@visactor/vtable-gantt 1.5.4
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/README.md +151 -0
- package/cjs/Gantt.d.ts +111 -0
- package/cjs/Gantt.js +244 -0
- package/cjs/Gantt.js.map +1 -0
- package/cjs/data/DataSource.d.ts +9 -0
- package/cjs/data/DataSource.js +30 -0
- package/cjs/data/DataSource.js.map +1 -0
- package/cjs/env.d.ts +19 -0
- package/cjs/env.js +48 -0
- package/cjs/env.js.map +1 -0
- package/cjs/event/EventHandler.d.ts +47 -0
- package/cjs/event/EventHandler.js +128 -0
- package/cjs/event/EventHandler.js.map +1 -0
- package/cjs/event/EventTarget.d.ts +12 -0
- package/cjs/event/EventTarget.js +67 -0
- package/cjs/event/EventTarget.js.map +1 -0
- package/cjs/event/event-manager.d.ts +15 -0
- package/cjs/event/event-manager.js +76 -0
- package/cjs/event/event-manager.js.map +1 -0
- package/cjs/event/scroll.d.ts +22 -0
- package/cjs/event/scroll.js +136 -0
- package/cjs/event/scroll.js.map +1 -0
- package/cjs/gantt-helper.d.ts +28 -0
- package/cjs/gantt-helper.js +225 -0
- package/cjs/gantt-helper.js.map +1 -0
- package/cjs/index.d.ts +7 -0
- package/cjs/index.js +48 -0
- package/cjs/index.js.map +1 -0
- package/cjs/register.d.ts +1 -0
- package/cjs/register.js +1 -0
- package/cjs/register.js.map +1 -0
- package/cjs/scenegraph/frame-border.d.ts +9 -0
- package/cjs/scenegraph/frame-border.js +42 -0
- package/cjs/scenegraph/frame-border.js.map +1 -0
- package/cjs/scenegraph/ganttNode.d.ts +7 -0
- package/cjs/scenegraph/ganttNode.js +16 -0
- package/cjs/scenegraph/ganttNode.js.map +1 -0
- package/cjs/scenegraph/grid.d.ts +30 -0
- package/cjs/scenegraph/grid.js +130 -0
- package/cjs/scenegraph/grid.js.map +1 -0
- package/cjs/scenegraph/mark-line.d.ts +15 -0
- package/cjs/scenegraph/mark-line.js +66 -0
- package/cjs/scenegraph/mark-line.js.map +1 -0
- package/cjs/scenegraph/scenegraph.d.ts +41 -0
- package/cjs/scenegraph/scenegraph.js +109 -0
- package/cjs/scenegraph/scenegraph.js.map +1 -0
- package/cjs/scenegraph/scroll-bar.d.ts +19 -0
- package/cjs/scenegraph/scroll-bar.js +150 -0
- package/cjs/scenegraph/scroll-bar.js.map +1 -0
- package/cjs/scenegraph/task-bar.d.ts +24 -0
- package/cjs/scenegraph/task-bar.js +188 -0
- package/cjs/scenegraph/task-bar.js.map +1 -0
- package/cjs/scenegraph/timeline-header.d.ts +10 -0
- package/cjs/scenegraph/timeline-header.js +134 -0
- package/cjs/scenegraph/timeline-header.js.map +1 -0
- package/cjs/state/gantt-table-sync.d.ts +7 -0
- package/cjs/state/gantt-table-sync.js +60 -0
- package/cjs/state/gantt-table-sync.js.map +1 -0
- package/cjs/state/state-manager.d.ts +58 -0
- package/cjs/state/state-manager.js +223 -0
- package/cjs/state/state-manager.js.map +1 -0
- package/cjs/themes.d.ts +1 -0
- package/cjs/themes.js +1 -0
- package/cjs/themes.js.map +1 -0
- package/cjs/tools/debounce.d.ts +1 -0
- package/cjs/tools/debounce.js +51 -0
- package/cjs/tools/debounce.js.map +1 -0
- package/cjs/tools/index.d.ts +2 -0
- package/cjs/tools/index.js +20 -0
- package/cjs/tools/index.js.map +1 -0
- package/cjs/tools/isx.d.ts +16 -0
- package/cjs/tools/isx.js +117 -0
- package/cjs/tools/isx.js.map +1 -0
- package/cjs/tools/pixel-ratio.d.ts +2 -0
- package/cjs/tools/pixel-ratio.js +16 -0
- package/cjs/tools/pixel-ratio.js.map +1 -0
- package/cjs/tools/util.d.ts +7 -0
- package/cjs/tools/util.js +87 -0
- package/cjs/tools/util.js.map +1 -0
- package/cjs/ts-types/EVENT_TYPE.d.ts +5 -0
- package/cjs/ts-types/EVENT_TYPE.js +9 -0
- package/cjs/ts-types/EVENT_TYPE.js.map +1 -0
- package/cjs/ts-types/common.d.ts +13 -0
- package/cjs/ts-types/common.js +14 -0
- package/cjs/ts-types/common.js.map +1 -0
- package/cjs/ts-types/events.d.ts +14 -0
- package/cjs/ts-types/events.js +6 -0
- package/cjs/ts-types/events.js.map +1 -0
- package/cjs/ts-types/gantt-engine.d.ts +163 -0
- package/cjs/ts-types/gantt-engine.js +6 -0
- package/cjs/ts-types/gantt-engine.js.map +1 -0
- package/cjs/ts-types/index.d.ts +4 -0
- package/cjs/ts-types/index.js +22 -0
- package/cjs/ts-types/index.js.map +1 -0
- package/dist/vtable-gantt.js +53942 -0
- package/dist/vtable-gantt.min.js +1 -0
- package/es/Gantt.d.ts +111 -0
- package/es/Gantt.js +246 -0
- package/es/Gantt.js.map +1 -0
- package/es/data/DataSource.d.ts +9 -0
- package/es/data/DataSource.js +22 -0
- package/es/data/DataSource.js.map +1 -0
- package/es/env.d.ts +19 -0
- package/es/env.js +42 -0
- package/es/env.js.map +1 -0
- package/es/event/EventHandler.d.ts +47 -0
- package/es/event/EventHandler.js +119 -0
- package/es/event/EventHandler.js.map +1 -0
- package/es/event/EventTarget.d.ts +12 -0
- package/es/event/EventTarget.js +58 -0
- package/es/event/EventTarget.js.map +1 -0
- package/es/event/event-manager.d.ts +15 -0
- package/es/event/event-manager.js +78 -0
- package/es/event/event-manager.js.map +1 -0
- package/es/event/scroll.d.ts +22 -0
- package/es/event/scroll.js +126 -0
- package/es/event/scroll.js.map +1 -0
- package/es/gantt-helper.d.ts +28 -0
- package/es/gantt-helper.js +220 -0
- package/es/gantt-helper.js.map +1 -0
- package/es/index.d.ts +7 -0
- package/es/index.js +10 -0
- package/es/index.js.map +1 -0
- package/es/register.d.ts +1 -0
- package/es/register.js +1 -0
- package/es/register.js.map +1 -0
- package/es/scenegraph/frame-border.d.ts +9 -0
- package/es/scenegraph/frame-border.js +34 -0
- package/es/scenegraph/frame-border.js.map +1 -0
- package/es/scenegraph/ganttNode.d.ts +7 -0
- package/es/scenegraph/ganttNode.js +8 -0
- package/es/scenegraph/ganttNode.js.map +1 -0
- package/es/scenegraph/grid.d.ts +30 -0
- package/es/scenegraph/grid.js +122 -0
- package/es/scenegraph/grid.js.map +1 -0
- package/es/scenegraph/mark-line.d.ts +15 -0
- package/es/scenegraph/mark-line.js +58 -0
- package/es/scenegraph/mark-line.js.map +1 -0
- package/es/scenegraph/scenegraph.d.ts +41 -0
- package/es/scenegraph/scenegraph.js +116 -0
- package/es/scenegraph/scenegraph.js.map +1 -0
- package/es/scenegraph/scroll-bar.d.ts +19 -0
- package/es/scenegraph/scroll-bar.js +144 -0
- package/es/scenegraph/scroll-bar.js.map +1 -0
- package/es/scenegraph/task-bar.d.ts +24 -0
- package/es/scenegraph/task-bar.js +188 -0
- package/es/scenegraph/task-bar.js.map +1 -0
- package/es/scenegraph/timeline-header.d.ts +10 -0
- package/es/scenegraph/timeline-header.js +130 -0
- package/es/scenegraph/timeline-header.js.map +1 -0
- package/es/state/gantt-table-sync.d.ts +7 -0
- package/es/state/gantt-table-sync.js +51 -0
- package/es/state/gantt-table-sync.js.map +1 -0
- package/es/state/state-manager.d.ts +58 -0
- package/es/state/state-manager.js +219 -0
- package/es/state/state-manager.js.map +1 -0
- package/es/themes.d.ts +1 -0
- package/es/themes.js +1 -0
- package/es/themes.js.map +1 -0
- package/es/tools/debounce.d.ts +1 -0
- package/es/tools/debounce.js +43 -0
- package/es/tools/debounce.js.map +1 -0
- package/es/tools/index.d.ts +2 -0
- package/es/tools/index.js +4 -0
- package/es/tools/index.js.map +1 -0
- package/es/tools/isx.d.ts +16 -0
- package/es/tools/isx.js +80 -0
- package/es/tools/isx.js.map +1 -0
- package/es/tools/pixel-ratio.d.ts +2 -0
- package/es/tools/pixel-ratio.js +12 -0
- package/es/tools/pixel-ratio.js.map +1 -0
- package/es/tools/util.d.ts +7 -0
- package/es/tools/util.js +78 -0
- package/es/tools/util.js.map +1 -0
- package/es/ts-types/EVENT_TYPE.d.ts +5 -0
- package/es/ts-types/EVENT_TYPE.js +5 -0
- package/es/ts-types/EVENT_TYPE.js.map +1 -0
- package/es/ts-types/common.d.ts +13 -0
- package/es/ts-types/common.js +13 -0
- package/es/ts-types/common.js.map +1 -0
- package/es/ts-types/events.d.ts +14 -0
- package/es/ts-types/events.js +2 -0
- package/es/ts-types/events.js.map +1 -0
- package/es/ts-types/gantt-engine.d.ts +163 -0
- package/es/ts-types/gantt-engine.js +2 -0
- package/es/ts-types/gantt-engine.js.map +1 -0
- package/es/ts-types/index.d.ts +4 -0
- package/es/ts-types/index.js +8 -0
- package/es/ts-types/index.js.map +1 -0
- package/package.json +122 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e(((t="undefined"!=typeof globalThis?globalThis:t||self).VTable=t.VTable||{},t.VTable.gantt={}))}(this,(function(t){"use strict";var e,i;!function(t){t.default="default",t.grabing="grabing",t.scrolling="scrolling"}(e||(e={})),function(t){t.single="single",t.column="column",t.row="row",t.cross="cross",t.none="none"}(i||(i={}));const o={SCROLL:"scroll",CHANGE_DATE_RANGE:"change_date_range"};var n=Object.freeze({__proto__:null,GANTT_EVENT_TYPE:o,get HighlightScope(){return i},get InteractionState(){return e}});class r{static GenAutoIncrementId(){return r.auto_increment_id++}}r.auto_increment_id=0;class s{constructor(t){this.id=r.GenAutoIncrementId(),this.registry=t}}const l="named",a="inject",h="multi_inject",d="inversify:tagged",c="inversify:paramtypes";class u{constructor(t,e){this.key=t,this.value=e}toString(){return this.key===l?`named: ${String(this.value).toString()} `:`tagged: { key:${this.key.toString()}, value: ${String(this.value)} }`}}var g=function(t){var e;return function(t){const e=Object.prototype.hasOwnProperty,i="function"==typeof Symbol,o=i&&void 0!==Symbol.toPrimitive?Symbol.toPrimitive:"@@toPrimitive",n=i&&void 0!==Symbol.iterator?Symbol.iterator:"@@iterator",r="function"==typeof Object.create,s={__proto__:[]}instanceof Array,l=!r&&!s,a={create:r?function(){return S(Object.create(null))}:s?function(){return S({__proto__:null})}:function(){return S({})},has:l?function(t,i){return e.call(t,i)}:function(t,e){return e in t},get:l?function(t,i){return e.call(t,i)?t[i]:void 0}:function(t,e){return t[e]}},h=Object.getPrototypeOf(Function),d="object"==typeof process&&process.env&&"true"===process.env.REFLECT_METADATA_USE_MAP_POLYFILL,c=d||"function"!=typeof Map||"function"!=typeof Map.prototype.entries?function(){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[n]=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 o=this._keys.length;for(let t=i+1;t<o;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,o)},e.prototype.values=function(){return new i(this._keys,this._values,r)},e.prototype.entries=function(){return new i(this._keys,this._values,s)},e.prototype["@@iterator"]=function(){return this.entries()},e.prototype[n]=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 o(t,e){return t}function r(t,e){return e}function s(t,e){return[t,e]}}():Map,u=(d||"function"!=typeof Set||"function"!=typeof Set.prototype.entries?function(){function t(){this._map=new c}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[n]=function(){return this.keys()}}():Set,new(d||"function"!=typeof WeakMap?function(){const t=16,i=a.create(),o=n();return function(){function t(){this._key=n()}return t.prototype.has=function(t){const e=r(t,!1);return void 0!==e&&a.has(e,this._key)},t.prototype.get=function(t){const e=r(t,!1);return void 0!==e?a.get(e,this._key):void 0},t.prototype.set=function(t,e){return r(t,!0)[this._key]=e,this},t.prototype.delete=function(t){const e=r(t,!1);return void 0!==e&&delete e[this._key]},t.prototype.clear=function(){this._key=n()},t}();function n(){let t;do{t="@@WeakMap@@"+l()}while(a.has(i,t));return i[t]=!0,t}function r(t,i){if(!e.call(t,o)){if(!i)return;Object.defineProperty(t,o,{value:a.create()})}return t[o]}function s(t,e){for(let i=0;i<e;++i)t[i]=255*Math.random()|0;return t}function l(){const e=(i=t,"function"==typeof Uint8Array?"undefined"!=typeof crypto?crypto.getRandomValues(new Uint8Array(i)):s(new Uint8Array(i),i):s(new Array(i),i));var i;e[6]=79&e[6]|64,e[8]=191&e[8]|128;let o="";for(let i=0;i<t;++i){const t=e[i];4!==i&&6!==i&&8!==i||(o+="-"),t<16&&(o+="0"),o+=t.toString(16).toLowerCase()}return o}}():WeakMap));function g(t,e,i){let o=u.get(t);if(b(o)){if(!i)return;o=new c,u.set(t,o)}let n=o.get(e);if(b(n)){if(!i)return;n=new c,o.set(e,n)}return n}function p(t,e,i){if(f(t,e,i))return!0;const o=_(e);return!v(o)&&p(t,o,i)}function f(t,e,i){const o=g(e,i,!1);return!b(o)&&!!o.has(t)}function m(t,e,i){if(f(t,e,i))return function(t,e,i){const o=g(e,i,!1);if(!b(o))return o.get(t)}(t,e,i);const o=_(e);return v(o)?void 0:m(t,o,i)}function b(t){return void 0===t}function v(t){return null===t}function y(t){return"object"==typeof t?null!==t:"function"==typeof t}function C(t,e){switch(function(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}}(t)){case 0:case 1:case 2:case 3:case 4:case 5:return t}const i=3===e?"string":5===e?"number":"default",n=function(t,e){const i=t[e];if(null!=i){if(!x(i))throw new TypeError;return i}}(t,o);if(void 0!==n){const e=n.call(t,i);if(y(e))throw new TypeError;return e}return function(t,e){if("string"===e){const e=t.toString;if(x(e)){const i=e.call(t);if(!y(i))return i}const i=t.valueOf;if(x(i)){const e=i.call(t);if(!y(e))return e}}else{const e=t.valueOf;if(x(e)){const i=e.call(t);if(!y(i))return i}const i=t.toString;if(x(i)){const e=i.call(t);if(!y(e))return e}}throw new TypeError}(t,"default"===i?"number":i)}function w(t){const e=C(t,3);return"symbol"==typeof e?e:function(t){return""+t}(e)}function x(t){return"function"==typeof t}function _(t){const e=Object.getPrototypeOf(t);if("function"!=typeof t||t===h)return e;if(e!==h)return e;const i=t.prototype,o=i&&Object.getPrototypeOf(i);if(null==o||o===Object.prototype)return e;const n=o.constructor;return"function"!=typeof n||n===t?e:n}function S(t){return t.__=void 0,delete t.__,t}t("defineMetadata",(function(t,e,i,o){if(!y(i))throw new TypeError;return n=t,r=e,void g(i,o,!0).set(n,r);var n,r})),t("hasMetadata",(function(t,e,i){if(!y(e))throw new TypeError;return b(i)||(i=w(i)),p(t,e,i)})),t("hasOwnMetadata",(function(t,e,i){if(!y(e))throw new TypeError;return b(i)||(i=w(i)),f(t,e,i)})),t("getMetadata",(function(t,e,i){if(!y(e))throw new TypeError;return b(i)||(i=w(i)),m(t,e,i)}))}((e=t,function(t,i){"function"!=typeof e[t]&&Object.defineProperty(e,t,{configurable:!0,writable:!0,value:i})})),t}({});function p(t,e,i,o){!function(t,e,i,o){const n=[o];let r={};g.hasOwnMetadata(t,e)&&(r=g.getMetadata(t,e));let s=r[i];void 0===s&&(s=[]),s.push(...n),r[i]=s,g.defineMetadata(t,r,e)}(d,t,i.toString(),o)}function f(t){return(e,i,o)=>{p(e,0,o,t)}}function m(t){return e=>(i,o,n)=>f(new u(t,e))(i,o,n)}const b=m(a),v=m(h);function y(){return function(t){return g.defineMetadata(c,null,t),t}}function C(t){return f(new u(l,t))}const w="Singleton",x="Transient",_="ConstantValue",S="DynamicValue",A="Factory",B="Function",R="Instance",M="Invalid";class T{constructor(t,e){this.id=r.GenAutoIncrementId(),this.activated=!1,this.serviceIdentifier=t,this.scope=e,this.type=M,this.constraint=t=>!0,this.implementationType=null,this.cache=null,this.factory=null,this.provider=null,this.dynamicValue=null}clone(){const t=new T(this.serviceIdentifier,this.scope);return t.activated=t.scope===w&&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 k{getConstructorMetadata(t){return{compilerGeneratedMetadata:g.getMetadata(c,t),userGeneratedMetadata:g.getMetadata(d,t)||{}}}getPropertiesMetadata(t){throw new Error("暂未实现")}}const P=(E=l,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 u(E,t),e});var E;class L{constructor(t){this._binding=t}inRequestScope(){throw new Error("暂未实现")}inSingletonScope(){return this._binding.scope=w,this}inTransientScope(){return this._binding.scope=x,this}whenTargetNamed(t){return this._binding.constraint=P(t),this}}class H{constructor(t){this._binding=t}to(t){return this._binding.type=R,this._binding.implementationType=t,new L(this._binding)}toSelf(){const t=this._binding.serviceIdentifier;return this.to(t)}toDynamicValue(t){return this._binding.type=S,this._binding.cache=null,this._binding.dynamicValue=t,this._binding.implementationType=null,new L(this._binding)}toConstantValue(t){return this._binding.type=_,this._binding.cache=t,this._binding.dynamicValue=null,this._binding.implementationType=null,this._binding.scope=w,new L(this._binding)}toFactory(t){return this._binding.type=A,this._binding.factory=t,this._binding.scope=w,new L(this._binding)}toService(t){this.toDynamicValue((e=>e.container.get(t)))}}const z=Symbol("ContributionProvider");class F{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 I(t,e){t(z).toDynamicValue((t=>{let{container:i}=t;return new F(e,i)})).inSingletonScope().whenTargetNamed(e)}class O{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 o;if("string"==typeof e)o={name:e.trim()};else if("object"!=typeof e||null===e)throw new Error("Invalid tap options");if("string"!=typeof o.name||""===o.name)throw new Error("Missing name for tap");return o=Object.assign({type:t,fn:i},o),o}_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 o=this.taps.length;for(;o>0;){o--;const t=this.taps[o];this.taps[o+1]=t;const n=t.stage||0;if(e){if(e.has(t.name)){e.delete(t.name);continue}if(e.size>0)continue}if(!(n>i)){o++;break}}this.taps[o]=t}}class D extends O{call(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];this.taps.map((t=>t.fn)).forEach((t=>t(...e)))}}const W=Symbol.for("EnvContribution"),N=Symbol.for("VGlobal");var G=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s},j=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},V=function(t,e){return function(i,o){e(i,o,t)}};let U=class{get env(){return this._env}get devicePixelRatio(){return this._env||this.setEnv("browser"),this.envContribution.getDevicePixelRatio()}get supportEvent(){return this._env||this.setEnv("browser"),this.envContribution.supportEvent}set supportEvent(t){this._env||this.setEnv("browser"),this.envContribution.supportEvent=t}get supportsTouchEvents(){return this._env||this.setEnv("browser"),this.envContribution.supportsTouchEvents}set supportsTouchEvents(t){this._env||this.setEnv("browser"),this.envContribution.supportsTouchEvents=t}get supportsPointerEvents(){return this._env||this.setEnv("browser"),this.envContribution.supportsPointerEvents}set supportsPointerEvents(t){this._env||this.setEnv("browser"),this.envContribution.supportsPointerEvents=t}get supportsMouseEvents(){return this._env||this.setEnv("browser"),this.envContribution.supportsMouseEvents}set supportsMouseEvents(t){this._env||this.setEnv("browser"),this.envContribution.supportsMouseEvents=t}get applyStyles(){return this._env||this.setEnv("browser"),this.envContribution.applyStyles}set applyStyles(t){this._env||this.setEnv("browser"),this.envContribution.applyStyles=t}constructor(t){this.contributions=t,this.id=r.GenAutoIncrementId(),this.hooks={onSetEnv:new D(["lastEnv","env","global"])},this.measureTextMethod="native",this.optimizeVisible=!1}bindContribution(t){const e=[];if(this.contributions.getContributions().forEach((i=>{const o=i.configure(this,t);o&&o.then&&e.push(o)})),e.length)return Promise.all(e)}getDynamicCanvasCount(){return this._env||this.setEnv("browser"),this.envContribution.getDynamicCanvasCount()}getStaticCanvasCount(){return this._env||this.setEnv("browser"),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 o=this.bindContribution(e);if(o&&o.then)return o.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("browser"),this.envContribution.createCanvas(t)}createOffscreenCanvas(t){return this._env||this.setEnv("browser"),this.envContribution.createOffscreenCanvas(t)}releaseCanvas(t){return this._env||this.setEnv("browser"),this.envContribution.releaseCanvas(t)}addEventListener(t,e,i){return this._env||this.setEnv("browser"),this.envContribution.addEventListener(t,e,i)}removeEventListener(t,e,i){return this._env||this.setEnv("browser"),this.envContribution.removeEventListener(t,e,i)}dispatchEvent(t){return this._env||this.setEnv("browser"),this.envContribution.dispatchEvent(t)}getRequestAnimationFrame(){return this._env||this.setEnv("browser"),this.envContribution.getRequestAnimationFrame()}getCancelAnimationFrame(){return this._env||this.setEnv("browser"),this.envContribution.getCancelAnimationFrame()}getElementById(t){return this._env||this.setEnv("browser"),this.envContribution.getElementById?this.envContribution.getElementById(t):null}getRootElement(){return this._env||this.setEnv("browser"),this.envContribution.getRootElement?this.envContribution.getRootElement():null}getDocument(){return this._env||this.setEnv("browser"),this.envContribution.getDocument?this.envContribution.getDocument():null}mapToCanvasPoint(t,e){return this._env||this.setEnv("browser"),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)}updateDom(t,e){return this._env||this.setEnv("browser"),this.envContribution.updateDom(t,e)}getElementTop(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this._env||this.setEnv("browser"),this.envContribution.getElementTop(t,e)}getElementLeft(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this._env||this.setEnv("browser"),this.envContribution.getElementLeft(t,e)}getElementTopLeft(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this._env||this.setEnv("browser"),this.envContribution.getElementTopLeft(t,e)}};function $(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}U=G([y(),V(0,b(z)),V(0,C(W)),j("design:paramtypes",[Object])],U);var X={exports:{}};!function(t){var e=Object.prototype.hasOwnProperty,i="~";function o(){}function n(t,e,i){this.fn=t,this.context=e,this.once=i||!1}function r(t,e,o,r,s){if("function"!=typeof o)throw new TypeError("The listener must be a function");var l=new n(o,r||t,s),a=i?i+e:e;return t._events[a]?t._events[a].fn?t._events[a]=[t._events[a],l]:t._events[a].push(l):(t._events[a]=l,t._eventsCount++),t}function s(t,e){0==--t._eventsCount?t._events=new o:delete t._events[e]}function l(){this._events=new o,this._eventsCount=0}Object.create&&(o.prototype=Object.create(null),(new o).__proto__||(i=!1)),l.prototype.eventNames=function(){var t,o,n=[];if(0===this._eventsCount)return n;for(o in t=this._events)e.call(t,o)&&n.push(i?o.slice(1):o);return Object.getOwnPropertySymbols?n.concat(Object.getOwnPropertySymbols(t)):n},l.prototype.listeners=function(t){var e=i?i+t:t,o=this._events[e];if(!o)return[];if(o.fn)return[o.fn];for(var n=0,r=o.length,s=new Array(r);n<r;n++)s[n]=o[n].fn;return s},l.prototype.listenerCount=function(t){var e=i?i+t:t,o=this._events[e];return o?o.fn?1:o.length:0},l.prototype.emit=function(t,e,o,n,r,s){var l=i?i+t:t;if(!this._events[l])return!1;var a,h,d=this._events[l],c=arguments.length;if(d.fn){switch(d.once&&this.removeListener(t,d.fn,void 0,!0),c){case 1:return d.fn.call(d.context),!0;case 2:return d.fn.call(d.context,e),!0;case 3:return d.fn.call(d.context,e,o),!0;case 4:return d.fn.call(d.context,e,o,n),!0;case 5:return d.fn.call(d.context,e,o,n,r),!0;case 6:return d.fn.call(d.context,e,o,n,r,s),!0}for(h=1,a=new Array(c-1);h<c;h++)a[h-1]=arguments[h];d.fn.apply(d.context,a)}else{var u,g=d.length;for(h=0;h<g;h++)switch(d[h].once&&this.removeListener(t,d[h].fn,void 0,!0),c){case 1:d[h].fn.call(d[h].context);break;case 2:d[h].fn.call(d[h].context,e);break;case 3:d[h].fn.call(d[h].context,e,o);break;case 4:d[h].fn.call(d[h].context,e,o,n);break;default:if(!a)for(u=1,a=new Array(c-1);u<c;u++)a[u-1]=arguments[u];d[h].fn.apply(d[h].context,a)}}return!0},l.prototype.on=function(t,e,i){return r(this,t,e,i,!1)},l.prototype.once=function(t,e,i){return r(this,t,e,i,!0)},l.prototype.removeListener=function(t,e,o,n){var r=i?i+t:t;if(!this._events[r])return this;if(!e)return s(this,r),this;var l=this._events[r];if(l.fn)l.fn!==e||n&&!l.once||o&&l.context!==o||s(this,r);else{for(var a=0,h=[],d=l.length;a<d;a++)(l[a].fn!==e||n&&!l[a].once||o&&l[a].context!==o)&&h.push(l[a]);h.length?this._events[r]=1===h.length?h[0]:h:s(this,r)}return this},l.prototype.removeAllListeners=function(t){var e;return t?(e=i?i+t:t,this._events[e]&&s(this,e)):(this._events=new o,this._eventsCount=0),this},l.prototype.off=l.prototype.removeListener,l.prototype.addListener=l.prototype.on,l.prefixed=i,l.EventEmitter=l,t.exports=l}(X);var Y=$(X.exports);var K=(t,e)=>Object.prototype.toString.call(t)===`[object ${e}]`;var q=function(t){return arguments.length>1&&void 0!==arguments[1]&&arguments[1]?"boolean"==typeof t:!0===t||!1===t||K(t,"Boolean")};var Z=t=>"function"==typeof t;var J=t=>null==t;var Q=t=>null!=t;var tt=t=>{const e=typeof t;return null!==t&&"object"===e||"function"===e};var et=t=>"object"==typeof t&&null!==t;var it=function(t){if(!et(t)||!K(t,"Object"))return!1;if(null===Object.getPrototypeOf(t))return!0;let e=t;for(;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e};var ot=t=>void 0===t;var nt=function(t){const e=typeof t;return arguments.length>1&&void 0!==arguments[1]&&arguments[1]?"string"===e:"string"===e||K(t,"String")};var rt=t=>Array.isArray?Array.isArray(t):K(t,"Array");var st=function(t){return null!==t&&"function"!=typeof t&&Number.isFinite(t.length)};var lt=t=>K(t,"Date");var at=function(t){const e=typeof t;return arguments.length>1&&void 0!==arguments[1]&&arguments[1]?"number"===e:"number"===e||K(t,"Number")};var ht=t=>at(t)&&Number.isFinite(t);var dt=t=>new RegExp(/^(http(s)?:\/\/)\w+[^\s]+(\.[^\s]+){1,}$/).test(t);var ct=t=>new RegExp(/^data:image\/(?:gif|png|jpeg|bmp|webp|svg\+xml)(?:;charset=utf-8)?;base64,(?:[A-Za-z0-9]|[+/])+={0,2}/g).test(t);var ut=t=>({}.toString.call(t).replace(/^\[object /,"").replace(/]$/,""));const gt=Object.prototype;var pt=function(t){const e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||gt)};const ft=Object.prototype.hasOwnProperty;function mt(t){if(J(t))return!0;if(st(t))return!t.length;const e=ut(t);if("Map"===e||"Set"===e)return!t.size;if(pt(t))return!Object.keys(t).length;for(const e in t)if(ft.call(t,e))return!1;return!0}var bt=(t,e,i)=>{const o=nt(e)?e.split("."):e;for(let e=0;e<o.length;e++)t=t?t[o[e]]:void 0;return void 0===t?i:t};const vt=Object.prototype.hasOwnProperty;var yt=(t,e)=>null!=t&&vt.call(t,e);function Ct(t){let e;if(!Q(t)||"object"!=typeof t)return t;const i=rt(t),o=t.length;e=i?new Array(o):"object"==typeof t?{}:q(t)||at(t)||nt(t)?t:lt(t)?new Date(+t):void 0;const n=i?void 0:Object.keys(Object(t));let r=-1;if(e)for(;++r<(n||t).length;){const i=n?n[r]:r,o=t[i];e[i]=Ct(o)}return e}function wt(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(e){if(t===e)return;if(Q(e)&&"object"==typeof e){const o=Object(e),n=[];for(const t in o)n.push(t);let{length:r}=n,s=-1;for(;r--;){const r=n[++s];Q(o[r])&&"object"==typeof o[r]?xt(t,e,r,i):_t(t,r,o[r])}}}}function xt(t,e,i){let o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const n=t[i],r=e[i];let s=e[i],l=!0;if(rt(r)){if(o)s=[];else if(rt(n))s=n;else if(st(n)){s=new Array(n.length);let t=-1;const e=n.length;for(;++t<e;)s[t]=n[t]}}else it(r)?(s=n,"function"!=typeof n&&"object"==typeof n||(s={})):l=!1;l&&wt(s,r,o),_t(t,i,s)}function _t(t,e,i){(void 0!==i&&!function(t,e){return t===e||Number.isNaN(t)&&Number.isNaN(e)}(t[e],i)||void 0===i&&!(e in t))&&(t[e]=i)}function St(t){let e=-1;const i=arguments.length<=1?0:arguments.length-1;for(;++e<i;)wt(t,e+1<1||arguments.length<=e+1?void 0:arguments[e+1],!0);return t}function At(t){return Object.prototype.toString.call(t)}function Bt(t){return Object.keys(t)}function Rt(t,e,i){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(null==t||null==e)return!1;if(Number.isNaN(t)&&Number.isNaN(e))return!0;if(At(t)!==At(e))return!1;if(Z(t))return!!(null==i?void 0:i.skipFunction);if("object"!=typeof t)return!1;if(rt(t)){if(t.length!==e.length)return!1;for(let o=t.length-1;o>=0;o--)if(!Rt(t[o],e[o],i))return!1;return!0}if(!it(t))return!1;const o=Bt(t),n=Bt(e);if(o.length!==n.length)return!1;o.sort(),n.sort();for(let t=o.length-1;t>=0;t--)if(o[t]!=n[t])return!1;for(let n=o.length-1;n>=0;n--){const r=o[n];if(!Rt(t[r],e[r],i))return!1}return!0}function Mt(t,e,i){const o=function(t){if(!t)return[];if(Object.keys)return Object.keys(t);const e=[];for(const i in t)t.hasOwnProperty(i)&&e.push(i);return e}(e);for(let n=0;n<o.length;n++){const r=o[n];(i?null!=e[r]:null==t[r])&&(t[r]=e[r])}return t}function Tt(t){return Q(t)?rt(t)?t:[t]:[]}function kt(t){if(st(t))return t[t.length-1]}const Pt=(t,e)=>{var i;if(0===t.length)return;let o=t[0];for(let n=1;n<t.length;n++){const r=t[n];(null!==(i=null==e?void 0:e(r,o))&&void 0!==i?i:r-o>0)&&(o=r)}return o},Et=(t,e)=>{var i;if(0===t.length)return;let o=t[0];for(let n=1;n<t.length;n++){const r=t[n];(null!==(i=null==e?void 0:e(r,o))&&void 0!==i?i:r-o<0)&&(o=r)}return o};function Lt(t,e){if(!rt(t)||!rt(e))return!1;if(t.length!==e.length)return!1;for(let i=0;i<t.length;i++)if(t[i]!==e[i])return!1;return!0}function Ht(t){if(!rt(t))return[t];const e=[];for(const i of t)e.push(...Ht(i));return e}function zt(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function Ft(t){return Number(t)}const It="undefined"!=typeof console;function Ot(t,e,i){const o=[e].concat([].slice.call(i));It&&console[t].apply(console,o)}var Dt;!function(t){t[t.None=0]="None",t[t.Error=1]="Error",t[t.Warn=2]="Warn",t[t.Info=3]="Info",t[t.Debug=4]="Debug"}(Dt||(Dt={}));class Wt{static getInstance(t,e){return Wt._instance&&at(t)?Wt._instance.level(t):Wt._instance||(Wt._instance=new Wt(t,e)),Wt._instance}static setInstance(t){return Wt._instance=t}static setInstanceLevel(t){Wt._instance?Wt._instance.level(t):Wt._instance=new Wt(t)}static clearInstance(){Wt._instance=null}constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Dt.None,e=arguments.length>1?arguments[1]:void 0;this._onErrorHandler=[],this._level=t,this._method=e}addErrorHandler(t){this._onErrorHandler.find((e=>e===t))||this._onErrorHandler.push(t)}removeErrorHandler(t){const e=this._onErrorHandler.findIndex((e=>e===t));e<0||this._onErrorHandler.splice(e,1)}callErrorHandler(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];this._onErrorHandler.forEach((t=>t(...e)))}canLogInfo(){return this._level>=Dt.Info}canLogDebug(){return this._level>=Dt.Debug}canLogError(){return this._level>=Dt.Error}canLogWarn(){return this._level>=Dt.Warn}level(t){return arguments.length?(this._level=+t,this):this._level}error(){for(var t,e=arguments.length,i=new Array(e),o=0;o<e;o++)i[o]=arguments[o];return this._level>=Dt.Error&&(this._onErrorHandler.length?this.callErrorHandler(...i):Ot(null!==(t=this._method)&&void 0!==t?t:"error","ERROR",i)),this}warn(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return this._level>=Dt.Warn&&Ot(this._method||"warn","WARN",e),this}info(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return this._level>=Dt.Info&&Ot(this._method||"log","INFO",e),this}debug(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return this._level>=Dt.Debug&&Ot(this._method||"log","DEBUG",e),this}}Wt._instance=null;const Nt=1e-10,Gt=1e-10;function jt(t,e){const i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Nt,o=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:Gt)*Math.max(t,e);return Math.abs(t-e)<=Math.max(i,o)}function Vt(t,e,i,o){return t>e&&!jt(t,e,i,o)}function Ut(t,e,i,o){return t<e&&!jt(t,e,i,o)}const $t=t=>{let e=null,i=null;return function(){for(var o=arguments.length,n=new Array(o),r=0;r<o;r++)n[r]=arguments[r];return e&&n.every(((t,i)=>t===e[i]))||(e=n,i=t(...n)),i}};var Xt=function(t,e,i){return t<e?e:t>i?i:t};var Yt=(t,e,i)=>{let[o,n]=t;n<o&&(o=t[1],n=t[0]);const r=n-o;return r>=i-e?[e,i]:(o=Math.min(Math.max(o,e),i-r),[o,o+r])};function Kt(t,e){let i;return t>e&&(i=t,t=e,e=i),i=>Math.max(t,Math.min(e,i))}let qt=!1;try{qt="function"==typeof requestAnimationFrame&&"function"==typeof cancelAnimationFrame}catch(t){qt=!1}function Zt(t,e,i){let o,n,r,s,l,a,h=0,d=!1,c=!1,u=!0;const g=!e&&0!==e&&qt;if("function"!=typeof t)throw new TypeError("Expected a function");function p(e){const i=o,r=n;return o=n=void 0,h=e,s=t.apply(r,i),s}function f(t,e){return g?(cancelAnimationFrame(l),requestAnimationFrame(t)):setTimeout(t,e)}function m(t){const i=t-a;return void 0===a||i>=e||i<0||c&&t-h>=r}function b(){const t=Date.now();if(m(t))return v(t);l=f(b,function(t){const i=t-h,o=e-(t-a);return c?Math.min(o,r-i):o}(t))}function v(t){return l=void 0,u&&o?p(t):(o=n=void 0,s)}function y(){const t=Date.now(),i=m(t);for(var r=arguments.length,u=new Array(r),g=0;g<r;g++)u[g]=arguments[g];if(o=u,n=this,a=t,i){if(void 0===l)return function(t){return h=t,l=f(b,e),d?p(t):s}(a);if(c)return l=f(b,e),p(a)}return void 0===l&&(l=f(b,e)),s}return e=+e||0,tt(i)&&(d=!!i.leading,c="maxWait"in i,c&&(r=Math.max(ht(i.maxWait)?i.maxWait:0,e)),u="trailing"in i?!!i.trailing:u),y.cancel=function(){void 0!==l&&function(t){if(g)return cancelAnimationFrame(t);clearTimeout(t)}(l),h=0,o=a=n=l=void 0},y.flush=function(){return void 0===l?s:v(Date.now())},y.pending=function(){return void 0!==l},y}function Jt(t,e){return i=>t*(1-i)+e*i}function Qt(t,e){return function(i){return Math.round(t*(1-i)+e*i)}}qt=!1;const te=1e-12,ee=Math.PI,ie=ee/2,oe=2*ee,ne=2*Math.PI,re=Math.abs,se=Math.atan2,le=Math.cos,ae=Math.max,he=Math.min,de=Math.sin,ce=Math.sqrt,ue=Math.pow;function ge(t){return t>1?0:t<-1?ee:Math.acos(t)}function pe(t){return t>=1?ie:t<=-1?-ie:Math.asin(t)}function fe(t,e,i,o,n){let r,s;return"number"==typeof t&&"number"==typeof i&&(r=(1-n)*t+n*i),"number"==typeof e&&"number"==typeof o&&(s=(1-n)*e+n*o),{x:r,y:s}}class me{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2?arguments[2]:void 0,o=arguments.length>3?arguments[3]:void 0;this.x=0,this.y=0,this.x=t,this.y=e,this.x1=i,this.y1=o}clone(){return new me(this.x,this.y)}copyFrom(t){return this.x=t.x,this.y=t.y,this.x1=t.x1,this.y1=t.y1,this.defined=t.defined,this.context=t.context,this}set(t,e){return this.x=t,this.y=e,this}add(t){return at(t)?(this.x+=t,void(this.y+=t)):(this.x+=t.x,this.y+=t.y,this)}sub(t){return at(t)?(this.x-=t,void(this.y-=t)):(this.x-=t.x,this.y-=t.y,this)}multi(t){throw new Error("暂不支持")}div(t){throw new Error("暂不支持")}}class be{static distancePP(t,e){return ce(ue(t.x-e.x,2)+ue(t.y-e.y,2))}static distanceNN(t,e,i,o){return ce(ue(t-i,2)+ue(e-o,2))}static distancePN(t,e,i){return ce(ue(e-t.x,2)+ue(i-t.y,2))}static pointAtPP(t,e,i){return new me((e.x-t.x)*i+t.x,(e.y-t.y)*i+t.y)}}function ve(t,e,i){const{x1:o,y1:n,x2:r,y2:s}=e;return i.onlyTranslate()?(t!==e&&t.setValue(e.x1,e.y1,e.x2,e.y2),t.translate(i.e,i.f),e):(t.clear(),t.add(i.a*o+i.c*n+i.e,i.b*o+i.d*n+i.f),t.add(i.a*r+i.c*n+i.e,i.b*r+i.d*n+i.f),t.add(i.a*r+i.c*s+i.e,i.b*r+i.d*s+i.f),t.add(i.a*o+i.c*s+i.e,i.b*o+i.d*s+i.f),e)}class ye{constructor(t){t?this.setValue(t.x1,t.y1,t.x2,t.y2):this.clear()}clone(){return new ye(this)}clear(){return this.x1=+Number.MAX_VALUE,this.y1=+Number.MAX_VALUE,this.x2=-Number.MAX_VALUE,this.y2=-Number.MAX_VALUE,this}empty(){return this.x1===+Number.MAX_VALUE&&this.y1===+Number.MAX_VALUE&&this.x2===-Number.MAX_VALUE&&this.y2===-Number.MAX_VALUE}equals(t){return this.x1===t.x1&&this.y1===t.y1&&this.x2===t.x2&&this.y2===t.y2}setValue(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return this.x1=t,this.y1=e,this.x2=i,this.y2=o,this}set(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return i<t?(this.x2=t,this.x1=i):(this.x1=t,this.x2=i),o<e?(this.y2=e,this.y1=o):(this.y1=e,this.y2=o),this}add(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return t<this.x1&&(this.x1=t),e<this.y1&&(this.y1=e),t>this.x2&&(this.x2=t),e>this.y2&&(this.y2=e),this}expand(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return rt(t)?(this.y1-=t[0],this.x2+=t[1],this.y2+=t[2],this.x1-=t[3]):(this.x1-=t,this.y1-=t,this.x2+=t,this.y2+=t),this}round(){return this.x1=Math.floor(this.x1),this.y1=Math.floor(this.y1),this.x2=Math.ceil(this.x2),this.y2=Math.ceil(this.y2),this}translate(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.x1+=t,this.x2+=t,this.y1+=e,this.y2+=e,this}rotate(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;const o=this.rotatedPoints(t,e,i);return this.clear().add(o[0],o[1]).add(o[2],o[3]).add(o[4],o[5]).add(o[6],o[7])}scale(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;const n=this.scalePoints(t,e,i,o);return this.clear().add(n[0],n[1]).add(n[2],n[3])}union(t){return t.x1<this.x1&&(this.x1=t.x1),t.y1<this.y1&&(this.y1=t.y1),t.x2>this.x2&&(this.x2=t.x2),t.y2>this.y2&&(this.y2=t.y2),this}intersect(t){return t.x1>this.x1&&(this.x1=t.x1),t.y1>this.y1&&(this.y1=t.y1),t.x2<this.x2&&(this.x2=t.x2),t.y2<this.y2&&(this.y2=t.y2),this}encloses(t){return t&&this.x1<=t.x1&&this.x2>=t.x2&&this.y1<=t.y1&&this.y2>=t.y2}alignsWith(t){return t&&(this.x1===t.x1||this.x2===t.x2||this.y1===t.y1||this.y2===t.y2)}intersects(t){return t&&!(this.x2<t.x1||this.x1>t.x2||this.y2<t.y1||this.y1>t.y2)}contains(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return!(t<this.x1||t>this.x2||e<this.y1||e>this.y2)}containsPoint(t){return!(t.x<this.x1||t.x>this.x2||t.y<this.y1||t.y>this.y2)}width(){return this.empty()?0:this.x2-this.x1}height(){return this.empty()?0:this.y2-this.y1}scaleX(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this.x1*=t,this.x2*=t,this}scaleY(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this.y1*=t,this.y2*=t,this}transformWithMatrix(t){return ve(this,this,t),this}copy(t){return this.x1=t.x1,this.y1=t.y1,this.x2=t.x2,this.y2=t.y2,this}rotatedPoints(t,e,i){const{x1:o,y1:n,x2:r,y2:s}=this,l=Math.cos(t),a=Math.sin(t),h=e-e*l+i*a,d=i-e*a-i*l;return[l*o-a*n+h,a*o+l*n+d,l*o-a*s+h,a*o+l*s+d,l*r-a*n+h,a*r+l*n+d,l*r-a*s+h,a*r+l*s+d]}scalePoints(t,e,i,o){const{x1:n,y1:r,x2:s,y2:l}=this;return[t*n+(1-t)*i,e*r+(1-e)*o,t*s+(1-t)*i,e*l+(1-e)*o]}}class Ce extends ye{}function we(t){return t*(Math.PI/180)}const xe=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if(t<0)for(;t<-oe;)t+=oe;else if(t>0)for(;t>oe;)t-=oe;return t};function _e(t){for(;t<0;)t+=2*Math.PI;for(;t>=2*Math.PI;)t-=2*Math.PI;return t}class Se{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;this.a=t,this.b=e,this.c=i,this.d=o,this.e=n,this.f=r}equalToMatrix(t){return!(this.e!==t.e||this.f!==t.f||this.a!==t.a||this.d!==t.d||this.b!==t.b||this.c!==t.c)}equalTo(t,e,i,o,n,r){return!(this.e!==n||this.f!==r||this.a!==t||this.d!==o||this.b!==e||this.c!==i)}setValue(t,e,i,o,n,r){return this.a=t,this.b=e,this.c=i,this.d=o,this.e=n,this.f=r,this}reset(){return this.a=1,this.b=0,this.c=0,this.d=1,this.e=0,this.f=0,this}getInverse(){const t=this.a,e=this.b,i=this.c,o=this.d,n=this.e,r=this.f,s=new Se,l=t*o-e*i;return s.a=o/l,s.b=-e/l,s.c=-i/l,s.d=t/l,s.e=(i*r-o*n)/l,s.f=-(t*r-e*n)/l,s}rotate(t){const e=Math.cos(t),i=Math.sin(t),o=this.a*e+this.c*i,n=this.b*e+this.d*i,r=this.a*-i+this.c*e,s=this.b*-i+this.d*e;return this.a=o,this.b=n,this.c=r,this.d=s,this}rotateByCenter(t,e,i){const o=Math.cos(t),n=Math.sin(t),r=(1-o)*e+n*i,s=(1-o)*i-n*e,l=o*this.a-n*this.b,a=n*this.a+o*this.b,h=o*this.c-n*this.d,d=n*this.c+o*this.d,c=o*this.e-n*this.f+r,u=n*this.e+o*this.f+s;return this.a=l,this.b=a,this.c=h,this.d=d,this.e=c,this.f=u,this}scale(t,e){return this.a*=t,this.b*=t,this.c*=e,this.d*=e,this}setScale(t,e){return this.b=this.b/this.a*t,this.c=this.c/this.d*e,this.a=t,this.d=e,this}transform(t,e,i,o,n,r){return this.multiply(t,e,i,o,n,r),this}translate(t,e){return this.e+=this.a*t+this.c*e,this.f+=this.b*t+this.d*e,this}transpose(){const{a:t,b:e,c:i,d:o,e:n,f:r}=this;return this.a=e,this.b=t,this.c=o,this.d=i,this.e=r,this.f=n,this}multiply(t,e,i,o,n,r){const s=this.a,l=this.b,a=this.c,h=this.d,d=s*t+a*e,c=l*t+h*e,u=s*i+a*o,g=l*i+h*o,p=s*n+a*r+this.e,f=l*n+h*r+this.f;return this.a=d,this.b=c,this.c=u,this.d=g,this.e=p,this.f=f,this}interpolate(t,e){const i=new Se;return i.a=this.a+(t.a-this.a)*e,i.b=this.b+(t.b-this.b)*e,i.c=this.c+(t.c-this.c)*e,i.d=this.d+(t.d-this.d)*e,i.e=this.e+(t.e-this.e)*e,i.f=this.f+(t.f-this.f)*e,i}transformPoint(t,e){const{a:i,b:o,c:n,d:r,e:s,f:l}=this,a=i*r-o*n,h=r/a,d=-o/a,c=-n/a,u=i/a,g=(n*l-r*s)/a,p=-(i*l-o*s)/a,{x:f,y:m}=t;e.x=f*h+m*c+g,e.y=f*d+m*u+p}onlyTranslate(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return this.a===t&&0===this.b&&0===this.c&&this.d===t}clone(){return new Se(this.a,this.b,this.c,this.d,this.e,this.f)}toTransformAttrs(){const t=this.a,e=this.b,i=this.c,o=this.d,n=t*o-e*i,r={x:this.e,y:this.f,rotateDeg:0,scaleX:0,scaleY:0,skewX:0,skewY:0};if(0!==t||0!==e){const s=Math.sqrt(t*t+e*e);r.rotateDeg=e>0?Math.acos(t/s):-Math.acos(t/s),r.scaleX=s,r.scaleY=n/s,r.skewX=(t*i+e*o)/n,r.skewY=0}else if(0!==i||0!==o){const s=Math.sqrt(i*i+o*o);r.rotateDeg=Math.PI/2-(o>0?Math.acos(-i/s):-Math.acos(i/s)),r.scaleX=n/s,r.scaleY=s,r.skewX=0,r.skewY=(t*i+e*o)/n}return r.rotateDeg=180*r.rotateDeg/Math.PI,r}}class Ae{constructor(){this.CLEAN_THRESHOLD=1e3,this.L_TIME=1e3,this.R_COUNT=1,this.R_TIMESTAMP_MAX_SIZE=20}clearCache(t,e){const{CLEAN_THRESHOLD:i=this.CLEAN_THRESHOLD,L_TIME:o=this.L_TIME,R_COUNT:n=this.R_COUNT}=e;if(t.size<i)return 0;let r=0;const s=e=>{r++,t.delete(e)},l=Date.now();return t.forEach(((t,e)=>{if(t.timestamp.length<n)return s(e);let i=0;for(;l-t.timestamp[t.timestamp.length-1-i]<o&&(i++,!(i>=n)););if(i<n)return s(e);for(;l-t.timestamp[0]>o;)t.timestamp.shift()})),r}addLimitedTimestamp(t,e,i){const{R_TIMESTAMP_MAX_SIZE:o=this.R_TIMESTAMP_MAX_SIZE}=i;t.timestamp.length>o&&t.timestamp.shift(),t.timestamp.push(e)}clearTimeStamp(t,e){const{L_TIME:i=this.L_TIME}=e,o=Date.now();t.forEach((t=>{for(;o-t.timestamp[0]>i;)t.timestamp.shift()}))}clearItemTimestamp(t,e){const{L_TIME:i=this.L_TIME}=e,o=Date.now();for(;o-t.timestamp[0]>i;)t.timestamp.shift()}}function Be(t,e,i){e/=100,i/=100;const o=(1-Math.abs(2*i-1))*e,n=o*(1-Math.abs(t/60%2-1)),r=i-o/2;let s=0,l=0,a=0;return 0<=t&&t<60?(s=o,l=n,a=0):60<=t&&t<120?(s=n,l=o,a=0):120<=t&&t<180?(s=0,l=o,a=n):180<=t&&t<240?(s=0,l=n,a=o):240<=t&&t<300?(s=n,l=0,a=o):300<=t&&t<360&&(s=o,l=0,a=n),s=Math.round(255*(s+r)),l=Math.round(255*(l+r)),a=Math.round(255*(a+r)),{r:s,g:l,b:a}}function Re(t,e,i){t/=255,e/=255,i/=255;const o=Math.min(t,e,i),n=Math.max(t,e,i),r=n-o;let s=0,l=0,a=0;return s=0===r?0:n===t?(e-i)/r%6:n===e?(i-t)/r+2:(t-e)/r+4,s=Math.round(60*s),s<0&&(s+=360),a=(n+o)/2,l=0===r?0:r/(1-Math.abs(2*a-1)),l=+(100*l).toFixed(1),a=+(100*a).toFixed(1),{h:s,s:l,l:a}}const Me=/^#([0-9a-f]{3,8})$/,Te={transparent:4294967040},ke={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function Pe(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function Ee(t){return at(t)?new Fe(t>>16,t>>8&255,255&t,1):rt(t)?new Fe(t[0],t[1],t[2]):new Fe(255,255,255)}function Le(t){return t<.04045?.0773993808*t:Math.pow(.9478672986*t+.0521327014,2.4)}function He(t){return t<.0031308?12.92*t:1.055*Math.pow(t,.41666)-.055}class ze{static Brighter(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return 1===e?t:new ze(t).brighter(e).toRGBA()}static SetOpacity(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return 1===e?t:new ze(t).setOpacity(e).toRGBA()}static getColorBrightness(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"hsl";const i=t instanceof ze?t:new ze(t);switch(e){case"hsv":default:return i.getHSVBrightness();case"hsl":return i.getHSLBrightness();case"lum":return i.getLuminance();case"lum2":return i.getLuminance2();case"lum3":return i.getLuminance3()}}static parseColorString(t){if(Q(Te[t]))return function(t){return at(t)?new Fe(t>>>24,t>>>16&255,t>>>8&255,255&t):rt(t)?new Fe(t[0],t[1],t[2],t[3]):new Fe(255,255,255,1)}(Te[t]);if(Q(ke[t]))return Ee(ke[t]);const e=`${t}`.trim().toLowerCase(),i=Me.exec(e);if(i){const t=parseInt(i[1],16),e=i[1].length;return 3===e?new Fe((t>>8&15)+((t>>8&15)<<4),(t>>4&15)+((t>>4&15)<<4),(15&t)+((15&t)<<4),1):6===e?Ee(t):8===e?new Fe(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):void 0}if(/^(rgb|RGB|rgba|RGBA)/.test(e)){const t=e.replace(/(?:\(|\)|rgba|RGBA|rgb|RGB)*/g,"").split(",");return new Fe(parseInt(t[0],10),parseInt(t[1],10),parseInt(t[2],10),parseFloat(t[3]))}if(/^(hsl|HSL|hsla|HSLA)/.test(e)){const t=e.replace(/(?:\(|\)|hsla|HSLA|hsl|HSL)*/g,"").split(","),i=Be(parseInt(t[0],10),parseInt(t[1],10),parseInt(t[2],10));return new Fe(i.r,i.g,i.b,parseFloat(t[3]))}}constructor(t){const e=ze.parseColorString(t);this.color=e||new Fe(255,255,255)}toRGBA(){return this.color.formatRgb()}toString(){return this.color.formatRgb()}toHex(){return this.color.formatHex()}toHsl(){return this.color.formatHsl()}brighter(t){const{r:e,g:i,b:o}=this.color;return this.color.r=Math.max(0,Math.min(255,Math.floor(e*t))),this.color.g=Math.max(0,Math.min(255,Math.floor(i*t))),this.color.b=Math.max(0,Math.min(255,Math.floor(o*t))),this}add(t){const{r:e,g:i,b:o}=this.color;return this.color.r+=Math.min(255,e+t.color.r),this.color.g+=Math.min(255,i+t.color.g),this.color.b+=Math.min(255,o+t.color.b),this}sub(t){return this.color.r=Math.max(0,this.color.r-t.color.r),this.color.g=Math.max(0,this.color.g-t.color.g),this.color.b=Math.max(0,this.color.b-t.color.b),this}multiply(t){const{r:e,g:i,b:o}=this.color;return this.color.r=Math.max(0,Math.min(255,Math.floor(e*t.color.r))),this.color.g=Math.max(0,Math.min(255,Math.floor(i*t.color.g))),this.color.b=Math.max(0,Math.min(255,Math.floor(o*t.color.b))),this}getHSVBrightness(){return Math.max(this.color.r,this.color.g,this.color.b)/255}getHSLBrightness(){return.5*(Math.max(this.color.r,this.color.g,this.color.b)/255+Math.min(this.color.r,this.color.g,this.color.b)/255)}setHsl(t,e,i){const o=this.color.opacity,n=Re(this.color.r,this.color.g,this.color.b),r=Be(J(t)?n.h:Xt(t,0,360),J(e)?n.s:e>=0&&e<=1?100*e:e,J(i)?n.l:i<=1&&i>=0?100*i:i);return this.color=new Fe(r.r,r.g,r.b,o),this}setRGB(t,e,i){return!J(t)&&(this.color.r=t),!J(e)&&(this.color.g=e),!J(i)&&(this.color.b=i),this}setHex(t){const e=`${t}`.trim().toLowerCase(),i=Me.exec(e),o=parseInt(i[1],16),n=i[1].length;return 3===n?new Fe((o>>8&15)+((o>>8&15)<<4),(o>>4&15)+((o>>4&15)<<4),(15&o)+((15&o)<<4),1):6===n?Ee(o):8===n?new Fe(o>>24&255,o>>16&255,o>>8&255,(255&o)/255):this}setColorName(t){const e=ke[t.toLowerCase()];return void 0!==e&&this.setHex(e),this}setScalar(t){return this.color.r=t,this.color.g=t,this.color.b=t,this}setOpacity(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return this.color.opacity=t,this}getLuminance(){return(.2126*this.color.r+.7152*this.color.g+.0722*this.color.b)/255}getLuminance2(){return(.2627*this.color.r+.678*this.color.g+.0593*this.color.b)/255}getLuminance3(){return(.299*this.color.r+.587*this.color.g+.114*this.color.b)/255}clone(){return new ze(this.color.toString())}copyGammaToLinear(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;return this.color.r=Math.pow(t.color.r,e),this.color.g=Math.pow(t.color.g,e),this.color.b=Math.pow(t.color.b,e),this}copyLinearToGamma(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;const i=e>0?1/e:1;return this.color.r=Math.pow(t.color.r,i),this.color.g=Math.pow(t.color.g,i),this.color.b=Math.pow(t.color.b,i),this}convertGammaToLinear(t){return this.copyGammaToLinear(this,t),this}convertLinearToGamma(t){return this.copyLinearToGamma(this,t),this}copySRGBToLinear(t){return this.color.r=Le(t.color.r),this.color.g=Le(t.color.g),this.color.b=Le(t.color.b),this}copyLinearToSRGB(t){return this.color.r=He(t.color.r),this.color.g=He(t.color.g),this.color.b=He(t.color.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}}class Fe{constructor(t,e,i,o){this.r=isNaN(+t)?255:Math.max(0,Math.min(255,+t)),this.g=isNaN(+e)?255:Math.max(0,Math.min(255,+e)),this.b=isNaN(+i)?255:Math.max(0,Math.min(255,+i)),Q(o)?this.opacity=isNaN(+o)?1:Math.max(0,Math.min(1,+o)):this.opacity=1}formatHex(){return`#${Pe(this.r)+Pe(this.g)+Pe(this.b)+(1===this.opacity?"":Pe(255*this.opacity))}`}formatRgb(){const t=this.opacity;return`${1===t?"rgb(":"rgba("}${this.r},${this.g},${this.b}${1===t?")":`,${t})`}`}formatHsl(){const t=this.opacity,{h:e,s:i,l:o}=Re(this.r,this.g,this.b);return`${1===t?"hsl(":"hsla("}${e},${i}%,${o}%${1===t?")":`,${t})`}`}toString(){return this.formatHex()}}var Ie=Object.freeze({__proto__:null,Color:ze,DEFAULT_COLORS:ke,RGB:Fe,hexToRgb:function(t){let e="",i="",o="";const n="#"===t[0]?1:0;for(let r=n;r<t.length;r++)"#"!==t[r]&&(r<n+2?e+=t[r]:r<n+4?i+=t[r]:r<n+6&&(o+=t[r]));return[parseInt(e,16),parseInt(i,16),parseInt(o,16)]},hslToRgb:Be,interpolateRgb:function(t,e){const i=t.r,o=e.r,n=t.g,r=e.g,s=t.b,l=e.b,a=t.opacity,h=e.opacity;return t=>{const e=Math.round(i*(1-t)+o*t),d=Math.round(n*(1-t)+r*t),c=Math.round(s*(1-t)+l*t);return new Fe(e,d,c,a*(1-t)+h*t)}},rgbToHex:function(t,e,i){return Number((1<<24)+(t<<16)+(e<<8)+i).toString(16).slice(1)},rgbToHsl:Re});let Oe,De,We,Ne,Ge,je,Ve,Ue;function $e(t,e,i){return null===t?e:null===e?t:(Oe=t.x1,De=t.x2,We=t.y1,Ne=t.y2,Ge=e.x1,je=e.x2,Ve=e.y1,Ue=e.y2,i&&(Oe>De&&([Oe,De]=[De,Oe]),We>Ne&&([We,Ne]=[Ne,We]),Ge>je&&([Ge,je]=[je,Ge]),Ve>Ue&&([Ve,Ue]=[Ue,Ve])),Oe>=je||De<=Ge||We>=Ue||Ne<=Ve?{x1:0,y1:0,x2:0,y2:0}:{x1:Math.max(Oe,Ge),y1:Math.max(We,Ve),x2:Math.min(De,je),y2:Math.min(Ne,Ue)})}var Xe;function Ye(t,e,i){return!(t&&e&&(i?(Oe=t.x1,De=t.x2,We=t.y1,Ne=t.y2,Ge=e.x1,je=e.x2,Ve=e.y1,Ue=e.y2,Oe>De&&([Oe,De]=[De,Oe]),We>Ne&&([We,Ne]=[Ne,We]),Ge>je&&([Ge,je]=[je,Ge]),Ve>Ue&&([Ve,Ue]=[Ue,Ve]),Oe>je||De<Ge||We>Ue||Ne<Ve):t.x1>e.x2||t.x2<e.x1||t.y1>e.y2||t.y2<e.y1))}function Ke(t,e){return Math.abs(e[0]*t[0]+e[1]*t[1])}function qe(t,e){let{x:i,y:o}=t,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{x:0,y:0};return{x:(i-n.x)*Math.cos(e)+(o-n.y)*Math.sin(e)+n.x,y:(i-n.x)*Math.sin(e)+(n.y-o)*Math.cos(e)+n.y}}function Ze(t){return{x:(t.x1+t.x2)/2,y:(t.y1+t.y2)/2}}function Je(t,e){const i=e?t.angle:we(t.angle),o=Ze(t);return[qe({x:t.x1,y:t.y1},i,o),qe({x:t.x2,y:t.y1},i,o),qe({x:t.x2,y:t.y2},i,o),qe({x:t.x1,y:t.y2},i,o)]}!function(t){t[t.NONE=0]="NONE",t[t.BBOX1=1]="BBOX1",t[t.BBOX2=2]="BBOX2"}(Xe||(Xe={}));const Qe=t=>{let e=t.charCodeAt(0),i=2===t.length?t.charCodeAt(1):0,o=e;return 55296<=e&&e<=56319&&56320<=i&&i<=57343&&(e&=1023,i&=1023,o=e<<10|i,o+=65536),12288===o||65281<=o&&o<=65376||65504<=o&&o<=65510?"F":8361===o||65377<=o&&o<=65470||65474<=o&&o<=65479||65482<=o&&o<=65487||65490<=o&&o<=65495||65498<=o&&o<=65500||65512<=o&&o<=65518?"H":4352<=o&&o<=4447||4515<=o&&o<=4519||4602<=o&&o<=4607||9001<=o&&o<=9002||11904<=o&&o<=11929||11931<=o&&o<=12019||12032<=o&&o<=12245||12272<=o&&o<=12283||12289<=o&&o<=12350||12353<=o&&o<=12438||12441<=o&&o<=12543||12549<=o&&o<=12589||12593<=o&&o<=12686||12688<=o&&o<=12730||12736<=o&&o<=12771||12784<=o&&o<=12830||12832<=o&&o<=12871||12880<=o&&o<=13054||13056<=o&&o<=19903||19968<=o&&o<=42124||42128<=o&&o<=42182||43360<=o&&o<=43388||44032<=o&&o<=55203||55216<=o&&o<=55238||55243<=o&&o<=55291||63744<=o&&o<=64255||65040<=o&&o<=65049||65072<=o&&o<=65106||65108<=o&&o<=65126||65128<=o&&o<=65131||110592<=o&&o<=110593||127488<=o&&o<=127490||127504<=o&&o<=127546||127552<=o&&o<=127560||127568<=o&&o<=127569||131072<=o&&o<=194367||177984<=o&&o<=196605||196608<=o&&o<=262141?"W":32<=o&&o<=126||162<=o&&o<=163||165<=o&&o<=166||172===o||175===o||10214<=o&&o<=10221||10629<=o&&o<=10630?"Na":161===o||164===o||167<=o&&o<=168||170===o||173<=o&&o<=174||176<=o&&o<=180||182<=o&&o<=186||188<=o&&o<=191||198===o||208===o||215<=o&&o<=216||222<=o&&o<=225||230===o||232<=o&&o<=234||236<=o&&o<=237||240===o||242<=o&&o<=243||247<=o&&o<=250||252===o||254===o||257===o||273===o||275===o||283===o||294<=o&&o<=295||299===o||305<=o&&o<=307||312===o||319<=o&&o<=322||324===o||328<=o&&o<=331||333===o||338<=o&&o<=339||358<=o&&o<=359||363===o||462===o||464===o||466===o||468===o||470===o||472===o||474===o||476===o||593===o||609===o||708===o||711===o||713<=o&&o<=715||717===o||720===o||728<=o&&o<=731||733===o||735===o||768<=o&&o<=879||913<=o&&o<=929||931<=o&&o<=937||945<=o&&o<=961||963<=o&&o<=969||1025===o||1040<=o&&o<=1103||1105===o||8208===o||8211<=o&&o<=8214||8216<=o&&o<=8217||8220<=o&&o<=8221||8224<=o&&o<=8226||8228<=o&&o<=8231||8240===o||8242<=o&&o<=8243||8245===o||8251===o||8254===o||8308===o||8319===o||8321<=o&&o<=8324||8364===o||8451===o||8453===o||8457===o||8467===o||8470===o||8481<=o&&o<=8482||8486===o||8491===o||8531<=o&&o<=8532||8539<=o&&o<=8542||8544<=o&&o<=8555||8560<=o&&o<=8569||8585===o||8592<=o&&o<=8601||8632<=o&&o<=8633||8658===o||8660===o||8679===o||8704===o||8706<=o&&o<=8707||8711<=o&&o<=8712||8715===o||8719===o||8721===o||8725===o||8730===o||8733<=o&&o<=8736||8739===o||8741===o||8743<=o&&o<=8748||8750===o||8756<=o&&o<=8759||8764<=o&&o<=8765||8776===o||8780===o||8786===o||8800<=o&&o<=8801||8804<=o&&o<=8807||8810<=o&&o<=8811||8814<=o&&o<=8815||8834<=o&&o<=8835||8838<=o&&o<=8839||8853===o||8857===o||8869===o||8895===o||8978===o||9312<=o&&o<=9449||9451<=o&&o<=9547||9552<=o&&o<=9587||9600<=o&&o<=9615||9618<=o&&o<=9621||9632<=o&&o<=9633||9635<=o&&o<=9641||9650<=o&&o<=9651||9654<=o&&o<=9655||9660<=o&&o<=9661||9664<=o&&o<=9665||9670<=o&&o<=9672||9675===o||9678<=o&&o<=9681||9698<=o&&o<=9701||9711===o||9733<=o&&o<=9734||9737===o||9742<=o&&o<=9743||9748<=o&&o<=9749||9756===o||9758===o||9792===o||9794===o||9824<=o&&o<=9825||9827<=o&&o<=9829||9831<=o&&o<=9834||9836<=o&&o<=9837||9839===o||9886<=o&&o<=9887||9918<=o&&o<=9919||9924<=o&&o<=9933||9935<=o&&o<=9953||9955===o||9960<=o&&o<=9983||10045===o||10071===o||10102<=o&&o<=10111||11093<=o&&o<=11097||12872<=o&&o<=12879||57344<=o&&o<=63743||65024<=o&&o<=65039||65533===o||127232<=o&&o<=127242||127248<=o&&o<=127277||127280<=o&&o<=127337||127344<=o&&o<=127386||917760<=o&&o<=917999||983040<=o&&o<=1048573||1048576<=o&&o<=1114109?"A":"N"};class ti{constructor(t,e){this._numberCharSize=null,this._fullCharSize=null,this._letterCharSize=null,this._specialCharSizeMap={},this._canvas=null,this._context=null,this._contextSaved=!1,this._notSupportCanvas=!1,this._notSupportVRender=!1,this._userSpec={},this.specialCharSet="-/: .,@%'\"~",this._option=t,this._userSpec=null!=e?e:{},this.textSpec=this._initSpec(),Q(t.specialCharSet)&&(this.specialCharSet=t.specialCharSet),this._standardMethod=Q(t.getTextBounds)?this.fullMeasure.bind(this):this.measureWithNaiveCanvas.bind(this)}initContext(){if(this._notSupportCanvas)return!1;if(J(this._canvas)&&(Q(this._option.getCanvasForMeasure)&&(this._canvas=this._option.getCanvasForMeasure()),J(this._canvas)&&"undefined"!=typeof window&&void 0!==window.document&&globalThis&&Q(globalThis.document)&&(this._canvas=globalThis.document.createElement("canvas"))),J(this._context)&&Q(this._canvas)){const t=this._canvas.getContext("2d");Q(t)&&(t.save(),t.font=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{fontStyle:i=e.fontStyle,fontVariant:o=e.fontVariant,fontWeight:n=e.fontWeight,fontSize:r=e.fontSize,fontFamily:s=e.fontFamily}=t;return(i?i+" ":"")+(o?o+" ":"")+(n?n+" ":"")+r+"px "+(s||"sans-serif")}(this.textSpec),this._contextSaved=!0,this._context=t)}return!J(this._context)||(this._notSupportCanvas=!0,!1)}_initSpec(){var t,e,i;const{defaultFontParams:o={}}=this._option,{fontStyle:n=o.fontStyle,fontVariant:r=o.fontVariant,fontWeight:s=(null!==(t=o.fontWeight)&&void 0!==t?t:"normal"),fontSize:l=(null!==(e=o.fontSize)&&void 0!==e?e:12),fontFamily:a=(null!==(i=o.fontFamily)&&void 0!==i?i:"sans-serif"),align:h,textAlign:d=(null!=h?h:"center"),baseline:c,textBaseline:u=(null!=c?c:"middle"),ellipsis:g,limit:p}=this._userSpec;let{lineHeight:f=l}=this._userSpec;if(nt(f)&&"%"===f[f.length-1]){const t=Number.parseFloat(f.substring(0,f.length-1))/100;f=l*t}return{fontStyle:n,fontVariant:r,fontFamily:a,fontSize:l,fontWeight:s,textAlign:d,textBaseline:u,ellipsis:g,limit:p,lineHeight:f}}measure(t,e){switch(e){case"vrender":case"canopus":return this.fullMeasure(t);case"canvas":return this.measureWithNaiveCanvas(t);case"simple":return this.quickMeasureWithoutCanvas(t);default:return this.quickMeasure(t)}}fullMeasure(t){if(J(t))return{width:0,height:0};if(J(this._option.getTextBounds)||!this._notSupportVRender)return this.measureWithNaiveCanvas(t);const{fontFamily:e,fontSize:i,fontWeight:o,textAlign:n,textBaseline:r,ellipsis:s,limit:l,lineHeight:a}=this.textSpec;let h;try{const d=this._option.getTextBounds({text:t,fontFamily:e,fontSize:i,fontWeight:o,textAlign:n,textBaseline:r,ellipsis:!!s,maxLineWidth:l||1/0,lineHeight:a});h={width:d.width(),height:d.height()}}catch(e){this._notSupportVRender=!0,h=this.measureWithNaiveCanvas(t)}return h}measureWithNaiveCanvas(t){return this._measureReduce(t,this._measureWithNaiveCanvas.bind(this))}_measureWithNaiveCanvas(t){var e;if(!this.initContext())return this._quickMeasureWithoutCanvas(t);const i=this._context.measureText(t),{fontSize:o,lineHeight:n}=this.textSpec;return{width:i.width,height:null!==(e=n)&&void 0!==e?e:o}}quickMeasure(t){return this._measureReduce(t,this._quickMeasure.bind(this))}_quickMeasure(t){const e={width:0,height:0};for(let i=0;i<t.length;i++){const o=t[i];let n=this._measureSpecialChar(o);J(n)&&ti.NUMBERS_CHAR_SET.includes(o)&&(n=this._measureNumberChar()),J(n)&&["F","W"].includes(Qe(o))&&(n=this._measureFullSizeChar()),J(n)&&(n=this._measureLetterChar()),e.width+=n.width,e.height=Math.max(e.height,n.height)}return e}quickMeasureWithoutCanvas(t){return this._measureReduce(t,this._quickMeasureWithoutCanvas.bind(this))}_quickMeasureWithoutCanvas(t){var e;const i={width:0,height:0},{fontSize:o,lineHeight:n}=this.textSpec;for(let e=0;e<t.length;e++){const n=t[e],r=["F","W"].includes(Qe(n))?1:.53;i.width+=r*o}return i.height=null!==(e=n)&&void 0!==e?e:o,i}_measureReduce(t,e){var i;const{fontSize:o,lineHeight:n}=this.textSpec,r={width:0,height:0};if(J(t))return r;if(rt(t)){const s=t.filter(Q).map((t=>t.toString()));return 0===s.length?r:1===s.length?e(s[0]):{width:s.reduce(((t,i)=>Math.max(t,e(i).width)),0),height:s.length*((null!==(i=n)&&void 0!==i?i:o)+1)+1}}return e(t.toString())}_measureNumberChar(){if(J(this._numberCharSize)){const t=this._standardMethod(ti.NUMBERS_CHAR_SET);this._numberCharSize={width:t.width/ti.NUMBERS_CHAR_SET.length,height:t.height}}return this._numberCharSize}_measureFullSizeChar(){return J(this._fullCharSize)&&(this._fullCharSize=this._standardMethod(ti.FULL_SIZE_CHAR)),this._fullCharSize}_measureLetterChar(){if(J(this._letterCharSize)){const t=this._standardMethod(ti.ALPHABET_CHAR_SET);this._letterCharSize={width:t.width/ti.ALPHABET_CHAR_SET.length,height:t.height}}return this._letterCharSize}_measureSpecialChar(t){return Q(this._specialCharSizeMap[t])?this._specialCharSizeMap[t]:this.specialCharSet.includes(t)?(this._specialCharSizeMap[t]=this._standardMethod(t),this._specialCharSizeMap[t]):null}release(){Q(this._canvas)&&(this._canvas=null),Q(this._context)&&(this._contextSaved&&(this._context.restore(),this._contextSaved=!1),this._context=null)}}ti.ALPHABET_CHAR_SET="abcdefghijklmnopqrstuvwxyz",ti.NUMBERS_CHAR_SET="0123456789",ti.FULL_SIZE_CHAR="字";function ei(t){if(ht(t))return[t,t,t,t];if(rt(t)){const e=t.length;if(1===e){const e=t[0];return[e,e,e,e]}if(2===e){const[e,i]=t;return[e,i,e,i]}if(3===e){const[e,i,o]=t;return[e,i,o,i]}if(4===e)return t}if(tt(t)){const{top:e=0,right:i=0,bottom:o=0,left:n=0}=t;return[e,i,o,n]}return[0,0,0,0]}const ii=t=>t.replace(/([A-Z])/g,"-$1").toLowerCase();const oi=oe-1e-8;class ni{constructor(t){this.init(t)}init(t){this.bounds=t}arc(t,e,i,o,n,r){if(Math.abs(n-o)>oi)return this.bounds.add(t-i,e-i),void this.bounds.add(t+i,e+i);let s,l,a,h,d=1/0,c=-1/0,u=1/0,g=-1/0;function p(t){a=i*Math.cos(t),h=i*Math.sin(t),a<d&&(d=a),a>c&&(c=a),h<u&&(u=h),h>g&&(g=h)}if(p(o),p(n),n!==o)if((o%=oe)<0&&(o+=oe),(n%=oe)<0&&(n+=oe),n<o&&(r=!r,s=o,o=n,n=s),r)for(n-=oe,s=o-o%ie,l=0;l<4&&s>n;++l,s-=ie)p(s);else for(s=o-o%ie+ie,l=0;l<4&&s<n;++l,s+=ie)p(s);this.bounds.add(t+d,e+u),this.bounds.add(t+c,e+g)}arcTo(t,e,i,o,n){throw new Error("不支持arcTo")}bezierCurveTo(t,e,i,o,n,r){this.bounds.add(t,e),this.bounds.add(i,o),this.bounds.add(n,r)}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,o){this.bounds.add(t,e),this.bounds.add(i,o)}rect(t,e,i,o){this.bounds.add(t,e),this.bounds.add(t+i,e+o)}clear(){this.bounds.clear()}release(){}}class ri{constructor(){this.curves=[],this.bounds=new Ce}getCurveLengths(){return this.curves.map((t=>t.getLength()))}getPointAt(t){return{x:0,y:0}}getLength(){return 0}getBounds(){return this.bounds}}const si=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:[eE][-+]?\d+)?)/gi,li={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},ai=0,hi=1,di=2,ci=3,ui=4,gi=5,pi=6,fi=7,mi=8;let bi,vi,yi,Ci,wi,xi;var _i,Si,Ai,Bi,Ri,Mi,Ti,ki,Pi;function Ei(t){const e=t[0],i=t[1],o=t[2],n=t[3],r=t[4],s=t[5],l=t[6],a=t[7],h=a*r,d=-l*s,c=l*r,u=a*s,g=Math.cos(o),p=Math.sin(o),f=Math.cos(n),m=Math.sin(n),b=.5*(n-o),v=Math.sin(.5*b),y=8/3*v*v/Math.sin(b),C=e+g-y*p,w=i+p+y*g,x=e+f,_=i+m,S=x+y*m,A=_-y*f;return[h*C+d*w,c*C+u*w,h*S+d*A,c*S+u*A,h*x+d*_,c*x+u*_]}function Li(t,e,i,o){const n=function(t,e,i,o,n,r,s,l,a){const h=we(s),d=Math.sin(h),c=Math.cos(h),u=c*(l-t)*.5+d*(a-e)*.5,g=c*(a-e)*.5-d*(l-t)*.5;let p=u*u/((i=Math.abs(i))*i)+g*g/((o=Math.abs(o))*o);p>1&&(p=Math.sqrt(p),i*=p,o*=p);const f=c/i,m=d/i,b=-d/o,v=c/o,y=f*l+m*a,C=b*l+v*a,w=f*t+m*e,x=b*t+v*e;let _=1/((w-y)*(w-y)+(x-C)*(x-C))-.25;_<0&&(_=0);let S=Math.sqrt(_);r===n&&(S=-S);const A=.5*(y+w)-S*(x-C),B=.5*(C+x)+S*(w-y),R=Math.atan2(C-B,y-A);let M=Math.atan2(x-B,w-A)-R;M<0&&1===r?M+=oe:M>0&&0===r&&(M-=oe);const T=Math.ceil(Math.abs(M/(ie+.001))),k=[];for(let t=0;t<T;++t){const e=R+t*M/T,n=R+(t+1)*M/T;k[t]=[A,B,e,n,i,o,d,c]}return k}(o[5],o[6],o[0],o[1],o[3],o[4],o[2],e,i);for(let e=0;e<n.length;++e){const i=Ei(n[e]);t.bezierCurveTo(i[0],i[1],i[2],i[3],i[4],i[5])}}!function(t){t[t.NONE=0]="NONE",t[t.UPDATE_BOUNDS=1]="UPDATE_BOUNDS",t[t.UPDATE_SHAPE=2]="UPDATE_SHAPE",t[t.CLEAR_SHAPE=253]="CLEAR_SHAPE",t[t.UPDATE_SHAPE_AND_BOUNDS=3]="UPDATE_SHAPE_AND_BOUNDS",t[t.INIT=179]="INIT",t[t.CLEAR_BOUNDS=254]="CLEAR_BOUNDS",t[t.UPDATE_GLOBAL_MATRIX=32]="UPDATE_GLOBAL_MATRIX",t[t.CLEAR_GLOBAL_MATRIX=223]="CLEAR_GLOBAL_MATRIX",t[t.UPDATE_LOCAL_MATRIX=16]="UPDATE_LOCAL_MATRIX",t[t.CLEAR_LOCAL_MATRIX=239]="CLEAR_LOCAL_MATRIX",t[t.UPDATE_GLOBAL_LOCAL_MATRIX=48]="UPDATE_GLOBAL_LOCAL_MATRIX",t[t.UPDATE_LAYOUT=128]="UPDATE_LAYOUT",t[t.CLEAR_LAYOUT=127]="CLEAR_LAYOUT"}(_i||(_i={})),function(t){t[t.GLOBAL=1]="GLOBAL",t[t.LOCAL=16]="LOCAL",t[t.GLOBAL_ACCURATE=3]="GLOBAL_ACCURATE",t[t.LOCAL_ACCURATE=48]="LOCAL_ACCURATE"}(Si||(Si={})),function(t){t[t.INIT=0]="INIT",t[t.DEFAULT=1]="DEFAULT",t[t.STATE=2]="STATE",t[t.ANIMATE_BIND=10]="ANIMATE_BIND",t[t.ANIMATE_PLAY=11]="ANIMATE_PLAY",t[t.ANIMATE_START=12]="ANIMATE_START",t[t.ANIMATE_UPDATE=13]="ANIMATE_UPDATE",t[t.ANIMATE_END=14]="ANIMATE_END",t[t.TRANSLATE=20]="TRANSLATE",t[t.TRANSLATE_TO=21]="TRANSLATE_TO",t[t.SCALE=22]="SCALE",t[t.SCALE_TO=23]="SCALE_TO",t[t.ROTATE=24]="ROTATE",t[t.ROTATE_TO=25]="ROTATE_TO"}(Ai||(Ai={})),function(t){t[t.INITIAL=0]="INITIAL",t[t.RUNNING=1]="RUNNING",t[t.PAUSED=2]="PAUSED",t[t.END=3]="END"}(Bi||(Bi={})),function(t){t[t.NORMAL=0]="NORMAL",t[t.SET_ATTR_IMMEDIATELY=1]="SET_ATTR_IMMEDIATELY"}(Ri||(Ri={})),function(t){t.wait="wait",t.from="from",t.to="to",t.customAnimate="customAnimate"}(Mi||(Mi={})),function(t){t[t.ROW=1]="ROW",t[t.COLUMN=2]="COLUMN"}(Ti||(Ti={})),function(t){t[t.CubicBezierCurve=0]="CubicBezierCurve",t[t.QuadraticBezierCurve=1]="QuadraticBezierCurve",t[t.ArcCurve=2]="ArcCurve",t[t.LineCurve=3]="LineCurve",t[t.EllipseCurve=4]="EllipseCurve",t[t.MoveCurve=5]="MoveCurve"}(ki||(ki={})),function(t){t[t.beforeFillStroke=0]="beforeFillStroke",t[t.afterFillStroke=1]="afterFillStroke"}(Pi||(Pi={}));const Hi=[(t,e,i,o,n,r,s)=>e.arc(t[1]*n+i,t[2]*r+o,t[3]*(n+r)/2,t[4],t[5],t[6],s),(t,e,i,o,n,r,s)=>e.arcTo(t[1]*n+i,t[2]*r+o,t[3]*n+i,t[4]*r+o,t[5]*(n+r)/2,s),(t,e,i,o,n,r,s)=>e.bezierCurveTo(t[1]*n+i,t[2]*r+o,t[3]*n+i,t[4]*r+o,t[5]*n+i,t[6]*r+o,s),(t,e,i,o)=>e.closePath(),(t,e,i,o,n,r)=>e.ellipse(t[1]*n+i,t[2]*r+o,t[3]*n,t[4]*r,t[5],t[6],t[7],t[8]),(t,e,i,o,n,r,s)=>e.lineTo(t[1]*n+i,t[2]*r+o,s),(t,e,i,o,n,r,s)=>e.moveTo(t[1]*n+i,t[2]*r+o,s),(t,e,i,o,n,r,s)=>e.quadraticCurveTo(t[1]*n+i,t[2]*r+o,t[3]*n+i,t[4]*r+o,s),(t,e,i,o,n,r,s)=>e.rect(t[1]*n+i,t[2]*r+o,t[3]*n,t[4]*r,s)];function zi(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1,s=arguments.length>6?arguments[6]:void 0;for(let l=0;l<t.length;l++){const a=t[l];Hi[a[0]](a,e,i,o,n,r,s)}}class Fi{getLength(t){return null!=t?this.calcProjLength(t):(Number.isFinite(this.length)||(this.length=this.calcLength()),this.length)}}function Ii(t,e,i,o,n){return function(t,e){let i=0;const o=t.length;for(let n=0;n<o;n++){const r=t[n],s=e[n],l=t[(n+1)%o],a=e[(n+1)%o];i+=be.distanceNN(r,s,l,a)}return i/2}([t.x,e.x,i.x,o.x],[t.y,e.y,i.y,o.y])}function Oi(t,e,i,o,n){const r=1-n;return r*r*r*t+3*e*n*r*r+3*i*n*n*r+o*n*n*n}function Di(t,e,i,o,n){const r=Oi(t.x,e.x,i.x,o.x,n),s=Oi(t.y,e.y,i.y,o.y,n);return new me(r,s)}function Wi(t,e){const{p0:i,p1:o,p2:n,p3:r}=t,s=Di(i,o,n,r,e),l=be.pointAtPP(i,o,e),a=be.pointAtPP(o,n,e),h=be.pointAtPP(n,r,e),d=be.pointAtPP(l,a,e),c=be.pointAtPP(a,h,e);return[new Ni(i,l,d,s),new Ni(s,c,h,r)]}class Ni extends Fi{constructor(t,e,i,o){super(),this.type=ki.CubicBezierCurve,this.p0=t,this.p1=e,this.p2=i,this.p3=o}_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 Di(this.p0,this.p1,this.p2,this.p3,t);throw new Error("defined为false的点不能getPointAt")}calcLength(){return this._validPoint()?Ii(this.p0,this.p1,this.p2,this.p3):60}calcProjLength(t){return t===Ti.ROW?re(this.p0.x-this.p3.x):t===Ti.COLUMN?re(this.p0.y-this.p3.y):0}getAngleAt(t){const e=ae(t-.01,0),i=he(t+.01,1),o=this.getPointAt(e),n=this.getPointAt(i);return se(n.y-o.y,n.x-o.x)}}function Gi(t,e){const{p0:i,p1:o}=t,n=be.pointAtPP(i,o,e);return[new ji(i,n),new ji(n,o)]}class ji extends Fi{constructor(t,e){super(),this.type=ki.LineCurve,this.p0=t,this.p1=e}getPointAt(t){if(!1!==this.defined)return be.pointAtPP(this.p0,this.p1,t);throw new Error("defined为false的点不能getPointAt")}getAngleAt(t){return null==this.angle&&(this.angle=se(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()?be.distancePP(this.p0,this.p1):60}calcProjLength(t){return t===Ti.ROW?re(this.p0.x-this.p1.x):t===Ti.COLUMN?re(this.p0.y-this.p1.y):0}}class Vi{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,e,i,o,n,r,s,l){const a=new Ni(new me(this._lastX,this._lastY),new me(t,e),new me(i,o),new me(n,r));a.originP1=this._lastOriginP,a.originP2=l,a.defined=s,this.curves.push(a),this._lastX=n,this._lastY=r,this._lastOriginP=l}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,o){const n=this.addLinearCurve(t,e,i,this._lastOriginP,o);this.curves.push(n),this._lastX=t,this._lastY=e,this._lastOriginP=o}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,o){throw new Error("SegContext不支持调用quadraticCurveTo")}clear(){this.curves=[],this.length=NaN}tryUpdateLength(t){return this.getLength(t)}addLinearCurve(t,e,i,o,n){const r=new ji(new me(this._lastX,this._lastY),new me(t,e));return r.originP1=o,r.originP2=n,r.defined=i,r}getPointAt(t){throw new Error("暂未实现")}getCurveLengths(){return[]}getLength(t){var e,i;if(t===Ti.COLUMN){if(!this.curves.length)return 0;const t=this.curves[0],i=this.curves[this.curves.length-1],o=null!==(e=i.p3)&&void 0!==e?e:i.p1;return re(t.p0.y-o.y)}if(t===Ti.ROW){if(!this.curves.length)return 0;const t=this.curves[0],e=this.curves[this.curves.length-1],o=null!==(i=e.p3)&&void 0!==i?i:e.p1;return re(t.p0.x-o.x)}return Number.isFinite(this.length)||(this.length=this.curves.reduce(((t,e)=>t+e.getLength()),0)),this.length}}class Ui extends Vi{bezierCurveTo(t,e,i,o,n,r,s,l){return super.bezierCurveTo(e,t,o,i,r,n,s,l)}lineTo(t,e,i,o){return super.lineTo(e,t,i,o)}moveTo(t,e,i){return super.moveTo(e,t,i)}clear(){return super.clear()}}function $i(t,e){let i=!1;for(let o=0,n=e.length;o<=n;o++)o>=n===i&&((i=!i)?t.lineStart():t.lineEnd()),i&&t.point(e[o])}function Xi(t,e,i){const o=null!=e?e:re(i[i.length-1].x-i[0].x)>re(i[i.length-1].y-i[0].y)?Ti.ROW:Ti.COLUMN;return"monotoneY"===t?new Ui(t,o):new Vi(t,o)}class Yi{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 Ki(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{direction:i,startPoint:o}=e;if(t.length<2-Number(!!o))return null;const n=Xi("linear",i,t);return function(t,e){$i(t,e)}(new Yi(n,o),t),n}function qi(t,e,i,o,n){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,o,t.lastPoint1)}class Zi{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(){2===this._point&&qi(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:qi(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 Ji(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{direction:i,startPoint:o}=e;if(t.length<2-Number(!!o))return null;if(t.length<3-Number(!!o))return Ki(t,e);const n=Xi("basis",i,t);return function(t,e){$i(t,e)}(new Zi(n,o),t),n}function Qi(t){return t<0?-1:1}function to(t,e,i){const o=t._x1-t._x0,n=e-t._x1,r=(t._y1-t._y0)/(o||Number(n<0&&-0)),s=(i-t._y1)/(n||Number(o<0&&-0)),l=(r*n+s*o)/(o+n);return(Qi(r)+Qi(s))*Math.min(Math.abs(r),Math.abs(s),.5*Math.abs(l))||0}function eo(t,e){const i=t._x1-t._x0;return i?(3*(t._y1-t._y0)/i-e)/2:e}function io(t,e,i,o,n){const r=t._x0,s=t._y0,l=t._x1,a=t._y1,h=(l-r)/3;t.context.bezierCurveTo(r+h,s+h*e,l-h,a-h*i,l,a,o,t.lastPoint1)}class oo{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:io(this,this._t0,eo(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,o=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(i,o,!1!==this._lastDefined1&&!1!==this._lastDefined2,t):this.context.moveTo(i,o,t);break;case 1:this._point=2;break;case 2:this._point=3,io(this,eo(this,e=to(this,i,o)),e,!1!==this._lastDefined1&&!1!==this._lastDefined2);break;default:io(this,this._t0,e=to(this,i,o),!1!==this._lastDefined1&&!1!==this._lastDefined2)}this._x0=this._x1,this._x1=i,this._y0=this._y1,this._y1=o,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 no extends oo{constructor(t,e){super(t,e)}point(t){return super.point({y:t.x,x:t.y,defined:t.defined})}}function ro(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{direction:i,startPoint:o}=e;if(t.length<2-Number(!!o))return null;if(t.length<3-Number(!!o))return Ki(t,e);const n=Xi("monotoneX",i,t);return function(t,e){$i(t,e)}(new oo(n,o),t),n}function so(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{direction:i,startPoint:o}=e;if(t.length<2-Number(!!o))return null;if(t.length<3-Number(!!o))return Ki(t,e);const n=Xi("monotoneY",i,t);return function(t,e){$i(t,e)}(new no(n,o),t),n}let lo=class{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.5,i=arguments.length>2?arguments[2]:void 0;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 o=this._x*(1-this._t)+e*this._t;this.context.lineTo(o,this._y,!1!==this._lastDefined&&!1!==t.defined,this.lastPoint),this.context.lineTo(o,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 ao(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{direction:o,startPoint:n}=i;if(t.length<2-Number(!!n))return null;const r=new Vi("step",null!=o?o:re(t[t.length-1].x-t[0].x)>re(t[t.length-1].y-t[0].y)?Ti.ROW:Ti.COLUMN);return function(t,e){$i(t,e)}(new lo(r,e,n),t),r}class ho extends Yi{lineEnd(){this.context.closePath()}}function co(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{direction:i,startPoint:o}=e;if(t.length<2-Number(!!o))return null;const n=Xi("linear",i,t);return function(t,e){$i(t,e)}(new ho(n,o),t),n}function uo(t,e,i){switch(e){case"linear":default:return Ki(t,i);case"basis":return Ji(t,i);case"monotoneX":return ro(t,i);case"monotoneY":return so(t,i);case"step":return ao(t,.5,i);case"stepBefore":return ao(t,0,i);case"stepAfter":return ao(t,1,i);case"linearClosed":return co(t,i)}}class go extends ri{constructor(t){super(),this.commandList=[],t&&(this._ctx=t),this._boundsContext=new ni(this.bounds)}setCtx(t){this._ctx=t}moveTo(t,e){return this.commandList.push([pi,t,e]),this._ctx&&this._ctx.moveTo(t,e),this}lineTo(t,e){return this.commandList.push([gi,t,e]),this._ctx&&this._ctx.lineTo(t,e),this}quadraticCurveTo(t,e,i,o){return this.commandList.push([fi,t,e,i,o]),this._ctx&&this._ctx.quadraticCurveTo(t,e,i,o),this}bezierCurveTo(t,e,i,o,n,r){return this.commandList.push([di,t,e,i,o,n,r]),this._ctx&&this._ctx.bezierCurveTo(t,e,i,o,n,r),this}arcTo(t,e,i,o,n){return this.commandList.push([hi,t,e,i,o,n]),this._ctx&&this._ctx.arcTo(t,e,i,o,n),this}ellipse(t,e,i,o,n,r,s,l){return this.commandList.push([ui,t,e,i,o,n,r,s,l]),this._ctx&&this._ctx.ellipse(t,e,i,o,n,r,s,l),this}rect(t,e,i,o){return this.commandList.push([mi,t,e,i,o]),this._ctx&&this._ctx.rect(t,e,i,o),this}arc(t,e,i,o,n,r){return this.commandList.push([ai,t,e,i,o,n,r]),this._ctx&&this._ctx.arc(t,e,i,o,n,r),this}closePath(){return this.commandList.push([ci]),this._ctx&&this._ctx.closePath(),this}addCurve(t){this.curves.push(t)}clear(){this.transformCbList=null,this.commandList.length=0,this.curves.length=0}beginPath(){this.clear()}toString(){if(!this.toStringCbList){const t=[];t[pi]=t=>`M${t[1]} ${t[2]}`,t[gi]=t=>`L${t[1]} ${t[2]}`,t[fi]=t=>`Q${t[1]} ${t[2]} ${t[3]} ${t[4]}`,t[di]=t=>`C${t[1]} ${t[2]} ${t[3]} ${t[4]} ${t[5]} ${t[6]}`,t[ai]=t=>{const e=[];((t,e,i,o,n,r,s)=>{const l=Math.abs(i-e),a=4*Math.tan(l/4)/3,h=i<e?-1:1,d=Math.cos(e),c=Math.sin(e),u=Math.cos(i),g=Math.sin(i),p=d*r+o,f=c*s+n,m=u*r+o,b=g*s+n,v=r*a*h,y=s*a*h;t.push(p-v*c,f+y*d,m+v*g,b-y*u,m,b)})(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[mi]=t=>`M${t[1]} ${t[2]} h${t[3]} v${t[4]} H${t[1]}Z`,t[ci]=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,o,n){this.clear();const r=function(t){if(!t)return[];const e=t.match(/[mzlhvcsqta][^mzlhvcsqta]*/gi);if(null===e)return[];let i,o;const n=[];for(let t=0,r=e.length;t<r;t++)if(bi=e[t],vi=bi.slice(1),yi=bi[0],i=[yi],o=vi.match(si),null!==o){for(let t=0,e=o.length;t<e;t++)Ci=o[t],wi=parseFloat(Ci),Number.isNaN(wi)||i.push(wi);if(xi=li[yi],i.length-1>xi){let t;for(let e=1,o=i.length;e<o;e+=xi){t=[yi];for(let o=e,n=e+xi;o<n;o++)t.push(i[o]);n.push(t)}}else n.push(i)}else n.push(i);return n}(t);return this._runCommandStrList(r,e,i,o,n),this._updateBounds(),this}fromLine(t){const{points:e,curveType:i,clipRangeByDimension:o}=t.attribute;if(!e)return;const n=uo(e,i);"x"===o?this.direction=Ti.ROW:"y"===o?this.direction=Ti.COLUMN:"auto"===o&&(this.direction=n.direction),this.curves=n.curves}fromCustomPath2D(t,e,i,o,n){return this.clear(),this._runCommandList(t.commandList,e,i,o,n),this._updateBounds(),this}transform(t,e,i,o){const n=this.commandList;if(!this.transformCbList){const t=[];t[pi]=this.moveToTransform,t[gi]=this.lineToTransform,t[fi]=this.quadraticCurveToTransform,t[di]=this.bezierCurveToTransform,t[hi]=this.arcToTransform,t[ui]=this.ellipseTransform,t[mi]=this.rectTransform,t[ai]=this.arcTransform,t[ci]=this.closePathTransform,this.transformCbList=t}n.forEach((n=>{this.transformCbList[n[0]](n,t,e,i,o)})),this._updateBounds()}moveToTransform(t,e,i,o,n){t[1]=t[1]*o+e,t[2]=t[2]*n+i}lineToTransform(t,e,i,o,n){t[1]=t[1]*o+e,t[2]=t[2]*n+i}quadraticCurveToTransform(t,e,i,o,n){t[1]=t[1]*o+e,t[2]=t[2]*n+i,t[3]=t[3]*o+e,t[4]=t[4]*n+i}bezierCurveToTransform(t,e,i,o,n){t[1]=t[1]*o+e,t[2]=t[2]*n+i,t[3]=t[3]*o+e,t[4]=t[4]*n+i,t[5]=t[5]*o+e,t[6]=t[6]*n+i}arcToTransform(t,e,i,o,n){t[1]=t[1]*o+e,t[2]=t[2]*n+i,t[3]=t[3]*o+e,t[4]=t[4]*n+i,t[5]=t[5]*(o+n)/2}ellipseTransform(t,e,i,o,n){t[1]=t[1]*o+e,t[2]=t[2]*n+i,t[3]=t[3]*o,t[4]=t[4]*n}rectTransform(t,e,i,o,n){t[1]=t[1]*o+e,t[2]=t[2]*n+i,t[3]=t[3]*o,t[4]=t[4]*n}arcTransform(t,e,i,o,n){t[1]=t[1]*o+e,t[2]=t[2]*n+i,t[3]=t[3]*(o+n)/2}closePathTransform(){}_runCommandStrList(t){let e,i,o,n,r,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,h=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,d=null,c=0,u=0,g=0,p=0;for(let f=0,m=t.length;f<m;++f){switch(e=t[f],1===a&&1===h||(e=fo(e,a,h)),e[0]){case"l":c+=e[1],u+=e[2],this.lineTo(c+s,u+l);break;case"L":c=e[1],u=e[2],this.lineTo(c+s,u+l);break;case"h":c+=e[1],this.lineTo(c+s,u+l);break;case"H":c=e[1],this.lineTo(c+s,u+l);break;case"v":u+=e[1],this.lineTo(c+s,u+l);break;case"V":u=e[1],this.lineTo(c+s,u+l);break;case"m":c+=e[1],u+=e[2],this.moveTo(c+s,u+l);break;case"M":c=e[1],u=e[2],this.moveTo(c+s,u+l);break;case"c":i=c+e[5],o=u+e[6],g=c+e[3],p=u+e[4],this.bezierCurveTo(c+e[1]+s,u+e[2]+l,g+s,p+l,i+s,o+l),c=i,u=o;break;case"C":c=e[5],u=e[6],g=e[3],p=e[4],this.bezierCurveTo(e[1]+s,e[2]+l,g+s,p+l,c+s,u+l);break;case"s":i=c+e[3],o=u+e[4],g=2*c-g,p=2*u-p,this.bezierCurveTo(g+s,p+l,c+e[1]+s,u+e[2]+l,i+s,o+l),g=c+e[1],p=u+e[2],c=i,u=o;break;case"S":i=e[3],o=e[4],g=2*c-g,p=2*u-p,this.bezierCurveTo(g+s,p+l,e[1]+s,e[2]+l,i+s,o+l),c=i,u=o,g=e[1],p=e[2];break;case"q":i=c+e[3],o=u+e[4],g=c+e[1],p=u+e[2],this.quadraticCurveTo(g+s,p+l,i+s,o+l),c=i,u=o;break;case"Q":i=e[3],o=e[4],this.quadraticCurveTo(e[1]+s,e[2]+l,i+s,o+l),c=i,u=o,g=e[1],p=e[2];break;case"t":i=c+e[1],o=u+e[2],null===d[0].match(/[QqTt]/)?(g=c,p=u):"t"===d[0]?(g=2*c-n,p=2*u-r):"q"===d[0]&&(g=2*c-g,p=2*u-p),n=g,r=p,this.quadraticCurveTo(g+s,p+l,i+s,o+l),c=i,u=o,g=c+e[1],p=u+e[2];break;case"T":i=e[1],o=e[2],g=2*c-g,p=2*u-p,this.quadraticCurveTo(g+s,p+l,i+s,o+l),c=i,u=o;break;case"a":Li(this,c+s,u+l,[e[1],e[2],e[3],e[4],e[5],e[6]+c+s,e[7]+u+l]),c+=e[6],u+=e[7];break;case"A":Li(this,c+s,u+l,[e[1],e[2],e[3],e[4],e[5],e[6]+s,e[7]+l]),c=e[6],u=e[7];break;case"z":case"Z":this.closePath()}d=e}}_runCommandList(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1;if(0!==e||0!==i||1!==o||1!==n)for(let r=0,s=t.length;r<s;++r){const s=t[r].slice();switch(s[0]){case gi:this.lineToTransform(s,e,i,o,n);break;case pi:this.moveToTransform(s,e,i,o,n);break;case di:this.bezierCurveToTransform(s,e,i,o,n);break;case fi:this.quadraticCurveToTransform(s,e,i,o,n);break;case ai:this.arcToTransform(s,e,i,o,n);break;case ui:this.ellipseTransform(s,e,i,o,n);break;case mi:this.rectTransform(s,e,i,o,n);break;case hi:this.arcToTransform(s,e,i,o,n);break;case ci:this.closePath()}}else this.commandList=t.map((t=>t.slice()))}_updateBounds(){this.bounds.clear(),zi(this.commandList,this._boundsContext)}release(){this.commandList=[],this._boundsContext=null,this._ctx=null}getLength(){if(this.direction===Ti.COLUMN){if(!this.curves.length)return 0;const t=this.curves[0],e=this.curves[this.curves.length-1];return re(t.p0.y-e.p1.y)}if(this.direction===Ti.ROW){if(!this.curves.length)return 0;const t=this.curves[0],e=this.curves[this.curves.length-1];return re(t.p0.x-e.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 o=0;o<this.curves.length;o++){e=this.curves[o];const n=e.getLength(this.direction);if(i+n>=t)break;i+=n}const o=(t-i)/e.getLength(this.direction);return{pos:e.getPointAt(o),angle:e.getAngleAt(o)}}}const po=["l",0,0,0,0,0,0,0];function fo(t,e,i){const o=po[0]=t[0];if("a"===o||"A"===o)po[1]=e*t[1],po[2]=i*t[2],po[3]=t[3],po[4]=t[4],po[5]=t[5],po[6]=e*t[6],po[7]=i*t[7];else if("h"===o||"H"===o)po[1]=e*t[1];else if("v"===o||"V"===o)po[1]=i*t[1];else for(let o=1,n=t.length;o<n;++o)po[o]=(o%2==1?e:i)*t[o];return po}const mo={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 Se},bo={fillOpacity:1,fill:!1,shadowBlur:0,shadowColor:"black",shadowOffsetX:0,shadowOffsetY:0},vo={strokeOpacity:1,lineDash:[],lineDashOffset:0,lineWidth:1,lineCap:"butt",lineJoin:"miter",miterLimit:10,strokeBoundsBuffer:2,stroke:!1},yo=Object.assign({outerBorder:Object.assign(Object.assign({},vo),{distance:0}),innerBorder:Object.assign(Object.assign({},vo),{distance:0})},vo),Co={text:"",maxLineWidth:1/0,textAlign:"left",textBaseline:"alphabetic",fontSize:16,fontFamily:"PingFang SC,Microsoft Yahei,system-ui,-apple-system,segoe ui,\n Roboto,Helvetica,Arial,sans-serif, apple color emoji,segoe ui emoji,segoe ui symbol",fontWeight:"",ellipsis:"…",fontVariant:"",fontStyle:"",lineHeight:void 0,underline:0,lineThrough:0,scaleIn3d:!1,direction:"horizontal",wordBreak:"break-all",ignoreBuf:!1,verticalMode:0,wrap:!1,whiteSpace:"no-wrap",heightLimit:1/0,lineClamp:1/0,suffixPosition:"end",underlineDash:[],underlineOffset:0,disableAutoClipedPoptip:void 0},wo=Object.assign(Object.assign(Object.assign(Object.assign({forceBoundsWidth:void 0,forceBoundsHeight:void 0,opacity:1,background:null,backgroundOpacity:1,backgroundCornerRadius:0,texture:null,textureColor:"black",textureSize:10,texturePadding:2,backgroundMode:"no-repeat",backgroundFit:!0,blur:0,cursor:null,html:null,react:null},bo),yo),{alignSelf:"auto"}),{pickStrokeBuffer:0}),xo={connectedType:"none",connectedStyle:{},connectedX:NaN,connectedY:NaN},_o=Object.assign(Object.assign(Object.assign({strokeSeg:null,renderable:!0,pickable:!0,shadowGraphic:void 0,childrenPickable:!0,fillPickable:!0,strokePickable:!0,visible:!0,zIndex:0,layout:null,boundsPadding:0,renderStyle:"default",pickMode:"accurate",customPickShape:null,boundsMode:"accurate",keepDirIn3d:!0,shadowRootIdx:1,globalZIndex:1,globalCompositeOperation:"",overflow:"hidden"},{_debug_bounds:!1}),wo),mo),So=Object.assign(Object.assign({},_o),{startAngle:0,endAngle:ne,innerRadius:0,outerRadius:1,innerPadding:0,outerPadding:0,cornerRadius:0,padRadius:0,padAngle:0,cap:!1,forceShowCap:!1}),Ao=Object.assign(Object.assign(Object.assign({},_o),xo),{points:[],segments:[],curveType:"linear",clipRange:1,closePath:!1}),Bo=Object.assign(Object.assign({},_o),{radius:1,startAngle:0,endAngle:ne}),Ro=Object.assign(Object.assign({},_o),{width:0,height:0,cornerRadius:0,path:[],clip:!1,visibleAll:!0,display:"relative",flexDirection:"row",flexWrap:"wrap",justifyContent:"flex-start",alignItems:"flex-start",alignContent:"flex-start",baseOpacity:1}),Mo=Object.assign(Object.assign({},_o),{path:"",width:0,height:0,cornerRadius:0,clip:!1}),To=Object.assign(Object.assign(Object.assign({},_o),xo),{points:[],segments:[],curveType:"linear",clipRange:1,clipRangeByDimension:"default",closePath:!1}),ko=Object.assign(Object.assign({},_o),{path:new go,customPath:()=>{Wt.getInstance().warn("空函数")}}),Po=Object.assign(Object.assign({},_o),{points:[],cornerRadius:0,closePath:!0}),Eo=Object.assign(Object.assign({},_o),{width:0,height:0,x1:0,y1:0,strokeBoundsBuffer:0,cornerRadius:0});Object.assign(Object.assign({},_o),{width:0,height:0,x1:0,y1:0,cornerRadius:0,length:0});const Lo=Object.assign(Object.assign({},_o),{symbolType:"circle",size:10,keepDirIn3d:!0}),Ho=Object.assign(Object.assign(Object.assign({},_o),Co),{strokeBoundsBuffer:0,keepDirIn3d:!0}),zo=Object.assign(Object.assign(Object.assign({},_o),Co),{width:300,height:300,ellipsis:!0,wordBreak:"break-word",verticalDirection:"top",textAlign:"left",textBaseline:"top",layoutDirection:"horizontal",textConfig:[],disableAutoWrapLine:!1,maxHeight:void 0,maxWidth:void 0,singleLine:!1}),Fo=Object.assign(Object.assign({repeatX:"no-repeat",repeatY:"no-repeat",image:"",width:0,height:0},_o),{fill:!0,cornerRadius:0}),Io=Object.assign(Object.assign({},Fo),{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});const Oo=new class{},Do={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"}},Wo=!0,No=!1,Go=/\w|\(|\)|-/,jo=/[.?!,;:/,。?!、;:]/,Vo=/\S/;function Uo(t,e,i,o,n){if(!e||e<=0)return 0;const r=Oo.graphicUtil.textMeasure;let s=o,l=t.slice(0,s),a=Math.floor(r.measureText(l,i).width),h=t.slice(0,s+1),d=Math.floor(r.measureText(h,i).width);for(;a>e||d<=e;){if(a>e?s--:s++,s>t.length){s=t.length;break}if(s<0){s=0;break}l=t.slice(0,s),a=Math.floor(r.measureText(l,i).width),h=t.slice(0,s+1),d=Math.floor(r.measureText(h,i).width)}return n&&(s=$o(t,s)),s}function $o(t,e){let i=e;for(;Go.test(t[i-1])&&Go.test(t[i])||jo.test(t[i]);)if(i--,i<=0)return e;return i}function Xo(t,e){const i=Oo.graphicUtil.textMeasure.measureText(t,e),o={ascent:0,height:0,descent:0,width:0};return"number"!=typeof i.actualBoundingBoxAscent||"number"!=typeof i.actualBoundingBoxDescent?(o.width=Math.floor(i.width),o.height=e.fontSize||0,o.ascent=o.height,o.descent=0):(o.width=Math.floor(i.width),o.height=Math.floor(i.actualBoundingBoxAscent+i.actualBoundingBoxDescent),o.ascent=Math.floor(i.actualBoundingBoxAscent),o.descent=o.height-o.ascent),o}var Yo=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s};let Ko=class{configure(t,e){this.canvas=t.canvas,this.context=t.context,t.bindTextMeasure(this)}measureTextWidth(t,e){return this.context?(this.context.setTextStyleWithoutAlignBaseline(e),this.context.measureText(t).width):this.estimate(t,e).width}estimate(t,e){let{fontSize:i=Ho.fontSize}=e,o=0,n=0;for(let e=0;e<t.length;e++)t.charCodeAt(e)<128?o++:n++;return{width:~~(.8*o*i+n*i),height:i}}measureTextPixelHeight(t,e){var i;if(!this.context)return null!==(i=e.fontSize)&&void 0!==i?i:Co.fontSize;this.context.setTextStyleWithoutAlignBaseline(e);const o=this.context.measureText(t);return Math.abs(o.actualBoundingBoxAscent-o.actualBoundingBoxDescent)}measureTextBoundHieght(t,e){var i;if(!this.context)return null!==(i=e.fontSize)&&void 0!==i?i:Co.fontSize;this.context.setTextStyleWithoutAlignBaseline(e);const o=this.context.measureText(t);return Math.abs(o.fontBoundingBoxAscent-o.fontBoundingBoxDescent)}measureText(t,e){return this.context?(this.context.setTextStyleWithoutAlignBaseline(e),this.context.measureText(t)):this.estimate(t,e)}clipTextVertical(t,e,i,o){if(0===t.length)return{verticalList:t,width:0};const{fontSize:n=12}=e;t.forEach((t=>{t.width=0===t.direction?n:this.measureTextWidth(t.text,e)}));const r=[];let s=0,l=0;for(;l<t.length&&s+t[l].width<i;l++)s+=t[l].width,r.push(t[l]);if(t[l]&&t[l].text.length>1){const n=this._clipText(t[l].text,e,i-s,0,t[l].text.length-1,"end",!1);if(o&&n.str!==t[l].text){let i="",o=0;for(let e=0;e<l;e++){const n=t[e];i+=n.text,o+=n.text.length}i+=t[l].text;let r=$o(i,o+n.str.length);r-=o,r!==n.str.length-1&&(n.str=n.str.substring(0,r),n.width=this.measureTextWidth(n.str,e))}r.push(Object.assign(Object.assign({},t[l]),{text:n.str,width:n.width})),s+=n.width}return{verticalList:r,width:s}}clipText(t,e,i,o){if(0===t.length)return{str:"",width:0};let n=this.measureTextWidth(t,e);if(n<=i)return{str:t,width:n};if(n=this.measureTextWidth(t[0],e),n>i)return{str:"",width:0};const r=this._clipText(t,e,i,0,t.length-1,"end",!1);if(o&&r.str!==t){const i=$o(t,r.str.length);i!==r.str.length&&(r.str=t.substring(0,i),r.width=this.measureTextWidth(r.str,e))}return r}_clipText(t,e,i,o,n,r,s){let l;if("start"===r)l=this._clipTextStart(t,e,i,o,n),s&&(l.result=s+l.str);else if("middle"===r){const o=this._clipTextMiddle(t,e,i,"","",0,0,1);l={str:"none",width:o.width,result:o.left+s+o.right}}else l=this._clipTextEnd(t,e,i,o,n),s&&(l.result=l.str+s);return l}_clipTextEnd(t,e,i,o,n){const r=Math.floor((o+n)/2),s=t.substring(0,r+1),l=this.measureTextWidth(s,e);let a;if(l>i){if(s.length<=1)return{str:"",width:0};const n=t.substring(0,r);return a=this.measureTextWidth(n,e),a<=i?{str:n,width:a}:this._clipTextEnd(t,e,i,o,r)}if(l<i){if(r>=t.length-1)return{str:t,width:this.measureTextWidth(t,e)};const o=t.substring(0,r+2);return a=this.measureTextWidth(o,e),a>=i?{str:s,width:l}:this._clipTextEnd(t,e,i,r,n)}return{str:s,width:l}}_clipTextStart(t,e,i,o,n){const r=Math.ceil((o+n)/2),s=t.substring(r-1,t.length-1),l=this.measureTextWidth(s,e);let a;if(l>i){if(s.length<=1)return{str:"",width:0};const o=t.substring(r,t.length-1);return a=this.measureTextWidth(o,e),a<=i?{str:o,width:a}:this._clipTextStart(t,e,i,r,t.length-1)}if(l<i){if(r<=0)return{str:t,width:this.measureTextWidth(t,e)};const n=t.substring(r-2,t.length-1);return a=this.measureTextWidth(n,e),a>=i?{str:s,width:l}:this._clipTextStart(t,e,i,o,r)}return{str:s,width:l}}_clipTextMiddle(t,e,i,o,n,r,s,l){const a=t.substring(0,l),h=this.measureTextWidth(a,e);if(h+s>i)return{left:o,right:n,width:r+s};const d=t.substring(t.length-l,t.length),c=this.measureTextWidth(d,e);return h+c>i?{left:a,right:n,width:h+s}:this._clipTextMiddle(t,e,i,a,d,h,c,l+1)}clipTextWithSuffixVertical(t,e,i,o,n,r){if(""===o)return this.clipTextVertical(t,e,i,n);if(0===t.length)return{verticalList:t,width:0};const s=this.clipTextVertical(t,e,i,n);if(s.verticalList.length===t.length&&s.verticalList[s.verticalList.length-1].width===t[t.length-1].width)return s;const l=this.measureTextWidth(o,e);if(l>i)return s;let a;if(i-=l,"start"===r){const r=this.revertVerticalList(t);a=this.clipTextVertical(r,e,i,n);const s=this.revertVerticalList(a.verticalList);s.unshift({text:o,direction:1,width:l}),a.verticalList=s}else if("middle"===r){const r=this.clipTextVertical(t,e,i/2,n),s=this.revertVerticalList(t),h=this.clipTextVertical(s,e,i/2,n);r.verticalList.push({text:o,direction:1,width:l}),this.revertVerticalList(h.verticalList).forEach((t=>r.verticalList.push(t))),a={verticalList:r.verticalList,width:r.width+h.width}}else a=this.clipTextVertical(t,e,i,n),a.verticalList.push({text:o,direction:1,width:l});return a.width+=l,a}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,o,n,r){let s=arguments.length>6&&void 0!==arguments[6]&&arguments[6];if(""===o)return this.clipText(t,e,i,n);if(0===t.length)return{str:"",width:0};const l=this.measureTextWidth(t,e);if(!s&&l<=i)return{str:t,width:l};const a=this.measureTextWidth(o,e);if(a>i)return{str:"",width:0};if(s&&l+a<=i)return{str:t+o,width:l+a};i-=a;const h=this._clipText(t,e,i,0,t.length-1,r,o);if(n&&h.str!==t){const i=$o(t,h.str.length);i!==h.str.length&&(h.result=t.substring(0,i),h.width=this.measureTextWidth(h.str,e))}else s&&h.str===t&&(h.result=t+o);return h.str=h.result,h.width+=a,h}};Ko=Yo([y()],Ko);var qo=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s};const Zo=Symbol.for("TextMeasureContribution");let Jo=class extends Ko{};Jo=qo([y()],Jo);const Qo=new class{constructor(t){const e=t||{};e.defaultScope=e.defaultScope||x,this.options=e,this.id=r.GenAutoIncrementId(),this._bindingDictionary=new Map,this._metadataReader=new k}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 o=this._getNotAllArgs(t,!1,e,i);return this._get(o)}getNamed(t,e){return this.getTagged(t,l,e)}isBound(t){return this._bindingDictionary.has(t)}bind(t){const e=this.options.defaultScope,i=new T(t,e),o=this._bindingDictionary.get(t)||[];return o.push(i),this._bindingDictionary.set(t,o),new H(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 o=this.bind(i);return t(o,e),o},i=()=>t=>this.unbind(t),o=()=>t=>this.isBound(t),n=e=>i=>{const o=this.rebind(i);return t(o,e),o};return t=>({bindFunction:e(t),isboundFunction:o(),rebindFunction:n(t),unbindFunction:i(),unbindAsyncFunction:t=>null})}_getNotAllArgs(t,e,i,o){return{avoidConstraints:!1,isMultiInject:e,serviceIdentifier:t,key:i,value:o}}_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),o=Object.keys(i),n=[];for(let t=0;t<o.length;t++){const e=i[t],o={};e.forEach((t=>{o[t.key]=t.value}));const r={inject:o[a],multiInject:o[h]},s=r.inject||r.multiInject,l={serviceIdentifier:s,constructorArgsMetadata:e},d={injectIdentifier:s,metadata:e,bindings:this._bindingDictionary.get(s).filter((t=>t.constraint(l)))};n.push(d)}return n}_resolveFromBinding(t){const e=this._getResolvedFromBinding(t);return this._saveToScope(t,e),e}_getResolvedFromBinding(t){let e;switch(t.type){case _:case B:e=t.cache;break;case R: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){return e.length?new t(...this._resolveRequests(e)):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===w&&(t.cache=e,t.activated=!0)}},tn=Symbol.for("CanvasFactory"),en=Symbol.for("Context2dFactory");function on(t){return Qo.getNamed(tn,Oo.global.env)(t)}const nn=new class{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=on(Object.assign({nativeCanvas:Oo.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=on(Object.assign({nativeCanvas:Oo.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(){this.pools=[]}};var rn=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s},sn=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};const ln=Symbol.for("VWindow"),an=Symbol.for("WindowHandlerContribution");let hn=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 D(["x","y","width","height"])},this.active=()=>{const t=this.global;t.env&&!this.actived&&(Qo.getNamed(an,t.env).configure(this,t),this.actived=!0)},this._uid=r.GenAutoIncrementId(),this.global=Oo.global,this.postInit()}postInit(){this.global.hooks.onSetEnv.tap("window",this.active),this.active()}get style(){var t;return null!==(t=this._handler.getStyle())&&void 0!==t?t:{}}set style(t){this._handler.setStyle(t)}create(t){var e,i;this._handler.createWindow(t);const o=this._handler.getWH();this._width=o.width,this._height=o.height,t.viewBox?this.setViewBox(t.viewBox):!1!==t.canvasControled?this.setViewBox({x1:0,y1:0,x2:this._width,y2:this._height}):this.setViewBox({x1:0,y1:0,x2:null!==(e=t.width)&&void 0!==e?e:this._width,y2:null!==(i=t.height)&&void 0!==i?i:this._height}),this.title=this._handler.getTitle(),this.resizable=!0}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.global.hooks.onSetEnv.unTap("window",this.active),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){this._handler.clearViewBox(t)}setViewBox(t){this._handler.setViewBox(t)}setViewBoxTransform(t,e,i,o,n,r){this._handler.setViewBoxTransform(t,e,i,o,n,r)}getViewBox(){return this._handler.getViewBox()}getViewBoxTransform(){return this._handler.getViewBoxTransform()}pointTransform(t,e){const i=this._handler.getViewBox(),o={x:t,y:e};return this._handler.getViewBoxTransform().transformPoint({x:t,y:e},o),o.x-=i.x1,o.y-=i.y1,o}hasSubView(){const t=this._handler.getViewBox();return!(0===t.x1&&0===t.y1&&this.width===t.width()&&this.height===t.height())}isVisible(t){return this._handler.isVisible(t)}onVisibleChange(t){return this._handler.onVisibleChange(t)}getTopLeft(t){return this._handler.getTopLeft(t)}};hn=rn([y(),sn("design:paramtypes",[])],hn);var dn=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s},cn=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},un=function(t,e){return function(i,o){e(i,o,t)}};let gn=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=Oo.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=nn.shareCanvas();this._canvas=t,this._context=t.getContext("2d")}}bindTextMeasure(t){this._textMeasure=t}measureText(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"native";var o;this.configure(this.global,this.global.env);const n=this.global.measureTextMethod;this.global.measureTextMethod=i;const r={width:this._textMeasure.measureTextWidth(t,e),height:null!==(o=e.fontSize)&&void 0!==o?o:Co.fontSize};return this.global.measureTextMethod=n,r}createTextMeasureInstance(t,e,i){return this.configure(this.global,this.global.env),new ti(Object.assign({defaultFontParams:{fontFamily:Co.fontFamily,fontSize:Co.fontSize},getCanvasForMeasure:i||(()=>this.canvas),getTextBounds:void 0,specialCharSet:"-/: .,@%'\"~"+ti.ALPHABET_CHAR_SET+ti.ALPHABET_CHAR_SET.toUpperCase()},null!=e?e:{}),t)}drawGraphicToCanvas(t,e,i){if(!e.defaultLayer)return null;const o=Qo.get(ln),n=t.AABBBounds,r=n.width(),s=n.height(),l=-n.x1,a=-n.y1;o.create({viewBox:{x1:l,y1:a,x2:n.x2,y2:n.y2},width:r,height:s,canvas:i,dpr:e.window.dpr,canvasControled:!0,offscreen:!0,title:""});const h=e.params.optimize.disableCheckGraphicWidthOutRange;e.params.optimize.disableCheckGraphicWidthOutRange=!0,e.defaultLayer.getNativeHandler().drawTo(o,[t],{transMatrix:o.getViewBoxTransform(),viewBox:o.getViewBox(),stage:e,layer:e.defaultLayer,renderService:e.renderService,background:"transparent",clear:!0,updateBounds:!1}),e.params.optimize.disableCheckGraphicWidthOutRange=h;const d=o.getNativeHandler();return d.nativeCanvas?d.nativeCanvas:null}};var pn;gn=dn([y(),un(0,b(z)),un(0,C(Zo)),cn("design:paramtypes",[Object])],gn),function(t){t[t.transform=0]="transform",t[t.matrix=1]="matrix"}(pn||(pn={}));const fn=new Se;let mn=class{constructor(){this.matrix=new Se}init(t){return this.mode=pn.transform,this.originTransform=t,this.matrix.reset(),this}fromMatrix(t,e){return this.mode=pn.matrix,this.outSourceMatrix=t,this.outTargetMatrix=e,this}scaleMatrix(t,e,i){const o=this.outSourceMatrix;if(fn.setValue(o.a,o.b,o.c,o.d,o.e,o.f),this.outTargetMatrix.reset(),i){const{x:o,y:n}=i;this.outTargetMatrix.translate(o,n),this.outTargetMatrix.scale(t,e),this.outTargetMatrix.translate(-o,-n)}else this.outTargetMatrix.scale(t,e);return this.outTargetMatrix.multiply(fn.a,fn.b,fn.c,fn.d,fn.e,fn.f),this}rotateMatrix(t,e){const i=this.outSourceMatrix;if(fn.setValue(i.a,i.b,i.c,i.d,i.e,i.f),this.outTargetMatrix.reset(),e){const{x:i,y:o}=e;this.outTargetMatrix.translate(i,o),this.outTargetMatrix.rotate(t),this.outTargetMatrix.translate(-i,-o)}else this.outTargetMatrix.rotate(t);return this.outTargetMatrix.multiply(fn.a,fn.b,fn.c,fn.d,fn.e,fn.f),this}scale(t,e,i){return this.mode===pn.matrix?this.scaleMatrix(t,e,i):this}rotate(t,e){return this.mode===pn.matrix?this.rotateMatrix(t,e):this}translateMatrix(t,e){const i=this.outSourceMatrix;return fn.setValue(i.a,i.b,i.c,i.d,i.e,i.f),this.outTargetMatrix.reset(),this.outTargetMatrix.translate(t,e),this.outTargetMatrix.multiply(fn.a,fn.b,fn.c,fn.d,fn.e,fn.f),this}translate(t,e){return this.mode===pn.matrix?this.translateMatrix(t,e):this}simplify(t){return this.mode===pn.matrix?this.simplifyMatrix(t):this}simplifyMatrix(t){return this}};mn=dn([y(),cn("design:paramtypes",[])],mn);const bn={arc:So,area:Ao,circle:Bo,line:To,path:ko,symbol:Lo,text:Ho,rect:Eo,polygon:Po,richtext:zo,richtextIcon:Io,image:Fo,group:Ro,glyph:Mo},vn=Object.keys(bn);function yn(t,e){Object.keys(e).forEach((i=>{t[i]=e[i]}))}const Cn={arc:Object.assign({},bn.arc),area:Object.assign({},bn.area),circle:Object.assign({},bn.circle),line:Object.assign({},bn.line),path:Object.assign({},bn.path),symbol:Object.assign({},bn.symbol),text:Object.assign({},bn.text),rect:Object.assign({},bn.rect),polygon:Object.assign({},bn.polygon),richtext:Object.assign({},bn.richtext),richtextIcon:Object.assign({},bn.richtextIcon),image:Object.assign({},bn.image),group:Object.assign({},bn.group),glyph:Object.assign({},bn.glyph)};class wn{constructor(){this.initTheme(),this.dirty=!1}initTheme(){this._defaultTheme={},vn.forEach((t=>{this._defaultTheme[t]=Object.create(Cn[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,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(this.dirty){const o=this.getParentWithTheme(t);if(o){const t=o.theme;(t.dirty||i)&&t.applyTheme(o,e,!0)}this.userTheme?this.doCombine(o&&o.theme.combinedTheme):(o?this.combinedTheme=o.theme.combinedTheme:(this.combinedTheme=this._defaultTheme,Wt.getInstance().warn("未知错误,走到不应该走的区域里")),this.dirty=!1)}return this.combinedTheme}doCombine(t){const e=this.userTheme,i=this.combinedTheme;vn.forEach((o=>{const n=Object.create(Cn[o]);t&&t[o]&&yn(n,t[o]),i[o]&&yn(n,i[o]),e[o]&&yn(n,e[o]),this.combinedTheme[o]=n})),e.common&&vn.forEach((t=>{yn(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 xn=new wn;function _n(t,e){return t.glyphHost?_n(t.glyphHost):e?(t.isContainer,e):function(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)):xn.getTheme()}return null}(t)||t.attachedThemeGraphic&&_n(t.attachedThemeGraphic)||xn.getTheme()}var Sn=function(t,e,i,o){return new(i||(i=Promise))((function(n,r){function s(t){try{a(o.next(t))}catch(t){r(t)}}function l(t){try{a(o.throw(t))}catch(t){r(t)}}function a(t){var e;t.done?n(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(s,l)}a((o=o.apply(t,e||[])).next())}))};class An extends Y{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=r.GenAutoIncrementId(),this._firstChild=null,this._lastChild=null,this.parent=null,this._count=1}forEachChildren(t){if(arguments.length>1&&void 0!==arguments[1]&&arguments[1]){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){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return Sn(this,void 0,void 0,(function*(){if(e){let e=this._lastChild,i=0;for(;e;){let o=t(e,i++);if(o.then&&(o=yield o),o)return;e=e._prev}}else{let e=this._firstChild,i=0;for(;e;){let o=t(e,i++);if(o.then&&(o=yield o),o)return;e=e._next}}}))}forEach(t){return this.forEachChildren(t)}appendChild(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(this._uid===t._uid)return null;if(!e&&t.isAncestorsOf(this))throw new Error("【Node::appendChild】不能将父辈元素append为子元素");return t.parent&&t.parent.removeChild(t),t.parent=this,this._lastChild?(this._lastChild._next=t,t._prev=this._lastChild,this._lastChild=t):(this._firstChild=this._lastChild=t,t._prev=t._next=null),this._idMap||(this._idMap=new Map),this._idMap.set(t._uid,t),this.setCount(t.count),this._structEdit=!0,t}appendChildArrHighPerformance(t){return 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,e){if(!this._ignoreWarn&&this._nodeList&&Wt.getInstance().warn("insertIntoKeepIdx和insertInto混用可能会存在错误"),e>=this.childrenCount)return this.appendChild(t);if(this._uid===t._uid)return null;if(t.isAncestorsOf(this))throw new Error("【Node::insertBefore】不能将父辈元素insert为子元素");if(t.parent&&t.parent.removeChild(t),t.parent=this,0===e)t._next=this._firstChild,this._firstChild&&(this._firstChild._prev=t),t._prev=null,this._firstChild=t;else{let i=this._firstChild;for(let t=0;t<e;t++){if(!i)return null;t>0&&(i=i._next)}if(!i)return null;t._next=i._next,t._prev=i,i._next=t,t._next&&(t._next._prev=t)}return this._idMap||(this._idMap=new Map),this._idMap.set(t._uid,t),this._structEdit=!0,this.setCount(t.count),t}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 o=this.insertInto(t,0);return this._ignoreWarn=!1,o}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(t){if(!this._idMap)return;this._nodeList&&(this._nodeList.length=0);let e=this._firstChild;for(;e;){const t=e._next;e.parent=null,e._prev=null,e._next=null,e=e._next,e=t}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){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=null;return this.forEachChildren(((e,o)=>!(e===this||!t(e,o)||(i=e,0)))),e&&this.forEachChildren((e=>{if(e.isContainer){const o=e.find(t,!0);if(o)return i=o,!0}return!1})),i}findAll(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=[];return this.forEachChildren(((e,o)=>{e!==this&&t(e,o)&&i.push(e)})),e&&this.forEachChildren((e=>{if(e.isContainer){const o=e.findAll(t,!0);o.length&&(i=i.concat(o))}})),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){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[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,e,i){const o=q(i,!0)&&i||tt(i)&&i.capture,n=tt(i)&&i.once,r=Z(e)?void 0:e;return t=o?`${t}capture`:t,e=Z(e)?e:e.handleEvent,n?super.once(t,e,r):super.on(t,e,r),this}on(t,e,i){return this.addEventListener(t,e,i)}removeEventListener(t,e,i){const o=q(i,!0)&&i||tt(i)&&i.capture,n=Z(e)?void 0:e;t=o?`${t}capture`:t,e=Z(e)?e:e.handleEvent;const r=tt(i)&&i.once;return super.off(t,e,n,r),this}off(t,e,i){return this.removeEventListener(t,e,i)}once(t,e,i){return tt(i)?(i.once=!0,this.addEventListener(t,e,i)):this.addEventListener(t,e,{once:!0})}removeAllEventListeners(){return super.removeAllListeners(),this}removeAllListeners(){return this.removeAllEventListeners()}dispatchEvent(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),o=1;o<e;o++)i[o-1]=arguments[o];return super.emit(t.type,t,...i),!t.defaultPrevented}emit(t,e){return this.dispatchEvent(t,e)}release(){this.removeAllListeners()}}class Bn{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=Bn.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.composedDetailPath(),this.path}composedDetailPath(){return this.pickParams&&this.pickParams.graphic?(this.detailPath=this.path.slice(),this._composedDetailPath(this.pickParams)):this.detailPath=this.path.slice(),this.detailPath}_composedDetailPath(t){if(t&&t.graphic){const e=this.pickParams.graphic;if(e.stage){const i=e.stage.eventSystem.manager.propagationPath(e);this.detailPath.push(i),this._composedDetailPath(t.params)}}}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 Rn extends Bn{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,o,n,r,s,l,a,h,d,c,u,g,p){throw new Error("Method not implemented.")}}class Mn extends Rn{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 o=new Mn(this.manager);o.eventPhase=o.NONE,o.currentTarget=null,o.path=[],o.detailPath=[],o.target=null,o.nativeEvent=this.nativeEvent,o.originalEvent=this.originalEvent,null===(t=this.manager)||void 0===t||t.copyPointerData(this,o),null===(e=this.manager)||void 0===e||e.copyMouseData(this,o),null===(i=this.manager)||void 0===i||i.copyData(this,o),o.target=this.target,o.path=this.composedPath().slice();const n=this.composedDetailPath();return o.detailPath=n&&n.slice(),o.type=this.type,o}}class Tn extends Rn{constructor(){super(...arguments),this.DOM_DELTA_PIXEL=0,this.DOM_DELTA_LINE=1,this.DOM_DELTA_PAGE=2}clone(){var t,e,i;const o=new Tn(this.manager);o.eventPhase=o.NONE,o.currentTarget=null,o.path=[],o.detailPath=[],o.target=null,o.nativeEvent=this.nativeEvent,o.originalEvent=this.originalEvent,null===(t=this.manager)||void 0===t||t.copyWheelData(this,o),null===(e=this.manager)||void 0===e||e.copyMouseData(this,o),null===(i=this.manager)||void 0===i||i.copyData(this,o),o.target=this.target,o.path=this.composedPath().slice();const n=this.composedDetailPath();return o.detailPath=n&&n.slice(),o.type=this.type,o}}Tn.DOM_DELTA_PIXEL=0,Tn.DOM_DELTA_LINE=1,Tn.DOM_DELTA_PAGE=2;class kn extends Bn{constructor(t,e){super(),this.type=t,this.detail=e}}const Pn="object"==typeof performance&&performance.now?performance:Date;function En(t){return"mouse"===t||"pen"===t}const Ln={dispatchEvent(t){var e;if(!(t instanceof Bn))throw new Error("DisplayObject cannot propagate events outside of the Federated Events API");return t.defaultPrevented=!1,t.path=[],t.detailPath&&(t.detailPath=[]),t.target=this,null===(e=null==t?void 0:t.manager)||void 0===e||e.dispatchEvent(t),!t.defaultPrevented},emit(t,e){return this.dispatchEvent(new kn(t,e))}},Hn={touchstart:"pointerdown",touchend:"pointerup",touchendoutside:"pointerupoutside",touchmove:"pointermove",touchcancel:"pointercancel"};class zn{constructor(t){this.resolution=1,this.onPointerDown=t=>{if(this.supportsTouchEvents&&"touch"===t.pointerType)return;const e=this.normalizeToPointerData(t);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],o=this.bootstrapEvent(this.rootPointerEvent,i);this.manager.mapEvent(o)}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.isEventOutsideOfTargetViewPort(t)?"outside":"",i=this.normalizeToPointerData(t);for(let t=0,o=i.length;t<o;t++){const o=this.bootstrapEvent(this.rootPointerEvent,i[t]);o.type+=e,this.manager.mapEvent(o)}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:o,global:n,autoPreventDefault:r=!1,clickInterval:s,supportsTouchEvents:l=n.supportsTouchEvents,supportsPointerEvents:a=n.supportsPointerEvents}=t;this.manager=new class{constructor(t,e){this.dispatch=new Y,this.cursorTarget=null,this.pauseNotify=!1,this.mappingState={trackingData:{}},this.eventPool=new Map,this.onPointerDown=(t,e)=>{if(!(t instanceof Mn))return void Wt.getInstance().warn("EventManager cannot map a non-pointer event as a pointer event");const i=this.createPointerEvent(t,t.type,e);if(this.dispatchEvent(i,"pointerdown"),"touch"===i.pointerType)this.dispatchEvent(i,"touchstart");else if(En(i.pointerType)){const t=2===i.button;this.dispatchEvent(i,t?"rightdown":"mousedown")}this.trackingData(t.pointerId).pressTargetsByButton[t.button]=i.composedPath(),this.freeEvent(i)},this.onPointerMove=(t,e)=>{var i,o;if(!(t instanceof Mn))return void Wt.getInstance().warn("EventManager cannot map a non-pointer event as a pointer event");const n=this.createPointerEvent(t,t.type,e),r=En(n.pointerType),s=this.trackingData(t.pointerId),l=this.findMountedTarget(s.overTargets);if(s.overTargets&&l&&l!==this.rootTarget&&l!==n.target){const e="mousemove"===t.type?"mouseout":"pointerout",i=this.createPointerEvent(t,e,l||void 0);if(this.dispatchEvent(i,"pointerout"),r&&this.dispatchEvent(i,"mouseout"),!n.composedPath().includes(l)){const e=this.createPointerEvent(t,"pointerleave",l||void 0);for(e.eventPhase=e.AT_TARGET;e.target&&!n.composedPath().includes(e.target);)e.currentTarget=e.target,this.notifyTarget(e),r&&this.notifyTarget(e,"mouseleave"),e.target=e.target.parent;this.freeEvent(e)}this.freeEvent(i)}if(l!==n.target){const e="mousemove"===t.type?"mouseover":"pointerover",i=this.clonePointerEvent(n,e);this.dispatchEvent(i,"pointerover"),r&&this.dispatchEvent(i,"mouseover");let o=null==l?void 0:l.parent;for(;o&&o!==this.rootTarget.parent&&o!==n.target;)o=o.parent;if(!o||o===this.rootTarget.parent){const t=this.clonePointerEvent(n,"pointerenter");t.eventPhase=t.AT_TARGET;let e=t.target;const i=new Set;let o=l;for(;o&&o!==this.rootTarget;)i.add(o),o=o.parent;for(;e&&e!==l&&e!==this.rootTarget.parent;)i.has(e)||(t.currentTarget=e,this.notifyTarget(t),r&&this.notifyTarget(t,"mouseenter")),e=e.parent;this.freeEvent(t)}this.freeEvent(i)}this.dispatchEvent(n,"pointermove"),"touch"===n.pointerType&&this.dispatchEvent(n,"touchmove"),r&&(this.dispatchEvent(n,"mousemove"),this.cursorTarget=n.target,this.cursor=(null===(o=null===(i=n.target)||void 0===i?void 0:i.attribute)||void 0===o?void 0:o.cursor)||this.rootTarget.getCursor()),s.overTargets=n.composedPath(),this.freeEvent(n)},this.onPointerOver=(t,e)=>{var i,o;if(!(t instanceof Mn))return void Wt.getInstance().warn("EventManager cannot map a non-pointer event as a pointer event");const n=this.trackingData(t.pointerId),r=this.createPointerEvent(t,t.type,e),s=En(r.pointerType);this.dispatchEvent(r,"pointerover"),s&&this.dispatchEvent(r,"mouseover"),"mouse"===r.pointerType&&(this.cursorTarget=r.target,this.cursor=(null===(o=null===(i=r.target)||void 0===i?void 0:i.attribute)||void 0===o?void 0:o.cursor)||this.rootTarget.getCursor());const l=this.clonePointerEvent(r,"pointerenter");for(l.eventPhase=l.AT_TARGET;l.target&&l.target!==this.rootTarget.parent;)l.currentTarget=l.target,this.notifyTarget(l),s&&this.notifyTarget(l,"mouseenter"),l.target=l.target.parent;n.overTargets=r.composedPath(),this.freeEvent(r),this.freeEvent(l)},this.onPointerOut=(t,e)=>{if(!(t instanceof Mn))return void Wt.getInstance().warn("EventManager cannot map a non-pointer event as a pointer event");const i=this.trackingData(t.pointerId);if(i.overTargets){const e=En(t.pointerType),o=this.findMountedTarget(i.overTargets),n=this.createPointerEvent(t,"pointerout",o||void 0);this.dispatchEvent(n),e&&this.dispatchEvent(n,"mouseout");const r=this.createPointerEvent(t,"pointerleave",o||void 0);for(r.eventPhase=r.AT_TARGET;r.target&&r.target!==this.rootTarget.parent;)r.currentTarget=r.target,this.notifyTarget(r),e&&this.notifyTarget(r,"mouseleave"),r.target=r.target.parent;i.overTargets=[],this.freeEvent(n),this.freeEvent(r)}this.cursorTarget=null,this.cursor=""},this.onPointerUp=(t,e)=>{var i;if(!(t instanceof Mn))return void Wt.getInstance().warn("EventManager cannot map a non-pointer event as a pointer event");const o=Pn.now(),n=this.createPointerEvent(t,t.type,e);if(this.dispatchEvent(n,"pointerup"),"touch"===n.pointerType)this.dispatchEvent(n,"touchend");else if(En(n.pointerType)){const t=2===n.button;this.dispatchEvent(n,t?"rightup":"mouseup")}const r=this.trackingData(t.pointerId),s=this.findMountedTarget(r.pressTargetsByButton[t.button]);let l=s;if(s&&!n.composedPath().includes(s)){let e=s;for(;e&&!n.composedPath().includes(e);){if(n.currentTarget=e,this.notifyTarget(n,"pointerupoutside"),"touch"===n.pointerType)this.notifyTarget(n,"touchendoutside");else if(En(n.pointerType)){const t=2===n.button;this.notifyTarget(n,t?"rightupoutside":"mouseupoutside")}e=e.parent}delete r.pressTargetsByButton[t.button],l=e}if(l){const e=this.clonePointerEvent(n,"click");e.target=l,e.path=[],e.detailPath=[],r.clicksByButton[t.button]||(r.clicksByButton[t.button]={clickCount:0,target:e.target,timeStamp:o});const s=r.clicksByButton[t.button];s.target===e.target&&o-s.timeStamp<(null!==(i=this._config.clickInterval)&&void 0!==i?i:200)?++s.clickCount:s.clickCount=1,s.target=e.target,s.timeStamp=o,e.detail=s.clickCount,En(e.pointerType)?(this.dispatchEvent(e,"click"),2===s.clickCount&&this.dispatchEvent(e,"dblclick")):"touch"===e.pointerType&&(this.dispatchEvent(e,"tap"),2===s.clickCount&&this.dispatchEvent(e,"dbltap")),this.dispatchEvent(e,"pointertap"),this.freeEvent(e)}this.freeEvent(n)},this.onPointerUpOutside=(t,e)=>{if(!(t instanceof Mn))return void Wt.getInstance().warn("EventManager cannot map a non-pointer event as a pointer event");const i=this.trackingData(t.pointerId),o=this.findMountedTarget(i.pressTargetsByButton[t.button]),n=this.createPointerEvent(t,t.type,e);if(o){let e=o;for(;e;)n.currentTarget=e,this.notifyTarget(n,"pointerupoutside"),"touch"===n.pointerType?this.notifyTarget(n,"touchendoutside"):En(n.pointerType)&&this.notifyTarget(n,2===n.button?"rightupoutside":"mouseupoutside"),e=e.parent;delete i.pressTargetsByButton[t.button]}this.freeEvent(n)},this.onWheel=(t,e)=>{if(!(t instanceof Tn))return void Wt.getInstance().warn("EventManager cannot map a non-wheel event as a wheel event");const i=this.createWheelEvent(t,e);this.dispatchEvent(i),this.freeEvent(i)},this.rootTarget=t,this.mappingTable={},this._config=Object.assign({clickInterval:200},e),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 e,i,o,n,r,s,l;if(!this.rootTarget)return;const a=this.mappingTable[t.type];let h;const d=`${t.canvasX}-${t.canvasY}`;if((null===(e=this._prePointTargetCache)||void 0===e?void 0:e[d])&&(null===(o=null===(i=this._prePointTargetCache)||void 0===i?void 0:i[d])||void 0===o?void 0:o.stage)&&(null===(r=null===(n=this._prePointTargetCache)||void 0===n?void 0:n[d])||void 0===r?void 0:r.stage.renderCount)===(null===(s=this._prePointTargetCache)||void 0===s?void 0:s.stageRenderCount)?h=this._prePointTargetCache[d]:(h=this.pickTarget(t.viewX,t.viewY,t),t.pickParams||(this._prePointTargetCache={[d]:h,stageRenderCount:null!==(l=null==h?void 0:h.stage.renderCount)&&void 0!==l?l:-1})),a)for(let e=0,i=a.length;e<i;e++)a[e].fn(t,h);else Wt.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 o=0,n=i.length-1;o<n;o++)if(t.currentTarget=i[o],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 o=i.length-2;o>=0;o--)if(t.currentTarget=i[o],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){if(this.pauseNotify)return;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){var o,n;const r=this.allocateEvent(Mn);return this.copyPointerData(t,r),this.copyMouseData(t,r),this.copyData(t,r),r.nativeEvent=t.nativeEvent,r.originalEvent=t,r.target=i||this.pickTarget(null!==(o=r.viewX)&&void 0!==o?o:r.global.x,null!==(n=r.viewY)&&void 0!==n?n:r.global.y,r),"string"==typeof e&&(r.type=e),r}createWheelEvent(t,e){var i,o;const n=this.allocateEvent(Tn);return this.copyWheelData(t,n),this.copyMouseData(t,n),this.copyData(t,n),n.nativeEvent=t.nativeEvent,n.originalEvent=t,n.target=e||this.pickTarget(null!==(i=n.viewX)&&void 0!==i?i:n.global.x,null!==(o=n.viewY)&&void 0!==o?o:n.global.y,n),n}clonePointerEvent(t,e){const i=this.allocateEvent(Mn);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();const o=t.composedDetailPath();return i.detailPath=o&&o.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 Mn&&e instanceof Mn&&(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 Rn&&e instanceof Rn&&(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=Pn.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.detailPath=[],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 o=0,n=i.length;o<n&&!t.propagationImmediatelyStopped;o++)i[o].once&&t.currentTarget.removeEventListener(e,i[o].fn,{once:!0}),i[o].fn.call(i[o].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 o=0,n=i.length;o<n&&!t.propagationImmediatelyStopped;o++)i[o].fn.call(i[o].context,t,e)}pickTarget(t,e,i){let o;const n=this.rootTarget.pick(t,e);return o=n&&n.graphic?n.graphic:n&&n.group?n.group:this.rootTarget.AABBBounds.contains(t,e)?this.rootTarget:null,i&&(i.pickParams=n.params),o}release(){this.dispatch.removeAllListeners(),this.eventPool.clear(),this.rootTarget=null,this.mappingTable=null,this.mappingState=null,this.cursorTarget=null}}(o,{clickInterval:s}),this.globalObj=n,this.supportsPointerEvents=a,this.supportsTouchEvents=l,this.supportsMouseEvents=n.supportsMouseEvents,this.applyStyles=n.applyStyles,this.autoPreventDefault=r,this.eventsAdded=!1,this.rootPointerEvent=new Mn,this.rootWheelEvent=new Tn,this.cursorStyles={default:"inherit",pointer:"pointer"},this.resolution=i,this.setTargetElement(e)}release(){this.removeEvents(),this.manager&&this.manager.release(),this.domElement=null,this.manager=null,this.globalObj=null}setCursor(t,e){if(!e&&!this.manager.rootTarget.window._handler.canvas.controled)return;t||(t="default");const{applyStyles:i,domElement:o}=this;if(this.currentCursor===t)return;this.currentCursor=t;const n=this.cursorStyles[t];n?"string"==typeof n&&i?o.style.cursor=n:"function"==typeof n?n(t):"object"==typeof n&&i&&Object.assign(o.style,n):i&&nt(t)&&!yt(this.cursorStyles,t)&&(o.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){return this.domElement.pointTransform?this.domElement.pointTransform(t.x,t.y):t}mapToCanvasPoint(t){var e,i;const o=null===(e=this.globalObj)||void 0===e?void 0:e.mapToCanvasPoint(t,this.domElement);if(o)return o;let n=0,r=0;if(t.changedTouches){const e=null!==(i=t.changedTouches[0])&&void 0!==i?i:{};n=e.clientX||0,r=e.clientY||0}else n=t.clientX||0,r=t.clientY||0;const s=this.domElement.getBoundingClientRect();return{x:n-s.left,y:r-s.top}}normalizeToPointerData(t){const e=[];if(this.supportsTouchEvents&&t.changedTouches&&t.changedTouches.length)for(let i=0,o=t.changedTouches.length;i<o;i++){const o=t.changedTouches[i];ot(o.button)&&(o.button=0),ot(o.buttons)&&(o.buttons=1),ot(o.isPrimary)&&(o.isPrimary=1===t.touches.length&&"touchstart"===t.type),ot(o.width)&&(o.width=o.radiusX||1),ot(o.height)&&(o.height=o.radiusY||1),ot(o.tiltX)&&(o.tiltX=0),ot(o.tiltY)&&(o.tiltY=0),ot(o.pointerType)&&(o.pointerType="touch"),ot(o.pointerId)&&(o.pointerId=o.identifier||0),ot(o.pressure)&&(o.pressure=o.force||.5),ot(o.twist)&&(o.twist=0),ot(o.tangentialPressure)&&(o.tangentialPressure=0),ot(o.layerX)&&(o.layerX=o.offsetX=o.clientX),ot(o.layerY)&&(o.layerY=o.offsetY=o.clientY),o.isNormalized=!0,o.type=t.type,e.push(o)}else if(!this.globalObj.supportsMouseEvents||t instanceof MouseEvent&&!(this.supportsPointerEvents&&t instanceof PointerEvent)){const i=t;ot(i.isPrimary)&&(i.isPrimary=!0),ot(i.width)&&(i.width=1),ot(i.height)&&(i.height=1),ot(i.tiltX)&&(i.tiltX=0),ot(i.tiltY)&&(i.tiltY=0),ot(i.pointerType)&&(i.pointerType="mouse"),ot(i.pointerId)&&(i.pointerId=1),ot(i.pressure)&&(i.pressure=.5),ot(i.twist)&&(i.twist=0),ot(i.tangentialPressure)&&(i.tangentialPressure=0),i.isNormalized=!0,e.push(i)}else e.push(t);return e}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:o}=this.mapToCanvasPoint(t);e.canvas.x=i,e.canvas.y=o,e.global.x=i,e.global.y=o,e.offset.x=i,e.offset.y=o;const{x:n,y:r}=this.mapToViewportPoint(e);return e.viewport.x=n,e.viewport.y=r,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:o}=this.mapToCanvasPoint(e);t.canvas.x=i,t.canvas.y=o,t.global.x=i,t.global.y=o,t.offset.x=i,t.offset.y=o;const{x:n,y:r}=this.mapToViewportPoint(t);return t.viewport.x=n,t.viewport.y=r,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=Hn[t.type]||t.type),t}transferMouseData(t,e){t.isTrusted=e.isTrusted,t.srcElement=e.srcElement,t.timeStamp=Pn.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}isEventOutsideOfTargetViewPort(t){if(this.isEventOutsideOfTargetElement(t))return!0;if(this.domElement.getViewBox){const e=this.mapToViewportPoint(this.mapToCanvasPoint(t)),i=this.domElement.getViewBox(),o=i.width(),n=i.height();return!(e.x<o&&e.y<n&&e.x>0&&e.y>0)}return!1}isEventOutsideOfTargetElement(t){let e=t.target;return t.composedPath&&t.composedPath().length>0&&(e=t.composedPath()[0]),e!==(this.domElement.getNativeHandler?this.domElement.getNativeHandler().nativeCanvas:this.domElement)}pauseTriggerEvent(){this.manager.pauseNotify=!0}resumeTriggerEvent(){this.manager.pauseNotify=!1}}class Fn{constructor(){this.time=0}static Avaliable(){return!0}avaliable(){return Fn.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 In{static Avaliable(){return!0}avaliable(){return In.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 On{static Avaliable(){return!!Oo.global.getRequestAnimationFrame()}avaliable(){return On.Avaliable()}tick(t,e){Oo.global.getRequestAnimationFrame()((()=>{this.released||e(this)}))}release(){this.released=!0}getTime(){return Date.now()}}var Dn;!function(t){t[t.INITIAL=0]="INITIAL",t[t.RUNNING=1]="RUNNING",t[t.PAUSE=2]="PAUSE"}(Dn||(Dn={}));class Wn{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-Wn.bounceOut(1-t)}static bounceInOut(t){return t<.5?.5*Wn.bounceIn(2*t):.5*Wn.bounceOut(2*t-1)+.5}static getElasticIn(t,e){return function(i){if(0===i||1===i)return i;const o=e/ne*Math.asin(1/t);return-t*Math.pow(2,10*(i-=1))*Math.sin((i-o)*ne/e)}}static getElasticOut(t,e){return function(i){if(0===i||1===i)return i;const o=e/ne*Math.asin(1/t);return t*Math.pow(2,-10*i)*Math.sin((i-o)*ne/e)+1}}static getElasticInOut(t,e){return function(i){const o=e/ne*Math.asin(1/t);return(i*=2)<1?t*Math.pow(2,10*(i-=1))*Math.sin((i-o)*ne/e)*-.5:t*Math.pow(2,-10*(i-=1))*Math.sin((i-o)*ne/e)*.5+1}}}Wn.quadIn=Wn.getPowIn(2),Wn.quadOut=Wn.getPowOut(2),Wn.quadInOut=Wn.getPowInOut(2),Wn.cubicIn=Wn.getPowIn(3),Wn.cubicOut=Wn.getPowOut(3),Wn.cubicInOut=Wn.getPowInOut(3),Wn.quartIn=Wn.getPowIn(4),Wn.quartOut=Wn.getPowOut(4),Wn.quartInOut=Wn.getPowInOut(4),Wn.quintIn=Wn.getPowIn(5),Wn.quintOut=Wn.getPowOut(5),Wn.quintInOut=Wn.getPowInOut(5),Wn.backIn=Wn.getBackIn(1.7),Wn.backOut=Wn.getBackOut(1.7),Wn.backInOut=Wn.getBackInOut(1.7),Wn.elasticIn=Wn.getElasticIn(1,.3),Wn.elasticOut=Wn.getElasticOut(1,.3),Wn.elasticInOut=Wn.getElasticInOut(1,.3*1.5);class Nn{constructor(){this.id=r.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(t){if(this.paused)return;let e=this.animateHead;for(this.animateCount=0;e;)e.status===Bi.END?this.removeAnimate(e):e.status===Bi.RUNNING||e.status===Bi.INITIAL?(this.animateCount++,e.advance(t)):e.status===Bi.PAUSED&&this.animateCount++,e=e.nextAnimate}clear(){let t=this.animateHead;for(;t;)t.release(),t=t.nextAnimate;this.animateHead=null,this.animateTail=null,this.animateCount=0}removeAnimate(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];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 Gn=new Nn;class jn{constructor(t,e,i,o,n){this.from=t,this.to=e,this.duration=i,this.easing=o,this.params=n,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 Vn extends jn{constructor(t){super(null,null,0,"linear"),this.cb=t}onUpdate(t,e,i){}onStart(){this.cb()}}class Un{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:r.GenAutoIncrementId(),e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Gn;this.id=t,this.timeline=e,this.status=Bi.INITIAL,this.tailAnimate=new $n(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 e=-1/0;return t.forEach((t=>{e=ae(t.getDuration(),e)})),this._startTime=e,this}parallel(t){return this._startTime=t.getStartTime(),this}static AddInterpolate(t,e){Un.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(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Un.mode;t&&e&Ri.SET_ATTR_IMMEDIATELY&&this.target.setAttributes&&this.target.setAttributes(t,!1,{type:Ai.ANIMATE_PLAY})}runCb(t){const e=new Vn((()=>{t(this,e.step.prev)}));return this.tailAnimate.play(e),this}customInterpolate(t,e,i,o,n,r){const s=Un.interpolateMap.get(t)||Un.interpolateMap.get("");return!!s&&s(t,e,i,o,n,r)}pause(){this.status===Bi.RUNNING&&(this.status=Bi.PAUSED)}resume(){this.status===Bi.PAUSED&&(this.status=Bi.RUNNING)}to(t,e,i,o){if(this.tailAnimate.to(t,e,i,o),this.target){const t=this.target.stage;t&&t.renderNextFrame()}return this}from(t,e,i,o){if(this.tailAnimate.from(t,e,i,o),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 $n(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(t){if(this._duringTime<this._startTime){if(this._duringTime+t*this.timeScale<this._startTime)return void(this._duringTime+=t*this.timeScale);t=this._duringTime+t*this.timeScale-this._startTime,this._duringTime=this._startTime}this.status===Bi.INITIAL&&(this.status=Bi.RUNNING,this._onStart&&this._onStart.forEach((t=>t()))),this.setPosition(this.rawPosition+t*this.timeScale)&&this.status===Bi.RUNNING&&(this.status=Bi.END,this._onEnd&&this._onEnd.forEach((t=>t())))}setPosition(t){let e,i=0;const o=this.rawPosition,n=this.subAnimates.reduce(((t,e)=>t+e.totalDuration),0);t<0&&(t=0);const r=t>=n;if(r&&(t=n),t===o)return r;for(let o=0;o<this.subAnimates.length&&(e=this.subAnimates[o],!(i+e.totalDuration>=t));o++)i+=e.totalDuration,e=void 0;return this.rawPosition=t,e.setPosition(t-i),r}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=Bi.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()}}Un.mode=Ri.NORMAL,Un.interpolateMap=new Map;class $n{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 Xn(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(t){let e=t.duration;(null==e||e<0)&&(e=0);const i=t.easing,o="string"==typeof i?Wn[i]:i,n=this._addStep(e,null,o);return n.type=Mi.customAnimate,this._appendProps(t.getEndProps(),n,!1),this._appendCustomAnimate(t,n),this}to(t,e,i,o){(null==e||e<0)&&(e=0);const n="string"==typeof i?Wn[i]:i,r=this._addStep(e,null,n);return r.type=Mi.to,this._appendProps(t,r,!!o&&o.tempProps),r.propKeys||(r.propKeys=Object.keys(r.props)),o&&o.noPreventAttrs||this.target.animates.forEach((t=>{t.id!==this.animate.id&&t.preventAttrs(r.propKeys)})),this}from(t,e,i,o){this.to(t,0,i,o);const n={};this.stepTail.propKeys||(this.stepTail.propKeys=Object.keys(this.stepTail.props)),this.stepTail.propKeys.forEach((t=>{n[t]=this.getLastPropByName(t,this.stepTail)})),this.to(n,e,i,o),this.stepTail.type=Mi.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(t){if(t>0){const e=this._addStep(+t,null);e.type=Mi.wait,e.prev.customAnimate?e.props=e.prev.customAnimate.getEndProps():e.props=e.prev.props,this.target.onAddStep&&this.target.onAddStep(e)}return this}_addStep(t,e,i){const o=new Xn(this.duration,t,e,i);return this.duration+=t,this.stepTail.append(o),this.stepTail=o,o}_appendProps(t,e,i){e.props=i?t:Object.assign({},t);let o=e.prev;const n=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))}));o.prev;)o.props&&(o.propKeys||(o.propKeys=Object.keys(o.props)),o.propKeys.forEach((t=>{void 0===n[t]&&(n[t]=o.props[t])}))),e.propKeys=Object.keys(e.props),o=o.prev;const r=this.stepHead.props;e.propKeys||(e.propKeys=Object.keys(n)),e.propKeys.forEach((t=>{if(void 0===r[t]){const e=this.animate.getStartProps();r[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,o=this.loop,n=this.rawPosition;let r,s,l=!1;const a=null!==(e=this._startAt)&&void 0!==e?e:0;if(t<0&&(t=0),t<a)return this.rawPosition=t,!1;if(t-=a,i<=0)return l=!0,l;if(r=Math.floor(t/i),s=t-r*i,l=t>=o*i+i,l&&(s=i,r=o,t=s*r+i),t===n)return l;const h=!this.reversed!=!(this.bounce&&r%2);return h&&(s=i-s),this._deltaPosition=s-this.position,this.position=s,this.rawPosition=t+a,this.updatePosition(l,h),l}updatePosition(t,e){if(!this.stepHead)return;let i=this.stepHead.next;const o=this.position,n=this.duration;if(this.target&&i){let r=i.next;for(;r&&r.position<=o;)i=r,r=i.next;let s=t?0===n?1:o/n:(o-i.position)/i.duration;i.easing&&(s=i.easing(s)),this.tryCallCustomAnimateLifeCycle(i,this._lastStep||(e?this.stepTail:this.stepHead),e),this.updateTarget(i,s,t),this._lastStep=i,this.animate._onFrame&&this.animate._onFrame.forEach((t=>t(i,s)))}}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,e){let i=e.prev;for(;i;){if(i.props&&void 0!==i.props[t])return i.props[t];if(i.customAnimate){const e=i.customAnimate.getEndProps()[t];if(void 0!==e)return e}i=i.prev}return Wt.getInstance().warn("未知错误,step中找不到属性"),e.props[t]}updateTarget(t,e,i){null==t.props&&null==t.customAnimate||this.target.onStep(this,this.animate,t,e,i)}}class Xn{constructor(t,e,i,o){this.duration=e,this.position=t,this.props=i,this.easing=o}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 Yn=200,Kn="cubicOut";var qn;!function(t){t[t.Top=1]="Top",t[t.Right=2]="Right",t[t.Bottom=4]="Bottom",t[t.Left=8]="Left",t[t.ALL=15]="ALL"}(qn||(qn={}));const Zn=[!1,!1,!1,!1],Jn=[0,0,0,0],Qn=t=>t?rt(t)?0===t.length?0:1===t.length?t[0]:2===t.length?(Jn[0]=t[0],Jn[2]=t[0],Jn[1]=t[1],Jn[3]=t[1],Jn):t:t:0,tr=[{x:0,y:0},{x:0,y:0},{x:0,y:0},{x:0,y:0}],er=[1,2,3,0,1,2,3,0];function ir(t,e,i,o){for(;t>=ne;)t-=ne;for(;t<0;)t+=ne;for(;t>e;)e+=ne;tr[0].x=i,tr[1].y=i,tr[2].x=-i,tr[3].y=-i;const n=Math.ceil(t/ie)%4,r=Math.ceil(e/ie)%4;if(o.add(le(t)*i,de(t)*i),o.add(le(e)*i,de(e)*i),n!==r||e-t>ee){let t=!1;for(let e=0;e<er.length;e++)if(t||n!==er[e]){if(t&&r===er[e])break;if(t){const t=tr[er[e]];o.add(t.x,t.y)}}else{t=!0;const e=tr[n];o.add(e.x,e.y)}}}function or(t,e,i){const{x:o,y:n}=fe(t.x,t.y,e.x,e.y,i),{x:r,y:s}=fe(t.x1,t.y1,e.x1,e.y1,i),l=new me(o,n,r,s);return l.defined=e.defined,l}function nr(t,e,i){if(!t||!e)return[];Array.isArray(t)||(t=[t]),Array.isArray(e)||(e=[e]);let o=[];if(t.length>e.length){o=e.map((t=>{const e=new me(t.x,t.y,t.x1,t.y1);return e.defined=t.defined,e}));for(let n=0;n<e.length;n++)o[n]=or(t[n],e[n],i)}else{o=e.map((t=>{const e=new me(t.x,t.y,t.x1,t.y1);return e.defined=t.defined,e}));for(let n=0;n<t.length;n++)o[n]=or(t[n],e[n],i)}return o}function rr(t,e){if(rt(t)){let i;for(let o=0;o<t.length&&void 0===i;o++)i=t[o][e];return i}return t[e]}class sr{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:sr.TimeOut;this.durations=[],this.timeout=t,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)}}sr.TimeOut=1e3/60;const lr=new sr,ar=(t,e)=>nt(t)&&"%"===t[t.length-1]?e*(Number.parseFloat(t.substring(0,t.length-1))/100):t;var hr;!function(t){t[t.Color255=0]="Color255",t[t.Color1=1]="Color1"}(hr||(hr={}));class dr{static Get(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:hr.Color1,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[0,0,0,1];if(e===hr.Color1){const e=dr.store1[t];if(e)return i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[3],i;const o=ze.parseColorString(t);if(o){const e=[o.r/255,o.g/255,o.b/255,o.opacity];dr.store1[t]=e,dr.store255[t]=[o.r,o.g,o.b,o.opacity],i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[3]}return i}const o=dr.store255[t];if(o)return i[0]=o[0],i[1]=o[1],i[2]=o[2],i[3]=o[3],i;const n=ze.parseColorString(t);return n&&(dr.store1[t]=[n.r/255,n.g/255,n.b/255,n.opacity],dr.store255[t]=[n.r,n.g,n.b,n.opacity],i[0]=n.r,i[1]=n.g,i[2]=n.b,i[3]=n.opacity),i}static Set(t,e,i){if(e===hr.Color1){if(dr.store1[t])return;dr.store1[t]=i,dr.store255[t]=[Math.floor(255*i[0]),Math.floor(255*i[1]),Math.floor(255*i[2]),Math.floor(255*i[3])]}else{if(dr.store255[t])return;dr.store255[t]=i,dr.store1[t]=[i[0]/255,i[1]/255,i[2]/255,i[3]]}}}function cr(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return Array.isArray(t)&&at(t[0])?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 ur(t,e,i,o,n){return Array.isArray(t)&&!at(t[0])||Array.isArray(e)&&!at(e[0])?new Array(4).fill(0).map(((n,r)=>gr(rt(t)?t[r]:t,rt(e)?e[r]:e,i,o))):gr(t,e,i,o,n)}function gr(t,e,i,o,n){if(!t||!e)return t&&cr(t)||e&&cr(e)||!1;let r,s,l=!1,a=!1;if(Array.isArray(t)?r=t:"string"==typeof t?r=dr.Get(t,hr.Color255):l=!0,Array.isArray(e)?s=e:"string"==typeof e?s=dr.Get(e,hr.Color255):a=!0,l!==a){const r=l?t:e,s=l?e:t,a=Object.assign(Object.assign({},r),{stops:r.stops.map((t=>Object.assign(Object.assign({},t),{color:cr(s)})))});return l?ur(r,a,i,o,n):ur(a,r,i,o,n)}if(l){if(t.gradient===e.gradient){const o=t,n=e,r=o.stops,s=n.stops;if(r.length!==s.length)return!1;if("linear"===o.gradient)return function(t,e,i){const o=t.stops,n=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(o.length).fill(0).map(((t,e)=>({color:mr(o[e].color,n[e].color,i),offset:o[e].offset+(n[e].offset-o[e].offset)*i})))}}(o,n,i);if("radial"===o.gradient)return function(t,e,i){const o=t.stops,n=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(o.length).fill(0).map(((t,e)=>({color:mr(o[e].color,n[e].color,i),offset:o[e].offset+(n[e].offset-o[e].offset)*i})))}}(o,n,i);if("conical"===o.gradient)return function(t,e,i){const o=t.stops,n=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(o.length).fill(0).map(((t,e)=>({color:mr(o[e].color,n[e].color,i),offset:o[e].offset+(n[e].offset-o[e].offset)*i})))}}(o,n,i)}return!1}return n&&n(r,s),cr(function(t,e,i){return[t[0]+(e[0]-t[0])*i,t[1]+(e[1]-t[1])*i,t[2]+(e[2]-t[2])*i,t[3]+(e[3]-t[3])*i]}(r,s,i),o)}dr.store255={},dr.store1={};const pr=[0,0,0,0],fr=[0,0,0,0];function mr(t,e,i){return dr.Get(t,hr.Color255,pr),dr.Get(e,hr.Color255,fr),`rgba(${Math.round(pr[0]+(fr[0]-pr[0])*i)},${Math.round(pr[1]+(fr[1]-pr[1])*i)},${Math.round(pr[2]+(fr[2]-pr[2])*i)},${pr[3]+(fr[3]-pr[3])*i})`}class br{static GetImage(t,e){var i;const o=br.cache.get(t);o?"fail"===o.loadState?Oo.global.getRequestAnimationFrame()((()=>{e.imageLoadFail(t)})):"init"===o.loadState||"loading"===o.loadState?null===(i=o.waitingMark)||void 0===i||i.push(e):e&&e.imageLoadSuccess(t,o.data):br.loadImage(t,e)}static GetSvg(t,e){var i;let o=br.cache.get(t);o?"fail"===o.loadState?Oo.global.getRequestAnimationFrame()((()=>{e.imageLoadFail(t)})):"init"===o.loadState||"loading"===o.loadState?null===(i=o.waitingMark)||void 0===i||i.push(e):e&&e.imageLoadSuccess(t,o.data):(o={type:"image",loadState:"init"},br.cache.set(t,o),o.dataPromise=Oo.global.loadSvg(t),o.dataPromise?(o.waitingMark=[e],o.dataPromise.then((e=>{var i;o.loadState=(null==e?void 0:e.data)?"success":"fail",o.data=null==e?void 0:e.data,null===(i=o.waitingMark)||void 0===i||i.map(((i,n)=>{(null==e?void 0:e.data)?(o.loadState="success",o.data=e.data,i.imageLoadSuccess(t,e.data)):(o.loadState="fail",i.imageLoadFail(t))}))}))):(o.loadState="fail",e.imageLoadFail(t)))}static GetFile(t,e){let i=br.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"},br.cache.set(t,i),"arrayBuffer"===e?i.dataPromise=Oo.global.loadArrayBuffer(t):"blob"===e?i.dataPromise=Oo.global.loadBlob(t):"json"===e&&(i.dataPromise=Oo.global.loadJson(t)),i.dataPromise.then((t=>t.data)))}static loading(){setTimeout((()=>{if(!br.isLoading&&br.toLoadAueue.length){br.isLoading=!0;const t=br.toLoadAueue.splice(0,10),e=[];t.forEach((t=>{const{url:i,marks:o}=t,n={type:"image",loadState:"init"};if(br.cache.set(i,n),n.dataPromise=Oo.global.loadImage(i),n.dataPromise){n.waitingMark=o;const t=n.dataPromise.then((t=>{var e;n.loadState=(null==t?void 0:t.data)?"success":"fail",n.data=null==t?void 0:t.data,null===(e=n.waitingMark)||void 0===e||e.map(((e,o)=>{(null==t?void 0:t.data)?(n.loadState="success",n.data=t.data,e.imageLoadSuccess(i,t.data)):(n.loadState="fail",e.imageLoadFail(i))}))}));e.push(t)}else n.loadState="fail",o.forEach((t=>t.imageLoadFail(i)))})),Promise.all(e).then((()=>{br.isLoading=!1,this.onLoadSuccessCb.forEach((t=>t())),br.loading()})).catch((t=>{br.isLoading=!1,this.onLoadSuccessCb.forEach((t=>t())),br.loading()}))}}),0)}static loadImage(t,e){const i=vr(t,br.toLoadAueue);if(-1!==i)return br.toLoadAueue[i].marks.push(e),void br.loading();br.toLoadAueue.push({url:t,marks:[e]}),br.loading()}static improveImageLoading(t){const e=vr(t,br.toLoadAueue);if(-1!==e){const t=br.toLoadAueue.splice(e,1);br.toLoadAueue.unshift(t[0])}}static onLoadSuccess(t){this.onLoadSuccessCb.push(t)}}function vr(t,e){for(let i=0;i<e.length;i++)if(e[i].url===t)return i;return-1}br.cache=new Map,br.isLoading=!1,br.toLoadAueue=[],br.onLoadSuccessCb=[];const yr=new Se,Cr=new Ce,wr=["lineWidth","scaleX","scaleY","angle","anchor","visible"],xr=["x","y"],_r=["scaleX","scaleY"],Sr=["angle"],Ar=new me,Br={strokeSeg:1,boundsPadding:2,pickMode:1,boundsMode:1,customPickShape:1,pickable:1,childrenPickable:1,visible:1,zIndex:1,layout:1,keepDirIn3d:1,globalZIndex:1,outerBorder:1,innerBorder:1,lineDash:1,lineCap:1,lineJoin:1,miterLimit:2,strokeBoundsBuffer:2,scaleCenter:1,anchor:1,anchor3d:1,postMatrix:1,backgroundMode:2,background:1,texture:1,cursor:1,html:1};class Rr extends An{static mixin(t){const e=Object.keys(t);for(let i=0;i<e.length;++i){const o=e[i];Object.defineProperty(Rr.prototype,o,Object.getOwnPropertyDescriptor(t,o))}}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(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};var e;super(),this._AABBBounds=new Ce,this._updateTag=_i.INIT,this.attribute=t,this.valid=this.isValid(),t.background?this.loadImage(null!==(e=t.background.background)&&void 0!==e?e:t.background,!0):t.shadowGraphic&&this.setShadowGraphic(t.shadowGraphic)}setMode(t){"3d"===t?this.set3dMode():this.set2dMode()}set3dMode(){this.in3dMode=!0}set2dMode(){this.in3dMode=!1}getOffsetXY(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];var i,o;const{dx:n=t.dx,dy:r=t.dy}=this.attribute;if(e&&this.parent){const t=this.parent.attribute;Ar.x=n+(null!==(i=t.scrollX)&&void 0!==i?i:0),Ar.y=r+(null!==(o=t.scrollY)&&void 0!==o?o:0)}else Ar.x=n,Ar.y=r;return Ar}onAnimateBind(t){this._emitCustomEvent("animate-bind",t)}tryUpdateAABBBounds(t){if(!this.shouldUpdateAABBBounds())return this._AABBBounds;if(!this.valid)return this._AABBBounds.clear(),this._AABBBounds;Oo.graphicService.beforeUpdateAABBBounds(this,this.stage,!0,this._AABBBounds);const e=this.doUpdateAABBBounds(t);return Oo.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(){const t=this.AABBBounds;return this._globalAABBBounds?this._globalAABBBounds.setValue(t.x1,t.y1,t.x2,t.y2):this._globalAABBBounds=t.clone(),this._globalAABBBounds.empty()||this.parent&&this._globalAABBBounds.transformWithMatrix(this.parent.globalTransMatrix),this._globalAABBBounds}tryUpdateGlobalTransMatrix(){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(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this._transMatrix||(this._transMatrix=new Se),this.shouldUpdateLocalMatrix()&&(this.doUpdateLocalMatrix(),t&&this.clearUpdateLocalPositionTag()),this._transMatrix}shouldUpdateAABBBounds(){return this.shadowRoot?!!(this._updateTag&_i.UPDATE_BOUNDS)||this.shadowRoot.shouldUpdateAABBBounds():!!(this._updateTag&_i.UPDATE_BOUNDS)}shouldSelfChangeUpdateAABBBounds(){return this.shadowRoot?!!(this._updateTag&_i.UPDATE_BOUNDS)||this.shadowRoot.shouldUpdateAABBBounds():!!(this._updateTag&_i.UPDATE_BOUNDS)}shouldUpdateLocalMatrix(){return!!(this._updateTag&_i.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&_i.UPDATE_SHAPE)}clearUpdateShapeTag(){this._updateTag&=_i.CLEAR_SHAPE}containsPoint(t,e,i,o){if(!o)return!1;if(i===Si.GLOBAL){const i=new me(t,e);this.parent&&this.parent.globalTransMatrix.transformPoint(i,i),t=i.x,e=i.y}return o.containsPoint(this,{x:t,y:e})}setAttributes(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2?arguments[2]:void 0;(t=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(t,this.attribute,null,i)||t).background?this.loadImage(t.background,!0):t.shadowGraphic&&this.setShadowGraphic(t.shadowGraphic),this._setAttributes(t,e,i)}_setAttributes(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2?arguments[2]:void 0;const o=Object.keys(t);for(let e=0;e<o.length;e++){const i=o[e];this.attribute[i]=t[i]}this.valid=this.isValid(),this.updateShapeAndBoundsTagSetted()||!e&&!this.needUpdateTags(o)?this.addUpdateBoundTag():this.addUpdateShapeAndBoundsTag(),this.addUpdatePositionTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(i)}setAttribute(t,e,i,o){var n;const r=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({[t]:e},this.attribute,t,o);r?this._setAttributes(r,i,o):J(null===(n=this.normalAttrs)||void 0===n?void 0:n[t])?(this.attribute[t]=e,this.valid=this.isValid(),this.updateShapeAndBoundsTagSetted()||!i&&!this.needUpdateTag(t)?this.addUpdateBoundTag():this.addUpdateShapeAndBoundsTag(),this.addUpdatePositionTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(o)):this.normalAttrs[t]=e,"background"===t?this.loadImage(e,!0):"shadowGraphic"===t&&this.setShadowGraphic(e)}needUpdateTags(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:wr;for(let i=0;i<e.length;i++){const o=e[i];if(-1!==t.indexOf(o))return!0}return!1}needUpdateTag(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:wr;for(let i=0;i<e.length;i++)if(t===e[i])return!0;return!1}initAttributes(t){const e={type:Ai.INIT};t=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(t,this.attribute,null,e)||t,this.attribute=t,t.background?this.loadImage(t.background,!0):t.shadowGraphic&&this.setShadowGraphic(t.shadowGraphic),this._updateTag=_i.INIT,this.valid=this.isValid(),this.onAttributeUpdate(e)}translate(t,e){var i,o;if(0===t&&0===e)return this;const n={type:Ai.TRANSLATE},r=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({x:t,y:e},this.attribute,xr,n);r&&(t=r.x,e=r.y,delete r.x,delete r.y,this._setAttributes(r));const s=this.attribute,l=s.postMatrix;return l?Oo.transformUtil.fromMatrix(l,l).translate(t,e):(s.x=(null!==(i=s.x)&&void 0!==i?i:mo.x)+t,s.y=(null!==(o=s.y)&&void 0!==o?o:mo.y)+e),this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(n),this}translateTo(t,e){const i=this.attribute;if(i.x===t&&i.y===e)return this;const o={type:Ai.TRANSLATE_TO},n=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({x:t,y:e},this.attribute,xr,o);return n?(this._setAttributes(n,!1,o),this):(i.x=t,i.y=e,this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(o),this)}scale(t,e,i){var o,n;if(1===t&&1===e)return this;const r={type:Ai.SCALE},s=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({scaleX:t,scaleY:e,scaleCenter:i},this.attribute,_r,r);s&&(t=s.scaleX,e=s.scaleY,delete s.scaleX,delete s.scaleY,this._setAttributes(s));const l=this.attribute;if(i){let{postMatrix:o}=this.attribute;o||(o=new Se,l.postMatrix=o),Oo.transformUtil.fromMatrix(o,o).scale(t,e,i)}else l.scaleX=(null!==(o=l.scaleX)&&void 0!==o?o:mo.scaleX)*t,l.scaleY=(null!==(n=l.scaleY)&&void 0!==n?n:mo.scaleY)*e;return this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(r),this}scaleTo(t,e){const i=this.attribute;if(i.scaleX===t&&i.scaleY===e)return this;const o={type:Ai.SCALE_TO},n=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({scaleX:t,scaleY:e},this.attribute,_r,o);return n?(this._setAttributes(n,!1,o),this):(i.scaleX=t,i.scaleY=e,this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(o),this)}rotate(t,e){var i;if(0===t)return this;const o={type:Ai.ROTATE},n=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({angle:t,rotateCenter:e},this.attribute,Sr,o);n&&(delete n.angle,this._setAttributes(n,!1,o));const r=this.attribute;if(e){let{postMatrix:i}=this.attribute;i||(i=new Se,r.postMatrix=i),Oo.transformUtil.fromMatrix(i,i).rotate(t,e)}else r.angle=(null!==(i=r.angle)&&void 0!==i?i:mo.angle)+t;return this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(o),this}rotateTo(t){const e=this.attribute;if(e.angle===t)return this;const i={type:Ai.ROTATE_TO},o=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(t,this.attribute,Sr,i);return o?(this._setAttributes(o,!1,i),this):(e.angle=t,this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(i),this)}skewTo(t,e){return this}animate(t){this.animates||(this.animates=new Map);const e=new Un(null==t?void 0:t.id,this.stage&&this.stage.getTimeline()).bind(this);if(t){const{onStart:i,onFrame:o,onEnd:n,onRemove:r}=t;null!=i&&e.onStart(i),null!=o&&e.onFrame(o),null!=n&&e.onEnd(n),null!=r&&e.onRemove(r),e.interpolateFunc=t.interpolate}return this.animates.set(e.id,e),e.onRemove((()=>{this.animates.delete(e.id)})),e}onAttributeUpdate(t){t&&t.skipUpdateCallback||(Oo.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)&&(!!J(t)||this.currentStates.includes(t))}getState(t){var e;return null===(e=this.states)||void 0===e?void 0:e[t]}applyStateAttrs(t,e,i,o){var n,r,s,l;if(i){const i=Object.keys(t),a=this.getNoWorkAnimateAttr(),h={};let d;i.forEach((e=>{a[e]?(d||(d={}),d[e]=t[e]):h[e]=o&&void 0===t[e]?this.getDefaultAttribute(e):t[e]}));const c=this.animate();c.stateNames=e,c.to(h,null!==(r=null===(n=this.stateAnimateConfig)||void 0===n?void 0:n.duration)&&void 0!==r?r:Yn,null!==(l=null===(s=this.stateAnimateConfig)||void 0===s?void 0:s.easing)&&void 0!==l?l:Kn),d&&this.setAttributes(d,!1,{type:Ai.STATE})}else this.stopStateAnimates(),this.setAttributes(t,!1,{type:Ai.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}stopStateAnimates(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"end";this.animates&&this.animates.forEach((e=>{e.stateNames&&(e.stop(t),this.animates.delete(e.id))}))}getNormalAttribute(t){let e=this.attribute[t];return this.animates&&this.animates.forEach((i=>{if(i.stateNames){const o=i.getEndProps();yt(o,t)&&(e=o[t])}})),e}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 o;if(this.currentStates&&this.currentStates.includes(t)&&(e||1===this.currentStates.length))return;const n=e&&(null===(o=this.currentStates)||void 0===o?void 0:o.length)?this.currentStates.concat([t]):[t];this.useStates(n,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 o={};t.forEach((e=>{var i;const n=this.stateProxy?this.stateProxy(e,t):null===(i=this.states)||void 0===i?void 0:i[e];n&&Object.assign(o,n)})),this.updateNormalAttrs(o),this.currentStates=t,this.applyStateAttrs(o,t,e)}addUpdateBoundTag(){this._updateTag|=_i.UPDATE_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag(),this.glyphHost&&this.glyphHost.addUpdateBoundTag()}addUpdateShapeTag(){this._updateTag|=_i.UPDATE_SHAPE}addUpdateShapeAndBoundsTag(){this._updateTag|=_i.UPDATE_SHAPE_AND_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag(),this.glyphHost&&this.glyphHost.addUpdateBoundTag()}updateShapeAndBoundsTagSetted(){return(this._updateTag&_i.UPDATE_SHAPE_AND_BOUNDS)===_i.UPDATE_SHAPE_AND_BOUNDS}clearUpdateBoundTag(){this._updateTag&=_i.CLEAR_BOUNDS}addUpdatePositionTag(){this.shadowRoot&&this.shadowRoot.addUpdateGlobalPositionTag(),this._updateTag|=_i.UPDATE_GLOBAL_LOCAL_MATRIX}addUpdateGlobalPositionTag(){this.shadowRoot&&this.shadowRoot.addUpdateGlobalPositionTag(),this._updateTag|=_i.UPDATE_GLOBAL_MATRIX}clearUpdateLocalPositionTag(){this._updateTag&=_i.CLEAR_LOCAL_MATRIX}clearUpdateGlobalPositionTag(){this._updateTag&=_i.CLEAR_GLOBAL_MATRIX}addUpdateLayoutTag(){this._updateTag|=_i.UPDATE_LAYOUT}clearUpdateLayoutTag(){this._updateTag&=_i.CLEAR_LAYOUT}needUpdateLayout(){return!!(this._updateTag&_i.UPDATE_LAYOUT)}getAnchor(t,e){const i=[0,0],o=()=>{if(e.b)return e.b;const{scaleX:t,scaleY:i,angle:o}=this.attribute;return Cr.copy(this._AABBBounds),this.setAttributes({scaleX:1,scaleY:1,angle:0}),e.b=this.AABBBounds.clone(),this._AABBBounds.copy(Cr),this.setAttributes({scaleX:t,scaleY:i,angle:o}),e.b};if("string"==typeof t[0]){const e=parseFloat(t[0])/100,n=o();i[0]=n.x1+(n.x2-n.x1)*e}else i[0]=t[0];if("string"==typeof t[1]){const e=parseFloat(t[1])/100,n=o();i[1]=n.y1+(n.y2-n.y1)*e}else i[1]=t[1];return i}doUpdateLocalMatrix(){const{x:t=mo.x,y:e=mo.y,scaleX:i=mo.scaleX,scaleY:o=mo.scaleY,angle:n=mo.angle,scaleCenter:r,anchor:s,postMatrix:l}=this.attribute;let a=[0,0];const h={};if(s&&(a=this.getAnchor(s,h)),!r||1===i&&1===o)!function(t,e,i,o,n,r,s,l){const a=e.a,h=e.b,d=e.c,c=e.d,u=e.e,g=e.f,p=le(s),f=de(s);let m,b;l?(m=l[0],b=l[1]):(m=i,b=o);const v=m-i,y=b-o,C=a*p+d*f,w=h*p+c*f,x=d*p-a*f,_=c*p-h*f;t.a=n*C,t.b=n*w,t.c=r*x,t.d=r*_,t.e=u+a*m+d*b-C*v-x*y,t.f=g+h*m+c*b-w*v-_*y}(this._transMatrix,this._transMatrix.reset(),t,e,i,o,n,s&&a);else{const s=this._transMatrix;s.reset(),s.translate(a[0],a[1]),s.rotate(n),s.translate(-a[0],-a[1]),s.translate(t,e),a=this.getAnchor(r,h),Oo.transformUtil.fromMatrix(s,s).scale(i,o,{x:a[0],y:a[1]})}const d=this.getOffsetXY(mo);if(this._transMatrix.e+=d.x,this._transMatrix.f+=d.y,l){const t=yr.setValue(l.a,l.b,l.c,l.d,l.e,l.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),Oo.graphicService.onSetStage(this,t)}}setStageToShadowRoot(t,e){this.shadowRoot&&this.shadowRoot.setStage(t,e)}onAddStep(t){}onStop(t){t&&this.setAttributes(t,!1,{type:Ai.ANIMATE_END})}onStep(t,e,i,o,n){const r={};if(i.customAnimate)i.customAnimate.update(n,o,r);else{const s=i.props,l=i.parsedProps,a=i.propKeys;this.stepInterpolate(t,e,r,i,o,n,s,void 0,l,a)}this.setAttributes(r,!1,{type:Ai.ANIMATE_UPDATE,animationState:{ratio:o,end:n,step:i,isFirstFrameOfStep:t.getLastStep()!==i}}),this.stage&&this.stage.renderNextFrame()}stepInterpolate(t,e,i,o,n,r,s,l,a,h){h||(h=Object.keys(s),o.propKeys=h),r?o.propKeys.forEach((t=>{e.validAttr(t)&&(i[t]=s[t])})):h.forEach((r=>{var h;if(!e.validAttr(r))return;const d=s[r],c=null!==(h=l&&l[r])&&void 0!==h?h:t.getLastPropByName(r,o);if(null==d||null==c)return void(i[r]=d);let u;u=e.interpolateFunc&&e.interpolateFunc(r,n,c,d,i),u||(u=e.customInterpolate(r,n,c,d,this,i),u||this.defaultInterpolate(d,c,r,i,a,n)||this._interpolate(r,n,c,d,i))})),o.parsedProps=a}defaultInterpolate(t,e,i,o,n,r){if(Number.isFinite(t))return o[i]=e+(t-e)*r,!0;if("fill"===i){n||(n={});const s=n.fillColorArray,l=ur(e,null!=s?s:t,r,!1,((t,e)=>{n.fillColorArray=e}));return l&&(o[i]=l),!0}if("stroke"===i){n||(n={});const s=n.strokeColorArray,l=ur(e,null!=s?s:t,r,!1,((t,e)=>{n.strokeColorArray=e}));return l&&(o[i]=l),!0}if("shadowColor"===i){n||(n={});const s=n.shadowColorArray,l=ur(e,null!=s?s:t,r,!0,((t,e)=>{n.shadowColorArray=e}));return l&&(o[i]=l),!0}return!1}_interpolate(t,e,i,o,n){}getDefaultAttribute(t){return _n(this)[this.type][t]}getComputedAttribute(t){var e;return null!==(e=this.attribute[t])&&void 0!==e?e:this.getDefaultAttribute(t)}onSetStage(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this._onSetStage=t,e&&this.stage&&t(this,this.stage)}attachShadow(t){return t&&(t.shadowHost=this),this.shadowRoot=null!=t?t:Oo.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 nt(t,!0)?this.pathProxy=(new go).fromString(t):this.pathProxy=new go,this.pathProxy}loadImage(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!t||e&&function(t){return!(!t.fill&&!t.stroke)}(t))return;const i=t;this.resources||(this.resources=new Map);const o={data:"init",state:null};this.resources.set(i,o),"string"==typeof t?(o.state="loading",t.startsWith("<svg")?(br.GetSvg(t,this),this.backgroundImg=this.backgroundImg||e):(dt(t)||t.includes("/")||ct(t))&&(br.GetImage(t,this),this.backgroundImg=this.backgroundImg||e)):tt(t)?(o.state="success",o.data=t,this.backgroundImg=this.backgroundImg||e):o.state="fail"}setShadowGraphic(t){t?this.attachShadow().add(t):this.detachShadow()}imageLoadSuccess(t,e,i){if(!this.resources)return;const o=this.resources.get(t);o&&(o.state="success",o.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(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this._stopAnimates(this.animates),this.shadowRoot&&this.shadowRoot.stopAnimates(!0),this.isContainer&&t&&this.forEachChildren((e=>{e.stopAnimates(t)}))}release(){this.releaseStatus="released",Oo.graphicService.onRelease(this)}_emitCustomEvent(t,e){var i,o;if(this._events&&t in this._events){const n=new kn(t,e);n.bubbles=!1,n.manager=null===(o=null===(i=this.stage)||void 0===i?void 0:i.eventSystem)||void 0===o?void 0:o.manager,this.dispatchEvent(n)}}}Rr.mixin(Ln);class Mr{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 Tr(t,e,i,o){const n=t.indexOf(e,i);if(-1===n)throw new Error(o);return n+e.length-1}function kr(t,e,i){const o=function(t,e){let i,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:">",n="";for(let r=e;r<t.length;r++){let e=t[r];if(i)e===i&&(i="");else if('"'===e||"'"===e)i=e;else if(e===o[0]){if(!o[1])return{data:n,index:r};if(t[r+1]===o[1])return{data:n,index:r}}else"\t"===e&&(e=" ");n+=e}}(t,e+1,arguments.length>3&&void 0!==arguments[3]?arguments[3]:">");if(!o)return;let n=o.data;const r=o.index,s=n.search(/\s/);let l=n,a=!0;-1!==s&&(l=n.substr(0,s).replace(/\s\s*$/,""),n=n.substr(s+1));const h=l;if(i){const t=l.indexOf(":");-1!==t&&(l=l.substr(t+1),a=l!==o.data.substr(t+1))}return{tagName:l,tagExp:n,closeIndex:r,attrExpPresent:a,rawTagName:h}}const Pr=new RegExp("([^\\s=]+)\\s*(=\\s*(['\"])([\\s\\S]*?)\\3)?","gm");class Er{constructor(t){this.currentNode=null,this.options=t,this.tagsNodeStack=[],this.docTypeEntities={}}addChild(t,e,i){const o=e.tagname;"string"==typeof o?(e.tagname=o,t.addChild(e)):t.addChild(e)}buildAttributesMap(t,e,i){const o={};if(!t)return;const n=function(t,e){const i=[];let o=e.exec(t);for(;o;){const n=[];n.startIndex=e.lastIndex-o[0].length;const r=o.length;for(let t=0;t<r;t++)n.push(o[t]);i.push(n),o=e.exec(t)}return i}(t,Pr),r=n.length;for(let t=0;t<r;t++){const e=n[t][1],i=n[t][4];e&&(o[e]=void 0===i||(isNaN(i)?i:Number(i)))}return o}parseXml(t){t=t.replace(/\r\n?/g,"\n");const e=new Mr("!xml");let i=e,o="",n="";for(let r=0;r<t.length;r++)if("<"===t[r])if("/"===t[r+1]){const e=Tr(t,">",r,"Closing Tag is not closed."),s=n.lastIndexOf(".");n=n.substring(0,s),i=this.tagsNodeStack.pop(),i&&i.child&&o&&i.child[i.child.length-1][":@"]&&(i.child[i.child.length-1][":@"].text=o),o="",r=e}else if("?"===t[r+1])r=kr(t,r,!1,"?>").closeIndex+1;else if("!--"===t.substr(r+1,3))r=Tr(t,"--\x3e",r+4,"Comment is not closed.");else{const s=kr(t,r,!1);let l=s.tagName,a=s.tagExp;const h=s.attrExpPresent,d=s.closeIndex;if(l!==e.tagname&&(n+=n?"."+l:l),a.length>0&&a.lastIndexOf("/")===a.length-1){"/"===l[l.length-1]?(l=l.substr(0,l.length-1),n=n.substr(0,n.length-1),a=l):a=a.substr(0,a.length-1);const t=new Mr(l);l!==a&&h&&(t[":@"]=this.buildAttributesMap(a,n,l)),this.addChild(i,t,n),n=n.substr(0,n.lastIndexOf("."))}else{const t=new Mr(l);this.tagsNodeStack.push(i),l!==a&&h&&(t[":@"]=this.buildAttributesMap(a,n,l)),this.addChild(i,t,n),i=t}o="",r=d}else o+=t[r];return e.child}}function Lr(t,e){return Hr(t)}function Hr(t,e){const i={};for(let e=0;e<t.length;e++){const o=t[e],n=zr(o);if(void 0!==n&&o[n]){const t=Hr(o[n]);Ir(t),o[":@"]&&Fr(t,o[":@"]),void 0!==i[n]&&i.hasOwnProperty(n)?(Array.isArray(i[n])||(i[n]=[i[n]]),i[n].push(t)):i[n]=t}}return i}function zr(t){const e=Object.keys(t);for(let t=0;t<e.length;t++){const i=e[t];if(":@"!==i)return i}}function Fr(t,e,i){if(e){const i=Object.keys(e),o=i.length;for(let n=0;n<o;n++){const o=i[n];t[o]=e[o]}}}function Ir(t){return 0===Object.keys(t).length}class Or{constructor(t){this.options=Object.assign({},Or.defaultOptions,t)}valid(t){return t.startsWith("<")}parse(t){if(!this.valid)return!1;return Lr(new Er(this.options).parseXml(t),this.options)}}function Dr(t,e,i){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return t.expand(e+(o/2+(i?function(t,e){return t?e:0}(i,e):0))),t}Or.defaultOptions={};let Wr=0;function Nr(){return Wr++}var Gr;function jr(t){const e=[];let i=0,o="";for(let n=0;n<t.length;n++)$r(t[n])?i?o+=t[n]:(i=1,o=t[n]):(i&&(e.push({text:o,direction:Gr.VERTICAL}),o="",i=0),e.push({text:t[n],direction:Gr.HORIZONTAL}));return o&&e.push({text:o,direction:Gr.VERTICAL}),e}!function(t){t[t.HORIZONTAL=0]="HORIZONTAL",t[t.VERTICAL=1]="VERTICAL"}(Gr||(Gr={}));const Vr=new Map;["…","(",")","—","【","】","「","」","《","》"].forEach((t=>Vr.set(t,!0)));const Ur=new Map;function $r(t){if(Vr.has(t))return!0;if(Ur.has(t))return!1;let e=!1;return t.codePointAt(0)<256&&(e=!0),e}[""].forEach((t=>Ur.set(t,!0)));const Xr=Nr(),Yr=Nr(),Kr=Nr(),qr=Nr();Nr();const Zr=Nr(),Jr=Nr(),Qr=Nr(),ts=Nr(),es=Nr();Nr();const is=Nr();Nr();const os=Nr(),ns=Nr(),rs=Nr(),ss=Symbol.for("GraphicService"),ls=Symbol.for("GraphicCreator"),as={"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"},hs=Object.keys(as);var ds;!function(t){t[t.LESS_GROUP=0]="LESS_GROUP",t[t.MORE_GROUP=1]="MORE_GROUP"}(ds||(ds={}));let cs=class t extends Rr{constructor(t){super(t),this.type="group",this.parent=null,this.isContainer=!0,this.numberType=Zr,this._childUpdateTag=_i.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 wn),this.theme.setTheme(t,this)}createTheme(){this.theme||(this.theme=new wn)}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(t,e,i){if(i===Si.GLOBAL){const i=new me(t,e);return this.parent&&this.parent.globalTransMatrix.transformPoint(i,i),this.AABBBounds.contains(i.x,i.y)}return this.AABBBounds.contains(t,e)}shouldUpdateAABBBounds(){return!!super.shouldUpdateAABBBounds()||!!(this._childUpdateTag&_i.UPDATE_BOUNDS)}tryUpdateAABBBounds(){if(!this.shouldUpdateAABBBounds())return this._AABBBounds;Oo.graphicService.beforeUpdateAABBBounds(this,this.stage,!0,this._AABBBounds);const t=this.shouldSelfChangeUpdateAABBBounds(),e=this.doUpdateAABBBounds();return this.addUpdateLayoutTag(),Oo.graphicService.afterUpdateAABBBounds(this,this.stage,this._AABBBounds,this,t),e}doUpdateLocalMatrix(){const{x:t=mo.x,y:e=mo.y,dx:i=mo.dx,dy:o=mo.dy,scaleX:n=mo.scaleX,scaleY:r=mo.scaleY,angle:s=mo.angle,postMatrix:l}=this.attribute;if(0!==t||0!==e||0!==i||0!==o||1!==n||1!==r||0!==s||l)return super.doUpdateLocalMatrix();this._transMatrix.reset()}doUpdateAABBBounds(){const t=this.attribute,e=_n(this).group;this._AABBBounds.clear();const i=Oo.graphicService.updateGroupAABBBounds(t,e,this._AABBBounds,this),{boundsPadding:o=e.boundsPadding}=t,n=Qn(o);return n&&i.expand(n),this.parent&&this.parent.addChildUpdateBoundTag(),this.clearUpdateBoundTag(),this._emitCustomEvent("AAABBBoundsChange"),i}clearUpdateBoundTag(){this._updateTag&=_i.CLEAR_BOUNDS,this._childUpdateTag&=_i.CLEAR_BOUNDS}tryUpdateOBBBounds(){throw new Error("暂不支持")}addUpdateBoundTag(){this._updateTag|=_i.UPDATE_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag()}addChildUpdateBoundTag(){this._childUpdateTag&_i.UPDATE_BOUNDS||(this._childUpdateTag|=_i.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(),Oo.graphicService.onAddIncremental(t,this,this.stage),e}incrementalClearChild(){super.removeAllChild(),this.addUpdateBoundTag(),Oo.graphicService.onClearIncremental(this,this.stage)}appendChild(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];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,Oo.graphicService.onRemove(t),this.addUpdateBoundTag(),e}removeAllChild(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.forEachChildren((e=>{Oo.graphicService.onRemove(e),t&&e.isContainer&&e.removeAllChild(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),Oo.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(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[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&_i.UPDATE_GLOBAL_MATRIX)}_getChildByName(t,e){return this.find((e=>e.name===t),e)}createOrUpdateChild(t,e,i){let o=this._getChildByName(t);return o?o.setAttributes(e):(o=Oo.graphicService.creator[i](e),o.name=t,this.add(o)),o}clone(){return new t(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return t.NOWORK_ANIMATE_ATTR}};function us(t){return new cs(t)}cs.NOWORK_ANIMATE_ATTR=Br;class gs 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,o){var n;super({}),this.stage=t,this.global=e,this.window=i,this.main=o.main,this.layerHandler=o.layerHandler,this.layerHandler.init(this,i,{main:o.main,canvasId:o.canvasId,width:this.viewWidth,height:this.viewHeight,zIndex:null!==(n=o.zIndex)&&void 0!==n?n:0}),this.layer=this,this.subLayers=new Map,this.theme=new wn,this.background="rgba(0, 0, 0, 0)",this.afterDrawCbs=[]}combineSubLayer(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[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=>{Oo.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;this.layerHandler.render([this],{renderService:t.renderService,stage:this.stage,layer:this,viewBox:t.viewBox,transMatrix:t.transMatrix,background:null!==(i=t.background)&&void 0!==i?i:this.background,updateBounds:t.updateBounds},e),this.afterDrawCbs.forEach((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){}release(){super.release(),this.layerHandler.release(),this.subLayers&&this.subLayers.forEach((t=>{Oo.layerService.releaseLayer(this.stage,t.layer)}))}drawTo(t,e){var i;this.layerHandler.drawTo(t,[this],Object.assign({background:null!==(i=e.background)&&void 0!==i?i:this.background,renderService:e.renderService,viewBox:e.viewBox,transMatrix:e.transMatrix,stage:this.stage,layer:this},e)),this.afterDrawCbs.forEach((t=>t(this)))}}const ps=Symbol.for("TransformUtil"),fs=Symbol.for("GraphicUtil"),ms=Symbol.for("LayerService"),bs=Symbol.for("StaticLayerHandlerContribution"),vs=Symbol.for("DynamicLayerHandlerContribution"),ys=Symbol.for("VirtualLayerHandlerContribution");var Cs,ws=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s},xs=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let _s=Cs=class{static GenerateLayerId(){return`${Cs.idprefix}_${Cs.prefix_count++}`}constructor(){this.layerMap=new Map,this.global=Oo.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?Qo.get(bs):"dynamic"===t?Qo.get(vs):Qo.get(ys),e}createLayer(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{main:!1};var i;this.tryInit();let o=this.getRecommendedLayerType(e.layerMode);o=e.main||e.canvasId?"static":o;const n=this.getLayerHandler(o),r=new gs(t,this.global,t.window,Object.assign(Object.assign({main:!1},e),{layerMode:o,canvasId:null!==(i=e.canvasId)&&void 0!==i?i:Cs.GenerateLayerId(),layerHandler:n})),s=this.layerMap.get(t)||[];return s.push(r),this.layerMap.set(t,s),this.staticLayerCountInEnv--,r}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}releaseStage(t){this.layerMap.delete(t)}};_s.idprefix="visactor_layer",_s.prefix_count=0,_s=Cs=ws([y(),xs("design:paramtypes",[])],_s);var Ss=new s((t=>{t(N).to(U).inSingletonScope(),t(ln).to(hn),t(fs).to(gn).inSingletonScope(),t(ps).to(mn).inSingletonScope(),t(ms).to(_s).inSingletonScope()}));function As(t,e){return!(!t&&!e)}function Bs(t,e){let i;return i=rt(t)?t.some((t=>t||void 0===t)):!!t,i&&e>0}function Rs(t,e,i){return i&&t*e>0}function Ms(t,e,i,o,n){return n&&t*e>0&&0!==i&&0!==o}function Ts(t,e){return t*e>0}function ks(t,e,i,o){return t*e>0&&0!==i&&0!==o}function Ps(t,e,i,o,n,r,s,l){const a=i-t,h=o-e,d=s-n,c=l-r;let u=c*a-d*h;return u*u<te?[]:(u=(d*(e-r)-c*(t-n))/u,[t+u*a,e+u*h])}function Es(t,e,i,o,n,r,s){const l=t-i,a=e-o,h=(s?r:-r)/Math.sqrt(l*l+a*a),d=h*a,c=-h*l,u=t+d,g=e+c,p=i+d,f=o+c,m=(u+p)/2,b=(g+f)/2,v=p-u,y=f-g,C=v*v+y*y,w=n-r,x=u*f-p*g,_=(y<0?-1:1)*Math.sqrt(Math.max(0,w*w*C-x*x));let S=(x*y-v*_)/C,A=(-x*v-y*_)/C;const B=(x*y+v*_)/C,R=(-x*v+y*_)/C,M=S-m,T=A-b,k=B-m,P=R-b;return M*M+T*T>k*k+P*P&&(S=B,A=R),{cx:S,cy:A,x01:-d,y01:-c,x11:S*(n/w-1),y11:A*(n/w-1)}}function Ls(t,e,i,o,n,r,s){const{startAngle:l,endAngle:a}=t.getParsedAngle(),h=re(a-l),d=a>l;let c=!1;if(n<r){const t=n;n=r,r=t}if(n<=te)e.moveTo(i,o);else if(h>=ne-te)e.moveTo(i+n*le(l),o+n*de(l)),e.arc(i,o,n,l,a,!d),r>te&&(e.moveTo(i+r*le(a),o+r*de(a)),e.arc(i,o,r,a,l,d));else{const u=t.getParsedCornerRadius(),{outerDeltaAngle:g,innerDeltaAngle:p,outerStartAngle:f,outerEndAngle:m,innerEndAngle:b,innerStartAngle:v}=t.getParsePadAngle(l,a),y=u,C=u,w=u,x=u,_=Math.max(C,y),S=Math.max(w,x);let A=_,B=S;const R=n*le(f),M=n*de(f),T=r*le(b),k=r*de(b);let P,E,L,H;if((S>te||_>te)&&(P=n*le(m),E=n*de(m),L=r*le(v),H=r*de(v),h<ee)){const t=Ps(R,M,L,H,P,E,T,k);if(t){const e=R-t[0],i=M-t[1],o=P-t[0],s=E-t[1],l=1/de(ge((e*o+i*s)/(ce(e*e+i*i)*ce(o*o+s*s)))/2),a=ce(t[0]*t[0]+t[1]*t[1]);B=he(S,(r-a)/(l-1)),A=he(_,(n-a)/(l+1))}}if(g<.001)s&&(s[3]||s[1])&&e.moveTo(i+R,o+M),c=!0;else if(A>te){const t=he(y,A),r=he(C,A),l=Es(L,H,R,M,n,t,Number(d)),a=Es(P,E,T,k,n,r,Number(d));A<_&&t===r?!s||s[0]?(e.moveTo(i+l.cx+l.x01,o+l.cy+l.y01),e.arc(i+l.cx,o+l.cy,A,se(l.y01,l.x01),se(a.y01,a.x01),!d)):e.moveTo(i+l.cx+A*le(se(a.y01,a.x01)),o+l.cy+A*de(se(a.y01,a.x01))):!s||s[0]?(e.moveTo(i+l.cx+l.x01,o+l.cy+l.y01),t>0&&e.arc(i+l.cx,o+l.cy,t,se(l.y01,l.x01),se(l.y11,l.x11),!d),e.arc(i,o,n,se(l.cy+l.y11,l.cx+l.x11),se(a.cy+a.y11,a.cx+a.x11),!d),r>0&&e.arc(i+a.cx,o+a.cy,r,se(a.y11,a.x11),se(a.y01,a.x01),!d)):r>0?e.moveTo(i+a.cx+r*le(se(a.y01,a.x01)),o+a.cy+r*de(se(a.y01,a.x01))):e.moveTo(i+P,o+n*de(m))}else!s||s[0]?(e.moveTo(i+R,o+M),e.arc(i,o,n,f,m,!d)):e.moveTo(i+n*le(m),o+n*de(m));if(!(r>te)||p<.001)!s||s[1]?e.lineTo(i+T,o+k):e.moveTo(i+T,o+k),c=!0;else if(B>te){const t=he(x,B),n=he(w,B),l=Es(T,k,P,E,r,-n,Number(d)),a=Es(R,M,L,H,r,-t,Number(d));if(!s||s[1]?e.lineTo(i+l.cx+l.x01,o+l.cy+l.y01):e.moveTo(i+l.cx+l.x01,o+l.cy+l.y01),B<S&&t===n){const t=se(a.y01,a.x01);!s||s[2]?e.arc(i+l.cx,o+l.cy,B,se(l.y01,l.x01),t,!d):e.moveTo(i+l.cx+le(t),o+l.cy+de(t))}else!s||s[2]?(n>0&&e.arc(i+l.cx,o+l.cy,n,se(l.y01,l.x01),se(l.y11,l.x11),!d),e.arc(i,o,r,se(l.cy+l.y11,l.cx+l.x11),se(a.cy+a.y11,a.cx+a.x11),d),t>0&&e.arc(i+a.cx,o+a.cy,t,se(a.y11,a.x11),se(a.y01,a.x01),!d)):t>0?e.moveTo(i+a.cx+t*le(se(a.y01,a.x01)),o+a.cy+t*de(se(a.y01,a.x01))):e.moveTo(i+L,o+H)}else!s||s[1]?e.lineTo(i+T,o+k):e.moveTo(i+T,o+k),!s||s[2]?e.arc(i,o,r,b,v,d):e.moveTo(i+r*le(v),o+r*de(v))}return s?s[3]&&e.lineTo(i+n*le(l),o+n*de(l)):e.closePath(),c}class Hs{static GetCanvas(){try{return Hs.canvas||(Hs.canvas=Oo.global.createCanvas({})),Hs.canvas}catch(t){return null}}static GetCtx(){if(!Hs.ctx){const t=Hs.GetCanvas();Hs.ctx=t.getContext("2d")}return Hs.ctx}}class zs extends Ae{static getInstance(){return zs._instance||(zs._instance=new zs),zs._instance}constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:100;super(),this.cacheParams={CLEAN_THRESHOLD:100,L_TIME:1e3},this.dataMap=new Map;const i=Hs.GetCanvas(),o=Hs.GetCtx();if(i.width=e,i.height=1,!o)return;if(o.translate(0,0),!o)throw new Error("获取ctx发生错误");const n=o.createLinearGradient(0,0,e,0);t.forEach((t=>{n.addColorStop(t[0],t[1])})),o.fillStyle=n,o.fillRect(0,0,e,1),this.rgbaSet=o.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,o){let n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[],r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:100,s=`${t}${e}${i}${o}`;n.forEach((t=>s+=t.join())),s+=r;let l=this.dataMap.get(s);return l||(l={data:new zs(n,r),timestamp:[]},this.addLimitedTimestamp(l,Date.now(),{}),this.dataMap.set(s,l)),this.clearCache(this.dataMap,this.cacheParams),l.data}}class Fs{static GetSize(t){for(let e=0;e<Fs.ImageSize.length;e++)if(Fs.ImageSize[e]>=t)return Fs.ImageSize[e];return t}static Get(t,e,i,o,n,r,s){const l=Fs.GenKey(t,e,i,o,n),a=Fs.cache[l];if(!a||0===a.length)return null;for(let t=0;t<a.length;t++)if(a[t].width>=r&&a[t].height>=s)return a[t].pattern;return null}static Set(t,e,i,o,n,r,s,l){const a=Fs.GenKey(t,e,i,o,n);Fs.cache[a]?Fs.cache[a].push({width:s,height:l,pattern:r}):Fs.cache[a]=[{width:s,height:l,pattern:r}]}static GenKey(t,e,i,o,n){return`${e},${i},${o},${n},${t.join()}`}}Fs.cache={},Fs.ImageSize=[20,40,80,160,320,640,1280,2560];const Is=Symbol.for("ArcRenderContribution"),Os=Symbol.for("AreaRenderContribution"),Ds=Symbol.for("CircleRenderContribution"),Ws=Symbol.for("GroupRenderContribution"),Ns=Symbol.for("ImageRenderContribution"),Gs=Symbol.for("PathRenderContribution"),js=Symbol.for("PolygonRenderContribution"),Vs=Symbol.for("RectRenderContribution"),Us=Symbol.for("SymbolRenderContribution"),$s=Symbol.for("TextRenderContribution"),Xs=Symbol.for("InteractiveSubRenderContribution"),Ys=["radius","startAngle","endAngle",...wr];class Ks extends Rr{constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{radius:1}),this.type="circle",this.numberType=qr}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=_n(this).circle;this._AABBBounds.clear();const i=this.attribute,o=Oo.graphicService.updateCircleAABBBounds(i,_n(this).circle,this._AABBBounds,t,this),{boundsPadding:n=e.boundsPadding}=i,r=Qn(n);return r&&o.expand(r),this.clearUpdateBoundTag(),o}tryUpdateOBBBounds(){throw new Error("暂不支持")}getDefaultAttribute(t){return _n(this).circle[t]}needUpdateTags(t){return super.needUpdateTags(t,Ys)}needUpdateTag(t){return super.needUpdateTag(t,Ys)}toCustomPath(){var t,e,i;const o=this.attribute,n=null!==(t=o.radius)&&void 0!==t?t:this.getDefaultAttribute("radius"),r=null!==(e=o.startAngle)&&void 0!==e?e:this.getDefaultAttribute("startAngle"),s=null!==(i=o.endAngle)&&void 0!==i?i:this.getDefaultAttribute("endAngle"),l=new go;return l.arc(0,0,n,r,s),l}clone(){return new Ks(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return Ks.NOWORK_ANIMATE_ATTR}}function qs(t){return new Ks(t)}function Zs(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2?arguments[2]:void 0;i||(i=1);const{fontStyle:o=e.fontStyle,fontVariant:n=e.fontVariant,fontWeight:r=e.fontWeight,fontSize:s=e.fontSize,fontFamily:l=e.fontFamily}=t;return(o?o+" ":"")+(n?n+" ":"")+(r?r+" ":"")+s*i+"px "+(l||"sans-serif")}function Js(t,e){return"end"===t||"right"===t?-e:"center"===t?-e/2:0}function Qs(t,e,i){return"middle"===t?-e/2:"top"===t?0:"bottom"===t?(arguments.length>3&&void 0!==arguments[3]?arguments[3]:0)-e:t&&"alphabetic"!==t?0:(i||(i=e),-(e-i)/2-.79*i)}Ks.NOWORK_ANIMATE_ATTR=Br;class tl{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,o,n,r,s,l,a){const h=[],d=[e,i],c=[0,0];for(;t.length>0;){const{str:i}=this.textMeasure.clipTextWithSuffix(t,this.textOptions,e,s,l,a);h.push({str:i,width:this.textMeasure.measureTextWidth(i,this.textOptions)}),t=t.substring(i.length)}"left"===o||"start"===o||("center"===o?c[0]=d[0]/-2:"right"!==o&&"end"!==o||(c[0]=-d[0])),"top"===n||("middle"===n?c[1]=d[1]/-2:"bottom"===n&&(c[1]=-d[1]));const u={xOffset:c[0],yOffset:c[1],width:d[0],height:d[1]};return this.layoutWithBBox(u,h,o,n,r)}GetLayoutByLines(t,e,i,o){let n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"",r=arguments.length>5?arguments[5]:void 0,s=arguments.length>6?arguments[6]:void 0,l=arguments.length>7&&void 0!==arguments[7]?arguments[7]:"end";t=t.map((t=>t.toString()));const a=[],h=[0,0];if("number"==typeof s&&s!==1/0){let e;for(let i=0,o=t.length;i<o;i++)e=Math.min(this.textMeasure.measureTextWidth(t[i],this.textOptions),s),a.push({str:this.textMeasure.clipTextWithSuffix(t[i],this.textOptions,e,n,r,l).str,width:e});h[0]=s}else{let e,i;s=0;for(let o=0,n=t.length;o<n;o++)i=t[o],e=this.textMeasure.measureTextWidth(i,this.textOptions),s=Math.max(s,e),a.push({str:i,width:e});h[0]=s}h[1]=a.length*o,h[0]=a.reduce(((t,e)=>Math.max(t,e.width)),0);const d={xOffset:0,yOffset:0,width:h[0],height:h[1]};return this.LayoutBBox(d,e,i),this.layoutWithBBox(d,a,e,i,o)}layoutWithBBox(t,e,i,o,n){const r=[0,0],s=e.length*n;"top"===o||("middle"===o?r[1]=(t.height-s)/2:"bottom"===o&&(r[1]=t.height-s));for(let s=0;s<e.length;s++)this.lineOffset(t,e[s],i,o,n,r);return{bbox:t,lines:e,fontFamily:this.fontFamily,fontSize:this.textOptions.fontSize,fontWeight:this.textOptions.fontWeight,lineHeight:n,textAlign:i,textBaseline:o}}lineOffset(t,e,i,o,n,r){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=(n-this.textOptions.fontSize)/2+.79*this.textOptions.fontSize+r[1],r[1]+=n,e}}const el=["text","maxLineWidth","textAlign","textBaseline","heightLimit","lineClamp","fontSize","fontFamily","fontWeight","ellipsis","lineHeight","direction","wordBreak","heightLimit","lineClamp",...wr];class il extends Rr{get font(){const t=_n(this).text;return this._font||(this._font=Zs(this.attribute,t)),this._font}get clipedText(){var t;const e=this.attribute,i=_n(this).text;if(!this.isSimplify())return;const{maxLineWidth:o=i.maxLineWidth}=e;return Number.isFinite(o)?(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=_n(this).text,e=this.attribute;if(this.isMultiLine)return;const{maxLineWidth:i=t.maxLineWidth}=e;return!!Number.isFinite(i)&&(this.tryUpdateAABBBounds(),"vertical"===e.direction&&this.cache.verticalList&&this.cache.verticalList[0]?this.cache.verticalList[0].map((t=>t.text)).join("")!==e.text.toString():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(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{text:"",fontSize:16}),this.type="text",this.numberType=rs,this.cache={}}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{text:t}=this.attribute;return rt(t)?!t.every((t=>null==t||""===t)):null!=t&&""!==t}doUpdateAABBBounds(){const t=_n(this).text;this._AABBBounds.clear();const e=this.attribute,i=Oo.graphicService.updateTextAABBBounds(e,t,this._AABBBounds,this),{boundsPadding:o=t.boundsPadding}=this.attribute,n=Qn(o);return n&&i.expand(n),this.clearUpdateBoundTag(),i}updateWrapAABBBounds(t){var e,i,o,n;const r=_n(this).text,{fontFamily:s=r.fontFamily,textAlign:l=r.textAlign,textBaseline:a=r.textBaseline,fontSize:h=r.fontSize,ellipsis:d=r.ellipsis,maxLineWidth:c,stroke:u=r.stroke,lineWidth:g=r.lineWidth,wordBreak:p=r.wordBreak,fontWeight:f=r.fontWeight,ignoreBuf:m=r.ignoreBuf,suffixPosition:b=r.suffixPosition,heightLimit:v=0,lineClamp:y}=this.attribute,C=null!==(e=ar(this.attribute.lineHeight,this.attribute.fontSize||r.fontSize))&&void 0!==e?e:this.attribute.fontSize||r.fontSize,w=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),u&&this._AABBBounds.expand(g/2),this._AABBBounds}const x=Oo.graphicUtil.textMeasure,_=new tl(s,{fontSize:h,fontWeight:f,fontFamily:s},x),S=rt(t)?t.map((t=>t.toString())):[t.toString()],A=[],B=[0,0];let R=1/0;if(v>0&&(R=Math.max(Math.floor(v/C),1)),y&&(R=Math.min(R,y)),"number"==typeof c&&c!==1/0){if(c>0)for(let t=0;t<S.length;t++){const e=S[t];let i=!0;if(t===R-1){const i=_.textMeasure.clipTextWithSuffix(e,_.textOptions,c,d,!1,b,t!==S.length-1);A.push({str:i.str,width:i.width});break}const r=_.textMeasure.clipText(e,_.textOptions,c,"break-word"===p);if(""!==e&&""===r.str){if(d){const t=_.textMeasure.clipTextWithSuffix(e,_.textOptions,c,d,!1,b);r.str=null!==(o=t.str)&&void 0!==o?o:"",r.width=null!==(n=t.width)&&void 0!==n?n:0}else r.str="",r.width=0;i=!1}if(A.push({str:r.str,width:r.width}),r.str.length===e.length);else if(i){const i=e.substring(r.str.length);S.splice(t+1,0,i)}}let t=0;A.forEach((e=>{t=Math.max(t,e.width)})),B[0]=t}else{let t,e,i=0;for(let o=0,n=S.length;o<n;o++){if(o===R-1){const t=_.textMeasure.clipTextWithSuffix(S[o],_.textOptions,c,d,!1,b);A.push({str:t.str,width:t.width}),i=Math.max(i,t.width);break}e=S[o],t=_.textMeasure.measureTextWidth(e,_.textOptions,"break-word"===p),i=Math.max(i,t),A.push({str:e,width:t})}B[0]=i}B[1]=A.length*(C+w);const M={xOffset:0,yOffset:0,width:B[0],height:B[1]};_.LayoutBBox(M,l,a);const T=_.layoutWithBBox(M,A,l,a,C);return this.cache.layoutData=T,this.clearUpdateShapeTag(),this._AABBBounds.set(M.xOffset,M.yOffset,M.xOffset+M.width,M.yOffset+M.height),u&&this._AABBBounds.expand(g/2),this._AABBBounds}updateSingallineAABBBounds(t){const e=_n(this).text,{direction:i=e.direction,underlineOffset:o=e.underlineOffset}=this.attribute,n="horizontal"===i?this.updateHorizontalSinglelineAABBBounds(t):this.updateVerticalSinglelineAABBBounds(t);return"horizontal"===i&&o&&this._AABBBounds.add(this._AABBBounds.x1,this._AABBBounds.y2+o),n}updateMultilineAABBBounds(t){const e=_n(this).text,{direction:i=e.direction,underlineOffset:o=e.underlineOffset}=this.attribute,n="horizontal"===i?this.updateHorizontalMultilineAABBBounds(t):this.updateVerticalMultilineAABBBounds(t);return"horizontal"===i&&o&&this._AABBBounds.add(this._AABBBounds.x1,this._AABBBounds.y2+o),n}updateHorizontalSinglelineAABBBounds(t){var e,i;const o=_n(this).text,{wrap:n=o.wrap}=this.attribute;if(n)return this.updateWrapAABBBounds([t]);const r=Oo.graphicUtil.textMeasure;let s,l;const a=this.attribute,{maxLineWidth:h=o.maxLineWidth,ellipsis:d=o.ellipsis,textAlign:c=o.textAlign,textBaseline:u=o.textBaseline,fontFamily:g=o.fontFamily,fontSize:p=o.fontSize,fontWeight:f=o.fontWeight,stroke:m=o.stroke,lineWidth:b=o.lineWidth,ignoreBuf:v=o.ignoreBuf,whiteSpace:y=o.whiteSpace,suffixPosition:C=o.suffixPosition}=a;if("normal"===y)return this.updateWrapAABBBounds(t);const w=v?0:Math.max(2,.075*p),x=a.fontSize||o.fontSize,_=null!==(e=ar(a.lineHeight,x))&&void 0!==e?e:x+w;if(!this.shouldUpdateShape()&&this.cache){s=null!==(i=this.cache.clipedWidth)&&void 0!==i?i:0;const t=Js(c,s),e=Qs(u,_,p);return this._AABBBounds.set(t,e,t+s,e+_),m&&this._AABBBounds.expand(b/2),this._AABBBounds}if(Number.isFinite(h)){if(d){const e=!0===d?o.ellipsis:d,i=r.clipTextWithSuffix(t.toString(),{fontSize:p,fontWeight:f,fontFamily:g},h,e,!1,C);l=i.str,s=i.width}else{const e=r.clipText(t.toString(),{fontSize:p,fontWeight:f,fontFamily:g},h,!1);l=e.str,s=e.width}this.cache.clipedText=l,this.cache.clipedWidth=s}else s=r.measureTextWidth(t.toString(),{fontSize:p,fontWeight:f,fontFamily:g}),this.cache.clipedText=t.toString(),this.cache.clipedWidth=s;this.clearUpdateShapeTag();const S=Js(c,s);let A=_;Oo.global&&Oo.global.isSafari()&&(A+=.2*p);const B=Qs(u,A,p,w);return this._AABBBounds.set(S,B,S+s,B+A),m&&this._AABBBounds.expand(b/2),this._AABBBounds}getBaselineMapAlign(){return il.baselineMapAlign}getAlignMapBaseline(){return il.alignMapBaseline}updateVerticalSinglelineAABBBounds(t){var e,i,o;const n=_n(this).text,r=Oo.graphicUtil.textMeasure;let s;const l=this.attribute,{ignoreBuf:a=n.ignoreBuf}=l,h=a?0:2,{maxLineWidth:d=n.maxLineWidth,ellipsis:c=n.ellipsis,fontSize:u=n.fontSize,fontWeight:g=n.fontWeight,fontFamily:p=n.fontFamily,stroke:f=n.stroke,lineWidth:m=n.lineWidth,verticalMode:b=n.verticalMode,suffixPosition:v=n.suffixPosition}=l,y=null!==(e=ar(l.lineHeight,l.fontSize||n.fontSize))&&void 0!==e?e:(l.fontSize||n.fontSize)+h;let{textAlign:C=n.textAlign,textBaseline:w=n.textBaseline}=l;if(!b){const t=C;C=null!==(i=il.baselineMapAlign[w])&&void 0!==i?i:"left",w=null!==(o=il.alignMapBaseline[t])&&void 0!==o?o:"top"}if(!this.shouldUpdateShape()&&this.cache){s=this.cache.clipedWidth;const t=Js(C,s),e=Qs(w,y,u);return this._AABBBounds.set(e,t,e+y,t+s),f&&this._AABBBounds.expand(m/2),this._AABBBounds}let x=[jr(t.toString())];if(Number.isFinite(d)){if(c){const t=!0===c?n.ellipsis:c,e=r.clipTextWithSuffixVertical(x[0],{fontSize:u,fontWeight:g,fontFamily:p},d,t,!1,v);x=[e.verticalList],s=e.width}else{const t=r.clipTextVertical(x[0],{fontSize:u,fontWeight:g,fontFamily:p},d,!1);x=[t.verticalList],s=t.width}this.cache.verticalList=x,this.cache.clipedWidth=s}else s=0,x[0].forEach((t=>{const e=t.direction===Gr.HORIZONTAL?u:r.measureTextWidth(t.text,{fontSize:u,fontWeight:g,fontFamily:p});s+=e,t.width=e})),this.cache.verticalList=x,this.cache.clipedWidth=s;this.clearUpdateShapeTag();const _=Js(C,s),S=Qs(w,y,u);return this._AABBBounds.set(S,_,S+y,_+s),f&&this._AABBBounds.expand(m/2),this._AABBBounds}updateHorizontalMultilineAABBBounds(t){var e,i;const o=_n(this).text,{wrap:n=o.wrap}=this.attribute;if(n)return this.updateWrapAABBBounds(t);const r=this.attribute,{fontFamily:s=o.fontFamily,textAlign:l=o.textAlign,textBaseline:a=o.textBaseline,fontSize:h=o.fontSize,fontWeight:d=o.fontWeight,ellipsis:c=o.ellipsis,maxLineWidth:u,stroke:g=o.stroke,lineWidth:p=o.lineWidth,whiteSpace:f=o.whiteSpace,suffixPosition:m=o.suffixPosition}=r,b=null!==(e=ar(r.lineHeight,r.fontSize||o.fontSize))&&void 0!==e?e:r.fontSize||o.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),g&&this._AABBBounds.expand(p/2),this._AABBBounds}const v=Oo.graphicUtil.textMeasure,y=new tl(s,{fontSize:h,fontWeight:d,fontFamily:s},v).GetLayoutByLines(t,l,a,b,!0===c?o.ellipsis:c||void 0,!1,u,m),{bbox:C}=y;return this.cache.layoutData=y,this.clearUpdateShapeTag(),this._AABBBounds.set(C.xOffset,C.yOffset,C.xOffset+C.width,C.yOffset+C.height),g&&this._AABBBounds.expand(p/2),this._AABBBounds}updateVerticalMultilineAABBBounds(t){var e,i,o;const n=_n(this).text,r=Oo.graphicUtil.textMeasure;let s;const l=this.attribute,{ignoreBuf:a=n.ignoreBuf}=l,h=a?0:2,{maxLineWidth:d=n.maxLineWidth,ellipsis:c=n.ellipsis,fontFamily:u=n.fontFamily,fontSize:g=n.fontSize,fontWeight:p=n.fontWeight,stroke:f=n.stroke,lineWidth:m=n.lineWidth,verticalMode:b=n.verticalMode,suffixPosition:v=n.suffixPosition}=l,y=null!==(e=ar(l.lineHeight,l.fontSize||n.fontSize))&&void 0!==e?e:(l.fontSize||n.fontSize)+h;let{textAlign:C=n.textAlign,textBaseline:w=n.textBaseline}=l;if(!b){const t=C;C=null!==(i=il.baselineMapAlign[w])&&void 0!==i?i:"left",w=null!==(o=il.alignMapBaseline[t])&&void 0!==o?o:"top"}if(s=0,!this.shouldUpdateShape()&&this.cache){this.cache.verticalList.forEach((t=>{const e=t.reduce(((t,e)=>t+e.width),0);s=ae(e,s)}));const t=Js(C,s),e=this.cache.verticalList.length*y,i=Qs(w,e,g);return this._AABBBounds.set(i,t,i+e,t+s),f&&this._AABBBounds.expand(m/2),this._AABBBounds}const x=t.map((t=>jr(t.toString())));x.forEach(((t,e)=>{if(Number.isFinite(d))if(c){const i=!0===c?n.ellipsis:c,o=r.clipTextWithSuffixVertical(t,{fontSize:g,fontWeight:p,fontFamily:u},d,i,!1,v);x[e]=o.verticalList,s=o.width}else{const i=r.clipTextVertical(t,{fontSize:g,fontWeight:p,fontFamily:u},d,!1);x[e]=i.verticalList,s=i.width}else s=0,t.forEach((t=>{const e=t.direction===Gr.HORIZONTAL?g:r.measureTextWidth(t.text,{fontSize:g,fontWeight:p,fontFamily:u});s+=e,t.width=e}))})),this.cache.verticalList=x,this.clearUpdateShapeTag(),this.cache.verticalList.forEach((t=>{const e=t.reduce(((t,e)=>t+e.width),0);s=ae(e,s)}));const _=Js(C,s),S=this.cache.verticalList.length*y,A=Qs(w,S,g);return this._AABBBounds.set(A,_,A+S,_+s),f&&this._AABBBounds.expand(m/2),this._AABBBounds}tryUpdateOBBBounds(){throw new Error("暂不支持")}getDefaultAttribute(t){return _n(this).text[t]}needUpdateTags(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:el;return super.needUpdateTags(t,e)}needUpdateTag(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:el;return super.needUpdateTag(t,e)}clone(){return new il(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return il.NOWORK_ANIMATE_ATTR}}function ol(t){return new il(t)}il.NOWORK_ANIMATE_ATTR=Object.assign({ellipsis:1,wordBreak:1,direction:1,textAlign:1,textBaseline:1,fontFamily:1,fontWeight:1},Br),il.baselineMapAlign={top:"left",bottom:"right",middle:"center"},il.alignMapBaseline={left:"top",right:"bottom",center:"middle"};const nl=["heightLimit","lineClamp"];class rl extends il{constructor(t){super(Object.assign(Object.assign({},t),{wrap:!0}))}_isValid(){const{text:t}=this.attribute;return rt(t)?!t.every((t=>null==t||""===t)):null!=t&&""!==t}updateMultilineAABBBounds(t){var e,i,o,n;const r=_n(this).text,{fontFamily:s=r.fontFamily,textAlign:l=r.textAlign,textBaseline:a=r.textBaseline,fontSize:h=r.fontSize,ellipsis:d=r.ellipsis,maxLineWidth:c,stroke:u=r.stroke,lineWidth:g=r.lineWidth,wordBreak:p=r.wordBreak,fontWeight:f=r.fontWeight,ignoreBuf:m=r.ignoreBuf,heightLimit:b=0,suffixPosition:v=r.suffixPosition,lineClamp:y}=this.attribute,C=null!==(e=ar(this.attribute.lineHeight,this.attribute.fontSize||r.fontSize))&&void 0!==e?e:this.attribute.fontSize||r.fontSize,w=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),u&&this._AABBBounds.expand(g/2),this._AABBBounds}const x=Oo.graphicUtil.textMeasure,_=new tl(s,{fontSize:h,fontWeight:f,fontFamily:s},x),S=t.map((t=>t.toString())),A=[],B=[0,0];let R=1/0;if(b>0&&(R=Math.max(Math.floor(b/C),1)),y&&(R=Math.min(R,y)),"number"==typeof c&&c!==1/0){if(c>0)for(let t=0;t<S.length;t++){const e=S[t];let i=!0;if(t===R-1){const t=_.textMeasure.clipTextWithSuffix(e,_.textOptions,c,d,!1,v);A.push({str:t.str,width:t.width});break}const r=_.textMeasure.clipText(e,_.textOptions,c,"break-word"===p);if(""!==e&&""===r.str){if(d){const t=_.textMeasure.clipTextWithSuffix(e,_.textOptions,c,d,!1,v);r.str=null!==(o=t.str)&&void 0!==o?o:"",r.width=null!==(n=t.width)&&void 0!==n?n:0}else r.str="",r.width=0;i=!1}if(A.push({str:r.str,width:r.width}),r.str.length===e.length);else if(i){const i=e.substring(r.str.length);S.splice(t+1,0,i)}}let t=0;A.forEach((e=>{t=Math.max(t,e.width)})),B[0]=t}else{let t,e,i=0;for(let o=0,n=S.length;o<n;o++){if(o===R-1){const t=_.textMeasure.clipTextWithSuffix(S[o],_.textOptions,c,d,!1,v);A.push({str:t.str,width:t.width}),i=Math.max(i,t.width);break}e=S[o],t=_.textMeasure.measureTextWidth(e,_.textOptions,"break-word"===p),i=Math.max(i,t),A.push({str:e,width:t})}B[0]=i}B[1]=A.length*(C+w);const M={xOffset:0,yOffset:0,width:B[0],height:B[1]};_.LayoutBBox(M,l,a);const T=_.layoutWithBBox(M,A,l,a,C);return this.cache.layoutData=T,this.clearUpdateShapeTag(),this._AABBBounds.set(M.xOffset,M.yOffset,M.xOffset+M.width,M.yOffset+M.height),u&&this._AABBBounds.expand(g/2),this._AABBBounds}needUpdateTags(t){for(let e=0;e<nl.length;e++){const i=nl[e];if(-1!==t.indexOf(i))return!0}return super.needUpdateTags(t)}needUpdateTag(t){for(let e=0;e<nl.length;e++)if(t===nl[e])return!0;return super.needUpdateTag(t)}getNoWorkAnimateAttr(){return rl.NOWORK_ANIMATE_ATTR}}function sl(t){return new rl(t)}class ll{bounds(t,e){if(at(t)){const i=t/2;e.x1=-i,e.x2=i,e.y1=-i,e.y2=i}else e.x1=-t[0]/2,e.x2=t[0]/2,e.y1=-t[1]/2,e.y2=t[1]/2}}function al(t,e,i,o,n){return n?t.arc(i,o,e,0,oe,!1,n):t.arc(i,o,e,0,oe),!1}var hl=new class extends ll{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,o,n){return al(t,e/2,i,o,n)}drawOffset(t,e,i,o,n,r){return al(t,e/2+n,i,o,r)}drawToSvgPath(t,e,i,o){const n=t/2;return`M ${e-n}, ${i} a ${n},${n} 0 1,0 ${2*n},0 a ${n},${n} 0 1,0 -${2*n},0`}};var dl=new class extends ll{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,o,n){return function(t,e,i,o,n){return t.moveTo(-3*e+i,-e+o,n),t.lineTo(-e+i,-e+o,n),t.lineTo(-e+i,-3*e+o,n),t.lineTo(e+i,-3*e+o,n),t.lineTo(e+i,-e+o,n),t.lineTo(3*e+i,-e+o,n),t.lineTo(3*e+i,e+o,n),t.lineTo(e+i,e+o,n),t.lineTo(e+i,3*e+o,n),t.lineTo(-e+i,3*e+o,n),t.lineTo(-e+i,e+o,n),t.lineTo(-3*e+i,e+o,n),t.closePath(),!0}(t,e/6,i,o,n)}drawOffset(t,e,i,o,n,r){return function(t,e,i,o,n,r){return t.moveTo(-3*e+i-n,-e+o-n,r),t.lineTo(-e+i-n,-e+o-n,r),t.lineTo(-e+i-n,-3*e+o-n,r),t.lineTo(e+i+n,-3*e+o-n,r),t.lineTo(e+i+n,-e+o-n,r),t.lineTo(3*e+i+n,-e+o-n,r),t.lineTo(3*e+i+n,e+o+n,r),t.lineTo(e+i+n,e+o+n,r),t.lineTo(e+i+n,3*e+o+n,r),t.lineTo(-e+i-n,3*e+o+n,r),t.lineTo(-e+i-n,e+o+n,r),t.lineTo(-3*e+i-n,e+o+n,r),t.closePath(),!0}(t,e/6,i,o,n,r)}};function cl(t,e,i,o,n){return t.moveTo(i,o-e,n),t.lineTo(e+i,o,n),t.lineTo(i,o+e,n),t.lineTo(i-e,o,n),t.closePath(),!0}var ul=new class extends ll{constructor(){super(...arguments),this.type="diamond",this.pathStr="M-0.5,0L0,-0.5L0.5,0L0,0.5Z"}draw(t,e,i,o,n){return cl(t,e/2,i,o,n)}drawFitDir(t,e,i,o,n){return cl(t,e/2,i,o,n)}drawOffset(t,e,i,o,n,r){return cl(t,e/2+n,i,o,r)}};function gl(t,e,i,o){const n=2*e;return t.rect(i-e,o-e,n,n),!1}var pl=new class extends ll{constructor(){super(...arguments),this.type="square",this.pathStr="M-0.5,-0.5h1v1h-1Z"}draw(t,e,i,o){return gl(t,e/2,i,o)}drawOffset(t,e,i,o,n){return gl(t,e/2+n,i,o)}};class fl extends ll{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,o){return function(t,e,i,o){return t.moveTo(i+e,e+o),t.lineTo(i-e,e+o),t.lineTo(i,o-e),t.closePath(),!0}(t,e/2,i,o)}drawOffset(t,e,i,o,n){return function(t,e,i,o,n){return t.moveTo(i+e+2*n,e+o+n),t.lineTo(i-e-2*n,e+o+n),t.lineTo(i,o-e-2*n),t.closePath(),!0}(t,e/2,i,o,n)}}var ml=new fl;var bl=new class extends fl{constructor(){super(...arguments),this.type="triangle"}};const vl=Math.sin(Math.PI/10)/Math.sin(7*Math.PI/10),yl=Math.sin(oe/10)*vl,Cl=-Math.cos(oe/10)*vl;function wl(t,e,i,o){const n=yl*e,r=Cl*e;t.moveTo(i,-e+o),t.lineTo(n+i,r+o);for(let s=1;s<5;++s){const l=oe*s/5,a=Math.cos(l),h=Math.sin(l);t.lineTo(h*e+i,-a*e+o),t.lineTo(a*n-h*r+i,h*n+a*r+o)}return t.closePath(),!0}var xl=new class extends ll{constructor(){super(...arguments),this.type="star",this.pathStr="M0 -1L0.22451398828979266 -0.3090169943749474L0.9510565162951535 -0.30901699437494745L0.3632712640026804 0.1180339887498948L0.5877852522924732 0.8090169943749473L8.326672684688674e-17 0.3819660112501051L-0.587785252292473 0.8090169943749476L-0.3632712640026804 0.11803398874989487L-0.9510565162951536 -0.30901699437494723L-0.22451398828979274 -0.30901699437494734Z"}draw(t,e,i,o){return wl(t,e/2,i,o)}drawOffset(t,e,i,o,n){return wl(t,e/2+n,i,o)}};const _l=ce(3);function Sl(t,e,i,o){const n=e,r=n/_l,s=r/5,l=e;return t.moveTo(0+i,-n+o),t.lineTo(r/2+i,o),t.lineTo(s/2+i,o),t.lineTo(s/2+i,l+o),t.lineTo(-s/2+i,l+o),t.lineTo(-s/2+i,o),t.lineTo(-r/2+i,o),t.closePath(),!0}var Al=new class extends ll{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,o){return Sl(t,e/2,i,o)}drawOffset(t,e,i,o,n){return Sl(t,e/2+n,i,o)}};function Bl(t,e,i,o){const n=2*e;return t.moveTo(i,-e+o),t.lineTo(n/3/2+i,e+o),t.lineTo(-n/3/2+i,e+o),t.closePath(),!0}var Rl=new class extends ll{constructor(){super(...arguments),this.type="wedge",this.pathStr="M0,-0.5773502691896257L-0.125,0.28867513459481287L0.125,0.28867513459481287Z"}draw(t,e,i,o){return Bl(t,e/2,i,o)}drawOffset(t,e,i,o,n){return Bl(t,e/2+n,i,o)}};function Ml(t,e,i,o){return t.moveTo(-e+i,o),t.lineTo(i,e+o),!1}var Tl=new class extends ll{constructor(){super(...arguments),this.type="stroke",this.pathStr=""}draw(t,e,i,o){return Ml(t,e/2,i,o)}drawOffset(t,e,i,o,n){return Ml(t,e/2+n,i,o)}};const kl=-.5,Pl=ce(3)/2,El=1/ce(12);function Ll(t,e,i,o){const n=e/2,r=e*El,s=n,l=e*El+e,a=-s,h=l;return t.moveTo(n+i,r+o),t.lineTo(s+i,l+o),t.lineTo(a+i,h+o),t.lineTo(kl*n-Pl*r+i,Pl*n+kl*r+o),t.lineTo(kl*s-Pl*l+i,Pl*s+kl*l+o),t.lineTo(kl*a-Pl*h+i,Pl*a+kl*h+o),t.lineTo(kl*n+Pl*r+i,kl*r-Pl*n+o),t.lineTo(kl*s+Pl*l+i,kl*l-Pl*s+o),t.lineTo(kl*a+Pl*h+i,kl*h-Pl*a+o),t.closePath(),!1}var Hl=new class extends ll{constructor(){super(...arguments),this.type="wye",this.pathStr="M0.25 0.14433756729740646L0.25 0.6443375672974064L-0.25 0.6443375672974064L-0.25 0.14433756729740643L-0.6830127018922193 -0.10566243270259357L-0.4330127018922193 -0.5386751345948129L0 -0.28867513459481287L0.4330127018922193 -0.5386751345948129L0.6830127018922193 -0.10566243270259357Z"}draw(t,e,i,o){return Ll(t,e/2,i,o)}drawOffset(t,e,i,o,n){return Ll(t,e/2+n,i,o)}};var zl=new class extends ll{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,o){return function(t,e,i,o){return t.moveTo(-e+i,o),t.lineTo(e+i,e+o),t.lineTo(e+i,o-e),t.closePath(),!0}(t,e/2,i,o)}drawOffset(t,e,i,o,n){return function(t,e,i,o,n){return t.moveTo(-e+i-2*n,o),t.lineTo(e+i+n,e+o+2*n),t.lineTo(e+i+n,o-e-2*n),t.closePath(),!0}(t,e/2,i,o,n)}};var Fl=new class extends ll{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,o){return function(t,e,i,o){return t.moveTo(i-e,e+o),t.lineTo(e+i,o),t.lineTo(i-e,o-e),t.closePath(),!0}(t,e/2,i,o)}drawOffset(t,e,i,o,n){return function(t,e,i,o,n){return t.moveTo(i-e-n,e+o+2*n),t.lineTo(e+i+2*n,o),t.lineTo(i-e-n,o-e-2*n),t.closePath(),!0}(t,e/2,i,o,n)}};var Il=new class extends ll{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,o){return function(t,e,i,o){return t.moveTo(i-e,o-e),t.lineTo(i+e,o-e),t.lineTo(i,o+e),t.closePath(),!0}(t,e/2,i,o)}drawOffset(t,e,i,o,n){return function(t,e,i,o,n){return t.moveTo(i-e-2*n,o-e-n),t.lineTo(i+e+2*n,o-e-n),t.lineTo(i,o+e+2*n),t.closePath(),!0}(t,e/2,i,o,n)}};const Ol=ce(3);function Dl(t,e,i,o){const n=e*Ol;return t.moveTo(i,o+-n/3*2),t.lineTo(e+i,o+n),t.lineTo(i-e,o+n),t.closePath(),!0}var Wl=new class extends fl{constructor(){super(...arguments),this.type="thinTriangle",this.pathStr="M0,-0.5773502691896257L-0.5,0.28867513459481287L0.5,0.28867513459481287Z"}draw(t,e,i,o){return Dl(t,e/2/Ol,i,o)}drawOffset(t,e,i,o,n){return Dl(t,e/2/Ol+n,i,o)}};function Nl(t,e,i,o){const n=2*e;return t.moveTo(e+i,o-n),t.lineTo(i-e,o),t.lineTo(e+i,n+o),!0}var Gl=new class extends ll{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,o){return Nl(t,e/4,i,o)}drawOffset(t,e,i,o,n){return Nl(t,e/4+n,i,o)}};function jl(t,e,i,o){const n=2*e;return t.moveTo(i-e,o-n),t.lineTo(i+e,o),t.lineTo(i-e,n+o),!0}var Vl=new class extends ll{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,o){return jl(t,e/4,i,o)}drawOffset(t,e,i,o,n){return jl(t,e/4+n,i,o)}};function Ul(t,e,i,o){const n=2*e;return t.moveTo(i-n,o+e),t.lineTo(i,o-e),t.lineTo(i+n,o+e),!0}var $l=new class extends ll{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,o){return Ul(t,e/4,i,o)}drawOffset(t,e,i,o,n){return Ul(t,e/4+n,i,o)}};function Xl(t,e,i,o){const n=2*e;return t.moveTo(i-n,o-e),t.lineTo(i,o+e),t.lineTo(i+n,o-e),!0}var Yl=new class extends ll{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,o){return Xl(t,e/4,i,o)}drawOffset(t,e,i,o,n){return Xl(t,e/4+n,i,o)}};function Kl(t,e,i,o,n){return t.moveTo(i,o-e),t.lineTo(i,o+e),!0}var ql=new class extends ll{constructor(){super(...arguments),this.type="lineV",this.pathStr="M0,-0.5L0,0.5"}draw(t,e,i,o,n){return Kl(t,e/2,i,o)}drawOffset(t,e,i,o,n,r){return Kl(t,e/2+n,i,o)}drawToSvgPath(t,e,i,o){const n=t/2;return`M ${e}, ${i-n} L ${e},${i+n}`}};function Zl(t,e,i,o,n){return t.moveTo(i-e,o),t.lineTo(i+e,o),!0}var Jl=new class extends ll{constructor(){super(...arguments),this.type="lineH",this.pathStr="M-0.5,0L0.5,0"}draw(t,e,i,o,n){return Zl(t,e/2,i,o)}drawOffset(t,e,i,o,n,r){return Zl(t,e/2+n,i,o)}drawToSvgPath(t,e,i,o){const n=t/2;return`M ${e-n}, ${i} L ${e+n},${i}`}};function Ql(t,e,i,o,n){return t.moveTo(i-e,o-e),t.lineTo(i+e,o+e),t.moveTo(i+e,o-e),t.lineTo(i-e,o+e),!0}var ta=new class extends ll{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,o,n){return Ql(t,e/2,i,o)}drawOffset(t,e,i,o,n,r){return Ql(t,e/2+n,i,o)}drawToSvgPath(t,e,i,o){const n=t/2;return`M ${e-n}, ${i-n} L ${e+n},${i+n} M ${e+n}, ${i-n} L ${e-n},${i+n}`}};function ea(t,e,i,o){return t.rect(i-e[0]/2,o-e[1]/2,e[0],e[1]),!1}function ia(t,e,i,o){const n=e,r=e/2;return t.rect(i-n/2,o-r/2,n,r),!1}var oa=new class extends ll{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,e,i,o){return at(e)?ia(t,e,i,o):ea(t,e,i,o)}drawOffset(t,e,i,o,n){return at(e)?ia(t,e+2*n,i,o):ea(t,[e[0]+2*n,e[1]+2*n],i,o)}};const na=new Ce;class ra{constructor(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.pathStr="",this.type=t,rt(e)?this.svgCache=e:this.path=e,this.isSvg=i}drawOffset(t,e,i,o,n,r,s){return this.isSvg?!!this.svgCache&&(this.svgCache.forEach((n=>{t.beginPath(),zi(n.path.commandList,t,i,o,e,e),s&&s(n.path,n.attribute)})),!1):(zi(this.path.commandList,t,i,o,e+n,e+n),!1)}draw(t,e,i,o,n,r){return this.isSvg?!!this.svgCache&&(this.svgCache.forEach((n=>{t.beginPath(),zi(n.path.commandList,t,i,o,e,e),r&&r(n.path,n.attribute)})),!1):(zi(this.path.commandList,t,i,o,e,e),!1)}bounds(t,e){if(this.isSvg){if(!this.svgCache)return;return e.clear(),void this.svgCache.forEach((i=>{let{path:o}=i;na.x1=o.bounds.x1*t,na.y1=o.bounds.y1*t,na.x2=o.bounds.x2*t,na.y2=o.bounds.y2*t,e.union(na)}))}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 sa={};[hl,dl,ul,pl,Wl,bl,xl,Al,Rl,Tl,Hl,zl,Fl,ml,Il,Gl,Vl,$l,Yl,oa,ql,Jl,ta].forEach((t=>{sa[t.type]=t}));const la={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"},aa=new Ce,ha=["symbolType","size",...wr];let da=class t extends Rr{constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{symbolType:"circle"}),this.type="symbol",this.numberType=ns}getParsedPath(){return this.shouldUpdateShape()&&(this.doUpdateParsedPath(),this.clearUpdateShapeTag()),this._parsedPath}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{size:t}=this.attribute;return rt(t)?2===t.length&&t.every(this._validNumber):this._validNumber(t)}doUpdateParsedPath(){const e=_n(this).symbol;let{symbolType:i=e.symbolType}=this.attribute,o=sa[i];if(o)return this._parsedPath=o,o;if(o=t.userSymbolMap[i],o)return this._parsedPath=o,o;if(i=la[i]||i,!0===function(t){return t.startsWith("<svg")||t.startsWith("<?xml")}(i)){const e=new Or,{svg:o}=e.parse(i);if(!o)return null;const n=rt(o.path)?o.path:[o.path];aa.clear();const r=[];n.forEach((t=>{const e=(new go).fromString(t.d),i={};hs.forEach((e=>{t[e]&&(i[as[e]]=t[e])})),r.push({path:e,attribute:i}),aa.union(e.bounds)}));const s=aa.width(),l=aa.height(),a=1/ae(s,l);return r.forEach((t=>t.path.transform(0,0,a,a))),this._parsedPath=new ra(i,r,!0),t.userSymbolMap[i]=this._parsedPath,this._parsedPath}const n=(new go).fromString(i),r=n.bounds.width(),s=n.bounds.height(),l=1/ae(r,s);return n.transform(0,0,l,l),this._parsedPath=new ra(i,n),t.userSymbolMap[i]=this._parsedPath,this._parsedPath}doUpdateAABBBounds(t){const e=_n(this).symbol;this._AABBBounds.clear();const i=this.attribute,o=Oo.graphicService.updateSymbolAABBBounds(i,_n(this).symbol,this._AABBBounds,t,this),{boundsPadding:n=e.boundsPadding}=i,r=Qn(n);return r&&o.expand(r),this.clearUpdateBoundTag(),o}tryUpdateOBBBounds(){throw new Error("暂不支持")}getDefaultAttribute(t){return _n(this).symbol[t]}needUpdateTags(t){return super.needUpdateTags(t,ha)}needUpdateTag(t){return super.needUpdateTag(t,ha)}toCustomPath(){const t=this.getParsedPath(),e=this.attribute.size,i=rt(e)?e:[e,e];return t.path?(new go).fromCustomPath2D(t.path,0,0,i[0],i[1]):(new go).fromString(t.pathStr,0,0,i[0],i[1])}clone(){return new t(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return t.NOWORK_ANIMATE_ATTR}};function ca(t){return new da(t)}da.userSymbolMap={},da.NOWORK_ANIMATE_ATTR=Object.assign({symbolType:1},Br);const ua=["segments","points","curveType",...wr];let ga=class t extends Rr{constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),this.type="line",this.numberType=Qr}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,o,n){"points"===t&&(n.points=nr(i,o,e))}doUpdateAABBBounds(){const t=_n(this).line;this._AABBBounds.clear();const e=this.attribute,i=Oo.graphicService.updateLineAABBBounds(e,_n(this).line,this._AABBBounds,this),{boundsPadding:o=t.boundsPadding}=e,n=Qn(o);return n&&i.expand(n),this.clearUpdateBoundTag(),i}tryUpdateOBBBounds(){throw new Error("暂不支持")}getDefaultAttribute(t){return _n(this).line[t]}needUpdateTags(t){return super.needUpdateTags(t,ua)}needUpdateTag(t){return super.needUpdateTag(t,ua)}toCustomPath(){const t=this.attribute,e=new go,i=t.segments,o=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=>{o(t.points)})):t.points&&o(t.points),e}clone(){return new t(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return t.NOWORK_ANIMATE_ATTR}};function pa(t){return new ga(t)}ga.NOWORK_ANIMATE_ATTR=Object.assign({segments:1,curveType:1},Br);const fa=["width","x1","y1","height","cornerRadius",...wr];let ma=class t extends Rr{constructor(t){super(t),this.type="rect",this.numberType=is}isValid(){return super.isValid()&&this._isValid()}_isValid(){return!0}doUpdateAABBBounds(){const t=_n(this).rect;this._AABBBounds.clear();const e=this.attribute,i=Oo.graphicService.updateRectAABBBounds(e,_n(this).rect,this._AABBBounds,this),{boundsPadding:o=t.boundsPadding}=e,n=Qn(o);return n&&i.expand(n),this.clearUpdateBoundTag(),i}tryUpdateOBBBounds(){throw new Error("暂不支持")}getDefaultAttribute(t){return _n(this).rect[t]}needUpdateTags(t){return super.needUpdateTags(t,fa)}needUpdateTag(t){return super.needUpdateTag(t,fa)}toCustomPath(){const t=this.attribute,{x:e,y:i,width:o,height:n}=(t=>{if(!t)return{x:0,y:0,width:0,height:0};let e=J(t.width)?t.x1-t.x:t.width,i=J(t.height)?t.y1-t.y:t.height,o=0,n=0;return e<0?(o=e,e=-e):Number.isNaN(e)&&(e=0),i<0?(n=i,i=-i):Number.isNaN(i)&&(i=0),{x:o,y:n,width:e,height:i}})(t),r=new go;return r.moveTo(e,i),r.rect(e,i,o,n),r}clone(){return new t(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return t.NOWORK_ANIMATE_ATTR}};function ba(t){return new ma(t)}ma.NOWORK_ANIMATE_ATTR=Br;class va{constructor(t,e,i,o,n,r,s,l,a,h,d,c,u,g){this.left=t,this.top=e,this.width=i,this.height=o,this.actualHeight=0,this.bottom=e+o,this.right=t+i,this.ellipsis=n,this.wordBreak=r,this.verticalDirection=s,this.lines=[],this.globalAlign=l,this.globalBaseline=a,this.layoutDirection=h,this.directionKey=Do[this.layoutDirection],this.isWidthMax=d,this.isHeightMax=c,this.singleLine=u,g?(g.clear(),this.icons=g):this.icons=new Map}draw(t,e){const{width:i,height:o}=this.getActualSize(),n=this.isWidthMax?Math.min(this.width,i):this.width||i||0;let r=this.isHeightMax?Math.min(this.height,o):this.height||o||0;r=Math.min(r,o);let s=0;switch(this.globalBaseline){case"top":s=0;break;case"middle":s=-r/2;break;case"bottom":s=-r}let l=0;"right"===this.globalAlign||"end"===this.globalAlign?l=-n:"center"===this.globalAlign&&(l=-n/2);let a=this[this.directionKey.height];this.singleLine&&(a=this.lines[0].height+1);let h=!1;if("middle"===this.verticalDirection)if(this.actualHeight>=a&&0!==a)for(let i=0;i<this.lines.length;i++){const{top:o,height:n}=this.lines[i];if(o+n<this[this.directionKey.top]||o+n>this[this.directionKey.top]+a)return h;let r=!1;this.ellipsis&&this.lines[i+1]&&this.lines[i+1].top+this.lines[i+1].height>this[this.directionKey.top]+a&&(r=!0,h=!0),this.lines[i].draw(t,r,this.lines[i][this.directionKey.left]+l,this.lines[i][this.directionKey.top]+s,this.ellipsis,e)}else{const i=Math.floor((a-this.actualHeight)/2);"vertical"===this.layoutDirection?l+=i:s+=i;for(let i=0;i<this.lines.length;i++)this.lines[i].draw(t,!1,this.lines[i][this.directionKey.left]+l,this.lines[i][this.directionKey.top]+s,this.ellipsis,e)}else if("bottom"===this.verticalDirection&&"vertical"!==this.layoutDirection)for(let i=0;i<this.lines.length;i++){const{top:o,height:n}=this.lines[i],r=a-this.lines[i].top-this.lines[i].height;if(0===a)this.lines[i].draw(t,!1,l,r+s,this.ellipsis,e);else{if(r+n>this[this.directionKey.top]+a||r<this[this.directionKey.top])return h;{let o=!1;this.ellipsis&&this.lines[i+1]&&r-this.lines[i+1].height<this[this.directionKey.top]&&(o=!0,h=!0),this.lines[i].draw(t,o,l,r+s,this.ellipsis,e)}}}else{"bottom"===this.verticalDirection&&"vertical"===this.layoutDirection&&this.singleLine&&this.isWidthMax&&(l+=this.lines[0].height+1);for(let i=0;i<this.lines.length;i++){"bottom"===this.verticalDirection&&"vertical"===this.layoutDirection&&(l-=this.lines[i].height+this.lines[i].top);const{top:o,height:n}=this.lines[i];if(0===a)this.lines[i].draw(t,!1,this.lines[i][this.directionKey.left]+l,this.lines[i][this.directionKey.top]+s,this.ellipsis,e);else{if(o+n<this[this.directionKey.top]||o+n>this[this.directionKey.top]+a)return h;{let o=!1;this.ellipsis&&this.lines[i+1]&&this.lines[i+1].top+this.lines[i+1].height>this[this.directionKey.top]+a&&(o=!0,h=!0),this.lines[i].draw(t,o,this.lines[i][this.directionKey.left]+l,this.lines[i][this.directionKey.top]+s,this.ellipsis,e)}}}}return h}getActualSize(){return this.ellipsis?this.getActualSizeWidthEllipsis():this.getRawActualSize()}getRawActualSize(){let t=0,e=0;for(let i=0;i<this.lines.length;i++){const o=this.lines[i];o.actualWidth>t&&(t=o.actualWidth),e+=o.height}return{width:"vertical"===this.layoutDirection?e:t,height:"vertical"===this.layoutDirection?t:e}}getActualSizeWidthEllipsis(){let t=0,e=0;const{width:i,height:o}=this.getRawActualSize();this.width,this.height;let n=this[this.directionKey.height];if(this.singleLine&&(n=this.lines[0].height+1),"middle"===this.verticalDirection)if(this.actualHeight>=n&&0!==n)for(let i=0;i<this.lines.length;i++){const{top:o,height:r}=this.lines[i];if(o+r<this[this.directionKey.top]||o+r>this[this.directionKey.top]+n);else if(this.ellipsis&&this.lines[i+1]&&this.lines[i+1].top+this.lines[i+1].height>this[this.directionKey.top]+n){const o=!0===this.ellipsis?"...":this.ellipsis||"",n=this.lines[i].getWidthWithEllips(o);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((n-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:o,height:r}=this.lines[i],s=n-this.lines[i].top-this.lines[i].height;if(0===n)this.lines[i].actualWidth>t&&(t=this.lines[i].actualWidth),e+=this.lines[i].height;else if(s+r>this[this.directionKey.top]+n||s<this[this.directionKey.top]);else if(this.ellipsis&&this.lines[i+1]&&s-this.lines[i+1].height<this[this.directionKey.top]){const o=!0===this.ellipsis?"...":this.ellipsis||"",n=this.lines[i].getWidthWithEllips(o);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:o,height:r}=this.lines[i];if(0===n)this.lines[i].actualWidth>t&&(t=this.lines[i].actualWidth),e+=this.lines[i].height;else if(o+r<this[this.directionKey.top]||o+r>this[this.directionKey.top]+n);else if(this.ellipsis&&this.lines[i+1]&&this.lines[i+1].top+this.lines[i+1].height>this[this.directionKey.top]+n){const o=!0===this.ellipsis?"...":this.ellipsis||"",n=this.lines[i].getWidthWithEllips(o);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 ya{constructor(t,e,i){this.fontSize=i.fontSize||16,this.textBaseline=i.textBaseline||"alphabetic";const o=ar(i.lineHeight,this.fontSize);this.lineHeight="number"==typeof o?o>this.fontSize?o:this.fontSize:Math.floor(1.2*this.fontSize),this.height=this.lineHeight;const{ascent:n,height:r,descent:s,width:l}=Xo(t,i);let a=0,h=0,d=0;this.height>r&&(a=(this.height-r)/2,h=Math.ceil(a),d=Math.floor(a)),"top"===this.textBaseline?(this.ascent=a,this.descent=r-a):"bottom"===this.textBaseline?(this.ascent=r-a,this.descent=a):"middle"===this.textBaseline?(this.ascent=this.height/2,this.descent=this.height/2):(this.ascent=n+h,this.descent=s+d),this.length=t.length,this.width=l||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),this.ellipsisStr="..."}updateWidth(){const{width:t}=Xo(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,o,n){let r=this.text,s=this.left+i;e+=this.top;let l=this.direction;if(this.verticalEllipsis)r=this.ellipsisStr,l="vertical",e-=this.ellipsisWidth/2;else{if("hide"===this.ellipsis)return;if("add"===this.ellipsis)r+=this.ellipsisStr,"right"!==n&&"end"!==n||(s-=this.ellipsisWidth);else if("replace"===this.ellipsis){const t=Uo(r,("vertical"===l?this.height:this.width)-this.ellipsisWidth+this.ellipsisOtherParagraphWidth,this.character,r.length-1);if(r=r.slice(0,t),r+=this.ellipsisStr,"right"===n||"end"===n){const{width:e}=Xo(this.text.slice(t),this.character);"vertical"===l||(s-=this.ellipsisWidth-e)}}}switch(this.character.script){case"super":e-=this.ascent*(1/3);break;case"sub":e+=this.descent/2}"vertical"===l&&(t.save(),t.rotateAbout(Math.PI/2,s,e),t.translate(-this.heightOrigin||-this.lineHeight/2,-this.descent/2),t.translate(s,e),s=0,e=0),this.character.stroke&&(function(t,e){const i=e&&e.stroke||No;if(!i)return void(t.globalAlpha=0);const{strokeOpacity:o=1,opacity:n=1}=e;t.globalAlpha=o*n,t.lineWidth=e&&"number"==typeof e.lineWidth?e.lineWidth:1,t.strokeStyle=i;let r=e.fontSize||16;switch(e.script){case"super":case"sub":r*=.8}t.setTextStyle({textAlign:"left",textBaseline:e.textBaseline||"alphabetic",fontStyle:e.fontStyle||"",fontWeight:e.fontWeight||"",fontSize:r,fontFamily:e.fontFamily||"sans-serif"})}(t,this.character),t.strokeText(r,s,e)),function(t,e){const i=e&&e.fill||Wo;if(!i)return void(t.globalAlpha=0);const{fillOpacity:o=1,opacity:n=1}=e;t.globalAlpha=o*n,t.fillStyle=i;let r=e.fontSize||16;switch(e.script){case"super":case"sub":r*=.8}t.setTextStyle({textAlign:"left",textBaseline:e.textBaseline||"alphabetic",fontStyle:e.fontStyle||"",fontWeight:e.fontWeight||"",fontSize:r,fontFamily:e.fontFamily||"sans-serif"})}(t,this.character),this.character.fill&&t.fillText(r,s,e),this.character.fill&&("boolean"==typeof this.character.lineThrough||"boolean"==typeof this.character.underline?(this.character.underline&&t.fillRect(s,1+e,this.widthOrigin||this.width,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1),this.character.lineThrough&&t.fillRect(s,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(s,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(s,1+e-this.ascent/2,this.widthOrigin||this.width,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1)),"vertical"===l&&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=Uo(e,i-this.ellipsisWidth+this.ellipsisOtherParagraphWidth,this.character,e.length-1);e=e.slice(0,t),e+=this.ellipsisStr;const{width:o}=Xo(this.text.slice(t),this.character);return i+this.ellipsisWidth-o}return i}}const Ca=["width","height","image",...wr];let wa=class t extends Rr{constructor(t){super(t),this.type="image",this.numberType=Jr,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()}))}setAttributes(t,e,i){return t.image&&this.loadImage(t.image),super.setAttributes(t,e,i)}setAttribute(t,e,i,o){return"image"===t&&this.loadImage(e),super.setAttribute(t,e,i,o)}doUpdateAABBBounds(){const t=_n(this).image;this._AABBBounds.clear();const e=this.attribute,i=Oo.graphicService.updateImageAABBBounds(e,_n(this).image,this._AABBBounds,this),{boundsPadding:o=t.boundsPadding}=e,n=Qn(o);return n&&i.expand(n),this.clearUpdateBoundTag(),i}tryUpdateOBBBounds(){throw new Error("暂不支持")}getDefaultAttribute(t){return Fo[t]}needUpdateTags(t){return super.needUpdateTags(t,Ca)}needUpdateTag(t){return super.needUpdateTag(t,Ca)}clone(){return new t(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return t.NOWORK_ANIMATE_ATTR}};function xa(t){return new wa(t)}wa.NOWORK_ANIMATE_ATTR=Object.assign({image:1,repeatX:1,repeatY:1},Br);class _a extends wa{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=Qn(t.margin);this._marginArray="number"==typeof e?[e,e,e,e]:e}this.onBeforeAttributeUpdate=(t,e,i)=>{if(rt(i)&&-1!==i.indexOf("margin")||"margin"===i)if(e.margin){const t=Qn(e.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=Fo.width,height:e=Fo.height}=this.attribute,{backgroundWidth:i=t,backgroundHeight:o=e}=this.attribute,n=(i-t)/2,r=(o-e)/2;return this._AABBBounds.expand([0,2*n,2*r,0]),this._AABBBounds}setHoverState(t){"hover"===this.attribute.backgroundShowMode&&this._hovered!==t&&(this._hovered=t)}}class Sa{constructor(t,e,i,o,n,r,s,l){this.left=t,this.width=e,this.baseline=i,this.ascent=o,this.descent=n,this.top=i-o,this.paragraphs=r.map((t=>t)),this.textAlign=(this.paragraphs[0]instanceof _a?this.paragraphs[0].attribute.textAlign:this.paragraphs[0].character.textAlign)||"left",this.direction=s,this.directionKey=Do[this.direction],this.actualWidth=0;let a=0;this.paragraphs.forEach(((t,e)=>{if(0===e&&t instanceof ya){const e=Vo.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],a=Math.max(t[this.directionKey.height],a)})),this.height=a,this.blankWidth=l?0:this.width-this.actualWidth,this.calcOffset(e,l)}calcOffset(t,e){const i=this.directionKey,o=this.height;let n=this.left,r=0;this.actualWidth<t&&!e&&("right"===this.textAlign||"end"===this.textAlign?n=t-this.actualWidth:"center"===this.textAlign?n=(t-this.actualWidth)/2:"justify"===this.textAlign&&(this.paragraphs.length<2?n=(t-this.actualWidth)/2:r=(t-this.actualWidth)/(this.paragraphs.length-1))),this.paragraphs.map((function(t){t instanceof _a?(t["_"+i.x]=n,n+=t[i.width]+r,t["_"+i.y]="top"===t.attribute.textBaseline?0:"bottom"===t.attribute.textBaseline?o-t.height:(o-t.height)/2):(t[i.left]=n,n+=t[i.width]+r)}))}draw(t,e,i,o,n,r){if(n&&(e||this.paragraphs.some((t=>t.overflow)))){let t=0;for(let i=this.paragraphs.length-1;i>=0;i--){const o=this.paragraphs[i];if(o.overflow)continue;if(o instanceof _a)break;if("vertical"===this.direction&&"vertical"!==o.direction){o.verticalEllipsis=!0;break}const r=!0===n?"...":n||"";o.ellipsisStr=r;const{width:s}=Xo(r,o.character),l=s||0;if(l<=this.blankWidth+t){e&&(o.ellipsis="add");break}if(l<=this.blankWidth+t+o.width){o.ellipsis="replace",o.ellipsisWidth=l,o.ellipsisOtherParagraphWidth=this.blankWidth+t;break}o.ellipsis="hide",t+=o.width}}this.paragraphs.map(((e,n)=>{if(e instanceof _a)return e.setAttributes({x:i+e._x,y:o+e._y}),void r(e,t,i+e._x,o+e._y,this.ascent);e.draw(t,o+this.ascent,i,0===n,this.textAlign)}))}getWidthWithEllips(t){let e=0;for(let i=this.paragraphs.length-1;i>=0;i--){const o=this.paragraphs[i];if(o instanceof _a)break;const{width:n}=Xo(t,o.character),r=n||0;if(r<=this.blankWidth+e){o.ellipsis="add",o.ellipsisWidth=r;break}if(r<=this.blankWidth+e+o.width){o.ellipsis="replace",o.ellipsisWidth=r,o.ellipsisOtherParagraphWidth=this.blankWidth+e;break}o.ellipsis="hide",e+=o.width}let i=0;return this.paragraphs.map(((t,e)=>{i+=t instanceof _a?t.width:t.getWidthWithEllips(this.direction)})),i}}class Aa{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=Do[this.direction]}store(t){if(t instanceof _a){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 Sa(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 _a?"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,o=Uo(t.text,e,t.character,i,"break-word"===this.frame.wordBreak);if(0!==o){const[e,i]=function(t,e){const i=t.text.slice(0,e),o=t.text.slice(e);return[new ya(i,t.newLine,t.character),new ya(o,!0,t.character)]}(t,o);this.store(e),this.deal(i)}else 0!==this.lineBuffer.length&&(this.send(),this.deal(t))}}const Ba=["width","height","ellipsis","wordBreak","verticalDirection","maxHeight","maxWidth","textAlign","textBaseline","textConfig","layoutDirection",...wr];class Ra extends Rr{constructor(t){super(t),this.type="richtext",this._currentHoverIcon=null,this.numberType=os}get width(){var t;return null!==(t=this.attribute.width)&&void 0!==t?t:zo.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:zo.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:zo.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:zo.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:zo.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:zo.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:zo.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:zo.textConfig}set textConfig(t){this.attribute.textConfig=t,this.addUpdateShapeAndBoundsTag()}doUpdateAABBBounds(){const t=_n(this).richtext;this._AABBBounds.clear();const e=this.attribute,i=Oo.graphicService.updateRichTextAABBBounds(e,_n(this).richtext,this._AABBBounds,this),{boundsPadding:o=t.boundsPadding}=e,n=Qn(o);return n&&i.expand(n),this.clearUpdateBoundTag(),i}tryUpdateOBBBounds(){throw new Error("暂不支持")}getDefaultAttribute(t){return zo[t]}needUpdateTags(t){return super.needUpdateTags(t,Ba)}needUpdateTag(t){return super.needUpdateTag(t,Ba)}getFrameCache(){return this.shouldUpdateShape()&&(this.doUpdateFrameCache(),this.clearUpdateShapeTag()),this._frameCache}combinedStyleToCharacter(t){const{fill:e,stroke:i,fontSize:o,fontFamily:n,fontStyle:r,fontWeight:s,lineWidth:l,opacity:a,fillOpacity:h,strokeOpacity:d}=this.attribute;return Object.assign({fill:e,stroke:i,fontSize:o,fontFamily:n,fontStyle:r,fontWeight:s,lineWidth:l,opacity:a,fillOpacity:h,strokeOpacity:d},t)}doUpdateFrameCache(){var t;const{textConfig:e=[],maxWidth:i,maxHeight:o,width:n,height:r,ellipsis:s,wordBreak:l,verticalDirection:a,textAlign:h,textBaseline:d,layoutDirection:c,singleLine:u,disableAutoWrapLine:g}=this.attribute,p=[];for(let t=0;t<e.length;t++)if("image"in e[t]){const i=this.combinedStyleToCharacter(e[t]),o=i.id&&this._frameCache&&this._frameCache.icons&&this._frameCache.icons.get(i.id);if(o)p.push(o);else{const t=new _a(i);t.successCallback=()=>{var t;this.addUpdateBoundTag(),null===(t=this.stage)||void 0===t||t.renderNextFrame()},t.richtextId=i.id,p.push(t)}}else{const i=this.combinedStyleToCharacter(e[t]);if(at(i.text)&&(i.text=`${i.text}`),i.text&&i.text.includes("\n")){const t=i.text.split("\n");for(let e=0;e<t.length;e++)p.push(new ya(t[e],0!==e,i))}else i.text&&p.push(new ya(i.text,!1,i))}const f="number"==typeof i&&Number.isFinite(i)&&i>0,m="number"==typeof o&&Number.isFinite(o)&&o>0,b="number"==typeof n&&Number.isFinite(n)&&n>0&&(!f||n<=i),v="number"==typeof r&&Number.isFinite(r)&&r>0&&(!m||r<=o),y=new va(0,0,(b?n:f?i:0)||0,(v?r:m?o:0)||0,s,l,a,h,d,c||"horizontal",!b&&f,!v&&m,u||!1,null===(t=this._frameCache)||void 0===t?void 0:t.icons),C=new Aa(y);if(g){let t=0,e=!1;for(let i=0;i<p.length;i++){const o=p[i];e?(o.overflow=!0,o.left=1/0,o.top=1/0,!o.newLine&&y.lines[y.lines.length-1].paragraphs.push(o)):C.deal(o),y.lines.length!==t&&(t=y.lines.length,C.lineBuffer.length=0,o.overflow=!0,o.left=1e3,o.top=1e3,y.lines[y.lines.length-1].paragraphs.push(o),e=!0),o.newLine&&(e=!1,C.lineWidth=0)}}else for(let t=0;t<p.length;t++)C.deal(p[t]);if(C.send(),!("horizontal"===y.layoutDirection?b:v)){const t=y.getActualSizeWidthEllipsis();let e="horizontal"===y.layoutDirection?t.width:t.height;("horizontal"===y.layoutDirection?f:m)&&(e=Math.min(e,"horizontal"===y.layoutDirection?i:o)),y.lines.forEach((function(t){t.calcOffset(e,!1)}))}this._frameCache=y}clone(){return new Ra(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,o,n,r;const s=this.pickIcon(t.global);s&&s===this._currentHoverIcon||(s?(null===(e=this._currentHoverIcon)||void 0===e||e.setHoverState(!1),this._currentHoverIcon=s,this._currentHoverIcon.setHoverState(!0),null===(i=this.stage)||void 0===i||i.setCursor(s.attribute.cursor),null===(o=this.stage)||void 0===o||o.renderNextFrame()):!s&&this._currentHoverIcon&&(this._currentHoverIcon.setHoverState(!1),this._currentHoverIcon=null,null===(n=this.stage)||void 0===n||n.setCursor(),null===(r=this.stage)||void 0===r||r.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:o}=this.globalTransMatrix;let n;return e.icons.forEach((e=>{var r,s;e.AABBBounds.containsPoint({x:t.x-i,y:t.y-o})&&(n=e,n.globalX=(null!==(r=n.attribute.x)&&void 0!==r?r:0)+i,n.globalY=(null!==(s=n.attribute.y)&&void 0!==s?s:0)+o)})),n}getNoWorkAnimateAttr(){return Ra.NOWORK_ANIMATE_ATTR}}function Ma(t){return new Ra(t)}Ra.NOWORK_ANIMATE_ATTR=Object.assign({ellipsis:1,wordBreak:1,verticalDirection:1,textAlign:1,textBaseline:1,textConfig:1,layoutDirection:1},Br);const Ta=["path","customPath",...wr];class ka extends Rr{constructor(t){super(t),this.type="path",this.numberType=ts}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=_n(this).path;if(!this.valid)return t.path;const e=this.attribute;return e.path instanceof go?e.path:(J(this.cache)&&this.doUpdatePathShape(),this.cache instanceof go?this.cache:t.path)}doUpdateAABBBounds(){const t=_n(this).path;this.doUpdatePathShape(),this._AABBBounds.clear();const e=this.attribute,i=Oo.graphicService.updatePathAABBBounds(e,_n(this).path,this._AABBBounds,this),{boundsPadding:o=t.boundsPadding}=e,n=Qn(o);return n&&i.expand(n),this.clearUpdateBoundTag(),i}doUpdatePathShape(){const t=this.attribute;nt(t.path,!0)?this.cache=(new go).fromString(t.path):t.customPath&&(this.cache=new go,t.customPath(this.cache,this))}tryUpdateOBBBounds(){throw new Error("暂不支持")}getDefaultAttribute(t){return _n(this).path[t]}needUpdateTags(t){return super.needUpdateTags(t,Ta)}needUpdateTag(t){return super.needUpdateTag(t,Ta)}toCustomPath(){return(new go).fromCustomPath2D(this.getParsedPathShape(),0,0)}clone(){return new ka(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return ka.NOWORK_ANIMATE_ATTR}}function Pa(t){return new ka(t)}ka.NOWORK_ANIMATE_ATTR=Object.assign({path:1,customPath:1},Br);const Ea=["innerRadius","outerRadius","startAngle","endAngle","cornerRadius","padAngle","padRadius","cap",...wr];class La extends Rr{constructor(t){super(t),this.type="arc",this.numberType=Xr}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{startAngle:t,endAngle:e,outerRadius:i,innerRadius:o}=this.attribute;return this._validNumber(t)&&this._validNumber(e)&&this._validNumber(i)&&this._validNumber(o)}getParsedCornerRadius(){const t=_n(this).arc,{cornerRadius:e=t.cornerRadius,innerPadding:i=t.innerPadding,outerPadding:o=t.outerPadding}=this.attribute;let{outerRadius:n=t.outerRadius,innerRadius:r=t.innerRadius}=this.attribute;if(n+=o,r-=i,0===e||"0%"===e)return 0;const s=Math.abs(n-r);return Math.min(at(e,!0)?e:s*parseFloat(e)/100,s/2)}getParsedAngle(){const t=_n(this).arc;let{startAngle:e=t.startAngle,endAngle:i=t.endAngle}=this.attribute;const{cap:o=t.cap}=this.attribute,n=i-e>=0?1:-1,r=i-e;if(e=xe(e),i=e+r,o&&re(r)<ne-te){let r=1,s=1;o.length&&(r=Number(o[0]),s=Number(o[1]));let{outerRadius:l=t.outerRadius,innerRadius:a=t.innerRadius}=this.attribute;const{outerPadding:h=t.outerPadding,innerPadding:d=t.innerPadding}=this.attribute;l+=h,a-=d;const c=Math.abs(l-a)/2,u=c/l;if(c>te&&l>te)return{startAngle:e-n*u*r,endAngle:i+n*u*s,sc:n*u*r,ec:n*u*s}}return{startAngle:e,endAngle:i}}getParsePadAngle(t,e){const i=_n(this).arc,{innerPadding:o=i.innerPadding,outerPadding:n=i.outerPadding,padAngle:r=i.padAngle}=this.attribute;let{outerRadius:s=i.outerRadius,innerRadius:l=i.innerRadius}=this.attribute;s+=n,l-=o;const{padRadius:a=ce(s*s+l*l)}=this.attribute,h=re(e-t);let d=t,c=e,u=t,g=e;const p=r/2;let f=h,m=h;if(p>te&&a>te){const i=e>t?1:-1;let o=pe(Number(a)/l*de(p)),n=pe(Number(a)/s*de(p));return(f-=2*o)>te?(o*=i,u+=o,g-=o):(f=0,u=g=(t+e)/2),(m-=2*n)>te?(n*=i,d+=n,c-=n):(m=0,d=c=(t+e)/2),{outerStartAngle:d,outerEndAngle:c,innerStartAngle:u,innerEndAngle:g,innerDeltaAngle:f,outerDeltaAngle:m}}return{outerStartAngle:d,outerEndAngle:c,innerStartAngle:u,innerEndAngle:g,innerDeltaAngle:f,outerDeltaAngle:m}}doUpdateAABBBounds(t){const e=_n(this).arc;this._AABBBounds.clear();const i=this.attribute,o=Oo.graphicService.updateArcAABBBounds(i,_n(this).arc,this._AABBBounds,t,this),{boundsPadding:n=e.boundsPadding}=i,r=Qn(n);return r&&o.expand(r),this.clearUpdateBoundTag(),o}tryUpdateOBBBounds(){throw new Error("暂不支持")}needUpdateTags(t){return super.needUpdateTags(t,Ea)}needUpdateTag(t){return super.needUpdateTag(t,Ea)}getDefaultAttribute(t){return _n(this).arc[t]}toCustomPath(){const t=this.attribute,{startAngle:e,endAngle:i}=this.getParsedAngle();let o=t.innerRadius-(t.innerPadding||0),n=t.outerRadius-(t.outerPadding||0);const r=re(i-e),s=i>e;if(n<o){const t=n;n=o,o=t}const l=new go;if(n<=te)l.moveTo(0,0);else if(r>=ne-te)l.moveTo(0+n*le(e),0+n*de(e)),l.arc(0,0,n,e,i,!s),o>te&&(l.moveTo(0+o*le(i),0+o*de(i)),l.arc(0,0,o,i,e,s));else{const t=n*le(e),r=n*de(e),a=o*le(i),h=o*de(i);l.moveTo(0+t,0+r),l.arc(0,0,n,e,i,!s),l.lineTo(0+a,0+h),l.arc(0,0,o,i,e,s),l.closePath()}return l}clone(){return new La(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return La.NOWORK_ANIMATE_ATTR}}function Ha(t){return new La(t)}La.NOWORK_ANIMATE_ATTR=Object.assign({cap:1},Br);const za=["points","cornerRadius",...wr];class Fa extends Rr{constructor(t){super(t),this.type="polygon",this.numberType=es}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{points:t}=this.attribute;return t&&t.length>=2}doUpdateAABBBounds(){const t=_n(this).polygon;this._AABBBounds.clear();const e=this.attribute,i=Oo.graphicService.updatePolygonAABBBounds(e,_n(this).polygon,this._AABBBounds,this),{boundsPadding:o=t.boundsPadding}=e,n=Qn(o);return n&&i.expand(n),this.clearUpdateBoundTag(),this._AABBBounds}tryUpdateOBBBounds(){throw new Error("暂不支持")}_interpolate(t,e,i,o,n){"points"===t&&(n.points=nr(i,o,e))}getDefaultAttribute(t){return _n(this).polygon[t]}needUpdateTags(t){return super.needUpdateTags(t,za)}needUpdateTag(t){return super.needUpdateTag(t,za)}toCustomPath(){const t=this.attribute.points,e=new go;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 Fa(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return Fa.NOWORK_ANIMATE_ATTR}}function Ia(t){return new Fa(t)}Fa.NOWORK_ANIMATE_ATTR=Br;class Oa{updateBounds(t,e,i,o){const{outerBorder:n,shadowBlur:r=e.shadowBlur}=t;if(n){const t=e.outerBorder,{distance:o=t.distance,lineWidth:s=t.lineWidth}=n;i.expand(o+(r+s)/2)}return i}}class Da extends Oa{updateBounds(t,e,i,o){const{outerBorder:n,shadowBlur:r=e.shadowBlur,strokeBoundsBuffer:s=e.strokeBoundsBuffer}=t;if(n){const t=e.outerBorder,{distance:o=t.distance,lineWidth:l=t.lineWidth}=n;Dr(i,o+(r+l)/2,!0,s)}return i}}class Wa{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 Wa.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(){this.pools=[]}}const Na=new class{constructor(){this.pools=[]}allocate(t,e,i,o,n,r){if(!this.pools.length)return new Se(t,e,i,o,n,r);const s=this.pools.pop();return s.a=t,s.b=e,s.c=i,s.d=o,s.e=n,s.f=r,s}allocateByObj(t){if(!this.pools.length)return new Se(t.a,t.b,t.c,t.d,t.e,t.f);const e=this.pools.pop();return e.a=t.a,e.b=t.b,e.c=t.c,e.d=t.d,e.e=t.e,e.f=t.f,e}free(t){this.pools.push(t)}get length(){return this.pools.length}release(){this.pools=[]}},Ga=new Wa;var ja=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s},Va=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Ua=function(t,e){return function(i,o){e(i,o,t)}};function $a(t,e,i){const o=i[0],n=i[1],r=i[2];let s,l,a,h,d,c,u,g,p,f,m,b;return e===t?(t[12]=e[0]*o+e[4]*n+e[8]*r+e[12],t[13]=e[1]*o+e[5]*n+e[9]*r+e[13],t[14]=e[2]*o+e[6]*n+e[10]*r+e[14],t[15]=e[3]*o+e[7]*n+e[11]*r+e[15]):(s=e[0],l=e[1],a=e[2],h=e[3],d=e[4],c=e[5],u=e[6],g=e[7],p=e[8],f=e[9],m=e[10],b=e[11],t[0]=s,t[1]=l,t[2]=a,t[3]=h,t[4]=d,t[5]=c,t[6]=u,t[7]=g,t[8]=p,t[9]=f,t[10]=m,t[11]=b,t[12]=s*o+d*n+p*r+e[12],t[13]=l*o+c*n+f*r+e[13],t[14]=a*o+u*n+m*r+e[14],t[15]=h*o+g*n+b*r+e[15]),t}function Xa(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 Ya(t,e,i){const o=e[0],n=e[1],r=e[2],s=e[3],l=e[4],a=e[5],h=e[6],d=e[7],c=e[8],u=e[9],g=e[10],p=e[11],f=e[12],m=e[13],b=e[14],v=e[15];let y=i[0],C=i[1],w=i[2],x=i[3];return t[0]=y*o+C*l+w*c+x*f,t[1]=y*n+C*a+w*u+x*m,t[2]=y*r+C*h+w*g+x*b,t[3]=y*s+C*d+w*p+x*v,y=i[4],C=i[5],w=i[6],x=i[7],t[4]=y*o+C*l+w*c+x*f,t[5]=y*n+C*a+w*u+x*m,t[6]=y*r+C*h+w*g+x*b,t[7]=y*s+C*d+w*p+x*v,y=i[8],C=i[9],w=i[10],x=i[11],t[8]=y*o+C*l+w*c+x*f,t[9]=y*n+C*a+w*u+x*m,t[10]=y*r+C*h+w*g+x*b,t[11]=y*s+C*d+w*p+x*v,y=i[12],C=i[13],w=i[14],x=i[15],t[12]=y*o+C*l+w*c+x*f,t[13]=y*n+C*a+w*u+x*m,t[14]=y*r+C*h+w*g+x*b,t[15]=y*s+C*d+w*p+x*v,t}function Ka(t,e,i){var o;const{x:n=i.x,y:r=i.y,z:s=i.z,dx:l=i.dx,dy:a=i.dy,dz:h=i.dz,scaleX:d=i.scaleX,scaleY:c=i.scaleY,scaleZ:u=i.scaleZ,alpha:g=i.alpha,beta:p=i.beta,angle:f=i.angle,anchor3d:m=e.attribute.anchor,anchor:b}=e.attribute,v=[0,0,0];if(m){if("string"==typeof m[0]){const t=parseFloat(m[0])/100,i=e.AABBBounds;v[0]=i.x1+(i.x2-i.x1)*t}else v[0]=m[0];if("string"==typeof m[1]){const t=parseFloat(m[1])/100,i=e.AABBBounds;v[1]=i.x1+(i.x2-i.x1)*t}else v[1]=m[1];v[2]=null!==(o=m[2])&&void 0!==o?o: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),$a(t,t,[n+l,r+a,s+h]),$a(t,t,[v[0],v[1],v[2]]),function(t,e,i){const o=Math.sin(i),n=Math.cos(i),r=e[4],s=e[5],l=e[6],a=e[7],h=e[8],d=e[9],c=e[10],u=e[11];e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=r*n+h*o,t[5]=s*n+d*o,t[6]=l*n+c*o,t[7]=a*n+u*o,t[8]=h*n-r*o,t[9]=d*n-s*o,t[10]=c*n-l*o,t[11]=u*n-a*o}(t,t,p),function(t,e,i){const o=Math.sin(i),n=Math.cos(i),r=e[0],s=e[1],l=e[2],a=e[3],h=e[8],d=e[9],c=e[10],u=e[11];e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=r*n-h*o,t[1]=s*n-d*o,t[2]=l*n-c*o,t[3]=a*n-u*o,t[8]=r*o+h*n,t[9]=s*o+d*n,t[10]=l*o+c*n,t[11]=a*o+u*n}(t,t,g),$a(t,t,[-v[0],-v[1],v[2]]),function(t,e,i){const o=i[0],n=i[1],r=i[2];t[0]=e[0]*o,t[1]=e[1]*o,t[2]=e[2]*o,t[3]=e[3]*o,t[4]=e[4]*n,t[5]=e[5]*n,t[6]=e[6]*n,t[7]=e[7]*n,t[8]=e[8]*r,t[9]=e[9]*r,t[10]=e[10]*r,t[11]=e[11]*r,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]}(t,t,[d,c,u]),f){const i=Ga.allocate(),o=[0,0];if(b){if("string"==typeof m[0]){const t=parseFloat(m[0])/100,i=e.AABBBounds;o[0]=i.x1+(i.x2-i.x1)*t}else o[0]=m[0];if("string"==typeof m[1]){const t=parseFloat(m[1])/100,i=e.AABBBounds;o[1]=i.x1+(i.x2-i.x1)*t}else o[1]=m[1]}$a(i,i,[o[0],o[1],0]),function(t,e,i){const o=Math.sin(i),n=Math.cos(i),r=e[0],s=e[1],l=e[2],a=e[3],h=e[4],d=e[5],c=e[6],u=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]=r*n+h*o,t[1]=s*n+d*o,t[2]=l*n+c*o,t[3]=a*n+u*o,t[4]=h*n-r*o,t[5]=d*n-s*o,t[6]=c*n-l*o,t[7]=u*n-a*o}(i,i,f),$a(i,i,[-o[0],-o[1],0]),Ya(t,t,i)}}let qa=class{constructor(t){this.creator=t,this.hooks={onAttributeUpdate:new D(["graphic"]),onSetStage:new D(["graphic","stage"]),onRemove:new D(["graphic"]),onRelease:new D(["graphic"]),onAddIncremental:new D(["graphic","group","stage"]),onClearIncremental:new D(["graphic","group","stage"]),beforeUpdateAABBBounds:new D(["graphic","stage","willUpdate","aabbBounds"]),afterUpdateAABBBounds:new D(["graphic","stage","aabbBounds","globalAABBBounds","selfChange"])},this.tempAABBBounds1=new Ce,this.tempAABBBounds2=new Ce,this._rectBoundsContribitions=[new Oa],this._symbolBoundsContribitions=[new Da],this._imageBoundsContribitions=[new Oa],this._circleBoundsContribitions=[new Oa],this._arcBoundsContribitions=[new Oa],this._pathBoundsContribitions=[new Oa]}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,o){this.hooks.beforeUpdateAABBBounds.taps.length&&this.hooks.beforeUpdateAABBBounds.call(t,e,i,o)}afterUpdateAABBBounds(t,e,i,o,n){this.hooks.afterUpdateAABBBounds.taps.length&&this.hooks.afterUpdateAABBBounds.call(t,e,i,o,n)}updatePathProxyAABBBounds(t,e){const i="function"==typeof e.pathProxy?e.pathProxy(e.attribute):e.pathProxy;if(!i)return!1;const o=new ni(t);return zi(i.commandList,o,0,0),!0}updateRectAABBBounds(t,e,i,o){if(!this._validCheck(t,e,i,o))return i;if(!this.updatePathProxyAABBBounds(i,o)){let{width:e,height:o}=t;const{x1:n,y1:r,x:s,y:l}=t;e=null!=e?e:n-s,o=null!=o?o:r-l,i.set(0,0,e||0,o||0)}const n=this.tempAABBBounds1,r=this.tempAABBBounds2;return n.setValue(i.x1,i.y1,i.x2,i.y2),r.setValue(i.x1,i.y1,i.x2,i.y2),this._rectBoundsContribitions.length&&this._rectBoundsContribitions.forEach((s=>{s.updateBounds(t,e,n,o),i.union(n),n.setValue(r.x1,r.y1,r.x2,r.y2)})),this.transformAABBBounds(t,i,e,!1,o),i}updateGroupAABBBounds(t,e,i,o){const n=i;i=i.clone();const{width:r,height:s,path:l,clip:a=e.clip}=t;l&&l.length?l.forEach((t=>{i.union(t.AABBBounds)})):null!=r&&null!=s&&i.set(0,0,Math.max(0,r),Math.max(0,s)),a||o.forEachChildren((t=>{i.union(t.AABBBounds)}));const h=this.tempAABBBounds1,d=this.tempAABBBounds2;return h.setValue(i.x1,i.y1,i.x2,i.y2),d.setValue(i.x1,i.y1,i.x2,i.y2),this.transformAABBBounds(t,i,e,!1,o),n.copy(i),n}updateGlyphAABBBounds(t,e,i,o){return this._validCheck(t,e,i,o)?(o.getSubGraphic().forEach((t=>{i.union(t.AABBBounds)})),i):i}updateHTMLTextAABBBounds(t,e,i,o){const{textAlign:n,textBaseline:r}=t;if(null!=t.forceBoundsHeight){const e=at(t.forceBoundsHeight)?t.forceBoundsHeight:t.forceBoundsHeight(),o=Qs(r,e,e);i.set(i.x1,o,i.x2,o+e)}if(null!=t.forceBoundsWidth){const e=at(t.forceBoundsWidth)?t.forceBoundsWidth:t.forceBoundsWidth(),o=Js(n,e);i.set(o,i.y1,o+e,i.y2)}}updateRichTextAABBBounds(t,e,i,o){if(!this._validCheck(t,e,i,o))return i;if(!o)return i;const{width:n=e.width,height:r=e.height,maxWidth:s=e.maxWidth,maxHeight:l=e.maxHeight,textAlign:a=e.textAlign,textBaseline:h=e.textBaseline}=t;if(n>0&&r>0)i.set(0,0,n,r);else{const t=o.getFrameCache(),{width:e,height:a}=t.getActualSize();let h=n||e||0,d=r||a||0;d="number"==typeof l&&d>l?l:d||0,h="number"==typeof s&&h>s?s:h||0,i.set(0,0,h,d)}let d=0;switch(h){case"top":d=0;break;case"middle":d=-i.height()/2;break;case"bottom":d=-i.height()}let c=0;switch(a){case"left":c=0;break;case"center":c=-i.width()/2;break;case"right":c=-i.width()}i.translate(c,d);const u=this.tempAABBBounds1,g=this.tempAABBBounds2;return u.setValue(i.x1,i.y1,i.x2,i.y2),g.setValue(i.x1,i.y1,i.x2,i.y2),null==t.forceBoundsHeight&&null==t.forceBoundsWidth||this.updateHTMLTextAABBBounds(t,e,i),this.transformAABBBounds(t,i,e,!1,o),i}updateTextAABBBounds(t,e,i,o){if(!this._validCheck(t,e,i,o))return i;if(!o)return i;const{text:n=e.text}=o.attribute;Array.isArray(n)?o.updateMultilineAABBBounds(n):o.updateSingallineAABBBounds(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{scaleX:l=e.scaleX,scaleY:a=e.scaleY,shadowBlur:h=e.shadowBlur,strokeBoundsBuffer:d=e.strokeBoundsBuffer}=t;if(h){Dr(r,h/Math.abs(l+a),!0,d),i.union(r)}return this.combindShadowAABBBounds(i,o),null==t.forceBoundsHeight&&null==t.forceBoundsWidth||this.updateHTMLTextAABBBounds(t,e,i),ve(i,i,o.transMatrix),i}updatePathAABBBounds(t,e,i,o){if(!this._validCheck(t,e,i,o))return i;this.updatePathProxyAABBBounds(i,o)||this.updatePathAABBBoundsImprecise(t,e,i,o);const n=this.tempAABBBounds1,r=this.tempAABBBounds2;n.setValue(i.x1,i.y1,i.x2,i.y2),r.setValue(i.x1,i.y1,i.x2,i.y2),this._pathBoundsContribitions.length&&this._pathBoundsContribitions.forEach((s=>{s.updateBounds(t,e,n,o),i.union(n),n.setValue(r.x1,r.y1,r.x2,r.y2)}));const{lineJoin:s=e.lineJoin}=t;return this.transformAABBBounds(t,i,e,"miter"===s,o),i}updatePathAABBBoundsImprecise(t,e,i,o){if(!o)return i;const n=o.getParsedPathShape();return i.union(n.getBounds()),i}updatePyramid3dAABBBounds(t,e,i,o){if(!o)return i;const n=o.stage;if(!n||!n.camera)return i;o.findFace().vertices.forEach((t=>{const e=t[0],o=t[1];i.add(e,o)}));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,o),i}updateArc3dAABBBounds(t,e,i,o){if(!o)return i;const n=o.stage;if(!n||!n.camera)return i;const{outerRadius:r=e.outerRadius,height:s=0}=t,l=r+s;i.setValue(-l,-l,l,l);const a=this.tempAABBBounds1,h=this.tempAABBBounds2;return a.setValue(i.x1,i.y1,i.x2,i.y2),h.setValue(i.x1,i.y1,i.x2,i.y2),this.transformAABBBounds(t,i,e,!1,o),i}updatePolygonAABBBounds(t,e,i,o){if(!this._validCheck(t,e,i,o))return i;this.updatePathProxyAABBBounds(i,o)||this.updatePolygonAABBBoundsImprecise(t,e,i,o);const n=this.tempAABBBounds1,r=this.tempAABBBounds2;n.setValue(i.x1,i.y1,i.x2,i.y2),r.setValue(i.x1,i.y1,i.x2,i.y2);const{lineJoin:s=e.lineJoin}=t;return this.transformAABBBounds(t,i,e,"miter"===s,o),i}updatePolygonAABBBoundsImprecise(t,e,i,o){const{points:n=e.points}=t;return n.forEach((t=>{i.add(t.x,t.y)})),i}updateLineAABBBounds(t,e,i,o){if(!this._validCheck(t,e,i,o))return i;this.updatePathProxyAABBBounds(i,o)||(t.segments?this.updateLineAABBBoundsBySegments(t,e,i,o):this.updateLineAABBBoundsByPoints(t,e,i,o));const n=this.tempAABBBounds1,r=this.tempAABBBounds2;n.setValue(i.x1,i.y1,i.x2,i.y2),r.setValue(i.x1,i.y1,i.x2,i.y2);const{lineJoin:s=e.lineJoin}=t;return this.transformAABBBounds(t,i,e,"miter"===s,o),i}updateLineAABBBoundsByPoints(t,e,i,o){const{points:n=e.points}=t,r=i;return n.forEach((t=>{r.add(t.x,t.y)})),r}updateLineAABBBoundsBySegments(t,e,i,o){const{segments:n=e.segments}=t,r=i;return n.forEach((t=>{t.points.forEach((t=>{r.add(t.x,t.y)}))})),r}updateAreaAABBBounds(t,e,i,o){if(!this._validCheck(t,e,i,o))return i;this.updatePathProxyAABBBounds(i,o)||(t.segments?this.updateAreaAABBBoundsBySegments(t,e,i,o):this.updateAreaAABBBoundsByPoints(t,e,i,o));const n=this.tempAABBBounds1,r=this.tempAABBBounds2;n.setValue(i.x1,i.y1,i.x2,i.y2),r.setValue(i.x1,i.y1,i.x2,i.y2);const{lineJoin:s=e.lineJoin}=t;return this.transformAABBBounds(t,i,e,"miter"===s,o),i}updateAreaAABBBoundsByPoints(t,e,i,o){const{points:n=e.points}=t,r=i;return n.forEach((t=>{var e,i;r.add(t.x,t.y),r.add(null!==(e=t.x1)&&void 0!==e?e:t.x,null!==(i=t.y1)&&void 0!==i?i:t.y)})),r}updateAreaAABBBoundsBySegments(t,e,i,o){const{segments:n=e.segments}=t,r=i;return n.forEach((t=>{t.points.forEach((t=>{var e,i;r.add(t.x,t.y),r.add(null!==(e=t.x1)&&void 0!==e?e:t.x,null!==(i=t.y1)&&void 0!==i?i:t.y)}))})),r}updateCircleAABBBounds(t,e,i,o,n){if(!this._validCheck(t,e,i,n))return i;this.updatePathProxyAABBBounds(i,n)||(o?this.updateCircleAABBBoundsImprecise(t,e,i,n):this.updateCircleAABBBoundsAccurate(t,e,i,n));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._circleBoundsContribitions.length&&this._circleBoundsContribitions.forEach((o=>{o.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}updateCircleAABBBoundsImprecise(t,e,i,o){const{radius:n=e.radius}=t;return i.set(-n,-n,n,n),i}updateCircleAABBBoundsAccurate(t,e,i,o){const{startAngle:n=e.startAngle,endAngle:r=e.endAngle,radius:s=e.radius}=t;return r-n>ne-te?i.set(-s,-s,s,s):ir(n,r,s,i),i}updateArcAABBBounds(t,e,i,o,n){if(!this._validCheck(t,e,i,n))return i;this.updatePathProxyAABBBounds(i,n)||(o?this.updateArcAABBBoundsImprecise(t,e,i,n):this.updateArcAABBBoundsAccurate(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._arcBoundsContribitions.length&&this._arcBoundsContribitions.forEach((o=>{o.updateBounds(t,e,r,n),i.union(r),r.setValue(s.x1,s.y1,s.x2,s.y2)}));const{lineJoin:l=e.lineJoin}=t;return this.transformAABBBounds(t,i,e,"miter"===l,n),i}updateArcAABBBoundsImprecise(t,e,i,o){let{outerRadius:n=e.outerRadius,innerRadius:r=e.innerRadius}=t;const{outerPadding:s=e.outerPadding,innerPadding:l=e.innerPadding}=t;return n+=s,r-=l,n<r&&(n=r),i.set(-n,-n,n,n),i}updateArcAABBBoundsAccurate(t,e,i,o){let{outerRadius:n=e.outerRadius,innerRadius:r=e.innerRadius}=t;const{outerPadding:s=e.outerPadding,innerPadding:l=e.innerPadding}=t;if(n+=s,r-=l,n<r){const t=n;n=r,r=t}let{endAngle:a=e.endAngle,startAngle:h=e.startAngle}=t;if(h>a){const t=h;h=a,a=t}return n<=te?i.set(0,0,0,0):Math.abs(a-h)>ne-te?i.set(-n,-n,n,n):(ir(h,a,n,i),ir(h,a,r,i)),i}updateSymbolAABBBounds(t,e,i,o,n){if(!this._validCheck(t,e,i,n))return i;this.updatePathProxyAABBBounds(i,n)||(o?this.updateSymbolAABBBoundsImprecise(t,e,i,n):this.updateSymbolAABBBoundsAccurate(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._symbolBoundsContribitions.length&&this._symbolBoundsContribitions.forEach((o=>{o.updateBounds(t,e,r,n),i.union(r),r.setValue(s.x1,s.y1,s.x2,s.y2)}));const{lineJoin:l=e.lineJoin}=t;return this.transformAABBBounds(t,i,e,"miter"===l,n),i}updateSymbolAABBBoundsImprecise(t,e,i,o){const{size:n=e.size}=t;if(rt(n))i.set(-n[0]/2,-n[1]/2,n[0]/2,n[1]/2);else{const t=n/2;i.set(-t,-t,t,t)}return i}updateSymbolAABBBoundsAccurate(t,e,i,o){if(!o)return i;const{size:n=e.size}=t;return o.getParsedPath().bounds(n,i),i}updateImageAABBBounds(t,e,i,o){if(!this._validCheck(t,e,i,o))return i;if(!this.updatePathProxyAABBBounds(i,o)){const{width:o=e.width,height:n=e.height}=t;i.set(0,0,o,n)}const n=this.tempAABBBounds1,r=this.tempAABBBounds2;return n.setValue(i.x1,i.y1,i.x2,i.y2),r.setValue(i.x1,i.y1,i.x2,i.y2),this._imageBoundsContribitions.length&&this._imageBoundsContribitions.forEach((s=>{s.updateBounds(t,e,n,o),i.union(n),n.setValue(r.x1,r.y1,r.x2,r.y2)})),this.transformAABBBounds(t,i,e,!1,o),i}combindShadowAABBBounds(t,e){if(e&&e.shadowRoot){const i=e.shadowRoot.AABBBounds;t.union(i)}}transformAABBBounds(t,e,i,o,n){if(!e.empty()){const{scaleX:n=i.scaleX,scaleY:r=i.scaleY,stroke:s=i.stroke,shadowBlur:l=i.shadowBlur,lineWidth:a=i.lineWidth,pickStrokeBuffer:h=i.pickStrokeBuffer,strokeBoundsBuffer:d=i.strokeBoundsBuffer}=t,c=this.tempAABBBounds1,u=this.tempAABBBounds2;if(s&&a){Dr(c,(a+h)/Math.abs(n+r),o,d),e.union(c),c.setValue(u.x1,u.y1,u.x2,u.y2)}if(l){const{shadowOffsetX:o=i.shadowOffsetX,shadowOffsetY:s=i.shadowOffsetY}=t;Dr(c,l/Math.abs(n+r)*2,!1,d+1),c.translate(o,s),e.union(c)}}if(this.combindShadowAABBBounds(e,n),e.empty())return;let r=!0;const s=n.transMatrix;n&&n.isContainer&&(r=!(1===s.a&&0===s.b&&0===s.c&&1===s.d&&0===s.e&&0===s.f)),r&&ve(e,e,s)}_validCheck(t,e,i,o){if(!o)return!0;if(null!=t.forceBoundsHeight||null!=t.forceBoundsWidth)return!0;if(!o.valid)return i.clear(),!1;const{visible:n=e.visible}=t;return!!n||(i.clear(),!1)}};qa=ja([y(),Ua(0,b(ls)),Va("design:paramtypes",[Object])],qa);const Za=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 Ja;function Qa(t){return Ja||(Ja=Za.CreateGraphic("text",{})),Ja.initAttributes(t),Ja.AABBBounds}const th={x:0,y:0,z:0,lastModelMatrix:null};class eh{init(t){t&&(this._renderContribitions=t.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((t=>t.time===Pi.beforeFillStroke)),this._afterRenderContribitions=this._renderContribitions.filter((t=>t.time===Pi.afterFillStroke)))}beforeRenderStep(t,e,i,o,n,r,s,l,a,h,d,c,u){this._beforeRenderContribitions&&this._beforeRenderContribitions.forEach((g=>{g.supportedAppName&&t.stage&&t.stage.params&&t.stage.params.context&&t.stage.params.context.appName&&!(Array.isArray(g.supportedAppName)?g.supportedAppName:[g.supportedAppName]).includes(t.stage.params.context.appName)||g.drawShape(t,e,i,o,n,r,s,l,a,h,d,c,u)}))}afterRenderStep(t,e,i,o,n,r,s,l,a,h,d,c,u){this._afterRenderContribitions&&this._afterRenderContribitions.forEach((g=>{g.supportedAppName&&t.stage&&t.stage.params&&t.stage.params.context&&t.stage.params.context.appName&&!(Array.isArray(g.supportedAppName)?g.supportedAppName:[g.supportedAppName]).includes(t.stage.params.context.appName)||g.drawShape(t,e,i,o,n,r,s,l,a,h,d,c,u)}))}valid(t,e,i,o){const{fill:n=e.fill,background:r,stroke:s=e.stroke,opacity:l=e.opacity,fillOpacity:a=e.fillOpacity,lineWidth:h=e.lineWidth,strokeOpacity:d=e.strokeOpacity,visible:c=e.visible}=t.attribute,u=Rs(l,a,n),g=Ts(l,d),p=As(n,r),f=Bs(s,h);return!(!t.valid||!c)&&!(!p&&!f)&&!!(u||g||i||o||r)&&{fVisible:u,sVisible:g,doFill:p,doStroke:f}}transform(t,e,i){let o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const{x:n=e.x,y:r=e.y,z:s=e.z,scaleX:l=e.scaleX,scaleY:a=e.scaleY,angle:h=e.angle,postMatrix:d}=t.attribute,c=i.modelMatrix,u=i.camera;th.x=n,th.y=r,th.z=s,th.lastModelMatrix=c;const g=u&&(o||function(t){const{alpha:e,beta:i}=t.attribute;return e||i}(t)),p=g?t.transMatrix.onlyTranslate()&&!d:1===l&&1===a&&0===h&&!d;if(g){const o=Ga.allocate(),n=Ga.allocate();Ka(n,t,e),Ya(o,c||o,n),th.x=0,th.y=0,th.z=0,i.modelMatrix=o,i.setTransform(1,0,0,1,0,0,!0),Ga.free(n)}if(p&&!c){const o=t.getOffsetXY(e);th.x+=o.x,th.y+=o.y,th.z=s,i.setTransformForCurrent()}else if(g)th.x=0,th.y=0,th.z=0,i.setTransform(1,0,0,1,0,0,!0);else if(u&&i.project){const o=t.getOffsetXY(e);th.x+=o.x,th.y+=o.y,this.transformWithoutTranslate(i,th.x,th.y,th.z,l,a,h)}else i.transformFromMatrix(t.transMatrix,!0),th.x=0,th.y=0,th.z=0;return th}transformUseContext2d(t,e,i,o){const n=o.camera;if(this.camera=n,n){const e=t.AABBBounds,n=e.x2-e.x1,r=e.y2-e.y1,s=o.project(0,0,i),l=o.project(n,0,i),a=o.project(n,r,i),h={x:0,y:0},d={x:n,y:0},c={x:n,y:r};o.camera=null;const u=1/(h.x*(c.y-d.y)-d.x*c.y+c.x*d.y+(d.x-c.x)*h.y),g=-(h.y*(a.x-l.x)-d.y*a.x+c.y*l.x+(d.y-c.y)*s.x)*u,p=(d.y*a.y+h.y*(l.y-a.y)-c.y*l.y+(c.y-d.y)*s.y)*u,f=(h.x*(a.x-l.x)-d.x*a.x+c.x*l.x+(d.x-c.x)*s.x)*u,m=-(d.x*a.y+h.x*(l.y-a.y)-c.x*l.y+(c.x-d.x)*s.y)*u,b=(h.x*(c.y*l.x-d.y*a.x)+h.y*(d.x*a.x-c.x*l.x)+(c.x*d.y-d.x*c.y)*s.x)*u,v=(h.x*(c.y*l.y-d.y*a.y)+h.y*(d.x*a.y-c.x*l.y)+(c.x*d.y-d.x*c.y)*s.y)*u;o.setTransform(g,p,f,m,b,v,!0)}}restoreTransformUseContext2d(t,e,i,o){this.camera&&(o.camera=this.camera)}transformWithoutTranslate(t,e,i,o,n,r,s){const l=t.project(e,i,o);t.translate(l.x,l.y,!1),t.scale(n,r,!1),t.rotate(s,!1),t.translate(-l.x,-l.y,!1),t.setTransformForCurrent()}_draw(t,e,i,o,n){const{context:r}=o;if(!r)return;const{renderable:s}=t.attribute;if(!1===s)return;r.highPerformanceSave();const l=this.transform(t,e,r,i),{x:a,y:h,z:d,lastModelMatrix:c}=l;this.z=d,function(t,e,i,o,n,r,s,l){if(!t.pathProxy)return!1;const a=_n(t,null==r?void 0:r.theme)[t.type.replace("3d","")],{fill:h=a.fill,stroke:d=a.stroke,opacity:c=a.opacity,fillOpacity:u=a.fillOpacity,lineWidth:g=a.lineWidth,strokeOpacity:p=a.strokeOpacity,visible:f=a.visible,x:m=a.x,y:b=a.y}=t.attribute,v=Rs(c,u,h),y=Ts(c,p),C=As(h),w=Bs(d,g);return!f||(!C&&!w||(!(v||y||s||l)||(e.beginPath(),zi(("function"==typeof t.pathProxy?t.pathProxy(t.attribute):t.pathProxy).commandList,e,i,o),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,a),w&&(l?l(e,t.attribute,a):y&&(e.setStrokeStyle(t,t.attribute,i-m,o-b,a),e.stroke())),C&&(s?s(e,t.attribute,a):v&&(e.setCommonStyle(t,t.attribute,i-m,o-b,a),e.fill())),!0)))}(t,r,a,h,0,n)||(this.drawShape(t,r,a,h,o,n),this.z=0,r.modelMatrix!==c&&Ga.free(r.modelMatrix),r.modelMatrix=c),r.highPerformanceRestore()}}const ih=function(){const t={linearGradient:/^(linear\-gradient)/i,radialGradient:/^(radial\-gradient)/i,conicGradient:/^(conic\-gradient)/i,sideOrCorner:/^to (left (top|bottom)|right (top|bottom)|top (left|right)|bottom (left|right)|left|right|top|bottom)/i,extentKeywords:/^(closest\-side|closest\-corner|farthest\-side|farthest\-corner|contain|cover)/,positionKeywords:/^(left|center|right|top|bottom)/i,pixelValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))px/,percentageValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))\%/,emValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))em/,angleValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))deg/,fromAngleValue:/^from\s*(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))deg/,startCall:/^\(/,endCall:/^\)/,comma:/^,/,hexColor:/(^\#[0-9a-fA-F]+)/,literalColor:/^([a-zA-Z]+)/,rgbColor:/^(rgb\(\d{1,3},\s*\d{1,3},\s*\d{1,3}\))/i,rgbaColor:/^(rgba\(\d{1,3},\s*\d{1,3},\s*\d{1,3},\s*((\d\.\d+)|\d{1,3})\))/i,number:/^(([0-9]*\.[0-9]+)|([0-9]+\.?))/};let e="";function i(t){const i=new Error(e+": "+t);throw i.source=e,i}function o(){return n("linear",t.linearGradient,r)||n("radial",t.radialGradient,l)||n("conic",t.conicGradient,s)}function n(e,o,n){return function(o,r){const s=b(o);if(s){b(t.startCall)||i("Missing (");const o=function(o){const r=n();return r&&(b(t.comma)||i("Missing comma before color stops")),{type:e,orientation:r,colorStops:u(g)}}();return b(t.endCall)||i("Missing )"),o}}(o)}function r(){return m("directional",t.sideOrCorner,1)||m("angular",t.angleValue,1)}function s(){return m("angular",t.fromAngleValue,1)}function l(){let i,o,n=a();return n&&(i=[],i.push(n),o=e,b(t.comma)&&(n=a(),n?i.push(n):e=o)),i}function a(){let t=function(){const t=m("shape",/^(circle)/i,0);return t&&(t.style=f()||h()),t}()||function(){const t=m("shape",/^(ellipse)/i,0);return t&&(t.style=p()||h()),t}();if(t)t.at=d();else{const e=h();if(e){t=e;const i=d();i&&(t.at=i)}else{const e=c();e&&(t={type:"default-radial",at:e})}}return t}function h(){return m("extent-keyword",t.extentKeywords,1)}function d(){if(m("position",/^at/,0)){const t=c();return t||i("Missing positioning value"),t}}function c(){const t={x:p(),y:p()};if(t.x||t.y)return{type:"position",value:t}}function u(e){let o=e();const n=[];if(o)for(n.push(o);b(t.comma);)o=e(),o?n.push(o):i("One extra comma");return n}function g(){const e=m("hex",t.hexColor,1)||m("rgba",t.rgbaColor,1)||m("rgb",t.rgbColor,1)||m("literal",t.literalColor,0);return e||i("Expected color definition"),e.length=p(),e}function p(){return m("%",t.percentageValue,1)||m("position-keyword",t.positionKeywords,1)||f()}function f(){return m("px",t.pixelValue,1)||m("em",t.emValue,1)}function m(t,e,i){const o=b(e);if(o)return{type:t,value:o[i]}}function b(t){const i=/^[\n\r\t\s]+/.exec(e);i&&v(i[0].length);const o=t.exec(e);return o&&v(o[0].length),o}function v(t){e=e.substr(t)}return function(t){return e=t.toString(),function(){const t=u(o);return e.length>0&&i("Invalid input not EOF"),t}()}}();class oh{static IsGradient(t){return!("string"==typeof t&&!t.includes("gradient"))}static IsGradientStr(t){return"string"==typeof t&&t.includes("gradient")}static Parse(t){if(oh.IsGradientStr(t))try{const e=ih(t)[0];if(e){if("linear"===e.type)return oh.ParseLinear(e);if("radial"===e.type)return oh.ParseRadial(e);if("conic"===e.type)return oh.ParseConic(e)}}catch(e){return t}return t}static ParseConic(t){const{orientation:e,colorStops:i=[]}=t,o=ee/2,n=parseFloat(e.value)/180*ee-o;return{gradient:"conical",x:.5,y:.5,startAngle:n,endAngle:n+ne,stops:i.map((t=>({color:t.value,offset:parseFloat(t.length.value)/100})))}}static ParseRadial(t){const{colorStops:e=[]}=t;return{gradient:"radial",x0:.5,y0:.5,x1:.5,y1:.5,r0:0,r1:1,stops:e.map((t=>({color:t.value,offset:parseFloat(t.length.value)/100})))}}static ParseLinear(t){const{orientation:e,colorStops:i=[]}=t,o=ee/2;let n="angular"===e.type?parseFloat(e.value)/180*ee:0;for(;n<0;)n+=ne;for(;n>ne;)n-=ne;let r=0,s=0,l=0,a=0;return n<o?(r=0,s=1,l=Math.sin(n),a=Math.cos(n)):n<ee?(r=0,s=0,l=Math.cos(n-o),a=Math.sin(n-o)):n<ee+o?(r=1,s=0,l=r-Math.sin(n-ee),a=Math.cos(n-ee)):(r=1,l=r-Math.cos(n-o-ee),a-=Math.sin(n-o-ee)),{gradient:"linear",x0:r,y0:s,x1:l,y1:a,stops:i.map((t=>({color:t.value,offset:parseFloat(t.length.value)/100})))}}}function nh(t,e,i){let o=e;const{a:n,b:r,c:s,d:l}=t.currentMatrix,a=Math.sign(n)*Math.sqrt(n*n+r*r),h=Math.sign(l)*Math.sqrt(s*s+l*l);return a+h===0?0:(o=o/Math.abs(a+h)*2*i,o)}function rh(t,e,i,o,n){if(!e||!0===e)return"black";let r,s;if(rt(e))for(let t=0;t<e.length&&(s=e[t],!s);t++);else s=e;return s=oh.Parse(s),"string"==typeof s?s:("linear"===s.gradient?r=function(t,e,i){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;var r,s,l,a;const h=i.AABBBounds;if(!h)return;let d=h.x2-h.x1,c=h.y2-h.y1,u=h.x1-o,g=h.y1-n;if(i.attribute){const{scaleX:t=1,scaleY:e=1}=i.attribute;if(t*e==0)return;d/=t,c/=e,u/=t,g/=e}const p=t.createLinearGradient(u+(null!==(r=e.x0)&&void 0!==r?r:0)*d,g+(null!==(s=e.y0)&&void 0!==s?s:0)*c,u+(null!==(l=e.x1)&&void 0!==l?l:1)*d,g+(null!==(a=e.y1)&&void 0!==a?a:0)*c);return e.stops.forEach((t=>{p.addColorStop(t.offset,t.color)})),p}(t,s,i,o,n):"conical"===s.gradient?r=function(t,e,i){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;var r,s;const l=i.AABBBounds;if(!l)return;let a=l.x2-l.x1,h=l.y2-l.y1,d=l.x1-o,c=l.y1-n;if(i.attribute){const{scaleX:t=1,scaleY:e=1}=i.attribute;if(t*e==0)return;a/=t,h/=e,d/=t,c/=e}const u=t.createConicGradient(d+(null!==(r=e.x)&&void 0!==r?r:0)*a,c+(null!==(s=e.y)&&void 0!==s?s:0)*h,e.startAngle,e.endAngle);return e.stops.forEach((t=>{u.addColorStop(t.offset,t.color)})),u.GetPattern(a+d,h+c,void 0)}(t,s,i,o,n):"radial"===s.gradient&&(r=function(t,e,i){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;var r,s,l,a,h,d;const c=i.AABBBounds;if(!c)return;let u=c.x2-c.x1,g=c.y2-c.y1,p=c.x1-o,f=c.y1-n;if(i.attribute){const{scaleX:t=1,scaleY:e=1}=i.attribute;if(t*e==0)return;p/=t,f/=e,u/=t,g/=e}const m=t.createRadialGradient(p+(null!==(r=e.x0)&&void 0!==r?r:.5)*u,f+(null!==(s=e.y0)&&void 0!==s?s:.5)*g,Math.max(u,g)*(null!==(l=e.r0)&&void 0!==l?l:0),p+(null!==(a=e.x1)&&void 0!==a?a:.5)*u,f+(null!==(h=e.y1)&&void 0!==h?h:.5)*g,Math.max(u,g)*(null!==(d=e.r1)&&void 0!==d?d:.5));return e.stops.forEach((t=>{m.addColorStop(t.offset,t.color)})),m}(t,s,i,o,n)),r||"orange")}var sh=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s},lh=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},ah=function(t,e){return function(i,o){e(i,o,t)}};class hh{constructor(){this.time=Pi.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,o,n,r,s,l,a,h,d,c,u){var g;const{background:p,backgroundOpacity:f=(null!==(g=t.attribute.fillOpacity)&&void 0!==g?g:a.backgroundOpacity),opacity:m=a.opacity,backgroundMode:b=a.backgroundMode,backgroundFit:v=a.backgroundFit}=t.attribute;if(p)if(t.backgroundImg&&t.resources){const n=t.resources.get(p);if("success"!==n.state||!n.data)return;if(e.save(),t.parent&&!t.transMatrix.onlyTranslate()){const i=_n(t.parent).group,{scrollX:o=i.scrollX,scrollY:n=i.scrollY}=t.parent.attribute;e.setTransformFromMatrix(t.parent.globalTransMatrix,!0),e.translate(o,n)}e.clip();const r=t.AABBBounds;e.setCommonStyle(t,t.attribute,i,o,a),e.globalAlpha=f*m,this.doDrawImage(e,n.data,r,b,v),e.restore(),t.transMatrix.onlyTranslate()||e.setTransformForCurrent()}else e.highPerformanceSave(),e.setCommonStyle(t,t.attribute,i,o,a),e.globalAlpha=f*m,e.fillStyle=p,e.fill(),e.highPerformanceRestore()}doDrawImage(t,e,i,o,n){if("no-repeat"===o)t.drawImage(e,i.x1,i.y1,i.width(),i.height());else{const r=i.width(),s=i.height();let l=r,a=s;if(n&&"repeat"!==o&&(e.width||e.height)){const i=e.width,n=e.height;"repeat-x"===o?(l=i*(s/n),a=s):"repeat-y"===o&&(a=n*(r/i),l=r);const h=t.dpr,d=nn.allocate({width:l,height:a,dpr:h}),c=d.getContext("2d");c&&(c.inuse=!0,c.clearMatrix(),c.setTransformForCurrent(!0),c.clearRect(0,0,l,a),c.drawImage(e,0,0,l,a),e=d.nativeCanvas),nn.free(d)}const h=t.dpr,d=t.createPattern(e,o);d.setTransform&&d.setTransform(new DOMMatrix([1/h,0,0,1/h,0,0])),t.fillStyle=d,t.translate(i.x1,i.y1),t.fillRect(0,0,r,s),t.translate(-i.x1,-i.y1)}}}const dh=new hh;let ch=class{constructor(t){this.subRenderContribitions=t,this.time=Pi.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,o,n,r,s,l,a,h,d,c,u){this._subRenderContribitions||(this._subRenderContribitions=this.subRenderContribitions.getContributions()),this._subRenderContribitions.forEach((g=>{g.render(t,e,i,o,n,r,s,l,a,h,d,c,u)}))}};ch=sh([y(),ah(0,b(z)),ah(0,C(Xs)),lh("design:paramtypes",[Object])],ch);class uh{constructor(){this.time=Pi.afterFillStroke,this.useStyle=!0,this.order=10}createCommonPattern(t,e,i,o,n){const r=(t-2*e)/2,s=o.dpr,l=nn.allocate({width:t,height:t,dpr:s}),a=l.getContext("2d");if(!a)return null;a.inuse=!0,a.clearMatrix(),a.setTransformForCurrent(!0),a.clearRect(0,0,t,t),n(r,a);const h=o.createPattern(l.nativeCanvas,"repeat");return h.setTransform&&h.setTransform(new DOMMatrix([1/s,0,0,1/s,0,0])),nn.free(l),h}createCirclePattern(t,e,i,o){return this.createCommonPattern(t,e,i,o,((t,e)=>{e.fillStyle=i,e.arc(t,t,t,0,ne),e.fill()}))}createDiamondPattern(t,e,i,o){return this.createCommonPattern(t,e,i,o,((e,o)=>{const n=t/2,r=n;o.fillStyle=i,o.moveTo(n,r-e),o.lineTo(e+n,r),o.lineTo(n,r+e),o.lineTo(n-e,r),o.closePath(),o.fill()}))}createRectPattern(t,e,i,o){return this.createCommonPattern(t,e,i,o,((t,o)=>{const n=e,r=n;o.fillStyle=i,o.fillRect(n,r,2*t,2*t)}))}createVerticalLinePattern(t,e,i,o){return this.createCommonPattern(t,e,i,o,((o,n)=>{const r=e;n.fillStyle=i,n.fillRect(r,0,2*o,t)}))}createHorizontalLinePattern(t,e,i,o){return this.createCommonPattern(t,e,i,o,((o,n)=>{const r=e;n.fillStyle=i,n.fillRect(0,r,t,2*o)}))}createBiasLRLinePattern(t,e,i,o){return this.createCommonPattern(t,e,i,o,((e,o)=>{o.strokeStyle=i,o.lineWidth=e,o.moveTo(0,0),o.lineTo(t,t);const n=t/2,r=-n;o.moveTo(n,r),o.lineTo(n+t,r+t),o.moveTo(-n,-r),o.lineTo(-n+t,-r+t),o.stroke()}))}createBiasRLLinePattern(t,e,i,o){return this.createCommonPattern(t,e,i,o,((e,o)=>{o.strokeStyle=i,o.lineWidth=e,o.moveTo(t,0),o.lineTo(0,t);const n=t/2,r=n;o.moveTo(t+n,r),o.lineTo(n,r+t),o.moveTo(t-n,-r),o.lineTo(-n,-r+t),o.stroke()}))}createGridPattern(t,e,i,o){return this.createCommonPattern(t,e,i,o,((t,o)=>{const n=e,r=n;o.fillStyle=i,o.fillRect(n,r,t,t),o.fillRect(n+t,r+t,t,t)}))}initTextureMap(t,e){this.textureMap=new Map}drawShape(t,e,i,o,n,r,s,l,a,h,d,c,u){this.textureMap||this.initTextureMap(e,t.stage);const{texture:g=a.texture,textureColor:p=a.textureColor,textureSize:f=a.textureSize,texturePadding:m=a.texturePadding}=t.attribute;g&&this.drawTexture(g,t,e,i,o,a,p,f,m)}drawTexture(t,e,i,o,n,r,s,l,a){let h=this.textureMap.get(t);if(!h)switch(t){case"circle":h=this.createCirclePattern(l,a,s,i);break;case"diamond":h=this.createDiamondPattern(l,a,s,i);break;case"rect":h=this.createRectPattern(l,a,s,i);break;case"vertical-line":h=this.createVerticalLinePattern(l,a,s,i);break;case"horizontal-line":h=this.createHorizontalLinePattern(l,a,s,i);break;case"bias-lr":h=this.createBiasLRLinePattern(l,a,s,i);break;case"bias-rl":h=this.createBiasRLLinePattern(l,a,s,i);break;case"grid":h=this.createGridPattern(l,a,s,i)}h&&(i.highPerformanceSave(),i.setCommonStyle(e,e.attribute,o,n,r),i.fillStyle=h,i.fill(),i.highPerformanceRestore())}}const gh=new uh;const ph=new class{constructor(){this.time=Pi.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,o,n,r,s,l,a,h,d,c){const{outerBorder:u,innerBorder:g}=t.attribute,p=u&&!1!==u.visible,f=g&&!1!==g.visible;if(!p&&!f)return;const{innerPadding:m=a.innerPadding,outerPadding:b=a.outerPadding,startAngle:v=a.startAngle,endAngle:y=a.endAngle,opacity:C=a.opacity,x:w=a.x,y:x=a.y,scaleX:_=a.scaleX,scaleY:S=a.scaleY}=t.attribute;let{innerRadius:A=a.innerRadius,outerRadius:B=a.outerRadius}=t.attribute;B+=b,A-=m;const R=!(!u||!u.stroke),M=!(!g||!g.stroke);if(p){const{distance:n=a.outerBorder.distance}=u,r=nh(e,n,e.dpr),s=n/B;if(t.setAttributes({outerRadius:B+r,innerRadius:A-r,startAngle:v-s,endAngle:y+s}),e.beginPath(),Ls(t,e,i,o,B+r,A-r),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,a),c)c(e,u,a.outerBorder);else if(R){const n=a.outerBorder.opacity;a.outerBorder.opacity=C,e.setStrokeStyle(t,u,(w-i)/_,(x-o)/S,a.outerBorder),a.outerBorder.opacity=n,e.stroke()}}if(f){const{distance:n=a.innerBorder.distance}=g,r=nh(e,n,e.dpr),s=n/B;if(t.setAttributes({outerRadius:B-r,innerRadius:A+r,startAngle:v+s,endAngle:y-s}),e.beginPath(),Ls(t,e,i,o,B-r,A+r),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,a),c)c(e,g,a.innerBorder);else if(M){const n=a.innerBorder.opacity;a.innerBorder.opacity=C,e.setStrokeStyle(t,g,(w-i)/_,(x-o)/S,a.innerBorder),a.innerBorder.opacity=n,e.stroke()}}t.setAttributes({outerRadius:B,innerRadius:A,startAngle:v,endAngle:y})}},fh=gh,mh=dh;const bh=new class{constructor(){this.time=Pi.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,o,n,r,s,l,a,h,d,c){const{outerBorder:u,innerBorder:g}=t.attribute,p=u&&!1!==u.visible,f=g&&!1!==g.visible;if(!p&&!f)return;const{radius:m=a.radius,startAngle:b=a.startAngle,endAngle:v=a.endAngle,opacity:y=a.opacity,x:C=a.x,y:w=a.y,scaleX:x=a.scaleX,scaleY:_=a.scaleY}=t.attribute,S=!(!u||!u.stroke),A=!(!g||!g.stroke);if(p){const{distance:n=a.outerBorder.distance}=u,r=nh(e,n,e.dpr);if(e.beginPath(),e.arc(i,o,m+r,b,v),e.closePath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,a),c)c(e,u,a.outerBorder);else if(S){const n=a.outerBorder.opacity;a.outerBorder.opacity=y,e.setStrokeStyle(t,u,(C-i)/x,(w-o)/_,a.outerBorder),a.outerBorder.opacity=n,e.stroke()}}if(f){const{distance:n=a.innerBorder.distance}=g,r=nh(e,n,e.dpr);if(e.beginPath(),e.arc(i,o,m-r,b,v),e.closePath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,a),c)c(e,g,a.innerBorder);else if(A){const n=a.innerBorder.opacity;a.innerBorder.opacity=y,e.setStrokeStyle(t,g,(C-i)/x,(w-o)/_,a.innerBorder),a.innerBorder.opacity=n,e.stroke()}}}},vh=gh,yh=dh;const Ch=new class extends hh{constructor(){super(...arguments),this.time=Pi.beforeFillStroke}drawShape(t,e,i,o,n,r,s,l,a,h,d,c){const{background:u,backgroundMode:g=a.backgroundMode,backgroundFit:p=a.backgroundFit}=t.attribute;if(u)if(t.backgroundImg&&t.resources){const i=t.resources.get(u);if("success"!==i.state||!i.data)return;e.highPerformanceSave(),e.setTransformFromMatrix(t.parent.globalTransMatrix,!0);const o=t.AABBBounds;this.doDrawImage(e,i.data,o,g,p),e.highPerformanceRestore(),e.setTransformForCurrent()}else e.highPerformanceSave(),e.fillStyle=u,e.fill(),e.highPerformanceRestore()}},wh=ee/2;function xh(t,e,i,o,n,r){let s;if(o<0&&(e+=o,o=-o),n<0&&(i+=n,n=-n),at(r,!0))s=[r=re(r),r,r,r];else if(Array.isArray(r)){const t=r;let e,i;switch(t.length){case 0:s=[0,0,0,0];break;case 1:e=re(t[0]),s=[e,e,e,e];break;case 2:case 3:e=re(t[0]),i=re(t[1]),s=[e,i,e,i];break;default:s=t,s[0]=re(s[0]),s[1]=re(s[1]),s[2]=re(s[2]),s[3]=re(s[3])}}else s=[0,0,0,0];if(o<0||s[0]+s[1]+s[2]+s[3]<1e-12)return t.rect(e,i,o,n);const[l,a,h,d]=[[e,i],[e+o,i],[e+o,i+n],[e,i+n]],c=Math.min(o/2,n/2),u=[Math.min(c,s[0]),Math.min(c,s[1]),Math.min(c,s[2]),Math.min(c,s[3])],g=[l[0]+u[0],l[1]],p=[l[0],l[1]+u[0]],f=[a[0]-u[1],a[1]],m=[a[0],a[1]+u[1]],b=[h[0]-u[2],h[1]],v=[h[0],h[1]-u[2]],y=[d[0]+u[3],d[1]],C=[d[0],d[1]-u[3]];if(t.moveTo(g[0],g[1]),t.lineTo(f[0],f[1]),!Lt(f,m)){const e=f[0],i=f[1]+u[1];t.arc(e,i,u[1],-wh,0,!1)}if(t.lineTo(v[0],v[1]),!Lt(b,v)){const e=v[0]-u[2],i=v[1];t.arc(e,i,u[2],0,wh,!1)}if(t.lineTo(y[0],y[1]),!Lt(y,C)){const e=y[0],i=y[1]-u[3];t.arc(e,i,u[3],wh,ee,!1)}if(t.lineTo(p[0],p[1]),!Lt(g,p)){const e=g[0],i=g[1]+u[0];t.arc(e,i,u[0],ee,ee+wh,!1)}return t.closePath(),t}var _h=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s};class Sh{constructor(){this.time=Pi.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,o,n,r,s,l,a,h,d,c){const{outerBorder:u,innerBorder:g}=t.attribute,p=u&&!1!==u.visible,f=g&&!1!==g.visible;if(!p&&!f)return;const{cornerRadius:m=a.cornerRadius,opacity:b=a.opacity,x:v=a.x,y:y=a.y,scaleX:C=a.scaleX,scaleY:w=a.scaleY,x1:x,y1:_}=t.attribute;let{width:S,height:A}=t.attribute;S=(null!=S?S:x-i)||0,A=(null!=A?A:_-o)||0;const B=!(!u||!u.stroke),R=!(!g||!g.stroke);if(p){const{distance:n=a.outerBorder.distance}=u,r=nh(e,n,e.dpr),s=i-r,l=o-r,h=2*r;if(0===m||rt(m)&&m.every((t=>0===t))?(e.beginPath(),e.rect(s,l,S+h,A+h)):(e.beginPath(),xh(e,s,l,S+h,A+h,m)),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,a),c)c(e,u,a.outerBorder);else if(B){const n=a.outerBorder.opacity;a.outerBorder.opacity=b,e.setStrokeStyle(t,u,(v-i)/C,(y-o)/w,a.outerBorder),a.outerBorder.opacity=n,e.stroke()}}if(f){const{distance:n=a.innerBorder.distance}=g,r=nh(e,n,e.dpr),s=i+r,l=o+r,h=2*r;if(0===m||rt(m)&&m.every((t=>0===t))?(e.beginPath(),e.rect(s,l,S-h,A-h)):(e.beginPath(),xh(e,s,l,S-h,A-h,m)),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,a),c)c(e,g,a.innerBorder);else if(R){const n=a.innerBorder.opacity;a.innerBorder.opacity=b,e.setStrokeStyle(t,g,(v-i)/C,(y-o)/w,a.innerBorder),a.innerBorder.opacity=n,e.stroke()}}}}let Ah=class{constructor(){this.time=Pi.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,o,n,r,s,l,a,h,d,c,u){const{stroke:g=a.stroke}=t.attribute;Array.isArray(g)&&g.some((t=>!1===t))&&(u.doStroke=!1)}};Ah=_h([y()],Ah);let Bh=class{constructor(){this.time=Pi.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,o,n,r,s,l,a,h,d,c){const{x1:u,y1:g,x:p=a.x,y:f=a.y,stroke:m=a.stroke}=t.attribute;let{width:b,height:v}=t.attribute;if(b=(null!=b?b:u-p)||0,v=(null!=v?v:g-f)||0,Array.isArray(m)&&m.some((t=>!1===t))){if(e.setStrokeStyle(t,t.attribute,i,o,a),e.beginPath(),e.moveTo(i,o),m[0]?e.lineTo(i+b,o):e.moveTo(i+b,o),m[1]?e.lineTo(i+b,o+v):e.moveTo(i+b,o+v),m[2]?e.lineTo(i,o+v):e.moveTo(i,o+v),m[3]){const t=m[0]?o-e.lineWidth/2:o;e.lineTo(i,t)}else e.moveTo(i,o);e.stroke()}}};Bh=_h([y()],Bh);const Rh=new Sh,Mh=gh,Th=dh;const kh=new class extends Sh{constructor(){super(...arguments),this.time=Pi.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,o,n,r,s,l,a,h,d,c){return super.drawShape(t,e,i,o,n,r,s,l,a,h,d,c)}},Ph=new class extends hh{constructor(){super(...arguments),this.time=Pi.beforeFillStroke}drawShape(t,e,i,o,n,r,s,l,a,h,d,c){const{background:u,backgroundMode:g=a.backgroundMode,backgroundFit:p=a.backgroundFit}=t.attribute;if(u)if(t.backgroundImg){const i=t.resources.get(u);if("success"!==i.state||!i.data)return;if(e.save(),t.parent&&!t.transMatrix.onlyTranslate()){const i=_n(t.parent).group,{scrollX:o=i.scrollX,scrollY:n=i.scrollY}=t.parent.attribute;e.setTransformFromMatrix(t.parent.globalTransMatrix,!0),e.translate(o,n)}const o=t.AABBBounds;this.doDrawImage(e,i.data,o,g,p),e.restore(),t.transMatrix.onlyTranslate()||e.setTransformForCurrent()}else if(tt(u)){const{stroke:i,fill:o,lineWidth:n=1,cornerRadius:r=0,expandX:s=0,expandY:l=0}=u;if(!i&&!o)return;e.beginPath();const{x:a,y:h,width:d,height:c}=function(t){const e=Qn(t.attribute.boundsPadding),i=t.AABBBounds;let o=i.x1,n=i.y1,r=i.width(),s=i.height();return at(e)?(o+=e,n+=e,r-=2*e,s-=2*e):(o+=e[3],n+=e[0],r-=e[1]+e[3],s-=e[0]+e[2]),{x:o,y:n,width:r,height:s}}(t);r?xh(e,a-s,h-l,d+2*s,c+2*l,r):e.rect(a-s,h-l,d+2*s,c+2*l),e.globalAlpha=1,o&&(e.fillStyle=o,e.fill()),i&&n>0&&(e.lineWidth=n,e.strokeStyle=i,e.stroke())}else{e.beginPath();const n=t.AABBBounds;e.rect(i,o,n.width(),n.height()),e.fillStyle=u,e.globalAlpha=1,e.fill()}}};const Eh=new class{constructor(){this.time=Pi.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,o,n,r,s,l,a,h,d,c){const u=t.getParsedPath();if(!u)return;const{outerBorder:g,innerBorder:p}=t.attribute,f=g&&!1!==g.visible,m=p&&!1!==p.visible;if(!f&&!m)return;const{size:b=a.size,opacity:v=a.opacity,x:y=a.x,y:C=a.y,scaleX:w=a.scaleX,scaleY:x=a.scaleY}=t.attribute,_=!(!g||!g.stroke),S=!(!p||!p.stroke);if(f){const{distance:n=a.outerBorder.distance}=g,r=nh(e,n,e.dpr);if(e.beginPath(),!1===u.drawOffset(e,b,i,o,r)&&e.closePath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,a),c)c(e,g,a.outerBorder);else if(_){const n=a.outerBorder.opacity;a.outerBorder.opacity=v,e.setStrokeStyle(t,g,(y-i)/w,(C-o)/x,a.outerBorder),a.outerBorder.opacity=n,e.stroke()}}if(m){const{distance:n=a.innerBorder.distance}=p,r=nh(e,n,e.dpr);if(e.beginPath(),!1===u.drawOffset(e,b,i,o,-r)&&e.closePath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,a),c)c(e,p,a.innerBorder);else if(S){const n=a.innerBorder.opacity;a.innerBorder.opacity=v,e.setStrokeStyle(t,p,(y-i)/w,(C-o)/x,a.innerBorder),a.innerBorder.opacity=n,e.stroke()}}}},Lh=gh,Hh=dh;var zh=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s},Fh=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Ih=function(t,e){return function(i,o){e(i,o,t)}};let Oh=class extends eh{constructor(t){super(),this.arcRenderContribitions=t,this.numberType=Xr,this.builtinContributions=[ph,mh,fh],this.init(t)}drawArcTailCapPath(t,e,i,o,n,r,s,l){const a=l-s,h=t.getParsedAngle(),d=h.startAngle;let c=h.endAngle;c=l;const u=re(c-d),g=c>d;let p=!1;if(n<r){const t=n;n=r,r=t}const f=t.getParsedCornerRadius(),{outerDeltaAngle:m,innerDeltaAngle:b,outerStartAngle:v,outerEndAngle:y,innerEndAngle:C,innerStartAngle:w}=t.getParsePadAngle(d,c),x=f,_=f,S=f,A=f,B=Math.max(_,x),R=Math.max(S,A);let M=B,T=R;const k=n*le(v),P=n*de(v),E=r*le(C),L=r*de(C);let H,z,F,I;if((R>te||B>te)&&(H=n*le(y),z=n*de(y),F=r*le(w),I=r*de(w),u<ee)){const t=Ps(k,P,F,I,H,z,E,L);if(t){const e=k-t[0],i=P-t[1],o=H-t[0],s=z-t[1],l=1/de(ge((e*o+i*s)/(ce(e*e+i*i)*ce(o*o+s*s)))/2),a=ce(t[0]*t[0]+t[1]*t[1]);T=he(R,(r-a)/(l-1)),M=he(B,(n-a)/(l+1))}}if(M>te){const t=he(x,M),r=he(_,M),s=Es(F,I,k,P,n,t,Number(g)),l=Es(H,z,E,L,n,r,Number(g));if(M<B&&t===r)e.moveTo(i+s.cx+s.x01,o+s.cy+s.y01),e.arc(i+s.cx,o+s.cy,M,se(s.y01,s.x01),se(l.y01,l.x01),!g);else{const t=c-a-.03,s=se(l.y11,l.x11);e.arc(i,o,n,t,s,!g),r>0&&e.arc(i+l.cx,o+l.cy,r,se(l.y11,l.x11),se(l.y01,l.x01),!g)}}else e.moveTo(i+k,o+P);if(!(r>te)||b<.001)e.lineTo(i+E,o+L),p=!0;else if(T>te){const t=he(A,T),n=he(S,T),s=Es(E,L,H,z,r,-n,Number(g)),l=Es(k,P,F,I,r,-t,Number(g));if(e.lineTo(i+s.cx+s.x01,o+s.cy+s.y01),T<R&&t===n){const t=se(l.y01,l.x01);e.arc(i+s.cx,o+s.cy,T,se(s.y01,s.x01),t,!g)}else{n>0&&e.arc(i+s.cx,o+s.cy,n,se(s.y01,s.x01),se(s.y11,s.x11),!g);const t=se(s.cy+s.y11,s.cx+s.x11),l=c-a-.03;e.arc(i,o,r,t,l,g)}}else e.lineTo(i+r*le(w),o+r*de(w));return p}drawShape(t,e,i,o,n,r,s,l){const a=_n(t,null==r?void 0:r.theme).arc,{fill:h=a.fill,stroke:d=a.stroke,x:c=a.x,y:u=a.y}=t.attribute,g=this.valid(t,a,s,l);if(!g)return;const{fVisible:p,sVisible:f,doFill:m,doStroke:b}=g,{outerPadding:v=a.outerPadding,innerPadding:y=a.innerPadding,cap:C=a.cap,forceShowCap:w=a.forceShowCap}=t.attribute;let{outerRadius:x=a.outerRadius,innerRadius:_=a.innerRadius}=t.attribute;x+=v,_-=y;let S=0;const A=(q(C)&&C||C[0])&&"conical"===h.gradient;if(A){const{sc:e,startAngle:i,endAngle:o}=t.getParsedAngle();re(o-i)<ne-te&&(S=e||0,h.startAngle-=S,h.endAngle-=S)}let B=!1;const{isFullStroke:R,stroke:M}=(t=>{var e;let i=!0;if(q(t,!0)){for(let o=0;o<4;o++)Zn[o]=t,i&&(i=!(null!==(e=Zn[o])&&void 0!==e&&!e));i=t}else if(Array.isArray(t))for(let e=0;e<4;e++)Zn[e]=!!t[e],i&&(i=!!Zn[e]);else Zn[0]=!1,Zn[1]=!1,Zn[2]=!1,Zn[3]=!1;return{isFullStroke:i,stroke:Zn}})(d);if((m||R)&&(e.beginPath(),Ls(t,e,i,o,x,_),B=!0,e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,a),this.beforeRenderStep(t,e,i,o,m,b,p,f,a,n,s,l),m&&(s?s(e,t.attribute,a):p&&(e.setCommonStyle(t,t.attribute,c-i,u-o,a),e.fill())),b&&R&&(l?l(e,t.attribute,a):f&&(e.setStrokeStyle(t,t.attribute,c-i,u-o,a),e.stroke()))),!R&&b&&(e.beginPath(),Ls(t,e,i,o,x,_,M),B||this.beforeRenderStep(t,e,i,o,m,b,p,f,a,n,s,l),l?l(e,t.attribute,a):f&&(e.setStrokeStyle(t,t.attribute,i,o,a),e.stroke())),(q(C)&&C||C[1])&&w){const{startAngle:r,endAngle:h}=t.getParsedAngle();if(re(h-r)>=ne-te){e.beginPath();const r=Math.abs(x-_)/2/x,{endAngle:h=a.endAngle,fill:d=a.fill}=t.attribute,c=h;if(this.drawArcTailCapPath(t,e,i,o,x,_,c,c+r),B||this.beforeRenderStep(t,e,i,o,m,b,p,f,a,n,s,l),m){const n=d;if("conical"===n.gradient){const r=function(t,e,i,o){const{stops:n,startAngle:r,endAngle:s}=o;for(;i<0;)i+=ne;for(;i>ne;)i-=ne;if(i<r)return n[0].color;if(i>s)return n[0].color;let l,a,h=(i-r)/(s-r);for(let t=0;t<n.length;t++)if(n[t].offset>=h){l=n[t-1],a=n[t];break}return h=(h-l.offset)/(a.offset-l.offset),ur(l.color,a.color,h,!1)}(0,0,h,n);s||Rs&&(e.setCommonStyle(t,t.attribute,i,o,a),e.fillStyle=r,e.fill())}}b&&(l||f&&(e.setStrokeStyle(t,t.attribute,i,o,a),e.stroke()))}}this.afterRenderStep(t,e,i,o,m,b,p,f,a,n,s,l),A&&(h.startAngle+=S,h.endAngle+=S)}draw(t,e,i,o){const n=_n(t,null==o?void 0:o.theme).arc;this._draw(t,n,!1,i,o)}};Oh=zh([y(),Ih(0,b(z)),Ih(0,C(Is)),Fh("design:paramtypes",[Object])],Oh);var Dh=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s},Wh=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Nh=function(t,e){return function(i,o){e(i,o,t)}};let Gh=class extends eh{constructor(t){super(),this.circleRenderContribitions=t,this.numberType=qr,this.builtinContributions=[bh,yh,vh],this.init(t)}drawShape(t,e,i,o,n,r,s,l){const a=_n(t,null==r?void 0:r.theme).circle,{radius:h=a.radius,startAngle:d=a.startAngle,endAngle:c=a.endAngle,x:u=a.x,y:g=a.y}=t.attribute,p=this.valid(t,a,s,l);if(!p)return;const{fVisible:f,sVisible:m,doFill:b,doStroke:v}=p;e.beginPath(),e.arc(i,o,h,d,c),e.closePath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,a),this.beforeRenderStep(t,e,i,o,b,v,f,m,a,n,s,l),b&&(s?s(e,t.attribute,a):f&&(e.setCommonStyle(t,t.attribute,u-i,g-o,a),e.fill())),v&&(l?l(e,t.attribute,a):m&&(e.setStrokeStyle(t,t.attribute,u-i,g-o,a),e.stroke())),this.afterRenderStep(t,e,i,o,b,v,f,m,a,n,s,l)}draw(t,e,i,o){const n=_n(t,null==o?void 0:o.theme).circle;this._draw(t,n,!1,i,o)}};function jh(t,e,i,o){if(!e.p1)return;const{offsetX:n=0,offsetY:r=0,offsetZ:s=0}=o||{};if(1===i)e.p2&&e.p3?t.bezierCurveTo(n+e.p1.x,r+e.p1.y,n+e.p2.x,r+e.p2.y,n+e.p3.x,r+e.p3.y,s):t.lineTo(n+e.p1.x,r+e.p1.y,s);else if(e.p2&&e.p3){const[o]=Wi(e,i);t.bezierCurveTo(n+o.p1.x,r+o.p1.y,n+o.p2.x,r+o.p2.y,n+o.p3.x,r+o.p3.y,s)}else{const o=e.getPointAt(i);t.lineTo(n+o.x,r+o.y,s)}}function Vh(t,e,i,o,n){var r;const{offsetX:s=0,offsetY:l=0,offsetZ:a=0,mode:h="none",drawConnect:d=!1,zeroX:c=0,zeroY:u=0}=n||{};if(d&&"none"===h)return;if(!e)return;let g=!0;const{curves:p}=e;if(i>=1){if(d){let e,i=!0;p.forEach(((o,n)=>{var r;let h=o.p0;if(o.originP1!==o.originP2){if(e&&e.originP1===e.originP2&&(h=e.p0),o.defined)i||(t.lineTo(h.x+s,h.y+l,a),i=!i);else{const{originP1:e,originP2:n}=o;let d;if(e&&!1!==e.defined?d=h:e&&!1!==n.defined&&(d=null!==(r=o.p3)&&void 0!==r?r:o.p1),i){i=!i;const e=d?d.x:o.p0.x,n=d?d.y:o.p0.y;t.moveTo(e+s,n+l,a)}else d&&(i=!i,t.lineTo(d.x+s,d.y+l,a))}e=o}else e=o}))}else p.forEach((e=>{e.defined?(g&&t.moveTo(e.p0.x+s,e.p0.y+l,a),jh(t,e,1,n),g=!1):g=!0}));return}if(i<=0)return;let f;"x"===o?f=Ti.ROW:"y"===o?f=Ti.COLUMN:"auto"===o&&(f=e.direction);const m=i*e.tryUpdateLength(f);let b=0,v=!0,y=null;for(let e=0,i=p.length;e<i;e++){const i=p[e],o=i.getLength(f),h=(m-b)/o;if(b+=o,h<0)break;if(d){let e=i.p0;if(i.originP1===i.originP2){y=i;continue}if(y&&y.originP1===y.originP2&&(e=y.p0),i.defined)v||(t.lineTo(e.x+s,e.y+l,a),v=!v);else{const{originP1:o,originP2:n}=i;let h;if(o&&!1!==o.defined?h=e:o&&!1!==n.defined&&(h=null!==(r=i.p3)&&void 0!==r?r:i.p1),v){v=!v;const e=h?h.x:i.p0.x,o=h?h.y:i.p0.y;t.moveTo(e+s,o+l,a)}else h&&(v=!v,t.lineTo(h.x+s,h.y+l,a))}y=i}else{if(!i.defined){g=!0;continue}g&&t.moveTo(i.p0.x+s,i.p0.y+l,a),jh(t,i,he(h,1),n),g=!1}}}Gh=Dh([y(),Nh(0,b(z)),Nh(0,C(Ds)),Wh("design:paramtypes",[Object])],Gh);var Uh=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s};let $h=class extends eh{constructor(){super(...arguments),this.numberType=Qr}draw(t,e,i,o){const n=_n(t,null==o?void 0:o.theme).line;this._draw(t,n,!1,i,o)}drawSegmentItem(t,e,i,o,n,r,s,l,a,h,d,c,u,g,p){var f,m,b,v,y;if(!e)return;t.beginPath();const C=null!==(f=this.z)&&void 0!==f?f:0;Vh(t.camera?t:t.nativeContext,e,a,h,{offsetX:d,offsetY:c,offsetZ:C}),u.cache&&!rt(u.cache)&&u.cache.curves.every((t=>t.defined))&&u.attribute.curveType&&u.attribute.curveType.includes("Closed")&&t.closePath(),t.setShadowBlendStyle&&t.setShadowBlendStyle(u,s,l);const{x:w=0,x:x=0}=s;!1!==i&&(g?g(t,s,l):n&&(t.setCommonStyle(u,s,w-d,x-c,l),t.fill())),!1!==o&&(p?p(t,s,l):r&&(t.setStrokeStyle(u,s,w-d,x-c,l),t.stroke()));let{connectedType:_,connectedX:S,connectedY:A,connectedStyle:B}=s;if(rt(l)?(_=null!==(m=null!=_?_:l[0].connectedType)&&void 0!==m?m:l[1].connectedType,S=null!==(b=null!=S?S:l[0].connectedX)&&void 0!==b?b:l[1].connectedX,A=null!==(v=null!=A?A:l[0].connectedY)&&void 0!==v?v:l[1].connectedY,B=null!==(y=null!=B?B:l[0].connectedStyle)&&void 0!==y?y:l[1].connectedStyle):(_=null!=_?_:l.connectedType,S=null!=S?S:l.connectedX,A=null!=A?A:l.connectedY,B=null!=B?B:l.connectedStyle),"connect"!==_&&"zero"!==_&&(_="none"),"none"!==_){t.beginPath(),Vh(t.camera?t:t.nativeContext,e,a,h,{offsetX:d,offsetY:c,offsetZ:C,drawConnect:!0,mode:_,zeroX:S,zeroY:A});const f=[];rt(l)?l.forEach((t=>f.push(t))):f.push(l),f.push(s),!1!==i&&(g?g(t,s,l):n&&(t.setCommonStyle(u,B,w-d,x-c,f),t.fill())),!1!==o&&(p?p(t,s,l):r&&(t.setStrokeStyle(u,B,w-d,x-c,f),t.stroke()))}return!1}drawLinearLineHighPerformance(t,e,i,o,n,r,s,l,a,h,d,c,u){var g;e.beginPath();const p=null!==(g=this.z)&&void 0!==g?g:0,{points:f}=t.attribute,m=f[0];e.moveTo(m.x+s,m.y+l,p);for(let t=1;t<f.length;t++){const i=f[t];e.lineTo(i.x+s,i.y+l,p)}e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,a);const{x:b=0,x:v=0}=t.attribute;!1!==i&&(c?c(e,t.attribute,a):n&&(e.setCommonStyle(t,t.attribute,b-s,v-l,a),e.fill())),!1!==o&&(u?u(e,t.attribute,a):r&&(e.setStrokeStyle(t,t.attribute,b-s,v-l,a),e.stroke()))}drawShape(t,e,i,o,n,r,s,l){const a=_n(t,null==r?void 0:r.theme).line,{fill:h=a.fill,stroke:d=a.stroke,fillOpacity:c=a.fillOpacity,strokeOpacity:u=a.strokeOpacity,segments:g,points:p,closePath:f}=t.attribute;if(!this.valid(t,a,s,l))return;let{curveType:m=a.curveType}=t.attribute;f&&"linear"===m&&(m="linearClosed");const{clipRange:b=a.clipRange,clipRangeByDimension:v=a.clipRangeByDimension}=t.attribute;if(1===b&&!g&&!p.some((t=>!1===t.defined))&&"linear"===m)return this.drawLinearLineHighPerformance(t,e,!!h,!!d,c,u,i,o,a,n,r,s,l);if(t.shouldUpdateShape()){const{points:e,segments:i}=t.attribute,o=e;if(i&&i.length){let e,o;if(t.cache=i.map(((t,i)=>{if(t.points.length<=1&&0===i)return t.points[0]&&(o={endX:t.points[0].x,endY:t.points[0].y,curves:[{defined:!1!==t.points[0].defined}]}),null;1===i?e={x:o.endX,y:o.endY,defined:o.curves[o.curves.length-1].defined}:i>1&&(e.x=o.endX,e.y=o.endY,e.defined=o.curves[o.curves.length-1].defined);const n=uo(t.points,m,{startPoint:e});return o=n,n})).filter((t=>!!t)),"linearClosed"===m){let e;for(let i=0;i<t.cache.length;i++){const o=t.cache[i];for(let t=0;t<o.curves.length;t++)if(o.curves[t].defined){e=o.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=uo(o,m)}t.clearUpdateShapeTag()}if(Array.isArray(t.cache)){const n=t.attribute.segments.filter((t=>t.points.length));if(1===n[0].points.length&&n.shift(),1===b){let r=!1;t.cache.forEach(((g,p)=>{r||(r=this.drawSegmentItem(e,g,!!h,!!d,c,u,n[p],[a,t.attribute],b,v,i,o,t,s,l))}))}else{const r=t.cache.reduce(((t,e)=>t+e.getLength()),0),g=b*r;let p=0,f=!1;t.cache.forEach(((r,m)=>{if(f)return;const b=r.getLength(),y=(g-p)/b;p+=b,y>0&&(f=this.drawSegmentItem(e,r,!!h,!!d,c,u,n[m],[a,t.attribute],he(y,1),v,i,o,t,s,l))}))}}else this.drawSegmentItem(e,t.cache,!!h,!!d,c,u,t.attribute,a,b,v,i,o,t,s,l)}};function Xh(t,e,i,o){if(e.length<2)return;const{offsetX:n=0,offsetY:r=0,offsetZ:s=0,mode:l}=o||{};let a=e[0];t.moveTo(a.p0.x+n,a.p0.y+r,s),a=e[e.length-1];let h=a.p3||a.p1;t.lineTo(h.x+n,h.y+r,s),a=i[i.length-1],t.lineTo(a.p0.x+n,a.p0.y+r,s),a=i[0],h=a.p3||a.p1,t.lineTo(h.x+n,h.y+r,s),t.closePath()}function Yh(t,e,i,o){const{offsetX:n=0,offsetY:r=0,offsetZ:s=0}=o||{};let l=!0;e.forEach((e=>{e.defined?(l&&t.moveTo(e.p0.x+n,e.p0.y+r,s),jh(t,e,1,o),l=!1):l=!0})),l=!0;for(let e=i.length-1;e>=0;e--){const a=i[e];a.defined?(l&&t.lineTo(a.p0.x+n,a.p0.y+r,s),jh(t,a,1,o),l=!1):l=!0}t.closePath()}$h=Uh([y()],$h);const Kh=new class extends uh{constructor(){super(...arguments),this.time=Pi.afterFillStroke}drawShape(t,e,i,o,n,r,s,l,a,h,d,c,u){var g,p,f,m;this.textureMap||this.initTextureMap(e,t.stage);const{attribute:b=t.attribute}=u||{},{texture:v=(null!==(g=t.attribute.texture)&&void 0!==g?g:rr(a,"texture")),textureColor:y=(null!==(p=t.attribute.textureColor)&&void 0!==p?p:rr(a,"textureColor")),textureSize:C=(null!==(f=t.attribute.textureSize)&&void 0!==f?f:rr(a,"textureSize")),texturePadding:w=(null!==(m=t.attribute.texturePadding)&&void 0!==m?m:rr(a,"texturePadding"))}=b;v&&this.drawTexture(v,t,e,i,o,a,y,C,w)}},qh=dh;var Zh=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s},Jh=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Qh=function(t,e){return function(i,o){e(i,o,t)}};function td(t,e,i){switch(e){case"linear":default:return Ki(t,i);case"basis":return Ji(t,i);case"monotoneX":return ro(t,i);case"monotoneY":return so(t,i);case"step":return ao(t,.5,i);case"stepBefore":return ao(t,0,i);case"stepAfter":return ao(t,1,i);case"linearClosed":return co(t,i)}}let ed=class extends eh{constructor(t){super(),this.areaRenderContribitions=t,this.numberType=Kr,this.builtinContributions=[Kh,qh],this.init(t)}drawLinearAreaHighPerformance(t,e,i,o,n,r,s,l,a,h,d,c,u){var g,p,f,m,b;const{points:v}=t.attribute;if(v.length<2)return;e.beginPath();const y=null!==(g=this.z)&&void 0!==g?g:0,C=v[0];e.moveTo(C.x+s,C.y+l,y);for(let t=1;t<v.length;t++){const i=v[t];e.lineTo(i.x+s,i.y+l,y)}for(let t=v.length-1;t>=0;t--){const i=v[t];e.lineTo((null!==(p=i.x1)&&void 0!==p?p:i.x)+s,(null!==(f=i.y1)&&void 0!==f?f:i.y)+l,y)}e.closePath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,a),this.beforeRenderStep(t,e,s,l,!!n,!1,i,!1,a,h,c,null,{attribute:t.attribute});const{x:w=0,x:x=0}=t.attribute;if(!1!==i&&(c?c(e,t.attribute,a):n&&(e.setCommonStyle(t,t.attribute,w-s,x-l,a),e.fill())),this.afterRenderStep(t,e,s,l,!!n,!1,i,!1,a,h,c,null,{attribute:t.attribute}),o){const{stroke:i=a&&a.stroke}=t.attribute;if(rt(i)&&(i[0]||i[2])&&!1===i[1])if(e.beginPath(),i[0]){e.moveTo(C.x+s,C.y+l,y);for(let t=1;t<v.length;t++){const i=v[t];e.lineTo(i.x+s,i.y+l,y)}}else if(i[2]){const t=v[v.length-1];e.moveTo(t.x+s,t.y+l,y);for(let t=v.length-2;t>=0;t--){const i=v[t];e.lineTo((null!==(m=i.x1)&&void 0!==m?m:i.x)+s,(null!==(b=i.y1)&&void 0!==b?b:i.y)+l,y)}}u?u(e,t.attribute,a):(e.setStrokeStyle(t,t.attribute,w-s,x-l,a),e.stroke())}}drawShape(t,e,i,o,n,r,s,l){var a,h,d,c,u,g;const p=_n(t,null==r?void 0:r.theme).area,{fill:f=p.fill,stroke:m=p.stroke,fillOpacity:b=p.fillOpacity,z:v=p.z,strokeOpacity:y=p.strokeOpacity}=t.attribute,C=this.valid(t,p,s,l);if(!C)return;const{doFill:w,doStroke:x}=C,{clipRange:_=p.clipRange,closePath:S,points:A,segments:B}=t.attribute;let{curveType:R=p.curveType}=t.attribute;if(S&&"linear"===R&&(R="linearClosed"),1===_&&!B&&!A.some((t=>!1===t.defined))&&"linear"===R)return this.drawLinearAreaHighPerformance(t,e,!!f,x,b,y,i,o,p,n,r,s,l);if(t.shouldUpdateShape()){if(B&&B.length){let e,i;const o=B.map(((t,o)=>{if(t.points.length<=1&&0===o)return t.points[0]&&(i={endX:t.points[0].x,endY:t.points[0].y}),null;1===o?e={x:i.endX,y:i.endY}:o>1&&(e.x=i.endX,e.y=i.endY);const n=td(t.points,R,{startPoint:e});return i=n,n})).filter((t=>!!t));let n;const r=[];for(let t=B.length-1;t>=0;t--){const e=B[t].points,i=[];for(let t=e.length-1;t>=0;t--)i.push({x:null!==(a=e[t].x1)&&void 0!==a?a:e[t].x,y:null!==(h=e[t].y1)&&void 0!==h?h:e[t].y});if(0!==t){const e=B[t-1].points,o=e[e.length-1];o&&i.push({x:null!==(d=o.x1)&&void 0!==d?d:o.x,y:null!==(c=o.y1)&&void 0!==c?c:o.y})}i.length>1&&(n=td(i,"stepBefore"===R?"stepAfter":"stepAfter"===R?"stepBefore":R),r.unshift(n))}t.cacheArea=r.map(((t,e)=>({top:o[e],bottom:t})))}else{if(!A||!A.length)return t.cacheArea=null,void t.clearUpdateShapeTag();{const e=A,i=[];for(let t=A.length-1;t>=0;t--)i.push({x:null!==(u=A[t].x1)&&void 0!==u?u:A[t].x,y:null!==(g=A[t].y1)&&void 0!==g?g:A[t].y});const o=td(e,R),n=td(i,"stepBefore"===R?"stepAfter":"stepAfter"===R?"stepBefore":R);t.cacheArea={top:o,bottom:n}}}t.clearUpdateShapeTag()}if(Array.isArray(t.cacheArea)){const r=t.attribute.segments.filter((t=>t.points.length));if(1===r[0].points.length&&r.shift(),1===_){let a=!1;t.cacheArea.forEach(((h,d)=>{a||(a=this.drawSegmentItem(e,h,w,b,x,y,r[d],[p,t.attribute],_,i,o,v,t,n,s,l))}))}else{const a=t.cacheArea.reduce(((t,e)=>t+e.top.getLength()),0),h=_*a;let d=0,c=!1;t.cacheArea.forEach(((a,u)=>{if(c)return;const g=a.top.getLength(),f=(h-d)/g;d+=g,f>0&&(c=this.drawSegmentItem(e,a,w,b,x,y,r[u],[p,t.attribute],he(f,1),i,o,v,t,n,s,l))}))}}else this.drawSegmentItem(e,t.cacheArea,w,b,x,y,t.attribute,p,_,i,o,v,t,n,s,l)}draw(t,e,i,o){const n=_n(t,null==o?void 0:o.theme).area;this._draw(t,n,!1,i,o)}drawSegmentItem(t,e,i,o,n,r,s,l,a,h,d,c,u,g,p,f){let m=!1;return m=m||this._drawSegmentItem(t,e,i,o,n,r,s,l,a,h,d,c,u,g,!1,p,f),m=m||this._drawSegmentItem(t,e,i,o,n,r,s,l,a,h,d,c,u,g,!0,p,f),m}_drawSegmentItem(t,e,i,o,n,r,s,l,a,h,d,c,u,g,p,f,m){var b,v,y,C;if(!(e&&e.top&&e.bottom&&e.top.curves&&e.top.curves.length&&e.bottom.curves&&e.bottom.curves.length))return;let{connectedType:w,connectedX:x,connectedY:_,connectedStyle:S}=s;const A=[];if(p&&(rt(l)?(w=null!==(b=null!=w?w:l[0].connectedType)&&void 0!==b?b:l[1].connectedType,x=null!==(v=null!=x?x:l[0].connectedX)&&void 0!==v?v:l[1].connectedX,_=null!==(y=null!=_?_:l[0].connectedY)&&void 0!==y?y:l[1].connectedY,S=null!==(C=null!=S?S:l[0].connectedStyle)&&void 0!==C?C:l[1].connectedStyle):(w=null!=w?w:l.connectedType,x=null!=x?x:l.connectedX,_=null!=_?_:l.connectedY,S=null!=S?S:l.connectedStyle),"connect"!==w&&"zero"!==w&&(w="none"),rt(l)?l.forEach((t=>A.push(t))):A.push(l),A.push(s)),p&&"none"===w)return!1;t.beginPath();const{points:B,segments:R}=u.attribute;let M,T,k=Ti.ROW;if(R){const t=R[R.length-1];T=R[0].points[0],M=t.points[t.points.length-1]}else T=B[0],M=B[B.length-1];const P=re(M.x-T.x),E=re(M.y-T.y);k=Number.isFinite(P+E)?P>E?Ti.ROW:Ti.COLUMN:Ti.ROW,function(t,e,i,o){var n;const{drawConnect:r=!1,mode:s="none"}=o||{};if(r&&"none"===s)return;const{top:l,bottom:a}=e;if(l.curves.length!==a.curves.length)return;if(i>=1){const e=[],i=[];let n=!0;if(r){let n,r,s=!0;const h=l.curves.length;l.curves.forEach(((l,d)=>{const c=a.curves[h-d-1];let u=l,g=c;if(l.originP1===l.originP2)return n=l,void(r=c);if(n&&n.originP1===n.originP2&&(u=n,g=r),l.defined)s||(e.push(u),i.push(g),Xh(t,e,i,o),e.length=0,i.length=0,s=!s);else{const{originP1:n,originP2:r}=l;let a,h;n&&!1!==n.defined?(a=u,h=g):n&&!1!==r.defined&&(a=l,h=c),s?(s=!s,e.push(a||l),i.push(h||c)):a&&(s=!s,e.push(a||l),i.push(h||c),Xh(t,e,i,o),e.length=0,i.length=0)}n=l})),Xh(t,e,i,o)}else{for(let r=0,s=l.curves.length;r<s;r++){const h=l.curves[r];n!==h.defined?(n?(Yh(t,e,i,o),e.length=0,i.length=0):(e.push(h),i.push(a.curves[s-r-1])),n=!n):n&&(e.push(h),i.push(a.curves[s-r-1]))}Yh(t,e,i,o)}return}if(i<=0)return;let{direction:h}=o||{};const{curves:d}=l,c=null!==(n=d[d.length-1].p3)&&void 0!==n?n:d[d.length-1].p1,u=re(c.x-d[0].p0.x),g=re(c.y-d[0].p0.y);h=null!=h?h:u>g?Ti.ROW:Ti.COLUMN,Number.isFinite(u)||(h=Ti.COLUMN),Number.isFinite(g)||(h=Ti.ROW);const p=i*(h===Ti.ROW?u:g);let f=0,m=!0;const b=[],v=[];let y,C,w=!0;for(let e=0,i=l.curves.length;e<i;e++){const n=l.curves[e],s=n.getLength(h),d=(p-f)/s;if(d<0)break;if(f+=s,r){const r=a.curves[i-e-1];let s=n,l=r;if(n.originP1===n.originP2){y=n,C=r;continue}if(y&&y.originP1===y.originP2&&(s=y,l=C),n.defined)w||(b.push(s),v.push(l),Xh(t,b,v,o),b.length=0,v.length=0,w=!w);else{const{originP1:e,originP2:i}=n;let a,h;e&&!1!==e.defined?(a=s,h=l):e&&!1!==i.defined&&(a=n,h=r),w?(w=!w,b.push(a||n),v.push(h||r)):a&&(w=!w,b.push(a||n),v.push(h||r),Xh(t,b,v,o),b.length=0,v.length=0)}y=n}else{let r=null,s=null;m!==n.defined?(m?(Yh(t,b,v,o),b.length=0,v.length=0):(r=n,s=a.curves[i-e-1]),m=!m):m&&(r=n,s=a.curves[i-e-1]),r&&s&&(d<1&&(r=r.p2&&r.p3?Wi(r,d)[0]:Gi(r,d)[0],s=s.p2&&s.p3?Wi(s,1-d)[1]:Gi(s,1-d)[1]),r.defined=m,s.defined=m,b.push(r),v.push(s)),r=null,s=null}}r?Xh(t,b,v,o):Yh(t,b,v,o)}(t.camera?t:t.nativeContext,e,a,{offsetX:h,offsetY:d,offsetZ:c,direction:k,drawConnect:p,mode:w,zeroX:x,zeroY:_}),this.beforeRenderStep(u,t,h,d,!!o,!1,i,!1,l,g,f,null,{attribute:s}),t.setShadowBlendStyle&&t.setShadowBlendStyle(u,s,l);const{x:L=0,x:H=0}=s;if(!1!==i&&(f?f(t,s,l):o&&(t.setCommonStyle(u,p?S:s,L-h,H-d,p?A:l),t.fill())),this.afterRenderStep(u,t,h,d,!!o,!1,i,!1,l,g,f,null,{attribute:s}),!1!==n)if(m)m(t,s,l);else{const{stroke:i=l&&l[1]&&l[1].stroke}=s;rt(i)&&(i[0]||i[2])&&!1===i[1]&&(t.beginPath(),Vh(t.camera?t:t.nativeContext,i[0]?e.top:e.bottom,a,k===Ti.ROW?"x":"y",{offsetX:h,offsetY:d,offsetZ:c,drawConnect:p,mode:w,zeroX:x,zeroY:_})),t.setStrokeStyle(u,p?S:s,L-h,H-d,p?A:l),t.stroke()}return!1}};ed=Zh([y(),Qh(0,b(z)),Qh(0,C(Os)),Jh("design:paramtypes",[Object])],ed);const id=gh,od=dh;var nd=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s},rd=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},sd=function(t,e){return function(i,o){e(i,o,t)}};let ld=class extends eh{constructor(t){super(),this.pathRenderContribitions=t,this.numberType=ts,this.builtinContributions=[od,id],this.init(t)}drawShape(t,e,i,o,n,r,s,l){var a,h,d;const c=null!==(a=this.tempTheme)&&void 0!==a?a:_n(t,null==r?void 0:r.theme).path,{x:u=c.x,y:g=c.y}=t.attribute,p=null!==(h=this.z)&&void 0!==h?h:0,f=this.valid(t,c,s,l);if(!f)return;const{fVisible:m,sVisible:b,doFill:v,doStroke:y}=f;if(e.beginPath(),t.pathShape)zi(t.pathShape.commandList,e,i,o,1,1,p);else{zi((null!==(d=t.attribute.path)&&void 0!==d?d:c.path).commandList,e,i,o,1,1,p)}e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,c),this.beforeRenderStep(t,e,i,o,v,y,m,b,c,n,s,l),y&&(l?l(e,t.attribute,c):b&&(e.setStrokeStyle(t,t.attribute,u-i,g-o,c),e.stroke())),v&&(s?s(e,t.attribute,c):m&&(e.setCommonStyle(t,t.attribute,u-i,g-o,c),e.fill())),this.afterRenderStep(t,e,i,o,v,y,m,b,c,n,s,l)}draw(t,e,i,o){const n=_n(t,null==o?void 0:o.theme).path;this.tempTheme=n,this._draw(t,n,!1,i,o),this.tempTheme=null}};ld=nd([y(),sd(0,b(z)),sd(0,C(Gs)),rd("design:paramtypes",[Object])],ld);var ad=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s},hd=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},dd=function(t,e){return function(i,o){e(i,o,t)}};let cd=class extends eh{constructor(t){super(),this.rectRenderContribitions=t,this.type="rect",this.numberType=is,this.builtinContributions=[Rh,Th,Mh],this.init(t)}drawShape(t,e,i,o,n,r,s,l){var a;const h=null!==(a=this.tempTheme)&&void 0!==a?a:_n(t,null==r?void 0:r.theme).rect,{fill:d=h.fill,background:c,stroke:u=h.stroke,cornerRadius:g=h.cornerRadius,opacity:p=h.opacity,fillOpacity:f=h.fillOpacity,lineWidth:m=h.lineWidth,strokeOpacity:b=h.strokeOpacity,visible:v=h.visible,x1:y,y1:C,x:w=h.x,y:x=h.y}=t.attribute;let{width:_,height:S}=t.attribute;_=(null!=_?_:y-w)||0,S=(null!=S?S:C-x)||0;const A=Ms(p,f,_,S,d),B=ks(p,b,_,S),R=As(d,c),M=Bs(u,m);if(!t.valid||!v)return;if(!R&&!M)return;if(!(A||B||s||l||c))return;0===g||rt(g)&&g.every((t=>0===t))?(e.beginPath(),e.rect(i,o,_,S)):(e.beginPath(),xh(e,i,o,_,S,g));const T={doFill:R,doStroke:M};e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,h),this.beforeRenderStep(t,e,i,o,R,M,A,B,h,n,s,l,T),T.doFill&&(s?s(e,t.attribute,h):A&&(e.setCommonStyle(t,t.attribute,w-i,x-o,h),e.fill())),T.doStroke&&(l?l(e,t.attribute,h):B&&(e.setStrokeStyle(t,t.attribute,w-i,x-o,h),e.stroke())),this.afterRenderStep(t,e,i,o,R,M,A,B,h,n,s,l)}draw(t,e,i,o){const n=_n(t,null==o?void 0:o.theme).rect;this.tempTheme=n,this._draw(t,n,!1,i,o),this.tempTheme=null}};cd=ad([y(),dd(0,b(z)),dd(0,C(Vs)),hd("design:paramtypes",[Object])],cd);var ud=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s},gd=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},pd=function(t,e){return function(i,o){e(i,o,t)}};let fd=class extends eh{constructor(t){super(),this.symbolRenderContribitions=t,this.numberType=ns,this.builtinContributions=[Eh,Hh,Lh],this.init(t)}drawShape(t,e,i,o,n,r,s,l){var a;const h=_n(t,null==r?void 0:r.theme).symbol,{size:d=h.size,x:c=h.x,y:u=h.y,scaleX:g=h.scaleX,scaleY:p=h.scaleY}=t.attribute,f=this.valid(t,h,s,l);if(!f)return;const{fVisible:m,sVisible:b,doFill:v,doStroke:y}=f,C=t.getParsedPath();if(!C)return;const{keepDirIn3d:w=h.keepDirIn3d}=t.attribute,x=null!==(a=this.z)&&void 0!==a?a:0;if(e.beginPath(),w&&e.camera&&e.project){const n=e.project(i,o,x),r=e.camera;e.camera=null,!1===C.draw(e,rt(d)?[d[0]*g,d[1]*p]:d*g,n.x,n.y,void 0,((n,r)=>{var a,d,f;if(t._parsedPath.svgCache){const e=Object.assign({},r);e.fill=null!==(a=r.fill)&&void 0!==a?a:t.attribute.fill,e.opacity=null!==(d=r.fill)&&void 0!==d?d:t.attribute.opacity,e.fillOpacity=t.attribute.fillOpacity,e.stroke=null!==(f=r.stroke)&&void 0!==f?f:t.attribute.stroke,r=e}r.fill&&(s?s(e,t.attribute,h):(e.setCommonStyle(t,r,c-i,u-o,h),e.fill())),r.stroke&&(l?l(e,t.attribute,h):(e.setStrokeStyle(t,r,(c-i)/g,(u-o)/p,h),e.stroke()))}))&&e.closePath(),e.camera=r}else!1===C.draw(e,d,i,o,x,((n,r)=>{var a,d,f;if(t._parsedPath.svgCache){const e=Object.assign({},r);e.fill=null!==(a=r.fill)&&void 0!==a?a:t.attribute.fill,e.opacity=null!==(d=r.opacity)&&void 0!==d?d:t.attribute.opacity,e.fillOpacity=t.attribute.fillOpacity,e.stroke=null!==(f=r.stroke)&&void 0!==f?f:t.attribute.stroke,r=e}r.fill&&(s?s(e,t.attribute,h):(e.setCommonStyle(t,r,c-i,u-o,h),e.fill())),r.stroke&&(l?l(e,t.attribute,h):(e.setStrokeStyle(t,r,(c-i)/g,(u-o)/p,h),e.stroke()))}))&&e.closePath();e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,h),this.beforeRenderStep(t,e,i,o,v,y,m,b,h,n,s,l),v&&!C.isSvg&&(s?s(e,t.attribute,h):m&&(e.setCommonStyle(t,t.attribute,c-i,u-o,h),e.fill())),y&&!C.isSvg&&(l?l(e,t.attribute,h):b&&(e.setStrokeStyle(t,t.attribute,(c-i)/g,(u-o)/p,h),e.stroke())),this.afterRenderStep(t,e,i,o,v,y,m,b,h,n,s,l)}draw(t,e,i,o){const n=_n(t,null==o?void 0:o.theme).symbol;this._draw(t,n,!1,i,o)}};fd=ud([y(),pd(0,b(z)),pd(0,C(Us)),gd("design:paramtypes",[Object])],fd);const md=new class{constructor(){this.pools=[];for(let t=0;t<10;t++)this.pools.push(new Ce)}allocate(t,e,i,o){if(!this.pools.length)return(new Ce).setValue(t,e,i,o);const n=this.pools.pop();return n.x1=t,n.y1=e,n.x2=i,n.y2=o,n}allocateByObj(t){if(!this.pools.length)return new Ce(t);const e=this.pools.pop();return e.x1=t.x1,e.y1=t.y1,e.x2=t.x2,e.y2=t.y2,e}free(t){this.pools.push(t)}get length(){return this.pools.length}release(){this.pools=[]}};const bd=new class extends hh{constructor(){super(...arguments),this.time=Pi.beforeFillStroke}drawShape(t,e,i,o,n,r,s,l,a,h,d,c){var u,g,p,f,m,b,v,y,C,w;const{backgroundMode:x=a.backgroundMode,backgroundFit:_=a.backgroundFit}=t.attribute;let S,{background:A}=t.attribute;if(!A)return;const B=()=>{"richtext"===t.type&&(e.restore(),e.save(),S&&e.setTransformFromMatrix(S,!0,1))};let R;"richtext"===t.type&&(S=e.currentMatrix.clone(),e.restore(),e.save(),e.setTransformForCurrent());const M=tt(A)&&A.background,T=t.transMatrix.onlyTranslate();if(M){const e=t.AABBBounds,i=(null!==(u=A.x)&&void 0!==u?u:e.x1)+(null!==(g=A.dx)&&void 0!==g?g:0),o=(null!==(p=A.y)&&void 0!==p?p:e.y1)+(null!==(f=A.dy)&&void 0!==f?f:0),n=null!==(m=A.width)&&void 0!==m?m:e.width(),r=null!==(b=A.height)&&void 0!==b?b:e.height();if(R=md.allocate(i,o,i+n,o+r),A=A.background,!T){const t=R.width(),e=R.height();R.set((null!==(v=A.x)&&void 0!==v?v:0)+(null!==(y=A.dx)&&void 0!==y?y:0),(null!==(C=A.y)&&void 0!==C?C:0)+(null!==(w=A.dy)&&void 0!==w?w:0),t,e)}}else R=t.AABBBounds,T||(R=Qa(Object.assign(Object.assign({},t.attribute),{angle:0,scaleX:1,scaleY:1,x:0,y:0,dx:0,dy:0})).clone());if(t.backgroundImg&&t.resources){const n=t.resources.get(A);if("success"!==n.state||!n.data)return void B();e.highPerformanceSave(),T&&e.setTransformFromMatrix(t.parent.globalTransMatrix,!0),e.setCommonStyle(t,t.attribute,i,o,a),this.doDrawImage(e,n.data,R,x,_),e.highPerformanceRestore(),e.setTransformForCurrent()}else{const{backgroundCornerRadius:n}=t.attribute;e.highPerformanceSave(),e.setCommonStyle(t,t.attribute,i,o,a),e.fillStyle=A,n?(xh(e,R.x1,R.y1,R.width(),R.height(),n),e.fill()):e.fillRect(R.x1,R.y1,R.width(),R.height()),e.highPerformanceRestore()}M&&md.free(R),B()}};var vd=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s},yd=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Cd=function(t,e){return function(i,o){e(i,o,t)}};let wd=class extends eh{constructor(t){super(),this.textRenderContribitions=t,this.numberType=rs,this.builtinContributions=[bd],this.init(t)}drawShape(t,e,i,o,n,r,s,l){var a,h,d;const c=_n(t,null==r?void 0:r.theme).text,{text:u,underline:g=c.underline,lineThrough:p=c.lineThrough,keepDirIn3d:f=c.keepDirIn3d,direction:m=c.direction,whiteSpace:b=c.whiteSpace,fontSize:v=c.fontSize,verticalMode:y=c.verticalMode,x:C=c.x,y:w=c.y}=t.attribute;let{textAlign:x=c.textAlign,textBaseline:_=c.textBaseline}=t.attribute;if(!y&&"vertical"===m){const e=x;x=null!==(a=t.getBaselineMapAlign()[_])&&void 0!==a?a:"left",_=null!==(h=t.getAlignMapBaseline()[e])&&void 0!==h?h:"top"}const S=null!==(d=ar(t.attribute.lineHeight,v))&&void 0!==d?d:v,A=this.valid(t,c,s,l);if(!A)return;const{fVisible:B,sVisible:R,doFill:M,doStroke:T}=A,k=!f,P=this.z||0;e.beginPath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,c),this.beforeRenderStep(t,e,i,o,M,T,B,R,c,n,s,l),k&&this.transformUseContext2d(t,c,P,e);const E=(n,r,a,h)=>{let d=i+r;const u=o+a;if(h){e.highPerformanceSave(),d+=v;const t=Na.allocate(1,0,0,1,0,0);t.rotateByCenter(Math.PI/2,d,u),e.transformFromMatrix(t,!0),Na.free(t)}T&&(l?l(e,t.attribute,c):R&&(e.setStrokeStyle(t,t.attribute,C-i,w-o,c),e.strokeText(n,d,u,P))),M&&(s?s(e,t.attribute,c):B&&(e.setCommonStyle(t,t.attribute,C-i,w-o,c),e.fillText(n,d,u,P),this.drawUnderLine(g,p,t,d,u,P,c,e))),h&&(e.highPerformanceRestore(),e.setTransformForCurrent())};if(t.isMultiLine)if(e.setTextStyleWithoutAlignBaseline(t.attribute,c,P),"horizontal"===m){const{multilineLayout:n}=t;if(!n)return void e.highPerformanceRestore();const{xOffset:r,yOffset:a}=n.bbox;T&&(l?l(e,t.attribute,c):R&&(e.setStrokeStyle(t,t.attribute,C-i,w-o,c),n.lines.forEach((t=>{e.strokeText(t.str,(t.leftOffset||0)+r+i,(t.topOffset||0)+a+o,P)})))),M&&(s?s(e,t.attribute,c):B&&(e.setCommonStyle(t,t.attribute,C-i,w-o,c),n.lines.forEach((n=>{var s,l;e.fillText(n.str,(n.leftOffset||0)+r+i,(n.topOffset||0)+a+o,P),this.drawMultiUnderLine(g,p,t,(n.leftOffset||0)+r+i,(n.topOffset||0)+a+o-(l=v,"top"===(s="bottom")?Math.ceil(.79*l):"middle"===s?Math.round(.3*l):"bottom"===s?Math.round(-.21*l):0)-.05*v,P,n.width,c,e)}))))}else{t.tryUpdateAABBBounds();const i=t.cache,{verticalList:o}=i;e.textAlign="left",e.textBaseline="top";const n=S*o.length;let r=0;o.forEach((t=>{const e=t.reduce(((t,e)=>t+(e.width||0)),0);r=ae(e,r)}));let s=0,l=0;"bottom"===_?l=-n:"middle"===_&&(l=-n/2),"center"===x?s-=r/2:"right"===x&&(s-=r),o.forEach(((t,e)=>{const i=t.reduce(((t,e)=>t+(e.width||0)),0),o=r-i;let a=s;"center"===x?a+=o/2:"right"===x&&(a+=o),t.forEach((t=>{const{text:i,width:o,direction:r}=t;E(i,n-(e+1)*S+l,a,r),a+=o}))}))}else if("horizontal"===m){e.setTextStyle(t.attribute,c,P);const i=t.clipedText;let o=0;S!==v&&("top"===_?o=(S-v)/2:"middle"===_||"bottom"===_&&(o=-(S-v)/2)),E(i,0,o,0)}else{t.tryUpdateAABBBounds();const i=t.cache;if(i){e.setTextStyleWithoutAlignBaseline(t.attribute,c,P);const{verticalList:o}=i;let n=0;const r=o[0].reduce(((t,e)=>t+(e.width||0)),0);let s=0;"bottom"===_?s=-S:"middle"===_&&(s=-S/2),"center"===x?n-=r/2:"right"===x&&(n-=r),e.textAlign="left",e.textBaseline="top",o[0].forEach((t=>{const{text:e,width:i,direction:o}=t;E(e,s,n,o),n+=i}))}}k&&this.restoreTransformUseContext2d(t,c,P,e),this.afterRenderStep(t,e,i,o,M,T,B,R,c,n,s,l)}draw(t,e,i,o){const n=_n(t,null==o?void 0:o.theme).text,{keepDirIn3d:r=n.keepDirIn3d}=t.attribute,s=!r;this._draw(t,n,s,i,o)}drawUnderLine(t,e,i,o,n,r,s,l){if(e+t<=0)return;const{textAlign:a=s.textAlign,textBaseline:h=s.textBaseline,fontSize:d=s.fontSize,fill:c=s.fill,opacity:u=s.opacity,underlineOffset:g=s.underlineOffset,underlineDash:p=s.underlineDash,fillOpacity:f=s.fillOpacity}=i.attribute,m=i.clipedWidth,b=Js(a,m),v=Qs(h,d,d),y={lineWidth:0,stroke:c,opacity:u,strokeOpacity:f};if(t){y.lineWidth=t,l.setStrokeStyle(i,y,o,n,s),p&&l.setLineDash(p),l.beginPath();const e=n+v+d+g;l.moveTo(o+b,e,r),l.lineTo(o+b+m,e,r),l.stroke()}if(e){y.lineWidth=e,l.setStrokeStyle(i,y,o,n,s),l.beginPath();const t=n+v+d/2;l.moveTo(o+b,t,r),l.lineTo(o+b+m,t,r),l.stroke()}}drawMultiUnderLine(t,e,i,o,n,r,s,l,a){if(e+t<=0)return;const{fontSize:h=l.fontSize,fill:d=l.fill,opacity:c=l.opacity,underlineOffset:u=l.underlineOffset,underlineDash:g=l.underlineDash,fillOpacity:p=l.fillOpacity}=i.attribute,f=Qs("alphabetic",h,h),m={lineWidth:0,stroke:d,opacity:c,strokeOpacity:p};let b=-3;if(t){m.lineWidth=t,a.setStrokeStyle(i,m,o,n,l),g&&a.setLineDash(g),a.beginPath();const e=n+f+h+b+u;a.moveTo(o+0,e,r),a.lineTo(o+0+s,e,r),a.stroke()}if(b=-1,e){m.lineWidth=e,a.setStrokeStyle(i,m,o,n,l),a.beginPath();const t=n+f+h/2+b;a.moveTo(o+0,t,r),a.lineTo(o+0+s,t,r),a.stroke()}}};function xd(t,e,i,o){t.moveTo(e[0].x+i,e[0].y+o);for(let n=1;n<e.length;n++)t.lineTo(e[n].x+i,e[n].y+o)}function _d(t,e){return Math.sqrt(t*t+e*e)}function Sd(t,e,i,o,n){const r=e/i;return{x:t.x-o*r,y:t.y-n*r}}wd=vd([y(),Cd(0,b(z)),Cd(0,C($s)),yd("design:paramtypes",[Object])],wd);const Ad=gh,Bd=dh;var Rd=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s},Md=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Td=function(t,e){return function(i,o){e(i,o,t)}};let kd=class extends eh{constructor(t){super(),this.polygonRenderContribitions=t,this.numberType=es,this.builtinContributions=[Bd,Ad],this.init(t)}drawShape(t,e,i,o,n,r,s,l){const a=_n(t,null==r?void 0:r.theme).polygon,{points:h=a.points,cornerRadius:d=a.cornerRadius,x:c=a.x,y:u=a.y,closePath:g=a.closePath}=t.attribute,p=this.valid(t,a,s,l);if(!p)return;const{fVisible:f,sVisible:m,doFill:b,doStroke:v}=p;e.beginPath(),d<=0||rt(d)&&d.every((t=>0===t))?xd(e.camera?e:e.nativeContext,h,i,o):function(t,e,i,o,n){let r=!(arguments.length>5&&void 0!==arguments[5])||arguments[5];var s;if(e.length<3)return void xd(t,e,i,o);let l=0,a=e.length-1;r||(l+=1,a-=1,t.moveTo(e[0].x+i,e[0].y+o));for(let r=l;r<=a;r++){const l=e[0===r?a:(r-1)%e.length],h=e[r%e.length],d=e[(r+1)%e.length],c=h.x-l.x,u=h.y-l.y,g=h.x-d.x,p=h.y-d.y,f=(Math.atan2(u,c)-Math.atan2(p,g))/2,m=Math.abs(Math.tan(f));let b=Array.isArray(n)?null!==(s=n[r%e.length])&&void 0!==s?s:0:n,v=b/m;const y=_d(c,u),C=_d(g,p),w=Math.min(y,C);v>w&&(v=w,b=w*m);const x=Sd(h,v,y,c,u),_=Sd(h,v,C,g,p),S=2*h.x-x.x-_.x,A=2*h.y-x.y-_.y,B=_d(S,A),R=Sd(h,_d(v,b),B,S,A);let M=Math.atan2(x.y-R.y,x.x-R.x);const T=Math.atan2(_.y-R.y,_.x-R.x);let k=T-M;k<0&&(M=T,k=-k),k>Math.PI&&(k-=Math.PI),0===r?t.moveTo(x.x+i,x.y+o):t.lineTo(x.x+i,x.y+o),k&&t.arcTo(h.x+i,h.y+o,_.x+i,_.y+o,b),t.lineTo(_.x+i,_.y+o)}r||t.lineTo(e[a+1].x+i,e[a+1].y+o)}(e.camera?e:e.nativeContext,h,i,o,d,g),g&&e.closePath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,a),this.beforeRenderStep(t,e,i,o,b,v,f,m,a,n,s,l),b&&(s?s(e,t.attribute,a):f&&(e.setCommonStyle(t,t.attribute,c-i,u-o,a),e.fill())),v&&(l?l(e,t.attribute,a):m&&(e.setStrokeStyle(t,t.attribute,c-i,u-o,a),e.stroke())),this.afterRenderStep(t,e,i,o,b,v,f,m,a,n,s,l)}draw(t,e,i,o){const n=_n(t,null==o?void 0:o.theme).polygon;this._draw(t,n,!1,i,o)}};kd=Rd([y(),Td(0,b(z)),Td(0,C(js)),Md("design:paramtypes",[Object])],kd);var Pd=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s},Ed=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Ld=function(t,e){return function(i,o){e(i,o,t)}};const Hd=["","repeat-x","repeat-y","repeat"];let zd=class extends eh{constructor(t){super(),this.imageRenderContribitions=t,this.numberType=Jr,this.builtinContributions=[kh,Ph],this.init(t)}drawShape(t,e,i,o,n,r,s,l){const a=_n(t).image,{width:h=a.width,height:d=a.height,repeatX:c=a.repeatX,repeatY:u=a.repeatY,x:g=a.x,y:p=a.y,cornerRadius:f=a.cornerRadius,image:m}=t.attribute,b=this.valid(t,a,s);if(!b)return;const{fVisible:v,sVisible:y,doFill:C,doStroke:w}=b;if(e.setShadowBlendStyle&&e.setShadowBlendStyle(t,a),this.beforeRenderStep(t,e,i,o,C,!1,v,!1,a,n,s),C)if(s)s(e,t.attribute,a);else if(v){if(!m||!t.resources)return;const n=t.resources.get(m);if("success"!==n.state)return;let r=!1;0===f||rt(f)&&f.every((t=>0===t))||(e.beginPath(),xh(e,i,o,h,d,f),e.save(),e.clip(),r=!0),e.setCommonStyle(t,t.attribute,i,o,a);let s=0;if("repeat"===c&&(s|=1),"repeat"===u&&(s|=2),s){const t=e.createPattern(n.data,Hd[s]);e.fillStyle=t,e.translate(i,o,!0),e.fillRect(0,0,h,d),e.translate(-i,-o,!0)}else e.drawImage(n.data,i,o,h,d);r&&e.restore()}w&&(l?l(e,t.attribute,a):y&&(e.setStrokeStyle(t,t.attribute,g-i,p-o,a),e.stroke())),this.afterRenderStep(t,e,i,o,C,!1,v,!1,a,n,s)}draw(t,e,i){const{image:o}=t.attribute;if(!o||!t.resources)return;const n=t.resources.get(o);if("loading"===n.state&&nt(o))return void br.improveImageLoading(o);if("success"!==n.state)return;const{context:r}=e.drawParams;if(!r)return;const s=_n(t).image;this._draw(t,s,!1,i)}};zd=Pd([y(),Ld(0,b(z)),Ld(0,C(Ns)),Ed("design:paramtypes",[Object])],zd);const Fd=Symbol.for("IncrementalDrawContribution"),Id=Symbol.for("ArcRender"),Od=Symbol.for("CircleRender"),Dd=Symbol.for("GraphicRender"),Wd=Symbol.for("GroupRender"),Nd=Symbol.for("LineRender"),Gd=Symbol.for("PathRender"),jd=Symbol.for("PolygonRender"),Vd=Symbol.for("RectRender"),Ud=Symbol.for("SymbolRender"),$d=Symbol.for("TextRender"),Xd=Symbol.for("RichTextRender"),Yd=Symbol.for("ImageRender"),Kd=Symbol.for("DrawContribution");var qd=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s},Zd=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};const Jd=Symbol.for("DrawItemInterceptor"),Qd=new Ce,tc=new Ce;class ec{constructor(){this.order=1}afterDrawItem(t,e,i,o,n){return(t.attribute.shadowRootIdx>0||!t.attribute.shadowRootIdx)&&this.drawItem(t,e,i,o,n),!1}beforeDrawItem(t,e,i,o,n){return t.attribute.shadowRootIdx<0&&this.drawItem(t,e,i,o,n),!1}drawItem(t,e,i,o,n){if(!t.shadowRoot)return!1;const{context:r}=i;if(r.highPerformanceSave(),r.transformFromMatrix(t.transMatrix,!0),o.dirtyBounds&&o.backupDirtyBounds){Qd.copy(o.dirtyBounds),tc.copy(o.backupDirtyBounds);const e=t.globalTransMatrix.getInverse();o.dirtyBounds.copy(o.backupDirtyBounds).transformWithMatrix(e),o.backupDirtyBounds.copy(o.dirtyBounds)}return o.renderGroup(t.shadowRoot,i,t.parent.globalTransMatrix),r.highPerformanceRestore(),o.dirtyBounds&&o.backupDirtyBounds&&(o.dirtyBounds.copy(Qd),o.backupDirtyBounds.copy(tc)),!0}}class ic{constructor(){this.order=1}afterDrawItem(t,e,i,o,n){return t.attribute._debug_bounds&&this.drawItem(t,e,i,o,n),!1}drawItem(t,e,i,o,n){if(!t.attribute._debug_bounds)return!1;const{context:r}=i;r.highPerformanceSave(),t.parent&&r.setTransformFromMatrix(t.parent.globalTransMatrix,!0),t.glyphHost&&t.glyphHost.parent&&r.setTransformFromMatrix(t.glyphHost.parent.globalTransMatrix,!0);const s=t.AABBBounds;return!0!==t.attribute._debug_bounds&&t.attribute._debug_bounds(r,t),r.strokeRect(s.x1,s.y1,s.width(),s.height()),r.highPerformanceRestore(),!0}}let oc=class{constructor(){this.order=1,this.interceptors=[new ec,new rc,new nc,new ic]}afterDrawItem(t,e,i,o,n){for(let r=0;r<this.interceptors.length;r++)if(this.interceptors[r].afterDrawItem&&this.interceptors[r].afterDrawItem(t,e,i,o,n))return!0;return!1}beforeDrawItem(t,e,i,o,n){if((!t.in3dMode||i.in3dInterceptor)&&!t.shadowRoot&&!(t.baseGraphic||t.attribute.globalZIndex||t.interactiveGraphic))return!1;for(let r=0;r<this.interceptors.length;r++)if(this.interceptors[r].beforeDrawItem&&this.interceptors[r].beforeDrawItem(t,e,i,o,n))return!0;return!1}};oc=qd([y(),Zd("design:paramtypes",[])],oc);class nc{constructor(){this.order=1}beforeDrawItem(t,e,i,o,n){return!this.processing&&(t.baseGraphic?this.beforeDrawInteractive(t,e,i,o,n):this.beforeSetInteractive(t,e,i,o,n))}beforeSetInteractive(t,e,i,o,n){let r=t.interactiveGraphic;if(t.attribute.globalZIndex){r||(r=t.clone(),t.interactiveGraphic=r,r.baseGraphic=t),r.setAttributes({globalZIndex:0,zIndex:t.attribute.globalZIndex},!1,{skipUpdateCallback:!0}),i.stage.tryInitInteractiveLayer();const e=i.stage.getLayer("_builtin_interactive");return e&&this.getShadowRoot(e).add(r),!0}if(r){i.stage.tryInitInteractiveLayer();const e=i.stage.getLayer("_builtin_interactive");e&&this.getShadowRoot(e).removeChild(r),t.interactiveGraphic=null,r.baseGraphic=null}return!1}beforeDrawInteractive(t,e,i,o,n){const r=t.baseGraphic;if(!r.stage){const e=i.stage.getLayer("_builtin_interactive");return e&&this.getShadowRoot(e).removeChild(t),!0}if(r){this.processing=!0;const{context:t}=i;return t.highPerformanceSave(),t.setTransformFromMatrix(r.parent.globalTransMatrix,!0),r.isContainer?o.renderGroup(r,i,r.parent.globalTransMatrix):o.renderItem(r,i),t.highPerformanceRestore(),this.processing=!1,!0}return!1}getShadowRoot(t){var e;let i=t.getElementById("_interactive_group");return i||(i=Za.CreateGraphic("group",{}),i.id="_interactive_group",t.add(i)),null!==(e=i.shadowRoot)&&void 0!==e?e:i.attachShadow()}}class rc{constructor(){this.order=1}beforeDrawItem(t,e,i,o,n){if(!t.in3dMode||i.in3dInterceptor)return!1;i.in3dInterceptor=!0;const{context:r,stage:s}=e.drawParams;r.canvas,r.save(),this.initCanvasCtx(r),r.camera=s.camera;const l=r.currentMatrix;l.a/=r.dpr,l.b/=r.dpr,l.c/=r.dpr,l.d/=r.dpr,l.e/=r.dpr,l.f/=r.dpr;const a=Ga.allocate();Xa(a,l);const h=r.modelMatrix;if(h){if(a){const t=Ga.allocate();r.modelMatrix=Ya(t,h,a)}}else r.modelMatrix=a;if(r.setTransform(1,0,0,1,0,0,!0),t.isContainer){let e=!1,n=!1;if(t.forEachChildren((t=>(e=t.numberType===Yr,!e))),t.forEachChildren((t=>(n=!!t.findFace,!n))),e){const e=t.getChildren(),n=[...e];n.sort(((t,e)=>{var i,o,n,r;let s=((null!==(i=t.attribute.startAngle)&&void 0!==i?i:0)+(null!==(o=t.attribute.endAngle)&&void 0!==o?o:0))/2,l=((null!==(n=e.attribute.startAngle)&&void 0!==n?n:0)+(null!==(r=e.attribute.endAngle)&&void 0!==r?r:0))/2;for(;s<0;)s+=ne;for(;l<0;)l+=ne;return l-s})),n.forEach((t=>{t._next=null,t._prev=null})),t.removeAllChild(),t.update(),n.forEach((e=>{t.appendChild(e)}));const r=t.parent.globalTransMatrix;i.hack_pieFace="outside",o.renderGroup(t,i,r),i.hack_pieFace="inside",o.renderGroup(t,i,r),i.hack_pieFace="top",o.renderGroup(t,i,r),t.removeAllChild(),e.forEach((t=>{t._next=null,t._prev=null})),e.forEach((e=>{t.appendChild(e)}))}else if(n){const e=t.getChildren(),n=e.map((t=>({ave_z:t.findFace().vertices.map((e=>{var i;return r.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})));n.sort(((t,e)=>e.ave_z-t.ave_z)),t.removeAllChild(),n.forEach((t=>{t.g._next=null,t.g._prev=null})),t.update(),n.forEach((e=>{t.add(e.g)})),o.renderGroup(t,i,t.parent.globalTransMatrix,!0),t.removeAllChild(),e.forEach((t=>{t._next=null,t._prev=null})),t.update(),e.forEach((e=>{t.add(e)}))}else o.renderGroup(t,i,t.parent.globalTransMatrix)}else o.renderItem(t,i);return r.camera=null,r.restore(),r.modelMatrix!==h&&Ga.free(r.modelMatrix),r.modelMatrix=h,i.in3dInterceptor=!1,!0}initCanvasCtx(t){t.setTransformForCurrent()}}var sc=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s},lc=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},ac=function(t,e){return function(i,o){e(i,o,t)}};const hc=Symbol.for("RenderService");let dc=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),this.drawParams=null}};dc=sc([y(),ac(0,b(Kd)),lc("design:paramtypes",[Object])],dc);var cc=new s((t=>{t(hc).to(dc)}));const uc=Symbol.for("PickerService"),gc=Symbol.for("GlobalPickerService");var pc=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s};const fc=Symbol.for("PickItemInterceptor");let mc=class{constructor(){this.order=1}afterPickItem(t,e,i,o,n){return t.attribute.shadowRootIdx>0||!t.attribute.shadowRootIdx?this._pickItem(t,e,i,o,n):null}beforePickItem(t,e,i,o,n){return t.attribute.shadowRootIdx<0?this._pickItem(t,e,i,o,n):null}_pickItem(t,e,i,o,n){if(!t.shadowRoot)return null;const{parentMatrix:r}=n||{};if(!r)return null;const s=e.pickContext;s.highPerformanceSave();const l=t.shadowRoot,a=Na.allocateByObj(r),h=new me(a.a*i.x+a.c*i.y+a.e,a.b*i.x+a.d*i.y+a.f),d=e.pickGroup(l,h,a,o);return s.highPerformanceRestore(),d}};mc=pc([y()],mc);let bc=class{constructor(){this.order=1}beforePickItem(t,e,i,o,n){const r=t.baseGraphic;if(r&&r.parent){const t=new me(i.x,i.y),n=e.pickContext;n.highPerformanceSave();const s=r.parent.globalTransMatrix;s.transformPoint(t,t);const l=r.isContainer?e.pickGroup(r,t.clone(),s,o):e.pickItem(r,t.clone(),s,o);return n.highPerformanceRestore(),l}return null}};bc=pc([y()],bc);let vc=class{constructor(){this.order=1}beforePickItem(t,e,i,o,n){if(!t.in3dMode||o.in3dInterceptor)return null;const r=e.pickContext,s=t.stage;if(!r||!s)return null;if(o.in3dInterceptor=!0,r.save(),this.initCanvasCtx(r),r.camera=s.camera,t.isContainer){let s,l=!1,a=!1;if(t.forEachChildren((t=>(l=t.numberType===Yr,!l))),t.forEachChildren((t=>(a=!!t.findFace,!a))),l){const r=t.getChildren(),l=[...r];l.sort(((t,e)=>{var i,o,n,r;let s=(null!==(o=null!==(i=t.attribute.startAngle)&&void 0!==i?i:0+t.attribute.endAngle)&&void 0!==o?o:0)/2,l=(null!==(r=null!==(n=e.attribute.startAngle)&&void 0!==n?n:0+e.attribute.endAngle)&&void 0!==r?r:0)/2;for(;s<0;)s+=ne;for(;l<0;)l+=ne;return l-s})),l.forEach((t=>{t._next=null,t._prev=null})),t.removeAllChild(),t.update(),l.forEach((e=>{t.appendChild(e)})),o.hack_pieFace="outside",s=e.pickGroup(t,i,n.parentMatrix,o),s.graphic||(o.hack_pieFace="inside",s=e.pickGroup(t,i,n.parentMatrix,o)),s.graphic||(o.hack_pieFace="top",s=e.pickGroup(t,i,n.parentMatrix,o)),t.removeAllChild(),r.forEach((t=>{t._next=null,t._prev=null})),r.forEach((e=>{t.appendChild(e)}))}else if(a){const l=t.getChildren(),a=l.map((t=>({ave_z:t.findFace().vertices.map((e=>{var i;return r.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})));a.sort(((t,e)=>e.ave_z-t.ave_z)),t.removeAllChild(),a.forEach((t=>{t.g._next=null,t.g._prev=null})),t.update(),a.forEach((e=>{t.add(e.g)})),s=e.pickGroup(t,i,n.parentMatrix,o),t.removeAllChild(),l.forEach((t=>{t._next=null,t._prev=null})),t.update(),l.forEach((e=>{t.add(e)}))}else s=e.pickGroup(t,i,n.parentMatrix,o);return r.camera=null,o.in3dInterceptor=!1,r.restore(),s}return r.restore(),null}initCanvasCtx(t){t.setTransformForCurrent()}};vc=pc([y()],vc);var yc=new s(((t,e,i)=>{i(uc)||(t(gc).toSelf(),t(uc).toService(gc)),t(vc).toSelf().inSingletonScope(),t(fc).toService(vc),t(mc).toSelf().inSingletonScope(),t(fc).toService(mc),t(bc).toSelf().inSingletonScope(),t(fc).toService(bc),I(t,fc)})),Cc=new s((t=>{t(ss).to(qa).inSingletonScope(),t(ls).toConstantValue(Za)}));const wc=Symbol.for("AutoEnablePlugins"),xc=Symbol.for("PluginService");var _c=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s},Sc=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Ac=function(t,e){return function(i,o){e(i,o,t)}};let Bc=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&&Qo.isBound(wc)&&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(){this.onStartupFinishedPlugin.forEach((t=>{t.deactivate(this)})),this.onStartupFinishedPlugin=[],this.onRegisterPlugin.forEach((t=>{t.deactivate(this)})),this.onRegisterPlugin=[]}};Bc=_c([y(),Ac(0,b(z)),Ac(0,C(wc)),Sc("design:paramtypes",[Object])],Bc);var Rc=new s((t=>{t(xc).to(Bc),function(t,e){t(z).toDynamicValue((t=>{let{container:i}=t;return new F(e,i)})).whenTargetNamed(e)}(t,wc)})),Mc=new s((t=>{I(t,W)})),Tc=new s((t=>{t(Zo).to(Jo).inSingletonScope(),I(t,Zo)})),kc=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s},Pc=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let Ec=class{constructor(){this.type="static",this.offscreen=!1,this.global=Oo.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 o=e.getContext().getCanvas().nativeCanvas,n=on({nativeCanvas:t,width:e.width,height:e.height,dpr:e.dpr,id:i.canvasId,canvasControled:!0,container:e.getContainer(),x:o.offsetLeft,y:o.offsetTop});n.applyPosition(),this.canvas=n,this.context=n.getContext()}}resize(t,e){this.canvas.resize(t,e)}resizeView(t,e){}render(t,e,i){var o;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!==(o=e.background)&&void 0!==o?o:"#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 o;const n=t.getContext();i.renderService.render(e,Object.assign(Object.assign({context:n},i),{clear:i.clear?null!==(o=i.background)&&void 0!==o?o:"#fff":void 0}))}getContext(){return this.context}release(){this.canvas.release()}};Ec=kc([y(),Pc("design:paramtypes",[])],Ec);var Lc=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s},Hc=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let zc=class{constructor(){this.offscreen=!1,this.type="virtual",this.global=Oo.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 o;const n=t.getContext();i.renderService.render(e,Object.assign(Object.assign({context:n},i),{clear:i.clear?null!==(o=i.background)&&void 0!==o?o:"#fff":void 0}))}getContext(){return null}release(){}};zc=Lc([y(),Hc("design:paramtypes",[])],zc);var Fc=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s},Ic=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let Oc=class{constructor(){this.offscreen=!0,this.type="dynamic",this.global=Oo.global}setDpr(t){this.canvas.dpr=t}init(t,e,i){this.layer=t;const o=on({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=o,this.context=o.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,viewBox:e.stage.window.getViewBox(),transMatrix:e.stage.window.getViewBoxTransform()},e),{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 o=t.getContext(),n=t.dpr,{viewBox:r}=i,s=r.x1,l=r.y1,a=r.width(),h=r.height();o.nativeContext.save(),o.nativeContext.setTransform(n,0,0,n,0,0),i.clear&&o.clearRect(s,l,a,h),o.drawImage(this.canvas.nativeCanvas,0,0,this.canvas.width,this.canvas.height,s,l,a,h),o.nativeContext.restore()}merge(t){}};Oc=Fc([y(),Ic("design:paramtypes",[])],Oc);var Dc=new s((t=>{t(Ec).toSelf(),t(Oc).toSelf(),t(zc).toSelf(),t(bs).toService(Ec),t(vs).toService(Oc),t(ys).toService(zc)}));var Wc=function(t,e,i,o){return new(i||(i=Promise))((function(n,r){function s(t){try{a(o.next(t))}catch(t){r(t)}}function l(t){try{a(o.throw(t))}catch(t){r(t)}}function a(t){var e;t.done?n(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(s,l)}a((o=o.apply(t,e||[])).next())}))};function Nc(t,e,i){let o=arguments.length>3&&void 0!==arguments[3]&&arguments[3],n=arguments.length>4&&void 0!==arguments[4]&&arguments[4];const r={},s=[];let l=!1;if(n)l=!0;else{let i;t.forEachChildren(((t,o)=>{const{zIndex:n=e}=t.attribute;if(0===o)i=n;else if(i!==n)return l=!0,!0;return!1}),o)}if(l){t.forEachChildren((t=>{const{zIndex:i=e}=t.attribute;r[i]?r[i].push(t):(r[i]=[t],s.push(i))}),o),s.sort(((t,e)=>o?e-t:t-e));let l=!1;for(let t=0;t<s.length&&!l;t++){const e=s[t],a=r[e];n&&a.sort(((t,e)=>{var i,n;return(o?-1:1)*((null!==(i=e.attribute.z)&&void 0!==i?i:0)-(null!==(n=t.attribute.z)&&void 0!==n?n:0))}));for(let t=0;t<a.length;t++)if(i(a[t],t)){l=!0;break}}}else t.forEachChildren(i,o)}function Gc(t,e,i){let o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return Wc(this,void 0,void 0,(function*(){yield t.forEachChildrenAsync(i,o)}))}function jc(t,e,i){let o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const n={},r=[];let s=!1;t.forEachChildren(((t,e)=>{const{zIndex:o=i}=t.attribute;if(0===e);else if(void 0!==o)return s=!0,!0;return!1}),o);let l=null,a=!1;if(s){t.forEachChildren((t=>{const{zIndex:e=i}=t.attribute;n[e]?n[e].push(t):(n[e]=[t],r.push(e))}),o),r.sort(((t,e)=>o?e-t:t-e));let s=!1;for(let t=0;t<r.length&&!s;t++){const i=r[t],o=n[i];for(let t=0;t<o.length;t++){if(a){s=!0,l=o[t];break}o[t]._uid!==e||(a=!0)}}}else t.forEachChildren((t=>a?(l=t,!0):(t._uid===e&&(a=!0),!1)),o);return l}var Vc=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s},Uc=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},$c=function(t,e){return function(i,o){e(i,o,t)}};let Xc=class{constructor(t,e){this.contributions=t,this.drawItemInterceptorContributions=e,this.currentRenderMap=new Map,this.defaultRenderMap=new Map,this.styleRenderMap=new Map,this.dirtyBounds=new ye,this.backupDirtyBounds=new ye,this.global=Oo.global,this.layerService=Oo.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,e){this.prepareForDraw(t,e),e.drawContribution=this,this.currentRenderMap=this.styleRenderMap.get(e.renderStyle)||this.defaultRenderMap,this.currentRenderService=t;const{context:i,stage:o,viewBox:n,transMatrix:r}=e;if(!i)return;const s=this.dirtyBounds.setValue(0,0,n.width(),n.height());if(o.dirtyBounds&&!o.dirtyBounds.empty()){const t=$e(s,o.dirtyBounds,!1);s.x1=Math.floor(t.x1),s.y1=Math.floor(t.y1),s.x2=Math.ceil(t.x2),s.y2=Math.ceil(t.y2)}const l=i.dpr%1;(l||.5!==l)&&(s.x1=Math.floor(s.x1*i.dpr)/i.dpr,s.y1=Math.floor(s.y1*i.dpr)/i.dpr,s.x2=Math.ceil(s.x2*i.dpr)/i.dpr,s.y2=Math.ceil(s.y2*i.dpr)/i.dpr),this.backupDirtyBounds.copy(s),i.inuse=!0,i.setClearMatrix(r.a,r.b,r.c,r.d,r.e,r.f),i.clearMatrix(),i.setTransformForCurrent(!0),i.translate(n.x1,n.y1,!0),i.beginPath(),i.rect(s.x1,s.y1,s.width(),s.height()),i.clip(),o.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,i,e),i.save(),t.renderTreeRoots.sort(((t,e)=>{var i,o;return(null!==(i=t.attribute.zIndex)&&void 0!==i?i:_o.zIndex)-(null!==(o=e.attribute.zIndex)&&void 0!==o?o:_o.zIndex)})).forEach((t=>{t.isContainer?this.renderGroup(t,e,Na.allocate(1,0,0,1,0,0)):this.renderItem(t,e)})),i.restore(),i.setClearMatrix(1,0,0,1,0,0),i.inuse=!1,i.draw()}doRegister(){throw new Error("暂不支持")}_findNextGraphic(t){let e=t.parent,i=t._uid;for(;e;){const t=jc(e,i,_o.zIndex);if(t)return t;i=e._uid,e=e.parent}return null}renderGroup(t,e,i,o){if(e.break||!1===t.attribute.visibleAll)return;if(t.incremental&&(null==e.startAtId||e.startAtId===t._uid))return e.break=!0,void this._increaseRender(t,e);if(this.useDirtyBounds&&!Ye(t.AABBBounds,this.dirtyBounds,!1))return;let n,r=i;if(this.useDirtyBounds){n=md.allocateByObj(this.dirtyBounds);const e=t.transMatrix;r=Na.allocateByObj(i).multiply(e.a,e.b,e.c,e.d,e.e,e.f),this.dirtyBounds.copy(this.backupDirtyBounds).transformWithMatrix(r.getInverse())}this.renderItem(t,e,{drawingCb:()=>{var i;o?t.forEachChildren((t=>{e.break||(t.isContainer?this.renderGroup(t,e,r):this.renderItem(t,e))})):Nc(t,_o.zIndex,(t=>{e.break||(t.isContainer?this.renderGroup(t,e,r):this.renderItem(t,e))}),!1,!!(null===(i=e.context)||void 0===i?void 0:i.camera))}}),this.useDirtyBounds&&(this.dirtyBounds.copy(n),md.free(n),Na.free(r))}_increaseRender(t,e){const{layer:i,stage:o}=e,{subLayers:n}=i;let r=n.get(t._uid);r||(r={layer:this.layerService.createLayer(o),zIndex:n.size,group:t},n.set(t._uid,r));const s=r.layer.getNativeHandler().getContext(),l=r.drawContribution||Qo.get(Fd);l.dirtyBounds.setValue(-1/0,-1/0,1/0,1/0),l.backupDirtyBounds.setValue(-1/0,-1/0,1/0,1/0),l.draw(this.currentRenderService,Object.assign(Object.assign({},e),{drawContribution:l,clear:"transparent",layer:r.layer,context:s,startAtId:t._uid,break:!1})),r.drawContribution=l;const a=this._findNextGraphic(t);if(a)if(a.isContainer&&a.incremental)this._increaseRender(a,e);else{let t=n.get(a._uid);t||(t={layer:this.layerService.createLayer(o),zIndex:n.size},n.set(a._uid,t));const i=t.layer.getNativeHandler().getContext();this.draw(this.currentRenderService,Object.assign(Object.assign({},e),{drawContribution:l,clear:"transparent",layer:t.layer,context:i,startAtId:a._uid,break:!1}))}}getRenderContribution(t){let e;return e||(e=this.selectRenderByNumberType(t.numberType,t)),e||(e=this.selectRenderByType(t.type)),e}renderItem(t,e,i){if(this.InterceptorContributions.length)for(let o=0;o<this.InterceptorContributions.length;o++){const n=this.InterceptorContributions[o];if(n.beforeDrawItem&&n.beforeDrawItem(t,this.currentRenderService,e,this,i))return}const o=this.getRenderContribution(t);if(!o)return;let n,r=!1;if(t.parent){const{scrollX:e=0,scrollY:i=0}=t.parent.attribute;if(r=!(!e&&!i),r){n=this.dirtyBounds.clone();const o=t.globalTransMatrix.getInverse();this.dirtyBounds.copy(this.backupDirtyBounds).transformWithMatrix(o),this.dirtyBounds.translate(-e,-i)}}if(this.useDirtyBounds&&!t.isContainer&&!Ye(t.AABBBounds,this.dirtyBounds,!1))return void(r&&this.dirtyBounds.copy(n));const s=null!=e.startAtId&&t._uid!==e.startAtId;if(t._uid===e.startAtId&&(e.startAtId=null),i&&(i.skipDraw=s),s?t.isContainer&&o.draw(t,this.currentRenderService,e,i):o.draw(t,this.currentRenderService,e,i),r&&this.dirtyBounds.copy(n),this.InterceptorContributions.length)for(let i=0;i<this.InterceptorContributions.length;i++){const o=this.InterceptorContributions[i];if(o.afterDrawItem&&o.afterDrawItem(t,this.currentRenderService,e,this))return}}selectRenderByType(t){return Wt.getInstance().warn("未知错误,不应该走到这里"),null}selectRenderByNumberType(t,e){let i;if(e.attribute.renderStyle){const o=this.styleRenderMap.get(e.attribute.renderStyle);i=o&&o.get(t)}return i||this.currentRenderMap.get(t)||this.defaultRenderMap.get(t)}clearScreen(t,e,i){var o,n;const{clear:r,viewBox:s}=i,l=s.width(),a=s.height();if(r){e.clearRect(0,0,l,a);const i=null===(o=t.drawParams)||void 0===o?void 0:o.stage;if(i&&(e.globalAlpha=null!==(n=i.attribute.opacity)&&void 0!==n?n:1),i&&i.backgroundImg&&i.resources){const t=i.resources.get(r);t&&"success"===t.state&&t.data&&e.drawImage(t.data,0,0,l,a)}else e.fillStyle=rh(e,r,{AABBBounds:{x1:0,y1:0,x2:0+l,y2:0+a}},0,0),e.fillRect(0,0,l,a)}}afterDraw(t,e){}};Xc=Vc([y(),$c(0,v(Dd)),$c(1,b(z)),$c(1,C(Jd)),Uc("design:paramtypes",[Array,Object])],Xc);var Yc=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s},Kc=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},qc=function(t,e){return function(i,o){e(i,o,t)}};let Zc=class{constructor(t){this.groupRenderContribitions=t,this.numberType=Zr}drawShape(t,e,i,o,n,r,s,l){const a=_n(t,null==r?void 0:r.theme).group,{fill:h=a.fill,background:d,stroke:c=a.stroke,opacity:u=a.opacity,width:g=a.width,height:p=a.height,clip:f=a.clip,fillOpacity:m=a.fillOpacity,strokeOpacity:b=a.strokeOpacity,cornerRadius:v=a.cornerRadius,path:y=a.path,lineWidth:C=a.lineWidth,visible:w=a.visible}=t.attribute,x=Ms(u,m,g,p,h),_=ks(u,b,g,p),S=As(h,d),A=Bs(c,C);if(!t.valid||!w)return;if(!f){if(!S&&!A)return;if(!(x||_||s||l||d))return}if(y&&y.length&&n.drawContribution){const t=e.disableFill,i=e.disableStroke,o=e.disableBeginPath;e.disableFill=!0,e.disableStroke=!0,e.disableBeginPath=!0,y.forEach((t=>{n.drawContribution.getRenderContribution(t).draw(t,n.renderService,n,r)})),e.disableFill=t,e.disableStroke=i,e.disableBeginPath=o}else 0===v||rt(v)&&v.every((t=>0===t))?(e.beginPath(),e.rect(i,o,g,p)):(e.beginPath(),xh(e,i,o,g,p,v));this._groupRenderContribitions||(this._groupRenderContribitions=this.groupRenderContribitions.getContributions()||[],this._groupRenderContribitions.push(Ch));const B={doFill:S,doStroke:A};this._groupRenderContribitions.forEach((r=>{r.time===Pi.beforeFillStroke&&r.drawShape(t,e,i,o,S,A,x,_,a,n,s,l,B)})),f&&e.clip(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,a),B.doFill&&(s?s(e,t.attribute,a):x&&(e.setCommonStyle(t,t.attribute,i,o,a),e.fill())),B.doStroke&&(l?l(e,t.attribute,a):_&&(e.setStrokeStyle(t,t.attribute,i,o,a),e.stroke())),this._groupRenderContribitions.forEach((r=>{r.time===Pi.afterFillStroke&&r.drawShape(t,e,i,o,S,A,x,_,a,n,s,l)}))}draw(t,e,i,o){const{context:n}=i;if(!n)return;const{clip:r,baseOpacity:s=1}=t.attribute;r?n.save():n.highPerformanceSave(),n.baseGlobalAlpha*=s;const l=_n(t,null==o?void 0:o.theme).group,a=n.modelMatrix;if(n.camera){const e=Ga.allocate(),i=Ga.allocate();Ka(i,t,l),Ya(e,a||e,i),n.modelMatrix=e,Ga.free(i),n.setTransform(1,0,0,1,0,0,!0)}else n.transformFromMatrix(t.transMatrix,!0);n.beginPath(),o.skipDraw?this.drawShape(t,n,0,0,i,o,(()=>!1),(()=>!1)):this.drawShape(t,n,0,0,i);const{scrollX:h=l.scrollX,scrollY:d=l.scrollY}=t.attribute;let c;(h||d)&&n.translate(h,d),o&&o.drawingCb&&(c=o.drawingCb()),n.modelMatrix!==a&&Ga.free(n.modelMatrix),n.modelMatrix=a,n.baseGlobalAlpha/=s,c&&c.then?c.then((()=>{r?n.restore():n.highPerformanceRestore()})):r?n.restore():n.highPerformanceRestore()}};Zc=Yc([y(),qc(0,b(z)),qc(0,C(Ws)),Kc("design:paramtypes",[Object])],Zc);var Jc=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s};let Qc=class extends $h{constructor(){super(...arguments),this.numberType=Qr}drawShape(t,e,i,o,n,r,s,l){if(t.incremental&&n.multiGraphicOptions){const{startAtIdx:e,length:r}=n.multiGraphicOptions,{segments:a=[]}=t.attribute;if(e>a.length)return;const h=_n(t).line,{fill:d=h.fill,stroke:c=h.stroke,opacity:u=h.opacity,fillOpacity:g=h.fillOpacity,strokeOpacity:p=h.strokeOpacity,lineWidth:f=h.lineWidth,visible:m=h.visible}=t.attribute,b=Rs(u,g,d),v=Ts(u,p),y=As(d),C=Bs(c,f);if(!t.valid||!m)return;if(!y&&!C)return;if(!(b||v||s||l))return;const{context:w}=n;for(let n=e;n<e+r;n++)this.drawIncreaseSegment(t,w,a[n-1],a[n],t.attribute.segments[n],[h,t.attribute],i,o)}else super.drawShape(t,e,i,o,n,r,s,l)}drawIncreaseSegment(t,e,i,o,n,r,s,l){o&&(e.beginPath(),function(t,e,i,o){const{offsetX:n=0,offsetY:r=0}=o||{},s=e?e.points[e.points.length-1]:i.points[0];t.moveTo(s.x+n,s.y+r),i.points.forEach((e=>{!1!==e.defined?t.lineTo(e.x+n,e.y+r):t.moveTo(e.x+n,e.y+r)}))}(e.nativeContext,i,o,{offsetX:s,offsetY:l}),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,n,r),e.setStrokeStyle(t,n,s,l,r),e.stroke())}};Qc=Jc([y()],Qc);var tu=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s};let eu=class extends ed{constructor(){super(...arguments),this.numberType=Kr}drawShape(t,e,i,o,n,r,s){if(t.incremental&&n.multiGraphicOptions){const{startAtIdx:r,length:l}=n.multiGraphicOptions,{segments:a=[]}=t.attribute;if(r>a.length)return;const h=_n(t).area,{fill:d=h.fill,fillOpacity:c=h.fillOpacity,opacity:u=h.opacity,visible:g=h.visible}=t.attribute,p=Rs(u,c,d),f=As(d);if(!t.valid||!g)return;if(!f)return;if(!p&&!s)return;for(let n=r;n<r+l;n++)this.drawIncreaseSegment(t,e,a[n-1],a[n],t.attribute.segments[n],[h,t.attribute],i,o)}else super.drawShape(t,e,i,o,n,r,s)}drawIncreaseSegment(t,e,i,o,n,r,s,l){o&&(e.beginPath(),function(t,e,i,o){const{offsetX:n=0,offsetY:r=0}=o||{},{points:s}=i,l=[];for(let t=0;t<s.length;t++)s[t].defined;l.push(s),l.forEach(((i,o)=>{var s,l,a,h;const d=e&&0===o?e.points[e.points.length-1]:i[0];t.moveTo(d.x+n,d.y+r),i.forEach((e=>{!1!==e.defined?t.lineTo(e.x+n,e.y+r):t.moveTo(e.x+n,e.y+r)}));for(let e=i.length-1;e>=0;e--){const o=i[e];t.lineTo(null!==(s=o.x1)&&void 0!==s?s:o.x,null!==(l=o.y1)&&void 0!==l?l:o.y)}t.lineTo(null!==(a=d.x1)&&void 0!==a?a:d.x,null!==(h=d.y1)&&void 0!==h?h:d.y),t.closePath()}))}(e.camera?e:e.nativeContext,i,o,{offsetX:s,offsetY:l}),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,n,r),e.setCommonStyle(t,n,s,l,r),e.fill())}};eu=tu([y()],eu);var iu,ou=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s},nu=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},ru=function(t,e){return function(i,o){e(i,o,t)}},su=function(t,e,i,o){return new(i||(i=Promise))((function(n,r){function s(t){try{a(o.next(t))}catch(t){r(t)}}function l(t){try{a(o.throw(t))}catch(t){r(t)}}function a(t){var e;t.done?n(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(s,l)}a((o=o.apply(t,e||[])).next())}))};!function(t){t[t.NORMAL=0]="NORMAL",t[t.STOP=1]="STOP"}(iu||(iu={}));let lu=class extends Xc{constructor(t,e,i,o){super(t,o),this.contributions=t,this.lineRender=e,this.areaRender=i,this.drawItemInterceptorContributions=o,this.rendering=!1,this.currFrameStartAt=0,this.currentIdx=0,this.status=iu.NORMAL,this.checkingForDrawPromise=null,this.hooks={completeDraw:new D([])},this.defaultRenderMap.set(this.lineRender.numberType,this.lineRender),this.defaultRenderMap.set(this.areaRender.numberType,this.areaRender)}draw(t,e){return su(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:o,viewBox:n}=e;o&&(o.inuse=!0,o.clearMatrix(),o.setTransformForCurrent(!0),o.save(),e.restartIncremental&&this.clearScreen(this.currentRenderService,o,e),o.translate(n.x1,n.y1,!0),o.save(),t.renderTreeRoots.sort(((t,e)=>{var i,o;return(null!==(i=t.attribute.zIndex)&&void 0!==i?i:_o.zIndex)-(null!==(o=e.attribute.zIndex)&&void 0!==o?o:_o.zIndex)})).forEach((t=>{this.renderGroup(t,e)})),this.hooks.completeDraw.tap("top-draw",(()=>{o.restore(),o.restore(),o.draw(),o.inuse=!1,this.rendering=!1})))}))}_increaseRender(t,e){return su(this,void 0,void 0,(function*(){this.rendering=!0,yield this._renderIncrementalGroup(t,e)}))}_renderIncrementalGroup(t,e){return su(this,void 0,void 0,(function*(){this.count=t.count,yield new Promise((i=>{this.renderItem(t,e,{drawingCb:()=>su(this,void 0,void 0,(function*(){if(2!==t.count)yield Gc(t,_o.zIndex,((i,o)=>{if(this.status===iu.STOP)return!0;if(i.isContainer)return!1;if(o<this.currentIdx)return!1;const n=this.currFrameStartAt+t.incremental;return o<n&&(this.currentIdx=o+1,this.renderItem(i,e)),o===n-1&&(this.currFrameStartAt=this.currentIdx,this.waitToNextFrame())})),i(!1);else{const o=t.getChildAt(0);if(o.incremental&&o.attribute.segments)for(o.incrementalAt||(o.incrementalAt=0);o.incrementalAt<o.attribute.segments.length;)e.multiGraphicOptions={startAtIdx:o.incrementalAt,length:o.incremental},this.renderItem(o,e),o.incrementalAt+=o.incremental,yield this.waitToNextFrame();else this.renderItem(o,e);i(!1)}}))})})),this.hooks.completeDraw.call()}))}waitToNextFrame(){return su(this,void 0,void 0,(function*(){return new Promise((t=>{this.global.getRequestAnimationFrame()((()=>{t(!1)}))}))}))}checkForDraw(t){return su(this,void 0,void 0,(function*(){let e=this.rendering;return t.restartIncremental&&(e=!1,yield this.forceStop(),this.resetToInit()),e}))}forceStop(){return su(this,void 0,void 0,(function*(){this.rendering&&(this.status=iu.STOP,yield new Promise((t=>{this.hooks.completeDraw.tap("stopCb",(()=>{this.status=iu.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 su(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:()=>su(this,void 0,void 0,(function*(){yield Gc(t,_o.zIndex,(t=>su(this,void 0,void 0,(function*(){e.break||t.isContainer&&(yield this.renderGroup(t,e))})))),i(!1)}))})})))}))}};lu=ou([y(),ru(0,v(Dd)),ru(1,b(Qc)),ru(2,b(eu)),ru(3,b(z)),ru(3,C(Jd)),nu("design:paramtypes",[Array,Object,Object,Object])],lu);var au=new s((t=>{t(hh).toSelf().inSingletonScope(),t(uh).toSelf().inSingletonScope(),t(Kd).to(Xc),t(Fd).to(lu),t(Wd).to(Zc).inSingletonScope(),t(Dd).toService(Wd),I(t,Ws),t(ch).toSelf().inSingletonScope(),I(t,Xs),I(t,Dd),t(oc).toSelf().inSingletonScope(),t(Jd).toService(oc),I(t,Jd)}));function hu(){hu.__loaded||(hu.__loaded=!0,Qo.load(Ss),Qo.load(Cc),Qo.load(cc),Qo.load(yc),Qo.load(Rc),function(t){t.load(Mc),t.load(Tc),t.load(Dc)}(Qo),function(t){t.load(au)}(Qo))}hu.__loaded=!1,hu();const du=Qo.get(N);Oo.global=du;const cu=Qo.get(fs);Oo.graphicUtil=cu;const uu=Qo.get(ps);Oo.transformUtil=uu;const gu=Qo.get(ss);Oo.graphicService=gu;const pu=Qo.get(ms);Oo.layerService=pu;class fu{constructor(){this.name="AutoRenderPlugin",this.activeEvent="onRegister",this._uid=r.GenAutoIncrementId(),this.key=this.name+this._uid}activate(t){this.pluginService=t,Oo.graphicService.hooks.onAttributeUpdate.tap(this.key,(e=>{e.glyphHost&&(e=e.glyphHost),e.stage===t.stage&&null!=e.stage&&e.stage.renderNextFrame()})),Oo.graphicService.hooks.onSetStage.tap(this.key,(e=>{e.glyphHost&&(e=e.glyphHost),e.stage===t.stage&&null!=e.stage&&e.stage.renderNextFrame()}))}deactivate(t){Oo.graphicService.hooks.onAttributeUpdate.taps=Oo.graphicService.hooks.onAttributeUpdate.taps.filter((t=>t.name!==this.key)),Oo.graphicService.hooks.onSetStage.taps=Oo.graphicService.hooks.onSetStage.taps.filter((t=>t.name!==this.key))}}class mu{constructor(){this.name="ViewTransform3dPlugin",this.activeEvent="onRegister",this._uid=r.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 o=this.pluginService.stage;if(this.option3d||(this.option3d=o.option3d),this.option3d&&this.mousedown)if(this.pageX&&this.pageY){const n=t.page.x-this.pageX,r=t.page.y-this.pageY;this.pageX=t.page.x,this.pageY=t.page.y;const s=n/100,l=r/100;this.option3d.alpha=(null!==(e=this.option3d.alpha)&&void 0!==e?e:0)+s,this.option3d.beta=(null!==(i=this.option3d.beta)&&void 0!==i?i:0)+l,o.set3dOptions(this.option3d),o.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 bu{constructor(){this.name="IncrementalAutoRenderPlugin",this.activeEvent="onRegister",this.nextFrameRenderGroupSet=new Set,this.willNextFrameRender=!1,this.nextUserParams={},this._uid=r.GenAutoIncrementId(),this.key=this.name+this._uid}activate(t){this.pluginService=t,Oo.graphicService.hooks.onAddIncremental.tap(this.key,((e,i,o)=>{e.glyphHost&&(e=e.glyphHost),e.stage===t.stage&&null!=e.stage&&(this.nextUserParams.startAtId=i._uid,this.renderNextFrame(i))})),Oo.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){Oo.graphicService.hooks.onAddIncremental.taps=Oo.graphicService.hooks.onAddIncremental.taps.filter((t=>t.name!==this.key)),Oo.graphicService.hooks.onClearIncremental.taps=Oo.graphicService.hooks.onClearIncremental.taps.filter((t=>t.name!==this.key))}renderNextFrame(t){this.nextFrameRenderGroupSet.add(t),this.willNextFrameRender||(this.willNextFrameRender=!0,Oo.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 o=e.layer.subLayers.get(e._uid);o&&o.drawContribution&&o.drawContribution.draw(t.renderService,Object.assign({stage:t,layer:i,viewBox:t.window.getViewBox(),transMatrix:t.window.getViewBoxTransform(),clear:"transparent",renderService:t.renderService,updateBounds:!1,startAtId:e._uid,context:o.layer.getNativeHandler().getContext()},this.nextUserParams))})),this.nextUserParams={},this.nextFrameRenderGroupSet.clear())}}class vu{constructor(){this.name="HtmlAttributePlugin",this.activeEvent="onRegister",this._uid=r.GenAutoIncrementId(),this.key=this.name+this._uid,this.htmlMap={},this.renderId=0}activate(t){this.pluginService=t,t.stage.hooks.afterRender.tap(this.key,(e=>{e&&e===this.pluginService.stage&&this.drawHTML(t.stage.renderService)}))}deactivate(t){t.stage.hooks.afterRender.taps=t.stage.hooks.afterRender.taps.filter((t=>t.name!==this.key)),Oo.graphicService.hooks.onRemove.unTap(this.key),Oo.graphicService.hooks.onRelease.unTap(this.key),this.release()}getWrapContainer(t,e,i){let o;return o=e?"string"==typeof e?Oo.global.getElementById(e):e:t.window.getContainer(),{wrapContainer:Oo.global.createDom(Object.assign({tagName:"div",parent:o},i)),nativeContainer:o}}parseDefaultStyleFromGraphic(t){return function(t){const e={};return["textAlign","fontFamily","fontVariant","fontStyle","fontWeight"].forEach((i=>{t[i]&&(e[ii(i)]=t[i])})),["fontSize","lineHeight"].forEach((i=>{const o=ii(i);J(t[i])||(e[o]=/^[0-9]*$/.test(`${t[i]}`)?`${t[i]}px`:`${t[i]}`)})),t.underline?e["text-decoration"]="underline":t.lineThrough&&(e["text-decoration"]="line-through"),t.fill&&nt(t.fill)&&(e.color=t.fill),e}("text"===t.type&&t.attribute?t.attribute:_n(t).text)}getTransformOfText(t){const e=_n(t).text,{textAlign:i=e.textAlign,textBaseline:o=e.textBaseline}=t.attribute,n=t.globalTransMatrix.toTransformAttrs(),{rotateDeg:r,scaleX:s,scaleY:l}=n,a={left:"0",start:"0",end:"-100%",center:"-50%",right:"-100%",top:"0",middle:"-50%",bottom:"-100%",alphabetic:"-79%"},h={left:"0",start:"0",end:"100%",center:"50%",right:"100%",top:"0",middle:"50%",bottom:"100%",alphabetic:"79%"};return{textAlign:i,transform:`translate(${a[i]},${a[o]}) rotate(${r}deg) scaleX(${s}) scaleY(${l})`,transformOrigin:`${h[i]} ${h[o]}`}}updateStyleOfWrapContainer(t,e,i,o,n){const{pointerEvents:r}=n;let s=this.parseDefaultStyleFromGraphic(t);s.display=!1!==t.attribute.visible?"block":"none",s.pointerEvents=!0===r?"all":r||"none",i.style.position||(i.style.position="absolute",o.style.position="relative");let l=0,a=0;const h=t.globalAABBBounds;let d=n.anchorType;if(J(d)&&(d="text"===t.type?"position":"boundsLeftTop"),"boundsLeftTop"===d&&(d="top-left"),"position"===d||h.empty()){const e=t.globalTransMatrix;l=e.e,a=e.f}else{const t=((t,e)=>{const{x1:i,x2:o,y1:n,y2:r}=t,s=Math.abs(o-i),l=Math.abs(r-n);let a=(i+o)/2,h=(n+r)/2,d=0,c=0;switch(e){case"top":case"inside-top":c=-.5;break;case"bottom":case"inside-bottom":c=.5;break;case"left":case"inside-left":d=-.5;break;case"right":case"inside-right":d=.5;break;case"top-right":d=.5,c=-.5;break;case"top-left":d=-.5,c=-.5;break;case"bottom-right":d=.5,c=.5;break;case"bottom-left":d=-.5,c=.5}return a+=d*s,h+=c*l,{x:a,y:h}})(h,d);l=t.x,a=t.y}const c=Oo.global.getElementTopLeft(o,!1),u=e.window.getTopLeft(!1),g=l+u.left-c.left,p=a+u.top-c.top;if(s.left=`${g}px`,s.top=`${p}px`,"text"===t.type&&"position"===d&&(s=Object.assign(Object.assign({},s),this.getTransformOfText(t))),Z(n.style)){const e=n.style({top:p,left:g,width:h.width(),height:h.height()},t,i);e&&(s=Object.assign(Object.assign({},s),e))}else tt(n.style)?s=Object.assign(Object.assign({},s),n.style):nt(n.style)&&n.style&&(s=Object.assign(Object.assign({},s),function(){const t={};return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").split(";").forEach((e=>{if(e){const i=e.split(":");if(2===i.length){const e=i[0].trim(),o=i[1].trim();e&&o&&(t[e]=o)}}})),t}(n.style)));Oo.global.updateDom(i,{width:n.width,height:n.width,style:s})}clearCacheContainer(){this.htmlMap&&Object.keys(this.htmlMap).forEach((t=>{this.htmlMap[t]&&this.htmlMap[t].renderId!==this.renderId&&this.removeElement(t)})),this.renderId+=1}drawHTML(t){"browser"===Oo.global.env&&(t.renderTreeRoots.sort(((t,e)=>{var i,o;return(null!==(i=t.attribute.zIndex)&&void 0!==i?i:_o.zIndex)-(null!==(o=e.attribute.zIndex)&&void 0!==o?o:_o.zIndex)})).forEach((t=>{this.renderGroupHTML(t)})),this.clearCacheContainer())}renderGroupHTML(t){this.renderGraphicHTML(t),t.forEachChildren((t=>{t.isContainer?this.renderGroupHTML(t):this.renderGraphicHTML(t)}))}removeElement(t){if(!this.htmlMap||!this.htmlMap[t])return;const{wrapContainer:e}=this.htmlMap[t];e&&Oo.global.removeDom(e),this.htmlMap[t]=null}renderGraphicHTML(t){var e;const{html:i}=t.attribute;if(!i)return;const o=t.stage;if(!o)return;const{dom:n,container:r}=i;if(!n)return;const s=J(i.id)?`${null!==(e=t.id)&&void 0!==e?e:t._uid}_react`:i.id;if(this.htmlMap&&this.htmlMap[s]&&r&&r!==this.htmlMap[s].container&&this.removeElement(s),this.htmlMap&&this.htmlMap[s])"string"==typeof n?this.htmlMap[s].wrapContainer.innerHTML=n:n!==this.htmlMap[s].wrapContainer.firstChild&&(this.htmlMap[s].wrapContainer.removeChild(this.htmlMap[s].wrapContainer.firstChild),this.htmlMap[s].wrapContainer.appendChild(n));else{const{wrapContainer:t,nativeContainer:e}=this.getWrapContainer(o,r);t&&("string"==typeof n?t.innerHTML=n:t.appendChild(n),this.htmlMap||(this.htmlMap={}),this.htmlMap[s]={wrapContainer:t,nativeContainer:e,container:r,renderId:this.renderId})}if(!this.htmlMap||!this.htmlMap[s])return;const{wrapContainer:l,nativeContainer:a}=this.htmlMap[s];this.updateStyleOfWrapContainer(t,o,l,a,i),this.htmlMap[s].renderId=this.renderId}release(){"browser"===Oo.global.env&&this.removeAllDom(this.pluginService.stage.defaultLayer)}removeAllDom(t){this.htmlMap&&(Object.keys(this.htmlMap).forEach((t=>{this.removeElement(t)})),this.htmlMap=null)}}const yu=new Ce;class Cu{constructor(){this.name="DirtyBoundsPlugin",this.activeEvent="onRegister",this._uid=r.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()})),Oo.graphicService.hooks.beforeUpdateAABBBounds.tap(this.key,((t,e,i,o)=>{t.glyphHost&&(t=t.glyphHost),e&&e===this.pluginService.stage&&e.renderCount&&(t.isContainer&&!t.shouldSelfChangeUpdateAABBBounds()||i&&(yu.setValue(o.x1,o.y1,o.x2,o.y2),e.dirty(yu,t.parent&&t.parent.globalTransMatrix)))})),Oo.graphicService.hooks.afterUpdateAABBBounds.tap(this.key,((t,e,i,o,n)=>{e&&e===this.pluginService.stage&&e.renderCount&&(t.isContainer&&!n||e.dirty(o.globalAABBBounds))})),Oo.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){Oo.graphicService.hooks.beforeUpdateAABBBounds.taps=Oo.graphicService.hooks.beforeUpdateAABBBounds.taps.filter((t=>t.name!==this.key)),Oo.graphicService.hooks.afterUpdateAABBBounds.taps=Oo.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)),Oo.graphicService.hooks.onRemove.taps=Oo.graphicService.hooks.onRemove.taps.filter((t=>t.name!==this.key))}}const wu=new Ce;class xu{constructor(){this.name="FlexLayoutPlugin",this.activeEvent="onRegister",this.id=r.GenAutoIncrementId(),this.key=this.name+this.id,this.tempBounds=new Ce}pauseLayout(t){this.pause=t}tryLayoutChildren(t){t.firstChild&&this.tryLayout(t.firstChild)}tryLayout(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(this.pause)return;const i=t.parent;if(!(e||i&&t.needUpdateLayout()))return;const o=_n(i).group,{display:n=o.display}=i.attribute;if("flex"!==n)return;const{flexDirection:r=o.flexDirection,flexWrap:s=o.flexWrap,alignItems:l=o.alignItems,clip:a=o.clip}=i.attribute,{alignContent:h=(null!=l?l:o.alignContent)}=i.attribute;let{width:d,height:c,justifyContent:u=o.justifyContent}=i.attribute;const g=i.getChildren();if(null==d||null==c){let t=0,e=0,i=0;if(g.forEach((o=>{const n=this.getAABBBounds(o);n.empty()||("column"===r||"column-reverse"===r?(e+=n.height(),t=Math.max(t,n.width())):(t+=n.width(),e=Math.max(e,n.height())),i+=n.x1,i+=n.y1,i+=n.x2,i+=n.y2)})),!isFinite(i))return;d=t,c=e}null==i.attribute.width?i.attribute.width=d:d=i.attribute.width,null==i.attribute.height?i.attribute.height=c:c=i.attribute.height,this.tempBounds.copy(i._AABBBounds);const p={main:{len:d,field:"x"},cross:{len:c,field:"y"}},f=p.main,m=p.cross;"column"!==r&&"column-reverse"!==r||(f.len=c,m.len=d,f.field="y",m.field="x"),"row-reverse"!==r&&"column-reverse"!==r||("flex-start"===u?u="flex-end":"flex-end"===u?u="flex-start":g.reverse());let b=0,v=0;const y=[];g.forEach((t=>{const e=this.getAABBBounds(t);if(e.empty())return;const i="x"===f.field?e.width():e.height(),o="x"===m.field?e.width():e.height();y.push({mainLen:i,crossLen:o}),b+=i,v=Math.max(v,o)}));const C=[];if(b>f.len&&"wrap"===s){let t=0,e=0;y.forEach(((i,o)=>{let{mainLen:n,crossLen:r}=i;t+n>f.len?0===t?(C.push({idx:o,mainLen:t+n,crossLen:r}),t=0,e=0):(C.push({idx:o-1,mainLen:t,crossLen:e}),t=n,e=r):(t+=n,e=Math.max(e,r))})),C.push({idx:y.length-1,mainLen:t,crossLen:e})}else C.push({idx:y.length-1,mainLen:b,crossLen:v});let w=0;if(C.forEach((t=>{this.layoutMain(i,g,u,f,y,w,t),w=t.idx+1})),v=C.reduce(((t,e)=>t+e.crossLen),0),1===C.length){const t={"flex-start":0,"flex-end":m.len,center:m.len/2};this.layoutCross(g,l,m,t,y,C[0],0)}else if("flex-start"===h){w=0;let t=0;C.forEach(((e,i)=>{const o={"flex-start":t,"flex-end":t+e.crossLen,center:t+e.crossLen/2};this.layoutCross(g,"flex-start",m,o,y,C[i],w),w=e.idx+1,t+=e.crossLen}))}else if("center"===h){w=0;let t=Math.max(0,(m.len-v)/2);C.forEach(((e,i)=>{const o={"flex-start":t,"flex-end":t+e.crossLen,center:t+e.crossLen/2};this.layoutCross(g,"center",m,o,y,C[i],w),w=e.idx+1,t+=e.crossLen}))}else if("space-around"===h){w=0;const t=Math.max(0,(m.len-v)/C.length/2);let e=t;C.forEach(((i,o)=>{const n={"flex-start":e,"flex-end":e+i.crossLen,center:e+i.crossLen/2};this.layoutCross(g,"flex-start",m,n,y,C[o],w),w=i.idx+1,e+=i.crossLen+2*t}))}else if("space-between"===h){w=0;const t=Math.max(0,(m.len-v)/(2*C.length-2));let e=0;C.forEach(((i,o)=>{const n={"flex-start":e,"flex-end":e+i.crossLen,center:e+i.crossLen/2};this.layoutCross(g,"flex-start",m,n,y,C[o],w),w=i.idx+1,e+=i.crossLen+2*t}))}g.forEach(((t,e)=>{t.addUpdateBoundTag(),t.addUpdatePositionTag(),t.clearUpdateLayoutTag()})),i.addUpdateLayoutTag();const x=this.getAABBBounds(i);a||this.tempBounds.equals(x)||this.tryLayout(i,!1)}getAABBBounds(t){this.skipBoundsTrigger=!0;const e=t.AABBBounds;return this.skipBoundsTrigger=!1,e}updateChildPos(t,e,i){return t+(null!=e?e:0)-i}layoutMain(t,e,i,o,n,r,s){if("flex-start"===i){let t=0;for(let i=r;i<=s.idx;i++){const r=t+(e[i],o.field,0),s=this.getAABBBounds(e[i]);!s.empty()&&(e[i].attribute[o.field]=this.updateChildPos(r,e[i].attribute[o.field],s[`${o.field}1`])),t+=n[i].mainLen}}else if("flex-end"===i){let t=o.len;for(let i=s.idx;i>=r;i--){t-=n[i].mainLen;const r=t+(e[i],o.field,0),s=this.getAABBBounds(e[i]);!s.empty()&&(e[i].attribute[o.field]=this.updateChildPos(r,e[i].attribute[o.field],s[`${o.field}1`]))}}else if("space-around"===i)if(s.mainLen>=o.len){let t=0;for(let i=r;i<=s.idx;i++){const r=t+(e[i],o.field,0),s=this.getAABBBounds(e[i]);!s.empty()&&(e[i].attribute[o.field]=this.updateChildPos(r,e[i].attribute[o.field],s[`${o.field}1`])),t+=n[i].mainLen}}else{const t=s.idx-r+1,i=(o.len-s.mainLen)/t/2;let l=i;for(let t=r;t<=s.idx;t++){const r=l+(e[t],o.field,0),s=this.getAABBBounds(e[t]);!s.empty()&&(e[t].attribute[o.field]=this.updateChildPos(r,e[t].attribute[o.field],s[`${o.field}1`])),l+=n[t].mainLen+2*i}}else if("space-between"===i)if(s.mainLen>=o.len){let t=0;for(let i=r;i<=s.idx;i++){const r=t+(e[i],o.field,0),s=this.getAABBBounds(e[i]);!s.empty()&&(e[i].attribute[o.field]=this.updateChildPos(r,e[i].attribute[o.field],s[`${o.field}1`])),t+=n[i].mainLen}}else{const t=s.idx-r+1,i=(o.len-s.mainLen)/(2*t-2);let l=0;for(let t=r;t<=s.idx;t++){const r=l+(e[t],o.field,0),s=this.getAABBBounds(e[t]);!s.empty()&&(e[t].attribute[o.field]=this.updateChildPos(r,e[t].attribute[o.field],s[`${o.field}1`])),l+=n[t].mainLen+2*i}}else if("center"===i){let t=(o.len-s.mainLen)/2;for(let i=r;i<=s.idx;i++){const r=t+(e[i],o.field,0),s=this.getAABBBounds(e[i]);!s.empty()&&(e[i].attribute[o.field]=this.updateChildPos(r,e[i].attribute[o.field],s[`${o.field}1`])),t+=n[i].mainLen}}}layoutCross(t,e,i,o,n,r,s){var l;for(let a=s;a<=r.idx;a++){const r=t[a];let{alignSelf:s}=r.attribute;s&&"auto"!==s||(s=e);const h=this.getAABBBounds(r),d=null!==(l=o[s])&&void 0!==l?l:o["flex-start"];"flex-end"===s?!h.empty()&&(r.attribute[i.field]=this.updateChildPos(d-n[a].crossLen+(i.field,0),r.attribute[i.field],h[`${i.field}1`])):"center"===s?!h.empty()&&(r.attribute[i.field]=this.updateChildPos(d-n[a].crossLen/2+(i.field,0),r.attribute[i.field],h[`${i.field}1`])):!h.empty()&&(r.attribute[i.field]=this.updateChildPos(d+(i.field,0),r.attribute[i.field],h[`${i.field}1`]))}}activate(t){this.pluginService=t,Oo.graphicService.hooks.onAttributeUpdate.tap(this.key,(t=>{t.glyphHost&&(t=t.glyphHost),t.stage&&t.stage===this.pluginService.stage&&this.tryLayout(t,!1)})),Oo.graphicService.hooks.beforeUpdateAABBBounds.tap(this.key,((t,e,i,o)=>{t.glyphHost&&(t=t.glyphHost),e&&e===this.pluginService.stage&&t.isContainer&&!this.skipBoundsTrigger&&wu.copy(o)})),Oo.graphicService.hooks.afterUpdateAABBBounds.tap(this.key,((t,e,i,o,n)=>{e&&e===this.pluginService.stage&&t.isContainer&&!this.skipBoundsTrigger&&(wu.equals(i)||this.tryLayout(t,!1))})),Oo.graphicService.hooks.onSetStage.tap(this.key,(t=>{t.glyphHost&&(t=t.glyphHost),this.tryLayout(t,!1)}))}deactivate(t){Oo.graphicService.hooks.onAttributeUpdate.taps=Oo.graphicService.hooks.onAttributeUpdate.taps.filter((t=>t.name!==this.key)),Oo.graphicService.hooks.beforeUpdateAABBBounds.taps=Oo.graphicService.hooks.beforeUpdateAABBBounds.taps.filter((t=>t.name!==this.key)),Oo.graphicService.hooks.afterUpdateAABBBounds.taps=Oo.graphicService.hooks.afterUpdateAABBBounds.taps.filter((t=>t.name!==this.key)),Oo.graphicService.hooks.onSetStage.taps=Oo.graphicService.hooks.onSetStage.taps.filter((t=>t.name!==this.key))}}const _u=new class{set mode(t){this._mode!==t&&(this._mode=t,this.setupTickHandler())}get mode(){return this._mode}constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];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===Dn.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=Dn.INITIAL,Oo.global.hooks.onSetEnv.tap("default-ticker",(()=>{this.initHandler()})),Oo.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:On},{mode:"timeout",cons:In},{mode:"manual",cons:Fn}];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 On;break;case"timeout":t=new In;break;case"manual":t=new Fn;break;default:Wt.getInstance().warn("非法的计时器模式"),t=new On}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!==Dn.INITIAL&&(this.status=Dn.PAUSE,!0)}resume(){return this.status!==Dn.INITIAL&&(this.status=Dn.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(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.status===Dn.RUNNING)return!1;if(!this.tickerHandler)return!1;if(!t){if(this.status===Dn.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=Dn.RUNNING,this.tickerHandler.tick(0,this.handleTick),!0}stop(){this.status=Dn.INITIAL,this.setupTickHandler(),this.lastFrameTime=-1}};_u.addTimeline(Gn),_u.setFPS(60);class Su{constructor(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.8;this.dir=t,this.color=e,this.colorRgb=dr.Get(e,hr.Color1),this.ambient=i;const o=ce(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);this.formatedDir=[t[0]/o,t[1]/o,t[2]/o]}computeColor(t,e){const i=this.formatedDir,o=he(ae((t[0]*i[0]+t[1]*i[1]+t[2]*i[2])*(1-this.ambient/2),0)+this.ambient,1);let n;n=nt(e)?dr.Get(e,hr.Color1):e;const r=this.colorRgb;return`rgb(${r[0]*n[0]*o}, ${r[1]*n[1]*o}, ${r[2]*n[2]*o})`}}function Au(t,e,i){const o=e[0],n=e[1],r=e[2],s=e[3],l=e[4],a=e[5],h=e[6],d=e[7],c=e[8],u=e[9],g=e[10],p=e[11],f=e[12],m=e[13],b=e[14],v=e[15];let y=i[0],C=i[1],w=i[2],x=i[3];return t[0]=y*o+C*l+w*c+x*f,t[1]=y*n+C*a+w*u+x*m,t[2]=y*r+C*h+w*g+x*b,t[3]=y*s+C*d+w*p+x*v,y=i[4],C=i[5],w=i[6],x=i[7],t[4]=y*o+C*l+w*c+x*f,t[5]=y*n+C*a+w*u+x*m,t[6]=y*r+C*h+w*g+x*b,t[7]=y*s+C*d+w*p+x*v,y=i[8],C=i[9],w=i[10],x=i[11],t[8]=y*o+C*l+w*c+x*f,t[9]=y*n+C*a+w*u+x*m,t[10]=y*r+C*h+w*g+x*b,t[11]=y*s+C*d+w*p+x*v,y=i[12],C=i[13],w=i[14],x=i[15],t[12]=y*o+C*l+w*c+x*f,t[13]=y*n+C*a+w*u+x*m,t[14]=y*r+C*h+w*g+x*b,t[15]=y*s+C*d+w*p+x*v,t}function Bu(t,e,i){const o=e[0],n=e[1],r=e[2];let s=i[3]*o+i[7]*n+i[11]*r+i[15];return s=s||1,t[0]=(i[0]*o+i[4]*n+i[8]*r+i[12])/s,t[1]=(i[1]*o+i[5]*n+i[9]*r+i[13])/s,t[2]=(i[2]*o+i[6]*n+i[10]*r+i[14])/s,t}class Ru{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=Ga.allocate()),this._viewMatrixCached}forceGetViewMatrix(){this._viewMatrixCached||(this._viewMatrixCached=Ga.allocate());const{pos:t,center:e,up:i}=this.params.viewParams;return function(t,e,i,o){let n,r,s,l,a,h,d,c,u,g;const p=e[0],f=e[1],m=e[2],b=o[0],v=o[1],y=o[2],C=i[0],w=i[1],x=i[2];Math.abs(p-C)<te&&Math.abs(f-w)<te&&Math.abs(m-x)<te?Wa.identity(t):(d=p-C,c=f-w,u=m-x,g=1/Math.hypot(d,c,u),d*=g,c*=g,u*=g,n=v*u-y*c,r=y*d-b*u,s=b*c-v*d,g=Math.hypot(n,r,s),g?(g=1/g,n*=g,r*=g,s*=g):(n=0,r=0,s=0),l=c*s-u*r,a=u*n-d*s,h=d*r-c*n,g=Math.hypot(l,a,h),g?(g=1/g,l*=g,a*=g,h*=g):(l=0,a=0,h=0),t[0]=n,t[1]=l,t[2]=d,t[3]=0,t[4]=r,t[5]=a,t[6]=c,t[7]=0,t[8]=s,t[9]=h,t[10]=u,t[11]=0,t[12]=-(n*p+r*f+s*m),t[13]=-(l*p+a*f+h*m),t[14]=-(d*p+c*f+u*m),t[15]=1)}(this._viewMatrixCached,t,e,i),this._vp||(this._vp=Ga.allocate()),this._vp=Au(this._vp,this.getProjectionMatrix(),this.getViewMatrix()),this._viewMatrixCached}getProjectionMatrix(){return this._projectionMatrixCached||(this._projectionMatrixCached=Ga.allocate()),this._projectionMatrixCached}forceGetProjectionMatrix(){this._projectionMatrixCached||(this._projectionMatrixCached=Ga.allocate());const{left:t,top:e,right:i,bottom:o}=this._params;return function(t,e,i,o,n,r,s){const l=1/(e-i),a=1/(o-n),h=1/(r-s);t[0]=-2*l,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*a,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*h,t[11]=0,t[12]=(e+i)*l,t[13]=(n+o)*a,t[14]=(s+r)*h,t[15]=1}(this._projectionMatrixCached,t,i,o,e,0,-2e6),this._vp||(this._vp=Ga.allocate()),this._vp=Au(this._vp,this.getProjectionMatrix(),this.getViewMatrix()),this._projectionMatrixCached}getField(){const{fieldRatio:t=.8,fieldDepth:e,left:i,right:o}=this._params;return(null!=e?e:o-i)*t}getProjectionScale(t){const e=this.getField();return e/(e+t)}view(t,e,i){const o=[0,0,0];return Bu(o,[t,e,i],this._viewMatrixCached),o}vp(t,e,i){const o=[0,0,0],{pos:n}=this._params.viewParams;Bu(o,[t,e,i],this._viewMatrixCached),t=o[0],e=o[1],i=o[2];const r=this.getProjectionScale(i);return{x:t*r+n[0],y:e*r+n[1]}}}let Mu;function Tu(){if(null==Mu)try{const t=document.createElement("canvas"),e=t.getContext("2d");Mu=!!(window&&t.getBoundingClientRect&&requestAnimationFrame&&window.devicePixelRatio&&e&&e.isPointInPath&&e.isPointInStroke),Mu&&(Mu=!!document.createElement)}catch(t){Mu=!1}}function ku(){Tu();const t=Oo.global&&Oo.global.env;return t?"browser"===t:Mu}class Pu extends vu{constructor(){super(...arguments),this.name="ReactAttributePlugin",this.activeEvent="onRegister",this._uid=r.GenAutoIncrementId(),this.key=this.name+this._uid,this.htmlMap={}}removeElement(t){if(!this.htmlMap||!this.htmlMap[t])return;const{root:e,wrapContainer:i}=this.htmlMap[t];e&&Oo.global.getRequestAnimationFrame()((()=>{e.unmount()})),i&&Oo.global.removeDom(i),this.htmlMap[t]=null}renderGraphicHTML(t){var e;const{react:i}=t.attribute;if(!i)return;const o=t.stage;if(!o)return;const n=o.params.ReactDOM,{element:r,container:s}=i;if(!(r&&n&&n.createRoot))return;const l=J(i.id)?`${null!==(e=t.id)&&void 0!==e?e:t._uid}_react`:i.id;if(this.htmlMap&&this.htmlMap[l]&&s&&s!==this.htmlMap[l].container&&this.removeElement(l),this.htmlMap&&this.htmlMap[l])this.htmlMap[l].root.render(r);else{const{wrapContainer:t,nativeContainer:e}=this.getWrapContainer(o,s);if(t){const i=n.createRoot(t);i.render(r),this.htmlMap||(this.htmlMap={}),this.htmlMap[l]={root:i,wrapContainer:t,nativeContainer:e,container:s,renderId:this.renderId}}}if(!this.htmlMap||!this.htmlMap[l])return;const{wrapContainer:a,nativeContainer:h}=this.htmlMap[l];this.updateStyleOfWrapContainer(t,o,a,h,i),this.htmlMap[l].renderId=this.renderId}}const Eu="white";class Lu extends cs{set viewBox(t){this.window.setViewBox(t)}get viewBox(){return this.window.getViewBox()}get x(){return this.window.getViewBox().x1}set x(t){const e=this.window.getViewBox();e.translate(t-e.x1,0),this.window.setViewBox(e)}get y(){return this.window.getViewBox().y1}set y(t){const e=this.window.getViewBox();e.translate(0,t-e.y1),this.window.setViewBox(e)}get width(){return this.window.width}set width(t){this.resize(t,this.height)}get viewWidth(){return this.window.getViewBox().width()}set viewWidth(t){this.resizeView(t,this.viewHeight)}get viewHeight(){return this.window.getViewBox().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:Eu}set background(t){this._background=t}get defaultLayer(){return this.at(0)}get eventSystem(){return this._eventSystem}constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};var e;super({}),this._onVisibleChange=t=>{if(!(this._skipRender<0))if(t){if(this.dirtyBounds){const t=this.window.getViewBox();this.dirtyBounds.setValue(t.x1,t.y1,t.width(),t.height())}this._skipRender>1&&this.renderNextFrame(),this._skipRender=0}else 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 wn,this.hooks={beforeRender:new D(["stage"]),afterRender:new D(["stage"])},this.global=Oo.global,!this.global.env&&ku()&&this.global.setEnv("browser"),this.window=Qo.get(ln),this.renderService=Qo.get(hc),this.pluginService=Qo.get(xc),this.layerService=Qo.get(ms),this.pluginService.active(this,t),this.window.create({width:t.width,height:t.height,viewBox:t.viewBox,container:t.container,dpr:t.dpr||this.global.devicePixelRatio,canvasControled:!1!==t.canvasControled,title:t.title||"",canvas:t.canvas}),this.state="normal",this.renderCount=0,this.tryInitEventSystem(),this._background=null!==(e=t.background)&&void 0!==e?e:Eu,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.ReactDOM&&this.enableReactAttribute(t.ReactDOM),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||_u,this.supportInteractiveLayer=!1!==t.interactiveLayer,this.timeline=new Nn,this.ticker.addTimeline(this.timeline),this.timeline.pause(),t.optimize||(t.optimize={}),this.optmize(t.optimize),t.background&&nt(this._background)&&this._background.includes("/")&&this.setAttributes({background:this._background})}pauseRender(){this._skipRender=-1}resumeRender(){this._skipRender=0}tryInitEventSystem(){this.global.supportEvent&&!this._eventSystem&&(this._eventSystem=new zn(Object.assign({targetElement:this.window,resolution:this.window.dpr||this.global.devicePixelRatio,rootNode:this,global:this.global,supportsPointerEvents:this.params.supportsPointerEvents,supportsTouchEvents:this.params.supportsTouchEvents},this.params.event)))}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(){arguments.length>0&&void 0!==arguments[0]&&arguments[0]&&(this._skipRender=this._skipRender<0?this._skipRender:this.window.isVisible()?0:1,this.window.onVisibleChange(this._onVisibleChange))}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:o=0,beta:n=0,camera:r,fieldRatio:s=1,fieldDepth:l}=t;return Object.assign(Object.assign({},t),{center:e,light:i,alpha:o,beta:n,camera:r,fieldRatio:s,fieldDepth:l})}set3dOptions(t){var e,i,o,n,r,s;this.option3d=t;const l=this.get3dOptions(t),{light:a,center:h,camera:d,alpha:c,beta:u,fieldRatio:g,fieldDepth:p}=l,{dir:f=[1,1,-1],color:m="white",ambient:b}=a,v=(null!==(e=h.x)&&void 0!==e?e:this.width/2)+(null!==(i=h.dx)&&void 0!==i?i:0),y=(null!==(o=h.y)&&void 0!==o?o:this.height/2)+(null!==(n=h.dy)&&void 0!==n?n:0),C=[v,y,(null!==(r=h.z)&&void 0!==r?r:0)+(null!==(s=h.dz)&&void 0!==s?s:0)];let w=0,x=0,_=0;d||(w=Math.sin(c)+v,x=Math.sin(u)+y,_=Math.cos(c)*Math.cos(u)*1),this.light=new Su(f,m,b);const S={left:0,right:this.width,top:0,bottom:this.height,fieldRatio:g,fieldDepth:p,viewParams:{pos:[w,x,_],center:C,up:[0,1,0]}};this.camera?this.camera.params=S:this.camera=new Ru(S),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 mu))}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 fu))}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 bu))}disableIncrementalAutoRender(){this.increaseAutoRender&&(this.increaseAutoRender=!1,this.pluginService.findPluginsByName("IncrementalAutoRenderPlugin").forEach((t=>{this.pluginService.unRegister(t)})))}enableDirtyBounds(){if(this.dirtyBounds)return;this.dirtyBounds=new ye;let t=this.pluginService.findPluginsByName("DirtyBoundsPlugin")[0];t?t.activate(this.pluginService):(t=new Cu,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 xu))}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 vu))}disableHtmlAttribute(){this.htmlAttribute&&(this.htmlAttribute=!1,this.pluginService.findPluginsByName("HtmlAttributePlugin").forEach((t=>{this.pluginService.unRegister(t)})))}enableReactAttribute(t){this.reactAttribute||(this.reactAttribute=t,this.pluginService.register(new Pu))}disableReactAttribute(){this.reactAttribute&&(this.reactAttribute=!1,this.pluginService.findPluginsByName("ReactAttributePlugin").forEach((t=>{this.pluginService.unRegister(t)})))}getPluginsByName(t){return this.pluginService.findPluginsByName(t)}tryUpdateAABBBounds(){const t=this.window.getViewBox();return this._AABBBounds.setValue(t.x1,t.y1,t.x2,t.y2),this._AABBBounds}combineLayer(t,e){throw new Error("暂不支持")}createLayer(t,e){if("released"===this.releaseStatus)return;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(){"released"!==this.releaseStatus&&this.supportInteractiveLayer&&!this.interactiveLayer&&(this.interactiveLayer=this.createLayer(),this.interactiveLayer.name="_builtin_interactive",this.interactiveLayer.attribute.pickable=!1,this.nextFrameRenderLayerSet.add(this.interactiveLayer))}clearViewBox(t){this.window.clearViewBox(t)}render(t,e){if("released"===this.releaseStatus)return;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._skipRender||(this.renderLayerList(this.children),this.combineLayersToWindow(),this.nextFrameRenderLayerSet.clear()),this.hooks.afterRender.call(this)),this.state=i,this._skipRender&&this._skipRender++}combineLayersToWindow(){if("harmony"===this.global.env){const t=this.window.getContext().nativeContext;this.forEachChildren(((e,i)=>{if(i>0){const i=e.getNativeHandler().getContext().canvas.nativeCanvas.nativeCanvas._c.transferToImageBitmap();t.transferFromImageBitmap(i)}}))}}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(){if("released"===this.releaseStatus)return;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._skipRender||(this.renderLayerList(Array.from(this.nextFrameRenderLayerSet.values()),this.lastRenderparams||{}),this.combineLayersToWindow(),this.nextFrameRenderLayerSet.clear()),this.hooks.afterRender.call(this)),this.state=t,this._skipRender&&this._skipRender++}renderLayerList(t,e){const i=[];for(let e=0;e<t.length;e++){let o=t[e];"virtual"===o.layerMode&&(o=o.getNativeHandler().mainHandler.layer),i.includes(o)||i.push(o)}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()),viewBox:this.window.getViewBox(),transMatrix:this.window.getViewBoxTransform()},Object.assign({renderStyle:this.renderStyle},e)))})),this.interactiveLayer&&!t.includes(this.interactiveLayer)&&this.interactiveLayer.render({renderService:this.renderService,updateBounds:!(!this.dirtyBounds||this.dirtyBounds.empty()),viewBox:this.window.getViewBox(),transMatrix:this.window.getViewBoxTransform()},Object.assign({renderStyle:this.renderStyle},e))}resizeWindow(t,e){let i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.window.resize(t,e),i&&this.render()}resize(t,e){let i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];"released"!==this.releaseStatus&&(this.window.hasSubView()||this.viewBox.setValue(this.viewBox.x1,this.viewBox.y1,this.viewBox.x1+t,this.viewBox.y1+e),this.window.resize(t,e),this.forEachChildren((i=>{i.resize(t,e)})),this.camera&&this.option3d&&this.set3dOptions(this.option3d),i&&this.render())}resizeView(t,e){let i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];"released"!==this.releaseStatus&&(this.viewBox.setValue(this.viewBox.x1,this.viewBox.y1,this.viewBox.x1+t,this.viewBox.y1+e),this.forEachChildren((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,o,n){let r=!0;"object"==typeof t?(this.viewBox.setValue(t.x1,t.y1,t.x2,t.y2),!1===e&&(r=!1)):(this.viewBox.setValue(t,e,t+i,e+o),!1===n&&(r=!1)),this.forEachChildren((t=>{t.resizeView(this.viewBox.width(),this.viewBox.height())})),r&&this.render()}setDpr(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.forEachChildren((e=>{e.setDpr(t)})),e&&this.render()}setOrigin(t,e){throw new Error("暂不支持")}export(t){throw new Error("暂不支持")}pick(t,e){if("released"===this.releaseStatus)return;this.pickerService||(this.pickerService=Qo.get(uc));const i=this.pickerService.pick(this.children,new me(t,e),{bounds:this.AABBBounds});return!(!(null==i?void 0:i.graphic)&&!(null==i?void 0:i.group))&&i}startAnimate(t){throw new Error("暂不支持")}setToFrame(t){throw new Error("暂不支持")}release(){super.release(),this.hooks.beforeRender.unTap("constructor",this.beforeRender),this.hooks.afterRender.unTap("constructor",this.afterRender),this.eventSystem&&this.eventSystem.release(),this.layerService.releaseStage(this),this.pluginService.release(),this.forEach((t=>{t.release()})),this.interactiveLayer&&this.interactiveLayer.release(),this.window.release(),this.ticker.remTimeline(this.timeline),this.renderService.renderTreeRoots=[]}setStage(t){}dirty(t,e){"released"!==this.releaseStatus&&(e&&t.transformWithMatrix(e),this.dirtyBounds.empty()&&this.dirtyBounds.setValue(t.x1,t.y1,t.x2,t.y2),this.dirtyBounds.union(t))}getLayer(t){return this.children.filter((e=>e.name===t))[0]}renderTo(t){"released"!==this.releaseStatus&&this.forEachChildren(((e,i)=>{e.drawTo(t,{renderService:this.renderService,viewBox:t.getViewBox(),transMatrix:t.getViewBoxTransform(),background:e===this.defaultLayer?this.background:void 0,clear:0===i,updateBounds:!(!this.dirtyBounds||this.dirtyBounds.empty())})}))}renderToNewWindow(){let t=arguments.length>1?arguments[1]:void 0;if("released"===this.releaseStatus)return;const e=Qo.get(ln),i=t?-t.x1:0,o=t?-t.y1:0,n=t?t.x2:this.viewWidth,r=t?t.y2:this.viewHeight,s=t?t.width():this.viewWidth,l=t?t.height():this.viewHeight;return e.create({viewBox:{x1:i,y1:o,x2:n,y2:r},width:s,height:l,dpr:this.window.dpr,canvasControled:!0,offscreen:!0,title:""}),this.renderTo(e),e}toCanvas(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=arguments.length>1?arguments[1]:void 0;if("released"===this.releaseStatus)return;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}eventPointTransform(t){const e=this.global.mapToCanvasPoint(t,this.window.getContext().canvas.nativeCanvas);return this.stage.window.pointTransform(e.x,e.y)}pauseTriggerEvent(){this._eventSystem&&this._eventSystem.pauseTriggerEvent()}resumeTriggerEvent(){this._eventSystem&&this._eventSystem.resumeTriggerEvent()}}function Hu(t){return new Lu(t)}var zu=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s},Fu=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};const Iu={WIDTH:500,HEIGHT:500,DPR:1};let Ou=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:o=Iu.WIDTH,height:n=Iu.HEIGHT,dpr:r=Iu.DPR,x:s,y:l,id:a,canvasControled:h=!0}=t;this._x=null!=s?s:0,this._y=null!=l?l:0,this._pixelWidth=o*r,this._pixelHeight=n*r,this._visiable=!1!==t.visiable,this.controled=h,this._displayWidth=o,this._displayHeight=n,this._dpr=r,this._nativeCanvas=i,this._id=null!==(e=i.id)&&void 0!==e?e:a,a&&(i.id=a),this.init(t)}getNativeCanvas(){return this._nativeCanvas}hide(){}show(){}applyPosition(){}resetStyle(t){}resize(t,e){}toDataURL(t,e){return""}readPixels(t,e,i,o){return this._context.getImageData(t,e,i,o)}convertToBlob(t){throw new Error("暂未实现")}transferToImageBitmap(){throw new Error("暂未实现")}release(){this.controled&&this._nativeCanvas.parentElement&&this._nativeCanvas.parentElement.removeChild(this._nativeCanvas)}};Ou.env="browser",Ou=zu([y(),Fu("design:paramtypes",[Object])],Ou);var Du=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s};let Wu=class{configure(t){t.env===this.type&&t.setActiveEnvContribution(this)}getNativeAABBBounds(t){return new Ce}removeDom(t){return!1}createDom(t){return null}updateDom(t,e){return!1}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}}};Wu=Du([y()],Wu);var Nu=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s},Gu=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let ju=class{constructor(){this._uid=r.GenAutoIncrementId(),this.viewBox=new Ce,this.modelMatrix=new Se(1,0,0,1,0,0)}onChange(t){this._onChangeCb=t}configure(t,e){e.env===this.type&&t.setWindowHandler(this)}release(){this.releaseWindow()}isVisible(t){return!0}onVisibleChange(t){}getTopLeft(t){return{top:0,left:0}}setViewBox(t){this.viewBox.setValue(t.x1,t.y1,t.x2,t.y2)}getViewBox(){return this.viewBox}setViewBoxTransform(t,e,i,o,n,r){this.modelMatrix.setValue(t,e,i,o,n,r)}getViewBoxTransform(){return this.modelMatrix}};ju=Nu([y(),Gu("design:paramtypes",[])],ju);var Vu=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s},Uu=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},$u=function(t,e){return function(i,o){e(i,o,t)}};let Xu=class{constructor(t){this.pickItemInterceptorContributions=t,this.type="default",this.global=Oo.global}_init(){this.InterceptorContributions=this.pickItemInterceptorContributions.getContributions().sort(((t,e)=>t.order-e.order))}pick(t,e,i){let o={graphic:null,group:null};i.pickerService=this;const n=i.bounds.width(),r=i.bounds.height();if(!(new Ce).setValue(0,0,n,r).containsPoint(e))return o;this.pickContext&&(this.pickContext.inuse=!0),i.pickContext=this.pickContext,this.pickContext&&this.pickContext.clearMatrix(!0,1);const s=new Se(1,0,0,1,0,0);let l;for(let n=t.length-1;n>=0&&(o=t[n].isContainer?this.pickGroup(t[n],e,s,i):this.pickItem(t[n],e,s,i),!o.graphic);n--)l||(l=o.group);if(o.graphic||(o.group=l),this.pickContext&&(this.pickContext.inuse=!1),o.graphic){let t=o.graphic;for(;t.parent;)t=t.parent;t.shadowHost&&(o.params={shadowTarget:o.graphic},o.graphic=t.shadowHost)}return o}containsPoint(t,e,i){var o;return!!(null===(o=this.pickItem(t,e,null,null!=i?i:{pickContext:this.pickContext,pickerService:this}))||void 0===o?void 0:o.graphic)}pickGroup(t,e,i,o){let n={group:null,graphic:null};if(!1===t.attribute.visibleAll)return n;const r=o.pickContext,s=r.modelMatrix;if(r.camera){const e=t.transMatrix,i=Ga.allocate();if(Xa(i,e),s){if(i){const t=Ga.allocate();r.modelMatrix=Ya(t,s,i),Ga.free(i)}}else Xa(i,t.globalTransMatrix),r.modelMatrix=i}if(this.InterceptorContributions.length)for(let n=0;n<this.InterceptorContributions.length;n++){const l=this.InterceptorContributions[n];if(l.beforePickItem){const n=l.beforePickItem(t,this,e,o,{parentMatrix:i});if(n)return r.modelMatrix!==s&&Ga.free(r.modelMatrix),r.modelMatrix=s,n}}const l=t.transMatrix,a=Na.allocateByObj(i),h=new me(e.x,e.y);a.transformPoint(h,h);const d=t.AABBBounds.containsPoint(h);if(!d&&!t.stage.camera)return n;const c=this.pickItem(t,h.clone(),i,o);c&&c.graphic&&(n.graphic=c.graphic,n.params=c.params);const u=!1!==t.attribute.pickable&&d;return a.multiply(l.a,l.b,l.c,l.d,l.e,l.f),!1===t.attribute.childrenPickable||c&&c.graphic||Nc(t,_o.zIndex,(r=>{if(r.isContainer){const i=new me(e.x,e.y),s=_n(t).group,{scrollX:l=s.scrollX,scrollY:h=s.scrollY}=t.attribute;i.x-=l,i.y-=h,n=this.pickGroup(r,i,a,o)}else{const s=new me(e.x,e.y);a.transformPoint(s,s);const l=_n(t).group,{scrollX:h=l.scrollX,scrollY:d=l.scrollY}=t.attribute;s.x-=h,s.y-=d;const c=this.pickItem(r,s,i,o);c&&c.graphic&&(n.graphic=c.graphic,n.params=c.params)}return!!n.graphic||!!n.group}),!0,!!r.camera),r.modelMatrix!==s&&Ga.free(r.modelMatrix),r.modelMatrix=s,n.graphic||n.group||!u||t.stage.camera||(n.group=t),Na.free(a),n}selectPicker(t){return this.pickerMap.get(t.numberType)||null}};Xu=Vu([y(),$u(0,b(z)),$u(0,C(fc)),Uu("design:paramtypes",[Object])],Xu);let Yu=!1;const Ku=new s((t=>{Yu||(Yu=!0,t(Oh).toSelf().inSingletonScope(),t(Id).to(Oh).inSingletonScope(),t(Dd).toService(Id),t(Is).toService(ch),I(t,Is))}));let qu=!1;const Zu=new s((t=>{qu||(qu=!0,t(cd).toSelf().inSingletonScope(),t(Vd).to(cd).inSingletonScope(),t(Dd).toService(Vd),t(Bh).toSelf(),t(Ah).toSelf(),t(Vs).toService(Bh),t(Vs).toService(Ah),t(Vs).toService(ch),I(t,Vs))}));let Ju=!1;const Qu=new s((t=>{Ju||(Ju=!0,t($h).toSelf().inSingletonScope(),t(Qc).toSelf().inSingletonScope(),t(Nd).to($h).inSingletonScope(),t(Dd).toService(Nd))}));let tg=!1;const eg=new s((t=>{tg||(tg=!0,t(fd).toSelf().inSingletonScope(),t(Ud).to(fd).inSingletonScope(),t(Dd).toService(Ud),t(Us).toService(ch),I(t,Us))}));let ig=!1;const og=new s((t=>{ig||(ig=!0,t(Gh).toSelf().inSingletonScope(),t(Od).to(Gh).inSingletonScope(),t(Dd).toService(Od),t(Ds).toService(ch),I(t,Ds))}));let ng=!1;const rg=new s((t=>{ng||(ng=!0,t($d).to(wd).inSingletonScope(),t(Dd).toService($d),t($s).toService(ch),I(t,$s))}));let sg=!1;const lg=new s((t=>{sg||(sg=!0,t(ld).toSelf().inSingletonScope(),t(Gd).to(ld).inSingletonScope(),t(Dd).toService(Gd),t(Gs).toService(ch),I(t,Gs))}));let ag=!1;const hg=new s((t=>{ag||(ag=!0,t(jd).to(kd).inSingletonScope(),t(Dd).toService(jd),t(js).toService(ch),I(t,js))}));var dg=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s},cg=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let ug=class extends eh{constructor(){super(),this.numberType=os,this.builtinContributions=[bd],this.init()}drawShape(t,e,i,o,n){const r=_n(t).richtext,{strokeOpacity:s=r.strokeOpacity,opacity:l=r.opacity,fillOpacity:a=r.fillOpacity,visible:h=r.visible}=t.attribute;if(!t.valid||!h)return;const d=Rs(l,a,!0),c=Rs(l,s,!0);d&&(e.translate(i,o),this.beforeRenderStep(t,e,i,o,d,c,d,c,r,n),t.getFrameCache().draw(e,this.drawIcon),this.afterRenderStep(t,e,i,o,d,c,d,c,r,n))}drawIcon(t,e,i,o,n){var r;const s=_n(t).richtextIcon,{width:l=s.width,height:a=s.height,opacity:h=s.opacity,image:d,backgroundFill:c=s.backgroundFill,backgroundFillOpacity:u=s.backgroundFillOpacity,backgroundStroke:g=s.backgroundStroke,backgroundStrokeOpacity:p=s.backgroundStrokeOpacity,backgroundRadius:f=s.backgroundRadius,margin:m}=t.attribute,{backgroundWidth:b=l,backgroundHeight:v=a}=t.attribute;if(m&&(i+=t._marginArray[3],o+=t._marginArray[0]),t._hovered){const t=(b-l)/2,n=(v-a)/2;0===f?(e.beginPath(),e.rect(i-t,o-n,b,v)):(e.beginPath(),xh(e,i-t,o-n,b,v,f)),c&&(e.globalAlpha=u,e.fillStyle=c,e.fill()),g&&(e.globalAlpha=p,e.strokeStyle=g,e.stroke())}const y=d&&(null===(r=null==t?void 0:t.resources)||void 0===r?void 0:r.get(d));y&&"success"===y.state&&(e.globalAlpha=h,e.drawImage(y.data,i,o,l,a))}draw(t,e,i){const o=_n(t).richtext;this._draw(t,o,!1,i)}};ug=dg([y(),cg("design:paramtypes",[])],ug);let gg=!1;const pg=new s((t=>{gg||(gg=!0,t(Xd).to(ug).inSingletonScope(),t(Dd).toService(Xd))}));let fg=!1;const mg=new s((t=>{fg||(fg=!0,t(Yd).to(zd).inSingletonScope(),t(Dd).toService(Yd),t(Ns).toService(ch),I(t,Ns))}));const bg=["x","y","dx","dy","scaleX","scaleY","angle","anchor","postMatrix","visible","clip","pickable","childrenPickable","zIndex","cursor"];class vg extends cs{constructor(t,e){super(t),(null==e?void 0:e.mode)&&(this.mode=e.mode,this.setMode(e.mode)),(null==e?void 0:e.skipDefault)&&(this.skipDefault=!0),this.setTheme({common:{strokeBoundsBuffer:0}}),this.attribute=t,this.onSetStage((()=>{this.render(),this.bindEvents()}))}setAttribute(t,e,i){it(this.attribute[t])&&it(e)&&!Z(this.attribute[t])&&!Z(e)?St(this.attribute[t],e):this.attribute[t]=e,bg.includes(t)||this.render(),this.valid=this.isValid(),this.updateShapeAndBoundsTagSetted()||!i&&!this.needUpdateTag(t)?this.addUpdateBoundTag():this.addUpdateShapeAndBoundsTag(),this.addUpdatePositionTag(),this.onAttributeUpdate()}setAttributes(t,e){const i=Object.keys(t);this._mergeAttributes(t,i),i.every((t=>bg.includes(t)))||this.render(),this.valid=this.isValid(),this.updateShapeAndBoundsTagSetted()||!e&&!this.needUpdateTags(i)?this.addUpdateBoundTag():this.addUpdateShapeAndBoundsTag(),this.addUpdatePositionTag(),this.onAttributeUpdate()}_mergeAttributes(t,e){J(e)&&(e=Object.keys(t));for(let i=0;i<e.length;i++){const o=e[i];!it(this.attribute[o])||Z(this.attribute[o])||Z(t[o])?this.attribute[o]=t[o]:St(this.attribute[o],t[o])}}bindEvents(){}_getNodeId(t){var e;return`${null!==(e=this.id)&&void 0!==e?e:this._uid}-${this.name}-${t}`}_dispatchEvent(t,e){var i;const o=new kn(t,e);o.manager=null===(i=this.stage)||void 0===i?void 0:i.eventSystem.manager,this.dispatchEvent(o)}}const yg=Symbol.for("MathPickerContribution"),Cg=Symbol.for("MathArcPicker"),wg=Symbol.for("MathCirclePicker"),xg=Symbol.for("MathImagePicker"),_g=Symbol.for("MathLinePicker"),Sg=Symbol.for("MathPathPicker"),Ag=Symbol.for("MathRectPicker"),Bg=Symbol.for("MathSymbolPicker"),Rg=Symbol.for("MathTextPicker"),Mg=Symbol.for("MathPolygonPicker"),Tg=Symbol.for("CanvasArcPicker"),kg=Symbol.for("CanvasCirclePicker"),Pg=Symbol.for("CanvasImagePicker"),Eg=Symbol.for("CanvasLinePicker"),Lg=Symbol.for("CanvasPathPicker"),Hg=Symbol.for("CanvasRectPicker"),zg=Symbol.for("CanvasSymbolPicker"),Fg=Symbol.for("CanvasTextPicker"),Ig=Symbol.for("CanvasPolygonPicker"),Og=Symbol.for("CanvasRichTextPicker"),Dg=Symbol.for("CanvasGroupPicker"),Wg=Symbol.for("CanvasPickerContribution"),Ng={onPointerDown:"pointerdown",onPointerUp:"pointerup",onPointerUpOutside:"pointerupoutside",onPointerTap:"pointertap",onPointerOver:"pointerover",onPointerMove:"pointermove",onPointerEnter:"pointerenter",onPointerLeave:"pointerleave",onPointerOut:"pointerout",onMouseDown:"mousedown",onMouseUp:"mouseup",onMouseUpOutside:"mouseupoutside",onMouseMove:"mousemove",onMouseOver:"mouseover",onMouseOut:"mouseout",onMouseEnter:"mouseenter",onMouseLeave:"mouseleave",onPinch:"pinch",onPinchStart:"pinchstart",onPinchEnd:"pinchend",onPan:"pan",onPanStart:"panstart",onPanEnd:"panend",onDrag:"drag",onDragStart:"dragstart",onDragEnter:"dragenter",onDragLeave:"dragleave",onDragOver:"dragover",onDragEnd:"dragend",onRightDown:"rightdown",onRightUp:"rightup",onRightUpOutside:"rightupoutside",onTouchStart:"touchstart",onTouchEnd:"touchend",onTouchEndOutside:"touchendoutside",onTouchMove:"touchmove",onTouchCancel:"touchcancel",onPress:"press",onPressUp:"pressup",onPressEnd:"pressend",onSwipe:"swipe",onDrop:"drop",onWeel:"wheel",onClick:"click",onDblClick:"dblclick"},Gg=(t,e)=>{const i=e.x-t.x,o=e.y-t.y;return Math.abs(i)>Math.abs(o)?i>0?"right":"left":o>0?"down":"up"},jg=(t,e)=>{const i=Math.abs(e.x-t.x),o=Math.abs(e.y-t.y);return Math.sqrt(i*i+o*o)};class Vg extends Y{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};var i,o,n,r,s,l,a,h,d,c;super(),this.cachedEvents=[],this.startPoints=[],this.processEvent={},this.throttleTimer=0,this.emitThrottles=[],this.lastTapTarget=null,this.onStart=t=>{this.reset(),this.startTime=Pn.now();const{cachedEvents:e,startPoints:i}=this;t&&e.push(t.clone()),i.length=e.length;for(let t=0;t<e.length;t++){const{x:o,y:n}=e[t],r={x:o,y:n};i[t]=r}if(1!==i.length)this.startDistance=jg(i[0],i[1]),this.center=(t=>{const e=t.length;if(1===e)return{x:Math.round(t[0].x),y:Math.round(t[0].y)};let i=0,o=0,n=0;for(;n<e;)i+=t[n].x,o+=t[n].y,n++;return{x:Math.round(i/e),y:Math.round(o/e)}})([i[0],i[1]]);else{const t=e[0];this.pressTimeout=setTimeout((()=>{t.direction="none",t.deltaX=0,t.deltaY=0,t.points=i,this.triggerStartEvent("press",t),this.triggerEvent("press",t),this.eventType="press",this.direction="none"}),this.config.press.time)}},this.onMove=t=>{this.clearPressTimeout();const{startPoints:e,cachedEvents:i}=this;if(!e.length)return;const o=t.clone(),{x:n,y:r,pointerId:s}=o;for(let t=0,e=i.length;t<e;t++)if(s===i[t].pointerId){i[t]=o;break}const l={x:n,y:r},a=i.map((t=>({x:t.x,y:t.y}))),h=Pn.now();if(this.prevMoveTime=this.lastMoveTime,this.prevMovePoint=this.lastMovePoint,this.lastMoveTime=h,this.lastMovePoint=l,1===e.length){const t=e[0],i=n-t.x,s=r-t.y,h=this.direction||Gg(t,l);this.direction=h;const d=this.getEventType(l);return o.direction=h,o.deltaX=i,o.deltaY=s,o.points=a,this.triggerStartEvent(d,o),void this.triggerEvent(d,o)}const{startDistance:d}=this,c=jg(a[0],a[1]);o.scale=c/d,o.center=this.center,o.points=a,this.triggerStartEvent("pinch",o),this.triggerEvent("pinch",o)},this.onEnd=t=>{const e=t.clone(),{cachedEvents:i,startPoints:o}=this,n=i.map((t=>({x:t.x,y:t.y})));if(e.points=n,this.triggerEndEvent(e),1===i.length){const i=Pn.now(),n=this.lastMoveTime;if(i-n<100){const t=n-(this.prevMoveTime||this.startTime);if(t>0){const i=this.prevMovePoint||o[0],n=this.lastMovePoint||o[0],r=jg(i,n),s=r/t;s>this.config.swipe.velocity&&r>this.config.swipe.threshold&&(e.velocity=s,e.direction=Gg(i,n),this.triggerEvent("swipe",e))}}i-this.lastTapTime<this.config.tap.interval&&t.target===this.lastTapTarget?this.tapCount++:this.tapCount=1,this.lastTapTime=i,this.lastTapTarget=t.target,1===this.tapCount?this.triggerEvent("tap",e):2===this.tapCount&&(this.triggerEvent("doubletap",e),this.tapCount=0)}for(let t=0,n=i.length;t<n;t++)if(i[t].pointerId===e.pointerId){i.splice(t,1),o.splice(t,1);break}this.reset(),i.length>0&&this.onStart()},this.element=t,this.tapCount=0,this.lastTapTime=0,this.config={press:{time:null!==(o=null===(i=null==e?void 0:e.press)||void 0===i?void 0:i.time)&&void 0!==o?o:251,threshold:null!==(r=null===(n=null==e?void 0:e.press)||void 0===n?void 0:n.threshold)&&void 0!==r?r:9},swipe:{threshold:null!==(l=null===(s=null==e?void 0:e.swipe)||void 0===s?void 0:s.threshold)&&void 0!==l?l:10,velocity:null!==(h=null===(a=null==e?void 0:e.swipe)||void 0===a?void 0:a.velocity)&&void 0!==h?h:.3},tap:{interval:null!==(c=null===(d=null==e?void 0:e.tap)||void 0===d?void 0:d.interval)&&void 0!==c?c:300}},this.initEvents()}initEvents(){const{element:t}=this;t&&(t.addEventListener("pointerdown",this.onStart),t.addEventListener("pointermove",this.onMove),t.addEventListener("pointerup",this.onEnd),t.addEventListener("pointerupoutside",this.onEnd))}removeEvents(){const{element:t}=this;t&&(t.removeEventListener("pointerdown",this.onStart),t.removeEventListener("pointermove",this.onMove),t.removeEventListener("pointerup",this.onEnd),t.removeEventListener("pointerupoutside",this.onEnd))}release(){this.removeEvents(),this.element=null}getEventType(t){const{eventType:e,startTime:i,startPoints:o}=this;if(e)return e;let n;return n=Pn.now()-i>this.config.press.time&&jg(o[0],t)<this.config.press.threshold?"press":"pan",this.eventType=n,n}enable(t){this.processEvent[t]=!0}isProcess(t){return this.processEvent[t]}pushEvent(t,e){const{emitThrottles:i}=this,o={type:t,ev:e};for(let e=0,n=i.length;e<n;e++)if(i[e].type===t)return void i.splice(e,1,o);i.push(o)}clearPressTimeout(){this.pressTimeout&&(clearTimeout(this.pressTimeout),this.pressTimeout=null)}reset(){this.clearPressTimeout(),this.startTime=0,this.startDistance=0,this.direction=null,this.eventType=null,this.prevMoveTime=0,this.prevMovePoint=null,this.lastMoveTime=0,this.lastMovePoint=null}triggerEvent(t,e){this.pushEvent(t,e);const{throttleTimer:i,emitThrottles:o}=this;i||(this.throttleTimer=Oo.global.getRequestAnimationFrame()((()=>{for(let t=0,e=o.length;t<e;t++){const{type:e,ev:i}=o[t];this.emitEvent(e,i)}this.throttleTimer=0,this.emitThrottles.length=0})))}triggerStartEvent(t,e){this.isProcess(t)||(this.enable(t),this.triggerEvent(`${t}start`,e))}triggerEndEvent(t){const e=this.processEvent;Object.keys(e).forEach((i=>{this.triggerEvent(`${i}end`,t),"press"===i&&this.triggerEvent(`${i}up`,t),delete e[i]}))}emitEvent(t,e){const i=this.element._events["*"];if(i)if("fn"in i)i.fn.call(i.context,e,t);else for(let o=0,n=i.length;o<n&&!e.propagationImmediatelyStopped;o++)i[o].fn.call(i[o].context,e,t);this.emit(t,e)}}var Ug=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s},$g=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};const Xg=[0,0,0];let Yg=class{set fillStyle(t){this.nativeContext.fillStyle=t}get fillStyle(){return this.nativeContext.fillStyle}set font(t){this.nativeContext.font=t}get font(){return this.nativeContext.font}set globalAlpha(t){this.nativeContext.globalAlpha=t*this.baseGlobalAlpha}get globalAlpha(){return this.nativeContext.globalAlpha}set lineCap(t){this.nativeContext.lineCap=t}get lineCap(){return this.nativeContext.lineCap}set lineDashOffset(t){this.nativeContext.lineDashOffset=t}get lineDashOffset(){return this.nativeContext.lineDashOffset}set lineJoin(t){this.nativeContext.lineJoin=t}get lineJoin(){return this.nativeContext.lineJoin}set lineWidth(t){this.nativeContext.lineWidth=t}get lineWidth(){return this.nativeContext.lineWidth}set miterLimit(t){this.nativeContext.miterLimit=t}get miterLimit(){return this.nativeContext.miterLimit}set shadowBlur(t){this.nativeContext.shadowBlur=t}get shadowBlur(){return this.nativeContext.shadowBlur}set shadowColor(t){this.nativeContext.shadowColor=t}get shadowColor(){return this.nativeContext.shadowColor}set shadowOffsetX(t){this.nativeContext.shadowOffsetX=t}get shadowOffsetX(){return this.nativeContext.shadowOffsetX}set shadowOffsetY(t){this.nativeContext.shadowOffsetY=t}get shadowOffsetY(){return this.nativeContext.shadowOffsetY}set strokeStyle(t){this.nativeContext.strokeStyle=t}get strokeStyle(){return this.nativeContext.strokeStyle}set textAlign(t){this.nativeContext.textAlign=t}get textAlign(){return this.nativeContext.textAlign}set textBaseline(t){this.nativeContext.textBaseline=t}get textBaseline(){return this.nativeContext.textBaseline}get inuse(){return!!this._inuse}set inuse(t){t!==!!this._inuse&&(this._inuse=t,t?(this.nativeContext.save(),this.reset()):this.nativeContext.restore())}constructor(t,e){this.fillAttributes=Object.assign(Object.assign({},bo),{opacity:1}),this.strokeAttributes=Object.assign(Object.assign({},yo),{opacity:1}),this.textAttributes=Object.assign(Object.assign({},Co),{opacity:1}),this._clearShadowStyle=!1,this._clearFilterStyle=!1,this._clearGlobalCompositeOperationStyle=!1;const i=t.nativeCanvas.getContext("2d");if(!i)throw new Error("发生错误,获取2d上下文失败");this.nativeContext=i,this.canvas=t,this.matrix=new Se(1,0,0,1,0,0),this.stack=[],this.dpr=e,this.applyedMatrix=new Se(1,0,0,1,0,0),this._clearMatrix=new Se(1,0,0,1,0,0),this.baseGlobalAlpha=1}reset(){this.stack.length&&Wt.getInstance().warn("可能存在bug,matrix没有清空"),this.matrix.setValue(1,0,0,1,0,0),this.applyedMatrix=new Se(1,0,0,1,0,0),this.stack.length=0,this.nativeContext.setTransform(1,0,0,1,0,0)}getCanvas(){return this.canvas}getContext(){return this.nativeContext}setTransformForCurrent(){!(arguments.length>0&&void 0!==arguments[0]&&arguments[0])&&this.applyedMatrix.equalToMatrix(this.matrix)||(this.applyedMatrix.setValue(this.matrix.a,this.matrix.b,this.matrix.c,this.matrix.d,this.matrix.e,this.matrix.f),this.nativeContext.setTransform(this.matrix.a,this.matrix.b,this.matrix.c,this.matrix.d,this.matrix.e,this.matrix.f))}get currentMatrix(){return this.matrix}cloneMatrix(t){return Na.allocateByObj(t)}clear(){this.save(),this.resetTransform(),this.nativeContext.clearRect(0,0,this.canvas.width,this.canvas.height),this.restore()}restore(){this.nativeContext.restore(),this.stack.length>0&&(Na.free(this.matrix),this.matrix=this.stack.pop(),this.setTransformForCurrent(!0))}highPerformanceRestore(){this.stack.length>0&&(Na.free(this.matrix),this.matrix=this.stack.pop())}rotate(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.matrix.rotate(t),e&&this.setTransformForCurrent()}save(){const t=this.cloneMatrix(this.matrix);this.stack.push(t),this.nativeContext.save()}highPerformanceSave(){const t=this.cloneMatrix(this.matrix);this.stack.push(t)}scale(t,e){let i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.matrix.scale(t,e),i&&this.setTransformForCurrent()}setScale(t,e){let i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.matrix.setScale(t,e),i&&this.setTransformForCurrent()}scalePoint(t,e,i,o){let n=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];this.translate(i,o,!1),this.scale(t,e,!1),this.translate(-i,-o,!1),n&&this.setTransformForCurrent()}setTransform(t,e,i,o,n,r){let s=!(arguments.length>6&&void 0!==arguments[6])||arguments[6],l=arguments.length>7&&void 0!==arguments[7]?arguments[7]:this.dpr;this.matrix.setValue(l*t,l*e,l*i,l*o,l*n,l*r),s&&this.setTransformForCurrent()}setTransformFromMatrix(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.dpr;this.matrix.setValue(t.a*i,t.b*i,t.c*i,t.d*i,t.e*i,t.f*i),e&&this.setTransformForCurrent()}resetTransform(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.dpr;this.setTransform(e,0,0,e,0,0),t&&this.setTransformForCurrent()}transform(t,e,i,o,n,r){let s=!(arguments.length>6&&void 0!==arguments[6])||arguments[6];this.matrix.multiply(t,e,i,o,n,r),s&&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){let i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.matrix.translate(t,e),i&&this.setTransformForCurrent()}rotateDegrees(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const i=t*Math.PI/180;this.rotate(i,e)}rotateAbout(t,e,i){let o=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];this.translate(e,i,!1),this.rotate(t,!1),this.translate(-e,-i,!1),o&&this.setTransformForCurrent()}rotateDegreesAbout(t,e,i){let o=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];this.translate(e,i,!1),this.rotateDegrees(t,!1),this.translate(-e,-i,!1),o&&this.setTransformForCurrent()}beginPath(){this.disableBeginPath||this.nativeContext.beginPath()}clip(t,e){t?"string"==typeof t?this.nativeContext.clip(t):this.nativeContext.clip(t,e):this.nativeContext.clip()}arc(t,e,i,o,n,r,s){if(s=s||0,this.camera){const l=[];((t,e,i,o,n,r,s,l)=>{if(l)for(;i>e;)i-=ne;else for(;i<e;)i+=ne;const a=ee/3*(i>e?1:-1);let h=e,d=h;for(;d!==i;){d=a>0?Math.min(d+a,i):Math.max(d+a,i);const e=Math.abs(d-h),l=4*Math.tan(e/4)/3,c=d<h?-1:1,u=Math.cos(h),g=Math.sin(h),p=Math.cos(d),f=Math.sin(d),m=u*r+o,b=g*s+n,v=p*r+o,y=f*s+n,C=r*l*c,w=s*l*c;t.push([m-C*g,b+w*u,v+C*f,y-w*p,v,y]),h=d}})(l,o,n,t,e,i,i,r);for(let t=0;t<l.length;++t){const e=l[t];this.bezierCurveTo(e[0],e[1],e[2],e[3],e[4],e[5],s)}}else this.nativeContext.arc(t,e,i,o,n,r)}arcTo(t,e,i,o,n){this.nativeContext.arcTo(t,e,i,o,n)}bezierCurveTo(t,e,i,o,n,r,s){if(s=s||0,this.camera){let l=s,a=s;this.modelMatrix&&(Bu(Xg,[t,e,s],this.modelMatrix),t=Xg[0],e=Xg[1],l=Xg[2],Bu(Xg,[i,o,s],this.modelMatrix),i=Xg[0],o=Xg[1],a=Xg[2],Bu(Xg,[n,r,s],this.modelMatrix),n=Xg[0],r=Xg[1],s=Xg[2]);let h=this.camera.vp(n,r,s);n=h.x,r=h.y,h=this.camera.vp(t,e,l),t=h.x,e=h.y,h=this.camera.vp(i,o,a),i=h.x,o=h.y}this.nativeContext.bezierCurveTo(t,e,i,o,n,r)}closePath(){this.nativeContext.closePath()}ellipse(t,e,i,o,n,r,s,l){null==l?this.nativeContext.ellipse(t,e,i,o,n,r,s):this.nativeContext.ellipse(t,e,i,o,n,r,s,l)}lineTo(t,e,i){if(i=i||0,this.camera){this.modelMatrix&&(Bu(Xg,[t,e,i],this.modelMatrix),t=Xg[0],e=Xg[1],i=Xg[2]);const o=this.camera.vp(t,e,i);t=o.x,e=o.y}this.nativeContext.lineTo(t,e)}moveTo(t,e,i){if(i=i||0,this.camera){this.modelMatrix&&(Bu(Xg,[t,e,i],this.modelMatrix),t=Xg[0],e=Xg[1],i=Xg[2]);const o=this.camera.vp(t,e,i);t=o.x,e=o.y}this.nativeContext.moveTo(t,e)}quadraticCurveTo(t,e,i,o,n){if(n=n||0,this.camera){let r=n;this.modelMatrix&&(Bu(Xg,[t,e,n],this.modelMatrix),t=Xg[0],e=Xg[1],r=Xg[2],Bu(Xg,[i,o,n],this.modelMatrix),i=Xg[0],o=Xg[1],n=Xg[2]);let s=this.camera.vp(i,o,n);i=s.x,o=s.y,s=this.camera.vp(t,e,r),t=s.x,e=s.y}this.nativeContext.quadraticCurveTo(t,e,i,o)}rect(t,e,i,o,n){n=n||0,this.camera?(this.moveTo(t,e,n),this.lineTo(t+i,e,n),this.lineTo(t+i,e+o,n),this.lineTo(t,e+o,n),this.closePath()):this.nativeContext.rect(t,e,i,o)}createImageData(){const t=arguments;return 2===t.length?this.nativeContext.createImageData(t[0],t[1]):1===t.length?this.nativeContext.createImageData(t[0]):null}createLinearGradient(t,e,i,o){return this.nativeContext.createLinearGradient(t,e,i,o)}createPattern(t,e){return 0===t.width||0===t.height?null:this.nativeContext.createPattern(t,e)}createRadialGradient(t,e,i,o,n,r){return this.nativeContext.createRadialGradient(t,e,i,o,n,r)}createConicGradient(t,e,i,o){let n,r=!1;const s=this;return{stops:[],addColorStop(t,e){this.stops.push([t,e]),r=!0},GetPattern(l,a,h){return r&&(h||(h=o-i),n=function(t,e,i,o,n,r,s,l,a){const h=Math.floor(180*n/Math.PI),d=Hs.GetCanvas(),c=Hs.GetCtx();if(!c)return null;const u=Fs.GetSize(l),g=Fs.GetSize(a);let p=Fs.Get(e,i,o,r,s,u,g);if(p)return p;const f=Math.sqrt(Math.max(Math.max(Math.pow(i,2)+Math.pow(o,2),Math.pow(u-i,2)+Math.pow(o,2)),Math.max(Math.pow(u-i,2)+Math.pow(g-o,2),Math.pow(i,2)+Math.pow(g-o,2)))),m=h+1,b=n/Math.max(1,m-1),v=zs.getInstance().GetOrCreate(i,o,u,g,e,m),y=2*Math.PI*f/360;d.width=u,d.height=g,c.setTransform(1,0,0,1,0,0),c.clearRect(0,0,u,g),c.translate(i,o),c.rotate(r);for(let t=0,e=m-1;t<e&&!(r+t*b>s);t++){const e=v.getColor(t);c.beginPath(),c.rotate(b),c.moveTo(0,0),c.lineTo(f,-2*y),c.lineTo(f,0),c.fillStyle=e,c.closePath(),c.fill()}const C=c.getImageData(0,0,u,g);return d.width=C.width,d.height=C.height,c.putImageData(C,0,0),p=t.createPattern(d,"no-repeat"),p&&Fs.Set(e,i,o,r,s,p,u,g),p}(s,this.stops,t,e,h,i,o,l,a),r=!1),n}}}fill(t,e){this.disableFill||(t?this.nativeContext.fill(t):this.nativeContext.fill())}fillRect(t,e,i,o){this.nativeContext.fillRect(t,e,i,o)}clearRect(t,e,i,o){this.nativeContext.clearRect(t,e,i,o)}project(t,e,i){if(i=i||0,this.camera){this.modelMatrix&&(Bu(Xg,[t,e,i],this.modelMatrix),t=Xg[0],e=Xg[1],i=Xg[2]);const o=this.camera.vp(t,e,i);t=o.x,e=o.y}return{x:t,y:e}}view(t,e,i){return i=i||0,this.camera?(this.modelMatrix&&(Bu(Xg,[t,e,i],this.modelMatrix),t=Xg[0],e=Xg[1],i=Xg[2]),this.camera.view(t,e,i)):[t,e,i]}fillText(t,e,i,o){if(o=o||0,this.camera){this.modelMatrix&&(Bu(Xg,[e,i,o],this.modelMatrix),e=Xg[0],i=Xg[1],o=Xg[2]);const t=this.camera.vp(e,i,o);e=t.x,i=t.y}this.nativeContext.fillText(t,e,i)}getImageData(t,e,i,o){return this.nativeContext.getImageData(t,e,i,o)}getLineDash(){return this.nativeContext.getLineDash()}isPointInPath(t,e){return this.nativeContext.isPointInPath(t,e)}isPointInStroke(t,e){return this.nativeContext.isPointInStroke(t,e)}measureText(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Oo.global.measureTextMethod;var i,o;if(!e||"native"===e)return this.nativeContext.measureText(t);this.mathTextMeasure||(this.mathTextMeasure=Oo.graphicUtil.createTextMeasureInstance({},{},(()=>this.canvas.nativeCanvas)));const n=null!==(i=this.fontFamily)&&void 0!==i?i:Co.fontFamily,r=null!==(o=this.fontSize)&&void 0!==o?o:Co.fontSize;return this.mathTextMeasure.textSpec.fontFamily===n&&this.mathTextMeasure.textSpec.fontSize===r||(this.mathTextMeasure.textSpec.fontFamily=n,this.mathTextMeasure.textSpec.fontSize=r,this.mathTextMeasure._numberCharSize=null,this.mathTextMeasure._fullCharSize=null,this.mathTextMeasure._letterCharSize=null,this.mathTextMeasure._specialCharSizeMap={}),this.mathTextMeasure.measure(t,e)}putImageData(t,e,i){this.nativeContext.putImageData(t,e,i)}setLineDash(t){const e=arguments,i=this.nativeContext;this.nativeContext.setLineDash?e[0]&&i.setLineDash(e[0]):"mozDash"in i?i.mozDash=e[0]:"webkitLineDash"in i&&(i.webkitLineDash=e[0])}stroke(t){this.disableStroke||(t?this.nativeContext.stroke(t):this.nativeContext.stroke())}strokeRect(t,e,i,o){this.nativeContext.strokeRect(t,e,i,o)}strokeText(t,e,i,o){if(o=o||0,this.camera){this.modelMatrix&&(Bu(Xg,[e,i,o],this.modelMatrix),e=Xg[0],i=Xg[1],o=Xg[2]);const t=this.camera.vp(e,i,o);e=t.x,i=t.y}this.nativeContext.strokeText(t,e,i)}drawImage(){const t=this.nativeContext,e=arguments;3===e.length?t.drawImage(e[0],e[1],e[2]):5===e.length?t.drawImage(e[0],e[1],e[2],e[3],e[4]):9===e.length&&t.drawImage(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])}setCommonStyle(t,e,i,o,n){if(Array.isArray(n)){if(n.length<=1)return this._setCommonStyle(t,e,i,o,n[0]);const r=Object.create(n[0]);return n.forEach(((t,e)=>{0!==e&&Object.assign(r,t)})),this._setCommonStyle(t,e,i,o,r)}return this._setCommonStyle(t,e,i,o,n)}_setCommonStyle(t,e,i,o,n){const r=this.nativeContext;n||(n=this.fillAttributes);const{fillOpacity:s=n.fillOpacity,opacity:l=n.opacity,fill:a=n.fill}=e;s>1e-12&&l>1e-12?(r.globalAlpha=s*l*this.baseGlobalAlpha,r.fillStyle=rh(this,a,t,i,o)):r.globalAlpha=s*l*this.baseGlobalAlpha}setShadowBlendStyle(t,e,i){if(Array.isArray(i)){if(i.length<=1)return this._setShadowBlendStyle(t,i[0]);const o=Object.create(i[0]);return i.forEach(((t,e)=>{0!==e&&Object.assign(o,t)})),this._setShadowBlendStyle(t,e,o)}return this._setShadowBlendStyle(t,e,i)}_setShadowBlendStyle(t,e,i){const o=this.nativeContext;i||(i=this.fillAttributes);const{opacity:n=i.opacity,shadowBlur:r=i.shadowBlur,shadowColor:s=i.shadowColor,shadowOffsetX:l=i.shadowOffsetX,shadowOffsetY:a=i.shadowOffsetY,blur:h=i.blur,globalCompositeOperation:d=i.globalCompositeOperation}=e;n<=1e-12||(r||l||a?(o.shadowBlur=r*this.dpr,o.shadowColor=s,o.shadowOffsetX=l*this.dpr,o.shadowOffsetY=a*this.dpr,this._clearShadowStyle=!0):this._clearShadowStyle&&(o.shadowBlur=0,o.shadowOffsetX=0,o.shadowOffsetY=0),h?(o.filter=`blur(${h}px)`,this._clearFilterStyle=!0):this._clearFilterStyle&&(o.filter="blur(0px)",this._clearFilterStyle=!1),d?(o.globalCompositeOperation=d,this._clearGlobalCompositeOperationStyle=!0):this._clearGlobalCompositeOperationStyle&&(o.globalCompositeOperation="source-over",this._clearGlobalCompositeOperationStyle=!1))}setStrokeStyle(t,e,i,o,n){if(Array.isArray(n)){if(n.length<=1)return this._setStrokeStyle(t,e,i,o,n[0]);const r=Object.create(n[0]);return n.forEach(((t,e)=>{0!==e&&Object.assign(r,t)})),this._setStrokeStyle(t,e,i,o,r)}return this._setStrokeStyle(t,e,i,o,n)}_setStrokeStyle(t,e,i,o,n){const r=this.nativeContext;n||(n=this.strokeAttributes);const{strokeOpacity:s=n.strokeOpacity,opacity:l=n.opacity}=e;if(s>1e-12&&l>1e-12){const{lineWidth:a=n.lineWidth,stroke:h=n.stroke,lineJoin:d=n.lineJoin,lineDash:c=n.lineDash,lineCap:u=n.lineCap,miterLimit:g=n.miterLimit}=e;r.globalAlpha=s*l*this.baseGlobalAlpha,r.lineWidth=nh(this,a,this.dpr),r.strokeStyle=rh(this,h,t,i,o),r.lineJoin=d,c&&r.setLineDash(c),r.lineCap=u,r.miterLimit=g}}setTextStyleWithoutAlignBaseline(t,e,i){const o=this.nativeContext;e||(e=this.textAttributes);const{scaleIn3d:n=e.scaleIn3d}=t;t.font?o.font=t.font:o.font=Zs(t,e,n&&this.camera&&this.camera.getProjectionScale(i));const{fontFamily:r=e.fontFamily,fontSize:s=e.fontSize}=t;this.fontFamily=r,this.fontSize=s,o.textAlign="left",o.textBaseline="alphabetic"}setTextStyle(t,e,i){var o,n;const r=this.nativeContext;e||(e=this.textAttributes),t.font?r.font=t.font:r.font=Zs(t,e,this.camera&&this.camera.getProjectionScale(i));const{fontFamily:s=e.fontFamily,fontSize:l=e.fontSize}=t;this.fontFamily=s,this.fontSize=l,r.textAlign=null!==(o=t.textAlign)&&void 0!==o?o:e.textAlign,r.textBaseline=null!==(n=t.textBaseline)&&void 0!==n?n:e.textBaseline}draw(){}clearMatrix(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.dpr;this.setTransformFromMatrix(this._clearMatrix,t,e)}setClearMatrix(t,e,i,o,n,r){this._clearMatrix.setValue(t,e,i,o,n,r)}onlyTranslate(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.dpr;return this.matrix.a===t&&0===this.matrix.b&&0===this.matrix.c&&this.matrix.d===t}release(){this.stack.forEach((t=>Na.free(t))),this.stack.length=0}};Yg.env="browser",Yg=Ug([y(),$g("design:paramtypes",[Object,Number])],Yg);var Kg=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s},qg=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let Zg=class extends Ou{constructor(t){super(t)}init(t){const{container:e}=t;if("string"==typeof e){const t=Oo.global.getElementById(e);t&&(this._container=t)}else this._container=e;this._context=new Yg(this,this._dpr),this.initStyle()}initStyle(){if(!this.controled)return;const{nativeCanvas:t}=this;t.width=this._pixelWidth,t.height=this._pixelHeight,!t.style||this.setCanvasStyle(t,this._x,this._y,this._displayWidth,this._displayHeight),this._container&&this._container.appendChild(t),this.visiable||this.hide()}hide(){this._nativeCanvas&&(this._nativeCanvas.style.display="none")}show(){this._nativeCanvas&&(this._nativeCanvas.style.display="block")}applyPosition(){const t=this._nativeCanvas;t.style.position="absolute",t.style.top=`${this._y}px`,t.style.left=`${this._x}px`}resetStyle(t){if(!this.controled)return;const{width:e=this._displayWidth,height:i=this._displayHeight,dpr:o=this._dpr,x:n=this._x,y:r=this._y}=t,{nativeCanvas:s}=this;s.width=e*o,s.height=i*o,!s.style||this.setCanvasStyle(s,n,r,e,i),t.id&&(s.id=t.id),this.visiable||this.hide()}setCanvasStyle(t,e,i,o,n){this.controled&&(t.style.width=`${o}px`,t.style.height=`${n}px`)}toDataURL(t,e){return"image/jpeg"===t?this._nativeCanvas.toDataURL(t,e):"image/png"===t?this._nativeCanvas.toDataURL(t):this._nativeCanvas.toDataURL(t,e)}resize(t,e){this.controled&&(this._pixelWidth=t*this._dpr,this._pixelHeight=e*this._dpr,this._displayWidth=t,this._displayHeight=e,this._nativeCanvas.style&&(this._nativeCanvas.style.width=`${t}px`,this._nativeCanvas.style.height=`${e}px`),this._nativeCanvas.width=this._pixelWidth,this._nativeCanvas.height=this._pixelHeight,this._context.dpr=this._dpr)}};function Jg(t,e){return new s((i=>{i(tn).toDynamicValue((()=>e=>new t(e))).whenTargetNamed(t.env),i(en).toDynamicValue((()=>(t,i)=>new e(t,i))).whenTargetNamed(e.env)}))}Zg.env="browser",Zg=Kg([y(),qg("design:paramtypes",[Object])],Zg);const Qg=Jg(Zg,Yg);var tp=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s},ep=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},ip=function(t,e){return function(i,o){e(i,o,t)}};let op=class extends Xu{constructor(t,e,i){super(i),this.contributions=t,this.drawContribution=e,this.pickItemInterceptorContributions=i,this.global.hooks.onSetEnv.tap("canvas-picker-service",((t,e,i)=>{this.configure(i,e)})),this.configure(this.global,this.global.env),this.pickerMap=new Map,this.init()}init(){this.contributions.getContributions().forEach((t=>{this.pickerMap.set(t.numberType,t)})),super._init()}configure(t,e){this.pickCanvas=nn.shareCanvas(),this.pickContext=this.pickCanvas.getContext("2d")}pickItem(t,e,i,o){if(!1===t.attribute.pickable)return null;if(this.InterceptorContributions.length)for(let n=0;n<this.InterceptorContributions.length;n++){const r=this.InterceptorContributions[n];if(r.beforePickItem){const n=r.beforePickItem(t,this,e,o,{parentMatrix:i});if(n)return n}}const n=this.pickerMap.get(t.numberType);if(!n)return null;const r=n.contains(t,e,o),s=r?t:null,l={graphic:s,params:r};if(s)return l;if(this.InterceptorContributions.length)for(let n=0;n<this.InterceptorContributions.length;n++){const r=this.InterceptorContributions[n];if(r.afterPickItem){const n=r.afterPickItem(t,this,e,o,{parentMatrix:i});if(n)return n}}return l}};op=tp([y(),ip(0,b(z)),ip(0,C(Wg)),ip(1,b(Kd)),ip(2,b(z)),ip(2,C(fc)),ep("design:paramtypes",[Object,Object,Object])],op);var np=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s};let rp=class{constructor(){this.type="group",this.numberType=Zr}contains(t,e,i){return!1}};rp=np([y()],rp);const sp=new s(((t,e,i,o)=>{sp.__vloaded||(sp.__vloaded=!0,t(Dg).to(rp).inSingletonScope(),t(Wg).toService(Dg),I(t,Wg))}));sp.__vloaded=!1;var lp=sp;const ap=new s(((t,e,i,o)=>{i(op)||t(op).toSelf().inSingletonScope(),i(uc)?o(uc).toService(op):t(uc).toService(op)}));var hp,dp=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s},cp=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let up=hp=class extends ju{get container(){return this.canvas.nativeCanvas.parentElement}static GenerateCanvasId(){return`${hp.idprefix}_${hp.prefix_count++}`}constructor(){super(),this.type="browser",this._canvasIsIntersecting=!0,this.global=Oo.global,this.viewBox=new Ce,this.modelMatrix=new Se(1,0,0,1,0,0)}getTitle(){return this.canvas.id&&this.canvas.id.toString()}getWH(){return{width:this.canvas.width/(this.canvas.dpr||1),height:this.canvas.height/(this.canvas.dpr||1)}}getXY(){return this.canvas.nativeCanvas.getBoundingClientRect()}createWindow(t){t.canvas?this.createWindowByCanvas(t):this.createWindowByConfig(t),this.postInit()}postInit(){if(this.global.optimizeVisible)try{this.observerCanvas()}catch(t){}}isElementVisible(t){const e=t.getBoundingClientRect(),i=window.innerWidth||document.documentElement.clientWidth,o=window.innerHeight||document.documentElement.clientHeight;return!(e.right<0||e.bottom<0||e.left>i||e.top>o)}observerCanvas(){this._canvasIsIntersecting=this.isElementVisible(this.canvas.nativeCanvas);const t=new IntersectionObserver(((t,e)=>{t.forEach((t=>{this._canvasIsIntersecting!==t.isIntersecting?(this._canvasIsIntersecting=t.isIntersecting,this._onVisibleChangeCb&&this._onVisibleChangeCb(t.isIntersecting)):this._canvasIsIntersecting=t.isIntersecting}))}));t&&t.observe(this.canvas.nativeCanvas)}createWindowByConfig(t){const e=this.global.createCanvas({width:t.width,height:t.height});let i;if(i="string"==typeof t.container?this.global.getElementById(t.container):t.container?t.container:this.global.getRootElement(),!i)throw new Error("发生错误,containerId可能传入有误");t.offscreen?i=null:i.appendChild(e);const o={width:t.width,height:t.height,dpr:t.dpr,nativeCanvas:e,container:i,id:hp.GenerateCanvasId(),canvasControled:!0};this.canvas=new Zg(o)}createWindowByCanvas(t){var e;let i;if("string"==typeof t.canvas){if(i=this.global.getElementById(t.canvas),!i)throw new Error("canvasId 参数不正确,请确认canvas存在并插入dom")}else i=t.canvas;if(!i)throw new Error("发生错误,传入的canvas不正确");let o=t.width,n=t.height;if(null==o||null==n||!t.canvasControled){const t=i.getBoundingClientRect();o=t.width,n=t.height}let r=t.dpr;null==r&&(r=null!==(e=i.getContext("2d").pixelRatio)&&void 0!==e?e:i.width/o),this.canvas=new Zg({width:o,height:n,dpr:r,nativeCanvas:i,canvasControled:t.canvasControled})}releaseWindow(){this.canvas.release()}resizeWindow(t,e){this.canvas.resize(t,e)}setDpr(t){this.canvas.dpr=t}getContext(){return this.canvas.getContext()}getNativeHandler(){return this.canvas}getDpr(){return this.canvas.dpr}addEventListener(t,e,i){return this.canvas.nativeCanvas.addEventListener(t,e,i)}removeEventListener(t,e,i){return this.canvas.nativeCanvas.removeEventListener(t,e,i)}dispatchEvent(t){return this.canvas.nativeCanvas.dispatchEvent(t)}getStyle(){var t;return null!==(t=this.canvas.nativeCanvas.style)&&void 0!==t?t:{}}setStyle(t){this.canvas.nativeCanvas.style=t}getBoundingClientRect(){const t=this.canvas.nativeCanvas,e=this.getWH();return t.parentElement?this.canvas.nativeCanvas.getBoundingClientRect():{x:0,y:0,width:e.width,height:e.height,left:0,top:0,right:0,bottom:0}}clearViewBox(t){const e=this.viewBox,i=this.getContext(),o=this.getDpr();i.nativeContext.save(),i.nativeContext.setTransform(o,0,0,o,0,0),i.clearRect(e.x1,e.y1,e.x2-e.x1,e.y2-e.y1),t&&(i.fillStyle=t,i.fillRect(e.x1,e.y1,e.x2-e.x1,e.y2-e.y1)),i.nativeContext.restore()}isVisible(t){return this._canvasIsIntersecting}onVisibleChange(t){this._onVisibleChangeCb=t}getTopLeft(t){return this.global.getElementTopLeft(this.canvas.nativeCanvas,t)}};up.env="browser",up.idprefix="visactor_window",up.prefix_count=0,up=hp=dp([y(),cp("design:paramtypes",[])],up);const gp=new s((t=>{t(up).toSelf(),t(an).toDynamicValue((t=>t.container.get(up))).whenTargetNamed(up.env)}));var pp=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s},fp=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};class mp{get x1(){return this.dom.getBoundingClientRect().left}get x2(){return this.dom.getBoundingClientRect().right}get y1(){return this.dom.getBoundingClientRect().top}get y2(){return this.dom.getBoundingClientRect().bottom}get width(){return this.dom.getBoundingClientRect().width}get height(){return this.dom.getBoundingClientRect().height}constructor(t){this.dom=t}}function bp(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const i=document.createElement("img");if(i.crossOrigin="anonymous",e){const e=new Blob([t],{type:"image/svg+xml"});t=window.URL.createObjectURL(e)}return i.src=t,i.complete?Promise.resolve(i):new Promise(((t,e)=>{i.onload=()=>{t(i)},i.onerror=()=>{e(new Error("加载失败"))}}))}let vp=class extends Wu{constructor(){super(),this.type="browser",this.supportEvent=!0;try{this.supportsTouchEvents="ontouchstart"in globalThis,this.supportsPointerEvents=!!globalThis.PointerEvent,this.supportsMouseEvents=!!globalThis.MouseEvent}catch(t){this.supportsTouchEvents=!1,this.supportsPointerEvents=!1,this.supportsPointerEvents=!1}this.applyStyles=!0}mapToCanvasPoint(t,e){var i,o;let n=0,r=0,s=0,l=0;if(t.changedTouches){const e=null!==(i=t.changedTouches[0])&&void 0!==i?i:{};n=e.clientX||0,r=e.clientY||0,s=n,l=r}else n=t.clientX||0,r=t.clientY||0,s=t.offsetX||0,l=t.offsetY||0;if(e){const t=n,i=r,s=e.getBoundingClientRect(),l=null===(o=e.getNativeHandler)||void 0===o?void 0:o.call(e).nativeCanvas;let a,h;return l&&(a=s.width/l.offsetWidth,h=s.height/l.offsetHeight),{x:(t-s.left)/(ht(a)?a:1),y:(i-s.top)/(ht(h)?h:1)}}return{x:s,y:l}}getNativeAABBBounds(t){let e=t;if("string"==typeof t&&(e=(new DOMParser).parseFromString(t,"text/html").firstChild,e.lastChild&&(e=e.lastChild.firstChild)),e.getBoundingClientRect){const t=e.getBoundingClientRect();return new mp(t)}return new Ce}removeDom(t){return t.parentElement.removeChild(t),!0}updateDom(t,e){const{width:i,height:o,style:n}=e;return n&&(nt(n)?t.setAttribute("style",n):Object.keys(n).forEach((e=>{t.style[e]=n[e]}))),null!=i&&(t.style.width=`${i}px`),null!=o&&(t.style.height=`${o}px`),!0}createDom(t){const{tagName:e="div",parent:i}=t,o=document.createElement(e);if(this.updateDom(o,t),i){const t=nt(i)?this.getElementById(i):i;t&&t.appendChild&&t.appendChild(o)}return o}loadImage(t){return bp(t,!1).then((t=>({data:t,loadState:"success"}))).catch((()=>({data:null,loadState:"fail"})))}loadSvg(t){return bp(t,!0).then((t=>({data:t,loadState:"success"}))).catch((()=>({data:null,loadState:"fail"})))}createCanvas(t){var e,i;const o=document.createElement("canvas");t.id&&(o.id=null!==(e=t.id)&&void 0!==e?e:r.GenAutoIncrementId().toString());const n=null!==(i=t.dpr)&&void 0!==i?i:window.devicePixelRatio;return t.width&&t.height&&(o.style.width=`${t.width}px`,o.style.height=`${t.height}px`,o.width=t.width*n,o.height=t.height*n),o}createOffscreenCanvas(t){var e;const i=null!==(e=t.dpr)&&void 0!==e?e:window.devicePixelRatio;return new OffscreenCanvas(t.width*i,t.height*i)}releaseCanvas(t){let e;e="string"==typeof t?document.getElementById(t):t,e&&e.parentElement&&e.parentElement.removeChild(e)}getDevicePixelRatio(){return window.devicePixelRatio}getRequestAnimationFrame(){return window.requestAnimationFrame}getCancelAnimationFrame(){return window.cancelAnimationFrame}addEventListener(t,e,i){return document.addEventListener(t,e,i)}removeEventListener(t,e,i){return document.removeEventListener(t,e,i)}dispatchEvent(t){return document.dispatchEvent(t)}getElementById(t){return document.getElementById(t)}getRootElement(){return document.body}getDocument(){return document}release(){}getElementTop(t,e){let i=t.offsetTop,o=t.offsetParent;for(;null!==o;)i+=o.offsetTop,o=o.offsetParent;return i}getElementLeft(t,e){let i=t.offsetLeft,o=t.offsetParent;for(;null!==o;)i+=o.offsetLeft,o=o.offsetParent;return i}getElementTopLeft(t,e){let i=t.offsetTop,o=t.offsetLeft,n=t.offsetParent;for(;null!==n;)i+=n.offsetTop,o+=n.offsetLeft,n=n.offsetParent;return{top:i,left:o}}};vp=pp([y(),fp("design:paramtypes",[])],vp);const yp=new s((t=>{yp.isBrowserBound||(yp.isBrowserBound=!0,t(vp).toSelf().inSingletonScope(),t(W).toService(vp))}));function Cp(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];Cp.__loaded||(Cp.__loaded=!0,t.load(yp),t.load(Qg),t.load(gp),e&&function(t){t.load(lp),t.load(ap)}(t))}yp.isBrowserBound=!1,Cp.__loaded=!1;var wp=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s},xp=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},_p=function(t,e){return function(i,o){e(i,o,t)}};let Sp=class{constructor(t){this.canvasRenderer=t,this.type="arc",this.numberType=Xr}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:o}=null!=i?i:{};if(!o)return!1;const n=_n(t).arc;o.highPerformanceSave();let{x:r=n.x,y:s=n.y}=t.attribute;if(t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(n);r+=e.x,s+=e.y,o.setTransformForCurrent()}else r=0,s=0,o.transformFromMatrix(t.transMatrix,!0);let l=!1;return this.canvasRenderer.drawShape(t,o,r,s,{},null,((t,i,o)=>!!l||(l=t.isPointInPath(e.x,e.y),l)),((t,i,n)=>{if(l)return!0;const r=i.lineWidth||n.lineWidth,s=i.pickStrokeBuffer||n.pickStrokeBuffer;return o.lineWidth=r+s,l=t.isPointInStroke(e.x,e.y),l})),o.highPerformanceRestore(),l}};Sp=wp([y(),_p(0,b(Id)),xp("design:paramtypes",[Object])],Sp);let Ap=!1;const Bp=new s(((t,e,i,o)=>{Ap||(Ap=!0,t(Cg).to(Sp).inSingletonScope(),t(yg).toService(Cg))}));var Rp=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s},Mp=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Tp=function(t,e){return function(i,o){e(i,o,t)}};let kp=class{constructor(t){this.canvasRenderer=t,this.type="circle",this.numberType=qr}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:o}=null!=i?i:{};if(!o)return!1;const n=_n(t).circle;let{x:r=n.x,y:s=n.y}=t.attribute;if(o.highPerformanceSave(),t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(n);r+=e.x,s+=e.y,o.setTransformForCurrent()}else r=0,s=0,o.transformFromMatrix(t.transMatrix,!0);let l=!1;return this.canvasRenderer.drawShape(t,o,r,s,{},null,((t,i,o)=>!!l||(l=t.isPointInPath(e.x,e.y),l)),((t,i,n)=>{if(l)return!0;const r=i.lineWidth||n.lineWidth,s=i.pickStrokeBuffer||n.pickStrokeBuffer;return o.lineWidth=r+s,l=t.isPointInStroke(e.x,e.y),l})),o.highPerformanceRestore(),l}};kp=Rp([y(),Tp(0,b(Od)),Mp("design:paramtypes",[Object])],kp);let Pp=!1;const Ep=new s(((t,e,i,o)=>{Pp||(Pp=!0,t(wg).to(kp).inSingletonScope(),t(yg).toService(wg))}));var Lp=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s};let Hp=class{constructor(){this.type="image",this.numberType=Jr}contains(t,e,i){const{pickContext:o}=null!=i?i:{};return!!o&&!!t.AABBBounds.containsPoint(e)}};Hp=Lp([y()],Hp);let zp=!1;const Fp=new s(((t,e,i,o)=>{zp||(zp=!0,t(xg).to(Hp).inSingletonScope(),t(Hp).toService(xg))}));var Ip=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s},Op=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Dp=function(t,e){return function(i,o){e(i,o,t)}};let Wp=class{constructor(t){this.canvasRenderer=t,this.type="line",this.numberType=Qr}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:o}=null!=i?i:{};if(!o)return!1;const n=_n(t).line;let{x:r=n.x,y:s=n.y}=t.attribute;if(o.highPerformanceSave(),t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(n);r+=e.x,s+=e.y,o.setTransformForCurrent()}else r=0,s=0,o.transformFromMatrix(t.transMatrix,!0);let l=!1;return this.canvasRenderer.drawShape(t,o,r,s,{},null,(t=>!!l||(l=t.isPointInPath(e.x,e.y),l)),((t,i,n)=>{if(l)return!0;const r=i.lineWidth||n.lineWidth,s=i.pickStrokeBuffer||n.pickStrokeBuffer;return o.lineWidth=r+s,l=t.isPointInStroke(e.x,e.y),l})),o.highPerformanceRestore(),l}};Wp=Ip([y(),Dp(0,b(Nd)),Op("design:paramtypes",[Object])],Wp);let Np=!1;const Gp=new s(((t,e,i,o)=>{Np||(Np=!0,t(_g).to(Wp).inSingletonScope(),t(yg).toService(_g))}));var jp=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s},Vp=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Up=function(t,e){return function(i,o){e(i,o,t)}};let $p=class{constructor(t){this.canvasRenderer=t,this.type="polygon",this.numberType=es}contains(t,e,i){if(!t.AABBBounds.contains(e.x,e.y))return!1;const{pickContext:o}=null!=i?i:{};if(!o)return!1;const n=_n(t).polygon;let{x:r=n.x,y:s=n.y}=t.attribute;if(o.highPerformanceSave(),t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(n);r+=e.x,s+=e.y,o.setTransformForCurrent()}else r=0,s=0,o.transformFromMatrix(t.transMatrix,!0);let l=!1;return this.canvasRenderer.drawShape(t,o,r,s,{},null,((t,i,o)=>!!l||(l=t.isPointInPath(e.x,e.y),l)),((t,i,n)=>{if(l)return!0;const r=i.lineWidth||n.lineWidth,s=i.pickStrokeBuffer||n.pickStrokeBuffer;return o.lineWidth=r+s,l=t.isPointInStroke(e.x,e.y),l})),o.highPerformanceRestore(),l}};$p=jp([y(),Up(0,b(jd)),Vp("design:paramtypes",[Object])],$p);let Xp=!1;const Yp=new s(((t,e,i,o)=>{Xp||(Xp=!0,t(Mg).to($p).inSingletonScope(),t(yg).toService(Mg))}));var Kp=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s},qp=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Zp=function(t,e){return function(i,o){e(i,o,t)}};let Jp=class{constructor(t){this.canvasRenderer=t,this.type="path",this.numberType=ts}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:o}=null!=i?i:{};if(!o)return!1;const n=_n(t).path;let{x:r=n.x,y:s=n.y}=t.attribute;if(o.highPerformanceSave(),t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(n);r+=e.x,s+=e.y,o.setTransformForCurrent()}else r=0,s=0,o.transformFromMatrix(t.transMatrix,!0);let l=!1;return this.canvasRenderer.drawShape(t,o,r,s,{},null,((t,i,o)=>!!l||(l=t.isPointInPath(e.x,e.y),l)),((t,i,n)=>{if(l)return!0;const r=i.lineWidth||n.lineWidth,s=i.pickStrokeBuffer||n.pickStrokeBuffer;return o.lineWidth=r+s,l=t.isPointInStroke(e.x,e.y),l})),o.highPerformanceRestore(),l}};Jp=Kp([y(),Zp(0,b(Gd)),qp("design:paramtypes",[Object])],Jp);let Qp=!1;const tf=new s(((t,e,i,o)=>{Qp||(Qp=!0,t(Sg).to(Jp).inSingletonScope(),t(yg).toService(Sg))}));var ef=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s},of=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},nf=function(t,e){return function(i,o){e(i,o,t)}};const rf=new Ce;let sf=class{constructor(t){this.canvasRenderer=t,this.type="rect",this.numberType=is}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:o}=null!=i?i:{};if(!o)return!1;const n=_n(t).rect,{cornerRadius:r=n.cornerRadius}=t.attribute;let{x:s=n.x,y:l=n.y}=t.attribute;o.highPerformanceSave();let a=!0;if(t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(n);s+=e.x,l+=e.y,o.setTransformForCurrent()}else s=0,l=0,a=!1,o.transformFromMatrix(t.transMatrix,!0);let h=!0;if(!a||at(r,!0)&&0!==r||rt(r)&&r.some((t=>0!==t)))h=!1,this.canvasRenderer.drawShape(t,o,s,l,{},null,((t,i,o)=>!!h||(h=t.isPointInPath(e.x,e.y),h)),((t,i,n)=>{if(h)return!0;const r=i.lineWidth||n.lineWidth,s=i.pickStrokeBuffer||n.pickStrokeBuffer;return o.lineWidth=r+s,h=t.isPointInStroke(e.x,e.y),h}));else if(h){const{fill:i=n.fill,stroke:o=n.stroke,lineWidth:r=n.lineWidth}=t.attribute;if(i)h=!0;else if(o){const i=t.AABBBounds;rf.setValue(i.x1,i.y1,i.x2,i.y2),rf.expand(-r/2),h=!rf.containsPoint(e)}}return o.highPerformanceRestore(),h}};sf=ef([y(),nf(0,b(Vd)),of("design:paramtypes",[Object])],sf);let lf=!1;const af=new s(((t,e,i,o)=>{lf||(lf=!0,t(Ag).to(sf).inSingletonScope(),t(yg).toService(Ag))}));let hf=!1;const df=new s(((t,e,i,o)=>{hf||(hf=!0,t(xg).to(Hp).inSingletonScope(),t(Hp).toService(xg))}));var cf=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s},uf=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},gf=function(t,e){return function(i,o){e(i,o,t)}};let pf=class{constructor(t){this.canvasRenderer=t,this.type="symbol",this.numberType=ns}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:o}=null!=i?i:{};if(!o)return!1;const n=_n(t).symbol;let{x:r=n.x,y:s=n.y}=t.attribute;if(o.highPerformanceSave(),t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(n);r+=e.x,s+=e.y,o.setTransformForCurrent()}else r=0,s=0,o.transformFromMatrix(t.transMatrix,!0);let l=!1;return this.canvasRenderer.drawShape(t,o,r,s,{},null,((t,i,o)=>!!l||(l=t.isPointInPath(e.x,e.y),l)),((t,i,n)=>{if(l)return!0;const r=i.lineWidth||n.lineWidth,s=i.pickStrokeBuffer||n.pickStrokeBuffer;return o.lineWidth=r+s,l=t.isPointInStroke(e.x,e.y),l})),o.highPerformanceRestore(),l}};pf=cf([y(),gf(0,b(Ud)),uf("design:paramtypes",[Object])],pf);let ff=!1;const mf=new s(((t,e,i,o)=>{ff||(ff=!0,t(Bg).to(pf).inSingletonScope(),t(yg).toService(Bg))}));var bf=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s};let vf=class{constructor(){this.type="text",this.numberType=rs}contains(t,e,i){return!!t.AABBBounds.containsPoint(e)}};vf=bf([y()],vf);let yf=!1;const Cf=new s(((t,e,i,o)=>{yf||(yf=!0,t(Rg).to(vf).inSingletonScope(),t(yg).toService(Rg))}));var wf=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s},xf=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let _f=class extends Yg{constructor(t,e){super(t,e);const i=t.nativeCanvas.getContext("2d");if(!i)throw new Error("发生错误,获取2d上下文失败");this.nativeContext=i,this.canvas=t,this.matrix=new Se(1,0,0,1,0,0),this.stack=[],this.dpr=null!=e?e:1}release(){}};_f.env="node",_f=wf([y(),xf("design:paramtypes",[Object,Number])],_f);var Sf=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s},Af=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let Bf=class extends Ou{constructor(t){super(t)}init(){this._context=new _f(this,this._dpr),this.nativeCanvas.width=this._pixelWidth,this.nativeCanvas.height=this._pixelHeight}release(){this._nativeCanvas.release&&Z(this._nativeCanvas.release)&&this._nativeCanvas.release()}};Bf.env="node",Bf=Sf([y(),Af("design:paramtypes",[Object])],Bf);const Rf=Jg(Bf,_f);var Mf=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s},Tf=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},kf=function(t,e){return function(i,o){e(i,o,t)}};let Pf=class extends ju{get container(){return null}constructor(t){super(),this.global=t,this.type="node"}getTitle(){return""}getWH(){return{width:this.canvas.displayWidth,height:this.canvas.displayHeight}}getXY(){return{x:0,y:0}}createWindow(t){t.canvas?this.createWindowByCanvas(t):this.createWindowByConfig(t)}createWindowByConfig(t){const e=this.global.createCanvas({width:t.width,height:t.height}),i={width:t.width,height:t.height,dpr:t.dpr,nativeCanvas:e,id:r.GenAutoIncrementId().toString(),canvasControled:!0};this.canvas=new Bf(i)}createWindowByCanvas(t){const e=t.canvas;let i=t.width,o=t.height;null!=i&&null!=o&&t.canvasControled||(i=e.width,o=e.height),this.canvas=new Bf({width:i,height:o,dpr:1,nativeCanvas:e,canvasControled:t.canvasControled})}releaseWindow(){this.canvas.release()}resizeWindow(t,e){this.canvas.resize(t,e)}setDpr(t){this.canvas.dpr=t}getContext(){return this.canvas.getContext()}getNativeHandler(){return this.canvas}getDpr(){return this.canvas.dpr}getImageBuffer(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"image/png";return this.canvas.nativeCanvas.toBuffer(t)}addEventListener(t,e,i){}dispatchEvent(t){return!0}removeEventListener(t,e,i){}getStyle(){}setStyle(t){}getBoundingClientRect(){return null}clearViewBox(t){}};Pf.env="node",Pf=Mf([y(),kf(0,b(N)),Tf("design:paramtypes",[Object])],Pf);const Ef=new s((t=>{t(Pf).toSelf(),t(an).toDynamicValue((t=>t.container.get(Pf))).whenTargetNamed(Pf.env)}));var Lf=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s};let Hf=class extends Wu{constructor(){super(...arguments),this.type="node",this._lastTime=0,this.supportEvent=!1}configure(t,e){t.env===this.type&&(t.setActiveEnvContribution(this),this.pkg=e)}getDynamicCanvasCount(){return 0}getStaticCanvasCount(){return 999}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"})))}loadImage(t){const{loadImage:e}=this.pkg;return e?e(t).then((t=>({loadState:t?"success":"fail",data:t}))).catch((()=>({loadState:"fail",data:null}))):Promise.reject(new Error("node-canvas loadImage could not be found!"))}loadSvg(t){const e=this.pkg.Resvg;if(!e)return Promise.reject(new Error("@resvg/resvg-js svgParser could not be found!"));const i=new e(t).render().asPng();return this.loadImage(i)}createCanvas(t){return this.pkg.createCanvas(t.width,t.height)}releaseCanvas(t){}getDevicePixelRatio(){return 1}getRequestAnimationFrame(){return function(t){return lr.call(t)}}getCancelAnimationFrame(){return t=>{lr.clear(t)}}addEventListener(t,e,i){}removeEventListener(t,e,i){}getElementById(t){return null}getRootElement(){return null}dispatchEvent(t){}release(){}createOffscreenCanvas(t){}};Hf=Lf([y()],Hf);const zf=new s((t=>{zf.isNodeBound||(zf.isNodeBound=!0,t(Hf).toSelf().inSingletonScope(),t(W).toService(Hf))}));function Ff(t){Ff.__loaded||(Ff.__loaded=!0,t.load(zf),t.load(Rf),t.load(Ef))}zf.isNodeBound=!1,Ff.__loaded=!1;var If=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s},Of=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Df=function(t,e){return function(i,o){e(i,o,t)}};let Wf=class{constructor(t){this.canvasRenderer=t,this.type="arc",this.numberType=Xr}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:o}=null!=i?i:{};if(!o)return!1;const n=_n(t).arc;o.highPerformanceSave();let{x:r=n.x,y:s=n.y}=t.attribute;if(t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(n);r+=e.x,s+=e.y,o.setTransformForCurrent()}else r=0,s=0,o.transformFromMatrix(t.transMatrix,!0);let l=!1;return this.canvasRenderer.drawShape(t,o,r,s,{},null,((t,i,o)=>!!l||(l=t.isPointInPath(e.x,e.y),l)),((t,i,n)=>{if(l)return!0;const r=i.lineWidth||n.lineWidth,s=i.pickStrokeBuffer||n.pickStrokeBuffer;return o.lineWidth=nh(o,r+s,o.dpr),l=t.isPointInStroke(e.x,e.y),l})),o.highPerformanceRestore(),l}};Wf=If([y(),Df(0,b(Id)),Of("design:paramtypes",[Object])],Wf);let Nf=!1;const Gf=new s(((t,e,i,o)=>{Nf||(Nf=!0,t(Tg).to(Wf).inSingletonScope(),t(Wg).toService(Tg))}));var jf=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s},Vf=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Uf=function(t,e){return function(i,o){e(i,o,t)}};const $f=new Ce;let Xf=class{constructor(t){this.canvasRenderer=t,this.type="rect",this.numberType=is}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:o}=null!=i?i:{};if(!o)return!1;const n=_n(t).rect,{cornerRadius:r=n.cornerRadius}=t.attribute;let{x:s=n.x,y:l=n.y}=t.attribute;o.highPerformanceSave();let a=!0;if(t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(n);s+=e.x,l+=e.y,o.setTransformForCurrent()}else s=0,l=0,a=!1,o.transformFromMatrix(t.transMatrix,!0);let h=!0;if(!a||t.shadowRoot||at(r,!0)&&0!==r||rt(r)&&r.some((t=>0!==t)))h=!1,this.canvasRenderer.drawShape(t,o,s,l,{},null,((t,i,o)=>!!h||(h=t.isPointInPath(e.x,e.y),h)),((t,i,n)=>{if(h)return!0;const r=i.lineWidth||n.lineWidth,s=i.pickStrokeBuffer||n.pickStrokeBuffer;return o.lineWidth=nh(o,r+s,o.dpr),h=t.isPointInStroke(e.x,e.y),h}));else{const{fill:i=n.fill,stroke:o=n.stroke,lineWidth:r=n.lineWidth}=t.attribute;if(i)h=!0;else if(o){const i=t.AABBBounds;$f.setValue(i.x1,i.y1,i.x2,i.y2),$f.expand(-r/2),h=!$f.containsPoint(e)}}return o.highPerformanceRestore(),h}};Xf=jf([y(),Uf(0,b(Vd)),Vf("design:paramtypes",[Object])],Xf);let Yf=!1;const Kf=new s(((t,e,i,o)=>{Yf||(Yf=!0,t(Hg).to(Xf).inSingletonScope(),t(Wg).toService(Hg))}));var qf=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s};let Zf=class extends eh{};Zf=qf([y()],Zf);var Jf=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s},Qf=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},tm=function(t,e){return function(i,o){e(i,o,t)}};let em=class extends Zf{constructor(t){super(),this.canvasRenderer=t,this.type="line",this.numberType=Qr}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:o}=null!=i?i:{};if(!o)return!1;o.highPerformanceSave();const n=_n(t).line,r=this.transform(t,n,o),{x:s,y:l,z:a,lastModelMatrix:h}=r;let d=e;if(o.camera){d=e.clone();const i=t.parent.globalTransMatrix;d.x=i.a*e.x+i.c*e.y+i.e,d.y=i.b*e.x+i.d*e.y+i.f}this.canvasRenderer.z=a;let c=!1;return this.canvasRenderer.drawShape(t,o,s,l,{},null,(t=>!!c||(c=t.isPointInPath(d.x,d.y),c)),((t,e,i)=>{if(c)return!0;const n=e.lineWidth||i.lineWidth,r=e.pickStrokeBuffer||i.pickStrokeBuffer;return o.lineWidth=nh(o,n+r,o.dpr),c=t.isPointInStroke(d.x,d.y),c})),this.canvasRenderer.z=0,o.modelMatrix!==h&&Ga.free(o.modelMatrix),o.modelMatrix=h,o.highPerformanceRestore(),c}};em=Jf([y(),tm(0,b(Nd)),Qf("design:paramtypes",[Object])],em);let im=!1;const om=new s(((t,e,i,o)=>{im||(im=!0,t(Eg).to(em).inSingletonScope(),t(Wg).toService(Eg))}));var nm=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s},rm=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},sm=function(t,e){return function(i,o){e(i,o,t)}};let lm=class extends Zf{constructor(t){super(),this.canvasRenderer=t,this.type="symbol",this.numberType=ns}contains(t,e,i){const{pickContext:o}=null!=i?i:{};if(!o)return!1;const n=t.getParsedPath();if(!o.camera){if(!t.AABBBounds.containsPoint(e))return!1;if(n.isSvg||"imprecise"===t.attribute.pickMode)return!0}o.highPerformanceSave();const r=_n(t).symbol,s=this.transform(t,r,o),{x:l,y:a,z:h,lastModelMatrix:d}=s;let c=e;if(o.camera){c=e.clone();const i=t.parent.globalTransMatrix;c.x=i.a*e.x+i.c*e.y+i.e,c.y=i.b*e.x+i.d*e.y+i.f}this.canvasRenderer.z=h;let u=!1;return this.canvasRenderer.drawShape(t,o,l,a,{},null,((t,e,i)=>!!u||(u=t.isPointInPath(c.x,c.y),u)),((t,e,i)=>{if(u)return!0;const n=e.lineWidth||i.lineWidth,r=e.pickStrokeBuffer||i.pickStrokeBuffer;return o.lineWidth=nh(o,n+r,o.dpr),u=t.isPointInStroke(c.x,c.y),u})),this.canvasRenderer.z=0,o.modelMatrix!==d&&Ga.free(o.modelMatrix),o.modelMatrix=d,o.highPerformanceRestore(),u}};lm=nm([y(),sm(0,b(Ud)),rm("design:paramtypes",[Object])],lm);let am=!1;const hm=new s(((t,e,i,o)=>{am||(am=!0,t(zg).to(lm).inSingletonScope(),t(Wg).toService(zg))}));var dm=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s},cm=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},um=function(t,e){return function(i,o){e(i,o,t)}};let gm=class{constructor(t){this.canvasRenderer=t,this.type="circle",this.numberType=qr}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:o}=null!=i?i:{};if(!o)return!1;const n=_n(t).circle;let{x:r=n.x,y:s=n.y}=t.attribute;if(o.highPerformanceSave(),t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(n);r+=e.x,s+=e.y,o.setTransformForCurrent()}else r=0,s=0,o.transformFromMatrix(t.transMatrix,!0);let l=!1;return this.canvasRenderer.drawShape(t,o,r,s,{},null,((t,i,o)=>!!l||(l=t.isPointInPath(e.x,e.y),l)),((t,i,n)=>{if(l)return!0;const r=i.lineWidth||n.lineWidth,s=i.pickStrokeBuffer||n.pickStrokeBuffer;return o.lineWidth=nh(o,r+s,o.dpr),l=t.isPointInStroke(e.x,e.y),l})),o.highPerformanceRestore(),l}};gm=dm([y(),um(0,b(Od)),cm("design:paramtypes",[Object])],gm);let pm=!1;const fm=new s(((t,e,i,o)=>{pm||(pm=!0,t(kg).to(gm).inSingletonScope(),t(Wg).toService(kg))}));var mm=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s},bm=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},vm=function(t,e){return function(i,o){e(i,o,t)}};let ym=class extends Zf{constructor(t){super(),this.canvasRenderer=t,this.type="text",this.numberType=rs}contains(t,e,i){const{pickContext:o}=null!=i?i:{};if(!o)return!1;const n=t.AABBBounds;if(!o.camera)return!!n.containsPoint(e);o.highPerformanceSave();const r=_n(t).text,{keepDirIn3d:s=r.keepDirIn3d}=t.attribute,l=!s,a=this.transform(t,r,o,l),{x:h,y:d,z:c,lastModelMatrix:u}=a;this.canvasRenderer.z=c;let g=e;if(o.camera){g=e.clone();const i=t.parent.globalTransMatrix;g.x=i.a*e.x+i.c*e.y+i.e,g.y=i.b*e.x+i.d*e.y+i.f}let p=!1;return this.canvasRenderer.drawShape(t,o,h,d,{},null,((e,i,o)=>{if(p)return!0;const{fontSize:n=r.fontSize,textBaseline:s=r.textBaseline,textAlign:l=r.textAlign}=t.attribute,a=t.AABBBounds,u=a.height(),f=a.width(),m=Qs(s,u,n),b=Js(l,f);return e.rect(b+h,m+d,f,u,c),p=e.isPointInPath(g.x,g.y),p}),((t,e,i)=>p)),this.canvasRenderer.z=0,o.modelMatrix!==u&&Ga.free(o.modelMatrix),o.modelMatrix=u,o.highPerformanceRestore(),p}};ym=mm([y(),vm(0,b($d)),bm("design:paramtypes",[Object])],ym);let Cm=!1;const wm=new s(((t,e,i,o)=>{Cm||(Cm=!0,t(Fg).to(ym).inSingletonScope(),t(Wg).toService(Fg))}));var xm=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s},_m=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Sm=function(t,e){return function(i,o){e(i,o,t)}};let Am=class extends Zf{constructor(t){super(),this.canvasRenderer=t,this.type="path",this.numberType=ts}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:o}=null!=i?i:{};if(!o)return!1;const n=_n(t).path;o.highPerformanceSave();const r=this.transform(t,n,o),{x:s,y:l,z:a,lastModelMatrix:h}=r;let d=e;if(o.camera){d=e.clone();const i=t.parent.globalTransMatrix;d.x=i.a*e.x+i.c*e.y+i.e,d.y=i.b*e.x+i.d*e.y+i.f}this.canvasRenderer.z=a;let c=!1;return this.canvasRenderer.drawShape(t,o,s,l,{},null,((t,e,i)=>!!c||(c=t.isPointInPath(d.x,d.y),c)),((t,e,i)=>{if(c)return!0;const n=e.lineWidth||i.lineWidth,r=e.pickStrokeBuffer||i.pickStrokeBuffer;return o.lineWidth=nh(o,n+r,o.dpr),c=t.isPointInStroke(d.x,d.y),c})),this.canvasRenderer.z=0,o.modelMatrix!==h&&Ga.free(o.modelMatrix),o.modelMatrix=h,o.highPerformanceRestore(),c}};Am=xm([y(),Sm(0,b(Gd)),_m("design:paramtypes",[Object])],Am);let Bm=!1;const Rm=new s(((t,e,i,o)=>{Bm||(Bm=!0,t(Lg).to(Am).inSingletonScope(),t(Wg).toService(Lg))}));var Mm=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s},Tm=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},km=function(t,e){return function(i,o){e(i,o,t)}};let Pm=class{constructor(t){this.canvasRenderer=t,this.type="polygon",this.numberType=es}contains(t,e,i){if(!t.AABBBounds.contains(e.x,e.y))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:o}=null!=i?i:{};if(!o)return!1;const n=_n(t).polygon;let{x:r=n.x,y:s=n.y}=t.attribute;if(o.highPerformanceSave(),t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(n);r+=e.x,s+=e.y,o.setTransformForCurrent()}else r=0,s=0,o.transformFromMatrix(t.transMatrix,!0);let l=!1;return this.canvasRenderer.drawShape(t,o,r,s,{},null,((t,i,o)=>!!l||(l=t.isPointInPath(e.x,e.y),l)),((t,i,n)=>{if(l)return!0;const r=i.lineWidth||n.lineWidth,s=i.pickStrokeBuffer||n.pickStrokeBuffer;return o.lineWidth=nh(o,r+s,o.dpr),l=t.isPointInStroke(e.x,e.y),l})),o.highPerformanceRestore(),l}};Pm=Mm([y(),km(0,b(jd)),Tm("design:paramtypes",[Object])],Pm);let Em=!1;const Lm=new s(((t,e,i,o)=>{Em||(Em=!0,t(Ig).to(Pm).inSingletonScope(),t(Wg).toService(Ig))}));var Hm=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s},zm=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Fm=function(t,e){return function(i,o){e(i,o,t)}};let Im=class{constructor(t){this.canvasRenderer=t,this.type="richtext",this.numberType=os}contains(t,e,i){return!!t.AABBBounds.containsPoint(e)}};Im=Hm([y(),Fm(0,b(Xd)),zm("design:paramtypes",[Object])],Im);let Om=!1;const Dm=new s(((t,e,i,o)=>{Om||(Om=!0,t(Og).to(Im).inSingletonScope(),t(Wg).toService(Og))}));var Wm=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s};let Nm=class{constructor(){this.type="image",this.numberType=Jr}contains(t,e,i){const{pickContext:o}=null!=i?i:{};return!!o&&!!t.AABBBounds.containsPoint(e)}};Nm=Wm([y()],Nm);let Gm=!1;const jm=new s(((t,e,i,o)=>{Gm||(Gm=!0,t(Pg).to(Nm).inSingletonScope(),t(Wg).toService(Pg))})),Vm=ku();function Um(){Um.__loaded||(Um.__loaded=!0,Za.RegisterGraphicCreator("arc",Ha),Qo.load(Ku),Qo.load(Vm?Gf:Bp))}Um.__loaded=!1;const $m=Um;function Xm(){Xm.__loaded||(Xm.__loaded=!0,Za.RegisterGraphicCreator("circle",qs),Qo.load(og),Qo.load(Vm?fm:Ep))}Xm.__loaded=!1;const Ym=Xm;function Km(){Km.__loaded||(Km.__loaded=!0,Za.RegisterGraphicCreator("group",us))}Km.__loaded=!1;const qm=Km;function Zm(){Zm.__loaded||(Zm.__loaded=!0,Za.RegisterGraphicCreator("image",xa),Qo.load(mg),Qo.load(Vm?jm:Fp))}Zm.__loaded=!1;const Jm=Zm;function Qm(){Qm.__loaded||(Qm.__loaded=!0,Za.RegisterGraphicCreator("line",pa),Qo.load(Qu),Qo.load(Vm?om:Gp))}Qm.__loaded=!1;const tb=Qm;function eb(){eb.__loaded||(eb.__loaded=!0,Za.RegisterGraphicCreator("path",Pa),Qo.load(lg),Qo.load(Vm?Rm:tf))}eb.__loaded=!1;const ib=eb;function ob(){ob.__loaded||(ob.__loaded=!0,Za.RegisterGraphicCreator("polygon",Ia),Qo.load(hg),Qo.load(Vm?Lm:Yp))}ob.__loaded=!1;const nb=ob;function rb(){rb.__loaded||(rb.__loaded=!0,Za.RegisterGraphicCreator("rect",ba),Qo.load(Zu),Qo.load(Vm?Kf:af))}rb.__loaded=!1;const sb=rb;function lb(){lb.__loaded||(lb.__loaded=!0,Za.RegisterGraphicCreator("richtext",Ma),Qo.load(pg),Qo.load(Vm?Dm:df))}lb.__loaded=!1;const ab=lb;function hb(){hb.__loaded||(hb.__loaded=!0,Za.RegisterGraphicCreator("symbol",ca),Qo.load(eg),Qo.load(Vm?hm:mf))}hb.__loaded=!1;const db=hb;function cb(){cb.__loaded||(cb.__loaded=!0,Za.RegisterGraphicCreator("text",ol),Qo.load(rg),Qo.load(Vm?wm:Cf))}cb.__loaded=!1;const ub=cb;function gb(){gb.__loaded||(gb.__loaded=!0,Za.RegisterGraphicCreator("wrapText",sl))}gb.__loaded=!1;const pb=gb;function fb(){qm(),sb()}const mb="PingFang SC,Helvetica Neue,Microsoft Yahei,system-ui,-apple-system,segoe ui,Roboto,Helvetica,Arial,sans-serif,apple color emoji,segoe ui emoji,segoe ui symbol";var bb;!function(t){t.selected="selected",t.selectedReverse="selected_reverse",t.hover="hover",t.hoverReverse="hover_reverse"}(bb||(bb={}));const vb={[bb.selectedReverse]:{},[bb.selected]:{},[bb.hover]:{},[bb.hoverReverse]:{}},yb={container:"",width:30,height:30,style:{}},Cb={debounce:Zt,throttle:function(t,e,i){let o=!0,n=!0;if("function"!=typeof t)throw new TypeError("Expected a function");return tt(i)&&(o="leading"in i?!!i.leading:o,n="trailing"in i?!!i.trailing:n),Zt(t,e,{leading:o,trailing:n,maxWait:e})}};fb();class wb extends vg{constructor(t,e){super((null==e?void 0:e.skipDefault)?t:St({},wb.defaultAttributes,t)),this.name="scrollbar",this._onRailPointerDown=t=>{const{viewX:e,viewY:i}=t,{direction:o,width:n,height:r,range:s}=this.attribute,l=this._sliderSize,[a,h]=this._getScrollRange();let d;if("vertical"===o){const t=i-this._viewPosition.y,e=Xt(t-l/2,a,h);d=t/r,this._slider.setAttribute("y",e,!0)}else{const t=e-this._viewPosition.x,i=Xt(t-l/2,a,h);d=t/n,this._slider.setAttribute("x",i,!0)}this.setScrollRange([d-(s[1]-s[0])/2,d+(s[1]-s[0])/2],!1),this.stage&&!this.stage.autoRender&&this.stage.renderNextFrame()},this._onSliderPointerDown=t=>{const{stopSliderDownPropagation:e=!0}=this.attribute;e&&t.stopPropagation();const{direction:i}=this.attribute,{x:o,y:n}=this.stage.eventPointTransform(t);this._prePos="horizontal"===i?o:n,this._dispatchEvent("scrollDown",{pos:this._prePos,event:t}),"browser"===du.env?(du.addEventListener("pointermove",this._onSliderPointerMoveWithDelay,{capture:!0}),du.addEventListener("pointerup",this._onSliderPointerUp)):(this.stage.addEventListener("pointermove",this._onSliderPointerMoveWithDelay,{capture:!0}),this.stage.addEventListener("pointerup",this._onSliderPointerUp),this.stage.addEventListener("pointerupoutside",this._onSliderPointerUp))},this._computeScrollValue=t=>{const{direction:e}=this.attribute,{x:i,y:o}=this.stage.eventPointTransform(t);let n,r,s=0;const{width:l,height:a}=this._getSliderRenderBounds();return"vertical"===e?(r=o,s=r-this._prePos,n=s/a):(r=i,s=r-this._prePos,n=s/l),[r,n]},this._onSliderPointerMove=t=>{const{stopSliderMovePropagation:e=!0}=this.attribute;e&&t.stopPropagation();const i=this.getScrollRange(),[o,n]=this._computeScrollValue(t);this.setScrollRange([i[0]+n,i[1]+n],!0),this._prePos=o},this._onSliderPointerMoveWithDelay=0===this.attribute.delayTime?this._onSliderPointerMove:Cb[this.attribute.delayType](this._onSliderPointerMove,this.attribute.delayTime),this._onSliderPointerUp=t=>{t.preventDefault();const{realTime:e=!0,range:i,limitRange:o=[0,1]}=this.attribute,n=this.getScrollRange(),[r,s]=this._computeScrollValue(t),l=[n[0]+s,n[1]+s];this._dispatchEvent("scrollUp",{pre:i,value:Yt(l,o[0],o[1])}),"browser"===du.env?(du.removeEventListener("pointermove",this._onSliderPointerMoveWithDelay,{capture:!0}),du.removeEventListener("pointerup",this._onSliderPointerUp)):(this.stage.removeEventListener("pointermove",this._onSliderPointerMoveWithDelay,{capture:!0}),this.stage.removeEventListener("pointerup",this._onSliderPointerUp),this.stage.removeEventListener("pointerupoutside",this._onSliderPointerUp))}}setScrollRange(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const{direction:i="horizontal",limitRange:o=[0,1],range:n,realTime:r=!0}=this.attribute,s=Yt(t,o[0],o[1]);if(e){const t=this._getSliderPos(s);if(this._slider){const e=t[1]-t[0];this._sliderSize=e,"horizontal"===i?this._slider.setAttributes({x:t[0],width:e},!0):this._slider.setAttributes({y:t[0],height:e},!0),this.stage&&!this.stage.autoRender&&this.stage.renderNextFrame()}}this.attribute.range=s,r&&this._dispatchEvent("scrollDrag",{pre:n,value:s})}getScrollRange(){return this.attribute.range}bindEvents(){if(this.attribute.disableTriggerEvent)return;const{delayType:t="throttle",delayTime:e=0}=this.attribute;this._rail&&this._rail.addEventListener("pointerdown",Cb[t](this._onRailPointerDown,e)),this._slider&&this._slider.addEventListener("pointerdown",this._onSliderPointerDown)}render(){this._reset();const{direction:t="horizontal",width:e,height:i,range:o,limitRange:n=[0,1],railStyle:r,sliderStyle:s,padding:l=2}=this.attribute,a=this.createOrUpdateChild("scrollbar-container",{},"group"),h=a.createOrUpdateChild("scrollbar-rail",Object.assign({x:0,y:0,width:e,height:i},r),"rect");this._rail=h;const d=this._getSliderRenderBounds(),c=this._getSliderPos(Yt(o,n[0],n[1])),u=c[1]-c[0];let g;this._sliderSize=u,g="horizontal"===t?{x:c[0],y:d.y1,width:u,height:d.height}:{x:d.x1,y:c[0],width:d.width,height:u};const p=a.createOrUpdateChild("slider",Object.assign(Object.assign(Object.assign(Object.assign({},g),{cornerRadius:this._getDefaultSliderCornerRadius()}),s),{boundsPadding:ei(l),pickMode:"imprecise"}),"rect");this._slider=p,this._container=a;const f=this._container.AABBBounds;this._viewPosition={x:f.x1,y:f.y1}}_getSliderRenderBounds(){if(this._sliderRenderBounds)return this._sliderRenderBounds;const{width:t,height:e,padding:i=2}=this.attribute,[o,n,r,s]=ei(i),l={x1:s,y1:o,x2:t-n,y2:e-r,width:Math.max(0,t-(s+n)),height:Math.max(0,e-(o+r))};return this._sliderRenderBounds=l,l}_getDefaultSliderCornerRadius(){const{direction:t,round:e}=this.attribute;if(e){const{width:e,height:i}=this._getSliderRenderBounds();return"horizontal"===t?i:e}return 0}_getSliderPos(t){const{direction:e}=this.attribute,{width:i,height:o,x1:n,y1:r}=this._getSliderRenderBounds();return"horizontal"===e?[i*t[0]+n,i*t[1]+n]:[o*t[0]+r,o*t[1]+r]}_getScrollRange(){if(this._sliderLimitRange)return this._sliderLimitRange;const{limitRange:t=[0,1],direction:e}=this.attribute,[i,o]=Yt(t,0,1),{width:n,height:r,x1:s,y1:l}=this._getSliderRenderBounds(),a=this._sliderSize;return"horizontal"===e?Yt([s+i*n,s+o*n],s,n-a):Yt([l+i*r,l+o*r],l,r-a)}_reset(){this._sliderRenderBounds=null,this._sliderLimitRange=null}}function xb(t,e){t.forEachChildren((t=>{const i=e(t);t.isContainer&&!i&&xb(t,e)}))}function _b(t,e){return[t[0]*e,t[1]*e]}function Sb(t,e,i){const o=function(t,e){const[i,o]=t,[n,r]=e,s=Math.sqrt((i*i+o*o)*(n*n+r*r)),l=s&&(i*n+o*r)/s;return Math.acos(Math.min(Math.max(l,-1),1))}(t,e),n=function(t,e){return t[0]*e[1]-e[0]*t[1]}(t,e)>=0;return i?n?2*Math.PI-o:o:n?o:2*Math.PI-o}wb.defaultAttributes={direction:"horizontal",round:!0,sliderSize:20,sliderStyle:{fill:"rgba(0, 0, 0, .5)"},railStyle:{fill:"rgba(0, 0, 0, .0)"},padding:2,scrollRange:[0,1],delayType:"throttle",delayTime:0,realTime:!0};const Ab=(t,e,i,o)=>new ti(Object.assign({defaultFontParams:Object.assign({fontFamily:mb,fontSize:14},o),getTextBounds:i?void 0:Qa,specialCharSet:"-/: .,@%'\"~"+ti.ALPHABET_CHAR_SET+ti.ALPHABET_CHAR_SET.toUpperCase()},null!=e?e:{}),t);function Bb(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!t)return{width:0,height:0};const o=Qa({text:t,fontFamily:e.fontFamily||i.fontFamily||mb,fontSize:e.fontSize||i.fontSize||12,fontWeight:e.fontWeight||i.fontWeight,textAlign:e.textAlign||"center",textBaseline:e.textBaseline,ellipsis:!!e.ellipsis,maxLineWidth:e.maxLineWidth||1/0,lineHeight:e.fontSize||i.fontSize||12});return{width:o.width(),height:o.height()}}function Rb(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"type";var i,o;return tt(t.text)&&"type"in t.text?null!==(i=t.text.type)&&void 0!==i?i:"text":e in t&&null!==(o=t[e])&&void 0!==o?o:"text"}function Mb(t){var e,i;return t.width=null!==(e=t.width)&&void 0!==e?e:0,t.height=null!==(i=t.height)&&void 0!==i?i:0,t.maxWidth=t.maxLineWidth,t.textConfig=t.text.text||t.text,t}function Tb(t){const e=Rb(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:"type");return"rich"===e?Za.richtext(Mb(t)):("html"===e?t=function(t){const{text:e,_originText:i}=t,{text:o}=e;return t.html=o,t.text=i,t.renderable=!1,t}(t):"react"===e&&(t=function(t){const{text:e,_originText:i}=t,{text:o}=e;return t.react=o,t.text=i,t.renderable=!1,t}(t)),Za.text(t))}function kb(){qm(),sb(),db(),ab(),ub()}var Pb=function(t,e){var i={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(i[o]=t[o]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(o=Object.getOwnPropertySymbols(t);n<o.length;n++)e.indexOf(o[n])<0&&Object.prototype.propertyIsEnumerable.call(t,o[n])&&(i[o[n]]=t[o[n]])}return i};kb();class Eb extends vg{getBgRect(){return this._bgRect}getTextShape(){return this._textShape}constructor(t,e){super((null==e?void 0:e.skipDefault)?t:St({},Eb.defaultAttributes,t)),this.name="tag"}render(){var t,e,i;const{text:o="",textStyle:n={},shape:r={},panel:s={},space:l=4,minWidth:a,maxWidth:h,padding:d=4,visible:c,state:u,type:g,textAlwaysCenter:p,containerTextAlign:f}=this.attribute,m=ei(d),b=this.createOrUpdateChild("tag-content",{x:0,y:0,zIndex:1},"group");let v,y=m[1]+m[3],C=m[0]+m[2],w=0,x=0;const{visible:_}=r,S=Pb(r,["visible"]);if(q(_)){const t=(null==S?void 0:S.size)||10,e=at(t)?t:Math.max(t[0],t[1]);v=b.createOrUpdateChild("tag-shape",Object.assign(Object.assign({symbolType:"circle",size:t,strokeBoundsBuffer:0},S),{visible:_,x:e/2,y:e/2}),"symbol"),mt(null==u?void 0:u.shape)||(v.states=u.shape),_&&(x=e+l)}let A;if(y+=x,w+=x,function(t){return"rich"===Rb(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:"type")}({text:o})||"rich"===g){const t=Object.assign(Object.assign(Object.assign({},Mb(Object.assign({type:g,text:o},n))),n),{visible:Q(o)&&!1!==c,x:w,y:0});A=b.createOrUpdateChild("tag-text",t,"richtext");const{visible:e}=s,i=Pb(s,["visible"]);if(c&&q(e)){const t=this.createOrUpdateChild("tag-panel",Object.assign(Object.assign({},i),{visible:e&&!!o,x:A.AABBBounds.x1,y:A.AABBBounds.y1,width:A.AABBBounds.width(),height:A.AABBBounds.height()}),"rect");mt(null==u?void 0:u.panel)||(t.states=u.panel),this._bgRect=t}}else{const l=Object.assign(Object.assign({text:tt(o)&&"type"in o&&"text"===o.type?o.text:o,visible:Q(o)&&!1!==c,lineHeight:null==n?void 0:n.fontSize},n),{x:w,y:0});J(l.lineHeight)&&(l.lineHeight=n.fontSize),A=b.createOrUpdateChild("tag-text",l,"text"),mt(null==u?void 0:u.text)||(A.states=u.text);const d=Bb(l.text,n,null===(e=null===(t=this.stage)||void 0===t?void 0:t.getTheme())||void 0===e?void 0:e.text),g=d.width,_=d.height;y+=g;const S=null!==(i=r.size)&&void 0!==i?i:10,B=at(S)?S:Math.max(S[0],S[1]);C+=Math.max(_,r.visible?B:0);const{textAlign:R,textBaseline:M}=n;(Q(a)||Q(h))&&(Q(a)&&y<a&&(y=a),Q(h)&&y>h&&(y=h,A.setAttribute("maxLineWidth",h-m[1]-m[2])));let T=0,k=0,P=0;"left"===R||"start"===R?P=1:"right"===R||"end"===R?P=-1:"center"===R&&(P=0),P?P<0?(T-=y,v&&v.setAttribute("x",(v.attribute.x||0)-g),b.setAttribute("x",-m[1]-x)):P>0&&b.setAttribute("x",m[3]):(T-=y/2,v&&v.setAttribute("x",(v.attribute.x||0)-g/2),b.setAttribute("x",-x/2));const E="right"===f||"end"===f,L="left"===f||"start"===f;if((f?"center"===f:p)&&P){const t=y-m[1]-m[3],e=g+x,i=1===P?(t-e)/2+x+g/2:m[0]+x-(y/2+e/2-x)+g/2;if(A.setAttributes({x:i,textAlign:"center"}),v){const t=i-g/2-x+B/2;v.setAttributes({x:t})}}if(L&&1!==P){const t=y-m[1]-m[3],e=0===P?-t/2+x/2:-y+m[3]+m[1]+x,i=e+x;if(A.setAttributes({x:i,textAlign:"left"}),v){const t=e+B/2;v.setAttributes({x:t})}}if(E&&-1!==P){const t=y-m[1]-m[3],e=0===P?t/2+x/2:t;if(A.setAttributes({x:e,textAlign:"right"}),v){const t=e-g-x+B/2;v.setAttributes({x:t})}}"middle"===M?(k-=C/2,v&&v.setAttribute("y",0)):"bottom"===M?(k-=C,v&&v.setAttribute("y",-_/2),b.setAttribute("y",-m[2])):"top"===M&&(b.setAttribute("y",m[0]),v&&v.setAttribute("y",_/2));const{visible:H}=s,z=Pb(s,["visible"]);if(c&&q(H)){const t=this.createOrUpdateChild("tag-panel",Object.assign(Object.assign({},z),{visible:H&&!!o,x:T,y:k,width:y,height:C}),"rect");mt(null==u?void 0:u.panel)||(t.states=u.panel),this._bgRect=t}}this._textShape=A}}Eb.defaultAttributes={visible:!0,textStyle:{fontSize:12,fill:"#000",textAlign:"left",textBaseline:"top"},space:4,padding:4,shape:{fill:"#000"}};const Lb={visible:!0,position:"auto",titleStyle:{fontSize:16,fill:"#08979c"},contentStyle:{fontSize:12,fill:"green"},panel:{visible:!0,fill:"#e6fffb",size:12,space:0,stroke:"#87e8de",lineWidth:1,cornerRadius:4}},Hb={poptip:St({},Lb)};var zb=function(t,e){var i={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(i[o]=t[o]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(o=Object.getOwnPropertySymbols(t);n<o.length;n++)e.indexOf(o[n])<0&&Object.prototype.propertyIsEnumerable.call(t,o[n])&&(i[o[n]]=t[o[n]])}return i};const Fb=new Ce;qm(),ub(),db(),sb();class Ib extends vg{constructor(t,e){super((null==e?void 0:e.skipDefault)?t:St({},Ib.defaultAttributes,t)),this.name="poptip",this.positionList=["top","tl","tr","bottom","bl","br","left","lt","lb","right","rt","rb"]}render(){var t,e,i,o,n,r,s,l;const{titleStyle:a={},position:h,contentStyle:d={},panel:c={},space:u=4,minWidth:g=0,maxWidth:p=1/0,padding:f=4,maxWidthPercent:m,visible:b,state:v,dx:y=0,dy:C=0}=this.attribute;let{title:w="",content:x=""}=this.attribute;w=this.attribute.titleFormatMethod?this.attribute.titleFormatMethod(w):w,x=this.attribute.contentFormatMethod?this.attribute.contentFormatMethod(x):x;const _=ei(f),S=this.createOrUpdateChild("poptip-content",{x:0,y:0,zIndex:1},"group"),A=p-_[1]-_[3],B=Q(w)&&!1!==b,R=Object.assign(Object.assign({text:rt(w)?w:[w],visible:B,wrap:!0},a),{x:_[3],y:_[0],maxLineWidth:A,textAlign:"left",textBaseline:"top"}),M=S.createOrUpdateChild("poptip-title",R,"text");mt(null==v?void 0:v.title)||(M.states=v.title);const T=M.AABBBounds,k=T.height(),P=T.width();let E=k+u;B||(E=0);const L=Q(x)&&!1!==b,H=Object.assign(Object.assign({text:rt(x)?x:[x],visible:L,wrap:!0},d),{x:_[3],y:_[0]+E,maxLineWidth:A,textAlign:"left",textBaseline:"top"}),z=S.createOrUpdateChild("poptip-content",H,"text");mt(null==v?void 0:v.content)||(z.states=v.content);const F=z.AABBBounds,I=F.height(),O=F.width();L&&(E+=I);let D=ae(P+_[1]+_[3],O+_[1]+_[3]);D>p?D=p:D<g&&(D=g);let W=_[0]+_[2]+E;const{visible:N}=c,G=zb(c,["visible"]),j=null!==(t=G.size)&&void 0!==t?t:12,V=rt(j)?[j[0]+(null!==(e=G.space)&&void 0!==e?e:0),j[1]+(null!==(i=G.space)&&void 0!==i?i:0)]:j+(null!==(o=G.space)&&void 0!==o?o:0),U=null!==(n=G.lineWidth)&&void 0!==n?n:1,$=this.stage?[null!==(r=this.stage.viewWidth)&&void 0!==r?r:this.stage.width,null!==(s=this.stage.viewHeight)&&void 0!==s?s:this.stage.height]:void 0;if($){const t=this.AABBBounds,e=null!==(l=this.attribute.x)&&void 0!==l?l:t.x1,i=$[0]-t.x1;let o=Math.max(e,i);const n=(rt(j)?j[0]:12)+3;if(o=Math.min(o-n,o*m),o<D){D=o;const t=_[1]+_[3];M.setAttribute("maxLineWidth",o-t),z.setAttribute("maxLineWidth",o-t),W=_[0]+_[2],B&&(W+=M.AABBBounds.height()+u),W+=z.AABBBounds.height()}}const X="auto"===h;let Y,K=-1/0;for(let t=0;t<this.positionList.length+1;t++){const e=X?this.positionList[t===this.positionList.length?Y:t]:h,{angle:i,offset:o,rectOffset:n}=this.getAngleAndOffset(e,D,W,rt(V)?V:[V,V-U]);if(q(N)){const t=(rt(j)?j[0]:j)/4,e=S.createOrUpdateChild("poptip-symbol-panel",Object.assign(Object.assign({},G),{visible:N&&(L||B),x:t,y:0,strokeBoundsBuffer:-1,boundsPadding:-2,anchor:[0,0],symbolType:"arrow2Left",angle:i,dx:o[0],dy:o[1],size:j,zIndex:-9}),"symbol");mt(null==v?void 0:v.panel)||(e.states=v.panel);const n=S.createOrUpdateChild("poptip-rect-panel",Object.assign(Object.assign({},G),{visible:N&&(L||B),x:0,y:0,width:D,height:W,zIndex:-8}),"rect");mt(null==v?void 0:v.panel)||(n.states=v.panel)}if(S.setAttributes({x:-o[0]+y,y:-o[1]+C}),!X||!$)break;{Fb.setValue(0,0,D,W).transformWithMatrix(S.globalTransMatrix);const e=Fb,i=(new ye).setValue(0,0,$[0],$[1]);if(J=i,tt=!1,(Z=e)&&J?(Oe=Z.x1,De=Z.x2,We=Z.y1,Ne=Z.y2,Ge=J.x1,je=J.x2,Ve=J.y1,Ue=J.y2,tt&&(Oe>De&&([Oe,De]=[De,Oe]),We>Ne&&([We,Ne]=[Ne,We]),Ge>je&&([Ge,je]=[je,Ge]),Ve>Ue&&([Ve,Ue]=[Ue,Ve])),Oe>Ge&&De<je&&We>Ve&&Ne<Ue?Xe.BBOX1:Ge>Oe&&je<De&&Ve>We&&Ue<Ne?Xe.BBOX2:Xe.NONE):Xe.NONE)break;{const o=$e(e,i,!1),n=(o.x2-o.x1)*(o.y2-o.y1);n>K&&(K=n,Y=t)}}}var Z,J,tt}getAngleAndOffset(t,e,i,o){const n=o[1]/2;switch(t){case"tl":return{angle:ee/2*3,offset:[e/4,i+n],rectOffset:[-e/4,-i-o[1]]};case"top":return{angle:ee/2*3,offset:[e/2,i+n],rectOffset:[0,-i-o[1]]};case"tr":return{angle:ee/2*3,offset:[e/4*3,i+n],rectOffset:[e/4*3,-i-o[1]]};case"rt":return{angle:0,offset:[-n,i/5],rectOffset:[e/4*3,-i-o[1]]};case"right":return{angle:0,offset:[-n,i/2],rectOffset:[e/4*3,-i-o[1]]};case"rb":return{angle:0,offset:[-n,i/5*4],rectOffset:[e/4*3,-i-o[1]]};case"bl":return{angle:ee/2,offset:[e/4,-n],rectOffset:[-e/4,-i-o[1]]};case"bottom":return{angle:ee/2,offset:[e/2,-n],rectOffset:[0,-i-o[1]]};case"br":return{angle:ee/2,offset:[e/4*3,-n],rectOffset:[e/4*3,-i-o[1]]};case"lt":return{angle:ee,offset:[e+n,i/5],rectOffset:[-e/4,-i-o[1]]};case"left":return{angle:ee,offset:[e+n,i/2],rectOffset:[0,-i-o[1]]};case"lb":return{angle:ee,offset:[e+n,i/5*4],rectOffset:[e/4*3,-i-o[1]]}}}}Ib.defaultAttributes={position:"rt",visible:!0,title:null,content:null,titleStyle:{fontSize:12,fill:"#000",textAlign:"left",textBaseline:"top"},contentStyle:{fontSize:12,fill:"#000",textAlign:"left",textBaseline:"top"},maxWidthPercent:.8,space:8,padding:10};var Ob=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s};let Db=class{render(t,e,i,o,n,r,s,l,a,h,d,c,u){var g;if(1===t._showPoptip){const{visible:e,visibleCb:i}=t.attribute.poptip||{};if(!1===e||i&&!1===i(t))return;const o={};St(o,Ib.defaultAttributes,t.attribute.poptip?t.attribute.poptip:{}),this.poptipComponent?this.poptipComponent.initAttributes(o):this.poptipComponent=new Ib(o);let n=t.attribute.poptip||{};if("text"===t.type&&null==n.title&&null==n.content){const e={};St(e,Hb.poptip,n),n=e,n.content=null!==(g=n.content)&&void 0!==g?g:t.attribute.text}const r=t.globalTransMatrix;this.poptipComponent.setAttributes(Object.assign(Object.assign({visibleAll:!0,pickable:!1,childrenPickable:!1},n),{x:r.e,y:r.f})),h.stage.tryInitInteractiveLayer();const s=h.stage.getLayer("_builtin_interactive");s&&s.add(this.poptipComponent)}else 2===t._showPoptip&&(t._showPoptip=0,this.poptipComponent&&this.poptipComponent.setAttributes({visibleAll:!1}))}};Db=Ob([y()],Db);var Wb=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s};let Nb=class{constructor(){this.name="poptip",this.activeEvent="onRegister",this._uid=r.GenAutoIncrementId(),this.key=this.name+this._uid,this.poptip=t=>{const e=t.target;if(e.isContainer||!e.attribute)return void this.unpoptip(t);if(e===this.activeGraphic)return;const{poptip:i}=e.attribute;i&&(e.setAttributes({}),e._showPoptip=1),this.activeGraphic&&(this.activeGraphic.setAttributes({}),this.activeGraphic._showPoptip=2),this.setActiveGraphic(e,!0)},this.unpoptip=t=>{this.activeGraphic&&(this.activeGraphic.setAttributes({}),this.activeGraphic._showPoptip=2,this.setActiveGraphic(null,!0))}}activate(t){this.pluginService=t;const{stage:e}=this.pluginService;e.addEventListener("pointerover",this.poptip)}setActiveGraphic(t,e){this.activeGraphic=t,this.pluginService.stage.renderNextFrame()}deactivate(t){const{stage:e}=this.pluginService;e.removeEventListener("pointerover",this.poptip)}};Nb=Wb([y()],Nb);let Gb=class{constructor(){this.name="poptipForText",this.activeEvent="onRegister",this._uid=r.GenAutoIncrementId(),this.key=this.name+this._uid,this.pointerlave=t=>{const{stage:e}=this.pluginService;t.target===e&&this.unpoptip(t)},this.poptip=t=>{const e=t.target;if("text"!==e.type||!e.cliped||e.isContainer||!e.attribute||e.attribute.disableAutoClipedPoptip)return void this.unpoptip(t);if(e===this.activeGraphic)return;const{poptip:i={}}=e.attribute;i&&(e.setAttributes({}),e._showPoptip=1),this.activeGraphic&&(this.activeGraphic.setAttributes({}),this.activeGraphic._showPoptip=2),this.setActiveGraphic(e,!0)},this.unpoptip=t=>{this.activeGraphic&&(this.activeGraphic.setAttributes({}),this.activeGraphic._showPoptip=2,this.setActiveGraphic(null,!0))}}activate(t){this.pluginService=t;const{stage:e}=this.pluginService;e.addEventListener("pointerover",this.poptip),e.addEventListener("pointerleave",this.pointerlave)}setActiveGraphic(t,e){this.activeGraphic=t,this.pluginService.stage.renderNextFrame()}deactivate(t){const{stage:e}=this.pluginService;e.removeEventListener("pointerover",this.poptip),e.removeEventListener("pointerleave",this.pointerlave)}};Gb=Wb([y()],Gb);const jb=new s(((t,e,i,o)=>{i(Db)||(t(Db).toSelf().inSingletonScope(),t(Xs).toService(Db)),i(Nb)||(t(Nb).toSelf(),t(wc).toService(Nb)),i(Gb)||(t(Gb).toSelf(),t(wc).toService(Gb))}));qm(),tb(),nb(),db();class Vb extends vg{getStartAngle(){return _e(this._startAngle)}getEndAngle(){return _e(this._endAngle)}getMainSegmentPoints(){return this._mainSegmentPoints}constructor(t,e){super((null==e?void 0:e.skipDefault)?t:St({},Vb.defaultAttributes,t)),this.name="segment",this.key="segment",this.lines=[]}render(){this.removeAllChild(!0),this._reset();const{startSymbol:t,endSymbol:e,lineStyle:i,state:o,visible:n=!0,multiSegment:r,mainSegmentIndex:s}=this.attribute;if(!n)return;this._computeLineAngle();const l=this._getMainSegmentPoints(),a=this._renderSymbol(t,l,"start"),h=this._renderSymbol(e,l,"end");if(this.startSymbol=a,this.endSymbol=h,r){const t=[...this.attribute.points];if(ht(s))t[s]=this._clipPoints(t[s]);else{const e=this._clipPoints(Ht(t));t[0][0]=e[0],t[t.length-1][t[t.length-1].length-1]=e[e.length-1]}t.forEach(((t,e)=>{var n,r;const s=Za.line(Object.assign(Object.assign({points:t},rt(i)?null!==(n=i[e])&&void 0!==n?n:i[i.length-1]:i),{fill:!1}));s.name=`${this.name}-line`,s.id=this._getNodeId("line"+e),mt(null==o?void 0:o.line)||(s.states=rt(o.line)?null!==(r=o.line[e])&&void 0!==r?r:o.line[o.line.length-1]:o.line),this.add(s),this.lines.push(s)}))}else{let t=Za.line;Tt(i)[0].cornerRadius&&(t=Za.polygon);const e=t(Object.assign(Object.assign({points:this._clipPoints(this.attribute.points)},Tt(i)[0]),{fill:!1,closePath:!1}));e.name=`${this.name}-line`,e.id=this._getNodeId("line"),mt(null==o?void 0:o.line)||(e.states=[].concat(o.line)[0]),this.add(e),this.lines.push(e)}}_computeStartRotate(t){return t+Math.PI/2}_computeEndRotate(t){return t+Math.PI/2}_renderSymbol(t,e,i){if(!e.length)return;const{autoRotate:o=!0}=t;let n;if(t&&t.visible){const r=this.getStartAngle(),s=this.getEndAngle(),{state:l}=this.attribute,a=e[0],h=e[e.length-1],{refX:d=0,refY:c=0,refAngle:u=0,style:g,symbolType:p,size:f=12}=t;let m,b;"start"===i?(m={x:a.x+(ht(r)?d*Math.cos(r)+c*Math.cos(r-Math.PI/2):0),y:a.y+(ht(r)?d*Math.sin(r)+c*Math.sin(r-Math.PI/2):0)},b=this._computeStartRotate(this._startAngle)):(m={x:h.x+(ht(s)?d*Math.cos(s)+c*Math.cos(s-Math.PI/2):0),y:h.y+(ht(s)?d*Math.sin(s)+c*Math.sin(s-Math.PI/2):0)},b=this._computeEndRotate(this._endAngle)),n=Za.symbol(Object.assign(Object.assign(Object.assign({},m),{symbolType:p,size:f,angle:o?b+u:0,strokeBoundsBuffer:0}),g)),n.name=`${this.name}-${i}-symbol`,n.id=this._getNodeId(`${i}-symbol`),mt(null==l?void 0:l.symbol)||(n.states=l.symbol),"start"===i?mt(null==l?void 0:l.startSymbol)||(n.states=l.startSymbol):mt(null==l?void 0:l.endSymbol)||(n.states=l.endSymbol),this.add(n)}return n}_getMainSegmentPoints(){if(this._mainSegmentPoints)return this._mainSegmentPoints;const{points:t,multiSegment:e,mainSegmentIndex:i}=this.attribute;let o;return o=e?ht(i)?t[i]:Ht(t):t,this._mainSegmentPoints=o,o}_clipPoints(t){const{startSymbol:e={},endSymbol:i={}}=this.attribute;let o=t;if(e.visible){const i=e.clip?e.size||10:0;o=[{x:t[0].x-i/2*(Math.cos(this._startAngle)||0),y:t[0].y-i/2*(Math.sin(this._startAngle)||0)},...o.slice(1)]}if(i.visible){const e=i.clip?i.size||10:0,n={x:t[t.length-1].x-e/2*(Math.cos(this._endAngle)||0),y:t[t.length-1].y-e/2*(Math.sin(this._endAngle)||0)};o=[...o.slice(0,o.length-1),n]}return o}_computeLineAngle(){const t=this._getMainSegmentPoints();if(t.length<=1)return;const e=t[0],i=t[1],o=t[t.length-2],n=t[t.length-1],r=[e.x-i.x,e.y-i.y],s=Math.atan2(r[1],r[0]),l=[n.x-o.x,n.y-o.y],a=Math.atan2(l[1],l[0]);this._startAngle=s,this._endAngle=a}_reset(){this.startSymbol=null,this.endSymbol=null,this._startAngle=null,this._endAngle=null,this._mainSegmentPoints=null}}var Ub,$b;Vb.defaultAttributes={visible:!0,lineStyle:{lineWidth:1,stroke:"#000"},startSymbol:{visible:!1,autoRotate:!0,symbolType:"triangle",size:12,refX:0,refY:0,refAngle:0,style:{fill:"#000",zIndex:1}},endSymbol:{visible:!1,autoRotate:!0,symbolType:"triangle",size:12,refX:0,refY:0,refAngle:0,style:{fill:"#000",zIndex:1}}},function(t){t.innerView="inner-view",t.axisContainer="axis-container",t.labelContainer="axis-label-container",t.tickContainer="axis-tick-container",t.tick="axis-tick",t.subTick="axis-sub-tick",t.label="axis-label",t.title="axis-title",t.gridContainer="axis-grid-container",t.grid="axis-grid",t.gridRegion="axis-grid-region",t.line="axis-line",t.background="axis-background",t.axisLabelBackground="axis-label-background"}(Ub||(Ub={})),function(t){t.selected="selected",t.selectedReverse="selected_reverse",t.hover="hover",t.hoverReverse="hover_reverse"}($b||($b={}));const Xb={[$b.selectedReverse]:{},[$b.selected]:{},[$b.hover]:{},[$b.hoverReverse]:{}},Yb={title:{space:4,padding:0,textStyle:{fontSize:12,fill:"#333333",fontWeight:"normal",fillOpacity:1}},label:{visible:!0,inside:!1,space:4,padding:0,style:{fontSize:12,fill:"#333",fontWeight:"normal",fillOpacity:1}},tick:{visible:!0,inside:!1,alignWithLabel:!0,length:4,style:{lineWidth:1,stroke:"#000",strokeOpacity:1}},subTick:{visible:!1,inside:!1,count:4,length:2,style:{lineWidth:1,stroke:"#999",strokeOpacity:1}},line:{visible:!0,style:{lineWidth:1,stroke:"#000",strokeOpacity:1}}},Kb=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if(t<0)for(;t<0;)t+=oe;else if(t>0)for(;t>oe;)t-=oe;return t};function qb(t,e,i){return!Ut(t,e,0,1e-6)&&!Vt(t,i,0,1e-6)}function Zb(t,e){return{x:t.x+e[0],y:t.y+e[1]}}function Jb(t,e,i){let o=arguments.length>3&&void 0!==arguments[3]&&arguments[3],n=arguments.length>4&&void 0!==arguments[4]&&arguments[4];const r=[e.x-i.x,e.y-i.y];return _b(r,(o?-1:1)*(n?-1:1)*t/function(t){const[e,i]=t;return Math.sqrt(e*e+i*i)}(r))}function Qb(t,e,i,o,n,r,s){const l=function(t,e,i){return e?{x:t.x+e*Math.cos(i),y:t.y+e*Math.sin(i)}:{x:t.x,y:t.y}}({x:0,y:0},i,t),a=Zb(l,Jb(o,l,e,n));return function(t,e,i,o){const n=Qa(Object.assign({text:i},o)),r=n.width(),s=n.height(),l=Kb(Math.atan2(e[1],e[0]))-Math.PI,a=3*Math.PI/4,h=Math.PI/4,d=Math.PI/2,c=t.x;let u=0;u=qb(l,-a,-h)?((l+a)/d-.5)*r:qb(l,h,a)?(.5-(l-h)/d)*r:Math.cos(l)>=0?.5*r:.5*-r;const g=c-u,p=t.y;let f=0;return f=qb(l,-a,-h)?.5*-s:qb(l,h,a)?.5*s:Math.cos(l)>=0?(.5-(h-l)/d)*s:(.5-Kb(l-a)/d)*s,{x:g,y:p-f}}(a,Jb(o||1,a,e,n),r,s)}class tv extends vg{constructor(){super(...arguments),this.name="axis",this.data=[],this.tickLineItems=[],this.subTickLineItems=[],this.axisLabelLayerSize={},this.axisLabelsContainer=null,this._onHover=t=>{this._lastHover=((t,e,i)=>{const o=t.target;return o!==i&&o.name&&!mt(o.states)?(o.addState(bb.hover,!0),xb(e,(t=>{t!==o&&t.name&&!mt(t.states)&&t.addState(bb.hoverReverse,!0)})),o):i})(t,this.axisContainer,this._lastHover)},this._onUnHover=t=>{this._lastHover=((t,e,i)=>i?(xb(e,(t=>{t.name&&!mt(t.states)&&(t.removeState(bb.hoverReverse),t.removeState(bb.hover))})),null):i)(0,this.axisContainer,this._lastHover)},this._onClick=t=>{this._lastSelect=((t,e,i)=>{const o=t.target;return i===o&&o.hasState(bb.selected)?(xb(e,(t=>{t.name&&!mt(t.states)&&(t.removeState(bb.selectedReverse),t.removeState(bb.selected))})),null):o.name&&!mt(o.states)?(o.addState(bb.selected,!0),xb(e,(t=>{t!==o&&t.name&&!mt(t.states)&&t.addState(bb.selectedReverse,!0)})),o):i})(t,this.axisContainer,this._lastSelect)}}getInnerView(){return this._innerView}getPrevInnerView(){return this._prevInnerView}getBoundsWithoutRender(t){const e=Ct(this.attribute);St(this.attribute,t);const i=Za.group({x:this.attribute.x,y:this.attribute.y});return this.add(i),this._renderInner(i),this.removeChild(i),this.attribute=e,i.AABBBounds}render(){this._prevInnerView=this._innerView&&function(t){const e={};return xb(t,(t=>{"group"!==t.type&&t.id&&(e[t.id]=t)})),e}(this._innerView),this.removeAllChild(!0),this._innerView=Za.group({x:0,y:0,pickable:!1}),this.add(this._innerView),this._renderInner(this._innerView),this._bindEvent()}_bindEvent(){if(this.attribute.disableTriggerEvent)return;const{hover:t,select:e}=this.attribute;t&&(this._innerView.addEventListener("pointermove",this._onHover),this._innerView.addEventListener("pointerout",this._onUnHover)),e&&this._innerView.addEventListener("pointerdown",this._onClick)}_renderInner(t){const{title:e,label:i,tick:o,line:n,items:r}=this.attribute,s=Za.group({x:0,y:0,zIndex:1});if(s.name=Ub.axisContainer,s.id=this._getNodeId("container"),s.setMode(this.mode),this.axisContainer=s,t.add(s),n&&n.visible&&this.renderLine(s),r&&r.length&&(this.data=this._transformItems(r[0]),o&&o.visible&&this.renderTicks(s),i&&i.visible)){const t=Za.group({x:0,y:0,pickable:!1});t.name=Ub.labelContainer,t.id=this._getNodeId("label-container"),this.axisLabelsContainer=t,s.add(t),r.forEach(((e,i)=>{const o=this.renderLabels(t,e,i),n=o.getChildren();this.beforeLabelsOverlap(n,e,o,i,r.length),this.handleLabelsOverlap(n,e,o,i,r.length),this.afterLabelsOverlap(n,e,o,i,r.length);let s=0,l=0,a="center",h="middle";n.forEach((t=>{var e;const i=t.attribute,o=null!==(e=i.angle)&&void 0!==e?e:0,n=t.AABBBounds;let r=n.width(),d=n.height();o&&(r=Math.abs(r*Math.cos(o)),d=Math.abs(d*Math.sin(o))),s=Math.max(s,r),l=Math.max(l,d),a=i.textAlign,h=i.textBaseline})),this.axisLabelLayerSize[i]={width:s,height:l,textAlign:a,textBaseline:h}}))}e&&e.visible&&this.renderTitle(s)}renderTicks(t){const e=this.getTickLineItems(),i=Za.group({x:0,y:0,pickable:!1});i.name=Ub.tickContainer,i.id=this._getNodeId("tick-container"),t.add(i),e.forEach(((t,o)=>{var n;const r=Za.line(Object.assign({},this._getTickLineAttribute("tick",t,o,e)));if(r.name=Ub.tick,r.id=this._getNodeId(t.id),mt(null===(n=this.attribute.tick)||void 0===n?void 0:n.state))r.states=vb;else{const t=this.data[o],e=St({},vb,this.attribute.tick.state);Object.keys(e).forEach((i=>{Z(e[i])&&(e[i]=e[i](t.rawValue,o,t,this.data))})),r.states=e}i.add(r)})),this.tickLineItems=e;const{subTick:o}=this.attribute;if(o&&o.visible){const t=this.getSubTickLineItems();t.length&&t.forEach(((t,n)=>{const r=Za.line(Object.assign({},this._getTickLineAttribute("subTick",t,n,e)));if(r.name=Ub.subTick,r.id=this._getNodeId(`${n}`),mt(o.state))r.states=vb;else{const i=St({},vb,o.state);Object.keys(i).forEach((o=>{Z(i[o])&&(i[o]=i[o](t.value,n,t,e))})),r.states=i}i.add(r)})),this.subTickLineItems=t}}renderLabels(t,e,i){const{dataFilter:o}=this.attribute.label;o&&Z(o)&&(e=o(e,i));const n=this._transformItems(e),r=Za.group({x:0,y:0,pickable:!1});return r.name=`${Ub.labelContainer}-layer-${i}`,r.id=this._getNodeId(`label-container-layer-${i}`),t.add(r),n.forEach(((t,e)=>{var o;const s=Tb(this._getLabelAttribute(t,e,n,i));if(s.name=Ub.label,s.id=this._getNodeId(`layer${i}-label-${t.id}`),mt(null===(o=this.attribute.label)||void 0===o?void 0:o.state))s.states=vb;else{const o=St({},vb,this.attribute.label.state);Object.keys(o).forEach((r=>{Z(o[r])&&(o[r]=o[r](t,e,n,i))})),s.states=o}r.add(s)})),r}renderTitle(t){const e=this.getTitleAttribute(),i=new Eb(Object.assign({},e));i.name=Ub.title,i.id=this._getNodeId("title"),t.add(i)}getVerticalCoord(t,e,i){return Zb(t,this.getVerticalVector(e,i,t))}getTextAlign(t){let e="center";return jt(t[0],0)?jt(t[1],0)?Object.is(t[1],-0)?e="start":Object.is(t[0],-0)&&(e="end"):e="center":t[0]>0?e="start":t[0]<0&&(e="end"),e}getTickLineItems(){const{tick:t}=this.attribute,e=this.data,i=[],{alignWithLabel:o,inside:n=!1,length:r,dataFilter:s}=t;let l=1;return e.length>=2&&(l=e[1].value-e[0].value),(s&&Z(s)?s(e):e).forEach((t=>{let e=t.point,s=t.value;if(!o){const i=t.value-l/2;if(this.isInValidValue(i))return;e=this.getTickCoord(i),s=i}const a=this.getVerticalCoord(e,r,n);if("3d"===this.mode){const o=this.getVerticalVector(r,n,e);let l=0,h=0;re(o[0])>re(o[1])?l=ee/2*(a.x>e.x?1:-1):h=ee/2*(a.y>e.y?-1:1),i.push({start:e,end:a,value:s,id:`tick-${t.id}`,anchor:[e.x,e.y],alpha:l,beta:h})}else i.push({start:e,end:a,value:s,id:`tick-${t.id}`})})),i}getSubTickLineItems(){const{subTick:t}=this.attribute,e=[],{count:i=4,inside:o=!1,length:n=2}=t,r=this.tickLineItems,s=r.length;if(s>=2)for(let t=0;t<s-1;t++){const s=r[t],l=r[t+1];for(let t=0;t<i;t++){const r=(t+1)/(i+1),a=(1-r)*s.value+r*l.value,h=this.getTickCoord(a),d=this.getVerticalCoord(h,n,o);e.push({start:h,end:d,value:a,id:`sub-tick-${a}`})}}return e}_getTickLineAttribute(t,e,i,o){let n=bt(this.attribute,`${t}.style`);const r=this.data[i];n=Z(n)?St({},bt(Yb,`${t}.style`),"tick"===t?n(r.rawValue,i,r,this.data):n(e.value,i,e,o)):n;const{start:s,end:l,anchor:a,alpha:h,beta:d}=e;return Object.assign({points:[s,l],anchor:a,alpha:h,beta:d},n)}_getLabelAttribute(t,e,i,o){var n,r;const{space:s=4,inside:l=!1,formatMethod:a,type:h="text",text:d}=this.attribute.label;let c=s,u=0;(null===(n=this.attribute.tick)||void 0===n?void 0:n.visible)&&this.attribute.tick.inside===l&&(u=this.attribute.tick.length||4),(null===(r=this.attribute.subTick)||void 0===r?void 0:r.visible)&&this.attribute.subTick.inside===l&&(u=Math.max(u,this.attribute.subTick.length||2)),c+=u;const g=this.getRelativeVector(t.point);o>0&&(0===g[1]?c+=(this.axisLabelLayerSize[o-1].height+bt(this.attribute,"label.space",4))*o:c+=(this.axisLabelLayerSize[o-1].width+bt(this.attribute,"label.space",4))*o);const p=this.getVerticalCoord(t.point,c,l),f=this.getVerticalVector(c||1,l,p),m=a?a(`${t.label}`,t,e,i,o):t.label;let{style:b}=this.attribute.label;b=Z(b)?St({},Yb.label.style,b(t,e,i,o)):b;return b=St(this.getLabelAlign(f,l,b.angle),b),Z(b.text)&&(b.text=b.text({label:t.label,value:t.rawValue,index:t.index,layer:o})),Object.assign(Object.assign(Object.assign({},this.getLabelPosition(p,f,m,b)),{text:null!=d?d:m,_originText:t.label,lineHeight:null==b?void 0:b.fontSize,type:h}),b)}getLabelPosition(t,e,i,o){return t}_transformItems(t){const e=[];return t.forEach((t=>{var i;e.push(Object.assign(Object.assign({},t),{point:this.getTickCoord(t.value),id:null!==(i=t.id)&&void 0!==i?i:t.label}))})),e}release(){super.release(),this._prevInnerView=null,this._innerView=null}}function ev(t){t.forEach((t=>{if(t.rotatedBounds||!t.attribute.angle)return;const e=function(t){const e=t.AABBBounds;return{x1:e.x1,x2:e.x2,y1:e.y1,y2:e.y2,centerX:t.attribute.x,centerY:t.attribute.y,angle:t.attribute.angle}}(t),i=(r=e.centerX,s=e.centerY,l=e.angle,a=t.attribute.x,h=t.attribute.y,{x:(r-a)*Math.cos(l)+(s-h)*Math.sin(l)+a,y:(r-a)*Math.sin(l)+(h-s)*Math.cos(l)+h}),o=i.x-e.centerX,n=i.y-e.centerY;var r,s,l,a,h;e.x1+=o,e.x2+=o,e.y1+=n,e.y2+=n,e.centerX+=o,e.centerY+=n,t.rotatedBounds=e}))}function iv(t,e){return Ye(t.AABBBounds,e.AABBBounds,!1)&&(!t.rotatedBounds||!e.rotatedBounds||function(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=arguments.length>3?arguments[3]:void 0;const n=Je(t,i),r=Je(e,i),s=(t,e)=>[e.x-t.x,e.y-t.y];o&&(o.save(),o.fillStyle="red",o.globalAlpha=.6,n.forEach(((t,e)=>{0===e?o.moveTo(t.x,t.y):o.lineTo(t.x,t.y)})),o.fill(),o.restore(),o.save(),o.fillStyle="green",o.globalAlpha=.6,r.forEach(((t,e)=>{0===e?o.moveTo(t.x,t.y):o.lineTo(t.x,t.y)})),o.fill(),o.restore());const l=Ze(t),a=Ze(e);o&&o.fillRect(l.x,l.y,2,2),o&&o.fillRect(a.x,a.y,2,2);const h=s(l,a),d=s(n[0],n[1]),c=s(n[1],n[2]),u=s(r[0],r[1]),g=s(r[1],r[2]),p=i?t.angle:we(t.angle);let f=i?t.angle+ie:we(90-t.angle);const m=i?e.angle:we(e.angle);let b=i?e.angle+ie:we(90-e.angle);f>ne&&(f-=ne),b>ne&&(b-=ne);const v=(t,e,i,o)=>{const n=[Math.cos(e),Math.sin(e)];return t+(Ke(n,i)+Ke(n,o))/2>Ke(n,h)};return v((t.x2-t.x1)/2,p,u,g)&&v((t.y2-t.y1)/2,f,u,g)&&v((e.x2-e.x1)/2,m,d,c)&&v((e.y2-e.y1)/2,b,d,c)}(t.rotatedBounds,e.rotatedBounds,!0))}const ov={parity:function(t){return t.filter(((t,e)=>e%2?t.setAttribute("opacity",0):1))},greedy:function(t,e){let i;return t.filter(((t,o)=>o&&nv(i,t,e)?t.setAttribute("opacity",0):(i=t,1)))}};function nv(t,e,i){const o=t.AABBBounds,n=e.AABBBounds;return i>Math.max(n.x1-o.x2,o.x1-n.x2,n.y1-o.y2,o.y1-n.y2)&&(!t.rotatedBounds||!e.rotatedBounds||i>Math.max(e.rotatedBounds.x1-t.rotatedBounds.x2,t.rotatedBounds.x1-e.rotatedBounds.x2,e.rotatedBounds.y1-t.rotatedBounds.y2,t.rotatedBounds.y1-e.rotatedBounds.y2))}function rv(t,e){for(let i,o=1,n=t.length,r=t[0];o<n;r=i,++o)if(nv(r,i=t[o],e))return!0}function sv(t){const e=t.AABBBounds;return e.width()>1&&e.height()>1}function lv(t){for(let e=1;e<t.length;e++)if(iv(t[e-1],t[e]))return!0;return!1}function av(t,e){"bottom"!==t&&"top"!==t||function(t,e){e.forEach((e=>{e.attribute.angle&&e.setAttributes(Object.assign(Object.assign({},dv(t,e.attribute.angle)),{angle:hv(e.attribute.angle)}))}))}(t,e),"left"!==t&&"right"!==t||function(t,e){e.forEach(((e,i)=>{e.attribute.angle&&e.setAttributes(Object.assign(Object.assign({},cv(t,e.attribute.angle)),{angle:hv(e.attribute.angle)}))}))}(t,e),ev(e)}function hv(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if(t<0)for(;t<0;)t+=2*Math.PI;if(t>0)for(;t>=2*Math.PI;)t-=2*Math.PI;return t}function dv(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=["center","left","left","left","center","right","right","right","left"],o=["top","top","middle","bottom","bottom","bottom","middle","top","top"];"top"===t&&(i=["center","right","right","right","center","left","left","left","right"],o=["bottom","bottom","middle","top","top","top","middle","bottom","bottom"]);const n=(e=hv(e))/(.5*Math.PI);let r;return r=n===Math.floor(n)?2*Math.floor(n):2*Math.floor(n)+1,{textAlign:i[r],textBaseline:o[r]}}function cv(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=["right","right","center","left","center","left","center","right","right"],o=["middle","middle","top","top","middle","middle","bottom","bottom","middle"];"right"===t&&(i=["left","right","right","right","left","left","left","left","right"],o=["middle","bottom","middle","top","top","top","middle","bottom","bottom"]);const n=(e=hv(e))/(.5*Math.PI);let r;return r=n===Math.floor(n)?2*Math.floor(n):2*Math.floor(n)+1,{textAlign:i[r],textBaseline:o[r]}}var uv,gv=function(t,e){var i={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(i[o]=t[o]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(o=Object.getOwnPropertySymbols(t);n<o.length;n++)e.indexOf(o[n])<0&&Object.prototype.propertyIsEnumerable.call(t,o[n])&&(i[o[n]]=t[o[n]])}return i};qm(),tb(),ab(),ub(),sb();class pv extends tv{constructor(t,e){super((null==e?void 0:e.skipDefault)?t:St({},pv.defaultAttributes,t),e)}_renderInner(t){var e;super._renderInner(t);const{panel:i}=this.attribute;if(i&&i.visible){const t=this.axisContainer,o=t.AABBBounds,n=Za.rect(Object.assign({x:o.x1,y:o.y1,width:o.width(),height:o.height()},i.style));n.name=Ub.background,n.id=this._getNodeId("background"),n.states=St({},Xb,null!==(e=i.state)&&void 0!==e?e:{}),t.insertBefore(n,t.firstChild)}}renderLine(t){const{start:e,end:i,line:o}=this.attribute,n=o,{startSymbol:r,endSymbol:s,style:l,breakRange:a,breakShape:h,breakShapeStyle:d,state:c}=n,u=gv(n,["startSymbol","endSymbol","style","breakRange","breakShape","breakShapeStyle","state"]),g=Object.assign({points:[e,i],startSymbol:r,endSymbol:s,lineStyle:l},u);mt(c)||(g.state={line:St({},Xb,c),symbol:St({},Xb,c)});const p=new Vb(g);p.name=Ub.line,p.id=this._getNodeId("line"),t.add(p)}getTitleAttribute(){var t,e,i;const o=this.attribute.title,{position:n="middle",space:r=4,textStyle:s={},autoRotate:l=!0,shape:a,background:h,state:d={},maxWidth:c}=o,u=gv(o,["position","space","textStyle","autoRotate","shape","background","state","maxWidth"]);let g=.5;"start"===n?g=0:"end"===n&&(g=1);const{verticalFactor:p=1}=this.attribute,f=-1*p,m=this.getTickCoord(g),b=this.getRelativeVector();let v=0;if((null===(t=this.attribute.label)||void 0===t?void 0:t.visible)&&!1===this.attribute.label.inside){const t=+bt(this.attribute,"label.space",4);v+=t;const e=Object.keys(this.axisLabelLayerSize).length;if(0===b[1]){const i=this.axisLabelsContainer?this.axisLabelsContainer.AABBBounds.height():0;isFinite(i)?v+=i+(e-1)*t:v=0}else{if(0===b[0]){const i=this.axisLabelsContainer?this.axisLabelsContainer.AABBBounds.width():0;isFinite(i)?v+=i+(e-1)*t:v=0}else Object.keys(this.axisLabelLayerSize).forEach(((e,i)=>{v+=this.axisLabelLayerSize[e].width+(i>0?t:0)}));const i=this.axisLabelLayerSize[0].textAlign,o="start"===i||"left"===i,n="center"===i,r=b[1]>0;v=1===f?r?o?v:n?v/2:t:o?t:n?v/2:v:r?o?t:n?v/2:v:o?v:n?v/2:t}}let y=0;(null===(e=this.attribute.tick)||void 0===e?void 0:e.visible)&&!1===this.attribute.tick.inside&&(y=this.attribute.tick.length||4),(null===(i=this.attribute.subTick)||void 0===i?void 0:i.visible)&&!1===this.attribute.subTick.inside&&(y=Math.max(y,this.attribute.subTick.length||2));const C=y+v+r,w=this.getVerticalCoord(m,C,!1),x=this.getVerticalVector(C,!1,{x:0,y:0});let _,S,{angle:A}=u;if(_="start"===n?"start":"end"===n?"end":"center",J(A)&&l){A=Sb(b,[1,0],!0);const{verticalFactor:t=1}=this.attribute;S=1==-1*t?"bottom":"top"}else _=this.getTextAlign(x),S=this.getTextBaseline(x,!1);let B=c;if(J(B)){const{verticalLimitSize:t,verticalMinSize:e,orient:i}=this.attribute,o=Math.min(t||1/0,e||1/0);if(ht(o))if("bottom"===i||"top"===i)if(A!==Math.PI/2){const t=Math.abs(Math.cos(null!=A?A:0));B=t<1e-6?1/0:this.attribute.end.x/t}else B=o-C;else if(A&&0!==A){const t=Math.abs(Math.sin(A));B=t<1e-6?1/0:this.attribute.end.y/t}else B=o-C}const R=Object.assign(Object.assign(Object.assign({},w),u),{maxWidth:B,textStyle:Object.assign({textAlign:_,textBaseline:S},s),state:{text:St({},Xb,d.text),shape:St({},Xb,d.shape),panel:St({},Xb,d.background)}});return R.angle=A,a&&a.visible&&(R.shape=Object.assign({visible:!0},a.style),a.space&&(R.space=a.space)),h&&h.visible&&(R.panel=Object.assign({visible:!0},h.style)),R}getTextBaseline(t,e){let i="middle";const{verticalFactor:o=1}=this.attribute,n=(e?1:-1)*o;return jt(t[1],0)?i=!jt(t[0],0)||Object.is(t[0],-0)||Object.is(t[1],-0)?"middle":1===n?"bottom":"top":t[1]>0?i="top":t[1]<0&&(i="bottom"),i}getLabelAlign(t,e,i){const o=this.attribute.orient;if(["top","bottom","right","left"].includes(o)||0===t[0]&&0===t[1]){if("top"===o||"bottom"===o)return dv(e?"bottom"===o?"top":"bottom":o,i);if("left"===o||"right"===o)return cv(e?"left"===o?"right":"left":o,i)}return{textAlign:this.getTextAlign(t),textBaseline:this.getTextBaseline(t,e)}}beforeLabelsOverlap(t,e,i,o,n){var r,s,l,a;const{flush:h=!1}=this.attribute.label||{};if(h&&t.length){const{orient:e,start:i,end:o}=this.attribute,n="bottom"===e||"top"===e,h=t[0],d=kt(t),c=n?h.attribute.x>d.attribute.x:h.attribute.y<d.attribute.y;if(n){const t=c?d:h,e=c?h:d,n=i.x,l=o.x,a=t.AABBBounds.x1,u=e.AABBBounds.x2;a<n&&(t.attribute.angle?t.setAttributes({dx:(null!==(r=t.attribute.dx)&&void 0!==r?r:0)+n-a}):t.setAttributes({x:n,textAlign:"left"})),u>l&&(e.attribute.angle?e.setAttributes({dx:(null!==(s=e.attribute.dx)&&void 0!==s?s:0)+l-u}):e.setAttributes({x:l,textAlign:"right"}))}else{const t=c?d:h,e=c?h:d,n=t.AABBBounds.y2,r=e.AABBBounds.y1,s=i.y,u=o.y;r<s&&(e.attribute.angle?e.setAttributes({dy:(null!==(l=e.attribute.dy)&&void 0!==l?l:0)+s-r}):e.setAttributes({y:s,textBaseline:"top"})),n>u&&(t.attribute.angle?t.setAttributes({dy:(null!==(a=t.attribute.dy)&&void 0!==a?a:0)+u-n}):t.setAttributes({y:u,textBaseline:"bottom"}))}}}handleLabelsOverlap(t,e,i,o,n){if(mt(t))return;const{verticalLimitSize:r,label:s,orient:l}=this.attribute,a=this._getAxisLabelLimitLength(r,n),{layoutFunc:h,autoRotate:d,autoRotateAngle:c,autoLimit:u,limitEllipsis:g,autoHide:p,autoHideMethod:f,autoHideSeparation:m,lastVisible:b}=s;if(Z(h))h(t,e,o,this);else{if(d&&function(t,e){if(mt(t))return;const{orient:i,labelRotateAngle:o=[0,45,90]}=e;if(0===o.length||t.some((t=>!!t.attribute.angle)))return;let n=0,r=0;for(o&&o.length>0&&(r=o.length);n<r;){const e=o[n++];if(t.forEach((t=>{t.attribute.angle=we(e)})),av(i,t),!lv(t))break}}(t,{labelRotateAngle:c,orient:l}),u&&ht(a)&&a>0){const e="left"===l||"right"===l,i=e?Math.abs(this.attribute.start.y-this.attribute.end.y):Math.abs(this.attribute.start.x-this.attribute.end.x);!function(t,e){const{limitLength:i,verticalLimitLength:o,ellipsis:n="...",orient:r,axisLength:s}=e;if(mt(t)||!ht(i))return;const l=Math.sin(Math.PI/10);t.forEach((t=>{var e;const a=t.attribute.angle,h=!J(a),d=h?Math.cos(a):1,c=h?Math.sin(a):0,u=!h||Math.abs(c)<=l,g=h&&Math.abs(d)<=l,p="top"===r||"bottom"===r;if(p){if(g&&Math.floor(t.AABBBounds.height())<=i)return;if(u&&Math.floor(t.AABBBounds.width())<=o)return}const f=t.attribute.direction;if(!p){if("vertical"===f&&Math.floor(t.AABBBounds.height())<=o)return;if("vertical"!==f){if(u&&Math.floor(t.AABBBounds.width())<=i)return;if(g&&Math.floor(t.AABBBounds.height())<=o)return}}let m=null;if(u||g)m=p?u?o:i:"vertical"===f||g?o:i;else if(p){const{x1:e,x2:o}=t.AABBBounds,n=c/d;m=n>0&&e<=s&&i/n+e>s?(s-e)/Math.abs(d):n<0&&o>=0&&i/n+o<0?o/Math.abs(d):Math.abs(i/c)}else m=Math.abs(i/d);ht(t.attribute.maxLineWidth)&&(m=ht(m)?Math.min(t.attribute.maxLineWidth,m):t.attribute.maxLineWidth),t.setAttributes({maxLineWidth:m,ellipsis:null!==(e=t.attribute.ellipsis)&&void 0!==e?e:n})}))}(t,{limitLength:a,verticalLimitLength:e?i/t.length:p||d?1/0:i/t.length,ellipsis:g,orient:l,axisLength:i})}p&&function(t,e){if(mt(t))return;const i=t.filter(sv);if(mt(i))return;let o;o=function(t){return t.forEach((t=>t.setAttribute("opacity",1))),t}(i),ev(o);const{method:n="parity",separation:r=0}=e,s=Z(n)?n:ov[n]||ov.parity;if(o.length>=3&&rv(o,r)){do{o=s(o,r)}while(o.length>=3&&rv(o,r));if(o.length<3||e.lastVisible){const t=kt(i);if(!t.attribute.opacity){const e=o.length;if(e>1){t.setAttribute("opacity",1);for(let i=e-1;i>=0&&nv(o[i],t,r);i--)o[i].setAttribute("opacity",0)}}}}i.forEach((t=>{t.setAttribute("visible",!!t.attribute.opacity)}))}(t,{orient:l,method:f,separation:m,lastVisible:b})}}afterLabelsOverlap(t,e,i,o,n){const{verticalLimitSize:r,orient:s}=this.attribute,l="bottom"===s||"top"===s,a=i.AABBBounds;let h=l?a.height():a.width();const{verticalMinSize:d}=this.attribute;if(ht(d)&&(!ht(r)||d<=r)){const t=this._getAxisLabelLimitLength(d,n);let e,o;h=Math.max(h,t),"left"===s?(e=a.x2-h,o=a.y1):"right"===s?(e=a.x1,o=a.y1):"top"===s?(e=a.x1,o=a.y2-h):"bottom"===s&&(e=a.x1,o=a.y1);const r=Za.rect({x:e,y:o,width:l?a.width():h,height:l?h:a.height(),pickable:!1});r.name=Ub.axisLabelBackground,r.id=this._getNodeId("axis-label-background"),i.insertBefore(r,i.firstChild)}if(Q(this.attribute.label.containerAlign)){let e;"left"===s?e=a.x2:"right"===s?e=a.x1:"top"===s?e=a.y2:"bottom"===s&&(e=a.y1),function(t,e,i,o,n){if("right"===o||"left"===o){if("left"===n){const n="right"===o?0:-1;t.forEach((t=>{t.setAttributes({x:e+i*n,textAlign:"left"})}))}else if("right"===n){const n="right"===o?1:0;t.forEach((t=>{t.setAttributes({x:e+i*n,textAlign:"right"})}))}else if("center"===n){const n="right"===o?1:-1;t.forEach((t=>{t.setAttributes({x:e+.5*i*n,textAlign:"center"})}))}}else if("bottom"===o||"top"===o)if("top"===n){const n="bottom"===o?0:-1;t.forEach((t=>{t.setAttributes({y:e+i*n,textBaseline:"top"})}))}else if("bottom"===n){const n="bottom"===o?1:0;t.forEach((t=>{t.setAttributes({y:e+i*n,textBaseline:"bottom"})}))}else if("middle"===n){const n="bottom"===o?1:-1;t.forEach((t=>{t.setAttributes({y:e+.5*i*n,textBaseline:"middle"})}))}}(t,e,h,s,this.attribute.label.containerAlign)}}_getAxisLabelLimitLength(t,e){var i,o,n,r,s;const{label:l,title:a,line:h,tick:d}=this.attribute,c=null!==(i=l.space)&&void 0!==i?i:4;let u=t,g=0,p=0;const f=h&&h.visible?null!==(o=h.style.lineWidth)&&void 0!==o?o:1:0,m=d&&d.visible?null!==(n=d.length)&&void 0!==n?n:4:0;if(a&&a.visible&&"string"==typeof a.text){g=Bb(a.text,a.textStyle,null===(s=null===(r=this.stage)||void 0===r?void 0:r.getTheme())||void 0===s?void 0:s.text).height;const t=ei(a.padding);p=a.space+t[0]+t[2]}return u&&(u=(u-c-p-g-f-m)/e),u}}function fv(t){switch(t){case uv.Linear:case uv.Log:case uv.Pow:case uv.Sqrt:case uv.Symlog:case uv.Time:return!0;default:return!1}}function mv(t){return t}pv.defaultAttributes=Yb,function(t,e){let i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(t="prototype"in t?t.prototype:t,e="prototype"in e?e.prototype:e,Object.getOwnPropertyNames){const o=Object.getOwnPropertyNames(e);for(let n=0;n<o.length;n++){const r=o[n];"constructor"!==r&&(i?null!=e[r]:null==t[r])&&(t[r]=e[r])}}else Mt(t,e,i)}(pv,class{isInValidValue(t){return t<0||t>1}getTickCoord(t){const{start:e}=this.attribute,i=this.getRelativeVector();return{x:e.x+i[0]*t,y:e.y+i[1]*t}}getRelativeVector(t){const{start:e,end:i}=this.attribute;return[i.x-e.x,i.y-e.y]}getVerticalVector(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const{verticalFactor:i=1}=this.attribute,o=function(t){const[e,i]=t;let o=e*e+i*i;return o>0&&(o=1/Math.sqrt(o)),[t[0]*o,t[1]*o]}(this.getRelativeVector());return _b([o[1],-1*o[0]],t*(e?1:-1)*i)}}),function(t){t.Identity="identity",t.Linear="linear",t.Log="log",t.Pow="pow",t.Sqrt="sqrt",t.Symlog="symlog",t.Time="time",t.Quantile="quantile",t.Quantize="quantize",t.Threshold="threshold",t.Ordinal="ordinal",t.Point="point",t.Band="band"}(uv||(uv={})),Object.values(uv).forEach((t=>{}));const bv=t=>-Math.log(-t),vv=t=>-Math.exp(-t),yv=t=>isFinite(t)?Math.pow(10,t):t<0?0:t,Cv=t=>10===t?yv:t===Math.E?Math.exp:e=>Math.pow(t,e),wv=t=>t===Math.E?Math.log:10===t?Math.log10:2===t?Math.log2:(t=Math.log(t),e=>Math.log(e)/t),xv=t=>e=>Math.sign(e)*Math.log1p(Math.abs(e/t)),_v=t=>e=>Math.sign(e)*Math.expm1(Math.abs(e))*t;function Sv(t,e){if(t=Number(t),e=Number(e),e-=t)return i=>(i-t)/e;const i=Number.isNaN(e)?NaN:.5;return()=>i}function Av(t,e,i){const o=t[0],n=t[1],r=e[0],s=e[1];let l,a;return n<o?(l=Sv(n,o),a=i(s,r)):(l=Sv(o,n),a=i(r,s)),t=>a(l(t))}function Bv(t,e,i){let o;return o=1===t?t+2*i:t-e+2*i,t?o>0?o:1:0}function Rv(t,e){const i=(t[1]-t[0])/(e[1]-e[0]),o=t[0]-i*e[0];return[o,i+o]}function Mv(t,e,i){const o=Math.min(t.length,e.length)-1,n=new Array(o),r=new Array(o);let s=-1;for(t[o]<t[0]&&(t=t.slice().reverse(),e=e.slice().reverse());++s<o;)n[s]=Sv(t[s],t[s+1]),r[s]=i(e[s],e[s+1]);return function(e){const i=function(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3?arguments[3]:void 0;for(J(o)&&(o=t.length);i<o;){const n=i+o>>>1;zt(t[n],e)>0?o=n:i=n+1}return i}(t,e,1,o)-1;return r[i](n[i](e))}}const Tv=(t,e)=>{const i=t.slice();let o=0,n=i.length-1,r=i[o],s=i[n];return s<r&&([o,n]=[n,o],[r,s]=[s,r]),i[o]=e.floor(r),i[n]=e.ceil(s),i},kv=function(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const i=Math.floor(Math.log10(t)),o=t/Math.pow(10,i);let n;return n=e?o<1.5?1:o<3?2:o<7?5:10:o<=1?1:o<=2?2:o<=5?5:10,n*Math.pow(10,i)};class Pv{constructor(){this._rangeFactorStart=null,this._rangeFactorEnd=null}_calculateWholeRange(t){return this._wholeRange?this._wholeRange:Q(this._rangeFactorStart)&&Q(this._rangeFactorEnd)&&2===t.length?(this._wholeRange=Rv(t,[this._rangeFactorStart,this._rangeFactorEnd]),this._wholeRange):t}rangeFactor(t,e,i){return t?(2===t.length&&t.every((t=>t>=0&&t<=1))&&(this._wholeRange=null,0===t[0]&&1===t[1]?(this._rangeFactorStart=null,this._rangeFactorEnd=null):(this._rangeFactorStart=t[0],this._rangeFactorEnd=t[1])),this):i?(this._wholeRange=null,this._rangeFactorStart=null,this._rangeFactorEnd=null,this):Q(this._rangeFactorStart)&&Q(this._rangeFactorEnd)?[this._rangeFactorStart,this._rangeFactorEnd]:null}rangeFactorStart(t,e){var i;return J(t)?this._rangeFactorStart:(t>=0&&t<=1&&(this._wholeRange=null,0!==t||!J(this._rangeFactorEnd)&&1!==this._rangeFactorEnd?(this._rangeFactorStart=t,this._rangeFactorEnd=null!==(i=this._rangeFactorEnd)&&void 0!==i?i:1):(this._rangeFactorStart=null,this._rangeFactorEnd=null)),this)}rangeFactorEnd(t,e){var i;return J(t)?this._rangeFactorEnd:(t>=0&&t<=1&&(this._wholeRange=null,0!==t||!J(this._rangeFactorStart)&&0!==this._rangeFactorStart?(this._rangeFactorEnd=t,this._rangeFactorStart=null!==(i=this._rangeFactorStart)&&void 0!==i?i:0):(this._rangeFactorStart=null,this._rangeFactorEnd=null)),this)}generateFishEyeTransform(){var t;if(!this._fishEyeOptions)return void(this._fishEyeTransform=null);const{distortion:e=2,radiusRatio:i=.1,radius:o}=this._fishEyeOptions,n=this.range(),r=n[0],s=n[n.length-1],l=Math.min(r,s),a=Math.max(r,s),h=Xt(null!==(t=this._fishEyeOptions.focus)&&void 0!==t?t:0,l,a),d=J(o)?(a-l)*i:o;let c=Math.exp(e);c=c/(c-1)*d;const u=e/d;this._fishEyeTransform=t=>{const e=Math.abs(t-h);if(e>=d)return t;if(e<=1e-6)return h;const i=c*(1-Math.exp(-e*u))/e*.75+.25;return h+(t-h)*i}}unknown(t){return arguments.length?(this._unknown=t,this):this._unknown}}const Ev=Symbol("implicit");class Lv extends Pv{specified(t){var e;return t?(this._specified=Object.assign(null!==(e=this._specified)&&void 0!==e?e:{},t),this):Object.assign({},this._specified)}_getSpecifiedValue(t){if(this._specified)return this._specified[t]}constructor(){super(),this.type=uv.Ordinal,this._index=new Map,this._domain=[],this._ordinalRange=[],this._unknown=Ev}clone(){const t=(new Lv).domain(this._domain).range(this._ordinalRange).unknown(this._unknown);return this._specified&&t.specified(this._specified),t}calculateVisibleDomain(t){return Q(this._rangeFactorStart)&&Q(this._rangeFactorEnd)&&2===t.length?[this.invert(t[0]),this.invert(t[1])]:this._domain}scale(t){const e=`${t}`,i=this._getSpecifiedValue(e);if(void 0!==i)return i;let o=this._index.get(e);if(!o){if(this._unknown!==Ev)return this._unknown;o=this._domain.push(t),this._index.set(e,o)}const n=this._ordinalRange[(o-1)%this._ordinalRange.length];return this._fishEyeTransform?this._fishEyeTransform(n):n}invert(t){let e=0;for(;e<this._ordinalRange.length&&this._ordinalRange[e]!==t;)e++;return this._domain[(e-1)%this._domain.length]}domain(t){if(!t)return this._domain.slice();this._domain=[],this._index=new Map;for(const e of t){const t=`${e}`;this._index.has(t)||this._index.set(t,this._domain.push(e))}return this}range(t){if(!t)return this._ordinalRange.slice();const e=Array.from(t);return this._ordinalRange=e,this}index(t){var e;return this._index&&null!==(e=this._index.get(`${t}`))&&void 0!==e?e:-1}}function Hv(t,e,i,o){let n;const r=[];let s;if(e=Math.floor(+e),t=Math.floor(+t),!(i=Math.floor(+i)))return[];if(t===e)return[t];if(n=e<t){const i=t;t=e,e=i}let l=Kt(1,e-t+1)(i);if(s=Math.floor((e-t+1)/l),!o)for(;Math.ceil((e-t+1)/s)>i&&l>1;)l-=1,s=Math.floor((e-t)/l);let a=t;for(;a<=e;)r.push(a),a+=s;return n&&r.reverse(),r}class zv extends Lv{constructor(t){super(),this.type=uv.Band,this._range=[0,1],this._step=void 0,this._bandwidth=void 0,this._isFixed=!1,this._round=!1,this._paddingInner=0,this._paddingOuter=0,this._align=.5,this._unknown=void 0,delete this.unknown,this.rescale(t)}rescale(t,e){if(t)return this;this._wholeRange=null;const i=this._calculateWholeRange(this._range,e),o=super.domain().length,n=i[1]<i[0];let r=i[Number(n)-0];const s=i[1-Number(n)],l=Bv(o,this._paddingInner,this._paddingOuter);return this._step=(s-r)/Math.max(1,l||1),this._round&&(this._step=Math.floor(this._step)),r+=(s-r-this._step*(o-this._paddingInner))*this._align,this.isBandwidthFixed()||(this._bandwidth=this._step*(1-this._paddingInner)),this._round&&(r=Math.round(r),this.isBandwidthFixed()||(this._bandwidth=Math.round(this._bandwidth))),this._bandRangeState={reverse:n,start:n?r+this._step*(o-1):r,count:o},this.generateFishEyeTransform(),this}scale(t){if(!this._bandRangeState)return;const e=`${t}`,i=this._getSpecifiedValue(e);if(void 0!==i)return i;let o=this._index.get(e);if(!o){if(this._unknown!==Ev)return this._unknown;o=this._domain.push(t),this._index.set(e,o)}const{count:n,start:r,reverse:s}=this._bandRangeState,l=r+(o-1)%n*(s?-1:1)*this._step;return this._fishEyeTransform?this._fishEyeTransform(l):l}_calculateWholeRange(t,e){if(this._wholeRange)return this._wholeRange;if((this._minBandwidth||this._maxBandwidth)&&!this._isBandwidthFixedByUser()){let e;if(Q(this._rangeFactorStart)&&Q(this._rangeFactorEnd)&&2===t.length){const i=Rv(t,[this._rangeFactorStart,this._rangeFactorEnd]);e=Math.abs(i[1]-i[0])}else e=Math.abs(t[1]-t[0]);const i=function(t,e,i,o,n){const r=Bv(t,i,o);let s=e/Math.max(1,r||1);n&&(s=Math.floor(s));let l=s*(1-i);return n&&(l=Math.round(l)),l}(super.domain().length,e,this._paddingInner,this._paddingOuter,this._round);i<this._minBandwidth?(this._bandwidth=this._minBandwidth,this._isFixed=!0):i>this._maxBandwidth?(this._bandwidth=this._maxBandwidth,this._isFixed=!0):(this._bandwidth=i,this._isFixed=!1)}if(this.isBandwidthFixed()){const s=(i=super.domain().length,o=this._bandwidth,n=this._paddingInner,r=this._paddingOuter,1===n&&(n=0),Bv(i,n,r)*(o/(1-n))*Math.sign(t[1]-t[0])),l=Math.min((t[1]-t[0])/s,1);if(Q(this._rangeFactorStart)&&Q(this._rangeFactorEnd)){if(s>0){const e=t[0]-s*this._rangeFactorStart,i=e+s;this._wholeRange=[e,i]}else{const e=t[1]+s*(1-this._rangeFactorEnd),i=e-s;this._wholeRange=[i,e]}const i=this._rangeFactorStart+l<=1,o=this._rangeFactorEnd-l>=0;"rangeFactorStart"===e&&i?this._rangeFactorEnd=this._rangeFactorStart+l:"rangeFactorEnd"===e&&o?this._rangeFactorStart=this._rangeFactorEnd-l:t[0]<=t[1]?i?this._rangeFactorEnd=this._rangeFactorStart+l:o?this._rangeFactorStart=this._rangeFactorEnd-l:(this._rangeFactorStart=0,this._rangeFactorEnd=l):o?this._rangeFactorStart=this._rangeFactorEnd-l:i?this._rangeFactorEnd=this._rangeFactorStart+l:(this._rangeFactorStart=1-l,this._rangeFactorEnd=1)}else this._rangeFactorStart=0,this._rangeFactorEnd=l,this._wholeRange=[t[0],t[0]+s];return this._wholeRange}var i,o,n,r;return super._calculateWholeRange(t)}calculateWholeRangeSize(){const t=this._calculateWholeRange(this._range);return Math.abs(t[1]-t[0])}calculateVisibleDomain(t){const e=this._domain;if(Q(this._rangeFactorStart)&&Q(this._rangeFactorEnd)&&e.length){const i=this._getInvertIndex(t[0]),o=this._getInvertIndex(t[1]);return e.slice(Math.min(i,o),Math.max(i,o)+1)}return e}domain(t,e){return t?(super.domain(t),this.rescale(e)):super.domain()}range(t,e){return t?(this._range=[Ft(t[0]),Ft(t[1])],this.rescale(e)):this._range}rangeRound(t,e){return this._range=[Ft(t[0]),Ft(t[1])],this._round=!0,this.rescale(e)}ticks(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10;const e=this.calculateVisibleDomain(this._range);return-1===t?e:Hv(0,e.length-1,t,!1).map((t=>e[t]))}tickData(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10;return this.ticks(t).map(((t,e)=>({index:e,tick:t,value:(this.scale(t)-this._range[0]+this._bandwidth/2)/(this._range[1]-this._range[0])})))}forceTicks(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10;const e=this.calculateVisibleDomain(this._range);return Hv(0,e.length-1,t,!0).filter((t=>t<e.length)).map((t=>e[t]))}stepTicks(t){const e=this.calculateVisibleDomain(this._range);return function(t,e,i){const o=[];let n;if(i=Kt(1,(e=Math.floor(+e))-(t=Math.floor(+t))+1)(Math.floor(+i)),n=e<t){const i=t;t=e,e=i}let r=t;for(;r<=e;)o.push(r),r+=i;return n&&o.reverse(),o}(0,e.length-1,t).map((t=>e[t]))}_getInvertIndex(t){let e=0;const i=this.step()/2,o=this.bandwidth()/2,n=this._domain.length,r=this.range(),s=r[0]>r[r.length-1];for(e=0;e<n;e++){const r=this.scale(this._domain[e])+o;if(0===e&&(!s&&!Vt(t,r+i)||s&&!Ut(t,r-i)))break;if(e===n-1)break;if(!Ut(t,r-i)&&!Vt(t,r+i))break}return e>=0&&e<=n-1?e:n-1}invert(t){return this._domain[this._getInvertIndex(t)]}padding(t,e){return void 0!==t?(this._paddingOuter=Math.max(0,Math.min(Array.isArray(t)?Math.min.apply(null,t):t)),this._paddingInner=this._paddingOuter,this.rescale(e)):this._paddingInner}paddingInner(t,e){return void 0!==t?(this._paddingInner=Math.max(0,Math.min(1,t)),this.rescale(e)):this._paddingInner}paddingOuter(t,e){return void 0!==t?(this._paddingOuter=Math.max(0,Math.min(1,t)),this.rescale(e)):this._paddingOuter}step(){return this._step}round(t,e){return void 0!==t?(this._round=t,this.rescale(e)):this._round}align(t,e){return void 0!==t?(this._align=Math.max(0,Math.min(1,t)),this.rescale(e)):this._align}rangeFactor(t,e){return t?(super.rangeFactor(t),this.rescale(e)):super.rangeFactor()}rangeFactorStart(t,e){return J(t)?super.rangeFactorStart():(super.rangeFactorStart(t),this.rescale(e,"rangeFactorStart"))}rangeFactorEnd(t,e){return J(t)?super.rangeFactorEnd():(super.rangeFactorEnd(t),this.rescale(e,"rangeFactorEnd"))}bandwidth(t,e){return t?("auto"===t?(this._bandwidth=void 0,this._isFixed=!1):(this._bandwidth=t,this._isFixed=!0),this._userBandwidth=t,this.rescale(e)):this._bandwidth}maxBandwidth(t,e){return t?(this._maxBandwidth="auto"===t?void 0:t,this.rescale(e)):this._maxBandwidth}minBandwidth(t,e){return t?(this._minBandwidth="auto"===t?void 0:t,this.rescale(e)):this._minBandwidth}fishEye(t,e,i){return t||i?(this._fishEyeOptions=t,this._fishEyeTransform=null,this.rescale(e)):this._fishEyeOptions}isBandwidthFixed(){return this._isFixed&&!!this._bandwidth}_isBandwidthFixedByUser(){return this._isFixed&&this._userBandwidth&&at(this._userBandwidth)}clone(){var t,e,i;return new zv(!0).domain(this._domain,!0).range(this._range,!0).round(this._round,!0).paddingInner(this._paddingInner,!0).paddingOuter(this._paddingOuter,!0).align(this._align,!0).bandwidth(null!==(t=this._userBandwidth)&&void 0!==t?t:"auto",!0).maxBandwidth(null!==(e=this._maxBandwidth)&&void 0!==e?e:"auto",!0).minBandwidth(null!==(i=this._maxBandwidth)&&void 0!==i?i:"auto")}}const{interpolateRgb:Fv}=Ie;function Iv(t,e){const i=typeof e;let o;if(J(e)||"boolean"===i)return()=>e;if("number"===i)return Jt(t,e);if("string"===i){if(o=ze.parseColorString(e)){const e=Fv(ze.parseColorString(t),o);return t=>e(t).formatRgb()}return Jt(Number(t),Number(e))}return e instanceof Fe?Fv(t,e):e instanceof ze?Fv(t.color,e.color):e instanceof Date?function(t,e){const i=t.valueOf(),o=e.valueOf(),n=new Date;return t=>(n.setTime(i*(1-t)+o*t),n)}(t,e):Jt(Number(t),Number(e))}class Ov extends Pv{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:mv,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:mv;super(),this._unknown=void 0,this.transformer=t,this.untransformer=e,this._forceAlign=!0,this._domain=[0,1],this._range=[0,1],this._clamp=mv,this._piecewise=Av,this._interpolate=Iv}calculateVisibleDomain(t){var e;return Q(this._rangeFactorStart)&&Q(this._rangeFactorEnd)&&2===t.length?[this.invert(t[0]),this.invert(t[1])]:null!==(e=this._niceDomain)&&void 0!==e?e:this._domain}fishEye(t,e,i){return t||i?(this._fishEyeOptions=t,this._fishEyeTransform=null,this.rescale(e)):this._fishEyeOptions}scale(t){var e;if(t=Number(t),Number.isNaN(t)||this._domainValidator&&!this._domainValidator(t))return this._unknown;this._output||(this._output=this._piecewise((null!==(e=this._niceDomain)&&void 0!==e?e:this._domain).map(this.transformer),this._calculateWholeRange(this._range),this._interpolate));const i=this._output(this.transformer(this._clamp(t)));return this._fishEyeTransform?this._fishEyeTransform(i):i}invert(t){var e;return this._input||(this._input=this._piecewise(this._calculateWholeRange(this._range),(null!==(e=this._niceDomain)&&void 0!==e?e:this._domain).map(this.transformer),Jt)),this._clamp(this.untransformer(this._input(t)))}domain(t,e){var i;if(!t)return(null!==(i=this._niceDomain)&&void 0!==i?i:this._domain).slice();this._domainValidator=null,this._niceType=null,this._niceDomain=null;const o=Array.from(t,Ft);return this._domain=o,this.rescale(e)}range(t,e){if(!t)return this._range.slice();const i=Array.from(t);return this._range=i,this.rescale(e)}rangeRound(t,e){const i=Array.from(t);return this._range=i,this._interpolate=Qt,this.rescale(e)}rescale(t){var e;if(t)return this;const i=null!==(e=this._niceDomain)&&void 0!==e?e:this._domain,o=i.length,n=this._range.length;let r=Math.min(o,n);if(o&&o<n&&this._forceAlign){const t=n-o+1,e=i[o-1],s=o>=2?(e-i[o-2])/t:0;for(let n=1;n<=t;n++)i[o-2+n]=e-s*(t-n);r=n}return this._autoClamp&&(this._clamp=Kt(i[0],i[r-1])),this._piecewise=r>2?Mv:Av,this._output=this._input=null,this._wholeRange=null,this.generateFishEyeTransform(),this}clamp(t,e,i){return arguments.length?(e?(this._autoClamp=!1,this._clamp=e):(this._autoClamp=!!t,this._clamp=t?void 0:mv),this.rescale(i)):this._clamp!==mv}interpolate(t,e){return arguments.length?(this._interpolate=t,this.rescale(e)):this._interpolate}ticks(){return[]}tickData(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10;const e=this.ticks(t);return(null!=e?e:[]).map(((t,e)=>({index:e,tick:t,value:(this.scale(t)-this._range[0])/(this._range[1]-this._range[0])})))}rangeFactor(t,e){return t?(super.rangeFactor(t),this._output=this._input=null,this):super.rangeFactor()}rangeFactorStart(t,e){return J(t)?super.rangeFactorStart():(super.rangeFactorStart(t),this._output=this._input=null,this)}rangeFactorEnd(t,e){return J(t)?super.rangeFactorEnd():(super.rangeFactorEnd(t),this._output=this._input=null,this)}forceAlignDomainRange(t){return arguments.length?(this._forceAlign=t,this):this._forceAlign}}const Dv=Math.sqrt(50),Wv=Math.sqrt(10),Nv=Math.sqrt(2),Gv=[1,2,5,10],jv=(t,e,i)=>{let o=1,n=t;const r=Math.floor((e-1)/2),s=Math.abs(t);return t>=0&&t<=Number.MIN_VALUE?n=0:t<0&&t>=-Number.MIN_VALUE?n=-(e-1):!i&&s<1?o=Xv(s).step:(i||s>1)&&(n=Math.floor(t)-r*o),o>0?(t>0?n=Math.max(n,0):t<0&&(n=Math.min(n,-(e-1)*o)),function(t,e,i){Q(e)||(e=t,t=0),Q(i)||(i=1);let o=-1;const n=0|Math.max(0,Math.ceil((e-t)/i)),r=new Array(n);for(;++o<n;)r[o]=t+o*i;return r}(0,e).map((t=>n+t*o))):t>0?Uv(0,-(e-1)/o,o):Uv((e-1)/o,0,o)},Vv=$t(((t,e,i,o)=>{let n,r,s,l,a=-1;if(i=+i,(t=+t)==(e=+e))return[t];if(Math.abs(t-e)<=Number.MIN_VALUE&&i>0)return[t];if((n=e<t)&&(r=t,t=e,e=r),l=Yv(t,e,i).step,!isFinite(l))return[];if(l>0){let i=Math.round(t/l),o=Math.round(e/l);for(i*l<t&&++i,o*l>e&&--o,s=new Array(r=o-i+1);++a<r;)s[a]=(i+a)*l}else if(l<0&&(null==o?void 0:o.noDecimals)){l=1;const i=Math.ceil(t),o=Math.floor(e);if(!(i<=o))return[];for(s=new Array(r=o-i+1);++a<r;)s[a]=i+a}else{l=-l;let i=Math.round(t*l),o=Math.round(e*l);for(i/l<t&&++i,o/l>e&&--o,s=new Array(r=o-i+1);++a<r;)s[a]=(i+a)/l}return n&&s.reverse(),s})),Uv=(t,e,i)=>{let o,n,r=-1;if(i>0){let s=Math.floor(t/i),l=Math.ceil(e/i);for((s+1)*i<t&&++s,(l-1)*i>e&&--l,n=new Array(o=l-s+1);++r<o;)n[r]=(s+r)*i}else{i=-i;let s=Math.floor(t*i),l=Math.ceil(e*i);for((s+1)/i<t&&++s,(l-1)/i>e&&--l,n=new Array(o=l-s+1);++r<o;)n[r]=(s+r)/i}return n},$v=$t(((t,e,i,o)=>{let n,r,s;if(i=+i,(t=+t)==(e=+e))return jv(t,i,null==o?void 0:o.noDecimals);if(Math.abs(t-e)<=Number.MIN_VALUE&&i>0)return jv(t,i,null==o?void 0:o.noDecimals);(n=e<t)&&(s=t,t=e,e=s);const l=Yv(t,e,i);let a=l.step;if(!isFinite(a))return[];if(a>0){let o=1;const{power:n,gap:s}=l,h=10===s?2*10**n:1*10**n;for(;o<=5&&(r=Uv(t,e,a),r.length>i+1)&&i>2;)a+=h,o+=1;i>2&&r.length<i-1&&(r=((t,e,i)=>{let o;const n=t[0],r=t[t.length-1],s=e-t.length;if(r<=0){const e=[];for(o=s;o>=1;o--)e.push(n-o*i);return e.concat(t)}if(n>=0){for(o=1;o<=s;o++)t.push(r+o*i);return t}let l=[];const a=[];for(o=1;o<=s;o++)o%2==0?l=[n-Math.floor(o/2)*i].concat(l):a.push(r+Math.ceil(o/2)*i);return l.concat(t).concat(a)})(r,i,a))}else(null==o?void 0:o.noDecimals)&&a<0&&(a=1),r=Uv(t,e,a);return n&&r.reverse(),r})),Xv=t=>{const e=Math.floor(Math.log(t)/Math.LN10),i=t/10**e;let o=Gv[0];return i>=Dv?o=Gv[3]:i>=Wv?o=Gv[2]:i>=Nv&&(o=Gv[1]),e>=0?{step:o*10**e,gap:o,power:e}:{step:-(10**-e)/o,gap:o,power:e}};function Yv(t,e,i){const o=(e-t)/Math.max(0,i);return Xv(o)}function Kv(t,e,i){let o;if(i=+i,(t=+t)==(e=+e)&&i>0)return[t];if(i<=0||0===(o=function(t,e,i){return(e-t)/Math.max(1,i-1)}(t,e,i))||!isFinite(o))return[];const n=new Array(i);for(let e=0;e<i;e++)n[e]=t+e*o;return n}function qv(t){let e,i,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10,n=0,r=t.length-1,s=t[n],l=t[r],a=10;for(l<s&&(i=s,s=l,l=i,i=n,n=r,r=i);a-- >0;){if(i=Yv(s,l,o).step,i===e)return t[n]=s,t[r]=l,t;if(i>0)s=Math.floor(s/i)*i,l=Math.ceil(l/i)*i;else{if(!(i<0))break;s=Math.ceil(s*i)/i,l=Math.floor(l*i)/i}e=i}}function Zv(t,e){const i=at(e.forceMin),o=at(e.forceMax);let n=null;const r=[];let s=null;const l=i&&o?t=>t>=e.forceMin&&t<=e.forceMax:i?t=>t>=e.forceMin:o?t=>t<=e.forceMax:null;return i?r[0]=e.forceMin:at(e.min)&&e.min<=Math.min(t[0],t[t.length-1])&&(r[0]=e.min),o?r[1]=e.forceMax:at(e.max)&&e.max>=Math.max(t[0],t[t.length-1])&&(r[1]=e.max),at(r[0])&&at(r[1])?(s=t.slice(),s[0]=r[0],s[s.length-1]=r[1]):n=at(r[0])||at(r[1])?at(r[0])?"max":"min":"all",{niceType:n,niceDomain:s,niceMinMax:r,domainValidator:l}}const Jv=(t,e,i)=>Math.abs(e-t)<1?+i.toFixed(1):Math.round(+i),Qv=$t(((t,e,i,o,n,r,s)=>{let l=t,a=e;const h=a<l;h&&([l,a]=[a,l]);let d,c,u=n(l),g=n(a),p=[];if(!(o%1)&&g-u<i){if(u=Math.floor(u),g=Math.ceil(g),l>0){for(;u<=g;++u)for(d=1;d<o;++d)if(c=u<0?d/r(-u):d*r(u),!(c<l)){if(c>a)break;p.push(c)}}else for(;u<=g;++u)for(d=o-1;d>=1;--d)if(c=u>0?d/r(-u):d*r(u),!(c<l)){if(c>a)break;p.push(c)}2*p.length<i&&(p=$v(l,a,i))}else p=$v(u,g,Math.min(g-u,i)).map(r);return p=p.filter((t=>0!==t)),(null==s?void 0:s.noDecimals)&&(p=Array.from(new Set(p.map((t=>Math.floor(t)))))),h?p.reverse():p})),ty=$t(((t,e,i,o,n,r)=>{const s=[],l={},a=n(t),h=n(e);let d=[];if(Number.isInteger(o))d=$v(a,h,i);else{const t=(h-a)/(i-1);for(let e=0;e<i;e++)d.push(a+e*t)}return d.forEach((i=>{const n=r(i),a=Number.isInteger(o)?Jv(t,e,n):Jv(t,e,kv(n)),h=Jv(t,e,((t,e)=>{let i,o;return e[0]<e[1]?(i=e[0],o=e[1]):(i=e[1],o=e[0]),Math.min(Math.max(t,i),o)})(a,[t,e]));!l[h]&&!isNaN(h)&&d.length>1&&(l[h]=1,s.push(h))})),s})),ey=$t(((t,e,i,o,n)=>Kv(o(t),o(e),i).map((t=>kv(n(t))))));class iy extends Ov{constructor(){super(...arguments),this.type=uv.Linear}clone(){return(new iy).domain(this._domain,!0).range(this._range,!0).unknown(this._unknown).clamp(this.clamp(),null,!0).interpolate(this._interpolate)}tickFormat(){return()=>{}}d3Ticks(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10,e=arguments.length>1?arguments[1]:void 0;const i=this.calculateVisibleDomain(this._range);return Vv(i[0],i[i.length-1],t,e)}ticks(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10,e=arguments.length>1?arguments[1]:void 0;var i;if(Q(this._rangeFactorStart)&&Q(this._rangeFactorEnd)&&(this._rangeFactorStart>0||this._rangeFactorEnd<1)&&2===this._range.length||!this._niceType)return this.d3Ticks(t,e);const o=null!==(i=this._niceDomain)&&void 0!==i?i:this._domain,n=this._domain,r=o[0],s=o[o.length-1];let l=$v(n[0],n[n.length-1],t,e);if(!l.length)return l;if(this._domainValidator)l=l.filter(this._domainValidator);else if((l[0]!==r||l[l.length-1]!==s)&&this._niceType){const t=o.slice();if("all"===this._niceType?(t[0]=l[0],t[t.length-1]=l[l.length-1],this._niceDomain=t,this.rescale()):"min"===this._niceType&&l[0]!==r?(t[0]=l[0],this._niceDomain=t,this.rescale()):"max"===this._niceType&&l[l.length-1]!==s&&(t[t.length-1]=l[l.length-1],this._niceDomain=t,this.rescale()),"all"!==this._niceType){const e=Math.min(t[0],t[t.length-1]),i=Math.max(t[0],t[t.length-1]);l=l.filter((t=>t>=e&&t<=i))}}return l}forceTicks(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10;const e=this.calculateVisibleDomain(this._range);return Kv(e[0],e[e.length-1],t)}stepTicks(t){const e=this.calculateVisibleDomain(this._range);return function(t,e,i){let o,n,r=-1;if(i=+i,(n=(e=+e)<(t=+t))&&(o=t,t=e,e=o),!isFinite(i)||e-t<=i)return[t];const s=Math.floor((e-t)/i+1),l=new Array(s);for(;++r<s;)l[r]=t+r*i;return n&&l.reverse(),l}(e[0],e[e.length-1],t)}nice(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10,e=arguments.length>1?arguments[1]:void 0;var i,o;const n=this._domain;let r=[];if(e){const t=Zv(n,e);if(r=t.niceMinMax,this._domainValidator=t.domainValidator,this._niceType=t.niceType,t.niceDomain)return this._niceDomain=t.niceDomain,this.rescale(),this}else this._niceType="all";if(this._niceType){const e=qv(n.slice(),t);"min"===this._niceType?e[e.length-1]=null!==(i=r[1])&&void 0!==i?i:e[e.length-1]:"max"===this._niceType&&(e[0]=null!==(o=r[0])&&void 0!==o?o:e[0]),this._niceDomain=e,this.rescale()}return this}niceMin(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10;this._niceType="min";const e=this._domain[this._domain.length-1],i=qv(this.domain(),t);return i&&(i[i.length-1]=e,this._niceDomain=i,this.rescale()),this}niceMax(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10;this._niceType="max";const e=this._domain[0],i=qv(this._domain.slice(),t);return i&&(i[0]=e,this._niceDomain=i,this.rescale()),this}}function oy(t){return e=>-t(-e)}function ny(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Number.EPSILON;return e=>Math.max(e,t)}class ry extends Ov{constructor(){super(wv(10),Cv(10)),this.type=uv.Log,this._limit=ny(),this._logs=this.transformer,this._pows=this.untransformer,this._domain=[1,10],this._base=10}clone(){return(new ry).domain(this._domain,!0).range(this._range,!0).unknown(this._unknown).clamp(this.clamp(),null,!0).interpolate(this._interpolate,!0).base(this._base)}rescale(t){var e;if(t)return this;super.rescale();const i=wv(this._base),o=Cv(this._base);return(null!==(e=this._niceDomain)&&void 0!==e?e:this._domain)[0]<0?(this._logs=oy(i),this._pows=oy(o),this._limit=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Number.EPSILON;return e=>Math.min(e,-t)}(),this.transformer=bv,this.untransformer=vv):(this._logs=i,this._pows=o,this._limit=ny(),this.transformer=this._logs,this.untransformer=o),this}scale(t){var e;if(t=Number(t),Number.isNaN(t)||this._domainValidator&&!this._domainValidator(t))return this._unknown;this._output||(this._output=this._piecewise((null!==(e=this._niceDomain)&&void 0!==e?e:this._domain).map(this._limit).map(this.transformer),this._calculateWholeRange(this._range),this._interpolate));const i=this._output(this.transformer(this._limit(this._clamp(t))));return this._fishEyeTransform?this._fishEyeTransform(i):i}base(t,e){return arguments.length?(this._base=t,this.rescale(e)):this._base}tickFormat(){return mv}d3Ticks(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10,e=arguments.length>1?arguments[1]:void 0;const i=this.domain(),o=this._limit(i[0]),n=this._limit(i[i.length-1]);return Qv(o,n,t,this._base,this.transformer,this.untransformer,e)}ticks(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10;const e=this.calculateVisibleDomain(this._range);return ty(this._limit(e[0]),this._limit(e[e.length-1]),t,this._base,this.transformer,this.untransformer)}forceTicks(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10;const e=this.calculateVisibleDomain(this._range);return ey(e[0],e[e.length-1],t,this.transformer,this.untransformer)}stepTicks(t){const e=this.calculateVisibleDomain(this._range);return ey(this._limit(e[0]),this._limit(e[e.length-1]),t,this.transformer,this.untransformer)}nice(){let t=arguments.length>1?arguments[1]:void 0;var e,i;const o=this._domain;let n=[],r=null;if(t){const e=Zv(o,t);if(n=e.niceMinMax,this._domainValidator=e.domainValidator,r=e.niceType,e.niceDomain)return this._niceDomain=e.niceDomain,this.rescale(),this}else r="all";if(r){const t=Tv(o.slice(),{floor:t=>this._pows(Math.floor(this._logs(this._limit(t)))),ceil:t=>Math.abs(t)>=1?Math.ceil(t):this._pows(Math.ceil(this._logs(this._limit(t))))});return"min"===r?t[t.length-1]=null!==(e=n[1])&&void 0!==e?e:t[t.length-1]:"max"===r&&(t[0]=null!==(i=n[0])&&void 0!==i?i:t[0]),this._niceDomain=t,this.rescale(),this}return this}niceMin(){const t=this._domain[this._domain.length-1];this.nice();const e=this._domain.slice();return this._domain&&(e[e.length-1]=t,this._niceDomain=e,this.rescale()),this}niceMax(){const t=this._domain[0];this.nice();const e=this._domain.slice();return this._domain&&(e[0]=t,this._niceDomain=e,this.rescale()),this}}class sy extends iy{constructor(){super(xv(1),_v(1)),this.type=uv.Symlog,this._const=1}clone(){return(new sy).domain(this._domain,!0).range(this._range,!0).unknown(this._unknown).clamp(this.clamp(),null,!0).interpolate(this._interpolate,!0).constant(this._const)}constant(t,e){return arguments.length?(this._const=t,this.transformer=xv(t),this.untransformer=_v(t),this.rescale(e)):this._const}d3Ticks(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10,e=arguments.length>1?arguments[1]:void 0;const i=this.domain(),o=i[0],n=i[i.length-1];return Qv(o,n,t,this._const,this.transformer,this.untransformer,e)}ticks(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10;const e=this.calculateVisibleDomain(this._range);return ty(e[0],e[e.length-1],t,this._const,this.transformer,this.untransformer)}forceTicks(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10;const e=this.calculateVisibleDomain(this._range);return ey(e[0],e[e.length-1],t,this.transformer,this.untransformer)}stepTicks(t){const e=this.calculateVisibleDomain(this._range);return ey(e[0],e[e.length-1],t,this.transformer,this.untransformer)}nice(){let t=arguments.length>1?arguments[1]:void 0;var e,i;const o=this._domain;let n=[],r=null;if(t){const e=Zv(o,t);if(n=e.niceMinMax,this._domainValidator=e.domainValidator,r=e.niceType,e.niceDomain)return this._niceDomain=e.niceDomain,this.rescale(),this}else r="all";if(r){const t=Tv(o.slice(),{floor:t=>Math.floor(t),ceil:t=>Math.ceil(t)});return"min"===r?t[t.length-1]=null!==(e=n[1])&&void 0!==e?e:t[t.length-1]:"max"===r&&(t[0]=null!==(i=n[0])&&void 0!==i?i:t[0]),this._niceDomain=t,this.rescale(),this}return this}niceMin(){const t=this._domain[this._domain.length-1];this.nice();const e=this._domain.slice();return this._domain&&(e[e.length-1]=t,this._niceDomain=e,this.rescale()),this}niceMax(){const t=this._domain[0];this.nice();const e=this._domain.slice();return this._domain&&(e[0]=t,this._niceDomain=e,this.rescale()),this}}const ly=t=>t.map(((t,e)=>({index:e,value:t}))),ay=function(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;const o=new Ce(t).expand(i/2),n=new Ce(e).expand(i/2);return o.intersects(n)};function hy(t,e,i){return i>Math.max(e.x1-t.x2,t.x1-e.x2,e.y1-t.y2,t.y1-e.y2)}function dy(t,e){for(let i,o=1,n=t.length,r=t[0];o<n;r=i,++o)if(i=t[o],hy(r.AABBBounds,i.AABBBounds,e))return!0;return!1}const cy=(t,e,i,o)=>i<t?Math.max(t-e/2,i):i>t?Math.min(t-e/2,i-e):i<o?i:i-e,uy=(t,e,i)=>{var o;const{labelStyle:n,axisOrientType:r,labelFlush:s,labelFormatter:l,startAngle:a=0}=i;let h=null!==(o=n.angle)&&void 0!==o?o:0;"vertical"===n.direction&&(h+=we(90));const d=["bottom","top"].includes(r),c=["left","right"].includes(r);let u=1,g=0;d||(c?(u=0,g=1):a&&(u=Math.cos(a),g=-Math.sin(a)));const p=Ab(n),f=t.range(),m=e.map(((i,o)=>{var r,a;const m=l?l(i):`${i}`,{width:b,height:v}=p.quickMeasure(m),y=Math.max(b,12),C=Math.max(v,12),w=t.scale(i),x=u*w,_=g*w;let S,A,B=x,R=_;s&&d&&0===o?B=cy(x,y,f[0],f[f.length-1]):s&&d&&o===e.length-1?B=cy(x,y,f[f.length-1],f[0]):S=null!==(r=n.textAlign)&&void 0!==r?r:"center","right"===S?B-=y:"center"===S&&(B-=y/2),s&&c&&0===o?R=cy(_,C,f[0],f[f.length-1]):s&&c&&o===e.length-1?R=cy(_,C,f[f.length-1],f[0]):A=null!==(a=n.textBaseline)&&void 0!==a?a:"middle","bottom"===A?R-=C:"middle"===A&&(R-=C/2);const M=(new Ce).set(B,R,B+y,R+C);return h&&M.rotate(h,x,_),M}));return m},gy={parity:function(t){return t.filter(((t,e)=>e%2==0))},greedy:function(t,e){let i;return t.filter(((t,o)=>!(o&&hy(i.AABBBounds,t.AABBBounds,e)||(i=t,0))))}},py=(t,e,i,o)=>uy(t,e,i).map((t=>o?[t.x1,t.x2,t.width()]:[t.y1,t.y2,t.height()])),fy=function(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return Math.max(t[0],e[0])-i/2<=Math.min(t[1],e[1])+i/2},my=(t,e)=>t[1]<e[0]?e[0]-t[1]:e[1]<t[0]?t[0]-e[1]:0,by=(t,e,i,o,n,r)=>{let s=0,l=0,a=-1,h=Number.MAX_VALUE;const d=o=>{let n=!0,r=0;do{r+o<t.length&&fy(e[r],e[r+o],i)&&(n=!1),r+=o}while(n&&r<t.length);return n},c=((t,e,i)=>{let o=t,n=e;for(;o<n;){const t=Math.floor((o+n)/2);i(t)>=0?n=t:o=t+1}return o})(n,t.length,(t=>d(t)?1:-1));let u=c;do{if(u>c&&!r&&!d(u))u++;else{if(!o){l=u;break}{const o=t.length-1;let n,r=0;n=t.length%u>0?t.length-t.length%u+u:t.length;do{if(n-=u,n!==o&&!fy(e[n],e[o],i))break;r++}while(n>0);if(n===o){l=u,s=r;break}{const i=Math.floor(t.length/u)-r+1;if(i<a)break;{a=i;const t=my(e[n],e[o]),d=n-u>=0?my(e[n-u],e[n]):t,c=Math.abs(t-d);if(c<h&&(h=c,l=u,s=r),t<=d)break}}}u++}}while(u<=t.length);return{step:l,delCount:s}},vy=(t,e)=>{const{tickCount:i,forceTickCount:o,tickStep:n,getRadius:r,labelOffset:s,labelGap:l=0,labelStyle:a}=e,h=null==r?void 0:r();if(!h)return ly(t.domain());let d;if(Q(n))d=t.stepTicks(n);else if(Q(o))d=t.forceTicks(o);else if(Q(i)){const e=t.range(),o=Math.abs(e[e.length-1]-e[0]),n=Z(i)?i({axisLength:o,labelStyle:a}):i;d=t.ticks(n)}else if(e.sampling){const i=t.domain(),o=t.range(),n=((t,e,i)=>{var o;const{labelStyle:n,getRadius:r,labelOffset:s,labelFormatter:l,inside:a}=i,h=null==r?void 0:r(),d=null!==(o=n.angle)&&void 0!==o?o:0,c=Ab(n),u=e.map((e=>{var i,o;const r=l?l(e):`${e}`,{width:u,height:g}=c.quickMeasure(r),p=Math.max(u,12),f=Math.max(g,12),m=t.scale(e);let b=0,v=0;const y=null!==(i=n.textAlign)&&void 0!==i?i:"center",C=null!==(o=n.textBaseline)&&void 0!==o?o:"middle",{x:w,y:x}=Qb(m,{x:0,y:0},h,s,a,r,n);return b=w+("right"===y?-p:"center"===y?-p/2:0),v=x+("bottom"===C?-f:"middle"===C?-f/2:0),(new Ce).set(b,v,b+p,v+f).rotate(d,b+p/2,v+f/2)}));return u})(t,i,e),r=Et(o),a=Pt(o),c=Math.abs(a-r)*(h+s)/i.length,{step:u,delCount:g}=yy(i,n,l,Math.floor(n.reduce(((t,e)=>Math.min(t,e.width(),e.height())),Number.MAX_VALUE)/c));d=t.stepTicks(u),d=d.slice(0,d.length-g)}else d=t.domain();return ly(d)},yy=(t,e,i,o)=>{let n=o;do{let o=!0;n++;let r=0;do{r+n<t.length&&ay(e[r],e[r+n],i)&&(o=!1),r+=n}while(o&&r<t.length);if(o)break}while(n<=t.length);let r=0;if(t.length>2){let i=t.length-t.length%n;for(i>=t.length&&(i-=n);i>0&&ay(e[0],e[i]);)r++,i-=n}return{step:n,delCount:r}},Cy=(t,e)=>{if(fv(t.type))return((t,e)=>{if(!fv(t.type))return ly(t.domain());const i=t.range(),o=Math.abs(i[i.length-1]-i[0]);if(o<2)return ly([t.domain()[0]]);const{tickCount:n,forceTickCount:r,tickStep:s,noDecimals:l=!1,labelStyle:a}=e;let h;if(Q(s))h=t.stepTicks(s);else if(Q(r))h=t.forceTicks(r);else if("d3"===e.tickMode){const e=Z(n)?n({axisLength:o,labelStyle:a}):n;h=t.d3Ticks(null!=e?e:5,{noDecimals:l})}else{const e=Z(n)?n({axisLength:o,labelStyle:a}):n;h=t.ticks(null!=e?e:5,{noDecimals:l})}if(e.sampling&&("cartesian"===e.coordinateType||"polar"===e.coordinateType&&"radius"===e.axisOrientType)){const{labelGap:i=4,labelFlush:o}=e;let n=uy(t,h,e).map(((t,e)=>({AABBBounds:t,value:h[e]})));for(;n.length>=3&&dy(n,i);)n=gy.parity(n);const r=n.map((t=>t.value));r.length<3&&o&&(r.length>1&&r.pop(),kt(r)!==kt(h)&&r.push(kt(h))),h=r}return ly(h)})(t,e);if(function(t){switch(t){case uv.Ordinal:case uv.Point:case uv.Band:return!0;default:return!1}}(t.type)){if("cartesian"===e.coordinateType)return((t,e)=>{var i;const o=t.domain();if(!o.length)return[];const{tickCount:n,forceTickCount:r,tickStep:s,labelGap:l=4,axisOrientType:a,labelStyle:h}=e,d=(t=>["bottom","top","z"].includes(t))(a),c=t.range(),u=t.calculateWholeRangeSize();if(u<2)return e.labelLastVisible?ly([o[o.length-1]]):ly([o[0]]);let g;if(Q(s))g=t.stepTicks(s);else if(Q(r))g=t.forceTicks(r);else if(Q(n)){const e=Z(n)?n({axisLength:u,labelStyle:h}):n;g=t.ticks(e)}else if(e.sampling){const n=(null!==(i=e.labelStyle.fontSize)&&void 0!==i?i:12)+2,r=Et(c),s=Pt(c);if(o.length<=u/n){const i=(s-r)/o.length,n=py(t,o,e,d),a=Math.min(...n.map((t=>t[2]))),h=by(o,n,l,e.labelLastVisible,Math.floor(a/i),!1);g=t.stepTicks(h.step),e.labelLastVisible&&(h.delCount&&(g=g.slice(0,g.length-h.delCount)),g.push(o[o.length-1]))}else{const i=[o[0],o[Math.floor(o.length/2)],o[o.length-1]],n=py(t,i,e,d);let a=null;n.forEach((t=>{a?a[2]<t[2]&&(a=t):a=t}));const h=s-r-l>0?Math.ceil(o.length*(l+a[2])/(s-r-l)):o.length-1;g=t.stepTicks(h),!e.labelLastVisible||g.length&&g[g.length-1]===o[o.length-1]||(g.length&&Math.abs(t.scale(g[g.length-1])-t.scale(o[o.length-1]))<a[2]&&(g=g.slice(0,-1)),g.push(o[o.length-1]))}}else g=t.domain();return ly(g)})(t,e);if("polar"===e.coordinateType&&"angle"===e.axisOrientType)return vy(t,e)}return ly(t.domain())};function wy(){qm(),db(),ub()}const xy={space:8,style:{fill:"rgb(47, 69, 84)",cursor:"pointer",size:15},state:{disable:{fill:"rgb(170, 170, 170)",cursor:"not-allowed"},hover:{}}};wy();class _y extends vg{getCurrent(){return this._current}constructor(t,e){super((null==e?void 0:e.skipDefault)?t:St({},_y.defaultAttributes,t)),this.name="pager",this._current=1,this._onHover=t=>{const e=t.target;e.hasState("disable")||e.addState("hover")},this._onUnHover=t=>{t.target.removeState("hover")},this._onClick=t=>{const e=t.target;if("preHandler"===e.name){if(1===this._current)return;this._current-=1,1===this._current?e.addState("disable"):e.removeState("disable"),this._dispatchEvent("toPrev",{current:this._current,total:this._total,direction:"pre",event:t})}if("nextHandler"===e.name){if(this._current===this._total)return;this._current+=1,this._current===this._total?e.addState("disable"):e.removeState("disable"),this._dispatchEvent("toNext",{current:this._current,total:this._total,direction:"next",event:t})}this._current>1&&this.preHandler.removeState("disable"),this._current<this._total&&this.nextHandler.removeState("disable"),this.text.setAttribute("text",this._getPageText(this._current))}}render(){var t,e,i;this._reset();const{layout:o="horizontal",handler:n=xy,total:r,defaultCurrent:s=1,textStyle:l,padding:a=0}=this.attribute;this._current=s;const h=ei(a),d="horizontal"===o,c=Za.group({x:0,y:0}),u=n.style||{},g=u.size||15,p=null!==(t=n.space)&&void 0!==t?t:8,f=n.state||{};let{preShape:m,nextShape:b}=n;m||(m=d?"triangleLeft":"triangleUp"),b||(b=d?"triangleRight":"triangleDown");const v=Za.symbol(Object.assign(Object.assign({strokeBoundsBuffer:0,pickMode:"imprecise"},u),{x:0,y:0,symbolType:m,size:g}));v.states=f,v.name="preHandler",this.preHandler=v,c.add(v);const{width:y,height:C}=Bb(this._getPageText(r),Object.assign({textAlign:"center",textBaseline:"middle"},l),null===(i=null===(e=this.stage)||void 0===e?void 0:e.getTheme())||void 0===i?void 0:i.text),w=at(g)?g:g[0],x=at(g)?g:g[1],_=Za.text(Object.assign({x:d?w/2+p+y/2:0,y:d?0:x/2+p+C/2,text:this._getPageText(s),textAlign:"center",textBaseline:"middle",lineHeight:null==l?void 0:l.fontSize},l));this.text=_,c.add(_);const S=Za.symbol(Object.assign(Object.assign({strokeBoundsBuffer:0,pickMode:"imprecise"},u),{x:d?w+2*p+y:0,y:d?0:x+2*p+C,symbolType:b,size:g}));S.name="nextHandler",S.states=f,this.nextHandler=S,c.add(S),1===this._total?(v.addState("disable"),S.addState("disable")):1===this._current?v.addState("disable"):this._current===r&&S.addState("disable");const A=c.AABBBounds,B=A.width(),R=A.height();c.translateTo(0-A.x1+h[3],0-A.y1+h[0]),this.add(c),this.attribute.width=B+h[1]+h[3],this.attribute.height=R+h[0]+h[2],this._bindEvents()}_bindEvents(){this.attribute.disableTriggerEvent||(this.preHandler&&(this.preHandler.addEventListener("pointerenter",this._onHover),this.preHandler.addEventListener("pointerleave",this._onUnHover),this.preHandler.addEventListener("pointerdown",this._onClick)),this.nextHandler&&(this.nextHandler.addEventListener("pointerenter",this._onHover),this.nextHandler.addEventListener("pointerleave",this._onUnHover),this.nextHandler.addEventListener("pointerdown",this._onClick)))}_reset(){this.removeAllChild(!0),this._current=1,this._total=this.attribute.total,this.preHandler=this.nextHandler=this.text=null}_getPageText(t){const{pageFormatter:e}=this.attribute;return e?Z(e)?e(t,this._total):`${e}`.replace("{current}",`${t}`).replace("{total}",`${this._total}`):`${t}/${this._total}`}setTotal(t){t!==this.attribute.total&&(this._total=t,1!==this._current&&this._current<=t?this.setAttributes({total:t,defaultCurrent:this._current}):this.setAttribute("total",t))}}_y.defaultAttributes={handler:xy,textStyle:{fill:"rgb(51, 51, 51)",fontSize:12}};const Sy=16,Ay=8,By=12;var Ry,My,Ty;!function(t){t.selected="selected",t.unSelected="unSelected",t.selectedHover="selectedHover",t.unSelectedHover="unSelectedHover",t.focus="focus"}(Ry||(Ry={})),function(t){t.legendItemHover="legendItemHover",t.legendItemUnHover="legendItemUnHover",t.legendItemClick="legendItemClick",t.legendItemAttributeUpdate="legendItemAttributeUpdate"}(My||(My={})),function(t){t.innerView="innerView",t.title="legendTitle",t.item="legendItem",t.itemShape="legendItemShape",t.itemLabel="legendItemLabel",t.itemValue="legendItemValue",t.focus="legendItemFocus"}(Ty||(Ty={}));class ky extends vg{constructor(){super(...arguments),this.name="legend",this._title=null}render(){this.removeAllChild(!0);const{interactive:t=!0,title:e,padding:i=0}=this.attribute,o=ei(i),n=Za.group({x:o[3],y:o[0],pickable:t,childrenPickable:t});n.name=Ty.innerView,this.add(n),this._innerView=n,(null==e?void 0:e.visible)&&this._renderTitle(e),this._renderContent(),this._adjustLayout(),t&&this._bindEvents();const r=this._innerView.AABBBounds;this.attribute.width=r.width()+o[1]+o[3],this.attribute.height=r.height()+o[0]+o[2]}_renderTitle(t){const{text:e="",textStyle:i,padding:o=0,background:n,minWidth:r,maxWidth:s,shape:l}=t,a={x:0,y:0,text:e,textStyle:i,padding:ei(o),minWidth:r,maxWidth:s};l&&l.visible&&(a.shape=Object.assign({visible:!0},l.style),Q(l.space)&&(a.space=l.space)),n&&n.visible&&(a.panel=Object.assign({visible:!0},n.style));const h=new Eb(a);h.name=Ty.title,this._title=h,this._innerView.add(h)}_adjustLayout(){var t;if(this._title){const e=this._innerView.AABBBounds.width(),i=this._title.AABBBounds.width(),o=null===(t=this.attribute.title)||void 0===t?void 0:t.align;"center"===o?this._title.setAttribute("x",(e-i)/2):"end"===o&&this._title.setAttribute("x",e-i)}}}function Py(){qm(),ub(),sb(),db()}function Ey(){qm(),kb()}var Ly=function(t,e){var i={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(i[o]=t[o]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(o=Object.getOwnPropertySymbols(t);n<o.length;n++)e.indexOf(o[n])<0&&Object.prototype.propertyIsEnumerable.call(t,o[n])&&(i[o[n]]=t[o[n]])}return i};const Hy={[Ry.focus]:{},[Ry.selected]:{},[Ry.selectedHover]:{},[Ry.unSelected]:{},[Ry.unSelectedHover]:{}};Ey(),wy(),fb();class zy extends ky{constructor(t,e){super((null==e?void 0:e.skipDefault)?t:St({},zy.defaultAttributes,t)),this.name="discreteLegend",this._itemsContainer=null,this._itemHeightByUser=void 0,this._itemHeight=0,this._itemMaxWidth=0,this._onHover=t=>{const e=t.target;if(e&&e.name&&e.name.startsWith(Ty.item)){const i=e.delegate;if(this._lastActiveItem){if(this._lastActiveItem.id===i.id)return;this._unHover(this._lastActiveItem,t)}this._hover(i,t)}else this._lastActiveItem&&(this._unHover(this._lastActiveItem,t),this._lastActiveItem=null)},this._onUnHover=t=>{this._lastActiveItem&&(this._unHover(this._lastActiveItem,t),this._lastActiveItem=null)},this._onClick=t=>{var e,i,o,n;const r=t.target;if(r&&r.name&&r.name.startsWith(Ty.item)){const s=r.delegate,{selectMode:l="multiple"}=this.attribute;if(r.name===Ty.focus||"focus"===l){const o=s.hasState(Ry.focus);s.toggleState(Ry.focus),o?null===(e=this._itemsContainer)||void 0===e||e.getChildren().forEach((e=>{this._removeLegendItemState(e,[Ry.unSelected,Ry.unSelectedHover,Ry.focus],t),this._setLegendItemState(e,Ry.selected,t)})):(this._setLegendItemState(s,Ry.selected,t),this._removeLegendItemState(s,[Ry.unSelected,Ry.unSelectedHover],t),null===(i=this._itemsContainer)||void 0===i||i.getChildren().forEach((e=>{s!==e&&(this._removeLegendItemState(e,[Ry.selected,Ry.selectedHover,Ry.focus],t),this._setLegendItemState(e,Ry.unSelected,t))})))}else{null===(o=this._itemsContainer)||void 0===o||o.getChildren().forEach((t=>{t.removeState(Ry.focus)}));const{allowAllCanceled:e=!0}=this.attribute,i=s.hasState(Ry.selected),r=this._getSelectedLegends();if("multiple"===l){if(!1===e&&i&&1===r.length)return void this._dispatchLegendEvent(My.legendItemClick,s,t);i?(this._removeLegendItemState(s,[Ry.selected,Ry.selectedHover],t),this._setLegendItemState(s,Ry.unSelected,t)):(this._setLegendItemState(s,Ry.selected,t),this._removeLegendItemState(s,[Ry.unSelected,Ry.unSelectedHover],t))}else this._setLegendItemState(s,Ry.selected,t),this._removeLegendItemState(s,[Ry.unSelected,Ry.unSelectedHover],t),null===(n=this._itemsContainer)||void 0===n||n.getChildren().forEach((e=>{s!==e&&(this._removeLegendItemState(e,[Ry.selected,Ry.selectedHover],t),this._setLegendItemState(e,Ry.unSelected,t))}))}this._dispatchLegendEvent(My.legendItemClick,s,t)}}}render(){super.render(),this._lastActiveItem=null}setSelected(t){var e;(null===(e=this._itemsContainer)||void 0===e?void 0:e.getChildren()).forEach((e=>{const i=e.data;t.includes(i.label)?(this._setLegendItemState(e,Ry.selected),this._removeLegendItemState(e,[Ry.unSelected,Ry.unSelectedHover])):(this._removeLegendItemState(e,[Ry.selected,Ry.selectedHover]),this._setLegendItemState(e,Ry.unSelected))}))}_renderItems(){const{item:t={},maxCol:e=1,maxRow:i=2,maxWidth:o,maxHeight:n,defaultSelected:r,lazyload:s,autoPage:l}=this.attribute,{spaceCol:a=Sy,spaceRow:h=Ay}=t,d=this._itemsContainer,{items:c,isHorizontal:u,startIndex:g,isScrollbar:p}=this._itemContext,f=p?1:u?i:e;let m,{doWrap:b,maxWidthInCol:v,startX:y,startY:C,pages:w}=this._itemContext;for(let t=g,e=c.length;t<e&&!(s&&w>this._itemContext.currentPage*f);t++){s&&(this._itemContext.startIndex=t+1),m=c[t],m.id||(m.id=m.label),m.index=t;let e=!0;rt(r)&&(e=r.includes(m.label));const i=this._renderEachItem(m,e,t,c),g=i.attribute.width,f=i.attribute.height;this._itemHeight=Math.max(this._itemHeight,f),v=Math.max(g,v),this._itemMaxWidth=Math.max(g,this._itemMaxWidth),u?(Q(o)&&(p&&l?(w=Math.ceil((y+g)/o),b=w>1):y+g>o&&(b=!0,y>0&&(w+=1,y=0,C+=f+h))),0===y&&0===C||i.setAttributes({x:y,y:C}),y+=a+g):(Q(n)&&(p&&l?(w=Math.ceil((C+f)/n),b=w>1):n<C+f&&(w+=1,b=!0,C=0,y+=v+a,v=0)),0===y&&0===C||i.setAttributes({x:y,y:C}),C+=h+f),d.add(i)}return this._itemContext.doWrap=b,this._itemContext.startX=y,this._itemContext.startY=C,this._itemContext.maxWidthInCol=v,this._itemContext.pages=w,this._itemContext.maxPages=f,p&&(this._itemContext.totalPage=w),s||(this._itemContext.startIndex=c.length),this._itemContext}_renderContent(){const{item:t={},items:e,reversed:i,maxWidth:o}=this.attribute;if(!1===t.visible||mt(e))return;let n=e;i&&(n=null==e?void 0:e.reverse());const r=Za.group({x:0,y:0});this._itemsContainer=r;const{layout:s,autoPage:l}=this.attribute,a="horizontal"===s,{maxWidth:h,width:d,height:c}=t,u=[];Q(h)&&u.push(h),Q(d)&&u.push(d),u.length&&(Q(o)&&u.push(o),this._itemWidthByUser=Et(u)),Q(c)&&(this._itemHeightByUser=c);const g=this.attribute.pager;this._itemContext={currentPage:g&&g.defaultCurrent||1,doWrap:!1,maxWidthInCol:0,maxPages:1,pages:1,startX:0,startY:0,startIndex:0,items:n,isHorizontal:a,totalPage:1/0,isScrollbar:g&&"scrollbar"===g.type},this._itemContext=this._renderItems();let p=!1;this._itemContext.doWrap&&l&&this._itemContext.pages>this._itemContext.maxPages&&(p=this._renderPagerComponent()),p||(r.setAttribute("y",this._title?this._title.AABBBounds.height()+bt(this.attribute,"title.space",8):0),this._innerView.add(r))}_bindEvents(){if(this.attribute.disableTriggerEvent)return;if(!this._itemsContainer)return;const{hover:t=!0,select:e=!0}=this.attribute;t&&(this._itemsContainer.addEventListener("pointermove",this._onHover),this._itemsContainer.addEventListener("pointerleave",this._onUnHover)),e&&this._itemsContainer.addEventListener("pointerdown",this._onClick)}_autoEllipsis(t,e,i,o){var n,r;const{label:s,value:l}=this.attribute.item,a=o.AABBBounds,h=i.AABBBounds,d=a.width(),c=h.width();let u=!1;"labelFirst"===t?c>e?u=!0:o.setAttribute("maxLineWidth",e-c):"valueFirst"===t?d>e?u=!0:i.setAttribute("maxLineWidth",e-d):d+c>e&&(u=!0),u&&(o.setAttribute("maxLineWidth",Math.max(e*(null!==(n=s.widthRatio)&&void 0!==n?n:.5),e-c)),i.setAttribute("maxLineWidth",Math.max(e*(null!==(r=l.widthRatio)&&void 0!==r?r:.5),e-d)))}_renderEachItem(t,e,i,o){var n,r;const{id:s,label:l,value:a,shape:h}=t,{padding:d=0,focus:c,focusIconStyle:u,align:g,autoEllipsisStrategy:p}=this.attribute.item,{shape:f,label:m,value:b,background:v}=this.attribute.item,y=this._handleStyle(f,t,e,i,o),C=this._handleStyle(m,t,e,i,o),w=this._handleStyle(b,t,e,i,o),x=this._handleStyle(v,t,e,i,o),_=ei(d);let S;!1===v.visible?(S=Za.group({x:0,y:0,cursor:null===(n=x.style)||void 0===n?void 0:n.cursor}),this._appendDataToShape(S,Ty.item,t,S)):(S=Za.group(Object.assign({x:0,y:0},x.style)),this._appendDataToShape(S,Ty.item,t,S,x.state)),S.id=`${null!=s?s:l}-${i}`,S.addState(e?Ry.selected:Ry.unSelected);const A=Za.group({x:0,y:0,pickable:!1});S.add(A);let B,R=0,M=0,T=0;if(f&&!1!==f.visible){const i=bt(y,"style.size",10);M=rt(i)?i[0]||0:i,T=bt(f,"space",8);const o=Za.symbol(Object.assign(Object.assign({x:0,y:0,symbolType:"circle",strokeBoundsBuffer:0},h),y.style));Object.keys(y.state||{}).forEach((t=>{const e=y.state[t].fill||y.state[t].stroke;h.fill&&J(y.state[t].fill)&&e&&(y.state[t].fill=e),h.stroke&&J(y.state[t].stroke)&&e&&(y.state[t].stroke=e)})),this._appendDataToShape(o,Ty.itemShape,t,S,y.state),o.addState(e?Ry.selected:Ry.unSelected),A.add(o)}let k=0;if(c){const e=bt(u,"size",10);B=Za.symbol(Object.assign(Object.assign({x:0,y:-e/2-1,strokeBoundsBuffer:0},u),{visible:!0,pickMode:"imprecise",boundsPadding:_})),this._appendDataToShape(B,Ty.focus,t,S),k=e}const P=m.formatMethod?m.formatMethod(l,t,i):l,E=Tb(Object.assign(Object.assign({x:M/2+T,y:0,textAlign:"start",textBaseline:"middle",lineHeight:null===(r=C.style)||void 0===r?void 0:r.fontSize},C.style),{text:P,_originText:m.formatMethod?l:void 0}));this._appendDataToShape(E,Ty.itemLabel,t,S,C.state),E.addState(e?Ry.selected:Ry.unSelected),A.add(E);const L=bt(m,"space",8);if(Q(a)){const o=bt(b,"space",c?8:0),n=b.formatMethod?b.formatMethod(a,t,i):a,r=Tb(Object.assign(Object.assign({x:0,y:0,textAlign:"start",textBaseline:"middle",lineHeight:w.style.fontSize},w.style),{text:n,_originText:b.formatMethod?a:void 0}));if(this._appendDataToShape(r,Ty.itemValue,t,S,w.state),r.addState(e?Ry.selected:Ry.unSelected),this._itemWidthByUser){const t=this._itemWidthByUser-_[1]-_[3]-M-T-L-k-o;this._autoEllipsis(p,t,E,r),b.alignRight?r.setAttributes({textAlign:"right",x:this._itemWidthByUser-M/2-_[1]-_[3]-k-o}):r.setAttribute("x",o+(E.AABBBounds.empty()?0:E.AABBBounds.x2))}else r.setAttribute("x",o+(E.AABBBounds.empty()?0:E.AABBBounds.x2));R=o+(r.AABBBounds.empty()?0:r.AABBBounds.x2),A.add(r)}else this._itemWidthByUser?(E.setAttribute("maxLineWidth",this._itemWidthByUser-_[1]-_[3]-M-T-k),R=L+(E.AABBBounds.empty()?0:E.AABBBounds.x2)):R=L+(E.AABBBounds.empty()?0:E.AABBBounds.x2);B&&(B.setAttribute("x",R),A.add(B));const H=A.AABBBounds,z=H.width();if("right"===g){const t=H.x2,e=H.x1;A.forEachChildren(((i,o)=>{"symbol"!==i.type&&"right"!==i.attribute.textAlign||i===B?i.setAttribute("x",e+t-i.attribute.x-i.AABBBounds.width()):"symbol"!==i.type?i.setAttributes({x:e+t-i.attribute.x,textAlign:"left"}):i.setAttribute("x",e+t-i.attribute.x)}))}const F=H.height(),I=Q(this.attribute.item.width)?this.attribute.item.width:z+_[1]+_[3],O=this._itemHeightByUser||F+_[0]+_[2];return S.attribute.width=I,S.attribute.height=O,B&&B.setAttribute("visible",!1),A.translateTo(-H.x1+_[3],-H.y1+_[0]),S}_createPager(t){var e,i;const{disableTriggerEvent:o,maxRow:n}=this.attribute;return this._itemContext.isHorizontal?new _y(Object.assign(Object.assign({layout:1===n?"horizontal":"vertical",total:99},St({handler:{preShape:"triangleUp",nextShape:"triangleDown"}},t)),{defaultCurrent:null===(e=this.attribute.pager)||void 0===e?void 0:e.defaultCurrent,disableTriggerEvent:o})):new _y(Object.assign({layout:"horizontal",total:99,disableTriggerEvent:o,defaultCurrent:null===(i=this.attribute.pager)||void 0===i?void 0:i.defaultCurrent},t))}_createScrollbar(t,e){const{disableTriggerEvent:i}=this.attribute;return this._itemContext.isHorizontal?new wb(Object.assign(Object.assign({direction:"horizontal",disableTriggerEvent:i,range:[0,.5],height:12},t),{width:e})):new wb(Object.assign(Object.assign({direction:"vertical",width:12,range:[0,.5]},t),{height:e,disableTriggerEvent:i}))}_updatePositionOfPager(t,e,i,o,n){const{maxHeight:r,pager:s}=this.attribute,{totalPage:l,isHorizontal:a}=this._itemContext,h=s&&s.position||"middle";if(this._pagerComponent.setTotal(l),a){let e;e="start"===h?i:"end"===h?i+n-this._pagerComponent.AABBBounds.height()/2:i+n/2-this._pagerComponent.AABBBounds.height()/2,this._pagerComponent.setAttributes({x:t,y:e})}else{let t;t="start"===h?0:"end"===h?o-this._pagerComponent.AABBBounds.width():(o-this._pagerComponent.AABBBounds.width())/2,this._pagerComponent.setAttributes({x:t,y:r-this._pagerComponent.AABBBounds.height()})}}_updatePositionOfScrollbar(t,e,i){const{currentPage:o,totalPage:n,isHorizontal:r}=this._itemContext;this._pagerComponent.setScrollRange([(o-1)/n,o/n]),r?this._pagerComponent.setAttributes({x:0,y:i+e}):this._pagerComponent.setAttributes({x:t,y:i})}_bindEventsOfPager(t,e){const i=this.attribute.pager||{},{animation:o=!0,animationDuration:n=450,animationEasing:r="quadIn"}=i,s=this._itemContext.isScrollbar?t=>{const{value:e}=t.detail;let o=e[0]*this._itemContext.totalPage;return i.scrollByPosition?o+=1:o=Math.floor(o)+1,o}:t=>t.detail.current,l=i=>{const l=s(i);if(l!==this._itemContext.currentPage){if(this._itemContext.currentPage=l,this._itemContext&&this._itemContext.startIndex<this._itemContext.items.length){this._renderItems();const t=Math.ceil(this._itemContext.pages/this._itemContext.maxPages);this._itemContext.totalPage=t,this._pagerComponent.setScrollRange([(l-1)/t,l/t])}o?this._itemsContainer.animate().to({[e]:-(l-1)*t},n,r):this._itemsContainer.setAttribute(e,-(l-1)*t)}};this._itemContext.isScrollbar?(this._pagerComponent.addEventListener("scrollDrag",l),this._pagerComponent.addEventListener("scrollUp",l)):(this._pagerComponent.addEventListener("toPrev",l),this._pagerComponent.addEventListener("toNext",l))}_renderPager(){const t=this._title?this._title.AABBBounds.height()+bt(this.attribute,"title.space",8):0,{maxWidth:e,maxHeight:i,maxCol:o=1,maxRow:n=2,item:r={},pager:s={}}=this.attribute,{spaceCol:l=Sy,spaceRow:a=Ay}=r,h=this._itemsContainer,{space:d=By,defaultCurrent:c=1}=s,u=Ly(s,["space","defaultCurrent"]),{isHorizontal:g}=this._itemContext;let p,f=0,m=0,b=0,v=0,y=0,C=0,w=1;if(g){if(m=(n-1)*a+this._itemHeight*n,f=e,p=this._createPager(u),this._pagerComponent=p,this._innerView.add(p),b=e-p.AABBBounds.width()-d,b<=0)return this._innerView.removeChild(p),!1;h.getChildren().forEach(((t,e)=>{const{width:i,height:o}=t.attribute;b<y+i&&(y=0,C+=o+a,w+=1),e>0&&t.setAttributes({x:y,y:C}),y+=l+i})),this._itemContext.startX=y,this._itemContext.startY=C,this._itemContext.pages=w;const i=Math.ceil(w/n);this._itemContext.totalPage=i,this._updatePositionOfPager(b,v,t,f,m)}else{if(f=this._itemMaxWidth*o+(o-1)*l,m=i,b=f,p=this._createPager(u),this._pagerComponent=p,this._innerView.add(p),v=i-p.AABBBounds.height()-d-t,v<=0)return this._innerView.removeChild(p),!1;h.getChildren().forEach(((t,e)=>{const{height:i}=t.attribute;v<C+i&&(C=0,y+=this._itemMaxWidth+l,w+=1),e>0&&t.setAttributes({x:y,y:C}),C+=a+i}));const e=Math.ceil(w/o);this._itemContext.totalPage=e,this._updatePositionOfPager(b,v,t,f,m)}c>1&&(g?h.setAttribute("y",-(c-1)*(m+a)):h.setAttribute("x",-(c-1)*(f+l)));const x=Za.group({x:0,y:t,width:g?b:f,height:g?m:v,clip:!0,pickable:!1});return x.add(h),this._innerView.add(x),this._bindEventsOfPager(g?m+a:f+l,g?"y":"x"),!0}_renderScrollbar(){const t=this._title?this._title.AABBBounds.height()+bt(this.attribute,"title.space",8):0,{maxWidth:e,maxHeight:i,item:o={},pager:n={}}=this.attribute,{spaceCol:r=Sy,spaceRow:s=Ay}=o,l=this._itemsContainer,{space:a=By,defaultCurrent:h=1}=n,d=Ly(n,["space","defaultCurrent"]),{isHorizontal:c}=this._itemContext;let u,g=0,p=0,f=0,m=0,b=1;if(c)g=e,p=e,f=this._itemHeight,u=this._createScrollbar(d,g),this._pagerComponent=u,this._innerView.add(u),this._updatePositionOfScrollbar(p,f,t);else{if(g=i,u=this._createScrollbar(d,g),this._pagerComponent=u,this._innerView.add(u),f=i-t,p=this._itemMaxWidth,f<=0)return this._innerView.removeChild(u),!1;l.getChildren().forEach(((t,e)=>{const{height:i}=t.attribute;b=Math.floor((m+i)/f)+1,m+=s+i})),this._itemContext.totalPage=b,this._itemContext.pages=b,this._updatePositionOfScrollbar(p,f,t)}h>1&&(c?l.setAttribute("x",-(h-1)*(p+r)):l.setAttribute("y",-(h-1)*(f+s)));const v=Za.group({x:0,y:t,width:p,height:f,clip:!0,pickable:!1});return v.add(l),this._innerView.add(v),this._bindEventsOfPager(c?p:f,c?"x":"y"),!0}_renderPagerComponent(){return this._itemContext.isScrollbar?this._renderScrollbar():this._renderPager(),!0}_hover(t,e){this._lastActiveItem=t,t.hasState(Ry.selected)?this._setLegendItemState(t,Ry.selectedHover,e):this._setLegendItemState(t,Ry.unSelectedHover,e);const i=t.getChildren()[0].find((t=>t.name===Ty.focus),!1);i&&i.setAttribute("visible",!0),this._dispatchLegendEvent(My.legendItemHover,t,e)}_unHover(t,e){let i=!1;(t.hasState(Ry.unSelectedHover)||t.hasState(Ry.selectedHover))&&(i=!0),t.removeState(Ry.unSelectedHover),t.removeState(Ry.selectedHover),t.getChildren()[0].getChildren().forEach((t=>{i||!t.hasState(Ry.unSelectedHover)&&!t.hasState(Ry.selectedHover)||(i=!0),t.removeState(Ry.unSelectedHover),t.removeState(Ry.selectedHover)}));const o=t.getChildren()[0].find((t=>t.name===Ty.focus),!1);o&&o.setAttribute("visible",!1),i&&this._dispatchLegendEvent(My.legendItemAttributeUpdate,t,e),this._dispatchLegendEvent(My.legendItemUnHover,t,e)}_setLegendItemState(t,e,i){let o=!1;t.hasState(e)||(o=!0),t.addState(e,!0),t.getChildren()[0].getChildren().forEach((t=>{t.name!==Ty.focus&&(o||t.hasState(e)||(o=!0),t.addState(e,!0))})),o&&this._dispatchLegendEvent(My.legendItemAttributeUpdate,t,i)}_removeLegendItemState(t,e,i){let o=!1;e.forEach((e=>{!o&&t.hasState(e)&&(o=!0),t.removeState(e)})),t.getChildren()[0].getChildren().forEach((t=>{t.name!==Ty.focus&&e.forEach((e=>{!o&&t.hasState(e)&&(o=!0),t.removeState(e)}))})),o&&this._dispatchLegendEvent(My.legendItemAttributeUpdate,t,i)}_getSelectedLegends(){var t;const e=[];return null===(t=this._itemsContainer)||void 0===t||t.getChildren().forEach((t=>{t.hasState(Ry.selected)&&e.push(t.data)})),e}_appendDataToShape(t,e,i,o){let n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};t.name=e,t.data=i,t.delegate=o,t.states=St({},Hy,n)}_dispatchLegendEvent(t,e,i){const o=this._getSelectedLegends();o.sort(((t,e)=>t.index-e.index));const n=o.map((t=>t.label));this._dispatchEvent(t,{item:e,data:e.data,selected:e.hasState(Ry.selected),currentSelectedItems:o,currentSelected:n,event:i})}_handleStyle(t,e,i,o,n){const r={};return t.style&&(Z(t.style)?r.style=t.style(e,i,o,n):r.style=t.style),t.state&&(r.state={},Object.keys(t.state).forEach((s=>{t.state[s]&&(Z(t.state[s])?r.state[s]=t.state[s](e,i,o,n):r.state[s]=t.state[s])}))),r}}var Fy;function Iy(t){return rt(t)?t:[t,t]}function Oy(t){return t?"ew-resize":"ns-resize"}zy.defaultAttributes={layout:"horizontal",title:{align:"start",space:12,textStyle:{fontSize:12,fontWeight:"bold",fill:"#2C3542"}},item:{spaceCol:Sy,spaceRow:Ay,shape:{space:8,style:{size:10,cursor:"pointer"},state:{selectedHover:{opacity:.85},unSelected:{opacity:.5}}},label:{space:8,style:{fontSize:12,fill:"#2C3542",cursor:"pointer"},state:{selectedHover:{opacity:.85},unSelected:{fill:"#D8D8D8"}}},value:{alignRight:!1,style:{fontSize:12,fill:"#ccc",cursor:"pointer"},state:{selectedHover:{opacity:.85},unSelected:{fill:"#D8D8D8"}}},background:{style:{cursor:"pointer"}},focus:!1,focusIconStyle:{size:10,symbolType:"M8 1C11.866 1 15 4.13401 15 8C15 11.866 11.866 15 8 15C4.13401 15 1 11.866 1 8C1 4.13401 4.13401 1 8 1ZM8.75044 2.55077L8.75 3.75H7.25L7.25006 2.5507C4.81247 2.88304 2.88304 4.81247 2.5507 7.25006L3.75 7.25V8.75L2.55077 8.75044C2.8833 11.1878 4.81264 13.117 7.25006 13.4493L7.25 12.25H8.75L8.75044 13.4492C11.1876 13.1167 13.1167 11.1876 13.4492 8.75044L12.25 8.75V7.25L13.4493 7.25006C13.117 4.81264 11.1878 2.8833 8.75044 2.55077ZM8 5.5C9.38071 5.5 10.5 6.61929 10.5 8C10.5 9.38071 9.38071 10.5 8 10.5C6.61929 10.5 5.5 9.38071 5.5 8C5.5 6.61929 6.61929 5.5 8 5.5ZM8 7C7.44772 7 7 7.44772 7 8C7 8.55228 7.44772 9 8 9C8.55228 9 9 8.55228 9 8C9 7.44772 8.55228 7 8 7Z",fill:"#333",cursor:"pointer"}},autoPage:!0,pager:{space:By,handler:{style:{size:10},space:4}},hover:!0,select:!0,selectMode:"multiple",allowAllCanceled:!0},function(t){t.innerView="innerView",t.railContainer="sliderRailContainer",t.rail="sliderRail",t.startText="sliderStartText",t.endText="sliderEndText",t.startHandler="sliderStartHandler",t.startHandlerText="startHandlerText",t.endHandler="sliderEndHandler",t.endHandlerText="sliderEndHandlerText",t.track="sliderTrack",t.trackContainer="sliderTrackContainer"}(Fy||(Fy={})),Py();class Dy extends vg{get track(){return this._track}get currentValue(){return this._currentValue}get startHandler(){return this._startHandler}get endHandler(){return this._endHandler}get tooltipShape(){return this._tooltipShape}constructor(t,e){super((null==e?void 0:e.skipDefault)?t:St({},Dy.defaultAttributes,t)),this.name="slider",this._isHorizontal=!0,this._startHandler=null,this._endHandler=null,this._startHandlerText=null,this._endHandlerText=null,this._currentHandler=null,this._currentValue={},this._onTooltipShow=t=>{this._isChanging||this._tooltipState&&this._tooltipState.isActive||(this._tooltipState?this._tooltipState.isActive=!0:this._tooltipState={isActive:!0},this._onTooltipUpdate(t),this._dispatchTooltipEvent("sliderTooltipShow"))},this._onTooltipUpdate=t=>{if(this._isChanging||!this._tooltipState||!this._tooltipState.isActive)return;const e=this._isHorizontal?this._rail.globalAABBBounds.width():this._rail.globalAABBBounds.height(),i=Xt(this._isHorizontal?(t.viewX-this._rail.globalAABBBounds.x1)/e:(t.viewY-this._rail.globalAABBBounds.y1)/e,0,1);i!==this._tooltipState.pos&&(this._tooltipState.pos=i,this._tooltipState.value=this.calculateValueByPos(i*e),this._updateTooltip(),this._dispatchTooltipEvent("sliderTooltipUpdate"))},this._onTooltipHide=()=>{const{tooltip:t}=this.attribute;t&&t.alwaysShow||(this._tooltipState=null,this._tooltipShape&&this._tooltipShape.setAttribute("visible",!1),this._tooltipText&&this._tooltipText.setAttribute("visible",!1),this._dispatchTooltipEvent("sliderTooltipHide"))},this._onHandlerPointerdown=t=>{t.stopPropagation(),this._isChanging=!0;const{x:e,y:i}=this.stage.eventPointTransform(t);this._currentHandler=t.target,this._prePos=this._isHorizontal?e:i,"browser"===du.env?(du.addEventListener("pointermove",this._onHandlerPointerMove,{capture:!0}),du.addEventListener("pointerup",this._onHandlerPointerUp)):(this.stage.addEventListener("pointermove",this._onHandlerPointerMove,{capture:!0}),this.stage.addEventListener("pointerup",this._onHandlerPointerUp),this.stage.addEventListener("pointerupoutside",this._onHandlerPointerUp))},this._onHandlerPointerMove=t=>{var e,i;t.stopPropagation(),this._isChanging=!0;const{railWidth:o,railHeight:n,min:r,max:s}=this.attribute;if(s===r)return;const{x:l,y:a}=this.stage.eventPointTransform(t);let h,d,c,u=0;this._isHorizontal?(h=l,u=h-this._prePos,d=null===(i=this._currentHandler)||void 0===i?void 0:i.attribute.x,c=o):(h=a,u=h-this._prePos,d=null===(e=this._currentHandler)||void 0===e?void 0:e.attribute.y,c=n);const g=Xt(d+u,0,c),p=this.calculateValueByPos(g);"text"===this._currentHandler.type?this._updateHandlerText(this._currentHandler,g,p):this._updateHandler(this._currentHandler,g,p),this._updateTrack(),this._prePos=h,this._dispatchChangeEvent()},this._onHandlerPointerUp=t=>{t.preventDefault(),this._isChanging=!1,this._currentHandler=null,"browser"===du.env?(du.removeEventListener("pointermove",this._onHandlerPointerMove,{capture:!0}),du.removeEventListener("pointerup",this._onHandlerPointerUp)):(this.stage.removeEventListener("pointermove",this._onHandlerPointerMove,{capture:!0}),this.stage.removeEventListener("pointerup",this._onHandlerPointerUp),this.stage.removeEventListener("pointerupoutside",this._onHandlerPointerUp))},this._onTrackPointerdown=t=>{t.stopPropagation(),this._isChanging=!0;const{x:e,y:i}=this.stage.eventPointTransform(t);this._prePos=this._isHorizontal?e:i,"browser"===du.env?(du.addEventListener("pointermove",this._onTrackPointerMove,{capture:!0}),du.addEventListener("pointerup",this._onTrackPointerUp)):(this.stage.addEventListener("pointermove",this._onTrackPointerMove,{capture:!0}),this.stage.addEventListener("pointerup",this._onTrackPointerUp),this.stage.addEventListener("pointerupoutside",this._onTrackPointerUp))},this._onTrackPointerMove=t=>{t.stopPropagation(),this._isChanging=!0;const{railWidth:e,railHeight:i,min:o,max:n,inverse:r}=this.attribute;if(n===o)return;const{startHandler:s,endHandler:l}=this._getHandlers();let a,h,d;const{x:c,y:u}=this.stage.eventPointTransform(t);this._isHorizontal?(a=c,h=this._track.attribute.width,d=e):(a=u,h=this._track.attribute.height,d=i);const g=a-this._prePos;if(s){const t=this._isHorizontal?s.attribute.x:s.attribute.y,e=r?Xt(t+g,h,d):Xt(t+g,0,d-h),i=this.calculateValueByPos(e);this._updateHandler(s,e,i)}if(l){const t=this._isHorizontal?l.attribute.x:l.attribute.y,e=r?Xt(t+g,0,d-h):Xt(t+g,h,d),i=this.calculateValueByPos(e),o=null==s?void 0:s.attribute;this._updateHandler(l,e,i),this._track.setAttributes(this._isHorizontal?{x:Math.min(o.x,l.attribute.x),width:Math.abs(o.x-l.attribute.x)}:{y:Math.min(o.y,l.attribute.y),height:Math.abs(o.y-l.attribute.y)})}this._prePos=a,this._dispatchChangeEvent()},this._onTrackPointerUp=t=>{t.preventDefault(),this._isChanging=!1,"browser"===du.env?(du.removeEventListener("pointermove",this._onTrackPointerMove,{capture:!0}),du.removeEventListener("pointerup",this._onTrackPointerUp)):(this.stage.removeEventListener("pointermove",this._onTrackPointerMove,{capture:!0}),this.stage.removeEventListener("pointerup",this._onTrackPointerUp),this.stage.removeEventListener("pointerupoutside",this._onTrackPointerUp))},this._onRailPointerDown=t=>{t.stopPropagation(),this._isChanging=!0;const{railWidth:e,railHeight:i,min:o,max:n}=this.attribute;if(n===o)return;const r=this._startHandler,s=this._endHandler;let l,a,h;this._isHorizontal?(l=t.viewX-this._rail.globalAABBBounds.x1,a=null==r?void 0:r.attribute.x,h=null==s?void 0:s.attribute.x):(l=t.viewY-this._rail.globalAABBBounds.y1,a=null==r?void 0:r.attribute.y,h=null==s?void 0:s.attribute.y);const d=this.calculateValueByPos(l);if(Q(h)){const t=Math.abs(l-a)>Math.abs(l-h)?s:r;this._updateHandler(t,l,d)}else this._updateHandler(r,l,d);this._updateTrack(),this._dispatchChangeEvent()}}calculatePosByValue(t,e){const{layout:i,railWidth:o,railHeight:n,min:r,max:s,inverse:l}=this.attribute;let a=0;return a=r===s?"start"===e?0:"end"===e?1:0:(t-r)/(s-r),(l?1-a:a)*("vertical"===i?n:o)}calculateValueByPos(t){const{layout:e,railWidth:i,railHeight:o,min:n,max:r,inverse:s}=this.attribute,l="vertical"===e?o:i;return n+(r-n)*(s?1-t/l:t/l)}setValue(t){const{min:e,max:i}=this.attribute;if(i===e)return;const[o,n]=Tt(t),{startHandler:r,endHandler:s}=this._getHandlers();r&&this._updateHandler(r,this.calculatePosByValue(o),o),s&&this._updateHandler(s,this.calculatePosByValue(n),n),this._updateTrack()}render(){var t,e;this.removeAllChild(!0);const{layout:i="horizontal",railWidth:o,railHeight:n,startText:r,endText:s,min:l,max:a,showHandler:h=!0,showTooltip:d}=this.attribute;let{value:c}=this.attribute;J(c)&&(c=[l,a]),this._currentValue={startValue:Iy(c)[0],endValue:Iy(c)[1]};const u="horizontal"===i;this._isHorizontal=u;const g=Za.group({x:0,y:0});g.name=Fy.innerView,this.add(g),this._innerView=g;let p,f=0;if(r&&r.visible){p=Za.text(Object.assign({x:u?0:o/2,y:u?n/2:0,textAlign:u?"start":"center",textBaseline:u?"middle":"top",text:r.text,lineHeight:null===(t=r.style)||void 0===t?void 0:t.fontSize},r.style)),p.name=Fy.startText,g.add(p);const e=Q(r.space)?r.space:0;f+=(u?p.AABBBounds.width():p.AABBBounds.height())+e}const m=Za.group({x:u?f:0,y:u?0:f});g.add(m);const b=Za.group({x:0,y:0});let v;if(b.name=Fy.railContainer,this._railContainer=b,m.add(b),this._mainContainer=m,this._renderRail(b),f+=u?o:n,s&&s.visible){const t=Q(s.space)?s.space:0;v=Za.text(Object.assign({x:u?f+t:o/2,y:u?n/2:f+t,textAlign:u?"start":"center",textBaseline:u?"middle":"top",text:s.text,lineHeight:null===(e=s.style)||void 0===e?void 0:e.fontSize},s.style)),v.name=Fy.endText,g.add(v)}this._renderTrack(b),h&&(this._renderHandlers(m),this._bindEvents()),d&&(this._renderTooltip(),this._bindTooltipEvents())}_renderRail(t){const{railWidth:e,railHeight:i,railStyle:o,slidable:n}=this.attribute;let r="default";!1!==n&&(r="pointer");const s=Za.rect(Object.assign({x:0,y:0,width:e,height:i,cursor:r},o));return s.name=Fy.rail,t.add(s),this._rail=s,s}_renderHandlers(t){const{range:e,min:i,max:o,handlerSize:n=14,handlerStyle:r,handlerText:s,railHeight:l,railWidth:a,slidable:h}=this.attribute;let{value:d}=this.attribute;J(d)&&(d=[i,o]);const c=s&&s.visible,u=this._isHorizontal,[g,p]=Iy(d),f=this.calculatePosByValue(g,e?"start":"end"),m=this._renderHandler(Object.assign({x:u?f:a/2,y:u?l/2:f,size:n,strokeBoundsBuffer:0,cursor:!1===h?"default":Oy(u)},r));if(m.name=Fy.startHandler,this._startHandler=m,t.add(m),this._currentValue.startPos=f,c){const i=this._renderHandlerText(g,e?"start":"end");i.name=Fy.startHandlerText,t.add(i),this._startHandlerText=i}if(e){const e=this.calculatePosByValue(p,"end"),i=this._renderHandler(Object.assign({x:u?e:a/2,y:u?l/2:e,size:n,strokeBoundsBuffer:0,cursor:!1===h?"default":Oy(u)},r));if(i.name=Fy.endHandler,this._endHandler=i,t.add(i),this._currentValue.endPos=e,c){const e=this._renderHandlerText(p,"end");e.name=Fy.endHandlerText,t.add(e),this._endHandlerText=e}}}_renderTrack(t){const{range:e,min:i,max:o,railHeight:n,railWidth:r,trackStyle:s,railStyle:l,slidable:a,value:h}=this.attribute;let d,c;if(J(h))e?(d=i,c=o):d=c=i;else if(e){const t=Yt(h,i,o);d=t[0],c=t[1]}else d=i,c=Xt(h,i,o);const u=this._isHorizontal;e||(d=i);const g=Za.group({x:0,y:0,width:r,height:n,cornerRadius:null==l?void 0:l.cornerRadius,clip:!0,pickable:!1});g.name=Fy.trackContainer;const p=tt(e)&&!0===e.draggableTrack;let f;f=!1===a?"default":!1===e||!1===p?"pointer":Oy(u);const m=this.calculatePosByValue(d,"start"),b=this.calculatePosByValue(c,e?"end":"start"),v=Za.rect(Object.assign({x:u?Math.min(m,b):0,y:u?0:Math.min(m,b),width:u?Math.abs(b-m):r,height:u?n:Math.abs(b-m),cursor:f},s));v.name=Fy.track,this._track=v,g.add(v),t.add(g)}_renderHandler(t){return Za.symbol(t)}_renderHandlerText(t,e){var i,o,n;const{align:r,handlerSize:s=14,handlerText:l={},railHeight:a,railWidth:h,slidable:d}=this.attribute,c=this._isHorizontal,u=this.calculatePosByValue(t,e),g=null!==(i=l.space)&&void 0!==i?i:4,p={text:l.formatter?l.formatter(t):t.toFixed(null!==(o=l.precision)&&void 0!==o?o:0),lineHeight:null===(n=l.style)||void 0===n?void 0:n.lineHeight,cursor:!1===d?"default":Oy(c)};return c?"top"===r?(p.textBaseline="bottom",p.textAlign="center",p.x=u,p.y=(a-s)/2-g):(p.textBaseline="top",p.textAlign="center",p.x=u,p.y=(a+s)/2+g):"left"===r?(p.textBaseline="middle",p.textAlign="end",p.x=(h-s)/2-g,p.y=u):(p.textBaseline="middle",p.textAlign="start",p.x=(h+s)/2+g,p.y=u),Za.text(Object.assign(Object.assign({},p),l.style))}_renderTooltip(){var t;const{tooltip:e,railHeight:i,railWidth:o,align:n}=this.attribute;e&&e.alwaysShow?this._tooltipState={value:this._currentValue.startValue,pos:this._currentValue.startPos}:this._tooltipState=null;const r=this._isHorizontal?0:o/2,s=this._isHorizontal?i/2:0;if(e&&e.shape){const t=Za.symbol(Object.assign({pickable:!1,visible:!!this._tooltipState,x:r,y:s,symbolType:"circle"},e.shapeStyle));this._tooltipShape=t,this._mainContainer.add(t)}const l=e&&e.text||{},a=null!==(t=l.space)&&void 0!==t?t:6,h={pickable:!1,visible:!!this._tooltipState,text:""};this._isHorizontal?(h.x=r,h.y="top"===n?s-i/2-a:s+i/2+a,h.textAlign="center",h.textBaseline="top"===n?"bottom":"top"):(h.y=s,h.x="left"===n?r-o/2-a:s+o/2+a,h.textAlign="left"===n?"end":"start",h.textBaseline="middle");const d=Za.text(Object.assign(Object.assign({},h),l.style));this._mainContainer.add(d),this._tooltipText=d,this._tooltipState&&this._updateTooltip()}_updateTooltip(){var t,e;if(!this._tooltipShape&&!this._tooltipText||!this._tooltipState)return;const{railWidth:i,railHeight:o}=this.attribute,n=this._isHorizontal?i:o,r=this._tooltipState.pos*n,s=this._isHorizontal?"x":"y";this._tooltipShape&&this._tooltipShape.setAttributes({visible:!0,[s]:r});const{align:l}=this.attribute;if(this._tooltipText){const i=this.attribute.tooltip&&this.attribute.tooltip.text||{};this._tooltipText.setAttributes({visible:!0,[s]:r,text:i.formatter?i.formatter(this._tooltipState.value):this._isHorizontal||"left"!==l?`≈ ${this._tooltipState.value.toFixed(null!==(e=i.precision)&&void 0!==e?e:0)}`:`${this._tooltipState.value.toFixed(null!==(t=i.precision)&&void 0!==t?t:0)} ≈`})}}_bindEvents(){if(this.attribute.disableTriggerEvent)return;const{slidable:t,range:e}=this.attribute;t&&(this._startHandler&&this._startHandler.addEventListener("pointerdown",this._onHandlerPointerdown),this._startHandlerText&&this._startHandlerText.addEventListener("pointerdown",this._onHandlerPointerdown),this._endHandler&&this._endHandler.addEventListener("pointerdown",this._onHandlerPointerdown),this._endHandlerText&&this._endHandlerText.addEventListener("pointerdown",this._onHandlerPointerdown),tt(e)&&e.draggableTrack&&this._track.addEventListener("pointerdown",this._onTrackPointerdown),this._railContainer.addEventListener("pointerdown",this._onRailPointerDown))}_bindTooltipEvents(){this.attribute.disableTriggerEvent||(this._mainContainer.addEventListener("pointerenter",this._onTooltipShow),this._mainContainer.addEventListener("pointermove",this._onTooltipUpdate),this._mainContainer.addEventListener("pointerleave",this._onTooltipHide))}_updateTrack(){const{inverse:t,railWidth:e,railHeight:i}=this.attribute,o=this._startHandler,n=this._endHandler;if(this._isHorizontal){const i=null==o?void 0:o.attribute.x;if(n){const t=null==n?void 0:n.attribute.x;this._track.setAttributes({x:Math.min(i,t),width:Math.abs(i-t)})}else t?this._track.setAttributes({x:i,width:e-i}):this._track.setAttributes({width:i})}else{const e=null==o?void 0:o.attribute.y;if(n){const t=null==n?void 0:n.attribute.y;this._track.setAttributes({y:Math.min(e,t),height:Math.abs(e-t)})}else t?this._track.setAttributes({y:e,height:i-e}):this._track.setAttributes({height:e})}}_updateHandler(t,e,i){var o;const n=this._isHorizontal;t.setAttribute(n?"x":"y",e);const r=t.name===Fy.startHandler?this._startHandlerText:this._endHandlerText;if(r){const{handlerText:t={}}=this.attribute;r.setAttributes({text:t.formatter?t.formatter(i):i.toFixed(null!==(o=t.precision)&&void 0!==o?o:0),[n?"x":"y"]:e})}t.name===Fy.startHandler?(this._currentValue.startValue=i,this._currentValue.startPos=e):(this._currentValue.endValue=i,this._currentValue.endPos=e)}_updateHandlerText(t,e,i){var o;const n=this._isHorizontal,{handlerText:r={}}=this.attribute;t.setAttributes({[n?"x":"y"]:e,text:r.formatter?r.formatter(i):i.toFixed(null!==(o=r.precision)&&void 0!==o?o:0)});const s=t.name===Fy.startHandlerText?this._startHandler:this._endHandler;s&&s.setAttributes({[n?"x":"y"]:e}),t.name===Fy.startHandlerText?(this._currentValue.startValue=i,this._currentValue.startPos=e):(this._currentValue.endValue=i,this._currentValue.endPos=e)}_dispatchChangeEvent(){const t=!!this.attribute.range,e=this._currentValue;this._dispatchEvent("change",{value:t?[Math.min(e.endValue,e.startValue),Math.max(e.endValue,e.startValue)]:e.startValue,position:t?[Math.min(e.endPos,e.startPos),Math.max(e.endPos,e.startPos)]:e.startPos})}_dispatchTooltipEvent(t){this._dispatchEvent("sliderTooltip",{type:t,position:this._tooltipState&&this._tooltipState.pos,value:this._tooltipState&&this._tooltipState.value})}_getHandlers(){const{inverse:t}=this.attribute;let e=this._startHandler,i=this._endHandler;return i?(this._isHorizontal?(!t&&i.attribute.x<(null==e?void 0:e.attribute.x)||t&&i.attribute.x>(null==e?void 0:e.attribute.x))&&([e,i]=[i,e]):(!t&&i.attribute.y<(null==e?void 0:e.attribute.y)||t&&i.attribute.y>(null==e?void 0:e.attribute.y))&&([e,i]=[i,e]),{startHandler:e,endHandler:i}):{startHandler:e,endHandler:i}}}Dy.defaultAttributes={slidable:!0,layout:"horizontal",align:"bottom",height:8,showHandler:!0,handlerSize:14,handlerStyle:{symbolType:"circle",fill:"#fff",stroke:"#91caff",lineWidth:2},tooltip:{shapeStyle:{symbolType:"circle",fill:"#fff",stroke:"#91caff",lineWidth:2},text:{style:{fill:"#2C3542",fontSize:12}}},railStyle:{fill:"rgba(0,0,0,.04)"},trackStyle:{fill:"#91caff"},showValue:!0,valueStyle:{fill:"#2C3542",fontSize:12},startText:{style:{fill:"#2C3542",fontSize:12}},endText:{style:{fill:"#2C3542",fontSize:12}},handlerText:{visible:!0,space:4,precision:0,style:{fill:"#2C3542",fontSize:12}}},Ey(),Py();class Wy extends ky{constructor(t,e){super((null==e?void 0:e.skipDefault)?t:St({},Wy.defaultAttributes,t)),this.name="colorLegend",this._onSliderToolipChange=t=>{const e=this._slider.tooltipShape;if(e&&t.detail&&!J(t.detail.value)){const i=this._colorScale.scale(t.detail.value);e.setAttribute("fill",i)}this.dispatchEvent(t)},this._onSliderChange=t=>{this._updateColor(),this.dispatchEvent(t)}}setSelected(t){this._slider&&(this._slider.setValue(t),this._updateColor())}_renderContent(){const{colors:t,slidable:e,layout:i,align:o,min:n,max:r,value:s,railWidth:l,railHeight:a,showHandler:h=!0,handlerSize:d,handlerStyle:c,railStyle:u,trackStyle:g,startText:p,endText:f,handlerText:m,showTooltip:b,tooltip:v,inverse:y,disableTriggerEvent:C}=this.attribute,w=[],x=(r-n)/(t.length-1);for(let e=0;e<t.length;e++)w.push(n+x*e);this._colorScale=(new iy).domain(w,!0).range(t),this._color=this._getTrackColor();const _=new Dy({x:0,y:0,range:{draggableTrack:!0},slidable:e,layout:i,align:o,min:n,max:r,value:s,railWidth:l,railHeight:a,showHandler:h,handlerSize:d,handlerStyle:c,railStyle:u,trackStyle:Object.assign({fill:this._color},g),startText:p,endText:f,handlerText:m,showTooltip:b,tooltip:v,disableTriggerEvent:C,inverse:y});this._innerView.add(_),this._slider=_,_.translateTo(0-_.AABBBounds.x1,(this._title?this._title.AABBBounds.height()+bt(this.attribute,"title.space",12):0)-_.AABBBounds.y1),this._updateColor()}_bindEvents(){this.attribute.disableTriggerEvent||this._slider&&(this._slider.addEventListener("change",this._onSliderChange),this._slider.addEventListener("sliderTooltip",this._onSliderToolipChange))}_getTrackColor(){const{colors:t,layout:e,inverse:i}=this.attribute;if(mt(t))return;const o=t.length;if(1===o)return t[0];const n=[];for(let e=0;e<o;e++){const i=e/(o-1);n.push({offset:i,color:t[e]})}const r="horizontal"===e,s={gradient:"linear",stops:n,x0:0,y0:0,x1:r?1:0,y1:r?0:1};return i&&(r?(s.x0=1,s.x1=0):(s.y0=1,s.y1=0)),s}_updateColor(){var t;const{layout:e="horizontal",colors:i,railWidth:o,railHeight:n}=this.attribute,{startHandler:r,endHandler:s,track:l,attribute:a}=this._slider,{startValue:h,endValue:d,startPos:c,endPos:u}=this._slider.currentValue,g=null===(t=a.handlerStyle)||void 0===t?void 0:t.fill;if(r&&!g){const t=this._colorScale.scale(h);r.setAttribute("fill",t)}if(s&&!g){const t=this._colorScale.scale(d);s.setAttribute("fill",t)}const p="horizontal"===e?o:n;if(Math.abs(c-u)!==p&&i&&i.length>1){const t=this._color.stops,e=Math.min(c,u),i=Math.max(c,u),o=e/p,n=i/p,r=n-o,s=t.filter((t=>t.offset>o&&t.offset<n)),a=Math.min(h,d),g=Math.max(h,d),f=this._colorScale.scale(a),m=this._colorScale.scale(g),b=[{offset:0,color:f}];s.forEach((t=>{b.push({offset:(t.offset-o)/r,color:t.color})})),b.push({offset:1,color:m}),l.setAttribute("fill",Object.assign(Object.assign({},this._color),{stops:b}))}}}function Ny(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"bottom",e=0;return"top"===t?`\n M${e},-6L${e-3.5},-2.5\n v5\n h7\n v-5\n Z\n`:"left"===t?(e=1,`\n M${e-6},0L${e-6+2.5},-3.5\n h5\n v7\n h-5\n Z\n`):"right"===t?(e=-1,`\n M${e+6},0L${e+6-2.5},-3.5\n h-5\n v7\n h5\n Z\n `):`\n M${e},6L${e-3.5},2.5\n v-5\n h7\n v5\n Z\n`}Wy.defaultAttributes={layout:"horizontal",title:{align:"start",space:12,textStyle:{fontSize:12,fontWeight:"bold",fill:"rgba(46, 47, 50, 1)"}},handlerSize:10,handlerStyle:{fill:null,lineWidth:4,stroke:"#fff",outerBorder:{distance:2,lineWidth:1,stroke:"#ccc"}},tooltip:{shapeStyle:{lineWidth:4,stroke:"#fff"}}},Ey(),Py(),ib();class Gy extends ky{constructor(t,e){super((null==e?void 0:e.skipDefault)?t:St({},Gy.defaultAttributes,t)),this.name="sizeLegend",this._onSliderChange=t=>{this.dispatchEvent(t)},this._onSliderToolipChange=t=>{this.dispatchEvent(t)}}setSelected(t){this._slider&&this._slider.setValue(t)}_renderContent(){const{slidable:t,layout:e,align:i,min:o,max:n,value:r,railWidth:s,railHeight:l,showHandler:a=!0,handlerSize:h,handlerStyle:d,railStyle:c,trackStyle:u,startText:g,endText:p,handlerText:f,showTooltip:m,tooltip:b,sizeBackground:v,disableTriggerEvent:y,inverse:C}=this.attribute,w=Za.group({x:0,y:0});this._innerView.add(w);const x=new Dy({x:0,y:0,zIndex:1,range:{draggableTrack:!0},slidable:t,layout:e,align:i,min:o,max:n,value:r,railWidth:s,railHeight:l,showHandler:a,handlerSize:h,handlerStyle:Object.assign({symbolType:Ny(i)},d),railStyle:c,trackStyle:u,startText:g,endText:p,handlerText:f,showTooltip:m,tooltip:b,disableTriggerEvent:y,inverse:C});w.add(x);let _,S=0;"horizontal"===e?"top"===i?(_=`M0,0L${s},0L${C?0:s},12Z`,S=l):(_=`M0,12L${s},12L${C?0:s},0Z`,x.setAttribute("y",12)):"left"===i?_=`M${s},0L${s+12},${C?0:l}L${s},${l}Z`:(_=`M0,${C?0:l}L12,${l}L12,0Z`,x.setAttribute("x",12));const A=Za.path(Object.assign(Object.assign({x:0,y:S,path:_},v),{zIndex:0}));w.add(A);const B=this._title?this._title.AABBBounds.height()+bt(this.attribute,"title.space",12):0;w.translate(0-w.AABBBounds.x1,B-w.AABBBounds.y1),this._slider=x}_bindEvents(){this.attribute.disableTriggerEvent||this._slider&&(this._slider.addEventListener("change",this._onSliderChange),this._slider.addEventListener("sliderTooltip",this._onSliderToolipChange))}}Gy.defaultAttributes={layout:"horizontal",title:{align:"start",space:12,textStyle:{fontSize:12,fontWeight:"bold",fill:"rgba(46, 47, 50, 1)"}},handlerSize:10,handlerStyle:{lineWidth:1,stroke:"#ccc",fill:"#fff"},sizeBackground:{fill:"rgba(20,20,20,0.1)"}},qm(),ub(),ab();let jy=class t extends vg{constructor(e,i){super((null==i?void 0:i.skipDefault)?e:St({},t.defaultAttributes,e)),this.name="title"}render(){var t,e,i,o,n,r,s,l,a,h,d,c,u,g,p,f,m,b,v,y,C,w,x,_,S,A,B,R,M,T,k,P,E,L,H,z,F,I,O,D,W,N;const{textType:G,text:j,subtextType:V,textStyle:U={},subtext:$,subtextStyle:X={},width:Y,height:K,minWidth:q,maxWidth:Z,minHeight:J,maxHeight:tt,align:et,verticalAlign:it,padding:ot=0}=this.attribute,nt=ei(ot),st=this.createOrUpdateChild("title-container",{x:nt[3],y:nt[0],zIndex:1},"group");if(!1!==this.attribute.visible&&!1!==U.visible)if("rich"===G||Q(U.character)){const h=Object.assign({x:null!==(t=U.x)&&void 0!==t?t:0,y:null!==(e=U.y)&&void 0!==e?e:0,width:null!==(o=null!==(i=U.width)&&void 0!==i?i:Y)&&void 0!==o?o:0,height:null!==(r=null!==(n=U.height)&&void 0!==n?n:K)&&void 0!==r?r:0,ellipsis:null===(s=U.ellipsis)||void 0===s||s,wordBreak:null!==(l=U.wordBreak)&&void 0!==l?l:"break-word",maxHeight:U.maxHeight,maxWidth:U.maxWidth,textConfig:null!==(a=U.character)&&void 0!==a?a:j},U);this._mainTitle=st.createOrUpdateChild("mainTitle",h,"richtext")}else if("html"===G){const t=Object.assign({html:Object.assign(Object.assign({dom:j},yb),U),x:null!==(h=U.x)&&void 0!==h?h:0,y:null!==(d=U.y)&&void 0!==d?d:0,width:null!==(u=null!==(c=U.width)&&void 0!==c?c:Y)&&void 0!==u?u:0,height:null!==(p=null!==(g=U.height)&&void 0!==g?g:K)&&void 0!==p?p:0,ellipsis:null===(f=U.ellipsis)||void 0===f||f,wordBreak:null!==(m=U.wordBreak)&&void 0!==m?m:"break-word",maxHeight:U.maxHeight,maxWidth:U.maxWidth,textConfig:[]},U);this._mainTitle=st.createOrUpdateChild("mainTitle",t,"richtext")}else Q(j)&&(this._mainTitle=st.createOrUpdateChild("mainTitle",Object.assign(Object.assign({text:rt(j)?j:[j],wrap:!0},U),{maxLineWidth:null!==(b=U.maxLineWidth)&&void 0!==b?b:Y,heightLimit:U.heightLimit,lineClamp:U.lineClamp,ellipsis:null===(v=U.ellipsis)||void 0===v||v,x:0,y:0}),"text"));const lt=this._mainTitle?this._mainTitle.AABBBounds.height():0,at=this._mainTitle?this._mainTitle.AABBBounds.width():0;if(!1!==this.attribute.visible&&!1!==X.visible)if("rich"===V||Q(X.character)){const t=Object.assign({x:null!==(y=X.x)&&void 0!==y?y:0,y:null!==(C=X.y)&&void 0!==C?C:0,width:null!==(x=null!==(w=X.width)&&void 0!==w?w:Y)&&void 0!==x?x:0,height:null!==(S=null!==(_=X.height)&&void 0!==_?_:K)&&void 0!==S?S:0,ellipsis:null===(A=X.ellipsis)||void 0===A||A,wordBreak:null!==(B=X.wordBreak)&&void 0!==B?B:"break-word",maxHeight:X.maxHeight,maxWidth:X.maxWidth,textConfig:null!==(R=X.character)&&void 0!==R?R:$},X);this._subTitle=st.createOrUpdateChild("subTitle",t,"richtext")}else if("html"===V){const t=Object.assign({html:Object.assign(Object.assign({dom:$},yb),X),x:null!==(M=X.x)&&void 0!==M?M:0,y:null!==(T=X.y)&&void 0!==T?T:0,width:null!==(P=null!==(k=X.width)&&void 0!==k?k:Y)&&void 0!==P?P:0,height:null!==(L=null!==(E=X.height)&&void 0!==E?E:K)&&void 0!==L?L:0,ellipsis:null===(H=X.ellipsis)||void 0===H||H,wordBreak:null!==(z=X.wordBreak)&&void 0!==z?z:"break-word",maxHeight:X.maxHeight,maxWidth:X.maxWidth,textConfig:[]},X);this._subTitle=st.createOrUpdateChild("subTitle",t,"richtext")}else Q($)&&(this._subTitle=st.createOrUpdateChild("subTitle",Object.assign(Object.assign({text:rt($)?$:[$],wrap:!0},X),{maxLineWidth:null!==(F=X.maxLineWidth)&&void 0!==F?F:Y,heightLimit:X.heightLimit,lineClamp:X.lineClamp,ellipsis:null===(I=X.ellipsis)||void 0===I||I,x:0,y:lt}),"text"));const ht=this._subTitle?this._subTitle.AABBBounds.height():0,dt=this._subTitle?this._subTitle.AABBBounds.width():0;let ct=Math.max(at,dt),ut=lt+(null!==(O=X.height)&&void 0!==O?O:ht);if(Q(Y)&&(ct=Y,this._mainTitle&&this._mainTitle.setAttribute("maxLineWidth",Y),this._subTitle&&this._subTitle.setAttribute("maxLineWidth",Y)),Q(K)&&(ut=K),Q(q)&&ct<q&&(ct=q),Q(Z)&&(this._mainTitle&&this._mainTitle.setAttribute("maxLineWidth",Z),this._subTitle&&this._subTitle.setAttribute("maxLineWidth",Z),this._mainTitle&&this._mainTitle.setAttribute("maxWidth",Z),this._subTitle&&this._subTitle.setAttribute("maxWidth",Z),ct>Z&&(ct=Z)),Q(J)&&ut<J&&(ut=J),Q(tt)&&(this._mainTitle&&this._mainTitle.setAttribute("maxHeight",tt),this._subTitle&&this._subTitle.setAttribute("maxHeight",tt-lt),ut>tt&&(ut=tt)),st.attribute.width=ct,st.attribute.height=ut,st.attribute.boundsPadding=nt,this._mainTitle){if(Q(et)||Q(U.align)){const t=U.align?U.align:et,e=null!==(D=U.width)&&void 0!==D?D:at;"left"===t?(this._mainTitle.setAttribute("x",0),this._mainTitle.setAttribute("textAlign","left")):"center"===t?(this._mainTitle.setAttribute("x",e/2),this._mainTitle.setAttribute("textAlign","center")):"right"===t&&(this._mainTitle.setAttribute("x",e),this._mainTitle.setAttribute("textAlign","right"))}if(Q(it)||Q(U.verticalAlign)){const t=U.verticalAlign?U.verticalAlign:it,e=U.height?U.height:ut;"top"===t?(this._mainTitle.setAttribute("y",0),this._mainTitle.setAttribute("textBaseline","top")):"middle"===t?(this._mainTitle.setAttribute("y",e/2),this._mainTitle.setAttribute("textBaseline","middle")):"bottom"===t&&(this._mainTitle.setAttribute("y",e),this._mainTitle.setAttribute("textBaseline","bottom"))}}if(this._subTitle){if(Q(et)||Q(X.align)){const t=X.align?X.align:et,e=null!==(W=X.width)&&void 0!==W?W:dt;"left"===t?(this._subTitle.setAttribute("x",0),this._subTitle.setAttribute("textAlign","left")):"center"===t?(this._subTitle.setAttribute("x",e/2),this._subTitle.setAttribute("textAlign","center")):"right"===t&&(this._subTitle.setAttribute("x",e),this._subTitle.setAttribute("textAlign","right"))}if(Q(it)||Q(U.verticalAlign)){const t=X.verticalAlign?X.verticalAlign:it,e=lt,i=null!==(N=X.height)&&void 0!==N?N:0;"top"===t?(this._subTitle.setAttribute("y",e),this._subTitle.setAttribute("textBaseline","top")):"middle"===t?(this._subTitle.setAttribute("y",e+i/2),this._subTitle.setAttribute("textBaseline","middle")):"bottom"===t&&(this._subTitle.setAttribute("y",e+i),this._subTitle.setAttribute("textBaseline","bottom"))}}}};jy.defaultAttributes={textStyle:{ellipsis:"...",fill:"#333",fontSize:20,fontWeight:"bold",textAlign:"left",textBaseline:"top"},subtextStyle:{ellipsis:"...",fill:"#6F6F6F",fontSize:16,fontWeight:"normal",textAlign:"left",textBaseline:"top"}};qm(),sb(),ub(),Jm();class Vy extends vg{constructor(t,e){super((null==e?void 0:e.skipDefault)?t:St({},Vy.defaultAttributes,t)),this._handlePointerUp=()=>{this.attribute.disabled||(this.attribute.checked?(this.setAttribute("checked",!1),this.setAttribute("indeterminate",!1)):(this.setAttribute("checked",!0),this.setAttribute("indeterminate",!1)),this._dispatchEvent("checkbox_state_change",{eventType:"checkbox_state_change",checked:this.attribute.checked}),this.stage.renderNextFrame())},this.renderGroup(),this.onBeforeAttributeUpdate=(t,e,i)=>{"interactive"in t&&this.setAttribute("pickable",t.interactive),"disabled"in t&&this.setAttribute("cursor",t.disable?this.attribute.disableCursor:this.attribute.cursor)},this.addEventListener("pointerup",this._handlePointerUp)}render(){this.removeAllChild(!0),this.renderBox(),this.renderIcon(),this.renderText(),this.layout()}renderBox(){this._box=new ma(St({},this.attribute.box));const t=this.attribute.checked||this.attribute.indeterminate;t&&this.attribute.disabled?this._box.setAttributes({fill:this.attribute.box.disableCheckedFill,stroke:this.attribute.box.disableCheckedStroke}):t&&this._box.setAttributes({fill:this.attribute.box.checkedFill,stroke:this.attribute.box.checkedStroke}),this.appendChild(this._box)}renderIcon(){this._checkIcon=new wa(St({image:this.attribute.icon.checkIconImage},this.attribute.icon)),this.appendChild(this._checkIcon),this._indeterminateIcon=new wa(St({image:this.attribute.icon.indeterminateIconImage},this.attribute.icon)),this.appendChild(this._indeterminateIcon),this.attribute.checked?(this._checkIcon.setAttribute("visible",!0),this._indeterminateIcon.setAttribute("visible",!1)):this.attribute.indeterminate?(this._checkIcon.setAttribute("visible",!1),this._indeterminateIcon.setAttribute("visible",!0)):(this._checkIcon.setAttribute("visible",!1),this._indeterminateIcon.setAttribute("visible",!1))}renderText(){this._text=new il(St({wrap:!0},this.attribute.text)),this.attribute.disabled&&this._text.setAttribute("fill",this.attribute.text.disableFill),this.appendChild(this._text)}renderGroup(){this.attribute.interactive||this.setAttribute("pickable",!1),this.attribute.disabled&&this.setAttribute("cursor",this.attribute.disableCursor)}layout(){const t=this.attribute.box.height,e=this.attribute.icon.height,i=this._text.AABBBounds.height(),o=Math.max(t,e,i),n=o/2-t/2,r=o/2-e/2,s=o/2-i/2,l=this.attribute.box.width,a=this.attribute.icon.width,h=Math.max(l,a),d=h/2-l/2,c=h/2-a/2,u=h+this.attribute.spaceBetweenTextAndIcon;this._box.setAttributes({x:d,y:n}),this._checkIcon.setAttributes({x:c,y:r}),this._indeterminateIcon.setAttributes({x:c,y:r}),this._text.setAttributes({x:u,y:s})}}Vy.defaultAttributes={interactive:!0,disabled:!1,checked:!1,indeterminate:!1,cursor:"pointer",disableCursor:"not-allowed",spaceBetweenTextAndIcon:8,text:{text:"text",fontSize:14,fill:"#000",disableFill:"rgb(201,205,212)",textBaseline:"top",pickable:!1},icon:{checkIconImage:'<svg width="200" height="200" viewBox="0 0 1024 1024" fill="#fff" xmlns="http://www.w3.org/2000/svg"><path d="M877.44815445 206.10060629a64.72691371 64.72691371 0 0 0-95.14856334 4.01306852L380.73381888 685.46812814 235.22771741 533.48933518a64.72691371 64.72691371 0 0 0-92.43003222-1.03563036l-45.82665557 45.82665443a64.72691371 64.72691371 0 0 0-0.90617629 90.61767965l239.61903446 250.10479331a64.72691371 64.72691371 0 0 0 71.19960405 15.14609778 64.33855261 64.33855261 0 0 0 35.08198741-21.23042702l36.24707186-42.71976334 40.5190474-40.77795556-3.36579926-3.49525333 411.40426297-486.74638962a64.72691371 64.72691371 0 0 0-3.88361443-87.64024149l-45.3088404-45.43829334z"></path></svg>',indeterminateIconImage:'<svg width="200" height="200" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill="none"><path stroke="#fff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5" d="M5 12h14"/></svg>',width:10,height:10,pickable:!1},box:{width:14,height:14,cornerRadius:2,fill:"#fff",stroke:"rgb(229,230,235)",disableFill:"rgb(242,243,245)",checkedFill:"rgb(22, 93, 255)",checkedStroke:"rgb(22, 93, 255)",disableCheckedFill:"rgb(148, 191, 255)",disableCheckedStroke:"rgb(148, 191, 255)",pickable:!1}},qm(),sb(),pb(),Jm();class Uy extends vg{constructor(t,e){super((null==e?void 0:e.skipDefault)?t:St({},Uy.defaultAttributes,t)),this._handlePointerUp=()=>{this.attribute.disabled||this.attribute.checked||(this.setAttribute("checked",!0),this._dispatchEvent("radio_checked",{eventType:"radio_checked",target:this}),this.stage.renderNextFrame())},this.renderGroup(),this.onBeforeAttributeUpdate=(t,e,i)=>{"interactive"in t&&this.setAttribute("pickable",t.interactive),"disabled"in t&&this.setAttribute("cursor",t.disable?this.attribute.disableCursor:this.attribute.cursor)},this.addEventListener("pointerup",this._handlePointerUp)}render(){this.removeAllChild(!0),this.renderCircle(),this.renderText(),this.layout()}renderCircle(){this._circle=new La(St({},this.attribute.circle));const t=this.attribute.checked;t&&this.attribute.disabled?this._circle.setAttributes({fill:this.attribute.circle.disableCheckedFill,stroke:this.attribute.circle.disableCheckedStroke}):t&&this._circle.setAttributes({fill:this.attribute.circle.checkedFill,stroke:this.attribute.circle.checkedStroke}),this.appendChild(this._circle)}renderText(){this._text=new rl(St({},this.attribute.text)),this.attribute.disabled&&this._text.setAttribute("fill",this.attribute.text.disableFill),this.appendChild(this._text)}renderGroup(){this.attribute.interactive||this.setAttribute("pickable",!1),this.attribute.disabled&&this.setAttribute("cursor",this.attribute.disableCursor)}layout(){const t=2*(this.attribute.circle.outerRadius+this.attribute.circle.lineWidth),e=this._text.AABBBounds.height(),i=Math.max(t,e),o=i/2-t/2+this.attribute.circle.outerRadius+this.attribute.circle.lineWidth,n=i/2-e/2,r=2*(this.attribute.circle.outerRadius+this.attribute.circle.lineWidth),s=this.attribute.circle.outerRadius+this.attribute.circle.lineWidth,l=r+this.attribute.spaceBetweenTextAndIcon;this._circle.setAttributes({x:s,y:o}),this._text.setAttributes({x:l,y:n})}}Uy.defaultAttributes={interactive:!0,disabled:!1,checked:!1,cursor:"pointer",disableCursor:"not-allowed",spaceBetweenTextAndIcon:8,text:{text:"text",fontSize:14,fill:"#000",disableFill:"rgb(201,205,212)",textBaseline:"top",pickable:!1},circle:{outerRadius:7,innerRadius:3,startAngle:0,endAngle:2*Math.PI,lineWidth:1,fill:"#fff",stroke:"rgb(229,230,235)",disableFill:"rgb(242,243,245)",checkedFill:"rgb(22, 93, 255)",checkedStroke:"rgb(22, 93, 255)",disableCheckedFill:"rgb(148, 191, 255)",disableCheckedStroke:"rgb(148, 191, 255)",pickable:!1}};qm(),ub(),Jm();let $y=class t extends vg{constructor(e,i){super((null==i?void 0:i.skipDefault)?e:St({},t.defaultAttributes,e))}render(){this.removeAllChild(!0),this.renderIcon(),this.renderText(),this.layout()}renderIcon(){this._emptyTipIcon=new wa(St({image:this.attribute.icon.image},this.attribute.icon)),this.appendChild(this._emptyTipIcon)}renderText(){this._text=new il(St({wrap:!0},this.attribute.text)),this.appendChild(this._text)}layout(){const t=this.attribute.icon.height,e=this._text.AABBBounds.height(),i=this.attribute.icon.width,{width:o,height:n,spaceBetweenTextAndIcon:r}=this.attribute;this._emptyTipIcon.setAttribute("x",o/2-i/2),this._emptyTipIcon.setAttribute("y",n/2-t/2-e/2-r/2),this._text.setAttribute("x",o/2),this._text.setAttribute("textAlign","center"),this._text.setAttribute("y",n/2+t/2+r/2),this._text.setAttribute("textBaseline","middle")}};$y.defaultAttributes={spaceBetweenTextAndIcon:20,text:{text:"no data",fontSize:14,fill:"#000",disableFill:"rgb(201,205,212)",pickable:!1},icon:{image:'<svg t="1716726614852" class="icon" viewBox="0 0 1194 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2621" width="200" height="200"><path d="M1038.694079 367.237067c13.265507 23.342857-16.633865-40.004445-63.05621-40.004446H219.018794c-26.558738 0-46.46393 13.334815-63.05621 40.004446S0.006238 607.277601 0.006238 650.608819V940.647979a82.351494 82.351494 0 0 0 82.961402 83.349526H1111.702885a82.337632 82.337632 0 0 0 82.975264-83.349526V650.608819c0-43.331218-155.970208-283.371753-155.970208-283.371752zM730.066575 667.284269a136.328386 136.328386 0 0 1-132.738243 133.33429 133.417459 133.417459 0 0 1-132.738243-133.33429v-6.681269a40.6698 40.6698 0 0 0-36.497473-26.66963H73.015044l119.458874-220.02445s23.231965-40.004445 53.103614-40.004446h713.481918c26.544876 0 29.871649 10.008042 46.436207 40.004446L1128.33675 633.947231H769.904682c-26.184476 0-39.838107 7.623855-39.838107 33.337038zM338.505391 210.559919l-89.601086-86.69016a22.178487 22.178487 0 0 1 0-33.26773 21.984425 21.984425 0 0 1 33.170699 0l89.601087 86.676299a22.317102 22.317102 0 0 1 0 33.26773 24.950798 24.950798 0 0 1-33.1707 0z m252.197118-40.059891a25.532983 25.532983 0 0 1-6.639685-16.633865l-3.326773-126.694606A28.263709 28.263709 0 0 1 603.995739 0.515788c13.251646-3.326773 23.204242 10.021904 26.544877 23.342858V153.866163a28.249847 28.249847 0 0 1-23.259688 26.66963c-6.611961-3.312911-13.279369-3.312911-16.578419-10.035765z m235.646421 33.337038a22.372548 22.372548 0 0 1 0-33.337038l86.288175-90.030795a22.039871 22.039871 0 0 1 33.170699 0 22.289379 22.289379 0 0 1 0 33.364761l-82.961401 90.003072a25.962691 25.962691 0 0 1-36.483611 0z" fill="#8a8a8a" p-id="2622"></path></svg>',width:100,height:100,pickable:!1}};let Xy=!1;function Yy(){Xy||(Xy=!0,hu(),ku()?Cp(Qo):function(){Tu();const t=Oo.global&&Oo.global.env;return t?"node"===t:!Mu}()&&Ff(Qo),$m(),Ym(),qm(),Jm(),tb(),sb(),ab(),db(),ub(),Qo.load(jb))}var Ky,qy,Zy,Jy,Qy,tC,eC,iC,oC;!function(t){t.default="default",t.grabing="grabing",t.scrolling="scrolling"}(Ky||(Ky={})),function(t){t.single="single",t.column="column",t.row="row",t.cross="cross",t.none="none"}(qy||(qy={})),function(t){t.top="top",t.bottom="bottom",t.left="left",t.right="right"}(Zy||(Zy={})),function(t){t.expand="expand",t.collapse="collapse",t.none="none"}(Jy||(Jy={})),function(t){t.RECORD="RECORD",t.NONE="NONE",t.SUM="SUM",t.MIN="MIN",t.MAX="MAX",t.AVG="AVG",t.COUNT="COUNT",t.CUSTOM="CUSTOM",t.RECALCULATE="RECALCULATE"}(Qy||(Qy={})),function(t){t.ASC="ASC",t.DESC="DESC"}(tC||(tC={})),function(t){t.inlineFront="inlineFront",t.inlineEnd="inlineEnd",t.left="left",t.right="right",t.absoluteRight="absoluteRight",t.contentLeft="contentLeft",t.contentRight="contentRight",t.absolute="absolute"}(eC||(eC={})),function(t){t.frozen="frozen",t.sort="sort",t.dropDown="dropDown",t.dropDownState="dropDownState",t.play="play",t.damagePic="damagePic",t.expand="expand",t.collapse="collapse",t.drillDown="drillDown",t.drillUp="drillUp",t.dragReorder="dragReorder"}(iC||(iC={})),function(t){t.upwardIconName="sort_upward",t.downwardIconName="sort_downward",t.normalIconName="sort_normal",t.freezeIconName="freeze",t.frozenIconName="frozen",t.frozenCurrentIconName="frozenCurrent",t.dropdownIconName="dropdownIcon",t.expandIconName="expand",t.collapseIconName="collapse",t.dragReorderIconName="dragReorder"}(oC||(oC={}));let nC,rC=1,sC=class{constructor(){this.listenersData={listeners:{},listenerData:{}}}on(t,e){const i=this.listenersData.listeners[t]||(this.listenersData.listeners[t]=[]);i.push(e);const o=rC++;return this.listenersData.listenerData[o]={type:t,listener:e,remove:()=>{delete this.listenersData.listenerData[o];const n=i.indexOf(e);i.splice(n,1),this.listenersData.listeners[t].length||delete this.listenersData.listeners[t]}},o}off(t,e){var i;if(e){const i=t;this.removeEventListener(i,e)}else{const e=t;if(!this.listenersData)return;null===(i=this.listenersData.listenerData[e])||void 0===i||i.remove()}}addEventListener(t,e,i){this.on(t,e)}removeEventListener(t,e){if(this.listenersData)for(const i in this.listenersData.listenerData){const o=this.listenersData.listenerData[i];o.type===t&&o.listener===e&&this.off(i)}}hasListeners(t){return!!this.listenersData&&!!this.listenersData.listeners[t]}fireListeners(t,e){if(!this.listenersData)return[];const i=this.listenersData.listeners[t];return i?i.map((t=>t.call(this,e))).filter((t=>Q(t))):[]}release(){delete this.listenersData}};const lC={CHANGE_STYLE:"change_style"};let aC,hC,dC,cC=class t extends sC{static get EVENT_TYPE(){return lC}static get DEFAULT(){return nC||(nC=new t)}constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};var i,o,n,r,s,l,a,h,d,c,u,g,p,f,m,b,v,y,C,w,x,_,S,A,B,R,M,T,k,P,E;super(),this._defaultPadding=[10,16,10,16],this._textAlign=null!==(i=null==t?void 0:t.textAlign)&&void 0!==i?i:null==e?void 0:e.textAlign,this._textBaseline=null!==(o=null==t?void 0:t.textBaseline)&&void 0!==o?o:null==e?void 0:e.textBaseline,this._color=null!==(n=null==t?void 0:t.color)&&void 0!==n?n:null==e?void 0:e.color,this._strokeColor=null!==(r=null==t?void 0:t.strokeColor)&&void 0!==r?r:null==e?void 0:e.strokeColor,this._fontSize=null!==(s=t.fontSize)&&void 0!==s?s:null==e?void 0:e.fontSize,this._fontFamily=null!==(l=t.fontFamily)&&void 0!==l?l:null==e?void 0:e.fontFamily,this._fontWeight=null!==(a=t.fontWeight)&&void 0!==a?a:null==e?void 0:e.fontWeight,this._fontVariant=null!==(h=t.fontVariant)&&void 0!==h?h:null==e?void 0:e.fontVariant,this._fontStyle=null!==(d=t.fontStyle)&&void 0!==d?d:null==e?void 0:e.fontStyle,this._padding=null!==(u=null!==(c=null==t?void 0:t.padding)&&void 0!==c?c:null==e?void 0:e.padding)&&void 0!==u?u:this._defaultPadding,this._borderColor=null!==(g=null==t?void 0:t.borderColor)&&void 0!==g?g:null==e?void 0:e.borderColor,this._textOverflow=null!==(p=null==t?void 0:t.textOverflow)&&void 0!==p?p:null==e?void 0:e.textOverflow,this._textStick=null!==(m=null!==(f=t.textStick)&&void 0!==f?f:null==e?void 0:e.textStick)&&void 0!==m&&m,this._textStickBaseOnAlign=null!==(v=null!==(b=t.textStickBaseOnAlign)&&void 0!==b?b:null==e?void 0:e.textStickBaseOnAlign)&&void 0!==v&&v,this._bgColor=null!==(y=null==t?void 0:t.bgColor)&&void 0!==y?y:null==e?void 0:e.bgColor,this._lineHeight=null!==(C=null==t?void 0:t.lineHeight)&&void 0!==C?C:null==e?void 0:e.lineHeight,this._underline=null!==(w=null==t?void 0:t.underline)&&void 0!==w?w:null==e?void 0:e.underline,this._underlineColor=null!==(x=null==t?void 0:t.underlineColor)&&void 0!==x?x:null==e?void 0:e.underlineColor,this._underlineDash=null!==(_=null==t?void 0:t.underlineDash)&&void 0!==_?_:null==e?void 0:e.underlineDash,this._underlineOffset=null!==(S=null==t?void 0:t.underlineOffset)&&void 0!==S?S:null==e?void 0:e.underlineOffset,this._lineThrough=null!==(A=null==t?void 0:t.lineThrough)&&void 0!==A?A:null==e?void 0:e.lineThrough,this._lineThroughColor=null!==(B=null==t?void 0:t.lineThroughColor)&&void 0!==B?B:null==e?void 0:e.lineThroughColor,this._lineThroughDash=null!==(R=null==t?void 0:t.lineThroughDash)&&void 0!==R?R:null==e?void 0:e.lineThroughDash,this._linkColor=null!==(M=null==t?void 0:t.linkColor)&&void 0!==M?M:null==e?void 0:e.linkColor,this._cursor=null!==(T=t.cursor)&&void 0!==T?T:null==e?void 0:e.cursor,this._borderLineWidth=null!==(k=t.borderLineWidth)&&void 0!==k?k:null==e?void 0:e.borderLineWidth,this._borderLineDash=null!==(P=t.borderLineDash)&&void 0!==P?P:null==e?void 0:e.borderLineDash,this._marked=null!==(E=t.marked)&&void 0!==E?E:null==e?void 0:e.marked}get color(){return this._color}set color(t){this._color=t}get strokeColor(){return this._strokeColor}set strokeColor(t){this._strokeColor=t}get fontSize(){return this._fontSize}set fontSize(t){this._fontSize=t}get fontFamily(){return this._fontFamily}set fontFamily(t){this._fontFamily=t}get fontWeight(){return this._fontWeight}set fontWeight(t){this._fontWeight=t}get fontVariant(){return this._fontVariant}set fontVariant(t){this._fontVariant=t}get fontStyle(){return this._fontStyle}set fontStyle(t){this._fontStyle=t}get padding(){return this._padding}set padding(t){this._padding=t}get textOverflow(){return this._textOverflow}set textOverflow(t){this._textOverflow=t}get bgColor(){return this._bgColor}set bgColor(t){this._bgColor=t}get borderColor(){return this._borderColor}set borderColor(t){this._borderColor=t}get textStick(){return this._textStick}set textStick(t){this._textStick=t}get textStickBaseOnAlign(){return this._textStickBaseOnAlign}set textStickBaseOnAlign(t){this._textStickBaseOnAlign=t}get textAlign(){return this._textAlign}set textAlign(t){this._textAlign=t}get textBaseline(){return this._textBaseline}set textBaseline(t){this._textBaseline=t}get lineHeight(){return this._lineHeight}set lineHeight(t){this._lineHeight=t}get underline(){return this._underline}set underline(t){this._underline=t}get underlineColor(){return this._underlineColor}set underlineColor(t){this._underlineColor=t}get underlineDash(){return this._underlineDash}set underlineDash(t){this._underlineDash=t}get underlineOffset(){return this._underlineOffset}set underlineOffset(t){this._underlineOffset=t}get lineThrough(){return this._lineThrough}set lineThrough(t){this._lineThrough=t}get lineThroughColor(){return this._lineThroughColor}set lineThroughColor(t){this._lineThroughColor=t}get lineThroughDash(){return this._lineThroughDash}set lineThroughDash(t){this._lineThroughDash=t}get linkColor(){return this._linkColor}set linkColor(t){this._linkColor=t}get cursor(){return this._cursor}set cursor(t){this._cursor=t}get borderLineWidth(){return this._borderLineWidth}set borderLineWidth(t){this._borderLineWidth=t}get borderLineDash(){return this._borderLineDash}set borderLineDash(t){this._borderLineDash=t}get marked(){return this._marked}set marked(t){this._marked=t}clone(){return new t(this,null)}},uC=class t extends cC{static get DEFAULT(){return aC||(aC=new t)}constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},arguments.length>1&&void 0!==arguments[1]?arguments[1]:{})}clone(){return new t(this,null)}};class gC extends cC{static get DEFAULT(){return hC||(hC=new gC)}constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};var i,o;super(t,e),this._autoWrapText=null!==(i=null==t?void 0:t.autoWrapText)&&void 0!==i?i:null==e?void 0:e.autoWrapText,this._lineClamp=null!==(o=null==t?void 0:t.lineClamp)&&void 0!==o?o:null==e?void 0:e.lineClamp}clone(){return new gC(this,null)}get lineClamp(){return this._lineClamp}set lineClamp(t){this._lineClamp=t}get autoWrapText(){return this._autoWrapText}set autoWrapText(t){this._autoWrapText=t}}let pC,fC,mC=class t extends cC{static get DEFAULT(){return dC||(dC=new t)}constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};var o,n,r,s,l,a,h,d,c,u,g,p,f,m,b,v,y,C,w,x,_,S;super(t,e),this._size=(null!==(n=null!==(o=null==t?void 0:t.size)&&void 0!==o?o:null==e?void 0:e.size)&&void 0!==n?n:null==i?void 0:i.size)||14,this._spaceBetweenTextAndIcon=(null!==(s=null!==(r=null==t?void 0:t.spaceBetweenTextAndIcon)&&void 0!==r?r:null==e?void 0:e.spaceBetweenTextAndIcon)&&void 0!==s?s:null==i?void 0:i.spaceBetweenTextAndIcon)||8,this._defaultFill=null!==(a=null===(l=null==t?void 0:t.checkboxStyle)||void 0===l?void 0:l.defaultFill)&&void 0!==a?a:null==i?void 0:i.defaultFill,this._defaultStroke=null!==(d=null===(h=null==t?void 0:t.checkboxStyle)||void 0===h?void 0:h.defaultStroke)&&void 0!==d?d:null==i?void 0:i.defaultStroke,this._disableFill=null!==(u=null===(c=null==t?void 0:t.checkboxStyle)||void 0===c?void 0:c.disableFill)&&void 0!==u?u:null==i?void 0:i.disableFill,this._checkedFill=null!==(p=null===(g=null==t?void 0:t.checkboxStyle)||void 0===g?void 0:g.checkedFill)&&void 0!==p?p:null==i?void 0:i.checkedFill,this._checkedStroke=null!==(m=null===(f=null==t?void 0:t.checkboxStyle)||void 0===f?void 0:f.checkedStroke)&&void 0!==m?m:null==i?void 0:i.checkedStroke,this._disableCheckedFill=null!==(v=null===(b=null==t?void 0:t.checkboxStyle)||void 0===b?void 0:b.disableCheckedFill)&&void 0!==v?v:null==i?void 0:i.disableCheckedFill,this._disableCheckedStroke=null!==(C=null===(y=null==t?void 0:t.checkboxStyle)||void 0===y?void 0:y.disableCheckedStroke)&&void 0!==C?C:null==i?void 0:i.disableCheckedStroke,this._checkIconImage=null!==(x=null===(w=null==t?void 0:t.checkboxStyle)||void 0===w?void 0:w.checkIconImage)&&void 0!==x?x:null==i?void 0:i.checkIconImage,this._indeterminateIconImage=null!==(S=null===(_=null==t?void 0:t.checkboxStyle)||void 0===_?void 0:_.indeterminateIconImage)&&void 0!==S?S:null==i?void 0:i.indeterminateIconImage}get size(){return this._size}set size(t){this._size=t}get spaceBetweenTextAndIcon(){return this._spaceBetweenTextAndIcon}set spaceBetweenTextAndIcon(t){this._spaceBetweenTextAndIcon=t}get defaultFill(){return this._defaultFill}set defaultFill(t){this._defaultFill=t}get defaultStroke(){return this._defaultStroke}set defaultStroke(t){this._defaultStroke=t}get disableFill(){return this._disableFill}set disableFill(t){this._disableFill=t}get checkedFill(){return this._checkedFill}set checkedFill(t){this._checkedFill=t}get checkedStroke(){return this._checkedStroke}set checkedStroke(t){this._checkedStroke=t}get disableCheckedFill(){return this._disableCheckedFill}set disableCheckedFill(t){this._disableCheckedFill=t}get disableCheckedStroke(){return this._disableCheckedStroke}set disableCheckedStroke(t){this._disableCheckedStroke=t}get checkIconImage(){return this._checkIconImage}set checkIconImage(t){this._checkIconImage=t}get indeterminateIconImage(){return this._indeterminateIconImage}set indeterminateIconImage(t){this._indeterminateIconImage=t}getStyle(e){return new t(e,this)}clone(){return new t(this)}};class bC extends cC{static get DEFAULT(){return pC||(pC=new bC)}constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};var o,n,r,s,l,a,h,d,c,u,g,p,f,m,b,v,y,C,w,x,_,S,A,B;super(t,e),this._size=(null!==(n=null!==(o=null==t?void 0:t.size)&&void 0!==o?o:null==e?void 0:e.size)&&void 0!==n?n:null==i?void 0:i.size)||14,this._spaceBetweenTextAndIcon=(null!==(s=null!==(r=null==t?void 0:t.spaceBetweenTextAndIcon)&&void 0!==r?r:null==e?void 0:e.spaceBetweenTextAndIcon)&&void 0!==s?s:null==i?void 0:i.spaceBetweenTextAndIcon)||8,this._spaceBetweenRadio=(null!==(a=null!==(l=null==t?void 0:t.spaceBetweenRadio)&&void 0!==l?l:null==e?void 0:e.spaceBetweenRadio)&&void 0!==a?a:null==i?void 0:i.spaceBetweenRadio)||2,this._innerRadius=null!==(d=null===(h=null==t?void 0:t.radioStyle)||void 0===h?void 0:h.innerRadius)&&void 0!==d?d:null==i?void 0:i.innerRadius,this._outerRadius=null!==(u=null===(c=null==t?void 0:t.radioStyle)||void 0===c?void 0:c.outerRadius)&&void 0!==u?u:null==i?void 0:i.outerRadius,this._defaultFill=null!==(p=null===(g=null==t?void 0:t.radioStyle)||void 0===g?void 0:g.defaultFill)&&void 0!==p?p:null==i?void 0:i.defaultFill,this._defaultStroke=null!==(m=null===(f=null==t?void 0:t.radioStyle)||void 0===f?void 0:f.defaultStroke)&&void 0!==m?m:null==i?void 0:i.defaultStroke,this._disableFill=null!==(v=null===(b=null==t?void 0:t.radioStyle)||void 0===b?void 0:b.disableFill)&&void 0!==v?v:null==i?void 0:i.disableFill,this._checkedFill=null!==(C=null===(y=null==t?void 0:t.radioStyle)||void 0===y?void 0:y.checkedFill)&&void 0!==C?C:null==i?void 0:i.checkedFill,this._checkedStroke=null!==(x=null===(w=null==t?void 0:t.radioStyle)||void 0===w?void 0:w.checkedStroke)&&void 0!==x?x:null==i?void 0:i.checkedStroke,this._disableCheckedFill=null!==(S=null===(_=null==t?void 0:t.radioStyle)||void 0===_?void 0:_.disableCheckedFill)&&void 0!==S?S:null==i?void 0:i.disableCheckedFill,this._disableCheckedStroke=null!==(B=null===(A=null==t?void 0:t.radioStyle)||void 0===A?void 0:A.disableCheckedStroke)&&void 0!==B?B:null==i?void 0:i.disableCheckedStroke}get size(){return this._size}set size(t){this._size=t}get spaceBetweenTextAndIcon(){return this._spaceBetweenTextAndIcon}set spaceBetweenTextAndIcon(t){this._spaceBetweenTextAndIcon=t}get spaceBetweenRadio(){return this._spaceBetweenRadio}set spaceBetweenRadio(t){this._spaceBetweenRadio=t}get innerRadius(){return this._innerRadius}set innerRadius(t){this._innerRadius=t}get outerRadius(){return this._outerRadius}set outerRadius(t){this._outerRadius=t}get defaultFill(){return this._defaultFill}set defaultFill(t){this._defaultFill=t}get defaultStroke(){return this._defaultStroke}set defaultStroke(t){this._defaultStroke=t}get disableFill(){return this._disableFill}set disableFill(t){this._disableFill=t}get checkedFill(){return this._checkedFill}set checkedFill(t){this._checkedFill=t}get checkedStroke(){return this._checkedStroke}set checkedStroke(t){this._checkedStroke=t}get disableCheckedFill(){return this._disableCheckedFill}set disableCheckedFill(t){this._disableCheckedFill=t}get disableCheckedStroke(){return this._disableCheckedStroke}set disableCheckedStroke(t){this._disableCheckedStroke=t}getStyle(t){return new bC(t,this)}clone(){return new bC(this)}}function vC(t,e,i){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:cC,n=arguments.length>4?arguments[4]:void 0,r=arguments.length>5?arguments[5]:void 0;var s,l;return t||e?t instanceof cC?t:"function"==typeof t?vC(t(i),e,i,o,n,r):(t||(t={}),n&&!Q(t.autoWrapText)&&(t.autoWrapText=!0),o===mC?new mC(null!=t?t:{},null!=e?e:{},null!==(s=r.checkboxStyle)&&void 0!==s?s:{}):o===bC?new bC(null!=t?t:{},null!=e?e:{},null!==(l=r.radioStyle)&&void 0!==l?l:{}):new o(null!=t?t:{},null!=e?e:{})):o.DEFAULT}const yC={CHANGE_STYLE:"change_style"};class CC extends sC{static get EVENT_TYPE(){return yC}static get DEFAULT(){return fC||(fC=new CC)}constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};var i,o,n,r,s,l,a,h,d,c,u,g,p,f,m,b,v,y,C,w,x,_,S,A,B,R,M,T,k,P,E,L;super(),this._defaultPadding=[10,16,10,16],this._color=null!==(i=t.color)&&void 0!==i?i:null==e?void 0:e.color,this._strokeColor=null!==(o=null==t?void 0:t.strokeColor)&&void 0!==o?o:null==e?void 0:e.strokeColor,this._fontSize=null!==(n=t.fontSize)&&void 0!==n?n:null==e?void 0:e.fontSize,this._fontFamily=null!==(r=t.fontFamily)&&void 0!==r?r:null==e?void 0:e.fontFamily,this._fontWeight=null!==(s=t.fontWeight)&&void 0!==s?s:null==e?void 0:e.fontWeight,this._fontVariant=null!==(l=t.fontVariant)&&void 0!==l?l:null==e?void 0:e.fontVariant,this._fontStyle=null!==(a=t.fontStyle)&&void 0!==a?a:null==e?void 0:e.fontStyle,this._textOverflow=(null!==(h=t.textOverflow)&&void 0!==h?h:null==e?void 0:e.textOverflow)||"ellipsis",this._textStick=null!==(c=null!==(d=t.textStick)&&void 0!==d?d:null==e?void 0:e.textStick)&&void 0!==c&&c,this._textStickBaseOnAlign=null!==(g=null!==(u=t.textStickBaseOnAlign)&&void 0!==u?u:null==e?void 0:e.textStickBaseOnAlign)&&void 0!==g&&g,this._marked=null!==(f=null!==(p=t.marked)&&void 0!==p?p:null==e?void 0:e.marked)&&void 0!==f&&f,this._textAlign=(null!==(m=t.textAlign)&&void 0!==m?m:null==e?void 0:e.textAlign)||"left",this._textBaseline=(null!==(b=t.textBaseline)&&void 0!==b?b:null==e?void 0:e.textBaseline)||"middle",this._bgColor=null!==(v=t.bgColor)&&void 0!==v?v:null==e?void 0:e.bgColor,this._padding=null!==(C=null!==(y=t.padding)&&void 0!==y?y:null==e?void 0:e.padding)&&void 0!==C?C:this._defaultPadding,this._borderColor=null!==(w=t.borderColor)&&void 0!==w?w:null==e?void 0:e.borderColor,this._lineHeight=null!==(x=t.lineHeight)&&void 0!==x?x:null==e?void 0:e.lineHeight,this._underline=null!==(_=t.underline)&&void 0!==_?_:null==e?void 0:e.underline,this._underlineColor=null!==(S=t.underlineColor)&&void 0!==S?S:null==e?void 0:e.underlineColor,this._underlineDash=null!==(A=t.underlineDash)&&void 0!==A?A:null==e?void 0:e.underlineDash,this._underlineOffset=null!==(B=t.underlineOffset)&&void 0!==B?B:null==e?void 0:e.underlineOffset,this._lineThrough=null!==(R=t.lineThrough)&&void 0!==R?R:null==e?void 0:e.lineThrough,this._lineThroughColor=null!==(M=t.lineThroughColor)&&void 0!==M?M:null==e?void 0:e.lineThroughColor,this._lineThroughDash=null!==(T=t.lineThroughDash)&&void 0!==T?T:null==e?void 0:e.lineThroughDash,this._linkColor=null!==(k=t.linkColor)&&void 0!==k?k:null==e?void 0:e.linkColor,this._cursor=null!==(P=t.cursor)&&void 0!==P?P:null==e?void 0:e.cursor,this._borderLineWidth=null!==(E=t.borderLineWidth)&&void 0!==E?E:null==e?void 0:e.borderLineWidth,this._borderLineDash=null!==(L=t.borderLineDash)&&void 0!==L?L:null==e?void 0:e.borderLineDash}get bgColor(){return this._bgColor}set bgColor(t){this._bgColor=t}get color(){return this._color}set color(t){this._color=t}get strokeColor(){return this._strokeColor}set strokeColor(t){this._strokeColor=t}get fontSize(){return this._fontSize}set fontSize(t){this._fontSize=t}get fontFamily(){return this._fontFamily}set fontFamily(t){this._fontFamily=t}get fontWeight(){return this._fontWeight}set fontWeight(t){this._fontWeight=t}get fontVariant(){return this._fontVariant}set fontVariant(t){this._fontVariant=t}get fontStyle(){return this._fontStyle}set fontStyle(t){this._fontStyle=t}get textOverflow(){return this._textOverflow}set textOverflow(t){this._textOverflow=t}get padding(){var t;return null!==(t=this._padding)&&void 0!==t?t:this._defaultPadding}set padding(t){this._padding=t}get borderColor(){return this._borderColor}set borderColor(t){this._borderColor=t}get textStick(){return this._textStick}set textStick(t){this._textStick=t}get textStickBaseOnAlign(){return this._textStickBaseOnAlign}set textStickBaseOnAlign(t){this._textStickBaseOnAlign=t}get marked(){return this._marked}set marked(t){this._marked=t}get textAlign(){return this._textAlign}set textAlign(t){this._textAlign=t}get textBaseline(){return this._textBaseline}set textBaseline(t){this._textBaseline=t}get lineHeight(){return this._lineHeight}set lineHeight(t){this._lineHeight=t}get underline(){return this._underline}set underline(t){this._underline=t}get underlineColor(){return this._underlineColor}set underlineColor(t){this._underlineColor=t}get underlineDash(){return this._underlineDash}set underlineDash(t){this._underlineDash=t}get underlineOffset(){return this._underlineOffset}set underlineOffset(t){this._underlineOffset=t}get lineThrough(){return this._lineThrough}set lineThrough(t){this._lineThrough=t}get lineThroughColor(){return this._lineThroughColor}set lineThroughColor(t){this._lineThroughColor=t}get lineThroughDash(){return this._lineThroughDash}set lineThroughDash(t){this._lineThroughDash=t}get linkColor(){return this._linkColor}set linkColor(t){this._linkColor=t}get cursor(){return this._cursor}set cursor(t){this._cursor=t}get borderLineWidth(){return this._borderLineWidth}set borderLineWidth(t){this._borderLineWidth=t}get borderLineDash(){return this._borderLineDash}set borderLineDash(t){this._borderLineDash=t}clone(){return new CC(this)}}let wC,xC;class _C extends CC{static get DEFAULT(){return wC||(wC=new _C)}constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;var i,o;super(t,e),this._autoWrapText=null!==(i=null==t?void 0:t.autoWrapText)&&void 0!==i?i:null==e?void 0:e.autoWrapText,this._lineClamp=null!==(o=null==t?void 0:t.lineClamp)&&void 0!==o?o:null==e?void 0:e.lineClamp}clone(){return new _C(this,null)}get lineClamp(){return this._lineClamp}set lineClamp(t){this._lineClamp=t}get autoWrapText(){return this._autoWrapText}set autoWrapText(t){this._autoWrapText=t}}class SC extends CC{static get DEFAULT(){return xC||(xC=new SC)}constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};var o,n,r,s,l,a,h,d,c,u,g,p,f,m,b,v,y,C,w,x,_,S;super(t,e),this._size=(null!==(n=null!==(o=null==t?void 0:t.size)&&void 0!==o?o:null==e?void 0:e.size)&&void 0!==n?n:null==i?void 0:i.size)||14,this._spaceBetweenTextAndIcon=(null!==(s=null!==(r=null==t?void 0:t.spaceBetweenTextAndIcon)&&void 0!==r?r:null==e?void 0:e.spaceBetweenTextAndIcon)&&void 0!==s?s:null==i?void 0:i.spaceBetweenTextAndIcon)||8,this._defaultFill=null!==(a=null===(l=null==t?void 0:t.checkboxStyle)||void 0===l?void 0:l.defaultFill)&&void 0!==a?a:null==i?void 0:i.defaultFill,this._defaultStroke=null!==(d=null===(h=null==t?void 0:t.checkboxStyle)||void 0===h?void 0:h.defaultStroke)&&void 0!==d?d:null==i?void 0:i.defaultStroke,this._disableFill=null!==(u=null===(c=null==t?void 0:t.checkboxStyle)||void 0===c?void 0:c.disableFill)&&void 0!==u?u:null==i?void 0:i.disableFill,this._checkedFill=null!==(p=null===(g=null==t?void 0:t.checkboxStyle)||void 0===g?void 0:g.checkedFill)&&void 0!==p?p:null==i?void 0:i.checkedFill,this._checkedStroke=null!==(m=null===(f=null==t?void 0:t.checkboxStyle)||void 0===f?void 0:f.checkedStroke)&&void 0!==m?m:null==i?void 0:i.checkedStroke,this._disableCheckedFill=null!==(v=null===(b=null==t?void 0:t.checkboxStyle)||void 0===b?void 0:b.disableCheckedFill)&&void 0!==v?v:null==i?void 0:i.disableCheckedFill,this._disableCheckedStroke=null!==(C=null===(y=null==t?void 0:t.checkboxStyle)||void 0===y?void 0:y.disableCheckedStroke)&&void 0!==C?C:null==i?void 0:i.disableCheckedStroke,this._checkIconImage=null!==(x=null===(w=null==t?void 0:t.checkboxStyle)||void 0===w?void 0:w.checkIconImage)&&void 0!==x?x:null==i?void 0:i.checkIconImage,this._indeterminateIconImage=null!==(S=null===(_=null==t?void 0:t.checkboxStyle)||void 0===_?void 0:_.indeterminateIconImage)&&void 0!==S?S:null==i?void 0:i.indeterminateIconImage}get size(){return this._size}set size(t){this._size=t}get spaceBetweenTextAndIcon(){return this._spaceBetweenTextAndIcon}set spaceBetweenTextAndIcon(t){this._spaceBetweenTextAndIcon=t}get defaultFill(){return this._defaultFill}set defaultFill(t){this._defaultFill=t}get defaultStroke(){return this._defaultStroke}set defaultStroke(t){this._defaultStroke=t}get disableFill(){return this._disableFill}set disableFill(t){this._disableFill=t}get checkedFill(){return this._checkedFill}set checkedFill(t){this._checkedFill=t}get checkedStroke(){return this._checkedStroke}set checkedStroke(t){this._checkedStroke=t}get disableCheckedFill(){return this._disableCheckedFill}set disableCheckedFill(t){this._disableCheckedFill=t}get disableCheckedStroke(){return this._disableCheckedStroke}set disableCheckedStroke(t){this._disableCheckedStroke=t}get checkIconImage(){return this._checkIconImage}set checkIconImage(t){this._checkIconImage=t}get indeterminateIconImage(){return this._indeterminateIconImage}set indeterminateIconImage(t){this._indeterminateIconImage=t}getStyle(t){return new SC(t,this)}clone(){return new SC(this)}}function AC(t,e,i,o,n,r){var s;return t||e?t instanceof CC?t:"function"==typeof t?AC(t(i),e,i,o,n,r):(t||(t={}),n&&!Q(t.autoWrapText)&&(t.autoWrapText=!0),o===SC?new SC(null!=t?t:{},null!=e?e:{},null!==(s=r.checkboxStyle)&&void 0!==s?s:{}):new o(null!=t?t:{},null!=e?e:{})):o.DEFAULT}let BC=class t{static get mode(){return t._mode||(t._mode=function(){let t="browser";try{"node"===window.type?t="node":"undefined"==typeof window||window.performance?"undefined"==typeof window&&(t="node"):t="miniApp"}catch(e){t="node"}return t}()),t._mode}static set mode(e){t._mode=e}static RegisterCreateCanvas(e){t.CreateCanvas=e}static RegisterLoadImage(e){t.LoadImage=e}static GetCreateCanvasFunc(){return t.CreateCanvas?t.CreateCanvas:"worker"===t.mode?function(){return new OffscreenCanvas(arguments.length>0&&void 0!==arguments[0]?arguments[0]:200,arguments.length>1&&void 0!==arguments[1]?arguments[1]:200)}:void 0}static RegisterRequestAnimationFrame(e){t.RequestAnimationFrame=e()}static GetRequestAnimationFrame(){if(t.RequestAnimationFrame)return t.RequestAnimationFrame}static RegisterCancelAnimationFrame(e){t.CancelAnimationFrame=e()}static GetCancelAnimationFrame(){if(t.CancelAnimationFrame)return t.CancelAnimationFrame}};BC.dpr=0;const RC=(t,e)=>(t=>{switch(Object.prototype.toString.call(t)){case"[object Object]":return"object";case"[object Function]":return"function";case"[object Array]":return"array";case"[object String]":return"string";case"[object Number]":return"number";case"[object RegExp]":return"regExp";case"[object Boolean]":return"boolean";case"[object Symbol]":return"symbol";case"[object Date]":return"date";case"[object Undefined]":return"undefined";case"[object Null]":return"null";case"[object Error]":return"error";case"[object HTMLDocument]":return"document";case"[object global]":return"global";default:return null}})(t)===e,MC=t=>RC(t,"object"),TC=t=>RC(t,"string"),kC=t=>RC(t,"number"),PC=t=>RC(t,"boolean");function EC(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),o=1;o<e;o++)i[o-1]=arguments[o];if(!i.length)return t||{};const n=i.shift();if(MC(t)&&MC(n))for(const e in n)MC(n[e])?(t[e]||Object.assign(t,{[e]:{}}),MC(t[e])||Object.assign(t,{[e]:n[e]}),EC(t[e],n[e])):null!==n[e]&&void 0!==n[e]&&Object.assign(t,{[e]:n[e]});return EC(t,...i)}function LC(t){return"function"==typeof t&&(t=t()),Q(t)?`${t}`:""}function HC(t,e){let i=null;return function(){for(var o=arguments.length,n=new Array(o),r=0;r<o;r++)n[r]=arguments[r];i||(t.apply(this,n),i=setTimeout((()=>{i=null}),e))}}function zC(t,e){for(t=`${t}`;t.length<e;)t="0"+t;return t}function FC(t,e,i){t=(t=t.replace(/^\s*|\s*$/,"")).replace(/^#?([a-f0-9])([a-f0-9])([a-f0-9])$/i,"#$1$1$2$2$3$3");const o=Math.round(256*e)*(i?-1:1),n=t.match(new RegExp("^rgba?\\(\\s*(\\d|[1-9]\\d|1\\d{2}|2[0-4][0-9]|25[0-5])\\s*,\\s*(\\d|[1-9]\\d|1\\d{2}|2[0-4][0-9]|25[0-5])\\s*,\\s*(\\d|[1-9]\\d|1\\d{2}|2[0-4][0-9]|25[0-5])(?:\\s*,\\s*(0|1|0?\\.\\d+))?\\s*\\)$","i")),r=n&&Q(n[4])?n[4]:null,s=n?[n[1],n[2],n[3]]:t.replace(/^#?([a-f0-9][a-f0-9])([a-f0-9][a-f0-9])([a-f0-9][a-f0-9])/i,(function(){return`${parseInt(arguments[1],16)},${parseInt(arguments[2],16)},${parseInt(arguments[3],16)}`})).split(/,/);return n?`rgb${null!==r?"a":""}(${Math[i?"max":"min"](parseInt(s[0],10)+o,i?0:255)}, ${Math[i?"max":"min"](parseInt(s[1],10)+o,i?0:255)}, ${Math[i?"max":"min"](parseInt(s[2],10)+o,i?0:255)}${null!==r?`, ${r}`:""})`:["#",zC(Math[i?"max":"min"](parseInt(s[0],10)+o,i?0:255).toString(16),2),zC(Math[i?"max":"min"](parseInt(s[1],10)+o,i?0:255).toString(16),2),zC(Math[i?"max":"min"](parseInt(s[2],10)+o,i?0:255).toString(16),2)].join("")}function IC(t){return TC(t)||kC(t)||PC(t)?t.toString():""}function OC(){return navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i)}function DC(t,e,i){return"desc"!==i?t===e?0:t>e?1:-1:t===e?0:t<e?1:-1}function WC(t){const e=[];for(let i=0;i<t.length;i++)-1===e.indexOf(t[i])&&e.push(t[i]);return e}const NC="undefined"==typeof window||void 0===window.window;let GC,jC;const VC={get find(){return GC||(GC=Array.prototype.find?(t,e)=>Array.prototype.find.call(t,e):(t,e)=>{const i=VC.findIndex(t,e);return i>=0?t[i]:void 0},GC)},get findIndex(){return jC||(jC=Array.prototype.findIndex?(t,e)=>Array.prototype.findIndex.call(t,e):(t,e)=>{const{length:i}=t;for(let o=0;o<i;o++)if(e(t[o],o,t))return o;return-1},jC)}};const{IE:UC,Chrome:$C,Firefox:XC,Edge:YC,Safari:KC}=function(){if(NC)return{IE:!1,Edge:!1,Chrome:!1,Firefox:!1,Safari:!1};const t=window.navigator.userAgent.toLowerCase();return{IE:!!/(msie|trident)/.exec(t),Edge:t.indexOf("edge")>-1,Chrome:t.indexOf("chrome")>-1&&-1===t.indexOf("edge"),Firefox:t.indexOf("firefox")>-1,Safari:t.indexOf("safari")>-1&&-1===t.indexOf("edge")}}();function qC(){const t={};for(var e=arguments.length,i=new Array(e),o=0;o<e;o++)i[o]=arguments[o];return i.forEach((e=>{for(const i in e)Object.defineProperty(t,i,{get:()=>e[i],set(t){e[i]=t},configurable:!0,enumerable:!0})})),t}function ZC(t,e){let i=t;for(let t=0;t<(arguments.length<=2?0:arguments.length-2)&&null!=i;t++)i=e(i,t+2<2||arguments.length<=t+2?void 0:arguments[t+2]);return i}function JC(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),o=1;o<e;o++)i[o-1]=arguments[o];return ZC(t,((t,e)=>t[e]),...i)}function QC(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),o=1;o<e;o++)i[o-1]=arguments[o];return"function"==typeof t?t(...i):t}function tw(t){return Boolean(t&&"function"==typeof t.then)}function ew(t,e){tw(t)?t.then((t=>{e(t)})).catch((t=>{})):e(t)}function iw(t,e,i){return t.start.col<=e&&e<=t.end.col&&t.start.row<=i&&i<=t.end.row||t.end.col<=e&&e<=t.start.col&&t.end.row<=i&&i<=t.start.row}function ow(t){return{start:{col:Math.min(t.start.col,t.end.col),row:Math.min(t.start.row,t.end.row)},end:{col:Math.max(t.start.col,t.end.col),row:Math.max(t.start.row,t.end.row)}}}function nw(t,e){const i=ow(t),o=ow(e);return Math.max(i.start.col,o.start.col)<=Math.min(i.end.col,o.end.col)&&Math.max(i.start.row,o.start.row)<=Math.min(i.end.row,o.end.row)}const rw=UC,sw={isObject:function(t){return t===Object(t)}},lw={endsWith:function(t,e,i){const o=IC(t);("number"!=typeof i||!isFinite(i)||Math.floor(i)!==i||i>o.length)&&(i=o.length),i-=e.length;const n=o.lastIndexOf(e,i);return-1!==n&&n===i}},aw={isTouchEvent:function(t){return!!t.changedTouches}},hw={toBoxArray:function(t){return Array.isArray(t)?3===t.length?[t[0],t[1],t[2],t[1]]:2===t.length?[t[0],t[1],t[0],t[1]]:1===t.length?[t[0],t[0],t[0],t[0]]:[t[0],t[1],t[2],t[3]]:[t,t,t,t]}},dw=Function.prototype,cw={CLICK_CELL:"click_cell",DBLCLICK_CELL:"dblclick_cell",MOUSEDOWN_CELL:"mousedown_cell",MOUSEUP_CELL:"mouseup_cell",SELECTED_CELL:"selected_cell",SELECTED_CLEAR:"selected_clear",KEYDOWN:"keydown",MOUSEENTER_TABLE:"mouseenter_table",MOUSELEAVE_TABLE:"mouseleave_table",MOUSEDOWN_TABLE:"mousedown_table",MOUSEMOVE_CELL:"mousemove_cell",MOUSEENTER_CELL:"mouseenter_cell",MOUSELEAVE_CELL:"mouseleave_cell",CONTEXTMENU_CELL:"contextmenu_cell",RESIZE_COLUMN:"resize_column",RESIZE_COLUMN_END:"resize_column_end",RESIZE_ROW:"resize_row",RESIZE_ROW_END:"resize_row_end",CHANGE_HEADER_POSITION:"change_header_position",SORT_CLICK:"sort_click",FREEZE_CLICK:"freeze_click",SCROLL:"scroll",SCROLL_HORIZONTAL_END:"scroll_horizontal_end",SCROLL_VERTICAL_END:"scroll_vertical_end",DROPDOWN_MENU_CLICK:"dropdown_menu_click",MOUSEOVER_CHART_SYMBOL:"mouseover_chart_symbol",DRAG_SELECT_END:"drag_select_end",COPY_DATA:"copy_data",DROPDOWN_ICON_CLICK:"dropdown_icon_click",DROPDOWN_MENU_CLEAR:"dropdown_menu_clear",TREE_HIERARCHY_STATE_CHANGE:"tree_hierarchy_state_change",SHOW_MENU:"show_menu",HIDE_MENU:"hide_menu",ICON_CLICK:"icon_click",LEGEND_ITEM_CLICK:"legend_item_click",LEGEND_ITEM_HOVER:"legend_item_hover",LEGEND_ITEM_UNHOVER:"legend_item_unHover",LEGEND_CHANGE:"legend_change",MOUSEENTER_AXIS:"mouseenter_axis",MOUSELEAVE_AXIS:"mouseleave_axis",CHECKBOX_STATE_CHANGE:"checkbox_state_change",RADIO_STATE_CHANGE:"radio_state_change",AFTER_RENDER:"after_render",INITIALIZED:"initialized",CHANGE_CELL_VALUE:"change_cell_value",DRAG_FILL_HANDLE_END:"drag_fill_handle_end",MOUSEDOWN_FILL_HANDLE:"mousedown_fill_handle",DBLCLICK_FILL_HANDLE:"dblclick_fill_handle"},uw=(t,e)=>(t=>{switch(Object.prototype.toString.call(t)){case"[object Object]":return"object";case"[object Function]":return"function";case"[object Array]":return"array";case"[object String]":return"string";case"[object Number]":return"number";case"[object RegExp]":return"regExp";case"[object Boolean]":return"boolean";case"[object Symbol]":return"symbol";case"[object Date]":return"date";case"[object Undefined]":return"undefined";case"[object Null]":return"null";case"[object Error]":return"error";case"[object HTMLDocument]":return"document";case"[object global]":return"global";default:return null}})(t)===e;function gw(t,e,i){let o,n,r,s,l,a,h=0,d=!1,c=!1,u=!0;const g=!e&&0!==e&&"function"==typeof requestAnimationFrame;if("function"!=typeof t)throw new TypeError("Expected a function");function p(e){const i=o,r=n;return n=void 0,o=void 0,h=e,s=t.apply(r,i),s}function f(t,e){return g?requestAnimationFrame(t):setTimeout(t,e)}function m(t){const i=t-a;return void 0===a||i>=e||i<0||d&&t-h>=r}function b(){const t=Date.now();if(m(t))return function(t){return l=void 0,u&&o?p(t):(n=void 0,o=void 0,s)}(t);l=f(b,function(t){const i=t-h,o=e&&-(t-a);return d?Math.min(o,r-i):o}(t))}return e=+e||0,uw(i,"object")&&(c=!!i.leading,d="maxWait"in i,d&&(r=Math.max(+i.maxWait||0,e)),u="trailing"in i?!!i.trailing:u),function(){const t=Date.now(),i=m(t);for(var r=arguments.length,u=new Array(r),g=0;g<r;g++)u[g]=arguments[g];if(o=u,n=this,a=t,i){if(void 0===l)return function(t){return h=t,l=f(b,e),c?p(t):s}(a);if(d)return l=f(b,e),p(a)}return void 0===l&&(l=f(b,e)),s}}let pw=1,fw=class{constructor(){this.listeners={},this.reseizeListeners={}}on(t,e,i){if("node"===BC.mode)return-1;const o=pw++;for(var n=arguments.length,r=new Array(n>3?n-3:0),s=3;s<n;s++)r[s-3]=arguments[s];if(null==t?void 0:t.addEventListener)if("resize"!==e||t===window)null==t||t.addEventListener(e,i,...r);else{const e=new class{constructor(t,e,i){var o;if(this.resizeTime=100,this.lastSize={width:0,height:0},this.mutationResize=()=>{this.onResize()},this.callBack=()=>{const t=this.getSize();let e=!1;t.width===this.lastSize.width&&t.height===this.lastSize.height&&(e=!0),this.lastSize=t,this.cb&&this.cb(Object.assign(Object.assign({},this.lastSize),{windowSizeNotChange:e}))},this.onResize=()=>{this.callBackDebounce()},this.element=t,this.cb=e,this.lastSize=this.getSize(),i&&(this.resizeTime=Math.max(i,16)),this.callBackDebounce=gw(this.callBack,this.resizeTime),null===window||void 0===window||window.addEventListener("resize",this.onResize),"ResizeObserver"in window){const t=window.ResizeObserver;this.observer=new t(this.mutationResize),null===(o=this.observer)||void 0===o||o.observe(this.element)}else"MutationObserver"in window&&(this.observer=new MutationObserver(this.mutationResize),this.observer.observe(this.element,{attributes:!0,attributeFilter:["style"]}))}disConnect(){window.removeEventListener("resize",this.onResize),this.observer&&(this.observer.disconnect(),this.observer=void 0)}setSize(t){this.lastSize=t}checkSize(){const t=this.getSize();return t.width!==this.lastSize.width||t.height!==this.lastSize.height}getSize(){return this.element?{width:Math.floor(this.element.clientWidth),height:Math.floor(this.element.clientHeight)}:Object.assign({},this.lastSize)}}(t,i,this.resizeTime);this.reseizeListeners[o]=e}const l={target:t,type:e,listener:i,options:r};return this.listeners[o]=l,o}once(t,e,i){var o=this;if("node"===BC.mode)return-1;for(var n=arguments.length,r=new Array(n>3?n-3:0),s=3;s<n;s++)r[s-3]=arguments[s];const l=this.on(t,e,(function(){o.off(l),i(...arguments)}),...r);return l}off(t){var e;if("node"===BC.mode)return;if(null==t)return;const i=null===(e=this.listeners)||void 0===e?void 0:e[t];i&&(delete this.listeners[t],i.target.removeEventListener&&i.target.removeEventListener(i.type,i.listener,...i.options))}fire(t,e){if("node"!==BC.mode){for(var i=arguments.length,o=new Array(i>2?i-2:0),n=2;n<i;n++)o[n-2]=arguments[n];for(const i in this.listeners){const n=this.listeners[i];n.target===t&&n.type===e&&n.listener.call(n.target,...o)}}}hasListener(t,e){if("node"===BC.mode)return!1;let i=!1;for(const o in this.listeners){const n=this.listeners[o];n.target===t&&n.type===e&&(i=!0)}return i}clear(){if("node"!==BC.mode){for(const t in this.listeners){const e=this.listeners[t];e.target.removeEventListener&&e.target.removeEventListener(e.type,e.listener,...e.options)}for(const t in this.reseizeListeners){const e=this.reseizeListeners[t];null==e||e.disConnect()}this.listeners={}}}release(){"node"!==BC.mode&&(this.clear(),this.listeners={})}};const mw=(t,e)=>{let i=0,o=t.length-1;for(;i<=o;){const n=Math.floor((i+o)/2);if(t[n]===e)return n;t[n]>e?o=n-1:i=n+1}return o<0?0:o};class bw{constructor(){this._keys=[],this._vals={},this._sorted=!1}count(){return this._keys.length}values(){return this._vals}valueArr(){return Object.values(this._vals)}adjustOrder(t,e,i){const{_keys:o}=this;if(this._sorted||(o.sort(((t,e)=>t<e?-1:t>e?1:0)),this._sorted=!0),t>e){const n=[];for(let r=mw(o,t+i-1);r>=0;r--){const s=o[r];if(s>=t)n.push(this.get(s));else if(e<=s&&s<t)this.put(s+i,this.get(s));else if(s<e)break}for(let t=0;t<i;t++)this.put(e+t,n[i-1-t])}const{length:n}=o;if(t<e){const r=[];for(let s=mw(o,t);s<n;s++){const n=o[s];if(n>=t&&n<t+i)r.push(this.get(n));else if(t+i<=n&&n<=e)this.put(n-i,this.get(n));else if(n>e)break}for(let t=0;t<i;t++)this.put(e+t,r[t])}}exchangeOrder(t,e,i,o,n){const{_keys:r}=this;if(this._sorted||(r.sort(((t,e)=>t<e?-1:t>e?1:0)),this._sorted=!0),t>i){const o=[],s=[];for(let n=mw(r,i);n<t+e;n++){const i=r[n];i>=t&&i<t+e?s.push(this.get(i)):o.push(this.get(i))}for(let t=0;t<e;t++)this.put(n+t,s[t]);for(let t=0;t<o.length;t++)this.put(n+e+t,o[t])}else{const s=[],l=[];for(let n=mw(r,t);n<i+o;n++){const i=r[n];i>=t&&i<t+e?l.push(this.get(i)):s.push(this.get(i))}for(let t=0;t<e;t++)this.put(n+t,l[t]);for(let e=0;e<s.length;e++)this.put(t+e,s[e])}}del(t){delete this._vals[t];const e=this._keys.indexOf(t);-1!==e&&this._keys.splice(e,1)}put(t,e){t in this._vals||(this._keys.push(t),this._sorted=!1),this._vals[t]=e}get(t){return this._vals[t]}has(t){return Q(this._vals[t])}contain(t){return Object.values(this._vals).indexOf(t)>=0}each(t,e,i){const{_keys:o}=this,{length:n}=o;this._sorted||(o.sort(((t,e)=>t<e?-1:t>e?1:0)),this._sorted=!0);for(let r=mw(o,t);r<n;r++){const n=o[r];if(t<=n&&n<=e){if(!1===i(this.get(n),n))break}else if(e<n)return}}clear(){this._keys.length=0,this._vals={},this._sorted=!1}getLastIndex(){return this._keys[this._keys.length-1]}delLast(){const t=this.getLastIndex();this.del(t)}delAndReorder(t){if(!this.has(t))return;const e=this.getLastIndex();this.adjustOrder(t+1,t,e-t),this.delLast()}addAndReorder(t,e){const i=this.getLastIndex();this.adjustOrder(t,t+1,i-t),Q(e)&&this.put(t,e)}}class vw{constructor(t,e,i,o){this.bounds=new ye,this.bounds.set(t,e,t+i,e+o)}static bounds(t,e,i,o){return new vw(t,e,Math.round(i-t),Math.round(o-e))}get left(){return this.bounds.x1}set left(t){this.bounds.x1=t}get top(){return this.bounds.y1}set top(t){this.bounds.y1=t}get right(){return this.bounds.x2}set right(t){this.bounds.x2=t}get bottom(){return this.bounds.y2}set bottom(t){this.bounds.y2=t}get width(){return this.bounds.width()}set width(t){this.bounds.x2=this.bounds.x1+t}get height(){return this.bounds.height()}set height(t){this.bounds.y2=this.bounds.y1+t}offsetLeft(t){this.bounds.translate(t,0)}offsetTop(t){this.bounds.translate(0,t)}copy(){return new vw(this.left,this.top,this.width,this.height)}contains(t){return this.bounds.encloses(t.bounds)}inPoint(t,e){return this.bounds.contains(t,e)}}var yw={underlayBackgroundColor:"transparent",defaultStyle:{color:"#D3D5DA",bgColor:"#373b45",fontSize:12,fontFamily:"PingFang SC",fontWeight:500,lineHeight:12,borderColor:"#444A54",padding:[8,12,8,12],hover:{cellBgColor:"#2F4774"}},headerStyle:{color:"#D3D5DA",bgColor:"#373b45",fontSize:12,fontFamily:"PingFang SC",fontWeight:500,lineHeight:12,borderColor:"#444A54",padding:[8,12,8,12],hover:{cellBgColor:"#2F4774"}},rowHeaderStyle:{},cornerHeaderStyle:{},bodyStyle:{color:"#e5e7ea",bgColor:function(t){const{row:e,table:i}=t;return 1&e-i.frozenRowCount?"#282a2e":"#2d3137"},fontSize:12,fontFamily:"PingFang SC",fontWeight:500,lineHeight:12,borderColor:"#444A54",padding:[8,12,8,12],hover:{cellBgColor:"#29364D"}},frameStyle:{borderColor:"#d1d5da",borderLineWidth:1,borderLineDash:[],cornerRadius:10,shadowBlur:6,shadowOffsetX:0,shadowOffsetY:0,shadowColor:"rgba(00, 24, 47, 0.06)"},columnResize:{lineWidth:1,lineColor:"#416EFF",bgColor:"#D9E2FF",width:3},frozenColumnLine:{shadow:{width:4,startColor:"rgba(00, 24, 47, 0.05)",endColor:"rgba(00, 24, 47, 0)"}},selectionStyle:{cellBgColor:"rgba(255, 255, 255, 0.1)",cellBorderColor:"#4284FF",cellBorderLineWidth:2},tooltipStyle:{bgColor:"#FFF",color:"#000",fontSize:12,fontFamily:"Arial,sans-serif"}};var Cw={underlayBackgroundColor:"#FFF",defaultStyle:{color:"#FFF",bgColor:"#5389FF",borderColor:"#5286FA",hover:{cellBgColor:"#2E67E3"}},headerStyle:{color:"#FFF",bgColor:"#5389FF",borderColor:"#A1C1FF",hover:{cellBgColor:"#2E67E3"}},bodyStyle:{color:"#000",bgColor:function(t){const{row:e,table:i}=t;return 1&e-i.frozenRowCount?"#FFF":"#F4F8FF"},borderColor:"#E0EAFE",hover:{cellBgColor:"#E9EFFD"}},frameStyle:{borderColor:"#E1E4E8",borderLineWidth:1,borderLineDash:[],cornerRadius:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,shadowColor:"black"},columnResize:{lineWidth:1,lineColor:"#416EFF",bgColor:"#D9E2FF",width:3},frozenColumnLine:{shadow:{width:3,startColor:"#CBDCFE",endColor:"#CBDCFE"}},selectionStyle:{cellBgColor:"rgba(0, 0, 255,0.1)"},tooltipStyle:{bgColor:"#FFF",color:"#000",fontSize:12,fontFamily:"Arial,sans-serif"}};var ww={underlayBackgroundColor:"#FFF",defaultStyle:{color:"#1B1F23",bgColor:"#EEF1F5",fontSize:14,fontFamily:"Arial,sans-serif",fontWeight:600,lineHeight:14,borderColor:"#e1e4e8",padding:[8,12,8,12]},headerStyle:{color:"#1B1F23",bgColor:"#EEF1F5",fontSize:14,fontFamily:"Arial,sans-serif",fontWeight:600,lineHeight:14,borderColor:"#e1e4e8",padding:[8,12,8,12],hover:{cellBgColor:"#c8daf6"}},rowHeaderStyle:{color:"#1B1F23",bgColor:"#EEF1F5",fontSize:12,fontFamily:"PingFang SC",fontWeight:500,lineHeight:12,borderColor:"#e1e4e8",padding:[8,12,8,12],hover:{cellBgColor:"#c8daf6"}},cornerHeaderStyle:{color:"#1B1F23",bgColor:"#EEF1F5",fontSize:12,fontFamily:"PingFang SC",fontWeight:500,lineHeight:12,borderColor:"#e1e4e8",padding:[8,12,8,12],hover:{cellBgColor:"#c8daf6"}},bodyStyle:{padding:[8,12,8,12],color:"#141414",fontSize:14,fontFamily:"Arial,sans-serif",fontWeight:400,textAlign:"left",bgColor:function(t){const{row:e,table:i}=t;return 1&e-i.frozenRowCount?"#fbfbfc":"#FFF"},borderColor:"#e1e4e8",lineHeight:14,hover:{cellBgColor:"#F7F8FA",inlineRowBgColor:"#F3F8FF",inlineColumnBgColor:"#F3F8FF"}},frameStyle:{borderColor:"#d1d5da",borderLineWidth:1,borderLineDash:[],cornerRadius:4,shadowBlur:6,shadowOffsetX:0,shadowOffsetY:0,shadowColor:"rgba(00, 24, 47, 0.06)"},columnResize:{lineWidth:1,lineColor:"#416EFF",bgColor:"#D9E2FF",width:3},frozenColumnLine:{shadow:{width:4,startColor:"rgba(00, 24, 47, 0.05)",endColor:"rgba(00, 24, 47, 0)"}},selectionStyle:{cellBgColor:"rgba(0, 0, 255,0.1)",cellBorderLineWidth:2,cellBorderColor:"#3073f2"},tooltipStyle:{bgColor:"#FFF",color:"#000",fontSize:12,fontFamily:"Arial,sans-serif"}};var xw={underlayBackgroundColor:"#FFF",defaultStyle:{borderColor:"#E1E4E8",color:"#000",bgColor:"#ECF1F5"},headerStyle:{fontSize:16,fontWeight:"bold",bgColor:"#ECF1F5",hover:{cellBgColor:"#CCE0FF",inlineRowBgColor:"#F3F8FF",inlineColumnBgColor:"#F3F8FF"}},rowHeaderStyle:{fontSize:16,fontWeight:"bold",bgColor:"#ECF1F5",hover:{cellBgColor:"#CCE0FF",inlineRowBgColor:"#F3F8FF",inlineColumnBgColor:"#F3F8FF"}},cornerHeaderStyle:{fontSize:16,fontWeight:"bold"},bodyStyle:{fontSize:14,bgColor:function(t){const{row:e,table:i}=t;return 1&e-i.frozenRowCount?"#FDFDFD":"#FAF9FB"},hover:{cellBgColor:"#CCE0FF",inlineRowBgColor:"#F3F8FF",inlineColumnBgColor:"#F3F8FF"}},frameStyle:{borderColor:"#E1E4E8",borderLineWidth:1,borderLineDash:[],cornerRadius:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,shadowColor:"black"},columnResize:{lineWidth:1,lineColor:"#416EFF",bgColor:"#D9E2FF",width:3},frozenColumnLine:{shadow:{width:3,startColor:"rgba(225, 228, 232, 0.6)",endColor:"rgba(225, 228, 232, 0.6)"}},selectionStyle:{cellBgColor:"rgba(0, 0, 255,0.1)",cellBorderLineWidth:2,cellBorderColor:"#0000ff"},tooltipStyle:{bgColor:"#FFF",color:"#000",fontSize:12,fontFamily:"Arial,sans-serif"}};var _w={underlayBackgroundColor:"#FFF",defaultStyle:{borderColor:function(t){const{col:e,table:i}=t,{colCount:o,frozenColCount:n}=i,r="#ccc7c7";return n-1===e||o-1===e?[r,"#f2f2f2","#ccc7c7",null]:[r,null,"#ccc7c7",null]},hover:{cellBorderColor:"#0000FF",cellBgColor:"#D0E0E3"},bgColor:"#FFF"},headerStyle:{color:"rgba(0, 0, 0, 0.87)",borderColor:function(t){const{row:e,table:{frozenRowCount:i}}=t;return i-1===e?["#f2f2f2","#f2f2f2","#ccc7c7","#f2f2f2"]:["#f2f2f2"]}},bodyStyle:{color:"rgba(0, 0, 0, 0.87)"},frameStyle:{borderColor:"#f2f2f2",borderLineWidth:1},columnResize:{lineWidth:1,lineColor:"#416EFF",bgColor:"#D9E2FF"},selectionStyle:{cellBorderColor:"#FD5",cellBgColor:"rgba(111, 168, 220, 0.1)"},tooltipStyle:{bgColor:"#FFF",color:"#000",fontSize:12,fontFamily:"Arial,sans-serif"}};const Sw={},Aw="Arial,sans-serif",Bw=[],Rw=/^(https?|ftp|file):\/\/[-A-Za-z0-9+&@#/%?=~_|!:,.;]+[-A-Za-z0-9+&@#/%=~_|]/,Mw="$$indicator$$",Tw={type:"line"};function kw(t){return t||{}}const Pw={visible:!0,position:"auto",padding:8,titleStyle:{fontSize:12,fontWeight:"bold",fill:"#4E5969"},contentStyle:{fontSize:12,fill:"#4E5969"},panel:{visible:!0,fill:"#fff",stroke:"#ffffff",lineWidth:0,cornerRadius:3,shadowBlur:12,shadowOffsetX:0,shadowOffsetY:4,shadowColor:"rgba(0, 0, 0, 0.1)",size:0,space:12}};function Ew(t,e,i,o){var n,r,s;return null!==(s=null!==(r=null!==(n=JC(t,...i))&&void 0!==n?n:JC(e,...i))&&void 0!==r?r:o&&JC(t,...o))&&void 0!==s?s:o&&JC(e,...o)}class Lw{constructor(t,e){this._defaultStyle=null,this._header=null,this._cornerHeader=null,this._cornerRightTopCell=null,this._cornerLeftBottomCell=null,this._cornerRightBottomCell=null,this._rightFrozen=null,this._bottomFrozen=null,this._rowHeader=null,this._body=null,this._scroll=null,this._tooltip=null,this._frameStyle=null,this._columnResize=null,this._dragHeaderSplitLine=null,this._frozenColumnLine=null,this._selectionStyle=null,this._axisStyle=null,this._checkboxStyle=null,this._radioStyle=null,this._textPopTipStyle=null,this.isPivot=!1,this.internalTheme={obj:t,superTheme:e}}get font(){const{obj:t,superTheme:e}=this.internalTheme;return Ew(t,e,["font"],["bodyStyle","font"])}get underlayBackgroundColor(){const{obj:t,superTheme:e}=this.internalTheme;return Ew(t,e,["underlayBackgroundColor"])}get cellInnerBorder(){var t;const{obj:e,superTheme:i}=this.internalTheme;return null===(t=Ew(e,i,["cellInnerBorder"]))||void 0===t||t}get cellBorderClipDirection(){var t;const{obj:e,superTheme:i}=this.internalTheme;return null!==(t=Ew(e,i,["cellBorderClipDirection"]))&&void 0!==t?t:"top-left"}get _contentOffset(){var t;const{obj:e,superTheme:i}=this.internalTheme;return null!==(t=Ew(e,i,["_contentOffset"]))&&void 0!==t?t:0}get defaultStyle(){const t=this;if(!this._defaultStyle){const{obj:e,superTheme:i}=this.internalTheme,o=EC({},i.defaultStyle,e.defaultStyle);this._defaultStyle={get fontSize(){var t;return null!==(t=o.fontSize)&&void 0!==t?t:16},get fontFamily(){var t;return null!==(t=o.fontFamily)&&void 0!==t?t:Aw},get fontWeight(){return o.fontWeight},get fontVariant(){return o.fontVariant},get fontStyle(){return o.fontStyle},get bgColor(){var t;return null!==(t=o.bgColor)&&void 0!==t?t:"#FFF"},get color(){var t;return null!==(t=o.color)&&void 0!==t?t:"#000"},get borderColor(){var t;return null!==(t=o.borderColor)&&void 0!==t?t:"#000"},get borderLineWidth(){var t;return null!==(t=o.borderLineWidth)&&void 0!==t?t:1},get borderLineDash(){var t;return null!==(t=o.borderLineDash)&&void 0!==t?t:Bw},get hover(){if(o.hover)return{get cellBgColor(){var t,e;return null!==(e=null===(t=o.hover)||void 0===t?void 0:t.cellBgColor)&&void 0!==e?e:void 0},get inlineColumnBgColor(){var t,e,i,n,r,s;return null!==(s=null!==(e=null===(t=o.hover)||void 0===t?void 0:t.inlineColumnBgColor)&&void 0!==e?e:(null===(i=o.hover)||void 0===i?void 0:i.cellBgColor)&&"string"==typeof(null===(n=o.hover)||void 0===n?void 0:n.cellBgColor)?FC(null===(r=o.hover)||void 0===r?void 0:r.cellBgColor,.1,!1):void 0)&&void 0!==s?s:void 0},get inlineRowBgColor(){var t,e,i,n,r,s;return null!==(s=null!==(e=null===(t=o.hover)||void 0===t?void 0:t.inlineRowBgColor)&&void 0!==e?e:(null===(i=o.hover)||void 0===i?void 0:i.cellBgColor)&&"string"==typeof(null===(n=o.hover)||void 0===n?void 0:n.cellBgColor)?FC(null===(r=o.hover)||void 0===r?void 0:r.cellBgColor,.1,!1):void 0)&&void 0!==s?s:void 0}}},get select(){if(o.select)return{get inlineColumnBgColor(){var e,i,n,r,s,l;return null!==(l=null!==(r=null!==(i=null===(e=o.select)||void 0===e?void 0:e.inlineColumnBgColor)&&void 0!==i?i:null===(n=t.selectionStyle)||void 0===n?void 0:n.inlineColumnBgColor)&&void 0!==r?r:(null===(s=t.selectionStyle)||void 0===s?void 0:s.cellBgColor)&&"string"==typeof t.selectionStyle.cellBgColor?FC(t.selectionStyle.cellBgColor,.1,!1):void 0)&&void 0!==l?l:void 0},get inlineRowBgColor(){var e,i,n,r,s;return null!==(s=null!==(n=null!==(i=null===(e=o.select)||void 0===e?void 0:e.inlineRowBgColor)&&void 0!==i?i:t.selectionStyle.inlineRowBgColor)&&void 0!==n?n:(null===(r=t.selectionStyle)||void 0===r?void 0:r.cellBgColor)&&"string"==typeof t.selectionStyle.cellBgColor?FC(t.selectionStyle.cellBgColor,.1,!1):void 0)&&void 0!==s?s:void 0}}},get padding(){var t;return null!==(t=o.padding)&&void 0!==t?t:[10,16,10,16]},get textAlign(){var t;return null!==(t=o.textAlign)&&void 0!==t?t:"left"},get textBaseline(){var t;return null!==(t=o.textBaseline)&&void 0!==t?t:"middle"},get textOverflow(){var t;return null!==(t=o.textOverflow)&&void 0!==t?t:"ellipsis"},get lineHeight(){return o.lineHeight},get autoWrapText(){var t;return null!==(t=o.autoWrapText)&&void 0!==t&&t},get lineClamp(){var t;return null!==(t=o.lineClamp)&&void 0!==t?t:"auto"},get linkColor(){var t;return null!==(t=o.linkColor)&&void 0!==t?t:"#3772ff"},get cursor(){var t;return null!==(t=o.cursor)&&void 0!==t?t:"auto"},get marked(){var t;return null!==(t=o.marked)&&void 0!==t&&t},get underline(){var t;return null!==(t=o.underline)&&void 0!==t&&t},get underlineColor(){return o.underlineColor},get underlineDash(){return o.underlineDash},get underlineOffset(){return o.underlineOffset},get lineThrough(){var t;return null!==(t=o.lineThrough)&&void 0!==t&&t},get lineThroughColor(){return o.lineThroughColor},get lineThroughDash(){return o.lineThroughDash}}}return this._defaultStyle}get headerStyle(){if(!this._header){const{obj:t,superTheme:e}=this.internalTheme,i=EC({},this.defaultStyle,e.headerStyle,t.headerStyle);this._header=this.getStyle(i)}return this._header}get cornerHeaderStyle(){if(!this._cornerHeader){const{obj:t,superTheme:e}=this.internalTheme,i=EC({},this.defaultStyle,e.cornerHeaderStyle,t.cornerHeaderStyle);this._cornerHeader=this.getStyle(i)}return this._cornerHeader}get cornerRightTopCellStyle(){if(!this._cornerRightTopCell){const{obj:t,superTheme:e}=this.internalTheme;if(!e.cornerRightTopCellStyle&&!t.cornerRightTopCellStyle)return this._cornerRightTopCell;const i=EC({},this.defaultStyle,e.cornerRightTopCellStyle,t.cornerRightTopCellStyle);this._cornerRightTopCell=this.getStyle(i)}return this._cornerRightTopCell}get cornerLeftBottomCellStyle(){if(!this._cornerLeftBottomCell){const{obj:t,superTheme:e}=this.internalTheme;if(!e.cornerLeftBottomCellStyle&&!t.cornerLeftBottomCellStyle)return this._cornerLeftBottomCell;const i=EC({},this.defaultStyle,e.cornerLeftBottomCellStyle,t.cornerLeftBottomCellStyle);this._cornerLeftBottomCell=this.getStyle(i)}return this._cornerLeftBottomCell}get cornerRightBottomCellStyle(){if(!this._cornerRightBottomCell){const{obj:t,superTheme:e}=this.internalTheme;if(!e.cornerRightBottomCellStyle&&!t.cornerRightBottomCellStyle)return this._cornerRightBottomCell;const i=EC({},this.defaultStyle,e.cornerRightBottomCellStyle,t.cornerRightBottomCellStyle);this._cornerRightBottomCell=this.getStyle(i)}return this._cornerRightBottomCell}get rightFrozenStyle(){if(!this._rightFrozen){const{obj:t,superTheme:e}=this.internalTheme;if(!e.rightFrozenStyle&&!t.rightFrozenStyle)return this._rightFrozen;const i=EC({},this.defaultStyle,this.rowHeaderStyle,e.rightFrozenStyle,t.rightFrozenStyle);this._rightFrozen=this.getStyle(i)}return this._rightFrozen}get bottomFrozenStyle(){if(!this._bottomFrozen){const{obj:t,superTheme:e}=this.internalTheme;if(!e.bottomFrozenStyle&&!t.bottomFrozenStyle)return this._bottomFrozen;const i=EC({},this.defaultStyle,this.headerStyle,e.bottomFrozenStyle,t.bottomFrozenStyle);this._bottomFrozen=this.getStyle(i)}return this._bottomFrozen}get rowHeaderStyle(){var t;if(!this._rowHeader){const{obj:e,superTheme:i}=this.internalTheme,o=EC({},this.defaultStyle,i.rowHeaderStyle,null!==(t=e.rowHeaderStyle)&&void 0!==t?t:this.isPivot?null:e.headerStyle);this._rowHeader=this.getStyle(o)}return this._rowHeader}get bodyStyle(){if(!this._body){const{obj:t,superTheme:e}=this.internalTheme,i=EC({},this.defaultStyle,e.bodyStyle,t.bodyStyle);this._body=this.getStyle(i)}return this._body}get frameStyle(){if(!this._frameStyle){const{obj:t,superTheme:e}=this.internalTheme,i=EC({},e.frameStyle,t.frameStyle);this._frameStyle={get borderColor(){return i.borderColor},get borderLineWidth(){return i.borderLineWidth},get borderLineDash(){return i.borderLineDash},get innerBorder(){return i.innerBorder},get shadowBlur(){return i.shadowBlur},get shadowColor(){return i.shadowColor},get shadowOffsetX(){return i.shadowOffsetX},get shadowOffsetY(){return i.shadowOffsetY},get cornerRadius(){return i.cornerRadius}}}return this._frameStyle}get scrollStyle(){if(!this._scroll){const{obj:t,superTheme:e}=this.internalTheme,i=EC({},e.scrollStyle,t.scrollStyle);this._scroll={get scrollSliderColor(){var t;return null!==(t=i.scrollSliderColor)&&void 0!==t?t:"#C0C0C0"},get scrollSliderCornerRadius(){return i.scrollSliderCornerRadius},get scrollRailColor(){return i.scrollRailColor},get visible(){var t;return null!==(t=i.visible)&&void 0!==t?t:"scrolling"},get verticalVisible(){return i.verticalVisible},get horizontalVisible(){return i.horizontalVisible},get width(){var t;return null!==(t=i.width)&&void 0!==t?t:7},get hoverOn(){var t;return null===(t=i.hoverOn)||void 0===t||t},get barToSide(){var t;return null!==(t=i.barToSide)&&void 0!==t&&t}}}return this._scroll}get tooltipStyle(){if(!this._tooltip){const{obj:t,superTheme:e}=this.internalTheme,i=EC({},e.tooltipStyle,t.tooltipStyle);this._tooltip={get fontFamily(){var t;return null!==(t=i.fontFamily)&&void 0!==t?t:Aw},get fontSize(){var t;return null!==(t=i.fontSize)&&void 0!==t?t:16},get bgColor(){var t;return null!==(t=i.bgColor)&&void 0!==t?t:"#000"},get padding(){var t;return null!==(t=i.padding)&&void 0!==t?t:[6,8]},get color(){var t;return null!==(t=i.color)&&void 0!==t?t:"#FFF"},get maxWidth(){return i.maxWidth},get maxHeight(){return i.maxHeight}}}return this._tooltip}get columnResize(){if(!this._columnResize){const{obj:t,superTheme:e}=this.internalTheme,i=EC({},e.columnResize,t.columnResize);this._columnResize={get lineColor(){var t;return null!==(t=i.lineColor)&&void 0!==t?t:"#416EFF"},get bgColor(){var t;return null!==(t=i.bgColor)&&void 0!==t?t:"#D9E2FF"},get lineWidth(){var t;return null!==(t=i.lineWidth)&&void 0!==t?t:1},get width(){var t;return null!==(t=i.width)&&void 0!==t?t:i.lineWidth+2},get labelColor(){var t;return null!==(t=i.labelColor)&&void 0!==t?t:"#FFF"},get labelFontSize(){var t;return null!==(t=i.labelFontSize)&&void 0!==t?t:10},get labelFontFamily(){var t;return null!==(t=i.labelFontFamily)&&void 0!==t?t:"sans-serif"},get labelBackgroundFill(){var t;return null!==(t=i.labelBackgroundFill)&&void 0!==t?t:"#3073F2"},get labelBackgroundCornerRadius(){var t;return null!==(t=i.labelBackgroundCornerRadius)&&void 0!==t?t:5}}}return this._columnResize}get dragHeaderSplitLine(){if(!this._dragHeaderSplitLine){const{obj:t,superTheme:e}=this.internalTheme,i=EC({},e.dragHeaderSplitLine,t.dragHeaderSplitLine);this._dragHeaderSplitLine={get lineColor(){var t;return null!==(t=i.lineColor)&&void 0!==t?t:"blue"},get lineWidth(){var t;return null!==(t=i.lineWidth)&&void 0!==t?t:2},get shadowBlockColor(){var t;return null!==(t=i.shadowBlockColor)&&void 0!==t?t:"rgba(204,204,204,0.3)"}}}return this._dragHeaderSplitLine}get frozenColumnLine(){if(!this._frozenColumnLine){const{obj:t,superTheme:e}=this.internalTheme,i=EC({},e.frozenColumnLine,t.frozenColumnLine);this._frozenColumnLine={get shadow(){if(i.shadow)return{get width(){var t,e;return null!==(e=null===(t=i.shadow)||void 0===t?void 0:t.width)&&void 0!==e?e:24},get startColor(){var t,e;return null!==(e=null===(t=i.shadow)||void 0===t?void 0:t.startColor)&&void 0!==e?e:"rgba(00, 24, 47, 0.06)"},get endColor(){var t,e;return null!==(e=null===(t=i.shadow)||void 0===t?void 0:t.endColor)&&void 0!==e?e:"rgba(00, 24, 47, 0)"}}},get border(){if(i.border)return{get lineColor(){var t,e;return null!==(e=null===(t=i.border)||void 0===t?void 0:t.lineColor)&&void 0!==e?e:"rgba(00, 24, 47, 0.06)"},get bgColor(){var t,e,o,n;return null!==(n=null!==(e=null===(t=i.border)||void 0===t?void 0:t.bgColor)&&void 0!==e?e:null===(o=i.border)||void 0===o?void 0:o.lineColor)&&void 0!==n?n:"rgba(00, 24, 47, 0.06)"},get lineWidth(){var t,e;return null!==(e=null===(t=i.border)||void 0===t?void 0:t.lineWidth)&&void 0!==e?e:4},get width(){var t,e,o,n;return null!==(n=null!==(e=null===(t=i.border)||void 0===t?void 0:t.width)&&void 0!==e?e:null===(o=i.border)||void 0===o?void 0:o.lineWidth)&&void 0!==n?n:4}}}}}return this._frozenColumnLine}get selectionStyle(){if(!this._selectionStyle){const{obj:t,superTheme:e}=this.internalTheme,i=EC({},e.selectionStyle,t.selectionStyle);this._selectionStyle={get cellBgColor(){var t;return null!==(t=null==i?void 0:i.cellBgColor)&&void 0!==t?t:"rgba(0, 0, 255,0.1)"},get cellBorderColor(){var t;return null!==(t=null==i?void 0:i.cellBorderColor)&&void 0!==t?t:"#3073f2"},get cellBorderLineWidth(){var t;return null!==(t=null==i?void 0:i.cellBorderLineWidth)&&void 0!==t?t:2},get inlineColumnBgColor(){return null==i?void 0:i.inlineColumnBgColor},get inlineRowBgColor(){return null==i?void 0:i.inlineRowBgColor}}}return this._selectionStyle}get axisStyle(){if(!this._axisStyle){const{obj:t,superTheme:e}=this.internalTheme,i=EC({},e.axisStyle,t.axisStyle);this._axisStyle=function(t){return{defaultAxisStyle:kw(t.defaultAxisStyle),leftAxisStyle:kw(t.leftAxisStyle),rightAxisStyle:kw(t.rightAxisStyle),topAxisStyle:kw(t.topAxisStyle),bottomAxisStyle:kw(t.bottomAxisStyle)}}(i)}return this._axisStyle}get checkboxStyle(){if(!this._checkboxStyle){const{obj:t,superTheme:e}=this.internalTheme,i=EC({},e.checkboxStyle,t.checkboxStyle);this._checkboxStyle=i}return this._checkboxStyle}get radioStyle(){if(!this._radioStyle){const{obj:t,superTheme:e}=this.internalTheme,i=EC({},e.radioStyle,t.radioStyle);this._radioStyle=i}return this._radioStyle}get textPopTipStyle(){if(!this._textPopTipStyle){const{obj:t,superTheme:e}=this.internalTheme,i=EC({},Pw,e.textPopTipStyle,t.textPopTipStyle);this._textPopTipStyle=i}return this._textPopTipStyle}hasProperty(t){const{obj:e,superTheme:i}=this.internalTheme;return Hw(e,t)||Hw(i,t)}extends(t){return new Lw(t,this.internalTheme.superTheme||this.internalTheme.obj)}getStyle(t){const e=this;return{get fontSize(){return t.fontSize},get fontFamily(){return t.fontFamily},get fontWeight(){return t.fontWeight},get fontVariant(){return t.fontVariant},get fontStyle(){return t.fontStyle},get bgColor(){return t.bgColor},get color(){return t.color},get strokeColor(){return t.strokeColor},get borderColor(){return t.borderColor},get borderLineWidth(){return t.borderLineWidth},get borderLineDash(){return t.borderLineDash},get hover(){if(t.hover)return{get cellBgColor(){var e,i;return null!==(i=null===(e=t.hover)||void 0===e?void 0:e.cellBgColor)&&void 0!==i?i:void 0},get inlineColumnBgColor(){var e,i,o,n,r,s;return null!==(s=null!==(i=null===(e=t.hover)||void 0===e?void 0:e.inlineColumnBgColor)&&void 0!==i?i:(null===(o=t.hover)||void 0===o?void 0:o.cellBgColor)&&"string"==typeof(null===(n=t.hover)||void 0===n?void 0:n.cellBgColor)?FC(null===(r=t.hover)||void 0===r?void 0:r.cellBgColor,.1,!1):void 0)&&void 0!==s?s:void 0},get inlineRowBgColor(){var e,i,o,n,r,s;return null!==(s=null!==(i=null===(e=t.hover)||void 0===e?void 0:e.inlineRowBgColor)&&void 0!==i?i:(null===(o=t.hover)||void 0===o?void 0:o.cellBgColor)&&"string"==typeof(null===(n=t.hover)||void 0===n?void 0:n.cellBgColor)?FC(null===(r=t.hover)||void 0===r?void 0:r.cellBgColor,.1,!1):void 0)&&void 0!==s?s:void 0}}},get select(){return{get inlineColumnBgColor(){var i,o,n,r,s,l;return null!==(l=null!==(r=null!==(o=null===(i=t.select)||void 0===i?void 0:i.inlineColumnBgColor)&&void 0!==o?o:null===(n=e.selectionStyle)||void 0===n?void 0:n.inlineColumnBgColor)&&void 0!==r?r:(null===(s=e.selectionStyle)||void 0===s?void 0:s.cellBgColor)&&"string"==typeof e.selectionStyle.cellBgColor?FC(e.selectionStyle.cellBgColor,.1,!1):void 0)&&void 0!==l?l:void 0},get inlineRowBgColor(){var i,o,n,r,s;return null!==(s=null!==(n=null!==(o=null===(i=t.select)||void 0===i?void 0:i.inlineRowBgColor)&&void 0!==o?o:e.selectionStyle.inlineRowBgColor)&&void 0!==n?n:(null===(r=e.selectionStyle)||void 0===r?void 0:r.cellBgColor)&&"string"==typeof e.selectionStyle.cellBgColor?FC(e.selectionStyle.cellBgColor,.1,!1):void 0)&&void 0!==s?s:void 0}}},get frameStyle(){if(t.frameStyle)return{get borderColor(){var e,i;return null!==(i=null===(e=t.frameStyle)||void 0===e?void 0:e.borderColor)&&void 0!==i?i:void 0},get borderLineWidth(){var e,i;return null!==(i=null===(e=t.frameStyle)||void 0===e?void 0:e.borderLineWidth)&&void 0!==i?i:void 0},get borderLineDash(){var e,i;return null!==(i=null===(e=t.frameStyle)||void 0===e?void 0:e.borderLineDash)&&void 0!==i?i:void 0}}},get padding(){return t.padding},get textAlign(){return t.textAlign},get textBaseline(){return t.textBaseline},get textOverflow(){return t.textOverflow},get lineHeight(){return t.lineHeight},get autoWrapText(){return t.autoWrapText},get lineClamp(){return t.lineClamp},get linkColor(){return t.linkColor},get cursor(){return t.cursor},get textStick(){return t.textStick},get marked(){return t.marked},get underline(){var e;return null!==(e=t.underline)&&void 0!==e&&e},get underlineColor(){return t.underlineColor},get underlineDash(){return t.underlineDash},get underlineOffset(){return t.underlineOffset},get lineThrough(){var e;return null!==(e=t.lineThrough)&&void 0!==e&&e},get lineThroughColor(){return t.lineThroughColor},get lineThroughDash(){return t.lineThroughDash}}}}function Hw(t,e){if(t instanceof Lw)return t.hasProperty(e);let i=t;if(!i)return!1;for(let t=0;t<e.length;t++)if(i=i[e[t]],!i)return!1;return!!i}const zw=new Lw(yw,yw),Fw=new Lw(Cw,Cw),Iw=new Lw(ww,ww),Ow=new Lw(xw,xw),Dw=new Lw(_w,_w),Ww={DEFAULT:Ow,SIMPLIFY:Dw,ARCO:Iw,DARK:zw,BRIGHT:Fw};function Nw(){return qC(Ww,Sw)}var Gw={DARK:zw,BRIGHT:Fw,ARCO:Iw,DEFAULT:Ow,SIMPLIFY:Dw,theme:{TableTheme:Lw},of:function(t){if(!t)return null;if("string"==typeof t){const e=function(t,e){if(t[e])return t[e];const i=e.toLowerCase();if(t[i])return t[i];const o=e.toLowerCase();if(t[o])return t[o];for(const e in t)if(e.toLowerCase()===i)return t[e]}(Nw(),t);return e?e instanceof Lw?e:new Lw(e,e):null}return t instanceof Lw?t:new Lw(t,t)},get:Nw};function jw(t,e,i){var o;if(t.internalProps.customMergeCell){const o=t.getCustomMerge(e,i);if(o)return o.range}if(!t.isHeader(e,i)&&!(null===(o=t.getBodyColumnDefine(e,i))||void 0===o?void 0:o.mergeCell))return!1;const n=t.getCellRange(e,i);return!(n.start.col===n.end.col&&n.start.row===n.end.row)&&n}class Vw{static registerComponent(t,e){Vw._components[t]=e}static getComponent(t){return Vw._components[t]}static registerFunction(t,e){Vw._functions[t]=e}static getFunction(t){return Vw._functions[t]}static registerCellType(t,e){Vw._cellTypes[t]=e}static getCellType(t){return Vw._cellTypes[t]}}function Uw(t,e,i,o,n,r){const s=function(t,e){const i=new Array(e);for(let o=0;o<e;o++)i[o]=t(o);return i}(t,i);s.sort(((t,e)=>o(r(t),r(e),n)));for(let t=0;t<i;t++)e(t,s[t])}Vw._components={},Vw._functions={},Vw._cellTypes={};class $w{constructor(t){var e;this.className="Aggregator",this.isRecord=!0,this.records=[],this.key=t.key,this.field=t.dimension,this.formatFun=t.formatFun,this.isRecord=null!==(e=t.isRecord)&&void 0!==e?e:this.isRecord}clearCacheValue(){this._formatedValue=void 0}formatValue(t,e,i){return this._formatedValue||(this.formatFun?this._formatedValue=this.formatFun(this.value(),t,e,i):this._formatedValue=this.value()),this._formatedValue}reset(){this.records=[]}}class Xw extends $w{constructor(){super(...arguments),this.type=Qy.RECORD,this.isRecord=!0}push(t){t&&this.isRecord&&this.records&&("Aggregator"===t.className?this.records.push(...t.records):this.records.push(t))}value(){return this.records}reset(){this.records=[]}recalculate(){}}class Yw extends $w{constructor(){super(...arguments),this.type=Qy.NONE,this.isRecord=!0}push(t){t&&(this.isRecord&&(this.records=[t]),this.field&&(this.fieldValue=t[this.field]))}value(){return this.fieldValue}reset(){this.records=[],this.fieldValue=void 0}recalculate(){}}class Kw extends $w{constructor(t){super(t),this.type=Qy.CUSTOM,this.isRecord=!0,this.values=[],this.aggregationFun=t.aggregationFun}push(t){t&&(this.isRecord&&this.records&&("Aggregator"===t.className?this.records.push(...t.records):this.records.push(t)),this.field&&this.values.push(t[this.field]))}value(){var t;return this.fieldValue||(this.fieldValue=null===(t=this.aggregationFun)||void 0===t?void 0:t.call(this,this.values,this.records,this.field)),this.fieldValue}reset(){this.records=[],this.fieldValue=void 0}recalculate(){}}class qw extends $w{constructor(t){var e;super(t),this.type=Qy.SUM,this.sum=0,this.positiveSum=0,this.nagetiveSum=0,this.needSplitPositiveAndNegativeForSum=!1,this.needSplitPositiveAndNegativeForSum=null!==(e=t.needSplitPositiveAndNegative)&&void 0!==e&&e}push(t){if(t)if(this.isRecord&&this.records&&("Aggregator"===t.className?this.records.push(...t.records):this.records.push(t)),"Aggregator"===t.className){const e=t.value();this.sum+=e,this.needSplitPositiveAndNegativeForSum&&(e>0?this.positiveSum+=e:e<0&&(this.nagetiveSum+=e))}else if(this.field&&!isNaN(parseFloat(t[this.field]))){const e=parseFloat(t[this.field]);this.sum+=e,this.needSplitPositiveAndNegativeForSum&&(e>0?this.positiveSum+=e:e<0&&(this.nagetiveSum+=e))}}value(){return this.sum}positiveValue(){return this.positiveSum}negativeValue(){return this.nagetiveSum}reset(){this.records=[],this.sum=0}recalculate(){if(this.sum=0,this._formatedValue=void 0,this.records)for(let t=0;t<this.records.length;t++){const e=this.records[t];if("Aggregator"===e.className){const t=e.value();this.sum+=t,this.needSplitPositiveAndNegativeForSum&&(t>0?this.positiveSum+=t:t<0&&(this.nagetiveSum+=t))}else if(this.field&&!isNaN(parseFloat(e[this.field]))){const t=parseFloat(e[this.field]);this.sum+=t,this.needSplitPositiveAndNegativeForSum&&(t>0?this.positiveSum+=t:t<0&&(this.nagetiveSum+=t))}}}}class Zw extends $w{constructor(){super(...arguments),this.type=Qy.COUNT,this.count=0}push(t){t&&(this.isRecord&&this.records&&("Aggregator"===t.className?this.records.push(...t.records):this.records.push(t)),"Aggregator"===t.className?this.count+=t.value():this.count++)}value(){return this.count}reset(){this.records=[],this.count=0}recalculate(){if(this.count=0,this._formatedValue=void 0,this.records)for(let t=0;t<this.records.length;t++){const e=this.records[t];"Aggregator"===e.className?this.count+=e.value():this.count++}}}class Jw extends $w{constructor(){super(...arguments),this.type=Qy.AVG,this.sum=0,this.count=0}push(t){t&&(this.isRecord&&this.records&&("Aggregator"===t.className?this.records.push(...t.records):this.records.push(t)),"Aggregator"===t.className&&t.type===Qy.AVG?(this.sum+=t.sum,this.count+=t.count):this.field&&!isNaN(parseFloat(t[this.field]))&&(this.sum+=parseFloat(t[this.field]),this.count++))}value(){return this.sum/this.count}reset(){this.records=[],this.sum=0,this.count=0}recalculate(){if(this.sum=0,this.count=0,this._formatedValue=void 0,this.records)for(let t=0;t<this.records.length;t++){const e=this.records[t];"Aggregator"===e.className&&e.type===Qy.AVG?(this.sum+=e.sum,this.count+=e.count):this.field&&!isNaN(parseFloat(e[this.field]))&&(this.sum+=parseFloat(e[this.field]),this.count++)}}}class Qw extends $w{constructor(){super(...arguments),this.type=Qy.MAX,this.max=Number.MIN_SAFE_INTEGER}push(t){t&&(this.isRecord&&this.records&&("Aggregator"===t.className?this.records.push(...t.records):this.records.push(t)),"Aggregator"===t.className?this.max=t.max>this.max?t.max:this.max:"number"==typeof t?this.max=t>this.max?t:this.max:this.field&&"number"==typeof t[this.field]?this.max=t[this.field]>this.max?t[this.field]:this.max:this.field&&!isNaN(t[this.field])&&(this.max=parseFloat(t[this.field])>this.max?parseFloat(t[this.field]):this.max))}value(){return this.max}reset(){this.records=[],this.max=Number.MIN_SAFE_INTEGER}recalculate(){if(this.max=Number.MIN_SAFE_INTEGER,this._formatedValue=void 0,this.records)for(let t=0;t<this.records.length;t++){const e=this.records[t];"Aggregator"===e.className?this.max=e.max>this.max?e.max:this.max:"number"==typeof e?this.max=e>this.max?e:this.max:this.field&&"number"==typeof e[this.field]?this.max=e[this.field]>this.max?e[this.field]:this.max:this.field&&!isNaN(e[this.field])&&(this.max=parseFloat(e[this.field])>this.max?parseFloat(e[this.field]):this.max)}}}class tx extends $w{constructor(){super(...arguments),this.type=Qy.MIN,this.min=Number.MAX_SAFE_INTEGER}push(t){t&&(this.isRecord&&this.records&&("Aggregator"===t.className?this.records.push(...t.records):this.records.push(t)),"Aggregator"===t.className?this.min=t.min<this.min?t.min:this.min:"number"==typeof t?this.min=t<this.min?t:this.min:this.field&&"number"==typeof t[this.field]&&(this.min=t[this.field]<this.min?t[this.field]:this.min))}value(){return this.min}reset(){this.records=[],this.min=Number.MAX_SAFE_INTEGER}recalculate(){if(this.min=Number.MAX_SAFE_INTEGER,this._formatedValue=void 0,this.records)for(let t=0;t<this.records.length;t++){const e=this.records[t];"Aggregator"===e.className?this.min=e.min<this.min?e.min:this.min:"number"==typeof e?this.min=e<this.min?e:this.min:this.field&&"number"==typeof e[this.field]&&(this.min=e[this.field]<this.min?e[this.field]:this.min)}}}const ex={SOURCE_LENGTH_UPDATE:"source_length_update",CHANGE_ORDER:"change_order"};function ix(t,e){const i=QC(t);if(tw(i)){const t=i.then((t=>(e(t),t)));return e(t),t}return i}function ox(t,e,i,o,n,r){if(null==t)return;if(tw(t))return t.then((t=>ox(t,e,i,o,n,r)));const s=function(t){if(sw.isObject(t)){const e=t;if(Q(e.get)&&Q(e.set))return!0}return!1}(e)?e.get:e;if(s in t)return ix(t[s],r);if("function"==typeof s)return ix(s(t,i,o,n),r);if(Array.isArray(s))return ix(function(t,e){let i,o=t;for(;i=e.shift();)o=o[i];return o}(t,[...s]),r);const l=`${s}`.split(".");return l.length<=1?ix(t[s],r):ix(ZC(t,((t,e)=>ox(t,e,i,o,n,dw)),...l),r)}function nx(t,e){if(!t)return e;const i=t[e];return Q(i)?i:e}let rx=class extends sC{static get EVENT_TYPE(){return ex}constructor(t,e,i,o,n,r){var s;super(),this.currentIndexedData=[],this.hierarchyExpandLevel=0,this.hasHierarchyStateExpand=!1,this.beforeChangedRecordsMap=[],this.registedAggregators={},this.fieldAggregators=[],this.layoutColumnObjects=[],this.registerAggregators(),this.dataSourceObj=t,this.dataConfig=e,this._get=null==t?void 0:t.get,this.layoutColumnObjects=o,this._source=(null==t?void 0:t.records)?this.processRecords(null==t?void 0:t.records):t,this._sourceLength=(null===(s=this._source)||void 0===s?void 0:s.length)||0,this.sortedIndexMap=new Map,this._currentPagerIndexedData=[],this.userPagination=i,this.pagination=i||{totalCount:this._sourceLength,perPageCount:this._sourceLength,currentPage:0},r>=1&&(this.hierarchyExpandLevel=r),this.currentIndexedData=Array.from({length:this._sourceLength},((t,e)=>e)),"tree"===n&&this.initTreeHierarchyState(),this.rowHierarchyType=n,this.updatePagerData()}initTreeHierarchyState(){var t;this.currentIndexedData=Array.from({length:this._sourceLength},((t,e)=>e));let e=this._sourceLength;for(let i=0;i<e;i++){const o=this.currentIndexedData[i],n=this.getOriginalRecord(o),r=null!==(t=n.filteredChildren)&&void 0!==t?t:n.children;if((null==r?void 0:r.length)>0){if(this.hierarchyExpandLevel>1?!n.hierarchyState&&(n.hierarchyState=Jy.expand):!n.hierarchyState&&(n.hierarchyState=Jy.collapse),this.hasHierarchyStateExpand=!0,n.hierarchyState===Jy.collapse)continue;const t=this.initChildrenNodeHierarchy(o,this.hierarchyExpandLevel,2,n);i+=t,e+=t}else!0===n.children&&!n.hierarchyState&&(n.hierarchyState=Jy.collapse)}}registerAggregator(t,e){this.registedAggregators[t]=e}registerAggregators(){this.registerAggregator(Qy.RECORD,Xw),this.registerAggregator(Qy.SUM,qw),this.registerAggregator(Qy.COUNT,Zw),this.registerAggregator(Qy.MAX,Qw),this.registerAggregator(Qy.MIN,tx),this.registerAggregator(Qy.AVG,Jw),this.registerAggregator(Qy.NONE,Yw),this.registerAggregator(Qy.CUSTOM,Kw)}_generateFieldAggragations(){const t=this.layoutColumnObjects;for(let e=0;e<(null==t?void 0:t.length);e++){t[e].aggregator=null;const i=t[e].field,o=t[e].aggregation;if(o)if(Array.isArray(o))for(let n=0;n<o.length;n++){const r=o[n],s=new this.registedAggregators[r.aggregationType]({dimension:i,formatFun:r.formatFun,isRecord:!0,aggregationFun:r.aggregationFun});this.fieldAggregators.push(s),t[e].aggregator||(t[e].aggregator=[]),t[e].aggregator.push(s)}else{const n=new this.registedAggregators[o.aggregationType]({dimension:i,formatFun:o.formatFun,isRecord:!0,aggregationFun:o.aggregationFun});this.fieldAggregators.push(n),t[e].aggregator=n}}}processRecords(t){var e,i,o,n,r,s,l,a;this._generateFieldAggragations();const h=[],d=this.fieldAggregators.length>=1;if((null===(i=null===(e=this.dataConfig)||void 0===e?void 0:e.filterRules)||void 0===i?void 0:i.length)>=1||(null===(o=this.lastFilterRules)||void 0===o?void 0:o.length)>=1||d){for(let e=0,i=t.length;e<i;e++){const i=t[e];(null===(r=null===(n=this.dataConfig)||void 0===n?void 0:n.filterRules)||void 0===r?void 0:r.length)>=1?this.filterRecord(i)&&(h.push(i),"tree"===this.rowHierarchyType&&i.children&&(i.filteredChildren=this.filteredChildren(i.children)),d&&this.processRecord(i)):(null===(s=this.lastFilterRules)||void 0===s?void 0:s.length)>=1?(this.clearFilteredChildren(i),d&&this.processRecord(i)):d&&this.processRecord(i)}if((null===(a=null===(l=this.dataConfig)||void 0===l?void 0:l.filterRules)||void 0===a?void 0:a.length)>=1)return h}return t}filteredChildren(t){const e=[];for(let i=0,o=t.length;i<o;i++){const o=t[i];this.filterRecord(o)&&(e.push(o),o.children&&(o.filteredChildren=this.filteredChildren(o.children)))}return e}processRecord(t){for(let e=0;e<this.fieldAggregators.length;e++)this.fieldAggregators[e].push(t)}initChildrenNodeHierarchy(t,e,i,o){var n,r,s;let l=0;const a=o.filteredChildren?o.filteredChildren.length:null!==(r=null===(n=o.children)||void 0===n?void 0:n.length)&&void 0!==r?r:0;for(let n=0;n<a;n++){(i<=e||o.hierarchyState===Jy.expand)&&(l+=1);const r=o.filteredChildren?o.filteredChildren[n]:o.children[n],a=Array.isArray(t)?t.concat(n):[t,n];(i<=e||o.hierarchyState===Jy.expand)&&this.currentIndexedData.splice(this.currentIndexedData.indexOf(t)+l,0,a),(r.filteredChildren?r.filteredChildren.length>0:(null===(s=r.children)||void 0===s?void 0:s.length)>0)&&(i<e||r.hierarchyState===Jy.expand?(!r.hierarchyState&&(r.hierarchyState=Jy.expand),this.hasHierarchyStateExpand=!0):!r.hierarchyState&&(r.hierarchyState=Jy.collapse)),r.hierarchyState===Jy.expand&&(l+=this.initChildrenNodeHierarchy(a,e,i+1,r))}return l}updatePagination(t){this.pagination=t||{totalCount:this._sourceLength,perPageCount:this._sourceLength,currentPage:0},this.updatePagerData()}updatePagerData(){const{currentIndexedData:t}=this,{perPageCount:e,currentPage:i}=this.pagination,o=e*(i||0),n=o+e;if(this._currentPagerIndexedData.length=0,t&&t.length>0){let e=-1;for(let i=0;i<t.length;i++)if((Array.isArray(t[i])&&1===t[i].length||!Array.isArray(t[i]))&&e++,e>=o&&e<n)this._currentPagerIndexedData.push(t[i]);else if(e>=n)break}else if(this._sourceLength>0)throw new Error("currentIndexedData should has values!")}get records(){return Array.isArray(this._source)?this._source:[]}get source(){return this._source}get(t){return this.getOriginalRecord(nx(this.currentPagerIndexedData,t))}getRaw(t){return this.getRawRecord(nx(this.currentPagerIndexedData,t))}getIndexKey(t){return nx(this.currentPagerIndexedData,t)}getTableIndex(t){return Array.isArray(t)?this.currentPagerIndexedData.findIndex((e=>Lt(e,t))):this.currentPagerIndexedData.findIndex((e=>e===t))}getField(t,e,i,o,n){return this.getOriginalField(nx(this.currentPagerIndexedData,t),e,i,o,n)}getRawField(t,e,i,o,n){return this.getRawFieldData(nx(this.currentPagerIndexedData,t),e,i,o,n)}hasField(t,e){return this.hasOriginalField(nx(this.currentPagerIndexedData,t),e)}getHierarchyState(t){var e;const i=this.getOriginalRecord(this.currentIndexedData[t]);return null!==(e=null==i?void 0:i.hierarchyState)&&void 0!==e?e:null}toggleHierarchyState(t,e,i){const o=this.currentIndexedData.slice(0),n=this.getIndexKey(t),r=this.getHierarchyState(t),s=this.getOriginalRecord(n);if(this.clearSortedIndexMap(),r===Jy.collapse)s.hierarchyState=Jy.expand,this.pushChildrenNode(n,Jy.expand,s),this.hasHierarchyStateExpand=!0;else if(r===Jy.expand){let t=0;const e=(i,o,n)=>{if(!o||o===Jy.collapse||o===Jy.none)return;const r=n.filteredChildren?n.filteredChildren:n.children;if(r)for(let o=0;o<r.length;o++){t+=1;const n=Array.isArray(i)?i.concat([o]):[i,o];e(n,r[o].hierarchyState,r[o])}};e(n,r,s),this.currentIndexedData.splice(this.currentIndexedData.indexOf(n)+1,t),s.hierarchyState=Jy.collapse}this.updatePagerData();const l=[],a=[];if(r===Jy.collapse){const e=this.currentIndexedData.length-o.length;for(let i=0;i<e;i++)l.push(t+i+1)}else if(r===Jy.expand){const e=o.length-this.currentIndexedData.length;for(let i=0;i<e;i++)a.push(t+i+1)}return{add:l,remove:a}}pushChildrenNode(t,e,i){var o;if(!e||e===Jy.collapse||e===Jy.none)return 0;let n=0;const r=i.filteredChildren?i.filteredChildren:i.children;if(r){const e=Array.from({length:r.length},((t,e)=>e));this.lastOrder&&"normal"!==this.lastOrder&&this.lastOrderField&&Uw((t=>Q(e[t])?e[t]:e[t]=t),((t,i)=>{e[t]=i}),r.length,this.lastOrderFn,this.lastOrder,(e=>this.getOriginalField(Array.isArray(t)?t.concat([e]):[t,e],this.lastOrderField)));for(let i=0;i<e.length;i++){n+=1;const s=Array.isArray(t)?t.concat([e[i]]):[t,e[i]];this.currentIndexedData.splice(this.currentIndexedData.indexOf(t)+n,0,s);const l=this.getOriginalRecord(s);!l.hierarchyState&&(null!==(o=l.filteredChildren)&&void 0!==o?o:l.children)&&(l.hierarchyState=Jy.collapse),n+=this.pushChildrenNode(s,l.hierarchyState,r[e[i]])}}return n}changeFieldValue(t,e,i,o,n,r){var s;if(null!==i&&e>=0){const o=this.getIndexKey(e);if(!this.beforeChangedRecordsMap[o]){const t=this.getOriginalRecord(o);this.beforeChangedRecordsMap[o]=null!==(s=Ct(t))&&void 0!==s?s:{}}if("string"==typeof i||"number"==typeof i){const e=this.beforeChangedRecordsMap[o][i],n=this.getOriginalRecord(o);let r=t;"number"==typeof e&&function(t){return/^-?\d+(\.\d+)?$/.test(t)}(t)&&(r=parseFloat(t)),tw(n)?n.then((t=>{t[i]=r})).catch((t=>{})):n?n[i]=r:(this.records[o]={},this.records[o][i]=r)}}}setRecord(t,e){var i,o;let n=!0;if((null===(o=null===(i=this.dataConfig)||void 0===i?void 0:i.filterRules)||void 0===o?void 0:o.length)>=1&&(this.filterRecord(t)?"tree"===this.rowHierarchyType&&t.children&&(t.filteredChildren=this.filteredChildren(t.children)):n=!1),n&&Array.isArray(this.records)){const i=this.getIndexKey(e);Array.isArray(i)||this.records.splice(i,1,t)}}addRecord(t,e){var i;if(Array.isArray(this.records)){if(this.records.splice(e,0,t),this.adjustBeforeChangedRecordsMap(e,1),this.currentIndexedData.push(this.currentIndexedData.length),this._sourceLength+=1,"tree"===this.rowHierarchyType&&this.initTreeHierarchyState(),this.userPagination){this.pagination.totalCount=this._sourceLength;const{perPageCount:t,currentPage:i}=this.pagination;e<t*(i||0)+t&&this.updatePagerData()}else this.pagination.perPageCount=this._sourceLength,this.pagination.totalCount=this._sourceLength,this.updatePagerData();(null===(i=this.dataSourceObj)||void 0===i?void 0:i.added)&&this.dataSourceObj.added(e,1)}}addRecords(t,e){var i;if(Array.isArray(this.records)){if(Array.isArray(t)){this.records.splice(e,0,...t),this.adjustBeforeChangedRecordsMap(e,t.length);for(let e=0;e<t.length;e++)this.currentIndexedData.push(this.currentIndexedData.length);this._sourceLength+=t.length}if(this.userPagination){this.pagination.totalCount=this._sourceLength;const{perPageCount:t,currentPage:i}=this.pagination;e<t*(i||0)+t&&this.updatePagerData()}else this.pagination.perPageCount=this._sourceLength,this.pagination.totalCount=this._sourceLength,this.updatePagerData();(null===(i=this.dataSourceObj)||void 0===i?void 0:i.added)&&this.dataSourceObj.added(e,t.length)}}addRecordForSorted(t){Array.isArray(this.records)&&(this.beforeChangedRecordsMap=[],this.records.push(t),this.currentIndexedData.push(this.currentIndexedData.length),this._sourceLength+=1,this.sortedIndexMap.clear(),this.userPagination||(this.pagination.perPageCount=this._sourceLength,this.pagination.totalCount=this._sourceLength))}addRecordsForSorted(t){if(Array.isArray(this.records)){if(this.beforeChangedRecordsMap=[],Array.isArray(t)){this.records.push(...t);for(let e=0;e<t.length;e++)this.currentIndexedData.push(this.currentIndexedData.length);this._sourceLength+=t.length,this.sortedIndexMap.clear()}this.userPagination||(this.pagination.perPageCount=this._sourceLength,this.pagination.totalCount=this._sourceLength)}}adjustBeforeChangedRecordsMap(t,e){for(let i=this.beforeChangedRecordsMap.length-1;i>=t;i--){const t=this.beforeChangedRecordsMap[i];delete this.beforeChangedRecordsMap[i],this.beforeChangedRecordsMap[i+e]=t}}deleteRecords(t){var e;if(Array.isArray(this.records)){const i=[],o=t.sort(((t,e)=>e-t));for(let t=0;t<o.length;t++){const e=o[t];e>=this._sourceLength||e<0||(delete this.beforeChangedRecordsMap[e],i.push(e),this.records.splice(e,1),this.currentIndexedData.pop(),this._sourceLength-=1)}return this.userPagination||(this.pagination.perPageCount=this._sourceLength,this.pagination.totalCount=this._sourceLength),this.updatePagerData(),(null===(e=this.dataSourceObj)||void 0===e?void 0:e.deleted)&&this.dataSourceObj.deleted(i),i}return[]}deleteRecordsForSorted(t){if(Array.isArray(this.records)){const e=t.sort(((t,e)=>e-t));for(let t=0;t<e.length;t++){const i=e[t];if(i>=this._sourceLength||i<0)continue;const o=this.currentIndexedData[i];delete this.beforeChangedRecordsMap[o],this.records.splice(o,1),this._sourceLength-=1}this.sortedIndexMap.clear(),this.userPagination||(this.pagination.perPageCount=this._sourceLength,this.pagination.totalCount=this._sourceLength)}}updateRecords(t,e){const i=[];for(let o=0;o<e.length;o++){const n=e[o];n>=this._sourceLength||n<0||(delete this.beforeChangedRecordsMap[n],i.push(n),this.records[n]=t[o])}return this.userPagination&&this.updatePagerData(),i}updateRecordsForSorted(t,e){for(let i=0;i<e.length;i++){const o=e[i];if(o>=this._sourceLength||o<0)continue;const n=this.currentIndexedData[o];if("number"!=typeof n)return;delete this.beforeChangedRecordsMap[n],this.records[n]=t[i]}this.sortedIndexMap.clear()}sort(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"desc"!==e?(t,e)=>t===e?0:t>e?1:-1:(t,e)=>t===e?0:t<e?1:-1;this.lastOrderField=t,this.lastOrder=e,this.lastOrderFn=i;let o,n=this.sortedIndexMap.get(t);if(n&&(o=n[e],o&&o.length>0))return this.currentIndexedData=o,this.updatePagerData(),void this.fireListeners(ex.CHANGE_ORDER,null);const r=[];if("normal"===e)for(let t=0;t<this._sourceLength;t++)r[t]=t;else Uw((t=>Q(r[t])?r[t]:r[t]=t),((t,e)=>{r[t]=e}),this._sourceLength,i,e,(e=>this.getOriginalField(e,t)));if(this.currentIndexedData=r,this.hierarchyExpandLevel){let t=r.length;window.performance.now();for(let e=0;e<t;e++){const i=this.getOriginalRecord(r[e]),o=this.pushChildrenNode(r[e],i.hierarchyState,this.getOriginalRecord(r[e]));t+=o,e+=o}}n||(n={asc:[],desc:[],normal:[]},this.sortedIndexMap.set(t,n)),n[e]=r,this.updatePagerData(),this.fireListeners(ex.CHANGE_ORDER,null)}setSortedIndexMap(t,e){this.sortedIndexMap.set(t,e)}clearFilteredChildren(t){var e,i;t.filteredChildren=void 0;for(let o=0;null!==(i=o<(null===(e=t.children)||void 0===e?void 0:e.length))&&void 0!==i&&i;o++)this.clearFilteredChildren(t.children[o])}filterRecord(t){var e,i,o;let n=!0;for(let r=0;r<(null===(e=this.dataConfig.filterRules)||void 0===e?void 0:e.length);r++){const e=null===(i=this.dataConfig)||void 0===i?void 0:i.filterRules[r];if(e.filterKey){const i=t[e.filterKey];if(-1===e.filteredValues.indexOf(i)){n=!1;break}}else if(!(null===(o=e.filterFunc)||void 0===o?void 0:o.call(e,t))){n=!1;break}}return n}updateFilterRulesForSorted(t){var e,i,o;this.lastFilterRules=this.dataConfig.filterRules,this.dataConfig.filterRules=t,this._source=this.processRecords(null!==(i=null===(e=this.dataSourceObj)||void 0===e?void 0:e.records)&&void 0!==i?i:this.dataSourceObj),this._sourceLength=(null===(o=this._source)||void 0===o?void 0:o.length)||0,this.sortedIndexMap.clear(),this.currentIndexedData=Array.from({length:this._sourceLength},((t,e)=>e)),this.userPagination||(this.pagination.perPageCount=this._sourceLength,this.pagination.totalCount=this._sourceLength)}updateFilterRules(t){var e,i,o;this.lastFilterRules=this.dataConfig.filterRules,this.dataConfig.filterRules=t,this._source=this.processRecords(null!==(i=null===(e=this.dataSourceObj)||void 0===e?void 0:e.records)&&void 0!==i?i:this.dataSourceObj),this._sourceLength=(null===(o=this._source)||void 0===o?void 0:o.length)||0,this.currentIndexedData=Array.from({length:this._sourceLength},((t,e)=>e)),this.userPagination||(this.pagination.perPageCount=this._sourceLength,this.pagination.totalCount=this._sourceLength,"tree"===this.rowHierarchyType&&this.initTreeHierarchyState()),this.updatePagerData()}clearSortedIndexMap(){this.lastOrderField&&this.lastOrder&&this.sortedIndexMap.forEach(((t,e)=>{e!==this.lastOrderField?this.sortedIndexMap.delete(e):"asc"===this.lastOrder?(t.desc=[],t.normal=[]):"desc"===this.lastOrder?(t.asc=[],t.normal=[]):(t.desc=[],t.asc=[])}))}get sourceLength(){return this._sourceLength}set sourceLength(t){this._sourceLength!==t&&(this._sourceLength=t,this.fireListeners(ex.SOURCE_LENGTH_UPDATE,this._sourceLength))}get length(){return this.currentPagerIndexedData.length}get dataSource(){return this}get currentPagerIndexedData(){return this._currentPagerIndexedData.length>0?this._currentPagerIndexedData:[]}release(){var t;null===(t=super.release)||void 0===t||t.call(this),this.lastFilterRules=null}clearSortedMap(){this.currentIndexedData&&(this.currentIndexedData.length=0),this.currentIndexedData=null,this.sortedIndexMap.forEach((t=>{t.asc&&(t.asc.length=0),t.desc&&(t.desc.length=0)})),this.sortedIndexMap.clear()}clearCurrentIndexedData(){this.currentIndexedData=null,this.currentPagerIndexedData.length=0}getOriginalRecord(t){let e;return e=this.dataSourceObj.records?Array.isArray(t)?sx(this.records,t):this.records[t]:this._get(t),ix(e,(e=>{this.recordPromiseCallBack(t,e)}))}getRawRecord(t){var e;if(null===(e=this.beforeChangedRecordsMap)||void 0===e?void 0:e[t])return this.beforeChangedRecordsMap[t];let i;return i=this.dataSourceObj.records?Array.isArray(t)?sx(this.records,t):this.records[t]:this._get(t),ix(i,(e=>{this.recordPromiseCallBack(t,e)}))}getOriginalField(t,e,i,o,n){if(null!==e)return ox(this.getOriginalRecord(t),e,i,o,n,(i=>{this.fieldPromiseCallBack(t,e,i)}))}getRawFieldData(t,e,i,o,n){if(null!==e)return ox(this.getRawRecord(t),e,i,o,n,(i=>{this.fieldPromiseCallBack(t,e,i)}))}hasOriginalField(t,e){if(null===e)return!1;if("function"==typeof e)return!0;const i=this.getOriginalRecord(t);return Boolean(i&&e in i)}fieldPromiseCallBack(t,e,i){}recordPromiseCallBack(t,e){}isCanExchangeOrder(t,e){if(this.hasHierarchyStateExpand){let i=this.currentPagerIndexedData[t],o=this.currentPagerIndexedData[e];if(i=Array.isArray(i)?[...i]:[i],o=Array.isArray(o)?[...o]:[o],e>t&&o.length>i.length){let t=this.currentPagerIndexedData[e+1];t=Array.isArray(t)?[...t]:[t],t.length<o.length&&o.splice(o.length-1,1)}if(i.length===o.length){for(let t=0;t<=i.length-2;t++)if(i[t]!==o[t])return!1;return!0}return!1}return!0}reorderRecord(t,e){var i;if("asc"!==this.lastOrder&&"desc"!==this.lastOrder&&this.isCanExchangeOrder(t,e))if(this.hasHierarchyStateExpand){let o,n,r=this.currentPagerIndexedData[t],s=this.currentPagerIndexedData[e];if(r=Array.isArray(r)?[...r]:[r],s=Array.isArray(s)?[...s]:[s],r.length>1||s.length>1){if(e>t&&s.length>r.length){let t=this.currentPagerIndexedData[e+1];t=Array.isArray(t)?[...t]:[t],t.length<s.length&&s.splice(s.length-1,1)}if(o=r.splice(r.length-1,1)[0],n=s.splice(s.length-1,1)[0],r.length>=1){const t=this.getOriginalRecord(r),e=t.filteredChildren?t.filteredChildren.splice(o,1):t.children.splice(o,1);e.unshift(n,0),Array.prototype.splice.apply(null!==(i=t.filteredChildren)&&void 0!==i?i:t.children,e)}else{const t=this.records.splice(o,1);t.unshift(n,0),Array.prototype.splice.apply(this.records,t)}}else{o=this.currentPagerIndexedData[t],n=this.currentPagerIndexedData[e];const i=this.records.splice(o,1);i.unshift(n,0),Array.prototype.splice.apply(this.records,i)}this.restoreTreeHierarchyState(),this.updatePagerData()}else{const i=this.records.splice(t,1);i.unshift(e,0),Array.prototype.splice.apply(this.records,i)}}restoreTreeHierarchyState(){var t,e;if(this.hierarchyExpandLevel){for(let e=0;e<this._sourceLength;e++){const i=this.getOriginalRecord(e);(null!==(t=i.filteredChildren)&&void 0!==t?t:i.children)&&!i.hierarchyState&&(i.hierarchyState=Jy.collapse)}this.currentIndexedData=Array.from({length:this._sourceLength},((t,e)=>e));let i=this._sourceLength;for(let t=0;t<i;t++){const o=this.currentIndexedData[t],n=this.getOriginalRecord(o),r=null!==(e=n.filteredChildren)&&void 0!==e?e:n.children;if((null==r?void 0:r.length)>0&&n.hierarchyState===Jy.expand){this.hasHierarchyStateExpand=!0;const e=this.restoreChildrenNodeHierarchy(o,n);t+=e,i+=e}else!0===n.children&&!n.hierarchyState&&(n.hierarchyState=Jy.collapse)}}}restoreChildrenNodeHierarchy(t,e){var i,o;let n=0;const r=null!==(i=e.filteredChildren)&&void 0!==i?i:e.children,s=null!==(o=null==r?void 0:r.length)&&void 0!==o?o:0;for(let i=0;i<s;i++){e.hierarchyState===Jy.expand&&(n+=1);const o=r[i],s=Array.isArray(t)?t.concat(i):[t,i];e.hierarchyState===Jy.expand&&this.currentIndexedData.splice(this.currentIndexedData.indexOf(t)+n,0,s),n+=this.restoreChildrenNodeHierarchy(s,o)}return n}};function sx(t,e){var i;let o=t;for(let t=0;t<e.length;t++){const n=e[t];if(!o[n])return;o=o[n];const r=null!==(i=o.filteredChildren)&&void 0!==i?i:null==o?void 0:o.children;r&&t+1<e.length&&(o=r)}return o}rx.EMPTY=new rx({get(){},length:0});class lx extends rx{static get EVENT_TYPE(){return rx.EVENT_TYPE}static ofArray(t,e,i,o,n,r){return new lx({get:e=>t[e],length:t.length,records:t},e,i,o,n,r)}constructor(t,e,i,o,n,r){super(t,e,i,o,n,r),this._recordCache=[],this._fieldCache={}}getOriginalRecord(t){return this._recordCache&&this._recordCache[t]?this._recordCache[t]:super.getOriginalRecord(t)}getOriginalField(t,e,i,o,n){const r=this._fieldCache&&this._fieldCache[t];if(r){const t=r.get(e);if(t)return t}return super.getOriginalField(t,e,i,o,n)}clearCache(){this._recordCache&&(this._recordCache=[]),this._fieldCache&&(this._fieldCache={})}fieldPromiseCallBack(t,e,i){!function(t,e,i,o){(t[e]||(t[e]=new Map)).set(i,o)}(this._fieldCache,t,e,i)}recordPromiseCallBack(t,e){this._recordCache[t]=e}get records(){return Array.isArray(this._recordCache)&&this._recordCache.length>0?this._recordCache:super.records}release(){var t;null===(t=super.release)||void 0===t||t.call(this),this._recordCache=null,this._fieldCache=null}}var ax={exports:{}},hx={},dx=new RegExp(["^\\s*(?=(?:(?:[-a-z]+\\s*){0,2}(italic|oblique))?)","(?=(?:(?:[-a-z]+\\s*){0,2}(small-caps))?)","(?=(?:(?:[-a-z]+\\s*){0,2}(bold(?:er)?|lighter|[1-9]00 ))?)","(?:(?:normal|\\1|\\2|\\3)\\s*){0,3}((?:xx?-)?","(?:small|large)|medium|smaller|larger|[\\.\\d]+(?:\\%|in|[cem]m|ex|p[ctx]))","(?:\\s*\\/\\s*(normal|[\\.\\d]+(?:\\%|in|[cem]m|ex|p[ctx])?))","?\\s*([-,\\\"\\'\\sa-z]+?)\\s*$"].join(""),"i"),cx=["style","variant","weight","size","lineHeight","family"],ux=/([\.0-9]+)(.*)/,gx=function(t,e,i){var o=t.match(ux);if(o){t=parseFloat(o[1]);var n=o[2].toLowerCase().trim(),r=Math.round(t);switch(r===t&&(t=r),n){case"em":if(null===e)return;return t*e;case"px":return t;case"pt":return t/(72/i);case"pc":return t/(6/i);case"mm":return t*(i/25.4);case"cm":return t*(i/2.54);case"in":return t*i;case"%":if(null===e)return;return e*(t/100)}}},px={size:gx,lineHeight:gx},fx={serif:1,"sans-serif":1,cursive:1,fantasy:1,monospace:1},mx=ax.exports=function(t,e,i){var o=t+"-"+(e||"null")+"@"+i;if(i=i||96,void 0!==hx[o])return hx[o];if(e&&(e=mx(e,null,i)),"inherit"===t)return e;var n=dx.exec(t);if(n){n.shift();for(var r={},s=0;s<n.length;s++){var l=cx[s],a=n[s];if(px[l]&&a){var h=e&&e[l]||null,d=px[l](a,h,i);a=void 0===d&&"lineHeight"===l&&a?r.size*parseFloat(a):d}if(a&&"normal"!==a){if("inherit"===a){if(!e)return;a=e[l]}a.trim&&(a=a.trim()),r[l]=a}}Object.keys(r).length||(r=null),hx[o]=r;var c=[];r.style&&c.push(r.style),r.variant&&c.push(r.variant),r.weight&&"400"!==r.weight&&"normal"!==r.weight&&c.push(r.weight),c.push(r.size+"px"),r.lineHeight&&(c[c.length-1]+="/"+r.lineHeight+"px");var u=r.family.split(",");return r.family=u.map((function(t){return t=t.trim(),fx[t.toLowerCase()]&&(t=t.toLowerCase()),t})),c.push(r.family),Object.defineProperty(r,"toString",{value:function(){return c.map((function(t){return Array.isArray(t)?t.map((function(t){return t.indexOf(" ")>-1?'"'+t.replace(/["']/g,"")+'"':t})).join(", "):t})).join(" ")}}),r}hx[o]=null};ax.exports.generics=fx;var bx=$(ax.exports);function vx(t){var e,i,o,n;if(at(t)||nt(t)||rt(t)){let e=Qn(t);return"number"==typeof e||"string"==typeof e?e=[e,e,e,e]:Array.isArray(e)&&(e=e.slice(0)),e}return t&&(isFinite(t.bottom)||isFinite(t.left)||isFinite(t.right)||isFinite(t.top))?[null!==(e=t.top)&&void 0!==e?e:0,null!==(i=t.right)&&void 0!==i?i:0,null!==(o=t.bottom)&&void 0!==o?o:0,null!==(n=t.left)&&void 0!==n?n:0]:[0,0,0,0]}const yx=0,Cx=1,wx=2,xx=3,_x=10,Sx=11,Ax=12,Bx=9,Rx=13,Mx=10,Tx=12,kx=32,Px=37,Ex=46,Lx=48,Hx=57,zx=65,Fx=90,Ix=97,Ox=122;function Dx(t){return function(t){return t>=Ix&&t<=Ox}(t)||function(t){return t>=zx&&t<=Fx}(t)}function Wx(t){return t===Bx||t===Mx||t===Tx||t===Rx||t===kx}function Nx(t){return t>=Lx&&t<=Hx}function Gx(t){return t===Ex}function jx(t){return Dx(t)||t===Px}function Vx(t){return new Error(`calc parse error: ${t}`)}const Ux={"*":3,"/":3,"+":2,"-":2};function $x(t,e){function i(t){const i=t.pop(),o=t.pop(),n=t.pop();if(!(n&&n.nodeType&&o&&o.type===wx&&i&&i.nodeType))throw Vx(e);return{nodeType:Sx,left:n,op:o,right:i}}const o=[];for(;t.length;){const n=t.shift();if(n.type===yx&&"("===n.value){let i=0;const n=VC.findIndex(t,(t=>{if(t.type===yx&&"("===t.value)i++;else if(t.type===yx&&")"===t.value){if(!i)return!0;i--}return!1}));if(-1===n)throw Vx(e);o.push($x(t.splice(0,n),e)),t.shift()}else if(n.type===wx){if(o.length>=3){const t=o[o.length-2].value;Ux[n.value]<=Ux[t]&&o.push(i(o))}o.push(n)}else if(n.type===Cx){const{value:t,unit:e}=n;o.push({nodeType:_x,value:t,unit:e})}else n.type===xx&&o.push({nodeType:Ax,value:n.value})}for(;o.length>1;)o.push(i(o));return o[0]}function Xx(t){return $x(function(t){const e=t.replace(/calc\(/g,"(").trim(),i=[],o=e.length;for(let s=0;s<o;s++){const o=e[s],l=o.charCodeAt(0);if("("===o||")"===o)i.push({value:o,type:yx});else if("*"===o||"/"===o)i.push({value:o,type:wx});else if("+"===o||"-"===o)s=n(o,s+1)-1;else if(Nx(l)||Gx(l))s=r(o,s+1)-1;else if(!Wx(l))throw Vx(t)}function n(t,n){if(n<o){const i=e[n],o=i.charCodeAt(0);if(Nx(o)||Gx(o))return r(t+i,n+1)}return i.push({value:t,type:wx}),n}function r(n,r){let l=r;for(;l<o;l++){const i=e[l],o=i.charCodeAt(0);if(Nx(o))n+=i;else{if("."!==i){if(jx(o))return s(n,i,l+1);break}if(n.indexOf(".")>=0)throw Vx(t);n+=i}}if("."===n)throw Vx(t);return i.push({value:parseFloat(n),type:xx}),l}function s(t,n,r){let s=r;for(;s<o;s++){const t=e[s];if(!jx(t.charCodeAt(0)))break;n+=t}return i.push({value:parseFloat(t),unit:n,type:Cx}),s}return i}(t),t)}function Yx(t,e){if(t.nodeType===Sx){const i=Yx(t.left,e),o=Yx(t.right,e);switch(t.op.value){case"+":return i+o;case"-":return i-o;case"*":return i*o;case"/":return i/o;default:throw new Error(`calc error. unknown operator: ${t.op.value}`)}}else if(t.nodeType===_x)switch(t.unit){case"%":return t.value*e.full/100;case"px":return t.value;default:throw new Error(`calc error. unknown unit: ${t.unit}`)}else if(t.nodeType===Ax)return t.value;throw new Error("calc error.")}function Kx(t,e){return Yx(Xx(t),e)}function qx(t){return!!nt(t)&&!!t.endsWith("%")&&function(t){return!(J(t)||!at(t)&&+t!=+t)}(t.substring(0,t.length-1))}function Zx(t,e){const{dataSourceEventIds:i}=t.internalProps;i&&i.forEach((e=>t.internalProps.handler.off(e))),e(t),t.internalProps.dataSourceEventIds=[t.internalProps.handler.on(t.internalProps.dataSource,rx.EVENT_TYPE.CHANGE_ORDER,(()=>{t.dataSource.hierarchyExpandLevel&&t.refreshRowColCount(),t.render()}))]}function Jx(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];Zx(t,(()=>{var i,o;t.internalProps.records=e;const n=t.internalProps.dataSource=lx.ofArray(e,t.internalProps.dataConfig,t.pagination,t.internalProps.layoutMap.columnObjects,t.internalProps.layoutMap.rowHierarchyType,null!==(i=t.options.hierarchyExpandLevel)&&void 0!==i?i:(null===(o=t._hasHierarchyTreeHeader)||void 0===o?void 0:o.call(t))?1:void 0);t.addReleaseObj(n)}))}function Qx(t,e){Zx(t,(()=>{if(e)if(e instanceof rx)t.internalProps.dataSource=e;else{const i=t.internalProps.dataSource=new lx(e);t.addReleaseObj(i)}else t.internalProps.dataSource=rx.EMPTY;t.internalProps.records=null}))}function t_(t,e){return Math.round((i=e,o=t.internalProps.calcWidthContext,"string"==typeof i?Kx(i.trim(),o):i-0));var i,o}function e_(t,e,i,o,n){let r=!(arguments.length>5&&void 0!==arguments[5])||arguments[5];const s=vx(n("padding",t,i,o,e)),l=n("bgColor",t,i,o,e),a=n("font",t,i,o,e);let h,d,c,u,g;if(a){const{family:t,size:e,weight:i,style:o,variant:n}=function(t){return bx(t)}(a);h=t.join(" "),d=e,c=i,u=o,u=n}else h=n("fontFamily",t,i,o,e),d=n("fontSize",t,i,o,e),c=n("fontWeight",t,i,o,e),u=n("fontStyle",t,i,o,e),g=n("fontVariant",t,i,o,e);const p=n("textAlign",t,i,o,e),f=n("textBaseline",t,i,o,e),m=n("color",t,i,o,e),b=n("strokeColor",t,i,o,e),v=n("lineHeight",t,i,o,e),y=n("underline",t,i,o,e),C=n("underlineDash",t,i,o,e),w=n("underlineOffset",t,i,o,e),x=n("lineThrough",t,i,o,e),_=Math.max(1,Math.floor(d/10)),S=n("textOverflow",t,i,o,e),A=n("borderColor",t,i,o,e),B=n("borderLineWidth",t,i,o,e),R=n("borderLineDash",t,i,o,e),M=n("marked",t,i,o,e),T=n("cursor",t,i,o,e),k=!(s&&l&&a&&p&&f&&m&&S&&A&&B&&R&&"boolean"==typeof y&&"boolean"==typeof x&&"boolean"==typeof M);if(!r)return{hasFunctionPros:k};const P={text:{fontFamily:h,fontSize:d,fontWeight:c,fontStyle:u,fontVariant:g,fill:m,stroke:null!=b&&b,textAlign:p,textBaseline:f,lineHeight:null!=v?v:d,underline:y?_:void 0,underlineDash:C,underlineOffset:w,lineThrough:x?_:void 0,ellipsis:"clip"===S?"":"ellipsis"===S?"...":Q(S)?S:void 0},group:{fill:l,lineDash:R,lineWidth:B,stroke:A,cursor:"auto"===T||"default"===T?void 0:T},_vtable:{padding:s,marked:M}};if(Array.isArray(B)&&(P.group.strokeArrayWidth=vx(B)),Array.isArray(A)){const t=vx(A);P.group.stroke=!t.every((t=>!t))&&t,P.group.strokeArrayColor=vx(A)}return{theme:P,hasFunctionPros:k}}function i_(t){var e;if(t.sortState){let i,o;if(Array.isArray(t.sortState)?0!==t.sortState.length&&({order:i,field:o}=null===(e=t.sortState)||void 0===e?void 0:e[0]):({order:i,field:o}=t.sortState),i&&o&&"normal"!==i){const e=t._getSortFuncFromHeaderOption(void 0,o),n=t.internalProps.layoutMap.headerObjects.find((t=>t&&t.field===o));t.dataSource.sort(n.field,i,null!=e?e:DC)}}}function o_(t,e,i){const o=i.theme.frameStyle.cornerRadius;if(o){if(0===t&&0===e)return[o,0,0,0];if(t===i.colCount-1&&0===e)return[0,o,0,0];if(0===t&&e===i.rowCount-1)return[0,0,0,o];if(t===i.colCount-1&&e===i.rowCount-1)return[0,0,o,0]}return 0}class n_ extends wa{constructor(t){super(t),"mouseenter_cell"!==this.attribute.visibleTime&&"click_cell"!==this.attribute.visibleTime||(this.attribute.opacity=0),this.attribute.hoverImage&&(this.attribute.originImage=this.attribute.image)}get backgroundWidth(){var t,e;return null!==(e=null!==(t=this.attribute.backgroundWidth)&&void 0!==t?t:this.attribute.width)&&void 0!==e?e:0}get backgroundHeight(){var t,e;return null!==(e=null!==(t=this.attribute.backgroundHeight)&&void 0!==t?t:this.attribute.height)&&void 0!==e?e:0}}function r_(t){return{rootContainer:new cs({}),renderDefault:!0}}class s_{constructor(t){this.table=t,this.customLayoutFuncCache=new Map,this.reactRemoveGraphicCache=new Map,this.headerCustomLayoutFuncCache=new Map,this.headerReactRemoveGraphicCache=new Map}hasReactCreateGraphic(t,e){return e?this.headerCustomLayoutFuncCache.has(t):this.customLayoutFuncCache.has(t)}setReactCreateGraphic(t,e,i){i?this.headerCustomLayoutFuncCache.set(t,e):this.customLayoutFuncCache.set(t,e)}setReactRemoveGraphic(t,e,i){i?this.headerReactRemoveGraphicCache.set(t,e):this.reactRemoveGraphicCache.set(t,e)}updateCustomCell(t,e){const i=this.table;if(i.isPivotTable()){const o=function(t,e,i){const o=e.internalProps.rowSeriesNumber?1:0,n=[],r=e.internalProps.layoutMap;if(i){const{headerObjects:e}=r,i=[];for(let o=0;o<e.length;o++){const n=e[o];n&&n.define.componentId===t&&i.push(n.id)}for(let t=0;t<i.length;t++){const e=i[t],o=r.getHeaderCellAdressById(e),s=r.getCellRange(o.col,o.row);n.push(s)}}else{let e;const{columnObjects:i,indicatorsAsCol:s}=r;for(let o=0;o<i.length;o++)if(i[o].define.componentId===t){e=o;break}if(s)for(let t=r.rowHeaderLevelCount+e;t<r.colCount;t+=i.length){const e={start:{col:t+o,row:r.columnHeaderLevelCount},end:{col:t+o,row:r.rowCount-1}};n.push(e)}else for(let t=r.columnHeaderLevelCount+e;t<r.rowCount;t+=i.length){const e={start:{col:r.rowHeaderLevelCount+o,row:t},end:{col:r.colCount-1,row:t}};n.push(e)}}return n}(t,i,e);for(let t=0;t<o.length;t++){const e=o[t];for(let t=e.start.col;t<=e.end.col;t++)for(let o=e.start.row;o<=e.end.row;o++)i.scenegraph.updateCellContent(t,o)}}else{const o=function(t,e,i){const o=e.internalProps.rowSeriesNumber?1:0;if(i){const i=e.internalProps.layoutMap,{headerObjects:o}=e.internalProps.layoutMap;let n;for(let e=0;e<o.length;e++){const i=o[e];if(i.define.componentId===t){n=i.id;break}}const r=i.getHeaderCellAdressById(n);return i.getCellRange(r.col,r.row)}const{columnObjects:n}=e.internalProps.layoutMap;for(let i=0;i<n.length;i++)if(n[i].define.componentId===t)return{start:{col:o+i,row:e.columnHeaderLevelCount},end:{col:o+i,row:e.rowCount-1}};return{start:{col:0,row:0},end:{col:e.colCount-1,row:e.rowCount-1}}}(t,i,e);for(let t=o.start.col;t<=o.end.col;t++)for(let e=o.start.row;e<=o.end.row;e++)i.scenegraph.updateCellContent(t,e)}i.scenegraph.renderSceneGraph()}getCustomLayoutFunc(t,e){var i;if(this.table.isHeader(t,e)){const{componentId:o}=this.table.getHeaderDefine(t,e);return null!==(i=this.headerCustomLayoutFuncCache.get(o))&&void 0!==i?i:r_}const{componentId:o}=this.table.getBodyColumnDefine(t,e);return this.customLayoutFuncCache.get(o)||r_}removeCustomCell(t,e){let i;if(this.table.isHeader(t,e)){const o=this.table.getHeaderDefine(t,e),{componentId:n}=o;i=this.headerReactRemoveGraphicCache.get(n)}else{const o=this.table.getBodyColumnDefine(t,e),{componentId:n}=o;i=this.reactRemoveGraphicCache.get(n)}i&&i(t,e)}}function l_(t){const e={abstractPos:{x:t.x,y:t.y}},i=a_(t.target);return i&&(e.eventArgs={col:i.col,row:i.row,event:t,targetCell:i,mergeInfo:h_(i),target:t.target}),e}function a_(t){for(;t&&t.parent;){if("cell"===t.role)return t;t=t.parent}return null}function h_(t){if(Q(t.mergeStartCol)&&Q(t.mergeStartRow)&&Q(t.mergeEndCol)&&Q(t.mergeEndRow))return{colStart:t.mergeStartCol,colEnd:t.mergeEndCol,rowStart:t.mergeStartRow,rowEnd:t.mergeEndRow}}const d_=/radio-\d+-\d+-(\d+)/,c_="_custom_",u_="custom-container",g_=c_+"_0";function p_(t,e,i,o,n,r,s,l,a,h,d){var c;let u,g,p,f,m=!0,b=!1;if("react-custom-layout"===t&&(t=(null===(c=d.reactCustomLayout)||void 0===c?void 0:c.getCustomLayoutFunc(i,o))||r_),"function"==typeof t){const e=t({col:i,row:o,dataValue:d.getCellOriginValue(i,o),value:d.getCellValue(i,o)||"",rect:{left:0,top:0,right:n,bottom:r,width:n,height:r},table:d});e.rootContainer&&(e.rootContainer=b_(e.rootContainer)),e.rootContainer instanceof cs&&(f=e.rootContainer,f.name=u_,f.col=i,f.row=o),m=e.renderDefault,b=e.enableCellPadding}else if("function"==typeof e){const t=e({col:i,row:o,dataValue:d.getCellOriginValue(i,o),value:d.getCellValue(i,o)||"",rect:{left:0,top:0,right:n,bottom:r,width:n,height:r},table:d});t&&(p=t.elements,m=t.renderDefault,u=t.expectedWidth,g=t.expectedHeight)}else e&&(u=e.expectedWidth,g=e.expectedHeight,p=e.elements,m=e.renderDefault);return p&&(f=function(t,e,i,o){const n=new cs({x:0,y:0,width:e,height:i,fill:!1,stroke:!1,pickable:!1});return n.name=u_,function(t,e,i,o){const n=[],r=[0,0,0,0];for(let s=0;s<t.length;s++){const l=t[s],a=Object.assign({},l);for(const t in a)a.hasOwnProperty(t)&&Z(a[t])&&(a[t]=a[t](o));const h=a;Q(h.x)&&(h.x=nt(h.x)?f_(h.x,e-r[1]):Number(h.x)),Q(h.y)&&(h.y=nt(h.y)?f_(h.y,i-r[2]):Number(h.y)),"width"in a&&(a.width=nt(a.width)?f_(a.width,e-r[1]):Number(a.width)),"height"in a&&(a.height=nt(a.height)?f_(a.height,i-r[2]):Number(a.height)),"radius"in a&&(a.radius=nt(a.radius)?f_(a.radius,Math.min(e-r[1],i-r[2])):Number(a.radius)),"hover"in a&&(a.hover.x=nt(a.hover.x)?f_(a.hover.x,e-r[1]):Number(a.hover.x),a.hover.y=nt(a.hover.y)?f_(a.hover.y,i-r[2]):Number(a.hover.y),a.hover.width=nt(a.hover.width)?f_(a.hover.width,e-r[1]):Number(a.hover.width),a.hover.height=nt(a.hover.height)?f_(a.hover.height,i-r[2]):Number(a.hover.height),a.hover.x+=0,a.hover.y+=0),h.x=h.x+0,h.y=h.y+0,n.push(a)}return n}(t,e,i,o).forEach((t=>{var e,i,o,r,s,l,a,h,d,c,u,g,p,f,m,b,v,y,C,w,x,_,S,A,B,R,M,T;switch(t.clickable&&(t.pickable=t.clickable),t.type){case"arc":const k=Ha({x:t.x,y:t.y,dx:null!==(e=t.dx)&&void 0!==e?e:0,dy:null!==(i=t.dy)&&void 0!==i?i:0,fill:t.fill,stroke:t.stroke,outerRadius:t.radius,startAngle:t.startAngle,endAngle:t.endAngle,pickable:!!t.pickable,cursor:t.cursor});k.name=t.name,n.appendChild(k);break;case"text":if(t.background){const e=null!==(r=null===(o=t.background)||void 0===o?void 0:o.expandX)&&void 0!==r?r:0,i=null!==(l=null===(s=t.background)||void 0===s?void 0:s.expandY)&&void 0!==l?l:0,p=ba({x:t.x-e,y:t.y-i,dx:null!==(a=t.dx)&&void 0!==a?a:0,dy:null!==(h=t.dy)&&void 0!==h?h:0,width:t.width+2*e,height:t.height+2*i,cornerRadius:null!==(c=null===(d=t.background)||void 0===d?void 0:d.cornerRadius)&&void 0!==c?c:0,fill:null!==(g=null===(u=t.background)||void 0===u?void 0:u.fill)&&void 0!==g?g:"#888"});n.appendChild(p)}const P=new il(Object.assign({pickable:!!t.pickable,fill:null!==(p=t.color)&&void 0!==p?p:t.fill},t));P.name=t.name,n.appendChild(P);break;case"rect":const E=ba({x:t.x,y:t.y,dx:null!==(f=t.dx)&&void 0!==f?f:0,dy:null!==(m=t.dy)&&void 0!==m?m:0,width:t.width,height:t.height,cornerRadius:t.radius,fill:t.fill,stroke:t.stroke,pickable:!!t.pickable,cursor:t.cursor});E.name=t.name,n.appendChild(E);break;case"circle":const L=qs({x:t.x,y:t.y,dx:null!==(b=t.dx)&&void 0!==b?b:0,dy:null!==(v=t.dy)&&void 0!==v?v:0,radius:t.radius,fill:t.fill,stroke:t.stroke,pickable:!!t.pickable,cursor:t.cursor});L.name=t.name,n.appendChild(L);break;case"icon":const H=new n_({x:t.x,y:t.y,dx:null!==(y=t.dx)&&void 0!==y?y:0,dy:null!==(C=t.dy)&&void 0!==C?C:0,width:t.width,height:t.height,image:t.svg,backgroundWidth:t.hover?null!==(w=t.hover.width)&&void 0!==w?w:t.width:void 0,backgroundHeight:t.hover?null!==(x=t.hover.width)&&void 0!==x?x:t.width:void 0,backgroundColor:t.hover?null!==(_=t.hover.bgColor)&&void 0!==_?_:"rgba(22,44,66,0.2)":void 0,pickable:!!t.pickable,cursor:t.cursor});H.name=t.name,H.role="icon-custom",n.appendChild(H);break;case"image":const z=new n_({x:t.x,y:t.y,dx:null!==(S=t.dx)&&void 0!==S?S:0,dy:null!==(A=t.dy)&&void 0!==A?A:0,width:t.width,height:t.height,image:t.src,backgroundWidth:t.hover?null!==(B=t.hover.width)&&void 0!==B?B:t.width:void 0,backgroundHeight:t.hover?null!==(R=t.hover.width)&&void 0!==R?R:t.width:void 0,backgroundColor:t.hover?null!==(M=t.hover.bgColor)&&void 0!==M?M:"rgba(22,44,66,0.2)":void 0,pickable:!!t.pickable,cursor:t.cursor,shape:t.shape});z.name=t.name,z.role="image-custom",n.appendChild(z);break;case"line":const F=pa({points:t.points,lineWidth:null!==(T=t.lineWidth)&&void 0!==T?T:1,stroke:t.stroke,pickable:!!t.pickable,cursor:t.cursor});F.name=t.name,n.appendChild(F)}})),n}(p,s?u:n,l?g:r,d.getCellValue(i,o))),b&&f.setAttributes({x:a[3],y:a[0],width:n-a[1]-a[3],height:r-a[0]-a[2]}),m_(f,n,r),!h||h.start.col===h.end.col&&h.start.row===h.end.row||v_(f,i,o,0),{elementsGroup:f,renderDefault:m}}function f_(t,e){return t.endsWith("px")?parseInt(t,10):t.endsWith("%")&&e?parseInt(t,10)/100*e:parseInt(t,10)}function m_(t,e,i){t&&t.forEachChildren((t=>{var o,n;t&&(tt(t.attribute.width)&&t.attribute.width.percent&&t.setAttribute("width",Math.max(0,t.attribute.width.percent/100*e+(null!==(o=t.attribute.width.delta)&&void 0!==o?o:0))),t.attribute.width<0&&t.setAttribute("width",0),tt(t.attribute.height)&&t.attribute.height.percent&&t.setAttribute("height",Math.max(0,t.attribute.height.percent/100*i+(null!==(n=t.attribute.height.delta)&&void 0!==n?n:0))),t.attribute.height<0&&t.setAttribute("height",0),"group"===t.type&&m_(t,t.attribute.width,t.attribute.height))}))}function b_(t){if(!t||!Q(t.$$typeof)&&!Q(t.vtype))return t;const e=t.type,{attribute:i,children:o,stateProxy:n}=t.props,r=e({attribute:i});return function(t,e){let i=!1;switch(t.type){case"richtext":case"rich/image":break;default:i=!0}i&&Object.keys(e).forEach((i=>{const o=Ng[i];o&&t.on(o,e[i])}))}(r,t.props),n&&(r.stateProxy=n),r.id=i.id,r.name=i.name,rt(o)?o.forEach((t=>{const e=b_(t);e&&e.type&&r.add(e)})):o&&r.add(b_(o)),r}function v_(t,e,i,o,n){t&&(t.name=`${c_}${null!=n?n:""}_${o}`,t.onBeforeAttributeUpdate=y_,"group"===t.type&&t.childrenCount&&t.forEachChildren(((t,r)=>{v_(t,e,i,r,(null!=n?n:"")+"_"+o)})))}function y_(t,e){const i=this;if(i.skipMergeUpdate)return;const o=a_(i);if(!o||o.stage)return;const n=o.stage.table;i.skipAttributeUpdate=!0;const{mergeStartCol:r,mergeEndCol:s,mergeStartRow:l,mergeEndRow:a}=o;if(Q(r)&&Q(s)&&Q(l)&&Q(a)&&(r!==s||l!==a)){for(let e=r;e<=s;e++)for(let r=l;r<=a;r++){if(e===o.col&&r===o.row)continue;const s=n.scenegraph.highPerformanceGetCell(e,r);if("cell"===s.role){const e=s.getChildByName(i.name,!0);if(!e||e.skipAttributeUpdate)continue;for(const i in t)t[i]!==e.attribute[i]&&"dx"!==i&&"dy"!==i&&e.setAttribute(i,t[i])}}i.skipAttributeUpdate=void 0}}const C_={};class w_{static setIcon(t,e){this.cache.set(t,e)}static getIcon(t){return this.cache.has(t)?this.cache.get(t):null}static hasIcon(t){return this.cache.has(t)}static clear(t){return this.cache.delete(t)}static clearAll(){this.cache=new Map}}w_.cache=new Map;const x_={get sort_downward(){return{type:"svg",svg:'<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"> <path d="M4.6665 9H11.3332L7.99984 13.1667L4.6665 9Z" fill="#282F38" fill-opacity="0.35"/><path d="M11.3335 7L4.66683 7L8.00016 2.83333L11.3335 7Z" fill="#416EFF"/> </svg>',width:16,height:16,funcType:iC.sort,name:"sort_downward",positionType:eC.contentRight,marginLeft:3,hover:{width:22,height:22,bgColor:"rgba(101, 117, 168, 0.1)"},cursor:"pointer"}},get sort_upward(){return{type:"svg",svg:'<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"> <path d="M4.6665 9H11.3332L7.99984 13.1667L4.6665 9Z" fill="#416EFF"/><path d="M11.3335 7L4.66683 7L8.00016 2.83333L11.3335 7Z" fill="#282F38" fill-opacity="0.35"/></svg> ',width:16,height:16,funcType:iC.sort,positionType:eC.contentRight,name:"sort_upward",marginLeft:3,hover:{width:22,height:22,bgColor:"rgba(101, 117, 168, 0.1)"},cursor:"pointer"}},get sort_normal(){return{type:"svg",svg:'<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M4.6665 9H11.3332L7.99984 13.1667L4.6665 9Z" fill="#282F38" fill-opacity="0.35"/><path d="M11.3335 7L4.66683 7L8.00016 2.83333L11.3335 7Z" fill="#282F38" fill-opacity="0.35"/></svg> ',width:16,height:16,funcType:iC.sort,positionType:eC.contentRight,name:"sort_normal",marginLeft:3,hover:{width:22,height:22,bgColor:"rgba(101, 117, 168, 0.1)"},cursor:"pointer"}},get freeze(){return{type:"svg",svg:'<svg width="22" height="22" viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#clip0)"><path d="M17.1313 8.42047C17.1932 8.48238 17.2423 8.55587 17.2759 8.63676C17.3094 8.71764 17.3266 8.80434 17.3266 8.89189C17.3266 8.97944 17.3094 9.06613 17.2759 9.14702C17.2423 9.2279 17.1932 9.3014 17.1313 9.3633L13.3843 13.1103C13.7007 14.3048 13.5305 15.4443 12.8388 16.2395C12.8104 16.2781 12.7778 16.3136 12.7417 16.3451L12.712 16.3755C12.6501 16.4374 12.5766 16.4865 12.4957 16.52C12.4148 16.5535 12.3281 16.5707 12.2406 16.5707C12.153 16.5707 12.0663 16.5535 11.9854 16.52C11.9046 16.4865 11.8311 16.4374 11.7692 16.3755L9.17633 13.7826L6.05316 16.9058L5.11983 17.0925C5.09291 17.0979 5.06508 17.0965 5.03881 17.0886C5.01254 17.0806 4.98863 17.0663 4.96923 17.0469C4.94982 17.0275 4.9355 17.0036 4.92755 16.9773C4.9196 16.951 4.91827 16.9232 4.92366 16.8963L5.11033 15.963L8.23333 12.8396L5.64066 10.2471C5.57875 10.1852 5.52964 10.1117 5.49614 10.0309C5.46263 9.94997 5.44539 9.86327 5.44539 9.77572C5.44539 9.68817 5.46263 9.60148 5.49614 9.52059C5.52964 9.43971 5.57875 9.36621 5.64066 9.3043C5.65066 9.2943 5.66066 9.2843 5.67099 9.27464C5.70266 9.2383 5.73833 9.20547 5.77766 9.17664C6.57283 8.48564 7.71199 8.31564 8.90599 8.63197L12.6528 4.88497C12.7147 4.82306 12.7882 4.77395 12.8691 4.74045C12.95 4.70694 13.0367 4.6897 13.1242 4.6897C13.2118 4.6897 13.2985 4.70694 13.3794 4.74045C13.4603 4.77395 13.5338 4.82306 13.5957 4.88497L17.1312 8.42047H17.1313ZM15.7172 8.8918L13.1243 6.29914L9.56483 9.8588C9.47574 9.94788 9.36323 10.0099 9.24034 10.0376C9.11746 10.0654 8.98922 10.0578 8.87049 10.0156C8.22783 9.78764 7.63899 9.7553 7.17749 9.89814L12.1182 14.8388C12.261 14.3771 12.2287 13.7885 12.0007 13.146C11.9585 13.0272 11.9509 12.899 11.9787 12.7761C12.0064 12.6532 12.0684 12.5407 12.1575 12.4516L15.7172 8.89164V8.8918Z" fill="#282F38" fill-opacity="0.2"/></g><defs><clipPath id="clip0"><rect width="22" height="22" fill="white"/></clipPath></defs></svg>',width:22,height:22,name:"freeze",funcType:iC.frozen,positionType:eC.right,marginRight:0,hover:{width:22,height:22,bgColor:"rgba(101, 117, 168, 0.1)"},cursor:"pointer"}},get frozen(){return{type:"svg",svg:'<svg width="22" height="22" viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg"> <path d="M8.49975 3.66663C8.32294 3.66663 8.15337 3.73686 8.02835 3.86189C7.90332 3.98691 7.83309 4.15648 7.83309 4.33329V9.63246C6.76475 10.2533 6.07942 11.1795 6.00625 12.2308C5.99892 12.2786 5.99692 12.3268 6.00009 12.3741L5.99975 12.4166C5.99975 12.5934 6.06999 12.763 6.19501 12.888C6.32004 13.0131 6.48961 13.0833 6.66642 13.0833H10.3333L10.3331 17.5L10.8611 18.292C10.8763 18.3148 10.8969 18.3335 10.9211 18.3464C10.9453 18.3594 10.9723 18.3662 10.9998 18.3662C11.0272 18.3662 11.0542 18.3594 11.0784 18.3464C11.1026 18.3335 11.1232 18.3148 11.1384 18.292L11.6664 17.5L11.6666 13.0833H15.3331C15.5099 13.0833 15.6795 13.0131 15.8045 12.888C15.9295 12.763 15.9998 12.5934 15.9998 12.4166C15.9998 12.4025 15.9998 12.3883 15.9994 12.3741C16.0028 12.3263 16.0008 12.2776 15.9933 12.2295C15.9196 11.1786 15.2343 10.2528 14.1664 9.63229V4.33329C14.1664 4.15648 14.0962 3.98691 13.9712 3.86189C13.8461 3.73686 13.6766 3.66663 13.4998 3.66663H8.49975Z" fill="#282F38" fill-opacity="0.35"/></svg>',width:22,height:22,name:"frozen",funcType:iC.frozen,positionType:eC.right,marginRight:0,hover:{width:22,height:22,bgColor:"rgba(101, 117, 168, 0.1)"},cursor:"pointer"}},get frozenCurrent(){return{type:"svg",svg:'<svg width="22" height="22" viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M8.49975 3.66663C8.32294 3.66663 8.15337 3.73686 8.02835 3.86189C7.90332 3.98691 7.83309 4.15648 7.83309 4.33329V9.63246C6.76475 10.2533 6.07942 11.1795 6.00625 12.2308C5.99892 12.2786 5.99692 12.3268 6.00009 12.3741L5.99975 12.4166C5.99975 12.5934 6.06999 12.763 6.19501 12.888C6.32004 13.0131 6.48961 13.0833 6.66642 13.0833H10.3333L10.3331 17.5L10.8611 18.292C10.8763 18.3148 10.8969 18.3335 10.9211 18.3464C10.9453 18.3594 10.9723 18.3662 10.9998 18.3662C11.0272 18.3662 11.0542 18.3594 11.0784 18.3464C11.1026 18.3335 11.1232 18.3148 11.1384 18.292L11.6664 17.5L11.6666 13.0833H15.3331C15.5099 13.0833 15.6795 13.0131 15.8045 12.888C15.9295 12.763 15.9998 12.5934 15.9998 12.4166C15.9998 12.4025 15.9998 12.3883 15.9994 12.3741C16.0028 12.3263 16.0008 12.2776 15.9933 12.2295C15.9196 11.1786 15.2343 10.2528 14.1664 9.63229V4.33329C14.1664 4.15648 14.0962 3.98691 13.9712 3.86189C13.8461 3.73686 13.6766 3.66663 13.4998 3.66663H8.49975Z" fill="#416EFF"/></svg>',width:22,height:22,funcType:iC.frozen,positionType:eC.right,name:"frozenCurrent",marginRight:0,hover:{width:22,height:22,bgColor:"rgba(101, 117, 168, 0.1)"},cursor:"pointer"}},get dropdownIcon(){return{type:"svg",svg:'<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><g><rect x="2" y="1" width="20" height="20" rx="10" fill="white"/><rect x="2.5" y="1.5" width="19" height="19" rx="9.5" stroke="#959DA5"/></g><path d="M14.9492 9.39531C15.0086 9.31911 15.0165 9.21887 14.9698 9.1356C14.923 9.05234 14.8294 9 14.7273 9L9.27273 9C9.17057 9 9.07697 9.05234 9.03023 9.1356C8.98348 9.21887 8.99142 9.31911 9.0508 9.39531L11.7781 12.8953C11.8293 12.961 11.9119 13 12 13C12.0881 13 12.1707 12.961 12.2219 12.8953L14.9492 9.39531Z" fill="#4F5965"/></svg>',width:24,height:24,funcType:iC.dropDown,positionType:eC.absoluteRight,name:"dropdownIcon",marginRight:0,hover:{width:24,height:24,bgColor:"rgba(101, 117, 168, 0.1)",image:'<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><g><rect x="2" y="1" width="20" height="20" rx="10" fill="#1E54C9"/><rect x="2.5" y="1.5" width="19" height="19" rx="9.5" stroke="#141414" stroke-opacity="0.2"/></g><path d="M14.9492 9.39531C15.0086 9.31911 15.0165 9.21887 14.9698 9.1356C14.923 9.05234 14.8294 9 14.7273 9L9.27273 9C9.17057 9 9.07697 9.05234 9.03023 9.1356C8.98348 9.21887 8.99142 9.31911 9.0508 9.39531L11.7781 12.8953C11.8293 12.961 11.9119 13 12 13C12.0881 13 12.1707 12.961 12.2219 12.8953L14.9492 9.39531Z" fill="white"/></svg>'},cursor:"pointer",visibleTime:"mouseenter_cell"}},get play(){return{type:"svg",svg:'<svg width="24" height="24" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg"><rect width="48" height="48" fill="white" fill-opacity="0.01" /><path d="M24 44C35.0457 44 44 35.0457 44 24C44 12.9543 35.0457 4 24 4C12.9543 4 4 12.9543 4 24C4 35.0457 12.9543 44 24 44Z" fill="none" stroke="#686a6e" stroke-width="4" stroke-linejoin="round" stroke-opacity="0.7" /><path d="M20 24V17.0718L26 20.5359L32 24L26 27.4641L20 30.9282V24Z" fill="none" stroke="#686a6e" stroke-width="4" stroke-linejoin="round" stroke-opacity="0.7" /></svg>',width:24,height:24,funcType:iC.play,positionType:eC.right,name:"play",marginRight:0,hover:{width:24,height:24,bgColor:"rgba(101, 117, 168, 0.1)"},cursor:"pointer"}},get damage_pic(){return{type:"svg",svg:'<svg width="24" height="24" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M5 10V38C5 39.1046 5.89543 40 7 40H14H18L15 29L22 27L21 20L29 16L27 13L30 8H7C5.89543 8 5 8.89543 5 10Z" fill="none" stroke="#333" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/><path d="M43 38V10C43 8.89543 42.1046 8 41 8H38L34 14L37 19L28 23L29 31L22 33L24 40H41C42.1046 40 43 39.1046 43 38Z" fill="none" stroke="#333" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/><path fill-rule="evenodd" clip-rule="evenodd" d="M14.5 18C15.3284 18 16 17.3284 16 16.5C16 15.6716 15.3284 15 14.5 15C13.6716 15 13 15.6716 13 16.5C13 17.3284 13.6716 18 14.5 18Z" fill="none" stroke="#333" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/></svg>',width:24,height:24,funcType:iC.damagePic,positionType:eC.left,name:"damage_pic",marginRight:0,hover:{width:24,height:24,bgColor:"rgba(101, 117, 168, 0.1)"},cursor:"pointer"}},get loading_pic(){return{type:"svg",svg:'<svg viewBox="0 0 400 300" fill="none" xmlns="http://www.w3.org/2000/svg"><mask id="a" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="50" y="65" width="301" height="170"><path d="M350.3 65H50v169.8h300.3V65Z" fill="#fff"/></mask><g mask="url(#a)"><path fill-rule="evenodd" clip-rule="evenodd" d="M58.3 233.2h32.8v-36.8H58.3v36.8Z" fill="#C7DEFF"/><path d="M91.1 224.5v8.8H58.3M82.4 196.2H58.3" stroke="#071F4D"/><path fill-rule="evenodd" clip-rule="evenodd" d="M305.4 182.5s-2.7 12.6 0 17.4c2.7 4.8 8.3 6.7 12.4 4.4 4.2-2.4 5.3-8.1 2.6-12.9-2.7-4.8-15-8.9-15-8.9ZM336 204.7c4.3 2 9.7-.4 12-5.4 2.3-5-1.5-17.3-1.5-17.3s-11.8 5.1-14.1 10.1c-2.3 5-.7 10.6 3.6 12.6Z" fill="#00E4E5"/><path fill-rule="evenodd" clip-rule="evenodd" d="M326.7 174s-10 11.8-10 18.6c0 6.7 4.5 12.2 10 12.2s10-5.5 10-12.3c0-6.8-10-18.5-10-18.5Z" fill="#00E4E5"/><path d="M332.3 181.5c2.3 3.6 4.4 7.8 4.4 10.9M316.7 192.5c0-3.1 2.1-7.2 4.3-10.8" stroke="#071F4D"/><path fill-rule="evenodd" clip-rule="evenodd" d="M343.1 227.3v-9.7h-34v9.7c0 3.7 3 6.6 6.6 6.6h20.9c3.6 0 6.5-2.9 6.5-6.6Z" fill="#071F4D"/><path fill-rule="evenodd" clip-rule="evenodd" d="M350.4 220.8V198H302v22.8c0 5.9 4.8 10.7 10.7 10.7h26.9c5.9 0 10.7-4.8 10.8-10.7Z" fill="#C7DEFF"/><path fill-rule="evenodd" clip-rule="evenodd" d="M331.7 74.2H117.8L87.4 203h213.8l30.5-128.8Z" fill="#fff"/><path fill-rule="evenodd" clip-rule="evenodd" d="M337 74.2h-6.2l-30.6 129.2h6.2L337 74.2Z" fill="#fff"/><path fill-rule="evenodd" clip-rule="evenodd" d="M303.8 203.5h2.4l30.7-129.3h-1.8l-31.3 129.3Z" fill="#C7DEFF"/><path d="m337 74.2-30.6 129.2h-5.9" stroke="#071F4D"/><path fill-rule="evenodd" clip-rule="evenodd" d="M229.9 202.1h-47.6l2 9.6h47.3l-1.7-9.6Z" fill="#C7DEFF"/><path fill-rule="evenodd" clip-rule="evenodd" d="M94.7 172.6 87.4 203h213.1l7.8-30.4H94.7Z" fill="#006EFF"/><path fill-rule="evenodd" clip-rule="evenodd" d="M94.7 172.6 87.4 203h213.1l7.8-30.4H94.7Z" fill="#006EFF"/><path d="M138.5 74.2h193.2l-23.4 98.6M94.5 172.7l11-46.3M104.8 155.4l-2.3 11.5h6.7M316 112.1l1.1-4.5" stroke="#071F4D"/><path fill-rule="evenodd" clip-rule="evenodd" d="M148.3 138.1h97V119h-97v19.1Z" fill="#00E4E5"/><path d="M303.1 80.6h20.3l-4.6 19.6M228.3 234.3c3.6 0 6.3-3.2 5.7-6.8l-4.1-24.1" stroke="#071F4D"/><path fill-rule="evenodd" clip-rule="evenodd" d="M226.2 229.5h-68.9v1.2c0 2 1.6 3.7 3.7 3.7h60.1c2.8 0 5-2.2 5.1-4.9Z" fill="#C7DEFF"/><path d="M180.699 226.8h-19.9c-2.8 0-4.6 3-3.3 5.5m0 0c.6 1.2 1.9 2 3.3 2h57.8M175.9 203.4l3.6 17.6M241.2 234.3h65.1M104.6 234.3h41.3" stroke="#071F4D"/><path d="M206.2 234.3h14.9c3.1 0 5.5-2.8 5-5.9l-4.3-24.9M160.7 226.8h46M62.2 226.1h-9.5c-1.2 0-2.2-1-2.2-2.2v-18.3c0-1.2 1-2.2 2.2-2.2h9.5" stroke="#071F4D"/><path d="M53.4 171.7H68c2.1 0 3.7 1.7 3.7 3.7v16.1M79.1 192v-21.8c0-2.5 2-4.6 4.6-4.6h2.2c2.5 0 4.5-2 4.5-4.5m0 0c0-2.5-2-4.5-4.5-4.5H56.1c-2.4 0-4.3-1.9-4.3-4.3V148M71.2 165.2h-18M64 181.7v10.1" stroke="#C7DEFF"/><path fill-rule="evenodd" clip-rule="evenodd" d="M85.7 120H124c4.3 0 7.7-3.5 7.7-7.7V65.5H94.2c-4.7 0-8.5 4.9-8.5 11V120Z" fill="#C7DEFF"/><path d="M85.7 110.7V73c0-4.1 3.4-7.5 7.5-7.5h38.5M146.2 73.8v-2.5c0-3.2-2-5.8-5.8-5.8-2.8 0-6 1.1-6 5.8v42.4c0 4.7-3.8 8.5-8.5 8.5h-15.6" stroke="#071F4D"/><path d="M119.7 122.3H87c-6.1 0-11.1-5-11.1-11.1m0 0h39M126.1 122.3c-6.1 0-11.1-5-11.1-11.1" stroke="#071F4D"/><path fill-rule="evenodd" clip-rule="evenodd" d="M85.4 122.1h37.2c-6.5-1.8-8-10.5-8-10.5H76.2c.6 8.8 9.2 10.5 9.2 10.5Z" fill="#071F4D"/><path fill-rule="evenodd" clip-rule="evenodd" d="M95.8 102.9h4.8V83.6h-4.8v19.3ZM106.6 102.9h4.8V77.6h-4.8v25.3ZM117.3 102.9h4.8V89.1h-4.8v13.8Z" fill="#fff"/><path d="M273.2 195.9h16.9M261.2 195.9h5" stroke="#fff"/><path d="M62.4 201.9v2.9M62.4 224.5v2.9" stroke="#071F4D"/><path d="m153.6 138.1 9.7-19.1M168.8 138.1l9.7-19.1M184.1 138.1l9.7-19.1M199.4 138.1l9.7-19.1M214.6 138.1l9.8-19.1M229.9 138.1l9.7-19.1" stroke="#fff"/><path d="M148.3 138.1h121.6V119H148.3v19.1Z" stroke="#071F4D"/></g></svg>',width:400,height:300,name:"loading_pic",positionType:eC.left}},get expand(){return{type:"svg",svg:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="none">\n <path d="M4.64988 6.81235C4.38797 6.48497 4.62106 6 5.04031 6L10.9597 6C11.3789 6 11.612 6.48497 11.3501 6.81235L8.39043 10.512C8.19027 10.7622 7.80973 10.7622 7.60957 10.512L4.64988 6.81235Z" fill="#141414" fill-opacity="0.65"/>\n </svg>',width:16,height:16,funcType:iC.expand,name:"expand",positionType:eC.contentLeft,marginLeft:0,marginRight:4,hover:{width:22,height:22,bgColor:"rgba(101, 117, 168, 0.1)"},cursor:"pointer"}},get collapse(){return{type:"svg",svg:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="none">\n <path d="M5.81235 11.3501C5.48497 11.612 5 11.3789 5 10.9597L5 5.04031C5 4.62106 5.48497 4.38797 5.81235 4.64988L9.51196 7.60957C9.76216 7.80973 9.76216 8.19027 9.51196 8.39044L5.81235 11.3501Z" fill="#141414" fill-opacity="0.65"/>\n </svg>',width:16,height:16,funcType:iC.collapse,name:"collapse",positionType:eC.contentLeft,marginLeft:0,marginRight:4,hover:{width:22,height:22,bgColor:"rgba(101, 117, 168, 0.1)"},cursor:"pointer"}},get drillDown(){return{name:"drillDown",type:"svg",positionType:eC.absolute,funcType:iC.drillDown,svg:'<svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><rect x="0" y="0" width="1024" height="1024" rx="20%" ry="20%" fill="#ffffff" /><path d="M810.666667 85.333333c70.688 0 128 57.312 128 128v597.333334c0 70.688-57.312 128-128 128H213.333333c-70.688 0-128-57.312-128-128V213.333333c0-70.688 57.312-128 128-128h597.333334z m0 85.333334H213.333333a42.666667 42.666667 0 0 0-42.613333 40.533333L170.666667 213.333333v597.333334a42.666667 42.666667 0 0 0 40.533333 42.613333L213.333333 853.333333h597.333334a42.666667 42.666667 0 0 0 42.613333-40.533333L853.333333 810.666667V213.333333a42.666667 42.666667 0 0 0-40.533333-42.613333L810.666667 170.666667zM549.333333 288a5.333333 5.333333 0 0 1 5.333334 5.333333V469.333333h176a5.333333 5.333333 0 0 1 5.333333 5.333334v74.666666a5.333333 5.333333 0 0 1-5.333333 5.333334H554.666667v176a5.333333 5.333333 0 0 1-5.333334 5.333333h-74.666666a5.333333 5.333333 0 0 1-5.333334-5.333333V554.666667H293.333333a5.333333 5.333333 0 0 1-5.333333-5.333334v-74.666666a5.333333 5.333333 0 0 1 5.333333-5.333334H469.333333V293.333333a5.333333 5.333333 0 0 1 5.333334-5.333333h74.666666z"></path></svg>',width:13,height:13,cursor:"pointer"}},get drillUp(){return{name:"drillUp",type:"svg",positionType:eC.absolute,funcType:iC.drillUp,svg:'<svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><rect x="0" y="0" width="1024" height="1024" rx="20%" ry="20%" fill="#ffffff" /><path d="M810.666667 85.333333c70.688 0 128 57.312 128 128v597.333334c0 70.688-57.312 128-128 128H213.333333c-70.688 0-128-57.312-128-128V213.333333c0-70.688 57.312-128 128-128h597.333334z m0 85.333334H213.333333a42.666667 42.666667 0 0 0-42.613333 40.533333L170.666667 213.333333v597.333334a42.666667 42.666667 0 0 0 40.533333 42.613333L213.333333 853.333333h597.333334a42.666667 42.666667 0 0 0 42.613333-40.533333L853.333333 810.666667V213.333333a42.666667 42.666667 0 0 0-40.533333-42.613333L810.666667 170.666667zM693.333333 469.333333a42.666667 42.666667 0 1 1 0 85.333334H330.666667a42.666667 42.666667 0 1 1 0-85.333334h362.666666z"></path></svg>',width:13,height:13,cursor:"pointer"}},get dragReorder(){return{type:"svg",svg:'<svg t="1710129136961" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5166" width="200" height="200"><path d="M362.666667 192m-64 0a64 64 0 1 0 128 0 64 64 0 1 0-128 0Z" fill="#666666" p-id="5167"></path><path d="M661.333333 192m-64 0a64 64 0 1 0 128 0 64 64 0 1 0-128 0Z" fill="#666666" p-id="5168"></path><path d="M362.666667 512m-64 0a64 64 0 1 0 128 0 64 64 0 1 0-128 0Z" fill="#666666" p-id="5169"></path><path d="M661.333333 512m-64 0a64 64 0 1 0 128 0 64 64 0 1 0-128 0Z" fill="#666666" p-id="5170"></path><path d="M362.666667 832m-64 0a64 64 0 1 0 128 0 64 64 0 1 0-128 0Z" fill="#666666" p-id="5171"></path><path d="M661.333333 832m-64 0a64 64 0 1 0 128 0 64 64 0 1 0-128 0Z" fill="#666666" p-id="5172"></path></svg>',width:20,height:20,funcType:iC.dragReorder,positionType:eC.left,name:"dragReorder",marginLeft:-10,marginRight:10,cursor:"grab"}}};function __(){return qC(x_,C_)}class S_ extends cs{clear(){this.removeAllChild()}getChildByName(t,e){let i=null;return this.forEachChildren((e=>e.name===t&&(i=e,!0))),e&&this.forEachChildren((e=>{if(e.getChildByName){const o=e.getChildByName(t,!0);if(o)return i=o,!0}return!1})),i}get width(){var t;let e=this.AABBBounds.width();return e!==1/0&&e!==-1/0||(e=0),Math.max(e,null!==(t=this.attribute.width)&&void 0!==t?t:0)}get height(){var t;let e=this.AABBBounds.height();return e!==1/0&&e!==-1/0||(e=0),Math.max(e,null!==(t=this.attribute.height)&&void 0!==t?t:0)}setDeltaWidth(t){var e;0!==t&&(this.setAttribute("width",(null!==(e=this.attribute.width)&&void 0!==e?e:0)+t),this.border&&(this.border.setAttribute("width",this.border.attribute.width+t),"group"===this.border.type&&this.border.firstChild.setAttribute("width",this.border.firstChild.attribute.width+t)))}setDeltaHeight(t){var e;0!==t&&(this.setAttribute("height",(null!==(e=this.attribute.height)&&void 0!==e?e:0)+t),this.border&&(this.border.setAttribute("height",this.border.attribute.height+t),"group"===this.border.type&&this.border.firstChild.setAttribute("width",this.border.firstChild.attribute.height+t)))}setDeltaX(t){0!==t&&this.setAttribute("x",this.attribute.x+t)}setDeltaY(t){0!==t&&this.setAttribute("y",this.attribute.y+t)}forEachChildrenSkipChild(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"border-rect";if(arguments.length>2&&void 0!==arguments[2]&&arguments[2]){let i=this._lastChild,o=0;for(;i;){if(i.name!==e&&t(i,o++))return;i=i._prev}}else{let i=this._firstChild,o=0;for(;i;){if(i.name!==e&&t(i,o++))return;i=i._next}}}getColGroup(t){let e=this._firstChild;if(!e)return null;for(let i=0;i<this.childrenCount;i++){if(e.col===t)return e;e=e._next}return null}getRowGroup(t){let e=this._firstChild;if(!e)return null;for(let i=0;i<this.childrenCount;i++){if(e.row===t)return e;e=e._next}return null}addCellGroup(t){if(0===this.childrenCount||this.lastChild.row===t.row-1)this.addChild(t);else{let e=this._firstChild;for(let i=0;i<this.childrenCount;i++){if(e.row===t.row-1)return void this.insertAfter(t,e);e=e._next}this.addChild(t)}}getChildAt(t){const e=super.getChildAt(t);return e&&"border-rect"===e.name?e._next:e}tryUpdateAABBBounds(){if("cell"===this.role){if(!this.shouldUpdateAABBBounds())return this._AABBBounds;const t=this.shouldSelfChangeUpdateAABBBounds(),e=this.doUpdateAABBBounds();return this.addUpdateLayoutTag(),function(t,e){t.stage&&t.stage.dirtyBounds&&t.stage.renderCount&&(t.isContainer&&!e||t.stage.dirty(t.globalAABBBounds))}(this,t),e}return super.tryUpdateAABBBounds()}doUpdateAABBBounds(){if("cell"===this.role){const t=this.attribute,{x:e,y:i,width:o,height:n}=t;return this._AABBBounds.setValue(e,i,e+o,i+n),this.parent&&this.parent.addChildUpdateBoundTag(),this.clearUpdateBoundTag(),this._AABBBounds}return"body"===this.role||"row-header"===this.role||"col-header"===this.role||"right-frozen"===this.role||"bottom-frozen"===this.role||"corner-header"===this.role||"corner-right-top-header"===this.role||"corner-right-bottom-header"===this.role||"corner-left-bottom-header"===this.role?(this._AABBBounds.setValue(-1/0,-1/0,1/0,1/0),this.parent&&this.parent.addChildUpdateBoundTag(),this.clearUpdateBoundTag(),this._AABBBounds):super.doUpdateAABBBounds()}updateColumnRowNumber(t){this.rowNumber?this.rowNumber=Math.max(this.rowNumber,t):this.rowNumber=t}updateColumnHeight(t){this.colHeight?this.colHeight+=t:this.colHeight=t}}function A_(t,e,i,o){const n=t/e;let r,s;return n>i/o?(r=i,s=r/n):(s=o,r=s*n),{width:r,height:s}}function B_(t,e,i,o,n,r){let s=arguments.length>6&&void 0!==arguments[6]?arguments[6]:"left",l=arguments.length>7&&void 0!==arguments[7]?arguments[7]:"middle",a=arguments.length>8&&void 0!==arguments[8]?arguments[8]:[0,0,0,0],h=arguments.length>9&&void 0!==arguments[9]?arguments[9]:0,d=arguments.length>10&&void 0!==arguments[10]?arguments[10]:0,c=arguments.length>11&&void 0!==arguments[11]?arguments[11]:0,u=arguments.length>12&&void 0!==arguments[12]?arguments[12]:0;const g=t+i,p=e+o;let f=t+a[3]+h;"right"===s||"end"===s?f=g-n-a[1]-d:"center"===s&&(f=t+(i-n+h-d)/2);let m=e+a[0]+c;return"bottom"===l||"alphabetic"===l||"ideographic"===l?m=p-r-a[2]-u:"middle"===l&&(m=e+(o-r+c-u)/2),{x:f,y:m}}function R_(t,e,i,o,n){const r=e&&Q(e[t])?e[t]:void 0;return"function"==typeof r?r({col:i,row:o,table:n,value:n.getCellValue(i,o),dataValue:n.getCellOriginValue(i,o),cellHeaderPaths:n.getCellHeaderPaths(i,o)}):r}function M_(t,e,i,o,n){const r=e&&Q(e[t])?e[t]:void 0;if("function"==typeof r)return r({col:i,row:o,table:n,value:n.getCellValue(i,o),dataValue:n.getCellOriginValue(i,o),cellHeaderPaths:n.getCellHeaderPaths(i,o)})}function T_(t,e,i,o){var n,r,s,l,a,h,d,c,u,g,p,f,m,b,v,y,C,w;let x=null!==(r=null===(n=null==i?void 0:i.group)||void 0===n?void 0:n.strokeArrayWidth)&&void 0!==r?r:void 0;return o.theme.cellInnerBorder||(0===t&&(x=null!=x?x:[null===(s=null==i?void 0:i.group)||void 0===s?void 0:s.lineWidth,null===(l=null==i?void 0:i.group)||void 0===l?void 0:l.lineWidth,null===(a=null==i?void 0:i.group)||void 0===a?void 0:a.lineWidth,null===(h=null==i?void 0:i.group)||void 0===h?void 0:h.lineWidth],x[3]=0),t===o.colCount-1&&(x=null!=x?x:[null===(d=null==i?void 0:i.group)||void 0===d?void 0:d.lineWidth,null===(c=null==i?void 0:i.group)||void 0===c?void 0:c.lineWidth,null===(u=null==i?void 0:i.group)||void 0===u?void 0:u.lineWidth,null===(g=null==i?void 0:i.group)||void 0===g?void 0:g.lineWidth],x[1]=0),0===e&&(x=null!=x?x:[null===(p=null==i?void 0:i.group)||void 0===p?void 0:p.lineWidth,null===(f=null==i?void 0:i.group)||void 0===f?void 0:f.lineWidth,null===(m=null==i?void 0:i.group)||void 0===m?void 0:m.lineWidth,null===(b=null==i?void 0:i.group)||void 0===b?void 0:b.lineWidth],x[0]=0),e===o.rowCount-1&&(x=null!=x?x:[null===(v=null==i?void 0:i.group)||void 0===v?void 0:v.lineWidth,null===(y=null==i?void 0:i.group)||void 0===y?void 0:y.lineWidth,null===(C=null==i?void 0:i.group)||void 0===C?void 0:C.lineWidth,null===(w=null==i?void 0:i.group)||void 0===w?void 0:w.lineWidth],x[2]=0)),x}class k_ extends S_{constructor(t){super(t),this._autoWidth=!1,this._autoHeight=!1,this._leftGroup=new S_({pickable:!1,fill:!1,stroke:!1}),this._leftGroup.role="content-left",this._rightGroup=new S_({pickable:!1,fill:!1,stroke:!1}),this._rightGroup.role="content-right",this._centerGroup=new S_({pickable:!1,fill:!1,stroke:!1}),this._centerGroup.role="content-center",this.appendChild(this._leftGroup),this.appendChild(this._rightGroup),this.appendChild(this._centerGroup)}setCellContentOption(t){this._autoWidth=t.autoWidth,this._autoHeight=t.autoHeight,this._cellWidth=t.cellWidth,this._originCellWidth=t.cellWidth,this._cellHeight=t.cellHeight,this._align=t.align,this._baseline=t.baseline}addLeftOccupyingIcon(t){var e,i,o;t.setAttribute("x",this._leftGroup.width+(null!==(e=t.attribute.marginLeft)&&void 0!==e?e:0)),this._leftGroup.appendChild(t),this._leftGroup.setDeltaWidth((null!==(i=t.attribute.marginLeft)&&void 0!==i?i:0)+(null!==(o=t.attribute.marginRight)&&void 0!==o?o:0)+t.attribute.width)}addRightOccupyingIcon(t){var e,i,o;t.setAttribute("x",this._rightGroup.width+(null!==(e=t.attribute.marginLeft)&&void 0!==e?e:0)),this._rightGroup.appendChild(t),this._rightGroup.setDeltaWidth((null!==(i=t.attribute.marginLeft)&&void 0!==i?i:0)+(null!==(o=t.attribute.marginRight)&&void 0!==o?o:0)+t.attribute.width)}addContent(t){const e=this._centerGroup.lastChild;e&&t.setAttributes({x:e.attribute.x+e.AABBBounds.width()}),this._centerGroup.appendChild(t),t instanceof il&&(this._centerGroup.setAttribute("pickable",!1),t.setAttribute("textAlign","left"))}layout(){let t=this._leftGroup.width;t===1/0&&(t=0);let e=this._rightGroup.width;if(e===-1/0&&(e=0),this._autoWidth){const i=this._centerGroup.width;this._cellWidth=t+e+i,this.setAttribute("width",this._cellWidth)}else{const i=this._cellWidth-t-e;this.updateCenterLayout(i);const o=this._centerGroup.width;this._cellWidth=t+e+o,this.setAttribute("width",this._cellWidth)}this.updateHorizontalPos();const i=this._leftGroup.height,o=this._rightGroup.height,n=this._centerGroup.height;this._cellHeight=Math.max(i,o,n),this.setAttribute("height",this._cellHeight),this.updateVerticalPos()}updateCenterLayout(t){let e=t;this._centerGroup.forEachChildren((t=>{t instanceof n_&&(e-=t.AABBBounds.width())}));const i=this._centerGroup.getChildByName("text");i instanceof Ra?i.setAttribute("width",e):i instanceof il&&i.setAttribute("maxLineWidth",e);let o=0;this._centerGroup.forEachChildren((t=>{t.setAttribute("x",o),o+=t.AABBBounds.width()}))}updateHorizontalPos(){this._leftGroup.setAttribute("x",0),this._rightGroup.setAttribute("x",this._cellWidth-this._rightGroup.width),this._centerGroup.setAttribute("x",this._leftGroup.width),"left"===this._align||"start"===this._align?this.setAttribute("dx",0):"center"===this._align?this.setAttribute("dx",-this.attribute.width/2):"right"!==this._align&&"end"!==this._align||this.setAttribute("dx",-this.attribute.width)}updateVerticalPos(){"top"===this._baseline?(this._leftGroup.setAttribute("y",0),this._rightGroup.setAttribute("y",0),this._centerGroup.setAttribute("y",0)):"middle"===this._baseline?(this._leftGroup.forEachChildren((t=>{t.setAttribute("y",(this._leftGroup.height-t.AABBBounds.height())/2)})),this._rightGroup.forEachChildren((t=>{t.setAttribute("y",(this._rightGroup.height-t.AABBBounds.height())/2)})),this._leftGroup.setAttribute("y",this._cellHeight/2-this._leftGroup.height/2),this._rightGroup.setAttribute("y",this._cellHeight/2-this._rightGroup.height/2),this._centerGroup.setAttribute("y",this._cellHeight/2-this._centerGroup.height/2)):"bottom"===this._baseline&&(this._leftGroup.forEachChildren((t=>{t.setAttribute("y",this._leftGroup.height-t.AABBBounds.height())})),this._rightGroup.forEachChildren((t=>{t.setAttribute("y",this._rightGroup.height-t.AABBBounds.height())})),this._leftGroup.setAttribute("y",this._cellHeight-this._leftGroup.height),this._rightGroup.setAttribute("y",this._cellHeight-this._rightGroup.height),this._centerGroup.setAttribute("y",this._cellHeight-this._centerGroup.height))}updateWidth(t){this._cellWidth=t,this._originCellWidth=t,this.layout()}updateHeight(t){this._cellHeight=t,this._cellWidth=this._originCellWidth,this.layout()}}function P_(t,e,i){var o,n,r;let s=0;const l=i.internalProps.layoutMap;if(l.isHeader(t,e)){const r=l.getHeader(t,e);Q(null==r?void 0:r.hierarchyLevel)&&(s=(null!==(o=r.hierarchyLevel)&&void 0!==o?o:0)*(null!==(n=l.rowHierarchyIndent)&&void 0!==n?n:0),l.rowHierarchyTextStartAlignment&&!i.internalProps.headerHelper.getHierarchyIcon(t,e)&&(s+=i.internalProps.headerHelper.getHierarchyIconWidth()))}else{const o=i.getBodyColumnDefine(t,e);if(null==o?void 0:o.tree){const o=i.dataSource.getIndexKey(i.getRecordShowIndexByCell(t,e));s=Array.isArray(o)&&i.getHierarchyState(t,e)!==Jy.none?(o.length-1)*(null!==(r=l.hierarchyIndent)&&void 0!==r?r:0):0,l.hierarchyTextStartAlignment&&!i.internalProps.bodyHelper.getHierarchyIcon(t,e)&&(s+=i.internalProps.bodyHelper.getHierarchyIconWidth())}}return s}function E_(t,e){var i,o;let n,r=!1;for(nt(t)&&t.length>(e.options.maxCharactersNumber||200)&&(t=t.slice(0,e.options.maxCharactersNumber||200),t+="…",r=!0),n=e.internalProps.enableLineBreak||(null===(i=e.options.customConfig)||void 0===i?void 0:i.multilinesForXTable)?LC(t).replace(/\r?\n/g,"\n").replace(/\r/g,"\n").split("\n")||[]:[LC(t)];n.length&&n.length>1&&!n[n.length-1];)n.pop();if((null===(o=e.options.customConfig)||void 0===o?void 0:o.multilinesForXTable)&&!e.internalProps.autoWrapText)for(;n.length&&n.length>1&&!n[0];)n.shift();return{text:n,moreThanMaxCharacters:r}}function L_(t,e,i,o,n,r,s){var l,a,h,d,c,u;const g={};"image"===t.type?g.image=t.src:("svg"===t.type||"svg"in t)&&(g.image=t.svg),g.width=t.width,g.height=t.height,g.visibleTime=null!==(l=t.visibleTime)&&void 0!==l?l:"always",g.funcType=t.funcType,g.interactive=t.interactive;let p=0;if(s&&0!==(null==s?void 0:s.addedHierarchyOffset)||!at(i)||!at(o)||!r||t.funcType!==iC.collapse&&t.funcType!==iC.expand&&t.positionType!==eC.contentLeft&&t.positionType!==eC.contentRight||(p=n?P_(n.start.col,n.start.row,r):P_(i,o,r),s&&(s.addedHierarchyOffset=1)),g.marginLeft=(null!==(a=t.marginLeft)&&void 0!==a?a:0)+p,g.marginRight=null!==(h=t.marginRight)&&void 0!==h?h:0,!1===t.interactive&&(g.pickable=!1),t.hover&&(g.backgroundWidth=null!==(d=t.hover.width)&&void 0!==d?d:t.width,g.backgroundHeight=null!==(c=t.hover.width)&&void 0!==c?c:t.width,g.backgroundColor=null!==(u=t.hover.bgColor)&&void 0!==u?u:"rgba(22,44,66,0.2)",g.hoverImage=t.hover.image),t.cursor&&(g.cursor=t.cursor),"shape"in t&&"circle"===t.shape&&(g.shape=t.shape),e)return e.setAttributes(g),e.loadImage(g.image),e;const f=new n_(g);return f.tooltip=t.tooltip,f}function H_(t){var e,i,o,n,r,s;const l={};return"image"===t.type?l.image=t.src:("svg"===t.type||"svg"in t)&&(l.image=t.svg),l.visibleTime=null!==(e=t.visibleTime)&&void 0!==e?e:"always",l.funcType=t.funcType,l.id=t.name,l.width=t.width,l.height=t.height,(t.marginRight||t.marginLeft)&&(l.margin=[0,null!==(i=t.marginRight)&&void 0!==i?i:0,0,null!==(o=t.marginLeft)&&void 0!==o?o:0]),t.hover&&(l.backgroundWidth=null!==(n=t.hover.width)&&void 0!==n?n:t.width,l.backgroundHeight=null!==(r=t.hover.height)&&void 0!==r?r:t.height,l.backgroundShowMode="hover",l.hoverImage=t.hover.image,l.backgroundStroke=!1,l.backgroundFill=null!==(s=t.hover.bgColor)&&void 0!==s?s:"rgba(22,44,66,0.2)"),t.cursor&&(l.cursor=t.cursor),l.tooltip=t.tooltip,l}function z_(t,e,i,o,n,r,s,l,a){var h,d,c,u;ht(t.contentWidth)&&(o=e-(null!==(h=t.contentWidth)&&void 0!==h?h:t.attribute.width));let g,p=0,f=0,m=0,b=0;t.forEachChildren((t=>{"icon-left"===t.role?(p+=t.AABBBounds.width(),f=Math.max(f,t.AABBBounds.height())):"icon-right"===t.role&&(m+=t.AABBBounds.width(),b=Math.max(b,t.AABBBounds.height()))}));const v=t.getChildByName("text"),y=t.getChildByName("content");let C;v instanceof il?(g=v.AABBBounds.height(),v.setAttribute("maxLineWidth",e-p-b-(r[1]+r[3])-(null!==(d=v.attribute.dx)&&void 0!==d?d:0)-(null!==(c=a.table.theme._contentOffset)&&void 0!==c?c:0)),C=v.AABBBounds.height()):v instanceof Ra?(g=v.AABBBounds.height(),v.setAttribute("width",e-p-b-(r[1]+r[3])),C=v.AABBBounds.height()):y&&(g=y.AABBBounds.height(),y.updateWidth(e-p-b-(r[1]+r[3])),C=y.AABBBounds.height());const w=Math.round(Math.max(f,b,g)+r[0]+r[2]);if(t.forEachChildren((i=>{var n;if("icon-left"===i.role);else if("icon-right"===i.role)i.setAttribute("x",i.attribute.x+o);else if("icon-absolute-right"===i.role)i.setAttribute("x",i.attribute.x+o);else if("content"===i.name||"text"===i.name&&"richtext"!==i.type){const t=null!==(n=i.attribute.textAlign)&&void 0!==n?n:s;"center"===t?i.setAttribute("x",r[3]+p+(e-(r[1]+r[3])-p-m)/2):"right"===t&&i.setAttribute("x",r[3]+e-(r[1]+r[3])-m)}else"mark"===i.name&&i.setAttribute("x",t.attribute.width)})),n){let e=Math.max(f,C,b);if(function(t,e,i,o){const n=t.table,r=jw(n,e.col,e.row);if(r&&r.end.row-r.start.row){o/=r.end.row-r.start.row+1,i/=r.end.row-r.start.row+1;for(let t=r.start.row;t<=r.end.row;t++){const e=n.getRowHeight(t);if(e===o&&i!==e)return!0;if(i>e)return!0}}else{const t=n.getRowHeight(e.row);if(t===o&&i!==t)return!0;if(i>t)return!0}return!1}(a,t,Math.round(e+r[0]+r[2]),w))return!0;e=(null!==(u=t.contentHeight)&&void 0!==u?u:i)-(r[0]+r[2]),t.forEachChildren((t=>{"rect"!==t.type&&"chart"!==t.type&&("mark"===t.name?t.setAttribute("y",0):"middle"===l?t.setAttribute("y",r[0]+(e-t.AABBBounds.height())/2):"bottom"===l?t.setAttribute("y",r[0]+e-t.AABBBounds.height()):t.setAttribute("y",r[0]))}))}else"middle"!==l&&"bottom"!==l||t.forEachChildren((t=>{"rect"!==t.type&&"chart"!==t.type&&("mark"===t.name?t.setAttribute("y",0):"middle"===l?t.setAttribute("y",(i-r[2]+r[0]-t.AABBBounds.height())/2):"bottom"===l?t.setAttribute("y",i-t.AABBBounds.height()-r[2]):t.setAttribute("y",r[0]))}));return!1}function F_(t,e,i,o,n,r,s){const l=e-Math.floor(n[0]+n[2]),a=t.getChildByName("text");a instanceof il&&!o?a.setAttributes({heightLimit:l}):a instanceof Ra&&!o?a.setAttributes({height:l}):t.getChildByName("content")&&t.getChildByName("content").updateHeight(l),t.forEachChildren((t=>{t.setAttribute("dy",0),"rect"===t.type||"chart"===t.type||("mark"===t.name?t.setAttribute("y",0):"middle"===s?t.setAttribute("y",n[0]+(l-t.AABBBounds.height())/2):"bottom"===s?t.setAttribute("y",n[0]+l-t.AABBBounds.height()):t.setAttribute("y",n[0]))}))}function I_(t,e,i,o){const n=[],r=[],s=[],l=[],a=[],h=[],d=[],c=[];let u=0,g=0,p=0,f=0,m=0,b=0;return t.forEach((t=>{switch(t.positionType){case eC.left:n.push(t);break;case eC.right:r.push(t);break;case eC.contentLeft:s.push(t);break;case eC.contentRight:l.push(t);break;case eC.absoluteRight:c.push(t);break;case eC.inlineFront:a.push(t);break;case eC.inlineEnd:h.push(t)}})),n.forEach((t=>{var n,r,s;const l=L_(t,void 0,e.col,e.row,i,o);l.role="icon-left",l.name=t.name,l.setAttribute("x",u+(null!==(n=l.attribute.marginLeft)&&void 0!==n?n:0)),u+=l.AABBBounds.width()+(null!==(r=l.attribute.marginLeft)&&void 0!==r?r:0)+(null!==(s=l.attribute.marginRight)&&void 0!==s?s:0),g=Math.max(g,l.AABBBounds.height()),e.appendChild(l)})),r.forEach((t=>{var n,r,s;const l=L_(t,void 0,e.col,e.row,i,o);l.role="icon-right",l.name=t.name,l.setAttribute("x",p+(null!==(n=l.attribute.marginLeft)&&void 0!==n?n:0)),p+=l.AABBBounds.width()+(null!==(r=l.attribute.marginLeft)&&void 0!==r?r:0)+(null!==(s=l.attribute.marginRight)&&void 0!==s?s:0),f=Math.max(f,l.AABBBounds.height()),e.appendChild(l)})),d.forEach((t=>{var n,r,s;const l=L_(t,void 0,e.col,e.row,i,o);l.role="icon-absolute-left",l.name=t.name,l.setAttribute("x",m+(null!==(n=l.attribute.marginLeft)&&void 0!==n?n:0)),m+=l.AABBBounds.width()+(null!==(r=l.attribute.marginLeft)&&void 0!==r?r:0)+(null!==(s=l.attribute.marginRight)&&void 0!==s?s:0),e.appendChild(l)})),c.forEach((t=>{var n,r,s;const l=L_(t,void 0,e.col,e.row,i,o);l.role="icon-absolute-right",l.name=t.name,l.setAttribute("x",b+(null!==(n=l.attribute.marginLeft)&&void 0!==n?n:0)),b+=l.AABBBounds.width()+(null!==(r=l.attribute.marginLeft)&&void 0!==r?r:0)+(null!==(s=l.attribute.marginRight)&&void 0!==s?s:0),e.appendChild(l)})),{leftIcons:n,rightIcons:r,contentLeftIcons:s,contentRightIcons:l,inlineFrontIcons:a,inlineEndIcons:h,absoluteLeftIcons:d,absoluteRightIcons:c,leftIconWidth:u,leftIconHeight:g,rightIconWidth:p,rightIconHeight:f,absoluteLeftIconWidth:m,absoluteRightIconWidth:b}}function O_(t,e,i,o,n,r,s,l,a,h,d,c,u,g,p,f,m){var b,v,y,C,w,x,_,S,A,B,R,M,T,k,P,E,L,H,z,F,I,O,D,W,N,G,j,V,U,$;const X=M_("padding",g._getCellStyle(o,n),o,n,g);(null===(b=g.options.customConfig)||void 0===b?void 0:b.imageMargin)?h=vx(null===(v=g.options.customConfig)||void 0===v?void 0:v.imageMargin):Q(X)&&(h=X),(null===(y=null==p?void 0:p.text)||void 0===y?void 0:y.textAlign)&&(d=null===(C=null==p?void 0:p.text)||void 0===C?void 0:C.textAlign),(null===(w=null==p?void 0:p.text)||void 0===w?void 0:w.textBaseline)&&(c=null===(x=null==p?void 0:p.text)||void 0===x?void 0:x.textBaseline);const Y=T_(o,n,p,g);let K,q;if(m&&(K=g.scenegraph.highPerformanceGetCell(o,n,!0),K&&"cell"===K.role&&K.setAttributes({x:e,y:i,width:r,height:s,lineWidth:null!==(S=null===(_=null==p?void 0:p.group)||void 0===_?void 0:_.lineWidth)&&void 0!==S?S:void 0,fill:null!==(B=null===(A=null==p?void 0:p.group)||void 0===A?void 0:A.fill)&&void 0!==B?B:void 0,stroke:null!==(M=null===(R=null==p?void 0:p.group)||void 0===R?void 0:R.stroke)&&void 0!==M?M:void 0,strokeArrayWidth:null!=Y?Y:void 0,strokeArrayColor:null!==(k=null===(T=null==p?void 0:p.group)||void 0===T?void 0:T.strokeArrayColor)&&void 0!==k?k:void 0,cursor:null!==(E=null===(P=null==p?void 0:p.group)||void 0===P?void 0:P.cursor)&&void 0!==E?E:void 0,lineDash:null!==(H=null===(L=null==p?void 0:p.group)||void 0===L?void 0:L.lineDash)&&void 0!==H?H:void 0,lineCap:"butt",clip:!0,cornerRadius:p.group.cornerRadius})),K&&"cell"===K.role||(K=new S_({x:e,y:i,width:r,height:s,lineWidth:null!==(F=null===(z=null==p?void 0:p.group)||void 0===z?void 0:z.lineWidth)&&void 0!==F?F:void 0,fill:null!==(O=null===(I=null==p?void 0:p.group)||void 0===I?void 0:I.fill)&&void 0!==O?O:void 0,stroke:null!==(W=null===(D=null==p?void 0:p.group)||void 0===D?void 0:D.stroke)&&void 0!==W?W:void 0,strokeArrayWidth:null!=Y?Y:void 0,strokeArrayColor:null!==(G=null===(N=null==p?void 0:p.group)||void 0===N?void 0:N.strokeArrayColor)&&void 0!==G?G:void 0,cursor:null!==(V=null===(j=null==p?void 0:p.group)||void 0===j?void 0:j.cursor)&&void 0!==V?V:void 0,lineDash:null!==($=null===(U=null==p?void 0:p.group)||void 0===U?void 0:U.lineDash)&&void 0!==$?$:void 0,lineCap:"butt",clip:!0,cornerRadius:p.group.cornerRadius}),K.role="cell",K.col=o,K.row=n,null==t||t.addCellGroup(K)),u){let t=o,e=n;f&&(t=f.start.col,e=f.start.row),q=g.getCellIcons(t,e)}let Z=0,J=0,tt=0;if(Array.isArray(q)&&0!==q.length){const{leftIconWidth:t,rightIconWidth:e,absoluteLeftIconWidth:i,absoluteRightIconWidth:o}=I_(q,K,f,g);Z=t+e,J=t,tt=e,K.forEachChildren((t=>{"icon-left"===t.role?t.setAttribute("x",t.attribute.x+h[3]):"icon-right"===t.role?t.setAttribute("x",t.attribute.x+r-e-h[1]):"icon-absolute-right"===t.role&&t.setAttribute("x",t.attribute.x+r-o-h[1])})),K.forEachChildren((t=>{"middle"===c?t.setAttribute("y",(s-t.AABBBounds.height())/2):"bottom"===c?t.setAttribute("y",s-t.AABBBounds.height()-h[2]):t.setAttribute("y",h[0])})),K._cellLeftIconWidth=J,K._cellRightIconWidth=tt}const et=g.getCellValue(o,n),it=xa({x:h[3],y:h[0],width:r-h[1]-h[3]-Z,height:s-h[0]-h[2],image:et,cursor:"pointer"});return it.name="image",it.keepAspectRatio=l,it.textAlign=d,it.textBaseline=c,l||a?it.resources&&it.resources.has(it.attribute.image)&&"success"===it.resources.get(it.attribute.image).state?setTimeout((()=>{j_(a,l,h,d,c,it,K,g)}),0):it.successCallback=()=>{j_(a,l,h,d,c,it,K,g),g.scenegraph.updateNextFrame()}:it.resources&&it.resources.has(it.attribute.image)&&"success"===it.resources.get(it.attribute.image).state?W_(K,o,n,0,0,g):it.successCallback=()=>{W_(K,o,n,0,0,g)},it.failCallback=()=>{const t=__();it.image=t.damage_pic.svg},K.appendChild(it),K}function D_(t,e,i,o,n,r,s){let l=!1,a=null,h=null;const{width:d,height:c,isMerge:u}=N_(s,n.table);if(d<i+r[1]+r[3]&&(a=i+r[1]+r[3],l=!0),c<o+r[2]+r[0]&&(h=o+r[2]+r[0],l=!0),l){if("number"==typeof a)if(u)for(let t=s.mergeStartCol;t<=s.mergeEndCol;t++)n.setColWidth(t,a/(s.mergeEndCol-s.mergeStartCol+1));else n.setColWidth(t,a);if("number"==typeof h)if(u)for(let t=s.mergeStartRow;t<=s.mergeEndRow;t++)n.setRowHeight(t,h/(s.mergeEndRow-s.mergeStartRow+1));else n.setRowHeight(e,h);return n.component.updateScrollBar(),!0}return!1}function W_(t,e,i,o,n,r){var s,l,a,h,d,c,u,g,p,f,m,b;const v=t.getChildByName("image");if(!v)return;const y="string"!=typeof v.attribute.image&&v.attribute.image||(null===(s=v.resources)||void 0===s?void 0:s.get(v.attribute.image).data);if(!y)return;const C=r._getCellStyle(e,i),w=null!==(l=R_("textAlign",C,e,i,r))&&void 0!==l?l:"left",x=null!==(a=R_("textBaseline",C,e,i,r))&&void 0!==a?a:"middle";let _;_=(null===(h=r.options.customConfig)||void 0===h?void 0:h.imageMargin)?vx(null===(d=r.options.customConfig)||void 0===d?void 0:d.imageMargin):null!==(c=vx(R_("padding",C,e,i,r)))&&void 0!==c?c:[0,0,0,0];const{width:S,height:A,isMerge:B}=N_(t,r),R=null!==(u=t.mergeStartCol)&&void 0!==u?u:t.col,M=null!==(g=t.mergeStartRow)&&void 0!==g?g:t.row,T=null!==(p=t.mergeEndCol)&&void 0!==p?p:t.col,k=null!==(f=t.mergeEndCol)&&void 0!==f?f:t.row,P=null!==(m=t._cellLeftIconWidth)&&void 0!==m?m:0,E=null!==(b=t._cellRightIconWidth)&&void 0!==b?b:0;if(v.keepAspectRatio){const{width:t,height:e}=A_(y.width||y.videoWidth,y.height||y.videoHeight,S-(_[1]+_[3]),A-(_[0]+_[2])),i=B_(0,0,S,A,t,e,w,x,_);for(let o=R;o<=T;o++)for(let n=M;n<=k;n++){const s=r.scenegraph.getCell(o,n).getChildByName("image");null==s||s.setAttributes({x:i.x,y:i.y,width:t,height:e})}}else for(let t=R;t<=T;t++)for(let e=M;e<=k;e++){const i=r.scenegraph.getCell(t,e).getChildByName("image");null==i||i.setAttributes({x:P+_[3],y:_[0],width:S-_[1]-_[3]-E-P,height:A-_[0]-_[2]})}if(t.getChildByName("play-icon")){const e=0,i=0,{width:o,height:n}=N_(t,r),s=Math.floor(Math.min(o-_[1]-_[3],n-_[2]-_[0])/2),l=e+(o>v.attribute.width?v.attribute.x-e+v.attribute.width/2:o/2),a=i+(n>v.attribute.height?v.attribute.y-i+v.attribute.height/2:n/2);for(let t=R;t<=T;t++)for(let e=M;e<=k;e++)r.scenegraph.getCell(t,e).getChildByName("play-icon").setAttributes({x:l-s/2,y:a-s/2,width:s,height:s})}t.forEachChildren((t=>{"icon-left"===t.role||("icon-right"===t.role||"icon-absolute-right"===t.role)&&t.setAttribute("x",t.attribute.x+o)})),t.forEachChildren((t=>{("rect"===t.type||t.role&&t.role.startsWith("icon"))&&("middle"===x?t.setAttribute("y",_[0]+(A-_[0]-_[2]-t.AABBBounds.height())/2):"bottom"===x?t.setAttribute("y",_[0]+A-_[0]-_[2]-t.AABBBounds.height()):t.setAttribute("y",_[0]))})),B&&G_(t.mergeStartCol,t.mergeEndCol,t.mergeStartRow,t.mergeEndRow,r)}function N_(t,e){return"cell"===t.role&&Q(t.mergeStartCol)&&Q(t.mergeEndCol)&&Q(t.mergeStartRow)&&Q(t.mergeEndRow)?{width:e.getColsWidth(t.mergeStartCol,t.mergeEndCol),height:e.getRowsHeight(t.mergeStartRow,t.mergeEndRow),isMerge:!0}:{width:t.attribute.width,height:t.attribute.height,isMerge:!1}}function G_(t,e,i,o,n){for(let r=t;r<=e;r++)for(let t=i;t<=o;t++){const e=n.scenegraph.getCell(r,t);if(e){const i=e.getChildByName("image");i&&i.setAttributes({dx:-n.getColsWidth(e.mergeStartCol,r-1),dy:-n.getRowsHeight(e.mergeStartRow,t-1)});const o=e.getChildByName("play-icon");o&&o.setAttributes({dx:-n.getColsWidth(e.mergeStartCol,r-1),dy:-n.getRowsHeight(e.mergeStartRow,t-1)})}}}function j_(t,e,i,o,n,r,s,l){const a=r.resources.get(r.attribute.image).data,{col:h,row:d}=s;if(t&&!V_(r)&&D_(h,d,a.width,a.height,l.scenegraph,i,s),e||V_(r)){const{width:t,height:e,isMerge:h}=N_(s,l),{width:d,height:c}=A_(a.width,a.height,t-i[1]-i[3],e-i[0]-i[2]),u=B_(0,0,t,e,d,c,o,n,i);r.setAttributes({x:u.x,y:u.y,width:d,height:c}),h&&G_(s.mergeStartCol,s.mergeEndCol,s.mergeStartRow,s.mergeEndRow,l)}}function V_(t){const e=__();return t.attribute.image===e.damage_pic.svg}function U_(t,e,i){t.then((()=>{i(),e.scenegraph.updateNextFrame()})).catch((t=>{}))}function $_(t,e,i,o,n,r,s,l,a,h,d,c,u,g,p,f,m,b){var v;let y,C=!1;if(tw(e)&&(e=o.getCellValue(n,r),C=!0),"text"===t||"link"===t){if("link"===t){const s=e,l=o._getCellStyle(n,r);"link"===t&&("templateLink"in i&&i.templateLink||!("linkDetect"in i)||!i.linkDetect||Rw.test(s))&&(f?(f.text.fill=R_("linkColor",l,n,r,o),f.group.cursor="pointer"):f={text:{fill:R_("linkColor",l,n,r,o)},group:{cursor:"pointer"}})}let v,w=!0;if(b)v=b.elementsGroup,w=b.renderDefault;else{let t,e;if("body"!==o.getCellLocation(n,r)?(t=null==i?void 0:i.headerCustomRender,e=null==i?void 0:i.headerCustomLayout):(t=(null==i?void 0:i.customRender)||o.customRender,e=null==i?void 0:i.customLayout),e||t){const i=p_(e,t,n,r,l,a,!1,o.isAutoRowHeight(r),c,m,o);v=i.elementsGroup,w=i.renderDefault}}y=Vw.getFunction("createTextCellGroup")(o,e,h,0,d,n,r,s,l,a,c,u,g,p,v,w,f,m,C);const x=o.internalProps.layoutMap.getAxisConfigInPivotChart(n,r);if(x){const t=new(Vw.getComponent("axis"))(x,y.attribute.width,y.attribute.height,c,o);y.clear(),y.appendChild(t.component),t.overlap()}else o.internalProps.layoutMap.isEmpty(n,r)?(y.setAttributes({fill:!1,stroke:!1}),y.clear()):o.internalProps.layoutMap.isAxisCell(n,r)&&y.clear()}else if("image"===t)y=Vw.getFunction("createImageCellGroup")(h,0,d,n,r,l,a,i.keepAspectRatio,i.imageAutoSizing,c,u,g,p,o,f,m,C);else if("video"===t)y=Vw.getFunction("createVideoCellGroup")(h,0,d,n,r,l,a,i.keepAspectRatio,i.imageAutoSizing,c,u,g,p,o,f,m,C);else if("chart"===t){const t=o.internalProps.layoutMap.getChartInstance(n,r);y=Vw.getFunction("createChartCellGroup")(null,h,0,d,n,r,l,a,c,e,i.chartModule,o.internalProps.layoutMap.getChartSpec(n,r),t,null!==(v=o.internalProps.layoutMap.getChartDataId(n,r))&&void 0!==v?v:"data",o,f,o.internalProps.layoutMap.isShareChartSpec(n,r),C)}else if("progressbar"===t){const t=o._getCellStyle(n,r),p=o.getCellOriginValue(n,r);y=Vw.getFunction("createTextCellGroup")(o,e,h,0,d,n,r,s,l,a,c,u,g,!1,null,!0,f,m,C);const b=Vw.getFunction("createProgressBarCell")(i,t,s,e,p,n,r,c,o);y.firstChild?y.insertBefore(b,y.firstChild):y.appendChild(b)}else"sparkline"===t?y=Vw.getFunction("createSparkLineCellGroup")(null,h,0,d,n,r,l,a,c,o,f,C):"checkbox"===t?y=Vw.getFunction("createCheckboxCellGroup")(null,h,0,d,n,r,s,l,a,c,u,g,p,o,f,i,m,C):"radio"===t&&(y=Vw.getFunction("createRadioCellGroup")(null,h,0,d,n,r,s,l,a,c,u,g,o,f,i));return y}function X_(t,e,i,o){var n,r,s,l,a,h,d,c,u,g,p,f,m,b,v,y;const C=i.scenegraph.highPerformanceGetCell(t,e,!0),w=i._getCellStyle(t,e),x=null!==(n=w.autoWrapText)&&void 0!==n?n:i.internalProps.autoWrapText,_=i.getCellLocation(t,e);let S,A,B,R,M,T=i.getCellValue(t,e);if(i.internalProps.customMergeCell){const o=i.getCustomMerge(t,e);if(o){const{range:n,text:r,style:s,customLayout:l,customRender:a}=o;A=n,S=A.start.col!==A.end.col||A.start.row!==A.end.row,T=r,R=s,R&&(B=e_(R,i,A.start.col,A.start.row,R_).theme,B.group.cornerRadius=o_(t,e,i)),(l||a)&&(M=p_(l,a,n.start.col,n.start.row,i.getColsWidth(n.start.col,n.end.col),i.getRowsHeight(n.start.row,n.end.row),!1,i.isAutoRowHeight(e),[0,0,0,0],A,i))}}let k=t,P=e;A&&(k=A.start.col,P=A.start.row);const E="body"!==_?i.getHeaderDefine(k,P):i.getBodyColumnDefine(k,P);if(A||"body"===_&&!(null==E?void 0:E.mergeCell)||(A=i.getCellRange(t,e),S=A.start.col!==A.end.col||A.start.row!==A.end.row),B||(B=e_(w,i,S?A.start.col:t,S?A.start.row:e,R_).theme),B.group.cornerRadius=o_(t,e,i),!o&&!S&&!(E.customLayout||E.customRender||E.headerCustomLayout||E.headerCustomRender)&&function(t,e,i,o,n){var r;const s=n.getBodyColumnDefine(t,e),l=!!(null==s?void 0:s.icon)||!!(null==s?void 0:s.tree)||(null==s?void 0:s.dragOrder),a=n.getBodyColumnType(t,e),h=n.isAutoRowHeight(e),d=n.getCellValue(t,e);return!(n.isHeader(t,e)||"cell"!==i.role||"text"!==a||o||h||l||"text"!==(null===(r=i.firstChild)||void 0===r?void 0:r.type)||tw(d))}(t,e,C,x,i)){const o=i.getColWidth(t),n=i.getRowHeight(e);C.setAttributes({width:o,height:n,lineWidth:null!==(s=null===(r=null==B?void 0:B.group)||void 0===r?void 0:r.lineWidth)&&void 0!==s?s:void 0,fill:null!==(a=null===(l=null==B?void 0:B.group)||void 0===l?void 0:l.fill)&&void 0!==a?a:void 0,stroke:null!==(d=null===(h=null==B?void 0:B.group)||void 0===h?void 0:h.stroke)&&void 0!==d?d:void 0,strokeArrayWidth:null!==(u=null===(c=null==B?void 0:B.group)||void 0===c?void 0:c.strokeArrayWidth)&&void 0!==u?u:void 0,strokeArrayColor:null!==(p=null===(g=null==B?void 0:B.group)||void 0===g?void 0:g.strokeArrayColor)&&void 0!==p?p:void 0,cursor:null!==(m=null===(f=null==B?void 0:B.group)||void 0===f?void 0:f.cursor)&&void 0!==m?m:void 0,cornerRadius:null!==(v=null===(b=null==B?void 0:B.group)||void 0===b?void 0:b.cornerRadius)&&void 0!==v?v:0,y:i.scenegraph.getCellGroupY(e)}),C.forEachChildren((t=>{t.setAttributes({dx:0,dy:0})}));const _=C.getChildByName("text");if(_){const r=i.getCellValue(t,e),{text:s,moreThanMaxCharacters:l}=E_(r,i),a=P_(t,e,i),h=w.lineClamp,d=null!==(y=vx(R_("padding",w,t,e,i)))&&void 0!==y?y:[0,0,0,0],c=B.text.textAlign;let u=0;u="center"===c?d[3]+(o-(d[1]+d[3]))/2:"right"===c?d[3]+o-(d[1]+d[3]):d[3];const g={text:1!==s.length||x?s:s[0],moreThanMaxCharacters:l,maxLineWidth:o-(d[1]+d[3]+a),textBaseline:"top",autoWrapText:x,lineClamp:h,wordBreak:"break-word",heightLimit:n-Math.floor(d[0]+d[2]),pickable:!1,dx:"left"===c?a:0,x:u};if(_.setAttributes(B.text?Object.assign({},B.text,g):g),_.attribute.text){const t=B.text.textBaseline,e=n-(d[0]+d[2]);let i=0;i="middle"===t?d[0]+(e-_.AABBBounds.height())/2:"bottom"===t?d[0]+e-_.AABBBounds.height():d[0],_.setAttributes({y:i})}}return C}if(!o&&"empty"===C.role)return;const L=i.isHeader(t,e)?i._getHeaderLayoutMap(t,e).headerType:i.getBodyColumnType(t,e),H="body"!==_||(null==E?void 0:E.dragOrder)||!!(null==E?void 0:E.icon)||!!(null==E?void 0:E.tree),z=B._vtable.padding,F=B.text.textAlign,I=B.text.textBaseline;let O,D,W;if(A?(D=i.getColsWidth(A.start.col,A.end.col),W=i.getRowsHeight(A.start.row,A.end.row)):(D=i.getColWidth(t),W=i.getRowHeight(e)),tw(T)?(C.removeAllChild(),U_(T,i,Y_.bind(null,L,T,E,i,t,e,D,W,C,z,F,I,H,o,B,A,M))):O=Y_(L,T,E,i,t,e,D,W,C,z,F,I,H,o,B,A,M),S){const{width:t}=O.attribute,{height:e}=O.attribute;O.contentWidth=t,O.contentHeight=e,K_(A,D,W,z,F,I,i)}return O}function Y_(t,e,i,o,n,r,s,l,a,h,d,c,u,g,p,f,m){var b,v;if(tw(e)&&(e=o.getCellValue(n,r)),!g&&(a.row!==r||a.col!==n))return null;if(!g&&a.parent&&o.reactCustomLayout){const t=a.getChildByName("custom-container");if(t){const{col:e,row:i}=t;o.reactCustomLayout.removeCustomCell(e,i)}}const y=$_(t,e,i,o,n,r,o.getColWidth(n),s,l,g?o.scenegraph.getColGroup(n):a.parent,g?0:o.scenegraph.getCellGroupY(r),h,d,c,u,p,f,m);return!g&&a.parent&&(a.parent.insertAfter(y,a),a.parent.removeChild(a),(null===(b=o.scenegraph)||void 0===b?void 0:b.proxy.cellCache.get(n))&&(null===(v=o.scenegraph)||void 0===v||v.proxy.cellCache.set(n,y))),y}function K_(t,e,i,o,n,r,s){for(let l=t.start.col;l<=t.end.col;l++)for(let a=t.start.row;a<=t.end.row;a++){const h=s.scenegraph.highPerformanceGetCell(l,a,!0);if("cell"!==h.role)continue;t.start.row!==t.end.row&&h.contentHeight!==i&&F_(h,i,0,s.isAutoRowHeight(a),o,0,r),t.start.col!==t.end.col&&h.contentWidth!==e&&z_(h,e,i,0,s.isAutoRowHeight(a),o,n,r,s.scenegraph),h.contentWidth=e,h.contentHeight=i;const d=s.getRowHeight(a);q_(h,s.getColWidth(l),d,t,s)}}function q_(t,e,i,o,n){var r;const{col:s,row:l}=t,a=-n.getColsWidth(o.start.col,s-1),h=-n.getRowsHeight(o.start.row,l-1);t.forEachChildren((t=>{var e,i,o,n,r,s;"number"==typeof t._dx?(t.skipMergeUpdate=!0,t.setAttributes({dx:(null!==(e=t._dx)&&void 0!==e?e:0)+a}),t.skipMergeUpdate=!1):(t.skipMergeUpdate=!0,t._dx=null!==(i=t.attribute.dx)&&void 0!==i?i:0,t.setAttributes({dx:(null!==(o=t.attribute.dx)&&void 0!==o?o:0)+a}),t.skipMergeUpdate=!1),"number"==typeof t._dy?(t.skipMergeUpdate=!0,t.setAttributes({dy:(null!==(n=t._dy)&&void 0!==n?n:0)+h}),t.skipMergeUpdate=!1):(t._dy=null!==(r=t.attribute.dy)&&void 0!==r?r:0,t.skipMergeUpdate=!0,t.setAttributes({dy:(null!==(s=t.attribute.dy)&&void 0!==s?s:0)+h}),t.skipMergeUpdate=!1)}));const d=null!==(r=t.attribute.strokeArrayWidth)&&void 0!==r?r:t.attribute.lineWidth,c=rt(d),u=[0,0,0,0];s===o.start.col&&(u[3]=c?d[3]:d),l===o.start.row&&(u[0]=c?d[0]:d),s===o.end.col&&(u[1]=c?d[1]:d),l===o.end.row&&(u[2]=c?d[2]:d);const g=e!==t.attribute.width,p=i!==t.attribute.height;return t.skipMergeUpdate=!0,t.setAttributes({width:e,height:i,strokeArrayWidth:u}),t.skipMergeUpdate=!1,t.mergeStartCol=o.start.col,t.mergeStartRow=o.start.row,t.mergeEndCol=o.end.col,t.mergeEndRow=o.end.row,{widthChange:g,heightChange:p}}function Z_(t,e,i,o){if(o.internalProps.customMergeCell){const n=o.getCustomMerge(t,e);if(n){const{range:r,text:s,style:l,customLayout:a,customRender:h}=n;if(a||h){const n=p_(a,h,r.start.col,r.start.row,o.getColsWidth(r.start.col,r.end.col),o.getRowsHeight(r.start.row,r.end.row),!1,o.isAutoRowHeight(e),[0,0,0,0],r,o).elementsGroup;i.childrenCount>0&&n?i.insertBefore(n,i.firstChild):n&&i.appendChild(n);const s=o.getRowHeight(e),l=o.getColWidth(t),{width:d}=i.attribute,{height:c}=i.attribute;return i.contentWidth=d,i.contentHeight=c,q_(i,l,s,r,o),r}}}}function J_(t){return!!("cell"===t.role&&at(t.mergeStartCol)&&at(t.mergeStartRow)&&at(t.mergeEndCol)&&at(t.mergeEndRow))}const Q_=new Vy({}),tS=new Uy({});function eS(t,e,i,o,n,r,s,l,a,h,d,c,u,g,p){const f=IC(tt(t)?t.text:t).split("\n")||[],m=p.getColsWidth(e,o),b=R_("size",n,e,i,p);let v=R_("outerRadius",n,e,i,p);const y=at(v)?2*v:b;let C=0;if(r){const t=R_("spaceBetweenTextAndIcon",n,e,i,p),o=m-(g[1]+g[3])-s-y-t;at(v)||(v=Math.round(b/2)),tS.setAttributes({text:{maxLineWidth:o,text:f,fontSize:l,fontStyle:a,fontWeight:h,fontFamily:d,lineHeight:c,wordBreak:"break-word",lineClamp:u},circle:{outerRadius:v},spaceBetweenTextAndIcon:t}),tS.render(),C=tS.AABBBounds.height()}else C=Math.max(b,f.length*c);return C}let iS="quick";const oS=new s(((t,e,i,o)=>{i(Zo)?o(Zo).to(sS).inSingletonScope():t(Zo).to(sS).inSingletonScope()}));new s(((t,e,i,o)=>{i(Zo)?o(Zo).to(Jo).inSingletonScope():t(Zo).to(Jo).inSingletonScope()}));const nS=new Map;function rS(t,e,i){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"normal";const n=`${t}-${e}-${i}-${o}`,r=nS.get(n);if(r)return r;const s=(l={fontSize:t,fontFamily:i,fontWeight:e,fontStyle:o},new ti(Object.assign({defaultFontParams:{fontFamily:Co.fontFamily,fontSize:Co.fontSize},getTextBounds:Qa,specialCharSet:`{}()//&-/: .,@%'"~…=${ti.ALPHABET_CHAR_SET}${ti.ALPHABET_CHAR_SET.toUpperCase()}0123456789`},{}),l));var l;return nS.set(n,s),s}class sS extends Jo{measureTextWidth(t,e){const{fontSize:i,fontFamily:o="Arial,sans-serif",fontWeight:n="normal",fontStyle:r="normal"}=e;return rS(i,n,o,r).measure(t,iS).width}measureText(t,e){const{fontSize:i,fontFamily:o="Arial,sans-serif",fontWeight:n="normal",fontStyle:r="normal"}=e;return rS(i,n,o,r).measure(t,iS)}}const lS=new class{measureText(t,e){const{fontSize:i,fontFamily:o="Arial,sans-serif",fontWeight:n="normal",fontStyle:r="normal"}=e;return rS(i,n,o,r).measure(t,iS)}measureTextWidth(t,e){const{fontSize:i,fontFamily:o="Arial,sans-serif",fontWeight:n="normal",fontStyle:r="normal"}=e;return rS(i,n,o,r).measure(t,iS).width}clipText(t,e,i){if(0===t.length)return{str:"",width:0};let o=this.measureTextWidth(t,e);return o<=i?{str:t,width:o}:(o=this.measureTextWidth(t[0],e),o>i?{str:"",width:0}:this._clipText(t,e,i,0,t.length-1))}_clipText(t,e,i,o,n){const r=Math.floor((o+n)/2),s=t.substring(0,r+1),l=this.measureTextWidth(s,e);let a;if(l>i){if(s.length<=1)return{str:"",width:0};const n=t.substring(0,r);return a=this.measureTextWidth(n,e),a<=i?{str:n,width:a}:this._clipText(t,e,i,o,r)}if(l<i){if(r>=t.length-1)return{str:t,width:this.measureTextWidth(t,e)};const o=t.substring(0,r+2);return a=this.measureTextWidth(o,e),a>=i?{str:s,width:l}:this._clipText(t,e,i,r,n)}return{str:s,width:l}}clipTextWithSuffix(t,e,i,o){if(""===o)return this.clipText(t,e,i);if(0===t.length)return{str:"",width:0};const n=this.measureTextWidth(t,e);if(n<=i)return{str:t,width:n};const r=this.measureTextWidth(o,e);if(r>i)return{str:"",width:0};i-=r;const s=this._clipText(t,e,i,0,t.length-1);return s.str+=o,s.width+=r,s}},aS=new il({ignoreBuf:!0});function hS(t){return aS.initAttributes(Object.assign(Object.assign({},t),{ignoreBuf:!0})),aS.AABBBounds}const dS=new Ra({width:0,height:0,textConfig:[]});function cS(t,e,i){let o=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],n=arguments.length>4?arguments[4]:void 0;var r,s,l,a,h,d,c,u,g,p,f,m;"undefined"!=typeof window&&window.performance.now();const b=[],v=[];if(n)for(let o=e;o<=i;o++)b[o]=t.getRowHeight(o);const y=t.internalProps.layoutMap;t.isPivotTable()&&(y.enableUseGetBodyCache(),y.enableUseHeaderPathCache()),t.defaultHeaderRowHeight,t.defaultHeaderColWidth;const C="auto"===t.defaultHeaderRowHeight||rt(t.defaultHeaderRowHeight)&&t.defaultHeaderRowHeight.some((t=>"auto"===t)),w="autoHeight"===t.heightMode||"adaptive"===t.heightMode;if(w||C){e=null!=e?e:0,i=null!=i?i:t.rowCount-1,(0===e&&i===t.rowCount-1||o)&&t._clearRowRangeHeightsMap();for(let i=e;i<t.columnHeaderLevelCount;i++){let e=0,o=t.colCount-1;if((t.isPivotTable()&&!t.isPivotChart()||t.isPivotChart()&&!t.internalProps.layoutMap.indicatorsAsCol)&&pS(t,i)&&!jw(t,t.rowHeaderLevelCount,i)&&(e=0,o=t.rowHeaderLevelCount),w||"auto"===t.getDefaultRowHeight(i)){const n=uS(i,e,o,t);v[i]=Math.round(n),t._setRowHeight(i,n)}}for(let e=t.rowCount-t.bottomFrozenRowCount;e<=i;e++)if(w||"auto"===t.getDefaultRowHeight(e)){const i=uS(e,0,t.colCount-1,t);n?v[e]=Math.round(i):t._setRowHeight(e,i)}if(i<t.columnHeaderLevelCount||!w);else if(t.internalProps.transpose||t.isPivotTable()&&!t.internalProps.layoutMap.indicatorsAsCol||!function(t){var e,i,o;const{layoutMap:n}=t.internalProps,r=t.columnHeaderLevelCount;if((t.internalProps.autoWrapText||t.internalProps.enableLineBreak||t.isPivotChart())&&("autoHeight"===t.options.heightMode||"adaptive"===t.options.heightMode))return!1;for(let s=0;s<t.colCount;s++){const l=n.getBody(s,r);if("radio"===l.cellType)return!1;if("function"==typeof l.style||"function"==typeof l.icon||(null===(e=l.define)||void 0===e?void 0:e.customRender)||(null===(i=l.define)||void 0===i?void 0:i.customLayout)||"function"==typeof(null===(o=l.define)||void 0===o?void 0:o.icon))return!1;const a=t._getCellStyle(s,r);if("function"==typeof a.padding||"function"==typeof a.fontSize||"function"==typeof a.lineHeight||!0===a.autoWrapText)return!1}return!0}(t))if(t.internalProps.transpose||t.isPivotTable()&&!t.internalProps.layoutMap.indicatorsAsCol)for(let o=Math.max(e,t.columnHeaderLevelCount);o<=i;o++){let e;e=gS(t,o)?uS(o,0,t.rowHeaderLevelCount,t):uS(o,0,t.colCount-1,t),n?v[o]=Math.round(e):t._setRowHeight(o,e)}else for(let o=Math.max(e,t.columnHeaderLevelCount);o<=i;o++){const e=uS(o,0,t.colCount-1,t);n?v[o]=Math.round(e):t._setRowHeight(o,e)}else{!function(t,e,i,o,n){if(!o.internalProps.useOneRowHeightFillAll){for(let r=e;r<=i;r++)n?n[r]=t:o._setRowHeight(r,t);o.internalProps.useOneRowHeightFillAll=!0}}(uS(t.columnHeaderLevelCount,0,t.colCount-1,t),t.columnHeaderLevelCount,t.rowCount-1-t.bottomFrozenRowCount,t,n?v:void 0);for(let e=t.rowCount-t.bottomFrozenRowCount;e<=i;e++){const i=uS(e,0,t.colCount-1,t);n?v[e]=Math.round(i):t._setRowHeight(e,i)}}}else if(("adaptive"===t.heightMode||t.autoFillHeight)&&t.clearRowHeightCache(),n)for(let o=e;o<=i;o++)v[o]=t.getRowHeight(o);if((0===e&&i===t.rowCount-1||o)&&t._clearRowRangeHeightsMap(),"adaptive"===t.heightMode){t._clearRowRangeHeightsMap();let e=t.tableNoFrameHeight,i=0,o=t.rowCount;if("only-body"===t.heightAdaptiveMode){const n=t.getRowsHeight(0,t.columnHeaderLevelCount-1),r=t.isPivotChart()?t.getBottomFrozenRowsHeight():0;e=t.tableNoFrameHeight-n-r,i=t.columnHeaderLevelCount,o=t.isPivotChart()?t.rowCount-t.bottomFrozenRowCount:t.rowCount}let l=0;for(let e=i;e<o;e++)l+=n&&null!==(r=v[e])&&void 0!==r?r:t.getRowHeight(e);const a=e/l;for(let r=i;r<o;r++){let l;l=r===o-1?e-(n?v.reduce(((t,e,n)=>n>=i&&n<=o-2?t+e:t),0):t.getRowsHeight(i,o-2)):Math.round((n&&null!==(s=v[r])&&void 0!==s?s:t.getRowHeight(r))*a),n?v[r]=l:t._setRowHeight(r,l,!1)}}else if(t.autoFillHeight){t._clearRowRangeHeightsMap();const e=t.tableNoFrameHeight;let i=0,o=0;for(let e=0;e<t.rowCount;e++){const r=n&&null!==(l=v[e])&&void 0!==l?l:t.getRowHeight(e);(e<t.columnHeaderLevelCount||t.isPivotChart()&&e>=t.rowCount-t.bottomFrozenRowCount)&&(o+=r),i+=r}if(t.scenegraph._dealAutoFillHeightOriginRowsHeight=i,i<e&&i-o>0){const r=t.columnHeaderLevelCount,s=t.isPivotChart()?t.rowCount-t.bottomFrozenRowCount:t.rowCount,l=(e-o)/(i-o);for(let i=r;i<s;i++){let h;h=i===s-1?e-o-(n?v.reduce(((t,e,i)=>i>=r&&i<=s-2?t+e:t),0):t.getRowsHeight(r,s-2)):Math.round((n&&null!==(a=v[i])&&void 0!==a?a:t.getRowHeight(i))*l),n?v[i]=h:t._setRowHeight(i,h,!1)}}}if(n){for(let o=e;o<=i;o++){const e=null!==(h=v[o])&&void 0!==h?h:t.getRowHeight(o);e!==(null!==(d=b[o])&&void 0!==d?d:t.getRowHeight(o))&&t._setRowHeight(o,e)}if("adaptive"===t.heightMode||t.autoFillHeight&&t.getAllRowsHeight()<=t.tableNoFrameHeight){for(let e=0;e<=t.columnHeaderLevelCount-1;e++){const i=t.getRowHeight(e);i!==(null!==(c=b[e])&&void 0!==c?c:t.getRowHeight(e))&&t.scenegraph.updateRowHeight(e,i-(null!==(u=b[e])&&void 0!==u?u:t.getRowHeight(e)),!0)}for(let e=t.rowCount-t.bottomFrozenRowCount;e<=t.rowCount-1;e++){const i=t.getRowHeight(e);i!==(null!==(g=b[e])&&void 0!==g?g:t.getRowHeight(e))&&t.scenegraph.updateRowHeight(e,i-(null!==(p=b[e])&&void 0!==p?p:t.getRowHeight(e)),!0)}}for(let e=t.scenegraph.proxy.rowStart;e<=t.scenegraph.proxy.rowEnd;e++){const i=t.getRowHeight(e);i!==(null!==(f=b[e])&&void 0!==f?f:t.getRowHeight(e))&&t.scenegraph.updateRowHeight(e,i-(null!==(m=b[e])&&void 0!==m?m:t.getRowHeight(e)),!0)}}t.isPivotTable()&&(y.disableUseGetBodyCache(),y.disableUseHeaderPathCache())}function uS(t,e,i,o){var n;let r;if(o.isPivotChart()&&t>=o.columnHeaderLevelCount&&t<o.rowCount-o.bottomFrozenRowCount)if(o.internalProps.layoutMap.indicatorsAsCol){const e=o.internalProps.layoutMap.getOptimunHeightForChart(t);if(e>0)return e}else{const e=o.getDefaultRowHeight(t);if(at(e))return e}for(let s=e;s<=i;s++){const e=fS(s,t,o);if(e&&(r=Q(r)?Math.max(e.height,r):e.height,!e.renderDefault))continue;if(o.isPivotChart()){const e=o.internalProps.layoutMap.getAxisConfigInPivotChart(s,t);if(e){const t=Vw.getFunction("computeAxisComponentHeight")(e,o);if("number"==typeof t){r=Q(r)?Math.max(t,r):t;continue}}}if(o.isPivotChart()&&(o.isLeftFrozenColumn(s)&&o.isBottomFrozenRow(t)||o.isRightFrozenColumn(s)&&o.isBottomFrozenRow(t)))continue;const i=mS(s,t,o.isHeader(s,t)?null===(n=o._getHeaderLayoutMap(s,t))||void 0===n?void 0:n.headerType:o.getBodyColumnType(s,t),o);r=Q(r)?Math.max(i,r):i}if(Q(r))return r;const s=o.getDefaultRowHeight(t);return at(s)?s:o.defaultRowHeight}function gS(t,e){var i,o,n;const{layoutMap:r}=t.internalProps;if((t.internalProps.autoWrapText||t.internalProps.enableLineBreak)&&("autoHeight"===t.options.heightMode||"adaptive"===t.options.heightMode))return!1;const s=r.getBody(t.rowHeaderLevelCount,e);if("function"==typeof s.style||"function"==typeof s.icon||(null===(i=s.define)||void 0===i?void 0:i.customRender)||(null===(o=s.define)||void 0===o?void 0:o.customLayout)||"function"==typeof(null===(n=s.define)||void 0===n?void 0:n.icon))return!1;const l=t._getCellStyle(t.rowHeaderLevelCount,e);return"function"!=typeof l.padding&&"function"!=typeof l.fontSize&&"function"!=typeof l.lineHeight&&!0!==l.autoWrapText}function pS(t,e){var i,o,n;const{layoutMap:r}=t.internalProps;if(t.internalProps.autoWrapText&&("autoHeight"===t.options.heightMode||"adaptive"===t.options.heightMode))return!1;const s=r.getHeader(t.rowHeaderLevelCount,e);if("function"==typeof s.style||"function"==typeof s.icons||(null===(i=s.define)||void 0===i?void 0:i.headerCustomRender)||(null===(o=s.define)||void 0===o?void 0:o.headerCustomLayout)||"function"==typeof(null===(n=s.define)||void 0===n?void 0:n.icon))return!1;const l=t._getCellStyle(t.rowHeaderLevelCount,e);return"function"!=typeof l.padding&&"function"!=typeof l.fontSize&&"function"!=typeof l.lineHeight&&!0!==l.autoWrapText}function fS(t,e,i){var o,n,r,s;const l=i.getCustomRender(t,e),a=i.getCustomLayout(t,e);if(l||a){let h=1,d=0,c=!1,u=!1;if(i.isHeader(t,e)||(null===(o=i.getBodyColumnDefine(t,e))||void 0===o?void 0:o.mergeCell)||i.hasCustomMerge()){const o=i.getCellRange(t,e);h=o.end.row-o.start.row+1}const g={col:t,row:e,dataValue:i.getCellOriginValue(t,e),value:i.getCellValue(t,e)||"",rect:bS(t,e,i),table:i};if(Z(a)){const e=a(g);e.rootContainer instanceof cs?(e.rootContainer=b_(e.rootContainer),m_(e.rootContainer,i.getColWidth(t),0),e.rootContainer.setStage(i.scenegraph.stage),d=null!==(n=e.rootContainer.AABBBounds.height())&&void 0!==n?n:0,c=e.renderDefault,u=e.enableCellPadding):(d=0,c=e.renderDefault,u=e.enableCellPadding)}else if("function"==typeof l){const t=l(g);d=null!==(r=null==t?void 0:t.expectedHeight)&&void 0!==r?r:0,c=null==t?void 0:t.renderDefault}else d=null!==(s=null==l?void 0:l.expectedHeight)&&void 0!==s?s:0,c=null==l?void 0:l.renderDefault;if(u){const o=vx(R_("padding",i._getCellStyle(t,e),t,e,i));d+=o[0]+o[2]}return{height:d/h,renderDefault:c}}}function mS(t,e,i,o){var n,r,s;let l=0;const a=o.getCellValue(t,e),h=o._getCellStyle(t,e);let d=0,c=0;const u=[];let g=0;const p=[];let f=0,m=!1;if("body"!==o.getCellLocation(t,e))m=!0;else{const i=o.getBodyColumnDefine(t,e);m=!!(null==i?void 0:i.icon)||!!(null==i?void 0:i.tree)||(null==i?void 0:i.dragOrder)}if(m){const i=o.getCellIcons(t,e);null==i||i.forEach((t=>{var e,i,o,n,r,s,l,a,h,m;t.positionType!==eC.absoluteRight&&t.positionType!==eC.inlineFront&&t.positionType!==eC.inlineEnd?(c+=(null!==(e=t.width)&&void 0!==e?e:0)+(null!==(i=t.marginLeft)&&void 0!==i?i:0)+(null!==(o=t.marginRight)&&void 0!==o?o:0),d=Math.max(d,null!==(n=t.height)&&void 0!==n?n:0)):t.positionType===eC.inlineFront?(u.push(t),g=Math.max(g,(null!==(r=t.height)&&void 0!==r?r:0)+(null!==(s=t.marginLeft)&&void 0!==s?s:0)+(null!==(l=t.marginRight)&&void 0!==l?l:0))):t.positionType===eC.inlineEnd&&(p.push(t),f=Math.max(f,(null!==(a=t.height)&&void 0!==a?a:0)+(null!==(h=t.marginLeft)&&void 0!==h?h:0)+(null!==(m=t.marginRight)&&void 0!==m?m:0)))}))}let b=1,v=t;if(o.isHeader(t,e)||(null===(n=o.getBodyColumnDefine(t,e))||void 0===n?void 0:n.mergeCell)||o.hasCustomMerge()){const i=o.getCellRange(t,e);b=i.end.row-i.start.row+1,t=i.start.col,v=i.end.col}const y=vx(R_("padding",h,t,e,o)),C=R_("fontSize",h,t,e,o),w=R_("fontStyle",h,t,e,o),x=R_("fontWeight",h,t,e,o),_=null!==(r=R_("lineHeight",h,t,e,o))&&void 0!==r?r:C,S=R_("fontFamily",h,t,e,o),A=R_("autoWrapText",h,t,e,o),B=R_("lineClamp",h,t,e,o);let R;if("text"!==i&&"link"!==i&&"progressbar"!==i&&"checkbox"!==i&&"radio"!==i)l=_;else if("checkbox"===i)l=function(t,e,i,o,n,r,s,l,a,h,d,c,u,g,p){const f=IC(tt(t)?t.text:t).split("\n")||[],m=p.getColsWidth(e,o),b=R_("size",n,e,i,p);let v=0;if(r){const t=R_("spaceBetweenTextAndIcon",n,e,i,p),o=m-(g[1]+g[3])-s-b-t;Q_.setAttributes({text:{maxLineWidth:o,text:f,fontSize:l,fontStyle:a,fontWeight:h,fontFamily:d,lineHeight:c,wordBreak:"break-word",lineClamp:u},icon:{width:Math.floor(b/1.4),height:Math.floor(b/1.4)},box:{width:b,height:b},spaceBetweenTextAndIcon:t}),Q_.render(),v=Q_.AABBBounds.height()}else v=Math.max(b,f.length*c);return v}(a,t,e,v,h,A,c,C,w,x,S,_,B,y,o);else if("radio"===i)l=function(t,e,i,o,n,r,s,l,a,h,d,c,u,g,p){var f;if(rt(t)){let m=0;const b=p.getBodyColumnDefine(e,i),v=R_("spaceBetweenRadio",n,e,i,p),y=null!==(f=null==b?void 0:b.radioDirectionInCell)&&void 0!==f?f:"vertical";return"vertical"===y?t.forEach(((f,b)=>{const y=eS(f,e,i,o,n,r,s,l,a,h,d,c,u,g,p);m+=y,b!==t.length-1&&(m+=v)})):"horizontal"===y&&t.forEach((t=>{const f=eS(t,e,i,o,n,r,s,l,a,h,d,c,u,g,p);m=Math.max(f,m)})),m}return eS(t,e,i,o,n,r,s,l,a,h,d,c,u,g,p)}(a,t,e,v,h,A,c,C,w,x,S,_,B,y,o);else{R=a;const i=E_(R,o).text,n=o.getColsWidth(t,v);if(u.length||p.length)if(A){const t=Object.assign({text:null==a?void 0:a.toString(),fontFamily:S,fontSize:C,fontStyle:w,fontWeight:x,lineHeight:_});t.textBaseline="middle";const e=[...u.map((t=>H_(t))),t,...p.map((t=>H_(t)))];dS.setAttributes({width:n-(y[1]+y[3])-c,height:0,textConfig:e}),l=dS.AABBBounds.height()}else l=0,i.forEach(((t,e)=>{var n;(null===(n=o.options.customConfig)||void 0===n?void 0:n.multilinesForXTable)&&0!==e||(0===e&&u.length?l+=Math.max(_,g):e===i.length-1&&p.length?l+=Math.max(_,f):l+=_)}));else if(A){const r=P_(t,e,o),s=hS({maxLineWidth:n-(y[1]+y[3])-c-r,text:i,fontSize:C,fontStyle:w,fontWeight:x,fontFamily:S,lineHeight:_,wordBreak:"break-word",whiteSpace:1!==i.length||A?"normal":"no-wrap",lineClamp:B});l=s.height()||("number"==typeof _?_:C)}else l=(null===(s=o.options.customConfig)||void 0===s?void 0:s.multilinesForXTable)?_:i.length*_}return(Math.max(l,d)+y[0]+y[2])/b}function bS(t,e,i){return{left:0,top:0,right:i.getColWidth(t),bottom:i.getRowHeight(e),width:i.getColWidth(t),height:0}}function vS(t,e){if(!e||!e.proxy)return{colStart:0,colEnd:0,rowStart:0,rowEnd:0};const{mergeStartCol:i,mergeEndCol:o,mergeStartRow:n,mergeEndRow:r,col:s,row:l}=t,{colStart:a,colEnd:h,rowStart:d,rowEnd:c,bodyLeftCol:u,bodyRightCol:g,bodyTopRow:p,bodyBottomRow:f}=e.proxy;let m=i,b=o,v=n,y=r;return s>=u&&s<=g&&(m=Math.max(t.mergeStartCol,a),b=Math.min(t.mergeEndCol,h)),l>=p&&l<=f&&(v=Math.max(t.mergeStartRow,d),y=Math.min(t.mergeEndRow,c)),{colStart:m,colEnd:b,rowStart:v,rowEnd:y}}function yS(t,e,i,o){o||t.table._setRowHeight(e,t.table.getRowHeight(e)+i,!0);for(let o=0;o<t.table.colCount;o++){const n=t.getCell(o,e);if("empty"===n.role)continue;const r=jw(t.table,o,e);r&&r.start.col!==o||(CS(t,n,o,e,n.attribute.height+i,i,t.table.isHeader(o,e)),t.updateCellContentWhileResize(o,e))}let n=0,r=0;e<t.table.frozenRowCount?(n=e+1,r=t.table.frozenRowCount-1):e>=t.table.rowCount-t.table.bottomFrozenRowCount?(n=e+1,r=t.table.rowCount-1):(n=e+1,r=Math.min(t.proxy.rowEnd,t.table.rowCount-t.table.bottomFrozenRowCount-1));for(let e=0;e<t.table.colCount;e++)for(let o=n;o<=r;o++){const n=t.highPerformanceGetCell(e,o);"cell"===n.role&&n.setAttribute("y",n.attribute.y+i)}}function CS(t,e,i,o,n,r,s){e&&function(t,e,i,o,n,r,s){var l,a;if(e.attribute.height===n&&!e.needUpdateHeight)return;e.needUpdateHeight=!1,e.setAttribute("height",n);const h=t.table.isHeader(i,o)?t.table._getHeaderLayoutMap(i,o).headerType:t.table.getBodyColumnType(i,o);if("progressbar"===h){const n=t.table.getBodyColumnDefine(i,o),r=t.table._getCellStyle(i,o),s=t.table.getCellValue(i,o),l=t.table.getCellOriginValue(i,o),a=vx(R_("padding",r,i,o,t.table)),h=Vw.getFunction("createProgressBarCell")(n,r,e.attribute.width,s,l,i,o,a,t.table),d=e.getChildByName("progress-bar");e.insertBefore(h,d),e.removeChild(d),d.removeAllChild(),d.release()}else if("sparkline"===h){e.removeAllChild();const n=t.table._getCellStyle(i,o),r=vx(R_("padding",n,i,o,t.table));Vw.getFunction("createSparkLineCellGroup")(e,e.parent,e.attribute.x,e.attribute.y,i,o,e.attribute.width,e.attribute.height,r,t.table,e_(n,t.table,i,o,R_).theme,!1)}else if("image"===h||"video"===h)W_(e,i,o,0,0,t.table);else if("axis"===(null===(l=e.firstChild)||void 0===l?void 0:l.name))null===(a=e.firstChild)||void 0===a||a.originAxis.resize(e.attribute.width,e.attribute.height);else{let r=!0;const s=e.getChildByName(u_)||e.getChildByName(g_);if(s){let n;t.table.reactCustomLayout&&t.table.reactCustomLayout.removeCustomCell(i,o),s.removeAllChild(),e.removeChild(s);const l=Z_(i,o,e,t.table);if(l)for(let n=l.start.row;n<=l.end.row;n++){if(n===o)continue;const r=t.getCell(i,n),s=e.getChildByName(u_)||e.getChildByName(g_);s.removeAllChild(),r.removeChild(s),Z_(i,n,r,t.table)}else{let s,l;if("body"!==t.table.getCellLocation(i,o)){const e=t.table.getHeaderDefine(i,o);s=null==e?void 0:e.headerCustomRender,l=null==e?void 0:e.headerCustomLayout}else{const e=t.table.getBodyColumnDefine(i,o);s=(null==e?void 0:e.customRender)||t.table.customRender,l=null==e?void 0:e.customLayout}if(l||s){const a=vx(R_("padding",t.table._getCellStyle(i,o),i,o,t.table));let h=e.attribute.width,d=e.attribute.height;J_(e)&&(h=t.table.getColsWidth(e.mergeStartCol,e.mergeEndCol),d=t.table.getRowsHeight(e.mergeStartRow,e.mergeEndRow));const c=p_(l,s,i,o,h,d,!1,t.table.isAutoRowHeight(o),a,J_(e)?{start:{col:e.mergeStartCol,row:e.mergeStartRow},end:{col:e.mergeEndCol,row:e.mergeEndRow}}:void 0,t.table);n=c.elementsGroup,r=c.renderDefault}e.childrenCount>0&&n?e.insertBefore(n,e.firstChild):n&&e.appendChild(n)}}!function(t,e,i,o,n,r){if(J_(t)){e=0;for(let i=t.mergeStartRow;i<=t.mergeEndRow;i++)e+=r.getRowHeight(i);const{colStart:i,colEnd:s,rowStart:l,rowEnd:a}=vS(t,r.scenegraph);for(let h=i;h<=s;h++)for(let i=l;i<=a;i++){const s=r.scenegraph.getCell(h,i);if(s.forEachChildren((t=>{t.setAttributes({dx:0,dy:0})})),n){const t=r._getCellStyle(h,i);F_(s,e,0,o,vx(t.padding),t.textAlign,t.textBaseline)}const l=r.getRowHeight(i),a=r.getColWidth(h);s.contentHeight=e;const{widthChange:d}=q_(s,a,l,{start:{col:t.mergeStartCol,row:t.mergeStartRow},end:{col:t.mergeEndCol,row:t.mergeEndRow}},r);d&&(s.needUpdateWidth=!0)}}else{const i=r._getCellStyle(t.col,t.row);F_(t,e,0,o,vx(i.padding),i.textAlign,i.textBaseline)}}(e,n,0,t.table.isAutoRowHeight(o),r,t.table)}}(t,e,i,o,n)}function wS(t,e,i,o){var n,r,s,l,a,h,d;let c=!1;const u=null!==(n=null==t?void 0:t.attribute.width)&&void 0!==n?n:0;if(null==t||t.setAttribute("width",u+e),null==t||t.forEachChildren(((t,n)=>{if(function(t,e,i,o,n,r,s,l,a){var h,d,c;if(e.attribute.width===r&&!e.needUpdateWidth)return!1;e.needUpdateWidth=!1,e.setAttribute("width",r);const u=e;if(!u)return!1;const g=t.table.isAutoRowHeight(o),p=t.table.isHeader(i,o)?t.table._getHeaderLayoutMap(i,o).headerType:t.table.getBodyColumnType(i,o);let f=!1;if("progressbar"===p){const e=t.table.getBodyColumnDefine(i,o),n=t.table._getCellStyle(i,o),r=t.table.getCellValue(i,o),s=t.table.getCellOriginValue(i,o),l=vx(R_("padding",n,i,o,t.table)),a=Vw.getFunction("createProgressBarCell")(e,n,u.attribute.width,r,s,i,o,l,t.table),h=u.getChildByName("progress-bar");u.insertBefore(a,h),u.removeChild(h),h.removeAllChild(),h.release()}else if("sparkline"===p){u.removeAllChild();const e=t.table._getCellStyle(i,o),n=vx(R_("padding",e,i,o,t.table));Vw.getFunction("createSparkLineCellGroup")(u,u.parent,u.attribute.x,u.attribute.y,i,o,u.attribute.width,u.attribute.height,n,t.table,e_(e,t.table,i,o,R_).theme,!1)}else if("image"===p||"video"===p)W_(u,i,o,s,0,t.table);else if("axis"===(null===(h=u.firstChild)||void 0===h?void 0:h.name)){const e=t.table.internalProps.layoutMap.getAxisConfigInPivotChart(i,o),n=vx(R_("padding",t.table._getCellStyle(i,o),i,o,t.table));if(e){const i=new(Vw.getComponent("axis"))(e,u.attribute.width,u.attribute.height,n,t.table);u.clear(),u.appendChild(i.component),i.overlap()}}else if("axis"===(null===(d=e.firstChild)||void 0===d?void 0:d.name))null===(c=e.firstChild)||void 0===c||c.originAxis.resize(e.attribute.width,e.attribute.height);else{let n=!0;const l=e.getChildByName(u_)||e.getChildByName(g_);if(l){let r;t.table.reactCustomLayout&&t.table.reactCustomLayout.removeCustomCell(i,o),l.removeAllChild(),e.removeChild(l);const s=Z_(i,o,e,t.table);if(s)for(let n=s.start.col;n<=s.end.col;n++){if(n===i)continue;const r=t.getCell(n,o),s=r.getChildByName(u_)||e.getChildByName(g_);s.removeAllChild(),r.removeChild(s),Z_(n,o,r,t.table)}else{let s,l;if("body"!==t.table.getCellLocation(i,o)){const e=t.table.getHeaderDefine(i,o);s=null==e?void 0:e.headerCustomRender,l=null==e?void 0:e.headerCustomLayout}else{const e=t.table.getBodyColumnDefine(i,o);s=(null==e?void 0:e.customRender)||t.table.customRender,l=null==e?void 0:e.customLayout}if(l||s){const e=vx(R_("padding",t.table._getCellStyle(i,o),i,o,t.table));let a=u.attribute.width,h=u.attribute.height;J_(u)&&(a=t.table.getColsWidth(u.mergeStartCol,u.mergeEndCol),h=t.table.getRowsHeight(u.mergeStartRow,u.mergeEndRow));const d=p_(l,s,i,o,a,h,!1,t.table.isAutoRowHeight(o),e,J_(u)?{start:{col:u.mergeStartCol,row:u.mergeStartRow},end:{col:u.mergeEndCol,row:u.mergeEndRow}}:void 0,t.table);r=d.elementsGroup,n=d.renderDefault,f=!0}e.childrenCount>0&&r?e.insertBefore(r,e.firstChild):r&&e.appendChild(r)}}const a=function(t,e,i,o,n,r){if(J_(t)){e=0;let s=!1;for(let i=t.mergeStartCol;i<=t.mergeEndCol;i++)e+=r.getColWidth(i);let l=0;for(let e=t.mergeStartRow;e<=t.mergeEndRow;e++)l+=r.getRowHeight(e);const{colStart:a,colEnd:h,rowStart:d,rowEnd:c}=vS(t,r.scenegraph);for(let u=a;u<=h;u++)for(let a=d;a<=c;a++){if(u===t.col&&a!==t.row)continue;const h=r.scenegraph.getCell(u,a);h.forEachChildren((t=>{t.setAttributes({dx:0,dy:0})}));let d=!1;if(n){const t=r._getCellStyle(u,a);d=z_(h,e,l,i,o,vx(t.padding),t.textAlign,t.textBaseline,r.scenegraph);const n=P_(h.col,h.row,r);if(n){const t=h.getChildByName("text"),e=h.getChildByName("expand")||h.getChildByName("collapse");"icon-left"!==(null==e?void 0:e.role)&&t&&t.setAttribute("dx",n)}}const c=r.getRowHeight(a),g=r.getColWidth(u);h.contentWidth=e;const{heightChange:p}=q_(h,g,c,{start:{col:t.mergeStartCol,row:t.mergeStartRow},end:{col:t.mergeEndCol,row:t.mergeEndRow}},r);p&&(h.needUpdateHeight=!0),s=s||d}return s}const s=r._getCellStyle(t.col,t.row),l=vx(s.padding),a=s.textAlign,h=s.textBaseline;return z_(t,e,r.getRowHeight(t.row),i,o,l,a,h,r.scenegraph)}(u,r,s,g,n,t.table);f=f||a}a||(a=t.table._getCellStyle(i,o).autoWrapText);return!(!g||!a)&&f}(o,t,t.col,t.row,0,u+e,e,"row-body"!==i||(t.col,o.table.rowHeaderLevelCount),o.table.internalProps.autoWrapText)){const e=jw(o.table,t.col,t.row);if(e&&e.end.row-e.start.row)for(let t=e.start.row;t<=e.end.row;t++)xS(o,t);else xS(o,t.row);c=!0}})),c){let t,e,n,c=0;for(let u=0;u<o.table.colCount;u++){if("col-corner"===i?(n=0,t=o.getColGroup(u,!0),e=null!==(r=o.colHeaderGroup.attribute.height)&&void 0!==r?r:0):"row-body"===i?(n=o.table.frozenRowCount,t=o.getColGroup(u,!1),e=null!==(s=o.bodyGroup.attribute.height)&&void 0!==s?s:0):"bottom"===i?(n=o.table.rowCount-o.table.bottomFrozenRowCount,t=o.getColGroupInBottom(u),e=null!==(l=o.bottomFrozenGroup.attribute.height)&&void 0!==l?l:0):"left-bottom"===i?(n=o.table.rowCount-o.table.bottomFrozenRowCount,t=o.getColGroupInLeftBottomCorner(u),e=null!==(a=o.leftBottomCornerGroup.attribute.height)&&void 0!==a?a:0):"right-top"===i?(n=0,t=o.getColGroupInRightTopCorner(u),e=null!==(h=o.rightTopCornerGroup.attribute.height)&&void 0!==h?h:0):"right-bottom"===i&&(n=o.table.rowCount-o.table.bottomFrozenRowCount,t=o.getColGroupInRightBottomCorner(u),e=null!==(d=o.rightBottomCornerGroup.attribute.height)&&void 0!==d?d:0),!t)continue;let g=0;t.forEachChildren((t=>{var e;t.setAttribute("y",g),g+=null!==(e=o.table.getRowHeight(t.row))&&void 0!==e?e:0})),c=g}o.updateContainerHeight(n,c-e);for(let t=0;t<o.table.frozenColCount;t++){const e=o.getColGroupInLeftBottomCorner(t);let i=0;null==e||e.forEachChildren((t=>{t.setAttribute("y",i),i+=o.table.getRowHeight(t.row)}))}for(let t=o.table.colCount-o.table.rightFrozenColCount;t<o.table.colCount;t++){const e=o.getColGroupInRightBottomCorner(t);let i=0;null==e||e.forEachChildren((t=>{t.setAttribute("y",i),i+=o.table.getRowHeight(t.row)}))}for(let t=o.table.frozenColCount;t<o.table.colCount-o.table.rightFrozenColCount;t++){const e=o.getColGroupInBottom(t);let i=0;null==e||e.forEachChildren((t=>{t.setAttribute("y",i),i+=o.table.getRowHeight(t.row)}))}}}function xS(t,e){const i=Math.round(uS(e,0,t.table.colCount-1,t.table));t.table._setRowHeight(e,i,!0);for(let o=0;o<t.table.colCount;o++){const n=i,r=t.highPerformanceGetCell(o,e);if("empty"===r.role)return;CS(t,r,o,e,n,r.attribute.height,t.table.isHeader(o,e))}}var _S;!function(t){t.dropDown="dropDown",t.contextmenu="contextmenu",t.custom="custom"}(_S||(_S={}));const SS=12,AS="Arial,sans-serif",BS="#000",RS="#2E68CF",MS="#EEE",TS=30,kS="#FFF",PS=4,ES=.5,LS="#CCC",HS=6,zS=9,FS=200;const IS=__();class OS{constructor(){const t=IS.drillDown;this.icon=new n_({x:-1e3,y:-1e3,image:t.svg,width:t.width,height:t.height,dx:-t.width/2,dy:-t.height/2,visible:!1,funcType:t.funcType,cursor:t.cursor}),this.icon.role="icon-drill"}appand(t){t.appendChild(this.icon)}update(t,e,i,o,n,r){if(!t||o&&n)return this.icon.setAttributes({x:-1e3,y:-1e3,visible:!1}),void r.updateNextFrame();const s=IS.drillDown,l=IS.drillUp;this.icon.setAttributes({x:e,y:i,image:o?s.svg:l.svg,visible:!0}),this.icon.loadImage(this.icon.attribute.image),r.updateNextFrame()}}class DS{constructor(t){const e=t.theme.dragHeaderSplitLine.lineWidth,i=t.theme.dragHeaderSplitLine.lineColor,o=t.theme.dragHeaderSplitLine.shadowBlockColor;this.columnMoverLabel=ca({visible:!1,pickable:!1,x:0,y:0,symbolType:"triangle",fill:i}),this.columnMoverLine=pa({visible:!1,pickable:!1,stroke:i,lineWidth:e,x:0,y:0,points:[{x:0,y:0},{x:0,y:0}]}),this.columnMoverBack=ba({visible:!1,pickable:!1,fill:o,x:0,y:0,width:0,height:0}),this.table=t}appand(t){t.appendChild(this.columnMoverLabel),t.appendChild(this.columnMoverLine),t.appendChild(this.columnMoverBack)}show(t,e,i){const o=this.table.getCellLocation(t,e),n=jw(this.table,t,e);n&&(t=n.start.col,e=n.start.row);let r=0,s=0,l=0,a=0,h=0,d=0,c=0,u=0,g=Math.PI;const p=[];"columnHeader"===o?(r=this.table.getColsWidth(0,t-1)-this.table.stateManager.scroll.horizontalBarPos,s=this.table.getRowsHeight(0,this.table.frozenRowCount-1),a=this.table.tableNoFrameHeight,l=n?this.table.getColsWidth(n.start.col,n.end.col):this.table.getColWidth(t),h=r-i,c=r+l,u=2,p.push({x:0,y:0}),p.push({x:0,y:this.table.tableNoFrameHeight})):("rowHeader"===o||this.table.internalProps.layoutMap.isSeriesNumberInBody(t,e))&&(s=this.table.getRowsHeight(0,e-1)-this.table.stateManager.scroll.verticalBarPos,r=this.table.getColsWidth(0,this.table.frozenColCount-1),l=this.table.tableNoFrameWidth,a=n?this.table.getRowsHeight(n.start.row,n.end.row):this.table.getRowHeight(e),d=s-i,c=2,u=s+a,g=Math.PI/2,p.push({x:0,y:0}),p.push({x:this.table.tableNoFrameWidth,y:0})),this.columnMoverBack.setAttributes({visible:!0,x:r-h,y:s-d,width:l,height:a,dx:h,dy:d}),this.columnMoverLine.setAttributes({x:c,y:u,visible:!0,points:p}),this.columnMoverLabel.setAttributes({visible:!0,x:c,y:u,angle:g})}hide(){this.columnMoverLabel.setAttribute("visible",!1),this.columnMoverLine.setAttribute("visible",!1),this.columnMoverBack.setAttribute("visible",!1)}update(t,e,i,o){"number"==typeof t&&"number"==typeof e?(this.columnMoverLabel.setAttribute("x",e),this.columnMoverLine.setAttribute("x",e),this.columnMoverBack.setAttribute("x",t)):"number"==typeof i&&"number"==typeof o&&(this.columnMoverLabel.setAttribute("y",o),this.columnMoverLine.setAttribute("y",o),this.columnMoverBack.setAttribute("y",i))}updateStyle(){const t=this.table.theme.dragHeaderSplitLine.lineWidth,e=this.table.theme.dragHeaderSplitLine.lineColor,i=this.table.theme.dragHeaderSplitLine.shadowBlockColor;this.columnMoverLabel.setAttributes({fill:e}),this.columnMoverLine.setAttributes({stroke:e,lineWidth:t}),this.columnMoverBack.setAttributes({fill:i})}}function WS(t,e,i){if(i)return Math.min(e.tableNoFrameWidth,e.getAllColsWidth())-e.getColsWidth(t,e.colCount-1);let o=e.getColsWidth(0,t);return t>=e.frozenColCount&&(o-=e.scrollLeft),o}function NS(t,e,i){if(i)return Math.min(e.tableNoFrameWidth,e.getAllRowsHeight())-e.getRowsHeight(t,e.rowCount-1);let o=e.getRowsHeight(0,t);return t>=e.frozenRowCount&&(o-=e.scrollLeft),o}class GS{constructor(t){var e,i,o,n,r,s,l,a,h,d,c,u,g,p,f;this.table=t;const m=this.table.theme;this.createScrollBar();const b=null===(e=m.columnResize)||void 0===e?void 0:e.lineColor,v=null===(i=m.columnResize)||void 0===i?void 0:i.lineWidth,y=null===(o=m.columnResize)||void 0===o?void 0:o.bgColor,C=null===(n=m.columnResize)||void 0===n?void 0:n.width,w=null===(r=m.columnResize)||void 0===r?void 0:r.labelColor,x=null===(s=m.columnResize)||void 0===s?void 0:s.labelFontSize,_=null===(l=m.columnResize)||void 0===l?void 0:l.labelFontFamily,S=null===(a=m.columnResize)||void 0===a?void 0:a.labelBackgroundFill,A=null===(h=m.columnResize)||void 0===h?void 0:h.labelBackgroundCornerRadius;this.columnResizeLine=pa({visible:!1,pickable:!1,stroke:b,lineWidth:v,x:0,y:0,points:[{x:0,y:0},{x:0,y:0}]}),this.columnResizeBgLine=pa({visible:!1,pickable:!1,stroke:y,lineWidth:C,x:0,y:0,points:[{x:0,y:0},{x:0,y:0}]});const B=ol({visible:!1,pickable:!1,x:0,y:0,fontSize:x,fill:w,fontFamily:_,text:"",textBaseline:"top",dx:16,dy:-x/2}),R=ba({visible:!1,pickable:!1,fill:S,x:0,y:0,width:5*x*.8,height:x+8,cornerRadius:A,dx:12,dy:-x/2-4});this.columnResizeLabel=us({visible:!1,pickable:!1,x:0,y:0}),this.columnResizeLabel.appendChild(R),this.columnResizeLabel.appendChild(B),this.rowResizeLine=pa({visible:!1,pickable:!1,stroke:b,lineWidth:v,x:0,y:0,points:[{x:0,y:0},{x:0,y:0}]}),this.rowResizeBgLine=pa({visible:!1,pickable:!1,stroke:y,lineWidth:C,x:0,y:0,points:[{x:0,y:0},{x:0,y:0}]});const M=ol({visible:!1,pickable:!1,x:0,y:0,fontSize:x,fill:w,fontFamily:_,text:"",textBaseline:"top",dx:16,dy:-x/2}),T=ba({visible:!1,pickable:!1,fill:S,x:0,y:0,width:5*x*.8,height:x+8,cornerRadius:A,dx:12,dy:-x/2-4});this.rowResizeLabel=us({visible:!1,pickable:!1,x:0,y:0}),this.rowResizeLabel.appendChild(T),this.rowResizeLabel.appendChild(M),this.cellMover=new DS(this.table);const k=null===(c=null===(d=m.frozenColumnLine)||void 0===d?void 0:d.shadow)||void 0===c?void 0:c.width,P=null===(g=null===(u=m.frozenColumnLine)||void 0===u?void 0:u.shadow)||void 0===g?void 0:g.startColor,E=null===(f=null===(p=m.frozenColumnLine)||void 0===p?void 0:p.shadow)||void 0===f?void 0:f.endColor;this.frozenShadowLine=ba({visible:!0,pickable:!1,x:0,y:0,width:k,height:0,fill:{gradient:"linear",x0:0,y0:0,x1:1,y1:0,stops:[{color:P,offset:0},{color:E,offset:1}]}}),this.rightFrozenShadowLine=ba({visible:!0,pickable:!1,x:0,y:0,width:k,height:0,fill:{gradient:"linear",x0:0,y0:0,x1:1,y1:0,stops:[{color:E,offset:0},{color:P,offset:1}]}}),this.menu=new class{constructor(t){this._table=t,this._menuInstance=new S_({x:0,y:0,fill:kS,stroke:LS,cornerRadius:PS,lineWidth:ES}),this._menuInfo={x:-1,y:-1,col:-1,row:-1,type:_S.dropDown,menuInfo:[],highlightIndex:-1}}bindTableComponent(t){t.appendChild(this._menuInstance),this.bindEvent()}release(){}attach(t,e,i,o,n,r){if(n===_S.dropDown&&this.checkDropDownMenuChange(i,o)){const t=this.getMenuInfo(i,o,n);if(!t)return;const{menuInfo:e,highlightIndex:r}=t;this.updateMenuInfo(i,o,n,e,r),this.updateMenuInstance(e,r)}else if(n===_S.contextmenu&&this.checkContextMenuChange(t,e)){const t=this.getMenuInfo(i,o,n);if(!t)return;const{menuInfo:e,highlightIndex:r}=t;this.updateMenuInfo(i,o,n,e,r),this.updateMenuInstance(e,r)}this.updatePosition(t-this._table.scenegraph.x,e-this._table.scenegraph.y),this.addToScene()}updateMenuInfo(t,e,i,o,n){this._menuInfo.col=t,this._menuInfo.row=e,this._menuInfo.type=i,this._menuInfo.menuInfo=o,this._menuInfo.highlightIndex=n}checkDropDownMenuChange(t,e){const{type:i,col:o,row:n}=this._menuInfo;return i!==_S.dropDown||t!==o||e!==n}checkContextMenuChange(t,e){var i;const{type:o,menuInfo:n}=this._menuInfo;return o!==_S.contextmenu||n!==(null===(i=this._table.internalProps.menu)||void 0===i?void 0:i.contextMenuItems)}updateMenuInstance(t,e){this._menuInstance.removeAllChild();let i=HS;const o=HS;let n=0;t.forEach(((t,r)=>{var s,l;const a=e===r;let h,d;"string"==typeof t?d=t:"object"==typeof t&&(d=t.text,h=a?t.selectedIcon:t.icon);const c=new S_({y:i,x:o,height:TS,fill:kS});c.role="menu-item",this._menuInstance.appendChild(c),c.stateProxy=t=>"hover"===t?{fill:MS}:{fill:kS},c.addEventListener("pointerenter",(t=>{c.addState("hover",!0,!1),this._table.scenegraph.updateNextFrame()})),c.addEventListener("pointerleave",(t=>{c.removeState("hover",!1),this._table.scenegraph.updateNextFrame()}));const u=new il({x:zS,y:zS,fill:a?RS:BS,text:d,textBaseline:"top",fontSize:SS,fontFamily:AS,pickable:!1,maxLineWidth:FS,ellipsis:"…"});if(c.addChild(u),h){u.AABBBounds.height();const t=null!==(s=h.width)&&void 0!==s?s:16,e=null!==(l=h.height)&&void 0!==l?l:16,i=new n_({x:zS,y:(TS-e)/2,width:t,height:e,image:h.svg,pickable:!1});i.role="menu-icon",c.insertBefore(i,u),u.setAttribute("x",t+zS)}n=Math.max(c.AABBBounds.width(),n),i+=TS})),this._menuInstance.setAttributes({width:n+2*zS+2*HS,height:i+HS}),this._menuInstance.forEachChildren((t=>{t.setAttribute("width",n+2*zS)}))}updatePosition(t,e){this._menuInstance.setAttributes({x:this._menuInfo.type===_S.dropDown?t-this._menuInstance.attribute.width:t,y:e}),this._menuInfo.x=_S.dropDown?t-this._menuInstance.attribute.width:t,this._menuInfo.y=e}addToScene(){this._table.scenegraph.updateNextFrame()}detach(){this._menuInstance.setAttributes({x:-1e3,y:-1e3}),this._table.scenegraph.updateNextFrame()}getMenuInfo(t,e,i){var o;if(i===_S.dropDown){const{dropDownMenu:i=this._table.globalDropDownMenu,pivotInfo:o}=this._table._getHeaderLayoutMap(t,e);let n=-1;if(Array.isArray(i))for(let o=0;o<i.length;o++)if(this._table._dropDownMenuIsHighlight(t,e,o)){n=o;break}return{menuInfo:i,highlightIndex:n}}if(i===_S.contextmenu){const i=null===(o=this._table.internalProps.menu)||void 0===o?void 0:o.contextMenuItems;let n;if(Array.isArray(i))n=i;else if("function"==typeof i){const{field:o}=this._table.isHeader(t,e)?this._table.getHeaderDefine(t,e):this._table.getBodyColumnDefine(t,e);n=i(o,e,t)}return{menuInfo:n,highlightIndex:-1}}}bindEvent(){this._menuInstance.addEventListener("click",(t=>{const{target:e}=t;if(e&&"menu-item"===e.role){const i=this.getEventInfo(e),o=this._table.getMenuInfo(this._menuInfo.col,this._menuInfo.row,this._menuInfo.type),n=Object.assign(i,o);n.event=t.nativeEvent,this._table.fireListeners(cw.DROPDOWN_MENU_CLICK,n)}}))}getEventInfo(t){const e=t.parent;let i=0;e.forEachChildren(((e,o)=>e===t&&(i=o-1,!0)));const o="string"==typeof this._menuInfo.menuInfo[i]?this._menuInfo.menuInfo[i]:this._menuInfo.menuInfo[i].text,n="string"==typeof this._menuInfo.menuInfo[i]?o:this._menuInfo.menuInfo[i].menuKey||o;return{col:this._menuInfo.col,row:this._menuInfo.row,dropDownIndex:i,highlight:i===this._menuInfo.highlightIndex,text:o,menuKey:n}}get bounds(){return this._menuInstance.globalAABBBounds}}(this.table),this.drillIcon=new OS}addToGroup(t){t.addChild(this.frozenShadowLine),t.addChild(this.rightFrozenShadowLine),t.addChild(this.columnResizeBgLine),t.addChild(this.columnResizeLine),t.addChild(this.columnResizeLabel),t.addChild(this.rowResizeBgLine),t.addChild(this.rowResizeLine),t.addChild(this.rowResizeLabel),this.table.theme.scrollStyle.hoverOn&&!this.table.theme.scrollStyle.barToSide?(t.addChild(this.hScrollBar),t.addChild(this.vScrollBar)):(t.stage.defaultLayer.addChild(this.hScrollBar),t.stage.defaultLayer.addChild(this.vScrollBar)),this.menu.bindTableComponent(t),this.drillIcon.appand(t),this.cellMover.appand(t)}createScrollBar(){var t,e,i,o;const n=this.table.theme,r=null===(t=n.scrollStyle)||void 0===t?void 0:t.scrollRailColor,s=null===(e=n.scrollStyle)||void 0===e?void 0:e.scrollSliderColor,l=null===(i=n.scrollStyle)||void 0===i?void 0:i.scrollSliderCornerRadius,a=null===(o=n.scrollStyle)||void 0===o?void 0:o.width;let h;h=Q(l)?{cornerRadius:l,fill:s}:{fill:s},this.hScrollBar=new wb({direction:"horizontal",x:2*-this.table.tableNoFrameWidth,y:2*-this.table.tableNoFrameHeight,width:this.table.tableNoFrameWidth,height:a,padding:0,railStyle:{fill:r},sliderStyle:h,range:[0,.1],visible:!1}),this.hScrollBar.render(),this.hScrollBar.hideAll(),this.vScrollBar=new wb({direction:"vertical",x:2*-this.table.tableNoFrameWidth,y:2*-this.table.tableNoFrameHeight,width:a,height:this.table.tableNoFrameHeight-this.table.getFrozenRowsHeight(),padding:0,railStyle:{fill:r},sliderStyle:h,range:[0,.1],visible:!1}),this.vScrollBar.render(),this.vScrollBar.hideAll()}updateScrollBar(){var t,e,i,o,n,r,s;const l=this.table.stateManager.scroll.horizontalBarPos,a=this.table.stateManager.scroll.verticalBarPos,h=this.table.theme,d=null===(t=h.scrollStyle)||void 0===t?void 0:t.width,c=null===(e=h.scrollStyle)||void 0===e?void 0:e.visible,u=null!==(o=null===(i=h.scrollStyle)||void 0===i?void 0:i.horizontalVisible)&&void 0!==o?o:c,g=null!==(r=null===(n=h.scrollStyle)||void 0===n?void 0:n.verticalVisible)&&void 0!==r?r:c,p=Math.ceil(this.table.scenegraph.tableGroup.attribute.width),f=Math.ceil(this.table.scenegraph.tableGroup.attribute.height),m=this.table.getAllRowsHeight(),b=this.table.getAllColsWidth(),v=this.table.getFrozenRowsHeight(),y=this.table.getFrozenColsWidth(),C=this.table.getBottomFrozenRowsHeight(),w=this.table.getRightFrozenColsWidth(),x=(null===(s=this.table.options.customConfig)||void 0===s?void 0:s._disableColumnAndRowSizeRound)?1:0;if(b>p+x){const t=Math.min(f,m),e=Math.max(.05,(p-y)/(b-y)),i=this.table.theme.scrollStyle.hoverOn;let o=0;o=this.table.theme.scrollStyle.barToSide?this.table.tableNoFrameHeight-(i?d:-this.table.scenegraph.tableGroup.attribute.y)+this.table.tableY:t-(i?d:-this.table.scenegraph.tableGroup.attribute.y),this.hScrollBar.setAttributes({x:y+(i?0:this.table.scenegraph.tableGroup.attribute.x),y:o,width:p-y-w,range:[0,e],visible:"always"===u});const n=this.hScrollBar.AABBBounds&&this.hScrollBar.globalAABBBounds;this.hScrollBar._viewPosition={x:n.x1,y:n.y1},"always"===u&&this.hScrollBar.showAll()}else this.hScrollBar.setAttributes({x:2*-this.table.tableNoFrameWidth,y:2*-this.table.tableNoFrameHeight,width:0,visible:!1});if(m>f+x){const t=Math.min(p,b),e=Math.max(.05,(f-v)/(m-v));let i=0;const o=this.table.theme.scrollStyle.hoverOn;i=this.table.theme.scrollStyle.barToSide?this.table.tableNoFrameWidth-(o?d:-this.table.scenegraph.tableGroup.attribute.x)+this.table.tableX:t-(o?d:-this.table.scenegraph.tableGroup.attribute.x),this.vScrollBar.setAttributes({x:i,y:v+(o?0:this.table.scenegraph.tableGroup.attribute.y),height:f-v-C,range:[0,e],visible:"always"===g});const n=this.vScrollBar.AABBBounds&&this.vScrollBar.globalAABBBounds;this.vScrollBar._viewPosition={x:n.x1,y:n.y1},"always"===g&&this.vScrollBar.showAll()}else this.vScrollBar.setAttributes({x:2*-this.table.tableNoFrameWidth,y:2*-this.table.tableNoFrameHeight,height:0,visible:!1});this.table.stateManager.setScrollLeft(l),this.table.stateManager.setScrollTop(a)}hideResizeCol(){this.columnResizeLine.setAttribute("visible",!1),this.columnResizeBgLine.setAttribute("visible",!1),this.columnResizeLabel.setAttribute("visible",!1),this.columnResizeLabel.hideAll()}showResizeCol(t,e,i){const o=WS(t,this.table,i);this.columnResizeLine.setAttributes({visible:!0,x:o,points:[{x:0,y:0},{x:0,y:this.table.getRowsHeight(0,this.table.rowCount-1)}]}),this.columnResizeBgLine.setAttributes({visible:!0,x:o,points:[{x:0,y:0},{x:0,y:this.table.getRowsHeight(0,this.table.rowCount-1)}]}),this.columnResizeLabel.showAll(),this.columnResizeLabel.setAttributes({visible:!0,x:o,y:e}),this.columnResizeLabel.lastChild.setAttribute("text",`${this.table.getColWidth(t)}px`)}updateResizeCol(t,e,i){const o=WS(t,this.table,i);this.columnResizeLine.setAttributes({x:o,points:[{x:0,y:0},{x:0,y:this.table.getRowsHeight(0,this.table.rowCount-1)}]}),this.columnResizeBgLine.setAttributes({x:o,points:[{x:0,y:0},{x:0,y:this.table.getRowsHeight(0,this.table.rowCount-1)}]}),this.columnResizeLabel.setAttributes({x:o,y:e}),this.columnResizeLabel.lastChild.setAttribute("text",`${Math.floor(this.table.getColWidth(t))}px`)}hideResizeRow(){this.rowResizeLine.setAttribute("visible",!1),this.rowResizeBgLine.setAttribute("visible",!1),this.rowResizeLabel.setAttribute("visible",!1),this.rowResizeLabel.hideAll()}showResizeRow(t,e,i){const o=NS(t,this.table,i);this.rowResizeLine.setAttributes({visible:!0,y:o,points:[{y:0,x:0},{y:0,x:this.table.getColsWidth(0,this.table.colCount-1)}]}),this.rowResizeBgLine.setAttributes({visible:!0,y:o,points:[{y:0,x:0},{y:0,x:this.table.getColsWidth(0,this.table.colCount-1)}]}),this.rowResizeLabel.showAll(),this.rowResizeLabel.setAttributes({visible:!0,y:o,x:e}),this.rowResizeLabel.lastChild.setAttribute("text",`${this.table.getRowHeight(t)}px`)}updateResizeRow(t,e,i){const o=NS(t,this.table,i);this.rowResizeLine.setAttributes({y:o,points:[{y:0,x:0},{y:0,x:this.table.getColsWidth(0,this.table.colCount-1)}]}),this.rowResizeBgLine.setAttributes({y:o,points:[{y:0,x:0},{y:0,x:this.table.getColsWidth(0,this.table.colCount-1)}]}),this.rowResizeLabel.setAttributes({y:o,x:e}),this.rowResizeLabel.lastChild.setAttribute("text",`${Math.floor(this.table.getRowHeight(t))}px`)}hideMoveCol(){this.cellMover.hide()}showMoveCol(t,e,i){this.cellMover.show(t,e,i)}updateMoveCol(t,e,i,o){this.cellMover.update(t,e,i,o)}setFrozenColumnShadow(t,e){if(t<0)this.frozenShadowLine.setAttributes({visible:!1});else{const i=WS(t,this.table,e);this.frozenShadowLine.setAttributes({visible:!0,x:i,height:this.table.getDrawRange().height})}}setRightFrozenColumnShadow(t){if(t>=this.table.colCount)this.rightFrozenShadowLine.setAttributes({visible:!1});else{const e=WS(t,this.table,!0);this.rightFrozenShadowLine.setAttributes({visible:!0,x:e-this.rightFrozenShadowLine.attribute.width,height:this.table.getDrawRange().height})}}hideVerticalScrollBar(){var t;const e=this.table.theme.scrollStyle.visible,i=null!==(t=this.table.theme.scrollStyle.verticalVisible)&&void 0!==t?t:e;"focus"!==i&&"scrolling"!==i||(this.vScrollBar.setAttribute("visible",!1),this.vScrollBar.hideAll(),this.table.scenegraph.updateNextFrame())}showVerticalScrollBar(){var t;const e=this.table.theme.scrollStyle.visible,i=null!==(t=this.table.theme.scrollStyle.verticalVisible)&&void 0!==t?t:e;"focus"!==i&&"scrolling"!==i||(this.vScrollBar.setAttribute("visible",!0),this.vScrollBar.showAll(),this.table.scenegraph.updateNextFrame())}hideHorizontalScrollBar(){var t;const e=this.table.theme.scrollStyle.visible,i=null!==(t=this.table.theme.scrollStyle.horizontalVisible)&&void 0!==t?t:e;"focus"!==i&&"scrolling"!==i||(this.hScrollBar.setAttribute("visible",!1),this.hScrollBar.hideAll(),this.table.scenegraph.updateNextFrame())}showHorizontalScrollBar(){var t;const e=this.table.theme.scrollStyle.visible,i=null!==(t=this.table.theme.scrollStyle.horizontalVisible)&&void 0!==t?t:e;"focus"!==i&&"scrolling"!==i||(this.hScrollBar.setAttribute("visible",!0),this.hScrollBar.showAll(),this.table.scenegraph.updateNextFrame())}updateVerticalScrollBarPos(t){const e=this.vScrollBar.attribute.range,i=e[1]-e[0],o=t*(1-i);this.vScrollBar.setAttribute("range",[o,o+i]);const n=this.vScrollBar.AABBBounds&&this.vScrollBar.globalAABBBounds;this.vScrollBar._viewPosition={x:n.x1,y:n.y1}}updateHorizontalScrollBarPos(t){const e=this.hScrollBar.attribute.range,i=e[1]-e[0],o=t*(1-i);this.hScrollBar.setAttribute("range",[o,o+i]);const n=this.hScrollBar.AABBBounds&&this.hScrollBar.globalAABBBounds;this.hScrollBar._viewPosition={x:n.x1,y:n.y1}}updateStyle(){var t,e,i,o,n,r,s,l,a,h,d,c,u,g,p,f,m,b,v;const y=this.table.theme,C=null===(t=y.scrollStyle)||void 0===t?void 0:t.scrollRailColor,w=null===(e=y.scrollStyle)||void 0===e?void 0:e.scrollSliderColor,x=null===(i=y.scrollStyle)||void 0===i?void 0:i.scrollSliderCornerRadius,_=null===(o=y.scrollStyle)||void 0===o?void 0:o.width;let S;S=Q(x)?{cornerRadius:x,fill:w}:{fill:w},this.hScrollBar.setAttributes({height:_,railStyle:{fill:C},sliderStyle:S}),this.vScrollBar.setAttributes({width:_,railStyle:{fill:C},sliderStyle:S});const A=null===(n=y.columnResize)||void 0===n?void 0:n.lineColor,B=null===(r=y.columnResize)||void 0===r?void 0:r.lineWidth,R=null===(s=y.columnResize)||void 0===s?void 0:s.bgColor,M=null===(l=y.columnResize)||void 0===l?void 0:l.width;this.columnResizeLine.setAttributes({stroke:A,lineWidth:B}),this.columnResizeBgLine=pa({stroke:R,lineWidth:M});const T=null===(a=y.columnResize)||void 0===a?void 0:a.labelColor,k=null===(h=y.columnResize)||void 0===h?void 0:h.labelFontSize,P=null===(d=y.columnResize)||void 0===d?void 0:d.labelFontFamily,E=null===(c=y.columnResize)||void 0===c?void 0:c.labelBackgroundFill,L=null===(u=y.columnResize)||void 0===u?void 0:u.labelBackgroundCornerRadius;this.columnResizeLabel.lastChild.setAttributes({fontSize:k,fill:T,fontFamily:P,dy:-k/2}),this.columnResizeLabel.firstChild.setAttributes({fill:E,width:5*k*.8,height:k+8,cornerRadius:L,dy:-k/2-4}),this.rowResizeLabel.lastChild.setAttributes({fontSize:k,fill:T,fontFamily:P,dy:-k/2}),this.rowResizeLabel.firstChild.setAttributes({fill:E,width:5*k*.8,height:k+8,cornerRadius:L,dy:-k/2-4});const H=null===(p=null===(g=y.frozenColumnLine)||void 0===g?void 0:g.shadow)||void 0===p?void 0:p.width,z=null===(m=null===(f=y.frozenColumnLine)||void 0===f?void 0:f.shadow)||void 0===m?void 0:m.startColor,F=null===(v=null===(b=y.frozenColumnLine)||void 0===b?void 0:b.shadow)||void 0===v?void 0:v.endColor;this.frozenShadowLine.setAttributes({width:H,fill:{gradient:"linear",x0:0,y0:0,x1:1,y1:0,stops:[{color:z,offset:0},{color:F,offset:1}]}}),this.rightFrozenShadowLine.setAttributes({width:H,fill:{gradient:"linear",x0:0,y0:0,x1:1,y1:0,stops:[{color:F,offset:0},{color:z,offset:1}]}}),this.cellMover.updateStyle()}}function jS(t,e,i,o,n){var r,s,l,a,h;if(!e)return;const d="table"===i,{shadowBlur:c,shadowOffsetX:u,shadowOffsetY:g,shadowColor:p,cornerRadius:f,borderColor:m,borderLineWidth:b,borderLineDash:v}=e;let y=!1;const C={},w={pickable:!1};c&&d&&(w.shadowBlur=c,w.shadowOffsetX=u,w.shadowOffsetY=g,w.shadowColor=p,w.stroke=!0,w.stroke=p,w.lineWidth=1,y=!0),b&&(w.stroke=!0,w.fill=!1,w.stroke=US(m,o),w.lineWidth=b,v&&(w.lineDash=v),w.lineCap="butt"),Array.isArray(m)&&(w.strokeArrayColor=vx(m)),Array.isArray(b)&&(w.strokeArrayWidth=vx(b),w.lineWidth=1),f&&(w.cornerRadius=f,C.cornerRadius=f);const x=w.strokeArrayWidth?w.strokeArrayWidth[0]:null!==(r=w.lineWidth)&&void 0!==r?r:0,_=w.strokeArrayWidth?w.strokeArrayWidth[1]:null!==(s=w.lineWidth)&&void 0!==s?s:0,S=w.strokeArrayWidth?w.strokeArrayWidth[2]:null!==(l=w.lineWidth)&&void 0!==l?l:0,A=w.strokeArrayWidth?w.strokeArrayWidth[3]:null!==(a=w.lineWidth)&&void 0!==a?a:0;if(t.setAttributes(C),!n&&w.stroke)if(w.x=A/2,w.y=x/2,w.pickable=!1,d){let i,o;if(f&&(w.cornerRadius=f+(null!==(h=w.lineWidth)&&void 0!==h?h:0)/2),e.innerBorder?(w.x=t.attribute.x+A/2,w.y=t.attribute.y+x/2,w.width=t.attribute.width-A/2-_/2,w.height=t.attribute.height-x/2-S/2):(w.x=t.attribute.x-A/2,w.y=t.attribute.y-x/2,w.width=t.attribute.width+A/2+_/2,w.height=t.attribute.height+x/2+S/2),y){w.fill="white",w.notAdjustPos=!0,o=us(w),o.name="table-border-rect",i=ba({x:A/2,y:x/2,width:t.attribute.width,height:t.attribute.height,fill:"red",cornerRadius:t.attribute.cornerRadius,globalCompositeOperation:"destination-out"}),o.addChild(i);const e=ba({width:1,height:1,fill:"transparent",pickable:!1});o.addChild(e)}else o=ba(w),o.name="table-border-rect";e.innerBorder&&!y?t.parent.insertAfter(o,t):t.parent.insertBefore(o,t),t.border=o}else{w.width=t.attribute.width-A/2-_/2,w.height=t.attribute.height-x/2-S/2;const e=ba(w);e.name="border-rect",t.addChild(e),t.border=e}}function VS(t,e,i){var o;const{borderColor:n}=e;null===(o=t.border)||void 0===o||o.setAttribute("stroke",US(n,i))}function US(t,e){let i=!0;return e&&!rt(t)?i=e.map((e=>!!e&&t)):e?i=e:e||rt(t)?rt(t)&&(i=!0):i=t,i}function $S(t){var e,i,o,n;if(!t.border)return;const r=t.border.attribute.strokeArrayWidth?t.border.attribute.strokeArrayWidth[0]:null!==(e=t.border.attribute.lineWidth)&&void 0!==e?e:0,s=t.border.attribute.strokeArrayWidth?t.border.attribute.strokeArrayWidth[1]:null!==(i=t.border.attribute.lineWidth)&&void 0!==i?i:0,l=t.border.attribute.strokeArrayWidth?t.border.attribute.strokeArrayWidth[2]:null!==(o=t.border.attribute.lineWidth)&&void 0!==o?o:0,a=t.border.attribute.strokeArrayWidth?t.border.attribute.strokeArrayWidth[3]:null!==(n=t.border.attribute.lineWidth)&&void 0!==n?n:0;t.border.setAttributes({width:t.attribute.width-a/2-s/2,height:t.attribute.height-r/2-l/2}),"group"===t.border.type&&t.border.firstChild.setAttributes({width:t.attribute.width,height:t.attribute.height})}function XS(t,e){t.setAttribute("cornerRadius",e),t.border&&t.border.setAttribute("cornerRadius",e)}const YS=Nr();class KS extends cs{constructor(t,e){if(super(e),this.type="chart",this.numberType=YS,this.isShareChartSpec=t,e.chartInstance)this.chartInstance=e.chartInstance;else{const t=new e.ClassType(e.spec,{renderCanvas:e.canvas,mode:"node"===this.attribute.mode?"node":"desktop-browser",modeParams:this.attribute.modeParams,canvasControled:!1,viewBox:{x1:0,x2:0,y1:0,y2:0},dpr:e.dpr,interactive:!1,animation:!1,autoFit:!1});t.renderSync(),e.chartInstance=this.chartInstance=t}}activate(t){var e,i,o,n;this.active=!0;const{col:r,row:s}=this.parent,{x1:l,y1:a,x2:h,y2:d}=this.getViewBox(),c=function(t,e,i){const{layoutMap:o}=i.internalProps,n=new ye,r=i.scenegraph.tableGroup.globalAABBBounds;return n.x1=r.x1,n.x2=r.x2,n.y1=r.y1,n.y2=r.y2,o.isFrozenColumn(t,e)||o.isRightFrozenColumn(t,e)?o.isLeftBottomCorner(t,e)||o.isRightTopCorner(t,e)||(o.isFrozenColumn(t,e)||o.isRightFrozenColumn(t,e)?(n.y1=r.y1+i.getFrozenRowsHeight(),n.y2=r.y2-i.getBottomFrozenRowsHeight()):o.isBottomFrozenRow(t,e)&&(n.x1=r.x1+i.getFrozenColsWidth(),n.x2=r.x2-i.getRightFrozenColsWidth())):(n.x1=r.x1+i.getFrozenColsWidth(),n.x2=r.x2-i.getRightFrozenColsWidth(),n.y1=r.y1+i.getFrozenRowsHeight(),n.y2=r.y2-i.getBottomFrozenRowsHeight()),n}(r,s,t).intersect({x1:l-t.scrollLeft,x2:h-t.scrollLeft,y1:a-t.scrollTop,y2:d-t.scrollTop});this.activeChartInstance=new this.attribute.ClassType(this.attribute.spec,{renderCanvas:this.attribute.canvas,mode:"desktop-browser",canvasControled:!1,viewBox:{x1:l-t.scrollLeft,x2:h-t.scrollLeft,y1:a-t.scrollTop,y2:d-t.scrollTop},dpr:t.internalProps.pixelRatio,animation:!1,interactive:!0,autoFit:!1,beforeRender:t=>{const e=t.window.getContext();e.inuse=!0,e.clearMatrix(),e.setTransformForCurrent(!0),e.beginPath(),e.rect(c.x1,c.y1,c.x2-c.x1,c.y2-c.y1),e.clip()},afterRender(t){t.window.getContext().inuse=!1}}),this.activeChartInstance.renderSync(),null===(i=null===(e=t.internalProps.layoutMap)||void 0===e?void 0:e.updateDataStateToActiveChartInstance)||void 0===i||i.call(e,this.activeChartInstance),this.activeChartInstance.on("click",(e=>{KS.temp&&t.scenegraph.updateChartState(null==e?void 0:e.datum)})),this.activeChartInstance.on("brushEnd",(e=>{var i;t.scenegraph.updateChartState(null===(i=null==e?void 0:e.value)||void 0===i?void 0:i.inBrushData),KS.temp=0,setTimeout((()=>{KS.temp=1}),0)})),null===(n=(o=t)._bindChartEvent)||void 0===n||n.call(o,this.activeChartInstance)}deactivate(){var t,e;this.active=!1,null===(t=this.activeChartInstance)||void 0===t||t.updateViewBox({x1:-1e3,x2:-800,y1:-1e3,y2:-800},!1,!1),null===(e=this.activeChartInstance)||void 0===e||e.release(),this.activeChartInstance=null}updateData(t){this.attribute.data=t}getViewBox(){const t=this.parent,e=this.attribute.cellPadding,i=this.stage.table;return{x1:Math.ceil(t.globalAABBBounds.x1+e[3]+i.scrollLeft),x2:Math.ceil(t.globalAABBBounds.x1+t.attribute.width-e[1]+i.scrollLeft),y1:Math.ceil(t.globalAABBBounds.y1+e[0]+i.scrollTop),y2:Math.ceil(t.globalAABBBounds.y1+t.attribute.height-e[2]+i.scrollTop)}}}KS.temp=1;const qS=[],ZS=[];let JS=5,QS=!1;function tA(t){Q(t)&&(JS=t)}function eA(t){var e,i,o,n,r,s;const{axes:l,dataId:a,data:h,spec:d}=t.attribute,{chartInstance:c}=t,u=t.getViewBox();if(u.x2<=u.x1&&(u.x2=u.x1+1),u.y2<=u.y1&&(u.y2=u.y1+1),null==l||l.forEach(((t,e)=>{var i,o,n,r;"band"===t.type?c.updateModelSpec({type:"axes",index:e},{domain:t.domain.slice(0)},!0):c.updateModelSpecSync({type:"axes",index:e},{min:null!==(o=null===(i=t.range)||void 0===i?void 0:i.min)&&void 0!==o?o:0,max:null!==(r=null===(n=t.range)||void 0===n?void 0:n.max)&&void 0!==r?r:0},!0)})),c.updateViewBox({x1:u.x1-t.getRootNode().table.scrollLeft,x2:u.x2-t.getRootNode().table.scrollLeft,y1:u.y1-t.getRootNode().table.scrollTop,y2:u.y2-t.getRootNode().table.scrollTop},!1,!1),null===(i=null===(e=t.getRootNode().table.internalProps.layoutMap)||void 0===e?void 0:e.updateDataStateToActiveChartInstance)||void 0===i||i.call(e,c),"string"==typeof a)c.updateDataSync(a,null!=h?h:[]);else{const t=[];for(const e in a){const i=a[e],s=d.series.find((t=>{var i;return(null===(i=null==t?void 0:t.data)||void 0===i?void 0:i.id)===e}));t.push({id:e,values:i?null!==(o=null==h?void 0:h.filter((t=>t.hasOwnProperty(i))))&&void 0!==o?o:[]:null!=h?h:[],fields:null===(n=null==s?void 0:s.data)||void 0===n?void 0:n.fields}),c.updateFullDataSync||c.updateDataSync(e,i?null!==(r=null==h?void 0:h.filter((t=>t.hasOwnProperty(i))))&&void 0!==r?r:[]:null!=h?h:[])}null===(s=c.updateFullDataSync)||void 0===s||s.call(c,t)}!function(t,e){var i;const{viewWidth:o,viewHeight:n}=t;if(o<oA&&n<oA)return e.cacheCanvas=t.toCanvas(),void(e.isShareChartSpec||(null===(i=e.chartInstance)||void 0===i||i.release(),e.chartInstance=null,e.setAttribute("chartInstance",null)));const r=Math.ceil(n/oA),s=Math.ceil(o/oA),l=[];for(let e=0;e<r;e++)for(let i=0;i<s;i++){const r=i*oA,s=e*oA,a=r+oA>o?o:r+oA,h=s+oA>n?n:s+oA,d=a-r,c=h-s,u=new ye;u.setValue(r,s,a,h);const g=t.toCanvas(!1,u);l.push({canvas:g,x:r,y:s,width:d,height:c})}e.cacheCanvas=l}(c.getStage(),t)}function iA(t){QS=!0,ZS.length>0?requestAnimationFrame((()=>{const e=ZS.splice(0,JS);qS.splice(0,JS),e.forEach((t=>{eA(t),t.addUpdateBoundTag()})),t.render(),iA(t)})):QS=!1}const oA=2e3;var nA=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s};const rA=Symbol.for("ChartRender");let sA=class{constructor(){this.numberType=YS}drawShape(t,e,i,o,n,r,s,l){var a,h,d,c;const u=_n(t,null==r?void 0:r.theme).group,{dataId:g,data:p,spec:f}=t.attribute,{width:m=u.width,height:b=u.height}=(t.getViewBox(),t.attribute),{active:v,cacheCanvas:y,activeChartInstance:C}=t;if(!v&&y)rt(y)?y.forEach((t=>{const{x:i,y:o,width:n,height:r,canvas:s}=t;e.drawImage(s,i,o,n,r)})):e.drawImage(y,i,o,m,b);else if(C)if("string"==typeof g)C.updateDataSync(g,null!=p?p:[]);else{const t=[];for(const e in g){const i=g[e],o=f.series.find((t=>{var i;return(null===(i=null==t?void 0:t.data)||void 0===i?void 0:i.id)===e}));t.push({id:e,values:i?null!==(a=null==p?void 0:p.filter((t=>t.hasOwnProperty(i))))&&void 0!==a?a:[]:null!=p?p:[],fields:null===(h=null==o?void 0:o.data)||void 0===h?void 0:h.fields}),C.updateFullDataSync||C.updateDataSync(e,i?null!==(d=null==p?void 0:p.filter((t=>t.hasOwnProperty(i))))&&void 0!==d?d:[]:null!=p?p:[])}null===(c=C.updateFullDataSync)||void 0===c||c.call(C,t)}else t.getRootNode().table.internalProps.renderChartAsync?(-1===qS.indexOf(`${t.parent.col}+${t.parent.row}`)&&(qS.push(`${t.parent.col}+${t.parent.row}`),ZS.push(t)),QS||iA(t.getRootNode().table)):eA(t)}draw(t,e,i,o){const{context:n}=i;if(!n)return;const{clip:r}=t.attribute;r?n.save():n.highPerformanceSave(),n.transformFromMatrix(t.transMatrix,!0),n.beginPath(),o.skipDraw?this.drawShape(t,n,0,0,i,o,(()=>!1),(()=>!1)):this.drawShape(t,n,0,0,i),r?n.restore():n.highPerformanceRestore()}};sA=nA([y()],sA);var lA=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s};let aA=class{constructor(){this.time=Pi.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,o,n,r,s,l,a,h,d,c,u){const{shape:g}=t.attribute;if("circle"===g){const{width:n=a.width,height:r=a.height}=t.attribute;e.beginPath(),e.arc(i+n/2,o+r/2,Math.min(n,r)/2,0,2*Math.PI),e.closePath(),e.save(),e.clip()}}};aA=lA([y()],aA);let hA=class{constructor(){this.time=Pi.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,o,n,r,s,l,a,h,d,c,u){const{shape:g}=t.attribute;"circle"===g&&e.restore()}};function dA(t,e,i,o){var n;const{highlightScope:r,disableHeader:s,cellPos:l}=t.hover,a=t.table,h=a.isHeader(e,i);if(h&&s)return;let d;if(r===qy.single&&l.col===e&&l.row===i?d="cellBgColor":r===qy.column&&l.col===e?d=l.col===e&&l.row===i?"cellBgColor":"inlineColumnBgColor":r===qy.row&&l.row===i?d=l.col===e&&l.row===i?"cellBgColor":"inlineRowBgColor":r===qy.cross&&(l.col===e&&l.row===i?d="cellBgColor":l.col===e?d="inlineColumnBgColor":l.row===i&&(d="inlineRowBgColor")),d){let t;if(h){const r=a.getHeaderDefine(e,i);t=null==r?void 0:r.disableHeaderHover,o.firstChild&&"axis"===o.firstChild.name&&(null===(n=a.options.hover)||void 0===n?void 0:n.disableAxisHover)&&(t=!0)}else{const o=a.getBodyColumnDefine(e,i);t=null==o?void 0:o.disableHover}t&&(d=void 0)}return d}function cA(t,e,i,o){const{highlightScope:n,disableHeader:r,cellPos:s,ranges:l}=t.select;let a;if(1===(null==l?void 0:l.length)&&l[0].end.col===l[0].start.col&&l[0].end.row===l[0].start.row){const o=t.table,l=o.isHeader(e,i);if(l&&r)return;if(n===qy.single&&s.col===e&&s.row===i?a="cellBgColor":n===qy.column&&s.col===e?a=s.col===e&&s.row===i?"cellBgColor":"inlineColumnBgColor":n===qy.row&&s.row===i?a=s.col===e&&s.row===i?"cellBgColor":"inlineRowBgColor":n===qy.cross&&(s.col===e&&s.row===i?a="cellBgColor":s.col===e?a="inlineColumnBgColor":s.row===i&&(a="inlineRowBgColor")),a){let t;if(l){const n=o.getHeaderDefine(e,i);t=null==n?void 0:n.disableHeaderSelect}else{const n=o.getBodyColumnDefine(e,i);t=null==n?void 0:n.disableSelect}t&&(a=void 0)}}return a}function uA(t,e,i){const o=t.getBodyColumnDefine(e,i),n=t.isHeader(e,i);return!(!(null==o?void 0:o.disableSelect)||n)||!(!n||!(null==o?void 0:o.disableHeaderSelect))}hA=lA([y()],hA);var gA=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s};let pA=class{constructor(){this.time=Pi.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,o,n,r,s,l,a,h,d,c,u){const{stroke:g=a.stroke,strokeArrayWidth:p=a.strokeArrayWidth,strokeArrayColor:f=a.strokeArrayColor}=t.attribute;g&&(Array.isArray(p)||Array.isArray(f))&&(u.doStroke=!1)}};pA=gA([y()],pA);let fA=class{constructor(){this.time=Pi.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,o,n,r,s,l,a,h,d,c){var u;const{stroke:g=a.stroke,strokeArrayColor:p=a.strokeArrayColor,strokeArrayWidth:f=a.strokeArrayWidth,lineWidth:m=a.lineWidth,strokeColor:b=a.stroke}=t.attribute;let v,y,{width:C=a.width,height:w=a.height}=t.attribute;if(g&&(Array.isArray(f)||0!==m)&&(Array.isArray(p)||Array.isArray(f))){if("number"==typeof m&&1&m||Array.isArray(f)&&f.some((t=>1&t))){const e=t.stage.table;if(!e)return;const n="bottom-right"===(null==e?void 0:e.theme.cellBorderClipDirection);n?(i=Math.floor(i)-.5,o=Math.floor(o)-.5):(i=Math.floor(i)+.5,o=Math.floor(o)+.5),(null===(u=e.options.customConfig)||void 0===u?void 0:u._disableColumnAndRowSizeRound)&&(C=Math.round(C),w=Math.round(w));const{width:r,height:s}=AA(t,Math.ceil(C),Math.ceil(w),n);v=r,y=s}else v=Math.ceil(C),y=Math.ceil(w);mA(t,e,i,o,a,g,f||m,p||b,v,y)}}};function mA(t,e,i,o,n,r,s,l,a,h,d,c){var u,g,p,f;const m=function(t){if(!Array.isArray(t))return{isSplitDraw:!1,width:t};let e;for(let i=0;i<t.length;i++){const o=t[i];if(o)if(e){if(o!==e)return{isSplitDraw:!0}}else e=o}return{isSplitDraw:!1,width:e}}(s),b=!Array.isArray(s),v=!Array.isArray(r),y=Array.isArray(c),C=Array.isArray(l)||m.isSplitDraw;e.setStrokeStyle(t,t.attribute,i,o,n);const{lineDash:w=n.lineDash}=t.attribute;let x=!1;w.length&&w.some((t=>Array.isArray(t)))&&(x=!0),e.beginPath(),e.moveTo(i,o);const _=(v||r[0])&&(b||s[0]),S=(v||r[1])&&(b||s[1]),A=(v||r[2])&&(b||s[2]),B=(v||r[3])&&(b||s[3]);if(_){const t=(b?m.width:s[0])/2,n=(b?m.width:s[0])/2;y&&Array.isArray(c[0])?(e.moveTo(i-t+(a+t+n)*c[0][0],o),e.lineTo(i-t+(a+t+n)*(c[0][1]-c[0][0]),o),e.moveTo(i+a+n,o)):(e.moveTo(i-t,o),e.lineTo(i+a+n,o)),(C||x)&&(l&&l[0]?e.strokeStyle=l[0]:e.strokeStyle="transparent",b||(e.lineWidth=s[0]),e.lineDashOffset=e.currentMatrix.e/e.currentMatrix.a,x&&e.setLineDash(null!==(u=w[0])&&void 0!==u?u:[]),e.stroke(),e.beginPath(),e.moveTo(i+a,o))}else e.moveTo(i+a,o);if(S){const t=(b?m.width:s[1])/2,n=(b?m.width:s[1])/2;y&&Array.isArray(c[1])?(e.moveTo(i+a,o-t+h*c[1][0]),e.lineTo(i+a,o-t+(h+t+n)*(c[1][1]-c[1][0])),e.moveTo(i+a,o+h+n)):(e.moveTo(i+a,o-t),e.lineTo(i+a,o+h+n)),(C||x)&&(l&&l[1]?e.strokeStyle=l[1]:e.strokeStyle="transparent",b||(e.lineWidth=s[1]),e.lineDashOffset=e.currentMatrix.f/e.currentMatrix.d,x&&e.setLineDash(null!==(g=w[1])&&void 0!==g?g:[]),e.stroke(),e.beginPath(),e.moveTo(i+a,o+h))}else e.moveTo(i+a,o+h);if(A){const t=(b?m.width:s[2])/2,n=(b?m.width:s[2])/2;y&&Array.isArray(c[2])?(e.moveTo(i-t+(a+t+n)*c[2][0],o+h),e.lineTo(i-t+(a+t+n)*(c[2][1]-c[2][0]),o+h),e.moveTo(i-t,o+h)):(e.moveTo(i-t,o+h),e.lineTo(i+a+n,o+h)),(C||x)&&(l&&l[2]?e.strokeStyle=l[2]:e.strokeStyle="transparent",b||(e.lineWidth=s[2]),e.lineDashOffset=e.currentMatrix.e/e.currentMatrix.a,x&&e.setLineDash(null!==(p=w[2])&&void 0!==p?p:[]),e.stroke(),e.beginPath(),e.moveTo(i,o+h))}else e.moveTo(i,o+h);if(B){const t=(b?m.width:s[3])/2,n=(b?m.width:s[3])/2;y&&Array.isArray(c[3])?(e.moveTo(i,o-t+(h+t+n)*c[3][0]),e.lineTo(i,o-t+(h+t+n)*(c[3][1]-c[3][0])),e.moveTo(i,o-t)):(e.moveTo(i,o-t),e.lineTo(i,o+h+n)),(C||x)&&(l&&l[3]?e.strokeStyle=l[3]:e.strokeStyle="transparent",b||(e.lineWidth=s[3]),e.lineDashOffset=e.currentMatrix.f/e.currentMatrix.d,x&&e.setLineDash(null!==(f=w[3])&&void 0!==f?f:[]),e.stroke(),e.beginPath(),e.moveTo(i,o))}else e.moveTo(i,o);C||x||(!b&&m.width&&(e.lineWidth=m.width),e.stroke()),e.lineDashOffset=0,e.setLineDash([])}fA=gA([y()],fA);let bA=class{constructor(){this.time=Pi.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,o,n,r,s,l,a,h,d,c,u){var g;const{lineDash:p=a.lineDash,stroke:f=a.stroke,strokeArrayColor:m=a.strokeArrayColor,strokeArrayWidth:b=a.strokeArrayWidth}=t.attribute;f&&Array.isArray(p)&&p.length&&(null===(g=p[0])||void 0===g?void 0:g.length)&&!Array.isArray(m)&&!Array.isArray(b)&&(u.doStroke=!1)}};bA=gA([y()],bA);let vA=class{constructor(){this.time=Pi.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,o,n,r,s,l,a,h,d,c){var u,g,p,f,m,b;const{lineDash:v=a.lineDash,stroke:y=a.stroke,strokeArrayColor:C=a.strokeArrayColor,strokeArrayWidth:w=a.strokeArrayWidth,lineWidth:x=a.lineWidth}=t.attribute;if(!y||!(Array.isArray(v)&&v.length&&(null===(u=v[0])||void 0===u?void 0:u.length))||Array.isArray(C)||Array.isArray(w))return;const _=t.stage.table;if(!_)return;const S=rt(v[0])?function(t){return 1===t.length?[t[0],t[0],t[0],t[0]]:2===t.length?[t[0],t[1],t[0],t[1]]:t}(v):[v,v,v,v];let A,B,{width:R=a.width,height:M=a.height}=t.attribute;if((null===(g=_.options.customConfig)||void 0===g?void 0:g._disableColumnAndRowSizeRound)?(R=Math.round(R),M=Math.round(M)):(R=Math.ceil(R),M=Math.ceil(M)),1&x){const e="bottom-right"===_.theme.cellBorderClipDirection,n=0,r=0;e?(i=Math.floor(i)-.5,o=Math.floor(o)-.5):(i=Math.floor(i)+.5,o=Math.floor(o)+.5);const{width:s,height:l}=AA(t,Math.ceil(R+n),Math.ceil(M+r),e);A=s,B=l}else A=Math.ceil(R),B=Math.ceil(M);e.setStrokeStyle(t,t.attribute,i,o,a),e.beginPath(),e.moveTo(i,o),e.lineTo(i+A,o),e.lineDashOffset=e.currentMatrix.e/e.currentMatrix.a,e.setLineDash(null!==(p=S[0])&&void 0!==p?p:[]),e.stroke(),e.beginPath(),e.moveTo(i+A,o),e.lineTo(i+A,o+B),e.lineDashOffset=e.currentMatrix.f/e.currentMatrix.d,e.setLineDash(null!==(f=S[1])&&void 0!==f?f:[]),e.stroke(),e.beginPath(),e.moveTo(i,o+B),e.lineTo(i+A,o+B),e.lineDashOffset=e.currentMatrix.e/e.currentMatrix.a,e.setLineDash(null!==(m=S[2])&&void 0!==m?m:[]),e.stroke(),e.beginPath(),e.moveTo(i,o),e.lineTo(i,o+B),e.lineDashOffset=e.currentMatrix.f/e.currentMatrix.d,e.setLineDash(null!==(b=S[3])&&void 0!==b?b:[]),e.stroke(),e.lineDashOffset=0,e.setLineDash([])}};vA=gA([y()],vA);let yA=class{constructor(){this.time=Pi.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,o,n,r,s,l,a,h,d,c,u){const{lineWidth:g=a.lineWidth,stroke:p=a.stroke,lineDash:f=a.lineDash,strokeArrayWidth:m=a.strokeArrayWidth,strokeArrayColor:b=a.strokeArrayColor,notAdjustPos:v}=t.attribute;!0!==v&&p&&Array.isArray(f)&&!f.length&&!Array.isArray(b)&&!Array.isArray(m)&&1&g&&(u.doStroke=!1)}};yA=gA([y()],yA);let CA=class{constructor(){this.time=Pi.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,o,n,r,s,l,a,h,d,c){var u;const{lineWidth:g=a.lineWidth,stroke:p=a.stroke,lineDash:f=a.lineDash,strokeArrayWidth:m=a.strokeArrayWidth,strokeArrayColor:b=a.strokeArrayColor,notAdjustPos:v,cornerRadius:y=a.cornerRadius}=t.attribute;let{width:C=a.width,height:w=a.height}=t.attribute;if(!0!==v&&p&&Array.isArray(f)&&!f.length&&!Array.isArray(b)&&!Array.isArray(m)&&1&g){const n=t.stage.table;if(!n)return;(null===(u=n.options.customConfig)||void 0===u?void 0:u._disableColumnAndRowSizeRound)&&(C=Math.round(C),w=Math.round(w)),e.beginPath();const r="bottom-right"===(null==n?void 0:n.theme.cellBorderClipDirection),s=0,l=0;r?(i=Math.floor(i)-.5,o=Math.floor(o)-.5):(i=Math.floor(i)+.5,o=Math.floor(o)+.5);const{width:h,height:d}=AA(t,Math.ceil(C),Math.ceil(w),r);y?xh(e,i,o,h+s,d+l,y):e.rect(i,o,h,d),e.setStrokeStyle(t,t.attribute,i,o,a),e.stroke()}}};CA=gA([y()],CA);let wA=class{constructor(){this.time=Pi.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,o,n,r,s,l,a,h,d,c,u){if("cell"===t.role){const e=t.stage.table;if(e){const i=function(t,e){var i,o,n,r,s,l,a,h,d,c,u;let g,p;if("cell"===t.role&&Q(t.mergeStartCol)&&Q(t.mergeStartRow)&&Q(t.mergeEndCol)&&Q(t.mergeEndRow)){const{colStart:i,colEnd:o,rowStart:n,rowEnd:r}=vS(t,e.scenegraph);for(let t=i;t<=o;t++)for(let i=n;i<=r;i++){const o=cA(e.stateManager,t,i);!o||g&&"cellBgColor"!==o||(g=o)}}else"cell"===t.role&&(g=cA(e.stateManager,t.col,t.row));if(!g)return;const f=e.internalProps.layoutMap;return f.isCornerHeader(t.col,t.row)?p=(null===(i=e.theme.cornerHeaderStyle)||void 0===i?void 0:i.select)||(null===(o=e.theme.headerStyle)||void 0===o?void 0:o.select):f.isColumnHeader(t.col,t.row)?p=null===(n=e.theme.headerStyle)||void 0===n?void 0:n.select:f.isRowHeader(t.col,t.row)?p=null===(r=e.theme.rowHeaderStyle)||void 0===r?void 0:r.select:f.isBottomFrozenRow(t.col,t.row)?p=(null===(s=e.theme.bottomFrozenStyle)||void 0===s?void 0:s.select)||(e.isListTable()?null===(l=e.theme.bodyStyle)||void 0===l?void 0:l.select:null===(a=e.theme.headerStyle)||void 0===a?void 0:a.select):f.isRightFrozenColumn(t.col,t.row)?p=(null===(h=e.theme.rightFrozenStyle)||void 0===h?void 0:h.select)||(e.isListTable()?null===(d=e.theme.bodyStyle)||void 0===d?void 0:d.select:null===(c=e.theme.rowHeaderStyle)||void 0===c?void 0:c.select):e.isHeader(t.col,t.row)||(p=null===(u=e.theme.bodyStyle)||void 0===u?void 0:u.select),R_(g,p,t.col,t.row,e)}(t,e);if(i)t.attribute._vtableHightLightFill=i;else if(e.stateManager.interactionState!==Ky.scrolling){const i=function(t,e){var i,o,n,r,s,l,a,h,d,c,u;let g,p;if("cell"===t.role&&Q(t.mergeStartCol)&&Q(t.mergeStartRow)&&Q(t.mergeEndCol)&&Q(t.mergeEndRow)){const{colStart:i,colEnd:o,rowStart:n,rowEnd:r}=vS(t,e.scenegraph);for(let s=i;s<=o;s++)for(let i=n;i<=r;i++){const o=dA(e.stateManager,s,i,t);!o||g&&"cellBgColor"!==o||(g=o)}}else"cell"===t.role&&(g=dA(e.stateManager,t.col,t.row,t));if(!g)return;const f=e.internalProps.layoutMap;return f.isCornerHeader(t.col,t.row)?p=(null===(i=e.theme.cornerHeaderStyle)||void 0===i?void 0:i.hover)||(null===(o=e.theme.headerStyle)||void 0===o?void 0:o.hover):f.isColumnHeader(t.col,t.row)?p=null===(n=e.theme.headerStyle)||void 0===n?void 0:n.hover:f.isRowHeader(t.col,t.row)?p=null===(r=e.theme.rowHeaderStyle)||void 0===r?void 0:r.hover:f.isBottomFrozenRow(t.col,t.row)?p=(null===(s=e.theme.bottomFrozenStyle)||void 0===s?void 0:s.hover)||(e.isListTable()?null===(l=e.theme.bodyStyle)||void 0===l?void 0:l.hover:null===(a=e.theme.headerStyle)||void 0===a?void 0:a.hover):f.isRightFrozenColumn(t.col,t.row)?p=(null===(h=e.theme.rightFrozenStyle)||void 0===h?void 0:h.hover)||(e.isListTable()?null===(d=e.theme.bodyStyle)||void 0===d?void 0:d.hover:null===(c=e.theme.rowHeaderStyle)||void 0===c?void 0:c.hover):e.isHeader(t.col,t.row)||(p=null===(u=e.theme.bodyStyle)||void 0===u?void 0:u.hover),R_(g,p,t.col,t.row,e)}(t,e);i&&(t.attribute._vtableHightLightFill=i)}}}}};wA=gA([y()],wA);let xA=class{constructor(){this.time=Pi.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,o,n,r,s,l,a,h,d,c){if(t.attribute._vtableHightLightFill)if(d);else if(s){const n=t.attribute.fill;t.attribute.fill=t.attribute._vtableHightLightFill,e.setCommonStyle(t,t.attribute,i,o,a),e.fill(),t.attribute.fill=n,t.attribute._vtableHightLightFill=void 0}}};xA=gA([y()],xA);let _A=class{constructor(){this.time=Pi.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,o,n,r,s,l,a,h,d,c,u){var g,p,f,m,b,v;const y=t.stage.table;if(y)if("body"===t.role){const i=-(null!==(g=t.attribute.x)&&void 0!==g?g:0)+y.getFrozenColsWidth(),o=-(null!==(p=t.attribute.y)&&void 0!==p?p:0)+y.getFrozenRowsHeight(),n=t.parent.attribute.width-y.getFrozenColsWidth()-y.getRightFrozenColsWidth(),r=t.parent.attribute.height-y.getFrozenRowsHeight()-y.getBottomFrozenRowsHeight();e.beginPath(),e.rect(i,o,n,r)}else if("row-header"===t.role){const i=0,o=-(null!==(f=t.attribute.y)&&void 0!==f?f:0)+y.getFrozenRowsHeight(),n=y.getFrozenColsWidth(),r=t.parent.attribute.height-y.getFrozenRowsHeight()-y.getBottomFrozenRowsHeight();e.beginPath(),e.rect(i,o,n,r)}else if("col-header"===t.role){const i=-(null!==(m=t.attribute.x)&&void 0!==m?m:0)+y.getFrozenColsWidth(),o=0,n=t.parent.attribute.width-y.getFrozenColsWidth()-y.getRightFrozenColsWidth(),r=y.getFrozenRowsHeight();e.beginPath(),e.rect(i,o,n,r)}else if("right-frozen"===t.role){const i=0,o=-(null!==(b=t.attribute.y)&&void 0!==b?b:0)+y.getFrozenRowsHeight(),n=y.getRightFrozenColsWidth(),r=t.parent.attribute.height-y.getFrozenRowsHeight()-y.getBottomFrozenRowsHeight();e.beginPath(),e.rect(i,o,n,r)}else if("bottom-frozen"===t.role){const i=-(null!==(v=t.attribute.x)&&void 0!==v?v:0)+y.getFrozenColsWidth(),o=0,n=t.parent.attribute.width-y.getFrozenColsWidth()-y.getRightFrozenColsWidth(),r=y.getBottomFrozenRowsHeight();e.beginPath(),e.rect(i,o,n,r)}else if("corner-header"===t.role){const t=0,i=0,o=y.getFrozenColsWidth(),n=y.getFrozenRowsHeight();e.beginPath(),e.rect(t,i,o,n)}else if("corner-right-top-header"===t.role){const t=0,i=0,o=y.getRightFrozenColsWidth(),n=y.getFrozenRowsHeight();e.beginPath(),e.rect(t,i,o,n)}else if("corner-right-bottom-header"===t.role){const t=0,i=0,o=y.getRightFrozenColsWidth(),n=y.getBottomFrozenRowsHeight();e.beginPath(),e.rect(t,i,o,n)}else if("corner-left-bottom-header"===t.role){const t=0,i=0,o=y.getFrozenColsWidth(),n=y.getBottomFrozenRowsHeight();e.beginPath(),e.rect(t,i,o,n)}}};_A=gA([y()],_A);let SA=class{constructor(){this.time=Pi.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,o,n,r,s,l,a,h,d,c){t.role}};function AA(t,e,i,o){const n=t.stage.table;if("cell"===t.role){let r=t.col,s=t.row;const l=jw(n,r,s);l&&(r=l.end.col,s=l.end.row),(n&&r===n.colCount-1&&!o||n&&r===n.frozenColCount-1&&n.scrollLeft&&!o)&&(e-=1),(n&&s===n.rowCount-1&&!o||n&&s===n.frozenRowCount-1&&n.scrollTop&&!o)&&(i-=1)}else"corner-frozen"===t.role&&(n&&n.scrollLeft&&!o&&(e-=1),n&&n.scrollTop&&!o&&(i-=1));return{width:e,height:i}}SA=gA([y()],SA);var BA=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s};let RA=class{constructor(){this.time=Pi.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,o,n,r,s,l,a,h,d,c,u){const{stroke:g=a.stroke,strokeArrayWidth:p=a.strokeArrayWidth,strokeArrayColor:f=a.strokeArrayColor}=t.attribute;g&&(Array.isArray(g)||Array.isArray(p)||Array.isArray(f))&&(u.doStroke=!1)}};RA=BA([y()],RA);let MA=class{constructor(){this.time=Pi.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,o,n,r,s,l,a,h,d,c){const{width:u=a.width,height:g=a.height,stroke:p=a.stroke,strokeArrayColor:f=a.strokeArrayColor,strokeArrayWidth:m=a.strokeArrayWidth,lineWidth:b=a.lineWidth,strokeColor:v=a.stroke}=t.attribute;if(p&&(Array.isArray(m)||0!==b)&&(Array.isArray(p)||Array.isArray(f)||Array.isArray(m))){const n=0,r=0;"border-rect"!==t.name&&"table-border-rect"!==t.name&&("number"==typeof b&&1&b||Array.isArray(m)&&m.some((t=>1&t)))&&(i=Math.floor(i)+.5,o=Math.floor(o)+.5),mA(t,e,i,o,a,p,m||b,f||v,Math.ceil(u+n),Math.ceil(g+r))}}};MA=BA([y()],MA);var TA=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s};let kA,PA=class{constructor(){this.order=1,this.interceptors=[new EA]}afterDrawItem(t,e,i,o,n){for(let r=0;r<this.interceptors.length;r++)if(this.interceptors[r].afterDrawItem&&this.interceptors[r].afterDrawItem(t,e,i,o,n))return!0;return!1}beforeDrawItem(t,e,i,o,n){if((!t.in3dMode||i.in3dInterceptor)&&!t.shadowRoot&&!(t.baseGraphic||t.attribute.globalZIndex||t.interactiveGraphic))return!1;for(let r=0;r<this.interceptors.length;r++)if(this.interceptors[r].beforeDrawItem&&this.interceptors[r].beforeDrawItem(t,e,i,o,n))return!0;return!1}};PA=TA([y()],PA);class EA{constructor(){this.order=1}afterDrawItem(t,e,i,o,n){return"image"===t.type&&this.drawItem(t,e,i,o,n),!1}drawItem(t,e,i,o,n){const{image:r}=t.attribute;if(!r||!t.resources)return!1;if("loading"!==t.resources.get(r).state)return!1;if(!kA){const t=__(),e=t.loading_pic.svg,i=t.loading_pic.width,o=t.loading_pic.height;kA=xa({width:i,height:o,image:e})}const{image:s}=kA.attribute;if(!r||!kA.resources)return!1;const l=kA.resources.get(s);if("success"!==l.state)return!1;const{context:a}=i;a.highPerformanceSave(),t.parent&&a.setTransformFromMatrix(t.parent.globalTransMatrix,!0),t.glyphHost&&t.glyphHost.parent&&a.setTransformFromMatrix(t.glyphHost.parent.globalTransMatrix,!0);const h=t.AABBBounds,{width:d,height:c}=A_(l.data.width,l.data.height,h.width(),h.height());return a.drawImage(l.data,h.x1+(h.width()-d)/2,h.y1+(h.height()-c)/2,d,c),a.highPerformanceRestore(),!0}}var LA=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s};let HA=class{constructor(){this.time=Pi.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,o,n,r,s,l,a,h,d,c,u){var g,p;const{text:f,underline:m=a.underline,lineThrough:b=a.lineThrough,direction:v=a.direction,whiteSpace:y=a.whiteSpace,fontSize:C=a.fontSize,verticalMode:w=a.verticalMode,ellipsis:x=a.ellipsis,textAlign:_=a.textAlign,textBaseline:S=a.textBaseline,x:A=a.x,y:B=a.y}=t.attribute;let R=!1;if(Array.isArray(t)){const e=null===(g=t.cache)||void 0===g?void 0:g.layoutData;x&&e&&e.lines.every((t=>""===t.str))&&(R=!0)}else{const{cache:e}=t;x&&e&&""===e.clipedText&&0===e.clipedWidth&&(R=!0)}if(!R)return;const M=nt(x)?x:"...",T=null!==(p=ar(t.attribute.lineHeight,C))&&void 0!==p?p:C;let k=0;T!==C&&("top"===S?k=(T-C)/2:"middle"===S||"bottom"===S&&(k=-(T-C)/2)),r&&(c?c(e,t.attribute,a):l&&(e.setStrokeStyle(t,t.attribute,A-i,B-o,a),e.strokeText(M,A,B+k))),n&&(d?d(e,t.attribute,a):s&&(e.setCommonStyle(t,t.attribute,A-i,B-o,a),e.fillText(M,A,B+k),this.drawUnderLine(m,b,t,A,B+k,0,a,e,M)))}drawUnderLine(t,e,i,o,n,r,s,l,a){if(e+t<=0)return;const{textAlign:h=s.textAlign,textBaseline:d=s.textBaseline,fontSize:c=s.fontSize,fontFamily:u=s.fontFamily,fontWeight:g=s.fontWeight,fontStyle:p=s.fontStyle,fill:f=s.fill,opacity:m=s.opacity,underlineOffset:b=s.underlineOffset,underlineDash:v=s.underlineDash,fillOpacity:y=s.fillOpacity}=i.attribute;if(!t&&!e)return;const C=lS.measureTextWidth(a,{fontSize:c,fontFamily:u,fontWeight:g,fontStyle:p}),w=Js(h,C),x=Qs(d,c,c),_={lineWidth:0,stroke:f,opacity:m,strokeOpacity:y};if(t){_.lineWidth=t,l.setStrokeStyle(i,_,o,n,s),l.setLineDash(v),l.beginPath();const e=n+x+c+b;l.moveTo(o+w,e,r),l.lineTo(o+w+C,e,r),l.stroke()}if(e){_.lineWidth=e,l.setStrokeStyle(i,_,o,n,s),l.beginPath();const t=n+x+c/2;l.moveTo(o+w,t,r),l.lineTo(o+w+C,t,r),l.stroke()}}};HA=LA([y()],HA);var zA=new s(((t,e,i,o)=>{i(Ah)?o(Ah).to(RA).inSingletonScope():(t(RA).toSelf().inSingletonScope(),t(Vs).toService(RA)),i(Bh)?o(Bh).to(MA).inSingletonScope():(t(MA).toSelf().inSingletonScope(),t(Vs).toService(MA)),t(sA).toSelf().inSingletonScope(),t(rA).to(sA),t(Dd).to(sA),t(aA).toSelf().inSingletonScope(),t(Ns).toService(aA),t(hA).toSelf().inSingletonScope(),t(Ns).toService(hA),t(wA).toSelf().inSingletonScope(),t(Ws).toService(wA),t(xA).toSelf().inSingletonScope(),t(Ws).toService(xA),t(fA).toSelf().inSingletonScope(),t(Ws).toService(fA),t(pA).toSelf().inSingletonScope(),t(Ws).toService(pA),t(bA).toSelf().inSingletonScope(),t(Ws).toService(bA),t(vA).toSelf().inSingletonScope(),t(Ws).toService(vA),t(yA).toSelf().inSingletonScope(),t(Ws).toService(yA),t(CA).toSelf().inSingletonScope(),t(Ws).toService(CA),t(_A).toSelf().inSingletonScope(),t(Ws).toService(_A),t(SA).toSelf().inSingletonScope(),t(Ws).toService(SA),t(PA).toSelf().inSingletonScope(),t(Jd).toService(PA),t(HA).toSelf().inSingletonScope(),t($s).toService(HA)}));function FA(t,e,i,o){var n,r,s,l,a,h,d,c;"undefined"!=typeof window&&window.performance.now(),e=null!=e?e:0,i=null!=i?i:t.colCount-1,0===e&&i===t.colCount-1&&t._clearColRangeWidthsMap();const u=t.internalProps.layoutMap;t.isPivotTable()&&(u.enableUseGetBodyCache(),u.enableUseHeaderPathCache());const g=[],p=[];if(o)for(let e=0;e<t.colCount;e++)g[e]=t.getColWidth(e);for(let a=e;a<=i;a++){let e;if(t.internalProps.transpose||"only-header"!==(null===(r=null===(n=t.internalProps.layoutMap.columnObjects)||void 0===n?void 0:n[a])||void 0===r?void 0:r.columnWidthComputeMode)&&"only-header"!==t.columnWidthComputeMode||!("showHeader"in t.internalProps.layoutMap))e=t.internalProps.transpose||"only-body"!==(null===(l=null===(s=t.internalProps.layoutMap.columnObjects)||void 0===s?void 0:s[a])||void 0===l?void 0:l.columnWidthComputeMode)&&"only-body"!==t.columnWidthComputeMode?IA(a,0,t.rowCount-1,t):IA(a,t.internalProps.layoutMap.getBodyRange().start.row,t.internalProps.layoutMap.getBodyRange().end.row,t);else{const i=t.internalProps.layoutMap.showHeader;t.internalProps.layoutMap.showHeader=!0,e=IA(a,0,t.internalProps.layoutMap.headerLevelCount-1,t),t.internalProps.layoutMap.showHeader=i}t._setColContentWidth(a,e),t.getColWidth(a)!==e&&t._clearColRangeWidthsMap(a),o?p[a]=Math.round(t._adjustColWidth(a,e)):t._setColWidth(a,t._adjustColWidth(a,e),!1,!0)}if("adaptive"===t.widthMode){t._clearColRangeWidthsMap();const e=t.tableNoFrameWidth;let i=0,n=0,r=t.colCount;if("only-body"===t.widthAdaptiveMode){for(let e=0;e<t.colCount;e++){const n=o&&null!==(a=p[e])&&void 0!==a?a:t.getColWidth(e);(e<t.rowHeaderLevelCount||t.isPivotChart()&&e>=t.colCount-t.rightFrozenColCount)&&(i+=n)}n=t.rowHeaderLevelCount,r=t.isPivotChart()?t.colCount-t.rightFrozenColCount:t.colCount}GA(e-i,n,r,o,p,t)}else if(t.autoFillWidth){t._clearColRangeWidthsMap();const e=t.tableNoFrameWidth;let i=0,n=0;for(let e=0;e<t.colCount;e++){const r=o&&null!==(h=p[e])&&void 0!==h?h:t.getColWidth(e);(e<t.rowHeaderLevelCount||t.isPivotChart()&&e>=t.colCount-t.rightFrozenColCount)&&(i+=r),n+=r}n<e&&n>i&&GA(e-i,t.rowHeaderLevelCount,t.isPivotChart()?t.colCount-t.rightFrozenColCount:t.colCount,o,p,t)}if(o){for(let e=0;e<t.colCount;e++){const i=null!==(c=null!==(d=p[e])&&void 0!==d?d:t.getColWidth(e))&&void 0!==c?c:t.getColWidth(e);i!==g[e]&&t._setColWidth(e,i,!1,!0)}t.stateManager.checkFrozen();for(let e=0;e<t.colCount;e++){const i=t.getColWidth(e);i!==g[e]&&t.scenegraph.updateColWidth(e,i-g[e],!0,!0)}t.scenegraph.updateContainer(!0)}t.isPivotTable()&&(u.disableUseGetBodyCache(),u.disableUseHeaderPathCache())}function IA(t,e,i,o){let n=arguments.length>4&&void 0!==arguments[4]&&arguments[4],r=function(t,e){const i=e.getColWidthDefined(t);return e.internalProps._widthResizedColMap.has(t)?e.getColWidth(t):i}(t,o);return o.internalProps.transpose&&"auto"===r&&("only-header"===o.columnWidthComputeMode&&t>=o.rowHeaderLevelCount||"only-body"===o.columnWidthComputeMode&&t<o.rowHeaderLevelCount)&&(r=o.getDefaultColumnWidth(t)),n&&!o.internalProps.transpose?OA(r,t,e,i,n,o):"number"==typeof r?r:"auto"!==r&&"string"==typeof r?o._adjustColWidth(t,o._colWidthDefineToPxWidth(r)):OA(r,t,e,i,n,o)}function OA(t,e,i,o,n,r){var s,l,a,h,d;let c=0,u=1,g=1;if(o-i>5e3&&(g=Math.ceil((o-i)/5e3)),r.isPivotChart()&&e>=r.rowHeaderLevelCount&&e<r.colCount-r.rightFrozenColCount){if(r.internalProps.layoutMap.indicatorsAsCol)return r.defaultColWidth;{const t=r.internalProps.layoutMap.getOptimunWidthForChart(e);if(t>0)return t}}for(let p=i;p<=o;p+=u){if(r.isPivotChart()){const t=r.internalProps.layoutMap,i=t.getAxisConfigInPivotChart(e,p);if(i){const t=Vw.getFunction("computeAxisComponentWidth")(i,r);if("number"==typeof t){c=Math.max(t,c);continue}}else if(t.isLeftBottomCorner(e,p)||t.isRightTopCorner(e,p)||t.isRightBottomCorner(e,p))continue}const i=DA(e,p,r);if(i&&(c=Math.max(i.width,c),!i.renderDefault))continue;const o=t;if("number"==typeof o&&"standard"===r.widthMode&&!n){c=Math.max(o,c);continue}const f=r.isHeader(e,p)?null===(s=r._getHeaderLayoutMap(e,p))||void 0===s?void 0:s.headerType:r.getBodyColumnType(e,p);if(Q(f)&&"text"!==f&&"link"!==f&&"progressbar"!==f&&"checkbox"!==f&&"radio"!==f){c=Math.max(c,r.getColWidthDefinedNumber(e)||0);continue}let m=0;const b=r.internalProps.layoutMap;if(b.isHeader(e,p)){const t=b.getHeader(e,p);if("only-body"===(null===(l=null==t?void 0:t.define)||void 0===l?void 0:l.columnWidthComputeMode))continue;Q(null==t?void 0:t.hierarchyLevel)&&(m=(null!==(a=t.hierarchyLevel)&&void 0!==a?a:0)*(null!==(h=b.rowHierarchyIndent)&&void 0!==h?h:0),b.rowHierarchyTextStartAlignment&&!r.internalProps.headerHelper.getHierarchyIcon(e,p)&&(m+=r.internalProps.headerHelper.getHierarchyIconWidth()))}else if(r.isListTable()){u=g;const t=r.getBodyColumnDefine(e,p);if(null==t?void 0:t.tree){const t=r.dataSource.getIndexKey(r.getRecordShowIndexByCell(e,p));m=Array.isArray(t)&&r.getHierarchyState(e,p)!==Jy.none?(t.length-1)*(null!==(d=b.hierarchyIndent)&&void 0!==d?d:0):0,b.hierarchyTextStartAlignment&&!r.internalProps.bodyHelper.getHierarchyIcon(e,p)&&(m+=r.internalProps.headerHelper.getHierarchyIconWidth())}}const v=WA(e,p,f,r);c=Math.max(v+m,c),u>1&&r.bottomFrozenRowCount>0&&p<r.rowCount-r.bottomFrozenRowCount&&p+u>=r.rowCount-r.bottomFrozenRowCount&&(p=r.rowCount-r.bottomFrozenRowCount-u,u=1,g=1)}const p=r.getMinColWidth(e),f=r.getMaxColWidth(e);return c<p?p:c>f?f:(c<=0&&(c=r.defaultColWidth),c)}function DA(t,e,i){var o,n,r,s;const l=i.getCustomRender(t,e),a=i.getCustomLayout(t,e);if(l||a){let h=1,d=0,c=!1,u=!1;if(i.isHeader(t,e)||(null===(o=i.getBodyColumnDefine(t,e))||void 0===o?void 0:o.mergeCell)||i.hasCustomMerge()){const o=i.getCellRange(t,e);h=o.end.col-o.start.col+1}const g={col:t,row:e,dataValue:i.getCellOriginValue(t,e),value:i.getCellValue(t,e)||"",rect:NA(t,e,i),table:i};if(Z(a)){const t=a(g);if(t.rootContainer instanceof cs){t.rootContainer=b_(t.rootContainer),m_(t.rootContainer,0,i.getRowHeight(e));const o=t.rootContainer.attribute.width;t.rootContainer.setStage(i.scenegraph.stage),d=o>0?o:null!==(n=t.rootContainer.AABBBounds.width())&&void 0!==n?n:0,c=t.renderDefault,u=t.enableCellPadding}else d=0,c=t.renderDefault,u=t.enableCellPadding}else if("function"==typeof l){const t=l(g);d=null!==(r=null==t?void 0:t.expectedWidth)&&void 0!==r?r:0,c=null==t?void 0:t.renderDefault}else d=null!==(s=null==l?void 0:l.expectedWidth)&&void 0!==s?s:0,c=null==l?void 0:l.renderDefault;if(d=Math.ceil(d),u){const o=vx(R_("padding",i._getCellStyle(t,e),t,e,i));d+=o[1]+o[3]}return{width:d/h,renderDefault:c}}}function WA(t,e,i,o){var n,r,s;let l=0;const a=o.getCellValue(t,e),h=o._getCellStyle(t,e);let d=0,c=!1;if("body"!==o.getCellLocation(t,e))c=!0;else{const i=o.getBodyColumnDefine(t,e);c=!!(null==i?void 0:i.icon)||!!(null==i?void 0:i.tree)||(null==i?void 0:i.dragOrder)}if(c){const i=o.getCellIcons(t,e);null==i||i.forEach((t=>{var e,i,o;t.positionType!==eC.absoluteRight&&(d+=(null!==(e=t.width)&&void 0!==e?e:0)+(null!==(i=t.marginLeft)&&void 0!==i?i:0)+(null!==(o=t.marginRight)&&void 0!==o?o:0))}))}let u=1;if(o.isHeader(t,e)||(null===(n=o.getBodyColumnDefine(t,e))||void 0===n?void 0:n.mergeCell)||o.hasCustomMerge()){const i=o.getCellRange(t,e);u=i.end.col-i.start.col+1}const g=vx(R_("padding",h,t,e,o)),p=g[1]+g[3],f=R_("fontSize",h,t,e,o),m=R_("fontFamily",h,t,e,o),b=R_("fontWeight",h,t,e,o);let v;if("checkbox"===i)v=tt(a)?a.text:a;else if("radio"===i)if(rt(a)){v="";const i=o.getBodyColumnDefine(t,e),n=null!==(r=null==i?void 0:i.radioDirectionInCell)&&void 0!==r?r:"vertical";"vertical"===n?a.forEach((t=>{v+=(tt(t)?t.text:t).toString()+"\n"})):"horizontal"===n&&a.forEach((t=>{v+=(tt(t)?t.text:t).toString()}))}else v=tt(a)?a.text:a;else v=a;const y=E_(v,o).text;if(y.length>=1&&(1!==y.length||""!==y[0])?y.forEach((t=>{const e=o.measureText(t,{fontSize:f,fontFamily:m,fontWeight:b}).width;l=Math.max((e+p+4+d)/u,l)})):l=Math.max((p+4+d)/u,l),!1!==o.internalProps.limitMaxAutoWidth&&(l=Math.min("number"==typeof o.internalProps.limitMaxAutoWidth?o.internalProps.limitMaxAutoWidth:450,l)),"checkbox"===i){const i=R_("size",h,t,e,o);if(l+=i,v){const i=R_("spaceBetweenTextAndIcon",h,t,e,o);l+=i}}else if("radio"===i){const i=R_("size",h,t,e,o),n=R_("outerRadius",h,t,e,o),r=at(n)?2*n:i,d=R_("spaceBetweenTextAndIcon",h,t,e,o);if(rt(a)){const i=o.getBodyColumnDefine(t,e),n=R_("spaceBetweenRadio",h,t,e,o),c=null!==(s=null==i?void 0:i.radioDirectionInCell)&&void 0!==s?s:"vertical";"vertical"===c?(l+=r,l+=d):"horizontal"===c&&(l+=(r+d)*a.length,l+=n*(a.length-1))}else l+=r,v&&(l+=d)}return l}function NA(t,e,i){return{left:0,top:0,right:i.getColWidth(t),bottom:i.getRowHeight(e),width:null,height:null}}function GA(t,e,i,o,n,r,s){var l,a,h,d;let c=0;const u=[],g=[];let p=0;for(let s=e;s<i;s++){const e=o&&null!==(l=n[s])&&void 0!==l?l:r.getColWidth(s),i=r.getMaxColWidth(s),h=r.getMinColWidth(s);e!==i&&e!==h?(c+=e,u.push(s)):t-=e,(null===(a=r.options.customConfig)||void 0===a?void 0:a.shrinkSparklineFirst)&&"sparkline"===r.getBodyColumnType(s,0)&&(g.push({col:s,width:e}),p+=e-r.defaultColWidth)}const f=t/c;if((null===(h=r.options.customConfig)||void 0===h?void 0:h.shrinkSparklineFirst)&&f<1&&c-t<p)for(let e=0;e<g.length;e++){const{col:i,width:l}=g[e],a=(c-t)/g.length,h=Math.floor(l-a);o?n[i]=r._adjustColWidth(i,h):s?r.scenegraph.setColWidth(i,r._adjustColWidth(i,h)):r._setColWidth(i,r._adjustColWidth(i,h),!1,!0)}else for(let e=0;e<u.length;e++){const i=u[e];let l;l=e===u.length-1?t-u.reduce(((t,e,s)=>{var l;return e!==i?t+(o?null!==(l=n[e])&&void 0!==l?l:r.getColWidth(i):r.getColWidth(e)):t}),0):Math.round((o&&null!==(d=n[i])&&void 0!==d?d:r.getColWidth(i))*f),o?n[i]=r._adjustColWidth(i,l):s?r.scenegraph.setColWidth(i,r._adjustColWidth(i,l)):r._setColWidth(i,r._adjustColWidth(i,l),!1,!0)}}const jA=new S_({});function VA(t,e,i,o,n,r,s,l,a,h){let d,c,u,g=0;t.lastChild&&t.lastChild.row===o-1?g=t.lastChild.attribute.y+t.lastChild.attribute.height:t.colHeight&&(g=t.colHeight);for(let p=o;p<=n;p++){const n=p;let f,m,b,v,y=l.getCellValue(e,n),C=i,w=l.getRowHeight(n);if(l.internalProps.customMergeCell){const t=l.getCustomMerge(e,n);if(t){const{range:e,text:i,style:s,customLayout:a,customRender:h}=t;if(f=e,m=f.start.col!==f.end.col||f.start.row!==f.end.row,m){const t=UA(f,r,l,o>f.start.row);C=t.cellWidth,w=t.cellHeight}y=i,b=s,(a||h)&&(v=p_(a,h,e.start.col,e.start.row,l.getColsWidth(e.start.col,e.end.col),l.getRowsHeight(e.start.row,e.end.row),!1,l.isAutoRowHeight(n),[0,0,0,0],f,l))}}let x=e,_=n;f&&(x=f.start.col,_=f.start.row);const S="body"!==a?l.getHeaderDefine(x,_):l.getBodyColumnDefine(x,_),A="body"!==a||(null==S?void 0:S.dragOrder)||!!(null==S?void 0:S.icon)||!!(null==S?void 0:S.tree);if(!f&&("body"!==a||(null==S?void 0:S.mergeCell))&&(f=l.getCellRange(e,n),m=f.start.col!==f.end.col||f.start.row!==f.end.row,m)){const t=UA(f,r,l,o>f.start.row);C=t.cellWidth,w=t.cellHeight}const B=e_(b||l._getCellStyle(e,n),l,f?f.start.col:e,f?f.start.row:n,R_).theme;B.group.cornerRadius=o_(e,n,l),B.group.width=i,B.group.height=Array.isArray(s)?s[n]:s,B._vtable.padding&&(d=B._vtable.padding),B.text.textAlign&&(c=B.text.textAlign),B.text.textBaseline&&(u=B.text.textBaseline),"body"===a||B.group.fill||(B.group.fill="#fff");const R=(l.isHeader(e,n)?l._getHeaderLayoutMap(e,n).headerType:l.getBodyColumnType(e,n))||"text";if(tw(y)){$A(e,n,0,g,C,w,t),U_(y,l,$_.bind(null,R,y,S,l,e,n,i,C,w,t,g,d,c,u,A,B,f,v)),t.updateColumnRowNumber(n);const o=l.getRowHeight(n);t.updateColumnHeight(o),g+=o}else{const o=$_(R,y,S,l,e,n,i,C,w,t,g,d,c,u,A,B,f,v);if(t.updateColumnRowNumber(n),m){const i=l.getRowHeight(n),{width:r}=(l.getColWidth(e),o.attribute),{height:s}=o.attribute;o.contentWidth=r,o.contentHeight=s,K_(f,r,s,d,c,u,l),t.updateColumnHeight(i),g+=i}else t.updateColumnHeight(w),g+=w}if(h&&n>h)break}return t.setAttribute("width",i),{width:i,height:g}}function UA(t,e,i,o){let n=0,r=0;const s=e.get(`${t.start.col},${t.start.row};${t.end.col},${t.end.row}`);if(!s||o){for(let e=t.start.col;e<=t.end.col;e++)n+=i.getColWidth(e);for(let e=t.start.row;e<=t.end.row;e++)r+=i.getRowHeight(e);e.set(`${t.start.col},${t.start.row};${t.end.col},${t.end.row}`,{cellWidth:n,cellHeight:r})}else n=s.cellWidth,r=s.cellHeight;return{cellWidth:n,cellHeight:r}}function $A(t,e,i,o,n,r,s){const l=new S_({x:i,y:o,width:n,height:r});l.role="cell",l.col=t,l.row=e,s.addChild(l)}function XA(t,e,i,o,n,r,s,l,a,h){if(o>n||r>s)return;const{layoutMap:d,defaultRowHeight:c,defaultHeaderRowHeight:u,defaultColWidth:g}=a.internalProps;let p=0,f=0;for(let d=o;d<=n;d++){const o=d,n=a.getColWidth(o),g=new S_({x:e+p,y:i,width:n,height:0,clip:!1,pickable:!1});g.role="column",g.col=d,t.addChild(g);const{width:m,height:b}=VA(g,o,n,r,s,a.scenegraph.mergeMap,"columnHeader"===l&&at(u)?u:c,a,l,h);p+=m,f=Math.max(f,b)}t.setAttribute("width",p),t.setAttribute("height",f)}function YA(t){let e=t.firstChild;for(;"group"!==e.type;)e=e._next;return e}function KA(t){let e=t.lastChild;for(;"group"!==e.type;)e=e._prev;return e}function qA(t,e,i){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"left";for(let n=t;n<=e;n++){const t=i.scenegraph.getColGroup(n);t&&ZA(t,i,o);const e=i.scenegraph.getColGroup(n,!0);e&&ZA(e,i,o);const r=i.scenegraph.getColGroupInBottom(n);r&&ZA(r,i,o)}const n=Math.min(i.scenegraph.proxy.colLimit,i.scenegraph.proxy.bodyRightCol-i.scenegraph.proxy.bodyLeftCol+1),r=i.getColsWidth(i.frozenColCount,i.frozenColCount+n),s=i.getColsWidth(i.frozenColCount,i.colCount-1);i.scenegraph.proxy.xLimitLeft=r/2,i.scenegraph.proxy.xLimitRight=s-r/2}function ZA(t,e){if("left"===(arguments.length>2&&void 0!==arguments[2]?arguments[2]:"left")){let i;const o=function(t){let e=t._prev;for(;e&&"group"!==e.type;)e=e._prev;return e}(t);i=o?o.attribute.x+e.getColWidth(t._prev.col):e.getColsWidth(e.frozenColCount,t.col-1),t.setAttribute("x",i)}else{let i;const o=function(t){let e=t._next;for(;e&&"group"!==e.type;)e=e._next;return e}(t);i=o?o.attribute.x-e.getColWidth(t.col):e.getColsWidth(e.frozenColCount,t.col-1),t.setAttribute("x",i)}}jA.role="empty";var JA=function(t,e,i,o){return new(i||(i=Promise))((function(n,r){function s(t){try{a(o.next(t))}catch(t){r(t)}}function l(t){try{a(o.throw(t))}catch(t){r(t)}}function a(t){var e;t.done?n(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(s,l)}a((o=o.apply(t,e||[])).next())}))};function QA(t,e,i,o){return JA(this,void 0,void 0,(function*(){if(!e)return;const n=e.col,r=e.left;let s;if(s=i?o.bodyRightCol-o.colEnd:o.screenLeftCol-o.referenceCol,function(t,e,i,o,n){t>0?(tB(t,"left",n.screenLeftCol,i,o,n),n.updateDeltaX(o,i,e),n.table.scenegraph.setBodyAndColHeaderX(-o+n.deltaX)):t<0?(tB(-t,"right",n.screenLeftCol,i,o,n),n.updateDeltaX(o,i,e),n.table.scenegraph.setBodyAndColHeaderX(-o+n.deltaX)):(n.updateDeltaX(o,i,e),n.table.scenegraph.setBodyAndColHeaderX(-o+n.deltaX))}(s,n,r,t,o),i){const e=o.table.scenegraph.getColGroup(o.colEnd);if(e){const i=e.attribute.x+e.attribute.width-(o.table.tableNoFrameWidth-o.table.getFrozenColsWidth()-o.table.getRightFrozenColsWidth())-t;o.deltaX=-i,o.table.scenegraph.setBodyAndColHeaderX(-t+o.deltaX)}}o.table.scenegraph.updateNextFrame()}))}function tB(t,e,i,o,n,r){return JA(this,void 0,void 0,(function*(){if("left"===e&&r.colEnd+t>r.bodyRightCol?t=r.bodyRightCol-r.colEnd:"right"===e&&r.colStart-t<r.bodyLeftCol&&(t=r.colStart-r.bodyLeftCol),0!==t)if(t<0&&(e="left"===e?"right":"left",t=-t),t<r.colEnd-r.colStart){const n="left"===e?r.colStart:r.colEnd-t+1,s="left"===e?r.colStart+t-1:r.colEnd,l="left"===e?r.colEnd+1:r.colStart-t,a="left"===e?r.colEnd+t:r.colStart-1;FA(r.table,l,a),function(t,e,i,o){for(let n=t;n<=e;n++)o.table.scenegraph.bodyGroup.childrenCount>0&&"group"===o.table.scenegraph.bodyGroup.firstChild.type&&nB(o.table.scenegraph.bodyGroup,i,o),o.table.scenegraph.colHeaderGroup.childrenCount>0&&"group"===o.table.scenegraph.colHeaderGroup.firstChild.type&&nB(o.table.scenegraph.colHeaderGroup,i,o),o.table.scenegraph.bottomFrozenGroup.childrenCount>0&&"group"===o.table.scenegraph.bottomFrozenGroup.firstChild.type&&nB(o.table.scenegraph.bottomFrozenGroup,i,o)}(n,s,e,r);const h=l,d=a;r.colStart="left"===e?r.colStart+t:r.colStart-t,r.colEnd="left"===e?r.colEnd+t:r.colEnd-t,rB(h,d,r),qA(h,d,r.table,e);const c=r.table.scenegraph.getColGroup(i)||r.table.scenegraph.getColGroup(i,!0),u=o-(c.attribute.x+r.table.getFrozenColsWidth()+r.table.scenegraph.proxy.deltaX);r.table.scenegraph.proxy.deltaX+=u,r.currentCol="left"===e?r.currentCol+t:r.currentCol-t,r.totalCol=Math.max(0,Math.min(r.table.colCount-1,"left"===e?r.totalCol+t:r.totalCol-t)),r.referenceCol=r.colStart+Math.floor((r.colEnd-r.colStart)/2),r.colUpdatePos=l,r.colUpdateDirection=e,r.table.scenegraph.updateNextFrame()}else{const i="left"===e?r.colStart+t:r.colStart-t,o="left"===e?r.colEnd+t:r.colEnd-t;FA(r.table,i,o),function(t,e,i,o){o.table.scenegraph.colHeaderGroup.forEachChildren(((n,r)=>{"group"===n.type&&eB(n,"left"===i?n.col+e:n.col-e,0===r?t:n._prev.attribute.x+o.table.getColWidth(n._prev.col))})),o.table.scenegraph.bottomFrozenGroup.forEachChildren(((n,r)=>{"group"===n.type&&eB(n,"left"===i?n.col+e:n.col-e,0===r?t:n._prev.attribute.x+o.table.getColWidth(n._prev.col))})),o.table.scenegraph.bodyGroup.forEachChildren(((n,r)=>{"group"===n.type&&eB(n,"left"===i?n.col+e:n.col-e,0===r?t:n._prev.attribute.x+o.table.getColWidth(n._prev.col))}))}(r.table.getColsWidth(r.bodyLeftCol,i-1),t,e,r);const n=i,s=o;r.colStart=i,r.colEnd=o,rB(n,s,r),qA(n,s,r.table,o>r.bodyRightCol-(r.colEnd-r.colStart+1)?"right":"left"),r.currentCol="left"===e?r.currentCol+t:r.currentCol-t,r.totalCol=Math.max(0,Math.min(r.table.colCount-1,"left"===e?r.totalCol+t:r.totalCol-t)),r.referenceCol=r.colStart+Math.floor((r.colEnd-r.colStart)/2),r.colUpdatePos=r.colStart,r.colUpdateDirection=o>r.bodyRightCol-(r.colEnd-r.colStart+1)?"right":"left",r.table.scenegraph.updateNextFrame()}}))}function eB(t,e,i){t.col=e,t.forEachChildren((t=>{t.col=e,t.needUpdate=!0})),t.setAttribute("x",i),t.needUpdate=!0}function iB(t,e){if(!t)return;let i=t.firstChild;for(;i;)i=e.updateCellGroupContent(i)._next;t.needUpdate=!1,t.setAttribute("width",e.table.getColWidth(t.col))}function oB(t,e){if(!t)return;const i=e.screenTopRow,o=Math.max(e.bodyTopRow,i-1*e.screenRowCount),n=Math.min(e.bodyBottomRow,i+2*e.screenRowCount);for(let i=o;i<=n;i++){const o=e.highPerformanceGetCell(t.col,i,!0);e.updateCellGroupContent(o)}e.rowUpdatePos=e.rowStart,t.needUpdate=!1,t.setAttribute("width",e.table.getColWidth(t.col))}function nB(t,e,i){if("left"===e){const e=YA(t),o=KA(t);eB(e,o.col+1,o.attribute.x+i.table.getColWidth(o.col)),t.appendChild(e),t.border&&t.appendChild(t.border)}else{const e=KA(t),o=YA(t);eB(e,o.col-1,o.attribute.x-i.table.getColWidth(o.col-1)),t.insertBefore(e,t.firstChild)}}function rB(t,e,i){for(let o=t;o<=e;o++){const t=i.table.scenegraph.getColGroup(o,!0);t&&iB(t,i);const e=i.table.scenegraph.getColGroupInBottom(o);e&&iB(e,i);const n=i.table.scenegraph.getColGroupInRightTopCorner(o);n&&iB(n,i);const r=i.table.scenegraph.getColGroupInRightBottomCorner(o);r&&iB(r,i);const s=i.table.scenegraph.getColGroup(o);s&&oB(s,i)}i.progress()}function sB(t,e,i,o,n){let r=arguments.length>6?arguments[6]:void 0;var s,l;if("up"===(arguments.length>5&&void 0!==arguments[5]?arguments[5]:"up"))for(let l=t;l<=e;l++)for(let t=i;t<=o;t++){const e=n.scenegraph.highPerformanceGetCell(l,t,!0);if("cell"!==e.role||!e.row)continue;let i;if(e._prev)i=(null===(s=e._prev)||void 0===s?void 0:s.attribute.y)+n.getRowHeight(e._prev.row);else if(r){if(i=n.scenegraph.highPerformanceGetCell(l,o+1,!0).attribute.y,Q(i))for(let e=t;e<=o;e++)i-=n.getRowHeight(e)}else i=n.getRowsHeight(n.frozenRowCount,e.row-1);Q(i)&&e.setAttribute("y",i)}else for(let s=t;s<=e;s++)for(let t=o;t>=i;t--){const e=n.scenegraph.highPerformanceGetCell(s,t,!0);if("cell"!==e.role||!e.row)continue;let o;if(e._next)o=(null===(l=e._next)||void 0===l?void 0:l.attribute.y)-n.getRowHeight(e.row);else if(r){o=n.scenegraph.highPerformanceGetCell(s,i-1,!0).attribute.y;for(let e=i-1;e<t;e++)o+=n.getRowHeight(e)}else o=n.getRowsHeight(n.frozenRowCount,e.row-1);Q(o)&&e.setAttribute("y",o)}const a=Math.min(n.scenegraph.proxy.rowLimit,n.scenegraph.proxy.bodyBottomRow-n.scenegraph.proxy.bodyTopRow+1),h=n.getRowsHeight(n.frozenRowCount,n.frozenRowCount+a),d=n.getRowsHeight(n.frozenRowCount,n.rowCount-1);n.scenegraph.proxy.yLimitTop=h/2,n.scenegraph.proxy.yLimitBottom=d-h/2}var lB=function(t,e,i,o){return new(i||(i=Promise))((function(n,r){function s(t){try{a(o.next(t))}catch(t){r(t)}}function l(t){try{a(o.throw(t))}catch(t){r(t)}}function a(t){var e;t.done?n(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(s,l)}a((o=o.apply(t,e||[])).next())}))};function aB(t,e,i,o){return lB(this,void 0,void 0,(function*(){if(!e)return;const n=e.row,r=e.top;let s;if(s=i?o.bodyBottomRow-o.rowEnd:n-o.referenceRow,function(t,e,i,o,n){t>0?(hB(t,"up",e,i,o,n),n.updateDeltaY(o,i,e),n.updateBody(o-n.deltaY)):t<0?(hB(-t,"down",e,i,o,n),n.updateDeltaY(o,i,e),n.updateBody(o-n.deltaY)):(n.updateDeltaY(o,i,e),n.updateBody(o-n.deltaY))}(s,n,r,t,o),i){const e=o.table.scenegraph.highPerformanceGetCell(o.colStart,o.rowEnd,!0);if("cell"===e.role){const i=e.attribute.y+e.attribute.height-(o.table.tableNoFrameHeight-o.table.getFrozenRowsHeight()-o.table.getBottomFrozenRowsHeight())-t;o.deltaY=-i,o.updateBody(t-o.deltaY)}}}))}function hB(t,e,i,o,n,r){return lB(this,void 0,void 0,(function*(){if("up"===e&&r.rowEnd+t>r.bodyBottomRow?t=r.bodyBottomRow-r.rowEnd:"down"===e&&r.rowStart-t<r.bodyTopRow&&(t=r.rowStart-r.bodyTopRow),0!==t)if(t<0&&(e="up"===e?"down":"up",t=-t),t<r.rowEnd-r.rowStart){const o="up"===e?r.rowStart:r.rowEnd-t+1,n="up"===e?r.rowStart+t-1:r.rowEnd,s="up"===e?r.rowEnd+1:r.rowStart-t,l="up"===e?r.rowEnd+t:r.rowStart-1;let a,h;"autoHeight"===r.table.heightMode?(a=s,h=l):(a=Math.max(r.bodyTopRow,i-1*r.screenRowCount),h=Math.min(r.bodyBottomRow,i+2*r.screenRowCount)),cS(r.table,a,h,!1),function(t,e,i,o){for(let n=0;n<o.table.frozenColCount;n++){const r=o.table.scenegraph.getColGroup(n);if(r)for(let n=t;n<=e;n++)dB(r,i,o)}for(let n=o.table.colCount-o.table.rightFrozenColCount;n<o.table.colCount;n++){const r=o.table.scenegraph.getColGroup(n);if(r)for(let n=t;n<=e;n++)dB(r,i,o)}for(let n=o.bodyLeftCol;n<=o.bodyRightCol;n++){const r=o.table.scenegraph.getColGroup(n);if(r)for(let n=t;n<=e;n++)dB(r,i,o)}}(o,n,e,r),r.rowStart="up"===e?r.rowStart+t:r.rowStart-t,r.rowEnd="up"===e?r.rowEnd+t:r.rowEnd-t;const d=cB(a,h,r,!0);"autoHeight"===r.table.heightMode&&(sB(r.bodyLeftCol,r.bodyRightCol,a,h,r.table,l>r.bodyBottomRow-(r.rowEnd-r.rowStart+1)?"down":"up",!0),sB(0,r.table.frozenColCount-1,a,h,r.table,l>r.bodyBottomRow-(r.rowEnd-r.rowStart+1)?"down":"up",!0),sB(r.table.colCount-r.table.rightFrozenColCount,r.table.colCount-1,a,h,r.table,l>r.bodyBottomRow-(r.rowEnd-r.rowStart+1)?"down":"up",!0)),r.currentRow="up"===e?r.currentRow+t:r.currentRow-t,r.totalRow=Math.max(0,Math.min(r.bodyBottomRow,"up"===e?r.totalRow+t:r.totalRow-t)),r.referenceRow=r.rowStart+Math.floor((r.rowEnd-r.rowStart)/2),"autoHeight"===r.table.heightMode&&d?r.rowUpdatePos=Math.min(r.rowUpdatePos,r.rowEnd+1):r.rowUpdatePos=Math.min(r.rowUpdatePos,s),r.rowUpdateDirection=e,r.table.scenegraph.updateNextFrame(),yield r.progress()}else{const o="up"===e?r.rowStart+t:r.rowStart-t,n="up"===e?r.rowEnd+t:r.rowEnd-t,s=r.table.getRowsHeight(r.bodyTopRow,o-1);let l,a;"autoHeight"===r.table.heightMode?(l=o,a=n):(l=Math.max(r.bodyTopRow,i-1*r.screenRowCount),a=Math.min(r.bodyBottomRow,i+2*r.screenRowCount)),cS(r.table,l,a,!1),function(t,e,i,o){for(let n=0;n<o.table.frozenColCount;n++){const r=o.table.scenegraph.getColGroup(n);null==r||r.forEachChildren(((n,r)=>{o.updateCellGroupPosition(n,"up"===i?n.row+e:n.row-e,0===r?t:n._prev.attribute.y+o.table.getRowHeight(n._prev.row))}))}for(let n=o.table.colCount-o.table.rightFrozenColCount;n<o.table.colCount;n++){const r=o.table.scenegraph.getColGroup(n);null==r||r.forEachChildren(((n,r)=>{o.updateCellGroupPosition(n,"up"===i?n.row+e:n.row-e,0===r?t:n._prev.attribute.y+o.table.getRowHeight(n._prev.row))}))}for(let n=o.bodyLeftCol;n<=o.bodyRightCol;n++){const r=o.table.scenegraph.getColGroup(n);null==r||r.forEachChildren(((n,r)=>{o.updateCellGroupPosition(n,"up"===i?n.row+e:n.row-e,0===r?t:n._prev.attribute.y+o.table.getRowHeight(n._prev.row))}))}}(s,t,e,r),r.rowStart=o,r.rowEnd=n;const h=cB(l,a,r,!0);"autoHeight"===r.table.heightMode&&(sB(r.bodyLeftCol,r.bodyRightCol,l,a,r.table,n>r.bodyBottomRow-(r.rowEnd-r.rowStart+1)?"down":"up"),sB(0,r.table.frozenColCount-1,l,a,r.table,n>r.bodyBottomRow-(r.rowEnd-r.rowStart+1)?"down":"up"),sB(r.table.colCount-r.table.rightFrozenColCount,r.table.colCount-1,l,a,r.table,n>r.bodyBottomRow-(r.rowEnd-r.rowStart+1)?"down":"up")),r.currentRow="up"===e?r.currentRow+t:r.currentRow-t,r.totalRow=Math.max(0,Math.min(r.bodyBottomRow,"up"===e?r.totalRow+t:r.totalRow-t)),r.referenceRow=r.rowStart+Math.floor((r.rowEnd-r.rowStart)/2),"autoHeight"===r.table.heightMode&&h?r.rowUpdatePos=r.rowEnd+1:r.rowUpdatePos=r.rowStart,r.rowUpdateDirection=n>r.bodyBottomRow-(r.rowEnd-r.rowStart+1)?"down":"up",r.table.scenegraph.updateNextFrame(),yield r.progress()}}))}function dB(t,e,i){if(t.childrenCount>=1)if("up"===e){const e=t.firstChild;i.updateCellGroupPosition(e,t.lastChild.row+1,t.lastChild.attribute.y+i.table.getRowHeight(t.lastChild.row)),t.appendChild(e)}else{const e=t.lastChild;i.updateCellGroupPosition(e,t.firstChild.row-1,t.firstChild.attribute.y-i.table.getRowHeight(e.row)),t.insertBefore(e,t.firstChild)}}function cB(t,e,i){let o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];for(let o=0;o<i.table.frozenColCount;o++)for(let n=t;n<=e;n++){const t=i.highPerformanceGetCell(o,n,!0);i.updateCellGroupContent(t)}for(let o=i.table.colCount-i.table.rightFrozenColCount;o<i.table.colCount;o++)for(let n=t;n<=e;n++){const t=i.highPerformanceGetCell(o,n);i.updateCellGroupContent(t)}let n=i.bodyLeftCol,r=i.bodyRightCol,s=!0;if(o){const t=i.screenLeftCol;n=Math.max(i.bodyLeftCol,t-1*i.screenColCount),r=Math.min(i.bodyRightCol,t+2*i.screenColCount),n===i.bodyLeftCol&&r===i.bodyRightCol||(s=!1)}for(let o=n;o<=r;o++)for(let n=t;n<=e;n++){const t=i.highPerformanceGetCell(o,n);i.updateCellGroupContent(t)}return i.table.scenegraph.updateNextFrame(),s}var uB=function(t,e,i,o){return new(i||(i=Promise))((function(n,r){function s(t){try{a(o.next(t))}catch(t){r(t)}}function l(t){try{a(o.throw(t))}catch(t){r(t)}}function a(t){var e;t.done?n(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(s,l)}a((o=o.apply(t,e||[])).next())}))};var gB=function(t,e,i,o){return new(i||(i=Promise))((function(n,r){function s(t){try{a(o.next(t))}catch(t){r(t)}}function l(t){try{a(o.throw(t))}catch(t){r(t)}}function a(t){var e;t.done?n(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(s,l)}a((o=o.apply(t,e||[])).next())}))};function pB(t){const{changedCells:e}=t.internalProps.stick;e.forEach((e=>{t.scenegraph.getCell(e.col,e.row).forEachChildren((t=>{t.setAttributes({dx:e.dx,dy:e.dy})}))})),e.clear();const{scrollTop:i,scrollLeft:o,frozenRowCount:n,frozenColCount:r}=t,s=t.getFrozenRowsHeight(),l=t.getFrozenColsWidth(),{row:a}=t.getRowAt(i+s+1),{col:h}=t.getColAt(o+l+1),d=Math.max(a,t.frozenRowCount),c=Math.max(h,t.frozenColCount),u=t.getAllRowsHeight()>t.tableNoFrameHeight?t.getRowAt(i+t.tableNoFrameHeight-t.getBottomFrozenRowsHeight()-1).row:t.rowCount-t.bottomFrozenRowCount-1,g=t.getAllColsWidth()>t.tableNoFrameWidth?t.getColAt(o+t.tableNoFrameWidth-t.getRightFrozenColsWidth()-1).col:t.colCount-t.rightFrozenColCount-1;if(!(g<0||u<0)){for(let i=0;i<n&&!(g<c);i++)[c,g].forEach((o=>{const n=t._getCellStyle(o,i);(null==n?void 0:n.textStick)&&bB(t.scenegraph.getCell(o,i),l+t.tableX,t.tableNoFrameWidth-t.getRightFrozenColsWidth()+t.tableX,e,null==n?void 0:n.textStickBaseOnAlign,t)}));for(let i=0;i<r&&!(u<d);i++)[d,u].forEach((o=>{const n=t._getCellStyle(i,o);(null==n?void 0:n.textStick)&&"tree"!==t.internalProps.layoutMap.rowHierarchyType&&fB(t.scenegraph.getCell(i,o),s+t.tableY,t.tableNoFrameHeight-t.getBottomFrozenRowsHeight()+t.tableY,e,null==n?void 0:n.textStickBaseOnAlign,t)}));for(let i=c;i<=g&&!(u<d);i++)[d,u].forEach((o=>{const n=t._getCellStyle(i,o);(null==n?void 0:n.textStick)&&fB(t.scenegraph.getCell(i,o),s+t.tableY,t.tableNoFrameHeight-t.getBottomFrozenRowsHeight()+t.tableY,e,null==n?void 0:n.textStickBaseOnAlign,t)}));for(let i=d;i<u&&!(g<c);i++)[c,g].forEach((o=>{var n;const r=t._getCellStyle(o,i);(null===(n=t._getCellStyle(o,i))||void 0===n?void 0:n.textStick)&&bB(t.scenegraph.getCell(o,i),l+t.tableX,t.tableNoFrameWidth-t.getRightFrozenColsWidth()+t.tableX,e,null==r?void 0:r.textStickBaseOnAlign,t)}))}}function fB(t,e,i,o,n,r){if(at(t.mergeStartCol)&&at(t.mergeStartRow)&&at(t.mergeEndCol)&&at(t.mergeEndRow)){const{colStart:s,colEnd:l,rowStart:a,rowEnd:h}=vS(t,r.scenegraph);for(let t=s;t<=l;t++)for(let s=a;s<=h;s++)mB(r.scenegraph.getCell(t,s),e,i,o,n)}else mB(t,e,i,o,n)}function mB(t,e,i,o,n){var r,s,l,a,h,d,c,u,g,p,f,m,b,v,y,C,w;const x=t.getChildByName("text",!0)||t.getChildByName("image",!0);if(!x)return;if("image"===x.type){const{image:t}=x.attribute;if(!t||!x.resources)return;if("success"!==x.resources.get(t).state)return}const _=null!==(r=x.textBaseline)&&void 0!==r?r:"top";x.AABBBounds.width();const S=x.globalAABBBounds.y1,A=x.globalAABBBounds.y2;if("middle"===_&&n){const n=t.globalAABBBounds.y1+(null!==(l=null===(s=t.firstChild)||void 0===s?void 0:s.attribute.dy)&&void 0!==l?l:0),r=n+(null!==(h=null!==(a=t.contentHeight)&&void 0!==a?a:t.attribute.height)&&void 0!==h?h:0);if(n<e||r>i){const s=Math.max(n,e),l=Math.min(r,i),a=x.globalTransMatrix.f-(l+s)/2+x.AABBBounds.height()/2;!o.has(`${t.col}-${t.row}`)&&o.set(`${t.col}-${t.row}`,{col:t.col,row:t.row,dx:null!==(c=null===(d=t.firstChild)||void 0===d?void 0:d.attribute.dx)&&void 0!==c?c:0,dy:null!==(g=null===(u=t.firstChild)||void 0===u?void 0:u.attribute.dy)&&void 0!==g?g:0}),t.forEachChildren((t=>{var e;t.setAttribute("dy",(null!==(e=t.attribute.dy)&&void 0!==e?e:0)-a+2)}))}}else if(S<e){const i=S-e;!o.has(`${t.col}-${t.row}`)&&o.set(`${t.col}-${t.row}`,{col:t.col,row:t.row,dx:null!==(f=null===(p=t.firstChild)||void 0===p?void 0:p.attribute.dx)&&void 0!==f?f:0,dy:null!==(b=null===(m=t.firstChild)||void 0===m?void 0:m.attribute.dy)&&void 0!==b?b:0}),t.forEachChildren((t=>{var e;t.setAttribute("dy",(null!==(e=t.attribute.dy)&&void 0!==e?e:0)-i+2)}))}else if(A>i){const e=A-i;!o.has(`${t.col}-${t.row}`)&&o.set(`${t.col}-${t.row}`,{col:t.col,row:t.row,dx:null!==(y=null===(v=t.firstChild)||void 0===v?void 0:v.attribute.dx)&&void 0!==y?y:0,dy:null!==(w=null===(C=t.firstChild)||void 0===C?void 0:C.attribute.dy)&&void 0!==w?w:0}),t.forEachChildren((t=>{var i;t.setAttribute("dy",(null!==(i=t.attribute.dy)&&void 0!==i?i:0)-e)}))}}function bB(t,e,i,o,n,r){if(at(t.mergeStartCol)&&at(t.mergeStartRow)&&at(t.mergeEndCol)&&at(t.mergeEndRow)){const{colStart:s,colEnd:l,rowStart:a,rowEnd:h}=vS(t,r.scenegraph);for(let t=s;t<=l;t++)for(let s=a;s<=h;s++)vB(r.scenegraph.getCell(t,s),e,i,o,n)}else vB(t,e,i,o,n)}function vB(t,e,i,o,n){var r,s,l,a,h,d,c,u,g,p,f,m,b,v,y,C,w,x;const _=t.getChildByName("text",!0)||t.getChildByName("image",!0);if(!_)return;if("image"===_.type){const{image:t}=_.attribute;if(!t||!_.resources)return;if("success"!==_.resources.get(t).state)return}const S=null!==(s=null!==(r=_.attribute.textAlign)&&void 0!==r?r:_.textAlign)&&void 0!==s?s:"left";_.AABBBounds.width();const A=_.globalAABBBounds.x1,B=_.globalAABBBounds.x2;if("center"===S&&n){const n=t.globalAABBBounds.x1+(null!==(a=null===(l=t.firstChild)||void 0===l?void 0:l.attribute.dx)&&void 0!==a?a:0),r=n+(null!==(d=null!==(h=t.contentWidth)&&void 0!==h?h:t.attribute.width)&&void 0!==d?d:0);if(n<e||r>i){const s=Math.max(n,e),l=Math.min(r,i),a=_.globalTransMatrix.e-(l+s)/2;!o.has(`${t.col}-${t.row}`)&&o.set(`${t.col}-${t.row}`,{col:t.col,row:t.row,dx:null!==(u=null===(c=t.firstChild)||void 0===c?void 0:c.attribute.dx)&&void 0!==u?u:0,dy:null!==(p=null===(g=t.firstChild)||void 0===g?void 0:g.attribute.dy)&&void 0!==p?p:0}),t.forEachChildren((t=>{var e;t.setAttribute("dx",(null!==(e=t.attribute.dx)&&void 0!==e?e:0)-a+2)}))}}else if(A<e){const i=A-e;!o.has(`${t.col}-${t.row}`)&&o.set(`${t.col}-${t.row}`,{col:t.col,row:t.row,dx:null!==(m=null===(f=t.firstChild)||void 0===f?void 0:f.attribute.dx)&&void 0!==m?m:0,dy:null!==(v=null===(b=t.firstChild)||void 0===b?void 0:b.attribute.dy)&&void 0!==v?v:0}),t.forEachChildren((t=>{var e;t.setAttribute("dx",(null!==(e=t.attribute.dx)&&void 0!==e?e:0)-i+2)}))}else if(B>i){const e=B-i;!o.has(`${t.col}-${t.row}`)&&o.set(`${t.col}-${t.row}`,{col:t.col,row:t.row,dx:null!==(C=null===(y=t.firstChild)||void 0===y?void 0:y.attribute.dx)&&void 0!==C?C:0,dy:null!==(x=null===(w=t.firstChild)||void 0===w?void 0:w.attribute.dy)&&void 0!==x?x:0}),t.forEachChildren((t=>{var i;t.setAttribute("dx",(null!==(i=t.attribute.dx)&&void 0!==i?i:0)-e)}))}}function yB(t){var e,i;const o=t.internalProps.layoutMap.headerObjects,n=t.internalProps.layoutMap.columnObjects;for(let t=0;t<o.length;t++){const i=o[t];if(i&&(null===(e=i.style)||void 0===e?void 0:e.textStick))return!0}for(let t=0;t<n.length;t++){const e=n[t];if(e&&(null===(i=e.style)||void 0===i?void 0:i.textStick))return!0}return!!(t.theme.headerStyle.textStick||t.theme.rowHeaderStyle.textStick||t.theme.bodyStyle.textStick)}var CB=function(t,e,i,o){return new(i||(i=Promise))((function(n,r){function s(t){try{a(o.next(t))}catch(t){r(t)}}function l(t){try{a(o.throw(t))}catch(t){r(t)}}function a(t){var e;t.done?n(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(s,l)}a((o=o.apply(t,e||[])).next())}))};class wB{constructor(t){this.isRelease=!1,this.mode="column",this.rowLimit=200,this.currentRow=0,this.rowStart=0,this.rowEnd=0,this.referenceRow=0,this.screenTopRow=0,this.deltaY=0,this.deltaHeight=0,this.colLimit=100,this.screenLeftCol=0,this.deltaX=0,this.deltaWidth=0,this.cellCache=new Map,this.table=t,this.table.isPivotChart()?(this.rowLimit=Math.max(100,Math.ceil(2*t.tableNoFrameHeight/t.defaultRowHeight)),this.colLimit=Math.max(100,Math.ceil(2*t.tableNoFrameWidth/t.defaultColWidth))):"autoHeight"===this.table.heightMode?this.rowLimit=Math.max(100,Math.ceil(2*t.tableNoFrameHeight/t.defaultRowHeight)):("autoWidth"===this.table.widthMode||(this.rowLimit=Math.max(200,Math.ceil(2*t.tableNoFrameHeight/t.defaultRowHeight))),this.colLimit=Math.max(100,Math.ceil(2*t.tableNoFrameWidth/t.defaultColWidth))),this.table.internalProps.transpose?this.mode="row":this.table.isPivotTable()&&(this.mode="pivot"),this.table.options.maintainedDataCount&&(this.rowLimit=this.table.options.maintainedDataCount)}get bodyLeftCol(){return this.table.frozenColCount}setParamsForColumn(){this.bodyRightCol=this.table.colCount-1-this.table.rightFrozenColCount;const t=Math.min(this.colLimit,this.bodyRightCol-this.bodyLeftCol+1);this.totalActualBodyColCount=t,this.totalCol=this.bodyLeftCol+t-1,this.colStart=this.bodyLeftCol,this.colEnd=this.totalCol;const e=this.table.defaultColWidth;this.taskColCount=1*Math.ceil(this.table.tableNoFrameWidth/e);const i=e*t,o=e*(this.bodyRightCol-this.bodyLeftCol+1);this.xLimitLeft=i/2,this.xLimitRight=o-i/2;const n=5*this.table.tableNoFrameWidth;this.screenColCount=Math.ceil(this.table.tableNoFrameWidth/e),this.firstScreenColLimit=Math.max(15,this.bodyLeftCol+Math.min(this.colLimit,Math.ceil(n/e))),this.colUpdatePos=this.bodyRightCol}setParamsForRow(){this.bodyTopRow=this.table.frozenRowCount,this.bodyBottomRow=this.table.rowCount-1-this.table.bottomFrozenRowCount;const t=Math.min(this.rowLimit,this.bodyBottomRow-this.bodyTopRow+1);this.totalActualBodyRowCount=t,this.totalRow=this.bodyTopRow+t-1,this.rowStart=this.bodyTopRow,this.rowEnd=this.totalRow;const e=this.table.defaultRowHeight;this.taskRowCount=1*Math.ceil(this.table.tableNoFrameHeight/e);const i=e*t,o=e*(this.bodyBottomRow-this.bodyTopRow+1);this.yLimitTop=i/2,this.yLimitBottom=o-i/2;const n=5*this.table.tableNoFrameHeight;this.screenRowCount=Math.ceil(this.table.tableNoFrameHeight/e),this.firstScreenRowLimit=Math.max(30,this.bodyTopRow+Math.min(this.rowLimit,Math.ceil(n/e))),this.rowUpdatePos=this.bodyBottomRow}resize(){const t=this.table.defaultColWidth;this.taskColCount=1*Math.ceil(this.table.tableNoFrameWidth/t);const e=5*this.table.tableNoFrameWidth;this.screenColCount=Math.ceil(this.table.tableNoFrameWidth/t),this.firstScreenColLimit=this.bodyLeftCol+Math.min(this.colLimit,Math.ceil(e/t));const i=this.table.defaultRowHeight;this.taskRowCount=1*Math.ceil(this.table.tableNoFrameHeight/i);const o=5*this.table.tableNoFrameHeight;this.screenRowCount=Math.ceil(this.table.tableNoFrameHeight/i),this.firstScreenRowLimit=this.bodyTopRow+Math.min(this.rowLimit,Math.ceil(o/i))}createGroupForFirstScreen(t,e,i,o,n,r,s,l){!function(t,e,i,o,n,r,s,l,a){var h,d,c,u,g,p,f,m,b,v,y,C;const{table:w}=a,{leftBottomCornerGroup:x,rightTopCornerGroup:_,rightBottomCornerGroup:S}=w.scenegraph;let A,B;a.setParamsForRow(),a.setParamsForColumn(),A="adaptive"===w.widthMode||w.options.autoWrapText&&("adaptive"===w.heightMode||"autoHeight"===w.heightMode)?w.colCount-1:Math.min(a.firstScreenColLimit,w.colCount-1),B="adaptive"===w.heightMode?w.rowCount-1:Math.min(a.firstScreenRowLimit,w.rowCount-1),0===w.internalProps._widthResizedColMap.size&&FA(w,0,A),0===w.internalProps._heightResizedRowMap.size&&cS(w,0,B),A<w.colCount-w.rightFrozenColCount&&FA(w,w.colCount-w.rightFrozenColCount,w.colCount-1),B<w.rowCount-w.bottomFrozenRowCount&&cS(w,w.rowCount-w.bottomFrozenRowCount,w.rowCount-1),w.scenegraph.colHeaderGroup.setAttribute("x",w.getFrozenColsWidth()),w.scenegraph.rowHeaderGroup.setAttribute("y",w.getFrozenRowsHeight()),w.scenegraph.bottomFrozenGroup.setAttribute("x",w.getFrozenColsWidth()),w.scenegraph.rightFrozenGroup.setAttribute("y",w.getFrozenRowsHeight()),w.scenegraph.bodyGroup.setAttributes({x:w.getFrozenColsWidth(),y:w.getFrozenRowsHeight()}),XA(t,s,l,0,w.frozenColCount-1,0,w.frozenRowCount-1,w.isListTable()?"columnHeader":"cornerHeader",w),A-w.rightFrozenColCount>=w.frozenColCount&&XA(e,s,l,w.frozenColCount,A-w.rightFrozenColCount,0,w.frozenRowCount-1,"columnHeader",w),w.frozenColCount>0&&(w.leftRowSeriesNumberCount>0&&XA(i,s,l,0,w.leftRowSeriesNumberCount-1,w.frozenRowCount,B-w.bottomFrozenRowCount,"rowHeader",w),w.rowHeaderLevelCount>0&&XA(i,s,l,w.leftRowSeriesNumberCount,w.leftRowSeriesNumberCount+w.rowHeaderLevelCount-1,w.frozenRowCount,B-w.bottomFrozenRowCount,"rowHeader",w),w.frozenColCount>w.rowHeaderLevelCount+w.leftRowSeriesNumberCount&&XA(i,s,l,w.rowHeaderLevelCount+w.leftRowSeriesNumberCount,w.frozenColCount-1,w.frozenRowCount,B-w.bottomFrozenRowCount,"body",w)),w.bottomFrozenRowCount>0&&(w.frozenColCount>0&&(w.leftRowSeriesNumberCount>0&&XA(x,s,l,0,w.leftRowSeriesNumberCount-1,w.rowCount-1-w.bottomFrozenRowCount+1,w.rowCount-1,"rowHeader",w),w.rowHeaderLevelCount>0&&XA(x,s,l,w.leftRowSeriesNumberCount,w.leftRowSeriesNumberCount+w.rowHeaderLevelCount-1,w.rowCount-1-w.bottomFrozenRowCount+1,w.rowCount-1,"rowHeader",w),w.frozenColCount>w.rowHeaderLevelCount+w.leftRowSeriesNumberCount&&XA(x,s,l,w.rowHeaderLevelCount+w.leftRowSeriesNumberCount,w.frozenColCount-1,w.rowCount-1-w.bottomFrozenRowCount+1,w.rowCount-1,"body",w)),A-w.rightFrozenColCount>=w.frozenColCount&&XA(n,s,l,w.frozenColCount,A-w.rightFrozenColCount,w.rowCount-1-w.bottomFrozenRowCount+1,w.rowCount-1,w.isPivotChart()?"rowHeader":"body",w)),w.rightFrozenColCount>0&&(XA(_,s,l,w.colCount-1-w.rightFrozenColCount+1,w.colCount-1,0,w.frozenRowCount-1,"columnHeader",w),XA(o,s,l,w.colCount-1-w.rightFrozenColCount+1,w.colCount-1,w.frozenRowCount,B-w.bottomFrozenRowCount,w.isPivotChart()?"rowHeader":"body",w)),w.bottomFrozenRowCount>0&&w.rightFrozenColCount>0&&XA(S,s,l,w.colCount-1-w.rightFrozenColCount+1,w.colCount-1,w.rowCount-1-w.bottomFrozenRowCount+1,w.rowCount-1,"body",w),A-w.rightFrozenColCount>=w.frozenColCount&&XA(r,s,l,w.frozenColCount,A-w.rightFrozenColCount,w.frozenRowCount,B-w.bottomFrozenRowCount,"body",w),r.firstChild||e.firstChild||t.firstChild||i.firstChild?(a.currentRow=null!==(u=null!==(d=null===(h=r.firstChild)||void 0===h?void 0:h.rowNumber)&&void 0!==d?d:null===(c=i.firstChild)||void 0===c?void 0:c.rowNumber)&&void 0!==u?u:a.totalRow,a.rowEnd=a.currentRow,a.rowUpdatePos=a.rowEnd+1,a.referenceRow=a.rowStart+Math.floor((a.rowEnd-a.rowStart)/2),a.currentCol=null!==(C=null!==(v=null!==(m=null!==(p=null===(g=r.lastChild)||void 0===g?void 0:g.col)&&void 0!==p?p:null===(f=e.lastChild)||void 0===f?void 0:f.col)&&void 0!==m?m:null===(b=i.lastChild)||void 0===b?void 0:b.col)&&void 0!==v?v:null===(y=t.lastChild)||void 0===y?void 0:y.col)&&void 0!==C?C:a.totalCol,a.colEnd=a.currentCol,a.colUpdatePos=a.colEnd+1,a.referenceCol=a.colStart+Math.floor((a.colEnd-a.colStart)/2),a.progress()):(a.currentRow=a.totalRow,a.rowEnd=a.currentRow,a.rowUpdatePos=a.rowEnd+1,a.referenceRow=a.rowStart+Math.floor((a.rowEnd-a.rowStart)/2),a.currentCol=a.totalCol,a.colEnd=a.currentCol,a.colUpdatePos=a.colEnd+1,a.referenceCol=a.colStart+Math.floor((a.colEnd-a.colStart)/2))}(t,e,i,o,n,r,s,l,this)}progress(){return CB(this,void 0,void 0,(function*(){if(!this.isProgressing)return this.isProgressing=!0,new Promise(((t,e)=>{setTimeout((()=>CB(this,void 0,void 0,(function*(){this.isProgressing=!1,this.isRelease||(this.colUpdatePos<=this.colEnd?(yield this.updateColCellGroupsAsync(),yield this.progress()):this.rowUpdatePos<=this.rowEnd?(yield this.updateRowCellGroupsAsync(),yield this.progress()):this.currentCol<this.totalCol?(yield this.createCol(),yield this.progress()):this.currentRow<this.totalRow&&(yield this.createRow(),yield this.progress()),pB(this.table),this.table.scenegraph.updateNextFrame(),t())}))),16)}))}))}createRow(){return CB(this,void 0,void 0,(function*(){this.taskRowCount&&this.createRowCellGroup(this.taskRowCount)}))}createCol(){return CB(this,void 0,void 0,(function*(){this.taskColCount&&this.createColGroup(this.taskRowCount)}))}createRowCellGroup(t){const e=Math.min(this.totalRow,this.currentRow+t);if(cS(this.table,this.currentRow+1,e,!1),this.rowEnd=e,this.table.frozenColCount){let t=0;for(let i=0;i<this.table.frozenColCount;i++){const o=this.table.scenegraph.getColGroup(i),n=this.table.isListTable()?"body":"rowHeader",{height:r}=VA(o,i,o.attribute.width,this.currentRow+1,e,this.table.scenegraph.mergeMap,this.table.internalProps.defaultRowHeight,this.table,n);t=Math.max(t,r),this.table.scenegraph.rowHeaderGroup.setAttribute("height",t)}}if(this.table.rightFrozenColCount){let t=0;for(let i=this.table.colCount-this.table.rightFrozenColCount;i<this.table.colCount;i++){const o=this.table.scenegraph.getColGroup(i),n=this.table.isPivotChart()?"rowHeader":"body",{height:r}=VA(o,i,o.attribute.width,this.currentRow+1,e,this.table.scenegraph.mergeMap,this.table.internalProps.defaultRowHeight,this.table,n);t=Math.max(t,r),this.table.scenegraph.rightFrozenGroup.setAttribute("height",t)}}let i=0;for(let t=this.bodyLeftCol;t<=this.bodyRightCol;t++){const o=this.table.scenegraph.getColGroup(t);if(!o)continue;const n=t<this.table.rowHeaderLevelCount?"rowHeader":"body",{height:r}=VA(o,t,o.attribute.width,this.currentRow+1,e,this.table.scenegraph.mergeMap,this.table.internalProps.defaultRowHeight,this.table,n);i=Math.max(i,r)}this.table.scenegraph.bodyGroup.setAttribute("height",i),this.currentRow=e,this.rowUpdatePos=this.rowEnd,this.table.scenegraph.updateContainer(),this.table.scenegraph.updateBorderSizeAndPosition()}createColGroup(t){const e=Math.min(this.totalCol,this.currentCol+t);FA(this.table,this.currentCol+1,e),this.colEnd=e;for(let t=0;t<this.table.rowCount;t++){const e=this.highPerformanceGetCell(this.currentCol,t);"cell"===e.role&&at(e.mergeStartCol)&&e.mergeStartCol>this.currentCol&&this.table.scenegraph.updateCellContent(e.col,e.row)}if(this.table.frozenRowCount){const t=this.table.scenegraph.colHeaderGroup.lastChild instanceof S_?this.table.scenegraph.colHeaderGroup.lastChild:this.table.scenegraph.colHeaderGroup.lastChild._prev,i=t.attribute.x+t.attribute.width,o=t.attribute.y;XA(this.table.scenegraph.colHeaderGroup,i,o,this.currentCol+1,e,0,this.table.frozenRowCount-1,"columnHeader",this.table)}if(this.table.bottomFrozenRowCount){const t=this.table.scenegraph.bottomFrozenGroup.lastChild instanceof S_?this.table.scenegraph.bottomFrozenGroup.lastChild:this.table.scenegraph.bottomFrozenGroup.lastChild._prev,i=t.attribute.x+t.attribute.width,o=t.attribute.y;XA(this.table.scenegraph.bottomFrozenGroup,i,o,this.currentCol+1,e,this.table.rowCount-this.table.bottomFrozenRowCount,this.table.rowCount-1,"columnHeader",this.table)}let i=this.table.scenegraph.bodyGroup.lastChild&&(this.table.scenegraph.bodyGroup.lastChild instanceof S_?this.table.scenegraph.bodyGroup.lastChild:this.table.scenegraph.bodyGroup.lastChild._prev);i||(i=this.table.scenegraph.colHeaderGroup.lastChild&&(this.table.scenegraph.colHeaderGroup.lastChild instanceof S_?this.table.scenegraph.colHeaderGroup.lastChild:this.table.scenegraph.colHeaderGroup.lastChild._prev));const o=i.attribute.x+i.attribute.width,n=i.attribute.y;XA(this.table.scenegraph.bodyGroup,o,n,this.currentCol+1,e,this.rowStart,this.rowEnd,"body",this.table),this.currentCol=e,this.colUpdatePos=this.colEnd,this.table.scenegraph.updateContainer(),this.table.scenegraph.updateBorderSizeAndPosition()}setY(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return CB(this,void 0,void 0,(function*(){const i=this.table.getRowsHeight(this.bodyTopRow,this.bodyTopRow+(this.rowEnd-this.rowStart+1))/2,o=this.table.getAllRowsHeight()-i,n=this.table.getTargetRowAt(t+this.table.scenegraph.colHeaderGroup.attribute.height);n&&(this.screenTopRow=n.row),t<i&&this.rowStart===this.bodyTopRow||t>o&&this.rowEnd===this.bodyBottomRow?(this.updateDeltaY(t),this.updateBody(t-this.deltaY)):this.table.scenegraph.bodyGroup.firstChild&&0!==this.table.scenegraph.bodyGroup.firstChild.childrenCount||this.table.scenegraph.rowHeaderGroup.firstChild&&0!==this.table.scenegraph.rowHeaderGroup.firstChild.childrenCount?this.dynamicSetY(t,n,e):(this.updateDeltaY(t),this.updateBody(t-this.deltaY))}))}setX(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return CB(this,void 0,void 0,(function*(){const i=this.table.getColsWidth(this.bodyLeftCol,this.bodyLeftCol+(this.colEnd-this.colStart+1))/2,o=this.table.getAllColsWidth()-i,n=this.table.getTargetColAt(t+this.table.scenegraph.rowHeaderGroup.attribute.width);n&&(this.screenLeftCol=n.col),t<i&&this.colStart===this.bodyLeftCol||t>o&&this.colEnd===this.bodyRightCol||this.table.scenegraph.bodyGroup.firstChild&&0===this.table.scenegraph.bodyGroup.firstChild.childrenCount?(this.updateDeltaX(t),this.table.scenegraph.setBodyAndColHeaderX(-t+this.deltaX)):this.dynamicSetX(t,n,e)}))}dynamicSetY(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return CB(this,void 0,void 0,(function*(){aB(t,e,i,this)}))}dynamicSetX(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return CB(this,void 0,void 0,(function*(){QA(t,e,i,this)}))}updateBody(t){this.table.scenegraph.setBodyAndRowHeaderY(-t)}updateRowCellGroupsAsync(){return CB(this,void 0,void 0,(function*(){this.updateCellGroups(this.taskRowCount)}))}updateCellGroups(t){const e=Math.min(this.bodyBottomRow,this.rowUpdatePos+t);"autoHeight"===this.table.heightMode&&cS(this.table,this.rowUpdatePos,e,!1),cB(this.rowUpdatePos,e,this),"autoHeight"===this.table.heightMode&&(sB(this.bodyLeftCol,this.bodyRightCol,this.rowUpdatePos,e,this.table,this.rowUpdateDirection,!0),sB(0,this.table.frozenColCount-1,this.rowUpdatePos,e,this.table,this.rowUpdateDirection,!0),sB(this.table.colCount-this.table.rightFrozenColCount,this.table.colCount-1,this.rowUpdatePos,e,this.table,this.rowUpdateDirection,!0)),this.rowUpdatePos=e+1}updateBottomFrozenCellGroups(){const t=this.table.rowCount-this.table.bottomFrozenRowCount,e=this.table.rowCount-1;"autoHeight"===this.table.heightMode&&cS(this.table,t,e,!1),cB(t,e,this),"autoHeight"===this.table.heightMode&&(sB(this.bodyLeftCol,this.bodyRightCol,t,e,this.table,this.rowUpdateDirection),sB(0,this.table.frozenColCount-1,t,e,this.table,this.rowUpdateDirection),sB(this.table.colCount-this.table.rightFrozenColCount,this.table.colCount-1,t,e,this.table,this.rowUpdateDirection))}updateRightFrozenCellGroups(){const t=this.table.colCount-this.table.rightFrozenColCount,e=this.table.colCount-1;"autoWidth"===this.table.widthMode&&FA(this.table,t,e,!1),rB(t,e,this),"autoHeight"===this.table.heightMode&&qA(t,e,this.table,this.colUpdateDirection)}updateColCellGroupsAsync(){return CB(this,void 0,void 0,(function*(){this.updateColGroups(this.taskRowCount)}))}updateColGroups(t){const e=Math.min(this.bodyRightCol,this.colUpdatePos+t);FA(this.table,this.colUpdatePos,e),rB(this.colUpdatePos,e,this),this.colUpdatePos=e+1}updateCellGroupPosition(t,e,i){t.row=e,t.mergeStartCol=void 0,t.mergeStartRow=void 0,t.mergeEndCol=void 0,t.mergeEndRow=void 0,t.setAttribute("y",i),t.needUpdate=!0,t.needUpdateForAutoRowHeight=!0}updateCellGroupContent(t){if(!t.needUpdate||"cell"!==t.role)return t;const e=this.table.scenegraph.updateCellContent(t.col,t.row);return t.needUpdate=!1,e||t}sortCellVertical(){return CB(this,void 0,void 0,(function*(){yield function(t){var e;return uB(this,void 0,void 0,(function*(){let i,o;t.table.scenegraph.bodyGroup.forEachChildren(((t,e)=>{"group"===t.type&&(t.needUpdate=!0,null==t||t.forEachChildren((t=>{t.needUpdate=!0})))})),"autoHeight"===t.table.heightMode?(i=t.rowStart,o=t.rowEnd):(i=Math.max(t.bodyTopRow,t.screenTopRow-1*t.screenRowCount),o=Math.min(t.bodyBottomRow,t.screenTopRow+2*t.screenRowCount));const n=t.table.getAllRowsHeight();cS(t.table,i,o);const r=t.table.getAllRowsHeight();n!==r&&t.table.scenegraph.updateContainerHeight(t.table.frozenRowCount,r-n);for(let i=0;null!==(e=i<t.table.frozenColCount)&&void 0!==e&&e;i++){const e=t.table.scenegraph.getColGroup(i);null==e||e.setAttribute("chartInstance",void 0);for(let e=t.rowStart;e<=t.rowEnd;e++)t.table.scenegraph.updateCellContent(i,e);for(let e=t.table.rowCount-t.table.bottomFrozenRowCount;e<t.table.rowCount;e++)t.table.scenegraph.updateCellContent(i,e)}for(let e=t.colStart;e<=t.colEnd;e++){const i=t.table.scenegraph.getColGroup(e);null==i||i.setAttribute("chartInstance",void 0);for(let i=t.table.rowCount-t.table.bottomFrozenRowCount;i<t.table.rowCount;i++)t.table.scenegraph.updateCellContent(e,i)}for(let e=t.table.colCount-t.table.rightFrozenColCount;e<t.table.colCount;e++){const i=t.table.scenegraph.getColGroup(e);null==i||i.setAttribute("chartInstance",void 0);for(let i=t.rowStart;i<=t.rowEnd;i++)t.table.scenegraph.updateCellContent(e,i);for(let i=t.table.rowCount-t.table.bottomFrozenRowCount;i<t.table.rowCount;i++)t.table.scenegraph.updateCellContent(e,i)}cB(i,o,t),"autoHeight"===t.table.heightMode&&sB(t.bodyLeftCol,t.bodyRightCol,i,o,t.table,t.rowEnd>t.bodyBottomRow-(t.rowEnd-t.rowStart+1)?"down":"up"),t.rowUpdatePos=t.rowStart,t.rowUpdateDirection=t.rowEnd>t.bodyBottomRow-(t.rowEnd-t.rowStart+1)?"down":"up",t.table.scenegraph.updateNextFrame(),"autoHeight"!==t.table.heightMode&&(yield t.progress())}))}(this)}))}sortCellHorizontal(){return CB(this,void 0,void 0,(function*(){yield function(t){return gB(this,void 0,void 0,(function*(){t.table.scenegraph.bodyGroup.forEachChildren(((t,e)=>{"group"===t.type&&(t.needUpdate=!0,null==t||t.forEachChildren((t=>{t.needUpdate=!0})))}));const e=Math.max(t.bodyLeftCol,t.screenLeftCol-1*t.screenColCount),i=Math.min(t.bodyRightCol,t.screenLeftCol+2*t.screenColCount);FA(t.table,e,i);for(let e=t.colStart;e<=t.colEnd;e++){const i=t.table.scenegraph.getColGroup(e);null==i||i.setAttribute("chartInstance",void 0);for(let i=t.table.rowCount-t.table.bottomFrozenRowCount;i<t.table.rowCount;i++)t.table.scenegraph.updateCellContent(e,i)}for(let e=t.table.colCount-t.table.rightFrozenColCount;e<t.table.colCount;e++){const i=t.table.scenegraph.getColGroup(e);null==i||i.setAttribute("chartInstance",void 0);for(let i=t.rowStart;i<=t.rowEnd;i++)t.table.scenegraph.updateCellContent(e,i);for(let i=t.table.rowCount-t.table.bottomFrozenRowCount;i<t.table.rowCount;i++)t.table.scenegraph.updateCellContent(e,i)}rB(e,i,t),t.colUpdatePos=t.colStart,t.colUpdateDirection=t.colEnd>t.bodyRightCol-(t.colEnd-t.colStart+1)?"right":"left",t.table.scenegraph.updateNextFrame(),yield t.progress()}))}(this)}))}highPerformanceGetCell(t,e,i){if(e>=this.table.frozenRowCount&&e<this.table.rowCount-this.table.bottomFrozenRowCount&&(e<this.rowStart||e>this.rowEnd))return jA;if(t>=this.table.frozenColCount&&t<this.table.colCount-this.table.rightFrozenColCount&&(t<this.colStart||t>this.colEnd))return jA;if(this.cellCache.get(t)){const o=this.cellCache.get(t);if((o._next||o._prev)&&Math.abs(o.row-e)<e){let n=xB(o,e);return n&&(i||"shadow-cell"!==n.role)||(n=this.table.scenegraph.getCell(t,e,i)),n.row&&this.cellCache.set(t,n),n}const n=this.table.scenegraph.getCell(t,e,i);return n.col===t&&n.row&&this.cellCache.set(t,n),n}const o=this.table.scenegraph.getCell(t,e,i);return o.col===t&&o.row&&this.cellCache.set(t,o),o}updateDeltaY(t,e,i){if(this.rowStart===this.bodyTopRow){const t=this.table.scenegraph.highPerformanceGetCell(this.colStart,this.rowStart,!0);if("cell"===t.role){const e=t.attribute.y;this.deltaY=-e}}else if(this.rowEnd===this.bodyBottomRow){const t=this.table.scenegraph.highPerformanceGetCell(this.colStart,this.rowEnd,!0);if("cell"===t.role){const e=t.attribute.y+t.attribute.height-(this.table.getAllRowsHeight()-this.table.getFrozenRowsHeight()-this.table.getBottomFrozenRowsHeight());this.deltaY=-e}}else if(Q(e)&&Q(i)){let o=this.table.scenegraph.highPerformanceGetCell(this.colStart,i,!0);"cell"!==o.role&&(o=this.table.scenegraph.highPerformanceGetCell(0,i,!0));const n=t-this.deltaY,r=e-n,s=o.attribute.y-n+this.table.getFrozenRowsHeight();this.deltaY=r-s}}updateDeltaX(t,e,i){if(this.colStart===this.bodyLeftCol){const t=this.table.scenegraph.getColGroup(this.colStart);if(t){const e=t.attribute.x;this.deltaX=-e}}else if(this.colEnd===this.bodyRightCol){const t=this.table.scenegraph.getColGroup(this.colEnd);if(t){const e=t.attribute.x+t.attribute.width-(this.table.getAllColsWidth()-this.table.getFrozenColsWidth()-this.table.getRightFrozenColsWidth());this.deltaX=-e}}else if(Q(e)&&Q(i)){const o=this.table.scenegraph.getColGroup(i)||this.table.scenegraph.getColGroup(i,!0),n=t-this.deltaX,r=e-n,s=o.attribute.x-n+this.table.getFrozenColsWidth();this.deltaX=r-s}}release(){this.isRelease=!0}}function xB(t,e){if(!t)return null;if(t.row===e)return t;const i=t._prev,o=t._next;return t.row>e&&i&&i.row===t.row-1?xB(i,e):t.row<e&&o&&o.row===t.row+1?xB(o,e):null}function _B(t,e,i){var o,n,r,s,l,a,h,d,c;const u=i.table,[g,p,f,m]=e.split("-"),b=parseInt(g,10),v=parseInt(p,10),y=parseInt(f,10),C=parseInt(m,10);let w,x=b,_=v,S=y,A=C;switch(t.role){case"rowHeader":w=u.getBodyVisibleRowRange(),w&&(_=Math.max(v,w.rowStart-1),A=Math.min(C,w.rowEnd+1));break;case"columnHeader":case"bottomFrozen":w=u.getBodyVisibleCellRange(),w&&(x=Math.max(b,w.colStart-1),S=Math.min(y,w.colEnd+1));break;case"cornerHeader":case"rightTopCorner":case"leftBottomCorner":case"rightBottomCorner":break;case"rightFrozen":w=u.getBodyVisibleCellRange(),w&&(_=Math.max(v,w.rowStart-1),A=Math.min(C,w.rowEnd+1));break;default:w=u.getBodyVisibleCellRange(),w&&(_=Math.max(v,w.rowStart-1),A=Math.min(C,w.rowEnd+1),x=Math.max(b,w.colStart-1),S=Math.min(y,w.colEnd+1))}const B=u.getColsWidth(x,S),R=u.getRowsHeight(_,A),M=i.highPerformanceGetCell(x,_).globalAABBBounds,T=i.highPerformanceGetCell(S,A).globalAABBBounds;t.rect.setAttributes({x:M.x1-i.tableGroup.attribute.x,y:M.y1-i.tableGroup.attribute.y,width:B,height:R,visible:!0}),t.fillhandle&&(null===(o=t.fillhandle)||void 0===o||o.setAttributes({x:T.x2-i.tableGroup.attribute.x-3,y:T.y2-i.tableGroup.attribute.y-3,width:6,height:6,visible:!0}));let k=!!u.frozenColCount&&b===u.frozenColCount;!k&&u.frozenColCount&&u.scrollLeft>0&&b>=u.frozenColCount&&u.getColsWidth(0,b-1)-u.scrollLeft<u.getFrozenColsWidth()&&(k=!0);let P=!!u.rightFrozenColCount&&u.rightFrozenColCount>0&&y===u.colCount-u.rightFrozenColCount-1;!P&&u.rightFrozenColCount&&y<u.colCount-u.rightFrozenColCount&&u.getColsWidth(0,y)-u.scrollLeft>u.tableNoFrameWidth-u.getRightFrozenColsWidth()&&(P=!0);let E=!u.frozenRowCount||v===u.frozenRowCount;!E&&u.frozenRowCount&&u.scrollTop>0&&v>=u.frozenRowCount&&u.getRowsHeight(0,v-1)-u.scrollTop<u.getFrozenRowsHeight()&&(E=!0);let L=!!u.bottomFrozenRowCount&&C===u.rowCount-u.bottomFrozenRowCount-1;if(!L&&u.bottomFrozenRowCount&&C<u.rowCount-u.bottomFrozenRowCount&&u.getRowsHeight(0,C)-u.scrollTop>u.tableNoFrameHeight-u.getBottomFrozenRowsHeight()&&(L=!0),k&&t.rect.attribute.stroke[3]||P&&t.rect.attribute.stroke[1]||E&&t.rect.attribute.stroke[0]||L&&t.rect.attribute.stroke[2]){if(k&&t.rect.attribute.stroke[3]&&i.tableGroup.insertAfter(t.rect,"columnHeader"===t.role?i.cornerHeaderGroup:"bottomFrozen"===t.role?i.leftBottomCornerGroup:i.rowHeaderGroup),L&&t.rect.attribute.stroke[2]&&i.tableGroup.insertAfter(t.rect,"rowHeader"===t.role?i.leftBottomCornerGroup:"rightFrozen"===t.role?i.rightBottomCornerGroup:i.bottomFrozenGroup),E&&t.rect.attribute.stroke[0]&&i.tableGroup.insertAfter(t.rect,"rowHeader"===t.role?i.cornerHeaderGroup:"rightFrozen"===t.role?i.rightTopCornerGroup:i.colHeaderGroup),P&&t.rect.attribute.stroke[1]&&i.tableGroup.insertAfter(t.rect,"columnHeader"===t.role?i.rightTopCornerGroup:"bottomFrozen"===t.role?i.rightBottomCornerGroup:i.rightFrozenGroup),t.rect.attribute.x<u.getFrozenColsWidth()&&u.scrollLeft>0&&("body"===t.role||"columnHeader"===t.role||"bottomFrozen"===t.role)){const e=t.rect.attribute.width-(u.getFrozenColsWidth()-t.rect.attribute.x);t.rect.setAttributes({x:t.rect.attribute.x+(u.getFrozenColsWidth()-t.rect.attribute.x),width:e>0?e:0}),null===(n=t.fillhandle)||void 0===n||n.setAttributes({visible:e>0})}if(u.getRightFrozenColsWidth()>0&&i.rightFrozenGroup.attribute.height>0&&t.rect.attribute.x+t.rect.attribute.width>i.rightFrozenGroup.attribute.x&&("body"===t.role||"columnHeader"===t.role||"bottomFrozen"===t.role)){const e=i.rightFrozenGroup.attribute.x-t.rect.attribute.x;t.rect.setAttributes({x:t.rect.attribute.x,width:e>0?e:0}),null===(r=t.fillhandle)||void 0===r||r.setAttributes({visible:e-B>0})}if(t.rect.attribute.y<i.colHeaderGroup.attribute.height&&u.scrollTop>0&&("body"===t.role||"rowHeader"===t.role||"rightFrozen"===t.role)){const e=t.rect.attribute.height-(i.colHeaderGroup.attribute.height-t.rect.attribute.y);t.rect.setAttributes({y:t.rect.attribute.y+(i.colHeaderGroup.attribute.height-t.rect.attribute.y),height:e>0?e:0}),null===(s=t.fillhandle)||void 0===s||s.setAttributes({visible:e>0})}if(i.bottomFrozenGroup.attribute.width>0&&i.bottomFrozenGroup.attribute.height>0&&t.rect.attribute.y+t.rect.attribute.height>i.bottomFrozenGroup.attribute.y&&("body"===t.role||"rowHeader"===t.role||"rightFrozen"===t.role)){const e=i.bottomFrozenGroup.attribute.y-t.rect.attribute.y;t.rect.setAttributes({y:t.rect.attribute.y,height:e>0?e:0}),null===(l=t.fillhandle)||void 0===l||l.setAttributes({visible:e-R>0})}}else i.tableGroup.insertAfter(t.rect,"body"===t.role?i.bodyGroup:"columnHeader"===t.role?i.colHeaderGroup:"rowHeader"===t.role?i.rowHeaderGroup:"cornerHeader"===t.role?i.cornerHeaderGroup:"rightTopCorner"===t.role?i.rightTopCornerGroup:"rightFrozen"===t.role?i.rightFrozenGroup:"leftBottomCorner"===t.role?i.leftBottomCornerGroup:"bottomFrozen"===t.role?i.bottomFrozenGroup:i.rightBottomCornerGroup);let H=0;"number"==typeof t.rect.attribute.lineWidth&&(H=Math.ceil(t.rect.attribute.lineWidth/2)),y===u.colCount-1&&(Array.isArray(t.rect.attribute.lineWidth)&&(H=Math.ceil((null!==(a=t.rect.attribute.lineWidth[1])&&void 0!==a?a:0)/2)),t.rect.setAttributes({width:t.rect.attribute.width-H})),0===b&&(Array.isArray(t.rect.attribute.lineWidth)&&(H=Math.ceil((null!==(h=t.rect.attribute.lineWidth[3])&&void 0!==h?h:0)/2)),t.rect.setAttributes({x:t.rect.attribute.x+H,width:t.rect.attribute.width-H})),C===u.rowCount-1&&(Array.isArray(t.rect.attribute.lineWidth)&&(H=Math.ceil((null!==(d=t.rect.attribute.lineWidth[2])&&void 0!==d?d:0)/2)),t.rect.setAttributes({height:t.rect.attribute.height-H})),0===v&&(Array.isArray(t.rect.attribute.lineWidth)&&(H=Math.ceil((null!==(c=t.rect.attribute.lineWidth[0])&&void 0!==c?c:0)/2)),t.rect.setAttributes({y:t.rect.attribute.y+H,height:t.rect.attribute.height-H}))}function SB(t,e){let i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];const o=t.table,n=e.start.col,r=e.start.row,s=e.end.col,l=e.end.row,a=e.skipBodyMerge;let h=Math.max(Math.min(s,n),0),d=Math.max(Math.min(l,r),0),c=Math.min(Math.max(s,n),o.colCount-1),u=Math.min(Math.max(l,r),o.rowCount-1);const g=()=>{let t=!1;for(let e=h;e<=c;e++){if(e===h)for(let i=d;i<=u;i++){if(!o.isHeader(e,i)&&a)continue;const n=jw(o,e,i);if(n&&n.start.col<h){h=n.start.col,t=!0;break}}if(!t&&e===c)for(let i=d;i<=u;i++){if(!o.isHeader(e,i)&&a)continue;const n=jw(o,e,i);if(n&&Math.min(n.end.col,o.colCount-1)>c){c=n.end.col,t=!0;break}}if(t)break}if(!t)for(let e=d;e<=u;e++){if(e===d)for(let i=h;i<=c;i++){if(!o.isHeader(i,e)&&a)continue;const n=jw(o,i,e);if(n&&n.start.row<d){d=n.start.row,t=!0;break}}if(!t&&e===u)for(let i=h;i<=c;i++){if(!o.isHeader(i,e)&&a)continue;const n=jw(o,i,e);if(n&&Math.min(n.end.row,o.rowCount-1)>u){u=n.end.row,t=!0;break}}if(t)break}t&&g()};i&&g(),t.selectingRangeComponents.forEach(((t,e)=>{var i;t.rect.delete(),null===(i=t.fillhandle)||void 0===i||i.delete()})),t.selectingRangeComponents=new Map;let p=!1,f=!1,m=!1,b=!1,v=!1,y=!1,C=!1,w=!1,x=!1;if(h<=o.frozenColCount-1&&d<=o.frozenRowCount-1&&(y=!0),c>=o.colCount-o.rightFrozenColCount&&d<=o.frozenRowCount-1&&(C=!0),h<=o.frozenColCount-1&&u>=o.rowCount-o.bottomFrozenRowCount&&(x=!0),c>=o.colCount-o.rightFrozenColCount&&u>=o.rowCount-o.bottomFrozenRowCount&&(w=!0),h<=o.frozenColCount-1&&u>=o.frozenRowCount&&d<=o.rowCount-o.bottomFrozenRowCount-1&&(p=!0),c>=o.colCount-o.rightFrozenColCount&&u>=o.frozenRowCount&&d<=o.rowCount-o.bottomFrozenRowCount-1&&(f=!0),d<=o.frozenRowCount-1&&c>=o.frozenColCount&&h<=o.colCount-o.rightFrozenColCount-1&&(m=!0),u>=o.rowCount-o.bottomFrozenRowCount&&c>=o.frozenColCount&&h<=o.colCount-o.rightFrozenColCount-1&&(b=!0),h<=o.colCount-o.rightFrozenColCount-1&&c>=o.frozenColCount&&d<=o.rowCount-o.bottomFrozenRowCount-1&&u>=o.frozenRowCount&&(v=!0),y){const e=Math.min(c,o.frozenColCount-1),i=Math.min(u,o.frozenRowCount-1),n=[!0,!m,!p,!0];t.createCellSelectBorder(h,d,e,i,"cornerHeader",`${h}${d}${c}${u}`,n)}if(C){const e=Math.max(h,o.colCount-o.rightFrozenColCount),i=Math.min(u,o.frozenRowCount-1),n=[!0,!0,!f,!m];t.createCellSelectBorder(e,d,c,i,"rightTopCorner",`${h}${d}${c}${u}`,n)}if(x){const e=Math.min(c,o.frozenColCount-1),i=Math.max(d,o.rowCount-o.bottomFrozenRowCount),n=[!p,!b,!0,!0];t.createCellSelectBorder(h,i,e,u,"leftBottomCorner",`${h}${d}${c}${u}`,n)}if(w){const e=Math.max(h,o.colCount-o.rightFrozenColCount),i=Math.max(d,o.rowCount-o.bottomFrozenRowCount),n=[!f,!0,!0,!b];t.createCellSelectBorder(e,i,c,u,"rightBottomCorner",`${h}${d}${c}${u}`,n)}if(m){const e=Math.max(h,o.frozenColCount),i=Math.min(c,o.colCount-o.rightFrozenColCount-1),n=Math.min(u,o.frozenRowCount-1),r=[!0,!C,!v,!y];t.createCellSelectBorder(e,d,i,n,"columnHeader",`${h}${d}${c}${u}`,r)}if(b){const e=Math.max(h,o.frozenColCount),i=Math.min(c,o.colCount-o.rightFrozenColCount-1),n=Math.max(d,o.rowCount-o.bottomFrozenRowCount),r=[!v,!w,!0,!x];t.createCellSelectBorder(e,n,i,u,"bottomFrozen",`${h}${d}${c}${u}`,r)}if(p){const e=Math.max(d,o.frozenRowCount),i=Math.min(u,o.rowCount-o.bottomFrozenRowCount-1),n=Math.min(c,o.frozenColCount-1),r=[!y,!v,!x,!0];t.createCellSelectBorder(h,e,n,i,"rowHeader",`${h}${d}${c}${u}`,r)}if(f){const e=Math.max(d,o.frozenRowCount),i=Math.min(u,o.rowCount-o.bottomFrozenRowCount-1),n=Math.max(h,o.colCount-o.rightFrozenColCount),r=[!C,!0,!w,!v];t.createCellSelectBorder(n,e,c,i,"rightFrozen",`${h}${d}${c}${u}`,r)}if(v){const e=Math.max(h,o.frozenColCount),i=Math.max(d,o.frozenRowCount),n=Math.min(c,o.colCount-o.rightFrozenColCount-1),r=Math.min(u,o.rowCount-o.bottomFrozenRowCount-1),s=[!m,!f,!b,!p];t.createCellSelectBorder(e,i,n,r,"body",`${h}${d}${c}${u}`,s)}}function AB(t){t.selectingRangeComponents.forEach(((t,e)=>{t.rect.setAttribute("opacity",0)})),t.selectedRangeComponents.forEach(((t,e)=>{t.rect.setAttribute("opacity",0)}))}function BB(t){t.selectingRangeComponents.forEach(((t,e)=>{t.rect.setAttribute("opacity",1)})),t.selectedRangeComponents.forEach(((t,e)=>{t.rect.setAttribute("opacity",1)}))}function RB(t){t.selectingRangeComponents.forEach(((e,i)=>{var o;t.selectedRangeComponents.get(i)&&(t.selectingRangeComponents.get(i).rect.delete(),null===(o=t.selectingRangeComponents.get(i).fillhandle)||void 0===o||o.delete()),t.selectedRangeComponents.set(i,e)})),t.selectingRangeComponents=new Map,t.updateNextFrame()}function MB(t){t.selectedRangeComponents.forEach(((t,e)=>{var i;t.rect.delete(),null===(i=t.fillhandle)||void 0===i||i.delete()})),t.selectedRangeComponents=new Map}function TB(t,e,i,o){const n=o.scenegraph,r=WC(t.map((t=>t.row))).sort(((t,e)=>e-t)),s=WC(e.map((t=>t.row))).sort(((t,e)=>t-e)),l=WC(i.map((t=>t.row))).sort(((t,e)=>t-e));let a;if(l.length&&(a=EB(l[0]-1,l[l.length-1]+1,n)),s.length){const t=EB(s[0]-1,s[s.length-1]+1,n);a=Q(a)?Q(t)?Math.min(a,t):a:t}if(r.length){const t=EB(r[0]-1,r[r.length-1]+1,n);a=Q(a)?Q(t)?Math.min(a,t):a:t}r.forEach((t=>{!function(t,e){const i=e.proxy;t>=i.rowStart&&t<=i.rowEnd&&(function(t,e){for(let i=0;i<e.table.colCount;i++){const o=e.getColGroup(i,!1);if(!o)continue;let n;o.forEachChildren((e=>e.row===t&&(n=e,!0))),n&&(o.updateColumnHeight(-n.attribute.height),o.removeChild(n))}}(t,e),i.rowEnd--,i.currentRow--),i.bodyBottomRow--;const o=Math.min(i.rowLimit,i.bodyBottomRow-i.bodyTopRow+1);i.totalActualBodyRowCount=o,i.totalRow=i.rowStart+o-1}(t,n)}));const h=o.rowHeightsMap;if(r.forEach((t=>{h.delete(t)})),r.length){!function(t){function e(e,i){e.row=i;const o=jw(t.table,e.col,e.row);o?(e.mergeStartCol=o.start.col,e.mergeEndCol=o.end.col,e.mergeStartRow=o.start.row,e.mergeEndRow=o.end.row):(e.mergeStartCol=void 0,e.mergeEndCol=void 0,e.mergeStartRow=void 0,e.mergeEndRow=void 0)}t.bodyGroup.forEachChildren((i=>{let o=t.bodyRowStart;null==i||i.forEachChildren((t=>{e(t,o),o++}))})),t.rowHeaderGroup.forEachChildren((i=>{let o=t.bodyRowStart;null==i||i.forEachChildren((t=>{e(t,o),o++}))})),t.rightFrozenGroup.forEachChildren((i=>{let o=t.bodyRowStart;null==i||i.forEachChildren((t=>{e(t,o),o++}))})),t.bottomFrozenGroup.forEachChildren((i=>{let o=t.table.rowCount-t.table.bottomFrozenRowCount;null==i||i.forEachChildren((t=>{e(t,o),o++}))})),t.leftBottomCornerGroup.forEachChildren((i=>{let o=t.table.rowCount-t.table.bottomFrozenRowCount;null==i||i.forEachChildren((t=>{e(t,o),o++}))})),t.rightBottomCornerGroup.forEachChildren((i=>{let o=t.table.rowCount-t.table.bottomFrozenRowCount;null==i||i.forEachChildren((t=>{e(t,o),o++}))}))}(n);const t=PB(r[r.length-1]-1,r[0]-r.length+1,n);a=Q(a)?Q(t)?Math.min(a,t):a:t}let d;if(n.table._clearRowRangeHeightsMap(),s.forEach((t=>{const e=function(t,e){const i=e.proxy;i.bodyBottomRow++;const o=Math.min(i.rowLimit,i.bodyBottomRow-i.bodyTopRow+1);if(i.totalActualBodyRowCount=o,i.totalRow=i.rowStart+o-1,!(t<i.rowStart))return t>i.rowEnd?i.rowEnd-i.rowStart+1<i.rowLimit?(i.rowEnd++,i.currentRow++,kB(t,e),t):void 0:i.rowEnd-i.rowStart+1<i.rowLimit?(i.rowEnd++,i.currentRow++,kB(t,e),t):t}(t,n);d=null!=d?d:e,h.insert(t)})),function(t){function e(e,i,o){e.row=i,e.setAttribute("y",o);const n=jw(t.table,e.col,e.row);n?(e.mergeStartCol=n.start.col,e.mergeEndCol=n.end.col,e.mergeStartRow=n.start.row,e.mergeEndRow=n.end.row):(e.mergeStartCol=void 0,e.mergeEndCol=void 0,e.mergeStartRow=void 0,e.mergeEndRow=void 0)}t.bodyGroup.forEachChildren((i=>{let o=t.bodyRowStart,n=t.getCellGroupY(o);null==i||i.forEachChildren((t=>{e(t,o,n),o++,n+=t.attribute.height}))})),t.rowHeaderGroup.forEachChildren((i=>{let o=t.bodyRowStart,n=t.getCellGroupY(o);null==i||i.forEachChildren((t=>{e(t,o,n),o++,n+=t.attribute.height}))})),t.rightFrozenGroup.forEachChildren((i=>{let o=t.bodyRowStart,n=t.getCellGroupY(o);null==i||i.forEachChildren((t=>{e(t,o,n),o++,n+=t.attribute.height}))})),t.bottomFrozenGroup.forEachChildren((i=>{let o=t.table.rowCount-t.table.bottomFrozenRowCount,n=0;null==i||i.forEachChildren((t=>{e(t,o,n),o++,n+=t.attribute.height}))})),t.leftBottomCornerGroup.forEachChildren((i=>{let o=t.table.rowCount-t.table.bottomFrozenRowCount,n=0;null==i||i.forEachChildren((t=>{e(t,o,n),o++,n+=t.attribute.height}))})),t.rightBottomCornerGroup.forEachChildren((i=>{let o=t.table.rowCount-t.table.bottomFrozenRowCount,n=0;null==i||i.forEachChildren((t=>{e(t,o,n),o++,n+=t.attribute.height}))}))}(n),s.length){const t=PB(s[0]-1,s[s.length-1]+1,n);a=Q(a)?Q(t)?Math.min(a,t):a:t}for(let t=0;t<o.colCount;t++)l.forEach((e=>{const i=jw(n.table,t,e);if(i)for(let t=i.start.col;t<=i.end.col;t++)for(let e=i.start.row;e<=i.end.row;e++)X_(t,e,n.table,!1);else X_(t,e,n.table,!1)}));if(l.length){const t=PB(l[0]-1,l[l.length-1]+1,n);a=Q(a)?Q(t)?Math.min(a,t):a:t}if(at(d)){for(let t=0;t<o.colCount;t++)for(let e=d;e<o.rowCount;e++){const i=n.highPerformanceGetCell(t,e,!0);i&&(i.needUpdate=!0)}a=Q(a)?Q(d)?Math.min(a,d):a:d}if(at(a)&&(n.proxy.rowUpdatePos=Math.min(n.proxy.rowUpdatePos,a)),s.length){if(!at(d)){const t=Math.min(...s);n.proxy.rowUpdatePos=Math.min(t,n.proxy.rowUpdatePos)}n.proxy.rowUpdateDirection="up",n.proxy.updateCellGroups(2*n.proxy.screenRowCount),u()}else r.length&&(function(t,e){if(e.table.isHasSeriesNumber())for(let i=t;i<=e.table.rowCount-1;i++)X_(0,i,e.table,!1)}(r[r.length-1],n),n.proxy.updateCellGroups(2*n.proxy.screenRowCount),u(),n.proxy.progress());n.proxy.progress();const c=o.getRowsHeight(o.frozenRowCount,o.rowCount-1-o.bottomFrozenRowCount);function u(){if((null==s?void 0:s[(null==s?void 0:s.length)-1])>=o.rowCount-o.bottomFrozenRowCount||(null==l?void 0:l[(null==l?void 0:l.length)-1])>=o.rowCount-o.bottomFrozenRowCount||(null==r?void 0:r[0])>=o.rowCount-o.bottomFrozenRowCount){for(let t=0;t<o.colCount;t++)for(let e=o.rowCount-o.bottomFrozenRowCount;e<o.rowCount;e++){const i=n.highPerformanceGetCell(t,e,!0);i&&(i.needUpdate=!0)}n.proxy.updateBottomFrozenCellGroups()}}n.updateContainerHeight(n.table.frozenRowCount,c-n.bodyGroup.attribute.height)}function kB(t,e){for(let i=0;i<e.table.colCount;i++){const o=new S_({x:0,y:0,width:e.table.getColWidth(i),height:e.table.getRowHeight(t)});if(o.role="cell",o.col=i,o.row=t,o.needUpdate=!0,!o)continue;const n=e.getColGroup(i);if(n)if(n.firstChild&&t<n.firstChild.row)n.insertBefore(o,n.firstChild),n.firstChild.row=n.firstChild.row+1;else if(n.lastChild&&t>n.lastChild.row)n.appendChild(o);else{const r=e.highPerformanceGetCell(i,t,!0);r!==o&&(n.insertBefore(o,r),r&&(r.row=r.row+1),r!==n.lastChild&&n.lastChild&&(n.lastChild.row=n.lastChild.row+1))}}}function PB(t,e,i){let o;for(let n=0;n<i.table.colCount;n++){const r=i.table.getCellRange(n,t);let s;r.start.row<=t+1&&r.end.row>=t+1&&(LB(r,i),s=r.start.row);const l=i.table.getCellRange(n,e);l.start.row<=e+1&&l.end.row>=e+1&&(LB(l,i),s=l.start.row),Q(s)&&(o=Q(o)?Math.min(o,s):s)}return o}function EB(t,e,i){let o;for(let n=0;n<i.table.colCount;n++){let r;const s=i.highPerformanceGetCell(n,t);s.mergeStartRow&&s.mergeEndRow&&s.mergeEndRow>t&&(LB({start:{row:s.mergeStartRow,col:"autoHeight"===i.table.heightMode?0:s.mergeStartCol},end:{row:s.mergeEndRow,col:"autoHeight"===i.table.heightMode?i.table.colCount-1:s.mergeEndCol}},i),r=s.mergeStartRow);const l=i.highPerformanceGetCell(n,e);l.mergeStartRow&&l.mergeEndRow&&l.mergeStartRow<e&&(LB({start:{row:l.mergeStartRow,col:"autoHeight"===i.table.heightMode?0:l.mergeStartCol},end:{row:l.mergeEndRow,col:"autoHeight"===i.table.heightMode?i.table.colCount-1:l.mergeEndCol}},i),r=l.mergeStartRow),Q(r)&&(o=Q(o)?Math.min(o,r):r)}return o}function LB(t,e){const{start:i,end:o}=t;for(let t=i.col;t<=o.col;t++)for(let n=i.row;n<=o.row;n++){const i=e.highPerformanceGetCell(t,n,!0);i&&(i.needUpdate=!0)}}function HB(t){const e=t.bodyGroup.firstChild instanceof S_?t.bodyGroup.firstChild:null;e&&(t.rowHeaderGroup.appendChild(e),t.rowHeaderGroup.setAttribute("width",t.rowHeaderGroup.attribute.width+e.attribute.width),t.bodyGroup.setAttribute("width",t.bodyGroup.attribute.width-e.attribute.width))}function zB(t){const e=t.colHeaderGroup.firstChild instanceof S_?t.colHeaderGroup.firstChild:null;e&&(t.cornerHeaderGroup.appendChild(e),t.cornerHeaderGroup.setAttribute("width",t.cornerHeaderGroup.attribute.width+e.attribute.width),t.colHeaderGroup.setAttribute("width",t.colHeaderGroup.attribute.width-e.attribute.width))}function FB(t){var e;const i=t.rowHeaderGroup.lastChild instanceof S_?t.rowHeaderGroup.lastChild:null===(e=t.rowHeaderGroup.lastChild)||void 0===e?void 0:e._prev;i&&(WB(t.bodyGroup,i,t.bodyGroup.firstChild),t.bodyGroup.setAttribute("width",t.bodyGroup.attribute.width+i.attribute.width),t.rowHeaderGroup.setAttribute("width",t.rowHeaderGroup.attribute.width-i.attribute.width))}function IB(t){var e;const i=t.cornerHeaderGroup.lastChild instanceof S_?t.cornerHeaderGroup.lastChild:null===(e=t.cornerHeaderGroup.lastChild)||void 0===e?void 0:e._prev;i&&(WB(t.colHeaderGroup,i,t.colHeaderGroup.firstChild),t.colHeaderGroup.setAttribute("width",t.colHeaderGroup.attribute.width+i.attribute.width),t.cornerHeaderGroup.setAttribute("width",t.cornerHeaderGroup.attribute.width-i.attribute.width))}function OB(t){const e=t.bottomFrozenGroup.firstChild instanceof S_?t.bottomFrozenGroup.firstChild:null;e&&(t.leftBottomCornerGroup.appendChild(e),t.leftBottomCornerGroup.setAttribute("width",t.leftBottomCornerGroup.attribute.width+e.attribute.width),t.bottomFrozenGroup.setAttribute("width",t.bottomFrozenGroup.attribute.width-e.attribute.width),t.table.isPivotChart()&&e.forEachChildren((t=>{t.setAttributes({stroke:!1,fill:!1})})))}function DB(t){var e;const i=t.leftBottomCornerGroup.lastChild instanceof S_?t.leftBottomCornerGroup.lastChild:null===(e=t.leftBottomCornerGroup.lastChild)||void 0===e?void 0:e._prev;i&&(WB(t.bottomFrozenGroup,i,t.bottomFrozenGroup.firstChild),t.bottomFrozenGroup.setAttribute("width",t.bottomFrozenGroup.attribute.width+i.attribute.width),t.leftBottomCornerGroup.setAttribute("width",t.leftBottomCornerGroup.attribute.width-i.attribute.width),t.table.isPivotChart()&&i.forEachChildren((e=>{var i,o,n,r;const s=t.table._getCellStyle(e.col,e.row),l=t.table.getCellRange(e.col,e.row),a=e_(s,t.table,l?l.start.col:e.col,l?l.start.row:e.row,R_).theme;e.setAttributes({fill:null!==(o=null===(i=null==a?void 0:a.group)||void 0===i?void 0:i.fill)&&void 0!==o?o:void 0,stroke:null!==(r=null===(n=null==a?void 0:a.group)||void 0===n?void 0:n.stroke)&&void 0!==r?r:void 0})})))}function WB(t,e,i){e&&t&&(i?t.insertBefore(e,i):t.appendChild(e))}function NB(t){var e;for(let i=t.proxy.colStart;i<=t.proxy.colEnd;i++){const o=t.getColGroup(i);null===(e=null==o?void 0:o.getChildren())||void 0===e||e.forEach((t=>{t.children.forEach((t=>{"chart"===t.type&&(t.cacheCanvas=null,t.addUpdateBoundTag())}))}))}}function GB(t,e,i){return new S_({x:0,y:0,width:t,height:e,clip:null!=i&&i,pickable:!1})}function jB(t,e){return t.forEachChildrenSkipChild(((t,i)=>{t.setAttribute("x",e),e+=t.attribute.width})),e}function VB(t,e,i,o,n){const r=t.name;XB(i,o,(t=>t.name===r),(t=>{L_(e,t),t.name=e.name}),n),n.updateNextFrame()}function UB(t,e,i,o,n,r,s,l){const a=l.table.internalProps.headerHelper.getSortIcon(o,l.table,t,e);if(i&&VB(i,a,t,e,l),!function(t,e,i,o,n){const r=n.getCellRange(t,e),s=n.getCellRange(i,o);return r.start.col===s.start.col&&r.start.row===s.start.row&&r.end.col===s.end.col&&r.end.row===s.end.row}(t,e,n,r,l.table)){const t=l.table.internalProps.headerHelper.getSortIcon("normal",l.table,n,r);s?VB(s,t,n,r,l):function(t,e,i,o){const n=o.getCell(t,e);if(Q(n.mergeStartCol)&&Q(n.mergeStartRow)&&Q(n.mergeEndCol)&&Q(n.mergeEndRow))for(let t=n.mergeStartCol;t<=n.mergeEndCol;t++)for(let e=n.mergeStartRow;e<=n.mergeEndRow;e++){let n;o.getCell(t,e).forEachChildren((t=>"sort"===t.attribute.funcType&&(n=t,!0))),n&&(L_(i,n),n.name=i.name)}else{let t;n.forEachChildren((e=>"sort"===e.attribute.funcType&&(t=e,!0))),t&&(L_(i,t),t.name=i.name)}}(n,r,t,l)}}function $B(t,e,i){t.forEachChildren((t=>{"group"===t.type?$B(t,e,i):e(t)&&i(t)}))}function XB(t,e,i,o,n){const r=n.getCell(t,e);if("cell"===r.role&&Q(r.mergeStartCol)&&Q(r.mergeStartRow)&&Q(r.mergeEndCol)&&Q(r.mergeEndRow)){const{colStart:t,colEnd:e,rowStart:s,rowEnd:l}=vS(r,n);for(let r=t;r<=e;r++)for(let t=s;t<=l;t++)$B(n.highPerformanceGetCell(r,t),i,o)}else $B(r,i,o)}function YB(t,e){const{bgColor:i,borderColor:o,borderLineWidth:n,borderLineDash:r}=e,s={x:0,y:0,width:0,height:0,visible:!1,pickable:!0,fill:i};return s.stroke=US(o,void 0),s.lineWidth=n,r&&(s.lineDash=r),s.lineCap="butt",Array.isArray(o)&&(s.strokeArrayColor=vx(o)),Array.isArray(n)&&(s.strokeArrayWidth=vx(n),s.lineWidth=1),t.setAttributes(s),t.role="corner-frozen",t}function KB(t,e,i,o){const n=o.scenegraph,r=qB(t.map((t=>t.col))).sort(((t,e)=>e-t)),s=qB(e.map((t=>t.col))).sort(((t,e)=>t-e)),l=qB(i.map((t=>t.col))).sort(((t,e)=>t-e));r.forEach((t=>{!function(t,e){const i=e.proxy;if(t>=e.table.rowHeaderLevelCount)if(t>=e.table.colCount-e.table.rightFrozenColCount);else{const i=e.getColGroup(t,!1);i&&i.parent===e.bodyGroup&&e.bodyGroup.removeChild(i);const o=e.getColGroupInBottom(t);o&&o.parent===e.bottomFrozenGroup&&e.bottomFrozenGroup.removeChild(o)}t>=i.colStart&&t<=i.colEnd&&(i.colEnd--,i.currentCol--),i.bodyRightCol--;const o=Math.min(i.colLimit,i.bodyRightCol-i.bodyLeftCol+1);i.totalActualBodyColCount=o,i.totalCol=i.colStart+o-1}(t,n)}));const a=o.colWidthsMap;let h;if(r.forEach((t=>{a.delAndReorder(t)})),r.length&&ZB(n),n.table._clearColRangeWidthsMap(),s.forEach((t=>{const e=function(t,e){const i=e.proxy;i.bodyRightCol++;const o=Math.min(i.colLimit,i.bodyRightCol-i.bodyLeftCol+1);if(i.totalActualBodyColCount=o,i.totalCol=i.colStart+o-1,!(t<i.colStart))return t>i.colEnd?i.colEnd-i.colStart+1<i.colLimit?(i.colEnd++,i.currentCol++,JB(t,e),t):void 0:i.colEnd-i.colStart+1<i.colLimit?(i.colEnd++,i.currentCol++,JB(t,e),t):t}(t,n);ZB(n),h=null!=h?h:e,a.addAndReorder(t)})),function(t){let e=t.bodyColStart,i=t.getCellGroupX(e);function o(i){i.col=e;const o=jw(t.table,i.col,i.row);o&&(i.mergeStartCol=o.start.col,i.mergeStartCol=o.start.col,i.mergeEndCol=o.end.col,i.mergeEndCol=o.end.col),i.role}t.bodyGroup.forEachChildren((t=>{t.col=e,null==t||t.forEachChildren((t=>{o(t)})),t.setAttribute("x",i),i+=t.attribute.width,e++})),e=t.bodyColStart,i=t.getCellGroupX(e),t.colHeaderGroup.forEachChildren((t=>{t.col=e,null==t||t.forEachChildren((t=>{o(t)})),t.setAttribute("x",i),i+=t.attribute.width,e++})),e=t.bodyColStart,i=t.getCellGroupX(e),t.bottomFrozenGroup.forEachChildren((t=>{t.col=e,null==t||t.forEachChildren((t=>{o(t)})),t.setAttribute("x",i),i+=t.attribute.width,e++})),e=t.table.colCount-t.table.rightFrozenColCount,i=0,t.rightFrozenGroup.forEachChildren((t=>{t.col=e,null==t||t.forEachChildren((t=>{o(t)})),t.setAttribute("x",i),i+=t.attribute.width,e++})),e=t.table.colCount-t.table.rightFrozenColCount,i=0,t.rightTopCornerGroup.forEachChildren((t=>{t.col=e,null==t||t.forEachChildren((t=>{o(t)})),t.setAttribute("x",i),i+=t.attribute.width,e++})),e=t.table.colCount-t.table.rightFrozenColCount,i=0,t.rightBottomCornerGroup.forEachChildren((t=>{t.col=e,null==t||t.forEachChildren((t=>{o(t)})),t.setAttribute("x",i),i+=t.attribute.width,e++}))}(n),l.forEach((t=>{for(let e=0;e<o.rowCount;e++){const i=jw(n.table,t,e);if(i)for(let t=i.start.col;t<=i.end.col;t++)for(let t=i.start.col;t<=i.end.col;t++)X_(t,e,n.table,!1);else X_(t,e,n.table,!1)}})),at(h)){for(let t=h;t<o.colCount;t++)for(let e=0;e<o.rowCount;e++){const i=n.highPerformanceGetCell(t,e,!0);i&&(i.needUpdate=!0)}n.proxy.colUpdatePos=h}if(s.length){if(!at(h)){const t=Math.min(...s);n.proxy.colUpdatePos=t}n.proxy.colUpdateDirection="left",n.proxy.updateColGroups(2*n.proxy.screenColCount),c(),n.proxy.progress()}else r.length&&(n.proxy.updateColGroups(2*n.proxy.screenColCount),c(),n.proxy.progress());const d=o.getColsWidth(o.frozenColCount,o.colCount-1);function c(){if((null==s?void 0:s[(null==s?void 0:s.length)-1])>=o.colCount-o.rightFrozenColCount||(null==l?void 0:l[(null==l?void 0:l.length)-1])>=o.colCount-o.rightFrozenColCount||(null==r?void 0:r[0])>=o.colCount-o.rightFrozenColCount){for(let t=o.colCount-o.rightFrozenColCount;t<o.colCount;t++)for(let e=0;e<o.rowCount;e++){const i=n.highPerformanceGetCell(t,e,!0);i&&(i.needUpdate=!0)}n.proxy.updateRightFrozenCellGroups()}}n.updateContainerWidth(n.table.frozenColCount,d-n.bodyGroup.attribute.width)}function qB(t){const e=[];for(let i=0;i<t.length;i++)-1===e.indexOf(t[i])&&e.push(t[i]);return e}function ZB(t){let e=t.bodyColStart;function i(i){i.col=e;const o=jw(t.table,i.col,i.row);o&&(i.mergeStartCol=o.start.col,i.mergeStartCol=o.start.col,i.mergeEndCol=o.end.col,i.mergeEndCol=o.end.col),i.role}t.bodyGroup.forEachChildren((t=>{t.col=e,null==t||t.forEachChildren((t=>{i(t)})),e++})),e=t.bodyColStart,t.colHeaderGroup.forEachChildren((t=>{t.col=e,null==t||t.forEachChildren((t=>{i(t)})),e++})),e=t.bodyColStart,t.bottomFrozenGroup.forEachChildren((t=>{t.col=e,null==t||t.forEachChildren((t=>{i(t)})),e++}))}function JB(t,e){if(e.colHeaderGroup&&e.table.columnHeaderLevelCount>0){const o=new S_({x:0,y:0,width:e.table.getColWidth(t),height:0,clip:!1,pickable:!1});o.role="column",o.col=t;const n=e.getColGroup(t,!0);n?e.colHeaderGroup.insertBefore(o,n):e.colHeaderGroup.appendChild(o),i(o,t,0,e.table.columnHeaderLevelCount-1)}if(e.bodyGroup){const o=new S_({x:0,y:0,width:e.table.getColWidth(t),height:0,clip:!1,pickable:!1});o.role="column",o.col=t;const n=e.getColGroup(t,!1);n?e.bodyGroup.insertBefore(o,n):e.bodyGroup.appendChild(o),i(o,t,e.bodyRowStart,e.bodyRowEnd)}if(e.bottomFrozenGroup&&e.table.bottomFrozenRowCount>0){const o=new S_({x:0,y:0,width:e.table.getColWidth(t),height:0,clip:!1,pickable:!1});o.role="column",o.col=t;const n=e.getColGroupInBottom(t);n?e.bottomFrozenGroup.insertBefore(o,n):e.bottomFrozenGroup.appendChild(o),i(o,t,e.table.rowCount-e.table.bottomFrozenRowCount,e.table.rowCount-1)}function i(t,i,o,n){for(let r=o;r<=n;r++){const o=new S_({x:0,y:0,width:e.table.getColWidth(i),height:e.table.getRowHeight(r)});o.role="cell",o.col=i,o.row=r,o.needUpdate=!0,t.appendChild(o)}}}Yy(),Qo.load(zA),Qo.load(oS);function QB(t,e,i){const o=t.highPerformanceGetCell(e,i);if("cell"===o.role&&Q(o.mergeStartCol)&&Q(o.mergeStartRow)&&Q(o.mergeEndCol)&&Q(o.mergeEndRow)){const{colStart:e,colEnd:i,rowStart:n,rowEnd:r}=vS(o,t);for(let o=e;o<=i;o++)for(let e=n;e<=r;e++)t.highPerformanceGetCell(o,e).addUpdateBoundTag()}else o.addUpdateBoundTag()}function tR(t,e,i,o,n){const r=t.table;for(let i=0;i<r.columnHeaderLevelCount;i++)QB(t,e,i);const s=t.getColGroup(e);return null==s||s.addUpdateBoundTag(),!0}function eR(t,e,i,o,n,r){const s=t.table;for(let i=0;i<s.columnHeaderLevelCount;i++)QB(t,e,i);const l=t.getColGroup(e);return null==l||l.addUpdateBoundTag(),!0}function iR(t,e,i,o,n){const r=t.table;for(let e=0;e<r.colCount;e++)QB(t,e,i);return!0}function oR(t,e,i,o,n,r){const s=t.table;for(let e=0;e<s.colCount;e++)QB(t,e,i);return!0}function nR(t,e,i){const{table:o}=t,{scenegraph:n}=o,{highlightScope:r,singleStyle:s,disableHeader:l,cellPos:a,cellPosContainHeader:h}=t.hover,d=a.col,c=a.row;if(r===qy.none||l&&(h.col!==e||h.row!==i)){const t=h.col,o=h.row;n.hideHoverIcon(t,o),n.showHoverIcon(e,i),h.col=e,h.row=i}if((l&&o.isHeader(e,i)||r===qy.none)&&(e=-1,i=-1),d===e&&c===i)return;n.deactivateChart(d,c),n.activateChart(e,i);let u=!1;const{ranges:g,highlightScope:p}=t.select;if(-1!==d&&-1!==c&&(u=function(t,e,i,o,n,r,s){let l=!1;return r===qy.single?l=!!function(t,e,i,o,n){return QB(t,e,i),!0}(t,e,i):r===qy.row?l=!!iR(t,0,i):r===qy.column?l=!!tR(t,e):r===qy.cross&&(l=!!iR(t,0,i),l=!!tR(t,e)),l}(n,d,c,0,0,r),l||n.hideHoverIcon(d,c)),-1===e||-1===i)return a.col=-1,a.row=-1,void(!u||d===e&&c===i||t.table.scenegraph.updateNextFrame());r===qy.single?u=!!function(t,e,i,o,n){return QB(t,e,i),!0}(n,e,i):r===qy.row?u=!!oR(n,0,i):r===qy.column?u=!!eR(n,e):r===qy.cross&&(u=!!oR(n,0,i),u=!!eR(n,e)),r===qy.none||l||n.showHoverIcon(e,i),a.col=e,a.row=i,u&&t.table.scenegraph.updateNextFrame()}function rR(t,e,i,o){var n;let r,s=null,l=!1;if(Array.isArray(i.sortState))for(let o=0;o<i.sortState.length&&(r=i.sortState[o],r&&(s=i._getHeaderCellBySortState(r)),s&&(l=sR(t,e,s.col,s.row,i)),!l);o++);else r=i.sortState,r&&(s=i._getHeaderCellBySortState(r)),s&&(l=sR(t,e,s.col,s.row,i));const a=i.getHeaderDefine(t,e);if(r&&l&&(null==a?void 0:a.sort)?r.order="asc"===r.order?"desc":"desc"===r.order?"normal":"asc":(null==a?void 0:a.sort)?r={field:i.getHeaderField(t,e),order:"asc"}:l&&(null==a?void 0:a.showSort)||(r={field:i.getHeaderField(t,e),order:"normal"}),r.event=o,i.fireListeners(cw.SORT_CLICK,r).includes(!1))return;i.internalProps.sortState=r,i.stateManager.setSortState(r),(null==a?void 0:a.sort)&&function(t,e,i){const o=e.internalProps.layoutMap.headerObjects.find((e=>e&&e.field===t.field));if(!o)return;const{field:n}=o;null!==n&&("function"==typeof i.sort?e.dataSource.sort(n,t.order||"asc",i.sort):e.dataSource.sort(n,t.order||"asc",DC))}(r,i,a),i.internalProps.useOneRowHeightFillAll=!1,i.internalProps.layoutMap.clearCellRangeMap(),i.scenegraph.sortCell();const h=!!(null===(n=i.stateManager.select.ranges)||void 0===n?void 0:n.length);i.stateManager.updateSelectPos(-1,-1),i.stateManager.endSelectCells(!0,h)}function sR(t,e,i,o,n){return n._getLayoutCellId(t,e)===n._getLayoutCellId(i,o)}const lR=qC(cw,{PIVOT_SORT_CLICK:"pivot_sort_click",DRILLMENU_CLICK:"drillmenu_click"});function aR(t,e,i,o,n){for(let i=t;i<=e;i++)n._clearColRangeWidthsMap(i);for(let t=i;t<=o;t++)n._clearRowRangeHeightsMap(t)}function hR(t){var e;if(!t)return;const i=(null===(e=t.role)||void 0===e?void 0:e.startsWith("icon"))?t:"richtext"===t.type?t._currentHoverIcon:void 0;return i?"richtext"===t.type?{icon:i,position:{left:t.globalAABBBounds.x1+i.globalAABBBounds.x1,right:t.globalAABBBounds.x1+i.globalAABBBounds.x2,top:t.globalAABBBounds.y1+i.globalAABBBounds.y1,bottom:t.globalAABBBounds.y1+i.globalAABBBounds.y2,width:i.globalAABBBounds.x2-i.globalAABBBounds.x1,height:i.globalAABBBounds.y2-i.globalAABBBounds.y1},type:"richtext-icon"}:{icon:i,position:{left:i.globalAABBBounds.x1,right:i.globalAABBBounds.x2,top:i.globalAABBBounds.y1,bottom:i.globalAABBBounds.y2,width:i.globalAABBBounds.x2-i.globalAABBBounds.x1,height:i.globalAABBBounds.y2-i.globalAABBBounds.y1},type:"icon"}:void 0}function dR(t,e){"adaptive"===e.table.widthMode&&e.columnResize.col<e.table.colCount-1?(e.table.scenegraph.updateColWidth(e.columnResize.col,t),e.table.scenegraph.updateColWidth(e.columnResize.col+1,-t),e.table.internalProps._widthResizedColMap.add(e.columnResize.col),e.table.internalProps._widthResizedColMap.add(e.columnResize.col+1)):(e.table.scenegraph.updateColWidth(e.columnResize.col,t),e.table.internalProps._widthResizedColMap.add(e.columnResize.col))}function cR(t,e){"adaptive"===e.table.heightMode&&e.rowResize.row<e.table.colCount-1?(e.table.scenegraph.updateRowHeight(e.rowResize.row,t),e.table.scenegraph.updateRowHeight(e.rowResize.row+1,-t),e.table.internalProps._heightResizedRowMap.add(e.rowResize.row),e.table.internalProps._heightResizedRowMap.add(e.rowResize.row+1)):(e.table.scenegraph.updateRowHeight(e.rowResize.row,t),e.table.internalProps._heightResizedRowMap.add(e.rowResize.row))}qC(cw,{VCHART_EVENT_TYPE:"vchart_event_type"});function uR(t){if(t.eventManager.bindSparklineHoverEvent)return;let e=!1;e=t.isPivotTable()?t.internalProps.layoutMap.indicatorsDefine.some((t=>"string"!=typeof t&&"sparkline"===t.cellType)):t.internalProps.layoutMap.columnObjects.some((t=>"sparkline"===t.cellType||"function"==typeof t.cellType)),e&&(t.eventManager.bindSparklineHoverEvent=!0,t.on(cw.MOUSEMOVE_CELL,(e=>{const{col:i,row:o,x:n,y:r}=e;"sparkline"!==t.getBodyColumnType(i,o)&&t.stateManager.updateSparklineHoverPose(-1,-1,0,0),t.stateManager.updateSparklineHoverPose(i,o,n,r)})),t.on(cw.MOUSELEAVE_TABLE,(e=>{t.stateManager.updateSparklineHoverPose(-1,-1,0,0)})))}function gR(t){const e=t.table,i=e.stateManager;e.scenegraph.tableGroup.addEventListener("pointermove",(o=>{var n,r,s,l,a,h,d,c,u,g,p,f,m,b,v;const y=null!==(r=null===(n=e.eventManager.LastPointerXY)||void 0===n?void 0:n.x)&&void 0!==r?r:o.x,C=null!==(l=null===(s=e.eventManager.LastPointerXY)||void 0===s?void 0:s.y)&&void 0!==l?l:o.y;e.eventManager.LastPointerXY={x:o.x,y:o.y},t.touchSetTimeout&&(clearTimeout(t.touchSetTimeout),t.touchSetTimeout=void 0);const w=l_(o);if(i.interactionState===Ky.grabing&&!(null===(a=e.editorManager)||void 0===a?void 0:a.editingEditor))return void(Math.abs(y-o.x)+Math.abs(C-o.y)>=1&&(i.isResizeCol()||(i.isMoveCol()?t.dealColumnMover(w):i.isFillHandle()?t.dealFillSelect(w,!0):t.dealTableSelect(w,!0))));e.eventManager.isDraging&&i.isSelecting()&&!(null===(h=e.editorManager)||void 0===h?void 0:h.editingEditor)&&t.dealTableSelect(w,!0);const x=o.path.find((t=>"cell"===t.role));if(e.hasListeners(cw.MOUSELEAVE_CELL)&&(-1===e.stateManager.hover.cellPos.col||-1===e.stateManager.hover.cellPos.row||(null==x?void 0:x.col)===e.stateManager.hover.cellPos.col&&(null==x?void 0:x.row)===e.stateManager.hover.cellPos.row||e.fireListeners(cw.MOUSELEAVE_CELL,{col:e.stateManager.hover.cellPos.col,row:e.stateManager.hover.cellPos.row,cellRange:e.getCellRangeRelativeRect({col:e.stateManager.hover.cellPos.col,row:e.stateManager.hover.cellPos.row}),scaleRatio:e.canvas.getBoundingClientRect().width/e.canvas.offsetWidth,event:o.nativeEvent,target:null===(d=null==w?void 0:w.eventArgs)||void 0===d?void 0:d.target})),e.hasListeners(cw.MOUSEENTER_CELL)&&("cell"!==(null==x?void 0:x.role)||!Q(x.col)||!Q(x.row)||x.col===e.stateManager.hover.cellPos.col&&x.row===e.stateManager.hover.cellPos.row||x.col===(null===(c=e.stateManager.hover.cellPosContainHeader)||void 0===c?void 0:c.col)&&x.row===(null===(u=e.stateManager.hover.cellPosContainHeader)||void 0===u?void 0:u.row)||e.fireListeners(cw.MOUSEENTER_CELL,{col:x.col,row:x.row,cellRange:e.getCellRangeRelativeRect({col:x.col,row:x.row}),scaleRatio:e.canvas.getBoundingClientRect().width/e.canvas.offsetWidth,event:o.nativeEvent,target:null===(g=null==w?void 0:w.eventArgs)||void 0===g?void 0:g.target,mergeCellInfo:null===(p=w.eventArgs)||void 0===p?void 0:p.mergeInfo})),t.dealIconHover(w),t.dealTableHover(w),w.eventArgs&&e.hasListeners(cw.MOUSEMOVE_CELL)){let t,i;if(null===(f=w.eventArgs)||void 0===f?void 0:f.target){const e=hR(null===(m=w.eventArgs)||void 0===m?void 0:m.target);e&&(t=e.icon,i=e.position)}e.fireListeners(cw.MOUSEMOVE_CELL,{col:w.eventArgs.col,row:w.eventArgs.row,x:w.abstractPos.x,y:w.abstractPos.y,event:o.nativeEvent,targetIcon:t?{name:t.name,position:i,funcType:t.attribute.funcType}:void 0,target:null===(b=null==w?void 0:w.eventArgs)||void 0===b?void 0:b.target,mergeCellInfo:null===(v=w.eventArgs)||void 0===v?void 0:v.mergeInfo})}})),e.scenegraph.tableGroup.addEventListener("pointerout",(e=>{var i;const o=l_(e),n=null===(i=null==o?void 0:o.eventArgs)||void 0===i?void 0:i.target;"table"===(null==n?void 0:n.role)&&t.dealTableHover()})),e.scenegraph.tableGroup.addEventListener("pointerover",(t=>{var i,o;const n=l_(t),r=null===(i=null==n?void 0:n.eventArgs)||void 0===i?void 0:i.target;if(r&&e.hasListeners(cw.MOUSEOVER_CHART_SYMBOL)&&"symbol"===r.type){const i=t.composedPath().find((t=>"cell"===t.roll));if(i){const{col:r,row:s}=i,l={col:r,row:s,field:e.getHeaderField(r,s),value:e.getCellValue(r,s),dataValue:e.getCellOriginValue(r,s),cellHeaderPaths:e.internalProps.layoutMap.getCellHeaderPaths(r,s),title:e.getBodyColumnDefine(r,s).title,cellRange:e.getCellRelativeRect(r,s),event:t.nativeEvent,sparkline:{pointData:void 0},scaleRatio:e.canvas.getBoundingClientRect().width/e.canvas.offsetWidth,target:null===(o=null==n?void 0:n.eventArgs)||void 0===o?void 0:o.target};e.fireListeners(cw.MOUSEOVER_CHART_SYMBOL,l)}}})),e.scenegraph.tableGroup.addEventListener("pointerenter",(t=>{(e.theme.scrollStyle.horizontalVisible&&"focus"===e.theme.scrollStyle.horizontalVisible||!e.theme.scrollStyle.horizontalVisible&&"focus"===e.theme.scrollStyle.visible)&&i.showHorizontalScrollBar(),(e.theme.scrollStyle.verticalVisible&&"focus"===e.theme.scrollStyle.verticalVisible||!e.theme.scrollStyle.verticalVisible&&"focus"===e.theme.scrollStyle.visible)&&i.showVerticalScrollBar(),e.hasListeners(cw.MOUSEENTER_TABLE)&&e.fireListeners(cw.MOUSEENTER_TABLE,{event:t.nativeEvent})})),e.scenegraph.tableGroup.addEventListener("pointerleave",(o=>{i.isResizeCol()||i.isMoveCol()||i.isSelecting()||(i.updateInteractionState(Ky.default),i.updateCursor()),(e.theme.scrollStyle.horizontalVisible&&"focus"===e.theme.scrollStyle.horizontalVisible||!e.theme.scrollStyle.horizontalVisible&&"focus"===e.theme.scrollStyle.visible)&&i.hideHorizontalScrollBar(),(e.theme.scrollStyle.verticalVisible&&"focus"===e.theme.scrollStyle.verticalVisible||!e.theme.scrollStyle.verticalVisible&&"focus"===e.theme.scrollStyle.visible)&&i.hideVerticalScrollBar(),e.hasListeners(cw.MOUSELEAVE_CELL)&&-1!==e.stateManager.hover.cellPos.col&&-1!==e.stateManager.hover.cellPos.row&&e.fireListeners(cw.MOUSELEAVE_CELL,{col:e.stateManager.hover.cellPos.col,row:e.stateManager.hover.cellPos.row,cellRange:e.getCellRangeRelativeRect({col:e.stateManager.hover.cellPos.col,row:e.stateManager.hover.cellPos.row}),scaleRatio:e.canvas.getBoundingClientRect().width/e.canvas.offsetWidth,event:o.nativeEvent,target:void 0}),t.dealTableHover();const n=o.target;n&&!n.isDescendantsOf(e.scenegraph.tableGroup)&&e.fireListeners(cw.MOUSELEAVE_TABLE,{event:o.nativeEvent})})),e.scenegraph.tableGroup.addEventListener("pointerupoutside",(o=>{var n,r,s,l,a,h,d,c,u;const g=l_(o);if(i.menu.isShow&&(null===(n=g.eventArgs)||void 0===n?void 0:n.target)!==(null===(r=i.residentHoverIcon)||void 0===r?void 0:r.icon)&&setTimeout((()=>{e.internalProps.menuHandler.pointInMenuElement(o.page.x,o.page.y)||i.menu.isShow&&i.hideMenu()}),0),i.isResizeCol())fR(e);else if(i.isResizeRow())mR(e);else if(i.isMoveCol())e.stateManager.endMoveCol(),-1!==(null===(s=e.stateManager.columnMove)||void 0===s?void 0:s.colSource)&&-1!==(null===(l=e.stateManager.columnMove)||void 0===l?void 0:l.rowSource)&&-1!==(null===(a=e.stateManager.columnMove)||void 0===a?void 0:a.colTarget)&&-1!==(null===(h=e.stateManager.columnMove)||void 0===h?void 0:h.rowTarget)&&e.hasListeners(cw.CHANGE_HEADER_POSITION)&&e.fireListeners(cw.CHANGE_HEADER_POSITION,{target:{col:e.stateManager.columnMove.colTarget,row:e.stateManager.columnMove.rowTarget},source:{col:e.stateManager.columnMove.colSource,row:e.stateManager.columnMove.rowSource}});else if(i.isSelecting()&&(null===(c=null===(d=e.stateManager.select)||void 0===d?void 0:d.ranges)||void 0===c?void 0:c.length)){const t=e.stateManager.select.ranges[e.stateManager.select.ranges.length-1].end.col,i=e.stateManager.select.ranges[e.stateManager.select.ranges.length-1].end.row;if(e.stateManager.endSelectCells(),e.hasListeners(cw.DRAG_SELECT_END)){const n={event:o.nativeEvent,cells:[],col:t,row:i,scaleRatio:e.canvas.getBoundingClientRect().width/e.canvas.offsetWidth,target:void 0};n.cells=e.getSelectedCellInfos(),e.fireListeners(cw.DRAG_SELECT_END,n)}}ew(null===(u=e.editorManager)||void 0===u?void 0:u.completeEdit(o.nativeEvent),(o=>{var n,r;if(!1!==o&&(i.updateInteractionState(Ky.default),t.dealTableHover(),null===(n=e.options.select)||void 0===n?void 0:n.outsideClickDeselect)){const e=!!(null===(r=i.select.ranges)||void 0===r?void 0:r.length);t.dealTableSelect(),i.endSelectCells(!0,e)}}))})),e.scenegraph.tableGroup.addEventListener("pointerdown",(o=>{var n,r,s,l;if(e.hasListeners(cw.MOUSEDOWN_TABLE)&&e.fireListeners(cw.MOUSEDOWN_TABLE,{event:o.nativeEvent}),e.eventManager.isDown=!0,e.eventManager.LastBodyPointerXY={x:o.x,y:o.y},e.eventManager.LastPointerXY={x:o.x,y:o.y},0!==o.button)return;const a=l_(o);if(t.downIcon=void 0,i.interactionState!==Ky.default)return;e.isPivotChart()&&"chart"!==(null===(n=null==a?void 0:a.eventArgs)||void 0===n?void 0:n.target.type)&&e.scenegraph.updateChartState(null),(null===(r=a.eventArgs)||void 0===r?void 0:r.target)!==(null===(s=i.residentHoverIcon)||void 0===s?void 0:s.icon)&&i.hideMenu();ew(null===(l=e.editorManager)||void 0===l?void 0:l.completeEdit(o.nativeEvent),(n=>{var r,s,l,h,d;if(!1===n)return;const c=(null===(l=null===(s=null===(r=null==a?void 0:a.eventArgs)||void 0===r?void 0:r.target)||void 0===s?void 0:s.role)||void 0===l?void 0:l.startsWith("icon"))?a.eventArgs.target:(null===(h=o.target.role)||void 0===h?void 0:h.startsWith("icon"))?o.target:void 0;if(t.downIcon=c,c&&!1!==c.attribute.interactive)c.attribute.funcType===iC.dragReorder&&(i.startMoveCol(a.eventArgs.col,a.eventArgs.row,a.abstractPos.x,a.abstractPos.y),i.updateInteractionState(Ky.grabing));else if("touch"===o.pointerType)t.touchEnd=!1,t.touchSetTimeout=setTimeout((()=>{t.isTouchdown=!1,t.touchMove=!0,(!t.touchEnd&&(t.checkColumnResize(a,!0)||t.checkRowResize(a,!0))||!t.touchEnd&&t.chechColumnMover(a)||t.dealTableSelect(a)&&!t.touchEnd)&&i.updateInteractionState(Ky.grabing)}),500),t.dealTableHover(a);else{if(!t.checkCellFillhandle(a)&&(t.checkColumnResize(a,!0)||t.checkRowResize(a,!0)))return e.scenegraph.updateChartState(null),void i.updateInteractionState(Ky.grabing);if(t.chechColumnMover(a))return void i.updateInteractionState(Ky.grabing);if(t.checkCellFillhandle(a,!0)&&t.dealFillSelect(a))return void i.updateInteractionState(Ky.grabing);t.dealTableSelect(a)&&i.updateInteractionState(Ky.grabing)}if(e.hasListeners(cw.MOUSEDOWN_CELL)){const t=l_(o);t.eventArgs&&e.fireListeners(cw.MOUSEDOWN_CELL,{col:t.eventArgs.col,row:t.eventArgs.row,event:o.nativeEvent,target:null===(d=null==t?void 0:t.eventArgs)||void 0===d?void 0:d.target,mergeCellInfo:t.eventArgs.mergeInfo})}}))})),e.scenegraph.tableGroup.addEventListener("pointerup",(t=>{var o,n,r,s;if(0===t.button){if("grabing"===i.interactionState){if(i.updateInteractionState(Ky.default),i.isResizeCol())fR(e);else if(i.isResizeRow())mR(e);else if(i.isMoveCol()){const i=l_(t);e.stateManager.endMoveCol(),i.eventArgs&&e.hasListeners(cw.CHANGE_HEADER_POSITION)&&e.fireListeners(cw.CHANGE_HEADER_POSITION,{target:{col:i.eventArgs.col,row:i.eventArgs.row},source:{col:e.stateManager.columnMove.colSource,row:e.stateManager.columnMove.rowSource}})}else if(i.isSelecting()){e.stateManager.endSelectCells(),e.stateManager.isFillHandle()&&e.stateManager.endFillSelect();const i=l_(t);if(e.eventManager.isDraging&&i.eventArgs&&e.hasListeners(cw.DRAG_SELECT_END)){const r={event:t.nativeEvent,cells:[],col:i.eventArgs.target.col,row:i.eventArgs.target.row,scaleRatio:e.canvas.getBoundingClientRect().width/e.canvas.offsetWidth,target:null===(o=null==i?void 0:i.eventArgs)||void 0===o?void 0:o.target,mergeCellInfo:null===(n=i.eventArgs)||void 0===n?void 0:n.mergeInfo};r.cells=e.getSelectedCellInfos(),e.fireListeners(cw.DRAG_SELECT_END,r)}}}else i.interactionState===Ky.scrolling&&i.updateInteractionState(Ky.default);if(e.hasListeners(cw.MOUSEUP_CELL)){const i=l_(t);i.eventArgs&&e.fireListeners(cw.MOUSEUP_CELL,{col:i.eventArgs.col,row:i.eventArgs.row,event:t.nativeEvent,target:null===(r=null==i?void 0:i.eventArgs)||void 0===r?void 0:r.target,mergeCellInfo:null===(s=i.eventArgs)||void 0===s?void 0:s.mergeInfo})}}})),e.scenegraph.tableGroup.addEventListener("rightdown",(t=>{var o,n,r,s;const l=l_(t);if(l.eventArgs){i.triggerContextMenu(l.eventArgs.col,l.eventArgs.row,l.abstractPos.x,l.abstractPos.y);const{col:a,row:h}=l.eventArgs;if(e.hasListeners(cw.CONTEXTMENU_CELL)){const i=e.getCellInfo(a,h);let d,c;if(null===(o=l.eventArgs)||void 0===o?void 0:o.target){const t=hR(null===(n=l.eventArgs)||void 0===n?void 0:n.target);t&&(d=t.icon,c=t.position)}const u=Object.assign(Object.assign({},i),{event:t.nativeEvent,cells:[],targetIcon:d?{name:d.name,position:c,funcType:d.attribute.funcType}:void 0,target:null===(r=null==l?void 0:l.eventArgs)||void 0===r?void 0:r.target,mergeCellInfo:null===(s=l.eventArgs)||void 0===s?void 0:s.mergeInfo});!function(t,e,i){for(let o=0;o<t.length;o++){const n=t[o],r=Math.min(n.start.col,n.end.col),s=Math.max(n.start.col,n.end.col),l=Math.min(n.start.row,n.end.row),a=Math.max(n.start.row,n.end.row);if(r<=e&&e<=s&&l<=i&&i<=a||s<=e&&e<=r&&a<=i&&i<=l)return!0}return!1}(e.stateManager.select.ranges,a,h)?u.cells=[[i]]:u.cells=e.getSelectedCellInfos(),e.fireListeners(cw.CONTEXTMENU_CELL,u)}}})),e.scenegraph.tableGroup.addEventListener("pointertap",(o=>{var n,r,s,l,a;if(e.stateManager.columnResize.resizing||e.stateManager.columnMove.moving)return;const h=l_(o);if(t.dealIconClick(o,h),null==h?void 0:h.eventArgs){if(t.touchSetTimeout&&"touch"===o.pointerType){const e=l_(o);if(t.touchSetTimeout){clearTimeout(t.touchSetTimeout);const o=!!(null===(n=i.select.ranges)||void 0===n?void 0:n.length);t.dealTableSelect(e),i.endSelectCells(!0,o),t.touchSetTimeout=void 0}}if(!t.touchMove&&0===o.button&&e.hasListeners(cw.CLICK_CELL)){const{col:t,row:i}=h.eventArgs,n=e.getCellInfo(t,i);let d,c;if(null===(r=h.eventArgs)||void 0===r?void 0:r.target){const t=hR(null===(s=h.eventArgs)||void 0===s?void 0:s.target);t&&(d=t.icon,c=t.position)}const u=Object.assign(Object.assign({},n),{event:o.nativeEvent,federatedEvent:o,cells:[],targetIcon:d?{name:d.name,position:c,funcType:d.attribute.funcType}:void 0,target:null===(l=null==h?void 0:h.eventArgs)||void 0===l?void 0:l.target,mergeCellInfo:null===(a=h.eventArgs)||void 0===a?void 0:a.mergeInfo});e.fireListeners(cw.CLICK_CELL,u)}}})),e.scenegraph.stage.addEventListener("pointerdown",(o=>{var n,r,s;const l=l_(o);(null===(n=l.eventArgs)||void 0===n?void 0:n.target)!==(null===(r=i.residentHoverIcon)||void 0===r?void 0:r.icon)&&i.hideMenu();ew(null===(s=e.editorManager)||void 0===s?void 0:s.completeEdit(o.nativeEvent),(n=>{var r;if(!1===n)return;const s=(null===(r=o.target.role)||void 0===r?void 0:r.startsWith("icon"))?o.target:void 0;if(t.downIcon=s,s||t.checkCellFillhandle(l)||i.columnResize.resizing||!t.checkColumnResize(l,!0));else{e.scenegraph.updateChartState(null),i.updateInteractionState(Ky.grabing);const{eventArgs:t}=l;(null==t?void 0:t.targetCell)||e.getCellAt(l.abstractPos.x-8,l.abstractPos.y)&&e.hasListeners(cw.MOUSEDOWN_TABLE)&&e.fireListeners(cw.MOUSEDOWN_TABLE,{event:o.nativeEvent})}}))})),e.scenegraph.stage.addEventListener("pointerup",(t=>{"grabing"===i.interactionState&&(i.updateInteractionState(Ky.default),i.isResizeCol()&&fR(e))})),e.scenegraph.stage.addEventListener("pointertap",(o=>{var n,r,s;const l=o.target;if(e.eventManager.isDraging||!l||!l.isDescendantsOf(e.scenegraph.stage)&&l.stage!==l||l.isDescendantsOf(e.scenegraph.tableGroup))e.eventManager.isDraging&&i.isSelecting()&&i.endSelectCells();else{i.updateInteractionState(Ky.default),t.dealTableHover();const o=!!(null===(n=i.select.ranges)||void 0===n?void 0:n.length);(null===(s=null===(r=e.options.select)||void 0===r?void 0:r.blankAreaClickDeselect)||void 0===s||s)&&t.dealTableSelect(),i.endSelectCells(!0,o),i.updateCursor(),e.scenegraph.updateChartState(null)}})),e.scenegraph.stage.addEventListener("pointermove",(o=>{const n=l_(o);i.isResizeCol()||t.checkColumnResize(n)?e.stateManager.select&&t.checkCellFillhandle(n)?i.updateCursor("crosshair"):i.updateCursor("col-resize"):i.isResizeRow()||t.checkRowResize(n)?e.stateManager.select&&t.checkCellFillhandle(n)?i.updateCursor("crosshair"):i.updateCursor("row-resize"):i.updateCursor()})),e.scenegraph.tableGroup.addEventListener("checkbox_state_change",(t=>{var i,o;const n=l_(t),{col:r,row:s}=n.eventArgs,l=e.getCellInfo(r,s),a=jw(e,r,s);if(a)for(let i=a.start.col;i<=a.end.col;i++)for(let o=a.start.row;o<=a.end.row;o++)e.scenegraph.getCell(i,o).forEachChildren((e=>{"checkbox"===e.name&&e.setAttributes({checked:t.target.attribute.checked,indeterminate:t.target.attribute.indeterminate})}));const h=Object.assign(Object.assign({},l),{event:t.nativeEvent,target:null===(i=null==n?void 0:n.eventArgs)||void 0===i?void 0:i.target,mergeCellInfo:null===(o=null==n?void 0:n.eventArgs)||void 0===o?void 0:o.mergeInfo,checked:t.detail.checked});if(e.isHeader(r,s))e.stateManager.setHeaderCheckedState(l.field,t.detail.checked),"checkbox"===e.getCellType(r,s)&&e.scenegraph.updateCheckboxCellState(r,s,t.detail.checked);else if(e.stateManager.setCheckedState(r,s,l.field,t.detail.checked),"checkbox"===e.getCellType(r,s)){const t=e.stateManager.headerCheckedState[l.field],i=e.stateManager.updateHeaderCheckedState(l.field);t!==i&&e.scenegraph.updateHeaderCheckboxCellState(r,s,i)}e.fireListeners(cw.CHECKBOX_STATE_CHANGE,h),e.scenegraph.updateNextFrame()})),e.scenegraph.tableGroup.addEventListener("radio_checked",(t=>{var i,o,n;const r=l_(t),{col:s,row:l,target:a}=r.eventArgs,h=e.getCellInfo(s,l),d=null===(i=d_.exec(a.id))||void 0===i?void 0:i[1],c=jw(e,s,l);if(c)for(let t=c.start.col;t<=c.end.col;t++)for(let i=c.start.row;i<=c.end.row;i++)e.scenegraph.getCell(t,i).forEachChildren((t=>{"radio"===t.name&&t.id===a.id&&t.setAttributes({checked:!0})}));const u=e.getBodyColumnDefine(s,l).radioCheckType||"column";if("cell"===u)if(c)for(let t=c.start.col;t<=c.end.col;t++)for(let i=c.start.row;i<=c.end.row;i++)e.scenegraph.getCell(t,i).forEachChildren((t=>{"radio"===t.name&&t.id!==a.id&&t.setAttributes({checked:!1})}));else e.scenegraph.getCell(s,l).forEachChildren((t=>{"radio"===t.name&&t.id!==a.id&&t.setAttributes({checked:!1})}));else"column"===u&&e.scenegraph.getColGroup(s).forEachChildren((t=>{t.forEachChildren((t=>{"radio"===t.name&&t.id!==a.id&&t.setAttributes({checked:!1})}))}));const g=d?Number(d):void 0;e.stateManager.setRadioState(s,l,h.field,u,g);const p=Object.assign(Object.assign({},h),{event:t.nativeEvent,target:null===(o=null==r?void 0:r.eventArgs)||void 0===o?void 0:o.target,mergeCellInfo:null===(n=null==r?void 0:r.eventArgs)||void 0===n?void 0:n.mergeInfo,radioIndexInCell:g});e.fireListeners(cw.RADIO_STATE_CHANGE,p),e.scenegraph.updateNextFrame()}))}function pR(t){const e=t.table;t.gesture=new Vg(e.scenegraph.tableGroup,{tap:{interval:300}}),t.gesture.on("doubletap",(t=>{!function(t,e){var i,o,n,r,s,l;const a=l_(t);let h=-1,d=-1;a.eventArgs&&(h=a.eventArgs.col,d=a.eventArgs.row);const c=e.getCellValue(h,d),u=null===(o=null===(i=a.eventArgs)||void 0===i?void 0:i.targetCell)||void 0===o?void 0:o.globalAABBBounds;if(u&&e.internalProps.focusControl.setFocusRect(new vw(u.x1+e.scrollLeft,u.y1+e.scrollTop,u.x2-u.x1,u.y2-u.y1),c),e.hasListeners(cw.DBLCLICK_CELL)){const i=e.getCellInfo(h,d);let o,c;if(null===(n=a.eventArgs)||void 0===n?void 0:n.target){const t=hR(null===(r=a.eventArgs)||void 0===r?void 0:r.target);t&&(o=t.icon,c=t.position)}const u=Object.assign(Object.assign({},i),{event:t.nativeEvent,federatedEvent:t,cells:[],targetIcon:o?{name:o.name,position:c,funcType:o.attribute.funcType}:void 0,target:null===(s=null==a?void 0:a.eventArgs)||void 0===s?void 0:s.target,mergeCellInfo:null===(l=null==a?void 0:a.eventArgs)||void 0===l?void 0:l.mergeInfo});e.fireListeners(cw.DBLCLICK_CELL,u)}}(t,e)}))}function fR(t){t.stateManager.endResizeCol();const e=[];for(let i=0;i<t.colCount;i++)e.push(t.getColWidth(i));t.fireListeners(cw.RESIZE_COLUMN_END,{col:t.stateManager.columnResize.col,colWidths:e})}function mR(t){t.stateManager.endResizeRow(),t.fireListeners(cw.RESIZE_ROW_END,{row:t.stateManager.rowResize.row,rowHeight:t.getRowHeight(t.stateManager.rowResize.row)})}function bR(t,e){let i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],{deltaX:o,deltaY:n}=t;t.shiftKey&&t.deltaY&&(o=n,n=0);const[r,s]=function(t,e,i){var o,n;const r=Math.abs(t/e),s=r<=.5?0:t,l=r>2?0:e;return[Math.ceil(s*(null!==(o=i.horizontal)&&void 0!==o?o:0)),Math.ceil(l*(null!==(n=i.vertical)&&void 0!==n?n:0))]}(o,n,{horizontal:1,vertical:1});(r||s)&&e.interactionState!==Ky.scrolling&&e.updateInteractionState(Ky.scrolling),r&&(e.setScrollLeft(e.scroll.horizontalBarPos+r),e.showHorizontalScrollBar(!0)),s&&(e.setScrollTop(e.scroll.verticalBarPos+s),e.showVerticalScrollBar(!0)),i&&e.resetInteractionState(),t.cancelable&&("none"===e.table.internalProps.overscrollBehavior||Math.abs(n)>=Math.abs(o)&&0!==n&&vR(n,e)||Math.abs(n)<=Math.abs(o)&&0!==o&&yR(o,e))&&t.preventDefault()}function vR(t,e){return 0!=e.table.getAllRowsHeight()-e.table.scenegraph.height&&!function(t,e){return 0!=e.table.getAllRowsHeight()-e.table.scenegraph.height&&t<=0&&e.scroll.verticalBarPos<1}(t,e)&&!function(t,e){var i;const o=(null===(i=e.table.options.customConfig)||void 0===i?void 0:i._disableColumnAndRowSizeRound)?1:0,n=e.table.getAllRowsHeight()-e.table.scenegraph.height;return 0!==n&&t>=0&&Math.abs(e.scroll.verticalBarPos-n)<1+o}(t,e)}function yR(t,e){return 0!=e.table.getAllColsWidth()-e.table.scenegraph.width&&!function(t,e){return 0!=e.table.getAllColsWidth()-e.table.scenegraph.width&&t<=0&&e.scroll.horizontalBarPos<1}(t,e)&&!function(t,e){var i;const o=(null===(i=e.table.options.customConfig)||void 0===i?void 0:i._disableColumnAndRowSizeRound)?1:0,n=e.table.getAllColsWidth()-e.table.scenegraph.width;return 0!==n&&t>=0&&Math.abs(e.scroll.horizontalBarPos-n)<1+o}(t,e)}class CR{constructor(t){this.stateManager=t}setScrollHandle(t){this.scrollHandle=t}startInertia(t,e,i){this.lastTime=Date.now(),this.speedX=t,this.speedY=e,this.friction=i,this.runingId||(this.runingId=requestAnimationFrame(this.inertia.bind(this)))}inertia(){var t;const e=Date.now(),i=e-this.lastTime;let o=!0;const n=Math.pow(this.friction,i/16),r=n*this.speedX,s=n*this.speedY;let l=0,a=0;Math.abs(r)>.05&&(o=!1,l=(this.speedX+r)/2*i),Math.abs(s)>.05&&(o=!1,a=(this.speedY+s)/2*i),null===(t=this.scrollHandle)||void 0===t||t.call(this,l,a),o?this.runingId=null:(this.lastTime=e,this.speedX=r,this.speedY=s,this.runingId=requestAnimationFrame(this.inertia.bind(this)))}endInertia(){cancelAnimationFrame(this.runingId),this.runingId=null}isInertiaScrolling(){return!!this.runingId}}let wR=1;function xR(){return NC?wR=1:(wR=Math.ceil(window.devicePixelRatio||1),wR>1&&wR%2!=0&&(wR+=1)),wR}function _R(t){return!!t.changedTouches}function SR(t,e,i){if(i.indicatorsAsCol){if(i.hasTwoIndicatorAxes&&e===i.columnHeaderLevelCount-1&&t>=i.rowHeaderLevelCount&&t<i.colCount-i.rightFrozenColCount)return"top";if(e===i.rowCount-i.bottomFrozenRowCount&&t>=i.rowHeaderLevelCount&&t<i.colCount-i.rightFrozenColCount)return"bottom";if(t===i.rowHeaderLevelCount-1&&e>=i.rowHeaderLevelCount&&e<i.rowCount-i.bottomFrozenRowCount)return"left"}else{if(t===i.rowHeaderLevelCount-1&&e>=i.columnHeaderLevelCount&&e<i.rowCount-i.bottomFrozenRowCount)return"left";if(t===i.colCount-i.rightFrozenColCount&&e>=i.columnHeaderLevelCount&&e<i.rowCount-i.bottomFrozenRowCount)return"right";if(e===i.rowCount-i.bottomFrozenRowCount&&t>=i.rowHeaderLevelCount&&t<i.colCount-i.rightFrozenColCount)return"bottom"}return"bottom"}xR();let AR;const BR=t=>{const e=t.value;return Number(e)>80?"#20a8d8":Number(e)>50?"#4dbd74":Number(e)>20?"#ffc107":"#f86c6b"};class RR extends cC{static get DEFAULT(){return AR||(AR=new RR)}constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};var e,i,o,n,r,s,l,a,h,d,c,u,g,p,f;super(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}),this._showBar=null===(e=t.showBar)||void 0===e||e,this._barColor=null!==(i=t.barColor)&&void 0!==i?i:BR,this._barPositiveColor=null!==(o=t.barPositiveColor)&&void 0!==o?o:"#4dbd74",this._barNegativeColor=null!==(n=t.barNegativeColor)&&void 0!==n?n:"#f86c6b",this._barAxisColor=null!==(r=t.barAxisColor)&&void 0!==r?r:"black",this._barBgColor=t.barBgColor,this._barHeight=null!==(s=t.barHeight)&&void 0!==s?s:3,this._barHeight=null!==(l=t.barHeight)&&void 0!==l?l:3,this._barBottom=null!==(a=t.barBottom)&&void 0!==a?a:0,this._barPadding=null!==(h=t.barPadding)&&void 0!==h?h:[0,0,0,0],this._showBarMark=null!==(d=t.showBarMark)&&void 0!==d&&d,this._barMarkPositiveColor=null!==(c=t.barMarkPositiveColor)&&void 0!==c?c:"#4dbd74",this._barMarkNegativeColor=null!==(u=t.barMarkNegativeColor)&&void 0!==u?u:"#f86c6b",this._barMarkWidth=null!==(g=t.barMarkWidth)&&void 0!==g?g:2,this._barMarkPosition=null!==(p=t.barMarkPosition)&&void 0!==p?p:"right",this._barRightToLeft=null!==(f=t.barRightToLeft)&&void 0!==f&&f}get showBar(){return this._showBar}set showBar(t){this._showBar=t}get barColor(){return this._barColor}set barColor(t){this._barColor=t}get barBgColor(){return this._barBgColor}set barBgColor(t){this._barBgColor=t}get barHeight(){return this._barHeight}set barHeight(t){this._barHeight=t}get barBottom(){return this._barBottom}set barBottom(t){this._barBottom=t}get barPositiveColor(){return this._barPositiveColor}set barPositiveColor(t){this._barPositiveColor=t}get barNegativeColor(){return this._barNegativeColor}set barNegativeColor(t){this._barNegativeColor=t}get barAxisColor(){return this._barAxisColor}set barAxisColor(t){this._barAxisColor=t}get barPadding(){return this._barPadding}set barPadding(t){this._barPadding=t}get showBarMark(){return this._showBarMark}set showBarMark(t){this._showBarMark=t}get barMarkPositiveColor(){return this._barMarkPositiveColor}set barMarkPositiveColor(t){this._barMarkPositiveColor=t}get barMarkNegativeColor(){return this._barMarkNegativeColor}set barMarkNegativeColor(t){this._barMarkNegativeColor=t}get barMarkWidth(){return this._barMarkWidth}set barMarkWidth(t){this._barMarkWidth=t}get barMarkPosition(){return this._barMarkPosition}set barMarkPosition(t){this._barMarkPosition=t}get barRightToLeft(){return this._barRightToLeft}set barRightToLeft(t){this._barRightToLeft=t}clone(){return new RR(this,null)}}const MR=["type","content","font","color","width","height","marginRight","marginLeft","src","svg","name","path","positionType","tooltip","hover","cursor","shape","interactive"];class TR{constructor(t){this._table=t;const e=__();this.expandIcon=e[oC.expandIconName],this.collapseIcon=e[oC.collapseIconName]}getIcons(t,e,i,o,n){const r=[],s=this.getHierarchyIcon(t,e);s&&r.push(s);const{icon:l}=this._table.getBodyColumnDefine(t,e);if(l){let n;n="function"==typeof l?l({col:t,row:e,value:i,dataValue:o,table:this._table}):l;const s=__(),a=t=>{let e;e="string"==typeof t?s[t]:t,e&&r.push(e)};Array.isArray(n)?n.forEach(((t,e)=>{a(t)})):a(n)}return n&&r.forEach(((i,o)=>{(i.content||i.src)&&(r[o]=this.getCellIconFromRecordValue(i,t,e))})),r}getStyleClass(t){switch(t){case"text":case"link":return gC;case"image":case"video":return uC;case"chart":case"sparkline":return cC;case"progressbar":return RR;case"checkbox":return mC;case"radio":return bC}return gC}getCellIconFromRecordValue(t,e,i){if(Array.isArray(t))return t.map((t=>this.getCellIconFromRecordValue(t,e,i)));if(!sw.isObject(t)||"function"==typeof t)return this._table.getFieldData(t,e,i);const o={},n=t;return MR.forEach((t=>{var r,s;if(void 0!==n[t]){const l=this._table.getFieldData(n[t],e,i);null!=l?o[t]=l:(null===(s=(r=this._table)._hasField)||void 0===s?void 0:s.call(r,n[t],e,i))||(o[t]=n[t])}})),o}getHierarchyIcon(t,e){const i=this._table.getHierarchyState(t,e);return i===Jy.expand?this.expandIcon:i===Jy.collapse?this.collapseIcon:void 0}getHierarchyIconWidth(){var t,e;return this.expandIcon.width+(null!==(t=this.expandIcon.marginLeft)&&void 0!==t?t:0)+(null!==(e=this.expandIcon.marginRight)&&void 0!==e?e:0)}}function kR(t,e){const i=document.createElement(t);return e&&i.classList.add(...e),i}!function(){if("node"===BC.mode)return;const t=document.createElement("style");t.id="vtable-menu-styleSheet",t.textContent="\n@keyframes vtable__menu-element--shown-animation {\n\t0% {\n\t\topacity: 0;\n\t}\n\t100% {\n\t\topacity: 1;\n\t}\n}\n.vtable__menu-element {\n\tposition: absolute;\n\tbox-sizing: border-box;\n\tborder-radius: 4px;\n\tbackground-color: #fff;\n\tpadding: 6px 0;\n\t/* pointer-events: none; */\n\tuser-select: none;\n\tcolor: #000;\n\tmax-width: 300px;\n\tz-index: 99999;\n\tborder: #CCC 0.5px solid;\n\tcursor: default;\n\twidth: max-content;\n\tbox-shadow: 0px 8px 16px rgba(27, 31, 35, 0.12);\n}\n.vtable__menu-element--hidden {\n\topacity: 0;\n\t/* transform: translate(-50%, -50%); */\n\ttransition: opacity 75ms linear;\n\tz-index: -9999;\n}\n.vtable__menu-element--shown {\n\topacity: 1;\n\t/* transform: translate(-50%, -50%); */\n\tanimation: vtable__menu-element--shown-animation 150ms ease-out;\n}\n.vtable__menu-element__content {\n\tfont-family: Roboto;\n\tfont-size: 12px;\n\toverflow: hidden;\n\tdisplay: inline-block;\n\t/* height: 100%; */\n\tline-height: 30px;\n}\n.vtable__menu-element__item {\n\theight: 32px;\n\tpadding: 0px 12px;\n\tcursor: pointer;\n\tposition: relative;\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: flex-start;\n}\n.vtable__menu-element__item:hover {\n\tbackground-color: rgba(27, 31, 35, 0.06);\n}\n.vtable__menu-element__icon{\n\t/* vertical-align: top; */\n\tdisplay: flex;\n\t/* line-height: 30px; */\n\tmargin-right: 6px;\n}\n.vtable__menu-element__no-event {\n\tpointer-events: none;\n}\n.vtable__menu-element--select {\n\tcolor: #2E68CF;\n}.vtable__menu-element--normal {\n\tcolor: rgba(20, 20, 20, 0.9);;\n}\n.vtable__menu-element__split {\n\theight: 0px;\n\tborder: 1px solid rgb(209, 213, 218);\n\tmargin: 5px 0;\n}\n.vtable__menu-element__title {\n\tcolor: rgb(149, 149, 149);\n}\n.vtable__menu-element__arrow {\n\tposition: absolute;\n\tright: 3px;\n\tfont-weight: bold;\n\tmargin-top: 1px;\n}\n.vtable__menu-element__item-text {\n\tmargin-right: 15px;\n}\n",document.head.appendChild(t)}();const PR="vtable__menu-element",ER=`${PR}__item`,LR=`${PR}__content`,HR=`${PR}--hidden`,zR=`${PR}--shown`,FR=`${PR}--normal`,IR=`${PR}--select`,OR=`${PR}__icon`,DR=`${PR}__split`,WR=`${PR}__title`,NR=`${PR}__arrow`,GR=`${PR}__no-event`,jR=`${PR}__item-text`;function VR(){return kR("div",[PR,HR])}function UR(t,e,i,o,n,r){const s=t.getCellRange(o,n);for(let o=0;o<e.length;o++){const n=e[o];let{col:r,row:l}=n;const{field:a,menuKey:h}=n;if("number"!=typeof r||"number"!=typeof l)if(t.isPivotTable()){const e=t.internalProps.layoutMap.getPivotCellAdress(a);if(!e)continue;r=e.col,l=e.row}else{const e=t.internalProps.layoutMap.getHeaderCellAddressByField(a);if(!e)continue;r=e.col,l=e.row}if(Q(r)&&Q(l)&&iw(s,r,l)&&i===h)return!0}return!1}class $R{constructor(t){var e,i,o,n,r,s,l,a,h,d;this._handler=new fw,this._rootElement=VR(),this._secondElement=VR(),this._secondElement.sub=!0,this._showChildrenIndex=-1,this._rootElement.addEventListener("wheel",(t=>{t.stopPropagation()})),null===(e=this._rootElement)||void 0===e||e.addEventListener("mousedown",(t=>{t.stopPropagation(),t.preventDefault()})),null===(i=this._rootElement)||void 0===i||i.addEventListener("touchend",(e=>{if(e.stopPropagation(),e.preventDefault(),this._rootElement.classList.contains(HR))return;const{col:i,row:o,dropDownIndex:n,menuKey:r,text:s,hasChildren:l}=e.target;if("number"!=typeof n||l)return void e.stopPropagation();const a=t.isPivotTable()?t.internalProps.layoutMap.getPivotDimensionInfo(i,o):t.getHeaderField(i,o),h=t._dropDownMenuIsHighlight(i,o,n);t.fireListeners(cw.DROPDOWN_MENU_CLICK,{col:i,row:o,field:a,menuKey:r,text:s,highlight:h,cellLocation:t.getCellLocation(i,o),event:e}),t.fireListeners(cw.DROPDOWN_MENU_CLEAR,null),t.fireListeners(cw.HIDE_MENU,null),e.stopPropagation()})),null===(o=this._rootElement)||void 0===o||o.addEventListener("click",(e=>{if(e.stopPropagation(),e.preventDefault(),this._rootElement.classList.contains(HR))return;const{col:i,row:o,dropDownIndex:n,menuKey:r,text:s,hasChildren:l}=e.target;if("number"!=typeof n||l)return void e.stopPropagation();const a=t.isPivotTable()?t.internalProps.layoutMap.getPivotDimensionInfo(i,o):t.getHeaderField(i,o),h=t._dropDownMenuIsHighlight(i,o,n);t.fireListeners(cw.DROPDOWN_MENU_CLICK,{col:i,row:o,field:a,menuKey:r,text:s,highlight:h,cellLocation:t.getCellLocation(i,o),event:e}),t.fireListeners(cw.DROPDOWN_MENU_CLEAR,null),t.fireListeners(cw.HIDE_MENU,null),e.stopPropagation()})),null===(n=this._rootElement)||void 0===n||n.addEventListener("mousemove",(e=>{var i,o;if(this._rootElement.classList.contains(HR))return;e.stopPropagation();const{hasChildren:n,dropDownIndex:r,col:s,row:l,sub:a}=e.target;if(n){this._showChildrenIndex=r;const o=this._secondElement;null==o||o.classList.remove(HR),null==o||o.classList.add(zR),o.innerHTML="";const n=null===(i=this._menuInstanceInfo.content[r])||void 0===i?void 0:i.children;for(let e=0;e<n.length;e++){const i=n[e],r=XR(i,!!t.stateManager.menu.dropDownMenuHighlight&&UR(t,t.stateManager.menu.dropDownMenuHighlight,"object"==typeof i?(null==i?void 0:i.menuKey)||(null==i?void 0:i.text):i,s,l));r.col=s,r.row=l,r.dropDownIndex=e,"string"==typeof i?(r.text=i,r.menuKey=i):"object"==typeof i&&(r.text=i.text,r.menuKey=i.menuKey||i.text),r.sub=!0,r.sub=!0,o.appendChild(r)}const a=e.target.getBoundingClientRect();this._bindSecondElement(t,s,l,a.right,a.top)}else if(n&&this._showChildrenIndex===r){const t=this._secondElement;null==t||t.classList.remove(HR),null==t||t.classList.add(zR)}else!a&&(null===(o=this._secondElement)||void 0===o?void 0:o.classList.contains(zR))&&setTimeout((()=>{if(!0!==this._mouseEnterSecondElement){this._showChildrenIndex=-1;const t=this._secondElement;null==t||t.classList.remove(zR),null==t||t.classList.add(HR)}}),300)})),null===(r=this._secondElement)||void 0===r||r.addEventListener("wheel",(t=>{t.stopPropagation()})),null===(s=this._secondElement)||void 0===s||s.addEventListener("mousemove",(t=>{this._rootElement.classList.contains(HR)||t.stopPropagation()})),null===(l=this._secondElement)||void 0===l||l.addEventListener("mouseenter",(t=>{this._mouseEnterSecondElement=!0})),null===(a=this._secondElement)||void 0===a||a.addEventListener("mouseleave",(t=>{this._mouseEnterSecondElement=!1})),null===(h=this._secondElement)||void 0===h||h.addEventListener("mousedown",(t=>{t.stopPropagation(),t.preventDefault()})),null===(d=this._secondElement)||void 0===d||d.addEventListener("click",(e=>{if(e.stopPropagation(),e.preventDefault(),this._secondElement.classList.contains(HR))return;const{col:i,row:o,dropDownIndex:n,menuKey:r,text:s,hasChildren:l}=e.target;if("number"!=typeof n||l)return void e.stopPropagation();const a=t.isPivotTable()?t.internalProps.layoutMap.getPivotDimensionInfo(i,o):t.getHeaderField(i,o);let h=!1;this._menuInstanceInfo.content.forEach(((e,n)=>{if("object"==typeof e&&e.children&&e.children.length)for(let n=0;n<e.children.length;n++){const s=e.children[n];if(UR(t,t.stateManager.menu.dropDownMenuHighlight,"object"==typeof s?null==s?void 0:s.menuKey:s,i,o)&&r===("object"==typeof s?null==s?void 0:s.menuKey:s))return void(h=!0)}})),t.fireListeners(cw.DROPDOWN_MENU_CLICK,{col:i,row:o,field:a,cellHeaderPaths:t.isPivotTable()?t.getCellHeaderPaths(i,o):void 0,menuKey:r,text:s,highlight:h,cellLocation:t.getCellLocation(i,o),event:e}),t.fireListeners(cw.DROPDOWN_MENU_CLEAR,null),t.fireListeners(cw.HIDE_MENU,null),e.stopPropagation()}))}get rootElement(){return this._rootElement}release(){this.unbindFromCell();const t=this._rootElement;(null==t?void 0:t.parentElement)&&t.parentElement.removeChild(t),this._handler.release(),delete this._rootElement}bindToCell(t,e,i,o){var n,r;const s=this._rootElement,l=this._secondElement;if(this._menuInstanceInfo=o,null==s||s.classList.remove(zR),null==s||s.classList.add(HR),null==l||l.classList.remove(zR),null==l||l.classList.add(HR),this._canBindToCell(t,e,i)){if(s.innerHTML="",Array.isArray(o.content)){const l=o.content;for(let o=0;null!==(n=o<(null==l?void 0:l.length))&&void 0!==n&&n;o++){const n=l[o];let a=!!t.stateManager.menu.dropDownMenuHighlight&&UR(t,t.stateManager.menu.dropDownMenuHighlight,"object"==typeof n?(null==n?void 0:n.menuKey)||(null==n?void 0:n.text):n,e,i);if(t.stateManager.menu.dropDownMenuHighlight&&"object"==typeof n&&Array.isArray(n.children)&&n.children.length)for(let o=0;o<n.children.length;o++){const r=n.children[o];if(UR(t,t.stateManager.menu.dropDownMenuHighlight,"object"==typeof r?(null==r?void 0:r.menuKey)||(null==r?void 0:r.text):r,e,i)){a=!0;break}}const h=XR(n,a);h.col=e,h.row=i,h.dropDownIndex=o,"string"==typeof n?(h.text=n,h.menuKey=n):"object"==typeof n&&(h.text=n.text,h.menuKey=n.menuKey||n.text,(null===(r=n.children)||void 0===r?void 0:r.length)&&(h.hasChildren=!0)),s.appendChild(h)}}if(this._bindToCell(t,e,i,o.position,o.referencePosition))return null==s||s.classList.add(zR),null==s||s.classList.remove(HR),!0}else this.unbindFromCell();return!1}unbindFromCell(){const t=this._rootElement,e=this._secondElement;this._menuInstanceInfo=void 0,(null==t?void 0:t.parentElement)&&(t.classList.remove(zR),t.classList.add(HR)),(null==e?void 0:e.parentElement)&&(e.classList.remove(zR),e.classList.add(HR))}_canBindToCell(t,e,i){const o=t.getCellRangeRelativeRect({col:e,row:i}),n=t.getElement(),{top:r,bottom:s,left:l,right:a}=o;if(t.isFrozenCell(e,i))return!0;if(s<t.getFrozenRowsHeight()||a<t.getFrozenColsWidth()||l>t.tableNoFrameWidth-t.getRightFrozenColsWidth()||r>t.tableNoFrameHeight-t.getBottomFrozenRowsHeight())return!1;const{offsetHeight:h,offsetWidth:d}=n;return!(h<r||d<l)}_bindToCell(t,e,i,o,n){const r=this._rootElement,s=t.getElement(),{width:l,height:a}=t.internalProps.element.getBoundingClientRect();if(r){r.parentElement!==s&&s.appendChild(r),r.style.left="0px";const t=.8*l;r.style.maxWidth=`${t}px`;const e=r.clientWidth,i=r.clientHeight;let h,d;return o?(h=o.x,d=o.y):n&&(h=n.rect.right-e,d=n.rect.bottom),d+i>a&&(d=a-i),d<0&&(d/=2),r.style.top=`${d}px`,h<0?h=0:h+e>l&&(h=l-e),r.style.left=`${h}px`,!0}return!1}_bindSecondElement(t,e,i,o,n){const r=this._secondElement,s=this._rootElement,l=t.getElement(),{width:a,left:h,top:d}=t.internalProps.element.getBoundingClientRect(),{x:c,y:u,width:g}=s.getBoundingClientRect();if(r){r.parentElement!==l&&l.appendChild(r),r.style.left="0px";const t=.8*a;r.style.maxWidth=`${t}px`;const e=r.clientWidth,i=n-4-d,s=o-h;r.style.top=`${i}px`;let c=s;return c+e>a?c=c-e-g:c+=4,r.style.left=`${c}px`,!0}return!1}pointInMenuElement(t,e){const i=this._rootElement,{x:o,y:n,width:r,height:s}=i.getBoundingClientRect();if(t>o-5&&t<o+r+5&&e>n-5&&e<n+s+5)return!0;if(this._secondElement){const{x:o,y:n,width:r,height:s}=i.getBoundingClientRect();if(t>o-5&&t<o+r+5&&e>n-5&&e<n+s+5)return!0}return!1}}function XR(t,e){var i,o,n;const r=kR("div",[ER,e?IR:FR]);if("string"==typeof t){const e=kR("span",[LR,GR,jR]);e.innerHTML=t,r.appendChild(e)}else if("object"==typeof t){const s=null!==(i=t.type)&&void 0!==i?i:"item";if("split"===s)return null==r||r.classList.add(DR),r;if(null===(o=null==t?void 0:t.icon)||void 0===o?void 0:o.svg)if(Rw.test(t.icon.svg)){const e=new Image;t.icon.width?e.style.width=t.icon.width.toString()+"px":e.style.width="16px",t.icon.height?e.style.height=t.icon.height.toString()+"px":e.style.height="16px",e.src=t.icon.svg,r.appendChild(e)}else{const i=kR("span",[OR,GR]);i.innerHTML=e&&t.selectedIcon&&t.selectedIcon.svg?t.selectedIcon.svg:t.icon.svg,t.icon.width&&i.children[0].setAttribute("width",t.icon.width.toString()),t.icon.height&&i.children[0].setAttribute("height",t.icon.height.toString()),r.appendChild(i)}const l=kR("span",[LR,GR,jR]);if(l.innerHTML=t.text,r.appendChild(l),"title"===s)null==r||r.classList.add(GR,WR);else if(null===(n=null==t?void 0:t.children)||void 0===n?void 0:n.length){const t=kR("span",[LR,GR,NR]);t.innerHTML=e?'<svg width="8" height="12" viewBox="0 0 10 17" fill="none" xmlns="http://www.w3.org/2000/svg" style="vertical-align: baseline"><path d="M1.78186 16.7729L0.300378 15.2915L6.8189 8.77295L0.300377 2.25443L1.78186 0.77295L9.78186 8.77295L1.78186 16.7729Z" fill="#2E68CF" fill-opacity="0.65"></path></svg>':'<svg width="8" height="12" viewBox="0 0 10 17" fill="none" xmlns="http://www.w3.org/2000/svg" style="vertical-align: baseline"><path d="M1.78186 16.7729L0.300378 15.2915L6.8189 8.77295L0.300377 2.25443L1.78186 0.77295L9.78186 8.77295L1.78186 16.7729Z" fill="#141414" fill-opacity="0.65"></path></svg>',r.appendChild(t)}}return r}let YR;class KR extends CC{static get DEFAULT(){return YR||(YR=new KR)}constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};var i;super(t,e),this.textAlign=(null!==(i=t.textAlign)&&void 0!==i?i:null==e?void 0:e.textAlign)||"center"}clone(){return new KR(this)}}class qR{constructor(t){this._table=t;const e=__();this.freezeIcon=e[oC.freezeIconName],this.frozenIcon=e[oC.frozenIconName],this.frozenCurrentIcon=e[oC.frozenCurrentIconName],this.normalIcon=e[oC.normalIconName],this.upIcon=e[oC.upwardIconName],this.downIcon=e[oC.downwardIconName],this.dropDownAbsoluteIcon=e[oC.dropdownIconName],this.expandIcon=e[oC.expandIconName],this.collapseIcon=e[oC.collapseIconName]}getIcons(t,e){const i=[];if(this._table.isPivotTable()){const{showSort:o,sort:n}=this._table.internalProps.layoutMap.getHeader(t,e);if(o){let o=this._table.getPivotSortState(t,e);o&&(o=o.toUpperCase());const n="ASC"===o?this.downIcon:"DESC"===o?this.upIcon:this.normalIcon;n&&i.push(n)}else if(n){const o=this.getSortIconForPivotTable(this._table.getPivotSortState(t,e),this._table,t,e);o&&i.push(o)}}else{const o=this._table.sortState;let n;n=void 0;const r=this._table.getCellRange(t,e);if(o)if(Array.isArray(o))for(let t=0;t<o.length;t++){const e=o[t],i=this._table._getHeaderCellBySortState(e);if(i&&iw(r,i.col,i.row)){({order:n}=e);break}}else{const t=this._table._getHeaderCellBySortState(o);t&&iw(r,t.col,t.row)&&({order:n}=o)}const s=this.getSortIcon(n,this._table,t,e);s&&i.push(s)}if(this._table.showFrozenIcon&&t<this._table.allowFrozenColCount){const o=this.getFrozenIcon(t,e);o&&i.push(o)}if(this.checkDropDownIcon(this._table,t,e)){const t=this.dropDownAbsoluteIcon;i.push(t)}const o=this.getDropDownStateIcons(this._table,t,e);o.length&&i.push(...o);const{headerIcon:n}=this._table._getHeaderLayoutMap(t,e),r=this.getHierarchyIcon(t,e);if(r&&i.push(r),n){let o;o="function"==typeof n?n({col:t,row:e,value:this._table.getCellValue(t,e),dataValue:this._table.getCellOriginValue(t,e),table:this._table}):n;const r=__(),s=t=>{let e;e="string"==typeof t?r[t]:t,e&&i.push(e)};Array.isArray(o)?o.forEach(((t,e)=>{s(t)})):s(o)}return i}getFrozenIcon(t,e){if(this._table.isPivotTable()||this._table.transpose)return null;if(this._table.rightFrozenColCount&&t>=this._table.colCount-this._table.rightFrozenColCount)return null;const i=this._table.getHeaderDefine(t,e);if(i.columns&&i.columns.length>0)return null;let o=this.freezeIcon;return this._table.options.frozenColCount-1>t?o=this.frozenIcon:this._table.options.frozenColCount-1===t&&(o=this.frozenCurrentIcon),o}getSortIcon(t,e,i,o){const n="asc"===t?this.downIcon:"desc"===t?this.upIcon:this.normalIcon,r=e.getHeaderDefine(i,o);return!r||!1===r.showSort||!Q(r.showSort)&&!r.sort||r.columns&&r.columns.length>0?null:n}getSortIconForPivotTable(t,e,i,o){const n=e.getHeaderDefine(i,o);return!n||!1===n.showSort||!Q(n.showSort)&&!n.sort||n.columns&&n.columns.length>0?null:"ASC"===t?this.downIcon:"DESC"===t?this.upIcon:this.normalIcon}getDropDownStateIcons(t,e,i){var o,n,r;const s=t.getHeaderDefine(e,i),l=t._getHeaderLayoutMap(e,i),{dropDownMenu:a}=l,h=[];if(Array.isArray(a)&&a.length||Array.isArray(t.globalDropDownMenu)&&t.globalDropDownMenu.length&&!(null===(o=null==s?void 0:s.columns)||void 0===o?void 0:o.length)){const o=a||t.globalDropDownMenu;let s=-1,l=-1;for(let a=0;a<o.length;a++){const h=o[a];if("object"==typeof h&&h.children&&h.children.length)for(let o=0;o<h.children.length;o++){const d=h.children[o];if((null===(n=t.stateManager.menu)||void 0===n?void 0:n.dropDownMenuHighlight)&&UR(t,null===(r=t.stateManager.menu)||void 0===r?void 0:r.dropDownMenuHighlight,"object"==typeof d?null==d?void 0:d.menuKey:d,e,i)){s=a,l=o;break}}if(t._dropDownMenuIsHighlight(e,i,a)){s=a;break}}if(-1!==s){let e;e=-1!==l?(a||t.globalDropDownMenu)[s].children[l]:(a||t.globalDropDownMenu)[s],e.stateIcon&&(e.stateIcon.svg?h.push({type:"svg",name:e.stateIcon.src||e.stateIcon.svg,width:e.stateIcon.width||22,height:e.stateIcon.height||22,svg:e.stateIcon.svg,positionType:eC.right,marginRight:0,funcType:iC.dropDownState,interactive:!1}):e.stateIcon.src&&h.push({type:"image",name:e.stateIcon.src||e.stateIcon.svg,width:e.stateIcon.width||22,height:e.stateIcon.height||22,src:e.stateIcon.src,positionType:eC.right,marginRight:0,funcType:iC.dropDownState,interactive:!1}))}}return h}getDropDownIconRect(t,e,i){var o,n,r,s,l,a,h,d;const c=null!==(s=null!==(n=null===(o=this.downIcon.hover)||void 0===o?void 0:o.width)&&void 0!==n?n:null===(r=this.downIcon)||void 0===r?void 0:r.width)&&void 0!==s?s:0,u=null!==(d=null!==(a=null===(l=this.downIcon.hover)||void 0===l?void 0:l.height)&&void 0!==a?a:null===(h=this.downIcon)||void 0===h?void 0:h.height)&&void 0!==d?d:0,g=t.right-2-c,p=t.right-2;let f;return f="middle"===i?t.top+t.height/2-c/2:"top"===i?t.top+e/2:"bottom"===i?t.bottom-2*e:t.top,{left:g,right:p,top:f,bottom:u+f,width:c,height:u}}getHierarchyIcon(t,e){const{hierarchyState:i}=this._table._getHeaderLayoutMap(t,e);if(i){if(i===Jy.expand)return this.expandIcon;if(i===Jy.collapse)return this.collapseIcon}}getHierarchyIconWidth(){var t,e;return this.expandIcon.width+(null!==(t=this.expandIcon.marginLeft)&&void 0!==t?t:0)+(null!==(e=this.expandIcon.marginRight)&&void 0!==e?e:0)}checkDropDownIcon(t,e,i){var o;if(t.isPivotTable()){const o=t._getHeaderLayoutMap(e,i);if(Array.isArray(o.dropDownMenu)&&o.dropDownMenu.length)return!0}else{const n=t.getHeaderDefine(e,i);if(Array.isArray(n.dropDownMenu)&&n.dropDownMenu.length||(!Array.isArray(n.dropDownMenu)||0!==n.dropDownMenu.length)&&Array.isArray(t.globalDropDownMenu)&&t.globalDropDownMenu.length&&!(null===(o=null==n?void 0:n.columns)||void 0===o?void 0:o.length))return!0}return!1}getStyleClass(t){switch(t){case"text":case"link":return _C;case"image":case"video":return KR;case"checkbox":return SC}}setTableColumnsEditor(){const t=(e,i)=>{null==e||e.forEach(((e,o)=>{e.editor&&(i[o].editor=e.editor),e.columns&&t(e.columns,i[o].columns)}))};t(this._table.options.columns,this._table.internalProps.columns)}}class ZR extends EventTarget{constructor(t,e){if(super(),this._table=t,"node"===BC.mode)return;const i=document.createElement("div");i.style.opacity="0",i.dataset.vtable="vtable",i.style.pointerEvents="none",i.classList.add("input-container");const o=this._input=document.createElement("input");i.appendChild(o),o.classList.add("table-focus-control"),o.dataset.vtable="vtable",o.readOnly=!0,e.appendChild(i)}focus(){this._input.focus({preventScroll:!0})}setFocusRect(t,e){const i=this._input;i.value=e,i.select();const o=t.top-this._table.scrollTop,n=t.left-this._table.scrollLeft;i.style.top=`${o.toFixed()}px`,i.style.left=`${n.toFixed()}px`,i.style.width=`${t.width.toFixed()}px`,i.style.height=`${t.height.toFixed()}px`}get input(){return this._input}release(){}}function JR(t){return 2===t.length&&ht(t[0])&&ht(t[1])&&t[1]>=t[0]}function QR(t){const e=t[1]-t[0],i=t[1]*t[0]<0;let o=t[0]<=0?0-t[0]:0,n=t[1]>0?t[1]-0:0;return 0===e?t[0]<0?(o=1,n=0):t[0]>0&&(o=0,n=1):(o/=e,n/=e),{total:e,negative:o,positive:n,includeZero:i,domain:t,extendable_min:!0,extendable_max:!0}}function tM(t,e){const{positive:i,negative:o,extendable_min:n,extendable_max:r,domain:s}=t,{positive:l,negative:a,extendable_min:h,extendable_max:d,domain:c}=e;if(l>0){if(!h)return!1;let t=o/i;r&&(t=o/Math.max(i,l),s[1]=-s[0]/t),c[0]=-c[1]*t}else if(a>0){if(!d)return!1;let t=i/o;n&&(t=i/Math.max(o,o),s[0]=-s[1]/t),c[1]=-c[0]*t}return!0}function eM(t,e){const{extendable_min:i,extendable_max:o,domain:n}=t,{positive:r,negative:s,domain:l}=e;return!(0===r&&0===s||r>0&&!o||s>0&&!i||(n[0]=l[0],n[1]=l[1],0))}function iM(t,e){const{positive:i,negative:o,extendable_max:n,domain:r}=t,{positive:s,negative:l,extendable_min:a,domain:h}=e;if(n&&a){const t=Math.max(o,l)/Math.max(i,s);r[1]=-r[0]/t,h[0]=-h[1]*t}else if(a){const t=o/i;h[0]=-h[1]*t}else{if(!n)return!1;{const t=l/s;r[1]=-r[0]/t}}return!0}function oM(t,e){const{extendable_min:i,domain:o}=t,{extendable_max:n,domain:r}=e;return!(!i||!n||(o[0]=-o[1],r[1]=-r[0],0))}function nM(t,e){const i=[t.min,t.max],o=[e.min,e.max];if(!JR(i)||!JR(o))return;const n=QR(i),r=QR(o),{positive:s,negative:l,extendable_min:a,extendable_max:h,includeZero:d}=n,{positive:c,negative:u,extendable_min:g,extendable_max:p,includeZero:f}=r;if(0===s&&0===l){if(!eM(n,r))return}else if(0===c&&0===u){if(!eM(r,n))return}else if(d||f)if(d&&!f){if(!tM(n,r))return}else if(f&&!d){if(!tM(r,n))return}else{if(l===u)return;if(l>u){if(!iM(n,r))return}else if(!iM(r,n))return}else{if(0===l&&0===c){if(!oM(n,r))return}else if(0===u&&0===s&&!oM(r,n))return;if(0===l&&0===u)if(0===i[0]&&o[0]>0){if(!g)return;o[0]=0}else{if(!(0===o[0]&&i[0]>0))return;if(!a)return;i[0]=0}if(0===s&&0===c)if(0===i[1]&&o[1]>0){if(!p)return;o[1]=0}else{if(!(0===o[1]&&i[1]>0))return;if(!h)return;i[1]=0}}return{range1:i,range2:o}}function rM(t,e,i){var o,n,r,s,l,a,h;if(i._table.isPivotChart())if(i.indicatorsAsCol){if(i.hasTwoIndicatorAxes&&e===i.columnHeaderLevelCount-1&&t>=i.rowHeaderLevelCount&&t<i.colCount-i.rightFrozenColCount){const o=hM("top",t,e+1,t,i.columnHeaderLevelCount-1,t,e,1,i);if(!o)return;const{range:n,ticks:r,axisOption:s,isZeroAlign:l,theme:a}=o;if(l){const o=hM("bottom",t,e+1,t,i.columnHeaderLevelCount-1,t,e,0,i);if(o){const{range:t}=o,e=nM(n,t);e&&(n.min=e.range1[0],n.max=e.range1[1])}}return at(null==s?void 0:s.min)&&(n.min=s.min,n.min>0&&(s.zero=!1)),at(null==s?void 0:s.max)&&(n.max=s.max,n.max<0&&(s.zero=!1)),St({range:n},s,{orient:"top",type:(null==s?void 0:s.type)||"linear",label:{flush:!0},__ticksForVTable:r,__vtableChartTheme:a})}if(e===i.rowCount-i.bottomFrozenRowCount&&t>=i.rowHeaderLevelCount&&t<i.colCount-i.rightFrozenColCount){const o=i.getIndicatorKeyInChartSpec(t,e);let n=null;null==o||o.forEach((t=>{const e=i.getIndicatorInfo(t);e&&(n=e)}));const r=hM("bottom",t,e-1,t,e,t,e,0,i);if(!r)return;const{range:s,ticks:l,axisOption:a,isZeroAlign:h,theme:d}=r;if(h){const o=hM("top",t,e-1,t,e,t,e,1,i);if(o){const{range:t}=o,e=nM(s,t);e&&(s.min=e.range1[0],s.max=e.range1[1])}}return at(null==a?void 0:a.min)&&(s.min=a.min,s.min>0&&(a.zero=!1)),at(null==a?void 0:a.max)&&(s.max=a.max,s.max<0&&(a.zero=!1)),St({title:{visible:!0,text:null==n?void 0:n.title},range:s},a,{orient:"bottom",type:(null==a?void 0:a.type)||"linear",label:{flush:!0},__ticksForVTable:l,__vtableChartTheme:d})}if(t===i.rowHeaderLevelCount-1&&e>=i.columnHeaderLevelCount&&e<i.rowCount-i.bottomFrozenRowCount){let l=i.getDimensionKeyInChartSpec(i.rowHeaderLevelCount,e);rt(l)&&(l=l[0]);const a=null!==(o=i.dataset.collectedValues[l])&&void 0!==o?o:[],h=i.getRowKeysPath(t,e),d=null!==(n=a[null!=h?h:""])&&void 0!==n?n:[],{axisOption:c,theme:u,chartType:g}=sM(t+1,e,"left",i);if(!1===(null==c?void 0:c.visible))return;const p=i.getRawChartSpec(t+1,e);return St({domain:"linear"===(null==c?void 0:c.type)?void 0:Array.from(d),range:"linear"===(null==c?void 0:c.type)?d:void 0,title:{autoRotate:!0}},c,{orient:"left",type:null!==(r=null==c?void 0:c.type)&&void 0!==r?r:"band",__vtableChartTheme:u,inverse:cM(c,"horizontal"===(null!==(s=null==p?void 0:p.direction)&&void 0!==s?s:"scatter"===g?"vertical":"horizontal"))})}}else{if(t===i.rowHeaderLevelCount-1&&e>=i.columnHeaderLevelCount&&e<i.rowCount-i.bottomFrozenRowCount){const o=i.getIndicatorKeyInChartSpec(t,e);let n=null;null==o||o.forEach((t=>{const e=i.getIndicatorInfo(t);e&&(n=e)}));const r=hM("left",t+1,e,t,e,t,e,0,i);if(!r)return;const{range:s,ticks:l,axisOption:a,isZeroAlign:h,theme:d}=r;if(h){const o=hM("right",t+1,e,t,e,t,e,1,i);if(o){const{range:t}=o,e=nM(s,t);e&&(s.min=e.range1[0],s.max=e.range1[1])}}return at(null==a?void 0:a.min)&&(s.min=a.min,s.min>0&&(a.zero=!1)),at(null==a?void 0:a.max)&&(s.max=a.max,s.max<0&&(a.zero=!1)),St({title:{visible:!0,text:null==n?void 0:n.title,autoRotate:!0},range:s},a,{orient:"left",type:(null==a?void 0:a.type)||"linear",label:{flush:!0},__ticksForVTable:l,__vtableChartTheme:d})}if(t===i.colCount-i.rightFrozenColCount&&e>=i.columnHeaderLevelCount&&e<i.rowCount-i.bottomFrozenRowCount){const o=hM("right",t-1,e,i.rowHeaderLevelCount-1,e,t,e,1,i);if(!o)return;const{range:n,ticks:r,axisOption:s,isZeroAlign:l,theme:a}=o;if(l){const o=hM("left",t-1,e,i.rowHeaderLevelCount-1,e,t,e,0,i);if(o){const{range:t}=o,e=nM(n,t);e&&(n.min=e.range1[0],n.max=e.range1[1])}}return at(null==s?void 0:s.min)&&(n.min=s.min,n.min>0&&(s.zero=!1)),at(null==s?void 0:s.max)&&(n.max=s.max,n.max<0&&(s.zero=!1)),St({range:n,title:{autoRotate:!0}},s,{orient:"right",type:(null==s?void 0:s.type)||"linear",label:{flush:!0},__ticksForVTable:r,__vtableChartTheme:a})}if(e===i.rowCount-i.bottomFrozenRowCount&&t>=i.rowHeaderLevelCount&&t<i.colCount-i.rightFrozenColCount){let o=i.getDimensionKeyInChartSpec(t,i.columnHeaderLevelCount);rt(o)&&(o=o[0]);const n=null!==(l=i.dataset.collectedValues[o])&&void 0!==l?l:[],r=i.getColKeysPath(t,e),s=null!==(a=null==n?void 0:n[null!=r?r:""])&&void 0!==a?a:[],{axisOption:d,isPercent:c,theme:u,chartType:g}=sM(t,e-1,"bottom",i);if(!1===(null==d?void 0:d.visible))return;return St({domain:"linear"===(null==d?void 0:d.type)?void 0:Array.from(s),range:"linear"===(null==d?void 0:d.type)?s:void 0},d,{orient:"bottom",type:null!==(h=null==d?void 0:d.type)&&void 0!==h?h:"band",__vtableChartTheme:u})}}}function sM(t,e,i,o){var n,r;const s=o.getRawChartSpec(t,e),l=null!==(n=s.axes)&&void 0!==n?n:[];if(o._table.pivotChartAxes.forEach((t=>{-1===l.findIndex((e=>t.orient===e.orient))&&l.push(t)})),s&&rt(l)){const t=l.find((t=>t.orient===i));if(t){const{seriesIndex:e,seriesId:n}=t;let l,a;return Q(n)&&rt(s.series)?l=(rt(n)?n:[n]).map((t=>{const e=s.series.findIndex((e=>e.id===t));return e>=0&&(a=s.series[e]),e})):Q(e)&&rt(s.series)&&(l=e),{axisOption:t,isPercent:s.percent,isZeroAlign:lM(s,i,o),seriesIndice:l,theme:s.theme,chartType:null!==(r=null==a?void 0:a.type)&&void 0!==r?r:s.type}}}return{axisOption:o._table.pivotChartAxes.find((t=>t.orient===i)),isPercent:!1,isZeroAlign:lM(s,i,o),theme:s.theme,chartType:s.type}}function lM(t,e,i){const o=[];let n;if("left"===e||"right"===e?o.push("left","right"):"top"!==e&&"bottom"!==e||o.push("top","bottom"),n=t&&rt(t.axes)?t.axes:i._table.pivotChartAxes,rt(n)){const t=[];n.forEach((e=>{o.includes(e.orient)&&t.push(e)}));for(let e=0;e<t.length;e++){const i=t[e];if(i.sync&&i.sync.zeroAlign&&i.sync.axisId&&t.find((t=>t.id===i.sync.axisId)))return!0}}return!1}function aM(t,e,i,o,n){var r;if(rt(n)){const r={min:1/0,max:-1/0};for(let s=0;s<n.length;s++){const l=aM(t,e,i,o,n[s]);l&&(r.min=Math.min(r.min,l.min),r.max=Math.max(r.max,l.max))}return isFinite(r.min)&&isFinite(r.max)?r:null}let s=null==e?void 0:e[n];if(rt(s)&&(s=s[0]),!s)return null;const l=t[s],a=St({},null!==(r=null==l?void 0:l[null!=o?o:""])&&void 0!==r?r:{min:0,max:1});return a.positiveMax&&a.positiveMax>a.max&&(a.max=a.positiveMax),a.negativeMin&&a.negativeMin<a.min&&(a.min=a.negativeMin),a.min===a.max&&(a.min>0?a.min=0:a.max=0),a}function hM(t,e,i,o,n,r,s,l,a){const{axisOption:h,isPercent:d,isZeroAlign:c,seriesIndice:u,theme:g,chartType:p}=sM(e,i,t,a);if(!1===(null==h?void 0:h.visible))return;const f=a.getIndicatorKeyInChartSpec(o,n);let m;m="top"===t||"bottom"===t?a.getColKeysPath(r,s):a.getRowKeysPath(r,s);const b=aM(a.dataset.collectedValues,f,c,m,null!=u?u:l);if(!b)return;d&&(b.min=b.min<0?-1:0,b.max=b.max>0?1:0);const v=Vw.getFunction("getAxisDomainRangeAndLabels"),{range:y,ticks:C}=v(b.min,b.max,h,c,a._table.getColWidth(r));return b.min=isNaN(y[0])?0:y[0],b.max=isNaN(y[1])?1:y[1],at(null==h?void 0:h.min)&&(b.min=h.min,b.min>0&&(h.zero=!1)),at(null==h?void 0:h.max)&&(b.max=h.max,b.max<0&&(h.zero=!1)),{axisOption:h,isZeroAlign:c,range:b,ticks:C,theme:g,chartType:p}}var dM;function cM(t,e){let i=null==t?void 0:t.inverse;return e&&!("bottom"===(o=null==t?void 0:t.orient)||"top"===o)&&(i=!Q(null==t?void 0:t.inverse)||!(null==t?void 0:t.inverse)),i;var o}!function(t){t.vertical="vertical",t.horizontal="horizontal"}(dM||(dM={}));class uM{constructor(t){this.isUpdate=!1,this._keys=[],this._sorted=!1,this.data=new Map,this._keys.length=0,this.cumulativeSum=new Map,this.difference=new Map,this.totalSum=0,this.table=t}get length(){return this.data.size}clear(){this._keys=[],this.data.clear(),this.cumulativeSum.clear(),this.difference.clear(),this.totalSum=0}clearRange(){this.cumulativeSum.clear(),this.difference.clear()}add(t,e){const i=this.table.getRowHeight(t);this.data.has(t)||(this._keys.push(t),this._sorted=!1),this.data.set(t,e),this.totalSum+=e,this.updateDifference(t,e-i)}remove(t){if(this.data.has(t)){const e=this.data.get(t);this.data.delete(t);const i=this._keys.indexOf(t);-1!==i&&this._keys.splice(i,1),this.totalSum-=e;const o=this.table.getRowHeight(t);this.updateDifference(t,o-e)}}put(t,e){if(this.data.has(t)){const i=this.data.get(t);if(i===e)return;this.data.set(t,e);const o=e-i;this.totalSum+=o,this.updateDifference(t,o)}else this.add(t,e)}get(t){return this.data.get(t)}has(t){return this.data.has(t)}_sort(){const{_keys:t}=this;this._sorted||(t.sort(((t,e)=>t<e?-1:t>e?1:0)),this._sorted=!0)}updateDifference(t,e){var i;const o=null!==(i=this.difference.get(t))&&void 0!==i?i:0;this.difference.set(t,o+e),this.update()}getSumInRange(t,e){return this.calculatePrefixSum(e)-this.calculatePrefixSum(t-1)}updateCumulativeSum(t,e){for(const[i,o]of this.cumulativeSum)i>=t&&this.cumulativeSum.set(i,o+e)}calculatePrefixSum(t){if(t<0)return 0;if(this.cumulativeSum.has(t)){let e=this.cumulativeSum.get(t);for(const[i,o]of this.difference)i<=t&&(e+=o);return e}return this.dealDiffenence(),this.getCumulativeSum(t)}getCumulativeSum(t){var e;let i=0;for(let o=t;o>=0;o--){if(this.cumulativeSum.has(o)){i+=this.cumulativeSum.get(o);break}i+=null!==(e=this.data.get(o))&&void 0!==e?e:this.table.getRowHeight(o)}return this.cumulativeSum.set(t,i),i}update(){this.isUpdate||(this.isUpdate=!0,setTimeout((()=>{this.dealDiffenence(),this.isUpdate=!1}),0))}dealDiffenence(){for(const[t]of this.cumulativeSum)for(const[e,i]of this.difference)if(t>=e){const e=this.cumulativeSum.get(t);this.cumulativeSum.set(t,e+i)}this.difference.clear()}insert(t,e){for(let e=t;e<=this.getLastIndex();e++)this.cumulativeSum.delete(e);const i=this.getLastIndex()+1;this.adjustOrder(t,t+1,i-t),Q(e)&&this.put(t,e)}getLastIndex(){return this._sort(),this._keys[this._keys.length-1]}delLast(){const t=this.getLastIndex();this.remove(t)}delete(t){if(!this.has(t))return;for(let e=t;e<=this.getLastIndex();e++)this.cumulativeSum.delete(e);const e=this.getLastIndex();this.adjustOrder(t+1,t,e-t),this.delLast()}adjustOrder(t,e,i){this.clearRange(),this._sort();const{_keys:o}=this;if(t>e){const n=[];for(let r=gM(o,t+i-1);r>=0;r--){const s=o[r];if(s>=t)n.push(this.get(s));else if(e<=s&&s<t)this.put(s+i,this.get(s));else if(s<e)break}for(let t=0;t<i;t++)this.put(e+t,n[i-1-t])}const{length:n}=o;if(t<e){const r=[];for(let s=gM(o,t);s<n;s++){const n=o[s];if(n>=t&&n<t+i)r.push(this.get(n));else if(t+i<=n&&n<=e)this.put(n-i,this.get(n));else if(n>e)break}for(let t=0;t<i;t++)this.put(e+t,r[t])}}exchangeOrder(t,e,i,o,n){const{_keys:r}=this;if(this._sorted||(r.sort(((t,e)=>t<e?-1:t>e?1:0)),this._sorted=!0),t>i){const o=[],s=[];for(let n=gM(r,i);n<t+e;n++){const i=r[n];i>=t&&i<t+e?s.push(this.get(i)):o.push(this.get(i))}for(let t=0;t<e;t++)this.put(n+t,s[t]);for(let t=0;t<o.length;t++)this.put(n+e+t,o[t])}else{const s=[],l=[];for(let n=gM(r,t);n<i+o;n++){const i=r[n];i>=t&&i<t+e?l.push(this.get(i)):s.push(this.get(i))}for(let t=0;t<e;t++)this.put(n+t,l[t]);for(let e=0;e<s.length;e++)this.put(t+e,s[e])}}}function gM(t,e){let i=0,o=t.length-1;for(;i<=o;){const n=Math.floor((i+o)/2);if(t[n]===e)return n;t[n]>e?o=n-1:i=n+1}return o<0?0:o}class pM{constructor(t){this._table=t;const e=__();this.dragReorderIconName=e[oC.dragReorderIconName]}getIcons(t,e){return[this.dragReorderIconName]}}class fM{constructor(t,e,i){this.table=t,this.customCellStyle=e,this.customCellStyleArrangement=i}getCustomCellStyle(t,e){const i=this.getCustomCellStyleId(t,e);if(i){const t=this.getCustomCellStyleOption(i);return null==t?void 0:t.style}}getCustomCellStyleId(t,e){let i;return this.customCellStyleArrangement.forEach((o=>{o.cellPosition.range?o.cellPosition.range.start.col<=t&&o.cellPosition.range.end.col>=t&&o.cellPosition.range.start.row<=e&&o.cellPosition.range.end.row>=e&&(i=o.customStyleId):o.cellPosition.col===t&&o.cellPosition.row===e&&(i=o.customStyleId)})),i}getCustomCellStyleOption(t){return this.customCellStyle.find((e=>e.id===t))}registerCustomCellStyle(t,e){const i=this.customCellStyle.findIndex((e=>e.id===t));-1===i?this.customCellStyle.push({id:t,style:e}):this.customCellStyle[i]={id:t,style:e},this.customCellStyleArrangement.forEach((e=>{const i=e.cellPosition;if(e.customStyleId===t)if(i.range)for(let t=i.range.start.col;t<=i.range.end.col;t++)for(let e=i.range.start.row;e<=i.range.end.row;e++)this.table.scenegraph.updateCellContent(t,e);else this.table.scenegraph.updateCellContent(i.col,i.row)})),this.table.scenegraph.updateNextFrame()}arrangeCustomCellStyle(t,e){const i=this.customCellStyleArrangement.findIndex((e=>e.cellPosition.range&&t.range?e.cellPosition.range.start.col===t.range.start.col&&e.cellPosition.range.start.row===t.range.start.row&&e.cellPosition.range.end.col===t.range.end.col&&e.cellPosition.range.end.row===t.range.end.row:e.cellPosition.col===t.col&&e.cellPosition.row===t.row));if(-1===i?this.customCellStyleArrangement.push({cellPosition:{col:t.col,row:t.row,range:t.range},customStyleId:e}):this.customCellStyleArrangement[i].customStyleId=e,t.range)for(let e=t.range.start.col;e<=t.range.end.col;e++)for(let i=t.range.start.row;i<=t.range.end.row;i++)this.table.scenegraph.updateCellContent(e,i);else this.table.scenegraph.updateCellContent(t.col,t.row);this.table.scenegraph.updateNextFrame()}updateCustomCell(t,e){this.customCellStyle.length=0,this.customCellStyleArrangement.length=0,t.forEach((t=>{this.registerCustomCellStyle(t.id,t.style)})),e.forEach((t=>{this.arrangeCustomCellStyle(t.cellPosition,t.customStyleId)}))}hasCustomCellStyle(t){return this.customCellStyle.some((e=>e.id===t))}}function mM(t,e){t=t.clone();for(const i in e){const o=e[i];o&&(t[`_${i}`]=o)}return t}class bM{constructor(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"grid",o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:void 0;this.sizeIncludeParent=!1,this.tree={id:0,dimensionKey:"",value:"",children:[],level:-1,levelSpan:1,startIndex:0,size:0,startInTotal:0,hierarchyState:void 0},this.totalLevel=0,this.dimensionKeys=new bw,this.dimensionKeysIncludeVirtual=new bw,this.cache=new Map,this.sizeIncludeParent=null!=o,this.rowExpandLevel=o,this.hierarchyType=i,this.sharedVar=e,this.reset(t)}reset(t){this.cache.clear(),this.dimensionKeys=new bw,this.dimensionKeysIncludeVirtual=new bw,this.tree.children=t,this.setTreeNode(this.tree,0,this.tree)}setTreeNode(t,e,i){var o,n;t.startIndex=e,t.startInTotal=(null!==(o=i.startInTotal)&&void 0!==o?o:0)+t.startIndex,(null!==(n=t.dimensionKey)&&void 0!==n?n:t.indicatorKey)&&(t.virtual||this.dimensionKeys.contain(t.indicatorKey?Mw:t.dimensionKey)||this.dimensionKeys.put(t.level,t.indicatorKey?Mw:t.dimensionKey),this.dimensionKeysIncludeVirtual.contain(t.indicatorKey?Mw:t.dimensionKey)||this.dimensionKeysIncludeVirtual.put(t.level,t.indicatorKey?Mw:t.dimensionKey),t.id||(t.id=++this.sharedVar.seqId));let r=t.dimensionKey&&this.sizeIncludeParent?1:0;const s=t.children||t.columns;return"grid"===this.hierarchyType?(null==s?void 0:s.length)>=1?s.forEach((e=>{var i;e.level=(null!==(i=t.level)&&void 0!==i?i:0)+1,this.totalLevel=Math.max(this.totalLevel,e.level+1),r+=this.setTreeNode(e,r,t)})):r=1:t.hierarchyState===Jy.expand&&(null==s?void 0:s.length)>=1?s.forEach((e=>{var i;e.level=(null!==(i=t.level)&&void 0!==i?i:0)+1,this.totalLevel=Math.max(this.totalLevel,e.level+1),r+=this.setTreeNode(e,r,t)})):t.hierarchyState===Jy.collapse&&(null==s?void 0:s.length)>=1?s.forEach((e=>{var i;e.level=(null!==(i=t.level)&&void 0!==i?i:0)+1,this.totalLevel=Math.max(this.totalLevel,e.level+1),this.setTreeNode(e,r,t)})):!t.hierarchyState&&t.level+1<this.rowExpandLevel&&((null==s?void 0:s.length)>=1||!0===s)?(t.hierarchyState=Jy.expand,(null==s?void 0:s.length)>=1&&s.forEach((e=>{var i;e.level=(null!==(i=t.level)&&void 0!==i?i:0)+1,this.totalLevel=Math.max(this.totalLevel,e.level+1),r+=this.setTreeNode(e,r,t)}))):(null==s?void 0:s.length)>=1||!0===s?(t.hierarchyState=Jy.collapse,(null==s?void 0:s.length)>=1&&s.forEach((e=>{var i;e.level=(null!==(i=t.level)&&void 0!==i?i:0)+1,this.totalLevel=Math.max(this.totalLevel,e.level+1),this.setTreeNode(e,r,t)}))):(t.hierarchyState=Jy.none,r=1),t.size=r,r}getTreePath(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:30;const i=[];return this.searchPath(t,this.tree,i,e),i.shift(),i}getTreePathByCellIds(t){const e=[];let i=this.tree.children;for(let o=0;o<t.length;o++){const n=t[o],r=this.findNodeById(i,n);if(!r)break;e.push(r),i=r.children}return e}findNodeById(t,e){return t.find((t=>t.id===e))}searchPath(t,e,i,o){if(!e)return;if(t<e.startIndex||t>=e.startIndex+e.size)return;if(i.push(e),!e.children||0===e.children.length||e.level>=o)return;const n=t-e.startIndex;if(this.cache.has(e.level+1)){const t=this.cache.get(e.level+1);if(n>=t.startIndex&&n<t.startIndex+t.size)return void this.searchPath(n,t,i,o)}let r=0,s=e.children.length-1;for(;r<=s;){const t=Math.floor((r+s)/2),l=e.children[t];if(n>=l.startIndex&&n<l.startIndex+l.size){this.cache.set(l.level,l);const t=[];this.cache.forEach(((e,i)=>{i>l.level&&t.push(i)})),t.forEach((t=>{this.cache.delete(t)})),this.searchPath(n,l,i,o);break}n<l.startIndex?s=t-1:r=t+1}}movePosition(t,e,i){let o,n,r;const s=(l,a)=>{if(void 0!==n&&void 0!==r)return;l.level===t&&(l.startInTotal===e&&(n=a),l.startInTotal<=i&&i<=l.startInTotal+l.size-1&&(r=a));const h=l.children||l.columns;if(h&&l.level<t){o=l;for(let t=0;t<h.length;t++)(e>=h[t].startInTotal&&e<=h[t].startInTotal+h[t].size||i>=h[t].startInTotal&&i<=h[t].startInTotal+h[t].size)&&s(h[t],t)}};s(this.tree,0);const l=o.children||o.columns,a=l.splice(n,1);a.unshift(r,0),Array.prototype.splice.apply(l,a)}getCopiedTree(){const t=Ct(this.tree.children);return vM(t),t}}function vM(t){for(let e=0;e<t.length;e++){const i=t[e];delete i.level,delete i.startIndex,delete i.id,delete i.levelSpan,delete i.size,delete i.startInTotal;const o=i.children||i.columns;o&&vM(o)}}function yM(t,e){const i=function(t,e){if(!t.internalProps.frozenRowCount)return null;let{scrollTop:i}=t;const o=t.internalProps.frozenRowCount;for(let n=0;n<o;n++){const o=t.getRowHeight(n),r=i+o;if(r>e)return{top:i,row:n,bottom:r,height:o};i=r}return null}(e,t);if(i)return i;let o=xM(t,e);return o||(o={top:-1,row:-1,bottom:-1,height:-1}),o}function CM(t,e){const i=function(t,e){if(!t.internalProps.frozenColCount)return null;let{scrollLeft:i}=t;const o=t.internalProps.frozenColCount;for(let n=0;n<o;n++){const o=t.getColWidth(n),r=i+o;if(r>e)return{left:i,col:n,right:r,width:o};i=r}return null}(e,t);if(i)return i;let o=wM(t,e);return o||(o={left:-1,col:-1,right:-1,width:1}),o}function wM(t,e){if(0===t)return{left:0,col:0,right:0,width:0};const i=function(t,e){if(e._colRangeWidthsMap.get("$0$"+(e.colCount-1))){let i=0,o=e.colCount-1;for(;o-i>1;){const n=Math.floor((i+o)/2);if(t<e._colRangeWidthsMap.get(`$0$${n}`))o=n;else{if(!(t>e._colRangeWidthsMap.get(`$0$${n}`)))return n;i=n}}return o}return Math.min(Math.ceil(t/e.internalProps.defaultColWidth),e.colCount-1)}(t,e),o=e.getColsWidth(0,i);return t>=o?((i,o)=>{let n=o-e.getColWidth(i);const{colCount:r}=e.internalProps;for(let o=i;o<r;o++){const i=e.getColWidth(o),r=n+i;if(Math.round(n)<=Math.round(t)&&Math.round(t)<Math.round(r))return{left:n,col:o,right:r,width:i};n=r}return null})(i,o):((i,o)=>{let n=o;for(let o=i;o>=0;o--){const i=e.getColWidth(o),r=n-i;if(Math.round(r)<=Math.round(t)&&Math.round(t)<Math.round(n))return{left:r,col:o,right:n,width:i};n=r}return null})(i,o)}function xM(t,e){if(0===t)return{top:0,row:0,bottom:0,height:0};const i=function(t,e){let i=e.internalProps.defaultRowHeight;return e._rowRangeHeightsMap.get("$0$"+(e.rowCount-1))&&(i=e._rowRangeHeightsMap.get("$0$"+(e.rowCount-1))/e.rowCount),Math.min(Math.ceil(t/i),e.rowCount-1)}(t,e),o=e.getRowsHeight(0,i);return t>=o?((i,o)=>{let n=o-e.getRowHeight(i);const{rowCount:r}=e.internalProps;for(let o=i;o<r;o++){const i=e.getRowHeight(o),r=n+i;if(Math.round(n)<=Math.round(t)&&Math.round(t)<Math.round(r))return{top:n,row:o,bottom:r,height:i};n=r}return null})(i,o):((i,o)=>{let n=o;for(let o=i;o>=0;o--){const i=e.getRowHeight(o),r=n-i;if(Math.round(r)<=Math.round(t)&&Math.round(t)<Math.round(n))return{top:r,row:o,bottom:n,height:i};n=r}return null})(i,o)}function _M(t,e,i){if(0===t)return{left:0,col:0,right:0,width:0};if(e&&t>i.tableNoFrameWidth-i.getRightFrozenColsWidth()&&t<i.tableNoFrameWidth&&t<=i.getAllColsWidth())for(let e=0;e<i.rightFrozenColCount;e++)if(t>i.tableNoFrameWidth-i.getColsWidth(i.colCount-e-1,i.colCount-1))return{col:i.colCount-e-1,left:void 0,right:void 0,width:void 0};return wM(t,i)}function SM(t,e,i){if(0===t)return{top:0,row:0,bottom:0,height:0};if(e&&t>i.tableNoFrameHeight-i.getBottomFrozenRowsHeight()&&t<i.tableNoFrameHeight)for(let e=0;e<i.rightFrozenColCount;e++)if(t>i.tableNoFrameHeight-i.getRowsHeight(i.rowCount-e-1,i.rowCount-1))return{row:i.rowCount-e-1,top:void 0,bottom:void 0,height:void 0};return xM(t,i)}const{toBoxArray:AM}=hw,{isTouchEvent:BM}=aw,RM=/^\$(\d+)\$(\d+)$/;!function(){if("node"===BC.mode)return;const t=document.createElement("style");t.id="vtable-style-styleSheet",t.textContent="\n.vtable .input-container {\n\tposition: absolute;\n\ttop:0px;\n}\n.vtable .table-scrollable {\n\tposition: absolute;\n\toverflow: scroll;\n}\n.vtable .table-scrollable::-webkit-scrollbar-button{\n\tbackground-color: transparent;\n}\n.vtable .table-scrollable::-webkit-scrollbar-track-piece{\n\tbackground-color: transparent;\n}\n.vtable .table-scrollable::-webkit-scrollbar-corner {\n\tbackground-color: transparent;\n}\n.vtable .table-scrollable::-webkit-scrollbar-thumb {\n\tborder-radius : 4px;\n\tbackground-color : rgba(100, 100, 100, .5);\n}\n\n.vtable .table-scroll-end-point {\n\topacity: 0;\n\tposition: relative;\n}\n.vtable {\n\t/* 设置overflow: auto 应该是为了滚动条的某个问题 但设置了auto之后 dom的下拉菜单只能显示在vtable节点中 超出会截断;现在去掉auto 暂时滚动条的问题没有发现 */\n\t/* overflow: auto; */\n\tposition: relative;\n\twidth: 100%;\n\theight: 100%;\n\ttext-align: left;\n -webkit-font-smoothing:auto;\n\n overflow: hidden; // for react-vtable dom custom element\n}\n\n.vtable-gantt {\n\t/* 设置overflow: auto 应该是为了滚动条的某个问题 但设置了auto之后 dom的下拉菜单只能显示在vtable节点中 超出会截断;现在去掉auto 暂时滚动条的问题没有发现 */\n\t/* overflow: auto; */\n\tposition: absolute;\n\twidth: 100%;\n\theight: 100%;\n\ttext-align: left;\n -webkit-font-smoothing:auto;\n\n overflow: hidden; // for react-vtable dom custom element\n}\n.vtable .table-component-container {\n pointer-events: none;\n overflow: hidden;\n position: absolute;\n top: 0px;\n left: 0px;\n}\n.vtable > canvas {\n\tposition: absolute;\n\twidth: 0;\n\theight: 0;\n}\n.vtable .table-focus-control {\n\tposition: relative !important;\n\twidth: 1px;\n\theight: 1px;\n\topacity: 0;\n\tpadding: 0;\n\tmargin: 0;\n\tbox-sizing: border-box;\n\tpointer-events: none;\n\tmax-width: 500px;\n\tmax-height: 500px;\n\tfloat: none !important;\n}\n.vtable input.table-focus-control::-ms-clear {\n\tvisibility: hidden;\n}\n.vtable input.table-focus-control.composition {\n\topacity: 1;\n\tmax-width: none;\n\tmax-height: none;\n}\n",document.head.appendChild(t)}();const MM={};class TM extends sC{static get EVENT_TYPE(){return cw}constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};var i,o,n,r,s,l,a,h,d,c,u;if(super(),this.showFrozenIcon=!0,this.version="1.5.3",this.id=`VTable${Date.now()}`,this.isReleased=!1,this._chartEventMap={},this.throttleInvalidate=function(t,e){let i=null;return function(){for(var o=arguments.length,n=new Array(o),r=0;r<o;r++)n[r]=arguments[r];i||(i=setTimeout((()=>{t.apply(this,n),i=null}),e))}}(this.render.bind(this),200),!t&&"node"!==e.mode)throw new Error("vtable's container is undefined");const{frozenColCount:g=0,frozenRowCount:p,defaultRowHeight:f=40,defaultHeaderRowHeight:m,defaultColWidth:b=80,defaultHeaderColWidth:v,widthMode:y="standard",heightMode:C="standard",autoFillWidth:w=!1,autoFillHeight:x=!1,widthAdaptiveMode:_="only-body",heightAdaptiveMode:S="only-body",keyboardOptions:A,eventOptions:B,rowSeriesNumber:R,columnResizeMode:M,rowResizeMode:T="none",dragHeaderMode:k,showFrozenIcon:P,allowFrozenColCount:E,padding:L,hover:H,menu:z,select:F,customRender:I,pixelRatio:O=wR,renderChartAsync:D,renderChartAsyncBatchCount:W,mode:N,modeParams:G,canvasWidth:j,canvasHeight:V,overscrollBehavior:U,limitMinWidth:$,limitMinHeight:X,clearDOM:Y=!0}=e;this.container=t,this.options=e,this._widthMode=y,this._heightMode=C,this._widthAdaptiveMode=_,this._heightAdaptiveMode=S,this._autoFillWidth=w,this._autoFillHeight=x,this.customRender=I,this.padding={top:0,right:0,left:0,bottom:0},L&&("number"==typeof L?(this.padding.top=L,this.padding.left=L,this.padding.bottom=L,this.padding.right=L):(L.top&&(this.padding.top=L.top),L.bottom&&(this.padding.bottom=L.bottom),L.left&&(this.padding.left=L.left),L.right&&(this.padding.right=L.right))),Q(V)&&Q(j)&&(this.canvasSizeSeted=!0),this.tableNoFrameWidth=0,this.tableNoFrameHeight=0,this.canvasWidth=j,this.canvasHeight=V,this.columnWidthComputeMode=null!==(i=e.columnWidthComputeMode)&&void 0!==i?i:"normal";const K=this.internalProps={};if(void 0!==P&&(this.showFrozenIcon=P),"number"==typeof E&&E<=0&&(this.showFrozenIcon=!1),"node"!==BC.mode&&(K.element=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"vtable";var i,o;const n=document.createElement("div");n.setAttribute("tabindex","0"),n.classList.add(e),n.style.outline="none",n.style.margin=`${t.top}px ${t.right}px ${t.bottom}px ${t.left}px`;const r=(n.offsetWidth||(null===(i=n.parentElement)||void 0===i?void 0:i.offsetWidth)||1)-1,s=(n.offsetHeight||(null===(o=n.parentElement)||void 0===o?void 0:o.offsetHeight)||1)-1;return n.style.width=r&&r-t.left-t.right+"px"||"0px",n.style.height=s&&s-t.top-t.bottom+"px"||"0px",n}(this.padding),K.focusControl=new ZR(this,K.element),K.canvas=document.createElement("canvas"),K.element.appendChild(K.canvas),K.context=K.canvas.getContext("2d"),(null===(o=e.customConfig)||void 0===o?void 0:o.createReactContainer)&&(K.bodyDomContainer=document.createElement("div"),K.bodyDomContainer.classList.add("table-component-container"),K.element.appendChild(K.bodyDomContainer),K.headerDomContainer=document.createElement("div"),K.headerDomContainer.classList.add("table-component-container"),K.element.appendChild(K.headerDomContainer))),K.handler=new fw,at(this.options.resizeTime)&&(K.handler.resizeTime=this.options.resizeTime),K.pixelRatio=O,K.frozenColCount=g,K.frozenRowCount=p,K.defaultRowHeight=f,K.defaultHeaderRowHeight=null!=m?m:f,K.defaultColWidth=b,K.defaultHeaderColWidth=null!=v?v:b,K.keyboardOptions=A,K.eventOptions=B,K.rowSeriesNumber=R,K.columnResizeMode=M,K.rowResizeMode=T,K.dragHeaderMode=null!=k?k:"none",K.renderChartAsync=D,tA(W),K.overscrollBehavior=null!=U?U:"auto",K._rowHeightsMap=new uM(this),K._rowRangeHeightsMap=new Map,K._colRangeWidthsMap=new Map,K._widthResizedColMap=new Set,K._heightResizedRowMap=new Set,this.colWidthsMap=new bw,this.colContentWidthsMap=new bw,this.colWidthsLimit={},K.calcWidthContext={_:K,get full(){var t;return"node"===BC.mode?j/(null!=O?O:1):this._.canvas.width/(null!==(t=this._.context.pixelRatio)&&void 0!==t?t:window.devicePixelRatio)}},K.cellTextOverflows={},K.focusedTable=!1,K.theme=Gw.of(null!==(n=e.theme)&&void 0!==n?n:Gw.DEFAULT),K.theme.isPivot=this.isPivotTable(),t?(Y&&(t.innerHTML=""),t.appendChild(K.element),this._updateSize()):this._updateSize(),this.options=e,K.theme=Gw.of(null!==(r=e.theme)&&void 0!==r?r:Gw.DEFAULT),K.theme.isPivot=this.isPivotTable(),K.bodyHelper=new TR(this),K.headerHelper=new qR(this),K.rowSeriesNumberHelper=new pM(this),K.autoWrapText=e.autoWrapText,K.enableLineBreak=e.enableLineBreak,K.allowFrozenColCount=null!==(s=e.allowFrozenColCount)&&void 0!==s?s:0,K.limitMaxAutoWidth=null!==(l=e.limitMaxAutoWidth)&&void 0!==l?l:450,K.limitMinWidth=null!=$?"number"==typeof $?$:$?10:0:10,K.limitMinHeight=null!=X?"number"==typeof X?X:X?10:0:10,this.scenegraph=new class{constructor(t){let e,i;var o;this._needUpdateContainer=!1,this.table=t,this.hasFrozen=!1,this.clear=!0,this.mergeMap=new Map,o=this.table.theme.textPopTipStyle,St(Hb.poptip,Lb,o),"node"===BC.mode?(du.setEnv("node",t.options.modeParams),e=t.canvasWidth,i=t.canvasHeight):(du.setEnv("browser"),e=t.canvas.width,i=t.canvas.height),this.stage=Hu(Object.assign({canvas:t.canvas,width:e,height:i,disableDirtyBounds:!1,background:t.theme.underlayBackgroundColor,dpr:t.internalProps.pixelRatio,enableLayout:!0,afterRender:()=>{this.table.fireListeners("after_render",null)}},t.options.renderOption)),this.stage.defaultLayer.setTheme({group:{boundsPadding:0,strokeBoundsBuffer:0,lineJoin:"round"},text:{ignoreBuf:!0}}),this.initSceneGraph(),this.stage.defaultLayer.add(this.tableGroup),this.stage.table=this.table,this.createComponent()}get width(){var t,e;return null!==(e=null===(t=this.tableGroup.attribute)||void 0===t?void 0:t.width)&&void 0!==e?e:0}get height(){var t,e;return null!==(e=null===(t=this.tableGroup.attribute)||void 0===t?void 0:t.height)&&void 0!==e?e:0}get x(){var t,e;return null!==(e=null===(t=this.tableGroup.attribute)||void 0===t?void 0:t.x)&&void 0!==e?e:0}get y(){var t,e;return null!==(e=null===(t=this.tableGroup.attribute)||void 0===t?void 0:t.y)&&void 0!==e?e:0}get bodyRowStart(){var t;return null!==(t=this.proxy.rowStart)&&void 0!==t?t:0}get bodyRowEnd(){var t;return null!==(t=this.proxy.rowEnd)&&void 0!==t?t:this.table.rowCount-1}get bodyColStart(){var t;return null!==(t=this.proxy.colStart)&&void 0!==t?t:0}get bodyColEnd(){var t;return null!==(t=this.proxy.colEnd)&&void 0!==t?t:this.table.colCount-1}initSceneGraph(){this.isPivot=this.table.isPivotTable(),function(t){const e=t.table.tableNoFrameWidth,i=t.table.tableNoFrameHeight;t.tableGroup=new S_({x:0,y:0,width:e,height:i,clip:!0,pickable:!1}),t.tableGroup.role="table";const o=GB(0,0,!0);o.role="col-header",t.colHeaderGroup=o;const n=GB(0,0,!0);n.role="corner-header",t.cornerHeaderGroup=n;const r=GB(0,0,!0);r.role="row-header",t.rowHeaderGroup=r;const s=GB(e,0,!0);s.role="body",t.bodyGroup=s;const l=GB(0,0,!0);l.role="right-frozen",t.rightFrozenGroup=l;const a=GB(0,0,!0);a.role="bottom-frozen",t.bottomFrozenGroup=a;const h=GB(0,0);h.role="component",t.componentGroup=h;const d=GB(0,0,!0);d.role="corner-right-top-header",t.rightTopCornerGroup=d;const c=GB(0,0,!0);c.role="corner-right-bottom-header",t.rightBottomCornerGroup=c;const u=GB(0,0,!0);u.role="corner-left-bottom-header",t.leftBottomCornerGroup=u,t.tableGroup.addChild(s),t.tableGroup.addChild(r),t.tableGroup.addChild(a),t.tableGroup.addChild(o),t.tableGroup.addChild(l),t.tableGroup.addChild(c),t.tableGroup.addChild(d),t.tableGroup.addChild(u),t.tableGroup.addChild(n),t.tableGroup.addChild(h)}(this)}clearCells(){var t;(this.table.isPivotChart()||this.table._hasCustomRenderOrLayout())&&this.stage.pluginService.findPluginsByName("poptipForText").forEach((t=>{t.deactivate(this.stage.pluginService)})),this.clear=!0,this.hasFrozen=!1,this.mergeMap.clear(),this.colHeaderGroup.clear(),this.rowHeaderGroup.clear(),this.cornerHeaderGroup.clear(),this.bodyGroup.clear(),this.bottomFrozenGroup.clear(),this.rightFrozenGroup.clear(),this.rightTopCornerGroup.clear(),this.rightBottomCornerGroup.clear(),this.leftBottomCornerGroup.clear(),this.colHeaderGroup.setAttributes({x:0,y:0,width:0,height:0}),this.rowHeaderGroup.setAttributes({x:0,y:0,width:0,height:0}),this.cornerHeaderGroup.setAttributes({x:0,y:0,width:0,height:0}),this.bodyGroup.setAttributes({x:0,y:0,width:0,height:0}),this.rightFrozenGroup.setAttributes({x:0,y:0,width:0,height:0}),this.bottomFrozenGroup.setAttributes({x:0,y:0,width:0,height:0}),this.rightTopCornerGroup.setAttributes({x:0,y:0,width:0,height:0,visible:!1}),this.leftBottomCornerGroup.setAttributes({x:0,y:0,width:0,height:0,visible:!1}),this.rightBottomCornerGroup.setAttributes({x:0,y:0,width:0,height:0,visible:!1}),this.tableGroup.setAttributes({x:this.table.tableX,y:this.table.tableY,width:0,height:0}),this.tableGroup.border&&(this.tableGroup.parent.removeChild(this.tableGroup.border),delete this.tableGroup.border),null===(t=this.proxy)||void 0===t||t.release()}updateStageBackground(){this.stage.background=this.table.theme.underlayBackgroundColor,this.stage.renderNextFrame()}createComponent(){this.component=new GS(this.table),this.component.addToGroup(this.componentGroup),this.selectedRangeComponents=new Map,this.selectingRangeComponents=new Map}updateComponent(){this.component.updateStyle()}createSceneGraph(){arguments.length>0&&void 0!==arguments[0]&&arguments[0]||this.table.rowHeightsMap.clear(),(this.table.isPivotChart()||this.table._hasCustomRenderOrLayout())&&this.stage.pluginService.autoEnablePlugins.getContributions().forEach((t=>{"poptipForText"===t.name&&this.stage.pluginService.register(t)})),this.clear=!1,this.frozenColCount=this.table.frozenColCount,this.frozenRowCount=this.table.frozenRowCount,this.proxy=new wB(this.table),jS(this.tableGroup,this.table.theme.frameStyle,this.tableGroup.role,void 0,!0),this.table.isPivotChart()&&(YB(this.rightTopCornerGroup,this.table.theme.cornerRightTopCellStyle||this.table.theme.cornerHeaderStyle||{}),YB(this.leftBottomCornerGroup,this.table.theme.cornerLeftBottomCellStyle||this.table.theme.cornerHeaderStyle||{}),YB(this.rightBottomCornerGroup,this.table.theme.cornerRightBottomCellStyle||this.table.theme.cornerHeaderStyle||{})),this.proxy.createGroupForFirstScreen(this.cornerHeaderGroup,this.colHeaderGroup,this.rowHeaderGroup,this.rightFrozenGroup,this.bottomFrozenGroup,this.bodyGroup,0,0),this.afterScenegraphCreated()}renderSceneGraph(){this.stage.render()}getCell(t,e,i){var o,n,r,s,l,a;let h;if(h=this.table.rightFrozenColCount>0&&t>=this.table.colCount-this.table.rightFrozenColCount&&e<this.table.frozenRowCount?null===(o=this.rightTopCornerGroup.getColGroup(t))||void 0===o?void 0:o.getRowGroup(e):this.table.bottomFrozenRowCount>0&&e>=this.table.rowCount-this.table.bottomFrozenRowCount&&t<this.table.frozenColCount?null===(n=this.leftBottomCornerGroup.getColGroup(t))||void 0===n?void 0:n.getRowGroup(e):this.table.rightFrozenColCount>0&&this.table.bottomFrozenRowCount>0&&t>=this.table.colCount-this.table.rightFrozenColCount&&e>=this.table.rowCount-this.table.bottomFrozenRowCount?null===(r=this.rightBottomCornerGroup.getColGroup(t))||void 0===r?void 0:r.getRowGroup(e):this.table.rightFrozenColCount>0&&t>this.table.colCount-1-this.table.rightFrozenColCount?null===(s=this.rightFrozenGroup.getColGroup(t))||void 0===s?void 0:s.getRowGroup(e):this.table.bottomFrozenRowCount>0&&e>this.table.rowCount-1-this.table.bottomFrozenRowCount?null===(l=this.bottomFrozenGroup.getColGroup(t))||void 0===l?void 0:l.getRowGroup(e):null===(a=this.getColGroup(t,e<this.frozenRowCount))||void 0===a?void 0:a.getRowGroup(e),h&&"shadow-cell"===h.role&&!i){const i=this.table.getCellRange(t,e);i.start.col===t&&i.start.row===e||(h=this.getCell(i.start.col,i.start.row))}return h||jA}highPerformanceGetCell(t,e,i){return this.proxy.highPerformanceGetCell(t,e,i)}getColGroup(t){let e,i=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return e=t<this.frozenColCount&&i?this.cornerHeaderGroup.getColGroup(t):t<this.frozenColCount?this.rowHeaderGroup.getColGroup(t):i&&this.table.rightFrozenColCount>0&&t>this.table.colCount-1-this.table.rightFrozenColCount?this.rightTopCornerGroup.getColGroup(t):!i&&this.table.rightFrozenColCount>0&&t>this.table.colCount-1-this.table.rightFrozenColCount?this.rightFrozenGroup.getColGroup(t):i?this.colHeaderGroup.getColGroup(t):this.bodyGroup.getColGroup(t),e||void 0}getColGroupInBottom(t){if(this.table.bottomFrozenRowCount>0)return this.bottomFrozenGroup.getColGroup(t)}getColGroupInLeftBottomCorner(t){if(this.table.bottomFrozenRowCount>0)return this.leftBottomCornerGroup.getColGroup(t)}getColGroupInRightTopCorner(t){if(this.table.rightFrozenColCount>0)return this.rightTopCornerGroup.getColGroup(t)}getColGroupInRightBottomCorner(t){if(this.table.rightFrozenColCount>0&&this.table.bottomFrozenRowCount>0)return this.rightBottomCornerGroup.getColGroup(t)}getCellSize(t,e){const i=this.getCell(t,e),o=jw(this.table,t,e);let n=i.attribute.width,r=i.attribute.height;return o&&(n/=o.end.col-o.start.col+1,r/=o.end.row-o.start.row+1),{width:n,height:r}}updateNextFrame(){this.updateContainerSync(),this.resetAllSelectComponent(),this.stage.renderNextFrame()}resetAllSelectComponent(){var t,e,i;(null===(e=null===(t=this.table.stateManager.select)||void 0===t?void 0:t.ranges)||void 0===e?void 0:e.length)>0&&((i=this).selectingRangeComponents.forEach(((t,e)=>{_B(t,e,i)})),i.selectedRangeComponents.forEach(((t,e)=>{_B(t,e,i)})))}hideHoverIcon(t,e){!function(t,e,i){-1!==t&&-1!==e&&(XB(t,e,(t=>"mouseenter_cell"===t.attribute.visibleTime),(t=>{t.setAttribute("opacity",0);const e=t.parent.getChildByName("icon-back");e&&e.setAttribute("visible",!1)}),i),i.updateNextFrame())}(t,e,this)}showHoverIcon(t,e){!function(t,e,i){-1!==t&&-1!==e&&(XB(t,e,(t=>"mouseenter_cell"===t.attribute.visibleTime),(t=>{t.setAttribute("opacity",1)}),i),i.updateNextFrame())}(t,e,this)}hideClickIcon(t,e){!function(t,e,i){-1!==t&&-1!==e&&(XB(t,e,(t=>"click_cell"===t.attribute.visibleTime),(t=>{t.setAttribute("opacity",0)}),i),i.updateNextFrame())}(t,e,this)}showClickIcon(t,e){!function(t,e,i){-1!==t&&-1!==e&&(XB(t,e,(t=>"click_cell"===t.attribute.visibleTime),(t=>{t.setAttribute("opacity",1)}),i),i.updateNextFrame())}(t,e,this)}getIcon(t,e,i,o){return function(t,e,i,o,n){let r;return n.getCell(t,e).forEachChildren((t=>{t.role&&t.role.startsWith("icon")&&t.containsPoint(i,o,Si.GLOBAL)&&(r=t)})),r}(t,e,i,o,this)}setIconHoverStyle(t,e,i,o){!function(t,e,i,o,n){var r,s;if((t.attribute.backgroundColor||t.attribute.hoverImage)&&XB(e,i,(e=>e.name===t.name),(t=>{var e,i,o,n,r,s,l,a;if(t.attribute.backgroundColor){let h=t.parent.getChildByName("icon-back");h?h.setAttributes({x:(null!==(e=t.attribute.x)&&void 0!==e?e:0)+(t.AABBBounds.width()-t.backgroundWidth)/2,y:(null!==(i=t.attribute.y)&&void 0!==i?i:0)+(t.AABBBounds.height()-t.backgroundHeight)/2,dx:null!==(o=t.attribute.dx)&&void 0!==o?o:0,dy:null!==(n=t.attribute.dy)&&void 0!==n?n:0,width:t.backgroundWidth,height:t.backgroundHeight,fill:t.attribute.backgroundColor,cornerRadius:5,visible:!0}):(h=ba({x:(null!==(r=t.attribute.x)&&void 0!==r?r:0)+(t.AABBBounds.width()-t.backgroundWidth)/2,y:(null!==(s=t.attribute.y)&&void 0!==s?s:0)+(t.AABBBounds.height()-t.backgroundHeight)/2,dx:null!==(l=t.attribute.dx)&&void 0!==l?l:0,dy:null!==(a=t.attribute.dy)&&void 0!==a?a:0,width:t.backgroundWidth,height:t.backgroundHeight,fill:t.attribute.backgroundColor,cornerRadius:5,pickable:!1,visible:!0}),h.name="icon-back"),t.parent.insertBefore(h,t)}t.attribute.hoverImage&&t.attribute.image!==t.attribute.hoverImage&&(t.image=t.attribute.hoverImage)}),n),t.tooltip){const{x1:o,x2:l,y1:a,y2:h}=t.globalAABBBounds,d={content:t.tooltip.title,referencePosition:{rect:{left:o,right:l,top:a,bottom:h,width:t.globalAABBBounds.width(),height:t.globalAABBBounds.height()},placement:t.tooltip.placement},disappearDelay:t.tooltip.disappearDelay,style:Object.assign({},null===(r=n.table.internalProps.theme)||void 0===r?void 0:r.tooltipStyle,null===(s=t.tooltip)||void 0===s?void 0:s.style)};n.table.internalProps.tooltipHandler.isBinded(d)||n.table.showTooltip(e,i,d)}}(t,e,i,0,this)}updateSortIcon(t,e,i,o,n,r,s){UB(t,e,i,o,n,r,s,this)}updateFrozenIcon(t,e){!function(t){for(let e=0;e<t.table.colCount;e++)for(let i=0;i<t.table.columnHeaderLevelCount;i++)XB(e,i,(t=>"frozen"===t.attribute.funcType),(o=>{const n=t.table.internalProps.headerHelper.getFrozenIcon(e,i);L_(n,o),o.name=n.name}),t)}(this)}updateHierarchyIcon(t,e){!function(t,e,i){let o;o=i.table.isHeader(t,e)?i.table.internalProps.headerHelper.getHierarchyIcon(t,e):i.table.internalProps.bodyHelper.getHierarchyIcon(t,e),XB(t,e,(t=>t.attribute.funcType===iC.collapse||t.attribute.funcType===iC.expand),(t=>{L_(o,t),t.name=o.name}),i)}(t,e,this)}setIconNormalStyle(t,e,i){!function(t,e,i,o){(t.attribute.backgroundColor||t.attribute.hoverImage)&&XB(e,i,(e=>e.name===t.name),(t=>{const e=t.parent.getChildByName("icon-back");e&&e.setAttribute("visible",!1),t.attribute.hoverImage&&t.attribute.image!==t.attribute.originImage&&(t.image=t.attribute.originImage)}),o)}(t,e,i,this)}residentHoverIcon(t,e){!function(t,e,i){XB(t,e,(t=>t.attribute.funcType===iC.dropDown),(t=>{t.oldVisibleTime=t.attribute.visibleTime,t.setAttribute("visibleTime","always"),t.setAttribute("opacity",1)}),i)}(t,e,this)}resetResidentHoverIcon(t,e){!function(t,e,i){XB(t,e,(t=>t.attribute.funcType===iC.dropDown),(t=>{t.oldVisibleTime&&t.setAttribute("visibleTime",t.oldVisibleTime),t.setAttribute("opacity","always"===t.attribute.visibleTime?1:0)}),i)}(t,e,this)}deactivateChart(t,e){var i,o;if(-1===t||-1===e)return;const n=this.getCell(t,e);null===(o=null===(i=null==n?void 0:n.firstChild)||void 0===i?void 0:i.deactivate)||void 0===o||o.call(i)}activateChart(t,e){var i,o;if(-1===t||-1===e)return;const n=this.getCell(t,e);null===(o=null===(i=null==n?void 0:n.firstChild)||void 0===i?void 0:i.activate)||void 0===o||o.call(i,this.table)}removeInteractionBorder(t,e){const i=this.getCell(t,e);i.setAttribute("highlightStroke",void 0),i.setAttribute("highlightStrokeArrayWidth",void 0),i.setAttribute("highlightStrokeArrayColor",void 0)}createCellSelectBorder(t,e,i,o,n,r,s){!function(t,e,i,o,n,r,s,l){var a,h,d,c,u,g,p;let f=!!(null===(a=t.table.options.excelOptions)||void 0===a?void 0:a.fillHandle);if((null===(h=t.table.stateManager.select.ranges)||void 0===h?void 0:h.length)>1)f=!1,t.removeFillHandleFromSelectComponents();else if(1===(null===(d=t.table.stateManager.select.ranges)||void 0===d?void 0:d.length)){const e=Math.max(t.table.stateManager.select.ranges[0].start.row,t.table.stateManager.select.ranges[0].end.row),i=Math.max(t.table.stateManager.select.ranges[0].start.col,t.table.stateManager.select.ranges[0].end.col);t.table.isHeader(i,e)&&(f=!1)}!Array.isArray(l)||!1!==l[1]&&!1!==l[2]||(f=!1);const m=Math.min(e,o),b=Math.min(i,n),v=Math.max(e,o),y=Math.max(i,n),C=t.highPerformanceGetCell(m,b).globalAABBBounds,w=t.highPerformanceGetCell(v,y).globalAABBBounds,x=t.table.theme,_=null===(c=x.selectionStyle)||void 0===c?void 0:c.cellBorderColor,S=null===(u=x.selectionStyle)||void 0===u?void 0:u.cellBorderLineWidth,A=ba({pickable:!1,fill:null!==(p=null===(g=x.selectionStyle)||void 0===g?void 0:g.cellBgColor)&&void 0!==p?p:"rgba(0, 0, 255,0.1)",lineWidth:S,stroke:l.map((t=>!!t&&_)),x:C.x1-t.tableGroup.attribute.x,y:C.y1-t.tableGroup.attribute.y,width:0,height:0,visible:!0});let B;f&&(B=ba({pickable:!1,fill:_,stroke:_,x:w.x2-3,y:w.y2-3,width:6,height:6,visible:!0})),t.lastSelectId=s,t.selectingRangeComponents.set(`${m}-${b}-${v}-${y}-${s}`,{rect:A,fillhandle:B,role:r}),t.tableGroup.insertAfter(A,"body"===r?t.bodyGroup:"columnHeader"===r?t.colHeaderGroup:"rowHeader"===r?t.rowHeaderGroup:"cornerHeader"===r?t.cornerHeaderGroup:"rightTopCorner"===r?t.rightTopCornerGroup:"rightFrozen"===r?t.rightFrozenGroup:"leftBottomCorner"===r?t.leftBottomCornerGroup:"bottomFrozen"===r?t.bottomFrozenGroup:t.rightBottomCornerGroup),f&&t.tableGroup.insertAfter(B,"body"===r?t.bodyGroup:"columnHeader"===r?t.colHeaderGroup:"rowHeader"===r?t.rowHeaderGroup:"cornerHeader"===r?t.cornerHeaderGroup:"rightTopCorner"===r?t.rightTopCornerGroup:"rightFrozen"===r?t.rightFrozenGroup:"leftBottomCorner"===r?t.leftBottomCornerGroup:"bottomFrozen"===r?t.bottomFrozenGroup:t.rightBottomCornerGroup)}(this,t,e,i,o,n,r,s)}moveSelectingRangeComponentsToSelectedRangeComponents(){RB(this)}deleteLastSelectedRangeComponents(){var t;(t=this).selectedRangeComponents.forEach(((e,i)=>{var o;i.split("-")[4]===t.lastSelectId&&(e.rect.delete(),null===(o=e.fillhandle)||void 0===o||o.delete(),t.selectedRangeComponents.delete(i))}))}deleteAllSelectBorder(){MB(this)}updateCellSelectBorder(t){SB(this,t,!(arguments.length>1&&void 0!==arguments[1])||arguments[1])}removeFillHandleFromSelectComponents(){this.selectedRangeComponents.forEach(((t,e)=>{var i;null===(i=t.fillhandle)||void 0===i||i.delete(),t.fillhandle=void 0}))}recreateAllSelectRangeComponents(){MB(this),this.table.stateManager.select.ranges.forEach((t=>{SB(this,t)})),RB(this)}updateColWidth(t,e,i,o){(function(t,e,i,o){o||t.table._setColWidth(e,t.table.getColWidth(e)+i,!0);const n=t.getColGroup(e,!0),r=t.getColGroupInRightTopCorner(e);n&&!r&&wS(n,i,"col-corner",t),r&&wS(r,i,"right-top",t);const s=t.getColGroup(e);s&&wS(s,i,"row-body",t);const l=t.getColGroupInLeftBottomCorner(e);l&&wS(l,i,"left-bottom",t);const a=t.getColGroupInBottom(e);a&&wS(a,i,"bottom",t);const h=t.getColGroupInRightBottomCorner(e);h&&wS(h,i,"right-bottom",t),e<t.frozenColCount?(t.cornerHeaderGroup.forEachChildrenSkipChild(((t,o)=>{t.col>e&&t.setAttribute("x",t.attribute.x+i)})),t.rowHeaderGroup.forEachChildrenSkipChild(((t,o)=>{t.col>e&&t.setAttribute("x",t.attribute.x+i)}))):(t.colHeaderGroup.forEachChildrenSkipChild(((t,o)=>{t.col>e&&t.setAttribute("x",t.attribute.x+i)})),t.bodyGroup.forEachChildrenSkipChild(((t,o)=>{t.col>e&&t.setAttribute("x",t.attribute.x+i)}))),l&&t.leftBottomCornerGroup.forEachChildrenSkipChild(((t,o)=>{t.col>e&&t.setAttribute("x",t.attribute.x+i)})),a&&t.bottomFrozenGroup.forEachChildrenSkipChild(((t,o)=>{t.col>e&&t.setAttribute("x",t.attribute.x+i)})),h&&t.rightBottomCornerGroup.forEachChildrenSkipChild(((t,o)=>{t.col>e&&t.setAttribute("x",t.attribute.x+i)}))})(this,t,Math.round(e),o),i||this.updateContainer(!0)}updateChartSize(t){!function(t,e){var i,o;for(let o=e;o<=t.proxy.colEnd;o++){const e=t.getColGroup(o);null===(i=null==e?void 0:e.getChildren())||void 0===i||i.forEach((e=>{const i=t.table.getColWidth(e.col),o=t.table.getRowHeight(e.row);e.children.forEach((t=>{"chart"===t.type&&(t.cacheCanvas=null,t.setAttribute("width",Math.ceil(i-t.attribute.cellPadding[3]-t.attribute.cellPadding[1])),t.setAttribute("height",Math.ceil(o-t.attribute.cellPadding[0]-t.attribute.cellPadding[2])))}))}))}if(!t.table.isPivotChart()&&t.table.rightFrozenColCount>=1)for(let e=t.table.colCount-t.table.rightFrozenColCount;e<=t.table.colCount-1;e++){const i=t.getColGroup(e);null===(o=null==i?void 0:i.getChildren())||void 0===o||o.forEach((e=>{const i=t.table.getColWidth(e.col),o=t.table.getRowHeight(e.row);e.children.forEach((t=>{"chart"===t.type&&(t.cacheCanvas=null,t.setAttribute("width",Math.ceil(i-t.attribute.cellPadding[3]-t.attribute.cellPadding[1])),t.setAttribute("height",Math.ceil(o-t.attribute.cellPadding[0]-t.attribute.cellPadding[2])))}))}))}}(this,t)}updateChartState(t){this.table.isPivotChart()&&function(t,e){const i=t.table;if(i.isPivotChart()){const o=i._selectedDataItemsInChart.length;if((null===e||0===(null==e?void 0:e.length)||0===Object.keys(e).length)&&0===o)return;const n=[];if(Array.isArray(e))e.forEach((t=>{if(t&&0!==t.key&&Object.keys(t).length>0){const e={};for(const i in t)i.startsWith("VGRAMMAR_")||i.startsWith("__VCHART")||(e[i]=t[i]);n.push(e)}}));else if(e&&0!==e.key&&Object.keys(e).length>0){const t={};for(const i in e)i.startsWith("VGRAMMAR_")||i.startsWith("__VCHART")||(t[i]=e[i]);n.push(t)}Rt(i._selectedDataItemsInChart,n)||(i._selectedDataItemsInChart=n,i.internalProps.layoutMap.updateDataStateToChartInstance(),NB(t),i.scenegraph.updateNextFrame())}}(this,t)}updateCheckboxCellState(t,e,i){var o,n;this.table.transpose?null===(o=this.bodyGroup.children)||void 0===o||o.forEach((t=>{t.getChildAt(e).getChildren().forEach((t=>{"checkbox"===t.name&&t.setAttribute("checked",i)}))})):null===(n=this.getColGroup(t).children)||void 0===n||n.forEach((t=>{t.getChildren().find((t=>{"checkbox"===t.name&&t.setAttribute("checked",i)}))}))}updateHeaderCheckboxCellState(t,e,i){var o,n;this.table.transpose?null===(o=this.rowHeaderGroup.children)||void 0===o||o.forEach((t=>{t.getChildAt(e).getChildren().forEach((t=>{"checkbox"===t.name&&("indeterminate"===i?(t.setAttribute("indeterminate",!0),t.setAttribute("checked",void 0)):(t.setAttribute("indeterminate",void 0),t.setAttribute("checked",i)))}))})):null===(n=this.getColGroup(t,!0).children)||void 0===n||n.forEach((t=>{t.getChildren().find((t=>{"checkbox"===t.name&&("indeterminate"===i?(t.setAttribute("indeterminate",!0),t.setAttribute("checked",void 0)):(t.setAttribute("indeterminate",void 0),t.setAttribute("checked",i)))}))}))}updateAutoColWidth(t){this.table.internalProps._widthResizedColMap.delete(t);const e=this.table.getColWidth(t),i=IA(t,0,this.table.rowCount-1,this.table,!0);i!==e&&this.updateColWidth(t,i-e)}recalculateColWidths(){const t=this.table;"adaptive"===t.widthMode||t.autoFillWidth||t.internalProps.transpose?FA(this.table,0,this.table.colCount-1,!0):(t._clearColRangeWidthsMap(),t.frozenColCount>0&&FA(this.table,0,t.frozenColCount-1,!0),t.rightFrozenColCount>0&&FA(this.table,t.rightFrozenColCount,t.colCount-1,!0),FA(t,this.proxy.colStart,this.proxy.colEnd,!0))}recalculateRowHeights(){const t=this.table;t.internalProps.useOneRowHeightFillAll=!1,"adaptive"===t.heightMode||t.autoFillHeight?cS(this.table,0,this.table.rowCount-1,!0,!0):(t.frozenRowCount>0&&cS(this.table,0,t.frozenRowCount-1,!0,!0),t.bottomFrozenRowCount>0&&cS(this.table,t.bottomFrozenRowCount,t.rowCount-1,!0,!0),cS(t,this.proxy.rowStart,this.proxy.rowEnd,!0,!0))}resize(){this.proxy.resize(),("adaptive"===this.table.widthMode||this.table.autoFillWidth)&&(0===this.table.internalProps._widthResizedColMap.size?this.recalculateColWidths():this.dealWidthMode()),"adaptive"===this.table.heightMode?0===this.table.internalProps._heightResizedRowMap.size?this.recalculateRowHeights():this.dealHeightMode():this.table.autoFillHeight&&this.dealHeightMode(),this.resetFrozen(),this.updateTableSize(),this.updateBorderSizeAndPosition(),this.component.updateScrollBar(),("adaptive"===this.table.widthMode||"adaptive"===this.table.heightMode||this.table.autoFillWidth||this.table.autoFillHeight)&&this.updateChartSize(this.table.rowHeaderLevelCount),this.proxy.progress(),this.updateNextFrame()}updateTableSize(){var t,e,i,o;this.tableGroup.setAttributes({x:this.table.tableX,y:this.table.tableY,width:Math.min(this.table.tableNoFrameWidth,Math.max(this.colHeaderGroup.attribute.width,this.bodyGroup.attribute.width,this.bottomFrozenGroup.attribute.width,0)+Math.max(this.cornerHeaderGroup.attribute.width,this.rowHeaderGroup.attribute.width,this.leftBottomCornerGroup.attribute.width,0)+Math.max(this.rightTopCornerGroup.attribute.width,this.rightFrozenGroup.attribute.width,this.rightBottomCornerGroup.attribute.width,0)),height:Math.min(this.table.tableNoFrameHeight,Math.max(this.colHeaderGroup.attribute.height,this.cornerHeaderGroup.attribute.height,this.rightTopCornerGroup.attribute.height,0)+Math.max(this.rowHeaderGroup.attribute.height,this.bodyGroup.attribute.height,this.rightFrozenGroup.attribute.height,0)+Math.max(this.leftBottomCornerGroup.attribute.height,this.bottomFrozenGroup.attribute.height,this.rightBottomCornerGroup.attribute.height,0))}),this.tableGroup.border&&"rect"===this.tableGroup.border.type?(null===(t=this.table.theme.frameStyle)||void 0===t?void 0:t.innerBorder)?this.tableGroup.border.setAttributes({x:this.table.tableX+this.tableGroup.border.attribute.lineWidth/2,y:this.table.tableY+this.tableGroup.border.attribute.lineWidth/2,width:this.tableGroup.attribute.width-this.tableGroup.border.attribute.lineWidth,height:this.tableGroup.attribute.height-this.tableGroup.border.attribute.lineWidth}):this.tableGroup.border.setAttributes({x:this.table.tableX-this.tableGroup.border.attribute.lineWidth/2,y:this.table.tableY-this.tableGroup.border.attribute.lineWidth/2,width:this.tableGroup.attribute.width+this.tableGroup.border.attribute.lineWidth,height:this.tableGroup.attribute.height+this.tableGroup.border.attribute.lineWidth}):this.tableGroup.border&&"group"===this.tableGroup.border.type&&((null===(e=this.table.theme.frameStyle)||void 0===e?void 0:e.innerBorder)?(this.tableGroup.border.setAttributes({x:this.table.tableX+this.tableGroup.border.attribute.lineWidth/2,y:this.table.tableY+this.tableGroup.border.attribute.lineWidth/2,width:this.tableGroup.attribute.width-this.tableGroup.border.attribute.lineWidth,height:this.tableGroup.attribute.height-this.tableGroup.border.attribute.lineWidth}),null===(i=this.tableGroup.border.firstChild)||void 0===i||i.setAttributes({x:0,y:0,width:this.tableGroup.attribute.width-this.tableGroup.border.attribute.lineWidth,height:this.tableGroup.attribute.height-this.tableGroup.border.attribute.lineWidth})):(this.tableGroup.border.setAttributes({x:this.table.tableX-this.tableGroup.border.attribute.lineWidth/2,y:this.table.tableY-this.tableGroup.border.attribute.lineWidth/2,width:this.tableGroup.attribute.width+this.tableGroup.border.attribute.lineWidth,height:this.tableGroup.attribute.height+this.tableGroup.border.attribute.lineWidth}),null===(o=this.tableGroup.border.firstChild)||void 0===o||o.setAttributes({x:this.tableGroup.border.attribute.lineWidth/2,y:this.tableGroup.border.attribute.lineWidth/2,width:this.tableGroup.attribute.width,height:this.tableGroup.attribute.height}))),this.table.bottomFrozenRowCount>0&&(this.bottomFrozenGroup.setAttribute("y",this.tableGroup.attribute.height-this.table.getBottomFrozenRowsHeight()),this.leftBottomCornerGroup.setAttributes({visible:!0,y:this.tableGroup.attribute.height-this.table.getBottomFrozenRowsHeight(),height:this.table.getBottomFrozenRowsHeight(),width:this.table.getFrozenColsWidth()}),this.rightBottomCornerGroup.setAttributes({visible:!0,y:this.tableGroup.attribute.height-this.table.getBottomFrozenRowsHeight(),height:this.table.getBottomFrozenRowsHeight()})),this.table.rightFrozenColCount>0&&(this.rightFrozenGroup.setAttribute("x",this.tableGroup.attribute.width-this.table.getRightFrozenColsWidth()),this.rightTopCornerGroup.setAttributes({visible:!0,x:this.tableGroup.attribute.width-this.table.getRightFrozenColsWidth(),width:this.table.getRightFrozenColsWidth(),height:this.table.getFrozenRowsHeight()}),this.rightBottomCornerGroup.setAttributes({visible:!0,x:this.tableGroup.attribute.width-this.table.getRightFrozenColsWidth(),width:this.table.getRightFrozenColsWidth()}))}updateRowHeight(t,e,i){yS(this,t,e=Math.round(e),i),this.updateContainerHeight(t,e)}updateRowsHeight(t,e,i){for(let o=0;o<t.length;o++){const n=t[o];if(n>=this.proxy.rowStart&&n<=this.proxy.rowEnd){const t=e[o];yS(this,n,Math.round(t),i),this._updateContainerHeight(n,t)}}this.updateTableSize(),this.component.updateScrollBar(),this.updateNextFrame()}updateContainerWidth(t,e){t<this.frozenColCount?(this.rowHeaderGroup.setDeltaWidth(e),this.cornerHeaderGroup.setDeltaWidth(e),this.colHeaderGroup.setDeltaX(e),this.bodyGroup.setDeltaX(e)):(this.colHeaderGroup.setDeltaWidth(e),this.bodyGroup.setDeltaWidth(e)),this.updateTableSize(),this.component.updateScrollBar(),this.updateNextFrame()}_updateContainerHeight(t,e){t<this.table.frozenRowCount?(this.colHeaderGroup.setDeltaHeight(e),this.cornerHeaderGroup.setDeltaHeight(e),this.rowHeaderGroup.setDeltaY(e),this.bodyGroup.setDeltaY(e),this.table.rightFrozenColCount&&this.rightFrozenGroup.setDeltaY(e)):t>=this.table.rowCount-this.table.bottomFrozenRowCount?(this.leftBottomCornerGroup.setDeltaHeight(e),this.bottomFrozenGroup.setDeltaHeight(e),this.table.rightFrozenColCount&&this.rightBottomCornerGroup.setDeltaHeight(e)):(this.rowHeaderGroup.setDeltaHeight(e),this.bodyGroup.setDeltaHeight(e),this.table.rightFrozenColCount&&this.rightFrozenGroup.setDeltaHeight(e))}updateContainerHeight(t,e){this._updateContainerHeight(t,e),this.updateTableSize(),this.component.updateScrollBar(),this.updateNextFrame()}setColWidth(t,e){const i=this.table.getColWidth(t);i!==e&&(this.updateColWidth(t,e-i),this.table._clearColRangeWidthsMap(t))}setRowHeight(t,e){const i=this.table.getRowHeight(t);i!==e&&((t>=this.proxy.rowStart&&t<=this.proxy.rowEnd||t>=this.table.rowCount-this.table.bottomFrozenRowCount&&t<=this.table.rowCount-1||t<this.table.frozenRowCount)&&this.updateRowHeight(t,e-i),this.table._clearRowRangeHeightsMap(t))}setX(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.table.scenegraph.proxy.setX(-t,e)}setY(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.table.scenegraph.proxy.setY(-t,e)}setBodyAndRowHeaderY(t){var e,i;const o=null===(e=this.bodyGroup.firstChild)||void 0===e?void 0:e.firstChild,n=null===(i=this.bodyGroup.firstChild)||void 0===i?void 0:i.lastChild;0===t&&o&&o.row===this.table.frozenRowCount&&o.attribute.y+t<0?t=-o.attribute.y:n&&this.table.tableNoFrameHeight<this.table.getAllRowsHeight()&&n.row===this.table.rowCount-this.table.bottomFrozenRowCount-1&&n.attribute.y+n.attribute.height+t<this.table.tableNoFrameHeight-this.table.getFrozenRowsHeight()-this.table.getBottomFrozenRowsHeight()&&(t=this.table.tableNoFrameHeight-this.table.getFrozenRowsHeight()-this.table.getBottomFrozenRowsHeight()-n.attribute.y-n.attribute.height),this.colHeaderGroup.attribute.height+t!==this.bodyGroup.attribute.y&&(this.bodyGroup.setAttribute("y",this.colHeaderGroup.attribute.height+t),this.rowHeaderGroup.setAttribute("y",this.cornerHeaderGroup.attribute.height+t),this.table.rightFrozenColCount>0&&this.rightFrozenGroup.setAttribute("y",this.rightTopCornerGroup.attribute.height+t),this.updateNextFrame())}setBodyAndColHeaderX(t){const e=this.bodyGroup.firstChild,i=this.bodyGroup.lastChild;0===t&&e&&e.col===this.table.frozenColCount&&e.attribute.x+t<0?t=-e.attribute.x:i&&this.table.tableNoFrameWidth<this.table.getAllColsWidth()&&i.col===this.table.colCount-this.table.rightFrozenColCount-1&&i.attribute.x+i.attribute.width+t<this.table.tableNoFrameWidth-this.table.getFrozenColsWidth()-this.table.getRightFrozenColsWidth()&&(t=this.table.tableNoFrameWidth-this.table.getFrozenColsWidth()-this.table.getRightFrozenColsWidth()-i.attribute.x-i.attribute.width),this.table.getFrozenColsWidth()+t!==this.bodyGroup.attribute.x&&(this.bodyGroup.setAttribute("x",this.table.getFrozenColsWidth()+t),this.colHeaderGroup.setAttribute("x",this.table.getFrozenColsWidth()+t),this.table.bottomFrozenRowCount>0&&this.bottomFrozenGroup.setAttribute("x",this.table.getFrozenColsWidth()+t),this.updateNextFrame())}afterScenegraphCreated(){this.isPivot||this.table.transpose?this.table.options.frozenColCount?this.component.setFrozenColumnShadow(this.table.frozenColCount-1):this.table.options.rightFrozenColCount?this.component.setRightFrozenColumnShadow(this.table.colCount-this.table.rightFrozenColCount):this.component.setFrozenColumnShadow(-1):(this.component.setFrozenColumnShadow(this.table.frozenColCount-1),this.component.setRightFrozenColumnShadow(this.table.colCount-this.table.rightFrozenColCount)),this.table.stateManager.checkFrozen(),this.updateContainer(),this.createFrameBorder(),this.updateBorderSizeAndPosition(),this.component.updateScrollBar(),pB(this.table),this.table.options.animationAppear&&function(t){var e,i,o,n;if(!t.options.animationAppear)return;let r,s,l,a;!0===t.options.animationAppear?(r=500,s=0,l="one-by-one",a="column"):(r=null!==(e=t.options.animationAppear.duration)&&void 0!==e?e:500,s=null!==(i=t.options.animationAppear.delay)&&void 0!==i?i:0,l=null!==(o=t.options.animationAppear.type)&&void 0!==o?o:"one-by-one",a=null!==(n=t.options.animationAppear.direction)&&void 0!==n?n:"row");const{scenegraph:h,frozenColCount:d,frozenRowCount:c}=t,{colStart:u,colEnd:g,rowStart:p,rowEnd:f}=h.proxy;for(let t=0;t<=g;t++)for(let e=0;e<=f;e++){const i=h.highPerformanceGetCell(t,e);i&&"cell"===i.role&&i.forEachChildren((i=>{i.setAttribute("opacity",0),i.animate().wait("one-by-one"===l?("row"===a?e:t)*(r-s):s).to({opacity:1},r,"linear")}))}}(this.table),this.updateNextFrame()}dealWidthMode(){const t=this.table;if("adaptive"===t.widthMode){t._clearColRangeWidthsMap();const e=t.tableNoFrameWidth;let i=0;for(let e=0;e<t.colCount;e++)(e<t.rowHeaderLevelCount||t.isPivotChart()&&e>=t.colCount-t.rightFrozenColCount)&&(i+=t.getColWidth(e));GA(e-i,t.rowHeaderLevelCount,t.isPivotChart()?t.colCount-t.rightFrozenColCount:t.colCount,!1,[],t,!0)}else if(t.autoFillWidth){t._clearColRangeWidthsMap();const e=t.tableNoFrameWidth;let i=0,o=0;for(let e=0;e<t.colCount;e++){const n=t.getColWidth(e);(e<t.rowHeaderLevelCount||t.isPivotChart()&&e>=t.colCount-t.rightFrozenColCount)&&(i+=n),o+=n}o<e&&o>i&&GA(e-i,t.rowHeaderLevelCount,t.isPivotChart()?t.colCount-t.rightFrozenColCount:t.colCount,!1,[],t,!0)}let e=0;this.bodyGroup.forEachChildrenSkipChild((t=>{e+=t.attribute.width})),this.bodyGroup.setAttribute("width",e);let i=0;this.colHeaderGroup.forEachChildrenSkipChild((t=>{i+=t.attribute.width})),this.colHeaderGroup.setAttribute("width",i);let o=0;this.rowHeaderGroup.forEachChildrenSkipChild((t=>{o+=t.attribute.width})),this.rowHeaderGroup.setAttribute("width",o);let n=0;this.cornerHeaderGroup.forEachChildrenSkipChild((t=>{n+=t.attribute.width})),this.cornerHeaderGroup.setAttribute("width",n),this.colHeaderGroup.setAttribute("x",this.cornerHeaderGroup.attribute.width),this.rowHeaderGroup.setAttribute("y",this.cornerHeaderGroup.attribute.height),this.bodyGroup.setAttributes({x:this.rowHeaderGroup.attribute.width,y:this.colHeaderGroup.attribute.height})}dealHeightMode(){var t;const e=this.table;if("adaptive"===e.heightMode){e._clearRowRangeHeightsMap();const t=e.getRowsHeight(0,e.columnHeaderLevelCount-1),i=e.isPivotChart()?e.getBottomFrozenRowsHeight():0,o=e.tableNoFrameHeight-t-i,n=e.columnHeaderLevelCount,r=e.isPivotChart()?e.rowCount-e.bottomFrozenRowCount:e.rowCount;let s=0;for(let t=n;t<r;t++)s+=e.getRowHeight(t);const l=o/s;for(let t=n;t<r;t++){let i;i=t===r-1?o-e.getRowsHeight(n,r-2):Math.round(e.getRowHeight(t)*l),this.setRowHeight(t,i)}}else if(e.autoFillHeight){e._clearRowRangeHeightsMap();const i=e.tableNoFrameHeight;let o=0,n=0;for(let t=0;t<e.rowCount;t++){const i=e.getRowHeight(t);(t<e.columnHeaderLevelCount||e.isPivotChart()&&t>=e.rowCount-e.bottomFrozenRowCount)&&(n+=i),o+=i}if((null!==(t=this._dealAutoFillHeightOriginRowsHeight)&&void 0!==t?t:o)<i&&o-n>0){const t=e.columnHeaderLevelCount,r=e.isPivotChart()?e.rowCount-e.bottomFrozenRowCount:e.rowCount,s=(i-n)/(o-n);for(let o=t;o<r;o++){let l;l=o===r-1?i-n-e.getRowsHeight(t,r-2):Math.round(e.getRowHeight(o)*s),this.setRowHeight(o,l)}}}}dealFrozen(){!function(t){var e,i;if(t.table.frozenColCount>t.table.rowHeaderLevelCount){t.rowHeaderGroup.setAttribute("height",t.bodyGroup.attribute.height),t.rowHeaderGroup.setAttribute("y",t.bodyGroup.attribute.y),t.cornerHeaderGroup.setAttribute("height",t.colHeaderGroup.attribute.height);for(let e=0;e<t.table.frozenColCount-t.table.rowHeaderLevelCount;e++)HB(t),zB(t),OB(t)}else if(t.table.frozenColCount<t.table.rowHeaderLevelCount){t.bodyGroup.setAttribute("height",t.rowHeaderGroup.attribute.height),t.bodyGroup.setAttribute("y",t.rowHeaderGroup.attribute.y),t.colHeaderGroup.setAttribute("height",t.cornerHeaderGroup.attribute.height);for(let e=0;e<t.table.rowHeaderLevelCount-t.table.frozenColCount;e++)FB(t),IB(t),DB(t)}t.bodyGroup.setAttribute("x",t.rowHeaderGroup.attribute.width),t.colHeaderGroup.setAttribute("x",t.cornerHeaderGroup.attribute.width),t.updateContainer(),t.updateBorderSizeAndPosition(),t.isPivot||t.table.transpose?t.table.options.frozenColCount?t.component.setFrozenColumnShadow(t.table.frozenColCount-1):t.table.options.frozenColCount&&t.component.setRightFrozenColumnShadow(t.table.colCount-t.table.rightFrozenColCount):(t.component.setFrozenColumnShadow(t.table.frozenColCount-1),t.component.setRightFrozenColumnShadow(t.table.colCount-t.table.rightFrozenColCount)),t.hasFrozen=!0,t.frozenColCount=t.table.frozenColCount,t.frozenRowCount=null!==(i=null===(e=t.colHeaderGroup.firstChild)||void 0===e?void 0:e.childrenCount)&&void 0!==i?i:0}(this)}resetFrozen(){!function(t){var e,i;if(t.frozenColCount>t.table.frozenColCount){t.bodyGroup.setAttribute("height",t.rowHeaderGroup.attribute.height),t.bodyGroup.setAttribute("y",t.rowHeaderGroup.attribute.y),t.colHeaderGroup.setAttribute("height",t.cornerHeaderGroup.attribute.height);for(let e=0;e<t.frozenColCount-t.table.frozenColCount;e++)FB(t),IB(t),DB(t)}else if(t.frozenColCount<t.table.frozenColCount){t.rowHeaderGroup.setAttribute("height",t.bodyGroup.attribute.height),t.rowHeaderGroup.setAttribute("y",t.bodyGroup.attribute.y),t.cornerHeaderGroup.setAttribute("height",t.colHeaderGroup.attribute.height);for(let e=0;e<t.table.frozenColCount-t.frozenColCount;e++)HB(t),zB(t),OB(t)}t.deleteAllSelectBorder(),t.table.stateManager.select.ranges.forEach((e=>{t.updateCellSelectBorder(e)})),t.frozenColCount=t.table.frozenColCount,t.frozenRowCount=null!==(i=null===(e=t.colHeaderGroup.firstChild)||void 0===e?void 0:e.childrenCount)&&void 0!==i?i:0,t.proxy.colStart=t.table.frozenColCount,t.bodyGroup.setAttribute("x",t.rowHeaderGroup.attribute.width),t.colHeaderGroup.setAttribute("x",t.cornerHeaderGroup.attribute.width),t.updateContainer(),t.updateBorderSizeAndPosition(),t.isPivot||t.table.transpose?t.table.options.frozenColCount?t.component.setFrozenColumnShadow(t.table.frozenColCount-1):t.table.options.rightFrozenColCount&&t.component.setRightFrozenColumnShadow(t.table.colCount-t.table.rightFrozenColCount):(t.component.setFrozenColumnShadow(t.table.frozenColCount-1),t.component.setRightFrozenColumnShadow(t.table.colCount-t.table.rightFrozenColCount)),t.hasFrozen=!0}(this)}updateCellLayoutWidthCertainWidth(t,e,i){const o=t.attribute.width;let n=!1;return t.forEachChildren(((t,r)=>{r+=e;const s=jw(this.table,i,r);s?t=this.getCell(s.start.col,s.start.row):t.setAttribute("width",o);const l=vx(R_("padding",this.table._getCellStyle(i,r),i,r,this.table)),a=t.getChildByName("text");let h=0,d=0;if(a)h=a.AABBBounds.height()+(l[0]+l[2]),a.setAttribute("maxLineWidth",o-(l[1]+l[3])),d=a.AABBBounds.height()+(l[0]+l[2]);else{const e=t.getChildAt(1);h=e.AABBBounds.height()+(l[0]+l[2]),e._cellWidth=o-(l[1]+l[3]),e.layout(),d=e.AABBBounds.height()+(l[0]+l[2])}const c=this.table.getRowHeight(r);t.attribute.height!==d&&(t.setAttribute("height",d),(c===h||d>c)&&(n=!0))})),n}updateHeaderPosition(t,e,i,o,n){!function(t,e,i,o,n,r){const s=r.scenegraph;for(let i=t;i<=e;i++){const t=r.getColWidth(i),e=r.scenegraph.getColGroup(i,!0),o=r.scenegraph.getColGroup(i),n=r.scenegraph.getColGroupInBottom(i),s=r.scenegraph.getColGroupInLeftBottomCorner(i),l=r.scenegraph.getColGroupInRightBottomCorner(i);e&&(e.setAttribute("width",t),e.forEachChildren((e=>{e.setAttribute("width",t)}))),o&&(o.setAttribute("width",t),o.forEachChildren((e=>{e.setAttribute("width",t)}))),n&&(n.setAttribute("width",t),n.forEachChildren((e=>{e.setAttribute("width",t)}))),l&&(l.setAttribute("width",t),l.forEachChildren((e=>{e.setAttribute("width",t)}))),s&&(s.setAttribute("width",t),s.forEachChildren((e=>{e.setAttribute("width",t)})))}if(s.updateContainer(),"column"===n)for(let i=t;i<=e;i++){const t=r.scenegraph.getColGroup(i);null==t||t.setAttribute("chartInstance",void 0);for(let t=0;t<=r.frozenRowCount-1;t++)s.updateCellContent(i,t);for(let t=s.bodyRowStart;t<=s.bodyRowEnd;t++)s.updateCellContent(i,t);for(let t=r.rowCount-r.bottomFrozenRowCount;t<=r.rowCount-1;t++)s.updateCellContent(i,t)}else{for(let t=0;t<=r.frozenColCount-1;t++){const e=r.scenegraph.getColGroup(t);null==e||e.setAttribute("chartInstance",void 0);for(let e=i;e<=o;e++)s.updateCellContent(t,e)}for(let t=s.bodyColStart;t<=s.bodyColEnd;t++){const e=r.scenegraph.getColGroup(t);null==e||e.setAttribute("chartInstance",void 0);for(let e=i;e<=o;e++)s.updateCellContent(t,e)}for(let t=r.colCount-r.rightFrozenColCount;t<=r.colCount-1;t++){const e=r.scenegraph.getColGroup(t);null==e||e.setAttribute("chartInstance",void 0);for(let e=i;e<=o;e++)s.updateCellContent(t,e)}}}(t,e,i,o,n,this.table)}updateContainerAttrWidthAndX(){var t,e,i;const o=jB(this.cornerHeaderGroup,0),n=jB(this.rowHeaderGroup,0),r=this.colHeaderGroup.hasChildNodes()&&this.colHeaderGroup.firstChild?jB(this.colHeaderGroup,this.colHeaderGroup.firstChild.col>0?this.table.getColsWidth(null!==(t=this.table.frozenColCount)&&void 0!==t?t:0,this.colHeaderGroup.firstChild.col-1):0):0,s=this.bodyGroup.hasChildNodes()&&this.bodyGroup.firstChild?jB(this.bodyGroup,this.bodyGroup.firstChild.col>0?this.table.getColsWidth(null!==(e=this.table.frozenColCount)&&void 0!==e?e:0,this.bodyGroup.firstChild.col-1):0):0,l=jB(this.rightFrozenGroup,0);this.bottomFrozenGroup.hasChildNodes()&&this.bottomFrozenGroup.firstChild&&jB(this.bottomFrozenGroup,this.bottomFrozenGroup.firstChild.col>0?this.table.getColsWidth(null!==(i=this.table.frozenColCount)&&void 0!==i?i:0,this.bottomFrozenGroup.firstChild.col-1):0),jB(this.leftBottomCornerGroup,0),jB(this.rightTopCornerGroup,0),jB(this.rightBottomCornerGroup,0),this.cornerHeaderGroup.setDeltaWidth(o-this.cornerHeaderGroup.attribute.width),this.leftBottomCornerGroup.setDeltaWidth(o-this.leftBottomCornerGroup.attribute.width),this.colHeaderGroup.setDeltaWidth(r-this.colHeaderGroup.attribute.width),this.rowHeaderGroup.setDeltaWidth(n-this.rowHeaderGroup.attribute.width),this.bottomFrozenGroup.setDeltaWidth(r-this.bottomFrozenGroup.attribute.width),this.rightFrozenGroup.setDeltaWidth(l-this.rightFrozenGroup.attribute.width),this.rightTopCornerGroup.setDeltaWidth(l-this.rightTopCornerGroup.attribute.width),this.rightBottomCornerGroup.setDeltaWidth(l-this.rightBottomCornerGroup.attribute.width),this.bodyGroup.setDeltaWidth(s-this.bodyGroup.attribute.width),this.colHeaderGroup.setAttribute("x",this.cornerHeaderGroup.attribute.width),this.bottomFrozenGroup.setAttribute("x",this.table.getFrozenColsWidth()),this.bodyGroup.setAttribute("x",this.rowHeaderGroup.attribute.width)}updateContainer(){arguments.length>0&&void 0!==arguments[0]&&arguments[0]?this._needUpdateContainer||(this._needUpdateContainer=!0,setTimeout((()=>{this.updateContainerSync()}),0)):(this._needUpdateContainer=!0,this.updateContainerSync())}updateContainerSync(){this._needUpdateContainer&&(this._needUpdateContainer=!1,this.updateContainerAttrWidthAndX(),this.updateTableSize(),this.component.updateScrollBar(),this.updateDomContainer(),this.updateNextFrame())}updateCellContentWhileResize(t,e){const i=this.table.getBodyColumnType(t,e),o=this.getCell(t,e);"image"!==i&&"video"!==i||W_(o,t,e,0,0,this.table)}createFrameBorder(){this.updateTableSize();const t=!this.isPivot&&!this.table.internalProps.transpose;jS(this.bodyGroup,this.table.theme.bodyStyle.frameStyle,this.bodyGroup.role,t?[!0,!0,!0,!1]:void 0),jS(this.rowHeaderGroup,this.isPivot||this.table.internalProps.transpose?this.table.theme.rowHeaderStyle.frameStyle:this.table.theme.bodyStyle.frameStyle,this.rowHeaderGroup.role,t?[!0,!1,!0,!0]:void 0),jS(this.colHeaderGroup,this.table.theme.headerStyle.frameStyle,this.colHeaderGroup.role,t?[!0,!0,!0,!1]:void 0),jS(this.cornerHeaderGroup,this.isPivot?this.table.theme.cornerHeaderStyle.frameStyle:this.table.theme.headerStyle.frameStyle,this.cornerHeaderGroup.role,t?[!0,!1,!0,!0]:void 0),jS(this.tableGroup,this.table.theme.frameStyle,this.tableGroup.role,void 0)}getResizeColAt(t,e,i){let o,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:8;if(!i){const i=this.table.getDrawRange();return e>=i.top&&e<=i.bottom?(o=this.table.getCellAtRelativePosition(t-n,e),o):{col:-1,row:-1}}return t<i.globalAABBBounds.x1+n?o={col:i.col-1,row:i.row,x:i.globalAABBBounds.x1}:i.globalAABBBounds.x2-n<t&&(o={col:i.col,row:i.row,x:i.globalAABBBounds.x2}),o&&this.table.rightFrozenColCount>0&&o.col===this.table.colCount-this.table.rightFrozenColCount-1&&this.table.tableNoFrameWidth-this.table.getFrozenColsWidth()-this.table.getRightFrozenColsWidth()+this.table.scrollLeft<this.bodyGroup.attribute.width&&(o.col=o.col+1,o.rightFrozen=!0),o||{col:-1,row:-1}}getResizeRowAt(t,e,i){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:8;if(i){let t;if(e<i.globalAABBBounds.y1+o?t={col:i.col,row:i.row-1,y:i.globalAABBBounds.y1}:i.globalAABBBounds.y2-o<e&&(t={col:i.col,row:i.row,y:i.globalAABBBounds.y2}),t&&this.table.bottomFrozenRowCount>0&&t.row===this.table.rowCount-this.table.bottomFrozenRowCount-1&&this.table.tableNoFrameHeight-this.table.getFrozenRowsHeight()-this.table.getBottomFrozenRowsHeight()+this.table.scrollTop<this.bodyGroup.attribute.height&&(t.row=t.row+1,t.bottomFrozen=!0),t)return t}return{col:-1,row:-1}}updateFrozen(){this.clear||(this.resetFrozen(),this.component.updateScrollBar())}dealWidthRightFrozen(t){this.clear?this.table.internalProps.rightFrozenColCount=t:function(t,e){const{table:i,proxy:o,rightTopCornerGroup:n,rightFrozenGroup:r,rightBottomCornerGroup:s,bottomFrozenGroup:l,bodyGroup:a,colHeaderGroup:h}=e,d=e.table.rightFrozenColCount;if(t>d){for(let o=i.colCount-d-1;o>=i.colCount-t;o--)WB(r,e.getColGroup(o),r.firstChild),WB(n,e.getColGroup(o,!0),n.firstChild),WB(s,e.getColGroupInBottom(o),s.firstChild);let o=0;r.forEachChildren((t=>{t.setAttribute("x",o),o+=t.attribute.width})),o=0,n.forEachChildren((t=>{t.setAttribute("x",o),o+=t.attribute.width})),o=0,s.forEachChildren((t=>{t.setAttribute("x",o),o+=t.attribute.width}))}else if(t<d){for(let o=i.colCount-d;o<i.colCount-t;o++){const t=e.getColGroup(o);t.setAttribute("x",a.lastChild.attribute.x+i.getColWidth(a.lastChild.col)),a.appendChild(t);const n=e.getColGroupInRightTopCorner(o);n.setAttribute("x",h.lastChild.attribute.x+i.getColWidth(h.lastChild.col)),h.appendChild(n);const r=e.getColGroupInRightBottomCorner(o);r.setAttribute("x",l.lastChild.attribute.x+i.getColWidth(l.lastChild.col)),l.appendChild(r)}let o=0;r.forEachChildren((t=>{t.setAttribute("x",o),o+=t.attribute.width})),o=0,n.forEachChildren((t=>{t.setAttribute("x",o),o+=t.attribute.width})),o=0,s.forEachChildren((t=>{t.setAttribute("x",o),o+=t.attribute.width}))}r.setAttribute("width",i.getColsWidth(i.colCount-t,i.colCount-1)),n.setAttribute("width",i.getColsWidth(i.colCount-t,i.colCount-1)),s.setAttribute("width",i.getColsWidth(i.colCount-t,i.colCount-1)),i.internalProps.rightFrozenColCount=t,e.updateContainer(),e.component.updateScrollBar(),e.updateNextFrame()}(t,this)}dealWidthBottomFrozen(t){this.clear?this.table.internalProps.bottomFrozenRowCount=t:function(t,e){const{table:i,proxy:o,bottomFrozenGroup:n,leftBottomCornerGroup:r,rightBottomCornerGroup:s}=e;n.childrenCount||(o.table.isPivotChart()||(XA(r,0,0,0,i.frozenColCount-1,0,-1,"rowHeader",i),XA(s,0,0,i.colCount-i.rightFrozenColCount,i.colCount-1,0,-1,"body",i)),XA(n,0,0,o.colStart,o.colEnd,0,-1,"body",i));const l=e.table.bottomFrozenRowCount;if(t>l){for(let o=0;o<i.frozenColCount;o++){const n=e.getColGroupInLeftBottomCorner(o);for(let r=i.rowCount-l-1;r>=i.rowCount-t;r--)WB(n,e.getCell(o,r,!0),n.firstChild);let r=0;n.forEachChildren((t=>{t.setAttribute("y",r),r+=i.getRowHeight(t.row)}))}for(let n=o.colStart;n<=o.colEnd;n++){const o=e.getColGroupInBottom(n);for(let r=i.rowCount-l-1;r>=i.rowCount-t;r--)WB(o,e.getCell(n,r,!0),o.firstChild);let r=0;o.forEachChildren((t=>{t.setAttribute("y",r),r+=i.getRowHeight(t.row)}))}if(i.rightFrozenColCount>0)for(let o=i.colCount-i.rightFrozenColCount;o<i.colCount;o++){const n=e.getColGroupInRightBottomCorner(o);for(let r=i.rowCount-l-1;r>=i.rowCount-t;r--)WB(n,e.getCell(o,r,!0),n.firstChild);let r=0;n.forEachChildren((t=>{t.setAttribute("y",r),r+=i.getRowHeight(t.row)}))}}else if(t<l){for(let o=0;o<i.rowHeaderLevelCount;o++){const n=e.getColGroup(o);for(let r=i.rowCount-l;r<i.rowCount-t;r++){const t=e.getCell(o,r,!0);t.setAttribute("y",n.lastChild.attribute.y+i.getRowHeight(n.lastChild.row)),n.appendChild(t)}const r=e.getColGroupInLeftBottomCorner(o);let s=0;r.forEachChildren((t=>{t.setAttribute("y",s),s+=i.getRowHeight(t.row)}))}for(let n=o.colStart;n<=o.colEnd;n++){const o=e.getColGroup(n);for(let r=i.rowCount-l;r<i.rowCount-t;r++){const t=e.getCell(n,r,!0);t.setAttribute("y",o.lastChild.attribute.y+i.getRowHeight(o.lastChild.row)),o.appendChild(t)}const r=e.getColGroupInBottom(n);let s=0;r.forEachChildren((t=>{t.setAttribute("y",s),s+=i.getRowHeight(t.row)}))}if(i.rightFrozenColCount>0)for(let o=i.colCount-i.rightFrozenColCount;o<i.colCount;o++){const n=e.getColGroup(o);for(let r=i.rowCount-l;r<i.rowCount-t;r++){const t=e.getCell(o,r,!0);t.setAttribute("y",n.lastChild.attribute.y+i.getRowHeight(n.lastChild.row)),n.appendChild(t)}const r=e.getColGroupInRightBottomCorner(o);let s=0;r.forEachChildren((t=>{t.setAttribute("y",s),s+=i.getRowHeight(t.row)}))}}n.setAttribute("height",i.getRowsHeight(i.rowCount-t,i.rowCount-1)),r.setAttribute("height",i.getRowsHeight(i.rowCount-t,i.rowCount-1)),s.setAttribute("height",i.getRowsHeight(i.rowCount-t,i.rowCount-1)),i.internalProps.bottomFrozenRowCount=t,e.updateContainer(),e.component.updateScrollBar(),e.updateNextFrame()}(t,this)}updateBorderSizeAndPosition(){this.bodyGroup.border&&(this.bodyGroup.appendChild(this.bodyGroup.border),$S(this.bodyGroup),this.rowHeaderGroup.attribute.width,VS(this.bodyGroup,this.table.theme.bodyStyle.frameStyle)),this.colHeaderGroup.border&&(this.colHeaderGroup.appendChild(this.colHeaderGroup.border),$S(this.colHeaderGroup),this.cornerHeaderGroup.attribute.width,VS(this.colHeaderGroup,this.table.theme.headerStyle.frameStyle)),this.rowHeaderGroup.border&&(this.rowHeaderGroup.appendChild(this.rowHeaderGroup.border),$S(this.rowHeaderGroup)),this.cornerHeaderGroup.border&&(this.cornerHeaderGroup.appendChild(this.cornerHeaderGroup.border),$S(this.cornerHeaderGroup)),function(t){if(!t.theme.frameStyle.cornerRadius)return;const e=t.theme.frameStyle.cornerRadius,{cornerHeaderGroup:i,colHeaderGroup:o,rowHeaderGroup:n,bodyGroup:r,rightTopCornerGroup:s,leftBottomCornerGroup:l,rightBottomCornerGroup:a,rightFrozenGroup:h,bottomFrozenGroup:d}=t.scenegraph;i.setAttribute("cornerRadius",0),o.setAttribute("cornerRadius",0),n.setAttribute("cornerRadius",0),r.setAttribute("cornerRadius",0),s.setAttribute("cornerRadius",0),l.setAttribute("cornerRadius",0),a.setAttribute("cornerRadius",0),h.setAttribute("cornerRadius",0),d.setAttribute("cornerRadius",0),i.attribute.width>0&&i.attribute.height>0?XS(i,[e,0,0,0]):o.attribute.height>0?XS(o,[e,0,0,0]):n.attribute.width>0?XS(n,[e,0,0,0]):XS(r,[e,0,0,0]),l.attribute.width>0&&l.attribute.height>0?XS(l,[0,0,0,e]):d.attribute.height>0?XS(d,[0,0,0,e]):n.attribute.width>0?XS(n,[0,0,0,e]):XS(r,[0,0,0,e]),s.attribute.width>0&&s.attribute.height>0?XS(s,[0,e,0,0]):o.attribute.height>0?XS(o,[0,e,0,0]):h.attribute.width>0?XS(h,[0,e,0,0]):XS(r,[0,e,0,0]),a.attribute.width>0&&a.attribute.height>0?XS(a,[0,0,e,0]):h.attribute.width>0?XS(h,[0,0,e,0]):d.attribute.height>0?XS(d,[0,0,e,0]):XS(r,[0,0,e,0])}(this.table)}sortCell(){this.isPivot||(this.table.transpose?this.proxy.sortCellHorizontal():this.proxy.sortCellVertical())}getCellOverflowText(t,e){var i,o;const n=this.getCell(t,e).getChildByName("text",!0);if(n&&"text"===n.type){if(n.attribute.moreThanMaxCharacters)return this.table.getCellValue(t,e);const r=rt(n.attribute.text)?n.attribute.text.join(""):n.attribute.text;let s="";if(nt(n.cache.clipedText)?s=n.cache.clipedText:null===(o=null===(i=n.cache.layoutData)||void 0===i?void 0:i.lines)||void 0===o||o.forEach((t=>{s+=t.str})),s!==r)return this.table.getCellValue(t,e)}else if(n&&"richtext"===n.type){const i=n;if(i.attribute.ellipsis&&i._frameCache&&i.attribute.height<i._frameCache.actualHeight)return i.attribute.textConfig.find((t=>t.text)),this.table.getCellValue(t,e)}return null}updateDrill(t,e,i,o,n){this.component.drillIcon.update(t,e,i,o,n,this)}updateCellContent(t,e){if(!this.clear)return X_(t,e,this.table)}setPixelRatio(t){this.stage.disableDirtyBounds(),this.stage.window.setDpr(t),this.stage.render(),this.stage.enableDirtyBounds()}updateRow(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];this.table.internalProps.layoutMap.clearCellRangeMap(),this.table.internalProps.useOneRowHeightFillAll=!1;const o=WC(e.map((t=>t.row))).sort(((t,e)=>t-e)),n=WC(i.map((t=>t.row))).sort(((t,e)=>t-e)),r=this.table.getAllRowsHeight()-[...o,...n].reduce(((t,e)=>t+this.table.getRowHeight(e)),0)<=this.table.tableNoFrameHeight;if(TB(t,e,i,this.table),this.recalculateColWidths(),"adaptive"===this.table.heightMode||this.table.autoFillHeight&&(this.table.getAllRowsHeight()<=this.table.tableNoFrameHeight||r))this.table.scenegraph.recalculateRowHeights();else if("autoHeight"===this.table.heightMode)for(let t=0;t<n.length;t++){const e=n[t],i=this.table.getRowHeight(e),o=uS(e,0,this.table.colCount-1,this.table);(e>=this.proxy.rowStart&&e<=this.proxy.rowEnd||e>=this.table.rowCount-this.table.bottomFrozenRowCount&&e<=this.table.rowCount-1)&&this.table.scenegraph.updateRowHeight(e,o-i)}this.table.stateManager.checkFrozen(),this.isPivot||this.table.transpose?this.table.options.frozenColCount?this.component.setFrozenColumnShadow(this.table.frozenColCount-1):this.table.options.rightFrozenColCount&&this.component.setRightFrozenColumnShadow(this.table.colCount-this.table.rightFrozenColCount):(this.component.setFrozenColumnShadow(this.table.frozenColCount-1),this.component.setRightFrozenColumnShadow(this.table.colCount-this.table.rightFrozenColCount)),this.component.updateScrollBar(),this.updateNextFrame()}updateCol(t,e){KB(t,e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],this.table),this.recalculateColWidths(),this.recalculateRowHeights(),this.table.stateManager.checkFrozen(),this.isPivot||this.table.transpose?this.table.options.frozenColCount?this.component.setFrozenColumnShadow(this.table.frozenColCount-1):this.table.options.rightFrozenColCount&&this.component.setRightFrozenColumnShadow(this.table.colCount-this.table.rightFrozenColCount):(this.component.setFrozenColumnShadow(this.table.frozenColCount-1),this.component.setRightFrozenColumnShadow(this.table.colCount-this.table.rightFrozenColCount)),this.component.updateScrollBar(),this.updateNextFrame()}getColumnGroupX(t){return t<this.table.rowHeaderLevelCount?this.table.getColsWidth(0,t-1):t<this.table.colCount-this.table.rightFrozenColCount?this.table.getColsWidth(this.table.rowHeaderLevelCount,t-1):t<this.table.colCount?this.table.getColsWidth(this.table.colCount-this.table.bottomFrozenRowCount,t-1):0}getCellGroupY(t){return t<this.table.frozenRowCount?this.table.getRowsHeight(0,t-1):t<this.table.rowCount-this.table.bottomFrozenRowCount?this.table.getRowsHeight(this.table.frozenRowCount,t-1):t<this.table.rowCount?this.table.getRowsHeight(this.table.rowCount-this.table.bottomFrozenRowCount,t-1):0}getCellGroupX(t){return t<this.table.rowHeaderLevelCount?this.table.getColsWidth(0,t-1):t<this.table.colCount-this.table.rightFrozenColCount?this.table.getColsWidth(this.table.rowHeaderLevelCount,t-1):t<this.table.colCount?this.table.getColsWidth(this.table.colCount-this.table.rightFrozenColCount,t-1):0}updateDomContainer(){var t,e,i,o,n,r;const{headerDomContainer:s,bodyDomContainer:l}=this.table.internalProps;s&&(s.style.width=`${null!==(e=null===(t=s.parentElement)||void 0===t?void 0:t.offsetWidth)&&void 0!==e?e:0}px`,s.style.height=`${this.table.getFrozenRowsHeight()}px`),l&&(l.style.width=`${null!==(o=null===(i=l.parentElement)||void 0===i?void 0:i.offsetWidth)&&void 0!==o?o:0}px`,l.style.height=`${null!==(r=null===(n=l.parentElement)||void 0===n?void 0:n.offsetHeight)&&void 0!==r?r:0-this.table.getFrozenRowsHeight()}px`,l.style.top=`${this.table.getFrozenRowsHeight()}px`)}}(this),this.stateManager=new class{constructor(t){this.fastScrolling=!1,this.checkedState=[],this.headerCheckedState={},this._checkboxCellTypeFields=[],this._headerCheckFuncs={},this.radioState={},this.resetInteractionState=gw((()=>{this.updateInteractionState(Ky.default)}),100),this.table=t,this.initState(),this.updateVerticalScrollBar=this.updateVerticalScrollBar.bind(this),this.updateHorizontalScrollBar=this.updateHorizontalScrollBar.bind(this)}initState(){this._initState(),this.setHoverState(),this.setSelectState(),this.setFrozenState()}updateOptionSetState(){this._updateOptionSetState(),this.setHoverState(),this.setSelectState(),this.setFrozenState()}_updateOptionSetState(){this.interactionState=Ky.default,this.hoverIcon={col:-1,row:-1,icon:null},this.columnResize={col:-1,x:0,resizing:!1},this.rowResize={row:-1,y:0,resizing:!1},this.columnMove={colSource:-1,colTarget:-1,rowSource:-1,rowTarget:-1,x:0,y:0,moving:!1},this.menu={x:-1,y:-1,isShow:!1,itemList:[],bounds:new ye,highlightIndex:-1,dropDownMenuHighlight:[]},this.sort={col:-1,row:-1,order:"normal"},this.frozen={col:-1},this.tablePosition={absoluteX:0,absoluteY:0},this.drill={col:-1,row:-1},this.sparkLine={col:-1,row:-1}}_initState(){this.interactionState=Ky.default,this.select={highlightScope:qy.single,ranges:[],cellPos:{col:-1,row:-1},selecting:!1},this.fillHandle={isFilling:!1,startX:void 0,startY:void 0},this.hover={highlightScope:qy.single,cellPos:{col:-1,row:-1}},this.hoverIcon={col:-1,row:-1,icon:null},this.columnResize={col:-1,x:0,resizing:!1},this.rowResize={row:-1,y:0,resizing:!1},this.columnMove={colSource:-1,colTarget:-1,rowSource:-1,rowTarget:-1,x:0,y:0,moving:!1},this.menu={x:-1,y:-1,isShow:!1,itemList:[],bounds:new ye,highlightIndex:-1,dropDownMenuHighlight:[]},this.sort={col:-1,row:-1,order:"normal"},this.frozen={col:-1},this.scroll={horizontalBarPos:0,verticalBarPos:0},this.tablePosition={absoluteX:0,absoluteY:0},this.drill={col:-1,row:-1},this.sparkLine={col:-1,row:-1}}setHoverState(){var t;const{highlightMode:e,disableHover:i,disableHeaderHover:o}=null!==(t=this.table.options.hover)&&void 0!==t?t:{highlightMode:"cell"};i?this.hover.highlightScope=qy.none:"cross"===e?this.hover.highlightScope=qy.cross:"row"===e?this.hover.highlightScope=qy.row:"column"===e?this.hover.highlightScope=qy.column:"cell"===e&&(this.hover.highlightScope=qy.single),this.hover.singleStyle=!i,this.hover.disableHeader=o,(this.hover.highlightScope===qy.none||o)&&(this.hover.cellPosContainHeader={col:-1,row:-1})}setSelectState(){const{headerSelectMode:t,disableSelect:e,disableHeaderSelect:i,highlightMode:o}=Object.assign({},{headerSelectMode:"inline",disableSelect:!1,disableHeaderSelect:!1,highlightMode:"cell"},this.table.options.select);this.select.highlightScope=e?qy.none:"cross"===o?qy.cross:"row"===o?qy.row:"column"===o?qy.column:qy.single,this.select.singleStyle=!e,this.select.disableHeader=i,this.select.headerSelectMode=t}isSelected(t,e){let i=!1;return this.select.ranges.forEach((o=>{iw(o,t,e)&&(i=!0)})),i}setSortState(t){this.sort.field=null==t?void 0:t.field,this.sort.order=null==t?void 0:t.order}setFrozenState(){this.frozen.col=this.table.frozenColCount-1}updateInteractionState(t){if(this.interactionState===t)return;const e=this.interactionState;this.interactionState=t,e===Ky.scrolling&&Ky.default}updateHoverhighlightScope(t){this.hover.highlightScope!==t&&(this.hover.highlightScope=t)}updateHoverPos(t,e){nR(this,t,e)}updateSelectPos(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=arguments.length>3&&void 0!==arguments[3]&&arguments[3],n=arguments.length>4&&void 0!==arguments[4]&&arguments[4],r=arguments.length>5&&void 0!==arguments[5]&&arguments[5],s=arguments.length>6&&void 0!==arguments[6]&&arguments[6];-1!==e&&-1!==e&&(this.select.selecting=!0),function(t,e,i,o,n,r){let s=arguments.length>6&&void 0!==arguments[6]&&arguments[6],l=arguments.length>7&&void 0!==arguments[7]&&arguments[7];var a,h;const{table:d,interactionState:c}=t,{scenegraph:u}=d,{highlightScope:g,disableHeader:p,cellPos:f}=t.select;if((p&&d.isHeader(e,i)||"none"===g)&&(-1===e||-1===i||s||d._makeVisibleCell(e,i),e=-1,i=-1),-1!==e&&-1!==i&&!s)if(c===Ky.grabing&&t.select.ranges.length>0){const o=t.select.ranges[t.select.ranges.length-1];e>o.start.col&&e>o.end.col&&d._makeVisibleCell(e+1,i),i>o.start.row&&i>o.end.row&&d._makeVisibleCell(e,i+1),e<o.start.col&&e<o.end.col&&d._makeVisibleCell(e-1,i),i<o.start.row&&i<o.end.row&&d._makeVisibleCell(e,i-1)}else d._makeVisibleCell(e,i);if(r){t.select.ranges=[],u.deleteAllSelectBorder();let e=0,i=0;const{disableHeaderSelect:o,disableRowSeriesNumberSelect:n}=(null===(a=d.options.keyboardOptions)||void 0===a?void 0:a.selectAllOnCtrlA)||{};o&&(e=d.rowHeaderLevelCount,i=d.columnHeaderLevelCount),(n||o)&&d.options.rowSeriesNumber&&(e+=1),t.select.ranges.push({start:{col:e,row:i},end:{col:d.colCount-1,row:d.rowCount-1}});const r=t.select.ranges[t.select.ranges.length-1];u.updateCellSelectBorder(r,!1)}else if(-1===f.col||-1===f.row||-1!==e&&-1!==i)if(c!==Ky.default||d.eventManager.isDraging||d.stateManager.isResizeCol()){if((c===Ky.grabing||d.eventManager.isDraging)&&!d.stateManager.isResizeCol()){let o=!0;-1===f.col&&(f.col=e),-1===f.row&&(f.row=i),f.col=e,f.row=i;const n=t.select.ranges[t.select.ranges.length-1];if(n){if(d.internalProps.layoutMap.isSeriesNumberInBody(n.start.col,n.start.row))o=!1,n.end={col:d.colCount-1,row:i};else if(t.fillHandle.isFilling){if("top"===t.fillHandle.direction)if(i===t.fillHandle.beforeFillMinRow&&i===t.fillHandle.beforeFillMaxRow)n.start.row=n.end.row=i;else if(i<=t.fillHandle.beforeFillMinRow){if(n.start.row<n.end.row){const t=n.start.row;n.start.row=n.end.row,n.end.row=t}n.end.row=i}else i===t.fillHandle.beforeFillMaxRow&&(n.start.row>n.end.row?n.start.row=i:n.end.row=i);else if("bottom"===t.fillHandle.direction){if(i>=t.fillHandle.beforeFillMaxRow){if(n.start.row>n.end.row){const t=n.start.row;n.start.row=n.end.row,n.end.row=t}n.end.row=i}}else if("left"===t.fillHandle.direction)if(e===t.fillHandle.beforeFillMinCol&&e===t.fillHandle.beforeFillMaxCol)n.start.col=n.end.col=e;else if(e<=t.fillHandle.beforeFillMinCol){if(n.start.col<n.end.col){const t=n.start.col;n.start.col=n.end.col,n.end.col=t}n.end.col=e}else e===t.fillHandle.beforeFillMaxCol&&(n.start.col>n.end.col?n.start.col=e:n.end.col=e);else if("right"===t.fillHandle.direction&&e>=t.fillHandle.beforeFillMaxCol){if(n.start.col>n.end.col){const t=n.start.col;n.start.col=n.end.col,n.end.col=t}n.end.col=e}}else n.end={col:e,row:i},l&&(n.skipBodyMerge=!0);u.updateCellSelectBorder(n,o)}}}else{const r=t.select.ranges[t.select.ranges.length-1];if(o&&r){if(n||(f.col=e,f.row=i),"cell"!==t.select.headerSelectMode&&d.isColumnHeader(e,i)){const t=Math.min(r.start.col,r.end.col,e),o=Math.max(r.start.col,r.end.col,e),n=Math.min(r.start.row,r.end.row,i),s=d.rowCount-1;r.start={col:t,row:n},r.end={col:o,row:s}}else if("cell"!==t.select.headerSelectMode&&d.isRowHeader(e,i)){const t=Math.min(r.start.col,r.end.col,e),o=d.colCount-1,n=Math.min(r.start.row,r.end.row,i),s=Math.max(r.start.row,r.end.row,i);r.start={col:t,row:n},r.end={col:o,row:s}}else r.end={col:e,row:i};u.deleteLastSelectedRangeComponents(),u.updateCellSelectBorder(r)}else{let o=!0;if(-1===f.col||-1===f.row||n||(t.select.ranges=[],u.deleteAllSelectBorder()),"cell"!==t.select.headerSelectMode&&d.isColumnHeader(e,i)){const o=d.getCellRange(e,i);t.select.ranges.push({start:{col:o.start.col,row:i},end:{col:o.end.col,row:d.rowCount-1},skipBodyMerge:!0})}else if("cell"!==t.select.headerSelectMode&&d.isRowHeader(e,i)){const o=d.getCellRange(e,i);t.select.ranges.push({start:{col:e,row:o.start.row},end:{col:d.colCount-1,row:o.end.row},skipBodyMerge:!0})}else if(d.internalProps.layoutMap.isSeriesNumberInHeader(e,i))o=!1,t.select.ranges.push({start:{col:0,row:0},end:{col:d.colCount-1,row:d.rowCount-1},skipBodyMerge:!0});else if(d.internalProps.layoutMap.isSeriesNumberInBody(e,i))o=!1,t.select.ranges.push({start:{col:e,row:i},end:{col:d.colCount-1,row:i},skipBodyMerge:!0});else if(e>=0&&i>=0){const o=l?{start:{col:e,row:i},end:{col:e,row:i}}:d.getCellRange(e,i);t.select.ranges.push({start:{col:o.start.col,row:o.start.row},end:{col:o.end.col,row:o.end.row},skipBodyMerge:l||void 0})}f.col=e,f.row=i;const r=null===(h=t.select.ranges)||void 0===h?void 0:h[t.select.ranges.length-1];r&&u.updateCellSelectBorder(r,o)}}else f.col=-1,f.row=-1,t.select.ranges=[],u.deleteAllSelectBorder();u.updateNextFrame()}(this,t,e,i,o,n,r,s)}checkCellRangeInSelect(t,e){return function(t,e,i,o){for(let o=0;o<i.length;o++)if(nw(i[o],{start:t,end:e}))return!0;return!1}(t,e,this.select.ranges,this.select.highlightScope)}updateHoverIcon(t,e,i,o,n){var r,s,l,a,h,d,c,u,g;if((null===(r=this.residentHoverIcon)||void 0===r?void 0:r.icon)&&i===(null===(s=this.residentHoverIcon)||void 0===s?void 0:s.icon))return;const p=hR(i);if(p)if("richtext-icon"===p.type){const i=p.icon;if(this.hoverIcon.icon&&this.hoverIcon.icon!==(null===(a=this.residentHoverIcon)||void 0===a?void 0:a.icon)&&(this.table.scenegraph.setIconNormalStyle(this.hoverIcon.icon,this.hoverIcon.col,this.hoverIcon.row),this.hoverIcon.col=-1,this.hoverIcon.col=-1,this.hoverIcon.icon=null,this.table.scenegraph.updateNextFrame()),i.attribute.tooltip){const o={content:i.attribute.tooltip.title,referencePosition:{rect:p.position,placement:i.attribute.tooltip.placement},style:Object.assign({},null===(h=this.table.internalProps.theme)||void 0===h?void 0:h.tooltipStyle,null===(d=i.tooltip)||void 0===d?void 0:d.style,null===(u=null===(c=i.attribute)||void 0===c?void 0:c.tooltip)||void 0===u?void 0:u.style),disappearDelay:i.attribute.tooltip.disappearDelay};this.table.internalProps.tooltipHandler.isBinded(o)||this.table.showTooltip(t,e,o)}}else{const i=p.icon;i!==this.hoverIcon.icon&&(this.hoverIcon.icon&&this.hoverIcon.icon!==(null===(g=this.residentHoverIcon)||void 0===g?void 0:g.icon)&&this.table.scenegraph.setIconNormalStyle(this.hoverIcon.icon,this.hoverIcon.col,this.hoverIcon.row),this.hoverIcon.col=t,this.hoverIcon.row=e,this.hoverIcon.icon=i,this.table.scenegraph.setIconHoverStyle(i,t,e,o),this.table.scenegraph.updateNextFrame())}else this.hoverIcon.icon&&this.hoverIcon.icon!==(null===(l=this.residentHoverIcon)||void 0===l?void 0:l.icon)&&(this.table.scenegraph.setIconNormalStyle(this.hoverIcon.icon,this.hoverIcon.col,this.hoverIcon.row),this.hoverIcon.col=-1,this.hoverIcon.col=-1,this.hoverIcon.icon=null,this.table.scenegraph.updateNextFrame())}isResizeCol(){return this.columnResize.resizing}isResizeRow(){return this.rowResize.resizing}isFillHandle(){return this.fillHandle.isFilling}isSelecting(){return this.select.selecting}endSelectCells(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(this.select.selecting){if(this.select.selecting=!1,0===this.select.ranges.length)return;const e=this.select.ranges[this.select.ranges.length-1];let o=!1;for(let t=0;t<this.select.ranges.length-1;t++){const i=this.select.ranges[t];if(i&&i.start.col===e.start.col&&i.start.row===e.start.row&&i.end.col===e.end.col&&i.end.row===e.end.row){o=!0;break}}o?(this.select.ranges.pop(),(i=this.table.scenegraph).selectingRangeComponents.forEach(((t,e)=>{var i;t.rect.delete(),null===(i=t.fillhandle)||void 0===i||i.delete()})),i.selectingRangeComponents=new Map,this.table.scenegraph.selectingRangeComponents.clear()):this.table.scenegraph.moveSelectingRangeComponentsToSelectedRangeComponents();const n=this.select.ranges[this.select.ranges.length-1].end.col,r=this.select.ranges[this.select.ranges.length-1].end.row;t&&this.table.fireListeners(cw.SELECTED_CELL,{ranges:this.select.ranges,col:n,row:r})}else e&&0===this.select.ranges.length&&this.table.fireListeners(cw.SELECTED_CLEAR,{});var i}endResizeCol(){setTimeout((()=>{this.columnResize.resizing=!1}),0),this.table.scenegraph.updateChartSize(this.columnResize.col),this.checkFrozen(),this.table.scenegraph.component.hideResizeCol(),this.table.scenegraph.updateNextFrame()}startResizeCol(t,e,i,o){var n;this.columnResize.resizing=!0,this.columnResize.col=t,this.columnResize.x=e,this.columnResize.isRightFrozen=o,this.table.scenegraph.component.showResizeCol(t,i,o);const r=!!(null===(n=this.select.ranges)||void 0===n?void 0:n.length);this.updateSelectPos(-1,-1),this.endSelectCells(!0,r),this.table.scenegraph.updateNextFrame()}updateResizeCol(t,e){!function(t,e,i){t=Math.ceil(t),e=Math.ceil(e);let o=i.columnResize.isRightFrozen?i.columnResize.x-t:t-i.columnResize.x;if(Math.abs(o)<1)return;const n=i.table.getColWidth(i.columnResize.col);let r=n;r+=o;const s=i.table.getMinColWidth(i.columnResize.col),l=i.table.getMaxColWidth(i.columnResize.col);if(r<s||r>l){if(n===s||n===l)return;o=n-s>l-n?l-n:s-n}let a=i.table.getColWidth(i.columnResize.col)+o;if(a<i.table.internalProps.limitMinWidth&&(a=i.table.internalProps.limitMinWidth,o=a-i.table.getColWidth(i.columnResize.col)),"adaptive"===i.table.widthMode&&i.columnResize.col<i.table.colCount-1){const t=i.table.getColWidth(i.columnResize.col+1),e=i.table.getMinColWidth(i.columnResize.col+1),n=i.table.getMaxColWidth(i.columnResize.col+1);let r=t;if(r-=o,r<e||r>n){if(t===e||t===n)return;o=t-e>n-t?n-t:e-t}r-o<i.table.internalProps.limitMinWidth&&(o=r-i.table.internalProps.limitMinWidth)}o=Math.ceil(o),i.columnResize.col<i.table.rowHeaderLevelCount||i.columnResize.col>=i.table.colCount-i.table.rightFrozenColCount?dR(o,i):"indicator"===i.table.internalProps.columnResizeType?function(t,e){const i=e.table.internalProps.layoutMap;let o,n,r;if(i.indicatorsAsCol)o=i.getIndicatorKey(e.columnResize.col,e.table.columnHeaderLevelCount);else{const t=i.getCellHeaderPaths(e.columnResize.col,e.table.columnHeaderLevelCount-1),o=t.colHeaderPaths[t.colHeaderPaths.length-1];n=o.dimensionKey,r=o.value}for(let s=e.table.rowHeaderLevelCount;s<e.table.colCount-e.table.rightFrozenColCount;s++){const l=i.getIndicatorKey(s,e.table.columnHeaderLevelCount);if(i.indicatorsAsCol&&l===o)e.table.scenegraph.updateColWidth(s,t),e.table.internalProps._widthResizedColMap.add(s);else if(!i.indicatorsAsCol){const o=i.getCellHeaderPaths(s,e.table.columnHeaderLevelCount-1),l=null==o?void 0:o.colHeaderPaths[o.colHeaderPaths.length-1];l&&n===l.dimensionKey&&r===l.value&&(e.table.scenegraph.updateColWidth(s,t),e.table.internalProps._widthResizedColMap.add(s))}}}(o,i):"indicatorGroup"===i.table.internalProps.columnResizeType?function(t,e){const i=e.table.internalProps.layoutMap,o=i.getCellHeaderPaths(e.columnResize.col,e.table.columnHeaderLevelCount),n=i.getHeadNodeByRowOrColDimensions(o.colHeaderPaths.slice(0,o.colHeaderPaths.length-1)),r=n.startInTotal+e.table.frozenColCount,s=n.startInTotal+e.table.frozenColCount+n.size-1,l=e.table.getColsWidth(r,s),a=t;for(let t=r;t<=s;t++){if(!(e.table.internalProps.transpose||e.table.isPivotTable()&&!i.indicatorsAsCol)){const o=i.getBody(t,e.table.columnHeaderLevelCount);if(null==o?void 0:o.disableColumnResize)continue}let o=e.table.getColWidth(t)/l*a;o>0&&o<.5?o=.5:o<0&&o>=-.5&&(o=-.5),e.table.scenegraph.updateColWidth(t,o),e.table.internalProps._widthResizedColMap.add(t)}}(o,i):"all"===i.table.internalProps.columnResizeType?function(t,e){const i=e.table.internalProps.layoutMap;for(let o=e.table.frozenColCount;o<e.table.colCount-e.table.rightFrozenColCount;o++){if(!(e.table.internalProps.transpose||e.table.isPivotTable()&&!i.indicatorsAsCol)){const t=i.getBody(o,e.table.columnHeaderLevelCount);if(null==t?void 0:t.disableColumnResize)continue}e.table.scenegraph.updateColWidth(o,t),e.table.internalProps._widthResizedColMap.add(o)}}(o,i):dR(o,i),i.columnResize.x=t,i.table.scenegraph.component.updateResizeCol(i.columnResize.col,e,i.columnResize.isRightFrozen),i.columnResize.col<i.table.frozenColCount&&!i.table.isPivotTable()&&!i.table.transpose?i.table.scenegraph.component.setFrozenColumnShadow(i.table.frozenColCount-1,i.columnResize.isRightFrozen):i.columnResize.col>=i.table.colCount-i.table.rightFrozenColCount&&!i.table.isPivotTable()&&!i.table.transpose?i.table.scenegraph.component.setRightFrozenColumnShadow(i.table.colCount-i.table.rightFrozenColCount):i.table.options.frozenColCount?i.table.scenegraph.component.setFrozenColumnShadow(i.table.frozenColCount-1):i.table.options.rightFrozenColCount&&i.table.scenegraph.component.setRightFrozenColumnShadow(i.table.colCount-i.table.rightFrozenColCount),i.table.scenegraph.updateNextFrame()}(t,e,this)}endResizeRow(){setTimeout((()=>{this.rowResize.resizing=!1}),0),this.table.scenegraph.updateChartSize(this.rowResize.row),this.table.scenegraph.component.hideResizeRow(),this.table.scenegraph.updateNextFrame()}startResizeRow(t,e,i,o){var n;this.rowResize.resizing=!0,this.rowResize.row=t,this.rowResize.y=i,this.rowResize.isBottomFrozen=o,this.table.scenegraph.component.showResizeRow(t,e,o);const r=!!(null===(n=this.select.ranges)||void 0===n?void 0:n.length);this.updateSelectPos(-1,-1),this.endSelectCells(!0,r),this.table.scenegraph.updateNextFrame()}updateResizeRow(t,e){!function(t,e,i){t=Math.ceil(t),e=Math.ceil(e);let o=i.rowResize.isBottomFrozen?i.rowResize.y-e:e-i.rowResize.y;if(Math.abs(o)<1)return;i.table.getRowHeight(i.rowResize.row);let n=i.table.getRowHeight(i.rowResize.row)+o;if(n<i.table.internalProps.limitMinHeight&&(n=i.table.internalProps.limitMinHeight,o=n-i.table.getRowHeight(i.rowResize.row)),"adaptive"===i.table.heightMode&&i.rowResize.row<i.table.rowCount-1){let t=i.table.getRowHeight(i.rowResize.row+1);t-=o,t-o<i.table.internalProps.limitMinHeight&&(o=t-i.table.internalProps.limitMinHeight)}o=Math.ceil(o),i.rowResize.row<i.table.columnHeaderLevelCount||i.rowResize.row>=i.table.rowCount-i.table.bottomFrozenRowCount?cR(o,i):"indicator"===i.table.internalProps.rowResizeType?function(t,e){var i,o;const n=e.table.internalProps.layoutMap;let r,s,l;if(n.indicatorsAsCol){const t=n.getCellHeaderPaths(e.table.rowHeaderLevelCount-1,e.rowResize.row),o=null===(i=t.rowHeaderPaths)||void 0===i?void 0:i[t.rowHeaderPaths.length-1];s=null==o?void 0:o.dimensionKey,l=null==o?void 0:o.value}else r=n.getIndicatorKey(e.table.rowHeaderLevelCount,e.rowResize.row);for(let i=e.table.columnHeaderLevelCount;i<e.table.rowCount-e.table.bottomFrozenRowCount;i++){const a=n.getIndicatorKey(e.table.rowHeaderLevelCount,i);if(n.indicatorsAsCol||a!==r){if(n.indicatorsAsCol){const r=n.getCellHeaderPaths(e.table.rowHeaderLevelCount-1,i),a=null===(o=null==r?void 0:r.rowHeaderPaths)||void 0===o?void 0:o[r.rowHeaderPaths.length-1];a&&s===a.dimensionKey&&l===a.value&&(e.table.scenegraph.updateRowHeight(i,t),e.table.internalProps._heightResizedRowMap.add(i))}}else e.table.scenegraph.updateRowHeight(i,t),e.table.internalProps._heightResizedRowMap.add(i)}}(o,i):"indicatorGroup"===i.table.internalProps.rowResizeType?function(t,e){const i=e.table.internalProps.layoutMap,o=i.getCellHeaderPaths(e.table.rowHeaderLevelCount,e.rowResize.row),n=i.getHeadNodeByRowOrColDimensions(o.rowHeaderPaths.slice(0,o.rowHeaderPaths.length-1)),r=n.startInTotal+e.table.frozenRowCount,s=n.startInTotal+e.table.frozenRowCount+n.size-1,l=e.table.getRowsHeight(r,s),a=t;for(let t=r;t<=s;t++){let i=e.table.getRowHeight(t)/l*a;i>0&&i<.5?i=.5:i<0&&i>=-.5&&(i=-.51),e.table.scenegraph.updateRowHeight(t,i),e.table.internalProps._heightResizedRowMap.add(t)}}(o,i):"all"===i.table.internalProps.rowResizeType?function(t,e){for(let i=e.table.frozenRowCount;i<e.table.rowCount-e.table.bottomFrozenRowCount;i++)e.table.scenegraph.updateRowHeight(i,t),e.table.internalProps._heightResizedRowMap.add(i)}(o,i):cR(o,i),i.rowResize.y=e,i.table.scenegraph.component.updateResizeRow(i.rowResize.row,t,i.rowResize.isBottomFrozen),i.table.scenegraph.updateNextFrame()}(t,e,this)}startFillSelect(t,e){this.fillHandle.isFilling=!0,this.fillHandle.startX=t,this.fillHandle.startY=e;const i=this.select.ranges[this.select.ranges.length-1];this.fillHandle.beforeFillMinCol=Math.min(i.start.col,i.end.col),this.fillHandle.beforeFillMinRow=Math.min(i.start.row,i.end.row),this.fillHandle.beforeFillMaxCol=Math.max(i.start.col,i.end.col),this.fillHandle.beforeFillMaxRow=Math.max(i.start.row,i.end.row),this.table.fireListeners(cw.MOUSEDOWN_FILL_HANDLE,{})}endFillSelect(){this.fillHandle.isFilling=!1,this.fillHandle.startX=void 0,this.fillHandle.startY=void 0,this.fillHandle.directionRow=void 0;const t=Math.min(this.select.ranges[0].start.col,this.select.ranges[0].end.col),e=Math.min(this.select.ranges[0].start.row,this.select.ranges[0].end.row),i=Math.max(this.select.ranges[0].start.col,this.select.ranges[0].end.col),o=Math.max(this.select.ranges[0].start.row,this.select.ranges[0].end.row);this.fillHandle.beforeFillMinCol===t&&this.fillHandle.beforeFillMinRow===e&&this.fillHandle.beforeFillMaxCol===i&&this.fillHandle.beforeFillMaxRow===o||this.table.eventManager.isDraging&&this.table.fireListeners(cw.DRAG_FILL_HANDLE_END,{direction:this.fillHandle.direction}),this.fillHandle.beforeFillMaxCol=void 0,this.fillHandle.beforeFillMaxRow=void 0,this.fillHandle.beforeFillMinCol=void 0,this.fillHandle.beforeFillMinRow=void 0}startMoveCol(t,e,i,o){!function(t,e,i,o,n){var r;if(!("canMoveHeaderPosition"in n.table.internalProps.layoutMap))return;n.columnMove.moving=!0,n.columnMove.colSource=t,n.columnMove.rowSource=e,n.columnMove.x=i-n.table.tableX,n.columnMove.y=o-n.table.tableY;const s=n.table.getCellLocation(t,e),l="columnHeader"===s?n.columnMove.x:"rowHeader"===s||n.table.internalProps.layoutMap.isSeriesNumberInBody(t,e)?n.columnMove.y:0;n.table.scenegraph.component.showMoveCol(t,e,l);const a=!!(null===(r=n.select.ranges)||void 0===r?void 0:r.length);n.table.stateManager.updateSelectPos(-1,-1),n.table.stateManager.endSelectCells(!0,a),n.table.scenegraph.updateNextFrame()}(t,e,i,o,this)}updateMoveCol(t,e,i,o){!function(t,e,i,o,n){if(!("canMoveHeaderPosition"in n.table.internalProps.layoutMap))return;const r=function(t,e,i){const o=i.getCellRange(t.col,t.row);if(i.isColumnHeader(t.col,t.row)){const n=i.getCellRange(e.col,o.start.row);e.row>=i.columnHeaderLevelCount&&(e.row=i.columnHeaderLevelCount-1),e.col>=t.col?e.col=n.end.col:e.col=n.start.col}else if(i.isRowHeader(t.col,t.row)){const n=i.internalProps.layoutMap,r=i.getCellRange(o.start.col,e.row);if(e.col>=i.rowHeaderLevelCount+n.leftRowSeriesNumberColumnCount&&(e.col=i.rowHeaderLevelCount+n.leftRowSeriesNumberColumnCount-1),"tree"===n.rowHierarchyType){const o=n.getCellHeaderPathsWithTreeNode(t.col,t.row).rowHeaderPaths,r=n.getCellHeaderPathsWithTreeNode(e.col,e.row).rowHeaderPaths;if(o.length<=r.length){const n=r[o.length-1];n&&(e.row>=t.row?e.row=n.startInTotal+n.size-1+i.columnHeaderLevelCount:e.row=n.startInTotal+i.columnHeaderLevelCount)}}else e.row>=t.row?e.row=r.end.row:e.row=r.start.row}return e}({col:n.columnMove.colSource,row:n.columnMove.rowSource},{col:t,row:e},n.table);let s,l,a,h;n.columnMove.x=i-n.table.tableX,n.columnMove.y=o-n.table.tableY,n.columnMove.colTarget=r.col,n.columnMove.rowTarget=r.row,n.table.internalProps.layoutMap.canMoveHeaderPosition({col:n.columnMove.colSource,row:n.columnMove.rowSource},{col:n.columnMove.colTarget,row:n.columnMove.rowTarget})?n.updateCursor("grabbing"):n.updateCursor("not-allowed");const d=n.table.getCellLocation(n.columnMove.colSource,n.columnMove.rowSource);"columnHeader"===d?(l=n.columnMove.x,s=n.table.isLeftFrozenColumn(t)?n.columnMove.colTarget>=n.columnMove.colSource?n.table.getColsWidth(0,n.columnMove.colTarget):n.table.getColsWidth(0,n.columnMove.colTarget-1):n.table.isRightFrozenColumn(t)?n.table.tableNoFrameWidth-n.table.getColsWidth(r.col+1,n.table.colCount-1):(n.columnMove.colTarget>=n.columnMove.colSource?n.table.getColsWidth(0,n.columnMove.colTarget):n.table.getColsWidth(0,n.columnMove.colTarget-1))-n.table.stateManager.scroll.horizontalBarPos):("rowHeader"===d||n.table.internalProps.layoutMap.isSeriesNumberInBody(t,e))&&(h=n.columnMove.y,a=n.table.isFrozenRow(e)?n.columnMove.rowTarget>=n.columnMove.rowSource?n.table.getRowsHeight(0,n.columnMove.rowTarget):n.table.getRowsHeight(0,n.columnMove.rowTarget-1):n.table.isBottomFrozenRow(e)?n.table.tableNoFrameHeight-n.table.getRowsHeight(r.row+1,n.table.rowCount-1):(n.columnMove.rowTarget>=n.columnMove.rowSource?n.table.getRowsHeight(0,n.columnMove.rowTarget):n.table.getRowsHeight(0,n.columnMove.rowTarget-1))-n.table.stateManager.scroll.verticalBarPos),n.table.scenegraph.component.updateMoveCol(l,s,h,a),n.table.scenegraph.updateNextFrame()}(t,e,i,o,this)}isMoveCol(){return this.columnMove.moving}endMoveCol(){!function(t){if("canMoveHeaderPosition"in t.table.internalProps.layoutMap&&t.columnMove.moving&&t.columnMove.colSource>=0&&t.columnMove.rowSource>=0&&t.columnMove.colTarget>=0&&t.columnMove.rowTarget>=0){const e=t.table.getCellRange(t.columnMove.colSource,t.columnMove.rowSource),i=t.table.getCellRange(t.columnMove.colTarget,t.columnMove.rowTarget),o=t.table._moveHeaderPosition({col:t.columnMove.colSource,row:t.columnMove.rowSource},{col:t.columnMove.colTarget,row:t.columnMove.rowTarget});if(o){t.table.internalProps.useOneRowHeightFillAll=!1,t.table.internalProps.layoutMap.clearCellRangeMap();const n=t.table.getCellRange(t.columnMove.colSource,t.columnMove.rowSource),r=t.table.getCellRange(t.columnMove.colTarget,t.columnMove.rowTarget),s=Math.min(n.start.col,r.start.col,e.start.col,i.start.col),l=Math.max(n.end.col,r.end.col,e.end.col,i.end.col),a=Math.min(n.start.row,r.start.row,e.start.row,i.start.row);let h=Math.max(n.end.row,r.end.row,e.end.row,i.end.row);"row"===o.moveType&&"tree"===t.table.internalProps.layoutMap.rowHierarchyType&&(h=o.targetIndex>o.sourceIndex?h+o.targetSize-1:h+o.sourceSize-1),!t.table.transpose&&t.table.internalProps.layoutMap.isSeriesNumberInBody(t.columnMove.colSource,t.columnMove.rowSource)&&(t.table.changeRecordOrder(o.sourceIndex,o.targetIndex),t.changeCheckboxAndRadioOrder(o.sourceIndex,o.targetIndex)),"column"===o.moveType?aR(s,l,0,-1,t.table):aR(0,-1,a,h,t.table),t.table.clearCellStyleCache(),t.table.internalProps.layoutMap.isSeriesNumberInBody(t.columnMove.colSource,t.columnMove.rowSource)?t.table.scenegraph.updateHeaderPosition(t.table.scenegraph.proxy.colStart,t.table.scenegraph.proxy.colEnd,t.table.scenegraph.proxy.rowStart,t.table.scenegraph.proxy.rowEnd,o.moveType):"column"===o.moveType?t.table.scenegraph.updateHeaderPosition(s,l,0,-1,o.moveType):t.table.scenegraph.updateHeaderPosition(0,-1,a,h,o.moveType),"adjustFrozenCount"===t.table.internalProps.frozenColDragHeaderMode&&t.table.isListTable()&&(t.table.isLeftFrozenColumn(t.columnMove.colTarget)&&!t.table.isLeftFrozenColumn(t.columnMove.colSource)?t.table.frozenColCount+=n.end.col-n.start.col+1:t.table.isLeftFrozenColumn(t.columnMove.colSource)&&!t.table.isLeftFrozenColumn(t.columnMove.colTarget)&&(t.table.frozenColCount-=n.end.col-n.start.col+1),t.table.isRightFrozenColumn(t.columnMove.colTarget)&&!t.table.isRightFrozenColumn(t.columnMove.colSource)?t.table.rightFrozenColCount+=n.end.col-n.start.col+1:t.table.isRightFrozenColumn(t.columnMove.colSource)&&!t.table.isRightFrozenColumn(t.columnMove.colTarget)&&(t.table.rightFrozenColCount-=n.end.col-n.start.col+1))}t.updateCursor()}setTimeout((()=>{t.columnMove.moving=!1,delete t.columnMove.colSource,delete t.columnMove.rowSource,delete t.columnMove.colTarget,delete t.columnMove.rowTarget}),0),t.table.scenegraph.component.hideMoveCol(),t.columnResize.col<t.table.frozenColCount&&!t.table.isPivotTable()&&!t.table.transpose?(t.table.scenegraph.component.setFrozenColumnShadow(t.table.frozenColCount-1,t.columnResize.isRightFrozen),t.table.scenegraph.component.setRightFrozenColumnShadow(t.table.colCount-t.table.rightFrozenColCount)):t.columnResize.col>=t.table.colCount-t.table.rightFrozenColCount&&!t.table.isPivotTable()&&!t.table.transpose?t.table.scenegraph.component.setRightFrozenColumnShadow(t.table.colCount-t.table.rightFrozenColCount):t.table.options.frozenColCount?t.table.scenegraph.component.setFrozenColumnShadow(t.table.frozenColCount-1):t.table.options.rightFrozenColCount&&t.table.scenegraph.component.setRightFrozenColumnShadow(t.table.colCount-t.table.rightFrozenColCount),t.table.scenegraph.updateNextFrame()}(this)}checkFrozen(){var t,e,i;let o=this.table.isListTable()&&!this.table.internalProps.transpose?this.table.options.frozenColCount:this.table.isPivotChart()?null!==(t=this.table.rowHeaderLevelCount)&&void 0!==t?t:0:Math.max((null!==(e=this.table.rowHeaderLevelCount)&&void 0!==e?e:0)+this.table.internalProps.layoutMap.leftRowSeriesNumberColumnCount,null!==(i=this.table.options.frozenColCount)&&void 0!==i?i:0);if(o){if(o>this.table.colCount&&(o=this.table.colCount),this.table.tableNoFrameWidth-this.table.getColsWidth(0,o-1)<=120)return this.table._setFrozenColCount(0),this.setFrozenCol(-1),!1;if(this.table.frozenColCount!==o)return this.table._setFrozenColCount(o),this.setFrozenCol(o),!1}return!0}setFrozenCol(t){t!==this.frozen.col?(this.frozen.col=t,this.table.scenegraph.updateFrozen(),this.table.scenegraph.updateFrozenIcon(0,this.table.colCount-1)):this.table.scenegraph.updateFrozenIcon(0,this.table.colCount-1)}checkVerticalScrollBarEnd(){var t,e;const i=this.table.getAllRowsHeight(),o=this.scroll.verticalBarPos,n=this.table.tableNoFrameHeight;o+n>=i&&this.table.fireListeners(cw.SCROLL_VERTICAL_END,{scrollTop:o,scrollLeft:this.scroll.horizontalBarPos,scrollHeight:null===(t=this.table.theme.scrollStyle)||void 0===t?void 0:t.width,scrollWidth:null===(e=this.table.theme.scrollStyle)||void 0===e?void 0:e.width,viewHeight:n,viewWidth:this.table.tableNoFrameWidth})}checkHorizontalScrollBarEnd(){var t,e;const i=this.table.getAllColsWidth(),o=this.scroll.horizontalBarPos,n=this.table.tableNoFrameWidth;o+n>=i&&this.table.fireListeners(cw.SCROLL_HORIZONTAL_END,{scrollTop:this.scroll.verticalBarPos,scrollLeft:o,scrollHeight:null===(t=this.table.theme.scrollStyle)||void 0===t?void 0:t.width,scrollWidth:null===(e=this.table.theme.scrollStyle)||void 0===e?void 0:e.width,viewHeight:this.table.tableNoFrameHeight,viewWidth:n})}updateVerticalScrollBar(t){var e,i;const o=this.table.getAllRowsHeight(),n=this.scroll.verticalBarPos;this.scroll.verticalBarPos=Math.ceil(t*(o-this.table.scenegraph.height)),Q(this.scroll.verticalBarPos)&&!isNaN(this.scroll.verticalBarPos)||(this.scroll.verticalBarPos=0),this.table.scenegraph.setY(-this.scroll.verticalBarPos,1===t),this.scroll.verticalBarPos-=this.table.scenegraph.proxy.deltaY,this.table.scenegraph.proxy.deltaY=0,this.updateHoverPos(-1,-1),this.table.fireListeners(cw.SCROLL,{scrollTop:this.scroll.verticalBarPos,scrollLeft:this.scroll.horizontalBarPos,scrollHeight:null===(e=this.table.theme.scrollStyle)||void 0===e?void 0:e.width,scrollWidth:null===(i=this.table.theme.scrollStyle)||void 0===i?void 0:i.width,viewHeight:this.table.tableNoFrameHeight,viewWidth:this.table.tableNoFrameWidth,scrollDirection:"vertical",scrollRatioY:t}),n!==this.scroll.verticalBarPos&&this.checkVerticalScrollBarEnd()}updateHorizontalScrollBar(t){var e,i;const o=this.table.getAllColsWidth(),n=this.scroll.horizontalBarPos;this.scroll.horizontalBarPos=Math.ceil(t*(o-this.table.scenegraph.width)),Q(this.scroll.horizontalBarPos)&&!isNaN(this.scroll.horizontalBarPos)||(this.scroll.horizontalBarPos=0),this.table.scenegraph.setX(-this.scroll.horizontalBarPos,1===t),this.scroll.horizontalBarPos-=this.table.scenegraph.proxy.deltaX,this.table.scenegraph.proxy.deltaX=0,this.updateHoverPos(-1,-1),this.table.fireListeners(cw.SCROLL,{scrollTop:this.scroll.verticalBarPos,scrollLeft:this.scroll.horizontalBarPos,scrollHeight:null===(e=this.table.theme.scrollStyle)||void 0===e?void 0:e.width,scrollWidth:null===(i=this.table.theme.scrollStyle)||void 0===i?void 0:i.width,viewHeight:this.table.tableNoFrameHeight,viewWidth:this.table.tableNoFrameWidth,scrollDirection:"horizontal",scrollRatioX:t}),n!==this.scroll.horizontalBarPos&&this.checkHorizontalScrollBarEnd()}setScrollTop(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];var i,o,n;const r=this.table.getAllRowsHeight(),s=(null===(i=this.table.options.customConfig)||void 0===i?void 0:i._disableColumnAndRowSizeRound)?1:0;t=Math.max(0,Math.min(t,r-this.table.scenegraph.height-s)),((t=Math.ceil(t))!==this.scroll.verticalBarPos||this.table.isPivotChart())&&this.updateHoverPos(-1,-1);const l=this.scroll.verticalBarPos;this.scroll.verticalBarPos=t,Q(this.scroll.verticalBarPos)&&!isNaN(this.scroll.verticalBarPos)||(this.scroll.verticalBarPos=0),this.table.scenegraph.setY(-t);const a=t/(r-this.table.scenegraph.height);this.table.scenegraph.component.updateVerticalScrollBarPos(a),l!==t&&e&&(this.table.fireListeners(cw.SCROLL,{scrollTop:this.scroll.verticalBarPos,scrollLeft:this.scroll.horizontalBarPos,scrollHeight:null===(o=this.table.theme.scrollStyle)||void 0===o?void 0:o.width,scrollWidth:null===(n=this.table.theme.scrollStyle)||void 0===n?void 0:n.width,viewHeight:this.table.tableNoFrameHeight,viewWidth:this.table.tableNoFrameWidth,scrollDirection:"vertical",scrollRatioY:a}),this.checkVerticalScrollBarEnd())}setScrollLeft(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];var i,o,n;this.table.scrollLeft;const r=this.table.getAllColsWidth(),s=(this.table.getFrozenColsWidth(),(null===(i=this.table.options.customConfig)||void 0===i?void 0:i._disableColumnAndRowSizeRound)?1:0);t=Math.max(0,Math.min(t,r-this.table.scenegraph.width-s)),(t=Math.ceil(t))!==this.scroll.horizontalBarPos&&this.updateHoverPos(-1,-1);const l=this.scroll.horizontalBarPos;this.scroll.horizontalBarPos=t,Q(this.scroll.horizontalBarPos)&&!isNaN(this.scroll.horizontalBarPos)||(this.scroll.horizontalBarPos=0),this.table.scenegraph.setX(-t);const a=t/(r-this.table.scenegraph.width);this.table.scenegraph.component.updateHorizontalScrollBarPos(a),l!==t&&e&&(this.table.fireListeners(cw.SCROLL,{scrollTop:this.scroll.verticalBarPos,scrollLeft:this.scroll.horizontalBarPos,scrollHeight:null===(o=this.table.theme.scrollStyle)||void 0===o?void 0:o.width,scrollWidth:null===(n=this.table.theme.scrollStyle)||void 0===n?void 0:n.width,viewHeight:this.table.tableNoFrameHeight,viewWidth:this.table.tableNoFrameWidth,scrollDirection:"horizontal",scrollRatioX:a}),this.checkHorizontalScrollBarEnd())}hideVerticalScrollBar(){this.table.scenegraph.component.hideVerticalScrollBar()}showVerticalScrollBar(t){this.table.scenegraph.component.showVerticalScrollBar(),t&&(clearTimeout(this._clearVerticalScrollBar),this._clearVerticalScrollBar=setTimeout((()=>{this.table.scenegraph.component.hideVerticalScrollBar()}),1e3))}hideHorizontalScrollBar(){this.table.scenegraph.component.hideHorizontalScrollBar()}showHorizontalScrollBar(t){this.table.scenegraph.component.showHorizontalScrollBar(),t&&(clearTimeout(this._clearHorizontalScrollBar),this._clearHorizontalScrollBar=setTimeout((()=>{this.table.scenegraph.component.hideHorizontalScrollBar()}),1e3))}triggerContextMenu(t,e,i,o){this.menu.isShow&&this.menu.x===i&&this.menu.y===o?this.hideMenu():this.showContextMenu(t,e,i,o)}showContextMenu(t,e,i,o){var n;(null===(n=this.table.internalProps.menu)||void 0===n?void 0:n.contextMenuItems)&&("html"===this.table.internalProps.menu.renderMode?this.menu.isShow=!0:(this.menu.isShow=!0,this.menu.x=i,this.menu.y=o,this.table.scenegraph.component.menu.attach(i,o,t,e,_S.contextmenu)),this.table.fireListeners(cw.SHOW_MENU,{x:i,y:o,col:t,row:e,type:"contextmenu"}))}triggerDropDownMenu(t,e,i,o,n){this.table.fireListeners(cw.DROPDOWN_ICON_CLICK,{col:t,row:e,event:n}),this.menu.isShow?this.hideMenu():this.showDropDownMenu(t,e,i,o)}showDropDownMenu(t,e,i,o){"html"===this.table.internalProps.menu.renderMode?this.menu.isShow=!0:(this.menu.isShow=!0,this.table.scenegraph.component.menu.attach(i,o,t,e,_S.dropDown),this.menu.bounds=this.table.scenegraph.component.menu.bounds),this.table.fireListeners(cw.SHOW_MENU,{x:i,y:o,col:t,row:e,type:"dropDown"}),this.residentHoverIcon&&this.table.scenegraph.setIconNormalStyle(this.residentHoverIcon.icon,this.residentHoverIcon.col,this.residentHoverIcon.row);const n=this.table.scenegraph.getCell(t,e);let r;n.forEachChildren((t=>t.attribute.funcType===iC.dropDown&&(r=t,!0))),r&&(this.residentHoverIcon={col:t,row:e,icon:r},this.table.scenegraph.setIconHoverStyle(this.residentHoverIcon.icon,this.residentHoverIcon.col,this.residentHoverIcon.row,n),this.table.scenegraph.residentHoverIcon(t,e))}hideMenu(){this.menu.isShow&&(this.table.fireListeners(cw.DROPDOWN_MENU_CLEAR,null),this.table.fireListeners(cw.HIDE_MENU,null),this.menu.isShow=!1,this.table.scenegraph.component.menu.detach(),this.residentHoverIcon&&(this.table.scenegraph.setIconNormalStyle(this.residentHoverIcon.icon,this.residentHoverIcon.col,this.residentHoverIcon.row),this.table.scenegraph.resetResidentHoverIcon(this.residentHoverIcon.col,this.residentHoverIcon.row),this.residentHoverIcon=null))}setDropDownMenuHighlight(t){this.menu.dropDownMenuHighlight=t;for(let e=0;e<t.length;e++){const{col:i,row:o}=t[e],n=this.table.getCellRange(i,o);if(n)for(let t=n.start.col;t<=n.end.col;t++)for(let e=n.start.row;e<=n.end.row;e++)this.table.scenegraph.updateCellContent(t,e)}}dropDownMenuIsHighlight(t,e,i){const o=this.menu.dropDownMenuHighlight;if(Array.isArray(o))for(let n=0;n<o.length;n++){const r=o[n];let{col:s,row:l}=r;const{field:a,menuKey:h}=r;if("number"!=typeof s||"number"!=typeof l)if(this.table.isPivotTable()){const t=this.table.internalProps.layoutMap.getPivotCellAdress(a);if(!t)continue;s=t.col,l=t.row}else{const t=this.table.internalProps.layoutMap.getHeaderCellAddressByField(a);if(!t)continue;s=t.col,l=t.row}if(Q(s)&&Q(l)&&this.table.isCellRangeEqual(t,e,s,l)){const o=this.table._getHeaderLayoutMap(null!=s?s:t,null!=l?l:e).dropDownMenu||this.table.globalDropDownMenu;if(o)for(let t=0;t<o.length;t++){const e=o[t];if(tt(e)&&(e.menuKey||e.text)===(h||"")&&t===i)return!0;if(nt(e)&&e===h&&t===i)return!0}}}return!1}triggerSort(t,e,i,o){if(this.table.isPivotTable()){const i=this.table.getPivotSortState(t,e),n=i?i.toUpperCase():"DESC",r="ASC"===n?"DESC":"ASC";return this.table.sort(t,e,r),void this.table.fireListeners(lR.PIVOT_SORT_CLICK,{col:t,row:e,order:n||"normal",dimensionInfo:this.table.internalProps.layoutMap.getPivotDimensionInfo(t,e),cellLocation:this.table.getCellLocation(t,e),event:o})}const n=this.sort.col,r=this.sort.row;rR(t,e,this.table,o),this.sort.col=t,this.sort.row=e,this.table.scenegraph.updateSortIcon(this.sort.col,this.sort.row,i,this.sort.order,n,r,this.sort.icon),this.sort.icon=i}updateSortState(t){if(t.field===this.sort.field&&t.order===this.sort.order)return;const e=this.sort.col,i=this.sort.row,o="asc"===this.sort.order?"sort_downward":"desc"===this.sort.order?"sort_upward":"sort_normal";this.setSortState(t);const n=this.table.internalProps.layoutMap.getHeaderCellAddressByField(t.field);this.sort.col=n.col,this.sort.row=n.row;const r=this.table.scenegraph.getCell(this.sort.col,this.sort.row).getChildByName(o,!0);this.table.scenegraph.updateSortIcon(this.sort.col,this.sort.row,r,this.sort.order,e,i,this.sort.icon)}triggerFreeze(t,e,i){this.table.isPivotTable()||this.table.transpose||(function(t,e,i){i.frozenColCount>0?t!==i.frozenColCount-1?i.setFrozenColCount(t+1):i.setFrozenColCount(0):i.setFrozenColCount(t+1)}(t,0,this.table),this.frozen.icon=i)}updateCursor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";this.table.getElement().style.cursor=t}updateDrillState(t,e,i,o,n,r){this.drill.dimensionKey=t,this.drill.title=e,this.drill.drillDown=i,this.drill.drillUp=o,this.drill.col=n,this.drill.row=r,function(t,e,i,o,n){const r=n.getCellLocation(t,e);let s=0,l=0,a=!1;"columnHeader"===r?(s=n.getColsWidth(0,n.rowHeaderLevelCount-1)-(0===n.frozenColCount?n.scrollLeft:0),l=n.getRowsHeight(0,e-1)+n.getRowHeight(e)/2,a=!0):"rowHeader"===r&&(l=n.getRowsHeight(0,n.columnHeaderLevelCount-1),s=n.getColsWidth(0,t-1)+n.getColWidth(t)/2,a=!0),n.scenegraph.updateDrill(a,s,l,i,o)}(n,r,i,o,this.table)}updateSparklineHoverPose(t,e,i,o){-1!==this.sparkLine.col&&-1!==this.sparkLine.row&&function(t,e,i){const o=i.scenegraph.getCell(t,e).getChildByName("sparkline"),n=null==o?void 0:o.getChildByName("highlight-line"),r=null==o?void 0:o.getChildByName("highlight-symbol");n&&n.setAttributes({visible:!1,pickable:!1}),r&&r.setAttributes({visible:!1,pickable:!1}),i.scenegraph.updateNextFrame()}(this.sparkLine.col,this.sparkLine.row,this.table);let n=!1;-1!==t&&-1!==e&&(n=function(t,e,i,o,n){var r,s;const l=n.scenegraph.getCell(t,e).getChildByName("sparkline"),a=null==l?void 0:l.getChildByName("sparkline-line"),h=null==l?void 0:l.getChildByName("sparkline-symbol-group");if(!a)return!1;const d=a.bandwidth,c=a.min,u=a.max,g=a.attribute.points;let p;i-=l.globalAABBBounds.x1,l.globalAABBBounds.y1;for(let t=0;t<g.length;t++){const{x:e,y:o,defined:n,rawData:f}=g[t];if(Math.abs(i-e)<d/2&&(p={point:g[t],points:g,pointsBandWidth:d,pointData:f},n)){const t=l.getChildByName("highlight-line");if(t)t.setAttributes({points:[{x:e,y:u},{x:e,y:c}],visible:!0,pickable:!0});else{const t=pa({points:[{x:e,y:u},{x:e,y:c}],lineWidth:null===(r=a.hover)||void 0===r?void 0:r.strokeWidth,stroke:null===(s=a.hover)||void 0===s?void 0:s.stroke});t.name="highlight-line",l.addChild(t)}const i=l.getChildByName("highlight-symbol");if(i)i.setAttributes({x:e,y:o,visible:!0,pickable:!0});else{const t=ca({x:e,y:o,stroke:h.hover.stroke,lineWidth:h.hover.strokeWidth,fill:h.hover.fill,size:2*h.hover.size,symbolType:"circle"});t.name="highlight-symbol",l.addChild(t)}break}}if(n.scenegraph.updateNextFrame(),p){const i={col:t,row:e,field:n.getHeaderField(t,e),value:n.getCellValue(t,e),dataValue:n.getCellOriginValue(t,e),cellHeaderPaths:n.internalProps.layoutMap.getCellHeaderPaths(t,e),title:n.getBodyColumnDefine(t,e).title,cellRange:n.getCellRelativeRect(t,e),sparkline:{pointData:p.pointData},scaleRatio:n.canvas.getBoundingClientRect().width/n.canvas.offsetWidth};n.fireListeners(cw.MOUSEOVER_CHART_SYMBOL,i)}return!0}(t,e,i,0,this.table)),n?(this.sparkLine.col=t,this.sparkLine.row=e):(this.sparkLine.col=-1,this.sparkLine.row=-1)}setCheckedState(t,e,i,o){return function(t,e,i,o,n){const r=n.table.getRecordShowIndexByCell(t,e);if(r>=0){const t=n.table.dataSource.getIndexKey(r);n.checkedState[t]||(n.checkedState[t]={}),n.checkedState[t][i]=o}}(t,e,i,o,this)}setHeaderCheckedState(t,e){return function(t,e,i){var o;i.headerCheckedState[t]=e,null===(o=i.checkedState)||void 0===o||o.forEach((i=>{i[t]=e}))}(t,e,this)}syncCheckedState(t,e,i,o){return function(t,e,i,o,n){var r,s;if(n.table.isHeader(t,e)){if(Q(n.headerCheckedState[i]))return n.headerCheckedState[i];if("function"==typeof o)return;if(Q(o))n.headerCheckedState[i]=o;else if((null===(r=n.checkedState)||void 0===r?void 0:r.length)>0)return n.updateHeaderCheckedState(i);return n.headerCheckedState[i]}const l=n.table.getRecordShowIndexByCell(t,e);if(l>=0){const t=n.table.dataSource.getIndexKey(l);if(Q(null===(s=n.checkedState[t])||void 0===s?void 0:s[i]))return n.checkedState[t][i];n.checkedState[t]||(n.checkedState[t]={}),n.checkedState[t][i]=o}return o}(t,e,i,o,this)}initCheckedState(t){return function(t,e){e.checkedState=[],e.headerCheckedState={},e.radioState={};let i=!1;e._checkboxCellTypeFields=[],e._headerCheckFuncs={},e.table.internalProps.layoutMap.headerObjects.forEach(((t,o)=>{if("checkbox"===t.headerType){const o=t.define.checked;null==o||"function"==typeof o?(i=!0,"function"==typeof o&&(e._headerCheckFuncs[t.field]=o)):e.headerCheckedState[t.field]=o,"checkbox"!==t.define.cellType||t.fieldFormat||e._checkboxCellTypeFields.push(t.field)}})),i&&t.forEach(((t,i)=>{e._checkboxCellTypeFields.forEach((o=>{const n=t[o];let r;if(tt(n)?r=n.checked:"boolean"==typeof n&&(r=n),null==r){const t=e._headerCheckFuncs[o];if(t){const s=e.table.getCellAddrByFieldRecord(o,i);r=QC(t,{col:s.col,row:s.row,table:e.table,context:null,value:n})}}e.checkedState[i]||(e.checkedState[i]={}),e.checkedState[i][o]=r}))}))}(t,this)}updateHeaderCheckedState(t){return function(t,e){const i=e.checkedState.every((e=>!0===e[t]));return i?(e.headerCheckedState[t]=!0,i):e.checkedState.every((e=>!1===e[t]))?(e.headerCheckedState[t]=!1,!1):!!e.checkedState.find((e=>!0===e[t]))&&(e.headerCheckedState[t]="indeterminate","indeterminate")}(t,this)}initLeftRecordsCheckState(t){return function(t,e){for(let i=e.checkedState.length;i<t.length;i++){const o=t[i];e._checkboxCellTypeFields.forEach((t=>{const n=o[t];let r;tt(n)?r=n.checked:"boolean"==typeof n&&(r=n),e.checkedState[i]||(e.checkedState[i]={}),e.checkedState[i][t]=r}))}}(t,this)}setRadioState(t,e,i,o,n){!function(t,e,i,o,n,r){const s=r.table.getRecordShowIndexByCell(t,e);if(s>=0){const t=r.table.dataSource.getIndexKey(s);"column"===o?at(n)?(r.radioState[i]={},r.radioState[i][t]=n):r.radioState[i]=t:(r.radioState[i]||(r.radioState[i]={}),at(n)?r.radioState[i][t]=n:r.radioState[i][t]=!0)}}(t,e,i,o,n,this)}syncRadioState(t,e,i,o,n,r){return function(t,e,i,o,n,r,s){var l,a,h,d,c;const u=s.table.getRecordShowIndexByCell(t,e);if(u>=0){const t=s.table.dataSource.getIndexKey(u);if("column"===o){if(!Q(s.radioState[i])&&r)return at(n)?(s.radioState[i]={},s.radioState[i][t]=n):s.radioState[i]=t,!0;if(at(s.radioState[i])&&!at(n))return s.radioState[i]===t;if(at(s.radioState[i])&&at(n))return!1;if(tt(s.radioState[i])&&!at(n))return!1;if(tt(s.radioState[i])&&at(n))return s.radioState[i][t]===n}else if("cell"===o){if(!Q(s.radioState[i])&&r)return s.radioState[i]={},at(n)?s.radioState[i][t]=n:s.radioState[i][t]=!0,!0;if(!Q(null===(l=s.radioState[i])||void 0===l?void 0:l[t])&&r)return at(n)?s.radioState[i][t]=n:s.radioState[i][t]=!0,!0;if(q(null===(a=s.radioState[i])||void 0===a?void 0:a[t])&&!at(n))return s.radioState[i][t];if(q(null===(h=s.radioState[i])||void 0===h?void 0:h[t])&&at(n))return!1;if(at(null===(d=s.radioState[i])||void 0===d?void 0:d[t])&&!at(n))return!1;if(at(null===(c=s.radioState[i])||void 0===c?void 0:c[t])&&at(n))return s.radioState[i][t]===n}}return r}(t,e,i,o,n,r,this)}changeCheckboxAndRadioOrder(t,e){this.checkedState.length&&function(t,e,i){const{checkedState:o,table:n}=i;if(n.internalProps.transpose?(t=n.getRecordShowIndexByCell(t,0),e=n.getRecordShowIndexByCell(e,0)):(t=n.getRecordShowIndexByCell(0,t),e=n.getRecordShowIndexByCell(0,e)),t!==e){const i=o[t];o[t]=o[e],o[e]=i}}(t,e,this),this.radioState.length&&function(t,e,i){const{radioState:o,table:n}=i;if(n.internalProps.transpose?(t=n.getRecordShowIndexByCell(t,0),e=n.getRecordShowIndexByCell(e,0)):(t=n.getRecordShowIndexByCell(0,t),e=n.getRecordShowIndexByCell(0,e)),t!==e){const i=o[t];o[t]=o[e],o[e]=i}}(t,e,this)}}(this),this.eventManager=new class{constructor(t){this.isDown=!1,this.isDraging=!1,this.globalEventListeners=[],this._enableTableScroll=!0,this.table=t,this.handleTextStickBindId=[],this.inertiaScroll=new CR(t.stateManager),"node"!==BC.mode&&(this.bindOuterEvent(),setTimeout((()=>{this.bindSelfEvent()}),0))}bindOuterEvent(){gR(this),function(t){const e=t.table,i=e.stateManager,o=e.internalProps.handler;function n(t){var i;if(e.hasListeners(cw.KEYDOWN)){const o={keyCode:null!==(i=t.keyCode)&&void 0!==i?i:t.which,code:t.code,event:t,scaleRatio:e.canvas.getBoundingClientRect().width/e.canvas.offsetWidth};e.fireListeners(cw.KEYDOWN,o)}}o.on(e.getElement(),"blur",(e=>{t.dealTableHover()})),o.on(e.getElement(),"wheel",(t=>{e.eventManager._enableTableScroll&&bR(t,i)})),o.on(e.getElement(),"keydown",(o=>{var r,s,l,a,h,d,c,u,g,p,f,m,b,v;if("a"===o.key&&(o.ctrlKey||o.metaKey))(null===(r=e.keyboardOptions)||void 0===r?void 0:r.selectAllOnCtrlA)&&(o.preventDefault(),t.deelTableSelectAll());else if(i.select.cellPos.col>=0&&i.select.cellPos.row>=0&&("ArrowUp"===o.key||"ArrowDown"===o.key||"ArrowLeft"===o.key||"ArrowRight"===o.key)){if((null===(l=null===(s=e.options.keyboardOptions)||void 0===s?void 0:s.moveEditCellOnArrowKeys)||void 0===l||!l)&&(null===(a=e.editorManager)||void 0===a?void 0:a.editingEditor))return;let t,n;if(o.preventDefault(),o.stopPropagation(),"ArrowUp"===o.key?o.ctrlKey||o.metaKey?(t=i.select.cellPos.col,n=0):(o.shiftKey,t=i.select.cellPos.col,n=Math.min(e.rowCount-1,Math.max(0,i.select.cellPos.row-1))):"ArrowDown"===o.key?o.ctrlKey||o.metaKey?(t=i.select.cellPos.col,n=e.rowCount-1):(o.shiftKey,t=i.select.cellPos.col,n=Math.min(e.rowCount-1,Math.max(0,i.select.cellPos.row+1))):"ArrowLeft"===o.key?o.ctrlKey||o.metaKey?(t=0,n=i.select.cellPos.row):(o.shiftKey,n=i.select.cellPos.row,t=Math.min(e.colCount-1,Math.max(0,i.select.cellPos.col-1))):"ArrowRight"===o.key&&(o.ctrlKey||o.metaKey?(t=e.colCount-1,n=i.select.cellPos.row):(o.shiftKey,n=i.select.cellPos.row,t=Math.min(e.colCount-1,Math.max(0,i.select.cellPos.col+1)))),uA(e,t,n))return;e.selectCell(t,n,o.shiftKey),null!==(d=null===(h=e.options.keyboardOptions)||void 0===h?void 0:h.moveEditCellOnArrowKeys)&&void 0!==d&&d&&(null===(c=e.editorManager)||void 0===c?void 0:c.editingEditor)&&(e.editorManager.completeEdit(),e.getElement().focus(),e.getEditor(t,n)&&e.editorManager.startEditCell(t,n))}else if("Escape"===o.key)e.editorManager.cancelEdit();else if("Enter"===o.key){if(e.editorManager.editingEditor)return n(o),e.editorManager.completeEdit(),void e.getElement().focus();if((null===(g=null===(u=e.options.keyboardOptions)||void 0===u?void 0:u.editCellOnEnter)||void 0===g||g)&&1===(null!==(f=null===(p=e.stateManager.select.ranges)||void 0===p?void 0:p.length)&&void 0!==f?f:0)){const t=e.stateManager.select.ranges[0].start.col,i=e.stateManager.select.ranges[0].start.row,o=e.stateManager.select.ranges[0].end.col,n=e.stateManager.select.ranges[0].end.row;t===o&&i===n&&e.getEditor(t,i)&&e.editorManager.startEditCell(t,i)}}else if("Tab"===o.key&&(null===(b=null===(m=e.options.keyboardOptions)||void 0===m?void 0:m.moveFocusCellOnTab)||void 0===b||b)&&(o.preventDefault(),i.select.cellPos.col>=0&&i.select.cellPos.row>=0)){let t,o;if(i.select.cellPos.col===e.colCount-1?(o=Math.min(e.rowCount-1,i.select.cellPos.row+1),t=e.rowHeaderLevelCount):i.select.cellPos.row===e.rowCount-1?(o=e.rowCount-1,t=e.rowHeaderLevelCount):(o=i.select.cellPos.row,t=i.select.cellPos.col+1),uA(e,t,o))return;e.selectCell(t,o),(null===(v=e.editorManager)||void 0===v?void 0:v.editingEditor)&&(e.editorManager.completeEdit(),e.getElement().focus(),e.getEditor(t,o)&&e.editorManager.startEditCell(t,o))}n(o)})),o.on(e.getElement(),"copy",(t=>{var i,o;if(null===(i=e.keyboardOptions)||void 0===i?void 0:i.copySelected){const i=e.getCopyValue();if(Q(i)){if(t.preventDefault(),null===(o=navigator.clipboard)||void 0===o?void 0:o.write){const t=t=>{const e=["<table>"],i=['<meta name="author" content="Visactor"/>','<style type="text/css">td{white-space:normal}br{mso-data-placement:same-cell}</style>'].join(""),o=t.split("\r\n");return o.forEach((function(t,i){const n=t.split("\t"),r=[];0===i&&e.push("<tbody>"),n.forEach((function(t,e){const i=t?t.toString().replace(/&/g,"&").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">").replace(/\n/g,"<br>").replace(/(<br(\s*|\/)>(\r\n|\n)?|\r\n|\n)/g,"<br>\r\n").replace(/\x20{2,}/gi,(t=>`<span style="mso-spacerun: yes">${" ".repeat(t.length-1)} </span>`)).replace(/\t/gi,"	"):" ";r.push(`<td>${i}</td>`)})),e.push("<tr>",...r,"</tr>"),i===o.length-1&&e.push("</tbody>")})),e.push("</table>"),[i,e.join("")].join("")},e=t(i);navigator.clipboard.write([new ClipboardItem({"text/html":new Blob([e],{type:"text/html"}),"text/plain":new Blob([i],{type:"text/plain"})})])}else rw?window.clipboardData.setData("Text",i):t.clipboardData.setData("text/plain",i);e.fireListeners(cw.COPY_DATA,{cellRange:e.stateManager.select.ranges,copyData:i})}}})),o.on(e.getElement(),"paste",(t=>{var i,o,n,r;if((null===(i=e.keyboardOptions)||void 0===i?void 0:i.pasteValueToCell)&&e.changeCellValues){if(null===(o=e.editorManager)||void 0===o?void 0:o.editingEditor)return;if((null===(n=e.stateManager.select.ranges)||void 0===n?void 0:n.length)>0)if(null===(r=navigator.clipboard)||void 0===r?void 0:r.read)navigator.clipboard.read().then((t=>{for(const e of t)e.types.includes("text/html")?l(e):1===e.types.length&&"text/plain"===e.types[0]&&h(e)}));else{const i=e.stateManager.select.ranges,o=Math.min(i[0].start.col,i[0].end.col),n=Math.min(i[0].start.row,i[0].end.row),r=(t.clipboardData||window.Clipboard).getData("text").split("\n"),s=[];r.forEach((function(t,e){const i=t.split("\t"),o=[];s.push(o),i.forEach((function(t,e){e===i.length-1&&(t=t.trim()),o.push(t)}))})),e.changeCellValues(o,n,s)}}})),o.on(e.getElement(),"contextmenu",(t=>{var i;!1!==(null===(i=e.eventOptions)||void 0===i?void 0:i.preventDefaultContextMenu)&&t.preventDefault()})),o.on(e.getContainer(),"resize",(t=>{e.canvasSizeSeted||0===t.width&&0===t.height||(Q(e.options.pixelRatio)||e.setPixelRatio(xR()),t.windowSizeNotChange||e.resize())}));const r=/<tr[^>]*>([\s\S]*?)<\/tr>/g,s=/<td[^>]*>([\s\S]*?)<\/td>/g;function l(t){const i=e.stateManager.select.ranges,o=i.length,n=Math.min(i[o-1].start.col,i[o-1].end.col),l=Math.min(i[o-1].start.row,i[o-1].end.row),h=Math.max(i[o-1].start.col,i[o-1].end.col),c=Math.max(i[o-1].start.row,i[o-1].end.row);let u=0,g=0,p=[];t.getType("text/html").then((t=>{t.text().then((t=>{var i,o;if(t&&/(<table)|(<TABLE)/g.test(t)){const a=Array.from(t.matchAll(r));for(const t of a){const e=t[1],o=Array.from(e.matchAll(s)).map((t=>t[1].replace(/(<(?!br)([^>]+)>)/gi,"").replace(/<br(\s*|\/)>[\r\n]?/gim,"\n").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/	/gi,"\t").replace(/ /g," ")));p.push(o),u=Math.max(u,null!==(i=null==o?void 0:o.length)&&void 0!==i?i:0)}g=null!==(o=p.length)&&void 0!==o?o:0,p=d(p,g,u,c-l+1,h-n+1),e.changeCellValues(n,l,p,!0)}else navigator.clipboard.read().then((t=>{for(const e of t)e.types.includes("text/plain")&&e.getType("text/plain").then((t=>{t.text().then(a)}))}))}))}))}function a(t){var i;const o=e.stateManager.select.ranges,n=o.length,r=Math.min(o[n-1].start.col,o[n-1].end.col),s=Math.min(o[n-1].start.row,o[n-1].end.row),l=Math.max(o[n-1].start.col,o[n-1].end.col),a=Math.max(o[n-1].start.row,o[n-1].end.row);let h=0,c=0,u=[];t.split("\n").forEach((function(t,e){var i;const o=t.split("\t"),n=[];u.push(n),o.forEach((function(t,e){e===o.length-1&&(t=t.trim()),n.push(t)})),h=Math.max(h,null!==(i=null==n?void 0:n.length)&&void 0!==i?i:0)})),c=null!==(i=u.length)&&void 0!==i?i:0,u=d(u,c,h,a-s+1,l-r+1),e.changeCellValues(r,s,u,!0)}function h(t){const i=e.stateManager.select.ranges,o=i.length,n=Math.min(i[o-1].start.col,i[o-1].end.col),r=Math.min(i[o-1].start.row,i[o-1].end.row),s=Math.max(i[o-1].start.col,i[o-1].end.col),l=Math.max(i[o-1].start.row,i[o-1].end.row);let a=0,h=0;t.getType("text/plain").then((t=>{t.text().then((t=>{var i;const o=t.replace(/\r(?!\n)/g,"\r\n").split("\r\n");let c=[];o.length>1&&""===o[o.length-1]&&o.pop(),o.forEach((function(t,e){var i;const o=t.split("\t"),n=[];c.push(n),o.forEach((function(t,e){t.includes("\n")&&(t=t.replace(/^"(.*)"$/,"$1").replace(/["]*/g,(t=>new Array(Math.floor(t.length/2)).fill('"').join("")))),n.push(t)})),a=Math.max(a,null!==(i=null==n?void 0:n.length)&&void 0!==i?i:0)})),h=null!==(i=c.length)&&void 0!==i?i:0,c=d(c,h,a,l-r+1,s-n+1),e.changeCellValues(n,r,c,!0)}))}))}function d(t,e,i,o,n){if(n>i||o>e){if(n%i==0&&o%e==0){const r=[];for(let s=0;s<o;s++){const o=[];r.push(o);for(let r=0;r<n;r++){const n=s%e,l=r%i;o.push(t[n][l])}}return r}return t}return t}const c=t=>{e.eventManager.LastBodyPointerXY={x:t.x,y:t.y},e.eventManager.isDown=!0};t.globalEventListeners.push({name:"pointerdown",env:"body",callback:c}),document.body.addEventListener("pointerdown",c);const u=t=>{e.eventManager.LastBodyPointerXY=null,e.eventManager.isDown=!1,e.eventManager.isDraging=!1,e.eventManager.inertiaScroll.endInertia(),i.isResizeCol()?fR(e):i.isResizeRow()&&mR(e)};t.globalEventListeners.push({name:"pointerup",env:"document",callback:u}),document.addEventListener("pointerup",u);const g=o=>{var n,r,s,l,a;if(e.eventManager.isDown&&e.eventManager.LastBodyPointerXY){const t=null!==(r=null===(n=e.eventManager.LastBodyPointerXY)||void 0===n?void 0:n.x)&&void 0!==r?r:o.x,i=null!==(l=null===(s=e.eventManager.LastBodyPointerXY)||void 0===s?void 0:s.y)&&void 0!==l?l:o.y;(Math.abs(t-o.x)>1||Math.abs(i-o.y)>1)&&(e.eventManager.isDraging=!0)}const{x:h,y:d}=e._getMouseAbstractPoint(o,!1);i.interactionState===Ky.grabing&&(i.isResizeCol()?(t.dealColumnResize(h,d),e.hasListeners(cw.RESIZE_COLUMN)&&e.fireListeners(cw.RESIZE_COLUMN,{col:e.stateManager.columnResize.col,colWidth:e.getColWidth(e.stateManager.columnResize.col)})):i.isResizeRow()&&(t.dealRowResize(h,d),e.hasListeners(cw.RESIZE_ROW)&&e.fireListeners(cw.RESIZE_ROW,{row:e.stateManager.rowResize.row,rowHeight:e.getRowHeight(e.stateManager.rowResize.row)})));const c=e.stateManager.isSelecting();if(t._enableTableScroll&&t.isDraging&&c&&(null===(a=e.stateManager.select.ranges)||void 0===a?void 0:a.length)>0){const t=e.getDrawRange(),i=e.getFrozenRowsHeight(),o=e.getBottomFrozenRowsHeight(),n=e.getFrozenColsWidth(),r=e.getRightFrozenColsWidth(),s=e.stateManager.select.ranges[e.stateManager.select.ranges.length-1].start,l=e.stateManager.select.ranges[e.stateManager.select.ranges.length-1].end,a=(!1===e.isFrozenRow(s.row)||!1===e.isFrozenRow(l.row))&&e.getAllRowsHeight()>e.tableNoFrameHeight,c=(!1===e.isFrozenColumn(s.col)||!1===e.isFrozenColumn(l.col))&&e.getAllColsWidth()>e.tableNoFrameWidth;if((d>t.bottom-o||d<t.top+i)&&a||(h>t.right-r||h<t.left+n)&&c){e.eventManager.scrollXSpeed=0,e.eventManager.scrollYSpeed=0;let s=!1,l=!1,u=!1,g=!1;d>t.bottom-o&&a&&e.scrollTop+e.tableNoFrameWidth<e.getAllRowsHeight()?(s=!0,e.eventManager.scrollYSpeed=-(d-t.bottom+o)/50):d<t.top+i&&a&&e.scrollTop>0&&(l=!0,e.eventManager.scrollYSpeed=-(d-t.top-i)/50),h>t.right-r&&c&&e.scrollLeft+e.tableNoFrameWidth<e.getAllColsWidth()?(u=!0,e.eventManager.scrollXSpeed=-(h-t.right+r)/50):h<t.left+n&&c&&e.scrollLeft>0&&(g=!0,e.eventManager.scrollXSpeed=-(h-t.left-n)/50),e.eventManager.inertiaScroll.startInertia(e.eventManager.scrollXSpeed,e.eventManager.scrollYSpeed,1),e.eventManager.inertiaScroll.setScrollHandle(((a,c)=>{let p,f;bR({deltaX:-a,deltaY:-c},e.stateManager,!1),s?f=e.scrollTop+t.height-o-20:l&&(f=e.scrollTop+i+20),u?p=e.scrollLeft+t.width-r-20:g&&(p=e.scrollLeft+n+20);let m=!1,b=!1;u||g||(h>e.tableNoFrameWidth-e.getRightFrozenColsWidth()&&h<e.tableNoFrameWidth||h>0&&h<e.getFrozenColsWidth()?(p=h,b=!0):p=e.scrollLeft+h),s||l||(d>e.tableNoFrameHeight-e.getBottomFrozenRowsHeight()&&d<e.tableNoFrameHeight||d>0&&d<e.getFrozenRowsHeight()?(f=d,m=!0):f=e.scrollTop+d),e.stateManager.updateInteractionState(Ky.grabing);const v=e.getTargetColAtConsiderRightFrozen(p,b),y=e.getTargetRowAtConsiderBottomFrozen(f,m);Q(v)&&Q(y)&&e.stateManager.updateSelectPos(v.col,y.row,!1,!1,!1,!0)}))}else e.eventManager.inertiaScroll.isInertiaScrolling()?e.eventManager.inertiaScroll.endInertia():e.eventManager.scrollYSpeed=0}};t.globalEventListeners.push({name:"pointermove",env:"body",callback:g}),document.body.addEventListener("pointermove",g)}(this),function(t){const e=t.table,i=e.stateManager,o=e.scenegraph;o.component.vScrollBar.addEventListener("pointerover",(t=>{i.showVerticalScrollBar()})),o.component.hScrollBar.addEventListener("pointerover",(t=>{i.showHorizontalScrollBar()})),o.component.vScrollBar.addEventListener("pointerout",(t=>{i.interactionState!==Ky.scrolling&&i.hideVerticalScrollBar()})),o.component.hScrollBar.addEventListener("pointerout",(t=>{i.interactionState!==Ky.scrolling&&i.hideHorizontalScrollBar()})),o.component.vScrollBar.addEventListener("pointermove",(t=>{o.table.stateManager.updateCursor("default"),t.stopPropagation()})),o.component.vScrollBar.addEventListener("pointerdown",(t=>{t.stopPropagation(),o.table.hasListeners(cw.MOUSEDOWN_TABLE)&&o.table.fireListeners(cw.MOUSEDOWN_TABLE,{event:t.nativeEvent})})),o.component.vScrollBar.addEventListener("scrollDown",(t=>{var e;o.table.eventManager.LastBodyPointerXY={x:t.x,y:t.y},o.table.eventManager.isDown=!0,i.interactionState!==Ky.scrolling&&i.updateInteractionState(Ky.scrolling),o.table.stateManager.hideMenu(),null===(e=o.table.editorManager)||void 0===e||e.completeEdit(),o.table.hasListeners(cw.MOUSEDOWN_TABLE)&&o.table.fireListeners(cw.MOUSEDOWN_TABLE,{event:t.nativeEvent})})),o.component.vScrollBar.addEventListener("pointerup",(()=>{i.fastScrolling=!1,o.table.eventManager.isDraging=!1,i.interactionState===Ky.scrolling&&i.updateInteractionState(Ky.default)})),o.component.vScrollBar.addEventListener("pointerupoutside",(()=>{i.fastScrolling=!1,i.interactionState===Ky.scrolling&&i.updateInteractionState(Ky.default)})),o.component.vScrollBar.addEventListener("scrollUp",(t=>{o.table.eventManager.isDraging=!1})),o.component.hScrollBar.addEventListener("pointermove",(t=>{o.table.stateManager.updateCursor("default"),t.stopPropagation()})),o.component.hScrollBar.addEventListener("pointerdown",(t=>{t.stopPropagation(),o.table.hasListeners(cw.MOUSEDOWN_TABLE)&&o.table.fireListeners(cw.MOUSEDOWN_TABLE,{event:t.nativeEvent})})),o.component.hScrollBar.addEventListener("scrollDown",(t=>{var e;o.table.eventManager.LastBodyPointerXY={x:t.x,y:t.y},o.table.eventManager.isDown=!0,i.interactionState!==Ky.scrolling&&i.updateInteractionState(Ky.scrolling),o.table.stateManager.hideMenu(),null===(e=o.table.editorManager)||void 0===e||e.completeEdit(),o.table.hasListeners(cw.MOUSEDOWN_TABLE)&&o.table.fireListeners(cw.MOUSEDOWN_TABLE,{event:t.nativeEvent})})),o.component.hScrollBar.addEventListener("pointerup",(()=>{i.fastScrolling=!1,o.table.eventManager.isDraging=!1,i.interactionState===Ky.scrolling&&i.updateInteractionState(Ky.default)})),o.component.hScrollBar.addEventListener("pointerupoutside",(()=>{i.fastScrolling=!1,i.interactionState===Ky.scrolling&&i.updateInteractionState(Ky.default)})),o.component.hScrollBar.addEventListener("scrollUp",(t=>{o.table.eventManager.isDraging=!1}));const n=HC(i.updateVerticalScrollBar,20),r=HC(i.updateHorizontalScrollBar,20);o.component.vScrollBar.addEventListener("scrollDrag",(t=>{o.table.eventManager.isDown&&(o.table.eventManager.isDraging=!0),i.fastScrolling=!0,i.interactionState!==Ky.scrolling&&i.updateInteractionState(Ky.scrolling);const e=t.detail.value[0]/(1-t.detail.value[1]+t.detail.value[0]);n(e,t)})),o.component.hScrollBar.addEventListener("scrollDrag",(t=>{o.table.eventManager.isDown&&(o.table.eventManager.isDraging=!0),i.fastScrolling=!0,i.interactionState!==Ky.scrolling&&i.updateInteractionState(Ky.scrolling);const e=t.detail.value[0]/(1-t.detail.value[1]+t.detail.value[0]);r(e)}))}(this),function(t){const e=t.table,i=e.stateManager,o=e.scenegraph;t.touchMovePoints=[],e.scenegraph.tableGroup.addEventListener("touchstart",(e=>{e.target.isChildOf(o.component.vScrollBar)||e.target.isChildOf(o.component.vScrollBar)||(t.isTouchdown=!0,t.touchMovePoints.push({x:e.page.x,y:e.page.y,timestamp:Date.now()}))}));const n=o=>{var n,r;if(t.touchMove&&o.preventDefault(),t.isTouchdown&&_R(o))if((null===(r=null===(n=t.downIcon)||void 0===n?void 0:n.attribute)||void 0===r?void 0:r.funcType)===iC.dragReorder)o.preventDefault();else if(t.touchMovePoints.length>4&&t.touchMovePoints.shift(),t.touchMovePoints.push({x:o.changedTouches[0].pageX,y:o.changedTouches[0].pageY,timestamp:Date.now()}),t._enableTableScroll){const n=-t.touchMovePoints[t.touchMovePoints.length-1].x+t.touchMovePoints[t.touchMovePoints.length-2].x,r=-t.touchMovePoints[t.touchMovePoints.length-1].y+t.touchMovePoints[t.touchMovePoints.length-2].y;bR({deltaX:n,deltaY:r},i),o.cancelable&&("none"===e.internalProps.overscrollBehavior||Math.abs(r)>=Math.abs(n)&&0!==r&&vR(r,i)||Math.abs(r)<=Math.abs(n)&&0!==n&&yR(n,i))&&o.preventDefault()}};window.addEventListener("touchmove",n,{passive:!1}),t.globalEventListeners.push({name:"touchmove",env:"window",callback:n});const r=i=>{var o,n,r,s;if(t.touchEnd=!0,t.touchMove=!1,t.isTouchdown&&_R(i)){if((null===(n=null===(o=t.downIcon)||void 0===o?void 0:o.attribute)||void 0===n?void 0:n.funcType)===iC.dragReorder)i.preventDefault();else if((null===(r=t.touchMovePoints)||void 0===r?void 0:r.length)&&(t.touchMovePoints.length>4&&t.touchMovePoints.shift(),t.touchMovePoints.push({x:i.changedTouches[0].pageX,y:i.changedTouches[0].pageY,timestamp:Date.now()}),t._enableTableScroll)){const i=t.touchMovePoints[0],o=t.touchMovePoints[(null===(s=t.touchMovePoints)||void 0===s?void 0:s.length)-1],n=(o.x-i.x)/(o.timestamp-i.timestamp),r=(o.y-i.y)/(o.timestamp-i.timestamp);t.inertiaScroll.startInertia(n,r,.95),e.eventManager.inertiaScroll.setScrollHandle(((t,i)=>{bR({deltaX:-t,deltaY:-i},e.stateManager)}))}t.isTouchdown=!1,t.touchMovePoints=[]}};window.addEventListener("touchend",r),t.globalEventListeners.push({name:"touchend",env:"window",callback:r});const s=e=>{t.touchEnd=!0,t.touchMove=!1,t.isTouchdown&&(t.isTouchdown=!1,t.touchMovePoints=[])};window.addEventListener("touchcancel",s),t.globalEventListeners.push({name:"touchcancel",env:"window",callback:s})}(this),pR(this)}updateEventBinder(){setTimeout((()=>{var t;yB(this.table)&&0===(null===(t=this.handleTextStickBindId)||void 0===t?void 0:t.length)?(this.handleTextStickBindId.push(this.table.on(cw.SCROLL,(t=>{pB(this.table)}))),this.handleTextStickBindId.push(this.table.on(cw.RESIZE_COLUMN_END,(t=>{pB(this.table)}))),this.handleTextStickBindId.push(this.table.on(cw.RESIZE_ROW_END,(t=>{pB(this.table)})))):!yB(this.table)&&this.handleTextStickBindId&&(this.handleTextStickBindId.forEach((t=>{this.table.off(t)})),this.handleTextStickBindId=[]),uR(this.table)}),0)}bindSelfEvent(){if(this.table.isReleased)return;const t=this.table.stateManager;var e;this.table.on(cw.ICON_CLICK,(e=>{var i;const{col:o,row:n,x:r,y:s,funcType:l,icon:a,event:h}=e;if(l===iC.dropDown)t.triggerDropDownMenu(o,n,r,s,h);else if(l===iC.sort)t.triggerSort(o,n,a,h);else if(l===iC.frozen)t.triggerFreeze(o,n,a);else if(l===iC.drillDown)(d=this.table).fireListeners(lR.DRILLMENU_CLICK,d.stateManager.drill);else if(l===iC.collapse||l===iC.expand){const e=!!(null===(i=t.select.ranges)||void 0===i?void 0:i.length);t.updateSelectPos(-1,-1),t.endSelectCells(!0,e),this.table.toggleHierarchyState(o,n)}var d})),this.table.on(cw.DROPDOWN_MENU_CLICK,(()=>{t.hideMenu()})),this.updateEventBinder(),e=this.table,"browser"===BC.mode&&e.on(cw.CLICK_CELL,(t=>{const{col:i,row:o}=t;if("image"===t.target.type&&t.target.role&&t.target.role.startsWith("icon"))return;let n;n=e.internalProps.layoutMap.isHeader(i,o)?e.isPivotTable()?e._getHeaderLayoutMap(i,o).headerType:e.getHeaderDefine(i,o).headerType:e.getBodyColumnType(i,o);const r=e.isHeader(i,o)?e.getHeaderDefine(i,o):e.getBodyColumnDefine(i,o),s=e.getCellValue(i,o),l=e.getCellOriginValue(i,o);if("link"===n){if(!1===r.linkJump)return;const t=r.templateLink,n=!1!==r.linkDetect;let a;if(t){const n=e.getCellOriginRecord(i,o),r=Object.assign({__value:s,__dataValue:l},n),h=/\{\s*(\S+?)\s*\}/g;a=t.replace(h,((t,e)=>r[e]))}else if(n){if(!Rw.test(s))return;a=s}else a=s;window.open(a)}else if("image"===n){const{clickToPreview:t}=r;if(!1===t)return;const e=document.createElement("div");e.style.width="100%",e.style.height="100%",e.style.position="absolute",e.style.top="0",e.style.left="0",e.style.backgroundColor="rgba(30, 30, 30, 0.4)",e.style.display="flex",e.style.justifyContent="center",e.style.alignItems="center",e.style.overflow="hidden",e.style.zIndex="9999",e.addEventListener("click",(t=>{t.target===e&&document.body.removeChild(e)}));const i=new Image;i.src=s,i.style.maxWidth="80%",i.style.maxHeight="80%",e.appendChild(i),document.body.appendChild(e)}else if("video"===n){const{clickToPreview:t}=r;if(!1===t)return;const e=document.createElement("div");e.style.width="100%",e.style.height="100%",e.style.position="absolute",e.style.top="0",e.style.left="0",e.style.backgroundColor="rgba(30, 30, 30, 0.4)",e.style.display="flex",e.style.justifyContent="center",e.style.alignItems="center",e.style.overflow="hidden",e.style.zIndex="9999",e.addEventListener("click",(t=>{t.target===e&&document.body.removeChild(e)}));const i=document.createElement("video");i.src=s,i.style.maxWidth="80%",i.style.maxHeight="80%",i.setAttribute("preload","auto"),i.setAttribute("controls","true"),e.appendChild(i),document.body.appendChild(e)}})),this.table.on(cw.DBLCLICK_CELL,(t=>{var e;if(t.federatedEvent){const i=l_(t.federatedEvent),o=this.table.scenegraph.getResizeColAt(i.abstractPos.x,i.abstractPos.y,null===(e=i.eventArgs)||void 0===e?void 0:e.targetCell);if(this.table.eventManager.checkCellFillhandle(i))this.table.fireListeners(cw.DBLCLICK_FILL_HANDLE,{});else if(this.table._canResizeColumn(o.col,o.row)&&o.col>=0){this.table.scenegraph.updateAutoColWidth(o.col),this.table.internalProps._widthResizedColMap.add(o.col),this.table.scenegraph.updateChartSize(o.col);const t=this.table.stateManager;t.columnResize.col<t.table.frozenColCount&&!t.table.isPivotTable()&&!t.table.transpose&&t.table.scenegraph.component.setFrozenColumnShadow(t.table.frozenColCount-1,t.columnResize.isRightFrozen);const e=[];for(let t=0;t<this.table.colCount;t++)e.push(this.table.getColWidth(t));this.table.fireListeners(cw.RESIZE_COLUMN_END,{col:o.col,colWidths:e})}}})),this.table.isPivotTable()&&function(t){const e=t.internalProps.layoutMap.rowsDefine,i=t.internalProps.layoutMap.columnsDefine;for(let t=0;t<e.length;t++){const i=e[t];if("string"!=typeof i&&(i.drillDown||i.drillUp))return!0}for(let t=0;t<i.length;t++){const e=i[t];if("string"!=typeof e&&(e.drillDown||e.drillUp))return!0}return!1}(this.table)&&function(t){t.on(cw.MOUSEENTER_CELL,(e=>{const{col:i,row:o}=e;if(-1===i||-1===o)return;const n=t.internalProps.layoutMap.getHeaderDimension(i,o);(null==n?void 0:n.drillDown)||(null==n?void 0:n.drillUp)?t.stateManager.updateDrillState(n.dimensionKey,n.title,n.drillDown,n.drillUp,i,o):t.stateManager.updateDrillState(void 0,void 0,!1,!1,-1,-1)})),t.on(cw.MOUSELEAVE_TABLE,(e=>{t.stateManager.updateDrillState(void 0,void 0,!1,!1,-1,-1)}))}(this.table),uR(this.table),function(t){t.isPivotChart()&&t.scenegraph.tableGroup.addEventListener("click",(e=>{var i;if(!t.stateManager.columnMove.moving&&!t.stateManager.columnResize.resizing)if("axis-label"===e.target.name){const i=l_(e),{col:o,row:n}=i.eventArgs,r=t.internalProps.layoutMap;let s,l;r.indicatorsAsCol?(s=r.getDimensionKeyInChartSpec(r.rowHeaderLevelCount,n),l=r.getCellHeaderPaths(r.rowHeaderLevelCount-2,n).rowHeaderPaths):(s=r.getDimensionKeyInChartSpec(o,r.columnHeaderLevelCount),l=r.getCellHeaderPaths(o,r.columnHeaderLevelCount-1).colHeaderPaths);const a=l.map((t=>({key:t.dimensionKey,value:t.value}))).filter((t=>t.key));if(a.push({key:s,value:e.target.attribute.text}),t._selectedDimensionInChart.length&&function(t,e){if(t.length!==e.length)return!1;for(let i=0;i<t.length;i++)if(t[i].key!==e[i].key||t[i].value!==e[i].value)return!1;return!0}(t._selectedDimensionInChart,a))return;t._selectedDimensionInChart=a,r.updateDataStateToChartInstance(),NB(t.scenegraph),t.scenegraph.updateNextFrame()}else(null===(i=t._selectedDimensionInChart)||void 0===i?void 0:i.length)&&(t._selectedDimensionInChart.length=0,t.internalProps.layoutMap.updateDataStateToChartInstance(),NB(t.scenegraph),t.scenegraph.updateNextFrame())}))}(this.table),function(t){t.isPivotChart()&&(t.on(cw.MOUSEENTER_CELL,(e=>{t.scenegraph.getCell(e.col,e.row).forEachChildren((i=>{if("axis"===i.name){const i=SR(e.col,e.row,t.internalProps.layoutMap);e.axisPosition=i,t.fireListeners(cw.MOUSEENTER_AXIS,e)}}))})),t.on(cw.MOUSELEAVE_CELL,(e=>{t.scenegraph.getCell(e.col,e.row).forEachChildren((i=>{if("axis"===i.name){const i=SR(e.col,e.row,t.internalProps.layoutMap);e.axisPosition=i,t.fireListeners(cw.MOUSELEAVE_AXIS,e)}}))})))}(this.table)}dealTableHover(t){if(!t)return void this.table.stateManager.updateHoverPos(-1,-1);const{eventArgs:e}=t;e?this.table.stateManager.updateHoverPos(e.col,e.row):this.table.stateManager.updateHoverPos(-1,-1)}dealIconHover(t){const{eventArgs:e}=t;e?this.table.stateManager.updateHoverIcon(e.col,e.row,e.target,e.targetCell,e.event):this.table.stateManager.updateHoverIcon(-1,-1,void 0,void 0)}dealMenuHover(t){}dealTableSelect(t,e){var i,o,n;if(!t)return this.table.stateManager.updateSelectPos(-1,-1),!1;const{eventArgs:r}=t;if(r){if("checkbox"===r.target.name||"radio"===r.target.name)return!1;const s=this.table.getBodyColumnDefine(r.col,r.row);return this.table.isHeader(r.col,r.row)&&((null==s?void 0:s.disableHeaderSelect)||(null===(i=this.table.stateManager.select)||void 0===i?void 0:i.disableHeader))||!this.table.isHeader(r.col,r.row)&&(null==s?void 0:s.disableSelect)?(e||this.table.stateManager.updateSelectPos(-1,-1),!1):!this.table.isPivotChart()||"axis-label"!==(null===(o=null==t?void 0:t.eventArgs)||void 0===o?void 0:o.target.name)&&"chart"!==(null===(n=null==t?void 0:t.eventArgs)||void 0===n?void 0:n.target.type)?(this.table.stateManager.updateSelectPos(r.col,r.row,r.event.shiftKey,r.event.ctrlKey||r.event.metaKey,!1,e),!0):(this.table.stateManager.updateSelectPos(-1,-1),!1)}return!1}dealFillSelect(t,e){var i,o;const{eventArgs:n}=t;if(n){if((null===(o=null===(i=this.table.stateManager.select)||void 0===i?void 0:i.ranges)||void 0===o?void 0:o.length)&&this.table.stateManager.isFillHandle()){let i,o;const r=this.table.stateManager.select.ranges[this.table.stateManager.select.ranges.length-1];e&&(Q(this.table.stateManager.fillHandle.directionRow)||(Math.abs(this.table.stateManager.fillHandle.startY-t.abstractPos.y)>=Math.abs(this.table.stateManager.fillHandle.startX-t.abstractPos.x)?this.table.stateManager.fillHandle.directionRow=!0:this.table.stateManager.fillHandle.directionRow=!1),Math.abs(this.table.stateManager.fillHandle.startY-t.abstractPos.y)>=Math.abs(this.table.stateManager.fillHandle.startX-t.abstractPos.x)?this.table.stateManager.fillHandle.startY-t.abstractPos.y>0?this.table.stateManager.fillHandle.direction="top":this.table.stateManager.fillHandle.direction="bottom":this.table.stateManager.fillHandle.startX-t.abstractPos.x>0?this.table.stateManager.fillHandle.direction="left":this.table.stateManager.fillHandle.direction="right",this.table.stateManager.fillHandle.directionRow?(i=n.row,o=r.end.col):(i=r.end.row,o=n.col)),this.table.stateManager.updateSelectPos(e?o:r.end.col,e?i:r.end.row,!0,n.event.ctrlKey||n.event.metaKey,!1,e)}else this.table.stateManager.updateSelectPos(n.col,n.row,n.event.shiftKey,n.event.ctrlKey||n.event.metaKey,!1,e);return!0}return!1}deelTableSelectAll(){this.table.stateManager.updateSelectPos(-1,-1,!1,!1,!0)}dealMenuSelect(t){}checkColumnResize(t,e){const{eventArgs:i}=t,o=this.table.scenegraph.getResizeColAt(t.abstractPos.x,t.abstractPos.y,null==i?void 0:i.targetCell);return!!(this.table._canResizeColumn(o.col,o.row)&&o.col>=0)&&(e&&this.table.stateManager.startResizeCol(o.col,t.abstractPos.x,t.abstractPos.y,o.rightFrozen),!0)}checkRowResize(t,e){const{eventArgs:i}=t;if(i){const o=this.table.scenegraph.getResizeRowAt(t.abstractPos.x,t.abstractPos.y,i.targetCell);if(this.table._canResizeRow(o.col,o.row)&&o.row>=0)return e&&this.table.stateManager.startResizeRow(o.row,t.abstractPos.x,t.abstractPos.y,o.bottomFrozen),!0}return!1}checkCellFillhandle(t,e){var i,o,n,r;if(null===(i=this.table.options.excelOptions)||void 0===i?void 0:i.fillHandle){const{eventArgs:i}=t;if(i&&(null===(n=null===(o=this.table.stateManager.select)||void 0===o?void 0:o.ranges)||void 0===n?void 0:n.length)){const i=Math.max(this.table.stateManager.select.ranges[this.table.stateManager.select.ranges.length-1].start.col,this.table.stateManager.select.ranges[this.table.stateManager.select.ranges.length-1].end.col),o=Math.max(this.table.stateManager.select.ranges[this.table.stateManager.select.ranges.length-1].start.row,this.table.stateManager.select.ranges[this.table.stateManager.select.ranges.length-1].end.row),n=this.table.scenegraph.highPerformanceGetCell(i,o).globalAABBBounds,s=Math.abs(t.abstractPos.x-n.x2),l=Math.abs(t.abstractPos.y-n.y2),a=18;if((null===(r=this.table.stateManager.fillHandle)||void 0===r?void 0:r.isFilling)||s<=a/2&&l<=a/2)return e&&this.table.stateManager.startFillSelect(t.abstractPos.x,t.abstractPos.y),!0}}return!1}dealColumnResize(t,e){this.table.stateManager.updateResizeCol(t,e)}dealRowResize(t,e){this.table.stateManager.updateResizeRow(t,e)}chechColumnMover(t){var e,i;const{eventArgs:o}=t;return!!(o&&this.table.isHeader(o.col,o.row)&&(function(t,e,i){for(let o=0;o<i.length;o++)if(iw(i[o],t,e))return!0;return!1}(o.col,o.row,this.table.stateManager.select.ranges)||(null===(e=this.table.options.select)||void 0===e?void 0:e.disableHeaderSelect)||(null===(i=this.table.options.select)||void 0===i?void 0:i.disableSelect))&&this.table._canDragHeaderPosition(o.col,o.row))&&(this.table.stateManager.startMoveCol(o.col,o.row,t.abstractPos.x,t.abstractPos.y),!0)}dealColumnMover(t){const{eventArgs:e}=t;Q(e.col)&&Q(e.row)&&this.table.stateManager.updateMoveCol(e.col,e.row,t.abstractPos.x,t.abstractPos.y)}startColumnResize(t){}dealIconClick(t,e){const{eventArgs:i}=e,{target:o,event:n,col:r,row:s}=i||{target:t.target,event:t,col:-1,row:-1},l=o;if(l.role&&l.role.startsWith("icon-"))return this.table.fireListeners(cw.ICON_CLICK,{name:l.name,x:(l.globalAABBBounds.x1+l.globalAABBBounds.x2)/2,y:l.globalAABBBounds.y2,col:r,row:s,funcType:l.attribute.funcType,icon:l,event:n}),!0;if(o instanceof Ra){const t=o.pickIcon(n.global);if(t)return this.table.fireListeners(cw.ICON_CLICK,{name:t.attribute.id,x:t.globalX+t.globalAABBBounds.width()/2,y:t.globalY+t.AABBBounds.height(),col:r,row:s,funcType:t.attribute.funcType,icon:t,event:n}),!0}return!1}release(){this.gesture.release(),this.globalEventListeners.forEach((t=>{"document"===t.env?document.removeEventListener(t.name,t.callback):"body"===t.env?document.body.removeEventListener(t.name,t.callback):"window"===t.env&&window.removeEventListener(t.name,t.callback)})),this.globalEventListeners=[]}enableScroll(){this._enableTableScroll=!0}disableScroll(){this._enableTableScroll=!1}}(this),e.legends){K.legends=[];const t=Vw.getFunction("createLegend");if(Array.isArray(e.legends)){for(let i=0;i<e.legends.length;i++)K.legends.push(t(e.legends[i],this));this.scenegraph.tableGroup.setAttributes({x:this.tableX,y:this.tableY})}else K.legends.push(t(e.legends,this)),this.scenegraph.tableGroup.setAttributes({x:this.tableX,y:this.tableY})}if(K.tooltip=Object.assign({renderMode:"html",isShowOverflowTextTooltip:!1,confine:!0},e.tooltip),"html"===K.tooltip.renderMode){const t=Vw.getComponent("tooltipHandler");K.tooltipHandler=new t(this,K.tooltip.confine)}if(K.menu=Object.assign({renderMode:"html"},e.menu),Array.isArray(null===(a=e.menu)||void 0===a?void 0:a.dropDownMenuHighlight)&&this.setDropDownMenuHighlight(null===(h=e.menu)||void 0===h?void 0:h.dropDownMenuHighlight),Array.isArray(null===(d=e.menu)||void 0===d?void 0:d.defaultHeaderMenuItems)&&(this.globalDropDownMenu=e.menu.defaultHeaderMenuItems),"html"===K.menu.renderMode){const t=Vw.getComponent("menuHandler");K.menuHandler=new t(this)}this.headerStyleCache=new Map,this.bodyStyleCache=new Map,this.bodyBottomStyleCache=new Map,K.stick={changedCells:new Map},K.customMergeCell=e.customMergeCell,this.customCellStylePlugin=new fM(this,null!==(c=e.customCellStyle)&&void 0!==c?c:[],null!==(u=e.customCellStyleArrangement)&&void 0!==u?u:[])}getContainer(){return this.container}getElement(){return this.internalProps.element}get canvas(){return this.internalProps.canvas}setCanvasSize(t,e){this.canvasWidth=t,this.canvasHeight=e,this.resize()}resize(){var t;this._updateSize(),null===(t=this.internalProps.legends)||void 0===t||t.forEach((t=>{null==t||t.resize()})),this.internalProps.title&&this.internalProps.title.resize(),this.internalProps.emptyTip&&this.internalProps.emptyTip.resize(),this.scenegraph.resize()}get rowCount(){return this.internalProps.rowCount}set rowCount(t){this.internalProps.rowCount=t}get colCount(){var t;return null!==(t=this.internalProps.colCount)&&void 0!==t?t:0}set colCount(t){this.internalProps.colCount=t}get frozenColCount(){var t,e,i,o,n;return null!==(n=null!==(i=null===(e=null===(t=this.internalProps)||void 0===t?void 0:t.layoutMap)||void 0===e?void 0:e.frozenColCount)&&void 0!==i?i:null===(o=this.internalProps)||void 0===o?void 0:o.frozenColCount)&&void 0!==n?n:0}set frozenColCount(t){t>=this.colCount&&(t=0),this.internalProps.frozenColCount=t,this.options.frozenColCount=t,this.tableNoFrameWidth-this.getColsWidth(0,t-1)<=120&&(this.internalProps.frozenColCount=0),this.stateManager.setFrozenCol(this.internalProps.frozenColCount)}setFrozenColCount(t){t>=this.colCount&&(t=0),this.internalProps.frozenColCount=t,this.options.frozenColCount=t,this.tableNoFrameWidth-this.getColsWidth(0,t-1)<=120&&(this.internalProps.frozenColCount=0),this.stateManager.setFrozenCol(this.internalProps.frozenColCount)}_setFrozenColCount(t){t>=this.colCount&&(t=0),this.internalProps.frozenColCount=t}_resetFrozenColCount(){this.options.frozenColCount&&(this.tableNoFrameWidth-this.getColsWidth(0,this.options.frozenColCount-1)<=120?this._setFrozenColCount(0):this.frozenColCount!==this.options.frozenColCount&&this._setFrozenColCount(this.options.frozenColCount))}get frozenRowCount(){var t,e,i,o,n;return null!==(n=null!==(i=null===(e=null===(t=this.internalProps)||void 0===t?void 0:t.layoutMap)||void 0===e?void 0:e.frozenRowCount)&&void 0!==i?i:null===(o=this.internalProps)||void 0===o?void 0:o.frozenRowCount)&&void 0!==n?n:0}set frozenRowCount(t){this.internalProps.frozenRowCount=t}get rightFrozenColCount(){var t,e,i,o,n;return null!==(n=null!==(i=null===(e=null===(t=this.internalProps)||void 0===t?void 0:t.layoutMap)||void 0===e?void 0:e.rightFrozenColCount)&&void 0!==i?i:null===(o=this.internalProps)||void 0===o?void 0:o.rightFrozenColCount)&&void 0!==n?n:0}set rightFrozenColCount(t){this.scenegraph.dealWidthRightFrozen(t)}get bottomFrozenRowCount(){var t,e,i,o,n;return null!==(n=null!==(i=null===(e=null===(t=this.internalProps)||void 0===t?void 0:t.layoutMap)||void 0===e?void 0:e.bottomFrozenRowCount)&&void 0!==i?i:null===(o=this.internalProps)||void 0===o?void 0:o.bottomFrozenRowCount)&&void 0!==n?n:0}set bottomFrozenRowCount(t){this.scenegraph.dealWidthBottomFrozen(t)}get defaultRowHeight(){return this.internalProps.defaultRowHeight}set defaultRowHeight(t){this.internalProps.defaultRowHeight=t,this.options.defaultRowHeight=t}get defaultHeaderRowHeight(){return this.internalProps.defaultHeaderRowHeight}set defaultHeaderRowHeight(t){this.internalProps.defaultHeaderRowHeight=t,this.options.defaultHeaderRowHeight=t}get defaultColWidth(){return this.internalProps.defaultColWidth}set defaultColWidth(t){this.internalProps.defaultColWidth=t,this.options.defaultColWidth=t}get defaultHeaderColWidth(){return this.internalProps.defaultHeaderColWidth}set defaultHeaderColWidth(t){this.internalProps.defaultHeaderColWidth=t,this.options.defaultHeaderColWidth=t}get colWidthsMap(){return this.internalProps._colWidthsMap}set colWidthsMap(t){this.internalProps._colWidthsMap=t}get colContentWidthsMap(){return this.internalProps._colContentWidthsMap}set colContentWidthsMap(t){this.internalProps._colContentWidthsMap=t}get _colRangeWidthsMap(){return this.internalProps._colRangeWidthsMap}set _colRangeWidthsMap(t){this.internalProps._colRangeWidthsMap=t}get _rowRangeHeightsMap(){return this.internalProps._rowRangeHeightsMap}set _rowRangeHeightsMap(t){this.internalProps._rowRangeHeightsMap=t}get rowHeightsMap(){return this.internalProps._rowHeightsMap}set rowHeightsMap(t){this.internalProps._rowHeightsMap=t}get colWidthsLimit(){return this.internalProps._colWidthsLimit}set colWidthsLimit(t){this.internalProps._colWidthsLimit=t}get keyboardOptions(){var t;return null!==(t=this.internalProps.keyboardOptions)&&void 0!==t?t:null}set keyboardOptions(t){this.internalProps.keyboardOptions=null!=t?t:void 0}get eventOptions(){var t;return null!==(t=this.internalProps.eventOptions)&&void 0!==t?t:null}set eventOptions(t){this.internalProps.eventOptions=null!=t?t:void 0}get widthMode(){return this._widthMode}set widthMode(t){t!==this._widthMode&&(this._widthMode=t,this.options.widthMode=t)}get heightMode(){return this._heightMode}set heightMode(t){t!==this._heightMode&&(this._heightMode=t,this.options.heightMode=t)}get autoFillWidth(){return this._autoFillWidth}set autoFillWidth(t){t!==this._autoFillWidth&&(this._autoFillWidth=t)}get autoFillHeight(){return this._autoFillHeight}set autoFillHeight(t){t!==this._autoFillHeight&&(this._autoFillHeight=t)}get widthAdaptiveMode(){return this._widthAdaptiveMode}set widthAdaptiveMode(t){t!==this._widthAdaptiveMode&&(this._widthAdaptiveMode=t)}get heightAdaptiveMode(){return this._heightAdaptiveMode}set heightAdaptiveMode(t){t!==this._heightAdaptiveMode&&(this._heightAdaptiveMode=t)}_colWidthDefineToPxWidth(t){return"auto"===t?0:t_(this,t)}_getColWidthLimits(t){const e=this.colWidthsLimit[t];if(!e)return null;const i={};return e.min&&(i.min=t_(this,e.min),i.minDef=e.min),e.max&&(i.max=t_(this,e.max),i.maxDef=e.max),i}_adjustColWidth(t,e){const i=this._getColWidthLimits(t);return Math.max(function(t,e){return t?t.min&&t.min>e?t.min:t.max&&t.max<e?t.max:e:e}(i,e),0)}setPixelRatio(t){if(t!==this.internalProps.pixelRatio){this.internalProps.pixelRatio=t;const e=this.options.canvasWidth;this.internalProps.calcWidthContext={_:this.internalProps,get full(){var i;return"node"===BC.mode?e/(null!=t?t:1):this._.canvas.width/(null!==(i=this._.context.pixelRatio)&&void 0!==i?i:window.devicePixelRatio)}},this.scenegraph.setPixelRatio(t)}}_updateSize(){var t,e,i,o,n,r,s,l,a,h,d,c,u,g,p,f,m,b,v,y,C,w,x,_,S;const{padding:A}=this;let B=0,R=0;if("browser"===BC.mode){const r=this.getElement();let s=0,l=0;if(this.canvasSizeSeted)s=this.canvasWidth,l=this.canvasHeight;else if(r.parentElement){const t=r.parentElement.style||window.getComputedStyle(r.parentElement);s=r.parentElement.offsetWidth-parseInt(t.paddingLeft||"0px",10)-parseInt(t.paddingRight||"0px",10),l=r.parentElement.offsetHeight-parseInt(t.paddingTop||"0px",10)-parseInt(t.paddingBottom||"0px",20)}const a=null!=s?s:0,h=null!=l?l:0;r.style.width=a&&a-A.left-A.right+"px"||"0px",r.style.height=h&&h-A.top-A.bottom+"px"||"0px";const{canvas:d}=this.internalProps;B=null!==(e=null===(t=d.parentElement)||void 0===t?void 0:t.offsetWidth)&&void 0!==e?e:0,R=null!==(o=null===(i=d.parentElement)||void 0===i?void 0:i.offsetHeight)&&void 0!==o?o:0,(null===(n=null==this?void 0:this.scenegraph)||void 0===n?void 0:n.stage)?this.scenegraph.stage.resize(B,R):(d.style.width="",d.style.height="",d.width=B,d.height=R,d.style.width=`${B}px`,d.style.height=`${R}px`),this.internalProps.bodyDomContainer&&(this.internalProps.bodyDomContainer.style.width=`${B}px`,this.internalProps.bodyDomContainer.style.height=`${R}px`),this.internalProps.headerDomContainer&&(this.internalProps.headerDomContainer.style.width=`${B}px`,this.internalProps.headerDomContainer.style.height=`${R}px`)}else"node"===BC.mode&&(B=this.canvasWidth-1,R=this.canvasHeight-1);const M=Math.floor(B-function(t){var e;return(null==t?void 0:t.hoverOn)||(null==t?void 0:t.verticalVisible)&&"none"===(null==t?void 0:t.verticalVisible)||!(null==t?void 0:t.verticalVisible)&&"none"===(null==t?void 0:t.visible)?0:null!==(e=null==t?void 0:t.width)&&void 0!==e?e:7}(this.getTheme().scrollStyle)),T=Math.floor(R-function(t){var e;return(null==t?void 0:t.hoverOn)||(null==t?void 0:t.horizontalVisible)&&"none"===(null==t?void 0:t.horizontalVisible)||!(null==t?void 0:t.horizontalVisible)&&"none"===(null==t?void 0:t.visible)?0:null!==(e=null==t?void 0:t.width)&&void 0!==e?e:7}(this.getTheme().scrollStyle));if(null===(r=this.internalProps.theme)||void 0===r?void 0:r.frameStyle){const t=AM(null!==(l=null===(s=this.internalProps.theme.frameStyle)||void 0===s?void 0:s.borderLineWidth)&&void 0!==l?l:[null]),e=AM(null!==(h=null===(a=this.internalProps.theme.frameStyle)||void 0===a?void 0:a.shadowBlur)&&void 0!==h?h:[0]);(null===(d=this.theme.frameStyle)||void 0===d?void 0:d.innerBorder)?(this.tableX=0,this.tableY=0,this.tableNoFrameWidth=M-(null!==(c=e[1])&&void 0!==c?c:0),this.tableNoFrameHeight=T-(null!==(u=e[2])&&void 0!==u?u:0)):(this.tableX=(null!==(g=t[3])&&void 0!==g?g:0)+(null!==(p=e[3])&&void 0!==p?p:0),this.tableY=(null!==(f=t[0])&&void 0!==f?f:0)+(null!==(m=e[0])&&void 0!==m?m:0),this.tableNoFrameWidth=M-((null!==(b=t[1])&&void 0!==b?b:0)+(null!==(v=e[1])&&void 0!==v?v:0))-((null!==(y=t[3])&&void 0!==y?y:0)+(null!==(C=e[3])&&void 0!==C?C:0)),this.tableNoFrameHeight=T-((null!==(w=t[0])&&void 0!==w?w:0)+(null!==(x=e[0])&&void 0!==x?x:0))-((null!==(_=t[2])&&void 0!==_?_:0)+(null!==(S=e[2])&&void 0!==S?S:0)))}}get rowHierarchyType(){return"grid"}getColsWidth(t,e){var i;if(t>e)return 0;t=Math.max(t,0),e=Math.min(e,(null!==(i=this.colCount)&&void 0!==i?i:1/0)-1);const o=this._colRangeWidthsMap.get(`$${t}$${e}`);if(null!=o)return o;const n=this._colRangeWidthsMap.get(`$${t}$${e-1}`);if(null!=n){const i=n+this.getColWidth(e);return t>=0&&e>=0&&!Number.isNaN(i)&&this._colRangeWidthsMap.set(`$${t}$${e}`,Math.round(i)),Math.round(i)}let r=0;for(let i=t;i<=e;i++)r+=this.getColWidth(i);return t>=0&&e>=0&&this._colRangeWidthsMap.set(`$${t}$${e}`,Math.round(r)),Math.round(r)}getRowHeight(t){var e;if(Q(this.rowHeightsMap.get(t))){if(null===(e=this.options.customConfig)||void 0===e?void 0:e._disableColumnAndRowSizeRound){const e=this.rowHeightsMap.get(t);let i;return i=t<this.frozenRowCount?this.rowHeightsMap.getSumInRange(0,t):t>=this.rowCount-this.bottomFrozenRowCount?this.rowHeightsMap.getSumInRange(t,this.rowCount-1):this.rowHeightsMap.getSumInRange(this.frozenRowCount,t),i=Number(i.toFixed(2)),Number.isInteger(i)?Math.ceil(e):Math.floor(e)}return this.rowHeightsMap.get(t)}const i=this.getDefaultRowHeight(t);return at(i)?i:this.defaultRowHeight}getDefaultColumnWidth(t){var e,i;return this.isRowHeader(t,0)||this.isCornerHeader(t,0)?Array.isArray(this.defaultHeaderColWidth)?null!==(e=this.defaultHeaderColWidth[t])&&void 0!==e?e:this.defaultColWidth:this.defaultHeaderColWidth:this.isRightFrozenColumn(t,this.columnHeaderLevelCount)&&this.isPivotTable()?Array.isArray(this.defaultHeaderColWidth)?null!==(i=this.defaultHeaderColWidth[this.rowHeaderLevelCount-this.rightFrozenColCount])&&void 0!==i?i:this.defaultColWidth:this.defaultHeaderColWidth:this.defaultColWidth}getDefaultRowHeight(t){var e,i;return this.isColumnHeader(0,t)||this.isCornerHeader(0,t)||this.isSeriesNumberInHeader(0,t)?Array.isArray(this.defaultHeaderRowHeight)?null!==(e=this.defaultHeaderRowHeight[t])&&void 0!==e?e:this.internalProps.defaultRowHeight:this.defaultHeaderRowHeight:this.isBottomFrozenRow(t)?Array.isArray(this.defaultHeaderRowHeight)?null!==(i=this.defaultHeaderRowHeight[this.columnHeaderLevelCount>0?this.columnHeaderLevelCount-this.bottomFrozenRowCount:0])&&void 0!==i?i:this.internalProps.defaultRowHeight:this.defaultHeaderRowHeight:this.internalProps.defaultRowHeight}_setRowHeight(t,e,i){var o;this.rowHeightsMap.put(t,(null===(o=this.options.customConfig)||void 0===o?void 0:o._disableColumnAndRowSizeRound)?e:Math.round(e)),i&&this._clearRowRangeHeightsMap(t)}setRowHeight(t,e){this.scenegraph.setRowHeight(t,e),this.internalProps._heightResizedRowMap.add(t)}getRowsHeight(t,e){var i,o;if(t>e||0===this.rowCount)return 0;t=Math.max(t,0),e=Math.min(e,(null!==(i=this.rowCount)&&void 0!==i?i:1/0)-1);let n=0;if("standard"!==this.heightMode||this.autoFillHeight||!this.internalProps.layoutMap||this.hasAutoImageColumn()||0!==this.internalProps._heightResizedRowMap.size){if(null===(o=this.options.customConfig)||void 0===o?void 0:o._disableColumnAndRowSizeRound){const i=this.rowHeightsMap.getSumInRange(t,e);let o;return o=e<this.frozenRowCount?this.rowHeightsMap.getSumInRange(0,e):e>=this.rowCount-this.bottomFrozenRowCount?this.rowHeightsMap.getSumInRange(e,this.rowCount-1):this.rowHeightsMap.getSumInRange(this.frozenRowCount,e),o=Number(o.toFixed(2)),Number.isInteger(o)?Math.ceil(i):Math.floor(i)}n=this.rowHeightsMap.getSumInRange(t,e)}else{for(let i=t;i<Math.min(e+1,this.columnHeaderLevelCount);i++)n+=this.getRowHeight(i);e>=this.columnHeaderLevelCount&&(n+=this.defaultRowHeight*(Math.min(e,this.rowCount-this.bottomFrozenRowCount-1)-Math.max(this.columnHeaderLevelCount,t)+1));for(let t=this.rowCount-this.bottomFrozenRowCount;t<e+1;t++)n+=this.getRowHeight(t)}return Math.round(n)}getColWidthDefined(t){var e;const{layoutMap:i}=this.internalProps;if("autoWidth"===this.widthMode)return"auto";const{width:o}=null!==(e=null==i?void 0:i.getColumnWidthDefined(t))&&void 0!==e?e:{};return"number"==typeof o&&o<=0?0:o||this.getDefaultColumnWidth(t)}getColWidthDefinedNumber(t){const e=this.getColWidthDefined(t);return this._adjustColWidth(t,this._colWidthDefineToPxWidth(e))}isAutoRowHeight(t){return"autoHeight"===this.heightMode||t>=0&&t<this.columnHeaderLevelCount&&"auto"===this.getDefaultRowHeight(t)}getColWidth(t){var e;const i=null!==(e=this.colWidthsMap.get(t))&&void 0!==e?e:this.getDefaultColumnWidth(t);return"adaptive"===this.widthMode&&"number"==typeof i||this.transpose&&"number"==typeof i?this._colWidthDefineToPxWidth(i):this._adjustColWidth(t,this._colWidthDefineToPxWidth(i))}_setColWidth(t,e,i,o){this.colWidthsMap.put(t,"number"==typeof e?Math.round(e):e),i&&this._clearColRangeWidthsMap(t),o||this.stateManager.checkFrozen()}setColWidth(t,e){this.scenegraph.setColWidth(t,e),this.internalProps._widthResizedColMap.add(t)}_clearColRangeWidthsMap(t){if("number"!=typeof t)this._colRangeWidthsMap.clear();else{const e=this._colRangeWidthsMap.keys();for(const i of e){const e=RM.exec(i);if(e){const o=Number(e[1]),n=Number(e[2]);t>=o&&t<=n&&this._colRangeWidthsMap.delete(i)}}}}_clearRowRangeHeightsMap(t){this.rowHeightsMap.clearRange()}_getColContentWidth(t){return Number(this.colContentWidthsMap.get(t))}_setColContentWidth(t,e){this.colContentWidthsMap.put(t,e)}getAllRowsHeight(){return this.internalProps.rowCount<=0?0:this.getRowsHeight(0,this.internalProps.rowCount-1)}getAllColsWidth(){return this.internalProps.colCount<=0?0:this.getColsWidth(0,this.internalProps.colCount-1)}getMaxColWidth(t){var e;const i=this.colWidthsLimit[t];let o=null!==(e=i&&i.max)&&void 0!==e?e:1/0;return"string"==typeof o&&(o=t_(this,o)),o}setMaxColWidth(t,e){(this.colWidthsLimit[t]||(this.colWidthsLimit[t]={})).max=e}getMinColWidth(t){var e;const i=this.colWidthsLimit[t];let o=null!==(e=i&&i.min)&&void 0!==e?e:0;return"string"==typeof o&&(o=t_(this,o)),o}setMinColWidth(t,e){(this.colWidthsLimit[t]||(this.colWidthsLimit[t]={})).min=e}getCellRect(t,e){var i,o;const n=this.isFrozenCell(t,e);let r;const s=this.getColWidth(t);let l;r=n&&n.col&&this.isRightFrozenColumn(t,e)?this.getAllColsWidth()<=this.tableNoFrameWidth?this.getColsWidth(0,t-1)||0:this.tableNoFrameWidth-(null!==(i=this.getColsWidth(t,this.colCount-1))&&void 0!==i?i:0):this.getColsWidth(0,t-1)||0;const a=this.getRowHeight(e);return l=n&&n.row&&this.isBottomFrozenRow(t,e)?this.getAllRowsHeight()<=this.tableNoFrameHeight?this.getRowsHeight(0,e-1):this.tableNoFrameHeight-(null!==(o=this.getRowsHeight(e,this.rowCount-1))&&void 0!==o?o:0):this.getRowsHeight(0,e-1),new vw(Math.round(r),Math.round(l),Math.round(s),Math.round(a))}getMergeCellRect(t,e){const i=this.getCellRange(t,e),o=this.getColsWidth(0,i.start.col-1)||0,n=this.getColsWidth(i.start.col,i.end.col),r=this.getRowsHeight(0,i.start.row-1)||0,s=this.getRowsHeight(i.start.row,i.end.row);return new vw(Math.round(o),Math.round(r),Math.round(n),Math.round(s))}getCellRelativeRect(t,e){const i=this.isFrozenCell(t,e);let o=!0,n=!0;(null==i?void 0:i.col)&&(null==i?void 0:i.row)?(o=!1,n=!1):(null==i?void 0:i.col)?o=!1:(null==i?void 0:i.row)&&(n=!1);const r=this.getCellRect(t,e);return this._toRelativeRect(r,o,n)}getCellRangeRelativeRect(t){if(t.start){const e=this.isFrozenCell(t.start.col,t.start.row);let i=!0,o=!0;return(null==e?void 0:e.col)&&(null==e?void 0:e.row)?(i=!1,o=!1):(null==e?void 0:e.col)?i=!1:(null==e?void 0:e.row)&&(o=!1),this._toRelativeRect(this.getCellsRect(t.start.col,t.start.row,t.end.col,t.end.row),i,o)}const e=this.getCellRange(t.col,t.row),i=this.isFrozenCell(t.col,t.row);let o=!0,n=!0;return(null==i?void 0:i.col)&&(null==i?void 0:i.row)?(o=!1,n=!1):(null==i?void 0:i.col)?o=!1:(null==i?void 0:i.row)&&(n=!1),this._toRelativeRect(this.getCellsRect(e.start.col,e.start.row,e.end.col,e.end.row),o,n)}getVisibleCellRangeRelativeRect(t){let e;return e=t.start?t:this.getCellRange(t.col,t.row),this._getVisiableRect(this.getCellRangeRelativeRect(t),e)}_getVisiableRect(t,e){const i=e.start.col>=this.frozenColCount?Math.max(t.left,this.frozenColCount>=1?this.getColsWidth(0,this.frozenColCount-1):0):t.left,o=Math.min(t.right,this.tableNoFrameWidth),n=t.copy();n.left=i,n.right=o;const r=e.start.row>=this.frozenRowCount?Math.max(t.top,this.frozenRowCount>=1?this.getRowsHeight(0,this.frozenRowCount-1):0):t.top,s=Math.min(t.bottom,this.tableNoFrameHeight);return n.top=r,n.bottom=s,n}getCellsRect(t,e,i,o){var n,r,s,l,a,h;let d=this.getColsWidth(0,t-1)||0,c=this.getColsWidth(t,i);const u=this.scrollLeft;this.isLeftFrozenColumn(t)&&this.isRightFrozenColumn(i)?c=this.tableNoFrameWidth-(null!==(n=this.getColsWidth(t+1,this.colCount-1))&&void 0!==n?n:0)-d:this.isLeftFrozenColumn(t)&&!this.isLeftFrozenColumn(i)?c=Math.max(c-u,this.getColsWidth(t,this.frozenColCount-1)):!this.isRightFrozenColumn(t)&&this.isRightFrozenColumn(i)?(d=Math.min(d-u,this.tableNoFrameWidth-this.getRightFrozenColsWidth()),c=this.tableNoFrameWidth-(null!==(r=this.getColsWidth(t+1,this.colCount-1))&&void 0!==r?r:0)-d):this.isRightFrozenColumn(t)&&(d=this.tableNoFrameWidth-(null!==(s=this.getColsWidth(t,this.colCount-1))&&void 0!==s?s:0));let g=this.getRowsHeight(0,e-1),p=this.getRowsHeight(e,o);const f=this.scrollTop;return this.isTopFrozenRow(e)&&this.isBottomFrozenRow(o)?p=this.tableNoFrameHeight-(null!==(l=this.getRowsHeight(e+1,this.rowCount-1))&&void 0!==l?l:0)-g:this.isTopFrozenRow(e)&&!this.isTopFrozenRow(o)?p=Math.max(p-f,this.getRowsHeight(e,this.frozenRowCount-1)):!this.isBottomFrozenRow(e)&&this.isBottomFrozenRow(o)?(g=Math.min(g-f,this.tableNoFrameHeight-this.getBottomFrozenRowsHeight()),p=this.tableNoFrameHeight-(null!==(a=this.getRowsHeight(e+1,this.rowCount-1))&&void 0!==a?a:0)-g):this.isBottomFrozenRow(e)&&(g=this.tableNoFrameHeight-(null!==(h=this.getRowsHeight(e,this.rowCount-1))&&void 0!==h?h:0)),new vw(Math.round(d),Math.round(g),Math.round(c),Math.round(p))}getCellsRectWidth(t,e,i,o){const n=this.isFrozenCell(t,e),r=this.isFrozenCell(i,o);let s=this.getColsWidth(t,i);if(n&&n.col){const e=this.scrollLeft;r&&r.col||(s-=e,s=Math.max(s,this.getColsWidth(t,this.frozenColCount-1)))}return s}getCellRangeRect(t){if(t.start)return this.getCellsRect(t.start.col,t.start.row,t.end.col,t.end.row);const e=this.getCellRange(t.col,t.row);return this.getCellsRect(e.start.col,e.start.row,e.end.col,e.end.row)}getCellRangeRectWidth(t){if(t.start)return this.getCellsRectWidth(t.start.col,t.start.row,t.end.col,t.end.row);const e=this.getCellRange(t.col,t.row);return this.getCellsRectWidth(e.start.col,e.start.row,e.end.col,e.end.row)}isFrozenCell(t,e){const i=this.isFrozenRow(e),o=this.isFrozenColumn(t);return i||o?{row:i,col:o}:null}getRowAt(t){return yM(t,this)}getColAt(t){return CM(t,this)}getCellAt(t,e){return function(t,e,i){const o=yM(e,i),{row:n,top:r,bottom:s,height:l}=o,a=CM(t,i),{col:h,left:d,right:c,width:u}=a;return{row:n,col:h,rect:{left:d,right:c,top:r,bottom:s,width:u,height:l}}}(t,e,this)}getCellAtRelativePosition(t,e){return function(t,e,i){t-=i.tableX;let o=!1;(e-=i.tableY)>0&&e<i.getFrozenRowsHeight()&&(o=!0);let n=!1;t>0&&t<i.getFrozenColsWidth()&&(n=!0);let r=!1;e>i.tableNoFrameHeight-i.getBottomFrozenRowsHeight()&&e<i.tableNoFrameHeight&&e<=i.getAllRowsHeight()&&(r=!0);let s=!1;t>i.tableNoFrameWidth-i.getRightFrozenColsWidth()&&t<i.tableNoFrameWidth&&t<=i.getAllColsWidth()&&(s=!0);const l=_M(n||s?t:t+i.scrollLeft,s,i),a=SM(o||r?e:e+i.scrollTop,r,i);if(l&&a){const{row:t,top:e,bottom:i,height:o}=a,{col:n,left:r,right:s,width:h}=l;return{row:t,col:n,rect:{left:r,right:s,top:e,bottom:i,width:h,height:o}}}return{col:-1,row:-1}}(t,e,this)}_checkRowCol(t,e){return t>=0&&t<this.colCount&&e>=0&&e<this.rowCount}_makeVisibleCell(t,e){if(this._checkRowCol(t,e)){const i=this.isFrozenCell(t,e);if(i&&i.col&&i.row)return;const o=this.getCellRect(t,e),n=function(t){let e=0,i=0;t.frozenColCount>0&&(e=t.getFrozenColsWidth()),t.rightFrozenColCount>0&&(i=t.getRightFrozenColsWidth());let o=0,n=0;return t.frozenRowCount>0&&(o=t.getFrozenRowsHeight()),t.bottomFrozenRowCount>0&&(n=t.getBottomFrozenRowsHeight()),new vw(t.scrollLeft+e,t.scrollTop+o,t.tableNoFrameWidth-e-i,t.tableNoFrameHeight-o-n)}(this);if(n.contains(o))return;i&&i.col||this.getColsWidth(0,this.frozenColCount-1)+o.width>this.canvas.width||(o.left<n.left?this.scrollLeft-=n.left-o.left:n.right<o.right&&(this.scrollLeft-=n.right-o.right)),i&&i.row||this.getRowsHeight(0,this.frozenRowCount-1)+o.height>this.canvas.height||(o.top<n.top?this.scrollTop-=n.top-o.top:n.bottom<o.bottom&&(this.scrollTop-=n.bottom-o.bottom))}}render(){this.scenegraph.renderSceneGraph()}renderAsync(){return this.scenegraph.updateNextFrame(),new Promise(((t,e)=>{setTimeout((()=>{t()}),0)}))}_toRelativeRect(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];const o=t.copy(),n=this.getVisibleRect();return o.offsetLeft(this.tableX-(e?n.left:0)),o.offsetTop(this.tableY-(i?n.top:0)),o}getVisibleRect(){const{scrollTop:t,scrollLeft:e}=this,i=this.tableNoFrameWidth,o=this.tableNoFrameHeight;return new vw(e,t,i,o)}get visibleRowCount(){const{frozenRowCount:t}=this,e=this.getVisibleRect(),i=t>0?e.top+this.getRowsHeight(0,t-1):e.top,o=this.getTargetRowAt(i);if(!o)return 0;const n=Math.max(o.top>=i?o.row:o.row+1,t);let r=this.getRowsHeight(0,n-1),s=0;const{rowCount:l}=this;for(let t=n;t<l;t++){const i=r+this.getRowHeight(t);if(e.bottom<i)break;s++,r=i}return s}getBodyVisibleCellRange(){const{scrollTop:t,scrollLeft:e}=this,i=this.getFrozenRowsHeight(),o=this.getFrozenColsWidth(),n=this.getBottomFrozenRowsHeight(),r=this.getRightFrozenColsWidth(),{row:s}=this.getRowAt(t+i+1),{col:l}=this.getColAt(e+o+1),a=this.getAllRowsHeight()>this.tableNoFrameHeight?this.getRowAt(t+this.tableNoFrameHeight-1-n).row:this.rowCount-1,h=this.getAllColsWidth()>this.tableNoFrameWidth?this.getColAt(e+this.tableNoFrameWidth-1-r).col:this.colCount-1;return h<0||a<0?null:{rowStart:s,colStart:l,rowEnd:a,colEnd:h}}getBodyVisibleRowRange(){const{scrollTop:t}=this,e=this.getFrozenRowsHeight(),i=this.getBottomFrozenRowsHeight(),{row:o}=this.getRowAt(t+e+1),n=this.getAllRowsHeight()>this.tableNoFrameHeight?this.getRowAt(t+this.tableNoFrameHeight-1-i).row:this.rowCount-1;return n<0?null:{rowStart:o,rowEnd:n}}getBodyVisibleColRange(){const{scrollLeft:t}=this,e=this.getFrozenColsWidth(),i=this.getRightFrozenColsWidth(),{col:o}=this.getColAt(t+e+1),n=this.getAllColsWidth()>this.tableNoFrameWidth?this.getColAt(t+this.tableNoFrameWidth-1-i).col:this.colCount-1;return n<0?null:{colStart:o,colEnd:n}}get visibleColCount(){const{frozenColCount:t}=this,e=this.getVisibleRect(),i=t>0?e.left+this.getColsWidth(0,t-1):e.left,o=this.getTargetColAt(i);if(!o)return 0;const n=Math.max(o.left>=i?o.col:o.col+1,t);let r=this.getColsWidth(0,n-1),s=0;const{colCount:l}=this;for(let t=n;t<l;t++){const i=r+this.getColWidth(t);if(e.right<i)break;s++,r=i}return s}get scrollTop(){return this.stateManager.scroll.verticalBarPos}set scrollTop(t){this.stateManager.setScrollTop(t)}get scrollLeft(){return this.stateManager.scroll.horizontalBarPos}set scrollLeft(t){this.stateManager.setScrollLeft(t)}getScrollLeft(){return this.scrollLeft}getScrollTop(){return this.scrollTop}setScrollLeft(t){this.scrollLeft=Math.ceil(t)}setScrollTop(t){this.scrollTop=Math.ceil(t)}getCellOverflowText(t,e){return this.scenegraph.getCellOverflowText(t,e)}addReleaseObj(t){if(!t||!t.release||"function"!=typeof t.release)throw new Error("not releaseObj!");(this.internalProps.releaseList=this.internalProps.releaseList||[]).push(t)}dispose(){this.release()}release(){var t,e,i,o,n,r,s,l,a,h,d,c,u,g,p;const f=this.internalProps;null===(e=null===(t=f.tooltipHandler)||void 0===t?void 0:t.release)||void 0===e||e.call(t),null===(o=null===(i=f.menuHandler)||void 0===i?void 0:i.release)||void 0===o||o.call(i),w_.clearAll(),null===(n=super.release)||void 0===n||n.call(this),null===(s=null===(r=f.handler)||void 0===r?void 0:r.release)||void 0===s||s.call(r),this.eventManager.release(),null===(a=null===(l=f.focusControl)||void 0===l?void 0:l.release)||void 0===a||a.call(l),null===(h=f.legends)||void 0===h||h.forEach((t=>{null==t||t.release()})),null===(d=f.title)||void 0===d||d.release(),f.title=null,null===(c=f.emptyTip)||void 0===c||c.release(),f.emptyTip=null,f.layoutMap.release(),f.releaseList&&(f.releaseList.forEach((t=>{var e;return null===(e=null==t?void 0:t.release)||void 0===e?void 0:e.call(t)})),f.releaseList=null),this.scenegraph.stage.release(),this.scenegraph.proxy.release();const{parentElement:m}=f.element;m&&m.removeChild(f.element),null===(p=null===(g=null===(u=this.editorManager)||void 0===u?void 0:u.editingEditor)||void 0===g?void 0:g.onEnd)||void 0===p||p.call(g),this.isReleased=!0,this.scenegraph=null,this.internalProps=null}fireListeners(t,e){return super.fireListeners(t,e)}updateOption(t){var e,i,o,n,r,s,l,a,h,d,c,u;this.options=t,this._hasAutoImageColumn=void 0;const{frozenColCount:g=0,defaultRowHeight:p=40,defaultHeaderRowHeight:f,defaultColWidth:m=80,defaultHeaderColWidth:b=80,keyboardOptions:v,eventOptions:y,rowSeriesNumber:C,columnResizeMode:w,rowResizeMode:x="none",dragHeaderMode:_,showFrozenIcon:S,allowFrozenColCount:A,padding:B,hover:R,menu:M,select:T,pixelRatio:k,widthMode:P,heightMode:E,autoFillWidth:L,autoFillHeight:H,widthAdaptiveMode:z,heightAdaptiveMode:F,customRender:I,renderChartAsync:O,renderChartAsyncBatchCount:D,overscrollBehavior:W,limitMinWidth:N,limitMinHeight:G}=t;k&&k!==this.internalProps.pixelRatio&&(this.internalProps.pixelRatio=k),B&&("number"==typeof B?(this.padding.top=B,this.padding.left=B,this.padding.bottom=B,this.padding.right=B):(B.top&&(this.padding.top=B.top),B.bottom&&(this.padding.bottom=B.bottom),B.left&&(this.padding.left=B.left),B.right&&(this.padding.right=B.right))),this.showFrozenIcon="boolean"!=typeof S||S,"number"==typeof A&&A<=0&&(this.showFrozenIcon=!1),this.widthMode=null!=P?P:"standard",this.heightMode=null!=E?E:"standard",this._widthAdaptiveMode=null!=z?z:"only-body",this._heightAdaptiveMode=null!=F?F:"only-body",this.autoFillWidth=null!=L&&L,this.autoFillHeight=null!=H&&H,this.customRender=I;const j=this.internalProps;if("node"!==BC.mode&&function(t,e){var i,o;t.style.margin=`${e.top}px ${e.right}px ${e.bottom}px ${e.left}px`;const n=(t.offsetWidth||(null===(i=t.parentElement)||void 0===i?void 0:i.offsetWidth)||1)-1,r=(t.offsetHeight||(null===(o=t.parentElement)||void 0===o?void 0:o.offsetHeight)||1)-1;t.style.width=n&&n-e.left-e.right+"px"||"0px",t.style.height=r&&r-e.top-e.bottom+"px"||"0px"}(j.element,this.padding),this.columnWidthComputeMode=null!==(e=t.columnWidthComputeMode)&&void 0!==e?e:"normal",j.frozenColCount=g,j.defaultRowHeight=p,j.defaultHeaderRowHeight=null!=f?f:p,j.defaultColWidth=m,j.defaultHeaderColWidth=null!=b?b:m,j.keyboardOptions=v,j.eventOptions=y,j.rowSeriesNumber=C,j.columnResizeMode=w,j.rowResizeMode=x,j.dragHeaderMode=null!=_?_:"none",j.renderChartAsync=O,tA(D),j.overscrollBehavior=null!=W?W:"auto",j.cellTextOverflows={},j._rowHeightsMap=new uM(this),j._rowRangeHeightsMap=new Map,j._colRangeWidthsMap=new Map,j._widthResizedColMap=new Set,j._heightResizedRowMap=new Set,this.colWidthsMap=new bw,this.colContentWidthsMap=new bw,this.colWidthsLimit={},j.stick.changedCells.clear(),j.theme=Gw.of(null!==(i=t.theme)&&void 0!==i?i:Gw.DEFAULT),j.theme.isPivot=this.isPivotTable(),this.scenegraph.updateStageBackground(),j.autoWrapText=t.autoWrapText,j.enableLineBreak=t.enableLineBreak,j.allowFrozenColCount=null!==(o=t.allowFrozenColCount)&&void 0!==o?o:0,j.limitMaxAutoWidth=null!==(n=t.limitMaxAutoWidth)&&void 0!==n?n:450,j.limitMinWidth=null!=N?"number"==typeof N?N:N?10:0:10,j.limitMinHeight=null!=G?"number"==typeof G?G:G?10:0:10,null===(r=j.legends)||void 0===r||r.forEach((t=>{null==t||t.release()})),null===(s=j.title)||void 0===s||s.release(),j.title=null,null===(l=j.emptyTip)||void 0===l||l.release(),j.emptyTip=null,j.layoutMap.release(),this.scenegraph.clearCells(),this.scenegraph.updateComponent(),this.stateManager.updateOptionSetState(),this._updateSize(),this.eventManager.updateEventBinder(),t.legends){j.legends=[];const e=Vw.getFunction("createLegend");if(Array.isArray(t.legends)){for(let i=0;i<t.legends.length;i++)j.legends.push(e(t.legends[i],this));this.scenegraph.tableGroup.setAttributes({x:this.tableX,y:this.tableY})}else j.legends.push(e(t.legends,this)),this.scenegraph.tableGroup.setAttributes({x:this.tableX,y:this.tableY})}if(j.tooltip=Object.assign({renderMode:"html",isShowOverflowTextTooltip:!1,confine:!0},t.tooltip),"html"===j.tooltip.renderMode&&!j.tooltipHandler){const t=Vw.getComponent("tooltipHandler");j.tooltipHandler=new t(this,j.tooltip.confine)}if(j.menu=Object.assign({renderMode:"html"},t.menu),Array.isArray(null===(a=t.menu)||void 0===a?void 0:a.dropDownMenuHighlight)&&this.setDropDownMenuHighlight(null===(h=t.menu)||void 0===h?void 0:h.dropDownMenuHighlight),Array.isArray(null===(d=t.menu)||void 0===d?void 0:d.defaultHeaderMenuItems)&&(this.globalDropDownMenu=t.menu.defaultHeaderMenuItems),"html"===j.menu.renderMode&&!j.menuHandler){const t=Vw.getComponent("menuHandler");j.menuHandler=new t(this)}this.clearCellStyleCache(),this.clearColWidthCache(),this.clearRowHeightCache(),j.customMergeCell=t.customMergeCell,this.customCellStylePlugin.updateCustomCell(null!==(c=t.customCellStyle)&&void 0!==c?c:[],null!==(u=t.customCellStyleArrangement)&&void 0!==u?u:[])}renderWithRecreateCells(){const t={col:this.stateManager.hover.cellPos.col,row:this.stateManager.hover.cellPos.row};this.refreshHeader(),this.internalProps.useOneRowHeightFillAll=!1,this.scenegraph.clearCells(),this.clearCellStyleCache(),this.scenegraph.createSceneGraph(),this.stateManager.updateHoverPos(t.col,t.row),this.render()}getFrozenRowsHeight(){return this.getRowsHeight(0,this.frozenRowCount-1)}getFrozenColsWidth(){return this.getColsWidth(0,this.frozenColCount-1)}getBottomFrozenRowsHeight(){if(this.bottomFrozenRowCount>0){let t=0;for(let e=this.rowCount-this.bottomFrozenRowCount;e<=this.rowCount-1;e++)t+=this.getRowHeight(e);return t}return 0}getRightFrozenColsWidth(){if(this.rightFrozenColCount>0){let t=0;for(let e=this.colCount-this.rightFrozenColCount;e<=this.colCount-1;e++)t+=this.getColWidth(e);return t}return 0}getDrawRange(){const t=Math.min(this.tableNoFrameWidth,this.getAllColsWidth()),e=Math.min(this.tableNoFrameHeight,this.getAllRowsHeight());return new vw(this.tableX,this.tableY,t,e)}_getMouseAbstractPoint(t){let e,i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(!t)return{inTable:!1,x:void 0,y:void 0};e=BM(t)?t.changedTouches[0]:t;const o=e.clientX||e.pageX+window.scrollX,n=e.clientY||e.pageY+window.scrollY,r=this.internalProps.canvas.getBoundingClientRect();let s=!0;r.right<=o&&(s=!1),r.bottom<=n&&(s=!1);const l=r.width,a=l/(this.canvas.offsetWidth||l),h=r.height,d=h/(this.canvas.offsetHeight||h);return{x:(o-r.left)/a+(i?this.scrollLeft:0),y:(n-r.top)/d+(i?this.scrollTop:0),inTable:s}}getTheme(){return this.internalProps.theme}getTargetColAt(t){return wM(t,this)}getTargetRowAt(t){return xM(t,this)}getTargetColAtConsiderRightFrozen(t,e){return _M(t,e,this)}getTargetRowAtConsiderBottomFrozen(t,e){return SM(t,e,this)}clearSelected(){this.stateManager.updateSelectPos(-1,-1)}selectCell(t,e,i,o){var n;const r=!!(null===(n=this.stateManager.select.ranges)||void 0===n?void 0:n.length);this.stateManager.updateSelectPos(t,e,i,o),this.stateManager.endSelectCells(!0,r)}selectCells(t){const{scrollLeft:e,scrollTop:i}=this;t.forEach(((t,e)=>{t.start.col===t.end.col&&t.start.row===t.end.row?this.stateManager.updateSelectPos(t.start.col,t.start.row,!1,e>=1,!1,!1,!0):(this.stateManager.updateSelectPos(t.start.col,t.start.row,!1,e>=1,!1,!1,!0),this.stateManager.updateInteractionState(Ky.grabing),this.stateManager.updateSelectPos(t.end.col,t.end.row,!1,e>=1,!1,!1,!0)),this.stateManager.endSelectCells(!1,!1),this.stateManager.updateInteractionState(Ky.default)})),this.setScrollTop(i),this.setScrollLeft(e)}get recordsCount(){var t;return null===(t=this.records)||void 0===t?void 0:t.length}get allowFrozenColCount(){return this.internalProps.allowFrozenColCount}get rowHeaderLevelCount(){return this.internalProps.layoutMap.rowHeaderLevelCount}get columnHeaderLevelCount(){return this.internalProps.layoutMap.columnHeaderLevelCount}get records(){return this.internalProps.records}get dataSource(){return this.internalProps.dataSource}set dataSource(t){this.scenegraph.clearCells(),Qx(this,t),this.refreshRowColCount(),this.scenegraph.createSceneGraph(),this.render()}get autoWrapText(){return this.internalProps.autoWrapText}set autoWrapText(t){this.internalProps.autoWrapText=t,this.options.autoWrapText=t}get enableLineBreak(){return this.internalProps.enableLineBreak}set enableLineBreak(t){this.internalProps.enableLineBreak=t,this.options.enableLineBreak=t}updateAutoWrapText(t){this.internalProps.autoWrapText!==t&&(this.internalProps.autoWrapText=t,this.options.autoWrapText=t,this.scenegraph.clearCells(),this.clearCellStyleCache(),this.scenegraph.createSceneGraph(),this.render())}get theme(){return this.internalProps.theme}set theme(t){this.internalProps.theme=Gw.of(null!=t?t:Gw.DEFAULT),this.internalProps.theme.isPivot=this.isPivotTable(),this.options.theme=t}updateTheme(t){const e={col:this.stateManager.hover.cellPos.col,row:this.stateManager.hover.cellPos.row};this.internalProps.theme=Gw.of(null!=t?t:Gw.DEFAULT),this.internalProps.theme.isPivot=this.isPivotTable(),this.options.theme=t,this.scenegraph.updateComponent(),this.scenegraph.updateStageBackground(),this.scenegraph.clearCells(),this.clearCellStyleCache(),this.scenegraph.createSceneGraph(),this.stateManager.updateHoverPos(e.col,e.row),this.render()}getBodyField(t,e){return this.internalProps.layoutMap.getBody(t,e).field}getBodyColumnDefine(t,e){const i=this.internalProps.layoutMap.getBody(t,e);return null==i?void 0:i.define}getBodyColumnType(t,e){return R_("cellType",{cellType:this.internalProps.layoutMap.getBody(t,e).cellType},t,e,this)}getCellType(t,e){let i;return this.isSeriesNumberInHeader(t,e)?this.internalProps.layoutMap.getSeriesNumberHeader(t,e).cellType:(i=this.isHeader(t,e)?this.internalProps.layoutMap.getHeader(t,e).headerType:this.internalProps.layoutMap.getBody(t,e).cellType,R_("cellType",{cellType:i},t,e,this))}getHeaderField(t,e){return this.internalProps.layoutMap.getHeaderField(t,e)}getHeaderDefine(t,e){const i=this.internalProps.layoutMap.getHeader(t,e);return null==i?void 0:i.define}getCellLocation(t,e){return this.internalProps.layoutMap.getCellLocation(t,e)}getCellHeaderPaths(t,e){return this.internalProps.layoutMap.getCellHeaderPaths(t,e)}getHeadersDefine(t,e){const i=[];for(;;){const o=this.getHeaderDefine(t,e);if(!o||!o.field&&!o.columns)break;i.push(o),e++}return i}_getHeaderLayoutMap(t,e){return this.internalProps.layoutMap.getHeader(t,e)}_getBodyLayoutMap(t,e){return this.internalProps.layoutMap.getBody(t,e)}getContext(){return this.internalProps.context}getRecordByCell(t,e){if(!this.internalProps.layoutMap.isHeader(t,e))return this.getCellOriginRecord(t,e)}getRecordByRowCol(t,e){return this.getRecordByCell(t,e)}getRecordStartRowByRecordIndex(t){return this.internalProps.layoutMap.getRecordStartRowByRecordIndex(t)}_getHeaderCellBySortState(t){const{layoutMap:e}=this.internalProps,i=e.headerObjects.find((e=>e&&e.field===t.field));if(i)return e.getHeaderCellAdressById(i.id)}getCellRange(t,e){var i;if(this.internalProps.customMergeCell){const i=this.internalProps.customMergeCell(t,e,this);if(i&&i.range&&(Q(i.text)||i.customLayout||i.customRender))return i.range}return null===(i=this.internalProps.layoutMap)||void 0===i?void 0:i.getCellRange(t,e)}hasCustomMerge(){return!!this.internalProps.customMergeCell}getCustomMerge(t,e){if(this.internalProps.customMergeCell){const i=this.internalProps.customMergeCell(t,e,this);if(i&&i.range&&(Q(i.text)||i.customLayout||this.customRender)){if(i.style){const o=this.internalProps.bodyHelper.getStyleClass("text"),n=vC(i.style,this.theme.bodyStyle,{col:t,row:e,table:this,value:i.text,dataValue:this.getCellOriginValue(t,e),cellHeaderPaths:this.getCellHeaderPaths(t,e)},o,this.options.autoWrapText,this.theme);i.style=n}return i}}}isCellRangeEqual(t,e,i,o){return this.internalProps.layoutMap.isCellRangeEqual(t,e,i,o)}_getLayoutCellId(t,e){return this.internalProps.layoutMap.getCellId(t,e)}getHeaderDescription(t,e){var i;const o=this._getHeaderLayoutMap(t,e),n=null==o?void 0:o.define,r=null!==(i=null==n?void 0:n.description)&&void 0!==i?i:null==o?void 0:o.description;return"function"==typeof r?r({col:t,row:e,value:this.getCellValue(t,e),dataValue:this.getCellOriginValue(t,e)}):r}setDropDownMenuHighlight(t){this.stateManager.setDropDownMenuHighlight(t)}_dropDownMenuIsHighlight(t,e,i){return this.stateManager.dropDownMenuIsHighlight(t,e,i)}isSeriesNumberInBody(t,e){return this.internalProps.layoutMap&&this.internalProps.layoutMap.isSeriesNumberInBody(t,e)}isSeriesNumberInHeader(t,e){return this.internalProps.layoutMap&&this.internalProps.layoutMap.isSeriesNumberInHeader(t,e)}isHeader(t,e){return this.internalProps.layoutMap&&this.internalProps.layoutMap.isHeader(t,e)}isColumnHeader(t,e){var i;return null===(i=this.internalProps.layoutMap)||void 0===i?void 0:i.isColumnHeader(t,e)}isRowHeader(t,e){var i;return null===(i=this.internalProps.layoutMap)||void 0===i?void 0:i.isRowHeader(t,e)}isCornerHeader(t,e){var i;return null===(i=this.internalProps.layoutMap)||void 0===i?void 0:i.isCornerHeader(t,e)}isFrozenColumn(t,e){return this.isLeftFrozenColumn(t,e)||this.isRightFrozenColumn(t,e)}isLeftFrozenColumn(t,e){var i;return null===(i=this.internalProps.layoutMap)||void 0===i?void 0:i.isFrozenColumn(t,e)}isRightFrozenColumn(t,e){var i;return null===(i=this.internalProps.layoutMap)||void 0===i?void 0:i.isRightFrozenColumn(t,e)}isFrozenRow(t,e){return this.isTopFrozenRow(t,e)||this.isBottomFrozenRow(t,e)}isTopFrozenRow(t,e){var i;return null===(i=this.internalProps.layoutMap)||void 0===i?void 0:i.isFrozenRow(t,e)}isBottomFrozenRow(t,e){var i;return null===(i=this.internalProps.layoutMap)||void 0===i?void 0:i.isBottomFrozenRow(t,e)}getCellInfo(t,e){if(t>=0&&e>=0){const i=this.isHeader(t,e)?this.getHeaderDefine(t,e):this.getBodyColumnDefine(t,e);return{col:t,row:e,field:this.getHeaderField(t,e),cellHeaderPaths:this.internalProps.layoutMap.getCellHeaderPaths(t,e),title:null==i?void 0:i.title,cellType:this.getCellType(t,e),originData:this.getCellOriginRecord(t,e),cellRange:this.getCellRangeRelativeRect({col:t,row:e}),value:this.getCellValue(t,e),dataValue:this.getCellOriginValue(t,e),cellLocation:this.getCellLocation(t,e),scaleRatio:this.canvas.getBoundingClientRect().width/this.canvas.offsetWidth}}}_hasField(t,e,i){var o;if(null==t)return!1;if(this.internalProps.layoutMap.isHeader(e,i))return!1;const n=this.getRecordShowIndexByCell(e,i);return null===(o=this.internalProps.dataSource)||void 0===o?void 0:o.hasField(n,t)}_getCellStyle(t,e){var i,o,n,r,s,l,a,h,d;const c=this.customCellStylePlugin.getCustomCellStyle(t,e),{layoutMap:u}=this.internalProps;if(u.isHeader(t,e)){let s;if(!this.isPivotTable()||this.isBottomFrozenRow(e)||this.isRightFrozenColumn(t))s=`${t}-${e}`;else{const i=this.getHeaderDefine(t,e),o=this.isCornerHeader(t,e);s=(null==i?void 0:i.dimensionKey)?o?`dim-cor-${i.dimensionKey}`:`dim-${i.dimensionKey}`:(null==i?void 0:i.indicatorKey)?`ind-${i.indicatorKey}`:`${t}-${e}`}let l=this.headerStyleCache.get(s);if(l)return c?mM(l,c):l;const a=u.getHeader(t,e);let h;if(this.isPivotChart()&&function(t,e,i){if(!i._table.isPivotChart())return!1;if(i.indicatorsAsCol){if(i.hasTwoIndicatorAxes&&e===i.columnHeaderLevelCount-1&&t>=i.rowHeaderLevelCount&&t<i.colCount-i.rightFrozenColCount)return!0;if(e===i.rowCount-i.bottomFrozenRowCount&&t>=i.rowHeaderLevelCount&&t<i.colCount-i.rightFrozenColCount)return!0}else if(e===i.rowCount-i.bottomFrozenRowCount&&t>=i.rowHeaderLevelCount&&t<i.colCount-i.rightFrozenColCount)return!0;return!1}(t,e,u)&&u.isAxisCell(t,e)?h=null!==(o=null===(i=u.getBody(t,this.rowHeaderLevelCount).style)||void 0===i?void 0:i.padding)&&void 0!==o?o:this.theme.bodyStyle.padding:this.isPivotChart()&&function(t,e,i){if(!i._table.isPivotChart())return!1;if(i.indicatorsAsCol){if(t===i.rowHeaderLevelCount-1&&e>=i.columnHeaderLevelCount&&e<i.rowCount-i.bottomFrozenRowCount)return!0}else{if(t===i.rowHeaderLevelCount-1&&e>=i.columnHeaderLevelCount&&e<i.rowCount-i.bottomFrozenRowCount)return!0;if(t===i.colCount-i.rightFrozenColCount&&e>=i.columnHeaderLevelCount&&e<i.rowCount-i.bottomFrozenRowCount)return!0}return!1}(t,e,u)&&u.isAxisCell(t,e)&&(h=null!==(r=null===(n=u.getBody(this.columnHeaderLevelCount,e).style)||void 0===n?void 0:n.padding)&&void 0!==r?r:this.theme.bodyStyle.padding),(!a||a.isEmpty)&&(u.isLeftBottomCorner(t,e)||u.isRightBottomCorner(t,e)||u.isCornerHeader(t,e)||u.isRightTopCorner(t,e)))return MM;const d=this.internalProps.headerHelper.getStyleClass((null==a?void 0:a.headerType)||"text");if(u.isBottomFrozenRow(t,e)&&this.theme.bottomFrozenStyle)l=AC(h?{padding:h}:{},this.theme.bottomFrozenStyle,{col:t,row:e,table:this,value:this.getCellValue(t,e),dataValue:this.getCellOriginValue(t,e),cellHeaderPaths:this.getCellHeaderPaths(t,e)},d,this.options.autoWrapText,this.theme);else if(u.isRightFrozenColumn(t,e)&&this.theme.rightFrozenStyle)l=AC(h?{padding:h}:{},this.theme.rightFrozenStyle,{col:t,row:e,table:this,value:this.getCellValue(t,e),dataValue:this.getCellOriginValue(t,e),cellHeaderPaths:this.getCellHeaderPaths(t,e)},d,this.options.autoWrapText,this.theme);else{const i=(null==a?void 0:a.style)||{};h&&(i.padding=h),l=AC(i,u.isColumnHeader(t,e)||u.isBottomFrozenRow(t,e)?this.theme.headerStyle:u.isRowHeader(t,e)||u.isRightFrozenColumn(t,e)?this.theme.rowHeaderStyle:this.theme.cornerHeaderStyle,{col:t,row:e,table:this,value:this.getCellValue(t,e),dataValue:this.getCellOriginValue(t,e),cellHeaderPaths:this.getCellHeaderPaths(t,e)},d,this.options.autoWrapText,this.theme)}return this.headerStyleCache.set(s,l),c?mM(l,c):l}let g,p;(null===(l=null===(s=this.internalProps)||void 0===s?void 0:s.dataConfig)||void 0===l?void 0:l.mappingRules)&&!this.isHeader(t,e)&&(null===(d=null===(h=null===(a=this.internalProps)||void 0===a?void 0:a.dataConfig)||void 0===h?void 0:h.mappingRules)||void 0===d||d.forEach(((i,o)=>{i.bgColor&&this.internalProps.layoutMap.getIndicatorKey(t,e)===i.bgColor.indicatorKey&&(g=i.bgColor.mapping)})));const f=this.getCellType(t,e);let m;if(p=this.isSeriesNumberInBody(t,e)?`${t}-series-`+f:this.isListTable()&&!this.transpose||this.isPivotTable()&&this.internalProps.layoutMap.indicatorsAsCol?t+f:e+f,m=u.isBottomFrozenRow(e)?this.bodyBottomStyleCache.get(p):this.bodyStyleCache.get(p),m)return c?mM(m,c):m;const b=u.getBody(t,e),v=this.internalProps.bodyHelper.getStyleClass(this.getCellType(t,e)),y=null==b?void 0:b.style;return m=vC(y,u.isBottomFrozenRow(e)&&this.theme.bottomFrozenStyle?this.theme.bottomFrozenStyle:u.isRightFrozenColumn(t)&&this.theme.rightFrozenStyle?this.theme.rightFrozenStyle:this.theme.bodyStyle,{col:t,row:e,table:this,value:this.getCellValue(t,e),dataValue:this.getCellOriginValue(t,e),cellHeaderPaths:this.getCellHeaderPaths(t,e)},v,this.options.autoWrapText,this.theme),g&&(m=mM(m,{bgColor:g})),Z(y)||(u.isBottomFrozenRow(e)?this.bodyBottomStyleCache.set(p,m):this.bodyStyleCache.set(p,m)),c?mM(m,c):m}clearCellStyleCache(){this.headerStyleCache.clear(),this.bodyStyleCache.clear(),this.bodyBottomStyleCache.clear()}clearRowHeightCache(){this.internalProps._rowHeightsMap.clear(),this._clearRowRangeHeightsMap()}clearColWidthCache(){this.internalProps._colWidthsMap.clear(),this._clearColRangeWidthsMap()}_canResizeColumn(t,e){if(!(t>=0&&e>=0))return!1;if(this.isCellRangeEqual(t,e,t+1,e))return!1;if("none"===this.internalProps.columnResizeMode)return!1;if("header"===this.internalProps.columnResizeMode){if(!this.isHeader(t,e))return!1}else if("body"===this.internalProps.columnResizeMode&&this.isHeader(t,e))return!1;const i=this.colWidthsLimit[t];return!(i&&i.min&&i.max)||i.max!==i.min}_canResizeRow(t,e){if(!(t>=0&&e>=0))return!1;if(this.isCellRangeEqual(t,e,t,e+1))return!1;if("none"===this.internalProps.rowResizeMode)return!1;if("header"===this.internalProps.rowResizeMode){if(!this.isHeader(t,e))return!1}else if("body"===this.internalProps.rowResizeMode&&this.isHeader(t,e))return!1;return!0}_canDragHeaderPosition(t,e){var i,o;if(this.isHeader(t,e)&&(this.stateManager.isSelected(t,e)||(null===(i=this.options.select)||void 0===i?void 0:i.disableHeaderSelect)||(null===(o=this.options.select)||void 0===o?void 0:o.disableSelect))){if("disabled"===this.internalProps.frozenColDragHeaderMode&&this.isFrozenColumn(t))return!1;if(this.stateManager.isSelected(t,e)){const i=this.stateManager.select.ranges[0];if(this.isColumnHeader(t,e)){if(i.end.row!==this.rowCount-1)return!1}else{if(!this.isRowHeader(t,e))return!1;if(i.end.col!==this.colCount-1)return!1}}const i=this.getHeaderDefine(t,e);if(!i)return!1;if(void 0===i.dragHeader){if("all"===this.internalProps.dragHeaderMode)return!0;if("column"===this.internalProps.dragHeaderMode){if(this.isColumnHeader(t,e))return!0}else if("row"===this.internalProps.dragHeaderMode&&this.isRowHeader(t,e))return!0;return!1}return i.dragHeader}return!1}getCellIcons(t,e){var i,o;let n;if(this.isHeader(t,e))n=this.internalProps.headerHelper.getIcons(t,e);else if(this.internalProps.layoutMap.isSeriesNumber(t,e)){(null===(o=null===(i=this.internalProps.layoutMap.getSeriesNumberBody(t,e))||void 0===i?void 0:i.define)||void 0===o?void 0:o.dragOrder)&&(n=this.internalProps.rowSeriesNumberHelper.getIcons(t,e));const r=this.getCellValue(t,e),s=this.getCellOriginValue(t,e),l=this.internalProps.context,a=this.internalProps.bodyHelper.getIcons(t,e,r,s,l);(null==n?void 0:n.length)>0?n=n.concat():(null==a?void 0:a.length)>0&&(n=a)}else{const i=this.getCellValue(t,e),o=this.getCellOriginValue(t,e),r=this.internalProps.context;n=this.internalProps.bodyHelper.getIcons(t,e,i,o,r)}return n}showDropDownMenu(t,e,i){let o="dropdown-menu";i&&(o=Array.isArray(i.content)?"dropdown-menu":"container"),"html"===this.internalProps.menu.renderMode&&(this.stateManager.menu.isShow=!0,this.internalProps.menuHandler._bindToCell(t,e,o,i))}showTooltip(t,e,i){"html"===this.internalProps.tooltip.renderMode&&this.internalProps.tooltipHandler._bindToCell(t,e,i)}getCellStyle(t,e){const i=this._getCellStyle(t,e),o=e_(i,this,t,e,R_).theme,{autoWrapText:n,lineClamp:r,textOverflow:s}=i;return{textAlign:o.text.textAlign,textBaseline:o.text.textBaseline,bgColor:q(o.group.fill)?R_("bgColor",i,t,e,this):o.group.fill,color:q(o.text.fill)?R_("color",i,t,e,this):o.text.fill,strokeColor:q(o.text.stroke)?R_("strokeColor",i,t,e,this):o.text.stroke,fontFamily:o.text.fontFamily,fontSize:o.text.fontSize,fontWeight:o.text.fontWeight,fontVariant:o.text.fontVariant,fontStyle:o.text.fontStyle,lineHeight:o.text.lineHeight,autoWrapText:null!=n&&n,lineClamp:null!=r?r:"auto",textOverflow:s,borderColor:q(o.group.stroke)?R_("borderColor",i,t,e,this):o.group.stroke,borderLineWidth:o.group.lineWidth,borderLineDash:o.group.lineDash,underline:!!o.text.underline,underlineDash:o.text.underlineDash,underlineOffset:o.text.underlineOffset,lineThrough:!!o.text.lineThrough,padding:o._vtable.padding,underlineWidth:o.text.underline,lineThroughLineWidth:o.text.lineThrough,_strokeArrayWidth:o.group.strokeArrayWidth,_strokeArrayColor:o.group.strokeArrayColor,_linkColor:R_("linkColor",i,t,e,this)}}getAllBodyCells(t,e){const i=this.rowHeaderLevelCount,o=this.columnHeaderLevelCount,n=this.colCount-1,r=this.rowCount-1;return Array(Math.min(null!=e?e:2e3,r-o+1,this.rowCount)).fill(0).map(((e,r)=>Array(Math.min(null!=t?t:2e3,n-i+1,this.colCount)).fill(0).map(((t,e)=>this.getCellInfo(e+i,r+o)))))}getAllCells(t,e){const i=this.colCount-1,o=this.rowCount-1;return Array(Math.min(null!=e?e:2e3,o-0+1,this.rowCount)).fill(0).map(((e,o)=>Array(Math.min(null!=t?t:2e3,i-0+1,this.colCount)).fill(0).map(((t,e)=>this.getCellInfo(e+0,o+0)))))}getAllColumnHeaderCells(){const t=this.rowHeaderLevelCount,e=this.colCount-1,i=this.columnHeaderLevelCount-1;return Array(i-0+1).fill(0).map(((i,o)=>Array(e-t+1).fill(0).map(((e,i)=>this.getCellInfo(i+t,o+0)))))}getAllRowHeaderCells(){const t=this.columnHeaderLevelCount,e=this.rowHeaderLevelCount-1,i=this.rowCount-1;return Array(i-t+1).fill(0).map(((i,o)=>Array(e-0+1).fill(0).map(((e,i)=>this.getCellInfo(i+0,o+t)))))}scrollToCell(t){const e=this.getDrawRange();if(Q(t.col)&&t.col>=this.frozenColCount){const i=this.getFrozenColsWidth(),o=this.getColsWidth(0,t.col-1);this.scrollLeft=Math.min(o-i,this.getAllColsWidth()-e.width)}if(Q(t.row)&&t.row>=this.frozenRowCount){const i=this.getFrozenRowsHeight(),o=this.getRowsHeight(0,t.row-1);this.scrollTop=Math.min(o-i,this.getAllRowsHeight()-e.height)}this.render()}getCopyValue(){var t,e;if((null===(e=null===(t=this.stateManager.select)||void 0===t?void 0:t.ranges)||void 0===e?void 0:e.length)>0){const t=this.stateManager.select.ranges;let e=Math.min(t[0].start.col,t[0].end.col),i=Math.max(t[0].start.col,t[0].end.col),o=Math.min(t[0].start.row,t[0].end.row),n=Math.max(t[0].start.row,t[0].end.row);t.forEach((t=>{e=Math.min(e,t.start.col,t.end.col),i=Math.max(i,t.start.col,t.end.col),o=Math.min(o,t.start.row,t.end.row),n=Math.max(n,t.start.row,t.end.row)}));const r=e=>{let i=!1;return t.forEach((t=>{const o=Math.min(t.start.row,t.end.row),n=Math.max(t.start.row,t.end.row);o<=e&&n>=e&&(i=!0)})),i},s=e=>{let i=!1;return t.forEach((t=>{const o=Math.min(t.start.col,t.end.col),n=Math.max(t.start.col,t.end.col);o<=e&&n>=e&&(i=!0)})),i},l=(e,i)=>{let o;return t.forEach((t=>{const n=Math.min(t.start.row,t.end.row),r=Math.max(t.start.row,t.end.row),s=Math.min(t.start.col,t.end.col),l=Math.max(t.start.col,t.end.col);s<=e&&l>=e&&n<=i&&r>=i&&(o=t)})),o},a=(t,e,i)=>{const o=this.getCellRange(t,e);let n=o.start.col,r=o.start.row;if(i){const t=Math.min(i.start.col,i.end.col),e=Math.min(i.start.row,i.end.row);n=Math.max(t,o.start.col),r=Math.max(e,o.start.row)}return n!==t||r!==e?"":this.getCellValue(t,e)};let h="";for(let t=o;t<=n;t++)if(r(t)){for(let o=e;o<=i;o++)if(s(o)){const e=l(o,t);if(e){const n=a(o,t,e);if("undefined"!=typeof Promise&&n instanceof Promise);else{const t=Q(n)?`${n}`:"";/^\[object .*\]$/.exec(t)||(h+=t)}(o<e.end.col||o<i)&&(h+="\t")}else h+="\t"}t<n&&(h+="\r\n")}return h}return""}getSelectedCellInfos(){var t;if(!(null===(t=this.stateManager.select)||void 0===t?void 0:t.ranges))return null;const e=this.stateManager.select.ranges;if(!e.length)return[];let i=Math.min(e[0].start.col,e[0].end.col),o=Math.max(e[0].start.col,e[0].end.col),n=Math.min(e[0].start.row,e[0].end.row),r=Math.max(e[0].start.row,e[0].end.row);e.forEach((t=>{i=Math.min(i,t.start.col,t.end.col),o=Math.max(o,t.start.col,t.end.col),n=Math.min(n,t.start.row,t.end.row),r=Math.max(r,t.start.row,t.end.row)}));const s=t=>{let i=!1;return e.forEach((e=>{const o=Math.min(e.start.row,e.end.row),n=Math.max(e.start.row,e.end.row);o<=t&&n>=t&&(i=!0)})),i},l=t=>{let i=!1;return e.forEach((e=>{const o=Math.min(e.start.col,e.end.col),n=Math.max(e.start.col,e.end.col);o<=t&&n>=t&&(i=!0)})),i},a=(t,i)=>{let o;return e.forEach((e=>{const n=Math.min(e.start.row,e.end.row),r=Math.max(e.start.row,e.end.row),s=Math.min(e.start.col,e.end.col),l=Math.max(e.start.col,e.end.col);s<=t&&l>=t&&n<=i&&r>=i&&(o=e)})),o},h=[];for(let t=n;t<=r;t++)if(s(t)){const e=[];for(let n=i;n<=o;n++)if(l(n)&&a(n,t)){const i=this.getCellInfo(n,t);e.push(i)}h.push(e)}return h}getSelectedCellRanges(){const t=this.stateManager.select.ranges;return t.length?Ct(t):[]}measureText(t,e){return lS.measureText(t,e)}measureTextBounds(t){return hS(t)}getCustomRender(t,e){let i;if("body"!==this.getCellLocation(t,e)){const o=this.getHeaderDefine(t,e);i=null==o?void 0:o.headerCustomRender}else{const o=this.getBodyColumnDefine(t,e);i=(null==o?void 0:o.customRender)||this.customRender}return i}getCustomLayout(t,e){let i;if("body"!==this.getCellLocation(t,e)){const o=this.getHeaderDefine(t,e);i=null==o?void 0:o.headerCustomLayout}else{const o=this.getBodyColumnDefine(t,e);i=null==o?void 0:o.customLayout}return i}hasAutoImageColumn(){return void 0===this._hasAutoImageColumn&&(this._hasAutoImageColumn=function(t){const{columns:e,rows:i,indicators:o}=t.options;if(t.isPivotTable()){if(rt(e)&&e.length>0)for(let t=0;t<e.length;t++){const i=e[t];if(!nt(i)&&("image"===i.headerType||"video"===i.headerType||"function"==typeof i.headerType)&&i.imageAutoSizing)return!0}if(rt(i)&&i.length>0)for(let t=0;t<i.length;t++){const e=i[t];if(!nt(e)&&("image"===e.headerType||"video"===e.headerType||"function"==typeof e.headerType)&&e.imageAutoSizing)return!0}if(rt(o)&&o.length>0)for(let t=0;t<o.length;t++){const e=o[t];if(!nt(e)&&(("image"===e.cellType||"video"===e.cellType||"function"==typeof e.cellType)&&e.imageAutoSizing||("image"===e.headerType||"video"===e.headerType||"function"==typeof e.headerType)&&e.imageAutoSizing))return!0}}else if(rt(e)&&e.length>0)for(let t=0;t<e.length;t++){const i=e[t];if(("image"===i.cellType||"video"===i.cellType||"function"==typeof i.cellType)&&i.imageAutoSizing||("image"===i.headerType||"video"===i.headerType||"function"==typeof i.headerType)&&i.imageAutoSizing)return!0}return!1}(this)),this._hasAutoImageColumn}_getActiveChartInstance(){var t,e,i,o,n,r;const s=this.scenegraph.getCell(null===(e=null===(t=this.stateManager.hover)||void 0===t?void 0:t.cellPos)||void 0===e?void 0:e.col,null===(o=null===(i=this.stateManager.hover)||void 0===i?void 0:i.cellPos)||void 0===o?void 0:o.row);return"chart"===(null===(r=null===(n=null==s?void 0:s.getChildren())||void 0===n?void 0:n[0])||void 0===r?void 0:r.type)?s.getChildren()[0].activeChartInstance:null}cellIsInVisualView(t,e){var i,o,n,r;const s=this.getDrawRange(),l=this.getCellRelativeRect(t,e);if(t<this.frozenColCount&&e<this.frozenRowCount)return!0;let a,h,d,c;if(this.frozenRowCount>=1&&(a=this.getCellRangeRelativeRect({start:{col:0,row:0},end:{col:this.colCount-1,row:this.frozenRowCount-1}})),this.frozenColCount>=1&&(h=this.getCellRangeRelativeRect({start:{col:0,row:0},end:{col:this.frozenColCount-1,row:this.rowCount-1}})),this.bottomFrozenRowCount>=1&&(d=this.getCellRangeRelativeRect({start:{col:0,row:this.rowCount-this.bottomFrozenRowCount},end:{col:this.colCount-1,row:this.rowCount-1}})),this.rightFrozenColCount>=1&&(c=this.getCellRangeRelativeRect({start:{col:this.colCount-this.rightFrozenColCount,row:0},end:{col:this.colCount-1,row:this.rowCount-1}})),l.top>=s.top&&l.bottom<=s.bottom&&l.left>=s.left&&l.right<=s.right){if(this.isFrozenCell(t,e))return!0;if(l.top>=(null!==(i=null==a?void 0:a.bottom)&&void 0!==i?i:l.top)&&l.left>=(null!==(o=null==h?void 0:h.right)&&void 0!==o?o:l.left)&&l.bottom<=(null!==(n=null==d?void 0:d.top)&&void 0!==n?n:l.bottom)&&l.right<=(null!==(r=null==c?void 0:c.left)&&void 0!==r?r:l.right))return!0}return!1}getCustomMergeValue(t,e){if(this.internalProps.customMergeCell){const i=this.getCustomMerge(t,e);if(i){const{text:t}=i;return t}}}exportImg(){return this.scenegraph.stage.toCanvas().toDataURL()}exportCellImg(t,e,i){var o,n,r,s;const l=this.cellIsInVisualView(t,e),{scrollTop:a,scrollLeft:h}=this;l||this.scrollToCell({col:t,row:e});const d=this.getCellRelativeRect(t,e);(null===(n=null===(o=this.stateManager.select)||void 0===o?void 0:o.ranges)||void 0===n?void 0:n.length)>0&&AB(this.scenegraph);const{col:c,row:u}=this.stateManager.hover.cellPos;let g,p;if(this.stateManager.updateHoverPos(-1,-1),this.scenegraph.component.hideVerticalScrollBar(),this.scenegraph.component.hideHorizontalScrollBar(),this.scenegraph.tableGroup.border.setAttribute("visible",!1),null==i?void 0:i.disableBackground){const i=this.scenegraph.getCell(t,e);g=i.attribute.fill,i.setAttribute("fill","transparent")}if(null==i?void 0:i.disableBorder){const i=this.scenegraph.getCell(t,e);p=i.attribute.stroke,i.setAttribute("stroke",!1)}this.scenegraph.renderSceneGraph();let f=0;"bottom-right"===this.theme.cellBorderClipDirection&&(f=1);const m=this.scenegraph.stage.toCanvas(!1,(new Ce).set(d.left+this.tableX+1,d.top+this.tableY+1,d.right+this.tableX-f,d.bottom+this.tableY-f));return l||(this.setScrollTop(a),this.setScrollLeft(h)),this.scenegraph.tableGroup.border.setAttribute("visible",!0),g&&this.scenegraph.getCell(t,e).setAttribute("fill",g),p&&this.scenegraph.getCell(t,e).setAttribute("stroke",p),(null===(s=null===(r=this.stateManager.select)||void 0===r?void 0:r.ranges)||void 0===s?void 0:s.length)>0&&BB(this.scenegraph),this.stateManager.updateHoverPos(c,u),this.scenegraph.updateNextFrame(),m.toDataURL()}exportCellRangeImg(t){var e,i,o,n;const{scrollTop:r,scrollLeft:s}=this,l=Math.min(t.start.col,t.end.col),a=Math.min(t.start.row,t.end.row),h=Math.max(t.start.col,t.end.col),d=Math.max(t.start.row,t.end.row),c=this.cellIsInVisualView(l,a),u=this.cellIsInVisualView(h,d);c&&u||this.scrollToCell({col:l,row:a});const g=this.getCellRangeRelativeRect({start:{col:l,row:a},end:{col:h,row:d}});(null===(i=null===(e=this.stateManager.select)||void 0===e?void 0:e.ranges)||void 0===i?void 0:i.length)>0&&AB(this.scenegraph);const{col:p,row:f}=this.stateManager.hover.cellPos;this.stateManager.updateHoverPos(-1,-1),this.scenegraph.component.hideVerticalScrollBar(),this.scenegraph.component.hideHorizontalScrollBar(),this.scenegraph.renderSceneGraph();const m=this.scenegraph.stage.toCanvas(!1,(new Ce).set(g.left+this.tableX+1,g.top+this.tableY+1,g.right+this.tableX,g.bottom+this.tableY)).toDataURL();return c&&u||(this.setScrollTop(r),this.setScrollLeft(s)),(null===(n=null===(o=this.stateManager.select)||void 0===o?void 0:o.ranges)||void 0===n?void 0:n.length)>0&&BB(this.scenegraph),this.stateManager.updateHoverPos(p,f),m}exportCanvas(){return this.scenegraph.stage.toCanvas()}getImageBuffer(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"image/png";if("node"!==this.options.mode)return;this.render();const e=this.scenegraph.stage;if(e){const i=this.tableX+this.getAllColsWidth(),o=this.tableY+this.getAllRowsHeight();return i>=this.canvasWidth&&o>=this.canvasHeight?(e.render(),e.window.getImageBuffer(t)):this.scenegraph.stage.toCanvas(!1,(new Ce).set(0,0,Math.min(this.canvasWidth,i),Math.min(this.canvasHeight,o))).toBuffer(t)}return null}getBodyIndexByTableIndex(t,e){return{col:t-this.rowHeaderLevelCount,row:e-this.columnHeaderLevelCount}}getTableIndexByBodyIndex(t,e){return{col:t+this.rowHeaderLevelCount,row:e+this.columnHeaderLevelCount}}onVChartEvent(t,e,i){this._chartEventMap[t]||(this._chartEventMap[t]=[]),"function"==typeof e?this._chartEventMap[t].push({callback:e}):this._chartEventMap[t].push({callback:i,query:e})}offVChartEvent(t,e){this._chartEventMap[t]&&(this._chartEventMap[t]=e?this._chartEventMap[t].filter((t=>t.callback!==e)):[])}_bindChartEvent(t){if(t)for(const e in this._chartEventMap)(this._chartEventMap[e]||[]).forEach((i=>{i.query?t.on(e,i.query,i.callback):t.on(e,i.callback)}))}changeRecordOrder(t,e){}hasCustomCellStyle(t){return this.customCellStylePlugin.hasCustomCellStyle(t)}registerCustomCellStyle(t,e){this.customCellStylePlugin.registerCustomCellStyle(t,e)}arrangeCustomCellStyle(t,e){this.customCellStylePlugin.arrangeCustomCellStyle(t,e)}isSeriesNumber(t,e){return this.internalProps.layoutMap.isSeriesNumber(t,e)}isHasSeriesNumber(){var t;return(null===(t=this.internalProps.layoutMap)||void 0===t?void 0:t.leftRowSeriesNumberColumnCount)>0}get leftRowSeriesNumberCount(){var t,e;return null!==(e=null===(t=this.internalProps.layoutMap)||void 0===t?void 0:t.leftRowSeriesNumberColumnCount)&&void 0!==e?e:0}setMinMaxLimitWidth(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];var e,i;const o=this.internalProps;for(let n=0;n<o.layoutMap.columnWidths.length;n++){const{width:r,minWidth:s,maxWidth:l}=null!==(i=null===(e=o.layoutMap.columnWidths)||void 0===e?void 0:e[n])&&void 0!==i?i:{};t&&r&&("string"==typeof r&&"auto"!==r||"number"==typeof r&&r>0)&&this._setColWidth(n,r),s&&("number"==typeof s&&s>0||"string"==typeof s)&&this.setMinColWidth(n,s),l&&("number"==typeof l&&l>0||"string"==typeof l)&&this.setMaxColWidth(n,l)}}setSortedIndexMap(t,e){var i;null===(i=this.dataSource)||void 0===i||i.setSortedIndexMap(t,e)}checkReactCustomLayout(){this.reactCustomLayout||(this.reactCustomLayout=new s_(this))}get bodyDomContainer(){return this.internalProps.bodyDomContainer}get headerDomContainer(){return this.internalProps.headerDomContainer}showMoverLine(t,e){this.scenegraph.component.showMoveCol(t,e,0),this.scenegraph.renderSceneGraph()}hideMoverLine(t,e){this.scenegraph.component.hideMoveCol(),this.scenegraph.renderSceneGraph()}disableScroll(){this.eventManager.disableScroll()}enableScroll(){this.eventManager.enableScroll()}}const kM={},PM={};const EM=(t,e)=>{var i,o;if(!(null==e?void 0:e.fields))return t;if(0===t.length)return t;const n=e.fields,r=t[0],s={},l=[];for(const e in n)if(Object.prototype.hasOwnProperty.call(n,e)){const a=n[e];if(!a.type){let o=r;e in r||(o=null!==(i=t.find((t=>e in t)))&&void 0!==i?i:r),a.type="number"==typeof o[e]?"linear":"ordinal"}let h;if("number"==typeof a.sortIndex&&(h={key:e,type:a.type,index:a.sortIndex,sortIndex:{},sortIndexCount:0,sortReverse:!0===a.sortReverse},l.push(h)),(null===(o=a.domain)||void 0===o?void 0:o.length)>0)if("ordinal"===a.type){a._domainCache={},s[e]=a;const t={};a.domain.forEach(((e,i)=>{t[e]=i,a._domainCache[e]=i})),h&&(h.sortIndex=t,h.sortIndexCount=a.domain.length)}else a.domain.length>=2&&(s[e]=a)}return Object.keys(s).length>0&&(t=t.filter((t=>{for(const e in s){const i=s[e];if("ordinal"===i.type){if(!(t[e]in i._domainCache))return!1}else if(i.domain[0]>t[e]||i.domain[1]<t[e])return!1}return!0}))),l.sort(((t,e)=>t.index-e.index)),t.sort(((t,e)=>function(t,e,i){for(let o=0;o<i.length;o++){const n=i[o];let r=0;if("ordinal"===n.type?(void 0===n.sortIndex[e[n.key]]&&(n.sortIndex[e[n.key]]=n.sortIndexCount++),void 0===n.sortIndex[t[n.key]]&&(n.sortIndex[t[n.key]]=n.sortIndexCount++),r=n.sortIndex[t[n.key]]-n.sortIndex[e[n.key]]):"linear"===n.type&&(r=t[n.key]-e[n.key]),n.sortReverse&&(r=-r),0!==r)return r}return 0}(t,e,l))),t};let LM=0;function HM(){return LM>1e8&&(LM=0),(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"dataset")+"_"+LM++}class zM{constructor(t){var e;let i;this.options=t,this.isDataSet=!0,this.transformMap={},this.parserMap={},this.dataViewMap={},this.target=new Y,i=(null==t?void 0:t.name)?t.name:HM("dataset"),this.name=i,this._logger=null!==(e=null==t?void 0:t.logger)&&void 0!==e?e:Wt.getInstance()}setLogger(t){this._logger=t}getDataView(t){return this.dataViewMap[t]}setDataView(t,e){var i;this.dataViewMap[t]&&(null===(i=this._logger)||void 0===i||i.error(`Error: dataView ${t} 之前已存在,请重新命名`)),this.dataViewMap[t]=e}removeDataView(t){this.dataViewMap[t]=null,delete this.dataViewMap[t]}registerParser(t,e){var i;this.parserMap[t]&&(null===(i=this._logger)||void 0===i||i.warn(`Warn: transform ${t} 之前已注册,执行覆盖逻辑`)),this.parserMap[t]=e}removeParser(t){this.parserMap[t]=null,delete this.parserMap[t]}getParser(t){return this.parserMap[t]||this.parserMap.default}registerTransform(t,e){var i;this.transformMap[t]&&(null===(i=this._logger)||void 0===i||i.warn(`Warn: transform ${t} 之前已注册,执行覆盖逻辑`)),this.transformMap[t]=e}removeTransform(t){this.transformMap[t]=null,delete this.transformMap[t]}getTransform(t){return this.transformMap[t]}multipleDataViewAddListener(t,e,i){this._callMap||(this._callMap=new Map);let o=this._callMap.get(i);o||(o=()=>{t.some((t=>t.isRunning))||i()}),t.forEach((t=>{t.target.addListener(e,o)})),this._callMap.set(i,o)}allDataViewAddListener(t,e){this.multipleDataViewAddListener(Object.values(this.dataViewMap),t,e)}multipleDataViewRemoveListener(t,e,i){if(this._callMap){const o=this._callMap.get(i);o&&t.forEach((t=>{t.target.removeListener(e,o)})),this._callMap.delete(i)}}multipleDataViewUpdateInParse(t){t.forEach((t=>{var e;return null===(e=this.getDataView(t.name))||void 0===e?void 0:e.markRunning()})),t.forEach((t=>{var e;return null===(e=this.getDataView(t.name))||void 0===e?void 0:e.parseNewData(t.data,t.options)}))}multipleDataViewUpdateInRawData(t){t.forEach((t=>{var e;return null===(e=this.getDataView(t.name))||void 0===e?void 0:e.markRunning()})),t.forEach((t=>{var e;return null===(e=this.getDataView(t.name))||void 0===e?void 0:e.updateRawData(t.data,t.options)}))}destroy(){this.transformMap=null,this.parserMap=null,this.dataViewMap=null,this._callMap=null,this.target.removeAllListeners()}}const FM="_data-view-diff-rank";class IM{constructor(t,e){var i=this;let o;this.dataSet=t,this.options=e,this.isDataView=!0,this.target=new Y,this.parseOption=null,this.transformsArr=[],this.isRunning=!1,this.rawData={},this.history=!1,this.parserData={},this.latestData={},this._fields=null,this.reRunAllTransform=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{pushHistory:!0,emitMessage:!0};return i.isRunning=!0,i.resetTransformData(),i.transformsArr.forEach((e=>{i.executeTransform(e,{pushHistory:t.pushHistory,emitMessage:!1}),i.isLastTransform(e)&&i.diffLastData()})),i.isRunning=!1,!1!==t.emitMessage&&i.target.emit("change",[]),i},this.markRunning=()=>{this.isRunning=!0,this.target.emit("markRunning",[])},o=(null==e?void 0:e.name)?e.name:HM("dataview"),this.name=o,(null==e?void 0:e.history)&&(this.history=e.history,this.historyData=[]),this.dataSet.setDataView(o,this),this.setFields(null==e?void 0:e.fields)}parse(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];var o;this.isRunning=!0,i&&this.target.emit("beforeParse",[]),e&&(this.parseOption=e);const n=this.cloneParseData(t,e);if(null==e?void 0:e.type){const t=(null!==(o=this.dataSet.getParser(e.type))&&void 0!==o?o:this.dataSet.getParser("bytejson"))(n,e.options,this);this.rawData=n,this.parserData=t,this.history&&this.historyData.push(n,t),this.latestData=t}else this.parserData=n,this.rawData=n,this.history&&this.historyData.push(n),this.latestData=n;return this.isRunning=!1,i&&this.target.emit("afterParse",[]),this}transform(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(this.isRunning=!0,t&&t.type){let i=!0;if("fields"===t.type){this._fields=t.options.fields;const e=this.transformsArr.findIndex((e=>e.type===t.type));e>=0&&(i=!1,this.transformsArr[e].options.fields=this._fields)}if(i&&this.transformsArr.push(t),e){const e=this.isLastTransform(t);this.executeTransform(t),e&&this.diffLastData()}}return this.sortTransform(),this.isRunning=!1,this}isLastTransform(t){return this.transformsArr[this.transformsArr.length-1]===t}sortTransform(){this.transformsArr.length>=2&&this.transformsArr.sort(((t,e)=>{var i,o;return(null!==(i=t.level)&&void 0!==i?i:0)-(null!==(o=e.level)&&void 0!==o?o:0)}))}executeTransform(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{pushHistory:!0,emitMessage:!0};const{pushHistory:i,emitMessage:o}=e,n=this.dataSet.getTransform(t.type)(this.latestData,t.options);this.history&&!1!==i&&this.historyData.push(n),this.latestData=n,!1!==o&&this.target.emit("change",[])}resetTransformData(){this.latestData=this.parserData,this.history&&(this.historyData.length=0,this.historyData.push(this.rawData,this.parserData))}enableDiff(t){this._diffData=!0,this._diffKeys=t,this._diffMap=new Map,this._diffRank=0}disableDiff(){this._diffData=!1,this._diffMap=null,this._diffRank=null}resetDiff(){this._diffMap=new Map,this._diffRank=0}diffLastData(){var t;if(!this._diffData)return;if(!this.latestData.forEach)return;if(!(null===(t=this._diffKeys)||void 0===t?void 0:t.length))return;const e=this._diffRank+1;if(0===this._diffRank)this.latestData.forEach((t=>{t[FM]=e,this._diffMap.set(this._diffKeys.reduce(((e,i)=>e+t[i]),""),t)})),this.latestDataAUD={add:Array.from(this.latestData),del:[],update:[]};else{let t;this.latestDataAUD={add:[],del:[],update:[]},this.latestData.forEach((i=>{i[FM]=e,t=this._diffKeys.reduce(((t,e)=>t+i[e]),""),this._diffMap.get(t)?this.latestDataAUD.update.push(i):this.latestDataAUD.add.push(i),this._diffMap.set(t,i)})),this._diffMap.forEach(((t,i)=>{t[FM]<e&&(this.latestDataAUD.del.push(t),this._diffMap.delete(i))}))}this._diffRank=e}cloneParseData(t,e){let i=!1;return t instanceof IM||!0!==(null==e?void 0:e.clone)||(i=!0),i?Ct(t):t}parseNewData(t,e){this.parse(t,e||this.parseOption),this.reRunAllTransform()}updateRawData(t,e){const i=this.cloneParseData(t,e);this.rawData=i,this.parserData=i,this.latestData=i,this.reRunAllTransform()}getFields(){var t;return this._fields?this._fields:"dataview"===(null===(t=this.parseOption)||void 0===t?void 0:t.type)&&1===this.rawData.length&&this.rawData[0].getFields?this.rawData[0].getFields():null}setFields(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this._fields=t&&e?St({},this._fields,t):t;const i=this.transformsArr.find((t=>"fields"===t.type));!J(this._fields)&&J(i)?(this.dataSet.registerTransform("fields",EM),this.transform({type:"fields",options:{fields:this._fields}},!1)):i&&(i.options.fields=this._fields)}destroy(){this.dataSet.removeDataView(this.name),this._diffMap=null,this._diffRank=null,this.latestData=null,this.rawData=null,this.parserData=null,this.transformsArr=null,this.target=null}}function OM(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:["data"];const i=t;let o;if(!Q(i)||"object"!=typeof i)return i;if(function(t){return t instanceof IM}(i)||function(t){try{return t instanceof Element}catch(e){const i=["children","innerHTML","classList","setAttribute","tagName","getBoundingClientRect"],o=Object.keys(t);return i.every((t=>o.includes(t)))}}(i))return i;const n=rt(i),r=i.length;o=n?new Array(r):"object"==typeof i?{}:q(i)||at(i)||nt(i)?i:lt(i)?new Date(+i):void 0;const s=n?void 0:Object.keys(Object(i));let l=-1;if(o)for(;++l<(s||i).length;){const t=s?s[l]:l,n=i[t];(null==e?void 0:e.includes(t.toString()))?o[t]=n:o[t]=OM(n,e)}return o}function DM(t){var e,i;const o=Object.assign({},t);return mt(t.style)||(o.textStyle=WM(t.style)),mt(t.textStyle)||St(o.textStyle,WM(t.textStyle)),(null===(e=t.shape)||void 0===e?void 0:e.style)&&WM(o.shape.style),(null===(i=t.background)||void 0===i?void 0:i.style)&&WM(o.background.style),o}function WM(t){return mt(t)||t.angle&&(t.angle=we(t.angle)),t}function NM(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return mt(t.style)||(t.style=WM(t.style)),mt(t.state)||Object.keys(t.state).forEach((e=>{mt(t.state[e])||(t.state[e]=WM(t.state[e]))})),t}function GM(t){return mt(t)?null:(Object.keys(t).forEach((e=>{mt(t[e])||(t[e]=WM(t[e]))})),t)}const jM={left:{textAlign:"center",textBaseline:"bottom"},right:{textAlign:"center",textBaseline:"bottom"},radius:{},angle:{}},VM="PingFang SC,Microsoft Yahei,system-ui,-apple-system,segoe ui,Roboto,Helvetica,Arial,sans-serif, apple color emoji,segoe ui emoji,segoe ui symbol",UM=14,$M=14,XM=4,YM={domainLine:{visible:!0,style:{lineWidth:1,stroke:"#D9DDE4",strokeOpacity:1}},grid:{visible:!0,style:{lineWidth:1,stroke:"#EBEDF2",strokeOpacity:1,lineDash:[]}},subGrid:{visible:!1,style:{lineWidth:1,stroke:"#EBEDF2",strokeOpacity:1,lineDash:[4,4]}},tick:{visible:!0,tickSize:XM,style:{lineWidth:1,stroke:"#D9DDE4",strokeOpacity:1}},subTick:{visible:!1,tickSize:XM/2,style:{lineWidth:1,stroke:"#D9DDE4",strokeOpacity:1}},label:{visible:!0,space:1,style:{fontSize:$M,fill:"#89909D",fontWeight:"normal",fillOpacity:1},autoLimit:!0},title:{space:10,style:{fontSize:$M,fill:"#333333",fontWeight:"normal",fillOpacity:1}}};function KM(t){var e,i,o,n,r,s,l,a,h,d,c,u,g;const p=St({},t);let f,m=null!==(i=null===(e=p.title)||void 0===e?void 0:e.angle)&&void 0!==i?i:0;"left"!==p.orient&&"right"!==p.orient||(null===(o=p.title)||void 0===o?void 0:o.autoRotate)&&J(p.title.angle)&&(m="left"===p.orient?-90:90,f=jM[p.orient]);const b=function(t,e){if(!t||!it(t))return t;const i={};return Object.keys(t).forEach((o=>{const n=t[o];let r=!1;e.forEach((t=>{(nt(t)&&t===o||t instanceof RegExp&&o.match(t))&&(r=!0)})),r||(i[o]=n)})),i}(p.label,["style","formatMethod","state"]);return{orient:p.orient,select:p.select,hover:p.hover,line:(v=p.domainLine,NM(v),NM(v.startSymbol),NM(v.endSymbol),v),label:Object.assign({style:WM(p.label.style),formatMethod:p.label.formatMethod?(t,e,i)=>p.label.formatMethod(e.rawValue,e):null,state:GM(p.label.state)},b),tick:{visible:p.tick.visible,length:p.tick.tickSize,inside:p.tick.inside,alignWithLabel:p.tick.alignWithLabel,style:WM(p.tick.style),state:GM(p.tick.state),dataFilter:p.tick.dataFilter},subTick:{visible:p.subTick.visible,length:p.subTick.tickSize,inside:p.subTick.inside,count:p.subTick.tickCount,style:WM(p.subTick.style),state:GM(p.subTick.state)},grid:{type:"line",visible:p.grid.visible,alternateColor:p.grid.alternateColor,alignWithLabel:p.grid.alignWithLabel,style:WM(p.grid.style)},subGrid:{type:"line",visible:p.subGrid.visible,alternateColor:p.subGrid.alternateColor,style:WM(p.subGrid.style)},title:{visible:p.title.visible,position:p.title.position,space:p.title.space,autoRotate:!1,angle:m?we(m):null,textStyle:St({},f,WM(p.title.style)),padding:p.title.padding,shape:{visible:null===(n=p.title.shape)||void 0===n?void 0:n.visible,space:null===(r=p.title.shape)||void 0===r?void 0:r.space,style:WM(null===(s=p.title.shape)||void 0===s?void 0:s.style)},background:{visible:null===(l=p.title.background)||void 0===l?void 0:l.visible,style:WM(null===(a=p.title.background)||void 0===a?void 0:a.style)},state:{text:GM(p.title.state),shape:GM(null===(h=p.title.shape)||void 0===h?void 0:h.state),background:GM(null===(d=p.title.background)||void 0===d?void 0:d.state)}},panel:{visible:null===(c=p.background)||void 0===c?void 0:c.visible,style:WM(null===(u=p.background)||void 0===u?void 0:u.style),state:GM(null===(g=p.background)||void 0===g?void 0:g.state)}};var v}class qM{constructor(t,e,i,o){this.seqId=0,this.leftRowSeriesNumberColumnCount=0,this.rightRowSeriesNumberColumnCount=0,this.bodyRowSpanCount=1,this._transpose=!1,this._showHeader=!0,this._recordsCount=0,this._hasAggregation=!1,this._hasAggregationOnTopCount=0,this._hasAggregationOnBottomCount=0,this._cellRangeMap=new Map,this._showHeader=i,this._table=t,this._columns=[],this._columnsIncludeHided=[],this._headerCellIds=[],this.hierarchyIndent=null!=o?o:20,this.hierarchyTextStartAlignment=t.options.hierarchyTextStartAlignment,this.columnTree=new bM(e,{seqId:0}),this._headerObjectsIncludeHided=this._addHeaders(0,e,[]),this._headerObjects=this._headerObjectsIncludeHided.filter((t=>!0!==t.define.hide)),this._headerObjectMap=this._headerObjects.reduce(((t,e)=>(t[e.id]=e,t)),{}),this.rowHierarchyType=function(t){const{columns:e}=t._table.options;if(rt(e)&&e.length>0)for(let t=0;t<e.length;t++){const i=e[t];if(!nt(i)&&i.tree)return!0}return!1}(this)?"tree":"grid",this._hasAggregation=function(t){const e=t.columnObjects;for(let t=0;t<e.length;t++){const i=e[t];if(null==i?void 0:i.aggregation)return!0}return!1}(this),this._hasAggregationOnBottomCount=function(t){const e=t.columnObjects;let i=0;for(let t=0;t<e.length;t++){const o=e[t];(null==o?void 0:o.aggregation)&&(Array.isArray(null==o?void 0:o.aggregation)?i=Math.max(i,o.aggregation.filter((t=>!1===t.showOnTop)).length):!1===o.aggregation.showOnTop&&(i=Math.max(i,1)))}return i}(this),this._hasAggregationOnTopCount=function(t){const e=t.columnObjects;let i=0;for(let t=0;t<e.length;t++){const o=e[t];(null==o?void 0:o.aggregation)&&(Array.isArray(null==o?void 0:o.aggregation)?i=Math.max(i,o.aggregation.filter((t=>!0===t.showOnTop)).length):!0===o.aggregation.showOnTop&&(i=Math.max(i,1)))}return i}(this),this.handleRowSeriesNumber(t.internalProps.rowSeriesNumber)}handleRowSeriesNumber(t){var e;t&&(Array.isArray(t)?this.rowSeriesNumberColumn=t.map((t=>{var e;return{id:this.seqId++,title:t.title,define:t,cellType:null!==(e=t.cellType)&&void 0!==e?e:"text",style:t.style,width:t.width,format:t.format,field:t.field,icon:t.icon,headerIcon:t.headerIcon,isChildNode:!1}})):this.rowSeriesNumberColumn=[{id:this.seqId++,title:t.title,define:t,cellType:null!==(e=t.cellType)&&void 0!==e?e:"text",style:t.style,width:t.width,format:t.format,field:"",icon:t.icon,headerIcon:t.headerIcon,isChildNode:!1}],this.leftRowSeriesNumberColumn=this.rowSeriesNumberColumn.filter((t=>!0)),this.rightRowSeriesNumberColumn=this.rowSeriesNumberColumn.filter((t=>!1)),this.leftRowSeriesNumberColumnCount=this.leftRowSeriesNumberColumn.length,this.rightRowSeriesNumberColumnCount=this.rightRowSeriesNumberColumn.length)}get transpose(){return this._transpose}set transpose(t){this._transpose=t}get showHeader(){return this._showHeader}set showHeader(t){this._showHeader=t}isSeriesNumberInHeader(t,e){if(this.leftRowSeriesNumberColumnCount>0&&t>=0&&e>=0&&t<this.leftRowSeriesNumberColumnCount){if(this.transpose)return!1;if(e<this.headerLevelCount)return!0}if(this.rightRowSeriesNumberColumnCount>0&&e>=0&&t>=this.colCount-this.rightRowSeriesNumberColumnCount){if(this.transpose)return!1;if(e<this.headerLevelCount)return!0}return!1}isSeriesNumberInBody(t,e){if(this.leftRowSeriesNumberColumnCount>0&&t>=0&&t<this.leftRowSeriesNumberColumnCount){if(this.transpose)return!0;if(e>=this.headerLevelCount)return!0}if(this.rightRowSeriesNumberColumnCount>0&&t>=this.colCount-this.rightRowSeriesNumberColumnCount){if(this.transpose)return!0;if(e>=this.headerLevelCount)return!0}return!1}isSeriesNumber(t,e){return this.leftRowSeriesNumberColumnCount>0&&t>=0&&e>=0&&t<this.leftRowSeriesNumberColumnCount||this.rightRowSeriesNumberColumnCount>0&&e>=0&&t>=this.colCount-this.rightRowSeriesNumberColumnCount}getSeriesNumberHeader(t,e){if(this.leftRowSeriesNumberColumnCount>0&&t>=0&&t<this.leftRowSeriesNumberColumnCount){if(this.transpose)return;if(e<this.headerLevelCount)return Object.assign({},this.leftRowSeriesNumberColumn[t],{style:this._table.internalProps.rowSeriesNumber.headerStyle})}if(this.rightRowSeriesNumberColumnCount>0&&t>=this.colCount-this.rightRowSeriesNumberColumnCount&&e<this.headerLevelCount){if(this.transpose)return;if(e<this.headerLevelCount)return this.rightRowSeriesNumberColumn[t-(this.colCount-this.rightRowSeriesNumberColumnCount)]}}getSeriesNumberBody(t,e){if(this.leftRowSeriesNumberColumnCount>0&&t>=0&&t<this.leftRowSeriesNumberColumnCount){if(this.transpose)return this.leftRowSeriesNumberColumn[t];if(e>=this.headerLevelCount)return this.leftRowSeriesNumberColumn[t]}if(this.rightRowSeriesNumberColumnCount>0&&t>=this.colCount-this.rightRowSeriesNumberColumnCount){if(this.transpose)return this.rightRowSeriesNumberColumn[t-(this.colCount-this.rightRowSeriesNumberColumnCount)];if(e>=this.headerLevelCount)return this.rightRowSeriesNumberColumn[t-(this.colCount-this.rightRowSeriesNumberColumnCount)]}}isHeader(t,e){return!!(this.transpose&&t>=this.leftRowSeriesNumberColumnCount&&t<this.headerLevelCount+this.leftRowSeriesNumberColumnCount)||!this.transpose&&e>=0&&e<this.headerLevelCount}isAggregation(t,e){if(this.hasAggregation){if(this.hasAggregationOnBottomCount)if(this.transpose){if(t>=this.colCount-this.hasAggregationOnBottomCount)return!0}else if(e>=this.rowCount-this.hasAggregationOnBottomCount)return!0;if(this.hasAggregationOnTopCount)if(this.transpose){if(t>=this.rowHeaderLevelCount&&t<this.rowHeaderLevelCount+this.hasAggregationOnTopCount)return!0}else if(e>=this.columnHeaderLevelCount&&e<this.columnHeaderLevelCount+this.hasAggregationOnTopCount)return!0}return!1}isTopAggregation(t,e){if(this.hasAggregationOnTopCount)if(this.transpose){if(t>=this.rowHeaderLevelCount&&t<this.rowHeaderLevelCount+this.hasAggregationOnTopCount)return!0}else if(e>=this.columnHeaderLevelCount&&e<this.columnHeaderLevelCount+this.hasAggregationOnTopCount)return!0;return!1}isBottomAggregation(t,e){if(this.hasAggregationOnBottomCount)if(this.transpose){if(t>=this.colCount-this.hasAggregationOnBottomCount)return!0}else if(e>=this.rowCount-this.hasAggregationOnBottomCount)return!0;return!1}get hasAggregation(){return this._hasAggregation}get hasAggregationOnTopCount(){return this._hasAggregationOnTopCount}get hasAggregationOnBottomCount(){return this._hasAggregationOnBottomCount}getAggregatorsByCell(t,e){return this.getBody(t,e).aggregator}getAggregatorsByCellRange(t,e,i,o){let n=[];if(!this.transpose){for(let o=t;o<=i;o++){const t=this.getBody(o,e);t.aggregator&&(n=n.concat(Array.isArray(t.aggregator)?t.aggregator:[t.aggregator]))}return n}for(let i=e;i<=o;i++){const e=this.getBody(t,i);e.aggregator&&(n=n.concat(Array.isArray(e.aggregator)?e.aggregator:[e.aggregator]))}return[]}getAggregatorOnTop(t,e){const i=this.getBody(t,e),o=i.aggregator,n=i.aggregation;if(Array.isArray(n)){const i=n.reduce(((t,e,i)=>(e.showOnTop&&t.push(i),t)),[]).map((t=>o[t]));return this.transpose?i[t-this.rowHeaderLevelCount]:i[e-this.columnHeaderLevelCount]}return this.transpose&&t-this.rowHeaderLevelCount==0?(null==n?void 0:n.showOnTop)?o:null:this.transpose||e-this.columnHeaderLevelCount!=0?null:(null==n?void 0:n.showOnTop)?o:null}getAggregatorOnBottom(t,e){const i=this.getBody(t,e),o=i.aggregator,n=i.aggregation;if(Array.isArray(n)){const i=n.reduce(((t,e,i)=>(!1===e.showOnTop&&t.push(i),t)),[]).map((t=>o[t]));return this.transpose?i[t-(this.colCount-this.hasAggregationOnBottomCount)]:i[e-(this.rowCount-this.hasAggregationOnBottomCount)]}return this.transpose&&t-(this.colCount-this.hasAggregationOnBottomCount)==0?!1===(null==n?void 0:n.showOnTop)?o:null:this.transpose||e-(this.rowCount-this.hasAggregationOnBottomCount)!=0?null:!1===(null==n?void 0:n.showOnTop)?o:null}getAggregatorCellAddress(t,e,i,o){const n=[],r=this.hasAggregationOnTopCount,s=this.hasAggregationOnBottomCount;if(this.transpose){for(let i=e;i<=o;i++)if(this.getBody(t,i).aggregator){for(let t=0;t<r;t++)n.push({col:this.headerLevelCount+t,row:i});for(let t=0;t<s;t++)n.push({col:this.rowCount-s+t,row:i})}}else for(let o=t;o<=i;o++)if(this.getBody(o,e).aggregator){for(let t=0;t<r;t++)n.push({col:o,row:this.headerLevelCount+t});for(let t=0;t<s;t++)n.push({col:o,row:this.rowCount-s+t})}return n}getCellLocation(t,e){return this.isHeader(t,e)?this.transpose?"rowHeader":"columnHeader":"body"}isRowHeader(t,e){return!!(this.transpose&&t>=this.leftRowSeriesNumberColumnCount&&t<this.headerLevelCount+this.leftRowSeriesNumberColumnCount)}isColumnHeader(t,e){return!this.transpose&&e>=0&&e<=this.headerLevelCount-1&&t>=this.leftRowSeriesNumberColumnCount&&t<this.colCount-this.rightRowSeriesNumberColumnCount}isFrozenColumn(t,e){if(Q(e)){if(t>=0&&t<this.frozenColCount&&e>=this.frozenRowCount&&e<this.rowCount-this.bottomFrozenRowCount)return!0}else if(this.frozenColCount>0&&t>=0&&t<this.frozenColCount)return!0;return!1}isRightFrozenColumn(t,e){if(Q(e)){if(t>=this.colCount-this.rightFrozenColCount&&e>=this.frozenRowCount&&e<this.rowCount-this.bottomFrozenRowCount)return!0}else if(this.rightFrozenColCount>0&&t>=this.colCount-this.rightFrozenColCount)return!0;return!1}isFrozenRow(t,e){if(Q(e)){if(e>=0&&e<this.frozenRowCount&&t>=this.frozenColCount&&t<this.colCount-this.rightFrozenColCount)return!0}else if(e=t,this.frozenRowCount>0&&e>=0&&e<this.frozenRowCount)return!0;return!1}isBottomFrozenRow(t,e){if(Q(e)){if(e>=this.rowCount-this.bottomFrozenRowCount&&t>=this.frozenColCount&&t<this.colCount-this.rightFrozenColCount)return!0}else if(e=t,this.bottomFrozenRowCount>0&&e>=this.rowCount-this.bottomFrozenRowCount)return!0;return!1}isLeftBottomCorner(t,e){return t>=0&&t<this.rowHeaderLevelCount&&e>=this.rowCount-this.bottomFrozenRowCount}isRightTopCorner(t,e){return t>=this.colCount-this.rightFrozenColCount&&e>=0&&e<this.columnHeaderLevelCount}isRightBottomCorner(t,e){return t>=this.colCount-this.rightFrozenColCount&&e>=this.rowCount-this.bottomFrozenRowCount}isCornerHeader(t,e){return!1}getColumnHeaderRange(){var t,e;return this.transpose?{start:{col:0,row:0},end:{col:this._headerCellIds.length-1,row:(null!==(t=this.rowCount)&&void 0!==t?t:0)-1}}:{start:{col:0,row:0},end:{col:(null!==(e=this.colCount)&&void 0!==e?e:0)-1,row:this._headerCellIds.length-1}}}getRowHeaderRange(){var t,e;return this.transpose?{start:{col:0,row:0},end:{col:this._headerCellIds.length-1,row:(null!==(t=this.rowCount)&&void 0!==t?t:0)-1}}:{start:{col:0,row:0},end:{col:(null!==(e=this.colCount)&&void 0!==e?e:0)-1,row:this._headerCellIds.length-1}}}getCornerHeaderRange(){}getBodyRange(){var t,e,i,o;return this.transpose?{start:{col:this.headerLevelCount,row:0},end:{col:(null!==(t=this.colCount)&&void 0!==t?t:0)-1,row:(null!==(e=this.rowCount)&&void 0!==e?e:0)-1}}:{start:{col:0,row:this.headerLevelCount},end:{col:(null!==(i=this.colCount)&&void 0!==i?i:0)-1,row:(null!==(o=this.rowCount)&&void 0!==o?o:0)-1}}}get headerLevelCount(){return this.showHeader?this._headerCellIds.length:0}get columnHeaderLevelCount(){return this.transpose?0:this.headerLevelCount}get rowHeaderLevelCount(){return this.transpose?this.headerLevelCount:0}get frozenColCount(){return this._table.internalProps.frozenColCount?this.colCount>this._table.internalProps.frozenColCount?this._table.internalProps.frozenColCount:this.colCount:0}get frozenRowCount(){return this._table.internalProps.frozenRowCount?this.rowCount>=this._table.internalProps.frozenRowCount?this._table.internalProps.frozenRowCount:this.rowCount:0}get bottomFrozenRowCount(){return this._table.internalProps.bottomFrozenRowCount?this.rowCount-this.headerLevelCount>=this._table.internalProps.bottomFrozenRowCount?this._table.internalProps.bottomFrozenRowCount:this.rowCount-this.headerLevelCount:0}get rightFrozenColCount(){return this._table.internalProps.rightFrozenColCount?this.colCount-this.frozenColCount>=this._table.internalProps.rightFrozenColCount?this._table.internalProps.rightFrozenColCount:Math.max(0,this.colCount-this.frozenColCount):0}get colCount(){return this.transpose?this.headerLevelCount+this.recordsCount+this.leftRowSeriesNumberColumnCount+this.rightRowSeriesNumberColumnCount:this._columns.length+this.leftRowSeriesNumberColumnCount+this.rightRowSeriesNumberColumnCount}get rowCount(){return this.transpose?this._columns.length:this.headerLevelCount+this.recordsCount}get bodyRowCount(){return this.transpose?this._columns.length:this.rowCount-this.bottomFrozenRowCount-this.headerLevelCount}get bodyColCount(){return this.transpose?this.colCount-this.rightFrozenColCount-this.rowHeaderLevelCount:this._columns.length}get recordsCount(){return this._recordsCount}set recordsCount(t){this._recordsCount=t}get headerObjects(){return this._headerObjects}get columnObjects(){return this._columns}get headerObjectsIncludeHided(){return this._headerObjectsIncludeHided}get columnWidths(){if(this.leftRowSeriesNumberColumnCount){const t=this.leftRowSeriesNumberColumn.map((t=>({width:t.width,minWidth:t.minWidth,maxWidth:t.maxWidth})));return t.push(...this._columns.map((t=>({width:t.width,minWidth:t.minWidth,maxWidth:t.maxWidth})))),t}return this._columns.map((t=>({width:t.width,minWidth:t.minWidth,maxWidth:t.maxWidth})))}getColumnWidthDefined(t){var e;if(t>=0){if(t<this.leftRowSeriesNumberColumnCount)return this.leftRowSeriesNumberColumn[t];if(this.transpose){let i,o,n=0;if(t>=this.rowHeaderLevelCount+this.leftRowSeriesNumberColumnCount){let t;return this.columnObjects.forEach(((e,r)=>{"number"==typeof e.width?n=Math.max(e.width,n):"auto"===e.width&&(t=!0),"number"==typeof e.minWidth&&(o=Math.max(e.minWidth,o)),"number"==typeof e.maxWidth&&(i=Math.max(e.maxWidth,i))})),n=n>0?n:t?"auto":void 0,{width:n,minWidth:o,maxWidth:i}}if(this.isRowHeader(t,0)){const i=Array.isArray(this._table.defaultHeaderColWidth)?null!==(e=this._table.defaultHeaderColWidth[t])&&void 0!==e?e:this._table.defaultColWidth:this._table.defaultHeaderColWidth;return"auto"===i?{width:"auto"}:{width:i}}}return this._columns[t-this.leftRowSeriesNumberColumnCount]}}getCellId(t,e){var i,o,n,r;return this.transpose?t>=this.headerLevelCount+this.leftRowSeriesNumberColumnCount?null===(i=this._columns[e])||void 0===i?void 0:i.id:this.isSeriesNumber(t,e)?e+"_series_number":null===(o=this._headerCellIds[t-this.leftRowSeriesNumberColumnCount])||void 0===o?void 0:o[e]:this.isSeriesNumber(t,e)?this.rowSeriesNumberColumn[t].id:this.headerLevelCount<=e?null===(n=this._columns[t-this.leftRowSeriesNumberColumnCount])||void 0===n?void 0:n.id:null===(r=this._headerCellIds[e])||void 0===r?void 0:r[t-this.leftRowSeriesNumberColumnCount]}getHeader(t,e){if(this.isSeriesNumberInHeader(t,e))return this.getSeriesNumberHeader(t,e);const i=this.getCellId(t,e);return this._headerObjectMap[i]}getHeaderField(t,e){var i;const o=this.getCellId(t,e);return(null===(i=this._headerObjectMap[o])||void 0===i?void 0:i.field)||(this.transpose?this._columns[e]&&this._columns[e].field:this._columns[t-this.leftRowSeriesNumberColumnCount]&&this._columns[t-this.leftRowSeriesNumberColumnCount].field)}getHeaderCellAdressById(t){for(let e=0;e<this._headerCellIds.length;e++){const i=this._headerCellIds[e];for(let o=0;o<i.length;o++)if(i[o]===t)return this.transpose?{col:e,row:o}:{col:o+this.leftRowSeriesNumberColumnCount,row:e}}}getHeaderCellAddressByField(t){const e=this.headerObjects.find((e=>e&&e.field===t));return this.getHeaderCellAdressById(e.id)}getBody(t,e){return this.isSeriesNumber(t,e)?this.getSeriesNumberBody(t,e):this.transpose?this._columns[e]:this._columns[t-this.leftRowSeriesNumberColumnCount]}getBodyLayoutRangeById(t){var e,i;if(this.transpose){for(let i=0;i<(null!==(e=this.rowCount)&&void 0!==e?e:0);i++)if(t===this._columns[i].id)return{start:{col:0,row:i},end:{col:0,row:i}}}else for(let e=0;e<(null!==(i=this.colCount)&&void 0!==i?i:0);e++)if(t===this._columns[e-this.leftRowSeriesNumberColumnCount].id)return{start:{col:e,row:0},end:{col:e,row:0}};throw new Error(`can not found body layout @id=${t}`)}getCellRange(t,e){var i,o,n;if(-1===t||-1===e)return{start:{col:t,row:e},end:{col:t,row:e}};if(this._cellRangeMap.has(`$${t}$${e}`))return this._cellRangeMap.get(`$${t}$${e}`);let r={start:{col:t,row:e},end:{col:t,row:e}};if(this.transpose)r=this.getCellRangeTranspose(t,e);else if(this.headerLevelCount<=e){if(this.headerLevelCount<=e&&(null===(o=null===(i=this.columnObjects[t-this.leftRowSeriesNumberColumnCount])||void 0===i?void 0:i.define)||void 0===o?void 0:o.mergeCell)){const i=this._table.getCellValue(t,e);for(let o=e-1;o>=this.headerLevelCount;o--){const e=this._table.getCellValue(t,o);if("boolean"==typeof this.columnObjects[t-this.leftRowSeriesNumberColumnCount].define.mergeCell){if(i!==e)break}else if(!this.columnObjects[t-this.leftRowSeriesNumberColumnCount].define.mergeCell(i,e))break;r.start.row=o}for(let o=e+1;o<this.rowCount;o++){const e=this._table.getCellValue(t,o);if("boolean"==typeof this.columnObjects[t-this.leftRowSeriesNumberColumnCount].define.mergeCell){if(i!==e)break}else if(!this.columnObjects[t-this.leftRowSeriesNumberColumnCount].define.mergeCell(i,e))break;r.end.row=o}}}else{const i=this.getCellId(t,e);for(let o=t-1;o>=0&&i===this.getCellId(o,e);o--)r.start.col=o;for(let o=t+1;o<(null!==(n=this.colCount)&&void 0!==n?n:0)&&i===this.getCellId(o,e);o++)r.end.col=o;for(let o=e-1;o>=0&&i===this.getCellId(t,o);o--)r.start.row=o;for(let o=e+1;o<this.headerLevelCount&&i===this.getCellId(t,o);o++)r.end.row=o}return this._cellRangeMap.set(`$${t}$${e}`,r),r}getCellRangeTranspose(t,e){var i,o,n,r;const s={start:{col:t,row:e},end:{col:t,row:e}};if(this.headerLevelCount+this.leftRowSeriesNumberColumnCount<=t||-1===t&&-1===e){if(this.headerLevelCount+this.leftRowSeriesNumberColumnCount<=t&&(null===(o=null===(i=this.columnObjects[e])||void 0===i?void 0:i.define)||void 0===o?void 0:o.mergeCell)){const i=this._table.getCellValue(t,e);for(let o=t-1;o>=this.headerLevelCount+this.leftRowSeriesNumberColumnCount;o--){const t=this._table.getCellValue(o,e);if("boolean"==typeof this.columnObjects[e].define.mergeCell){if(i!==t)break}else if(!this.columnObjects[e].define.mergeCell(i,t))break;s.start.col=o}for(let o=t+1;o<(null!==(n=this.colCount)&&void 0!==n?n:0);o++){const t=this._table.getCellValue(o,e);if("boolean"==typeof this.columnObjects[e].define.mergeCell){if(i!==t)break}else if(!this.columnObjects[e].define.mergeCell(i,t))break;s.end.col=o}}return s}const l=this.getCellId(t,e);for(let i=e-1;i>=0&&l===this.getCellId(t,i);i--)s.start.row=i;for(let i=e+1;i<(null!==(r=this.rowCount)&&void 0!==r?r:0)&&l===this.getCellId(t,i);i++)s.end.row=i;for(let i=t-1;i>=0&&l===this.getCellId(i,e);i--)s.start.col=i;for(let i=t+1;i<this.headerLevelCount+this.leftRowSeriesNumberColumnCount&&l===this.getCellId(i,e);i++)s.end.col=i;return s}isCellRangeEqual(t,e,i,o){const n=this.getCellRange(t,e),r=this.getCellRange(i,o);return n.start.col===r.start.col&&n.end.col===r.end.col&&n.start.row===r.start.row&&n.end.row===r.end.row}getRecordShowIndexByCell(t,e){const i=this.hasAggregationOnTopCount?this.headerLevelCount+1:this.headerLevelCount;return this.transpose?t<i?-1:t-i:e<i?-1:e-i}getRecordStartRowByRecordIndex(t){return(this.hasAggregationOnTopCount?this.headerLevelCount+1:this.headerLevelCount)+t}_addHeaders(t,e,i,o){const n=[],r=this._newRow(t,o);return e.forEach((e=>{var s,l,a,h;const d=this._columns.length,c=this.seqId++,u={id:c,title:null!==(s=e.title)&&void 0!==s?s:e.caption,headerIcon:e.headerIcon,field:e.field,style:e.headerStyle,headerType:null!==(l=e.headerType)&&void 0!==l?l:"text",dropDownMenu:e.dropDownMenu,define:e,columnWidthComputeMode:e.columnWidthComputeMode};n[c]=u;for(let e=t-1;e>=0;e--)this._headerCellIds[e]&&(this._headerCellIds[e][d]=i[e]);if(o?this._headerCellIds[t-1]&&(r[d]=this._headerCellIds[t-1][d]):r[d]=c,e.columns)this._addHeaders(t+1,e.columns,[...i,c],e.hideColumnsSubHeader||o).forEach((t=>n.push(t)));else{const i={id:this.seqId++,field:e.field,fieldFormat:e.fieldFormat,width:e.width,minWidth:e.minWidth,maxWidth:e.maxWidth,icon:e.icon,cellType:null!==(h=null!==(a=e.cellType)&&void 0!==a?a:e.columnType)&&void 0!==h?h:"text",chartModule:"chartModule"in e?e.chartModule:null,chartSpec:"chartSpec"in e?e.chartSpec:null,sparklineSpec:"sparklineSpec"in e?e.sparklineSpec:Tw,style:e.style,define:e,columnWidthComputeMode:e.columnWidthComputeMode,disableColumnResize:null==e?void 0:e.disableColumnResize,aggregation:this._getAggregationForColumn(e,d),isChildNode:t>=1};if(this._columnsIncludeHided.push(i),!0!==e.hide){this._columns.push(i);for(let e=t+1;e<this._headerCellIds.length;e++)this._headerCellIds[e][d]=c}}})),n}_getAggregationForColumn(t,e){let i;return t.aggregation?i=t.aggregation:this._table.options.aggregation&&(i="function"==typeof this._table.options.aggregation?this._table.options.aggregation({col:e,field:t.field}):this._table.options.aggregation),i?Array.isArray(i)?i.map((t=>(Q(t.showOnTop)||(t.showOnTop=!1),t))):Object.assign({showOnTop:!1},i):null}_newRow(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(this._headerCellIds[t]){const e=this._headerCellIds[t-1];if(e.length>this._headerCellIds[t].length)for(let i=this._headerCellIds[t].length;i<e.length;i++)this._headerCellIds[t][i]=e[i];return this._headerCellIds[t]}if(e)return[];const i=this._headerCellIds[t]=[];if(!this._columns.length)return i;const o=this._headerCellIds[t-1];for(let t=0;t<o.length;t++)i[t]=o[t];return i}getCellHeaderPaths(t,e){if(this.isSeriesNumber(t,e))return;let i=[],o=[];return this.transpose?o=[{field:this._columns[e].field}]:i=[{field:this._columns[t-this.leftRowSeriesNumberColumnCount].field}],{colHeaderPaths:i,rowHeaderPaths:o,cellLocation:this.getCellLocation(t,e)}}getParentCellId(t,e){if(0!==e){if(this.isColumnHeader(t,e))return this.getCellId(t,e-1);if(this.isRowHeader(t,e)){if(this.isSeriesNumberInBody(t-1,e))return;return this.getCellId(t-1,e)}}}canMoveHeaderPosition(t,e){if(this.isSeriesNumberInHeader(e.col,e.row)||this.isSeriesNumberInHeader(t.col,t.row))return!1;if(!this.transpose&&this.isSeriesNumberInBody(e.col,e.row)&&this.isSeriesNumberInBody(t.col,t.row))return!0;if(this.transpose&&this.isSeriesNumberInBody(e.col,e.row)&&this.isSeriesNumberInBody(t.col,t.row)&&(this._getColumnDefine(t.col+this.leftRowSeriesNumberColumnCount,t.row).isChildNode&&this._getColumnDefine(e.col+this.leftRowSeriesNumberColumnCount,e.row).isChildNode?(t.col=t.col+this.leftRowSeriesNumberColumnCount+this.rowHeaderLevelCount-1,e.col=e.col+this.leftRowSeriesNumberColumnCount+this.rowHeaderLevelCount-1):(t.col=t.col+this.leftRowSeriesNumberColumnCount,e.col=e.col+this.leftRowSeriesNumberColumnCount)),t.col<0||t.row<0||e.col<0||e.row<0)return!1;if("disabled"===this._table.internalProps.frozenColDragHeaderMode&&this._table.isFrozenColumn(e.col))return!1;const i=this.getCellRange(t.col,t.row);return this.isColumnHeader(t.col,t.row)?this.getParentCellId(t.col,i.start.row)===this.getParentCellId(e.col,i.start.row):!!this.isRowHeader(t.col,t.row)&&this.getParentCellId(i.start.col,t.row)===this.getParentCellId(i.start.col,e.row)}moveHeaderPosition(t,e){if(this.canMoveHeaderPosition(t,e)){let i=this.getCellRange(t.col,t.row);if(this.isColumnHeader(t.col,t.row)){const o=i.end.col-i.start.col+1;let n;const r=this.getCellRange(e.col,i.start.row);if(n=e.col>=t.col?r.end.col-o+1:r.start.col,n===i.start.col)return null;for(let t=0;t<this._headerCellIds.length;t++){const e=this._headerCellIds[t].splice(i.start.col-this.leftRowSeriesNumberColumnCount,o);e.unshift(n-this.leftRowSeriesNumberColumnCount,0),Array.prototype.splice.apply(this._headerCellIds[t],e)}const s=this._columns.splice(i.start.col-this.leftRowSeriesNumberColumnCount,o);return s.unshift(n-this.leftRowSeriesNumberColumnCount,0),Array.prototype.splice.apply(this._columns,s),this.columnTree.movePosition(i.start.row,i.start.col-this.leftRowSeriesNumberColumnCount,n-this.leftRowSeriesNumberColumnCount),this.columnTree.reset(this.columnTree.tree.children,!0),this._cellRangeMap=new Map,{sourceIndex:i.start.col,targetIndex:n,sourceSize:o,targetSize:r.end.col-r.start.col+1,moveType:"column"}}if(this.isRowHeader(t.col,t.row)||this.isSeriesNumberInBody(t.col,t.row)&&this.transpose){this.isSeriesNumberInBody(t.col,t.row)&&(i=this.getCellRange(t.col+this.leftRowSeriesNumberColumnCount,t.row));const o=i.end.row-i.start.row+1;let n;const r=this.getCellRange(i.start.col,e.row);if(n=e.row>=t.row?r.end.row-o+1:r.start.row,n===i.start.row)return null;for(let t=0;t<this._headerCellIds.length;t++){const e=this._headerCellIds[t].splice(i.start.row,o);e.unshift(n,0),Array.prototype.splice.apply(this._headerCellIds[t],e)}const s=this._columns.splice(i.start.row,o);return s.unshift(n,0),Array.prototype.splice.apply(this._columns,s),this.columnTree.movePosition(i.start.col-this.leftRowSeriesNumberColumnCount,i.start.row,n+(e.row>t.row?i.end.row-i.start.row:0)),this.columnTree.reset(this.columnTree.tree.children,!0),this._cellRangeMap=new Map,{sourceIndex:i.start.row,targetIndex:n,sourceSize:o,targetSize:r.end.row-r.start.row+1,moveType:"row"}}if(this.isSeriesNumberInBody(t.col,t.row))return{sourceIndex:t.row,targetIndex:e.row,sourceSize:1,targetSize:1,moveType:"row"}}return null}toggleHierarchyState(t){return{addCellPositions:t.add.map((t=>({col:0,row:this._table.frozenRowCount+t}))),removeCellPositions:t.remove.map((t=>({col:0,row:this._table.frozenRowCount+t})))}}setChartInstance(t,e,i){const o=this.transpose?this._columns[e]:this._columns[t-this.leftRowSeriesNumberColumnCount];"function"!=typeof o.chartSpec&&(o.chartInstance=i)}getChartInstance(t,e){return(this.transpose?this._columns[e]:this._columns[t-this.leftRowSeriesNumberColumnCount]).chartInstance}checkHasChart(){return function(t){let e=!1;for(let i=0;i<t.columnObjects.length;i++)if(t.columnObjects[i].chartSpec){e=!0;break}return e}(this)}getAxisConfigInPivotChart(t,e){}isEmpty(t,e){return!1}isAxisCell(t,e){return!1}getChartAxes(t,e){return[]}isShareChartSpec(t,e){const i=this.getBody(t,e);return"function"!=typeof(null==i?void 0:i.chartSpec)}getChartSpec(t,e){return this.getRawChartSpec(t,e)}getRawChartSpec(t,e){const i=this.getBody(t,e),o=null==i?void 0:i.chartSpec;return"function"==typeof o?o({col:t,row:e,dataValue:this._table.getCellOriginValue(t,e)||"",value:this._table.getCellValue(t,e)||"",rect:this._table.getCellRangeRelativeRect(this._table.getCellRange(t,e)),table:this._table}):o}getChartDataId(t,e){return function(t,e,i){var o;const n=i.getRawChartSpec(t,e);if(null==n?void 0:n.series){const t={};return(null===(o=n.data)||void 0===o?void 0:o.id)&&(t[n.data.id]=void 0),null==n||n.series.forEach((e=>{var i,o,r,s,l,a,h,d,c,u,g;if(!(null===(i=e.data)||void 0===i?void 0:i.fromDataId))if(null===(o=e.data)||void 0===o?void 0:o.transforms)t[null!==(g=null!==(c=null===(d=e.data)||void 0===d?void 0:d.id)&&void 0!==c?c:null===(u=n.data)||void 0===u?void 0:u.id)&&void 0!==g?g:"data"]=void 0;else{const i="horizontal"===e.direction?e.xField:e.yField;t[null!==(a=null!==(s=null===(r=e.data)||void 0===r?void 0:r.id)&&void 0!==s?s:null===(l=n.data)||void 0===l?void 0:l.id)&&void 0!==a?a:"data"]=(null===(h=e.data)||void 0===h?void 0:h.id)?i:void 0}})),t}return n.data.id}(t,e,this)}release(){const t=this._table._getActiveChartInstance();null==t||t.release(),this.columnObjects.forEach((t=>{var e;null===(e=t.chartInstance)||void 0===e||e.release()}))}clearCellRangeMap(){this._cellRangeMap.clear()}updateColumnTitle(t,e,i){const o=this._table.internalProps.layoutMap.getHeader(t,e);o.title=i,o.define.title=i}getColumnByField(t){var e;return null===(e=this.columnObjects)||void 0===e?void 0:e.reduce(((e,i,o)=>(i.field===t&&e.push({col:o,columnDefine:i}),e)),[])}_getColumnDefine(t,e){if(t>=0)return t<this.leftRowSeriesNumberColumnCount?this.leftRowSeriesNumberColumn[t]:this.transpose?this._columns[e]:this._columns[t-this.leftRowSeriesNumberColumnCount]}}class ZM{constructor(t){this.table=t,this.bindEvent()}bindEvent(){const t=this.table.internalProps.handler;this.table.on(cw.DBLCLICK_CELL,(t=>{var e;if(!this.table.options.editCellTrigger||"doubleclick"===this.table.options.editCellTrigger){const{col:i,row:o}=t,n=l_(t.federatedEvent),r=this.table.scenegraph.getResizeColAt(n.abstractPos.x,n.abstractPos.y,null===(e=n.eventArgs)||void 0===e?void 0:e.targetCell);if(this.table._canResizeColumn(r.col,r.row)&&r.col>=0)return;this.startEditCell(i,o)}})),this.table.on(cw.CLICK_CELL,(t=>{if("click"===this.table.options.editCellTrigger){const{col:e,row:i}=t;this.startEditCell(e,i)}})),t.on(this.table.getElement(),"wheel",(t=>{this.completeEdit()})),t.on(this.table.getElement(),"resize",(t=>{(this.table.autoFillWidth||this.table.autoFillHeight)&&this.completeEdit()}))}startEditCell(t,e,i){var o,n,r,s,l;const a=this.table.getEditor(t,e);if(a){if(null===(n=null===(o=this.table.internalProps.layoutMap)||void 0===o?void 0:o.isAggregation)||void 0===n?void 0:n.call(o,t,e))return;this.editingEditor||(this.editCell={col:t,row:e}),this.editingEditor=a;const h=Q(i)?i:this.table.getCellOriginValue(t,e),d=this.table.getCellRangeRelativeRect(this.table.getCellRange(t,e)),c={rect:{left:d.left,top:d.top,width:d.width,height:d.height}};a.beginEditing,null===(r=a.beginEditing)||void 0===r||r.call(a,this.table.getElement(),c,h),a.bindSuccessCallback,null===(s=a.bindSuccessCallback)||void 0===s||s.call(a,(()=>{this.completeEdit()})),null===(l=a.onStart)||void 0===l||l.call(a,{value:h,endEdit:()=>{this.completeEdit()},referencePosition:c,container:this.table.getElement(),col:t,row:e})}}completeEdit(t){var e,i;if(!this.editingEditor)return!0;const o=null==t?void 0:t.target,{editingEditor:n}=this;if(o)if(n.targetIsOnEditor){if(n.targetIsOnEditor(o))return!1}else if(!n.isEditorElement||n.isEditorElement(o))return!1;if(this.editingEditor.getValue,this.editingEditor.validateValue){const t=null===(i=(e=this.editingEditor).validateValue)||void 0===i?void 0:i.call(e);return tw(t)?new Promise(((e,i)=>{t.then((t=>{t?(this.doExit(),e(!0)):e(!1)})).catch((t=>{i(t)}))})):!!t&&(this.doExit(),!0)}return this.doExit(),!0}doExit(){var t,e,i,o,n,r;const s=null===(e=(t=this.editingEditor).getValue)||void 0===e?void 0:e.call(t),l=this.table.getCellRange(this.editCell.col,this.editCell.row),a=[];for(let t=l.start.row;t<=l.end.row;t++){const t=[];for(let e=l.start.col;e<=l.end.col;e++)t.push(s);a.push(t)}this.table.changeCellValues(l.start.col,l.start.row,a),this.editingEditor.exit,null===(o=(i=this.editingEditor).exit)||void 0===o||o.call(i),null===(r=(n=this.editingEditor).onEnd)||void 0===r||r.call(n),this.editingEditor=null}cancelEdit(){var t,e,i,o;this.editingEditor&&(null===(e=(t=this.editingEditor).exit)||void 0===e||e.call(t),null===(o=(i=this.editingEditor).onEnd)||void 0===o||o.call(i),this.editingEditor=null)}}class JM extends TM{constructor(t,e){var i,o;"node"===BC.mode?(e=t,t=null):t instanceof HTMLElement||(e=t,t=t.container?t.container:null),super(t,e),this.showHeader=!0;const n=this.internalProps;if(n.frozenColDragHeaderMode=e.frozenColDragHeaderMode,this.pagination=e.pagination,n.sortState=e.sortState,n.dataConfig={},n.columns=e.columns?OM(e.columns,["children"]):e.header?OM(e.header,["children"]):[],this.internalProps.headerHelper.setTableColumnsEditor(),this.showHeader=null===(i=e.showHeader)||void 0===i||i,this.transpose=null!==(o=e.transpose)&&void 0!==o&&o,"node"!==BC.mode&&(this.editorManager=new ZM(this)),this.refreshHeader(),this.internalProps.useOneRowHeightFillAll=!1,e.dataSource?Qx(this,e.dataSource):e.records?this.setRecords(e.records,{sortState:n.sortState}):this.setRecords([]),e.title){const t=Vw.getComponent("title");n.title=new t(e.title,this),this.scenegraph.resize()}if(this.options.emptyTip)if(this.internalProps.emptyTip)this.internalProps.emptyTip.resetVisible();else{const t=Vw.getComponent("emptyTip");this.internalProps.emptyTip=new t(this.options.emptyTip,this),this.internalProps.emptyTip.resetVisible()}setTimeout((()=>{this.fireListeners(cw.INITIALIZED,null)}),0)}isListTable(){return!0}isPivotTable(){return!1}isPivotChart(){return!1}get sortState(){return this.internalProps.sortState}get records(){var t;return null===(t=this.dataSource)||void 0===t?void 0:t.records}get recordsCount(){return this.dataSource.records.length}updateColumns(t){const e={col:this.stateManager.hover.cellPos.col,row:this.stateManager.hover.cellPos.row};this.internalProps.columns=OM(t,["children"]),this.options.columns=t,this.internalProps.headerHelper.setTableColumnsEditor(),this._hasAutoImageColumn=void 0,this.refreshHeader(),this.internalProps.useOneRowHeightFillAll=!1,this.scenegraph.clearCells(),this.headerStyleCache=new Map,this.bodyStyleCache=new Map,this.bodyBottomStyleCache=new Map,this.scenegraph.createSceneGraph(),this.stateManager.updateHoverPos(e.col,e.row),this.renderAsync(),this.eventManager.updateEventBinder()}get columns(){return this.internalProps.layoutMap.columnTree.getCopiedTree()}get header(){return this.internalProps.columns}set header(t){this.internalProps.columns=t,this.options.header=t,this.refreshHeader(),this.internalProps.useOneRowHeightFillAll=!1,this.renderAsync()}get transpose(){var t;return null!==(t=this.internalProps.transpose)&&void 0!==t&&t}set transpose(t){this.internalProps.transpose!==t&&(this.internalProps.transpose=t,this.internalProps.layoutMap&&(this.internalProps.layoutMap.transpose=t,this.refreshRowColCount(),this._resetFrozenColCount(),this.renderAsync()))}getCellValue(t,e,i){if(-1===t||-1===e)return null;if(!i){const i=this.getCustomMergeValue(t,e);if(i)return i}const o=this;if(o.internalProps.layoutMap.isSeriesNumber(t,e)){if(o.internalProps.layoutMap.isSeriesNumberInHeader(t,e)){const{title:i}=o.internalProps.layoutMap.getSeriesNumberHeader(t,e);return i}const{format:i}=o.internalProps.layoutMap.getSeriesNumberBody(t,e);return"function"==typeof i?i(t,e,this):e-this.columnHeaderLevelCount+1}if(o.internalProps.layoutMap.isHeader(t,e)){const{title:i}=o.internalProps.layoutMap.getHeader(t,e);return"function"==typeof i?i():i}if(o.internalProps.layoutMap.isAggregation(t,e)){if(o.internalProps.layoutMap.isTopAggregation(t,e)){const i=o.internalProps.layoutMap.getAggregatorOnTop(t,e);return(null==i?void 0:i.formatValue)?i.formatValue(t,e,this):""}if(o.internalProps.layoutMap.isBottomAggregation(t,e)){const i=o.internalProps.layoutMap.getAggregatorOnBottom(t,e);return(null==i?void 0:i.formatValue)?i.formatValue(t,e,this):""}}const{field:n,fieldFormat:r}=o.internalProps.layoutMap.getBody(t,e);return o.getFieldData(r||n,t,e)}getCellOriginValue(t,e){if(-1===t||-1===e)return null;const i=this;if(i.internalProps.layoutMap.isSeriesNumber(t,e)){if(i.internalProps.layoutMap.isSeriesNumberInHeader(t,e)){const{title:o}=i.internalProps.layoutMap.getSeriesNumberHeader(t,e);return o}const{format:o}=i.internalProps.layoutMap.getSeriesNumberBody(t,e);return"function"==typeof o?o(t,e,this):e-this.columnHeaderLevelCount}if(i.internalProps.layoutMap.isHeader(t,e)){const{title:o}=i.internalProps.layoutMap.getHeader(t,e);return"function"==typeof o?o():o}if(i.internalProps.layoutMap.isAggregation(t,e)){if(i.internalProps.layoutMap.isTopAggregation(t,e)){const o=i.internalProps.layoutMap.getAggregatorOnTop(t,e);return null==o?void 0:o.value()}if(i.internalProps.layoutMap.isBottomAggregation(t,e)){const o=i.internalProps.layoutMap.getAggregatorOnBottom(t,e);return null==o?void 0:o.value()}}const{field:o}=i.internalProps.layoutMap.getBody(t,e);return i.getFieldData(o,t,e)}getCellRawValue(t,e){if(-1===t||-1===e)return null;const i=this;if(i.internalProps.layoutMap.isHeader(t,e)){const{title:o}=i.internalProps.layoutMap.getHeader(t,e);return"function"==typeof o?o():o}const{field:o}=i.internalProps.layoutMap.getBody(t,e);return i.getRawFieldData(o,t,e)}getRecordShowIndexByCell(t,e){const{layoutMap:i}=this.internalProps;return i.getRecordShowIndexByCell(t,e)}getRecordIndexByCell(t,e){const{layoutMap:i}=this.internalProps,o=i.getRecordShowIndexByCell(t,e);return this.dataSource.currentPagerIndexedData[o]}getTableIndexByRecordIndex(t){return this.transpose?this.dataSource.getTableIndex(t)+this.rowHeaderLevelCount:this.dataSource.getTableIndex(t)+this.columnHeaderLevelCount}getTableIndexByField(t){const e=this.internalProps.layoutMap.columnObjects.find((e=>e.field===t)),i=this.internalProps.layoutMap.getBodyLayoutRangeById(e.id);return this.transpose?i.start.row:i.start.col}getCellAddrByFieldRecord(t,e){return this.transpose?{col:this.getTableIndexByRecordIndex(e),row:this.getTableIndexByField(t)}:{col:this.getTableIndexByField(t),row:this.getTableIndexByRecordIndex(e)}}getCellOriginRecord(t,e){const i=this.getRecordShowIndexByCell(t,e);if(i>-1)return this.dataSource.get(i)}getCellRawRecord(t,e){const i=this.getRecordShowIndexByCell(t,e);if(i>-1)return this.dataSource.getRaw(i)}_canResizeColumn(t,e){const i=super._canResizeColumn(t,e);if(i&&!this.transpose){const i=this.internalProps.layoutMap.getBody(t,this.columnHeaderLevelCount),o=this.internalProps.layoutMap.isSeriesNumber(t,e);if(null==i?void 0:i.disableColumnResize)return!1;if(o&&!0===this.internalProps.rowSeriesNumber.disableColumnResize)return!1}return i}updateOption(t){var e,i;const o=this.internalProps;if(super.updateOption(t),o.frozenColDragHeaderMode=t.frozenColDragHeaderMode,this.pagination=t.pagination,o.sortState=t.sortState,o.dataConfig={},this.showHeader=null===(e=t.showHeader)||void 0===e||e,o.columns=t.columns?OM(t.columns,["children"]):t.header?OM(t.header,["children"]):[],this.internalProps.headerHelper.setTableColumnsEditor(),this.transpose=null!==(i=t.transpose)&&void 0!==i&&i,this.refreshHeader(),this.internalProps.useOneRowHeightFillAll=!1,o.releaseList&&(o.releaseList.forEach((t=>{var e;return null===(e=null==t?void 0:t.release)||void 0===e?void 0:e.call(t)})),o.releaseList=null),t.dataSource?Qx(this,t.dataSource):t.records?this.setRecords(t.records,{sortState:t.sortState}):(this._resetFrozenColCount(),this.scenegraph.createSceneGraph(),this.render()),t.title){const e=Vw.getComponent("title");o.title=new e(t.title,this),this.scenegraph.resize()}if(this.options.emptyTip)if(this.internalProps.emptyTip)this.internalProps.emptyTip.resetVisible();else{const t=Vw.getComponent("emptyTip");this.internalProps.emptyTip=new t(this.options.emptyTip,this),this.internalProps.emptyTip.resetVisible()}return new Promise((t=>{setTimeout(t,0)}))}updatePagination(t){this.pagination&&("number"==typeof t.currentPage&&t.currentPage>=0&&(this.pagination.currentPage=t.currentPage),t.perPageCount&&(this.pagination.perPageCount=t.perPageCount||this.pagination.perPageCount),this.internalProps.layoutMap.clearCellRangeMap(),this.internalProps.useOneRowHeightFillAll=!1,this.scenegraph.clearCells(),this.dataSource.updatePagination(this.pagination),this.refreshRowColCount(),this.scenegraph.createSceneGraph(),this.renderAsync())}refreshHeader(){var t;const e=this.internalProps,i=this.transpose,o=this.showHeader;(e.layoutMap=new qM(this,null!==(t=e.columns)&&void 0!==t?t:[],o,this.options.hierarchyIndent)).transpose=i,i||this.setMinMaxLimitWidth(!0),this.refreshRowColCount()}refreshRowColCount(){var t,e,i,o,n,r,s,l,a,h,d,c,u,g,p,f,m;const b=this,{layoutMap:v}=b.internalProps;if(!v)return;const y=null!==(e=null===(t=b.internalProps.dataSource)||void 0===t?void 0:t.length)&&void 0!==e?e:0;v.recordsCount=y+(y>0?v.hasAggregationOnTopCount+v.hasAggregationOnBottomCount:0),b.transpose?(b.rowCount=null!==(i=v.rowCount)&&void 0!==i?i:0,b.colCount=null!==(o=v.colCount)&&void 0!==o?o:0,b.frozenRowCount=0,this.internalProps.frozenColCount=Math.max((null!==(n=v.headerLevelCount)&&void 0!==n?n:0)+v.leftRowSeriesNumberColumnCount,null!==(r=this.options.frozenColCount)&&void 0!==r?r:0),b.bottomFrozenRowCount!==(null!==(s=this.options.bottomFrozenRowCount)&&void 0!==s?s:0)&&(b.bottomFrozenRowCount=null!==(l=this.options.bottomFrozenRowCount)&&void 0!==l?l:0),b.rightFrozenColCount!==(null!==(a=this.options.rightFrozenColCount)&&void 0!==a?a:0)&&(b.rightFrozenColCount=null!==(h=this.options.rightFrozenColCount)&&void 0!==h?h:0)):(b.colCount=null!==(d=v.colCount)&&void 0!==d?d:0,b.rowCount=v.recordsCount*v.bodyRowSpanCount+v.headerLevelCount,this.internalProps.frozenColCount=null!==(c=this.options.frozenColCount)&&void 0!==c?c:0,b.frozenRowCount=Math.max(v.headerLevelCount,null!==(u=this.options.frozenRowCount)&&void 0!==u?u:0),b.bottomFrozenRowCount!==(null!==(g=this.options.bottomFrozenRowCount)&&void 0!==g?g:0)&&(b.bottomFrozenRowCount=null!==(p=this.options.bottomFrozenRowCount)&&void 0!==p?p:0),b.rightFrozenColCount!==(null!==(f=this.options.rightFrozenColCount)&&void 0!==f?f:0)&&(b.rightFrozenColCount=null!==(m=this.options.rightFrozenColCount)&&void 0!==m?m:0)),this.stateManager.setFrozenCol(this.internalProps.frozenColCount)}getFieldData(t,e,i){if(null===t)return null;if(this.internalProps.layoutMap.isHeader(e,i))return null;const o=this.getRecordShowIndexByCell(this.transpose?e-this.internalProps.layoutMap.leftRowSeriesNumberColumnCount:e,i);return this.internalProps.dataSource.getField(o,t,e,i,this)}getRawFieldData(t,e,i){if(null===t)return null;if(this.internalProps.layoutMap.isHeader(e,i))return null;const o=this.getRecordShowIndexByCell(e,i);return this.internalProps.dataSource.getRawField(o,t,e,i,this)}_moveHeaderPosition(t,e){const i=this.getCellRange(t.col,t.row),o=this.getCellRange(e.col,e.row),n=this.internalProps.layoutMap.moveHeaderPosition(t,e);return n?("column"===n.moveType?(this.colWidthsMap.exchangeOrder(i.start.col,i.end.col-i.start.col+1,o.start.col,o.end.col-o.start.col+1,n.targetIndex),this.transpose||(this.colWidthsLimit={},this.setMinMaxLimitWidth())):n.targetIndex>n.sourceIndex?this.rowHeightsMap.exchangeOrder(n.sourceIndex,n.sourceSize,n.targetIndex+n.sourceSize-n.targetSize,n.targetSize,n.targetIndex):this.rowHeightsMap.exchangeOrder(n.sourceIndex,n.sourceSize,n.targetIndex,n.targetSize,n.targetIndex),n):null}changeRecordOrder(t,e){this.transpose?(t=this.getRecordShowIndexByCell(t,0),e=this.getRecordShowIndexByCell(e,0)):(t=this.getRecordShowIndexByCell(0,t),e=this.getRecordShowIndexByCell(0,e)),this.dataSource.reorderRecord(t,e)}getCellAddress(t,e){let i;for(let e=0;e<this.internalProps.records.length;e++){const o=this.internalProps.records[e];if("function"==typeof t)t(o)&&(i=e);else{let n=!0;for(const e in t)if(o[e]!==t[e]){n=!1;break}n&&(i=e)}if(Q(i))break}const o=this.getCellRangeByField(e,i);if(o)return{row:o.start.row,col:o.start.col}}getCellRangeByField(t,e){const{layoutMap:i}=this.internalProps,o=i.columnObjects.find((e=>e.field===t));if(o){const t=i.getBodyLayoutRangeById(o.id);let n;return Q(e)&&(n=i.getRecordStartRowByRecordIndex(e)),this.transpose?{start:{row:t.start.row,col:Q(n)?n+t.start.col:void 0},end:{row:t.end.row,col:Q(n)?n+t.end.col:void 0}}:{start:{col:t.start.col,row:Q(n)?n+t.start.row:void 0},end:{col:t.end.col,row:Q(n)?n+t.end.row:void 0}}}return null}getHierarchyState(t,e){if(!this.getBodyColumnDefine(t,e).tree)return Jy.none;const i=this.getRecordShowIndexByCell(t,e);return this.dataSource.getHierarchyState(i)}toggleHierarchyState(t,e){this.stateManager.updateHoverIcon(t,e,void 0,void 0);const i=this.getHierarchyState(t,e);if(i===Jy.expand)this._refreshHierarchyState(t,e),this.fireListeners(cw.TREE_HIERARCHY_STATE_CHANGE,{col:t,row:e,hierarchyState:Jy.collapse});else if(i===Jy.collapse){const i=this.getCellOriginRecord(t,e);Array.isArray(i.children)&&this._refreshHierarchyState(t,e),this.fireListeners(cw.TREE_HIERARCHY_STATE_CHANGE,{col:t,row:e,hierarchyState:Jy.expand,originData:i})}}_refreshHierarchyState(t,e){let i=!1,o=!1;const n=this.internalProps.layoutMap.checkHasChart();n&&(this.autoFillWidth&&(i=this.getAllColsWidth()<=this.tableNoFrameWidth),this.autoFillHeight&&(o=this.getAllRowsHeight()<=this.tableNoFrameHeight));const r=this.getRecordShowIndexByCell(t,e),s=this.dataSource.toggleHierarchyState(r,this.scenegraph.proxy.rowStart-this.columnHeaderLevelCount,Math.max(this.scenegraph.proxy.rowEnd-this.columnHeaderLevelCount,this.scenegraph.proxy.rowStart-this.columnHeaderLevelCount+this.scenegraph.proxy.rowLimit-1)),l=this.internalProps.layoutMap.toggleHierarchyState(s);this.refreshRowColCount(),this.clearCellStyleCache(),this.internalProps.layoutMap.clearCellRangeMap(),this.internalProps.useOneRowHeightFillAll=!1,this.scenegraph.updateHierarchyIcon(t,e),this.scenegraph.updateRow(l.removeCellPositions,l.addCellPositions),n&&(this.autoFillWidth&&!i&&(i=this.getAllColsWidth()<=this.tableNoFrameWidth),this.autoFillHeight&&!o&&(o=this.getAllRowsHeight()<=this.tableNoFrameHeight),("adaptive"===this.widthMode||i||"adaptive"===this.heightMode||o)&&this.scenegraph.updateChartSize(0))}_hasHierarchyTreeHeader(){var t,e;return null===(e=null!==(t=this.options.columns)&&void 0!==t?t:this.options.header)||void 0===e?void 0:e.some(((t,e)=>t.tree))}getMenuInfo(t,e,i){return{field:this.getHeaderField(t,e),value:this.getCellValue(t,e),cellLocation:this.getCellLocation(t,e),event:void 0}}_getSortFuncFromHeaderOption(t,e,i){if(t||(t=this.internalProps.columns),e&&t&&t.length>0)for(let o=0;o<t.length;o++){const n=t[o];if((i&&i===n.fieldKey||!i&&n.field===e)&&n.sort&&"function"==typeof n.sort)return n.sort;if(n.columns){const t=this._getSortFuncFromHeaderOption(n.columns,e,i);if(t)return t}}}updateSortState(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];var i,o,n;let r,s;if(t?this.internalProps.sortState=t:this.internalProps.sortState&&(Array.isArray(this.internalProps.sortState)?(t=null===(i=this.internalProps.sortState)||void 0===i?void 0:i[0])&&(t.order="normal"):(this.internalProps.sortState.order="normal",t=this.internalProps.sortState)),Array.isArray(this.internalProps.sortState)?(null===(o=this.internalProps.sortState)||void 0===o?void 0:o[0])&&({order:r,field:s}=null===(n=this.internalProps.sortState)||void 0===n?void 0:n[0]):this.internalProps.sortState&&({order:r,field:s}=this.internalProps.sortState),s&&e){const t=this._getSortFuncFromHeaderOption(this.internalProps.columns,s),e=this.internalProps.layoutMap.headerObjects.find((t=>t&&t.field===s));!1!==e.define.sort&&(this.dataSource.sort(e.field,r,t),this.internalProps.layoutMap.clearCellRangeMap(),this.internalProps.useOneRowHeightFillAll=!1,this.scenegraph.sortCell())}t&&this.stateManager.updateSortState(t)}updateFilterRules(t){this.scenegraph.clearCells(),this.sortState?(this.dataSource.updateFilterRulesForSorted(t),i_(this)):this.dataSource.updateFilterRules(t),this.refreshRowColCount(),this.scenegraph.createSceneGraph()}getCheckboxState(t){return this.stateManager.checkedState.length<this.rowCount-this.columnHeaderLevelCount&&this.stateManager.initLeftRecordsCheckState(this.records),Q(t)?this.stateManager.checkedState.map((e=>e[t])):this.stateManager.checkedState}getCellCheckboxState(t,e){var i;const o=this.getBodyColumnDefine(t,e),n=null==o?void 0:o.field,r=this.getCellType(t,e);if(Q(n)&&"checkbox"===r){const o=this.dataSource.getIndexKey(this.getRecordShowIndexByCell(t,e));return null===(i=this.stateManager.checkedState[o])||void 0===i?void 0:i[n]}}getRadioState(t){return Q(t)?this.stateManager.radioState[t]:this.stateManager.radioState}getCellRadioState(t,e){return function(t,e,i){var o;const n=i.getBodyColumnDefine(t,e),r=null==n?void 0:n.field,s=i.getCellType(t,e);if(Q(r)&&"checkbox"===s){const n=i.dataSource.getIndexKey(i.getRecordShowIndexByCell(t,e)),s=null===(o=i.stateManager.radioState)||void 0===o?void 0:o[r];if(at(s)){if(s===n)return!0}else if(tt(s)){const t=s[n];if(at(t))return t}}return!1}(t,e,this)}setCellCheckboxState(t,e,i){!function(t,e,i,o){const n=o.scenegraph.getCell(t,e),r=null==n?void 0:n.getChildByName("checkbox");if(!r)return;const{checked:s,indeterminate:l}=r.attribute;l?(i||r._handlePointerUp(),r._handlePointerUp()):s?i||r._handlePointerUp():i&&r._handlePointerUp()}(t,e,i,this)}setCellRadioState(t,e,i){!function(t,e,i,o){const n=o.scenegraph.getCell(t,e);if(n)if(at(i)){const t=n.getChildAt(i);null==t||t._handlePointerUp()}else{const t=n.getChildByName("radio");null==t||t._handlePointerUp()}}(t,e,i,this)}setRecords(t,e){var i,o,n;let r;null===(i=this.internalProps.dataSource)||void 0===i||i.release(),this.internalProps.releaseList=null===(o=this.internalProps.releaseList)||void 0===o?void 0:o.filter((t=>!t.dataSourceObj)),this.internalProps.dataSource=null,Array.isArray(e)||(null==e?void 0:e.order)?r=e:e?r=e.sortState:null===e&&(r=null),"undefined"!=typeof window&&window.performance.now();const s={col:this.stateManager.hover.cellPos.col,row:this.stateManager.hover.cellPos.row};if(this.scenegraph.clearCells(),void 0!==r&&(this.internalProps.sortState=r,this.stateManager.setSortState(this.sortState)),t){if(Jx(this,t),this.sortState){let t,e;if(Array.isArray(this.sortState)?0!==this.sortState.length&&({order:t,field:e}=null===(n=this.sortState)||void 0===n?void 0:n[0]):({order:t,field:e}=this.sortState),t&&e&&"normal"!==t){const i=this._getSortFuncFromHeaderOption(void 0,e),o=this.internalProps.layoutMap.headerObjectsIncludeHided.find((t=>t&&t.field===e));!1!==o.define.sort&&this.dataSource.sort(o.field,t,null!=i?i:DC)}}this.refreshRowColCount()}else Jx(this,t);if(this.stateManager.initCheckedState(t),this.clearCellStyleCache(),this.scenegraph.createSceneGraph(),this.stateManager.updateHoverPos(s.col,s.row),this.internalProps.title&&!this.internalProps.title.isReleased&&(this._updateSize(),this.internalProps.title.resize(),this.scenegraph.resize()),this.options.emptyTip)if(this.internalProps.emptyTip)this.internalProps.emptyTip.resetVisible();else{const t=Vw.getComponent("emptyTip");this.internalProps.emptyTip=new t(this.options.emptyTip,this),this.internalProps.emptyTip.resetVisible()}this.render(),Q(s.col)&&Q(s.row)&&s.col>=0&&s.row>=0&&setTimeout((()=>{this.internalProps.tooltipHandler.showTooltip(s.col,s.row)}),0)}setRecordChildren(t,e,i){const o=this.getCellOriginRecord(e,i);o.children=t;const n=this.getRecordShowIndexByCell(e,i);this.dataSource.setRecord(o,n),this._refreshHierarchyState(e,i)}startEditCell(t,e,i){var o;if(Q(t)&&Q(e))this.eventManager.isDraging=!1,this.selectCell(t,e),this.editorManager.startEditCell(t,e,i);else if(null===(o=this.stateManager.select)||void 0===o?void 0:o.cellPos){const{col:t,row:e}=this.stateManager.select.cellPos;Q(t)&&Q(e)&&this.editorManager.startEditCell(t,e,i)}}completeEditCell(){this.editorManager.completeEdit()}getEditor(t,e){var i,o;const n=this.getBodyColumnDefine(t,e);let r=this.isHeader(t,e)?null!==(i=null==n?void 0:n.headerEditor)&&void 0!==i?i:this.options.headerEditor:null!==(o=null==n?void 0:n.editor)&&void 0!==o?o:this.options.editor;return"function"==typeof r&&(r=r({col:t,row:e,dataValue:this.getCellOriginValue(t,e),value:this.getCellValue(t,e)||"",table:this})),"string"==typeof r?function(t){if(PM[t])return PM[t]}(r):r}isHasEditorDefine(t,e){var i,o;const n=this.getBodyColumnDefine(t,e);let r=this.isHeader(t,e)?null!==(i=null==n?void 0:n.headerEditor)&&void 0!==i?i:this.options.headerEditor:null!==(o=null==n?void 0:n.editor)&&void 0!==o?o:this.options.editor;return"function"==typeof r&&(r=r({col:t,row:e,dataValue:this.getCellOriginValue(t,e),value:this.getCellValue(t,e)||"",table:this})),Q(r)}changeCellValue(t,e,i){let o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(o&&this.isHasEditorDefine(t,e)||!1===o){const o=this.getRecordShowIndexByCell(t,e),{field:n}=this.internalProps.layoutMap.getBody(t,e),r=this.getCellRawValue(t,e),s=this.getCellOriginValue(t,e);this.isHeader(t,e)?this.internalProps.layoutMap.updateColumnTitle(t,e,i):this.dataSource.changeFieldValue(i,o,n,t,e,this);const l=this.getCellRange(t,e),a=this.internalProps.layoutMap.getAggregatorsByCell(t,e);if(a){if(Array.isArray(a))for(let t=0;t<(null==a?void 0:a.length);t++)a[t].recalculate();else a.recalculate();const t=this.internalProps.layoutMap.getAggregatorCellAddress(l.start.col,l.start.row,l.end.col,l.end.row);for(let e=0;e<t.length;e++){const i=this.getCellRange(t[e].col,t[e].row);for(let t=i.start.col;t<=i.end.col;t++)for(let e=i.start.row;e<=i.end.row;e++)this.scenegraph.updateCellContent(t,e)}}for(let t=l.start.col;t<=l.end.col;t++)for(let e=l.start.row;e<=l.end.row;e++)this.scenegraph.updateCellContent(t,e);if("adaptive"===this.widthMode||this.autoFillWidth&&this.getAllColsWidth()<=this.tableNoFrameWidth)0===this.internalProps._widthResizedColMap.size&&this.scenegraph.recalculateColWidths();else if(!this.internalProps._widthResizedColMap.has(t)){const e=this.getColWidth(t),i=IA(t,0,this.rowCount-1,this,!1);i!==e&&this.scenegraph.updateColWidth(t,i-e)}if("adaptive"===this.heightMode||this.autoFillHeight&&this.getAllRowsHeight()<=this.tableNoFrameHeight)0===this.internalProps._heightResizedRowMap.size&&this.scenegraph.recalculateRowHeights();else if("autoHeight"===this.heightMode&&!this.internalProps._heightResizedRowMap.has(e)){const t=this.getRowHeight(e),i=uS(e,0,this.colCount-1,this);this.scenegraph.updateRowHeight(e,i-t)}this.fireListeners(cw.CHANGE_CELL_VALUE,{col:t,row:e,rawValue:r,currentValue:s,changedValue:this.getCellOriginValue(t,e)}),this.scenegraph.updateNextFrame()}}changeCellValues(t,e,i){let o=arguments.length>3&&void 0!==arguments[3]&&arguments[3],n=t,r=e;const s=[],l=[];for(let o=0;o<i.length&&!(e+o>this.rowCount-1);o++){const n=i[o],r=[],a=[];s.push(r),l.push(a);for(let i=0;i<n.length&&!(t+i>this.colCount-1);i++){const n=this.getCellRawValue(t+i,e+o);r.push(n);const s=this.getCellOriginValue(t+i,e+o);a.push(s)}}for(let a=0;a<i.length&&!(e+a>this.rowCount-1);a++){r=e+a;const h=i[a];let d=t;for(let i=0;i<h.length&&!(t+i>this.colCount-1);i++)if(d=t+i,o&&this.isHasEditorDefine(t+i,e+a)||!1===o){const o=h[i],n=this.getRecordShowIndexByCell(t+i,e+a),{field:r}=this.internalProps.layoutMap.getBody(t+i,e+a),d=s[a][i],c=l[a][i];this.isHeader(t+i,e+a)?this.internalProps.layoutMap.updateColumnTitle(t+i,e+a,o):this.dataSource.changeFieldValue(o,n,r,t+i,e+a,this),this.fireListeners(cw.CHANGE_CELL_VALUE,{col:t+i,row:e+a,rawValue:d,currentValue:c,changedValue:this.getCellOriginValue(t+i,e+a)})}n=Math.max(n,d)}const a=this.getCellRange(t,e),h=this.getCellRange(n,r),d=this.internalProps.layoutMap.getAggregatorsByCellRange(a.start.col,a.start.row,h.end.col,h.end.row);if(d){for(let t=0;t<(null==d?void 0:d.length);t++)d[t].recalculate();const t=this.internalProps.layoutMap.getAggregatorCellAddress(a.start.col,a.start.row,h.end.col,h.end.row);for(let e=0;e<t.length;e++){const i=this.getCellRange(t[e].col,t[e].row);for(let t=i.start.col;t<=i.end.col;t++)for(let e=i.start.row;e<=i.end.row;e++)this.scenegraph.updateCellContent(t,e)}}for(let t=a.start.col;t<=h.end.col;t++)for(let e=a.start.row;e<=h.end.row;e++)this.scenegraph.updateCellContent(t,e);if("adaptive"===this.widthMode||this.autoFillWidth&&this.getAllColsWidth()<=this.tableNoFrameWidth)0===this.internalProps._widthResizedColMap.size&&this.scenegraph.recalculateColWidths();else for(let e=t;e<=h.end.col;e++)if(!this.internalProps._widthResizedColMap.has(e)){const t=this.getColWidth(e),i=IA(e,0,this.rowCount-1,this,!1);i!==t&&this.scenegraph.updateColWidth(e,i-t)}if("adaptive"===this.heightMode||this.autoFillHeight&&this.getAllRowsHeight()<=this.tableNoFrameHeight)this.scenegraph.recalculateRowHeights();else if("autoHeight"===this.heightMode){const t=[],i=[];for(let o=e;o<=h.end.row;o++)if(this.rowHeightsMap.get(o)){const e=this.getRowHeight(o),n=uS(o,0,this.colCount-1,this);t.push(o),i.push(n-e)}this.scenegraph.updateRowsHeight(t,i)}this.scenegraph.updateNextFrame()}addRecord(t,e){if(this.sortState)this.dataSource.addRecordForSorted(t),i_(this),this.refreshRowColCount(),this.scenegraph.clearCells(),this.scenegraph.createSceneGraph();else{(void 0===e||e>this.dataSource.sourceLength)&&(e=this.dataSource.sourceLength);const i=this.transpose?this.rowHeaderLevelCount:this.columnHeaderLevelCount;this.dataSource.addRecord(t,e);const o=this.rowCount;if(this.refreshRowColCount(),0===this.scenegraph.proxy.totalActualBodyRowCount)return this.scenegraph.clearCells(),void this.scenegraph.createSceneGraph();const n=this.transpose?this.colCount:this.rowCount;if(this.pagination){const{perPageCount:t,currentPage:r}=this.pagination,s=t*(r||0)+t;if(e<s)if(e<s-t)this.scenegraph.clearCells(),this.scenegraph.createSceneGraph();else{const r=e-(s-t)+i;if(o-i===this.pagination.perPageCount){const t=[];for(let e=r;e<n;e++)this.transpose?t.push({col:e,row:0}):t.push({col:0,row:e});this.transpose?this.scenegraph.updateCol([],[],t):this.scenegraph.updateRow([],[],t)}else{const t=[];for(let e=r;e<Math.min(n,r+1);e++)this.transpose?t.push({col:e,row:0}):t.push({col:0,row:e});this.transpose?this.scenegraph.updateCol([],t,[]):this.scenegraph.updateRow([],t,[])}}}else{const t=[];for(let o=e+i;o<e+i+1;o++)this.transpose?t.push({col:o,row:0}):t.push({col:0,row:o});this.transpose?this.scenegraph.updateCol([],t,[]):this.scenegraph.updateRow([],t,[])}}}addRecords(t,e){if(this.sortState)this.dataSource.addRecordsForSorted(t),i_(this),this.refreshRowColCount(),this.scenegraph.clearCells(),this.scenegraph.createSceneGraph();else{void 0===e||e>this.dataSource.sourceLength?e=this.dataSource.sourceLength:e<0&&(e=0);const i=this.transpose?this.rowHeaderLevelCount:this.columnHeaderLevelCount;this.dataSource.addRecords(t,e);const o=this.transpose?this.colCount:this.rowCount;if(this.refreshRowColCount(),0===this.scenegraph.proxy.totalActualBodyRowCount)return this.scenegraph.clearCells(),void this.scenegraph.createSceneGraph();const n=this.transpose?this.colCount:this.rowCount;if(this.pagination){const{perPageCount:r,currentPage:s}=this.pagination,l=r*(s||0)+r;if(e<l)if(e<l-r)this.scenegraph.clearCells(),this.scenegraph.createSceneGraph();else{const s=e-(l-r)+i;if(o-i===this.pagination.perPageCount){const t=[];for(let e=s;e<n;e++)this.transpose?t.push({col:e,row:0}):t.push({col:0,row:e});this.transpose?this.scenegraph.updateCol([],[],t):this.scenegraph.updateRow([],[],t)}else{const e=[];for(let i=s;i<Math.min(n,s+(Array.isArray(t)?t.length:1));i++)this.transpose?e.push({col:i,row:0}):e.push({col:0,row:i});this.transpose?this.scenegraph.updateCol([],e,[]):this.scenegraph.updateRow([],e,[])}}}else{const o=[];for(let n=e+i;n<e+i+(Array.isArray(t)?t.length:1);n++)this.transpose?o.push({col:n,row:0}):o.push({col:0,row:n});this.transpose?this.scenegraph.updateCol([],o,[]):this.scenegraph.updateRow([],o,[])}}}deleteRecords(t){if((null==t?void 0:t.length)>0)if(this.sortState)this.dataSource.deleteRecordsForSorted(t),i_(this),this.refreshRowColCount(),this.scenegraph.clearCells(),this.scenegraph.createSceneGraph();else{const e=this.dataSource.deleteRecords(t);if(0===e.length)return;const i=this.transpose?this.colCount:this.rowCount;this.refreshRowColCount();const o=this.transpose?this.colCount:this.rowCount,n=e.sort(((t,e)=>t-e)),r=n[0];if(this.pagination){const{perPageCount:t,currentPage:e}=this.pagination,n=t*(e||0)+t;if(r<n)if(r<n-t)this.scenegraph.clearCells(),this.scenegraph.createSceneGraph();else{const e=[],s=[];for(let i=r-(n-t)+(this.transpose?this.rowHeaderLevelCount:this.columnHeaderLevelCount);i<o;i++)this.transpose?e.push({col:i,row:0}):e.push({col:0,row:i});if(o<i)for(let t=o;t<i;t++)this.transpose?s.push({col:t,row:0}):s.push({col:0,row:t});this.transpose?this.scenegraph.updateCol(s,[],e):this.scenegraph.updateRow(s,[],e)}}else{const t=[];for(let e=0;e<n.length;e++){const i=n[e]+(this.transpose?this.rowHeaderLevelCount:this.columnHeaderLevelCount);this.transpose?t.push({col:i,row:0}):t.push({col:0,row:i})}this.transpose?this.scenegraph.updateCol(t,[],[]):this.scenegraph.updateRow(t,[],[])}}}updateRecords(t,e){if((null==e?void 0:e.length)>0)if(this.sortState)this.dataSource.updateRecordsForSorted(t,e),i_(this),this.refreshRowColCount(),this.scenegraph.clearCells(),this.scenegraph.createSceneGraph();else{const i=this.dataSource.updateRecords(t,e);if(0===i.length)return;const o=i.sort(((t,e)=>t-e));if(this.pagination){const{perPageCount:t,currentPage:e}=this.pagination,i=t*(e||0)+t,n=[];for(let e=0;e<o.length;e++){const r=o[e];if(r<i&&r>=i-t){const e=r-(i-t)+(this.transpose?this.rowHeaderLevelCount:this.columnHeaderLevelCount);n.push(e)}}if(n.length>=1){const t=[];for(let e=0;e<n.length;e++){const i=n[e];this.transpose?t.push({col:i,row:0}):t.push({col:0,row:i})}this.transpose?this.scenegraph.updateCol([],[],t):this.scenegraph.updateRow([],[],t)}}else{const t=[];for(let e=0;e<o.length;e++){const i=o[e]+(this.transpose?this.rowHeaderLevelCount:this.columnHeaderLevelCount);this.transpose?t.push({col:i,row:0}):t.push({col:0,row:i})}this.transpose?this.scenegraph.updateCol([],[],t):this.scenegraph.updateRow([],[],t)}}}_hasCustomRenderOrLayout(){var t,e,i,o;const{headerObjects:n}=this.internalProps.layoutMap;if(this.options.customRender)return!0;for(let r=0;r<n.length;r++){const s=n[r];if((null===(t=null==s?void 0:s.define)||void 0===t?void 0:t.customLayout)||(null===(e=null==s?void 0:s.define)||void 0===e?void 0:e.headerCustomLayout)||(null===(i=null==s?void 0:s.define)||void 0===i?void 0:i.customRender)||(null===(o=null==s?void 0:s.define)||void 0===o?void 0:o.headerCustomRender))return!0}return!1}getAggregateValuesByField(t){const e=this.internalProps.layoutMap.getColumnByField(t),i=[];for(let t=0;t<e.length;t++){const o=e[t].columnDefine.aggregator;if(delete e[t].columnDefine,o){const n={col:e[t].col,aggregateValue:null};if(n.aggregateValue=[],Array.isArray(o))for(let t=0;t<o.length;t++)n.aggregateValue.push({aggregationType:o[t].type,value:o[t].value()});else n.aggregateValue.push({aggregationType:o.type,value:o.value()});i.push(n)}}return i}isAggregation(t,e){return this.internalProps.layoutMap.isAggregation(t,e)}}function QM(t){return"bottom"===t||"top"===t}class tT{constructor(){this._scale=new zv,this._scales=[this._scale]}valueToPosition(t){return this._scale.scale(t)}getPosition(t){let e=0,i=this._scale;if(1===this._scales.length||1===t.length)e=this.valueToPosition(t[0]);else{const o=Math.min(t.length,this._scales.length);for(let i=0;i<o;i++)e+=this._scales[i].scale(t[i]);i=this._scales[o-1]}return{position:e,bandScale:i}}calcScales(t,e){var i,o;const{bandPadding:n,paddingInner:r,paddingOuter:s}=this,l=rt(n),a=rt(r),h=rt(s);for(let d=0;d<this._scales.length;d++){const c=l?n[d]:n,u=a?r[d]:r,g=h?s[d]:s;this._scales[d].paddingInner(null!==(i=null!=u?u:c)&&void 0!==i?i:t,!0).paddingOuter(null!==(o=null!=g?g:c)&&void 0!==o?o:e)}}dataToPosition(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};var i;if(0===t.length||0===this._scales.length)return 0;const{position:o,bandScale:n}=this.getPosition(t);return o+n.bandwidth()*(null!==(i=e.bandPosition)&&void 0!==i?i:.5)}updateScaleDomain(t){for(let e=0;e<this._scales.length;e++)this._scales[e].domain(t)}updateRange(t){const[e,i]=this._scale.range();t[0]===e&&t[1]===i||this._scale.range(t)}}const eT=Math.sqrt(50),iT=Math.sqrt(10),oT=Math.sqrt(2);class nT{constructor(t){this._extend={},this.type=null!=t?t:"linear",this._scale="log"===t?new ry:"symlog"===t?new sy:new iy,this._scales=[this._scale]}setExtraAttrFromSpec(t,e,i,o,n,r){this.nice=!1,this.zero=e,this.zero&&(i.min=Math.min(i.min,0),i.max=Math.max(i.max,0)),this.domain=i,this.expand=o,"log"===this.type?this._scale.base(null!=n?n:10):"symlog"===this.type&&this._scale.constant(null!=r?r:10)}transformScaleDomain(){"symlog"===this.type||"log"===this.type||this.setScaleNice()}setScaleNice(){"log"===this.type?this.setLogScaleNice():this.setLinearScaleNice()}setLogScaleNice(){var t,e,i,o,n,r;J(null===(t=this.domain)||void 0===t?void 0:t.min)&&J(null===(e=this.domain)||void 0===e?void 0:e.max)?this.nice&&this._scale.nice():Q(null===(i=this.domain)||void 0===i?void 0:i.min)&&J(null===(o=this.domain)||void 0===o?void 0:o.max)?this.nice&&this._scale.niceMax():J(null===(n=this.domain)||void 0===n?void 0:n.min)&&Q(null===(r=this.domain)||void 0===r?void 0:r.max)&&this.nice&&this._scale.niceMin()}setLinearScaleNice(){var t,e,i,o,n,r,s,l;let a=null!==(e=null!==(t=this.forceTickCount)&&void 0!==t?t:this.tickCount)&&void 0!==e?e:10;"accurateFirst"===this.niceType&&(a=Math.max(10,a)),J(null===(i=this.domain)||void 0===i?void 0:i.min)&&J(null===(o=this.domain)||void 0===o?void 0:o.max)?this.nice&&this._scale.nice(a):Q(null===(n=this.domain)||void 0===n?void 0:n.min)&&J(null===(r=this.domain)||void 0===r?void 0:r.max)?this.nice&&this._scale.niceMax(a):J(null===(s=this.domain)||void 0===s?void 0:s.min)&&Q(null===(l=this.domain)||void 0===l?void 0:l.max)?this.nice&&this._scale.niceMin(a):this.nice&&this._scale.nice(a)}dataToPosition(t){return this.valueToPosition(t[0])}valueToPosition(t){return this._scale.scale(t)}computeLinearDomain(t){const e=[];return t.forEach((t=>{const{min:i,max:o}=t;e[0]=void 0===e[0]?i:Math.min(e[0],i),e[1]=void 0===e[1]?o:Math.max(e[1],o)})),this.expandDomain(e),this.includeZero(e),this.setDomainMinMax(e),e}expandDomain(t){if(!this.expand)return;const e=t[0],i=t[t.length-1];Q(this.expand.min)&&(t[0]=e-(i-e)*this.expand.min),Q(this.expand.max)&&(t[t.length-1]=i+(i-e)*this.expand.max)}niceDomain(t){if(Q(t[0])||Q(t[1])||"linear"!==this.type)return t;if(Math.abs(Et(t)-Pt(t))<=1e-12){let e=t[0];const i=e>=0?1:-1;if(e=Math.abs(e),e<1)t[0]=0,t[1]=1;else{let i=e/5;const o=Math.floor(Math.log(i)/Math.LN10),n=i/Math.pow(10,o);i=(n>=eT?10:n>=iT?5:n>=oT?2:1)*Math.pow(10,o),t[0]=0,t[1]=10*i}i<0&&(t.reverse(),t[0]*=-1,t[1]*=-1)}return t}niceMinMax(){var t,e,i,o,n,r,s,l;if(this.nice){let a=null!==(e=null!==(t=this.forceTickCount)&&void 0!==t?t:this.tickCount)&&void 0!==e?e:10;"accurateFirst"===this.niceType&&(a=Math.max(10,a)),J(null===(i=this.domain)||void 0===i?void 0:i.min)&&J(null===(o=this.domain)||void 0===o?void 0:o.max)?this._scale.nice(a):Q(null===(n=this.domain)||void 0===n?void 0:n.min)&&J(null===(r=this.domain)||void 0===r?void 0:r.max)?this._scale.niceMax(a):J(null===(s=this.domain)||void 0===s?void 0:s.min)&&Q(null===(l=this.domain)||void 0===l?void 0:l.max)?this._scale.niceMin(a):this._scale.nice(a)}}includeZero(t){this.zero&&(t[0]=Math.min(t[0],0),t[t.length-1]=Math.max(t[t.length-1],0))}setExtendDomain(t,e){if(void 0===e)return void delete this._extend[t];this._extend[t]=e;const i=this._scale.domain();this.extendDomain(i),this.includeZero(i),this.setDomainMinMax(i),this.niceDomain(i),this._scale.domain(i,this.nice),this.niceMinMax()}extendDomain(t){let e;const i=t.length-1,o=t[0]-t[i]>0,n=o?i:0,r=o?0:i;for(const i in this._extend)e=this._extend[i],e>t[r]&&(t[r]=e),e<t[n]&&(t[n]=e)}setDomainMinMax(t){if(!this.domain)return;const{min:e,max:i}=this.domain;Q(e)&&(t[0]=e),Q(i)&&(t[1]=i)}setZero(t){this.zero!==t&&(this.zero=t,this.updateScaleDomain())}updateScaleDomain(){const t=this.computeDomain([this.domain]);this.updateScaleDomainByModel(t)}computeDomain(t){return this.computeLinearDomain(t)}updateScaleDomainByModel(t){t=null!=t?t:this._scale.domain(),this.extendDomain(t),this.includeZero(t),this.setDomainMinMax(t),this.niceDomain(t),this._scale.domain(t,this.nice),this.niceMinMax()}updateRange(t){const[e,i]=this._scale.range();t[0]===e&&t[1]===i||this._scale.range(t)}}function rT(t,e){var i;const o=e.option;mt(t)||(null===(i=null==o?void 0:o.label)||void 0===i?void 0:i.flush)&&function(t,e){const{width:i,height:o}=e.getLayoutRect(),n=QM(e.orient),r=!0===e.option.inverse,s=t[0],l=kt(t);if(n)if(r){const t=i,e=0,o=s.AABBBounds.x2,n=l.AABBBounds.x1;o>t&&s.setAttributes({x:t,textAlign:"right"}),n<e&&l.setAttributes({x:e,textAlign:"left"})}else{const t=0,e=i,o=s.AABBBounds.x1,n=l.AABBBounds.x2;o<t&&s.setAttributes({x:t,textAlign:"left"}),n>e&&l.setAttributes({x:e,textAlign:"right"})}else if(r){const t=s.AABBBounds.y1,e=l.AABBBounds.y2,i=0,n=o;t<i&&s.setAttributes({y:i,textBaseline:"top"}),e>n&&l.setAttributes({y:n,textBaseline:"bottom"})}else{const t=o,e=0,i=s.AABBBounds.y2,n=l.AABBBounds.y1;i>t&&s.setAttributes({y:t,textBaseline:"bottom"}),n<e&&l.setAttributes({y:e,textBaseline:"top"})}}(t,e)}const sT=t=>t;class lT{constructor(t,e,i,o,n){var r,s,l;if(this.x=0,this.y=0,this.table=n,this.orient=null!==(r=t.orient)&&void 0!==r?r:"left",this.type=null!==(s=t.type)&&void 0!==s?s:"band",this.option=St({},function(t){var e,i;return(null===(i=null===(e=null==t?void 0:t.colorScheme)||void 0===e?void 0:e.default)||void 0===i?void 0:i.palette)?St({},YM,{tick:{style:{stroke:t.colorScheme.default.palette.axisDomainColor||"#D9DDE4"}},subTick:{style:{stroke:t.colorScheme.default.palette.axisDomainColor||"#D9DDE4"}},label:{style:{fill:t.colorScheme.default.palette.axisLabelFontColor||"#89909D"}},title:{style:{fill:t.colorScheme.default.palette.secondaryFontColor||"#333333"}}}):YM}(t.__vtableChartTheme),function(t,e){let i;return"left"===t?i=e.axisStyle.leftAxisStyle:"right"===t?i=e.axisStyle.rightAxisStyle:"top"===t?i=e.axisStyle.topAxisStyle:"bottom"===t&&(i=e.axisStyle.bottomAxisStyle),St({},e.axisStyle.defaultAxisStyle,i)}(this.orient,n.theme),function(t,e,i){if(!i)return{};const o=i.axis;let n,r;return"linear"===e||"log"===e||"symlog"===e?n=i.axisLinear:"band"===e&&(n=i.axisBand),"top"===t||"bottom"===t?r=i.axisX:"left"!==t&&"right"!==t||(r=i.axisY),St({},o,n,r)}(this.orient,this.type,t.__vtableChartTheme),t),"left"===this.orient||"right"===this.orient){const t=0,n=0;this.width=e,this.height=i-o[2]-n,this.y=o[0]+t}else if("top"===this.orient||"bottom"===this.orient){const t=0,n=0;this.width=e-o[1]-n,this.height=i,this.x=o[3]+t}this.visible=null===(l=t.visible)||void 0===l||l,this.inverse="inverse"in t&&!!t.inverse,"band"===t.type&&(this.data=t.domain),this.initScale(),this.initData(),this.createComponent(),this.initEvent()}initScale(){const t=this.option;"band"===this.type||"point"===this.type?(this.scale=new tT,this.scale.bandPadding=t.bandPadding,this.scale.paddingInner=t.paddingInner,this.scale.paddingOuter=t.paddingOuter,this.scale.calcScales(.1,.3),this.scale.updateScaleDomain(this.data),this.updateScaleRange()):"linear"!==this.type&&"time"!==this.type&&"log"!==this.type&&"symlog"!==this.type||(this.scale=new nT(this.type),this.scale.setExtraAttrFromSpec(t.nice,t.zero,t.range,t.expand,t.base,t.constant),this.scale.transformScaleDomain(),this.scale.updateScaleDomain(),this.updateScaleRange())}initData(){var t,e,i;this.table._vDataSet||(this.table._vDataSet=new zM),function(t,e,i){t.getParser(e)||t.registerParser(e,i)}(this.table._vDataSet,"scale",sT),t=this.table._vDataSet,e="ticks",i=Cy,t.getTransform(e)||t.registerTransform(e,i);const o=this.option.label||{},n=this.option.tick||{},r=new IM(this.table._vDataSet).parse(this.scale._scale,{type:"scale"}).transform({type:"ticks",options:{sampling:!1!==this.option.sampling,tickCount:n.tickCount,forceTickCount:n.forceTickCount,tickStep:n.tickStep,tickMode:n.tickMode,noDecimals:n.noDecimals,axisOrientType:this.orient,coordinateType:"cartesian",labelStyle:o.style,labelFormatter:o.formatMethod,labelGap:o.minGap,labelLastVisible:o.lastVisible,labelFlush:o.flush}},!1);this.tickData=r,this.computeData()}computeData(){this.tickData.reRunAllTransform()}initEvent(){}createComponent(){const t=KM(this.option),e=this.getUpdateAttribute();e.verticalFactor="top"===this.orient||"right"===this.orient?-1:1,this.component=new pv(St({},t,e)),this.component.setAttributes(this.setLayoutStartPosition({x:0,y:0})),this.component.originAxis=this}resize(t,e){this.width=t,this.height=e,this.updateScaleRange(),this.computeData();const i=KM(this.option),o=this.getUpdateAttribute();o.verticalFactor="top"===this.orient||"right"===this.orient?-1:1,this.component.setAttributes(St({},i,o)),this.component.setAttributes(this.setLayoutStartPosition({x:0,y:0})),this.overlap()}overlap(){!function(t,e){const i=t.find((t=>"axis-label-container-layer-0"===t.name),!0),o=t.find((t=>"axis-label-container-layer-1"===t.name),!0);rT(i?i.getChildren():[],e),rT(o?o.getChildren():[],e)}(this.component,this)}getLayoutRect(){return{width:this.width,height:this.height}}getUpdateAttribute(){this.table.tableNoFrameHeight,this.table.tableNoFrameWidth;const{width:t,height:e}=this.getLayoutRect(),i=QM(this.orient),o="left"===(n=this.orient)||"right"===n;var n;let r={x:0,y:0},s=0;i?(r={x:t,y:0},s=t):o&&(r={x:0,y:e},s=e);const l="top"===this.orient||"bottom"===this.orient?e:t;return{start:{x:this.x,y:this.y},end:r,title:{text:this.option.title.text,maxWidth:this._getTitleLimit(i)},items:this.getLabelItems(s),verticalLimitSize:l,verticalMinSize:l}}getLabelItems(t){return[this.tickData.latestData.map((e=>({id:e.value,label:e.value,value:0===t?0:this.scale.dataToPosition([e.value])/t,rawValue:e.value}))).filter((t=>t.value>=0&&t.value<=1))]}updateScaleRange(){var t,e,i,o,n,r,s,l;const a=null!==(e=null===(t=this.option.innerOffset)||void 0===t?void 0:t.right)&&void 0!==e?e:0,h=null!==(o=null===(i=this.option.innerOffset)||void 0===i?void 0:i.left)&&void 0!==o?o:0,d=null!==(r=null===(n=this.option.innerOffset)||void 0===n?void 0:n.top)&&void 0!==r?r:0,c=null!==(l=null===(s=this.option.innerOffset)||void 0===s?void 0:s.bottom)&&void 0!==l?l:0,{width:u,height:g}=this.getLayoutRect(),p=this.option.inverse||!1;let f=[0,0];QM(this.orient)?ht(u)&&(f=p?[u-a,h]:[h,u-a]):ht(g)&&(f=p?[d,g-c]:[g-c,d]),this.scale.updateRange(f)}setLayoutStartPosition(t){let{x:e,y:i}=t;return ht(e)&&(e+=Number("left"===this.orient)*this.getLayoutRect().width),ht(i)&&(i+=Number("top"===this.orient)*this.getLayoutRect().height),{x:e,y:i}}_getTitleLimit(t){var e,i,o;if(this.option.title.visible&&J(null===(e=this.option.title.style)||void 0===e?void 0:e.maxLineWidth)){let e=(null===(i=this.option.title.style)||void 0===i?void 0:i.angle)||0;if((null===(o=this.option.title)||void 0===o?void 0:o.autoRotate)&&J(this.option.title.angle)&&(e="left"===this.option.orient?-90:90),t){const t=this.getLayoutRect().width,i=Math.abs(Math.cos(we(e)));return i<1e-6?1/0:t/i}const n=this.getLayoutRect().height,r=Math.abs(Math.sin(we(e)));return r<1e-6?1/0:n/r}return null}getScale(){return this.scale._scale}getDomainSpec(){return this.scale.domain}}function aT(t,e){var i,o,n,r,s,l,a,h,d,c,u,g,p,f,m,b;const v=St({},YM,t);let y=0;!1!==v.tick.visible&&(y=null!==(i=v.tick.width)&&void 0!==i?i:4);let C=0;if(v.label.visible){if("band"===v.type)v.domain.forEach((t=>{var i,o,n,r,s,l,a,h,d,c,u,g,p,f,m,b;v.label.formatMethod&&(t=v.label.formatMethod(t));const{width:y,height:w}=e.measureText(t,{fontSize:null!==(n=null===(o=null===(i=v.label)||void 0===i?void 0:i.style)||void 0===o?void 0:o.fontSize)&&void 0!==n?n:UM,fontWeight:null!==(l=null===(s=null===(r=v.label)||void 0===r?void 0:r.style)||void 0===s?void 0:s.fontWeight)&&void 0!==l?l:"normal",fontFamily:null!==(d=null===(h=null===(a=v.label)||void 0===a?void 0:a.style)||void 0===h?void 0:h.fontFamily)&&void 0!==d?d:VM}),x=(null===(u=null===(c=v.label)||void 0===c?void 0:c.style)||void 0===u?void 0:u.maxLineWidth)||1/0,_=(null!==(f=null===(p=null===(g=v.label)||void 0===g?void 0:g.style)||void 0===p?void 0:p.angle)&&void 0!==f?f:0)+("vertical"===(null===(b=null===(m=v.label)||void 0===m?void 0:m.style)||void 0===b?void 0:b.direction)?90:0);C=Math.max(C,cT(Math.min(y,x),w,_).width)}));else{let i;if(rt(t.__ticksForVTable))i=t.__ticksForVTable;else{const t=v.range,e=Math.abs(t.min)>1?Math.round(t.min):t.min,o=Math.abs(t.max)>1?Math.round(t.max):t.max;i=[dT(e),dT(o)]}i.forEach((t=>{var i,o,n,r,s,l,a,h,d,c,u,g,p,f,m,b;v.label.formatMethod&&(t=v.label.formatMethod(t));const{width:y,height:w}=e.measureText(t,{fontSize:null!==(n=null===(o=null===(i=v.label)||void 0===i?void 0:i.style)||void 0===o?void 0:o.fontSize)&&void 0!==n?n:UM,fontWeight:null!==(l=null===(s=null===(r=v.label)||void 0===r?void 0:r.style)||void 0===s?void 0:s.fontWeight)&&void 0!==l?l:"normal",fontFamily:null!==(d=null===(h=null===(a=v.label)||void 0===a?void 0:a.style)||void 0===h?void 0:h.fontFamily)&&void 0!==d?d:VM}),x=(null===(u=null===(c=v.label)||void 0===c?void 0:c.style)||void 0===u?void 0:u.maxLineWidth)||1/0,_=(null!==(f=null===(p=null===(g=v.label)||void 0===g?void 0:g.style)||void 0===p?void 0:p.angle)&&void 0!==f?f:0)+("vertical"===(null===(b=null===(m=v.label)||void 0===m?void 0:m.style)||void 0===b?void 0:b.direction)?90:0);C=Math.max(C,cT(Math.min(y,x),w,_).width)}))}C+=null!==(o=v.label.space)&&void 0!==o?o:4}let w=0;if(v.title.visible&&nt(v.title.text)){const{width:i,height:o}=e.measureText(v.title.text,{fontSize:null!==(s=null===(r=null===(n=v.title)||void 0===n?void 0:n.style)||void 0===r?void 0:r.fontSize)&&void 0!==s?s:UM,fontWeight:null!==(h=null===(a=null===(l=v.title)||void 0===l?void 0:l.style)||void 0===a?void 0:a.fontWeight)&&void 0!==h?h:"normal",fontFamily:null!==(u=null===(c=null===(d=v.title)||void 0===d?void 0:d.style)||void 0===c?void 0:c.fontFamily)&&void 0!==u?u:VM}),y=(null===(p=null===(g=v.label)||void 0===g?void 0:g.style)||void 0===p?void 0:p.maxLineWidth)||1/0,C=cT(Math.min(i,y),o,null===(m=null===(f=v.title)||void 0===f?void 0:f.style)||void 0===m?void 0:m.angle);w="left"!==t.orient&&"right"!==t.orient||!v.title.autoRotate?C.width:C.height,w+=null!==(b=v.title.space)&&void 0!==b?b:4}return y+C+w+1}function hT(t,e){var i,o,n,r,s,l,a,h,d,c,u,g,p,f,m,b;const v=St({},YM,t);let y=0;!1!==v.tick.visible&&(y=null!==(i=v.tick.width)&&void 0!==i?i:4);let C=0;if(v.label.visible){if("band"===v.type)v.domain.forEach((t=>{var i,o,n,r,s,l,a,h,d,c,u,g,p,f,m,b;v.label.formatMethod&&(t=v.label.formatMethod(t));const{width:y,height:w}=e.measureText(t,{fontSize:null!==(n=null===(o=null===(i=v.label)||void 0===i?void 0:i.style)||void 0===o?void 0:o.fontSize)&&void 0!==n?n:UM,fontWeight:null!==(l=null===(s=null===(r=v.label)||void 0===r?void 0:r.style)||void 0===s?void 0:s.fontWeight)&&void 0!==l?l:"normal",fontFamily:null!==(d=null===(h=null===(a=v.label)||void 0===a?void 0:a.style)||void 0===h?void 0:h.fontFamily)&&void 0!==d?d:VM}),x=(null===(u=null===(c=v.label)||void 0===c?void 0:c.style)||void 0===u?void 0:u.maxLineWidth)||1/0,_=(null!==(f=null===(p=null===(g=v.label)||void 0===g?void 0:g.style)||void 0===p?void 0:p.angle)&&void 0!==f?f:0)+("vertical"===(null===(b=null===(m=v.label)||void 0===m?void 0:m.style)||void 0===b?void 0:b.direction)?90:0);C=Math.max(C,cT(Math.min(y,x),w,_).height)}));else{let i;if(rt(t.__ticksForVTable))i=t.__ticksForVTable;else{const t=v.range,e=Math.abs(t.min)>1?Math.round(t.min):t.min,o=Math.abs(t.max)>1?Math.round(t.max):t.max;i=[dT(e),dT(o)]}i.forEach((t=>{var i,o,n,r,s,l,a,h,d,c,u,g,p,f,m,b;v.label.formatMethod&&(t=v.label.formatMethod(t));const{width:y,height:w}=e.measureText(t,{fontSize:null!==(n=null===(o=null===(i=v.label)||void 0===i?void 0:i.style)||void 0===o?void 0:o.fontSize)&&void 0!==n?n:UM,fontWeight:null!==(l=null===(s=null===(r=v.label)||void 0===r?void 0:r.style)||void 0===s?void 0:s.fontWeight)&&void 0!==l?l:"normal",fontFamily:null!==(d=null===(h=null===(a=v.label)||void 0===a?void 0:a.style)||void 0===h?void 0:h.fontFamily)&&void 0!==d?d:VM}),x=(null===(u=null===(c=v.label)||void 0===c?void 0:c.style)||void 0===u?void 0:u.maxLineWidth)||1/0,_=(null!==(f=null===(p=null===(g=v.label)||void 0===g?void 0:g.style)||void 0===p?void 0:p.angle)&&void 0!==f?f:0)+("vertical"===(null===(b=null===(m=v.label)||void 0===m?void 0:m.style)||void 0===b?void 0:b.direction)?90:0);C=Math.max(C,cT(Math.min(y,x),w,_).height)}))}C+=null!==(o=v.label.space)&&void 0!==o?o:4}let w=0;if(v.title.visible&&v.title.text){const{width:i,height:o}=e.measureText(v.title.text,{fontSize:null!==(s=null===(r=null===(n=v.title)||void 0===n?void 0:n.style)||void 0===r?void 0:r.fontSize)&&void 0!==s?s:UM,fontWeight:null!==(h=null===(a=null===(l=v.title)||void 0===l?void 0:l.style)||void 0===a?void 0:a.fontWeight)&&void 0!==h?h:"normal",fontFamily:null!==(u=null===(c=null===(d=v.title)||void 0===d?void 0:d.style)||void 0===c?void 0:c.fontFamily)&&void 0!==u?u:VM}),y=(null===(p=null===(g=v.label)||void 0===g?void 0:g.style)||void 0===p?void 0:p.maxLineWidth)||1/0,C=cT(Math.min(i,y),o,null===(m=null===(f=v.title)||void 0===f?void 0:f.style)||void 0===m?void 0:m.angle);w="bottom"!==t.orient&&"top"!==t.orient||!v.title.autoRotate?C.height:C.width,w+=null!==(b=v.title.space)&&void 0!==b?b:4}return y+C+w+1}function dT(t){return"number"!=typeof t&&(t=Number(t)),Number(t.toPrecision(1)).toString()}function cT(t,e){const i=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:0)*Math.PI/180,o=-t/2,n=-e/2,r=t/2,s=-e/2,l=t/2,a=e/2,h=-t/2,d=e/2,c={x:o*Math.cos(i)-n*Math.sin(i),y:o*Math.sin(i)+n*Math.cos(i)},u={x:r*Math.cos(i)-s*Math.sin(i),y:r*Math.sin(i)+s*Math.cos(i)},g={x:l*Math.cos(i)-a*Math.sin(i),y:l*Math.sin(i)+a*Math.cos(i)},p={x:h*Math.cos(i)-d*Math.sin(i),y:h*Math.sin(i)+d*Math.cos(i)},f=Math.min(c.x,u.x,g.x,p.x),m=Math.max(c.x,u.x,g.x,p.x),b=Math.min(c.y,u.y,g.y,p.y);return{width:m-f,height:Math.max(c.y,u.y,g.y,p.y)-b}}class uT{constructor(t,e){this._emptyTipOption={spaceBetweenTextAndIcon:20,text:"no data",textStyle:{fontSize:14,color:"#000"},icon:{image:'<svg t="1716726614852" class="icon" viewBox="0 0 1194 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2621" width="200" height="200"><path d="M1038.694079 367.237067c13.265507 23.342857-16.633865-40.004445-63.05621-40.004446H219.018794c-26.558738 0-46.46393 13.334815-63.05621 40.004446S0.006238 607.277601 0.006238 650.608819V940.647979a82.351494 82.351494 0 0 0 82.961402 83.349526H1111.702885a82.337632 82.337632 0 0 0 82.975264-83.349526V650.608819c0-43.331218-155.970208-283.371753-155.970208-283.371752zM730.066575 667.284269a136.328386 136.328386 0 0 1-132.738243 133.33429 133.417459 133.417459 0 0 1-132.738243-133.33429v-6.681269a40.6698 40.6698 0 0 0-36.497473-26.66963H73.015044l119.458874-220.02445s23.231965-40.004445 53.103614-40.004446h713.481918c26.544876 0 29.871649 10.008042 46.436207 40.004446L1128.33675 633.947231H769.904682c-26.184476 0-39.838107 7.623855-39.838107 33.337038zM338.505391 210.559919l-89.601086-86.69016a22.178487 22.178487 0 0 1 0-33.26773 21.984425 21.984425 0 0 1 33.170699 0l89.601087 86.676299a22.317102 22.317102 0 0 1 0 33.26773 24.950798 24.950798 0 0 1-33.1707 0z m252.197118-40.059891a25.532983 25.532983 0 0 1-6.639685-16.633865l-3.326773-126.694606A28.263709 28.263709 0 0 1 603.995739 0.515788c13.251646-3.326773 23.204242 10.021904 26.544877 23.342858V153.866163a28.249847 28.249847 0 0 1-23.259688 26.66963c-6.611961-3.312911-13.279369-3.312911-16.578419-10.035765z m235.646421 33.337038a22.372548 22.372548 0 0 1 0-33.337038l86.288175-90.030795a22.039871 22.039871 0 0 1 33.170699 0 22.289379 22.289379 0 0 1 0 33.364761l-82.961401 90.003072a25.962691 25.962691 0 0 1-36.483611 0z" fill="#8a8a8a" p-id="2622"></path></svg>',width:100,height:100}},this.isReleased=!1,this.table=e,this._emptyTipOption=Object.assign(this._emptyTipOption,!0===t?{}:t),this._emptyTipComponent=this._createOrUpdateEmptyTipComponent(this._getEmptyTipAttrs())}_createOrUpdateEmptyTipComponent(t){if(this._emptyTipComponent)Rt(t,this._cacheAttrs)||this._emptyTipComponent.setAttributes(t);else{const e=new $y(t);e.name="emptyTip",this.table.scenegraph.stage.defaultLayer.appendChild(e),this._emptyTipComponent=e}return this._emptyTipComponent}resize(){var t;if(!this._emptyTipComponent)return;const e=this.table.transpose||!1===this.table.options.indicatorsAsCol?this.table.getFrozenColsWidth():0,i=!this.table.transpose||this.table.options.indicatorsAsCol?this.table.getFrozenRowsHeight():0,o=(this.table.columnHeaderLevelCount>0&&this.table.isListTable()?this.table.getDrawRange().width:this.table.tableNoFrameWidth)-e,n=(this.table.rowHeaderLevelCount>0&&this.table.isListTable()?this.table.getDrawRange().height:this.table.tableNoFrameHeight)-i;this._emptyTipComponent.setAttributes({spaceBetweenTextAndIcon:this._emptyTipOption.spaceBetweenTextAndIcon,x:this.table.tableX+e,y:this.table.tableY+i,width:o,height:n,text:Object.assign(Object.assign({text:this._emptyTipOption.text},this._emptyTipOption.textStyle),{fill:null===(t=this._emptyTipOption.textStyle)||void 0===t?void 0:t.color}),icon:Object.assign({},this._emptyTipOption.icon)})}release(){this._emptyTipComponent&&this.table.scenegraph.stage.defaultLayer.removeChild(this._emptyTipComponent),this._emptyTipComponent=null,this.isReleased=!0}resetVisible(){(this.table.recordsCount&&0!==this.table.recordsCount||this.table.internalProps.layoutMap.rowCount!==this.table.internalProps.layoutMap.columnHeaderLevelCount)&&this.table.internalProps.layoutMap.colCount!==this.table.internalProps.layoutMap.rowHeaderLevelCount?this.table.scenegraph.stage.defaultLayer.children.includes(this._emptyTipComponent)&&this.table.scenegraph.stage.defaultLayer.removeChild(this._emptyTipComponent):this.table.scenegraph.stage.defaultLayer.children.includes(this._emptyTipComponent)||this.table.scenegraph.stage.defaultLayer.appendChild(this._emptyTipComponent)}_getEmptyTipAttrs(){var t;const e=this.table.transpose||!1===this.table.options.indicatorsAsCol?this.table.getFrozenColsWidth():0,i=!this.table.transpose||this.table.options.indicatorsAsCol?this.table.getFrozenRowsHeight():0,o=(this.table.columnHeaderLevelCount>0&&this.table.isListTable()?this.table.getDrawRange().width:this.table.tableNoFrameWidth)-e,n=(this.table.rowHeaderLevelCount>0&&this.table.isListTable()?this.table.getDrawRange().height:this.table.tableNoFrameHeight)-i;return{spaceBetweenTextAndIcon:this._emptyTipOption.spaceBetweenTextAndIcon,x:this.table.tableX+e,y:this.table.tableY+i,width:o,height:n,text:Object.assign(Object.assign({text:this._emptyTipOption.text},this._emptyTipOption.textStyle),{fill:null===(t=this._emptyTipOption.textStyle)||void 0===t?void 0:t.color}),icon:Object.assign({},this._emptyTipOption.icon)}}}var gT=function(t,e){var i={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(i[o]=t[o]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(o=Object.getOwnPropertySymbols(t);n<o.length;n++)e.indexOf(o[n])<0&&Object.prototype.propertyIsEnumerable.call(t,o[n])&&(i[o[n]]=t[o[n]])}return i};const pT={orient:"bottom",position:"middle",padding:30,title:{visible:!1,padding:0,textStyle:{fontSize:14,fill:"#000000",fontWeight:"normal"},space:12},item:{visible:!0,spaceCol:10,spaceRow:10,padding:2,background:{state:{selectedHover:{fill:"gray",fillOpacity:.7},unSelectedHover:{fill:"gray",fillOpacity:.2}}},shape:{space:4,state:{unSelected:{fillOpacity:.5}}},label:{space:4,style:{fill:"#89909D",fontSize:14},state:{unSelected:{fillOpacity:.5}}}},allowAllCanceled:!0,visible:!0};class fT{constructor(t,e){var i,o,n,r;this.table=e,this.option=Ct(t),this.orient=null!==(i=t.orient)&&void 0!==i?i:"left",this.visible=null===(o=t.visible)||void 0===o||o,this.position=null!==(n=t.position)&&void 0!==n?n:"middle",this.selectedData=null!==(r=t.defaultSelected)&&void 0!==r?r:null,this.createComponent(),this.initEvent()}createComponent(){const t=this.getLegendAttributes({width:this.table.tableNoFrameWidth,height:this.table.tableNoFrameHeight}),e=new zy(St({},t,{defaultSelected:this.selectedData}));e.name="legend",this.legendComponent=e,this.table.scenegraph.stage.defaultLayer.appendChild(e),this.adjustTableSize(t)}resize(){this.legendComponent&&(this.legendComponent.setAttributes({width:this.table.tableNoFrameWidth,height:this.table.tableNoFrameHeight}),this.adjustTableSize(this.legendComponent.attribute))}adjustTableSize(t){var e,i;let o=isFinite(this.legendComponent.AABBBounds.width())?this.legendComponent.AABBBounds.width():0,n=isFinite(this.legendComponent.AABBBounds.height())?this.legendComponent.AABBBounds.height():0;if(o<=0||n<=0)return;const r=this.table.tableNoFrameWidth,s=this.table.tableNoFrameHeight,l=vx(null!==(i=null!==(e=t.padding)&&void 0!==e?e:this.option.padding)&&void 0!==i?i:10);let a=0,h=0;"left"===this.orient?(a=l[3],h=0,o+=l[1]+l[3]):"top"===this.orient?(a=0,h=l[0],n+=l[0]+l[2]):"right"===this.orient?(a=r-o-l[1],h=0,o+=l[1]+l[3]):"bottom"===this.orient&&(a=0,h=s-n-l[2],n+=l[0]+l[2]);const d="bottom"===this.orient||"top"===this.orient?"horizontal":"vertical",c=this.position;let u=0,g=0;"horizontal"===d?u="middle"===c?(r-o)/2:"end"===c?r-o-l[1]:l[3]:g="middle"===c?(s-n)/2:"end"===c?s-n-l[2]:l[0],this.legendComponent.setAttributes({dx:u,dy:g,x:a,y:h}),"left"===this.orient?(this.table.tableNoFrameWidth=this.table.tableNoFrameWidth-Math.ceil(o),this.table.tableX+=Math.ceil(o)):"top"===this.orient?(this.table.tableNoFrameHeight=this.table.tableNoFrameHeight-Math.ceil(n),this.table.tableY+=Math.ceil(n)):"right"===this.orient?this.table.tableNoFrameWidth=this.table.tableNoFrameWidth-Math.ceil(o):"bottom"===this.orient&&(this.table.tableNoFrameHeight=this.table.tableNoFrameHeight-Math.ceil(n))}getLegendAttributes(t){const e="bottom"===this.orient||"top"===this.orient?"horizontal":"vertical";return Object.assign({layout:e,items:this.getLegendItems(),maxWidth:t.width,maxHeight:t.height},function(t,e){const i=St({},pT,t),{title:o={},item:n={},pager:r={},background:s={},type:l,id:a,visible:h,orient:d,position:c,data:u,filter:g,regionId:p,regionIndex:f,seriesIndex:m,seriesId:b,padding:v}=i,y=gT(i,["title","item","pager","background","type","id","visible","orient","position","data","filter","regionId","regionIndex","seriesIndex","seriesId","padding"]);return o.visible&&(y.title=DM(o)),mt(n.focusIconStyle)||WM(n.focusIconStyle),NM(n.shape),NM(n.label),NM(n.value),NM(n.background),qx(n.maxWidth)&&(n.maxWidth=Number(n.maxWidth.substring(0,n.maxWidth.length-1))*e.width/100),qx(n.width)&&(n.width=Number(n.width.substring(0,n.width.length-1))*e.width/100),qx(n.height)&&(n.height=Number(n.height.substring(0,n.height.length-1))*e.width/100),y.item=n,mt(r.textStyle)||WM(r.textStyle),NM(r.handler),y.pager=r,s.visible&&!mt(s.style)&&(St(y,s.style),Q(s.padding)&&(y.padding=s.padding)),y}(this.option,t))}getLegendItems(){return this.option.data}initEvent(){this.legendComponent&&(this.legendComponent.addEventListener(My.legendItemClick,(t=>{const e=bt(t,"detail.currentSelected");this.table.fireListeners(cw.LEGEND_ITEM_CLICK,{model:this,value:e,event:t})})),this.legendComponent.addEventListener(My.legendItemHover,(t=>{const e=bt(t,"detail");this.table.fireListeners(cw.LEGEND_ITEM_HOVER,{model:this,value:e,event:t})})),this.legendComponent.addEventListener(My.legendItemUnHover,(t=>{const e=bt(t,"detail");this.table.fireListeners(cw.LEGEND_ITEM_UNHOVER,{model:this,value:e,event:t})})),this.legendComponent.addEventListener("legendItemAttributeUpdate",(t=>{this.table.scenegraph.updateNextFrame()})))}getLegendBounds(){return{width:isFinite(this.legendComponent.AABBBounds.width())?this.legendComponent.AABBBounds.width():0,height:isFinite(this.legendComponent.AABBBounds.height())?this.legendComponent.AABBBounds.height():0}}release(){this.legendComponent&&this.table.scenegraph.stage.defaultLayer.removeChild(this.legendComponent),this.legendComponent=null}}var mT=function(t,e){var i={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(i[o]=t[o]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(o=Object.getOwnPropertySymbols(t);n<o.length;n++)e.indexOf(o[n])<0&&Object.prototype.propertyIsEnumerable.call(t,o[n])&&(i[o[n]]=t[o[n]])}return i};const bT={orient:"right",position:"middle",padding:30,title:{visible:!1,padding:0,textStyle:{fontSize:14,fontWeight:"normal",fill:{type:"palette",key:"titleFontColor"}},space:12},handler:{visible:!0},startText:{style:{fontSize:14,fontWeight:"normal",fill:{type:"palette",key:"labelFontColor"}}},endText:{style:{fontSize:14,fontWeight:"normal",fill:{type:"palette",key:"labelFontColor"}}},handlerText:{style:{fontSize:14,fontWeight:"normal",fill:{type:"palette",key:"labelFontColor"}}}},vT={horizontal:Object.assign(Object.assign({},bT),{rail:{width:200,height:8,style:{fill:"rgba(0,0,0,0.04)"}}}),vertical:Object.assign(Object.assign({},bT),{rail:{width:8,height:200,style:{fill:"rgba(0,0,0,0.04)"}}})},yT={horizontal:Object.assign({sizeBackground:{fill:"#cdcdcd"},track:{style:{fill:"rgba(20,20,20,0.1)"}},rail:{width:200,height:4,style:{fill:"rgba(0,0,0,0.04)"}}},bT),vertical:Object.assign({sizeBackground:{fill:"#cdcdcd"},track:{style:{fill:"rgba(20,20,20,0.1)"}},rail:{width:4,height:200,style:{fill:"rgba(0,0,0,0.04)"}}},bT)};class CT{constructor(t,e){var i,o,n,r;this.table=e,this.option=Ct(t),this.orient=null!==(i=t.orient)&&void 0!==i?i:"left",this.visible=null===(o=t.visible)||void 0===o||o,this.position=null!==(n=t.position)&&void 0!==n?n:"middle",this.selectedData=null!==(r=t.defaultSelected)&&void 0!==r?r:null,this.createComponent(),this.initEvent()}createComponent(){const t=this.getLegendAttributes({width:this.table.tableNoFrameWidth,height:this.table.tableNoFrameHeight});let e;e="color"===this.option.type?new Wy(St({},t,{slidable:!0})):new Gy(St({},t,{slidable:!0})),e.name="legend",this.legendComponent=e,this.table.scenegraph.stage.defaultLayer.appendChild(e),this.adjustTableSize(t)}resize(){this.legendComponent&&(this.legendComponent.setAttributes({width:this.table.tableNoFrameWidth,height:this.table.tableNoFrameHeight}),this.adjustTableSize(this.legendComponent.attribute))}adjustTableSize(t){var e,i;let o=isFinite(this.legendComponent.AABBBounds.width())?this.legendComponent.AABBBounds.width():0,n=isFinite(this.legendComponent.AABBBounds.height())?this.legendComponent.AABBBounds.height():0;if(o<=0||n<=0)return;const r=this.table.tableNoFrameWidth,s=this.table.tableNoFrameHeight,l=vx(null!==(i=null!==(e=t.padding)&&void 0!==e?e:this.option.padding)&&void 0!==i?i:10);let a=0,h=0;"left"===this.orient?(a=l[3],h=0,o+=l[1]+l[3]):"top"===this.orient?(a=0,h=l[0],n+=l[0]+l[2]):"right"===this.orient?(a=r-o-l[1],h=0,o+=l[1]+l[3]):"bottom"===this.orient&&(a=0,h=s-n-l[2],n+=l[0]+l[2]);const d="bottom"===this.orient||"top"===this.orient?"horizontal":"vertical",c=this.position;let u=0,g=0;"horizontal"===d?u="middle"===c?(r-o)/2:"end"===c?r-o-l[1]:l[3]:g="middle"===c?(s-n)/2:"end"===c?s-n-l[2]:l[0],this.legendComponent.setAttributes({dx:u,dy:g,x:a,y:h}),"left"===this.orient?(this.table.tableNoFrameWidth=this.table.tableNoFrameWidth-Math.ceil(o),this.table.tableX+=Math.ceil(o)):"top"===this.orient?(this.table.tableNoFrameHeight=this.table.tableNoFrameHeight-Math.ceil(n),this.table.tableY+=Math.ceil(n)):"right"===this.orient?this.table.tableNoFrameWidth=this.table.tableNoFrameWidth-Math.ceil(o):"bottom"===this.orient&&(this.table.tableNoFrameHeight=this.table.tableNoFrameHeight-Math.ceil(n))}getLegendAttributes(t){const e="bottom"===this.orient||"top"===this.orient?"horizontal":"vertical",i="horizontal"===e?"bottom":this.orient;return Object.assign(Object.assign({},function(t,e){const i=St({},("color"===t.type?vT:yT)["bottom"===t.orient||"top"===t.orient?"horizontal":"vertical"],t),{title:o={},handler:n={},rail:r={},track:s={},startText:l,endText:a,handlerText:h,sizeBackground:d,background:c={},type:u,id:g,visible:p,orient:f,position:m,data:b,defaultSelected:v,field:y,filter:C,regionId:w,regionIndex:x,seriesIndex:_,seriesId:S,padding:A}=i,B=mT(i,["title","handler","rail","track","startText","endText","handlerText","sizeBackground","background","type","id","visible","orient","position","data","defaultSelected","field","filter","regionId","regionIndex","seriesIndex","seriesId","padding"]);return o.visible&&(B.title=DM(o)),B.showHandler=!1!==n.visible,mt(n.style)||(B.handlerStyle=WM(n.style)),Q(r.width)&&(B.railWidth=r.width),Q(r.height)&&(B.railHeight=r.height),mt(r.style)||(B.railStyle=WM(r.style)),mt(s.style)||(B.trackStyle=WM(s.style)),B.startText=NM(l),B.endText=NM(a),B.handlerText=NM(h),mt(d)||(B.sizeBackground=WM(d)),c.visible&&!mt(c.style)&&(St(B,c.style),Q(c.padding)&&(B.padding=c.padding)),B}(this.option)),{layout:e,align:i,min:this.option.min,max:this.option.max,value:this.option.value,["color"===this.option.type?"colors":"sizeRange"]:"color"===this.option.type?this.option.colors:this.option.sizeRange})}initEvent(){this.legendComponent&&this.legendComponent.addEventListener("change",(t=>{const e=bt(t,"detail.value");this.table.fireListeners(cw.LEGEND_CHANGE,{model:this,value:e,event:t}),this.table.scenegraph.updateNextFrame()}))}getLegendBounds(){return{width:isFinite(this.legendComponent.AABBBounds.width())?this.legendComponent.AABBBounds.width():0,height:isFinite(this.legendComponent.AABBBounds.height())?this.legendComponent.AABBBounds.height():0}}release(){this.legendComponent&&this.table.scenegraph.stage.defaultLayer.removeChild(this.legendComponent),this.legendComponent=null}}function wT(t,e){return"color"===t.type||"size"===t.type?new CT(t,e):new fT(t,e)}class xT{constructor(t){this._table=t}release(){this.unbindMenuElement(),this._menuElement&&this._menuElement.release(),this._menuElement=void 0}_getMenuElement(){return this._menuElement||(this._menuElement=this.createMenuElementInternal()),this._menuElement}bindMenuElement(t,e,i){return this._getMenuElement().bindToCell(this._table,t,e,i)}unbindMenuElement(){this._getMenuElement().unbindFromCell()}pointInMenuElement(t,e){return this._getMenuElement().pointInMenuElement(t,e)}}const _T="vtable__menu-element",ST=`${_T}--hidden`,AT=`${_T}--shown`;class BT{constructor(t){var e,i,o;this._handler=new fw,this._rootElement=kR("div",[_T,ST]),this._rootElement.addEventListener("wheel",(t=>{t.stopPropagation()})),null===(e=this._rootElement)||void 0===e||e.addEventListener("mousedown",(t=>{t.stopPropagation(),t.preventDefault()})),null===(i=this._rootElement)||void 0===i||i.addEventListener("click",(e=>{if(e.stopPropagation(),e.preventDefault(),this._rootElement.classList.contains(ST))return;const{col:i,row:o,dropDownIndex:n,menuKey:r,text:s,hasChildren:l}=e.target;if("number"!=typeof n||l)return void e.stopPropagation();const a=t.isPivotTable()?t.internalProps.layoutMap.getPivotDimensionInfo(i,o):t.getHeaderField(i,o),h=t._dropDownMenuIsHighlight(i,o,n);t.fireListeners(cw.DROPDOWN_MENU_CLICK,{col:i,row:o,field:a,menuKey:r,text:s,highlight:h,cellLocation:t.getCellLocation(i,o),event:e}),t.fireListeners(cw.DROPDOWN_MENU_CLEAR,null),t.fireListeners(cw.HIDE_MENU,null),e.stopPropagation()})),null===(o=this._rootElement)||void 0===o||o.addEventListener("mousemove",(t=>{this._rootElement.classList.contains(ST)||t.stopPropagation()}))}get rootElement(){return this._rootElement}release(){this.unbindFromCell();const t=this._rootElement;(null==t?void 0:t.parentElement)&&t.parentElement.removeChild(t),this._handler.release(),delete this._rootElement}bindToCell(t,e,i,o){const n=this._rootElement;if(this._menuInstanceInfo=o,null==n||n.classList.remove(AT),null==n||n.classList.add(ST),this._canBindToCell(t,e,i)){if(n.innerHTML="",n.appendChild(o.content),this._bindCell(t,e,i,o.position,o.referencePosition))return null==n||n.classList.add(AT),null==n||n.classList.remove(ST),!0}else this.unbindFromCell();return!1}unbindFromCell(){const t=this._rootElement;this._menuInstanceInfo=void 0,(null==t?void 0:t.parentElement)&&(t.classList.remove(AT),t.classList.add(ST))}_canBindToCell(t,e,i){const o=t.getCellRangeRelativeRect({col:e,row:i}),n=t.getElement(),{top:r,bottom:s,left:l,right:a}=o;if(t.isFrozenCell(e,i))return!0;if(s<t.getFrozenRowsHeight()||a<t.getFrozenColsWidth()||l>t.tableNoFrameWidth-t.getRightFrozenColsWidth()||r>t.tableNoFrameHeight-t.getBottomFrozenRowsHeight())return!1;const{offsetHeight:h,offsetWidth:d}=n;return!(h<r||d<l)}_bindCell(t,e,i,o,n){const r=this._rootElement,s=t.getElement(),{width:l,height:a}=t.internalProps.element.getBoundingClientRect();if(r){r.parentElement!==s&&s.appendChild(r),r.style.left="0px";const t=.8*l;r.style.maxWidth=`${t}px`;const e=r.clientWidth,i=r.clientHeight;let h,d;return o&&(h=o.x,d=o.y),n&&(h=n.rect.right-e,d=n.rect.bottom),d+i>a&&(d=a-i,h+=e-2),d<0&&(d/=2),r.style.top=`${d}px`,h<0?h=0:h+e>l&&(h=l-e),r.style.left=`${h}px`,!0}return!1}pointInMenuElement(t,e){const i=this._rootElement,{x:o,y:n,width:r,height:s}=i.getBoundingClientRect();return t>o-5&&t<o+r+5&&e>n-5&&e<n+s+5}}class RT extends xT{createMenuElementInternal(){return new $R(this._table)}}class MT extends xT{createMenuElementInternal(){return new BT(this._table)}}const TT={"dropdown-menu":function(t){return new RT(t)},"context-menu":function(t){return new RT(t)},container:t=>new MT(t)};class kT{constructor(t){this._table=t,this._menuInstances={},this._bindTableEvent(t)}release(){const t=this._menuInstances;for(const e in t)t[e].release();delete this._menuInstances,this._attachInfo=null}_bindToCell(t,e,i,o){var n;const r=this._attachInfo,s=this._getMenuInstanceInfo(t,e,i,o);if(!r||s&&r.instance===s.instance||(null===(n=r.instance)||void 0===n||n.unbindMenuElement(),this._attachInfo=null),!s)return;const{instance:l,info:a}=s;if(l&&l.bindMenuElement(t,e,a)){const i=this._table.getCellRange(t,e);this._attachInfo={range:i,instance:l}}}_unbindFromCell(){const t=this._attachInfo;if(!t)return;const{instance:e}=t;null==e||e.unbindMenuElement(),this._attachInfo=null}_isBindToCell(t,e){const i=this._attachInfo;return!!i&&iw(i.range,t,e)}pointInMenuElement(t,e){if(!this._attachInfo)return!1;const i=this._attachInfo,{instance:o}=i;return o.pointInMenuElement(t,e)}_bindTableEvent(t){t.on(cw.DROPDOWN_ICON_CLICK,(t=>{this._attachInfo&&this._isBindToCell(t.col,t.row)?this._unbindFromCell():this._bindToCell(t.col,t.row,"dropdown-menu")})),t.on(cw.DROPDOWN_MENU_CLEAR,(t=>{this._unbindFromCell()})),t.on(cw.CONTEXTMENU_CELL,(e=>{var i,o,n,r;if("html"===(null===(i=t.internalProps.menu)||void 0===i?void 0:i.renderMode)){const i=t._getMouseAbstractPoint(e.event,!1);let s=null;i.inTable&&"function"==typeof(null===(o=t.internalProps.menu)||void 0===o?void 0:o.contextMenuItems)?s=t.internalProps.menu.contextMenuItems(t.getHeaderField(e.col,e.row),e.row,e.col):i.inTable&&Array.isArray(null===(n=t.internalProps.menu)||void 0===n?void 0:n.contextMenuItems)&&(s=null===(r=t.internalProps.menu)||void 0===r?void 0:r.contextMenuItems),this._bindToCell(e.col,e.row,"context-menu",{content:s,position:{x:i.x,y:i.y}})}}))}_getMenuInstanceInfo(t,e,i,o){const n=this._table,r=this._menuInstances,s=function(t,e,i,o,n){var r;const{lineHeight:s,textBaseline:l,textStick:a}=t._getCellStyle(e,i);let h=t.getCellRangeRelativeRect(t.getCellRange(e,i));a&&(h=t.getVisibleCellRangeRelativeRect({col:e,row:i}));let{left:d,right:c,bottom:u,top:g,width:p,height:f}=h;if(t.isHeader(e,i)&&({left:d,right:c,bottom:u,top:g,width:p,height:f}=t.internalProps.headerHelper.getDropDownIconRect(h,s,l||"middle")),null==n?void 0:n.content)return{type:o,position:n.position,referencePosition:null!==(r=n.referencePosition)&&void 0!==r?r:{rect:{left:d,right:c,top:g,bottom:u,width:p,height:f}},content:n.content};if("dropdown-menu"===o){const{dropDownMenu:n=t.globalDropDownMenu,pivotInfo:r}=t._getHeaderLayoutMap(e,i);return{type:o,referencePosition:{rect:{left:d,right:c,top:g,bottom:u,width:p,height:f}},content:n,pivotInfo:r}}return null}(n,t,e,i,o);return s?{instance:r&&r[i]||r&&(r[i]=TT[i](n)),type:i,info:s}:null}}class PT{constructor(t,e){this.isReleased=!1,this.table=e,this._titleOption=t,!1!==t.visible&&(this._titleComponent=this._createOrUpdateTitleComponent(this._getTitleAttrs()))}_createOrUpdateTitleComponent(t){if(this._titleComponent)Rt(t,this._cacheAttrs)||this._titleComponent.setAttributes(t);else{const e=new jy(t);e.name="title",this.table.scenegraph.stage.defaultLayer.appendChild(e),this._titleComponent=e}return this._adjustTableSize(this._titleComponent.attribute),this._titleComponent}resize(){var t,e,i,o,n;if(!this._titleComponent)return;const r=vx(null!==(t=this._titleOption.padding)&&void 0!==t?t:10),s=null!==(e=this._titleOption.width)&&void 0!==e?e:Math.min(this.table.tableNoFrameWidth,this.table.getDrawRange().width)-r[1]-r[3],l=null!==(i=this._titleOption.height)&&void 0!==i?i:Math.min(this.table.tableNoFrameHeight,this.table.getDrawRange().height)-r[0]-r[2];this._titleComponent.setAttributes({x:(null!==(o=this._titleOption.x)&&void 0!==o?o:"right"===this._titleOption.orient)?this.table.tableX+Math.min(this.table.tableNoFrameWidth,this.table.getDrawRange().width):this.table.tableX,y:(null!==(n=this._titleOption.y)&&void 0!==n?n:"bottom"===this._titleOption.orient)?this.table.tableY+this.table.tableNoFrameHeight:this.table.tableY,width:"top"===this._titleOption.orient||"bottom"===this._titleOption.orient?s:this._titleOption.width,height:"left"===this._titleOption.orient||"right"===this._titleOption.orient?l:this._titleOption.height,textStyle:Object.assign({width:s},this._titleOption.textStyle),subtextStyle:Object.assign({width:s},this._titleOption.subtextStyle)}),this._adjustTableSize(this._titleComponent.attribute)}_adjustTableSize(t){var e,i,o,n;const r=isFinite(null===(e=this._titleComponent)||void 0===e?void 0:e.AABBBounds.width())?this._titleComponent.AABBBounds.width():0,s=isFinite(null===(i=this._titleComponent)||void 0===i?void 0:i.AABBBounds.height())?this._titleComponent.AABBBounds.height():0;"left"===this._titleOption.orient?(this.table.tableNoFrameWidth=this.table.tableNoFrameWidth-Math.ceil(r),this.table.tableX+=Math.ceil(r)):"top"===this._titleOption.orient?(this.table.tableNoFrameHeight=this.table.tableNoFrameHeight-Math.ceil(s),this.table.tableY+=Math.ceil(s)):"right"===this._titleOption.orient?this.table.tableNoFrameWidth=this.table.tableNoFrameWidth-Math.ceil(r):"bottom"===this._titleOption.orient&&(this.table.tableNoFrameHeight=this.table.tableNoFrameHeight-Math.ceil(s)),this._cacheAttrs=t,"right"!==this._titleOption.orient&&"bottom"!==this._titleOption.orient||this._titleComponent.setAttributes({x:(null!==(o=this._titleOption.x)&&void 0!==o?o:"right"===this._titleOption.orient)?this.table.tableX+this.table.tableNoFrameWidth:this.table.tableX,y:(null!==(n=this._titleOption.y)&&void 0!==n?n:"bottom"===this._titleOption.orient)?this.table.tableY+this.table.tableNoFrameHeight:this.table.tableY})}release(){this._titleComponent&&this.table.scenegraph.stage.defaultLayer.removeChild(this._titleComponent),this._titleComponent=null,this.isReleased=!0}_getTitleAttrs(){var t,e,i,o,n,r,s,l,a,h,d;const c=this._titleOption.text||this._titleOption.subtext?10:0,u=vx(null!==(t=this._titleOption.padding)&&void 0!==t?t:c),g=null!==(e=this._titleOption.width)&&void 0!==e?e:Math.min(this.table.tableNoFrameWidth,this.table.getDrawRange().width)-u[1]-u[3],p=null!==(i=this._titleOption.height)&&void 0!==i?i:Math.min(this.table.tableNoFrameHeight,this.table.getDrawRange().height)-u[0]-u[2];return{text:null!==(o=this._titleOption.text)&&void 0!==o?o:"",subtext:null!==(n=this._titleOption.subtext)&&void 0!==n?n:"",x:(null!==(r=this._titleOption.x)&&void 0!==r?r:"right"===this._titleOption.orient)?this.table.tableX+Math.min(this.table.tableNoFrameWidth,this.table.getDrawRange().width):this.table.tableX,y:(null!==(s=this._titleOption.y)&&void 0!==s?s:"bottom"===this._titleOption.orient)?this.table.tableY+this.table.tableNoFrameHeight:this.table.tableY,width:"top"===this._titleOption.orient||"bottom"===this._titleOption.orient?g:this._titleOption.width,height:"left"===this._titleOption.orient||"right"===this._titleOption.orient?p:this._titleOption.height,minWidth:this._titleOption.minWidth,maxWidth:this._titleOption.maxWidth,minHeight:this._titleOption.minHeight,maxHeight:this._titleOption.maxHeight,padding:this._titleOption.padding,align:null!==(l=this._titleOption.align)&&void 0!==l?l:"left",verticalAlign:null!==(a=this._titleOption.verticalAlign)&&void 0!==a?a:"top",textStyle:Object.assign({width:g},this._titleOption.textStyle),subtextStyle:Object.assign({width:g},this._titleOption.subtextStyle),dx:null!==(h=this._titleOption.dx)&&void 0!==h?h:0,dy:null!==(d=this._titleOption.dy)&&void 0!==d?d:0}}}class ET{constructor(t){this._table=t}release(){var t,e;this.unbindTooltipElement(),this._tooltipElement&&(null===(e=(t=this._tooltipElement).release)||void 0===e||e.call(t)),this._tooltipElement=void 0}_getTooltipElement(){return this._tooltipElement||(this._tooltipElement=this.createTooltipElementInternal()),this._tooltipElement}bindTooltipElement(t,e,i,o){return this._getTooltipElement().bindToCell(this._table,t,e,i,o)}moveTooltipElement(t,e,i,o){this._getTooltipElement().move(this._table,t,e,i,o)}unbindTooltipElement(){this._getTooltipElement().unbindFromCell()}locateTooltipElement(t,e,i,o,n){this._getTooltipElement()._locate(this._table,t,e,i,o,n)}}!function(){if("node"===BC.mode)return;const t=document.createElement("style");t.id="vtable-tooltip-styleSheet",t.textContent="\n@keyframes vtable__bubble-tooltip-element--shown-animation {\n\t0% {\n\t\topacity: 0;\n\t}\n\t100% {\n\t\topacity: 1;\n\t}\n}\n.vtable__bubble-tooltip-element {\n\tposition: absolute;\n\t\n\t// pointer-events: none;\n\t//user-select: none;\n\tmax-width: 300px;\n\tz-index: 99999;\n\n\tbackground: #FFFFFF;\n border: 1px solid #E6E8ED;\n box-sizing: border-box;\n border-radius: 4px;\n box-shadow: 0px 2px 4px rgb(27 31 35 / 8%);\n color: #141414;\n font-size: 13px;\n}\n.vtable__bubble-tooltip-element--hidden {\n\topacity: 0;\n pointer-events: none;\n\tuser-select: none;\n\t/* transform: translate(-50%, -50%); */\n\ttransition: opacity 75ms linear;\n}\n.vtable__bubble-tooltip-element--shown {\n\topacity: 1;\n\t/* transform: translate(-50%, -50%); */\n\tanimation: vtable__bubble-tooltip-element--shown-animation 150ms ease-out;\n}\n.vtable__bubble-tooltip-element__content {\n\t/* font-size: .75rem; */\n\tpadding: 6px 8px;\n\tmin-height: 1em;\n\tline-height: 1.5;\n\twidth: 100%;\n\tdisplay: block;\n\twhite-space: pre-wrap;\n\tmargin: 0;\n\tbox-sizing: border-box;\n\toverflow: auto;\n\tword-wrap: break-word;\n\tposition: relative;\n\tbackground-color: #FFF;\n\tz-index: 2;\n\tborder-radius: 4px;\n}\n/* WebKit Microsoft Edge(新版): */\n.vtable__bubble-tooltip-element__content::-webkit-scrollbar {\n width: 0;\n height: 0;\n background-color: transparent;\n}\n/* Opera Firefox */\n.vtable__bubble-tooltip-element__content > scrollbar-track {\n width: 0;\n height: 0;\n background-color: transparent;\n}\n/* Internet Explorer 11 和 Microsoft Edge(旧版) */\n.vtable__bubble-tooltip-element__content > scrollbar {\n width: 0;\n height: 0;\n background-color: transparent;\n}\n.vtable__bubble-tooltip-element__triangle {\n\t/* font-size: .75rem; */\n\tposition: absolute;\n\twidth: 10px;\n\theight: 10px;\n\tdisplay: block;\n\ttransform: rotate(45deg);\n transform-origin: 50% 50% 0;\n\tz-index: 1;\n\tbackground-color: #FFF;\n\tborder: 1px solid #E6E8ED;\n}\n",document.head.appendChild(t)}();const LT="vtable__bubble-tooltip-element",HT=`${LT}__content`,zT=`${LT}__triangle`,FT=`${LT}--hidden`,IT=`${LT}--shown`;class OT{constructor(){this._handler=new fw;const t=this._rootElement=kR("div",[LT,FT]),e=kR("div",[HT]),i=kR("span",[zT]);t.appendChild(i),t.appendChild(e),this._messageElement=t.querySelector(`.${HT}`)||void 0,this._triangleElement=t.querySelector(`.${zT}`)||void 0,t.addEventListener("mousemove",(()=>{this._disappearDelayId&&clearTimeout(this._disappearDelayId)})),t.addEventListener("mouseleave",(()=>{this._disappearDelay=void 0,this.unbindFromCell()})),e.addEventListener("wheel",(t=>{t.stopPropagation()})),e.addEventListener("copy",(t=>{(function(t){const e=window.getSelection();if(e.rangeCount){const i=e.getRangeAt(0);return i.endOffset>i.startOffset&&t.contains(i.commonAncestorContainer)}return!1})(e)&&t.stopPropagation()}))}bindToCell(t,e,i,o,n){var r,s,l,a,h,d,c,u,g,p,f,m,b,v,y,C,w,x,_;this._disappearDelay=null==o?void 0:o.disappearDelay,this._disappearDelayId&&clearTimeout(this._disappearDelayId);const S=this._rootElement,A=this._messageElement,B=this._triangleElement;if(null==S||S.classList.remove(IT),null==S||S.classList.add(FT),this._canBindToCell(t,e,i)){if(A.setAttribute("style",""),B.setAttribute("style",""),(null==o?void 0:o.className)&&S.classList.add(o.className),(null===(r=null==o?void 0:o.style)||void 0===r?void 0:r.bgColor)&&(A.style.backgroundColor=null===(s=null==o?void 0:o.style)||void 0===s?void 0:s.bgColor),(null===(l=null==o?void 0:o.style)||void 0===l?void 0:l.bgColor)&&(B.style.backgroundColor=null===(a=null==o?void 0:o.style)||void 0===a?void 0:a.bgColor),B.style.display=!0===(null===(h=null==o?void 0:o.style)||void 0===h?void 0:h.arrowMark)?"block":"none",(null===(d=null==o?void 0:o.style)||void 0===d?void 0:d.fontSize)&&(A.style.fontSize=(null!==(u=null===(c=null==o?void 0:o.style)||void 0===c?void 0:c.fontSize)&&void 0!==u?u:12)+"px"),(null===(g=null==o?void 0:o.style)||void 0===g?void 0:g.fontFamily)&&(A.style.fontFamily=null===(p=null==o?void 0:o.style)||void 0===p?void 0:p.fontFamily),(null===(f=null==o?void 0:o.style)||void 0===f?void 0:f.color)&&(A.style.color=null===(m=null==o?void 0:o.style)||void 0===m?void 0:m.color),(null===(b=null==o?void 0:o.style)||void 0===b?void 0:b.padding)&&(A.style.padding=`${null===(v=null==o?void 0:o.style)||void 0===v?void 0:v.padding.join("px ")}px`),(null===(y=null==o?void 0:o.style)||void 0===y?void 0:y.maxHeight)&&(A.style.maxHeight=`${null===(C=null==o?void 0:o.style)||void 0===C?void 0:C.maxHeight}px`),(null===(w=null==o?void 0:o.style)||void 0===w?void 0:w.maxWidth)&&(A.style.maxWidth=`${null===(x=null==o?void 0:o.style)||void 0===x?void 0:x.maxWidth}px`),A&&(A.textContent=null==o?void 0:o.content),this._bindToCell(t,e,i,null==o?void 0:o.position,null==o?void 0:o.referencePosition,n,null===(_=null==o?void 0:o.style)||void 0===_?void 0:_.arrowMark))return null==S||S.classList.add(IT),null==S||S.classList.remove(FT),!0}else this.unbindFromCell();return!1}release(){var t,e;this.unbindFromCell();const i=this._rootElement;(null==i?void 0:i.parentElement)&&i.parentElement.removeChild(i),null===(e=null===(t=this._handler)||void 0===t?void 0:t.release)||void 0===e||e.call(t),delete this._rootElement,delete this._messageElement}move(t,e,i,o,n){const r=this._rootElement;this._canBindToCell(t,e,i)?(this._bindToCell(t,e,i,null==o?void 0:o.position,null==o?void 0:o.referencePosition,n),null==r||r.classList.add(IT),null==r||r.classList.remove(FT)):this.unbindFromCell()}unbindFromCell(){var t;if(this._disappearDelay)this._disappearDelayId=setTimeout((()=>{const t=this._rootElement;(null==t?void 0:t.parentElement)&&(t.classList.remove(IT),t.classList.add(FT))}),null!==(t=this._disappearDelay)&&void 0!==t?t:0);else{const t=this._rootElement;(null==t?void 0:t.parentElement)&&(t.classList.remove(IT),t.classList.add(FT))}}_canBindToCell(t,e,i){const o=t.getCellRangeRelativeRect({col:e,row:i}),n=t.getElement(),{bottom:r,left:s,right:l,top:a}=o;if(t.isFrozenCell(e,i))return!0;if(r<t.getFrozenRowsHeight()||l<t.getFrozenColsWidth()||s>t.tableNoFrameWidth-t.getRightFrozenColsWidth()||a>t.tableNoFrameHeight-t.getBottomFrozenRowsHeight())return!1;const{offsetHeight:h,offsetWidth:d}=n;return!(a>h||s>d)}_bindToCell(t,e,i,o,n,r,s){const l=this._rootElement,a=t.getCellRangeRelativeRect({col:e,row:i}),h=t.getElement(),d=t.internalProps.element.offsetWidth,{width:c}=a;if(l){let a,u;l.parentElement!==h&&h.appendChild(l),l.style.left="0px";const g=Math.min(.8*d,4*c);l.style.maxWidth=`${g}px`;const p=l.clientWidth,f=l.clientHeight;if(!o&&!n)return!1;{const l=this.getComputedPosition(t,e,i,o,n,r,s);u=l.x,a=l.y}l.style.left=`${u}px`,l.style.top=`${a}px`,OC()&&(l.style.fontSize="11px");const{x1:m,x2:b,y1:v,y2:y}=t.stateManager.menu.bounds,C=u,w=C+p,x=a,_=C+f;return!(t.stateManager.menu.isShow&&m<w&&b>C&&y>x&&v<_)}return!1}getComputedPosition(t,e,i,o,n,r,s){var l;const a=this._rootElement,h=t.getCellRangeRelativeRect({col:e,row:i}),{width:d,height:c}=t.internalProps.element.getBoundingClientRect(),{width:u}=h;let g,p;const f=Math.min(.8*d,4*u);a.style.maxWidth=`${f}px`;const m=a.clientWidth,b=a.clientHeight,v=s?6:0;if(o)p=o.x,g=o.y+v,this._triangleElement.style.left="50%",this._triangleElement.style.marginLeft="-5px",this._triangleElement.style.top="-5px";else if(n){let t=null!==(l=n.placement)&&void 0!==l?l:Zy.bottom;const e=n.rect.left+n.rect.width/2,i=n.rect.top+n.rect.height/2,o=n.rect.top,s=n.rect.bottom,a=n.rect.left,h=n.rect.right;let u=0;const f=()=>{u++,u>=4||(this.removeStyleFromTriangle(),t===Zy.top?(p=e-m/2,g=o-b-v,this._triangleElement.style.left="50%",this._triangleElement.style.marginLeft="-5px",this._triangleElement.style.bottom="-5px",r&&g<0&&(t=Zy.right,f())):t===Zy.bottom?(p=e-m/2,g=s+v,this._triangleElement.style.left="50%",this._triangleElement.style.marginLeft="-5px",this._triangleElement.style.top="-5px",r&&g+b>c&&(t=Zy.left,f())):t===Zy.left?(g=i-b/2,p=a-m-v,this._triangleElement.style.top="50%",this._triangleElement.style.marginTop="-5px",this._triangleElement.style.right="-5px",r&&p<0&&(t=Zy.top,f())):t===Zy.right&&(g=i-b/2,p=h+v,this._triangleElement.style.top="50%",this._triangleElement.style.marginTop="-5px",this._triangleElement.style.left="-5px",r&&p+m>d&&(t=Zy.bottom,f())))};f()}return r&&(p<0?p=0:p+a.offsetWidth>d&&(p=d-a.offsetWidth)),{x:p,y:g}}removeStyleFromTriangle(){this._triangleElement.style.left="",this._triangleElement.style.right="",this._triangleElement.style.top="",this._triangleElement.style.bottom="",this._triangleElement.style.marginLeft="",this._triangleElement.style.marginTop=""}_locate(t,e,i,o,n,r){const s=this.getComputedPosition(t,e,i,o,n,r),l=s.x,a=s.y;this._rootElement.style.left=`${l}px`,this._rootElement.style.top=`${a}px`}}class DT extends ET{createTooltipElementInternal(){return new OT}}const WT=function(t){return new DT(t)};class NT{constructor(t,e){this._table=t,this._tooltipInstances={},this._bindTableEvent(t),this.confine=e}release(){var t,e;const i=this._tooltipInstances;for(const o in i)null===(e=null===(t=i[o])||void 0===t?void 0:t.release)||void 0===e||e.call(t);delete this._tooltipInstances,this._attachInfo=null}_bindToCell(t,e,i){var o;const n=this._attachInfo,r=this._getTooltipInstanceInfo(t,e);if(!n||r&&n.instance===r||(null===(o=n.instance)||void 0===o||o.unbindTooltipElement(),this._attachInfo=null),r&&r&&r.bindTooltipElement(t,e,i,this.confine)){const o=this._table.getCellRange(t,e);this._attachInfo={range:o,instance:r,tooltipOptions:i}}}_move(t,e,i){const o=this._attachInfo;if(!o||!iw(o.range,t,e))return;const{instance:n}=o;null==n||n.moveTooltipElement(t,e,i,this.confine)}moveToPosition(t,e,i,o){const n=this._attachInfo;if(!n||!iw(n.range,t,e))return;const{instance:r}=n;this._attachInfo.tooltipOptions.position=i,this._attachInfo.tooltipOptions.referencePosition=o,null==r||r.locateTooltipElement(t,e,i,o,this.confine)}_unbindFromCell(){const t=this._attachInfo;if(!t)return;const{instance:e}=t;null==e||e.unbindTooltipElement(),this._attachInfo=null}_isBindCell(t,e){const i=this._attachInfo;return!!i&&iw(i.range,t,e)}_bindTableEvent(t){t.on(cw.MOUSEENTER_CELL,(e=>{if(OC())return;const{x1:i,x2:o,y1:n,y2:r}=t.stateManager.menu.bounds;if(t.stateManager.menu.isShow&&"number"==typeof e.x&&"number"==typeof e.y&&e.x>i&&e.x<o&&e.y>n&&e.y<r)return;const{col:s,row:l}=e;this.showTooltip(s,l)})),t.on(cw.MOUSEMOVE_CELL,(e=>{var i,o;if(!OC()){if(null===(o=null===(i=this._attachInfo)||void 0===i?void 0:i.tooltipOptions)||void 0===o?void 0:o.referencePosition){const i=this._attachInfo.tooltipOptions.referencePosition,{event:o}=e,{left:n,right:r,top:s,bottom:l}=i.rect,a=t._getMouseAbstractPoint(o,!1);a.inTable&&a.x>=n-5&&a.x<=r+5&&a.y>=s-5&&a.y<=l+5||this._unbindFromCell()}this._attachInfo&&t.stateManager.menu.isShow&&this._bindToCell(e.col,e.row)}})),t.on(cw.MOUSELEAVE_CELL,(t=>{this._unbindFromCell()})),t.on(cw.SELECTED_CELL,(t=>{this._isBindCell(t.col,t.row)&&this._unbindFromCell()})),t.on(cw.MOUSELEAVE_TABLE,(t=>{this._unbindFromCell()})),t.on(cw.SCROLL,(t=>{this._unbindFromCell()}))}showTooltip(t,e){var i,o,n;let r;const s=this._table,l=s.getHeaderDescription(t,e);if(l){const o=s.getCellRangeRelativeRect({col:t,row:e});r={content:l,referencePosition:{placement:Zy.bottom,rect:o},disappearDelay:null!==(i=s.internalProps.tooltip.overflowTextTooltipDisappearDelay)&&void 0!==i?i:0,style:s.theme.tooltipStyle}}else if(null===(o=s.internalProps.tooltip)||void 0===o?void 0:o.isShowOverflowTextTooltip){const i=s.getCellOverflowText(t,e),o=s.getCellRangeRelativeRect({col:t,row:e});i&&(r={content:l?`${l}\n ${i}`:i,referencePosition:{placement:Zy.bottom,rect:o},disappearDelay:null!==(n=s.internalProps.tooltip.overflowTextTooltipDisappearDelay)&&void 0!==n?n:0,style:s.theme.tooltipStyle})}r?this._bindToCell(t,e,r):this._unbindFromCell()}_getTooltipInstanceInfo(t,e){const i=this._table,o=this._tooltipInstances;return o&&o["bubble-tooltip"]||o&&(o["bubble-tooltip"]=WT(i))}isBinded(t){var e;return JSON.stringify(t)===JSON.stringify(null===(e=this._attachInfo)||void 0===e?void 0:e.tooltipOptions)}}const GT={};function jT(t,e,i,o,n,r,s,l,a,h,d,c,u,g,p,f,m,b){var v,y,C,w,x,_,S,A,B,R,M,T,k,P,E,L,H,z,F,I,O,D,W,N,G;const j=qC(GT,kM)[d],V=M_("padding",p._getCellStyle(n,r),n,r,p);if(Q(V)&&(a=V),!t){const a=T_(n,r,f,p);b&&(t=p.scenegraph.highPerformanceGetCell(n,r,!0))&&"cell"===t.role&&t.setAttributes({x:i,y:o,width:s,height:l,lineWidth:null!==(y=null===(v=null==f?void 0:f.group)||void 0===v?void 0:v.lineWidth)&&void 0!==y?y:void 0,fill:null!==(w=null===(C=null==f?void 0:f.group)||void 0===C?void 0:C.fill)&&void 0!==w?w:void 0,stroke:null!==(_=null===(x=null==f?void 0:f.group)||void 0===x?void 0:x.stroke)&&void 0!==_?_:void 0,strokeArrayWidth:a,strokeArrayColor:null!==(A=null===(S=null==f?void 0:f.group)||void 0===S?void 0:S.strokeArrayColor)&&void 0!==A?A:void 0,cursor:null!==(R=null===(B=null==f?void 0:f.group)||void 0===B?void 0:B.cursor)&&void 0!==R?R:void 0,lineDash:null!==(T=null===(M=null==f?void 0:f.group)||void 0===M?void 0:M.lineDash)&&void 0!==T?T:void 0,lineCap:"butt",clip:!0,cornerRadius:f.group.cornerRadius}),t&&"cell"===t.role||((t=new S_({x:i,y:o,width:s,height:l,lineWidth:null!==(P=null===(k=null==f?void 0:f.group)||void 0===k?void 0:k.lineWidth)&&void 0!==P?P:void 0,fill:null!==(L=null===(E=null==f?void 0:f.group)||void 0===E?void 0:E.fill)&&void 0!==L?L:void 0,stroke:null!==(z=null===(H=null==f?void 0:f.group)||void 0===H?void 0:H.stroke)&&void 0!==z?z:void 0,strokeArrayWidth:a,strokeArrayColor:null!==(I=null===(F=null==f?void 0:f.group)||void 0===F?void 0:F.strokeArrayColor)&&void 0!==I?I:void 0,cursor:null!==(D=null===(O=null==f?void 0:f.group)||void 0===O?void 0:O.cursor)&&void 0!==D?D:void 0,lineDash:null!==(N=null===(W=null==f?void 0:f.group)||void 0===W?void 0:W.lineDash)&&void 0!==N?N:void 0,lineCap:"butt",clip:!0,cornerRadius:f.group.cornerRadius})).role="cell",t.col=n,t.row=r,null==e||e.addCellGroup(t))}t.AABBBounds.width();const U=new KS(m,{stroke:!1,x:a[3],y:a[0],canvas:null!==(G=p.canvas)&&void 0!==G?G:p.scenegraph.stage.window.getContext().canvas,mode:p.options.mode,modeParams:p.options.modeParams,spec:c,ClassType:j,width:s-a[3]-a[1],height:l-a[2]-a[0],chartInstance:u,dataId:g,data:p.getCellValue(n,r),cellPadding:a,dpr:p.internalProps.pixelRatio,axes:p.isPivotChart()?p.internalProps.layoutMap.getChartAxes(n,r):[]});return t.appendChild(U),p.internalProps.layoutMap.setChartInstance(n,r,U.chartInstance),t}function VT(t,e,i,o,n,r,s,l,a,h,d,c,u,g,p,f,m,b){var v,y,C,w,x,_,S,A,B,R,M,T,k,P,E,L,H,z,F,I,O,D,W,N;if(!t){const s=T_(n,r,p,g);b&&(t=g.scenegraph.highPerformanceGetCell(n,r,!0))&&"cell"===t.role&&t.setAttributes({x:i,y:o,width:l,height:a,lineWidth:null!==(y=null===(v=null==p?void 0:p.group)||void 0===v?void 0:v.lineWidth)&&void 0!==y?y:void 0,fill:null!==(w=null===(C=null==p?void 0:p.group)||void 0===C?void 0:C.fill)&&void 0!==w?w:void 0,stroke:null!==(_=null===(x=null==p?void 0:p.group)||void 0===x?void 0:x.stroke)&&void 0!==_?_:void 0,strokeArrayWidth:s,strokeArrayColor:null!==(A=null===(S=null==p?void 0:p.group)||void 0===S?void 0:S.strokeArrayColor)&&void 0!==A?A:void 0,cursor:null!==(R=null===(B=null==p?void 0:p.group)||void 0===B?void 0:B.cursor)&&void 0!==R?R:void 0,lineDash:null!==(T=null===(M=null==p?void 0:p.group)||void 0===M?void 0:M.lineDash)&&void 0!==T?T:void 0,lineCap:"butt",clip:!0,cornerRadius:p.group.cornerRadius}),t&&"cell"===t.role||((t=new S_({x:i,y:o,width:l,height:a,lineWidth:null!==(P=null===(k=null==p?void 0:p.group)||void 0===k?void 0:k.lineWidth)&&void 0!==P?P:void 0,fill:null!==(L=null===(E=null==p?void 0:p.group)||void 0===E?void 0:E.fill)&&void 0!==L?L:void 0,stroke:null!==(z=null===(H=null==p?void 0:p.group)||void 0===H?void 0:H.stroke)&&void 0!==z?z:void 0,strokeArrayWidth:s,strokeArrayColor:null!==(I=null===(F=null==p?void 0:p.group)||void 0===F?void 0:F.strokeArrayColor)&&void 0!==I?I:void 0,cursor:null!==(D=null===(O=null==p?void 0:p.group)||void 0===O?void 0:O.cursor)&&void 0!==D?D:void 0,lineDash:null!==(N=null===(W=null==p?void 0:p.group)||void 0===W?void 0:W.lineDash)&&void 0!==N?N:void 0,lineCap:"butt",clip:!0,cornerRadius:p.group.cornerRadius})).role="cell",t.col=n,t.row=r,null==e||e.addCellGroup(t))}let G;if(u){let t=n,e=r;m&&(t=m.start.col,e=m.start.row),G=g.getCellIcons(t,e)}let j=0,V=0;if(Array.isArray(G)&&0!==G.length){const{leftIconWidth:e,rightIconWidth:i,absoluteLeftIconWidth:o,absoluteRightIconWidth:n}=I_(G,t,m,g);j=e+i,V=e,t.forEachChildren((t=>{"icon-left"===t.role?t.setAttribute("x",t.attribute.x+h[3]):"icon-right"===t.role?t.setAttribute("x",t.attribute.x+l-i-h[1]):"icon-absolute-right"===t.role&&t.setAttribute("x",t.attribute.x+l-n-h[1])})),t.forEachChildren((t=>{"middle"===c?t.setAttribute("y",(a-t.AABBBounds.height())/2):"bottom"===c?t.setAttribute("y",a-t.AABBBounds.height()-h[2]):t.setAttribute("y",h[0])}))}const U=function(t,e,i,o,n,r,s,l,a){var h,d,c,u;const g=a._getCellStyle(t,e),p=R_("size",g,t,e,a),f=R_("spaceBetweenTextAndIcon",g,t,e,a),m=R_("defaultFill",g,t,e,a),b=R_("defaultStroke",g,t,e,a),v=R_("disableFill",g,t,e,a),y=R_("checkedFill",g,t,e,a),C=R_("checkedStroke",g,t,e,a),w=R_("disableCheckedFill",g,t,e,a),x=R_("disableCheckedStroke",g,t,e,a),_=R_("checkIconImage",g,t,e,a),S=R_("indeterminateIconImage",g,t,e,a),A=a.getCellValue(t,e),B=a.getCellOriginValue(t,e);let R,M,T=null!==(h=A)&&void 0!==h?h:"";tt(A)?(R=A.checked,M=A.disable,T=null!==(d=A.text)&&void 0!==d?d:""):"boolean"==typeof A&&(R=A,T=""),R=a.stateManager.syncCheckedState(t,e,l.field,R);const k=P_(t,e,a),P=a._getCellStyle(t,e),E=null!==(c=P.autoWrapText)&&void 0!==c?c:a.internalProps.autoWrapText,{lineClamp:L}=P,{checked:H,disable:z}=l;if(null==R||"function"==typeof R){const i=QC(H,{col:t,row:e,table:a,context:null,value:A,dataValue:B});R=a.stateManager.syncCheckedState(t,e,l.field,i)}const F=QC(z,{col:t,row:e,table:a,context:null,value:A,dataValue:B}),I="auto"===i,O=a.isAutoRowHeight(e),D={text:1===T.length?T[0]:T,maxLineWidth:I?1/0:o-(r[1]+r[3]+k)-p-f,textBaseline:"top",autoWrapText:E,lineClamp:L,wordBreak:"break-word",heightLimit:O?-1:n-Math.floor(r[0]+r[2]),pickable:!1,dx:k,whiteSpace:1!==T.length||E?"normal":"no-wrap"},W={x:0,y:0,text:s.text?Object.assign({},s.text,D):D,icon:{width:Math.floor(p/1.4),height:Math.floor(p/1.4)},box:{width:p,height:p},spaceBetweenTextAndIcon:f,disabled:null!==(u=null!=M?M:F)&&void 0!==u&&u};"indeterminate"===R?(W.checked=void 0,W.indeterminate=!0):(W.checked=R,W.indeterminate=void 0),m&&(W.box.fill=m),b&&(W.box.stroke=b),v&&(W.box.disableFill=v),y&&(W.box.checkedFill=y),C&&(W.box.checkedStroke=C),w&&(W.box.disableCheckedFill=w),x&&(W.box.disableCheckedStroke=x),_&&(W.icon.checkIconImage=_),S&&(W.icon.indeterminateIconImage=S);const N=new Vy(W);return N.name="checkbox",N}(n,r,s-j,l,a,h,p,f,g);return U&&t.appendChild(U),U.render(),l-=h[1]+h[3]+j,a-=h[0]+h[2],"center"===d?U.setAttribute("x",h[3]+V+(l-U.AABBBounds.width())/2):"right"===d?U.setAttribute("x",h[3]+V+l-U.AABBBounds.width()):U.setAttribute("x",h[3]+V),"middle"===c?U.setAttribute("y",h[0]+(a-U.AABBBounds.height())/2):"bottom"===c?U.setAttribute("y",h[0]+a-U.AABBBounds.height()):U.setAttribute("y",h[0]),t}function UT(t,e,i,o,n,r,s,l,a,h,d,c,u,g,p){var f,m,b,v,y,C,w,x,_,S,A,B;if(!t){const s=T_(n,r,g,u);(t=new S_({x:i,y:o,width:l,height:a,lineWidth:null!==(m=null===(f=null==g?void 0:g.group)||void 0===f?void 0:f.lineWidth)&&void 0!==m?m:void 0,fill:null!==(v=null===(b=null==g?void 0:g.group)||void 0===b?void 0:b.fill)&&void 0!==v?v:void 0,stroke:null!==(C=null===(y=null==g?void 0:g.group)||void 0===y?void 0:y.stroke)&&void 0!==C?C:void 0,strokeArrayWidth:s,strokeArrayColor:null!==(x=null===(w=null==g?void 0:g.group)||void 0===w?void 0:w.strokeArrayColor)&&void 0!==x?x:void 0,cursor:null!==(S=null===(_=null==g?void 0:g.group)||void 0===_?void 0:_.cursor)&&void 0!==S?S:void 0,lineDash:null!==(B=null===(A=null==g?void 0:g.group)||void 0===A?void 0:A.lineDash)&&void 0!==B?B:void 0,lineCap:"butt",clip:!0,cornerRadius:g.group.cornerRadius})).role="cell",t.col=n,t.row=r,null==e||e.addCellGroup(t)}const{width:R,height:M}=function(t,e,i,o,n,r,s,l,a,h){var d,c;const u=h._getCellStyle(t,e);let g=R_("size",u,t,e,h),p=R_("innerRadius",u,t,e,h),f=R_("outerRadius",u,t,e,h);const m=R_("spaceBetweenTextAndIcon",u,t,e,h),b=R_("spaceBetweenRadio",u,t,e,h),v=R_("defaultFill",u,t,e,h),y=R_("defaultStroke",u,t,e,h),C=R_("disableFill",u,t,e,h),w=R_("checkedFill",u,t,e,h),x=R_("checkedStroke",u,t,e,h),_=R_("disableCheckedFill",u,t,e,h),S=R_("disableCheckedStroke",u,t,e,h);at(f)?g=2*f:f=Math.round(g/2),(!at(p)||p<0)&&(p=Math.round(f/7*3));const A=h.getCellValue(t,e),B=h.getCellOriginValue(t,e),R=P_(t,e,h),M=h._getCellStyle(t,e),T=null!==(d=M.autoWrapText)&&void 0!==d?d:h.internalProps.autoWrapText,{lineClamp:k}=M,P="auto"===i,E="autoHeight"===h.heightMode,L={maxLineWidth:P?1/0:o-(r[1]+r[3]+R)-g-m,textBaseline:"top",autoWrapText:T,lineClamp:k,wordBreak:"break-word",heightLimit:E?-1:n-Math.floor(r[0]+r[2]),pickable:!1,dx:R},H={x:0,y:0,text:s.text?Object.assign({},s.text,L):L,circle:{innerRadius:p,outerRadius:f},spaceBetweenTextAndIcon:m};v&&(H.circle.fill=v),y&&(H.circle.stroke=y),C&&(H.circle.disableFill=C),w&&(H.circle.checkedFill=w),x&&(H.circle.checkedStroke=x),_&&(H.circle.disableCheckedFill=_),S&&(H.circle.disableCheckedStroke=S);let z=0,F=0;const I=null!==(c=l.radioDirectionInCell)&&void 0!==c?c:"vertical";if(rt(A))A.forEach(((i,o)=>{const n=$T(i,B,o,t,e,l,T,H,h);n&&a.appendChild(n),n.id=`radio-${t}-${e}-${o}`,n.render();const r=n.AABBBounds;"vertical"===I?(n.setAttribute("y",F),F+=r.height()+(o!==A.length-1?b:0),z=Math.max(z,r.width())):"horizontal"===I&&(n.setAttribute("x",z),z+=r.width()+(o!==A.length-1?b:0),F=Math.max(F,r.height()))}));else{const i=$T(A,B,void 0,t,e,l,T,H,h);i&&a.appendChild(i),i.id=`radio-${t}-${e}`,i.render();const o=i.AABBBounds;z=o.width(),F=o.height()}return{width:z,height:F}}(n,r,s,l,a,h,g,p,t,u);return l-=h[1]+h[3],a-=h[0]+h[2],t.forEachChildren((t=>{"center"===d?t.setAttribute("x",h[3]+t.attribute.x+(l-R)/2):"right"===d?t.setAttribute("x",h[3]+t.attribute.x+l-R):t.setAttribute("x",h[3]+t.attribute.x),"middle"===c?t.setAttribute("y",h[0]+t.attribute.y+(a-M)/2):"bottom"===c?t.setAttribute("y",h[0]+t.attribute.y+a-M):t.setAttribute("y",h[0]+t.attribute.y)})),t}function $T(t,e,i,o,n,r,s,l,a){const h=function(t,e,i,o,n,r,s){var l,a;const h=null!==(l=r.radioCheckType)&&void 0!==l?l:"column";let d,c;return tt(t)?d=t.checked:"boolean"==typeof t&&(d=t),d=s.stateManager.syncRadioState(o,n,r.field,h,i,d),null!=d&&"function"!=typeof d||(c=QC(r.checked,{col:o,row:n,table:s,context:null,value:t,dataValue:e}),d=s.stateManager.syncRadioState(o,n,r.field,h,i,c)),null!==(a=null!=d?d:c)&&void 0!==a&&a}(t,e,i,o,n,r,a),d=function(t,e,i,o,n,r){var s;let l;tt(t)&&(l=t.disable);const a=QC(n.disable,{col:i,row:o,table:r,context:null,value:t,dataValue:e});return null!==(s=null!=l?l:a)&&void 0!==s&&s}(t,e,o,n,r,a),c=tt(t)?t.text:q(t)?"":null!=t?t:"",u=St({},l,{checked:h,disabled:d,text:{text:1===c.length?c[0]:c,whiteSpace:1!==c.length||s?"normal":"no-wrap"},boundsPadding:0}),g=new Uy(u);return g.name="radio",g}const XT=new class extends zv{constructor(t){super(!1),this.type=uv.Point,this._padding=0,this.paddingInner(1,t),this.padding=this.paddingOuter,this.paddingInner=void 0,this.paddingOuter=void 0}},YT=new iy;function KT(t,e,i,o,n,r,s,l,a,h,d,c){var u,g,p,f,m,b,v,y,C,w,x,_,S,A,B,R,M,T,k,P,E,L,H,z;if(!t){const a=T_(n,r,d,h);c&&(t=h.scenegraph.highPerformanceGetCell(n,r,!0))&&"cell"===t.role&&t.setAttributes({x:i,y:o,width:s,height:l,lineWidth:null!==(g=null===(u=null==d?void 0:d.group)||void 0===u?void 0:u.lineWidth)&&void 0!==g?g:void 0,fill:null!==(f=null===(p=null==d?void 0:d.group)||void 0===p?void 0:p.fill)&&void 0!==f?f:void 0,stroke:null!==(b=null===(m=null==d?void 0:d.group)||void 0===m?void 0:m.stroke)&&void 0!==b?b:void 0,strokeArrayWidth:a,strokeArrayColor:null!==(y=null===(v=null==d?void 0:d.group)||void 0===v?void 0:v.strokeArrayColor)&&void 0!==y?y:void 0,cursor:null!==(w=null===(C=null==d?void 0:d.group)||void 0===C?void 0:C.cursor)&&void 0!==w?w:void 0,lineDash:null!==(_=null===(x=null==d?void 0:d.group)||void 0===x?void 0:x.lineDash)&&void 0!==_?_:void 0,lineCap:"butt",clip:!0,cornerRadius:d.group.cornerRadius}),t&&"cell"===t.role||((t=new S_({x:i,y:o,width:s,height:l,lineWidth:null!==(A=null===(S=null==d?void 0:d.group)||void 0===S?void 0:S.lineWidth)&&void 0!==A?A:void 0,fill:null!==(R=null===(B=null==d?void 0:d.group)||void 0===B?void 0:B.fill)&&void 0!==R?R:void 0,stroke:null!==(T=null===(M=null==d?void 0:d.group)||void 0===M?void 0:M.stroke)&&void 0!==T?T:void 0,strokeArrayWidth:a,strokeArrayColor:null!==(P=null===(k=null==d?void 0:d.group)||void 0===k?void 0:k.strokeArrayColor)&&void 0!==P?P:void 0,cursor:null!==(L=null===(E=null==d?void 0:d.group)||void 0===E?void 0:E.cursor)&&void 0!==L?L:void 0,lineDash:null!==(z=null===(H=null==d?void 0:d.group)||void 0===H?void 0:H.lineDash)&&void 0!==z?z:void 0,lineCap:"butt",clip:!0,cornerRadius:d.group.cornerRadius})).role="cell",t.col=n,t.row=r,null==e||e.addCellGroup(t))}const F=function(t,e,i,o,n,r){let s,l;const a=r.internalProps.layoutMap.getBody(t,e).sparklineSpec,h=r.getCellValue(t,e);if(!Array.isArray(h))return;const d=n[3],c=n[0];i-=n[1]+n[3];const u=o-=n[0]+n[2];if("function"==typeof a){const n={col:t,row:e,dataValue:r.getCellOriginValue(t,e)||"",value:r.getCellValue(t,e)||"",rect:r.getCellRangeRelativeRect(r.getCellRange(t,e)),table:r};s=a(n),l=qT(s,d,c,i,o)}else s=a,l=qT(a,d,c,i,o);const g=[],p=[];let f,m;if("object"==typeof s.xField)XT.domain(s.xField.domain),f=s.xField.field;else if("string"==typeof s.xField){const t=h.map((t=>t[s.xField]));XT.domain(t),f=s.xField}else Array.isArray(h)&&(XT.domain(Array.from({length:h.length},((t,e)=>e))),f=s.xField);if(XT.range([0,i]),"object"==typeof s.yField)YT.domain(s.yField.domain),m=s.yField.field;else if("string"==typeof s.yField){const t=h.map((t=>t[s.yField]));YT.domain([Math.min(...t),Math.max(...t)]),m=s.yField}else Array.isArray(h)&&h.every((t=>"number"==typeof t))&&(YT.domain([Math.min(...h),Math.max(...h)]),m=s.yField);if(YT.range([0,o]),"object"==typeof s.xField&&Array.isArray(s.xField.domain)){const t=h.map((t=>t[s.xField.field])),e=s.xField.domain;for(let i=0;i<e.length;i++){let o=!1;for(let n=0;n<t.length;n++)if(e[i]==t[n]){const t=h[n];if(!Q(t[f])||!Q(t[m]))break;g.push({x:0+XT.scale(t[f]),y:u-YT.scale(t[m]),defined:Q(t[m])}),p.push(t),o=!0;break}o||(g.push({x:0+XT.scale(e[i]),y:0,defined:!1}),p.push({[f]:e[i],[m]:null}))}}else for(let t=0;t<h.length;t++){const e=h[t];g.push({x:0+XT.scale(f?e[f]:t),y:u-YT.scale(m?e[m]:e),defined:Q(m?e[m]:e),rawData:e}),p.push(e)}const b=l.getChildByName("sparkline-line");b&&b.setAttribute("points",g),b.bandwidth=XT.step(),b.min=YT.range()[0],b.max=YT.range()[1];const v=l.getChildByName("sparkline-symbol-group");if(v){const t="isolatedPoint"===s.pointShowRule;if("all"===s.pointShowRule)for(let t=0;t<g.length;t++){const{x:e,y:i,defined:o}=g[t];if(o){const t=ca({x:e,y:i});v.appendChild(t)}}else if(t)for(let t=0;t<g.length;t++){const{x:e,y:i,defined:o}=g[t];if(o&&(!g[t-1]||!g[t-1].defined)&&(!g[t+1]||!g[t+1].defined)){const t=ca({x:e,y:i});v.appendChild(t)}}}return l}(n,r,s,l,a,h);return F&&t.appendChild(F),t}function qT(t,e,i,o,n){var r,s,l,a,h,d,c,u,g,p,f,m,b,v,y,C,w,x,_,S,A,B;let R;R="function"==typeof t?t(null):t;const M=new S_({x:e,y:i,width:o,height:n,stroke:!1,fill:!1});if(M.name="sparkline","line"===R.type){const t=pa({x:0,y:0,curveType:R.smooth?"monotoneX":"linear",stroke:null!==(l=null===(s=null===(r=R.line)||void 0===r?void 0:r.style)||void 0===s?void 0:s.stroke)&&void 0!==l?l:"blue",lineWidth:null!==(d=null===(h=null===(a=R.line)||void 0===a?void 0:a.style)||void 0===h?void 0:h.strokeWidth)&&void 0!==d?d:2});t.name="sparkline-line",M.addChild(t),R.crosshair&&(t.hover=null!==(u=null===(c=R.crosshair)||void 0===c?void 0:c.style)&&void 0!==u?u:{stroke:"#000",interpolate:"linear"});const e=new S_({x:0,y:0,width:o,height:n,stroke:!1,fill:!1});e.name="sparkline-symbol-group",e.setTheme({symbol:{stroke:null!==(f=null===(p=null===(g=R.point)||void 0===g?void 0:g.style)||void 0===p?void 0:p.stroke)&&void 0!==f?f:"#000",lineWidth:null!==(v=null===(b=null===(m=R.point)||void 0===m?void 0:m.style)||void 0===b?void 0:b.strokeWidth)&&void 0!==v?v:1,fill:null!==(w=null===(C=null===(y=R.point)||void 0===y?void 0:y.style)||void 0===C?void 0:C.fill)&&void 0!==w?w:"#000",size:2*(null!==(S=null===(_=null===(x=R.point)||void 0===x?void 0:x.style)||void 0===_?void 0:_.size)&&void 0!==S?S:3),symbolType:"circle"}}),M.addChild(e),e.hover=null!==(B=null===(A=R.point)||void 0===A?void 0:A.hover)&&void 0!==B&&B}return M}const ZT=__();function JT(t,e,i,o,n,r,s,l,a,h,d,c,u,g,p,f,m){var b,v,y,C,w,x,_,S,A,B,R,M,T,k,P,E,L,H,z,F,I,O,D,W,N,G,j,V,U,$;const X=M_("padding",g._getCellStyle(o,n),o,n,g);(null===(b=g.options.customConfig)||void 0===b?void 0:b.imageMargin)?h=vx(null===(v=g.options.customConfig)||void 0===v?void 0:v.imageMargin):Q(X)&&(h=X),(null===(y=null==p?void 0:p.text)||void 0===y?void 0:y.textAlign)&&(d=null===(C=null==p?void 0:p.text)||void 0===C?void 0:C.textAlign),(null===(w=null==p?void 0:p.text)||void 0===w?void 0:w.textBaseline)&&(c=null===(x=null==p?void 0:p.text)||void 0===x?void 0:x.textBaseline);const Y=T_(o,n,p,g);let K,q;if(m&&(K=g.scenegraph.highPerformanceGetCell(o,n,!0),K&&"cell"===K.role&&K.setAttributes({x:e,y:i,width:r,height:s,lineWidth:null!==(S=null===(_=null==p?void 0:p.group)||void 0===_?void 0:_.lineWidth)&&void 0!==S?S:void 0,fill:null!==(B=null===(A=null==p?void 0:p.group)||void 0===A?void 0:A.fill)&&void 0!==B?B:void 0,stroke:null!==(M=null===(R=null==p?void 0:p.group)||void 0===R?void 0:R.stroke)&&void 0!==M?M:void 0,strokeArrayWidth:Y,strokeArrayColor:null!==(k=null===(T=null==p?void 0:p.group)||void 0===T?void 0:T.strokeArrayColor)&&void 0!==k?k:void 0,cursor:null!==(E=null===(P=null==p?void 0:p.group)||void 0===P?void 0:P.cursor)&&void 0!==E?E:void 0,lineDash:null!==(H=null===(L=null==p?void 0:p.group)||void 0===L?void 0:L.lineDash)&&void 0!==H?H:void 0,lineCap:"butt",clip:!0,cornerRadius:p.group.cornerRadius})),K&&"cell"===K.role||(K=new S_({x:e,y:i,width:r,height:s,lineWidth:null!==(F=null===(z=null==p?void 0:p.group)||void 0===z?void 0:z.lineWidth)&&void 0!==F?F:void 0,fill:null!==(O=null===(I=null==p?void 0:p.group)||void 0===I?void 0:I.fill)&&void 0!==O?O:void 0,stroke:null!==(W=null===(D=null==p?void 0:p.group)||void 0===D?void 0:D.stroke)&&void 0!==W?W:void 0,strokeArrayWidth:Y,strokeArrayColor:null!==(G=null===(N=null==p?void 0:p.group)||void 0===N?void 0:N.strokeArrayColor)&&void 0!==G?G:void 0,cursor:null!==(V=null===(j=null==p?void 0:p.group)||void 0===j?void 0:j.cursor)&&void 0!==V?V:void 0,lineDash:null!==($=null===(U=null==p?void 0:p.group)||void 0===U?void 0:U.lineDash)&&void 0!==$?$:void 0,lineCap:"butt",clip:!0,cornerRadius:p.group.cornerRadius}),K.role="cell",K.col=o,K.row=n,null==t||t.addCellGroup(K)),u){let t=o,e=n;f&&(t=f.start.col,e=f.start.row),q=g.getCellIcons(t,e)}let Z=0,J=0;if(Array.isArray(q)&&0!==q.length){const{leftIconWidth:t,rightIconWidth:e,absoluteLeftIconWidth:i,absoluteRightIconWidth:o}=I_(q,K,f,g);Z=t,J=e,K.forEachChildren((t=>{"icon-left"===t.role?t.setAttribute("x",t.attribute.x+h[3]):"icon-right"===t.role?t.setAttribute("x",t.attribute.x+r-e-h[1]):"icon-absolute-right"===t.role&&t.setAttribute("x",t.attribute.x+r-o-h[1])})),K.forEachChildren((t=>{"middle"===c?t.setAttribute("y",(s-t.AABBBounds.height())/2):"bottom"===c?t.setAttribute("y",s-t.AABBBounds.height()-h[2]):t.setAttribute("y",h[0])})),K._cellLeftIconWidth=Z,K._cellRightIconWidth=J}const tt=g.getCellValue(o,n),et=document.createElement("video");et.addEventListener("loadeddata",(()=>{a&&D_(o,n,et.videoWidth,et.videoHeight,g.scenegraph,h,K);const{width:t,height:e,isMerge:i}=N_(K,g);if(l){const{width:i,height:o}=A_(et.videoWidth,et.videoHeight,t-h[1]-h[3],e-h[0]-h[2]),n=B_(0,0,t,e,i,o,d,c,h);it.setAttributes({width:i,height:o,x:n.x,y:n.y,dx:0})}else it.setAttributes({x:h[3],y:h[0],width:t-h[1]-h[3],height:e-h[2]-h[0],dy:0});i&&G_(K.mergeStartCol,K.mergeEndCol,K.mergeStartRow,K.mergeEndRow,g);const{width:r,height:s}=N_(K,g),u=Math.floor(Math.min(r-h[1]-h[3],s-h[2]-h[0])/2),p=0+(r>it.attribute.width?it.attribute.x-0+it.attribute.width/2:r/2),f=0+(s>it.attribute.height?it.attribute.y-0+it.attribute.height/2:s/2),m=new n_({x:p-u/2,y:f-u/2,width:u,height:u,image:ZT.play.svg,cursor:ZT.play.cursor});m.name="play-icon",K.appendChild(m),g.scenegraph.updateNextFrame()})),et.onerror=()=>{it.image=ZT.damage_pic.svg},et.src=tt,et.setAttribute("preload","auto");const it=xa({x:h[3],y:h[0],width:r-h[1]-h[3],height:s-h[2]-h[0],image:et,cursor:"pointer"});return it.name="image",it.keepAspectRatio=l,it.textAlign=d,it.textBaseline=c,K.appendChild(it),K}function QT(t,e,i,o,n,r,s,l,a,h,d,c,u,g,p,f,m,b,v){var y,C,w,x,_,S,A,B,R,M,T,k,P,E,L,H,z,F,I,O,D,W,N,G,j,V,U,$,X,Y,K,q;const Z=t._getCellStyle(r,s),J=M_("padding",Z,r,s,t);Q(J)&&(d=J),(null===(y=null==m?void 0:m.text)||void 0===y?void 0:y.textAlign)&&(c=null===(C=null==m?void 0:m.text)||void 0===C?void 0:C.textAlign),(null===(w=null==m?void 0:m.text)||void 0===w?void 0:w.textBaseline)&&(u=null===(x=null==m?void 0:m.text)||void 0===x?void 0:x.textBaseline);const tt=t.isAutoRowHeight(s),et="auto"===l,it=null!==(_=Z.autoWrapText)&&void 0!==_?_:t.internalProps.autoWrapText,ot=Z.lineClamp,nt=T_(r,s,m,t);let rt;if(v&&(rt=t.scenegraph.getCell(r,s,!0),rt&&"cell"===rt.role&&rt.setAttributes({x:o,y:n,width:a,height:h,lineWidth:null!==(A=null===(S=null==m?void 0:m.group)||void 0===S?void 0:S.lineWidth)&&void 0!==A?A:void 0,fill:null!==(R=null===(B=null==m?void 0:m.group)||void 0===B?void 0:B.fill)&&void 0!==R?R:void 0,stroke:null!==(T=null===(M=null==m?void 0:m.group)||void 0===M?void 0:M.stroke)&&void 0!==T?T:void 0,strokeArrayWidth:null!=nt?nt:void 0,strokeArrayColor:null!==(P=null===(k=null==m?void 0:m.group)||void 0===k?void 0:k.strokeArrayColor)&&void 0!==P?P:void 0,cursor:null!==(L=null===(E=null==m?void 0:m.group)||void 0===E?void 0:E.cursor)&&void 0!==L?L:void 0,lineDash:null!==(z=null===(H=null==m?void 0:m.group)||void 0===H?void 0:H.lineDash)&&void 0!==z?z:void 0,lineCap:"butt",clip:!0,cornerRadius:m.group.cornerRadius})),rt&&"cell"===rt.role||(rt=new S_({x:o,y:n,width:a,height:h,lineWidth:null!==(I=null===(F=null==m?void 0:m.group)||void 0===F?void 0:F.lineWidth)&&void 0!==I?I:void 0,fill:null!==(D=null===(O=null==m?void 0:m.group)||void 0===O?void 0:O.fill)&&void 0!==D?D:void 0,stroke:null!==(N=null===(W=null==m?void 0:m.group)||void 0===W?void 0:W.stroke)&&void 0!==N?N:void 0,strokeArrayWidth:null!=nt?nt:void 0,strokeArrayColor:null!==(j=null===(G=null==m?void 0:m.group)||void 0===G?void 0:G.strokeArrayColor)&&void 0!==j?j:void 0,cursor:null!==(U=null===(V=null==m?void 0:m.group)||void 0===V?void 0:V.cursor)&&void 0!==U?U:void 0,lineDash:null!==(X=null===($=null==m?void 0:m.group)||void 0===$?void 0:$.lineDash)&&void 0!==X?X:void 0,lineCap:"butt",clip:!0,cornerRadius:m.group.cornerRadius}),rt.role="cell",rt.col=r,rt.row=s,null==i||i.addCellGroup(rt)),p&&rt.appendChild(p),f){const i=e;let o;if(g){let e=r,i=s;b&&(e=b.start.col,i=b.start.row),o=t.getCellIcons(e,i)}if(function(t,e,i,o,n,r,s,l,a,h,d,c,u,g,p){var f,m,b,v,y;let C,w=0,x=0,_=0;if(Array.isArray(e)&&0!==e.length){const{inlineFrontIcons:f,inlineEndIcons:S,contentLeftIcons:A,contentRightIcons:B,leftIconWidth:R,rightIconWidth:M,absoluteRightIconWidth:T}=I_(e,t,p,u);let k;if(w=R,x=M,_=T,0===f.length&&0===S.length){let e=0;at(u.theme._contentOffset)&&("left"===d?e=u.theme._contentOffset:"right"===d&&(e=-u.theme._contentOffset));const c=p?P_(p.start.col,p.start.row,u):P_(t.col,t.row,u),{text:f,moreThanMaxCharacters:b}=E_(i,u),v={text:1===f.length?f[0]:f,moreThanMaxCharacters:b,maxLineWidth:n?1/0:a-(o[1]+o[3])-w-x-c,textBaseline:"top",heightLimit:r&&!(null===(m=u.options.customConfig)||void 0===m?void 0:m.multilinesForXTable)?-1:h-Math.floor(o[0]+o[2]),pickable:!1,autoWrapText:s,lineClamp:l,wordBreak:"break-word",whiteSpace:1!==f.length||s?"normal":"no-wrap",dx:("left"===d?A.length?0:c:0)+e},y=new il(g.text?Object.assign({},g.text,v):v);y.name="text",k=y}else{const e=Object.assign({text:null==i?void 0:i.toString()},(null===(y=null===(v=null===(b=t.parent)||void 0===b?void 0:b.theme)||void 0===v?void 0:v.userTheme)||void 0===y?void 0:y.text)||{});g.text&&Object.assign(e,g.text),e.textBaseline="middle";const l=[...f.map((t=>H_(t))),e,...S.map((t=>H_(t)))];l[0].textAlign=d;const u=new Ra({width:n?0:a-(o[1]+o[3])-w-x,height:r&&s?0:Math.ceil(h-(o[0]+o[2])),textConfig:l,verticalDirection:r&&s?"top":c,ellipsis:e.ellipsis});u.name="text",k=u,u.bindIconEvent()}if(0!==A.length||0!==B.length){const e=new k_({x:0,y:0,fill:!1,stroke:!1});e.name="content",e.setCellContentOption({autoWidth:n,autoHeight:r,cellWidth:a-(o[1]+o[3])-w-x,cellHeight:h-(o[0]+o[2]),align:d,baseline:c});const i={addedHierarchyOffset:0};A.forEach((o=>{const n=L_(o,void 0,t.col,t.row,p,u,i);n.role="icon-content-left",n.name=o.name,e.addLeftOccupyingIcon(n)})),B.forEach((o=>{const n=L_(o,void 0,t.col,t.row,p,u,i);n.role="icon-content-right",n.name=o.name,e.addRightOccupyingIcon(n)})),e.addContent(k),t.appendChild(e),e.layout(),C=e.AABBBounds.width(),e.AABBBounds.height()}else t.firstChild?t.insertBefore(k,t.firstChild):t.appendChild(k),C=k.AABBBounds.width(),k.AABBBounds.height()}else if(Q(i)){const{text:e,moreThanMaxCharacters:m}=E_(i,u),b=p?P_(p.start.col,p.start.row,u):P_(t.col,t.row,u);let v=0;at(u.theme._contentOffset)&&("left"===d?v=u.theme._contentOffset:"right"===d&&(v=-u.theme._contentOffset));const y={text:1===e.length?e[0]:e,moreThanMaxCharacters:m,maxLineWidth:n?1/0:a-(o[1]+o[3]+b),textBaseline:"top",autoWrapText:s,lineClamp:l,wordBreak:"break-word",heightLimit:r&&!(null===(f=u.options.customConfig)||void 0===f?void 0:f.multilinesForXTable)?-1:h-Math.floor(o[0]+o[2]),pickable:!1,dx:("left"===d?b:0)+v,whiteSpace:1!==e.length||s?"normal":"no-wrap"},w=new il(g.text?Object.assign({},g.text,y):y);w.name="text",w.textBaseline=c,t.appendChild(w),C=w.AABBBounds.width(),w.AABBBounds.height()}const S=n?w+C+x:a-(o[1]+o[3]),A=h-(o[0]+o[2]);t.forEachChildren((t=>{"icon-left"===t.role?t.setAttribute("x",t.attribute.x+o[3]):"icon-right"===t.role?t.setAttribute("x",t.attribute.x+S-x+o[3]):"icon-absolute-right"===t.role?t.setAttribute("x",t.attribute.x+S-_+o[3]+o[1]):"content"!==t.name&&"text"!==t.name||("center"===d&&"richtext"!==t.type?t.setAttribute("x",o[3]+w+(S-w-x)/2):"right"===d&&"richtext"!==t.type?t.setAttribute("x",o[3]+S-x):t.setAttribute("x",o[3]+w))})),t.forEachChildren((t=>{"middle"===c?t.setAttribute("y",o[0]+(A-t.AABBBounds.height())/2):"bottom"===c?t.setAttribute("y",o[0]+A-t.AABBBounds.height()):t.setAttribute("y",o[0])})),t.setAttributes({width:S+o[1]+o[3],height:A+o[0]+o[2]})}(rt,o,i,d,et,tt,it,"number"==typeof ot?ot:void 0,rt.attribute.width,rt.attribute.height,c,u,t,m,b),null===(Y=null==m?void 0:m._vtable)||void 0===Y?void 0:Y.marked){const t=Ha({x:rt.attribute.width,y:0,startAngle:Math.PI/2,endAngle:Math.PI,outerRadius:6,fill:"#3073F2",pickable:!1});t.name="mark",rt.appendChild(t)}}return p&&rt.setAttributes({width:Math.max(rt.attribute.width,null!==(K=p.attribute.width)&&void 0!==K?K:0),height:Math.max(rt.attribute.height,null!==(q=p.attribute.height)&&void 0!==q?q:0)}),rt}function tk(t,e,i,o,n,r,s,l,a){var h,d,c,u,g,p;t.dependField&&(n=null!==(d=null===(h=a.getCellOriginRecord(r,s))||void 0===h?void 0:h[t.dependField])&&void 0!==d?d:n),t.barType=null!==(c=t.barType)&&void 0!==c?c:"default",t.min=null!==(u=QC(t.min,{col:r,row:s,table:a,value:o,dataValue:n,cellHeaderPaths:void 0}))&&void 0!==u?u:0,t.max=null!==(g=QC(t.max,{col:r,row:s,table:a,value:o,dataValue:n,cellHeaderPaths:void 0}))&&void 0!==g?g:t.min+100;const f=a.getRowHeight(s);let m=i,b=f,v=0;at(a.theme._contentOffset)&&(v=a.theme._contentOffset);const y=new S_({x:-v,y:-v,width:m,height:b});y.name="progress-bar";const{showBar:C,barColor:w,barBgColor:x,barPositiveColor:_,barNegativeColor:S,barAxisColor:A,barRightToLeft:B,showBarMark:R,barMarkPositiveColor:M,barMarkNegativeColor:T,barMarkWidth:k,barMarkPosition:P}=e;let{barHeight:E,barBottom:L,barPadding:H}=e;1===H.length?H=[H[0],H[0],H[0],H[0]]:2===H.length?H=[H[0],H[1],H[0],H[1]]:3===H.length&&(H=[H[0],H[1],H[2],H[1]]),H=H.map(((t,e)=>{if("string"==typeof t&&lw.endsWith(t,"%")){const o=Number(t.substr(0,t.length-1));return 0===e||2===e?f*o/100:i*o/100}return Number(t)}));const z=vx(R_("borderLineWidth",e,r,s,a)),F=Math.max(H[0],Math.ceil(z[0]/2)),I=Math.max(H[1],Math.floor(z[1]/2)),O=Math.max(H[2],Math.floor(z[2]/2)),D=Math.max(H[3],Math.ceil(z[3]/2));m-=I+D,b-=O+F,s===a.rowCount-1&&[0,"0"].includes(L)&&(b-=1);const W=F,N=D,G=m;if("string"==typeof E&&lw.endsWith(E,"%")?(E=Number(E.substr(0,E.length-1)),E=b*E/100):E=Number(E),"string"==typeof L&&lw.endsWith(L,"%")?(L=Number(L.substr(0,L.length-1)),L=b*L/100):L=Number(L),QC(C,{col:r,row:s,table:a,context:null,value:o,dataValue:n})){let e=`${n}`;lw.endsWith(e,"%")&&(e=e.substr(0,e.length-1));const i=Number(e);if(isNaN(i))return y;if("default"===(null!==(p=t.barType)&&void 0!==p?p:"default")){const e=i<t.min?0:i>t.max?1:(i-t.min)/(t.max-t.min),l=m,h=W+b-E-L;let d=Math.min(l*e,l);const c=B?N+G-d:N;r!==a.colCount-1||1!==e||B||(d-=1);const u=QC(x,{col:r,row:s,table:a,context:null,value:o,dataValue:n,percentile:e});if(u){const t=ba({x:c,y:h,width:l,height:E,fill:u});y.addChild(t)}const g=ba({x:c,y:h,width:d,height:E,fill:QC(w,{col:r,row:s,table:a,context:null,value:o,dataValue:n,percentile:e})||"#20a8d8"});y.addChild(g)}else if("negative"===t.barType){const e=t.min<0?-t.min:0,l=t.max>0?t.max:0,h=e/(e+l),d=1-h,c=i>0?i/l:0,u=i<0?-i/e:0,g=m,p=W+b-E-L,v=N,C=QC(x,{col:r,row:s,table:a,context:null,value:o,dataValue:n,percentile:c});if(C){const t=ba({x:v,y:p,width:g,height:E,fill:C});y.addChild(t)}const w=B?d*g:h*g,H=Math.min(g*h*u,g),z=B?{left:v+w,top:p,width:H,height:E}:{left:v+w-H,top:p,width:H,height:E},F=QC(S,{col:r,row:s,table:a,context:null,value:o,dataValue:n,percentile:u})||"#20a8d8",I=ba({x:z.left,y:z.top,width:z.width,height:z.height,fill:F});y.addChild(I);let O=Math.min(g*d*c,g);r!==a.colCount-1||1!==c||B||(O-=1);const D=B?{left:v+w-O,top:p,width:O,height:E}:{left:v+w,top:p,width:O,height:E},G=QC(_,{col:r,row:s,table:a,context:null,value:o,dataValue:n,percentile:c})||"#20a8d8",j=ba({x:D.left,y:D.top,width:D.width,height:D.height,fill:G});y.addChild(j);const V=B?z.left:D.left,U=pa({x:0,y:0,stroke:QC(A),lineWidth:1,lineDash:[2,2],points:[{x:V,y:0},{x:V,y:f}]});if(y.addChild(U),R&&(c||u)){const t=k,e=[];let i;if(c>0)if(i=QC(M,{col:r,row:s,table:a,context:null,value:o,dataValue:n,percentile:c})||"#20a8d8","right"===P){const t=B?D.left+k/2:D.left+D.width-k/2;e.push({x:t,y:D.top}),e.push({x:t,y:D.top+D.height})}else"bottom"===P&&(e.push({x:D.left,y:D.top+D.height-k/2}),e.push({x:D.left+D.width,y:D.top+D.height-k/2}));else if(u>0)if(i=QC(T,{col:r,row:s,table:a,context:null,value:o,dataValue:n,percentile:u})||"#20a8d8","right"===P){const t=B?z.left+z.width-k/2:z.left+k/2;e.push({x:t,y:z.top}),e.push({x:t,y:z.top+z.height})}else"bottom"===P&&(e.push({x:z.left,y:z.top+z.height-k/2}),e.push({x:z.left+z.width,y:z.top+z.height-k/2}));const l=pa({x:0,y:0,stroke:i,lineWidth:t,points:e});y.addChild(l)}}else if("negative_no_axis"===t.barType){const e=t.min<0?-t.min:0,l=t.max>0?t.max:0,h=Math.max(e,l),d=0===h?0:Math.abs(i)/h,c=m;let u=Math.min(c*d,c);r!==a.colCount-1||1!==d||B||(u-=1);const g=W+b-E-L,p=B?N+G-u:N,f=QC(x,{col:r,row:s,table:a,context:null,value:o,dataValue:n,percentile:d});if(f){const t=ba({x:p,y:g,width:c,height:E,fill:f});y.addChild(t)}const v={left:p,top:g,width:u,height:E};let C;C=i>=0?QC(_,{col:r,row:s,table:a,context:null,value:o,percentile:d,dataValue:n})||"#20a8d8":QC(S,{col:r,row:s,table:a,context:null,value:o,dataValue:n,percentile:d})||"#20a8d8";const w=ba({x:v.left,y:v.top,width:v.width,height:v.height,fill:C});if(y.addChild(w),R&&i){const t=k,e=[];let l;if(l=i>=0?QC(M,{col:r,row:s,table:a,context:null,value:o,dataValue:n,percentile:d})||"#20a8d8":QC(T,{col:r,row:s,table:a,context:null,value:o,dataValue:n,percentile:d})||"#20a8d8","right"===P){const t=B?v.left+k/2:v.left+v.width-k/2;e.push({x:t,y:v.top}),e.push({x:t,y:v.top+v.height})}else"bottom"===P&&(e.push({x:v.left,y:v.top+v.height-k/2}),e.push({x:v.left+v.width,y:v.top+v.height-k/2}));const h=pa({x:0,y:0,stroke:l,lineWidth:t,points:e});y.addChild(h)}}}return y}function ek(t,e,i,o,n,r){var s,l,a,h,d,c,u,g,p;if((null==i?void 0:i.zero)&&(t=Math.min(t,0),e=Math.max(e,0)),null==i?void 0:i.expand){const o=t,n=e;Q(i.expand.min)&&(t=o-(n-o)*i.expand.min),Q(i.expand.max)&&(e=n+(n-o)*i.expand.max)}let f,m;if(at(null==i?void 0:i.min)&&(t=i.min),at(null==i?void 0:i.max)&&(e=i.max),"log"===(null==i?void 0:i.type)?(f=new ry,f.base(null!==(s=null==i?void 0:i.base)&&void 0!==s?s:10)):"symlog"===(null==i?void 0:i.type)?(f=new sy,f.constant(null!==(l=null==i?void 0:i.constant)&&void 0!==l?l:10)):f=new iy,f.domain([t,e],!!(null==i?void 0:i.nice)),null==i?void 0:i.nice){let t=null!==(c=null!==(h=null===(a=i.tick)||void 0===a?void 0:a.forceTickCount)&&void 0!==h?h:null===(d=i.tick)||void 0===d?void 0:d.tickCount)&&void 0!==c?c:10;Z(t)&&(t=t({axisLength:n,labelStyle:null!==(g=null===(u=null==i?void 0:i.label)||void 0===u?void 0:u.style)&&void 0!==g?g:{fontSize:$M}})),"accurateFirst"===i.niceType&&(t=Math.max(10,t)),J(i.min)&&J(i.max)?f.nice(t):Q(i.min)&&J(i.max)?f.niceMax(t):J(i.min)&&Q(i.max)&&f.niceMin(t)}return delete f._niceType,r||(m=f.ticks(at(null==i?void 0:i.tickCount)?null==i?void 0:i.tickCount:5,{noDecimals:null===(p=null==i?void 0:i.tick)||void 0===p?void 0:p.noDecimals})),{range:f.domain(),ticks:m}}Vw.registerComponent("axis",lT),Vw.registerFunction("computeAxisComponentWidth",aT),Vw.registerFunction("computeAxisComponentHeight",hT),Vw.registerFunction("getAxisConfigInPivotChart",rM),Vw.registerComponent("emptyTip",uT),Vw.registerFunction("createLegend",wT),Vw.registerComponent("menuHandler",kT),Vw.registerComponent("title",PT),Vw.registerComponent("tooltipHandler",NT),Vw.registerFunction("createChartCellGroup",jT),Vw.registerFunction("getAxisDomainRangeAndLabels",ek),Vw.registerFunction("createCheckboxCellGroup",VT),Vw.registerFunction("createImageCellGroup",O_),Vw.registerFunction("createProgressBarCell",tk),Vw.registerFunction("createRadioCellGroup",UT),Vw.registerFunction("createSparkLineCellGroup",KT),Vw.registerFunction("createTextCellGroup",QT),Vw.registerFunction("createVideoCellGroup",JT);class ik extends JM{}Yy();class ok{vertical;horizontal;gridStyle;scrollLeft;scrollTop;x;y;width;height;timelineDates;colWidthPerDay;rowHeight;rowCount;group;verticalLineGroup;horizontalLineGroup;allGridHeight;allGridWidth;_scene;constructor(t){this._scene=t,this.vertical=!!t._gantt.parsedOptions.gridStyle.verticalLine,this.horizontal=!!t._gantt.parsedOptions.gridStyle.horizontalLine,this.gridStyle=t._gantt.parsedOptions.gridStyle,this.scrollLeft=0,this.scrollTop=0,this.x=0,this.y=t._gantt.getAllHeaderRowsHeight(),this.width=t.tableGroup.attribute.width,this.height=t.tableGroup.attribute.height-t.timelineHeader.group.attribute.height,this.timelineDates=t._gantt.reverseSortedTimelineScales[0].timelineDates,this.colWidthPerDay=t._gantt.parsedOptions.colWidthPerDay,this.rowHeight=t._gantt.parsedOptions.rowHeight,this.rowCount=t._gantt.itemCount,this.allGridWidth=t._gantt.getAllColsWidth(),this.allGridHeight=t._gantt.getAllGridHeight(),this.group=new cs({x:this.x,y:this.y,width:this.width,height:this.height,clip:!0,fill:this.gridStyle?.backgroundColor}),this.group.name="grid-container",t.tableGroup.addChild(this.group);const e=pa({pickable:!1,stroke:t._gantt.parsedOptions.timelineHeaderHorizontalLineStyle?.lineColor,lineWidth:t._gantt.parsedOptions.timelineHeaderHorizontalLineStyle?.lineWidth,points:[{x:0,y:1&t._gantt.parsedOptions.timelineHeaderHorizontalLineStyle?.lineWidth?.5:0},{x:t._gantt.getAllColsWidth(),y:1&t._gantt.parsedOptions.timelineHeaderHorizontalLineStyle?.lineWidth?.5:0}]});this.group.addChild(e),this.createVerticalLines(),this.createHorizontalLines()}createVerticalLines(){if(this.vertical){this.verticalLineGroup=new cs({x:0,y:0,width:this.allGridWidth,height:this.allGridHeight}),this.verticalLineGroup.name="grid-vertical",this.group.appendChild(this.verticalLineGroup);let t=0;1&this.gridStyle?.verticalLine.lineWidth&&(t=.5);for(let e=0;e<this.timelineDates.length-1;e++){const i=this.timelineDates[e];t+=Math.floor(this.colWidthPerDay*i.days);const o=pa({pickable:!1,stroke:this.gridStyle?.verticalLine.lineColor,lineWidth:this.gridStyle?.verticalLine.lineWidth,points:[{x:t,y:0},{x:t,y:this.allGridHeight}]});this.verticalLineGroup.appendChild(o)}}}createHorizontalLines(){if(this.horizontal){this.horizontalLineGroup=new cs({x:0,y:0,width:this.allGridWidth,height:this.allGridHeight}),this.horizontalLineGroup.name="grid-horizontal",this.group.appendChild(this.horizontalLineGroup);let t=0;1&this.gridStyle?.horizontalLine.lineWidth&&(t+=.5);for(let e=0;e<this.rowCount-1;e++){t+=Math.floor(this.rowHeight);const e=pa({pickable:!1,stroke:this.gridStyle?.horizontalLine.lineColor,lineWidth:this.gridStyle?.horizontalLine.lineWidth,points:[{x:0,y:t},{x:this.allGridWidth,y:t}]});this.horizontalLineGroup.appendChild(e)}}}refresh(){this.width=this._scene.tableGroup.attribute.width,this.height=this._scene.tableGroup.attribute.height-this._scene.timelineHeader.group.attribute.height,this.group.setAttributes({width:this.width,height:this.height}),this.rowCount=this._scene._gantt.itemCount,this.allGridWidth=this._scene._gantt.getAllColsWidth(),this.allGridHeight=this._scene._gantt.getAllGridHeight(),this.verticalLineGroup?.parent.removeChild(this.verticalLineGroup),this.horizontalLineGroup?.parent.removeChild(this.horizontalLineGroup),this.createVerticalLines(),this.createHorizontalLines()}setX(t){this.verticalLineGroup?.setAttribute("x",t),this.horizontalLineGroup?.setAttribute("x",t)}setY(t){this.verticalLineGroup?.setAttribute("y",t),this.horizontalLineGroup?.setAttribute("y",t)}resize(){this.width=this._scene.tableGroup.attribute.width,this.height=this._scene.tableGroup.attribute.height-this._scene.timelineHeader.group.attribute.height,this.group.setAttribute("width",this.width),this.group.setAttribute("height",this.height)}}class nk{static _mode;static get mode(){return nk._mode||(nk._mode=function(){let t="browser";try{"node"===window.type?t="node":"undefined"==typeof window||window.performance?"undefined"==typeof window&&(t="node"):t="miniApp"}catch(e){t="node"}return t}()),nk._mode}static set mode(t){nk._mode=t}static dpr=0;static CreateCanvas;static LoadImage;static RequestAnimationFrame;static CancelAnimationFrame;static RegisterCreateCanvas(t){nk.CreateCanvas=t}static RegisterLoadImage(t){nk.LoadImage=t}static GetCreateCanvasFunc(){return nk.CreateCanvas?nk.CreateCanvas:"worker"===nk.mode?(t=200,e=200)=>new OffscreenCanvas(t,e):void 0}static RegisterRequestAnimationFrame(t){nk.RequestAnimationFrame=t()}static GetRequestAnimationFrame(){if(nk.RequestAnimationFrame)return nk.RequestAnimationFrame}static RegisterCancelAnimationFrame(t){nk.CancelAnimationFrame=t()}static GetCancelAnimationFrame(){if(nk.CancelAnimationFrame)return nk.CancelAnimationFrame}}class rk{hScrollBar;vScrollBar;_gantt;_clearHorizontalScrollBar;_clearVerticalScrollBar;constructor(t){this._gantt=t,this.createScrollBar(t.tableNoFrameWidth,t.tableNoFrameHeight-t.getAllHeaderRowsHeight())}createScrollBar(t,e){const i=this._gantt.parsedOptions.scrollStyle.scrollRailColor,o=this._gantt.parsedOptions.scrollStyle.scrollSliderColor,n=this._gantt.parsedOptions.scrollStyle.scrollSliderCornerRadius,r=this._gantt.parsedOptions.scrollStyle.width;let s;s=Q(n)?{cornerRadius:n,fill:o}:{fill:o},this._gantt.parsedOptions.scrollStyle?.visible,this._gantt.parsedOptions.scrollStyle?.hoverOn,this.hScrollBar=new wb({direction:"horizontal",x:2*-t,y:2*-e,width:t,height:r,padding:0,railStyle:{fill:i},sliderStyle:s,range:[0,.1],visible:!1}),this.hScrollBar.render(),this.hScrollBar.hideAll(),this.vScrollBar=new wb({direction:"vertical",x:2*-t,y:2*-e,width:r,height:e,padding:0,railStyle:{fill:i},sliderStyle:s,range:[0,.1],visible:!1}),this.vScrollBar.render(),this.vScrollBar.hideAll()}refresh(){}hideVerticalScrollBar(){const t=this._gantt.parsedOptions.scrollStyle.visible;"focus"!==t&&"scrolling"!==t||(this.vScrollBar.setAttribute("visible",!1),this.vScrollBar.hideAll(),this._gantt.scenegraph.updateNextFrame())}showVerticalScrollBar(t){const e=this._gantt.parsedOptions.scrollStyle.visible;"focus"!==e&&"scrolling"!==e||(this.vScrollBar.setAttribute("visible",!0),this.vScrollBar.showAll(),this._gantt.scenegraph.updateNextFrame(),t&&(clearTimeout(this._clearVerticalScrollBar),this._clearVerticalScrollBar=setTimeout((()=>{this.hideVerticalScrollBar()}),1e3)))}hideHorizontalScrollBar(){const t=this._gantt.parsedOptions.scrollStyle.visible;"focus"!==t&&"scrolling"!==t||(this.hScrollBar.setAttribute("visible",!1),this.hScrollBar.hideAll(),this._gantt.scenegraph.updateNextFrame())}showHorizontalScrollBar(t){const e=this._gantt.parsedOptions.scrollStyle.visible;"focus"!==e&&"scrolling"!==e||(this.hScrollBar.setAttribute("visible",!0),this.hScrollBar.showAll(),this._gantt.scenegraph.updateNextFrame(),t&&(clearTimeout(this._clearHorizontalScrollBar),this._clearHorizontalScrollBar=setTimeout((()=>{this.hideHorizontalScrollBar()}),1e3)))}updateVerticalScrollBarPos(t){const e=this.vScrollBar.attribute.range,i=e[1]-e[0],o=t*(1-i);this.vScrollBar.setAttribute("range",[o,o+i]);const n=this.vScrollBar.AABBBounds&&this.vScrollBar.globalAABBBounds;this.vScrollBar._viewPosition={x:n.x1,y:n.y1}}updateHorizontalScrollBarPos(t){const e=this.hScrollBar.attribute.range,i=e[1]-e[0],o=t*(1-i);this.hScrollBar.setAttribute("range",[o,o+i]);const n=this.hScrollBar.AABBBounds&&this.hScrollBar.globalAABBBounds;this.hScrollBar._viewPosition={x:n.x1,y:n.y1}}updateScrollBar(){const t=this._gantt.stateManager.scroll.horizontalBarPos,e=this._gantt.stateManager.scroll.verticalBarPos,i=this._gantt.parsedOptions.scrollStyle,o=i?.width,n=i?.visible,r=Math.ceil(this._gantt.scenegraph.tableGroup.attribute.width),s=Math.ceil(this._gantt.scenegraph.tableGroup.attribute.height),l=this._gantt.getAllRowsHeight(),a=this._gantt.getAllColsWidth(),h=this._gantt.getAllHeaderRowsHeight();if(a>r){const t=Math.min(s,l),e=Math.max(.05,r/a),h=i.hoverOn;let d=0;d=i.barToSide?this._gantt.tableNoFrameHeight-(h?o:-this._gantt.scenegraph.tableGroup.attribute.y)+this._gantt.tableY:t-(h?o:-this._gantt.scenegraph.tableGroup.attribute.y)+this._gantt.tableY,this.hScrollBar.setAttributes({x:h?0:this._gantt.scenegraph.tableGroup.attribute.x,y:d,width:r,range:[0,e],visible:"always"===n});const c=this.hScrollBar.AABBBounds&&this.hScrollBar.globalAABBBounds;this.hScrollBar._viewPosition={x:c.x1,y:c.y1},"always"===n&&this.hScrollBar.showAll()}else this.hScrollBar.setAttributes({x:2*-this._gantt.tableNoFrameWidth,y:2*-this._gantt.tableNoFrameHeight,width:0,visible:!1});if(l>s){const t=Math.min(r,a),e=Math.max(.05,(s-h)/(l-h));let i=0;const d=this._gantt.parsedOptions.scrollStyle.hoverOn;i=this._gantt.parsedOptions.scrollStyle.barToSide?this._gantt.tableNoFrameWidth-(d?o:-this._gantt.scenegraph.tableGroup.attribute.x)+this._gantt.tableX:t-(d?o:-this._gantt.scenegraph.tableGroup.attribute.x),this.vScrollBar.setAttributes({x:i,y:h+(d?0:this._gantt.scenegraph.tableGroup.attribute.y)+this._gantt.tableY,height:s-h,range:[0,e],visible:"always"===n});const c=this.vScrollBar.AABBBounds&&this.vScrollBar.globalAABBBounds;this.vScrollBar._viewPosition={x:c.x1,y:c.y1},"always"===n&&this.vScrollBar.showAll()}else this.vScrollBar.setAttributes({x:2*-this._gantt.tableNoFrameWidth,y:2*-this._gantt.tableNoFrameHeight,height:0,visible:!1});this._gantt.stateManager.setScrollLeft(t),this._gantt.stateManager.setScrollTop(e)}}function sk(t,e){let i=null;return function(...o){i||(t.apply(this,o),i=setTimeout((()=>{i=null}),e))}}function lk(t,e){const i=t.getFullYear().toString(),o=(t.getMonth()+1).toString().padStart(2,"0"),n=t.getDate().toString().padStart(2,"0");return e=(e=(e=e.replace("yyyy",i)).replace("mm",o)).replace("dd",n)}function ak(t,e){const i=e.indexOf("yyyy"),o=e.indexOf("mm"),n=e.indexOf("dd"),r=o<i?o<n?0:1:o<n?1:2,s=n<i?n<o?0:1:n<o?1:2,l=parseInt(t[i<o?i<n?0:1:o<n?1:2],10),a=parseInt(t[r],10)-1,h=parseInt(t[s],10);if(isNaN(l)||l<1)return!1;if(isNaN(a)||a<0||a>11)return!1;const d=[31,hk(l)?29:28,31,30,31,30,31,31,30,31,30,31];return!(isNaN(h)||h<1||h>d[a])}function hk(t){return t%4==0&&t%100!=0||t%400==0}function dk(t){const e=t.match(/[^\w]/g);if(e){const t=e.map((t=>"\\"+t)).join("|");return new RegExp(t,"g")}return/[^\w]/}function ck(t,e){const i=t.replace(/\{([^}]+)\}/g,((t,i)=>{const o=i.split(".");let n=e;for(const e of o){if(!n.hasOwnProperty(e)){n=t;break}n=n[e]}return n}));return i}function uk(t){return Array.isArray(t)?3===t.length?[t[0],t[1],t[2],t[1]]:2===t.length?[t[0],t[1],t[0],t[1]]:1===t.length?[t[0],t[0],t[0],t[0]]:[t[0],t[1],t[2],t[3]]:[t,t,t,t]}function gk(t){const e=new Date(t.getFullYear(),0,1);return Math.ceil(((t.getTime()-e.getTime())/864e5+1)/7)}function pk(t,e,i,o=!0){let{deltaX:n,deltaY:r}=t;t.shiftKey&&t.deltaY&&(n=r,r=0);const[s,l]=function(t,e,i){const o=2,n=Math.abs(t/e),r=n<=1/o?0:t,s=n>o?0:e;return[Math.ceil(r*(i.horizontal??0)),Math.ceil(s*(i.vertical??0))]}(n,r,{horizontal:1,vertical:1});s&&(e.setScrollLeft(e.scroll.horizontalBarPos+s),i.scenegraph.scrollbarComponent.showHorizontalScrollBar(!0)),l&&(e.setScrollTop(e.scroll.verticalBarPos+l),i.scenegraph.scrollbarComponent.showVerticalScrollBar(!0)),o&&e.resetInteractionState(),t.cancelable&&("none"===e._gantt.parsedOptions.overscrollBehavior||Math.abs(r)>=Math.abs(n)&&0!==r&&function(t,e){const i=e._gantt.getAllRowsHeight()-e._gantt.scenegraph.height;if(0===i)return!1;return!function(t,e){const i=e._gantt.getAllRowsHeight()-e._gantt.scenegraph.height;return 0!==i&&t<=0&&e.scroll.verticalBarPos<1}(t,e)&&!function(t,e){const i=e._gantt.getAllRowsHeight()-e._gantt.scenegraph.height;return 0!==i&&t>=0&&Math.abs(e.scroll.verticalBarPos-i)<1}(t,e)}(r,e)||Math.abs(r)<=Math.abs(n)&&0!==n&&function(t,e){const i=e._gantt.getAllColsWidth()-e._gantt.scenegraph.width;if(0===i)return!1;return!function(t,e){const i=e._gantt.getAllColsWidth()-e._gantt.scenegraph.width;return 0!==i&&t<=0&&e.scroll.horizontalBarPos<1}(t,e)&&!function(t,e){const i=e._gantt.getAllColsWidth()-e._gantt.scenegraph.width;return 0!==i&&t>=0&&Math.abs(e.scroll.horizontalBarPos-i)<1}(t,e)}(n,e))&&t.preventDefault()}const fk="undefined"==typeof window||void 0===window.window,mk=864e5;function bk(t,e){const i=t-e.headerHeight,o=e.stateManager.scroll.verticalBarPos+i;return Math.floor(o/e.parsedOptions.rowHeight)}function vk(t){const e=t.options;t.parsedOptions.pixelRatio=e?.pixelRatio??1,t.parsedOptions.headerRowHeight=e?.headerRowHeight??40,t.parsedOptions.rowHeight=e?.rowHeight??40,t.parsedOptions.timelineColWidth=e?.timelineHeader?.colWidth??60,t.parsedOptions.startDateField=e?.startDateField??"startDate",t.parsedOptions.endDateField=e?.endDateField??"endDate",t.parsedOptions.progressField=e?.progressField??"progress",t.parsedOptions.minDate=e?.minDate?new Date(e?.minDate):void 0,t.parsedOptions.maxDate=e?.maxDate?new Date(e?.maxDate):void 0,t.parsedOptions._minDateTime=t.parsedOptions.minDate?.getTime(),t.parsedOptions._maxDateTime=t.parsedOptions.maxDate?.getTime(),t.parsedOptions.overscrollBehavior=e?.overscrollBehavior??"auto",t.parsedOptions.scrollStyle=Object.assign({},{scrollRailColor:"rgba(100, 100, 100, 0.2)",scrollSliderColor:"rgba(100, 100, 100, 0.5)",scrollSliderCornerRadius:4,width:10,visible:"always",hoverOn:!0,barToSide:!1},e?.scrollStyle),t.parsedOptions.timelineHeaderHorizontalLineStyle=e?.timelineHeader?.horizontalLine,t.parsedOptions.timelineHeaderVerticalLineStyle=e?.timelineHeader?.verticalLine,t.parsedOptions.timelineHeaderBackgroundColor=e?.timelineHeader?.backgroundColor,t.parsedOptions.timelineHeaderStyles=[];for(let i=0;i<e?.timelineHeader?.scales?.length;i++){const o=e?.timelineHeader?.scales[i].style;t.parsedOptions.timelineHeaderStyles.push(Object.assign({fontSize:20,fontWeight:"bold",textAlign:"center",textBaseline:"middle",color:"#000",backgroundColor:"#fff"},o))}var i;t.parsedOptions.gridStyle=Object.assign({},e?.gridStyle),t.parsedOptions.taskBarStyle=Object.assign({},{barColor:"blue",completedBarColor:"gray",width:t.parsedOptions.rowHeight,cornerRadius:3,borderWidth:1,borderColor:"red",fontFamily:"Arial",fontSize:14},e?.taskBar?.barStyle),t.parsedOptions.taskBarLabelText=e?.taskBar?.labelText??"",t.parsedOptions.taskBarMoveable=e?.taskBar?.moveable??!0,t.parsedOptions.taskBarResizable=e?.taskBar?.resizable??!0,t.parsedOptions.taskBarHoverColor=null===e?.taskBar?.hoverColor?"rgba(0,0,0,0)":e?.taskBar?.hoverColor??"rgba(0,0,0,0.1)",t.parsedOptions.taskBarLabelStyle={fontFamily:e?.taskBar?.labelTextStyle.fontFamily??"Arial",fontSize:e?.taskBar?.labelTextStyle.fontSize??t.parsedOptions.rowHeight,color:e?.taskBar?.labelTextStyle.color??"#F01",textAlign:e?.taskBar?.labelTextStyle.textAlign??"left",textBaseline:e?.taskBar?.labelTextStyle.textBaseline??"middle",padding:e?.taskBar?.labelTextStyle.padding??0,textOverflow:e?.taskBar?.labelTextStyle.textOverflow},t.parsedOptions.taskBarCustomLayout=e?.taskBar?.customLayout,t.parsedOptions.frameStyle=Object.assign({},{borderColor:"gray",borderLineWidth:[1,1,1,1],cornerRadius:4},e.frameStyle?.outerFrameStyle),t.parsedOptions.markLine=(i=e?.markLine,i?!0===i?[{date:(new Date).toLocaleDateString(),style:{lineColor:"red",lineWidth:1}}]:Array.isArray(i)?i.map((t=>({date:t.date,style:{lineColor:t.style?.lineColor||"red",lineWidth:t.style?.lineWidth||1,lineDash:t.style?.lineDash}}))):[{date:i.date,style:{lineColor:i.style?.lineColor||"red",lineWidth:i.style?.lineWidth||1,lineDash:i.style?.lineDash}}]:[]),t.parsedOptions.resizeLineStyle={lineColor:e.resizeLineStyle?.lineColor??"yellow",lineWidth:e.resizeLineStyle?.lineWidth??2}}function yk(t,e,i){const{unit:o,step:n,format:r}=i,s=[];for(;t<=e;)if("day"===o){const e=new Date(t.getTime()+24*n*60*60*1e3),i=new Date(t),o=r?.({dateIndex:t.getDate(),startDate:i,endDate:e}),l={days:n,startDate:i,endDate:e,title:o||t.getDate().toString(),dateIndex:t.getDate()};s.push(l),t.setDate(t.getDate()+n)}else if("month"===o){const i=t.getFullYear(),o=t.getMonth()+1,l=new Date(i,o+n-1,0);l.getTime()>e.getTime()&&l.setDate(e.getDate());const a=t,h=r?.({dateIndex:o,startDate:a,endDate:l}),d=h||o.toString(),c={days:Math.ceil(Math.abs(l.getTime()-t.getTime())/864e5)+1,startDate:a,endDate:l,title:d,dateIndex:o};s.push(c),t=new Date(i,t.getMonth()+n,1)}else if("quarter"===o){const i=t.getFullYear(),o=Math.floor(t.getMonth()/3+1),l=new Date(i,3*(o+n-1),0);l.getTime()>e.getTime()&&l.setDate(e.getDate());const a=t,h=r?.({dateIndex:o,startDate:a,endDate:l}),d=h||o.toString(),c={days:Math.ceil(Math.abs(l.getTime()-t.getTime())/864e5)+1,startDate:a,endDate:l,title:d,dateIndex:o};s.push(c),t=new Date(i,3*(o+n-1),1)}else if("year"===o){const i=t.getFullYear(),o=new Date(i,11,31);o.getTime()>e.getTime()&&o.setDate(e.getDate());const l=t,a=r?.({dateIndex:i,startDate:l,endDate:o}),h=a||i.toString(),d={days:Math.ceil(Math.abs(o.getTime()-t.getTime())/864e5)+1,startDate:l,endDate:o,title:h,dateIndex:i};s.push(d),t=new Date(i+n,0,1)}else if("week"===o){const o=i.startOfWeek??"monday";let n=t.getDay();"monday"===o&&(n=0===n?6:n-1);const l=new Date(t),a=new Date(l.getTime()+24*(6-n)*60*60*1e3);a>e&&a.setDate(e.getDate());const h=gk(l),d=r?.({dateIndex:h,startDate:l,endDate:a})||h.toString(),c={days:Math.ceil((a.getTime()-l.getTime())/864e5)+1,startDate:l,endDate:a,title:d,dateIndex:h};s.push(c),t.setDate(t.getDate()+(7-n))}return s}function Ck(t,e,i,o,n){let r=t[3]??10;"right"===e||"end"===e?r=o-0-(t[1]??10):"center"===e&&(r=0+(o-0+(t[3]??10)-(t[1]??10))/2);let s=0+(t[0]??10);return"bottom"===i||"alphabetic"===i||"ideographic"===i?s=n-0-(t[2]??10):"middle"===i&&(s=0+(n-0-(t[0]??10)-(t[2]??10))/2+(t[0]??10)),{x:r,y:s}}class wk{group;_scene;constructor(t){this._scene=t;const e=new cs({x:0,y:0,width:t._gantt.getAllColsWidth(),height:t._gantt.getAllHeaderRowsHeight(),clip:!0,pickable:!1});this.group=e,e.name="date-header-container",t.tableGroup.addChild(this.group);let i=0;for(let o=0;o<t._gantt.headerLevel;o++){const n=new cs({x:0,y:i,width:t._gantt.getAllColsWidth(),height:Array.isArray(t._gantt.parsedOptions.headerRowHeight)?t._gantt.parsedOptions.headerRowHeight[o]:t._gantt.parsedOptions.headerRowHeight,clip:!1});i+=n.attribute.height,n.name="row-header",e.addChild(n);const{unit:r,timelineDates:s,customLayout:l}=t._gantt.sortedTimelineScales[o];let a=0;for(let e=0;e<s.length;e++){const{days:i,endDate:r,startDate:h,title:d,dateIndex:c}=s[e],u=new cs({x:a,y:0,width:t._gantt.parsedOptions.colWidthPerDay*i,height:n.attribute.height,clip:!1,fill:t._gantt.parsedOptions.timelineHeaderBackgroundColor});let g;u.name="date-cell";let p=!0;const f=t._gantt.parsedOptions.colWidthPerDay*s[e].days,m=n.attribute.height;if(l){let t;if("function"==typeof l){t=l({width:f,height:m,index:e,startDate:h,endDate:r,days:i,dateIndex:c,title:d,ganttInstance:this._scene._gantt})}else t=l;t&&(g=t.rootContainer,p=t.renderDefaultText??!1,g.name="task-bar-custom-render"),g&&u.appendChild(g)}if(p){const{padding:e,textAlign:i,textBaseline:n,textOverflow:r,fontSize:s,fontWeight:l,color:a,strokeColor:h}=t._gantt.parsedOptions.timelineHeaderStyles[o],c=Ck(uk(e),i,n,f,m),g=new il({x:c.x,y:c.y,maxLineWidth:f,heightLimit:m,pickable:!0,text:d.toLocaleString(),fontSize:s,fontWeight:l,fill:a,stroke:h,lineWidth:2,textAlign:i,textBaseline:n,ellipsis:"clip"===r?"":"ellipsis"===r?"...":Q(r)?r:void 0});u.appendChild(g)}if(n.addChild(u),e>0){const e=pa({pickable:!1,stroke:t._gantt.parsedOptions.timelineHeaderVerticalLineStyle?.lineColor,lineWidth:t._gantt.parsedOptions.timelineHeaderVerticalLineStyle?.lineWidth,points:[{x:1&t._gantt.parsedOptions.timelineHeaderVerticalLineStyle?.lineWidth?.5:0,y:0},{x:1&t._gantt.parsedOptions.timelineHeaderVerticalLineStyle?.lineWidth?.5:0,y:n.attribute.height}]});u.appendChild(e)}a+=f}if(o>0){const e=pa({pickable:!1,stroke:t._gantt.parsedOptions.timelineHeaderHorizontalLineStyle?.lineColor,lineWidth:t._gantt.parsedOptions.timelineHeaderHorizontalLineStyle?.lineWidth,points:[{x:0,y:1&t._gantt.parsedOptions.timelineHeaderHorizontalLineStyle?.lineWidth?.5:0},{x:t._gantt.getAllColsWidth(),y:1&t._gantt.parsedOptions.timelineHeaderHorizontalLineStyle?.lineWidth?.5:0}]});n.addChild(e)}}}setX(t){this.group.setAttribute("x",t)}setY(t){this.group.setAttribute("y",t)}resize(){this.group.setAttribute("width",this.group.attribute?.width??0),this.group.setAttribute("height",this.group.attribute?.height??0)}}class xk extends cs{barRect;progressRect;textLabel;constructor(t){super(t)}}const _k='<svg width="100" height="200" xmlns="http://www.w3.org/2000/svg">\n <line x1="30" y1="10" x2="30" y2="190" stroke="black" stroke-width="4"/>\n <line x1="70" y1="10" x2="70" y2="190" stroke="black" stroke-width="4"/>\n</svg>';class Sk{group;barContainer;hoverBarGroup;hoverBarLeftIcon;hoverBarRightIcon;_scene;width;height;constructor(t){this._scene=t,this.width=t._gantt.tableNoFrameWidth,this.height=t._gantt.gridHeight,this.group=new cs({x:0,y:t._gantt.getAllHeaderRowsHeight(),width:this.width,height:this.height,pickable:!1,clip:!0}),this.group.name="task-bar-container",t.tableGroup.addChild(this.group),this.initBars(),this.initHoverBarIcons()}initBars(){this.barContainer=new cs({x:0,y:0,width:this._scene._gantt.getAllColsWidth(),height:this._scene._gantt.getAllGridHeight(),pickable:!1,clip:!0}),this.group.appendChild(this.barContainer);for(let t=0;t<this._scene._gantt.itemCount;t++){const e=this.initBar(t);e&&this.barContainer.appendChild(e)}}initBar(t){const e=this._scene._gantt.parsedOptions.taskBarCustomLayout,{startDate:i,endDate:o,taskDays:n,progress:r,taskRecord:s}=this._scene._gantt.getTaskInfoByTaskListIndex(t);if(n<=0)return null;const l=this._scene._gantt.parsedOptions.colWidthPerDay*n,a=this._scene._gantt.parsedOptions.taskBarStyle.width,h=new Date(this._scene._gantt.parsedOptions.minDate),d=new xk({x:this._scene._gantt.parsedOptions.colWidthPerDay*Math.ceil(Math.abs(i.getTime()-h.getTime())/864e5),y:this._scene._gantt.parsedOptions.rowHeight*t+(this._scene._gantt.parsedOptions.rowHeight-a)/2,width:l,height:a,cornerRadius:this._scene._gantt.parsedOptions.taskBarStyle.cornerRadius,clip:!0});let c;d.name="task-bar";let u=!0,g=!0;if(e){let h;if("function"==typeof e){h=e({width:l,height:a,index:t,startDate:i,endDate:o,taskDays:n,progress:r,taskRecord:s,ganttInstance:this._scene._gantt})}else h=e;h&&(c=h.rootContainer,u=h.renderDefaultBar??!1,g=h.renderDefaultText??!1,c.name="task-bar-custom-render")}if(u){const t=ba({x:0,y:0,width:l,height:a,fill:this._scene._gantt.parsedOptions.taskBarStyle.barColor,pickable:!1});t.name="task-bar-rect",d.appendChild(t),d.barRect=t;const e=ba({x:0,y:0,width:l*r/100,height:a,fill:this._scene._gantt.parsedOptions.taskBarStyle.completedBarColor,pickable:!1});e.name="task-bar-progress-rect",d.appendChild(e),d.progressRect=e}if(c&&d.appendChild(c),g){const{textAlign:t,textBaseline:e,fontSize:i,fontFamily:o,textOverflow:n,color:r,padding:h}=this._scene._gantt.parsedOptions.taskBarLabelStyle,c=Ck(uk(h),t,e,l,a),u=ol({pickable:!1,x:c.x,y:c.y,fontSize:i,fill:r,fontFamily:o,text:ck(this._scene._gantt.parsedOptions.taskBarLabelText,s),maxLineWidth:l-20,textBaseline:e,textAlign:t,ellipsis:"clip"===n?"":"ellipsis"===n?"...":Q(n)?n:void 0});d.appendChild(u),d.textLabel=u}return d}updateTaskBarNode(t){const e=this.barContainer.getChildren()?.[t];if(e){this.barContainer.removeChild(e);const i=this.initBar(t);i&&this.barContainer.insertInto(i,t)}}initHoverBarIcons(){const t=new cs({x:0,y:0,width:100,height:100,clip:!0,cursor:this._scene._gantt.parsedOptions.taskBarMoveable?"grab":"default",pickable:!1,cornerRadius:this._scene._gantt.parsedOptions.taskBarStyle.cornerRadius,fill:this._scene._gantt.parsedOptions.taskBarHoverColor,visibleAll:!1});if(this.hoverBarGroup=t,t.name="task-bar-hover-shadow",this._scene._gantt.parsedOptions.taskBarResizable){const e=new wa({x:0,y:0,width:10,height:20,image:_k,pickable:!0,cursor:"col-resize"});e.name="task-bar-hover-shadow-left-icon",this.hoverBarLeftIcon=e,t.appendChild(e);const i=new wa({x:0,y:0,width:10,height:20,image:_k,pickable:!0,cursor:"col-resize"});i.name="task-bar-hover-shadow-right-icon",this.hoverBarRightIcon=i,t.appendChild(i)}}setX(t){this.barContainer.setAttribute("x",t)}setY(t){this.barContainer.setAttribute("y",t)}refreshItems(){this.height=this._scene._gantt.gridHeight,this.group.setAttribute("height",this.height),this.barContainer.removeAllChild(),this.group.removeChild(this.barContainer),this.initBars()}resize(){this.width=this._scene._gantt.tableNoFrameWidth,this.height=this._scene._gantt.gridHeight,this.group.setAttribute("width",this.width),this.group.setAttribute("height",this.height)}showHoverBar(t,e,i,o,n){n&&"task-bar"===n.name&&n.appendChild(this.hoverBarGroup),this.hoverBarGroup.setAttribute("x",0),this.hoverBarGroup.setAttribute("y",0),this.hoverBarGroup.setAttribute("width",i),this.hoverBarGroup.setAttribute("height",o),this.hoverBarGroup.setAttribute("visibleAll",!0),this.hoverBarLeftIcon&&(this.hoverBarLeftIcon.setAttribute("x",0),this.hoverBarLeftIcon.setAttribute("y",Math.ceil(o/10)),this.hoverBarLeftIcon.setAttribute("width",10),this.hoverBarLeftIcon.setAttribute("height",o-2*Math.ceil(o/10)),this.hoverBarRightIcon.setAttribute("x",i-10),this.hoverBarRightIcon.setAttribute("y",Math.ceil(o/10)),this.hoverBarRightIcon.setAttribute("width",10),this.hoverBarRightIcon.setAttribute("height",o-2*Math.ceil(o/10)))}hideHoverBar(){this.hoverBarGroup.setAttribute("visibleAll",!1)}}class Ak{_scene;group;markLine;markLIneContainer;markLineContainerWidth=20;height;constructor(t){this._scene=t,this.markLine=t._gantt.parsedOptions.markLine,this.height=Math.min(t._gantt.tableNoFrameHeight,t._gantt.drawHeight)-t._gantt.getAllHeaderRowsHeight(),this.group=new cs({x:0,y:t._gantt.getAllHeaderRowsHeight(),width:t._gantt.tableNoFrameWidth,height:this.height,pickable:!1,clip:!0}),this.group.name="mark-line-container",t.tableGroup.addChild(this.group),this.markLIneContainer=new cs({x:0,y:0,width:this._scene._gantt.getAllColsWidth(),height:this.height,pickable:!1,clip:!0}),this.group.appendChild(this.markLIneContainer),this.initMarkLines()}initMarkLines(){this.markLine.forEach((t=>{const e=t.style,i=new Date(t.date),o=new Date(this._scene._gantt.parsedOptions.minDate),n=this._scene._gantt.parsedOptions.colWidthPerDay*Math.ceil(Math.abs(i.getTime()-o.getTime())/864e5),r=new cs({pickable:!1,x:n-this.markLineContainerWidth/2,y:0,width:this.markLineContainerWidth,height:this.height});r.name="mark-line",this.markLIneContainer.appendChild(r);const s=pa({pickable:!1,stroke:e.lineColor,lineWidth:e.lineWidth,lineDash:e.lineDash,points:[{x:n,y:0},{x:n,y:this.height}]});r.appendChild(s)}))}refresh(){this.height=Math.min(this._scene._gantt.tableNoFrameHeight,this._scene._gantt.drawHeight)-this._scene._gantt.getAllHeaderRowsHeight(),this.markLIneContainer.removeAllChild(),this.group.setAttribute("height",this.height),this.markLIneContainer.setAttribute("height",this.height),this.initMarkLines()}setX(t){this.markLIneContainer.setAttribute("x",t)}}class Bk{_scene;border;constructor(t){this._scene=t,this.createFrameBorder()}createFrameBorder(){const t=this._scene.tableGroup,e=this._scene._gantt.parsedOptions.frameStyle;if(!e)return;const{cornerRadius:i,borderColor:o,borderLineWidth:n,borderLineDash:r}=e,s={},l={pickable:!1};if(n&&(l.stroke=!0,l.fill=!1,l.stroke=o,l.lineWidth=n,r&&(l.lineDash=r),l.lineCap="butt"),i&&(l.cornerRadius=[0,10,10,0],s.cornerRadius=[0,10,10,0]),t.setAttributes(s),l.stroke){l.x=-n/2,l.y=n/2,l.pickable=!1,l.width=t.attribute.width+n/2+n/2,l.height=t.attribute.height+n/2+n/2;const e=ba(l);e.name="border-rect",t.parent.insertAfter(e,t),t.border=e,this.border=e}}resize(){this._scene._gantt.parsedOptions.frameStyle,this.border.setAttributes({width:this._scene.tableGroup.attribute.width+this.border.attribute.lineWidth,height:this._scene.tableGroup.attribute.height+this.border.attribute.lineWidth})}}class Rk{dateStepWidth;rowHeight;_scales;timelineHeader;grid;taskBar;_gantt;tableGroup;scrollbarComponent;markLine;frameBorder;stage;tableGroupWidth;tableGroupHeight;constructor(t){let e,i;this._gantt=t,this.tableGroupWidth=t.tableNoFrameWidth,this.tableGroupHeight=Math.min(t.tableNoFrameHeight,t.drawHeight),"node"===nk.mode||(du.setEnv("browser"),e=t.canvas.width,i=t.canvas.height),this.stage=Hu({canvas:t.canvas,width:e,height:i,disableDirtyBounds:!1,enableLayout:!0,autoRender:!1}),this.stage.defaultLayer.setTheme({group:{boundsPadding:0,strokeBoundsBuffer:0,lineJoin:"round"},text:{ignoreBuf:!0}}),this.initSceneGraph()}initSceneGraph(){const t=this;t.tableGroup=new cs({x:0,y:t._gantt.tableY,width:this.tableGroupWidth,height:this.tableGroupHeight,clip:!0,pickable:!1}),t.stage.defaultLayer.add(t.tableGroup),t.tableGroup.name="table",t.timelineHeader=new wk(t),t.grid=new ok(t),t.taskBar=new Sk(t),t.markLine=new Ak(t),t.frameBorder=new Bk(t),t.scrollbarComponent=new rk(t._gantt),t.stage.defaultLayer.addChild(t.scrollbarComponent.hScrollBar),t.stage.defaultLayer.addChild(t.scrollbarComponent.vScrollBar)}afterCreateSceneGraph(){this.scrollbarComponent.updateScrollBar(),function(t){const i=t._gantt,o=i.stateManager,n=i.scenegraph;n.scrollbarComponent.vScrollBar.addEventListener("pointerover",(t=>{n.scrollbarComponent.showVerticalScrollBar()})),n.scrollbarComponent.hScrollBar.addEventListener("pointerover",(t=>{n.scrollbarComponent.showHorizontalScrollBar()})),n.scrollbarComponent.vScrollBar.addEventListener("pointerout",(t=>{o.interactionState!==e.scrolling&&n.scrollbarComponent.hideVerticalScrollBar()})),n.scrollbarComponent.hScrollBar.addEventListener("pointerout",(t=>{o.interactionState!==e.scrolling&&n.scrollbarComponent.hideHorizontalScrollBar()})),n.scrollbarComponent.vScrollBar.addEventListener("pointermove",(t=>{t.stopPropagation()})),n.scrollbarComponent.vScrollBar.addEventListener("scrollDown",(t=>{n._gantt.eventManager.isDown=!0})),n.scrollbarComponent.vScrollBar.addEventListener("pointerup",(()=>{n._gantt.eventManager.isDraging=!1,o.interactionState===e.scrolling&&o.updateInteractionState(e.default)})),n.scrollbarComponent.vScrollBar.addEventListener("pointerupoutside",(()=>{o.interactionState===e.scrolling&&o.updateInteractionState(e.default)})),n.scrollbarComponent.vScrollBar.addEventListener("scrollUp",(t=>{n._gantt.eventManager.isDraging=!1})),n.scrollbarComponent.hScrollBar.addEventListener("pointermove",(t=>{t.stopPropagation()})),n.scrollbarComponent.hScrollBar.addEventListener("pointerdown",(t=>{t.stopPropagation()})),n.scrollbarComponent.hScrollBar.addEventListener("scrollDown",(t=>{n._gantt.eventManager.isDown=!0,o.interactionState!==e.scrolling&&o.updateInteractionState(e.scrolling)})),n.scrollbarComponent.hScrollBar.addEventListener("pointerup",(()=>{o.interactionState===e.scrolling&&o.updateInteractionState(e.default)})),n.scrollbarComponent.hScrollBar.addEventListener("pointerupoutside",(()=>{o.interactionState===e.scrolling&&o.updateInteractionState(e.default)})),n.scrollbarComponent.hScrollBar.addEventListener("scrollUp",(t=>{n._gantt.eventManager.isDraging=!1}));const r=sk(o.updateVerticalScrollBar,20),s=sk(o.updateHorizontalScrollBar,20);n.scrollbarComponent.vScrollBar.addEventListener("scrollDrag",(t=>{n._gantt.eventManager.isDown&&(n._gantt.eventManager.isDraging=!0),o.interactionState!==e.scrolling&&o.updateInteractionState(e.scrolling);const i=t.detail.value[0]/(1-t.detail.value[1]+t.detail.value[0]);r(i,t)})),n.scrollbarComponent.hScrollBar.addEventListener("scrollDrag",(t=>{n._gantt.eventManager.isDown&&(n._gantt.eventManager.isDraging=!0),o.fastScrolling=!0,o.interactionState!==e.scrolling&&o.updateInteractionState(e.scrolling);const i=t.detail.value[0]/(1-t.detail.value[1]+t.detail.value[0]);s(i)}))}(this._gantt.eventManager)}refreshTaskBars(){this.taskBar.refreshItems(),this.updateNextFrame()}refreshTaskBarsAndGrid(){this.tableGroupHeight=Math.min(this._gantt.tableNoFrameHeight,this._gantt.drawHeight),this.tableGroup.setAttribute("height",this.tableGroupHeight),this.grid.refresh(),this.taskBar.refreshItems(),this.markLine.refresh(),this.frameBorder.resize(),this.scrollbarComponent.updateScrollBar(),this.updateNextFrame()}updateTableSize(){this.tableGroupHeight=Math.min(this._gantt.tableNoFrameHeight,this._gantt.drawHeight),this.tableGroup.setAttributes({x:0,y:this._gantt.tableY,width:this._gantt.tableNoFrameWidth,height:this.tableGroupHeight}),this.grid.resize(),this.taskBar.resize(),this.frameBorder.resize()}renderSceneGraph(){this.stage.render()}updateNextFrame(){this.stage.renderNextFrame()}get width(){return this.tableGroup.attribute?.width??0}get height(){return this.tableGroup.attribute?.height??0}get x(){return this.tableGroup.attribute?.x??0}get y(){return this.tableGroup.attribute?.y??0}setX(t,e=!1){this.timelineHeader.setX(t),this.grid.setX(t),this.taskBar.setX(t),this.markLine.setX(t),this.updateNextFrame()}setY(t,e=!1){this.grid.setY(t),this.taskBar.setY(t),this.updateNextFrame()}setPixelRatio(t){this.stage.disableDirtyBounds(),this.stage.window.setDpr(t),this.stage.render(),this.stage.enableDirtyBounds()}resize(){this.updateTableSize(),this.scrollbarComponent.updateScrollBar(),this.updateNextFrame()}release(){this.stage.release()}}const Mk=(t,e)=>(t=>{switch(Object.prototype.toString.call(t)){case"[object Object]":return"object";case"[object Function]":return"function";case"[object Array]":return"array";case"[object String]":return"string";case"[object Number]":return"number";case"[object RegExp]":return"regExp";case"[object Boolean]":return"boolean";case"[object Symbol]":return"symbol";case"[object Date]":return"date";case"[object Undefined]":return"undefined";case"[object Null]":return"null";case"[object Error]":return"error";case"[object HTMLDocument]":return"document";case"[object global]":return"global";default:return null}})(t)===e;function Tk(t,e,i){let o,n,r,s,l,a,h=0,d=!1,c=!1,u=!0;const g=!e&&0!==e&&"function"==typeof requestAnimationFrame;if("function"!=typeof t)throw new TypeError("Expected a function");function p(e){const i=o,r=n;return n=void 0,o=void 0,h=e,s=t.apply(r,i),s}function f(t,e){return g?requestAnimationFrame(t):setTimeout(t,e)}function m(t){const i=t-a;return void 0===a||i>=e||i<0||d&&t-h>=r}function b(){const t=Date.now();if(m(t))return function(t){return l=void 0,u&&o?p(t):(n=void 0,o=void 0,s)}(t);l=f(b,function(t){const i=t-h,o=e&&-(t-a);return d?Math.min(o,r-i):o}(t))}return e=+e||0,Mk(i,"object")&&(c=!!i.leading,d="maxWait"in i,d&&(r=Math.max(+i.maxWait||0,e)),u="trailing"in i?!!i.trailing:u),function(...t){const i=Date.now(),r=m(i);if(o=t,n=this,a=i,r){if(void 0===l)return function(t){return h=t,l=f(b,e),c?p(t):s}(a);if(d)return l=f(b,e),p(a)}return void 0===l&&(l=f(b,e)),s}}let kk=1;class Pk{resizeTime=100;element;cb;observer;lastSize={width:0,height:0};callBackDebounce;constructor(t,e,i){if(this.element=t,this.cb=e,this.lastSize=this.getSize(),i&&(this.resizeTime=Math.max(i,16)),this.callBackDebounce=Tk(this.callBack,this.resizeTime),window?.addEventListener("resize",this.onResize),"ResizeObserver"in window){const t=window.ResizeObserver;this.observer=new t(this.mutationResize),this.observer?.observe(this.element)}else"MutationObserver"in window&&(this.observer=new MutationObserver(this.mutationResize),this.observer.observe(this.element,{attributes:!0,attributeFilter:["style"]}))}mutationResize=()=>{this.onResize()};disConnect(){window.removeEventListener("resize",this.onResize),this.observer&&(this.observer.disconnect(),this.observer=void 0)}callBack=()=>{const t=this.getSize();let e=!1;t.width===this.lastSize.width&&t.height===this.lastSize.height&&(e=!0),this.lastSize=t,this.cb&&this.cb({...this.lastSize,windowSizeNotChange:e})};setSize(t){this.lastSize=t}onResize=()=>{this.callBackDebounce()};checkSize(){const t=this.getSize();return t.width!==this.lastSize.width||t.height!==this.lastSize.height}getSize(){return this.element?{width:Math.floor(this.element.clientWidth),height:Math.floor(this.element.clientHeight)}:{...this.lastSize}}}class Ek{resizeTime;listeners={};reseizeListeners={};on(t,e,i,...o){if("node"===nk.mode)return-1;const n=kk++;if(t?.addEventListener)if("resize"!==e||t===window)t?.addEventListener(e,i,...o);else{const e=new Pk(t,i,this.resizeTime);this.reseizeListeners[n]=e}const r={target:t,type:e,listener:i,options:o};return this.listeners[n]=r,n}once(t,e,i,...o){if("node"===nk.mode)return-1;const n=this.on(t,e,((...t)=>{this.off(n),i(...t)}),...o);return n}off(t){if("node"===nk.mode)return;if(null==t)return;const e=this.listeners?.[t];e&&(delete this.listeners[t],e.target.removeEventListener&&e.target.removeEventListener(e.type,e.listener,...e.options))}fire(t,e,...i){if("node"!==nk.mode)for(const o in this.listeners){const n=this.listeners[o];n.target===t&&n.type===e&&n.listener.call(n.target,...i)}}hasListener(t,e){if("node"===nk.mode)return!1;let i=!1;for(const o in this.listeners){const n=this.listeners[o];n.target===t&&n.type===e&&(i=!0)}return i}clear(){if("node"!==nk.mode){for(const t in this.listeners){const e=this.listeners[t];e.target.removeEventListener&&e.target.removeEventListener(e.type,e.listener,...e.options)}for(const t in this.reseizeListeners){const e=this.reseizeListeners[t];e?.disConnect()}this.listeners={}}}release(){"node"!==nk.mode&&(this.clear(),this.listeners={})}}let Lk=1;function Hk(){return fk?Lk=1:(Lk=Math.ceil(window.devicePixelRatio||1),Lk>1&&Lk%2!=0&&(Lk+=1)),Lk}Hk();class zk{_gantt;_eventHandler;isDown=!1;isDraging=!1;lastDragPointerXYOnWindow;constructor(t){this._gantt=t,this._eventHandler=new Ek,this.bindEvent()}release(){this._eventHandler.release()}bindEvent(){!function(t){const i=t._gantt.scenegraph,o=t._gantt,n=o.stateManager;i.tableGroup.addEventListener("pointerdown",(t=>{if(0!==t.button)return;const i=t.detailPath.find((t=>"task-bar"===t.name));i&&("task-bar-hover-shadow-left-icon"===t.target.name?(n.startResizeTaskBar(i,t.nativeEvent.x,t.nativeEvent.y,"left"),n.updateInteractionState(e.grabing)):"task-bar-hover-shadow-right-icon"===t.target.name?(n.startResizeTaskBar(i,t.nativeEvent.x,t.nativeEvent.y,"right"),n.updateInteractionState(e.grabing)):o.parsedOptions.taskBarMoveable&&(n.startMoveTaskBar(i,t.nativeEvent.x,t.nativeEvent.y),n.updateInteractionState(e.grabing)))})),i.tableGroup.addEventListener("pointermove",(t=>{if(n.interactionState===e.default){t.detailPath.find((t=>"task-bar"===t.name))?n.showTaskBarHover(t):n.hideTaskBarHover()}})),i.tableGroup.addEventListener("pointerenter",(t=>{(o.parsedOptions.scrollStyle.horizontalVisible&&"focus"===o.parsedOptions.scrollStyle.horizontalVisible||!o.parsedOptions.scrollStyle.horizontalVisible&&"focus"===o.parsedOptions.scrollStyle.visible)&&i.scrollbarComponent.showHorizontalScrollBar(),(o.parsedOptions.scrollStyle.verticalVisible&&"focus"===o.parsedOptions.scrollStyle.verticalVisible||!o.parsedOptions.scrollStyle.verticalVisible&&"focus"===o.parsedOptions.scrollStyle.visible)&&i.scrollbarComponent.showVerticalScrollBar()})),i.tableGroup.addEventListener("pointerleave",(t=>{(o.parsedOptions.scrollStyle.horizontalVisible&&"focus"===o.parsedOptions.scrollStyle.horizontalVisible||!o.parsedOptions.scrollStyle.horizontalVisible&&"focus"===o.parsedOptions.scrollStyle.visible)&&i.scrollbarComponent.hideHorizontalScrollBar(),(o.parsedOptions.scrollStyle.verticalVisible&&"focus"===o.parsedOptions.scrollStyle.verticalVisible||!o.parsedOptions.scrollStyle.verticalVisible&&"focus"===o.parsedOptions.scrollStyle.visible)&&i.scrollbarComponent.hideVerticalScrollBar()}))}(this),function(t){const i=t._gantt;t._gantt.scenegraph;const o=i.stateManager,n=t._eventHandler;n.on(i.getElement(),"wheel",(e=>{pk(e,o,t._gantt)})),n.on(i.getContainer(),"resize",(t=>{0===t.width&&0===t.height||(Q(i.options.pixelRatio)||i.setPixelRatio(Hk()),t.windowSizeNotChange||i._resize())})),n.on(i.resizeLine,"mousedown",(t=>{o.updateInteractionState(e.grabing),o.startResizeTableWidth(t)})),du.addEventListener("mousedown",(t=>{i.eventManager.lastDragPointerXYOnWindow={x:t.x,y:t.y}})),du.addEventListener("mousemove",(t=>{if(o.interactionState===e.grabing){const e=i.eventManager.lastDragPointerXYOnWindow?.x??t.x,n=i.eventManager.lastDragPointerXYOnWindow?.y??t.y;Math.abs(e-t.x)+Math.abs(n-t.y)>=1&&(o.isResizingTableWidth()?o.dealResizeTableWidth(t):o.isMoveingTaskBar()?o.dealTaskBarMove(t):o.isResizingTaskBar()&&o.dealTaskBarResize(t),i.eventManager.lastDragPointerXYOnWindow={x:t.x,y:t.y})}})),du.addEventListener("mouseup",(t=>{"grabing"===o.interactionState&&(o.updateInteractionState(e.default),o.isResizingTableWidth()?o.endResizeTableWidth():o.isMoveingTaskBar()?o.endMoveTaskBar(t.x):o.isResizingTaskBar()&&o.endResizeTaskBar(t.x))}))}(this)}}function Fk(t){const{scroll:e}=t.stateManager,{verticalBarPos:i}=e;t.taskListTableInstance.stateManager.setScrollTop(i,!1)}class Ik{_gantt;scroll;fastScrolling;interactionState=e.default;moveTaskBar;hoverTaskBar;resizeTaskBar;resizeTableWidth;resetInteractionState=Tk((()=>{this.updateInteractionState(e.default)}),100);constructor(t){this._gantt=t,this.scroll={horizontalBarPos:0,verticalBarPos:0},this.moveTaskBar={targetStartX:null,startX:null,startY:null,moving:!1,target:null},this.hoverTaskBar={targetStartX:null,startX:null,target:null},this.resizeTaskBar={targetStartX:null,startX:null,startY:null,target:null,resizing:!1,onIconName:""},this.resizeTableWidth={lastX:null,resizing:!1},this.updateVerticalScrollBar=this.updateVerticalScrollBar.bind(this),this.updateHorizontalScrollBar=this.updateHorizontalScrollBar.bind(this),function(t){t.taskListTableInstance&&t.taskListTableInstance?.on("scroll",(e=>{if("vertical"===e.scrollDirection){const{scroll:e}=t.taskListTableInstance.stateManager,{verticalBarPos:i}=e;t.stateManager.setScrollTop(i,!1)}}))}(this._gantt),function(t){t.taskListTableInstance&&"auto"===t.options.taskListTable?.width&&t.taskListTableInstance?.on("resize_column",(e=>{t.taskTableWidth=t.taskListTableInstance.getAllColsWidth()+2*t.taskListTableInstance.tableX,t.element.style.left=t.taskTableWidth?`${t.taskTableWidth}px`:"0px",t._resize()}))}(this._gantt),function(t){t.taskListTableInstance?.on("change_cell_value",(e=>{const{col:i,row:o,rawValue:n,changedValue:r}=e;t.redrawRecord(o-t.taskListTableInstance.columnHeaderLevelCount)}))}(this._gantt),function(t){t.taskListTableInstance?.on("change_header_position",(e=>{t.scenegraph.refreshTaskBars();const i=t.stateManager.scroll.horizontalBarPos,o=t.stateManager.scroll.verticalBarPos;t.scenegraph.setX(-i),t.scenegraph.setY(-o)}))}(this._gantt),function(t){t.taskListTableInstance?.on("tree_hierarchy_state_change",(e=>{t._syncPropsFromTable(),t.resizeLine.style.height=t.drawHeight+"px",t.scenegraph.refreshTaskBarsAndGrid();const i=t.stateManager.scroll.horizontalBarPos,o=t.stateManager.scroll.verticalBarPos;t.scenegraph.setX(-i),t.scenegraph.setY(-o)}))}(this._gantt)}setScrollTop(t,e=!0){const i=this._gantt.getAllRowsHeight();t=Math.max(0,Math.min(t,i-this._gantt.scenegraph.height)),t=Math.ceil(t);const n=this.scroll.verticalBarPos;this.scroll.verticalBarPos=t,Q(this.scroll.verticalBarPos)&&!isNaN(this.scroll.verticalBarPos)||(this.scroll.verticalBarPos=0),this._gantt.scenegraph.setY(-t);const r=t/(i-this._gantt.scenegraph.height);this._gantt.scenegraph.scrollbarComponent.updateVerticalScrollBarPos(r),n!==t&&e&&(Fk(this._gantt),this._gantt.fireListeners(o.SCROLL,{scrollTop:this.scroll.verticalBarPos,scrollLeft:this.scroll.horizontalBarPos,scrollDirection:"vertical",scrollRatioY:r}))}setScrollLeft(t,e=!0){const i=this._gantt.getAllColsWidth();t=Math.max(0,Math.min(t,i-this._gantt.scenegraph.width)),t=Math.ceil(t);const n=this.scroll.horizontalBarPos;this.scroll.horizontalBarPos=t,Q(this.scroll.horizontalBarPos)&&!isNaN(this.scroll.horizontalBarPos)||(this.scroll.horizontalBarPos=0),this._gantt.scenegraph.setX(-t);const r=t/(i-this._gantt.scenegraph.width);this._gantt.scenegraph.scrollbarComponent.updateHorizontalScrollBarPos(r),n!==t&&e&&this._gantt.fireListeners(o.SCROLL,{scrollTop:this.scroll.verticalBarPos,scrollLeft:this.scroll.horizontalBarPos,scrollDirection:"horizontal",scrollRatioX:r})}updateInteractionState(t){if(this.interactionState===t)return;const i=this.interactionState;this.interactionState=t,i===e.scrolling&&e.default}updateVerticalScrollBar(t){const e=this._gantt.getAllRowsHeight();this.scroll.verticalBarPos,this.scroll.verticalBarPos=Math.ceil(t*(e-this._gantt.scenegraph.height)),Q(this.scroll.verticalBarPos)&&!isNaN(this.scroll.verticalBarPos)||(this.scroll.verticalBarPos=0),this._gantt.scenegraph.setY(-this.scroll.verticalBarPos,1===t),Fk(this._gantt),this._gantt.fireListeners(o.SCROLL,{scrollTop:this.scroll.verticalBarPos,scrollLeft:this.scroll.horizontalBarPos,scrollDirection:"vertical",scrollRatioY:t})}updateHorizontalScrollBar(t){const e=this._gantt.getAllColsWidth();this.scroll.horizontalBarPos,this.scroll.horizontalBarPos=Math.ceil(t*(e-this._gantt.scenegraph.width)),Q(this.scroll.horizontalBarPos)&&!isNaN(this.scroll.horizontalBarPos)||(this.scroll.horizontalBarPos=0),this._gantt.scenegraph.setX(-this.scroll.horizontalBarPos,1===t),this._gantt.fireListeners(o.SCROLL,{scrollTop:this.scroll.verticalBarPos,scrollLeft:this.scroll.horizontalBarPos,scrollDirection:"horizontal",scrollRatioY:t})}startMoveTaskBar(t,e,i){"task-bar-hover-shadow"===t.name&&(t=t.parent),this.moveTaskBar.moving=!0,this.moveTaskBar.target=t,this.moveTaskBar.targetStartX=t.attribute.x,this.moveTaskBar.startX=e,this.moveTaskBar.startY=i}isMoveingTaskBar(){return this.moveTaskBar.moving}endMoveTaskBar(t){const e=t-this.moveTaskBar.startX,i=Math.round(e/this._gantt.parsedOptions.colWidthPerDay),o=i*this._gantt.parsedOptions.colWidthPerDay,n=this.moveTaskBar.targetStartX+o;this._gantt.stateManager.moveTaskBar.target.setAttribute("x",n);const r=bk(this.moveTaskBar.startY,this._gantt);this._gantt.updateDateToTaskRecord("move",i,r),this.moveTaskBar.moving=!1,this.moveTaskBar.target=null,this._gantt.scenegraph.updateNextFrame()}dealTaskBarMove(t){const e=this.moveTaskBar.target,i=this._gantt.eventManager.lastDragPointerXYOnWindow.x,o=t.x-i;e.setAttribute("x",e.attribute.x+o),this._gantt.scenegraph.updateNextFrame()}startResizeTaskBar(t,e,i,o){this.resizeTaskBar.onIconName=o,this.resizeTaskBar.resizing=!0,this.resizeTaskBar.target=t,this.resizeTaskBar.targetStartX=t.attribute.x,this.resizeTaskBar.startX=e,this.resizeTaskBar.startY=i}isResizingTaskBar(){return this.resizeTaskBar.resizing}endResizeTaskBar(t){const e=this._gantt.stateManager.resizeTaskBar.onIconName,i=t-this.resizeTaskBar.startX;let o=Math.round(i/this._gantt.parsedOptions.colWidthPerDay);o="left"===e?-o:o;const n=this._gantt.stateManager.resizeTaskBar.target,r=this._gantt.stateManager.resizeTaskBar.target.barRect,s=this._gantt.stateManager.resizeTaskBar.target.progressRect,l=bk(this.resizeTaskBar.startY,this._gantt),{taskDays:a,progress:h}=this._gantt.getTaskInfoByTaskListIndex(l);o<0&&a+o<=0&&(o=1-a);const d=("left"===e?-o:o)*this._gantt.parsedOptions.colWidthPerDay,c=this.resizeTaskBar.targetStartX+d,u=this._gantt.parsedOptions.colWidthPerDay*(a+o);"left"===e?(n.setAttribute("x",c),n.setAttribute("width",u),r?.setAttribute("width",n.attribute.width),s?.setAttribute("width",h/100*n.attribute.width),this._gantt.updateDateToTaskRecord("start-move",-o,l)):"right"===e&&(n.setAttribute("width",u),r?.setAttribute("width",n.attribute.width),s?.setAttribute("width",h/100*n.attribute.width),this._gantt.updateDateToTaskRecord("end-move",o,l)),this._gantt.scenegraph.taskBar.showHoverBar(n.attribute.x,n.attribute.y,n.attribute.width,n.attribute.height),Ok(this._gantt,n,l),this.resizeTaskBar.resizing=!1,this.resizeTaskBar.target=null,this._gantt.scenegraph.updateNextFrame()}dealTaskBarResize(t){const e=this._gantt.eventManager.lastDragPointerXYOnWindow.x,i=t.x-e,o=this._gantt.stateManager.resizeTaskBar.target,n=o.barRect,r=o.progressRect,s=o.textLabel,l=this._gantt.parsedOptions.progressField,a=bk(this.resizeTaskBar.startY,this._gantt),h=this._gantt.getRecordByIndex(a)[l];let d="left"===this._gantt.stateManager.resizeTaskBar.onIconName?-i:i,c=o.attribute.width+d;d<0&&c<=this._gantt.parsedOptions.colWidthPerDay&&(d=this._gantt.parsedOptions.colWidthPerDay-o.attribute.width,c+=d),o.setAttribute("width",c),"left"===this._gantt.stateManager.resizeTaskBar.onIconName&&o.setAttribute("x",o.attribute.x-d),n?.setAttribute("width",o.attribute.width),r?.setAttribute("width",h/100*o.attribute.width),s?.setAttribute("x","center"===this._gantt.parsedOptions.taskBarLabelStyle.textAlign?c/2:"left"===this._gantt.parsedOptions.taskBarLabelStyle.textAlign?10:c-10),s?.setAttribute("maxLineWidth",c-20);const u=o.attribute.x,g=o.attribute.y,p=o.attribute.width,f=o.attribute.height;this._gantt.scenegraph.taskBar.showHoverBar(u,g,p,f,this.resizeTaskBar.target),Ok(this._gantt,o,a),this._gantt.scenegraph.updateNextFrame()}startResizeTableWidth(t){this.resizeTableWidth.resizing=!0,this.resizeTableWidth.lastX=t.pageX}isResizingTableWidth(){return this.resizeTableWidth.resizing}endResizeTableWidth(){this.resizeTableWidth.resizing=!1}dealResizeTableWidth(t){if(!this.resizeTableWidth.resizing)return;const e=t.pageX-this.resizeTableWidth.lastX;if(Math.abs(e)>=1){let i=this._gantt.taskTableWidth+e;const o=Math.min(this._gantt.taskListTableInstance.getAllColsWidth()+2*this._gantt.tableX,this._gantt.options.taskListTable.maxWidth??1e5),n=Math.max(2*this._gantt.tableX,this._gantt.options.taskListTable.minWidth??0);e>0&&i>o&&(i=o),e<0&&i<n&&(i=n),this._gantt.taskTableWidth=i,this._gantt.element.style.left=this._gantt.taskTableWidth?`${this._gantt.taskTableWidth}px`:"0px",this._gantt.resizeLine.style.left=this._gantt.taskTableWidth?this._gantt.taskTableWidth-7+"px":"0px",this._gantt._resize(),this.resizeTableWidth.lastX=t.pageX}}showTaskBarHover(t){const e=t.detailPath.find((t=>"task-bar"===t.name));if(this._gantt.stateManager.hoverTaskBar.target!==e){this._gantt.stateManager.hoverTaskBar.target=e;const t=this._gantt.stateManager.hoverTaskBar.target,i=t.attribute.x,o=t.attribute.y,n=t.attribute.width,r=t.attribute.height;this._gantt.scenegraph.taskBar.showHoverBar(i,o,n,r,e),this._gantt.scenegraph.updateNextFrame()}}hideTaskBarHover(){this._gantt.stateManager.hoverTaskBar.target=null,this._gantt.scenegraph.taskBar.hideHoverBar(),this._gantt.scenegraph.updateNextFrame()}}function Ok(t,e,i){const o=t.parsedOptions.taskBarCustomLayout;if(o){let n;if("function"==typeof o){const{startDate:r,endDate:s,taskDays:l,progress:a,taskRecord:h}=t.getTaskInfoByTaskListIndex(i);n=o({width:e.attribute.width,height:e.attribute.height,index:i,startDate:r,endDate:s,taskDays:l,progress:a,taskRecord:h,ganttInstance:t})}else n=o;if(n){const t=n.rootContainer;t.name="task-bar-custom-render";const i=e.children.findIndex((t=>"task-bar-custom-render"===t.name)),o=e.children[i];e.removeChild(o),e.insertInto(t,i)}}}let Dk=1,Wk=class{listenersData={listeners:{},listenerData:{}};on(t,e){const i=this.listenersData.listeners[t]||(this.listenersData.listeners[t]=[]);i.push(e);const o=Dk++;return this.listenersData.listenerData[o]={type:t,listener:e,remove:()=>{delete this.listenersData.listenerData[o];const n=i.indexOf(e);i.splice(n,1),this.listenersData.listeners[t].length||delete this.listenersData.listeners[t]}},o}off(t,e){if(e){const i=t;this.removeEventListener(i,e)}else{const e=t;if(!this.listenersData)return;this.listenersData.listenerData[e]?.remove()}}addEventListener(t,e,i){this.on(t,e)}removeEventListener(t,e){if(this.listenersData)for(const i in this.listenersData.listenerData){const o=this.listenersData.listenerData[i];o.type===t&&o.listener===e&&this.off(i)}}hasListeners(t){return!!this.listenersData&&!!this.listenersData.listeners[t]}fireListeners(t,e){if(!this.listenersData)return[];const i=this.listenersData.listeners[t];return i?i.map((t=>t.call(this,e))).filter((t=>Q(t))):[]}release(){delete this.listenersData}};class Nk{records;minDate;maxDate;_gantt;constructor(t){this._gantt=t,this.records=t.records,this.minDate=t.parsedOptions.minDate,this.maxDate=t.parsedOptions.maxDate,this.processRecords()}processRecords(){const t=!this.minDate,e=!this.maxDate;let i=Number.MAX_SAFE_INTEGER,o=Number.MIN_SAFE_INTEGER;if(t||e){for(let n=0;n<this.records.length;n++){const r=this.records[n];t&&(i=Math.min(i,new Date(r[this._gantt.parsedOptions.startDateField]).getTime())),e&&(o=Math.max(o,new Date(r[this._gantt.parsedOptions.endDateField]).getTime()))}t&&(this.minDate=new Date(i)),e&&(this.maxDate=new Date(o)),this._gantt.parsedOptions.minDate=this.minDate,this._gantt.parsedOptions.maxDate=this.maxDate,this._gantt.parsedOptions._minDateTime=this._gantt.parsedOptions.minDate.getTime(),this._gantt.parsedOptions._maxDateTime=this._gantt.parsedOptions.maxDate.getTime()}}}var Gk=Object.freeze({__proto__:null,formatDate:lk,getWeekNumber:gk});t.Gantt=class extends Wk{options;container;canvasWidth;canvasHeight;tableNoFrameWidth;tableNoFrameHeight;tableX;tableY;scenegraph;stateManager;eventManager;taskListTableInstance;canvas;element;resizeLine;context;sortedTimelineScales;reverseSortedTimelineScales;headerLevel;itemCount;drawHeight;headerHeight;gridHeight;parsedOptions={};taskTableWidth;taskTableColumns;records;data;constructor(t,e){super(),this.container=t,this.options=e,this.taskTableWidth="number"==typeof e?.taskListTable?.width?e?.taskListTable?.width:100,this.taskTableColumns=e?.taskListTable?.columns??[],this.records=e?.records??[],vk(this),this.data=new Nk(this),this._sortScales(),this._generateTimeLineDateMap(),this.headerLevel=this.sortedTimelineScales.length,this.element=function(t,e="vtable-gantt"){const i=document.createElement("div");i.setAttribute("tabindex","0"),i.classList.add(e),i.style.outline="none",i.style.margin=`${t.top}px ${t.right}px ${t.bottom}px ${t.left}px`;const o=(i.offsetWidth||i.parentElement?.offsetWidth||1)-1,n=(i.offsetHeight||i.parentElement?.offsetHeight||1)-1;return i.style.width=o&&o-t.left-t.right+"px"||"0px",i.style.height=n&&n-t.top-t.bottom+"px"||"0px",i}({top:0,right:0,left:0,bottom:0},"vtable-gantt"),this.element.style.top="0px",this.element.style.left=this.taskTableWidth?`${this.taskTableWidth}px`:"0px",this.canvas=document.createElement("canvas"),this.element.appendChild(this.canvas),this.context=this.canvas.getContext("2d"),t?(t.appendChild(this.element),this._updateSize()):this._updateSize(),this._generateListTable(),this._syncPropsFromTable(),this._createResizeLine(),this.scenegraph=new Rk(this),this.stateManager=new Ik(this),this.eventManager=new zk(this),this.scenegraph.afterCreateSceneGraph()}renderTaskTable(){this.scenegraph.updateNextFrame()}_updateSize(){let t=0,e=0;if("browser"===nk.mode){const i=this.getElement();let o=0,n=0;if(i.parentElement){const t=i.parentElement.style||window.getComputedStyle(i.parentElement);o=i.parentElement.offsetWidth-parseInt(t.paddingLeft||"0px",10)-parseInt(t.paddingRight||"0px",10),n=i.parentElement.offsetHeight-parseInt(t.paddingTop||"0px",10)-parseInt(t.paddingBottom||"0px",20)}const r=(o??1)-1-this.taskTableWidth,s=(n??1)-1;i.style.width=r&&`${r}px`||"0px",i.style.height=s&&`${s}px`||"0px";const{canvas:l}=this;t=l.parentElement?.offsetWidth??1,e=l.parentElement?.offsetHeight??1,this?.scenegraph?.stage?this.scenegraph.stage.resize(t,e):(l.style.width="",l.style.height="",l.width=t,l.height=e,l.style.width=`${t}px`,l.style.height=`${e}px`)}else"node"===nk.mode&&(t=this.canvasWidth-1,e=this.canvasHeight-1);const i=Math.floor(t-(o=this.parsedOptions.scrollStyle,o?.hoverOn||o?.verticalVisible&&"none"===o?.verticalVisible||!o?.verticalVisible&&"none"===o?.visible?0:o?.width??7));var o;const n=Math.floor(e-function(t){return t?.hoverOn||t?.horizontalVisible&&"none"===t?.horizontalVisible||!t?.horizontalVisible&&"none"===t?.visible?0:t?.width??7}(this.parsedOptions.scrollStyle));if(this.tableNoFrameWidth=t,this.tableNoFrameHeight=Math.floor(e),this.parsedOptions.frameStyle){const t=this.parsedOptions.frameStyle?.borderLineWidth;this.tableX=t,this.tableY=t,this.tableNoFrameWidth=i-t,this.tableNoFrameHeight=n-2*t}}_generateListTable(){if(this.taskTableColumns.length>=1){const t=this._generateListTableOptions();if(this.taskListTableInstance=new ik(this.container,t),"auto"===this.options?.taskListTable?.width&&(this.taskTableWidth=this.taskListTableInstance.getAllColsWidth()+2*this.taskListTableInstance.tableX,this.element.style.left=this.taskTableWidth?`${this.taskTableWidth}px`:"0px",this.taskListTableInstance.setCanvasSize(this.taskTableWidth,this.tableNoFrameHeight+2*this.parsedOptions.frameStyle.borderLineWidth),this._updateSize()),this.taskListTableInstance.columnHeaderLevelCount>1)if(Array.isArray(this.parsedOptions.headerRowHeight)&&this.taskListTableInstance.columnHeaderLevelCount===this.parsedOptions.headerRowHeight.length)for(let t=0;t<this.taskListTableInstance.columnHeaderLevelCount;t++)this.taskListTableInstance.setRowHeight(t,this.parsedOptions.headerRowHeight[t]);else{const t=this.getAllHeaderRowsHeight()/this.taskListTableInstance.columnHeaderLevelCount;for(let e=0;e<this.taskListTableInstance.columnHeaderLevelCount;e++)this.taskListTableInstance.setRowHeight(e,t)}}}_generateListTableOptions(){const t={},e=["container","records","pixelRatio","overscrollBehavior","pixelRatio"];for(const i in this.options)e.indexOf(i)>=0&&(t[i]=this.options[i]);for(const e in this.options.taskListTable)t[e]=this.options.taskListTable[e];return t.theme={scrollStyle:Object.assign({},this.parsedOptions.scrollStyle,{verticalVisible:"none"}),headerStyle:Object.assign({},Ow.headerStyle,{bgColor:this.parsedOptions.timelineHeaderBackgroundColor},this.options.taskListTable.headerStyle),cellInnerBorder:!1,frameStyle:Object.assign({},this.parsedOptions.frameStyle,{cornerRadius:this.parsedOptions.frameStyle.cornerRadius,borderLineWidth:[this.parsedOptions.frameStyle.borderLineWidth,0,this.parsedOptions.frameStyle.borderLineWidth,this.parsedOptions.frameStyle.borderLineWidth]}),bodyStyle:Object.assign({},Ow.bodyStyle,this.options.taskListTable.bodyStyle)},t.canvasWidth=this.taskTableWidth,t.canvasHeight=this.canvasHeight??this.canvas.height,t.defaultHeaderRowHeight=this.getAllHeaderRowsHeight(),t.defaultRowHeight=this.parsedOptions.rowHeight,t.clearDOM=!1,t}_createResizeLine(){if(this.taskListTableInstance&&"auto"!==this.options.taskListTable.width){this.resizeLine=document.createElement("div"),this.resizeLine.style.position="absolute",this.resizeLine.style.top=this.tableY+"px",this.resizeLine.style.left=this.taskTableWidth?this.taskTableWidth-7+"px":"0px",this.resizeLine.style.width="14px",this.resizeLine.style.height=this.drawHeight+"px",this.resizeLine.style.backgroundColor="rgba(0,0,0,0)",this.resizeLine.style.zIndex="100",this.resizeLine.style.cursor="col-resize",this.resizeLine.style.userSelect="none",this.resizeLine.style.opacity="1";const t=document.createElement("div");t.style.position="absolute",t.style.top="0px",t.style.left="5px",t.style.width=this.parsedOptions.resizeLineStyle.lineWidth+"px",t.style.height="100%",t.style.backgroundColor=this.parsedOptions.resizeLineStyle.lineColor,t.style.zIndex="100",t.style.cursor="col-resize",t.style.userSelect="none",t.style.pointerEvents="none",t.style.opacity="0",t.style.transition="background-color 0.3s",this.resizeLine.appendChild(t),this.resizeLine.addEventListener("mouseover",(()=>{t.style.opacity="1"})),this.resizeLine.addEventListener("mouseout",(()=>{t.style.opacity="0"})),this.container.appendChild(this.resizeLine)}}getElement(){return this.element}getContainer(){return this.element.parentElement}_sortScales(){const{timelineHeader:t}=this.options;if(t){const e=t.scales,i=["year","quarter","month","week","day"],o=e.slice().sort(((t,e)=>{const o=i.indexOf(t.unit),n=i.indexOf(e.unit);return-1===o?1:-1===n?-1:o-n})),n=e.slice().sort(((t,e)=>{const o=i.indexOf(t.unit),n=i.indexOf(e.unit);return-1===o?1:-1===n?-1:n-o}));this.sortedTimelineScales=o,this.reverseSortedTimelineScales=n}}_generateTimeLineDateMap(){const t=new Date(this.parsedOptions.minDate),e=new Date(this.parsedOptions.maxDate);let i=1e6;for(const i of this.reverseSortedTimelineScales){const o=new Date(t);i.timelineDates=yk(o,e,i)}const o=this.reverseSortedTimelineScales[0],{unit:n,step:r}=o;"day"===n?i=r:"month"===n?i=30:"week"===n?i=7:"quarter"===n?i=90:"year"===n&&(i=365),this.parsedOptions.colWidthPerDay=this.parsedOptions.timelineColWidth/i}getAllRowsHeight(){return this.getAllHeaderRowsHeight()+this.itemCount*this.parsedOptions.rowHeight}getAllHeaderRowsHeight(){return Array.isArray(this.parsedOptions.headerRowHeight)?this.parsedOptions.headerRowHeight.reduce(((t,e,i)=>t+e),0):this.parsedOptions.headerRowHeight*this.headerLevel}getAllColsWidth(){return this.parsedOptions.colWidthPerDay*(Math.ceil(Math.abs(new Date(this.parsedOptions.maxDate).getTime()-new Date(this.parsedOptions.minDate).getTime())/864e5)+1)}getAllGridHeight(){return this.itemCount*this.parsedOptions.rowHeight}getRecordByIndex(t){return this.taskListTableInstance?this.taskListTableInstance.getRecordByRowCol(0,t+this.taskListTableInstance.columnHeaderLevelCount):this.records[t]}redrawRecord(t){this.scenegraph.taskBar.updateTaskBarNode(t),this.scenegraph.updateNextFrame()}updateRecordToListTable(t,e){this.taskListTableInstance.updateRecords([t],[e])}getTaskInfoByTaskListIndex(t){const e=this.getRecordByIndex(t),i=this.parsedOptions.startDateField,o=this.parsedOptions.endDateField,n=this.parsedOptions.progressField,r=new Date(e[i]).getTime(),s=new Date(e[o]).getTime();if(s<this.parsedOptions._minDateTime||r>this.parsedOptions._maxDateTime)return{taskDays:0};const l=new Date(Math.min(Math.max(this.parsedOptions._minDateTime,r),this.parsedOptions._maxDateTime)),a=new Date(Math.max(Math.min(this.parsedOptions._maxDateTime,s),this.parsedOptions._minDateTime)),h=e[n];return{taskRecord:e,taskDays:Math.ceil(Math.abs(a.getTime()-l.getTime())/864e5)+1,startDate:l,endDate:a,progress:h}}updateDateToTaskRecord(t,e,i){const o=this.getRecordByIndex(i),n=this.parsedOptions.startDateField,r=this.parsedOptions.endDateField,s=function(t){const e=["yyyy-mm-dd","dd-mm-yyyy","mm/dd/yyyy","yyyy/mm/dd","dd/mm/yyyy","yyyy.mm.dd","dd.mm.yyyy","mm.dd.yyyy"];t=t.replace(/\s+/g,"");for(let i=0;i<e.length;i++){const o=e[i],n=t.split(dk(o)),r=ak(n,o);if(3===n.length&&r)return o}return null}(o[n]),l=new Date(o[n]),a=new Date(o[r]);if("move"===t){const t=lk(new Date(e*mk+l.getTime()),s),i=lk(new Date(e*mk+a.getTime()),s);o[n]=t,o[r]=i}else if("start-move"===t){const t=lk(new Date(e*mk+l.getTime()),s);o[n]=t}else if("end-move"===t){const t=lk(new Date(e*mk+a.getTime()),s);o[r]=t}this.updateRecordToListTable(o,i)}updateTaskRecord(t){const e=this.getRecordByIndex(t);this.updateRecordToListTable(e,t)}setPixelRatio(t){this.parsedOptions.pixelRatio=t,this.scenegraph.setPixelRatio(t)}_resize(){this._updateSize(),this.taskListTableInstance.setCanvasSize(this.taskTableWidth,this.tableNoFrameHeight+2*this.parsedOptions.frameStyle.borderLineWidth),this._syncPropsFromTable(),this.scenegraph.resize()}_syncPropsFromTable(){this.itemCount=this.taskListTableInstance?this.taskListTableInstance.rowCount-this.taskListTableInstance.columnHeaderLevelCount:this.records.length,this.headerHeight=this.getAllHeaderRowsHeight(),this.drawHeight=Math.min(this.headerHeight+this.parsedOptions.rowHeight*this.itemCount,this.tableNoFrameHeight),this.gridHeight=this.drawHeight-this.headerHeight}getContext(){return this.context}release(){super.release?.(),this.eventManager.release(),this.taskListTableInstance?.release();const{parentElement:t}=this.element;t&&t.removeChild(this.element),this.scenegraph=null}setRecords(t){this.records=t}},t.TYPES=n,t.tools=Gk,t.version="1.5.4"}));
|