@visactor/vtable 0.9.1 → 0.9.2-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (167) hide show
  1. package/cjs/core/BaseTable.d.ts +1 -1
  2. package/cjs/core/BaseTable.js +10 -8
  3. package/cjs/core/BaseTable.js.map +1 -1
  4. package/cjs/event/event.js +1 -1
  5. package/cjs/event/event.js.map +1 -1
  6. package/cjs/index.d.ts +1 -1
  7. package/cjs/index.js +1 -1
  8. package/cjs/index.js.map +1 -1
  9. package/cjs/layout/pivot-header-layout.d.ts +2 -0
  10. package/cjs/layout/pivot-header-layout.js +26 -0
  11. package/cjs/layout/pivot-header-layout.js.map +1 -1
  12. package/cjs/layout/pivot-layout.d.ts +2 -0
  13. package/cjs/layout/pivot-layout.js +26 -0
  14. package/cjs/layout/pivot-layout.js.map +1 -1
  15. package/cjs/layout/simple-header-layout.d.ts +2 -0
  16. package/cjs/layout/simple-header-layout.js +6 -0
  17. package/cjs/layout/simple-header-layout.js.map +1 -1
  18. package/cjs/render/layout/container.js +13 -0
  19. package/cjs/render/layout/container.js.map +1 -1
  20. package/cjs/scenegraph/graphic/text.js +5 -5
  21. package/cjs/scenegraph/graphic/text.js.map +1 -1
  22. package/cjs/scenegraph/group-creater/cell-helper.d.ts +1 -1
  23. package/cjs/scenegraph/group-creater/cell-helper.js +14 -10
  24. package/cjs/scenegraph/group-creater/cell-helper.js.map +1 -1
  25. package/cjs/scenegraph/group-creater/cell-type/chart-cell.d.ts +2 -1
  26. package/cjs/scenegraph/group-creater/cell-type/chart-cell.js +4 -4
  27. package/cjs/scenegraph/group-creater/cell-type/chart-cell.js.map +1 -1
  28. package/cjs/scenegraph/group-creater/cell-type/image-cell.d.ts +1 -1
  29. package/cjs/scenegraph/group-creater/cell-type/image-cell.js +1 -2
  30. package/cjs/scenegraph/group-creater/cell-type/image-cell.js.map +1 -1
  31. package/cjs/scenegraph/group-creater/cell-type/spark-line-cell.d.ts +2 -1
  32. package/cjs/scenegraph/group-creater/cell-type/spark-line-cell.js +2 -3
  33. package/cjs/scenegraph/group-creater/cell-type/spark-line-cell.js.map +1 -1
  34. package/cjs/scenegraph/group-creater/cell-type/text-cell.d.ts +1 -2
  35. package/cjs/scenegraph/group-creater/cell-type/text-cell.js +6 -18
  36. package/cjs/scenegraph/group-creater/cell-type/text-cell.js.map +1 -1
  37. package/cjs/scenegraph/group-creater/cell-type/video-cell.d.ts +1 -1
  38. package/cjs/scenegraph/group-creater/cell-type/video-cell.js +1 -2
  39. package/cjs/scenegraph/group-creater/cell-type/video-cell.js.map +1 -1
  40. package/cjs/scenegraph/group-creater/column-helper.js +9 -30
  41. package/cjs/scenegraph/group-creater/column-helper.js.map +1 -1
  42. package/cjs/scenegraph/group-creater/progress/proxy.d.ts +31 -12
  43. package/cjs/scenegraph/group-creater/progress/proxy.js +118 -123
  44. package/cjs/scenegraph/group-creater/progress/proxy.js.map +1 -1
  45. package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-x.d.ts +2 -0
  46. package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-x.js +112 -0
  47. package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-x.js.map +1 -0
  48. package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-y.d.ts +2 -0
  49. package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-y.js +109 -0
  50. package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-y.js.map +1 -0
  51. package/cjs/scenegraph/group-creater/progress/update-position/update-auto-row.d.ts +2 -0
  52. package/cjs/scenegraph/group-creater/progress/update-position/update-auto-row.js +24 -0
  53. package/cjs/scenegraph/group-creater/progress/update-position/update-auto-row.js.map +1 -0
  54. package/cjs/scenegraph/layout/compute-col-width.d.ts +9 -1
  55. package/cjs/scenegraph/layout/compute-col-width.js +11 -9
  56. package/cjs/scenegraph/layout/compute-col-width.js.map +1 -1
  57. package/cjs/scenegraph/layout/compute-row-height.d.ts +3 -0
  58. package/cjs/scenegraph/layout/compute-row-height.js +162 -0
  59. package/cjs/scenegraph/layout/compute-row-height.js.map +1 -0
  60. package/cjs/scenegraph/layout/update-height.js +3 -2
  61. package/cjs/scenegraph/layout/update-height.js.map +1 -1
  62. package/cjs/scenegraph/layout/update-width.js +3 -2
  63. package/cjs/scenegraph/layout/update-width.js.map +1 -1
  64. package/cjs/scenegraph/scenegraph.d.ts +4 -5
  65. package/cjs/scenegraph/scenegraph.js +23 -42
  66. package/cjs/scenegraph/scenegraph.js.map +1 -1
  67. package/cjs/scenegraph/stick-text/index.d.ts +1 -0
  68. package/cjs/scenegraph/stick-text/index.js +16 -2
  69. package/cjs/scenegraph/stick-text/index.js.map +1 -1
  70. package/cjs/scenegraph/utils/text-icon-layout.d.ts +2 -1
  71. package/cjs/scenegraph/utils/text-icon-layout.js +6 -5
  72. package/cjs/scenegraph/utils/text-icon-layout.js.map +1 -1
  73. package/cjs/state/hover/col.js +4 -4
  74. package/cjs/state/hover/col.js.map +1 -1
  75. package/cjs/tools/NumberMap.d.ts +1 -0
  76. package/cjs/tools/NumberMap.js +3 -0
  77. package/cjs/tools/NumberMap.js.map +1 -1
  78. package/cjs/ts-types/base-table.d.ts +12 -0
  79. package/cjs/ts-types/base-table.js.map +1 -1
  80. package/cjs/ts-types/list-table/layout-map/api.d.ts +2 -0
  81. package/cjs/ts-types/list-table/layout-map/api.js.map +1 -1
  82. package/dist/vtable.js +7621 -7036
  83. package/dist/vtable.min.js +2 -2
  84. package/es/core/BaseTable.d.ts +1 -1
  85. package/es/core/BaseTable.js +10 -8
  86. package/es/core/BaseTable.js.map +1 -1
  87. package/es/event/event.js +2 -2
  88. package/es/event/event.js.map +1 -1
  89. package/es/index.d.ts +1 -1
  90. package/es/index.js +1 -1
  91. package/es/index.js.map +1 -1
  92. package/es/layout/pivot-header-layout.d.ts +2 -0
  93. package/es/layout/pivot-header-layout.js +26 -0
  94. package/es/layout/pivot-header-layout.js.map +1 -1
  95. package/es/layout/pivot-layout.d.ts +2 -0
  96. package/es/layout/pivot-layout.js +26 -0
  97. package/es/layout/pivot-layout.js.map +1 -1
  98. package/es/layout/simple-header-layout.d.ts +2 -0
  99. package/es/layout/simple-header-layout.js +6 -0
  100. package/es/layout/simple-header-layout.js.map +1 -1
  101. package/es/render/layout/container.js +13 -0
  102. package/es/render/layout/container.js.map +1 -1
  103. package/es/scenegraph/graphic/text.js +5 -5
  104. package/es/scenegraph/graphic/text.js.map +1 -1
  105. package/es/scenegraph/group-creater/cell-helper.d.ts +1 -1
  106. package/es/scenegraph/group-creater/cell-helper.js +14 -9
  107. package/es/scenegraph/group-creater/cell-helper.js.map +1 -1
  108. package/es/scenegraph/group-creater/cell-type/chart-cell.d.ts +2 -1
  109. package/es/scenegraph/group-creater/cell-type/chart-cell.js +3 -5
  110. package/es/scenegraph/group-creater/cell-type/chart-cell.js.map +1 -1
  111. package/es/scenegraph/group-creater/cell-type/image-cell.d.ts +1 -1
  112. package/es/scenegraph/group-creater/cell-type/image-cell.js +0 -3
  113. package/es/scenegraph/group-creater/cell-type/image-cell.js.map +1 -1
  114. package/es/scenegraph/group-creater/cell-type/spark-line-cell.d.ts +2 -1
  115. package/es/scenegraph/group-creater/cell-type/spark-line-cell.js +1 -4
  116. package/es/scenegraph/group-creater/cell-type/spark-line-cell.js.map +1 -1
  117. package/es/scenegraph/group-creater/cell-type/text-cell.d.ts +1 -2
  118. package/es/scenegraph/group-creater/cell-type/text-cell.js +3 -17
  119. package/es/scenegraph/group-creater/cell-type/text-cell.js.map +1 -1
  120. package/es/scenegraph/group-creater/cell-type/video-cell.d.ts +1 -1
  121. package/es/scenegraph/group-creater/cell-type/video-cell.js +0 -3
  122. package/es/scenegraph/group-creater/cell-type/video-cell.js.map +1 -1
  123. package/es/scenegraph/group-creater/column-helper.js +8 -29
  124. package/es/scenegraph/group-creater/column-helper.js.map +1 -1
  125. package/es/scenegraph/group-creater/progress/proxy.d.ts +31 -12
  126. package/es/scenegraph/group-creater/progress/proxy.js +124 -123
  127. package/es/scenegraph/group-creater/progress/proxy.js.map +1 -1
  128. package/es/scenegraph/group-creater/progress/update-position/dynamic-set-x.d.ts +2 -0
  129. package/es/scenegraph/group-creater/progress/update-position/dynamic-set-x.js +104 -0
  130. package/es/scenegraph/group-creater/progress/update-position/dynamic-set-x.js.map +1 -0
  131. package/es/scenegraph/group-creater/progress/update-position/dynamic-set-y.d.ts +2 -0
  132. package/es/scenegraph/group-creater/progress/update-position/dynamic-set-y.js +102 -0
  133. package/es/scenegraph/group-creater/progress/update-position/dynamic-set-y.js.map +1 -0
  134. package/es/scenegraph/group-creater/progress/update-position/update-auto-row.d.ts +2 -0
  135. package/es/scenegraph/group-creater/progress/update-position/update-auto-row.js +18 -0
  136. package/es/scenegraph/group-creater/progress/update-position/update-auto-row.js.map +1 -0
  137. package/es/scenegraph/layout/compute-col-width.d.ts +9 -1
  138. package/es/scenegraph/layout/compute-col-width.js +9 -8
  139. package/es/scenegraph/layout/compute-col-width.js.map +1 -1
  140. package/es/scenegraph/layout/compute-row-height.d.ts +3 -0
  141. package/es/scenegraph/layout/compute-row-height.js +164 -0
  142. package/es/scenegraph/layout/compute-row-height.js.map +1 -0
  143. package/es/scenegraph/layout/update-height.js +3 -1
  144. package/es/scenegraph/layout/update-height.js.map +1 -1
  145. package/es/scenegraph/layout/update-width.js +3 -1
  146. package/es/scenegraph/layout/update-width.js.map +1 -1
  147. package/es/scenegraph/scenegraph.d.ts +4 -5
  148. package/es/scenegraph/scenegraph.js +24 -44
  149. package/es/scenegraph/scenegraph.js.map +1 -1
  150. package/es/scenegraph/stick-text/index.d.ts +1 -0
  151. package/es/scenegraph/stick-text/index.js +14 -0
  152. package/es/scenegraph/stick-text/index.js.map +1 -1
  153. package/es/scenegraph/utils/text-icon-layout.d.ts +2 -1
  154. package/es/scenegraph/utils/text-icon-layout.js +4 -4
  155. package/es/scenegraph/utils/text-icon-layout.js.map +1 -1
  156. package/es/state/hover/col.js +4 -4
  157. package/es/state/hover/col.js.map +1 -1
  158. package/es/tools/NumberMap.d.ts +1 -0
  159. package/es/tools/NumberMap.js +3 -0
  160. package/es/tools/NumberMap.js.map +1 -1
  161. package/es/ts-types/base-table.d.ts +12 -0
  162. package/es/ts-types/base-table.js.map +1 -1
  163. package/es/ts-types/list-table/layout-map/api.d.ts +2 -0
  164. package/es/ts-types/list-table/layout-map/api.js.map +1 -1
  165. package/package.json +4 -4
  166. package/dist/vtable.es5.js +0 -53155
  167. package/dist/vtable.es5.min.js +0 -3
@@ -1,3 +0,0 @@
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={})}(this,(function(t){"use strict";var e,n,i,r,o,a,s,l,h;!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"}(n||(n={})),function(t){t.top="top",t.bottom="bottom",t.left="left",t.right="right"}(i||(i={})),function(t){t.expand="expand",t.collapse="collapse",t.none="none"}(r||(r={})),function(t){t.SUM="SUM",t.MIN="MIN",t.MAX="MAX",t.AVG="AVG",t.COUNT="COUNT"}(o||(o={})),function(t){t.ASC="ASC",t.DESC="DESC"}(a||(a={})),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"}(s||(s={})),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"}(l||(l={})),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"}(h||(h={}));var u=Object.freeze({__proto__:null,get AggregationType(){return o},get HierarchyState(){return r},get HighlightScope(){return n},get IconFuncTypeEnum(){return l},get IconPosition(){return s},get InteractionState(){return e},get InternalIconName(){return h},get Placement(){return i},get SortType(){return a}});const c=(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,d=t=>c(t,"object"),f=t=>c(t,"function"),p=t=>c(t,"string"),g=t=>c(t,"number"),v=t=>c(t,"undefined"),y=t=>c(t,"null");function m(t,...e){if(!e.length)return t||{};const n=e.shift();if(d(t)&&d(n))for(const e in n)d(n[e])?(t[e]||Object.assign(t,{[e]:{}}),d(t[e])||Object.assign(t,{[e]:n[e]}),m(t[e],n[e])):null!==n[e]&&void 0!==n[e]&&Object.assign(t,{[e]:n[e]});return m(t,...e)}function b(t){if(!t)return t;let e;if([Number,String,Boolean].forEach((function(n){t instanceof n&&(e=n(t))})),void 0===e)if("[object Array]"===Object.prototype.toString.call(t))e=[],t.forEach((function(t,n){e[n]=b(t)}));else if("object"==typeof t)if(t.nodeType&&"function"==typeof t.cloneNode)e=t.cloneNode(!0);else if(t.prototype)e=t.constructor?new t.constructor:t;else if(t instanceof Date)e=new Date(t);else if(t.clone)e=t.clone();else{e={};for(const n in t)e[n]=b(t[n])}else e=t;return e}function w(t){return"function"==typeof t&&(t=t()),k(t)?`${t}`:""}function C(t){if(t?.length<=0)return t;const e=t.length,n=t[0].length,i=new Array(n);for(let r=0;r<e;r++)for(let o=0;o<n;o++)i[o]||(i[o]=new Array(e)),i[o][r]=t[r][o];return i}function x(t,e){let n=null;return function(...i){n||(t.apply(this,i),n=setTimeout((()=>{n=null}),e)),console.log("throttle")}}function _(t,e){for(t=`${t}`;t.length<e;)t="0"+t;return t}function S(t,e,n){t=(t=t.replace(/^\s*|\s*$/,"")).replace(/^#?([a-f0-9])([a-f0-9])([a-f0-9])$/i,"#$1$1$2$2$3$3");const i=Math.round(256*e)*(n?-1:1),r=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")),o=r&&k(r[4])?r[4]:null,a=r?[r[1],r[2],r[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 r?`rgb${null!==o?"a":""}(${Math[n?"max":"min"](parseInt(a[0],10)+i,n?0:255)}, ${Math[n?"max":"min"](parseInt(a[1],10)+i,n?0:255)}, ${Math[n?"max":"min"](parseInt(a[2],10)+i,n?0:255)}${null!==o?`, ${o}`:""})`:["#",_(Math[n?"max":"min"](parseInt(a[0],10)+i,n?0:255).toString(16),2),_(Math[n?"max":"min"](parseInt(a[1],10)+i,n?0:255).toString(16),2),_(Math[n?"max":"min"](parseInt(a[2],10)+i,n?0:255).toString(16),2)].join("")}function k(t){return!v(t)&&!y(t)}function A(t){return v(t)||y(t)?"":t.toString()}function R(){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 B(t,e,n){return"desc"!==n?t===e?0:t>e?1:-1:t===e?0:t<e?1:-1}let T,M=1,P=class{listenersData={listeners:{},listenerData:{}};listen(t,e){const n=this.listenersData.listeners[t]||(this.listenersData.listeners[t]=[]);n.push(e);const i=M++;return this.listenersData.listenerData[i]={type:t,listener:e,remove:()=>{delete this.listenersData.listenerData[i];const r=n.indexOf(e);n.splice(r,1),this.listenersData.listeners[t].length||delete this.listenersData.listeners[t]}},i}unlisten(t){this.listenersData&&this.listenersData.listenerData[t].remove()}addEventListener(t,e,n){this.listen(t,e)}removeEventListener(t,e){if(this.listenersData)for(const n in this.listenersData.listenerData){const i=this.listenersData.listenerData[n];i.type===t&&i.listener===e&&this.unlisten(n)}}hasListeners(t){return!!this.listenersData&&!!this.listenersData.listeners[t]}fireListeners(t,...e){if(!this.listenersData)return[];const n=this.listenersData.listeners[t];return n?n.map((t=>t.call(this,...e))).filter((t=>k(t))):[]}dispose(){delete this.listenersData}};const E={CHANGE_STYLE:"change_style"};let H,O,L,I=class t extends P{_color;_fontSize;_fontFamily;_fontWeight;_fontVariant;_fontStyle;_padding;_defaultPadding=[10,16,10,16];_textStick;_textOverflow;_textAlign;_textBaseline;_bgColor;_borderColor;_lineHeight;_underline;_underlineColor;_underlineDash;_lineThrough;_lineThroughColor;_lineThroughDash;_linkColor;_cursor;_borderLineWidth;_borderLineDash;_marked;static get EVENT_TYPE(){return E}static get DEFAULT(){return T||(T=new t)}constructor(t={},e={}){super(),this._textAlign=t?.textAlign??e?.textAlign,this._textBaseline=t?.textBaseline??e?.textBaseline,this._color=t?.color??e?.color,this._fontSize=t.fontSize??e?.fontSize,this._fontFamily=t.fontFamily??e?.fontFamily,this._fontWeight=t.fontWeight??e?.fontWeight,this._fontVariant=t.fontVariant??e?.fontVariant,this._fontStyle=t.fontStyle??e?.fontStyle,this._padding=t?.padding??e?.padding??this._defaultPadding,this._borderColor=t?.borderColor??e?.borderColor,this._textOverflow=t?.textOverflow??e?.textOverflow,this._textStick=t.textStick??e?.textStick??!1,this._bgColor=t?.bgColor??e?.bgColor,this._lineHeight=t?.lineHeight??e?.lineHeight,this._underline=t?.underline??e?.underline,this._underlineColor=t?.underlineColor??e?.underlineColor,this._underlineDash=t?.underlineDash??e?.underlineDash,this._lineThrough=t?.lineThrough??e?.lineThrough,this._lineThroughColor=t?.lineThroughColor??e?.lineThroughColor,this._lineThroughDash=t?.lineThroughDash??e?.lineThroughDash,this._linkColor=t?.linkColor??e?.linkColor,this._cursor=t.cursor??e?.cursor,this._borderLineWidth=t.borderLineWidth??e?.borderLineWidth,this._borderLineDash=t.borderLineDash??e?.borderLineDash,this._marked=t.marked??e?.marked}get color(){return this._color}set color(t){this._color=t,this.doChangeStyle()}get fontSize(){return this._fontSize}set fontSize(t){this._fontSize=t,this.doChangeStyle()}get fontFamily(){return this._fontFamily}set fontFamily(t){this._fontFamily=t,this.doChangeStyle()}get fontWeight(){return this._fontWeight}set fontWeight(t){this._fontWeight=t,this.doChangeStyle()}get fontVariant(){return this._fontVariant}set fontVariant(t){this._fontVariant=t,this.doChangeStyle()}get fontStyle(){return this._fontStyle}set fontStyle(t){this._fontStyle=t,this.doChangeStyle()}get padding(){return this._padding}set padding(t){this._padding=t,this.doChangeStyle()}get textOverflow(){return this._textOverflow}set textOverflow(t){this._textOverflow=t,this.doChangeStyle()}get bgColor(){return this._bgColor}set bgColor(t){this._bgColor=t,this.doChangeStyle()}get borderColor(){return this._borderColor}set borderColor(t){this._borderColor=t,this.doChangeStyle()}get textStick(){return this._textStick}set textStick(t){this._textStick=t,this.doChangeStyle()}get textAlign(){return this._textAlign}set textAlign(t){this._textAlign=t,this.doChangeStyle()}get textBaseline(){return this._textBaseline}set textBaseline(t){this._textBaseline=t,this.doChangeStyle()}get lineHeight(){return this._lineHeight}set lineHeight(t){this._lineHeight=t,this.doChangeStyle()}get underline(){return this._underline}set underline(t){this._underline=t,this.doChangeStyle()}get underlineColor(){return this._underlineColor}set underlineColor(t){this._underlineColor=t,this.doChangeStyle()}get underlineDash(){return this._underlineDash}set underlineDash(t){this._underlineDash=t,this.doChangeStyle()}get lineThrough(){return this._lineThrough}set lineThrough(t){this._lineThrough=t,this.doChangeStyle()}get lineThroughColor(){return this._lineThroughColor}set lineThroughColor(t){this._lineThroughColor=t,this.doChangeStyle()}get lineThroughDash(){return this._lineThroughDash}set lineThroughDash(t){this._lineThroughDash=t,this.doChangeStyle()}get linkColor(){return this._linkColor}set linkColor(t){this._linkColor=t,this.doChangeStyle()}get cursor(){return this._cursor}set cursor(t){this._cursor=t,this.doChangeStyle()}get borderLineWidth(){return this._borderLineWidth}set borderLineWidth(t){this._borderLineWidth=t,this.doChangeStyle()}get borderLineDash(){return this._borderLineDash}set borderLineDash(t){this._borderLineDash=t,this.doChangeStyle()}get marked(){return this._marked}set marked(t){this._marked=t,this.doChangeStyle()}doChangeStyle(){this.fireListeners(E.CHANGE_STYLE)}clone(){return new t(this,null)}},D=class t extends I{static get DEFAULT(){return H||(H=new t)}constructor(t={},e={}){super(t,e)}clone(){return new t(this,null)}};class W extends I{_autoWrapText;_lineClamp;static get DEFAULT(){return O||(O=new W)}constructor(t={},e={}){super(t,e),this._autoWrapText=t?.autoWrapText??e?.autoWrapText,this._lineClamp=t?.lineClamp??e?.lineClamp}clone(){return new W(this,null)}get lineClamp(){return this._lineClamp}set lineClamp(t){this._lineClamp=t,this.doChangeStyle()}get autoWrapText(){return this._autoWrapText}set autoWrapText(t){this._autoWrapText=t,this.doChangeStyle()}}function F(t,e,n,i=I,r){return t||e?t instanceof I?t:"function"==typeof t?F(t(n),e,n,i,r):(t||(t={}),r&&!k(t.autoWrapText)&&(t.autoWrapText=!0),new i(t??{},e??{})):i.DEFAULT}const z={CHANGE_STYLE:"change_style"};class j extends P{_color;_fontSize;_fontFamily;_fontWeight;_fontVariant;_fontStyle;_textOverflow;_padding;_defaultPadding=[10,16,10,16];_textStick;_marked;_textAlign;_textBaseline;_bgColor;_borderColor;_lineHeight;_underline;_underlineColor;_underlineDash;_lineThrough;_lineThroughColor;_lineThroughDash;_linkColor;_cursor;_borderLineWidth;_borderLineDash;static get EVENT_TYPE(){return z}static get DEFAULT(){return L||(L=new j)}constructor(t={},e={}){super(),this._color=t.color??e?.color,this._fontSize=t.fontSize??e?.fontSize,this._fontFamily=t.fontFamily??e?.fontFamily,this._fontWeight=t.fontWeight??e?.fontWeight,this._fontVariant=t.fontVariant??e?.fontVariant,this._fontStyle=t.fontStyle??e?.fontStyle,this._textOverflow=(t.textOverflow??e?.textOverflow)||"ellipsis",this._textStick=t.textStick??e?.textStick??!1,this._marked=t.marked??e?.marked??!1,this._textAlign=(t.textAlign??e?.textAlign)||"left",this._textBaseline=(t.textBaseline??e?.textBaseline)||"middle",this._bgColor=t.bgColor??e?.bgColor,this._padding=t.padding??e?.padding??this._defaultPadding,this._borderColor=t.borderColor??e?.borderColor,this._lineHeight=t.lineHeight??e?.lineHeight,this._underline=t.underline??e?.underline,this._underlineColor=t.underlineColor??e?.underlineColor,this._underlineDash=t.underlineDash??e?.underlineDash,this._lineThrough=t.lineThrough??e?.lineThrough,this._lineThroughColor=t.lineThroughColor??e?.lineThroughColor,this._lineThroughDash=t.lineThroughDash??e?.lineThroughDash,this._linkColor=t.linkColor??e?.linkColor,this._cursor=t.cursor??e?.cursor,this._borderLineWidth=t.borderLineWidth??e?.borderLineWidth,this._borderLineDash=t.borderLineDash??e?.borderLineDash}get bgColor(){return this._bgColor}set bgColor(t){this._bgColor=t,this.doChangeStyle()}get color(){return this._color}set color(t){this._color=t,this.doChangeStyle()}get fontSize(){return this._fontSize}set fontSize(t){this._fontSize=t,this.doChangeStyle()}get fontFamily(){return this._fontFamily}set fontFamily(t){this._fontFamily=t,this.doChangeStyle()}get fontWeight(){return this._fontWeight}set fontWeight(t){this._fontWeight=t,this.doChangeStyle()}get fontVariant(){return this._fontVariant}set fontVariant(t){this._fontVariant=t,this.doChangeStyle()}get fontStyle(){return this._fontStyle}set fontStyle(t){this._fontStyle=t,this.doChangeStyle()}get textOverflow(){return this._textOverflow}set textOverflow(t){this._textOverflow=t,this.doChangeStyle()}get padding(){return this._padding??this._defaultPadding}set padding(t){this._padding=t,this.doChangeStyle()}get borderColor(){return this._borderColor}set borderColor(t){this._borderColor=t,this.doChangeStyle()}get textStick(){return this._textStick}set textStick(t){this._textStick=t,this.doChangeStyle()}get marked(){return this._marked}set marked(t){this._marked=t,this.doChangeStyle()}get textAlign(){return this._textAlign}set textAlign(t){this._textAlign=t,this.doChangeStyle()}get textBaseline(){return this._textBaseline}set textBaseline(t){this._textBaseline=t,this.doChangeStyle()}get lineHeight(){return this._lineHeight}set lineHeight(t){this._lineHeight=t,this.doChangeStyle()}get underline(){return this._underline}set underline(t){this._underline=t,this.doChangeStyle()}get underlineColor(){return this._underlineColor}set underlineColor(t){this._underlineColor=t,this.doChangeStyle()}get underlineDash(){return this._underlineDash}set underlineDash(t){this._underlineDash=t,this.doChangeStyle()}get lineThrough(){return this._lineThrough}set lineThrough(t){this._lineThrough=t,this.doChangeStyle()}get lineThroughColor(){return this._lineThroughColor}set lineThroughColor(t){this._lineThroughColor=t,this.doChangeStyle()}get lineThroughDash(){return this._lineThroughDash}set lineThroughDash(t){this._lineThroughDash=t,this.doChangeStyle()}get linkColor(){return this._linkColor}set linkColor(t){this._linkColor=t,this.doChangeStyle()}get cursor(){return this._cursor}set cursor(t){this._cursor=t,this.doChangeStyle()}get borderLineWidth(){return this._borderLineWidth}set borderLineWidth(t){this._borderLineWidth=t,this.doChangeStyle()}get borderLineDash(){return this._borderLineDash}set borderLineDash(t){this._borderLineDash=t,this.doChangeStyle()}doChangeStyle(){this.fireListeners(z.CHANGE_STYLE)}clone(){return new j(this)}}let N;class G extends j{_autoWrapText;_lineClamp;static get DEFAULT(){return N||(N=new G)}constructor(t={},e=null){super(t,e),this._autoWrapText=t?.autoWrapText??e?.autoWrapText,this._lineClamp=t?.lineClamp??e?.lineClamp}clone(){return new G(this,null)}get lineClamp(){return this._lineClamp}set lineClamp(t){this._lineClamp=t,this.doChangeStyle()}get autoWrapText(){return this._autoWrapText}set autoWrapText(t){this._autoWrapText=t,this.doChangeStyle()}}function U(t,e,n,i,r){return t||e?t instanceof j?t:"function"==typeof t?U(t(n),e,n,i,r):(t||(t={}),r&&!k(t.autoWrapText)&&(t.autoWrapText=!0),new i(t??{},e??{})):i.DEFAULT}function K(t){return t?.hoverOn||"none"===t?.visible?0:t?.width??7}const V="undefined"==typeof window||void 0===window.window;let Y,X;const $={get find(){return Y||(Y=Array.prototype.find?(t,e)=>Array.prototype.find.call(t,e):(t,e)=>{const n=$.findIndex(t,e);return n>=0?t[n]:void 0},Y)},get findIndex(){return X||(X=Array.prototype.findIndex?(t,e)=>Array.prototype.findIndex.call(t,e):(t,e)=>{const{length:n}=t;for(let i=0;i<n;i++){if(e(t[i],i,t))return i}return-1},X)}};const{IE:q,Chrome:Z,Firefox:J,Edge:Q,Safari:et}=function(){if(V)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 nt(...t){const e={};return t.forEach((t=>{for(const n in t)Object.defineProperty(e,n,{get:()=>t[n],set(e){t[n]=e},configurable:!0,enumerable:!0})})),e}function it(t,e,...n){let i=t;for(let t=0;t<n.length&&null!=i;t++)i=e(i,n[t]);return i}function rt(t,...e){return it(t,((t,e)=>t[e]),...e)}function ot(t,...e){return"function"==typeof t?t(...e):t}function at(t){return Boolean(t&&"function"==typeof t.then)}function st(t,e,n){return t.start.col<=e&&e<=t.end.col&&t.start.row<=n&&n<=t.end.row||t.end.col<=e&&e<=t.start.col&&t.end.row<=n&&n<=t.start.row}function lt(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 ht(t,e){const n=lt(t),i=lt(e);if(Math.max(n.start.col,i.start.col)<=Math.min(n.end.col,i.end.col)){if(Math.max(n.start.row,i.start.row)<=Math.min(n.end.row,i.end.row))return!0}return!1}const ut=q,ct={isObject:function(t){return t===Object(t)}},dt={endsWith:function(t,e,n){const i=A(t);("number"!=typeof n||!isFinite(n)||Math.floor(n)!==n||n>i.length)&&(n=i.length),n-=e.length;const r=i.lastIndexOf(e,n);return-1!==r&&r===n}},ft={isTouchEvent:function(t){return!!t.changedTouches}},pt={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]}},gt=Function.prototype,vt={CLICK_CELL:"click_cell",DBLCLICK_CELL:"dblclick_cell",MOUSEDOWN_CELL:"mousedown_cell",MOUSEUP_CELL:"mouseup_cell",SELECTED_CELL:"selected_cell",KEYDOWN:"keydown",MOUSEENTER_TABLE:"mouseenter_table",MOUSELEAVE_TABLE:"mouseleave_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",CHANGE_HEADER_POSITION:"change_header_position",SORT_CLICK:"sort_click",FREEZE_CLICK:"freeze_click",SCROLL:"scroll",DROPDOWNMENU_CLICK:"dropdownmenu_click",MOUSEOVER_CHART_SYMBOL:"mouseover_chart_symbol",DRAG_SELECT_END:"drag_select_end",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"},yt=(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 mt(t,e,n){let i,r,o,a,s,l,h=0,u=!1,c=!1,d=!0;const f=!e&&0!==e&&"function"==typeof requestAnimationFrame;if("function"!=typeof t)throw new TypeError("Expected a function");function p(e){const n=i,o=r;return r=void 0,i=void 0,h=e,a=t.apply(o,n),a}function g(t,e){return f?requestAnimationFrame(t):setTimeout(t,e)}function v(t){const n=t-l;return void 0===l||n>=e||n<0||u&&t-h>=o}function y(){const t=Date.now();if(v(t))return function(t){return s=void 0,d&&i?p(t):(r=void 0,i=void 0,a)}(t);s=g(y,function(t){const n=t-h,i=e&&-(t-l);return u?Math.min(i,o-n):i}(t))}return e=+e||0,yt(n,"object")&&(c=!!n.leading,u="maxWait"in n,u&&(o=Math.max(+n.maxWait||0,e)),d="trailing"in n?!!n.trailing:d),function(...t){const n=Date.now(),o=v(n);if(i=t,r=this,l=n,o){if(void 0===s)return function(t){return h=t,s=g(y,e),c?p(t):a}(l);if(u)return s=g(y,e),p(l)}return void 0===s&&(s=g(y,e)),a}}class bt{static _mode;static get mode(){return bt._mode||(bt._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}()),bt._mode}static set mode(t){bt._mode=t}static dpr=0;static CreateCanvas;static LoadImage;static RequestAnimationFrame;static CancelAnimationFrame;static RegisterCreateCanvas(t){bt.CreateCanvas=t}static RegisterLoadImage(t){bt.LoadImage=t}static GetCreateCanvasFunc(){return bt.CreateCanvas?bt.CreateCanvas:"worker"===bt.mode?(t=200,e=200)=>new OffscreenCanvas(t,e):void 0}static RegisterRequestAnimationFrame(t){bt.RequestAnimationFrame=t()}static GetRequestAnimationFrame(){if(bt.RequestAnimationFrame)return bt.RequestAnimationFrame}static RegisterCancelAnimationFrame(t){bt.CancelAnimationFrame=t()}static GetCancelAnimationFrame(){if(bt.CancelAnimationFrame)return bt.CancelAnimationFrame}}let wt=1;class Ct{resizeTime=100;element;cb;observer;lastSize={width:0,height:0};callBackDebounce;constructor(t,e,n){if(this.element=t,this.cb=e,this.lastSize=this.getSize(),n&&(this.resizeTime=Math.max(n,16)),this.callBackDebounce=mt(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();t.width===this.lastSize.width&&t.height===this.lastSize.height||(this.lastSize=t,this.cb&&this.cb({...this.lastSize}))};setSize(t){this.lastSize=t}onResize=()=>{this.checkSize()&&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 xt{listeners={};reseizeListeners={};on(t,e,n,...i){if("node"===bt.mode)return-1;const r=wt++;if(t?.addEventListener)if("resize"!==e||t===window)t?.addEventListener(e,n,...i);else{const e=new Ct(t,n);this.reseizeListeners[r]=e}const o={target:t,type:e,listener:n,options:i};return this.listeners[r]=o,r}once(t,e,n,...i){if("node"===bt.mode)return-1;const r=this.on(t,e,((...t)=>{this.off(r),n(...t)}),...i);return r}off(t){if("node"===bt.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,...n){if("node"!==bt.mode)for(const i in this.listeners){const r=this.listeners[i];r.target===t&&r.type===e&&r.listener.call(r.target,...n)}}hasListener(t,e){if("node"===bt.mode)return!1;let n=!1;for(const i in this.listeners){const r=this.listeners[i];r.target===t&&r.type===e&&(n=!0)}return n}clear(){if("node"!==bt.mode){for(const t in this.listeners){const e=this.listeners[t];e.target.removeEventListener&&e.target.removeEventListener(e.type,e.listener,...e.options)}this.listeners={}}}dispose(){"node"!==bt.mode&&(this.clear(),this.listeners=null)}}const _t=(t,e)=>{let n=0,i=t.length-1;for(;n<=i;){const r=Math.floor((n+i)/2);if(t[r]===e)return r;t[r]>e?i=r-1:n=r+1}return i<0?0:i};class St{_keys=[];_vals={};_sorted=!1;count(){return this._keys.length}values(){return this._vals}valueArr(){return Object.values(this._vals)}adjustOrder(t,e,n){const{_keys:i}=this;if(this._sorted||(i.sort(((t,e)=>t<e?-1:t>e?1:0)),this._sorted=!0),t>e){const r=[];for(let o=_t(i,t+n-1);o>=0;o--){const a=i[o];if(a>=t)r.push(this.get(a));else if(e<=a&&a<t)this.put(a+n,this.get(a));else if(a<e)break}for(let t=0;t<n;t++)this.put(e+t,r[n-1-t])}const{length:r}=i;if(t<e){const o=[];for(let a=_t(i,t);a<r;a++){const r=i[a];if(r>=t&&r<t+n)o.push(this.get(r));else if(t+n<=r&&r<=e)this.put(r-n,this.get(r));else if(r>e)break}for(let t=0;t<n;t++)this.put(e+t,o[t])}}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 k(this._vals[t])}contain(t){return Object.values(this._vals).indexOf(t)>=0}each(t,e,n){const{_keys:i}=this,{length:r}=i;this._sorted||(i.sort(((t,e)=>t<e?-1:t>e?1:0)),this._sorted=!0);for(let o=_t(i,t);o<r;o++){const r=i[o];if(t<=r&&r<=e){if(!1===n(this.get(r),r))break}else if(e<r)return}}}var kt="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function At(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Rt={exports:{}};!function(t){var e=Object.prototype.hasOwnProperty,n="~";function i(){}function r(t,e,n){this.fn=t,this.context=e,this.once=n||!1}function o(t,e,i,o,a){if("function"!=typeof i)throw new TypeError("The listener must be a function");var s=new r(i,o||t,a),l=n?n+e:e;return t._events[l]?t._events[l].fn?t._events[l]=[t._events[l],s]:t._events[l].push(s):(t._events[l]=s,t._eventsCount++),t}function a(t,e){0==--t._eventsCount?t._events=new i:delete t._events[e]}function s(){this._events=new i,this._eventsCount=0}Object.create&&(i.prototype=Object.create(null),(new i).__proto__||(n=!1)),s.prototype.eventNames=function(){var t,i,r=[];if(0===this._eventsCount)return r;for(i in t=this._events)e.call(t,i)&&r.push(n?i.slice(1):i);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(t)):r},s.prototype.listeners=function(t){var e=n?n+t:t,i=this._events[e];if(!i)return[];if(i.fn)return[i.fn];for(var r=0,o=i.length,a=new Array(o);r<o;r++)a[r]=i[r].fn;return a},s.prototype.listenerCount=function(t){var e=n?n+t:t,i=this._events[e];return i?i.fn?1:i.length:0},s.prototype.emit=function(t,e,i,r,o,a){var s=n?n+t:t;if(!this._events[s])return!1;var l,h,u=this._events[s],c=arguments.length;if(u.fn){switch(u.once&&this.removeListener(t,u.fn,void 0,!0),c){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,e),!0;case 3:return u.fn.call(u.context,e,i),!0;case 4:return u.fn.call(u.context,e,i,r),!0;case 5:return u.fn.call(u.context,e,i,r,o),!0;case 6:return u.fn.call(u.context,e,i,r,o,a),!0}for(h=1,l=new Array(c-1);h<c;h++)l[h-1]=arguments[h];u.fn.apply(u.context,l)}else{var d,f=u.length;for(h=0;h<f;h++)switch(u[h].once&&this.removeListener(t,u[h].fn,void 0,!0),c){case 1:u[h].fn.call(u[h].context);break;case 2:u[h].fn.call(u[h].context,e);break;case 3:u[h].fn.call(u[h].context,e,i);break;case 4:u[h].fn.call(u[h].context,e,i,r);break;default:if(!l)for(d=1,l=new Array(c-1);d<c;d++)l[d-1]=arguments[d];u[h].fn.apply(u[h].context,l)}}return!0},s.prototype.on=function(t,e,n){return o(this,t,e,n,!1)},s.prototype.once=function(t,e,n){return o(this,t,e,n,!0)},s.prototype.removeListener=function(t,e,i,r){var o=n?n+t:t;if(!this._events[o])return this;if(!e)return a(this,o),this;var s=this._events[o];if(s.fn)s.fn!==e||r&&!s.once||i&&s.context!==i||a(this,o);else{for(var l=0,h=[],u=s.length;l<u;l++)(s[l].fn!==e||r&&!s[l].once||i&&s[l].context!==i)&&h.push(s[l]);h.length?this._events[o]=1===h.length?h[0]:h:a(this,o)}return this},s.prototype.removeAllListeners=function(t){var e;return t?(e=n?n+t:t,this._events[e]&&a(this,e)):(this._events=new i,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prefixed=n,s.EventEmitter=s,t.exports=s}(Rt);var Bt=At(Rt.exports),Tt=function(t,e){return toString.call(t)==="[object ".concat(e,"]")},Mt=function(t){return arguments.length>1&&void 0!==arguments[1]&&arguments[1]?"boolean"==typeof t:!0===t||!1===t||Tt(t,"Boolean")},Pt=function(t){return null==t},Et=function(t){return null!=t};function Ht(t){return Ht="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ht(t)}var Ot=function(t){return Array.isArray?Array.isArray(t):Tt(t,"Array")},Lt=function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=Ht(t);return e?"number"===n:"number"===n||Tt(t,"Number")};function It(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}function Dt(t,e){if(t){if("string"==typeof t)return It(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?It(t,e):void 0}}function Wt(t){return function(t){if(Array.isArray(t))return It(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||Dt(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ft(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function zt(t){return Number(t)}var jt=1e-10,Nt=1e-10;function Gt(t,e){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:jt,i=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:Nt)*Math.max(t,e);return Math.abs(t-e)<=Math.max(n,i)}function Ut(t,e,n,i){return t>e&&!Gt(t,e,n,i)}function Kt(t,e,n,i){return t<e&&!Gt(t,e,n,i)}function Vt(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var i,r,o,a,s=[],l=!0,h=!1;try{if(o=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;l=!1}else for(;!(l=(i=o.call(n)).done)&&(s.push(i.value),s.length!==e);l=!0);}catch(t){h=!0,r=t}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(h)throw r}}return s}}(t,e)||Dt(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Yt(t,e){var n;return t>e&&(n=t,t=e,e=n),function(n){return Math.max(t,Math.min(e,n))}}try{"function"==typeof requestAnimationFrame&&"function"==typeof cancelAnimationFrame}catch(t){!1}function Xt(t,e){return function(n){return t*(1-n)+e*n}}function $t(t,e){return function(n){return Math.round(t*(1-n)+e*n)}}function qt(t){var e=function(t,e){if("object"!==Ht(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!==Ht(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===Ht(e)?e:String(e)}function Zt(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,qt(i.key),i)}}function Jt(t,e,n){return e&&Zt(t.prototype,e),n&&Zt(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function Qt(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function te(t,e){return te=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},te(t,e)}function ee(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&te(t,e)}function ne(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function ie(t,e){if(e&&("object"===Ht(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return ne(t)}function re(t){return re=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},re(t)}var oe=function(){function t(e){Qt(this,t),e?this.setValue(e.x1,e.y1,e.x2,e.y2):this.clear()}return Jt(t,[{key:"clone",value:function(){return new t(this)}},{key:"clear",value:function(){return this.x1=+Number.MAX_VALUE,this.y1=+Number.MAX_VALUE,this.x2=-Number.MAX_VALUE,this.y2=-Number.MAX_VALUE,this}},{key:"empty",value:function(){return this.x1===+Number.MAX_VALUE&&this.y1===+Number.MAX_VALUE&&this.x2===-Number.MAX_VALUE&&this.y2===-Number.MAX_VALUE}},{key:"equals",value:function(t){return this.x1===t.x1&&this.y1===t.y1&&this.x2===t.x2&&this.y2===t.y2}},{key:"setValue",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return this.x1=t,this.y1=e,this.x2=n,this.y2=i,this}},{key:"set",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return n<t?(this.x2=t,this.x1=n):(this.x1=t,this.x2=n),i<e?(this.y2=e,this.y1=i):(this.y1=e,this.y2=i),this}},{key:"add",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return t<this.x1&&(this.x1=t),e<this.y1&&(this.y1=e),t>this.x2&&(this.x2=t),e>this.y2&&(this.y2=e),this}},{key:"expand",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return Ot(t)?(this.y1-=t[0],this.x2+=t[1],this.y2+=t[2],this.x1-=t[3]):(this.x1-=t,this.y1-=t,this.x2+=t,this.y2+=t),this}},{key:"round",value:function(){return this.x1=Math.floor(this.x1),this.y1=Math.floor(this.y1),this.x2=Math.ceil(this.x2),this.y2=Math.ceil(this.y2),this}},{key:"translate",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.x1+=t,this.x2+=t,this.y1+=e,this.y2+=e,this}},{key:"rotate",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=this.rotatedPoints(t,e,n);return this.clear().add(i[0],i[1]).add(i[2],i[3]).add(i[4],i[5]).add(i[6],i[7])}},{key:"scale",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=this.scalePoints(t,e,n,i);return this.clear().add(r[0],r[1]).add(r[2],r[3])}},{key:"union",value:function(t){return t.x1<this.x1&&(this.x1=t.x1),t.y1<this.y1&&(this.y1=t.y1),t.x2>this.x2&&(this.x2=t.x2),t.y2>this.y2&&(this.y2=t.y2),this}},{key:"intersect",value:function(t){return t.x1>this.x1&&(this.x1=t.x1),t.y1>this.y1&&(this.y1=t.y1),t.x2<this.x2&&(this.x2=t.x2),t.y2<this.y2&&(this.y2=t.y2),this}},{key:"encloses",value:function(t){return t&&this.x1<=t.x1&&this.x2>=t.x2&&this.y1<=t.y1&&this.y2>=t.y2}},{key:"alignsWith",value:function(t){return t&&(this.x1===t.x1||this.x2===t.x2||this.y1===t.y1||this.y2===t.y2)}},{key:"intersects",value:function(t){return t&&!(this.x2<t.x1||this.x1>t.x2||this.y2<t.y1||this.y1>t.y2)}},{key:"contains",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return!(t<this.x1||t>this.x2||e<this.y1||e>this.y2)}},{key:"containsPoint",value:function(t){return!(t.x<this.x1||t.x>this.x2||t.y<this.y1||t.y>this.y2)}},{key:"width",value:function(){return this.empty()?0:this.x2-this.x1}},{key:"height",value:function(){return this.empty()?0:this.y2-this.y1}},{key:"scaleX",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this.x1*=t,this.x2*=t,this}},{key:"scaleY",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this.y1*=t,this.y2*=t,this}},{key:"transformWithMatrix",value:function(t){return function(t,e,n){var i=e.x1,r=e.y1,o=e.x2,a=e.y2;n.onlyTranslate()?(t!==e&&t.setValue(e.x1,e.y1,e.x2,e.y2),t.translate(n.e,n.f)):(t.clear(),t.add(n.a*i+n.c*r+n.e,n.b*i+n.d*r+n.f),t.add(n.a*o+n.c*r+n.e,n.b*o+n.d*r+n.f),t.add(n.a*o+n.c*a+n.e,n.b*o+n.d*a+n.f),t.add(n.a*i+n.c*a+n.e,n.b*i+n.d*a+n.f))}(this,this,t),this}},{key:"copy",value:function(t){return this.x1=t.x1,this.y1=t.y1,this.x2=t.x2,this.y2=t.y2,this}},{key:"rotatedPoints",value:function(t,e,n){var i=this.x1,r=this.y1,o=this.x2,a=this.y2,s=Math.cos(t),l=Math.sin(t),h=e-e*s+n*l,u=n-e*l-n*s;return[s*i-l*r+h,l*i+s*r+u,s*i-l*a+h,l*i+s*a+u,s*o-l*r+h,l*o+s*r+u,s*o-l*a+h,l*o+s*a+u]}},{key:"scalePoints",value:function(t,e,n,i){return[t*this.x1+(1-t)*n,e*this.y1+(1-e)*i,t*this.x2+(1-t)*n,e*this.y2+(1-e)*i]}}]),t}();function ae(t,e,n){e/=100,n/=100;var i=(1-Math.abs(2*n-1))*e,r=i*(1-Math.abs(t/60%2-1)),o=n-i/2,a=0,s=0,l=0;return 0<=t&&t<60?(a=i,s=r,l=0):60<=t&&t<120?(a=r,s=i,l=0):120<=t&&t<180?(a=0,s=i,l=r):180<=t&&t<240?(a=0,s=r,l=i):240<=t&&t<300?(a=r,s=0,l=i):300<=t&&t<360&&(a=i,s=0,l=r),{r:a=Math.round(255*(a+o)),g:s=Math.round(255*(s+o)),b:l=Math.round(255*(l+o))}}function se(t,e,n){t/=255,e/=255,n/=255;var i=Math.min(t,e,n),r=Math.max(t,e,n),o=r-i,a=0,s=0;return a=0===o?0:r===t?(e-n)/o%6:r===e?(n-t)/o+2:(t-e)/o+4,(a=Math.round(60*a))<0&&(a+=360),s=(r+i)/2,{h:a,s:+(100*(0===o?0:o/(1-Math.abs(2*s-1)))).toFixed(1),l:s=+(100*s).toFixed(1)}}var le=/^#([0-9a-f]{3,8})$/,he={transparent:4294967040},ue={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 ce(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function de(t){return Lt(t)?new ge(t>>16,t>>8&255,255&t,1):Ot(t)?new ge(t[0],t[1],t[2]):new ge(255,255,255)}var fe,pe=function(){function t(e){Qt(this,t);var n=t.parseColorString(e);n?this.color=n:(console.warn("Warn: 传入".concat(e,"无法解析为Color")),this.color=new ge(255,255,255))}return Jt(t,[{key:"toRGBA",value:function(){return this.color.formatRgb()}},{key:"toString",value:function(){return this.color.formatRgb()}},{key:"toHex",value:function(){return this.color.formatHex()}},{key:"toHsl",value:function(){return this.color.formatHsl()}},{key:"setOpacity",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return this.color.opacity=t,this}},{key:"brighter",value:function(t){var e=this.color,n=e.r,i=e.g,r=e.b;return this.color.r=Math.max(0,Math.min(255,Math.floor(n*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(r*t))),this}},{key:"getHSVBrightness",value:function(){return Math.max(this.color.r,this.color.g,this.color.b)/255}},{key:"getHSLBrightness",value:function(){return.5*(Math.max(this.color.r,this.color.g,this.color.b)/255+Math.min(this.color.r,this.color.g,this.color.b)/255)}},{key:"setHsl",value:function(t,e,n){var i=this.color.opacity,r=se(this.color.r,this.color.g,this.color.b),o=ae(Pt(t)?r.h:function(t,e,n){return t<e?e:t>n?n:t}(t,0,360),Pt(e)?r.s:e>=0&&e<=1?100*e:e,Pt(n)?r.l:n<=1&&n>=0?100*n:n);return this.color=new ge(o.r,o.g,o.b,i),this}},{key:"getLuminance",value:function(){return(.2126*this.color.r+.7152*this.color.g+.0722*this.color.b)/255}},{key:"getLuminance2",value:function(){return(.2627*this.color.r+.678*this.color.g+.0593*this.color.b)/255}},{key:"getLuminance3",value:function(){return(.299*this.color.r+.587*this.color.g+.114*this.color.b)/255}}],[{key:"Brighter",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return 1===n?e:new t(e).brighter(n).toRGBA()}},{key:"SetOpacity",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return 1===n?e:new t(e).setOpacity(n).toRGBA()}},{key:"getColorBrightness",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"hsl",i=e instanceof t?e:new t(e);switch(n){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()}}},{key:"parseColorString",value:function(t){if(Et(he[t]))return function(t){return Lt(t)?new ge(t>>>24,t>>>16&255,t>>>8&255,255&t):Ot(t)?new ge(t[0],t[1],t[2],t[3]):new ge(255,255,255,1)}(he[t]);if(Et(ue[t]))return de(ue[t]);var e="".concat(t).trim().toLowerCase(),n=le.exec(e);if(n){var i=parseInt(n[1],16),r=n[1].length;return 3===r?new ge((i>>8&15)+((i>>8&15)<<4),(i>>4&15)+((i>>4&15)<<4),(15&i)+((15&i)<<4),1):6===r?de(i):8===r?new ge(i>>24&255,i>>16&255,i>>8&255,(255&i)/255):void 0}if(/^(rgb|RGB|rgba|RGBA)/.test(e)){var o=e.replace(/(?:\(|\)|rgba|RGBA|rgb|RGB)*/g,"").split(",");return new ge(parseInt(o[0],10),parseInt(o[1],10),parseInt(o[2],10),parseFloat(o[3]))}if(/^(hsl|HSL|hsla|HSLA)/.test(e)){var a=e.replace(/(?:\(|\)|hsla|HSLA|hsl|HSL)*/g,"").split(","),s=ae(parseInt(a[0],10),parseInt(a[1],10),parseInt(a[2],10));return new ge(s.r,s.g,s.b,parseFloat(a[3]))}}}]),t}(),ge=function(){function t(e,n,i,r){Qt(this,t),this.r=isNaN(+e)?255:Math.max(0,Math.min(255,+e)),this.g=isNaN(+n)?255:Math.max(0,Math.min(255,+n)),this.b=isNaN(+i)?255:Math.max(0,Math.min(255,+i)),Et(r)?this.opacity=isNaN(+r)?1:Math.max(0,Math.min(1,+r)):this.opacity=1}return Jt(t,[{key:"formatHex",value:function(){return"#".concat(ce(this.r)+ce(this.g)+ce(this.b)+(1===this.opacity?"":ce(255*this.opacity)))}},{key:"formatRgb",value:function(){var t=this.opacity;return"".concat(1===t?"rgb(":"rgba(").concat(this.r,",").concat(this.g,",").concat(this.b).concat(1===t?")":",".concat(t,")"))}},{key:"formatHsl",value:function(){var t=this.opacity,e=se(this.r,this.g,this.b),n=e.h,i=e.s,r=e.l;return"".concat(1===t?"hsl(":"hsla(").concat(n,",").concat(i,"%,").concat(r,"%").concat(1===t?")":",".concat(t,")"))}},{key:"toString",value:function(){return this.formatHex()}}]),t}();!function(t){t[t.NONE=0]="NONE",t[t.BBOX1=1]="BBOX1",t[t.BBOX2=2]="BBOX2"}(fe||(fe={}));var ve=function(t){var e=t.charCodeAt(0),n=2===t.length?t.charCodeAt(1):0,i=e;return 55296<=e&&e<=56319&&56320<=n&&n<=57343&&(i=(e&=1023)<<10|(n&=1023),i+=65536),12288===i||65281<=i&&i<=65376||65504<=i&&i<=65510?"F":8361===i||65377<=i&&i<=65470||65474<=i&&i<=65479||65482<=i&&i<=65487||65490<=i&&i<=65495||65498<=i&&i<=65500||65512<=i&&i<=65518?"H":4352<=i&&i<=4447||4515<=i&&i<=4519||4602<=i&&i<=4607||9001<=i&&i<=9002||11904<=i&&i<=11929||11931<=i&&i<=12019||12032<=i&&i<=12245||12272<=i&&i<=12283||12289<=i&&i<=12350||12353<=i&&i<=12438||12441<=i&&i<=12543||12549<=i&&i<=12589||12593<=i&&i<=12686||12688<=i&&i<=12730||12736<=i&&i<=12771||12784<=i&&i<=12830||12832<=i&&i<=12871||12880<=i&&i<=13054||13056<=i&&i<=19903||19968<=i&&i<=42124||42128<=i&&i<=42182||43360<=i&&i<=43388||44032<=i&&i<=55203||55216<=i&&i<=55238||55243<=i&&i<=55291||63744<=i&&i<=64255||65040<=i&&i<=65049||65072<=i&&i<=65106||65108<=i&&i<=65126||65128<=i&&i<=65131||110592<=i&&i<=110593||127488<=i&&i<=127490||127504<=i&&i<=127546||127552<=i&&i<=127560||127568<=i&&i<=127569||131072<=i&&i<=194367||177984<=i&&i<=196605||196608<=i&&i<=262141?"W":32<=i&&i<=126||162<=i&&i<=163||165<=i&&i<=166||172===i||175===i||10214<=i&&i<=10221||10629<=i&&i<=10630?"Na":161===i||164===i||167<=i&&i<=168||170===i||173<=i&&i<=174||176<=i&&i<=180||182<=i&&i<=186||188<=i&&i<=191||198===i||208===i||215<=i&&i<=216||222<=i&&i<=225||230===i||232<=i&&i<=234||236<=i&&i<=237||240===i||242<=i&&i<=243||247<=i&&i<=250||252===i||254===i||257===i||273===i||275===i||283===i||294<=i&&i<=295||299===i||305<=i&&i<=307||312===i||319<=i&&i<=322||324===i||328<=i&&i<=331||333===i||338<=i&&i<=339||358<=i&&i<=359||363===i||462===i||464===i||466===i||468===i||470===i||472===i||474===i||476===i||593===i||609===i||708===i||711===i||713<=i&&i<=715||717===i||720===i||728<=i&&i<=731||733===i||735===i||768<=i&&i<=879||913<=i&&i<=929||931<=i&&i<=937||945<=i&&i<=961||963<=i&&i<=969||1025===i||1040<=i&&i<=1103||1105===i||8208===i||8211<=i&&i<=8214||8216<=i&&i<=8217||8220<=i&&i<=8221||8224<=i&&i<=8226||8228<=i&&i<=8231||8240===i||8242<=i&&i<=8243||8245===i||8251===i||8254===i||8308===i||8319===i||8321<=i&&i<=8324||8364===i||8451===i||8453===i||8457===i||8467===i||8470===i||8481<=i&&i<=8482||8486===i||8491===i||8531<=i&&i<=8532||8539<=i&&i<=8542||8544<=i&&i<=8555||8560<=i&&i<=8569||8585===i||8592<=i&&i<=8601||8632<=i&&i<=8633||8658===i||8660===i||8679===i||8704===i||8706<=i&&i<=8707||8711<=i&&i<=8712||8715===i||8719===i||8721===i||8725===i||8730===i||8733<=i&&i<=8736||8739===i||8741===i||8743<=i&&i<=8748||8750===i||8756<=i&&i<=8759||8764<=i&&i<=8765||8776===i||8780===i||8786===i||8800<=i&&i<=8801||8804<=i&&i<=8807||8810<=i&&i<=8811||8814<=i&&i<=8815||8834<=i&&i<=8835||8838<=i&&i<=8839||8853===i||8857===i||8869===i||8895===i||8978===i||9312<=i&&i<=9449||9451<=i&&i<=9547||9552<=i&&i<=9587||9600<=i&&i<=9615||9618<=i&&i<=9621||9632<=i&&i<=9633||9635<=i&&i<=9641||9650<=i&&i<=9651||9654<=i&&i<=9655||9660<=i&&i<=9661||9664<=i&&i<=9665||9670<=i&&i<=9672||9675===i||9678<=i&&i<=9681||9698<=i&&i<=9701||9711===i||9733<=i&&i<=9734||9737===i||9742<=i&&i<=9743||9748<=i&&i<=9749||9756===i||9758===i||9792===i||9794===i||9824<=i&&i<=9825||9827<=i&&i<=9829||9831<=i&&i<=9834||9836<=i&&i<=9837||9839===i||9886<=i&&i<=9887||9918<=i&&i<=9919||9924<=i&&i<=9933||9935<=i&&i<=9953||9955===i||9960<=i&&i<=9983||10045===i||10071===i||10102<=i&&i<=10111||11093<=i&&i<=11097||12872<=i&&i<=12879||57344<=i&&i<=63743||65024<=i&&i<=65039||65533===i||127232<=i&&i<=127242||127248<=i&&i<=127277||127280<=i&&i<=127337||127344<=i&&i<=127386||917760<=i&&i<=917999||983040<=i&&i<=1048573||1048576<=i&&i<=1114109?"A":"N"};var ye=function(){function t(e,n){Qt(this,t),this._numberCharSize=null,this._fullCharSize=null,this._letterCharSize=null,this._specialCharSizeMap={},this._canvas=null,this._context=null,this._contextSaved=!1,this._notSupportCanvas=!1,this._notSupportCanopus=!1,this._userSpec={},this.specialCharSet="-/: .,@%'\"~",this._option=e,this._userSpec=null!=n?n:{},this.textSpec=this._initSpec(),Et(e.specialCharSet)&&(this.specialCharSet=e.specialCharSet),this._standardMethod=Et(e.getTextBounds)?this.fullMeasure.bind(this):this.measureWithNaiveCanvas.bind(this)}return Jt(t,[{key:"initContext",value:function(){if(this._notSupportCanvas)return!1;if(Pt(this._canvas)&&(Et(this._option.getCanvasForMeasure)&&(this._canvas=this._option.getCanvasForMeasure()),Pt(this._canvas)&&Et(globalThis.document)&&(this._canvas=globalThis.document.createElement("canvas"))),Pt(this._context)&&Et(this._canvas)){var t=this._canvas.getContext("2d");Et(t)&&(t.save(),t.font=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.fontStyle,i=void 0===n?e.fontStyle:n,r=t.fontVariant,o=void 0===r?e.fontVariant:r,a=t.fontWeight,s=void 0===a?e.fontWeight:a,l=t.fontSize,h=void 0===l?e.fontSize:l,u=t.fontFamily;return(i?i+" ":"")+(o?o+" ":"")+(s?s+" ":"")+h+"px "+((void 0===u?e.fontFamily:u)||"sans-serif")}(this.textSpec),this._contextSaved=!0,this._context=t)}return!Pt(this._context)||(this._notSupportCanvas=!0,!1)}},{key:"_initSpec",value:function(){var t,e,n,i=this._option.defaultFontParams,r=void 0===i?{}:i,o=this._userSpec,a=o.fontStyle,s=void 0===a?r.fontStyle:a,l=o.fontVariant,h=void 0===l?r.fontVariant:l,u=o.fontWeight,c=void 0===u?null!==(t=r.fontWeight)&&void 0!==t?t:"normal":u,d=o.fontSize,f=void 0===d?null!==(e=r.fontSize)&&void 0!==e?e:12:d,p=o.fontFamily,g=void 0===p?null!==(n=r.fontFamily)&&void 0!==n?n:"sans-serif":p,v=o.align,y=o.textAlign,m=void 0===y?null!=v?v:"center":y,b=o.baseline,w=o.textBaseline,C=void 0===w?null!=b?b:"middle":w,x=o.ellipsis,_=o.limit,S=o.lineHeight;return{fontStyle:s,fontVariant:h,fontFamily:g,fontSize:f,fontWeight:c,textAlign:m,textBaseline:C,ellipsis:x,limit:_,lineHeight:void 0===S?f:S}}},{key:"measure",value:function(t,e){switch(e){case"canopus":return this.fullMeasure(t);case"canvas":return this.measureWithNaiveCanvas(t);case"simple":return this.quickMeasureWithoutCanvas(t);default:return this.quickMeasure(t)}}},{key:"fullMeasure",value:function(t){if(Pt(t))return{width:0,height:0};if(Pt(this._option.getTextBounds)||!this._notSupportCanopus)return this.measureWithNaiveCanvas(t);var e,n=this.textSpec,i=n.fontFamily,r=n.fontSize,o=n.fontWeight,a=n.textAlign,s=n.textBaseline,l=n.ellipsis,h=n.limit,u=n.lineHeight;try{var c=this._option.getTextBounds({text:t,fontFamily:i,fontSize:r,fontWeight:o,textAlign:a,textBaseline:s,ellipsis:!!l,maxLineWidth:h||1/0,lineHeight:u});e={width:c.width(),height:c.height()}}catch(n){this._notSupportCanopus=!0,e=this.measureWithNaiveCanvas(t)}return e}},{key:"measureWithNaiveCanvas",value:function(t){return this._measureReduce(t,this._measureWithNaiveCanvas.bind(this))}},{key:"_measureWithNaiveCanvas",value:function(t){if(!this.initContext())return this._quickMeasureWithoutCanvas(t);var e=this._context.measureText(t),n=this.textSpec,i=n.fontSize,r=n.lineHeight;return{width:e.width,height:null!=r?r:i}}},{key:"quickMeasure",value:function(t){return this._measureReduce(t,this._quickMeasure.bind(this))}},{key:"_quickMeasure",value:function(e){for(var n={width:0,height:0},i=0;i<e.length;i++){var r=e[i],o=this._measureSpecialChar(r);Pt(o)&&t.NUMBERS_CHAR_SET.includes(r)&&(o=this._measureNumberChar()),Pt(o)&&["F","W"].includes(ve(r))&&(o=this._measureFullSizeChar()),Pt(o)&&(o=this._measureLetterChar()),n.width+=o.width,n.height=Math.max(n.height,o.height)}return n}},{key:"quickMeasureWithoutCanvas",value:function(t){return this._measureReduce(t,this._quickMeasureWithoutCanvas.bind(this))}},{key:"_quickMeasureWithoutCanvas",value:function(t){for(var e={width:0,height:0},n=this.textSpec,i=n.fontSize,r=n.lineHeight,o=0;o<t.length;o++){var a=t[o],s=["F","W"].includes(ve(a))?1:.53;e.width+=s*i}return e.height=null!=r?r:i,e}},{key:"_measureReduce",value:function(t,e){var n=this.textSpec,i=n.fontSize,r=n.lineHeight,o={width:0,height:0};if(Pt(t))return o;if(Ot(t)){var a=t.filter(Et).map((function(t){return t.toString()}));return 0===a.length?o:1===a.length?e(a[0]):{width:a.reduce((function(t,n){return Math.max(t,e(n).width)}),0),height:a.length*((null!=r?r:i)+1)+1}}return e(t.toString())}},{key:"_measureNumberChar",value:function(){if(Pt(this._numberCharSize)){var e=this._standardMethod(t.NUMBERS_CHAR_SET);this._numberCharSize={width:e.width/t.NUMBERS_CHAR_SET.length,height:e.height}}return this._numberCharSize}},{key:"_measureFullSizeChar",value:function(){return Pt(this._fullCharSize)&&(this._fullCharSize=this._standardMethod(t.FULL_SIZE_CHAR)),this._fullCharSize}},{key:"_measureLetterChar",value:function(){if(Pt(this._letterCharSize)){var e=this._standardMethod(t.ALPHABET_CHAR_SET);this._letterCharSize={width:e.width/t.ALPHABET_CHAR_SET.length,height:e.height}}return this._letterCharSize}},{key:"_measureSpecialChar",value:function(t){return Et(this._specialCharSizeMap[t])?this._specialCharSizeMap[t]:this.specialCharSet.includes(t)?(this._specialCharSizeMap[t]=this._standardMethod(t),this._specialCharSizeMap[t]):null}},{key:"release",value:function(){Et(this._canvas)&&(this._canvas=null),Et(this._context)&&(this._contextSaved&&(this._context.restore(),this._contextSaved=!1),this._context=null)}}]),t}();ye.ALPHABET_CHAR_SET="abcdefghijklmnopqrstuvwxyz",ye.NUMBERS_CHAR_SET="0123456789",ye.FULL_SIZE_CHAR="字";let me=class t{bounds;constructor(t,e,n,i){this.bounds=new oe,this.bounds.set(t,e,t+n,e+i)}static bounds(e,n,i,r){return new t(e,n,Math.round(i-e),Math.round(r-n))}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 t(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 be={underlayBackgroundColor:"#FFF",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:n}=t;return 1&e-n.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)"}},menuStyle:{color:"#000",highlightColor:"#2E68CF",fontSize:12,fontFamily:"sans-serif",highlightFont:"12px sans-serif",hoverBgColor:"#EEE"},selectionStyle:{cellBgColor:"#29364D",cellBorderColor:"#4284FF",cellBorderLineWidth:2}};var we={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:n}=t;return 1&e-n.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"}},menuStyle:{color:"#000",highlightColor:"#2E68CF",fontSize:12,fontFamily:"sans-serif",highlightFont:"12px sans-serif",hoverBgColor:"#EEE"},selectionStyle:{cellBgColor:"rgba(0, 0, 255,0.1)"}};var Ce={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:n}=t;return 1&e-n.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)"}},menuStyle:{color:"#000",highlightColor:"#2E68CF",fontSize:12,fontFamily:"sans-serif",highlightFont:"12px sans-serif",hoverBgColor:"#EEE"},selectionStyle:{cellBgColor:"rgba(0, 0, 255,0.1)",cellBorderLineWidth:2,cellBorderColor:"#3073f2"}};var xe={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:n}=t;return 1&e-n.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)"}},menuStyle:{color:"#000",highlightColor:"#2E68CF",fontSize:12,fontFamily:"sans-serif",highlightFont:"12px sans-serif",hoverBgColor:"#EEE"},selectionStyle:{cellBgColor:"rgba(0, 0, 255,0.1)",cellBorderLineWidth:2,inlineColumnBgColor:"#CCE0FF",inlineRowBgColor:"#CCE0FF",cellBorderColor:"#0000ff"}};var _e={underlayBackgroundColor:"#FFF",defaultStyle:{borderColor:function(t){const{col:e,table:n}=t,{colCount:i,frozenColCount:r}=n,o="#ccc7c7",a="#ccc7c7";return r-1===e||i-1===e?[o,"#f2f2f2",a,null]:[o,null,a,null]},hover:{cellBorderColor:"#0000FF",cellBgColor:"#D0E0E3"},bgColor:"#FFF"},headerStyle:{color:"rgba(0, 0, 0, 0.87)",borderColor:function(t){const{row:e,table:{frozenRowCount:n}}=t;return n-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:"#6FA8DC"}};const Se={},ke=[],Ae=/^(https?|ftp|file):\/\/[-A-Za-z0-9+&@#/%?=~_|!:,.;]+[-A-Za-z0-9+&@#/%=~_|]/,Re="$$indicator$$",Be={type:"line"};function Te(t,e,n,i){return rt(t,...n)||rt(e,...n)||i&&rt(t,...i)||i&&rt(e,...i)}class Me{internalTheme;_defaultStyle=null;_header=null;_cornerHeader=null;_rowHeader=null;_body=null;_scroll=null;_tooltip=null;_frameStyle=null;_columnResize=null;_dragHeaderSplitLine=null;_frozenColumnLine=null;_selectionStyle=null;constructor(t,e){this.internalTheme={obj:t,superTheme:e}}get font(){const{obj:t,superTheme:e}=this.internalTheme;return Te(t,e,["font"],["bodyStyle","font"])}get underlayBackgroundColor(){const{obj:t,superTheme:e}=this.internalTheme;return Te(t,e,["underlayBackgroundColor"])}get defaultStyle(){if(!this._defaultStyle){const{obj:t,superTheme:e}=this.internalTheme,n=m({},e.defaultStyle,t.defaultStyle);this._defaultStyle={get fontSize(){return n.fontSize??16},get fontFamily(){return n.fontFamily??"sans-serif"},get fontWeight(){return n.fontWeight},get fontVariant(){return n.fontVariant},get fontStyle(){return n.fontStyle},get bgColor(){return n.bgColor??"#FFF"},get color(){return n.color??"#000"},get borderColor(){return n.borderColor??"#000"},get borderLineWidth(){return n.borderLineWidth??1},get borderLineDash(){return n.borderLineDash??ke},get hover(){if(n.hover)return{get cellBgColor(){return n.hover?.cellBgColor??void 0},get inlineColumnBgColor(){return n.hover?.inlineColumnBgColor??(n.hover?.cellBgColor&&"string"==typeof n.hover?.cellBgColor?S(n.hover?.cellBgColor,.1,!1):void 0)??void 0},get inlineRowBgColor(){return n.hover?.inlineRowBgColor??(n.hover?.cellBgColor&&"string"==typeof n.hover?.cellBgColor?S(n.hover?.cellBgColor,.1,!1):void 0)??void 0}}},get padding(){return n.padding??[10,16,10,16]},get textAlign(){return n.textAlign??"left"},get textBaseline(){return n.textBaseline??"middle"},get textOverflow(){return n.textOverflow??"ellipsis"},get lineHeight(){return n.lineHeight},get autoWrapText(){return n.autoWrapText??!1},get lineClamp(){return n.lineClamp??"auto"},get linkColor(){return n.linkColor??"#3772ff"},get cursor(){return n.cursor??"auto"},get marked(){return n.marked??!1},get underline(){return n.underline??!1},get underlineColor(){return n.underlineColor},get underlineDash(){return n.underlineDash},get lineThrough(){return n.lineThrough??!1},get lineThroughColor(){return n.lineThroughColor},get lineThroughDash(){return n.lineThroughDash}}}return this._defaultStyle}get headerStyle(){if(!this._header){const{obj:t,superTheme:e}=this.internalTheme,n=m({},this.defaultStyle,e.headerStyle,t.headerStyle);this._header=this.getStyle(n)}return this._header}get cornerHeaderStyle(){if(!this._cornerHeader){const{obj:t,superTheme:e}=this.internalTheme,n=m({},this.defaultStyle,e.cornerHeaderStyle,t.cornerHeaderStyle);this._cornerHeader=this.getStyle(n)}return this._cornerHeader}get rowHeaderStyle(){if(!this._rowHeader){const{obj:t,superTheme:e}=this.internalTheme,n=m({},this.defaultStyle,e.rowHeaderStyle,t.rowHeaderStyle);this._rowHeader=this.getStyle(n)}return this._rowHeader}get bodyStyle(){if(!this._body){const{obj:t,superTheme:e}=this.internalTheme,n=m({},this.defaultStyle,e.bodyStyle,t.bodyStyle);this._body=this.getStyle(n)}return this._body}get frameStyle(){if(!this._frameStyle){const{obj:t,superTheme:e}=this.internalTheme,n=m({},e.frameStyle,t.frameStyle);this._frameStyle={get borderColor(){return n.borderColor},get borderLineWidth(){return n.borderLineWidth},get borderLineDash(){return n.borderLineDash},get shadowBlur(){return n.shadowBlur},get shadowColor(){return n.shadowColor},get shadowOffsetX(){return n.shadowOffsetX},get shadowOffsetY(){return n.shadowOffsetY},get cornerRadius(){return n.cornerRadius}}}return this._frameStyle}get scrollStyle(){if(!this._scroll){const{obj:t,superTheme:e}=this.internalTheme,n=m({},e.scrollStyle,t.scrollStyle);this._scroll={get scrollSliderColor(){return n.scrollSliderColor??"#C0C0C0"},get scrollRailColor(){return n.scrollRailColor},get visible(){return n.visible??"scrolling"},get width(){return n.width??7},get hoverOn(){return n.hoverOn??!0}}}return this._scroll}get tooltipStyle(){if(!this._tooltip){const{obj:t,superTheme:e}=this.internalTheme,n=m({},e.tooltipStyle,t.tooltipStyle);this._tooltip={get font(){return n.font??"16px sans-serif"},get bgColor(){return n.bgColor??"#000"},get padding(){return n.padding??[6,8]},get color(){return n.color??"#FFF"}}}return this._tooltip}get columnResize(){if(!this._columnResize){const{obj:t,superTheme:e}=this.internalTheme,n=m({},e.columnResize,t.columnResize);this._columnResize={get lineColor(){return n.lineColor??"#416EFF"},get bgColor(){return n.bgColor??"#D9E2FF"},get lineWidth(){return n.lineWidth??1},get width(){return n.width??n.lineWidth+2}}}return this._columnResize}get dragHeaderSplitLine(){if(!this._dragHeaderSplitLine){const{obj:t,superTheme:e}=this.internalTheme,n=m({},e.dragHeaderSplitLine,t.dragHeaderSplitLine);this._dragHeaderSplitLine={get lineColor(){return n.lineColor??"blue"},get lineWidth(){return n.lineWidth??2},get shadowBlockColor(){return n.shadowBlockColor??"rgba(204,204,204,0.3)"}}}return this._dragHeaderSplitLine}get frozenColumnLine(){if(!this._frozenColumnLine){const{obj:t,superTheme:e}=this.internalTheme,n=m({},e.frozenColumnLine,t.frozenColumnLine);this._frozenColumnLine={get shadow(){if(n.shadow)return{get width(){return n.shadow?.width??24},get startColor(){return n.shadow?.startColor??"rgba(00, 24, 47, 0.06)"},get endColor(){return n.shadow?.endColor??"rgba(00, 24, 47, 0)"}}},get border(){if(n.border)return{get lineColor(){return n.border?.lineColor??"rgba(00, 24, 47, 0.06)"},get bgColor(){return n.border?.bgColor??n.border?.lineColor??"rgba(00, 24, 47, 0.06)"},get lineWidth(){return n.border?.lineWidth??4},get width(){return n.border?.width??n.border?.lineWidth??4}}}}}return this._frozenColumnLine}get selectionStyle(){if(!this._selectionStyle){const{obj:t,superTheme:e}=this.internalTheme,n=m({},e.selectionStyle,t.selectionStyle);this._selectionStyle={get cellBgColor(){return n?.cellBgColor??"rgba(0, 0, 255,0.1)"},get cellBorderColor(){return n?.cellBorderColor??"#3073f2"},get cellBorderLineWidth(){return n?.cellBorderLineWidth??2}}}return this._selectionStyle}hasProperty(t){const{obj:e,superTheme:n}=this.internalTheme;return Pe(e,t)||Pe(n,t)}extends(t){return new Me(t,this)}getStyle(t){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 borderColor(){return t.borderColor},get borderLineWidth(){return t.borderLineWidth},get borderLineDash(){return t.borderLineDash},get hover(){if(t.hover)return{get cellBgColor(){return t.hover?.cellBgColor??void 0},get inlineColumnBgColor(){return t.hover?.inlineColumnBgColor??(t.hover?.cellBgColor&&"string"==typeof t.hover?.cellBgColor?S(t.hover?.cellBgColor,.1,!1):void 0)??void 0},get inlineRowBgColor(){return t.hover?.inlineRowBgColor??(t.hover?.cellBgColor&&"string"==typeof t.hover?.cellBgColor?S(t.hover?.cellBgColor,.1,!1):void 0)??void 0}}},get frameStyle(){if(t.frameStyle)return{get borderColor(){return t.frameStyle?.borderColor??void 0},get borderLineWidth(){return t.frameStyle?.borderLineWidth??void 0},get borderLineDash(){return t.frameStyle?.borderLineDash??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(){return t.underline??!1},get underlineColor(){return t.underlineColor},get underlineDash(){return t.underlineDash},get lineThrough(){return t.lineThrough??!1},get lineThroughColor(){return t.lineThroughColor},get lineThroughDash(){return t.lineThroughDash}}}}function Pe(t,e){if(t instanceof Me)return t.hasProperty(e);let n=t;if(!n)return!1;for(let t=0;t<e.length;t++){if(n=n[e[t]],!n)return!1}return!!n}const Ee=new Me(be,be),He=new Me(we,we),Oe=new Me(Ce,Ce),Le=new Me(xe,xe),Ie=new Me(_e,_e),De={DEFAULT:Le,SIMPLIFY:Ie,ARCO:Oe,DARK:Ee,BRIGHT:He},We={TableTheme:Me};function Fe(t){if(!t)return null;if("string"==typeof t){const e=function(t,e){if(t[e])return t[e];const n=e.toLowerCase();if(t[n])return t[n];const i=e.toLowerCase();if(t[i])return t[i];for(const e in t)if(e.toLowerCase()===n)return t[e]}(ze(),t);return e?e instanceof Me?e:new Me(e,e):null}return t instanceof Me?t:new Me(t,t)}function ze(){return nt(De,Se)}var je,Ne={DARK:Ee,BRIGHT:He,ARCO:Oe,DEFAULT:Le,SIMPLIFY:Ie,theme:We,of:Fe,get:ze},Ge=Object.freeze({__proto__:null,ARCO:Oe,BRIGHT:He,DARK:Ee,DEFAULT:Le,SIMPLIFY:Ie,default:Ne,get:ze,of:Fe,theme:We});!function(t){!function(e){var n="object"===Ht(kt)?kt:"object"===("undefined"==typeof self?"undefined":Ht(self))?self:"object"===Ht(this)?this:Function("return this;")(),i=r(t);function r(t,e){return function(n,i){"function"!=typeof t[n]&&Object.defineProperty(t,n,{configurable:!0,writable:!0,value:i}),e&&e(n,i)}}void 0===n.Reflect?n.Reflect=t:i=r(n.Reflect,i),function(t){var e=Object.prototype.hasOwnProperty,n="function"==typeof Symbol,i=n&&void 0!==Symbol.toPrimitive?Symbol.toPrimitive:"@@toPrimitive",r=n&&void 0!==Symbol.iterator?Symbol.iterator:"@@iterator",o="function"==typeof Object.create,a={__proto__:[]}instanceof Array,s=!o&&!a,l={create:o?function(){return it(Object.create(null))}:a?function(){return it({__proto__:null})}:function(){return it({})},has:s?function(t,n){return e.call(t,n)}:function(t,e){return e in t},get:s?function(t,n){return e.call(t,n)?t[n]:void 0}:function(t,e){return t[e]}},h=Object.getPrototypeOf(Function),u="object"===("undefined"==typeof process?"undefined":Ht(process))&&process.env&&"true"===process.env.REFLECT_METADATA_USE_MAP_POLYFILL,c=u||"function"!=typeof Map||"function"!=typeof Map.prototype.entries?tt():Map,d=u||"function"!=typeof Set||"function"!=typeof Set.prototype.entries?et():Set,f=new(u||"function"!=typeof WeakMap?nt():WeakMap);function p(t,e,n,i){if(L(n)){if(!U(t))throw new TypeError;if(!V(e))throw new TypeError;return S(t,e)}if(!U(t))throw new TypeError;if(!W(e))throw new TypeError;if(!W(i)&&!L(i)&&!I(i))throw new TypeError;return I(i)&&(i=void 0),k(t,e,n=G(n),i)}function g(t,e){function n(n,i){if(!W(n))throw new TypeError;if(!L(i)&&!Y(i))throw new TypeError;P(t,e,n,i)}return n}function v(t,e,n,i){if(!W(n))throw new TypeError;return L(i)||(i=G(i)),P(t,e,n,i)}function y(t,e,n){if(!W(e))throw new TypeError;return L(n)||(n=G(n)),R(t,e,n)}function m(t,e,n){if(!W(e))throw new TypeError;return L(n)||(n=G(n)),B(t,e,n)}function b(t,e,n){if(!W(e))throw new TypeError;return L(n)||(n=G(n)),T(t,e,n)}function w(t,e,n){if(!W(e))throw new TypeError;return L(n)||(n=G(n)),M(t,e,n)}function C(t,e){if(!W(t))throw new TypeError;return L(e)||(e=G(e)),E(t,e)}function x(t,e){if(!W(t))throw new TypeError;return L(e)||(e=G(e)),H(t,e)}function _(t,e,n){if(!W(e))throw new TypeError;L(n)||(n=G(n));var i=A(e,n,!1);if(L(i))return!1;if(!i.delete(t))return!1;if(i.size>0)return!0;var r=f.get(e);return r.delete(n),r.size>0||f.delete(e),!0}function S(t,e){for(var n=t.length-1;n>=0;--n){var i=(0,t[n])(e);if(!L(i)&&!I(i)){if(!V(i))throw new TypeError;e=i}}return e}function k(t,e,n,i){for(var r=t.length-1;r>=0;--r){var o=(0,t[r])(e,n,i);if(!L(o)&&!I(o)){if(!W(o))throw new TypeError;i=o}}return i}function A(t,e,n){var i=f.get(t);if(L(i)){if(!n)return;i=new c,f.set(t,i)}var r=i.get(e);if(L(r)){if(!n)return;r=new c,i.set(e,r)}return r}function R(t,e,n){if(B(t,e,n))return!0;var i=Q(e);return!I(i)&&R(t,i,n)}function B(t,e,n){var i=A(e,n,!1);return!L(i)&&j(i.has(t))}function T(t,e,n){if(B(t,e,n))return M(t,e,n);var i=Q(e);return I(i)?void 0:T(t,i,n)}function M(t,e,n){var i=A(e,n,!1);if(!L(i))return i.get(t)}function P(t,e,n,i){A(n,i,!0).set(t,e)}function E(t,e){var n=H(t,e),i=Q(t);if(null===i)return n;var r=E(i,e);if(r.length<=0)return n;if(n.length<=0)return r;for(var o=new d,a=[],s=0,l=n;s<l.length;s++){var h=l[s];o.has(h)||(o.add(h),a.push(h))}for(var u=0,c=r;u<c.length;u++){h=c[u];o.has(h)||(o.add(h),a.push(h))}return a}function H(t,e){var n=[],i=A(t,e,!1);if(L(i))return n;for(var r=$(i.keys()),o=0;;){var a=Z(r);if(!a)return n.length=o,n;var s=q(a);try{n[o]=s}catch(t){try{J(r)}finally{throw t}}o++}}function O(t){if(null===t)return 1;switch(Ht(t)){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return null===t?1:6;default:return 6}}function L(t){return void 0===t}function I(t){return null===t}function D(t){return"symbol"===Ht(t)}function W(t){return"object"===Ht(t)?null!==t:"function"==typeof t}function F(t,e){switch(O(t)){case 0:case 1:case 2:case 3:case 4:case 5:return t}var n=3===e?"string":5===e?"number":"default",r=X(t,i);if(void 0!==r){var o=r.call(t,n);if(W(o))throw new TypeError;return o}return z(t,"default"===n?"number":n)}function z(t,e){if("string"===e){var n=t.toString;if(K(n))if(!W(r=n.call(t)))return r;if(K(i=t.valueOf))if(!W(r=i.call(t)))return r}else{var i;if(K(i=t.valueOf))if(!W(r=i.call(t)))return r;var r,o=t.toString;if(K(o))if(!W(r=o.call(t)))return r}throw new TypeError}function j(t){return!!t}function N(t){return""+t}function G(t){var e=F(t,3);return D(e)?e:N(e)}function U(t){return Array.isArray?Array.isArray(t):t instanceof Object?t instanceof Array:"[object Array]"===Object.prototype.toString.call(t)}function K(t){return"function"==typeof t}function V(t){return"function"==typeof t}function Y(t){switch(O(t)){case 3:case 4:return!0;default:return!1}}function X(t,e){var n=t[e];if(null!=n){if(!K(n))throw new TypeError;return n}}function $(t){var e=X(t,r);if(!K(e))throw new TypeError;var n=e.call(t);if(!W(n))throw new TypeError;return n}function q(t){return t.value}function Z(t){var e=t.next();return!e.done&&e}function J(t){var e=t.return;e&&e.call(t)}function Q(t){var e=Object.getPrototypeOf(t);if("function"!=typeof t||t===h)return e;if(e!==h)return e;var n=t.prototype,i=n&&Object.getPrototypeOf(n);if(null==i||i===Object.prototype)return e;var r=i.constructor;return"function"!=typeof r||r===t?e:r}function tt(){var t={},e=[],n=function(){function t(t,e,n){this._index=0,this._keys=t,this._values=e,this._selector=n}return t.prototype["@@iterator"]=function(){return this},t.prototype[r]=function(){return this},t.prototype.next=function(){var t=this._index;if(t>=0&&t<this._keys.length){var n=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:n,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){var e=this._find(t,!1);return e>=0?this._values[e]:void 0},e.prototype.set=function(t,e){var n=this._find(t,!0);return this._values[n]=e,this},e.prototype.delete=function(e){var n=this._find(e,!1);if(n>=0){for(var i=this._keys.length,r=n+1;r<i;r++)this._keys[r-1]=this._keys[r],this._values[r-1]=this._values[r];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 n(this._keys,this._values,i)},e.prototype.values=function(){return new n(this._keys,this._values,o)},e.prototype.entries=function(){return new n(this._keys,this._values,a)},e.prototype["@@iterator"]=function(){return this.entries()},e.prototype[r]=function(){return this.entries()},e.prototype._find=function(t,e){return this._cacheKey!==t&&(this._cacheIndex=this._keys.indexOf(this._cacheKey=t)),this._cacheIndex<0&&e&&(this._cacheIndex=this._keys.length,this._keys.push(t),this._values.push(void 0)),this._cacheIndex},e}();function i(t,e){return t}function o(t,e){return e}function a(t,e){return[t,e]}}function et(){return function(){function t(){this._map=new c}return Object.defineProperty(t.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),t.prototype.has=function(t){return this._map.has(t)},t.prototype.add=function(t){return this._map.set(t,t),this},t.prototype.delete=function(t){return this._map.delete(t)},t.prototype.clear=function(){this._map.clear()},t.prototype.keys=function(){return this._map.keys()},t.prototype.values=function(){return this._map.values()},t.prototype.entries=function(){return this._map.entries()},t.prototype["@@iterator"]=function(){return this.keys()},t.prototype[r]=function(){return this.keys()},t}()}function nt(){var t=16,n=l.create(),i=r();return function(){function t(){this._key=r()}return t.prototype.has=function(t){var e=o(t,!1);return void 0!==e&&l.has(e,this._key)},t.prototype.get=function(t){var e=o(t,!1);return void 0!==e?l.get(e,this._key):void 0},t.prototype.set=function(t,e){return o(t,!0)[this._key]=e,this},t.prototype.delete=function(t){var e=o(t,!1);return void 0!==e&&delete e[this._key]},t.prototype.clear=function(){this._key=r()},t}();function r(){var t;do{t="@@WeakMap@@"+h()}while(l.has(n,t));return n[t]=!0,t}function o(t,n){if(!e.call(t,i)){if(!n)return;Object.defineProperty(t,i,{value:l.create()})}return t[i]}function a(t,e){for(var n=0;n<e;++n)t[n]=255*Math.random()|0;return t}function s(t){return"function"==typeof Uint8Array?"undefined"!=typeof crypto?crypto.getRandomValues(new Uint8Array(t)):"undefined"!=typeof msCrypto?msCrypto.getRandomValues(new Uint8Array(t)):a(new Uint8Array(t),t):a(new Array(t),t)}function h(){var e=s(t);e[6]=79&e[6]|64,e[8]=191&e[8]|128;for(var n="",i=0;i<t;++i){var r=e[i];4!==i&&6!==i&&8!==i||(n+="-"),r<16&&(n+="0"),n+=r.toString(16).toLowerCase()}return n}}function it(t){return t.__=void 0,delete t.__,t}t("decorate",p),t("metadata",g),t("defineMetadata",v),t("hasMetadata",y),t("hasOwnMetadata",m),t("getMetadata",b),t("getOwnMetadata",w),t("getMetadataKeys",C),t("getOwnMetadataKeys",x),t("deleteMetadata",_)}(i)}()}(je||(je={}));var Ue=Symbol.for("EnvContribution"),Ke=Symbol.for("Global"),Ve="named",Ye="name",Xe="unmanaged",$e="optional",qe="inject",Ze="multi_inject",Je="inversify:tagged",Qe="inversify:tagged_props",tn="inversify:paramtypes",en="post_construct",nn="pre_destroy";var rn=[qe,Ze,Ye,Xe,Ve,$e],on={Request:"Request",Singleton:"Singleton",Transient:"Transient"},an={ConstantValue:"ConstantValue",Constructor:"Constructor",DynamicValue:"DynamicValue",Factory:"Factory",Function:"Function",Instance:"Instance",Invalid:"Invalid",Provider:"Provider"},sn={ClassProperty:"ClassProperty",ConstructorArgument:"ConstructorArgument",Variable:"Variable"},ln=0;function hn(){return ln++}var un=function(){function t(t,e){this.id=hn(),this.activated=!1,this.serviceIdentifier=t,this.scope=e,this.type=an.Invalid,this.constraint=function(t){return!0},this.implementationType=null,this.cache=null,this.factory=null,this.provider=null,this.onActivation=null,this.onDeactivation=null,this.dynamicValue=null}return t.prototype.clone=function(){var e=new t(this.serviceIdentifier,this.scope);return e.activated=e.scope===on.Singleton&&this.activated,e.implementationType=this.implementationType,e.dynamicValue=this.dynamicValue,e.scope=this.scope,e.type=this.type,e.factory=this.factory,e.provider=this.provider,e.constraint=this.constraint,e.onActivation=this.onActivation,e.onDeactivation=this.onDeactivation,e.cache=this.cache,e},t}(),cn="Metadata key was used more than once in a parameter:",dn="NULL argument",fn="Key Not Found",pn="Ambiguous match found for serviceIdentifier:",gn="No matching bindings found for serviceIdentifier:",vn="Missing required @injectable annotation in:",yn="Missing required @inject or @multiInject annotation in:",mn="Circular dependency found:",bn="The @inject @multiInject @tagged and @named decorators must be applied to the parameters of a class constructor or a class property.",wn=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return"The number of constructor arguments in the derived class "+t[0]+" must be >= than the number of constructor arguments of its base class."},Cn=function(t,e){return"@postConstruct error in class "+t+": "+e},xn=function(t,e){return"@preDestroy error in class "+t+": "+e},_n=function(t,e){return"onDeactivation() error in class "+t+": "+e},Sn="Maximum call stack size exceeded",kn=function(){function t(){}return t.prototype.getConstructorMetadata=function(t){return{compilerGeneratedMetadata:Reflect.getMetadata(tn,t),userGeneratedMetadata:Reflect.getMetadata(Je,t)||{}}},t.prototype.getPropertiesMetadata=function(t){return Reflect.getMetadata(Qe,t)||[]},t}(),An={MultipleBindingsAvailable:2,NoBindingsAvailable:0,OnlyOneBindingAvailable:1};function Rn(t){return t instanceof RangeError||t.message===Sn}function Bn(t){return"function"==typeof t?t.name:"symbol"===Ht(t)?t.toString():t}function Tn(t,e,n){var i="",r=n(t,e);return 0!==r.length&&(i="\nRegistered bindings:",r.forEach((function(t){var e="Object";null!==t.implementationType&&(e=En(t.implementationType)),i=i+"\n "+e,t.constraint.metaData&&(i=i+" - "+t.constraint.metaData)}))),i}function Mn(t,e){return null!==t.parentRequest&&(t.parentRequest.serviceIdentifier===e||Mn(t.parentRequest,e))}function Pn(t){t.childRequests.forEach((function(t){if(Mn(t,t.serviceIdentifier)){var e=function(t){var e=function t(e,n){void 0===n&&(n=[]);var i=Bn(e.serviceIdentifier);return n.push(i),null!==e.parentRequest?t(e.parentRequest,n):n}(t);return e.reverse().join(" --\x3e ")}(t);throw new Error(mn+" "+e)}Pn(t)}))}function En(t){if(t.name)return t.name;var e=t.toString(),n=e.match(/^function\s*([^\s(]+)/);return n?n[1]:"Anonymous function: "+e}var Hn=function(){function t(t){this.id=hn(),this.container=t}return t.prototype.addPlan=function(t){this.plan=t},t.prototype.setCurrentRequest=function(t){this.currentRequest=t},t}(),On=function(){function t(t,e){this.key=t,this.value=e}return t.prototype.toString=function(){return this.key===Ve?"named: "+String(this.value).toString()+" ":"tagged: { key:"+this.key.toString()+", value: "+String(this.value)+" }"},t}(),Ln=function(t,e){this.parentContext=t,this.rootRequest=e},In=function(){function t(t){this._cb=t}return t.prototype.unwrap=function(){return this._cb()},t}(),Dn=function(){function t(t){this.str=t}return t.prototype.startsWith=function(t){return 0===this.str.indexOf(t)},t.prototype.endsWith=function(t){var e,n=t.split("").reverse().join("");return e=this.str.split("").reverse().join(""),this.startsWith.call({str:e},n)},t.prototype.contains=function(t){return-1!==this.str.indexOf(t)},t.prototype.equals=function(t){return this.str===t},t.prototype.value=function(){return this.str},t}(),Wn=function(){function t(t,e,n,i){this.id=hn(),this.type=t,this.serviceIdentifier=n;var r="symbol"===Ht(e)?e.toString().slice(7,-1):e;this.name=new Dn(r||""),this.identifier=e,this.metadata=new Array;var o=null;"string"==typeof i?o=new On(Ve,i):i instanceof On&&(o=i),null!==o&&this.metadata.push(o)}return t.prototype.hasTag=function(t){for(var e=0,n=this.metadata;e<n.length;e++){if(n[e].key===t)return!0}return!1},t.prototype.isArray=function(){return this.hasTag(Ze)},t.prototype.matchesArray=function(t){return this.matchesTag(Ze)(t)},t.prototype.isNamed=function(){return this.hasTag(Ve)},t.prototype.isTagged=function(){return this.metadata.some((function(t){return rn.every((function(e){return t.key!==e}))}))},t.prototype.isOptional=function(){return this.matchesTag($e)(!0)},t.prototype.getNamedTag=function(){return this.isNamed()?this.metadata.filter((function(t){return t.key===Ve}))[0]:null},t.prototype.getCustomTags=function(){return this.isTagged()?this.metadata.filter((function(t){return rn.every((function(e){return t.key!==e}))})):null},t.prototype.matchesNamedTag=function(t){return this.matchesTag(Ve)(t)},t.prototype.matchesTag=function(t){var e=this;return function(n){for(var i=0,r=e.metadata;i<r.length;i++){var o=r[i];if(o.key===t&&o.value===n)return!0}return!1}},t}(),Fn=function(t,e,n){if(n||2===arguments.length)for(var i,r=0,o=e.length;r<o;r++)!i&&r in e||(i||(i=Array.prototype.slice.call(e,0,r)),i[r]=e[r]);return t.concat(i||Array.prototype.slice.call(e))};function zn(t,e,n,i){var r=t.getConstructorMetadata(n),o=r.compilerGeneratedMetadata;if(void 0===o)throw new Error(vn+" "+e+".");var a=r.userGeneratedMetadata,s=Object.keys(a),l=0===n.length&&s.length>0,h=s.length>n.length,u=function(t,e,n,i,r){for(var o=[],a=0;a<r;a++){var s=jn(a,t,e,n,i);null!==s&&o.push(s)}return o}(i,e,o,a,l||h?s.length:n.length),c=Gn(t,n,e);return Fn(Fn([],u,!0),c,!0)}function jn(t,e,n,i,r){var o=r[t.toString()]||[],a=Kn(o),s=!0!==a.unmanaged,l=i[t],h=a.inject||a.multiInject;if((l=h||l)instanceof In&&(l=l.unwrap()),s){if(!e&&(l===Object||l===Function||void 0===l))throw new Error(yn+" argument "+t+" in class "+n+".");var u=new Wn(sn.ConstructorArgument,a.targetName,l);return u.metadata=o,u}return null}function Nn(t,e,n,i){var r=t||e;if(void 0===r){var o=vn+" for property "+String(n)+" in class "+i+".";throw new Error(o)}return r}function Gn(t,e,n){for(var i=t.getPropertiesMetadata(e),r=[],o=Object.getOwnPropertySymbols(i),a=0,s=Object.keys(i).concat(o);a<s.length;a++){var l=s[a],h=i[l],u=Kn(h),c=u.targetName||l,d=Nn(u.inject,u.multiInject,l,n),f=new Wn(sn.ClassProperty,c,d);f.metadata=h,r.push(f)}var p=Object.getPrototypeOf(e.prototype).constructor;if(p!==Object){var g=Gn(t,p,n);r=Fn(Fn([],r,!0),g,!0)}return r}function Un(t,e){var n=Object.getPrototypeOf(e.prototype).constructor;if(n!==Object){var i=zn(t,En(n),n,!0),r=i.map((function(t){return t.metadata.filter((function(t){return t.key===Xe}))})),o=[].concat.apply([],r).length,a=i.length-o;return a>0?a:Un(t,n)}return 0}function Kn(t){var e={};return t.forEach((function(t){e[t.key.toString()]=t.value})),{inject:e[qe],multiInject:e[Ze],targetName:e[Ye],unmanaged:e[Xe]}}var Vn=function(){function t(t,e,n,i,r){this.id=hn(),this.serviceIdentifier=t,this.parentContext=e,this.parentRequest=n,this.target=r,this.childRequests=[],this.bindings=Array.isArray(i)?i:[i],this.requestScope=null===n?new Map:null}return t.prototype.addChildRequest=function(e,n,i){var r=new t(e,this.parentContext,this,n,i);return this.childRequests.push(r),r},t}();function Yn(t){return t._bindingDictionary}function Xn(t,e,n,i,r){var o=qn(n.container,r.serviceIdentifier),a=[];return o.length===An.NoBindingsAvailable&&n.container.options.autoBindInjectable&&"function"==typeof r.serviceIdentifier&&t.getConstructorMetadata(r.serviceIdentifier).compilerGeneratedMetadata&&(n.container.bind(r.serviceIdentifier).toSelf(),o=qn(n.container,r.serviceIdentifier)),a=e?o:o.filter((function(t){var e=new Vn(t.serviceIdentifier,n,i,t,r);return t.constraint(e)})),function(t,e,n,i){switch(e.length){case An.NoBindingsAvailable:if(n.isOptional())return e;var r=Bn(t),o=gn;throw o+=function(t,e){if(e.isTagged()||e.isNamed()){var n="",i=e.getNamedTag(),r=e.getCustomTags();return null!==i&&(n+=i.toString()+"\n"),null!==r&&r.forEach((function(t){n+=t.toString()+"\n"}))," "+t+"\n "+t+" - "+n}return" "+t}(r,n),o+=Tn(i,r,qn),new Error(o);case An.OnlyOneBindingAvailable:return e;case An.MultipleBindingsAvailable:default:if(n.isArray())return e;r=Bn(t),o=pn+" "+r;throw o+=Tn(i,r,qn),new Error(o)}}(r.serviceIdentifier,a,r,n.container),a}function $n(t,e,n,i,r,o){var a,s;if(null===r){a=Xn(t,e,i,null,o),s=new Vn(n,i,null,a,o);var l=new Ln(i,s);i.addPlan(l)}else a=Xn(t,e,i,r,o),s=r.addChildRequest(o.serviceIdentifier,a,o);a.forEach((function(e){var n=null;if(o.isArray())n=s.addChildRequest(e.serviceIdentifier,e,o);else{if(e.cache)return;n=s}if(e.type===an.Instance&&null!==e.implementationType){var r=function(t,e){return zn(t,En(e),e,!1)}(t,e.implementationType);if(!i.container.options.skipBaseClassChecks){var a=Un(t,e.implementationType);if(r.length<a){var l=wn(En(e.implementationType));throw new Error(l)}}r.forEach((function(e){$n(t,!1,e.serviceIdentifier,i,n,e)}))}}))}function qn(t,e){var n=[],i=Yn(t);return i.hasKey(e)?n=i.get(e):null!==t.parent&&(n=qn(t.parent,e)),n}function Zn(t,e,n,i,r,o,a,s){void 0===s&&(s=!1);var l=new Hn(e),h=function(t,e,n,i,r,o){var a=new On(t?Ze:qe,n),s=new Wn(e,i,n,a);if(void 0!==r){var l=new On(r,o);s.metadata.push(l)}return s}(n,i,r,"",o,a);try{return $n(t,s,r,l,null,h),l}catch(t){throw Rn(t)&&Pn(l.plan.rootRequest),t}}function Jn(t){return("object"===Ht(t)&&null!==t||"function"==typeof t)&&"function"==typeof t.then}function Qn(t){return!!Jn(t)||Array.isArray(t)&&t.some(Jn)}var ti,ei=function(t,e,n,i){return new(n||(n=Promise))((function(r,o){function a(t){try{l(i.next(t))}catch(t){o(t)}}function s(t){try{l(i.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((i=i.apply(t,e||[])).next())}))},ni=function(t,e){var n,i,r,o,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(r=a.trys,(r=r.length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}},ii=function(t,e,n){t.has(e.id)||t.set(e.id,n)},ri=function(t,e){t.cache=e,t.activated=!0,Jn(e)&&oi(t,e)},oi=function(t,e){return ei(void 0,void 0,void 0,(function(){var n,i;return ni(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,e];case 1:return n=r.sent(),t.cache=n,[3,3];case 2:throw i=r.sent(),t.cache=null,t.activated=!1,i;case 3:return[2]}}))}))};!function(t){t.DynamicValue="toDynamicValue",t.Factory="toFactory",t.Provider="toProvider"}(ti||(ti={}));var ai=function(){return ai=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},ai.apply(this,arguments)},si=function(t,e,n,i){return new(n||(n=Promise))((function(r,o){function a(t){try{l(i.next(t))}catch(t){o(t)}}function s(t){try{l(i.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((i=i.apply(t,e||[])).next())}))},li=function(t,e){var n,i,r,o,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(r=a.trys,(r=r.length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}},hi=function(t,e,n){if(n||2===arguments.length)for(var i,r=0,o=e.length;r<o;r++)!i&&r in e||(i||(i=Array.prototype.slice.call(e,0,r)),i[r]=e[r]);return t.concat(i||Array.prototype.slice.call(e))};function ui(t,e,n){var i;if(e.length>0){var r=function(t,e){return t.reduce((function(t,n){var i=e(n);return n.target.type===sn.ConstructorArgument?t.constructorInjections.push(i):(t.propertyRequests.push(n),t.propertyInjections.push(i)),t.isAsync||(t.isAsync=Qn(i)),t}),{constructorInjections:[],propertyInjections:[],propertyRequests:[],isAsync:!1})}(e,n),o=ai(ai({},r),{constr:t});i=r.isAsync?function(t){return si(this,void 0,void 0,(function(){var e,n;return li(this,(function(i){switch(i.label){case 0:return[4,di(t.constructorInjections)];case 1:return e=i.sent(),[4,di(t.propertyInjections)];case 2:return n=i.sent(),[2,ci(ai(ai({},t),{constructorInjections:e,propertyInjections:n}))]}}))}))}(o):ci(o)}else i=new t;return i}function ci(t){var e,n=new((e=t.constr).bind.apply(e,hi([void 0],t.constructorInjections,!1)));return t.propertyRequests.forEach((function(e,i){var r=e.target.identifier,o=t.propertyInjections[i];n[r]=o})),n}function di(t){return si(this,void 0,void 0,(function(){var e,n,i,r;return li(this,(function(o){for(e=[],n=0,i=t;n<i.length;n++)r=i[n],Array.isArray(r)?e.push(Promise.all(r)):e.push(r);return[2,Promise.all(e)]}))}))}function fi(t,e){var n=function(t,e){var n,i;if(Reflect.hasMetadata(en,t)){var r=Reflect.getMetadata(en,t);try{return null===(i=(n=e)[r.value])||void 0===i?void 0:i.call(n)}catch(e){throw new Error(Cn(t.name,e.message))}}}(t,e);return Jn(n)?n.then((function(){return e})):e}function pi(t,e){t.scope!==on.Singleton&&function(t,e){var n="Class cannot be instantiated in "+(t.scope===on.Request?"request":"transient")+" scope.";if("function"==typeof t.onDeactivation)throw new Error(_n(e.name,n));if(Reflect.hasMetadata(nn,e))throw new Error(xn(e.name,n))}(t,e)}var gi=function(t,e,n,i){return new(n||(n=Promise))((function(r,o){function a(t){try{l(i.next(t))}catch(t){o(t)}}function s(t){try{l(i.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((i=i.apply(t,e||[])).next())}))},vi=function(t,e){var n,i,r,o,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(r=a.trys,(r=r.length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}},yi=function t(e){return function(n){n.parentContext.setCurrentRequest(n);var i=n.bindings,r=n.childRequests,o=n.target&&n.target.isArray(),a=!(n.parentRequest&&n.parentRequest.target&&n.target&&n.parentRequest.target.matchesArray(n.target.serviceIdentifier));if(o&&a)return r.map((function(n){return t(e)(n)}));if(!n.target.isOptional()||0!==i.length){var s=i[0];return Ci(e,n,s)}}},mi=function(t,e){var n=function(t){switch(t.type){case an.Factory:return{factory:t.factory,factoryType:ti.Factory};case an.Provider:return{factory:t.provider,factoryType:ti.Provider};case an.DynamicValue:return{factory:t.dynamicValue,factoryType:ti.DynamicValue};default:throw new Error("Unexpected factory type "+t.type)}}(t);return function(t,e){try{return t()}catch(t){throw Rn(t)&&(t=e()),t}}((function(){return n.factory.bind(t)(e)}),(function(){return new Error((t=n.factoryType,i=e.currentRequest.serviceIdentifier.toString(),"It looks like there is a circular dependency in one of the '"+t+"' bindings. Please investigate bindings withservice identifier '"+i+"'."));var t,i}))},bi=function(t,e,n){var i,r=e.childRequests;switch(function(t){var e=null;switch(t.type){case an.ConstantValue:case an.Function:e=t.cache;break;case an.Constructor:case an.Instance:e=t.implementationType;break;case an.DynamicValue:e=t.dynamicValue;break;case an.Provider:e=t.provider;break;case an.Factory:e=t.factory}if(null===e){var n=Bn(t.serviceIdentifier);throw new Error("Invalid binding type: "+n)}}(n),n.type){case an.ConstantValue:case an.Function:i=n.cache;break;case an.Constructor:i=n.implementationType;break;case an.Instance:i=function(t,e,n,i){pi(t,e);var r=ui(e,n,i);return Jn(r)?r.then((function(t){return fi(e,t)})):fi(e,r)}(n,n.implementationType,r,yi(t));break;default:i=mi(n,e.parentContext)}return i},wi=function(t,e,n){var i=function(t,e){return e.scope===on.Singleton&&e.activated?e.cache:e.scope===on.Request&&t.has(e.id)?t.get(e.id):null}(t,e);return null!==i||function(t,e,n){e.scope===on.Singleton&&ri(e,n),e.scope===on.Request&&ii(t,e,n)}(t,e,i=n()),i},Ci=function(t,e,n){return wi(t,n,(function(){var i=bi(t,e,n);return i=Jn(i)?i.then((function(t){return xi(e,n,t)})):xi(e,n,i)}))};function xi(t,e,n){var i,r=_i(t.parentContext,e,n),o=Ri(t.parentContext.container),a=o.next();do{i=a.value;var s=t.parentContext,l=t.serviceIdentifier,h=Ai(i,l);r=Jn(r)?ki(h,s,r):Si(h,s,r),a=o.next()}while(!0!==a.done&&!Yn(i).hasKey(t.serviceIdentifier));return r}var _i=function(t,e,n){return"function"==typeof e.onActivation?e.onActivation(t,n):n},Si=function(t,e,n){for(var i=t.next();!i.done;){if(Jn(n=i.value(e,n)))return ki(t,e,n);i=t.next()}return n},ki=function(t,e,n){return gi(void 0,void 0,void 0,(function(){var i,r;return vi(this,(function(o){switch(o.label){case 0:return[4,n];case 1:i=o.sent(),r=t.next(),o.label=2;case 2:return r.done?[3,4]:[4,r.value(e,i)];case 3:return i=o.sent(),r=t.next(),[3,2];case 4:return[2,i]}}))}))},Ai=function(t,e){var n=t._activations;return n.hasKey(e)?n.get(e).values():[].values()},Ri=function(t){for(var e=[t],n=t.parent;null!==n;)e.push(n),n=n.parent;return{next:function(){var t=e.pop();return void 0!==t?{done:!1,value:t}:{done:!0,value:void 0}}}};var Bi=function t(e,n){var i=e.parentRequest;return null!==i&&(!!n(i)||t(i,n))},Ti=function(t){return function(e){var n=function(n){return null!==n&&null!==n.target&&n.target.matchesTag(t)(e)};return n.metaData=new On(t,e),n}},Mi=Ti(Ve),Pi=function(t){return function(e){var n=null;if(null!==e){if(n=e.bindings[0],"string"==typeof t)return n.serviceIdentifier===t;var i=e.bindings[0].implementationType;return t===i}return!1}},Ei=function(){function t(t){this._binding=t}return t.prototype.when=function(t){return this._binding.constraint=t,new Hi(this._binding)},t.prototype.whenTargetNamed=function(t){return this._binding.constraint=Mi(t),new Hi(this._binding)},t.prototype.whenTargetIsDefault=function(){return this._binding.constraint=function(t){return null!==t&&(null!==t.target&&!t.target.isNamed()&&!t.target.isTagged())},new Hi(this._binding)},t.prototype.whenTargetTagged=function(t,e){return this._binding.constraint=Ti(t)(e),new Hi(this._binding)},t.prototype.whenInjectedInto=function(t){return this._binding.constraint=function(e){return null!==e&&Pi(t)(e.parentRequest)},new Hi(this._binding)},t.prototype.whenParentNamed=function(t){return this._binding.constraint=function(e){return null!==e&&Mi(t)(e.parentRequest)},new Hi(this._binding)},t.prototype.whenParentTagged=function(t,e){return this._binding.constraint=function(n){return null!==n&&Ti(t)(e)(n.parentRequest)},new Hi(this._binding)},t.prototype.whenAnyAncestorIs=function(t){return this._binding.constraint=function(e){return null!==e&&Bi(e,Pi(t))},new Hi(this._binding)},t.prototype.whenNoAncestorIs=function(t){return this._binding.constraint=function(e){return null!==e&&!Bi(e,Pi(t))},new Hi(this._binding)},t.prototype.whenAnyAncestorNamed=function(t){return this._binding.constraint=function(e){return null!==e&&Bi(e,Mi(t))},new Hi(this._binding)},t.prototype.whenNoAncestorNamed=function(t){return this._binding.constraint=function(e){return null!==e&&!Bi(e,Mi(t))},new Hi(this._binding)},t.prototype.whenAnyAncestorTagged=function(t,e){return this._binding.constraint=function(n){return null!==n&&Bi(n,Ti(t)(e))},new Hi(this._binding)},t.prototype.whenNoAncestorTagged=function(t,e){return this._binding.constraint=function(n){return null!==n&&!Bi(n,Ti(t)(e))},new Hi(this._binding)},t.prototype.whenAnyAncestorMatches=function(t){return this._binding.constraint=function(e){return null!==e&&Bi(e,t)},new Hi(this._binding)},t.prototype.whenNoAncestorMatches=function(t){return this._binding.constraint=function(e){return null!==e&&!Bi(e,t)},new Hi(this._binding)},t}(),Hi=function(){function t(t){this._binding=t}return t.prototype.onActivation=function(t){return this._binding.onActivation=t,new Ei(this._binding)},t.prototype.onDeactivation=function(t){return this._binding.onDeactivation=t,new Ei(this._binding)},t}(),Oi=function(){function t(t){this._binding=t,this._bindingWhenSyntax=new Ei(this._binding),this._bindingOnSyntax=new Hi(this._binding)}return t.prototype.when=function(t){return this._bindingWhenSyntax.when(t)},t.prototype.whenTargetNamed=function(t){return this._bindingWhenSyntax.whenTargetNamed(t)},t.prototype.whenTargetIsDefault=function(){return this._bindingWhenSyntax.whenTargetIsDefault()},t.prototype.whenTargetTagged=function(t,e){return this._bindingWhenSyntax.whenTargetTagged(t,e)},t.prototype.whenInjectedInto=function(t){return this._bindingWhenSyntax.whenInjectedInto(t)},t.prototype.whenParentNamed=function(t){return this._bindingWhenSyntax.whenParentNamed(t)},t.prototype.whenParentTagged=function(t,e){return this._bindingWhenSyntax.whenParentTagged(t,e)},t.prototype.whenAnyAncestorIs=function(t){return this._bindingWhenSyntax.whenAnyAncestorIs(t)},t.prototype.whenNoAncestorIs=function(t){return this._bindingWhenSyntax.whenNoAncestorIs(t)},t.prototype.whenAnyAncestorNamed=function(t){return this._bindingWhenSyntax.whenAnyAncestorNamed(t)},t.prototype.whenAnyAncestorTagged=function(t,e){return this._bindingWhenSyntax.whenAnyAncestorTagged(t,e)},t.prototype.whenNoAncestorNamed=function(t){return this._bindingWhenSyntax.whenNoAncestorNamed(t)},t.prototype.whenNoAncestorTagged=function(t,e){return this._bindingWhenSyntax.whenNoAncestorTagged(t,e)},t.prototype.whenAnyAncestorMatches=function(t){return this._bindingWhenSyntax.whenAnyAncestorMatches(t)},t.prototype.whenNoAncestorMatches=function(t){return this._bindingWhenSyntax.whenNoAncestorMatches(t)},t.prototype.onActivation=function(t){return this._bindingOnSyntax.onActivation(t)},t.prototype.onDeactivation=function(t){return this._bindingOnSyntax.onDeactivation(t)},t}(),Li=function(){function t(t){this._binding=t}return t.prototype.inRequestScope=function(){return this._binding.scope=on.Request,new Oi(this._binding)},t.prototype.inSingletonScope=function(){return this._binding.scope=on.Singleton,new Oi(this._binding)},t.prototype.inTransientScope=function(){return this._binding.scope=on.Transient,new Oi(this._binding)},t}(),Ii=function(){function t(t){this._binding=t,this._bindingWhenSyntax=new Ei(this._binding),this._bindingOnSyntax=new Hi(this._binding),this._bindingInSyntax=new Li(t)}return t.prototype.inRequestScope=function(){return this._bindingInSyntax.inRequestScope()},t.prototype.inSingletonScope=function(){return this._bindingInSyntax.inSingletonScope()},t.prototype.inTransientScope=function(){return this._bindingInSyntax.inTransientScope()},t.prototype.when=function(t){return this._bindingWhenSyntax.when(t)},t.prototype.whenTargetNamed=function(t){return this._bindingWhenSyntax.whenTargetNamed(t)},t.prototype.whenTargetIsDefault=function(){return this._bindingWhenSyntax.whenTargetIsDefault()},t.prototype.whenTargetTagged=function(t,e){return this._bindingWhenSyntax.whenTargetTagged(t,e)},t.prototype.whenInjectedInto=function(t){return this._bindingWhenSyntax.whenInjectedInto(t)},t.prototype.whenParentNamed=function(t){return this._bindingWhenSyntax.whenParentNamed(t)},t.prototype.whenParentTagged=function(t,e){return this._bindingWhenSyntax.whenParentTagged(t,e)},t.prototype.whenAnyAncestorIs=function(t){return this._bindingWhenSyntax.whenAnyAncestorIs(t)},t.prototype.whenNoAncestorIs=function(t){return this._bindingWhenSyntax.whenNoAncestorIs(t)},t.prototype.whenAnyAncestorNamed=function(t){return this._bindingWhenSyntax.whenAnyAncestorNamed(t)},t.prototype.whenAnyAncestorTagged=function(t,e){return this._bindingWhenSyntax.whenAnyAncestorTagged(t,e)},t.prototype.whenNoAncestorNamed=function(t){return this._bindingWhenSyntax.whenNoAncestorNamed(t)},t.prototype.whenNoAncestorTagged=function(t,e){return this._bindingWhenSyntax.whenNoAncestorTagged(t,e)},t.prototype.whenAnyAncestorMatches=function(t){return this._bindingWhenSyntax.whenAnyAncestorMatches(t)},t.prototype.whenNoAncestorMatches=function(t){return this._bindingWhenSyntax.whenNoAncestorMatches(t)},t.prototype.onActivation=function(t){return this._bindingOnSyntax.onActivation(t)},t.prototype.onDeactivation=function(t){return this._bindingOnSyntax.onDeactivation(t)},t}(),Di=function(){function t(t){this._binding=t}return t.prototype.to=function(t){return this._binding.type=an.Instance,this._binding.implementationType=t,new Ii(this._binding)},t.prototype.toSelf=function(){if("function"!=typeof this._binding.serviceIdentifier)throw new Error("The toSelf function can only be applied when a constructor is used as service identifier");var t=this._binding.serviceIdentifier;return this.to(t)},t.prototype.toConstantValue=function(t){return this._binding.type=an.ConstantValue,this._binding.cache=t,this._binding.dynamicValue=null,this._binding.implementationType=null,this._binding.scope=on.Singleton,new Oi(this._binding)},t.prototype.toDynamicValue=function(t){return this._binding.type=an.DynamicValue,this._binding.cache=null,this._binding.dynamicValue=t,this._binding.implementationType=null,new Ii(this._binding)},t.prototype.toConstructor=function(t){return this._binding.type=an.Constructor,this._binding.implementationType=t,this._binding.scope=on.Singleton,new Oi(this._binding)},t.prototype.toFactory=function(t){return this._binding.type=an.Factory,this._binding.factory=t,this._binding.scope=on.Singleton,new Oi(this._binding)},t.prototype.toFunction=function(t){if("function"!=typeof t)throw new Error("Value provided to function binding must be a function!");var e=this.toConstantValue(t);return this._binding.type=an.Function,this._binding.scope=on.Singleton,e},t.prototype.toAutoFactory=function(t){return this._binding.type=an.Factory,this._binding.factory=function(e){return function(){return e.container.get(t)}},this._binding.scope=on.Singleton,new Oi(this._binding)},t.prototype.toAutoNamedFactory=function(t){return this._binding.type=an.Factory,this._binding.factory=function(e){return function(n){return e.container.getNamed(t,n)}},new Oi(this._binding)},t.prototype.toProvider=function(t){return this._binding.type=an.Provider,this._binding.provider=t,this._binding.scope=on.Singleton,new Oi(this._binding)},t.prototype.toService=function(t){this.toDynamicValue((function(e){return e.container.get(t)}))},t}(),Wi=function(){function t(){}return t.of=function(e,n,i,r,o){var a=new t;return a.bindings=e,a.middleware=n,a.deactivations=r,a.activations=i,a.moduleActivationStore=o,a},t}();var Fi=function(){function t(){this._map=new Map}return t.prototype.getMap=function(){return this._map},t.prototype.add=function(t,e){if(null==t)throw new Error(dn);if(null==e)throw new Error(dn);var n=this._map.get(t);void 0!==n?n.push(e):this._map.set(t,[e])},t.prototype.get=function(t){if(null==t)throw new Error(dn);var e=this._map.get(t);if(void 0!==e)return e;throw new Error(fn)},t.prototype.remove=function(t){if(null==t)throw new Error(dn);if(!this._map.delete(t))throw new Error(fn)},t.prototype.removeIntersection=function(t){var e=this;this.traverse((function(n,i){var r=t.hasKey(n)?t.get(n):void 0;if(void 0!==r){var o=i.filter((function(t){return!r.some((function(e){return t===e}))}));e._setValue(n,o)}}))},t.prototype.removeByCondition=function(t){var e=this,n=[];return this._map.forEach((function(i,r){for(var o=[],a=0,s=i;a<s.length;a++){var l=s[a];t(l)?n.push(l):o.push(l)}e._setValue(r,o)})),n},t.prototype.hasKey=function(t){if(null==t)throw new Error(dn);return this._map.has(t)},t.prototype.clone=function(){var e=new t;return this._map.forEach((function(t,n){t.forEach((function(t){return e.add(n,function(t){return"object"===Ht(t)&&null!==t&&"clone"in t&&"function"==typeof t.clone}(t)?t.clone():t)}))})),e},t.prototype.traverse=function(t){this._map.forEach((function(e,n){t(n,e)}))},t.prototype._setValue=function(t,e){e.length>0?this._map.set(t,e):this._map.delete(t)},t}(),zi=function(){function t(){this._map=new Map}return t.prototype.remove=function(t){if(this._map.has(t)){var e=this._map.get(t);return this._map.delete(t),e}return this._getEmptyHandlersStore()},t.prototype.addDeactivation=function(t,e,n){this._getModuleActivationHandlers(t).onDeactivations.add(e,n)},t.prototype.addActivation=function(t,e,n){this._getModuleActivationHandlers(t).onActivations.add(e,n)},t.prototype.clone=function(){var e=new t;return this._map.forEach((function(t,n){e._map.set(n,{onActivations:t.onActivations.clone(),onDeactivations:t.onDeactivations.clone()})})),e},t.prototype._getModuleActivationHandlers=function(t){var e=this._map.get(t);return void 0===e&&(e=this._getEmptyHandlersStore(),this._map.set(t,e)),e},t.prototype._getEmptyHandlersStore=function(){return{onActivations:new Fi,onDeactivations:new Fi}},t}(),ji=function(){return ji=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},ji.apply(this,arguments)},Ni=function(t,e,n,i){return new(n||(n=Promise))((function(r,o){function a(t){try{l(i.next(t))}catch(t){o(t)}}function s(t){try{l(i.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((i=i.apply(t,e||[])).next())}))},Gi=function(t,e){var n,i,r,o,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(r=a.trys,(r=r.length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}},Ui=function(t,e,n){if(n||2===arguments.length)for(var i,r=0,o=e.length;r<o;r++)!i&&r in e||(i||(i=Array.prototype.slice.call(e,0,r)),i[r]=e[r]);return t.concat(i||Array.prototype.slice.call(e))},Ki=function(){function t(t){var e=t||{};if("object"!==Ht(e))throw new Error("Invalid Container constructor argument. Container options must be an object.");if(void 0===e.defaultScope)e.defaultScope=on.Transient;else if(e.defaultScope!==on.Singleton&&e.defaultScope!==on.Transient&&e.defaultScope!==on.Request)throw new Error("Invalid Container option. Default scope must be a string ('singleton' or 'transient').");if(void 0===e.autoBindInjectable)e.autoBindInjectable=!1;else if("boolean"!=typeof e.autoBindInjectable)throw new Error("Invalid Container option. Auto bind injectable must be a boolean");if(void 0===e.skipBaseClassChecks)e.skipBaseClassChecks=!1;else if("boolean"!=typeof e.skipBaseClassChecks)throw new Error("Invalid Container option. Skip base check must be a boolean");this.options={autoBindInjectable:e.autoBindInjectable,defaultScope:e.defaultScope,skipBaseClassChecks:e.skipBaseClassChecks},this.id=hn(),this._bindingDictionary=new Fi,this._snapshots=[],this._middleware=null,this._activations=new Fi,this._deactivations=new Fi,this.parent=null,this._metadataReader=new kn,this._moduleActivationStore=new zi}return t.merge=function(e,n){for(var i=[],r=2;r<arguments.length;r++)i[r-2]=arguments[r];var o=new t,a=Ui([e,n],i,!0).map((function(t){return Yn(t)})),s=Yn(o);return a.forEach((function(t){var e;e=s,t.traverse((function(t,n){n.forEach((function(t){e.add(t.serviceIdentifier,t.clone())}))}))})),o},t.prototype.load=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];for(var n=this._getContainerModuleHelpersFactory(),i=0,r=t;i<r.length;i++){var o=r[i],a=n(o.id);o.registry(a.bindFunction,a.unbindFunction,a.isboundFunction,a.rebindFunction,a.unbindAsyncFunction,a.onActivationFunction,a.onDeactivationFunction)}},t.prototype.loadAsync=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Ni(this,void 0,void 0,(function(){var e,n,i,r,o;return Gi(this,(function(a){switch(a.label){case 0:e=this._getContainerModuleHelpersFactory(),n=0,i=t,a.label=1;case 1:return n<i.length?(r=i[n],o=e(r.id),[4,r.registry(o.bindFunction,o.unbindFunction,o.isboundFunction,o.rebindFunction,o.unbindAsyncFunction,o.onActivationFunction,o.onDeactivationFunction)]):[3,4];case 2:a.sent(),a.label=3;case 3:return n++,[3,1];case 4:return[2]}}))}))},t.prototype.unload=function(){for(var t=this,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];e.forEach((function(e){var n=t._removeModuleBindings(e.id);t._deactivateSingletons(n),t._removeModuleHandlers(e.id)}))},t.prototype.unloadAsync=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Ni(this,void 0,void 0,(function(){var e,n,i,r;return Gi(this,(function(o){switch(o.label){case 0:e=0,n=t,o.label=1;case 1:return e<n.length?(i=n[e],r=this._removeModuleBindings(i.id),[4,this._deactivateSingletonsAsync(r)]):[3,4];case 2:o.sent(),this._removeModuleHandlers(i.id),o.label=3;case 3:return e++,[3,1];case 4:return[2]}}))}))},t.prototype.bind=function(t){var e=this.options.defaultScope||on.Transient,n=new un(t,e);return this._bindingDictionary.add(t,n),new Di(n)},t.prototype.rebind=function(t){return this.unbind(t),this.bind(t)},t.prototype.rebindAsync=function(t){return Ni(this,void 0,void 0,(function(){return Gi(this,(function(e){switch(e.label){case 0:return[4,this.unbindAsync(t)];case 1:return e.sent(),[2,this.bind(t)]}}))}))},t.prototype.unbind=function(t){if(this._bindingDictionary.hasKey(t)){var e=this._bindingDictionary.get(t);this._deactivateSingletons(e)}this._removeServiceFromDictionary(t)},t.prototype.unbindAsync=function(t){return Ni(this,void 0,void 0,(function(){var e;return Gi(this,(function(n){switch(n.label){case 0:return this._bindingDictionary.hasKey(t)?(e=this._bindingDictionary.get(t),[4,this._deactivateSingletonsAsync(e)]):[3,2];case 1:n.sent(),n.label=2;case 2:return this._removeServiceFromDictionary(t),[2]}}))}))},t.prototype.unbindAll=function(){var t=this;this._bindingDictionary.traverse((function(e,n){t._deactivateSingletons(n)})),this._bindingDictionary=new Fi},t.prototype.unbindAllAsync=function(){return Ni(this,void 0,void 0,(function(){var t,e=this;return Gi(this,(function(n){switch(n.label){case 0:return t=[],this._bindingDictionary.traverse((function(n,i){t.push(e._deactivateSingletonsAsync(i))})),[4,Promise.all(t)];case 1:return n.sent(),this._bindingDictionary=new Fi,[2]}}))}))},t.prototype.onActivation=function(t,e){this._activations.add(t,e)},t.prototype.onDeactivation=function(t,e){this._deactivations.add(t,e)},t.prototype.isBound=function(t){var e=this._bindingDictionary.hasKey(t);return!e&&this.parent&&(e=this.parent.isBound(t)),e},t.prototype.isCurrentBound=function(t){return this._bindingDictionary.hasKey(t)},t.prototype.isBoundNamed=function(t,e){return this.isBoundTagged(t,Ve,e)},t.prototype.isBoundTagged=function(t,e,n){var i=!1;if(this._bindingDictionary.hasKey(t)){var r=this._bindingDictionary.get(t),o=function(t,e,n,i){var r=new Wn(sn.Variable,"",e,new On(n,i)),o=new Hn(t);return new Vn(e,o,null,[],r)}(this,t,e,n);i=r.some((function(t){return t.constraint(o)}))}return!i&&this.parent&&(i=this.parent.isBoundTagged(t,e,n)),i},t.prototype.snapshot=function(){this._snapshots.push(Wi.of(this._bindingDictionary.clone(),this._middleware,this._activations.clone(),this._deactivations.clone(),this._moduleActivationStore.clone()))},t.prototype.restore=function(){var t=this._snapshots.pop();if(void 0===t)throw new Error("No snapshot available to restore.");this._bindingDictionary=t.bindings,this._activations=t.activations,this._deactivations=t.deactivations,this._middleware=t.middleware,this._moduleActivationStore=t.moduleActivationStore},t.prototype.createChild=function(e){var n=new t(e||this.options);return n.parent=this,n},t.prototype.applyMiddleware=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=this._middleware?this._middleware:this._planAndResolve();this._middleware=t.reduce((function(t,e){return e(t)}),n)},t.prototype.applyCustomMetadataReader=function(t){this._metadataReader=t},t.prototype.get=function(t){var e=this._getNotAllArgs(t,!1);return this._getButThrowIfAsync(e)},t.prototype.getAsync=function(t){return Ni(this,void 0,void 0,(function(){var e;return Gi(this,(function(n){return e=this._getNotAllArgs(t,!1),[2,this._get(e)]}))}))},t.prototype.getTagged=function(t,e,n){var i=this._getNotAllArgs(t,!1,e,n);return this._getButThrowIfAsync(i)},t.prototype.getTaggedAsync=function(t,e,n){return Ni(this,void 0,void 0,(function(){var i;return Gi(this,(function(r){return i=this._getNotAllArgs(t,!1,e,n),[2,this._get(i)]}))}))},t.prototype.getNamed=function(t,e){return this.getTagged(t,Ve,e)},t.prototype.getNamedAsync=function(t,e){return this.getTaggedAsync(t,Ve,e)},t.prototype.getAll=function(t){var e=this._getAllArgs(t);return this._getButThrowIfAsync(e)},t.prototype.getAllAsync=function(t){var e=this._getAllArgs(t);return this._getAll(e)},t.prototype.getAllTagged=function(t,e,n){var i=this._getNotAllArgs(t,!0,e,n);return this._getButThrowIfAsync(i)},t.prototype.getAllTaggedAsync=function(t,e,n){var i=this._getNotAllArgs(t,!0,e,n);return this._getAll(i)},t.prototype.getAllNamed=function(t,e){return this.getAllTagged(t,Ve,e)},t.prototype.getAllNamedAsync=function(t,e){return this.getAllTaggedAsync(t,Ve,e)},t.prototype.resolve=function(t){var e=this.isBound(t);e||this.bind(t).toSelf();var n=this.get(t);return e||this.unbind(t),n},t.prototype._preDestroy=function(t,e){if(Reflect.hasMetadata(nn,t))return e[Reflect.getMetadata(nn,t).value]()},t.prototype._removeModuleHandlers=function(t){var e=this._moduleActivationStore.remove(t);this._activations.removeIntersection(e.onActivations),this._deactivations.removeIntersection(e.onDeactivations)},t.prototype._removeModuleBindings=function(t){return this._bindingDictionary.removeByCondition((function(e){return e.moduleId===t}))},t.prototype._deactivate=function(t,e){var n=this,i=Object.getPrototypeOf(e).constructor;try{if(this._deactivations.hasKey(t.serviceIdentifier)){var r=this._deactivateContainer(e,this._deactivations.get(t.serviceIdentifier).values());if(Jn(r))return this._handleDeactivationError(r.then((function(){return n._propagateContainerDeactivationThenBindingAndPreDestroyAsync(t,e,i)})),i)}var o=this._propagateContainerDeactivationThenBindingAndPreDestroy(t,e,i);if(Jn(o))return this._handleDeactivationError(o,i)}catch(t){throw new Error(_n(i.name,t.message))}},t.prototype._handleDeactivationError=function(t,e){return Ni(this,void 0,void 0,(function(){var n;return Gi(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,t];case 1:return i.sent(),[3,3];case 2:throw n=i.sent(),new Error(_n(e.name,n.message));case 3:return[2]}}))}))},t.prototype._deactivateContainer=function(t,e){for(var n=this,i=e.next();i.value;){var r=i.value(t);if(Jn(r))return r.then((function(){return n._deactivateContainerAsync(t,e)}));i=e.next()}},t.prototype._deactivateContainerAsync=function(t,e){return Ni(this,void 0,void 0,(function(){var n;return Gi(this,(function(i){switch(i.label){case 0:n=e.next(),i.label=1;case 1:return n.value?[4,n.value(t)]:[3,3];case 2:return i.sent(),n=e.next(),[3,1];case 3:return[2]}}))}))},t.prototype._getContainerModuleHelpersFactory=function(){var t=this,e=function(t,e){t._binding.moduleId=e},n=function(n){return function(i){var r=t.rebind(i);return e(r,n),r}},i=function(e){return function(n,i){t._moduleActivationStore.addActivation(e,n,i),t.onActivation(n,i)}},r=function(e){return function(n,i){t._moduleActivationStore.addDeactivation(e,n,i),t.onDeactivation(n,i)}};return function(o){return{bindFunction:(a=o,function(n){var i=t.bind(n);return e(i,a),i}),isboundFunction:function(e){return t.isBound(e)},onActivationFunction:i(o),onDeactivationFunction:r(o),rebindFunction:n(o),unbindFunction:function(e){return t.unbind(e)},unbindAsyncFunction:function(e){return t.unbindAsync(e)}};var a}},t.prototype._getAll=function(t){return Promise.all(this._get(t))},t.prototype._get=function(t){var e=ji(ji({},t),{contextInterceptor:function(t){return t},targetType:sn.Variable});if(this._middleware){var n=this._middleware(e);if(null==n)throw new Error("Invalid return type in middleware. Middleware must return!");return n}return this._planAndResolve()(e)},t.prototype._getButThrowIfAsync=function(t){var e=this._get(t);if(Qn(e))throw new Error("You are attempting to construct '"+t.serviceIdentifier+"' in a synchronous way\n but it has asynchronous dependencies.");return e},t.prototype._getAllArgs=function(t){return{avoidConstraints:!0,isMultiInject:!0,serviceIdentifier:t}},t.prototype._getNotAllArgs=function(t,e,n,i){return{avoidConstraints:!1,isMultiInject:e,serviceIdentifier:t,key:n,value:i}},t.prototype._planAndResolve=function(){var t=this;return function(e){var n=Zn(t._metadataReader,t,e.isMultiInject,e.targetType,e.serviceIdentifier,e.key,e.value,e.avoidConstraints);return function(t){return yi(t.plan.rootRequest.requestScope)(t.plan.rootRequest)}(n=e.contextInterceptor(n))}},t.prototype._deactivateIfSingleton=function(t){var e=this;if(t.activated)return Jn(t.cache)?t.cache.then((function(n){return e._deactivate(t,n)})):this._deactivate(t,t.cache)},t.prototype._deactivateSingletons=function(t){for(var e=0,n=t;e<n.length;e++){var i=n[e];if(Jn(this._deactivateIfSingleton(i)))throw new Error("Attempting to unbind dependency with asynchronous destruction (@preDestroy or onDeactivation)")}},t.prototype._deactivateSingletonsAsync=function(t){return Ni(this,void 0,void 0,(function(){var e=this;return Gi(this,(function(n){switch(n.label){case 0:return[4,Promise.all(t.map((function(t){return e._deactivateIfSingleton(t)})))];case 1:return n.sent(),[2]}}))}))},t.prototype._propagateContainerDeactivationThenBindingAndPreDestroy=function(t,e,n){return this.parent?this._deactivate.bind(this.parent)(t,e):this._bindingDeactivationAndPreDestroy(t,e,n)},t.prototype._propagateContainerDeactivationThenBindingAndPreDestroyAsync=function(t,e,n){return Ni(this,void 0,void 0,(function(){return Gi(this,(function(i){switch(i.label){case 0:return this.parent?[4,this._deactivate.bind(this.parent)(t,e)]:[3,2];case 1:return i.sent(),[3,4];case 2:return[4,this._bindingDeactivationAndPreDestroyAsync(t,e,n)];case 3:i.sent(),i.label=4;case 4:return[2]}}))}))},t.prototype._removeServiceFromDictionary=function(t){try{this._bindingDictionary.remove(t)}catch(e){throw new Error("Could not unbind serviceIdentifier: "+Bn(t))}},t.prototype._bindingDeactivationAndPreDestroy=function(t,e,n){var i=this;if("function"==typeof t.onDeactivation){var r=t.onDeactivation(e);if(Jn(r))return r.then((function(){return i._preDestroy(n,e)}))}return this._preDestroy(n,e)},t.prototype._bindingDeactivationAndPreDestroyAsync=function(t,e,n){return Ni(this,void 0,void 0,(function(){return Gi(this,(function(i){switch(i.label){case 0:return"function"!=typeof t.onDeactivation?[3,2]:[4,t.onDeactivation(e)];case 1:i.sent(),i.label=2;case 2:return[4,this._preDestroy(n,e)];case 3:return i.sent(),[2]}}))}))},t}(),Vi=function(t){this.id=hn(),this.registry=t};function Yi(t,e,n,i){!function(t){if(void 0!==t)throw new Error(bn)}(e),$i(Je,t,n.toString(),i)}function Xi(t){var e=[];if(Array.isArray(t)){var n=function(t){for(var e=new Set,n=0,i=t;n<i.length;n++){var r=i[n];if(e.has(r))return r;e.add(r)}}((e=t).map((function(t){return t.key})));if(void 0!==n)throw new Error(cn+" "+n.toString())}else e=[t];return e}function $i(t,e,n,i){var r=Xi(i),o={};Reflect.hasOwnMetadata(t,e)&&(o=Reflect.getMetadata(t,e));var a=o[n];if(void 0===a)a=[];else for(var s=function(t){if(r.some((function(e){return e.key===t.key})))throw new Error(cn+" "+t.key.toString())},l=0,h=a;l<h.length;l++){s(h[l])}a.push.apply(a,r),o[n]=a,Reflect.defineMetadata(t,o,e)}function qi(t){return function(e,n,i){"number"==typeof i?Yi(e,n,i,t):function(t,e,n){if(void 0!==t.prototype)throw new Error(bn);$i(Qe,t.constructor,e,n)}(e,n,t)}}function Zi(){return function(t){if(Reflect.hasOwnMetadata(tn,t))throw new Error("Cannot apply @injectable decorator multiple times.");var e=Reflect.getMetadata("design:paramtypes",t)||[];return Reflect.defineMetadata(tn,e,t),t}}function Ji(t){return qi(new On(Ve,t))}function Qi(t){return function(e){return function(n,i,r){if(void 0===e){var o="function"==typeof n?n.name:n.constructor.name;throw new Error(function(t){return"@inject called with undefined this could mean that the class "+t+" has a circular dependency problem. You can use a LazyServiceIdentifer to overcome this limitation."}(o))}return qi(new On(t,e))(n,i,r)}}}var tr=Qi(qe),er=Qi(Ze);var nr,ir,rr=(nr=en,ir="Cannot apply @postConstruct decorator multiple times in the same class",function(){return function(t,e){var n=new On(nr,e);if(Reflect.hasOwnMetadata(nr,t.constructor))throw new Error(ir);Reflect.defineMetadata(nr,n,t.constructor)}}),or=function(){function t(e,n){Qt(this,t),this._args=e,this.name=n,this.taps=[]}return Jt(t,[{key:"tap",value:function(t,e){this._tap("sync",t,e)}},{key:"unTap",value:function(t,e){var n="string"==typeof t?t.trim():t.name;n&&(this.taps=this.taps.filter((function(t){return t.name!==n&&(!e||t.fn===e)})))}},{key:"_parseOptions",value:function(t,e,n){var i;if("string"==typeof e)i={name:e.trim()};else if("object"!=Ht(e)||null===e)throw new Error("Invalid tap options");if("string"!=typeof i.name||""===i.name)throw new Error("Missing name for tap");return i=Object.assign({type:t,fn:n},i)}},{key:"_tap",value:function(t,e,n){this._insert(this._parseOptions(t,e,n))}},{key:"_insert",value:function(t){var e;"string"==typeof t.before?e=new Set([t.before]):Array.isArray(t.before)&&(e=new Set(t.before));var n=0;"number"==typeof t.stage&&(n=t.stage);for(var i=this.taps.length;i>0;){i--;var r=this.taps[i];this.taps[i+1]=r;var o=r.stage||0;if(e){if(e.has(r.name)){e.delete(r.name);continue}if(e.size>0)continue}if(!(o>n)){i++;break}}this.taps[i]=t}}]),t}();function ar(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=re(t);if(e){var r=re(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return ie(this,n)}}var sr=function(t){ee(n,t);var e=ar(n);function n(){return Qt(this,n),e.apply(this,arguments)}return Jt(n,[{key:"call",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];this.taps.map((function(t){return t.fn})).forEach((function(t){return t.apply(void 0,e)}))}}]),n}(or),lr=Symbol("ContributionProvider"),hr=function(){function t(e,n){Qt(this,t),this.serviceIdentifier=e,this.container=n}return Jt(t,[{key:"getContributions",value:function(){var t;return this.caches||(this.caches=[],this.container&&(t=this.caches).push.apply(t,Wt(this.container.getAll(this.serviceIdentifier)))),this.caches}}]),t}();function ur(t,e){t(lr).toDynamicValue((function(t){var n=t.container;return new hr(e,n)})).inSingletonScope().whenTargetNamed(e)}var cr=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},dr=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},fr=function(t,e){return function(n,i){e(n,i,t)}},pr=function(){function t(e){Qt(this,t),this.contributions=e,this.hooks={onSetEnv:new sr(["lastEnv","env","global"])},this.measureTextMethod="native"}return Jt(t,[{key:"env",get:function(){return this._env}},{key:"devicePixelRatio",get:function(){return this._env||this.setEnv("browser"),this.envContribution.getDevicePixelRatio()}},{key:"supportEvent",get:function(){return this._env||this.setEnv("browser"),this.envContribution.supportEvent}},{key:"supportsTouchEvents",get:function(){return this._env||this.setEnv("browser"),this.envContribution.supportsTouchEvents}},{key:"supportsPointerEvents",get:function(){return this._env||this.setEnv("browser"),this.envContribution.supportsPointerEvents}},{key:"supportsMouseEvents",get:function(){return this._env||this.setEnv("browser"),this.envContribution.supportsMouseEvents}},{key:"applyStyles",get:function(){return this._env||this.setEnv("browser"),this.envContribution.applyStyles}},{key:"bindContribution",value:function(t){var e=this;this.contributions.getContributions().forEach((function(n){n.configure(e,t)}))}},{key:"setEnv",value:function(t,e){(e&&!0===e.force||this._env!==t)&&(this.deactiveCurrentEnv(),this.activeEnv(t,e))}},{key:"deactiveCurrentEnv",value:function(){this.envContribution&&this.envContribution.release()}},{key:"activeEnv",value:function(t,e){var n=this._env;this._env=t,this.bindContribution(e),this.envParams=e,this.hooks.onSetEnv.call(n,t,this)}},{key:"setActiveEnvContribution",value:function(t){this.envContribution=t}},{key:"createCanvas",value:function(t){return this._env||this.setEnv("browser"),this.envContribution.createCanvas(t)}},{key:"createOffscreenCanvas",value:function(t){return this._env||this.setEnv("browser"),this.envContribution.createOffscreenCanvas(t)}},{key:"releaseCanvas",value:function(t){return this._env||this.setEnv("browser"),this.envContribution.releaseCanvas(t)}},{key:"addEventListener",value:function(t,e,n){return this._env||this.setEnv("browser"),this.envContribution.addEventListener(t,e,n)}},{key:"removeEventListener",value:function(t,e,n){return this._env||this.setEnv("browser"),this.envContribution.removeEventListener(t,e,n)}},{key:"dispatchEvent",value:function(t){return this._env||this.setEnv("browser"),this.envContribution.dispatchEvent(t)}},{key:"getRequestAnimationFrame",value:function(){return this._env||this.setEnv("browser"),this.envContribution.getRequestAnimationFrame()}},{key:"getCancelAnimationFrame",value:function(){return this._env||this.setEnv("browser"),this.envContribution.getCancelAnimationFrame()}},{key:"getElementById",value:function(t){return this._env||this.setEnv("browser"),this.envContribution.getElementById?this.envContribution.getElementById(t):null}},{key:"getRootElement",value:function(){return this._env||this.setEnv("browser"),this.envContribution.getRootElement?this.envContribution.getRootElement():null}},{key:"getDocument",value:function(){return this._env||this.setEnv("browser"),this.envContribution.getDocument?this.envContribution.getDocument():null}},{key:"mapToCanvasPoint",value:function(t,e){return this._env||this.setEnv("browser"),this.envContribution.mapToCanvasPoint?this.envContribution.mapToCanvasPoint(t,e):null}},{key:"loadImage",value:function(t){return this._env||this.setEnv("browser"),this.envContribution.loadImage(t)}},{key:"loadSvg",value:function(t){return this._env||this.setEnv("browser"),this.envContribution.loadSvg(t)}},{key:"loadJson",value:function(t){return this._env||this.setEnv("browser"),this.envContribution.loadJson(t)}},{key:"loadArrayBuffer",value:function(t){return this._env||this.setEnv("browser"),this.envContribution.loadArrayBuffer(t)}},{key:"loadBlob",value:function(t){return this._env||this.setEnv("browser"),this.envContribution.loadBlob(t)}}]),t}();pr=cr([Zi(),fr(0,tr(lr)),fr(0,Ji(Ue)),dr("design:paramtypes",[Object])],pr);var gr=function(t,e){return toString.call(t)==="[object ".concat(e,"]")},vr=function(t){return arguments.length>1&&void 0!==arguments[1]&&arguments[1]?"boolean"==typeof t:!0===t||!1===t||gr(t,"Boolean")},yr=function(t){return"function"==typeof t},mr=function(t){return null==t},br=function(t){return null!=t},wr=function(t){var e=Ht(t);return null!==t&&"object"===e||"function"===e},Cr=function(t){if(!function(t){return"object"==Ht(t)&&null!==t}(t)||!gr(t,"Object"))return!1;if(null===Object.getPrototypeOf(t))return!0;for(var e=t;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e},xr=function(t){return void 0===t},_r=function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=Ht(t);return e?"string"===n:"string"===n||gr(t,"String")},Sr=function(t){return Array.isArray?Array.isArray(t):gr(t,"Array")},kr=function(t){return null!==t&&"function"!=typeof t&&Number.isFinite(t.length)},Ar=function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=Ht(t);return e?"number"===n:"number"===n||gr(t,"Number")},Rr=function(t){return Ar(t)&&Number.isFinite(t)},Br=function(t,e,n){for(var i=_r(e)?e.split("."):e,r=0;r<i.length;r++)t=t?t[i[r]]:void 0;return void 0===t?n:t},Tr=Object.prototype.hasOwnProperty,Mr=function(t,e){return null!=t&&Tr.call(t,e)};function Pr(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:void 0,r=[],o=[];return void 0===e&&(e=!0),void 0===n&&(n=1/0),function t(n,a){if(null===n)return null;if(0===a)return n;var s,l,h;if("object"!=Ht(n))return n;if(Sr(n)?s=[]:gr(n,"RegExp")?(s=new RegExp(n.source,(h="",(l=n).global&&(h+="g"),l.ignoreCase&&(h+="i"),l.multiline&&(h+="m"),h)),n.lastIndex&&(s.lastIndex=n.lastIndex)):s=function(t){return gr(t,"Date")}(n)?new Date(n.getTime()):void 0===i?Object.create(Object.getPrototypeOf(n)):Object.create(i),e){var u=r.indexOf(n);if(-1!==u)return o[u];r.push(n),o.push(s)}for(var c in n)s[c]=t(n[c],a-1);return s}(t,n)}function Er(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(e){if(t===e)return;if(br(e)&&"object"==Ht(e)){var i=Object(e),r=[];for(var o in i)r.push(o);for(var a=r.length,s=-1;a--;){var l=r[++s];br(i[l])&&"object"==Ht(i[l])?Hr(t,e,l,n):Or(t,l,i[l])}}}}function Hr(t,e,n){var i=arguments.length>3&&void 0!==arguments[3]&&arguments[3],r=t[n],o=e[n],a=e[n],s=!0;if(Sr(o)){if(i)a=[];else if(Sr(r))a=r;else if(kr(r)){a=new Array(r.length);for(var l=-1,h=r.length;++l<h;)a[l]=r[l]}}else Cr(o)?(a=r,"function"!=typeof r&&"object"==Ht(r)||(a={})):s=!1;s&&Er(a,o,i),Or(t,n,a)}function Or(t,e,n){(void 0!==n&&!function(t,e){return t===e||Number.isNaN(t)&&Number.isNaN(e)}(t[e],n)||void 0===n&&!(e in t))&&(t[e]=n)}function Lr(t){for(var e=-1,n=arguments.length<=1?0:arguments.length-1;++e<n;)Er(t,e+1<1||arguments.length<=e+1?void 0:arguments[e+1],!0);return t}function Ir(t,e){if(!Sr(t)||!Sr(e))return!1;if(t.length!==e.length)return!1;for(var n=0;n<t.length;n++)if(t[n]!==e[n])return!1;return!0}var Dr=function(t,e,n){return t<e?e:t>n?n:t},Wr=function(t,e,n){var i=Vt(t,2),r=i[0],o=i[1];o<r&&(r=t[1],o=t[0]);var a=o-r;return a>=n-e?[e,n]:[r=Math.min(Math.max(r,e),n-a),r+a]};try{"function"==typeof requestAnimationFrame&&"function"==typeof cancelAnimationFrame}catch(t){!1}var Fr=1e-12,zr=Math.PI,jr=zr/2,Nr=2*zr,Gr=2*Math.PI,Ur=Math.abs,Kr=Math.atan2,Vr=Math.cos,Yr=Math.max,Xr=Math.min,$r=Math.sin,qr=Math.sqrt,Zr=Math.pow;function Jr(t){return t>1?0:t<-1?zr:Math.acos(t)}function Qr(t){return t>=1?jr:t<=-1?-jr:Math.asin(t)}function to(t,e,n,i,r){var o,a;return"number"==typeof t&&"number"==typeof n&&(o=(1-r)*t+r*n),"number"==typeof e&&"number"==typeof i&&(a=(1-r)*e+r*i),{x:o,y:a}}var eo=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0;Qt(this,t),this.x=0,this.y=0,this.x=e,this.y=n,this.x1=i,this.y1=r}return Jt(t,[{key:"clone",value:function(){return new t(this.x,this.y)}},{key:"copyFrom",value:function(t){return this.x=t.x,this.y=t.y,this.x1=t.x1,this.y1=t.y1,this.defined=t.defined,this.context=t.context,this}},{key:"set",value:function(t,e){return this.x=t,this.y=e,this}},{key:"add",value:function(t){return Ar(t)?(this.x+=t,void(this.y+=t)):(this.x+=t.x,this.y+=t.y,this)}},{key:"sub",value:function(t){return Ar(t)?(this.x-=t,void(this.y-=t)):(this.x-=t.x,this.y-=t.y,this)}},{key:"multi",value:function(t){throw new Error("暂不支持")}},{key:"div",value:function(t){throw new Error("暂不支持")}}]),t}(),no=function(){function t(){Qt(this,t)}return Jt(t,null,[{key:"distancePP",value:function(t,e){return qr(Zr(t.x-e.x,2)+Zr(t.y-e.y,2))}},{key:"distanceNN",value:function(t,e,n,i){return qr(Zr(t-n,2)+Zr(e-i,2))}},{key:"distancePN",value:function(t,e,n){return qr(Zr(e-t.x,2)+Zr(n-t.y,2))}},{key:"pointAtPP",value:function(t,e,n){return new eo((e.x-t.x)*n+t.x,(e.y-t.y)*n+t.y)}}]),t}();function io(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=re(t);if(e){var r=re(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return ie(this,n)}}function ro(t,e,n){var i=e.x1,r=e.y1,o=e.x2,a=e.y2;return n.onlyTranslate()?(t!==e&&t.setValue(e.x1,e.y1,e.x2,e.y2),t.translate(n.e,n.f),e):(t.clear(),t.add(n.a*i+n.c*r+n.e,n.b*i+n.d*r+n.f),t.add(n.a*o+n.c*r+n.e,n.b*o+n.d*r+n.f),t.add(n.a*o+n.c*a+n.e,n.b*o+n.d*a+n.f),t.add(n.a*i+n.c*a+n.e,n.b*i+n.d*a+n.f),e)}var oo=function(){function t(e){Qt(this,t),e?this.setValue(e.x1,e.y1,e.x2,e.y2):this.clear()}return Jt(t,[{key:"clone",value:function(){return new t(this)}},{key:"clear",value:function(){return this.x1=+Number.MAX_VALUE,this.y1=+Number.MAX_VALUE,this.x2=-Number.MAX_VALUE,this.y2=-Number.MAX_VALUE,this}},{key:"empty",value:function(){return this.x1===+Number.MAX_VALUE&&this.y1===+Number.MAX_VALUE&&this.x2===-Number.MAX_VALUE&&this.y2===-Number.MAX_VALUE}},{key:"equals",value:function(t){return this.x1===t.x1&&this.y1===t.y1&&this.x2===t.x2&&this.y2===t.y2}},{key:"setValue",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return this.x1=t,this.y1=e,this.x2=n,this.y2=i,this}},{key:"set",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return n<t?(this.x2=t,this.x1=n):(this.x1=t,this.x2=n),i<e?(this.y2=e,this.y1=i):(this.y1=e,this.y2=i),this}},{key:"add",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return t<this.x1&&(this.x1=t),e<this.y1&&(this.y1=e),t>this.x2&&(this.x2=t),e>this.y2&&(this.y2=e),this}},{key:"expand",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return Sr(t)?(this.y1-=t[0],this.x2+=t[1],this.y2+=t[2],this.x1-=t[3]):(this.x1-=t,this.y1-=t,this.x2+=t,this.y2+=t),this}},{key:"round",value:function(){return this.x1=Math.floor(this.x1),this.y1=Math.floor(this.y1),this.x2=Math.ceil(this.x2),this.y2=Math.ceil(this.y2),this}},{key:"translate",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.x1+=t,this.x2+=t,this.y1+=e,this.y2+=e,this}},{key:"rotate",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=this.rotatedPoints(t,e,n);return this.clear().add(i[0],i[1]).add(i[2],i[3]).add(i[4],i[5]).add(i[6],i[7])}},{key:"scale",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=this.scalePoints(t,e,n,i);return this.clear().add(r[0],r[1]).add(r[2],r[3])}},{key:"union",value:function(t){return t.x1<this.x1&&(this.x1=t.x1),t.y1<this.y1&&(this.y1=t.y1),t.x2>this.x2&&(this.x2=t.x2),t.y2>this.y2&&(this.y2=t.y2),this}},{key:"intersect",value:function(t){return t.x1>this.x1&&(this.x1=t.x1),t.y1>this.y1&&(this.y1=t.y1),t.x2<this.x2&&(this.x2=t.x2),t.y2<this.y2&&(this.y2=t.y2),this}},{key:"encloses",value:function(t){return t&&this.x1<=t.x1&&this.x2>=t.x2&&this.y1<=t.y1&&this.y2>=t.y2}},{key:"alignsWith",value:function(t){return t&&(this.x1===t.x1||this.x2===t.x2||this.y1===t.y1||this.y2===t.y2)}},{key:"intersects",value:function(t){return t&&!(this.x2<t.x1||this.x1>t.x2||this.y2<t.y1||this.y1>t.y2)}},{key:"contains",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return!(t<this.x1||t>this.x2||e<this.y1||e>this.y2)}},{key:"containsPoint",value:function(t){return!(t.x<this.x1||t.x>this.x2||t.y<this.y1||t.y>this.y2)}},{key:"width",value:function(){return this.empty()?0:this.x2-this.x1}},{key:"height",value:function(){return this.empty()?0:this.y2-this.y1}},{key:"scaleX",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this.x1*=t,this.x2*=t,this}},{key:"scaleY",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this.y1*=t,this.y2*=t,this}},{key:"transformWithMatrix",value:function(t){return ro(this,this,t),this}},{key:"copy",value:function(t){return this.x1=t.x1,this.y1=t.y1,this.x2=t.x2,this.y2=t.y2,this}},{key:"rotatedPoints",value:function(t,e,n){var i=this.x1,r=this.y1,o=this.x2,a=this.y2,s=Math.cos(t),l=Math.sin(t),h=e-e*s+n*l,u=n-e*l-n*s;return[s*i-l*r+h,l*i+s*r+u,s*i-l*a+h,l*i+s*a+u,s*o-l*r+h,l*o+s*r+u,s*o-l*a+h,l*o+s*a+u]}},{key:"scalePoints",value:function(t,e,n,i){return[t*this.x1+(1-t)*n,e*this.y1+(1-e)*i,t*this.x2+(1-t)*n,e*this.y2+(1-e)*i]}}]),t}(),ao=function(t){ee(n,t);var e=io(n);function n(){return Qt(this,n),e.apply(this,arguments)}return Jt(n)}(oo);var so,lo,ho,uo,co,fo,po,go,vo,yo=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if(t<0)for(;t<-Nr;)t+=Nr;else if(t>0)for(;t>Nr;)t-=Nr;return t},mo=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;Qt(this,t),this.a=e,this.b=n,this.c=i,this.d=r,this.e=o,this.f=a}return Jt(t,[{key:"equalToMatrix",value:function(t){return!(this.e!==t.e||this.f!==t.f||this.a!==t.a||this.d!==t.d||this.b!==t.b||this.c!==t.c)}},{key:"equalTo",value:function(t,e,n,i,r,o){return!(this.e!==r||this.f!==o||this.a!==t||this.d!==i||this.b!==e||this.c!==n)}},{key:"setValue",value:function(t,e,n,i,r,o){return this.a=t,this.b=e,this.c=n,this.d=i,this.e=r,this.f=o,this}},{key:"reset",value:function(){return this.a=1,this.b=0,this.c=0,this.d=1,this.e=0,this.f=0,this}},{key:"getInverse",value:function(){var e=this.a,n=this.b,i=this.c,r=this.d,o=this.e,a=this.f,s=new t,l=e*r-n*i;return s.a=r/l,s.b=-n/l,s.c=-i/l,s.d=e/l,s.e=(i*a-r*o)/l,s.f=-(e*a-n*o)/l,s}},{key:"rotate",value:function(t){var e=Math.cos(t),n=Math.sin(t),i=this.a*e+this.c*n,r=this.b*e+this.d*n,o=this.a*-n+this.c*e,a=this.b*-n+this.d*e;return this.a=i,this.b=r,this.c=o,this.d=a,this}},{key:"rotateByCenter",value:function(t,e,n){var i=Math.cos(t),r=Math.sin(t),o=(1-i)*e+r*n,a=(1-i)*n-r*e,s=i*this.a-r*this.b,l=r*this.a+i*this.b,h=i*this.c-r*this.d,u=r*this.c+i*this.d,c=i*this.e-r*this.f+o,d=r*this.e+i*this.f+a;return this.a=s,this.b=l,this.c=h,this.d=u,this.e=c,this.f=d,this}},{key:"scale",value:function(t,e){return this.a*=t,this.b*=t,this.c*=e,this.d*=e,this}},{key:"setScale",value:function(t,e){return this.b=this.b/this.a*t,this.c=this.c/this.d*e,this.a=t,this.d=e,this}},{key:"transform",value:function(t,e,n,i,r,o){return this.multiply(t,e,n,i,r,o),this}},{key:"translate",value:function(t,e){return this.e+=this.a*t+this.c*e,this.f+=this.b*t+this.d*e,this}},{key:"transpose",value:function(){var t=this.a,e=this.b,n=this.c,i=this.d,r=this.e,o=this.f;return this.a=e,this.b=t,this.c=i,this.d=n,this.e=o,this.f=r,this}},{key:"multiply",value:function(t,e,n,i,r,o){var a=this.a,s=this.b,l=this.c,h=this.d,u=a*t+l*e,c=s*t+h*e,d=a*n+l*i,f=s*n+h*i,p=a*r+l*o+this.e,g=s*r+h*o+this.f;return this.a=u,this.b=c,this.c=d,this.d=f,this.e=p,this.f=g,this}},{key:"interpolate",value:function(e,n){var i=new t;return i.a=this.a+(e.a-this.a)*n,i.b=this.b+(e.b-this.b)*n,i.c=this.c+(e.c-this.c)*n,i.d=this.d+(e.d-this.d)*n,i.e=this.e+(e.e-this.e)*n,i.f=this.f+(e.f-this.f)*n,i}},{key:"transformPoint",value:function(t,e){var n=this.a,i=this.b,r=this.c,o=this.d,a=this.e,s=this.f,l=n*o-i*r,h=o/l,u=-i/l,c=-r/l,d=n/l,f=(r*s-o*a)/l,p=-(n*s-i*a)/l,g=t.x,v=t.y;e.x=g*h+v*c+f,e.y=g*u+v*d+p}},{key:"onlyTranslate",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return this.a===t&&0===this.b&&0===this.c&&this.d===t}},{key:"clone",value:function(){return new t(this.a,this.b,this.c,this.d,this.e,this.f)}},{key:"toTransformAttrs",value:function(){var t=this.a,e=this.b,n=this.c,i=this.d,r=t*i-e*n,o={x:this.e,y:this.f,rotateDeg:0,scaleX:0,scaleY:0,skewX:0,skewY:0};if(0!==t||0!==e){var a=Math.sqrt(t*t+e*e);o.rotateDeg=e>0?Math.acos(t/a):-Math.acos(t/a),o.scaleX=a,o.scaleY=r/a,o.skewX=(t*n+e*i)/r,o.skewY=0}else if(0!==n||0!==i){var s=Math.sqrt(n*n+i*i);o.rotateDeg=Math.PI/2-(i>0?Math.acos(-n/s):-Math.acos(n/s)),o.scaleX=r/s,o.scaleY=s,o.skewX=0,o.skewY=(t*n+e*i)/r}return o.rotateDeg=180*o.rotateDeg/Math.PI,o}}]),t}();function bo(t,e,n){var i,r,o,a;return!(t&&e&&(n?(so=t.x1,lo=t.x2,ho=t.y1,uo=t.y2,co=e.x1,fo=e.x2,po=e.y1,go=e.y2,so>lo&&(i=[lo,so],so=i[0],lo=i[1]),ho>uo&&(r=[uo,ho],ho=r[0],uo=r[1]),co>fo&&(o=[fo,co],co=o[0],fo=o[1]),po>go&&(a=[go,po],po=a[0],go=a[1]),so>fo||lo<co||ho>go||uo<po):t.x1>e.x2||t.x2<e.x1||t.y1>e.y2||t.y2<e.y1))}!function(t){t[t.NONE=0]="NONE",t[t.BBOX1=1]="BBOX1",t[t.BBOX2=2]="BBOX2"}(vo||(vo={}));var wo=function(t){var e=t.charCodeAt(0),n=2===t.length?t.charCodeAt(1):0,i=e;return 55296<=e&&e<=56319&&56320<=n&&n<=57343&&(i=(e&=1023)<<10|(n&=1023),i+=65536),12288===i||65281<=i&&i<=65376||65504<=i&&i<=65510?"F":8361===i||65377<=i&&i<=65470||65474<=i&&i<=65479||65482<=i&&i<=65487||65490<=i&&i<=65495||65498<=i&&i<=65500||65512<=i&&i<=65518?"H":4352<=i&&i<=4447||4515<=i&&i<=4519||4602<=i&&i<=4607||9001<=i&&i<=9002||11904<=i&&i<=11929||11931<=i&&i<=12019||12032<=i&&i<=12245||12272<=i&&i<=12283||12289<=i&&i<=12350||12353<=i&&i<=12438||12441<=i&&i<=12543||12549<=i&&i<=12589||12593<=i&&i<=12686||12688<=i&&i<=12730||12736<=i&&i<=12771||12784<=i&&i<=12830||12832<=i&&i<=12871||12880<=i&&i<=13054||13056<=i&&i<=19903||19968<=i&&i<=42124||42128<=i&&i<=42182||43360<=i&&i<=43388||44032<=i&&i<=55203||55216<=i&&i<=55238||55243<=i&&i<=55291||63744<=i&&i<=64255||65040<=i&&i<=65049||65072<=i&&i<=65106||65108<=i&&i<=65126||65128<=i&&i<=65131||110592<=i&&i<=110593||127488<=i&&i<=127490||127504<=i&&i<=127546||127552<=i&&i<=127560||127568<=i&&i<=127569||131072<=i&&i<=194367||177984<=i&&i<=196605||196608<=i&&i<=262141?"W":32<=i&&i<=126||162<=i&&i<=163||165<=i&&i<=166||172===i||175===i||10214<=i&&i<=10221||10629<=i&&i<=10630?"Na":161===i||164===i||167<=i&&i<=168||170===i||173<=i&&i<=174||176<=i&&i<=180||182<=i&&i<=186||188<=i&&i<=191||198===i||208===i||215<=i&&i<=216||222<=i&&i<=225||230===i||232<=i&&i<=234||236<=i&&i<=237||240===i||242<=i&&i<=243||247<=i&&i<=250||252===i||254===i||257===i||273===i||275===i||283===i||294<=i&&i<=295||299===i||305<=i&&i<=307||312===i||319<=i&&i<=322||324===i||328<=i&&i<=331||333===i||338<=i&&i<=339||358<=i&&i<=359||363===i||462===i||464===i||466===i||468===i||470===i||472===i||474===i||476===i||593===i||609===i||708===i||711===i||713<=i&&i<=715||717===i||720===i||728<=i&&i<=731||733===i||735===i||768<=i&&i<=879||913<=i&&i<=929||931<=i&&i<=937||945<=i&&i<=961||963<=i&&i<=969||1025===i||1040<=i&&i<=1103||1105===i||8208===i||8211<=i&&i<=8214||8216<=i&&i<=8217||8220<=i&&i<=8221||8224<=i&&i<=8226||8228<=i&&i<=8231||8240===i||8242<=i&&i<=8243||8245===i||8251===i||8254===i||8308===i||8319===i||8321<=i&&i<=8324||8364===i||8451===i||8453===i||8457===i||8467===i||8470===i||8481<=i&&i<=8482||8486===i||8491===i||8531<=i&&i<=8532||8539<=i&&i<=8542||8544<=i&&i<=8555||8560<=i&&i<=8569||8585===i||8592<=i&&i<=8601||8632<=i&&i<=8633||8658===i||8660===i||8679===i||8704===i||8706<=i&&i<=8707||8711<=i&&i<=8712||8715===i||8719===i||8721===i||8725===i||8730===i||8733<=i&&i<=8736||8739===i||8741===i||8743<=i&&i<=8748||8750===i||8756<=i&&i<=8759||8764<=i&&i<=8765||8776===i||8780===i||8786===i||8800<=i&&i<=8801||8804<=i&&i<=8807||8810<=i&&i<=8811||8814<=i&&i<=8815||8834<=i&&i<=8835||8838<=i&&i<=8839||8853===i||8857===i||8869===i||8895===i||8978===i||9312<=i&&i<=9449||9451<=i&&i<=9547||9552<=i&&i<=9587||9600<=i&&i<=9615||9618<=i&&i<=9621||9632<=i&&i<=9633||9635<=i&&i<=9641||9650<=i&&i<=9651||9654<=i&&i<=9655||9660<=i&&i<=9661||9664<=i&&i<=9665||9670<=i&&i<=9672||9675===i||9678<=i&&i<=9681||9698<=i&&i<=9701||9711===i||9733<=i&&i<=9734||9737===i||9742<=i&&i<=9743||9748<=i&&i<=9749||9756===i||9758===i||9792===i||9794===i||9824<=i&&i<=9825||9827<=i&&i<=9829||9831<=i&&i<=9834||9836<=i&&i<=9837||9839===i||9886<=i&&i<=9887||9918<=i&&i<=9919||9924<=i&&i<=9933||9935<=i&&i<=9953||9955===i||9960<=i&&i<=9983||10045===i||10071===i||10102<=i&&i<=10111||11093<=i&&i<=11097||12872<=i&&i<=12879||57344<=i&&i<=63743||65024<=i&&i<=65039||65533===i||127232<=i&&i<=127242||127248<=i&&i<=127277||127280<=i&&i<=127337||127344<=i&&i<=127386||917760<=i&&i<=917999||983040<=i&&i<=1048573||1048576<=i&&i<=1114109?"A":"N"};var Co=function(){function t(e,n){Qt(this,t),this._numberCharSize=null,this._fullCharSize=null,this._letterCharSize=null,this._specialCharSizeMap={},this._canvas=null,this._context=null,this._contextSaved=!1,this._notSupportCanvas=!1,this._notSupportCanopus=!1,this._userSpec={},this.specialCharSet="-/: .,@%'\"~",this._option=e,this._userSpec=null!=n?n:{},this.textSpec=this._initSpec(),br(e.specialCharSet)&&(this.specialCharSet=e.specialCharSet),this._standardMethod=br(e.getTextBounds)?this.fullMeasure.bind(this):this.measureWithNaiveCanvas.bind(this)}return Jt(t,[{key:"initContext",value:function(){if(this._notSupportCanvas)return!1;if(mr(this._canvas)&&(br(this._option.getCanvasForMeasure)&&(this._canvas=this._option.getCanvasForMeasure()),mr(this._canvas)&&br(globalThis.document)&&(this._canvas=globalThis.document.createElement("canvas"))),mr(this._context)&&br(this._canvas)){var t=this._canvas.getContext("2d");br(t)&&(t.save(),t.font=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.fontStyle,i=void 0===n?e.fontStyle:n,r=t.fontVariant,o=void 0===r?e.fontVariant:r,a=t.fontWeight,s=void 0===a?e.fontWeight:a,l=t.fontSize,h=void 0===l?e.fontSize:l,u=t.fontFamily;return(i?i+" ":"")+(o?o+" ":"")+(s?s+" ":"")+h+"px "+((void 0===u?e.fontFamily:u)||"sans-serif")}(this.textSpec),this._contextSaved=!0,this._context=t)}return!mr(this._context)||(this._notSupportCanvas=!0,!1)}},{key:"_initSpec",value:function(){var t,e,n,i=this._option.defaultFontParams,r=void 0===i?{}:i,o=this._userSpec,a=o.fontStyle,s=void 0===a?r.fontStyle:a,l=o.fontVariant,h=void 0===l?r.fontVariant:l,u=o.fontWeight,c=void 0===u?null!==(t=r.fontWeight)&&void 0!==t?t:"normal":u,d=o.fontSize,f=void 0===d?null!==(e=r.fontSize)&&void 0!==e?e:12:d,p=o.fontFamily,g=void 0===p?null!==(n=r.fontFamily)&&void 0!==n?n:"sans-serif":p,v=o.align,y=o.textAlign,m=void 0===y?null!=v?v:"center":y,b=o.baseline,w=o.textBaseline,C=void 0===w?null!=b?b:"middle":w,x=o.ellipsis,_=o.limit,S=o.lineHeight;return{fontStyle:s,fontVariant:h,fontFamily:g,fontSize:f,fontWeight:c,textAlign:m,textBaseline:C,ellipsis:x,limit:_,lineHeight:void 0===S?f:S}}},{key:"measure",value:function(t,e){switch(e){case"canopus":return this.fullMeasure(t);case"canvas":return this.measureWithNaiveCanvas(t);case"simple":return this.quickMeasureWithoutCanvas(t);default:return this.quickMeasure(t)}}},{key:"fullMeasure",value:function(t){if(mr(t))return{width:0,height:0};if(mr(this._option.getTextBounds)||!this._notSupportCanopus)return this.measureWithNaiveCanvas(t);var e,n=this.textSpec,i=n.fontFamily,r=n.fontSize,o=n.fontWeight,a=n.textAlign,s=n.textBaseline,l=n.ellipsis,h=n.limit,u=n.lineHeight;try{var c=this._option.getTextBounds({text:t,fontFamily:i,fontSize:r,fontWeight:o,textAlign:a,textBaseline:s,ellipsis:!!l,maxLineWidth:h||1/0,lineHeight:u});e={width:c.width(),height:c.height()}}catch(n){this._notSupportCanopus=!0,e=this.measureWithNaiveCanvas(t)}return e}},{key:"measureWithNaiveCanvas",value:function(t){return this._measureReduce(t,this._measureWithNaiveCanvas.bind(this))}},{key:"_measureWithNaiveCanvas",value:function(t){if(!this.initContext())return this._quickMeasureWithoutCanvas(t);var e=this._context.measureText(t),n=this.textSpec,i=n.fontSize,r=n.lineHeight;return{width:e.width,height:null!=r?r:i}}},{key:"quickMeasure",value:function(t){return this._measureReduce(t,this._quickMeasure.bind(this))}},{key:"_quickMeasure",value:function(e){for(var n={width:0,height:0},i=0;i<e.length;i++){var r=e[i],o=this._measureSpecialChar(r);mr(o)&&t.NUMBERS_CHAR_SET.includes(r)&&(o=this._measureNumberChar()),mr(o)&&["F","W"].includes(wo(r))&&(o=this._measureFullSizeChar()),mr(o)&&(o=this._measureLetterChar()),n.width+=o.width,n.height=Math.max(n.height,o.height)}return n}},{key:"quickMeasureWithoutCanvas",value:function(t){return this._measureReduce(t,this._quickMeasureWithoutCanvas.bind(this))}},{key:"_quickMeasureWithoutCanvas",value:function(t){for(var e={width:0,height:0},n=this.textSpec,i=n.fontSize,r=n.lineHeight,o=0;o<t.length;o++){var a=t[o],s=["F","W"].includes(wo(a))?1:.53;e.width+=s*i}return e.height=null!=r?r:i,e}},{key:"_measureReduce",value:function(t,e){var n=this.textSpec,i=n.fontSize,r=n.lineHeight,o={width:0,height:0};if(mr(t))return o;if(Sr(t)){var a=t.filter(br).map((function(t){return t.toString()}));return 0===a.length?o:1===a.length?e(a[0]):{width:a.reduce((function(t,n){return Math.max(t,e(n).width)}),0),height:a.length*((null!=r?r:i)+1)+1}}return e(t.toString())}},{key:"_measureNumberChar",value:function(){if(mr(this._numberCharSize)){var e=this._standardMethod(t.NUMBERS_CHAR_SET);this._numberCharSize={width:e.width/t.NUMBERS_CHAR_SET.length,height:e.height}}return this._numberCharSize}},{key:"_measureFullSizeChar",value:function(){return mr(this._fullCharSize)&&(this._fullCharSize=this._standardMethod(t.FULL_SIZE_CHAR)),this._fullCharSize}},{key:"_measureLetterChar",value:function(){if(mr(this._letterCharSize)){var e=this._standardMethod(t.ALPHABET_CHAR_SET);this._letterCharSize={width:e.width/t.ALPHABET_CHAR_SET.length,height:e.height}}return this._letterCharSize}},{key:"_measureSpecialChar",value:function(t){return br(this._specialCharSizeMap[t])?this._specialCharSizeMap[t]:this.specialCharSet.includes(t)?(this._specialCharSizeMap[t]=this._standardMethod(t),this._specialCharSizeMap[t]):null}},{key:"release",value:function(){br(this._canvas)&&(this._canvas=null),br(this._context)&&(this._contextSaved&&(this._context.restore(),this._contextSaved=!1),this._context=null)}}]),t}();function xo(t){if(Rr(t))return[t,t,t,t];if(Sr(t)){var e=t.length;if(1===e){var n=t[0];return[n,n,n,n]}if(2===e){var i=Vt(t,2),r=i[0],o=i[1];return[r,o,r,o]}if(3===e){var a=Vt(t,3),s=a[0],l=a[1];return[s,l,a[2],l]}if(4===e)return t}if(wr(t)){var h=t.top,u=void 0===h?0:h,c=t.right,d=void 0===c?0:c,f=t.bottom,p=void 0===f?0:f,g=t.left;return[u,d,p,void 0===g?0:g]}return[0,0,0,0]}Co.ALPHABET_CHAR_SET="abcdefghijklmnopqrstuvwxyz",Co.NUMBERS_CHAR_SET="0123456789",Co.FULL_SIZE_CHAR="字";var _o,So,ko,Ao,Ro,Bo,To,Mo,Po,Eo,Ho,Oo,Lo,Io,Do=Nr-1e-8,Wo=function(){function t(e){Qt(this,t),this.init(e)}return Jt(t,[{key:"init",value:function(t){this.bounds=t}},{key:"arc",value:function(t,e,n,i,r,o){if(Math.abs(r-i)>Do)return this.bounds.add(t-n,e-n),void this.bounds.add(t+n,e+n);var a,s,l,h,u=1/0,c=-1/0,d=1/0,f=-1/0;function p(t){l=n*Math.cos(t),h=n*Math.sin(t),l<u&&(u=l),l>c&&(c=l),h<d&&(d=h),h>f&&(f=h)}if(p(i),p(r),r!==i)if((i%=Nr)<0&&(i+=Nr),(r%=Nr)<0&&(r+=Nr),r<i&&(o=!o,a=i,i=r,r=a),o)for(r-=Nr,a=i-i%jr,s=0;s<4&&a>r;++s,a-=jr)p(a);else for(a=i-i%jr+jr,s=0;s<4&&a<r;++s,a+=jr)p(a);this.bounds.add(t+u,e+d),this.bounds.add(t+c,e+f)}},{key:"arcTo",value:function(t,e,n,i,r){throw new Error("不支持arcTo")}},{key:"bezierCurveTo",value:function(t,e,n,i,r,o){this.bounds.add(t,e),this.bounds.add(n,i),this.bounds.add(r,o)}},{key:"closePath",value:function(){}},{key:"ellipse",value:function(){throw new Error("不支持ellipse")}},{key:"lineTo",value:function(t,e){this.bounds.add(t,e)}},{key:"moveTo",value:function(t,e){this.bounds.add(t,e)}},{key:"quadraticCurveTo",value:function(t,e,n,i){this.bounds.add(t,e),this.bounds.add(n,i)}},{key:"rect",value:function(t,e,n,i){this.bounds.add(t,e),this.bounds.add(t+n,e+i)}},{key:"clear",value:function(){this.bounds.clear()}},{key:"release",value:function(){}}]),t}(),Fo=function(){function t(){Qt(this,t),this.curves=[],this.bounds=new ao}return Jt(t,[{key:"getCurveLengths",value:function(){return this.curves.map((function(t){return t.getLength()}))}},{key:"getPointAt",value:function(t){return{x:0,y:0}}},{key:"getLength",value:function(){return 0}},{key:"getBounds",value:function(){return this.bounds}}]),t}(),zo=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:[eE][-+]?\d+)?)/gi,jo={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},No={A:0,AT:1,C:2,Z:3,E:4,L:5,M:6,Q:7,R:8};function Go(t,e,n,i,r,o,a,s,l){var h=a*(Math.PI/180),u=Math.sin(h),c=Math.cos(h),d=c*(s-t)*.5+u*(l-e)*.5,f=c*(l-e)*.5-u*(s-t)*.5,p=d*d/((n=Math.abs(n))*n)+f*f/((i=Math.abs(i))*i);p>1&&(n*=p=Math.sqrt(p),i*=p);var g=c/n,v=u/n,y=-u/i,m=c/i,b=g*s+v*l,w=y*s+m*l,C=g*t+v*e,x=y*t+m*e,_=1/((C-b)*(C-b)+(x-w)*(x-w))-.25;_<0&&(_=0);var S=Math.sqrt(_);o===r&&(S=-S);var k=.5*(b+C)-S*(x-w),A=.5*(w+x)+S*(C-b),R=Math.atan2(w-A,b-k),B=Math.atan2(x-A,C-k)-R;B<0&&1===o?B+=Nr:B>0&&0===o&&(B-=Nr);for(var T=Math.ceil(Math.abs(B/(jr+.001))),M=[],P=0;P<T;++P){var E=R+P*B/T,H=R+(P+1)*B/T;M[P]=[k,A,E,H,n,i,u,c]}return M}function Uo(t,e,n,i){for(var r,o,a,s,l,h,u,c,d,f,p,g,v,y,m,b,w,C,x,_,S,k,A,R,B,T,M=Go(i[5],i[6],i[0],i[1],i[3],i[4],i[2],e,n),P=0;P<M.length;++P){var E=(r=M[P],o=void 0,a=void 0,s=void 0,l=void 0,h=void 0,u=void 0,c=void 0,d=void 0,f=void 0,p=void 0,g=void 0,v=void 0,y=void 0,m=void 0,b=void 0,w=void 0,C=void 0,x=void 0,_=void 0,S=void 0,k=void 0,A=void 0,R=void 0,B=void 0,T=void 0,o=r[0],a=r[1],s=r[2],l=r[3],h=r[4],u=r[5],c=r[6],d=r[7],f=d*h,p=-c*u,g=c*h,v=d*u,y=Math.cos(s),m=Math.sin(s),b=Math.cos(l),w=Math.sin(l),C=.5*(l-s),x=Math.sin(.5*C),_=8/3*x*x/Math.sin(C),[f*(S=o+y-_*m)+p*(k=a+m+_*y),g*S+v*k,f*(B=(A=o+b)+_*w)+p*(T=(R=a+w)-_*b),g*B+v*T,f*A+p*R,g*A+v*R]);t.bezierCurveTo(E[0],E[1],E[2],E[3],E[4],E[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=51]="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"}(To||(To={})),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"}(Mo||(Mo={})),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"}(Po||(Po={})),function(t){t[t.INITIAL=0]="INITIAL",t[t.RUNNING=1]="RUNNING",t[t.PAUSED=2]="PAUSED",t[t.END=3]="END"}(Eo||(Eo={})),function(t){t[t.NORMAL=0]="NORMAL",t[t.SET_ATTR_IMMEDIATELY=1]="SET_ATTR_IMMEDIATELY"}(Ho||(Ho={})),function(t){t.wait="wait",t.from="from",t.to="to",t.customAnimate="customAnimate"}(Oo||(Oo={})),function(t){t[t.ROW=1]="ROW",t[t.COLUMN=2]="COLUMN"}(Lo||(Lo={})),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"}(Io||(Io={}));var Ko=[function(t,e,n,i,r,o,a){return e.arc(t[1]*r+n,t[2]*o+i,t[3]*(r+o)/2,t[4],t[5],t[6],a)},function(t,e,n,i,r,o,a){return e.arcTo(t[1]*r+n,t[2]*o+i,t[3]*r+n,t[4]*o+i,t[5]*(r+o)/2,a)},function(t,e,n,i,r,o,a){return e.bezierCurveTo(t[1]*r+n,t[2]*o+i,t[3]*r+n,t[4]*o+i,t[5]*r+n,t[6]*o+i,a)},function(t,e,n,i){return e.closePath()},function(t,e,n,i,r,o){return e.ellipse(t[1]*r+n,t[2]*o+i,t[3]*r,t[4]*o,t[5],t[6],t[7],t[8])},function(t,e,n,i,r,o,a){return e.lineTo(t[1]*r+n,t[2]*o+i,a)},function(t,e,n,i,r,o,a){return e.moveTo(t[1]*r+n,t[2]*o+i,a)},function(t,e,n,i,r,o,a){return e.quadraticCurveTo(t[1]*r+n,t[2]*o+i,t[3]*r+n,t[4]*o+i,a)},function(t,e,n,i,r,o,a){return e.rect(t[1]*r+n,t[2]*o+i,t[3]*r,t[4]*o,a)}];function Vo(t,e){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1,a=arguments.length>6?arguments[6]:void 0,s=0;s<t.length;s++){var l=t[s];Ko[l[0]](l,e,n,i,r,o,a)}}function Yo(){return Yo="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var i=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=re(t)););return t}(t,e);if(i){var r=Object.getOwnPropertyDescriptor(i,e);return r.get?r.get.call(arguments.length<3?t:n):r.value}},Yo.apply(this,arguments)}var Xo=function(){function t(){Qt(this,t)}return Jt(t,[{key:"getLength",value:function(t){return null!=t?this.calcProjLength(t):(Number.isFinite(this.length)||(this.length=this.calcLength()),this.length)}}]),t}();function $o(t,e,n,i,r){return function(t,e){for(var n=0,i=t.length,r=0;r<i;r++){var o=t[r],a=e[r],s=t[(r+1)%i],l=e[(r+1)%i];n+=no.distanceNN(o,a,s,l)}return n/2}([t.x,e.x,n.x,i.x],[t.y,e.y,n.y,i.y])}function qo(t,e,n,i,r){var o=1-r;return o*o*o*t+3*e*r*o*o+3*n*r*r*o+i*r*r*r}function Zo(t,e,n,i,r){var o=qo(t.x,e.x,n.x,i.x,r),a=qo(t.y,e.y,n.y,i.y,r);return new eo(o,a)}function Jo(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=re(t);if(e){var r=re(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return ie(this,n)}}function Qo(t,e){var n=t.p0,i=t.p1,r=t.p2,o=t.p3,a=Zo(n,i,r,o,e),s=no.pointAtPP(n,i,e),l=no.pointAtPP(i,r,e),h=no.pointAtPP(r,o,e),u=no.pointAtPP(s,l,e),c=no.pointAtPP(l,h,e);return[new ta(n,s,u,a),new ta(a,c,h,o)]}var ta=function(t){ee(n,t);var e=Jo(n);function n(t,i,r,o){var a;return Qt(this,n),(a=e.call(this)).type=Io.CubicBezierCurve,a.p0=t,a.p1=i,a.p2=r,a.p3=o,a}return Jt(n,[{key:"_validPoint",value:function(){return Number.isFinite(this.p0.x+this.p0.y+this.p1.x+this.p1.y+this.p2.x+this.p2.y+this.p3.x+this.p3.y)}},{key:"getPointAt",value:function(t){if(!1!==this.defined)return Zo(this.p0,this.p1,this.p2,this.p3,t);throw new Error("defined为false的点不能getPointAt")}},{key:"calcLength",value:function(){return this._validPoint()?$o(this.p0,this.p1,this.p2,this.p3):60}},{key:"calcProjLength",value:function(t){return t===Lo.ROW?Ur(this.p0.x-this.p3.x):t===Lo.COLUMN?Ur(this.p0.y-this.p3.y):0}},{key:"getAngleAt",value:function(t){var e=Yr(t-.01,0),n=Xr(t+.01,1),i=this.getPointAt(e),r=this.getPointAt(n);return Kr(r.y-i.y,r.x-i.x)}}]),n}(Xo);function ea(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=re(t);if(e){var r=re(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return ie(this,n)}}function na(t,e){var n=t.p0,i=t.p1,r=no.pointAtPP(n,i,e);return[new ia(n,r),new ia(r,i)]}var ia=function(t){ee(n,t);var e=ea(n);function n(t,i){var r;return Qt(this,n),(r=e.call(this)).type=Io.LineCurve,r.p0=t,r.p1=i,r}return Jt(n,[{key:"getPointAt",value:function(t){if(!1!==this.defined)return no.pointAtPP(this.p0,this.p1,t);throw new Error("defined为false的点不能getPointAt")}},{key:"getAngleAt",value:function(t){return null==this.angle&&(this.angle=Kr(this.p1.y-this.p0.y,this.p1.x-this.p0.x)),this.angle}},{key:"_validPoint",value:function(){return Number.isFinite(this.p0.x+this.p0.y+this.p1.x+this.p1.y)}},{key:"calcLength",value:function(){return this._validPoint()?no.distancePP(this.p0,this.p1):60}},{key:"calcProjLength",value:function(t){return t===Lo.ROW?Ur(this.p0.x-this.p1.x):t===Lo.COLUMN?Ur(this.p0.y-this.p1.y):0}}]),n}(Xo);function ra(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=re(t);if(e){var r=re(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return ie(this,n)}}var oa=function(){function t(e,n){Qt(this,t),this.init(e,n)}return Jt(t,[{key:"endX",get:function(){return this._lastX}},{key:"endY",get:function(){return this._lastY}},{key:"init",value:function(t,e){this._lastX=this._lastY=this._startX=this._startY=0,this.curveType=t,this.direction=e,this.curves=[]}},{key:"bezierCurveTo",value:function(t,e,n,i,r,o,a){var s=new ta(new eo(this._lastX,this._lastY),new eo(t,e),new eo(n,i),new eo(r,o));s.defined=a,this.curves.push(s),this._lastX=r,this._lastY=o}},{key:"closePath",value:function(){if(!(this.curves.length<2)){var t=this.curves[this.curves.length-1];this.lineTo(this._startX,this._startY,t.defined)}}},{key:"ellipse",value:function(){throw new Error("SegContext不支持调用ellipse")}},{key:"lineTo",value:function(t,e,n){var i=this.addLinearCurve(t,e,n);this.curves.push(i),this._lastX=t,this._lastY=e}},{key:"moveTo",value:function(t,e){return this._lastX=this._startX=t,this._lastY=this._startY=e,this}},{key:"quadraticCurveTo",value:function(t,e,n,i){throw new Error("SegContext不支持调用quadraticCurveTo")}},{key:"clear",value:function(){this.curves=[],this.length=NaN}},{key:"tryUpdateLength",value:function(t){return this.getLength(t)}},{key:"addLinearCurve",value:function(t,e,n){var i=new ia(new eo(this._lastX,this._lastY),new eo(t,e));return i.defined=n,i}},{key:"getPointAt",value:function(t){throw new Error("暂未实现")}},{key:"getCurveLengths",value:function(){return[]}},{key:"getLength",value:function(t){if(t===Lo.COLUMN){if(!this.curves.length)return 0;var e=this.curves[0],n=this.curves[this.curves.length-1];return Ur(e.p0.y-n.p1.y)}if(t===Lo.ROW){if(!this.curves.length)return 0;var i=this.curves[0],r=this.curves[this.curves.length-1];return Ur(i.p0.x-r.p1.x)}return Number.isFinite(this.length)||(this.length=this.curves.reduce((function(t,e){return t+e.getLength()}),0)),this.length}}]),t}(),aa=function(t){ee(n,t);var e=ra(n);function n(){return Qt(this,n),e.apply(this,arguments)}return Jt(n,[{key:"bezierCurveTo",value:function(t,e,i,r,o,a,s){return Yo(re(n.prototype),"bezierCurveTo",this).call(this,e,t,r,i,a,o,s)}},{key:"lineTo",value:function(t,e,i){return Yo(re(n.prototype),"lineTo",this).call(this,e,t,i)}},{key:"moveTo",value:function(t,e){return Yo(re(n.prototype),"moveTo",this).call(this,e,t)}},{key:"clear",value:function(){return Yo(re(n.prototype),"clear",this).call(this)}}]),n}(oa);function sa(t,e){for(var n=!1,i=0,r=e.length;i<=r;i++)i>=r===n&&((n=!n)?t.lineStart():t.lineEnd()),n&&t.point(e[i])}var la=function(){function t(e,n){Qt(this,t),this.context=e,n&&(this.startPoint=n)}return Jt(t,[{key:"areaStart",value:function(){this._line=0}},{key:"areaEnd",value:function(){this._line=NaN}},{key:"lineStart",value:function(){this._point=0,this.startPoint&&this.point(this.startPoint)}},{key:"lineEnd",value:function(){(this._line||0!==this._line&&1===this._point)&&this.context.closePath(),this._line=1-this._line}},{key:"point",value:function(t){var e=t.x,n=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,n,!1!==this._lastDefined&&!1!==t.defined):this.context.moveTo(e,n);break;case 1:this._point=2;default:this.context.lineTo(e,n,!1!==this._lastDefined&&!1!==t.defined)}this._lastDefined=t.defined}},{key:"tryUpdateLength",value:function(){return this.context.tryUpdateLength()}}]),t}();function ha(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.direction,i=e.startPoint;if(t.length<2-Number(!!i))return null;var r=new oa("linear",null!=n?n:Ur(t[t.length-1].x-t[0].x)>Ur(t[t.length-1].y-t[0].y)?Lo.ROW:Lo.COLUMN);return function(t,e){sa(t,e)}(new la(r,i),t),r}function ua(t,e,n,i){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+n)/6,i)}var ca=function(){function t(e,n){Qt(this,t),this.context=e,this.startPoint=n}return Jt(t,[{key:"areaStart",value:function(){this._line=0}},{key:"areaEnd",value:function(){this._line=NaN}},{key:"lineStart",value:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0,this.startPoint&&this.point(this.startPoint)}},{key:"lineEnd",value:function(){2===this._point&&ua(this,6*this._x1-(this._x0+4*this._x1),6*this._y1-(this._y0+4*this._y1),!1!==this._lastDefined1&&!1!==this._lastDefined2),(this._line||0!==this._line&&1===this._point)&&this.context.closePath(),this._line=1-this._line}},{key:"point",value:function(t){var e=t.x,n=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,n,!1!==this._lastDefined1&&!1!==this._lastDefined2):this.context.moveTo(e,n);break;case 1:this._point=2;break;default:ua(this,e,n,!1!==this._lastDefined1&&!1!==this._lastDefined2)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=n,this._lastDefined1=this._lastDefined2,this._lastDefined2=t.defined}},{key:"tryUpdateLength",value:function(){return this.context.tryUpdateLength()}}]),t}();function da(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.direction,i=e.startPoint;if(t.length<2-Number(!!i))return null;if(t.length<3-Number(!!i))return ha(t,e);var r=new oa("basis",null!=n?n:Ur(t[t.length-1].x-t[0].x)>Ur(t[t.length-1].y-t[0].y)?Lo.ROW:Lo.COLUMN);return function(t,e){sa(t,e)}(new ca(r,i),t),r}function fa(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=re(t);if(e){var r=re(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return ie(this,n)}}function pa(t){return t<0?-1:1}function ga(t,e,n){var i=t._x1-t._x0,r=e-t._x1,o=(t._y1-t._y0)/(i||Number(r<0&&-0)),a=(n-t._y1)/(r||Number(i<0&&-0)),s=(o*r+a*i)/(i+r);return(pa(o)+pa(a))*Math.min(Math.abs(o),Math.abs(a),.5*Math.abs(s))||0}function va(t,e){var n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-e)/2:e}function ya(t,e,n,i){var r=t._x0,o=t._y0,a=t._x1,s=t._y1,l=(a-r)/3;t.context.bezierCurveTo(r+l,o+l*e,a-l,s-l*n,a,s,i)}var ma=function(){function t(e,n){Qt(this,t),this.context=e,this.startPoint=n}return Jt(t,[{key:"areaStart",value:function(){this._line=0}},{key:"areaEnd",value:function(){this._line=NaN}},{key:"lineStart",value:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0,this.startPoint&&this.point(this.startPoint)}},{key:"lineEnd",value:function(){switch(this._point){case 2:this.context.lineTo(this._x1,this._y1,!1!==this._lastDefined2);break;case 3:ya(this,this._t0,va(this,this._t0),!1!==this._lastDefined2)}(this._line||0!==this._line&&1===this._point)&&this.context.closePath(),this._line=1-this._line}},{key:"point",value:function(t){var e=NaN,n=t.x,i=t.y;if(n!==this._x1||i!==this._y1){switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(n,i,!1!==this._lastDefined1&&!1!==this._lastDefined2):this.context.moveTo(n,i);break;case 1:this._point=2;break;case 2:this._point=3,ya(this,va(this,e=ga(this,n,i)),e,!1!==this._lastDefined1&&!1!==this._lastDefined2);break;default:ya(this,this._t0,e=ga(this,n,i),!1!==this._lastDefined1&&!1!==this._lastDefined2)}this._x0=this._x1,this._x1=n,this._y0=this._y1,this._y1=i,this._t0=e,this._lastDefined1=this._lastDefined2,this._lastDefined2=!1!==t.defined}}},{key:"tryUpdateLength",value:function(){return this.context.tryUpdateLength()}}]),t}(),ba=function(t){ee(n,t);var e=fa(n);function n(t,i){return Qt(this,n),e.call(this,t,i)}return Jt(n,[{key:"point",value:function(t){return Yo(re(n.prototype),"point",this).call(this,{y:t.x,x:t.y,defined:t.defined})}}]),n}(ma);function wa(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.direction,i=e.startPoint;if(t.length<2-Number(!!i))return null;if(t.length<3-Number(!!i))return ha(t,e);var r=new oa("monotoneX",null!=n?n:Ur(t[t.length-1].x-t[0].x)>Ur(t[t.length-1].y-t[0].y)?Lo.ROW:Lo.COLUMN);return function(t,e){sa(t,e)}(new ma(r,i),t),r}function Ca(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.direction,i=e.startPoint;if(t.length<2-Number(!!i))return null;if(t.length<3-Number(!!i))return ha(t,e);var r=new aa("monotoneY",null!=n?n:Ur(t[t.length-1].x-t[0].x)>Ur(t[t.length-1].y-t[0].y)?Lo.ROW:Lo.COLUMN);return function(t,e){sa(t,e)}(new ba(r,i),t),r}var xa=function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.5,i=arguments.length>2?arguments[2]:void 0;Qt(this,t),this.context=e,this._t=n,this.startPoint=i}return Jt(t,[{key:"areaStart",value:function(){this._line=0}},{key:"areaEnd",value:function(){this._line=NaN}},{key:"lineStart",value:function(){this._x=this._y=NaN,this._point=0,this.startPoint&&this.point(this.startPoint)}},{key:"lineEnd",value:function(){0<this._t&&this._t<1&&2===this._point&&this.context.lineTo(this._x,this._y,!1!==this._lastDefined),(this._line||0!==this._line&&1===this._point)&&this.context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)}},{key:"point",value:function(t){var e=t.x,n=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,n,!1!==this._lastDefined&&!1!==t.defined):this.context.moveTo(e,n);break;case 1:this._point=2;default:if(this._t<=0)this.context.lineTo(this._x,n,!1!==this._lastDefined&&!1!==t.defined),this.context.lineTo(e,n,!1!==this._lastDefined&&!1!==t.defined);else{var i=this._x*(1-this._t)+e*this._t;this.context.lineTo(i,this._y,!1!==this._lastDefined&&!1!==t.defined),this.context.lineTo(i,n,!1!==this._lastDefined&&!1!==t.defined)}}this._lastDefined=t.defined,this._x=e,this._y=n}},{key:"tryUpdateLength",value:function(){return this.context.tryUpdateLength()}}]),t}();function _a(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=n.direction,r=n.startPoint;if(t.length<2-Number(!!r))return null;var o=new oa("step",null!=i?i:Ur(t[t.length-1].x-t[0].x)>Ur(t[t.length-1].y-t[0].y)?Lo.ROW:Lo.COLUMN);return function(t,e){sa(t,e)}(new xa(o,e,r),t),o}var Sa=function(){function t(e,n){Qt(this,t),this.context=e,n&&(this.startPoint=n)}return Jt(t,[{key:"areaStart",value:function(){this._line=0}},{key:"areaEnd",value:function(){this._line=NaN}},{key:"lineStart",value:function(){this._point=0,this.startPoint&&this.point(this.startPoint)}},{key:"lineEnd",value:function(){this.context.closePath()}},{key:"point",value:function(t){var e=t.x,n=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,n,!1!==this._lastDefined&&!1!==t.defined):this.context.moveTo(e,n);break;case 1:this._point=2;default:this.context.lineTo(e,n,!1!==this._lastDefined&&!1!==t.defined)}this._lastDefined=t.defined}},{key:"tryUpdateLength",value:function(){return this.context.tryUpdateLength()}}]),t}();function ka(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.direction,i=e.startPoint;if(t.length<2-Number(!!i))return null;var r=new oa("linear",null!=n?n:Ur(t[t.length-1].x-t[0].x)>Ur(t[t.length-1].y-t[0].y)?Lo.ROW:Lo.COLUMN);return function(t,e){sa(t,e)}(new Sa(r,i),t),r}function Aa(t,e,n){switch(e){case"linear":default:return ha(t,n);case"basis":return da(t,n);case"monotoneX":return wa(t,n);case"monotoneY":return Ca(t,n);case"step":return _a(t,.5,n);case"stepBefore":return _a(t,0,n);case"stepAfter":return _a(t,1,n);case"linearClosed":return ka(t,n)}}function Ra(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=re(t);if(e){var r=re(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return ie(this,n)}}var Ba=function(t){ee(n,t);var e=Ra(n);function n(t){var i;return Qt(this,n),(i=e.call(this)).commandList=[],t&&(i._ctx=t),i._boundsContext=new Wo(i.bounds),i}return Jt(n,[{key:"setCtx",value:function(t){this._ctx=t}},{key:"moveTo",value:function(t,e){return this.commandList.push([No.M,t,e]),this._ctx&&this._ctx.moveTo(t,e),this}},{key:"lineTo",value:function(t,e){return this.commandList.push([No.L,t,e]),this._ctx&&this._ctx.lineTo(t,e),this}},{key:"quadraticCurveTo",value:function(t,e,n,i){return this.commandList.push([No.Q,t,e,n,i]),this._ctx&&this._ctx.quadraticCurveTo(t,e,n,i),this}},{key:"bezierCurveTo",value:function(t,e,n,i,r,o){return this.commandList.push([No.C,t,e,n,i,r,o]),this._ctx&&this._ctx.bezierCurveTo(t,e,n,i,r,o),this}},{key:"arcTo",value:function(t,e,n,i,r){return this.commandList.push([No.AT,t,e,n,i,r]),this._ctx&&this._ctx.arcTo(t,e,n,i,r),this}},{key:"ellipse",value:function(t,e,n,i,r,o,a,s){return this.commandList.push([No.E,t,e,n,i,r,o,a,s]),this._ctx&&this._ctx.ellipse(t,e,n,i,r,o,a,s),this}},{key:"rect",value:function(t,e,n,i){return this.commandList.push([No.R,t,e,n,i]),this._ctx&&this._ctx.rect(t,e,n,i),this}},{key:"arc",value:function(t,e,n,i,r,o){return this.commandList.push([No.A,t,e,n,i,r,o]),this._ctx&&this._ctx.arc(t,e,n,i,r,o),this}},{key:"closePath",value:function(){return this.commandList.push([No.Z]),this._ctx&&this._ctx.closePath(),this}},{key:"addCurve",value:function(t){this.curves.push(t)}},{key:"clear",value:function(){this.transformCbList=null,this.commandList.length=0,this.curves.length=0}},{key:"toString",value:function(){if(!this.toStringCbList){var t=[];t[No.M]=function(t){return"M".concat(t[1]," ").concat(t[2])},t[No.L]=function(t){return"L".concat(t[1]," ").concat(t[2])},t[No.Q]=function(t){return"Q".concat(t[1]," ").concat(t[2]," ").concat(t[3]," ").concat(t[4])},t[No.C]=function(t){return"C".concat(t[1]," ").concat(t[2]," ").concat(t[3]," ").concat(t[4]," ").concat(t[5]," ").concat(t[6])},t[No.A]=function(t){var e,n,i,r,o,a,s,l,h,u,c,d,f,p,g,v,y,m,b,w,C=[];e=C,n=t[4],i=t[5],r=t[1],o=t[2],a=t[3],s=t[3],l=Math.abs(i-n),h=4*Math.tan(l/4)/3,u=i<n?-1:1,c=Math.cos(n),d=Math.sin(n),f=Math.cos(i),p=Math.sin(i),g=c*a+r,v=d*s+o,y=f*a+r,m=p*s+o,b=a*h*u,w=s*h*u,e.push(g-b*d,v+w*c,y+b*p,m-w*f,y,m);for(var x="",_=0;_<C.length;_+=6)x+="C".concat(C[_]," ").concat(C[_+1]," ").concat(C[_+2]," ").concat(C[_+3]," ").concat(C[_+4]," ").concat(C[_+5]);return x},t[No.Z]=function(t){return"Z"},this.toStringCbList=t}var e=this.toStringCbList,n="";return this.commandList.forEach((function(t){n+=e[t[0]](t)})),n}},{key:"fromString",value:function(t,e,n,i,r){this.clear();var o=function(t){if(!t)return[];var e,n,i=t.match(/[mzlhvcsqta][^mzlhvcsqta]*/gi);if(null===i)return[];for(var r=[],o=0,a=i.length;o<a;o++)if(_o=i[o],So=_o.slice(1),e=[ko=_o[0]],null!==(n=So.match(zo))){for(var s=0,l=n.length;s<l;s++)Ao=n[s],Ro=parseFloat(Ao),Number.isNaN(Ro)||e.push(Ro);if(Bo=jo[ko],e.length-1>Bo)for(var h=void 0,u=1,c=e.length;u<c;u+=Bo){h=[ko];for(var d=u,f=u+Bo;d<f;d++)h.push(e[d]);r.push(h)}else r.push(e)}else r.push(e);return r}(t);return this._runCommandStrList(o,e,n,i,r),this._updateBounds(),this}},{key:"fromLine",value:function(t){var e=t.attribute,n=e.points,i=e.curveType,r=e.clipRangeByDimension;if(n){var o=Aa(n,i);"x"===r?this.direction=Lo.ROW:"y"===r?this.direction=Lo.COLUMN:"auto"===r&&(this.direction=o.direction),this.curves=o.curves}}},{key:"fromCustomPath2D",value:function(t,e,n,i,r){return this.clear(),this._runCommandList(t.commandList,e,n,i,r),this._updateBounds(),this}},{key:"transform",value:function(t,e,n,i){var r=this,o=this.commandList;if(!this.transformCbList){var a=[];a[No.M]=this.moveToTransform,a[No.L]=this.lineToTransform,a[No.Q]=this.quadraticCurveToTransform,a[No.C]=this.bezierCurveToTransform,a[No.AT]=this.arcToTransform,a[No.E]=this.ellipseTransform,a[No.R]=this.rectTransform,a[No.A]=this.arcTransform,a[No.Z]=this.closePathTransform,this.transformCbList=a}o.forEach((function(o){r.transformCbList[o[0]](o,t,e,n,i)})),this._updateBounds()}},{key:"moveToTransform",value:function(t,e,n,i,r){t[1]=t[1]*i+e,t[2]=t[2]*r+n}},{key:"lineToTransform",value:function(t,e,n,i,r){t[1]=t[1]*i+e,t[2]=t[2]*r+n}},{key:"quadraticCurveToTransform",value:function(t,e,n,i,r){t[1]=t[1]*i+e,t[2]=t[2]*r+n,t[3]=t[3]*i+e,t[4]=t[4]*r+n}},{key:"bezierCurveToTransform",value:function(t,e,n,i,r){t[1]=t[1]*i+e,t[2]=t[2]*r+n,t[3]=t[3]*i+e,t[4]=t[4]*r+n,t[5]=t[5]*i+e,t[6]=t[6]*r+n}},{key:"arcToTransform",value:function(t,e,n,i,r){t[1]=t[1]*i+e,t[2]=t[2]*r+n,t[3]=t[3]*i+e,t[4]=t[4]*r+n,t[5]=t[5]*(i+r)/2}},{key:"ellipseTransform",value:function(t,e,n,i,r){t[1]=t[1]*i+e,t[2]=t[2]*r+n,t[3]=t[3]*i,t[4]=t[4]*r}},{key:"rectTransform",value:function(t,e,n,i,r){t[1]=t[1]*i+e,t[2]=t[2]*r+n,t[3]=t[3]*i,t[4]=t[4]*r}},{key:"arcTransform",value:function(t,e,n,i,r){t[1]=t[1]*i+e,t[2]=t[2]*r+n,t[3]=t[3]*(i+r)/2}},{key:"closePathTransform",value:function(){}},{key:"_runCommandStrList",value:function(t){for(var e,n,i,r,o,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,h=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,u=null,c=0,d=0,f=0,p=0,g=0,v=t.length;g<v;++g){switch(e=t[g],1===l&&1===h||(e=Ma(e,l,h)),e[0]){case"l":c+=e[1],d+=e[2],this.lineTo(c+a,d+s);break;case"L":c=e[1],d=e[2],this.lineTo(c+a,d+s);break;case"h":c+=e[1],this.lineTo(c+a,d+s);break;case"H":c=e[1],this.lineTo(c+a,d+s);break;case"v":d+=e[1],this.lineTo(c+a,d+s);break;case"V":d=e[1],this.lineTo(c+a,d+s);break;case"m":c+=e[1],d+=e[2],this.moveTo(c+a,d+s);break;case"M":c=e[1],d=e[2],this.moveTo(c+a,d+s);break;case"c":n=c+e[5],i=d+e[6],f=c+e[3],p=d+e[4],this.bezierCurveTo(c+e[1]+a,d+e[2]+s,f+a,p+s,n+a,i+s),c=n,d=i;break;case"C":c=e[5],d=e[6],f=e[3],p=e[4],this.bezierCurveTo(e[1]+a,e[2]+s,f+a,p+s,c+a,d+s);break;case"s":n=c+e[3],i=d+e[4],f=2*c-f,p=2*d-p,this.bezierCurveTo(f+a,p+s,c+e[1]+a,d+e[2]+s,n+a,i+s),f=c+e[1],p=d+e[2],c=n,d=i;break;case"S":n=e[3],i=e[4],f=2*c-f,p=2*d-p,this.bezierCurveTo(f+a,p+s,e[1]+a,e[2]+s,n+a,i+s),c=n,d=i,f=e[1],p=e[2];break;case"q":n=c+e[3],i=d+e[4],f=c+e[1],p=d+e[2],this.quadraticCurveTo(f+a,p+s,n+a,i+s),c=n,d=i;break;case"Q":n=e[3],i=e[4],this.quadraticCurveTo(e[1]+a,e[2]+s,n+a,i+s),c=n,d=i,f=e[1],p=e[2];break;case"t":n=c+e[1],i=d+e[2],null===u[0].match(/[QqTt]/)?(f=c,p=d):"t"===u[0]?(f=2*c-r,p=2*d-o):"q"===u[0]&&(f=2*c-f,p=2*d-p),r=f,o=p,this.quadraticCurveTo(f+a,p+s,n+a,i+s),d=i,f=(c=n)+e[1],p=d+e[2];break;case"T":n=e[1],i=e[2],f=2*c-f,p=2*d-p,this.quadraticCurveTo(f+a,p+s,n+a,i+s),c=n,d=i;break;case"a":Uo(this,c+a,d+s,[e[1],e[2],e[3],e[4],e[5],e[6]+c+a,e[7]+d+s]),c+=e[6],d+=e[7];break;case"A":Uo(this,c+a,d+s,[e[1],e[2],e[3],e[4],e[5],e[6]+a,e[7]+s]),c=e[6],d=e[7];break;case"z":case"Z":this.closePath()}u=e}}},{key:"_runCommandList",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1;if(0!==e||0!==n||1!==i||1!==r)for(var o=0,a=t.length;o<a;++o){var s=t[o].slice();switch(s[0]){case No.L:this.lineToTransform(s,e,n,i,r);break;case No.M:this.moveToTransform(s,e,n,i,r);break;case No.C:this.bezierCurveToTransform(s,e,n,i,r);break;case No.Q:this.quadraticCurveToTransform(s,e,n,i,r);break;case No.A:this.arcToTransform(s,e,n,i,r);break;case No.E:this.ellipseTransform(s,e,n,i,r);break;case No.R:this.rectTransform(s,e,n,i,r);break;case No.AT:this.arcToTransform(s,e,n,i,r);break;case No.Z:this.closePath()}}else this.commandList=t.map((function(t){return t.slice()}))}},{key:"_updateBounds",value:function(){this.bounds.clear(),Vo(this.commandList,this._boundsContext)}},{key:"release",value:function(){this.commandList=[],this._boundsContext=null,this._ctx=null}},{key:"getLength",value:function(){if(this.direction===Lo.COLUMN){if(!this.curves.length)return 0;var t=this.curves[0],e=this.curves[this.curves.length-1];return Ur(t.p0.y-e.p1.y)}if(this.direction===Lo.ROW){if(!this.curves.length)return 0;var n=this.curves[0],i=this.curves[this.curves.length-1];return Ur(n.p0.x-i.p1.x)}return this.curves.reduce((function(t,e){return t+e.getLength()}),0)}},{key:"getAttrAt",value:function(t){if(!this.curves)return{pos:{x:0,y:0},angle:0};for(var e,n=0,i=0;i<this.curves.length;i++){var r=(e=this.curves[i]).getLength(this.direction);if(n+r>=t)break;n+=r}var o=(t-n)/e.getLength(this.direction);return{pos:e.getPointAt(o),angle:e.getAngleAt(o)}}}]),n}(Fo),Ta=["l",0,0,0,0,0,0,0];function Ma(t,e,n){var i=Ta[0]=t[0];if("a"===i||"A"===i)Ta[1]=e*t[1],Ta[2]=n*t[2],Ta[3]=t[3],Ta[4]=t[4],Ta[5]=t[5],Ta[6]=e*t[6],Ta[7]=n*t[7];else if("h"===i||"H"===i)Ta[1]=e*t[1];else if("v"===i||"V"===i)Ta[1]=n*t[1];else for(var r=1,o=t.length;r<o;++r)Ta[r]=(r%2==1?e:n)*t[r];return Ta}var Pa={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,anchor:[0,0],anchor3d:[0,0],postMatrix:new mo},Ea={fillOpacity:1,fill:!1,shadowBlur:0,shadowColor:"black",shadowOffsetX:0,shadowOffsetY:0},Ha={strokeOpacity:1,lineDash:[],lineDashOffset:0,lineWidth:1,lineCap:"butt",lineJoin:"miter",miterLimit:10,strokeBoundsBuffer:2,stroke:!1},Oa=Object.assign({outerBorder:Object.assign(Object.assign({},Ha),{distance:0}),innerBorder:Object.assign(Object.assign({},Ha),{distance:0})},Ha),La={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},Ia=Object.assign(Object.assign({opacity:1,background:null,texture:null,textureColor:"black",textureSize:10,texturePadding:2,backgroundMode:0,blur:0,cursor:null},Ea),Oa),Da=Object.assign(Object.assign({strokeSeg:null,pickable:!0,childrenPickable:!0,visible:!0,zIndex:0,layout:null,boundsPadding:0,pickMode:"accurate",customPickShape:null,boundsMode:"accurate",keepDirIn3d:!0},Ia),Pa),Wa=Object.assign(Object.assign({},Da),{startAngle:0,endAngle:Gr,innerRadius:0,outerRadius:1,cornerRadius:0,padRadius:0,padAngle:0,cap:!1,forceShowCap:!1}),Fa=Object.assign(Object.assign({},Da),{points:[],segments:[],curveType:"linear",clipRange:1}),za=Object.assign(Object.assign({},Da),{radius:1,startAngle:0,endAngle:Gr}),ja=Object.assign(Object.assign({},Da),{width:0,height:0,cornerRadius:0,path:[],clip:!1,visibleAll:!0}),Na=Object.assign(Object.assign({},Da),{path:"",width:0,height:0,cornerRadius:0,clip:!1}),Ga=Object.assign(Object.assign({},Da),{points:[],segments:[],curveType:"linear",clipRange:1,clipRangeByDimension:"default"}),Ua=Object.assign(Object.assign({},Da),{path:new Ba,customPath:function(){console.warn("空函数")}}),Ka=Object.assign(Object.assign({},Da),{points:[],cornerRadius:0}),Va=Object.assign(Object.assign({},Da),{width:0,height:0,cornerRadius:0}),Ya=Object.assign(Object.assign({},Da),{width:0,height:0,cornerRadius:0,length:0}),Xa=Object.assign(Object.assign({},Da),{symbolType:"circle",size:10,keepDirIn3d:!0}),$a=Object.assign(Object.assign(Object.assign({},Da),La),{strokeBoundsBuffer:0,keepDirIn3d:!0}),qa=Object.assign(Object.assign({},Da),{width:300,height:300,ellipsis:!0,wordBreak:"break-word",verticalDirection:"top",textAlign:"left",textBaseline:"top",layoutDirection:"horizontal",textConfig:[],maxHeight:void 0,maxWidth:void 0,singleLine:!1}),Za=Object.assign(Object.assign({repeatX:"stretch",repeatY:"stretch",image:"",width:0,height:0},Da),{fill:!0}),Ja=Object.assign(Object.assign({},Za),{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}),Qa=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},ts=function(){function t(){Qt(this,t)}return Jt(t,[{key:"configure",value:function(t,e){this.canvas=t.canvas,this.context=t.context,t.bindTextMeasure(this)}},{key:"measureTextWidth",value:function(t,e){return this.context?(this.context.setTextStyleWithoutAlignBaseline(e),this.context.measureText(t).width):this.estimate(t,e).width}},{key:"estimate",value:function(t,e){for(var n=e.fontSize,i=void 0===n?$a.fontSize:n,r=0,o=0,a=0;a<t.length;a++)t.charCodeAt(a)<128?r++:o++;return{width:~~(.8*r*i+o*i),height:i}}},{key:"measureTextPixelHeight",value:function(t,e){var n;if(!this.context)return null!==(n=e.fontSize)&&void 0!==n?n:La.fontSize;this.context.setTextStyleWithoutAlignBaseline(e);var i=this.context.measureText(t);return Math.abs(i.actualBoundingBoxAscent-i.actualBoundingBoxDescent)}},{key:"measureTextBoundHieght",value:function(t,e){var n;if(!this.context)return null!==(n=e.fontSize)&&void 0!==n?n:La.fontSize;this.context.setTextStyleWithoutAlignBaseline(e);var i=this.context.measureText(t);return Math.abs(i.fontBoundingBoxAscent-i.fontBoundingBoxDescent)}},{key:"measureText",value:function(t,e){return this.context?(this.context.setTextStyleWithoutAlignBaseline(e),this.context.measureText(t)):this.estimate(t,e)}},{key:"clipText",value:function(t,e,n){if(0===t.length)return{str:"",width:0};var i=this.measureTextWidth(t,e);return i<=n?{str:t,width:i}:(i=this.measureTextWidth(t[0],e))>n?{str:"",width:0}:this._clipText(t,e,n,0,t.length-1)}},{key:"_clipText",value:function(t,e,n,i,r){var o,a=Math.floor((i+r)/2),s=t.substring(0,a+1),l=this.measureTextWidth(s,e);if(l>n){if(s.length<=1)return{str:"",width:0};var h=t.substring(0,a);return(o=this.measureTextWidth(h,e))<=n?{str:h,width:o}:this._clipText(t,e,n,i,a)}if(l<n){if(a>=t.length-1)return{str:t,width:this.measureTextWidth(t,e)};var u=t.substring(0,a+2);return(o=this.measureTextWidth(u,e))>=n?{str:s,width:l}:this._clipText(t,e,n,a,r)}return{str:s,width:l}}},{key:"clipTextWithSuffix",value:function(t,e,n,i){if(""===i)return this.clipText(t,e,n);if(0===t.length)return{str:"",width:0};var r=this.measureTextWidth(t,e);if(r<=n)return{str:t,width:r};var o=this.measureTextWidth(i,e);if(o>n)return{str:"",width:0};n-=o;var a=this._clipText(t,e,n,0,t.length-1);return a.str+=i,a.width+=o,a}}]),t}();function es(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=re(t);if(e){var r=re(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return ie(this,n)}}ts=Qa([Zi()],ts);var ns=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},is=Symbol.for("TextMeasureContribution"),rs=function(t){ee(n,t);var e=es(n);function n(){return Qt(this,n),e.apply(this,arguments)}return Jt(n)}(ts);rs=ns([Zi()],rs);var os=new Ki,as=new(Jt((function t(){Qt(this,t)}))),ss=Symbol.for("CanvasFactory"),ls=Symbol.for("Context2dFactory");function hs(t){return os.getNamed(ss,as.global.env)(t)}var us=1e-4,cs=Math.sqrt(3),ds=1/3;function fs(t){return t>-Rs&&t<Rs}function ps(t){return t>Rs||t<-Rs}var gs=[0,0],vs=[0,0],ys=[0,0];function ms(t,e){return(t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1])}function bs(t,e,n,i){var r=1-i;return r*(r*t+2*i*e)+i*i*n}function ws(t,e,n,i,r){var o=1-r;return o*o*(o*t+3*r*e)+r*r*(r*i+3*o*n)}function Cs(t){return(t%=Gr)<0&&(t+=Gr),t}function xs(t,e,n,i,r,o){if(o>e&&o>i||o<e&&o<i)return 0;if(i===e)return 0;var a=(o-e)/(i-e),s=i<e?1:-1;1!==a&&0!==a||(s=i<e?.5:-.5);var l=a*(n-t)+t;return l===r?1/0:l>r?s:0}function _s(t,e,n,i,r,o,a,s,l){if(0===a)return!1;var h=a;return!(l>e+h&&l>i+h&&l>o+h||l<e-h&&l<i-h&&l<o-h||s>t+h&&s>n+h&&s>r+h||s<t-h&&s<n-h&&s<r-h)&&function(t,e,n,i,r,o,a,s,l){var h=0,u=.005,c=1/0;gs[0]=a,gs[1]=s;for(var d=0;d<1;d+=.05){vs[0]=bs(t,n,r,d),vs[1]=bs(e,i,o,d);var f=ms(gs,vs);f<c&&(h=d,c=f)}c=1/0;for(var p=0;p<32&&!(u<us);p++){var g=h-u,v=h+u;vs[0]=bs(t,n,r,g),vs[1]=bs(e,i,o,g);var y=ms(vs,gs);if(g>=0&&y<c)h=g,c=y;else{ys[0]=bs(t,n,r,v),ys[1]=bs(e,i,o,v);var m=ms(ys,gs);v<=1&&m<c?(h=v,c=m):u*=.5}}return l&&(l[0]=bs(t,n,r,h),l[1]=bs(e,i,o,h)),Math.sqrt(c)}(t,e,n,i,r,o,s,l,null)<=h/2}function Ss(t,e,n,i,r,o,a,s,l,h,u){if(0===l)return!1;var c=l;return!(u>e+c&&u>i+c&&u>o+c&&u>s+c||u<e-c&&u<i-c&&u<o-c&&u<s-c||h>t+c&&h>n+c&&h>r+c&&h>a+c||h<t-c&&h<n-c&&h<r-c&&h<a-c)&&function(t,e,n,i,r,o,a,s,l,h,u){var c,d,f,p,g=0,v=.005,y=1/0;gs[0]=l,gs[1]=h;for(var m=0;m<1;m+=.05)vs[0]=ws(t,n,r,a,m),vs[1]=ws(e,i,o,s,m),(f=ms(gs,vs))<y&&(g=m,y=f);y=1/0;for(var b=0;b<32&&!(v<us);b++)c=g-v,d=g+v,vs[0]=ws(t,n,r,a,c),vs[1]=ws(e,i,o,s,c),f=ms(vs,gs),c>=0&&f<y?(g=c,y=f):(ys[0]=ws(t,n,r,a,d),ys[1]=ws(e,i,o,s,d),p=ms(ys,gs),d<=1&&p<y?(g=d,y=p):v*=.5);return u&&(u[0]=ws(t,n,r,a,g),u[1]=ws(e,i,o,s,g)),Math.sqrt(y)}(t,e,n,i,r,o,a,s,h,u,null)<=c/2}function ks(t,e,n,i,r,o,a,s,l){if(0===a)return!1;var h=a;s-=t,l-=e;var u=Math.sqrt(s*s+l*l);if(u-h>n||u+h<n)return!1;if(Math.abs(i-r)%Gr<1e-4)return!0;if(o){var c=i;i=Cs(r),r=Cs(c)}else i=Cs(i),r=Cs(r);i>r&&(r+=Gr);var d=Math.atan2(l,s);return d<0&&(d+=Gr),d>=i&&d<=r||d+Gr>=i&&d+Gr<=r}function As(t,e,n,i,r,o,a){if(0===r)return!1;var s,l=r,h=r/2;if(a>e+h&&a>i+h||a<e-h&&a<i-h||o>t+h&&o>n+h||o<t-h&&o<n-h)return!1;if(t===n)return Math.abs(o-t)<=l/2;var u=(s=(e-i)/(t-n))*o-a+(t*i-n*e)/(t-n);return u*u/(s*s+1)<=l/2*l/2}var Rs=1e-4;function Bs(t,e,n,i,r){var o=6*n-12*e+6*t,a=9*e+3*i-3*t-9*n,s=3*e-3*t,l=0;if(fs(a)){if(ps(o)){var h=-s/o;h>=0&&h<=1&&(r[l++]=h)}}else{var u=o*o-4*a*s;if(fs(u))r[0]=-o/(2*a);else if(u>0){var c=Math.sqrt(u),d=(-o+c)/(2*a),f=(-o-c)/(2*a);d>=0&&d<=1&&(r[l++]=d),f>=0&&f<=1&&(r[l++]=f)}}return l}var Ts=[-1,-1,-1],Ms=[-1,-1];function Ps(t,e,n,i,r,o,a,s,l,h){if(h>e&&h>i&&h>o&&h>s||h<e&&h<i&&h<o&&h<s)return 0;var u=function(t,e,n,i,r,o){var a=i+3*(e-n)-t,s=3*(n-2*e+t),l=3*(e-t),h=t-r,u=s*s-3*a*l,c=s*l-9*a*h,d=l*l-3*s*h,f=0;if(fs(u)&&fs(c))if(fs(s))o[0]=0;else{var p=-l/s;p>=0&&p<=1&&(o[f++]=p)}else{var g=c*c-4*u*d;if(fs(g)){var v=c/u,y=-s/a+v,m=-v/2;y>=0&&y<=1&&(o[f++]=y),m>=0&&m<=1&&(o[f++]=m)}else if(g>0){var b=Math.sqrt(g),w=u*s+1.5*a*(-c+b),C=u*s+1.5*a*(-c-b),x=(-s-((w=w<0?-Math.pow(-w,ds):Math.pow(w,ds))+(C=C<0?-Math.pow(-C,ds):Math.pow(C,ds))))/(3*a);x>=0&&x<=1&&(o[f++]=x)}else{var _=(2*u*s-3*a*c)/(2*Math.sqrt(u*u*u)),S=Math.acos(_)/3,k=Math.sqrt(u),A=Math.cos(S),R=(-s-2*k*A)/(3*a),B=(-s+k*(A+cs*Math.sin(S)))/(3*a),T=(-s+k*(A-cs*Math.sin(S)))/(3*a);R>=0&&R<=1&&(o[f++]=R),B>=0&&B<=1&&(o[f++]=B),T>=0&&T<=1&&(o[f++]=T)}}return f}(e,i,o,s,h,Ts);if(0===u)return 0;for(var c,d=0,f=-1,p=0,g=0,v=0;v<u;v++){var y=Ts[v],m=0===y||1===y?.5:1;ws(t,n,r,a,y)<l||(f<0&&(f=Bs(e,i,o,s,Ms),Ms[1]<Ms[0]&&f>1&&(c=void 0,c=Ms[0],Ms[0]=Ms[1],Ms[1]=c),p=ws(e,i,o,s,Ms[0]),f>1&&(g=ws(e,i,o,s,Ms[1]))),2===f?y<Ms[0]?d+=p<e?m:-m:y<Ms[1]?d+=g<p?m:-m:d+=s<g?m:-m:y<Ms[0]?d+=p<e?m:-m:d+=s<p?m:-m)}return d}function Es(t,e,n,i,r,o,a,s){if(s>e&&s>i&&s>o||s<e&&s<i&&s<o)return 0;var l=function(t,e,n,i,r){var o=t-2*e+n,a=2*(e-t),s=t-i,l=0;if(fs(o)){if(ps(a)){var h=-s/a;h>=0&&h<=1&&(r[l++]=h)}}else{var u=a*a-4*o*s;if(fs(u)){var c=-a/(2*o);c>=0&&c<=1&&(r[l++]=c)}else if(u>0){var d=Math.sqrt(u),f=(-a+d)/(2*o),p=(-a-d)/(2*o);f>=0&&f<=1&&(r[l++]=f),p>=0&&p<=1&&(r[l++]=p)}}return l}(e,i,o,s,Ts);if(0===l)return 0;var h,u,c,d=0===(c=(h=e)+o-2*(u=i))?.5:(h-u)/c;if(d>=0&&d<=1){for(var f=0,p=bs(e,i,o,d),g=0;g<l;g++){var v=0===Ts[g]||1===Ts[g]?.5:1;bs(t,n,r,Ts[g])<a||(Ts[g]<d?f+=p<e?v:-v:f+=o<p?v:-v)}return f}var y=0===Ts[0]||1===Ts[0]?.5:1;return bs(t,n,r,Ts[0])<a?0:o<e?y:-y}function Hs(t,e,n,i,r,o,a,s){if((s-=e)>n||s<-n)return 0;var l=Math.sqrt(n*n-s*s);Ts[0]=-l,Ts[1]=l;var h=Math.abs(i-r);if(h<1e-4)return 0;if(h>=Gr-1e-4){i=0,r=Gr;var u=o?1:-1;return a>=Ts[0]+t&&a<=Ts[1]+t?u:0}if(i>r){var c=i;i=r,r=c}i<0&&(i+=Gr,r+=Gr);for(var d=0,f=0;f<2;f++){var p=Ts[f];if(p+t>a){var g=Math.atan2(s,p),v=o?1:-1;g<0&&(g=Gr+g),(g>=i&&g<=r||g+Gr>=i&&g+Gr<=r)&&(g>zr/2&&g<1.5*zr&&(v=-v),d+=v)}}return d}function Os(t){return Math.round(t/zr*1e8)/1e8%2*zr}function Ls(t,e){var n=Os(t[0]);n<0&&(n+=Gr);var i=n-t[0],r=t[1];r+=i,!e&&r-n>=Gr?r=n+Gr:e&&n-r>=Gr?r=n-Gr:!e&&n>r?r=n+(Gr-Os(n-r)):e&&n<r&&(r=n-(Gr-Os(r-n))),t[0]=n,t[1]=r}var Is=[0,0];function Ds(t,e,n,i,r){for(var o,a,s,l,h=t,u=t.length,c=0,d=0,f=0,p=0,g=0,v=0;v<u;v++){var y=h[v],m=0===v;y[0]===No.M&&v>1&&(n||(c+=xs(d,f,p,g,i,r))),m&&(p=d=y[1],g=f=y[2]);var b=y[0],w=y[1],C=y[2],x=y[3],_=y[4],S=y[5],k=y[6],A=_,R=S;Is[0]=A,Is[1]=R,Ls(Is,Boolean(y[6]));var B=A=Is[0],T=(R=Is[1])-A,M=!!(1-(y[6]?0:1)),P=(i-w)*x/x+w;switch(b){case No.M:d=p=w,f=g=C;break;case No.L:if(n){if(As(d,f,w,C,e,i,r))return!0}else c+=xs(d,f,w,C,i,r)||0;d=w,f=C;break;case No.C:if(n){if(Ss(d,f,w,C,x,_,S,k,e,i,r))return!0}else c+=Ps(d,f,w,C,x,_,S,k,i,r)||0;d=S,f=k;break;case No.Q:if(n){if(_s(d,f,w,C,x,_,e,i,r))return!0}else c+=Es(d,f,w,C,x,_,i,r)||0;d=x,f=_;break;case No.A:if(o=Math.cos(B)*x+w,a=Math.sin(B)*x+C,m?(p=o,g=a):c+=xs(d,f,o,a,i,r),n){if(ks(w,C,x,B,B+T,M,e,P,r))return!0}else c+=Hs(w,C,x,B,B+T,M,P,r);d=Math.cos(B+T)*x+w,f=Math.sin(B+T)*x+C;break;case No.R:if(o=(p=d=w)+x,a=(g=f=C)+_,n){if(As(p,g,o,g,e,i,r)||As(o,g,o,a,e,i,r)||As(o,a,p,a,e,i,r)||As(p,a,p,g,e,i,r))return!0}else c+=xs(o,g,o,a,i,r),c+=xs(p,a,p,g,i,r);break;case No.Z:if(n){if(As(d,f,p,g,e,i,r))return!0}else c+=xs(d,f,p,g,i,r);d=p,f=g}}return n||(s=f,l=g,Math.abs(s-l)<Rs)||(c+=xs(d,f,p,g,i,r)||0),0!==c}var Ws,Fs=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},zs=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},js=function(t,e){return function(n,i){e(n,i,t)}},Ns=function(){function t(e,n){var i=this;Qt(this,t),this.contributions=e,this.global=n,this.configured=!1,this.global.hooks.onSetEnv.tap("graphic-util",(function(t,e,n){i.configured=!1,i.configure(n,e)}))}return Jt(t,[{key:"textMeasure",get:function(){return this._textMeasure||this.configure(this.global,this.global.env),this._textMeasure}},{key:"configure",value:function(t,e){var n=this;if(!this.configured){var i=hs({nativeCanvas:t.createCanvas({width:100,height:100})});this.canvas=i,this.context=i.getContext("2d"),this.contributions.getContributions().forEach((function(t){t.configure(n,e)})),this.configured=!0}}},{key:"bindTextMeasure",value:function(t){this._textMeasure=t}},{key:"measureText",value:function(t,e){var n,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"native";this.configure(this.global,this.global.env);var r=this.global.measureTextMethod;this.global.measureTextMethod=i;var o={width:this._textMeasure.measureTextWidth(t,e),height:null!==(n=e.fontSize)&&void 0!==n?n:La.fontSize};return this.global.measureTextMethod=r,o}},{key:"createTextMeasureInstance",value:function(t,e,n){var i=this;return this.configure(this.global,this.global.env),new Co(Object.assign({defaultFontParams:{fontFamily:La.fontFamily,fontSize:La.fontSize},getCanvasForMeasure:n||function(){return i.canvas},getTextBounds:void 0,specialCharSet:"-/: .,@%'\"~"+Co.ALPHABET_CHAR_SET+Co.ALPHABET_CHAR_SET.toUpperCase()},null!=e?e:{}),t)}}]),t}();Ns=Fs([Zi(),js(0,tr(lr)),js(0,Ji(is)),js(1,tr(Ke)),zs("design:paramtypes",[Object,Object])],Ns),function(t){t[t.transform=0]="transform",t[t.matrix=1]="matrix"}(Ws||(Ws={}));var Gs=new mo,Us=function(){function t(){Qt(this,t),this.matrix=new mo}return Jt(t,[{key:"init",value:function(t){return this.mode=Ws.transform,this.originTransform=t,this.matrix.reset(),this}},{key:"fromMatrix",value:function(t,e){return this.mode=Ws.matrix,this.outSourceMatrix=t,this.outTargetMatrix=e,this}},{key:"scaleMatrix",value:function(t,e,n){var i=this.outSourceMatrix;if(Gs.setValue(i.a,i.b,i.c,i.d,i.e,i.f),this.outTargetMatrix.reset(),n){var r=n.x,o=n.y;this.outTargetMatrix.translate(r,o),this.outTargetMatrix.scale(t,e),this.outTargetMatrix.translate(-r,-o)}else this.outTargetMatrix.scale(t,e);return this.outTargetMatrix.multiply(Gs.a,Gs.b,Gs.c,Gs.d,Gs.e,Gs.f),this}},{key:"scale",value:function(t,e,n){return this.mode===Ws.matrix?this.scaleMatrix(t,e,n):this}},{key:"translateMatrix",value:function(t,e){var n=this.outSourceMatrix;return Gs.setValue(n.a,n.b,n.c,n.d,n.e,n.f),this.outTargetMatrix.reset(),this.outTargetMatrix.translate(t,e),this.outTargetMatrix.multiply(Gs.a,Gs.b,Gs.c,Gs.d,Gs.e,Gs.f),this}},{key:"translate",value:function(t,e){return this.mode===Ws.matrix?this.translateMatrix(t,e):this}},{key:"simplify",value:function(t){return this.mode===Ws.matrix?this.simplifyMatrix(t):this}},{key:"simplifyMatrix",value:function(t){return this}}]),t}();Us=Fs([Zi(),zs("design:paramtypes",[])],Us);var Ks={arc:Wa,area:Fa,circle:za,line:Ga,path:Ua,symbol:Xa,text:$a,rect:Va,rect3d:Ya,polygon:Ka,richtext:qa,richtextIcon:Ja,image:Za,group:ja,glyph:Na},Vs=Object.keys(Ks);function Ys(){return{arc:Object.assign({},Ks.arc),area:Object.assign({},Ks.area),circle:Object.assign({},Ks.circle),line:Object.assign({},Ks.line),path:Object.assign({},Ks.path),symbol:Object.assign({},Ks.symbol),text:Object.assign({},Ks.text),rect:Object.assign({},Ks.rect),rect3d:Object.assign({},Ks.rect3d),polygon:Object.assign({},Ks.polygon),richtext:Object.assign({},Ks.richtext),richtextIcon:Object.assign({},Ks.richtextIcon),image:Object.assign({},Ks.image),group:Object.assign({},Ks.group),glyph:Object.assign({},Ks.glyph)}}function Xs(t,e){e&&(!(arguments.length>2&&void 0!==arguments[2])||arguments[2]?Object.keys(e).forEach((function(n){t[n]?Object.assign(t[n],e[n]):t[n]=e[n]})):Object.keys(e).forEach((function(n){if(t[n]){var i=t[n],r=e[n];Object.keys(e[n]).forEach((function(t){void 0===i[t]&&(i[t]=r[t])}))}else t[n]=e[n]})))}var $s=new Array(60).fill(0).map((function(){return Ys()})),qs=function(){function t(){Qt(this,t),this._defaultTheme=$s.pop()||Ys(),this.combinedTheme=this._defaultTheme,this.dirty=!1}return Jt(t,[{key:"getTheme",value:function(t){if(!t)return this.combinedTheme;if(!this.dirty)return this.combinedTheme;var e={},n=this.getParentWithTheme(t);return n&&(e=n.theme),this.applyTheme(t,e),this.combinedTheme}},{key:"getParentWithTheme",value:function(t){for(;t.parent;)if((t=t.parent).theme)return t;return null}},{key:"applyTheme",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(this.dirty){var i=this.getParentWithTheme(t);if(i){var r=i.theme;(r.dirty||n)&&r.applyTheme(i,e,!0),this.userTheme?Xs(this.userTheme,r.userTheme,!1):this.userTheme=Pr(r.userTheme),Xs(e,r.userTheme)}this.userTheme?this.doCombine(e):(i?this.combinedTheme=i.theme.combinedTheme:(this.combinedTheme=this._defaultTheme,console.warn("未知错误,走到不应该走的区域里")),this.dirty=!1)}return this.combinedTheme}},{key:"doCombine",value:function(t){var e=this.userTheme,n=this._defaultTheme,i=this.combinedTheme,r=t.common||{},o=Object.assign(r,this.commonTheme);Vs.forEach((function(r){var a,s;e[r]||o||t[r]?i[r]=Object.assign({},n[r],null!=o?o:{},null!==(a=t[r])&&void 0!==a?a:{},null!==(s=e[r])&&void 0!==s?s:{}):i[r]=n[r]})),this.dirty=!1}},{key:"resetTheme",value:function(t,e){this.userTheme=t,this.dirty=!0,this.dirtyChildren(e)}},{key:"setTheme",value:function(t,e){var n=this.userTheme;n?Object.keys(t).forEach((function(e){n[e]?Object.assign(n[e],t[e]):n[e]=Object.assign({},t[e])})):n=t,t.common&&(this.commonTheme?Object.assign(this.commonTheme,t.common):this.commonTheme=t.common),this.userTheme=n,this.dirty=!0,this.dirtyChildren(e)}},{key:"dirtyChildren",value:function(t){var e=this;t.forEachChildren((function(t){t.isContainer&&(t.theme&&(t.theme.dirty=!0),e.dirtyChildren(t))}))}}]),t}(),Zs=new qs;function Js(t,e){return t.glyphHost?Js(t.glyphHost):e?(t.isContainer,e):function(t){var e;if(e=t.isContainer?t:t.parent,e){for(;e&&!e.theme;)e=e.parent;return e?(e.theme||e.createTheme(),e.theme.getTheme(e)):Zs.getTheme()}return null}(t)||Zs.getTheme()}function Qs(t,e,n){return(e=qt(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var tl={exports:{}},el={exports:{}};!function(t){function e(n){return t.exports=e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t.exports.__esModule=!0,t.exports.default=t.exports,e(n)}t.exports=e,t.exports.__esModule=!0,t.exports.default=t.exports}(el);var nl=el.exports;!function(t){var e=nl.default;function n(){
2
- /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
3
- t.exports=n=function(){return i},t.exports.__esModule=!0,t.exports.default=t.exports;var i={},r=Object.prototype,o=r.hasOwnProperty,a=Object.defineProperty||function(t,e,n){t[e]=n.value},s="function"==typeof Symbol?Symbol:{},l=s.iterator||"@@iterator",h=s.asyncIterator||"@@asyncIterator",u=s.toStringTag||"@@toStringTag";function c(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,n){return t[e]=n}}function d(t,e,n,i){var r=e&&e.prototype instanceof g?e:g,o=Object.create(r.prototype),s=new B(i||[]);return a(o,"_invoke",{value:S(t,n,s)}),o}function f(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}i.wrap=d;var p={};function g(){}function v(){}function y(){}var m={};c(m,l,(function(){return this}));var b=Object.getPrototypeOf,w=b&&b(b(T([])));w&&w!==r&&o.call(w,l)&&(m=w);var C=y.prototype=g.prototype=Object.create(m);function x(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function _(t,n){function i(r,a,s,l){var h=f(t[r],t,a);if("throw"!==h.type){var u=h.arg,c=u.value;return c&&"object"==e(c)&&o.call(c,"__await")?n.resolve(c.__await).then((function(t){i("next",t,s,l)}),(function(t){i("throw",t,s,l)})):n.resolve(c).then((function(t){u.value=t,s(u)}),(function(t){return i("throw",t,s,l)}))}l(h.arg)}var r;a(this,"_invoke",{value:function(t,e){function o(){return new n((function(n,r){i(t,e,n,r)}))}return r=r?r.then(o,o):o()}})}function S(t,e,n){var i="suspendedStart";return function(r,o){if("executing"===i)throw new Error("Generator is already running");if("completed"===i){if("throw"===r)throw o;return M()}for(n.method=r,n.arg=o;;){var a=n.delegate;if(a){var s=k(a,n);if(s){if(s===p)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===i)throw i="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i="executing";var l=f(t,e,n);if("normal"===l.type){if(i=n.done?"completed":"suspendedYield",l.arg===p)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(i="completed",n.method="throw",n.arg=l.arg)}}}function k(t,e){var n=e.method,i=t.iterator[n];if(void 0===i)return e.delegate=null,"throw"===n&&t.iterator.return&&(e.method="return",e.arg=void 0,k(t,e),"throw"===e.method)||"return"!==n&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+n+"' method")),p;var r=f(i,t.iterator,e.arg);if("throw"===r.type)return e.method="throw",e.arg=r.arg,e.delegate=null,p;var o=r.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,p):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,p)}function A(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function R(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function B(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(A,this),this.reset(!0)}function T(t){if(t){var e=t[l];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,i=function e(){for(;++n<t.length;)if(o.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:M}}function M(){return{value:void 0,done:!0}}return v.prototype=y,a(C,"constructor",{value:y,configurable:!0}),a(y,"constructor",{value:v,configurable:!0}),v.displayName=c(y,u,"GeneratorFunction"),i.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===v||"GeneratorFunction"===(e.displayName||e.name))},i.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,y):(t.__proto__=y,c(t,u,"GeneratorFunction")),t.prototype=Object.create(C),t},i.awrap=function(t){return{__await:t}},x(_.prototype),c(_.prototype,h,(function(){return this})),i.AsyncIterator=_,i.async=function(t,e,n,r,o){void 0===o&&(o=Promise);var a=new _(d(t,e,n,r),o);return i.isGeneratorFunction(e)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},x(C),c(C,u,"Generator"),c(C,l,(function(){return this})),c(C,"toString",(function(){return"[object Generator]"})),i.keys=function(t){var e=Object(t),n=[];for(var i in e)n.push(i);return n.reverse(),function t(){for(;n.length;){var i=n.pop();if(i in e)return t.value=i,t.done=!1,t}return t.done=!0,t}},i.values=T,B.prototype={constructor:B,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(R),!t)for(var e in this)"t"===e.charAt(0)&&o.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(n,i){return a.type="throw",a.arg=t,e.next=n,i&&(e.method="next",e.arg=void 0),!!i}for(var i=this.tryEntries.length-1;i>=0;--i){var r=this.tryEntries[i],a=r.completion;if("root"===r.tryLoc)return n("end");if(r.tryLoc<=this.prev){var s=o.call(r,"catchLoc"),l=o.call(r,"finallyLoc");if(s&&l){if(this.prev<r.catchLoc)return n(r.catchLoc,!0);if(this.prev<r.finallyLoc)return n(r.finallyLoc)}else if(s){if(this.prev<r.catchLoc)return n(r.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<r.finallyLoc)return n(r.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&o.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var r=i;break}}r&&("break"===t||"continue"===t)&&r.tryLoc<=e&&e<=r.finallyLoc&&(r=null);var a=r?r.completion:{};return a.type=t,a.arg=e,r?(this.method="next",this.next=r.finallyLoc,p):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),p},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),R(n),p}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var i=n.completion;if("throw"===i.type){var r=i.arg;R(n)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:T(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),p}},i}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}(tl);var il=(0,tl.exports)(),rl=il;try{regeneratorRuntime=il}catch(t){"object"===("undefined"==typeof globalThis?"undefined":Ht(globalThis))?globalThis.regeneratorRuntime=il:Function("r","regeneratorRuntime = r")(il)}var ol=At(rl),al=function(){function t(){Qt(this,t)}return Jt(t,null,[{key:"GenAutoIncrementId",value:function(){return t.auto_increment_id++}}]),t}();function sl(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=re(t);if(e){var r=re(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return ie(this,n)}}al.auto_increment_id=0;var ll=function(t,e,n,i){return new(n||(n=Promise))((function(r,o){function a(t){try{l(i.next(t))}catch(t){o(t)}}function s(t){try{l(i.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((i=i.apply(t,e||[])).next())}))},hl=function(t){ee(n,t);var e=sl(n);function n(){var t;return Qt(this,n),(t=e.call(this))._uid=al.GenAutoIncrementId(),t._firstChild=null,t._lastChild=null,t.parent=null,t._count=1,t}return Jt(n,[{key:"previousSibling",get:function(){return this._prev}},{key:"nextSibling",get:function(){return this._next}},{key:"children",get:function(){return this.getChildren()}},{key:"firstChild",get:function(){return this._firstChild}},{key:"lastChild",get:function(){return this._lastChild}},{key:"count",get:function(){return this._count}},{key:"childrenCount",get:function(){return this._idMap?this._idMap.size:0}},{key:"forEachChildren",value:function(t){if(arguments.length>1&&void 0!==arguments[1]&&arguments[1])for(var e=this._lastChild,n=0;e;){if(t(e,n++))return;e=e._prev}else for(var i=this._firstChild,r=0;i;){if(t(i,r++))return;i=i._next}}},{key:"forEachChildrenAsync",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return ll(this,void 0,void 0,ol.mark((function n(){var i,r,o,a,s,l;return ol.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!e){n.next=16;break}i=this._lastChild,r=0;case 2:if(!i){n.next=14;break}if(o=t(i,r++),n.t0=o.then,!n.t0){n.next=9;break}return n.next=8,o;case 8:o=n.sent;case 9:if(!o){n.next=11;break}return n.abrupt("return");case 11:i=i._prev;case 12:n.next=2;break;case 14:n.next=29;break;case 16:a=this._firstChild,s=0;case 17:if(!a){n.next=29;break}if(l=t(a,s++),n.t1=l.then,!n.t1){n.next=24;break}return n.next=23,l;case 23:l=n.sent;case 24:if(!l){n.next=26;break}return n.abrupt("return");case 26:a=a._next;case 27:n.next=17;break;case 29:case"end":return n.stop()}}),n,this)})))}},{key:"forEach",value:function(t){return this.forEachChildren(t)}},{key:"appendChild",value:function(t){if(this._uid===t._uid)return null;if(t.isAncestorsOf(this))throw new Error("【Node::appendChild】不能将父辈元素append为子元素");return t.parent&&t.parent.removeChild(t),t.parent=this,this._lastChild?(this._lastChild._next=t,t._prev=this._lastChild,this._lastChild=t):(this._firstChild=this._lastChild=t,t._prev=t._next=null),this._idMap||(this._idMap=new Map),this._idMap.set(t._uid,t),this.setCount(t.count),this._structEdit=!0,t}},{key:"appendChildArrHighPerformance",value:function(t){return console.error("暂不支持该函数"),t}},{key:"insertBefore",value:function(t,e){if(this._uid===t._uid)return null;if(t.isAncestorsOf(this))throw new Error("【Node::insertBefore】不能将父辈元素insert为子元素");return e.parent!==this?null:(t.parent&&t.parent.removeChild(t),t.parent=this,t._prev=e._prev,e._prev?e._prev._next=t:this._firstChild=t,e._prev=t,t._next=e,this._idMap||(this._idMap=new Map),this._idMap.set(t._uid,t),this._structEdit=!0,this.setCount(t.count),t)}},{key:"insertAfter",value:function(t,e){if(this._uid===t._uid)return null;if(t.isAncestorsOf(this))throw new Error("【Node::insertAfter】不能将父辈元素insert为子元素");return e.parent!==this?null:(t.parent&&t.parent.removeChild(t),t.parent=this,e._next?(e._next._prev=t,t._next=e._next):this._lastChild=t,e._next=t,t._prev=e,this._idMap||(this._idMap=new Map),this._idMap.set(t._uid,t),this._structEdit=!0,this.setCount(t.count),t)}},{key:"insertInto",value:function(t,e){if(e>=this.childrenCount)return this.appendChild(t);if(this._uid===t._uid)return null;if(t.isAncestorsOf(this))throw new Error("【Node::insertBefore】不能将父辈元素insert为子元素");if(t.parent&&t.parent.removeChild(t),t.parent=this,0===e)t._next=this._firstChild,this._firstChild&&(this._firstChild._prev=t),t._prev=null,this._firstChild=t;else{for(var n=this._firstChild,i=0;i<e;i++){if(!n)return null;i>0&&(n=n._next)}if(!n)return null;t._next=n._next,t._prev=n,n._next=t,t._next&&(t._next._prev=t)}return this._idMap||(this._idMap=new Map),this._idMap.set(t._uid,t),this._structEdit=!0,this.setCount(t.count),t}},{key:"insertIntoKeepIdx",value:function(t,e){if(this._nodeList||(this._nodeList=this.children),this._nodeList[e]){var n=this._nodeList[e];return this._nodeList.splice(e,0,t),this.insertBefore(t,n)}var i;this._nodeList[e]=t;for(var r=e-1;r>=0&&!(i=this._nodeList[r]);r--);return i?i._next?this.insertBefore(t,i._next):this.appendChild(t):this.insertInto(t,0)}},{key:"removeChild",value:function(t){if(!this._idMap)return null;if(!this._idMap.has(t._uid))return null;if(this._idMap.delete(t._uid),this._nodeList){var e=this._nodeList.findIndex((function(e){return e===t}));e>0&&this._nodeList.splice(e,1)}return t._prev?t._prev._next=t._next:this._firstChild=t._next,t._next?t._next._prev=t._prev:this._lastChild=t._prev,t.parent=null,t._prev=null,t._next=null,this._structEdit=!0,this.setCount(-t.count),t}},{key:"delete",value:function(){this.parent&&this.parent.removeChild(this)}},{key:"removeAllChild",value:function(){if(this._idMap){for(var t=this._firstChild;t;)t.parent=null,t._prev=null,t._next=null,t=t._next;this._firstChild=null,this._lastChild=null,this._idMap.clear(),this._structEdit=!0,this.setCount(1-this._count)}}},{key:"replaceChild",value:function(t,e){throw new Error("暂不支持")}},{key:"find",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=null;return this.forEachChildren((function(n,r){return!(n===e||!t(n,r)||(i=n,0))})),n&&this.forEachChildren((function(e){if(e.isContainer){var n=e.find(t,!0);if(n)return i=n,!0}return!1})),i}},{key:"findAll",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=[];return this.forEachChildren((function(n,r){n!==e&&t(n,r)&&i.push(n)})),n&&this.forEachChildren((function(e){if(e.isContainer){var n=e.findAll(t,!0);n.length&&(i=i.concat(n))}})),i}},{key:"getElementById",value:function(t){return this.find((function(e){return e.id===t}),!0)}},{key:"findChildById",value:function(t){return this.getElementById(t)}},{key:"findChildByUid",value:function(t){return this._idMap&&this._idMap.get(t)||null}},{key:"getElementsByName",value:function(t){return this.findAll((function(e){return e.name===t}),!0)}},{key:"findChildrenByName",value:function(t){return this.getElementsByName(t)}},{key:"getElementsByType",value:function(t){return this.findAll((function(e){return e.type===t}),!0)}},{key:"getChildByName",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.find((function(e){return e.name===t}),e)}},{key:"getChildAt",value:function(t){var e=this._firstChild;if(!e)return null;for(var n=0;n<t;n++){if(!e._next)return null;e=e._next}return e}},{key:"at",value:function(t){return this.getChildAt(t)}},{key:"containNode",value:function(t){if(!this._idMap)return!1;if(this._idMap.has(t._uid))return!0;for(var e=this._firstChild;e;){if(e.containNode(t))return!0;e=e._next}return!1}},{key:"getRootNode",value:function(){for(var t=this.parent;null==t?void 0:t.parent;)t=t.parent;return t||this}},{key:"hasChildNodes",value:function(){return null!==this._firstChild}},{key:"addChild",value:function(t){return this.appendChild(t)}},{key:"add",value:function(t){return this.appendChild(t)}},{key:"getChildren",value:function(){for(var t=[],e=this._firstChild;e;)t.push(e),e=e._next;return t}},{key:"isChildOf",value:function(t){return!!this.parent&&this.parent._uid===t._uid}},{key:"isParentOf",value:function(t){return t.isChildOf(this)}},{key:"isDescendantsOf",value:function(t){var e=this.parent;if(!e)return!1;do{if(e._uid===t._uid)return!0;e=e.parent}while(null!==e);return!1}},{key:"isAncestorsOf",value:function(t){return t.isDescendantsOf(this)}},{key:"getAncestor",value:function(t){throw new Error("暂不支持")}},{key:"setAllDescendantsProps",value:function(t,e){for(var n=this._firstChild;n;)n[t]=e,n.setAllDescendantsProps(t,e),n=n._next}},{key:"setCount",value:function(t){this._count+=t;var e=this.parent;if(e)do{e._count+=t,e=e.parent}while(null!==e)}},{key:"clone",value:function(){throw new Error("暂不支持")}},{key:"cloneTo",value:function(t){throw new Error("暂不支持")}},{key:"getParent",value:function(){return this.parent}},{key:"del",value:function(t){return this.removeChild(t)}},{key:"addEventListener",value:function(t,e,i){var r=vr(i,!0)&&i||wr(i)&&i.capture,o=wr(i)&&i.once,a=yr(e)?void 0:e;return t=r?"".concat(t,"capture"):t,e=yr(e)?e:e.handleEvent,o?Yo(re(n.prototype),"once",this).call(this,t,e,a):Yo(re(n.prototype),"on",this).call(this,t,e,a),this}},{key:"on",value:function(t,e,n){return this.addEventListener(t,e,n)}},{key:"removeEventListener",value:function(t,e,i){var r=vr(i,!0)&&i||wr(i)&&i.capture,o=yr(e)?void 0:e;t=r?"".concat(t,"capture"):t,e=yr(e)?e:e.handleEvent;var a=wr(i)&&i.once;return Yo(re(n.prototype),"off",this).call(this,t,e,o,a),this}},{key:"off",value:function(t,e,n){return this.removeEventListener(t,e,n)}},{key:"once",value:function(t,e,n){return wr(n)?(n.once=!0,this.addEventListener(t,e,n)):this.addEventListener(t,e,{once:!0})}},{key:"removeAllEventListeners",value:function(){return Yo(re(n.prototype),"removeAllListeners",this).call(this),this}},{key:"removeAllListeners",value:function(){return this.removeAllEventListeners()}},{key:"dispatchEvent",value:function(t){for(var e,i=arguments.length,r=new Array(i>1?i-1:0),o=1;o<i;o++)r[o-1]=arguments[o];return(e=Yo(re(n.prototype),"emit",this)).call.apply(e,[this,t.type,t].concat(r)),!t.defaultPrevented}},{key:"emit",value:function(t,e){return this.dispatchEvent(t,e)}},{key:"release",value:function(){this.removeAllListeners()}}]),n}(Bt),ul=function(){function t(e){Qt(this,t),this.bubbles=!0,this.cancelBubble=!0,this.cancelable=!1,this.composed=!1,this.defaultPrevented=!1,this.eventPhase=t.prototype.NONE,this.propagationStopped=!1,this.propagationImmediatelyStopped=!1,this.layer=new eo,this.page=new eo,this.canvas=new eo,this.viewport=new eo,this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,this.manager=e}return Jt(t,[{key:"layerX",get:function(){return this.layer.x}},{key:"layerY",get:function(){return this.layer.y}},{key:"pageX",get:function(){return this.page.x}},{key:"pageY",get:function(){return this.page.y}},{key:"x",get:function(){return this.canvas.x}},{key:"y",get:function(){return this.canvas.y}},{key:"canvasX",get:function(){return this.canvas.x}},{key:"canvasY",get:function(){return this.canvas.y}},{key:"viewX",get:function(){return this.viewport.x}},{key:"viewY",get:function(){return this.viewport.y}},{key:"composedPath",value:function(){return!this.manager||this.path&&this.path[this.path.length-1]===this.target||(this.path=this.target?this.manager.propagationPath(this.target):[]),this.path}},{key:"preventDefault",value:function(){this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault(),this.defaultPrevented=!0}},{key:"stopImmediatePropagation",value:function(){this.propagationImmediatelyStopped=!0}},{key:"stopPropagation",value:function(){this.propagationStopped=!0}},{key:"initEvent",value:function(){}},{key:"initUIEvent",value:function(){}},{key:"clone",value:function(){throw new Error("Method not implemented.")}}]),t}();function cl(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=re(t);if(e){var r=re(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return ie(this,n)}}var dl=function(t){ee(n,t);var e=cl(n);function n(){var t;return Qt(this,n),(t=e.apply(this,arguments)).client=new eo,t.movement=new eo,t.offset=new eo,t.global=new eo,t.screen=new eo,t}return Jt(n,[{key:"clientX",get:function(){return this.client.x}},{key:"clientY",get:function(){return this.client.y}},{key:"movementX",get:function(){return this.movement.x}},{key:"movementY",get:function(){return this.movement.y}},{key:"offsetX",get:function(){return this.offset.x}},{key:"offsetY",get:function(){return this.offset.y}},{key:"globalX",get:function(){return this.global.x}},{key:"globalY",get:function(){return this.global.y}},{key:"screenX",get:function(){return this.screen.x}},{key:"screenY",get:function(){return this.screen.y}},{key:"getModifierState",value:function(t){return"getModifierState"in this.nativeEvent&&this.nativeEvent.getModifierState(t)}},{key:"initMouseEvent",value:function(t,e,n,i,r,o,a,s,l,h,u,c,d,f,p){throw new Error("Method not implemented.")}}]),n}(ul);function fl(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=re(t);if(e){var r=re(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return ie(this,n)}}var pl=function(t){ee(n,t);var e=fl(n);function n(){var t;return Qt(this,n),(t=e.apply(this,arguments)).width=0,t.height=0,t.isPrimary=!1,t}return Jt(n,[{key:"getCoalescedEvents",value:function(){return"pointermove"===this.type||"mousemove"===this.type||"touchmove"===this.type?[this]:[]}},{key:"getPredictedEvents",value:function(){throw new Error("getPredictedEvents is not supported!")}},{key:"clone",value:function(){var t,e,i,r=new n(this.manager);return r.eventPhase=r.NONE,r.currentTarget=null,r.path=[],r.target=null,r.nativeEvent=this.nativeEvent,r.originalEvent=this.originalEvent,null===(t=this.manager)||void 0===t||t.copyPointerData(this,r),null===(e=this.manager)||void 0===e||e.copyMouseData(this,r),null===(i=this.manager)||void 0===i||i.copyData(this,r),r.target=this.target,r.path=this.composedPath().slice(),r.type=this.type,r}}]),n}(dl);function gl(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=re(t);if(e){var r=re(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return ie(this,n)}}var vl=function(t){ee(n,t);var e=gl(n);function n(){var t;return Qt(this,n),(t=e.apply(this,arguments)).DOM_DELTA_PIXEL=0,t.DOM_DELTA_LINE=1,t.DOM_DELTA_PAGE=2,t}return Jt(n,[{key:"clone",value:function(){var t,e,i,r=new n(this.manager);return r.eventPhase=r.NONE,r.currentTarget=null,r.path=[],r.target=null,r.nativeEvent=this.nativeEvent,r.originalEvent=this.originalEvent,null===(t=this.manager)||void 0===t||t.copyPointerData(this,r),null===(e=this.manager)||void 0===e||e.copyMouseData(this,r),null===(i=this.manager)||void 0===i||i.copyData(this,r),r.target=this.target,r.path=this.composedPath().slice(),r.type=this.type,r}}]),n}(dl);function yl(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=re(t);if(e){var r=re(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return ie(this,n)}}vl.DOM_DELTA_PIXEL=0,vl.DOM_DELTA_LINE=1,vl.DOM_DELTA_PAGE=2;var ml=function(t){ee(n,t);var e=yl(n);function n(t,i){var r;return Qt(this,n),(r=e.call(this)).type=t,r.detail=i,r}return Jt(n)}(ul),bl="object"==("undefined"==typeof performance?"undefined":Ht(performance))&&performance.now?performance:Date;function wl(t){return"mouse"===t||"pen"===t}var Cl,xl=function(){function t(e){var n=this;Qt(this,t),this.dispatch=new Bt,this.mappingState={trackingData:{}},this.eventPool=new Map,this.onPointerDown=function(t,e){if(t instanceof pl){var i=n.createPointerEvent(t,t.type,e);if(n.dispatchEvent(i,"pointerdown"),"touch"===i.pointerType)n.dispatchEvent(i,"touchstart");else if(wl(i.pointerType)){var r=2===i.button;n.dispatchEvent(i,r?"rightdown":"mousedown")}n.trackingData(t.pointerId).pressTargetsByButton[t.button]=i.composedPath(),n.freeEvent(i)}else console.warn("EventManager cannot map a non-pointer event as a pointer event")},this.onPointerMove=function(t,e){var i,r;if(t instanceof pl){var o=n.createPointerEvent(t,t.type,e),a=wl(o.pointerType),s=n.trackingData(t.pointerId),l=n.findMountedTarget(s.overTargets);if(s.overTargets&&l&&l!==n.rootTarget&&l!==o.target){var h="mousemove"===t.type?"mouseout":"pointerout",u=n.createPointerEvent(t,h,l||void 0);if(n.dispatchEvent(u,"pointerout"),a&&n.dispatchEvent(u,"mouseout"),!o.composedPath().includes(l)){var c=n.createPointerEvent(t,"pointerleave",l||void 0);for(c.eventPhase=c.AT_TARGET;c.target&&!o.composedPath().includes(c.target);)c.currentTarget=c.target,n.notifyTarget(c),a&&n.notifyTarget(c,"mouseleave"),c.target=c.target.parent;n.freeEvent(c)}n.freeEvent(u)}if(l!==o.target){var d="mousemove"===t.type?"mouseover":"pointerover",f=n.clonePointerEvent(o,d);n.dispatchEvent(f,"pointerover"),a&&n.dispatchEvent(f,"mouseover");for(var p=null==l?void 0:l.parent;p&&p!==n.rootTarget.parent&&p!==o.target;)p=p.parent;if(!p||p===n.rootTarget.parent){var g=n.clonePointerEvent(o,"pointerenter");for(g.eventPhase=g.AT_TARGET;g.target&&g.target!==l&&g.target!==n.rootTarget.parent;)g.currentTarget=g.target,n.notifyTarget(g),a&&n.notifyTarget(g,"mouseenter"),g.target=g.target.parent;n.freeEvent(g)}n.freeEvent(f)}n.dispatchEvent(o,"pointermove"),"touch"===o.pointerType&&n.dispatchEvent(o,"touchmove"),a&&(n.dispatchEvent(o,"mousemove"),n.cursor=(null===(r=null===(i=o.target)||void 0===i?void 0:i.attribute)||void 0===r?void 0:r.cursor)||n.rootTarget.getCursor()),s.overTargets=o.composedPath(),n.freeEvent(o)}else console.warn("EventManager cannot map a non-pointer event as a pointer event")},this.onPointerOver=function(t,e){var i,r;if(t instanceof pl){var o=n.trackingData(t.pointerId),a=n.createPointerEvent(t,t.type,e),s=wl(a.pointerType);n.dispatchEvent(a,"pointerover"),s&&n.dispatchEvent(a,"mouseover"),"mouse"===a.pointerType&&(n.cursor=(null===(r=null===(i=a.target)||void 0===i?void 0:i.attribute)||void 0===r?void 0:r.cursor)||n.rootTarget.getCursor());var l=n.clonePointerEvent(a,"pointerenter");for(l.eventPhase=l.AT_TARGET;l.target&&l.target!==n.rootTarget.parent;)l.currentTarget=l.target,n.notifyTarget(l),s&&n.notifyTarget(l,"mouseenter"),l.target=l.target.parent;o.overTargets=a.composedPath(),n.freeEvent(a),n.freeEvent(l)}else console.warn("EventManager cannot map a non-pointer event as a pointer event")},this.onPointerOut=function(t,e){if(t instanceof pl){var i=n.trackingData(t.pointerId);if(i.overTargets){var r=wl(t.pointerType),o=n.findMountedTarget(i.overTargets),a=n.createPointerEvent(t,"pointerout",o||void 0);n.dispatchEvent(a),r&&n.dispatchEvent(a,"mouseout");var s=n.createPointerEvent(t,"pointerleave",o||void 0);for(s.eventPhase=s.AT_TARGET;s.target&&s.target!==n.rootTarget.parent;)s.currentTarget=s.target,n.notifyTarget(s),r&&n.notifyTarget(s,"mouseleave"),s.target=s.target.parent;i.overTargets=[],n.freeEvent(a),n.freeEvent(s)}n.cursor=""}else console.warn("EventManager cannot map a non-pointer event as a pointer event")},this.onPointerUp=function(t,e){if(t instanceof pl){var i=bl.now(),r=n.createPointerEvent(t,t.type,e);if(n.dispatchEvent(r,"pointerup"),"touch"===r.pointerType)n.dispatchEvent(r,"touchend");else if(wl(r.pointerType)){var o=2===r.button;n.dispatchEvent(r,o?"rightup":"mouseup")}var a=n.trackingData(t.pointerId),s=n.findMountedTarget(a.pressTargetsByButton[t.button]),l=s;if(s&&!r.composedPath().includes(s)){for(var h=s;h&&!r.composedPath().includes(h);){if(r.currentTarget=h,n.notifyTarget(r,"pointerupoutside"),"touch"===r.pointerType)n.notifyTarget(r,"touchendoutside");else if(wl(r.pointerType)){var u=2===r.button;n.notifyTarget(r,u?"rightupoutside":"mouseupoutside")}h=h.parent}delete a.pressTargetsByButton[t.button],l=h}if(l){var c=n.clonePointerEvent(r,"click");c.target=l,c.path=[],a.clicksByButton[t.button]||(a.clicksByButton[t.button]={clickCount:0,target:c.target,timeStamp:i});var d=a.clicksByButton[t.button];d.target===c.target&&i-d.timeStamp<200?++d.clickCount:d.clickCount=1,d.target=c.target,d.timeStamp=i,c.detail=d.clickCount,wl(c.pointerType)?(n.dispatchEvent(c,"click"),2===d.clickCount&&n.dispatchEvent(c,"dblclick")):"touch"===c.pointerType&&n.dispatchEvent(c,"tap"),n.dispatchEvent(c,"pointertap"),n.freeEvent(c)}n.freeEvent(r)}else console.warn("EventManager cannot map a non-pointer event as a pointer event")},this.onPointerUpOutside=function(t,e){if(t instanceof pl){var i=n.trackingData(t.pointerId),r=n.findMountedTarget(i.pressTargetsByButton[t.button]),o=n.createPointerEvent(t,t.type,e);if(r){for(var a=r;a;)o.currentTarget=a,n.notifyTarget(o,"pointerupoutside"),"touch"===o.pointerType?n.notifyTarget(o,"touchendoutside"):wl(o.pointerType)&&n.notifyTarget(o,2===o.button?"rightupoutside":"mouseupoutside"),a=a.parent;delete i.pressTargetsByButton[t.button]}n.freeEvent(o)}else console.warn("EventManager cannot map a non-pointer event as a pointer event")},this.onWheel=function(t,e){if(t instanceof vl){var i=n.createWheelEvent(t,e);n.dispatchEvent(i),n.freeEvent(i)}else console.warn("EventManager cannot map a non-wheel event as a wheel event")},this.rootTarget=e,this.mappingTable={},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)}return Jt(t,[{key:"addEventMapping",value:function(t,e){this.mappingTable[t]||(this.mappingTable[t]=[]),this.mappingTable[t].push({fn:e,priority:0}),this.mappingTable[t].sort((function(t,e){return t.priority-e.priority}))}},{key:"dispatchEvent",value:function(t,e){t.propagationStopped=!1,t.propagationImmediatelyStopped=!1,this.propagate(t,e),this.dispatch.emit(e||t.type,t)}},{key:"mapEvent",value:function(t){var e;if(this.rootTarget){var n,i=this.mappingTable[t.type],r="".concat(t.canvasX,"-").concat(t.canvasY);if((null===(e=this._prePointTargetCache)||void 0===e?void 0:e[r])?n=this._prePointTargetCache[r]:(n=this.pickTarget(t.canvasX,t.canvasY),this._prePointTargetCache=Qs({},r,n)),i)for(var o=0,a=i.length;o<a;o++)i[o].fn(t,n);else console.warn("[EventManager]: Event mapping not defined for ".concat(t.type))}}},{key:"propagate",value:function(t,e){if(t.target){var n=t.composedPath();t.eventPhase=t.CAPTURING_PHASE;for(var i=0,r=n.length-1;i<r;i++)if(t.currentTarget=n[i],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return;if(t.eventPhase=t.AT_TARGET,t.currentTarget=t.target,this.notifyTarget(t,e),!t.propagationStopped&&!t.propagationImmediatelyStopped){t.eventPhase=t.BUBBLING_PHASE;for(var o=n.length-2;o>=0;o--)if(t.currentTarget=n[o],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return}}}},{key:"propagationPath",value:function(t){for(var e=[t],n=0;n<2048&&t!==this.rootTarget&&t.parent;n++){if(!t.parent)throw new Error("Cannot find propagation path to disconnected target");e.push(t.parent),t=t.parent}return e.reverse(),e}},{key:"notifyTarget",value:function(t,e){e=null!=e?e:t.type;var n=t.eventPhase===t.CAPTURING_PHASE||t.eventPhase===t.AT_TARGET?"".concat(e,"capture"):e;this.notifyListeners(t,n),t.eventPhase===t.AT_TARGET&&this.notifyListeners(t,e)}},{key:"findMountedTarget",value:function(t){if(!t)return null;for(var e=t[0],n=1;n<t.length&&t[n].parent===e;n++)e=t[n];return e}},{key:"createPointerEvent",value:function(t,e,n){var i=this.allocateEvent(pl);return this.copyPointerData(t,i),this.copyMouseData(t,i),this.copyData(t,i),i.nativeEvent=t.nativeEvent,i.originalEvent=t,i.target=n||this.pickTarget(i.global.x,i.global.y),"string"==typeof e&&(i.type=e),i}},{key:"createWheelEvent",value:function(t,e){var n=this.allocateEvent(vl);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(n.global.x,n.global.y),n}},{key:"clonePointerEvent",value:function(t,e){var n=this.allocateEvent(pl);return n.nativeEvent=t.nativeEvent,n.originalEvent=t.originalEvent,this.copyPointerData(t,n),this.copyMouseData(t,n),this.copyData(t,n),n.target=t.target,n.path=t.composedPath().slice(),n.type=null!=e?e:n.type,n}},{key:"copyWheelData",value:function(t,e){e.deltaMode=t.deltaMode,e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ}},{key:"copyPointerData",value:function(t,e){t instanceof pl&&e instanceof pl&&(e.pointerId=t.pointerId,e.width=t.width,e.height=t.height,e.isPrimary=t.isPrimary,e.pointerType=t.pointerType,e.pressure=t.pressure,e.tangentialPressure=t.tangentialPressure,e.tiltX=t.tiltX,e.tiltY=t.tiltY,e.twist=t.twist)}},{key:"copyMouseData",value:function(t,e){t instanceof dl&&e instanceof dl&&(e.altKey=t.altKey,e.button=t.button,e.buttons=t.buttons,e.client.copyFrom(t.client),e.ctrlKey=t.ctrlKey,e.shiftKey=t.shiftKey,e.metaKey=t.metaKey,e.movement.copyFrom(t.movement),e.canvas.copyFrom(t.canvas),e.screen.copyFrom(t.screen),e.global.copyFrom(t.global),e.offset.copyFrom(t.offset),e.viewport.copyFrom(t.viewport))}},{key:"copyData",value:function(t,e){e.isTrusted=t.isTrusted,e.srcElement=t.srcElement,e.timeStamp=bl.now(),e.type=t.type,e.detail=t.detail,e.view=t.view,e.which=t.which,e.layer.copyFrom(t.layer),e.page.copyFrom(t.page)}},{key:"trackingData",value:function(t){return this.mappingState.trackingData[t]||(this.mappingState.trackingData[t]={pressTargetsByButton:{},clicksByButton:{},overTarget:null}),this.mappingState.trackingData[t]}},{key:"allocateEvent",value:function(t){var e;this.eventPool.has(t)||this.eventPool.set(t,[]);var n=(null===(e=this.eventPool.get(t))||void 0===e?void 0:e.pop())||new t(this);return n.eventPhase=n.NONE,n.currentTarget=null,n.path=[],n.target=null,n}},{key:"freeEvent",value:function(t){var e;if(t.manager!==this)throw new Error("It is illegal to free an event not managed by this EventManager!");var n=t.constructor;this.eventPool.has(n)||this.eventPool.set(n,[]),null===(e=this.eventPool.get(n))||void 0===e||e.push(t)}},{key:"notifyListeners",value:function(t,e){var n=t.currentTarget._events[e];if(n)if("fn"in n)n.once&&t.currentTarget.removeEventListener(e,n.fn,{once:!0}),n.fn.call(n.context,t);else for(var i=0,r=n.length;i<r&&!t.propagationImmediatelyStopped;i++)n[i].once&&t.currentTarget.removeEventListener(e,n[i].fn,{once:!0}),n[i].fn.call(n[i].context,t);else this.emitDelegation(t,e)}},{key:"emitDelegation",value:function(t,e){var n=t.currentTarget._events["*"];if(n)if("fn"in n)n.fn.call(n.context,t,e);else for(var i=0,r=n.length;i<r&&!t.propagationImmediatelyStopped;i++)n[i].fn.call(n[i].context,t,e)}},{key:"pickTarget",value:function(t,e){var n=this.rootTarget.pick(t,e);return n&&n.graphic?n.graphic:n&&n.group?n.group:t>=0&&t<=Br(this.rootTarget,"width")&&e>=0&&e<=Br(this.rootTarget,"height")?this.rootTarget:null}}]),t}(),_l={pickable:!0,visible:!0,dispatchEvent:function(t){var e;if(!(t instanceof ul))throw new Error("DisplayObject cannot propagate events outside of the Federated Events API");return t.defaultPrevented=!1,t.path=[],t.target=this,null===(e=null==t?void 0:t.manager)||void 0===e||e.dispatchEvent(t),!t.defaultPrevented},emit:function(t,e){return this.dispatchEvent(new ml(t,e))}},Sl={touchstart:"pointerdown",touchend:"pointerup",touchendoutside:"pointerupoutside",touchmove:"pointermove",touchcancel:"pointercancel"},kl=function(){function t(e){var n=this;Qt(this,t),this.resolution=1,this.onPointerDown=function(t){if(!n.supportsTouchEvents||"touch"!==t.pointerType){var e=n.normalizeToPointerData(t);n.autoPreventDefault&&e[0].isNormalized&&(t.cancelable||!("cancelable"in t))&&t.preventDefault();for(var i=0,r=e.length;i<r;i++){var o=e[i],a=n.bootstrapEvent(n.rootPointerEvent,o);n.manager.mapEvent(a)}n.setCursor(n.manager.cursor)}},this.onPointerMove=function(t){if(!(n.supportsTouchEvents&&"touch"===t.pointerType||n.isEventOutsideOfTargetElement(t))){for(var e=n.normalizeToPointerData(t),i=0,r=e.length;i<r;i++){var o=n.bootstrapEvent(n.rootPointerEvent,e[i]);n.manager.mapEvent(o)}n.setCursor(n.manager.cursor)}},this.onPointerUp=function(t){if(!n.supportsTouchEvents||"touch"!==t.pointerType){for(var e=n.isEventOutsideOfTargetElement(t)?"outside":"",i=n.normalizeToPointerData(t),r=0,o=i.length;r<o;r++){var a=n.bootstrapEvent(n.rootPointerEvent,i[r]);a.type+=e,n.manager.mapEvent(a)}n.setCursor(n.manager.cursor)}},this.onPointerOverOut=function(t){if(!n.supportsTouchEvents||"touch"!==t.pointerType){for(var e=n.normalizeToPointerData(t),i=0,r=e.length;i<r;i++){var o=n.bootstrapEvent(n.rootPointerEvent,e[i]);n.manager.mapEvent(o)}n.setCursor(n.manager.cursor)}},this.onWheel=function(t){var e=n.normalizeWheelEvent(t);n.manager.mapEvent(e)};var i=e.targetElement,r=e.resolution,o=e.rootNode,a=e.global,s=e.viewport,l=e.autoPreventDefault,h=void 0!==l&&l;this.manager=new xl(o),this.globalObj=a,this.supportsPointerEvents=a.supportsPointerEvents,this.supportsTouchEvents=a.supportsTouchEvents,this.supportsMouseEvents=a.supportsMouseEvents,this.applyStyles=a.applyStyles,this.autoPreventDefault=h,this.eventsAdded=!1,this.viewport=s,this.rootPointerEvent=new pl,this.rootWheelEvent=new vl,this.cursorStyles={default:"inherit",pointer:"pointer"},this.resolution=r,this.setTargetElement(i)}return Jt(t,[{key:"release",value:function(){this.setTargetElement(null)}},{key:"setCursor",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default",e=this.applyStyles,n=this.domElement;if(this.currentCursor!==t){this.currentCursor=t;var i=this.cursorStyles[t];i?"string"==typeof i&&e?n.style.cursor=i:"function"==typeof i?i(t):"object"==Ht(i)&&e&&Object.assign(n.style,i):e&&_r(t)&&!Mr(this.cursorStyles,t)&&(n.style.cursor=t)}}},{key:"setTargetElement",value:function(t){this.removeEvents(),this.domElement=t,this.addEvents()}},{key:"addEvents",value:function(){if(!this.eventsAdded&&this.domElement){var t=this.globalObj,e=this.domElement;this.supportsPointerEvents?(t.getDocument()?(t.getDocument().addEventListener("pointermove",this.onPointerMove,!0),t.getDocument().addEventListener("pointerup",this.onPointerUp,!0)):(e.addEventListener("pointermove",this.onPointerMove,!0),e.addEventListener("pointerup",this.onPointerUp,!0)),e.addEventListener("pointerdown",this.onPointerDown,!0),e.addEventListener("pointerleave",this.onPointerOverOut,!0),e.addEventListener("pointerover",this.onPointerOverOut,!0)):(t.getDocument()?(t.getDocument().addEventListener("mousemove",this.onPointerMove,!0),t.getDocument().addEventListener("mouseup",this.onPointerUp,!0)):(e.addEventListener("mousemove",this.onPointerMove,!0),e.addEventListener("mouseup",this.onPointerUp,!0)),e.addEventListener("mousedown",this.onPointerDown,!0),e.addEventListener("mouseout",this.onPointerOverOut,!0),e.addEventListener("mouseover",this.onPointerOverOut,!0)),this.supportsTouchEvents&&(e.addEventListener("touchstart",this.onPointerDown,!0),e.addEventListener("touchend",this.onPointerUp,!0),e.addEventListener("touchmove",this.onPointerMove,!0)),e.addEventListener("wheel",this.onWheel,{passive:!0,capture:!0}),this.eventsAdded=!0}}},{key:"removeEvents",value:function(){if(this.eventsAdded&&this.domElement){var t=this.globalObj,e=this.domElement;this.supportsPointerEvents?(t.getDocument()?(t.getDocument().removeEventListener("pointermove",this.onPointerMove,!0),t.getDocument().removeEventListener("pointerup",this.onPointerUp,!0)):(e.removeEventListener("pointermove",this.onPointerMove,!0),e.removeEventListener("pointerup",this.onPointerUp,!0)),e.removeEventListener("pointerdown",this.onPointerDown,!0),e.removeEventListener("pointerleave",this.onPointerOverOut,!0),e.removeEventListener("pointerover",this.onPointerOverOut,!0)):(t.getDocument()?(t.getDocument().removeEventListener("mousemove",this.onPointerMove,!0),t.getDocument().removeEventListener("mouseup",this.onPointerUp,!0)):(e.removeEventListener("mousemove",this.onPointerMove,!0),e.removeEventListener("mouseup",this.onPointerUp,!0)),e.removeEventListener("mousedown",this.onPointerDown,!0),e.removeEventListener("mouseout",this.onPointerOverOut,!0),e.removeEventListener("mouseover",this.onPointerOverOut,!0)),this.supportsTouchEvents&&(e.removeEventListener("touchstart",this.onPointerDown,!0),e.removeEventListener("touchend",this.onPointerUp,!0),e.removeEventListener("touchmove",this.onPointerMove,!0)),e.removeEventListener("wheel",this.onWheel,!0),this.domElement=null,this.eventsAdded=!1}}},{key:"mapToViewportPoint",value:function(t){var e=this.viewport,n=t.x,i=t.y;return{x:n-e.x,y:i-e.y}}},{key:"mapToCanvasPoint",value:function(t){var e,n=null===(e=this.globalObj)||void 0===e?void 0:e.mapToCanvasPoint(t,this.domElement);if(n)return n;var i=t.clientX,r=t.clientY,o=this.domElement.getBoundingClientRect();return{x:i-o.left,y:r-o.top}}},{key:"normalizeToPointerData",value:function(t){var e=[];if(this.supportsTouchEvents&&t.changedTouches&&t.changedTouches.length)for(var n=0,i=t.changedTouches.length;n<i;n++){var r=t.changedTouches[n];xr(r.button)&&(r.button=0),xr(r.buttons)&&(r.buttons=1),xr(r.isPrimary)&&(r.isPrimary=1===t.touches.length&&"touchstart"===t.type),xr(r.width)&&(r.width=r.radiusX||1),xr(r.height)&&(r.height=r.radiusY||1),xr(r.tiltX)&&(r.tiltX=0),xr(r.tiltY)&&(r.tiltY=0),xr(r.pointerType)&&(r.pointerType="touch"),xr(r.pointerId)&&(r.pointerId=r.identifier||0),xr(r.pressure)&&(r.pressure=r.force||.5),xr(r.twist)&&(r.twist=0),xr(r.tangentialPressure)&&(r.tangentialPressure=0),xr(r.layerX)&&(r.layerX=r.offsetX=r.clientX),xr(r.layerY)&&(r.layerY=r.offsetY=r.clientY),r.isNormalized=!0,r.type=t.type,e.push(r)}else if(!this.globalObj.supportsMouseEvents||t instanceof MouseEvent&&!(this.supportsPointerEvents&&t instanceof PointerEvent)){var o=t;xr(o.isPrimary)&&(o.isPrimary=!0),xr(o.width)&&(o.width=1),xr(o.height)&&(o.height=1),xr(o.tiltX)&&(o.tiltX=0),xr(o.tiltY)&&(o.tiltY=0),xr(o.pointerType)&&(o.pointerType="mouse"),xr(o.pointerId)&&(o.pointerId=1),xr(o.pressure)&&(o.pressure=.5),xr(o.twist)&&(o.twist=0),xr(o.tangentialPressure)&&(o.tangentialPressure=0),o.isNormalized=!0,e.push(o)}else e.push(t);return e}},{key:"normalizeWheelEvent",value:function(t){var e=this.rootWheelEvent;this.transferMouseData(e,t),e.deltaMode=t.deltaMode,e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ;var n=this.mapToCanvasPoint(t),i=n.x,r=n.y;e.canvas.x=i,e.canvas.y=r,e.global.copyFrom(e.canvas),e.offset.copyFrom(e.canvas);var o=this.mapToViewportPoint(e),a=o.x,s=o.y;return e.viewport.x=a,e.viewport.y=s,e.nativeEvent=t,e.type=t.type,e}},{key:"bootstrapEvent",value:function(t,e){t.originalEvent=null,t.nativeEvent=e,t.pointerId=e.pointerId,t.width=e.width,t.height=e.height,t.isPrimary=e.isPrimary,t.pointerType=e.pointerType,t.pressure=e.pressure,t.tangentialPressure=e.tangentialPressure,t.tiltX=e.tiltX,t.tiltY=e.tiltY,t.twist=e.twist,this.transferMouseData(t,e);var n=this.mapToCanvasPoint(e),i=n.x,r=n.y;t.canvas.x=i,t.canvas.y=r,t.global.copyFrom(t.canvas),t.offset.copyFrom(t.canvas);var o=this.mapToViewportPoint(t),a=o.x,s=o.y;return t.viewport.x=a,t.viewport.y=s,t.isTrusted=e.isTrusted,"pointerleave"===t.type&&(t.type="pointerout"),t.type.startsWith("mouse")&&(t.type=t.type.replace("mouse","pointer")),t.type.startsWith("touch")&&(t.type=Sl[t.type]||t.type),t}},{key:"transferMouseData",value:function(t,e){t.isTrusted=e.isTrusted,t.srcElement=e.srcElement,t.timeStamp=bl.now(),t.type=e.type,t.altKey=e.altKey,t.button=e.button,t.buttons=e.buttons,t.client.x=e.clientX,t.client.y=e.clientY,t.ctrlKey=e.ctrlKey,t.shiftKey=e.shiftKey,t.metaKey=e.metaKey,t.movement.x=e.movementX,t.movement.y=e.movementY,t.page.x=e.pageX,t.page.y=e.pageY,t.relatedTarget=null}},{key:"isEventOutsideOfTargetElement",value:function(t){var e=t.target;return t.composedPath&&t.composedPath().length>0&&(e=t.composedPath()[0]),e!==(this.domElement.getNativeHandler?this.domElement.getNativeHandler().nativeCanvas:this.domElement)}}]),t}(),Al=function(){function t(){Qt(this,t),this.time=0}return Jt(t,[{key:"avaliable",value:function(){return t.Avaliable()}},{key:"tick",value:function(t,e){this.time=Math.max(0,t+this.time),e(this,{once:!0})}},{key:"tickTo",value:function(t,e){this.time=Math.max(0,t),e(this,{once:!0})}},{key:"release",value:function(){this.timerId>0&&(this.timerId=-1)}},{key:"getTime",value:function(){return this.time}}],[{key:"Avaliable",value:function(){return!0}}]),t}(),Rl=function(){function t(){Qt(this,t)}return Jt(t,[{key:"avaliable",value:function(){return t.Avaliable()}},{key:"tick",value:function(t,e){var n=this;this.timerId=setTimeout((function(){e(n)}),t)}},{key:"release",value:function(){this.timerId>0&&(clearTimeout(this.timerId),this.timerId=-1)}},{key:"getTime",value:function(){return Date.now()}}],[{key:"Avaliable",value:function(){return!0}}]),t}(),Bl=function(){function t(){Qt(this,t)}return Jt(t,[{key:"avaliable",value:function(){return t.Avaliable()}},{key:"tick",value:function(t,e){var n=this;as.global.getRequestAnimationFrame()((function(){n.released||e(n)}))}},{key:"release",value:function(){this.released=!0}},{key:"getTime",value:function(){return Date.now()}}],[{key:"Avaliable",value:function(){return!!as.global.getRequestAnimationFrame()}}]),t}();!function(t){t[t.INITIAL=0]="INITIAL",t[t.RUNNING=1]="RUNNING",t[t.PAUSE=2]="PAUSE"}(Cl||(Cl={}));var Tl=function(){function t(){var e=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];Qt(this,t),this.handleTick=function(t,n){var i=(null!=n?n:{}).once,r=void 0!==i&&i;e.ifCanStop()?e.stop():(e._handlerTick(t),r||t.tick(e.interval,e.handleTick))},this._handlerTick=function(t){var n=e.tickerHandler.getTime(),i=0;e.lastFrameTime>=0&&(i=n-e.lastFrameTime),e.lastFrameTime=n,e.status===Cl.RUNNING&&(e.tickCounts++,e.timelines.forEach((function(t){t.tick(i)})))},this.init(),this.lastFrameTime=-1,this.tickCounts=0,this.timelines=n,this.autoStop=!0}return Jt(t,[{key:"mode",get:function(){return this._mode},set:function(t){this._mode!==t&&(this._mode=t,this.setupTickHandler())}},{key:"init",value:function(){var t=this;this.interval=NaN,this.status=Cl.INITIAL,as.global.hooks.onSetEnv.tap("window",(function(){t.initHandler()})),as.global.env&&this.initHandler()}},{key:"addTimeline",value:function(t){this.timelines.push(t)}},{key:"remTimeline",value:function(t){this.timelines=this.timelines.filter((function(e){return e!==t}))}},{key:"initHandler",value:function(){if(this._mode)return null;for(var t=[{mode:"raf",cons:Bl},{mode:"timeout",cons:Rl},{mode:"manual",cons:Al}],e=0;e<t.length;e++)if(t[e].cons.Avaliable()){this.mode=t[e].mode;break}return null}},{key:"setupTickHandler",value:function(){var t;switch(this._mode){case"raf":t=new Bl;break;case"timeout":t=new Rl;break;case"manual":t=new Al;break;default:console.warn("非法的计时器模式"),t=new Bl}return!!t.avaliable()&&(this.tickerHandler&&this.tickerHandler.release(),this.tickerHandler=t,!0)}},{key:"setInterval",value:function(t){this.interval=t}},{key:"getInterval",value:function(){return this.interval}},{key:"setFPS",value:function(t){this.setInterval(1e3/t)}},{key:"getFPS",value:function(){return 1e3/this.interval}},{key:"tick",value:function(t){var e=this;this.tickerHandler.tick(t,(function(t){e.handleTick(t,{once:!0})}))}},{key:"tickTo",value:function(t){var e=this;this.tickerHandler.tickTo&&this.tickerHandler.tickTo(t,(function(t){e.handleTick(t,{once:!0})}))}},{key:"pause",value:function(){return this.status!==Cl.INITIAL&&(this.status=Cl.PAUSE,!0)}},{key:"resume",value:function(){return this.status!==Cl.INITIAL&&(this.status=Cl.RUNNING,!0)}},{key:"ifCanStop",value:function(){if(this.autoStop){if(!this.timelines.length)return!0;if(0===this.timelines.reduce((function(t,e){return t+e.animateCount}),0))return!0}return!1}},{key:"start",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.status===Cl.RUNNING)return!1;if(!this.tickerHandler)return!1;if(!t){if(this.status===Cl.PAUSE)return!1;if(!this.timelines.length)return!1;if(0===this.timelines.reduce((function(t,e){return t+e.animateCount}),0))return!1}return this.status=Cl.RUNNING,this.tickerHandler.tick(0,this.handleTick),!0}},{key:"stop",value:function(){this.status=Cl.INITIAL,this.setupTickHandler(),this.lastFrameTime=-1}}]),t}(),Ml=function(){function t(){Qt(this,t)}return Jt(t,null,[{key:"linear",value:function(t){return t}},{key:"none",value:function(){return this.linear}},{key:"get",value:function(t){return t<-1?t=-1:t>1&&(t=1),function(e){return 0===t?e:t<0?e*(e*-t+1+t):e*((2-e)*t+(1-t))}}},{key:"getPowIn",value:function(t){return function(e){return Math.pow(e,t)}}},{key:"getPowOut",value:function(t){return function(e){return 1-Math.pow(1-e,t)}}},{key:"getPowInOut",value:function(t){return function(e){return(e*=2)<1?.5*Math.pow(e,t):1-.5*Math.abs(Math.pow(2-e,t))}}},{key:"getBackIn",value:function(t){return function(e){return e*e*((t+1)*e-t)}}},{key:"getBackOut",value:function(t){return function(e){return--e*e*((t+1)*e+t)+1}}},{key:"getBackInOut",value:function(t){return t*=1.525,function(e){return(e*=2)<1?e*e*((t+1)*e-t)*.5:.5*((e-=2)*e*((t+1)*e+t)+2)}}},{key:"circIn",value:function(t){return-(Math.sqrt(1-t*t)-1)}},{key:"circOut",value:function(t){return Math.sqrt(1- --t*t)}},{key:"circInOut",value:function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)}},{key:"bounceOut",value:function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375}},{key:"bounceIn",value:function(e){return 1-t.bounceOut(1-e)}},{key:"bounceInOut",value:function(e){return e<.5?.5*t.bounceIn(2*e):.5*t.bounceOut(2*e-1)+.5}},{key:"getElasticIn",value:function(t,e){return function(n){if(0===n||1===n)return n;var i=e/Gr*Math.asin(1/t);return-t*Math.pow(2,10*(n-=1))*Math.sin((n-i)*Gr/e)}}},{key:"getElasticOut",value:function(t,e){return function(n){if(0===n||1===n)return n;var i=e/Gr*Math.asin(1/t);return t*Math.pow(2,-10*n)*Math.sin((n-i)*Gr/e)+1}}},{key:"getElasticInOut",value:function(t,e){return function(n){var i=e/Gr*Math.asin(1/t);return(n*=2)<1?t*Math.pow(2,10*(n-=1))*Math.sin((n-i)*Gr/e)*-.5:t*Math.pow(2,-10*(n-=1))*Math.sin((n-i)*Gr/e)*.5+1}}}]),t}();Ml.quadIn=Ml.getPowIn(2),Ml.quadOut=Ml.getPowOut(2),Ml.quadInOut=Ml.getPowInOut(2),Ml.cubicIn=Ml.getPowIn(3),Ml.cubicOut=Ml.getPowOut(3),Ml.cubicInOut=Ml.getPowInOut(3),Ml.quartIn=Ml.getPowIn(4),Ml.quartOut=Ml.getPowOut(4),Ml.quartInOut=Ml.getPowInOut(4),Ml.quintIn=Ml.getPowIn(5),Ml.quintOut=Ml.getPowOut(5),Ml.quintInOut=Ml.getPowInOut(5),Ml.backIn=Ml.getBackIn(1.7),Ml.backOut=Ml.getBackOut(1.7),Ml.backInOut=Ml.getBackInOut(1.7),Ml.elasticIn=Ml.getElasticIn(1,.3),Ml.elasticOut=Ml.getElasticOut(1,.3),Ml.elasticInOut=Ml.getElasticInOut(1,.3*1.5);var Pl=new(function(){function t(){Qt(this,t),this.id=al.GenAutoIncrementId(),this.animateHead=null,this.animateTail=null,this.animateCount=0,this.paused=!1}return Jt(t,[{key:"addAnimate",value:function(t){this.animateTail?(this.animateTail.nextAnimate=t,t.prevAnimate=this.animateTail,this.animateTail=t,t.nextAnimate=null):(this.animateHead=t,this.animateTail=t),this.animateCount++}},{key:"pause",value:function(){this.paused=!0}},{key:"resume",value:function(){this.paused=!1}},{key:"tick",value:function(t){if(!this.paused){var e=this.animateHead;for(this.animateCount=0;e;)e.status===Eo.END?this.removeAnimate(e):e.status===Eo.RUNNING||e.status===Eo.INITIAL?(this.animateCount++,e.advance(t)):e.status===Eo.PAUSED&&this.animateCount++,e=e.nextAnimate}}},{key:"clear",value:function(){for(var t=this.animateHead;t;)t.release(),t=t.nextAnimate;this.animateHead=null,this.animateTail=null,this.animateCount=0}},{key:"removeAnimate",value:function(t){t._onRemove&&t._onRemove.forEach((function(t){return t()})),t===this.animateHead?(this.animateHead=t.nextAnimate,t===this.animateTail?this.animateTail=null:this.animateHead.prevAnimate=null):t===this.animateTail?(this.animateTail=t.prevAnimate,this.animateTail.nextAnimate=null):(t.prevAnimate.nextAnimate=t.nextAnimate,t.nextAnimate.prevAnimate=t.prevAnimate),t.release()}}]),t}());function El(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=re(t);if(e){var r=re(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return ie(this,n)}}var Hl=function(t){ee(n,t);var e=El(n);function n(t){var i;return Qt(this,n),(i=e.call(this,null,null,0,"linear")).cb=t,i}return Jt(n,[{key:"onUpdate",value:function(t,e,n){}},{key:"onStart",value:function(){this.cb()}}]),n}(function(){function t(e,n,i,r,o){Qt(this,t),this.from=e,this.to=n,this.duration=i,this.easing=r,this.params=o,this.updateCount=0}return Jt(t,[{key:"bind",value:function(t,e){this.target=t,this.subAnimate=e,this.onBind()}},{key:"onBind",value:function(){}},{key:"onFirstRun",value:function(){}},{key:"onStart",value:function(){}},{key:"onEnd",value:function(){}},{key:"getEndProps",value:function(){}},{key:"getFromProps",value:function(){return this.from}},{key:"getMergedEndProps",value:function(){var t,e=this.getEndProps();return e?this._endProps===e?this._mergedEndProps:(this._endProps=e,void(this._mergedEndProps=Object.assign({},null!==(t=this.step.prev.getLastProps())&&void 0!==t?t:{},e))):this.step.prev?this.step.prev.getLastProps():e}},{key:"update",value:function(t,e,n){0===this.updateCount&&this.onFirstRun(),this.updateCount+=1,Object.assign(n,this.step.getLastProps()),this.onUpdate(t,e,n),t&&this.onEnd()}}]),t}()),Ol=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:al.GenAutoIncrementId(),n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Pl;Qt(this,t),this.id=e,this.timeline=n,this.status=Eo.INITIAL,this.tailAnimate=new Il(this),this.subAnimates=[this.tailAnimate],this.timeScale=1,this.rawPosition=-1,this._startTime=0,this._duringTime=0,this.timeline.addAnimate(this)}return Jt(t,[{key:"getStartTime",value:function(){return this._startTime}},{key:"getDuration",value:function(){return this.subAnimates.reduce((function(t,e){return t+e.totalDuration}),0)}},{key:"after",value:function(t){var e=t.getDuration();return this._startTime=e,this}},{key:"afterAll",value:function(t){var e=-1/0;return t.forEach((function(t){e=Yr(t.getDuration(),e)})),this._startTime=e,this}},{key:"parallel",value:function(t){return this._startTime=t.getStartTime(),this}},{key:"play",value:function(t){if(this.tailAnimate.play(t),this.target){var e=this.target.stage;e&&e.renderNextFrame()}return 1===this.subAnimates.length&&this.tailAnimate.duration===t.duration&&this.trySetAttribute(t.getFromProps(),t.mode),this}},{key:"trySetAttribute",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.mode;e&&n&Ho.SET_ATTR_IMMEDIATELY&&this.target.setAttributes&&this.target.setAttributes(e,!1,{type:Po.ANIMATE_PLAY})}},{key:"runCb",value:function(t){var e=this,n=new Hl((function(){t(e,n.step.prev)}));return this.tailAnimate.play(n),this}},{key:"customInterpolate",value:function(e,n,i,r,o,a){var s=t.interpolateMap.get(e)||t.interpolateMap.get("");return!!s&&s(e,n,i,r,o,a)}},{key:"pause",value:function(){this.status===Eo.RUNNING&&(this.status=Eo.PAUSED)}},{key:"resume",value:function(){this.status===Eo.PAUSED&&(this.status=Eo.RUNNING)}},{key:"to",value:function(t,e,n,i){if(this.tailAnimate.to(t,e,n,i),this.target){var r=this.target.stage;r&&r.renderNextFrame()}return this}},{key:"from",value:function(t,e,n,i){if(this.tailAnimate.from(t,e,n,i),this.target){var r=this.target.stage;r&&r.renderNextFrame()}return this}},{key:"wait",value:function(t){if(this.tailAnimate.wait(t),this.target){var e=this.target.stage;e&&e.renderNextFrame()}return this}},{key:"startAt",value:function(t){if(this.tailAnimate.startAt(t),this.target){var e=this.target.stage;e&&e.renderNextFrame()}return this}},{key:"loop",value:function(t){if(this.tailAnimate.loop=t,this.target){var e=this.target.stage;e&&e.renderNextFrame()}return this}},{key:"reversed",value:function(t){if(this.tailAnimate.reversed=t,this.target){var e=this.target.stage;e&&e.renderNextFrame()}return this}},{key:"bounce",value:function(t){if(this.tailAnimate.bounce=t,this.target){var e=this.target.stage;e&&e.renderNextFrame()}return this}},{key:"subAnimate",value:function(){var t=new Il(this,this.tailAnimate);return this.tailAnimate=t,this.subAnimates.push(t),t.bind(this.target),this}},{key:"getStartProps",value:function(){return this.subAnimates[0].getStartProps()}},{key:"getEndProps",value:function(){return this.tailAnimate.getEndProps()}},{key:"depreventAttr",value:function(t){this._preventAttrs&&this._preventAttrs.delete(t)}},{key:"preventAttr",value:function(t){this._preventAttrs||(this._preventAttrs=new Set),this._preventAttrs.add(t)}},{key:"preventAttrs",value:function(t){var e=this;t.forEach((function(t){return e.preventAttr(t)}))}},{key:"validAttr",value:function(t){return!this._preventAttrs||!this._preventAttrs.has(t)}},{key:"bind",value:function(t){return this.target=t,this.target.onAnimateBind&&this.target.onAnimateBind(this),this.subAnimates.forEach((function(e){e.bind(t)})),this}},{key:"advance",value:function(t){if(this._duringTime<this._startTime){if(this._duringTime+t*this.timeScale<this._startTime)return void(this._duringTime+=t*this.timeScale);t=this._duringTime+t*this.timeScale-this._startTime,this._duringTime=this._startTime}this.status===Eo.INITIAL&&(this.status=Eo.RUNNING,this._onStart&&this._onStart.forEach((function(t){return t()}))),this.setPosition(this.rawPosition+t*this.timeScale)&&this.status===Eo.RUNNING&&(this.status=Eo.END,this._onEnd&&this._onEnd.forEach((function(t){return t()})))}},{key:"setPosition",value:function(t){var e,n=0,i=this.rawPosition,r=this.subAnimates.reduce((function(t,e){return t+e.totalDuration}),0);t<0&&(t=0);var o=t>=r;if(o&&(t=r),t===i)return o;for(var a=0;a<this.subAnimates.length&&!(n+(e=this.subAnimates[a]).totalDuration>=t);a++)n+=e.totalDuration,e=void 0;return this.rawPosition=t,e.setPosition(t-n),o}},{key:"onStart",value:function(t){this._onStart||(this._onStart=[]),this._onStart.push(t)}},{key:"onEnd",value:function(t){this._onEnd||(this._onEnd=[]),this._onEnd.push(t)}},{key:"onRemove",value:function(t){this._onRemove||(this._onRemove=[]),this._onRemove.push(t)}},{key:"onFrame",value:function(t){this._onFrame||(this._onFrame=[]),this._onFrame.push(t)}},{key:"release",value:function(){this.status=Eo.END}},{key:"stop",value:function(t){t||this.target.onStop(),"start"===t?this.target.onStop(this.getStartProps()):"end"===t?this.target.onStop(this.getEndProps()):this.target.onStop(t),this.release()}}],[{key:"AddInterpolate",value:function(e,n){t.interpolateMap.set(e,n)}}]),t}();Ol.mode=Ho.NORMAL,Ol.interpolateMap=new Map;var Ll,Il=function(){function t(e,n){Qt(this,t),this.rawPosition=-1,this.position=0,this.loop=0,this.duration=0,this.animate=e,this.stepHead=new Dl(0,0,n?Object.assign({},n.stepTail.props):{}),this.stepTail=this.stepHead,this.dirty=!0,this._startAt=0}return Jt(t,[{key:"totalDuration",get:function(){return this.calcAttr(),this._totalDuration+this._startAt}},{key:"calcAttr",value:function(){this.dirty&&(this._totalDuration=this.duration*(this.loop+1))}},{key:"bind",value:function(t){return this.target=t,this}},{key:"play",value:function(t){var e=t.duration;(null==e||e<0)&&(e=0);var n=t.easing,i="string"==typeof n?Ml[n]:n,r=this._addStep(e,null,i);return r.type=Oo.customAnimate,this._appendProps(t.getEndProps(),r,!1),this._appendCustomAnimate(t,r),this}},{key:"to",value:function(t,e,n,i){var r=this;(null==e||e<0)&&(e=0);var o="string"==typeof n?Ml[n]:n,a=this._addStep(e,null,o);return a.type=Oo.to,this._appendProps(t,a,!!i&&i.tempProps),a.propKeys||(a.propKeys=Object.keys(a.props)),i&&i.noPreventAttrs||this.target.animates.forEach((function(t){t.id!==r.animate.id&&t.preventAttrs(a.propKeys)})),this}},{key:"from",value:function(t,e,n,i){var r=this;this.to(t,0,n,i);var o={};this.stepTail.propKeys||(this.stepTail.propKeys=Object.keys(this.stepTail.props)),this.stepTail.propKeys.forEach((function(t){o[t]=r.getLastPropByName(t,r.stepTail)})),this.to(o,e,n,i),this.stepTail.type=Oo.from}},{key:"startAt",value:function(t){return t<0&&(t=0),this._startAt=t,this}},{key:"getStartProps",value:function(){var t;return null===(t=this.stepHead)||void 0===t?void 0:t.props}},{key:"getEndProps",value:function(){return this.stepTail.props}},{key:"getLastStep",value:function(){return this._lastStep}},{key:"wait",value:function(t){if(t>0){var e=this._addStep(+t,null);e.type=Oo.wait,e.prev.customAnimate?e.props=e.prev.customAnimate.getEndProps():e.props=e.prev.props,this.target.onAddStep&&this.target.onAddStep(e)}return this}},{key:"_addStep",value:function(t,e,n){var i=new Dl(this.duration,t,e,n);return this.duration+=t,this.stepTail.append(i),this.stepTail=i,i}},{key:"_appendProps",value:function(t,e,n){var i=this;e.props=n?t:Object.assign({},t);var r=e.prev,o=e.props;for(e.propKeys||(e.propKeys=Object.keys(e.props)),e.propKeys.forEach((function(t){void 0===e.props[t]&&(e.props[t]=i.target.getDefaultAttribute(t))}));r.prev;)r.props&&(r.propKeys||(r.propKeys=Object.keys(r.props)),r.propKeys.forEach((function(t){void 0===o[t]&&(o[t]=r.props[t])}))),r=r.prev;var a=this.stepHead.props;e.propKeys||(e.propKeys=Object.keys(o)),e.propKeys.forEach((function(t){if(void 0===a[t]){var e=i.animate.getStartProps();a[t]=e[t]=i.target.getComputedAttribute(t)}})),this.target.onAddStep&&this.target.onAddStep(e)}},{key:"_appendCustomAnimate",value:function(t,e){e.customAnimate=t,t.step=e,t.bind(this.target,this)}},{key:"setPosition",value:function(t){var e,n,i,r=this.duration,o=this.loop,a=this.rawPosition,s=!1,l=null!==(e=this._startAt)&&void 0!==e?e:0;if(t<0&&(t=0),t<l)return this.rawPosition=t,!1;if(r<=0)return s=!0;if(i=(t-=l)-(n=Math.floor(t/r))*r,(s=t>=o*r+r)&&(t=(i=r)*(n=o)+r),t===a)return s;var h=!this.reversed!=!(this.bounce&&n%2);return h&&(i=r-i),this._deltaPosition=i-this.position,this.position=i,this.rawPosition=t+l,this.updatePosition(s,h),s}},{key:"updatePosition",value:function(t,e){if(this.stepHead){var n=this.stepHead.next,i=this.position,r=this.duration;if(this.target&&n){for(var o=n.next;o&&o.position<=i;)o=(n=o).next;var a=t?0===r?1:i/r:(i-n.position)/n.duration;n.easing&&(a=n.easing(a)),this.tryCallCustomAnimateLifeCycle(n,this._lastStep||(e?this.stepTail:this.stepHead),e),this.updateTarget(n,a,t),this._lastStep=n,this.animate._onFrame&&this.animate._onFrame.forEach((function(t){return t(n,a)}))}}}},{key:"tryCallCustomAnimateLifeCycle",value:function(t,e,n){if(t!==e)if(n){for(var i=e.prev;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{for(var r=e.next;r&&r!==t;)r.customAnimate&&(r.customAnimate.onStart&&r.customAnimate.onStart(),r.customAnimate.onEnd&&r.customAnimate.onEnd()),r=r.next;e&&e.customAnimate&&e.customAnimate.onEnd&&e.customAnimate.onEnd(),t&&t.customAnimate&&t.customAnimate.onStart&&t.customAnimate.onStart()}}},{key:"getLastPropByName",value:function(t,e){for(var n=e.prev;n;){if(n.props&&void 0!==n.props[t])return n.props[t];if(n.customAnimate){var i=n.customAnimate.getEndProps()[t];if(void 0!==i)return i}n=n.prev}return console.warn("未知错误,step中找不到属性"),e.props[t]}},{key:"updateTarget",value:function(t,e,n){null==t.props&&null==t.customAnimate||this.target.onStep(this,this.animate,t,e,n)}}]),t}(),Dl=function(){function t(e,n,i,r){Qt(this,t),this.duration=n,this.position=e,this.props=i,this.easing=r}return Jt(t,[{key:"append",value:function(t){t.prev=this,t.next=this.next,this.next=t}},{key:"getLastProps",value:function(){for(var t=this.prev;t;){if(t.props)return t.props;if(t.customAnimate)return t.customAnimate.getMergedEndProps();t=t.prev}return null}}]),t}(),Wl=200,Fl="cubicOut";!function(t){t[t.Top=1]="Top",t[t.Right=2]="Right",t[t.Bottom=4]="Bottom",t[t.Left=8]="Left",t[t.ALL=15]="ALL"}(Ll||(Ll={}));var zl,jl=[!1,!1,!1,!1],Nl=[0,0,0,0],Gl=function(t){return t?Sr(t)?0===t.length?0:1===t.length?t[0]:2===t.length?(Nl[0]=t[0],Nl[2]=t[0],Nl[1]=t[1],Nl[3]=t[1],Nl):t:t:0},Ul=[{x:0,y:0},{x:0,y:0},{x:0,y:0},{x:0,y:0}],Kl=[1,2,3,0,1,2,3,0];function Vl(t,e,n,i){for(;t>=Gr;)t-=Gr;for(;t<0;)t+=Gr;for(;t>e;)e+=Gr;Ul[0].x=n,Ul[1].y=n,Ul[2].x=-n,Ul[3].y=-n;var r=Math.ceil(t/jr)%4,o=Math.ceil(e/jr)%4;if(i.add(Vr(t)*n,$r(t)*n),i.add(Vr(e)*n,$r(e)*n),r!==o||e-t>zr)for(var a=!1,s=0;s<Kl.length;s++)if(a||r!==Kl[s]){if(a&&o===Kl[s])break;if(a){var l=Ul[Kl[s]];i.add(l.x,l.y)}}else{a=!0;var h=Ul[r];i.add(h.x,h.y)}}function Yl(t,e,n){var i=to(t.x,t.y,e.x,e.y,n),r=i.x,o=i.y,a=to(t.x1,t.y1,e.x1,e.y1,n),s=a.x,l=a.y,h=new eo(r,o,s,l);return h.defined=e.defined,h}function Xl(t,e,n){if(!t||!e)return[];Array.isArray(t)||(t=[t]),Array.isArray(e)||(e=[e]);var i=[];if(t.length>e.length){i=e.map((function(t){var e=new eo(t.x,t.y,t.x1,t.y1);return e.defined=t.defined,e}));for(var r=0;r<e.length;r++)i[r]=Yl(t[r],e[r],n)}else{i=e.map((function(t){var e=new eo(t.x,t.y,t.x1,t.y1);return e.defined=t.defined,e}));for(var o=0;o<t.length;o++)i[o]=Yl(t[o],e[o],n)}return i}function $l(t,e){if(Sr(t)){for(var n,i=0;i<t.length&&void 0===n;i++)n=t[i][e];return n}return t[e]}!function(t){t[t.LEFT_TO_RIGHT=0]="LEFT_TO_RIGHT",t[t.RIGHT_TO_LEFT=1]="RIGHT_TO_LEFT",t[t.TOP_TO_BOTTOM=2]="TOP_TO_BOTTOM",t[t.BOTTOM_TO_TOP=3]="BOTTOM_TO_TOP",t[t.STROKE=4]="STROKE"}(zl||(zl={}));var ql={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},Zl={};for(var Jl in ql)Mr(ql,Jl)&&(Zl[ql[Jl]]=Jl);var Ql={to:{},get:{}};function th(t,e,n){return Math.min(Math.max(e,t),n)}function eh(t){var e=t.toString(16).toUpperCase();return e.length<2?"0"+e:e}Ql.get=function(t){var e,n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0,1];switch(t.substring(0,3).toLowerCase()){case"hsl":e=Ql.get.hsl(t,i),n="hsl";break;case"hwb":e=Ql.get.hwb(t,i),n="hwb";break;default:e=Ql.get.rgb(t,i),n="rgb"}return e?{model:n,value:e}:null},Ql.get.rgb=function(t){if(!t)return null;var e,n,i,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0,1];if(e=t.match(/^#([a-f0-9]{6})([a-f0-9]{2})?$/i)){for(i=e[2],e=e[1],n=0;n<3;n++){var o=2*n;r[n]=parseInt(e.slice(o,o+2),16)}i&&(r[3]=Math.round(parseInt(i,16)/255*100)/100)}else if(e=t.match(/^#([a-f0-9]{3,4})$/i)){for(i=(e=e[1])[3],n=0;n<3;n++)r[n]=parseInt(e[n]+e[n],16);i&&(r[3]=Math.round(parseInt(i+i,16)/255*100)/100)}else if(e=t.match(/^rgba?\(\s*([+-]?\d+)\s*,\s*([+-]?\d+)\s*,\s*([+-]?\d+)\s*(?:,\s*([+-]?[\d.]+)\s*)?\)$/)){for(n=0;n<3;n++)r[n]=parseInt(e[n+1],10);e[4]&&(r[3]=parseFloat(e[4]))}else{if(!(e=t.match(/^rgba?\(\s*([+-]?[\d.]+)%\s*,\s*([+-]?[\d.]+)%\s*,\s*([+-]?[\d.]+)%\s*(?:,\s*([+-]?[\d.]+)\s*)?\)$/))){if(e=t.match(/(\D+)/)){if("transparent"===e[1])return[0,0,0,0];var a=ql[e[1]];return r[0]=a[0],r[1]=a[1],r[2]=a[2],r[3]=a[3],r?(r[3]=1,r):null}return null}for(n=0;n<3;n++)r[n]=Math.round(2.55*parseFloat(e[n+1]));e[4]&&(r[3]=parseFloat(e[4]))}for(n=0;n<3;n++)r[n]=th(r[n],0,255);return r[3]=th(r[3],0,1),r},Ql.get.hsl=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0,1];if(!t)return null;var n=t.match(/^hsla?\(\s*([+-]?(?:\d*\.)?\d+)(?:deg)?\s*,\s*([+-]?[\d.]+)%\s*,\s*([+-]?[\d.]+)%\s*(?:,\s*([+-]?[\d.]+)\s*)?\)$/);if(n){var i=parseFloat(n[4]);return e[0]=(parseFloat(n[1])+360)%360,e[1]=th(parseFloat(n[2]),0,100),e[2]=th(parseFloat(n[3]),0,100),e[3]=th(isNaN(i)?1:i,0,1),e}return null},Ql.get.hwb=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0,1];if(!t)return null;var n=t.match(/^hwb\(\s*([+-]?\d*[.]?\d+)(?:deg)?\s*,\s*([+-]?[\d.]+)%\s*,\s*([+-]?[\d.]+)%\s*(?:,\s*([+-]?[\d.]+)\s*)?\)$/);if(n){var i=parseFloat(n[4]);return e[0]=(parseFloat(n[1])%360+360)%360,e[1]=th(parseFloat(n[2]),0,100),e[2]=th(parseFloat(n[3]),0,100),e[3]=th(isNaN(i)?1:i,0,1),e}return null},Ql.to.hex=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];var i=e;return"#"+eh(i[0])+eh(i[1])+eh(i[2])+(i[3]<1?eh(Math.round(255*i[3])):"")},Ql.to.rgb=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];var i=e;return i.length<4||1===i[3]?"rgb("+Math.round(i[0])+", "+Math.round(i[1])+", "+Math.round(i[2])+")":"rgba("+Math.round(i[0])+", "+Math.round(i[1])+", "+Math.round(i[2])+", "+i[3]+")"},Ql.to.rgb.percent=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];var i=e,r=Math.round(i[0]/255*100),o=Math.round(i[1]/255*100),a=Math.round(i[2]/255*100);return i.length<4||1===i[3]?"rgb("+r+"%, "+o+"%, "+a+"%)":"rgba("+r+"%, "+o+"%, "+a+"%, "+i[3]+")"},Ql.to.hsl=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];var i=e;return i.length<4||1===i[3]?"hsl("+i[0]+", "+i[1]+"%, "+i[2]+"%)":"hsla("+i[0]+", "+i[1]+"%, "+i[2]+"%, "+i[3]+")"},Ql.to.hwb=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];var i=e,r="";return i.length>=4&&1!==i[3]&&(r=", "+i[3]),"hwb("+i[0]+", "+i[1]+"%, "+i[2]+"%"+r+")"},Ql.to.keyword=function(t){return Zl[t.slice(0,3)]};var nh,ih=Ql;!function(t){t[t.Color255=0]="Color255",t[t.Color1=1]="Color1"}(nh||(nh={}));var rh=function(){function t(){Qt(this,t)}return Jt(t,null,[{key:"Get",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:nh.Color1,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[0,0,0,1];if(n===nh.Color1){var r=t.store1[e];if(r)return i[0]=r[0],i[1]=r[1],i[2]=r[2],i[3]=r[3],i;if((r=Ql.get(e))&&r.value){var o=r.value,a=[o[0]/255,o[1]/255,o[2]/255,o[3]];t.store1[e]=a,t.store255[e]=o,i[0]=a[0],i[1]=a[1],i[2]=a[2],i[3]=a[3]}return i}var s=t.store255[e];if(s)return i[0]=s[0],i[1]=s[1],i[2]=s[2],i[3]=s[3],i;if((s=Ql.get(e))&&s.value){var l=s.value;t.store1[e]=[l[0]/255,l[1]/255,l[2]/255,l[3]],t.store255[e]=l,i[0]=l[0],i[1]=l[1],i[2]=l[2],i[3]=l[3]}return i}},{key:"Set",value:function(e,n,i){if(n===nh.Color1){if(t.store1[e])return;t.store1[e]=i,t.store255[e]=[Math.floor(255*i[0]),Math.floor(255*i[1]),Math.floor(255*i[2]),Math.floor(255*i[3])]}else{if(t.store255[e])return;t.store255[e]=i,t.store1[e]=[i[0]/255,i[1]/255,i[2]/255,i[3]]}}}]),t}();function oh(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return Array.isArray(t)?e?"rgb(".concat(Math.round(t[0]),",").concat(Math.round(t[1]),",").concat(Math.round(t[2]),",").concat(t[3].toFixed(2),")"):"rgb(".concat(Math.round(t[0]),",").concat(Math.round(t[1]),",").concat(Math.round(t[2]),")"):t}function ah(t,e,n,i,r){if(!t||!e)return t&&oh(t)||e&&oh(e)||!1;var o,a,s=!1,l=!1;if(Array.isArray(t)?o=t:"string"==typeof t?o=rh.Get(t,nh.Color255):s=!0,Array.isArray(e)?a=e:"string"==typeof e?a=rh.Get(e,nh.Color255):l=!0,s!==l){var h=s?t:e,u=s?e:t,c=Object.assign(Object.assign({},h),{stops:h.stops.map((function(t){return Object.assign(Object.assign({},t),{color:oh(u)})}))});return s?ah(h,c,n,i,r):ah(c,h,n,i,r)}if(s){if(t.gradient===e.gradient){var d=t,f=e,p=d.stops,g=f.stops;if(p.length!==g.length)return!1;if("linear"===d.gradient)return function(t,e,n){var i=t.stops,r=e.stops;return{gradient:"linear",x0:t.x0+(e.x0-t.x0)*n,x1:t.x1+(e.x1-t.x1)*n,y0:t.y0+(e.y0-t.y0)*n,y1:t.y1+(e.y1-t.y1)*n,stops:new Array(i.length).fill(0).map((function(t,e){return{color:hh(i[e].color,r[e].color,n),offset:i[e].offset+(r[e].offset-i[e].offset)*n}}))}}(d,f,n);if("radial"===d.gradient)return function(t,e,n){var i=t.stops,r=e.stops;return{gradient:"radial",x0:t.x0+(e.x0-t.x0)*n,x1:t.x1+(e.x1-t.x1)*n,y0:t.y0+(e.y0-t.y0)*n,y1:t.y1+(e.y1-t.y1)*n,r0:t.r0+(e.r0-t.r0)*n,r1:t.r1+(e.r1-t.r1)*n,stops:new Array(i.length).fill(0).map((function(t,e){return{color:hh(i[e].color,r[e].color,n),offset:i[e].offset+(r[e].offset-i[e].offset)*n}}))}}(d,f,n);if("conical"===d.gradient)return function(t,e,n){var i=t.stops,r=e.stops;return{gradient:"conical",startAngle:t.startAngle+(e.startAngle-t.startAngle)*n,endAngle:t.endAngle+(e.endAngle-t.endAngle)*n,x:t.x+(e.x-t.x)*n,y:t.y+(e.y-t.y)*n,stops:new Array(i.length).fill(0).map((function(t,e){return{color:hh(i[e].color,r[e].color,n),offset:i[e].offset+(r[e].offset-i[e].offset)*n}}))}}(d,f,n)}return!1}return r&&r(o,a),oh(function(t,e,n){return[t[0]+(e[0]-t[0])*n,t[1]+(e[1]-t[1])*n,t[2]+(e[2]-t[2])*n,t[3]+(e[3]-t[3])*n]}(o,a,n),i)}rh.store255={},rh.store1={};var sh=[0,0,0,0],lh=[0,0,0,0];function hh(t,e,n){return rh.Get(t,nh.Color255,sh),rh.Get(e,nh.Color255,lh),"rgba(".concat(Math.round(sh[0]+(lh[0]-sh[0])*n),",").concat(Math.round(sh[1]+(lh[1]-sh[1])*n),",").concat(Math.round(sh[2]+(lh[2]-sh[2])*n),",").concat(sh[3]+(lh[3]-sh[3])*n,")")}var uh=function(){function t(){Qt(this,t)}return Jt(t,null,[{key:"GetImage",value:function(e,n){var i,r=t.cache.get(e);r?"fail"===r.loadState?as.global.getRequestAnimationFrame()((function(){n.imageLoadFail(e)})):"init"===r.loadState||"loading"===r.loadState?null===(i=r.waitingMark)||void 0===i||i.push(n):n&&as.global.getRequestAnimationFrame()((function(){n.imageLoadSuccess(e,r.data)})):(r={type:"image",loadState:"init"},t.cache.set(e,r),r.dataPromise=as.global.loadImage(e),r.dataPromise?(r.waitingMark=[n],r.dataPromise.then((function(t){var n;r.loadState=(null==t?void 0:t.data)?"success":"fail",r.data=null==t?void 0:t.data,null===(n=r.waitingMark)||void 0===n||n.map((function(n,i){(null==t?void 0:t.data)?(r.loadState="success",r.data=t.data,n.imageLoadSuccess(e,t.data)):(r.loadState="fail",n.imageLoadFail(e))}))}))):(r.loadState="fail",n.imageLoadFail(e)))}},{key:"GetSvg",value:function(e,n){var i,r=t.cache.get(e);r?"fail"===r.loadState?as.global.getRequestAnimationFrame()((function(){n.imageLoadFail(e)})):"init"===r.loadState||"loading"===r.loadState?null===(i=r.waitingMark)||void 0===i||i.push(n):n&&as.global.getRequestAnimationFrame()((function(){n.imageLoadSuccess(e,r.data)})):(r={type:"image",loadState:"init"},t.cache.set(e,r),r.dataPromise=as.global.loadSvg(e),r.dataPromise?(r.waitingMark=[n],r.dataPromise.then((function(t){var n;r.loadState=(null==t?void 0:t.data)?"success":"fail",r.data=null==t?void 0:t.data,null===(n=r.waitingMark)||void 0===n||n.map((function(n,i){(null==t?void 0:t.data)?(r.loadState="success",r.data=t.data,n.imageLoadSuccess(e,t.data)):(r.loadState="fail",n.imageLoadFail(e))}))}))):(r.loadState="fail",n.imageLoadFail(e)))}},{key:"GetFile",value:function(e,n){var i=t.cache.get(e);return i?"init"===i.loadState||"fail"===i.loadState?Promise.reject():"loading"===i.loadState?i.dataPromise.then((function(t){return t.data})):Promise.resolve(i.data):(i={type:n,loadState:"init"},t.cache.set(e,i),"arrayBuffer"===n?i.dataPromise=as.global.loadArrayBuffer(e):"blob"===n?i.dataPromise=as.global.loadBlob(e):"json"===n&&(i.dataPromise=as.global.loadJson(e)),i.dataPromise.then((function(t){return t.data})))}}]),t}();function ch(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=re(t);if(e){var r=re(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return ie(this,n)}}uh.cache=new Map;var dh=new mo,fh=["lineWidth","lineCap","lineJoin","miterLimit","scaleX","scaleY","angle","anchor"],ph=["x","y"],gh=["scaleX","scaleY"],vh=["angle"],yh=new eo,mh=function(t){ee(n,t);var e=ch(n);function n(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Qt(this,n),(t=e.call(this))._AABBBounds=new ao,t._updateTag=To.INIT,t.attribute=i,t.valid=t.isValid(),i.background&&t.loadImage(i.background,!0),t}return Jt(n,[{key:"AABBBounds",get:function(){return this.tryUpdateAABBBounds("imprecise"===this.attribute.boundsMode)}},{key:"OBBBounds",get:function(){return this.tryUpdateOBBBounds()}},{key:"globalAABBBounds",get:function(){return this.tryUpdateGlobalAABBBounds()}},{key:"transMatrix",get:function(){return this.tryUpdateLocalTransMatrix(!0)}},{key:"globalTransMatrix",get:function(){return this.tryUpdateGlobalTransMatrix(!0)}},{key:"setMode",value:function(t){"3d"===t?this.set3dMode():this.set2dMode()}},{key:"set3dMode",value:function(){this.in3dMode=!0}},{key:"set2dMode",value:function(){this.in3dMode=!1}},{key:"getOffsetXY",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.attribute,i=n.dx,r=void 0===i?t.dx:i,o=n.dy,a=void 0===o?t.dy:o;if(e&&this.parent){var s=Js(this.parent).group,l=this.parent.attribute,h=l.scrollX,u=void 0===h?s.scrollX:h,c=l.scrollY,d=void 0===c?s.scrollY:c;yh.x=r+u,yh.y=a+d}else yh.x=r,yh.y=a;return yh}},{key:"tryUpdateAABBBounds",value:function(t){if(!this.shouldUpdateAABBBounds())return this._AABBBounds;if(!this.valid)return this._AABBBounds.clear(),this._AABBBounds;as.graphicService.beforeUpdateAABBBounds(this,this.stage,!0,this._AABBBounds);var e=this.doUpdateAABBBounds(t);return as.graphicService.afterUpdateAABBBounds(this,this.stage,this._AABBBounds,this,!0),e}},{key:"combindShadowAABBBounds",value:function(t){if(this.shadowRoot){var e=this.shadowRoot.AABBBounds.clone();t.union(e)}}},{key:"tryUpdateGlobalAABBBounds",value:function(){return this._globalAABBBounds?this._globalAABBBounds.setValue(this._AABBBounds.x1,this._AABBBounds.y1,this._AABBBounds.x2,this._AABBBounds.y2):this._globalAABBBounds=this._AABBBounds.clone(),this.parent&&this._globalAABBBounds.transformWithMatrix(this.parent.globalTransMatrix),this._globalAABBBounds}},{key:"tryUpdateGlobalTransMatrix",value:function(){if(this._globalTransMatrix){if(this.parent){var t=this.parent.globalTransMatrix;this._globalTransMatrix.setValue(t.a,t.b,t.c,t.d,t.e,t.f)}}else this._globalTransMatrix=this.parent?this.parent.globalTransMatrix.clone():this.transMatrix.clone();return this.shouldUpdateGlobalMatrix()&&this.doUpdateGlobalMatrix(),this._globalTransMatrix}},{key:"shouldUpdateGlobalMatrix",value:function(){return!0}},{key:"tryUpdateLocalTransMatrix",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this._transMatrix||(this._transMatrix=new mo),this.shouldUpdateLocalMatrix()&&(this.doUpdateLocalMatrix(),t&&this.clearUpdateLocalPositionTag()),this._transMatrix}},{key:"shouldUpdateAABBBounds",value:function(){return this.shadowRoot?!!(this._updateTag&To.UPDATE_BOUNDS)||this.shadowRoot.shouldUpdateAABBBounds():!!(this._updateTag&To.UPDATE_BOUNDS)}},{key:"shouldSelfChangeUpdateAABBBounds",value:function(){return this.shadowRoot?!!(this._updateTag&To.UPDATE_BOUNDS)||this.shadowRoot.shouldUpdateAABBBounds():!!(this._updateTag&To.UPDATE_BOUNDS)}},{key:"shouldUpdateLocalMatrix",value:function(){return!!(this._updateTag&To.UPDATE_LOCAL_MATRIX)}},{key:"isValid",value:function(){var t,e,n=this.attribute;return Number.isFinite((null!==(t=n.x)&&void 0!==t?t:0)+(null!==(e=n.y)&&void 0!==e?e:0))}},{key:"_validNumber",value:function(t){return null==t||Number.isFinite(t)}},{key:"shouldUpdateShape",value:function(){return!!(this._updateTag&To.UPDATE_SHAPE)}},{key:"clearUpdateShapeTag",value:function(){this._updateTag&=To.CLEAR_SHAPE}},{key:"containsPoint",value:function(t,e,n,i){if(!i)return!1;if(n===Mo.GLOBAL){var r=new eo(t,e);this.parent&&this.parent.globalTransMatrix.transformPoint(r,r),t=r.x,e=r.y}return i.containsPoint(this,{x:t,y:e})}},{key:"setAttributes",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2?arguments[2]:void 0;(t=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(t,this.attribute,null,n)||t).background&&this.loadImage(t.background,!0),this._setAttributes(t,e,n)}},{key:"_setAttributes",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2?arguments[2]:void 0,i=Object.keys(t),r=0;r<i.length;r++){var o=i[r];this.attribute[o]=t[o]}this.valid=this.isValid(),this.updateShapeAndBoundsTagSetted()||!e&&!this.needUpdateTags(i)?this.addUpdateBoundTag():this.addUpdateShapeAndBoundsTag(),this.addUpdatePositionTag(),this.onAttributeUpdate(n)}},{key:"setAttribute",value:function(t,e,n,i){var r,o=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(Qs({},t,e),this.attribute,t,i);o?this._setAttributes(o,n,i):mr(null===(r=this.normalAttrs)||void 0===r?void 0:r[t])?(this.attribute[t]=e,this.valid=this.isValid(),this.updateShapeAndBoundsTagSetted()||!n&&!this.needUpdateTag(t)?this.addUpdateBoundTag():this.addUpdateShapeAndBoundsTag(),this.addUpdatePositionTag(),this.onAttributeUpdate(i)):this.normalAttrs[t]=e,"background"===t&&this.loadImage(e,!0)}},{key:"needUpdateTags",value:function(t){for(var e=0;e<fh.length;e++){var n=fh[e];if(-1!==t.indexOf(n))return!0}return!1}},{key:"needUpdateTag",value:function(t){for(var e=0;e<fh.length;e++)if(t===fh[e])return!0;return!1}},{key:"initAttributes",value:function(t){var e={type:Po.INIT};t=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(t,this.attribute,null,e)||t,this.attribute=t,t.background&&this.loadImage(t.background,!0),this._updateTag=To.INIT,this.onAttributeUpdate(e)}},{key:"translate",value:function(t,e){var n,i;if(0===t&&0===e)return this;var r={type:Po.TRANSLATE},o=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({x:t,y:e},this.attribute,ph,r);o&&(t=o.x,e=o.y,delete o.x,delete o.y,this._setAttributes(o));var a=this.attribute,s=a.postMatrix;return s?as.transformUtil.fromMatrix(s,s).translate(t,e):(a.x=(null!==(n=a.x)&&void 0!==n?n:Pa.x)+t,a.y=(null!==(i=a.y)&&void 0!==i?i:Pa.y)+e),this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.onAttributeUpdate(r),this}},{key:"translateTo",value:function(t,e){var n=this.attribute;if(n.x===t&&n.y===e)return this;var i={type:Po.TRANSLATE_TO},r=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({x:t,y:e},this.attribute,ph,i);return r?(this._setAttributes(r,!1,i),this):(n.x=t,n.y=e,this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.onAttributeUpdate(i),this)}},{key:"scale",value:function(t,e,n){var i,r;if(1===t&&1===e)return this;var o={type:Po.SCALE},a=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({scaleX:t,scaleY:e,scaleCenter:n},this.attribute,gh,o);a&&(t=a.scaleX,e=a.scaleY,delete a.scaleX,delete a.scaleY,this._setAttributes(a));var s=this.attribute;if(n){var l=this.attribute.postMatrix;l||(l=new mo,s.postMatrix=l),as.transformUtil.fromMatrix(l,l).scale(t,e,n)}else s.scaleX=(null!==(i=s.scaleX)&&void 0!==i?i:Pa.scaleX)*t,s.scaleY=(null!==(r=s.scaleY)&&void 0!==r?r:Pa.scaleY)*e;return this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.onAttributeUpdate(o),this}},{key:"scaleTo",value:function(t,e){var n=this.attribute;if(n.scaleX===t&&n.scaleY===e)return this;var i={type:Po.SCALE_TO},r=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({scaleX:t,scaleY:e},this.attribute,gh,i);return r?(this._setAttributes(r,!1,i),this):(n.scaleX=t,n.scaleY=e,this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.onAttributeUpdate(i),this)}},{key:"rotate",value:function(t){var e;if(0===t)return this;var n={type:Po.ROTATE},i=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(t,this.attribute,vh,n);if(i)return this._setAttributes(i,!1,n),this;var r=this.attribute;return r.angle=(null!==(e=r.angle)&&void 0!==e?e:Pa.angle)+t,this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.onAttributeUpdate(n),this}},{key:"rotateTo",value:function(t){var e=this.attribute;if(e.angle===t)return this;var n={type:Po.ROTATE_TO},i=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(t,this.attribute,vh,n);return i?(this._setAttributes(i,!1,n),this):(e.angle=t,this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.onAttributeUpdate(n),this)}},{key:"skewTo",value:function(t,e){return this}},{key:"animate",value:function(t){var e=this;this.animates||(this.animates=new Map);var n=new Ol(null==t?void 0:t.id).bind(this);if(t){var i=t.onStart,r=t.onFrame,o=t.onEnd,a=t.onRemove;null!=i&&n.onStart(i),null!=r&&n.onFrame(r),null!=o&&n.onEnd(o),null!=a&&n.onRemove(a),n.interpolateFunc=t.interpolate}return this.animates.set(n.id,n),n.onRemove((function(){e.animates.delete(n.id)})),n}},{key:"onAttributeUpdate",value:function(t){as.graphicService.onAttributeUpdate(this),this._emitCustomEvent("afterAttributeUpdate",t)}},{key:"update",value:function(t){t?(t.bounds&&this.tryUpdateAABBBounds("imprecise"===this.attribute.boundsMode),t.trans&&this.tryUpdateLocalTransMatrix()):(this.tryUpdateAABBBounds("imprecise"===this.attribute.boundsMode),this.tryUpdateLocalTransMatrix())}},{key:"hasState",value:function(t){return!(!this.currentStates||!this.currentStates.length)&&(!!mr(t)||this.currentStates.includes(t))}},{key:"getState",value:function(t){var e;return null===(e=this.states)||void 0===e?void 0:e[t]}},{key:"applyStateAttrs",value:function(t,e,n,i){var r,o,a,s,l=this;if(n){var h=Object.keys(t),u=i?h.reduce((function(e,n){return e[n]=void 0===t[n]?l.getDefaultAttribute(n):t[n],e}),{}):t,c=this.animate();c.stateNames=e,c.to(u,null!==(o=null===(r=this.stateAnimateConfig)||void 0===r?void 0:r.duration)&&void 0!==o?o:Wl,null!==(s=null===(a=this.stateAnimateConfig)||void 0===a?void 0:a.easing)&&void 0!==s?s:Fl)}else this.setAttributes(t,!1,{type:Po.STATE})}},{key:"updateNormalAttrs",value:function(t){var e=this,n={};this.normalAttrs?(Object.keys(t).forEach((function(t){t in e.normalAttrs?(n[t]=e.normalAttrs[t],delete e.normalAttrs[t]):n[t]=e.getNormalAttribute(t)})),Object.keys(this.normalAttrs).forEach((function(n){t[n]=e.normalAttrs[n]}))):Object.keys(t).forEach((function(t){n[t]=e.getNormalAttribute(t)})),this.normalAttrs=n}},{key:"getNormalAttribute",value:function(t){var e=this.attribute[t];return this.animates&&this.animates.forEach((function(n){if(n.stateNames){var i=n.getEndProps();Mr(i,t)&&(e=i[t])}})),e}},{key:"clearStates",value:function(t){this.hasState()&&this.normalAttrs&&this.applyStateAttrs(this.normalAttrs,this.currentStates,t,!0),this.normalAttrs=null,this.currentStates=[]}},{key:"removeState",value:function(t,e){if((this.currentStates?this.currentStates.indexOf(t):-1)>=0){var n=this.currentStates.filter((function(e){return e!==t}));this.useStates(n,e)}}},{key:"toggleState",value:function(t,e){if(this.hasState(t))this.removeState(t,e);else if((this.currentStates?this.currentStates.indexOf(t):-1)<0){var n=this.currentStates?this.currentStates.slice():[];n.push(t),this.useStates(n,e)}}},{key:"addState",value:function(t,e,n){var i;if(!this.currentStates||!this.currentStates.includes(t)||!e&&1!==this.currentStates.length){var r=e&&(null===(i=this.currentStates)||void 0===i?void 0:i.length)?this.currentStates.concat([t]):[t];this.useStates(r,n)}}},{key:"useStates",value:function(t,e){var n,i=this;if(t.length){if((null===(n=this.currentStates)||void 0===n?void 0:n.length)!==t.length||t.some((function(t,e){return i.currentStates[e]!==t}))){var r={};t.forEach((function(e){var n,o=i.stateProxy?i.stateProxy(e,t):null===(n=i.states)||void 0===n?void 0:n[e];o&&Object.assign(r,o)})),this.updateNormalAttrs(r),this.currentStates=t,this.applyStateAttrs(r,t,e)}}else this.clearStates(e)}},{key:"addUpdateBoundTag",value:function(){this._updateTag|=To.UPDATE_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag(),this.glyphHost&&this.glyphHost.addUpdateBoundTag()}},{key:"addUpdateShapeTag",value:function(){this._updateTag|=To.UPDATE_SHAPE}},{key:"addUpdateShapeAndBoundsTag",value:function(){this._updateTag|=To.UPDATE_SHAPE_AND_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag(),this.glyphHost&&this.glyphHost.addUpdateBoundTag()}},{key:"updateShapeAndBoundsTagSetted",value:function(){return(this._updateTag&To.UPDATE_SHAPE_AND_BOUNDS)===To.UPDATE_SHAPE_AND_BOUNDS}},{key:"clearUpdateBoundTag",value:function(){this._updateTag&=To.CLEAR_BOUNDS}},{key:"addUpdatePositionTag",value:function(){this.shadowRoot&&this.shadowRoot.addUpdateGlobalPositionTag(),this._updateTag|=To.UPDATE_GLOBAL_LOCAL_MATRIX}},{key:"addUpdateGlobalPositionTag",value:function(){this.shadowRoot&&this.shadowRoot.addUpdateGlobalPositionTag(),this._updateTag|=To.UPDATE_GLOBAL_MATRIX}},{key:"clearUpdateLocalPositionTag",value:function(){this._updateTag&=To.CLEAR_LOCAL_MATRIX}},{key:"clearUpdateGlobalPositionTag",value:function(){this._updateTag&=To.CLEAR_GLOBAL_MATRIX}},{key:"doUpdateLocalMatrix",value:function(){var t=this.attribute,e=t.x,n=void 0===e?Pa.x:e,i=t.y,r=void 0===i?Pa.y:i,o=t.scaleX,a=void 0===o?Pa.scaleX:o,s=t.scaleY,l=void 0===s?Pa.scaleY:s,h=t.angle,u=void 0===h?Pa.angle:h,c=t.anchor,d=t.postMatrix,f=[0,0];if(c){if("string"==typeof c[0]){var p=parseFloat(c[0])/100,g=this.AABBBounds;f[0]=g.x1+(g.x2-g.x1)*p}else f[0]=c[0];if("string"==typeof c[1]){var v=parseFloat(c[1])/100,y=this.AABBBounds;f[1]=y.x1+(y.x2-y.x1)*v}else f[1]=c[1]}!function(t,e,n,i,r,o,a,s){var l,h,u=e.a,c=e.b,d=e.c,f=e.d,p=e.e,g=e.f,v=Vr(a),y=$r(a);s?(l=s[0],h=s[1]):(l=n,h=i);var m=l-n,b=h-i,w=u*v+d*y,C=c*v+f*y,x=d*v-u*y,_=f*v-c*y;t.a=r*w,t.b=r*C,t.c=o*x,t.d=o*_,t.e=p+u*l+d*h-w*m-x*b,t.f=g+c*l+f*h-C*m-_*b}(this._transMatrix,this._transMatrix.reset(),n,r,a,l,u,c&&f);var m=this.getOffsetXY(Pa);if(this._transMatrix.e+=m.x,this._transMatrix.f+=m.y,d){var b=dh.setValue(d.a,d.b,d.c,d.d,d.e,d.f),w=this._transMatrix;b.multiply(w.a,w.b,w.c,w.d,w.e,w.f),w.setValue(b.a,b.b,b.c,b.d,b.e,b.f)}}},{key:"doUpdateGlobalMatrix",value:function(){if(this.parent){this._globalTransMatrix.multiply(this.transMatrix.a,this.transMatrix.b,this.transMatrix.c,this.transMatrix.d,this.transMatrix.e,this.transMatrix.f);var t=this.parent.attribute,e=t.scrollX,n=void 0===e?0:e,i=t.scrollY,r=void 0===i?0:i;this._globalTransMatrix.translate(n,r)}}},{key:"setStage",value:function(t,e){this.stage!==t&&(this.stage=t,this.layer=e,this.setStageToShadowRoot(t,e),this._onSetStage&&this._onSetStage(this,t,e),as.graphicService.onSetStage(this,t))}},{key:"setStageToShadowRoot",value:function(t,e){this.shadowRoot&&this.shadowRoot.setStage(t,e)}},{key:"onAddStep",value:function(t){}},{key:"onStop",value:function(t){t&&this.setAttributes(t,!1,{type:Po.ANIMATE_END})}},{key:"onStep",value:function(t,e,n,i,r){var o={};if(n.customAnimate)n.customAnimate.update(r,i,o);else{var a=n.props,s=n.parsedProps,l=n.propKeys;this.stepInterpolate(t,e,o,n,i,r,a,void 0,s,l)}this.setAttributes(o,!1,{type:Po.ANIMATE_UPDATE,animationState:{ratio:i,end:r,step:n,isFirstFrameOfStep:t.getLastStep()!==n}}),this.stage&&this.stage.renderNextFrame()}},{key:"stepInterpolate",value:function(t,e,n,i,r,o,a,s,l,h){var u=this;h||(h=Object.keys(a),i.propKeys=h),o?i.propKeys.forEach((function(t){e.validAttr(t)&&(n[t]=a[t])})):h.forEach((function(o){var h;if(e.validAttr(o)){var c=a[o],d=null!==(h=s&&s[o])&&void 0!==h?h:t.getLastPropByName(o,i);e.interpolateFunc&&e.interpolateFunc(o,r,d,c,n)||(e.customInterpolate(o,r,d,c,u,n)||u.defaultInterpolate(c,d,o,n,l,r)||u._interpolate(o,r,d,c,n))}})),i.parsedProps=l}},{key:"defaultInterpolate",value:function(t,e,n,i,r,o){if(Number.isFinite(t))return i[n]=e+(t-e)*o,!0;if("fill"===n){r||(r={});var a=r.fillColorArray,s=ah(e,null!=a?a:t,o,!1,(function(t,e){r.fillColorArray=e}));return s&&(i[n]=s),!0}if("stroke"===n){r||(r={});var l=r.strokeColorArray,h=ah(e,null!=l?l:t,o,!1,(function(t,e){r.strokeColorArray=e}));return h&&(i[n]=h),!0}if("shadowColor"===n){r||(r={});var u=r.shadowColorArray,c=ah(e,null!=u?u:t,o,!0,(function(t,e){r.shadowColorArray=e}));return c&&(i[n]=c),!0}return!1}},{key:"_interpolate",value:function(t,e,n,i,r){}},{key:"getDefaultAttribute",value:function(t){return Js(this)[this.type][t]}},{key:"getComputedAttribute",value:function(t){var e;return null!==(e=this.attribute[t])&&void 0!==e?e:this.getDefaultAttribute(t)}},{key:"onSetStage",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this._onSetStage=t,e&&this.stage&&t(this,this.stage)}},{key:"attachShadow",value:function(t){return t&&(t.shadowHost=this),this.shadowRoot=null!=t?t:as.graphicService.creator.shadowRoot(this),this.addUpdateBoundTag(),this.shadowRoot.setStage(this.stage,this.layer),this.shadowRoot}},{key:"detachShadow",value:function(){this.shadowRoot&&(this.addUpdateBoundTag(),this.shadowRoot=null)}},{key:"toJson",value:function(){return{attribute:this.attribute,_uid:this._uid,type:this.type,name:this.name,children:this.children.map((function(t){return t.toJson()}))}}},{key:"createPathProxy",value:function(t){return _r(t,!0)?this.pathProxy=(new Ba).fromString(t):this.pathProxy=new Ba,this.pathProxy}},{key:"loadImage",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(t){var n=t;this.resources||(this.resources=new Map);var i,r={data:"init",state:null};this.resources.set(n,r),"string"==typeof t?(r.state="loading",i=t,new RegExp(/^(http(s)?:\/\/)\w+[^\s]+(\.[^\s]+){1,}$/).test(i)||function(t){return new RegExp(/^data:image\/(?:gif|png|jpeg|bmp|webp)(?:;charset=utf-8)?;base64,(?:[A-Za-z0-9]|[+/])+={0,2}/g).test(t)}(t)?(uh.GetImage(t,this),this.backgroundImg=this.backgroundImg||e):t.startsWith("<svg")&&(uh.GetSvg(t,this),this.backgroundImg=this.backgroundImg||e)):(r.state="success",r.data=t,this.backgroundImg=this.backgroundImg||e)}}},{key:"imageLoadSuccess",value:function(t,e,n){if(this.resources){var i=this.resources.get(t);i&&(i.state="success",i.data=e,n&&n(),this.addUpdateBoundTag(),this.stage&&this.stage.renderNextFrame())}}},{key:"imageLoadFail",value:function(t,e){if(this.resources){var n=this.resources.get(t);n&&(n.state="fail",e&&e())}}},{key:"release",value:function(){this.releaseStatus="released"}},{key:"_emitCustomEvent",value:function(t,e){var n,i;if(this._events&&t in this._events){var r=new ml(t,e);r.bubbles=!1,r.manager=null===(i=null===(n=this.stage)||void 0===n?void 0:n.eventSystem)||void 0===i?void 0:i.manager,this.dispatchEvent(r)}}}],[{key:"mixin",value:function(t){for(var e=Object.keys(t),i=0;i<e.length;++i){var r=e[i];Object.defineProperty(n.prototype,r,Object.getOwnPropertyDescriptor(t,r))}}}]),n}(hl);function bh(t,e,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return t.expand(e+i+(n?function(t,e){return t?e:0}(n,e):0)),t}mh.mixin(_l);var wh=0;function Ch(){return wh++}var xh,_h=Ch(),Sh=Ch(),kh=Ch(),Ah=Ch(),Rh=Ch(),Bh=Ch(),Th=Ch(),Mh=Ch(),Ph=Ch(),Eh=Ch(),Hh=Ch(),Oh=Ch(),Lh=Ch(),Ih=Ch(),Dh=Ch(),Wh=Ch(),Fh=Symbol.for("GraphicService"),zh=Symbol.for("GraphicCreator");function jh(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=re(t);if(e){var r=re(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return ie(this,n)}}!function(t){t[t.LESS_GROUP=0]="LESS_GROUP",t[t.MORE_GROUP=1]="MORE_GROUP"}(xh||(xh={}));var Nh=function(t){ee(n,t);var e=jh(n);function n(t){var i;return Qt(this,n),(i=e.call(this,t)).type="group",i.parent=null,i.isContainer=!0,i.numberType=Bh,i._childUpdateTag=To.UPDATE_BOUNDS,i}return Jt(n,[{key:"setMode",value:function(t){"3d"===t?this.set3dMode():this.set2dMode()}},{key:"set3dMode",value:function(){this.in3dMode=!0}},{key:"set2dMode",value:function(){this.in3dMode=!1}},{key:"setTheme",value:function(t){return this.theme||(this.theme=new qs),this.theme.setTheme(t,this)}},{key:"createTheme",value:function(){this.theme||(this.theme=new qs)}},{key:"hideAll",value:function(){this.setAttribute("visible",!1),this.forEachChildren((function(t){t.isContainer&&t.hideAll?t.hideAll():t.setAttribute("visible",!1)}))}},{key:"showAll",value:function(){this.setAttribute("visible",!0),this.forEachChildren((function(t){t.isContainer&&t.showAll?t.showAll():t.setAttribute("visible",!0)}))}},{key:"containsPoint",value:function(t,e,n){if(n===Mo.GLOBAL){var i=new eo(t,e);return this.parent&&this.parent.globalTransMatrix.transformPoint(i,i),this.AABBBounds.contains(i.x,i.y)}return this.AABBBounds.contains(t,e)}},{key:"shouldUpdateAABBBounds",value:function(){return!!Yo(re(n.prototype),"shouldUpdateAABBBounds",this).call(this)||!!(this._childUpdateTag&To.UPDATE_BOUNDS)}},{key:"tryUpdateAABBBounds",value:function(){if(!this.shouldUpdateAABBBounds())return this._AABBBounds;as.graphicService.beforeUpdateAABBBounds(this,this.stage,!0,this._AABBBounds);var t=this.shouldSelfChangeUpdateAABBBounds(),e=this.doUpdateAABBBounds();return as.graphicService.afterUpdateAABBBounds(this,this.stage,this._AABBBounds,this,t),e}},{key:"doUpdateAABBBounds",value:function(){var t=this.attribute,e=Js(this).group;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);var n=as.graphicService.updateGroupAABBBounds(t,Js(this).group,this._AABBBounds,this),i=t.boundsPadding,r=void 0===i?e.boundsPadding:i,o=Gl(r);return o&&n.expand(o),this.parent&&this.parent.addChildUpdateBoundTag(),this.clearUpdateBoundTag(),this._emitCustomEvent("AAABBBoundsChange"),n}},{key:"clearUpdateBoundTag",value:function(){this._updateTag&=To.CLEAR_BOUNDS,this._childUpdateTag&=To.CLEAR_BOUNDS}},{key:"tryUpdateOBBBounds",value:function(){throw new Error("暂不支持")}},{key:"addUpdateBoundTag",value:function(){this._updateTag|=To.UPDATE_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag()}},{key:"addChildUpdateBoundTag",value:function(){this._childUpdateTag&To.UPDATE_BOUNDS||(this._childUpdateTag|=To.UPDATE_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag())}},{key:"getTheme",value:function(){return this.theme.getTheme(this)}},{key:"incrementalAppendChild",value:function(t){var e=Yo(re(n.prototype),"appendChild",this).call(this,t);return this.stage&&e&&(e.stage=this.stage,e.layer=this.layer),this.addUpdateBoundTag(),as.graphicService.onAddIncremental(t,this,this.stage),e}},{key:"incrementalClearChild",value:function(){Yo(re(n.prototype),"removeAllChild",this).call(this),this.addUpdateBoundTag(),as.graphicService.onClearIncremental(this,this.stage)}},{key:"appendChild",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=Yo(re(n.prototype),"appendChild",this).call(this,t);return e&&this.stage&&i&&i.setStage(this.stage,this.layer),this.addUpdateBoundTag(),i}},{key:"insertBefore",value:function(t,e){var i=Yo(re(n.prototype),"insertBefore",this).call(this,t,e);return this.stage&&i&&i.setStage(this.stage,this.layer),this.addUpdateBoundTag(),i}},{key:"insertAfter",value:function(t,e){var i=Yo(re(n.prototype),"insertAfter",this).call(this,t,e);return this.stage&&i&&i.setStage(this.stage,this.layer),this.addUpdateBoundTag(),i}},{key:"insertInto",value:function(t,e){var i=Yo(re(n.prototype),"insertInto",this).call(this,t,e);return this.stage&&i&&i.setStage(this.stage,this.layer),this.addUpdateBoundTag(),i}},{key:"removeChild",value:function(t){var e=Yo(re(n.prototype),"removeChild",this).call(this,t);return t.stage=null,as.graphicService.onRemove(t),this.addUpdateBoundTag(),e}},{key:"removeAllChild",value:function(){this.forEachChildren((function(t){as.graphicService.onRemove(t)})),Yo(re(n.prototype),"removeAllChild",this).call(this),this.addUpdateBoundTag()}},{key:"setStage",value:function(t,e){var n=this;this.stage!==t&&(this.stage=t,this.layer=e,this.setStageToShadowRoot(t,e),this._onSetStage&&this._onSetStage(this,t,e),as.graphicService.onSetStage(this,t),this.forEachChildren((function(e){e.setStage(t,n.layer)})))}},{key:"addUpdatePositionTag",value:function(){Yo(re(n.prototype),"addUpdatePositionTag",this).call(this),this.forEachChildren((function(t){t.isContainer&&t.addUpdateGlobalPositionTag()}))}},{key:"addUpdateGlobalPositionTag",value:function(){Yo(re(n.prototype),"addUpdateGlobalPositionTag",this).call(this),this.forEachChildren((function(t){t.isContainer&&t.addUpdateGlobalPositionTag()}))}},{key:"tryUpdateGlobalTransMatrix",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(this.shouldUpdateGlobalMatrix()){if(this._globalTransMatrix){if(this.parent){var e=this.parent.globalTransMatrix;this._globalTransMatrix.setValue(e.a,e.b,e.c,e.d,e.e,e.f)}}else this._globalTransMatrix=this.parent?this.parent.globalTransMatrix.clone():this.transMatrix.clone();this.doUpdateGlobalMatrix(),t&&this.clearUpdateGlobalPositionTag()}return this._globalTransMatrix}},{key:"shouldUpdateGlobalMatrix",value:function(){return!!(this._updateTag&To.UPDATE_GLOBAL_MATRIX)}},{key:"_getChildByName",value:function(t,e){return this.find((function(e){return e.name===t}),e)}},{key:"createOrUpdateChild",value:function(t,e,n){var i=this._getChildByName(t);return i?i.setAttributes(e):((i=as.graphicService.creator[n](e)).name=t,this.add(i)),i}},{key:"clone",value:function(){return new n(Object.assign({},this.attribute))}}]),n}(mh);function Gh(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=re(t);if(e){var r=re(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return ie(this,n)}}var Uh=Symbol.for("LayerHandlerContribution"),Kh=function(t){ee(n,t);var e=Gh(n);function n(t,i,r,o){var a,s;return Qt(this,n),(a=e.call(this,{})).stage=t,a.global=i,a.window=r,a.main=o.main,a.layerHandler=os.get(Uh),a.layerHandler.init(ne(a),r,{main:o.main,canvasId:o.canvasId,width:a.viewWidth,height:a.viewHeight,zIndex:null!==(s=o.zIndex)&&void 0!==s?s:0}),a.layer=ne(a),a.subLayers=new Map,a.theme=new qs,a.background="rgba(0, 0, 0, 0)",a}return Jt(n,[{key:"offscreen",get:function(){return this.layerHandler.offscreen}},{key:"width",get:function(){return this.stage?this.stage.width:0}},{key:"height",get:function(){return this.stage?this.stage.height:0}},{key:"viewWidth",get:function(){return this.stage?this.stage.viewWidth:0}},{key:"viewHeight",get:function(){return this.stage?this.stage.viewHeight:0}},{key:"dirtyBound",get:function(){throw new Error("暂不支持")}},{key:"dpr",get:function(){return this._dpr}},{key:"combineSubLayer",value:function(){var t=this,e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],n=Array.from(this.subLayers.values()).sort((function(t,e){return t.zIndex-e.zIndex}));this.layerHandler.merge(n.map((function(t){return t.layer.subLayers.size&&t.layer.combineSubLayer(e),t.layer.getNativeHandler()}))),e&&n.forEach((function(t){t.group&&(t.group.incremental=0)})),n.forEach((function(e){as.layerService.releaseLayer(t.stage,e.layer)})),this.subLayers.clear()}},{key:"getNativeHandler",value:function(){return this.layerHandler}},{key:"setStage",value:function(t,e){Yo(re(n.prototype),"setStage",this).call(this,t,this)}},{key:"pick",value:function(t,e){throw new Error("暂不支持")}},{key:"render",value:function(t,e){var n,i=this.stage;this.layerHandler.render([this],{renderService:t.renderService,x:i.x,y:i.y,width:this.viewWidth,height:this.viewHeight,stage:this.stage,layer:this,background:null!==(n=t.background)&&void 0!==n?n:this.background,updateBounds:t.updateBounds},e)}},{key:"resize",value:function(t,e){this.layerHandler.resize(t,e)}},{key:"resizeView",value:function(t,e){this.layerHandler.resizeView(t,e)}},{key:"setDpr",value:function(t){throw new Error("暂不支持")}},{key:"afterDraw",value:function(t){throw new Error("暂不支持")}},{key:"startAnimate",value:function(t){throw new Error("暂不支持")}},{key:"setToFrame",value:function(t){throw new Error("暂不支持")}},{key:"prepare",value:function(t,e){}},{key:"combineTo",value:function(t,e){var n;this.offscreen&&this.layerHandler.drawTo(t,[this],Object.assign({background:null!==(n=e.background)&&void 0!==n?n:this.background,renderService:e.renderService,x:this.stage.x,y:this.stage.y,width:this.viewWidth,height:this.viewHeight,stage:this.stage,layer:this},e))}},{key:"release",value:function(){var t=this;Yo(re(n.prototype),"release",this).call(this),this.layerHandler.release(),this.subLayers&&this.subLayers.forEach((function(e){as.layerService.releaseLayer(t.stage,e.layer)}))}},{key:"drawTo",value:function(t,e){var n;this.layerHandler.drawTo(t,[this],Object.assign({background:null!==(n=e.background)&&void 0!==n?n:this.background,renderService:e.renderService,x:this.stage.x,y:this.stage.y,width:this.viewWidth,height:this.viewHeight,stage:this.stage,layer:this},e))}}]),n}(Nh),Vh=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},Yh=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Xh=function(t,e){return function(n,i){e(n,i,t)}},$h=function(){function t(e){Qt(this,t),this.global=e,this.layerMap=new Map}return Jt(t,[{key:"getStageLayer",value:function(t){return this.layerMap.get(t)}},{key:"createLayer",value:function(t){var e=new Kh(t,this.global,t.window,{main:!1}),n=this.layerMap.get(t)||[];return n.push(e),this.layerMap.set(t,n),e}},{key:"releaseLayer",value:function(t,e){e.release();var n=this.layerMap.get(t)||[];this.layerMap.set(t,n.filter((function(t){return t!==e})))}},{key:"layerCount",value:function(t){return(this.layerMap.get(t)||[]).length}},{key:"restLayerCount",value:function(t){return"browser"===this.global.env?10:0}}]),t}();$h=Vh([Zi(),Xh(0,tr(Ke)),Yh("design:paramtypes",[Object])],$h);var qh=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},Zh=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Jh=function(t,e){return function(n,i){e(n,i,t)}},Qh=Symbol.for("Window"),tu=Symbol.for("WindowHandlerContribution"),eu=function(){function t(e){Qt(this,t),this.global=e,this.hooks={onChange:new sr(["x","y","width","height"])},this._uid=al.GenAutoIncrementId()}return Jt(t,[{key:"width",get:function(){if(this._handler){var t=this._handler.getWH();return this._width=t.width}return this._width}},{key:"height",get:function(){if(this._handler){var t=this._handler.getWH();return this._height=t.height}return this._height}},{key:"dpr",get:function(){return this._handler.getDpr()}},{key:"postInit",value:function(){var t=this;this.global.hooks.onSetEnv.tap("window",(function(){t.active()})),this.active()}},{key:"active",value:function(){var t=this.global;t.env&&!this.actived&&(os.getNamed(tu,t.env).configure(this,t),this.actived=!0)}},{key:"style",get:function(){return this._handler.getStyle()},set:function(t){this._handler.setStyle(t)}},{key:"create",value:function(t){this._handler.createWindow(t);var e=this._handler.getWH();this._width=e.width,this._height=e.height,this.title=this._handler.getTitle(),this.resizable=!0}},{key:"setWindowHandler",value:function(t){this._handler=t}},{key:"setDpr",value:function(t){return this._handler.setDpr(t)}},{key:"resize",value:function(t,e){return this._handler.resizeWindow(t,e)}},{key:"configure",value:function(){throw new Error("暂不支持")}},{key:"release",value:function(){return this._handler.releaseWindow()}},{key:"getContext",value:function(){return this._handler.getContext()}},{key:"getNativeHandler",value:function(){return this._handler.getNativeHandler()}},{key:"getImageBuffer",value:function(t){return this._handler.getImageBuffer?this._handler.getImageBuffer(t):null}},{key:"addEventListener",value:function(t,e,n){return this._handler.addEventListener(t,e,n)}},{key:"removeEventListener",value:function(t,e,n){return this._handler.removeEventListener(t,e,n)}},{key:"dispatchEvent",value:function(t){return this._handler.dispatchEvent(t)}},{key:"getBoundingClientRect",value:function(){return this._handler.getBoundingClientRect()}},{key:"getContainer",value:function(){return this._handler.container}},{key:"clearViewBox",value:function(t,e){this._handler.clearViewBox(t,e)}}]),t}();qh([rr(),Zh("design:type",Function),Zh("design:paramtypes",[]),Zh("design:returntype",void 0)],eu.prototype,"postInit",null),eu=qh([Zi(),Jh(0,tr(Ke)),Zh("design:paramtypes",[Object])],eu);var nu=Symbol.for("TransformUtil"),iu=Symbol.for("GraphicUtil"),ru=Symbol.for("LayerService"),ou=new Vi((function(t){t(pr).toSelf().inSingletonScope(),t(Ke).toService(pr),t(eu).to(eu),t(Qh).toService(eu),t(Ns).toSelf().inSingletonScope(),t(iu).toService(Ns),t(Us).toSelf().inSingletonScope(),t(nu).toService(Us),t($h).toSelf().inSingletonScope(),t(ru).toService($h)}));function au(t){return!!t}function su(t,e){return(Sr(t)?t.some((function(t){return t||void 0===t})):!!t)&&e>0}function lu(t,e){return t*e>0}function hu(t,e,n,i){return t*e>0&&n>0&&i>0}function uu(t,e){return t*e>0}function cu(t,e,n,i){return t*e>0&&n>0&&i>0}function du(t,e,n,i,r,o,a,s){if(!t.pathProxy)return!1;var l=Js(t,null==o?void 0:o.theme)[t.type],h=t.attribute,u=h.fill,c=void 0===u?l.fill:u,d=h.stroke,f=void 0===d?l.stroke:d,p=h.opacity,g=void 0===p?l.opacity:p,v=h.fillOpacity,y=void 0===v?l.fillOpacity:v,m=h.lineWidth,b=void 0===m?l.lineWidth:m,w=h.strokeOpacity,C=void 0===w?l.strokeOpacity:w,x=h.visible,_=void 0===x?l.visible:x,S=lu(g,y),k=uu(g,C),A=au(c),R=su(f,b);return!_||(!A&&!R||(!(S||k||a||s)||(e.beginPath(),Vo(("function"==typeof t.pathProxy?t.pathProxy(t.attribute):t.pathProxy).commandList,e,n,i),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,l),R&&(s?s(e,t.attribute,l):k&&(e.setStrokeStyle(t,t.attribute,n,i,l),e.stroke())),A&&(a?a(e,t.attribute,l):S&&(e.setCommonStyle(t,t.attribute,n,i,l),e.fill())),!0)))}function fu(t,e,n,i,r,o,a,s){var l=n-t,h=i-e,u=a-r,c=s-o,d=c*l-u*h;return d*d<Fr?[]:[t+(d=(u*(e-o)-c*(t-r))/d)*l,e+d*h]}function pu(t,e,n,i,r,o,a){var s=t-n,l=e-i,h=(a?o:-o)/Math.sqrt(s*s+l*l),u=h*l,c=-h*s,d=t+u,f=e+c,p=n+u,g=i+c,v=(d+p)/2,y=(f+g)/2,m=p-d,b=g-f,w=m*m+b*b,C=r-o,x=d*g-p*f,_=(b<0?-1:1)*Math.sqrt(Math.max(0,C*C*w-x*x)),S=(x*b-m*_)/w,k=(-x*m-b*_)/w,A=(x*b+m*_)/w,R=(-x*m+b*_)/w,B=S-v,T=k-y,M=A-v,P=R-y;return B*B+T*T>M*M+P*P&&(S=A,k=R),{cx:S,cy:k,x01:-u,y01:-c,x11:S*(r/C-1),y11:k*(r/C-1)}}function gu(t,e,n,i,r,o,a){var s=t.getParsedAngle(),l=s.startAngle,h=s.endAngle,u=Ur(h-l),c=h>l,d=!1;if(r<o){var f=r;r=o,o=f}if(r<=Fr)e.moveTo(n,i);else if(u>=Gr-Fr)e.moveTo(n+r*Vr(l),i+r*$r(l)),e.arc(n,i,r,l,h,!c),o>Fr&&(e.moveTo(n+o*Vr(h),i+o*$r(h)),e.arc(n,i,o,h,l,c));else{var p,g,v,y,m=t.getParsedCornerRadius(),b=t.getParsePadAngle(l,h),w=b.outerDeltaAngle,C=b.innerDeltaAngle,x=b.outerStartAngle,_=b.outerEndAngle,S=b.innerEndAngle,k=b.innerStartAngle,A=m,R=m,B=m,T=m,M=Math.max(R,A),P=Math.max(B,T),E=M,H=P,O=r*Vr(x),L=r*$r(x),I=o*Vr(S),D=o*$r(S);if((P>Fr||M>Fr)&&(p=r*Vr(_),g=r*$r(_),v=o*Vr(k),y=o*$r(k),u<zr)){var W=fu(O,L,v,y,p,g,I,D);if(W){var F=O-W[0],z=L-W[1],j=p-W[0],N=g-W[1],G=1/$r(Jr((F*j+z*N)/(qr(F*F+z*z)*qr(j*j+N*N)))/2),U=qr(W[0]*W[0]+W[1]*W[1]);H=Xr(P,(o-U)/(G-1)),E=Xr(M,(r-U)/(G+1))}}if(w<.001)a&&(a[3]||a[1])&&e.moveTo(n+O,i+L),d=!0;else if(E>Fr){var K=Xr(A,E),V=Xr(R,E),Y=pu(v,y,O,L,r,K,Number(c)),X=pu(p,g,I,D,r,V,Number(c));E<M&&K===V?!a||a[0]?(e.moveTo(n+Y.cx+Y.x01,i+Y.cy+Y.y01),e.arc(n+Y.cx,i+Y.cy,E,Kr(Y.y01,Y.x01),Kr(X.y01,X.x01),!c)):e.moveTo(n+Y.cx+E*Vr(Kr(X.y01,X.x01)),i+Y.cy+E*$r(Kr(X.y01,X.x01))):!a||a[0]?(e.moveTo(n+Y.cx+Y.x01,i+Y.cy+Y.y01),K>0&&e.arc(n+Y.cx,i+Y.cy,K,Kr(Y.y01,Y.x01),Kr(Y.y11,Y.x11),!c),e.arc(n,i,r,Kr(Y.cy+Y.y11,Y.cx+Y.x11),Kr(X.cy+X.y11,X.cx+X.x11),!c),V>0&&e.arc(n+X.cx,i+X.cy,V,Kr(X.y11,X.x11),Kr(X.y01,X.x01),!c)):V>0?e.moveTo(n+X.cx+V*Vr(Kr(X.y01,X.x01)),i+X.cy+V*$r(Kr(X.y01,X.x01))):e.moveTo(n+p,i+r*$r(_))}else a&&!a[0]||(e.moveTo(n+O,i+L),e.arc(n,i,r,x,_,!c));if(!(o>Fr)||C<.001)!a||a[1]?e.lineTo(n+I,i+D):e.moveTo(n+I,i+D),d=!0;else if(H>Fr){var $=Xr(T,H),q=Xr(B,H),Z=pu(I,D,p,g,o,-q,Number(c)),J=pu(O,L,v,y,o,-$,Number(c));if(!a||a[1]?e.lineTo(n+Z.cx+Z.x01,i+Z.cy+Z.y01):e.moveTo(n+Z.cx+Z.x01,i+Z.cy+Z.y01),H<P&&$===q){var Q=Kr(J.y01,J.x01);!a||a[2]?e.arc(n+Z.cx,i+Z.cy,H,Kr(Z.y01,Z.x01),Q,!c):e.moveTo(n+Z.cx+Vr(Q),i+Z.cy+$r(Q))}else!a||a[2]?(q>0&&e.arc(n+Z.cx,i+Z.cy,q,Kr(Z.y01,Z.x01),Kr(Z.y11,Z.x11),!c),e.arc(n,i,o,Kr(Z.cy+Z.y11,Z.cx+Z.x11),Kr(J.cy+J.y11,J.cx+J.x11),c),$>0&&e.arc(n+J.cx,i+J.cy,$,Kr(J.y11,J.x11),Kr(J.y01,J.x01),!c)):$>0?e.moveTo(n+J.cx+$*Vr(Kr(J.y01,J.x01)),i+J.cy+$*$r(Kr(J.y01,J.x01))):e.moveTo(n+v,i+y)}else!a||a[1]?e.lineTo(n+I,i+D):e.moveTo(n+I,i+D),!a||a[2]?e.arc(n,i,o,S,k,c):e.moveTo(n+o*Vr(k),i+o*$r(k))}return a?a[3]&&e.lineTo(n+r*Vr(h),i+r*Vr(h)):e.closePath(),d}var vu=function(){function t(){Qt(this,t)}return Jt(t,null,[{key:"GetCanvas",value:function(){try{return t.canvas||(t.canvas=as.global.createCanvas({})),t.canvas}catch(t){return null}}},{key:"GetCtx",value:function(){if(!t.ctx){var e=t.GetCanvas();t.ctx=e.getContext("2d")}return t.ctx}}]),t}(),yu=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:100;Qt(this,t);var i=vu.GetCanvas(),r=vu.GetCtx();if(i.width=n,i.height=1,r){if(r.translate(0,0),!r)throw new Error("获取ctx发生错误");var o=r.createLinearGradient(0,0,n,0);e.forEach((function(t){o.addColorStop(t[0],t[1])})),r.fillStyle=o,r.fillRect(0,0,n,1),this.rgbaSet=r.getImageData(0,0,n,1).data}}return Jt(t,[{key:"getColor",value:function(t){var e=this.rgbaSet.slice(4*t,4*t+4);return"rgba(".concat(e[0],", ").concat(e[1],", ").concat(e[2],", ").concat(e[3]/255,")")}}],[{key:"GetOrCreate",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:100,i="";e.forEach((function(t){return i+=t.join()})),i+=n;var r=t.dataMap.get(i);return r||(r=new t(e,n),t.dataMap.set(i,r)),r}},{key:"SetColorInterpolateInstance",value:function(e,n){t.dataMap.set(e,n)}},{key:"GetColorInterpolateInstance",value:function(e){return t.dataMap.get(e)}}]),t}();yu.dataMap=new Map;var mu=function(){function t(){Qt(this,t)}return Jt(t,null,[{key:"GetSize",value:function(e){for(var n=0;n<t.ImageSize.length;n++)if(t.ImageSize[n]>=e)return t.ImageSize[n];return e}},{key:"Get",value:function(e,n,i,r,o,a,s){var l=t.GenKey(e,n,i,r,o),h=t.cache[l];if(!h||0===h.length)return null;for(var u=0;u<h.length;u++)if(h[u].width>=a&&h[u].height>=s)return h[u].imageData;return null}},{key:"Set",value:function(e,n,i,r,o,a,s,l){var h=t.GenKey(e,n,i,r,o);t.cache[h]?t.cache[h].push({width:s,height:l,imageData:a}):t.cache[h]=[{width:s,height:l,imageData:a}]}},{key:"GenKey",value:function(t,e,n,i,r){return"".concat(e,",").concat(n,",").concat(i,",").concat(r,",").concat(t.join())}}]),t}();function bu(t,e,n){var i=e,r=t.currentMatrix,o=r.a,a=r.b,s=r.c,l=r.d,h=Math.sign(o)*Math.sqrt(o*o+a*a),u=Math.sign(l)*Math.sqrt(s*s+l*l);return h+u===0?0:i=i/Math.abs(h+u)*2*n}function wu(t,e,n,i,r){if(!e||!0===e)return"black";var o,a;if(Sr(e))for(var s=0;s<e.length&&!(a=e[s]);s++);else a=e;return"string"==typeof a?a:("linear"===a.gradient?o=function(t,e,n){var i,r,o,a,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,l=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,h=n.AABBBounds;if(!h)return;var u=h.x2-h.x1,c=h.y2-h.y1,d=h.x1-s,f=h.y1-l;if(n.attribute){var p=n.attribute,g=p.scaleX,v=void 0===g?1:g,y=p.scaleY,m=void 0===y?1:y;if(v*m==0)return;u/=v,c/=m,d/=v,f/=m}var b=t.createLinearGradient(d+(null!==(i=e.x0)&&void 0!==i?i:0)*u,f+(null!==(r=e.y0)&&void 0!==r?r:0)*c,d+(null!==(o=e.x1)&&void 0!==o?o:1)*u,f+(null!==(a=e.y1)&&void 0!==a?a:0)*c);return e.stops.forEach((function(t){b.addColorStop(t.offset,t.color)})),b}(t,a,n,i,r):"conical"===a.gradient?o=function(t,e,n){var i,r,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,s=n.AABBBounds;if(!s)return;var l=s.x2-s.x1,h=s.y2-s.y1,u=s.x1-o,c=s.y1-a;if(n.attribute){var d=n.attribute,f=d.scaleX,p=void 0===f?1:f,g=d.scaleY,v=void 0===g?1:g;if(p*v==0)return;l/=p,h/=v,u/=p,c/=v}var y=t.createConicGradient(u+(null!==(i=e.x)&&void 0!==i?i:0)*l,c+(null!==(r=e.y)&&void 0!==r?r:0)*h,e.startAngle,e.endAngle);return e.stops.forEach((function(t){y.addColorStop(t.offset,t.color)})),y.GetPattern(l+u,h+c,void 0)}(t,a,n,i,r):"radial"===a.gradient&&(o=function(t,e,n){var i,r,o,a,s,l,h=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,u=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,c=n.AABBBounds;if(!c)return;var d=c.x2-c.x1,f=c.y2-c.y1,p=c.x1-h,g=c.y1-u;if(n.attribute){var v=n.attribute,y=v.scaleX,m=void 0===y?1:y,b=v.scaleY,w=void 0===b?1:b;if(m*w==0)return;p/=m,g/=w,d/=m,f/=w}var C=t.createRadialGradient(p+(null!==(i=e.x0)&&void 0!==i?i:.5)*d,g+(null!==(r=e.y0)&&void 0!==r?r:.5)*f,Math.max(d,f)*(null!==(o=e.r0)&&void 0!==o?o:0),p+(null!==(a=e.x1)&&void 0!==a?a:.5)*d,g+(null!==(s=e.y1)&&void 0!==s?s:.5)*f,Math.max(d,f)*(null!==(l=e.r1)&&void 0!==l?l:.5));return e.stops.forEach((function(t){C.addColorStop(t.offset,t.color)})),C}(t,a,n,i,r)),o||"orange")}function Cu(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=re(t);if(e){var r=re(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return ie(this,n)}}mu.cache={},mu.ImageSize=[20,40,80,160,320,640,1280,2560];var xu=["radius","startAngle","endAngle"].concat(Wt(fh)),_u=function(t){ee(n,t);var e=Cu(n);function n(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{radius:1};return Qt(this,n),(t=e.call(this,i)).type="circle",t.numberType=Ah,t}return Jt(n,[{key:"isValid",value:function(){return Yo(re(n.prototype),"isValid",this).call(this)&&this._isValid()}},{key:"_isValid",value:function(){var t=this.attribute,e=t.startAngle,n=t.endAngle,i=t.radius;return this._validNumber(e)&&this._validNumber(n)&&this._validNumber(i)}},{key:"doUpdateAABBBounds",value:function(t){var e=Js(this).circle;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);var n=this.attribute,i=as.graphicService.updateCircleAABBBounds(n,Js(this).circle,this._AABBBounds,t,this),r=n.boundsPadding,o=void 0===r?e.boundsPadding:r,a=Gl(o);return a&&i.expand(a),this.clearUpdateBoundTag(),i}},{key:"tryUpdateOBBBounds",value:function(){throw new Error("暂不支持")}},{key:"getDefaultAttribute",value:function(t){return Js(this).circle[t]}},{key:"needUpdateTags",value:function(t){for(var e=0;e<xu.length;e++){var n=xu[e];if(-1!==t.indexOf(n))return!0}return!1}},{key:"needUpdateTag",value:function(t){for(var e=0;e<xu.length;e++)if(t===xu[e])return!0;return!1}},{key:"toCustomPath",value:function(){var t,e,n,i=this.attribute,r=null!==(t=i.radius)&&void 0!==t?t:this.getDefaultAttribute("radius"),o=null!==(e=i.startAngle)&&void 0!==e?e:this.getDefaultAttribute("startAngle"),a=null!==(n=i.endAngle)&&void 0!==n?n:this.getDefaultAttribute("endAngle"),s=new Ba;return s.arc(0,0,r,o,a),s}},{key:"clone",value:function(){return new n(Object.assign({},this.attribute))}}]),n}(mh);function Su(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.fontStyle,i=void 0===n?e.fontStyle:n,r=t.fontVariant,o=void 0===r?e.fontVariant:r,a=t.fontWeight,s=void 0===a?e.fontWeight:a,l=t.fontSize,h=void 0===l?e.fontSize:l,u=t.fontFamily;return(i?i+" ":"")+(o?o+" ":"")+(s?s+" ":"")+1*h+"px "+((void 0===u?e.fontFamily:u)||"sans-serif")}function ku(t,e){return"end"===t||"right"===t?-e:"center"===t?-e/2:0}function Au(t,e,n){return"middle"===t?-e/2:"top"===t?0:"bottom"===t?-e:t&&"alphabetic"!==t?0:(n||(n=e),-(e-n)/2-.79*n)}var Ru=function(){function t(e,n,i){Qt(this,t),this.fontFamily=e,this.textOptions=n,this.textMeasure=i}return Jt(t,[{key:"LayoutBBox",value:function(t,e,n){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"===n?0:"middle"===n?t.height/-2:"alphabetic"===n?-.79*t.height:-t.height,t}},{key:"GetLayout",value:function(t,e,n,i,r,o,a,s){for(var l=[],h=[e,n],u=[0,0];t.length>0;){var c=this.textMeasure.clipTextWithSuffix(t,this.textOptions,e,a).str;l.push({str:c,width:this.textMeasure.measureTextWidth(c,this.textOptions)}),t=t.substring(c.length)}"left"===i||"start"===i||("center"===i?u[0]=h[0]/-2:"right"!==i&&"end"!==i||(u[0]=-h[0])),"top"===r||("middle"===r?u[1]=h[1]/-2:"bottom"===r&&(u[1]=-h[1]));var d={xOffset:u[0],yOffset:u[1],width:h[0],height:h[1]};return this.layoutWithBBox(d,l,i,r,o)}},{key:"GetLayoutByLines",value:function(t,e,n,i){var r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"",o=arguments.length>5?arguments[5]:void 0;t=t.map((function(t){return t.toString()}));var a=[],s=[0,0];if("number"==typeof o&&o!==1/0){for(var l,h=0,u=t.length;h<u;h++)l=Math.min(this.textMeasure.measureTextWidth(t[h],this.textOptions),o),a.push({str:this.textMeasure.clipTextWithSuffix(t[h],this.textOptions,l,r).str,width:l});s[0]=o}else{var c,d;o=0;for(var f=0,p=t.length;f<p;f++)d=t[f],c=this.textMeasure.measureTextWidth(d,this.textOptions),o=Math.max(o,c),a.push({str:d,width:c});s[0]=o}s[1]=a.length*i;var g={xOffset:0,yOffset:0,width:s[0],height:s[1]};return this.LayoutBBox(g,e,n),this.layoutWithBBox(g,a,e,n,i)}},{key:"layoutWithBBox",value:function(t,e,n,i,r){var o=[0,0],a=e.length*r;"top"===i||("middle"===i?o[1]=(t.height-a)/2:"bottom"===i&&(o[1]=t.height-a));for(var s=0;s<e.length;s++)this.lineOffset(t,e[s],n,i,r,o);return{bbox:t,lines:e,fontFamily:this.fontFamily,fontSize:this.textOptions.fontSize,fontWeight:this.textOptions.fontWeight,lineHeight:r,textAlign:n,textBaseline:i}}},{key:"lineOffset",value:function(t,e,n,i,r,o){return"left"===n||"start"===n?e.leftOffset=0:"center"===n?e.leftOffset=(t.width-e.width)/2:"right"!==n&&"end"!==n||(e.leftOffset=t.width-e.width),e.topOffset=(r-this.textOptions.fontSize)/2+.79*this.textOptions.fontSize+o[1],o[1]+=r,e}}]),t}();function Bu(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=re(t);if(e){var r=re(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return ie(this,n)}}var Tu=["text","maxLineWidth","fontSize","fontFamily","fontWeight","ellipsis","lineHeight"].concat(Wt(fh)),Mu=function(t){ee(n,t);var e=Bu(n);function n(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{text:"",fontSize:16};return Qt(this,n),(t=e.call(this,i)).type="text",t.numberType=Wh,t.cache={},t}return Jt(n,[{key:"font",get:function(){var t=Js(this).text;return this._font||(this._font=Su(this.attribute,t)),this._font}},{key:"clipedText",get:function(){var t,e=this.attribute,n=Js(this).text;if(!Array.isArray(e.text)){var i=e.maxLineWidth,r=void 0===i?n.maxLineWidth:i;return Number.isFinite(r)?(this.tryUpdateAABBBounds(),this.cache.clipedText):(null!==(t=e.text)&&void 0!==t?t:n.text).toString()}}},{key:"clipedWidth",get:function(){if(!Array.isArray(this.attribute.text))return this.tryUpdateAABBBounds(),this.cache.clipedWidth}},{key:"cliped",get:function(){var t=Js(this).text,e=this.attribute;if(!Array.isArray(e.text)){var n=e.maxLineWidth,i=void 0===n?t.maxLineWidth:n;return!!Number.isFinite(i)&&(this.tryUpdateAABBBounds(),this.clipedText===e.text)}}},{key:"multilineLayout",get:function(){if(Array.isArray(this.attribute.text))return this.tryUpdateAABBBounds(),this.cache.layoutData}},{key:"isValid",value:function(){return Yo(re(n.prototype),"isValid",this).call(this)&&this._isValid()}},{key:"_isValid",value:function(){var t=this.attribute.text;return null!=t&&""!==t}},{key:"doUpdateAABBBounds",value:function(){var t=Js(this).text;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);var e=this.attribute,n=as.graphicService.updateTextAABBBounds(e,t,this._AABBBounds,this),i=this.attribute.boundsPadding,r=void 0===i?t.boundsPadding:i,o=Gl(r);return o&&n.expand(o),this.clearUpdateBoundTag(),n}},{key:"updateSingallineAABBBounds",value:function(t){var e,n,i,r=Js(this).text,o=as.graphicUtil.textMeasure,a=this.attribute,s=a.maxLineWidth,l=void 0===s?r.maxLineWidth:s,h=a.ellipsis,u=void 0===h?r.ellipsis:h,c=a.textAlign,d=void 0===c?r.textAlign:c,f=a.textBaseline,p=void 0===f?r.textBaseline:f,g=a.fontSize,v=void 0===g?r.fontSize:g,y=a.stroke,m=void 0===y?r.stroke:y,b=a.lineHeight,w=void 0===b?null!==(e=a.lineHeight)&&void 0!==e?e:(a.fontSize||r.fontSize)+2:b,C=a.lineWidth,x=void 0===C?r.lineWidth:C;if(!this.shouldUpdateShape()&&this.cache){var _=ku(d,n=this.cache.clipedWidth),S=Au(p,w,v);return this._AABBBounds.set(_,S,_+n,S+w),m&&this._AABBBounds.expand(x/2),this._AABBBounds}if(Number.isFinite(l)){if(u){var k=!0===u?r.ellipsis:u,A=o.clipTextWithSuffix(t.toString(),{fontSize:v},l,k);i=A.str,n=A.width}else{var R=o.clipText(t.toString(),{fontSize:v},l);i=R.str,n=R.width}this.cache.clipedText=i,this.cache.clipedWidth=n}else n=o.measureTextWidth(t.toString(),{fontSize:v}),this.cache.clipedText=t.toString(),this.cache.clipedWidth=n;this.clearUpdateShapeTag();var B=ku(d,n),T=Au(p,w,v);return this._AABBBounds.set(B,T,B+n,T+w),m&&this._AABBBounds.expand(x/2),this._AABBBounds}},{key:"updateMultilineAABBBounds",value:function(t){var e,n=Js(this).text,i=this.attribute,r=i.fontFamily,o=void 0===r?n.fontFamily:r,a=i.textAlign,s=void 0===a?n.textAlign:a,l=i.textBaseline,h=void 0===l?n.textBaseline:l,u=i.fontSize,c=void 0===u?n.fontSize:u,d=i.lineHeight,f=void 0===d?i.lineHeight||i.fontSize||n.fontSize:d,p=i.ellipsis,g=void 0===p?n.ellipsis:p,v=i.maxLineWidth,y=i.stroke,m=void 0===y?n.stroke:y,b=i.lineWidth,w=void 0===b?n.lineWidth:b;if(!this.shouldUpdateShape()&&(null===(e=this.cache)||void 0===e?void 0:e.layoutData)){var C=this.cache.layoutData.bbox;return this._AABBBounds.set(C.xOffset,C.yOffset,C.xOffset+C.width,C.yOffset+C.height),m&&this._AABBBounds.expand(w/2),this._AABBBounds}var x=as.graphicUtil.textMeasure,_=new Ru(o,{fontSize:c},x).GetLayoutByLines(t,s,h,f,!0===g?n.ellipsis:g||void 0,v),S=_.bbox;return this.cache.layoutData=_,this.clearUpdateShapeTag(),this._AABBBounds.set(S.xOffset,S.yOffset,S.xOffset+S.width,S.yOffset+S.height),m&&this._AABBBounds.expand(w/2),this._AABBBounds}},{key:"tryUpdateOBBBounds",value:function(){throw new Error("暂不支持")}},{key:"getDefaultAttribute",value:function(t){return Js(this).text[t]}},{key:"needUpdateTags",value:function(t){for(var e=0;e<Tu.length;e++){var n=Tu[e];if(-1!==t.indexOf(n))return!0}return!1}},{key:"needUpdateTag",value:function(t){for(var e=0;e<Tu.length;e++)if(t===Tu[e])return!0;return!1}},{key:"clone",value:function(){return new n(Object.assign({},this.attribute))}}]),n}(mh);function Pu(t,e,n,i,r){return r?t.arc(n,i,e,0,Nr,!1,r):t.arc(n,i,e,0,Nr),!1}var Eu=function(){function t(){Qt(this,t),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"}return Jt(t,[{key:"draw",value:function(t,e,n,i,r){return Pu(t,e/2,n,i,r)}},{key:"drawOffset",value:function(t,e,n,i,r,o){return Pu(t,e/2+r,n,i,o)}},{key:"bounds",value:function(t,e){var n=t/2;e.x1=-n,e.x2=n,e.y1=-n,e.y2=n}}]),t}(),Hu=new Eu;var Ou=function(){function t(){Qt(this,t),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"}return Jt(t,[{key:"draw",value:function(t,e,n,i,r){return function(t,e,n,i,r){return t.moveTo(-3*e+n,-e+i,r),t.lineTo(-e+n,-e+i,r),t.lineTo(-e+n,-3*e+i,r),t.lineTo(e+n,-3*e+i,r),t.lineTo(e+n,-e+i,r),t.lineTo(3*e+n,-e+i,r),t.lineTo(3*e+n,e+i,r),t.lineTo(e+n,e+i,r),t.lineTo(e+n,3*e+i,r),t.lineTo(-e+n,3*e+i,r),t.lineTo(-e+n,e+i,r),t.lineTo(-3*e+n,e+i,r),t.closePath(),!0}(t,e/6,n,i,r)}},{key:"drawOffset",value:function(t,e,n,i,r,o){return function(t,e,n,i,r,o){return t.moveTo(-3*e+n-r,-e+i-r,o),t.lineTo(-e+n-r,-e+i-r,o),t.lineTo(-e+n-r,-3*e+i-r,o),t.lineTo(e+n+r,-3*e+i-r,o),t.lineTo(e+n+r,-e+i-r,o),t.lineTo(3*e+n+r,-e+i-r,o),t.lineTo(3*e+n+r,e+i+r,o),t.lineTo(e+n+r,e+i+r,o),t.lineTo(e+n+r,3*e+i+r,o),t.lineTo(-e+n-r,3*e+i+r,o),t.lineTo(-e+n-r,e+i+r,o),t.lineTo(-3*e+n-r,e+i+r,o),t.closePath(),!0}(t,e/6,n,i,r,o)}},{key:"bounds",value:function(t,e){var n=t/2;e.x1=-n,e.x2=n,e.y1=-n,e.y2=n}}]),t}(),Lu=new Ou;function Iu(t,e,n,i,r){return t.moveTo(n,i-e,r),t.lineTo(e+n,i,r),t.lineTo(n,i+e,r),t.lineTo(n-e,i,r),t.closePath(),!0}var Du=function(){function t(){Qt(this,t),this.type="diamond",this.pathStr="M-0.5,0L0,-0.5L0.5,0L0,0.5Z"}return Jt(t,[{key:"draw",value:function(t,e,n,i,r){return Iu(t,e/2,n,i,r)}},{key:"drawFitDir",value:function(t,e,n,i,r){return Iu(t,e/2,n,i,r)}},{key:"drawOffset",value:function(t,e,n,i,r,o){return Iu(t,e/2+r,n,i,o)}},{key:"bounds",value:function(t,e){var n=t/2;e.x1=-n,e.x2=n,e.y1=-n,e.y2=n}}]),t}(),Wu=new Du;function Fu(t,e,n,i){var r=2*e;return t.rect(n-e,i-e,r,r),!1}var zu=function(){function t(){Qt(this,t),this.type="square",this.pathStr="M-0.5,-0.5h1v1h-1Z"}return Jt(t,[{key:"draw",value:function(t,e,n,i){return Fu(t,e/2,n,i)}},{key:"drawOffset",value:function(t,e,n,i,r){return Fu(t,e/2+r,n,i)}},{key:"bounds",value:function(t,e){var n=t/2;e.x1=-n,e.x2=n,e.y1=-n,e.y2=n}}]),t}(),ju=new zu;var Nu=function(){function t(){Qt(this,t),this.type="triangleUp",this.pathStr="M0.5,0.5 L-0.5,0.5 L0,-0.5 Z"}return Jt(t,[{key:"draw",value:function(t,e,n,i){return function(t,e,n,i){return t.moveTo(n+e,e+i),t.lineTo(n-e,e+i),t.lineTo(n,i-e),t.closePath(),!0}(t,e/2,n,i)}},{key:"drawOffset",value:function(t,e,n,i,r){return function(t,e,n,i,r){return t.moveTo(n+e+2*r,e+i+r),t.lineTo(n-e-2*r,e+i+r),t.lineTo(n,i-e-2*r),t.closePath(),!0}(t,e/2,n,i,r)}},{key:"bounds",value:function(t,e){var n=t/2;e.x1=-n,e.x2=n,e.y1=-n,e.y2=n}}]),t}(),Gu=new Nu;function Uu(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=re(t);if(e){var r=re(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return ie(this,n)}}var Ku=function(t){ee(n,t);var e=Uu(n);function n(){var t;return Qt(this,n),(t=e.apply(this,arguments)).type="triangle",t}return Jt(n)}(Nu),Vu=new Ku,Yu=Math.sin(Math.PI/10)/Math.sin(7*Math.PI/10),Xu=Math.sin(Nr/10)*Yu,$u=-Math.cos(Nr/10)*Yu;function qu(t,e,n,i){var r=Xu*e,o=$u*e;t.moveTo(n,-e+i),t.lineTo(r+n,o+i);for(var a=1;a<5;++a){var s=Nr*a/5,l=Math.cos(s),h=Math.sin(s);t.lineTo(h*e+n,-l*e+i),t.lineTo(l*r-h*o+n,h*r+l*o+i)}return t.closePath(),!0}var Zu=function(){function t(){Qt(this,t),this.type="star",this.pathStr="M4.51351666838205,0A4.51351666838205,4.51351666838205,0,1,1,-4.51351666838205,0A4.51351666838205,4.51351666838205,0,1,1,4.51351666838205,0"}return Jt(t,[{key:"draw",value:function(t,e,n,i){return qu(t,e/2,n,i)}},{key:"drawOffset",value:function(t,e,n,i,r){return qu(t,e/2+r,n,i)}},{key:"bounds",value:function(t,e){var n=t/2;e.x1=-n,e.x2=n,e.y1=-n,e.y2=n}}]),t}(),Ju=new Zu,Qu=qr(3);function tc(t,e,n,i){var r=e,o=r/Qu,a=o/5,s=e;return t.moveTo(0+n,-r+i),t.lineTo(o/2+n,i),t.lineTo(a/2+n,i),t.lineTo(a/2+n,s+i),t.lineTo(-a/2+n,s+i),t.lineTo(-a/2+n,i),t.lineTo(-o/2+n,i),t.closePath(),!0}var ec=function(){function t(){Qt(this,t),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"}return Jt(t,[{key:"draw",value:function(t,e,n,i){return tc(t,e/2,n,i)}},{key:"drawOffset",value:function(t,e,n,i,r){return tc(t,e/2+r,n,i)}},{key:"bounds",value:function(t,e){var n=t/2;e.x1=-n,e.x2=n,e.y1=-n,e.y2=n}}]),t}(),nc=new ec;function ic(t,e,n,i){var r=2*e;return t.moveTo(n,-e+i),t.lineTo(r/3/2+n,e+i),t.lineTo(-r/3/2+n,e+i),t.closePath(),!0}var rc=function(){function t(){Qt(this,t),this.type="wedge",this.pathStr="M0,-0.5773502691896257L-0.125,0.28867513459481287L0.125,0.28867513459481287Z"}return Jt(t,[{key:"draw",value:function(t,e,n,i){return ic(t,e/2,n,i)}},{key:"drawOffset",value:function(t,e,n,i,r){return ic(t,e/2+r,n,i)}},{key:"bounds",value:function(t,e){var n=t/2;e.x1=-n,e.x2=n,e.y1=-n,e.y2=n}}]),t}(),oc=new rc;function ac(t,e,n,i){return t.moveTo(-e+n,i),t.lineTo(n,e+i),!1}var sc=function(){function t(){Qt(this,t),this.type="stroke",this.pathStr=""}return Jt(t,[{key:"draw",value:function(t,e,n,i){return ac(t,e/2,n,i)}},{key:"drawOffset",value:function(t,e,n,i,r){return ac(t,e/2+r,n,i)}},{key:"bounds",value:function(t,e){var n=t/2;e.x1=-n,e.x2=n,e.y1=-n,e.y2=n}}]),t}(),lc=new sc,hc=-.5,uc=qr(3)/2,cc=1/qr(12);function dc(t,e,n,i){var r=e/2,o=e*cc,a=r,s=e*cc+e,l=-a,h=s;return t.moveTo(r+n,o+i),t.lineTo(a+n,s+i),t.lineTo(l+n,h+i),t.lineTo(hc*r-uc*o+n,uc*r+hc*o+i),t.lineTo(hc*a-uc*s+n,uc*a+hc*s+i),t.lineTo(hc*l-uc*h+n,uc*l+hc*h+i),t.lineTo(hc*r+uc*o+n,hc*o-uc*r+i),t.lineTo(hc*a+uc*s+n,hc*s-uc*a+i),t.lineTo(hc*l+uc*h+n,hc*h-uc*l+i),t.closePath(),!1}var fc=function(){function t(){Qt(this,t),this.type="wye",this.pathStr="M4.51351666838205,0A4.51351666838205,4.51351666838205,0,1,1,-4.51351666838205,0A4.51351666838205,4.51351666838205,0,1,1,4.51351666838205,0"}return Jt(t,[{key:"draw",value:function(t,e,n,i){return dc(t,e/2,n,i)}},{key:"drawOffset",value:function(t,e,n,i,r){return dc(t,e/2+r,n,i)}},{key:"bounds",value:function(t,e){var n=t/2;e.x1=-n,e.x2=n,e.y1=-n,e.y2=n}}]),t}(),pc=new fc;var gc=function(){function t(){Qt(this,t),this.type="triangleLeft",this.pathStr="M-0.5,0 L0.5,0.5 L0.5,-0.5 Z"}return Jt(t,[{key:"draw",value:function(t,e,n,i){return function(t,e,n,i){return t.moveTo(-e+n,i),t.lineTo(e+n,e+i),t.lineTo(e+n,i-e),t.closePath(),!0}(t,e/2,n,i)}},{key:"drawOffset",value:function(t,e,n,i,r){return function(t,e,n,i,r){return t.moveTo(-e+n-2*r,i),t.lineTo(e+n+r,e+i+2*r),t.lineTo(e+n+r,i-e-2*r),t.closePath(),!0}(t,e/2,n,i,r)}},{key:"bounds",value:function(t,e){var n=t/2;e.x1=-n,e.x2=n,e.y1=-n,e.y2=n}}]),t}(),vc=new gc;var yc=function(){function t(){Qt(this,t),this.type="triangleRight",this.pathStr="M-0.5,0.5 L0.5,0 L-0.5,-0.5 Z"}return Jt(t,[{key:"draw",value:function(t,e,n,i){return function(t,e,n,i){return t.moveTo(n-e,e+i),t.lineTo(e+n,i),t.lineTo(n-e,i-e),t.closePath(),!0}(t,e/2,n,i)}},{key:"drawOffset",value:function(t,e,n,i,r){return function(t,e,n,i,r){return t.moveTo(n-e-r,e+i+2*r),t.lineTo(e+n+2*r,i),t.lineTo(n-e-r,i-e-2*r),t.closePath(),!0}(t,e/2,n,i,r)}},{key:"bounds",value:function(t,e){var n=t/2;e.x1=-n,e.x2=n,e.y1=-n,e.y2=n}}]),t}(),mc=new yc;var bc=function(){function t(){Qt(this,t),this.type="triangleDown",this.pathStr="M-0.5,-0.5 L0.5,-0.5 L0,0.5 Z"}return Jt(t,[{key:"draw",value:function(t,e,n,i){return function(t,e,n,i){return t.moveTo(n-e,i-e),t.lineTo(n+e,i-e),t.lineTo(n,i+e),t.closePath(),!0}(t,e/2,n,i)}},{key:"drawOffset",value:function(t,e,n,i,r){return function(t,e,n,i,r){return t.moveTo(n-e-2*r,i-e-r),t.lineTo(n+e+2*r,i-e-r),t.lineTo(n,i+e+2*r),t.closePath(),!0}(t,e/2,n,i,r)}},{key:"bounds",value:function(t,e){var n=t/2;e.x1=-n,e.x2=n,e.y1=-n,e.y2=n}}]),t}(),wc=new bc;function Cc(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=re(t);if(e){var r=re(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return ie(this,n)}}var xc=qr(3);function _c(t,e,n,i){var r=e*xc;return t.moveTo(n,i+-r/3*2),t.lineTo(e+n,i+r),t.lineTo(n-e,i+r),t.closePath(),!0}var Sc=function(t){ee(n,t);var e=Cc(n);function n(){var t;return Qt(this,n),(t=e.apply(this,arguments)).type="thinTriangle",t.pathStr="M0,-0.5773502691896257L-0.5,0.28867513459481287L0.5,0.28867513459481287Z",t}return Jt(n,[{key:"draw",value:function(t,e,n,i){return _c(t,e/2/xc,n,i)}},{key:"drawOffset",value:function(t,e,n,i,r){return _c(t,e/2/xc+r,n,i)}},{key:"bounds",value:function(t,e){var n=t/2;e.x1=-n,e.x2=n,e.y1=-n,e.y2=n}}]),n}(Nu),kc=new Sc;function Ac(t,e,n,i){var r=2*e;return t.moveTo(e+n,i-r),t.lineTo(n-e,i),t.lineTo(e+n,r+i),!0}var Rc=function(){function t(){Qt(this,t),this.type="arrow2Left",this.pathStr="M 0.25 -0.5 L -0.25 0 l 0.5 0.5"}return Jt(t,[{key:"draw",value:function(t,e,n,i){return Ac(t,e/4,n,i)}},{key:"drawOffset",value:function(t,e,n,i,r){return Ac(t,e/4+r,n,i)}},{key:"bounds",value:function(t,e){var n=t/2;e.x1=-n,e.x2=n,e.y1=-n,e.y2=n}}]),t}(),Bc=new Rc;function Tc(t,e,n,i){var r=2*e;return t.moveTo(n-e,i-r),t.lineTo(n+e,i),t.lineTo(n-e,r+i),!0}var Mc=function(){function t(){Qt(this,t),this.type="arrow2Right",this.pathStr="M -0.25 -0.5 l 0.5 0.5 l -0.5 0.5"}return Jt(t,[{key:"draw",value:function(t,e,n,i){return Tc(t,e/4,n,i)}},{key:"drawOffset",value:function(t,e,n,i,r){return Tc(t,e/4+r,n,i)}},{key:"bounds",value:function(t,e){var n=t/2;e.x1=-n,e.x2=n,e.y1=-n,e.y2=n}}]),t}(),Pc=new Mc;function Ec(t,e,n,i){return t.rect(n-e[0]/2,i-e[1]/2,e[0],e[1]),!1}var Hc=function(){function t(){Qt(this,t),this.type="rect",this.pathStr="M-0.5,-0.5h1v1h-1Z"}return Jt(t,[{key:"draw",value:function(t,e,n,i){return Ec(t,Ar(e)?[e,e]:e,n,i)}},{key:"drawOffset",value:function(t,e,n,i,r){return Ec(t,Ar(e)?[e+2*r,e+2*r]:[e[0]+2*r,e[1]+2*r],n,i)}},{key:"bounds",value:function(t,e){var n=Ar(t)?[t,t]:t;e.x1=-n[0]/2,e.x2=n[0]/2,e.y1=-n[1]/2,e.y2=n[1]/2}}]),t}(),Oc=new Hc,Lc=function(){function t(e,n){Qt(this,t),this.pathStr="",this.type=e,this.path=n}return Jt(t,[{key:"drawOffset",value:function(t,e,n,i,r){return Vo(this.path.commandList,t,n,i,e+r,e+r),!1}},{key:"draw",value:function(t,e,n,i){return Vo(this.path.commandList,t,n,i,e,e),!1}},{key:"bounds",value:function(t,e){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)}}]),t}(),Ic={};function Dc(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=re(t);if(e){var r=re(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return ie(this,n)}}[Hu,Lu,Wu,ju,kc,Vu,Ju,nc,oc,lc,pc,vc,mc,Gu,wc,Bc,Pc,Oc].forEach((function(t){Ic[t.type]=t}));var Wc=["symbolType","size"].concat(Wt(fh)),Fc=function(t){ee(n,t);var e=Dc(n);function n(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{symbolType:"circle"};return Qt(this,n),(t=e.call(this,i)).type="symbol",t.numberType=Dh,t}return Jt(n,[{key:"getParsedPath",value:function(){return this.shouldUpdateShape()&&(this.doUpdateParsedPath(),this.clearUpdateShapeTag()),this._parsedPath}},{key:"isValid",value:function(){return Yo(re(n.prototype),"isValid",this).call(this)&&this._isValid()}},{key:"_isValid",value:function(){var t=this.attribute.size;return Sr(t)?2===t.length&&t.every(this._validNumber):this._validNumber(t)}},{key:"doUpdateParsedPath",value:function(){var t=Js(this).symbol,e=this.attribute.symbolType,i=void 0===e?t.symbolType:e,r=Ic[i];if(r)return this._parsedPath=r,r;if(r=n.userSymbolMap[i])return this._parsedPath=r,r;var o=(new Ba).fromString(i),a=o.bounds.width(),s=o.bounds.height(),l=1/Yr(a,s);return o.transform(0,0,l,l),this._parsedPath=new Lc(i,o),n.userSymbolMap[i]=this._parsedPath,this._parsedPath}},{key:"doUpdateAABBBounds",value:function(t){var e=Js(this).symbol;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);var n=this.attribute,i=as.graphicService.updateSymbolAABBBounds(n,Js(this).symbol,this._AABBBounds,t,this),r=n.boundsPadding,o=void 0===r?e.boundsPadding:r,a=Gl(o);return a&&i.expand(a),this.clearUpdateBoundTag(),i}},{key:"tryUpdateOBBBounds",value:function(){throw new Error("暂不支持")}},{key:"getDefaultAttribute",value:function(t){return Js(this).symbol[t]}},{key:"needUpdateTags",value:function(t){for(var e=0;e<Wc.length;e++){var n=Wc[e];if(-1!==t.indexOf(n))return!0}return!1}},{key:"needUpdateTag",value:function(t){for(var e=0;e<Wc.length;e++)if(t===Wc[e])return!0;return!1}},{key:"toCustomPath",value:function(){var t=this.getParsedPath(),e=this.attribute.size,n=Sr(e)?e:[e,e];return t.path?(new Ba).fromCustomPath2D(t.path,0,0,n[0],n[1]):(new Ba).fromString(t.pathStr,0,0,n[0],n[1])}},{key:"clone",value:function(){return new n(Object.assign({},this.attribute))}}]),n}(mh);function zc(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=re(t);if(e){var r=re(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return ie(this,n)}}Fc.userSymbolMap={};var jc=["segments","points","curveType"].concat(Wt(fh)),Nc=function(t){ee(n,t);var e=zc(n);function n(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Qt(this,n),(t=e.call(this,i)).type="line",t.numberType=Mh,t}return Jt(n,[{key:"isValid",value:function(){return Yo(re(n.prototype),"isValid",this).call(this)&&this._isValid()}},{key:"_isValid",value:function(){var t=this.attribute,e=t.points,n=t.segments;return n?0!==n.length:!(!e||e.length<=1)}},{key:"_interpolate",value:function(t,e,n,i,r){"points"===t&&(r.points=Xl(n,i,e))}},{key:"doUpdateAABBBounds",value:function(){var t=Js(this).line;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);var e=this.attribute,n=as.graphicService.updateLineAABBBounds(e,Js(this).line,this._AABBBounds,this),i=e.boundsPadding,r=void 0===i?t.boundsPadding:i,o=Gl(r);return o&&n.expand(o),this.clearUpdateBoundTag(),n}},{key:"tryUpdateOBBBounds",value:function(){throw new Error("暂不支持")}},{key:"getDefaultAttribute",value:function(t){return Js(this).line[t]}},{key:"needUpdateTags",value:function(t){for(var e=0;e<jc.length;e++){var n=jc[e];if(-1!==t.indexOf(n))return!0}return!1}},{key:"needUpdateTag",value:function(t){for(var e=0;e<jc.length;e++)if(t===jc[e])return!0;return!1}},{key:"toCustomPath",value:function(){var t=this.attribute,e=new Ba,n=t.segments,i=function(t){if(t&&t.length){var n=!0;t.forEach((function(t){!1!==t.defined&&(n?e.moveTo(t.x,t.y):e.lineTo(t.x,t.y),n=!1)}))}};return n&&n.length?n.forEach((function(t){i(t.points)})):t.points&&i(t.points),e}},{key:"clone",value:function(){return new n(Object.assign({},this.attribute))}}]),n}(mh);function Gc(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=re(t);if(e){var r=re(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return ie(this,n)}}var Uc=["width","height","cornerRadius"].concat(Wt(fh)),Kc=function(t){ee(n,t);var e=Gc(n);function n(t){var i;return Qt(this,n),(i=e.call(this,t)).type="rect",i.numberType=Oh,i}return Jt(n,[{key:"isValid",value:function(){return Yo(re(n.prototype),"isValid",this).call(this)&&this._isValid()}},{key:"_isValid",value:function(){var t=this.attribute,e=t.width,n=t.height;return this._validNumber(e)&&this._validNumber(n)}},{key:"doUpdateAABBBounds",value:function(){var t=Js(this).rect;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);var e=this.attribute,n=as.graphicService.updateRectAABBBounds(e,Js(this).rect,this._AABBBounds,this),i=e.boundsPadding,r=void 0===i?t.boundsPadding:i,o=Gl(r);return o&&n.expand(o),this.clearUpdateBoundTag(),n}},{key:"tryUpdateOBBBounds",value:function(){throw new Error("暂不支持")}},{key:"getDefaultAttribute",value:function(t){return Js(this).rect[t]}},{key:"needUpdateTags",value:function(t){for(var e=0;e<Uc.length;e++){var n=Uc[e];if(-1!==t.indexOf(n))return!0}return!1}},{key:"needUpdateTag",value:function(t){for(var e=0;e<Uc.length;e++)if(t===Uc[e])return!0;return!1}},{key:"toCustomPath",value:function(){var t=this.attribute,e=t.width,n=t.height,i=new Ba;return i.moveTo(0,0),i.rect(0,0,e,n),i}},{key:"clone",value:function(){return new n(Object.assign({},this.attribute))}}]),n}(mh);function Vc(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=re(t);if(e){var r=re(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return ie(this,n)}}var Yc=[[0,0,0],[1,0,0],[1,1,0],[0,1,0],[0,0,1],[1,0,1],[1,1,1],[0,1,1]],Xc=function(t){ee(n,t);var e=Vc(n);function n(t){var i;return Qt(this,n),(i=e.call(this,t)).type="rect3d",i.numberType=Lh,i}return Jt(n,[{key:"findFace",value:function(){for(var t={polygons:[],vertices:[],edges:[]},e=Js(this).rect3d,n=this.attribute,i=n.width,r=void 0===i?e.width:i,o=n.height,a=void 0===o?e.width:o,s=n.length,l=void 0===s?Xr(e.width,e.height):s,h=0;h<Yc.length;h++){var u=Yc[h];t.vertices.push([u[0]*r,u[1]*a,u[2]*l])}return t.polygons.push({polygon:[0,1,5,4],normal:[0,-1,0]}),t.polygons.push({polygon:[2,3,7,6],normal:[0,1,0]}),t.polygons.push({polygon:[4,7,3,0],normal:[-1,0,0]}),t.polygons.push({polygon:[1,2,6,5],normal:[1,0,0]}),t.polygons.push({polygon:[0,1,2,3],normal:[0,0,-1]}),t.polygons.push({polygon:[4,5,6,7],normal:[0,0,1]}),t.edges=[[0,1],[1,2],[2,3],[3,0],[4,5],[5,6],[6,7],[7,4],[0,4],[3,7],[1,5],[2,6]],t}}]),n}(Kc),$c={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"}},qc=!0,Zc=!1,Jc=/\w|\(|\)/,Qc=/[.?!,;:/,。?!、;:]/,td=/\S/;function ed(t,e,n,i,r){if(!e||e<=0)return 0;for(var o=as.graphicUtil.textMeasure,a=i,s=t.slice(0,a),l=Math.floor(o.measureText(s,n).width),h=t.slice(0,a+1),u=Math.floor(o.measureText(h,n).width);l>e||u<=e;){if(l>e?a--:a++,a>t.length){a=t.length;break}if(a<0){a=0;break}s=t.slice(0,a),l=Math.floor(o.measureText(s,n).width),h=t.slice(0,a+1),u=Math.floor(o.measureText(h,n).width)}return r&&(a=function(t,e){for(var n=e;Jc.test(t[n-1])&&Jc.test(t[n])||Qc.test(t[n]);)if(--n<=0)return e;return n}(t,a)),a}function nd(t,e){var n=as.graphicUtil.textMeasure.measureText(t,e),i={ascent:0,height:0,descent:0,width:0};return"number"!=typeof n.actualBoundingBoxAscent||"number"!=typeof n.actualBoundingBoxDescent?(i.width=Math.floor(n.width),i.height=e.fontSize||0,i.ascent=i.height,i.descent=0):(i.width=Math.floor(n.width),i.height=Math.floor(n.actualBoundingBoxAscent+n.actualBoundingBoxDescent),i.ascent=Math.floor(n.actualBoundingBoxAscent),i.descent=i.height-i.ascent),i}var id=function(){function t(e,n,i,r,o,a,s,l,h,u,c,d,f,p){Qt(this,t),this.left=e,this.top=n,this.width=i,this.height=r,this.actualHeight=0,this.bottom=n+r,this.right=e+i,this.ellipsis=o,this.wordBreak=a,this.verticalDirection=s,this.lines=[],this.globalAlign=l,this.globalBaseline=h,this.layoutDirection=u,this.directionKey=$c[this.layoutDirection],this.isWidthMax=c,this.isHeightMax=d,this.singleLine=f,p?(p.clear(),this.icons=p):this.icons=new Map}return Jt(t,[{key:"draw",value:function(t,e){var n=this.getActualSize(),i=n.width,r=n.height,o=this.isWidthMax?Math.min(this.width,i):this.width||i||0,a=this.isHeightMax?Math.min(this.height,r):this.height||r||0;a=Math.min(a,r);var s=0;switch(this.globalBaseline){case"top":s=0;break;case"middle":s=-a/2;break;case"bottom":s=-a}var l=0;switch(this.globalAlign){case"left":l=0;break;case"center":l=-o/2;break;case"right":l=-o}var h=this[this.directionKey.height];this.singleLine&&(h=this.lines[0].height+1);var u=!1;if("middle"===this.verticalDirection)if(this.actualHeight>=h&&0!==h)for(var c=0;c<this.lines.length;c++){var d=this.lines[c],f=d.top,p=d.height;if(f+p<this[this.directionKey.top]||f+p>this[this.directionKey.top]+h)return u;var g=!1;this.ellipsis&&this.lines[c+1]&&this.lines[c+1].top+this.lines[c+1].height>this[this.directionKey.top]+h&&(g=!0,u=!0),this.lines[c].draw(t,g,this.lines[c][this.directionKey.left]+l,this.lines[c][this.directionKey.top]+s,e)}else{var v=Math.floor((h-this.actualHeight)/2);"vertical"===this.layoutDirection?l+=v:s+=v;for(var y=0;y<this.lines.length;y++)this.lines[y].draw(t,!1,this.lines[y][this.directionKey.left]+l,this.lines[y][this.directionKey.top]+s,e)}else if("bottom"===this.verticalDirection&&"vertical"!==this.layoutDirection)for(var m=0;m<this.lines.length;m++){var b=this.lines[m];b.top;var w=b.height,C=h-this.lines[m].top-this.lines[m].height;if(0===h)this.lines[m].draw(t,!1,l,C+s,e);else{if(C+w>this[this.directionKey.top]+h||C<this[this.directionKey.top])return u;var x=!1;this.ellipsis&&this.lines[m+1]&&C-this.lines[m+1].height<this[this.directionKey.top]&&(x=!0,u=!0),this.lines[m].draw(t,x,l,C+s,e)}}else{"bottom"===this.verticalDirection&&"vertical"===this.layoutDirection&&this.singleLine&&this.isWidthMax&&(l+=this.lines[0].height+1);for(var _=0;_<this.lines.length;_++){"bottom"===this.verticalDirection&&"vertical"===this.layoutDirection&&(l-=this.lines[_].height+this.lines[_].top);var S=this.lines[_],k=S.top,A=S.height;if(0===h)this.lines[_].draw(t,!1,this.lines[_][this.directionKey.left]+l,this.lines[_][this.directionKey.top]+s,e);else{if(k+A<this[this.directionKey.top]||k+A>this[this.directionKey.top]+h)return u;var R=!1;this.ellipsis&&this.lines[_+1]&&this.lines[_+1].top+this.lines[_+1].height>this[this.directionKey.top]+h&&(R=!0,u=!0),this.lines[_].draw(t,R,this.lines[_][this.directionKey.left]+l,this.lines[_][this.directionKey.top]+s,e)}}}return u}},{key:"getActualSize",value:function(){return this.ellipsis?this.getActualSizeWidthEllipsis():this.getRawActualSize()}},{key:"getRawActualSize",value:function(){for(var t=0,e=0,n=0;n<this.lines.length;n++){var i=this.lines[n];i.actualWidth>t&&(t=i.actualWidth),e+=i.height}return{width:"vertical"===this.layoutDirection?e:t,height:"vertical"===this.layoutDirection?t:e}}},{key:"getActualSizeWidthEllipsis",value:function(){var t=0,e=0,n=this.getRawActualSize();n.width;n.height;this.width,this.height;var i=this[this.directionKey.height];if(this.singleLine&&(i=this.lines[0].height+1),"middle"===this.verticalDirection)if(this.actualHeight>=i&&0!==i)for(var r=0;r<this.lines.length;r++){var o=this.lines[r],a=o.top,s=o.height;if(a+s<this[this.directionKey.top]||a+s>this[this.directionKey.top]+i);else if(this.ellipsis&&this.lines[r+1]&&this.lines[r+1].top+this.lines[r+1].height>this[this.directionKey.top]+i){var l=this.lines[r].getWidthWithEllips();l>t&&(t=l),e+=this.lines[r].height}else this.lines[r].actualWidth>t&&(t=this.lines[r].actualWidth),e+=this.lines[r].height}else{Math.floor((i-this.actualHeight)/2);for(var h=0;h<this.lines.length;h++)this.lines[h].actualWidth>t&&(t=this.lines[h].actualWidth),e+=this.lines[h].height}else if("bottom"===this.verticalDirection)for(var u=0;u<this.lines.length;u++){var c=this.lines[u];c.top;var d=c.height,f=i-this.lines[u].top-this.lines[u].height;if(0===i)this.lines[u].actualWidth>t&&(t=this.lines[u].actualWidth),e+=this.lines[u].height;else if(f+d>this[this.directionKey.top]+i||f<this[this.directionKey.top]);else if(this.ellipsis&&this.lines[u+1]&&f-this.lines[u+1].height<this[this.directionKey.top]){var p=this.lines[u].getWidthWithEllips();p>t&&(t=p),e+=this.lines[u].height}else this.lines[u].actualWidth>t&&(t=this.lines[u].actualWidth),e+=this.lines[u].height}else for(var g=0;g<this.lines.length;g++){var v=this.lines[g],y=v.top,m=v.height;if(0===i)this.lines[g].actualWidth>t&&(t=this.lines[g].actualWidth),e+=this.lines[g].height;else if(y+m<this[this.directionKey.top]||y+m>this[this.directionKey.top]+i);else if(this.ellipsis&&this.lines[g+1]&&this.lines[g+1].top+this.lines[g+1].height>this[this.directionKey.top]+i){var b=this.lines[g].getWidthWithEllips();b>t&&(t=b),e+=this.lines[g].height}else this.lines[g].actualWidth>t&&(t=this.lines[g].actualWidth),e+=this.lines[g].height}return{width:"vertical"===this.layoutDirection?e:t,height:"vertical"===this.layoutDirection?t:e}}}]),t}(),rd=function(){function t(e,n,i){Qt(this,t),this.fontSize=i.fontSize||16,this.textBaseline=i.textBaseline||"alphabetic","number"==typeof i.lineHeight?this.lineHeight=i.lineHeight>this.fontSize?i.lineHeight:this.fontSize:this.lineHeight=Math.floor(1.2*this.fontSize),this.height=this.lineHeight;var r=nd(e,i),o=r.ascent,a=r.height,s=r.descent,l=r.width,h=0,u=0,c=0;this.height>a&&(h=(this.height-a)/2,u=Math.ceil(h),c=Math.floor(h)),"top"===this.textBaseline?(this.ascent=h,this.descent=a-h):"bottom"===this.textBaseline?(this.ascent=a-h,this.descent=h):"middle"===this.textBaseline?(this.ascent=this.height/2,this.descent=this.height/2):(this.ascent=o+u,this.descent=s+c),this.length=e.length,this.width=l||0,this.text=e||"",this.newLine=n||!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)}return Jt(t,[{key:"updateWidth",value:function(){var t=nd(this.text,this.character).width;this.width=t,"vertical"===this.direction&&(this.widthOrigin=this.width,this.width=this.heightOrigin,this.height=this.widthOrigin)}},{key:"draw",value:function(t,e,n,i,r){var o=this.text,a=this.left+n;e+=this.top;var s=this.direction;if(this.verticalEllipsis)o="...",s="vertical",e-=this.ellipsisWidth/2;else{if("hide"===this.ellipsis)return;if("add"===this.ellipsis)o+="...","right"===r&&(a-=this.ellipsisWidth);else if("replace"===this.ellipsis){var l=ed(o,("vertical"===s?this.height:this.width)-this.ellipsisWidth+this.ellipsisOtherParagraphWidth,this.character,o.length-1);if(o=o.slice(0,l),o+="...","right"===r){var h=nd(this.text.slice(l),this.character).width;"vertical"===s||(a-=this.ellipsisWidth-h)}}}switch(this.character.script){case"super":e-=this.ascent*(1/3);break;case"sub":e+=this.descent/2}"vertical"===s&&(t.save(),t.rotateAbout(Math.PI/2,a,e),t.translate(-this.heightOrigin||-this.lineHeight/2,-this.descent/2),t.translate(a,e),a=0,e=0),this.character.stroke&&(function(t,e){var n=e&&e.stroke||Zc;if(n){t.globalAlpha=1,t.lineWidth=1,t.strokeStyle=n;var i=e.fontSize||16;switch(e.script){case"super":case"sub":i*=.8}t.setTextStyle({textAlign:"left",textBaseline:e.textBaseline||"alphabetic",fontStyle:e.fontStyle||"",fontWeight:e.fontWeight||"",fontSize:i,fontFamily:e.fontFamily||"sans-serif"})}else t.globalAlpha=0}(t,this.character),t.strokeText(o,a,e)),function(t,e){var n=e&&e.fill||qc;if(n){t.globalAlpha=1,t.fillStyle=n;var i=e.fontSize||16;switch(e.script){case"super":case"sub":i*=.8}t.setTextStyle({textAlign:"left",textBaseline:e.textBaseline||"alphabetic",fontStyle:e.fontStyle||"",fontWeight:e.fontWeight||"",fontSize:i,fontFamily:e.fontFamily||"sans-serif"})}else t.globalAlpha=0}(t,this.character),this.character.fill&&t.fillText(o,a,e),this.character.fill&&("boolean"==typeof this.character.lineThrough||"boolean"==typeof this.character.underline?(this.character.underline&&t.fillRect(a,1+e,this.widthOrigin||this.width,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1),this.character.lineThrough&&t.fillRect(a,1+e-this.ascent/2,this.widthOrigin||this.width,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1)):"underline"===this.character.textDecoration?t.fillRect(a,1+e,this.widthOrigin||this.width,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1):"line-through"===this.character.textDecoration&&t.fillRect(a,1+e-this.ascent/2,this.widthOrigin||this.width,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1)),"vertical"===s&&t.restore()}},{key:"getWidthWithEllips",value:function(t){var e=this.text,n="vertical"===t?this.height:this.width;if("hide"===this.ellipsis)return n;if("add"===this.ellipsis)return n+this.ellipsisWidth;if("replace"===this.ellipsis){var i=ed(e,n-this.ellipsisWidth+this.ellipsisOtherParagraphWidth,this.character,e.length-1);e=e.slice(0,i),e+="...";var r=nd(this.text.slice(i),this.character).width;return n+this.ellipsisWidth-r}return n}}]),t}();function od(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=re(t);if(e){var r=re(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return ie(this,n)}}var ad=["width","height","image"].concat(Wt(fh)),sd=function(t){ee(n,t);var e=od(n);function n(t){var i;return Qt(this,n),(i=e.call(this,t)).type="image",i.numberType=Th,i.loadImage(i.attribute.image),i}return Jt(n,[{key:"width",get:function(){var t;return null!==(t=this.attribute.width)&&void 0!==t?t:0},set:function(t){this.attribute.width===t&&(this.attribute.width=t,this.addUpdateShapeAndBoundsTag())}},{key:"height",get:function(){var t;return null!==(t=this.attribute.height)&&void 0!==t?t:0},set:function(t){this.attribute.height===t&&(this.attribute.height=t,this.addUpdateShapeAndBoundsTag())}},{key:"repeatX",get:function(){var t;return null!==(t=this.attribute.repeatX)&&void 0!==t?t:"stretch"},set:function(t){this.attribute.repeatX===t&&(this.attribute.repeatX=t)}},{key:"repeatY",get:function(){var t;return null!==(t=this.attribute.repeatY)&&void 0!==t?t:"stretch"},set:function(t){this.attribute.repeatY===t&&(this.attribute.repeatY=t)}},{key:"image",get:function(){return this.attribute.image},set:function(t){t!==this.attribute.image&&(this.attribute.image=t,this.loadImage(this.attribute.image))}},{key:"imageLoadSuccess",value:function(t,e,i){var r=this;Yo(re(n.prototype),"imageLoadSuccess",this).call(this,t,e,(function(){r.successCallback&&r.successCallback()}))}},{key:"imageLoadFail",value:function(t,e){var i=this;Yo(re(n.prototype),"imageLoadFail",this).call(this,t,(function(){i.failCallback&&i.failCallback()}))}},{key:"doUpdateAABBBounds",value:function(){var t=Js(this).image;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);var e=this.attribute,n=as.graphicService.updateImageAABBBounds(e,Js(this).image,this._AABBBounds,this),i=e.boundsPadding,r=void 0===i?t.boundsPadding:i,o=Gl(r);return o&&n.expand(o),this.clearUpdateBoundTag(),n}},{key:"tryUpdateOBBBounds",value:function(){throw new Error("暂不支持")}},{key:"getDefaultAttribute",value:function(t){return Za[t]}},{key:"needUpdateTags",value:function(t){for(var e=0;e<ad.length;e++){var n=ad[e];if(-1!==t.indexOf(n))return!0}return!1}},{key:"needUpdateTag",value:function(t){for(var e=0;e<ad.length;e++)if(t===ad[e])return!0;return!1}},{key:"clone",value:function(){return new n(Object.assign({},this.attribute))}}]),n}(mh);function ld(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=re(t);if(e){var r=re(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return ie(this,n)}}var hd=function(t){ee(n,t);var e=ld(n);function n(t){var i;if(Qt(this,n),(i=e.call(this,t))._x=0,i._y=0,i._hovered=!1,i._marginArray=[0,0,0,0],"always"===t.backgroundShowMode&&(i._hovered=!0),t.margin){var r=Gl(t.margin);i._marginArray="number"==typeof r?[r,r,r,r]:r}return i.onBeforeAttributeUpdate=function(t,e,n){if(Sr(n)&&-1!==n.indexOf("margin")||"margin"===n)if(e.margin){var r=Gl(e.margin);i._marginArray="number"==typeof r?[r,r,r,r]:r}else i._marginArray=[0,0,0,0]},ie(i)}return Jt(n,[{key:"width",get:function(){var t;return(null!==(t=this.attribute.width)&&void 0!==t?t:0)+this._marginArray[1]+this._marginArray[3]}},{key:"height",get:function(){var t;return(null!==(t=this.attribute.height)&&void 0!==t?t:0)+this._marginArray[0]+this._marginArray[2]}},{key:"tryUpdateAABBBounds",value:function(){if(!this.shouldUpdateAABBBounds())return this._AABBBounds;this.doUpdateAABBBounds();var t=this.attribute,e=t.width,n=void 0===e?Za.width:e,i=t.height,r=void 0===i?Za.height:i,o=this.attribute,a=o.backgroundWidth,s=void 0===a?n:a,l=o.backgroundHeight,h=(s-n)/2,u=((void 0===l?r:l)-r)/2;return this._AABBBounds.expand([0,2*h,2*u,0]),this._AABBBounds}},{key:"setHoverState",value:function(t){"hover"===this.attribute.backgroundShowMode&&this._hovered!==t&&(this._hovered=t)}}]),n}(sd),ud=function(){function t(e,n,i,r,o,a,s,l){var h=this;Qt(this,t),this.left=e,this.width=n,this.baseline=i,this.ascent=r,this.descent=o,this.top=i-r,this.paragraphs=a.map((function(t){return t})),this.textAlign=(this.paragraphs[0]instanceof hd?this.paragraphs[0].attribute.textAlign:this.paragraphs[0].character.textAlign)||"left",this.direction=s,this.directionKey=$c[this.direction];var u=this.directionKey;this.actualWidth=0;var c=0;this.paragraphs.forEach((function(t,e){if(0===e&&t instanceof rd){var n=td.exec(t.text);0!==(null==n?void 0:n.index)&&(t.text=t.text.slice(null==n?void 0:n.index),t.updateWidth())}h.actualWidth+=t[h.directionKey.width],c=Math.max(t[h.directionKey.height],c)})),this.height=c,this.blankWidth=l?0:this.width-this.actualWidth;var d=this.left,f=0;if(this.actualWidth<n&&!l)switch(this.textAlign){case"right":d=n-this.actualWidth;break;case"center":d=(n-this.actualWidth)/2;break;case"justify":this.paragraphs.length<2?d=(n-this.actualWidth)/2:f=(n-this.actualWidth)/(this.paragraphs.length-1)}this.paragraphs.map((function(t){t instanceof hd?(t["_"+u.x]=d,d+=t[u.width]+f,t["_"+u.y]="top"===t.attribute.textBaseline?0:"bottom"===t.attribute.textBaseline?c-t.height:(c-t.height)/2):(t[u.left]=d,d+=t[u.width]+f)}))}return Jt(t,[{key:"draw",value:function(t,e,n,i,r){var o=this;if(e)for(var a=0,s=this.paragraphs.length-1;s>=0;s--){var l=this.paragraphs[s];if(l instanceof hd)break;if("vertical"===this.direction&&"vertical"!==l.direction){l.verticalEllipsis=!0;break}var h=nd("...",l.character).width||0;if(h<=this.blankWidth+a){l.ellipsis="add";break}if(h<=this.blankWidth+a+l.width){l.ellipsis="replace",l.ellipsisWidth=h,l.ellipsisOtherParagraphWidth=this.blankWidth+a;break}l.ellipsis="hide",a+=l.width}this.paragraphs.map((function(e,a){if(e instanceof hd)return e.setAttributes({x:n+e._x,y:i+e._y}),void r(e,t,n+e._x,i+e._y,o.ascent);e.draw(t,i+o.ascent,n,0===a,o.textAlign)}))}},{key:"getWidthWithEllips",value:function(){for(var t=this,e=0,n=this.paragraphs.length-1;n>=0;n--){var i=this.paragraphs[n];if(i instanceof hd)break;var r=nd("...",i.character).width||0;if(r<=this.blankWidth+e){i.ellipsis="add",i.ellipsisWidth=r;break}if(r<=this.blankWidth+e+i.width){i.ellipsis="replace",i.ellipsisWidth=r,i.ellipsisOtherParagraphWidth=this.blankWidth+e;break}i.ellipsis="hide",e+=i.width}var o=0;return this.paragraphs.map((function(e,n){o+=e instanceof hd?e.width:e.getWidthWithEllips(t.direction)})),o}}]),t}(),cd=function(){function t(e){Qt(this,t),this.frame=e,this.width=this.frame.width,this.height=this.frame.height,this.lineWidth=0,this.y=this.frame.top,this.maxAscent=0,this.maxDescent=0,this.maxAscentForBlank=0,this.maxDescentForBlank=0,this.lineBuffer=[],this.direction=e.layoutDirection,this.directionKey=$c[this.direction]}return Jt(t,[{key:"store",value:function(t){if(t instanceof hd){this.frame.icons.set(t.richtextId,t),this.lineBuffer.push(t),this.lineWidth+=t[this.directionKey.width];var e=0,n=0;"top"===t.attribute.textBaseline?(e=0,n=t.height):"bottom"===t.attribute.textBaseline?(e=t.height,n=0):(e=t.height/2,n=t.height/2),this.maxAscent=Math.max(this.maxAscent,e),this.maxDescent=Math.max(this.maxDescent,n)}else this.lineBuffer.push(t),0!==t.text.length?(this.lineWidth+=t[this.directionKey.width],this.maxAscent=Math.max(this.maxAscent,t.ascent),this.maxDescent=Math.max(this.maxDescent,t.descent)):(this.maxAscentForBlank=Math.max(this.maxAscentForBlank,t.ascent),this.maxDescentForBlank=Math.max(this.maxDescentForBlank,t.descent))}},{key:"send",value:function(){if(0!==this.lineBuffer.length){var t=0===this.maxAscent?this.maxAscentForBlank:this.maxAscent,e=0===this.maxDescent?this.maxDescentForBlank:this.maxDescent,n=new ud(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(n),this.frame.actualHeight+=n.height,this.y+=n.height,this.lineBuffer.length=0,this.lineWidth=this.maxAscent=this.maxDescent=this.maxAscentForBlank=this.maxDescentForBlank=0}}},{key:"deal",value:function(t){t instanceof hd?"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.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)))}},{key:"cut",value:function(t){var e=this[this.directionKey.width]-this.lineWidth||0,n=Math.ceil(e/t[this.directionKey.width]*t.length)||0,i=ed(t.text,e,t.character,n,"break-word"===this.frame.wordBreak);if(0!==i){var r=function(t,e){var n=t.text.slice(0,e),i=t.text.slice(e);return[new rd(n,t.newLine,t.character),new rd(i,!0,t.character)]}(t,i),o=Vt(r,2),a=o[0],s=o[1];this.store(a),this.deal(s)}else 0!==this.lineBuffer.length&&(this.send(),this.deal(t))}}]),t}();function dd(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=re(t);if(e){var r=re(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return ie(this,n)}}var fd=["width","height","ellipsis","wordBreak","verticalDirection","maxHeight","maxWidth","textAlign","textBaseline","textConfig","layoutDirection"].concat(Wt(fh)),pd=function(t){ee(n,t);var e=dd(n);function n(t){var i;return Qt(this,n),(i=e.call(this,t)).type="richtext",i._currentHoverIcon=null,i.numberType=Ih,i}return Jt(n,[{key:"width",get:function(){var t;return null!==(t=this.attribute.width)&&void 0!==t?t:qa.width},set:function(t){this.attribute.width!==t&&(this.attribute.width=t,this.addUpdateShapeAndBoundsTag())}},{key:"height",get:function(){var t;return null!==(t=this.attribute.height)&&void 0!==t?t:qa.height},set:function(t){this.attribute.height!==t&&(this.attribute.height=t,this.addUpdateShapeAndBoundsTag())}},{key:"maxWidth",get:function(){return this.attribute.maxWidth},set:function(t){this.attribute.maxWidth!==t&&(this.attribute.maxWidth=t,this.addUpdateShapeAndBoundsTag())}},{key:"maxHeight",get:function(){return this.attribute.maxHeight},set:function(t){this.attribute.maxHeight!==t&&(this.attribute.maxHeight=t,this.addUpdateShapeAndBoundsTag())}},{key:"ellipsis",get:function(){var t;return null!==(t=this.attribute.ellipsis)&&void 0!==t?t:qa.ellipsis},set:function(t){this.attribute.ellipsis!==t&&(this.attribute.ellipsis=t,this.addUpdateShapeAndBoundsTag())}},{key:"wordBreak",get:function(){var t;return null!==(t=this.attribute.wordBreak)&&void 0!==t?t:qa.wordBreak},set:function(t){this.attribute.wordBreak!==t&&(this.attribute.wordBreak=t,this.addUpdateShapeAndBoundsTag())}},{key:"verticalDirection",get:function(){var t;return null!==(t=this.attribute.verticalDirection)&&void 0!==t?t:qa.verticalDirection},set:function(t){this.attribute.verticalDirection!==t&&(this.attribute.verticalDirection=t,this.addUpdateShapeAndBoundsTag())}},{key:"textAlign",get:function(){var t;return null!==(t=this.attribute.textAlign)&&void 0!==t?t:qa.textAlign},set:function(t){this.attribute.textAlign!==t&&(this.attribute.textAlign=t,this.addUpdateShapeAndBoundsTag())}},{key:"textBaseline",get:function(){var t;return null!==(t=this.attribute.textBaseline)&&void 0!==t?t:qa.textBaseline},set:function(t){this.attribute.textBaseline!==t&&(this.attribute.textBaseline=t,this.addUpdateShapeAndBoundsTag())}},{key:"textConfig",get:function(){var t;return null!==(t=this.attribute.textConfig)&&void 0!==t?t:qa.textConfig},set:function(t){this.attribute.textConfig=t,this.addUpdateShapeAndBoundsTag()}},{key:"doUpdateAABBBounds",value:function(){var t=Js(this).richtext;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);var e=this.attribute,n=as.graphicService.updateRichTextAABBBounds(e,Js(this).richtext,this._AABBBounds,this),i=e.boundsPadding,r=void 0===i?t.boundsPadding:i,o=Gl(r);return o&&n.expand(o),this.clearUpdateBoundTag(),n}},{key:"tryUpdateOBBBounds",value:function(){throw new Error("暂不支持")}},{key:"getDefaultAttribute",value:function(t){return qa[t]}},{key:"needUpdateTags",value:function(t){for(var e=0;e<fd.length;e++){var n=fd[e];if(-1!==t.indexOf(n))return!0}return!1}},{key:"needUpdateTag",value:function(t){for(var e=0;e<fd.length;e++)if(t===fd[e])return!0;return!1}},{key:"getFrameCache",value:function(){return this.shouldUpdateShape()&&(this.doUpdateFrameCache(),this.clearUpdateShapeTag()),this._frameCache}},{key:"doUpdateFrameCache",value:function(){for(var t,e=this,n=this.attribute,i=n.textConfig,r=n.maxWidth,o=n.maxHeight,a=n.width,s=n.height,l=n.ellipsis,h=n.wordBreak,u=n.verticalDirection,c=n.textAlign,d=n.textBaseline,f=n.layoutDirection,p=n.singleLine,g=[],v=0;v<i.length;v++)if("image"in i[v]){var y=i[v],m=y.id&&this._frameCache&&this._frameCache.icons&&this._frameCache.icons.get(y.id);if(m)g.push(m);else{var b=new hd(y);b.successCallback=function(){var t;e.addUpdateBoundTag(),null===(t=e.stage)||void 0===t||t.renderNextFrame()},b.richtextId=y.id,g.push(b)}}else if(i[v].text.includes("\n"))for(var w=i[v].text.split("\n"),C=0;C<w.length;C++)g.push(new rd(w[C],0!==C,i[v]));else g.push(new rd(i[v].text,!1,i[v]));for(var x=new id(0,0,("number"==typeof r&&(!a||a>r)?r:a)||0,("number"==typeof o&&(!s||s>o)?o:s)||0,l,h,u,c,d,f||"horizontal","number"==typeof r&&(!a||a>r),"number"==typeof o&&(!s||s>o),p||!1,null===(t=this._frameCache)||void 0===t?void 0:t.icons),_=new cd(x),S=0;S<g.length;S++)_.deal(g[S]);_.send(),this._frameCache=x}},{key:"clone",value:function(){return new n(Object.assign({},this.attribute))}},{key:"setStage",value:function(t,e){Yo(re(n.prototype),"setStage",this).call(this,t,e),this.getFrameCache().icons.forEach((function(n){n.setStage(t,e)}))}},{key:"bindIconEvent",value:function(){var t=this;this.addEventListener("pointermove",(function(e){var n,i,r,o,a,s=t.pickIcon(e.global);s&&s===t._currentHoverIcon||(s?(null===(n=t._currentHoverIcon)||void 0===n||n.setHoverState(!1),t._currentHoverIcon=s,t._currentHoverIcon.setHoverState(!0),null===(i=t.stage)||void 0===i||i.setCursor(s.attribute.cursor),null===(r=t.stage)||void 0===r||r.renderNextFrame()):!s&&t._currentHoverIcon&&(t._currentHoverIcon.setHoverState(!1),t._currentHoverIcon=null,null===(o=t.stage)||void 0===o||o.setCursor(),null===(a=t.stage)||void 0===a||a.renderNextFrame()))})),this.addEventListener("pointerleave",(function(e){var n,i;t._currentHoverIcon&&(t._currentHoverIcon.setHoverState(!1),t._currentHoverIcon=null,null===(n=t.stage)||void 0===n||n.setCursor(),null===(i=t.stage)||void 0===i||i.renderNextFrame())}))}},{key:"pickIcon",value:function(t){var e,n=this.getFrameCache(),i=this.globalTransMatrix,r=i.e,o=i.f;return n.icons.forEach((function(n){var i,a;n.AABBBounds.containsPoint({x:t.x-r,y:t.y-o})&&(e=n,e.globalX=(null!==(i=e.attribute.x)&&void 0!==i?i:0)+r,e.globalY=(null!==(a=e.attribute.y)&&void 0!==a?a:0)+o)})),e}}]),n}(mh);function gd(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=re(t);if(e){var r=re(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return ie(this,n)}}var vd=["path","customPath"].concat(Wt(fh)),yd=function(t){ee(n,t);var e=gd(n);function n(t){var i;return Qt(this,n),(i=e.call(this,t)).type="path",i.numberType=Ph,i}return Jt(n,[{key:"pathShape",get:function(){return this.tryUpdateAABBBounds(),this.getParsedPathShape()}},{key:"isValid",value:function(){return Yo(re(n.prototype),"isValid",this).call(this)&&this._isValid()}},{key:"_isValid",value:function(){var t=this.attribute.path;return null!=t&&""!==t}},{key:"getParsedPathShape",value:function(){var t=Js(this).path;if(!this.valid)return t.path;var e=this.attribute;return e.path instanceof Ba?e.path:(mr(this.cache)&&this.doUpdatePathShape(),this.cache instanceof Ba?this.cache:t.path)}},{key:"doUpdateAABBBounds",value:function(){var t=Js(this).path;this.doUpdatePathShape(),this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);var e=this.attribute,n=as.graphicService.updatePathAABBBounds(e,Js(this).path,this._AABBBounds,this),i=e.boundsPadding,r=void 0===i?t.boundsPadding:i,o=Gl(r);return o&&n.expand(o),this.clearUpdateBoundTag(),n}},{key:"doUpdatePathShape",value:function(){var t=this.attribute;_r(t.path,!0)?this.cache=(new Ba).fromString(t.path):t.customPath&&(this.cache=new Ba,t.customPath(this.cache,this))}},{key:"tryUpdateOBBBounds",value:function(){throw new Error("暂不支持")}},{key:"getDefaultAttribute",value:function(t){return Js(this).path[t]}},{key:"needUpdateTags",value:function(t){for(var e=0;e<vd.length;e++){var n=vd[e];if(-1!==t.indexOf(n))return!0}return!1}},{key:"needUpdateTag",value:function(t){for(var e=0;e<vd.length;e++)if(t===vd[e])return!0;return!1}},{key:"toCustomPath",value:function(){return(new Ba).fromCustomPath2D(this.getParsedPathShape(),0,0)}},{key:"clone",value:function(){return new n(Object.assign({},this.attribute))}}]),n}(mh);function md(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=re(t);if(e){var r=re(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return ie(this,n)}}var bd=["segments","points","curveType"].concat(Wt(fh)),wd=function(t){ee(n,t);var e=md(n);function n(t){var i;return Qt(this,n),(i=e.call(this,t)).type="area",i.numberType=kh,i}return Jt(n,[{key:"isValid",value:function(){return Yo(re(n.prototype),"isValid",this).call(this)&&this._isValid()}},{key:"_isValid",value:function(){var t=this.attribute,e=t.points,n=t.segments;return n?0!==n.length:!!e&&0!==e.length}},{key:"doUpdateAABBBounds",value:function(){var t=Js(this).area;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);var e=this.attribute,n=as.graphicService.updateAreaAABBBounds(e,Js(this).area,this._AABBBounds,this),i=e.boundsPadding,r=void 0===i?t.boundsPadding:i,o=Gl(r);return o&&n.expand(o),this.clearUpdateBoundTag(),n}},{key:"tryUpdateOBBBounds",value:function(){throw new Error("暂不支持")}},{key:"_interpolate",value:function(t,e,n,i,r){"points"===t&&(r.points=Xl(n,i,e))}},{key:"getDefaultAttribute",value:function(t){return Js(this).area[t]}},{key:"needUpdateTags",value:function(t){for(var e=0;e<bd.length;e++){var n=bd[e];if(-1!==t.indexOf(n))return!0}return!1}},{key:"needUpdateTag",value:function(t){for(var e=0;e<bd.length;e++)if(t===bd[e])return!0;return!1}},{key:"toCustomPath",value:function(){var t=new Ba,e=this.attribute,n=e.segments,i=function(e){if(e&&e.length){var n=!0,i=[];if(e.forEach((function(e){var r,o;!1!==e.defined&&(n?t.moveTo(e.x,e.y):t.lineTo(e.x,e.y),i.push({x:null!==(r=e.x1)&&void 0!==r?r:e.x,y:null!==(o=e.y1)&&void 0!==o?o:e.y}),n=!1)})),i.length){for(var r=i.length-1;r>=0;r--)t.lineTo(i[r].x,i[r].y);t.closePath()}}};return e.points?i(e.points):n&&n.length&&n.forEach((function(t){i(t.points)})),t}},{key:"clone",value:function(){return new n(Object.assign({},this.attribute))}}]),n}(mh);function Cd(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=re(t);if(e){var r=re(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return ie(this,n)}}var xd=["innerRadius","outerRadius","startAngle","endAngle","cornerRadius","padAngle","padRadius","cap"].concat(Wt(fh)),_d=function(t){ee(n,t);var e=Cd(n);function n(t){var i;return Qt(this,n),(i=e.call(this,t)).type="arc",i.numberType=_h,i}return Jt(n,[{key:"isValid",value:function(){return Yo(re(n.prototype),"isValid",this).call(this)&&this._isValid()}},{key:"_isValid",value:function(){var t=this.attribute,e=t.startAngle,n=t.endAngle,i=t.outerRadius,r=t.innerRadius;return this._validNumber(e)&&this._validNumber(n)&&this._validNumber(i)&&this._validNumber(r)}},{key:"getParsedCornerRadius",value:function(){var t=Js(this).arc,e=this.attribute,n=e.cornerRadius,i=void 0===n?t.cornerRadius:n,r=e.outerRadius,o=void 0===r?t.outerRadius:r,a=e.innerRadius,s=void 0===a?t.innerRadius:a;if(0===i||"0%"===i)return 0;var l=Math.abs(o-s);return Math.min(Ar(i,!0)?i:l*parseFloat(i)/100,l/2)}},{key:"getParsedAngle",value:function(){var t=Js(this).arc,e=this.attribute,n=e.startAngle,i=void 0===n?t.startAngle:n,r=e.endAngle,o=void 0===r?t.endAngle:r,a=this.attribute.cap,s=void 0===a?t.cap:a,l=o-i>=0?1:-1,h=o-i;if(o=(i=yo(i))+h,s&&Ur(h)<Gr-Fr){var u=1,c=1;s.length&&(u=Number(s[0]),c=Number(s[1]));var d=this.attribute,f=d.outerRadius,p=void 0===f?t.outerRadius:f,g=d.innerRadius,v=void 0===g?t.innerRadius:g,y=Math.abs(p-v)/2,m=y/p;if(y>Fr&&p>Fr)return{startAngle:i-l*m*u,endAngle:o+l*m*c}}return{startAngle:i,endAngle:o}}},{key:"getParsePadAngle",value:function(t,e){var n=Js(this).arc,i=this.attribute,r=i.outerRadius,o=void 0===r?n.outerRadius:r,a=i.innerRadius,s=void 0===a?n.innerRadius:a,l=i.padAngle,h=void 0===l?n.padAngle:l,u=this.attribute.padRadius,c=void 0===u?qr(o*o+s*s):u,d=Ur(e-t),f=t,p=e,g=t,v=e,y=h/2,m=d,b=d;if(y>Fr&&c>Fr){var w=e>t?1:-1,C=Qr(Number(c)/s*$r(y)),x=Qr(Number(c)/o*$r(y));return(m-=2*C)>Fr?(g+=C*=w,v-=C):(m=0,g=v=(t+e)/2),(b-=2*x)>Fr?(f+=x*=w,p-=x):(b=0,f=p=(t+e)/2),{outerStartAngle:f,outerEndAngle:p,innerStartAngle:g,innerEndAngle:v,innerDeltaAngle:m,outerDeltaAngle:b}}return{outerStartAngle:f,outerEndAngle:p,innerStartAngle:g,innerEndAngle:v,innerDeltaAngle:m,outerDeltaAngle:b}}},{key:"doUpdateAABBBounds",value:function(t){var e=Js(this).arc;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);var n=this.attribute,i=as.graphicService.updateArcAABBBounds(n,Js(this).arc,this._AABBBounds,t,this),r=n.boundsPadding,o=void 0===r?e.boundsPadding:r,a=Gl(o);return a&&i.expand(a),this.clearUpdateBoundTag(),i}},{key:"tryUpdateOBBBounds",value:function(){throw new Error("暂不支持")}},{key:"needUpdateTags",value:function(t){for(var e=0;e<xd.length;e++){var n=xd[e];if(-1!==t.indexOf(n))return!0}return!1}},{key:"needUpdateTag",value:function(t){for(var e=0;e<xd.length;e++)if(t===xd[e])return!0;return!1}},{key:"getDefaultAttribute",value:function(t){return Js(this).arc[t]}},{key:"toCustomPath",value:function(){var t=this.attribute,e=this.getParsedAngle(),n=e.startAngle,i=e.endAngle,r=t.innerRadius,o=t.outerRadius,a=Ur(i-n),s=i>n;if(o<r){var l=o;o=r,r=l}var h=new Ba;if(o<=Fr)h.moveTo(0,0);else if(a>=Gr-Fr)h.moveTo(0+o*Vr(n),0+o*$r(n)),h.arc(0,0,o,n,i,!s),r>Fr&&(h.moveTo(0+r*Vr(i),0+r*$r(i)),h.arc(0,0,r,i,n,s));else{var u=o*Vr(n),c=o*$r(n),d=r*Vr(i),f=r*$r(i);h.moveTo(0+u,0+c),h.arc(0,0,o,n,i,!s),h.lineTo(0+d,0+f),h.arc(0,0,r,i,n,s),h.closePath()}return h}},{key:"clone",value:function(){return new n(Object.assign({},this.attribute))}}]),n}(mh);function Sd(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=re(t);if(e){var r=re(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return ie(this,n)}}var kd=["points","cornerRadius"].concat(Wt(fh)),Ad=function(t){ee(n,t);var e=Sd(n);function n(t){var i;return Qt(this,n),(i=e.call(this,t)).type="polygon",i.numberType=Eh,i}return Jt(n,[{key:"isValid",value:function(){return Yo(re(n.prototype),"isValid",this).call(this)&&this._isValid()}},{key:"_isValid",value:function(){var t=this.attribute.points;return t&&t.length>=2}},{key:"doUpdateAABBBounds",value:function(){var t=Js(this).polygon;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);var e=this.attribute,n=as.graphicService.updatePolygonAABBBounds(e,Js(this).polygon,this._AABBBounds,this),i=e.boundsPadding,r=void 0===i?t.boundsPadding:i,o=Gl(r);return o&&n.expand(o),this.clearUpdateBoundTag(),this._AABBBounds}},{key:"tryUpdateOBBBounds",value:function(){throw new Error("暂不支持")}},{key:"_interpolate",value:function(t,e,n,i,r){"points"===t&&(r.points=Xl(n,i,e))}},{key:"getDefaultAttribute",value:function(t){return Js(this).polygon[t]}},{key:"needUpdateTags",value:function(t){for(var e=0;e<kd.length;e++){var n=kd[e];if(-1!==t.indexOf(n))return!0}return!1}},{key:"needUpdateTag",value:function(t){for(var e=0;e<kd.length;e++)if(t===kd[e])return!0;return!1}},{key:"toCustomPath",value:function(){var t=this.attribute.points,e=new Ba;return t.forEach((function(t,n){0===n?e.moveTo(t.x,t.y):e.lineTo(t.x,t.y)})),e.closePath(),e}},{key:"clone",value:function(){return new n(Object.assign({},this.attribute))}}]),n}(mh),Rd=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},Bd=function(){function t(){Qt(this,t)}return Jt(t,[{key:"updateBounds",value:function(t,e,n,i){var r=t.outerBorder,o=t.shadowBlur,a=void 0===o?e.shadowBlur:o;if(r){var s=e.outerBorder,l=r.distance,h=void 0===l?s.distance:l,u=r.lineWidth,c=void 0===u?s.lineWidth:u;n.expand(h+a+c/2)}return n}}]),t}();function Td(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=re(t);if(e){var r=re(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return ie(this,n)}}Bd=Rd([Zi()],Bd);var Md=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},Pd=Symbol.for("RectBoundsContribution"),Ed=function(t){ee(n,t);var e=Td(n);function n(){return Qt(this,n),e.apply(this,arguments)}return Jt(n)}(Bd);function Hd(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=re(t);if(e){var r=re(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return ie(this,n)}}Ed=Md([Zi()],Ed);var Od=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},Ld=Symbol.for("SymbolBoundsContribution"),Id=function(t){ee(n,t);var e=Hd(n);function n(){return Qt(this,n),e.apply(this,arguments)}return Jt(n,[{key:"updateBounds",value:function(t,e,n,i){var r=t.outerBorder,o=t.shadowBlur,a=void 0===o?e.shadowBlur:o,s=t.strokeBoundsBuffer,l=void 0===s?e.strokeBoundsBuffer:s;if(r){var h=e.outerBorder,u=r.distance,c=void 0===u?h.distance:u,d=r.lineWidth;bh(n,c+a+(void 0===d?h.lineWidth:d)/2,!0,l)}return n}}]),n}(Bd);function Dd(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=re(t);if(e){var r=re(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return ie(this,n)}}Id=Od([Zi()],Id);var Wd=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},Fd=Symbol.for("CircleBoundsContribution"),zd=function(t){ee(n,t);var e=Dd(n);function n(){return Qt(this,n),e.apply(this,arguments)}return Jt(n)}(Bd);function jd(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=re(t);if(e){var r=re(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return ie(this,n)}}zd=Wd([Zi()],zd);var Nd=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},Gd=Symbol.for("ArcBoundsContribution"),Ud=function(t){ee(n,t);var e=jd(n);function n(){return Qt(this,n),e.apply(this,arguments)}return Jt(n)}(Bd);function Kd(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=re(t);if(e){var r=re(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return ie(this,n)}}Ud=Nd([Zi()],Ud);var Vd=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},Yd=Symbol.for("PathBoundsContribution"),Xd=function(t){ee(n,t);var e=Kd(n);function n(){return Qt(this,n),e.apply(this,arguments)}return Jt(n)}(Bd);Xd=Vd([Zi()],Xd);var $d=function(){function t(){Qt(this,t),this.pools=[]}return Jt(t,[{key:"allocate",value:function(t,e,n,i,r,o){if(!this.pools.length)return new mo(t,e,n,i,r,o);var a=this.pools.pop();return a.a=t,a.b=e,a.c=n,a.d=i,a.e=r,a.f=o,a}},{key:"allocateByObj",value:function(t){if(!this.pools.length)return new mo(t.a,t.b,t.c,t.d,t.e,t.f);var e=this.pools.pop();return e.a=t.a,e.b=t.b,e.c=t.c,e.d=t.d,e.e=t.e,e.f=t.f,e}},{key:"free",value:function(t){this.pools.push(t)}},{key:"length",get:function(){return this.pools.length}},{key:"release",value:function(){this.pools=[]}}]),t}(),qd=function(){function t(){Qt(this,t),this.pools=[]}return Jt(t,[{key:"allocate",value:function(){if(!this.pools.length)return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];var e=this.pools.pop();return t.identity(e),e}},{key:"allocateByObj",value:function(t){var e;e=this.pools.length?this.pools.pop():[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];for(var n=0;n<e.length;n++)e[n]=t[n];return e}},{key:"free",value:function(t){t&&this.pools.push(t)}},{key:"length",get:function(){return this.pools.length}},{key:"release",value:function(){this.pools=[]}}],[{key:"identity",value:function(t){return 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}}]),t}(),Zd=new $d,Jd=new qd,Qd=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},tf=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},ef=function(t,e){return function(n,i){e(n,i,t)}};function nf(t,e,n){var i,r,o,a,s,l,h,u,c,d,f,p,g=n[0],v=n[1],y=n[2];return e===t?(t[12]=e[0]*g+e[4]*v+e[8]*y+e[12],t[13]=e[1]*g+e[5]*v+e[9]*y+e[13],t[14]=e[2]*g+e[6]*v+e[10]*y+e[14],t[15]=e[3]*g+e[7]*v+e[11]*y+e[15]):(i=e[0],r=e[1],o=e[2],a=e[3],s=e[4],l=e[5],h=e[6],u=e[7],c=e[8],d=e[9],f=e[10],p=e[11],t[0]=i,t[1]=r,t[2]=o,t[3]=a,t[4]=s,t[5]=l,t[6]=h,t[7]=u,t[8]=c,t[9]=d,t[10]=f,t[11]=p,t[12]=i*g+s*v+c*y+e[12],t[13]=r*g+l*v+d*y+e[13],t[14]=o*g+h*v+f*y+e[14],t[15]=a*g+u*v+p*y+e[15]),t}function rf(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 of(t,e,n){var i=e[0],r=e[1],o=e[2],a=e[3],s=e[4],l=e[5],h=e[6],u=e[7],c=e[8],d=e[9],f=e[10],p=e[11],g=e[12],v=e[13],y=e[14],m=e[15],b=n[0],w=n[1],C=n[2],x=n[3];return t[0]=b*i+w*s+C*c+x*g,t[1]=b*r+w*l+C*d+x*v,t[2]=b*o+w*h+C*f+x*y,t[3]=b*a+w*u+C*p+x*m,b=n[4],w=n[5],C=n[6],x=n[7],t[4]=b*i+w*s+C*c+x*g,t[5]=b*r+w*l+C*d+x*v,t[6]=b*o+w*h+C*f+x*y,t[7]=b*a+w*u+C*p+x*m,b=n[8],w=n[9],C=n[10],x=n[11],t[8]=b*i+w*s+C*c+x*g,t[9]=b*r+w*l+C*d+x*v,t[10]=b*o+w*h+C*f+x*y,t[11]=b*a+w*u+C*p+x*m,b=n[12],w=n[13],C=n[14],x=n[15],t[12]=b*i+w*s+C*c+x*g,t[13]=b*r+w*l+C*d+x*v,t[14]=b*o+w*h+C*f+x*y,t[15]=b*a+w*u+C*p+x*m,t}function af(t,e,n){var i,r=e.attribute,o=r.x,a=void 0===o?n.x:o,s=r.y,l=void 0===s?n.y:s,h=r.z,u=void 0===h?n.z:h,c=r.dx,d=void 0===c?n.dx:c,f=r.dy,p=void 0===f?n.dy:f,g=r.dz,v=void 0===g?n.dz:g,y=r.scaleX,m=void 0===y?n.scaleX:y,b=r.scaleY,w=void 0===b?n.scaleY:b,C=r.scaleZ,x=void 0===C?n.scaleZ:C,_=r.alpha,S=void 0===_?n.alpha:_,k=r.beta,A=void 0===k?n.beta:k,R=r.angle,B=void 0===R?n.angle:R,T=r.anchor3d,M=void 0===T?e.attribute.anchor:T,P=r.anchor,E=[0,0,0];if(M){if("string"==typeof M[0]){var H=parseFloat(M[0])/100,O=e.AABBBounds;E[0]=O.x1+(O.x2-O.x1)*H}else E[0]=M[0];if("string"==typeof M[1]){var L=parseFloat(M[1])/100,I=e.AABBBounds;E[1]=I.x1+(I.x2-I.x1)*L}else E[1]=M[1];E[2]=null!==(i=M[2])&&void 0!==i?i: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),nf(t,t,[a+d,l+p,u+v]),nf(t,t,[E[0],E[1],E[2]]),function(t,e,n){var i=Math.sin(n),r=Math.cos(n),o=e[4],a=e[5],s=e[6],l=e[7],h=e[8],u=e[9],c=e[10],d=e[11];e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=o*r+h*i,t[5]=a*r+u*i,t[6]=s*r+c*i,t[7]=l*r+d*i,t[8]=h*r-o*i,t[9]=u*r-a*i,t[10]=c*r-s*i,t[11]=d*r-l*i}(t,t,A),function(t,e,n){var i=Math.sin(n),r=Math.cos(n),o=e[0],a=e[1],s=e[2],l=e[3],h=e[8],u=e[9],c=e[10],d=e[11];e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=o*r-h*i,t[1]=a*r-u*i,t[2]=s*r-c*i,t[3]=l*r-d*i,t[8]=o*i+h*r,t[9]=a*i+u*r,t[10]=s*i+c*r,t[11]=l*i+d*r}(t,t,S),nf(t,t,[-E[0],-E[1],E[2]]),function(t,e,n){var i=n[0],r=n[1],o=n[2];t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i,t[3]=e[3]*i,t[4]=e[4]*r,t[5]=e[5]*r,t[6]=e[6]*r,t[7]=e[7]*r,t[8]=e[8]*o,t[9]=e[9]*o,t[10]=e[10]*o,t[11]=e[11]*o,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]}(t,t,[m,w,x]),B){var D=Jd.allocate(),W=[0,0];if(P){if("string"==typeof M[0]){var F=parseFloat(M[0])/100,z=e.AABBBounds;W[0]=z.x1+(z.x2-z.x1)*F}else W[0]=M[0];if("string"==typeof M[1]){var j=parseFloat(M[1])/100,N=e.AABBBounds;W[1]=N.x1+(N.x2-N.x1)*j}else W[1]=M[1]}nf(D,D,[W[0],W[1],0]),function(t,e,n){var i=Math.sin(n),r=Math.cos(n),o=e[0],a=e[1],s=e[2],l=e[3],h=e[4],u=e[5],c=e[6],d=e[7];e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=o*r+h*i,t[1]=a*r+u*i,t[2]=s*r+c*i,t[3]=l*r+d*i,t[4]=h*r-o*i,t[5]=u*r-a*i,t[6]=c*r-s*i,t[7]=d*r-l*i}(D,D,B),nf(D,D,[-W[0],-W[1],0]),of(t,t,D)}}var sf=function(){function t(e,n,i,r,o,a){Qt(this,t),this.creator=e,this.rectBoundsContribitions=n,this.symbolBoundsContribitions=i,this.circleBoundsContribitions=r,this.arcBoundsContribitions=o,this.pathBoundsContribitions=a,this.hooks={onAttributeUpdate:new sr(["graphic"]),onSetStage:new sr(["graphic","stage"]),onRemove:new sr(["graphic"]),onAddIncremental:new sr(["graphic","group","stage"]),onClearIncremental:new sr(["graphic","group","stage"]),beforeUpdateAABBBounds:new sr(["graphic","stage","willUpdate","aabbBounds"]),afterUpdateAABBBounds:new sr(["graphic","stage","aabbBounds","globalAABBBounds","selfChange"])},this.tempAABBBounds1=new ao,this.tempAABBBounds2=new ao}return Jt(t,[{key:"onAttributeUpdate",value:function(t){this.hooks.onAttributeUpdate.taps.length&&this.hooks.onAttributeUpdate.call(t)}},{key:"onSetStage",value:function(t,e){this.hooks.onSetStage.taps.length&&this.hooks.onSetStage.call(t,e)}},{key:"onRemove",value:function(t){this.hooks.onRemove.taps.length&&this.hooks.onRemove.call(t)}},{key:"onAddIncremental",value:function(t,e,n){this.hooks.onAddIncremental.taps.length&&this.hooks.onAddIncremental.call(t,e,n)}},{key:"onClearIncremental",value:function(t,e){this.hooks.onClearIncremental.taps.length&&this.hooks.onClearIncremental.call(t,e)}},{key:"beforeUpdateAABBBounds",value:function(t,e,n,i){this.hooks.beforeUpdateAABBBounds.taps.length&&this.hooks.beforeUpdateAABBBounds.call(t,e,n,i)}},{key:"afterUpdateAABBBounds",value:function(t,e,n,i,r){this.hooks.afterUpdateAABBBounds.taps.length&&this.hooks.afterUpdateAABBBounds.call(t,e,n,i,r)}},{key:"updatePathProxyAABBBounds",value:function(t,e){var n="function"==typeof e.pathProxy?e.pathProxy(e.attribute):e.pathProxy;if(!n)return!1;var i=new Wo(t);return Vo(n.commandList,i,0,0),!0}},{key:"updateRectAABBBounds",value:function(t,e,n,i){if(!this.updatePathProxyAABBBounds(n,i)){var r=t.width,o=void 0===r?e.width:r,a=t.height,s=void 0===a?e.height:a;n.set(0,0,o,s)}var l=this.tempAABBBounds1,h=this.tempAABBBounds2;return l.setValue(n.x1,n.y1,n.x2,n.y2),h.setValue(n.x1,n.y1,n.x2,n.y2),this._rectBoundsContribitions||(this._rectBoundsContribitions=this.rectBoundsContribitions.getContributions()||[]),this._rectBoundsContribitions.length&&this._rectBoundsContribitions.forEach((function(r){r.updateBounds(t,e,l,i),n.union(l),l.setValue(h.x1,h.y1,h.x2,h.y2)})),this.transformAABBBounds(t,n,e,i),n}},{key:"updateGroupAABBBounds",value:function(t,e,n,i){var r=t.width,o=t.height,a=t.path,s=t.clip,l=void 0===s?e.clip:s;a&&a.length?a.forEach((function(t){n.union(t.AABBBounds)})):null!=r&&null!=o&&n.set(0,0,r,o),l||i.forEachChildren((function(t){n.union(t.AABBBounds)}));var h=this.tempAABBBounds1,u=this.tempAABBBounds2;return h.setValue(n.x1,n.y1,n.x2,n.y2),u.setValue(n.x1,n.y1,n.x2,n.y2),this.transformAABBBounds(t,n,e,i),n}},{key:"updateGlyphAABBBounds",value:function(t,e,n,i){return i.getSubGraphic().forEach((function(t){n.union(t.AABBBounds)})),n}},{key:"updateRichTextAABBBounds",value:function(t,e,n,i){if(!i)return n;var r=t.width,o=void 0===r?e.width:r,a=t.height,s=void 0===a?e.height:a,l=t.maxWidth,h=void 0===l?e.maxWidth:l,u=t.maxHeight,c=void 0===u?e.maxHeight:u,d=t.textAlign,f=void 0===d?e.textAlign:d,p=t.textBaseline,g=void 0===p?e.textBaseline:p;if(o>0&&s>0)n.set(0,0,o,s);else{var v=i.getFrameCache().getActualSize(),y=v.width,m=v.height,b=o||y||0,w=s||m||0;w="number"==typeof c&&w>c?c:w||0,b="number"==typeof h&&b>h?h:b||0,n.set(0,0,b,w)}var C=0;switch(g){case"top":C=0;break;case"middle":C=-n.height()/2;break;case"bottom":C=-n.height()}var x=0;switch(f){case"left":x=0;break;case"center":x=-n.width()/2;break;case"right":x=-n.width()}n.translate(x,C);var _=this.tempAABBBounds1,S=this.tempAABBBounds2;return _.setValue(n.x1,n.y1,n.x2,n.y2),S.setValue(n.x1,n.y1,n.x2,n.y2),this.transformAABBBounds(t,n,e,i),n}},{key:"updateTextAABBBounds",value:function(t,e,n,i){if(!i)return n;var r=i.attribute.text,o=void 0===r?e.text:r;Array.isArray(o)?i.updateMultilineAABBBounds(o):i.updateSingallineAABBBounds(o);var a=this.tempAABBBounds1,s=this.tempAABBBounds2;return a.setValue(n.x1,n.y1,n.x2,n.y2),s.setValue(n.x1,n.y1,n.x2,n.y2),ro(n,n,i.transMatrix),n}},{key:"updatePathAABBBounds",value:function(t,e,n,i){this.updatePathProxyAABBBounds(n,i)||this.updatePathAABBBoundsImprecise(t,e,n,i);var r=this.tempAABBBounds1,o=this.tempAABBBounds2;return r.setValue(n.x1,n.y1,n.x2,n.y2),o.setValue(n.x1,n.y1,n.x2,n.y2),this._pathBoundsContribitions||(this._pathBoundsContribitions=this.pathBoundsContribitions.getContributions()||[]),this._pathBoundsContribitions.length&&this._pathBoundsContribitions.forEach((function(a){a.updateBounds(t,e,r,i),n.union(r),r.setValue(o.x1,o.y1,o.x2,o.y2)})),this.transformAABBBounds(t,n,e,i),n}},{key:"updatePathAABBBoundsImprecise",value:function(t,e,n,i){if(!i)return n;var r=i.getParsedPathShape();return n.union(r.getBounds()),n}},{key:"updatePyramid3dAABBBounds",value:function(t,e,n,i){if(!i)return n;var r=i.stage;if(!r||!r.camera)return n;i.findFace().vertices.forEach((function(t){var e=t[0],i=t[1];n.add(e,i)}));var o=this.tempAABBBounds1,a=this.tempAABBBounds2;return o.setValue(n.x1,n.y1,n.x2,n.y2),a.setValue(n.x1,n.y1,n.x2,n.y2),this.transformAABBBounds(t,n,e,i),n}},{key:"updateArc3dAABBBounds",value:function(t,e,n,i){if(!i)return n;var r=i.stage;if(!r||!r.camera)return n;var o=t.outerRadius,a=void 0===o?e.outerRadius:o,s=t.height,l=a+(void 0===s?0:s);n.setValue(-l,-l,l,l);var h=this.tempAABBBounds1,u=this.tempAABBBounds2;return h.setValue(n.x1,n.y1,n.x2,n.y2),u.setValue(n.x1,n.y1,n.x2,n.y2),this.transformAABBBounds(t,n,e,i),n}},{key:"updatePolygonAABBBounds",value:function(t,e,n,i){this.updatePathProxyAABBBounds(n,i)||this.updatePolygonAABBBoundsImprecise(t,e,n,i);var r=this.tempAABBBounds1,o=this.tempAABBBounds2;return r.setValue(n.x1,n.y1,n.x2,n.y2),o.setValue(n.x1,n.y1,n.x2,n.y2),this.transformAABBBounds(t,n,e,i),n}},{key:"updatePolygonAABBBoundsImprecise",value:function(t,e,n,i){var r=t.points;return(void 0===r?e.points:r).forEach((function(t){n.add(t.x,t.y)})),n}},{key:"updateLineAABBBounds",value:function(t,e,n,i){this.updatePathProxyAABBBounds(n,i)||(t.segments?this.updateLineAABBBoundsBySegments(t,e,n,i):this.updateLineAABBBoundsByPoints(t,e,n,i));var r=this.tempAABBBounds1,o=this.tempAABBBounds2;return r.setValue(n.x1,n.y1,n.x2,n.y2),o.setValue(n.x1,n.y1,n.x2,n.y2),this.transformAABBBounds(t,n,e,i),n}},{key:"updateLineAABBBoundsByPoints",value:function(t,e,n,i){var r=t.points,o=void 0===r?e.points:r,a=n;return o.forEach((function(t){a.add(t.x,t.y)})),a}},{key:"updateLineAABBBoundsBySegments",value:function(t,e,n,i){var r=t.segments,o=void 0===r?e.segments:r,a=n;return o.forEach((function(t){t.points.forEach((function(t){a.add(t.x,t.y)}))})),a}},{key:"updateAreaAABBBounds",value:function(t,e,n,i){this.updatePathProxyAABBBounds(n,i)||(t.segments?this.updateAreaAABBBoundsBySegments(t,e,n,i):this.updateAreaAABBBoundsByPoints(t,e,n,i));var r=this.tempAABBBounds1,o=this.tempAABBBounds2;return r.setValue(n.x1,n.y1,n.x2,n.y2),o.setValue(n.x1,n.y1,n.x2,n.y2),this.transformAABBBounds(t,n,e,i),n}},{key:"updateAreaAABBBoundsByPoints",value:function(t,e,n,i){var r=t.points,o=void 0===r?e.points:r,a=n;return o.forEach((function(t){var e,n;a.add(t.x,t.y),a.add(null!==(e=t.x1)&&void 0!==e?e:t.x,null!==(n=t.y1)&&void 0!==n?n:t.y)})),a}},{key:"updateAreaAABBBoundsBySegments",value:function(t,e,n,i){var r=t.segments,o=void 0===r?e.segments:r,a=n;return o.forEach((function(t){t.points.forEach((function(t){var e,n;a.add(t.x,t.y),a.add(null!==(e=t.x1)&&void 0!==e?e:t.x,null!==(n=t.y1)&&void 0!==n?n:t.y)}))})),a}},{key:"updateCircleAABBBounds",value:function(t,e,n,i,r){this.updatePathProxyAABBBounds(n,r)||(i?this.updateCircleAABBBoundsImprecise(t,e,n,r):this.updateCircleAABBBoundsAccurate(t,e,n,r));var o=this.tempAABBBounds1,a=this.tempAABBBounds2;return o.setValue(n.x1,n.y1,n.x2,n.y2),a.setValue(n.x1,n.y1,n.x2,n.y2),this._circleBoundsContribitions||(this._circleBoundsContribitions=this.circleBoundsContribitions.getContributions()||[]),this._circleBoundsContribitions.length&&this._circleBoundsContribitions.forEach((function(i){i.updateBounds(t,e,o,r),n.union(o),o.setValue(a.x1,a.y1,a.x2,a.y2)})),this.transformAABBBounds(t,n,e,r),n}},{key:"updateCircleAABBBoundsImprecise",value:function(t,e,n,i){var r=t.radius,o=void 0===r?e.radius:r;return n.set(-o,-o,o,o),n}},{key:"updateCircleAABBBoundsAccurate",value:function(t,e,n,i){var r=t.startAngle,o=void 0===r?e.startAngle:r,a=t.endAngle,s=void 0===a?e.endAngle:a,l=t.radius,h=void 0===l?e.radius:l;return s-o>Gr-Fr?n.set(-h,-h,h,h):Vl(o,s,h,n),n}},{key:"updateArcAABBBounds",value:function(t,e,n,i,r){this.updatePathProxyAABBBounds(n,r)||(i?this.updateArcAABBBoundsImprecise(t,e,n,r):this.updateArcAABBBoundsAccurate(t,e,n,r));var o=this.tempAABBBounds1,a=this.tempAABBBounds2;return o.setValue(n.x1,n.y1,n.x2,n.y2),a.setValue(n.x1,n.y1,n.x2,n.y2),this._arcBoundsContribitions||(this._arcBoundsContribitions=this.arcBoundsContribitions.getContributions()||[]),this._arcBoundsContribitions.length&&this._arcBoundsContribitions.forEach((function(i){i.updateBounds(t,e,o,r),n.union(o),o.setValue(a.x1,a.y1,a.x2,a.y2)})),this.transformAABBBounds(t,n,e,r),n}},{key:"updateArcAABBBoundsImprecise",value:function(t,e,n,i){var r=t.outerRadius,o=void 0===r?e.outerRadius:r;return n.set(-o,-o,o,o),n}},{key:"updateArcAABBBoundsAccurate",value:function(t,e,n,i){var r=t.outerRadius,o=void 0===r?e.outerRadius:r,a=t.innerRadius,s=void 0===a?e.innerRadius:a,l=t.endAngle,h=void 0===l?e.endAngle:l,u=t.startAngle,c=void 0===u?e.startAngle:u;return o<=Fr?n.set(0,0,0,0):Math.abs(h-c)>Gr-Fr?n.set(-o,-o,o,o):(Vl(c,h,o,n),Vl(c,h,s,n)),n}},{key:"updateSymbolAABBBounds",value:function(t,e,n,i,r){this.updatePathProxyAABBBounds(n,r)||(i?this.updateSymbolAABBBoundsImprecise(t,e,n,r):this.updateSymbolAABBBoundsAccurate(t,e,n,r));var o=this.tempAABBBounds1,a=this.tempAABBBounds2;return o.setValue(n.x1,n.y1,n.x2,n.y2),a.setValue(n.x1,n.y1,n.x2,n.y2),this._symbolBoundsContribitions||(this._symbolBoundsContribitions=this.symbolBoundsContribitions.getContributions()||[]),this._symbolBoundsContribitions.length&&this._symbolBoundsContribitions.forEach((function(i){i.updateBounds(t,e,o,r),n.union(o),o.setValue(a.x1,a.y1,a.x2,a.y2)})),this.transformAABBBounds(t,n,e,r),n}},{key:"updateSymbolAABBBoundsImprecise",value:function(t,e,n,i){var r=t.size,o=void 0===r?e.size:r;if(Sr(o))n.set(-o[0]/2,-o[1]/2,o[0]/2,o[1]/2);else{var a=o/2;n.set(-a,-a,a,a)}return n}},{key:"updateSymbolAABBBoundsAccurate",value:function(t,e,n,i){if(!i)return n;var r=t.size,o=void 0===r?e.size:r;return i.getParsedPath().bounds(o,n),n}},{key:"updateImageAABBBounds",value:function(t,e,n,i){if(!this.updatePathProxyAABBBounds(n,i)){var r=t.width,o=void 0===r?e.width:r,a=t.height,s=void 0===a?e.height:a;n.set(0,0,o,s)}var l=this.tempAABBBounds1,h=this.tempAABBBounds2;return l.setValue(n.x1,n.y1,n.x2,n.y2),h.setValue(n.x1,n.y1,n.x2,n.y2),this.transformAABBBounds(t,n,e,i),n}},{key:"combindShadowAABBBounds",value:function(t,e){if(e&&e.shadowRoot){var n=e.shadowRoot.AABBBounds;t.union(n)}}},{key:"transformAABBBounds",value:function(t,e,n,i){var r=t.scaleX,o=void 0===r?n.scaleX:r,a=t.scaleY,s=void 0===a?n.scaleY:a,l=t.stroke,h=void 0===l?n.stroke:l,u=t.shadowBlur,c=void 0===u?n.shadowBlur:u,d=t.lineWidth,f=void 0===d?n.lineWidth:d,p=t.lineJoin,g=void 0===p?n.lineJoin:p,v=t.strokeBoundsBuffer,y=void 0===v?n.strokeBoundsBuffer:v,m=this.tempAABBBounds1,b=this.tempAABBBounds2;h&&(bh(m,f/Math.abs(o+s),"miter"===g,y),e.union(m),m.setValue(b.x1,b.y1,b.x2,b.y2));c&&(bh(m,c/Math.abs(o+s),"miter"===g,y),e.union(m));this.combindShadowAABBBounds(e,i),ro(e,e,i.transMatrix)}}]),t}();function lf(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=re(t);if(e){var r=re(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return ie(this,n)}}sf=Qd([Zi(),ef(0,tr(zh)),ef(1,tr(lr)),ef(1,Ji(Pd)),ef(2,tr(lr)),ef(2,Ji(Ld)),ef(3,tr(lr)),ef(3,Ji(Fd)),ef(4,tr(lr)),ef(4,Ji(Gd)),ef(5,tr(lr)),ef(5,Ji(Yd)),tf("design:paramtypes",[Object,Object,Object,Object,Object,Object])],sf);var hf=function(t){ee(n,t);var e=lf(n);function n(t){var i;return Qt(this,n),(i=e.call(this,{x:0,y:0})).type="shadowroot",i.shadowHost=t,i}return Jt(n,[{key:"addUpdateBoundTag",value:function(){Yo(re(n.prototype),"addUpdateBoundTag",this).call(this),this.shadowHost&&this.shadowHost.addUpdateBoundTag()}},{key:"addUpdateShapeAndBoundsTag",value:function(){Yo(re(n.prototype),"addUpdateShapeAndBoundsTag",this).call(this),this.shadowHost&&this.shadowHost.addUpdateBoundTag()}},{key:"tryUpdateGlobalTransMatrix",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(this.shouldUpdateGlobalMatrix()){var e=this.transMatrix;this._globalTransMatrix?this._globalTransMatrix.setValue(e.a,e.b,e.c,e.d,e.e,e.f):this._globalTransMatrix=e.clone(),this.doUpdateGlobalMatrix(),t&&this.clearUpdateGlobalPositionTag()}return this._globalTransMatrix}},{key:"doUpdateGlobalMatrix",value:function(){if(this.shadowHost){var t=this.shadowHost.globalTransMatrix;this._globalTransMatrix.multiply(t.a,t.b,t.c,t.d,t.e,t.f)}}},{key:"tryUpdateGlobalAABBBounds",value:function(){return this._globalAABBBounds?this._globalAABBBounds.setValue(this._AABBBounds.x1,this._AABBBounds.y1,this._AABBBounds.x2,this._AABBBounds.y2):this._globalAABBBounds=this._AABBBounds.clone(),this.shadowHost&&this._globalAABBBounds.transformWithMatrix(this.shadowHost.globalTransMatrix),this._globalAABBBounds}}]),n}(Nh);function uf(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=re(t);if(e){var r=re(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return ie(this,n)}}var cf=["heightLimit","lineClamp"],df=function(t){ee(n,t);var e=uf(n);function n(){return Qt(this,n),e.apply(this,arguments)}return Jt(n,[{key:"_isValid",value:function(){var t=this.attribute.text;return Sr(t)?!t.every((function(t){return null==t||""===t})):null!=t&&""!==t}},{key:"updateMultilineAABBBounds",value:function(t){var e,n=Js(this).text,i=this.attribute,r=i.fontFamily,o=void 0===r?n.fontFamily:r,a=i.textAlign,s=void 0===a?n.textAlign:a,l=i.textBaseline,h=void 0===l?n.textBaseline:l,u=i.fontSize,c=void 0===u?n.fontSize:u,d=i.lineHeight,f=void 0===d?this.attribute.lineHeight||this.attribute.fontSize||n.fontSize:d,p=i.ellipsis,g=void 0===p?n.ellipsis:p,v=i.maxLineWidth,y=i.stroke,m=void 0===y?n.stroke:y,b=i.lineWidth,w=void 0===b?n.lineWidth:b,C=i.heightLimit,x=void 0===C?0:C,_=i.lineClamp;if(!this.shouldUpdateShape()&&(null===(e=this.cache)||void 0===e?void 0:e.layoutData)){var S=this.cache.layoutData.bbox;return this._AABBBounds.set(S.xOffset,S.yOffset,S.xOffset+S.width,S.yOffset+S.height),m&&this._AABBBounds.expand(w/2),this._AABBBounds}var k=as.graphicUtil.textMeasure,A=new Ru(o,{fontSize:c},k),R=t.map((function(t){return t.toString()})),B=[],T=[0,0],M=1/0;if(x>0&&(M=Math.max(Math.floor(x/f),1)),_&&(M=Math.min(M,_)),"number"==typeof v&&v!==1/0){if(v>0)for(var P=0;P<R.length;P++){var E=R[P];if(P===M-1){var H=A.textMeasure.clipTextWithSuffix(E,A.textOptions,v,g);B.push({str:H.str,width:H.width});break}var O=A.textMeasure.clipText(E,A.textOptions,v);if(B.push({str:O.str,width:O.width}),O.str.length===E.length);else{var L=E.substring(O.str.length);R.splice(P+1,0,L)}}var I=0;B.forEach((function(t){I=Math.max(I,t.width)})),T[0]=I}else{for(var D,W,F=0,z=0,j=R.length;z<j;z++){if(z===M-1){var N=A.textMeasure.clipTextWithSuffix(R[z],A.textOptions,v,g);B.push({str:N.str,width:N.width}),F=Math.max(F,N.width);break}W=R[z],D=A.textMeasure.measureTextWidth(W,A.textOptions),F=Math.max(F,D),B.push({str:W,width:D})}T[0]=F}T[1]=B.length*(f+2);var G={xOffset:0,yOffset:0,width:T[0],height:T[1]};A.LayoutBBox(G,s,h);var U=A.layoutWithBBox(G,B,s,h,f);return this.cache.layoutData=U,this.clearUpdateShapeTag(),this._AABBBounds.set(G.xOffset,G.yOffset,G.xOffset+G.width,G.yOffset+G.height),m&&this._AABBBounds.expand(w/2),this._AABBBounds}},{key:"needUpdateTags",value:function(t){for(var e=0;e<cf.length;e++){var i=cf[e];if(-1!==t.indexOf(i))return!0}return Yo(re(n.prototype),"needUpdateTags",this).call(this,t)}},{key:"needUpdateTag",value:function(t){for(var e=0;e<cf.length;e++)if(t===cf[e])return!0;return Yo(re(n.prototype),"needUpdateTag",this).call(this,t)}}]),n}(Mu);function ff(t){return new _d(t)}function pf(t){return new _u(t)}function gf(t){return new Nh(t)}function vf(t){return new Nc(t)}function yf(t){return new Kc(t)}function mf(t){return new Mu(t)}function bf(t){return new Fc(t)}function wf(t){return new sd(t)}var Cf={arc:ff,area:function(t){return new wd(t)},circle:pf,group:gf,image:wf,line:vf,path:function(t){return new yd(t)},rect:yf,rect3d:function(t){return new Xc(t)},symbol:bf,text:mf,richtext:function(t){return new pd(t)},polygon:function(t){return new Ad(t)},shadowRoot:function(t){return new hf(t)},wrapText:function(t){return new df(t)}},xf=mf({text:""});function _f(t){return xf.setAttributes(t),xf.AABBBounds}var Sf,kf=function(){function t(){Qt(this,t),this.pools=[]}return Jt(t,[{key:"allocate",value:function(t){if(!this.pools.length)return hs(Object.assign({nativeCanvas:as.global.createCanvas(t)},t));var e=this.pools.pop();return e.resize(t.width,t.height),e.dpr=t.dpr,e}},{key:"allocateByObj",value:function(t){if(!this.pools.length){var e={width:t.width/t.dpr,height:t.height/t.dpr,dpr:t.dpr};return hs(Object.assign({nativeCanvas:as.global.createCanvas(e)},e))}var n=this.pools.pop();return n.width=t.width,n.height=t.height,n}},{key:"free",value:function(t){this.pools.push(t)}},{key:"length",get:function(){return this.pools.length}},{key:"release",value:function(){this.pools=[]}}]),t}(),Af=new kf,Rf=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a};!function(t){t[t.beforeFillStroke=0]="beforeFillStroke",t[t.afterFillStroke=1]="afterFillStroke"}(Sf||(Sf={}));var Bf=function(){function t(){Qt(this,t),this.time=Sf.beforeFillStroke,this.useStyle=!0,this.order=0}return Jt(t,[{key:"drawShape",value:function(t,e,n,i,r,o,a,s,l,h,u,c){var d=t.attribute.background;if(d)if(t.backgroundImg&&t.resources){var f=t.resources.get(d);if("success"!==f.state||!f.data)return;if(e.save(),t.parent&&!t.transMatrix.onlyTranslate()){var p=Js(t.parent).group,g=t.parent.attribute,v=g.scrollX,y=void 0===v?p.scrollX:v,m=g.scrollY,b=void 0===m?p.scrollY:m;e.setTransformFromMatrix(t.parent.globalTransMatrix,!0),e.translate(y,b)}e.clip();var w=t.AABBBounds;e.setCommonStyle(t,t.attribute,n,i,l),e.drawImage(f.data,w.x1,w.y1,w.width(),w.height()),e.restore(),t.transMatrix.onlyTranslate()||e.setTransformForCurrent()}else e.highPerformanceSave(),e.setCommonStyle(t,t.attribute,n,i,l),e.fillStyle=d,e.fill(),e.highPerformanceRestore()}}]),t}();Bf=Rf([Zi()],Bf);var Tf=function(){function t(){Qt(this,t),this.time=Sf.afterFillStroke,this.useStyle=!0,this.order=10}return Jt(t,[{key:"createCommonPattern",value:function(t,e,n,i,r){var o=(t-2*e)/2,a=Af.allocate({width:t,height:t,dpr:1}),s=a.getContext("2d");if(!s)return null;s.clearRect(0,0,t,t),r(o,s);var l=i.createPattern(a.nativeCanvas,"repeat");return Af.free(a),l}},{key:"createCirclePattern",value:function(t,e,n,i){return this.createCommonPattern(t,e,n,i,(function(t,e){e.fillStyle=n,e.arc(t,t,t,0,Gr),e.fill()}))}},{key:"createDiamondPattern",value:function(t,e,n,i){return this.createCommonPattern(t,e,n,i,(function(e,i){var r=t/2,o=r;i.fillStyle=n,i.moveTo(r,o-e),i.lineTo(e+r,o),i.lineTo(r,o+e),i.lineTo(r-e,o),i.closePath(),i.fill()}))}},{key:"createRectPattern",value:function(t,e,n,i){return this.createCommonPattern(t,e,n,i,(function(t,i){var r=e,o=r;i.fillStyle=n,i.fillRect(r,o,2*t,2*t)}))}},{key:"createVerticalLinePattern",value:function(t,e,n,i){return this.createCommonPattern(t,e,n,i,(function(i,r){var o=e;r.fillStyle=n,r.fillRect(o,0,2*i,t)}))}},{key:"createHorizontalLinePattern",value:function(t,e,n,i){return this.createCommonPattern(t,e,n,i,(function(i,r){var o=e;r.fillStyle=n,r.fillRect(0,o,t,2*i)}))}},{key:"createBiasLRLinePattern",value:function(t,e,n,i){return this.createCommonPattern(t,e,n,i,(function(e,i){i.strokeStyle=n,i.lineWidth=e,i.moveTo(0,0),i.lineTo(t,t);var r=t/2,o=-r;i.moveTo(r,o),i.lineTo(r+t,o+t),i.moveTo(-r,-o),i.lineTo(-r+t,-o+t),i.stroke()}))}},{key:"createBiasRLLinePattern",value:function(t,e,n,i){return this.createCommonPattern(t,e,n,i,(function(e,i){i.strokeStyle=n,i.lineWidth=e,i.moveTo(t,0),i.lineTo(0,t);var r=t/2,o=r;i.moveTo(t+r,o),i.lineTo(r,o+t),i.moveTo(t-r,-o),i.lineTo(-r,-o+t),i.stroke()}))}},{key:"createGridPattern",value:function(t,e,n,i){return this.createCommonPattern(t,e,n,i,(function(t,i){var r=e,o=r;i.fillStyle=n,i.fillRect(r,o,t,t),i.fillRect(r+t,o+t,t,t)}))}},{key:"initTextureMap",value:function(t,e){this.textureMap=new Map}},{key:"drawShape",value:function(t,e,n,i,r,o,a,s,l,h,u,c){this.textureMap||this.initTextureMap(e,t.stage);var d=t.attribute,f=d.texture,p=void 0===f?l.texture:f,g=d.textureColor,v=void 0===g?l.textureColor:g,y=d.textureSize,m=void 0===y?l.textureSize:y,b=d.texturePadding,w=void 0===b?l.texturePadding:b;if(p){var C=this.textureMap.get(p);if(!C)switch(p){case"circle":C=this.createCirclePattern(m,w,v,e);break;case"diamond":C=this.createDiamondPattern(m,w,v,e);break;case"rect":C=this.createRectPattern(m,w,v,e);break;case"vertical-line":C=this.createVerticalLinePattern(m,w,v,e);break;case"horizontal-line":C=this.createHorizontalLinePattern(m,w,v,e);break;case"bias-lr":C=this.createBiasLRLinePattern(m,w,v,e);break;case"bias-rl":C=this.createBiasRLLinePattern(m,w,v,e);break;case"grid":C=this.createGridPattern(m,w,v,e)}C&&(e.highPerformanceSave(),e.setCommonStyle(t,t.attribute,n,i,l),e.fillStyle=C,e.fill(),e.highPerformanceRestore())}}}]),t}();function Mf(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=re(t);if(e){var r=re(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return ie(this,n)}}Tf=Rf([Zi()],Tf);var Pf=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},Ef=Symbol.for("ArcRenderContribution"),Hf=function(){function t(){Qt(this,t),this.time=Sf.afterFillStroke,this.useStyle=!0,this.order=0}return Jt(t,[{key:"drawShape",value:function(t,e,n,i,r,o,a,s,l,h,u){var c=t.attribute,d=c.innerRadius,f=void 0===d?l.innerRadius:d,p=c.outerRadius,g=void 0===p?l.outerRadius:p,v=c.startAngle,y=void 0===v?l.startAngle:v,m=c.endAngle,b=void 0===m?l.endAngle:m,w=c.opacity,C=void 0===w?l.opacity:w,x=c.outerBorder,_=c.innerBorder;if(x){var S=x.distance,k=void 0===S?l.outerBorder.distance:S,A=bu(e,k,e.dpr),R=k/g;if(t.setAttributes({outerRadius:g+A,innerRadius:f-A,startAngle:y-R,endAngle:b+R}),e.beginPath(),gu(t,e,n,i,g+A,f-A),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,l),u)u(e,x,l.outerBorder);else if(s){var B=l.outerBorder.opacity;l.outerBorder.opacity=C,e.setStrokeStyle(t,x,n,i,l.outerBorder),l.outerBorder.opacity=B,e.stroke()}}if(_){var T=_.distance,M=void 0===T?l.innerBorder.distance:T,P=bu(e,M,e.dpr),E=M/g;if(t.setAttributes({outerRadius:g-P,innerRadius:f+P,startAngle:y+E,endAngle:b-E}),e.beginPath(),gu(t,e,n,i,g-P,f+P),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,l),u)u(e,_,l.innerBorder);else if(s){var H=l.innerBorder.opacity;l.innerBorder.opacity=C,e.setStrokeStyle(t,_,n,i,l.innerBorder),l.innerBorder.opacity=H,e.stroke()}}t.setAttributes({outerRadius:g,innerRadius:f,startAngle:y,endAngle:b})}}]),t}();Hf=Pf([Zi()],Hf);var Of=function(t){ee(n,t);var e=Mf(n);function n(){var t;return Qt(this,n),(t=e.apply(this,arguments)).time=Sf.beforeFillStroke,t}return Jt(n)}(Bf);Of=Pf([Zi()],Of);var Lf=function(t){ee(n,t);var e=Mf(n);function n(){var t;return Qt(this,n),(t=e.apply(this,arguments)).time=Sf.afterFillStroke,t}return Jt(n)}(Tf);Lf=Pf([Zi()],Lf);var If=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},Df=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Wf=function(t,e){return function(n,i){e(n,i,t)}},Ff=function(){function t(e){Qt(this,t),this.arcRenderContribitions=e,this.numberType=_h}return Jt(t,[{key:"drawArcTailCapPath",value:function(t,e,n,i,r,o,a,s){var l=s-a,h=t.getParsedAngle(),u=h.startAngle,c=h.endAngle,d=Ur((c=s)-u),f=c>u,p=!1;if(r<o){var g=r;r=o,o=g}var v=t.getParsedCornerRadius(),y=t.getParsePadAngle(u,c);y.outerDeltaAngle;var m,b,w,C,x=y.innerDeltaAngle,_=y.outerStartAngle,S=y.outerEndAngle,k=y.innerEndAngle,A=y.innerStartAngle,R=v,B=v,T=v,M=v,P=Math.max(B,R),E=Math.max(T,M),H=P,O=E,L=r*Vr(_),I=r*$r(_),D=o*Vr(k),W=o*$r(k);if((E>Fr||P>Fr)&&(m=r*Vr(S),b=r*$r(S),w=o*Vr(A),C=o*$r(A),d<zr)){var F=fu(L,I,w,C,m,b,D,W);if(F){var z=L-F[0],j=I-F[1],N=m-F[0],G=b-F[1],U=1/$r(Jr((z*N+j*G)/(qr(z*z+j*j)*qr(N*N+G*G)))/2),K=qr(F[0]*F[0]+F[1]*F[1]);O=Xr(E,(o-K)/(U-1)),H=Xr(P,(r-K)/(U+1))}}if(H>Fr){var V=Xr(R,H),Y=Xr(B,H),X=pu(w,C,L,I,r,V,Number(f)),$=pu(m,b,D,W,r,Y,Number(f));if(H<P&&V===Y)e.moveTo(n+X.cx+X.x01,i+X.cy+X.y01),e.arc(n+X.cx,i+X.cy,H,Kr(X.y01,X.x01),Kr($.y01,$.x01),!f);else{var q=c-l-.03,Z=Kr($.y11,$.x11);e.arc(n,i,r,q,Z,!f),Y>0&&e.arc(n+$.cx,i+$.cy,Y,Kr($.y11,$.x11),Kr($.y01,$.x01),!f)}}else e.moveTo(n+L,i+I);if(!(o>Fr)||x<.001)e.lineTo(n+D,i+W),p=!0;else if(O>Fr){var J=Xr(M,O),Q=Xr(T,O),tt=pu(D,W,m,b,o,-Q,Number(f)),et=pu(L,I,w,C,o,-J,Number(f));if(e.lineTo(n+tt.cx+tt.x01,i+tt.cy+tt.y01),O<E&&J===Q){var nt=Kr(et.y01,et.x01);e.arc(n+tt.cx,i+tt.cy,O,Kr(tt.y01,tt.x01),nt,!f)}else{Q>0&&e.arc(n+tt.cx,i+tt.cy,Q,Kr(tt.y01,tt.x01),Kr(tt.y11,tt.x11),!f);var it=Kr(tt.cy+tt.y11,tt.cx+tt.x11),rt=c-l-.03;e.arc(n,i,o,it,rt,f)}}else e.lineTo(n+o*Vr(A),i+o*$r(A));return p}},{key:"drawShape",value:function(t,e,n,i,r,o,a,s){var l=Js(t,null==o?void 0:o.theme).arc,h=t.attribute,u=h.fill,c=void 0===u?l.fill:u,d=h.background,f=h.stroke,p=void 0===f?l.stroke:f,g=h.opacity,v=void 0===g?l.opacity:g,y=h.fillOpacity,m=void 0===y?l.fillOpacity:y,b=h.lineWidth,w=void 0===b?l.lineWidth:b,C=h.strokeOpacity,x=void 0===C?l.strokeOpacity:C,_=h.visible,S=void 0===_?l.visible:_,k=h.x,A=void 0===k?l.x:k,R=h.y,B=void 0===R?l.y:R,T=lu(v,m),M=uu(v,x),P=au(c),E=su(p,w);if(t.valid&&S&&(P||E||d)&&(T||M||a||s||d)){var H=t.attribute,O=H.outerRadius,L=void 0===O?l.outerRadius:O,I=H.innerRadius,D=void 0===I?l.innerRadius:I,W=H.cap,F=void 0===W?l.cap:W,z=H.forceShowCap,j=void 0===z?l.forceShowCap:z,N=function(t){var e,n=!0;if(vr(t,!0)){for(var i=0;i<4;i++)jl[i]=t,n&&(n=!(null!==(e=jl[i])&&void 0!==e&&!e));n=t}else if(Array.isArray(t))for(var r=0;r<4;r++)jl[r]=!!t[r],n&&(n=!!jl[r]);else jl[0]=!1,jl[1]=!1,jl[2]=!1,jl[3]=!1;return{isFullStroke:n,stroke:jl}}(p),G=N.isFullStroke,U=N.stroke;if((P||G)&&(e.beginPath(),gu(t,e,n,i,L,D),this._arcRenderContribitions||(this._arcRenderContribitions=this.arcRenderContribitions.getContributions()||[],this._arcRenderContribitions.sort((function(t,e){return e.order-t.order}))),this._arcRenderContribitions.forEach((function(r){r.time===Sf.beforeFillStroke&&r.drawShape(t,e,n,i,P,E,T,M,l,a,s)})),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,l),P&&(a?a(e,t.attribute,l):T&&(e.setCommonStyle(t,t.attribute,A-n,B-i,l),e.fill())),E&&G&&(s?s(e,t.attribute,l):M&&(e.setStrokeStyle(t,t.attribute,A-n,B-i,l),e.stroke()))),!G&&E&&(e.beginPath(),gu(t,e,n,i,L,D,U),s?s(e,t.attribute,l):M&&(e.setStrokeStyle(t,t.attribute,n,i,l),e.stroke())),F&&j){var K=t.getParsedAngle(),V=K.startAngle,Y=K.endAngle;if(Ur(Y-V)>=Gr-Fr){e.beginPath();var X=Math.abs(L-D)/2/L,$=t.attribute,q=$.endAngle,Z=void 0===q?l.endAngle:q,J=$.fill,Q=void 0===J?l.fill:J,tt=Z;if(this.drawArcTailCapPath(t,e,n,i,L,D,tt,tt+X),P){var et=Q;if("conical"===et.gradient){var nt=function(t,e,n,i){for(var r=i.stops,o=i.startAngle,a=i.endAngle;n<0;)n+=Gr;for(;n>Gr;)n-=Gr;if(n<o)return r[0].color;if(n>a)return r[0].color;for(var s,l,h=(n-o)/(a-o),u=0;u<r.length;u++)if(r[u].offset>=h){s=r[u-1],l=r[u];break}return h=(h-s.offset)/(l.offset-s.offset),ah(s.color,l.color,h,!1)}(0,0,Z,et);a||lu&&(e.setCommonStyle(t,t.attribute,n,i,l),e.fillStyle=nt,e.fill())}}E&&(s||M&&(e.setStrokeStyle(t,t.attribute,n,i,l),e.stroke()))}}this._arcRenderContribitions||(this._arcRenderContribitions=this.arcRenderContribitions.getContributions()||[]),this._arcRenderContribitions.forEach((function(r){r.time===Sf.afterFillStroke&&r.drawShape(t,e,n,i,P,E,T,M,l,a,s)}))}}},{key:"draw",value:function(t,e,n,i){var r=n.context;if(r){var o=Js(t,null==i?void 0:i.theme).arc;r.highPerformanceSave();var a=t.attribute,s=a.x,l=void 0===s?o.x:s,h=a.y,u=void 0===h?o.y:h;if(t.transMatrix.onlyTranslate()){var c=t.getOffsetXY(o);l+=c.x,u+=c.y,r.setTransformForCurrent()}else l=0,u=0,r.transformFromMatrix(t.transMatrix,!0);du(t,r,l,u,0,i)||this.drawShape(t,r,l,u,n,i),r.highPerformanceRestore()}}}]),t}();function zf(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=re(t);if(e){var r=re(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return ie(this,n)}}Ff=If([Zi(),Wf(0,tr(lr)),Wf(0,Ji(Ef)),Df("design:paramtypes",[Object])],Ff);var jf=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},Nf=Symbol.for("CircleRenderContribution"),Gf=function(){function t(){Qt(this,t),this.time=Sf.afterFillStroke,this.useStyle=!0,this.order=0}return Jt(t,[{key:"drawShape",value:function(t,e,n,i,r,o,a,s,l,h,u){var c=t.attribute,d=c.radius,f=void 0===d?l.radius:d,p=c.startAngle,g=void 0===p?l.startAngle:p,v=c.endAngle,y=void 0===v?l.endAngle:v,m=c.opacity,b=void 0===m?l.opacity:m,w=c.outerBorder,C=c.innerBorder;if(w){var x=w.distance,_=bu(e,void 0===x?l.outerBorder.distance:x,e.dpr);if(e.beginPath(),e.arc(n,i,f+_,g,y),e.closePath(),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,l),u)u(e,w,l.outerBorder);else if(s){var S=l.outerBorder.opacity;l.outerBorder.opacity=b,e.setStrokeStyle(t,w,n,i,l.outerBorder),l.outerBorder.opacity=S,e.stroke()}}if(C){var k=C.distance,A=bu(e,void 0===k?l.innerBorder.distance:k,e.dpr);if(e.beginPath(),e.arc(n,i,f-A,g,y),e.closePath(),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,l),u)u(e,C,l.innerBorder);else if(s){var R=l.innerBorder.opacity;l.innerBorder.opacity=b,e.setStrokeStyle(t,C,n,i,l.innerBorder),l.innerBorder.opacity=R,e.stroke()}}}}]),t}();Gf=jf([Zi()],Gf);var Uf=function(t){ee(n,t);var e=zf(n);function n(){var t;return Qt(this,n),(t=e.apply(this,arguments)).time=Sf.beforeFillStroke,t}return Jt(n)}(Bf);Uf=jf([Zi()],Uf);var Kf=function(t){ee(n,t);var e=zf(n);function n(){var t;return Qt(this,n),(t=e.apply(this,arguments)).time=Sf.afterFillStroke,t}return Jt(n)}(Tf);Kf=jf([Zi()],Kf);var Vf=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},Yf=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Xf=function(t,e){return function(n,i){e(n,i,t)}},$f=function(){function t(e){Qt(this,t),this.circleRenderContribitions=e,this.numberType=Ah}return Jt(t,[{key:"drawShape",value:function(t,e,n,i,r,o,a,s){var l=Js(t,null==o?void 0:o.theme).circle,h=t.attribute,u=h.fill,c=void 0===u?l.fill:u,d=h.background,f=h.stroke,p=void 0===f?l.stroke:f,g=h.radius,v=void 0===g?l.radius:g,y=h.startAngle,m=void 0===y?l.startAngle:y,b=h.endAngle,w=void 0===b?l.endAngle:b,C=h.fillOpacity,x=void 0===C?l.fillOpacity:C,_=h.strokeOpacity,S=void 0===_?l.strokeOpacity:_,k=h.opacity,A=void 0===k?l.opacity:k,R=h.lineWidth,B=void 0===R?l.lineWidth:R,T=h.visible,M=void 0===T?l.visible:T,P=h.x,E=void 0===P?l.x:P,H=h.y,O=void 0===H?l.y:H,L=lu(A,x),I=uu(A,S),D=au(c),W=su(p,B);t.valid&&M&&(D||W||d)&&(L||I||a||s||d)&&(e.beginPath(),e.arc(n,i,v,m,w),e.closePath(),this._circleRenderContribitions||(this._circleRenderContribitions=this.circleRenderContribitions.getContributions()||[],this._circleRenderContribitions.sort((function(t,e){return e.order-t.order}))),this._circleRenderContribitions.forEach((function(r){r.time===Sf.beforeFillStroke&&r.drawShape(t,e,n,i,D,W,L,I,l,a,s)})),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,l),D&&(a?a(e,t.attribute,l):L&&(e.setCommonStyle(t,t.attribute,E-n,O-i,l),e.fill())),W&&(s?s(e,t.attribute,l):I&&(e.setStrokeStyle(t,t.attribute,E-n,O-i,l),e.stroke())),this._circleRenderContribitions.forEach((function(r){r.time===Sf.afterFillStroke&&r.drawShape(t,e,n,i,D,W,L,I,l,a,s)})))}},{key:"draw",value:function(t,e,n,i){var r=n.context;if(r){r.highPerformanceSave();var o=Js(t,null==i?void 0:i.theme).circle,a=t.attribute,s=a.x,l=void 0===s?o.x:s,h=a.y,u=void 0===h?o.y:h;if(t.transMatrix.onlyTranslate()){var c=t.getOffsetXY(o);l+=c.x,u+=c.y,r.setTransformForCurrent()}else l=0,u=0,r.transformFromMatrix(t.transMatrix,!0);du(t,r,l,u,0,i)||this.drawShape(t,r,l,u,n,i),r.highPerformanceRestore()}}}]),t}();$f=Vf([Zi(),Xf(0,tr(lr)),Xf(0,Ji(Nf)),Yf("design:paramtypes",[Object])],$f);var qf=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},Zf=function(){function t(){Qt(this,t)}return Jt(t,[{key:"transform",value:function(t,e,n){var i=arguments.length>3&&void 0!==arguments[3]&&arguments[3],r=t.transMatrix.onlyTranslate(),o=t.attribute,a=o.x,s=void 0===a?e.x:a,l=o.y,h=void 0===l?e.y:l,u=o.z,c=void 0===u?e.z:u,d=o.scaleX,f=void 0===d?e.scaleX:d,p=o.scaleY,g=void 0===p?e.scaleY:p,v=o.angle,y=void 0===v?e.angle:v,m=n.modelMatrix,b=n.camera,w={x:s,y:h,z:c,lastModelMatrix:m},C=b&&(i||function(t){var e=t.attribute,n=e.alpha,i=e.beta;return n||i}(t));if(C){var x=Jd.allocate(),_=Jd.allocate();af(_,t,e),of(x,m||x,_),w.x=0,w.y=0,w.z=0,n.modelMatrix=x,n.setTransform(1,0,0,1,0,0,!0),Jd.free(_)}if(r&&!m){var S=t.getOffsetXY(e);w.x+=S.x,w.y+=S.y,w.z=c,n.setTransformForCurrent()}else if(C)w.x=0,w.y=0,w.z=0,n.setTransform(1,0,0,1,0,0,!0);else if(b&&n.project){var k=t.getOffsetXY(e);w.x+=k.x,w.y+=k.y,this.transformWithoutTranslate(n,w.x,w.y,w.z,f,g,y)}else n.transformFromMatrix(t.transMatrix,!0),w.x=0,w.y=0,w.z=0;return w}},{key:"transformUseContext2d",value:function(t,e,n,i){var r=i.camera;if(this.camera=r,r){var o=t.AABBBounds,a=o.x2-o.x1,s=o.y2-o.y1,l=i.project(0,0,n),h=i.project(a,0,n),u=i.project(a,s,n),c={x:0,y:0},d={x:a,y:0},f={x:a,y:s};i.camera=null;var p=1/(c.x*(f.y-d.y)-d.x*f.y+f.x*d.y+(d.x-f.x)*c.y),g=-(c.y*(u.x-h.x)-d.y*u.x+f.y*h.x+(d.y-f.y)*l.x)*p,v=(d.y*u.y+c.y*(h.y-u.y)-f.y*h.y+(f.y-d.y)*l.y)*p,y=(c.x*(u.x-h.x)-d.x*u.x+f.x*h.x+(d.x-f.x)*l.x)*p,m=-(d.x*u.y+c.x*(h.y-u.y)-f.x*h.y+(f.x-d.x)*l.y)*p,b=(c.x*(f.y*h.x-d.y*u.x)+c.y*(d.x*u.x-f.x*h.x)+(f.x*d.y-d.x*f.y)*l.x)*p,w=(c.x*(f.y*h.y-d.y*u.y)+c.y*(d.x*u.y-f.x*h.y)+(f.x*d.y-d.x*f.y)*l.y)*p;i.setTransform(g,v,y,m,b,w,!0)}}},{key:"restoreTransformUseContext2d",value:function(t,e,n,i){this.camera&&(i.camera=this.camera)}},{key:"transformWithoutTranslate",value:function(t,e,n,i,r,o,a){var s=t.project(e,n,i);t.translate(s.x,s.y,!1),t.scale(r,o,!1),t.rotate(a,!1),t.translate(-s.x,-s.y,!1),t.setTransformForCurrent()}}]),t}();function Jf(t,e,n,i){if(e.p1){var r=i||{},o=r.offsetX,a=void 0===o?0:o,s=r.offsetY,l=void 0===s?0:s,h=r.offsetZ,u=void 0===h?0:h;if(1===n)e.p2&&e.p3?t.bezierCurveTo(a+e.p1.x,l+e.p1.y,a+e.p2.x,l+e.p2.y,a+e.p3.x,l+e.p3.y,u):t.lineTo(a+e.p1.x,l+e.p1.y,u);else if(e.p2&&e.p3){var c=Vt(Qo(e,n),1)[0];t.bezierCurveTo(a+c.p1.x,l+c.p1.y,a+c.p2.x,l+c.p2.y,a+c.p3.x,l+c.p3.y,u)}else{var d=e.getPointAt(n);t.lineTo(a+d.x,l+d.y,u)}}}function Qf(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=re(t);if(e){var r=re(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return ie(this,n)}}var tp=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},ep=function(t){ee(n,t);var e=Qf(n);function n(){var t;return Qt(this,n),(t=e.apply(this,arguments)).numberType=Mh,t}return Jt(n,[{key:"draw",value:function(t,e,n,i){var r=n.context;r.highPerformanceSave();var o=Js(t,null==i?void 0:i.theme).line,a=this.transform(t,o,r),s=a.x,l=a.y,h=a.z,u=a.lastModelMatrix;this.z=h,du(t,r,s,l)||(this.drawShape(t,r,s,l,n,i),this.z=0,r.modelMatrix!==u&&Jd.free(r.modelMatrix),r.modelMatrix=u),r.highPerformanceRestore()}},{key:"drawSegmentItem",value:function(t,e,n,i,r,o,a,s,l,h,u,c,d,f,p){var g;t.beginPath();var v=null!==(g=this.z)&&void 0!==g?g:0;(function(t,e,n,i,r){var o=r||{},a=o.offsetX,s=void 0===a?0:a,l=o.offsetY,h=void 0===l?0:l,u=o.offsetZ,c=void 0===u?0:u,d=!0,f=e.curves;if(n>=1)f.forEach((function(e){e.defined?(d&&t.moveTo(e.p0.x+s,e.p0.y+h,c),Jf(t,e,1,r),d=!1):d=!0}));else if(!(n<=0)){var p;"x"===i?p=Lo.ROW:"y"===i?p=Lo.COLUMN:"auto"===i&&(p=e.direction);for(var g=n*e.tryUpdateLength(p),v=0,y=0,m=f.length;y<m;y++){var b=f[y],w=b.getLength(p),C=(g-v)/w;if(v+=w,C<0)break;b.defined?(d&&t.moveTo(b.p0.x+s,b.p0.y+h,c),Jf(t,b,Xr(C,1),r),d=!1):d=!0}}})(t.camera?t:t.nativeContext,e,l,h,{offsetX:u,offsetY:c,offsetZ:v}),d.cache&&!Sr(d.cache)&&d.attribute.curveType&&d.attribute.curveType.includes("Closed")&&t.closePath(),t.setShadowStyle&&t.setShadowStyle(d,a,s);var y=a.x,m=void 0===y?0:y,b=a.x,w=void 0===b?0:b;return!1!==n&&(f?f(t,a,s):r&&(t.setCommonStyle(d,a,m-u,w-c,s),t.fill())),!1!==i&&(p?p(t,a,s):o&&(t.setStrokeStyle(d,a,m-u,w-c,s),t.stroke())),!1}},{key:"drawShape",value:function(t,e,n,i,r,o,a,s){var l=this,h=Js(t,null==o?void 0:o.theme).line,u=t.attribute,c=u.fill,d=void 0===c?h.fill:c,f=u.stroke,p=void 0===f?h.stroke:f,g=u.opacity,v=void 0===g?h.opacity:g,y=u.fillOpacity,m=void 0===y?h.fillOpacity:y,b=u.strokeOpacity,w=void 0===b?h.strokeOpacity:b,C=u.lineWidth,x=void 0===C?h.lineWidth:C,_=u.visible,S=void 0===_?h.visible:_,k=lu(v,m),A=uu(v,w),R=au(d),B=su(p,x);if(t.valid&&S&&(R||B)&&(k||A||a||s)){if(t.shouldUpdateShape()){var T=t.attribute,M=T.points,P=T.segments,E=T.curveType,H=void 0===E?h.curveType:E,O=M;if(P&&P.length){var L,I;t.cache=P.map((function(t,e){return 1===e?L={x:I.endX,y:I.endY,defined:I.curves[I.curves.length-1].defined}:e>1&&(L.x=I.endX,L.y=I.endY,L.defined=I.curves[I.curves.length-1].defined),I=Aa(t.points,H,{startPoint:L})}))}else{if(!M||!M.length)return t.cache=null,void t.clearUpdateShapeTag();t.cache=Aa(O,H)}t.clearUpdateShapeTag()}var D=t.attribute,W=D.clipRange,F=void 0===W?h.clipRange:W,z=D.clipRangeByDimension,j=void 0===z?h.clipRangeByDimension:z;if(Array.isArray(t.cache))if(1===F){var N=!1;t.cache.forEach((function(r,o){N||(N=l.drawSegmentItem(e,r,!!d,!!p,m,w,t.attribute.segments[o],[h,t.attribute],F,j,n,i,t,a,s))}))}else{var G=t.cache.reduce((function(t,e){return t+e.getLength()}),0),U=F*G,K=0,V=!1;t.cache.forEach((function(r,o){if(!V){var u=r.getLength(),c=(U-K)/u;K+=u,c>0&&(V=l.drawSegmentItem(e,r,!!d,!!p,m,w,t.attribute.segments[o],[h,t.attribute],Xr(c,1),j,n,i,t,a,s))}}))}else this.drawSegmentItem(e,t.cache,!!d,!!p,m,w,t.attribute,h,F,j,n,i,t,a,s)}}}]),n}(Zf=qf([Zi()],Zf));function np(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=re(t);if(e){var r=re(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return ie(this,n)}}ep=tp([Zi()],ep);var ip=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},rp=Symbol.for("AreaRenderContribution"),op=function(t){ee(n,t);var e=np(n);function n(){var t;return Qt(this,n),(t=e.apply(this,arguments)).time=Sf.beforeFillStroke,t}return Jt(n)}(Bf);op=ip([Zi()],op);var ap=function(t){ee(n,t);var e=np(n);function n(){var t;return Qt(this,n),(t=e.apply(this,arguments)).time=Sf.afterFillStroke,t}return Jt(n,[{key:"drawShape",value:function(t,e,n,i,r,o,a,s,l,h,u,c){var d,f,p,g;this.textureMap||this.initTextureMap(e,t.stage);var v=(c||{}).attribute,y=void 0===v?t.attribute:v,m=y.texture,b=void 0===m?null!==(d=t.attribute.texture)&&void 0!==d?d:$l(l,"texture"):m,w=y.textureColor,C=void 0===w?null!==(f=t.attribute.textureColor)&&void 0!==f?f:$l(l,"textureColor"):w,x=y.textureSize,_=void 0===x?null!==(p=t.attribute.textureSize)&&void 0!==p?p:$l(l,"textureSize"):x,S=y.texturePadding,k=void 0===S?null!==(g=t.attribute.texturePadding)&&void 0!==g?g:$l(l,"texturePadding"):S;if(b){var A=this.textureMap.get(b);if(!A)switch(b){case"circle":A=this.createCirclePattern(_,k,C,e);break;case"diamond":A=this.createDiamondPattern(_,k,C,e);break;case"rect":A=this.createRectPattern(_,k,C,e);break;case"vertical-line":A=this.createVerticalLinePattern(_,k,C,e);break;case"horizontal-line":A=this.createHorizontalLinePattern(_,k,C,e);break;case"bias-lr":A=this.createBiasLRLinePattern(_,k,C,e);break;case"bias-rl":A=this.createBiasRLLinePattern(_,k,C,e);break;case"grid":A=this.createGridPattern(_,k,C,e)}A&&(e.highPerformanceSave(),e.setCommonStyle(t,t.attribute,n,i,l),e.fillStyle=A,e.fill(),e.highPerformanceRestore())}}}]),n}(Tf);function sp(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=re(t);if(e){var r=re(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return ie(this,n)}}ap=ip([Zi()],ap);var lp=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},hp=Symbol.for("GroupRenderContribution"),up=function(t){ee(n,t);var e=sp(n);function n(){var t;return Qt(this,n),(t=e.apply(this,arguments)).time=Sf.beforeFillStroke,t}return Jt(n,[{key:"drawShape",value:function(t,e,n,i,r,o,a,s,l,h,u){var c=t.attribute.background;if(c)if(t.backgroundImg&&t.resources){var d=t.resources.get(c);if("success"!==d.state||!d.data)return;e.highPerformanceSave(),e.setTransformFromMatrix(t.parent.globalTransMatrix,!0);var f=t.AABBBounds;e.drawImage(d.data,f.x1,f.y1,f.width(),f.height()),e.highPerformanceRestore(),e.setTransformForCurrent()}else e.highPerformanceSave(),e.fillStyle=c,e.fill(),e.highPerformanceRestore()}}]),n}(Bf);function cp(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=re(t);if(e){var r=re(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return ie(this,n)}}up=lp([Zi()],up);var dp=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},fp=Symbol.for("ImageRenderContribution"),pp=function(t){ee(n,t);var e=cp(n);function n(){var t;return Qt(this,n),(t=e.apply(this,arguments)).time=Sf.beforeFillStroke,t}return Jt(n,[{key:"drawShape",value:function(t,e,n,i,r,o,a,s,l,h,u){var c=t.attribute,d=c.background;if(c.width,c.height,d)if(t.backgroundImg){var f=t.resources.get(d);if("success"!==f.state||!f.data)return;if(e.save(),t.parent&&!t.transMatrix.onlyTranslate()){var p=Js(t.parent).group,g=t.parent.attribute,v=g.scrollX,y=void 0===v?p.scrollX:v,m=g.scrollY,b=void 0===m?p.scrollY:m;e.setTransformFromMatrix(t.parent.globalTransMatrix,!0),e.translate(y,b)}var w=t.AABBBounds;e.drawImage(f.data,w.x1,w.y1,w.width(),w.height()),e.restore(),t.transMatrix.onlyTranslate()||e.setTransformForCurrent()}else{e.beginPath();var C=t.AABBBounds;e.rect(n,i,C.width(),C.height()),e.fillStyle=d,e.globalAlpha=1,e.fill()}}}]),n}(Bf);pp=dp([Zi()],pp);var gp=zr/2;function vp(t,e,n,i,r,o){var a;if(Ar(o,!0))a=[o,o,o,o];else if(Array.isArray(o)){var s=o;switch(s.length){case 0:a=[0,0,0,0];break;case 1:a=[s[0],s[0],s[0],s[0]];break;case 2:case 3:a=[s[0],s[1],s[0],s[1]];break;default:a=s.slice(0,5)}}else a=[0,0,0,0];if(i<0||Math.abs(a[0])+Math.abs(a[1])+Math.abs(a[2])+Math.abs(a[3])<1e-12)return t.rect(e,n,i,r);var l=[e,n],h=[e+i,n],u=[e+i,n+r],c=[e,n+r],d=Math.min(i/2,r/2),f=[Math.min(d,a[0]),Math.min(d,a[1]),Math.min(d,a[2]),Math.min(d,a[3])],p=[l[0]+f[0],l[1]],g=[l[0],l[1]+f[0]],v=[h[0]-f[1],h[1]],y=[h[0],h[1]+f[1]],m=[u[0]-f[2],u[1]],b=[u[0],u[1]-f[2]],w=[c[0]+f[3],c[1]],C=[c[0],c[1]-f[3]];if(t.moveTo(p[0],p[1]),t.lineTo(v[0],v[1]),!Ir(v,y)){var x=v[0],_=v[1]+f[1];t.arc(x,_,f[1],-gp,0,!1)}if(t.lineTo(b[0],b[1]),!Ir(m,b)){var S=b[0]-f[2],k=b[1];t.arc(S,k,f[2],0,gp,!1)}if(t.lineTo(w[0],w[1]),!Ir(w,C)){var A=w[0],R=w[1]-f[3];t.arc(A,R,f[3],gp,zr,!1)}if(t.lineTo(g[0],g[1]),!Ir(p,g)){var B=p[0],T=p[1]+f[0];t.arc(B,T,f[0],zr,zr+gp,!1)}return t.closePath(),t}function yp(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=re(t);if(e){var r=re(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return ie(this,n)}}var mp=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},bp=Symbol.for("RectRenderContribution"),wp=function(){function t(){Qt(this,t),this.time=Sf.afterFillStroke,this.useStyle=!0,this.order=0}return Jt(t,[{key:"drawShape",value:function(t,e,n,i,r,o,a,s,l,h,u){var c=t.attribute,d=c.width,f=void 0===d?l.width:d,p=c.height,g=void 0===p?l.height:p,v=c.cornerRadius,y=void 0===v?l.cornerRadius:v,m=c.opacity,b=void 0===m?l.opacity:m,w=c.outerBorder,C=c.innerBorder;if(w){var x=w.distance,_=bu(e,void 0===x?l.outerBorder.distance:x,e.dpr),S=n-_,k=i-_,A=2*_;if(0===y||Sr(y)&&y.every((function(t){return 0===t}))?(e.beginPath(),e.rect(S,k,f+A,g+A)):(e.beginPath(),vp(e,S,k,f+A,g+A,y)),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,l),u)u(e,w,l.outerBorder);else if(s){var R=l.outerBorder.opacity;l.outerBorder.opacity=b,e.setStrokeStyle(t,w,n,i,l.outerBorder),l.outerBorder.opacity=R,e.stroke()}}if(C){var B=C.distance,T=bu(e,void 0===B?l.innerBorder.distance:B,e.dpr),M=n+T,P=i+T,E=2*T;if(0===y||Sr(y)&&y.every((function(t){return 0===t}))?(e.beginPath(),e.rect(M,P,f-E,g-E)):(e.beginPath(),vp(e,M,P,f-E,g-E,y)),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,l),u)u(e,C,l.innerBorder);else if(s){var H=l.innerBorder.opacity;l.innerBorder.opacity=b,e.setStrokeStyle(t,C,n,i,l.innerBorder),l.innerBorder.opacity=H,e.stroke()}}}}]),t}();wp=mp([Zi()],wp);var Cp=function(t){ee(n,t);var e=yp(n);function n(){var t;return Qt(this,n),(t=e.apply(this,arguments)).time=Sf.beforeFillStroke,t}return Jt(n)}(Bf);Cp=mp([Zi()],Cp);var xp=function(t){ee(n,t);var e=yp(n);function n(){var t;return Qt(this,n),(t=e.apply(this,arguments)).time=Sf.afterFillStroke,t}return Jt(n)}(Tf);xp=mp([Zi()],xp);var _p=function(){function t(){Qt(this,t),this.time=Sf.beforeFillStroke,this.useStyle=!0,this.order=0}return Jt(t,[{key:"drawShape",value:function(t,e,n,i,r,o,a,s,l,h,u,c){var d=t.attribute.stroke,f=void 0===d?l.stroke:d;Array.isArray(f)&&f.some((function(t){return!1===t}))&&(c.doStroke=!1)}}]),t}();_p=mp([Zi()],_p);var Sp=function(){function t(){Qt(this,t),this.time=Sf.afterFillStroke,this.useStyle=!0,this.order=0}return Jt(t,[{key:"drawShape",value:function(t,e,n,i,r,o,a,s,l,h,u){var c=t.attribute,d=c.width,f=void 0===d?l.width:d,p=c.height,g=void 0===p?l.height:p,v=c.stroke,y=void 0===v?l.stroke:v;if(Array.isArray(y)&&y.some((function(t){return!1===t}))){if(e.setStrokeStyle(t,t.attribute,n,i,l),e.beginPath(),e.moveTo(n,i),y[0]?e.lineTo(n+f,i):e.moveTo(n+f,i),y[1]?e.lineTo(n+f,i+g):e.moveTo(n+f,i+g),y[2]?e.lineTo(n,i+g):e.moveTo(n,i+g),y[3]){var m=y[0]?i-e.lineWidth/2:i;e.lineTo(n,m)}else e.moveTo(n,i);e.stroke()}}}]),t}();function kp(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=re(t);if(e){var r=re(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return ie(this,n)}}Sp=mp([Zi()],Sp);var Ap=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},Rp=Symbol.for("SymbolRenderContribution"),Bp=function(){function t(){Qt(this,t),this.time=Sf.afterFillStroke,this.useStyle=!0,this.order=0}return Jt(t,[{key:"drawShape",value:function(t,e,n,i,r,o,a,s,l,h,u){var c=t.attribute,d=c.size,f=void 0===d?l.size:d,p=c.opacity,g=void 0===p?l.opacity:p,v=c.outerBorder,y=c.innerBorder,m=t.getParsedPath();if(m){if(v){var b=v.distance,w=bu(e,void 0===b?l.outerBorder.distance:b,e.dpr);if(e.beginPath(),!1===m.drawOffset(e,f,n,i,w)&&e.closePath(),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,l),u)u(e,v,l.outerBorder);else if(s){var C=l.outerBorder.opacity;l.outerBorder.opacity=g,e.setStrokeStyle(t,v,n,i,l.outerBorder),l.outerBorder.opacity=C,e.stroke()}}if(y){var x=y.distance,_=bu(e,void 0===x?l.innerBorder.distance:x,e.dpr);if(e.beginPath(),!1===m.drawOffset(e,f,n,i,-_)&&e.closePath(),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,l),u)u(e,y,l.innerBorder);else if(s){var S=l.innerBorder.opacity;l.innerBorder.opacity=g,e.setStrokeStyle(t,y,n,i,l.innerBorder),l.innerBorder.opacity=S,e.stroke()}}}}}]),t}();Bp=Ap([Zi()],Bp);var Tp=function(t){ee(n,t);var e=kp(n);function n(){var t;return Qt(this,n),(t=e.apply(this,arguments)).time=Sf.beforeFillStroke,t}return Jt(n)}(Bf),Mp=function(t){ee(n,t);var e=kp(n);function n(){var t;return Qt(this,n),(t=e.apply(this,arguments)).time=Sf.afterFillStroke,t}return Jt(n)}(Tf);function Pp(t,e,n,i){var r=i||{},o=r.offsetX,a=void 0===o?0:o,s=r.offsetY,l=void 0===s?0:s,h=r.offsetZ,u=void 0===h?0:h,c=!0;e.forEach((function(e){e.defined?(c&&t.moveTo(e.p0.x+a,e.p0.y+l,u),Ep(t,e,1,i),c=!1):c=!0})),c=!0;for(var d=n.length-1;d>=0;d--){var f=n[d];f.defined?(c&&t.lineTo(f.p0.x+a,f.p0.y+l,u),Ep(t,f,1,i),c=!1):c=!0}}function Ep(t,e,n,i){if(e.p1){var r=i||{},o=r.offsetX,a=void 0===o?0:o,s=r.offsetY,l=void 0===s?0:s,h=r.offsetZ,u=void 0===h?0:h;if(1===n)e.p2&&e.p3?t.bezierCurveTo(a+e.p1.x,l+e.p1.y,a+e.p2.x,l+e.p2.y,a+e.p3.x,l+e.p3.y,u):t.lineTo(a+e.p1.x,l+e.p1.y,u);else if(e.p2&&e.p3){var c=Vt(Qo(e,n),1)[0];t.bezierCurveTo(a+c.p1.x,l+c.p1.y,a+c.p2.x,l+c.p2.y,a+c.p3.x,l+c.p3.y,u)}else{var d=e.getPointAt(n);t.lineTo(a+d.x,l+d.y,u)}}}var Hp=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},Op=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Lp=function(t,e){return function(n,i){e(n,i,t)}};function Ip(t,e,n){switch(e){case"linear":default:return ha(t,n);case"basis":return da(t,n);case"monotoneX":return wa(t,n);case"monotoneY":return Ca(t,n);case"step":return _a(t,.5,n);case"stepBefore":return _a(t,0,n);case"stepAfter":return _a(t,1,n);case"linearClosed":return ka(t,n)}}var Dp=function(){function t(e){Qt(this,t),this.areaRenderContribitions=e,this.numberType=kh}return Jt(t,[{key:"drawShape",value:function(t,e,n,i,r,o,a,s){var l,h,u,c,d,f,p=this,g=Js(t,null==o?void 0:o.theme).area,v=t.attribute,y=v.fill,m=void 0===y?g.fill:y,b=v.fillOpacity,w=void 0===b?g.fillOpacity:b,C=v.opacity,x=void 0===C?g.opacity:C,_=v.visible,S=void 0===_?g.visible:_,k=v.z,A=void 0===k?g.z:k,R=v.stroke,B=void 0===R?t.attribute.stroke:R,T=v.lineWidth,M=void 0===T?g.lineWidth:T,P=v.strokeOpacity,E=void 0===P?g.strokeOpacity:P,H=lu(x,w),O=au(m),L=su(B,M),I=uu(x,E);if(t.valid&&S&&(O||L)&&(H||a||I||s)){var D=t.attribute.clipRange,W=void 0===D?g.clipRange:D;if(t.shouldUpdateShape()){var F=t.attribute,z=F.points,j=F.segments,N=F.curveType,G=void 0===N?g.curveType:N;if(j&&j.length){for(var U,K,V,Y=j.map((function(t,e){return 1===e?U={x:K.endX,y:K.endY}:e>1&&(U.x=K.endX,U.y=K.endY),K=Ip(t.points,G,{startPoint:U})})),X=[],$=j.length-1;$>=0;$--){for(var q=j[$].points,Z=[],J=q.length-1;J>=0;J--)Z.push({x:null!==(l=q[J].x1)&&void 0!==l?l:q[J].x,y:null!==(h=q[J].y1)&&void 0!==h?h:q[J].y});if(0!==$){var Q=j[$-1].points,tt=Q[Q.length-1];tt&&Z.push({x:null!==(u=tt.x1)&&void 0!==u?u:tt.x,y:null!==(c=tt.y1)&&void 0!==c?c:tt.y})}V=Ip(Z,G),X.unshift(V)}t.cacheArea=X.map((function(t,e){return{top:Y[e],bottom:t}}))}else{if(!z||!z.length)return t.cache=null,void t.clearUpdateShapeTag();for(var et=z,nt=[],it=z.length-1;it>=0;it--)nt.push({x:null!==(d=z[it].x1)&&void 0!==d?d:z[it].x,y:null!==(f=z[it].y1)&&void 0!==f?f:z[it].y});var rt=Ip(et,G),ot=Ip(nt,"stepBefore"===G?"stepAfter":"stepAfter"===G?"stepBefore":G);t.cacheArea={top:rt,bottom:ot}}t.clearUpdateShapeTag()}if(Array.isArray(t.cacheArea))if(1===W){var at=!1;t.cacheArea.forEach((function(r,o){at||(at=p.drawSegmentItem(e,r,!!m,w,t.attribute.segments[o],[g,t.attribute],W,n,i,A,t,a))}))}else{var st=t.cacheArea.reduce((function(t,e){return t+e.top.getLength()}),0),lt=W*st,ht=0,ut=!1;t.cacheArea.forEach((function(r,o){if(!ut){var s=r.top.getLength(),l=(lt-ht)/s;ht+=s,l>0&&(ut=p.drawSegmentItem(e,r,!!m,w,t.attribute.segments[o],[g,t.attribute],Xr(l,1),n,i,A,t,a))}}))}else this.drawSegmentItem(e,t.cacheArea,!!m,w,t.attribute,g,W,n,i,A,t,a)}}},{key:"draw",value:function(t,e,n,i){var r=n.context,o=Js(t,null==i?void 0:i.theme).area,a=t.attribute,s=a.x,l=void 0===s?o.x:s,h=a.y,u=void 0===h?o.y:h;if(r.highPerformanceSave(),t.transMatrix.onlyTranslate()){var c=t.getOffsetXY(o);l+=c.x,u+=c.y,r.setTransformForCurrent()}else l=0,u=0,r.transformFromMatrix(t.transMatrix,!0);du(t,r,l,u,0,i)||this.drawShape(t,r,l,u,n,i),r.highPerformanceRestore()}},{key:"drawSegmentItem",value:function(t,e,n,i,r,o,a,s,l,h,u,c){t.beginPath(),function(t,e,n,i){var r,o=e.top,a=e.bottom;if(n>=1){for(var s=[],l=[],h=!0,u=0,c=o.curves.length;u<c;u++){var d=o.curves[u];h!==d.defined?(h?(Pp(t,s,l,i),s.length=0,l.length=0):(s.push(d),l.push(a.curves[c-u-1])),h=!h):h&&(s.push(d),l.push(a.curves[c-u-1]))}Pp(t,s,l,i)}else if(!(n<=0)){var f=(i||{}).direction,p=o.curves,g=null!==(r=p[p.length-1].p3)&&void 0!==r?r:p[p.length-1].p1,v=Ur(g.x-p[0].p0.x),y=Ur(g.y-p[0].p0.y);f=null!=f?f:v>y?Lo.ROW:Lo.COLUMN,Number.isFinite(v)||(f=Lo.COLUMN),Number.isFinite(y)||(f=Lo.ROW);for(var m=n*(f===Lo.ROW?v:y),b=0,w=!0,C=[],x=[],_=0,S=o.curves.length;_<S;_++){var k=o.curves[_],A=k.getLength(f),R=(m-b)/A;if(R<0)break;b+=A;var B=null,T=null;w!==k.defined?(w?(Pp(t,C,x,i),C.length=0,x.length=0):(B=k,T=a.curves[S-_-1]),w=!w):w&&(B=k,T=a.curves[S-_-1]),B&&T&&(R<1&&(B=B.p2&&B.p3?Qo(B,R)[0]:na(B,R)[0],T=T.p2&&T.p3?Qo(T,1-R)[1]:na(T,1-R)[1]),B.defined=w,T.defined=w,C.push(B),x.push(T)),B=null,T=null}Pp(t,C,x,i)}}(t.camera?t:t.nativeContext,e,a,{offsetX:s,offsetY:l,offsetZ:h}),this._areaRenderContribitions||(this._areaRenderContribitions=this.areaRenderContribitions.getContributions()||[],this._areaRenderContribitions.sort((function(t,e){return e.order-t.order}))),this._areaRenderContribitions.forEach((function(e){e.time===Sf.beforeFillStroke&&e.drawShape(u,t,s,l,!!i,!1,n,!1,o,c,null,{attribute:r})})),t.setShadowStyle&&t.setShadowStyle(u,r,o);var d=r.x,f=void 0===d?0:d,p=r.x,g=void 0===p?0:p;return!1!==n&&(c?c(t,r,o):i&&(t.setCommonStyle(u,r,f-s,g-l,o),t.fill())),this._areaRenderContribitions||(this._areaRenderContribitions=this.areaRenderContribitions.getContributions()||[]),this._areaRenderContribitions.forEach((function(e){e.time===Sf.afterFillStroke&&e.drawShape(u,t,s,l,!!i,!1,n,!1,o,c,null,{attribute:r})})),!1}}]),t}();function Wp(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=re(t);if(e){var r=re(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return ie(this,n)}}Dp=Hp([Zi(),Lp(0,tr(lr)),Lp(0,Ji(rp)),Op("design:paramtypes",[Object])],Dp);var Fp=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},zp=Symbol.for("PathRenderContribution"),jp=function(t){ee(n,t);var e=Wp(n);function n(){var t;return Qt(this,n),(t=e.apply(this,arguments)).time=Sf.beforeFillStroke,t}return Jt(n)}(Bf);jp=Fp([Zi()],jp);var Np=function(t){ee(n,t);var e=Wp(n);function n(){var t;return Qt(this,n),(t=e.apply(this,arguments)).time=Sf.afterFillStroke,t}return Jt(n)}(Tf);function Gp(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=re(t);if(e){var r=re(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return ie(this,n)}}Np=Fp([Zi()],Np);var Up=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},Kp=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Vp=function(t,e){return function(n,i){e(n,i,t)}},Yp=function(t){ee(n,t);var e=Gp(n);function n(t){var i;return Qt(this,n),(i=e.call(this)).pathRenderContribitions=t,i.numberType=Ph,i}return Jt(n,[{key:"drawShape",value:function(t,e,n,i,r,o,a,s){var l,h,u=Js(t,null==o?void 0:o.theme).path,c=t.attribute,d=c.fill,f=void 0===d?u.fill:d,p=c.stroke,g=void 0===p?u.stroke:p,v=c.fillOpacity,y=void 0===v?u.fillOpacity:v,m=c.strokeOpacity,b=void 0===m?u.strokeOpacity:m,w=c.opacity,C=void 0===w?u.opacity:w,x=c.background,_=c.lineWidth,S=void 0===_?u.lineWidth:_,k=c.visible,A=void 0===k?u.visible:k,R=c.x,B=void 0===R?u.x:R,T=c.y,M=void 0===T?u.y:T,P=null!==(l=this.z)&&void 0!==l?l:0,E=lu(C,y),H=uu(C,b),O=au(f),L=su(g,S);if(t.valid&&A&&(O||L||x)&&(E||H||a||s||x)){if(e.beginPath(),t.pathShape)Vo(t.pathShape.commandList,e,n,i,1,1,P);else Vo((null!==(h=t.attribute.path)&&void 0!==h?h:u.path).commandList,e,n,i,1,1,P);this._pathRenderContribitions||(this._pathRenderContribitions=this.pathRenderContribitions.getContributions()||[],this._pathRenderContribitions.sort((function(t,e){return e.order-t.order}))),this._pathRenderContribitions.forEach((function(r){r.time===Sf.beforeFillStroke&&r.drawShape(t,e,n,i,O,L,E,H,u,a,s)})),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,u),L&&(s?s(e,t.attribute,u):H&&(e.setStrokeStyle(t,t.attribute,B-n,M-i,u),e.stroke())),O&&(a?a(e,t.attribute,u):E&&(e.setCommonStyle(t,t.attribute,B-n,M-i,u),e.fill())),this._pathRenderContribitions.forEach((function(r){r.time===Sf.afterFillStroke&&r.drawShape(t,e,n,i,O,L,E,H,u,a,s)}))}}},{key:"draw",value:function(t,e,n,i){var r=n.context;if(r){r.highPerformanceSave();var o=Js(t,null==i?void 0:i.theme).path,a=this.transform(t,o,r),s=a.x,l=a.y,h=a.z,u=a.lastModelMatrix;this.z=h,du(t,r,s,l,0,i)||(this.drawShape(t,r,s,l,n,i),this.z=0,r.modelMatrix!==u&&Jd.free(r.modelMatrix),r.modelMatrix=u),r.highPerformanceRestore()}}}]),n}(Zf);Yp=Up([Zi(),Vp(0,tr(lr)),Vp(0,Ji(zp)),Kp("design:paramtypes",[Object])],Yp);var Xp=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},$p=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},qp=function(t,e){return function(n,i){e(n,i,t)}},Zp=function(){function t(e){Qt(this,t),this.rectRenderContribitions=e,this.type="rect",this.numberType=Oh}return Jt(t,[{key:"drawShape",value:function(t,e,n,i,r,o,a,s){var l=Js(t,null==o?void 0:o.theme).rect,h=t.attribute,u=h.fill,c=void 0===u?l.fill:u,d=h.background,f=h.stroke,p=void 0===f?l.stroke:f,g=h.width,v=void 0===g?l.width:g,y=h.height,m=void 0===y?l.height:y,b=h.cornerRadius,w=void 0===b?l.cornerRadius:b,C=h.opacity,x=void 0===C?l.opacity:C,_=h.fillOpacity,S=void 0===_?l.fillOpacity:_,k=h.lineWidth,A=void 0===k?l.lineWidth:k,R=h.strokeOpacity,B=void 0===R?l.strokeOpacity:R,T=h.visible,M=void 0===T?l.visible:T,P=h.x,E=void 0===P?l.x:P,H=h.y,O=void 0===H?l.y:H,L=hu(x,S,v,m),I=cu(x,B,v,m),D=au(c),W=su(p,A);if(t.valid&&M&&(D||W||d)&&(L||I||a||s||d)){0===w||Sr(w)&&w.every((function(t){return 0===t}))?(e.beginPath(),e.rect(n,i,v,m)):(e.beginPath(),vp(e,n,i,v,m,w)),this._rectRenderContribitions||(this._rectRenderContribitions=this.rectRenderContribitions.getContributions()||[],this._rectRenderContribitions.sort((function(t,e){return e.order-t.order})));var F={doFill:D,doStroke:W};this._rectRenderContribitions.forEach((function(r){r.time===Sf.beforeFillStroke&&r.drawShape(t,e,n,i,D,W,L,I,l,a,s,F)})),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,l),F.doFill&&(a?a(e,t.attribute,l):L&&(e.setCommonStyle(t,t.attribute,E-n,O-i,l),e.fill())),F.doStroke&&(s?s(e,t.attribute,l):I&&(e.setStrokeStyle(t,t.attribute,E-n,O-i,l),e.stroke())),this._rectRenderContribitions.forEach((function(r){r.time===Sf.afterFillStroke&&r.drawShape(t,e,n,i,D,W,L,I,l,a,s)}))}}},{key:"draw",value:function(t,e,n,i){var r=n.context;if(r){r.highPerformanceSave();var o=Js(t,null==i?void 0:i.theme).rect,a=t.attribute,s=a.x,l=void 0===s?o.x:s,h=a.y,u=void 0===h?o.y:h;if(t.transMatrix.onlyTranslate()){var c=t.getOffsetXY(o);l+=c.x,u+=c.y,r.setTransformForCurrent()}else l=0,u=0,r.transformFromMatrix(t.transMatrix,!0);du(t,r,l,u,0,i)||this.drawShape(t,r,l,u,n,i),r.highPerformanceRestore()}}}]),t}();function Jp(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=re(t);if(e){var r=re(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return ie(this,n)}}Zp=Xp([Zi(),qp(0,tr(lr)),qp(0,Ji(bp)),$p("design:paramtypes",[Object])],Zp);var Qp=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},tg=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},eg=function(t,e){return function(n,i){e(n,i,t)}},ng=function(t){ee(n,t);var e=Jp(n);function n(t){var i;return Qt(this,n),(i=e.call(this)).symbolRenderContribitions=t,i.numberType=Dh,i}return Jt(n,[{key:"drawShape",value:function(t,e,n,i,r,o,a,s){var l,h=Js(t,null==o?void 0:o.theme).symbol,u=t.attribute,c=u.size,d=void 0===c?h.size:c,f=u.fill,p=void 0===f?h.fill:f,g=u.background,v=u.fillOpacity,y=void 0===v?h.fillOpacity:v,m=u.strokeOpacity,b=void 0===m?h.strokeOpacity:m,w=u.opacity,C=void 0===w?h.opacity:w,x=u.lineWidth,_=void 0===x?h.lineWidth:x,S=u.stroke,k=void 0===S?h.stroke:S,A=u.visible,R=void 0===A?h.visible:A,B=u.x,T=void 0===B?h.x:B,M=u.y,P=void 0===M?h.y:M,E=u.scaleX,H=void 0===E?h.scaleX:E,O=u.scaleY,L=void 0===O?h.scaleY:O,I=lu(C,y),D=uu(C,b),W=au(p),F=su(k,_);if(t.valid&&R&&(W||F||g)&&(I||D||a||s||g)){var z=t.getParsedPath();if(z){var j=t.attribute.keepDirIn3d,N=void 0===j?h.keepDirIn3d:j,G=null!==(l=this.z)&&void 0!==l?l:0;if(e.beginPath(),N&&e.camera&&e.project){var U=e.project(n,i,G),K=e.camera;e.camera=null,!1===z.draw(e,d,U.x,U.y)&&e.closePath(),e.camera=K}else!1===z.draw(e,d,n,i,G)&&e.closePath();this._symbolRenderContribitions||(this._symbolRenderContribitions=this.symbolRenderContribitions.getContributions()||[],this._symbolRenderContribitions.sort((function(t,e){return e.order-t.order}))),this._symbolRenderContribitions.forEach((function(r){r.time===Sf.beforeFillStroke&&r.drawShape(t,e,n,i,W,F,I,D,h,a,s)})),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,h),W&&(a?a(e,t.attribute,h):I&&(e.setCommonStyle(t,t.attribute,T-n,P-i,h),e.fill())),F&&(s?s(e,t.attribute,h):D&&(e.setStrokeStyle(t,t.attribute,(T-n)/H,(P-i)/L,h),e.stroke())),this._symbolRenderContribitions.forEach((function(r){r.time===Sf.afterFillStroke&&r.drawShape(t,e,n,i,W,F,I,D,h,a,s)}))}}}},{key:"draw",value:function(t,e,n,i){var r=n.context;if(r){r.highPerformanceSave();var o=Js(t,null==i?void 0:i.theme).symbol,a=this.transform(t,o,r),s=a.x,l=a.y,h=a.z,u=a.lastModelMatrix;this.z=h,du(t,r,s,l,0,i)||(this.drawShape(t,r,s,l,n,i),this.z=0,r.modelMatrix!==u&&Jd.free(r.modelMatrix),r.modelMatrix=u),r.highPerformanceRestore()}}}]),n}(Zf);function ig(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=re(t);if(e){var r=re(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return ie(this,n)}}ng=Qp([Zi(),eg(0,tr(lr)),eg(0,Ji(Rp)),tg("design:paramtypes",[Object])],ng);var rg=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},og=function(t){ee(n,t);var e=ig(n);function n(){var t;return Qt(this,n),(t=e.apply(this,arguments)).numberType=Wh,t}return Jt(n,[{key:"drawShape",value:function(t,e,n,i,r,o,a,s){var l,h=this,u=Js(t,null==o?void 0:o.theme).text,c=t.attribute,d=c.text,f=c.fill,p=void 0===f?u.fill:f,g=c.stroke,v=void 0===g?u.stroke:g,y=c.fillOpacity,m=void 0===y?u.fillOpacity:y,b=c.strokeOpacity,w=void 0===b?u.strokeOpacity:b,C=c.opacity,x=void 0===C?u.opacity:C,_=c.lineWidth,S=void 0===_?u.lineWidth:_,k=c.visible,A=void 0===k?u.visible:k,R=c.underline,B=void 0===R?u.underline:R,T=c.lineThrough,M=void 0===T?u.lineThrough:T,P=c.keepDirIn3d,E=void 0===P?u.keepDirIn3d:P,H=c.fontSize,O=void 0===H?u.fontSize:H,L=c.textBaseline,I=void 0===L?u.textBaseline:L,D=c.x,W=void 0===D?u.x:D,F=c.y,z=void 0===F?u.y:F,j=null!==(l=t.attribute.lineHeight)&&void 0!==l?l:O,N=lu(x,m),G=uu(x,w),U=au(p),K=su(v,S);if(t.valid&&A&&(U||K||N||G)){var V=!E,Y=this.z||0;if(e.beginPath(),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,u),V&&this.transformUseContext2d(t,u,Y,e),Array.isArray(d)){e.setTextStyleWithoutAlignBaseline(t.attribute,u,Y);var X=t.multilineLayout;if(!X)return void e.highPerformanceRestore();var $=X.bbox,q=$.xOffset,Z=$.yOffset;K&&(s?s(e,t.attribute,u):G&&(e.setStrokeStyle(t,t.attribute,W-n,z-i,u),X.lines.forEach((function(t){e.strokeText(t.str,(t.leftOffset||0)+q+n,(t.topOffset||0)+Z+i,Y)})))),U&&(a?a(e,t.attribute,u):N&&(e.setCommonStyle(t,t.attribute,W-n,z-i,u),X.lines.forEach((function(r){e.fillText(r.str,(r.leftOffset||0)+q+n,(r.topOffset||0)+Z+i,Y),h.drawMultiUnderLine(B,M,t,(r.leftOffset||0)+n,(r.topOffset||0)+Z+i,Y,r.width,u,e)}))))}else{e.setTextStyle(t.attribute,u,Y);var J=t.clipedText,Q=0;j!==O&&("top"===I?Q=(j-O)/2:"middle"===I||"bottom"===I&&(Q=-(j-O)/2)),K&&(s?s(e,t.attribute,u):G&&(e.setStrokeStyle(t,t.attribute,W-n,z-i,u),e.strokeText(J,n,i+Q,Y))),U&&(a?a(e,t.attribute,u):N&&(e.setCommonStyle(t,t.attribute,W-n,z-i,u),e.fillText(J,n,i+Q,Y),this.drawUnderLine(B,M,t,n,i+Q,Y,u,e)))}V&&this.restoreTransformUseContext2d(t,u,Y,e)}}},{key:"draw",value:function(t,e,n,i){var r=n.context;if(r){r.highPerformanceSave();var o=Js(t,null==i?void 0:i.theme).text,a=t.attribute.keepDirIn3d,s=!(void 0===a?o.keepDirIn3d:a),l=this.transform(t,o,r,s),h=l.x,u=l.y,c=l.z,d=l.lastModelMatrix;this.z=c,this.drawShape(t,r,h,u,n,i),this.z=0,r.modelMatrix=d,r.highPerformanceRestore()}}},{key:"drawUnderLine",value:function(t,e,n,i,r,o,a,s){if(!(e+t<=0)){var l=n.attribute,h=l.textAlign,u=void 0===h?a.textAlign:h,c=l.textBaseline,d=void 0===c?a.textBaseline:c,f=l.fontSize,p=void 0===f?a.fontSize:f,g=l.fill,v=void 0===g?a.fill:g,y=l.opacity,m=void 0===y?a.opacity:y,b=l.fillOpacity,w=void 0===b?a.fillOpacity:b,C=n.clipedWidth,x=ku(u,C),_=Au(d,p,p),S={lineWidth:0,stroke:v,opacity:m,strokeOpacity:w};if(t){S.lineWidth=t,s.setStrokeStyle(n,S,i,r,a),s.beginPath();var k=r+_+p;s.moveTo(i+x,k,o),s.lineTo(i+x+C,k,o),s.stroke()}if(e){S.lineWidth=e,s.setStrokeStyle(n,S,i,r,a),s.beginPath();var A=r+_+p/2;s.moveTo(i+x,A,o),s.lineTo(i+x+C,A,o),s.stroke()}}}},{key:"drawMultiUnderLine",value:function(t,e,n,i,r,o,a,s,l){if(!(e+t<=0)){var h=n.attribute,u=h.textAlign,c=void 0===u?s.textAlign:u,d=h.fontSize,f=void 0===d?s.fontSize:d,p=h.fill,g=void 0===p?s.fill:p,v=h.opacity,y=void 0===v?s.opacity:v,m=h.fillOpacity,b=void 0===m?s.fillOpacity:m,w=ku(c,a),C=Au("alphabetic",f,f),x={lineWidth:0,stroke:g,opacity:y,strokeOpacity:b},_=-3;if(t){x.lineWidth=t,l.setStrokeStyle(n,x,i,r,s),l.beginPath();var S=r+C+f+_;l.moveTo(i+w,S,o),l.lineTo(i+w+a,S,o),l.stroke()}if(_=-1,e){x.lineWidth=e,l.setStrokeStyle(n,x,i,r,s),l.beginPath();var k=r+C+f/2+_;l.moveTo(i+w,k,o),l.lineTo(i+w+a,k,o),l.stroke()}}}}]),n}(Zf);og=rg([Zi()],og);var ag=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},sg=Jt((function t(){Qt(this,t)}));function lg(t,e,n,i){t.moveTo(e[0].x+n,e[0].y+i);for(var r=1;r<e.length;r++)t.lineTo(e[r].x+n,e[r].y+i)}function hg(t,e){return Math.sqrt(t*t+e*e)}function ug(t,e,n,i,r){var o=e/n;return{x:t.x-i*o,y:t.y-r*o}}function cg(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=re(t);if(e){var r=re(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return ie(this,n)}}sg=ag([Zi()],sg);var dg=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},fg=Symbol.for("PolygonRenderContribution"),pg=function(t){ee(n,t);var e=cg(n);function n(){var t;return Qt(this,n),(t=e.apply(this,arguments)).time=Sf.beforeFillStroke,t}return Jt(n)}(Bf);pg=dg([Zi()],pg);var gg=function(t){ee(n,t);var e=cg(n);function n(){var t;return Qt(this,n),(t=e.apply(this,arguments)).time=Sf.afterFillStroke,t}return Jt(n)}(Tf);gg=dg([Zi()],gg);var vg=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},yg=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},mg=function(t,e){return function(n,i){e(n,i,t)}},bg=function(){function t(e){Qt(this,t),this.polygonRenderContribitions=e,this.numberType=Eh}return Jt(t,[{key:"drawShape",value:function(t,e,n,i,r,o,a,s){var l=Js(t,null==o?void 0:o.theme).polygon,h=t.attribute,u=h.points,c=void 0===u?l.points:u,d=h.fill,f=void 0===d?l.fill:d,p=h.stroke,g=void 0===p?l.stroke:p,v=h.cornerRadius,y=void 0===v?l.cornerRadius:v,m=h.fillOpacity,b=void 0===m?l.fillOpacity:m,w=h.background,C=h.strokeOpacity,x=void 0===C?l.strokeOpacity:C,_=h.lineWidth,S=void 0===_?l.lineWidth:_,k=h.opacity,A=void 0===k?l.opacity:k,R=h.visible,B=void 0===R?l.visible:R,T=h.x,M=void 0===T?l.x:T,P=h.y,E=void 0===P?l.y:P,H=lu(A,b),O=uu(A,x),L=au(f),I=su(g,S);t.valid&&B&&(L||I||w)&&(H||O||a||s||w)&&(e.beginPath(),y<=0||Sr(y)&&y.every((function(t){return 0===t}))?lg(e.camera?e:e.nativeContext,c,n,i):function(t,e,n,i,r){var o;if(e.length<3)lg(t,e,n,i);else for(var a=0;a<e.length;a++){var s=e[a],l=e[(a+1)%e.length],h=e[(a+2)%e.length],u=l.x-s.x,c=l.y-s.y,d=l.x-h.x,f=l.y-h.y,p=(Math.atan2(c,u)-Math.atan2(f,d))/2,g=Math.abs(Math.tan(p)),v=Array.isArray(r)?null!==(o=r[(a+1)%e.length])&&void 0!==o?o:0:r,y=v/g,m=hg(u,c),b=hg(d,f),w=Math.min(m,b);y>w&&(y=w,v=w*g);var C=ug(l,y,m,u,c),x=ug(l,y,b,d,f),_=2*l.x-C.x-x.x,S=2*l.y-C.y-x.y,k=hg(_,S),A=ug(l,hg(y,v),k,_,S),R=Math.atan2(C.y-A.y,C.x-A.x),B=Math.atan2(x.y-A.y,x.x-A.x),T=B-R;T<0&&(R=B,T=-T),T>Math.PI&&(T-=Math.PI),0===a?t.moveTo(C.x+n,C.y+i):t.lineTo(C.x+n,C.y+i),T&&t.arcTo(l.x+n,l.y+i,x.x+n,x.y+i,v),t.lineTo(x.x+n,x.y+i)}}(e.camera?e:e.nativeContext,c,n,i,y),e.closePath(),this._polygonRenderContribitions||(this._polygonRenderContribitions=this.polygonRenderContribitions.getContributions()||[],this._polygonRenderContribitions.sort((function(t,e){return e.order-t.order}))),this._polygonRenderContribitions.forEach((function(r){r.time===Sf.beforeFillStroke&&r.drawShape(t,e,n,i,L,I,H,O,l,a,s)})),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,l),L&&(a?a(e,t.attribute,l):b&&(e.setCommonStyle(t,t.attribute,M-n,E-i,l),e.fill())),I&&(s?s(e,t.attribute,l):x&&(e.setStrokeStyle(t,t.attribute,M-n,E-i,l),e.stroke())),this._polygonRenderContribitions.forEach((function(r){r.time===Sf.afterFillStroke&&r.drawShape(t,e,n,i,L,I,H,O,l,a,s)})))}},{key:"draw",value:function(t,e,n,i){var r=n.context;if(r){r.highPerformanceSave();var o=Js(t,null==i?void 0:i.theme).polygon,a=t.attribute,s=a.x,l=void 0===s?o.x:s,h=a.y,u=void 0===h?o.y:h;if(t.transMatrix.onlyTranslate()){var c=t.getOffsetXY(o);l+=c.x,u+=c.y,r.setTransformForCurrent()}else l=0,u=0,r.transformFromMatrix(t.transMatrix,!0);du(t,r,l,u,0,i)||this.drawShape(t,r,l,u,n,i),r.highPerformanceRestore()}}}]),t}();bg=vg([Zi(),mg(0,tr(lr)),mg(0,Ji(fg)),yg("design:paramtypes",[Object])],bg);var wg=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},Cg=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},xg=function(t,e){return function(n,i){e(n,i,t)}},_g=function(){function t(e){Qt(this,t),this.imageRenderContribitions=e,this.numberType=Th}return Jt(t,[{key:"drawShape",value:function(t,e,n,i,r,o,a){var s=Js(t).image,l=t.attribute,h=l.fill,u=void 0===h?s.fill:h,c=l.width,d=void 0===c?s.width:c,f=l.height,p=void 0===f?s.height:f,g=l.opacity,v=void 0===g?s.opacity:g,y=l.fillOpacity,m=void 0===y?s.fillOpacity:y,b=l.visible,w=void 0===b?s.visible:b,C=l.image,x=lu(v,m),_=au(u);if(t.valid&&w&&_&&(x||a)){if(this._imageRenderContribitions||(this._imageRenderContribitions=this.imageRenderContribitions.getContributions()||[]),this._imageRenderContribitions.forEach((function(r){r.time===Sf.beforeFillStroke&&r.drawShape(t,e,n,i,_,!1,x,!1,s,a)})),e.setShadowStyle&&e.setShadowStyle(t,s),_)if(a)a(e,t.attribute,s);else if(x){if(!C||!t.resources)return;var S=t.resources.get(C);if("success"!==S.state)return;e.setCommonStyle(t,t.attribute,n,i,s),e.drawImage(S.data,n,i,d,p)}this._imageRenderContribitions.forEach((function(r){r.time===Sf.afterFillStroke&&r.drawShape(t,e,n,i,_,!1,x,!1,s,a)}))}}},{key:"draw",value:function(t,e,n){var i=e.drawParams.context;if(i){var r=Js(t).image,o=t.attribute,a=o.x,s=void 0===a?r.x:a,l=o.y,h=void 0===l?r.y:l,u=t.attribute.image;if(u&&t.resources&&"success"===t.resources.get(u).state){if(i.highPerformanceSave(),t.transMatrix.onlyTranslate()){var c=t.getOffsetXY(r);s+=c.x,h+=c.y,i.setTransformForCurrent()}else s=0,h=0,i.transformFromMatrix(t.transMatrix,!0);this.drawShape(t,i,s,h,n),i.highPerformanceRestore()}}}}]),t}();_g=wg([Zi(),xg(0,tr(lr)),xg(0,Ji(fp)),Cg("design:paramtypes",[Object])],_g);var Sg=Symbol.for("IncrementalDrawContribution"),kg=Symbol.for("ArcRender"),Ag=Symbol.for("Arc3dRender"),Rg=Symbol.for("AreaRender"),Bg=Symbol.for("CircleRender"),Tg=Symbol.for("GraphicRender"),Mg=Symbol.for("GroupRender"),Pg=Symbol.for("LineRender"),Eg=Symbol.for("PathRender"),Hg=Symbol.for("PolygonRender"),Og=Symbol.for("RectRender"),Lg=Symbol.for("Rect3DRender"),Ig=Symbol.for("SymbolRender"),Dg=Symbol.for("TextRender"),Wg=Symbol.for("RichTextRender"),Fg=Symbol.for("Pyramid3dRender"),zg=Symbol.for("GlyphRender"),jg=Symbol.for("ImageRender"),Ng=Symbol.for("RenderSelector"),Gg=Symbol.for("DrawContribution"),Ug=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},Kg=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Vg=function(t,e){return function(n,i){e(n,i,t)}},Yg=Symbol.for("RenderService"),Xg=function(){function t(e){Qt(this,t),this.drawContribution=e}return Jt(t,[{key:"prepare",value:function(t){var e=this;this.renderTreeRoots.forEach((function(n){e._prepare(n,t)}))}},{key:"_prepare",value:function(t,e){var n=this;t.forEachChildren((function(t){n._prepare(t,e)})),t.update({bounds:e,trans:!0})}},{key:"prepareRenderList",value:function(){}},{key:"beforeDraw",value:function(t){}},{key:"draw",value:function(t){this.drawContribution.draw(this,Object.assign({},this.drawParams))}},{key:"afterDraw",value:function(t){}},{key:"render",value:function(t,e){this.renderTreeRoots=t,this.drawParams=e;var n=e.updateBounds;this.prepare(n),this.prepareRenderList(),this.beforeDraw(e),this.draw(e),this.afterDraw(e)}}]),t}();Xg=Ug([Zi(),Vg(0,tr(Gg)),Kg("design:paramtypes",[Object])],Xg);var $g=new Vi((function(t){t(Xg).toSelf(),t(Yg).toService(Xg)})),qg=function(t,e,n,i){return new(n||(n=Promise))((function(r,o){function a(t){try{l(i.next(t))}catch(t){o(t)}}function s(t){try{l(i.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((i=i.apply(t,e||[])).next())}))};function Zg(t,e,n){var i,r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=arguments.length>4&&void 0!==arguments[4]&&arguments[4],a={},s=[],l=!1;o?l=!0:t.forEachChildren((function(t,n){var r=t.attribute.zIndex,o=void 0===r?e:r;if(0===n)i=o;else if(i!==o)return l=!0,!0;return!1}),r);if(l){t.forEachChildren((function(t){var n=t.attribute.zIndex,i=void 0===n?e:n;a[i]?a[i].push(t):(a[i]=[t],s.push(i))}),r),s.sort((function(t,e){return r?e-t:t-e}));for(var h=!1,u=0;u<s.length&&!h;u++){var c=s[u],d=a[c];o&&d.sort((function(t,e){var n,i;return(r?-1:1)*((null!==(n=e.attribute.z)&&void 0!==n?n:0)-(null!==(i=t.attribute.z)&&void 0!==i?i:0))}));for(var f=0;f<d.length;f++)if(n(d[f],f)){h=!0;break}}}else t.forEachChildren(n,r)}function Jg(t,e,n){var i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return qg(this,void 0,void 0,ol.mark((function e(){return ol.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.forEachChildrenAsync(n,i);case 2:case"end":return e.stop()}}),e)})))}function Qg(t,e,n){var i=arguments.length>3&&void 0!==arguments[3]&&arguments[3],r={},o=[],a=!1;t.forEachChildren((function(t,e){var i=t.attribute.zIndex;if(0===e);else if(void 0!==(void 0===i?n:i))return a=!0,!0;return!1}),i);var s=null,l=!1;if(a){t.forEachChildren((function(t){var e=t.attribute.zIndex,i=void 0===e?n:e;r[i]?r[i].push(t):(r[i]=[t],o.push(i))}),i),o.sort((function(t,e){return i?e-t:t-e}));for(var h=!1,u=0;u<o.length&&!h;u++)for(var c=o[u],d=r[c],f=0;f<d.length;f++){if(l){h=!0,s=d[f];break}d[f]._uid!==e||(l=!0)}}else t.forEachChildren((function(t){return l?(s=t,!0):(t._uid===e&&(l=!0),!1)}),i);return s}var tv=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},ev=Symbol.for("PickItemInterceptor"),nv=function(){function t(){Qt(this,t),this.order=1}return Jt(t,[{key:"beforePickItem",value:function(t,e,n,i,r){if(!t.in3dMode||i.in3dInterceptor)return null;var o=e.pickContext,a=t.stage;if(!o||!a)return null;if(i.in3dInterceptor=!0,o.save(),this.initCanvasCtx(o),o.camera=a.camera,t.isContainer){var s,l=!1,h=!1;if(t.forEachChildren((function(t){return!(l=t.numberType===Sh)})),t.forEachChildren((function(t){return!(h=!!t.findFace)})),l){var u=t.getChildren(),c=Wt(u);c.sort((function(t,e){for(var n,i,r,o,a=(null!==(i=null!==(n=t.attribute.startAngle)&&void 0!==n?n:0+t.attribute.endAngle)&&void 0!==i?i:0)/2,s=(null!==(o=null!==(r=e.attribute.startAngle)&&void 0!==r?r:0+e.attribute.endAngle)&&void 0!==o?o:0)/2;a<0;)a+=Gr;for(;s<0;)s+=Gr;return s-a})),c.forEach((function(t){t._next=null,t._prev=null})),t.removeAllChild(),t.update(),c.forEach((function(e){t.appendChild(e)})),i.hack_pieFace="outside",(s=e.pickGroup(t,n,r.parentMatrix,i)).graphic||(i.hack_pieFace="inside",s=e.pickGroup(t,n,r.parentMatrix,i)),s.graphic||(i.hack_pieFace="top",s=e.pickGroup(t,n,r.parentMatrix,i)),t.removeAllChild(),u.forEach((function(t){t._next=null,t._prev=null})),u.forEach((function(e){t.appendChild(e)}))}else if(h){var d=t.getChildren(),f=d.map((function(t){return{ave_z:t.findFace().vertices.map((function(e){var n;return o.view(e[0],e[1],null!==(n=e[2]+t.attribute.z)&&void 0!==n?n:0)[2]})).reduce((function(t,e){return t+e}),0),g:t}}));f.sort((function(t,e){return e.ave_z-t.ave_z})),t.removeAllChild(),f.forEach((function(t){t.g._next=null,t.g._prev=null})),t.update(),f.forEach((function(e){t.add(e.g)})),s=e.pickGroup(t,n,r.parentMatrix,i),t.removeAllChild(),d.forEach((function(t){t._next=null,t._prev=null})),t.update(),d.forEach((function(e){t.add(e)}))}else s=e.pickGroup(t,n,r.parentMatrix,i);return o.camera=null,o.restore(),i.in3dInterceptor=!1,s}return null}},{key:"initCanvasCtx",value:function(t){t.setTransformForCurrent()}}]),t}();nv=tv([Zi()],nv);var iv=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},rv=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},ov=function(t,e){return function(n,i){e(n,i,t)}},av=Symbol.for("PickerService"),sv=function(){function t(e,n){Qt(this,t),this.global=e,this.pickItemInterceptorContributions=n,this.type="default"}return Jt(t,[{key:"_init",value:function(){this.InterceptorContributions=this.pickItemInterceptorContributions.getContributions().sort((function(t,e){return t.order-e.order}))}},{key:"pick",value:function(t,e,n){var i={graphic:null,group:null};n.pickerService=this;var r=0,o=0;if(n&&n.bounds){if(!n.bounds.contains(e.x,e.y))return i;r=n.bounds.x1,o=n.bounds.y1}this.pickContext&&(this.pickContext.inuse=!0),n.pickContext=this.pickContext,this.pickContext&&this.pickContext.clearMatrix(!0,1);for(var a,s=new mo(1,0,0,1,r,o),l=t.length-1;l>=0&&(t[l].isContainer?i=this.pickGroup(t[l],e,s,n):i.graphic=this.pickItem(t[l],e,n),!i.graphic);l--)a||(a=i.group);return i.graphic||(i.group=a),this.pickContext&&(this.pickContext.inuse=!1),i}},{key:"containsPoint",value:function(t,e,n){return!!this.pickItem(t,e,n)}},{key:"pickGroup",value:function(t,e,n,i){var r=this,o={group:null,graphic:null};if(!1===t.attribute.visibleAll)return o;var a=i.pickContext,s=a.modelMatrix;if(a.camera){var l=t.transMatrix,h=Jd.allocate();if(rf(h,l),s){if(h){var u=Jd.allocate();a.modelMatrix=of(u,s,h),Jd.free(h)}}else rf(h,t.globalTransMatrix),a.modelMatrix=h}if(this.InterceptorContributions.length)for(var c=0;c<this.InterceptorContributions.length;c++){var d=this.InterceptorContributions[c];if(d.beforePickItem){var f=d.beforePickItem(t,this,e,i,{parentMatrix:n});if(f)return a.modelMatrix!==s&&Jd.free(a.modelMatrix),a.modelMatrix=s,f}}var p=t.transMatrix,g=Zd.allocateByObj(n),v=new eo(e.x,e.y);g.transformPoint(v,v);var y=t.AABBBounds.containsPoint(v);if(!y&&!t.stage.camera)return o;var m=!1!==t.attribute.pickable&&y;return g.multiply(p.a,p.b,p.c,p.d,p.e,p.f),!1!==t.attribute.childrenPickable&&Zg(t,Da.zIndex,(function(n){if(n.isContainer){var a=new eo(e.x,e.y),s=Js(t).group,l=t.attribute,h=l.scrollX,u=void 0===h?s.scrollX:h,c=l.scrollY,d=void 0===c?s.scrollY:c;a.x-=u,a.y-=d,o=r.pickGroup(n,a,g,i)}else{var f=new eo(e.x,e.y);g.transformPoint(f,f);var p=Js(t).group,v=t.attribute,y=v.scrollX,m=void 0===y?p.scrollX:y,b=v.scrollY,w=void 0===b?p.scrollY:b;f.x-=m,f.y-=w;var C=r.pickItem(n,f,i);o.graphic=C}return!!o.graphic||!!o.group}),!0,!!a.camera),a.modelMatrix!==s&&Jd.free(a.modelMatrix),a.modelMatrix=s,o.graphic||o.group||!m||t.stage.camera||(o.group=t),Zd.free(g),o}},{key:"selectPicker",value:function(t){return this.pickerMap.get(t.numberType)||null}}]),t}();sv=iv([Zi(),ov(0,tr(Ke)),ov(1,tr(lr)),ov(1,Ji(ev)),rv("design:paramtypes",[Object,Object])],sv);var lv=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},hv=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},uv=function(t,e){return function(n,i){e(n,i,t)}},cv=Symbol.for("GlobalPickerService"),dv=function(){function t(e){var n=this;Qt(this,t),this.global=e,this.global.hooks.onSetEnv.tap("global-picker-service",(function(t,e,i){n.configure(i,e)})),this.configure(this.global,this.global.env)}return Jt(t,[{key:"configure",value:function(t,e){}},{key:"pick",value:function(t,e,n){for(var i,r={graphic:null,group:null},o=new mo(1,0,0,1,0,0),a=0;a<t.length&&(t[a].isContainer?r=this.pickGroup(t[a],e,o,n):r.graphic=this.pickItem(t[a],e,n),!r.graphic);a++)i||(i=r.group);return r.graphic||(r.group=i),r}},{key:"containsPoint",value:function(t,e,n){return!!this.pickItem(t,e,n)}},{key:"pickGroup",value:function(t,e,n,i){var r=this,o={group:null,graphic:null};if(!1===t.attribute.visibleAll)return o;var a=t.transMatrix,s=new eo(e.x,e.y);n.transformPoint(s,s);var l=t.AABBBounds.containsPoint(s);if(!l)return o;var h=!1!==t.attribute.pickable&&l;return n.multiply(a.a,a.b,a.c,a.d,a.e,a.f),!1!==t.attribute.childrenPickable&&t.forEachChildren((function(t){if(t.isContainer)o=r.pickGroup(t,e,n,i);else{var a=new eo(e.x,e.y);n.transformPoint(a,a),o.graphic=r.pickItem(t,a,i)}return!!o.graphic||!!o.group})),o.graphic||o.group||!h||(o.group=t),o}},{key:"pickItem",value:function(t,e,n){return!1===t.attribute.pickable?null:t.AABBBounds.containsPoint(e)?t:null}}]),t}();function fv(t,e,n){var i=e[0],r=e[1],o=e[2],a=e[3],s=e[4],l=e[5],h=e[6],u=e[7],c=e[8],d=e[9],f=e[10],p=e[11],g=e[12],v=e[13],y=e[14],m=e[15],b=n[0],w=n[1],C=n[2],x=n[3];return t[0]=b*i+w*s+C*c+x*g,t[1]=b*r+w*l+C*d+x*v,t[2]=b*o+w*h+C*f+x*y,t[3]=b*a+w*u+C*p+x*m,b=n[4],w=n[5],C=n[6],x=n[7],t[4]=b*i+w*s+C*c+x*g,t[5]=b*r+w*l+C*d+x*v,t[6]=b*o+w*h+C*f+x*y,t[7]=b*a+w*u+C*p+x*m,b=n[8],w=n[9],C=n[10],x=n[11],t[8]=b*i+w*s+C*c+x*g,t[9]=b*r+w*l+C*d+x*v,t[10]=b*o+w*h+C*f+x*y,t[11]=b*a+w*u+C*p+x*m,b=n[12],w=n[13],C=n[14],x=n[15],t[12]=b*i+w*s+C*c+x*g,t[13]=b*r+w*l+C*d+x*v,t[14]=b*o+w*h+C*f+x*y,t[15]=b*a+w*u+C*p+x*m,t}function pv(t,e,n){var i=e[0],r=e[1],o=e[2],a=n[3]*i+n[7]*r+n[11]*o+n[15];return a=a||1,t[0]=(n[0]*i+n[4]*r+n[8]*o+n[12])/a,t[1]=(n[1]*i+n[5]*r+n[9]*o+n[13])/a,t[2]=(n[2]*i+n[6]*r+n[10]*o+n[14])/a,t}dv=lv([Zi(),uv(0,tr(Ke)),hv("design:paramtypes",[Object])],dv);var gv=function(){function t(e){Qt(this,t),this.params=e}return Jt(t,[{key:"params",get:function(){return Object.assign({},this._params)},set:function(t){this._params=Object.assign({},t),this._projectionMatrixCached=this.forceGetProjectionMatrix(),this._viewMatrixCached=this.forceGetViewMatrix()}},{key:"getViewMatrix",value:function(){return this._viewMatrixCached||(this._viewMatrixCached=Jd.allocate()),this._viewMatrixCached}},{key:"forceGetViewMatrix",value:function(){this._viewMatrixCached||(this._viewMatrixCached=Jd.allocate());var t=this.params.viewParams,e=t.pos,n=t.center,i=t.up;return function(t,e,n,i){var r,o,a,s,l,h,u,c,d,f,p=e[0],g=e[1],v=e[2],y=i[0],m=i[1],b=i[2],w=n[0],C=n[1],x=n[2];Math.abs(p-w)<Fr&&Math.abs(g-C)<Fr&&Math.abs(v-x)<Fr?qd.identity(t):(u=p-w,c=g-C,d=v-x,r=m*(d*=f=1/Math.hypot(u,c,d))-b*(c*=f),o=b*(u*=f)-y*d,a=y*c-m*u,(f=Math.hypot(r,o,a))?(r*=f=1/f,o*=f,a*=f):(r=0,o=0,a=0),s=c*a-d*o,l=d*r-u*a,h=u*o-c*r,(f=Math.hypot(s,l,h))?(s*=f=1/f,l*=f,h*=f):(s=0,l=0,h=0),t[0]=r,t[1]=s,t[2]=u,t[3]=0,t[4]=o,t[5]=l,t[6]=c,t[7]=0,t[8]=a,t[9]=h,t[10]=d,t[11]=0,t[12]=-(r*p+o*g+a*v),t[13]=-(s*p+l*g+h*v),t[14]=-(u*p+c*g+d*v),t[15]=1)}(this._viewMatrixCached,e,n,i),this._vp||(this._vp=Jd.allocate()),this._vp=fv(this._vp,this.getProjectionMatrix(),this.getViewMatrix()),this._viewMatrixCached}},{key:"getProjectionMatrix",value:function(){return this._projectionMatrixCached||(this._projectionMatrixCached=Jd.allocate()),this._projectionMatrixCached}},{key:"forceGetProjectionMatrix",value:function(){this._projectionMatrixCached||(this._projectionMatrixCached=Jd.allocate());var t=this._params,e=t.left,n=t.top,i=t.right,r=t.bottom;return function(t,e,n,i,r,o,a){var s=1/(e-n),l=1/(i-r),h=1/(o-a);t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*l,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*h,t[11]=0,t[12]=(e+n)*s,t[13]=(r+i)*l,t[14]=(a+o)*h,t[15]=1}(this._projectionMatrixCached,e,i,r,n,0,-2e6),this._vp||(this._vp=Jd.allocate()),this._vp=fv(this._vp,this.getProjectionMatrix(),this.getViewMatrix()),this._projectionMatrixCached}},{key:"getField",value:function(){var t=this._params,e=t.fieldRatio,n=void 0===e?.8:e,i=t.fieldDepth,r=t.left,o=t.right;return(null!=i?i:o-r)*n}},{key:"getProjectionScale",value:function(t){var e=this.getField();return e/(e+t)}},{key:"view",value:function(t,e,n){var i=[0,0,0];return pv(i,[t,e,n],this._viewMatrixCached),i}},{key:"vp",value:function(t,e,n){var i=[0,0,0],r=this._params.viewParams.pos;pv(i,[t,e,n],this._viewMatrixCached),t=i[0],e=i[1],n=i[2];var o=this.getProjectionScale(n);return{x:t*o+r[0],y:e*o+r[1]}}}]),t}(),vv=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},yv=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},mv=[0,0,0],bv=new mo(1,0,0,1,0,0),wv=function(){function t(e,n){Qt(this,t),this.fillAttributes=Object.assign(Object.assign({},Ea),{opacity:1}),this.strokeAttributes=Object.assign(Object.assign({},Oa),{opacity:1}),this.textAttributes=Object.assign(Object.assign({},La),{opacity:1}),this._clearShadowStyle=!1,this._clearFilterStyle=!1;var i=e.nativeCanvas.getContext("2d");if(!i)throw new Error("发生错误,获取2d上下文失败");this.nativeContext=i,this.canvas=e,this.matrix=new mo(1,0,0,1,0,0),this.stack=[],this.dpr=n,this.applyedMatrix=new mo(1,0,0,1,0,0)}return Jt(t,[{key:"fillStyle",get:function(){return this.nativeContext.fillStyle},set:function(t){this.nativeContext.fillStyle=t}},{key:"font",get:function(){return this.nativeContext.font},set:function(t){this.nativeContext.font=t}},{key:"globalAlpha",get:function(){return this.nativeContext.globalAlpha},set:function(t){this.nativeContext.globalAlpha=t}},{key:"lineCap",get:function(){return this.nativeContext.lineCap},set:function(t){this.nativeContext.lineCap=t}},{key:"lineDashOffset",get:function(){return this.nativeContext.lineDashOffset},set:function(t){this.nativeContext.lineDashOffset=t}},{key:"lineJoin",get:function(){return this.nativeContext.lineJoin},set:function(t){this.nativeContext.lineJoin=t}},{key:"lineWidth",get:function(){return this.nativeContext.lineWidth},set:function(t){this.nativeContext.lineWidth=t}},{key:"miterLimit",get:function(){return this.nativeContext.miterLimit},set:function(t){this.nativeContext.miterLimit=t}},{key:"shadowBlur",get:function(){return this.nativeContext.shadowBlur},set:function(t){this.nativeContext.shadowBlur=t}},{key:"shadowColor",get:function(){return this.nativeContext.shadowColor},set:function(t){this.nativeContext.shadowColor=t}},{key:"shadowOffsetX",get:function(){return this.nativeContext.shadowOffsetX},set:function(t){this.nativeContext.shadowOffsetX=t}},{key:"shadowOffsetY",get:function(){return this.nativeContext.shadowOffsetY},set:function(t){this.nativeContext.shadowOffsetY=t}},{key:"strokeStyle",get:function(){return this.nativeContext.strokeStyle},set:function(t){this.nativeContext.strokeStyle=t}},{key:"textAlign",get:function(){return this.nativeContext.textAlign},set:function(t){this.nativeContext.textAlign=t}},{key:"textBaseline",get:function(){return this.nativeContext.textBaseline},set:function(t){this.nativeContext.textBaseline=t}},{key:"inuse",get:function(){return!!this._inuse},set:function(t){t!==!!this._inuse&&(this._inuse=t,t?(this.nativeContext.save(),this.reset()):this.nativeContext.restore())}},{key:"reset",value:function(){this.stack.length&&console.warn("可能存在bug,matrix没有清空"),this.matrix.setValue(1,0,0,1,0,0),this.applyedMatrix=new mo(1,0,0,1,0,0),this.stack.length=0,this.nativeContext.setTransform(1,0,0,1,0,0)}},{key:"getCanvas",value:function(){return this.canvas}},{key:"getContext",value:function(){return this.nativeContext}},{key:"setTransformForCurrent",value:function(){!(arguments.length>0&&void 0!==arguments[0]&&arguments[0])&&this.applyedMatrix.equalToMatrix(this.matrix)||(this.applyedMatrix.setValue(this.matrix.a,this.matrix.b,this.matrix.c,this.matrix.d,this.matrix.e,this.matrix.f),this.nativeContext.setTransform(this.matrix.a,this.matrix.b,this.matrix.c,this.matrix.d,this.matrix.e,this.matrix.f))}},{key:"currentMatrix",get:function(){return this.matrix}},{key:"cloneMatrix",value:function(t){return Zd.allocateByObj(t)}},{key:"clear",value:function(){this.save(),this.resetTransform(),this.nativeContext.clearRect(0,0,this.canvas.width,this.canvas.height),this.restore()}},{key:"restore",value:function(){this.nativeContext.restore(),this.stack.length>0&&(Zd.free(this.matrix),this.matrix=this.stack.pop(),this.setTransformForCurrent(!0))}},{key:"highPerformanceRestore",value:function(){this.stack.length>0&&(Zd.free(this.matrix),this.matrix=this.stack.pop())}},{key:"rotate",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.matrix.rotate(t),e&&this.setTransformForCurrent()}},{key:"save",value:function(){var t=this.cloneMatrix(this.matrix);this.stack.push(t),this.nativeContext.save()}},{key:"highPerformanceSave",value:function(){var t=this.cloneMatrix(this.matrix);this.stack.push(t)}},{key:"scale",value:function(t,e){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.matrix.scale(t,e),n&&this.setTransformForCurrent()}},{key:"setScale",value:function(t,e){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.matrix.setScale(t,e),n&&this.setTransformForCurrent()}},{key:"scalePoint",value:function(t,e,n,i){var r=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];this.translate(n,i,!1),this.scale(t,e,!1),this.translate(-n,-i,!1),r&&this.setTransformForCurrent()}},{key:"setTransform",value:function(t,e,n,i,r,o){var a=!(arguments.length>6&&void 0!==arguments[6])||arguments[6],s=arguments.length>7&&void 0!==arguments[7]?arguments[7]:this.dpr;this.matrix.setValue(s*t,s*e,s*n,s*i,s*r,s*o),a&&this.setTransformForCurrent()}},{key:"setTransformFromMatrix",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.dpr;this.matrix.setValue(t.a*n,t.b*n,t.c*n,t.d*n,t.e*n,t.f*n),e&&this.setTransformForCurrent()}},{key:"resetTransform",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.dpr;this.setTransform(e,0,0,e,0,0),t&&this.setTransformForCurrent()}},{key:"transform",value:function(t,e,n,i,r,o){var a=!(arguments.length>6&&void 0!==arguments[6])||arguments[6];this.matrix.multiply(t,e,n,i,r,o),a&&this.setTransformForCurrent()}},{key:"transformFromMatrix",value:function(t,e){this.matrix.multiply(t.a,t.b,t.c,t.d,t.e,t.f),e&&this.setTransformForCurrent()}},{key:"translate",value:function(t,e){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.matrix.translate(t,e),n&&this.setTransformForCurrent()}},{key:"rotateDegrees",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=t*Math.PI/180;this.rotate(n,e)}},{key:"rotateAbout",value:function(t,e,n){var i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];this.translate(e,n,!1),this.rotate(t,!1),this.translate(-e,-n,!1),i&&this.setTransformForCurrent()}},{key:"rotateDegreesAbout",value:function(t,e,n){var i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];this.translate(e,n,!1),this.rotateDegrees(t,!1),this.translate(-e,-n,!1),i&&this.setTransformForCurrent()}},{key:"beginPath",value:function(){this.disableBeginPath||this.nativeContext.beginPath()}},{key:"clip",value:function(t,e){t?"string"==typeof t?this.nativeContext.clip(t):this.nativeContext.clip(t,e):this.nativeContext.clip()}},{key:"arc",value:function(t,e,n,i,r,o,a){if(a=a||0,this.camera){var s=[];!function(t,e,n,i,r,o,a,s){if(s)for(;n>e;)n-=Gr;else for(;n<e;)n+=Gr;for(var l=zr/3*(n>e?1:-1),h=e,u=h;u!==n;){u=l>0?Math.min(u+l,n):Math.max(u+l,n);var c=Math.abs(u-h),d=4*Math.tan(c/4)/3,f=u<h?-1:1,p=Math.cos(h),g=Math.sin(h),v=Math.cos(u),y=Math.sin(u),m=p*o+i,b=g*a+r,w=v*o+i,C=y*a+r,x=o*d*f,_=a*d*f;t.push([m-x*g,b+_*p,w+x*y,C-_*v,w,C]),h=u}}(s,i,r,t,e,n,n,o);for(var l=0;l<s.length;++l){var h=s[l];this.bezierCurveTo(h[0],h[1],h[2],h[3],h[4],h[5],a)}}else this.nativeContext.arc(t,e,n,i,r,o)}},{key:"arcTo",value:function(t,e,n,i,r){this.nativeContext.arcTo(t,e,n,i,r)}},{key:"bezierCurveTo",value:function(t,e,n,i,r,o,a){if(a=a||0,this.camera){var s=a,l=a;this.modelMatrix&&(pv(mv,[t,e,a],this.modelMatrix),t=mv[0],e=mv[1],s=mv[2],pv(mv,[n,i,a],this.modelMatrix),n=mv[0],i=mv[1],l=mv[2],pv(mv,[r,o,a],this.modelMatrix),r=mv[0],o=mv[1],a=mv[2]);var h=this.camera.vp(r,o,a);r=h.x,o=h.y,t=(h=this.camera.vp(t,e,s)).x,e=h.y,n=(h=this.camera.vp(n,i,l)).x,i=h.y}this.nativeContext.bezierCurveTo(t,e,n,i,r,o)}},{key:"closePath",value:function(){this.nativeContext.closePath()}},{key:"ellipse",value:function(t,e,n,i,r,o,a,s){null==s?this.nativeContext.ellipse(t,e,n,i,r,o,a):this.nativeContext.ellipse(t,e,n,i,r,o,a,s)}},{key:"lineTo",value:function(t,e,n){if(n=n||0,this.camera){this.modelMatrix&&(pv(mv,[t,e,n],this.modelMatrix),t=mv[0],e=mv[1],n=mv[2]);var i=this.camera.vp(t,e,n);t=i.x,e=i.y}this.nativeContext.lineTo(t,e)}},{key:"moveTo",value:function(t,e,n){if(n=n||0,this.camera){this.modelMatrix&&(pv(mv,[t,e,n],this.modelMatrix),t=mv[0],e=mv[1],n=mv[2]);var i=this.camera.vp(t,e,n);t=i.x,e=i.y}this.nativeContext.moveTo(t,e)}},{key:"quadraticCurveTo",value:function(t,e,n,i,r){if(r=r||0,this.camera){var o=r;this.modelMatrix&&(pv(mv,[t,e,r],this.modelMatrix),t=mv[0],e=mv[1],o=mv[2],pv(mv,[n,i,r],this.modelMatrix),n=mv[0],i=mv[1],r=mv[2]);var a=this.camera.vp(n,i,r);n=a.x,i=a.y,t=(a=this.camera.vp(t,e,o)).x,e=a.y}this.nativeContext.quadraticCurveTo(t,e,n,i)}},{key:"rect",value:function(t,e,n,i,r){r=r||0,this.camera?(this.moveTo(t,e,r),this.lineTo(t+n,e,r),this.lineTo(t+n,e+i,r),this.lineTo(t,e+i,r),this.closePath()):this.nativeContext.rect(t,e,n,i)}},{key:"createImageData",value:function(){var t=arguments;return 2===t.length?this.nativeContext.createImageData(t[0],t[1]):1===t.length?this.nativeContext.createImageData(t[0]):null}},{key:"createLinearGradient",value:function(t,e,n,i){return this.nativeContext.createLinearGradient(t,e,n,i)}},{key:"createPattern",value:function(t,e){return 0===t.width||0===t.height?null:this.nativeContext.createPattern(t,e)}},{key:"createRadialGradient",value:function(t,e,n,i,r,o){return this.nativeContext.createRadialGradient(t,e,n,i,r,o)}},{key:"createConicGradient",value:function(t,e,n,i){var r,o=!1,a=this;return{stops:[],addColorStop:function(t,e){this.stops.push([t,e]),o=!0},GetPattern:function(s,l,h){return o&&(h||(h=i-n),r=function(t,e,n,i,r,o,a,s,l){var h=Math.floor(180*r/Math.PI),u=vu.GetCanvas(),c=vu.GetCtx();if(!c)return null;var d=mu.GetSize(s),f=mu.GetSize(l),p=mu.Get(e,n,i,o,a,d,f);if(p)return u.width=p.width,u.height=p.height,c.putImageData(p,0,0),t.createPattern(u,"no-repeat");var g=Math.sqrt(Math.max(Math.max(Math.pow(n,2)+Math.pow(i,2),Math.pow(d-n,2)+Math.pow(i,2)),Math.max(Math.pow(d-n,2)+Math.pow(f-i,2),Math.pow(n,2)+Math.pow(f-i,2)))),v=h+1,y=r/Math.max(1,v-1),m=yu.GetOrCreate(e,v),b=2*Math.PI*g/360;u.width=d,u.height=f,c.setTransform(1,0,0,1,0,0),c.clearRect(0,0,d,f),c.translate(n,i),c.rotate(o);for(var w=0,C=v-1;w<C&&!(o+w*y>a);w++){var x=m.getColor(w);c.beginPath(),c.rotate(y),c.moveTo(0,0),c.lineTo(g,-2*b),c.lineTo(g,0),c.fillStyle=x,c.closePath(),c.fill()}return p=c.getImageData(0,0,d,f),mu.Set(e,n,i,o,a,p,d,f),u.width=p.width,u.height=p.height,c.putImageData(p,0,0),t.createPattern(u,"no-repeat")}(a,this.stops,t,e,h,n,i,s,l),o=!1),r}}}},{key:"fill",value:function(t,e){this.disableFill||(t?this.nativeContext.fill(t):this.nativeContext.fill())}},{key:"fillRect",value:function(t,e,n,i){this.nativeContext.fillRect(t,e,n,i)}},{key:"clearRect",value:function(t,e,n,i){this.nativeContext.clearRect(t,e,n,i)}},{key:"project",value:function(t,e,n){if(n=n||0,this.camera){this.modelMatrix&&(pv(mv,[t,e,n],this.modelMatrix),t=mv[0],e=mv[1],n=mv[2]);var i=this.camera.vp(t,e,n);t=i.x,e=i.y}return{x:t,y:e}}},{key:"view",value:function(t,e,n){return n=n||0,this.camera?(this.modelMatrix&&(pv(mv,[t,e,n],this.modelMatrix),t=mv[0],e=mv[1],n=mv[2]),this.camera.view(t,e,n)):[t,e,n]}},{key:"fillText",value:function(t,e,n,i){if(i=i||0,this.camera){this.modelMatrix&&(pv(mv,[e,n,i],this.modelMatrix),e=mv[0],n=mv[1],i=mv[2]);var r=this.camera.vp(e,n,i);e=r.x,n=r.y}this.nativeContext.fillText(t,e,n)}},{key:"getImageData",value:function(t,e,n,i){return this.nativeContext.getImageData(t,e,n,i)}},{key:"getLineDash",value:function(){return this.nativeContext.getLineDash()}},{key:"isPointInPath",value:function(t,e){return this.nativeContext.isPointInPath(t,e)}},{key:"isPointInStroke",value:function(t,e){return this.nativeContext.isPointInStroke(t,e)}},{key:"measureText",value:function(t){var e,n,i=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:as.global.measureTextMethod;return r&&"native"!==r?(this.mathTextMeasure||(this.mathTextMeasure=as.graphicUtil.createTextMeasureInstance({},{},(function(){return i.canvas}))),this.mathTextMeasure.textSpec.fontFamily=null!==(e=this.fontFamily)&&void 0!==e?e:La.fontFamily,this.mathTextMeasure.textSpec.fontSize=null!==(n=this.fontSize)&&void 0!==n?n:La.fontSize,this.mathTextMeasure._numberCharSize=null,this.mathTextMeasure._fullCharSize=null,this.mathTextMeasure._letterCharSize=null,this.mathTextMeasure._specialCharSizeMap={},this.mathTextMeasure.measure(t,r)):this.nativeContext.measureText(t)}},{key:"putImageData",value:function(t,e,n){this.nativeContext.putImageData(t,e,n)}},{key:"setLineDash",value:function(t){var e=arguments,n=this.nativeContext;this.nativeContext.setLineDash?n.setLineDash(e[0]):"mozDash"in n?n.mozDash=e[0]:"webkitLineDash"in n&&(n.webkitLineDash=e[0])}},{key:"stroke",value:function(t){this.disableStroke||(t?this.nativeContext.stroke(t):this.nativeContext.stroke())}},{key:"strokeRect",value:function(t,e,n,i){this.nativeContext.strokeRect(t,e,n,i)}},{key:"strokeText",value:function(t,e,n,i){if(i=i||0,this.camera){this.modelMatrix&&(pv(mv,[e,n,i],this.modelMatrix),e=mv[0],n=mv[1],i=mv[2]);var r=this.camera.vp(e,n,i);e=r.x,n=r.y}this.nativeContext.strokeText(t,e,n)}},{key:"drawImage",value:function(){var t=this.nativeContext,e=arguments;3===e.length?t.drawImage(e[0],e[1],e[2]):5===e.length?t.drawImage(e[0],e[1],e[2],e[3],e[4]):9===e.length&&t.drawImage(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])}},{key:"setCommonStyle",value:function(t,e,n,i,r){if(Array.isArray(r)){if(r.length<=1)return this._setCommonStyle(t,e,n,i,r[0]);var o={};return r.forEach((function(t){Object.assign(o,t)})),this._setCommonStyle(t,e,n,i,o)}return this._setCommonStyle(t,e,n,i,r)}},{key:"_setCommonStyle",value:function(t,e,n,i,r){var o=this.nativeContext;r||(r=this.fillAttributes);var a=e.fillOpacity,s=void 0===a?r.fillOpacity:a,l=e.opacity,h=void 0===l?r.opacity:l,u=e.fill,c=void 0===u?r.fill:u;s>1e-12&&h>1e-12?(o.globalAlpha=s*h,o.fillStyle=wu(this,c,t,n,i)):o.globalAlpha=s*h}},{key:"setShadowStyle",value:function(t,e,n){if(Array.isArray(n)){if(n.length<=1)return this._setShadowStyle(t,n[0]);var i={};return n.forEach((function(t){Object.assign(i,t)})),this._setShadowStyle(t,e,i)}return this._setShadowStyle(t,e,n)}},{key:"_setShadowStyle",value:function(t,e,n){var i=this.nativeContext;n||(n=this.fillAttributes);var r=e.opacity,o=void 0===r?n.opacity:r,a=e.shadowBlur,s=void 0===a?n.shadowBlur:a,l=e.shadowColor,h=void 0===l?n.shadowColor:l,u=e.shadowOffsetX,c=void 0===u?n.shadowOffsetX:u,d=e.shadowOffsetY,f=void 0===d?n.shadowOffsetY:d,p=e.blur,g=void 0===p?n.blur:p;o<=1e-12||(s||c||f?(i.shadowBlur=s,i.shadowColor=h,i.shadowOffsetX=c,i.shadowOffsetY=f,this._clearShadowStyle=!0):this._clearShadowStyle&&(i.shadowBlur=0,i.shadowOffsetX=0,i.shadowOffsetY=0),g?(i.filter="blur(".concat(g,"px)"),this._clearFilterStyle=!0):this._clearFilterStyle&&(i.filter="blur(0px)",this._clearFilterStyle=!1))}},{key:"setStrokeStyle",value:function(t,e,n,i,r){if(Array.isArray(r)){if(r.length<=1)return this._setStrokeStyle(t,e,n,i,r[0]);var o={};return r.forEach((function(t){Object.assign(o,t)})),this._setStrokeStyle(t,e,n,i,o)}return this._setStrokeStyle(t,e,n,i,r)}},{key:"_setStrokeStyle",value:function(t,e,n,i,r){var o=this.nativeContext;r||(r=this.strokeAttributes);var a=e.strokeOpacity,s=void 0===a?r.strokeOpacity:a,l=e.opacity,h=void 0===l?r.opacity:l;if(s>1e-12&&h>1e-12){var u=e.lineWidth,c=void 0===u?r.lineWidth:u,d=e.stroke,f=void 0===d?r.stroke:d,p=e.lineJoin,g=void 0===p?r.lineJoin:p,v=e.lineDash,y=void 0===v?r.lineDash:v,m=e.lineCap,b=void 0===m?r.lineCap:m,w=e.miterLimit,C=void 0===w?r.miterLimit:w;o.globalAlpha=s*h,o.lineWidth=bu(this,c,this.dpr),o.strokeStyle=wu(this,f,t,n,i),o.lineJoin=g,o.setLineDash(y),o.lineCap=b,o.miterLimit=C}}},{key:"setTextStyleWithoutAlignBaseline",value:function(t,e,n){var i=this.nativeContext;e||(e=this.textAttributes),t.font?i.font=t.font:i.font=Su(t,e,this.camera&&this.camera.getProjectionScale(n));var r=t.fontFamily,o=void 0===r?e.fontFamily:r,a=t.fontSize,s=void 0===a?e.fontSize:a;this.fontFamily=o,this.fontSize=s,i.textAlign="left",i.textBaseline="alphabetic"}},{key:"setTextStyle",value:function(t,e,n){var i,r,o=this.nativeContext;e||(e=this.textAttributes),t.font?o.font=t.font:o.font=Su(t,e,this.camera&&this.camera.getProjectionScale(n));var a=t.fontFamily,s=void 0===a?e.fontFamily:a,l=t.fontSize,h=void 0===l?e.fontSize:l;this.fontFamily=s,this.fontSize=h,o.textAlign=null!==(i=t.textAlign)&&void 0!==i?i:e.textAlign,o.textBaseline=null!==(r=t.textBaseline)&&void 0!==r?r:e.textBaseline}},{key:"draw",value:function(){}},{key:"clearMatrix",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.dpr;this.setTransformFromMatrix(bv,t,e)}},{key:"onlyTranslate",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.dpr;return this.matrix.a===t&&0===this.matrix.b&&0===this.matrix.c&&this.matrix.d===t}},{key:"release",value:function(){this.stack.forEach((function(t){return Zd.free(t)})),this.stack.length=0}}]),t}();wv.env="browser",wv=vv([Zi(),yv("design:paramtypes",[Object,Number])],wv);var Cv=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},xv=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},_v=500,Sv=500,kv=1,Av=function(){function t(e){Qt(this,t);var n=e.nativeCanvas,i=e.width,r=void 0===i?_v:i,o=e.height,a=void 0===o?Sv:o,s=e.dpr,l=void 0===s?kv:s,h=e.container,u=e.x,c=e.y,d=e.canvasControled,f=void 0===d||d;if(this._x=null!=u?u:0,this._y=null!=c?c:0,this._pixelWidth=r*l,this._pixelHeight=a*l,this._visiable=!1!==e.visiable,this.controled=f,"string"==typeof h){var p=as.global.getElementById(h);p&&(this._container=p)}else this._container=h;this._displayWidth=r,this._displayHeight=a,this._dpr=l,this._nativeCanvas=n,this._context=new wv(this,this._dpr),this._id=n.id,this.initStyle()}return Jt(t,[{key:"displayWidth",get:function(){return this._pixelWidth/this._dpr}},{key:"displayHeight",get:function(){return this._pixelHeight/this._dpr}},{key:"id",get:function(){return this._id}},{key:"x",get:function(){return this._x}},{key:"y",get:function(){return this._y}},{key:"nativeCanvas",get:function(){return this._nativeCanvas}},{key:"width",get:function(){return this._pixelWidth},set:function(t){this._pixelWidth=t,this._displayWidth=t/(this._dpr||1)}},{key:"height",get:function(){return this._pixelHeight},set:function(t){this._pixelHeight=t,this._displayHeight=t/(this._dpr||1)}},{key:"getContext",value:function(t){return this._context}},{key:"visiable",get:function(){return this._visiable},set:function(t){this._visiable=t,t?this.show():this.hide()}},{key:"dpr",get:function(){return this._dpr},set:function(t){this._dpr=t,this.resize(this.width,this.height)}},{key:"initStyle",value:function(){if(this.controled){var t=this.nativeCanvas;t.width=this._pixelWidth,t.height=this._pixelHeight,!t.style||this.setCanvasStyle(t,this._x,this._y,this._displayWidth,this._displayHeight),null!=this.id&&(t.id=this.id.toString()),this._container&&this._container.appendChild(t),this.visiable||this.hide()}}},{key:"applyPosition",value:function(){var t=this._nativeCanvas;t.style.position="absolute",t.style.top="".concat(this._y,"px"),t.style.left="".concat(this._x,"px")}},{key:"getNativeCanvas",value:function(){return this._nativeCanvas}},{key:"resetStyle",value:function(t){if(this.controled){var e=t.width,n=void 0===e?this._displayWidth:e,i=t.height,r=void 0===i?this._displayHeight:i,o=t.dpr,a=void 0===o?this._dpr:o,s=t.x,l=void 0===s?this._x:s,h=t.y,u=void 0===h?this._y:h,c=this.nativeCanvas;c.width=n*a,c.height=r*a,!c.style||this.setCanvasStyle(c,l,u,n,r),t.id&&(c.id=t.id),this.visiable||this.hide()}}},{key:"setCanvasStyle",value:function(t,e,n,i,r){this.controled&&(t.style.padding="0",t.style.margin="0",t.style.border="0",t.style.background="transparent",t.style.width="".concat(i,"px"),t.style.height="".concat(r,"px"))}},{key:"hide",value:function(){this._nativeCanvas&&(this._nativeCanvas.style.display="none")}},{key:"show",value:function(){this._nativeCanvas&&(this._nativeCanvas.style.display="block")}},{key:"resize",value:function(t,e){this.controled&&(this._pixelWidth=t*this._dpr,this._pixelHeight=e*this._dpr,this._displayWidth=t,this._displayHeight=e,this._nativeCanvas.style&&(this._nativeCanvas.style.width="".concat(t,"px"),this._nativeCanvas.style.height="".concat(e,"px")),this._nativeCanvas.width=this._pixelWidth,this._nativeCanvas.height=this._pixelHeight,this._context.dpr=this._dpr)}},{key:"toDataURL",value:function(t,e){return"image/jpeg"===t?this._nativeCanvas.toDataURL(t,e):"image/png"===t?this._nativeCanvas.toDataURL(t):this._nativeCanvas.toDataURL(t,e)}},{key:"readPixels",value:function(t,e,n,i){return this._context.getImageData(t,e,n,i)}},{key:"convertToBlob",value:function(t){throw new Error("暂未实现")}},{key:"transferToImageBitmap",value:function(){throw new Error("暂未实现")}},{key:"release",value:function(){this.controled&&this._nativeCanvas.parentElement&&this._nativeCanvas.parentElement.removeChild(this._nativeCanvas)}}]),t}();Av.env="browser",Av=Cv([Zi(),xv("design:paramtypes",[Object])],Av);var Rv=Symbol.for("CanvasArcPicker"),Bv=Symbol.for("CanvasArc3dPicker"),Tv=Symbol.for("CanvasAreaPicker"),Mv=Symbol.for("CanvasCirclePicker"),Pv=Symbol.for("CanvasImagePicker"),Ev=Symbol.for("CanvasLinePicker"),Hv=Symbol.for("CanvasPathPicker"),Ov=Symbol.for("CanvasRectPicker"),Lv=Symbol.for("CanvasRect3dPicker"),Iv=Symbol.for("CanvasSymbolPicker"),Dv=Symbol.for("CanvasTextPicker"),Wv=Symbol.for("CanvasPolygonPicker"),Fv=Symbol.for("CanvasPyramid3dPicker"),zv=Symbol.for("CanvasRichTextPicker"),jv=Symbol.for("CanvasGlyphPicker"),Nv=Symbol.for("CanvasPickerContribution"),Gv=Symbol.for("MathArcPicker"),Uv=Symbol.for("MathAreaPicker"),Kv=Symbol.for("MathCirclePicker"),Vv=Symbol.for("MathLinePicker"),Yv=Symbol.for("MathPathPicker"),Xv=Symbol.for("MathRectPicker"),$v=Symbol.for("MathSymbolPicker"),qv=Symbol.for("MathTextPicker"),Zv=Symbol.for("MathPolygonPicker"),Jv=Symbol.for("MathGlyphPicker"),Qv=Symbol.for("MathPickerContribution");function ty(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=re(t);if(e){var r=re(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return ie(this,n)}}var ey=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},ny=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},iy=function(t,e){return function(n,i){e(n,i,t)}},ry=function(t){ee(n,t);var e=ty(n);function n(t,i,r,o,a,s,l,h,u,c,d,f,p,g,v){var y;return Qt(this,n),(y=e.call(this,g,v)).contributions=t,y.circlePicker=i,y.rectPicker=r,y.arcPicker=o,y.areaPicker=a,y.imagePicker=s,y.linePicker=l,y.pathPicker=h,y.symbolPicker=u,y.textPicker=c,y.polygonPicker=d,y.richtextPicker=f,y.drawContribution=p,y.global=g,y.pickItemInterceptorContributions=v,y.global.hooks.onSetEnv.tap("canvas-picker-service",(function(t,e,n){y.configure(n,e)})),y.configure(y.global,y.global.env),y.pickerMap=new Map,y}return Jt(n,[{key:"init",value:function(){var t=this;this.contributions.getContributions().forEach((function(e){t.pickerMap.set(e.numberType,e)})),Yo(re(n.prototype),"_init",this).call(this)}},{key:"configure",value:function(t,e){var n={width:100,height:100,nativeCanvas:t.createCanvas({width:100,height:100}),id:"for-pick"};this.pickCanvas=new Av(n),this.pickContext=this.pickCanvas.getContext("2d")}},{key:"pickItem",value:function(t,e,n){if(!1===t.attribute.pickable)return null;if(this.InterceptorContributions.length)for(var i=0;i<this.InterceptorContributions.length;i++){var r=this.InterceptorContributions[i];if(r.beforePickItem&&r.beforePickItem(t,this,e,n))return t}var o=this.pickerMap.get(t.numberType);return o&&o.contains(t,e,n)?t:null}}]),n}(sv);ey([rr(),ny("design:type",Function),ny("design:paramtypes",[]),ny("design:returntype",void 0)],ry.prototype,"init",null),ry=ey([Zi(),iy(0,tr(lr)),iy(0,Ji(Nv)),iy(1,tr(Mv)),iy(2,tr(Ov)),iy(3,tr(Rv)),iy(4,tr(Tv)),iy(5,tr(Pv)),iy(6,tr(Ev)),iy(7,tr(Hv)),iy(8,tr(Iv)),iy(9,tr(Dv)),iy(10,tr(Wv)),iy(11,tr(zv)),iy(12,tr(Gg)),iy(13,tr(Ke)),iy(14,tr(lr)),iy(14,Ji(ev)),ny("design:paramtypes",[Object,Object,Object,Object,Object,Object,Object,Object,Object,Object,Object,Object,Object,Object,Object])],ry);var oy=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},ay=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},sy=new mo(1,0,0,1,0,0),ly={x:0,y:0},hy=function(){function t(e,n){Qt(this,t),this.matrix=new mo(1,0,0,1,0,0),this.stack=[],this.dpr=n,this.applyedMatrix=new mo(1,0,0,1,0,0),this.path=new Ba}return Jt(t,[{key:"nativeContext",get:function(){return this.path}},{key:"getCanvas",value:function(){throw new Error("不支持getCanvas")}},{key:"getContext",value:function(){throw new Error("不支持getContext")}},{key:"setTransformForCurrent",value:function(){!(arguments.length>0&&void 0!==arguments[0]&&arguments[0])&&this.applyedMatrix.equalToMatrix(this.matrix)||(this.applyedMatrix=this.cloneMatrix(this.matrix))}},{key:"currentMatrix",get:function(){return this.matrix}},{key:"cloneMatrix",value:function(t){return Zd.allocateByObj(t)}},{key:"clear",value:function(){this.save(),this.resetTransform(),this.restore()}},{key:"restore",value:function(){this.stack.length>0&&(Zd.free(this.matrix),this.matrix=this.stack.pop(),this.setTransformForCurrent())}},{key:"highPerformanceRestore",value:function(){this.stack.length>0&&(Zd.free(this.matrix),this.matrix=this.stack.pop())}},{key:"rotate",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.matrix.rotate(t),e&&this.setTransformForCurrent()}},{key:"save",value:function(){var t=this.cloneMatrix(this.matrix);this.stack.push(t)}},{key:"highPerformanceSave",value:function(){var t=this.cloneMatrix(this.matrix);this.stack.push(t)}},{key:"scale",value:function(t,e){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.matrix.scale(t,e),n&&this.setTransformForCurrent()}},{key:"setScale",value:function(t,e){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.matrix.setScale(t,e),n&&this.setTransformForCurrent()}},{key:"scalePoint",value:function(t,e,n,i){var r=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];this.translate(n,i,!1),this.scale(t,e,!1),this.translate(-n,-i,!1),r&&this.setTransformForCurrent()}},{key:"setTransform",value:function(t,e,n,i,r,o){var a=!(arguments.length>6&&void 0!==arguments[6])||arguments[6],s=arguments.length>7&&void 0!==arguments[7]?arguments[7]:this.dpr;this.matrix.setValue(s*t,s*e,s*n,s*i,s*r,s*o),a&&this.setTransformForCurrent()}},{key:"setTransformFromMatrix",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.dpr;this.matrix.setValue(t.a*n,t.b*n,t.c*n,t.d*n,t.e*n,t.f*n),e&&this.setTransformForCurrent()}},{key:"resetTransform",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.dpr;this.setTransform(e,0,0,e,0,0),t&&this.setTransformForCurrent()}},{key:"transform",value:function(t,e,n,i,r,o){var a=!(arguments.length>6&&void 0!==arguments[6])||arguments[6];this.matrix.multiply(t,e,n,i,r,o),a&&this.setTransformForCurrent()}},{key:"transformFromMatrix",value:function(t,e){this.matrix.multiply(t.a,t.b,t.c,t.d,t.e,t.f),e&&this.setTransformForCurrent()}},{key:"translate",value:function(t,e){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.matrix.translate(t,e),n&&this.setTransformForCurrent()}},{key:"rotateDegrees",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=t*Math.PI/180;this.rotate(n,e)}},{key:"rotateAbout",value:function(t,e,n){var i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];this.translate(e,n,!1),this.rotate(t,!1),this.translate(-e,-n,!1),i&&this.setTransformForCurrent()}},{key:"rotateDegreesAbout",value:function(t,e,n){var i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];this.translate(e,n,!1),this.rotateDegrees(t,!1),this.translate(-e,-n,!1),i&&this.setTransformForCurrent()}},{key:"beginPath",value:function(){this.path.clear()}},{key:"clip",value:function(t,e){}},{key:"arc",value:function(t,e,n,i,r,o){this.path.arc(t,e,n,i,r,o)}},{key:"arcTo",value:function(t,e,n,i,r){this.path.arcTo(t,e,n,i,r)}},{key:"bezierCurveTo",value:function(t,e,n,i,r,o){this.path.bezierCurveTo(t,e,n,i,r,o)}},{key:"closePath",value:function(){this.path.closePath()}},{key:"ellipse",value:function(t,e,n,i,r,o,a,s){}},{key:"lineTo",value:function(t,e){this.path.lineTo(t,e)}},{key:"moveTo",value:function(t,e){this.path.moveTo(t,e)}},{key:"quadraticCurveTo",value:function(t,e,n,i){this.path.quadraticCurveTo(t,e,n,i)}},{key:"rect",value:function(t,e,n,i){this.path.rect(t,e,n,i)}},{key:"createImageData",value:function(t,e){return null}},{key:"createLinearGradient",value:function(t,e,n,i){throw new Error("不支持createLinearGradient")}},{key:"createPattern",value:function(t,e){throw new Error("不支持createPattern")}},{key:"createRadialGradient",value:function(t,e,n,i,r,o){throw new Error("不支持createRadialGradient")}},{key:"createConicGradient",value:function(t,e,n,i){return null}},{key:"fill",value:function(t,e){}},{key:"fillRect",value:function(t,e,n,i){this.path.rect(t,e,n,i)}},{key:"clearRect",value:function(t,e,n,i){}},{key:"fillText",value:function(t,e,n){}},{key:"getImageData",value:function(t,e,n,i){return null}},{key:"getLineDash",value:function(){return[]}},{key:"isPointInPath",value:function(t,e){return this.matrix.transformPoint({x:t,y:e},ly),function(t,e,n){return Ds(t,0,!1,e,n)}(this.path.commandList,ly.x,ly.y)}},{key:"isPointInStroke",value:function(t,e){if(!this.lineWidth)return!1;this.matrix.transformPoint({x:t,y:e},ly);var n=bu(this,this.lineWidth,this.dpr);return function(t,e,n,i){return Ds(t,e,!0,n,i)}(this.path.commandList,n,ly.x,ly.y)}},{key:"measureText",value:function(t){throw new Error("不支持measureText")}},{key:"putImageData",value:function(t,e,n){throw new Error("不支持measureText")}},{key:"setLineDash",value:function(t){}},{key:"stroke",value:function(t){}},{key:"strokeRect",value:function(t,e,n,i){this.path.rect(t,e,n,i)}},{key:"strokeText",value:function(t,e,n){}},{key:"drawImage",value:function(){}},{key:"setCommonStyle",value:function(t,e,n,i,r){}},{key:"_setCommonStyle",value:function(t,e,n,i){}},{key:"setStrokeStyle",value:function(t,e,n,i,r){}},{key:"_setStrokeStyle",value:function(t,e,n,i){}},{key:"setTextStyleWithoutAlignBaseline",value:function(t,e){}},{key:"setTextStyle",value:function(t,e){}},{key:"draw",value:function(){}},{key:"clearMatrix",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.dpr;this.setTransformFromMatrix(sy,t,e)}},{key:"onlyTranslate",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.dpr;return this.matrix.a===t&&0===this.matrix.b&&0===this.matrix.c&&this.matrix.d===t}},{key:"release",value:function(){this.stack.forEach((function(t){return Zd.free(t)})),this.stack.length=0}}]),t}();function uy(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=re(t);if(e){var r=re(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return ie(this,n)}}hy=oy([Zi(),ay("design:paramtypes",[Object,Number])],hy);var cy=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},dy=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},fy=function(t,e){return function(n,i){e(n,i,t)}},py=function(t){ee(n,t);var e=uy(n);function n(t,i,r){var o;return Qt(this,n),(o=e.call(this,i,r)).contributions=t,o.global=i,o.pickItemInterceptorContributions=r,o.global.hooks.onSetEnv.tap("math-picker-service",(function(t,e,n){o.configure(n,e)})),o.configure(o.global,o.global.env),o.pickerMap=new Map,o}return Jt(n,[{key:"init",value:function(){var t=this;this.contributions.getContributions().forEach((function(e){t.pickerMap.set(e.numberType,e)})),Yo(re(n.prototype),"_init",this).call(this)}},{key:"configure",value:function(t,e){this.pickContext=new hy(null,1)}},{key:"pickItem",value:function(t,e,n){if(!1===t.attribute.pickable)return null;var i=this.pickerMap.get(t.numberType);return i&&i.contains(t,e,n)?t:null}}]),n}(sv);cy([rr(),dy("design:type",Function),dy("design:paramtypes",[]),dy("design:returntype",void 0)],py.prototype,"init",null),py=cy([Zi(),fy(0,tr(lr)),fy(0,Ji(Qv)),fy(1,tr(Ke)),fy(2,tr(lr)),fy(2,Ji(ev)),dy("design:paramtypes",[Object,Object,Object])],py);var gy=new Vi((function(t){t(ry).toSelf().inSingletonScope(),t(py).toSelf().inSingletonScope(),t(av).toService(ry),t(dv).toSelf().inSingletonScope(),t(cv).toService(dv),t(nv).toSelf().inSingletonScope(),t(ev).toService(nv),ur(t,ev)})),vy=new Vi((function(t){t(sf).toSelf().inSingletonScope(),t(Fh).toService(sf),t(Ed).toSelf().inSingletonScope(),t(Pd).toService(Ed),ur(t,Pd),t(Id).toSelf().inSingletonScope(),t(Ld).toService(Id),ur(t,Ld),t(zd).toSelf().inSingletonScope(),t(Fd).toService(zd),ur(t,Fd),t(Ud).toSelf().inSingletonScope(),t(Gd).toService(Ud),ur(t,Gd),t(Xd).toSelf().inSingletonScope(),t(Yd).toService(Xd),ur(t,Yd),t(zh).toConstantValue(Cf)})),yy=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},my=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},by=Symbol.for("PluginService"),wy=function(){function t(){Qt(this,t),this.onStartupFinishedPlugin=[],this.onRegisterPlugin=[],this.actived=!1}return Jt(t,[{key:"active",value:function(t){this.stage=t,this.actived=!0}},{key:"findPluginsByName",value:function(t){var e=[];return this.onStartupFinishedPlugin.forEach((function(n){n.name===t&&e.push(n)})),this.onRegisterPlugin.forEach((function(n){n.name===t&&e.push(n)})),e}},{key:"register",value:function(t){"onStartupFinished"===t.activeEvent?this.onStartupFinishedPlugin.push(t):"onRegister"===t.activeEvent&&(this.onRegisterPlugin.push(t),t.activate(this))}},{key:"release",value:function(){var t=this;this.onStartupFinishedPlugin.forEach((function(e){e.deactivate(t)})),this.onStartupFinishedPlugin=[],this.onRegisterPlugin.forEach((function(e){e.deactivate(t)})),this.onRegisterPlugin=[]}}]),t}();wy=yy([Zi(),my("design:paramtypes",[])],wy);var Cy=new Vi((function(t){t(wy).toSelf(),t(by).toService(wy)})),xy=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},_y=function(){function t(){Qt(this,t)}return Jt(t,[{key:"configure",value:function(t){t.env===this.type&&t.setActiveEnvContribution(this)}},{key:"getElementById",value:function(t){return document.getElementById(t)}},{key:"getRootElement",value:function(){return document.body}},{key:"loadJson",value:function(t){var e=fetch(t).then((function(t){return t.json()}));return e.then((function(t){return{data:t,state:"success"}})).catch((function(){return{data:null,state:"fail"}})),e}},{key:"loadArrayBuffer",value:function(t){return fetch(t).then((function(t){return t.arrayBuffer()})).then((function(t){return{data:t,loadState:"success"}})).catch((function(){return{data:null,loadState:"fail"}}))}},{key:"loadBlob",value:function(t){return fetch(t).then((function(t){return t.blob()})).then((function(t){return{data:t,loadState:"success"}})).catch((function(){return{data:null,loadState:"fail"}}))}}]),t}();function Sy(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=re(t);if(e){var r=re(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return ie(this,n)}}var ky=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},Ay=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};function Ry(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=document.createElement("img");if(n.crossOrigin="anonymous",e){var i=new Blob([t],{type:"image/svg+xml"});t=window.URL.createObjectURL(i)}return n.src=t,n.complete?Promise.resolve(n):new Promise((function(t,e){n.onload=function(){t(n)},n.onerror=function(){e(new Error("加载失败"))}}))}var By=function(t){ee(n,t);var e=Sy(n);function n(){var t;Qt(this,n),(t=e.call(this)).type="browser",t.supportEvent=!0;try{t.supportsTouchEvents="ontouchstart"in globalThis,t.supportsPointerEvents=!!globalThis.PointerEvent,t.supportsMouseEvents=!!globalThis.MouseEvent}catch(e){t.supportsTouchEvents=!1,t.supportsPointerEvents=!1,t.supportsPointerEvents=!1}return t.applyStyles=!0,t}return Jt(n,[{key:"mapToCanvasPoint",value:function(t,e){var n;if(e){var i,r,o=t.clientX,a=t.clientY,s=e.getBoundingClientRect(),l=null===(n=e.getNativeHandler)||void 0===n?void 0:n.call(e).nativeCanvas;return l&&(i=s.width/l.offsetWidth,r=s.height/l.offsetHeight),{x:(o-s.left)/(Rr(i)?i:1),y:(a-s.top)/(Rr(r)?i:1)}}return{x:t.offsetX,y:t.offsetY}}},{key:"loadImage",value:function(t){return Ry(t,!1).then((function(t){return{data:t,loadState:"success"}})).catch((function(){return{data:null,loadState:"fail"}}))}},{key:"loadSvg",value:function(t){return Ry(t,!0).then((function(t){return{data:t,loadState:"success"}})).catch((function(){return{data:null,loadState:"fail"}}))}},{key:"createCanvas",value:function(t){var e,n,i=document.createElement("canvas");t.id&&(i.id=null!==(e=t.id)&&void 0!==e?e:al.GenAutoIncrementId().toString());var r=null!==(n=t.dpr)&&void 0!==n?n:window.devicePixelRatio;return t.width&&t.height&&(i.style.width="".concat(t.width,"px"),i.style.height="".concat(t.height,"px"),i.width=t.width*r,i.height=t.height*r),i}},{key:"createOffscreenCanvas",value:function(t){var e,n=null!==(e=t.dpr)&&void 0!==e?e:window.devicePixelRatio;return new OffscreenCanvas(t.width*n,t.height*n)}},{key:"releaseCanvas",value:function(t){var e;(e="string"==typeof t?document.getElementById(t):t)&&e.parentElement&&e.parentElement.removeChild(e)}},{key:"getDevicePixelRatio",value:function(){return window.devicePixelRatio}},{key:"getRequestAnimationFrame",value:function(){return window.requestAnimationFrame}},{key:"getCancelAnimationFrame",value:function(){return window.cancelAnimationFrame}},{key:"addEventListener",value:function(t,e,n){return document.addEventListener(t,e,n)}},{key:"removeEventListener",value:function(t,e,n){return document.removeEventListener(t,e,n)}},{key:"dispatchEvent",value:function(t){return document.dispatchEvent(t)}},{key:"getElementById",value:function(t){return document.getElementById(t)}},{key:"getRootElement",value:function(){return document.body}},{key:"getDocument",value:function(){return document}},{key:"release",value:function(){}}]),n}(_y=xy([Zi()],_y));function Ty(){os.rebind(av).toService(py)}function My(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=re(t);if(e){var r=re(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return ie(this,n)}}By=ky([Zi(),Ay("design:paramtypes",[])],By);var Py=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},Ey=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};var Hy=function(t){ee(n,t);var e=My(n);function n(){var t;Qt(this,n),(t=e.call(this)).type="feishu",t.supportEvent=!0,t.canvasMap=new Map,t.freeCanvasList=[],t.canvasIdx=0,t.supportsTouchEvents=!0;try{t.supportsPointerEvents=!!globalThis.PointerEvent,t.supportsMouseEvents=!!globalThis.MouseEvent}catch(e){t.supportsPointerEvents=!1,t.supportsMouseEvents=!1}return t.applyStyles=!0,t}return Jt(n,[{key:"configure",value:function(t,e){var n,i,r,o,a,s;t.env===this.type&&(t.setActiveEnvContribution(this),n=e.domref,i=e.canvasIdLists,r=this.canvasMap,o=e.freeCanvasIdx,a=this.freeCanvasList,s=tt.getSystemInfoSync().pixelRatio,i.forEach((function(t,e){var i=tt.createCanvasContext(t);i.canvas={width:n.width*s,height:n.height*s};var l={width:n.width,height:n.height,offsetWidth:n.width,offsetHeight:n.height,id:null!=t?t:"",getContext:function(){return i},getBoundingClientRect:function(){return{height:n.height,width:n.width}}};r.set(t,l),e>=o&&a.push(l)})),Ty())}},{key:"loadImage",value:function(t){return Promise.resolve({data:t,loadState:"success"})}},{key:"loadSvg",value:function(t){return Promise.reject()}},{key:"createCanvas",value:function(t){var e=this.freeCanvasList[this.canvasIdx]||this.freeCanvasList[this.freeCanvasList.length-1];return this.canvasIdx++,e}},{key:"createOffscreenCanvas",value:function(t){}},{key:"releaseCanvas",value:function(t){}},{key:"getDevicePixelRatio",value:function(){return tt.getSystemInfoSync().pixelRatio}},{key:"getRequestAnimationFrame",value:function(){return function(t){return setTimeout(t,1e3/60,!0)}}},{key:"getCancelAnimationFrame",value:function(){return function(t){clearTimeout(t)}}},{key:"addEventListener",value:function(t,e,n){return null}},{key:"removeEventListener",value:function(t,e,n){return null}},{key:"dispatchEvent",value:function(t){return null}},{key:"getElementById",value:function(t){return this.canvasMap.get(t)}},{key:"getRootElement",value:function(){return null}},{key:"getDocument",value:function(){return null}},{key:"release",value:function(){}},{key:"mapToCanvasPoint",value:function(t){var e;return(null===(e=null==t?void 0:t.type)||void 0===e?void 0:e.startsWith("mouse"))?t:null}}]),n}(_y);function Oy(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=re(t);if(e){var r=re(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return ie(this,n)}}Hy=Py([Zi(),Ey("design:paramtypes",[])],Hy);var Ly=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},Iy=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};var Dy=function(t){ee(n,t);var e=Oy(n);function n(){var t;Qt(this,n),(t=e.call(this)).type="taro",t.supportEvent=!0,t.canvasMap=new Map,t.freeCanvasList=[],t.canvasIdx=0,t.supportsTouchEvents=!0;try{t.supportsPointerEvents=!!globalThis.PointerEvent,t.supportsMouseEvents=!!globalThis.MouseEvent}catch(e){t.supportsPointerEvents=!1,t.supportsMouseEvents=!1}return t.applyStyles=!0,t}return Jt(n,[{key:"configure",value:function(t,e){var n,i,r,o,a,s,l;t.env===this.type&&(t.setActiveEnvContribution(this),n=e.domref,i=e.canvasIdLists,r=this.canvasMap,o=e.freeCanvasIdx,a=this.freeCanvasList,s=e.taro,l=e.pixelRatio,i.forEach((function(t,e){var i=s.createCanvasContext(t);i.canvas={width:n.width*l,height:n.height*l},i.createRadialGradient||(i.createRadialGradient=function(){return i.createCircularGradient.apply(i,arguments)}),!i.getImageData&&s.canvasGetImageData&&(i.getImageData=function(e,n,i,r){return new Promise((function(o,a){try{s.canvasGetImageData({canvasId:t,x:e,y:n,width:i,height:r,success:function(t){o(t)}})}catch(t){a(t)}}))});var h={id:t,width:n.width,height:n.height,offsetWidth:n.width,offsetHeight:n.height,getContext:function(){return i},getBoundingClientRect:function(){return{height:n.height,width:n.width}}};return r.set(t,h),e>=o&&a.push(h),h})),this.taro=e.taro,this.pixelRatio=e.pixelRatio,os.rebind(av).toService(py))}},{key:"loadImage",value:function(t){return Promise.resolve({data:t,loadState:"success"})}},{key:"loadSvg",value:function(t){var e=window||globalThis;if(e.DOMParser){var n=(new e.DOMParser).parseFromString(t,"image/svg+xml").children[0],i=(new XMLSerializer).serializeToString(n),r="data:image/svg+xml;charset=utf-8,".concat(encodeURIComponent(i));return Promise.resolve({data:r,loadState:"success"})}if(e.Blob){var o=new e.Blob([t],{type:"image/svg+xml"}),a=e.URL.createObjectURL(o);return Promise.resolve({data:a,loadState:"success"})}return Promise.reject()}},{key:"createCanvas",value:function(t){var e=this.freeCanvasList[this.canvasIdx]||this.freeCanvasList[this.freeCanvasList.length-1];return this.canvasIdx++,e}},{key:"createOffscreenCanvas",value:function(t){}},{key:"releaseCanvas",value:function(t){}},{key:"getDevicePixelRatio",value:function(){return this.pixelRatio}},{key:"getRequestAnimationFrame",value:function(){return requestAnimationFrame}},{key:"getCancelAnimationFrame",value:function(){return cancelAnimationFrame}},{key:"addEventListener",value:function(t,e,n){return null}},{key:"removeEventListener",value:function(t,e,n){return null}},{key:"dispatchEvent",value:function(t){return null}},{key:"getElementById",value:function(t){return this.canvasMap.get(t)}},{key:"getRootElement",value:function(){return null}},{key:"getDocument",value:function(){return null}},{key:"release",value:function(){}}]),n}(_y);function Wy(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=re(t);if(e){var r=re(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return ie(this,n)}}Dy=Ly([Zi(),Iy("design:paramtypes",[])],Dy);var Fy=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},zy=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};var jy=function(t){ee(n,t);var e=Wy(n);function n(){var t;Qt(this,n),(t=e.call(this)).type="lynx",t.supportEvent=!0,t.canvasMap=new Map,t.freeCanvasList=[],t.canvasIdx=0,t.supportsTouchEvents=!0;try{t.supportsPointerEvents=!!globalThis.PointerEvent,t.supportsMouseEvents=!!globalThis.MouseEvent}catch(e){t.supportsPointerEvents=!1,t.supportsMouseEvents=!1}return t.applyStyles=!0,t}return Jt(n,[{key:"configure",value:function(t,e){var n,i,r,o,a;t.env===this.type&&(t.setActiveEnvContribution(this),n=e.domref,i=e.canvasIdLists,r=this.canvasMap,o=e.freeCanvasIdx,a=this.freeCanvasList,SystemInfo.pixelRatio,i.forEach((function(t,e){var i=lynx.createCanvas(t).getContext("2d");i.draw=function(t,e){e()};var s={width:n.width,height:n.height,offsetWidth:n.width,offsetHeight:n.height,id:null!=t?t:"",getContext:function(){return i},getBoundingClientRect:function(){return{height:n.height,width:n.width}}};r.set(t,s),e>=o&&a.push(s)})),Ty())}},{key:"loadImage",value:function(t){return Promise.resolve({data:t,loadState:"success"})}},{key:"loadSvg",value:function(t){return Promise.reject()}},{key:"createCanvas",value:function(t){var e=this.freeCanvasList[this.canvasIdx]||this.freeCanvasList[this.freeCanvasList.length-1];return this.canvasIdx++,e}},{key:"createOffscreenCanvas",value:function(t){}},{key:"releaseCanvas",value:function(t){}},{key:"getDevicePixelRatio",value:function(){return SystemInfo.pixelRatio}},{key:"getRequestAnimationFrame",value:function(){return function(t){return setTimeout(t,1e3/60,!0)}}},{key:"getCancelAnimationFrame",value:function(){return function(t){clearTimeout(t)}}},{key:"addEventListener",value:function(t,e,n){return null}},{key:"removeEventListener",value:function(t,e,n){return null}},{key:"dispatchEvent",value:function(t){return null}},{key:"getElementById",value:function(t){return this.canvasMap.get(t)}},{key:"getRootElement",value:function(){return null}},{key:"getDocument",value:function(){return null}},{key:"release",value:function(){}}]),n}(_y);function Ny(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=re(t);if(e){var r=re(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return ie(this,n)}}jy=Fy([Zi(),zy("design:paramtypes",[])],jy);var Gy=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},Uy=function(t){ee(n,t);var e=Ny(n);function n(){var t;return Qt(this,n),(t=e.apply(this,arguments)).type="node",t._lastTime=0,t.supportEvent=!1,t}return Jt(n,[{key:"configure",value:function(t,e){t.env===this.type&&(t.setActiveEnvContribution(this),this.pkg=e)}},{key:"loadJson",value:function(t){var e=fetch(t).then((function(t){return t.json()}));return e.then((function(t){return{data:t,state:"success"}})).catch((function(){return{data:null,state:"fail"}})),e}},{key:"loadArrayBuffer",value:function(t){return fetch(t).then((function(t){return t.arrayBuffer()})).then((function(t){return{data:t,loadState:"success"}})).catch((function(){return{data:null,loadState:"fail"}}))}},{key:"loadImage",value:function(t){var e=this.pkg.loadImage;return e?e(t).then((function(t){return{loadState:t?"success":"fail",data:t}})).catch((function(){return{loadState:"fail",data:null}})):Promise.reject(new Error("node-canvas loadImage could not be found!"))}},{key:"loadSvg",value:function(t){var e=this.pkg.Resvg;if(!e)return Promise.reject(new Error("@resvg/resvg-js svgParser could not be found!"));var n=new e(t).render().asPng();return this.loadImage(n)}},{key:"createCanvas",value:function(t){return this.pkg.createCanvas(t.width,t.height)}},{key:"releaseCanvas",value:function(t){}},{key:"getDevicePixelRatio",value:function(){return 1}},{key:"getRequestAnimationFrame",value:function(){return function(t){return setTimeout(t,1e3/60,!0)}}},{key:"getCancelAnimationFrame",value:function(){return function(t){clearTimeout(t)}}},{key:"addEventListener",value:function(t,e,n){}},{key:"removeEventListener",value:function(t,e,n){}},{key:"getElementById",value:function(t){return null}},{key:"getRootElement",value:function(){return null}},{key:"dispatchEvent",value:function(t){}},{key:"release",value:function(){}},{key:"createOffscreenCanvas",value:function(t){}}]),n}(_y);Uy=Gy([Zi()],Uy);var Ky=new Vi((function(t){t(By).toSelf().inSingletonScope(),t(Ue).toService(By),t(Hy).toSelf().inSingletonScope(),t(Ue).toService(Hy),t(Dy).toSelf().inSingletonScope(),t(Ue).toService(Dy),t(jy).toSelf().inSingletonScope(),t(Ue).toService(jy),t(Uy).toSelf().inSingletonScope(),t(Ue).toService(Uy),ur(t,Ue)})),Vy=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},Yy=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Xy=function(){function t(){Qt(this,t),this._uid=al.GenAutoIncrementId()}return Jt(t,[{key:"onChange",value:function(t){this._onChangeCb=t}},{key:"configure",value:function(t,e){e.env===this.type&&t.setWindowHandler(this)}}]),t}();function $y(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=re(t);if(e){var r=re(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return ie(this,n)}}var qy=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},Zy=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Jy=function(t,e){return function(n,i){e(n,i,t)}},Qy=function(t){ee(n,t);var e=$y(n);function n(t){var i;return Qt(this,n),(i=e.call(this)).global=t,i.type="browser",i}return Jt(n,[{key:"container",get:function(){return this.canvas.nativeCanvas.parentElement}},{key:"getTitle",value:function(){return this.canvas.id.toString()}},{key:"getWH",value:function(){return{width:this.canvas.width/(this.canvas.dpr||1),height:this.canvas.height/(this.canvas.dpr||1)}}},{key:"getXY",value:function(){return this.canvas.nativeCanvas.getBoundingClientRect()}},{key:"createWindow",value:function(t){t.canvas?this.createWindowByCanvas(t):this.createWindowByConfig(t)}},{key:"createWindowByConfig",value:function(t){var e,n=this.global.createCanvas({width:t.width,height:t.height});if(!(e="string"==typeof t.container?this.global.getElementById(t.container):t.container?t.container:this.global.getRootElement()))throw new Error("发生错误,containerId可能传入有误");t.offscreen?e=null:e.appendChild(n);var i={width:t.width,height:t.height,dpr:t.dpr,nativeCanvas:n,container:e,id:al.GenAutoIncrementId().toString(),canvasControled:!0};this.canvas=new Av(i)}},{key:"createWindowByCanvas",value:function(t){var e,n;if("string"==typeof t.canvas){if(!(n=this.global.getElementById(t.canvas)))throw new Error("canvasId 参数不正确,请确认canvas存在并插入dom")}else n=t.canvas;if(!n)throw new Error("发生错误,传入的canvas不正确");var i=t.width,r=t.height;if(null==i||null==r||!t.canvasControled){var o=n.getBoundingClientRect();i=o.width,r=o.height}var a=t.dpr;!1===t.canvasControled&&(a&&console.warn("canvasControled为false后,dpr参数将无效"),a=null),null==a&&(a=null!==(e=n.getContext("2d").pixelRatio)&&void 0!==e?e:n.width/i),this.canvas=new Av({width:i,height:r,dpr:a,nativeCanvas:n,canvasControled:t.canvasControled})}},{key:"releaseWindow",value:function(){this.canvas.release()}},{key:"resizeWindow",value:function(t,e){this.canvas.resize(t,e)}},{key:"setDpr",value:function(t){this.canvas.dpr=t}},{key:"getContext",value:function(){return this.canvas.getContext()}},{key:"getNativeHandler",value:function(){return this.canvas}},{key:"getDpr",value:function(){return this.canvas.dpr}},{key:"addEventListener",value:function(t,e,n){return this.canvas.nativeCanvas.addEventListener(t,e,n)}},{key:"removeEventListener",value:function(t,e,n){return this.canvas.nativeCanvas.removeEventListener(t,e,n)}},{key:"dispatchEvent",value:function(t){return this.canvas.nativeCanvas.dispatchEvent(t)}},{key:"getStyle",value:function(){return this.canvas.nativeCanvas.style}},{key:"setStyle",value:function(t){this.canvas.nativeCanvas.style=t}},{key:"getBoundingClientRect",value:function(){var t=this.canvas.nativeCanvas,e=this.getWH();return t.parentElement?this.canvas.nativeCanvas.getBoundingClientRect():{x:0,y:0,width:e.width,height:e.height,left:0,top:0,right:0,bottom:0}}},{key:"clearViewBox",value:function(t,e){var n=this.getContext(),i=this.getDpr();n.nativeContext.save(),n.nativeContext.setTransform(i,0,0,i,0,0),n.clearRect(t.x1,t.y1,t.x2-t.x1,t.y2-t.y1),e&&(n.fillStyle=e,n.fillRect(t.x1,t.y1,t.x2-t.x1,t.y2-t.y1)),n.nativeContext.restore()}}]),n}(Xy=Vy([Zi(),Yy("design:paramtypes",[])],Xy));function tm(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=re(t);if(e){var r=re(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return ie(this,n)}}Qy.env="browser",Qy=qy([Zi(),Jy(0,tr(Ke)),Zy("design:paramtypes",[Object])],Qy);var em=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},nm=function(t){ee(n,t);var e=tm(n);function n(){return Qt(this,n),e.apply(this,arguments)}return Jt(n,[{key:"globalAlpha",get:function(){return this._globalAlpha},set:function(t){this.nativeContext.globalAlpha=t,this._globalAlpha=t}},{key:"getImageData",value:function(t,e,n,i){var r=this;return new Promise((function(o,a){var s;try{tt.canvasGetImageData({canvasId:null!==(s=r.canvas.nativeCanvas.id)&&void 0!==s?s:r.canvas.id,x:t,y:e,width:n,height:i,success:function(t){o(t)}})}catch(t){a(t)}}))}},{key:"draw",value:function(){var t=this,e=this.nativeContext;this.drawPromise=new Promise((function(n){e.draw(!0,(function(){t.drawPromise=null,n(null)}))}))}}]),n}(wv);nm.env="feishu",nm=em([Zi()],nm);var im=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},rm=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},om=500,am=500,sm=1,lm=function(){function t(e){Qt(this,t);var n=e.nativeCanvas,i=e.width,r=void 0===i?om:i,o=e.height,a=void 0===o?am:o,s=e.dpr,l=void 0===s?sm:s,h=n.getBoundingClientRect?n.getBoundingClientRect():{x:0,y:0},u=h.x,c=h.y;this._x=u,this._y=c,this._pixelWidth=r*l,this._pixelHeight=a*l,this._visiable=!1!==e.visiable,this._displayWidth=r,this._displayHeight=a,this._dpr=l,this._nativeCanvas=n,this._context=new nm(this,this._dpr),this._id=n.id}return Jt(t,[{key:"id",get:function(){return this._id}},{key:"x",get:function(){return this._x}},{key:"y",get:function(){return this._y}},{key:"nativeCanvas",get:function(){return this._nativeCanvas}},{key:"width",get:function(){return this._pixelWidth},set:function(t){this._pixelWidth=t,this._displayWidth=t/(this._dpr||1)}},{key:"height",get:function(){return this._pixelHeight},set:function(t){this._pixelHeight=t,this._displayHeight=t/(this._dpr||1)}},{key:"displayWidth",get:function(){return this._displayWidth}},{key:"displayHeight",get:function(){return this._displayHeight}},{key:"getContext",value:function(t){return this._context}},{key:"visiable",get:function(){return this._visiable},set:function(t){this._visiable=t,t?this.show():this.hide()}},{key:"dpr",get:function(){return this._dpr},set:function(t){this._dpr=t}},{key:"getNativeCanvas",value:function(){return this._nativeCanvas}},{key:"resetStyle",value:function(t){}},{key:"applyPosition",value:function(){}},{key:"hide",value:function(){}},{key:"show",value:function(){}},{key:"resize",value:function(t,e){}},{key:"toDataURL",value:function(t,e){return""}},{key:"readPixels",value:function(t,e,n,i){throw new Error("暂未实现")}},{key:"convertToBlob",value:function(t){throw new Error("暂未实现")}},{key:"transferToImageBitmap",value:function(){throw new Error("暂未实现")}},{key:"release",value:function(){}}]),t}();function hm(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=re(t);if(e){var r=re(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return ie(this,n)}}lm.env="feishu",lm=im([Zi(),rm("design:paramtypes",[Object])],lm);var um=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},cm=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},dm=function(t,e){return function(n,i){e(n,i,t)}},fm=function(){function t(){Qt(this,t),this.cache={}}return Jt(t,[{key:"addEventListener",value:function(t,e){t&&e&&(this.cache[t]=this.cache[t]||{listener:[]},this.cache[t].listener.push(e))}},{key:"removeEventListener",value:function(t,e){if(t&&e&&this.cache[t]){var n=this.cache[t].listener.findIndex((function(t){return t===e}));n>=0&&this.cache[t].listener.splice(n,1)}}},{key:"cleanEvent",value:function(){this.cache={}}}]),t}(),pm=function(t){ee(n,t);var e=hm(n);function n(t){var i;return Qt(this,n),(i=e.call(this)).global=t,i.type="feishu",i.eventManager=new fm,i}return Jt(n,[{key:"container",get:function(){return null}},{key:"getTitle",value:function(){return this.canvas.id.toString()}},{key:"getWH",value:function(){return{width:this.canvas.width/(this.canvas.dpr||1),height:this.canvas.height/(this.canvas.dpr||1)}}},{key:"getXY",value:function(){return{x:0,y:0}}},{key:"createWindow",value:function(t){t.canvas?this.createWindowByCanvas(t):this.createWindowByConfig(t)}},{key:"createWindowByConfig",value:function(t){var e=this.global.createCanvas({width:t.width,height:t.height}),n={width:t.width,height:t.height,dpr:t.dpr,nativeCanvas:e,id:al.GenAutoIncrementId().toString(),canvasControled:!1};this.canvas=new lm(n)}},{key:"createWindowByCanvas",value:function(t){var e;if("string"==typeof t.canvas){if(!(e=this.global.getElementById(t.canvas)))throw new Error("canvasId 参数不正确,请确认canvas存在并插入dom")}else e=t.canvas;var n=t.width,i=t.height;if(null==n||null==i||!t.canvasControled){var r=e.getBoundingClientRect();n=r.width,i=r.height}var o=t.dpr;null==o&&(o=e.width/n),this.canvas=new lm({width:n,height:i,dpr:o,nativeCanvas:e,canvasControled:t.canvasControled})}},{key:"releaseWindow",value:function(){}},{key:"resizeWindow",value:function(t,e){}},{key:"setDpr",value:function(t){this.canvas.dpr=t}},{key:"getContext",value:function(){return this.canvas.getContext()}},{key:"getNativeHandler",value:function(){return this.canvas}},{key:"getDpr",value:function(){return this.canvas.dpr}},{key:"addEventListener",value:function(t,e){this.eventManager.addEventListener(t,e)}},{key:"removeEventListener",value:function(t,e){this.eventManager.removeEventListener(t,e)}},{key:"dispatchEvent",value:function(t){var e=t.type;return!!this.eventManager.cache[e]&&(t.changedTouches&&t.changedTouches[0]&&(t.offsetX=t.changedTouches[0].x,t.changedTouches[0].offsetX=t.changedTouches[0].x,t.changedTouches[0].clientX=t.changedTouches[0].x,t.offsetY=t.changedTouches[0].y,t.changedTouches[0].offsetY=t.changedTouches[0].y,t.changedTouches[0].clientY=t.changedTouches[0].y),t.preventDefault=function(){},t.stopPropagation=function(){},this.eventManager.cache[e].listener&&this.eventManager.cache[e].listener.forEach((function(e){e(t)})),!0)}},{key:"getStyle",value:function(){return{}}},{key:"setStyle",value:function(t){}},{key:"getBoundingClientRect",value:function(){var t=this.getWH();return{x:0,y:0,width:t.width,height:t.height,left:0,top:0,right:0,bottom:0}}},{key:"clearViewBox",value:function(t,e){var n=this.getContext(),i=this.getDpr();n.nativeContext.save(),n.nativeContext.setTransform(i,0,0,i,0,0),n.clearRect(t.x1,t.y1,t.x2-t.x1,t.y2-t.y1),e&&(n.fillStyle=e,n.fillRect(t.x1,t.y1,t.x2-t.x1,t.y2-t.y1)),n.nativeContext.restore()}}]),n}(Xy);function gm(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=re(t);if(e){var r=re(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return ie(this,n)}}pm.env="feishu",pm=um([Zi(),dm(0,tr(Ke)),cm("design:paramtypes",[Object])],pm);var vm=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},ym=function(t){ee(n,t);var e=gm(n);function n(){return Qt(this,n),e.apply(this,arguments)}return Jt(n,[{key:"globalAlpha",get:function(){return this._globalAlpha},set:function(t){this.nativeContext.setGlobalAlpha(t),this._globalAlpha=t}},{key:"draw",value:function(){this.nativeContext.draw()}},{key:"strokeText",value:function(t,e,n){}},{key:"_setCommonStyle",value:function(t,e,n,i,r){var o=this.nativeContext;r||(r=this.fillAttributes);var a=e.fillOpacity,s=void 0===a?r.fillOpacity:a,l=e.opacity,h=void 0===l?r.opacity:l,u=e.fill,c=void 0===u?r.fill:u;s>1e-12&&h>1e-12&&(o.setGlobalAlpha(s*h),o.setFillStyle(wu(this,c,t,n,i)))}},{key:"_setStrokeStyle",value:function(t,e,n,i,r){var o=this.nativeContext;r||(r=this.strokeAttributes);var a=e.strokeOpacity,s=void 0===a?r.strokeOpacity:a,l=e.opacity,h=void 0===l?r.opacity:l;if(s>1e-12&&h>1e-12){var u=e.lineWidth,c=void 0===u?r.lineWidth:u,d=e.stroke,f=void 0===d?r.stroke:d,p=e.lineJoin,g=void 0===p?r.lineJoin:p,v=e.lineDash,y=void 0===v?r.lineDash:v,m=e.lineCap,b=void 0===m?r.lineCap:m,w=e.miterLimit,C=void 0===w?r.miterLimit:w;o.setGlobalAlpha(s*h),o.setLineWidth(bu(this,c,this.dpr)),o.setStrokeStyle(wu(this,f,t,n,i)),o.setLineJoin(g),o.setLineDash(y),o.setLineCap(b),o.setMiterLimit(C)}}},{key:"setTextStyleWithoutAlignBaseline",value:function(t,e){var n,i=this.nativeContext;e||(e=this.textAttributes),t.font?i.font=t.font:i.font=Su(t,e),i.setFontSize(null!==(n=t.fontSize)&&void 0!==n?n:e.fontSize)}},{key:"setTextStyle",value:function(t,e){var n,i,r=this.nativeContext;e||(e=this.textAttributes),t.font?r.font=t.font:r.font=Su(t,e),r.setTextAlign(null!==(n=t.textAlign)&&void 0!==n?n:e.textAlign),r.setTextBaseline(null!==(i=t.textBaseline)&&void 0!==i?i:e.textBaseline)}},{key:"createConicGradient",value:function(t,e,n,i){return null}}]),n}(wv);ym.env="taro",ym=vm([Zi()],ym);var mm=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},bm=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},wm=500,Cm=500,xm=1,_m=function(){function t(e){Qt(this,t);var n=e.nativeCanvas,i=e.width,r=void 0===i?wm:i,o=e.height,a=void 0===o?Cm:o,s=e.dpr,l=void 0===s?xm:s,h=n.getBoundingClientRect?n.getBoundingClientRect():{x:0,y:0},u=h.x,c=h.y;this._x=u,this._y=c,this._pixelWidth=r*l,this._pixelHeight=a*l,this._visiable=!1!==e.visiable,this._displayWidth=r,this._displayHeight=a,this._dpr=l,this._nativeCanvas=n,this._context=new ym(this,this._dpr),this._id=n.id}return Jt(t,[{key:"id",get:function(){return this._id}},{key:"x",get:function(){return this._x}},{key:"y",get:function(){return this._y}},{key:"nativeCanvas",get:function(){return this._nativeCanvas}},{key:"width",get:function(){return this._pixelWidth},set:function(t){this._pixelWidth=t,this._displayWidth=t/(this._dpr||1)}},{key:"height",get:function(){return this._pixelHeight},set:function(t){this._pixelHeight=t,this._displayHeight=t/(this._dpr||1)}},{key:"displayWidth",get:function(){return this._displayWidth}},{key:"displayHeight",get:function(){return this._displayHeight}},{key:"getContext",value:function(t){return this._context}},{key:"visiable",get:function(){return this._visiable},set:function(t){this._visiable=t,t?this.show():this.hide()}},{key:"dpr",get:function(){return this._dpr},set:function(t){this._dpr=t}},{key:"getNativeCanvas",value:function(){return this._nativeCanvas}},{key:"resetStyle",value:function(t){}},{key:"applyPosition",value:function(){}},{key:"hide",value:function(){}},{key:"show",value:function(){}},{key:"resize",value:function(t,e){}},{key:"toDataURL",value:function(t,e){return""}},{key:"readPixels",value:function(t,e,n,i){throw new Error("暂未实现")}},{key:"convertToBlob",value:function(t){throw new Error("暂未实现")}},{key:"transferToImageBitmap",value:function(){throw new Error("暂未实现")}},{key:"release",value:function(){}}]),t}();function Sm(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=re(t);if(e){var r=re(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return ie(this,n)}}_m.env="taro",_m=mm([Zi(),bm("design:paramtypes",[Object])],_m);var km=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},Am=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Rm=function(t,e){return function(n,i){e(n,i,t)}},Bm=function(){function t(){Qt(this,t),this.cache={}}return Jt(t,[{key:"addEventListener",value:function(t,e){t&&e&&(this.cache[t]=this.cache[t]||{listener:[]},this.cache[t].listener.push(e))}},{key:"removeEventListener",value:function(t,e){if(t&&e&&this.cache[t]){var n=this.cache[t].listener.findIndex((function(t){return t===e}));n>=0&&this.cache[t].listener.splice(n,1)}}},{key:"cleanEvent",value:function(){this.cache={}}}]),t}(),Tm=function(t){ee(n,t);var e=Sm(n);function n(t){var i;return Qt(this,n),(i=e.call(this)).global=t,i.type="taro",i.eventManager=new Bm,i}return Jt(n,[{key:"container",get:function(){return null}},{key:"getTitle",value:function(){return this.canvas.id.toString()}},{key:"getWH",value:function(){return{width:this.canvas.width/(this.canvas.dpr||1),height:this.canvas.height/(this.canvas.dpr||1)}}},{key:"getXY",value:function(){return{x:0,y:0}}},{key:"createWindow",value:function(t){t.canvas?this.createWindowByCanvas(t):this.createWindowByConfig(t)}},{key:"createWindowByConfig",value:function(t){var e=this.global.createCanvas({width:t.width,height:t.height}),n={width:t.width,height:t.height,dpr:t.dpr,nativeCanvas:e,id:al.GenAutoIncrementId().toString(),canvasControled:!1};this.canvas=new _m(n)}},{key:"createWindowByCanvas",value:function(t){var e;if("string"==typeof t.canvas){if(!(e=this.global.getElementById(t.canvas)))throw new Error("canvasId 参数不正确,请确认canvas存在并插入dom")}else e=t.canvas;var n=t.width,i=t.height;if(null==n||null==i||!t.canvasControled){var r=e.getBoundingClientRect();n=r.width,i=r.height}var o=t.dpr;null==o&&(o=e.width/n),this.canvas=new _m({width:n,height:i,dpr:o,nativeCanvas:e,canvasControled:t.canvasControled})}},{key:"releaseWindow",value:function(){}},{key:"resizeWindow",value:function(t,e){}},{key:"setDpr",value:function(t){this.canvas.dpr=t}},{key:"getContext",value:function(){return this.canvas.getContext()}},{key:"getNativeHandler",value:function(){return this.canvas}},{key:"getDpr",value:function(){return this.canvas.dpr}},{key:"addEventListener",value:function(t,e){this.eventManager.addEventListener(t,e)}},{key:"removeEventListener",value:function(t,e){this.eventManager.removeEventListener(t,e)}},{key:"dispatchEvent",value:function(t){var e=t.type;return!!this.eventManager.cache[e]&&(t.changedTouches.length>0&&(t.changedTouches.forEach((function(e,n){t.changedTouches[n]=Object.assign(Object.assign({},t.changedTouches[n]),{offsetX:e.x,offsetY:e.y})})),t.offsetX=t.changedTouches[0].offsetX,t.offsetY=t.changedTouches[0].offsetY),t.touches.length>0&&t.touches.forEach((function(e,n){t.touches[n]=Object.assign(Object.assign({},t.touches[n]),{offsetX:e.x,offsetY:e.y})})),t.preventDefault=function(){},t.stopPropagation=function(){},this.eventManager.cache[e].listener&&this.eventManager.cache[e].listener.forEach((function(e){e(t)})),!0)}},{key:"getStyle",value:function(){return{}}},{key:"setStyle",value:function(t){}},{key:"getBoundingClientRect",value:function(){var t=this.getWH();return{x:0,y:0,width:t.width,height:t.height,left:0,top:0,right:0,bottom:0}}},{key:"clearViewBox",value:function(t,e){var n=this.getContext(),i=this.getDpr();n.nativeContext.save(),n.nativeContext.setTransform(i,0,0,i,0,0),n.clearRect(t.x1,t.y1,t.x2-t.x1,t.y2-t.y1),e&&(n.fillStyle=e,n.fillRect(t.x1,t.y1,t.x2-t.x1,t.y2-t.y1)),n.nativeContext.restore()}}]),n}(Xy);function Mm(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=re(t);if(e){var r=re(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return ie(this,n)}}Tm.env="taro",Tm=km([Zi(),Rm(0,tr(Ke)),Am("design:paramtypes",[Object])],Tm);var Pm=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},Em=function(t){ee(n,t);var e=Mm(n);function n(){return Qt(this,n),e.apply(this,arguments)}return Jt(n,[{key:"globalAlpha",get:function(){return this._globalAlpha},set:function(t){this.nativeContext.globalAlpha=t,this._globalAlpha=t}},{key:"draw",value:function(){var t=this,e=this.nativeContext;this.drawPromise=new Promise((function(n){e.draw(!0,(function(){t.drawPromise=null,n(null)}))}))}}]),n}(wv);Em.env="lynx",Em=Pm([Zi()],Em);var Hm=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},Om=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Lm=500,Im=500,Dm=1,Wm=function(){function t(e){Qt(this,t);var n=e.nativeCanvas,i=e.width,r=void 0===i?Lm:i,o=e.height,a=void 0===o?Im:o,s=e.dpr,l=void 0===s?Dm:s,h=n.getBoundingClientRect?n.getBoundingClientRect():{x:0,y:0},u=h.x,c=h.y;this._x=u,this._y=c,this._pixelWidth=r*l,this._pixelHeight=a*l,this._visiable=!1!==e.visiable,this._displayWidth=r,this._displayHeight=a,this._dpr=l,this._nativeCanvas=n,this._context=new Em(this,this._dpr),this._id=n.id}return Jt(t,[{key:"id",get:function(){return this._id}},{key:"x",get:function(){return this._x}},{key:"y",get:function(){return this._y}},{key:"nativeCanvas",get:function(){return this._nativeCanvas}},{key:"width",get:function(){return this._pixelWidth},set:function(t){this._pixelWidth=t,this._displayWidth=t/(this._dpr||1)}},{key:"height",get:function(){return this._pixelHeight},set:function(t){this._pixelHeight=t,this._displayHeight=t/(this._dpr||1)}},{key:"displayWidth",get:function(){return this._displayWidth}},{key:"displayHeight",get:function(){return this._displayHeight}},{key:"getContext",value:function(t){return this._context}},{key:"visiable",get:function(){return this._visiable},set:function(t){this._visiable=t,t?this.show():this.hide()}},{key:"dpr",get:function(){return this._dpr},set:function(t){this._dpr=t}},{key:"getNativeCanvas",value:function(){return this._nativeCanvas}},{key:"resetStyle",value:function(t){}},{key:"applyPosition",value:function(){}},{key:"hide",value:function(){}},{key:"show",value:function(){}},{key:"resize",value:function(t,e){}},{key:"toDataURL",value:function(t,e){return""}},{key:"readPixels",value:function(t,e,n,i){throw new Error("暂未实现")}},{key:"convertToBlob",value:function(t){throw new Error("暂未实现")}},{key:"transferToImageBitmap",value:function(){throw new Error("暂未实现")}},{key:"release",value:function(){}}]),t}();function Fm(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=re(t);if(e){var r=re(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return ie(this,n)}}Wm.env="lynx",Wm=Hm([Zi(),Om("design:paramtypes",[Object])],Wm);var zm=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},jm=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Nm=function(t,e){return function(n,i){e(n,i,t)}},Gm=function(){function t(){Qt(this,t),this.cache={}}return Jt(t,[{key:"addEventListener",value:function(t,e){t&&e&&(this.cache[t]=this.cache[t]||{listener:[]},this.cache[t].listener.push(e))}},{key:"removeEventListener",value:function(t,e){if(t&&e&&this.cache[t]){var n=this.cache[t].listener.findIndex((function(t){return t===e}));n>=0&&this.cache[t].listener.splice(n,1)}}},{key:"cleanEvent",value:function(){this.cache={}}}]),t}(),Um=function(t){ee(n,t);var e=Fm(n);function n(t){var i;return Qt(this,n),(i=e.call(this)).global=t,i.type="lynx",i.eventManager=new Gm,i}return Jt(n,[{key:"container",get:function(){return null}},{key:"getTitle",value:function(){return this.canvas.id.toString()}},{key:"getWH",value:function(){return{width:this.canvas.width/(this.canvas.dpr||1),height:this.canvas.height/(this.canvas.dpr||1)}}},{key:"getXY",value:function(){return{x:0,y:0}}},{key:"createWindow",value:function(t){t.canvas?this.createWindowByCanvas(t):this.createWindowByConfig(t)}},{key:"createWindowByConfig",value:function(t){var e=this.global.createCanvas({width:t.width,height:t.height}),n={width:t.width,height:t.height,dpr:t.dpr,nativeCanvas:e,id:al.GenAutoIncrementId().toString(),canvasControled:!1};this.canvas=new Wm(n)}},{key:"createWindowByCanvas",value:function(t){var e;if("string"==typeof t.canvas){if(!(e=this.global.getElementById(t.canvas)))throw new Error("canvasId 参数不正确,请确认canvas存在并插入dom")}else e=t.canvas;var n=t.width,i=t.height;if(null==n||null==i||!t.canvasControled){var r=e.getBoundingClientRect();n=r.width,i=r.height}var o=t.dpr;null==o&&(o=e.width/n),this.canvas=new Wm({width:n,height:i,dpr:o,nativeCanvas:e,canvasControled:t.canvasControled})}},{key:"releaseWindow",value:function(){}},{key:"resizeWindow",value:function(t,e){}},{key:"setDpr",value:function(t){this.canvas.dpr=t}},{key:"getContext",value:function(){return this.canvas.getContext()}},{key:"getNativeHandler",value:function(){return this.canvas}},{key:"getDpr",value:function(){return this.canvas.dpr}},{key:"addEventListener",value:function(t,e){this.eventManager.addEventListener(t,e)}},{key:"removeEventListener",value:function(t,e){this.eventManager.removeEventListener(t,e)}},{key:"dispatchEvent",value:function(t){var e=t.type;return!!this.eventManager.cache[e]&&(t.changedTouches&&t.changedTouches[0]&&(t.offsetX=t.changedTouches[0].x,t.changedTouches[0].offsetX=t.changedTouches[0].x,t.changedTouches[0].clientX=t.changedTouches[0].x,t.offsetY=t.changedTouches[0].y,t.changedTouches[0].offsetY=t.changedTouches[0].y,t.changedTouches[0].clientY=t.changedTouches[0].y),t.preventDefault=function(){},t.stopPropagation=function(){},this.eventManager.cache[e].listener&&this.eventManager.cache[e].listener.forEach((function(e){e(t)})),!0)}},{key:"getStyle",value:function(){return{}}},{key:"setStyle",value:function(t){}},{key:"getBoundingClientRect",value:function(){var t=this.getWH();return{x:0,y:0,width:t.width,height:t.height,left:0,top:0,right:0,bottom:0}}},{key:"clearViewBox",value:function(t,e){var n=this.getContext(),i=this.getDpr();n.nativeContext.save(),n.nativeContext.setTransform(i,0,0,i,0,0),n.clearRect(t.x1,t.y1,t.x2-t.x1,t.y2-t.y1),e&&(n.fillStyle=e,n.fillRect(t.x1,t.y1,t.x2-t.x1,t.y2-t.y1)),n.nativeContext.restore()}}]),n}(Xy);function Km(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=re(t);if(e){var r=re(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return ie(this,n)}}Um.env="lynx",Um=zm([Zi(),Nm(0,tr(Ke)),jm("design:paramtypes",[Object])],Um);var Vm=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},Ym=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};new mo(1,0,0,1,0,0);var Xm=function(t){ee(n,t);var e=Km(n);function n(t,i){var r;Qt(this,n),r=e.call(this,t,i);var o=t.nativeCanvas.getContext("2d");if(!o)throw new Error("发生错误,获取2d上下文失败");return r.nativeContext=o,r.canvas=t,r.matrix=new mo(1,0,0,1,0,0),r.stack=[],r.dpr=null!=i?i:1,r}return Jt(n,[{key:"release",value:function(){}}]),n}(wv);Xm.env="node",Xm=Vm([Zi(),Ym("design:paramtypes",[Object,Number])],Xm);var $m=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},qm=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Zm=500,Jm=500,Qm=1,tb=function(){function t(e){Qt(this,t);var n=e.nativeCanvas,i=e.width,r=void 0===i?Zm:i,o=e.height,a=void 0===o?Jm:o,s=e.canvasControled,l=void 0===s||s,h=e.dpr,u=void 0===h?Qm:h;this._visiable=!1!==e.visiable,this.controled=l,this._pixelWidth=r*u,this._pixelHeight=a*u,this._displayWidth=r,this._displayHeight=a,this._nativeCanvas=n,this._context=new Xm(this,e.dpr),this._id=n.id,this._dpr=u}return Jt(t,[{key:"id",get:function(){return this._id}},{key:"x",get:function(){return 0}},{key:"y",get:function(){return 0}},{key:"nativeCanvas",get:function(){return this._nativeCanvas}},{key:"width",get:function(){return this._pixelWidth},set:function(t){this._pixelWidth=t,this._displayWidth=t/(this._dpr||1)}},{key:"displayWidth",get:function(){return this._pixelWidth/this._dpr}},{key:"displayHeight",get:function(){return this._pixelHeight/this._dpr}},{key:"height",get:function(){return this._pixelHeight},set:function(t){this._pixelHeight=t,this._displayHeight=t/(this._dpr||1)}},{key:"getContext",value:function(t){return this._context}},{key:"visiable",get:function(){return this._visiable},set:function(t){this._visiable=t,t?this.show():this.hide()}},{key:"dpr",get:function(){return this._dpr},set:function(t){this._dpr=t,this.resize(this.width,this.height)}},{key:"applyPosition",value:function(){}},{key:"getNativeCanvas",value:function(){return this._nativeCanvas}},{key:"resetStyle",value:function(t){}},{key:"hide",value:function(){}},{key:"show",value:function(){}},{key:"resize",value:function(t,e){this._pixelWidth=t*this._dpr,this._pixelHeight=e*this._dpr,this._displayWidth=t,this._displayHeight=e,this._nativeCanvas&&(this._nativeCanvas.width=this._pixelWidth,this._nativeCanvas.height=this._pixelHeight)}},{key:"toDataURL",value:function(t,e){return""}},{key:"readPixels",value:function(t,e,n,i){return this._context.getImageData(t,e,n,i)}},{key:"convertToBlob",value:function(t){throw new Error("暂未实现")}},{key:"transferToImageBitmap",value:function(){throw new Error("暂未实现")}},{key:"release",value:function(){throw new Error("暂不支持release")}}]),t}();function eb(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=re(t);if(e){var r=re(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return ie(this,n)}}tb.env="node",tb=$m([Zi(),qm("design:paramtypes",[Object])],tb);var nb=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},ib=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},rb=function(t,e){return function(n,i){e(n,i,t)}},ob=function(t){ee(n,t);var e=eb(n);function n(t){var i;return Qt(this,n),(i=e.call(this)).global=t,i.type="node",i}return Jt(n,[{key:"container",get:function(){return null}},{key:"getTitle",value:function(){return""}},{key:"getWH",value:function(){return{width:this.canvas.displayWidth,height:this.canvas.displayHeight}}},{key:"getXY",value:function(){return{x:0,y:0}}},{key:"createWindow",value:function(t){t.canvas?this.createWindowByCanvas(t):this.createWindowByConfig(t)}},{key:"createWindowByConfig",value:function(t){var e=this.global.createCanvas({width:t.width,height:t.height}),n={width:t.width,height:t.height,dpr:t.dpr,nativeCanvas:e,id:al.GenAutoIncrementId().toString(),canvasControled:!0};this.canvas=new tb(n)}},{key:"createWindowByCanvas",value:function(t){var e=t.canvas,n=t.width,i=t.height;null!=n&&null!=i&&t.canvasControled||(n=e.width,i=e.height),this.canvas=new tb({width:n,height:i,dpr:1,nativeCanvas:e,canvasControled:t.canvasControled})}},{key:"releaseWindow",value:function(){this.canvas.release()}},{key:"resizeWindow",value:function(t,e){this.canvas.resize(t,e)}},{key:"setDpr",value:function(t){this.canvas.dpr=t}},{key:"getContext",value:function(){return this.canvas.getContext()}},{key:"getNativeHandler",value:function(){return this.canvas}},{key:"getDpr",value:function(){return this.canvas.dpr}},{key:"getImageBuffer",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"image/png";return this.canvas.nativeCanvas.toBuffer(t)}},{key:"addEventListener",value:function(t,e,n){}},{key:"dispatchEvent",value:function(t){return!0}},{key:"removeEventListener",value:function(t,e,n){}},{key:"getStyle",value:function(){}},{key:"setStyle",value:function(t){}},{key:"getBoundingClientRect",value:function(){return null}},{key:"clearViewBox",value:function(t,e){}}]),n}(Xy);ob.env="node",ob=nb([Zi(),rb(0,tr(Ke)),ib("design:paramtypes",[Object])],ob);var ab=new Vi((function(t){t(Qy).toSelf(),t(tu).toDynamicValue((function(t){return t.container.get(Qy)})).whenTargetNamed(Qy.env),t(pm).toSelf(),t(tu).toDynamicValue((function(t){return t.container.get(pm)})).whenTargetNamed(pm.env),t(Tm).toSelf(),t(tu).toDynamicValue((function(t){return t.container.get(Tm)})).whenTargetNamed(Tm.env),t(Um).toSelf(),t(tu).toDynamicValue((function(t){return t.container.get(Um)})).whenTargetNamed(Um.env),t(ob).toSelf(),t(tu).toDynamicValue((function(t){return t.container.get(ob)})).whenTargetNamed(ob.env)})),sb=new Vi((function(t){t(rs).toSelf().inSingletonScope(),t(is).toService(rs),ur(t,is)})),lb=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},hb=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},ub=function(t,e){return function(n,i){e(n,i,t)}},cb=function(){function t(e){Qt(this,t),this.global=e,this.offscreen=!1}return Jt(t,[{key:"init",value:function(t,e,n){if(this.layer=t,n.main)this.context=e.getContext(),this.canvas=this.context.getCanvas();else{var i;i=n.canvasId?this.global.getElementById(n.canvasId):this.global.createCanvas({width:e.width,height:e.height});var r=e.getContext().getCanvas().nativeCanvas,o=hs({nativeCanvas:i,width:e.width,height:e.height,dpr:e.dpr,canvasControled:!0,container:e.getContainer(),x:r.offsetLeft,y:r.offsetTop});o.applyPosition(),this.canvas=o,this.context=o.getContext()}}},{key:"resize",value:function(t,e){this.canvas.resize(t,e)}},{key:"resizeView",value:function(t,e){}},{key:"render",value:function(t,e,n){var i;e.renderService.render(t,Object.assign(Object.assign({context:this.context,clear:null!==(i=e.background)&&void 0!==i?i:"#ffffff"},e),n))}},{key:"merge",value:function(t){var e=this;t.forEach((function(t){var n=t.getContext().canvas.nativeCanvas;e.context.drawImage(n,0,0)}))}},{key:"prepare",value:function(t,e){}},{key:"drawTo",value:function(t,e,n){var i,r=t.getContext();n.renderService.render(e,Object.assign(Object.assign({context:r},n),{clear:n.clear?null!==(i=n.background)&&void 0!==i?i:"#fff":void 0}))}},{key:"getContext",value:function(){return this.context}},{key:"release",value:function(){this.canvas.release()}}]),t}();cb=lb([Zi(),ub(0,tr(Ke)),hb("design:paramtypes",[Object])],cb);var db=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},fb=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},pb=function(t,e){return function(n,i){e(n,i,t)}},gb=function(){function t(e){Qt(this,t),this.global=e,this.offscreen=!0}return Jt(t,[{key:"init",value:function(t,e,n){this.layer=t;var i=hs({nativeCanvas:this.global.createOffscreenCanvas({width:n.width,height:n.height,dpr:e.dpr}),width:n.width,height:n.height,dpr:e.dpr,canvasControled:!0});this.canvas=i,this.context=i.getContext()}},{key:"resize",value:function(t,e){this.canvas.resize(t,e)}},{key:"resizeView",value:function(t,e){this.canvas.resize(t,e)}},{key:"render",value:function(t,e){var n;e.renderService.render(t,Object.assign(Object.assign({context:this.context},e),{x:0,y:0,clear:null!==(n=e.background)&&void 0!==n?n:"#ffffff"}))}},{key:"prepare",value:function(t,e){}},{key:"release",value:function(){this.canvas.release()}},{key:"getContext",value:function(){return this.context}},{key:"drawTo",value:function(t,e,n){var i=t.getContext(),r=t.dpr,o=n.x,a=void 0===o?0:o,s=n.y,l=void 0===s?0:s,h=n.width,u=void 0===h?this.layer.viewWidth:h,c=n.height,d=void 0===c?this.layer.viewHeight:c;i.nativeContext.save(),i.nativeContext.setTransform(r,0,0,r,0,0),n.clear&&i.clearRect(a,l,u,d),i.drawImage(this.canvas.nativeCanvas,0,0,this.canvas.width,this.canvas.height,a,l,u,d),i.nativeContext.restore()}},{key:"merge",value:function(t){}}]),t}();gb=db([Zi(),pb(0,tr(Ke)),fb("design:paramtypes",[Object])],gb);var vb=new Vi((function(t){t(cb).toSelf(),t(gb).toSelf(),t(Uh).toService(cb)}));var yb=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},mb=Symbol.for("DrawItemInterceptor"),bb=new ao,wb=function(){function t(){Qt(this,t),this.order=1}return Jt(t,[{key:"afterDrawItem",value:function(t,e,n,i,r){if(!t.shadowRoot)return!1;var o=n.context;if(o.highPerformanceSave(),o.transformFromMatrix(t.transMatrix,!0),i.dirtyBounds&&i.backupDirtyBounds){bb.copy(i.dirtyBounds);var a=t.globalTransMatrix.getInverse();i.dirtyBounds.copy(i.backupDirtyBounds).transformWithMatrix(a)}return i.renderGroup(t.shadowRoot,n),o.highPerformanceRestore(),i.dirtyBounds&&i.backupDirtyBounds&&i.dirtyBounds.copy(bb),!0}}]),t}();wb=yb([Zi()],wb);var Cb=function(){function t(){Qt(this,t),this.order=1}return Jt(t,[{key:"beforeDrawItem",value:function(t,e,n,i,r){if(!t.in3dMode||n.in3dInterceptor)return!1;n.in3dInterceptor=!0;var o=e.drawParams,a=o.context,s=o.stage;a.canvas,a.save(),this.initCanvasCtx(a),a.camera=s.camera;var l=a.currentMatrix;l.a/=a.dpr,l.b/=a.dpr,l.c/=a.dpr,l.d/=a.dpr,l.e/=a.dpr,l.f/=a.dpr;var h=Jd.allocate();rf(h,l);var u=a.modelMatrix;if(u){if(h){var c=Jd.allocate();a.modelMatrix=of(c,u,h)}}else a.modelMatrix=h;if(a.setTransform(1,0,0,1,0,0,!0),t.isContainer){var d=!1,f=!1;if(t.forEachChildren((function(t){return!(d=t.numberType===Sh)})),t.forEachChildren((function(t){return!(f=!!t.findFace)})),d){var p=t.getChildren(),g=Wt(p);g.sort((function(t,e){for(var n,i,r,o,a=((null!==(n=t.attribute.startAngle)&&void 0!==n?n:0)+(null!==(i=t.attribute.endAngle)&&void 0!==i?i:0))/2,s=((null!==(r=e.attribute.startAngle)&&void 0!==r?r:0)+(null!==(o=e.attribute.endAngle)&&void 0!==o?o:0))/2;a<0;)a+=Gr;for(;s<0;)s+=Gr;return s-a})),g.forEach((function(t){t._next=null,t._prev=null})),t.removeAllChild(),t.update(),g.forEach((function(e){t.appendChild(e)})),n.hack_pieFace="outside",i.renderGroup(t,n),n.hack_pieFace="inside",i.renderGroup(t,n),n.hack_pieFace="top",i.renderGroup(t,n),t.removeAllChild(),p.forEach((function(t){t._next=null,t._prev=null})),p.forEach((function(e){t.appendChild(e)}))}else if(f){var v=t.getChildren(),y=v.map((function(t){return{ave_z:t.findFace().vertices.map((function(e){var n;return a.view(e[0],e[1],null!==(n=e[2]+t.attribute.z)&&void 0!==n?n:0)[2]})).reduce((function(t,e){return t+e}),0),g:t}}));y.sort((function(t,e){return e.ave_z-t.ave_z})),t.removeAllChild(),y.forEach((function(t){t.g._next=null,t.g._prev=null})),t.update(),y.forEach((function(e){t.add(e.g)})),i.renderGroup(t,n),t.removeAllChild(),v.forEach((function(t){t._next=null,t._prev=null})),t.update(),v.forEach((function(e){t.add(e)}))}else i.renderGroup(t,n)}else i.renderItem(t,n);return a.camera=null,a.restore(),a.modelMatrix!==u&&Jd.free(a.modelMatrix),a.modelMatrix=u,n.in3dInterceptor=!1,!0}},{key:"initCanvasCtx",value:function(t){t.setTransformForCurrent()}}]),t}();Cb=yb([Zi()],Cb);var xb=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},_b=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Sb=function(t,e){return function(n,i){e(n,i,t)}},kb=function(){function t(e,n,i,r){Qt(this,t),this.contributions=e,this.renderSelector=n,this.layerService=i,this.drawItemInterceptorContributions=r,this.currentRenderMap=new Map,this.defaultRenderMap=new Map,this.styleRenderMap=new Map,this.dirtyBounds=new oo,this.backupDirtyBounds=new oo}return Jt(t,[{key:"init",value:function(){var t=this;this.contributions.forEach((function(e){if(e.style){var n=t.styleRenderMap.get(e.style)||new Map;n.set(e.numberType,e),t.styleRenderMap.set(e.style,n)}else t.defaultRenderMap.set(e.numberType,e)})),this.InterceptorContributions=this.drawItemInterceptorContributions.getContributions().sort((function(t,e){return t.order-e.order}))}},{key:"draw",value:function(t,e){var n=this;e.drawContribution=this,this.currentRenderMap=this.styleRenderMap.get(e.renderStyle)||this.defaultRenderMap,this.currentRenderService=t;var i=e.context,r=e.stage,o=e.x,a=void 0===o?0:o,s=e.y,l=void 0===s?0:s,h=e.width,u=e.height;if(i){var c,d,f,p,g,v,y,m=this.dirtyBounds.setValue(0,0,h,u);if(r.dirtyBounds&&!r.dirtyBounds.empty()){var b=(c=m,d=r.dirtyBounds,f=!1,null===c?d:null===d?c:(so=c.x1,lo=c.x2,ho=c.y1,uo=c.y2,co=d.x1,fo=d.x2,po=d.y1,go=d.y2,f&&(so>lo&&(so=(p=[lo,so])[0],lo=p[1]),ho>uo&&(ho=(g=[uo,ho])[0],uo=g[1]),co>fo&&(co=(v=[fo,co])[0],fo=v[1]),po>go&&(po=(y=[go,po])[0],go=y[1])),so>=fo||lo<=co||ho>=go||uo<=po?{x1:0,y1:0,x2:0,y2:0}:{x1:Math.max(so,co),y1:Math.max(ho,po),x2:Math.min(lo,fo),y2:Math.min(uo,go)}));m.x1=Math.floor(b.x1),m.y1=Math.floor(b.y1),m.x2=Math.ceil(b.x2),m.y2=Math.ceil(b.y2)}this.backupDirtyBounds.copy(m),i.inuse=!0,i.clearMatrix(),i.setTransformForCurrent(!0);var w=m.width()*i.dpr!==i.canvas.width||m.height()*i.dpr!==i.canvas.height;i.save(),i.translate(a,l,!0),w&&(i.beginPath(),i.rect(m.x1,m.y1,m.width(),m.height()),i.clip()),r.camera&&(this.dirtyBounds.setValue(-1/0,-1/0,1/0,1/0),this.backupDirtyBounds.setValue(-1/0,-1/0,1/0,1/0)),this.clearScreen(t,i,e),i.save(),t.renderTreeRoots.sort((function(t,e){var n,i;return(null!==(n=t.attribute.zIndex)&&void 0!==n?n:Da.zIndex)-(null!==(i=e.attribute.zIndex)&&void 0!==i?i:Da.zIndex)})).forEach((function(t){n.renderGroup(t,e)})),i.restore(),i.restore(),i.draw(),i.inuse=!1}}},{key:"doRegister",value:function(){throw new Error("暂不支持")}},{key:"_findNextGraphic",value:function(t){for(var e=t.parent,n=t._uid;e;){var i=Qg(e,n,Da.zIndex);if(i)return i;n=e._uid,e=e.parent}return null}},{key:"renderGroup",value:function(t,e){var n=this;if(!e.break&&!1!==t.attribute.visibleAll){if(t.incremental&&(null==e.startAtId||e.startAtId===t._uid))return e.break=!0,void this._increaseRender(t,e);if(bo(t.AABBBounds,this.dirtyBounds,!1)){var i=this.dirtyBounds.clone(),r=t.globalTransMatrix.getInverse();this.dirtyBounds.copy(this.backupDirtyBounds).transformWithMatrix(r),this.renderItem(t,e,{drawingCb:function(){var i;Zg(t,Da.zIndex,(function(t){e.break||(t.isContainer?n.renderGroup(t,e):n.renderItem(t,e))}),!1,!!(null===(i=e.context)||void 0===i?void 0:i.camera))}}),this.dirtyBounds.copy(i)}}}},{key:"_increaseRender",value:function(t,e){var n=e.layer,i=e.stage,r=n.subLayers,o=r.get(t._uid);o||(o={layer:this.layerService.createLayer(i),zIndex:r.size,group:t},r.set(t._uid,o));var a=o.layer.getNativeHandler().getContext(),s=o.drawContribution||os.get(Sg);s.dirtyBounds.setValue(-1/0,-1/0,1/0,1/0),s.backupDirtyBounds.setValue(-1/0,-1/0,1/0,1/0),s.draw(this.currentRenderService,Object.assign(Object.assign({},e),{drawContribution:s,clear:"transparent",layer:o.layer,context:a,startAtId:t._uid,break:!1})),o.drawContribution=s;var l=this._findNextGraphic(t);if(l)if(l.isContainer&&l.incremental)this._increaseRender(l,e);else{var h=r.get(l._uid);h||(h={layer:this.layerService.createLayer(i),zIndex:r.size},r.set(l._uid,h));var u=h.layer.getNativeHandler().getContext();this.draw(this.currentRenderService,Object.assign(Object.assign({},e),{drawContribution:s,clear:"transparent",layer:h.layer,context:u,startAtId:l._uid,break:!1}))}}},{key:"getRenderContribution",value:function(t){var e=this.renderSelector.selector(t);return e||(e=this.selectRenderByNumberType(t.numberType)),e||(e=this.selectRenderByType(t.type)),e}},{key:"renderItem",value:function(t,e,n){if(this.InterceptorContributions.length)for(var i=0;i<this.InterceptorContributions.length;i++){var r=this.InterceptorContributions[i];if(r.beforeDrawItem&&r.beforeDrawItem(t,this.currentRenderService,e,this,n))return}var o=this.getRenderContribution(t);if(o&&(t.isContainer||bo(t.AABBBounds,this.dirtyBounds,!1))){var a=null!=e.startAtId&&t._uid!==e.startAtId;if(t._uid===e.startAtId&&(e.startAtId=null),n&&(n.skipDraw=a),a?t.isContainer&&o.draw(t,this.currentRenderService,e,n):o.draw(t,this.currentRenderService,e,n),this.InterceptorContributions.length)for(var s=0;s<this.InterceptorContributions.length;s++){var l=this.InterceptorContributions[s];if(l.afterDrawItem&&l.afterDrawItem(t,this.currentRenderService,e,this))return}}}},{key:"selectRenderByType",value:function(t){return console.warn("未知错误,不应该走到这里"),null}},{key:"selectRenderByNumberType",value:function(t){return this.currentRenderMap.get(t)||this.defaultRenderMap.get(t)}},{key:"clearScreen",value:function(t,e,n){var i=n.clear;if(i){var r=e.getCanvas(),o=n.width,a=void 0===o?r.width:o,s=n.height,l=void 0===s?r.height:s;e.clearRect(0,0,a,l),e.fillStyle=wu(e,i,{AABBBounds:{x1:0,y1:0,x2:0+a,y2:0+l}},0,0),e.fillRect(0,0,a,l)}}}]),t}();xb([rr(),_b("design:type",Function),_b("design:paramtypes",[]),_b("design:returntype",void 0)],kb.prototype,"init",null),kb=xb([Zi(),Sb(0,er(Tg)),Sb(1,tr(Ng)),Sb(2,tr(ru)),Sb(3,tr(lr)),Sb(3,Ji(mb)),_b("design:paramtypes",[Array,Object,Object,Object])],kb);var Ab=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},Rb=function(){function t(){Qt(this,t)}return Jt(t,[{key:"selector",value:function(t){return null}}]),t}();Rb=Ab([Zi()],Rb);var Bb=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},Tb=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Mb=function(t,e){return function(n,i){e(n,i,t)}},Pb=function(){function t(e){Qt(this,t),this.groupRenderContribitions=e,this.numberType=Bh}return Jt(t,[{key:"drawShape",value:function(t,e,n,i,r,o,a,s){var l=Js(t,null==o?void 0:o.theme).group,h=t.attribute,u=h.fill,c=void 0===u?l.fill:u,d=h.background,f=h.stroke,p=void 0===f?l.stroke:f,g=h.opacity,v=void 0===g?l.opacity:g,y=h.width,m=void 0===y?l.width:y,b=h.height,w=void 0===b?l.height:b,C=h.clip,x=void 0===C?l.clip:C,_=h.fillOpacity,S=void 0===_?l.fillOpacity:_,k=h.strokeOpacity,A=void 0===k?l.strokeOpacity:k,R=h.cornerRadius,B=void 0===R?l.cornerRadius:R,T=h.path,M=void 0===T?l.path:T,P=h.lineWidth,E=void 0===P?l.lineWidth:P,H=h.visible,O=void 0===H?l.visible:H,L=hu(v,S,m,w),I=cu(v,A,m,w),D=au(c),W=su(p,E);if(t.valid&&O){if(!x){if(!(D||W||d))return;if(!(L||I||a||s||d))return}if(M&&M.length&&r.drawContribution){var F=e.disableFill,z=e.disableStroke,j=e.disableBeginPath;e.disableFill=!0,e.disableStroke=!0,e.disableBeginPath=!0,M.forEach((function(t){r.drawContribution.getRenderContribution(t).draw(t,r.renderService,r,o)})),e.disableFill=F,e.disableStroke=z,e.disableBeginPath=j}else 0===B||Sr(B)&&B.every((function(t){return 0===t}))?(e.beginPath(),e.rect(n,i,m,w)):(e.beginPath(),vp(e,n,i,m,w,B));this._groupRenderContribitions||(this._groupRenderContribitions=this.groupRenderContribitions.getContributions()||[]);var N={doFill:D,doStroke:W};this._groupRenderContribitions.forEach((function(r){r.time===Sf.beforeFillStroke&&r.drawShape(t,e,n,i,D,W,L,I,l,a,s,N)})),x&&e.clip(),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,l),N.doFill&&(a?a(e,t.attribute,l):L&&(e.setCommonStyle(t,t.attribute,n,i,l),e.fill())),N.doStroke&&(s?s(e,t.attribute,l):I&&(e.setStrokeStyle(t,t.attribute,n,i,l),e.stroke())),this._groupRenderContribitions.forEach((function(r){r.time===Sf.afterFillStroke&&r.drawShape(t,e,n,i,D,W,L,I,l,a,s)}))}}},{key:"draw",value:function(t,e,n,i){var r=n.context;if(r){var o=t.attribute.clip;o?r.save():r.highPerformanceSave();var a=Js(t,null==i?void 0:i.theme).group,s=r.modelMatrix;if(r.camera){var l=Jd.allocate(),h=Jd.allocate();af(h,t,a),of(l,s||l,h),r.modelMatrix=l,Jd.free(h),r.setTransform(1,0,0,1,0,0,!0)}else r.transformFromMatrix(t.transMatrix,!0);r.beginPath(),i.skipDraw?this.drawShape(t,r,0,0,n,i,(function(){return!1}),(function(){return!1})):this.drawShape(t,r,0,0,n);var u,c=t.attribute,d=c.scrollX,f=void 0===d?a.scrollX:d,p=c.scrollY,g=void 0===p?a.scrollY:p;(f||g)&&r.translate(f,g),i&&i.drawingCb&&(u=i.drawingCb()),r.modelMatrix!==s&&Jd.free(r.modelMatrix),r.modelMatrix=s,u&&u.then?u.then((function(){o?r.restore():r.highPerformanceRestore()})):o?r.restore():r.highPerformanceRestore()}}}]),t}();function Eb(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=re(t);if(e){var r=re(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return ie(this,n)}}Pb=Bb([Zi(),Mb(0,tr(lr)),Mb(0,Ji(hp)),Tb("design:paramtypes",[Object])],Pb);var Hb=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},Ob=function(t){ee(n,t);var e=Eb(n);function n(){var t;return Qt(this,n),(t=e.apply(this,arguments)).numberType=Mh,t}return Jt(n,[{key:"drawShape",value:function(t,e,i,r,o,a,s,l){if(t.incremental&&o.multiGraphicOptions){var h=o.multiGraphicOptions,u=h.startAtIdx,c=h.length,d=t.attribute.segments,f=void 0===d?[]:d;if(u>f.length)return;var p=Js(t).line,g=t.attribute,v=g.fill,y=void 0===v?p.fill:v,m=g.stroke,b=void 0===m?p.stroke:m,w=g.opacity,C=void 0===w?p.opacity:w,x=g.fillOpacity,_=void 0===x?p.fillOpacity:x,S=g.strokeOpacity,k=void 0===S?p.strokeOpacity:S,A=g.lineWidth,R=void 0===A?p.lineWidth:A,B=g.visible,T=void 0===B?p.visible:B,M=lu(C,_),P=uu(C,k),E=au(y),H=su(b,R);if(!t.valid||!T)return;if(!E&&!H)return;if(!(M||P||s||l))return;for(var O=o.context,L=u;L<u+c;L++)this.drawIncreaseSegment(t,O,f[L-1],f[L],t.attribute.segments[L],[p,t.attribute],i,r)}else Yo(re(n.prototype),"drawShape",this).call(this,t,e,i,r,o,a,s,l)}},{key:"drawIncreaseSegment",value:function(t,e,n,i,r,o,a,s){i&&(e.beginPath(),function(t,e,n,i){var r=i||{},o=r.offsetX,a=void 0===o?0:o,s=r.offsetY,l=void 0===s?0:s,h=e?e.points[e.points.length-1]:n.points[0];t.moveTo(h.x+a,h.y+l),n.points.forEach((function(e){!1!==e.defined?t.lineTo(e.x+a,e.y+l):t.moveTo(e.x+a,e.y+l)}))}(e.nativeContext,n,i,{offsetX:a,offsetY:s}),e.setShadowStyle&&e.setShadowStyle(t,r,o),e.setStrokeStyle(t,r,a,s,o),e.stroke())}}]),n}(ep);function Lb(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=re(t);if(e){var r=re(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return ie(this,n)}}Ob=Hb([Zi()],Ob);var Ib=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},Db=function(t){ee(n,t);var e=Lb(n);function n(){var t;return Qt(this,n),(t=e.apply(this,arguments)).numberType=kh,t}return Jt(n,[{key:"drawShape",value:function(t,e,i,r,o,a,s){if(t.incremental&&o.multiGraphicOptions){var l=o.multiGraphicOptions,h=l.startAtIdx,u=l.length,c=t.attribute.segments,d=void 0===c?[]:c;if(h>d.length)return;var f=Js(t).area,p=t.attribute,g=p.fill,v=void 0===g?f.fill:g,y=p.fillOpacity,m=void 0===y?f.fillOpacity:y,b=p.opacity,w=void 0===b?f.opacity:b,C=p.visible,x=void 0===C?f.visible:C,_=lu(w,m),S=au(v);if(!t.valid||!x)return;if(!S)return;if(!_&&!s)return;for(var k=h;k<h+u;k++)this.drawIncreaseSegment(t,e,d[k-1],d[k],t.attribute.segments[k],[f,t.attribute],i,r)}else Yo(re(n.prototype),"drawShape",this).call(this,t,e,i,r,o,a,s)}},{key:"drawIncreaseSegment",value:function(t,e,n,i,r,o,a,s){i&&(e.beginPath(),function(t,e,n,i){for(var r=i||{},o=r.offsetX,a=void 0===o?0:o,s=r.offsetY,l=void 0===s?0:s,h=n.points,u=[],c=0;c<h.length;c++)h[c].defined;u.push(h),u.forEach((function(n,i){var r,o,s,h,u=e&&0===i?e.points[e.points.length-1]:n[0];t.moveTo(u.x+a,u.y+l),n.forEach((function(e){!1!==e.defined?t.lineTo(e.x+a,e.y+l):t.moveTo(e.x+a,e.y+l)}));for(var c=n.length-1;c>=0;c--){var d=n[c];t.lineTo(null!==(r=d.x1)&&void 0!==r?r:d.x,null!==(o=d.y1)&&void 0!==o?o:d.y)}t.lineTo(null!==(s=u.x1)&&void 0!==s?s:u.x,null!==(h=u.y1)&&void 0!==h?h:u.y),t.closePath()}))}(e.camera?e:e.nativeContext,n,i,{offsetX:a,offsetY:s}),e.setShadowStyle&&e.setShadowStyle(t,r,o),e.setCommonStyle(t,r,a,s,o),e.fill())}}]),n}(Dp);function Wb(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=re(t);if(e){var r=re(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return ie(this,n)}}Db=Ib([Zi()],Db);var Fb,zb=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},jb=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Nb=function(t,e){return function(n,i){e(n,i,t)}},Gb=function(t,e,n,i){return new(n||(n=Promise))((function(r,o){function a(t){try{l(i.next(t))}catch(t){o(t)}}function s(t){try{l(i.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((i=i.apply(t,e||[])).next())}))};!function(t){t[t.NORMAL=0]="NORMAL",t[t.STOP=1]="STOP"}(Fb||(Fb={}));var Ub=function(t){ee(n,t);var e=Wb(n);function n(t,i,r,o,a,s){var l;return Qt(this,n),(l=e.call(this,t,i,a,s)).contributions=t,l.renderSelector=i,l.lineRender=r,l.areaRender=o,l.layerService=a,l.drawItemInterceptorContributions=s,l.rendering=!1,l.currFrameStartAt=0,l.currentIdx=0,l.status=Fb.NORMAL,l.checkingForDrawPromise=null,l.hooks={completeDraw:new sr([])},l}return Jt(n,[{key:"init",value:function(){Yo(re(n.prototype),"init",this).call(this),this.defaultRenderMap.set(this.lineRender.numberType,this.lineRender),this.defaultRenderMap.set(this.areaRender.numberType,this.areaRender)}},{key:"draw",value:function(t,e){return Gb(this,void 0,void 0,ol.mark((function n(){var i,r,o,a,s,l,h=this;return ol.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!this.checkingForDrawPromise){n.next=2;break}return n.abrupt("return");case 2:return this.lastRenderService=t,this.lastDrawContext=e,this.checkingForDrawPromise=this.checkForDraw(e),n.next=5,this.checkingForDrawPromise;case 5:if(i=n.sent,this.checkingForDrawPromise=null,!i){n.next=8;break}return n.abrupt("return");case 8:this.currentRenderService=t,r=e.context,o=e.x,a=void 0===o?0:o,s=e.y,l=void 0===s?0:s,r&&(r.inuse=!0,r.clearMatrix(),r.setTransformForCurrent(!0),r.save(),e.restartIncremental&&this.clearScreen(this.currentRenderService,r,e),r.translate(a,l,!0),r.save(),t.renderTreeRoots.sort((function(t,e){var n,i;return(null!==(n=t.attribute.zIndex)&&void 0!==n?n:Da.zIndex)-(null!==(i=e.attribute.zIndex)&&void 0!==i?i:Da.zIndex)})).forEach((function(t){h.renderGroup(t,e)})),this.hooks.completeDraw.tap("top-draw",(function(){r.restore(),r.restore(),r.draw(),r.inuse=!1,h.rendering=!1})));case 11:case"end":return n.stop()}}),n,this)})))}},{key:"_increaseRender",value:function(t,e){return Gb(this,void 0,void 0,ol.mark((function n(){return ol.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return this.rendering=!0,n.next=3,this._renderIncrementalGroup(t,e);case 3:case"end":return n.stop()}}),n,this)})))}},{key:"_renderIncrementalGroup",value:function(t,e){return Gb(this,void 0,void 0,ol.mark((function n(){var i=this;return ol.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return this.count=t.count,n.next=3,new Promise((function(n){i.renderItem(t,e,{drawingCb:function(){return Gb(i,void 0,void 0,ol.mark((function i(){var r,o=this;return ol.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:if(2===t.count){i.next=6;break}return i.next=3,Jg(t,Da.zIndex,(function(n,i){if(o.status===Fb.STOP)return!0;if(n.isContainer)return!1;if(i<o.currentIdx)return!1;var r=o.currFrameStartAt+t.incremental;return i<r&&(o.currentIdx=i+1,o.renderItem(n,e)),i===r-1&&(o.currFrameStartAt=o.currentIdx,o.waitToNextFrame())}));case 3:n(!1),i.next=21;break;case 6:if(!(r=t.getChildAt(0)).incremental||!r.attribute.segments){i.next=19;break}r.incrementalAt||(r.incrementalAt=0);case 9:if(!(r.incrementalAt<r.attribute.segments.length)){i.next=17;break}return e.multiGraphicOptions={startAtIdx:r.incrementalAt,length:r.incremental},this.renderItem(r,e),r.incrementalAt+=r.incremental,i.next=15,this.waitToNextFrame();case 15:i.next=9;break;case 17:i.next=20;break;case 19:this.renderItem(r,e);case 20:n(!1);case 21:case"end":return i.stop()}}),i,this)})))}})}));case 3:this.hooks.completeDraw.call();case 4:case"end":return n.stop()}}),n,this)})))}},{key:"waitToNextFrame",value:function(){return Gb(this,void 0,void 0,ol.mark((function t(){var e=this;return ol.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise((function(t){e.global.getRequestAnimationFrame()((function(){t(!1)}))})));case 1:case"end":return t.stop()}}),t)})))}},{key:"checkForDraw",value:function(t){return Gb(this,void 0,void 0,ol.mark((function e(){var n;return ol.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=this.rendering,e.t0=t.restartIncremental,!e.t0){e.next=7;break}return n=!1,e.next=6,this.forceStop();case 6:this.resetToInit();case 7:return e.abrupt("return",n);case 8:case"end":return e.stop()}}),e,this)})))}},{key:"forceStop",value:function(){return Gb(this,void 0,void 0,ol.mark((function t(){var e=this;return ol.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(t.t0=this.rendering,!t.t0){t.next=5;break}return this.status=Fb.STOP,t.next=5,new Promise((function(t){e.hooks.completeDraw.tap("stopCb",(function(){e.status=Fb.NORMAL,e.hooks.completeDraw.taps=e.hooks.completeDraw.taps.filter((function(t){return"stopCb"!==t.name})),t(!1)}))}));case 5:case"end":return t.stop()}}),t,this)})))}},{key:"resetToInit",value:function(){this.currFrameStartAt=0,this.currentIdx=0}},{key:"renderGroup",value:function(t,e){return Gb(this,void 0,void 0,ol.mark((function n(){var i=this;return ol.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(e.break||!1===t.attribute.visibleAll){n.next=11;break}if(!t.incremental||e.startAtId!==t._uid){n.next=7;break}return n.next=4,this._increaseRender(t,e);case 4:n.t0=void(e.break=!0),n.next=10;break;case 7:return n.next=9,new Promise((function(n){i.renderItem(t,e,{drawingCb:function(){return Gb(i,void 0,void 0,ol.mark((function i(){var r=this;return ol.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return i.next=2,Jg(t,Da.zIndex,(function(t){return Gb(r,void 0,void 0,ol.mark((function n(){return ol.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(n.t0=e.break,n.t0){n.next=6;break}if(n.t1=t.isContainer,!n.t1){n.next=6;break}return n.next=6,this.renderGroup(t,e);case 6:case"end":return n.stop()}}),n,this)})))}));case 2:n(!1);case 3:case"end":return i.stop()}}),i)})))}})}));case 9:n.t0=void n.sent;case 10:return n.abrupt("return",n.t0);case 11:case"end":return n.stop()}}),n,this)})))}}]),n}(kb);function Kb(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=re(t);if(e){var r=re(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return ie(this,n)}}zb([tr(Ke),jb("design:type",Object)],Ub.prototype,"global",void 0),Ub=zb([Zi(),Nb(0,er(Tg)),Nb(1,tr(Ng)),Nb(2,tr(Ob)),Nb(3,tr(Db)),Nb(4,tr(ru)),Nb(5,tr(lr)),Nb(5,Ji(mb)),jb("design:paramtypes",[Array,Object,Object,Object,Object,Object])],Ub);var Vb=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},Yb=function(t){ee(n,t);var e=Kb(n);function n(){var t;return Qt(this,n),(t=e.apply(this,arguments)).type="rect3d",t.numberType=Lh,t}return Jt(n,[{key:"drawShape",value:function(t,e,n,i,r,o,a,s){var l,h=Js(t,null==o?void 0:o.theme).rect3d,u=t.attribute,c=u.fill,d=void 0===c?h.fill:c,f=u.stroke,p=void 0===f?h.stroke:f,g=u.width,v=void 0===g?h.width:g,y=u.height,m=void 0===y?h.height:y,b=u.opacity,w=void 0===b?h.opacity:b,C=u.fillOpacity,x=void 0===C?h.fillOpacity:C,_=u.lineWidth,S=void 0===_?h.lineWidth:_,k=u.strokeOpacity,A=void 0===k?h.strokeOpacity:k,R=u.visible,B=void 0===R?h.visible:R,T=null!==(l=this.z)&&void 0!==l?l:0,M=hu(w,x,v,m),P=cu(w,A,v,m),E=au(d),H=su(p,S);if(t.valid&&B&&(E||H)&&(M||P||a||s)){var O=r.stage||{},L=O.light;O.camera;var I=t.findFace();if(!1!==d){e.setCommonStyle(t,t.attribute,n,i,h);var D=d;"string"!=typeof D&&(D="black"),this.fill(n,i,T,I,D,e,L,a)}!1!==p&&(e.setStrokeStyle(t,t.attribute,n,i,h),this.stroke(n,i,T,I,e))}}},{key:"stroke",value:function(t,e,n,i,r){var o=i.vertices;i.edges.forEach((function(i){var a=o[i[0]],s={x:t+a[0],y:e+a[1],z:n+a[2]},l=o[i[1]],h={x:t+l[0],y:e+l[1],z:n+l[2]};r.beginPath(),r.moveTo(s.x,s.y,s.z),r.lineTo(h.x,h.y,h.z),r.stroke()}))}},{key:"fill",value:function(t,e,n,i,r,o,a,s){var l=ih.get(r).value,h=i.vertices,u=h.map((function(t){return o.view(t[0],t[1],t[2])[2]})),c=[];i.polygons.forEach((function(t,e){c.push({faceIdx:e,polygon:t});var n=t.polygon;t.normal;var i=u[n[0]],r=u[n[1]],o=u[n[2]],a=u[n[3]];t.ave_z=i+r+o+a})),c.sort((function(t,e){return e.polygon.ave_z-t.polygon.ave_z})),c.forEach((function(i){var u=i.polygon,c=u.polygon,d=u.normal,f=h[c[0]],p=h[c[1]],g=h[c[2]],v=h[c[3]],y={x:t+f[0],y:e+f[1],z:n+f[2]},m={x:t+p[0],y:e+p[1],z:n+p[2]},b={x:t+g[0],y:e+g[1],z:n+g[2]},w={x:t+v[0],y:e+v[1],z:n+v[2]};o.beginPath(),o.moveTo(y.x,y.y,y.z),o.lineTo(m.x,m.y,m.z),o.lineTo(b.x,b.y,b.z),o.lineTo(w.x,w.y,w.z),o.closePath(),s?s(o,null,null):(o.fillStyle=a?a.computeColor(d,l):r,o.fill())}))}},{key:"draw",value:function(t,e,n){var i=n.context;if(i){i.highPerformanceSave();var r=Js(t).rect,o=this.transform(t,r,i),a=o.x,s=o.y,l=o.z,h=o.lastModelMatrix;this.z=l,this.drawShape(t,i,a,s,n),this.z=0,i.modelMatrix!==h&&Jd.free(i.modelMatrix),i.modelMatrix=h,i.highPerformanceRestore()}}}]),n}(Zf);Yb=Vb([Zi()],Yb);var Xb=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},$b=function(){function t(){Qt(this,t),this.numberType=Ih}return Jt(t,[{key:"drawShape",value:function(t,e,n,i,r){var o=Js(t).richtext,a=t.attribute,s=a.width;void 0===s&&o.width;var l=a.height;void 0===l&&o.height;var h=a.opacity,u=void 0===h?o.opacity:h,c=a.fillOpacity,d=void 0===c?o.fillOpacity:c,f=a.visible,p=void 0===f?o.visible:f;t.valid&&p&&lu(u,d)&&(e.translate(n,i),t.getFrameCache().draw(e,this.drawIcon))}},{key:"drawIcon",value:function(t,e,n,i,r){var o,a=Js(t).richtextIcon,s=t.attribute,l=s.width,h=void 0===l?a.width:l,u=s.height,c=void 0===u?a.height:u,d=s.opacity,f=void 0===d?a.opacity:d,p=s.image,g=s.backgroundFill,v=void 0===g?a.backgroundFill:g,y=s.backgroundFillOpacity,m=void 0===y?a.backgroundFillOpacity:y,b=s.backgroundStroke,w=void 0===b?a.backgroundStroke:b,C=s.backgroundStrokeOpacity,x=void 0===C?a.backgroundStrokeOpacity:C,_=s.backgroundRadius,S=void 0===_?a.backgroundRadius:_,k=s.margin,A=t.attribute,R=A.backgroundWidth,B=void 0===R?h:R,T=A.backgroundHeight,M=void 0===T?c:T;if(k&&(n+=t._marginArray[3],i+=t._marginArray[0]),t._hovered){var P=(B-h)/2,E=(M-c)/2;0===S?(e.beginPath(),e.rect(n-P,i-E,B,M)):(e.beginPath(),vp(e,n-P,i-E,B,M,S)),v&&(e.globalAlpha=m,e.fillStyle=v,e.fill()),w&&(e.globalAlpha=x,e.strokeStyle=w,e.stroke())}var H=p&&(null===(o=null==t?void 0:t.resources)||void 0===o?void 0:o.get(p));H&&"success"===H.state&&(e.globalAlpha=f,e.drawImage(H.data,n,i,h,c))}},{key:"draw",value:function(t,e,n){var i=n.context;if(i){i.highPerformanceSave();var r=Js(t).richtext,o=t.attribute,a=o.x,s=void 0===a?r.x:a,l=o.y,h=void 0===l?r.y:l;if(t.transMatrix.onlyTranslate()){var u=t.getOffsetXY(r);s+=u.x,h+=u.y,i.setTransformForCurrent()}else s=0,h=0,i.transformFromMatrix(t.transMatrix,!0);this.drawShape(t,i,s,h,n),i.highPerformanceRestore()}}}]),t}();$b=Xb([Zi()],$b);var qb=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},Zb=function(){function t(){Qt(this,t),this.numberType=Rh}return Jt(t,[{key:"drawShape",value:function(t,e,n,i,r,o,a,s){r.drawContribution&&t.getSubGraphic().forEach((function(t){var l=r.drawContribution.getRenderContribution(t);l&&l.drawShape&&l.drawShape(t,e,n,i,r,o,a,s)}))}},{key:"draw",value:function(t,e,n,i){var r=n.context;if(r&&(r.highPerformanceSave(),n.drawContribution)){var o=Js(t),a=t.getSubGraphic();a.length&&a.forEach((function(t){n.drawContribution.renderItem(t,n,{theme:o})})),r.highPerformanceRestore()}}}]),t}();function Jb(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=re(t);if(e){var r=re(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return ie(this,n)}}Zb=qb([Zi()],Zb);var Qb=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a};var tw=function(t){ee(n,t);var e=Jb(n);function n(){var t;return Qt(this,n),(t=e.apply(this,arguments)).numberType=Sh,t}return Jt(n,[{key:"drawShape",value:function(t,e,n,i,r,o,a,s){var l,h=Js(t,null==o?void 0:o.theme).arc,u=t.attribute,c=u.fill,d=void 0===c?h.fill:c,f=u.background,p=u.stroke,g=void 0===p?h.stroke:p,v=u.opacity,y=void 0===v?h.opacity:v,m=u.fillOpacity,b=void 0===m?h.fillOpacity:m,w=u.lineWidth,C=void 0===w?h.lineWidth:w,x=u.strokeOpacity,_=void 0===x?h.strokeOpacity:x,S=u.visible,k=void 0===S?h.visible:S,A=lu(y,b),R=uu(y,_),B=au(d),T=su(g,C),M=null!==(l=this.z)&&void 0!==l?l:0;if(t.valid&&k&&(B||T||f)&&(A||R||a||s||f)){var P=t.attribute,E=P.outerRadius,H=void 0===E?h.outerRadius:E,O=P.innerRadius,L=void 0===O?h.innerRadius:O,I=P.height,D=void 0===I?10:I,W=ih.get(d).value,F=(r.stage||{}).light,z=r.hack_pieFace,j={top:M,bottom:M+D},N={top:[0,1,0],bottom:[0,-1,0],outside:[1,0,-1],inside:[1,0,-1]};"bottom"===z||"top"===z?(e.beginPath(),function(t,e,n,i,r,o,a){var s=t.getParsedAngle(),l=s.startAngle,h=s.endAngle,u=Ur(h-l),c=h>l,d=!1;if(o<a){var f=o;o=a,a=f}if(o<=Fr)e.moveTo(n,i,r);else if(u>=Gr-Fr)e.moveTo(n+o*Vr(l),i+o*$r(l),r),e.arc(n,i,o,l,h,!c,r),a>Fr&&(e.moveTo(n+a*Vr(h),i+a*$r(h),r),e.arc(n,i,a,h,l,c,r));else{var p=t.getParsePadAngle(l,h),g=p.outerDeltaAngle,v=p.innerDeltaAngle,y=p.outerStartAngle,m=p.outerEndAngle,b=p.innerEndAngle,w=p.innerStartAngle,C=o*Vr(y),x=o*$r(y),_=a*Vr(b),S=a*$r(b);g<.001?d=!0:(e.moveTo(n+C,i+x,r),e.arc(n,i,o,y,m,!c,r)),!(a>Fr)||v<.001?(e.lineTo(n+_,i+S,r),d=!0):(e.lineTo(n+_,i+S,r),e.arc(n,i,a,b,w,c,r))}e.closePath()}(t,e,n,i,j[z],H,L),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,h),B&&(a?a(e,t.attribute,h):A&&(e.setCommonStyle(t,t.attribute,n,i,h),e.fillStyle=F?F.computeColor(N[z],W):d,e.fill())),T&&(s?s(e,t.attribute,h):R&&(e.setStrokeStyle(t,t.attribute,n,i,h),e.stroke()))):"outside"!==z&&"inside"!==z||("inside"===z&&(e.save(),e.beginPath(),e.arc(n,i,L,0,Gr,!0,j.top),e.clip()),e.beginPath(),function(t,e,n,i,r,o,a,s){var l=t.getParsedAngle(),h=l.startAngle,u=l.endAngle,c=Ur(u-h),d=u>h,f=!1;if(a<=Fr)e.moveTo(n,i,r);else if(c>=Gr-Fr)e.moveTo(n+a*Vr(h),i+a*$r(h),r),e.arc(n,i,a,h,u,!d,r),e.lineTo(n+a*Vr(u),i+a*$r(u),o),e.arc(n,i,a,u,h,d,o);else{var p=s(h,u),g=p.innerouterDeltaAngle,v=p.innerouterStartAngle,y=p.innerouterEndAngle,m=a*Vr(v),b=a*$r(v),w=a*Vr(y),C=a*$r(y);g<.001?f=!0:(e.moveTo(n+m,i+b,r),e.arc(n,i,a,v,y,!d,r),e.lineTo(n+w,i+C,o),e.arc(n,i,a,y,v,d,o))}e.closePath()}(t,e,n,i,j.top,j.bottom,"outside"===z?H:L,(function(e,n){var i=t.getParsePadAngle(e,n),r=i.outerDeltaAngle,o=i.innerDeltaAngle,a=i.outerStartAngle,s=i.outerEndAngle,l=i.innerEndAngle,h=i.innerStartAngle;return"outside"===z?{innerouterDeltaAngle:r,innerouterEndAngle:s,innerouterStartAngle:a}:{innerouterDeltaAngle:o,innerouterEndAngle:l,innerouterStartAngle:h}})),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,h),B&&(a?a(e,t.attribute,h):A&&(e.setCommonStyle(t,t.attribute,n,i,h),e.fillStyle=F?F.computeColor(N[z],W):d,e.fill())),T&&(s?s(e,t.attribute,h):R&&(e.setStrokeStyle(t,t.attribute,n,i,h),e.stroke())),"inside"===z&&e.restore())}}},{key:"draw",value:function(t,e,n,i){var r=n.context;if(r){var o=Js(t,null==i?void 0:i.theme).arc;r.save();var a=this.transform(t,o,r),s=a.x,l=a.y,h=a.z,u=a.lastModelMatrix;this.z=h,du(t,r,s,l,0,i)||(this.drawShape(t,r,s,l,n,i),this.z=0,r.modelMatrix!==u&&Jd.free(r.modelMatrix),r.modelMatrix=u),r.restore()}}}]),n}(Zf);function ew(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=re(t);if(e){var r=re(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return ie(this,n)}}tw=Qb([Zi()],tw);var nw=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},iw=function(t){ee(n,t);var e=ew(n);function n(){var t;return Qt(this,n),(t=e.apply(this,arguments)).type="pyramid3d",t.numberType=Hh,t}return Jt(n,[{key:"drawShape",value:function(t,e,n,i,r,o,a,s){var l,h=Js(t,null==o?void 0:o.theme).polygon,u=t.attribute,c=u.fill,d=void 0===c?h.fill:c,f=u.stroke,p=void 0===f?h.stroke:f,g=u.opacity,v=void 0===g?h.opacity:g,y=u.fillOpacity,m=void 0===y?h.fillOpacity:y,b=u.lineWidth,w=void 0===b?h.lineWidth:b,C=u.strokeOpacity,x=void 0===C?h.strokeOpacity:C,_=u.visible,S=void 0===_?h.visible:_,k=u.points,A=u.face,R=void 0===A?[!0,!0,!0,!0,!0,!0]:A,B=null!==(l=this.z)&&void 0!==l?l:0,T=lu(v,m),M=uu(v,x),P=au(d),E=su(p,w);if(t.valid&&S&&4===k.length&&(P||E)&&(T||M||a||s)){var H=r.stage||{},O=H.light,L=H.camera,I=t.findFace();if(!1!==d){e.setCommonStyle(t,t.attribute,n,i,h);var D=d;"string"!=typeof D&&(D="black"),this.fill(n,i,B,I,R,D,e,O,L,t,h,a)}!1!==p&&(e.setStrokeStyle(t,t.attribute,n,i,h),this.stroke(n,i,B,I,e))}}},{key:"stroke",value:function(t,e,n,i,r){var o=i.vertices;i.edges.forEach((function(i){var a=o[i[0]],s=o[i[1]],l={x:t+a[0],y:e+a[1],z:n+a[2]},h={x:t+s[0],y:e+s[1],z:n+s[2]};r.beginPath(),r.moveTo(l.x,l.y,l.z),r.lineTo(h.x,h.y,h.z),r.stroke()}))}},{key:"fill",value:function(t,e,n,i,r,o,a,s,l,h,u,c){var d=ih.get(o).value,f=i.vertices,p=f.map((function(t){return a.view(t[0],t[1],t[2])[2]})),g=[];i.polygons.forEach((function(t,e){if(r[e]){g.push({faceIdx:e,polygon:t});var n=t.polygon;t.normal;var i=p[n[0]],o=p[n[1]],a=p[n[2]],s=p[n[3]];t.ave_z=i+o+a+s}})),g.sort((function(t,e){return e.polygon.ave_z-t.polygon.ave_z})),g.forEach((function(i){var r=i.polygon,l=r.polygon,p=r.normal,g=f[l[0]],v=f[l[1]],y=f[l[2]],m=f[l[3]],b={x:t+g[0],y:e+g[1],z:n+g[2]},w={x:t+v[0],y:e+v[1],z:n+v[2]},C={x:t+y[0],y:e+y[1],z:n+y[2]},x={x:t+m[0],y:e+m[1],z:n+m[2]};a.beginPath(),a.moveTo(b.x,b.y,b.z),a.lineTo(w.x,w.y,w.z),a.lineTo(C.x,C.y,C.z),a.lineTo(x.x,x.y,x.z),a.closePath(),c?c(a,h.attribute,u):(a.fillStyle=s?s.computeColor(p,d):o,a.fill())}))}},{key:"draw",value:function(t,e,n){var i=n.context;if(i){i.highPerformanceSave();var r=Js(t).polygon,o=this.transform(t,r,i),a=o.x,s=o.y,l=o.z,h=o.lastModelMatrix;this.z=l,this.drawShape(t,i,a,s,n),this.z=0,i.modelMatrix!==h&&Jd.free(i.modelMatrix),i.modelMatrix=h,i.highPerformanceRestore()}}}]),n}(Zf);iw=nw([Zi()],iw);var rw=new Vi((function(t){t(kb).toSelf(),t(Gg).toService(kb),t(Ub).toSelf(),t(Sg).toService(Ub),t(Rb).toSelf(),t(Ng).toService(Rb),t($f).toSelf().inSingletonScope(),t(Bg).to($f),t(Tg).to($f),t(Gf).toSelf().inSingletonScope(),t(Uf).toSelf().inSingletonScope(),t(Kf).toSelf().inSingletonScope(),t(Nf).toService(Gf),t(Nf).toService(Uf),t(Nf).toService(Kf),ur(t,Nf),t(Zp).toSelf().inSingletonScope(),t(Og).to(Zp),t(Tg).to(Zp),t(Yb).toSelf().inSingletonScope(),t(Lg).toService(Yb),t(Tg).toService(Lg),t(wp).toSelf().inSingletonScope(),t(Cp).toSelf().inSingletonScope(),t(xp).toSelf().inSingletonScope(),t(_p).toSelf().inSingletonScope(),t(Sp).toSelf().inSingletonScope(),t(bp).toService(wp),t(bp).toService(Cp),t(bp).toService(xp),t(bp).toService(_p),t(bp).toService(Sp),ur(t,bp),t(og).toSelf().inSingletonScope(),t(Dg).to(og),t(Tg).to(og),t(Yp).toSelf().inSingletonScope(),t(Eg).to(Yp),t(Tg).to(Yp),t(jp).toSelf().inSingletonScope(),t(Np).toSelf().inSingletonScope(),t(zp).toService(jp),t(zp).toService(Np),ur(t,zp),t(ng).toSelf().inSingletonScope(),t(Ig).to(ng),t(Tg).to(ng),t(Bp).toSelf().inSingletonScope(),t(Tp).toSelf().inSingletonScope(),t(Mp).toSelf().inSingletonScope(),t(Rp).toService(Bp),t(Rp).toService(Tp),t(Rp).toService(Mp),ur(t,Rp),t(Ff).toSelf().inSingletonScope(),t(kg).to(Ff),t(Tg).to(Ff),t(tw).toSelf().inSingletonScope(),t(Ag).toService(tw),t(Tg).toService(Ag),t(Hf).toSelf().inSingletonScope(),t(Of).toSelf().inSingletonScope(),t(Lf).toSelf().inSingletonScope(),t(Ef).toService(Hf),t(Ef).toService(Of),t(Ef).toService(Lf),ur(t,Ef),t(ep).toSelf().inSingletonScope(),t(Pg).to(ep),t(Tg).to(ep),t(Ob).toSelf().inSingletonScope(),t(Db).toSelf().inSingletonScope(),t(Dp).toSelf().inSingletonScope(),t(Rg).to(Dp),t(Tg).to(Dp),t(op).toSelf().inSingletonScope(),t(ap).toSelf().inSingletonScope(),t(rp).toService(op),t(rp).toService(ap),ur(t,rp),t(Pb).toSelf().inSingletonScope(),t(Mg).to(Pb),t(Tg).to(Pb),t(up).toSelf().inSingletonScope(),t(hp).toService(up),ur(t,hp),t(bg).toSelf().inSingletonScope(),t(Hg).to(bg),t(Tg).to(bg),t(pg).toSelf().inSingletonScope(),t(gg).toSelf().inSingletonScope(),t(fg).toService(pg),t(fg).toService(gg),ur(t,fg),t(Zb).toSelf().inSingletonScope(),t(zg).toService(Zb),t(Tg).toService(zg),t(_g).toSelf().inSingletonScope(),t(jg).toService(_g),t(Tg).toService(jg),t(pp).toSelf().inSingletonScope(),t(fp).toService(pp),ur(t,fp),t($b).toSelf().inSingletonScope(),t(Wg).toService($b),t(Tg).toService(Wg),t(iw).toSelf().inSingletonScope(),t(Fg).toService(iw),t(Tg).toService(Fg),ur(t,Tg),t(wb).toSelf().inSingletonScope(),t(mb).toService(wb),t(Cb).toSelf().inSingletonScope(),t(mb).toService(Cb),ur(t,mb)}));var ow=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},aw=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},sw=function(t,e){return function(n,i){e(n,i,t)}},lw=function(){function t(e){Qt(this,t),this.canvasRenderer=e,this.type="circle",this.numberType=Ah}return Jt(t,[{key:"contains",value:function(t,e,n){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;var i=(null!=n?n:{}).pickContext;if(!i)return!1;var r=Js(t).circle,o=t.attribute,a=o.x,s=void 0===a?r.x:a,l=o.y,h=void 0===l?r.y:l;if(i.highPerformanceSave(),t.transMatrix.onlyTranslate()){var u=t.getOffsetXY(r);s+=u.x,h+=u.y,i.setTransformForCurrent()}else s=0,h=0,i.transformFromMatrix(t.transMatrix,!0);var c=!1;return this.canvasRenderer.drawShape(t,i,s,h,{},null,(function(t,n,i){return!!c||(c=t.isPointInPath(e.x,e.y))}),(function(t,n,r){if(c)return!0;var o=n.lineWidth||r.lineWidth;return i.lineWidth=bu(i,o,i.dpr),c=t.isPointInStroke(e.x,e.y)})),i.highPerformanceRestore(),c}}]),t}();lw=ow([Zi(),sw(0,tr(Bg)),aw("design:paramtypes",[Object])],lw);var hw=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},uw=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},cw=function(t,e){return function(n,i){e(n,i,t)}},dw=new ao,fw=function(){function t(e){Qt(this,t),this.canvasRenderer=e,this.type="rect",this.numberType=Oh}return Jt(t,[{key:"contains",value:function(t,e,n){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;var i=(null!=n?n:{}).pickContext;if(!i)return!1;var r=Js(t).rect,o=t.attribute.cornerRadius,a=void 0===o?r.cornerRadius:o,s=t.attribute,l=s.x,h=void 0===l?r.x:l,u=s.y,c=void 0===u?r.y:u;i.highPerformanceSave();var d=!0;if(t.transMatrix.onlyTranslate()){var f=t.getOffsetXY(r);h+=f.x,c+=f.y,i.setTransformForCurrent()}else h=0,c=0,d=!1,i.transformFromMatrix(t.transMatrix,!0);var p=!0;if(!d||Ar(a,!0)&&0!==a||Sr(a)&&a.some((function(t){return 0!==t})))p=!1,this.canvasRenderer.drawShape(t,i,h,c,{},null,(function(t,n,i){return!!p||(p=t.isPointInPath(e.x,e.y))}),(function(t,n,r){if(p)return!0;var o=n.lineWidth||r.lineWidth;return i.lineWidth=bu(i,o,i.dpr),p=t.isPointInStroke(e.x,e.y)}));else if(p){var g=t.attribute,v=g.fill,y=void 0===v?r.fill:v,m=g.stroke,b=void 0===m?r.stroke:m,w=g.lineWidth,C=void 0===w?r.lineWidth:w;if(y)p=!0;else if(b){var x=t.AABBBounds;dw.setValue(x.x1,x.y1,x.x2,x.y2),dw.expand(-C/2),p=!dw.containsPoint(e)}}return i.highPerformanceRestore(),p}}]),t}();fw=hw([Zi(),cw(0,tr(Og)),uw("design:paramtypes",[Object])],fw);var pw=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},gw=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},vw=function(t,e){return function(n,i){e(n,i,t)}},yw=function(){function t(e){Qt(this,t),this.canvasRenderer=e,this.type="arc",this.numberType=_h}return Jt(t,[{key:"contains",value:function(t,e,n){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;var i=(null!=n?n:{}).pickContext;if(!i)return!1;var r=Js(t).arc;i.highPerformanceSave();var o=t.attribute,a=o.x,s=void 0===a?r.x:a,l=o.y,h=void 0===l?r.y:l;if(t.transMatrix.onlyTranslate()){var u=t.getOffsetXY(r);s+=u.x,h+=u.y,i.setTransformForCurrent()}else s=0,h=0,i.transformFromMatrix(t.transMatrix,!0);var c=!1;return this.canvasRenderer.drawShape(t,i,s,h,{},null,(function(t,n,i){return!!c||(c=t.isPointInPath(e.x,e.y))}),(function(t,n,r){if(c)return!0;var o=n.lineWidth||r.lineWidth;return i.lineWidth=bu(i,o,i.dpr),c=t.isPointInStroke(e.x,e.y)})),i.highPerformanceRestore(),c}}]),t}();yw=pw([Zi(),vw(0,tr(kg)),gw("design:paramtypes",[Object])],yw);var mw=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},bw=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},ww=function(t,e){return function(n,i){e(n,i,t)}},Cw=function(){function t(e){Qt(this,t),this.canvasRenderer=e,this.type="area",this.numberType=kh}return Jt(t,[{key:"contains",value:function(t,e,n){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;var i=(null!=n?n:{}).pickContext;if(!i)return!1;var r=Js(t).area,o=t.attribute,a=o.x,s=void 0===a?r.x:a,l=o.y,h=void 0===l?r.y:l;if(i.highPerformanceSave(),t.transMatrix.onlyTranslate()){var u=t.getOffsetXY(r);s+=u.x,h+=u.y,i.setTransformForCurrent()}else s=0,h=0,i.transformFromMatrix(t.transMatrix,!0);var c=!1;return this.canvasRenderer.drawShape(t,i,s,h,{},null,(function(t){return!!c||(c=t.isPointInPath(e.x,e.y))})),i.highPerformanceRestore(),c}}]),t}();Cw=mw([Zi(),ww(0,tr(Rg)),bw("design:paramtypes",[Object])],Cw);var xw=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},_w=function(){function t(){Qt(this,t),this.type="image",this.numberType=Th}return Jt(t,[{key:"contains",value:function(t,e,n){return!!(null!=n?n:{}).pickContext&&!!t.AABBBounds.containsPoint(e)}}]),t}();function Sw(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=re(t);if(e){var r=re(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return ie(this,n)}}_w=xw([Zi()],_w);var kw=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},Aw=function(t){ee(n,t);var e=Sw(n);function n(){return Qt(this,n),e.apply(this,arguments)}return Jt(n)}(Zf);function Rw(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=re(t);if(e){var r=re(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return ie(this,n)}}var Bw=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},Tw=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Mw=function(t,e){return function(n,i){e(n,i,t)}},Pw=function(t){ee(n,t);var e=Rw(n);function n(t){var i;return Qt(this,n),(i=e.call(this)).canvasRenderer=t,i.type="line",i.numberType=Mh,i}return Jt(n,[{key:"contains",value:function(t,e,n){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;var i=(null!=n?n:{}).pickContext;if(!i)return!1;i.highPerformanceSave();var r=Js(t).line,o=this.transform(t,r,i),a=o.x,s=o.y,l=o.z,h=o.lastModelMatrix,u=e;if(i.camera){u=e.clone();var c=t.parent.globalTransMatrix;u.x=c.a*e.x+c.c*e.y+c.e,u.y=c.b*e.x+c.d*e.y+c.f}this.canvasRenderer.z=l;var d=!1;return this.canvasRenderer.drawShape(t,i,a,s,{},null,(function(t){return!!d||(d=t.isPointInPath(u.x,u.y))}),(function(t,e,n){if(d)return!0;var r=e.lineWidth||n.lineWidth;return i.lineWidth=bu(i,r,i.dpr),d=t.isPointInStroke(u.x,u.y)})),this.canvasRenderer.z=0,i.modelMatrix!==h&&Jd.free(i.modelMatrix),i.modelMatrix=h,i.highPerformanceRestore(),d}}]),n}(Aw=kw([Zi()],Aw));function Ew(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=re(t);if(e){var r=re(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return ie(this,n)}}Pw=Bw([Zi(),Mw(0,tr(Pg)),Tw("design:paramtypes",[Object])],Pw);var Hw=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},Ow=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Lw=function(t,e){return function(n,i){e(n,i,t)}},Iw=function(t){ee(n,t);var e=Ew(n);function n(t){var i;return Qt(this,n),(i=e.call(this)).canvasRenderer=t,i.type="path",i.numberType=Ph,i}return Jt(n,[{key:"contains",value:function(t,e,n){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;var i=(null!=n?n:{}).pickContext;if(!i)return!1;var r=Js(t).path,o=this.transform(t,r,i),a=o.x,s=o.y,l=o.z,h=o.lastModelMatrix,u=e;if(i.camera){u=e.clone();var c=t.parent.globalTransMatrix;u.x=c.a*e.x+c.c*e.y+c.e,u.y=c.b*e.x+c.d*e.y+c.f}this.canvasRenderer.z=l;var d=!1;return this.canvasRenderer.drawShape(t,i,a,s,{},null,(function(t,e,n){return!!d||(d=t.isPointInPath(u.x,u.y))}),(function(t,e,n){if(d)return!0;var r=e.lineWidth||n.lineWidth;return i.lineWidth=bu(i,r,i.dpr),d=t.isPointInStroke(u.x,u.y)})),this.canvasRenderer.z=0,i.modelMatrix!==h&&Jd.free(i.modelMatrix),i.modelMatrix=h,i.highPerformanceRestore(),d}}]),n}(Aw);function Dw(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=re(t);if(e){var r=re(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return ie(this,n)}}Iw=Hw([Zi(),Lw(0,tr(Eg)),Ow("design:paramtypes",[Object])],Iw);var Ww=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},Fw=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},zw=function(t,e){return function(n,i){e(n,i,t)}},jw=function(t){ee(n,t);var e=Dw(n);function n(t){var i;return Qt(this,n),(i=e.call(this)).canvasRenderer=t,i.type="symbol",i.numberType=Dh,i}return Jt(n,[{key:"contains",value:function(t,e,n){var i=(null!=n?n:{}).pickContext;if(!i)return!1;if(!i.camera){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0}i.highPerformanceSave();var r=Js(t).symbol,o=this.transform(t,r,i),a=o.x,s=o.y,l=o.z,h=o.lastModelMatrix,u=e;if(i.camera){u=e.clone();var c=t.parent.globalTransMatrix;u.x=c.a*e.x+c.c*e.y+c.e,u.y=c.b*e.x+c.d*e.y+c.f}this.canvasRenderer.z=l;var d=!1;return this.canvasRenderer.drawShape(t,i,a,s,{},null,(function(t,e,n){return!!d||(d=t.isPointInPath(u.x,u.y))}),(function(t,e,n){if(d)return!0;var r=e.lineWidth||n.lineWidth;return i.lineWidth=bu(i,r,i.dpr),d=t.isPointInStroke(u.x,u.y)})),this.canvasRenderer.z=0,i.modelMatrix!==h&&Jd.free(i.modelMatrix),i.modelMatrix=h,i.highPerformanceRestore(),d}}]),n}(Aw);function Nw(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=re(t);if(e){var r=re(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return ie(this,n)}}jw=Ww([Zi(),zw(0,tr(Ig)),Fw("design:paramtypes",[Object])],jw);var Gw=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},Uw=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Kw=function(t,e){return function(n,i){e(n,i,t)}},Vw=function(t){ee(n,t);var e=Nw(n);function n(t){var i;return Qt(this,n),(i=e.call(this)).canvasRenderer=t,i.type="text",i.numberType=Wh,i}return Jt(n,[{key:"contains",value:function(t,e,n){var i=(null!=n?n:{}).pickContext;if(!i)return!1;var r=t.AABBBounds;if(!i.camera)return!!r.containsPoint(e);i.highPerformanceSave();var o=Js(t).text,a=t.attribute.keepDirIn3d,s=!(void 0===a?o.keepDirIn3d:a),l=this.transform(t,o,i,s),h=l.x,u=l.y,c=l.z,d=l.lastModelMatrix;this.canvasRenderer.z=c;var f=e;if(i.camera){f=e.clone();var p=t.parent.globalTransMatrix;f.x=p.a*e.x+p.c*e.y+p.e,f.y=p.b*e.x+p.d*e.y+p.f}var g=!1;return this.canvasRenderer.drawShape(t,i,h,u,{},null,(function(e,n,i){if(g)return!0;var r=t.attribute,a=r.fontSize,s=void 0===a?o.fontSize:a,l=r.textBaseline,d=void 0===l?o.textBaseline:l,p=r.textAlign,v=void 0===p?o.textAlign:p,y=t.AABBBounds,m=y.height(),b=y.width(),w=Au(d,m,s),C=ku(v,b);return e.rect(C+h,w+u,b,m,c),g=e.isPointInPath(f.x,f.y)}),(function(t,e,n){return g})),this.canvasRenderer.z=0,i.modelMatrix!==d&&Jd.free(i.modelMatrix),i.modelMatrix=d,i.highPerformanceRestore(),g}}]),n}(Aw);Vw=Gw([Zi(),Kw(0,tr(Dg)),Uw("design:paramtypes",[Object])],Vw);var Yw=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},Xw=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},$w=function(t,e){return function(n,i){e(n,i,t)}},qw=function(){function t(e){Qt(this,t),this.canvasRenderer=e,this.type="polygon",this.numberType=Eh}return Jt(t,[{key:"contains",value:function(t,e,n){if(!t.AABBBounds.contains(e.x,e.y))return!1;var i=(null!=n?n:{}).pickContext;if(!i)return!1;var r=Js(t).polygon,o=t.attribute,a=o.x,s=void 0===a?r.x:a,l=o.y,h=void 0===l?r.y:l;if(i.highPerformanceSave(),t.transMatrix.onlyTranslate()){var u=t.getOffsetXY(r);s+=u.x,h+=u.y,i.setTransformForCurrent()}else s=0,h=0,i.transformFromMatrix(t.transMatrix,!0);var c=!1;return this.canvasRenderer.drawShape(t,i,s,h,{},null,(function(t,n,i){return!!c||(c=t.isPointInPath(e.x,e.y))}),(function(t,n,r){if(c)return!0;var o=n.lineWidth||r.lineWidth;return i.lineWidth=o,c=t.isPointInStroke(e.x,e.y)})),i.highPerformanceRestore(),c}}]),t}();qw=Yw([Zi(),$w(0,tr(Hg)),Xw("design:paramtypes",[Object])],qw);var Zw=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},Jw=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Qw=function(t,e){return function(n,i){e(n,i,t)}};new ao;var tC=function(){function t(e){Qt(this,t),this.canvasRenderer=e,this.type="richtext",this.numberType=Ih}return Jt(t,[{key:"contains",value:function(t,e,n){return!!t.AABBBounds.containsPoint(e)}}]),t}();tC=Zw([Zi(),Qw(0,tr(Wg)),Jw("design:paramtypes",[Object])],tC);var eC=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},nC=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},iC=function(t,e){return function(n,i){e(n,i,t)}},rC=function(){function t(e){Qt(this,t),this.canvasRenderer=e,this.type="glyph",this.numberType=Rh}return Jt(t,[{key:"contains",value:function(t,e,n){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;if(!(null!=n?n:{}).pickContext)return!1;var i=null==n?void 0:n.pickerService;if(i){var r=!1;return t.getSubGraphic().forEach((function(t){r||(r=!!i.pickItem(t,e,n))})),r}return!1}}]),t}();function oC(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=re(t);if(e){var r=re(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return ie(this,n)}}rC=eC([Zi(),iC(0,tr(zg)),nC("design:paramtypes",[Object])],rC);var aC=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},sC=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},lC=function(t,e){return function(n,i){e(n,i,t)}};new ao;var hC=function(t){ee(n,t);var e=oC(n);function n(t){var i;return Qt(this,n),(i=e.call(this)).canvasRenderer=t,i.type="rect3d",i.numberType=Lh,i}return Jt(n,[{key:"contains",value:function(t,e,n){var i=(null!=n?n:{}).pickContext;if(!i)return!1;var r=Js(t).rect;i.highPerformanceSave();var o=this.transform(t,r,i),a=o.x,s=o.y,l=o.z,h=o.lastModelMatrix,u=e;if(i.camera){u=e.clone();var c=t.parent.globalTransMatrix;u.x=c.a*e.x+c.c*e.y+c.e,u.y=c.b*e.x+c.d*e.y+c.f}this.canvasRenderer.z=l;var d=!1;return this.canvasRenderer.drawShape(t,i,a,s,n,null,(function(t,e,n){return!!d||(d=t.isPointInPath(u.x,u.y))})),this.canvasRenderer.z=0,i.modelMatrix!==h&&Jd.free(i.modelMatrix),i.modelMatrix=h,i.highPerformanceRestore(),d}}]),n}(Aw);function uC(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=re(t);if(e){var r=re(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return ie(this,n)}}hC=aC([Zi(),lC(0,tr(Lg)),sC("design:paramtypes",[Object])],hC);var cC=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},dC=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},fC=function(t,e){return function(n,i){e(n,i,t)}};new ao;var pC=function(t){ee(n,t);var e=uC(n);function n(t){var i;return Qt(this,n),(i=e.call(this)).canvasRenderer=t,i.type="pyramid3d",i.numberType=Hh,i}return Jt(n,[{key:"contains",value:function(t,e,n){var i=(null!=n?n:{}).pickContext;if(!i)return!1;var r=Js(t).polygon;i.highPerformanceSave();var o=this.transform(t,r,i),a=o.x,s=o.y,l=o.z,h=o.lastModelMatrix,u=e;if(i.camera){u=e.clone();var c=t.parent.globalTransMatrix;u.x=c.a*e.x+c.c*e.y+c.e,u.y=c.b*e.x+c.d*e.y+c.f}this.canvasRenderer.z=l;var d=!1;return this.canvasRenderer.drawShape(t,i,a,s,{},null,(function(t,e,n){return!!d||(d=t.isPointInPath(u.x,u.y))}),(function(t,e,n){return!1})),this.canvasRenderer.z=0,i.modelMatrix!==h&&Jd.free(i.modelMatrix),i.modelMatrix=h,i.highPerformanceRestore(),d}}]),n}(Aw);function gC(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=re(t);if(e){var r=re(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return ie(this,n)}}pC=cC([Zi(),fC(0,tr(Fg)),dC("design:paramtypes",[Object])],pC);var vC=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},yC=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},mC=function(t,e){return function(n,i){e(n,i,t)}};new ao;var bC=function(t){ee(n,t);var e=gC(n);function n(t){var i;return Qt(this,n),(i=e.call(this)).canvasRenderer=t,i.type="arc3d",i.numberType=Sh,i}return Jt(n,[{key:"contains",value:function(t,e,n){var i=(null!=n?n:{}).pickContext;if(!i)return!1;var r=Js(t).arc;i.highPerformanceSave();var o=this.transform(t,r,i),a=o.x,s=o.y,l=o.z,h=o.lastModelMatrix,u=e;if(i.camera){u=e.clone();var c=t.parent.globalTransMatrix;u.x=c.a*e.x+c.c*e.y+c.e,u.y=c.b*e.x+c.d*e.y+c.f}this.canvasRenderer.z=l;var d=!1;return this.canvasRenderer.drawShape(t,i,a,s,n,null,(function(t,e,n){return!!d||(d=t.isPointInPath(u.x,u.y))})),this.canvasRenderer.z=0,i.modelMatrix!==h&&Jd.free(i.modelMatrix),i.modelMatrix=h,i.highPerformanceRestore(),d}}]),n}(Aw);bC=vC([Zi(),mC(0,tr(Ag)),yC("design:paramtypes",[Object])],bC);var wC=new Vi((function(t,e,n,i){t(lw).toSelf().inSingletonScope(),t(Mv).toService(lw),t(Nv).toService(Mv),t(fw).toSelf().inSingletonScope(),t(Ov).toService(fw),t(Nv).toService(Ov),t(hC).toSelf().inSingletonScope(),t(Lv).toService(hC),t(Nv).toService(Lv),t(yw).toSelf().inSingletonScope(),t(Rv).toService(yw),t(Nv).toService(Rv),t(Cw).toSelf().inSingletonScope(),t(Tv).toService(Cw),t(Nv).toService(Tv),t(_w).toSelf().inSingletonScope(),t(Pv).toService(_w),t(Nv).toService(Pv),t(Pw).toSelf().inSingletonScope(),t(Ev).toService(Pw),t(Nv).toService(Ev),t(Iw).toSelf().inSingletonScope(),t(Hv).toService(Iw),t(Nv).toService(Hv),t(jw).toSelf().inSingletonScope(),t(Iv).toService(jw),t(Nv).toService(Iv),t(Vw).toSelf().inSingletonScope(),t(Dv).toService(Vw),t(Nv).toService(Dv),t(qw).toSelf().inSingletonScope(),t(Wv).toService(qw),t(Nv).toService(Wv),t(pC).toSelf().inSingletonScope(),t(Fv).toService(pC),t(Nv).toService(Fv),t(bC).toSelf().inSingletonScope(),t(Bv).toService(bC),t(Nv).toService(Bv),t(tC).toSelf().inSingletonScope(),t(zv).toService(tC),t(Nv).toService(zv),t(rC).toSelf().inSingletonScope(),t(jv).toService(rC),t(Nv).toService(jv),ur(t,Nv)})),CC=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},xC=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},_C=function(t,e){return function(n,i){e(n,i,t)}},SC=function(){function t(e){Qt(this,t),this.canvasRenderer=e,this.type="path",this.numberType=Ph}return Jt(t,[{key:"contains",value:function(t,e,n){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;var i=(null!=n?n:{}).pickContext;if(!i)return!1;var r=Js(t).path,o=t.attribute,a=o.x,s=void 0===a?r.x:a,l=o.y,h=void 0===l?r.y:l;if(i.highPerformanceSave(),t.transMatrix.onlyTranslate()){var u=t.getOffsetXY(r);s+=u.x,h+=u.y,i.setTransformForCurrent()}else s=0,h=0,i.transformFromMatrix(t.transMatrix,!0);var c=!1;return this.canvasRenderer.drawShape(t,i,s,h,{},null,(function(t,n,i){return!!c||(c=t.isPointInPath(e.x,e.y))}),(function(t,n,r){if(c)return!0;var o=n.lineWidth||r.lineWidth;return i.lineWidth=o,c=t.isPointInStroke(e.x,e.y)})),i.highPerformanceRestore(),c}}]),t}();SC=CC([Zi(),_C(0,tr(Eg)),xC("design:paramtypes",[Object])],SC);var kC=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},AC=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},RC=function(t,e){return function(n,i){e(n,i,t)}},BC=function(){function t(e){Qt(this,t),this.canvasRenderer=e,this.type="circle",this.numberType=Ah}return Jt(t,[{key:"contains",value:function(t,e,n){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;var i=(null!=n?n:{}).pickContext;if(!i)return!1;var r=Js(t).circle,o=t.attribute,a=o.x,s=void 0===a?r.x:a,l=o.y,h=void 0===l?r.y:l;if(i.highPerformanceSave(),t.transMatrix.onlyTranslate()){var u=t.getOffsetXY(r);s+=u.x,h+=u.y,i.setTransformForCurrent()}else s=0,h=0,i.transformFromMatrix(t.transMatrix,!0);var c=!1;return this.canvasRenderer.drawShape(t,i,s,h,{},null,(function(t,n,i){return!!c||(c=t.isPointInPath(e.x,e.y))}),(function(t,n,r){if(c)return!0;var o=n.lineWidth||r.lineWidth;return i.lineWidth=o,c=t.isPointInStroke(e.x,e.y)})),i.highPerformanceRestore(),c}}]),t}();BC=kC([Zi(),RC(0,tr(Bg)),AC("design:paramtypes",[Object])],BC);var TC=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},MC=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},PC=function(t,e){return function(n,i){e(n,i,t)}},EC=new ao,HC=function(){function t(e){Qt(this,t),this.canvasRenderer=e,this.type="rect",this.numberType=Oh}return Jt(t,[{key:"contains",value:function(t,e,n){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;var i=(null!=n?n:{}).pickContext;if(!i)return!1;var r=Js(t).rect,o=t.attribute.cornerRadius,a=void 0===o?r.cornerRadius:o,s=t.attribute,l=s.x,h=void 0===l?r.x:l,u=s.y,c=void 0===u?r.y:u;i.highPerformanceSave();var d=!0;if(t.transMatrix.onlyTranslate()){var f=t.getOffsetXY(r);h+=f.x,c+=f.y,i.setTransformForCurrent()}else h=0,c=0,d=!1,i.transformFromMatrix(t.transMatrix,!0);var p=!0;if(!d||Ar(a,!0)&&0!==a||Sr(a)&&a.some((function(t){return 0!==t})))p=!1,this.canvasRenderer.drawShape(t,i,h,c,{},null,(function(t,n,i){return!!p||(p=t.isPointInPath(e.x,e.y))}),(function(t,n,r){if(p)return!0;var o=n.lineWidth||r.lineWidth;return i.lineWidth=o,p=t.isPointInStroke(e.x,e.y)}));else if(p){var g=t.attribute,v=g.fill,y=void 0===v?r.fill:v,m=g.stroke,b=void 0===m?r.stroke:m,w=g.lineWidth,C=void 0===w?r.lineWidth:w;if(y)p=!0;else if(b){var x=t.AABBBounds;EC.setValue(x.x1,x.y1,x.x2,x.y2),EC.expand(-C/2),p=!EC.containsPoint(e)}}return i.highPerformanceRestore(),p}}]),t}();HC=TC([Zi(),PC(0,tr(Og)),MC("design:paramtypes",[Object])],HC);var OC=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},LC=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},IC=function(t,e){return function(n,i){e(n,i,t)}},DC=function(){function t(e){Qt(this,t),this.canvasRenderer=e,this.type="arc",this.numberType=_h}return Jt(t,[{key:"contains",value:function(t,e,n){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;var i=(null!=n?n:{}).pickContext;if(!i)return!1;var r=Js(t).arc;i.highPerformanceSave();var o=t.attribute,a=o.x,s=void 0===a?r.x:a,l=o.y,h=void 0===l?r.y:l;if(t.transMatrix.onlyTranslate()){var u=t.getOffsetXY(r);s+=u.x,h+=u.y,i.setTransformForCurrent()}else s=0,h=0,i.transformFromMatrix(t.transMatrix,!0);var c=!1;return this.canvasRenderer.drawShape(t,i,s,h,{},null,(function(t,n,i){return!!c||(c=t.isPointInPath(e.x,e.y))}),(function(t,n,r){if(c)return!0;var o=n.lineWidth||r.lineWidth;return i.lineWidth=o,c=t.isPointInStroke(e.x,e.y)})),i.highPerformanceRestore(),c}}]),t}();DC=OC([Zi(),IC(0,tr(kg)),LC("design:paramtypes",[Object])],DC);var WC=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},FC=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},zC=function(t,e){return function(n,i){e(n,i,t)}},jC=function(){function t(e){Qt(this,t),this.canvasRenderer=e,this.type="area",this.numberType=kh}return Jt(t,[{key:"contains",value:function(t,e,n){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;var i=(null!=n?n:{}).pickContext;if(!i)return!1;var r=Js(t).area,o=t.attribute,a=o.x,s=void 0===a?r.x:a,l=o.y,h=void 0===l?r.y:l;if(i.highPerformanceSave(),t.transMatrix.onlyTranslate()){var u=t.getOffsetXY(r);s+=u.x,h+=u.y,i.setTransformForCurrent()}else s=0,h=0,i.transformFromMatrix(t.transMatrix,!0);var c=!1;return this.canvasRenderer.drawShape(t,i,s,h,{},null,(function(t){return!!c||(c=t.isPointInPath(e.x,e.y))})),i.highPerformanceRestore(),c}}]),t}();jC=WC([Zi(),zC(0,tr(Rg)),FC("design:paramtypes",[Object])],jC);var NC=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},GC=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},UC=function(t,e){return function(n,i){e(n,i,t)}},KC=function(){function t(e){Qt(this,t),this.canvasRenderer=e,this.type="line",this.numberType=Mh}return Jt(t,[{key:"contains",value:function(t,e,n){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;var i=(null!=n?n:{}).pickContext;if(!i)return!1;var r=Js(t).line,o=t.attribute,a=o.x,s=void 0===a?r.x:a,l=o.y,h=void 0===l?r.y:l;if(i.highPerformanceSave(),t.transMatrix.onlyTranslate()){var u=t.getOffsetXY(r);s+=u.x,h+=u.y,i.setTransformForCurrent()}else s=0,h=0,i.transformFromMatrix(t.transMatrix,!0);var c=!1;return this.canvasRenderer.drawShape(t,i,s,h,{},null,(function(t){return!!c||(c=t.isPointInPath(e.x,e.y))}),(function(t,n,r){if(c)return!0;var o=n.lineWidth||r.lineWidth;return i.lineWidth=o,c=t.isPointInStroke(e.x,e.y)})),i.highPerformanceRestore(),c}}]),t}();KC=NC([Zi(),UC(0,tr(Pg)),GC("design:paramtypes",[Object])],KC);var VC=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},YC=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},XC=function(t,e){return function(n,i){e(n,i,t)}},$C=function(){function t(e){Qt(this,t),this.canvasRenderer=e,this.type="symbol",this.numberType=Dh}return Jt(t,[{key:"contains",value:function(t,e,n){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;var i=(null!=n?n:{}).pickContext;if(!i)return!1;var r=Js(t).symbol,o=t.attribute,a=o.x,s=void 0===a?r.x:a,l=o.y,h=void 0===l?r.y:l;if(i.highPerformanceSave(),t.transMatrix.onlyTranslate()){var u=t.getOffsetXY(r);s+=u.x,h+=u.y,i.setTransformForCurrent()}else s=0,h=0,i.transformFromMatrix(t.transMatrix,!0);var c=!1;return this.canvasRenderer.drawShape(t,i,s,h,{},null,(function(t,n,i){return!!c||(c=t.isPointInPath(e.x,e.y))}),(function(t,n,r){if(c)return!0;var o=n.lineWidth||r.lineWidth;return i.lineWidth=o,c=t.isPointInStroke(e.x,e.y)})),i.highPerformanceRestore(),c}}]),t}();$C=VC([Zi(),XC(0,tr(Ig)),YC("design:paramtypes",[Object])],$C);var qC=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},ZC=function(){function t(){Qt(this,t),this.type="text",this.numberType=Wh}return Jt(t,[{key:"contains",value:function(t,e,n){return!!t.AABBBounds.containsPoint(e)}}]),t}();ZC=qC([Zi()],ZC);var JC=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},QC=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},tx=function(t,e){return function(n,i){e(n,i,t)}},ex=function(){function t(e){Qt(this,t),this.canvasRenderer=e,this.type="polygon",this.numberType=Eh}return Jt(t,[{key:"contains",value:function(t,e,n){if(!t.AABBBounds.contains(e.x,e.y))return!1;var i=(null!=n?n:{}).pickContext;if(!i)return!1;var r=Js(t).polygon,o=t.attribute,a=o.x,s=void 0===a?r.x:a,l=o.y,h=void 0===l?r.y:l;if(i.highPerformanceSave(),t.transMatrix.onlyTranslate()){var u=t.getOffsetXY(r);s+=u.x,h+=u.y,i.setTransformForCurrent()}else s=0,h=0,i.transformFromMatrix(t.transMatrix,!0);var c=!1;return this.canvasRenderer.drawShape(t,i,s,h,{},null,(function(t,n,i){return!!c||(c=t.isPointInPath(e.x,e.y))}),(function(t,n,r){if(c)return!0;var o=n.lineWidth||r.lineWidth;return i.lineWidth=o,c=t.isPointInStroke(e.x,e.y)})),i.highPerformanceRestore(),c}}]),t}();ex=JC([Zi(),tx(0,tr(Hg)),QC("design:paramtypes",[Object])],ex);var nx=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},ix=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},rx=function(t,e){return function(n,i){e(n,i,t)}},ox=function(){function t(e){Qt(this,t),this.canvasRenderer=e,this.type="glyph",this.numberType=Rh}return Jt(t,[{key:"contains",value:function(t,e,n){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;if(!(null!=n?n:{}).pickContext)return!1;var i=null==n?void 0:n.pickerService;if(i){var r=!1;return t.getSubGraphic().forEach((function(t){r||(r=!!i.pickItem(t,e,n))})),r}return!1}}]),t}();ox=nx([Zi(),rx(0,tr(zg)),ix("design:paramtypes",[Object])],ox);var ax=new Vi((function(t){t(BC).toSelf().inSingletonScope(),t(Kv).toService(BC),t(Qv).toService(Kv),t(HC).toSelf().inSingletonScope(),t(Xv).toService(HC),t(Qv).toService(Xv),t(DC).toSelf().inSingletonScope(),t(Gv).toService(DC),t(Qv).toService(Gv),t(jC).toSelf().inSingletonScope(),t(Uv).toService(jC),t(Qv).toService(Uv),t(KC).toSelf().inSingletonScope(),t(Vv).toService(KC),t(Qv).toService(Vv),t(SC).toSelf().inSingletonScope(),t(Yv).toService(SC),t(Qv).toService(Yv),t($C).toSelf().inSingletonScope(),t($v).toService($C),t(Qv).toService($v),t(ZC).toSelf().inSingletonScope(),t(qv).toService(ZC),t(Qv).toService(qv),t(ex).toSelf().inSingletonScope(),t(Zv).toService(ex),t(Qv).toService(Zv),t(ox).toSelf().inSingletonScope(),t(Jv).toService(ox),t(ox).toService(Jv),ur(t,Qv)}));var sx=new Vi((function(t){t(ss).toDynamicValue((function(){return function(t){return new Av(t)}})).whenTargetNamed(Av.env),t(ls).toDynamicValue((function(){return function(t,e){return new wv(t,e)}})).whenTargetNamed(wv.env)})),lx=new Vi((function(t){t(ss).toDynamicValue((function(){return function(t){return new _m(t)}})).whenTargetNamed(_m.env),t(ls).toDynamicValue((function(){return function(t,e){return new ym(t,e)}})).whenTargetNamed(ym.env)})),hx=new Vi((function(t){t(ss).toDynamicValue((function(){return function(t){return new lm(t)}})).whenTargetNamed(lm.env),t(ls).toDynamicValue((function(){return function(t,e){return new nm(t,e)}})).whenTargetNamed(nm.env)})),ux=new Vi((function(t){t(ss).toDynamicValue((function(){return function(t){return new Wm(t)}})).whenTargetNamed(Wm.env),t(ls).toDynamicValue((function(){return function(t,e){return new Em(t,e)}})).whenTargetNamed(Em.env)})),cx=new Vi((function(t){t(ss).toDynamicValue((function(){return function(t){return new tb(t)}})).whenTargetNamed(tb.env),t(ls).toDynamicValue((function(){return function(t,e){return new Xm(t,e)}})).whenTargetNamed(Xm.env)}));os.load(ou),os.load(vy),os.load($g),os.load(gy),os.load(Cy),function(t){t.load(Ky),t.load(ab),t.load(sb),t.load(vb)}(os),function(t){t.load(rw)}(os),function(t){t.load(wC),t.load(ax)}(os),function(t){t.load(sx),t.load(hx),t.load(lx),t.load(ux),t.load(cx)}(os);var dx=os.get(Ke);as.global=dx;var fx=os.get(iu);as.graphicUtil=fx;var px=os.get(nu);as.transformUtil=px;var gx=os.get(Fh);as.graphicService=gx,os.get(cv);var vx=os.get(ru);as.layerService=vx;var yx=function(){function t(){Qt(this,t),this.name="AutoRenderPlugin",this.activeEvent="onRegister",this._uid=al.GenAutoIncrementId(),this.key=this.name+this._uid}return Jt(t,[{key:"activate",value:function(t){this.pluginService=t,as.graphicService.hooks.onAttributeUpdate.tap(this.key,(function(e){e.glyphHost&&(e=e.glyphHost),e.stage===t.stage&&null!=e.stage&&e.stage.renderNextFrame()})),as.graphicService.hooks.onSetStage.tap(this.key,(function(e){e.glyphHost&&(e=e.glyphHost),e.stage===t.stage&&null!=e.stage&&e.stage.renderNextFrame()}))}},{key:"deactivate",value:function(t){var e=this;as.graphicService.hooks.onAttributeUpdate.taps=as.graphicService.hooks.onAttributeUpdate.taps.filter((function(t){return t.name!==e.key})),as.graphicService.hooks.onSetStage.taps=as.graphicService.hooks.onSetStage.taps.filter((function(t){return t.name!==e.key}))}}]),t}(),mx=function(){function t(){var e=this;Qt(this,t),this.name="ViewTransform3dPlugin",this.activeEvent="onRegister",this._uid=al.GenAutoIncrementId(),this.key=this.name+this._uid,this.onMouseDown=function(t){e.option3d||(e.option3d=e.pluginService.stage.option3d),e.option3d&&(e.mousedown=!0,e.pageX=t.page.x,e.pageY=t.page.y)},this.onMouseUp=function(t){e.option3d||(e.option3d=e.pluginService.stage.option3d),e.option3d&&(e.mousedown=!1)},this.onMouseMove=function(t){var n=e.pluginService.stage;if(e.option3d||(e.option3d=n.option3d),e.option3d&&e.mousedown)if(e.pageX&&e.pageY){var i=t.page.x-e.pageX,r=t.page.y-e.pageY;e.pageX=t.page.x,e.pageY=t.page.y;var o=i/100,a=r/100;e.option3d.alpha+=o,e.option3d.beta+=a,n.set3dOptions(e.option3d),n.renderNextFrame()}else e.pageX=t.page.x,e.pageY=t.page.y}}return Jt(t,[{key:"activate",value:function(t){this.pluginService=t;var e=t.stage;this.option3d=e.option3d,e.addEventListener("mousedown",this.onMouseDown),e.addEventListener("mouseup",this.onMouseUp),e.addEventListener("mousemove",this.onMouseMove)}},{key:"deactivate",value:function(t){var e=t.stage;e.removeEventListener("mousedown",this.onMouseDown),e.removeEventListener("mouseup",this.onMouseUp),e.removeEventListener("mousemove",this.onMouseMove)}}]),t}(),bx=function(){function t(){Qt(this,t),this.name="IncrementalAutoRenderPlugin",this.activeEvent="onRegister",this.nextFrameRenderGroupSet=new Set,this.willNextFrameRender=!1,this.nextUserParams={},this._uid=al.GenAutoIncrementId(),this.key=this.name+this._uid}return Jt(t,[{key:"activate",value:function(t){var e=this;this.pluginService=t,as.graphicService.hooks.onAddIncremental.tap(this.key,(function(n,i,r){n.glyphHost&&(n=n.glyphHost),n.stage===t.stage&&null!=n.stage&&(e.nextUserParams.startAtId=i._uid,e.renderNextFrame(i))})),as.graphicService.hooks.onClearIncremental.tap(this.key,(function(n,i){n.stage===t.stage&&null!=n.stage&&(e.nextUserParams.startAtId=n._uid,e.nextUserParams.restartIncremental=!0,e.renderNextFrame(n))}))}},{key:"deactivate",value:function(t){var e=this;as.graphicService.hooks.onAddIncremental.taps=as.graphicService.hooks.onAddIncremental.taps.filter((function(t){return t.name!==e.key})),as.graphicService.hooks.onClearIncremental.taps=as.graphicService.hooks.onClearIncremental.taps.filter((function(t){return t.name!==e.key}))}},{key:"renderNextFrame",value:function(t){var e=this;this.nextFrameRenderGroupSet.add(t),this.willNextFrameRender||(this.willNextFrameRender=!0,as.global.getRequestAnimationFrame()((function(){e._doRenderInThisFrame(),e.willNextFrameRender=!1})))}},{key:"_doRenderInThisFrame",value:function(){var t=this,e=this.pluginService.stage;this.nextFrameRenderGroupSet.size&&(this.nextFrameRenderGroupSet.forEach((function(n){var i=n.layer;if(i&&n.layer.subLayers){var r=n.layer.subLayers.get(n._uid);r&&r.drawContribution&&r.drawContribution.draw(e.renderService,Object.assign({x:e.x,y:e.y,width:i.viewWidth,height:i.viewHeight,stage:e,layer:i,clear:"transparent",renderService:e.renderService,updateBounds:!1,startAtId:n._uid,context:r.layer.getNativeHandler().getContext()},t.nextUserParams))}})),this.nextUserParams={},this.nextFrameRenderGroupSet.clear())}}]),t}(),wx=new ao,Cx=function(){function t(){Qt(this,t),this.name="DirtyBoundsPlugin",this.activeEvent="onRegister",this._uid=al.GenAutoIncrementId(),this.key=this.name+this._uid}return Jt(t,[{key:"activate",value:function(t){var e=this;this.pluginService=t,t.stage.hooks.afterRender.tap(this.key,(function(t){t&&t===e.pluginService.stage&&t.dirtyBounds.clear()})),as.graphicService.hooks.beforeUpdateAABBBounds.tap(this.key,(function(t,n,i,r){t.glyphHost&&(t=t.glyphHost),n&&n===e.pluginService.stage&&n.renderCount&&(t.isContainer&&!t.shouldSelfChangeUpdateAABBBounds()||i&&(wx.setValue(r.x1,r.y1,r.x2,r.y2),n.dirty(wx,t.parent&&t.parent.globalTransMatrix)))})),as.graphicService.hooks.afterUpdateAABBBounds.tap(this.key,(function(t,n,i,r,o){n&&n===e.pluginService.stage&&n.renderCount&&(t.isContainer&&!o||n.dirty(r.globalAABBBounds))})),as.graphicService.hooks.onRemove.tap(this.key,(function(t){var n=t.stage;n&&n===e.pluginService.stage&&n.renderCount&&n&&n.dirty(t.globalAABBBounds)}))}},{key:"deactivate",value:function(t){var e=this;as.graphicService.hooks.beforeUpdateAABBBounds.taps=as.graphicService.hooks.beforeUpdateAABBBounds.taps.filter((function(t){return t.name!==e.key})),as.graphicService.hooks.afterUpdateAABBBounds.taps=as.graphicService.hooks.afterUpdateAABBBounds.taps.filter((function(t){return t.name!==e.key})),t.stage.hooks.afterRender.taps=t.stage.hooks.afterRender.taps.filter((function(t){return t.name!==e.key})),as.graphicService.hooks.onRemove.taps=as.graphicService.hooks.onRemove.taps.filter((function(t){return t.name!==e.key}))}}]),t}(),xx=new Tl;xx.addTimeline(Pl),xx.setFPS(60);var _x=function(){function t(e,n){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.8;Qt(this,t),this.dir=e,this.color=n,this.colorRgb=ih.get(n).value,this.colorRgb[0]/=255,this.colorRgb[1]/=255,this.colorRgb[2]/=255,this.ambient=i;var r=qr(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);this.formatedDir=[e[0]/r,e[1]/r,e[2]/r]}return Jt(t,[{key:"computeColor",value:function(t,e){var n,i=this.formatedDir,r=Xr(Yr((t[0]*i[0]+t[1]*i[1]+t[2]*i[2])*(1-this.ambient/2),0)+this.ambient,1);n=_r(e)?ih.get(e).value:e;var o=this.colorRgb;return ih.to.rgb(o[0]*n[0]*r,o[1]*n[1]*r,o[2]*n[2]*r)}}]),t}();function Sx(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=re(t);if(e){var r=re(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return ie(this,n)}}var kx="white",Ax=function(t){ee(n,t);var e=Sx(n);function n(t){var i,r;return Qt(this,n),(i=e.call(this,{})).beforeRender=function(t){i._beforeRender&&i._beforeRender(t)},i.afterRender=function(t){i.renderCount++,i._afterRender&&i._afterRender(t),i._afterNextRenderCbs&&i._afterNextRenderCbs.forEach((function(e){return e(t)})),i._afterNextRenderCbs=null},i.theme=new qs,i.hooks={beforeRender:new sr(["stage"]),afterRender:new sr(["stage"])},i.global=os.get(Ke),i.window=os.get(Qh),i.renderService=os.get(Yg),i.pickerService=os.get(av),i.pluginService=os.get(by),i.pluginService.active(ne(i)),i.window.create({width:t.width,height:t.height,container:t.container,dpr:t.dpr||i.global.devicePixelRatio,canvasControled:!1!==t.canvasControled,title:t.title||"",canvas:t.canvas}),i._viewBox=new ao,t.viewBox?i._viewBox.setValue(t.viewBox.x1,t.viewBox.y1,t.viewBox.x2,t.viewBox.y2):i._viewBox.setValue(0,0,i.width,i.height),i.renderCount=0,i._subView=!(i._viewBox.width()===i.width&&i._viewBox.height()===i.height),i._background=null!==(r=t.background)&&void 0!==r?r:kx,i.appendChild(new Kh(ne(i),i.global,i.window,{main:!0})),i.nextFrameRenderLayerSet=new Set,i.willNextFrameRender=!1,i.stage=ne(i),i.renderStyle=t.renderStyle,i.global.supportEvent&&(i.eventSystem=new kl({targetElement:i.window,resolution:i.window.dpr||i.global.devicePixelRatio,rootNode:ne(i),global:i.global,viewport:{viewBox:i._viewBox,get x(){return this.viewBox.x1},get y(){return this.viewBox.y1},get width(){return this.viewBox.width()},get height(){return this.viewBox.height()}}})),t.autoRender&&i.enableAutoRender(),!1===t.disableDirtyBounds&&i.enableDirtyBounds(),i.hooks.beforeRender.tap("constructor",i.beforeRender),i.hooks.afterRender.tap("constructor",i.afterRender),i._beforeRender=t.beforeRender,i._afterRender=t.afterRender,i.ticker=t.ticker||xx,i}return Jt(n,[{key:"viewBox",get:function(){return this._viewBox},set:function(t){this._viewBox.setValue(t.x1,t.y1,t.x2,t.y2)}},{key:"x",get:function(){return this._viewBox.x1},set:function(t){this._viewBox.translate(t-this._viewBox.x1,0)}},{key:"y",get:function(){return this._viewBox.y1},set:function(t){this._viewBox.translate(0,t-this._viewBox.y1)}},{key:"width",get:function(){return this.window.width},set:function(t){this.resize(t,this.height)}},{key:"viewWidth",get:function(){return this._viewBox.width()},set:function(t){this.resizeView(t,this.viewHeight)}},{key:"viewHeight",get:function(){return this._viewBox.height()},set:function(t){this.resizeView(this.viewWidth,t)}},{key:"height",get:function(){return this.window.height},set:function(t){this.resize(this.width,t)}},{key:"dpr",get:function(){return this.window.dpr},set:function(t){this.setDpr(t)}},{key:"background",get:function(){var t;return null!==(t=this._background)&&void 0!==t?t:kx},set:function(t){this._background=t}},{key:"defaultLayer",get:function(){return this.at(0)}},{key:"set3dOptions",value:function(t){var e=t.center,n=void 0===e?{x:this.width/2,y:this.height/2}:e,i=t.light,r=void 0===i?{}:i,o=t.alpha,a=void 0===o?0:o,s=t.beta,l=void 0===s?0:s,h=t.camera,u=t.fieldRatio,c=void 0===u?1:u,d=t.fieldDepth;this.option3d=Object.assign(Object.assign({},t),{center:n,light:r,alpha:a,beta:l,camera:h,fieldRatio:c,fieldDepth:d});var f=r.dir,p=void 0===f?[1,1,-1]:f,g=r.color,v=void 0===g?"white":g,y=r.ambient,m=[n.x,n.y,0],b=0,w=0,C=0;h||(b=Math.sin(a)+n.x,w=Math.sin(l)+n.y,C=Math.cos(a)*Math.cos(l)*1),this.light=new _x(p,v,y);var x={left:0,right:this.width,top:0,bottom:this.height,fieldRatio:c,fieldDepth:d,viewParams:{pos:[b,w,C],center:m,up:[0,1,0]}};this.camera?this.camera.params=x:this.camera=new gv(x),t.enableView3dTransform&&this.enableView3dTransform()}},{key:"setBeforeRender",value:function(t){this._beforeRender=t}},{key:"setAfterRender",value:function(t){this._afterRender=t}},{key:"afterNextRender",value:function(t){this._afterNextRenderCbs||(this._afterNextRenderCbs=[]),this._afterNextRenderCbs.push(t)}},{key:"enableView3dTransform",value:function(){this.view3dTranform||(this.view3dTranform=!0,this.pluginService.register(new mx))}},{key:"disableView3dTranform",value:function(){var t=this;this.view3dTranform&&(this.view3dTranform=!1,this.pluginService.findPluginsByName("ViewTransform3dPlugin").forEach((function(e){e.deactivate(t.pluginService)})))}},{key:"enableAutoRender",value:function(){this.autoRender||(this.autoRender=!0,this.pluginService.register(new yx))}},{key:"disableAutoRender",value:function(){var t=this;this.autoRender&&(this.autoRender=!1,this.pluginService.findPluginsByName("AutoRenderPlugin").forEach((function(e){e.deactivate(t.pluginService)})))}},{key:"enableIncrementalAutoRender",value:function(){this.increaseAutoRender||(this.increaseAutoRender=!0,this.pluginService.register(new bx))}},{key:"disableIncrementalAutoRender",value:function(){var t=this;this.increaseAutoRender&&(this.increaseAutoRender=!1,this.pluginService.findPluginsByName("IncrementalAutoRenderPlugin").forEach((function(e){e.deactivate(t.pluginService)})))}},{key:"enableDirtyBounds",value:function(){if(!this.dirtyBounds){this.dirtyBounds=new oo;var t=this.pluginService.findPluginsByName("DirtyBoundsPlugin")[0];t||(t=new Cx,this.pluginService.register(t)),t.activate(this.pluginService)}}},{key:"disableDirtyBounds",value:function(){var t=this;this.dirtyBounds&&(this.dirtyBounds=null,this.pluginService.findPluginsByName("DirtyBoundsPlugin").forEach((function(e){e.deactivate(t.pluginService)})))}},{key:"tryUpdateAABBBounds",value:function(){var t=this._viewBox;return this._AABBBounds.setValue(t.x1,t.y1,t.x2,t.y2),this._AABBBounds}},{key:"combineLayer",value:function(t,e){throw new Error("暂不支持")}},{key:"createLayer",value:function(t){var e=new Kh(this,this.global,this.window,{main:!1,canvasId:t});return this.appendChild(e),e}},{key:"sortLayer",value:function(t){throw new Error("暂不支持")}},{key:"removeLayer",value:function(t){return this.removeChild(this.findChildByUid(t))}},{key:"clearViewBox",value:function(t){this.window.clearViewBox(this._viewBox,t)}},{key:"render",value:function(t,e){var n=this;this.ticker.start(),this.lastRenderparams=e,this.hooks.beforeRender.call(this),(t||this).forEach((function(t,i){t.render({renderService:n.renderService,background:t===n.defaultLayer?n.background:void 0,updateBounds:!!n.dirtyBounds},Object.assign({renderStyle:n.renderStyle},e))})),this.combineLayersToWindow(),this.nextFrameRenderLayerSet.clear(),this.hooks.afterRender.call(this)}},{key:"combineLayersToWindow",value:function(){var t=this;this.forEach((function(e,n){e.combineTo(t.window,{clear:0===n,x:t.x,y:t.y,width:t.viewWidth,height:t.viewHeight,renderService:t.renderService,background:e===t.defaultLayer?t.background:void 0,updateBounds:!!t.dirtyBounds})}))}},{key:"renderNextFrame",value:function(t){var e=this;this.nextFrameRenderLayerSet.size!==this.childrenCount&&(t||this).forEach((function(t){e.nextFrameRenderLayerSet.add(t)})),this.willNextFrameRender||(this.willNextFrameRender=!0,this.global.getRequestAnimationFrame()((function(){e._doRenderInThisFrame(),e.willNextFrameRender=!1})))}},{key:"_doRenderInThisFrame",value:function(){var t=this;this.nextFrameRenderLayerSet.size&&(this.ticker.start(),this.hooks.beforeRender.call(this),this.forEach((function(e){t.nextFrameRenderLayerSet.has(e)&&e.render({renderService:t.renderService,background:e===t.defaultLayer?t.background:void 0,updateBounds:!!t.dirtyBounds},Object.assign({renderStyle:t.renderStyle},t.lastRenderparams||{}))})),this.combineLayersToWindow(),this.hooks.afterRender.call(this),this.nextFrameRenderLayerSet.clear())}},{key:"resizeWindow",value:function(t,e){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.window.resize(t,e),n&&this.render()}},{key:"resize",value:function(t,e){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.window.resize(t,e),this.forEachChildren((function(n){n.resize(t,e)})),this._subView||this.viewBox.setValue(this.viewBox.x1,this.viewBox.y1,this.viewBox.x1+t,this.viewBox.y1+e),this.camera&&(this.camera.params=Object.assign(Object.assign({},this.camera.params),{right:this.width,bottom:this.height})),n&&this.render()}},{key:"resizeView",value:function(t,e){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.viewBox.setValue(this.viewBox.x1,this.viewBox.y1,this.viewBox.x1+t,this.viewBox.y1+e),this.forEachChildren((function(n){n.resizeView(t,e)})),this.camera&&(this.camera.params=Object.assign(Object.assign({},this.camera.params),{right:this.width,bottom:this.height})),n&&this.render()}},{key:"setViewBox",value:function(t,e,n,i,r){var o=this,a=!0;"object"==Ht(t)?(this.viewBox.setValue(t.x1,t.y1,t.x2,t.y2),!1===e&&(a=!1)):(this.viewBox.setValue(t,e,t+n,e+i),!1===r&&(a=!1)),this.forEachChildren((function(t){t.resizeView(o.viewBox.width(),o.viewBox.height())})),a&&this.render()}},{key:"setDpr",value:function(t){this.forEachChildren((function(e){e.setDpr(t)}))}},{key:"setOrigin",value:function(t,e){throw new Error("暂不支持")}},{key:"export",value:function(t){throw new Error("暂不支持")}},{key:"pick",value:function(t,e){var n=this.pickerService.pick(this.children,new eo(t,e),{bounds:this.AABBBounds});return!(!(null==n?void 0:n.graphic)&&!(null==n?void 0:n.group))&&n}},{key:"startAnimate",value:function(t){throw new Error("暂不支持")}},{key:"setToFrame",value:function(t){throw new Error("暂不支持")}},{key:"release",value:function(){Yo(re(n.prototype),"release",this).call(this),this.eventSystem.release(),this.pluginService.release(),this.forEach((function(t){t.release()})),this.window.release()}},{key:"setStage",value:function(t){}},{key:"dirty",value:function(t,e){e&&t.transformWithMatrix(e),this.dirtyBounds.empty()&&this.dirtyBounds.setValue(t.x1,t.y1,t.x2,t.y2),this.dirtyBounds.union(t)}},{key:"renderTo",value:function(t,e){var n=this;this.forEachChildren((function(i,r){i.drawTo(t,Object.assign(Object.assign({},e),{renderService:n.renderService,background:i===n.defaultLayer?n.background:void 0,clear:0===r,updateBounds:!!n.dirtyBounds}))}))}},{key:"renderToNewWindow",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=os.get(Qh);return t?e.create({width:this.viewWidth,height:this.viewHeight,dpr:this.window.dpr,canvasControled:!0,offscreen:!0,title:""}):e.create({width:Math.min(this.viewWidth,this.window.width-this.x),height:Math.min(this.viewHeight,this.window.height-this.y),dpr:this.window.dpr,canvasControled:!0,offscreen:!0,title:""}),this.renderTo(e,{x:0,y:0,width:e.width,height:e.height}),e}},{key:"toCanvas",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=this.renderToNewWindow(t).getNativeHandler();return e.nativeCanvas?e.nativeCanvas:null}},{key:"setCursor",value:function(t){this._cursor=t,this.eventSystem.setCursor(t)}},{key:"getCursor",value:function(){return this._cursor}}]),n}(Nh);class Rx extends Nh{role;col;row;mergeCol;mergeRow;rowNumber;colHeight;border;needUpdate;clear(){this.removeAllChild()}getChildByName(t,e){let n=null;return this.forEachChildren((e=>e.name===t&&(n=e,!0))),e&&this.forEachChildren((e=>{if(e.getChildByName){const i=e.getChildByName(t,!0);if(i)return n=i,!0}return!1})),n}get width(){let t=this.AABBBounds.width();return t!==1/0&&t!==-1/0||(t=0),Math.max(t,this.attribute.width??0)}get height(){let t=this.AABBBounds.height();return t!==1/0&&t!==-1/0||(t=0),Math.max(t,this.attribute.height??0)}setDeltaWidth(t){this.setAttribute("width",(this.attribute.width??0)+t),this.border&&this.border.setAttribute("width",this.border.attribute.width+t)}setDeltaHeight(t){this.setAttribute("height",(this.attribute.height??0)+t),this.border&&this.border.setAttribute("height",this.border.attribute.height+t)}setDeltaX(t){this.setAttribute("x",this.attribute.x+t)}setDeltaY(t){this.setAttribute("y",this.attribute.y+t)}forEachChildrenSkipChild(t,e="border-rect",n=!1){if(n){let n=this._lastChild,i=0;for(;n;){if(n.name!==e){if(t(n,i++))return}n=n._prev}}else{let n=this._firstChild,i=0;for(;n;){if(n.name!==e){if(t(n,i++))return}n=n._next}}}getColGroup(t){let e=this._firstChild;if(!e)return null;for(let n=0;n<this.childrenCount;n++){if(e.col===t)return e;e=e._next}return null}getRowGroup(t){let e=this._firstChild;if(!e)return null;for(let n=0;n<this.childrenCount;n++){if(e.row===t)return e;e=e._next}return null}getChildAt(t){const e=super.getChildAt(t);return e&&"border-rect"===e.name?e._next:e}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 Bx(t,e,n,i,r){const o=e&&k(e[t])?e[t]:null;if("function"==typeof o){return o({col:n,row:i,table:r,value:r.getCellValue(n,i),dataValue:r.getCellOriginValue(n,i),cellHeaderPaths:r.getCellHeaderPaths(n,i)})}return o}function Tx(t,e,n,i,r){const o=e&&k(e[t])?e[t]:null;if("function"!=typeof o)return o}function Mx(t,e,n,i,r){const o=e&&k(e[t])?e[t]:null;if("function"==typeof o){return o({col:n,row:i,table:r,value:r.getCellValue(n,i),dataValue:r.getCellOriginValue(n,i),cellHeaderPaths:r.getCellHeaderPaths(n,i)})}}let Px=class extends sd{role;tooltip;constructor(t){super(t),"mouseenter_cell"!==this.attribute.visibleTime&&"click_cell"!==this.attribute.visibleTime||(this.attribute.visible=!1),this.attribute.hoverImage&&(this.attribute.originImage=this.attribute.image)}get backgroundWidth(){return this.attribute.backgroundWidth??this.attribute.width}get backgroundHeight(){return this.attribute.backgroundHeight??this.attribute.height}};const Ex=new Map;function Hx(t,e){const n=`${t}-${e}`,i=Ex.get(n);if(i)return i;const r=(o={fontSize:t,fontFamily:e},new ye({defaultFontParams:{fontFamily:"PingFang SC,Microsoft Yahei,system-ui,-apple-system,segoe ui,Roboto,Helvetica,Arial,sans-serif, apple color emoji,segoe ui emoji,segoe ui symbol",fontSize:11},getTextBounds:s?void 0:_f,specialCharSet:`-/: .,@%'"~${ye.ALPHABET_CHAR_SET}${ye.ALPHABET_CHAR_SET.toUpperCase()}`,...a??{}},o));var o,a,s;return Ex.set(n,r),r}const Ox=new class{measureText(t,e){const{fontSize:n,fontFamily:i}=e;return Hx(n,i).measure(t)}measureTextWidth(t,e){const{fontSize:n,fontFamily:i="sans-serif"}=e;return Hx(n,i).measure(t).width}clipText(t,e,n){if(0===t.length)return{str:"",width:0};let i=this.measureTextWidth(t,e);return i<=n?{str:t,width:i}:(i=this.measureTextWidth(t[0],e),i>n?{str:"",width:0}:this._clipText(t,e,n,0,t.length-1))}_clipText(t,e,n,i,r){const o=Math.floor((i+r)/2),a=t.substring(0,o+1),s=this.measureTextWidth(a,e);let l;if(s>n){if(a.length<=1)return{str:"",width:0};const r=t.substring(0,o);return l=this.measureTextWidth(r,e),l<=n?{str:r,width:l}:this._clipText(t,e,n,i,o)}if(s<n){if(o>=t.length-1)return{str:t,width:this.measureTextWidth(t,e)};const i=t.substring(0,o+2);return l=this.measureTextWidth(i,e),l>=n?{str:a,width:s}:this._clipText(t,e,n,o,r)}return{str:a,width:s}}clipTextWithSuffix(t,e,n,i){if(""===i)return this.clipText(t,e,n);if(0===t.length)return{str:"",width:0};const r=this.measureTextWidth(t,e);if(r<=n)return{str:t,width:r};const o=this.measureTextWidth(i,e);if(o>n)return{str:"",width:0};n-=o;const a=this._clipText(t,e,n,0,t.length-1);return a.str+=i,a.width+=o,a}},Lx=["heightLimit","lineClamp","autoWrapText"];class Ix extends Mu{constructor(t){super(t)}updateSingallineAABBBounds(t){const e=Js(this).text;let n,i;const r=2,o=this.attribute,{maxLineWidth:a=e.maxLineWidth,ellipsis:s=e.ellipsis,textAlign:l=e.textAlign,textBaseline:h=e.textBaseline,fontSize:u=e.fontSize,fontFamily:c=e.fontFamily,stroke:d=e.stroke,lineHeight:f=o.lineHeight??(o.fontSize??e.lineHeight??e.fontSize)+r,lineWidth:p=e.lineWidth}=o;if(!this.shouldUpdateShape()&&this.cache){n=this.cache.clipedWidth;const t=ku(l,n),e=Au(h,f,u);return this._AABBBounds.set(t,e,t+n,e+f),d&&this._AABBBounds.expand(p/2),this._AABBBounds}if(Number.isFinite(a)){if(s){const r=!0===s?e.ellipsis:s,o=Ox.clipTextWithSuffix(t.toString(),{fontSize:u,fontFamily:c},a,r);i=o.str,n=o.width}else{const e=Ox.clipText(t.toString(),{fontSize:u,fontFamily:c},a);i=e.str,n=e.width}this.cache.clipedText=i,this.cache.clipedWidth=n}else n=Ox.measureTextWidth(t.toString(),{fontSize:u,fontFamily:c}),this.cache.clipedText=t.toString(),this.cache.clipedWidth=n;this.clearUpdateShapeTag();const g=ku(l,n),v=Au(h,f,u);return this._AABBBounds.set(g,v,g+n,v+f),d&&this._AABBBounds.expand(p/2),this._AABBBounds}updateMultilineAABBBounds(t){const e=Js(this).text,{fontFamily:n=e.fontFamily,textAlign:i=e.textAlign,textBaseline:r=e.textBaseline,fontSize:o=e.fontSize,lineHeight:a=this.attribute.lineHeight??this.attribute.fontSize??e.lineHeight??e.fontSize,ellipsis:s=e.ellipsis,maxLineWidth:l,stroke:h=e.stroke,lineWidth:u=e.lineWidth,heightLimit:c=-1,lineClamp:d=e.lineClamp,autoWrapText:f=e.autoWrapText}=this.attribute;if(!this.shouldUpdateShape()&&this.cache?.layoutData){const t=this.cache.layoutData.bbox;return this._AABBBounds.set(t.xOffset,t.yOffset,t.xOffset+t.width,t.yOffset+t.height),h&&this._AABBBounds.expand(u/2),this._AABBBounds}const p=new Ru(n,{fontSize:o,fontFamily:n},Ox),g=t.map((t=>t.toString())),v=[],y=[0,0];let m=1/0;if(c>0&&(m=Math.max(Math.floor(c/a),1)),d&&(m=Math.min(m,d)),f)if("number"==typeof l&&l!==1/0){if(l>0)for(let t=0;t<g.length;t++){const e=g[t];if(t===m-1){const t=p.textMeasure.clipTextWithSuffix(e,p.textOptions,l,s);v.push({str:t.str,width:t.width});break}const i=p.textMeasure.clipText(e,p.textOptions,l);if(""!==e&&""===i.str&&(i.str=e.substring(0,1),i.width=Ox.measureTextWidth(i.str,{fontSize:o,fontFamily:n})),v.push({str:i.str,width:i.width}),i.str.length===e.length);else{const n=e.substring(i.str.length);g.splice(t+1,0,n)}}let t=0;v.forEach((e=>{t=Math.max(t,e.width)})),y[0]=t}else{let t,e,n=0;for(let i=0,r=g.length;i<r;i++){if(i===m-1){const t=p.textMeasure.clipTextWithSuffix(g[i],p.textOptions,l,s);v.push({str:t.str,width:t.width}),n=Math.max(n,t.width);break}e=g[i],t=p.textMeasure.measureTextWidth(e,p.textOptions),n=Math.max(n,t),v.push({str:e,width:t})}y[0]=n}else{let t=0;for(let e=0,n=g.length;e<n;e++)if(e<m){const n=p.textMeasure.clipTextWithSuffix(g[e],p.textOptions,l,s);v.push({str:n.str,width:n.width}),t=Math.max(t,n.width)}y[0]=t}y[1]=v.length*a;const b={xOffset:0,yOffset:0,width:y[0],height:y[1]};p.LayoutBBox(b,i,r);const w=p.layoutWithBBox(b,v,i,r,a);return this.cache.layoutData=w,this.clearUpdateShapeTag(),this._AABBBounds.set(b.xOffset,b.yOffset,b.xOffset+b.width,b.yOffset+b.height),h&&this._AABBBounds.expand(u/2),this._AABBBounds}needUpdateTags(t){for(let e=0;e<Lx.length;e++){const n=Lx[e];if(-1!==t.indexOf(n))return!0}return super.needUpdateTags(t)}needUpdateTag(t){for(let e=0;e<Lx.length;e++){if(t===Lx[e])return!0}return super.needUpdateTag(t)}}function Dx(t,e,n,i,r,o,a,s,l){let h,u,c,d,g=!0;if("function"==typeof t){const e=t({col:n,row:i,dataValue:l.getCellOriginValue(n,i),value:l.getCellValue(n,i)||"",rect:{left:0,top:0,right:r,bottom:o,width:r,height:o},table:l});c=e.rootContainer.getElements(void 0,!1,!1),g=e.renderDefault}else if("function"==typeof e){const t=e({col:n,row:i,dataValue:l.getCellOriginValue(n,i),value:l.getCellValue(n,i)||"",rect:{left:0,top:0,right:r,bottom:o,width:r,height:o},table:l});t&&(c=t.elements,g=t.renderDefault,h=t.expectedWidth,u=t.expectedHeight)}else e&&(h=e.expectedWidth,u=e.expectedHeight,c=e.elements,g=e.renderDefault);if(c){d=function(t,e,n,i){const r=new Rx({x:0,y:0,width:e,height:n,fill:!1,stroke:!1,pickable:!1});r.name="custom-container";const o=function(t,e,n,i){const r=[],o=0,a=0,s=[0,0,0,0];for(let l=0;l<t.length;l++){const h=t[l],u=Object.assign({},h);for(const t in u)u.hasOwnProperty(t)&&f(u[t])&&(u[t]=u[t](i));const c=u;k(c.x)&&(c.x=p(c.x)?Wx(c.x,e-s[1]):Number(c.x),c.y=p(c.y)?Wx(c.y,n-s[2]):Number(c.y)),"width"in u&&(u.width=p(u.width)?Wx(u.width,e-s[1]):Number(u.width)),"height"in u&&(u.height=p(u.height)?Wx(u.height,n-s[2]):Number(u.height)),"radius"in u&&(u.radius=p(u.radius)?Wx(u.radius,Math.min(e-s[1],n-s[2])):Number(u.radius)),"hover"in u&&(u.hover.x=p(u.hover.x)?Wx(u.hover.x,e-s[1]):Number(u.hover.x),u.hover.y=p(u.hover.y)?Wx(u.hover.y,n-s[2]):Number(u.hover.y),u.hover.width=p(u.hover.width)?Wx(u.hover.width,e-s[1]):Number(u.hover.width),u.hover.height=p(u.hover.height)?Wx(u.hover.height,n-s[2]):Number(u.hover.height),u.hover.x+=o,u.hover.y+=a),c.x=c.x+o,c.y=c.y+a,r.push(u)}return r}(t,e,n,i);return o.forEach((t=>{switch(t.type){case"arc":const e=ff({x:t.x,y:t.y,dx:t.dx??0,dy:t.dy??0,fill:t.fill,stroke:t.stroke,outerRadius:t.radius,startAngle:t.startAngle,endAngle:t.endAngle,pickable:!!t.clickable,cursor:t.cursor});r.appendChild(e);break;case"text":if(t.background){const e=t.background?.expandX??0,n=t.background?.expandY??0,i=yf({x:t.x-e,y:t.y-n,dx:t.dx??0,dy:t.dy??0,width:t.width+2*e,height:t.height+2*n,cornerRadius:t.background?.cornerRadius??0,fill:t.background?.fill??"#888"});r.appendChild(i)}const n=new Ix(Object.assign({pickable:!!t.clickable},t));r.appendChild(n);break;case"rect":const i=yf({x:t.x,y:t.y,dx:t.dx??0,dy:t.dy??0,width:t.width,height:t.height,cornerRadius:t.radius,fill:t.fill,stroke:t.stroke,pickable:!!t.clickable,cursor:t.cursor});r.appendChild(i);break;case"circle":const o=pf({x:t.x,y:t.y,dx:t.dx??0,dy:t.dy??0,radius:t.radius,fill:t.fill,stroke:t.stroke,pickable:!!t.clickable,cursor:t.cursor});r.appendChild(o);break;case"icon":const a=new Px({x:t.x,y:t.y,dx:t.dx??0,dy:t.dy??0,width:t.width,height:t.height,image:t.svg,backgroundWidth:t.hover?t.hover.width??t.width:void 0,backgroundHeight:t.hover?t.hover.width??t.width:void 0,backgroundColor:t.hover?t.hover.bgColor??"rgba(22,44,66,0.2)":void 0,pickable:!!t.clickable,cursor:t.cursor});a.role="icon-custom",r.appendChild(a);break;case"image":const s=new Px({x:t.x,y:t.y,dx:t.dx??0,dy:t.dy??0,width:t.width,height:t.height,image:t.src,backgroundWidth:t.hover?t.hover.width??t.width:void 0,backgroundHeight:t.hover?t.hover.width??t.width:void 0,backgroundColor:t.hover?t.hover.bgColor??"rgba(22,44,66,0.2)":void 0,pickable:!!t.clickable,cursor:t.cursor,shape:t.shape});s.role="image-custom",r.appendChild(s);break;case"line":const l=vf({points:t.points,stroke:t.stroke,pickable:!!t.clickable,cursor:t.cursor});r.appendChild(l)}})),r}(c,a?h:r,s?u:o,l.getCellValue(n,i))}return{elementsGroup:d,renderDefault:g}}function Wx(t,e){return t.endsWith("px")?parseInt(t,10):t.endsWith("%")&&e?parseInt(t,10)/100*e:parseInt(t,10)}class Fx extends Rx{_leftGroup;_rightGroup;_centerGroup;_autoWidth=!1;_autoHeight=!1;_cellWidth;_cellHeight;_align;_baseline;constructor(t){super(t),this._leftGroup=new Rx({pickable:!1,fill:!1,stroke:!1}),this._leftGroup.role="content-left",this._rightGroup=new Rx({pickable:!1,fill:!1,stroke:!1}),this._rightGroup.role="content-right",this._centerGroup=new Rx({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._cellHeight=t.cellHeight,this._align=t.align,this._baseline=t.baseline}addLeftOccupyingIcon(t){t.setAttribute("x",this._leftGroup.width+(t.attribute.marginLeft??0)),this._leftGroup.appendChild(t),this._leftGroup.setDeltaWidth((t.attribute.marginLeft??0)+(t.attribute.marginRight??0)+t.attribute.width)}addRightOccupyingIcon(t){t.setAttribute("x",this._rightGroup.width+(t.attribute.marginLeft??0)),this._rightGroup.appendChild(t),this._rightGroup.setDeltaWidth((t.attribute.marginLeft??0)+(t.attribute.marginRight??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 Ix&&(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 n=this._centerGroup.width;this._cellWidth=t+e+n,this.setAttribute("width",this._cellWidth)}else{const n=this._cellWidth-t-e;this.updateCenterLayout(n);const i=this._centerGroup.width;this._cellWidth=t+e+i,this.setAttribute("width",this._cellWidth)}this.updateHorizontalPos();const n=this._leftGroup.height,i=this._rightGroup.height,r=this._centerGroup.height;this._cellHeight=Math.max(n,i,r),this.setAttribute("height",this._cellHeight),this.updateVerticalPos()}updateCenterLayout(t){let e=t;this._centerGroup.forEachChildren((t=>{t instanceof Px&&(e-=t.AABBBounds.width())}));const n=this._centerGroup.getChildByName("text");n instanceof pd?n.setAttribute("width",e):n instanceof Ix&&n.setAttribute("maxLineWidth",e);let i=0;this._centerGroup.forEachChildren((t=>{t.setAttribute("x",i),i+=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.layout()}updateHeight(t){this._cellHeight=t,this.layout()}}function zx(t,e,n){if(!t.isHeader(e,n)&&!0!==t.getBodyColumnDefine(e,n).mergeCell)return!1;const i=t.getCellRange(e,n);return!(i.start.col===i.end.col&&i.start.row===i.end.row)&&i}function jx(t,e,n){let i=0;const o=n.internalProps.layoutMap;if(o.isHeader(t,e)){const n=o.getHeader(t,e);n?.hierarchyLevel&&(i=(n.hierarchyLevel??0)*(o.rowHierarchyIndent??0))}else{const a=n.getBodyColumnDefine(t,e);if(a?.tree){const a=n.dataSource.getIndexKey(n.getRecordIndexByRow(t,e));i=Array.isArray(a)&&n.getHierarchyState(t,e)!==r.none?(a.length-1)*(o.hierarchyIndent??0):0}}return i}function Nx(t,e,n,i,r){const o={};"image"===t.type?o.image=t.src:("svg"===t.type||"svg"in t)&&(o.image=t.svg),o.width=t.width,o.height=t.height,o.visibleTime=t.visibleTime??"always",o.funcType=t.funcType;let a=0;if(Lt(n)&&Lt(i)&&r&&(t.funcType===l.collapse||t.funcType===l.expand)&&(a=jx(n,i,r)),o.marginLeft=(t.marginLeft??0)+a,o.marginRight=t.marginRight??0,t.interactive&&(o.pickable=!1),t.hover&&(o.backgroundWidth=t.hover.width??t.width,o.backgroundHeight=t.hover.width??t.width,o.backgroundColor=t.hover.bgColor??"rgba(22,44,66,0.2)",o.hoverImage=t.hover.image),t.cursor&&(o.cursor=t.cursor),"shape"in t&&"circle"===t.shape&&(o.shape=t.shape),e)return e.setAttributes(o),e.loadImage(o.image),e;const s=new Px(o);return s.tooltip=t.tooltip,s}function Gx(t){const e={};return"image"===t.type?e.image=t.src:("svg"===t.type||"svg"in t)&&(e.image=t.svg),e.visibleTime=t.visibleTime??"always",e.funcType=t.funcType,e.id=t.name,e.width=t.width,e.height=t.height,(t.marginRight||t.marginLeft)&&(e.margin=[0,t.marginRight??0,0,t.marginLeft??0]),t.hover&&(e.backgroundWidth=t.hover.width??t.width,e.backgroundHeight=t.hover.height??t.height,e.backgroundShowMode="hover",e.hoverImage=t.hover.image,e.backgroundStroke=!1,e.backgroundFill=t.hover.bgColor??"rgba(22,44,66,0.2)"),t.cursor&&(e.cursor=t.cursor),e.tooltip=t.tooltip,e}function Ux(t,e,n,i,r,o,a,s){let l,h=0,u=0,c=0,d=0;t.forEachChildren((t=>{"icon-left"===t.role?(h+=t.AABBBounds.width(),u=Math.max(u,t.AABBBounds.height())):"icon-right"===t.role&&(c+=t.AABBBounds.width(),d=Math.max(d,t.AABBBounds.height()))}));const f=t.getChildByName("text"),p=t.getChildByName("content");let g;f instanceof Ix?(l=f.AABBBounds.height(),f.setAttribute("maxLineWidth",e-h-d-(r[1]+r[3])),g=f.AABBBounds.height()):f instanceof pd?(l=f.AABBBounds.height(),f.setAttribute("width",e-h-d-(r[1]+r[3])),g=f.AABBBounds.height()):p&&(l=p.AABBBounds.height(),p.updateWidth(e-h-d-(r[1]+r[3])),g=p.AABBBounds.height());const v=Math.max(u,d,l)+r[0]+r[2];if(t.forEachChildren((i=>{"icon-left"===i.role||("icon-right"===i.role||"icon-absolute-right"===i.role?i.setAttribute("x",i.attribute.x+n):"content"===i.name||"text"===i.name?(i.AABBBounds.width(),"center"===o?i.setAttribute("x",r[3]+h+(e-(r[1]+r[3])-h-c)/2):"right"===o&&i.setAttribute("x",r[3]+e-(r[1]+r[3])-c)):"mark"===i.name&&i.setAttribute("x",t.attribute.width))})),i){let e=Math.max(u,g,d);if(function(t,e,n,i){const r=t.table,o=zx(r,e.col,e.row);if(o&&o.end.row-o.start.row){i/=o.end.row-o.start.row+1,n/=o.end.row-o.start.row+1;for(let t=o.start.row;t<=o.end.row;t++){const e=r.getRowHeight(t);if(e===i&&n!==e)return!0;if(n>e)return!0}}else{const t=r.getRowHeight(e.row);if(t===i&&n!==t)return!0;if(n>t)return!0}return!1}(s,t,e+r[0]+r[2],v))return!0;e=t.attribute.height-(r[0]+r[2]),t.forEachChildren((t=>{"rect"!==t.type&&"chart"!==t.type&&("mark"===t.name?t.setAttribute("y",0):"middle"===a?t.setAttribute("y",r[0]+(e-t.AABBBounds.height())/2):"bottom"===a?t.setAttribute("y",r[0]+e-t.AABBBounds.height()):t.setAttribute("y",r[0]))}))}else"middle"!==a&&"bottom"!==a||t.forEachChildren((e=>{"rect"!==e.type&&"chart"!==e.type&&("mark"===e.name?e.setAttribute("y",0):"middle"===a?e.setAttribute("y",(t.attribute.height-r[2]+r[0]-e.AABBBounds.height())/2):"bottom"===a?e.setAttribute("y",t.attribute.height-e.AABBBounds.height()-r[2]):e.setAttribute("y",r[0]))}));return!1}function Kx(t,e,n,i,r,o){const a=function(t,e){const n=new Array(e);for(let i=0;i<e;i++)n[i]=t(i);return n}(t,n);a.sort(((t,e)=>i(o(t),o(e),r)));for(let t=0;t<n;t++)e(t,a[t])}function Vx(t,e){if(typeof t!=typeof e)return!1;if("number"==typeof t&&"number"==typeof e&&t!==e)return!1;if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!==e[n])return!1;return!0}const Yx={SOURCE_LENGTH_UPDATE:"source_length_update",CHANGE_ORDER:"change_order"};function Xx(t,e){const n=ot(t);if(at(n)){const t=n.then((t=>(e(t),t)));return e(t),t}return n}function $x(t,e,n){if(null===t)return;if(at(t))return t.then((t=>$x(t,e,n)));const i=function(t){if(ct.isObject(t)){const e=t;if(k(e.get)&&k(e.set))return!0}return!1}(e)?e.get:e;if(i in t){return Xx(t[i],n)}if("function"==typeof i){return Xx(i(t),n)}if(Array.isArray(i)){const e=function(t,e){let n,i=t;for(;n=e.shift();)i=i[n];return i}(t,[...i]);return Xx(e,n)}const r=`${i}`.split(".");if(r.length<=1){return Xx(t[i],n)}const o=it(t,((t,e)=>$x(t,e,gt)),...r);return Xx(o,n)}function qx(t,e){if(!t)return e;const n=t[e];return k(n)?n:e}class Zx extends P{_get;_sourceLength;_source;sortedIndexMap;lastOrder;lastOrderFn;lastOrderField;currentIndexedData=[];pagerConf;_currentPagerIndexedData;enableHierarchyState=!1;static get EVENT_TYPE(){return Yx}treeDataHierarchyState=new Map;constructor(t,e,n){if(super(),this._get=t?.get.bind(t)||void 0,this._sourceLength=t?.length||0,this._source=t?.source??t,this.sortedIndexMap=new Map,this._currentPagerIndexedData=[],this.pagerConf=e||{totalCount:this._sourceLength,perPageCount:this._sourceLength,currentPage:0},n>=1&&(this.enableHierarchyState=!0),this.currentIndexedData=Array.from({length:this._sourceLength},((t,e)=>e)),this.enableHierarchyState)for(let t=0;t<this._sourceLength;t++){this.getOriginalRecord(t).children&&this.treeDataHierarchyState.set(t,r.collapse)}if(n>1){let t=this._sourceLength;for(let e=0;e<t;e++){const i=this.currentIndexedData[e],o=this.getOriginalRecord(i);if(o.children?.length>0){this.treeDataHierarchyState.set(Array.isArray(i)?i.join(","):i,r.expand);const a=this.initChildrenNodeHierarchy(i,n,2,o);e+=a,t+=a}}}this.updatePagerData()}initChildrenNodeHierarchy(t,e,n,i){if(n>e)return 0;let o=0;const a=i.children?.length??0;for(let s=0;s<a;s++){o+=1;const a=i.children[s],l=Array.isArray(t)?t.concat(s):[t,s];this.currentIndexedData.splice(this.currentIndexedData.indexOf(t)+o,0,l),a.children?.length>0&&(n<e?this.treeDataHierarchyState.set(Array.isArray(l)?l.join(","):l,r.expand):this.treeDataHierarchyState.set(Array.isArray(l)?l.join(","):l,r.collapse)),o+=this.initChildrenNodeHierarchy(l,e,n+1,a)}return o}updatePager(t){this.pagerConf=t||{totalCount:this._sourceLength,perPageCount:this._sourceLength,currentPage:0},this.updatePagerData()}updatePagerData(){const{currentIndexedData:t}=this,{perPageCount:e,currentPage:n}=this.pagerConf,i=e*(n||0),r=i+e;if(this._currentPagerIndexedData.length=0,t&&t.length>0){let e=-1;for(let n=0;n<t.length;n++)if((Array.isArray(t[n])&&1===t[n].length||!Array.isArray(t[n]))&&e++,e>=i&&e<r)this._currentPagerIndexedData.push(t[n]);else if(e>=r)break}else if(this._sourceLength>0)throw new Error("currentIndexedData should has values!")}get source(){return this._source}get(t){return this.getOriginalRecord(qx(this.currentPagerIndexedData,t))}getIndexKey(t){return qx(this.currentPagerIndexedData,t)}getField(t,e){return this.getOriginalField(qx(this.currentPagerIndexedData,t),e)}hasField(t,e){return this.hasOriginalField(qx(this.currentPagerIndexedData,t),e)}getHierarchyState(t){const e=this.getIndexKey(t);return this.treeDataHierarchyState.get(Array.isArray(e)?e.join(","):e)??null}toggleHierarchyState(t){const e=this.currentIndexedData.slice(0),n=this.getIndexKey(t),i=this.getHierarchyState(t),o=this.getOriginalRecord(n);if(this.clearSortedIndexMap(),i===r.collapse)this.treeDataHierarchyState.set(Array.isArray(n)?n.join(","):n,r.expand),this.pushChildrenNode(n,r.expand,o);else if(i===r.expand){let t=0;const e=(n,i,o)=>{if(i&&i!==r.collapse&&i!==r.none&&o.children)for(let i=0;i<o.children.length;i++){t+=1;const r=Array.isArray(n)?n.concat([i]):[n,i];e(r,this.treeDataHierarchyState.get(r.join(",")),o.children[i])}};e(n,i,o),this.currentIndexedData.splice(this.currentIndexedData.indexOf(n)+1,t),this.treeDataHierarchyState.set(Array.isArray(n)?n.join(","):n,r.collapse)}return this.updatePagerData(),function(t,e){const n=[],i=[];for(let n=0;n<t.length;n++){let r=!0;for(let i=0;i<e.length;i++)if(Vx(t[n],e[i])){r=!1;break}r&&i.push(n)}for(let i=0;i<e.length;i++){let r=!0;for(let n=0;n<t.length;n++)if(Vx(t[n],e[i])){r=!1;break}r&&n.push(i)}return{add:n,remove:i}}(e,this.currentIndexedData)}pushChildrenNode(t,e,n){if(!e||e===r.collapse||e===r.none)return 0;let i=0;if(n.children){const e=Array.from({length:n.children.length},((t,e)=>e));this.lastOrder&&"normal"!==this.lastOrder&&this.lastOrderField&&Kx((t=>k(e[t])?e[t]:e[t]=t),((t,n)=>{e[t]=n}),n.children.length,this.lastOrderFn,this.lastOrder,(e=>this.getOriginalField(Array.isArray(t)?t.concat([e]):[t,e],this.lastOrderField)));for(let o=0;o<e.length;o++){i+=1;const a=Array.isArray(t)?t.concat([e[o]]):[t,e[o]];this.currentIndexedData.splice(this.currentIndexedData.indexOf(t)+i,0,a);const s=this.treeDataHierarchyState.get(a.join(",")),l=this.getOriginalRecord(a);!s&&l.children&&this.treeDataHierarchyState.set(a.join(","),r.collapse),i+=this.pushChildrenNode(a,this.treeDataHierarchyState.get(a.join(",")),n.children[e[o]])}}return i}setRecord(t,e){const n=this.getIndexKey(e);if(Array.isArray(n)){const e=n[n.length-1];this.getOriginalRecord(n.slice(0,n.length-1)).children.splice(e,1,t)}else this.source.splice(n,1,t)}sort(t,e,n=("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=n;let i,r=this.sortedIndexMap.get(t);if(r&&(i=r[e],i&&i.length>0))return this.currentIndexedData=i,this.updatePagerData(),void this.fireListeners(Yx.CHANGE_ORDER);const o=[];if("normal"===e)for(let t=0;t<this._sourceLength;t++)o[t]=t;else Kx((t=>k(o[t])?o[t]:o[t]=t),((t,e)=>{o[t]=e}),this._sourceLength,n,e,(e=>this.getOriginalField(e,t)));if(this.currentIndexedData=o,this.enableHierarchyState){let t=o.length;window.performance.now();for(let e=0;e<t;e++){const n=this.pushChildrenNode(o[e],this.treeDataHierarchyState.get(o[e]),this.getOriginalRecord(o[e]));t+=n,e+=n}}r||(r={asc:[],desc:[],normal:[]},this.sortedIndexMap.set(t,r)),r[e]=o,this.updatePagerData(),this.fireListeners(Yx.CHANGE_ORDER)}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 sourceLenght(){return this._sourceLength}set sourceLength(t){this._sourceLength!==t&&(this._sourceLength=t,this.fireListeners(Yx.SOURCE_LENGTH_UPDATE,this._sourceLength))}get length(){return this.currentPagerIndexedData.length}get dataSource(){return this}get currentPagerIndexedData(){return this._currentPagerIndexedData.length>0?this._currentPagerIndexedData:[]}dispose(){super.dispose?.()}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){return Xx(this._get(t),(e=>{this.recordPromiseCallBack(t,e)}))}getOriginalField(t,e){if(null===e)return;return $x(this.getOriginalRecord(t),e,(n=>{this.fieldPromiseCallBack(t,e,n)}))}hasOriginalField(t,e){if(null===e)return!1;if("function"==typeof e)return!0;const n=this.getOriginalRecord(t);return Boolean(n&&e in n)}fieldPromiseCallBack(t,e,n){}recordPromiseCallBack(t,e){}static EMPTY=new Zx({get(){},length:0})}class Jx extends Zx{_recordCache;_fieldCache;static get EVENT_TYPE(){return Zx.EVENT_TYPE}static ofArray(t,e,n){return new Jx({get:e=>Array.isArray(e)?function(t,e){let n=t;for(let t=0;t<e.length;t++){const i=e[t];if(!n[i])return;n=n[i],n&&n.children&&t+1<e.length&&(n=n.children)}return n}(t,e):t[e],length:t.length,source:t},e,n)}constructor(t,e,n){super(t,e,n),this._recordCache={},this._fieldCache={}}getOriginalRecord(t){return this._recordCache&&this._recordCache[t]?this._recordCache[t]:super.getOriginalRecord(t)}getOriginalField(t,e){const n=this._fieldCache&&this._fieldCache[t];if(n){const t=n.get(e);if(t)return t}return super.getOriginalField(t,e)}clearCache(){this._recordCache&&(this._recordCache={}),this._fieldCache&&(this._fieldCache={})}fieldPromiseCallBack(t,e,n){!function(t,e,n,i){(t[e]||(t[e]=new Map)).set(n,i)}(this._fieldCache,t,e,n)}recordPromiseCallBack(t,e){this._recordCache[t]=e}dispose(){super.dispose?.()}}var Qx=Object.freeze({__proto__:null,CachedDataSource:Jx,DataSource:Zx}),t_={exports:{}},e_={},n_=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"),i_=["style","variant","weight","size","lineHeight","family"],r_=/([\.0-9]+)(.*)/,o_=function(t,e,n){var i=t.match(r_);if(i){t=parseFloat(i[1]);var r=i[2].toLowerCase().trim(),o=Math.round(t);switch(o===t&&(t=o),r){case"em":if(null===e)return;return t*e;case"px":return t;case"pt":return t/(72/n);case"pc":return t/(6/n);case"mm":return t*(n/25.4);case"cm":return t*(n/2.54);case"in":return t*n;case"%":if(null===e)return;return e*(t/100)}}},a_={size:o_,lineHeight:o_},s_={serif:1,"sans-serif":1,cursive:1,fantasy:1,monospace:1},l_=t_.exports=function(t,e,n){var i=t+"-"+(e||"null")+"@"+n;if(n=n||96,void 0!==e_[i])return e_[i];if(e&&(e=l_(e,null,n)),"inherit"===t)return e;var r=n_.exec(t);if(r){r.shift();for(var o={},a=0;a<r.length;a++){var s=i_[a],l=r[a];if(a_[s]&&l){var h=e&&e[s]||null,u=a_[s](l,h,n);l=void 0===u&&"lineHeight"===s&&l?o.size*parseFloat(l):u}if(l&&"normal"!==l){if("inherit"===l){if(!e)return;l=e[s]}l.trim&&(l=l.trim()),o[s]=l}}Object.keys(o).length||(o=null),e_[i]=o;var c=[];o.style&&c.push(o.style),o.variant&&c.push(o.variant),o.weight&&"400"!==o.weight&&"normal"!==o.weight&&c.push(o.weight),c.push(o.size+"px"),o.lineHeight&&(c[c.length-1]+="/"+o.lineHeight+"px");var d=o.family.split(",");return o.family=d.map((function(t){return t=t.trim(),s_[t.toLowerCase()]&&(t=t.toLowerCase()),t})),c.push(o.family),Object.defineProperty(o,"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(" ")}}),o}e_[i]=null};t_.exports.generics=s_;var h_=At(t_.exports);function u_(t){let e=Gl(t);return"number"==typeof e||"string"==typeof e?e=[e,e,e,e]:Array.isArray(e)&&(e=e.slice(0)),e}const c_=0,d_=1,f_=2,p_=3,g_=10,v_=11,y_=12,m_=9,b_=13,w_=10,C_=12,x_=32,__=37,S_=46,k_=48,A_=57,R_=65,B_=90,T_=97,M_=122;function P_(t){return function(t){return t>=T_&&t<=M_}(t)||function(t){return t>=R_&&t<=B_}(t)}function E_(t){return t===m_||t===w_||t===C_||t===b_||t===x_}function H_(t){return t>=k_&&t<=A_}function O_(t){return t===S_}function L_(t){return P_(t)||t===__}function I_(t){return new Error(`calc parse error: ${t}`)}const D_={"*":3,"/":3,"+":2,"-":2};function W_(t,e){function n(t){const n=t.pop(),i=t.pop(),r=t.pop();if(!(r&&r.nodeType&&i&&i.type===f_&&n&&n.nodeType))throw I_(e);return{nodeType:v_,left:r,op:i,right:n}}const i=[];for(;t.length;){const r=t.shift();if(r.type===c_&&"("===r.value){let n=0;const r=$.findIndex(t,(t=>{if(t.type===c_&&"("===t.value)n++;else if(t.type===c_&&")"===t.value){if(!n)return!0;n--}return!1}));if(-1===r)throw I_(e);i.push(W_(t.splice(0,r),e)),t.shift()}else if(r.type===f_){if(i.length>=3){const t=i[i.length-2].value;D_[r.value]<=D_[t]&&i.push(n(i))}i.push(r)}else if(r.type===d_){const{value:t,unit:e}=r;i.push({nodeType:g_,value:t,unit:e})}else r.type===p_&&i.push({nodeType:y_,value:r.value})}for(;i.length>1;)i.push(n(i));return i[0]}function F_(t){const e=function(t){const e=t.replace(/calc\(/g,"(").trim(),n=[],i=e.length;for(let a=0;a<i;a++){const i=e[a],s=i.charCodeAt(0);if("("===i||")"===i)n.push({value:i,type:c_});else if("*"===i||"/"===i)n.push({value:i,type:f_});else if("+"===i||"-"===i)a=r(i,a+1)-1;else if(H_(s)||O_(s))a=o(i,a+1)-1;else if(!E_(s))throw I_(t)}function r(t,r){if(r<i){const n=e[r],i=n.charCodeAt(0);if(H_(i)||O_(i))return o(t+n,r+1)}return n.push({value:t,type:f_}),r}function o(r,o){let s=o;for(;s<i;s++){const n=e[s],i=n.charCodeAt(0);if(H_(i))r+=n;else{if("."!==n){if(L_(i))return a(r,n,s+1);break}if(r.indexOf(".")>=0)throw I_(t);r+=n}}if("."===r)throw I_(t);return n.push({value:parseFloat(r),type:p_}),s}function a(t,r,o){let a=o;for(;a<i;a++){const t=e[a];if(!L_(t.charCodeAt(0)))break;r+=t}return n.push({value:parseFloat(t),unit:r,type:d_}),a}return n}(t);return W_(e,t)}function z_(t,e){if(t.nodeType===v_){const n=z_(t.left,e),i=z_(t.right,e);switch(t.op.value){case"+":return n+i;case"-":return n-i;case"*":return n*i;case"/":return n/i;default:throw new Error(`calc error. unknown operator: ${t.op.value}`)}}else if(t.nodeType===g_)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===y_)return t.value;throw new Error("calc error.")}function j_(t,e){return z_(F_(t),e)}function N_(t,e){return"string"==typeof t?j_(t.trim(),e):t-0}function G_(t,e){const{dataSourceEventIds:n}=t.internalProps;n&&n.forEach((e=>t.internalProps.handler.off(e))),e(t),t.internalProps.dataSourceEventIds=[t.internalProps.handler.on(t.internalProps.dataSource,Zx.EVENT_TYPE.CHANGE_ORDER,(()=>{t.dataSource.enableHierarchyState&&t.refreshRowColCount(),t.invalidate()}))]}function U_(t,e=[]){G_(t,(()=>{const n=e;t.internalProps.records=e;const i=t.internalProps.dataSource=Jx.ofArray(n,t.pagerConf,t.options.hierarchyExpandLevel??(t.hasHierarchyTreeHeader?.()?1:void 0));t.addDisposable(i)}))}function K_(t,e){G_(t,(()=>{if(e)if(e instanceof Zx)t.internalProps.dataSource=e;else{const n=t.internalProps.dataSource=new Jx(e);t.addDisposable(n)}else t.internalProps.dataSource=Zx.EMPTY;t.internalProps.records=null}))}function V_(t,e){return Math.round(N_(e,t.internalProps.calcWidthContext))}function Y_(t,e){return t?t.min&&t.min>e?t.min:t.max&&t.max<e?t.max:e:e}function X_(t){return Boolean(t&&"string"==typeof t&&"auto"===t.toLowerCase())}function $_(t,e,n,i,r,o=!0){const a=u_(r("padding",t,n,i,e)),s=r("bgColor",t,n,i,e),l=r("font",t,n,i,e);let h,u,c;if(l){const{family:t,size:e,weight:n}=function(t){return h_(t)}(l);h=t.join(" "),u=e,c=n}else h=r("fontFamily",t,n,i,e),u=r("fontSize",t,n,i,e),c=r("fontWeight",t,n,i,e);const d=r("textAlign",t,n,i,e),f=r("textBaseline",t,n,i,e),p=r("color",t,n,i,e),g=r("lineHeight",t,n,i,e),v=r("underline",t,n,i,e),y=r("lineThrough",t,n,i,e),m=Math.max(1,Math.floor(u/10)),b=r("textOverflow",t,n,i,e),w=r("borderColor",t,n,i,e),C=r("borderLineWidth",t,n,i,e),x=r("borderLineDash",t,n,i,e),_=r("marked",t,n,i,e),S=r("cursor",t,n,i,e),k=!(a&&s&&l&&d&&f&&p&&b&&w&&C&&x&&"boolean"==typeof v&&"boolean"==typeof y&&"boolean"==typeof _);if(!o)return{hasFunctionPros:k};const A={text:{fontFamily:h,fontSize:u,fontWeight:c,fill:p,textAlign:d,textBaseline:f,lineHeight:g??u,underline:v?m:void 0,lineThrough:y?m:void 0,ellipsis:b&&"clip"!==b?"ellipsis"===b?"...":b:void 0},group:{fill:s,lineDash:x,lineWidth:C,stroke:w,cursor:"auto"===S||"default"===S?void 0:S},_vtable:{padding:a,marked:_}};if(Array.isArray(C)&&(A.group.strokeArrayWidth=u_(C)),Array.isArray(w)){const t=u_(w);A.group.stroke=!t.every((t=>!t))&&t,A.group.strokeArrayColor=u_(w)}return{theme:A,hasFunctionPros:k}}function q_(t,e,n,i,r,o,a,l,h,u,c,d,f,p,g,v,y){p&&(y=Z_(t,r,o,y));const m=t._getCellStyle(r,o),b=Mx("padding",m,r,o,t);k(b)&&(u=b),y?.text?.textAlign&&(c=y?.text?.textAlign),y?.text?.textBaseline&&(d=y?.text?.textBaseline);const{autoRowHeight:C}=t.internalProps,x="auto"===a,_=m.autoWrapText??t.internalProps.autoWrapText,S=m.lineClamp,A=new Rx({x:n,y:i,width:l,height:h,lineWidth:y?.group?.lineWidth??void 0,fill:y?.group?.fill??void 0,stroke:y?.group?.stroke??void 0,strokeArrayWidth:y?.group?.strokeArrayWidth??void 0,strokeArrayColor:y?.group?.strokeArrayColor??void 0,cursor:y?.group?.cursor??void 0,lineCap:"square",clip:!0});if(A.role="cell",A.col=r,A.row=o,e.addChild(A),g&&A.appendChild(g),v){const e=t.getCellValue(r,o);let n;if(f&&(n=t.getCellIcons(r,o)),function(t,e,n,i,r,o,a,l,h,u,c,d,f,p){const g=[],v=[],y=[],m=[],b=[],C=[],x=[],_=[];let S,k,A=0,R=0,B=0,T=0,M=0,P=0;if(Array.isArray(e)&&0!==e.length){let E;if(e.forEach((t=>{switch(t.positionType){case s.left:g.push(t);break;case s.right:v.push(t);break;case s.contentLeft:y.push(t);break;case s.contentRight:m.push(t);break;case s.absoluteRight:_.push(t);break;case s.inlineFront:b.push(t);break;case s.inlineEnd:C.push(t)}})),g.forEach((e=>{const n=Nx(e,void 0,t.col,t.row,f);n.role="icon-left",n.name=e.name,n.setAttribute("x",A+(n.attribute.marginLeft??0)),A+=n.AABBBounds.width()+(n.attribute.marginLeft??0)+(n.attribute.marginRight??0),R=Math.max(R,n.AABBBounds.height()),t.appendChild(n)})),v.forEach((e=>{const n=Nx(e,void 0,t.col,t.row,f);n.role="icon-right",n.name=e.name,n.setAttribute("x",B+(n.attribute.marginLeft??0)),B+=n.AABBBounds.width()+(n.attribute.marginLeft??0)+(n.attribute.marginRight??0),T=Math.max(T,n.AABBBounds.height()),t.appendChild(n)})),x.forEach((e=>{const n=Nx(e,void 0,t.col,t.row,f);n.role="icon-absolute-left",n.name=e.name,n.setAttribute("x",M+(n.attribute.marginLeft??0)),M+=n.AABBBounds.width()+(n.attribute.marginLeft??0)+(n.attribute.marginRight??0),t.appendChild(n)})),_.forEach((e=>{const n=Nx(e,void 0,t.col,t.row,f);n.role="icon-absolute-right",n.name=e.name,n.setAttribute("x",P+(n.attribute.marginLeft??0)),P+=n.AABBBounds.width()+(n.attribute.marginLeft??0)+(n.attribute.marginRight??0),t.appendChild(n)})),0===b.length&&0===C.length){const t=w(n).replace(/\r?\n/g,"\n").replace(/\r/g,"\n").split("\n"),e={text:1!==t.length||a?t:t[0],maxLineWidth:r?1/0:h-(i[1]+i[3])-A-B,textBaseline:"top",heightLimit:o?-1:u-(i[0]+i[2]),pickable:!1,autoWrapText:a,lineClamp:l},s=new Ix(p&&p.text?Object.assign({},p.text,e):e);s.name="text",E=s}else{const e=Object.assign({text:n?.toString()},t.parent?.theme?.userTheme?.text||{});p&&p.text&&Object.assign(e,p.text),e.textBaseline="middle";const a=[...b.map((t=>Gx(t))),e,...C.map((t=>Gx(t)))];a[0].textAlign=c;const s=new pd({width:r?0:h-(i[1]+i[3])-A-B,height:o?0:u-(i[0]+i[2]),textConfig:a,verticalDirection:o?"top":d});s.name="text",E=s,s.bindIconEvent()}if(0!==y.length||0!==m.length){const e=new Fx({x:0,y:0,fill:!1,stroke:!1});e.name="content",e.setCellContentOption({autoWidth:r,autoHeight:o,cellWidth:h-(i[1]+i[3])-A-B,cellHeight:u-(i[0]+i[2]),align:c,baseline:d}),y.forEach((n=>{const i=Nx(n,void 0,t.col,t.row,f);i.role="icon-content-left",i.name=n.name,e.addLeftOccupyingIcon(i)})),m.forEach((n=>{const i=Nx(n,void 0,t.col,t.row,f);i.role="icon-content-right",i.name=n.name,e.addRightOccupyingIcon(i)})),e.addContent(E),t.appendChild(e),e.layout(),S=e.AABBBounds.width(),k=e.AABBBounds.height()}else t.firstChild?t.insertBefore(E,t.firstChild):t.appendChild(E),S=E.AABBBounds.width(),k=E.AABBBounds.height()}else{const e=w(n).replace(/\r?\n/g,"\n").replace(/\r/g,"\n").split("\n"),s=jx(t.col,t.row,f),c={text:1!==e.length||a?e:e[0],maxLineWidth:r?1/0:h-(i[1]+i[3]+s),textBaseline:"top",autoWrapText:a,lineClamp:l,heightLimit:o?-1:u-(i[0]+i[2]),pickable:!1,dx:s},d=new Ix(p&&p.text?Object.assign({},p.text,c):c);d.name="text",t.appendChild(d),S=d.AABBBounds.width(),k=d.AABBBounds.height()}const E=r?A+S+B:h-(i[1]+i[3]),H=o?Math.max(R,k,T):u-(i[0]+i[2]);t.forEachChildren((t=>{"icon-left"===t.role?t.setAttribute("x",t.attribute.x+i[3]):"icon-right"===t.role?t.setAttribute("x",t.attribute.x+E-B+i[3]):"icon-absolute-right"===t.role?t.setAttribute("x",t.attribute.x+E-P+i[3]+i[1]):"content"!==t.name&&"text"!==t.name||("center"===c&&"richtext"!==t.type?t.setAttribute("x",i[3]+A+(E-A-B)/2):"right"===c&&"richtext"!==t.type?t.setAttribute("x",i[3]+E-B):t.setAttribute("x",i[3]+A))})),t.forEachChildren((t=>{"middle"===d?t.setAttribute("y",i[0]+(H-t.AABBBounds.height())/2):"bottom"===d?t.setAttribute("y",i[0]+H-t.AABBBounds.height()):t.setAttribute("y",i[0])})),t.setAttributes({width:E+i[1]+i[3],height:H+i[0]+i[2]})}(A,n,e,u,x,C,_,"number"==typeof S?S:void 0,l,h,c,d,t,y),y?._vtable?.marked){const t=ff({x:A.attribute.width,y:0,startAngle:Math.PI/2,endAngle:Math.PI,outerRadius:6,fill:"#3073F2",pickable:!1});t.name="mark",A.appendChild(t)}}return g&&A.setAttributes({width:Math.max(A.attribute.width,g.attribute.width),height:Math.max(A.attribute.height,g.attribute.height)}),A}function Z_(t,e,n,i){const r=$_(t._getCellStyle(e,n),t,e,n,Mx).theme;for(const t in r.group)k(r.group[t])&&(i||(i={}),i.group||(i.group={}),i.group[t]=r.group[t]);for(const t in r.text)k(r.text[t])&&(i||(i={}),i.text||(i.text={}),i.text[t]=r.text[t]);for(const t in r._vtable)k(r._vtable[t])&&(i||(i={}),i._vtable||(i._vtable={}),i._vtable[t]=r._vtable[t]);return i}const J_=Ch();class Q_ extends Nh{type="chart";chartInstance;activeChartInstance;active;cacheCanvas;constructor(t){super(t),this.numberType=J_,t.chartInstance?this.chartInstance=t.chartInstance:(t.canvas.getContext("2d"),this.chartInstance=new t.ClassType(t.spec,{renderCanvas:t.canvas,mode:"desktop-browser",canvasControled:!1,viewBox:t.viewBox,interactive:!1,animation:!1}),this.chartInstance.renderSync())}activate(t){this.active=!0;const{x1:e,y1:n,x2:i,y2:r}=this.attribute.viewBox,o=t.scenegraph.tableGroup.globalAABBBounds,a=new oe;a.x1=o.x1+t.getFrozenColsWidth(),a.x2=o.x2,a.y1=o.y1+t.getFrozenRowsHeight(),a.y2=o.y2;const s=a.intersect({x1:e-t.scrollLeft,x2:i-t.scrollLeft,y1:n-t.scrollTop,y2:r-t.scrollTop});this.activeChartInstance=new this.attribute.ClassType(this.attribute.spec,{renderCanvas:this.attribute.canvas,mode:"desktop-browser",canvasControled:!1,viewBox:{x1:e-t.scrollLeft,x2:i-t.scrollLeft,y1:n-t.scrollTop,y2:r-t.scrollTop},animation:!1,interactive:!0,beforeRender:t=>{const e=t.window.getContext();e.inuse=!0,e.clearMatrix(),e.setTransformForCurrent(!0),e.beginPath(),e.rect(s.x1,s.y1,s.x2-s.x1,s.y2-s.y1),e.clip()},afterRender(t){t.window.getContext().inuse=!1}}),this.activeChartInstance.renderSync()}deactivate(){this.active=!1,this.activeChartInstance.release(),this.activeChartInstance=null}}const tS={},eS={};function nS(t,e,n,i,r,o,a,s,l,h,u,c,d,f){const p=nt(eS,tS)[u],g=Z_(f,r,o),v=Mx("padding",f._getCellStyle(r,o),r,o,f);k(v)&&(l=v),t||((t=new Rx({x:n,y:i,width:a,height:s,lineWidth:g?.group?.lineWidth??void 0,fill:g?.group?.fill??void 0,stroke:g?.group?.stroke??void 0,strokeArrayWidth:g?.group?.strokeArrayWidth??void 0,strokeArrayColor:g?.group?.strokeArrayColor??void 0,cursor:g?.group?.cursor??void 0,lineCap:"square",clip:!0})).role="cell",t.col=r,t.row=o,e.addChild(t)),t.AABBBounds.width();const y=new Q_({stroke:!1,x:l[3],y:l[0],canvas:f.canvas,spec:c,ClassType:p,width:a-l[3]-l[1],height:s-l[2]-l[0],chartInstance:d,dataId:"data",data:f.getCellValue(r,o),cellPadding:l,viewBox:{x1:Math.ceil(t.globalAABBBounds.x1+l[3]+f.scrollLeft),x2:Math.ceil(t.globalAABBBounds.x1+a-l[1]+f.scrollLeft),y1:Math.ceil(t.globalAABBBounds.y1+l[0]+f.scrollTop),y2:Math.ceil(t.globalAABBBounds.y1+s-l[2]+f.scrollTop)}});return t.appendChild(y),e.setAttribute("chartInstance",y.chartInstance),t}const iS={};class rS{static cache=new Map;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}}const oS={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:l.sort,name:"sort_downward",positionType:s.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:l.sort,positionType:s.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:l.sort,positionType:s.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:l.frozen,positionType:s.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:l.frozen,positionType:s.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:l.frozen,positionType:s.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:l.dropDown,positionType:s.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:l.play,positionType:s.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:l.damagePic,positionType:s.left,name:"damage_pic",marginRight:0,hover:{width:24,height:24,bgColor:"rgba(101, 117, 168, 0.1)"},cursor:"pointer"}},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:l.expand,name:"expand",positionType:s.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:l.collapse,name:"collapse",positionType:s.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:s.absolute,funcType:l.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"><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:s.absolute,funcType:l.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"><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"}}};function aS(){return nt(oS,iS)}function sS(t,e,n,i){let r=t,o=e;return r>n&&(r=n,o=r*e/t),o>i&&(o=i,r=o*t/e),{width:r,height:o}}function lS(t,e,n,i,r,o,a="left",s="middle",l=[0,0,0,0],h=0,u=0,c=0,d=0){const f=t+n,p=e+i;let g=t+l[3]+h;"right"===a||"end"===a?g=f-r-l[1]-u:"center"===a&&(g=t+(n-r+h-u)/2);let v=e+l[0]+c;return"bottom"===s||"alphabetic"===s||"ideographic"===s?v=p-o-l[2]-d:"middle"===s&&(v=e+(i-o+c-d)/2),{x:g,y:v}}const hS=aS();function uS(t,e,n,i,r,o){let a=!1,s=null,l=null;return r.table.getColWidth(t)<n+o[1]+o[3]&&(s=n+o[1]+o[3],a=!0),r.table.getRowHeight(e)<i+o[2]+o[0]&&(l=i+o[2]+o[0],a=!0),!!a&&("number"==typeof s&&r.setColWidth(t,s),"number"==typeof l&&r.setRowHeight(e,l),r.component.updateScrollBar(),!0)}function cS(t,e,n,i){const r=t.getChildByName("image"),o="string"!=typeof r.attribute.image&&r.attribute.image||r.resources.get(r.attribute.image).data;if(!o)return;const a=i._getCellStyle(e,n),s=Bx("textAlign",a,e,n,i)??"left",l=Bx("textBaseline",a,e,n,i)??"middle",h=u_(Bx("padding",a,e,n,i))??[0,0,0,0];if(r.keepAspectRatio){const{width:e,height:n}=sS(o.width||o.videoWidth,o.height||o.videoHeight,t.attribute.width-(h[1]+h[3]),t.attribute.height-(h[0]+h[2])),i=lS(0,0,t.attribute.width,t.attribute.height,e,n,s,l,h);r.setAttributes({x:i.x,y:i.y,width:e,height:n})}else r.setAttributes({x:h[3],y:h[0],width:t.attribute.width-h[1]-h[3],height:t.attribute.height-h[0]-h[2]});const u=t.getChildByName("play-icon");if(u){const e=0,n=0,i=t.attribute.width,o=t.attribute.height,a=Math.floor(Math.min(i-h[1]-h[3],o-h[2]-h[0])/2),s=e+(i>r.attribute.width?r.attribute.x-e+r.attribute.width/2:i/2),l=n+(o>r.attribute.height?r.attribute.y-n+r.attribute.height/2:o/2);u.setAttributes({x:s-a/2,y:l-a/2,width:a,height:a})}}function dS(t,e,n,i,r,o,a,s,l){t.dependField&&(r=l.getCellOriginRecord(o,a)?.[t.dependField]??r),t.barType=t.barType??"default",t.min=t.min??0,t.max=t.max??t.min+100;const h=l.getRowHeight(a);let u=n,c=h;const d=new Rx({x:0,y:0,width:u,height:c});d.name="progress-bar";const{showBar:f,barColor:p,barBgColor:g,barPositiveColor:v,barNegativeColor:y,barAxisColor:m,barRightToLeft:b,showBarMark:w,barMarkPositiveColor:C,barMarkNegativeColor:x,barMarkWidth:_,barMarkPosition:S}=e;let{barHeight:k,barBottom:A,barPadding:R}=e;1===R.length?R=[R[0],R[0],R[0],R[0]]:2===R.length?R=[R[0],R[1],R[0],R[1]]:3===R.length&&(R=[R[0],R[1],R[2],R[1]]),R=R.map(((t,e)=>{if("string"==typeof t&&dt.endsWith(t,"%")){const i=Number(t.substr(0,t.length-1));return 0===e||2===e?h*i/100:n*i/100}return Number(t)}));const B=u,T=c,M=u_(Bx("borderLineWidth",e,o,a,l));let P=Math.max(R[0],M[0]);const E=Math.max(R[1],M[1]),H=Math.max(R[2],M[2]);let O=Math.max(R[3],M[3]);u-=E+O,c-=H+P,1&P&&(P+=.5),1&O&&(O+=.5),"string"==typeof k&&dt.endsWith(k,"%")?(k=Number(k.substr(0,k.length-1)),k=c*k/100):k=Number(k),"string"==typeof A&&dt.endsWith(A,"%")?(A=Number(A.substr(0,A.length-1)),A=c*A/100):A=Number(A);if(ot(f,{col:o,row:a,table:l,context:null,value:i,dataValue:r})){let e=`${r}`;dt.endsWith(e,"%")&&(e=e.substr(0,e.length-1));const s=Number(e);if(isNaN(s))return d;if("default"===(t.barType??"default")){const e=s<t.min?0:s>t.max?1:(s-t.min)/(t.max-t.min),n=u,h=P+c-k-A,f=0+O,v=ot(g,{col:o,row:a,table:l,context:null,value:i,dataValue:r,percentile:e});if(v){const t=yf({x:f,y:h,width:n,height:k,fill:v});d.addChild(t)}const y=yf({x:f,y:h,width:Math.min(n*e,n),height:k,fill:ot(p,{col:o,row:a,table:l,context:null,value:i,dataValue:r,percentile:e})||"#20a8d8"});d.addChild(y)}else if("negative"===t.barType){const e=t.min<0?-t.min:0,n=t.max>0?t.max:0,f=e/(e+n),p=1-f,R=s>0?s/n:0,B=s<0?-s/e:0,T=u,M=P+c-k-A,E=0+O,H=ot(g,{col:o,row:a,table:l,context:null,value:i,dataValue:r,percentile:R});if(H){const t=yf({x:E,y:M,width:T,height:k,fill:H});d.addChild(t)}const L=b?p*T:f*T,I=Math.min(T*f*B,T),D=b?{left:E+L,top:M,width:I,height:k}:{left:E+L-I,top:M,width:I,height:k},W=ot(y,{col:o,row:a,table:l,context:null,value:i,dataValue:r,percentile:B})||"#20a8d8",F=yf({x:D.left,y:D.top,width:D.width,height:D.height,fill:W});d.addChild(F);const z=Math.min(T*p*R,T),j=b?{left:E+L-z,top:M,width:z,height:k}:{left:E+L,top:M,width:z,height:k},N=ot(v,{col:o,row:a,table:l,context:null,value:i,dataValue:r,percentile:R})||"#20a8d8",G=yf({x:j.left,y:j.top,width:j.width,height:j.height,fill:N});d.addChild(G);const U=b?D.left:j.left,K=vf({x:0,y:0,stroke:ot(m),lineWidth:1,lineDash:[2,2],points:[{x:U,y:0},{x:U,y:h}]});if(d.addChild(K),w&&(R||B)){const t=_,e=[];let n;if(R>0)if(n=ot(C,{col:o,row:a,table:l,context:null,value:i,dataValue:r,percentile:R})||"#20a8d8","right"===S){const t=b?j.left+_/2:j.left+j.width-_/2;e.push({x:t,y:j.top}),e.push({x:t,y:j.top+j.height})}else"bottom"===S&&(e.push({x:j.left,y:j.top+j.height-_/2}),e.push({x:j.left+j.width,y:j.top+j.height-_/2}));else if(B>0)if(n=ot(x,{col:o,row:a,table:l,context:null,value:i,dataValue:r,percentile:B})||"#20a8d8","right"===S){const t=b?D.left+D.width-_/2:D.left+_/2;e.push({x:t,y:D.top}),e.push({x:t,y:D.top+D.height})}else"bottom"===S&&(e.push({x:D.left,y:D.top+D.height-_/2}),e.push({x:D.left+D.width,y:D.top+D.height-_/2}));const s=vf({x:0,y:0,stroke:n,lineWidth:t,points:e});d.addChild(s)}}else if("negative_no_axis"===t.barType){const e=t.min<0?-t.min:0,h=t.max>0?t.max:0,u=Math.max(e,h),c=0===u?0:Math.abs(s)/u,f=n-O-E-1,p=Math.min(f*c,f),m=T-H-k-A-1,R=b?B-E-p:0+O,M=ot(g,{col:o,row:a,table:l,context:null,value:i,dataValue:r,percentile:c});if(M){const t=yf({x:R,y:m,width:f,height:k,fill:M});d.addChild(t)}const P={left:R,top:m,width:p,height:k};let L;L=s>=0?ot(v,{col:o,row:a,table:l,context:null,value:i,percentile:c,dataValue:r})||"#20a8d8":ot(y,{col:o,row:a,table:l,context:null,value:i,dataValue:r,percentile:c})||"#20a8d8";const I=yf({x:P.left,y:P.top,width:P.width,height:P.height,fill:L});if(d.addChild(I),w&&s){const t=_,e=[];let n;if(n=s>=0?ot(C,{col:o,row:a,table:l,context:null,value:i,dataValue:r,percentile:c})||"#20a8d8":ot(x,{col:o,row:a,table:l,context:null,value:i,dataValue:r,percentile:c})||"#20a8d8","right"===S){const t=b?P.left+_/2:P.left+P.width-_/2;e.push({x:t,y:P.top}),e.push({x:t,y:P.top+P.height})}else"bottom"===S&&(e.push({x:P.left,y:P.top+P.height-_/2}),e.push({x:P.left+P.width,y:P.top+P.height-_/2}));const h=vf({x:0,y:0,stroke:n,lineWidth:t,points:e});d.addChild(h)}}}return d}var fS;!function(t){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"}(fS||(fS={}));var pS=function(){function t(){Qt(this,t)}return Jt(t,[{key:"_calculateRange",value:function(t){if(this._wholeRange)return this._wholeRange;if(this._rangeFactor&&2===t.length){var e=(t[1]-t[0])/(this._rangeFactor[1]-this._rangeFactor[0]),n=t[0]-e*this._rangeFactor[0],i=n,r=e+n;return this._wholeRange=[i,r],this._wholeRange}return t}},{key:"calculateVisibleDomain",value:function(t){return this._rangeFactor&&2===t.length?[this.invert(t[0]),this.invert(t[1])]:this.domain()}},{key:"rangeFactor",value:function(t,e){return t?(2===t.length&&t.every((function(t){return t>=0&&t<=1}))&&(this._wholeRange=null,this._rangeFactor=t),this):this._rangeFactor}},{key:"unknown",value:function(t){return arguments.length?(this._unknown=t,this):this._unknown}}]),t}();function gS(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return vS(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return vS(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var i=0,r=function(){};return{s:r,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function vS(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}function yS(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=re(t);if(e){var r=re(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return ie(this,n)}}var mS=Symbol("implicit");function bS(t){return t}function wS(t,e){if(t=Number(t),e=Number(e),e-=t)return function(n){return(n-t)/e};var n=Number.isNaN(e)?NaN:.5;return function(){return n}}function CS(t,e,n){var i,r,o=t[0],a=t[1],s=e[0],l=e[1];return a<o?(i=wS(a,o),r=n(l,s)):(i=wS(o,a),r=n(s,l)),function(t){return r(i(t))}}function xS(t,e,n){var i=Math.min(t.length,e.length)-1,r=new Array(i),o=new Array(i),a=-1;for(t[i]<t[0]&&(t=t.slice().reverse(),e=e.slice().reverse());++a<i;)r[a]=wS(t[a],t[a+1]),o[a]=n(e[a],e[a+1]);return function(e){var n=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3?arguments[3]:void 0;for(Pt(i)&&(i=t.length);n<i;){var r=n+i>>>1;Ft(t[r],e)>0?i=r:n=r+1}return n}(t,e,1,i)-1;return o[n](r[n](e))}}function _S(t,e,n,i){var r,o,a=[];if(e=Math.floor(+e),t=Math.floor(+t),!(n=Math.floor(+n)))return[];if(t===e)return[t];if(r=e<t){var s=t;t=e,e=s}var l=Yt(1,e-t+1)(n);if(o=Math.floor((e-t+1)/l),!i)for(;Math.ceil((e-t+1)/o)>n&&l>1;)l-=1,o=Math.floor((e-t)/l);for(var h=t;h<=e;)a.push(h),h+=o;return r&&a.reverse(),a}function SS(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=re(t);if(e){var r=re(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return ie(this,n)}}var kS=function(t){ee(n,t);var e=SS(n);function n(t){var i;return Qt(this,n),(i=e.call(this)).type=fS.Band,i._range=[0,1],i._step=void 0,i._bandwidth=void 0,i._round=!1,i._paddingInner=0,i._paddingOuter=0,i._align=.5,i._unknown=void 0,delete i.unknown,i.rescale(t),i}return Jt(n,[{key:"rescale",value:function(t){var e=this;if(t)return this;this._wholeRange=null;var i=this._calculateRange(this._range),r=Yo(re(n.prototype),"domain",this).call(this).length,o=i[1]<i[0],a=i[Number(o)-0],s=i[1-Number(o)],l=function(t,e,n){var i;return i=1===t?t+2*n:t-e+2*n,t?i>0?i:1:0}(r,this._paddingInner,this._paddingOuter);this._step=(s-a)/Math.max(1,l||1),this._round&&(this._step=Math.floor(this._step)),a+=(s-a-this._step*(r-this._paddingInner))*this._align,this._bandwidth=this._step*(1-this._paddingInner),this._round&&(a=Math.round(a),this._bandwidth=Math.round(this._bandwidth));var h=function(t,e,n){Et(e)||(e=t,t=0),Et(n)||(n=1);for(var i=-1,r=0|Math.max(0,Math.ceil((e-t)/n)),o=new Array(r);++i<r;)o[i]=t+i*n;return o}(r).map((function(t){return a+e._step*t}));return Yo(re(n.prototype),"range",this).call(this,o?h.reverse():h),this}},{key:"calculateVisibleDomain",value:function(t){var e=this.domain();if(this._rangeFactor&&e.length){var n=this._getInvertIndex(t[0]),i=this._getInvertIndex(t[1]);return e.slice(Math.min(n,i),Math.max(n,i)+1)}return e}},{key:"domain",value:function(t,e){return t?(Yo(re(n.prototype),"domain",this).call(this,t),this.rescale(e)):Yo(re(n.prototype),"domain",this).call(this)}},{key:"range",value:function(t,e){return t?(this._range=[zt(t[0]),zt(t[1])],this.rescale(e)):this._range.slice()}},{key:"rangeRound",value:function(t,e){return this._range=[zt(t[0]),zt(t[1])],this._round=!0,this.rescale(e)}},{key:"ticks",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10,e=this.calculateVisibleDomain(this._range);return-1===t?e:_S(0,e.length-1,t,!1).map((function(t){return e[t]}))}},{key:"tickData",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10;return this.ticks(e).map((function(e,n){return{index:n,tick:e,value:(t.scale(e)-t._range[0]+t._bandwidth/2)/(t._range[1]-t._range[0])}}))}},{key:"forceTicks",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10,e=this.calculateVisibleDomain(this._range);return _S(0,e.length-1,t,!0).filter((function(t){return t<e.length})).map((function(t){return e[t]}))}},{key:"stepTicks",value:function(t){var e=this.calculateVisibleDomain(this._range);return function(t,e,n){var i,r=[];if(n=Yt(1,(e=Math.floor(+e))-(t=Math.floor(+t))+1)(Math.floor(+n)),i=e<t){var o=t;t=e,e=o}for(var a=t;a<=e;)r.push(a),a+=n;return i&&r.reverse(),r}(0,e.length-1,t).map((function(t){return e[t]}))}},{key:"_getInvertIndex",value:function(t){var e=0,n=this.step()/2,i=this.bandwidth()/2,r=this._domain.length,o=this.range(),a=o[0]>o[o.length-1];for(e=0;e<r;e++){var s=this.scale(this._domain[e])+i;if(0===e&&(!a&&!Ut(t,s+n)||a&&!Kt(t,s-n)))break;if(e===r-1)break;if(!Kt(t,s-n)&&!Ut(t,s+n))break}return e>=0&&e<=r-1?e:r-1}},{key:"invert",value:function(t){return this._domain[this._getInvertIndex(t)]}},{key:"padding",value:function(t,e){return void 0!==t?(this._paddingOuter=Math.max(0,Math.min(Array.isArray(t)?Math.min.apply(null,t):t)),this._paddingInner=this._paddingOuter,this.rescale(e)):this._paddingInner}},{key:"paddingInner",value:function(t,e){return void 0!==t?(this._paddingInner=Math.max(0,Math.min(1,t)),this.rescale(e)):this._paddingInner}},{key:"paddingOuter",value:function(t,e){return void 0!==t?(this._paddingOuter=Math.max(0,Math.min(1,t)),this.rescale(e)):this._paddingOuter}},{key:"bandwidth",value:function(){return this._bandwidth}},{key:"step",value:function(){return this._step}},{key:"round",value:function(t,e){return void 0!==t?(this._round=t,this.rescale(e)):this._round}},{key:"align",value:function(t,e){return void 0!==t?(this._align=Math.max(0,Math.min(1,t)),this.rescale(e)):this._align}},{key:"rangeFactor",value:function(t,e){return t?(Yo(re(n.prototype),"rangeFactor",this).call(this,t),this.rescale(e)):Yo(re(n.prototype),"rangeFactor",this).call(this)}},{key:"clone",value:function(){return new n(!0).domain(this._domain,!0).range(this._range,!0).round(this._round,!0).paddingInner(this._paddingInner,!0).paddingOuter(this._paddingOuter,!0).align(this._align)}}]),n}(function(t){ee(n,t);var e=yS(n);function n(){var t;return Qt(this,n),(t=e.call(this)).type=fS.Ordinal,t._index=new Map,t._domain=[],t._ordinalRange=[],t._unknown=mS,t}return Jt(n,[{key:"clone",value:function(){return(new n).domain(this._domain).range(this._ordinalRange).unknown(this._unknown)}},{key:"scale",value:function(t){var e="".concat(t),n=this._index.get(e);if(!n){if(this._unknown!==mS)return this._unknown;n=this._domain.push(t),this._index.set(e,n)}return this._ordinalRange[(n-1)%this._ordinalRange.length]}},{key:"invert",value:function(t){for(var e=0;e<this._ordinalRange.length&&this._ordinalRange[e]!==t;)e++;return this._domain[(e-1)%this._domain.length]}},{key:"domain",value:function(t){if(!t)return this._domain.slice();this._domain=[],this._index=new Map;var e,n=gS(t);try{for(n.s();!(e=n.n()).done;){var i=e.value,r="".concat(i);this._index.has(r)||this._index.set(r,this._domain.push(i))}}catch(t){n.e(t)}finally{n.f()}return this}},{key:"range",value:function(t){if(!t)return this._ordinalRange.slice();var e=Array.from(t);return this._ordinalRange=e,this}}]),n}(pS)),AS=function(t,e){var n=t.r,i=e.r,r=t.g,o=e.g,a=t.b,s=e.b,l=t.opacity,h=e.opacity;return function(t){var e=Math.round(n*(1-t)+i*t),u=Math.round(r*(1-t)+o*t),c=Math.round(a*(1-t)+s*t);return new ge(e,u,c,l*(1-t)+h*t)}};function RS(t,e){var n,i=Ht(e);if(Pt(e)||"boolean"===i)return function(){return e};if("number"===i)return Xt(t,e);if("string"===i){if(n=pe.parseColorString(e)){var r=AS(pe.parseColorString(t),n);return function(t){return r(t).formatRgb()}}return Xt(Number(t),Number(e))}return e instanceof ge?AS(t,e):e instanceof pe?AS(t.color,e.color):e instanceof Date?function(t,e){var n=t.valueOf(),i=e.valueOf(),r=new Date;return function(t){return r.setTime(n*(1-t)+i*t),r}}(t,e):Xt(Number(t),Number(e))}function BS(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=re(t);if(e){var r=re(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return ie(this,n)}}var TS=function(t){ee(n,t);var e=BS(n);function n(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:bS,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:bS;return Qt(this,n),(t=e.call(this))._unknown=void 0,t.transformer=i,t.untransformer=r,t._forceAlign=!0,t._domain=[0,1],t._range=[0,1],t._clamp=bS,t._piecewise=CS,t._interpolate=RS,t}return Jt(n,[{key:"scale",value:function(t){return t=Number(t),Number.isNaN(t)?this._unknown:(this._output||(this._output=this._piecewise(this._domain.map(this.transformer),this._calculateRange(this._range),this._interpolate)),this._output(this.transformer(this._clamp(t))))}},{key:"invert",value:function(t){return this._input||(this._input=this._piecewise(this._calculateRange(this._range),this._domain.map(this.transformer),Xt)),this._clamp(this.untransformer(this._input(t)))}},{key:"domain",value:function(t,e){if(!t)return this._domain.slice();var n=Array.from(t,zt);return this._domain=n,this.rescale(e)}},{key:"range",value:function(t,e){if(!t)return this._range.slice();var n=Array.from(t);return this._range=n,this.rescale(e)}},{key:"rangeRound",value:function(t,e){var n=Array.from(t);return this._range=n,this._interpolate=$t,this.rescale(e)}},{key:"rescale",value:function(t){if(t)return this;var e=this._domain.length,n=this._range.length,i=Math.min(e,n);if(e&&e<n&&this._forceAlign){for(var r=n-e+1,o=this._domain[e-1],a=e>=2?(o-this._domain[e-2])/r:0,s=1;s<=r;s++)this._domain[e-2+s]=o-a*(r-s);i=n}return void 0===this._clamp&&(this._clamp=Yt(this._domain[0],this._domain[i-1])),this._piecewise=i>2?xS:CS,this._output=this._input=null,this._wholeRange=null,this}},{key:"clamp",value:function(t,e,n){return arguments.length?(this._clamp=e||(t?void 0:bS),this.rescale(n)):this._clamp!==bS}},{key:"interpolate",value:function(t,e){return arguments.length?(this._interpolate=t,this.rescale(e)):this._interpolate}},{key:"ticks",value:function(){return[]}},{key:"tickData",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10,n=this.ticks(e);return(null!=n?n:[]).map((function(e,n){return{index:n,tick:e,value:(t.scale(e)-t._range[0])/(t._range[1]-t._range[0])}}))}},{key:"rangeFactor",value:function(t,e){return t?(Yo(re(n.prototype),"rangeFactor",this).call(this,t),this._output=this._input=null,this):Yo(re(n.prototype),"rangeFactor",this).call(this)}},{key:"forceAlignDomainRange",value:function(t){return arguments.length?(this._forceAlign=t,this):this._forceAlign}}]),n}(pS),MS=Math.sqrt(50),PS=Math.sqrt(10),ES=Math.sqrt(2);function HS(t,e,n){var i=(e-t)/Math.max(0,n),r=Math.floor(Math.log(i)/Math.LN10),o=i/Math.pow(10,r),a=1;return o>=MS?a=10:o>=PS?a=5:o>=ES&&(a=2),r>=0?a*Math.pow(10,r):-Math.pow(10,-r)/a}function OS(t,e,n){var i;if(n=+n,(t=+t)==(e=+e)&&n>0)return[t];if(n<=0||0===(i=function(t,e,n){return(e-t)/Math.max(1,n-1)}(t,e,n))||!isFinite(i))return[];for(var r=new Array(n),o=0;o<n;o++)r[o]=t+o*i;return r}function LS(t){var e,n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10,r=0,o=t.length-1,a=t[r],s=t[o],l=10;for(s<a&&(n=a,a=s,s=n,n=r,r=o,o=n);l-- >0;){if((n=HS(a,s,i))===e)return t[r]=a,t[o]=s,t;if(n>0)a=Math.floor(a/n)*n,s=Math.ceil(s/n)*n;else{if(!(n<0))break;a=Math.ceil(a*n)/n,s=Math.floor(s*n)/n}e=n}}function IS(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=re(t);if(e){var r=re(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return ie(this,n)}}var DS=function(t){ee(n,t);var e=IS(n);function n(){var t;return Qt(this,n),(t=e.apply(this,arguments)).type=fS.Linear,t}return Jt(n,[{key:"clone",value:function(){return(new n).domain(this._domain,!0).range(this._range,!0).unknown(this._unknown).clamp(this.clamp(),null,!0).interpolate(this._interpolate)}},{key:"tickFormat",value:function(){return function(){}}},{key:"ticks",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10,e=this.calculateVisibleDomain(this._range);return function(t,e,n){var i,r,o,a,s=-1;if(e=+e,t=+t,n=+n,Math.abs(t-e)<=Number.MIN_VALUE&&n>0)return[t];if((i=e<t)&&(r=t,t=e,e=r),a=HS(t,e,n),0===e||!isFinite(a))return[];if(a>0){var l=Math.round(t/a),h=Math.round(e/a);for(l*a<t&&++l,h*a>e&&--h,o=new Array(r=h-l+1);++s<r;)o[s]=(l+s)*a}else{a=-a;var u=Math.round(t*a),c=Math.round(e*a);for(u/a<t&&++u,c/a>e&&--c,o=new Array(r=c-u+1);++s<r;)o[s]=(u+s)/a}return i&&o.reverse(),o}(e[0],e[e.length-1],t)}},{key:"forceTicks",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10,e=this.calculateVisibleDomain(this._range);return OS(e[0],e[e.length-1],t)}},{key:"stepTicks",value:function(t){var e=this.calculateVisibleDomain(this._range);return function(t,e,n){var i,r,o=-1;if(n=+n,(r=(e=+e)<(t=+t))&&(i=t,t=e,e=i),!isFinite(n)||e-t<=n)return[t];for(var a=Math.floor((e-t)/n+1),s=new Array(a);++o<a;)s[o]=t+o*n;return r&&s.reverse(),s}(e[0],e[e.length-1],t)}},{key:"nice",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10,e=LS(this.domain(),t);return e?this.domain(e):this}},{key:"niceMin",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10,e=this._domain[this._domain.length-1],n=LS(this.domain(),t);return n&&(n[n.length-1]=e,this.domain(n)),this}},{key:"niceMax",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10,e=this._domain[0],n=LS(this.domain(),t);return n&&(n[0]=e,this.domain(n)),this}}]),n}(TS);function WS(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=re(t);if(e){var r=re(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return ie(this,n)}}const FS=new(function(t){ee(n,t);var e=WS(n);function n(t){var i;return Qt(this,n),(i=e.call(this,!1)).type=fS.Point,i._padding=0,i.paddingInner(1,t),i.padding=i.paddingOuter,i.paddingInner=void 0,i.paddingOuter=void 0,i}return Jt(n)}(kS)),zS=new DS;function jS(t,e,n,i,r,o,a,s,l,h){const u=Z_(h,r,o);t||((t=new Rx({x:n,y:i,width:a,height:s,lineWidth:u?.group?.lineWidth??void 0,fill:u?.group?.fill??void 0,stroke:u?.group?.stroke??void 0,strokeArrayWidth:u?.group?.strokeArrayWidth??void 0,strokeArrayColor:u?.group?.strokeArrayColor??void 0,cursor:u?.group?.cursor??void 0,lineCap:"square",clip:!0})).role="cell",t.col=r,t.row=o,e.addChild(t));const c=function(t,e,n,i,r,o){let a,s;const l=o.internalProps.layoutMap.getBody(t,e).sparklineSpec,h=o.getCellValue(t,e);if(!Array.isArray(h))return;const u=r[3],c=r[0];n-=r[1]+r[3],i-=r[0]+r[2];const d=0,f=i;if("function"==typeof l){const r={col:t,row:e,dataValue:o.getCellOriginValue(t,e)||"",value:o.getCellValue(t,e)||"",rect:o.getCellRangeRelativeRect(o.getCellRange(t,e)),table:o};a=l(r),s=NS(a,u,c,n,i)}else a=l,s=NS(l,u,c,n,i);const p=[],g=[];let v,y;if("object"==typeof a.xField)FS.domain(a.xField.domain),v=a.xField.field;else if("string"==typeof a.xField){const t=h.map((t=>t[a.xField]));FS.domain(t),v=a.xField}else Array.isArray(h)&&(FS.domain(Array.from({length:h.length},((t,e)=>e))),v=a.xField);if(FS.range([0,n]),"object"==typeof a.yField)zS.domain(a.yField.domain),y=a.yField.field;else if("string"==typeof a.yField){const t=h.map((t=>t[a.yField]));zS.domain([Math.min(...t),Math.max(...t)]),y=a.yField}else Array.isArray(h)&&h.every((t=>"number"==typeof t))&&(zS.domain([Math.min(...h),Math.max(...h)]),y=a.yField);if(zS.range([0,i]),"object"==typeof a.xField&&Array.isArray(a.xField.domain)){const t=h.map((t=>t[a.xField.field])),e=a.xField.domain;for(let n=0;n<e.length;n++){let i=!1;for(let r=0;r<t.length;r++)if(e[n]==t[r]){const t=h[r];if(!k(t[v])||!k(t[y]))break;p.push({x:d+FS.scale(t[v]),y:f-zS.scale(t[y]),defined:k(t[y])}),g.push(t),i=!0;break}i||(p.push({x:d+FS.scale(e[n]),y:0,defined:!1}),g.push({[v]:e[n],[y]:null}))}}else for(let t=0;t<h.length;t++){const e=h[t];p.push({x:d+FS.scale(v?e[v]:t),y:f-zS.scale(y?e[y]:e),defined:k(y?e[y]:e),rawData:e}),g.push(e)}const m=s.getChildByName("sparkline-line");m&&m.setAttribute("points",p);m.bandwidth=FS.step(),m.min=zS.range()[0],m.max=zS.range()[1];const b=s.getChildByName("sparkline-symbol-group");if(b){const t="isolatedPoint"===a.pointShowRule;if("all"===a.pointShowRule)for(let t=0;t<p.length;t++){const{x:e,y:n,defined:i}=p[t];if(i){const t=bf({x:e,y:n});b.appendChild(t)}}else if(t)for(let t=0;t<p.length;t++){const{x:e,y:n,defined:i}=p[t];if(i&&(!p[t-1]||!p[t-1].defined)&&(!p[t+1]||!p[t+1].defined)){const t=bf({x:e,y:n});b.appendChild(t)}}}return s}(r,o,a,s,l,h);return c&&t.appendChild(c),t}function NS(t,e,n,i,r){let o;o="function"==typeof t?t(null):t;const a=new Rx({x:e,y:n,width:i,height:r,stroke:!1,fill:!1});if(a.name="sparkline","line"===o.type){const t=vf({x:0,y:0,curveType:o.smooth?"monotoneX":"linear",stroke:o.line?.style?.stroke??"blue",lineWidth:o.line?.style?.strokeWidth??2});t.name="sparkline-line",a.addChild(t),o.crosshair&&(t.hover=o.crosshair?.style??{stroke:"#000",interpolate:"linear"});const e=new Rx({x:0,y:0,width:i,height:r,stroke:!1,fill:!1});e.name="sparkline-symbol-group",e.setTheme({symbol:{stroke:o.point?.style?.stroke??"#000",lineWidth:o.point?.style?.strokeWidth??1,fill:o.point?.style?.fill??"#000",size:2*(o.point?.style?.size??3),symbolType:"circle"}}),a.addChild(e),e.hover=o.point?.hover??!1}return a}const GS=aS();function US(t,e,n){t.then((()=>{n(),e.scenegraph.updateNextFrame()})).catch((t=>{console.error(t)}))}function KS(t,e,n,i,r,o,a,s,l,h,u,c,d,f,p,g,v,y,m){let b;if("text"===t||"link"===t){if("link"===t){const o=n.getCellValue(i,r),a=n._getCellStyle(i,r);"link"===t&&("templateLink"in e&&e.templateLink||!("linkDetect"in e)||!e.linkDetect||Ae.test(o))&&(m?(m.text.fill=Bx("linkColor",a,i,r,n),m.group.cursor="pointer"):m={text:{fill:Bx("linkColor",a,i,r,n)},group:{cursor:"pointer"}})}if(a){const t=n.getCellOriginValue(i,r),e=a(n,t);e&&(m?m.group.fill=e:m={group:{fill:e}})}let w,C,x,_=!0;if("body"!==n.getCellType(i,r)?(C=e?.headerCustomRender,x=e?.headerCustomLayout):(C=e?.customRender||n.customRender,x=e?.customLayout),x||C){const{autoRowHeight:t}=n.internalProps,e=Dx(x,C,i,r,n.getColWidth(i),n.getRowHeight(r),!1,t,n);w=e.elementsGroup,_=e.renderDefault}b=q_(n,h,0,u,i,r,o,s,l,c,d,f,p,g,w,_,m),v&&(b.mergeCol=y.end.col,b.mergeRow=y.end.row)}else if("image"===t)b=function(t,e,n,i,r,o,a,s,l,h,u,c,d,f){f=Z_(d,i,r,f);const p=Mx("padding",d._getCellStyle(i,r),i,r,d);k(p)&&(h=p),f?.text?.textAlign&&(u=f?.text?.textAlign),f?.text?.textBaseline&&(c=f?.text?.textBaseline);const g=new Rx({x:e,y:n,width:o,height:a,lineWidth:f?.group?.lineWidth??void 0,fill:f?.group?.fill??void 0,stroke:f?.group?.stroke??void 0,strokeArrayWidth:f?.group?.strokeArrayWidth??void 0,strokeArrayColor:f?.group?.strokeArrayColor??void 0,cursor:f?.group?.cursor??void 0,lineCap:"square",clip:!0});g.role="cell",g.col=i,g.row=r,t.addChild(g);const v=d.getCellValue(i,r),y=wf({x:h[3],y:h[0],width:o-h[1]-h[3],height:a-h[0]-h[2],image:v??hS.damage_pic.svg,cursor:"pointer"});return y.name="image",y.keepAspectRatio=s,y.successCallback=s||l?()=>{const t=y.resources.get(y.attribute.image).data;if(l&&uS(i,r,t.width,t.height,d.scenegraph,h),s){const{width:e,height:n}=sS(t.width,t.height,g.attribute.width-h[1]-h[3],g.attribute.height-h[0]-h[2]),i=lS(0,0,g.attribute.width,g.attribute.height,e,n,u,c,h);y.setAttributes({x:i.x,y:i.y,width:e,height:n})}d.scenegraph.updateNextFrame()}:()=>{cS(g,i,r,d)},y.failCallback=()=>{const t=aS();y.image=t.damage_pic.svg},g.appendChild(y),g}(h,0,u,i,r,n.getColWidth(i),n.getRowHeight(r),e.keepAspectRatio,e.imageAutoSizing,c,d,f,n,m);else if("video"===t)b=function(t,e,n,i,r,o,a,s,l,h,u,c,d,f){f=Z_(d,i,r,f);const p=Mx("padding",d._getCellStyle(i,r),i,r,d);k(p)&&(h=p),f?.text?.textAlign&&(u=f?.text?.textAlign),f?.text?.textBaseline&&(c=f?.text?.textBaseline);const g=new Rx({x:e,y:n,width:o,height:a,lineWidth:f?.group?.lineWidth??void 0,fill:f?.group?.fill??void 0,stroke:f?.group?.stroke??void 0,strokeArrayWidth:f?.group?.strokeArrayWidth??void 0,strokeArrayColor:f?.group?.strokeArrayColor??void 0,cursor:f?.group?.cursor??void 0,lineCap:"square",clip:!0});g.role="cell",g.col=i,g.row=r,t.addChild(g);const v=d.getCellValue(i,r),y=document.createElement("video");y.addEventListener("loadeddata",(()=>{l&&uS(i,r,y.videoWidth,y.videoHeight,d.scenegraph,h);const t=g.attribute.width,e=g.attribute.height;if(s){const{width:n,height:i}=sS(y.videoWidth,y.videoHeight,t-h[1]-h[3],e-h[0]-h[2]),r=lS(0,0,t,e,n,i,u,c,h);m.setAttributes({width:n,height:i,x:r.x,y:r.y})}else m.setAttributes({x:h[3],y:h[0],width:t-h[1]-h[3],height:e-h[2]-h[0]});const n=Math.floor(Math.min(t-h[1]-h[3],e-h[2]-h[0])/2),o=0+(t>m.attribute.width?m.attribute.x-0+m.attribute.width/2:t/2),a=0+(e>m.attribute.height?m.attribute.y-0+m.attribute.height/2:e/2),f=new Px({x:o-n/2,y:a-n/2,width:n,height:n,image:GS.play.svg,cursor:GS.play.cursor});f.name="play-icon",g.appendChild(f),d.scenegraph.updateNextFrame()})),y.onerror=()=>{m.image=GS.damage_pic.svg},y.src=v,y.setAttribute("preload","auto");const m=wf({x:h[3],y:h[0],width:o-h[1]-h[3],height:a-h[2]-h[0],image:y,cursor:"pointer"});return m.name="image",g.appendChild(m),g}(h,0,u,i,r,n.getColWidth(i),n.getRowHeight(r),e.keepAspectRatio,e.imageAutoSizing,c,d,f,n,m);else if("chart"===t)b=nS(null,h,0,u,i,r,n.getColWidth(i),n.getRowHeight(r),c,n.getCellValue(i,r),e.chartType,e.chartSpec,h.attribute.chartInstance,n);else if("progressbar"===t){const t=n._getCellStyle(i,r),a=n.getCellValue(i,r),p=n.getCellOriginValue(i,r);b=q_(n,h,0,u,i,r,o,s,l,c,d,f,!1,!0,null,!0,m);const g=dS(e,t,o,a,p,i,r,0,n);b.insertBefore(g,b.firstChild)}else"sparkline"===t&&(b=jS(null,h,0,u,i,r,s,l,c,n));return b}function VS(t,e,n,i){const r=n.scenegraph.getCell(t,e,!0),o=n.isHeader(t,e)?n._getHeaderLayoutMap(t,e).headerType:n.getBodyColumnType(t,e),a=n.getCellType(t,e),s="body"!==a?n.getHeaderDefine(t,e):n.getBodyColumnDefine(t,e);let l,h,u;if(("body"!==a||s?.mergeCell)&&(h=n.getCellRange(t,e),l=h.start.col!==h.end.col||h.start.row!==h.end.row),!l||t===h.start.col&&e===h.start.row){const c="body"!==a||(!!s?.icon||!!s?.tree),d=$_(n._getCellStyle(t,e),n,t,e,Bx).theme,f=d._vtable.padding,p=d._vtable.textAlign,g=d._vtable.textBaseline;let v,y,m,b,w;n.internalProps?.dataConfig?.mappingRules&&"body"===a&&n.internalProps?.dataConfig?.mappingRules?.forEach(((t,e)=>{t.bgColor&&(v=t.bgColor.mapping)})),"body"!==a?(y=s?.headerCustomRender,m=s?.headerCustomLayout):(y=s?.customRender||n.customRender,m=s?.customLayout),h?(b=n.getColsWidth(h.start.col,h.end.col),w=n.getRowsHeight(h.start.row,h.end.row)):(b=n.getColWidth(t),w=n.getRowHeight(e));const C=n.getCellValue(t,e);at(C)?(r.removeAllChild(),US(C,n,YS.bind(null,o,s,n,t,e,v,y,m,b,w,r,f,p,g,c,l,h,i,d))):u=YS(o,s,n,t,e,v,b,w,r,f,p,g,c,l,h,i,d)}else u=new Rx({x:0,y:i?0:r.attribute.y,width:0,height:0,visible:!1,pickable:!1}),u.role="shadow-cell",u.col=t,u.row=e,u.mergeCol=h.start.col,u.mergeRow=h.start.row,i||(r.parent.insertAfter(u,r),r.parent.removeChild(r));return u}function YS(t,e,n,i,r,o,a,s,l,h,u,c,d,f,p,g,v){const y=KS(t,e,n,i,r,n.getColWidth(i),o,a,s,g?n.scenegraph.getColGroup(i):l.parent,g?0:l.attribute.y,h,u,c,d,!1,f,p,v);return g||(l.parent.insertAfter(y,l),l.parent.removeChild(l)),y}function XS(t,e,n,i,r,o,a,s,l,h){let u,c,d,f=0,p=!1;const g=(s.isListTable()&&!s.scenegraph.transpose||s.isPivotTable()&&s.internalProps.layoutMap.indicatorsAsCol)&&"body"===l;if(g)if(t.childrenCount){if(t.theme){const n=s._getCellStyle(e,s.columnHeaderLevelCount),{hasFunctionPros:i}=$_(n,s,e,s.columnHeaderLevelCount,Tx,!1);p=i;const r=t.theme.userTheme;r._vtable.padding&&(u=r._vtable.padding),r.text.textAlign&&(c=r.text.textAlign),r.text.textBaseline&&(d=r.text.textBaseline)}}else{const{theme:i,hasFunctionPros:r}=function(t,e,n){const i=n._getCellStyle(t,n.columnHeaderLevelCount),{theme:r,hasFunctionPros:o}=$_(i,n,t,n.columnHeaderLevelCount,Tx);return r.group.width=e,r.group.height=0,{theme:r,hasFunctionPros:o}}(e,n,s);p=r,i._vtable.padding&&(u=i._vtable.padding),i.text.textAlign&&(c=i.text.textAlign),i.text.textBaseline&&(d=i.text.textBaseline),t.setTheme(i)}let v;s.internalProps?.dataConfig?.mappingRules&&"body"===l&&s.internalProps?.dataConfig?.mappingRules?.forEach(((t,e)=>{t.bgColor&&(v=t.bgColor.mapping)}));let y=0;t.colHeight&&(y=t.colHeight);for(let m=i;m<=r;m++){const i=m,r="body"!==l?s.getHeaderDefine(e,i):s.getBodyColumnDefine(e,i),b="body"!==l||(!!r?.icon||!!r?.tree);let w;if(!g){w=$_(s._getCellStyle(e,i),s,e,i,Bx).theme,w.group.width=n,w.group.height=Array.isArray(a)?a[i]:a,w._vtable.padding&&(u=w._vtable.padding),w.text.textAlign&&(c=w.text.textAlign),w.text.textBaseline&&(d=w.text.textBaseline)}let C=n,x=s.internalProps.autoRowHeight?0:s.getRowHeight(i);const _=(s.isHeader(e,i)?s._getHeaderLayoutMap(e,i).headerType:s.getBodyColumnType(e,i))||"text";let S,k,A;if(("body"!==l||r?.mergeCell)&&(k=s.getCellRange(e,i),A=k.start.col!==k.end.col||k.start.row!==k.end.row,A&&(C=0,x=0,S=o.get(`${k.start.col},${k.start.row};${k.end.col},${k.end.row}`),!S))){for(let t=k.start.col;t<=k.end.col;t++)C+=s.getColWidth(t);for(let t=k.start.row;t<=k.end.row;t++)x+=s.getRowHeight(t);o.set(`${k.start.col},${k.start.row};${k.end.col},${k.end.row}`,{x:0,y:y,cellWidth:C,cellHeight:x})}if(S){const n=S.cellHeight/(k.end.row-k.start.row+1),r=new Rx({x:0,y:y,width:0,height:n,visible:!1,pickable:!1});r.role="shadow-cell",r.col=e,r.row=i,r.mergeCol=k.start.col,r.mergeRow=k.start.row,t.addChild(r),t.updateColumnRowNumber(i),t.updateColumnHeight(n),k=s.getCellRange(e,i),y+=n,f=Math.max(f,S.cellWidth)}else{const o=s.getCellValue(e,i);if(at(o)){US(o,s,KS.bind(null,_,r,s,e,i,n,v,C,x,t,y,u,c,d,b,p,A,k,w)),t.updateColumnRowNumber(i);const a=A?s.getRowHeight(i)/(k.end.row-k.start.row+1):s.getRowHeight(i);t.updateColumnHeight(a),y+=a}else{const o=KS(_,r,s,e,i,n,v,C,x,t,y,u,c,d,b,p,A,k,w);t.updateColumnRowNumber(i);const a=A?o.attribute.height/(k.end.row-k.start.row+1):o.attribute.height;t.updateColumnHeight(a),y+=a}}if(h&&i>h)break}return t.setAttribute("width",n),{width:n,height:y}}function $S(t,e,n,i,r,o,a,s,l,h){if(i>r||o>a)return;const{layoutMap:u,defaultRowHeight:c,defaultHeaderRowHeight:d,defaultColWidth:f}=l.internalProps;let p=0,g=0;for(let u=i;u<=r;u++){const i=u,r=l.getColWidth(i),f=new Rx({x:e+p,y:n,width:r,height:0,clip:!1,pickable:!1});f.role="column",f.col=u,t.addChild(f);const{width:v,height:y}=XS(f,i,r,o,a,l.scenegraph.mergeMap,"columnHeader"===s?d??c:c,l,s,h);p+=v,g=Math.max(g,y)}t.setAttribute("width",p),t.setAttribute("height",g)}function qS(t,e,n,i,r,o,a){let s,l;const h=zx(t.table,n,i);if(h&&h.end.col-h.start.col&&h.start.col===n){const e=t.getCell(h.start.col,h.start.row),n=e.attribute.height;e.setAttribute("height",n+o),s=e,l=e.attribute.height}else h?(e.setAttribute("height",r+o),s=e,l=r+o):h||(e.setAttribute("height",r+o),s=e,l=r+o);s&&JS(t,s,n,i,l,o)}function ZS(t,e,n,i,r,o,a){let s;const l=zx(t.table,n,i);if(l&&l.end.row-l.start.row){if(e=t.getCell(l.start.col,l.start.row),i===l.start.row)return void(e._tempHeight=r);if(i!==l.end.row)return void(e._tempHeight+=r);e.setAttribute("height",e._tempHeight+r),s=e,r=e.attribute.height}else l?((e=t.getCell(l.start.col,l.start.row)).setAttribute("height",r),s=e):(e.setAttribute("height",r),s=e);JS(t,s,n,i,r,0)}function JS(t,e,n,i,r,o,a){const s=t.table.isHeader(n,i)?t.table._getHeaderLayoutMap(n,i).headerType:t.table.getBodyColumnType(n,i);if("progressbar"===s){const r=t.table.getBodyColumnDefine(n,i),o=t.table._getCellStyle(n,i),a=t.table.getCellValue(n,i),s=t.table.getCellOriginValue(n,i),l=(u_(Bx("padding",o,n,i,t.table)),dS(r,o,e.attribute.width,a,s,n,i,0,t.table)),h=e.getChildByName("progress-bar");e.insertBefore(l,h),e.removeChild(h),h.removeAllChild(),h.release()}else if("sparkline"===s){e.removeAllChild();const r=u_(Bx("padding",t.table._getCellStyle(n,i),n,i,t.table));jS(e,e.parent,e.attribute.x,e.attribute.y,n,i,e.attribute.width,e.attribute.height,r,t.table)}else if("image"===s||"video"===s)cS(e,n,i,t.table);else{const o=t.table._getCellStyle(n,i);!function(t,e,n,i,r,o,a){const s=e-(r[0]+r[2]),l=t.getChildByName("text");l instanceof Ix&&!i?l.setAttribute("heightLimit",s):l instanceof pd&&!i?l.setAttribute("height",s):t.getChildByName("content")&&t.getChildByName("content").updateHeight(s);t.forEachChildren((t=>{"rect"===t.type||("mark"===t.name?t.setAttribute("y",0):"middle"===a?t.setAttribute("y",r[0]+(s-t.AABBBounds.height())/2):"bottom"===a?t.setAttribute("y",r[0]+s-t.AABBBounds.height()):t.setAttribute("y",r[0]))}))}(e,r,0,t.table.internalProps.autoRowHeight,u_(o.padding),o.textAlign,o.textBaseline);const a=e.getChildByName("custom-container");if(a){let r,o;a.clear(),e.removeChild(a);if("body"!==t.table.getCellType(n,i)){const e=t.table.getHeaderDefine(n,i);r=e?.headerCustomRender,o=e?.headerCustomLayout}else{const e=t.table.getBodyColumnDefine(n,i);r=e?.customRender||t.table.customRender,o=e?.customLayout}const s=Dx(o,r,n,i,e.attribute.width,e.attribute.height,!1,!1,t.table);e.childrenCount>0?e.insertBefore(s.elementsGroup,e.firstChild):e.appendChild(s.elementsGroup)}}}function QS(t,e){const n=t.colHeaderGroup,i=t.rowHeaderGroup,r=t.cornerHeaderGroup,o=t.bodyGroup;for(let e=0;e<=t.bodyRowEnd;e++){let n=0;for(let i=0;i<t.table.colCount;i++){const r=t.getCell(i,e),o=zx(t.table,r.col,r.row);if(o){const e=t.getCell(o.start.col,o.start.row);n=Math.max(n,e.attribute.height/(o.end.row-o.start.row+1))}else n=Math.max(n,r.attribute.height)}t.table.setRowHeight(e,n,!0)}let a=0;for(let e=0;e<=t.bodyRowEnd;e++){const s=t.table.getRowHeight(e);if(e===t.table.columnHeaderLevelCount){let t=0;n?.firstChild?.forEachChildren((e=>{"shadow-cell"!==e.role&&(t+=e.attribute.height)})),n.setAttribute("height",t),r.setAttribute("height",t),i.setAttribute("y",t),o.setAttribute("y",t),a=0}for(let n=0;n<t.table.colCount;n++){tk(t.getCell(n,e),t,n,e,s,a)}a+=s}i.setAttribute("height",a),o.setAttribute("height",a)}function tk(t,e,n,i,r,o,a){const s=zx(e.table,n,i);s&&s.end.row-s.start.row?(t=e.getCell(s.start.col,s.start.row),i===s.start.row&&t.setAttribute("y",o),ZS(e,t,n,i,r,0,e.table.isHeader(n,i))):"shadow-cell"!==t.role&&(t.setAttribute("y",o),ZS(e,t,n,i,r,0,e.table.isHeader(n,i)))}function ek(t,e,n,i,r,o,a,s){let l,h;const u=zx(t.table,n,i);if(u&&u.end.col-u.start.col){const e=t.getCell(u.start.col,u.start.row),r=e.attribute.width;e.setAttribute("width",r+o),l=e,h=e.attribute.width,n=l.col,i=l.row}else u&&u.start.row===i?(e.setAttribute("width",r+o),l=e,h=r+o,n=l.col,i=l.row):u||(e.setAttribute("width",r+o),l=e,h=r+o);if(!l)return!1;const c=t.table.isHeader(n,i)?t.table._getHeaderLayoutMap(n,i).headerType:t.table.getBodyColumnType(n,i);let d=!1;if("progressbar"===c){const e=t.table.getBodyColumnDefine(n,i),r=t.table._getCellStyle(n,i),o=t.table.getCellValue(n,i),a=t.table.getCellOriginValue(n,i),s=(u_(Bx("padding",r,n,i,t.table)),dS(e,r,l.attribute.width,o,a,n,i,0,t.table)),h=l.getChildByName("progress-bar");l.insertBefore(s,h),l.removeChild(h),h.removeAllChild(),h.release()}else if("sparkline"===c){l.removeAllChild();const e=u_(Bx("padding",t.table._getCellStyle(n,i),n,i,t.table));jS(l,l.parent,l.attribute.x,l.attribute.y,n,i,l.attribute.width,l.attribute.height,e,t.table)}else if("image"===c||"video"===c)cS(l,n,i,t.table);else{const e=t.table._getCellStyle(n,i);d=Ux(l,h,o,s,u_(e.padding),e.textAlign,e.textBaseline,t)}return d}function nk(t,e){let n=0;for(let i=0;i<t.table.colCount;i++){let r=ik(t.highPerformanceGetCell(i,e),t);const o=zx(t.table,i,e);o&&o.end.row-o.start.row&&(r/=o.end.row-o.start.row+1),n=Math.max(n,r)}for(let i=0;i<t.table.colCount;i++){let r=n;const o=t.highPerformanceGetCell(i,e),a=zx(t.table,i,e);if(a&&a.end.row-a.start.row)for(let n=a.start.row;n<=a.end.row;n++)n!==e&&(r+=t.table.getRowHeight(n));qS(t,o,i,e,r,0,t.table.isHeader(i,e))}t.table.setRowHeight(e,n,!0)}function ik(t,e){let n=0;t.forEachChildren((t=>{"icon-left"!==t.role&&"icon-right"!==t.role&&"text"!==t.name&&"content"!==t.name||(n=Math.max(n,t.AABBBounds.height()))}));const i=u_(e.table._getCellStyle(t.col,t.row).padding);return n+i[0]+i[2]}function rk(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=re(t);if(e){var r=re(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return ie(this,n)}}var ok=["x","y","dx","dy","scaleX","scaleY","angle","anchor","postMatrix","visible","clip","pickable","childrenPickable","zIndex"],ak=function(t){ee(n,t);var e=rk(n);function n(t){var i,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"2d";return Qt(this,n),(i=e.call(this,t)).mode=r,i.setTheme({common:{strokeBoundsBuffer:0}}),i.attribute=t,i.onSetStage((function(){i.render(),i.bindEvents()})),i}return Jt(n,[{key:"setAttribute",value:function(t,e,n){Cr(this.attribute[t])?Lr(this.attribute[t],e):this.attribute[t]=e,ok.includes(t)||this.render(),this.valid=this.isValid(),this.updateShapeAndBoundsTagSetted()||!n&&!this.needUpdateTag(t)?this.addUpdateBoundTag():this.addUpdateShapeAndBoundsTag(),this.addUpdatePositionTag(),this.onAttributeUpdate()}},{key:"setAttributes",value:function(t,e){var n=Object.keys(t);this._mergeAttributes(t,n),n.every((function(t){return ok.includes(t)}))||this.render(),this.valid=this.isValid(),this.updateShapeAndBoundsTagSetted()||!e&&!this.needUpdateTags(n)?this.addUpdateBoundTag():this.addUpdateShapeAndBoundsTag(),this.addUpdatePositionTag(),this.onAttributeUpdate()}},{key:"_mergeAttributes",value:function(t,e){mr(e)&&(e=Object.keys(t));for(var n=0;n<e.length;n++){var i=e[n];Cr(this.attribute[i])?Lr(this.attribute[i],t[i]):this.attribute[i]=t[i]}}},{key:"bindEvents",value:function(){}},{key:"_getNodeId",value:function(t){return"".concat(this.id,"-").concat(this.name,"-").concat(t)}}]),n}(Nh);function sk(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=re(t);if(e){var r=re(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return ie(this,n)}}var lk,hk=function(t){ee(n,t);var e=sk(n);function n(t){var i;return Qt(this,n),(i=e.call(this,Lr({},n.defaultAttributes,t))).name="scrollbar",i._onRailPointerDown=function(t){var e,n,r,o=t.viewX,a=t.viewY,s=i.attribute,l=s.direction,h=s.width,u=s.height,c=s.range,d=i._sliderSize,f=Vt(i._getScrollRange(),2),p=f[0],g=f[1];if("vertical"===l){var v=a-i._viewPosition.y,y=Dr(v-d/2,p,g);r=v/u,i._slider.setAttribute("y",y,!0)}else{var m=o-i._viewPosition.x,b=Dr(m-d/2,p,g);r=m/h,i._slider.setAttribute("x",b,!0)}i.setScrollRange([r-(c[1]-c[0])/2,r+(c[1]-c[0])/2],!1),(null===(e=i.stage)||void 0===e?void 0:e.autoRender)||null===(n=i.stage)||void 0===n||n.renderNextFrame()},i._onSliderPointerDown=function(t){t.stopPropagation();var e=i.attribute.direction;i._prePos="horizontal"===e?t.clientX:t.clientY,"browser"===dx.env?(dx.addEventListener("pointermove",i._onSliderPointerMove),dx.addEventListener("pointerup",i._onSliderPointerUp)):(i._slider.addEventListener("pointermove",i._onSliderPointerMove),i._slider.addEventListener("pointerup",i._onSliderPointerUp),i._slider.addEventListener("pointerupoutside",i._onSliderPointerUp))},i._onSliderPointerMove=function(t){t.stopPropagation();var e,n,r=i.attribute.direction,o=i.getScrollRange(),a=i._getSliderRenderBounds(),s=a.width,l=a.height;"vertical"===r?e=((n=t.clientY)-i._prePos)/l:e=((n=t.clientX)-i._prePos)/s,i.setScrollRange([o[0]+e,o[1]+e],!0),i._prePos=n},i._onSliderPointerUp=function(t){t.preventDefault(),"browser"===dx.env?(dx.removeEventListener("pointermove",i._onSliderPointerMove),dx.removeEventListener("pointerup",i._onSliderPointerUp)):(i._slider.removeEventListener("pointermove",i._onSliderPointerMove),i._slider.removeEventListener("pointerup",i._onSliderPointerUp),i._slider.removeEventListener("pointerupoutside",i._onSliderPointerUp))},i}return Jt(n,[{key:"setScrollRange",value:function(t){var e,n,i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=this.attribute,o=r.direction,a=void 0===o?"horizontal":o,s=r.limitRange,l=void 0===s?[0,1]:s,h=r.range,u=Wr(t,l[0],l[1]);if(i){var c=this._getSliderPos(u);this._slider&&("horizontal"===a?this._slider.setAttribute("x",c[0],!0):this._slider.setAttribute("y",c[0],!0),(null===(e=this.stage)||void 0===e?void 0:e.autoRender)||null===(n=this.stage)||void 0===n||n.renderNextFrame())}this.attribute.range=u,this._onChange({pre:h,value:u})}},{key:"getScrollRange",value:function(){return this.attribute.range}},{key:"bindEvents",value:function(){this._rail&&this._rail.addEventListener("pointerdown",this._onRailPointerDown),this._slider&&this._slider.addEventListener("pointerdown",this._onSliderPointerDown)}},{key:"render",value:function(){this._reset();var t=this.attribute,e=t.direction,n=void 0===e?"horizontal":e,i=t.width,r=t.height,o=t.range,a=t.limitRange,s=void 0===a?[0,1]:a,l=t.railStyle,h=t.sliderStyle,u=t.padding,c=void 0===u?2:u,d=this.createOrUpdateChild("scrollbar-container",{},"group"),f=d.createOrUpdateChild("scrollbar-rail",Object.assign({x:0,y:0,width:i,height:r},l),"rect");this._rail=f;var p,g=this._getSliderRenderBounds(),v=this._getSliderPos(Wr(o,s[0],s[1])),y=v[1]-v[0];this._sliderSize=y,p="horizontal"===n?{x:v[0],y:g.y1,width:y,height:g.height}:{x:g.x1,y:v[0],width:g.width,height:y};var m=d.createOrUpdateChild("slider",Object.assign(Object.assign(Object.assign(Object.assign({},p),{cornerRadius:this._getDefaultSliderCornerRadius()}),h),{boundsPadding:xo(c),pickMode:"imprecise"}),"rect");this._slider=m,this._container=d;var b=this._container.AABBBounds;this._viewPosition={x:b.x1,y:b.y1}}},{key:"_getSliderRenderBounds",value:function(){if(this._sliderRenderBounds)return this._sliderRenderBounds;var t=this.attribute,e=t.width,n=t.height,i=t.padding,r=Vt(xo(void 0===i?2:i),4),o=r[0],a=r[1],s=r[2],l=r[3],h={x1:l,y1:o,x2:e-a,y2:n-s,width:e-(l+a),height:n-(o+s)};return this._sliderRenderBounds=h,h}},{key:"_getDefaultSliderCornerRadius",value:function(){var t=this.attribute,e=t.direction;if(t.round){var n=this._getSliderRenderBounds(),i=n.width,r=n.height;return"horizontal"===e?r:i}return 0}},{key:"_getSliderPos",value:function(t){var e=this.attribute.direction,n=this._getSliderRenderBounds(),i=n.width,r=n.height,o=n.x1,a=n.y1;return"horizontal"===e?[i*t[0]+o,i*t[1]+o]:[r*t[0]+a,r*t[1]+a]}},{key:"_getScrollRange",value:function(){if(this._sliderLimitRange)return this._sliderLimitRange;var t=this.attribute,e=t.limitRange,n=void 0===e?[0,1]:e,i=t.direction,r=Vt(Wr(n,0,1),2),o=r[0],a=r[1],s=this._getSliderRenderBounds(),l=s.width,h=s.height,u=s.x1,c=s.y1,d=this._sliderSize;return"horizontal"===i?Wr([u+o*l,u+a*l],u,l-d):Wr([c+o*h,c+a*h],c,h-d)}},{key:"_onChange",value:function(t){var e,n=new ml("scroll",t);n.manager=null===(e=this.stage)||void 0===e?void 0:e.eventSystem.manager,this.dispatchEvent(n)}},{key:"_reset",value:function(){this._sliderRenderBounds=null,this._sliderLimitRange=null}}]),n}(ak);hk.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]},function(t){t.dropDown="dropDown",t.contextmenu="contextmenu",t.custom="custom"}(lk||(lk={}));const uk={fontSize:12,color:"#000",highlightColor:"#2E68CF",hoverBgColor:"#EEE",lineHeight:30,bgColor:"#FFF",cornerRadius:4,borderWidth:.5,borderColor:"#CCC",menuPadding:6,menuItemPadding:9,maxLineWidth:200};const ck=aS();class dk{icon;constructor(){const t=ck.drillDown;this.icon=new Px({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,n,i,r,o){if(!t||i&&r)return this.icon.setAttributes({x:-1e3,y:-1e3,visible:!1}),void o.updateNextFrame();const a=ck.drillDown,s=ck.drillUp;this.icon.setAttributes({x:e,y:n,image:i?a.svg:s.svg,visible:!0}),this.icon.loadImage(this.icon.attribute.image),o.updateNextFrame()}}class fk{columnMoverLabel;columnMoverLine;columnMoverBack;table;x;constructor(t){const e=t.theme.dragHeaderSplitLine.lineWidth,n=t.theme.dragHeaderSplitLine.lineColor,i=t.theme.dragHeaderSplitLine.shadowBlockColor;this.columnMoverLabel=bf({visible:!1,pickable:!1,x:0,y:0,symbolType:"triangle",fill:n}),this.columnMoverLine=vf({visible:!1,pickable:!1,stroke:n,lineWidth:e,x:0,y:0,points:[{x:0,y:0},{x:0,y:0}]}),this.columnMoverBack=yf({visible:!1,pickable:!1,fill:i,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,n){const i=this.table.getCellType(t,e),r=zx(this.table,t,e);r&&(t=r.start.col,e=r.start.row);let o=0,a=0,s=0,l=0,h=0,u=0,c=0,d=0,f=Math.PI;const p=[];"columnHeader"===i?(o=this.table.getColsWidth(0,t-1)-this.table.stateManeger.scroll.horizontalBarPos,a=this.table.getRowsHeight(0,this.table.frozenRowCount-1),l=this.table.tableNoFrameHeight,s=r?this.table.getColsWidth(r.start.col,r.end.col):this.table.getColWidth(t),h=o-n,c=o+s,d=2,p.push({x:0,y:0}),p.push({x:0,y:this.table.tableNoFrameHeight})):"rowHeader"===i&&(a=this.table.getRowsHeight(0,e-1)-this.table.stateManeger.scroll.verticalBarPos,o=this.table.getColsWidth(0,this.table.frozenColCount-1),s=this.table.tableNoFrameWidth,l=r?this.table.getRowsHeight(r.start.row,r.end.row):this.table.getRowHeight(e),u=a-n,c=2,d=a+l,f=Math.PI/2,p.push({x:0,y:0}),p.push({x:this.table.tableNoFrameWidth,y:0})),this.columnMoverBack.setAttributes({visible:!0,x:o-h,y:a-u,width:s,height:l,dx:h,dy:u}),this.columnMoverLine.setAttributes({x:c,y:d,visible:!0,points:p}),this.columnMoverLabel.setAttributes({visible:!0,x:c,y:d,angle:f})}hide(){this.columnMoverLabel.setAttribute("visible",!1),this.columnMoverLine.setAttribute("visible",!1),this.columnMoverBack.setAttribute("visible",!1)}update(t,e,n,i){"number"==typeof t&&"number"==typeof e?(this.columnMoverLabel.setAttribute("x",e-this.table.stateManeger.scroll.horizontalBarPos),this.columnMoverLine.setAttribute("x",e-this.table.stateManeger.scroll.horizontalBarPos),this.columnMoverBack.setAttribute("x",t)):"number"==typeof n&&"number"==typeof i&&(this.columnMoverLabel.setAttribute("y",i-this.table.stateManeger.scroll.verticalBarPos),this.columnMoverLine.setAttribute("y",i-this.table.stateManeger.scroll.verticalBarPos),this.columnMoverBack.setAttribute("y",n))}}function pk(t,e){let n=e.getColsWidth(0,t);return t>=e.frozenColCount&&(n-=e.scrollLeft),n}class gk{table;border;columnResizeLine;columnResizeBgLine;columnResizeLabel;menu;vScrollBar;hScrollBar;frozenShadowLine;drillIcon;cellMover;constructor(t){this.table=t;const e=this.table.theme;this.createScrollBar();const n=e.columnResize?.lineColor,i=e.columnResize?.lineWidth,r=e.columnResize?.bgColor,o=e.columnResize?.width;this.columnResizeLine=vf({visible:!1,pickable:!1,stroke:n,lineWidth:i,x:0,y:0,points:[{x:0,y:0},{x:0,y:0}]}),this.columnResizeBgLine=vf({visible:!1,pickable:!1,stroke:r,lineWidth:o,x:0,y:0,points:[{x:0,y:0},{x:0,y:0}]});const a=mf({visible:!1,pickable:!1,x:0,y:0,fontSize:10,fill:"#FFF",text:"",textBaseline:"top",dx:16,dy:-6}),s=yf({visible:!1,pickable:!1,fill:"#3073F2",x:0,y:0,width:38,height:16,cornerRadius:5,dx:12,dy:-8});this.columnResizeLabel=gf({visible:!1,pickable:!1,x:0,y:0}),this.columnResizeLabel.appendChild(s),this.columnResizeLabel.appendChild(a),this.cellMover=new fk(this.table);const l=e.frozenColumnLine?.shadow?.width,h=e.frozenColumnLine?.shadow?.startColor,u=e.frozenColumnLine?.shadow?.endColor;this.frozenShadowLine=yf({visible:!0,pickable:!1,x:0,y:0,width:l,height:0,fill:{gradient:"linear",x0:0,y0:0,x1:1,y1:0,stops:[{color:h,offset:0},{color:u,offset:1}]}}),this.menu=new class{_table;_menuInstance;_menuInfo;constructor(t){this._table=t,this._menuInstance=new Rx({x:0,y:0,fill:uk.bgColor,stroke:uk.borderColor,cornerRadius:uk.cornerRadius,lineWidth:uk.borderWidth}),this._menuInfo={x:-1,y:-1,col:-1,row:-1,type:lk.dropDown,menuInfo:[],highlightIndex:-1}}bindTableComponent(t){t.appendChild(this._menuInstance),this.bindEvent()}dispose(){}attach(t,e,n,i,r,o){if(r===lk.dropDown&&this.checkDropDownMenuChange(n,i)){const t=this.getMenuInfo(n,i,r);if(!t)return;const{menuInfo:e,highlightIndex:o}=t;this.updateMenuInfo(n,i,r,e,o),this.updateMenuInstance(e,o)}else if(r===lk.contextmenu&&this.checkContextMenuChange(t,e)){const t=this.getMenuInfo(n,i,r);if(!t)return;const{menuInfo:e,highlightIndex:o}=t;this.updateMenuInfo(n,i,r,e,o),this.updateMenuInstance(e,o)}this.updatePosition(t-this._table.scenegraph.x,e-this._table.scenegraph.y),this.addToScene()}updateMenuInfo(t,e,n,i,r){this._menuInfo.col=t,this._menuInfo.row=e,this._menuInfo.type=n,this._menuInfo.menuInfo=i,this._menuInfo.highlightIndex=r}checkDropDownMenuChange(t,e){const{type:n,col:i,row:r}=this._menuInfo;return n!==lk.dropDown||t!==i||e!==r}checkContextMenuChange(t,e){const{type:n,menuInfo:i}=this._menuInfo;return n!==lk.contextmenu||i!==this._table.internalProps.menu?.contextMenuItems}updateMenuInstance(t,e){this._menuInstance.removeAllChild();let n=uk.menuPadding;const i=uk.menuPadding;let r=0;t.forEach(((t,o)=>{const a=e===o;let s,l;"string"==typeof t?l=t:"object"==typeof t&&(l=t.text,s=a?t.selectedIcon:t.icon);const h=new Rx({y:n,x:i,height:uk.lineHeight,fill:uk.bgColor});h.role="menu-item",this._menuInstance.appendChild(h),h.stateProxy=t=>"hover"===t?{fill:uk.hoverBgColor}:{fill:uk.bgColor},h.addEventListener("pointerenter",(t=>{h.addState("hover",!0,!1),this._table.scenegraph.updateNextFrame()})),h.addEventListener("pointerleave",(t=>{h.removeState("hover",!1),this._table.scenegraph.updateNextFrame()}));const u=new Mu({x:uk.menuItemPadding,y:uk.menuItemPadding,fill:a?uk.highlightColor:uk.color,text:l,textBaseline:"top",fontSize:uk.fontSize,pickable:!1,maxLineWidth:uk.maxLineWidth,ellipsis:"…"});if(h.addChild(u),s){u.AABBBounds.height();const t=s.width??16,e=s.height??16,n=new Px({x:uk.menuItemPadding,y:(uk.lineHeight-e)/2,width:t,height:e,image:s.svg,pickable:!1});n.role="menu-icon",h.insertBefore(n,u),u.setAttribute("x",t+uk.menuItemPadding)}r=Math.max(h.AABBBounds.width(),r),n+=uk.lineHeight})),this._menuInstance.setAttributes({width:r+2*uk.menuItemPadding+2*uk.menuPadding,height:n+uk.menuPadding}),this._menuInstance.forEachChildren((t=>{t.setAttribute("width",r+2*uk.menuItemPadding)}))}updatePosition(t,e){this._menuInstance.setAttributes({x:this._menuInfo.type===lk.dropDown?t-this._menuInstance.attribute.width:t,y:e}),this._menuInfo.x=lk.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,n){if(n===lk.dropDown){const{dropDownMenu:n=this._table.globalDropDownMenu,pivotInfo:i}=this._table._getHeaderLayoutMap(t,e);let r=-1;if(Array.isArray(n))for(let i=0;i<n.length;i++)if(this._table._dropDownMenuIsHighlight(t,e,i)){r=i;break}return{menuInfo:n,highlightIndex:r}}if(n===lk.contextmenu){const n=this._table.internalProps.menu?.contextMenuItems;let i;if(Array.isArray(n))i=n;else if("function"==typeof n){const{field:r}=this._table.isHeader(t,e)?this._table.getHeaderDefine(t,e):this._table.getBodyColumnDefine(t,e);i=n(r,e)}return{menuInfo:i,highlightIndex:-1}}}bindEvent(){this._menuInstance.addEventListener("click",(t=>{const{target:e}=t;if(e&&"menu-item"===e.role){const t=this.getEventInfo(e),n=this._table.getMenuInfo(this._menuInfo.col,this._menuInfo.row,this._menuInfo.type),i=Object.assign(t,n);this._table.fireListeners(vt.DROPDOWNMENU_CLICK,i)}}))}getEventInfo(t){const e=t.parent;let n=0;e.forEachChildren(((e,i)=>e===t&&(n=i-1,!0)));const i="string"==typeof this._menuInfo.menuInfo[n]?this._menuInfo.menuInfo[n]:this._menuInfo.menuInfo[n].text,r="string"==typeof this._menuInfo.menuInfo[n]?i:this._menuInfo.menuInfo[n].menuKey||i;return{col:this._menuInfo.col,row:this._menuInfo.row,dropDownIndex:n,highlight:n===this._menuInfo.highlightIndex,text:i,menuKey:r}}get bounds(){return this._menuInstance.globalAABBBounds}}(this.table),this.drillIcon=new dk}addToGroup(t){t.addChild(this.frozenShadowLine),t.addChild(this.columnResizeBgLine),t.addChild(this.columnResizeLine),t.addChild(this.columnResizeLabel),this.table.theme.scrollStyle.hoverOn?(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(){const t=this.table.theme,e=t.scrollStyle?.scrollRailColor,n=t.scrollStyle?.scrollSliderColor,i=t.scrollStyle?.width;this.hScrollBar=new hk({direction:"horizontal",x:2*-this.table.tableNoFrameWidth,y:2*-this.table.tableNoFrameHeight,width:this.table.tableNoFrameWidth,height:i,padding:0,railStyle:{fill:e},sliderStyle:{fill:n},range:[0,.1],visible:!1}),this.hScrollBar.render(),this.hScrollBar.hideAll(),this.vScrollBar=new hk({direction:"vertical",x:2*-this.table.tableNoFrameWidth,y:2*-this.table.tableNoFrameHeight,width:i,height:this.table.tableNoFrameHeight-this.table.getFrozenRowsHeight(),padding:0,railStyle:{fill:e},sliderStyle:{fill:n},range:[0,.1],visible:!1}),this.vScrollBar.render(),this.vScrollBar.hideAll()}updateScrollBar(){const t=this.table.stateManeger.scroll.horizontalBarPos,e=this.table.stateManeger.scroll.verticalBarPos,n=this.table.theme,i=n.scrollStyle?.width,r=n.scrollStyle?.visible,o=Math.ceil(this.table.scenegraph.tableGroup.attribute.width),a=Math.ceil(this.table.scenegraph.tableGroup.attribute.height),s=this.table.getAllRowsHeight(),l=this.table.getAllColsWidth(),h=this.table.getFrozenRowsHeight(),u=this.table.getFrozenColsWidth();if(l>o){const t=Math.min(a,s),e=Math.max(.05,(o-u)/(l-u));this.hScrollBar.setAttributes({x:u+(this.table.theme.scrollStyle.hoverOn?0:this.table.scenegraph.tableGroup.attribute.x),y:t-(this.table.theme.scrollStyle.hoverOn?i:-this.table.scenegraph.tableGroup.attribute.y),width:o-u,range:[0,e],visible:"always"===r});const n=this.hScrollBar.AABBBounds&&this.hScrollBar.globalAABBBounds;this.hScrollBar._viewPosition={x:n.x1,y:n.y1},"always"===r&&this.hScrollBar.showAll()}else this.hScrollBar.setAttributes({x:2*-this.table.tableNoFrameWidth,y:2*-this.table.tableNoFrameHeight,width:0,visible:!1});if(s>a){const t=Math.min(o,l),e=Math.max(.05,(a-h)/(s-h));this.vScrollBar.setAttributes({x:t-(this.table.theme.scrollStyle.hoverOn?i:-this.table.scenegraph.tableGroup.attribute.x),y:h+(this.table.theme.scrollStyle.hoverOn?0:this.table.scenegraph.tableGroup.attribute.y),height:a-h,range:[0,e],visible:"always"===r});const n=this.vScrollBar.AABBBounds&&this.vScrollBar.globalAABBBounds;this.vScrollBar._viewPosition={x:n.x1,y:n.y1},"always"===r&&this.vScrollBar.showAll()}else this.vScrollBar.setAttributes({x:2*-this.table.tableNoFrameWidth,y:2*-this.table.tableNoFrameHeight,height:0,visible:!1});this.table.stateManeger.setScrollLeft(t),this.table.stateManeger.setScrollTop(e)}hideResizeCol(){this.columnResizeLine.setAttribute("visible",!1),this.columnResizeBgLine.setAttribute("visible",!1),this.columnResizeLabel.setAttribute("visible",!1),this.columnResizeLabel.hideAll()}showResizeCol(t,e){const n=pk(t,this.table);this.columnResizeLine.setAttributes({visible:!0,x:n,points:[{x:0,y:0},{x:0,y:this.table.getRowsHeight(0,this.table.rowCount-1)}]}),this.columnResizeBgLine.setAttributes({visible:!0,x:n,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:n,y:e}),this.columnResizeLabel.lastChild.setAttribute("text",`${this.table.getColWidth(t)}px`)}updateResizeCol(t,e){const n=pk(t,this.table);this.columnResizeLine.setAttributes({x:n,points:[{x:0,y:0},{x:0,y:this.table.getRowsHeight(0,this.table.rowCount-1)}]}),this.columnResizeBgLine.setAttributes({x:n,points:[{x:0,y:0},{x:0,y:this.table.getRowsHeight(0,this.table.rowCount-1)}]}),this.columnResizeLabel.setAttributes({x:n,y:e}),this.columnResizeLabel.lastChild.setAttribute("text",`${Math.floor(this.table.getColWidth(t))}px`)}hideMoveCol(){this.cellMover.hide()}showMoveCol(t,e,n){this.cellMover.show(t,e,n)}updateMoveCol(t,e,n,i){this.cellMover.update(t,e,n,i)}setFrozenColumnShadow(t){if(t<0)this.frozenShadowLine.setAttributes({visible:!1});else{const e=this.table.getColsWidth(0,t);this.frozenShadowLine.setAttributes({visible:!0,x:e,height:this.table.getRowsHeight(0,this.table.rowCount-1)})}}hideVerticalScrollBar(){const t=this.table.theme.scrollStyle.visible;"focus"!==t&&"scrolling"!==t||(this.vScrollBar.setAttribute("visible",!1),this.vScrollBar.hideAll(),this.table.scenegraph.updateNextFrame())}showVerticalScrollBar(){const t=this.table.theme.scrollStyle.visible;"focus"!==t&&"scrolling"!==t||(this.vScrollBar.setAttribute("visible",!0),this.vScrollBar.showAll(),this.table.scenegraph.updateNextFrame())}hideHorizontalScrollBar(){const t=this.table.theme.scrollStyle.visible;"focus"!==t&&"scrolling"!==t||(this.hScrollBar.setAttribute("visible",!1),this.hScrollBar.hideAll(),this.table.scenegraph.updateNextFrame())}showHorizontalScrollBar(){const t=this.table.theme.scrollStyle.visible;"focus"!==t&&"scrolling"!==t||(this.hScrollBar.setAttribute("visible",!0),this.hScrollBar.showAll(),this.table.scenegraph.updateNextFrame())}updateVerticalScrollBarPos(t){const e=this.vScrollBar.attribute.range,n=e[1]-e[0],i=t*(1-n);this.vScrollBar.setAttribute("range",[i,i+n]);const r=this.vScrollBar.AABBBounds&&this.vScrollBar.globalAABBBounds;this.vScrollBar._viewPosition={x:r.x1,y:r.y1}}updateHorizontalScrollBarPos(t){const e=this.hScrollBar.attribute.range,n=e[1]-e[0];this.hScrollBar.setAttribute("range",[t,t+n]);const i=this.hScrollBar.AABBBounds&&this.hScrollBar.globalAABBBounds;this.hScrollBar._viewPosition={x:i.x1,y:i.y1}}}function vk(t,e,n,i,r){if(!e)return;const o="table"===n,{shadowBlur:a,shadowOffsetX:s,shadowOffsetY:l,shadowColor:h,cornerRadius:u,borderColor:c,borderLineWidth:d,borderLineDash:f}=e,p={},g={pickable:!1};a&&o&&(g.shadowBlur=a,g.shadowOffsetX=s,g.shadowOffsetY=l,g.shadowColor=h,g.stroke=!0,g.stroke=h,g.lineWidth=1,g.fill=!0,g.fillOpacity=.01),d&&(g.stroke=!0,g.fill=!1,g.stroke=mk(c,i),g.lineWidth=d,f&&(g.lineDash=f),g.lineCap="square"),Array.isArray(c)&&(g.strokeArrayColor=u_(c)),Array.isArray(d)&&(g.strokeArrayWidth=u_(d),g.lineWidth=1),u&&(g.cornerRadius=u,p.cornerRadius=u);const v=g.strokeArrayWidth?g.strokeArrayWidth[0]:g.lineWidth??0,y=g.strokeArrayWidth?g.strokeArrayWidth[1]:g.lineWidth??0,m=g.strokeArrayWidth?g.strokeArrayWidth[2]:g.lineWidth??0,b=g.strokeArrayWidth?g.strokeArrayWidth[3]:g.lineWidth??0;if(o&&(g.shadowBlur||g.lineWidth)){const t=(g.shadowBlur??0)+(b+y)/2,e=(g.shadowBlur??0)+(v+m)/2;p.x=t,p.y=e}if(t.setAttributes(p),!r&&g.stroke)if(g.x=b/2,g.y=v/2,g.pickable=!1,o){g.x=t.attribute.x-b/2,g.y=t.attribute.y-v/2,g.width=t.attribute.width+b/2+y/2,g.height=t.attribute.height+v/2+m/2;const e=yf(g);e.name="table-border-rect",t.parent.insertBefore(e,t),t.border=e}else{g.width=t.attribute.width-b/2-y/2,g.height=t.attribute.height-v/2-m/2;const e=yf(g);e.name="border-rect",t.addChild(e),t.border=e}}function yk(t,e,n){const{borderColor:i}=e;t.border?.setAttribute("stroke",mk(i,n))}function mk(t,e){let n=!0;return e&&!Ot(t)?n=e.map((e=>!!e&&t)):e?n=e:e||Ot(t)?Ot(t)&&(n=!0):n=t,n}function bk(t){if(!t.border)return;const e=t.border.attribute.strokeArrayWidth?t.border.attribute.strokeArrayWidth[0]:t.border.attribute.lineWidth??0,n=t.border.attribute.strokeArrayWidth?t.border.attribute.strokeArrayWidth[1]:t.border.attribute.lineWidth??0,i=t.border.attribute.strokeArrayWidth?t.border.attribute.strokeArrayWidth[2]:t.border.attribute.lineWidth??0,r=t.border.attribute.strokeArrayWidth?t.border.attribute.strokeArrayWidth[3]:t.border.attribute.lineWidth??0;t.border.setAttributes({width:t.attribute.width-r/2-n/2,height:t.attribute.height-e/2-i/2})}function wk(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"===("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a}const Ck=Symbol.for("ChartRender");let xk=class{type;numberType=J_;drawShape(t,e,n,i,r,o,a,s){const l=Js(t,o?.theme).group,{dataId:h,data:u,viewBox:c}=t.attribute,{width:d=l.width,height:f=l.height}=t.attribute,{chartInstance:p,active:g,cacheCanvas:v,activeChartInstance:y}=t;if(!g&&v)e.drawImage(v,n,i,d,f);else if(y)y.updateDataSync("data",u);else{p.updateViewBox({x1:c.x1-t.getRootNode().table.scrollLeft,x2:c.x2-t.getRootNode().table.scrollLeft,y1:c.y1-t.getRootNode().table.scrollTop,y2:c.y2-t.getRootNode().table.scrollTop}),p.updateDataSync(h,u);const e=p.getStage();t.cacheCanvas=e.toCanvas()}}draw(t,e,n,i){const{context:r}=n;if(!r)return;const{clip:o}=t.attribute;o?r.save():r.highPerformanceSave(),r.transformFromMatrix(t.transMatrix,!0),r.beginPath(),i.skipDraw?this.drawShape(t,r,0,0,n,i,(()=>!1),(()=>!1)):this.drawShape(t,r,0,0,n);const a=Js(t,i?.theme).group,{scrollX:s=a.scrollX,scrollY:l=a.scrollY}=t.attribute;let h;(s||l)&&r.translate(s,l),i&&i.drawingCb&&(h=i.drawingCb()),h&&h.then?h.then((()=>{o?r.restore():r.highPerformanceRestore()})):o?r.restore():r.highPerformanceRestore()}};xk=wk([Zi()],xk);let _k=class{time=Sf.beforeFillStroke;useStyle=!0;order=0;drawShape(t,e,n,i,r,o,a,s,l,h,u,c){const{shape:d}=t.attribute;if("circle"===d){const{width:r=l.width,height:o=l.height}=t.attribute;e.beginPath(),e.arc(n+r/2,i+o/2,Math.min(r,o)/2,0,2*Math.PI),e.closePath(),e.save(),e.clip()}}};_k=wk([Zi()],_k);let Sk=class{time=Sf.afterFillStroke;useStyle=!0;order=0;drawShape(t,e,n,i,r,o,a,s,l,h,u,c){const{shape:d}=t.attribute;"circle"===d&&e.restore()}};function kk(t,e,i){const{highlightScope:r,disableHeader:o,cellPos:a}=t.hover;if(!t.table.isHeader(e,i)||!o){if(r===n.single&&a.col===e&&a.row===i)return"cellBgColor";if(r===n.column&&a.col===e)return"inlineColumnBgColor";if(r===n.row&&a.row===i)return"inlineRowBgColor";if(r===n.cross){if(a.col===e&&a.row===i)return"cellBgColor";if(a.col===e)return"inlineColumnBgColor";if(a.row===i)return"inlineRowBgColor"}}}Sk=wk([Zi()],Sk);let Ak=class{time=Sf.beforeFillStroke;useStyle=!0;order=0;drawShape(t,e,n,i,r,o,a,s,l,h,u,c){const{stroke:d=l.stroke,strokeArrayWidth:f=l.strokeArrayWidth,strokeArrayColor:p=l.strokeArrayColor}=t.attribute;d&&(Array.isArray(f)||Array.isArray(p))&&(c.doStroke=!1)}};Ak=wk([Zi()],Ak);let Rk=class{time=Sf.afterFillStroke;useStyle=!0;order=0;drawShape(t,e,n,i,r,o,a,s,l,h,u){const{width:c=l.width,height:d=l.height,stroke:f=l.stroke,strokeArrayColor:p=l.strokeArrayColor,strokeArrayWidth:g=l.strokeArrayWidth,lineWidth:v=l.lineWidth,strokeColor:y=l.stroke}=t.attribute;f&&(Array.isArray(g)||0!==v)&&(Array.isArray(p)||Array.isArray(g))&&(("number"==typeof v&&1&v||Array.isArray(g)&&g.some((t=>1&t)))&&(n=Math.floor(n)+.5,i=Math.floor(i)+.5),Bk(t,e,n,i,l,f,g||v,p||y,Math.ceil(c),Math.ceil(d)))}};function Bk(t,e,n,i,r,o,a,s,l,h,u,c){const d=function(t){if(!Array.isArray(t))return{isSplitDraw:!1,width:t};let e;for(let n=0;n<t.length;n++){const i=t[n];if(i)if(e){if(i!==e)return{isSplitDraw:!0}}else e=i}return{isSplitDraw:!1,width:e}}(a),f=!Array.isArray(a),p=!Array.isArray(o),g=Array.isArray(c),v=Array.isArray(s)||d.isSplitDraw;e.setStrokeStyle(t,t.attribute,n,i,r);let y=!1;e.getLineDash().length&&(y=!0),e.beginPath(),e.moveTo(n,i),(p||o[0])&&(f||a[0])?(g&&Array.isArray(c[0])?(e.moveTo(n+l*c[0][0],i),e.lineTo(n+l*(c[0][1]-c[0][0]),i),e.moveTo(n+l,i)):(e.moveTo(n,i),e.lineTo(n+l,i)),!v&&!y||s&&!s[0]||(s&&(e.strokeStyle=s[0]),f||(e.lineWidth=a[0]),e.lineDashOffset=e.currentMatrix.e/e.currentMatrix.a,e.stroke(),e.beginPath(),e.moveTo(n+l,i))):e.moveTo(n+l,i),(p||o[1])&&(f||a[1])?(g&&Array.isArray(c[1])?(e.moveTo(n+l,i+h*c[1][0]),e.lineTo(n+l,i+h*(c[1][1]-c[1][0])),e.moveTo(n+l,i+h)):(e.moveTo(n+l,i),e.lineTo(n+l,i+h)),!v&&!y||s&&!s[1]||(s&&(e.strokeStyle=s[1]),f||(e.lineWidth=a[1]),e.lineDashOffset=e.currentMatrix.f/e.currentMatrix.d,e.stroke(),e.beginPath(),e.moveTo(n+l,i+h))):e.moveTo(n+l,i+h),(p||o[2])&&(f||a[2])?(g&&Array.isArray(c[2])?(e.moveTo(n+l*c[2][0],i+h),e.lineTo(n+l*(c[2][1]-c[2][0]),i+h),e.moveTo(n,i+h)):(e.moveTo(n,i+h),e.lineTo(n+l,i+h)),!v&&!y||s&&!s[2]||(s&&(e.strokeStyle=s[2]),f||(e.lineWidth=a[2]),e.lineDashOffset=e.currentMatrix.e/e.currentMatrix.a,e.stroke(),e.beginPath(),e.moveTo(n,i+h))):e.moveTo(n,i+h),(p||o[3])&&(f||a[3])?(g&&Array.isArray(c[3])?(e.moveTo(n,i+h*c[3][0]),e.lineTo(n,i+h*(c[3][1]-c[3][0])),e.moveTo(n,i)):(e.moveTo(n,i),e.lineTo(n,i+h)),!v&&!y||s&&!s[3]||(s&&(e.strokeStyle=s[3]),f||(e.lineWidth=a[3]),e.lineDashOffset=e.currentMatrix.f/e.currentMatrix.d,e.stroke(),e.beginPath(),e.moveTo(n,i))):e.moveTo(n,i),v||y||(!f&&d.width&&(e.lineWidth=d.width),e.stroke())}Rk=wk([Zi()],Rk);let Tk=class{time=Sf.beforeFillStroke;useStyle=!0;order=0;drawShape(t,e,n,i,r,o,a,s,l,h,u,c){const{lineDash:d=l.lineDash,stroke:f=l.stroke,strokeArrayColor:p=l.strokeArrayColor,strokeArrayWidth:g=l.strokeArrayWidth}=t.attribute;f&&Array.isArray(d)&&d.length&&!Array.isArray(p)&&!Array.isArray(g)&&(c.doStroke=!1)}};Tk=wk([Zi()],Tk);let Mk=class{time=Sf.afterFillStroke;useStyle=!0;order=0;drawShape(t,e,n,i,r,o,a,s,l,h,u){const{lineDash:c=l.lineDash,stroke:d=l.stroke,strokeArrayColor:f=l.strokeArrayColor,strokeArrayWidth:p=l.strokeArrayWidth,lineWidth:g=l.lineWidth}=t.attribute;if(!d||!Array.isArray(c)||!c.length||Array.isArray(f)||Array.isArray(p))return;let{width:v=l.width,height:y=l.height}=t.attribute;v=Math.ceil(v),y=Math.ceil(y),1&g&&(n=Math.floor(n)+.5,i=Math.floor(i)+.5),e.setStrokeStyle(t,t.attribute,n,i,l),e.beginPath(),e.moveTo(n,i),e.lineTo(n+v,i),e.lineDashOffset=e.currentMatrix.e/e.currentMatrix.a,e.stroke(),e.beginPath(),e.moveTo(n+v,i),e.lineTo(n+v,i+y),e.lineDashOffset=e.currentMatrix.f/e.currentMatrix.d,e.stroke(),e.beginPath(),e.moveTo(n,i+y),e.lineTo(n+v,i+y),e.lineDashOffset=e.currentMatrix.e/e.currentMatrix.a,e.stroke(),e.beginPath(),e.moveTo(n,i),e.lineTo(n,i+y),e.lineDashOffset=e.currentMatrix.f/e.currentMatrix.d,e.stroke()}};Mk=wk([Zi()],Mk);let Pk=class{time=Sf.beforeFillStroke;useStyle=!0;order=0;drawShape(t,e,n,i,r,o,a,s,l,h,u,c){const{lineWidth:d=l.lineWidth,stroke:f=l.stroke,lineDash:p=l.lineDash,strokeArrayWidth:g=l.strokeArrayWidth,strokeArrayColor:v=l.strokeArrayColor}=t.attribute;f&&Array.isArray(p)&&!p.length&&!Array.isArray(v)&&!Array.isArray(g)&&1&d&&(c.doStroke=!1)}};Pk=wk([Zi()],Pk);let Ek=class{time=Sf.afterFillStroke;useStyle=!0;order=0;drawShape(t,e,n,i,r,o,a,s,l,h,u){const{lineWidth:c=l.lineWidth,stroke:d=l.stroke,lineDash:f=l.lineDash,strokeArrayWidth:p=l.strokeArrayWidth,strokeArrayColor:g=l.strokeArrayColor}=t.attribute;let{width:v=l.width,height:y=l.height}=t.attribute;if(v=Math.ceil(v),y=Math.ceil(y),d&&Array.isArray(f)&&!f.length&&!Array.isArray(g)&&!Array.isArray(p)&&1&c){if("cell"===t.role){const e=t.stage.table;let n=t.col,i=t.row;const r=zx(e,n,i);r&&(n=r.end.col,i=r.end.row),(e&&n===e.colCount-1||e&&n===e.frozenColCount-1&&e.scrollLeft)&&(v-=1),(e&&i===e.rowCount-1||e&&i===e.frozenRowCount-1&&e.scrollTop)&&(y-=1)}e.beginPath(),n=Math.floor(n)+.5,i=Math.floor(i)+.5,e.rect(n,i,v,y),e.setStrokeStyle(t,t.attribute,n,i,l),e.stroke()}}};Ek=wk([Zi()],Ek);let Hk=class{time=Sf.beforeFillStroke;useStyle=!0;order=0;drawShape(t,e,n,i,r,o,a,s,l,h,u,c){if("cell"===t.role){const e=function(t,e){let n;if("cell"===t.role&&"number"==typeof t.mergeCol&&"number"==typeof t.mergeRow)for(let i=t.col;i<=t.mergeCol;i++)for(let r=t.row;r<=t.mergeRow;r++){const t=kk(e.stateManeger,i,r);!t||n&&"cellBgColor"!==t||(n=t)}else"cell"===t.role&&(n=kk(e.stateManeger,t.col,t.row));if(!n)return;return Bx(n,e.isHeader(t.col,t.row)?e.theme.headerStyle?.hover:e.theme.bodyStyle?.hover,t.col,t.row,e)}(t,t.stage.table);e&&(t.oldColor=t.attribute.fill,t.attribute.fill=e)}}};Hk=wk([Zi()],Hk);let Ok=class{time=Sf.afterFillStroke;useStyle=!0;order=0;drawShape(t,e,n,i,r,o,a,s,l,h,u){"oldColor"in t&&(t.attribute.fill=t.oldColor,delete t.oldColor)}};Ok=wk([Zi()],Ok);let Lk=class{time=Sf.beforeFillStroke;useStyle=!0;order=0;drawShape(t,e,n,i,r,o,a,s,l,h,u,c){const{stroke:d=l.stroke,strokeArrayWidth:f=l.strokeArrayWidth,strokeArrayColor:p=l.strokeArrayColor}=t.attribute;d&&(Array.isArray(d)||Array.isArray(f)||Array.isArray(p))&&(c.doStroke=!1)}};Lk=wk([Zi()],Lk);let Ik=class{time=Sf.afterFillStroke;useStyle=!0;order=0;drawShape(t,e,n,i,r,o,a,s,l,h,u){const{width:c=l.width,height:d=l.height,stroke:f=l.stroke,strokeArrayColor:p=l.strokeArrayColor,strokeArrayWidth:g=l.strokeArrayWidth,lineWidth:v=l.lineWidth,strokeColor:y=l.stroke}=t.attribute;f&&(Array.isArray(g)||0!==v)&&(Array.isArray(f)||Array.isArray(p)||Array.isArray(g))&&(("number"==typeof v&&1&v||Array.isArray(g)&&g.some((t=>1&t)))&&(n=Math.floor(n)+.5,i=Math.floor(i)+.5),Bk(t,e,n,i,l,f,g||v,p||y,Math.ceil(c),Math.ceil(d)))}};Ik=wk([Zi()],Ik);var Dk=new Vi(((t,e,n,i)=>{n(_p)?i(_p).to(Lk).inSingletonScope():(t(Lk).toSelf().inSingletonScope(),t(bp).toService(Lk)),n(Sp)?i(Sp).to(Ik).inSingletonScope():(t(Ik).toSelf().inSingletonScope(),t(bp).toService(Ik)),t(Rk).toSelf().inSingletonScope(),t(hp).toService(Rk),t(Ak).toSelf().inSingletonScope(),t(hp).toService(Ak),t(xk).toSelf().inSingletonScope(),t(Ck).to(xk),t(Tg).to(xk),t(_k).toSelf().inSingletonScope(),t(fp).toService(_k),t(Sk).toSelf().inSingletonScope(),t(fp).toService(Sk),t(Tk).toSelf().inSingletonScope(),t(hp).toService(Tk),t(Mk).toSelf().inSingletonScope(),t(hp).toService(Mk),t(Pk).toSelf().inSingletonScope(),t(hp).toService(Pk),t(Ek).toSelf().inSingletonScope(),t(hp).toService(Ek),t(Hk).toSelf().inSingletonScope(),t(hp).toService(Hk),t(Ok).toSelf().inSingletonScope(),t(hp).toService(Ok)}));const Wk=new Rx({});Wk.role="empty";class Fk{table;currentRow=0;totalRow;rowLimit=1e3;yLimitTop;yLimitBottom;accurateY=0;rowStart=0;rowEnd=0;referenceRow=0;bodyTopRow;bodyBottomRow;bodyLeftCol;bodyRightCol;screenRowCount;firstScreenRowLimit;taskRowCount;rowUpdatePos;rowUpdateDirection;screenTopRow=0;screenTopRowDeltaY;y;cellCache=new Map;constructor(t){this.table=t,this.table.options.maintainedDataCount&&(this.rowLimit=this.table.options.maintainedDataCount)}setParams(){this.bodyTopRow=this.table.columnHeaderLevelCount,this.bodyBottomRow=this.table.rowCount-1,this.bodyLeftCol=0,this.bodyRightCol=this.table.colCount-1;const t=Math.min(this.rowLimit,this.bodyBottomRow-this.bodyTopRow+1);this.totalRow=this.bodyTopRow+t-1,this.rowStart=this.bodyTopRow;const e=this.table.defaultRowHeight;this.taskRowCount=5*Math.ceil(this.table.tableNoFrameHeight/e);const n=e*t,i=e*(this.bodyBottomRow-this.bodyTopRow+1);this.yLimitTop=n/2,this.yLimitBottom=i-n/2;const r=5*this.table.tableNoFrameHeight;this.screenRowCount=Math.ceil(this.table.tableNoFrameHeight/e),this.firstScreenRowLimit=this.bodyTopRow+Math.ceil(r/e),this.rowUpdatePos=this.bodyBottomRow}async createColGroupForFirstScreen(t,e,n,i,r){this.setParams(),$S(t,n,i,0,r.rowHeaderLevelCount-1,r.columnHeaderLevelCount,r.rowCount-1,"rowHeader",r,this.firstScreenRowLimit),$S(e,n,i,r.rowHeaderLevelCount,r.colCount-1,r.columnHeaderLevelCount,r.rowCount-1,"body",r,this.firstScreenRowLimit),e.firstChild?(this.currentRow=e.firstChild?.rowNumber??this.totalRow,this.rowEnd=this.currentRow,this.rowUpdatePos=this.rowEnd,this.referenceRow=Math.floor((this.rowEnd-this.rowStart)/2),await this.progress()):(this.currentRow=this.totalRow,this.rowEnd=this.currentRow,this.rowUpdatePos=this.rowEnd,this.referenceRow=Math.floor((this.rowEnd-this.rowStart)/2))}async progress(){return new Promise(((t,e)=>{setTimeout((()=>{this.rowUpdatePos<this.rowEnd?(this.updateCellGroupsAsync(),this.progress()):this.currentRow<this.totalRow&&(this.createRow(),this.progress()),t()}),0)}))}async createRow(){this.taskRowCount&&(console.log("createRow",this.currentRow,this.currentRow+this.taskRowCount),this.createRowCellGroup(this.taskRowCount))}createRowCellGroup(t){const e=Math.min(this.totalRow,this.currentRow+t);let n=0;for(let t=this.bodyLeftCol;t<=this.bodyRightCol;t++){const i=this.table.scenegraph.getColGroup(t),r=t<this.table.rowHeaderLevelCount?"rowHeader":"body",{height:o}=XS(i,t,i.attribute.width,this.currentRow+1,e,this.table.scenegraph.mergeMap,this.table.internalProps.defaultRowHeight,this.table,r);n=Math.max(n,o)}this.table.scenegraph.bodyGroup.setAttribute("height",n),this.table.internalProps.autoRowHeight&&zk(this.bodyLeftCol,this.bodyRightCol,this.currentRow+1,e,this.table),this.currentRow=e,this.rowEnd=e,this.rowUpdatePos=this.rowEnd,this.referenceRow=Math.floor((e-this.rowStart)/2),this.table.scenegraph.updateContainer(),this.table.scenegraph.updateBorderSizeAndPosition()}async setY(t){t<this.yLimitTop&&this.rowStart===this.bodyTopRow||t>this.yLimitBottom&&this.rowEnd===this.bodyBottomRow?this.table.scenegraph.setBodyAndRowHeaderY(-t):this.dynamicSetY(t)}async dynamicSetY(t){const e=this.table.getTargetRowAt(t+this.table.scenegraph.colHeaderGroup.attribute.height);if(!e)return;const n=e.row;this.y=t,this.screenTopRow=n;const i=n-this.referenceRow;i>0?(this.moveCell(i,"up",n),this.updateBody(t)):i<0?(this.moveCell(-i,"down",n),this.updateBody(t)):this.updateBody(t),this.table.scenegraph.updateNextFrame()}updateBody(t){this.table.scenegraph.setBodyAndRowHeaderY(-t)}async moveCell(t,e,n){if("up"===e&&this.rowEnd+t>this.bodyBottomRow?t=this.bodyBottomRow-this.rowEnd:"down"===e&&this.rowStart-t<this.bodyTopRow&&(t=this.rowStart-this.bodyTopRow),t<this.rowEnd-this.rowStart){const i="up"===e?this.rowStart:this.rowEnd-t+1,r="up"===e?this.rowStart+t-1:this.rowEnd;for(let t=this.bodyLeftCol;t<=this.bodyRightCol;t++){const n=this.table.scenegraph.getColGroup(t);for(let t=i;t<=r;t++)if("up"===e){const t=n.firstChild;this.updateCellGroupPosition(t,n.lastChild.row+1,n.lastChild.attribute.y+n.lastChild.attribute.height),n.appendChild(t)}else{const t=n.lastChild;this.updateCellGroupPosition(t,n.firstChild.row-1,n.firstChild.attribute.y-t.attribute.height),n.insertBefore(t,n.firstChild)}}const o="up"===e?this.rowEnd+1:this.rowStart-t,a="up"===e?this.rowEnd+t:this.rowStart-1,s=Math.max(this.bodyTopRow,n-2*this.screenRowCount),l=Math.min(this.bodyBottomRow,n+3*this.screenRowCount);for(let t=this.bodyLeftCol;t<=this.bodyRightCol;t++)for(let e=s;e<=l;e++){const n=this.highPerformanceGetCell(t,e,o,a);this.updateCellGroupContent(n)}this.table.internalProps.autoRowHeight&&zk(this.bodyLeftCol,this.bodyRightCol,s,l,this.table,e),this.rowStart="up"===e?this.rowStart+t:this.rowStart-t,this.rowEnd="up"===e?this.rowEnd+t:this.rowEnd-t,this.currentRow="up"===e?this.currentRow+t:this.currentRow-t,this.totalRow="up"===e?this.totalRow+t:this.totalRow-t,this.referenceRow=this.rowStart+Math.floor((this.rowEnd-this.rowStart)/2),this.rowUpdatePos=o,this.rowUpdateDirection=e,console.log("move end proxy",this.rowStart,this.rowEnd),console.log("move end cell",this.table.scenegraph.bodyGroup.firstChild.firstChild.row,this.table.scenegraph.bodyGroup.firstChild.lastChild.row),this.table.scenegraph.stage.render(),await this.progress()}else{const i="up"===e?this.rowStart+t:this.rowStart-t,r="up"===e?this.rowEnd+t:this.rowEnd-t,o=this.table.getRowsHeight(this.bodyTopRow,i-1);for(let n=this.bodyLeftCol;n<=this.bodyRightCol;n++){this.table.scenegraph.getColGroup(n).forEachChildren(((n,i)=>{this.updateCellGroupPosition(n,"up"===e?n.row+t:n.row-t,0===i?o:n._prev.attribute.y+n._prev.attribute.height)}))}let a,s;this.table.internalProps.autoRowHeight?(a=i,s=r):(a=Math.max(this.bodyTopRow,n-2*this.screenRowCount),s=Math.min(this.bodyBottomRow,n+3*this.screenRowCount)),console.log("更新同步范围",a,s);for(let t=this.bodyLeftCol;t<=this.bodyRightCol;t++)for(let e=a;e<=s;e++){const n=this.highPerformanceGetCell(t,e,i,r);this.updateCellGroupContent(n)}console.log("updateAutoRow",r>this.bodyBottomRow-(this.rowEnd-this.rowStart+1)?"down":"up"),this.table.internalProps.autoRowHeight&&zk(this.bodyLeftCol,this.bodyRightCol,a,s,this.table,r>this.bodyBottomRow-(this.rowEnd-this.rowStart+1)?"down":"up"),this.rowStart=i,this.rowEnd=r,this.currentRow="up"===e?this.currentRow+t:this.currentRow-t,this.totalRow="up"===e?this.totalRow+t:this.totalRow-t,this.referenceRow=this.rowStart+Math.floor((this.rowEnd-this.rowStart)/2),this.rowUpdatePos=this.rowStart,this.rowUpdateDirection=r>this.bodyBottomRow-(this.rowEnd-this.rowStart+1)?"down":"up",console.log("move total end proxy",this.rowStart,this.rowEnd),console.log("move total end cell",this.table.scenegraph.bodyGroup.firstChild.firstChild.row,this.table.scenegraph.bodyGroup.firstChild.lastChild.row),this.table.internalProps.autoRowHeight||await this.progress()}}async updateCellGroupsAsync(){this.updateCellGroups(this.taskRowCount)}updateCellGroups(t){const e=Math.min(this.bodyBottomRow,this.rowUpdatePos+t);console.log("updateCellGroups",this.rowUpdatePos,e);for(let t=this.bodyLeftCol;t<=this.bodyRightCol;t++)for(let n=this.rowUpdatePos;n<=e;n++){const e=this.highPerformanceGetCell(t,n);this.updateCellGroupContent(e)}this.table.internalProps.autoRowHeight&&zk(this.bodyLeftCol,this.bodyRightCol,this.rowUpdatePos,e,this.table,this.rowUpdateDirection),this.rowUpdatePos=e+1}updateCellGroupPosition(t,e,n){t.row=e,t.setAttribute("y",n),t.needUpdate=!0,t.needUpdateForAutoRowHeight=!0}updateCellGroupContent(t){t.needUpdate&&(this.table.scenegraph.updateCellContent(t.col,t.row),t.needUpdate=!1)}async sortCell(){for(let t=this.bodyLeftCol;t<=this.bodyRightCol;t++)for(let e=this.rowStart;e<=this.rowEnd;e++){this.highPerformanceGetCell(t,e).needUpdate=!0}let t,e;this.table.internalProps.autoRowHeight?(t=this.rowStart,e=this.rowEnd):(t=Math.max(this.bodyTopRow,this.screenTopRow-2*this.screenRowCount),e=Math.min(this.bodyBottomRow,this.screenTopRow+3*this.screenRowCount)),console.log("sort更新同步范围",t,e);for(let n=this.bodyLeftCol;n<=this.bodyRightCol;n++)for(let i=t;i<=e;i++){const t=this.highPerformanceGetCell(n,i);this.updateCellGroupContent(t)}if(console.log("updateAutoRow",this.rowEnd>this.bodyBottomRow-(this.rowEnd-this.rowStart+1)?"down":"up"),this.table.internalProps.autoRowHeight&&zk(this.bodyLeftCol,this.bodyRightCol,t,e,this.table,this.rowEnd>this.bodyBottomRow-(this.rowEnd-this.rowStart+1)?"down":"up"),this.rowUpdatePos=this.rowStart,this.rowUpdateDirection=this.rowEnd>this.bodyBottomRow-(this.rowEnd-this.rowStart+1)?"down":"up",this.rowEnd===this.table.scenegraph.proxy.bodyBottomRow&&this.rowStart===this.table.scenegraph.proxy.bodyTopRow);else if(this.rowEnd===this.table.scenegraph.proxy.bodyBottomRow){const t=this.table.getAllRowsHeight()-this.table.scenegraph.height;this.updateBody(t)}else this.rowStart===this.table.scenegraph.proxy.bodyTopRow&&this.updateBody(0);this.table.internalProps.autoRowHeight||await this.progress()}highPerformanceGetCell(t,e,n=this.rowStart,i=this.rowEnd){if(e<n||e>i)return Wk;if(this.cellCache.get(t)){const n=this.cellCache.get(t);if((n._next||n._prev)&&Math.abs(n.row-e)<e){let i=jk(n,e);return i||(i=this.table.scenegraph.getCell(t,e)),i.row&&this.cellCache.set(t,i),i}const i=this.table.scenegraph.getCell(t,e);return i.row&&this.cellCache.set(t,i),i}const r=this.table.scenegraph.getCell(t,e);return r.row&&this.cellCache.set(t,r),r}}function zk(t,e,n,i,r,o="up"){for(let o=n;o<=i;o++){let n=0;for(let i=t;i<=e;i++){const t=r.scenegraph.getCell(i,o);if(!t.row)continue;const e=t.getChildByName("text")||t.getChildByName("content"),a=u_(Bx("padding",r._getCellStyle(i,o),i,o,r)),s=e.AABBBounds.height()+(a[0]+a[2]);n=Math.max(n,s),t.needUpdateForAutoRowHeight=!1}for(let i=t;i<=e;i++){const t=r.scenegraph.getCell(i,o);ZS(r.scenegraph,t,i,o,n)}r.setRowHeight(o,n,!0)}if("up"===o)for(let o=t;o<=e;o++)for(let t=n;t<=i;t++){const e=r.scenegraph.getCell(o,t);if(!e.row)continue;let n;n=e._prev?(e._prev?.attribute.y??0)+(e._prev?.attribute.height??0):r.getRowsHeight(r.columnHeaderLevelCount,e.row-1),e.setAttribute("y",n)}else for(let o=t;o<=e;o++)for(let t=i;t>=n;t--){const e=r.scenegraph.getCell(o,t);if(!e.row)continue;let n;e._next?n=(e._next?.attribute.y??0)-(e.attribute.height??0):(n=r.getRowsHeight(r.columnHeaderLevelCount,e.row)-(e.attribute.height??0),console.log("估计位置",r.getRowsHeight(r.columnHeaderLevelCount,e.row))),e.setAttribute("y",n)}}function jk(t,e){return t?t.row===e?t:t.row>e?jk(t._prev,e):jk(t._next,e):null}function Nk(t,e){const n="undefined"!=typeof window?window.performance.now():0;t._clearColRangeWidthsMap();const i=[];if(e)for(let e=0;e<t.colCount;e++)i.push(t.getColWidth(e));for(let e=0;e<t.colCount;e++){let n;if(!t.internalProps.transpose&&"only-header"===t.internalProps.layoutMap.columnWidths?.[e]?.columnWidthComputeMode&&"showHeader"in t.internalProps.layoutMap){const i=t.internalProps.layoutMap.showHeader;t.internalProps.layoutMap.showHeader=!0,n=Gk(e,0,t.internalProps.layoutMap.headerLevelCount,t,!1),t.internalProps.layoutMap.showHeader=i}else n=t.internalProps.transpose||"only-body"!==t.internalProps.layoutMap.columnWidths?.[e]?.columnWidthComputeMode?Gk(e,0,t.rowCount-1,t,!1):Gk(e,t.internalProps.layoutMap.getBodyRange().start.row,t.internalProps.layoutMap.getBodyRange().end.row,t,!1);t._setColContentWidth(e,n),t.setColWidth(e,n,!1,!0)}if("adaptive"===t.widthMode){t._clearColRangeWidthsMap();const e=t.tableNoFrameWidth;let n=0;for(let e=0;e<t.colCount;e++)n+=t.getColWidth(e);const i=e/n;for(let n=0;n<t.colCount;n++){let r;r=n===t.colCount-1?e-t.getColsWidth(0,t.colCount-2):Math.round(t.getColWidth(n)*i),t.setColWidth(n,r,!1,!0)}}else if("standard-aeolus"===t.widthMode&&t.internalProps.transpose){t._clearColRangeWidthsMap();const e=t.tableNoFrameWidth;let n=0,i=0;for(let e=0;e<t.colCount;e++){const r=t.getColWidth(e);e<t.frozenColCount&&(i+=r),n+=r}if(n<e&&n-i>0){const r=(e-i)/(n-i);for(let e=t.frozenColCount;e<t.colCount;e++)t.setColWidth(e,t.getColWidth(e)*r,!1,!0)}}if(console.log("computeColsWidth time:",("undefined"!=typeof window?window.performance.now():0)-n),e)for(let e=0;e<t.colCount;e++){const n=t.getColWidth(e);n!==i[e]&&t.scenegraph.updateColWidth(e,n-i[e])}}function Gk(t,e,n,i,o){const{layoutMap:a,transpose:s}=i.internalProps,{width:l}=a.columnWidths?.[t]||{};if(s){if("standard"===i.widthMode)return i.isRowHeader(t,0)||i.isCornerHeader(t,0)?Array.isArray(i.defaultHeaderColWidth)?i.defaultHeaderColWidth[t]??i.defaultColWidth:i.defaultHeaderColWidth:i.defaultColWidth;if(("standard-aeolus"===i.widthMode||"adaptive"===i.widthMode)&&0===t&&"auto"!==l&&(a?.showColumnHeader||a?.showHeader)){if("string"==typeof l)return N_(l,i.internalProps.calcWidthContext);if(l)return l}}else if("auto"!==l&&"autoWidth"!==i.widthMode&&!o)return"string"==typeof l?N_(l,i.internalProps.calcWidthContext):l||i.getColWidth(t);return function(t,e,n,i,o){let a=0,s=1;n-e>5e3&&(s=Math.ceil((n-e)/5e3));for(let l=e;l<=n;l+=s){const e=Uk(t,l,o);if("number"==typeof e){a=Math.max(e,a);continue}const n=Kk(t,l,i,o);if("number"==typeof n){a=Math.max(n,a);continue}const s=o.isHeader(t,l)?o._getHeaderLayoutMap(t,l).headerType:o.getBodyColumnType(t,l);if("text"!==s&&"link"!==s&&"progressbar"!==s){a=Math.max(a,o.getColWidth(t)||0);continue}let h=0;const u=o.internalProps.layoutMap;if(u.isHeader(t,l)){const e=u.getHeader(t,l);if("only-body"===e?.define?.columnWidthComputeMode)continue;e?.hierarchyLevel&&(h=(e.hierarchyLevel??0)*(u.rowHierarchyIndent??0))}else{const e=o.getBodyColumnDefine(t,l);if(e?.tree){const e=o.dataSource.getIndexKey(o.getRecordIndexByRow(t,l));h=Array.isArray(e)&&o.getHierarchyState(t,l)!==r.none?(e.length-1)*(u.hierarchyIndent??0):0}}const c=Vk(t,l,o);a=Math.max(c+h,a)}const l=o.getMinColWidth(t),h=o.getMaxColWidth(t);if(a<l)return l;if(a>h)return h;return a}(t,e,n,o,i)}function Uk(t,e,n){const i=n.getCustomRender(t,e),r=n.getCustomLayout(t,e);if(i||r){let o=1,a=0;if(n.isHeader(t,e)||n.getBodyColumnDefine(t,e).mergeCell){const i=n.getCellRange(t,e);o=i.end.col-i.start.col+1}const s={col:t,row:e,dataValue:n.getCellOriginValue(t,e),value:n.getCellValue(t,e)||"",rect:Yk(t,e,n),table:n};if(r){const t=r(s);t.rootContainer.isRoot=!0;a=t.rootContainer.getContentSize().width??0}else if("function"==typeof i){const t=i(s);a=t?.expectedWidth??0}else a=i?.expectedWidth??0;return a/o}}function Kk(t,e,n,i){const{layoutMap:r}=i.internalProps;if(i.isPivotTable()&&r.isColumnIndicatorHeader(t,e)){const o=r.getBody(t,e);if(o&&o.width&&"auto"!==o.width&&!n){return Math.round(N_(o.width,i.internalProps.calcWidthContext))}}}function Vk(t,e,n){let i=0;const r=n.getCellValue(t,e),o=n._getCellStyle(t,e);let a=0;const l=n.getBodyColumnDefine(t,e);if("body"!==n.getCellType(t,e)||(!!l?.icon||!!l?.tree)){const i=n.getCellIcons(t,e);i?.forEach((t=>{t.positionType!==s.absoluteRight&&(a+=(t.width??0)+(t.marginLeft??0)+(t.marginRight??0))}))}let h=1;if(n.isHeader(t,e)||n.getBodyColumnDefine(t,e).mergeCell){const i=n.getCellRange(t,e);h=i.end.col-i.start.col+1}const u=u_(Bx("padding",o,t,e,n)),c=u[1]+u[3],d=Bx("fontSize",o,t,e,n),f=Bx("fontFamily",o,t,e,n),p=A(r).split("\n")||[];return p.length>=1?p.forEach((t=>{const e=n.measureText(t.slice(0,n.options.maxCharactersNumber||200),{fontSize:d,fontFamily:f}).width;i=Math.max((e+c+4+a)/h,i)})):i=Math.max((c+4+a)/h,i),!1!==n.internalProps.limitMaxAutoWidth&&(i=Math.min("number"==typeof n.internalProps.limitMaxAutoWidth?n.internalProps.limitMaxAutoWidth:450,i)),i}function Yk(t,e,n){return{left:0,top:0,right:n.getColWidth(t),bottom:n.getRowHeight(e),width:n.getColWidth(t),height:n.getRowHeight(e)}}function Xk(t,e,n){const[i,r,o,a]=e.split("-"),s=parseInt(i,10),l=parseInt(r,10),h=parseInt(o,10),u=parseInt(a,10);let c;for(let t=s;t<=h;t++)for(let e=l;e<=u;e++){const i=n.highPerformanceGetCell(t,e);if("cell"!==i.role)continue;i.AABBBounds.width();const r=i.globalAABBBounds;c?c.union(r):c=r}c?t.rect.setAttributes({x:c.x1-n.tableGroup.attribute.x,y:c.y1-n.tableGroup.attribute.y,width:c.width(),height:c.height(),visible:!0}):t.rect.setAttributes({visible:!1});const d=s===n.table.frozenColCount,f=l===n.table.frozenRowCount;d&&t.rect.attribute.stroke[3]||f&&t.rect.attribute.stroke[0]?(d&&n.tableGroup.insertAfter(t.rect,"columnHeader"===t.role?n.cornerHeaderGroup:n.rowHeaderGroup),f&&n.tableGroup.insertAfter(t.rect,"rowHeader"===t.role?n.cornerHeaderGroup:n.colHeaderGroup),t.rect.attribute.x<n.rowHeaderGroup.attribute.width&&n.table.scrollLeft>0&&("body"===t.role||"columnHeader"===t.role)&&t.rect.setAttributes({x:t.rect.attribute.x+(n.rowHeaderGroup.attribute.width-t.rect.attribute.x),width:t.rect.attribute.width-(n.rowHeaderGroup.attribute.width-t.rect.attribute.x)}),t.rect.attribute.y<n.colHeaderGroup.attribute.height&&n.table.scrollTop>0&&("body"===t.role||"rowHeader"===t.role)&&t.rect.setAttributes({y:t.rect.attribute.y+(n.colHeaderGroup.attribute.height-t.rect.attribute.y),height:t.rect.attribute.height-(n.colHeaderGroup.attribute.height-t.rect.attribute.y)})):n.tableGroup.insertAfter(t.rect,"body"===t.role?n.bodyGroup:"columnHeader"===t.role?n.colHeaderGroup:"rowHeader"===t.role?n.rowHeaderGroup:n.cornerHeaderGroup)}function $k(t,e,n){const i=n.scenegraph,r=qk(t.map((t=>t.row))).sort(((t,e)=>t-e)),o=qk(e.map((t=>t.row))).sort(((t,e)=>t-e));r.forEach((t=>{!function(t,e){for(let n=0;n<e.table.colCount;n++){const i=e.getColGroup(n,!1);let r;i.forEachChildren((e=>e.row===t&&(r=e,!0))),r&&i.removeChild(r)}}(t,i)})),r.length&&function(t){for(let e=0;e<t.table.colCount;e++){const n=t.getColGroup(e,!0),i=t.getColGroup(e,!1);let r=n.firstChild?.row;n.forEachChildren((t=>{t.row=r,r++})),r=i.firstChild?.row,i.forEachChildren((t=>{t.row=r,r++}))}}(i),o.forEach((t=>{!function(t,e){for(let n=0;n<e.table.colCount;n++){const i=VS(n,t,e.table,!0);if(!i)continue;const r=e.getColGroup(n);if(r.firstChild&&t<r.firstChild.row)r.insertBefore(i,r.firstChild);else if(r.lastChild&&t>r.lastChild.row)r.appendChild(i);else{let e;r.forEachChildren((n=>n.row===t&&(e=n,!0))),e!==i&&r.insertBefore(i,e)}let o=r.firstChild?.row;r.forEachChildren((t=>{t.row=o,o++}))}}(t,i)})),function(t){let e=0;for(let n=0;n<t.table.colCount;n++){const i=t.getColGroup(n,!0),r=t.getColGroup(n,!1);let o=i.firstChild?.row,a=0;o=r.firstChild?.row,a=0,r.forEachChildren((t=>{t.row=o,o++,"cell"===t.role&&(t.setAttribute("y",a),a+=t.attribute.height)})),e=a}t.updateContainerHeight(t.table.frozenRowCount,e-t.bodyGroup.attribute.height)}(i)}function qk(t){const e=[];for(let n=0;n<t.length;n++)-1===e.indexOf(t[n])&&e.push(t[n]);return e}new Nh({});const Zk=[];function Jk(t){Zk.forEach((e=>{t.scenegraph.getCell(e.col,e.row).forEachChildren((t=>{t.setAttributes({dy:0,dx:0})}))})),Zk.length=0;const{scrollTop:e,scrollLeft:n,frozenRowCount:i,frozenColCount:r}=t,o=t.getFrozenRowsHeight(),a=t.getFrozenColsWidth(),{row:s}=t.getRowAt(e+o+1),{col:l}=t.getColAt(n+a+1),h=t.getAllRowsHeight()>t.tableNoFrameHeight?t.getRowAt(e+t.tableNoFrameHeight-1).row:t.rowCount-1,u=t.getAllColsWidth()>t.tableNoFrameWidth?t.getColAt(n+t.tableNoFrameWidth-1).col:t.colCount-1;for(let e=0;e<i;e++)for(let n=0;n<=u;n++)if(t._getCellStyle(n,e)?.textStick){tA(t.scenegraph.getCell(n,e),0,t.tableNoFrameWidth),Zk.push({col:n,row:e})}if(-1!==s){for(let e=s;e<=h;e++)for(let n=0;n<r;n++)if(t._getCellStyle(n,e)?.textStick&&"tree"!==t.internalProps.layoutMap.rowHierarchyType){Qk(t.scenegraph.getCell(n,e),o,t.tableNoFrameHeight),Zk.push({col:n,row:e})}for(let e=s;e<=h;e++)for(let n=l;n<=u;n++)if(t._getCellStyle(n,e)?.textStick){const i=t.scenegraph.getCell(n,e);Qk(i,o,t.tableNoFrameHeight),tA(i,a,t.tableNoFrameWidth),Zk.push({col:n,row:e})}}}function Qk(t,e,n){const i=t.getChildByName("text",!0);if(!i)return;i.AABBBounds.width();const r=i.globalAABBBounds.y1,o=i.globalAABBBounds.y2;if(r<e){const n=r-e;t.forEachChildren((t=>{t.setAttribute("dy",2-n)}))}else if(o>n){const e=o-n;t.forEachChildren((t=>{t.setAttribute("dy",-e)}))}}function tA(t,e,n){const i=t.getChildByName("text",!0);if(!i)return;i.AABBBounds.width();const r=i.globalAABBBounds.x1,o=i.globalAABBBounds.x2;if(r<e){const n=r-e;t.forEachChildren((t=>{t.setAttribute("dx",2-n)}))}else if(o>n){const e=o-n;t.forEachChildren((t=>{t.setAttribute("dx",-e)}))}}function eA(t){const e=t.bodyGroup.firstChild instanceof Rx?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 nA(t){const e=t.colHeaderGroup.firstChild instanceof Rx?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 iA(t){const e=t.rowHeaderGroup.lastChild instanceof Rx?t.rowHeaderGroup.lastChild:t.rowHeaderGroup.lastChild?._prev;e&&(t.bodyGroup.firstChild?t.bodyGroup.insertBefore(e,t.bodyGroup.firstChild):t.bodyGroup.appendChild(e),t.bodyGroup.setAttribute("width",t.bodyGroup.attribute.width+e.attribute.width),t.rowHeaderGroup.setAttribute("width",t.rowHeaderGroup.attribute.width-e.attribute.width))}function rA(t){const e=t.cornerHeaderGroup.lastChild instanceof Rx?t.cornerHeaderGroup.lastChild:t.cornerHeaderGroup.lastChild?._prev;e&&(t.colHeaderGroup.firstChild?t.colHeaderGroup.insertBefore(e,t.colHeaderGroup.firstChild):t.bodyGroup.appendChild(e),t.colHeaderGroup.setAttribute("width",t.colHeaderGroup.attribute.width+e.attribute.width),t.cornerHeaderGroup.setAttribute("width",t.cornerHeaderGroup.attribute.width-e.attribute.width))}os.load(Dk);class oA{proxy;tableGroup;colHeaderGroup;cornerHeaderGroup;rowHeaderGroup;bodyGroup;componentGroup;selectedRangeComponents;selectingRangeComponents;lastSelectId;component;stage;table;isPivot;transpose;hasFrozen;frozenColCount;frozenRowCount;clear;mergeMap;constructor(t){var e;this.table=t,this.hasFrozen=!1,this.clear=!0,this.mergeMap=new Map,this.stage=(e={canvas:t.canvas,width:t.canvas.width,height:t.canvas.height,disableDirtyBounds:!1,background:t.theme.underlayBackgroundColor,dpr:t.internalProps.pixelRatio},new Ax(e)),this.stage.defaultLayer.setTheme({group:{boundsPadding:0,strokeBoundsBuffer:0,lineJoin:"round"}}),this.initSceneGraph(),this.stage.defaultLayer.add(this.tableGroup),this.stage.table=this.table,this.createComponent()}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}get bodyRowStart(){return this.transpose||this.isPivot?this.table.columnHeaderLevelCount:this.proxy.rowStart??0}get bodyRowEnd(){return this.transpose||this.isPivot?this.table.rowCount-1:this.proxy.rowEnd??0}initSceneGraph(){this.isPivot=this.table.isPivotTable(),this.transpose=this.table.options.transpose;const t=this.table.tableNoFrameWidth,e=this.table.tableNoFrameHeight;this.tableGroup=new Rx({x:0,y:0,width:t,height:e,clip:!0,pickable:!1}),this.tableGroup.role="table";const n=new Rx({x:0,y:0,width:0,height:0,clip:!1,pickable:!1});n.role="col-header",this.colHeaderGroup=n;const i=new Rx({x:0,y:0,width:0,height:0,clip:!1,pickable:!1});i.role="corner-header",this.cornerHeaderGroup=i;const r=new Rx({x:0,y:0,width:0,height:0,clip:!1,pickable:!1});r.role="row-header",this.rowHeaderGroup=r;const o=new Rx({x:0,y:0,width:t,height:0,clip:!1,pickable:!1});o.role="body",this.bodyGroup=o;const a=new Rx({x:0,y:0,width:0,height:0,clip:!1,pickable:!1,childrenPickable:!0});a.role="component",this.componentGroup=a,this.tableGroup.addChild(o),this.tableGroup.addChild(r),this.tableGroup.addChild(n),this.tableGroup.addChild(i),this.tableGroup.addChild(a)}clearCells(){this.clear=!0,this.hasFrozen=!1,this.mergeMap.clear(),this.colHeaderGroup.clear(),this.rowHeaderGroup.clear(),this.cornerHeaderGroup.clear(),this.bodyGroup.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.tableGroup.setAttributes({x:0,y:0,width:0,height:0}),this.tableGroup.border&&(this.tableGroup.parent.removeChild(this.tableGroup.border),delete this.tableGroup.border)}createComponent(){this.component=new gk(this.table),this.component.addToGroup(this.componentGroup),this.selectedRangeComponents=new Map,this.selectingRangeComponents=new Map}createSceneGraph(){this.clear=!1,Nk(this.table),this.frozenColCount=this.table.rowHeaderLevelCount,this.frozenRowCount=this.table.columnHeaderLevelCount,this.proxy=new Fk(this.table),vk(this.tableGroup,this.table.theme.frameStyle,this.tableGroup.role,void 0,!0),this.createHeaderSceneGraph(),this.transpose||this.isPivot?this.createBodySceneGraph():this.createBodySceneGraphForFirstScreen()}createHeaderSceneGraph(){var t,e,n,i;t=this.cornerHeaderGroup,e=0,n=0,i=this.table,$S(t,e,n,0,i.rowHeaderLevelCount-1,0,i.columnHeaderLevelCount-1,"cornerHeader",i),this.colHeaderGroup.setAttribute("x",this.cornerHeaderGroup.attribute.width),function(t,e,n,i){$S(t,e,n,i.rowHeaderLevelCount,i.colCount-1,0,i.columnHeaderLevelCount-1,"columnHeader",i)}(this.colHeaderGroup,0,0,this.table)}createBodySceneGraph(){var t,e,n,i;this.rowHeaderGroup.setAttribute("y",this.colHeaderGroup.attribute.height),t=this.rowHeaderGroup,e=0,n=0,i=this.table,$S(t,e,n,0,i.rowHeaderLevelCount-1,i.columnHeaderLevelCount,i.rowCount-1,"rowHeader",i),this.bodyGroup.setAttributes({y:this.colHeaderGroup.attribute.height,x:this.rowHeaderGroup.attribute.width}),function(t,e,n,i){$S(t,e,n,i.rowHeaderLevelCount,i.colCount-1,i.columnHeaderLevelCount,i.rowCount-1,"body",i)}(this.bodyGroup,0,0,this.table),this.afterScenegraphCreated()}createBodySceneGraphForFirstScreen(){this.rowHeaderGroup.setAttribute("y",this.colHeaderGroup.attribute.height),this.bodyGroup.setAttributes({y:this.colHeaderGroup.attribute.height,x:this.rowHeaderGroup.attribute.width}),console.log("before-createBodyColGroupForFirstScreen"),this.proxy.createColGroupForFirstScreen(this.rowHeaderGroup,this.bodyGroup,0,0,this.table),console.log("after-createBodyColGroupForFirstScreen"),this.afterScenegraphCreated()}renderSceneGraph(){this.stage.render()}getCellOld(t,e){let n;if(n=this.hasFrozen&&t<this.table.frozenColCount&&e<this.table.frozenRowCount?this.cornerHeaderGroup.getChildAt(t)?.getChildAt(e):e<this.table.frozenRowCount?this.colHeaderGroup.getChildAt(this.hasFrozen?t-this.table.frozenColCount:t)?.getChildAt(e):t<this.table.frozenColCount?this.rowHeaderGroup.getChildAt(t)?.getChildAt(e-this.table.frozenRowCount):this.bodyGroup.getChildAt(t-this.table.frozenColCount)?.getChildAt(e-this.table.frozenRowCount),n&&"shadow-cell"===n.role){const i=this.table.getCellRange(t,e);n=this.getCell(i.start.col,i.start.row)}return n||void 0}getColGroupOld(t,e=!1){let n;return n=t<this.frozenColCount&&e?this.cornerHeaderGroup.getChildAt(t):t<this.frozenColCount?this.rowHeaderGroup.getChildAt(t):e?this.rowHeaderGroup.getChildAt(t-this.frozenColCount):this.bodyGroup.getChildAt(t-this.frozenColCount),n||void 0}getCell(t,e,n){let i=this.getColGroup(t,e<this.frozenRowCount)?.getRowGroup(e);if(i&&"shadow-cell"===i.role&&!n){const n=this.table.getCellRange(t,e);i=this.getCell(n.start.col,n.start.row)}return i||Wk}highPerformanceGetCell(t,e){return this.isPivot||this.transpose||this.table.isHeader(t,e)?this.getCell(t,e):this.proxy.highPerformanceGetCell(t,e,0,this.table.rowCount-1)}getColGroup(t,e=!1){let n;return n=t<this.frozenColCount&&e?this.cornerHeaderGroup.getColGroup(t):t<this.frozenColCount?this.rowHeaderGroup.getColGroup(t):e?this.colHeaderGroup.getColGroup(t):this.bodyGroup.getColGroup(t),n||void 0}getCellSize(t,e){const n=this.getCell(t,e),i=zx(this.table,t,e);let r=n.attribute.width,o=n.attribute.height;return i&&(r/=i.end.col-i.start.col+1,o/=i.end.row-i.start.row+1),{width:r,height:o}}updateNextFrame(){this.resetAllSelectComponent(),this.stage.renderNextFrame()}resetAllSelectComponent(){var t;(t=this).selectingRangeComponents.forEach(((e,n)=>{Xk(e,n,t)})),t.selectedRangeComponents.forEach(((e,n)=>{Xk(e,n,t)}))}hideHoverIcon(t,e){if(-1===t||-1===e)return;sA(this,this.getCell(t,e),"mouseenter_cell")}showHoverIcon(t,e){if(-1===t||-1===e)return;aA(this,this.getCell(t,e),"mouseenter_cell")}hideClickIcon(t,e){if(-1===t||-1===e)return;sA(this,this.getCell(t,e),"click_cell")}showClickIcon(t,e){if(-1===t||-1===e)return;aA(this,this.getCell(t,e),"click_cell")}deactivateChart(t,e){if(-1===t||-1===e)return;const n=this.getCell(t,e);n?.firstChild?.deactivate?.()}activateChart(t,e){if(-1===t||-1===e)return;const n=this.getCell(t,e);n?.firstChild?.activate?.(this.table)}removeInteractionBorder(t,e){const n=this.getCell(t,e);n.setAttribute("highlightStroke",void 0),n.setAttribute("highlightStrokeArrayWidth",void 0),n.setAttribute("highlightStrokeArrayColor",void 0)}createCellSelectBorder(t,e,n,i,r,o,a){!function(t,e,n,i,r,o,a,s){const l=Math.min(e,i),h=Math.min(n,r),u=Math.max(e,i),c=Math.max(n,r);let d;for(let e=l;e<=u;e++)for(let n=h;n<=c;n++){const i=t.highPerformanceGetCell(e,n);if("shadow-cell"===i.role)continue;i.AABBBounds.width();const r=i.globalAABBBounds;d?d.union(r):d=r}const f=t.table.theme,p=f.selectionStyle?.cellBorderColor,g=f.selectionStyle?.cellBorderLineWidth,v=yf({pickable:!1,fill:f.selectionStyle?.cellBgColor??"rgba(0, 0, 255,0.1)",lineWidth:g,stroke:s.map((t=>!!t&&p)),x:d.x1-t.tableGroup.attribute.x,y:d.y1-t.tableGroup.attribute.y,width:d.width(),height:d.height(),visible:!0});t.lastSelectId=a,t.selectingRangeComponents.set(`${l}-${h}-${u}-${c}-${a}`,{rect:v,role:o}),t.tableGroup.insertAfter(v,"body"===o?t.bodyGroup:"columnHeader"===o?t.colHeaderGroup:"rowHeader"===o?t.rowHeaderGroup:t.cornerHeaderGroup)}(this,t,e,n,i,r,o,a)}moveSelectingRangeComponentsToSelectedRangeComponents(){var t;(t=this).selectingRangeComponents.forEach(((e,n)=>{t.selectedRangeComponents.get(n)&&t.selectedRangeComponents.get(n).rect.delete(),t.selectedRangeComponents.set(n,e)})),t.selectingRangeComponents=new Map,t.updateNextFrame()}deleteLastSelectedRangeComponents(){var t;(t=this).selectedRangeComponents.forEach(((e,n)=>{n.split("-")[4]===t.lastSelectId&&(e.rect.delete(),t.selectedRangeComponents.delete(n))}))}deleteAllSelectBorder(){var t;(t=this).selectedRangeComponents.forEach(((t,e)=>{t.rect.delete()})),t.selectedRangeComponents=new Map}updateCellSelectBorder(t,e,n,i){!function(t,e,n,i,r){let o=Math.min(i,e),a=Math.min(r,n),s=Math.max(i,e),l=Math.max(r,n);const h=()=>{let e=!1;for(let n=o;n<=s;n++){if(n===o)for(let i=a;i<=l;i++){const r=zx(t.table,n,i);if(r&&r.start.col<o){o=r.start.col,e=!0;break}}if(!e&&n===s)for(let i=a;i<=l;i++){const r=zx(t.table,n,i);if(r&&r.end.col>s){s=r.end.col,e=!0;break}}if(e)break}if(!e)for(let n=a;n<=l;n++){if(n===a)for(let i=o;i<=s;i++){const r=zx(t.table,i,n);if(r&&r.start.row<a){a=r.start.row,e=!0;break}}if(!e&&n===l)for(let i=o;i<=s;i++){const r=zx(t.table,i,n);if(r&&r.end.row>l){l=r.end.row,e=!0;break}}if(e)break}e&&h()};h(),t.selectingRangeComponents.forEach(((t,e)=>{t.rect.delete()})),t.selectingRangeComponents=new Map;let u=!1,c=!1,d=!1,f=!1;if(o<=t.table.frozenColCount-1&&a<=t.table.frozenRowCount-1&&(f=!0),o<=t.table.frozenColCount-1&&l>=t.table.frozenRowCount&&(u=!0),a<=t.table.frozenRowCount-1&&s>=t.table.frozenColCount&&(c=!0),s>=t.table.frozenColCount&&l>=t.table.frozenRowCount&&(d=!0),f){const e=Math.min(s,t.table.frozenColCount-1),n=Math.min(l,t.table.frozenRowCount-1),i=[!0,!c,!u,!0];t.createCellSelectBorder(o,a,e,n,"cornerHeader",`${o}${a}${s}${l}`,i)}if(c){const e=Math.max(o,t.table.frozenColCount),n=Math.min(l,t.table.frozenRowCount-1),i=[!0,!0,!d,!f];t.createCellSelectBorder(e,a,s,n,"columnHeader",`${o}${a}${s}${l}`,i)}if(u){const e=Math.max(a,t.table.frozenRowCount),n=Math.min(s,t.table.frozenColCount-1),i=[!f,!d,!0,!0];t.createCellSelectBorder(o,e,n,l,"rowHeader",`${o}${a}${s}${l}`,i)}if(d){const e=Math.max(o,t.table.frozenColCount),n=Math.max(a,t.table.frozenRowCount),i=[!c,!0,!0,!u];t.createCellSelectBorder(e,n,s,l,"body",`${o}${a}${s}${l}`,i)}}(this,t,e,n,i)}getIcon(t,e,n,i){let r;return this.getCell(t,e).forEachChildren((t=>{"icon"===t.role&&t.containsPoint(n,i,Mo.GLOBAL)&&(r=t)})),r}setIconHoverStyle(t,e,n,i){if(t.attribute.backgroundColor){let e=t.parent.getChildByName("icon-back");e?e.setAttributes({x:(t.attribute.x??0)+(t.attribute.dx??0)+(t.AABBBounds.width()-t.backgroundWidth)/2,y:(t.attribute.y??0)+(t.AABBBounds.height()-t.backgroundHeight)/2,width:t.backgroundWidth,height:t.backgroundHeight,fill:t.attribute.backgroundColor,cornerRadius:5,visible:!0}):(e=yf({x:(t.attribute.x??0)+(t.attribute.dx??0)+(t.AABBBounds.width()-t.backgroundWidth)/2,y:(t.attribute.y??0)+(t.AABBBounds.height()-t.backgroundHeight)/2,width:t.backgroundWidth,height:t.backgroundHeight,fill:t.attribute.backgroundColor,cornerRadius:5,pickable:!1,visible:!0}),e.name="icon-back"),t.parent.insertBefore(e,t)}if(t.attribute.hoverImage&&t.attribute.image!==t.attribute.hoverImage&&(t.image=t.attribute.hoverImage),t.tooltip){const{x1:i,x2:r,y1:o,y2:a}=t.globalAABBBounds,s={content:t.tooltip.title,referencePosition:{rect:{left:i-this.table.tableX,right:r-this.table.tableX,top:o-this.table.tableY,bottom:a-this.table.tableY,width:t.globalAABBBounds.width(),height:t.globalAABBBounds.height()},placement:t.tooltip.placement},style:Object.assign({},this.table.internalProps.theme?.tooltipStyle,t.tooltip?.style)};this.table.internalProps.tooltipHandler.isBinded(s)||this.table.showTooltip(e,n,s)}}setIconNormalStyle(t,e,n){const i=t.parent.getChildByName("icon-back");i&&i.setAttribute("visible",!1),t.attribute.hoverImage&&t.attribute.image!==t.attribute.originImage&&(t.image=t.attribute.originImage)}updateColWidth(t,e){!function(t,e,n){const{autoRowHeight:i}=t.table.internalProps;let r=!1;const o=t.getColGroup(e,!0),a=o?.attribute.width;if(o?.setAttribute("width",a+n),o?.forEachChildren(((o,s)=>{if(ek(t,o,e,o.row,a,n,t.table.columnHeaderLevelCount,i)){const e=zx(t.table,o.col,o.row);if(e&&e.end.row-e.start.row)for(let n=e.start.row;n<=e.end.row;n++)nk(t,n);else nk(t,o.row);r=!0}})),r){let e=0;for(let n=0;n<t.table.colCount;n++){const i=t.getColGroup(n,!0);let r=0;i.forEachChildren((t=>{"cell"===t.role&&(t.setAttribute("y",r),r+=t.attribute.height)})),e=r}t.updateContainerHeight(0,e-t.colHeaderGroup.attribute.height)}r=!1;const s=t.getColGroup(e),l=s.attribute.width;if(s?.setAttribute("width",l+n),s?.forEachChildren(((e,o)=>{if(ek(t,e,e.col,e.row,l,n,t.table.rowHeaderLevelCount,i)){const n=zx(t.table,e.col,e.row);if(n&&n.end.row-n.start.row)for(let e=n.start.row;e<=n.end.row;e++)nk(t,e);else nk(t,e.row);r=!0}})),r){let e=0;for(let n=0;n<t.table.colCount;n++){const i=t.getColGroup(n,!1);let r=0;i.forEachChildren((t=>{"cell"===t.role&&(t.setAttribute("y",r),r+=t.attribute.height)})),e=r}t.updateContainerHeight(t.table.frozenRowCount,e-t.bodyGroup.attribute.height)}e<t.frozenColCount?(t.cornerHeaderGroup.forEachChildrenSkipChild(((t,i)=>{t.col>e&&t.setAttribute("x",t.attribute.x+n)})),t.rowHeaderGroup.forEachChildrenSkipChild(((t,i)=>{t.col>e&&t.setAttribute("x",t.attribute.x+n)}))):(t.colHeaderGroup.forEachChildrenSkipChild(((t,i)=>{t.col>e&&t.setAttribute("x",t.attribute.x+n)})),t.bodyGroup.forEachChildrenSkipChild(((t,i)=>{t.col>e&&t.setAttribute("x",t.attribute.x+n)}))),t.table.setColWidth(e,s.attribute.width,!0)}(this,t,e),this.updateContainer()}updateChartSize(t){!function(t,e){for(let n=e;n<t.table.colCount;n++){const e=t.getColGroup(n),i=e.attribute?.chartInstance;i&&e.getChildren().forEach((e=>{const n=t.table.getColWidth(e.col),i=t.table.getRowHeight(e.row);e.children.forEach((r=>{"chart"===r.type&&(r.cacheCanvas=null,r.setAttribute("width",Math.ceil(n-r.attribute.cellPadding[3]-r.attribute.cellPadding[1])),r.setAttribute("height",Math.ceil(i-r.attribute.cellPadding[0]-r.attribute.cellPadding[2])),r.setAttribute("viewBox",{x1:Math.ceil(e.globalAABBBounds.x1+r.attribute.cellPadding[3]+t.table.scrollLeft),x2:Math.ceil(e.globalAABBBounds.x1+n-r.attribute.cellPadding[1]+t.table.scrollLeft),y1:Math.ceil(e.globalAABBBounds.y1+r.attribute.cellPadding[0]+t.table.scrollTop),y2:Math.ceil(e.globalAABBBounds.y1+i-r.attribute.cellPadding[2]+t.table.scrollTop)}))}))}))}}(this,t)}updateAutoColWidth(t){const e=this.table.getColWidth(t),n=Gk(t,0,this.table.rowCount-1,this.table,!0);n!==e&&this.updateColWidth(t,n-e)}recalculateColWidths(){Nk(this.table,!0)}resize(){this.recalculateColWidths(),this.table.internalProps.autoRowHeight&&QS(this),this.dealWidthMode(),this.dealFrozen(),this.updateTableSize(),this.updateBorderSizeAndPosition(),this.component.updateScrollBar(),this.updateNextFrame()}updateTableSize(){this.tableGroup.setAttributes({width:Math.min(this.table.tableNoFrameWidth,Math.max(this.colHeaderGroup.attribute.width,this.bodyGroup.attribute.width,0)+Math.max(this.cornerHeaderGroup.attribute.width,this.rowHeaderGroup.attribute.width,0)),height:Math.min(this.table.tableNoFrameHeight,(this.colHeaderGroup.attribute.height??0)+(this.bodyGroup.attribute.height??0))}),this.tableGroup.border&&this.tableGroup.border.setAttributes({width:this.tableGroup.attribute.width+this.tableGroup.border.attribute.lineWidth,height:this.tableGroup.attribute.height+this.tableGroup.border.attribute.lineWidth})}updateRowHeight(t,e){!function(t,e,n){for(let i=0;i<t.table.colCount;i++){const r=t.getCell(i,e),o=zx(t.table,i,e);o&&o.start.col!==i||(qS(t,r,i,e,r.attribute.height,n,t.table.isHeader(i,e)),t.updateCellContentWhileResize(i,e))}let i=0,r=0;e<t.table.columnHeaderLevelCount?(t.colHeaderGroup.setAttribute("height",t.colHeaderGroup.attribute.height+n),t.rowHeaderGroup.setAttribute("y",t.colHeaderGroup.attribute.y+n),t.bodyGroup.setAttribute("y",t.bodyGroup.attribute.y+n),i=e+1,r=t.table.columnHeaderLevelCount-1):(i=e+1,r=t.bodyRowEnd);for(let e=i;e<=r;e++)for(let i=0;i<t.table.colCount;i++){const r=t.getCell(i,e),o=zx(t.table,i,e);(!o||o.start.col===i&&o.start.row===e)&&r.setAttribute("y",r.attribute.y+n)}t.table.setRowHeight(e,t.table.getRowHeight(e)+n,!0)}(this,t,e),this.updateContainerHeight(t,e)}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.frozenRowCount?(this.colHeaderGroup.setDeltaHeight(e),this.cornerHeaderGroup.setDeltaHeight(e),this.rowHeaderGroup.setDeltaY(e),this.bodyGroup.setDeltaY(e)):(this.rowHeaderGroup.setDeltaHeight(e),this.bodyGroup.setDeltaHeight(e)),this.updateTableSize(),this.component.updateScrollBar(),this.updateNextFrame()}setColWidth(t,e){const n=this.table.getColWidth(t);n!==e&&this.updateColWidth(t,e-n)}setRowHeight(t,e){const n=this.table.getRowHeight(t);this.updateRowHeight(t,e-n)}setX(t){this.colHeaderGroup.attribute.width+t!==this.bodyGroup.attribute.x&&(this.bodyGroup.setAttribute("x",this.rowHeaderGroup.attribute.width+t),this.colHeaderGroup.setAttribute("x",this.rowHeaderGroup.attribute.width+t),this.updateNextFrame())}setY(t){if(this.transpose||this.isPivot){if(this.colHeaderGroup.attribute.height+t===this.bodyGroup.attribute.y)return;this.bodyGroup.setAttribute("y",this.colHeaderGroup.attribute.height+t),this.rowHeaderGroup.setAttribute("y",this.colHeaderGroup.attribute.height+t),this.updateNextFrame()}else this.table.scenegraph.proxy&&this.table.scenegraph.proxy.setY(-t)}setBodyAndRowHeaderY(t){this.colHeaderGroup.attribute.height+t!==this.bodyGroup.attribute.y&&(this.bodyGroup.setAttribute("y",this.colHeaderGroup.attribute.height+t),this.rowHeaderGroup.setAttribute("y",this.colHeaderGroup.attribute.height+t),this.updateNextFrame())}afterScenegraphCreated(){const{autoRowHeight:t}=this.table.internalProps;t&&QS(this),this.dealWidthMode(),this.dealFrozen(),this.createFrameBorder(),this.updateBorderSizeAndPosition(),this.component.updateScrollBar(),Jk(this.table),this.updateNextFrame()}dealWidthMode(){const t=this.table;if("adaptive"===t.widthMode){const e=t.tableNoFrameWidth;let n=0;for(let e=0;e<t.colCount;e++)n+=t.getColWidth(e);const i=e/n;for(let n=0;n<t.colCount;n++){let r;r=n===t.colCount-1?e-t.getColsWidth(0,t.colCount-2):Math.round(t.getColWidth(n)*i),this.setColWidth(n,r)}}else if("standard-aeolus"===t.widthMode&&this.transpose){const e=t.tableNoFrameWidth;let n=0,i=0;for(let e=0;e<t.colCount;e++){const r=t.getColWidth(e);e<t.frozenColCount&&(i+=r),n+=r}if(n<e&&n-i>0){const r=(e-i)/(n-i);for(let e=t.frozenColCount;e<t.colCount;e++)this.setColWidth(e,t.getColWidth(e)*r)}}let e=0;this.bodyGroup.forEachChildrenSkipChild((t=>{e+=t.attribute.width})),this.bodyGroup.setAttribute("width",e);let n=0;this.colHeaderGroup.forEachChildrenSkipChild((t=>{n+=t.attribute.width})),this.colHeaderGroup.setAttribute("width",n);let i=0;this.rowHeaderGroup.forEachChildrenSkipChild((t=>{i+=t.attribute.width})),this.rowHeaderGroup.setAttribute("width",i);let r=0;this.cornerHeaderGroup.forEachChildrenSkipChild((t=>{r+=t.attribute.width})),this.cornerHeaderGroup.setAttribute("width",r),this.colHeaderGroup.setAttribute("x",this.cornerHeaderGroup.attribute.width),this.rowHeaderGroup.setAttribute("y",this.colHeaderGroup.attribute.height),this.bodyGroup.setAttributes({x:this.rowHeaderGroup.attribute.width,y:this.colHeaderGroup.attribute.height})}dealFrozen(){!function(t){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++)eA(t),nA(t)}else if(t.table.frozenColCount<t.table.rowHeaderLevelCount)for(let e=0;e<t.table.rowHeaderLevelCount-t.table.frozenColCount;e++)iA(t),rA(t);t.bodyGroup.setAttribute("x",t.rowHeaderGroup.attribute.width),t.colHeaderGroup.setAttribute("x",t.cornerHeaderGroup.attribute.width),t.updateContainer(),t.updateBorderSizeAndPosition(),t.isPivot||t.transpose||t.component.setFrozenColumnShadow(t.table.frozenColCount-1),t.hasFrozen=!0,t.frozenColCount=t.table.frozenColCount,t.frozenRowCount=t.colHeaderGroup.firstChild?.childrenCount??0}(this)}resetFrozen(){!function(t){if(t.frozenColCount>t.table.rowHeaderLevelCount)for(let e=0;e<t.frozenColCount-t.table.rowHeaderLevelCount;e++)iA(t),rA(t);else if(t.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.rowHeaderLevelCount-t.frozenColCount;e++)eA(t),nA(t)}t.bodyGroup.setAttribute("x",t.rowHeaderGroup.attribute.width),t.colHeaderGroup.setAttribute("x",t.cornerHeaderGroup.attribute.width),t.updateContainer(),t.updateBorderSizeAndPosition(),t.isPivot||t.transpose||t.component.setFrozenColumnShadow(t.table.frozenColCount-1),t.hasFrozen=!0,t.frozenColCount=t.table.rowHeaderLevelCount,t.frozenRowCount=t.colHeaderGroup.firstChild?.childrenCount??0}(this)}updateCellLayoutWidthCertainWidth(t,e,n){const i=t.attribute.width;let r=!1;return t.forEachChildren(((t,o)=>{o+=e;const a=zx(this.table,n,o);a?t=this.getCell(a.start.col,a.start.row):t.setAttribute("width",i);const s=u_(Bx("padding",this.table._getCellStyle(n,o),n,o,this.table)),l=t.getChildByName("text");let h=0,u=0;if(l)h=l.AABBBounds.height()+(s[0]+s[2]),l.setAttribute("maxLineWidth",i-(s[1]+s[3])),u=l.AABBBounds.height()+(s[0]+s[2]);else{const e=t.getChildAt(1);h=e.AABBBounds.height()+(s[0]+s[2]),e._cellWidth=i-(s[1]+s[3]),e.layout(),u=e.AABBBounds.height()+(s[0]+s[2])}const c=this.table.getRowHeight(o);t.attribute.height!==u&&(t.setAttribute("height",u),(c===h||u>c)&&(r=!0))})),r}updateHeaderPosition(t,e,n,i){!function(t,e,n,i,r){const o=r.scenegraph,a=r.getCellType(n,i),s="columnHeader"===a?"column":"rowHeader"===a?"row":void 0;let l=0,h=0,u=0,c=0,d=0,f=0,p=0,g=0;if("column"===s){const o=zx(r,t,e),a=zx(r,n,i);o&&a?(l=o.start.col,u=o.end.col,d=a.start.col,p=a.end.col):(l=t,u=t,d=n,p=n),h=e,c=r.rowCount-1,f=i,g=r.rowCount-1}else if("row"===s){const o=zx(r,t,e),a=zx(r,t,e);o&&a?(h=o.start.row,c=o.end.row,f=a.start.row,g=a.end.row):(h=e,c=e,f=i,g=i),l=t,u=r.colCount-1,d=n,p=r.colCount-1}const v=Math.min(l,d),y=Math.max(u,p),m=Math.min(h,f),b=Math.max(c,g);for(let t=v;t<=y;t++){const e=r.scenegraph.getColGroup(t,!0),n=r.scenegraph.getColGroup(t);e&&e.setAttribute("width",r.getColWidth(t)),n&&n.setAttribute("width",r.getColWidth(t))}o.updateContainer();for(let t=v;t<=y;t++){const e=r.scenegraph.getColGroup(t);e?.setAttribute("chartInstance",void 0);for(let e=m;e<=b;e++)o.updateCellContent(t,e)}}(t,e,n,i,this.table)}updateContainer(){let t=0;this.cornerHeaderGroup.forEachChildrenSkipChild(((e,n)=>{e.setAttribute("x",t),t+=e.attribute.width}));let e=0;this.rowHeaderGroup.forEachChildrenSkipChild(((t,n)=>{t.setAttribute("x",e),e+=t.attribute.width}));let n=0;this.colHeaderGroup.forEachChildrenSkipChild(((t,e)=>{t.setAttribute("x",n),n+=t.attribute.width}));let i=0;this.bodyGroup.forEachChildrenSkipChild(((t,e)=>{t.setAttribute("x",i),i+=t.attribute.width})),this.cornerHeaderGroup.setDeltaWidth(t-this.cornerHeaderGroup.attribute.width),this.colHeaderGroup.setDeltaWidth(n-this.colHeaderGroup.attribute.width),this.rowHeaderGroup.setDeltaWidth(e-this.rowHeaderGroup.attribute.width),this.bodyGroup.setDeltaWidth(i-this.bodyGroup.attribute.width),this.colHeaderGroup.setAttribute("x",this.cornerHeaderGroup.attribute.width),this.bodyGroup.setAttribute("x",this.rowHeaderGroup.attribute.width),this.updateTableSize();const r=this.table.stateManeger.scroll.horizontalBarPos,o=this.table.stateManeger.scroll.verticalBarPos;this.component.updateScrollBar(),this.table.stateManeger.setScrollLeft(r),this.table.stateManeger.setScrollTop(o),this.updateNextFrame()}updateCellContentWhileResize(t,e){const n=this.table.getBodyColumnType(t,e),i=this.getCell(t,e);"image"!==n&&"video"!==n||cS(i,t,e,this.table)}createFrameBorder(){this.updateTableSize();const t=!this.isPivot;vk(this.bodyGroup,this.table.theme.bodyStyle.frameStyle,this.bodyGroup.role,t?[!0,!0,!0,!1]:void 0),vk(this.rowHeaderGroup,this.isPivot?this.table.theme.rowHeaderStyle.frameStyle:this.table.theme.bodyStyle.frameStyle,this.rowHeaderGroup.role,t?[!0,!1,!0,!0]:void 0),vk(this.colHeaderGroup,this.table.theme.headerStyle.frameStyle,this.colHeaderGroup.role,t?[!0,!0,!0,!1]:void 0),vk(this.cornerHeaderGroup,this.isPivot?this.table.theme.cornerHeaderStyle.frameStyle:this.table.theme.headerStyle.frameStyle,this.cornerHeaderGroup.role,t?[!0,!1,!0,!0]:void 0),vk(this.tableGroup,this.table.theme.frameStyle,this.tableGroup.role,void 0)}getResizeColAt(t,e,n,i=8){if(n){if(t<n.globalAABBBounds.x1+i)return{col:n.col-1,row:n.row,x:n.globalAABBBounds.x1};if(n.globalAABBBounds.x2-i<t)return{col:n.col,row:n.row,x:n.globalAABBBounds.x2}}else;return{col:-1,row:-1}}updateIcon(t,e){Nx(e,t),t.name=e.name,this.updateNextFrame()}updateFrozen(){this.clear||(this.resetFrozen(),this.dealFrozen(),this.component.updateScrollBar())}updateBorderSizeAndPosition(){this.bodyGroup.border&&(this.bodyGroup.appendChild(this.bodyGroup.border),bk(this.bodyGroup),0===this.rowHeaderGroup.attribute.width?yk(this.bodyGroup,this.table.theme.bodyStyle.frameStyle,[!0,!0,!0,!0]):yk(this.bodyGroup,this.table.theme.bodyStyle.frameStyle,[!0,!0,!0,!1])),this.colHeaderGroup.border&&(this.colHeaderGroup.appendChild(this.colHeaderGroup.border),bk(this.colHeaderGroup),0===this.cornerHeaderGroup.attribute.width?yk(this.colHeaderGroup,this.table.theme.headerStyle.frameStyle,[!0,!0,!0,!0]):yk(this.colHeaderGroup,this.table.theme.headerStyle.frameStyle,[!0,!0,!0,!1])),this.rowHeaderGroup.border&&(this.rowHeaderGroup.appendChild(this.rowHeaderGroup.border),bk(this.rowHeaderGroup)),this.cornerHeaderGroup.border&&(this.cornerHeaderGroup.appendChild(this.cornerHeaderGroup.border),bk(this.cornerHeaderGroup))}updateSortIcon(t,e,n,i,r,o,a){const s=this.table.internalProps.headerHelper.getSortIcon(i,this.table,t,e);if(n&&this.updateIcon(n,s),a!==n){const t=this.table.internalProps.headerHelper.getSortIcon("normal",this.table,r,o);if(a)this.updateIcon(a,t);else{let e;this.getCell(r,o).forEachChildren((t=>"sort"===t.attribute.funcType&&(e=t,!0))),e&&this.updateIcon(e,t)}}}updateFrozenIcon(t,e){const n=Math.max(t,e);this.colHeaderGroup.forEachChildrenSkipChild((t=>!(t.col<=n)||(t.forEachChildren((t=>{t.forEachChildren((e=>{if("frozen"===e.attribute.funcType){const n=this.table.internalProps.headerHelper.getFrozenIcon(t.col,t.row);return this.updateIcon(e,n),!0}return!1}))})),!1))),this.cornerHeaderGroup.forEachChildrenSkipChild((t=>!(t.col<=n)||(t.forEachChildren((t=>{t.forEachChildren((e=>{if("frozen"===e.attribute.funcType){const n=this.table.internalProps.headerHelper.getFrozenIcon(t.col,t.row);return this.updateIcon(e,n),!0}return!1}))})),!1)))}sortCell(){this.isPivot||(this.transpose?setTimeout((()=>{this.clearCells(),this.createSceneGraph()}),10):this.proxy.sortCell())}getCellOverflowText(t,e){const n=this.getCell(t,e).getChildByName("text",!0);if(n){const t=Ot(n.attribute.text)?n.attribute.text.join(""):n.attribute.text;let e="";if(!function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=Ht(t);return e?"string"===n:"string"===n||Tt(t,"String")}(n.cache.clipedText)?n.cache.layoutData.lines.forEach((t=>{e+=t.str})):e=n.cache.clipedText,e!==t)return t}return null}updateDrill(t,e,n,i,r){this.component.drillIcon.update(t,e,n,i,r,this)}updateCellContent(t,e){this.clear||VS(t,e,this.table)}setPixelRatio(t){this.stage.disableDirtyBounds(),this.stage.window.setDpr(t),this.stage.render(),this.stage.enableDirtyBounds()}updateHierarchyIcon(t,e){const n=this.getCell(t,e);let i;i=this.table.isHeader(t,e)?this.table.internalProps.headerHelper.getHierarchyIcon(n.col,n.row):this.table.internalProps.bodyHelper.getHierarchyIcon(n.col,n.row),this.findAndUpdateIcon(n,[l.collapse,l.expand],i)}updateRow(t,e){$k(t,e,this.table),this.recalculateColWidths(),this.table.internalProps.autoRowHeight&&QS(this),this.table.stateManeger.checkFrozen(),this.updateNextFrame()}findAndUpdateIcon(t,e,n){t.forEachChildren((t=>{if("group"===t.type)this.findAndUpdateIcon(t,e,n);else if(-1!==e.indexOf(t.attribute.funcType))return this.updateIcon(t,n),!0;return!1}))}}function aA(t,e,n){e.forEachChildren((e=>{"group"===e.type?aA(t,e,n):e.attribute.visibleTime===n&&(e.attribute.visible=!0,t.updateNextFrame())}))}function sA(t,e,n){e.forEachChildren((e=>{"group"===e.type?sA(t,e,n):e.attribute.visibleTime===n&&(e.attribute.visible=!1,t.updateNextFrame())}))}function lA(t,e,n){const i=t.getCell(e,n);if("shadow-cell"===i.role){t.getCell(i.mergeCol,i.mergeRow).addUpdateBoundTag()}else i.addUpdateBoundTag()}function hA(t,e,n,i,r){const o=t.table;for(let n=0;n<o.columnHeaderLevelCount;n++)lA(t,e,n);const a=t.getCell(e,o.columnHeaderLevelCount);return a?.parent.addUpdateBoundTag(),!0}function uA(t,e,n,i,r,o){const a=t.table;for(let n=0;n<a.columnHeaderLevelCount;n++)lA(t,e,n);const s=t.getCell(e,a.columnHeaderLevelCount);return s?.parent.addUpdateBoundTag(),!0}function cA(t,e,n,i,r){const o=t.table;for(let e=0;e<o.colCount;e++)lA(t,e,n);return!0}function dA(t,e,n,i,r,o){const a=t.table;for(let e=0;e<a.colCount;e++)lA(t,e,n);return!0}function fA(t,e,i){const{table:r}=t,{scenegraph:o}=r,{highlightScope:a,singleStyle:s,disableHeader:l,cellPos:h,cellPosContainHeader:u}=t.hover,c=h.col,d=h.row;if(a===n.none||l&&(u.col!==e||u.row!==i)){const t=u.col,n=u.row;o.hideHoverIcon(t,n),o.showHoverIcon(e,i),u.col=e,u.row=i}if((l&&r.isHeader(e,i)||a===n.none)&&(e=-1,i=-1),c===e&&d===i)return;o.deactivateChart(c,d),o.activateChart(e,i);let f=!1;const{ranges:p,highlightScope:g}=t.select;if(-1!==c&&-1!==d&&(f=function(t,e,i,r,o,a,s){let l=!1;a===n.single?l=!!function(t,e,n,i,r){return lA(t,e,n),!0}(t,e,i)||l:a===n.row?l=!!cA(t,0,i)||l:a===n.column?l=!!hA(t,e)||l:a===n.cross&&(l=!!cA(t,0,i)||l,l=!!hA(t,e)||l);return l}(o,c,d,0,0,a),l||o.hideHoverIcon(c,d)),-1===e||-1===i)return h.col=-1,h.row=-1,void(f&&t.table.scenegraph.updateNextFrame());a===n.single?f=!!function(t,e,n,i,r){return lA(t,e,n),!0}(o,e,i)||f:a===n.row?f=!!dA(o,0,i)||f:a===n.column?f=!!uA(o,e)||f:a===n.cross&&(f=!!dA(o,0,i)||f,f=!!uA(o,e)||f),a===n.none||l||o.showHoverIcon(e,i),h.col=e,h.row=i,f&&t.table.scenegraph.updateNextFrame()}function pA(t,e,n){let i,r=null,o=!1;if(Array.isArray(n.sortState))for(let a=0;a<n.sortState.length&&(i=n.sortState[a],i&&(r=n._getHeaderCellBySortState(i)),r&&(o=gA(t,e,r.col,r.row,n)),!o);a++);else i=n.sortState,i&&(r=n._getHeaderCellBySortState(i)),r&&(o=gA(t,e,r.col,r.row,n));const a=n.getHeaderDefine(t,e);i&&o&&a?.sort?i.order="asc"===i.order?"desc":"desc"===i.order?"normal":"asc":a?.sort?i={fieldKey:n.getHeaderFieldKey(t,e),field:n.getHeaderField(t,e),order:"asc"}:o&&a?.showSort||(i={fieldKey:n.getHeaderFieldKey(t,e),field:n.getHeaderField(t,e),order:"normal"}),n.sortState=i,n.stateManeger.setSortState(i),a?.sort&&function(t,e,n){let i;i=t.fieldKey?e.internalProps.layoutMap.headerObjects.find((e=>e&&e.fieldKey===t.fieldKey)):e.internalProps.layoutMap.headerObjects.find((e=>e&&e.field===t.field));if(!i)return;const{field:r}=i;if(null===r)return;"function"==typeof n.sort?e.dataSource.sort(r,t.order||"asc",n.sort):e.dataSource.sort(r,t.order||"asc",B)}(i,n,a),n.scenegraph.sortCell(),n.stateManeger.updateSelectPos(-1,-1),n.fireListeners(vt.SORT_CLICK,i)}function gA(t,e,n,i,r){return r._getLayoutCellId(t,e)===r._getLayoutCellId(n,i)}const vA=nt(vt,{PIVOT_SORT_CLICK:"pivot_sort_click",DRILLMENU_CLICK:"drillmenu_click"});function yA(t){if(!("canMoveHeaderPosition"in t.table.internalProps.layoutMap))return;setTimeout((()=>{t.columnMove.moving=!1}),0);t.table.moveHeaderPosition({col:t.columnMove.colSource,row:t.columnMove.rowSource},{col:t.columnMove.colTarget,row:t.columnMove.rowTarget})&&(!function(t,e,n,i,r){const o=Math.min(t,n),a=Math.max(t,n),s=Math.min(e,i),l=Math.max(e,i);for(let t=o;t<=a;t++)r._clearColRangeWidthsMap(t);for(let t=s;t<=l;t++)r._clearRowRangeHeightsMap(t)}(t.columnMove.colSource,t.columnMove.rowSource,t.columnMove.colTarget,t.columnMove.rowTarget,t.table),t.table.clearCellStyleCache(),t.table.scenegraph.updateHeaderPosition(t.columnMove.colSource,t.columnMove.rowSource,t.columnMove.colTarget,t.columnMove.rowTarget)),t.updateCursor(),t.table.scenegraph.component.hideMoveCol(),t.table.scenegraph.updateNextFrame()}function mA(t){if(!t)return;const e=t.role?.startsWith("icon")?t:"richtext"===t.type?t._currentHoverIcon:void 0;return e?"richtext"===t.type?{icon:e,position:{left:t.globalAABBBounds.x1+e.globalAABBBounds.x1,right:t.globalAABBBounds.x1+e.globalAABBBounds.x2,top:t.globalAABBBounds.y1+e.globalAABBBounds.y1,bottom:t.globalAABBBounds.y1+e.globalAABBBounds.y2,width:e.globalAABBBounds.x2-e.globalAABBBounds.x1,height:e.globalAABBBounds.y2-e.globalAABBBounds.y1},type:"richtext-icon"}:{icon:e,position:{left:e.globalAABBBounds.x1,right:e.globalAABBBounds.x2,top:e.globalAABBBounds.y1,bottom:e.globalAABBBounds.y2,width:e.globalAABBBounds.x2-e.globalAABBBounds.x1,height:e.globalAABBBounds.y2-e.globalAABBBounds.y1},type:"icon"}:void 0}class bA{table;interactionState;select;hover;hoverIcon;residentHoverIcon;columnResize;columnMove;menu;sort;frozen;scroll;tablePosition;drill;sparkLine;_clearVerticalScrollBar;_clearHorizontalScrollBar;constructor(t){this.table=t,this.initState(),this.setHoverState(),this.setSelectState(),this.setFrozenState(),this.updateVerticalScrollBar=this.updateVerticalScrollBar.bind(this),this.updateHorizontalScrollBar=this.updateHorizontalScrollBar.bind(this)}initState(){this.interactionState=e.default,this.select={highlightScope:n.single,ranges:[],cellPos:{col:-1,row:-1},selecting:!1},this.hover={highlightScope:n.single,cellPos:{col:-1,row:-1}},this.hoverIcon={col:-1,row:-1,icon:null},this.columnResize={col:-1,x: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 oe,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(){const{highlightMode:t,disableHover:e,disableHeaderHover:i}=this.table.options.hover??{highlightMode:"cell"};e?this.hover.highlightScope=n.none:"cross"===t?this.hover.highlightScope=n.cross:"row"===t?this.hover.highlightScope=n.row:"column"===t?this.hover.highlightScope=n.column:"cell"===t&&(this.hover.highlightScope=n.single),this.hover.singleStyle=!e,this.hover.disableHeader=i,(this.hover.highlightScope===n.none||i)&&(this.hover.cellPosContainHeader={col:-1,row:-1})}setSelectState(){const{disableSelect:t,disableHeaderSelect:e}=this.table.options?.select??{disableSelect:!1,disableHeaderSelect:!1};this.select.highlightScope=t?n.none:n.single,this.select.singleStyle=!t,this.select.disableHeader=e}isSelected(t,e){let n=!1;return this.select.ranges.forEach((i=>{st(i,t,e)&&(n=!0)})),n}setSortState(t){this.sort.field=t.field,this.sort.fieldKey=t.fieldKey,this.sort.order=t.order}setFrozenState(){this.frozen.col=this.table.frozenColCount-1}updateInteractionState(t){this.interactionState!==t&&(this.interactionState=t)}updateHoverhighlightScope(t){this.hover.highlightScope!==t&&(this.hover.highlightScope=t)}updateHoverPos(t,e){fA(this,t,e)}updateSelectPos(t,n,i=!1,r=!1,o=!1){-1!==n&&-1!==n&&(this.select.selecting=!0),function(t,n,i,r,o,a){const{table:s,interactionState:l}=t,{scenegraph:h}=s,{highlightScope:u,disableHeader:c,cellPos:d}=t.select;if((c&&s.isHeader(n,i)||"none"===u)&&(n=-1,i=-1),d.col!==n||d.row!==i){if(-1!==n&&-1!==i&&t.select.ranges.length>0)if(l===e.grabing){const e=t.select.ranges[t.select.ranges.length-1];n>e.start.col&&n>e.end.col&&s._makeVisibleCell(n+1,i),i>e.start.row&&i>e.end.row&&s._makeVisibleCell(n,i+1),n<e.start.col&&n<e.end.col&&s._makeVisibleCell(n-1,i),i<e.start.row&&i<e.end.row&&s._makeVisibleCell(n,i-1)}else s._makeVisibleCell(n,i);if(a){t.select.ranges=[],h.deleteAllSelectBorder(),t.select.ranges.push({start:{col:0,row:0},end:{col:s.colCount-1,row:s.rowCount-1}});const e=t.select.ranges[t.select.ranges.length-1];h.updateCellSelectBorder(e.start.col,e.start.row,e.end.col,e.end.row)}else if(-1===d.col||-1===d.row||-1!==n&&-1!==i){if(l===e.default){const e=t.select.ranges[t.select.ranges.length-1];if(r&&e){if(s.isColumnHeader(n,i)){const t=Math.min(e.start.col,e.end.col,n),r=Math.max(e.start.col,e.end.col,n),o=Math.min(e.start.row,e.end.row,i),a=s.rowCount-1;e.start={col:t,row:o},e.end={col:r,row:a}}else if(s.isRowHeader(n,i)){const t=Math.min(e.start.col,e.end.col,n),r=s.colCount-1,o=Math.min(e.start.row,e.end.row,i),a=Math.max(e.start.row,e.end.row,i);e.start={col:t,row:o},e.end={col:r,row:a}}else e.end={col:n,row:i};h.deleteLastSelectedRangeComponents(),h.updateCellSelectBorder(e.start.col,e.start.row,e.end.col,e.end.row)}else{-1===d.col||-1===d.row||o||(t.select.ranges=[],h.deleteAllSelectBorder()),s.isColumnHeader(n,i)?t.select.ranges.push({start:{col:n,row:i},end:{col:n,row:s.rowCount-1}}):s.isRowHeader(n,i)?t.select.ranges.push({start:{col:n,row:i},end:{col:s.colCount-1,row:i}}):t.select.ranges.push({start:{col:n,row:i},end:{col:n,row:i}}),d.col=n,d.row=i;const e=t.select.ranges[t.select.ranges.length-1];h.updateCellSelectBorder(e.start.col,e.start.row,e.end.col,e.end.row)}}else if(l===e.grabing){-1===d.col&&(d.col=n),-1===d.row&&(d.row=i);const e=t.select.ranges[t.select.ranges.length-1];e.end={col:n,row:i},d.col=n,d.row=i,h.updateCellSelectBorder(e.start.col,e.start.row,n,i)}}else d.col=-1,d.row=-1,t.select.ranges=[],h.deleteAllSelectBorder();h.updateNextFrame()}}(this,t,n,i,r,o)}checkCellRangeInSelect(t,e){return function(t,e,n,i){for(let i=0;i<n.length;i++)if(ht(n[i],{start:t,end:e}))return!0;return!1}(t,e,this.select.ranges,this.select.highlightScope)}updateHoverIcon(t,e,n,i,r){if(n===this.residentHoverIcon?.icon)return;const o=mA(n);if(o)if("richtext-icon"===o.type){const n=o.icon;if(this.hoverIcon.icon&&this.hoverIcon.icon!==this.residentHoverIcon?.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()),n.attribute.tooltip){const i={content:n.attribute.tooltip.title,referencePosition:{rect:o.position,placement:n.attribute.tooltip.placement},style:Object.assign({},this.table.internalProps.theme?.tooltipStyle,n.tooltip?.style)};this.table.internalProps.tooltipHandler.isBinded(i)||this.table.showTooltip(t,e,i)}}else{const n=o.icon;n!==this.hoverIcon.icon&&(this.hoverIcon.icon&&this.hoverIcon.icon!==this.residentHoverIcon?.icon&&this.table.scenegraph.setIconNormalStyle(this.hoverIcon.icon,this.hoverIcon.col,this.hoverIcon.row),this.hoverIcon.col=t,this.hoverIcon.col=e,this.hoverIcon.icon=n,this.table.scenegraph.setIconHoverStyle(n,t,e,i),this.table.scenegraph.updateNextFrame())}else this.hoverIcon.icon&&this.hoverIcon.icon!==this.residentHoverIcon?.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}isSelecting(){return this.select.selecting}endSelectCells(){if(this.select.selecting=!1,0===this.select.ranges.length)return;this.table.scenegraph.moveSelectingRangeComponentsToSelectedRangeComponents();const t=this.select.ranges[this.select.ranges.length-1].end.col,e=this.select.ranges[this.select.ranges.length-1].end.row;this.table.fireListeners(vt.SELECTED_CELL,{ranges:this.select.ranges,col:t,row:e})}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,n){this.columnResize.resizing=!0,this.columnResize.col=t,this.columnResize.x=e,this.table.scenegraph.component.showResizeCol(t,n),this.table.stateManeger.updateSelectPos(-1,-1),this.table.scenegraph.updateNextFrame()}updateResizeCol(t,e){t=Math.ceil(t),e=Math.ceil(e);let n=t-this.columnResize.x;if(Math.abs(n)<1)return;let i=this.table.colWidthsMap.get(this.columnResize.col);"number"==typeof i||(i=this.table.getColWidth(this.columnResize.col));let r=i;r+=n;const o=this.table.getMinColWidth(this.columnResize.col),a=this.table.getMaxColWidth(this.columnResize.col);if(r<o||r>a){if(i===o||i===a)return;n=i-o>a-i?a-i:o-i}n=Math.ceil(n),this.table.scenegraph.updateColWidth(this.columnResize.col,n),"adaptive"===this.table.widthMode&&this.columnResize.col<this.table.colCount-1&&this.table.scenegraph.updateColWidth(this.columnResize.col+1,-n),this.columnResize.x=t,this.table.scenegraph.component.updateResizeCol(this.columnResize.col,e),this.columnResize.col<this.table.frozenColCount&&!this.table.isPivotTable()&&!this.table.transpose&&this.table.scenegraph.component.setFrozenColumnShadow(this.table.frozenColCount-1),this.table.scenegraph.updateNextFrame()}startMoveCol(t,e,n,i){!function(t,e,n,i,r){if(!("canMoveHeaderPosition"in r.table.internalProps.layoutMap))return;r.columnMove.moving=!0,r.columnMove.colSource=t,r.columnMove.rowSource=e,r.columnMove.x=n-r.table.tableX,r.columnMove.y=i-r.table.tableY;const o=r.table.getCellType(t,e),a="columnHeader"===o?r.columnMove.x:"rowHeader"===o?r.columnMove.y:0;r.table.scenegraph.component.showMoveCol(t,e,a),r.table.stateManeger.updateSelectPos(-1,-1),r.table.scenegraph.updateNextFrame()}(t,e,n,i,this)}updateMoveCol(t,e,n,i){!function(t,e,n,i,r){if(!("canMoveHeaderPosition"in r.table.internalProps.layoutMap))return;const o=function(t,e,n){const i=n.getCellRange(t.col,t.row);if(n.isColumnHeader(t.col,t.row)){const r=n.getCellRange(e.col,i.start.row);e.row>=n.columnHeaderLevelCount&&(e.row=n.columnHeaderLevelCount-1),e.col>=t.col?e.col=r.end.col:e.col=r.start.col}else if(n.isRowHeader(t.col,t.row)){const r=n.getCellRange(i.start.col,e.row);e.col>=n.rowHeaderLevelCount&&(e.col=n.rowHeaderLevelCount-1);const o=n.internalProps.layoutMap;if("tree"===o.rowHierarchyType){const i=o.getCellHeaderPathsWidthTreeNode(t.col,t.row).rowHeaderPaths,r=o.getCellHeaderPathsWidthTreeNode(e.col,e.row).rowHeaderPaths;if(i.length<=r.length){const o=r[i.length-1];o&&(e.row>=t.row?e.row=o.startInTotal+o.size-1+n.columnHeaderLevelCount:e.row=o.startInTotal+n.columnHeaderLevelCount)}}else e.row>=t.row?e.row=r.end.row:e.row=r.start.row}return e}({col:r.columnMove.colSource,row:r.columnMove.rowSource},{col:t,row:e},r.table);let a,s,l,h;r.columnMove.x=n-r.table.tableX,r.columnMove.y=i-r.table.tableY,r.columnMove.colTarget=o.col,r.columnMove.rowTarget=o.row,r.table.internalProps.layoutMap.canMoveHeaderPosition({col:r.columnMove.colSource,row:r.columnMove.rowSource},{col:r.columnMove.colTarget,row:r.columnMove.rowTarget})?r.updateCursor("grabbing"):r.updateCursor("not-allowed");const u=r.table.getCellType(t,e);"columnHeader"===u?(s=r.columnMove.x,a=r.columnMove.colTarget>=r.columnMove.colSource?r.table.getColsWidth(0,r.columnMove.colTarget):r.table.getColsWidth(0,r.columnMove.colTarget-1)):"rowHeader"===u&&(h=r.columnMove.y,l=r.columnMove.rowTarget>=r.columnMove.rowSource?r.table.getRowsHeight(0,r.columnMove.rowTarget):r.table.getRowsHeight(0,r.columnMove.rowTarget-1)),r.table.scenegraph.component.updateMoveCol(s,a,h,l),r.table.scenegraph.updateNextFrame()}(t,e,n,i,this)}isMoveCol(){return this.columnMove.moving}endMoveCol(){yA(this)}checkFrozen(){if(this.table.options.frozenColCount){if(this.table.tableNoFrameWidth-this.table.getColsWidth(0,this.table.options.frozenColCount-1)<=120)return this.table._setFrozenColCount(0),this.setFrozenCol(-1),!1;if(this.table.frozenColCount!==this.table.options.frozenColCount)return this.table._setFrozenColCount(this.table.options.frozenColCount),this.setFrozenCol(this.table.options.frozenColCount),!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)}updateVerticalScrollBar(t){const e=this.table.getAllRowsHeight();this.scroll.verticalBarPos=Math.ceil(t*(e-this.table.scenegraph.height)),this.table.scenegraph.setY(-this.scroll.verticalBarPos),this.table.stateManeger.updateHoverPos(-1,-1),this.table.fireListeners(vt.SCROLL,{scrollTop:this.scroll.verticalBarPos,scrollLeft:this.scroll.horizontalBarPos,scrollHeight:this.table.theme.scrollStyle?.width,scrollWidth:this.table.theme.scrollStyle?.width,viewHeight:this.table.tableNoFrameHeight,viewWidth:this.table.tableNoFrameWidth})}updateHorizontalScrollBar(t){const e=this.table.getAllColsWidth();this.scroll.horizontalBarPos=Math.ceil(t*(e-this.table.scenegraph.width)),this.table.scenegraph.setX(-this.scroll.horizontalBarPos),this.table.stateManeger.updateHoverPos(-1,-1),this.table.fireListeners(vt.SCROLL,{scrollTop:this.scroll.verticalBarPos,scrollLeft:this.scroll.horizontalBarPos,scrollHeight:this.table.theme.scrollStyle?.width,scrollWidth:this.table.theme.scrollStyle?.width,viewHeight:this.table.tableNoFrameHeight,viewWidth:this.table.tableNoFrameWidth})}setScrollTop(t){const e=this.table.getAllRowsHeight();t=Math.max(0,Math.min(t,e-this.table.scenegraph.height)),t=Math.ceil(t),this.scroll.verticalBarPos=t,this.table.scenegraph.setY(-t),this.table.scenegraph.component.updateVerticalScrollBarPos(t/(e-this.table.scenegraph.height)),this.table.stateManeger.updateHoverPos(-1,-1),this.table.fireListeners(vt.SCROLL,{scrollTop:this.scroll.verticalBarPos,scrollLeft:this.scroll.horizontalBarPos,scrollHeight:this.table.theme.scrollStyle?.width,scrollWidth:this.table.theme.scrollStyle?.width,viewHeight:this.table.tableNoFrameHeight,viewWidth:this.table.tableNoFrameWidth})}setScrollLeft(t){const e=this.table.getAllColsWidth(),n=this.table.getFrozenColsWidth();t=Math.max(0,Math.min(t,e-this.table.scenegraph.width)),t=Math.ceil(t),this.scroll.horizontalBarPos=t,this.table.scenegraph.setX(-t),this.table.scenegraph.component.updateHorizontalScrollBarPos(t/(e-n)),this.table.stateManeger.updateHoverPos(-1,-1),this.table.fireListeners(vt.SCROLL,{scrollTop:this.scroll.verticalBarPos,scrollLeft:this.scroll.horizontalBarPos,scrollHeight:this.table.theme.scrollStyle?.width,scrollWidth:this.table.theme.scrollStyle?.width,viewHeight:this.table.tableNoFrameHeight,viewWidth:this.table.tableNoFrameWidth})}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,n,i){this.menu.isShow&&this.menu.x===n&&this.menu.y===i?this.hideMenu():this.showContextMenu(t,e,n,i)}showContextMenu(t,e,n,i){this.table.internalProps.menu?.contextMenuItems&&("html"===this.table.internalProps.menu.renderMode?this.menu.isShow=!0:(this.menu.isShow=!0,this.menu.x=n,this.menu.y=i,this.table.scenegraph.component.menu.attach(n,i,t,e,lk.contextmenu)),this.table.fireListeners(vt.SHOW_MENU,{x:n,y:i,col:t,row:e,type:"contextmenu"}))}triggerDropDownMenu(t,e,n,i){this.table.fireListeners(vt.DROPDOWN_ICON_CLICK,{col:t,row:e}),this.menu.isShow?this.hideMenu():this.showDropDownMenu(t,e,n,i)}showDropDownMenu(t,e,n,i){"html"===this.table.internalProps.menu.renderMode?this.menu.isShow=!0:(this.menu.isShow=!0,this.table.scenegraph.component.menu.attach(n,i,t,e,lk.dropDown),this.menu.bounds=this.table.scenegraph.component.menu.bounds),this.table.fireListeners(vt.SHOW_MENU,{x:n,y:i,col:t,row:e,type:"dropDown"}),this.residentHoverIcon&&this.table.scenegraph.setIconNormalStyle(this.residentHoverIcon.icon,this.residentHoverIcon.col,this.residentHoverIcon.row);const r=this.table.scenegraph.getCell(t,e);let o;r.forEachChildren((t=>t.attribute.funcType===l.dropDown&&(o=t,!0))),o&&(this.residentHoverIcon={col:t,row:e,icon:o},this.table.scenegraph.setIconHoverStyle(this.residentHoverIcon.icon,this.residentHoverIcon.col,this.residentHoverIcon.row,r),o.oldVisibleTime=o.attribute.visibleTime,o.setAttribute("visibleTime","always"),o.setAttribute("visible",!0))}hideMenu(){this.table.fireListeners(vt.DROPDOWN_MENU_CLEAR,null),this.table.fireListeners(vt.HIDE_MENU),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.residentHoverIcon.icon.setAttribute("visibleTime",this.residentHoverIcon.icon.oldVisibleTime),this.residentHoverIcon.icon.setAttribute("visible","always"===this.residentHoverIcon.icon.attribute.visibleTime),this.residentHoverIcon=null)}setDropDownMenuHighlight(t){this.menu.dropDownMenuHighlight=t;for(let e=0;e<t.length;e++){const{col:n,row:i}=t[e];this.table.scenegraph.updateCellContent(n,i)}}dropDownMenuIsHighlight(t,e,n){const i=this.menu.dropDownMenuHighlight;if(Array.isArray(i))for(let r=0;r<i.length;r++){const o=i[r];let{col:a,row:s}=o;const{field:l,menuKey:h}=o;if("number"!=typeof a||"number"!=typeof s)if(this.table.isPivotTable()&&(Array.isArray(l),1)){const t=this.table.internalProps.layoutMap.getPivotCellAdress(l);if(!t)continue;a=t.col,s=t.row}else{const t=this.table.internalProps.layoutMap.getHeaderCellAddressByField(l);if(!t)continue;a=t.col,s=t.row}if(k(a)&&k(s)&&this.table.isCellRangeEqual(t,e,a,s)){const i=this.table._getHeaderLayoutMap(a??t,s??e).dropDownMenu||this.table.globalDropDownMenu;if(i)for(let t=0;t<i.length;t++){const e=i[t];if(d(e)&&(e.menuKey||e.text)===(h||"")&&t===n)return!0;if(p(e)&&e===h&&t===n)return!0}}}return!1}triggerSort(t,e,n){if(this.table.isPivotTable()){const n=this.table.getPivotSortState(t,e);return void this.table.fireListeners(vA.PIVOT_SORT_CLICK,{col:t,row:e,order:n||"normal",dimensionInfo:this.table.internalProps.layoutMap.getPivotDimensionInfo(t,e),cellType:this.table.getCellType(t,e)})}const i=this.sort.col,r=this.sort.row;pA(t,e,this.table),this.sort.col=t,this.sort.row=e,this.table.scenegraph.updateSortIcon(this.sort.col,this.sort.row,n,this.sort.order,i,r,this.sort.icon),this.sort.icon=n}updateSortState(t){if(t.field===this.sort.field&&t.order===this.sort.order)return;const e=this.sort.col,n=this.sort.row,i="asc"===this.sort.order?"sort_downward":"desc"===this.sort.order?"sort_upward":"sort_normal";this.setSortState(t);const r=this.table.internalProps.layoutMap.getHeaderCellAddressByField(t.field);this.sort.col=r.col,this.sort.row=r.row;const o=this.table.scenegraph.getCell(this.sort.col,this.sort.row).getChildByName(i,!0);this.table.scenegraph.sortCell(),this.table.scenegraph.updateSortIcon(this.sort.col,this.sort.row,o,this.sort.order,e,n,this.sort.icon)}triggerFreeze(t,e,n){this.table.isPivotTable()||this.table.transpose||(!function(t,e,n){n.frozenColCount>0?t!==n.frozenColCount-1?n.setFrozenColCount(t+1):n.setFrozenColCount(0):n.setFrozenColCount(t+1)}(t,0,this.table),this.frozen.icon=n)}updateCursor(t="default"){this.table.getElement().style.cursor=t}updateDrillState(t,e,n,i,r,o){this.drill.dimensionKey=t,this.drill.dimensionTitle=e,this.drill.drillDown=n,this.drill.drillUp=i,this.drill.col=r,this.drill.row=o,function(t,e,n,i,r){const o=r.getCellType(t,e);let a=0,s=0,l=!1;"columnHeader"===o?(a=r.getColsWidth(0,r.rowHeaderLevelCount-1)-(0===r.frozenColCount?r.scrollLeft:0),s=r.getRowsHeight(0,e-1)+r.getRowHeight(e)/2,l=!0):"rowHeader"===o&&(s=r.getRowsHeight(0,r.columnHeaderLevelCount-1),a=r.getColsWidth(0,t-1)+r.getColWidth(t)/2,l=!0),r.scenegraph.updateDrill(l,a,s,n,i)}(r,o,n,i,this.table)}updateSparklineHoverPose(t,e,n,i){-1!==this.sparkLine.col&&-1!==this.sparkLine.row&&function(t,e,n){const i=n.scenegraph.getCell(t,e).getChildByName("sparkline"),r=i?.getChildByName("highlight-line"),o=i?.getChildByName("highlight-symbol");r&&r.setAttributes({visible:!1,pickable:!1}),o&&o.setAttributes({visible:!1,pickable:!1}),n.scenegraph.updateNextFrame()}(this.sparkLine.col,this.sparkLine.row,this.table),-1!==t&&-1!==e&&function(t,e,n,i,r){const o=r.scenegraph.getCell(t,e).getChildByName("sparkline"),a=o?.getChildByName("sparkline-line"),s=o?.getChildByName("sparkline-symbol-group");if(!a)return;const l=a.bandwidth,h=a.min,u=a.max,c=a.attribute.points;let d;n-=o.globalAABBBounds.x1,o.globalAABBBounds.y1;for(let t=0;t<c.length;t++){const{x:e,y:i,defined:r,rawData:f}=c[t];if(Math.abs(n-e)<l/2&&(d={point:c[t],points:c,pointsBandWidth:l,pointData:f},r)){const t=o.getChildByName("highlight-line");if(t)t.setAttributes({x:e,visible:!0,pickable:!0});else{const t=vf({x:e,y:0,points:[{x:0,y:u},{x:0,y:h}],lineWidth:a.hover.strokeWidth,stroke:a.hover.stroke});t.name="highlight-line",o.addChild(t)}const n=o.getChildByName("highlight-symbol");if(n)n.setAttributes({x:e,y:i,visible:!0,pickable:!0});else{const t=bf({x:e,y:i,stroke:s.hover.stroke,lineWidth:s.hover.strokeWidth,fill:s.hover.fill,size:2*s.hover.size,symbolType:"circle"});t.name="highlight-symbol",o.addChild(t)}break}}if(r.scenegraph.updateNextFrame(),d){const n={col:t,row:e,field:r.getHeaderField(t,e),value:r.getCellValue(t,e),dataValue:r.getCellOriginValue(t,e),cellHeaderPaths:r.internalProps.layoutMap.getCellHeaderPaths(t,e),caption:r.getBodyColumnDefine(t,e).caption,cellRange:r.getCellRelativeRect(t,e),sparkline:{pointData:d.pointData},scaleRatio:r.canvas.getBoundingClientRect().width/r.canvas.offsetWidth};r.fireListeners(vt.MOUSEOVER_CHART_SYMBOL,n)}}(t,e,n,0,this.table),this.sparkLine.col=t,this.sparkLine.row=e}}function wA(t){const e={abstractPos:{x:t.x,y:t.y}},n=function(t){for(;t&&t.parent;){if("cell"===t.role)return t;t=t.parent}return null}(t.target);return n&&(e.eventArgs={col:n.col,row:n.row,event:t,targetCell:n,target:t.target}),e}function CA(t,e){let{deltaX:n,deltaY:i}=t;t.shiftKey&&t.deltaY&&(n=i,i=0);const[r,o]=function(t,e,n){const i=2,r=Math.abs(t/e),o=r<=1/i?0:t,a=r>i?0:e;return[Math.ceil(o*n.horizontal),Math.ceil(a*n.vertical)]}(n,i,{horizontal:1,vertical:1});r&&(e.setScrollLeft(e.scroll.horizontalBarPos+r),e.showHorizontalScrollBar(!0)),o&&(e.setScrollTop(e.scroll.verticalBarPos+o),e.showVerticalScrollBar(!0)),t.cancelable&&(0!==i&&xA(i,e)||0!==n&&_A(n,e))&&t.preventDefault()}function xA(t,e){return!function(t,e){const n=e.table.getAllRowsHeight()-e.table.scenegraph.height;return 0!==n&&t<=0&&e.scroll.verticalBarPos<1}(t,e)&&!function(t,e){const n=e.table.getAllRowsHeight()-e.table.scenegraph.height;return 0!==n&&t>=0&&Math.abs(e.scroll.verticalBarPos-n)<1}(t,e)}function _A(t,e){return!function(t,e){const n=e.table.getAllColsWidth()-e.table.scenegraph.width;return 0!==n&&t<=0&&e.scroll.horizontalBarPos<1}(t,e)&&!function(t,e){const n=e.table.getAllColsWidth()-e.table.scenegraph.width;return 0!==n&&t>=0&&Math.abs(e.scroll.horizontalBarPos-n)<1}(t,e)}function SA(t){const e=t.table,n=e.stateManeger,i=e.scenegraph;t.touchMovePoints=[],e.scenegraph.tableGroup.addEventListener("touchstart",(e=>{e.target.isChildOf(i.component.vScrollBar)||e.target.isChildOf(i.component.vScrollBar)||(t.isTouchdown=!0,t.touchMovePoints.push({x:e.page.x,y:e.page.y,timestamp:Date.now()}))})),window.addEventListener("touchmove",(e=>{if(t.touchMove&&e.preventDefault(),!t.isTouchdown||!kA(e))return;t.touchMovePoints.length>4&&t.touchMovePoints.shift(),t.touchMovePoints.push({x:e.changedTouches[0].pageX,y:e.changedTouches[0].pageY,timestamp:Date.now()});const i=-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;CA({deltaX:i,deltaY:r},n),e.cancelable&&(0!==r&&xA(r,n)||0!==i&&_A(i,n))&&e.preventDefault()}),{passive:!1}),window.addEventListener("touchend",(e=>{if(t.touchEnd=!0,t.touchMove=!1,t.isTouchdown&&kA(e)){if(t.touchMovePoints?.length){t.touchMovePoints.length>4&&t.touchMovePoints.shift(),t.touchMovePoints.push({x:e.changedTouches[0].pageX,y:e.changedTouches[0].pageY,timestamp:Date.now()});const i=t.touchMovePoints[0],r=t.touchMovePoints[t.touchMovePoints?.length-1];!function(t,e,n){let i=Date.now();const r=.95,o=()=>{const a=Date.now(),s=a-i;let l=!0;const h=Math.pow(r,s/16),u=h*t,c=h*e;let d=0,f=0;Math.abs(u)>.05&&(l=!1,d=(t+u)/2*s),Math.abs(c)>.05&&(l=!1,f=(e+c)/2*s),CA({deltaX:-d,deltaY:-f},n),l||(i=a,t=u,e=c,requestAnimationFrame(o))};requestAnimationFrame(o)}((r.x-i.x)/(r.timestamp-i.timestamp),(r.y-i.y)/(r.timestamp-i.timestamp),n)}t.isTouchdown=!1,t.touchMovePoints=[]}})),window.addEventListener("touchcancel",(e=>{t.touchEnd=!0,t.touchMove=!1,t.isTouchdown&&(t.isTouchdown=!1,t.touchMovePoints=[])}))}function kA(t){return!!t.changedTouches}class AA{table;isTouchdown;touchMovePoints;touchSetTimeout;touchEnd;touchMove;constructor(t){this.table=t,this.bindOuterEvent(),setTimeout((()=>{this.bindSelfEvent()}),0)}bindOuterEvent(){!function(t){const n=t.table,i=n.stateManeger;n.scenegraph.tableGroup.addEventListener("pointermove",(r=>{t.touchSetTimeout&&(clearTimeout(t.touchSetTimeout),t.touchSetTimeout=void 0);const o=wA(r);if(i.interactionState!==e.scrolling)if(i.interactionState!==e.grabing){if(t.checkColumnResize(o)?i.updateCursor("col-resize"):i.updateCursor(),n.hasListeners(vt.MOUSELEAVE_CELL)){const t=o?.eventArgs?.target;"cell"!==t?.role||-1===n.stateManeger.hover.cellPos.col||-1===n.stateManeger.hover.cellPos.row||t.col===n.stateManeger.hover.cellPos.col&&t.row===n.stateManeger.hover.cellPos.row||n.fireListeners(vt.MOUSELEAVE_CELL,{col:n.stateManeger.hover.cellPos.col,row:n.stateManeger.hover.cellPos.row,cellRange:n.getCellRangeRelativeRect({col:n.stateManeger.hover.cellPos.col,row:n.stateManeger.hover.cellPos.row}),scaleRatio:n.canvas.getBoundingClientRect().width/n.canvas.offsetWidth,event:r.nativeEvent})}if(n.hasListeners(vt.MOUSEENTER_CELL)){const t=o?.eventArgs?.target;"cell"===t?.role&&Et(t.col)&&Et(t.row)&&(t.col!==n.stateManeger.hover.cellPos.col||t.row!==n.stateManeger.hover.cellPos.row)&&n.fireListeners(vt.MOUSEENTER_CELL,{col:t.col,row:t.row,cellRange:n.getCellRangeRelativeRect({col:t.col,row:t.row}),scaleRatio:n.canvas.getBoundingClientRect().width/n.canvas.offsetWidth,event:r.nativeEvent})}if(t.dealIconHover(o),t.dealTableHover(o),o.eventArgs&&n.hasListeners(vt.MOUSEMOVE_CELL)){let t,e;if(o.eventArgs?.target){const n=mA(o.eventArgs?.target);n&&(t=n.icon,e=n.position)}n.fireListeners(vt.MOUSEMOVE_CELL,{col:o.eventArgs.col,row:o.eventArgs.row,x:o.abstractPos.x,y:o.abstractPos.y,event:r.nativeEvent,targetIcon:t?{name:t.name,position:e,funcType:t.attribute.funcType}:void 0})}}else i.isResizeCol()?(t.dealColumnResize(o),o.eventArgs&&n.hasListeners(vt.RESIZE_COLUMN)&&n.fireListeners(vt.RESIZE_COLUMN,{col:n.stateManeger.columnResize.col,colWidth:n.getColWidth(n.stateManeger.columnResize.col)})):i.isMoveCol()?t.dealColumnMover(o):t.dealTableSelect(o)})),n.scenegraph.tableGroup.addEventListener("pointerout",(e=>{const n=wA(e),i=n?.eventArgs?.target;"table"===i?.role&&t.dealTableHover()})),n.scenegraph.tableGroup.addEventListener("pointerover",(t=>{const e=wA(t),i=e?.eventArgs?.target;if(n.hasListeners(vt.MOUSEOVER_CHART_SYMBOL)&&"symbol"===i.type){const e=t.composedPath().find((t=>"cell"===t.roll));if(e){const{col:i,row:r}=e,o={col:i,row:r,field:n.getHeaderField(i,r),value:n.getCellValue(i,r),dataValue:n.getCellOriginValue(i,r),cellHeaderPaths:n.internalProps.layoutMap.getCellHeaderPaths(i,r),caption:n.getBodyColumnDefine(i,r).caption,cellRange:n.getCellRelativeRect(i,r),event:t.nativeEvent,sparkline:{pointData:void 0},scaleRatio:n.canvas.getBoundingClientRect().width/n.canvas.offsetWidth};n.fireListeners(vt.MOUSEOVER_CHART_SYMBOL,o)}}})),n.scenegraph.tableGroup.addEventListener("pointerleave",(r=>{i.updateInteractionState(e.default),t.dealTableHover(),i.updateCursor();const o=r.target;o&&!o.isDescendantsOf(n.scenegraph.tableGroup)&&n.fireListeners(vt.MOUSELEAVE_TABLE,{col:-1,row:-1,event:r.nativeEvent})})),n.scenegraph.tableGroup.addEventListener("pointerupoutside",(n=>{console.log("pointerupoutside"),i.updateInteractionState(e.default),t.dealTableHover(),t.dealTableSelect()})),n.scenegraph.tableGroup.addEventListener("pointerdown",(r=>{if(0!==r.button)return;const o=wA(r);if(i.interactionState===e.default){if(i.menu.isShow&&o.eventArgs&&o.eventArgs.target!==i.residentHoverIcon?.icon&&i.hideMenu(),!(o?.eventArgs?.target?.role?.startsWith("icon")?o.eventArgs.target:void 0))if("touch"===r.pointerType)t.touchEnd=!1,t.touchSetTimeout=setTimeout((()=>{t.isTouchdown=!1,t.touchMove=!0,(!t.touchEnd&&t.checkColumnResize(o,!0)||!t.touchEnd&&t.chechColumnMover(o)||t.dealTableSelect(o)&&!t.touchEnd)&&i.updateInteractionState(e.grabing)}),500);else{if(t.checkColumnResize(o,!0))return void i.updateInteractionState(e.grabing);if(t.chechColumnMover(o))return void i.updateInteractionState(e.grabing);t.dealTableSelect(o)&&i.updateInteractionState(e.grabing)}if(n.hasListeners(vt.MOUSEDOWN_CELL)){const t=wA(r);t.eventArgs&&n.fireListeners(vt.MOUSEDOWN_CELL,{col:t.eventArgs.col,row:t.eventArgs.row,event:r.nativeEvent})}}})),n.scenegraph.tableGroup.addEventListener("pointerup",(t=>{if(0===t.button){if("grabing"===i.interactionState){if(i.updateInteractionState(e.default),i.isResizeCol()){if(n.stateManeger.endResizeCol(),n.hasListeners(vt.RESIZE_COLUMN_END)){const t=[];for(let e=0;e<n.colCount;e++)t.push(n.getColWidth(e));n.fireListeners(vt.RESIZE_COLUMN_END,{col:n.stateManeger.columnResize.col,columns:t})}}else if(i.isMoveCol()){n.stateManeger.endMoveCol();const e=wA(t);e.eventArgs&&n.hasListeners(vt.CHANGE_HEADER_POSITION)&&n.fireListeners(vt.CHANGE_HEADER_POSITION,{target:{col:e.eventArgs.col,row:e.eventArgs.row},source:{col:n.stateManeger.columnMove.colSource,row:n.stateManeger.columnMove.colSource}})}else if(i.isSelecting()){n.stateManeger.endSelectCells();const e=wA(t);if(e.eventArgs&&n.hasListeners(vt.DRAG_SELECT_END)){const i={event:t.nativeEvent,cells:[],col:e.eventArgs.target.col,row:e.eventArgs.target.row,scaleRatio:n.canvas.getBoundingClientRect().width/n.canvas.offsetWidth};i.cells=n.getSelectedCellInfos(),n.fireListeners(vt.DRAG_SELECT_END,i)}}}else i.interactionState===e.scrolling&&i.updateInteractionState(e.default);if(n.hasListeners(vt.MOUSEUP_CELL)){const e=wA(t);e.eventArgs&&n.fireListeners(vt.MOUSEUP_CELL,{col:e.eventArgs.col,row:e.eventArgs.row,event:t.nativeEvent})}}})),n.scenegraph.tableGroup.addEventListener("rightdown",(t=>{const e=wA(t);if(e.eventArgs){i.triggerContextMenu(e.eventArgs.col,e.eventArgs.row,e.abstractPos.x,e.abstractPos.y);const{col:r,row:o}=e.eventArgs;if(n.hasListeners(vt.CONTEXTMENU_CELL)){const i=n.getCellInfo(r,o);let a,s;if(e.eventArgs?.target){const t=mA(e.eventArgs?.target);t&&(a=t.icon,s=t.position)}const l={...i,event:t.nativeEvent,cells:[],targetIcon:a?{name:a.name,position:s,funcType:a.attribute.funcType}:void 0};!function(t,e,n){for(let i=0;i<t.length;i++){const r=t[i];if(r.start.col<=e&&e<=r.end.col&&r.start.row<=n&&n<=r.end.row||r.end.col<=e&&e<=r.start.col&&r.end.row<=n&&n<=r.start.row)return!0}return!1}(n.stateManeger.select.ranges,r,o)?l.cells=[[i]]:l.cells=n.getSelectedCellInfos(),n.fireListeners(vt.CONTEXTMENU_CELL,l)}}})),n.scenegraph.tableGroup.addEventListener("click",(e=>{if(console.log("click",e),n.stateManeger.columnResize.resizing||n.stateManeger.columnMove.moving)return;const i=wA(e);if(t.dealIconClick(e,i),!i?.eventArgs)return;const{col:r,row:o}=i.eventArgs;if(n.hasListeners(vt.CLICK_CELL)){const t=n.getCellInfo(r,o);let a,s;if(i.eventArgs?.target){const t=mA(i.eventArgs?.target);t&&(a=t.icon,s=t.position)}const l={...t,event:e.nativeEvent,cells:[],targetIcon:a?{name:a.name,position:s,funcType:a.attribute.funcType}:void 0};n.fireListeners(vt.CLICK_CELL,l)}})),n.scenegraph.stage.addEventListener("click",(r=>{console.log("stage click");const o=r.target;o&&!o.isDescendantsOf(n.scenegraph.tableGroup)&&o!==n.scenegraph.tableGroup&&(console.log("pointerup outside table"),i.updateInteractionState(e.default),t.dealTableHover(),t.dealTableSelect(),i.updateCursor())})),n.scenegraph.tableGroup.addEventListener("dblclick",(t=>{const e=wA(t),i=e.eventArgs.targetCell.globalAABBBounds,{col:r,row:o}=e.eventArgs,a=n.getCellValue(r,o);if(n.internalProps.focusControl.setFocusRect(new me(i.x1+n.scrollLeft,i.y1+n.scrollTop,i.x2-i.x1,i.y2-i.y1),a),n.hasListeners(vt.DBLCLICK_CELL)){const i=n.getCellInfo(r,o);let a,s;if(e.eventArgs?.target){const t=mA(e.eventArgs?.target);t&&(a=t.icon,s=t.position)}const l={...i,event:t.nativeEvent,cells:[],targetIcon:a?{name:a.name,position:s,funcType:a.attribute.funcType}:void 0};n.fireListeners(vt.DBLCLICK_CELL,l)}}))}(this),function(t){const e=t.table,n=e.stateManeger,i=e.internalProps.handler;i.on(e.getElement(),"blur",(e=>{console.log("blur"),t.dealTableHover()})),i.on(e.getElement(),"wheel",(t=>{CA(t,n)})),i.on(e.getElement(),"keydown",(n=>{if(e.keyboardOptions?.selectAllOnCtrlA&&"a"===n.key&&(n.ctrlKey||n.metaKey)&&(n.preventDefault(),t.deelTableSelectAll()),e.hasListeners(vt.KEYDOWN)){const t={keyCode:n.keyCode??n.which,code:n.code,event:n,cells:e.getSelectedCellInfos(),scaleRatio:e.canvas.getBoundingClientRect().width/e.canvas.offsetWidth};e.fireListeners(vt.KEYDOWN,t)}})),i.on(e.getElement(),"copy",(t=>{if(e.keyboardOptions?.copySelected){const n=e.getCopyValue();Et(n)&&(t.preventDefault(),ut?window.clipboardData.setData("Text",n):t.clipboardData.setData("text/plain",n))}})),i.on(e.getElement(),"contextmenu",(t=>{t.preventDefault()})),i.on(e.getParentElement(),"resize",(()=>{e.resize()}))}(this),function(t){const n=t.table,i=n.stateManeger,r=n.scenegraph;r.component.vScrollBar.addEventListener("pointerover",(t=>{i.showVerticalScrollBar()})),r.component.hScrollBar.addEventListener("pointerover",(t=>{i.showHorizontalScrollBar()})),r.component.vScrollBar.addEventListener("pointerout",(t=>{i.interactionState!==e.scrolling&&i.hideVerticalScrollBar()})),r.component.hScrollBar.addEventListener("pointerout",(t=>{i.interactionState!==e.scrolling&&i.hideHorizontalScrollBar()})),r.component.vScrollBar._slider.addEventListener("pointerdown",(()=>{i.interactionState!==e.scrolling&&i.updateInteractionState(e.scrolling)})),r.component.vScrollBar.addEventListener("pointerup",(()=>{i.interactionState===e.scrolling&&i.updateInteractionState(e.default)})),r.component.vScrollBar.addEventListener("pointerupoutside",(()=>{i.interactionState===e.scrolling&&i.updateInteractionState(e.default)})),r.component.hScrollBar._slider.addEventListener("pointerdown",(()=>{i.interactionState!==e.scrolling&&i.updateInteractionState(e.scrolling)})),r.component.hScrollBar.addEventListener("pointerup",(()=>{i.interactionState===e.scrolling&&i.updateInteractionState(e.default)})),r.component.hScrollBar.addEventListener("pointerupoutside",(()=>{i.interactionState===e.scrolling&&i.updateInteractionState(e.default)}));const o=x(i.updateVerticalScrollBar,20),a=x(i.updateHorizontalScrollBar,20);r.component.vScrollBar.addEventListener("scroll",(t=>{const e=t.detail.value[0]/(1-t.detail.value[1]+t.detail.value[0]);o(e,t)})),r.component.hScrollBar.addEventListener("scroll",(t=>{const e=t.detail.value[0]/(1-t.detail.value[1]+t.detail.value[0]);a(e)}))}(this),SA(this)}bindSelfEvent(){const t=this.table.stateManeger;var e;this.table.listen(vt.ICON_CLICK,(e=>{const{col:n,row:i,x:r,y:o,funcType:a,icon:s}=e;var h;a===l.dropDown?t.triggerDropDownMenu(n,i,r,o):a===l.sort?t.triggerSort(n,i,s):a===l.frozen?t.triggerFreeze(n,i,s):a===l.drillDown?(h=this.table).fireListeners(vA.DRILLMENU_CLICK,h.stateManeger.drill):a!==l.collapse&&a!==l.expand||this.table.toggleHierarchyState(n,i)})),this.table.listen(vt.DROPDOWNMENU_CLICK,(()=>{t.hideMenu()})),this.table.listen(vt.SCROLL,(t=>{Jk(this.table)})),e=this.table,"browser"===bt.mode&&e.listen(vt.CLICK_CELL,(t=>{const{col:n,row:i}=t;let r;r=e.internalProps.layoutMap.isHeader(n,i)?e.isPivotTable()?e._getHeaderLayoutMap(n,i).headerType:e.getHeaderDefine(n,i).headerType:e.getBodyColumnType(n,i);const o=e.isHeader(n,i)?e.getHeaderDefine(n,i):e.getBodyColumnDefine(n,i),a=e.getCellValue(n,i),s=e.getCellOriginValue(n,i);if("link"===o.columnType){if(!1===o.linkJump)return;const t=o.templateLink,r=!1!==o.linkDetect;let l;if(t){const r=e.getCellOriginRecord(n,i),o=Object.assign({__value:a,__dataValue:s},r),h=/\{\s*(\S+?)\s*\}/g;l=t.replace(h,((t,e)=>o[e]))}else if(r){if(!Ae.test(a))return;l=a}else l=a;window.open(l)}else if("image"===r){const t=document.createElement("div");t.style.width="100%",t.style.height="100%",t.style.position="absolute",t.style.top="0",t.style.left="0",t.style.backgroundColor="rgba(30, 30, 30, 0.4)",t.style.display="flex",t.style.justifyContent="center",t.style.alignItems="center",t.style.overflow="hidden",t.style.zIndex="9999",t.addEventListener("click",(e=>{e.target===t&&document.body.removeChild(t)}));const e=new Image;e.src=a,e.style.maxWidth="80%",e.style.maxHeight="80%",t.appendChild(e),document.body.appendChild(t)}else if("video"===r){const t=document.createElement("div");t.style.width="100%",t.style.height="100%",t.style.position="absolute",t.style.top="0",t.style.left="0",t.style.backgroundColor="rgba(30, 30, 30, 0.4)",t.style.display="flex",t.style.justifyContent="center",t.style.alignItems="center",t.style.overflow="hidden",t.style.zIndex="9999",t.addEventListener("click",(e=>{e.target===t&&document.body.removeChild(t)}));const e=document.createElement("video");e.src=a,e.style.maxWidth="80%",e.style.maxHeight="80%",e.setAttribute("preload","auto"),e.setAttribute("controls","true"),t.appendChild(e),document.body.appendChild(t)}})),this.table.listen(vt.DBLCLICK_CELL,(t=>{this.table._canResizeColumn(t.col,t.row)&&this.table.scenegraph.updateAutoColWidth(t.col)})),this.table.isPivotTable()&&function(t){t.listen(vt.MOUSEENTER_CELL,(e=>{const{col:n,row:i}=e;if(-1===n||-1===i)return;const r=t.internalProps.layoutMap.getHeaderDimension(n,i);r?.drillDown||r?.drillUp?t.stateManeger.updateDrillState(r.dimensionKey,r.dimensionTitle,r.drillDown,r.drillUp,n,i):t.stateManeger.updateDrillState(void 0,void 0,!1,!1,-1,-1)}))}(this.table),function(t){let e=!1;e=t.isPivotTable()?t.internalProps.layoutMap.indicatorsDefine.some((t=>"string"!=typeof t&&"sparkline"===t.columnType)):t.internalProps.layoutMap.columnObjects.some((t=>"sparkline"===t.columnType));e&&(t.listen(vt.MOUSEMOVE_CELL,(e=>{const{col:n,row:i,x:r,y:o}=e;"sparkline"!==t.getBodyColumnType(n,i)&&t.stateManeger.updateSparklineHoverPose(-1,-1,0,0),t.stateManeger.updateSparklineHoverPose(n,i,r,o)})),t.listen(vt.MOUSELEAVE_TABLE,(e=>{t.stateManeger.updateSparklineHoverPose(-1,-1,0,0)})))}(this.table)}dealTableHover(t){if(!t)return void this.table.stateManeger.updateHoverPos(-1,-1);const{eventArgs:e}=t;e?this.table.stateManeger.updateHoverPos(e.col,e.row):this.table.stateManeger.updateHoverPos(-1,-1)}dealIconHover(t){const{eventArgs:e}=t;e?this.table.stateManeger.updateHoverIcon(e.col,e.row,e.target,e.targetCell,e.event):this.table.stateManeger.updateHoverIcon(-1,-1,void 0,void 0)}dealMenuHover(t){}dealTableSelect(t){if(!t)return this.table.stateManeger.updateSelectPos(-1,-1),!1;const{eventArgs:e}=t;return!!e&&(this.table.stateManeger.updateHoverPos(-1,-1),this.table.stateManeger.updateSelectPos(e.col,e.row,e.event.shiftKey,e.event.ctrlKey||e.event.metaKey),!0)}deelTableSelectAll(){this.table.stateManeger.updateSelectPos(-1,-1,!1,!1,!0)}dealMenuSelect(t){}checkColumnResize(t,e){const{eventArgs:n}=t;if(n){const i=this.table.scenegraph.getResizeColAt(t.abstractPos.x,t.abstractPos.y,n.targetCell);if(this.table._canResizeColumn(i.col,i.row)&&i.col>=0)return e&&this.table.stateManeger.startResizeCol(i.col,t.abstractPos.x,t.abstractPos.y),!0}return!1}dealColumnResize(t){this.table.stateManeger.updateResizeCol(t.abstractPos.x,t.abstractPos.y)}chechColumnMover(t){const{eventArgs:e}=t;return!!(e&&this.table.isHeader(e.col,e.row)&&function(t,e,n){for(let i=0;i<n.length;i++)if(st(n[i],t,e))return!0;return!1}(e.col,e.row,this.table.stateManeger.select.ranges)&&this.table._canDragHeaderPosition(e.col,e.row))&&(this.table.stateManeger.startMoveCol(e.col,e.row,t.abstractPos.x,t.abstractPos.y),!0)}dealColumnMover(t){const{eventArgs:e}=t;this.table.stateManeger.updateMoveCol(e.col,e.row,t.abstractPos.x,t.abstractPos.y)}startColumnResize(t){}dealIconClick(t,e){const{eventArgs:n}=e,{target:i,event:r,col:o,row:a}=n||{target:t.target,event:t,col:-1,row:-1},s=i;if(s.role&&s.role.startsWith("icon-"))return this.table.fireListeners(vt.ICON_CLICK,{name:s.name,x:(s.globalAABBBounds.x1+s.globalAABBBounds.x2)/2,y:s.globalAABBBounds.y2,col:o,row:a,funcType:s.attribute.funcType,icon:s}),!0;if(i instanceof pd){const t=i.pickIcon(r.global);if(t)return this.table.fireListeners(vt.ICON_CLICK,{name:t.attribute.id,x:t.globalX+t.globalAABBBounds.width()/2,y:t.globalY+t.AABBBounds.height(),col:o,row:a,funcType:t.attribute.funcType,icon:t}),!0}return!1}}let RA;const BA=t=>{const e=t.value;return Number(e)>80?"#20a8d8":Number(e)>50?"#4dbd74":Number(e)>20?"#ffc107":"#f86c6b"};class TA extends I{_showBar;_barColor;_barBgColor;_barPositiveColor;_barNegativeColor;_barAxisColor;_barHeight;_barBottom;_barPadding;_showBarMark;_barMarkPositiveColor;_barMarkNegativeColor;_barMarkWidth;_barMarkPosition;_barRightToLeft;static get DEFAULT(){return RA||(RA=new TA)}constructor(t={},e={}){super(t,e),this._showBar=t.showBar??!0,this._barColor=t.barColor??BA,this._barPositiveColor=t.barPositiveColor??"#4dbd74",this._barNegativeColor=t.barNegativeColor??"#f86c6b",this._barAxisColor=t.barAxisColor??"black",this._barBgColor=t.barBgColor,this._barHeight=t.barHeight??3,this._barHeight=t.barHeight??3,this._barBottom=t.barBottom??0,this._barPadding=t.barPadding??[1,1,1,1],this._showBarMark=t.showBarMark??!1,this._barMarkPositiveColor=t.barMarkPositiveColor??"#4dbd74",this._barMarkNegativeColor=t.barMarkNegativeColor??"#f86c6b",this._barMarkWidth=t.barMarkWidth??2,this._barMarkPosition=t.barMarkPosition??"right",this._barRightToLeft=t.barRightToLeft??!1}get showBar(){return this._showBar}set showBar(t){this._showBar=t,this.doChangeStyle()}get barColor(){return this._barColor}set barColor(t){this._barColor=t,this.doChangeStyle()}get barBgColor(){return this._barBgColor}set barBgColor(t){this._barBgColor=t,this.doChangeStyle()}get barHeight(){return this._barHeight}set barHeight(t){this._barHeight=t,this.doChangeStyle()}get barBottom(){return this._barBottom}set barBottom(t){this._barBottom=t,this.doChangeStyle()}get barPositiveColor(){return this._barPositiveColor}set barPositiveColor(t){this._barPositiveColor=t,this.doChangeStyle()}get barNegativeColor(){return this._barNegativeColor}set barNegativeColor(t){this._barNegativeColor=t,this.doChangeStyle()}get barAxisColor(){return this._barAxisColor}set barAxisColor(t){this._barAxisColor=t,this.doChangeStyle()}get barPadding(){return this._barPadding}set barPadding(t){this._barPadding=t,this.doChangeStyle()}get showBarMark(){return this._showBarMark}set showBarMark(t){this._showBarMark=t,this.doChangeStyle()}get barMarkPositiveColor(){return this._barMarkPositiveColor}set barMarkPositiveColor(t){this._barMarkPositiveColor=t,this.doChangeStyle()}get barMarkNegativeColor(){return this._barMarkNegativeColor}set barMarkNegativeColor(t){this._barMarkNegativeColor=t,this.doChangeStyle()}get barMarkWidth(){return this._barMarkWidth}set barMarkWidth(t){this._barMarkWidth=t,this.doChangeStyle()}get barMarkPosition(){return this._barMarkPosition}set barMarkPosition(t){this._barMarkPosition=t,this.doChangeStyle()}get barRightToLeft(){return this._barRightToLeft}set barRightToLeft(t){this._barRightToLeft=t,this.doChangeStyle()}clone(){return new TA(this,null)}}const MA=["type","content","font","color","width","height","marginRight","marginLeft","src","svg","name","path","positionType","tooltip","hover","cursor","shape","interactive"];class PA{expandIcon;collapseIcon;_table;constructor(t){this._table=t;const e=aS();this.expandIcon=e[h.expandIconName],this.collapseIcon=e[h.collapseIconName]}getIcons(t,e,n,i,r){const o=[],{icon:a}=this._table.getBodyColumnDefine(t,e);if(a){let r;if("function"==typeof a){r=a({col:t,row:e,value:n,dataValue:i,table:this._table})}else r=a;const s=aS(),l=t=>{let e;e="string"==typeof t?s[t]:t,e&&o.push(e)};Array.isArray(r)?r.forEach(((t,e)=>{l(t)})):l(r)}const s=this.getHierarchyIcon(t,e);return s&&o.push(s),r&&o.forEach(((n,i)=>{(n.content||n.src)&&(o[i]=this.getCellIconFromRecordValue(n,t,e))})),o}getStyleClass(t){switch(t){case"text":case"link":return W;case"image":case"video":return D;case"chart":case"sparkline":return I;case"progressbar":return TA}}getCellIconFromRecordValue(t,e,n){if(Array.isArray(t))return t.map((t=>this.getCellIconFromRecordValue(t,e,n)));if(!ct.isObject(t)||"function"==typeof t)return this._table.getFieldData(t,e,n);const i={},r=t;return MA.forEach((t=>{if(void 0!==r[t]){const o=this._table.getFieldData(r[t],e,n);null!=o?i[t]=o:this._table._hasField(r[t],e,n)||(i[t]=r[t])}})),i}getHierarchyIcon(t,e){const n=this._table.getHierarchyState(t,e);return n===r.expand?this.expandIcon:n===r.collapse?this.collapseIcon:void 0}}function EA(t,e){const n=document.createElement(t);return e&&n.classList.add(...e),n}!function(){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.body.appendChild(t)}();const HA="vtable__menu-element",OA=`${HA}__item`,LA=`${HA}__content`,IA=`${HA}--hidden`,DA=`${HA}--shown`,WA=`${HA}--normal`,FA=`${HA}--select`,zA=`${HA}__icon`,jA=`${HA}__split`,NA=`${HA}__title`,GA=`${HA}__arrow`,UA=`${HA}__no-event`,KA=`${HA}__item-text`;function VA(){return EA("div",[HA,IA])}function YA(t,e,n,i,r,o){const a=t.getCellRange(i,r);for(let i=0;i<e.length;i++){const r=e[i];let{col:o,row:s}=r;const{field:l,menuKey:h}=r;if("number"!=typeof o||"number"!=typeof s)if(t.isPivotTable()&&(Array.isArray(l),1)){const e=t.internalProps.layoutMap.getPivotCellAdress(l);if(!e)continue;o=e.col,s=e.row}else{const e=t.internalProps.layoutMap.getHeaderCellAddressByField(l);if(!e)continue;o=e.col,s=e.row}if(k(o)&&k(s)&&st(a,o,s)&&n===h)return!0}return!1}class XA{_handler;_rootElement;_secondElement;_menuInstanceInfo;_showChildrenIndex;_mouseEnterSecondElement;constructor(t){this._handler=new xt,this._rootElement=VA(),this._secondElement=VA(),this._secondElement.sub=!0,this._showChildrenIndex=-1,this._rootElement?.addEventListener("mousedown",(t=>{t.stopPropagation(),t.preventDefault()})),this._rootElement?.addEventListener("touchend",(e=>{if(e.stopPropagation(),e.preventDefault(),this._rootElement.classList.contains(IA))return;const{col:n,row:i,dropDownIndex:r,menuKey:o,text:a,hasChildren:s}=e.target;if("number"!=typeof r||s)return void e.stopPropagation();const l=t.isPivotTable()?t.internalProps.layoutMap.getPivotDimensionInfo(n,i):t.getHeaderField(n,i),h=t._dropDownMenuIsHighlight(n,i,r);t.fireListeners(vt.DROPDOWNMENU_CLICK,{col:n,row:i,field:l,menuKey:o,text:a,highlight:h,cellType:t.getCellType(n,i)}),t.fireListeners(vt.DROPDOWN_MENU_CLEAR,null),t.fireListeners(vt.HIDE_MENU),e.stopPropagation()})),this._rootElement?.addEventListener("click",(e=>{if(e.stopPropagation(),e.preventDefault(),this._rootElement.classList.contains(IA))return;const{col:n,row:i,dropDownIndex:r,menuKey:o,text:a,hasChildren:s}=e.target;if("number"!=typeof r||s)return void e.stopPropagation();const l=t.isPivotTable()?t.internalProps.layoutMap.getPivotDimensionInfo(n,i):t.getHeaderField(n,i),h=t._dropDownMenuIsHighlight(n,i,r);t.fireListeners(vt.DROPDOWNMENU_CLICK,{col:n,row:i,field:l,menuKey:o,text:a,highlight:h,cellType:t.getCellType(n,i)}),t.fireListeners(vt.DROPDOWN_MENU_CLEAR,null),t.fireListeners(vt.HIDE_MENU),e.stopPropagation()})),this._rootElement?.addEventListener("mousemove",(e=>{if(this._rootElement.classList.contains(IA))return;e.stopPropagation();const{hasChildren:n,dropDownIndex:i,col:r,row:o,sub:a}=e.target;if(n){this._showChildrenIndex=i;const n=this._secondElement;n?.classList.remove(IA),n?.classList.add(DA),n.innerHTML="";const a=this._menuInstanceInfo.content[i]?.children;for(let e=0;e<a.length;e++){const i=a[e],s=$A(i,!!t.stateManeger.menu.dropDownMenuHighlight&&YA(t,t.stateManeger.menu.dropDownMenuHighlight,"object"==typeof i?i?.menuKey||i?.text:i,r,o));s.col=r,s.row=o,s.dropDownIndex=e,"string"==typeof i?(s.text=i,s.menuKey=i):"object"==typeof i&&(s.text=i.text,s.menuKey=i.menuKey||i.text),s.sub=!0,s.sub=!0,n.appendChild(s)}const s=e.target.getBoundingClientRect();this._bindSecondElement(t,r,o,s.right,s.top)}else if(n&&this._showChildrenIndex===i){const t=this._secondElement;t?.classList.remove(IA),t?.classList.add(DA)}else!a&&this._secondElement?.classList.contains(DA)&&setTimeout((()=>{if(!0!==this._mouseEnterSecondElement){this._showChildrenIndex=-1;const t=this._secondElement;t?.classList.remove(DA),t?.classList.add(IA)}}),300)})),this._secondElement?.addEventListener("mousemove",(t=>{this._rootElement.classList.contains(IA)||t.stopPropagation()})),this._secondElement?.addEventListener("mouseenter",(t=>{this._mouseEnterSecondElement=!0})),this._secondElement?.addEventListener("mouseleave",(t=>{this._mouseEnterSecondElement=!1})),this._secondElement?.addEventListener("mousedown",(t=>{t.stopPropagation(),t.preventDefault()})),this._secondElement?.addEventListener("click",(e=>{if(e.stopPropagation(),e.preventDefault(),this._secondElement.classList.contains(IA))return;const{col:n,row:i,dropDownIndex:r,menuKey:o,text:a,hasChildren:s}=e.target;if("number"!=typeof r||s)return void e.stopPropagation();const l=t.isPivotTable()?t.internalProps.layoutMap.getPivotDimensionInfo(n,i):t.getHeaderField(n,i);let h=!1;this._menuInstanceInfo.content.forEach(((e,r)=>{if("object"==typeof e&&e.children&&e.children.length)for(let r=0;r<e.children.length;r++){const a=e.children[r];if(YA(t,t.stateManeger.menu.dropDownMenuHighlight,"object"==typeof a?a?.menuKey:a,n,i)&&o===("object"==typeof a?a?.menuKey:a))return void(h=!0)}})),t.fireListeners(vt.DROPDOWNMENU_CLICK,{col:n,row:i,field:l,cellHeaderPaths:t.isPivotTable()?t.getCellHeaderPaths(n,i):void 0,menuKey:o,text:a,highlight:h,cellType:t.getCellType(n,i)}),t.fireListeners(vt.DROPDOWN_MENU_CLEAR,null),t.fireListeners(vt.HIDE_MENU),e.stopPropagation()}))}get rootElement(){return this._rootElement}dispose(){this.unbindFromCell();const t=this._rootElement;t?.parentElement&&t.parentElement.removeChild(t),this._handler.dispose(),delete this._rootElement}bindToCell(t,e,n,i){const r=this._rootElement,o=this._secondElement;if(this._menuInstanceInfo=i,r?.classList.remove(DA),r?.classList.add(IA),o?.classList.remove(DA),o?.classList.add(IA),this._canBindToCell(t,e,n)){if(r.innerHTML="",Array.isArray(i.content)){const o=i.content;for(let i=0;i<o?.length;i++){const a=o[i];let s=!!t.stateManeger.menu.dropDownMenuHighlight&&YA(t,t.stateManeger.menu.dropDownMenuHighlight,"object"==typeof a?a?.menuKey||a?.text:a,e,n);if(t.stateManeger.menu.dropDownMenuHighlight&&"object"==typeof a&&Array.isArray(a.children)&&a.children.length)for(let i=0;i<a.children.length;i++){const r=a.children[i];if(YA(t,t.stateManeger.menu.dropDownMenuHighlight,"object"==typeof r?r?.menuKey||r?.text:r,e,n)){s=!0;break}}const l=$A(a,s);l.col=e,l.row=n,l.dropDownIndex=i,"string"==typeof a?(l.text=a,l.menuKey=a):"object"==typeof a&&(l.text=a.text,l.menuKey=a.menuKey||a.text,a.children?.length&&(l.hasChildren=!0)),r.appendChild(l)}}if(this._bindToCell(t,e,n,i.position,i.referencePosition))return r?.classList.add(DA),r?.classList.remove(IA),!0}else this.unbindFromCell();return!1}unbindFromCell(){const t=this._rootElement,e=this._secondElement;this._menuInstanceInfo=void 0,t?.parentElement&&(t.classList.remove(DA),t.classList.add(IA)),e?.parentElement&&(e.classList.remove(DA),e.classList.add(IA))}_canBindToCell(t,e,n){const i=t.getCellRangeRelativeRect({col:e,row:n}),r=t.getElement(),{top:o,bottom:a,left:s,right:l}=i,{frozenRowCount:h,frozenColCount:u}=t;if(n>=h&&h>0){if(a<t.getCellRangeRelativeRect({col:e,row:h-1}).bottom)return!1}else if(a<0)return!1;if(e>=u&&u>0){if(l<t.getCellRangeRelativeRect({col:u-1,row:n}).right)return!1}else if(l<0)return!1;const{offsetHeight:c,offsetWidth:d}=r;return!(c<o)&&!(d<s)}_bindToCell(t,e,n,i,r){const o=this._rootElement,a=t.getElement(),{width:s,height:l}=t.internalProps.element.getBoundingClientRect();if(o){o.parentElement!==a&&a.appendChild(o),o.style.left="0px";const e=.8*s;o.style.maxWidth=`${e}px`;const n=o.clientWidth,h=o.clientHeight;let u,c;return i?(u=i.x+t.tableX,c=i.y+t.tableY):r&&(u=r.rect.right-n+t.tableX,c=r.rect.bottom+t.tableY),c+h>l&&(c=l-h,u+=n-2),c<0&&(c/=2),o.style.top=`${c}px`,u<0?u=0:u+n>s&&(u=s-n),o.style.left=`${u}px`,!0}return!1}_bindSecondElement(t,e,n,i,r){const o=this._secondElement,a=this._rootElement,s=t.getElement(),{width:l,left:h,top:u}=t.internalProps.element.getBoundingClientRect(),{x:c,y:d,width:f}=a.getBoundingClientRect();if(o){o.parentElement!==s&&s.appendChild(o),o.style.left="0px";const t=.8*l;o.style.maxWidth=`${t}px`;const e=o.clientWidth,n=r-4-u,a=i-h;o.style.top=`${n}px`;let c=a;return c+e>l?c=c-e-f:c+=4,o.style.left=`${c}px`,!0}return!1}pointInMenuElement(t,e){const n=this._rootElement,{x:i,y:r,width:o,height:a}=n.getBoundingClientRect();if(t>i-5&&t<i+o+5&&e>r-5&&e<r+a+5)return!0;if(this._secondElement){const{x:i,y:r,width:o,height:a}=n.getBoundingClientRect();if(t>i-5&&t<i+o+5&&e>r-5&&e<r+a+5)return!0}return!1}}function $A(t,e){const n=EA("div",[OA,e?FA:WA]);if("string"==typeof t){const e=EA("span",[LA,UA,KA]);e.innerHTML=t,n.appendChild(e)}else if("object"==typeof t){const i=t.type??"item";if("split"===i)return n?.classList.add(jA),n;if(t?.icon?.svg)if(Ae.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,n.appendChild(e)}else{const i=EA("span",[zA,UA]);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()),n.appendChild(i)}const r=EA("span",[LA,UA,KA]);if(r.innerHTML=t.text,n.appendChild(r),"title"===i)n?.classList.add(UA,NA);else if(t?.children?.length){const t=EA("span",[LA,UA,GA]);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>',n.appendChild(t)}}return n}let qA;class ZA extends j{static get DEFAULT(){return qA||(qA=new ZA)}constructor(t={},e={}){super(t,e),this.textAlign=(t.textAlign??e?.textAlign)||"center"}clone(){return new ZA(this)}}class JA{normalIcon;upIcon;downIcon;freezeIcon;frozenIcon;frozenCurrentIcon;dropDownAbsoluteIcon;expandIcon;collapseIcon;_table;constructor(t){this._table=t;const e=aS();this.freezeIcon=e[h.freezeIconName],this.frozenIcon=e[h.frozenIconName],this.frozenCurrentIcon=e[h.frozenCurrentIconName],this.normalIcon=e[h.normalIconName],this.upIcon=e[h.upwardIconName],this.downIcon=e[h.downwardIconName],this.dropDownAbsoluteIcon=e[h.dropdownIconName],this.expandIcon=e[h.expandIconName],this.collapseIcon=e[h.collapseIconName]}getIcons(t,e){const n=[];if(this._table.isPivotTable()){const{showSort:i}=this._table.internalProps.layoutMap.getHeader(t,e);if(i){const i=this._table.getPivotSortState(t,e),r="asc"===i?this.downIcon:"desc"===i?this.upIcon:this.normalIcon;r&&n.push(r)}}else{const i=this._table.sortState;let r;r=void 0;const o=this._table.getCellRange(t,e);if(i)if(Array.isArray(i))for(let t=0;t<i.length;t++){const e=i[t],n=this._table._getHeaderCellBySortState(e);if(n&&st(o,n.col,n.row)){({order:r}=e);break}}else{const t=this._table._getHeaderCellBySortState(i);t&&st(o,t.col,t.row)&&({order:r}=i)}const a=this.getSortIcon(r,this._table,t,e);a&&n.push(a)}if(this._table.showFrozenIcon&&t<this._table.allowFrozenColCount){const i=this.getFrozenIcon(t,e);i&&n.push(i)}if(this.checkDropDownIcon(this._table,t,e)){const t=this.dropDownAbsoluteIcon;n.push(t)}const i=this.getDropDownStateIcons(this._table,t,e);i.length&&n.push(...i);const{captionIcon:r,headerIcon:o}=this._table._getHeaderLayoutMap(t,e);r&&n.push(r);const a=this.getHierarchyIcon(t,e);if(a&&n.push(a),o){let i;if("function"==typeof o){i=o({col:t,row:e,value:this._table.getCellValue(t,e),dataValue:this._table.getCellOriginValue(t,e),table:this._table})}else i=o;const r=aS(),a=t=>{let e;e="string"==typeof t?r[t]:t,e&&n.push(e)};Array.isArray(i)?i.forEach(((t,e)=>{a(t)})):a(i)}return n}getFrozenIcon(t,e){if(this._table.isPivotTable()||this._table.transpose)return null;const n=this._table.getHeaderDefine(t,e);if(n.columns&&n.columns.length>0)return null;let i=this.freezeIcon;return this._table.options.frozenColCount-1>t?i=this.frozenIcon:this._table.options.frozenColCount-1===t&&(i=this.frozenCurrentIcon),i}getSortIcon(t,e,n,i){const r="asc"===t?this.downIcon:"desc"===t?this.upIcon:this.normalIcon,o=e.getHeaderDefine(n,i);return!o||!o.showSort&&!o.sort||o.columns&&o.columns.length>0?null:r}getDropDownStateIcons(t,e,n){const i=t.getHeaderDefine(e,n),r=t._getHeaderLayoutMap(e,n),{dropDownMenu:o}=r,a=[];if(Array.isArray(o)&&o.length||Array.isArray(t.globalDropDownMenu)&&t.globalDropDownMenu.length&&!i?.columns?.length){const i=o||t.globalDropDownMenu;let r=-1,h=-1;for(let o=0;o<i.length;o++){const a=i[o];if("object"==typeof a&&a.children&&a.children.length)for(let i=0;i<a.children.length;i++){const s=a.children[i];if(t.stateManeger.menu?.dropDownMenuHighlight&&YA(t,t.stateManeger.menu?.dropDownMenuHighlight,"object"==typeof s?s?.menuKey:s,e,n)){r=o,h=i;break}}if(t._dropDownMenuIsHighlight(e,n,o)){r=o;break}}if(-1!==r){let e;e=-1!==h?(o||t.globalDropDownMenu)[r].children[h]:(o||t.globalDropDownMenu)[r],e.stateIcon&&(e.stateIcon.svg?a.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:s.right,marginRight:0,funcType:l.dropDownState,interactive:!1}):e.stateIcon.src&&a.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:s.right,marginRight:0,funcType:l.dropDownState,interactive:!1}))}}return a}getDropDownIconRect(t,e,n){const i=this.downIcon.hover?.width??this.downIcon?.width??0,r=this.downIcon.hover?.height??this.downIcon?.height??0,o=t.right-2-i,a=t.right-2;let s;s="middle"===n?t.top+t.height/2-i/2:"top"===n?t.top+e/2:"bottom"===n?t.bottom-2*e:t.top;return{left:o,right:a,top:s,bottom:r+s,width:i,height:r}}getHierarchyIcon(t,e){const{hierarchyState:n}=this._table._getHeaderLayoutMap(t,e);if(n){if(n===r.expand)return this.expandIcon;if(n===r.collapse)return this.collapseIcon}}checkDropDownIcon(t,e,n){if(t.isPivotTable()){const i=t._getHeaderLayoutMap(e,n);if(Array.isArray(i.dropDownMenu)&&i.dropDownMenu.length)return!0}else{const i=t.getHeaderDefine(e,n);if(Array.isArray(i.dropDownMenu)&&i.dropDownMenu.length||(!Array.isArray(i.dropDownMenu)||0!==i.dropDownMenu.length)&&Array.isArray(t.globalDropDownMenu)&&t.globalDropDownMenu.length&&!i?.columns?.length)return!0}return!1}getStyleClass(t){switch(t){case"text":case"link":return G;case"image":case"video":return ZA}}}class QA{_table;_tooltipElement;constructor(t){this._table=t}dispose(){this.unbindTooltipElement(),this._tooltipElement&&this._tooltipElement.dispose?.(),this._tooltipElement=void 0}_getTooltipElement(){return this._tooltipElement||(this._tooltipElement=this.createTooltipElementInternal()),this._tooltipElement}bindTooltipElement(t,e,n,i){return this._getTooltipElement().bindToCell(this._table,t,e,n,i)}moveTooltipElement(t,e,n,i){this._getTooltipElement().move(this._table,t,e,n,i)}unbindTooltipElement(){this._getTooltipElement().unbindFromCell()}locateTooltipElement(t,e,n,i,r){this._getTooltipElement()._locate(this._table,t,e,n,i,r)}}!function(){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\tpointer-events: none;\n\tuser-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\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: hidden;\n\tword-wrap: break-word;\n\tposition: relative;\n\tbackground-color: #FFF;\n\tz-index: 2;\n\tborder-radius: 4px\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.body.appendChild(t)}();const tR="vtable__bubble-tooltip-element",eR=`${tR}__content`,nR=`${tR}__triangle`,iR=`${tR}--hidden`,rR=`${tR}--shown`;class oR{_handler;_rootElement;_messageElement;_triangleElement;constructor(){this._handler=new xt;const t=this._rootElement=EA("div",[tR,iR]),e=EA("span",[eR]),n=EA("span",[nR]);t.appendChild(n),t.appendChild(e),this._messageElement=t.querySelector(`.${eR}`)||void 0,this._triangleElement=t.querySelector(`.${nR}`)||void 0}bindToCell(t,e,n,i,r){const o=this._rootElement,a=this._messageElement,s=this._triangleElement;if(o?.classList.remove(rR),o?.classList.add(iR),this._canBindToCell(t,e,n)){a.setAttribute("style",""),s.setAttribute("style",""),i?.className&&o.classList.add(i.className),i?.style?.bgColor&&(a.style.backgroundColor=i?.style?.bgColor),i?.style?.bgColor&&(s.style.backgroundColor=i?.style?.bgColor),s.style.display=!0===i?.style?.arrowMark?"block":"none",i?.style?.font&&(a.style.font=i?.style?.font),i?.style?.color&&(a.style.color=i?.style?.color),i?.style?.padding&&(a.style.padding=`${i?.style?.padding.join("px ")}px`),a&&(a.textContent=i?.content);if(this._bindToCell(t,e,n,i?.position,i?.referencePosition,r,i?.style?.arrowMark))return o?.classList.add(rR),o?.classList.remove(iR),!0}else this.unbindFromCell();return!1}dispose(){this.unbindFromCell();const t=this._rootElement;t?.parentElement&&t.parentElement.removeChild(t),this._handler?.dispose?.(),delete this._rootElement,delete this._messageElement}move(t,e,n,i,r){const o=this._rootElement;this._canBindToCell(t,e,n)?(this._bindToCell(t,e,n,i?.position,i?.referencePosition,r),o?.classList.add(rR),o?.classList.remove(iR)):this.unbindFromCell()}unbindFromCell(){const t=this._rootElement;t?.parentElement&&(t.classList.remove(rR),t.classList.add(iR))}_canBindToCell(t,e,n){const i=t.getCellRangeRelativeRect({col:e,row:n}),r=t.getElement(),{bottom:o,left:a,right:s}=i,{frozenRowCount:l,frozenColCount:h}=t;if(n>=l&&l>0){if(o<t.getCellRangeRelativeRect({col:e,row:l-1}).bottom)return!1}else if(o<0)return!1;if(e>=h&&h>0){if(s<t.getCellRangeRelativeRect({col:h-1,row:n}).right)return!1}else if(a<0)return!1;const{offsetHeight:u,offsetWidth:c}=r;return!(u<o)&&!(c<a)}_bindToCell(t,e,n,i,r,o,a){const s=this._rootElement,l=t.getCellRangeRelativeRect({col:e,row:n}),h=t.getElement(),u=t.internalProps.element.offsetWidth,{width:c}=l;if(s){let l,d;s.parentElement!==h&&h.appendChild(s),s.style.left="0px";const f=Math.min(.8*u,4*c);s.style.maxWidth=`${f}px`;const p=s.clientWidth,g=s.clientHeight;if(!i&&!r)return!1;{const s=this.getComputedPosition(t,e,n,i,r,o,a);d=s.x,l=s.y}s.style.left=`${d}px`,s.style.top=`${l}px`,R()&&(s.style.fontSize="11px");const{x1:v,x2:y,y1:m,y2:b}=t.stateManeger.menu.bounds,w=d,C=w+p,x=l,_=w+g;return!(t.stateManeger.menu.isShow&&v<C&&y>w&&b>x&&m<_)}return!1}getComputedPosition(t,e,n,r,o,a,s){const l=this._rootElement,h=t.getCellRangeRelativeRect({col:e,row:n}),{width:u,height:c}=t.internalProps.element.getBoundingClientRect(),{width:d}=h;let f,p;const g=Math.min(.8*u,4*d);l.style.maxWidth=`${g}px`;const v=l.clientWidth,y=l.clientHeight,m=s?6:0;if(r)p=r.x,f=r.y+m,this._triangleElement.style.left="50%",this._triangleElement.style.marginLeft="-5px",this._triangleElement.style.top="-5px";else if(o){let e=o.placement??i.bottom;const n=o.rect.left+o.rect.width/2+t.tableX,r=o.rect.top+o.rect.height/2+t.tableY,s=o.rect.top+t.tableY,l=o.rect.bottom+t.tableY,h=o.rect.left+t.tableX,d=o.rect.right+t.tableX;let g=0;const b=()=>{g++,g>=4||(this.removeStyleFromTriangle(),e===i.top?(p=n-v/2,f=s-y-m,this._triangleElement.style.left="50%",this._triangleElement.style.marginLeft="-5px",this._triangleElement.style.bottom="-5px",a&&f<0&&(e=i.right,b())):e===i.bottom?(p=n-v/2,f=l+m,this._triangleElement.style.left="50%",this._triangleElement.style.marginLeft="-5px",this._triangleElement.style.top="-5px",a&&f+y>c&&(e=i.left,b())):e===i.left?(f=r-y/2,p=h-v-m,this._triangleElement.style.top="50%",this._triangleElement.style.marginTop="-5px",this._triangleElement.style.right="-5px",a&&p<0&&(e=i.top,b())):e===i.right&&(f=r-y/2,p=d+m,this._triangleElement.style.top="50%",this._triangleElement.style.marginTop="-5px",this._triangleElement.style.left="-5px",a&&p+v>u&&(e=i.bottom,b())))};b()}return a&&(p<0?p=0:p+l.offsetWidth>u&&(p=u-l.offsetWidth)),{x:p,y:f}}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,n,i,r,o){const a=this.getComputedPosition(t,e,n,i,r,o),s=a.x,l=a.y;this._rootElement.style.left=`${s}px`,this._rootElement.style.top=`${l}px`}}class aR extends QA{createTooltipElementInternal(){return new oR}}const sR={"bubble-tooltip":function(t){return new aR(t)}};class lR{_table;_tooltipInstances;_attachInfo;confine;constructor(t,e){this._table=t,this._tooltipInstances={},this._bindTableEvent(t),this.confine=e}dispose(){const t=this._tooltipInstances;for(const e in t)t[e]?.dispose?.();delete this._tooltipInstances,this._attachInfo=null}_bindToCell(t,e,n){const i=this._attachInfo,r=this._getTooltipInstanceInfo(t,e);if(!i||r&&i.instance===r||(i.instance?.unbindTooltipElement(),this._attachInfo=null),!r)return;if(r&&r.bindTooltipElement(t,e,n,this.confine)){const i=this._table.getCellRange(t,e);this._attachInfo={range:i,instance:r,tooltipOptions:n}}}_move(t,e,n){const i=this._attachInfo;if(!i||!st(i.range,t,e))return;const{instance:r}=i;r?.moveTooltipElement(t,e,n,this.confine)}moveToPosition(t,e,n,i){const r=this._attachInfo;if(!r||!st(r.range,t,e))return;const{instance:o}=r;this._attachInfo.tooltipOptions.position=n,this._attachInfo.tooltipOptions.referencePosition=i,o?.locateTooltipElement(t,e,n,i,this.confine)}_unbindFromCell(){const t=this._attachInfo;if(!t)return;const{instance:e}=t;e?.unbindTooltipElement(),this._attachInfo=null}_isBindCell(t,e){const n=this._attachInfo;return!!n&&st(n.range,t,e)}_bindTableEvent(t){t.listen(vt.MOUSEENTER_CELL,(e=>{if(R())return;const{x1:n,x2:r,y1:o,y2:a}=t.stateManeger.menu.bounds;if(t.stateManeger.menu.isShow&&"number"==typeof e.x&&"number"==typeof e.y&&e.x>n&&e.x<r&&e.y>o&&e.y<a)return;const{col:s,row:l}=e;if((!e.related||!this._isBindCell(s,l))&&t.internalProps.tooltip?.isShowOverflowTextTooltip){const n=t.getCellOverflowText(s,l),r=t.getHeaderDescription(s,l),o=t.getCellRangeRelativeRect({col:s,row:l});let a;n&&(a={content:r?`${r}\n ${n}`:n,referencePosition:{placement:i.bottom,rect:o},style:{arrowMark:!1}}),r&&(a={content:r,referencePosition:{placement:i.bottom,rect:o},style:{arrowMark:!1}}),a&&this._bindToCell(e.col,e.row,a)}})),t.listen(vt.MOUSEMOVE_CELL,(e=>{if(!R()){if(this._attachInfo?.tooltipOptions?.referencePosition){const n=this._attachInfo.tooltipOptions.referencePosition,{event:i}=e,{left:r,right:o,top:a,bottom:s}=n.rect,l=t._getMouseAbstractPoint(i,!1);l&&l.x>=r-5&&l.x<=o+5&&l.y>=a-5&&l.y<=s+5||this._unbindFromCell()}this._attachInfo&&t.stateManeger.menu.isShow&&this._bindToCell(e.col,e.row)}})),t.listen(vt.MOUSELEAVE_CELL,(t=>{t.related&&this._isBindCell(t.related.col,t.related.row)||this._unbindFromCell()})),t.listen(vt.SELECTED_CELL,(t=>{this._isBindCell(t.col,t.row)&&this._unbindFromCell()})),t.listen(vt.SCROLL,(e=>{const n=this._attachInfo;if(n?.tooltipOptions&&n?.range?.start){const{col:e,row:i}=n.range.start,r=t.getCellRangeRelativeRect({col:e,row:i});n.tooltipOptions.referencePosition.rect=r,this._move(n.range.start.col,n.range.start.row,n.tooltipOptions)}}))}_getTooltipInstanceInfo(t,e){const n=this._table,i=this._tooltipInstances,r="bubble-tooltip";return i&&i[r]||i&&(i[r]=sR[r](n))}isBinded(t){return JSON.stringify(t)===JSON.stringify(this._attachInfo?.tooltipOptions)}}class hR{_table;_menuElement;constructor(t){this._table=t}dispose(){this.unbindMenuElement(),this._menuElement&&this._menuElement.dispose(),this._menuElement=void 0}_getMenuElement(){return this._menuElement||(this._menuElement=this.createMenuElementInternal()),this._menuElement}bindMenuElement(t,e,n){return this._getMenuElement().bindToCell(this._table,t,e,n)}unbindMenuElement(){this._getMenuElement().unbindFromCell()}pointInMenuElement(t,e){return this._getMenuElement().pointInMenuElement(t,e)}}const uR="vtable__menu-element",cR=`${uR}--hidden`,dR=`${uR}--shown`;class fR{_handler;_rootElement;_menuInstanceInfo;constructor(t){this._handler=new xt,this._rootElement=EA("div",[uR,cR]),this._rootElement?.addEventListener("mousedown",(t=>{t.stopPropagation(),t.preventDefault()})),this._rootElement?.addEventListener("click",(e=>{if(e.stopPropagation(),e.preventDefault(),this._rootElement.classList.contains(cR))return;const{col:n,row:i,dropDownIndex:r,menuKey:o,text:a,hasChildren:s}=e.target;if("number"!=typeof r||s)return void e.stopPropagation();const l=t.isPivotTable()?t.internalProps.layoutMap.getPivotDimensionInfo(n,i):t.getHeaderField(n,i),h=t._dropDownMenuIsHighlight(n,i,r);t.fireListeners(vt.DROPDOWNMENU_CLICK,{col:n,row:i,field:l,menuKey:o,text:a,highlight:h,cellType:t.getCellType(n,i)}),t.fireListeners(vt.DROPDOWN_MENU_CLEAR,null),t.fireListeners(vt.HIDE_MENU),e.stopPropagation()})),this._rootElement?.addEventListener("mousemove",(t=>{this._rootElement.classList.contains(cR)||t.stopPropagation()}))}get rootElement(){return this._rootElement}dispose(){this.unbindFromCell();const t=this._rootElement;t?.parentElement&&t.parentElement.removeChild(t),this._handler.dispose(),delete this._rootElement}bindToCell(t,e,n,i){const r=this._rootElement;if(this._menuInstanceInfo=i,r?.classList.remove(dR),r?.classList.add(cR),this._canBindToCell(t,e,n)){r.innerHTML="",r.appendChild(i.content);if(this._bindCell(t,e,n,i.position,i.referencePosition))return r?.classList.add(dR),r?.classList.remove(cR),!0}else this.unbindFromCell();return!1}unbindFromCell(){const t=this._rootElement;this._menuInstanceInfo=void 0,t?.parentElement&&(t.classList.remove(dR),t.classList.add(cR))}_canBindToCell(t,e,n){const i=t.getCellRangeRelativeRect({col:e,row:n}),r=t.getElement(),{top:o,bottom:a,left:s,right:l}=i,{frozenRowCount:h,frozenColCount:u}=t;if(n>=h&&h>0){if(a<t.getCellRangeRelativeRect({col:e,row:h-1}).bottom)return!1}else if(a<0)return!1;if(e>=u&&u>0){if(l<t.getCellRangeRelativeRect({col:u-1,row:n}).right)return!1}else if(l<0)return!1;const{offsetHeight:c,offsetWidth:d}=r;return!(c<o)&&!(d<s)}_bindCell(t,e,n,i,r){const o=this._rootElement,a=t.getElement(),{width:s,height:l}=t.internalProps.element.getBoundingClientRect();if(o){o.parentElement!==a&&a.appendChild(o),o.style.left="0px";const t=.8*s;o.style.maxWidth=`${t}px`;const e=o.clientWidth,n=o.clientHeight;let h,u;return i&&(h=i.x,u=i.y),r&&(h=r.rect.right-e,u=r.rect.bottom),u+n>l&&(u=l-n,h+=e-2),u<0&&(u/=2),o.style.top=`${u}px`,h<0?h=0:h+e>s&&(h=s-e),o.style.left=`${h}px`,!0}return!1}pointInMenuElement(t,e){const n=this._rootElement,{x:i,y:r,width:o,height:a}=n.getBoundingClientRect();return t>i-5&&t<i+o+5&&e>r-5&&e<r+a+5}}class pR extends hR{createMenuElementInternal(){return new XA(this._table)}}let gR=class extends hR{createMenuElementInternal(){return new fR(this._table)}};const vR={"dropdown-menu":function(t){return new pR(t)},"context-menu":function(t){return new pR(t)},container:t=>new gR(t)};class yR{_table;_menuInstances;_attachInfo;constructor(t){this._table=t,this._menuInstances={},this._bindTableEvent(t)}dispose(){const t=this._menuInstances;for(const e in t)t[e].dispose();delete this._menuInstances,this._attachInfo=null}_bindToCell(t,e,n,i){const r=this._attachInfo,o=this._getMenuInstanceInfo(t,e,n,i);if(!r||o&&r.instance===o.instance||(r.instance?.unbindMenuElement(),this._attachInfo=null),!o)return;const{instance:a,info:s}=o;if(a&&a.bindMenuElement(t,e,s)){const n=this._table.getCellRange(t,e);this._attachInfo={range:n,instance:a}}}_unbindFromCell(){const t=this._attachInfo;if(!t)return;const{instance:e}=t;e?.unbindMenuElement(),this._attachInfo=null}_isBindToCell(t,e){const n=this._attachInfo;return!!n&&st(n.range,t,e)}pointInMenuElement(t,e){if(!this._attachInfo)return!1;const n=this._attachInfo,{instance:i}=n;return i.pointInMenuElement(t,e)}_bindTableEvent(t){t.listen(vt.DROPDOWN_ICON_CLICK,(t=>{this._attachInfo&&this._isBindToCell(t.col,t.row)?this._unbindFromCell():this._bindToCell(t.col,t.row,"dropdown-menu")})),t.listen(vt.DROPDOWN_MENU_CLEAR,(t=>{this._unbindFromCell()})),t.listen(vt.CONTEXTMENU_CELL,(e=>{if("html"===t.internalProps.menu?.renderMode){const n=t._getMouseAbstractPoint(e.event,!1);let i=null;n&&"function"==typeof t.internalProps.menu?.contextMenuItems?i=t.internalProps.menu.contextMenuItems(t.getHeaderField(e.col,e.row),e.row):n&&Array.isArray(t.internalProps.menu?.contextMenuItems)&&(i=t.internalProps.menu?.contextMenuItems),this._bindToCell(e.col,e.row,"context-menu",{content:i,position:{x:n.x,y:n.y}})}}))}_getMenuInstanceInfo(t,e,n,i){const r=this._table,o=this._menuInstances,a=function(t,e,n,i,r){const{lineHeight:o,textBaseline:a,textStick:s}=t._getCellStyle(e,n);let l=t.getCellRangeRelativeRect(t.getCellRange(e,n));s&&(l=t.getVisibleCellRangeRelativeRect({col:e,row:n}));let{left:h,right:u,bottom:c,top:d,width:f,height:p}=l;if(t.isHeader(e,n)&&({left:h,right:u,bottom:c,top:d,width:f,height:p}=t.internalProps.headerHelper.getDropDownIconRect(l,o,a||"middle")),r?.content)return{type:i,position:r.position,referencePosition:r.referencePosition??{rect:{left:h,right:u,top:d,bottom:c,width:f,height:p}},content:r.content};if("dropdown-menu"===i){const{dropDownMenu:r=t.globalDropDownMenu,pivotInfo:o}=t._getHeaderLayoutMap(e,n);return{type:i,referencePosition:{rect:{left:h,right:u,top:d,bottom:c,width:f,height:p}},content:r,pivotInfo:o}}return null}(r,t,e,n,i);if(!a)return null;return{instance:o&&o[n]||o&&(o[n]=vR[n](r)),type:n,info:a}}}class mR extends EventTarget{_table;_input;constructor(t,e){if(super(),this._table=t,"node"===bt.mode)return;const n=document.createElement("div");n.style.opacity="0",n.dataset.vtable="vtable",n.style.pointerEvents="none",n.classList.add("input-container");const i=this._input=document.createElement("input");n.appendChild(i),i.classList.add("table-focus-control"),i.dataset.vtable="vtable",i.readOnly=!0,e.appendChild(n)}focus(){this._input.focus({preventScroll:!0})}setFocusRect(t,e){const n=this._input;n.value=e,n.select();const i=t.top-this._table.scrollTop,r=t.left-this._table.scrollLeft;n.style.top=`${i.toFixed()}px`,n.style.left=`${r.toFixed()}px`,n.style.width=`${t.width.toFixed()}px`,n.style.height=`${t.height.toFixed()}px`}get input(){return this._input}dispose(){}}let bR=1;V?bR=1:(bR=Math.ceil(window.devicePixelRatio||1),bR>1&&bR%2!=0&&(bR+=1));const{toBoxArray:wR}=pt,{isTouchEvent:CR}=ft,xR=/^\$(\d+)\$(\d+)$/;!function(){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}\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.body.appendChild(t)}();class _R extends P{internalProps;showFrozenIcon=!0;showSort=!0;padding;globalDropDownMenu;tableNoFrameWidth;tableNoFrameHeight;tableX;tableY;_widthMode;customRender;canvasWidth;canvasHeight;scenegraph;stateManeger;eventManeger;_pixelRatio;_cellToBeInvalidatedNextFrame;_willNextFrameInvalidate;static get EVENT_TYPE(){return vt}options;version="0.9.1";pagerConf;id=`VTable${Date.now()}`;headerStyleCache;bodyStyleCache;constructor(t={}){super();const{frozenColCount:e=0,defaultRowHeight:n=40,defaultHeaderRowHeight:i,defaultColWidth:r=80,defaultHeaderColWidth:o,widthMode:a="standard",keyboardOptions:s,parentElement:l,columnResizeMode:h,dragHeaderMode:u,showFrozenIcon:c,allowFrozenColCount:d,padding:f,hover:p,menu:g,select:v,customRender:y,pixelRatio:m=bR}=t;this.options=t,this._widthMode=a,this.customRender=y,this.padding={top:0,right:0,left:0,bottom:0},f&&("number"==typeof f?(this.padding.top=f,this.padding.left=f,this.padding.bottom=f,this.padding.right=f):(f.top&&(this.padding.top=f.top),f.bottom&&(this.padding.bottom=f.bottom),f.left&&(this.padding.left=f.left),f.right&&(this.padding.right=f.right))),this.tableNoFrameWidth=0,this.tableNoFrameHeight=0;const b=this.internalProps={};void 0!==c&&(this.showFrozenIcon=c),"number"==typeof d&&d<=0&&(this.showFrozenIcon=!1),b.autoRowHeight=t.autoRowHeight??!1,b.handler=new xt,b.element=function(t){const e=document.createElement("div");e.setAttribute("tabindex","0"),e.classList.add("vtable"),e.style.outline="none",e.style.margin=`${t.top}px ${t.right}px ${t.bottom}px ${t.left}px`;const n=(e.offsetWidth||e.parentElement?.offsetWidth||1)-1,i=(e.offsetHeight||e.parentElement?.offsetHeight||1)-1;return e.style.width=n&&n-t.left-t.right+"px"||"0px",e.style.height=i&&i-t.top-t.bottom+"px"||"0px",e}(this.padding),b.focusControl=new mR(this,b.element),b.pixelRatio=m,b.canvas=document.createElement("canvas"),b.element.appendChild(b.canvas),b.context=b.canvas.getContext("2d"),b.frozenColCount=e,b.defaultRowHeight=n,b.defaultHeaderRowHeight=i??n,b.defaultColWidth=r,b.defaultHeaderColWidth=o??r,b.keyboardOptions=s,b.columnResizeMode=h,b.dragHeaderMode=u,b._rowHeightsMap=new St,b._rowRangeHeightsMap=new Map,b._colRangeWidthsMap=new Map,this.colWidthsMap=new St,this.colContentWidthsMap=new St,this.colWidthsLimit={},b.calcWidthContext={_:b,get full(){return this._.canvas.width/(this._.context.pixelRatio??window.devicePixelRatio)}},b.cellTextOverflows={},b.focusedTable=!1,b.theme=Ne.of(t.theme??Ne.DEFAULT),l?(l.innerHTML="",l.appendChild(b.element),this._updateSize()):this._updateSize(),this._cellToBeInvalidatedNextFrame=new Set,this._willNextFrameInvalidate=!1,this.options=t,b.theme=Ne.of(t.theme??Ne.DEFAULT),b.bodyHelper=new PA(this),b.headerHelper=new JA(this),b.autoWrapText=t.autoWrapText,b.allowFrozenColCount=t.allowFrozenColCount??b.colCount,b.limitMaxAutoWidth=t.limitMaxAutoWidth??450,this.scenegraph=new oA(this),this.stateManeger=new bA(this),this.eventManeger=new AA(this),b.tooltip=Object.assign({renderMode:"html",isShowOverflowTextTooltip:!1,confine:!0},t.tooltip),"html"===b.tooltip.renderMode&&(b.tooltipHandler=new lR(this,b.tooltip.confine)),b.menu=Object.assign({renderMode:"html"},t.menu),Array.isArray(t.menu?.dropDownMenuHighlight)&&this.setDropDownMenuHighlight(t.menu?.dropDownMenuHighlight),Array.isArray(t.menu?.defaultHeaderMenuItems)&&(this.globalDropDownMenu=t.menu.defaultHeaderMenuItems),"html"===b.menu.renderMode&&(b.menuHandler=new yR(this)),this.headerStyleCache=new Map,this.bodyStyleCache=new Map}throttleInvalidate=function(t,e){let n=null;return function(...i){n||(n=setTimeout((()=>{t.apply(this,i),n=null}),e))}}(this.invalidate.bind(this),200);getParentElement(){return this.options.parentElement}getElement(){return this.internalProps.element}get canvas(){return this.internalProps.canvas}resize(){this._updateSize(),this.scenegraph.resize()}get rowCount(){return this.internalProps.rowCount}set rowCount(t){this.internalProps.rowCount=t}get colCount(){return this.internalProps.colCount??0}set colCount(t){this.internalProps.colCount=t}get frozenColCount(){return this.internalProps.frozenColCount??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.stateManeger.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.stateManeger.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(){return this.internalProps.frozenRowCount??0}set frozenRowCount(t){this.internalProps.frozenRowCount=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(){return this.internalProps.keyboardOptions??null}set keyboardOptions(t){this.internalProps.keyboardOptions=t??void 0}get widthMode(){return this._widthMode}set widthMode(t){t!==this._widthMode&&(this._widthMode=t)}_colWidthDefineToPxWidth(t){return X_(t)?V_(this,this._calculateAutoColWidthExpr()):V_(this,t)}_calculateAutoColWidthExpr(){const t=this.internalProps.calcWidthContext.full;let e=0;const n=[];let i=0;const r=[];for(let o=0;o<this.internalProps.colCount;o++){const a=this.getColWidthDefine(o),s=this._getColWidthLimits(o);if(X_(a))s&&(r.push(s),s.min&&(e+=s.min)),i++;else{let t=a;if(s){const n=V_(this,t),i=Y_(s,n);n!==i&&(t=`${i}px`),e+=i}n.push(t)}if(e>t)return"0px"}if(r.length&&n.length){const e=(t-V_(this,`calc(${n.map((t=>"number"==typeof t?`${t}px`:t)).join(" + ")})`))/i;if(r.forEach((t=>{t.min&&e<t.min?(n.push(t.minDef),i--):t.max&&t.max<e&&(n.push(t.maxDef),i--)})),i<=0)return`${e}px`}if(n.length){const t=[];let e=0;return n.forEach((n=>{"number"==typeof n?e+=n:t.push(n)})),t.push(`${e}px`),`calc((100% - (${t.join(" + ")})) / ${i})`}return 100/i+"%"}_getColWidthLimits(t){const e=this.colWidthsLimit[t];if(!e)return null;const n={};return e.min&&(n.min=V_(this,e.min),n.minDef=e.min),e.max&&(n.max=V_(this,e.max),n.maxDef=e.max),n}_adjustColWidth(t,e){const n=this._getColWidthLimits(t);return Math.max(Y_(n,e),0)}setPixelRatio(t){this.internalProps.pixelRatio=t,this.scenegraph.setPixelRatio(t)}_updateSize(){const{padding:t}=this;let e=0,n=0;if("browser"===bt.mode){const i=this.getElement(),r=i.parentElement?.offsetWidth??0,o=i.parentElement?.offsetHeight??0;i.style.width=r&&r-t.left-t.right+"px"||"0px",i.style.height=o&&o-t.top-t.bottom+"px"||"0px";const{canvas:a}=this.internalProps;e=a.parentElement?.offsetWidth??0,n=a.parentElement?.offsetHeight??0,this?.scenegraph?.stage?this.scenegraph.stage.window.resize(e,n):(a.style.width="",a.style.height="",a.width=e,a.height=n,a.style.width=`${e}px`,a.style.height=`${n}px`)}else"node"===bt.mode&&(e=this.canvasWidth-1,n=this.canvasHeight-1);const i=Math.floor(e-K(this.getTheme().scrollStyle)),r=Math.floor(n-K(this.getTheme().scrollStyle));if(this.internalProps.theme?.frameStyle){const t=wR(this.internalProps.theme.frameStyle?.borderLineWidth??[null]),e=wR(this.internalProps.theme.frameStyle?.shadowBlur??[0]);this.tableX=(t[3]??0)+(e[3]??0),this.tableY=(t[0]??0)+(e[0]??0),this.tableNoFrameWidth=i-((t[1]??0)+(e[1]??0))-((t[3]??0)+(e[3]??0)),this.tableNoFrameHeight=r-((t[0]??0)+(e[0]??0))-((t[2]??0)+(e[2]??0))}}get rowHierarchyType(){return"grid"}setColWidths(t){t.forEach(((t,e)=>this.setColWidth(e,t)))}getColsWidth(t,e){e=Math.min(e,this.colCount-1);const n=this._colRangeWidthsMap.get(`$${t}$${e}`);if(null!=n)return n;const i=this._colRangeWidthsMap.get(`$${t}$${e-1}`);if(null!=i){const n=this.colWidthsMap.get(e);let r;r=n?"adaptive"===this.widthMode||this.transpose?Number(n):this._adjustColWidth(e,this._colWidthDefineToPxWidth(n)):0;const o=i+r;return t>=0&&e>=0&&!Number.isNaN(o)&&this._colRangeWidthsMap.set(`$${t}$${e}`,Math.round(o)),Math.round(o)}let r=0;for(let n=t;n<=e;n++)r+=this.isRowHeader(n,0)||this.isCornerHeader(n,0)?Array.isArray(this.defaultHeaderColWidth)?this.defaultHeaderColWidth[n]??this.internalProps.defaultColWidth:this.defaultHeaderColWidth:this.internalProps.defaultColWidth;this.colWidthsMap.each(t,e,((t,e)=>{r+=("adaptive"===this.widthMode||this.transpose?Number(t):this._adjustColWidth(e,this._colWidthDefineToPxWidth(t)))-(this.isRowHeader(e,0)||this.isCornerHeader(e,0)?Array.isArray(this.defaultHeaderColWidth)?this.defaultHeaderColWidth[e]??this.internalProps.defaultColWidth:this.defaultHeaderColWidth:this.internalProps.defaultColWidth)}));for(let n=t;n<=e;n++){if(this.colWidthsMap.has(n))continue;const t=this._adjustColWidth(n,this.internalProps.defaultColWidth);t!==this.internalProps.defaultColWidth&&(r+=t-this.internalProps.defaultColWidth)}return t>=0&&e>=0&&this._colRangeWidthsMap.set(`$${t}$${e}`,Math.round(r)),Math.round(r)}getRowHeight(t){return this.rowHeightsMap.get(t)||(this.isColumnHeader(0,t)||this.isCornerHeader(0,t)?Array.isArray(this.defaultHeaderRowHeight)?this.defaultHeaderRowHeight[t]??this.internalProps.defaultRowHeight:this.defaultHeaderRowHeight:this.internalProps.defaultRowHeight)}setRowHeight(t,e,n){this.rowHeightsMap.put(t,Math.round(e)),n&&this._clearRowRangeHeightsMap(t)}fillRowsHeight(t,e,n){for(let i=t;i<=e;i++)this.rowHeightsMap.put(i,Math.round(n)),this._rowRangeHeightsMap.set(`$0$${i}`,Math.round((this._rowRangeHeightsMap.get("$0$"+(i-1))??0)+n))}getRowsHeight(t,e){const n=this._rowRangeHeightsMap.get(`$${t}$${e}`);if(null!=n)return n;const i=this._rowRangeHeightsMap.get(`$${t}$${e-1}`);if(null!=i){const n=Math.round(i+(this.rowHeightsMap.get(e)??(this.isColumnHeader(0,e)||this.isCornerHeader(0,e)?Array.isArray(this.defaultHeaderRowHeight)?this.defaultHeaderRowHeight[e]??this.internalProps.defaultRowHeight:this.defaultHeaderRowHeight:this.internalProps.defaultRowHeight)));return t>=0&&e>=0&&this._rowRangeHeightsMap.set(`$${t}$${e}`,Math.round(n)),n}let r=0;for(let n=t;n<=e;n++)r+=this.rowHeightsMap.get(n)||(this.isColumnHeader(0,n)||this.isCornerHeader(0,n)?Array.isArray(this.defaultHeaderRowHeight)?this.defaultHeaderRowHeight[n]??this.internalProps.defaultRowHeight:this.defaultHeaderRowHeight:this.internalProps.defaultRowHeight);return t>=0&&e>=0&&r>0&&this._rowRangeHeightsMap.set(`$${t}$${e}`,Math.round(r)),Math.round(r)}getColWidthDefine(t){const e=this.colWidthsMap.get(t);return"number"==typeof e&&e<=0?0:e||(this.isRowHeader(t,0)||this.isCornerHeader(t,0)?Array.isArray(this.defaultHeaderColWidth)?this.defaultHeaderColWidth[t]??this.defaultColWidth:this.defaultHeaderColWidth:this.defaultColWidth)}getColWidth(t){const e=this.getColWidthDefine(t);return"adaptive"===this.widthMode&&"number"==typeof e||this.transpose&&"number"==typeof e?this._colWidthDefineToPxWidth(e):this._adjustColWidth(t,this._colWidthDefineToPxWidth(e))}setColWidth(t,e,n,i){this.colWidthsMap.put(t,"number"==typeof e?Math.round(e):e),n&&this._clearColRangeWidthsMap(t),i||this.stateManeger.checkFrozen()}_clearColRangeWidthsMap(t){if("number"!=typeof t)this._colRangeWidthsMap.clear();else{const e=this._colRangeWidthsMap.keys();for(const n of e){const e=xR.exec(n);if(e){const i=Number(e[1]),r=Number(e[2]);t>=i&&t<=r&&this._colRangeWidthsMap.delete(n)}}}}_clearRowRangeHeightsMap(t){const e=this._rowRangeHeightsMap.keys();for(const n of e){const e=xR.exec(n);if(e){const i=Number(e[1]),r=Number(e[2]);t>=i&&t<=r&&this._rowRangeHeightsMap.delete(n)}}}_getColContentWidth(t){return Number(this.colContentWidthsMap.get(t))}_setColContentWidth(t,e){this.colContentWidthsMap.put(t,e)}getAllRowsHeight(){if(this.internalProps.rowCount<=0)return 0;return this.getRowsHeight(0,this.internalProps.rowCount-1)}getAllColsWidth(){if(this.internalProps.colCount<=0)return 0;return this.getColsWidth(0,this.internalProps.colCount-1)}getMaxColWidth(t){const e=this.colWidthsLimit[t];let n=(e&&e.max)??1/0;return"string"==typeof n&&(n=V_(this,n)),n}setMaxColWidth(t,e){(this.colWidthsLimit[t]||(this.colWidthsLimit[t]={})).max=e}getMinColWidth(t){const e=this.colWidthsLimit[t];let n=(e&&e.min)??0;return"string"==typeof n&&(n=V_(this,n)),n}setMinColWidth(t,e){(this.colWidthsLimit[t]||(this.colWidthsLimit[t]={})).min=e}getCellRect(t,e){const n=this.isFrozenCell(t,e);let i=this.getColsWidth(0,t-1)||0;const r=this.getColWidth(t);n&&n.col&&(i+=this.scrollLeft);let o=this.getRowsHeight(0,e-1);const a=this.getRowHeight(e);return n&&n.row&&(o+=this.scrollTop),new me(Math.round(i),Math.round(o),Math.round(r),Math.round(a))}getMergeCellRect(t,e){const n=this.getCellRange(t,e),i=this.getColsWidth(0,n.start.col-1)||0,r=this.getColsWidth(n.start.col,n.end.col),o=this.getRowsHeight(0,n.start.row-1)||0,a=this.getRowsHeight(n.start.row,n.end.row);return new me(Math.round(i),Math.round(o),Math.round(r),Math.round(a))}getCellRelativeRect(t,e){return this._toRelativeRect(this.getCellRect(t,e))}getCellRangeRelativeRect(t){if(t.start)return this._toRelativeRect(this.getCellsRect(t.start.col,t.start.row,t.end.col,t.end.row));const e=this.getCellRange(t.col,t.row);return this._toRelativeRect(this.getCellsRect(e.start.col,e.start.row,e.end.col,e.end.row))}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 n=e.start.col>=this.frozenColCount?Math.max(t.left,this.frozenColCount>=1?this.getColsWidth(0,this.frozenColCount-1):0):t.left,i=Math.min(t.right,this.tableNoFrameWidth),r=t.copy();r.left=n,r.right=i;const o=e.start.row>=this.frozenRowCount?Math.max(t.top,this.frozenRowCount>=1?this.getRowsHeight(0,this.frozenRowCount-1):0):t.top,a=Math.min(t.bottom,this.tableNoFrameHeight);return r.top=o,r.bottom=a,r}getCellsRect(t,e,n,i){const r=this.isFrozenCell(t,e),o=this.isFrozenCell(n,i);let a=this.getColsWidth(0,t-1)||0,s=this.getColsWidth(t,n);if(r&&r.col){const e=this.scrollLeft;a+=e,o&&o.col||(s-=e,s=Math.max(s,this.getColsWidth(t,this.frozenColCount-1)))}let l=this.getRowsHeight(0,e-1),h=this.getRowsHeight(e,i);if(r&&r.row){const t=this.scrollTop;l+=t,o&&o.row||(h-=t,h=Math.max(h,this.getRowsHeight(e,this.frozenRowCount-1)))}return new me(Math.round(a),Math.round(l),Math.round(s),Math.round(h))}getCellsRectWidth(t,e,n,i){const r=this.isFrozenCell(t,e),o=this.isFrozenCell(n,i);let a=this.getColsWidth(t,n);if(r&&r.col){const e=this.scrollLeft;o&&o.col||(a-=e,a=Math.max(a,this.getColsWidth(t,this.frozenColCount-1)))}return a}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{frozenRowCount:n,frozenColCount:i}=this.internalProps,r=n>0&&e<n,o=i>0&&t<i;return r||o?{row:r,col:o}:null}getRowAt(t){const e=function(t,e){if(!t.internalProps.frozenRowCount)return null;let{scrollTop:n}=t;const i=t.internalProps.frozenRowCount;for(let r=0;r<i;r++){const i=t.getRowHeight(r),o=n+i;if(o>e)return{top:n,row:r,bottom:o,height:i};n=o}return null}(this,t);if(e)return e;let n=this.getTargetRowAt(t);return n||(n={top:-1,row:-1,bottom:-1,height:-1}),n}getColAt(t){const e=function(t,e){if(!t.internalProps.frozenColCount)return null;let{scrollLeft:n}=t;const i=t.internalProps.frozenColCount;for(let r=0;r<i;r++){const i=t.getColWidth(r),o=n+i;if(o>e)return{left:n,col:r,right:o,width:i};n=o}return null}(this,t);if(e)return e;let n=this.getTargetColAt(t);return n||(n={left:-1,col:-1,right:-1,width:1}),n}getCellAt(t,e){const n=this.getRowAt(e),{row:i,top:r,bottom:o,height:a}=n,s=this.getColAt(t),{col:l,left:h,right:u,width:c}=s;return{row:i,col:l,rect:{left:h,right:u,top:r,bottom:o,width:c,height:a}}}_checkRowCol(t,e){return t>=0&&t<this.colCount&&e>=0&&e<this.rowCount}_makeVisibleCell(t,e){if(this._checkRowCol(t,e)){const n=this.isFrozenCell(t,e);if(n&&n.col&&n.row)return;const i=this.getCellRect(t,e),r=function(t){let e=0;t.internalProps.frozenColCount>0&&(e=t.getFrozenColsWidth());let n=0;return t.internalProps.frozenRowCount>0&&(n=t.getFrozenRowsHeight()),new me(t.scrollLeft+e,t.scrollTop+n,t.tableNoFrameWidth-e,t.tableNoFrameHeight-n)}(this);if(r.contains(i))return;n&&n.col||this.getColsWidth(0,this.frozenColCount-1)+i.width>this.canvas.width||(i.left<r.left?this.scrollLeft-=r.left-i.left:r.right<i.right&&(this.scrollLeft-=r.right-i.right)),n&&n.row||this.getRowsHeight(0,this.frozenRowCount-1)+i.height>this.canvas.height||(i.top<r.top?this.scrollTop-=r.top-i.top:r.bottom<i.bottom&&(this.scrollTop-=r.bottom-i.bottom))}}invalidate(){this.scenegraph.renderSceneGraph()}_toRelativeRect(t){const e=t.copy(),n=this.getVisibleRect();return e.offsetLeft(-n.left),e.offsetTop(-n.top),e}getVisibleRect(){const{scrollTop:t,scrollLeft:e}=this,n=this.tableNoFrameWidth,i=this.tableNoFrameHeight;return new me(e,t,n,i)}get visibleRowCount(){const{frozenRowCount:t}=this,e=this.getVisibleRect(),n=t>0?e.top+this.getRowsHeight(0,t-1):e.top,i=this.getTargetRowAt(n);if(!i)return 0;const r=Math.max(i.top>=n?i.row:i.row+1,t);let o=this.getRowsHeight(0,r-1),a=0;const{rowCount:s}=this;for(let t=r;t<s;t++){const n=o+this.getRowHeight(t);if(e.bottom<n)break;a++,o=n}return a}get visibleColCount(){const{frozenColCount:t}=this,e=this.getVisibleRect(),n=t>0?e.left+this.getColsWidth(0,t-1):e.left,i=this.getTargetColAt(n);if(!i)return 0;const r=Math.max(i.left>=n?i.col:i.col+1,t);let o=this.getColsWidth(0,r-1),a=0;const{colCount:s}=this;for(let t=r;t<s;t++){const n=o+this.getColWidth(t);if(e.right<n)break;a++,o=n}return a}get scrollTop(){return this.stateManeger.scroll.verticalBarPos}set scrollTop(t){this.stateManeger.setScrollTop(t)}get scrollLeft(){return this.stateManeger.scroll.horizontalBarPos}set scrollLeft(t){this.stateManeger.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)}addDisposable(t){if(!t||!t.dispose||"function"!=typeof t.dispose)throw new Error("not disposable!");(this.internalProps.disposables=this.internalProps.disposables||[]).push(t)}dispose(){const t=this.internalProps;t.tooltipHandler?.dispose?.(),t.menuHandler?.dispose?.(),rS.clearAll(),super.dispose?.(),t.handler?.dispose?.(),t.focusControl?.dispose?.(),t.disposables&&(t.disposables.forEach((t=>t?.dispose?.())),t.disposables=null),this.scenegraph.stage.release();const{parentElement:e}=t.element;e&&e.removeChild(t.element)}fireListeners(t,...e){return super.fireListeners(t,...e)}updateOption(t){this.options=t;const{frozenColCount:e=0,defaultRowHeight:n=40,defaultHeaderRowHeight:i,defaultColWidth:r=80,defaultHeaderColWidth:o=80,keyboardOptions:a,columnResizeMode:s,dragHeaderMode:l,showFrozenIcon:h,allowFrozenColCount:u,padding:c,hover:d,menu:f,select:p,pixelRatio:g,widthMode:v}=t;g&&g!==this.internalProps.pixelRatio&&(this.internalProps.pixelRatio=g),c&&("number"==typeof c?(this.padding.top=c,this.padding.left=c,this.padding.bottom=c,this.padding.right=c):(c.top&&(this.padding.top=c.top),c.bottom&&(this.padding.bottom=c.bottom),c.left&&(this.padding.left=c.left),c.right&&(this.padding.right=c.right))),this.showFrozenIcon="boolean"!=typeof h||h,"number"==typeof u&&u<=0&&(this.showFrozenIcon=!1),this.widthMode=v??"standard";const y=this.internalProps;"node"!==bt.mode&&function(t,e){t.style.margin=`${e.top}px ${e.right}px ${e.bottom}px ${e.left}px`;const n=(t.offsetWidth||t.parentElement?.offsetWidth||1)-1,i=(t.offsetHeight||t.parentElement?.offsetHeight||1)-1;t.style.width=n&&n-e.left-e.right+"px"||"0px",t.style.height=i&&i-e.top-e.bottom+"px"||"0px"}(y.element,this.padding),y.frozenColCount=e,y.defaultRowHeight=n,y.defaultHeaderRowHeight=i??n,y.defaultColWidth=r,y.defaultHeaderColWidth=o??r,y.keyboardOptions=a,y.columnResizeMode=s,y.dragHeaderMode=l,y.cellTextOverflows={},y.theme=Ne.of(t.theme??Ne.DEFAULT),y.autoRowHeight=t.autoRowHeight??!1,y.autoWrapText=t.autoWrapText,y.allowFrozenColCount=t.allowFrozenColCount??y.colCount,y.limitMaxAutoWidth=t.limitMaxAutoWidth??450,y.tooltip=Object.assign({renderMode:"html",isShowOverflowTextTooltip:!1,confine:!0},t.tooltip),"html"!==y.tooltip.renderMode||y.tooltipHandler||(y.tooltipHandler=new lR(this,y.tooltip.confine)),y.menu=Object.assign({renderMode:"html"},t.menu),"html"!==y.menu.renderMode||y.menuHandler||(y.menuHandler=new yR(this))}getFrozenRowsHeight(){return this.getRowsHeight(0,this.frozenRowCount-1)}getFrozenColsWidth(){return this.getColsWidth(0,this.frozenColCount-1)}getDrawRange(){const t=Math.min(this.tableNoFrameWidth,this.getAllColsWidth()),e=Math.min(this.tableNoFrameHeight,this.getAllRowsHeight());return new me(this.tableX,this.tableY,t,e)}_getMouseAbstractPoint(t,e=!0){const n=this;let i;if(!t)return null;i=CR(t)?t.changedTouches[0]:t;const r=i.clientX||i.pageX+window.scrollX,o=i.clientY||i.pageY+window.scrollY,a=n.internalProps.canvas.getBoundingClientRect();if(a.right<=r)return null;if(a.bottom<=o)return null;const s=a.width,l=s/(this.canvas.offsetWidth||s),h=a.height,u=h/(this.canvas.offsetHeight||h);return{x:(r-a.left)/l+(e?n.scrollLeft:0)-n.tableX,y:(o-a.top)/u+(e?n.scrollTop:0)-n.tableY}}_getCellEventArgsSet(t){const e=this._getMouseAbstractPoint(t);if(!e)return{};const n=this.getCellAt(e.x,e.y);if(n.col<0||n.row<0)return{abstractPos:e,cell:n};return{abstractPos:e,cell:n,eventArgs:{col:n.col,row:n.row,event:t,rect:n.rect}}}getTheme(){return this.internalProps.theme}getTargetColAt(t){if(0===t)return{left:0,col:0,right:0,width:0};const e=(e,n)=>{let i=n-this.getColWidth(e);const{colCount:r}=this.internalProps;for(let n=e;n<r;n++){const e=this.getColWidth(n),r=i+e;if(Math.round(i)<=Math.round(t)&&Math.round(t)<Math.round(r))return{left:i,col:n,right:r,width:e};i=r}return null},n=this.computeTargetColByX(t),i=this.getColsWidth(0,n);return t>=i?e(n,i):((e,n)=>{let i=n;for(let n=e;n>=0;n--){const e=this.getColWidth(n),r=i-e;if(Math.round(r)<=Math.round(t)&&Math.round(t)<Math.round(i))return{left:r,col:n,right:i,width:e};i=r}return null})(n,i)}getTargetRowAt(t){if(0===t)return{top:0,row:0,bottom:0,height:0};const e=(e,n)=>{let i=n-this.getRowHeight(e);const{rowCount:r}=this.internalProps;for(let n=e;n<r;n++){const e=this.getRowHeight(n),r=i+e;if(Math.round(i)<=Math.round(t)&&Math.round(t)<Math.round(r))return{top:i,row:n,bottom:r,height:e};i=r}return null},n=this.computeTargetRowByY(t),i=this.getRowsHeight(0,n);return t>=i?e(n,i):((e,n)=>{let i=n;for(let n=e;n>=0;n--){const e=this.getRowHeight(n),r=i-e;if(Math.round(r)<=Math.round(t)&&Math.round(t)<Math.round(i))return{top:r,row:n,bottom:i,height:e};i=r}return null})(n,i)}computeTargetRowByY(t){if(this._rowRangeHeightsMap.get("$0$"+(this.rowCount-1))){let e=0,n=this.rowCount-1;for(;n-e>1;){const i=Math.floor((e+n)/2);if(t<this._rowRangeHeightsMap.get(`$0$${i}`))n=i;else{if(!(t>this._rowRangeHeightsMap.get(`$0$${i}`)))return i;e=i}}return n}return Math.min(Math.ceil(t/this.internalProps.defaultRowHeight),this.rowCount-1)}computeTargetColByX(t){if(this._colRangeWidthsMap.get("$0$"+(this.colCount-1))){let e=0,n=this.colCount-1;for(;n-e>1;){const i=Math.floor((e+n)/2);if(t<this._colRangeWidthsMap.get(`$0$${i}`))n=i;else{if(!(t>this._colRangeWidthsMap.get(`$0$${i}`)))return i;e=i}}return n}return Math.min(Math.ceil(t/this.internalProps.defaultColWidth),this.colCount-1)}clearSelected(){this.stateManeger.updateSelectPos(-1,-1)}selectCell(t,e){this.stateManeger.updateSelectPos(t,e),this.stateManeger.endSelectCells()}updatePager(t){this.pagerConf&&("number"==typeof t.currentPage&&t.currentPage>=0&&(this.pagerConf.currentPage=t.currentPage),t.perPageCount&&(this.pagerConf.perPageCount=t.perPageCount||this.pagerConf.perPageCount),this.scenegraph.clearCells(),this.dataSource.updatePager(this.pagerConf),this.refreshRowColCount(),this.scenegraph.createSceneGraph(),this.invalidate())}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||null}get dataSource(){return this.internalProps.dataSource}set dataSource(t){this.scenegraph.clearCells(),K_(this,t),this.refreshRowColCount(),this.scenegraph.createSceneGraph(),this.invalidate()}get autoWrapText(){return this.internalProps.autoWrapText}set autoWrapText(t){this.internalProps.autoWrapText!==t&&(this.internalProps.autoWrapText=t,this.options.autoWrapText=t,this.internalProps.layoutMap&&(this.refreshHeader(),this.invalidate()))}get theme(){return this.internalProps.theme}set theme(t){const e=Ne.of(t);this.internalProps.theme=e||Ne.DEFAULT,this.options.theme=t,this.resize()}getBodyField(t,e){return this.internalProps.layoutMap.getBody(t,e).field}getBodyColumnDefine(t,e){const n=this.internalProps.layoutMap.getBody(t,e);return n?.define}getBodyColumnType(t,e){return this.internalProps.layoutMap.getBody(t,e).columnType}getHeaderField(t,e){return this.internalProps.layoutMap.getHeaderField(t,e)}getHeaderFieldKey(t,e){return this.internalProps.layoutMap.getHeaderFieldKey(t,e)}getHeaderDefine(t,e){const n=this.internalProps.layoutMap.getHeader(t,e);return n?.define}getCellType(t,e){return this.internalProps.layoutMap.getCellType(t,e)}getCellHeaderPaths(t,e){return this.internalProps.layoutMap.getCellHeaderPaths(t,e)}getHeadersDefine(t,e){const n=[];for(;;){const i=this.getHeaderDefine(t,e);if(!i||!i.field&&!i.columns)break;n.push(i),e++}return n}_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}getRecordByRowCol(t,e){if(!this.internalProps.layoutMap.isHeader(t,e))return this.internalProps.dataSource?.get(this.getRecordIndexByRow(t,e))}getRecordStartRowByRecordIndex(t){return this.internalProps.layoutMap.getRecordStartRowByRecordIndex(t)}_getHeaderCellBySortState(t){const{layoutMap:e}=this.internalProps;let n;if(n=t.fieldKey?e.headerObjects.find((e=>e&&e.fieldKey===t.fieldKey)):e.headerObjects.find((e=>e&&e.field===t.field)),n){return e.getHeaderCellAdress(n.id)}}getCellRange(t,e){return this.internalProps.layoutMap.getCellRange(t,e)}isCellRangeEqual(t,e,n,i){return this.internalProps.layoutMap.isCellRangeEqual(t,e,n,i)}_getLayoutCellId(t,e){return this.internalProps.layoutMap.getCellId(t,e)}getHeaderDescription(t,e){const n=this._getHeaderLayoutMap(t,e),i=n?.define,r=i?.description??n?.description;if("function"==typeof r){return r({col:t,row:e,value:this.getCellValue(t,e),dataValue:this.getCellOriginValue(t,e)})}return r}setRecords(t,e){const n="undefined"!=typeof window?window.performance.now():0;if(this.scenegraph.clearCells(),void 0!==e&&(this.sortState=e,this.stateManeger.setSortState(this.sortState)),t){if(U_(this,t),this.sortState){let t,e,n;if(Array.isArray(this.sortState)?0!==this.sortState.length&&({order:t,field:e,fieldKey:n}=this.sortState?.[0]):({order:t,field:e,fieldKey:n}=this.sortState),t&&e&&"normal"!==t){const i=this.getSortFuncFromHeaderOption(void 0,e,n);let r;r=n?this.internalProps.layoutMap.headerObjects.find((t=>t&&t.fieldKey===n)):this.internalProps.layoutMap.headerObjects.find((t=>t&&t.field===e)),r?.define?.sort&&this.dataSource.sort(r.field,t,i??B)}}this.refreshRowColCount()}else U_(this,t);this.scenegraph.createSceneGraph(),this.invalidate(),console.log("setRecords cost time:",("undefined"!=typeof window?window.performance.now():0)-n)}setRecord(t,e,n){const i=this.getRecordIndexByRow(e,n);this.dataSource.setRecord(t,i)}setDropDownMenuHighlight(t){this.stateManeger.setDropDownMenuHighlight(t)}_dropDownMenuIsHighlight(t,e,n){return this.stateManeger.dropDownMenuIsHighlight(t,e,n)}isHeader(t,e){return this.internalProps.layoutMap&&this.internalProps.layoutMap.isHeader(t,e)}isColumnHeader(t,e){return this.internalProps.layoutMap?.isColumnHeader(t,e)}isRowHeader(t,e){return this.internalProps.layoutMap?.isRowHeader(t,e)}isCornerHeader(t,e){return this.internalProps.layoutMap?.isCornerHeader(t,e)}getCellInfo(t,e){const n=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),caption:n.caption,columnType:n.columnType?"string"==typeof n.columnType?n.columnType:"progressbar":"text",originData:this.getCellOriginRecord(t,e),cellRange:this.getCellRangeRelativeRect({col:t,row:e}),value:this.getCellValue(t,e),dataValue:this.getCellOriginValue(t,e),cellType:this.getCellType(t,e),scaleRatio:this.canvas.getBoundingClientRect().width/this.canvas.offsetWidth}}_hasField(t,e,n){if(null==t)return!1;const i=this;if(i.internalProps.layoutMap.isHeader(e,n))return!1;const r=i.getRecordIndexByRow(e,n);return i.internalProps.dataSource.hasField(r,t)}_getCellStyle(t,e){const{layoutMap:n}=this.internalProps;if(n.isHeader(t,e)){let i=this.headerStyleCache.get(`${t}-${e}`);if(i)return i;const r=n.getHeader(t,e),o=this.internalProps.headerHelper.getStyleClass(r.headerType),{style:a}=r;return i=U(a,n.isColumnHeader(t,e)?this.theme.headerStyle:n.isRowHeader(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)},o,this.options.autoWrapText),this.headerStyleCache.set(`${t}-${e}`,i),i}let i;i=this.isListTable()&&!this.transpose||this.isPivotTable()&&this.internalProps.layoutMap.indicatorsAsCol?t:e;let r=this.bodyStyleCache.get(i);if(r)return r;const o=n.getBody(t,e),a=this.internalProps.bodyHelper.getStyleClass(o.columnType),s=o?.style;return r=F(s,this.theme.bodyStyle,{col:t,row:e,table:this,value:this.getCellValue(t,e),dataValue:this.getCellOriginValue(t,e),cellHeaderPaths:this.getCellHeaderPaths(t,e)},a,this.options.autoWrapText),this.bodyStyleCache.set(i,r),r}clearCellStyleCache(){this.headerStyleCache.clear()}_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 n=this.colWidthsLimit[t];return!(n&&n.min&&n.max)||n.max!==n.min}_canDragHeaderPosition(t,e){if(this.isHeader(t,e)&&this.stateManeger.isSelected(t,e)){const n=this.stateManeger.select.ranges[0];if(this.isColumnHeader(t,e)){if(n.end.row!==this.rowCount-1)return!1}else{if(!this.isRowHeader(t,e))return!1;if(n.end.col!==this.colCount-1)return!1}const i=this.getHeaderDefine(t,e);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){let n;if(this.isHeader(t,e))n=this.internalProps.headerHelper.getIcons(t,e);else{const i=this.getCellValue(t,e),r=this.getCellOriginValue(t,e),o=this.internalProps.context;n=this.internalProps.bodyHelper.getIcons(t,e,i,r,o)}return n}showDropDownMenu(t,e,n){let i="dropdown-menu";n&&(i=Array.isArray(n.content)?"dropdown-menu":"container"),"html"===this.internalProps.menu.renderMode&&(this.stateManeger.menu.isShow=!0,this.internalProps.menuHandler._bindToCell(t,e,i,n))}showTooltip(t,e,n){"html"===this.internalProps.tooltip.renderMode&&this.internalProps.tooltipHandler._bindToCell(t,e,n)}getCellStyle(t,e){const n=this._getCellStyle(t,e),i=$_(n,this,t,e,Bx).theme,{autoWrapText:r,lineClamp:o,textOverflow:a}=n;return{textAlign:i.text.textAlign,textBaseline:i.text.textBaseline,bgColor:Mt(i.group.fill)?Bx("bgColor",n,t,e,this):i.group.fill,color:Mt(i.text.fill)?Bx("color",n,t,e,this):i.text.fill,fontFamily:i.text.fontFamily,fontSize:i.text.fontSize,fontWeight:i.text.fontWeight,fontVariant:i.text.fontVariant,fontStyle:i.text.fontStyle,lineHeight:i.text.lineHeight,autoWrapText:r??!1,lineClamp:o??"auto",textOverflow:a,borderColor:Mt(i.group.stroke)?Bx("borderColor",n,t,e,this):i.group.stroke,borderLineWidth:i.group.lineWidth,borderLineDash:i.group.lineDash,underline:!!i.text.underline,lineThrough:!!i.text.lineThrough,padding:i._vtable.padding,underlineWidth:i.text.underline,lineThroughLineWidth:i.text.lineThrough}}getAllBodyCells(t,e){const n=this.rowHeaderLevelCount,i=this.columnHeaderLevelCount,r=this.colCount-1,o=this.rowCount-1;return Array(Math.min(e??2e3,o-i+1,this.rowCount)).fill(0).map(((e,o)=>Array(Math.min(t??2e3,r-n+1,this.colCount)).fill(0).map(((t,e)=>this.getCellInfo(e+n,o+i)))))}getAllCells(t,e){const n=0,i=0,r=this.colCount-1,o=this.rowCount-1;return Array(Math.min(e??2e3,o-i+1,this.rowCount)).fill(0).map(((e,o)=>Array(Math.min(t??2e3,r-n+1,this.colCount)).fill(0).map(((t,e)=>this.getCellInfo(e+n,o+i)))))}getAllColumnHeaderCells(){const t=this.rowHeaderLevelCount,e=0,n=this.colCount-1,i=this.columnHeaderLevelCount-1;return Array(i-e+1).fill(0).map(((i,r)=>Array(n-t+1).fill(0).map(((n,i)=>this.getCellInfo(i+t,r+e)))))}getAllRowHeaderCells(){const t=0,e=this.columnHeaderLevelCount,n=this.rowHeaderLevelCount-1,i=this.rowCount-1;return Array(i-e+1).fill(0).map(((i,r)=>Array(n-t+1).fill(0).map(((n,i)=>this.getCellInfo(i+t,r+e)))))}scrollToCell(t){const e=this.getDrawRange();if(k(t.col)&&t.col>=this.frozenColCount){const n=this.getFrozenColsWidth(),i=this.getColsWidth(0,t.col-1);this.scrollLeft=Math.min(i-n,this.getAllColsWidth()-e.width)}if(k(t.row)&&t.row>=this.frozenRowCount){const n=this.getFrozenRowsHeight(),i=this.getRowsHeight(0,t.row-1);this.scrollTop=Math.min(i-n,this.getAllRowsHeight()-e.height)}this.invalidate()}getCopyValue(){const t=this.stateManeger.select.ranges;let e=Math.min(t[0].start.col,t[0].end.col),n=Math.max(t[0].start.col,t[0].end.col),i=Math.min(t[0].start.row,t[0].end.row),r=Math.max(t[0].start.row,t[0].end.row);t.forEach((t=>{e=Math.min(e,t.start.col,t.end.col),n=Math.max(n,t.start.col,t.end.col),i=Math.min(i,t.start.row,t.end.row),r=Math.max(r,t.start.row,t.end.row)}));const o=e=>{let n=!1;return t.forEach((t=>{const i=Math.min(t.start.row,t.end.row),r=Math.max(t.start.row,t.end.row);i<=e&&r>=e&&(n=!0)})),n},a=e=>{let n=!1;return t.forEach((t=>{const i=Math.min(t.start.col,t.end.col),r=Math.max(t.start.col,t.end.col);i<=e&&r>=e&&(n=!0)})),n},s=(e,n)=>{let i;return t.forEach((t=>{const r=Math.min(t.start.row,t.end.row),o=Math.max(t.start.row,t.end.row),a=Math.min(t.start.col,t.end.col),s=Math.max(t.start.col,t.end.col);a<=e&&s>=e&&r<=n&&o>=n&&(i=t)})),i},l=(t,e,n)=>{const i=this.getCellRange(t,e);let r=i.start.col,o=i.start.row;if(n){const t=Math.min(n.start.col,n.end.col),e=Math.min(n.start.row,n.end.row);r=Math.max(t,i.start.col),o=Math.max(e,i.start.row)}if(r!==t||o!==e)return"";return this.getCellValue(t,e)};let h="";for(let t=i;t<=r;t++){if(o(t)){for(let i=e;i<=n;i++){if(a(i)){const e=s(i,t);if(e){const r=l(i,t,e);if("undefined"!=typeof Promise&&r instanceof Promise);else{const t=`${r}`;/^\[object .*\]$/.exec(t)||(h+=t)}(i<e.end.col||i<n)&&(h+="\t")}else h+="\t"}}h+="\n"}}return h}getSelectedCellInfos(){const t=this.stateManeger.select.ranges;let e=Math.min(t[0].start.col,t[0].end.col),n=Math.max(t[0].start.col,t[0].end.col),i=Math.min(t[0].start.row,t[0].end.row),r=Math.max(t[0].start.row,t[0].end.row);t.forEach((t=>{e=Math.min(e,t.start.col,t.end.col),n=Math.max(n,t.start.col,t.end.col),i=Math.min(i,t.start.row,t.end.row),r=Math.max(r,t.start.row,t.end.row)}));const o=e=>{let n=!1;return t.forEach((t=>{const i=Math.min(t.start.row,t.end.row),r=Math.max(t.start.row,t.end.row);i<=e&&r>=e&&(n=!0)})),n},a=e=>{let n=!1;return t.forEach((t=>{const i=Math.min(t.start.col,t.end.col),r=Math.max(t.start.col,t.end.col);i<=e&&r>=e&&(n=!0)})),n},s=(e,n)=>{let i;return t.forEach((t=>{const r=Math.min(t.start.row,t.end.row),o=Math.max(t.start.row,t.end.row),a=Math.min(t.start.col,t.end.col),s=Math.max(t.start.col,t.end.col);a<=e&&s>=e&&r<=n&&o>=n&&(i=t)})),i},l=[];for(let t=i;t<=r;t++){if(o(t)){const i=[];for(let r=e;r<=n;r++){if(a(r)){if(s(r,t)){const e=this.getCellInfo(r,t);i.push(e)}}}l.push(i)}}return l}measureText(t,e){return Ox.measureText(t,e)}measureTextBounds(t){const e=new Ix(t);return{width:e.AABBBounds.width(),height:e.AABBBounds.height()}}getCustomRender(t,e){let n;if("body"!==this.getCellType(t,e)){const i=this.getHeaderDefine(t,e);n=i?.headerCustomRender}else{const i=this.getBodyColumnDefine(t,e);n=i?.customRender||this.customRender}return n}getCustomLayout(t,e){let n;if("body"!==this.getCellType(t,e)){const i=this.getHeaderDefine(t,e);n=i?.headerCustomLayout}else{const i=this.getBodyColumnDefine(t,e);n=i?.customLayout}return n}}var SR=Object.freeze({__proto__:null,BaseTable:_R});function kR(t,e,n){const i=t[e];return t[e]=n,i}function AR(t){for(const e in t)delete t[e]}function RR(){AR(Se),AR(iS),AR(tS)}var BR=Object.freeze({__proto__:null,chartType:function(t,e){return null!=e?kR(tS,t,e):tS[t]},clearAll:RR,icon:function(t,e){return null!=e?kR(iS,t,e):iS[t]},theme:function(t,e){return null!=e?kR(Se,t,e):Se[t]}});var TR=Object.freeze({__proto__:null,dateFormat:function(t,e,n,i,r){null==n&&(n=!1),null==i&&(i=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]),null==r&&(r=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]);const o=n?"UTC":"",a=function(t){return`0${t}`.substring(0,2)};return function(n){const s=new Date(Date.parse(n[t]));return e.replace(/%(.)/g,(function(t,e){switch(e){case"y":return s[`get${o}FullYear`]();case"m":return a(s[`get${o}Month`]()+1);case"n":return i[s[`get${o}Month`]()];case"d":return a(s[`get${o}Date`]());case"w":return r[s[`get${o}Day`]()];case"x":return s[`get${o}Day`]();case"H":return a(s[`get${o}Hours`]());case"M":return a(s[`get${o}Minutes`]());case"S":return a(s[`get${o}Seconds`]());default:return`%${e}`}}))}},numberFormat:function(t){return t=Object.assign({},{digitsAfterDecimal:2,scaler:1,thousandsSep:",",decimalSep:".",prefix:"",suffix:""},t),function(e){if(isNaN(e)||!isFinite(e))return"";const n=function(t,e,n){const i=(t+="").split(".");let r=i[0];const o=i.length>1?n+i[1]:"";return r=function(t,e){return t.replace(/\d+/,(function(t){return t.replace(/(\d)(?=(\d{3})+$)/g,(function(t){return`${t}${e}`}))}))}(r,e),r+o}((t.scaler*e).toFixed(t.digitsAfterDecimal),t.thousandsSep,t.decimalSep);return`${t.prefix}${n}${t.suffix}`}}});let MR=0;class PR{_headerObjects;_headerObjectMap;_headerCellIds;_columns;bodyRowCount=1;hierarchyIndent;_transpose=!1;_showHeader=!0;_recordsCount=0;_table;_cellRangeMap;constructor(t,e,n,i){this._cellRangeMap=new Map,this._showHeader=n,this._table=t,this._columns=[],this._headerCellIds=[],this.hierarchyIndent=i??20,this._headerObjects=this._addHeaders(0,e,[]),this._headerObjectMap=this._headerObjects.reduce(((t,e)=>(t[e.id]=e,t)),{})}get transpose(){return this._transpose}set transpose(t){this._transpose=t}get showHeader(){return this._showHeader}set showHeader(t){this._showHeader=t}isHeader(t,e){return!!(this.transpose&&t<this.headerLevelCount)||!this.transpose&&e<this.headerLevelCount}getCellType(t,e){return this.isHeader(t,e)?this.transpose?"rowHeader":"columnHeader":"body"}isColumnHeader(t,e){return!this.transpose&&e<this.headerLevelCount}isCornerHeader(t,e){return!1}isRowHeader(t,e){return!!(this.transpose&&t<this.headerLevelCount)}getColumnHeaderRange(){return this.transpose?{start:{col:0,row:0},end:{col:this._headerCellIds.length-1,row:(this.rowCount??0)-1}}:{start:{col:0,row:0},end:{col:(this.colCount??0)-1,row:this._headerCellIds.length-1}}}getRowHeaderRange(){return this.transpose?{start:{col:0,row:0},end:{col:this._headerCellIds.length-1,row:(this.rowCount??0)-1}}:{start:{col:0,row:0},end:{col:(this.colCount??0)-1,row:this._headerCellIds.length-1}}}getCornerHeaderRange(){}getBodyRange(){return this.transpose?{start:{col:this.headerLevelCount,row:0},end:{col:(this.colCount??0)-1,row:(this.rowCount??0)-1}}:{start:{col:0,row:this.headerLevelCount},end:{col:(this.colCount??0)-1,row:(this.rowCount??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 colCount(){return this.transpose?this.headerLevelCount+this.recordsCount:this._columns.length}get rowCount(){return this.transpose?this._columns.length:this.headerLevelCount+this.recordsCount}get recordsCount(){return this._recordsCount}set recordsCount(t){this._recordsCount=t}get headerObjects(){return this._headerObjects}get columnObjects(){return this._columns}get columnWidths(){return this._columns}getCellId(t,e){return this.transpose?this.headerLevelCount<=t?this._columns[e]?.id:this._headerCellIds[t]?.[e]:this.headerLevelCount<=e?this._columns[t]?.id:this._headerCellIds[e]?.[t]}getHeader(t,e){const n=this.getCellId(t,e);return this._headerObjectMap[n]}getHeaderFieldKey(t,e){const n=this.getCellId(t,e);return this._headerObjectMap[n]?.fieldKey||(this.transpose?this._columns[e]?.fieldKey:this._columns[t]?.fieldKey)}getHeaderField(t,e){const n=this.getCellId(t,e);return this._headerObjectMap[n]?.field||(this.transpose?this._columns[e]&&this._columns[e].field:this._columns[t]&&this._columns[t].field)}getHeaderCellAdress(t){for(let e=0;e<this._headerCellIds.length;e++){const n=this._headerCellIds[e];for(let i=0;i<n.length;i++)if(n[i]===t)return this.transpose?{col:e,row:i}:{col:i,row:e}}}getHeaderCellAddressByField(t){const e=this.headerObjects.find((e=>e&&e.field===t));return this.getHeaderCellAdress(e.id)}getBody(t,e){return this.transpose?this._columns[e]:this._columns[t]}getBodyLayoutRangeById(t){if(this.transpose){for(let e=0;e<(this.rowCount??0);e++)if(t===this._columns[e].id)return{start:{col:0,row:e},end:{col:0,row:e}}}else for(let e=0;e<(this.colCount??0);e++)if(t===this._columns[e].id)return{start:{col:e,row:0},end:{col:e,row:0}};throw new Error(`can not found body layout @id=${t}`)}getBodyCellValue(t,e){if(this.isHeader(t,e))return null;const{field:n,fieldFormat:i}=this.getBody(t,e);return this._table.getFieldData(i||n,t,e)}getCellRange(t,e){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 n={start:{col:t,row:e},end:{col:t,row:e}};if(this.transpose)n=this.getCellRangeTranspose(t,e);else if(this.headerLevelCount<=e){if(this.headerLevelCount<=e&&this.columnObjects[t]?.define?.mergeCell){const i=this.getBodyCellValue(t,e);for(let r=e-1;r>=this.headerLevelCount&&i===this.getBodyCellValue(t,r);r--)n.start.row=r;for(let r=e+1;r<this.rowCount&&i===this.getBodyCellValue(t,r);r++)n.end.row=r}}else{const i=this.getCellId(t,e);for(let r=t-1;r>=0&&i===this.getCellId(r,e);r--)n.start.col=r;for(let r=t+1;r<(this.colCount??0)&&i===this.getCellId(r,e);r++)n.end.col=r;for(let r=e-1;r>=0&&i===this.getCellId(t,r);r--)n.start.row=r;for(let r=e+1;r<this.headerLevelCount&&i===this.getCellId(t,r);r++)n.end.row=r}return this._cellRangeMap.set(`$${t}$${e}`,n),n}getCellRangeTranspose(t,e){const n={start:{col:t,row:e},end:{col:t,row:e}};if(this.headerLevelCount<=t||-1===t&&-1===e){if(this.headerLevelCount<=t&&this.columnObjects[e]?.define?.mergeCell){const i=this.getBodyCellValue(t,e);for(let r=t-1;r>=this.headerLevelCount&&i===this.getBodyCellValue(r,e);r--)n.start.col=r;for(let r=t+1;r<(this.colCount??0)&&i===this.getBodyCellValue(r,e);r++)n.end.col=r}return n}const i=this.getCellId(t,e);for(let r=e-1;r>=0&&i===this.getCellId(t,r);r--)n.start.row=r;for(let r=e+1;r<(this.rowCount??0)&&i===this.getCellId(t,r);r++)n.end.row=r;for(let r=t-1;r>=0&&i===this.getCellId(r,e);r--)n.start.col=r;for(let r=t+1;r<this.headerLevelCount&&i===this.getCellId(r,e);r++)n.end.col=r;return n}isCellRangeEqual(t,e,n,i){const r=this.getCellRange(t,e),o=this.getCellRange(n,i);return r.start.col===o.start.col&&r.end.col===o.end.col&&r.start.row===o.start.row&&r.end.row===o.end.row}getRecordIndexByRow(t,e){return this.transpose?t<this.headerLevelCount?-1:t-this.headerLevelCount:e<this.headerLevelCount?-1:e-this.headerLevelCount}getRecordStartRowByRecordIndex(t){return this.headerLevelCount+t}_addHeaders(t,e,n,i){const r=[],o=this._newRow(t,i);return e.forEach((e=>{const a=this._columns.length,s=MR++,{captionIcon:l}=e,h={id:s,caption:e.caption,captionIcon:l,headerIcon:e.headerIcon,field:e.field,fieldKey:e?.fieldKey,fieldFormat:e.fieldFormat,style:e.headerStyle,headerType:e.headerType??"text",dropDownMenu:e.dropDownMenu,define:e,columnWidthComputeMode:e.columnWidthComputeMode};r[s]=h;for(let e=t-1;e>=0;e--)this._headerCellIds[e][a]=n[e];if(o[a]=i?this._headerCellIds[t-1][a]:s,e.columns)this._addHeaders(t+1,e.columns,[...n,s],e.hideColumnsSubHeader).forEach((t=>r.push(t)));else{const n=e;this._columns.push({id:MR++,field:n.field,fieldKey:n.fieldKey,fieldFormat:n.fieldFormat,width:n.width,minWidth:n.minWidth,maxWidth:n.maxWidth,icon:n.icon,columnType:n.columnType??"text",chartType:"chartType"in n?n.chartType:null,chartSpec:"chartSpec"in n?n.chartSpec:null,sparklineSpec:"sparklineSpec"in n?n.sparklineSpec:Be,style:n.style,define:n,columnWidthComputeMode:n.columnWidthComputeMode,disableColumnResize:n?.disableColumnResize});for(let e=t+1;e<this._headerCellIds.length;e++)this._headerCellIds[e][a]=s}})),r}_newRow(t,e=!1){if(this._headerCellIds[t]){const e=this._headerCellIds[t-1];if(e.length>this._headerCellIds[t].length)for(let n=this._headerCellIds[t].length;n<e.length;n++)this._headerCellIds[t][n]=e[n];return this._headerCellIds[t]}if(e)return[];const n=this._headerCellIds[t]=[];if(!this._columns.length)return n;const i=this._headerCellIds[t-1];for(let t=0;t<i.length;t++)n[t]=i[t];return n}getCellHeaderPaths(t,e){let n=[],i=[];return this.transpose?i=[{field:this._columns[e].field}]:n=[{field:this._columns[t].field}],{colHeaderPaths:n,rowHeaderPaths:i}}getParentCellId(t,e){if(0!==e)return this.isColumnHeader(t,e)?this.getCellId(t,e-1):this.isRowHeader(t,e)?this.getCellId(t-1,e):void 0}canMoveHeaderPosition(t,e){const n=this.getCellRange(t.col,t.row);if(this.isColumnHeader(t.col,t.row)){return this.getParentCellId(t.col,n.start.row)===this.getParentCellId(e.col,n.start.row)}if(this.isRowHeader(t.col,t.row)){return this.getParentCellId(n.start.col,t.row)===this.getParentCellId(n.start.col,e.row)}return!1}moveHeaderPosition(t,e){if(this.canMoveHeaderPosition(t,e)){const n=this.getCellRange(t.col,t.row);if(this.isColumnHeader(t.col,t.row)){const i=n.end.col-n.start.col+1;let r;const o=this.getCellRange(e.col,n.start.row);if(r=e.col>=t.col?o.end.col-i+1:o.start.col,r===n.start.col)return null;for(let t=0;t<this._headerCellIds.length;t++){const e=this._headerCellIds[t].splice(n.start.col,i);e.unshift(r,0),Array.prototype.splice.apply(this._headerCellIds[t],e)}const a=this._columns.splice(n.start.col,i);return a.unshift(r,0),Array.prototype.splice.apply(this._columns,a),this._cellRangeMap=new Map,{sourceIndex:n.start.col,targetIndex:r,moveSize:i,moveType:"column"}}if(this.isRowHeader(t.col,t.row)){const i=n.end.row-n.start.row+1;let r;const o=this.getCellRange(n.start.col,e.row);if(r=e.row>=t.row?o.end.row-i+1:o.start.row,r===n.start.row)return null;for(let t=0;t<this._headerCellIds.length;t++){const e=this._headerCellIds[t].splice(n.start.row,i);e.unshift(r,0),Array.prototype.splice.apply(this._headerCellIds[t],e)}const a=this._columns.splice(n.start.row,i);return a.unshift(r,0),Array.prototype.splice.apply(this._columns,a),this._cellRangeMap=new Map,{sourceIndex:n.start.row,targetIndex:r,moveSize:i,moveType:"row"}}}return null}toggleHierarchyState(t){const e=t.add.map((t=>({col:0,row:this._table.frozenRowCount+t}))),n=t.remove.map((t=>({col:0,row:this._table.frozenRowCount+t})));return{addCellPositions:e,removeCellPositions:n}}}class ER{sizeIncludeParent=!1;rowExpandLevel;hierarchyType;tree={id:0,dimensionKey:"",value:"",children:[],level:-1,startIndex:0,size:0,startInTotal:0,hierarchyState:void 0};totalLevel=0;dimensionKeys=new St;constructor(t,e="grid",n=void 0){this.sizeIncludeParent=null!=n,this.rowExpandLevel=n,this.hierarchyType=e,this.reset(t)}reset(t,e=!1){this.dimensionKeys=new St,this.tree.children=t,this.setTreeNode(this.tree,0,this.tree),this.totalLevel=this.dimensionKeys.count()}setTreeNode(t,e,n){t.startIndex=e,t.startInTotal=(n.startInTotal??0)+t.startIndex,(t.dimensionKey??t.indicatorKey)&&(!this.dimensionKeys.contain(t.indicatorKey?Re:t.dimensionKey)&&this.dimensionKeys.put(t.level,t.indicatorKey?Re:t.dimensionKey),t.id||(t.id=++HR));let i=t.dimensionKey&&this.sizeIncludeParent?1:0;return"grid"===this.hierarchyType?t.children?t.children.forEach((e=>{e.level=(t.level??0)+1,i+=this.setTreeNode(e,i,t)})):i=1:t.hierarchyState===r.expand&&t.children?t.children.forEach((e=>{e.level=(t.level??0)+1,i+=this.setTreeNode(e,i,t)})):t.hierarchyState===r.collapse&&t.children?t.children.forEach((e=>{e.level=(t.level??0)+1,this.setTreeNode(e,i,t)})):!t.hierarchyState&&t.level+1<this.rowExpandLevel&&t.children?(t.hierarchyState=r.expand,t.children.forEach((e=>{e.level=(t.level??0)+1,i+=this.setTreeNode(e,i,t)}))):t.children?(t.hierarchyState=r.collapse,t.children.forEach((e=>{e.level=(t.level??0)+1,this.setTreeNode(e,i,t)}))):(t.hierarchyState=r.none,i=1),t.size=i,i}getTreePath(t,e=30){const n=[];return this.searchPath(t,this.tree,n,e),n.shift(),n}searchPath(t,e,n,i){if(!e)return!1;if(t<e.startIndex||t>=e.startIndex+e.size)return!1;if(n.push(e),!e.children||0===e.children.length)return!0;if(e.level>=i)return!0;const r=t-e.startIndex;return e.children.some((t=>this.searchPath(r,t,n,i))),!0}movePosition(t,e,n){let i,r,o;const a=(s,l)=>{if((void 0===r||void 0===o)&&(s.level===t&&(s.startInTotal===e&&(r=l),s.startInTotal<=n&&n<=s.startInTotal+s.size-1&&(o=l)),s.children&&s.level<t)){i=s;for(let t=0;t<s.children.length;t++)(e>=s.children[t].startInTotal&&e<=s.children[t].startInTotal+s.children[t].size||n>=s.children[t].startInTotal&&n<=s.children[t].startInTotal+s.children[t].size)&&a(s.children[t],t)}};a(this.tree,0);const s=i.children.splice(r,1);s.unshift(o,0),Array.prototype.splice.apply(i.children,s)}}let HR=0,OR=0;class LR{_showHeader=!0;rowDimensionTree;columnDimensionTree;rowTree;columnTree;cornerHeaderObjs;columnHeaderObjs=[];rowHeaderObjs=[];_cornerHeaderCellIds=[];_columnHeaderCellIds=[];_rowHeaderCellIds=[];_columnWidths=[];rowsDefine;columnsDefine;indicatorsDefine;columnPaths=[];_headerObjects=[];_headerObjectMap={};_indicators=[];indicatorTitle;indicatorsAsCol=!0;hideIndicatorName=!1;_showRowHeader=!0;_showColumnHeader=!0;_rowHeaderTitle;_columnHeaderTitle;cornerSetting;_indicatorShowType="column";rowHierarchyType;rowExpandLevel;rowHierarchyIndent;rowDimensionKeys=[];colDimensionKeys=[];indicatorKeys=[];indicatorDimensionKey=Re;_cellRangeMap;_CellHeaderPathMap;_table;constructor(t){if(this._table=t,this._cellRangeMap=new Map,this._CellHeaderPathMap=new Map,this.rowTree=t.options.rowTree,this.columnTree=t.options.columnTree,this.rowsDefine=t.options.rows??[],this.columnsDefine=t.options.columns??[],this.indicatorsDefine=t.options.indicators??[],this.indicatorTitle=t.options.indicatorTitle,this.hideIndicatorName=t.options.hideIndicatorName??!1,this.showRowHeader=t.options.showRowHeader??!0,this.showColumnHeader=t.options.showColumnHeader??!0,this.rowHeaderTitle=t.options.rowHeaderTitle,this.columnHeaderTitle=t.options.columnHeaderTitle,this.rowHierarchyType=t.options.rowHierarchyType??"grid",this.rowExpandLevel=t.options.rowExpandLevel??1,this.rowHierarchyIndent=t.options.rowHierarchyIndent??20,this.cornerSetting=t.options.corner??{titleOnDimension:"column"},this.indicatorsDefine?.forEach((t=>{"string"==typeof t?this.indicatorKeys.push(t):this.indicatorKeys.push(t.indicatorKey)})),this.columnDimensionTree=new ER(this.columnTree??[]),this.rowDimensionTree=new ER(this.rowTree??[],this.rowHierarchyType,"tree"===this.rowHierarchyType?this.rowExpandLevel:void 0),this.colDimensionKeys=this.columnDimensionTree.dimensionKeys.valueArr(),this.rowDimensionKeys=this.rowDimensionTree.dimensionKeys.valueArr(),this.cornerHeaderObjs="column"===this.cornerSetting.titleOnDimension?this._addCornerHeaders(this.columnHeaderTitle?[""].concat(this.colDimensionKeys):this.colDimensionKeys):"row"===this.cornerSetting.titleOnDimension?this._addCornerHeaders(this.rowHeaderTitle?[""].concat(this.rowDimensionKeys):this.rowDimensionKeys):this._addCornerHeaders(null),this.columnDimensionTree.tree.children&&(this.columnHeaderObjs=this._addHeaders(this._columnHeaderCellIds,0,this.columnDimensionTree.tree.children,[]),this.columnHeaderTitle)){const t=++HR,e=Array(this.colCount-this.rowHeaderLevelCount).fill(t);this._columnHeaderCellIds.unshift(e);const n={id:t,caption:"string"==typeof this.columnHeaderTitle.title?this.columnHeaderTitle.title:this.columnsDefine.reduce(((t,e)=>"string"==typeof e?t:t+(t?`/${e.dimensionTitle}`:`${e.dimensionTitle}`)),""),field:void 0,headerType:this.columnHeaderTitle.headerType??"text",style:this.columnHeaderTitle.headerStyle,define:{id:t}};this.columnHeaderObjs.push(n),this._headerObjects[t]=n}if(OR=0,this.rowDimensionTree.tree.children&&(this.rowHeaderObjs="tree"===this.rowHierarchyType?this._addHeadersForTreeMode(this._rowHeaderCellIds,0,this.rowDimensionTree.tree.children,[],this.rowDimensionTree.totalLevel,!0):this._addHeaders(this._rowHeaderCellIds,0,this.rowDimensionTree.tree.children,[])),this.rowHeaderTitle){const t=++HR,e=Array(this.rowCount-this.columnHeaderLevelCount).fill(t);this._rowHeaderCellIds.unshift(e);const n={id:t,caption:"string"==typeof this.rowHeaderTitle.title?this.rowHeaderTitle.title:this.rowsDefine.reduce(((t,e)=>"string"==typeof e?t:t+(t?`/${e.dimensionTitle}`:`${e.dimensionTitle}`)),""),field:void 0,headerType:this.rowHeaderTitle.headerType??"text",style:this.rowHeaderTitle.headerStyle,define:{id:t}};this.rowHeaderObjs.push(n),this._headerObjects[t]=n}OR=0,this.indicatorsAsCol=!k(this.rowDimensionKeys.find((t=>t===this.indicatorDimensionKey))),this._rowHeaderCellIds=C(this._rowHeaderCellIds),this._headerObjectMap=this._headerObjects.reduce(((t,e)=>(t[e.id]=e,t)),{}),this.indicatorsAsCol&&!this.hideIndicatorName?this._indicatorShowType="column":this.indicatorsAsCol||this.hideIndicatorName?this._indicatorShowType="none":this._indicatorShowType="row",this.setColumnWidths()}_addHeaders(t,e,n,i){const r=[];return t[e]||function(e){const n=t[e]=[];if(0===OR)return n;const i=t[e-1];for(let t=0;t<i?.length;t++)n[t]=i[t]}(e),n.forEach((n=>{const o=n.id,a=this.rowsDefine?.find((t=>"string"!=typeof t&&t.dimensionKey===n.dimensionKey))??this.columnsDefine?.find((t=>"string"!=typeof t&&t.dimensionKey===n.dimensionKey)),s=this.indicatorsDefine?.find((t=>"string"!=typeof t&&(n.indicatorKey?t.indicatorKey===n.indicatorKey:t.caption===n.value))),l={id:o,caption:n.value??s.caption,field:n.dimensionKey,style:"function"==typeof(s??a)?.headerStyle?(s??a)?.headerStyle:Object.assign({},(s??a)?.headerStyle),headerType:s?.headerType??a?.headerType??"text",headerIcon:s?.headerIcon??a?.headerIcon,define:Object.assign({},n,s??a),fieldFormat:s?.headerFormat??a?.headerFormat,dropDownMenu:s?.dropDownMenu??a?.dropDownMenu,pivotInfo:{value:n.value,dimensionKey:n.dimensionKey,isPivotCorner:!1},width:a?.width,minWidth:a?.minWidth,maxWidth:a?.maxWidth,showSort:s?.showSort??a?.showSort,description:a?.description};s?(s.customRender&&(n.customRender=s.customRender),k(this._indicators.find((t=>t.indicatorKey===s.indicatorKey)))||this._indicators.push({id:++HR,indicatorKey:s.indicatorKey,field:s.indicatorKey,fieldFormat:s?.format,columnType:s?.columnType??"text",chartType:"chartType"in s?s.chartType:null,chartSpec:"chartSpec"in s?s.chartSpec:null,sparklineSpec:"sparklineSpec"in s?s.sparklineSpec:null,style:s?.style,icon:s?.icon,define:Object.assign({},n,s,{dragHeader:a?.dragHeader}),width:s?.width,minWidth:s?.minWidth,maxWidth:s?.maxWidth,disableColumnResize:s?.disableColumnResize})):n.indicatorKey&&(k(this._indicators.find((t=>t.indicatorKey===n.indicatorKey)))||this._indicators.push({id:++HR,indicatorKey:n.indicatorKey,field:n.indicatorKey,columnType:"text",define:Object.assign({},n)})),r[o]=l,this._headerObjects[o]=l,t[e][OR]=o;for(let n=e-1;n>=0;n--)t[n][OR]=i[n];if(n.children)this._addHeaders(t,e+1,n.children??[],[...i,o]).forEach((t=>r.push(t)));else{for(let n=e+1;n<t.length;n++)t[n][OR]=o;OR++}})),r}_addHeadersForTreeMode(t,e,n,i,o,a){const s=[];return t[e]||function(e){const n=t[e]=[];if(0===OR)return n;const i=t[e-1];for(let t=0;t<i?.length;t++)n[t]=i[t]}(e),n.forEach((n=>{const l=n.id,h=this.rowsDefine?.find((t=>"string"!=typeof t&&t.dimensionKey===n.dimensionKey))??this.columnsDefine?.find((t=>"string"!=typeof t&&t.dimensionKey===n.dimensionKey)),u={id:l,caption:n.value,field:n.dimensionKey,style:n.level+1===o||"function"==typeof h?.headerStyle?h?.headerStyle:Object.assign({},h?.headerStyle,{textAlign:"left"}),headerType:h?.headerType??"text",headerIcon:h?.headerIcon,define:Object.assign(n,{linkJump:h?.linkJump,linkDetect:h?.linkDetect,templateLink:h?.templateLink,keepAspectRatio:h?.keepAspectRatio??!1,imageAutoSizing:h?.imageAutoSizing,headerCustomRender:h?.headerCustomRender,headerCustomLayout:h?.headerCustomLayout,dragHeader:h?.dragHeader}),fieldFormat:h?.headerFormat,dropDownMenu:h?.dropDownMenu,pivotInfo:{value:n.value,dimensionKey:n.dimensionKey,isPivotCorner:!1},hierarchyLevel:n.level,dimensionTotalLevel:o,hierarchyState:n.level+1===o?void 0:n.hierarchyState,width:h?.width,minWidth:h?.minWidth,maxWidth:h?.maxWidth};s[l]=u,this._headerObjects[l]=u,t[e][OR]=l;for(let n=e-1;n>=0;n--)t[n][OR]=i[n];if(n.hierarchyState===r.expand&&n.children)a&&OR++,this._addHeadersForTreeMode(t,e,n.children??[],[...i,l],o,a&&n.hierarchyState===r.expand).forEach((t=>s.push(t)));else{a&&OR++;for(let n=e+1;n<t.length;n++)t[n][OR]=l}})),s}_addCornerHeaders(t){const e=[];if(t)t.forEach(((t,n)=>{const i=++HR,r=this.rowsDefine?.find((e=>"string"!=typeof e&&e.dimensionKey===t))??this.columnsDefine?.find((e=>"string"!=typeof e&&e.dimensionKey===t)),o={id:i,caption:t===this.indicatorDimensionKey?this.indicatorTitle:r?.dimensionTitle??"",field:"维度名称",style:this.cornerSetting.headerStyle,headerType:this.cornerSetting.headerType??"text",define:{dimensionKey:"维度名称",id:i,value:t},dropDownMenu:r?.cornerDropDownMenu,pivotInfo:{value:r?.dimensionTitle??"",dimensionKey:t,isPivotCorner:!0},description:r?.cornerDescription};if(e[i]=o,this._headerObjects[i]=o,"column"===this.cornerSetting.titleOnDimension){this._cornerHeaderCellIds[n]||(this._cornerHeaderCellIds[n]=[]);for(let t=0;t<this.rowHeaderLevelCount;t++)this._cornerHeaderCellIds[n][t]=i}else if("row"===this.cornerSetting.titleOnDimension)for(let t=0;t<this.columnHeaderLevelCount;t++)this._cornerHeaderCellIds[t]||(this._cornerHeaderCellIds[t]=[]),this._cornerHeaderCellIds[t][n]=i}));else{const t=++HR,n={id:t,caption:"",field:"维度名称",style:this.cornerSetting.headerStyle,headerType:this.cornerSetting.headerType??"text",define:{dimensionKey:"维度名称",id:t,value:""}};e[t]=n,this._headerObjects[t]=n;for(let e=0;e<this.columnHeaderLevelCount;e++)for(let n=0;n<this.rowHeaderLevelCount;n++)this._cornerHeaderCellIds[e]||(this._cornerHeaderCellIds[e]=[]),this._cornerHeaderCellIds[e][n]=t}return e}get columnWidths(){return this._columnWidths}setColumnWidths(){const t=new Array(this.colCount).fill(void 0);if(this.showHeader&&this.showRowHeader&&(this.rowHeaderTitle&&(t[0]={}),this.rowDimensionKeys.forEach(((e,n)=>{const i=this.rowsDefine?.find((t=>"string"!=typeof t&&t.dimensionKey===e));i&&(t[n+(this.rowHeaderTitle?1:0)]={width:i.width,minWidth:i.minWidth,maxWidth:i.maxWidth})}))),this.indicatorsAsCol)for(let e=this.rowHeaderLevelCount;e<this.colCount;e++){const n=this.getBody(e,this.columnHeaderLevelCount);t[e]={width:n?.width,minWidth:n?.minWidth,maxWidth:n?.maxWidth}}else{let e,n,i,r=0;this._indicators.forEach(((t,o)=>{"number"==typeof t.width?r=Math.max(t.width,r):"auto"===t.width&&(i=!0),"number"==typeof t.minWidth&&(n=Math.max(t.minWidth,n)),"number"==typeof t.maxWidth&&(e=Math.max(t.maxWidth,e))})),r=r>0?r:i?"auto":void 0,t.fill({width:r,minWidth:n,maxWidth:e},this.rowHeaderLevelCount,this.colCount)}this._columnWidths=t}get showHeader(){return this._showHeader}set showHeader(t){this._showHeader=t}get showColumnHeader(){return this._showColumnHeader}set showColumnHeader(t){this._showColumnHeader=t}get showRowHeader(){return this._showRowHeader}set showRowHeader(t){this._showRowHeader=t}get columnHeaderTitle(){return this._columnHeaderTitle}set columnHeaderTitle(t){this._columnHeaderTitle=t}get rowHeaderTitle(){return this._rowHeaderTitle}set rowHeaderTitle(t){this._rowHeaderTitle=t}getHeaderFieldKey(t,e){}getCellType(t,e){return this.isCornerHeader(t,e)?"cornerHeader":this.isColumnHeader(t,e)?"columnHeader":this.isRowHeader(t,e)?"rowHeader":"body"}isHeader(t,e){return t<this.rowHeaderLevelCount||e<this.columnHeaderLevelCount}isCornerHeader(t,e){return t<this.rowHeaderLevelCount&&e<this.columnHeaderLevelCount}isColumnHeader(t,e){return t>=this.rowHeaderLevelCount&&e<this.columnHeaderLevelCount}isRowHeader(t,e){return t<this.rowHeaderLevelCount&&e>=this.columnHeaderLevelCount}getColumnHeaderRange(){return{start:{col:this.rowHeaderLevelCount,row:0},end:{col:this.colCount-1,row:this.columnHeaderLevelCount-1}}}getRowHeaderRange(){return{start:{col:0,row:this.columnHeaderLevelCount},end:{col:this.rowHeaderLevelCount-1,row:this.rowCount-1}}}getCornerHeaderRange(){return{start:{col:0,row:0},end:{col:this.rowHeaderLevelCount-1,row:this.columnHeaderLevelCount-1}}}getBodyRange(){return{start:{col:this.rowHeaderLevelCount,row:this.columnHeaderLevelCount},end:{col:this.colCount-1,row:this.rowCount-1}}}resetCellIds(){}get headerLevelCount(){return this.columnHeaderLevelCount}get columnHeaderLevelCount(){if(this.showHeader&&this.showColumnHeader){let t=this.indicatorsAsCol&&this.hideIndicatorName&&this.colDimensionKeys[this.colDimensionKeys.length-1]===this.indicatorDimensionKey?this.columnDimensionTree.totalLevel-1:this.columnDimensionTree.totalLevel;return this.columnHeaderTitle&&(t+=1),t}return 0}get rowHeaderLevelCount(){if(this.showHeader&&this.showRowHeader){if("tree"===this.rowHierarchyType)return this.rowHeaderTitle?2:1;let t=this.indicatorsAsCol?this.rowDimensionTree.totalLevel:this.hideIndicatorName&&this.rowDimensionKeys[this.rowDimensionKeys.length-1]===this.indicatorDimensionKey?this.rowDimensionTree.totalLevel-1:this.rowDimensionTree.totalLevel;return this.rowHeaderTitle&&(t+=1),t}return 0}get colCount(){return this.columnDimensionTree.tree.size+this.rowHeaderLevelCount}get rowCount(){return this.rowDimensionTree.tree.size+this.columnHeaderLevelCount}get bodyRowCount(){return this.rowDimensionTree.tree.size}get headerObjects(){return this._headerObjects}get columnObjects(){return this._indicators}getCellId(t,e){if(e>=0&&t>=0){if(this.isCornerHeader(t,e))return this._cornerHeaderCellIds[e][t];if(this.isColumnHeader(t,e))return this._columnHeaderCellIds[e][t-this.rowHeaderLevelCount];if(this.isRowHeader(t,e))return this._rowHeaderCellIds[e-this.columnHeaderLevelCount]?.[t]}}getHeader(t,e){const n=this.getCellId(t,e);return this._headerObjectMap[n]}getHeaderField(t,e){const n=this.getCellId(t,e);return this._headerObjectMap[n]?.field||this.getBody(t,e)?.field}getHeaderCellAdress(t){for(let e=0;e<this._columnHeaderCellIds.length;e++){const n=this._columnHeaderCellIds[e];for(let i=0;i<n.length;i++)if(n[i]===t)return{col:i+this._table.frozenColCount,row:e}}for(let e=0;e<this._rowHeaderCellIds.length;e++){const n=this._rowHeaderCellIds[e];for(let i=0;i<n.length;i++)if(n[i]===t)return{col:i,row:e+this._table.frozenRowCount}}for(let e=0;e<this._cornerHeaderCellIds.length;e++){const n=this._cornerHeaderCellIds[e];for(let i=0;i<n.length;i++)if(n[i]===t)return{col:i,row:e}}}getHeaderCellAddressByField(t){const e=this.headerObjects.find((e=>e&&e.field===t));return this.getHeaderCellAdress(e.id)}getBody(t,e){const n=this.getCellHeaderPaths(t,e);if(this.indicatorsAsCol){const t=n.colHeaderPaths.find((t=>t.indicatorKey))?.indicatorKey;return this._indicators.find((e=>e.indicatorKey===t))??this._indicators[0]??{id:"",field:void 0,indicatorKey:void 0,columnType:void 0,define:void 0}}const i=n.rowHeaderPaths.find((t=>t.indicatorKey))?.indicatorKey;return this._indicators.find((t=>t.indicatorKey===i))??this._indicators[0]??{id:"",field:void 0,indicatorKey:void 0,columnType:void 0,define:void 0}}getBodyLayoutRangeById(t){for(let e=0;e<(this.colCount??0);e++)if(t===this.columnObjects[e].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){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}`);const n={start:{col:t,row:e},end:{col:t,row:e}};if(this.isHeader(t,e)&&-1!==t&&-1!==e){const i=this.getCellId(t,e);for(let r=t-1;r>=0&&i===this.getCellId(r,e);r--)n.start.col=r;for(let r=t+1;r<(this.colCount??0)&&i===this.getCellId(r,e);r++)n.end.col=r;for(let r=e-1;r>=0&&i===this.getCellId(t,r);r--)n.start.row=r;for(let r=e+1;r<(this.rowCount??0)&&i===this.getCellId(t,r);r++)n.end.row=r}return this._cellRangeMap.set(`${t}-${e}`,n),n}isCellRangeEqual(t,e,n,i){const r=this.getCellRange(t,e),o=this.getCellRange(n,i);return r.start.col===o.start.col&&r.end.col===o.end.col&&r.start.row===o.start.row&&r.end.row===o.end.row}getRecordIndexByRow(t){return t<this.columnHeaderLevelCount?-1:t-this.columnHeaderLevelCount}getRecordIndexByCol(t){return t<this.rowHeaderLevelCount?-1:t-this.rowHeaderLevelCount}getRecordStartRowByRecordIndex(t){return this.columnHeaderLevelCount+t}getCellHeaderPathsWidthTreeNode(t,e){if(this._CellHeaderPathMap.has(`${t}-${e}`))return this._CellHeaderPathMap.get(`${t}-${e}`);const n=this.getRecordIndexByCol(t),i=this.getRecordIndexByRow(e);let r,o;if(t>=0&&(r=this.columnDimensionTree.getTreePath(n,this.showHeader&&this.showColumnHeader?e-(this.columnHeaderTitle?1:0):this.columnDimensionTree.totalLevel)),e>=0)if("tree"===this.rowHierarchyType)if(t>=this.rowHeaderLevelCount)o=this.rowDimensionTree.getTreePath(i,t+this.rowDimensionTree.totalLevel);else{const n=this.getHeader(t,e);o=this.rowDimensionTree.getTreePath(i,t+n.hierarchyLevel)}else o=this.rowDimensionTree.getTreePath(i,this.showHeader&&this.showRowHeader?t-(this.rowHeaderTitle?1:0):this.rowDimensionTree.totalLevel);const a={colHeaderPaths:r,rowHeaderPaths:o};return this._CellHeaderPathMap.set(`${t}-${e}`,a),a}getCellHeaderPaths(t,e){const n=this.getCellHeaderPathsWidthTreeNode(t,e),i={colHeaderPaths:[],rowHeaderPaths:[]};return n.colHeaderPaths.forEach((t=>{const e={};e.dimensionKey=t.dimensionKey,e.indicatorKey=t.indicatorKey,e.value=t.value??this.getIndicatorInfoByIndicatorKey(t.indicatorKey)?.caption??"",i.colHeaderPaths.push(e)})),n.rowHeaderPaths.forEach((t=>{const e={};e.dimensionKey=t.dimensionKey,e.indicatorKey=t.indicatorKey,e.value=t.value??this.getIndicatorInfoByIndicatorKey(t.indicatorKey)?.caption??"",i.rowHeaderPaths.push(e)})),i}getIndicatorInfoByIndicatorKey(t){const e=this.indicatorsDefine?.find((e=>"string"!=typeof e&&(!!t&&e.indicatorKey===t)));return e}getHeaderDimension(t,e){if(this.isHeader(t,e)){const n=this.getHeader(t,e);return this.rowsDefine?.find((t=>"string"!=typeof t&&t.dimensionKey===n.field))??this.columnsDefine?.find((t=>"string"!=typeof t&&t.dimensionKey===n.field))}}isColumnIndicatorHeader(t,e){return"column"===this._indicatorShowType&&e===this.columnHeaderLevelCount-1&&t>=this.rowHeaderLevelCount}isRowIndicatorHeader(t,e){return"row"===this._indicatorShowType&&t===this.rowHeaderLevelCount-1&&e>=this.columnHeaderLevelCount}isIndicatorHeader(t,e){return this.isColumnIndicatorHeader(t,e)||this.isRowIndicatorHeader(t,e)}toggleHierarchyState(t,e){const n=this._rowHeaderCellIds.slice(0),i=n.map((t=>this.getHeaderCellAdress(t[0]))),o=this.getHeader(t,e);if(o.define.hierarchyState=o.define.hierarchyState===r.collapse?r.expand:r.collapse,this.rowDimensionTree.reset(this.rowDimensionTree.tree.children,!0),this._rowHeaderCellIds=[],this.rowHeaderObjs=this._addHeadersForTreeMode(this._rowHeaderCellIds,0,this.rowDimensionTree.tree.children,[],this.rowDimensionTree.totalLevel,!0),this.rowHeaderTitle){const t=++HR,e=Array(this.rowCount-this.columnHeaderLevelCount).fill(t);this._rowHeaderCellIds.unshift(e);const n={id:t,caption:"string"==typeof this.rowHeaderTitle.title?this.rowHeaderTitle.title:this.rowsDefine.reduce(((t,e)=>"string"==typeof e?t:t+(t?`/${e.dimensionTitle}`:`${e.dimensionTitle}`)),""),field:void 0,headerType:this.rowHeaderTitle.headerType??"text",style:this.rowHeaderTitle.headerStyle,define:{field:"",headerType:"text",columnType:"text"}};this.rowHeaderObjs.push(n),this._headerObjects[t]=n}return OR=0,this._rowHeaderCellIds=C(this._rowHeaderCellIds),this._headerObjectMap=this._headerObjects.reduce(((t,e)=>(t[e.id]=e,t)),{}),this._CellHeaderPathMap=new Map,function(t,e,n,i){const r=t.map((t=>t[0])),o=e.map((t=>t[0])),a=[],s=[];for(let t=0;t<r.length;t++)o.includes(r[t])||s.push(n[t]);for(let t=0;t<o.length;t++)r.includes(o[t])||a.push(i.getHeaderCellAdress(o[t]));return{addCellPositions:a,removeCellPositions:s}}(n,this._rowHeaderCellIds,i,this)}isHeaderForColWidth(t,e){return this.isHeader(t,e)}getHeaderForColWidth(t,e){return this.getHeader(t,e)}getPivotCellAdress(t){if(!Array.isArray(t))return;let e,n,i=this.rowTree,r=this.columnTree;for(let o=0;o<t.length;o++){const a=t[o];if((a.isPivotCorner||!a.value)&&o===t.length-1){if("row"===this?.cornerSetting?.titleOnDimension){let t=0;return"grid"===this.rowHierarchyType&&(t=this.rowDimensionKeys.indexOf(a.dimensionKey)),-1===t?void 0:{col:this.rowHeaderTitle?t+1:t,row:0}}const t=this.colDimensionKeys.indexOf(a.dimensionKey);return-1===t?void 0:{col:0,row:this.columnHeaderTitle?t+1:t}}let s=!1;for(let t=0;t<r.length;t++){const e=r[t];if((k(a.dimensionKey)&&e.dimensionKey===a.dimensionKey||k(a.indicatorKey)&&e.indicatorKey===a.indicatorKey)&&e.value===a.value){r=e.children,n=e,s=!0;break}}if(!s)for(let t=0;t<i.length;t++){const n=i[t];if((k(a.dimensionKey)&&n.dimensionKey===a.dimensionKey||k(a.indicatorKey)&&n.indicatorKey===a.indicatorKey)&&n.value===a.value){i=n.children,e=n;break}}}let o=0,a=0;if(e){a=this.columnHeaderLevelCount;const{startInTotal:t,level:n}=e;return a+=t,o="grid"===this.rowHierarchyType?this.rowHeaderTitle?n+1:n:0,{col:o,row:a}}if(n){o=this.rowHeaderLevelCount;const{startInTotal:t,level:e}=n;return o+=t,a=this.columnHeaderTitle?e+1:e,{col:o,row:a}}}getPivotDimensionInfo(t,e){const{colHeaderPaths:n,rowHeaderPaths:i}=this.getCellHeaderPaths(t,e),r=[];return n.length?n.forEach(((t,e)=>{r.push({dimensionKey:t.dimensionKey,value:t.value,isPivotCorner:!1,indicatorKey:t.indicatorKey})})):i.length?i.forEach(((t,e)=>{r.push({dimensionKey:t.dimensionKey,value:t.value,isPivotCorner:!1,indicatorKey:t.indicatorKey})})):this.isCornerHeader(t,e)&&("row"===this?.cornerSetting?.titleOnDimension?r.push({dimensionKey:this.rowDimensionKeys[this.rowHeaderTitle?t-1:t],isPivotCorner:!0}):r.push({dimensionKey:this.colDimensionKeys[this.columnHeaderTitle?e-1:e],isPivotCorner:!0})),r}getIndicatorKey(t,e){return this.getBody(t,e)?.indicatorKey}getParentCellId(t,e){if(0!==e)return this.isColumnHeader(t,e)?this.getCellId(t,e-1):this.isRowHeader(t,e)?this.getCellId(t-1,e):void 0}canMoveHeaderPosition(t,e){const n=this.getCellRange(t.col,t.row);if(this.isColumnHeader(t.col,t.row)){return this.getParentCellId(t.col,n.start.row)===this.getParentCellId(e.col,n.start.row)}if(this.isRowHeader(t.col,t.row)){if("tree"!==this.rowHierarchyType){return this.getParentCellId(n.start.col,t.row)===this.getParentCellId(n.start.col,e.row)}{const n=b(this.getCellHeaderPathsWidthTreeNode(t.col,t.row).rowHeaderPaths),i=b(this.getCellHeaderPathsWidthTreeNode(e.col,e.row).rowHeaderPaths);if(n.pop(),i.pop(),n.length<=i.length)return n.length!==i.length||!n.find(((t,e)=>t.dimensionKey!==i[e].dimensionKey||t.value!==i[e].value))}}return!1}moveHeaderPosition(t,e){if(this.canMoveHeaderPosition(t,e)&&!this.isCellRangeEqual(t.col,t.row,e.col,e.row)){const n=this.getCellRange(t.col,t.row);if(this.isColumnHeader(t.col,t.row)){const i=n.end.col-n.start.col+1;let r;const o=this.getCellRange(e.col,n.start.row);if(r=e.col>=t.col?o.end.col-i+1:o.start.col,r===n.end.col)return null;for(let t=0;t<this._columnHeaderCellIds.length;t++){const e=this._columnHeaderCellIds[t].splice(n.start.col-this.rowHeaderLevelCount,i);e.unshift(r-this.rowHeaderLevelCount,0),Array.prototype.splice.apply(this._columnHeaderCellIds[t],e)}const a=this._columnWidths.splice(n.start.col,i);return a.unshift(r,0),Array.prototype.splice.apply(this._columnWidths,a),this.columnDimensionTree.movePosition(t.row,n.start.col-this.rowHeaderLevelCount,r-this.rowHeaderLevelCount),this.columnDimensionTree.reset(this.columnDimensionTree.tree.children,!0),this._CellHeaderPathMap=new Map,this._cellRangeMap=new Map,{sourceIndex:n.start.col,targetIndex:r,moveSize:i,moveType:"column"}}if(this.isRowHeader(t.col,t.row)){let i;const r=this.getCellHeaderPathsWidthTreeNode(t.col,t.row).rowHeaderPaths,o=this.getCellHeaderPathsWidthTreeNode(e.col,e.row).rowHeaderPaths,a=r[r.length-1],s=o[r.length-1],l=a.size;if(i=e.row>=t.row?s.startInTotal+s.size-l:s.startInTotal,i===t.row||i===n.end.row)return null;const h=this._rowHeaderCellIds.splice(n.start.row-this.columnHeaderLevelCount,l);return h.unshift(i,0),Array.prototype.splice.apply(this._rowHeaderCellIds,h),this.rowDimensionTree.movePosition(this.getCellHeaderPathsWidthTreeNode(t.col,t.row).rowHeaderPaths.length-1,n.start.row-this.columnHeaderLevelCount,i+(e.row>t.row?a.size-1:0)),this.rowDimensionTree.reset(this.rowDimensionTree.tree.children,!0),this._CellHeaderPathMap=new Map,this._cellRangeMap=new Map,{sourceIndex:n.start.row,targetIndex:i+this.columnHeaderLevelCount,moveSize:l,moveType:"row"}}}return null}getCellAdressByHeaderPath(t){let e,n;if(Array.isArray(t)){if(t.length>this.rowDimensionKeys.length+this.colDimensionKeys.length)return;e=t.filter((t=>this.colDimensionKeys.indexOf(t.dimensionKey)>=0)),n=t.filter((t=>this.rowDimensionKeys.indexOf(t.dimensionKey)>=0))}else e=t.colHeaderPaths,n=t.rowHeaderPaths;if(!Array.isArray(e)&&!Array.isArray(n))return;e?.sort(((t,e)=>this.colDimensionKeys.indexOf(t.dimensionKey??this.indicatorDimensionKey)-this.colDimensionKeys.indexOf(e.dimensionKey??this.indicatorDimensionKey))),n?.sort(((t,e)=>this.rowDimensionKeys.indexOf(t.dimensionKey??this.indicatorDimensionKey)-this.rowDimensionKeys.indexOf(e.dimensionKey??this.indicatorDimensionKey)));let i,r,o,a,s=!1;e?.length>=1&&n?.length>=1&&(s=!0);let l,h,u=this.rowTree,c=this.columnTree;if(e)for(let t=0;t<e.length;t++){const n=e[t];for(let t=0;t<c.length;t++){const e=c[t];if((k(n.dimensionKey)&&e.dimensionKey===n.dimensionKey||k(n.indicatorKey)&&e.indicatorKey===n.indicatorKey)&&e.value===n.value){c=e.children,s&&!c?h=e:s||(h=e);break}}}if(n)for(let t=0;t<n.length;t++){const e=n[t];for(let t=0;t<u.length;t++){const n=u[t];if((k(e.dimensionKey)&&n.dimensionKey===e.dimensionKey||k(e.indicatorKey)&&n.indicatorKey===e.indicatorKey)&&n.value===e.value){u=n.children,s&&!u?l=n:s||(l=n);break}}}if(!s||l&&h){if(l){r=this.columnHeaderLevelCount;const{startInTotal:t,level:e}=l;r+=t,o="grid"===this.rowHierarchyType?this.rowHeaderTitle?e+1:e:0}if(h){i=this.rowHeaderLevelCount;const{startInTotal:t,level:e}=h;i+=t,a=this.columnHeaderTitle?e+1:e}return k(i)||k(r)?{col:i??o,row:r??a}:void 0}}}class IR{_headerObjects=[];_headerObjectMap={};_indicatorObjects=[];rowsDefine;columnsDefine;indicatorsDefine;indicators;_showRowHeader=!0;_showColumnHeader=!0;_indicatorShowType="column";indicatorsAsCol=!0;hideIndicatorName=!1;indicatorDimensionKey;indicatorTitle;rowKeysPath;colKeysPath;convertColKeys;rows;columns;rowShowAttrs;colShowAttrs;tree;dataset;dataConfig;_rowCount;_colCount;_bodyRowCount;cornerSetting;_table;constructor(t,e){this._table=t,this.rowsDefine=t.options.rows??[],this.columnsDefine=t.options.columns??[],this.indicatorsDefine=t.options.indicators??[],this.indicatorTitle=t.options.indicatorTitle,this.dataset=e,this.dataConfig=e.dataConfig,this.indicators=e.indicators,this.indicatorsAsCol=t.options.indicatorsAsCol??!0,this.hideIndicatorName=t.options.hideIndicatorName??!1,this.indicatorDimensionKey=Re,this.cornerSetting=t.options.corner??{titleOnDimension:"column"},this.columns=e.columns,this.rows=e.rows,this.rowKeysPath=e.rowKeysPath,this.colKeysPath=e.colKeysPath,this.convertColKeys=C(this.colKeysPath),this.tree=e.tree,this.initState()}initState(){this.indicatorsAsCol&&!this.hideIndicatorName?this._indicatorShowType="column":this.indicatorsAsCol||this.hideIndicatorName?this._indicatorShowType="none":this._indicatorShowType="row",this.colShowAttrs="column"===this._indicatorShowType?this.columns.concat(this.indicatorDimensionKey):this.columns,this.rowShowAttrs="row"===this._indicatorShowType?this.rows.concat(this.indicatorDimensionKey):this.rows,this._colCount=(0===this.colKeysPath.length?1:this.colKeysPath.length)*(this.indicatorsAsCol?this.indicators.length:1)+this.rowHeaderLevelCount,this._rowCount=(0===this.rowKeysPath.length?1:this.rowKeysPath.length)*(this.indicatorsAsCol?1:this.indicators.length)+this.columnHeaderLevelCount,this._bodyRowCount=this.rowKeysPath.length*(this.indicatorsAsCol?1:this.indicators.length),this.initHeaderObjects(),this.initIndicatorObjects()}getDimensionInfo(t){return this.rowsDefine?.find((e=>"string"!=typeof e&&e.dimensionKey===t))??this.columnsDefine?.find((e=>"string"!=typeof e&&e.dimensionKey===t))}getIndicatorInfo(t,e=""){const n=this.indicatorsDefine?.find((n=>"string"!=typeof n&&(t?n.indicatorKey===t:!!e&&n.caption===e)));return n}initHeaderObjects(){for(let t=0,e=this.rowKeysPath.length;t<=e-1;t++){const e=this.rowKeysPath[t];for(let t=0,n=e.length;t<=n-1;t++)if(!this._headerObjectMap[e[t]]){const n=e[t].split(this.dataset.stringJoinChar),i=this.getDimensionInfo(this.rows[n.length-1]);this._headerObjectMap[e[t]]={id:e[t],field:i?.dimensionKey??this.rows[n.length-1],caption:n[n.length-1],style:i?.headerStyle,define:{field:i?.dimensionKey??this.rows[n.length-1],headerType:i?.headerType??"text",columnType:"text"},fieldFormat:i?.headerFormat,dropDownMenu:i?.dropDownMenu,headerType:i?.headerType??"text",width:i?.width},this._headerObjects.push(this._headerObjectMap[e[t]])}}for(let t=0,e=this.colKeysPath.length;t<=e-1;t++){const e=this.colKeysPath[t];for(let t=0,n=e.length;t<=n-1;t++)if(!this._headerObjectMap[e[t]]){const n=e[t].split(this.dataset.stringJoinChar),i=this.getDimensionInfo(this.columns[n.length-1]);this._headerObjectMap[e[t]]={id:e[t],field:i?.dimensionKey??this.columns[n.length-1],caption:n[n.length-1],style:i?.headerStyle,define:{field:i?.dimensionKey??this.columns[n.length-1],headerType:i?.headerType??"text",columnType:"text"},fieldFormat:i?.headerFormat,dropDownMenu:i?.dropDownMenu,headerType:i?.headerType??"text",width:i?.width},this._headerObjects.push(this._headerObjectMap[e[t]])}}let t;this.indicatorsDefine.forEach((t=>{const e="string"==typeof t?t:t.indicatorKey,n="string"==typeof t?void 0:t;this._headerObjectMap[e]||(this._headerObjectMap[e]={id:e,field:this.indicatorDimensionKey,caption:e,style:n?.headerStyle,define:{field:this.indicatorDimensionKey,headerType:n?.headerType??"text",columnType:"text"},dropDownMenu:n?.dropDownMenu,headerType:n?.headerType??"text",width:n?.width},this._headerObjects.push(this._headerObjectMap[e]))})),"column"===this.cornerSetting.titleOnDimension?t=this.colShowAttrs:"row"===this.cornerSetting.titleOnDimension&&(t=this.rowShowAttrs),t.forEach((t=>{if(!this._headerObjectMap[t]){const e=this.getDimensionInfo(t);this._headerObjectMap[t]={id:t,field:t,caption:t===this.indicatorDimensionKey?this.indicatorTitle:e?.dimensionTitle??t,style:this.cornerSetting?.headerStyle,define:{field:t,headerType:this.cornerSetting?.headerType??"text",columnType:"text"},dropDownMenu:e?.dropDownMenu,headerType:this.cornerSetting?.headerType??"text",width:e?.width},this._headerObjects.push(this._headerObjectMap[t])}}))}initIndicatorObjects(){this.indicators.forEach((t=>{const e=this.indicatorsDefine?.find((e=>"string"!=typeof e&&e.caption===t));this._indicatorObjects.push({id:t,indicatorKey:t,field:t,define:{field:t,headerType:"text",columnType:e?.columnType??"text"},fieldFormat:e?.format,columnType:e?.columnType??"text",style:e?.style})}))}get columnWidths(){const t=[];for(let e=0;e<this.rowHeaderLevelCount;e++){const n=this.getDimensionInfo(this.rowShowAttrs[e])??this.getIndicatorInfo(this.rowShowAttrs[e]);t.push({width:n?.width})}for(let e=0;e<this.colCount-this.rowHeaderLevelCount;e++){const n=this._indicatorObjects[e%this._indicatorObjects.length];t.push({width:n?.width})}return t}get showColumnHeader(){return this._showColumnHeader}set showColumnHeader(t){this._showColumnHeader=t}get showRowHeader(){return this._showRowHeader}set showRowHeader(t){this._showRowHeader=t}getCellType(t,e){return this.isCornerHeader(t,e)?"cornerHeader":this.isColumnHeader(t,e)?"columnHeader":this.isRowHeader(t,e)?"rowHeader":"body"}isHeader(t,e){return t<this.rowHeaderLevelCount||e<this.columnHeaderLevelCount}isCornerHeader(t,e){return t<this.rowHeaderLevelCount&&e<this.columnHeaderLevelCount}isColumnHeader(t,e){return t>=this.rowHeaderLevelCount&&e<this.columnHeaderLevelCount}isRowHeader(t,e){return t<this.rowHeaderLevelCount&&e>=this.columnHeaderLevelCount}isColumnIndicatorHeader(t,e){return"column"===this._indicatorShowType&&e===this.columnHeaderLevelCount-1&&t>=this.rowHeaderLevelCount}isRowIndicatorHeader(t,e){return"row"===this._indicatorShowType&&t===this.rowHeaderLevelCount-1&&e>=this.columnHeaderLevelCount}isIndicatorHeader(t,e){return this.isColumnIndicatorHeader(t,e)||this.isRowIndicatorHeader(t,e)}getColumnHeaderRange(){return{start:{col:this.rowHeaderLevelCount,row:0},end:{col:this.colCount-1,row:this.columnHeaderLevelCount-1}}}getRowHeaderRange(){return{start:{col:0,row:this.columnHeaderLevelCount},end:{col:this.rowHeaderLevelCount-1,row:this.rowCount-1}}}getCornerHeaderRange(){return{start:{col:0,row:0},end:{col:this.rowHeaderLevelCount-1,row:this.columnHeaderLevelCount-1}}}getBodyRange(){return{start:{col:this.rowHeaderLevelCount,row:this.columnHeaderLevelCount},end:{col:this.colCount-1,row:this.rowCount-1}}}resetCellIds(){}get headerLevelCount(){return this.columnHeaderLevelCount}get columnHeaderLevelCount(){const t=this.colShowAttrs.length;return this.showColumnHeader?t:0}get rowHeaderLevelCount(){const t=this.rowShowAttrs.length;return this.showRowHeader?t:0}get colCount(){return this._colCount}get rowCount(){return this._rowCount}get bodyRowCount(){return this._bodyRowCount}get headerObjects(){return this._headerObjects}get columnObjects(){return this._indicatorObjects}getCellId(t,e){if(e>=0&&t>=0)if(this.isCornerHeader(t,e)){if("column"===this.cornerSetting.titleOnDimension)return this.colShowAttrs[e];if("row"===this.cornerSetting.titleOnDimension)return this.rowShowAttrs[t]}else{if(this.isColumnHeader(t,e))return e<this.columns.length?this.convertColKeys[e][this.indicatorsAsCol?Math.floor((t-this.rowHeaderLevelCount)/this.indicators.length):t-this.rowHeaderLevelCount]:this.indicators[(t-this.rowHeaderLevelCount)%this.indicators.length];if(this.isRowHeader(t,e))return t<this.rows.length?this.rowKeysPath[this.indicatorsAsCol?e-this.columnHeaderLevelCount:Math.floor((e-this.columnHeaderLevelCount)/this.indicators.length)][t]:this.indicators[(e-this.columnHeaderLevelCount)%this.indicators.length]}return 0}getIndicatorName(t,e){if(this.isHeader(t,e))return"";if(this.indicatorsAsCol){const e=t-this.rowHeaderLevelCount;return this.indicators[e%this.indicators.length]}const n=e-this.columnHeaderLevelCount;return this.indicators[n%this.indicators.length]}getHeader(t,e){const n=this.getCellId(t,e);return this._headerObjectMap[n]}getHeaderField(t,e){const n=this.getCellId(t,e);return this._headerObjectMap[n]?.field||this.getBody(t,e)?.field}getHeaderFieldKey(t,e){}getHeaderCellAdress(t){}getHeaderCellAddressByField(t){throw new Error(`Method not implemented.${t}`)}getBody(t,e){let n;return n=this.indicatorsAsCol?this.getIndicatorInfo(this?.indicators?.[(t-this.rowHeaderLevelCount)%(this.indicators?.length??0)]):this.getIndicatorInfo(this?.indicators?.[(e-this.columnHeaderLevelCount)%(this.indicators?.length??0)]),{id:0,indicatorKey:this.indicators[(t-this.rowHeaderLevelCount)%(this.indicators?.length??0)],field:this.indicators[(t-this.rowHeaderLevelCount)%(this.indicators?.length??0)],columnType:n?.columnType??"text",style:n?.style,define:{field:this.indicators[(t-this.rowHeaderLevelCount)%(this.indicators?.length??0)],headerType:"text",columnType:n?.columnType??"text"}}}getBodyLayoutRangeById(t){for(let e=0;e<(this.colCount??0);e++)if(t===this.columnObjects[e].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){const n={start:{col:t,row:e},end:{col:t,row:e}};if(!this.isHeader(t,e)||-1===t||-1===e||this.isIndicatorHeader(t,e))return n;const i=this.getCellId(t,e);for(let r=t-1;r>=0&&i===this.getCellId(r,e);r--)n.start.col=r;for(let r=t+1;r<(this.colCount??0)&&i===this.getCellId(r,e);r++)n.end.col=r;for(let r=e-1;r>=0&&i===this.getCellId(t,r);r--)n.start.row=r;for(let r=e+1;r<(this.rowCount??0)&&i===this.getCellId(t,r);r++)n.end.row=r;return n}isCellRangeEqual(t,e,n,i){const r=this.getCellRange(t,e),o=this.getCellRange(n,i);return r.start.col===o.start.col&&r.end.col===o.end.col&&r.start.row===o.start.row&&r.end.row===o.end.row}getRecordIndexByRow(t){return t<this.columnHeaderLevelCount?-1:this.indicatorsAsCol?t-this.columnHeaderLevelCount:Math.floor((t-this.columnHeaderLevelCount)/this.indicators.length)}getRecordIndexByCol(t){return t<this.rowHeaderLevelCount?-1:this.indicatorsAsCol?Math.floor((t-this.rowHeaderLevelCount)/this.indicators.length):t-this.rowHeaderLevelCount}getRecordStartRowByRecordIndex(t){return this.columnHeaderLevelCount+t}getCellHeaderPaths(t,e){const n=this.getRecordIndexByCol(t),i=this.getRecordIndexByRow(e);let r,o,a,s;return n>=0&&(r=this.colKeysPath[n],a=r?.[r.length-1]?.split(this.dataset.stringJoinChar),e<this.columns.length-1&&(a=a.slice(0,e+1))),i>=0&&(o=this.rowKeysPath[i],s=o?.[o.length-1]?.split(this.dataset.stringJoinChar),t<this.rows.length-1&&(s=s.slice(0,t+1))),{colHeaderPaths:a.map((t=>{const e=this._indicatorObjects.find((t=>{t.indicatorKey}));return{dimensionKey:e?void 0:t,indicatorKey:e?t:void 0,value:t}}))??[],rowHeaderPaths:s.map((t=>{const e=this._indicatorObjects.find((t=>{t.indicatorKey}));return{dimensionKey:e?void 0:t,indicatorKey:e?t:void 0,value:t}}))??[]}}getHeaderDimension(t,e){if(this.isHeader(t,e)){const n=this.getHeader(t,e);return this.rowsDefine?.find((t=>"string"!=typeof t&&t.dimensionKey===n.field))??this.columnsDefine?.find((t=>"string"!=typeof t&&t.dimensionKey===n.field))}}updateDataset(t){this.dataset=t,this.dataConfig=t.dataConfig,this.rowKeysPath=t.rowKeysPath,this.colKeysPath=t.colKeysPath,this.convertColKeys=C(this.colKeysPath),this.tree=t.tree,this.initState()}isHeaderForColWidth(t,e){return this.isHeader(t,e)}getHeaderForColWidth(t,e){return this.getHeader(t,e)}}class DR{dataConfig;records;tree={};colFlatKeys={};rowFlatKeys={};stringJoinChar=String.fromCharCode(0);rowsIsTotal=[];colsIsTotal=[];colGrandTotalLabel;colSubTotalLabel;rowGrandTotalLabel;rowSubTotalLabel;constructor(t,e){if(this.dataConfig=t,e){this.records=e;const t="undefined"!=typeof window?window.performance.now():0;this.setRecords(e);const n="undefined"!=typeof window?window.performance.now():0;console.log("processRecords:",n-t)}delete this.rowFlatKeys,delete this.colFlatKeys}setRecords(t){this.processRecords()}processRecords(){for(let t=0,e=this.records.length;t<e;t++){const e=this.records[t];this.processRecord(e)}}processRecord(t){const e=[],n=[];for(let e=0,i=this.dataConfig.rows.length;e<i;e++){const i=this.dataConfig.rows[e];void 0!==t[i]&&i!==this.dataConfig.indicatorDimensionKey&&n.push(t[i])}for(let n=0,i=this.dataConfig.columns.length;n<i;n++){const i=this.dataConfig.columns[n];void 0!==t[i]&&i!==this.dataConfig.indicatorDimensionKey&&e.push(t[i])}this.dataConfig.indicators.forEach((i=>{const r=t[i];void 0!==r&&(this.dataConfig.indicatorsAsCol?e.push(i):n.push(i));const o=n.join(this.stringJoinChar),a=e.join(this.stringJoinChar);0!==n.length&&(this.rowFlatKeys[o]||(this.rowFlatKeys[o]=1)),0!==e.length&&(this.colFlatKeys[a]||(this.colFlatKeys[a]=1)),0===e.length&&0===n.length||(this.tree[o]||(this.tree[o]={}),void 0!==r&&(this.tree[o][a]={value:r,record:t},this.dataConfig.indicatorsAsCol?e.pop():n.pop()))}))}getTreeNode(t=[],e=[],n){let i,r;if("string"==typeof t)i=t;else{let e=!1;t.map(((i,r)=>{i===n&&(t.splice(r,1),e=!0)})),e&&t.push(n),i=t.join(this.stringJoinChar)}if("string"==typeof e)r=e;else{let t=!1;e.map(((i,r)=>{i===n&&(e.splice(r,1),t=!0)})),t&&e.push(n),r=e.join(this.stringJoinChar)}return this.tree?.[i]?.[r]??void 0}}class WR{dataConfig;records;tree={};colFlatKeys={};rowFlatKeys={};colKeys=[];rowKeys=[];rowKeysPath;colKeysPath;rowOrder="key_a_to_z";colOrder="key_a_to_z";sorted=!1;sortRules;filterRules;aggregationRules;derivedFieldRules;mappingRules;totals;indicatorStatistics=[];aggregators={};stringJoinChar=String.fromCharCode(0);rowsIsTotal=[];colsIsTotal=[];colGrandTotalLabel;colSubTotalLabel;rowGrandTotalLabel;rowSubTotalLabel;rows;columns;indicators;constructor(t,e,n,i,r){this.registerAggregators(),this.dataConfig=t,this.sortRules=this.dataConfig.sortRules,this.aggregationRules=this.dataConfig.aggregationRules,this.derivedFieldRules=this.dataConfig.derivedFieldRules,this.mappingRules=this.dataConfig.mappingRules,this.totals=t.totals,this.rows=e,this.columns=n,this.indicators=i,this.colGrandTotalLabel=this.totals?.column?.grandTotalLabel??"总计",this.colSubTotalLabel=this.totals?.column?.subTotalLabel??"小计",this.rowGrandTotalLabel=this.totals?.row?.grandTotalLabel??"总计",this.rowSubTotalLabel=this.totals?.row?.subTotalLabel??"小计",this.rowsIsTotal=new Array(this.rows.length).fill(!1),this.colsIsTotal=new Array(this.columns.length).fill(!1);for(let t=0,e=this.totals?.row?.subTotalsDimensions?.length;t<e;t++){const e=this.totals.row.subTotalsDimensions[t],n=this.rows.indexOf(e);this.rowsIsTotal[n]=!0}for(let t=0,e=this.totals?.column?.subTotalsDimensions?.length;t<e;t++){const e=this.totals.column.subTotalsDimensions[t],n=this.columns.indexOf(e);this.colsIsTotal[n]=!0}if(r){this.records=r;const t="undefined"!=typeof window?window.performance.now():0;this.setRecords(r);const e="undefined"!=typeof window?window.performance.now():0;console.log("processRecords:",e-t);const n="undefined"!=typeof window?window.performance.now():0;this.totalStatistics();const i="undefined"!=typeof window?window.performance.now():0;console.log("totalStatistics:",i-n);const o="undefined"!=typeof window?window.performance.now():0;this.sortKeys();const a="undefined"!=typeof window?window.performance.now():0;console.log("sortKeys:",a-o);const s="undefined"!=typeof window?window.performance.now():0;this.rowKeysPath=this.TreeToArr(this.ArrToTree(this.rowKeys,this.rowsIsTotal,this?.totals?.row?.showGrandTotals||0===this.columns.length,this.rowGrandTotalLabel,this.rowSubTotalLabel)),this.colKeysPath=this.TreeToArr(this.ArrToTree(this.colKeys,this.colsIsTotal,this.totals?.column?.showGrandTotals||0===this.rows.length,this.colGrandTotalLabel,this.colSubTotalLabel));const l="undefined"!=typeof window?window.performance.now():0;console.log("TreeToArr:",l-s)}delete this.rowFlatKeys,delete this.colFlatKeys}registerAggregator(t,e){this.aggregators[t]=e}registerAggregators(){this.registerAggregator(o.SUM,zR),this.registerAggregator(o.COUNT,jR),this.registerAggregator(o.MAX,GR),this.registerAggregator(o.MIN,UR),this.registerAggregator(o.AVG,NR)}setRecords(t){this.processRecords()}processRecords(){for(let t=0,e=this.records.length;t<e;t++){const e=this.records[t];this.filterRecord(e)&&this.processRecord(e)}}filterRecord(t){let e=!0;for(let n=0;n<this.dataConfig.filterRules?.length;n++){const i=this.dataConfig.filterRules[n];if(!i.filterFunc?.(t)){e=!1;break}}return e}processRecord(t){this.derivedFieldRules?.forEach(((e,n)=>{t[e.fieldName]=e.derivedFunc(t)}));const e=[],n=[];for(let e=0,i=this.rows.length;e<i;e++){const i=this.rows[e];n.push(t[i])}for(let n=0,i=this.columns.length;n<i;n++){const i=this.columns[n];e.push(t[i])}const i=n.join(this.stringJoinChar),r=e.join(this.stringJoinChar);if(0!==n.length&&(this.rowFlatKeys[i]||(this.rowKeys.push(n),this.rowFlatKeys[i]=1)),0!==e.length&&(this.colFlatKeys[r]||(this.colKeys.push(e),this.colFlatKeys[r]=1)),0!==e.length||0!==n.length){this.tree[i]||(this.tree[i]={}),this.tree[i]?.[r]||(this.tree[i][r]=[]);for(let e=0;e<this.indicators.length;e++){if(!this.tree[i]?.[r]?.[e]){const t=this.getAggregatorRule(this.indicators[e]);this.tree[i][r][e]=new this.aggregators[t?.aggregationType??o.SUM](t?.field??this.indicators[e],t?.formatFun)}this.tree[i]?.[r]?.[e].push(t)}}if(this.mappingRules)for(let e=0;e<this.indicators.length;e++){if(!this.indicatorStatistics[e]){const t=this.getAggregatorRule(this.indicators[e]);this.indicatorStatistics[e]={max:new this.aggregators[o.MAX](this.indicators[e]),min:new this.aggregators[o.MIN](this.indicators[e]),total:new this.aggregators[t?.aggregationType??o.SUM](t?.field??this.indicators[e],t?.formatFun)}}this.indicatorStatistics[e].max.push(this.tree[i]?.[r]?.[e].value()),this.indicatorStatistics[e].min.push(this.tree[i]?.[r]?.[e].value()),this.indicatorStatistics[e].total.push(t)}}updateSortRules(t){this.sorted=!1,this.sortRules=t,this.sortKeys(),this.rowKeysPath=this.TreeToArr(this.ArrToTree(this.rowKeys,this.rowsIsTotal,this?.totals?.row?.showGrandTotals||0===this.columns.length,this.rowGrandTotalLabel,this.rowSubTotalLabel)),this.colKeysPath=this.TreeToArr(this.ArrToTree(this.colKeys,this.colsIsTotal,this.totals?.column?.showGrandTotals||0===this.rows.length,this.colGrandTotalLabel,this.colSubTotalLabel))}getAggregatorRule(t){return this.aggregationRules?.find(((e,n)=>t===e.indicatorKey))}getAggregator(t=[],e=[],n){const i=this.indicators.indexOf(n);let r,o,a;return o="string"==typeof t?t:t.join(this.stringJoinChar),a="string"==typeof e?e:e.join(this.stringJoinChar),0===t.length&&0===e.length||(r=this.tree[o]?.[a]?.[i]),r||{className:"",push(){},value:()=>null,formatValue:()=>""}}sortKeys(){const t=this;if(!this.sorted){this.sorted=!0;const e=function(e,n){return t.getAggregator(e,n,"").value()};switch(this.rowOrder){case"value_a_to_z":this.rowKeys.sort((function(t,n){return VR(e(t,[]),e(n,[]))}));break;case"value_z_to_a":this.rowKeys.sort((function(t,n){return-VR(e(t,[]),e(n,[]))}));break;default:this.rowKeys.sort(this.arrSort(this.rows,!0))}switch(this.colOrder){case"value_a_to_z":this.colKeys.sort((function(t,n){return VR(e([],t),e([],n))}));break;case"value_z_to_a":this.colKeys.sort((function(t,n){return-VR(e([],t),e([],n))}));break;default:const t=this.arrSort(this.columns,!1);this.colKeys.sort(t)}}}arrSort(t,e){let n;const i=this,r=function(r){const o=[];for(let r=0,a=t.length;r<a;r++){n=t[r];let a=!1;if(i.sortRules)for(let t=0,s=i.sortRules.length;t<s;t++)i.sortRules[t].sortField===n&&(a=!0,o.push({field:n,fieldIndex:r,sortRule:i.sortRules[t],func:i.getSort(i.sortRules[t],e)}));a||o.push({field:n,fieldIndex:r,func:VR})}return o}.call(this);return function(n,o){let s,l;for(let h=0;h<r.length;h++){if(l=r[h],l.sortRule?.sortByIndicator){let r=n,a=o;l.fieldIndex<t.length-1&&(r=n.slice(0,l.fieldIndex+1),r.push(e?i.totals?.row?.subTotalLabel:i.totals?.column?.subTotalLabel),a=o.slice(0,l.fieldIndex+1),a.push(e?i.totals?.row?.subTotalLabel:i.totals?.column?.subTotalLabel)),s=l.func(r,a)}else s=l.func(n[l.fieldIndex],o[l.fieldIndex]);if(0!==s)return s*(l.sortRule?.sortType===a.DESC?-1:1)}return 0}}getSort(t,e){const n=this;return t.sortByIndicator?(i,r)=>{const o=function(e,i){return e.length<n.rows.length&&e[e.length-1]!==n.rowSubTotalLabel&&e[e.length-1]!==n.rowGrandTotalLabel&&e.push(n.rowSubTotalLabel),i.length<n.columns.length&&i[i.length-1]!==n.colSubTotalLabel&&i[i.length-1]!==n.colGrandTotalLabel&&i.push(n.colSubTotalLabel),n.getAggregator(e,i,t.sortByIndicator).value()};return e?VR(o(i,t.query),o(r,t.query)):VR(o(t.query,i),o(t.query,r))}:t.sortBy?function(t){let e;const n={},i={};for(let r=0;r<t.length;r++)e=t[r],n[e]=r,"string"==typeof e&&(i[e.toLowerCase()]=r);return function(t,e){return null!==n[t]&&void 0!==n[t]&&null!==n[e]&&void 0!==n[e]?n[t]-n[e]:null!==n[t]&&void 0!==n[t]?-1:null!==n[e]&&void 0!==n[e]?1:null!==i[t]&&void 0!==n[t]&&null!==i[e]&&void 0!==n[e]?i[t]-i[e]:null===i[t]||void 0===n[t]||null===i[e]||void 0===n[e]?0:null!==i[t]&&void 0!==n[t]?-1:null!==i[e]&&void 0!==n[e]?1:VR(t,e)}}(t.sortBy):t.sortType?KR:t.sortFunc?t.sortFunc:VR}totalStatistics(){const t=this;if(t?.totals?.column?.showSubTotals&&t?.totals?.column?.subTotalsDimensions?.length>=1||t?.totals?.row?.showSubTotals&&t?.totals?.row?.subTotalsDimensions?.length>=1||t?.totals?.column?.showGrandTotals||t?.totals?.row?.showGrandTotals||0===t.rows.length||0===t.columns.length){const e=[],n=(e,n)=>{const i=n.split(this.stringJoinChar);for(let r=0,a=t.totals?.column?.subTotalsDimensions?.length;r<a;r++){const a=t.totals.column.subTotalsDimensions[r],s=t.columns.indexOf(a);if(s>=0){const r=i.slice(0,s+1);r.push(t.totals?.column?.subTotalLabel??"小计");const a=r.join(this.stringJoinChar);this.tree[e][a]||(this.tree[e][a]=[]);for(let i=0;i<this.indicators.length;i++){if(!this.tree[e][a][i]){const t=this.getAggregatorRule(this.indicators[i]);this.tree[e][a][i]=new this.aggregators[t?.aggregationType??o.SUM](t?.field??this.indicators[i],t?.formatFun)}this.tree[e][a][i].push(t.tree[e]?.[n]?.[i])}}}if(t.totals?.column?.showGrandTotals||0===this.rows.length){const i=t.colGrandTotalLabel;this.tree[e][i]||(this.tree[e][i]=[]);for(let r=0;r<this.indicators.length;r++){if(!this.tree[e][i][r]){const t=this.getAggregatorRule(this.indicators[r]);this.tree[e][i][r]=new this.aggregators[t?.aggregationType??o.SUM](t?.field??this.indicators[r],t?.formatFun)}this.tree[e][i][r].push(t.tree[e]?.[n]?.[r])}}};Object.keys(t.tree).forEach((i=>{const r=i.split(this.stringJoinChar);Object.keys(t.tree[i]).forEach((a=>{for(let s=0,l=t.totals?.row?.subTotalsDimensions?.length;s<l;s++){const l=t.totals.row.subTotalsDimensions[s],h=t.rows.indexOf(l);if(h>=0){const n=r.slice(0,h+1);n.push(t.totals?.row?.subTotalLabel??"小计");const s=n.join(this.stringJoinChar);if(this.tree[s]||(this.tree[s]={},e.push(s)),!this.tree[s][a]){this.tree[s][a]=[];for(let e=0;e<this.indicators.length;e++){if(!this.tree[s][a][e]){const t=this.getAggregatorRule(this.indicators[e]);this.tree[s][a][e]=new this.aggregators[t?.aggregationType??o.SUM](t?.field??this.indicators[e],t?.formatFun)}this.tree[s][a][e].push(t.tree[i]?.[a]?.[e])}}}if(t.totals?.row?.showGrandTotals||0===this.columns.length){const n=t.rowGrandTotalLabel;this.tree[n]||(this.tree[n]={},e.push(n)),this.tree[n][a]||(this.tree[n][a]=[]);for(let e=0;e<this.indicators.length;e++){if(!this.tree[n][a][e]){const t=this.getAggregatorRule(this.indicators[e]);this.tree[n][a][e]=new this.aggregators[t?.aggregationType??o.SUM](t?.field??this.indicators[e],t?.formatFun)}this.tree[n][a][e].push(t.tree[i]?.[a]?.[e])}}n(i,a)}}))})),e.forEach((e=>{Object.keys(t.tree[e]).forEach((t=>{n(e,t)}))}))}}ArrToTree(t,e,n,i,r){const o=[],a=this.stringJoinChar,s=new Map;if(t.forEach((t=>function(t){const n=[];let i;t.forEach(((l,h)=>{n.push(l);const u=n.join(a);let c=s.get(u);if(!c){if(c={id:u,child:[]},e[h]){let e=c.child;for(let n=h;n<t.length-1;n++){const t={id:`${u}${a}${r}`,child:[]};e.push(t),e=t.child}}s.set(u,c),i?e[h-1]?i.child.splice(i.child.length-1,0,c):i.child.push(c):o.push(c)}i=c}))}(t))),n){const t={id:i,child:[]};let n=t.child;for(let t=1;t<e.length;t++){const t={id:i,child:[]};n.push(t),n=t.child}o.push(t)}return o}TreeToArr(t){const e=[];function n(t,i){i.push(t.id),t.child.length>0?t.child?.forEach((t=>n(t,[...i]))):e.push(i)}return t.forEach((t=>n(t,[]))),e}}class FR{className="Aggregator";isRecord=!0;records=[];type;field;formatFun;_formatedValue;constructor(t,e,n){this.field=t,this.formatFun=e,this.isRecord=n??this.isRecord}formatValue(){return this._formatedValue||(this.formatFun?this._formatedValue=this.formatFun(this.value()):this._formatedValue=this.value()),this._formatedValue}}class zR extends FR{type=o.SUM;sum=0;push(t){this.isRecord&&("Aggregator"===t.className?this.records.push(...t.records):this.records.push(t)),"Aggregator"===t.className?this.sum+=t.value():isNaN(parseFloat(t[this.field]))||(this.sum+=parseFloat(t[this.field]))}value(){return this.sum}}class jR extends FR{type=o.COUNT;count=0;push(t){this.isRecord&&("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}}class NR extends FR{type=o.AVG;sum=0;count=0;push(t){this.isRecord&&("Aggregator"===t.className?this.records.push(...t.records):this.records.push(t)),"Aggregator"===t.className&&t.type===o.AVG?(this.sum+=t.sum,this.count+=t.count):isNaN(parseFloat(t[this.field]))||(this.sum+=parseFloat(t[this.field]),this.count++)}value(){return this.sum/this.count}}class GR extends FR{type=o.MAX;max=Number.MIN_SAFE_INTEGER;isRecord=!1;push(t){this.isRecord&&("Aggregator"===t.className?this.records.push(...t.records):this.records.push(t)),"number"==typeof t?this.max=t>this.max?t:this.max:"number"==typeof t[this.field]?this.max=t[this.field]>this.max?t[this.field]:this.max:isNaN(t[this.field])||(this.max=parseFloat(t[this.field])>this.max?parseFloat(t[this.field]):this.max)}value(){return this.max}}class UR extends FR{type=o.MIN;min=Number.MAX_SAFE_INTEGER;isRecord=!1;push(t){this.isRecord&&("Aggregator"===t.className?this.records.push(...t.records):this.records.push(t)),"number"==typeof t?this.min=t<this.min?t:this.min:"number"==typeof t[this.field]&&(this.min=t[this.field]<this.min?t[this.field]:this.min)}value(){return this.min}}function KR(t,e){return t&&e?t.toString().localeCompare(e.toString(),"zh"):t?1:-1}function VR(t,e){const n=/(\d+)|(\D+)/g,i=/\d/,r=/^0/;let o,a,s,l,h=0,u=0;if(null!==e&&null===t)return-1;if(null!==t&&null===e)return 1;if("number"==typeof t&&isNaN(t))return-1;if("number"==typeof e&&isNaN(e))return 1;if(h=+t,u=+e,h<u)return-1;if(h>u)return 1;if("number"==typeof t&&"number"!=typeof e)return-1;if("number"==typeof e&&"number"!=typeof t)return 1;if("number"==typeof t&&"number"==typeof e)return 0;if(isNaN(u)&&!isNaN(h))return-1;if(isNaN(h)&&!isNaN(u))return 1;if(o=String(t),s=String(e),o===s)return 0;if(!i.test(o)||!i.test(s))return o>s?1:-1;for(o=o.match(n),s=s.match(n);o.length&&s.length;)if(a=o.shift(),l=s.shift(),a!==l)return i.test(a)&&i.test(l)?a.replace(r,".0")-l.replace(r,".0"):a>l?1:-1;return o.length-s.length}class YR{type;id;x=0;y=0;width=0;height=0;marginLeft;marginRight;marginTop;marginBottom;layoutWidth;layoutHeight;dx=0;dy=0;background;constructor(t){this.id=t.id,this.marginLeft=t.marginLeft??0,this.marginRight=t.marginRight??0,this.marginTop=t.marginTop??0,this.marginBottom=t.marginBottom??0,this.background=t.background||void 0}getSize(t){this.initLayoutSize()}initLayoutSize(){this.layoutWidth=this.width+this.marginLeft+this.marginRight,this.layoutHeight=this.height+this.marginTop+this.marginBottom,this.background&&(this.layoutWidth+=2*(this.background.expandX||0),this.layoutHeight+=2*(this.background.expandY||0)),this.dx=this.marginLeft,this.dy=this.marginTop}}const XR={row:{x:"x",y:"y",width:"width",height:"height",layoutWidth:"layoutWidth",layoutHeight:"layoutHeight",widthLimit:"widthLimit",heightLimit:"heightLimit",parentX:"parentX",parentY:"parentY",dx:"dx",dy:"dy"},column:{x:"y",y:"x",width:"height",height:"width",layoutWidth:"layoutHeight",layoutHeight:"layoutWidth",widthLimit:"heightLimit",heightLimit:"widthLimit",parentX:"parentY",parentY:"parentX",dx:"dy",dy:"dx"}};class $R{width=0;height=0;y=0;x=0;children=[];addAble=!0;widthLimit=0;heightLimit=0;direction;directionKey;offsetX=0;justifyContent;alignItems;constructor(t,e,n,i){this.direction=e,this.directionKey=XR[this.direction],this.justifyContent=n,this.alignItems=i,this[this.directionKey.widthLimit]=t}add(t){t[this.directionKey.x]=this[this.directionKey.width],this[this.directionKey.width]+=t[this.directionKey.layoutWidth],this.children.push(t),this.updateHeight(t)}canAdd(t){return!(this[this.directionKey.width]+t[this.directionKey.layoutWidth]>this[this.directionKey.widthLimit])}updateHeight(t){t[this.directionKey.layoutHeight]>this[this.directionKey.height]&&(this[this.directionKey.height]=t[this.directionKey.layoutHeight])}lineFinish(){this.updateXAlign()}updateXAlign(){const t=this[this.directionKey.widthLimit]-this[this.directionKey.width];"center"===this.justifyContent?this.offsetX=t/2:"start"===this.justifyContent?this.offsetX=0:this.offsetX=t}getOffsetY(t){switch(this.alignItems){case"start":default:return 0;case"center":return(this[this.directionKey.height]-t[this.directionKey.layoutHeight])/2;case"end":return this[this.directionKey.height]-t[this.directionKey.layoutHeight]}}getContentSize(){const t={width:0,height:0};for(let e=0;e<this.children.length;e++){const n=this.children[e];let i;i="container"===n.type?n.getContentSize():{width:n.layoutWidth,height:n.layoutHeight},t[this.directionKey.height]<i[this.directionKey.height]&&(t[this.directionKey.height]=i[this.directionKey.height]),t[this.directionKey.width]+=i[this.directionKey.width]}return t}getElements(t={parentX:0,parentY:0},e=!1,n=!1){const i=[];for(let r=0;r<this.children.length;r++){const o=this.children[r];if("container"===o.type||"group-element"===o.type){const r=o.getElements({[this.directionKey.parentX]:this.offsetX+this[this.directionKey.x]+t.parentX,[this.directionKey.parentY]:this.getOffsetY(o)+this[this.directionKey.y]+t.parentY},e,n);i.push(...r)}else{if("icon"===o.type&&("mouseenter_cell"===o.cache?.visibleTime&&!e||"click_cell"===o.cache?.visibleTime&&!n))continue;o[this.directionKey.x]+=this.offsetX+this[this.directionKey.x]+t.parentX,o[this.directionKey.y]+=this.getOffsetY(o)+this[this.directionKey.y]+t.parentY,i.push(o)}}return i}}class qR extends YR{type="rect";lineWidth;cornerRadius;radius;fill;stroke;constructor(t){super(t),this.width=t.width,this.height=t.height,this.lineWidth=t.lineWidth||0,this.cornerRadius=t.cornerRadius||0,this.radius=this.cornerRadius,this.fill=t.fill||"#777",this.stroke=t.stroke||void 0,this.initLayoutSize()}}var ZR=Object.freeze({__proto__:null,Circle:class extends YR{type="circle";radius;radian;lineWidth;fill;stroke;constructor(t){super(t),this.radius=t.radius,this.radian=t.radian,this.lineWidth=t.lineWidth,this.fill=t.fill,this.stroke=t.stroke,this.width=2*this.radius,this.height=2*this.radius,this.initLayoutSize(),this.dx+=this.radius,this.dy+=this.radius}},Container:class extends YR{type="container";_widthObj;_heightObj;needCalcSize=!1;direction;justifyContent;alignItems;alignContent;lines=[];currentLine;currentLineY=0;table;directionKey;showBounds;offsetY=0;isRoot;constructor(t){super(t),this.direction=t.direction||"row",this.justifyContent=t.justifyContent||"start",this.alignItems=t.alignItems||"start",this.alignContent=t.alignContent||"start",g(t.width)?this.width=t.width:(this._widthObj=t.width,this.needCalcSize=!0),g(t.height)?this.height=t.height:(this._heightObj=t.height,this.needCalcSize=!0),this.directionKey=XR[this.direction],this.showBounds=t.showBounds||!1,this.initLayoutSize()}add(t){if(this.needCalcSize)throw new Error("Need to specify a parent element before adding a child element when use percent size!");"container"===t.type&&t.calcSize(this.width,this.height),this.currentLine&&this.currentLine.canAdd(t)?this.currentLine.add(t):(this.currentLine&&(this.currentLine.addAble=!1,this.currentLineY+=this.currentLine[this.directionKey.height],this.currentLine.lineFinish()),this.currentLine=new $R(this[this.directionKey.width],this.direction,this.justifyContent,this.alignItems),this.currentLine[this.directionKey.y]=this.currentLineY,this.currentLine.add(t),this.lines.push(this.currentLine))}updateYAlign(){const t=this[this.directionKey.height]-this.currentLineY;"center"===this.alignContent?this.offsetY=t/2:"start"===this.alignContent?this.offsetY=0:this.offsetY=t}getSize(){const t={width:0,height:0};this.currentLine&&this.currentLine.addAble?t[this.directionKey.height]=this.currentLineY+this.currentLine[this.directionKey.height]:t[this.directionKey.height]=this.currentLineY;for(let e=0;e<this.lines.length;e++){const n=this.lines[e];t[this.directionKey.width]<n[this.directionKey.width]&&(t[this.directionKey.width]=n[this.directionKey.width])}return t}getContentSize(){const t={width:0,height:0},e={width:!0,height:!0};this.isRoot||this._heightObj||(e.height=!1,t.height=this.height),this.isRoot||this._widthObj||(e.width=!1,t.width=this.width);for(let n=0;n<this.lines.length;n++){const i=this.lines[n].getContentSize();e[this.directionKey.width]&&t[this.directionKey.width]<i[this.directionKey.width]&&(t[this.directionKey.width]=i[this.directionKey.width]),e[this.directionKey.height]&&(t[this.directionKey.height]+=i[this.directionKey.height])}return t}calcSize(t,e){this._heightObj&&(this.height=e*this._heightObj.percent/100+this._heightObj.delta,this.needCalcSize=!1,this.initLayoutSize()),this._widthObj&&(this.width=t*this._widthObj.percent/100+this._widthObj.delta,this.needCalcSize=!1,this.initLayoutSize())}getElements(t={parentX:0,parentY:0},e=!1,n=!1){this.currentLine&&this.currentLine.addAble&&(this.currentLine.addAble=!1,this.currentLineY+=this.currentLine[this.directionKey.height],this.currentLine.lineFinish()),this.updateYAlign();const i=[];if(this.showBounds){const e=new qR({width:this.width,height:this.height,cornerRadius:0,stroke:"red",fill:"rgba(255, 0, 0, 0.2)",lineWidth:4});e.x+=this.x+t.parentX,e.y+=this.y+t.parentY,i.push(e)}for(let r=0;r<this.lines.length;r++){const o=this.lines[r];o[this.directionKey.y]+=this.offsetY;const a=o.getElements({[this.directionKey.parentX]:this.x+t.parentX,[this.directionKey.parentY]:this.y+t.parentY},e,n);i.push(...a)}return i}},GroupElement:class extends YR{type="group-element";direction;alignItems;width=0;height=0;children=[];directionKey;constructor(t){super(t),this.direction=t.direction||"row",this.alignItems=t.alignItems||"start",this.directionKey=XR[this.direction]}add(t){t.x=this.width,this.width+=t.layoutWidth,this.children.push(t),this.updateHeight(t),this.initLayoutSize()}updateHeight(t){t.layoutHeight>this.height&&(this.height=t.layoutHeight)}getOffsetY(t){switch(this.alignItems){case"start":default:return 0;case"center":return(this[this.directionKey.height]-t[this.directionKey.layoutHeight])/2;case"end":return this[this.directionKey.height]-t[this.directionKey.layoutHeight]}}getElements(t={parentX:0,parentY:0},e=!1,n=!1){const i=[];for(let r=0;r<this.children.length;r++){const o=this.children[r];"icon"===o.type&&("mouseenter_cell"===o.cache?.visibleTime&&!e||"click_cell"===o.cache?.visibleTime&&!n)||(o[this.directionKey.x]+=this[this.directionKey.dx]+this[this.directionKey.x]+t.parentX,o[this.directionKey.y]+=this.getOffsetY(o)+this[this.directionKey.dy]+this[this.directionKey.y]+t.parentY,i.push(o))}return i}},Icon:class extends YR{type="icon";svg;iconName;cursor;cache;constructor(t){if(super(t),this.iconName=t.iconName,p(this.iconName)){const t=aS()[this.iconName];t&&(this.cache=t,this.width=t.width,this.height=t.height,this.svg=t.svg,this.cursor=t.cursor)}this.width=t.width??this.width,this.height=t.height??this.height,this.svg=t.svg??this.svg,this.initLayoutSize()}},Image:class extends YR{type="image";src;cursor;cache;shape;constructor(t){super(t),this.width=t.width??this.width,this.height=t.height??this.height,this.src=t.src??this.src,this.shape=t.shape??this.shape,this.initLayoutSize()}},Rect:qR,Sector:class extends YR{type="arc";radius;startDegree=0;endDegree=360;clockWise=!0;lineWidth;fill;stroke;constructor(t){super(t),this.radius=t.radius,this.startDegree=t.startDegree,this.endDegree=t.endDegree,this.clockWise=t.clockWise,this.lineWidth=t.lineWidth,this.fill=t.fill,this.stroke=t.stroke,this.width=2*this.radius,this.height=2*this.radius,this.initLayoutSize(),this.dx+=this.radius,this.dy+=this.radius}},Text:class extends YR{type="text";text;fontSize;fontFamily;fill;textBaseline="top";textAlign="left";constructor(t){super(t),this.text=t.text,this.fontSize=t.fontSize||12,this.fontFamily=t.fontFamily||"sans-serif",this.fill=t.fill||"black"}getSize(t){const{width:e,height:n}=t.measureText(this.text,{fontSize:this.fontSize,fontFamily:this.fontFamily});this.width=e,this.height=n,this.initLayoutSize(),this.background&&(this.dx+=this.background.expandX||0,this.dy+=this.background.expandY||0)}},percentCalc:function(t,e=0){return{percent:t,delta:e}}});t.CustomLayout=ZR,t.DataStatistics=TR,t.ListTable=class extends _R{showHeader=!0;constructor(t={}){super(t);const e=this.internalProps;this.pagerConf=t.pagerConf,e.sortState=t.sortState,e.columns=t.columns?b(t.columns):t.header?b(t.header):[],this.showHeader=t.showHeader??!0,this.transpose=t.transpose??!1,this.refreshHeader(),t.dataSource?K_(this,t.dataSource):t.records?this.setRecords(t.records,e.sortState):this.setRecords([])}isListTable(){return!0}isPivotTable(){return!1}get sortState(){return this.internalProps.sortState}set sortState(t){this.internalProps.sortState=t}get columns(){return this.internalProps.columns}set columns(t){this.internalProps.columns=t,this.options.columns=t,this.refreshHeader(),setTimeout((()=>{this.invalidate()}),0)}get header(){return this.internalProps.columns}set header(t){this.internalProps.columns=t,this.options.header=t,this.refreshHeader(),setTimeout((()=>{this.invalidate()}),0)}get transpose(){return this.internalProps.transpose??!1}set transpose(t){this.internalProps.transpose!==t&&(this.internalProps.transpose=t,this.options.transpose=t,this.internalProps.layoutMap&&(this.internalProps.layoutMap.transpose=t,this.refreshRowColCount(),this._resetFrozenColCount(),this.invalidate()))}getCellValue(t,e){const n=this;if(n.internalProps.layoutMap.isHeader(t,e)){const{caption:i}=n.internalProps.layoutMap.getHeader(t,e);return"function"==typeof i?i():i}const{field:i,fieldFormat:r}=n.internalProps.layoutMap.getBody(t,e);return n.getFieldData(r||i,t,e)}getCellOriginValue(t,e){const n=this;if(n.internalProps.layoutMap.isHeader(t,e)){const{caption:i}=n.internalProps.layoutMap.getHeader(t,e);return"function"==typeof i?i():i}const{field:i}=n.internalProps.layoutMap.getBody(t,e);return n.getFieldData(i,t,e)}getRecordIndexByRow(t,e){const{layoutMap:n}=this.internalProps;return n.getRecordIndexByRow(t,e)}getCellOriginRecord(t,e){const n=this,i=n.getRecordIndexByRow(t,e);if(i>-1)return n.dataSource.get(i)}_canResizeColumn(t,e){const n=super._canResizeColumn(t,e);if(n&&!this.transpose){const e=this.internalProps.layoutMap.getBody(t,this.columnHeaderLevelCount);if(e?.disableColumnResize)return!1}return n}updateOption(t,e=!1){const n=this.internalProps;return super.updateOption(t),this.pagerConf=t.pagerConf,this.showHeader=t.showHeader??!0,n.columns=t.columns?b(t.columns):t.header?b(t.header):[],this.transpose=t.transpose??!1,this.refreshHeader(),n.disposables&&(n.disposables.forEach((t=>t?.dispose?.())),n.disposables=null),this._updateSize(),t.dataSource?K_(this,t.dataSource):t.records?this.setRecords(t.records,t.sortState):this._resetFrozenColCount(),new Promise((t=>{setTimeout(t,0)}))}refreshHeader(){const t=this,e=t.internalProps,n=t.transpose,i=t.showHeader;e.headerEvents&&e.headerEvents.forEach((e=>t.unlisten(e)));const r=e.layoutMap=new PR(this,e.columns??[],i,t.options.hierarchyIndent);r.transpose=n;for(let e=0;e<r.columnWidths.length;e++){const{width:n,minWidth:i,maxWidth:o}=r.columnWidths?.[e]??{};n&&("string"==typeof n&&"auto"!==n||"number"==typeof n&&n>0)&&t.setColWidth(e,n),i&&("number"==typeof i&&i>0||"string"==typeof i)&&t.setMinColWidth(e,i),o&&("number"==typeof o&&o>0||"string"==typeof o)&&t.setMaxColWidth(e,o)}this.refreshRowColCount()}refreshRowColCount(){const t=this,{layoutMap:e}=t.internalProps;e&&(e.recordsCount=t.internalProps.dataSource?.length??0,t.transpose?(t.rowCount=e.rowCount??0,t.colCount=(t.internalProps.dataSource?.length??0)*e.bodyRowCount+e.headerLevelCount,t.frozenRowCount=0,t.frozenColCount=e.headerLevelCount):(t.colCount=e.colCount??0,t.rowCount=(t.internalProps.dataSource?.length??0)*e.bodyRowCount+e.headerLevelCount,t.frozenColCount=t.options.frozenColCount??0,t.frozenRowCount=e.headerLevelCount))}getFieldData(t,e,n){if(null===t)return null;const i=this;if(i.internalProps.layoutMap.isHeader(e,n))return null;const r=i.getRecordIndexByRow(e,n);return i.internalProps.dataSource.getField(r,t)}moveHeaderPosition(t,e){const n=this.internalProps.layoutMap.moveHeaderPosition(t,e);if(n){if("column"===n.moveType){this.colWidthsMap.adjustOrder(n.sourceIndex,n.targetIndex,n.moveSize),this.colWidthsLimit={};for(let t=0;t<this.internalProps.layoutMap.columnWidths.length;t++){const{minWidth:e,maxWidth:n}=this.internalProps.layoutMap.columnWidths?.[t]??{};e&&("number"==typeof e&&e>0||"string"==typeof e)&&this.setMinColWidth(t,e),n&&("number"==typeof n&&n>0||"string"==typeof n)&&this.setMaxColWidth(t,n)}const t=Math.min(n.sourceIndex,n.targetIndex),e=Math.max(n.sourceIndex,n.targetIndex);for(let n=t;n<=e;n++)this._clearColRangeWidthsMap(n)}else{const t=Math.min(n.sourceIndex,n.targetIndex),e=Math.max(n.sourceIndex,n.targetIndex);for(let n=t;n<=e;n++)this._clearRowRangeHeightsMap(n)}return!0}return!1}getCellAddress(t,e){let n;for(let e=0;e<this.records.length;e++){const i=this.records[e];if("function"==typeof t)t(i)&&(n=e);else{let r=!0;for(const e in t)if(i[e]!==t[e]){r=!1;break}r&&(n=e)}if(k(n))break}const i=this.getCellRangeByField(e,n);if(i)return{row:i.start.row,col:i.start.col}}getCellRangeByField(t,e){const{layoutMap:n}=this.internalProps,i=n.columnObjects.find((e=>e.field===t));if(i){const t=n.getBodyLayoutRangeById(i.id);let r;return k(e)&&(r=n.getRecordStartRowByRecordIndex(e)),this.transpose?{start:{row:t.start.row,col:k(r)?r+t.start.col:void 0},end:{row:t.end.row,col:k(r)?r+t.end.col:void 0}}:{start:{col:t.start.col,row:k(r)?r+t.start.row:void 0},end:{col:t.end.col,row:k(r)?r+t.end.row:void 0}}}return null}getHierarchyState(t,e){if(!this.getBodyColumnDefine(t,e).tree)return r.none;const n=this.getRecordIndexByRow(t,e);return this.dataSource.getHierarchyState(n)}toggleHierarchyState(t,e){const n=this.getHierarchyState(t,e);n===r.expand?this.fireListeners(vt.TREE_HIERARCHY_STATE_CHANGE,{col:t,row:e,hierarchyState:r.collapse}):n===r.collapse&&this.fireListeners(vt.TREE_HIERARCHY_STATE_CHANGE,{col:t,row:e,hierarchyState:r.expand,originData:this.getCellOriginRecord(t,e)});const i=this.getRecordIndexByRow(t,e),o=this.dataSource.toggleHierarchyState(i),a=this.internalProps.layoutMap.toggleHierarchyState(o);this.refreshRowColCount(),this.clearCellStyleCache(),this.scenegraph.updateHierarchyIcon(t,e),this.scenegraph.updateRow(a.removeCellPositions,a.addCellPositions)}hasHierarchyTreeHeader(){return(this.options.columns??this.options.header)?.some(((t,e)=>t.tree))}getMenuInfo(t,e,n){return{field:this.getHeaderField(t,e),value:this.getCellValue(t,e),cellType:this.getCellType(t,e)}}getSortFuncFromHeaderOption(t,e,n){if(t||(t=this.internalProps.columns),e&&t&&t.length>0)for(let i=0;i<t.length;i++){const r=t[i];if((n&&n===r.fieldKey||!n&&r.field===e)&&r.sort&&"function"==typeof r.sort)return r.sort;if(r.columns){const t=this.getSortFuncFromHeaderOption(r.columns,e,n);if(t)return t}}}updateSortState(t){if(t)this.internalProps.sortState=t;else if(this.internalProps.sortState)if(Array.isArray(this.internalProps.sortState))for(let t=0;t<this.internalProps.sortState.length;t++){this.internalProps.sortState[t].order="normal"}else this.internalProps.sortState.order="normal";let e,n,i;if(Array.isArray(this.internalProps.sortState)?({order:e,field:n,fieldKey:i}=this.internalProps.sortState?.[0]):({order:e,field:n,fieldKey:i}=this.internalProps.sortState),n){const t=this.getSortFuncFromHeaderOption(this.internalProps.columns,n,i);let r;r=i?this.internalProps.layoutMap.headerObjects.find((t=>t&&t.fieldKey===i)):this.internalProps.layoutMap.headerObjects.find((t=>t&&t.field===n)),r?.define?.sort&&(this.dataSource.sort(r.field,e,t),this.scenegraph.sortCell())}this.stateManeger.updateSortState(t)}},t.PivotTable=class extends _R{pivotSortState;dataset;flatDataToObjects;constructor(t){if(super(t),t.layout&&Object.assign(t,t.layout),this.internalProps.dataConfig=t.dataConfig,this.internalProps.enableDataAnalysis=t.enableDataAnalysis,this.internalProps.enableDataAnalysis&&(t.rows||t.columns)){const e=t.rows.reduce(((t,e)=>("string"==typeof e?t.push(e):t.push(e.dimensionKey),t)),[]),n=t.columns.reduce(((t,e)=>("string"==typeof e?t.push(e):t.push(e.dimensionKey),t)),[]),i=t.indicators?.reduce(((t,e)=>("string"==typeof e?t.push(e):t.push(e.indicatorKey),t)),[])??[];this.dataset=new WR(this.internalProps.dataConfig,e,n,i,t.records)}this.refreshHeader(),this.pivotSortState=[],t.pivotSortState&&this.updatePivotSortState(t.pivotSortState),t.dataSource?K_(this,t.dataSource):t.records?this.setRecords(t.records,this.internalProps.sortState):this.setRecords([])}static get EVENT_TYPE(){return vA}isListTable(){return!1}isPivotTable(){return!0}_canResizeColumn(t,e){const n=super._canResizeColumn(t,e);if(n&&!this.internalProps.layoutMap.indicatorsAsCol){const e=this.internalProps.layoutMap.getBody(t,this.columnHeaderLevelCount);if(e?.disableColumnResize)return!1}return n}updateOption(t,e=!1){const n=this.internalProps;if(super.updateOption(t),n.dataConfig=t.dataConfig,n.enableDataAnalysis=t.enableDataAnalysis,"tree"===t?.rowHierarchyType&&"tree"===this.internalProps.layoutMap.rowHierarchyType&&this.internalProps.layoutMap.rowExpandLevel===t?.rowExpandLevel){const t=this.internalProps.layoutMap.rowDimensionTree.tree.children;this.internalProps.layoutMap.rowTree.forEach(((e,n)=>{this.syncHierarchyState(t[n],e)}))}if(this.internalProps.enableDataAnalysis&&(t.rows||t.columns)){const e=t.rows.reduce(((t,e)=>("string"==typeof e?t.push(e):t.push(e.dimensionKey),t)),[]),i=t.columns.reduce(((t,e)=>("string"==typeof e?t.push(e):t.push(e.dimensionKey),t)),[]),r=t.indicators.reduce(((t,e)=>("string"==typeof e?t.push(e):t.push(e.indicatorKey),t)),[]);this.dataset=new WR(n.dataConfig,e,i,r,t.records)}return this.refreshHeader(),n.disposables&&(n.disposables.forEach((t=>t?.dispose?.())),n.disposables=null),this._updateSize(),t.dataSource?K_(this,t.dataSource):t.records?this.setRecords(t.records,void 0):this._resetFrozenColCount(),this.pivotSortState=[],t.pivotSortState&&this.updatePivotSortState(t.pivotSortState),new Promise((t=>{setTimeout(t,0)}))}refreshHeader(){const t=this.internalProps;t.headerEvents&&t.headerEvents.forEach((t=>this.unlisten(t))),this.options.enableDataAnalysis?t.layoutMap=new IR(this,this.dataset):(Array.isArray(this.options.columnTree)||Array.isArray(this.options.rowTree))&&(t.layoutMap=new LR(this),this.options.records?.[0]?.constructor!==Array&&(this.flatDataToObjects=new DR({rows:t.layoutMap.rowDimensionKeys,columns:t.layoutMap.colDimensionKeys,indicators:t.layoutMap.indicatorKeys,indicatorsAsCol:t.layoutMap.indicatorsAsCol,indicatorDimensionKey:t.layoutMap.indicatorDimensionKey},this.options.records)));for(let e=0;e<t.layoutMap.columnWidths.length;e++){const{width:n,minWidth:i,maxWidth:r}=t.layoutMap.columnWidths?.[e]??{};n&&("string"==typeof n&&"auto"!==n||"number"==typeof n&&n>0)&&this.setColWidth(e,n),i&&("number"==typeof i&&i>0||"string"==typeof i)&&this.setMinColWidth(e,i),r&&("number"==typeof r&&r>0||"string"==typeof r)&&this.setMaxColWidth(e,r)}this.refreshRowColCount()}refreshRowColCount(){const t=this,{layoutMap:e}=t.internalProps;e&&(t.colCount=e.colCount??0,t.rowCount=e.rowCount??0,t.frozenColCount=e.rowHeaderLevelCount,t.frozenRowCount=e.headerLevelCount)}getSortFuncFromHeaderOption(t,e,n){}get rowHierarchyType(){return this.internalProps.layoutMap.rowHierarchyType}syncHierarchyState(t,e){t.value===e.value&&t.dimensionKey===e.dimensionKey&&(e.hierarchyState=e.hierarchyState??(e?.children?t.hierarchyState:void 0),e?.children?.forEach(((e,n)=>{t?.children?.[n]&&e&&this.syncHierarchyState(t.children[n],e)})))}getRecordIndexByRow(t){const{layoutMap:e}=this.internalProps;return e.getRecordIndexByRow(t)}getRecordIndexByCol(t){const{layoutMap:e}=this.internalProps;return e.getRecordIndexByCol(t)}getFieldData(t,e,n){if(null==t)return null;const i=this;if(i.internalProps.layoutMap.isHeader(e,n))return null;const r=this.getRecordIndexByRow(n),o=this.getRecordIndexByCol(e),a=i.dataSource?.getField(r,o);if("string"!=typeof t){return $x({dataValue:a,...i.internalProps.layoutMap.getCellHeaderPaths(e,n)},t,gt)}return a}getCellValue(t,e){if(this.internalProps.layoutMap.isHeader(t,e)){const{caption:n,fieldFormat:i}=this.internalProps.layoutMap.getHeader(t,e);return"function"==typeof i?i(n):n}if(this.dataset){const n=this.dataset.colKeysPath[this.internalProps.layoutMap.getRecordIndexByCol(t)]??[],i=this.dataset.rowKeysPath[this.internalProps.layoutMap.getRecordIndexByRow(e)]??[],r=this.dataset.getAggregator(i[i.length-1],n[n.length-1],this.internalProps.layoutMap.getIndicatorName(t,e));return r.formatValue?r.formatValue():""}if(this.flatDataToObjects){const n=this.internalProps.layoutMap.getCellHeaderPaths(t,e),i=n.colHeaderPaths.map((t=>t.indicatorKey??t.value)),r=n.rowHeaderPaths.map((t=>t.indicatorKey??t.value)),o=this.flatDataToObjects.getTreeNode(r,i,this.internalProps.layoutMap.getBody(t,e).indicatorKey),{fieldFormat:a}=this.internalProps.layoutMap.getBody(t,e);return"function"==typeof a?a(o?.record):o?.value??""}const{field:n,fieldFormat:i}=this.internalProps.layoutMap.getBody(t,e);return this.getFieldData(i||n,t,e)}getCellOriginValue(t,e){const n=this;if(n.internalProps.layoutMap.isHeader(t,e)){const{caption:i}=n.internalProps.layoutMap.getHeader(t,e);return"function"==typeof i?i():i}if(this.dataset){const n=this.dataset.colKeysPath[this.internalProps.layoutMap.getRecordIndexByCol(t)]??[],i=this.dataset.rowKeysPath[this.internalProps.layoutMap.getRecordIndexByRow(e)]??[],r=this.dataset.getAggregator(i[i.length-1],n[n.length-1],this.internalProps.layoutMap.getIndicatorName(t,e));return r.value?r.value():void 0}if(this.flatDataToObjects){const n=this.internalProps.layoutMap.getCellHeaderPaths(t,e),i=n.colHeaderPaths.map((t=>t.indicatorKey??t.value)),r=n.rowHeaderPaths.map((t=>t.indicatorKey??t.value)),o=this.flatDataToObjects.getTreeNode(r,i,this.internalProps.layoutMap.getBody(t,e).indicatorKey);return o?.value}const{field:i}=n.internalProps.layoutMap.getBody(t,e);return n.getFieldData(i,t,e)}getCellOriginRecord(t,e){if(!this.internalProps.layoutMap.isHeader(t,e)){if(this.dataset){const n=this.dataset.colKeysPath[this.internalProps.layoutMap.getRecordIndexByCol(t)]??[],i=this.dataset.rowKeysPath[this.internalProps.layoutMap.getRecordIndexByRow(e)]??[];return this.dataset.getAggregator(i[i.length-1],n[n.length-1],this.internalProps.layoutMap.getIndicatorName(t,e)).records}if(this.flatDataToObjects){const n=this.internalProps.layoutMap.getCellHeaderPaths(t,e),i=n.colHeaderPaths.map((t=>t.indicatorKey??t.value)),r=n.rowHeaderPaths.map((t=>t.indicatorKey??t.value)),o=this.flatDataToObjects.getTreeNode(r,i,this.internalProps.layoutMap.getBody(t,e).indicatorKey);return o?.record}}}updateSortRules(t){this.internalProps.dataConfig.sortRules=t,this.dataset.updateSortRules(t),this.internalProps.layoutMap.updateDataset(this.dataset),this.invalidate()}updatePivotSortState(t){for(let e=0;e<t.length;e++){const{dimensions:n,order:i}=t[e],r=this.internalProps.layoutMap.getPivotCellAdress(n);r&&this.pivotSortState.push({col:r.col,row:r.row,order:i})}}getPivotSortState(t,e){if(!this.pivotSortState)return;const n=this.getCellRange(t,e);for(let t=0;t<this.pivotSortState.length;t++){const{col:e,row:i,order:r}=this.pivotSortState[t];if(st(n,e,i))return r}}moveHeaderPosition(t,e){const n=this.internalProps.layoutMap.moveHeaderPosition(t,e);if(n){if("column"===n.moveType){if(this.options.records?.[0]?.constructor===Array)for(let t=0;t<this.records.length;t++){const e=this.records[t].splice(n.sourceIndex-this.rowHeaderLevelCount,n.moveSize);e.unshift(n.targetIndex-this.rowHeaderLevelCount,0),Array.prototype.splice.apply(this.records[t],e)}this.colWidthsMap.adjustOrder(n.sourceIndex,n.targetIndex,n.moveSize);for(let t=0;t<this.internalProps.layoutMap.columnWidths.length;t++){const{minWidth:e,maxWidth:n}=this.internalProps.layoutMap.columnWidths?.[t]??{};e&&("number"==typeof e&&e>0||"string"==typeof e)&&this.setMinColWidth(t,e),n&&("number"==typeof n&&n>0||"string"==typeof n)&&this.setMaxColWidth(t,n)}}else if("row"===n.moveType){if(this.options.records?.[0]?.constructor===Array){const t=this.records.splice(n.sourceIndex-this.columnHeaderLevelCount,n.moveSize);t.unshift(n.targetIndex-this.columnHeaderLevelCount,0),Array.prototype.splice.apply(this.records,t)}this.rowHeightsMap.adjustOrder(n.sourceIndex,n.targetIndex,n.moveSize)}return!0}return!1}toggleHierarchyState(t,e){const n=this.getHierarchyState(t,e);n===r.expand?this.fireListeners(vA.TREE_HIERARCHY_STATE_CHANGE,{col:t,row:e,hierarchyState:r.collapse}):n===r.collapse&&this.fireListeners(vA.TREE_HIERARCHY_STATE_CHANGE,{col:t,row:e,hierarchyState:r.expand,originData:this.getCellOriginRecord(t,e)});const i=this.internalProps.layoutMap.toggleHierarchyState(t,e);this.refreshRowColCount(),this.clearCellStyleCache(),this.scenegraph.updateHierarchyIcon(t,e),this.scenegraph.updateRow(i.removeCellPositions,i.addCellPositions)}getHeaderCellAddressByPath(t){return this.internalProps.layoutMap.getPivotCellAdress(t)}getCellAddressByHeaderPaths(t){return this.internalProps.layoutMap.getCellAdressByHeaderPath(t)}getHeaderPathByXY(t){let e;e=t?this.getCellAt(t.x+this.getFrozenColsWidth()+this.scrollLeft+1,t.y+this.getFrozenRowsHeight()+this.scrollTop+1):this.getCellAt(this.getFrozenColsWidth()+this.scrollLeft+1,this.getFrozenRowsHeight()+this.scrollTop+1);return this.internalProps.layoutMap.getCellHeaderPaths(e.col,e.row)}getHierarchyState(t,e){return this._getHeaderLayoutMap(t,e)?.hierarchyState}hasHierarchyTreeHeader(){return"tree"===this.internalProps.layoutMap.rowHierarchyType}getMenuInfo(t,e,n){const i=this.internalProps.layoutMap.getPivotDimensionInfo(t,e);return{dimensionKey:i[i.length-1].dimensionKey,value:this.getCellValue(t,e),cellType:this.getCellType(t,e),isPivotCorner:this.isCornerHeader(t,e)}}},t.TYPES=u,t.clearGlobal=function(){RR()},t.core=SR,t.data=Qx,t.getIcons=function(){return aS()},t.register=BR,t.themes=Ge,t.version="0.9.1"}));