@visactor/vtable-gantt 1.10.3 → 1.10.4-alpha.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -12,4 +12,4 @@
12
12
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
13
13
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
14
14
  PERFORMANCE OF THIS SOFTWARE.
15
- ***************************************************************************** */let PC=class{time=Ti.beforeFillStroke;useStyle=!0;order=0;supportedAppName="vtable";drawShape(t,e,i,o,n,r,s,l,a,h,d,c,u){"date-header-cell"===t.name&&t.forEachChildren((t=>{if("date-header-cell-text"===t.name&&!0===t.attribute.textStick){const e=t;e.setAttribute("dx",0);const i=e.globalAABBBounds,o=e.stage.globalAABBBounds,n=e.parent.globalAABBBounds,r=o.intersect(n);o.intersect(n)&&(i.width()>=r.width()&&e.attribute.last_dx?e.setAttribute("dx",e.attribute.last_dx??0):o.x1>=i.x1?(e.setAttribute("dx",o.x1-i.x1),e.setAttribute("last_dx",o.x1-i.x1)):o.x2<=i.x2&&(e.setAttribute("dx",o.x2-i.x2),e.setAttribute("last_dx",o.x1-i.x1)))}}))}};PC=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s}([y()],PC);var EC=new s(((t,e,i,o)=>{t(PC).toSelf().inSingletonScope(),t(Vs).toService(PC)}));class HC{_scene;group;lineVertical;lineHorizontal;constructor(t){this._scene=t,this.createAddButton()}createAddButton(){this._scene._gantt.parsedOptions.taskBarCreationCustomLayout?this.group=new fs({x:0,y:0,width:100,height:100}):(this.group=new fs({x:0,y:0,width:100,height:100,lineDash:this._scene._gantt.parsedOptions.taskBarCreationButtonStyle.lineDash,cursor:"pointer",lineWidth:this._scene._gantt.parsedOptions.taskBarCreationButtonStyle.lineWidth,stroke:this._scene._gantt.parsedOptions.taskBarCreationButtonStyle.lineColor,cornerRadius:this._scene._gantt.parsedOptions.taskBarCreationButtonStyle.cornerRadius??0,fill:this._scene._gantt.parsedOptions.taskBarCreationButtonStyle.backgroundColor}),this.lineVertical=oc({pickable:!1,stroke:this._scene._gantt.parsedOptions.taskBarCreationButtonStyle.lineColor,lineWidth:this._scene._gantt.parsedOptions.taskBarCreationButtonStyle.lineWidth,points:[{x:50,y:0},{x:50,y:100}]}),this.group.appendChild(this.lineVertical),this.lineHorizontal=oc({pickable:!1,stroke:this._scene._gantt.parsedOptions.taskBarCreationButtonStyle.lineColor,lineWidth:this._scene._gantt.parsedOptions.taskBarCreationButtonStyle.lineWidth,points:[{x:0,y:50},{x:100,y:50}]}),this.group.appendChild(this.lineHorizontal)),this.group.name="task-creation-button",this._scene.taskBar.group.addChild(this.group)}show(t,e,i,o){if(this._scene._gantt.parsedOptions.taskBarCreationCustomLayout)this.group.appendChild(this._scene._gantt.parsedOptions.taskBarCreationCustomLayout({width:i,height:o,ganttInstance:this._scene._gantt}).rootContainer);else{const t=Math.min(i,o)/6;this.lineHorizontal.setAttribute("points",[{x:(i-4*t)/2,y:o/2},{x:(i-4*t)/2+4*t,y:o/2}]),this.lineVertical.setAttribute("points",[{x:i/2,y:(o-4*t)/2},{x:i/2,y:(o-4*t)/2+4*t}])}this.group.setAttribute("x",t),this.group.setAttribute("y",e),this.group.setAttribute("width",i),this.group.setAttribute("height",o),this.group.setAttribute("visibleAll",!0)}hide(){this.group.setAttribute("visibleAll",!1),this._scene._gantt.parsedOptions.taskBarCreationCustomLayout&&this.group.removeAllChild()}}class FC{group;linkLinesContainer;_scene;width;height;selectedEffectNodes;constructor(t){this._scene=t,this.width=t._gantt.tableNoFrameWidth,this.height=t._gantt.gridHeight,this.group=new fs({x:0,y:t._gantt.getAllHeaderRowsHeight(),width:this.width,height:this.height,pickable:!1,clip:!0}),this.group.name="dependency-link-container",t.tableGroup.addChild(this.group),this.initLinkLines()}initLinkLines(){this.linkLinesContainer=new fs({x:0,y:0,width:this._scene._gantt._getAllColsWidth(),height:this._scene._gantt.getAllTaskBarsHeight(),pickable:!1,clip:!0}),this.group.appendChild(this.linkLinesContainer);for(let t=0;t<this._scene._gantt.parsedOptions.dependencyLinks?.length;t++)this.initLinkLine(t)}initLinkLine(t){const{taskKeyField:e,dependencyLinks:o}=this._scene._gantt.parsedOptions,n=o[t],{linkedToTaskKey:r,linkedFromTaskKey:s,type:l}=n,a=SC(this._scene._gantt.records,e,r);a.record.vtable_gantt_linkedTo||(a.record.vtable_gantt_linkedTo=[]),a.record.vtable_gantt_linkedTo.push(n);const h=SC(this._scene._gantt.records,e,s);h.record.vtable_gantt_linkedFrom||(h.record.vtable_gantt_linkedFrom=[]),h.record.vtable_gantt_linkedFrom.push(n);const d=this._scene._gantt.getTaskShowIndexByRecordIndex(h.index),c=this._scene._gantt.getTaskShowIndexByRecordIndex(a.index),{startDate:u,endDate:g,taskDays:p}=this._scene._gantt.getTaskInfoByTaskListIndex(c),{startDate:f,endDate:v,taskDays:m}=this._scene._gantt.getTaskInfoByTaskListIndex(d);if(!m||!p)return;const b=fC(this._scene._gantt.parsedOptions.minDate),{arrowPoints:y,linePoints:C}=function(t,e,o,n,r,s,l,a,h,d){const c=20,u=10,g=5;let p,f,v=[],m=[];if(t===i.FinishToStart){p=o,f=r;const t=d*(Math.ceil(Math.abs(p.getTime()-a.getTime())/864e5)+1),e=d*Math.ceil(Math.abs(f.getTime()-a.getTime())/864e5);v=[{x:t,y:h*(n+.5)},{x:t+c,y:h*(n+.5)},{x:t+c,y:h*(n+(n>l?0:1))},{x:e-c,y:h*(n+(n>l?0:1))},{x:e-c,y:h*(l+.5)},{x:e,y:h*(l+.5)}],t+c<=e-c&&v.splice(2,3,{x:t+c,y:h*(l+.5)});const i=v[v.length-1];m=[{x:i.x,y:i.y},{x:i.x-u,y:i.y-g},{x:i.x-u,y:i.y+g},{x:i.x,y:i.y}]}else if(t===i.StartToFinish){p=e,f=s;const t=d*Math.ceil(Math.abs(p.getTime()-a.getTime())/864e5),i=d*(Math.ceil(Math.abs(f.getTime()-a.getTime())/864e5)+1);v=[{x:t,y:h*(n+.5)},{x:t-c,y:h*(n+.5)},{x:t-c,y:h*(n+(n>l?0:1))},{x:i+c,y:h*(n+(n>l?0:1))},{x:i+c,y:h*(l+.5)},{x:i,y:h*(l+.5)}],t-c>=i+c&&v.splice(2,3,{x:t-c,y:h*(l+.5)});const o=v[v.length-1];m=[{x:o.x,y:o.y},{x:o.x+u,y:o.y-g},{x:o.x+u,y:o.y+g},{x:o.x,y:o.y}]}else if(t===i.StartToStart){p=e,f=r;const t=d*Math.ceil(Math.abs(p.getTime()-a.getTime())/864e5),i=d*Math.ceil(Math.abs(f.getTime()-a.getTime())/864e5);v=[{x:t,y:h*(n+.5)},{x:Math.min(t,i)-c,y:h*(n+.5)},{x:Math.min(t,i)-c,y:h*(l+.5)},{x:i,y:h*(l+.5)}];const o=v[v.length-1];m=[{x:o.x,y:o.y},{x:o.x-u,y:o.y-g},{x:o.x-u,y:o.y+g},{x:o.x,y:o.y}]}else if(t===i.FinishToFinish){p=o,f=s;const t=d*(Math.ceil(Math.abs(p.getTime()-a.getTime())/864e5)+1),e=d*(Math.ceil(Math.abs(f.getTime()-a.getTime())/864e5)+1);v=[{x:t,y:h*(n+.5)},{x:Math.max(t,e)+c,y:h*(n+.5)},{x:Math.max(t,e)+c,y:h*(l+.5)},{x:e,y:h*(l+.5)}];const i=v[v.length-1];m=[{x:i.x,y:i.y},{x:i.x+u,y:i.y-g},{x:i.x+u,y:i.y+g},{x:i.x,y:i.y}]}return{linePoints:v,arrowPoints:m}}(l,f,v,d,u,g,c,b,this._scene._gantt.parsedOptions.rowHeight,this._scene._gantt.parsedOptions.colWidthPerDay),w=this._scene._gantt.parsedOptions.dependencyLinkLineStyle,x=oc({pickable:!0,stroke:w.lineColor,lineWidth:w.lineWidth,lineDash:w.lineDash,points:C,pickStrokeBuffer:3,vtable_link:n});this.linkLinesContainer.appendChild(x),n.vtable_gantt_linkLineNode=x;const _=new Rc({fill:w.lineColor,points:y});this.linkLinesContainer.appendChild(_),n.vtable_gantt_linkArrowNode=_}setX(t){this.linkLinesContainer.setAttribute("x",t)}setY(t){this.linkLinesContainer.setAttribute("y",t)}refresh(){this.width=this._scene._gantt.tableNoFrameWidth,this.height=this._scene._gantt.gridHeight,this.group.setAttributes({height:this.height,width:this.width,y:this._scene._gantt.getAllHeaderRowsHeight()}),this.linkLinesContainer.removeAllChild(),this.group.removeChild(this.linkLinesContainer),this.initLinkLines()}resize(){this.width=this._scene._gantt.tableNoFrameWidth,this.height=this._scene._gantt.gridHeight,this.group.setAttribute("width",this.width),this.group.setAttribute("height",this.height)}createSelectedLinkLine(t){const e=t.vtable_gantt_linkLineNode,i=t.vtable_gantt_linkArrowNode,o=e.clone(),n=i.clone();o.setAttribute("stroke",this._scene._gantt.parsedOptions.dependencyLinkSelectedLineStyle.lineColor),o.setAttribute("lineWidth",this._scene._gantt.parsedOptions.dependencyLinkSelectedLineStyle.lineWidth),o.setAttribute("shadowColor",this._scene._gantt.parsedOptions.dependencyLinkSelectedLineStyle.shadowColor),o.setAttribute("shadowOffsetX",this._scene._gantt.parsedOptions.dependencyLinkSelectedLineStyle.shadowOffset),o.setAttribute("shadowOffsetY",this._scene._gantt.parsedOptions.dependencyLinkSelectedLineStyle.shadowOffset),o.setAttribute("shadowBlur",this._scene._gantt.parsedOptions.dependencyLinkSelectedLineStyle.shadowBlur),this.linkLinesContainer.appendChild(o),n.setAttribute("fill",this._scene._gantt.parsedOptions.dependencyLinkSelectedLineStyle.lineColor),this.linkLinesContainer.appendChild(n),this.selectedEffectNodes=[o,n]}removeSelectedLinkLine(){this.selectedEffectNodes?.forEach((t=>{t.delete()})),this.selectedEffectNodes=[]}deleteLink(t){const e=t.vtable_gantt_linkLineNode,i=t.vtable_gantt_linkArrowNode;e.delete(),i.delete()}}function zC(t,e,o,n,r,s,l,a,h,d,c,u){const g=20,p=10;let f,v,m=[],b=[];if(t===i.FinishToStart){f=o,v=r;const t=c?c.attribute.x+c.attribute.width:d*(Math.ceil(Math.abs(f.getTime()-a.getTime())/864e5)+1),e=u?u.attribute.x:d*Math.ceil(Math.abs(v.getTime()-a.getTime())/864e5);m=[{x:t,y:h*(n+.5)},{x:t+g,y:h*(n+.5)},{x:t+g,y:h*(n+(n>l?0:1))},{x:e-g,y:h*(n+(n>l?0:1))},{x:e-g,y:h*(l+.5)},{x:e,y:h*(l+.5)}],t+g<=e-g&&m.splice(2,3,{x:t+g,y:h*(l+.5)});const i=m[m.length-1];b=[{x:i.x,y:i.y},{x:i.x-p,y:i.y-5},{x:i.x-p,y:i.y+5},{x:i.x,y:i.y}]}else if(t===i.StartToFinish){f=e,v=s;const t=c?c.attribute.x:d*Math.ceil(Math.abs(f.getTime()-a.getTime())/864e5),i=u?u.attribute.x+u.attribute.width:d*(Math.ceil(Math.abs(v.getTime()-a.getTime())/864e5)+1);m=[{x:t,y:h*(n+.5)},{x:t-g,y:h*(n+.5)},{x:t-g,y:h*(n+(n>l?0:1))},{x:i+g,y:h*(n+(n>l?0:1))},{x:i+g,y:h*(l+.5)},{x:i,y:h*(l+.5)}],t-g>=i+g&&m.splice(2,3,{x:t-g,y:h*(l+.5)});const o=m[m.length-1];b=[{x:o.x,y:o.y},{x:o.x+p,y:o.y-5},{x:o.x+p,y:o.y+5},{x:o.x,y:o.y}]}else if(t===i.StartToStart){f=e,v=r;const t=c?c.attribute.x:d*Math.ceil(Math.abs(f.getTime()-a.getTime())/864e5),i=u?u.attribute.x:d*Math.ceil(Math.abs(v.getTime()-a.getTime())/864e5);m=[{x:t,y:h*(n+.5)},{x:Math.min(t,i)-g,y:h*(n+.5)},{x:Math.min(t,i)-g,y:h*(l+.5)},{x:i,y:h*(l+.5)}];const o=m[m.length-1];b=[{x:o.x,y:o.y},{x:o.x-p,y:o.y-5},{x:o.x-p,y:o.y+5},{x:o.x,y:o.y}]}else if(t===i.FinishToFinish){f=o,v=s;const t=c?c.attribute.x+c.attribute.width:d*(Math.ceil(Math.abs(f.getTime()-a.getTime())/864e5)+1),e=u?u.attribute.x+u.attribute.width:d*(Math.ceil(Math.abs(v.getTime()-a.getTime())/864e5)+1);m=[{x:t,y:h*(n+.5)},{x:Math.max(t,e)+g,y:h*(n+.5)},{x:Math.max(t,e)+g,y:h*(l+.5)},{x:e,y:h*(l+.5)}];const i=m[m.length-1];b=[{x:i.x,y:i.y},{x:i.x+p,y:i.y-5},{x:i.x+p,y:i.y+5},{x:i.x,y:i.y}]}return{linePoints:m,arrowPoints:b}}nn.load(EC);var IC,OC,DC,WC,NC,GC,jC,VC,UC;!function(t){t.default="default",t.grabing="grabing",t.scrolling="scrolling"}(IC||(IC={})),function(t){t.single="single",t.column="column",t.row="row",t.cross="cross",t.none="none"}(OC||(OC={})),function(t){t.top="top",t.bottom="bottom",t.left="left",t.right="right"}(DC||(DC={})),function(t){t.expand="expand",t.collapse="collapse",t.none="none"}(WC||(WC={})),function(t){t.RECORD="RECORD",t.NONE="NONE",t.SUM="SUM",t.MIN="MIN",t.MAX="MAX",t.AVG="AVG",t.COUNT="COUNT",t.CUSTOM="CUSTOM",t.RECALCULATE="RECALCULATE"}(NC||(NC={})),function(t){t.ASC="ASC",t.DESC="DESC",t.NORMAL="NORMAL",t.desc="desc",t.asc="asc",t.normal="normal"}(GC||(GC={})),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"}(jC||(jC={})),function(t){t.frozen="frozen",t.sort="sort",t.dropDown="dropDown",t.dropDownState="dropDownState",t.play="play",t.damagePic="damagePic",t.expand="expand",t.collapse="collapse",t.drillDown="drillDown",t.drillUp="drillUp",t.dragReorder="dragReorder"}(VC||(VC={})),function(t){t.upwardIconName="sort_upward",t.downwardIconName="sort_downward",t.normalIconName="sort_normal",t.freezeIconName="freeze",t.frozenIconName="frozen",t.frozenCurrentIconName="frozenCurrent",t.dropdownIconName="dropdownIcon",t.expandIconName="expand",t.collapseIconName="collapse",t.dragReorderIconName="dragReorder"}(UC||(UC={}));let $C,XC=1,YC=class{constructor(){this.listenersData={listeners:{},listenerData:{}}}on(t,e){const i=this.listenersData.listeners[t]||(this.listenersData.listeners[t]=[]);i.push(e);const o=XC++;return this.listenersData.listenerData[o]={type:t,listener:e,remove:()=>{delete this.listenersData.listenerData[o];const n=i.indexOf(e);i.splice(n,1),this.listenersData.listeners[t].length||delete this.listenersData.listeners[t]}},o}off(t,e){var i;if(e){const i=t;this.removeEventListener(i,e)}else{const e=t;if(!this.listenersData)return;null===(i=this.listenersData.listenerData[e])||void 0===i||i.remove()}}addEventListener(t,e,i){this.on(t,e)}removeEventListener(t,e){if(this.listenersData)for(const i in this.listenersData.listenerData){const o=this.listenersData.listenerData[i];o.type===t&&o.listener===e&&this.off(i)}}hasListeners(t){return!!this.listenersData&&!!this.listenersData.listeners[t]}fireListeners(t,e){if(!this.listenersData)return[];const i=this.listenersData.listeners[t];return i?i.map((t=>t.call(this,e))).filter((t=>Q(t))):[]}release(){delete this.listenersData}};const KC={CHANGE_STYLE:"change_style"};let qC,ZC,JC,QC=class t extends YC{static get EVENT_TYPE(){return KC}static get DEFAULT(){return $C||($C=new t)}constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};var i,o,n,r,s,l,a,h,d,c,u,g,p,f,v,m,b,y,C,w,x,_,S,A,B,R,M,T,k,L,P;super(),this._defaultPadding=[10,16,10,16],this._textAlign=null!==(i=null==t?void 0:t.textAlign)&&void 0!==i?i:null==e?void 0:e.textAlign,this._textBaseline=null!==(o=null==t?void 0:t.textBaseline)&&void 0!==o?o:null==e?void 0:e.textBaseline,this._color=null!==(n=null==t?void 0:t.color)&&void 0!==n?n:null==e?void 0:e.color,this._strokeColor=null!==(r=null==t?void 0:t.strokeColor)&&void 0!==r?r:null==e?void 0:e.strokeColor,this._fontSize=null!==(s=t.fontSize)&&void 0!==s?s:null==e?void 0:e.fontSize,this._fontFamily=null!==(l=t.fontFamily)&&void 0!==l?l:null==e?void 0:e.fontFamily,this._fontWeight=null!==(a=t.fontWeight)&&void 0!==a?a:null==e?void 0:e.fontWeight,this._fontVariant=null!==(h=t.fontVariant)&&void 0!==h?h:null==e?void 0:e.fontVariant,this._fontStyle=null!==(d=t.fontStyle)&&void 0!==d?d:null==e?void 0:e.fontStyle,this._padding=null!==(u=null!==(c=null==t?void 0:t.padding)&&void 0!==c?c:null==e?void 0:e.padding)&&void 0!==u?u:this._defaultPadding,this._borderColor=null!==(g=null==t?void 0:t.borderColor)&&void 0!==g?g:null==e?void 0:e.borderColor,this._textOverflow=null!==(p=null==t?void 0:t.textOverflow)&&void 0!==p?p:null==e?void 0:e.textOverflow,this._textStick=null!==(v=null!==(f=t.textStick)&&void 0!==f?f:null==e?void 0:e.textStick)&&void 0!==v&&v,this._textStickBaseOnAlign=null!==(b=null!==(m=t.textStickBaseOnAlign)&&void 0!==m?m:null==e?void 0:e.textStickBaseOnAlign)&&void 0!==b&&b,this._bgColor=null!==(y=null==t?void 0:t.bgColor)&&void 0!==y?y:null==e?void 0:e.bgColor,this._lineHeight=null!==(C=null==t?void 0:t.lineHeight)&&void 0!==C?C:null==e?void 0:e.lineHeight,this._underline=null!==(w=null==t?void 0:t.underline)&&void 0!==w?w:null==e?void 0:e.underline,this._underlineColor=null!==(x=null==t?void 0:t.underlineColor)&&void 0!==x?x:null==e?void 0:e.underlineColor,this._underlineDash=null!==(_=null==t?void 0:t.underlineDash)&&void 0!==_?_:null==e?void 0:e.underlineDash,this._underlineOffset=null!==(S=null==t?void 0:t.underlineOffset)&&void 0!==S?S:null==e?void 0:e.underlineOffset,this._lineThrough=null!==(A=null==t?void 0:t.lineThrough)&&void 0!==A?A:null==e?void 0:e.lineThrough,this._lineThroughColor=null!==(B=null==t?void 0:t.lineThroughColor)&&void 0!==B?B:null==e?void 0:e.lineThroughColor,this._lineThroughDash=null!==(R=null==t?void 0:t.lineThroughDash)&&void 0!==R?R:null==e?void 0:e.lineThroughDash,this._linkColor=null!==(M=null==t?void 0:t.linkColor)&&void 0!==M?M:null==e?void 0:e.linkColor,this._cursor=null!==(T=t.cursor)&&void 0!==T?T:null==e?void 0:e.cursor,this._borderLineWidth=null!==(k=t.borderLineWidth)&&void 0!==k?k:null==e?void 0:e.borderLineWidth,this._borderLineDash=null!==(L=t.borderLineDash)&&void 0!==L?L:null==e?void 0:e.borderLineDash,this._marked=null!==(P=t.marked)&&void 0!==P?P:null==e?void 0:e.marked}get color(){return this._color}set color(t){this._color=t}get strokeColor(){return this._strokeColor}set strokeColor(t){this._strokeColor=t}get fontSize(){return this._fontSize}set fontSize(t){this._fontSize=t}get fontFamily(){return this._fontFamily}set fontFamily(t){this._fontFamily=t}get fontWeight(){return this._fontWeight}set fontWeight(t){this._fontWeight=t}get fontVariant(){return this._fontVariant}set fontVariant(t){this._fontVariant=t}get fontStyle(){return this._fontStyle}set fontStyle(t){this._fontStyle=t}get padding(){return this._padding}set padding(t){this._padding=t}get textOverflow(){return this._textOverflow}set textOverflow(t){this._textOverflow=t}get bgColor(){return this._bgColor}set bgColor(t){this._bgColor=t}get borderColor(){return this._borderColor}set borderColor(t){this._borderColor=t}get textStick(){return this._textStick}set textStick(t){this._textStick=t}get textStickBaseOnAlign(){return this._textStickBaseOnAlign}set textStickBaseOnAlign(t){this._textStickBaseOnAlign=t}get textAlign(){return this._textAlign}set textAlign(t){this._textAlign=t}get textBaseline(){return this._textBaseline}set textBaseline(t){this._textBaseline=t}get lineHeight(){return this._lineHeight}set lineHeight(t){this._lineHeight=t}get underline(){return this._underline}set underline(t){this._underline=t}get underlineColor(){return this._underlineColor}set underlineColor(t){this._underlineColor=t}get underlineDash(){return this._underlineDash}set underlineDash(t){this._underlineDash=t}get underlineOffset(){return this._underlineOffset}set underlineOffset(t){this._underlineOffset=t}get lineThrough(){return this._lineThrough}set lineThrough(t){this._lineThrough=t}get lineThroughColor(){return this._lineThroughColor}set lineThroughColor(t){this._lineThroughColor=t}get lineThroughDash(){return this._lineThroughDash}set lineThroughDash(t){this._lineThroughDash=t}get linkColor(){return this._linkColor}set linkColor(t){this._linkColor=t}get cursor(){return this._cursor}set cursor(t){this._cursor=t}get borderLineWidth(){return this._borderLineWidth}set borderLineWidth(t){this._borderLineWidth=t}get borderLineDash(){return this._borderLineDash}set borderLineDash(t){this._borderLineDash=t}get marked(){return this._marked}set marked(t){this._marked=t}clone(){return new t(this,null)}},tw=class t extends QC{static get DEFAULT(){return qC||(qC=new t)}constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},arguments.length>1&&void 0!==arguments[1]?arguments[1]:{})}clone(){return new t(this,null)}};class ew extends QC{static get DEFAULT(){return ZC||(ZC=new ew)}constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};var i,o;super(t,e),this._autoWrapText=null!==(i=null==t?void 0:t.autoWrapText)&&void 0!==i?i:null==e?void 0:e.autoWrapText,this._lineClamp=null!==(o=null==t?void 0:t.lineClamp)&&void 0!==o?o:null==e?void 0:e.lineClamp}clone(){return new ew(this,null)}get lineClamp(){return this._lineClamp}set lineClamp(t){this._lineClamp=t}get autoWrapText(){return this._autoWrapText}set autoWrapText(t){this._autoWrapText=t}}let iw,ow=class t extends QC{static get DEFAULT(){return JC||(JC=new t)}constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};var o,n,r,s,l,a,h,d,c,u,g,p,f,v,m,b,y,C,w,x,_,S;super(t,e),this._size=(null!==(n=null!==(o=null==t?void 0:t.size)&&void 0!==o?o:null==e?void 0:e.size)&&void 0!==n?n:null==i?void 0:i.size)||14,this._spaceBetweenTextAndIcon=(null!==(s=null!==(r=null==t?void 0:t.spaceBetweenTextAndIcon)&&void 0!==r?r:null==e?void 0:e.spaceBetweenTextAndIcon)&&void 0!==s?s:null==i?void 0:i.spaceBetweenTextAndIcon)||8,this._defaultFill=null!==(a=null===(l=null==t?void 0:t.checkboxStyle)||void 0===l?void 0:l.defaultFill)&&void 0!==a?a:null==i?void 0:i.defaultFill,this._defaultStroke=null!==(d=null===(h=null==t?void 0:t.checkboxStyle)||void 0===h?void 0:h.defaultStroke)&&void 0!==d?d:null==i?void 0:i.defaultStroke,this._disableFill=null!==(u=null===(c=null==t?void 0:t.checkboxStyle)||void 0===c?void 0:c.disableFill)&&void 0!==u?u:null==i?void 0:i.disableFill,this._checkedFill=null!==(p=null===(g=null==t?void 0:t.checkboxStyle)||void 0===g?void 0:g.checkedFill)&&void 0!==p?p:null==i?void 0:i.checkedFill,this._checkedStroke=null!==(v=null===(f=null==t?void 0:t.checkboxStyle)||void 0===f?void 0:f.checkedStroke)&&void 0!==v?v:null==i?void 0:i.checkedStroke,this._disableCheckedFill=null!==(b=null===(m=null==t?void 0:t.checkboxStyle)||void 0===m?void 0:m.disableCheckedFill)&&void 0!==b?b:null==i?void 0:i.disableCheckedFill,this._disableCheckedStroke=null!==(C=null===(y=null==t?void 0:t.checkboxStyle)||void 0===y?void 0:y.disableCheckedStroke)&&void 0!==C?C:null==i?void 0:i.disableCheckedStroke,this._checkIconImage=null!==(x=null===(w=null==t?void 0:t.checkboxStyle)||void 0===w?void 0:w.checkIconImage)&&void 0!==x?x:null==i?void 0:i.checkIconImage,this._indeterminateIconImage=null!==(S=null===(_=null==t?void 0:t.checkboxStyle)||void 0===_?void 0:_.indeterminateIconImage)&&void 0!==S?S:null==i?void 0:i.indeterminateIconImage}get size(){return this._size}set size(t){this._size=t}get spaceBetweenTextAndIcon(){return this._spaceBetweenTextAndIcon}set spaceBetweenTextAndIcon(t){this._spaceBetweenTextAndIcon=t}get defaultFill(){return this._defaultFill}set defaultFill(t){this._defaultFill=t}get defaultStroke(){return this._defaultStroke}set defaultStroke(t){this._defaultStroke=t}get disableFill(){return this._disableFill}set disableFill(t){this._disableFill=t}get checkedFill(){return this._checkedFill}set checkedFill(t){this._checkedFill=t}get checkedStroke(){return this._checkedStroke}set checkedStroke(t){this._checkedStroke=t}get disableCheckedFill(){return this._disableCheckedFill}set disableCheckedFill(t){this._disableCheckedFill=t}get disableCheckedStroke(){return this._disableCheckedStroke}set disableCheckedStroke(t){this._disableCheckedStroke=t}get checkIconImage(){return this._checkIconImage}set checkIconImage(t){this._checkIconImage=t}get indeterminateIconImage(){return this._indeterminateIconImage}set indeterminateIconImage(t){this._indeterminateIconImage=t}getStyle(e){return new t(e,this)}clone(){return new t(this)}};class nw extends QC{static get DEFAULT(){return iw||(iw=new nw)}constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};var o,n,r,s,l,a,h,d,c,u,g,p,f,v,m,b,y,C,w,x,_,S,A,B;super(t,e),this._size=(null!==(n=null!==(o=null==t?void 0:t.size)&&void 0!==o?o:null==e?void 0:e.size)&&void 0!==n?n:null==i?void 0:i.size)||14,this._spaceBetweenTextAndIcon=(null!==(s=null!==(r=null==t?void 0:t.spaceBetweenTextAndIcon)&&void 0!==r?r:null==e?void 0:e.spaceBetweenTextAndIcon)&&void 0!==s?s:null==i?void 0:i.spaceBetweenTextAndIcon)||8,this._spaceBetweenRadio=(null!==(a=null!==(l=null==t?void 0:t.spaceBetweenRadio)&&void 0!==l?l:null==e?void 0:e.spaceBetweenRadio)&&void 0!==a?a:null==i?void 0:i.spaceBetweenRadio)||2,this._innerRadius=null!==(d=null===(h=null==t?void 0:t.radioStyle)||void 0===h?void 0:h.innerRadius)&&void 0!==d?d:null==i?void 0:i.innerRadius,this._outerRadius=null!==(u=null===(c=null==t?void 0:t.radioStyle)||void 0===c?void 0:c.outerRadius)&&void 0!==u?u:null==i?void 0:i.outerRadius,this._defaultFill=null!==(p=null===(g=null==t?void 0:t.radioStyle)||void 0===g?void 0:g.defaultFill)&&void 0!==p?p:null==i?void 0:i.defaultFill,this._defaultStroke=null!==(v=null===(f=null==t?void 0:t.radioStyle)||void 0===f?void 0:f.defaultStroke)&&void 0!==v?v:null==i?void 0:i.defaultStroke,this._disableFill=null!==(b=null===(m=null==t?void 0:t.radioStyle)||void 0===m?void 0:m.disableFill)&&void 0!==b?b:null==i?void 0:i.disableFill,this._checkedFill=null!==(C=null===(y=null==t?void 0:t.radioStyle)||void 0===y?void 0:y.checkedFill)&&void 0!==C?C:null==i?void 0:i.checkedFill,this._checkedStroke=null!==(x=null===(w=null==t?void 0:t.radioStyle)||void 0===w?void 0:w.checkedStroke)&&void 0!==x?x:null==i?void 0:i.checkedStroke,this._disableCheckedFill=null!==(S=null===(_=null==t?void 0:t.radioStyle)||void 0===_?void 0:_.disableCheckedFill)&&void 0!==S?S:null==i?void 0:i.disableCheckedFill,this._disableCheckedStroke=null!==(B=null===(A=null==t?void 0:t.radioStyle)||void 0===A?void 0:A.disableCheckedStroke)&&void 0!==B?B:null==i?void 0:i.disableCheckedStroke}get size(){return this._size}set size(t){this._size=t}get spaceBetweenTextAndIcon(){return this._spaceBetweenTextAndIcon}set spaceBetweenTextAndIcon(t){this._spaceBetweenTextAndIcon=t}get spaceBetweenRadio(){return this._spaceBetweenRadio}set spaceBetweenRadio(t){this._spaceBetweenRadio=t}get innerRadius(){return this._innerRadius}set innerRadius(t){this._innerRadius=t}get outerRadius(){return this._outerRadius}set outerRadius(t){this._outerRadius=t}get defaultFill(){return this._defaultFill}set defaultFill(t){this._defaultFill=t}get defaultStroke(){return this._defaultStroke}set defaultStroke(t){this._defaultStroke=t}get disableFill(){return this._disableFill}set disableFill(t){this._disableFill=t}get checkedFill(){return this._checkedFill}set checkedFill(t){this._checkedFill=t}get checkedStroke(){return this._checkedStroke}set checkedStroke(t){this._checkedStroke=t}get disableCheckedFill(){return this._disableCheckedFill}set disableCheckedFill(t){this._disableCheckedFill=t}get disableCheckedStroke(){return this._disableCheckedStroke}set disableCheckedStroke(t){this._disableCheckedStroke=t}getStyle(t){return new nw(t,this)}clone(){return new nw(this)}}function rw(t,e,i){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:QC,n=arguments.length>4?arguments[4]:void 0,r=arguments.length>5?arguments[5]:void 0;var s,l;return t||e?t instanceof QC?t:"function"==typeof t?rw(t(i),e,i,o,n,r):(t||(t={}),n&&!Q(t.autoWrapText)&&(t.autoWrapText=!0),o===ow?new ow(null!=t?t:{},null!=e?e:{},null!==(s=r.checkboxStyle)&&void 0!==s?s:{}):o===nw?new nw(null!=t?t:{},null!=e?e:{},null!==(l=r.radioStyle)&&void 0!==l?l:{}):new o(null!=t?t:{},null!=e?e:{})):o.DEFAULT}class sw{static get mode(){return sw._mode||(sw._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}()),sw._mode}static set mode(t){sw._mode=t}static RegisterCreateCanvas(t){sw.CreateCanvas=t}static RegisterLoadImage(t){sw.LoadImage=t}static GetCreateCanvasFunc(){return sw.CreateCanvas?sw.CreateCanvas:"worker"===sw.mode?function(){return new OffscreenCanvas(arguments.length>0&&void 0!==arguments[0]?arguments[0]:200,arguments.length>1&&void 0!==arguments[1]?arguments[1]:200)}:void 0}static RegisterRequestAnimationFrame(t){sw.RequestAnimationFrame=t()}static GetRequestAnimationFrame(){if(sw.RequestAnimationFrame)return sw.RequestAnimationFrame}static RegisterCancelAnimationFrame(t){sw.CancelAnimationFrame=t()}static GetCancelAnimationFrame(){if(sw.CancelAnimationFrame)return sw.CancelAnimationFrame}}sw.dpr=0;const lw=(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,aw=t=>lw(t,"object"),hw=t=>lw(t,"string"),dw=t=>lw(t,"number"),cw=t=>lw(t,"boolean");function uw(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),o=1;o<e;o++)i[o-1]=arguments[o];if(!i.length)return t||{};const n=i.shift();if(aw(t)&&aw(n))for(const e in n)aw(n[e])?(t[e]||Object.assign(t,{[e]:{}}),aw(t[e])||Object.assign(t,{[e]:n[e]}),uw(t[e],n[e])):null!==n[e]&&void 0!==n[e]&&Object.assign(t,{[e]:n[e]});return uw(t,...i)}function gw(t){return"function"==typeof t&&(t=t()),Q(t)?`${t}`:""}function pw(t,e){let i=null;return function(){for(var o=arguments.length,n=new Array(o),r=0;r<o;r++)n[r]=arguments[r];i||(t.apply(this,n),i=setTimeout((()=>{i=null}),e))}}function fw(t,e){for(t=`${t}`;t.length<e;)t="0"+t;return t}function vw(t,e,i){t=(t=t.replace(/^\s*|\s*$/,"")).replace(/^#?([a-f0-9])([a-f0-9])([a-f0-9])$/i,"#$1$1$2$2$3$3");const o=Math.round(256*e)*(i?-1:1),n=t.match(new RegExp("^rgba?\\(\\s*(\\d|[1-9]\\d|1\\d{2}|2[0-4][0-9]|25[0-5])\\s*,\\s*(\\d|[1-9]\\d|1\\d{2}|2[0-4][0-9]|25[0-5])\\s*,\\s*(\\d|[1-9]\\d|1\\d{2}|2[0-4][0-9]|25[0-5])(?:\\s*,\\s*(0|1|0?\\.\\d+))?\\s*\\)$","i")),r=n&&Q(n[4])?n[4]:null,s=n?[n[1],n[2],n[3]]:t.replace(/^#?([a-f0-9][a-f0-9])([a-f0-9][a-f0-9])([a-f0-9][a-f0-9])/i,(function(){return`${parseInt(arguments[1],16)},${parseInt(arguments[2],16)},${parseInt(arguments[3],16)}`})).split(/,/);return n?`rgb${null!==r?"a":""}(${Math[i?"max":"min"](parseInt(s[0],10)+o,i?0:255)}, ${Math[i?"max":"min"](parseInt(s[1],10)+o,i?0:255)}, ${Math[i?"max":"min"](parseInt(s[2],10)+o,i?0:255)}${null!==r?`, ${r}`:""})`:["#",fw(Math[i?"max":"min"](parseInt(s[0],10)+o,i?0:255).toString(16),2),fw(Math[i?"max":"min"](parseInt(s[1],10)+o,i?0:255).toString(16),2),fw(Math[i?"max":"min"](parseInt(s[2],10)+o,i?0:255).toString(16),2)].join("")}function mw(t){return hw(t)||dw(t)||cw(t)?t.toString():""}function bw(){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 yw(t,e,i){return"desc"!==i?t===e?0:t>e?1:-1:t===e?0:t<e?1:-1}function Cw(t){const e=[];for(let i=0;i<t.length;i++)-1===e.indexOf(t[i])&&e.push(t[i]);return e}function ww(t,e,i){i(t),(null==t?void 0:t[e])&&Array.isArray(null==t?void 0:t[e])&&t[e].forEach((t=>ww(t,e,i)))}const xw="undefined"==typeof window||void 0===window.window;let _w,Sw;const Aw={get find(){return _w||(_w=Array.prototype.find?(t,e)=>Array.prototype.find.call(t,e):(t,e)=>{const i=Aw.findIndex(t,e);return i>=0?t[i]:void 0},_w)},get findIndex(){return Sw||(Sw=Array.prototype.findIndex?(t,e)=>Array.prototype.findIndex.call(t,e):(t,e)=>{const{length:i}=t;for(let o=0;o<i;o++)if(e(t[o],o,t))return o;return-1},Sw)}};const{IE:Bw,Chrome:Rw,Firefox:Mw,Edge:Tw,Safari:kw}=function(){if(xw)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 Lw(){const t={};for(var e=arguments.length,i=new Array(e),o=0;o<e;o++)i[o]=arguments[o];return i.forEach((e=>{for(const i in e)Object.defineProperty(t,i,{get:()=>e[i],set(t){e[i]=t},configurable:!0,enumerable:!0})})),t}function Pw(t,e){let i=t;for(let t=0;t<(arguments.length<=2?0:arguments.length-2)&&null!=i;t++)i=e(i,t+2<2||arguments.length<=t+2?void 0:arguments[t+2]);return i}function Ew(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),o=1;o<e;o++)i[o-1]=arguments[o];return Pw(t,((t,e)=>t[e]),...i)}function Hw(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),o=1;o<e;o++)i[o-1]=arguments[o];return"function"==typeof t?t(...i):t}function Fw(t){return Boolean(t&&"function"==typeof t.then)}function zw(t,e){Fw(t)?t.then((t=>{e(t)})).catch((t=>{})):e(t)}function Iw(t){return Array.isArray(t)?3===t.length?[t[0],t[1],t[2],t[1]]:2===t.length?[t[0],t[1],t[0],t[1]]:1===t.length?[t[0],t[0],t[0],t[0]]:[t[0],t[1],t[2],t[3]]:[t,t,t,t]}function Ow(t,e,i){return t.start.col<=e&&e<=t.end.col&&t.start.row<=i&&i<=t.end.row||t.end.col<=e&&e<=t.start.col&&t.end.row<=i&&i<=t.start.row}function Dw(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 Ww(t,e){const i=Dw(t),o=Dw(e);return Math.max(i.start.col,o.start.col)<=Math.min(i.end.col,o.end.col)&&Math.max(i.start.row,o.start.row)<=Math.min(i.end.row,o.end.row)}const Nw=Bw,Gw={isObject:function(t){return t===Object(t)}},jw={endsWith:function(t,e,i){const o=mw(t);("number"!=typeof i||!isFinite(i)||Math.floor(i)!==i||i>o.length)&&(i=o.length),i-=e.length;const n=o.lastIndexOf(e,i);return-1!==n&&n===i}},Vw={isTouchEvent:function(t){return!!t.changedTouches}},Uw={toBoxArray:Iw},$w=Function.prototype,Xw={CLICK_CELL:"click_cell",DBLCLICK_CELL:"dblclick_cell",MOUSEDOWN_CELL:"mousedown_cell",MOUSEUP_CELL:"mouseup_cell",SELECTED_CELL:"selected_cell",SELECTED_CLEAR:"selected_clear",KEYDOWN:"keydown",MOUSEENTER_TABLE:"mouseenter_table",MOUSELEAVE_TABLE:"mouseleave_table",MOUSEDOWN_TABLE:"mousedown_table",MOUSEMOVE_TABLE:"mousemove_table",MOUSEMOVE_CELL:"mousemove_cell",MOUSEENTER_CELL:"mouseenter_cell",MOUSELEAVE_CELL:"mouseleave_cell",CONTEXTMENU_CELL:"contextmenu_cell",RESIZE_COLUMN:"resize_column",RESIZE_COLUMN_END:"resize_column_end",RESIZE_ROW:"resize_row",RESIZE_ROW_END:"resize_row_end",CHANGE_HEADER_POSITION_START:"change_header_position_start",CHANGE_HEADER_POSITION:"change_header_position",SORT_CLICK:"sort_click",AFTER_SORT:"after_sort",FREEZE_CLICK:"freeze_click",SCROLL:"scroll",SCROLL_HORIZONTAL_END:"scroll_horizontal_end",SCROLL_VERTICAL_END:"scroll_vertical_end",DROPDOWN_MENU_CLICK:"dropdown_menu_click",MOUSEOVER_CHART_SYMBOL:"mouseover_chart_symbol",DRAG_SELECT_END:"drag_select_end",COPY_DATA:"copy_data",DROPDOWN_ICON_CLICK:"dropdown_icon_click",DROPDOWN_MENU_CLEAR:"dropdown_menu_clear",TREE_HIERARCHY_STATE_CHANGE:"tree_hierarchy_state_change",SHOW_MENU:"show_menu",HIDE_MENU:"hide_menu",ICON_CLICK:"icon_click",LEGEND_ITEM_CLICK:"legend_item_click",LEGEND_ITEM_HOVER:"legend_item_hover",LEGEND_ITEM_UNHOVER:"legend_item_unHover",LEGEND_CHANGE:"legend_change",MOUSEENTER_AXIS:"mouseenter_axis",MOUSELEAVE_AXIS:"mouseleave_axis",CHECKBOX_STATE_CHANGE:"checkbox_state_change",RADIO_STATE_CHANGE:"radio_state_change",AFTER_RENDER:"after_render",INITIALIZED:"initialized",CHANGE_CELL_VALUE:"change_cell_value",DRAG_FILL_HANDLE_END:"drag_fill_handle_end",MOUSEDOWN_FILL_HANDLE:"mousedown_fill_handle",DBLCLICK_FILL_HANDLE:"dblclick_fill_handle"},Yw=(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 Kw(t,e,i){let o,n,r,s,l,a,h=0,d=!1,c=!1,u=!0;const g=!e&&0!==e&&"function"==typeof requestAnimationFrame;if("function"!=typeof t)throw new TypeError("Expected a function");function p(e){const i=o,r=n;return n=void 0,o=void 0,h=e,s=t.apply(r,i),s}function f(t,e){return g?requestAnimationFrame(t):setTimeout(t,e)}function v(t){const i=t-a;return void 0===a||i>=e||i<0||d&&t-h>=r}function m(){const t=Date.now();if(v(t))return function(t){return l=void 0,u&&o?p(t):(n=void 0,o=void 0,s)}(t);l=f(m,function(t){const i=t-h,o=e&&-(t-a);return d?Math.min(o,r-i):o}(t))}return e=+e||0,Yw(i,"object")&&(c=!!i.leading,d="maxWait"in i,d&&(r=Math.max(+i.maxWait||0,e)),u="trailing"in i?!!i.trailing:u),function(){const t=Date.now(),i=v(t);for(var r=arguments.length,u=new Array(r),g=0;g<r;g++)u[g]=arguments[g];if(o=u,n=this,a=t,i){if(void 0===l)return function(t){return h=t,l=f(m,e),c?p(t):s}(a);if(d)return l=f(m,e),p(a)}return void 0===l&&(l=f(m,e)),s}}let qw=1,Zw=class{constructor(){this.listeners={},this.reseizeListeners={}}on(t,e,i){if("node"===sw.mode)return-1;const o=qw++;for(var n=arguments.length,r=new Array(n>3?n-3:0),s=3;s<n;s++)r[s-3]=arguments[s];if(null==t?void 0:t.addEventListener)if("resize"!==e||t===window)null==t||t.addEventListener(e,i,...r);else{const e=new class{constructor(t,e,i){var o;if(this.resizeTime=100,this.lastSize={width:0,height:0},this.mutationResize=()=>{this.onResize()},this.callBack=()=>{const t=this.getSize();let e=!1;t.width===this.lastSize.width&&t.height===this.lastSize.height&&(e=!0),this.lastSize=t,this.cb&&this.cb(Object.assign(Object.assign({},this.lastSize),{windowSizeNotChange:e}))},this.onResize=()=>{this.callBackDebounce()},this.element=t,this.cb=e,this.lastSize=this.getSize(),i&&(this.resizeTime=Math.max(i,16)),this.callBackDebounce=Kw(this.callBack,this.resizeTime),null===window||void 0===window||window.addEventListener("resize",this.onResize),"ResizeObserver"in window){const t=window.ResizeObserver;this.observer=new t(this.mutationResize),null===(o=this.observer)||void 0===o||o.observe(this.element)}else"MutationObserver"in window&&(this.observer=new MutationObserver(this.mutationResize),this.observer.observe(this.element,{attributes:!0,attributeFilter:["style"]}))}disConnect(){window.removeEventListener("resize",this.onResize),this.observer&&(this.observer.disconnect(),this.observer=void 0)}setSize(t){this.lastSize=t}checkSize(){const t=this.getSize();return t.width!==this.lastSize.width||t.height!==this.lastSize.height}getSize(){return this.element?{width:Math.floor(this.element.clientWidth),height:Math.floor(this.element.clientHeight)}:Object.assign({},this.lastSize)}}(t,i,this.resizeTime);this.reseizeListeners[o]=e}const l={target:t,type:e,listener:i,options:r};return this.listeners[o]=l,o}once(t,e,i){var o=this;if("node"===sw.mode)return-1;for(var n=arguments.length,r=new Array(n>3?n-3:0),s=3;s<n;s++)r[s-3]=arguments[s];const l=this.on(t,e,(function(){o.off(l),i(...arguments)}),...r);return l}off(t){var e;if("node"===sw.mode)return;if(null===t)return;const i=null===(e=this.listeners)||void 0===e?void 0:e[t];i&&(delete this.listeners[t],i.target.removeEventListener&&i.target.removeEventListener(i.type,i.listener,...i.options))}fire(t,e){if("node"!==sw.mode){for(var i=arguments.length,o=new Array(i>2?i-2:0),n=2;n<i;n++)o[n-2]=arguments[n];for(const i in this.listeners){const n=this.listeners[i];n.target===t&&n.type===e&&n.listener.call(n.target,...o)}}}hasListener(t,e){if("node"===sw.mode)return!1;let i=!1;for(const o in this.listeners){const n=this.listeners[o];n.target===t&&n.type===e&&(i=!0)}return i}clear(){if("node"!==sw.mode){for(const t in this.listeners){const e=this.listeners[t];e.target.removeEventListener&&e.target.removeEventListener(e.type,e.listener,...e.options)}for(const t in this.reseizeListeners){const e=this.reseizeListeners[t];null==e||e.disConnect()}this.listeners={}}}release(){"node"!==sw.mode&&(this.clear(),this.listeners={})}};const Jw=(t,e)=>{let i=0,o=t.length-1;for(;i<=o;){const n=Math.floor((i+o)/2);if(t[n]===e)return n;t[n]>e?o=n-1:i=n+1}return o<0?0:o};class Qw{constructor(){this._keys=[],this._vals={},this._sorted=!1}count(){return this._keys.length}values(){return this._vals}valueArr(){return Object.values(this._vals)}adjustOrder(t,e,i){const{_keys:o}=this;if(this._sorted||(o.sort(((t,e)=>t<e?-1:t>e?1:0)),this._sorted=!0),t>e){const n=[];for(let r=Jw(o,t+i-1);r>=0;r--){const s=o[r];if(s>=t)n.push(this.get(s));else if(e<=s&&s<t)this.put(s+i,this.get(s));else if(s<e)break}for(let t=0;t<i;t++)this.put(e+t,n[i-1-t])}const{length:n}=o;if(t<e){const r=[];for(let s=Jw(o,t);s<n;s++){const n=o[s];if(n>=t&&n<t+i)r.push(this.get(n));else if(t+i<=n&&n<=e)this.put(n-i,this.get(n));else if(n>e)break}for(let t=0;t<i;t++)this.put(e+t,r[t])}}exchangeOrder(t,e,i,o,n){const{_keys:r}=this;if(this._sorted||(r.sort(((t,e)=>t<e?-1:t>e?1:0)),this._sorted=!0),t>i){const o=[],s=[];for(let n=Jw(r,i);n<t+e;n++){const i=r[n];i>=t&&i<t+e?s.push(this.get(i)):o.push(this.get(i))}for(let t=0;t<e;t++)this.put(n+t,s[t]);for(let t=0;t<o.length;t++)this.put(n+e+t,o[t])}else{const s=[],l=[];for(let n=Jw(r,t);n<i+o;n++){const i=r[n];i>=t&&i<t+e?l.push(this.get(i)):s.push(this.get(i))}for(let t=0;t<e;t++)this.put(n+t,l[t]);for(let e=0;e<s.length;e++)this.put(t+e,s[e])}}del(t){delete this._vals[t];const e=this._keys.indexOf(t);-1!==e&&this._keys.splice(e,1)}put(t,e){t in this._vals||(this._keys.push(t),this._sorted=!1),this._vals[t]=e}get(t){return this._vals[t]}has(t){return Q(this._vals[t])}contain(t){return Object.values(this._vals).indexOf(t)>=0}each(t,e,i){const{_keys:o}=this,{length:n}=o;this._sorted||(o.sort(((t,e)=>t<e?-1:t>e?1:0)),this._sorted=!0);for(let r=Jw(o,t);r<n;r++){const n=o[r];if(t<=n&&n<=e){if(!1===i(this.get(n),n))break}else if(e<n)return}}clear(){this._keys.length=0,this._vals={},this._sorted=!1}getLastIndex(){return this._keys[this._keys.length-1]}delLast(){const t=this.getLastIndex();this.del(t)}delAndReorder(t){if(!this.has(t))return;const e=this.getLastIndex();this.adjustOrder(t+1,t,e-t),this.delLast()}addAndReorder(t,e){const i=this.getLastIndex();this.adjustOrder(t,t+1,i-t),Q(e)&&this.put(t,e)}}let tx=class t{constructor(t,e,i,o){this.bounds=new ze,this.bounds.set(t,e,t+i,e+o)}static bounds(e,i,o,n){return new t(e,i,Math.round(o-e),Math.round(n-i))}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 ex={name:"DARK",underlayBackgroundColor:"transparent",defaultStyle:{color:"#D3D5DA",bgColor:"#373b45",fontSize:12,fontFamily:"PingFang SC",fontWeight:500,lineHeight:12,borderColor:"#444A54",padding:[8,12,8,12],hover:{cellBgColor:"#2F4774"}},headerStyle:{color:"#D3D5DA",bgColor:"#373b45",fontSize:12,fontFamily:"PingFang SC",fontWeight:500,lineHeight:12,borderColor:"#444A54",padding:[8,12,8,12],hover:{cellBgColor:"#2F4774"}},rowHeaderStyle:{},cornerHeaderStyle:{},bodyStyle:{color:"#e5e7ea",bgColor:function(t){const{row:e,table:i}=t;return 1&e-i.frozenRowCount?"#282a2e":"#2d3137"},fontSize:12,fontFamily:"PingFang SC",fontWeight:500,lineHeight:12,borderColor:"#444A54",padding:[8,12,8,12],hover:{cellBgColor:"#29364D"}},frameStyle:{borderColor:"#d1d5da",borderLineWidth:1,borderLineDash:[],cornerRadius:10,shadowBlur:6,shadowOffsetX:0,shadowOffsetY:0,shadowColor:"rgba(00, 24, 47, 0.06)"},columnResize:{lineWidth:1,lineColor:"#416EFF",bgColor:"#D9E2FF",width:3},frozenColumnLine:{shadow:{width:4,startColor:"rgba(00, 24, 47, 0.05)",endColor:"rgba(00, 24, 47, 0)"}},selectionStyle:{cellBgColor:"rgba(255, 255, 255, 0.1)",cellBorderColor:"#4284FF",cellBorderLineWidth:2},tooltipStyle:{bgColor:"#FFF",color:"#000",fontSize:12,fontFamily:"Arial,sans-serif"},functionalIconsStyle:{sort_color:"#FFFFFF",sort_color_opacity:"0.75",sort_color_2:"#416EFF",sort_color_opacity_2:"1",frozen_color:"#FFFFFF",frozen_color_opacity:"0.75",collapse_color:"#FFF",collapse_color_opacity:"0.75",expand_color:"#FFF",expand_color_opacity:"0.75",dragReorder_color:"#FFF",dragReorder_color_opacity:"0.75"}};var ix={name:"BRIGHT",underlayBackgroundColor:"#FFF",defaultStyle:{color:"#FFF",bgColor:"#5389FF",borderColor:"#5286FA",hover:{cellBgColor:"#2E67E3"}},headerStyle:{color:"#FFF",bgColor:"#5389FF",borderColor:"#A1C1FF",hover:{cellBgColor:"#2E67E3"}},bodyStyle:{color:"#000",bgColor:function(t){const{row:e,table:i}=t;return 1&e-i.frozenRowCount?"#FFF":"#F4F8FF"},borderColor:"#E0EAFE",hover:{cellBgColor:"#E9EFFD"}},frameStyle:{borderColor:"#E1E4E8",borderLineWidth:1,borderLineDash:[],cornerRadius:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,shadowColor:"black"},columnResize:{lineWidth:1,lineColor:"#416EFF",bgColor:"#D9E2FF",width:3},frozenColumnLine:{shadow:{width:3,startColor:"#CBDCFE",endColor:"#CBDCFE"}},selectionStyle:{cellBgColor:"rgba(0, 0, 255,0.1)"},tooltipStyle:{bgColor:"#FFF",color:"#000",fontSize:12,fontFamily:"Arial,sans-serif"}};var ox={name:"ARCO",underlayBackgroundColor:"#FFF",defaultStyle:{color:"#1B1F23",bgColor:"#EEF1F5",fontSize:14,fontFamily:"Arial,sans-serif",fontWeight:600,lineHeight:14,borderColor:"#e1e4e8",padding:[8,12,8,12]},headerStyle:{color:"#1B1F23",bgColor:"#EEF1F5",fontSize:14,fontFamily:"Arial,sans-serif",fontWeight:600,lineHeight:14,borderColor:"#e1e4e8",padding:[8,12,8,12],hover:{cellBgColor:"#c8daf6"}},rowHeaderStyle:{color:"#1B1F23",bgColor:"#EEF1F5",fontSize:12,fontFamily:"PingFang SC",fontWeight:500,lineHeight:12,borderColor:"#e1e4e8",padding:[8,12,8,12],hover:{cellBgColor:"#c8daf6"}},cornerHeaderStyle:{color:"#1B1F23",bgColor:"#EEF1F5",fontSize:12,fontFamily:"PingFang SC",fontWeight:500,lineHeight:12,borderColor:"#e1e4e8",padding:[8,12,8,12],hover:{cellBgColor:"#c8daf6"}},bodyStyle:{padding:[8,12,8,12],color:"#141414",fontSize:14,fontFamily:"Arial,sans-serif",fontWeight:400,textAlign:"left",bgColor:function(t){const{row:e,table:i}=t;return 1&e-i.frozenRowCount?"#fbfbfc":"#FFF"},borderColor:"#e1e4e8",lineHeight:14,hover:{cellBgColor:"#F7F8FA",inlineRowBgColor:"#F3F8FF",inlineColumnBgColor:"#F3F8FF"}},frameStyle:{borderColor:"#d1d5da",borderLineWidth:1,borderLineDash:[],cornerRadius:4,shadowBlur:6,shadowOffsetX:0,shadowOffsetY:0,shadowColor:"rgba(00, 24, 47, 0.06)"},columnResize:{lineWidth:1,lineColor:"#416EFF",bgColor:"#D9E2FF",width:3},frozenColumnLine:{shadow:{width:4,startColor:"rgba(00, 24, 47, 0.05)",endColor:"rgba(00, 24, 47, 0)"}},selectionStyle:{cellBgColor:"rgba(0, 0, 255,0.1)",cellBorderLineWidth:2,cellBorderColor:"#3073f2"},tooltipStyle:{bgColor:"#FFF",color:"#000",fontSize:12,fontFamily:"Arial,sans-serif"}};var nx={name:"DEFAULT",underlayBackgroundColor:"#FFF",defaultStyle:{borderColor:"#E1E4E8",color:"#000",bgColor:"#ECF1F5"},headerStyle:{fontSize:16,fontWeight:"bold",bgColor:"#ECF1F5",hover:{cellBgColor:"#CCE0FF",inlineRowBgColor:"#F3F8FF",inlineColumnBgColor:"#F3F8FF"}},rowHeaderStyle:{fontSize:16,fontWeight:"bold",bgColor:"#ECF1F5",hover:{cellBgColor:"#CCE0FF",inlineRowBgColor:"#F3F8FF",inlineColumnBgColor:"#F3F8FF"}},cornerHeaderStyle:{fontSize:16,fontWeight:"bold"},bodyStyle:{fontSize:14,bgColor:function(t){const{row:e,table:i}=t;return 1&e-i.frozenRowCount?"#FDFDFD":"#FAF9FB"},hover:{cellBgColor:"#CCE0FF",inlineRowBgColor:"#F3F8FF",inlineColumnBgColor:"#F3F8FF"}},frameStyle:{borderColor:"#E1E4E8",borderLineWidth:1,borderLineDash:[],cornerRadius:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,shadowColor:"black"},columnResize:{lineWidth:1,lineColor:"#416EFF",bgColor:"#D9E2FF",width:3},frozenColumnLine:{shadow:{width:3,startColor:"rgba(225, 228, 232, 0.6)",endColor:"rgba(225, 228, 232, 0.6)"}},selectionStyle:{cellBgColor:"rgba(0, 0, 255,0.1)",cellBorderLineWidth:2,cellBorderColor:"#0000ff"},tooltipStyle:{bgColor:"#FFF",color:"#000",fontSize:12,fontFamily:"Arial,sans-serif"}};var rx={name:"SIMPLIFY",underlayBackgroundColor:"#FFF",defaultStyle:{borderColor:function(t){const{col:e,table:i}=t,{colCount:o,frozenColCount:n}=i,r="#ccc7c7";return n-1===e||o-1===e?[r,"#f2f2f2","#ccc7c7",null]:[r,null,"#ccc7c7",null]},hover:{cellBorderColor:"#0000FF",cellBgColor:"#D0E0E3"},bgColor:"#FFF"},headerStyle:{color:"rgba(0, 0, 0, 0.87)",borderColor:function(t){const{row:e,table:{frozenRowCount:i}}=t;return i-1===e?["#f2f2f2","#f2f2f2","#ccc7c7","#f2f2f2"]:["#f2f2f2"]}},bodyStyle:{color:"rgba(0, 0, 0, 0.87)"},frameStyle:{borderColor:"#f2f2f2",borderLineWidth:1},columnResize:{lineWidth:1,lineColor:"#416EFF",bgColor:"#D9E2FF"},selectionStyle:{cellBorderColor:"#FD5",cellBgColor:"rgba(111, 168, 220, 0.1)"},tooltipStyle:{bgColor:"#FFF",color:"#000",fontSize:12,fontFamily:"Arial,sans-serif"}};const sx={},lx="Arial,sans-serif",ax=[],hx=/^(https?|ftp|file):\/\/[-A-Za-z0-9+&@#/%?=~_|!:,.;]+[-A-Za-z0-9+&@#/%=~_|]/,dx="$$indicator$$",cx={type:"line"};function ux(t){return t||{}}const gx={visible:!0,position:"auto",padding:8,titleStyle:{fontSize:12,fontWeight:"bold",fill:"#4E5969"},contentStyle:{fontSize:12,fill:"#4E5969"},panel:{visible:!0,fill:"#fff",stroke:"#ffffff",lineWidth:0,cornerRadius:3,shadowBlur:12,shadowOffsetX:0,shadowOffsetY:4,shadowColor:"rgba(0, 0, 0, 0.1)",size:0,space:12}};function px(t,e,i,o){var n,r,s;return null!==(s=null!==(r=null!==(n=Ew(t,...i))&&void 0!==n?n:Ew(e,...i))&&void 0!==r?r:o&&Ew(t,...o))&&void 0!==s?s:o&&Ew(e,...o)}class fx{constructor(t,e){this._defaultStyle=null,this._header=null,this._cornerHeader=null,this._cornerRightTopCell=null,this._cornerLeftBottomCell=null,this._cornerRightBottomCell=null,this._rightFrozen=null,this._bottomFrozen=null,this._rowHeader=null,this._body=null,this._groupTitle=null,this._scroll=null,this._tooltip=null,this._frameStyle=null,this._columnResize=null,this._dragHeaderSplitLine=null,this._frozenColumnLine=null,this._selectionStyle=null,this._axisStyle=null,this._checkboxStyle=null,this._radioStyle=null,this._textPopTipStyle=null,this._internalIconsStyle=null,this.isPivot=!1,this.name="",this.internalTheme={obj:t,superTheme:e},this.name=px(t,e,["name"])}getExtendTheme(){return this.internalTheme.obj}clearBodyStyleCache(){this._body=null}get font(){const{obj:t,superTheme:e}=this.internalTheme;return px(t,e,["font"],["bodyStyle","font"])}get underlayBackgroundColor(){const{obj:t,superTheme:e}=this.internalTheme;return px(t,e,["underlayBackgroundColor"])}get cellInnerBorder(){var t;const{obj:e,superTheme:i}=this.internalTheme;return null===(t=px(e,i,["cellInnerBorder"]))||void 0===t||t}get cellBorderClipDirection(){var t;const{obj:e,superTheme:i}=this.internalTheme;return null!==(t=px(e,i,["cellBorderClipDirection"]))&&void 0!==t?t:"top-left"}get _contentOffset(){var t;const{obj:e,superTheme:i}=this.internalTheme;return null!==(t=px(e,i,["_contentOffset"]))&&void 0!==t?t:0}get defaultStyle(){const t=this;if(!this._defaultStyle){const{obj:e,superTheme:i}=this.internalTheme,o=uw({},i.defaultStyle,e.defaultStyle);this._defaultStyle={get fontSize(){var t;return null!==(t=o.fontSize)&&void 0!==t?t:16},get fontFamily(){var t;return null!==(t=o.fontFamily)&&void 0!==t?t:lx},get fontWeight(){return o.fontWeight},get fontVariant(){return o.fontVariant},get fontStyle(){return o.fontStyle},get bgColor(){var t;return null!==(t=o.bgColor)&&void 0!==t?t:"#FFF"},get color(){var t;return null!==(t=o.color)&&void 0!==t?t:"#000"},get borderColor(){var t;return null!==(t=o.borderColor)&&void 0!==t?t:"#000"},get borderLineWidth(){var t;return null!==(t=o.borderLineWidth)&&void 0!==t?t:1},get borderLineDash(){var t;return null!==(t=o.borderLineDash)&&void 0!==t?t:ax},get hover(){if(o.hover)return{get cellBgColor(){var t,e;return null!==(e=null===(t=o.hover)||void 0===t?void 0:t.cellBgColor)&&void 0!==e?e:void 0},get inlineColumnBgColor(){var t,e,i,n,r,s;return null!==(s=null!==(e=null===(t=o.hover)||void 0===t?void 0:t.inlineColumnBgColor)&&void 0!==e?e:(null===(i=o.hover)||void 0===i?void 0:i.cellBgColor)&&"string"==typeof(null===(n=o.hover)||void 0===n?void 0:n.cellBgColor)?vw(null===(r=o.hover)||void 0===r?void 0:r.cellBgColor,.1,!1):void 0)&&void 0!==s?s:void 0},get inlineRowBgColor(){var t,e,i,n,r,s;return null!==(s=null!==(e=null===(t=o.hover)||void 0===t?void 0:t.inlineRowBgColor)&&void 0!==e?e:(null===(i=o.hover)||void 0===i?void 0:i.cellBgColor)&&"string"==typeof(null===(n=o.hover)||void 0===n?void 0:n.cellBgColor)?vw(null===(r=o.hover)||void 0===r?void 0:r.cellBgColor,.1,!1):void 0)&&void 0!==s?s:void 0}}},get select(){if(o.select)return{get inlineColumnBgColor(){var e,i,n,r,s,l;return null!==(l=null!==(r=null!==(i=null===(e=o.select)||void 0===e?void 0:e.inlineColumnBgColor)&&void 0!==i?i:null===(n=t.selectionStyle)||void 0===n?void 0:n.inlineColumnBgColor)&&void 0!==r?r:(null===(s=t.selectionStyle)||void 0===s?void 0:s.cellBgColor)&&"string"==typeof t.selectionStyle.cellBgColor?vw(t.selectionStyle.cellBgColor,.1,!1):void 0)&&void 0!==l?l:void 0},get inlineRowBgColor(){var e,i,n,r,s;return null!==(s=null!==(n=null!==(i=null===(e=o.select)||void 0===e?void 0:e.inlineRowBgColor)&&void 0!==i?i:t.selectionStyle.inlineRowBgColor)&&void 0!==n?n:(null===(r=t.selectionStyle)||void 0===r?void 0:r.cellBgColor)&&"string"==typeof t.selectionStyle.cellBgColor?vw(t.selectionStyle.cellBgColor,.1,!1):void 0)&&void 0!==s?s:void 0}}},get padding(){var t;return null!==(t=o.padding)&&void 0!==t?t:[10,16,10,16]},get textAlign(){var t;return null!==(t=o.textAlign)&&void 0!==t?t:"left"},get textBaseline(){var t;return null!==(t=o.textBaseline)&&void 0!==t?t:"middle"},get textOverflow(){var t;return null!==(t=o.textOverflow)&&void 0!==t?t:"ellipsis"},get lineHeight(){return o.lineHeight},get autoWrapText(){var t;return null!==(t=o.autoWrapText)&&void 0!==t&&t},get lineClamp(){var t;return null!==(t=o.lineClamp)&&void 0!==t?t:"auto"},get linkColor(){var t;return null!==(t=o.linkColor)&&void 0!==t?t:"#3772ff"},get cursor(){var t;return null!==(t=o.cursor)&&void 0!==t?t:"auto"},get marked(){var t;return null!==(t=o.marked)&&void 0!==t&&t},get underline(){var t;return null!==(t=o.underline)&&void 0!==t&&t},get underlineColor(){return o.underlineColor},get underlineDash(){return o.underlineDash},get underlineOffset(){return o.underlineOffset},get lineThrough(){var t;return null!==(t=o.lineThrough)&&void 0!==t&&t},get lineThroughColor(){return o.lineThroughColor},get lineThroughDash(){return o.lineThroughDash}}}return this._defaultStyle}get cornerHeaderStyle(){if(!this._cornerHeader){const{obj:t,superTheme:e}=this.internalTheme,i=uw({},this.defaultStyle,e.cornerHeaderStyle,t.cornerHeaderStyle);this._cornerHeader=this.getStyle(i)}return this._cornerHeader}get cornerRightTopCellStyle(){if(!this._cornerRightTopCell){const{obj:t,superTheme:e}=this.internalTheme;if(!e.cornerRightTopCellStyle&&!t.cornerRightTopCellStyle)return this._cornerRightTopCell;const i=uw({},this.defaultStyle,e.cornerRightTopCellStyle,t.cornerRightTopCellStyle);this._cornerRightTopCell=this.getStyle(i)}return this._cornerRightTopCell}get cornerLeftBottomCellStyle(){if(!this._cornerLeftBottomCell){const{obj:t,superTheme:e}=this.internalTheme;if(!e.cornerLeftBottomCellStyle&&!t.cornerLeftBottomCellStyle)return this._cornerLeftBottomCell;const i=uw({},this.defaultStyle,e.cornerLeftBottomCellStyle,t.cornerLeftBottomCellStyle);this._cornerLeftBottomCell=this.getStyle(i)}return this._cornerLeftBottomCell}get cornerRightBottomCellStyle(){if(!this._cornerRightBottomCell){const{obj:t,superTheme:e}=this.internalTheme;if(!e.cornerRightBottomCellStyle&&!t.cornerRightBottomCellStyle)return this._cornerRightBottomCell;const i=uw({},this.defaultStyle,e.cornerRightBottomCellStyle,t.cornerRightBottomCellStyle);this._cornerRightBottomCell=this.getStyle(i)}return this._cornerRightBottomCell}get rightFrozenStyle(){if(!this._rightFrozen){const{obj:t,superTheme:e}=this.internalTheme;if(!e.rightFrozenStyle&&!t.rightFrozenStyle)return this._rightFrozen;const i=uw({},this.defaultStyle,this.rowHeaderStyle,e.rightFrozenStyle,t.rightFrozenStyle);this._rightFrozen=this.getStyle(i)}return this._rightFrozen}get bottomFrozenStyle(){if(!this._bottomFrozen){const{obj:t,superTheme:e}=this.internalTheme;if(!e.bottomFrozenStyle&&!t.bottomFrozenStyle)return this._bottomFrozen;const i=uw({},this.defaultStyle,this.headerStyle,e.bottomFrozenStyle,t.bottomFrozenStyle);this._bottomFrozen=this.getStyle(i)}return this._bottomFrozen}get rowHeaderStyle(){var t;if(!this._rowHeader){const{obj:e,superTheme:i}=this.internalTheme,o=uw({},this.defaultStyle,i.rowHeaderStyle,null!==(t=e.rowHeaderStyle)&&void 0!==t?t:this.isPivot?null:e.headerStyle);this._rowHeader=this.getStyle(o)}return this._rowHeader}get headerStyle(){if(!this._header){const{obj:t,superTheme:e}=this.internalTheme,i=uw({},this.defaultStyle,e.headerStyle,t.headerStyle);this._header=this.getStyle(i)}return this._header}get bodyStyle(){if(!this._body){const{obj:t,superTheme:e}=this.internalTheme,i=uw({},this.defaultStyle,e.bodyStyle,t.bodyStyle);this._body=this.getStyle(i)}return this._body}get groupTitleStyle(){if(!this._groupTitle){const{obj:t,superTheme:e}=this.internalTheme;if(!e.groupTitleStyle&&!t.groupTitleStyle)return this._groupTitle;const i=uw({},this.defaultStyle,e.groupTitleStyle,t.groupTitleStyle);this._groupTitle=this.getStyle(i)}return this._groupTitle}get frameStyle(){if(!this._frameStyle){const{obj:t,superTheme:e}=this.internalTheme,i=uw({},e.frameStyle,t.frameStyle);this._frameStyle={get borderColor(){return i.borderColor},get borderLineWidth(){return i.borderLineWidth},get borderLineDash(){return i.borderLineDash},get innerBorder(){return i.innerBorder},get shadowBlur(){return i.shadowBlur},get shadowColor(){return i.shadowColor},get shadowOffsetX(){return i.shadowOffsetX},get shadowOffsetY(){return i.shadowOffsetY},get cornerRadius(){return i.cornerRadius}}}return this._frameStyle}get scrollStyle(){if(!this._scroll){const{obj:t,superTheme:e}=this.internalTheme,i=uw({},e.scrollStyle,t.scrollStyle);this._scroll={get scrollSliderColor(){var t;return null!==(t=i.scrollSliderColor)&&void 0!==t?t:"#C0C0C0"},get scrollSliderCornerRadius(){return i.scrollSliderCornerRadius},get scrollRailColor(){return i.scrollRailColor},get visible(){var t;return null!==(t=i.visible)&&void 0!==t?t:"scrolling"},get verticalVisible(){return i.verticalVisible},get horizontalVisible(){return i.horizontalVisible},get width(){var t;return null!==(t=i.width)&&void 0!==t?t:7},get hoverOn(){var t;return null===(t=i.hoverOn)||void 0===t||t},get barToSide(){var t;return null!==(t=i.barToSide)&&void 0!==t&&t},get horizontalPadding(){var t;return null!==(t=i.horizontalPadding)&&void 0!==t?t:0},get verticalPadding(){var t;return null!==(t=i.verticalPadding)&&void 0!==t?t:0}}}return this._scroll}get tooltipStyle(){if(!this._tooltip){const{obj:t,superTheme:e}=this.internalTheme,i=uw({},e.tooltipStyle,t.tooltipStyle);this._tooltip={get fontFamily(){var t;return null!==(t=i.fontFamily)&&void 0!==t?t:lx},get fontSize(){var t;return null!==(t=i.fontSize)&&void 0!==t?t:16},get bgColor(){var t;return null!==(t=i.bgColor)&&void 0!==t?t:"#000"},get padding(){var t;return null!==(t=i.padding)&&void 0!==t?t:[6,8]},get color(){var t;return null!==(t=i.color)&&void 0!==t?t:"#FFF"},get maxWidth(){return i.maxWidth},get maxHeight(){return i.maxHeight}}}return this._tooltip}get columnResize(){if(!this._columnResize){const{obj:t,superTheme:e}=this.internalTheme,i=uw({},e.columnResize,t.columnResize);this._columnResize={get lineColor(){var t;return null!==(t=i.lineColor)&&void 0!==t?t:"#416EFF"},get bgColor(){var t;return null!==(t=i.bgColor)&&void 0!==t?t:"#D9E2FF"},get lineWidth(){var t;return null!==(t=i.lineWidth)&&void 0!==t?t:1},get width(){var t;return null!==(t=i.width)&&void 0!==t?t:i.lineWidth+2},get labelColor(){var t;return null!==(t=i.labelColor)&&void 0!==t?t:"#FFF"},get labelFontSize(){var t;return null!==(t=i.labelFontSize)&&void 0!==t?t:10},get labelFontFamily(){var t;return null!==(t=i.labelFontFamily)&&void 0!==t?t:"sans-serif"},get labelBackgroundFill(){var t;return null!==(t=i.labelBackgroundFill)&&void 0!==t?t:"#3073F2"},get labelBackgroundCornerRadius(){var t;return null!==(t=i.labelBackgroundCornerRadius)&&void 0!==t?t:5},get labelVisible(){var t;return null===(t=i.labelVisible)||void 0===t||t}}}return this._columnResize}get dragHeaderSplitLine(){if(!this._dragHeaderSplitLine){const{obj:t,superTheme:e}=this.internalTheme,i=uw({},e.dragHeaderSplitLine,t.dragHeaderSplitLine);this._dragHeaderSplitLine={get lineColor(){var t;return null!==(t=i.lineColor)&&void 0!==t?t:"blue"},get lineWidth(){var t;return null!==(t=i.lineWidth)&&void 0!==t?t:2},get shadowBlockColor(){var t;return null!==(t=i.shadowBlockColor)&&void 0!==t?t:"rgba(204,204,204,0.3)"}}}return this._dragHeaderSplitLine}get frozenColumnLine(){if(!this._frozenColumnLine){const{obj:t,superTheme:e}=this.internalTheme,i=uw({},e.frozenColumnLine,t.frozenColumnLine);this._frozenColumnLine={get shadow(){if(i.shadow)return{get width(){var t,e;return null!==(e=null===(t=i.shadow)||void 0===t?void 0:t.width)&&void 0!==e?e:24},get startColor(){var t,e;return null!==(e=null===(t=i.shadow)||void 0===t?void 0:t.startColor)&&void 0!==e?e:"rgba(00, 24, 47, 0.06)"},get endColor(){var t,e;return null!==(e=null===(t=i.shadow)||void 0===t?void 0:t.endColor)&&void 0!==e?e:"rgba(00, 24, 47, 0)"}}},get border(){if(i.border)return{get lineColor(){var t,e;return null!==(e=null===(t=i.border)||void 0===t?void 0:t.lineColor)&&void 0!==e?e:"rgba(00, 24, 47, 0.06)"},get bgColor(){var t,e,o,n;return null!==(n=null!==(e=null===(t=i.border)||void 0===t?void 0:t.bgColor)&&void 0!==e?e:null===(o=i.border)||void 0===o?void 0:o.lineColor)&&void 0!==n?n:"rgba(00, 24, 47, 0.06)"},get lineWidth(){var t,e;return null!==(e=null===(t=i.border)||void 0===t?void 0:t.lineWidth)&&void 0!==e?e:4},get width(){var t,e,o,n;return null!==(n=null!==(e=null===(t=i.border)||void 0===t?void 0:t.width)&&void 0!==e?e:null===(o=i.border)||void 0===o?void 0:o.lineWidth)&&void 0!==n?n:4}}}}}return this._frozenColumnLine}get selectionStyle(){if(!this._selectionStyle){const{obj:t,superTheme:e}=this.internalTheme,i=uw({},e.selectionStyle,t.selectionStyle);this._selectionStyle={get cellBgColor(){var t;return null!==(t=null==i?void 0:i.cellBgColor)&&void 0!==t?t:"rgba(0, 0, 255,0.1)"},get cellBorderColor(){var t;return null!==(t=null==i?void 0:i.cellBorderColor)&&void 0!==t?t:"#3073f2"},get cellBorderLineWidth(){var t;return null!==(t=null==i?void 0:i.cellBorderLineWidth)&&void 0!==t?t:2},get inlineColumnBgColor(){return null==i?void 0:i.inlineColumnBgColor},get inlineRowBgColor(){return null==i?void 0:i.inlineRowBgColor},get selectionFillMode(){var t;return null!==(t=null==i?void 0:i.selectionFillMode)&&void 0!==t?t:"overlay"}}}return this._selectionStyle}get axisStyle(){if(!this._axisStyle){const{obj:t,superTheme:e}=this.internalTheme,i=uw({},e.axisStyle,t.axisStyle);this._axisStyle=function(t){return{defaultAxisStyle:ux(t.defaultAxisStyle),leftAxisStyle:ux(t.leftAxisStyle),rightAxisStyle:ux(t.rightAxisStyle),topAxisStyle:ux(t.topAxisStyle),bottomAxisStyle:ux(t.bottomAxisStyle)}}(i)}return this._axisStyle}get checkboxStyle(){if(!this._checkboxStyle){const{obj:t,superTheme:e}=this.internalTheme,i=uw({},e.checkboxStyle,t.checkboxStyle);this._checkboxStyle=i}return this._checkboxStyle}get radioStyle(){if(!this._radioStyle){const{obj:t,superTheme:e}=this.internalTheme,i=uw({},e.radioStyle,t.radioStyle);this._radioStyle=i}return this._radioStyle}get textPopTipStyle(){if(!this._textPopTipStyle){const{obj:t,superTheme:e}=this.internalTheme,i=uw({},gx,e.textPopTipStyle,t.textPopTipStyle);this._textPopTipStyle=i}return this._textPopTipStyle}get functionalIconsStyle(){if(!this._internalIconsStyle){const{obj:t,superTheme:e}=this.internalTheme,i=uw({},e.functionalIconsStyle,t.functionalIconsStyle);this._internalIconsStyle=i}return this._internalIconsStyle}hasProperty(t){const{obj:e,superTheme:i}=this.internalTheme;return vx(e,t)||vx(i,t)}extends(t){return new fx(uw({},t),uw(this.internalTheme.superTheme,this.internalTheme.obj))}getStyle(t){const e=this;return{get fontSize(){return t.fontSize},get fontFamily(){return t.fontFamily},get fontWeight(){return t.fontWeight},get fontVariant(){return t.fontVariant},get fontStyle(){return t.fontStyle},get bgColor(){return t.bgColor},get color(){return t.color},get strokeColor(){return t.strokeColor},get borderColor(){return t.borderColor},get borderLineWidth(){return t.borderLineWidth},get borderLineDash(){return t.borderLineDash},get hover(){if(t.hover)return{get cellBgColor(){var e,i;return null!==(i=null===(e=t.hover)||void 0===e?void 0:e.cellBgColor)&&void 0!==i?i:void 0},get inlineColumnBgColor(){var e,i,o,n,r,s;return null!==(s=null!==(i=null===(e=t.hover)||void 0===e?void 0:e.inlineColumnBgColor)&&void 0!==i?i:(null===(o=t.hover)||void 0===o?void 0:o.cellBgColor)&&"string"==typeof(null===(n=t.hover)||void 0===n?void 0:n.cellBgColor)?vw(null===(r=t.hover)||void 0===r?void 0:r.cellBgColor,.1,!1):void 0)&&void 0!==s?s:void 0},get inlineRowBgColor(){var e,i,o,n,r,s;return null!==(s=null!==(i=null===(e=t.hover)||void 0===e?void 0:e.inlineRowBgColor)&&void 0!==i?i:(null===(o=t.hover)||void 0===o?void 0:o.cellBgColor)&&"string"==typeof(null===(n=t.hover)||void 0===n?void 0:n.cellBgColor)?vw(null===(r=t.hover)||void 0===r?void 0:r.cellBgColor,.1,!1):void 0)&&void 0!==s?s:void 0}}},get select(){return{get inlineColumnBgColor(){var i,o,n,r,s,l;return null!==(l=null!==(r=null!==(o=null===(i=t.select)||void 0===i?void 0:i.inlineColumnBgColor)&&void 0!==o?o:null===(n=e.selectionStyle)||void 0===n?void 0:n.inlineColumnBgColor)&&void 0!==r?r:(null===(s=e.selectionStyle)||void 0===s?void 0:s.cellBgColor)&&"string"==typeof e.selectionStyle.cellBgColor?vw(e.selectionStyle.cellBgColor,.1,!1):void 0)&&void 0!==l?l:void 0},get inlineRowBgColor(){var i,o,n,r,s;return null!==(s=null!==(n=null!==(o=null===(i=t.select)||void 0===i?void 0:i.inlineRowBgColor)&&void 0!==o?o:e.selectionStyle.inlineRowBgColor)&&void 0!==n?n:(null===(r=e.selectionStyle)||void 0===r?void 0:r.cellBgColor)&&"string"==typeof e.selectionStyle.cellBgColor?vw(e.selectionStyle.cellBgColor,.1,!1):void 0)&&void 0!==s?s:void 0},get cellBgColor(){var i,o,n;if("replace"===e.selectionStyle.selectionFillMode)return null!==(n=null!==(o=null===(i=t.select)||void 0===i?void 0:i.cellBgColor)&&void 0!==o?o:e.selectionStyle.cellBgColor)&&void 0!==n?n:void 0}}},get frameStyle(){if(t.frameStyle)return{get borderColor(){var e,i;return null!==(i=null===(e=t.frameStyle)||void 0===e?void 0:e.borderColor)&&void 0!==i?i:void 0},get borderLineWidth(){var e,i;return null!==(i=null===(e=t.frameStyle)||void 0===e?void 0:e.borderLineWidth)&&void 0!==i?i:void 0},get borderLineDash(){var e,i;return null!==(i=null===(e=t.frameStyle)||void 0===e?void 0:e.borderLineDash)&&void 0!==i?i:void 0}}},get padding(){return t.padding},get textAlign(){return t.textAlign},get textBaseline(){return t.textBaseline},get textOverflow(){return t.textOverflow},get lineHeight(){return t.lineHeight},get autoWrapText(){return t.autoWrapText},get lineClamp(){return t.lineClamp},get linkColor(){return t.linkColor},get cursor(){return t.cursor},get textStick(){return t.textStick},get marked(){return t.marked},get underline(){var e;return null!==(e=t.underline)&&void 0!==e&&e},get underlineColor(){return t.underlineColor},get underlineDash(){return t.underlineDash},get underlineOffset(){return t.underlineOffset},get lineThrough(){var e;return null!==(e=t.lineThrough)&&void 0!==e&&e},get lineThroughColor(){return t.lineThroughColor},get lineThroughDash(){return t.lineThroughDash}}}}function vx(t,e){if(t instanceof fx)return t.hasProperty(e);let i=t;if(!i)return!1;for(let t=0;t<e.length;t++)if(i=i[e[t]],!i)return!1;return!!i}const mx=new fx(ex,ex),bx=new fx(ix,ix),yx=new fx(ox,ox),Cx=new fx(nx,nx),wx=new fx(rx,rx),xx={DEFAULT:Cx,SIMPLIFY:wx,ARCO:yx,DARK:mx,BRIGHT:bx},_x={TableTheme:fx};function Sx(t){if(!t)return null;if("string"==typeof t){const e=function(t,e){if(t[e])return t[e];const i=e.toLowerCase();if(t[i])return t[i];const o=e.toLowerCase();if(t[o])return t[o];for(const e in t)if(e.toLowerCase()===i)return t[e]}(Ax(),t);return e?e instanceof fx?e:new fx(e,e):null}return t instanceof fx?t:new fx(t,t)}function Ax(){return Lw(xx,sx)}var Bx={DARK:mx,BRIGHT:bx,ARCO:yx,DEFAULT:Cx,SIMPLIFY:wx,theme:_x,of:Sx,get:Ax},Rx=Object.freeze({__proto__:null,ARCO:yx,BRIGHT:bx,DARK:mx,DEFAULT:Cx,SIMPLIFY:wx,TableTheme:fx,default:Bx,get:Ax,of:Sx,theme:_x});function Mx(t,e,i){var o;if(t.internalProps.customMergeCell){const o=t.getCustomMerge(e,i);if(o)return o.range}if(!t.internalProps.enableTreeNodeMerge&&!t.isHeader(e,i)&&!(null===(o=t.getBodyColumnDefine(e,i))||void 0===o?void 0:o.mergeCell))return!1;const n=t.getCellRange(e,i);return!(n.start.col===n.end.col&&n.start.row===n.end.row)&&n}class Tx{static registerComponent(t,e){Tx._components[t]=e}static getComponent(t){return Tx._components[t]}static registerFunction(t,e){Tx._functions[t]=e}static getFunction(t){return Tx._functions[t]}static registerCellType(t,e){Tx._cellTypes[t]=e}static getCellType(t){return Tx._cellTypes[t]}}function kx(t,e,i,o,n,r){const s=function(t,e){const i=new Array(e);for(let o=0;o<e;o++)i[o]=t(o);return i}(t,i);s.sort(((t,e)=>o(r(t),r(e),n)));for(let t=0;t<i;t++)e(t,s[t])}Tx._components={},Tx._functions={},Tx._cellTypes={};class Lx{constructor(t){var e;this.className="Aggregator",this.isRecord=!0,this.records=[],this.key=t.key,this.field=t.dimension,this.formatFun=t.formatFun,this.isRecord=null!==(e=t.isRecord)&&void 0!==e?e:this.isRecord}clearCacheValue(){this._formatedValue=void 0}formatValue(t,e,i){return this._formatedValue||(this.formatFun?this._formatedValue=this.formatFun(this.value(),t,e,i):this._formatedValue=this.value()),this._formatedValue}reset(){this.records=[],this.clearCacheValue()}}class Px extends Lx{constructor(){super(...arguments),this.type=NC.RECORD,this.isRecord=!0}push(t){t&&this.isRecord&&this.records&&("Aggregator"===t.className?this.records.push(...t.records):this.records.push(t)),this.clearCacheValue()}deleteRecord(t){t&&this.isRecord&&this.records&&(this.records=this.records.filter((e=>e!==t))),this.clearCacheValue()}updateRecord(t,e){t&&e&&(this.isRecord&&this.records&&(this.records=this.records.map((i=>i===t?e:i))),this.clearCacheValue())}value(){return this.records}reset(){this.records=[]}recalculate(){}}class Ex extends Lx{constructor(){super(...arguments),this.type=NC.NONE,this.isRecord=!0}push(t){t&&(this.isRecord&&(this.records=[t]),this.field&&(this.fieldValue=t[this.field])),this.clearCacheValue()}deleteRecord(t){t&&(this.isRecord&&this.records&&(this.records=this.records.filter((e=>e!==t))),this.field&&this.records.length&&(this.fieldValue=this.records[this.records.length-1][this.field])),this.clearCacheValue()}updateRecord(t,e){t&&e&&(this.isRecord&&this.records&&(this.records=this.records.map((i=>i===t?e:i))),this.field&&this.records.length&&(this.fieldValue=this.records[this.records.length-1][this.field]),this.clearCacheValue())}value(){return this.fieldValue}reset(){this.records=[],this.fieldValue=void 0}recalculate(){}}class Hx extends Lx{constructor(t){super(t),this.type=NC.CUSTOM,this.isRecord=!0,this.values=[],this.aggregationFun=t.aggregationFun}push(t){t&&(this.isRecord&&this.records&&("Aggregator"===t.className?this.records.push(...t.records):this.records.push(t)),this.field&&this.values.push(t[this.field])),this.clearCacheValue()}updateRecord(t,e){t&&e&&(this.isRecord&&this.records&&(this.records=this.records.map((i=>i===t?e:i))),this.field&&this.records.length&&(this.values=this.records.map((t=>t[this.field]))),this.clearCacheValue())}deleteRecord(t){t&&(this.isRecord&&this.records&&(this.records=this.records.filter((e=>e!==t))),this.field&&this.records.length&&(this.values=this.records.map((t=>t[this.field])))),this.clearCacheValue()}value(){var t;return this.fieldValue||(this.fieldValue=null===(t=this.aggregationFun)||void 0===t?void 0:t.call(this,this.values,this.records,this.field)),this.fieldValue}reset(){this.records=[],this.fieldValue=void 0}recalculate(){}}class Fx extends Lx{constructor(t){var e;super(t),this.type=NC.SUM,this.sum=0,this.positiveSum=0,this.nagetiveSum=0,this.needSplitPositiveAndNegativeForSum=!1,this.needSplitPositiveAndNegativeForSum=null!==(e=t.needSplitPositiveAndNegative)&&void 0!==e&&e}push(t){if(t)if(this.isRecord&&this.records&&("Aggregator"===t.className?this.records.push(...t.records):this.records.push(t)),"Aggregator"===t.className){const e=t.value();this.sum+=null!=e?e:0,this.needSplitPositiveAndNegativeForSum&&(e>0?this.positiveSum+=e:e<0&&(this.nagetiveSum+=e))}else if(this.field&&!isNaN(parseFloat(t[this.field]))){const e=parseFloat(t[this.field]);this.sum+=e,this.needSplitPositiveAndNegativeForSum&&(e>0?this.positiveSum+=e:e<0&&(this.nagetiveSum+=e))}this.clearCacheValue()}deleteRecord(t){if(t)if(this.isRecord&&this.records&&(this.records=this.records.filter((e=>e!==t))),"Aggregator"===t.className){const e=t.value();this.sum-=null!=e?e:0,this.needSplitPositiveAndNegativeForSum&&(e>0?this.positiveSum-=e:e<0&&(this.nagetiveSum-=e))}else if(this.field&&!isNaN(parseFloat(t[this.field]))){const e=parseFloat(t[this.field]);this.sum-=e,this.needSplitPositiveAndNegativeForSum&&(e>0?this.positiveSum-=e:e<0&&(this.nagetiveSum-=e))}this.clearCacheValue()}updateRecord(t,e){if(t&&e){if(this.isRecord&&this.records&&(this.records=this.records.map((i=>i===t?e:i))),"Aggregator"===t.className){const i=t.value(),o=e.value();this.sum+=o-i,this.needSplitPositiveAndNegativeForSum&&(i>0?this.positiveSum-=i:i<0&&(this.nagetiveSum-=i),o>0?this.positiveSum+=o:o<0&&(this.nagetiveSum+=o))}else if(this.field&&!isNaN(parseFloat(t[this.field]))){const i=parseFloat(t[this.field]),o=parseFloat(e[this.field]);this.sum+=o-i,this.needSplitPositiveAndNegativeForSum&&(i>0?this.positiveSum-=i:i<0&&(this.nagetiveSum-=i),o>0?this.positiveSum+=o:o<0&&(this.nagetiveSum+=o))}this.clearCacheValue()}}value(){var t;return(null===(t=this.records)||void 0===t?void 0:t.length)>=1?this.sum:void 0}positiveValue(){return this.positiveSum}negativeValue(){return this.nagetiveSum}reset(){super.reset(),this.records=[],this.sum=0}recalculate(){if(this.sum=0,this._formatedValue=void 0,this.records)for(let t=0;t<this.records.length;t++){const e=this.records[t];if("Aggregator"===e.className){const t=e.value();this.sum+=null!=t?t:0,this.needSplitPositiveAndNegativeForSum&&(t>0?this.positiveSum+=t:t<0&&(this.nagetiveSum+=t))}else if(this.field&&!isNaN(parseFloat(e[this.field]))){const t=parseFloat(e[this.field]);this.sum+=t,this.needSplitPositiveAndNegativeForSum&&(t>0?this.positiveSum+=t:t<0&&(this.nagetiveSum+=t))}}}}class zx extends Lx{constructor(){super(...arguments),this.type=NC.COUNT,this.count=0}push(t){t&&(this.isRecord&&this.records&&("Aggregator"===t.className?this.records.push(...t.records):this.records.push(t)),"Aggregator"===t.className?this.count+=t.value():this.count++),this.clearCacheValue()}deleteRecord(t){t&&(this.isRecord&&this.records&&(this.records=this.records.filter((e=>e!==t))),"Aggregator"===t.className?this.count-=t.value():this.count--),this.clearCacheValue()}updateRecord(t,e){t&&e&&(this.isRecord&&this.records&&(this.records=this.records.map((i=>i===t?e:i))),"Aggregator"===t.className&&(this.count+=e.value()-t.value()))}value(){return this.count}reset(){this.records=[],this.count=0}recalculate(){if(this.count=0,this._formatedValue=void 0,this.records)for(let t=0;t<this.records.length;t++){const e=this.records[t];"Aggregator"===e.className?this.count+=e.value():this.count++}}}class Ix extends Lx{constructor(){super(...arguments),this.type=NC.AVG,this.sum=0,this.count=0}push(t){t&&(this.isRecord&&this.records&&("Aggregator"===t.className?this.records.push(...t.records):this.records.push(t)),"Aggregator"===t.className&&t.type===NC.AVG?(this.sum+=t.sum,this.count+=t.count):this.field&&!isNaN(parseFloat(t[this.field]))&&(this.sum+=parseFloat(t[this.field]),this.count++)),this.clearCacheValue()}deleteRecord(t){t&&(this.isRecord&&this.records&&(this.records=this.records.filter((e=>e!==t))),"Aggregator"===t.className&&t.type===NC.AVG?(this.sum-=t.sum,this.count-=t.count):this.field&&!isNaN(parseFloat(t[this.field]))&&(this.sum-=parseFloat(t[this.field]),this.count--)),this.clearCacheValue()}updateRecord(t,e){t&&e&&(this.isRecord&&this.records&&(this.records=this.records.map((i=>i===t?e:i))),"Aggregator"===t.className&&t.type===NC.AVG?(this.sum+=e.sum-t.sum,this.count+=e.count-t.count):this.field&&!isNaN(parseFloat(t[this.field]))&&(this.sum+=parseFloat(e[this.field])-parseFloat(t[this.field])),this.clearCacheValue())}value(){var t;return(null===(t=this.records)||void 0===t?void 0:t.length)>=1?this.sum/this.count:void 0}reset(){this.records=[],this.sum=0,this.count=0}recalculate(){if(this.sum=0,this.count=0,this._formatedValue=void 0,this.records)for(let t=0;t<this.records.length;t++){const e=this.records[t];"Aggregator"===e.className&&e.type===NC.AVG?(this.sum+=e.sum,this.count+=e.count):this.field&&!isNaN(parseFloat(e[this.field]))&&(this.sum+=parseFloat(e[this.field]),this.count++)}}}class Ox extends Lx{constructor(){super(...arguments),this.type=NC.MAX,this.max=Number.MIN_SAFE_INTEGER}push(t){t&&(this.isRecord&&this.records&&("Aggregator"===t.className?this.records.push(...t.records):this.records.push(t)),"Aggregator"===t.className?this.max=t.max>this.max?t.max:this.max:"number"==typeof t?this.max=t>this.max?t:this.max:this.field&&"number"==typeof t[this.field]?this.max=t[this.field]>this.max?t[this.field]:this.max:this.field&&!isNaN(t[this.field])&&(this.max=parseFloat(t[this.field])>this.max?parseFloat(t[this.field]):this.max)),this.clearCacheValue()}deleteRecord(t){t&&(this.isRecord&&this.records&&(this.records=this.records.filter((e=>e!==t))),this.recalculate())}updateRecord(t,e){t&&e&&(this.isRecord&&this.records&&(this.records=this.records.map((i=>i===t?e:i))),this.recalculate())}value(){var t;return(null===(t=this.records)||void 0===t?void 0:t.length)>=1?this.max:void 0}reset(){this.records=[],this.max=Number.MIN_SAFE_INTEGER}recalculate(){if(this.max=Number.MIN_SAFE_INTEGER,this._formatedValue=void 0,this.records)for(let t=0;t<this.records.length;t++){const e=this.records[t];"Aggregator"===e.className?this.max=e.max>this.max?e.max:this.max:"number"==typeof e?this.max=e>this.max?e:this.max:this.field&&"number"==typeof e[this.field]?this.max=e[this.field]>this.max?e[this.field]:this.max:this.field&&!isNaN(e[this.field])&&(this.max=parseFloat(e[this.field])>this.max?parseFloat(e[this.field]):this.max)}}}class Dx extends Lx{constructor(){super(...arguments),this.type=NC.MIN,this.min=Number.MAX_SAFE_INTEGER}push(t){t&&(this.isRecord&&this.records&&("Aggregator"===t.className?this.records.push(...t.records):this.records.push(t)),"Aggregator"===t.className?this.min=t.min<this.min?t.min:this.min:"number"==typeof t?this.min=t<this.min?t:this.min:this.field&&"number"==typeof t[this.field]?this.min=t[this.field]<this.min?t[this.field]:this.min:this.field&&!isNaN(t[this.field])&&(this.min=parseFloat(t[this.field])<this.min?parseFloat(t[this.field]):this.min)),this.clearCacheValue()}deleteRecord(t){t&&(this.isRecord&&this.records&&(this.records=this.records.filter((e=>e!==t))),this.recalculate())}updateRecord(t,e){t&&e&&(this.isRecord&&this.records&&(this.records=this.records.map((i=>i===t?e:i))),this.recalculate())}value(){var t;return(null===(t=this.records)||void 0===t?void 0:t.length)>=1?this.min:void 0}reset(){this.records=[],this.min=Number.MAX_SAFE_INTEGER}recalculate(){if(this.min=Number.MAX_SAFE_INTEGER,this._formatedValue=void 0,this.records)for(let t=0;t<this.records.length;t++){const e=this.records[t];"Aggregator"===e.className?this.min=e.min<this.min?e.min:this.min:"number"==typeof e?this.min=e<this.min?e:this.min:this.field&&"number"==typeof e[this.field]?this.min=e[this.field]<this.min?e[this.field]:this.min:this.field&&!isNaN(e[this.field])&&(this.min=parseFloat(e[this.field])<this.min?parseFloat(e[this.field]):this.min)}}}const Wx={SOURCE_LENGTH_UPDATE:"source_length_update",CHANGE_ORDER:"change_order"};function Nx(t,e){const i=Hw(t);if(Fw(i)){const t=i.then((t=>(e(t),t)));return e(t),t}return i}function Gx(t,e,i,o,n,r){if(null==t)return;if(Fw(t))return t.then((t=>Gx(t,e,i,o,n,r)));const s=function(t){if(Gw.isObject(t)){const e=t;if(Q(e.get)&&Q(e.set))return!0}return!1}(e)?e.get:e;if(s in t)return Nx(t[s],r);if("function"==typeof s)return Nx(s(t,i,o,n),r);if(Array.isArray(s))return Nx(function(t,e){let i,o=t;for(;(i=e.shift())&&(o=o[i],o););return o}(t,[...s]),r);const l=`${s}`.split(".");return l.length<=1?Nx(t[s],r):Nx(Pw(t,((t,e)=>Gx(t,e,i,o,n,$w)),...l),r)}function jx(t,e){if(!t)return e;const i=t[e];return Q(i)?i:e}let Vx=class extends YC{static get EVENT_TYPE(){return Wx}constructor(t,e,i,o,n,r){var s;super(),this.currentIndexedData=[],this.hierarchyExpandLevel=0,this.hasHierarchyStateExpand=!1,this.beforeChangedRecordsMap=[],this.registedAggregators={},this.fieldAggregators=[],this.registerAggregators(),this.dataSourceObj=t,this.dataConfig=e,this._get=null==t?void 0:t.get,this.columns=o,this._source=(null==t?void 0:t.records)?this.processRecords(null==t?void 0:t.records):t,this._sourceLength=(null===(s=this._source)||void 0===s?void 0:s.length)||0,this.sortedIndexMap=new Map,this._currentPagerIndexedData=[],this.userPagination=i,this.pagination=i||{totalCount:this._sourceLength,perPageCount:this._sourceLength,currentPage:0},r>=1&&(this.hierarchyExpandLevel=r),this.currentIndexedData=Array.from({length:this._sourceLength},((t,e)=>e)),"tree"===n&&this.initTreeHierarchyState(),this.rowHierarchyType=n,this.updatePagerData()}initTreeHierarchyState(){var t;this.currentIndexedData=Array.from({length:this._sourceLength},((t,e)=>e));let e=this._sourceLength;for(let i=0;i<e;i++){const o=this.currentIndexedData[i],n=this.getOriginalRecord(o),r=null!==(t=n.filteredChildren)&&void 0!==t?t:n.children;if((null==r?void 0:r.length)>0){if(this.hierarchyExpandLevel>1?!n.hierarchyState&&(n.hierarchyState=WC.expand):!n.hierarchyState&&(n.hierarchyState=WC.collapse),this.hasHierarchyStateExpand=!0,n.hierarchyState===WC.collapse)continue;const t=this.initChildrenNodeHierarchy(o,this.hierarchyExpandLevel,2,n);i+=t,e+=t}else!0===n.children&&!n.hierarchyState&&(n.hierarchyState=WC.collapse)}}registerAggregator(t,e){this.registedAggregators[t]=e}registerAggregators(){this.registerAggregator(NC.RECORD,Px),this.registerAggregator(NC.SUM,Fx),this.registerAggregator(NC.COUNT,zx),this.registerAggregator(NC.MAX,Ox),this.registerAggregator(NC.MIN,Dx),this.registerAggregator(NC.AVG,Ix),this.registerAggregator(NC.NONE,Ex),this.registerAggregator(NC.CUSTOM,Hx)}updateColumns(t){this.columns=t}_generateFieldAggragations(){const t=this.columns;this.fieldAggregators=[];for(let e=0;e<(null==t?void 0:t.length);e++){delete t[e].vtable_aggregator;const i=t[e].field,o=t[e].aggregation;if(o)if(Array.isArray(o))for(let n=0;n<o.length;n++){const r=o[n],s=new this.registedAggregators[r.aggregationType]({dimension:i,formatFun:r.formatFun,isRecord:!0,aggregationFun:r.aggregationFun});this.fieldAggregators.push(s),t[e].vtable_aggregator||(t[e].vtable_aggregator=[]),t[e].vtable_aggregator.push(s)}else{const n=new this.registedAggregators[o.aggregationType]({dimension:i,formatFun:o.formatFun,isRecord:!0,aggregationFun:o.aggregationFun});this.fieldAggregators.push(n),t[e].vtable_aggregator=n}}}processRecords(t){var e,i,o,n,r,s,l,a;this._generateFieldAggragations();const h=[],d=this.fieldAggregators.length>=1;if((null===(i=null===(e=this.dataConfig)||void 0===e?void 0:e.filterRules)||void 0===i?void 0:i.length)>=1||(null===(o=this.lastFilterRules)||void 0===o?void 0:o.length)>=1||d){for(let e=0,i=t.length;e<i;e++){const i=t[e];(null===(r=null===(n=this.dataConfig)||void 0===n?void 0:n.filterRules)||void 0===r?void 0:r.length)>=1?this.filterRecord(i)&&(h.push(i),"tree"===this.rowHierarchyType&&i.children&&(i.filteredChildren=this.filteredChildren(i.children)),d&&this.processRecord(i)):(null===(s=this.lastFilterRules)||void 0===s?void 0:s.length)>=1?(this.clearFilteredChildren(i),d&&this.processRecord(i)):d&&this.processRecord(i)}if((null===(a=null===(l=this.dataConfig)||void 0===l?void 0:l.filterRules)||void 0===a?void 0:a.length)>=1)return h}return t}filteredChildren(t){const e=[];for(let i=0,o=t.length;i<o;i++){const o=t[i];this.filterRecord(o)&&(e.push(o),o.children&&(o.filteredChildren=this.filteredChildren(o.children)))}return e}processRecord(t){for(let e=0;e<this.fieldAggregators.length;e++)this.fieldAggregators[e].push(t)}initChildrenNodeHierarchy(t,e,i,o){var n,r,s;let l=0;const a=o.filteredChildren?o.filteredChildren.length:null!==(r=null===(n=o.children)||void 0===n?void 0:n.length)&&void 0!==r?r:0;for(let n=0;n<a;n++){(i<=e||o.hierarchyState===WC.expand)&&(l+=1);const r=o.filteredChildren?o.filteredChildren[n]:o.children[n],a=Array.isArray(t)?t.concat(n):[t,n];(i<=e||o.hierarchyState===WC.expand)&&this.currentIndexedData.splice(this.currentIndexedData.indexOf(t)+l,0,a),(r.filteredChildren?r.filteredChildren.length>0:(null===(s=r.children)||void 0===s?void 0:s.length)>0)&&(i<e||r.hierarchyState===WC.expand?(!r.hierarchyState&&(r.hierarchyState=WC.expand),this.hasHierarchyStateExpand=!0):!r.hierarchyState&&(r.hierarchyState=WC.collapse)),r.hierarchyState===WC.expand&&(l+=this.initChildrenNodeHierarchy(a,e,i+1,r)),!0===r.children&&!r.hierarchyState&&(r.hierarchyState=WC.collapse)}return l}updatePagination(t){this.pagination=t||{totalCount:this._sourceLength,perPageCount:this._sourceLength,currentPage:0},this.updatePagerData()}updatePagerData(){const{currentIndexedData:t}=this,{perPageCount:e,currentPage:i}=this.pagination,o=e*(i||0),n=o+e;if(this._currentPagerIndexedData.length=0,t&&t.length>0){let e=-1;for(let i=0;i<t.length;i++)if((Array.isArray(t[i])&&1===t[i].length||!Array.isArray(t[i]))&&e++,e>=o&&e<n)this._currentPagerIndexedData.push(t[i]);else if(e>=n)break}else if(this._sourceLength>0)throw new Error("currentIndexedData should has values!")}get records(){return Array.isArray(this._source)?this._source:[]}get source(){return this._source}get(t){return this.getOriginalRecord(jx(this.currentPagerIndexedData,t))}getRaw(t){return this.getRawRecord(jx(this.currentPagerIndexedData,t))}getIndexKey(t){return jx(this.currentPagerIndexedData,t)}getTableIndex(t){return Array.isArray(t)?this.currentPagerIndexedData.findIndex((e=>Ht(e,t))):this.currentPagerIndexedData.findIndex((e=>e===t))}getField(t,e,i,o,n){return this.getOriginalField(jx(this.currentPagerIndexedData,t),e,i,o,n)}getRawField(t,e,i,o,n){return this.getRawFieldData(jx(this.currentPagerIndexedData,t),e,i,o,n)}hasField(t,e){return this.hasOriginalField(jx(this.currentPagerIndexedData,t),e)}getHierarchyState(t){var e;const i=this.getOriginalRecord(this.currentIndexedData[t]);return null!==(e=null==i?void 0:i.hierarchyState)&&void 0!==e?e:null}toggleHierarchyState(t,e,i){const o=this.currentIndexedData.slice(0),n=this.getIndexKey(t),r=this.getHierarchyState(t),s=this.getOriginalRecord(n);if(this.clearSortedIndexMap(),r===WC.collapse)s.hierarchyState=WC.expand,this.pushChildrenNode(n,WC.expand,s),this.hasHierarchyStateExpand=!0;else if(r===WC.expand){let t=0;const e=(i,o,n)=>{if(!o||o===WC.collapse||o===WC.none)return;const r=n.filteredChildren?n.filteredChildren:n.children;if(r)for(let o=0;o<r.length;o++){t+=1;const n=Array.isArray(i)?i.concat([o]):[i,o];e(n,r[o].hierarchyState,r[o])}};e(n,r,s),this.currentIndexedData.splice(this.currentIndexedData.indexOf(n)+1,t),s.hierarchyState=WC.collapse}this.updatePagerData();const l=[],a=[];if(r===WC.collapse){const e=this.currentIndexedData.length-o.length;for(let i=0;i<e;i++)l.push(t+i+1)}else if(r===WC.expand){const e=o.length-this.currentIndexedData.length;for(let i=0;i<e;i++)a.push(t+i+1)}return{add:l,remove:a}}pushChildrenNode(t,e,i){var o,n;if(!e||e===WC.collapse||e===WC.none)return 0;let r=0;const s=i.filteredChildren?i.filteredChildren:i.children;if(s){const e=Array.from({length:s.length},((t,e)=>e));null===(o=this.lastSortStates)||void 0===o||o.forEach((i=>{"normal"!==i.order&&kx((t=>Q(e[t])?e[t]:e[t]=t),((t,i)=>{e[t]=i}),s.length,i.orderFn,i.order,(e=>this.getOriginalField(Array.isArray(t)?t.concat([e]):[t,e],i.field)))}));for(let i=0;i<e.length;i++){r+=1;const o=Array.isArray(t)?t.concat([e[i]]):[t,e[i]];this.currentIndexedData.splice(this.currentIndexedData.indexOf(t)+r,0,o);const l=this.getOriginalRecord(o);!l.hierarchyState&&(null!==(n=l.filteredChildren)&&void 0!==n?n:l.children)&&(l.hierarchyState=WC.collapse),r+=this.pushChildrenNode(o,l.hierarchyState,s[e[i]])}}return r}changeFieldValue(t,e,i,o,n,r){var s;if(null!==i&&e>=0){const o=this.getIndexKey(e);if(!this.beforeChangedRecordsMap[o]){const t=this.getOriginalRecord(o);this.beforeChangedRecordsMap[o]=null!==(s=Ct(t))&&void 0!==s?s:{}}if("string"==typeof i||"number"==typeof i){const e=this.beforeChangedRecordsMap[o][i],n=this.getOriginalRecord(o);let r=t;"number"==typeof e&&function(t){return/^-?\d+(\.\d+)?$/.test(t)}(t)&&(r=parseFloat(t)),Fw(n)?n.then((t=>{t[i]=r})).catch((t=>{})):n?n[i]=r:(this.records[o]={},this.records[o][i]=r)}}}setRecord(t,e){var i,o;let n=!0;if((null===(o=null===(i=this.dataConfig)||void 0===i?void 0:i.filterRules)||void 0===o?void 0:o.length)>=1&&(this.filterRecord(t)?"tree"===this.rowHierarchyType&&t.children&&(t.filteredChildren=this.filteredChildren(t.children)):n=!1),n&&Array.isArray(this.records)){const i=this.getIndexKey(e);Array.isArray(i)||this.records.splice(i,1,t)}}addRecord(t,e){var i;if(Array.isArray(this.records)){this.records.splice(e,0,t),this.adjustBeforeChangedRecordsMap(e,1),this.currentIndexedData.push(this.currentIndexedData.length),this._sourceLength+=1;for(let e=0;e<this.fieldAggregators.length;e++)this.fieldAggregators[e].push(t);if("tree"===this.rowHierarchyType&&this.initTreeHierarchyState(),this.userPagination){this.pagination.totalCount=this._sourceLength;const{perPageCount:t,currentPage:i}=this.pagination;e<t*(i||0)+t&&this.updatePagerData()}else this.pagination.perPageCount=this._sourceLength,this.pagination.totalCount=this._sourceLength,this.updatePagerData();(null===(i=this.dataSourceObj)||void 0===i?void 0:i.added)&&this.dataSourceObj.added(e,1)}}addRecords(t,e){var i;if(Array.isArray(this.records)){if(Array.isArray(t)){this.records.splice(e,0,...t),this.adjustBeforeChangedRecordsMap(e,t.length);for(let e=0;e<t.length;e++)this.currentIndexedData.push(this.currentIndexedData.length);this._sourceLength+=t.length;for(let e=0;e<this.fieldAggregators.length;e++)for(let i=0;i<t.length;i++)this.fieldAggregators[e].push(t[i])}if(this.userPagination){this.pagination.totalCount=this._sourceLength;const{perPageCount:t,currentPage:i}=this.pagination;e<t*(i||0)+t&&this.updatePagerData()}else this.pagination.perPageCount=this._sourceLength,this.pagination.totalCount=this._sourceLength,this.updatePagerData();(null===(i=this.dataSourceObj)||void 0===i?void 0:i.added)&&this.dataSourceObj.added(e,t.length)}}addRecordForSorted(t){Array.isArray(this.records)&&(this.beforeChangedRecordsMap=[],this.records.push(t),this.currentIndexedData.push(this.currentIndexedData.length),this._sourceLength+=1,this.sortedIndexMap.clear(),this.userPagination||(this.pagination.perPageCount=this._sourceLength,this.pagination.totalCount=this._sourceLength))}addRecordsForSorted(t){if(Array.isArray(this.records)){if(this.beforeChangedRecordsMap=[],Array.isArray(t)){this.records.push(...t);for(let e=0;e<t.length;e++)this.currentIndexedData.push(this.currentIndexedData.length);this._sourceLength+=t.length,this.sortedIndexMap.clear()}this.userPagination||(this.pagination.perPageCount=this._sourceLength,this.pagination.totalCount=this._sourceLength)}}adjustBeforeChangedRecordsMap(t,e){for(let i=this.beforeChangedRecordsMap.length-1;i>=t;i--){const t=this.beforeChangedRecordsMap[i];delete this.beforeChangedRecordsMap[i],this.beforeChangedRecordsMap[i+e]=t}}deleteRecords(t){var e;if(Array.isArray(this.records)){const i=[],o=t.sort(((t,e)=>e-t));for(let t=0;t<o.length;t++){const e=o[t];if(e>=this._sourceLength||e<0)continue;delete this.beforeChangedRecordsMap[e],i.push(e);const n=this.records[e];for(let t=0;t<this.fieldAggregators.length;t++)this.fieldAggregators[t].deleteRecord(n);this.records.splice(e,1),this.currentIndexedData.pop(),this._sourceLength-=1}return this.userPagination||(this.pagination.perPageCount=this._sourceLength,this.pagination.totalCount=this._sourceLength),this.updatePagerData(),(null===(e=this.dataSourceObj)||void 0===e?void 0:e.deleted)&&this.dataSourceObj.deleted(i),i}return[]}deleteRecordsForSorted(t){if(Array.isArray(this.records)){const e=t.sort(((t,e)=>e-t));for(let t=0;t<e.length;t++){const i=e[t];if(i>=this._sourceLength||i<0)continue;const o=this.currentIndexedData[i];delete this.beforeChangedRecordsMap[o],this.records.splice(o,1),this._sourceLength-=1}this.sortedIndexMap.clear(),this.userPagination||(this.pagination.perPageCount=this._sourceLength,this.pagination.totalCount=this._sourceLength)}}updateRecords(t,e){const i=[];for(let o=0;o<e.length;o++){const n=e[o];if(!(n>=this._sourceLength||n<0)){delete this.beforeChangedRecordsMap[n],i.push(n);for(let e=0;e<this.fieldAggregators.length;e++)this.fieldAggregators[e].updateRecord(this.records[n],t[o]);this.records[n]=t[o]}}return this.userPagination&&this.updatePagerData(),i}updateRecordsForSorted(t,e){for(let i=0;i<e.length;i++){const o=e[i];if(o>=this._sourceLength||o<0)continue;const n=this.currentIndexedData[o];if("number"!=typeof n)return;delete this.beforeChangedRecordsMap[n],this.records[n]=t[i]}this.sortedIndexMap.clear()}sort(t){t=(Array.isArray(t)?t:[t]).filter((t=>{const e=this.columns.find((e=>e.field===t.field));return!1!==(null==e?void 0:e.sort)&&"normal"!==t.order})),this.lastSortStates=t;let e=t.map((t=>this.sortedIndexMap.get(null==t?void 0:t.field)||{asc:[],desc:[],normal:[]})),i=null;if(e.length>0&&(i=t.reduce(((t,i,o)=>{var n;const r=null===(n=e[o])||void 0===n?void 0:n[i.order];return r&&r.length>0?r:t}),null),i&&i.length>0))return this.currentIndexedData=i,this.updatePagerData(),void this.fireListeners(Wx.CHANGE_ORDER,null);const o=Array.from({length:this._sourceLength},((t,e)=>e));if(o.sort(((e,i)=>t.reduce(((t,o)=>0!==t?t:(o.orderFn||("desc"!==o.order?(t,e)=>t===e?0:t>e?1:-1:(t,e)=>t===e?0:t<e?1:-1))(this.getOriginalField(e,o.field),this.getOriginalField(i,o.field),o.order)),0))),this.currentIndexedData=o,this.hierarchyExpandLevel){let t=o.length;for(let e=0;e<t;e++){const i=this.getOriginalRecord(o[e]),n=this.pushChildrenNode(o[e],i.hierarchyState,this.getOriginalRecord(o[e]));t+=n,e+=n}}if(!e.length){e=t.map((()=>({asc:[],desc:[],normal:[]})));for(let i=0;i<t.length;i++)this.sortedIndexMap.set(t[i].field,e[i])}t.forEach(((t,i)=>{e[i][t.order]=o.slice()})),this.updatePagerData(),this.fireListeners(Wx.CHANGE_ORDER,null)}setSortedIndexMap(t,e){this.sortedIndexMap.set(t,e)}clearFilteredChildren(t){var e,i;t.filteredChildren=void 0;for(let o=0;null!==(i=o<(null===(e=t.children)||void 0===e?void 0:e.length))&&void 0!==i&&i;o++)this.clearFilteredChildren(t.children[o])}filterRecord(t){var e,i,o;let n=!0;for(let r=0;r<(null===(e=this.dataConfig.filterRules)||void 0===e?void 0:e.length);r++){const e=null===(i=this.dataConfig)||void 0===i?void 0:i.filterRules[r];if(e.filterKey){const i=t[e.filterKey];if(-1===e.filteredValues.indexOf(i)){n=!1;break}}else if(!(null===(o=e.filterFunc)||void 0===o?void 0:o.call(e,t))){n=!1;break}}return n}updateFilterRulesForSorted(t){var e,i,o;this.lastFilterRules=this.dataConfig.filterRules,this.dataConfig.filterRules=t,this._source=this.processRecords(null!==(i=null===(e=this.dataSourceObj)||void 0===e?void 0:e.records)&&void 0!==i?i:this.dataSourceObj),this._sourceLength=(null===(o=this._source)||void 0===o?void 0:o.length)||0,this.sortedIndexMap.clear(),this.currentIndexedData=Array.from({length:this._sourceLength},((t,e)=>e)),this.userPagination||(this.pagination.perPageCount=this._sourceLength,this.pagination.totalCount=this._sourceLength)}updateFilterRules(t){var e,i,o;this.lastFilterRules=this.dataConfig.filterRules,this.dataConfig.filterRules=t,this._source=this.processRecords(null!==(i=null===(e=this.dataSourceObj)||void 0===e?void 0:e.records)&&void 0!==i?i:this.dataSourceObj),this._sourceLength=(null===(o=this._source)||void 0===o?void 0:o.length)||0,this.currentIndexedData=Array.from({length:this._sourceLength},((t,e)=>e)),this.userPagination||(this.pagination.perPageCount=this._sourceLength,this.pagination.totalCount=this._sourceLength,"tree"===this.rowHierarchyType&&this.initTreeHierarchyState()),this.updatePagerData()}clearSortedIndexMap(){this.lastSortStates&&this.lastSortStates.length>0&&this.sortedIndexMap.forEach(((t,e)=>{this.lastSortStates.some((t=>t.field===e))?this.lastSortStates.forEach((e=>{"asc"===e.order?(t.desc=[],t.normal=[]):"desc"===e.order?(t.asc=[],t.normal=[]):(t.asc=[],t.desc=[])})):this.sortedIndexMap.delete(e)}))}get sourceLength(){return this._sourceLength}set sourceLength(t){this._sourceLength!==t&&(this._sourceLength=t,this.fireListeners(Wx.SOURCE_LENGTH_UPDATE,this._sourceLength))}get length(){return this.currentPagerIndexedData.length}get dataSource(){return this}get currentPagerIndexedData(){return this._currentPagerIndexedData.length>0?this._currentPagerIndexedData:[]}release(){var t;null===(t=super.release)||void 0===t||t.call(this),this.lastFilterRules=null}clearSortedMap(){this.currentIndexedData&&(this.currentIndexedData.length=0),this.currentIndexedData=null,this.sortedIndexMap.forEach((t=>{t.asc&&(t.asc.length=0),t.desc&&(t.desc.length=0)})),this.sortedIndexMap.clear()}clearCurrentIndexedData(){this.currentIndexedData=null,this.currentPagerIndexedData.length=0}getOriginalRecord(t){let e;return e=this.dataSourceObj.records?Array.isArray(t)?Ux(this.records,t):this.records[t]:this._get(t),Nx(e,(e=>{this.recordPromiseCallBack(t,e)}))}getRawRecord(t){var e;if(null===(e=this.beforeChangedRecordsMap)||void 0===e?void 0:e[t])return this.beforeChangedRecordsMap[t];let i;return i=this.dataSourceObj.records?Array.isArray(t)?Ux(this.records,t):this.records[t]:this._get(t),Nx(i,(e=>{this.recordPromiseCallBack(t,e)}))}getOriginalField(t,e,i,o,n){if(null!==e)return Gx(this.getOriginalRecord(t),e,i,o,n,(i=>{this.fieldPromiseCallBack(t,e,i)}))}getRawFieldData(t,e,i,o,n){if(null!==e)return Gx(this.getRawRecord(t),e,i,o,n,(i=>{this.fieldPromiseCallBack(t,e,i)}))}hasOriginalField(t,e){if(null===e)return!1;if("function"==typeof e)return!0;const i=this.getOriginalRecord(t);return Boolean(i&&e in i)}fieldPromiseCallBack(t,e,i){}recordPromiseCallBack(t,e){}isCanExchangeOrder(t,e){if(this.hasHierarchyStateExpand){let i=this.currentPagerIndexedData[t],o=this.currentPagerIndexedData[e];if(i=Array.isArray(i)?[...i]:[i],o=Array.isArray(o)?[...o]:[o],e>t&&o.length>i.length){let t=this.currentPagerIndexedData[e+1];t=Array.isArray(t)?[...t]:[t],t.length<o.length&&o.splice(o.length-1,1)}if(i.length===o.length){for(let t=0;t<=i.length-2;t++)if(i[t]!==o[t])return!1;return!0}return!1}return!0}reorderRecord(t,e){var i,o;if(!(null===(i=this.lastSortStates)||void 0===i?void 0:i.some((t=>"asc"===t.order||"desc"===t.order)))&&this.isCanExchangeOrder(t,e))if(this.hasHierarchyStateExpand){let i,n,r=this.currentPagerIndexedData[t],s=this.currentPagerIndexedData[e];if(r=Array.isArray(r)?[...r]:[r],s=Array.isArray(s)?[...s]:[s],r.length>1||s.length>1){if(e>t&&s.length>r.length){let t=this.currentPagerIndexedData[e+1];t=Array.isArray(t)?[...t]:[t],t.length<s.length&&s.splice(s.length-1,1)}if(i=r.splice(r.length-1,1)[0],n=s.splice(s.length-1,1)[0],r.length>=1){const t=this.getOriginalRecord(r),e=t.filteredChildren?t.filteredChildren.splice(i,1):t.children.splice(i,1);e.unshift(n,0),Array.prototype.splice.apply(null!==(o=t.filteredChildren)&&void 0!==o?o:t.children,e)}else{const t=this.records.splice(i,1);t.unshift(n,0),Array.prototype.splice.apply(this.records,t)}}else{i=this.currentPagerIndexedData[t],n=this.currentPagerIndexedData[e];const o=this.records.splice(i,1);o.unshift(n,0),Array.prototype.splice.apply(this.records,o)}this.restoreTreeHierarchyState(),this.updatePagerData()}else{const i=this.records.splice(t,1);i.unshift(e,0),Array.prototype.splice.apply(this.records,i)}}restoreTreeHierarchyState(){var t,e;if(this.hierarchyExpandLevel){for(let e=0;e<this._sourceLength;e++){const i=this.getOriginalRecord(e);(null!==(t=i.filteredChildren)&&void 0!==t?t:i.children)&&!i.hierarchyState&&(i.hierarchyState=WC.collapse)}this.currentIndexedData=Array.from({length:this._sourceLength},((t,e)=>e));let i=this._sourceLength;for(let t=0;t<i;t++){const o=this.currentIndexedData[t],n=this.getOriginalRecord(o),r=null!==(e=n.filteredChildren)&&void 0!==e?e:n.children;if((null==r?void 0:r.length)>0&&n.hierarchyState===WC.expand){this.hasHierarchyStateExpand=!0;const e=this.restoreChildrenNodeHierarchy(o,n);t+=e,i+=e}else!0===n.children&&!n.hierarchyState&&(n.hierarchyState=WC.collapse)}}}restoreChildrenNodeHierarchy(t,e){var i,o;let n=0;const r=null!==(i=e.filteredChildren)&&void 0!==i?i:e.children,s=null!==(o=null==r?void 0:r.length)&&void 0!==o?o:0;for(let i=0;i<s;i++){e.hierarchyState===WC.expand&&(n+=1);const o=r[i],s=Array.isArray(t)?t.concat(i):[t,i];e.hierarchyState===WC.expand&&this.currentIndexedData.splice(this.currentIndexedData.indexOf(t)+n,0,s),n+=this.restoreChildrenNodeHierarchy(s,o)}return n}};function Ux(t,e){var i;let o=t;for(let t=0;t<e.length;t++){const n=e[t];if(!o[n])return;o=o[n];const r=null!==(i=o.filteredChildren)&&void 0!==i?i:null==o?void 0:o.children;r&&t+1<e.length&&(o=r)}return o}Vx.EMPTY=new Vx({get(){},length:0});class $x extends Vx{static get EVENT_TYPE(){return Vx.EVENT_TYPE}static ofArray(t,e,i,o,n,r){return new $x({get:e=>t[e],length:t.length,records:t},e,i,o,n,r)}constructor(t,e,i,o,n,r){rt(null==e?void 0:e.groupByRules)&&(n="tree"),super(t,e,i,o,n,r),this._recordCache=[],this._fieldCache={}}getOriginalRecord(t){return this._recordCache&&this._recordCache[t]?this._recordCache[t]:super.getOriginalRecord(t)}getRawRecord(t){var e;return(null===(e=this.beforeChangedRecordsMap)||void 0===e?void 0:e[t])?this.beforeChangedRecordsMap[t]:this._recordCache&&this._recordCache[t]?this._recordCache[t]:super.getRawRecord(t)}getOriginalField(t,e,i,o,n){const r=this._fieldCache&&this._fieldCache[t];if(r){const t=r.get(e);if(t)return t}return super.getOriginalField(t,e,i,o,n)}clearCache(){this._recordCache&&(this._recordCache=[]),this._fieldCache&&(this._fieldCache={})}fieldPromiseCallBack(t,e,i){!function(t,e,i,o){(t[e]||(t[e]=new Map)).set(i,o)}(this._fieldCache,t,e,i)}recordPromiseCallBack(t,e){this._recordCache&&(this._recordCache[t]=e)}get records(){return Array.isArray(this._recordCache)&&this._recordCache.length>0?this._recordCache:super.records}release(){var t;null===(t=super.release)||void 0===t||t.call(this),this._recordCache=null,this._fieldCache=null}_generateFieldAggragations(){var t;if(super._generateFieldAggragations(),rt(null===(t=this.dataConfig)||void 0===t?void 0:t.groupByRules)){const t=this.dataConfig.groupByRules;this.groupAggregator=new this.registedAggregators[NC.CUSTOM]({dimension:"",aggregationFun:(e,i,o)=>{const n=new Map,r=[];for(let e=0;e<i.length;e++)Xx(i[e],r,n,t,0),i[e].vtableOriginIndex=e;return r}}),this.fieldAggregators.push(this.groupAggregator)}}processRecords(t){var e;const i=super.processRecords(t);return(null===(e=this.groupAggregator)||void 0===e?void 0:e.value())||i}getGroupLength(){var t,e,i;return null!==(i=null===(e=null===(t=this.dataConfig)||void 0===t?void 0:t.groupByRules)||void 0===e?void 0:e.length)&&void 0!==i?i:0}updateGroup(){var t,e,i;this.clearCache();const o=this.source;this._source=this.processRecords(null!==(e=null===(t=this.dataSourceObj)||void 0===t?void 0:t.records)&&void 0!==e?e:this.dataSourceObj),o&&Yx(o,this.source),this.sourceLength=(null===(i=this.source)||void 0===i?void 0:i.length)||0,this.sortedIndexMap.clear(),this.currentIndexedData=Array.from({length:this.sourceLength},((t,e)=>e)),this.userPagination||(this.pagination.perPageCount=this.sourceLength,this.pagination.totalCount=this.sourceLength),this.initTreeHierarchyState(),this.updatePagerData()}addRecordsForGroup(t,e){rt(t)&&0!==t.length&&((void 0===e||e>this.dataSourceObj.records)&&(e=this.dataSourceObj.records),this.dataSourceObj.records.splice(e,0,...t),this.updateGroup())}deleteRecordsForGroup(t){if(!rt(t)||0===t.length)return;const e=t.sort(((t,e)=>e-t));for(let t=0;t<e.length;t++){const i=e[t];i>=this.sourceLength||i<0||(delete this.beforeChangedRecordsMap[i],this.dataSourceObj.records.splice(i,1),this.sourceLength-=1)}this.updateGroup()}updateRecordsForGroup(t,e){for(let i=0;i<e.length;i++){const o=e[i];o>=this.sourceLength||o<0||(delete this.beforeChangedRecordsMap[o],this.dataSourceObj.records[o]=t[i])}this.updateGroup()}}function Xx(t,e,i,o,n){const r=o[n];if(!Q(r))return void e.push(t);const s=t[r];if(void 0!==s){if(i.has(s)){const r=i.get(s);return Xx(t,e[r].children,e[r].map,o,n+1)}return i.set(s,e.length),e.push({vtableMerge:!0,vtableMergeName:s,children:[],map:new Map}),Xx(t,e[e.length-1].children,e[e.length-1].map,o,n+1)}}function Yx(t,e,i,o){if(!i){i=new Map;for(let e=0;e<t.length;e++){const o=t[e];o.vtableMerge&&i.set(o.vtableMergeName,e)}}if(!o){o=new Map;for(let t=0;t<e.length;t++){const i=e[t];i.vtableMerge&&o.set(i.vtableMergeName,t)}}for(let i=0;i<t.length;i++){const n=t[i],r=e[o.get(n.vtableMergeName)];Q(r)&&(r.hierarchyState=t[i].hierarchyState),rt(n.children)&&rt(r.children)&&0!==n.map.size&&0!==r.map.size&&Yx(n.children,r.children,n.map,r.map)}}var Kx={exports:{}},qx={},Zx=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"),Jx=["style","variant","weight","size","lineHeight","family"],Qx=/([\.0-9]+)(.*)/,t_=function(t,e,i){var o=t.match(Qx);if(o){t=parseFloat(o[1]);var n=o[2].toLowerCase().trim(),r=Math.round(t);switch(r===t&&(t=r),n){case"em":if(null===e)return;return t*e;case"px":return t;case"pt":return t/(72/i);case"pc":return t/(6/i);case"mm":return t*(i/25.4);case"cm":return t*(i/2.54);case"in":return t*i;case"%":if(null===e)return;return e*(t/100)}}},e_={size:t_,lineHeight:t_},i_={serif:1,"sans-serif":1,cursive:1,fantasy:1,monospace:1},o_=Kx.exports=function(t,e,i){var o=t+"-"+(e||"null")+"@"+i;if(i=i||96,void 0!==qx[o])return qx[o];if(e&&(e=o_(e,null,i)),"inherit"===t)return e;var n=Zx.exec(t);if(n){n.shift();for(var r={},s=0;s<n.length;s++){var l=Jx[s],a=n[s];if(e_[l]&&a){var h=e&&e[l]||null,d=e_[l](a,h,i);a=void 0===d&&"lineHeight"===l&&a?r.size*parseFloat(a):d}if(a&&"normal"!==a){if("inherit"===a){if(!e)return;a=e[l]}a.trim&&(a=a.trim()),r[l]=a}}Object.keys(r).length||(r=null),qx[o]=r;var c=[];r.style&&c.push(r.style),r.variant&&c.push(r.variant),r.weight&&"400"!==r.weight&&"normal"!==r.weight&&c.push(r.weight),c.push(r.size+"px"),r.lineHeight&&(c[c.length-1]+="/"+r.lineHeight+"px");var u=r.family.split(",");return r.family=u.map((function(t){return t=t.trim(),i_[t.toLowerCase()]&&(t=t.toLowerCase()),t})),c.push(r.family),Object.defineProperty(r,"toString",{value:function(){return c.map((function(t){return Array.isArray(t)?t.map((function(t){return t.indexOf(" ")>-1?'"'+t.replace(/["']/g,"")+'"':t})).join(", "):t})).join(" ")}}),r}qx[o]=null};Kx.exports.generics=i_;var n_=$(Kx.exports);function r_(t){var e,i,o,n;if(at(t)||nt(t)||rt(t)){let e=or(t);return"number"==typeof e||"string"==typeof e?e=[e,e,e,e]:Array.isArray(e)&&(e=e.slice(0)),e}return t&&(isFinite(t.bottom)||isFinite(t.left)||isFinite(t.right)||isFinite(t.top))?[null!==(e=t.top)&&void 0!==e?e:0,null!==(i=t.right)&&void 0!==i?i:0,null!==(o=t.bottom)&&void 0!==o?o:0,null!==(n=t.left)&&void 0!==n?n:0]:[0,0,0,0]}const s_=0,l_=1,a_=2,h_=3,d_=10,c_=11,u_=12,g_=9,p_=13,f_=10,v_=12,m_=32,b_=37,y_=46,C_=48,w_=57,x_=65,__=90,S_=97,A_=122;function B_(t){return function(t){return t>=S_&&t<=A_}(t)||function(t){return t>=x_&&t<=__}(t)}function R_(t){return t===g_||t===f_||t===v_||t===p_||t===m_}function M_(t){return t>=C_&&t<=w_}function T_(t){return t===y_}function k_(t){return B_(t)||t===b_}function L_(t){return new Error(`calc parse error: ${t}`)}const P_={"*":3,"/":3,"+":2,"-":2};function E_(t,e){function i(t){const i=t.pop(),o=t.pop(),n=t.pop();if(!(n&&n.nodeType&&o&&o.type===a_&&i&&i.nodeType))throw L_(e);return{nodeType:c_,left:n,op:o,right:i}}const o=[];for(;t.length;){const n=t.shift();if(n.type===s_&&"("===n.value){let i=0;const n=Aw.findIndex(t,(t=>{if(t.type===s_&&"("===t.value)i++;else if(t.type===s_&&")"===t.value){if(!i)return!0;i--}return!1}));if(-1===n)throw L_(e);o.push(E_(t.splice(0,n),e)),t.shift()}else if(n.type===a_){if(o.length>=3){const t=o[o.length-2].value;P_[n.value]<=P_[t]&&o.push(i(o))}o.push(n)}else if(n.type===l_){const{value:t,unit:e}=n;o.push({nodeType:d_,value:t,unit:e})}else n.type===h_&&o.push({nodeType:u_,value:n.value})}for(;o.length>1;)o.push(i(o));return o[0]}function H_(t){return E_(function(t){const e=t.replace(/calc\(/g,"(").trim(),i=[],o=e.length;for(let s=0;s<o;s++){const o=e[s],l=o.charCodeAt(0);if("("===o||")"===o)i.push({value:o,type:s_});else if("*"===o||"/"===o)i.push({value:o,type:a_});else if("+"===o||"-"===o)s=n(o,s+1)-1;else if(M_(l)||T_(l))s=r(o,s+1)-1;else if(!R_(l))throw L_(t)}function n(t,n){if(n<o){const i=e[n],o=i.charCodeAt(0);if(M_(o)||T_(o))return r(t+i,n+1)}return i.push({value:t,type:a_}),n}function r(n,r){let l=r;for(;l<o;l++){const i=e[l],o=i.charCodeAt(0);if(M_(o))n+=i;else{if("."!==i){if(k_(o))return s(n,i,l+1);break}if(n.indexOf(".")>=0)throw L_(t);n+=i}}if("."===n)throw L_(t);return i.push({value:parseFloat(n),type:h_}),l}function s(t,n,r){let s=r;for(;s<o;s++){const t=e[s];if(!k_(t.charCodeAt(0)))break;n+=t}return i.push({value:parseFloat(t),unit:n,type:l_}),s}return i}(t),t)}function F_(t,e){if(t.nodeType===c_){const i=F_(t.left,e),o=F_(t.right,e);switch(t.op.value){case"+":return i+o;case"-":return i-o;case"*":return i*o;case"/":return i/o;default:throw new Error(`calc error. unknown operator: ${t.op.value}`)}}else if(t.nodeType===d_)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===u_)return t.value;throw new Error("calc error.")}function z_(t,e){return F_(H_(t),e)}function I_(t){return!!nt(t)&&!!t.endsWith("%")&&function(t){return!(J(t)||!at(t)&&+t!=+t)}(t.substring(0,t.length-1))}function O_(t,e){const{dataSourceEventIds:i}=t.internalProps;i&&i.forEach((e=>t.internalProps.handler.off(e))),e(t),t.internalProps.dataSourceEventIds=[t.internalProps.handler.on(t.internalProps.dataSource,Vx.EVENT_TYPE.CHANGE_ORDER,(()=>{t.dataSource.hierarchyExpandLevel&&t.refreshRowColCount(),t.render()}))]}function D_(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];O_(t,(()=>{t.internalProps.records=e;const i=t.internalProps.dataSource=$x.ofArray(e,t.internalProps.dataConfig,t.pagination,t.internalProps.columns,t.internalProps.layoutMap.rowHierarchyType,function(t){var e;return t.options.hierarchyExpandLevel?t.options.hierarchyExpandLevel:t.options.groupBy?1/0:(null===(e=t._hasHierarchyTreeHeader)||void 0===e?void 0:e.call(t))?1:void 0}(t));t.addReleaseObj(i)}))}function W_(t,e){O_(t,(()=>{if(e)if(e instanceof Vx)t.internalProps.dataSource=e;else{const i=t.internalProps.dataSource=new $x(e);t.addReleaseObj(i)}else t.internalProps.dataSource=Vx.EMPTY;t.internalProps.records=null}))}function N_(t,e){return Math.round((i=e,o=t.internalProps.calcWidthContext,"string"==typeof i?z_(i.trim(),o):i-0));var i,o}function G_(t,e,i,o,n){let r=!(arguments.length>5&&void 0!==arguments[5])||arguments[5];const s=r_(n("padding",t,i,o,e)),l=n("bgColor",t,i,o,e),a=n("font",t,i,o,e);let h,d,c,u,g;if(a){const{family:t,size:e,weight:i,style:o,variant:n}=function(t){return n_(t)}(a);h=t.join(" "),d=e,c=i,u=o,u=n}else h=n("fontFamily",t,i,o,e),d=n("fontSize",t,i,o,e),c=n("fontWeight",t,i,o,e),u=n("fontStyle",t,i,o,e),g=n("fontVariant",t,i,o,e);const p=n("textAlign",t,i,o,e),f=n("textBaseline",t,i,o,e),v=n("color",t,i,o,e),m=n("strokeColor",t,i,o,e),b=n("lineHeight",t,i,o,e),y=n("underline",t,i,o,e),C=n("underlineDash",t,i,o,e),w=n("underlineOffset",t,i,o,e),x=n("lineThrough",t,i,o,e),_=Math.max(1,Math.floor(d/10)),S=n("textOverflow",t,i,o,e),A=n("borderColor",t,i,o,e),B=n("borderLineWidth",t,i,o,e),R=n("borderLineDash",t,i,o,e),M=n("marked",t,i,o,e),T=n("cursor",t,i,o,e),k=!(s&&l&&a&&p&&f&&v&&S&&A&&B&&R&&"boolean"==typeof y&&"boolean"==typeof x&&"boolean"==typeof M);if(!r)return{hasFunctionPros:k};const L={text:{fontFamily:h,fontSize:d,fontWeight:c,fontStyle:u,fontVariant:g,fill:v,stroke:null!=m&&m,textAlign:p,textBaseline:f,lineHeight:null!=b?b:d,underline:y?_:void 0,underlineDash:C,underlineOffset:w,lineThrough:x?_:void 0,ellipsis:"clip"===S?"":"ellipsis"===S?"...":Q(S)?S:void 0},group:{fill:l,lineDash:R,lineWidth:B,stroke:A,cursor:"auto"===T||"default"===T?void 0:T},_vtable:{padding:s,marked:M}};if(Array.isArray(B)&&(L.group.strokeArrayWidth=r_(B)),Array.isArray(A)){const t=r_(A);L.group.stroke=!t.every((t=>!t))&&t,L.group.strokeArrayColor=r_(A)}return{theme:L,hasFunctionPros:k}}function j_(t,e,i){const o=i.theme.frameStyle.cornerRadius;if(Array.isArray(o)){if(0===t&&0===e)return[o[0],0,0,0];if(t===i.colCount-1&&0===e)return[0,o[1],0,0];if(0===t&&e===i.rowCount-1)return[0,0,0,o[3]];if(t===i.colCount-1&&e===i.rowCount-1)return[0,0,o[2],0]}else if(o){if(0===t&&0===e)return[o,0,0,0];if(t===i.colCount-1&&0===e)return[0,o,0,0];if(0===t&&e===i.rowCount-1)return[0,0,0,o];if(t===i.colCount-1&&e===i.rowCount-1)return[0,0,o,0]}return 0}function V_(t){for(let e=0;e<t.internalProps.columns.length;e++){const i=t.internalProps.columns[e];if(i.aggregation);else if(t.options.aggregation){let o;if(o="function"==typeof t.options.aggregation?t.options.aggregation({col:e,field:i.field}):t.options.aggregation,o)if(Array.isArray(o)){const t=[];o.forEach((e=>{t.push(Object.assign({showOnTop:!1},e))})),i.aggregation=t}else i.aggregation=Object.assign({showOnTop:!1},o)}}}let U_=class extends dc{constructor(t){super(t),"mouseenter_cell"!==this.attribute.visibleTime&&"click_cell"!==this.attribute.visibleTime||(this.attribute.opacity=0),this.attribute.hoverImage&&(this.attribute.originImage=this.attribute.image)}get backgroundWidth(){var t,e;return null!==(e=null!==(t=this.attribute.backgroundWidth)&&void 0!==t?t:this.attribute.width)&&void 0!==e?e:0}get backgroundHeight(){var t,e;return null!==(e=null!==(t=this.attribute.backgroundHeight)&&void 0!==t?t:this.attribute.height)&&void 0!==e?e:0}};function $_(t){return{rootContainer:new fs({}),renderDefault:!0}}class X_{constructor(t,e){this.removeAllContainer=t,this.table=e,this.customLayoutFuncCache=new Map,this.reactRemoveGraphicCache=new Map,this.headerCustomLayoutFuncCache=new Map,this.headerReactRemoveGraphicCache=new Map}hasReactCreateGraphic(t,e){return e?this.headerCustomLayoutFuncCache.has(t):this.customLayoutFuncCache.has(t)}setReactCreateGraphic(t,e,i){i?this.headerCustomLayoutFuncCache.set(t,e):this.customLayoutFuncCache.set(t,e)}setReactRemoveGraphic(t,e,i){i?this.headerReactRemoveGraphicCache.set(t,e):this.reactRemoveGraphicCache.set(t,e)}updateCustomCell(t,e){const i=this.table;if(i.isPivotTable()){const o=function(t,e,i){const o=e.internalProps.rowSeriesNumber?1:0,n=[],r=e.internalProps.layoutMap;if(i){const{headerObjects:e}=r,i=[];for(let o=0;o<e.length;o++){const n=e[o];n&&n.define.componentId===t&&i.push(n.id)}for(let t=0;t<i.length;t++){const e=i[t],o=r.getHeaderCellAdressById(e),s=r.getCellRange(o.col,o.row);n.push(s)}}else{let e;const{columnObjects:i,indicatorsAsCol:s}=r;for(let o=0;o<i.length;o++)if(i[o].define.componentId===t){e=o;break}if(s)for(let t=r.rowHeaderLevelCount+e;t<r.colCount;t+=i.length){const e={start:{col:t+o,row:r.columnHeaderLevelCount},end:{col:t+o,row:r.rowCount-1}};n.push(e)}else for(let t=r.columnHeaderLevelCount+e;t<r.rowCount;t+=i.length){const e={start:{col:r.rowHeaderLevelCount+o,row:t},end:{col:r.colCount-1,row:t}};n.push(e)}}return n}(t,i,e);for(let t=0;t<o.length;t++){const e=o[t];for(let t=e.start.col;t<=e.end.col;t++)for(let o=e.start.row;o<=e.end.row;o++)i.scenegraph.updateCellContent(t,o)}}else{const o=function(t,e,i){const o=e.internalProps.rowSeriesNumber?1:0;if(i){const i=e.internalProps.layoutMap,{headerObjects:o}=e.internalProps.layoutMap;let n;for(let e=0;e<o.length;e++){const i=o[e];if(i.define.componentId===t){n=i.id;break}}const r=i.getHeaderCellAdressById(n);return i.getCellRange(r.col,r.row)}const{columnObjects:n}=e.internalProps.layoutMap;for(let i=0;i<n.length;i++)if(n[i].define.componentId===t)return{start:{col:o+i,row:e.columnHeaderLevelCount},end:{col:o+i,row:e.rowCount-1}};return{start:{col:0,row:0},end:{col:e.colCount-1,row:e.rowCount-1}}}(t,i,e);for(let t=o.start.col;t<=o.end.col;t++)for(let e=o.start.row;e<=o.end.row;e++)i.scenegraph.updateCellContent(t,e)}"autoWidth"===i.widthMode&&i.scenegraph.recalculateColWidths(),"autoHeight"===i.heightMode&&i.scenegraph.recalculateRowHeights(),i.scenegraph.renderSceneGraph()}getCustomLayoutFunc(t,e){var i;if(this.table.isHeader(t,e)){const{componentId:o}=this.table.getHeaderDefine(t,e);return null!==(i=this.headerCustomLayoutFuncCache.get(o))&&void 0!==i?i:$_}const{componentId:o}=this.table.getBodyColumnDefine(t,e);return this.customLayoutFuncCache.get(o)||$_}removeCustomCell(t,e){let i;if(this.table.isHeader(t,e)){const o=this.table.getHeaderDefine(t,e),{componentId:n}=o;i=this.headerReactRemoveGraphicCache.get(n)}else{const o=this.table.getBodyColumnDefine(t,e),{componentId:n}=o;i=this.reactRemoveGraphicCache.get(n)}i&&i(t,e)}clearCache(){this.removeAllContainer()}}function Y_(t){const e={abstractPos:{x:t.viewport.x,y:t.viewport.y}},i=K_(t.target);return i&&(e.eventArgs={col:i.col,row:i.row,event:t,targetCell:i,mergeInfo:q_(i),target:t.target}),e}function K_(t){for(;t&&t.parent;){if("cell"===t.role)return t;t=t.parent}return null}function q_(t){if(Q(t.mergeStartCol)&&Q(t.mergeStartRow)&&Q(t.mergeEndCol)&&Q(t.mergeEndRow))return{colStart:t.mergeStartCol,colEnd:t.mergeEndCol,rowStart:t.mergeStartRow,rowEnd:t.mergeEndRow}}const Z_=/radio-\d+-\d+-(\d+)/,J_="_custom_",Q_="custom-container",tS=J_+"_0";function eS(t,e,i,o,n,r,s,l,a,h,d){var c,u,g;let p,f,v,m,b=!0,y=!1;if("react-custom-layout"===t&&(t=(null===(c=d.reactCustomLayout)||void 0===c?void 0:c.getCustomLayoutFunc(i,o))||$_),"function"==typeof t){const e=t({col:null!==(u=null==h?void 0:h.start.col)&&void 0!==u?u:i,row:null!==(g=null==h?void 0:h.start.row)&&void 0!==g?g:o,dataValue:d.getCellOriginValue(i,o),value:d.getCellValue(i,o)||"",rect:{left:0,top:0,right:n,bottom:r,width:n,height:r},table:d,originCol:i,originRow:o});e.rootContainer&&(e.rootContainer=nS(e.rootContainer)),e.rootContainer instanceof fs&&(m=e.rootContainer,m.name=Q_,m.col=i,m.row=o),b=e.renderDefault,y=e.enableCellPadding}else if("function"==typeof e){const t=e({col:i,row:o,dataValue:d.getCellOriginValue(i,o),value:d.getCellValue(i,o)||"",rect:{left:0,top:0,right:n,bottom:r,width:n,height:r},table:d});t&&(v=t.elements,b=t.renderDefault,p=t.expectedWidth,f=t.expectedHeight)}else e&&(p=e.expectedWidth,f=e.expectedHeight,v=e.elements,b=e.renderDefault);return v&&(m=function(t,e,i,o){const n=new fs({x:0,y:0,width:e,height:i,fill:!1,stroke:!1,pickable:!1});return n.name=Q_,function(t,e,i,o){const n=[],r=[0,0,0,0];for(let s=0;s<t.length;s++){const l=t[s],a=Object.assign({},l);for(const t in a)a.hasOwnProperty(t)&&Z(a[t])&&(a[t]=a[t](o));const h=a;Q(h.x)&&(h.x=nt(h.x)?iS(h.x,e-r[1]):Number(h.x)),Q(h.y)&&(h.y=nt(h.y)?iS(h.y,i-r[2]):Number(h.y)),"width"in a&&(a.width=nt(a.width)?iS(a.width,e-r[1]):Number(a.width)),"height"in a&&(a.height=nt(a.height)?iS(a.height,i-r[2]):Number(a.height)),"radius"in a&&(a.radius=nt(a.radius)?iS(a.radius,Math.min(e-r[1],i-r[2])):Number(a.radius)),"hover"in a&&(a.hover.x=nt(a.hover.x)?iS(a.hover.x,e-r[1]):Number(a.hover.x),a.hover.y=nt(a.hover.y)?iS(a.hover.y,i-r[2]):Number(a.hover.y),a.hover.width=nt(a.hover.width)?iS(a.hover.width,e-r[1]):Number(a.hover.width),a.hover.height=nt(a.hover.height)?iS(a.hover.height,i-r[2]):Number(a.hover.height),a.hover.x+=0,a.hover.y+=0),h.x=h.x+0,h.y=h.y+0,n.push(a)}return n}(t,e,i,o).forEach((t=>{var e,i,o,r,s,l,a,h,d,c,u,g,p,f,v,m,b,y,C,w,x,_,S,A,B,R,M,T;switch(t.clickable&&(t.pickable=t.clickable),t.type){case"arc":const k=Ac({x:t.x,y:t.y,dx:null!==(e=t.dx)&&void 0!==e?e:0,dy:null!==(i=t.dy)&&void 0!==i?i:0,fill:t.fill,stroke:t.stroke,outerRadius:t.radius,startAngle:t.startAngle,endAngle:t.endAngle,pickable:!!t.pickable,cursor:t.cursor});k.name=t.name,n.appendChild(k);break;case"text":if(t.background){const e=null!==(r=null===(o=t.background)||void 0===o?void 0:o.expandX)&&void 0!==r?r:0,i=null!==(l=null===(s=t.background)||void 0===s?void 0:s.expandY)&&void 0!==l?l:0,p=sc({x:t.x-e,y:t.y-i,dx:null!==(a=t.dx)&&void 0!==a?a:0,dy:null!==(h=t.dy)&&void 0!==h?h:0,width:t.width+2*e,height:t.height+2*i,cornerRadius:null!==(c=null===(d=t.background)||void 0===d?void 0:d.cornerRadius)&&void 0!==c?c:0,fill:null!==(g=null===(u=t.background)||void 0===u?void 0:u.fill)&&void 0!==g?g:"#888"});n.appendChild(p)}const L=new Nh(Object.assign({pickable:!!t.pickable,fill:null!==(p=t.color)&&void 0!==p?p:t.fill},t));L.name=t.name,n.appendChild(L);break;case"rect":const P=sc({x:t.x,y:t.y,dx:null!==(f=t.dx)&&void 0!==f?f:0,dy:null!==(v=t.dy)&&void 0!==v?v:0,width:t.width,height:t.height,cornerRadius:t.radius,fill:t.fill,stroke:t.stroke,pickable:!!t.pickable,cursor:t.cursor});P.name=t.name,n.appendChild(P);break;case"circle":const E=Oh({x:t.x,y:t.y,dx:null!==(m=t.dx)&&void 0!==m?m:0,dy:null!==(b=t.dy)&&void 0!==b?b:0,radius:t.radius,fill:t.fill,stroke:t.stroke,pickable:!!t.pickable,cursor:t.cursor});E.name=t.name,n.appendChild(E);break;case"icon":const H=new U_({x:t.x,y:t.y,dx:null!==(y=t.dx)&&void 0!==y?y:0,dy:null!==(C=t.dy)&&void 0!==C?C:0,width:t.width,height:t.height,image:t.svg,backgroundWidth:t.hover?null!==(w=t.hover.width)&&void 0!==w?w:t.width:void 0,backgroundHeight:t.hover?null!==(x=t.hover.width)&&void 0!==x?x:t.width:void 0,backgroundColor:t.hover?null!==(_=t.hover.bgColor)&&void 0!==_?_:"rgba(22,44,66,0.2)":void 0,pickable:!!t.pickable,cursor:t.cursor});H.name=t.name,H.role="icon-custom",n.appendChild(H);break;case"image":const F=new U_({x:t.x,y:t.y,dx:null!==(S=t.dx)&&void 0!==S?S:0,dy:null!==(A=t.dy)&&void 0!==A?A:0,width:t.width,height:t.height,image:t.src,backgroundWidth:t.hover?null!==(B=t.hover.width)&&void 0!==B?B:t.width:void 0,backgroundHeight:t.hover?null!==(R=t.hover.width)&&void 0!==R?R:t.width:void 0,backgroundColor:t.hover?null!==(M=t.hover.bgColor)&&void 0!==M?M:"rgba(22,44,66,0.2)":void 0,pickable:!!t.pickable,cursor:t.cursor,shape:t.shape});F.name=t.name,F.role="image-custom",n.appendChild(F);break;case"line":const z=oc({points:t.points,lineWidth:null!==(T=t.lineWidth)&&void 0!==T?T:1,stroke:t.stroke,pickable:!!t.pickable,cursor:t.cursor});z.name=t.name,n.appendChild(z)}})),n}(v,s?p:n,l?f:r,d.getCellValue(i,o))),y&&m.setAttributes({x:a[3],y:a[0],width:n-a[1]-a[3],height:r-a[0]-a[2]}),oS(m,n,r),!h||h.start.col===h.end.col&&h.start.row===h.end.row||rS(m,i,o,0),{elementsGroup:m,renderDefault:b}}function iS(t,e){return t.endsWith("px")?parseInt(t,10):t.endsWith("%")&&e?parseInt(t,10)/100*e:parseInt(t,10)}function oS(t,e,i){t&&t.forEachChildren((t=>{var o,n;t&&(tt(t.attribute.width)&&t.attribute.width.percent&&t.setAttribute("width",Math.max(0,t.attribute.width.percent/100*e+(null!==(o=t.attribute.width.delta)&&void 0!==o?o:0))),t.attribute.width<0&&t.setAttribute("width",0),tt(t.attribute.height)&&t.attribute.height.percent&&t.setAttribute("height",Math.max(0,t.attribute.height.percent/100*i+(null!==(n=t.attribute.height.delta)&&void 0!==n?n:0))),t.attribute.height<0&&t.setAttribute("height",0),"group"===t.type&&oS(t,t.attribute.width,t.attribute.height))}))}function nS(t){if(!t||!Q(t.$$typeof)&&!Q(t.vtype))return t;const e=t.type,{attribute:i,children:o,stateProxy:n}=t.props,r=e({attribute:i});return function(t,e){let i=!1;switch(t.type){case"richtext":case"rich/image":break;default:i=!0}i&&Object.keys(e).forEach((i=>{const o=Gg[i];o&&t.on(o,e[i])}))}(r,t.props),n&&(r.stateProxy=n),r.id=i.id,r.name=i.name,rt(o)?o.forEach((t=>{const e=nS(t);e&&e.type&&r.add(e)})):o&&r.add(nS(o)),r}function rS(t,e,i,o,n){t&&(t.name=`${J_}${null!=n?n:""}_${o}`,t.onBeforeAttributeUpdate=sS,"group"===t.type&&t.childrenCount&&t.forEachChildren(((t,r)=>{rS(t,e,i,r,(null!=n?n:"")+"_"+o)})))}function sS(t,e){const i=this;if(i.skipMergeUpdate)return;const o=K_(i);if(!o||!o.stage)return;const n=o.stage.table;i.skipAttributeUpdate=!0;const{mergeStartCol:r,mergeEndCol:s,mergeStartRow:l,mergeEndRow:a}=o;if(Q(r)&&Q(s)&&Q(l)&&Q(a)&&(r!==s||l!==a)){for(let e=r;e<=s;e++)for(let r=l;r<=a;r++){if(e===o.col&&r===o.row)continue;const s=n.scenegraph.highPerformanceGetCell(e,r);if("cell"===s.role){const e=s.getChildByName(i.name,!0);if(!e||e.skipAttributeUpdate)continue;for(const i in t)t[i]!==e.attribute[i]&&"dx"!==i&&"dy"!==i&&e.setAttribute(i,t[i])}}i.skipAttributeUpdate=void 0}}const lS={};class aS{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}}let hS,dS,cS,uS,gS,pS,fS,vS,mS,bS,yS,CS,wS,xS,_S,SS,AS,BS,RS,MS,TS,kS,LS,PS;function ES(t){var e,i,o,n,r,s,l,a,h,d,c,u,g,p,f,v,m,b,y,C,w,x,_,S;hS=null!==(e=null==t?void 0:t.sort_color)&&void 0!==e?e:"#282F38",dS=null!==(i=null==t?void 0:t.sort_color_opacity)&&void 0!==i?i:"0.35",cS=null!==(o=null==t?void 0:t.sort_color_2)&&void 0!==o?o:"#416EFF",uS=null!==(n=null==t?void 0:t.sort_color_opacity_2)&&void 0!==n?n:"1",gS=null!==(r=null==t?void 0:t.sort_size)&&void 0!==r?r:16,pS=null!==(s=null==t?void 0:t.sort_size_2)&&void 0!==s?s:22,fS=null!==(l=null==t?void 0:t.frozen_color)&&void 0!==l?l:"#282F38",vS=null!==(a=null==t?void 0:t.frozen_color_opacity)&&void 0!==a?a:"0.35",mS=null!==(h=null==t?void 0:t.frozen_color_opacity)&&void 0!==h?h:"0.2",bS=null!==(d=null==t?void 0:t.frozen_color_2)&&void 0!==d?d:"#416EFF",yS=null!==(c=null==t?void 0:t.frozen_color_opacity_2)&&void 0!==c?c:"1",CS=null!==(u=null==t?void 0:t.frozen_size)&&void 0!==u?u:22,wS=null!==(g=null==t?void 0:t.frozen_size_2)&&void 0!==g?g:22,xS=null!==(p=null==t?void 0:t.collapse_color)&&void 0!==p?p:"#141414",_S=null!==(f=null==t?void 0:t.collapse_color_opacity)&&void 0!==f?f:"0.65",SS=null!==(v=null==t?void 0:t.collapse_size)&&void 0!==v?v:16,AS=null!==(m=null==t?void 0:t.frozen_size_2)&&void 0!==m?m:22,BS=null!==(b=null==t?void 0:t.expand_color)&&void 0!==b?b:"#141414",RS=null!==(y=null==t?void 0:t.expand_color_opacity)&&void 0!==y?y:"0.65",MS=null!==(C=null==t?void 0:t.expand_size)&&void 0!==C?C:16,TS=null!==(w=null==t?void 0:t.expand_size_2)&&void 0!==w?w:22,kS=null!==(x=null==t?void 0:t.dragReorder_color)&&void 0!==x?x:"#666666",LS=null!==(_=null==t?void 0:t.dragReorder_color_opacity)&&void 0!==_?_:"1",PS=null!==(S=null==t?void 0:t.dragReorder_size)&&void 0!==S?S:20}aS.cache=new Map;const HS={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="${cS}" fill-opacity="${uS}"/><path d="M11.3335 7L4.66683 7L8.00016 2.83333L11.3335 7Z" fill="${hS}" fill-opacity="${dS}"/></svg> `,width:gS,height:gS,funcType:VC.sort,name:"sort_downward",positionType:jC.contentRight,marginLeft:3,hover:{width:pS,height:pS,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="${hS}" fill-opacity="${dS}"/><path d="M11.3335 7L4.66683 7L8.00016 2.83333L11.3335 7Z" fill="${cS}" fill-opacity="${uS}"/> </svg>`,width:gS,height:gS,funcType:VC.sort,positionType:jC.contentRight,name:"sort_upward",marginLeft:3,hover:{width:pS,height:pS,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="${hS}" fill-opacity="${dS}"/><path d="M11.3335 7L4.66683 7L8.00016 2.83333L11.3335 7Z" fill="${hS}" fill-opacity="${dS}"/></svg> `,width:gS,height:gS,funcType:VC.sort,positionType:jC.contentRight,name:"sort_normal",marginLeft:3,hover:{width:pS,height:pS,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="${fS}" fill-opacity="${mS}"/></g><defs><clipPath id="clip0"><rect width="22" height="22" fill="white"/></clipPath></defs></svg>`,width:CS,height:CS,name:"freeze",funcType:VC.frozen,positionType:jC.right,marginRight:0,hover:{width:wS,height:wS,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="${fS}" fill-opacity="${vS}"/></svg>`,width:CS,height:CS,name:"frozen",funcType:VC.frozen,positionType:jC.right,marginRight:0,hover:{width:wS,height:wS,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="${bS}" fill-opacity="${yS}"/></svg>`,width:CS,height:CS,funcType:VC.frozen,positionType:jC.right,name:"frozenCurrent",marginRight:0,hover:{width:wS,height:wS,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:VC.dropDown,positionType:jC.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:VC.play,positionType:jC.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:VC.damagePic,positionType:jC.left,name:"damage_pic",marginRight:0,hover:{width:24,height:24,bgColor:"rgba(101, 117, 168, 0.1)"},cursor:"pointer"}},get loading_pic(){return{type:"svg",svg:'<svg viewBox="0 0 400 300" fill="none" xmlns="http://www.w3.org/2000/svg"><mask id="a" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="50" y="65" width="301" height="170"><path d="M350.3 65H50v169.8h300.3V65Z" fill="#fff"/></mask><g mask="url(#a)"><path fill-rule="evenodd" clip-rule="evenodd" d="M58.3 233.2h32.8v-36.8H58.3v36.8Z" fill="#C7DEFF"/><path d="M91.1 224.5v8.8H58.3M82.4 196.2H58.3" stroke="#071F4D"/><path fill-rule="evenodd" clip-rule="evenodd" d="M305.4 182.5s-2.7 12.6 0 17.4c2.7 4.8 8.3 6.7 12.4 4.4 4.2-2.4 5.3-8.1 2.6-12.9-2.7-4.8-15-8.9-15-8.9ZM336 204.7c4.3 2 9.7-.4 12-5.4 2.3-5-1.5-17.3-1.5-17.3s-11.8 5.1-14.1 10.1c-2.3 5-.7 10.6 3.6 12.6Z" fill="#00E4E5"/><path fill-rule="evenodd" clip-rule="evenodd" d="M326.7 174s-10 11.8-10 18.6c0 6.7 4.5 12.2 10 12.2s10-5.5 10-12.3c0-6.8-10-18.5-10-18.5Z" fill="#00E4E5"/><path d="M332.3 181.5c2.3 3.6 4.4 7.8 4.4 10.9M316.7 192.5c0-3.1 2.1-7.2 4.3-10.8" stroke="#071F4D"/><path fill-rule="evenodd" clip-rule="evenodd" d="M343.1 227.3v-9.7h-34v9.7c0 3.7 3 6.6 6.6 6.6h20.9c3.6 0 6.5-2.9 6.5-6.6Z" fill="#071F4D"/><path fill-rule="evenodd" clip-rule="evenodd" d="M350.4 220.8V198H302v22.8c0 5.9 4.8 10.7 10.7 10.7h26.9c5.9 0 10.7-4.8 10.8-10.7Z" fill="#C7DEFF"/><path fill-rule="evenodd" clip-rule="evenodd" d="M331.7 74.2H117.8L87.4 203h213.8l30.5-128.8Z" fill="#fff"/><path fill-rule="evenodd" clip-rule="evenodd" d="M337 74.2h-6.2l-30.6 129.2h6.2L337 74.2Z" fill="#fff"/><path fill-rule="evenodd" clip-rule="evenodd" d="M303.8 203.5h2.4l30.7-129.3h-1.8l-31.3 129.3Z" fill="#C7DEFF"/><path d="m337 74.2-30.6 129.2h-5.9" stroke="#071F4D"/><path fill-rule="evenodd" clip-rule="evenodd" d="M229.9 202.1h-47.6l2 9.6h47.3l-1.7-9.6Z" fill="#C7DEFF"/><path fill-rule="evenodd" clip-rule="evenodd" d="M94.7 172.6 87.4 203h213.1l7.8-30.4H94.7Z" fill="#006EFF"/><path fill-rule="evenodd" clip-rule="evenodd" d="M94.7 172.6 87.4 203h213.1l7.8-30.4H94.7Z" fill="#006EFF"/><path d="M138.5 74.2h193.2l-23.4 98.6M94.5 172.7l11-46.3M104.8 155.4l-2.3 11.5h6.7M316 112.1l1.1-4.5" stroke="#071F4D"/><path fill-rule="evenodd" clip-rule="evenodd" d="M148.3 138.1h97V119h-97v19.1Z" fill="#00E4E5"/><path d="M303.1 80.6h20.3l-4.6 19.6M228.3 234.3c3.6 0 6.3-3.2 5.7-6.8l-4.1-24.1" stroke="#071F4D"/><path fill-rule="evenodd" clip-rule="evenodd" d="M226.2 229.5h-68.9v1.2c0 2 1.6 3.7 3.7 3.7h60.1c2.8 0 5-2.2 5.1-4.9Z" fill="#C7DEFF"/><path d="M180.699 226.8h-19.9c-2.8 0-4.6 3-3.3 5.5m0 0c.6 1.2 1.9 2 3.3 2h57.8M175.9 203.4l3.6 17.6M241.2 234.3h65.1M104.6 234.3h41.3" stroke="#071F4D"/><path d="M206.2 234.3h14.9c3.1 0 5.5-2.8 5-5.9l-4.3-24.9M160.7 226.8h46M62.2 226.1h-9.5c-1.2 0-2.2-1-2.2-2.2v-18.3c0-1.2 1-2.2 2.2-2.2h9.5" stroke="#071F4D"/><path d="M53.4 171.7H68c2.1 0 3.7 1.7 3.7 3.7v16.1M79.1 192v-21.8c0-2.5 2-4.6 4.6-4.6h2.2c2.5 0 4.5-2 4.5-4.5m0 0c0-2.5-2-4.5-4.5-4.5H56.1c-2.4 0-4.3-1.9-4.3-4.3V148M71.2 165.2h-18M64 181.7v10.1" stroke="#C7DEFF"/><path fill-rule="evenodd" clip-rule="evenodd" d="M85.7 120H124c4.3 0 7.7-3.5 7.7-7.7V65.5H94.2c-4.7 0-8.5 4.9-8.5 11V120Z" fill="#C7DEFF"/><path d="M85.7 110.7V73c0-4.1 3.4-7.5 7.5-7.5h38.5M146.2 73.8v-2.5c0-3.2-2-5.8-5.8-5.8-2.8 0-6 1.1-6 5.8v42.4c0 4.7-3.8 8.5-8.5 8.5h-15.6" stroke="#071F4D"/><path d="M119.7 122.3H87c-6.1 0-11.1-5-11.1-11.1m0 0h39M126.1 122.3c-6.1 0-11.1-5-11.1-11.1" stroke="#071F4D"/><path fill-rule="evenodd" clip-rule="evenodd" d="M85.4 122.1h37.2c-6.5-1.8-8-10.5-8-10.5H76.2c.6 8.8 9.2 10.5 9.2 10.5Z" fill="#071F4D"/><path fill-rule="evenodd" clip-rule="evenodd" d="M95.8 102.9h4.8V83.6h-4.8v19.3ZM106.6 102.9h4.8V77.6h-4.8v25.3ZM117.3 102.9h4.8V89.1h-4.8v13.8Z" fill="#fff"/><path d="M273.2 195.9h16.9M261.2 195.9h5" stroke="#fff"/><path d="M62.4 201.9v2.9M62.4 224.5v2.9" stroke="#071F4D"/><path d="m153.6 138.1 9.7-19.1M168.8 138.1l9.7-19.1M184.1 138.1l9.7-19.1M199.4 138.1l9.7-19.1M214.6 138.1l9.8-19.1M229.9 138.1l9.7-19.1" stroke="#fff"/><path d="M148.3 138.1h121.6V119H148.3v19.1Z" stroke="#071F4D"/></g></svg>',width:400,height:300,name:"loading_pic",positionType:jC.left}},get expand(){return{type:"svg",svg:`<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="none">\n <path d="M4.64988 6.81235C4.38797 6.48497 4.62106 6 5.04031 6L10.9597 6C11.3789 6 11.612 6.48497 11.3501 6.81235L8.39043 10.512C8.19027 10.7622 7.80973 10.7622 7.60957 10.512L4.64988 6.81235Z" fill="${BS}" fill-opacity="${RS}"/>\n </svg>`,width:MS,height:MS,funcType:VC.expand,name:"expand",positionType:jC.contentLeft,marginLeft:0,marginRight:4,hover:{width:TS,height:TS,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="${xS}" fill-opacity="${_S}"/>\n </svg>`,width:SS,height:SS,funcType:VC.collapse,name:"collapse",positionType:jC.contentLeft,marginLeft:0,marginRight:4,hover:{width:AS,height:AS,bgColor:"rgba(101, 117, 168, 0.1)"},cursor:"pointer"}},get drillDown(){return{name:"drillDown",type:"svg",positionType:jC.absolute,funcType:VC.drillDown,svg:'<svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><rect x="0" y="0" width="1024" height="1024" rx="20%" ry="20%" fill="#ffffff" /><path d="M810.666667 85.333333c70.688 0 128 57.312 128 128v597.333334c0 70.688-57.312 128-128 128H213.333333c-70.688 0-128-57.312-128-128V213.333333c0-70.688 57.312-128 128-128h597.333334z m0 85.333334H213.333333a42.666667 42.666667 0 0 0-42.613333 40.533333L170.666667 213.333333v597.333334a42.666667 42.666667 0 0 0 40.533333 42.613333L213.333333 853.333333h597.333334a42.666667 42.666667 0 0 0 42.613333-40.533333L853.333333 810.666667V213.333333a42.666667 42.666667 0 0 0-40.533333-42.613333L810.666667 170.666667zM549.333333 288a5.333333 5.333333 0 0 1 5.333334 5.333333V469.333333h176a5.333333 5.333333 0 0 1 5.333333 5.333334v74.666666a5.333333 5.333333 0 0 1-5.333333 5.333334H554.666667v176a5.333333 5.333333 0 0 1-5.333334 5.333333h-74.666666a5.333333 5.333333 0 0 1-5.333334-5.333333V554.666667H293.333333a5.333333 5.333333 0 0 1-5.333333-5.333334v-74.666666a5.333333 5.333333 0 0 1 5.333333-5.333334H469.333333V293.333333a5.333333 5.333333 0 0 1 5.333334-5.333333h74.666666z"></path></svg>',width:13,height:13,cursor:"pointer"}},get drillUp(){return{name:"drillUp",type:"svg",positionType:jC.absolute,funcType:VC.drillUp,svg:'<svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><rect x="0" y="0" width="1024" height="1024" rx="20%" ry="20%" fill="#ffffff" /><path d="M810.666667 85.333333c70.688 0 128 57.312 128 128v597.333334c0 70.688-57.312 128-128 128H213.333333c-70.688 0-128-57.312-128-128V213.333333c0-70.688 57.312-128 128-128h597.333334z m0 85.333334H213.333333a42.666667 42.666667 0 0 0-42.613333 40.533333L170.666667 213.333333v597.333334a42.666667 42.666667 0 0 0 40.533333 42.613333L213.333333 853.333333h597.333334a42.666667 42.666667 0 0 0 42.613333-40.533333L853.333333 810.666667V213.333333a42.666667 42.666667 0 0 0-40.533333-42.613333L810.666667 170.666667zM693.333333 469.333333a42.666667 42.666667 0 1 1 0 85.333334H330.666667a42.666667 42.666667 0 1 1 0-85.333334h362.666666z"></path></svg>',width:13,height:13,cursor:"pointer"}},get dragReorder(){return{type:"svg",svg:`<svg t="1710129136961" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5166" width="200" height="200"><path d="M362.666667 192m-64 0a64 64 0 1 0 128 0 64 64 0 1 0-128 0Z" fill="${kS}" fill-opacity="${LS}" p-id="5167"></path><path d="M661.333333 192m-64 0a64 64 0 1 0 128 0 64 64 0 1 0-128 0Z" fill="${kS}" fill-opacity="${LS}" p-id="5168"></path><path d="M362.666667 512m-64 0a64 64 0 1 0 128 0 64 64 0 1 0-128 0Z" fill="${kS}" fill-opacity="${LS}" p-id="5169"></path><path d="M661.333333 512m-64 0a64 64 0 1 0 128 0 64 64 0 1 0-128 0Z" fill="${kS}" fill-opacity="${LS}" p-id="5170"></path><path d="M362.666667 832m-64 0a64 64 0 1 0 128 0 64 64 0 1 0-128 0Z" fill="${kS}" fill-opacity="${LS}" p-id="5171"></path><path d="M661.333333 832m-64 0a64 64 0 1 0 128 0 64 64 0 1 0-128 0Z" fill="${kS}" fill-opacity="${LS}" p-id="5172"></path></svg>`,width:PS,height:PS,funcType:VC.dragReorder,positionType:jC.left,name:"dragReorder",marginLeft:-10,marginRight:10,cursor:"grab"}}};function FS(){return Lw(HS,lS)}let zS=class extends fs{clear(){this.removeAllChild()}getChildByName(t,e){let i=null;return this.forEachChildren((e=>e.name===t&&(i=e,!0))),e&&this.forEachChildren((e=>{if(e.getChildByName){const o=e.getChildByName(t,!0);if(o)return i=o,!0}return!1})),i}get width(){var t;let e=this.AABBBounds.width();return e!==1/0&&e!==-1/0||(e=0),Math.max(e,null!==(t=this.attribute.width)&&void 0!==t?t:0)}get height(){var t;let e=this.AABBBounds.height();return e!==1/0&&e!==-1/0||(e=0),Math.max(e,null!==(t=this.attribute.height)&&void 0!==t?t:0)}setDeltaWidth(t){var e;0!==t&&(this.setAttribute("width",(null!==(e=this.attribute.width)&&void 0!==e?e:0)+t),this.border&&(this.border.setAttribute("width",this.border.attribute.width+t),"group"===this.border.type&&this.border.firstChild.setAttribute("width",this.border.firstChild.attribute.width+t)))}setDeltaHeight(t){var e;0!==t&&(this.setAttribute("height",(null!==(e=this.attribute.height)&&void 0!==e?e:0)+t),this.border&&(this.border.setAttribute("height",this.border.attribute.height+t),"group"===this.border.type&&this.border.firstChild.setAttribute("width",this.border.firstChild.attribute.height+t)))}setDeltaX(t){0!==t&&this.setAttribute("x",this.attribute.x+t)}setDeltaY(t){0!==t&&this.setAttribute("y",this.attribute.y+t)}forEachChildrenSkipChild(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"border-rect";if(arguments.length>2&&void 0!==arguments[2]&&arguments[2]){let i=this._lastChild,o=0;for(;i;){if(i.name!==e&&t(i,o++))return;i=i._prev}}else{let i=this._firstChild,o=0;for(;i;){if(i.name!==e&&t(i,o++))return;i=i._next}}}getColGroup(t){let e=this._firstChild;if(!e)return null;for(let i=0;i<this.childrenCount;i++){if(e.col===t)return e;e=e._next}return null}getRowGroup(t){let e=this._firstChild;if(!e)return null;for(let i=0;i<this.childrenCount;i++){if(e.row===t)return e;e=e._next}return null}addCellGroup(t){if(0===this.childrenCount||this.lastChild.row===t.row-1)this.addChild(t);else{let e=this._firstChild;for(let i=0;i<this.childrenCount;i++){if(e.row===t.row-1)return void this.insertAfter(t,e);e=e._next}this.addChild(t)}}getChildAt(t){const e=super.getChildAt(t);return e&&"border-rect"===e.name?e._next:e}tryUpdateAABBBounds(){if("cell"===this.role){if(!this.shouldUpdateAABBBounds())return this._AABBBounds;const t=this.shouldSelfChangeUpdateAABBBounds(),e=this.doUpdateAABBBounds();return this.addUpdateLayoutTag(),function(t,e){t.stage&&t.stage.dirtyBounds&&t.stage.renderCount&&(t.isContainer&&!e||t.stage.dirty(t.globalAABBBounds))}(this,t),e}return super.tryUpdateAABBBounds()}doUpdateAABBBounds(){if("cell"===this.role){const t=this.attribute,{x:e,y:i,width:o,height:n}=t;return this._AABBBounds.setValue(e,i,e+o,i+n),this.parent&&this.parent.addChildUpdateBoundTag(),this.clearUpdateBoundTag(),this._AABBBounds}return"body"===this.role||"row-header"===this.role||"col-header"===this.role||"right-frozen"===this.role||"bottom-frozen"===this.role||"corner-header"===this.role||"corner-right-top-header"===this.role||"corner-right-bottom-header"===this.role||"corner-left-bottom-header"===this.role?(this._AABBBounds.setValue(-1/0,-1/0,1/0,1/0),this.parent&&this.parent.addChildUpdateBoundTag(),this.clearUpdateBoundTag(),this.shadowRoot&&this.shadowRoot.tryUpdateAABBBounds(),this._AABBBounds):super.doUpdateAABBBounds()}updateColumnRowNumber(t){this.rowNumber?this.rowNumber=Math.max(this.rowNumber,t):this.rowNumber=t}updateColumnHeight(t){this.colHeight?this.colHeight+=t:this.colHeight=t}};function IS(t,e,i,o){const n=t/e;let r,s;return n>i/o?(r=i,s=r/n):(s=o,r=s*n),{width:r,height:s}}function OS(t,e,i,o,n,r){let s=arguments.length>6&&void 0!==arguments[6]?arguments[6]:"left",l=arguments.length>7&&void 0!==arguments[7]?arguments[7]:"middle",a=arguments.length>8&&void 0!==arguments[8]?arguments[8]:[0,0,0,0],h=arguments.length>9&&void 0!==arguments[9]?arguments[9]:0,d=arguments.length>10&&void 0!==arguments[10]?arguments[10]:0,c=arguments.length>11&&void 0!==arguments[11]?arguments[11]:0,u=arguments.length>12&&void 0!==arguments[12]?arguments[12]:0;const g=t+i,p=e+o;let f=t+a[3]+h;"right"===s||"end"===s?f=g-n-a[1]-d:"center"===s&&(f=t+(i-n+h-d)/2);let v=e+a[0]+c;return"bottom"===l||"alphabetic"===l||"ideographic"===l?v=p-r-a[2]-u:"middle"===l&&(v=e+(o-r+c-u)/2),{x:f,y:v}}function DS(t,e,i,o,n){const r=e&&Q(e[t])?e[t]:void 0;return"function"==typeof r?r({col:i,row:o,table:n,value:n.getCellValue(i,o),dataValue:n.getCellOriginValue(i,o),cellHeaderPaths:n.getCellHeaderPaths(i,o)}):r}function WS(t,e,i,o,n){const r=e&&Q(e[t])?e[t]:void 0;if("function"==typeof r)return r({col:i,row:o,table:n,value:n.getCellValue(i,o),dataValue:n.getCellOriginValue(i,o),cellHeaderPaths:n.getCellHeaderPaths(i,o)})}function NS(t,e,i,o){var n,r,s,l,a,h,d,c,u,g,p,f,v,m,b,y,C,w;let x=null!==(r=null===(n=null==i?void 0:i.group)||void 0===n?void 0:n.strokeArrayWidth)&&void 0!==r?r:void 0;return o.theme.cellInnerBorder||!function(t){return!!Q(t)&&(!rt(t)||t.some((t=>Q(t))))}(o.theme.frameStyle.borderLineWidth)||function(t){return 0===t||rt(t)&&t.every((t=>0===t))}(o.theme.frameStyle.borderLineWidth)||(0===t&&(x=null!=x?x:[null===(s=null==i?void 0:i.group)||void 0===s?void 0:s.lineWidth,null===(l=null==i?void 0:i.group)||void 0===l?void 0:l.lineWidth,null===(a=null==i?void 0:i.group)||void 0===a?void 0:a.lineWidth,null===(h=null==i?void 0:i.group)||void 0===h?void 0:h.lineWidth],x[3]=0),t===o.colCount-1&&(x=null!=x?x:[null===(d=null==i?void 0:i.group)||void 0===d?void 0:d.lineWidth,null===(c=null==i?void 0:i.group)||void 0===c?void 0:c.lineWidth,null===(u=null==i?void 0:i.group)||void 0===u?void 0:u.lineWidth,null===(g=null==i?void 0:i.group)||void 0===g?void 0:g.lineWidth],x[1]=0),0===e&&(x=null!=x?x:[null===(p=null==i?void 0:i.group)||void 0===p?void 0:p.lineWidth,null===(f=null==i?void 0:i.group)||void 0===f?void 0:f.lineWidth,null===(v=null==i?void 0:i.group)||void 0===v?void 0:v.lineWidth,null===(m=null==i?void 0:i.group)||void 0===m?void 0:m.lineWidth],x[0]=0),e===o.rowCount-1&&(x=null!=x?x:[null===(b=null==i?void 0:i.group)||void 0===b?void 0:b.lineWidth,null===(y=null==i?void 0:i.group)||void 0===y?void 0:y.lineWidth,null===(C=null==i?void 0:i.group)||void 0===C?void 0:C.lineWidth,null===(w=null==i?void 0:i.group)||void 0===w?void 0:w.lineWidth],x[2]=0)),x}class GS extends zS{constructor(t){super(t),this._autoWidth=!1,this._autoHeight=!1,this._leftGroup=new zS({pickable:!1,fill:!1,stroke:!1}),this._leftGroup.role="content-left",this._rightGroup=new zS({pickable:!1,fill:!1,stroke:!1}),this._rightGroup.role="content-right",this._centerGroup=new zS({pickable:!1,fill:!1,stroke:!1}),this._centerGroup.role="content-center",this.appendChild(this._leftGroup),this.appendChild(this._rightGroup),this.appendChild(this._centerGroup)}setCellContentOption(t){this._autoWidth=t.autoWidth,this._autoHeight=t.autoHeight,this._cellWidth=t.cellWidth,this._originCellWidth=t.cellWidth,this._cellHeight=t.cellHeight,this._align=t.align,this._baseline=t.baseline}addLeftOccupyingIcon(t){var e,i,o;t.setAttribute("x",this._leftGroup.width+(null!==(e=t.attribute.marginLeft)&&void 0!==e?e:0)),this._leftGroup.appendChild(t),this._leftGroup.setDeltaWidth((null!==(i=t.attribute.marginLeft)&&void 0!==i?i:0)+(null!==(o=t.attribute.marginRight)&&void 0!==o?o:0)+t.attribute.width)}addRightOccupyingIcon(t){var e,i,o;t.setAttribute("x",this._rightGroup.width+(null!==(e=t.attribute.marginLeft)&&void 0!==e?e:0)),this._rightGroup.appendChild(t),this._rightGroup.setDeltaWidth((null!==(i=t.attribute.marginLeft)&&void 0!==i?i:0)+(null!==(o=t.attribute.marginRight)&&void 0!==o?o:0)+t.attribute.width)}addContent(t){const e=this._centerGroup.lastChild;e&&t.setAttributes({x:e.attribute.x+e.AABBBounds.width()}),this._centerGroup.appendChild(t),t instanceof Nh&&(this._centerGroup.setAttribute("pickable",!1),t.setAttribute("textAlign","left"))}layout(){let t=this._leftGroup.width;t===1/0&&(t=0);let e=this._rightGroup.width;if(e===-1/0&&(e=0),this._autoWidth){const i=this._centerGroup.width;this._cellWidth=t+e+i,this.setAttribute("width",this._cellWidth)}else{const i=this._cellWidth-t-e;this.updateCenterLayout(i);const o=this._centerGroup.width;this._cellWidth=t+e+o,this.setAttribute("width",this._cellWidth)}this.updateHorizontalPos();const i=this._leftGroup.height,o=this._rightGroup.height,n=this._centerGroup.height;this._cellHeight=Math.max(i,o,n),this.setAttribute("height",this._cellHeight),this.updateVerticalPos()}updateCenterLayout(t){let e=t;this._centerGroup.forEachChildren((t=>{t instanceof U_&&(e-=t.AABBBounds.width())}));const i=this._centerGroup.getChildByName("text");i instanceof vc?i.setAttribute("width",e):i instanceof Nh&&i.setAttribute("maxLineWidth",e);let o=0;this._centerGroup.forEachChildren((t=>{t.setAttribute("x",o),o+=t.AABBBounds.width()}))}updateHorizontalPos(){this._leftGroup.setAttribute("x",0),this._rightGroup.setAttribute("x",this._cellWidth-this._rightGroup.width),this._centerGroup.setAttribute("x",this._leftGroup.width),"left"===this._align||"start"===this._align?this.setAttribute("dx",0):"center"===this._align?this.setAttribute("dx",-this.attribute.width/2):"right"!==this._align&&"end"!==this._align||this.setAttribute("dx",-this.attribute.width)}updateVerticalPos(){"top"===this._baseline?(this._leftGroup.setAttribute("y",0),this._rightGroup.setAttribute("y",0),this._centerGroup.setAttribute("y",0)):"middle"===this._baseline?(this._leftGroup.forEachChildren((t=>{t.setAttribute("y",(this._leftGroup.height-t.AABBBounds.height())/2)})),this._rightGroup.forEachChildren((t=>{t.setAttribute("y",(this._rightGroup.height-t.AABBBounds.height())/2)})),this._leftGroup.setAttribute("y",this._cellHeight/2-this._leftGroup.height/2),this._rightGroup.setAttribute("y",this._cellHeight/2-this._rightGroup.height/2),this._centerGroup.setAttribute("y",this._cellHeight/2-this._centerGroup.height/2)):"bottom"===this._baseline&&(this._leftGroup.forEachChildren((t=>{t.setAttribute("y",this._leftGroup.height-t.AABBBounds.height())})),this._rightGroup.forEachChildren((t=>{t.setAttribute("y",this._rightGroup.height-t.AABBBounds.height())})),this._leftGroup.setAttribute("y",this._cellHeight-this._leftGroup.height),this._rightGroup.setAttribute("y",this._cellHeight-this._rightGroup.height),this._centerGroup.setAttribute("y",this._cellHeight-this._centerGroup.height))}updateWidth(t){this._cellWidth=t,this._originCellWidth=t,this.layout()}updateHeight(t){this._cellHeight=t,this._cellWidth=this._originCellWidth,this.layout()}}function jS(t,e,i){var o,n,r,s,l;let a=0;const h=i.internalProps.layoutMap;if(h.isHeader(t,e)){const r=h.getHeader(t,e);Q(null==r?void 0:r.hierarchyLevel)&&(a=(null!==(o=r.hierarchyLevel)&&void 0!==o?o:0)*(null!==(n=h.rowHierarchyIndent)&&void 0!==n?n:0),h.rowHierarchyTextStartAlignment&&!i.internalProps.headerHelper.getHierarchyIcon(t,e)&&(a+=i.internalProps.headerHelper.getHierarchyIconWidth()))}else if(i.options.groupBy||(null===(r=i.getBodyColumnDefine(t,e))||void 0===r?void 0:r.tree)){const o=i.dataSource.getIndexKey(i.getRecordShowIndexByCell(t,e)),n=null!==(s=i.dataSource.getGroupLength())&&void 0!==s?s:0;let r=rt(o)?o.length-1:0;n>0&&r===n&&(r=0),a=Array.isArray(o)&&i.getHierarchyState(t,e)!==WC.none?r*(null!==(l=h.hierarchyIndent)&&void 0!==l?l:0):0,h.hierarchyTextStartAlignment&&!i.internalProps.bodyHelper.getHierarchyIcon(t,e)&&(a+=i.internalProps.bodyHelper.getHierarchyIconWidth())}return a}function VS(t,e){var i,o;let n,r=!1;for(nt(t)&&t.length>(e.options.maxCharactersNumber||200)&&(t=t.slice(0,e.options.maxCharactersNumber||200),t+="…",r=!0),n=e.internalProps.enableLineBreak||(null===(i=e.options.customConfig)||void 0===i?void 0:i.multilinesForXTable)?gw(t).replace(/\r?\n/g,"\n").replace(/\r/g,"\n").split("\n")||[]:[gw(t)];n.length&&n.length>1&&!n[n.length-1];)n.pop();if((null===(o=e.options.customConfig)||void 0===o?void 0:o.multilinesForXTable)&&!e.internalProps.autoWrapText)for(;n.length&&n.length>1&&!n[0];)n.shift();return{text:n,moreThanMaxCharacters:r}}function US(t,e,i,o,n,r,s){var l,a,h,d,c,u;const g={};"image"===t.type?g.image=t.src:("svg"===t.type||"svg"in t)&&(g.image=t.svg),g.width=t.width,g.height=t.height,g.visibleTime=null!==(l=t.visibleTime)&&void 0!==l?l:"always",g.funcType=t.funcType,g.interactive=t.interactive;let p=0;if(s&&0!==(null==s?void 0:s.addedHierarchyOffset)||!at(i)||!at(o)||!r||t.funcType!==VC.collapse&&t.funcType!==VC.expand&&t.positionType!==jC.contentLeft&&t.positionType!==jC.contentRight||(p=n?jS(n.start.col,n.start.row,r):jS(i,o,r),s&&(s.addedHierarchyOffset=1)),g.marginLeft=(null!==(a=t.marginLeft)&&void 0!==a?a:0)+p,g.marginRight=null!==(h=t.marginRight)&&void 0!==h?h:0,!1===t.interactive&&(g.pickable=!1),t.hover&&(g.backgroundWidth=null!==(d=t.hover.width)&&void 0!==d?d:t.width,g.backgroundHeight=null!==(c=t.hover.width)&&void 0!==c?c:t.width,g.backgroundColor=null!==(u=t.hover.bgColor)&&void 0!==u?u:"rgba(22,44,66,0.2)",g.hoverImage=t.hover.image),t.cursor&&(g.cursor=t.cursor),"shape"in t&&"circle"===t.shape&&(g.shape=t.shape),e)return e.setAttributes(g),e.loadImage(g.image),e;const f=new U_(g);return f.tooltip=t.tooltip,f}function $S(t){var e,i,o,n,r,s;const l={};return"image"===t.type?l.image=t.src:("svg"===t.type||"svg"in t)&&(l.image=t.svg),l.visibleTime=null!==(e=t.visibleTime)&&void 0!==e?e:"always",l.funcType=t.funcType,l.id=t.name,l.width=t.width,l.height=t.height,(t.marginRight||t.marginLeft)&&(l.margin=[0,null!==(i=t.marginRight)&&void 0!==i?i:0,0,null!==(o=t.marginLeft)&&void 0!==o?o:0]),t.hover&&(l.backgroundWidth=null!==(n=t.hover.width)&&void 0!==n?n:t.width,l.backgroundHeight=null!==(r=t.hover.height)&&void 0!==r?r:t.height,l.backgroundShowMode="hover",l.hoverImage=t.hover.image,l.backgroundStroke=!1,l.backgroundFill=null!==(s=t.hover.bgColor)&&void 0!==s?s:"rgba(22,44,66,0.2)"),t.cursor&&(l.cursor=t.cursor),l.tooltip=t.tooltip,l}function XS(t,e,i,o,n,r,s,l,a){var h,d,c,u;ht(t.contentWidth)&&(o=e-(null!==(h=t.contentWidth)&&void 0!==h?h:t.attribute.width));let g,p=0,f=0,v=0,m=0;t.forEachChildren((t=>{var e,i,o,n;"icon-left"===t.role?(p+=t.AABBBounds.width()+(null!==(e=t.attribute.marginLeft)&&void 0!==e?e:0)+(null!==(i=t.attribute.marginRight)&&void 0!==i?i:0),f=Math.max(f,t.AABBBounds.height())):"icon-right"===t.role&&(v+=t.AABBBounds.width()+(null!==(o=t.attribute.marginLeft)&&void 0!==o?o:0)+(null!==(n=t.attribute.marginRight)&&void 0!==n?n:0),m=Math.max(m,t.AABBBounds.height()))}));const b=t.getChildByName("text"),y=t.getChildByName("content");let C;b instanceof Nh?(g=b.AABBBounds.height(),b.setAttribute("maxLineWidth",e-p-v-(r[1]+r[3])-(null!==(d=b.attribute.dx)&&void 0!==d?d:0)-(null!==(c=a.table.theme._contentOffset)&&void 0!==c?c:0)),C=b.AABBBounds.height()):b instanceof vc?(g=b.AABBBounds.height(),b.setAttribute("width",e-p-v-(r[1]+r[3])),C=b.AABBBounds.height()):y&&(g=y.AABBBounds.height(),y.updateWidth(e-p-v-(r[1]+r[3])),C=y.AABBBounds.height());const w=Math.round(Math.max(f,m,g)+r[0]+r[2]);if(t.forEachChildren((i=>{var n;if("icon-left"===i.role);else if("icon-right"===i.role)i.setAttribute("x",i.attribute.x+o);else if("icon-absolute-right"===i.role)i.setAttribute("x",i.attribute.x+o);else if("content"===i.name||"text"===i.name&&"richtext"!==i.type){const t=null!==(n=i.attribute.textAlign)&&void 0!==n?n:s;"center"===t?i.setAttribute("x",r[3]+p+(e-(r[1]+r[3])-p-v)/2):"right"===t&&i.setAttribute("x",r[3]+e-(r[1]+r[3])-v)}else"mark"===i.name&&i.setAttribute("x",t.attribute.width)})),n){let e=Math.max(f,C,m);if(function(t,e,i,o){const n=t.table,r=Mx(n,e.col,e.row);if(r&&r.end.row-r.start.row){o/=r.end.row-r.start.row+1,i/=r.end.row-r.start.row+1;for(let t=r.start.row;t<=r.end.row;t++){const e=n.getRowHeight(t);if(e===o&&i!==e)return!0;if(i>e)return!0}}else{const t=n.getRowHeight(e.row);if(t===o&&i!==t)return!0;if(i>t)return!0}return!1}(a,t,Math.round(e+r[0]+r[2]),w))return!0;e=(null!==(u=t.contentHeight)&&void 0!==u?u:i)-(r[0]+r[2]),t.forEachChildren((t=>{"rect"!==t.type&&"chart"!==t.type&&t.name!==Q_&&("mark"===t.name?t.setAttribute("y",0):"middle"===l?t.setAttribute("y",r[0]+(e-t.AABBBounds.height())/2):"bottom"===l?t.setAttribute("y",r[0]+e-t.AABBBounds.height()):t.setAttribute("y",r[0]))}))}else"middle"!==l&&"bottom"!==l||t.forEachChildren((t=>{"rect"!==t.type&&"chart"!==t.type&&t.name!==Q_&&("mark"===t.name?t.setAttribute("y",0):"middle"===l?t.setAttribute("y",(i-r[2]+r[0]-t.AABBBounds.height())/2):"bottom"===l?t.setAttribute("y",i-t.AABBBounds.height()-r[2]):t.setAttribute("y",r[0]))}));return!1}function YS(t,e,i,o,n,r,s){const l=e-Math.floor(n[0]+n[2]),a=t.getChildByName("text");a instanceof Nh&&!o?a.setAttributes({heightLimit:l}):a instanceof vc&&!o?a.setAttributes({height:l}):t.getChildByName("content")&&t.getChildByName("content").updateHeight(l),t.forEachChildren((t=>{t.setAttribute("dy",0),"rect"===t.type||"chart"===t.type||t.name===Q_||("mark"===t.name?t.setAttribute("y",0):"middle"===s?t.setAttribute("y",n[0]+(l-t.AABBBounds.height())/2):"bottom"===s?t.setAttribute("y",n[0]+l-t.AABBBounds.height()):t.setAttribute("y",n[0]))}))}function KS(t,e,i,o){const n=[],r=[],s=[],l=[],a=[],h=[],d=[],c=[];let u=0,g=0,p=0,f=0,v=0,m=0;return t.forEach((t=>{switch(t.positionType){case jC.left:n.push(t);break;case jC.right:r.push(t);break;case jC.contentLeft:s.push(t);break;case jC.contentRight:l.push(t);break;case jC.absoluteRight:c.push(t);break;case jC.inlineFront:a.push(t);break;case jC.inlineEnd:h.push(t)}})),n.forEach((t=>{var n,r,s;const l=US(t,void 0,e.col,e.row,i,o);l.role="icon-left",l.name=t.name,l.setAttribute("x",u+(null!==(n=l.attribute.marginLeft)&&void 0!==n?n:0)),u+=l.AABBBounds.width()+(null!==(r=l.attribute.marginLeft)&&void 0!==r?r:0)+(null!==(s=l.attribute.marginRight)&&void 0!==s?s:0),g=Math.max(g,l.AABBBounds.height()),e.appendChild(l)})),r.forEach((t=>{var n,r,s;const l=US(t,void 0,e.col,e.row,i,o);l.role="icon-right",l.name=t.name,l.setAttribute("x",p+(null!==(n=l.attribute.marginLeft)&&void 0!==n?n:0)),p+=l.AABBBounds.width()+(null!==(r=l.attribute.marginLeft)&&void 0!==r?r:0)+(null!==(s=l.attribute.marginRight)&&void 0!==s?s:0),f=Math.max(f,l.AABBBounds.height()),e.appendChild(l)})),d.forEach((t=>{var n,r,s;const l=US(t,void 0,e.col,e.row,i,o);l.role="icon-absolute-left",l.name=t.name,l.setAttribute("x",v+(null!==(n=l.attribute.marginLeft)&&void 0!==n?n:0)),v+=l.AABBBounds.width()+(null!==(r=l.attribute.marginLeft)&&void 0!==r?r:0)+(null!==(s=l.attribute.marginRight)&&void 0!==s?s:0),e.appendChild(l)})),c.forEach((t=>{var n,r,s;const l=US(t,void 0,e.col,e.row,i,o);l.role="icon-absolute-right",l.name=t.name,l.setAttribute("x",m+(null!==(n=l.attribute.marginLeft)&&void 0!==n?n:0)),m+=l.AABBBounds.width()+(null!==(r=l.attribute.marginLeft)&&void 0!==r?r:0)+(null!==(s=l.attribute.marginRight)&&void 0!==s?s:0),e.appendChild(l)})),{leftIcons:n,rightIcons:r,contentLeftIcons:s,contentRightIcons:l,inlineFrontIcons:a,inlineEndIcons:h,absoluteLeftIcons:d,absoluteRightIcons:c,leftIconWidth:u,leftIconHeight:g,rightIconWidth:p,rightIconHeight:f,absoluteLeftIconWidth:v,absoluteRightIconWidth:m}}function qS(t,e){if(t.hasOwnProperty("hoverIconId")){const e=this;if(e.skipMergeUpdate)return;const i=K_(e);if(!i||!i.stage)return;const o=i.stage.table;e.skipAttributeUpdate=!0;const{mergeStartCol:n,mergeEndCol:r,mergeStartRow:s,mergeEndRow:l}=i;if(Q(n)&&Q(r)&&Q(s)&&Q(l)&&(n!==r||s!==l)){for(let a=n;a<=r;a++)for(let n=s;n<=l;n++){if(a===i.col&&n===i.row){if(t.hoverIconId!==e.attribute.hoverIconId){const i=e._frameCache.icons.get(t.hoverIconId);e.updateHoverIconState(i)}continue}const r=o.scenegraph.highPerformanceGetCell(a,n);if("cell"===r.role){const i=r.getChildByName(e.name,!0);if(!i||i.skipAttributeUpdate)continue;t.hoverIconId!==i.attribute.hoverIconId&&(i.setAttribute("hoverIconId",t.hoverIconId),r.addUpdateBoundTag())}}e.skipAttributeUpdate=void 0}}}function ZS(t,e,i,o,n,r,s,l,a,h,d,c,u,g,p,f,v){var m,b,y,C,w,x,_,S,A,B,R,M,T,k,L,P,E,H,F,z,I,O,D,W,N,G,j,V,U,$;const X=WS("padding",g._getCellStyle(o,n),o,n,g);(null===(m=g.options.customConfig)||void 0===m?void 0:m.imageMargin)?h=r_(null===(b=g.options.customConfig)||void 0===b?void 0:b.imageMargin):Q(X)&&(h=X),(null===(y=null==p?void 0:p.text)||void 0===y?void 0:y.textAlign)&&(d=null===(C=null==p?void 0:p.text)||void 0===C?void 0:C.textAlign),(null===(w=null==p?void 0:p.text)||void 0===w?void 0:w.textBaseline)&&(c=null===(x=null==p?void 0:p.text)||void 0===x?void 0:x.textBaseline);const Y=NS(o,n,p,g);let K,q;if(v&&(K=g.scenegraph.highPerformanceGetCell(o,n,!0),K&&"cell"===K.role&&K.setAttributes({x:e,y:i,width:r,height:s,lineWidth:null!==(S=null===(_=null==p?void 0:p.group)||void 0===_?void 0:_.lineWidth)&&void 0!==S?S:void 0,fill:null!==(B=null===(A=null==p?void 0:p.group)||void 0===A?void 0:A.fill)&&void 0!==B?B:void 0,stroke:null!==(M=null===(R=null==p?void 0:p.group)||void 0===R?void 0:R.stroke)&&void 0!==M?M:void 0,strokeArrayWidth:null!=Y?Y:void 0,strokeArrayColor:null!==(k=null===(T=null==p?void 0:p.group)||void 0===T?void 0:T.strokeArrayColor)&&void 0!==k?k:void 0,cursor:null!==(P=null===(L=null==p?void 0:p.group)||void 0===L?void 0:L.cursor)&&void 0!==P?P:void 0,lineDash:null!==(H=null===(E=null==p?void 0:p.group)||void 0===E?void 0:E.lineDash)&&void 0!==H?H:void 0,lineCap:"butt",clip:!0,cornerRadius:p.group.cornerRadius})),K&&"cell"===K.role||(K=new zS({x:e,y:i,width:r,height:s,lineWidth:null!==(z=null===(F=null==p?void 0:p.group)||void 0===F?void 0:F.lineWidth)&&void 0!==z?z:void 0,fill:null!==(O=null===(I=null==p?void 0:p.group)||void 0===I?void 0:I.fill)&&void 0!==O?O:void 0,stroke:null!==(W=null===(D=null==p?void 0:p.group)||void 0===D?void 0:D.stroke)&&void 0!==W?W:void 0,strokeArrayWidth:null!=Y?Y:void 0,strokeArrayColor:null!==(G=null===(N=null==p?void 0:p.group)||void 0===N?void 0:N.strokeArrayColor)&&void 0!==G?G:void 0,cursor:null!==(V=null===(j=null==p?void 0:p.group)||void 0===j?void 0:j.cursor)&&void 0!==V?V:void 0,lineDash:null!==($=null===(U=null==p?void 0:p.group)||void 0===U?void 0:U.lineDash)&&void 0!==$?$:void 0,lineCap:"butt",clip:!0,cornerRadius:p.group.cornerRadius}),K.role="cell",K.col=o,K.row=n,null==t||t.addCellGroup(K)),u){let t=o,e=n;f&&(t=f.start.col,e=f.start.row),q=g.getCellIcons(t,e)}let Z=0,J=0,tt=0;if(Array.isArray(q)&&0!==q.length){const{leftIconWidth:t,rightIconWidth:e,absoluteLeftIconWidth:i,absoluteRightIconWidth:o}=KS(q,K,f,g);Z=t+e,J=t,tt=e,K.forEachChildren((t=>{"icon-left"===t.role?t.setAttribute("x",t.attribute.x+h[3]):"icon-right"===t.role?t.setAttribute("x",t.attribute.x+r-e-h[1]):"icon-absolute-right"===t.role&&t.setAttribute("x",t.attribute.x+r-o-h[1])})),K.forEachChildren((t=>{"middle"===c?t.setAttribute("y",(s-t.AABBBounds.height())/2):"bottom"===c?t.setAttribute("y",s-t.AABBBounds.height()-h[2]):t.setAttribute("y",h[0])})),K._cellLeftIconWidth=J,K._cellRightIconWidth=tt}const et=g.getCellValue(o,n),it=cc({x:h[3],y:h[0],width:r-h[1]-h[3]-Z,height:s-h[0]-h[2],image:et,cursor:"pointer"});return it.name="image",it.keepAspectRatio=l,it.textAlign=d,it.textBaseline=c,l||a?it.resources&&it.resources.has(it.attribute.image)&&"success"===it.resources.get(it.attribute.image).state?setTimeout((()=>{iA(a,l,h,d,c,it,K,g)}),0):it.successCallback=()=>{iA(a,l,h,d,c,it,K,g),g.scenegraph.updateNextFrame()}:it.resources&&it.resources.has(it.attribute.image)&&"success"===it.resources.get(it.attribute.image).state?QS(K,o,n,0,0,g):it.successCallback=()=>{QS(K,o,n,0,0,g)},it.failCallback=()=>{const t=FS();it.image=t.damage_pic.svg},K.appendChild(it),K}function JS(t,e,i,o,n,r,s){let l=!1,a=null,h=null;const{width:d,height:c,isMerge:u}=tA(s,n.table);if(d<i+r[1]+r[3]&&(a=i+r[1]+r[3],l=!0),c<o+r[2]+r[0]&&(h=o+r[2]+r[0],l=!0),l){if("number"==typeof a)if(u)for(let t=s.mergeStartCol;t<=s.mergeEndCol;t++)n.setColWidth(t,a/(s.mergeEndCol-s.mergeStartCol+1));else n.setColWidth(t,a);if("number"==typeof h)if(u)for(let t=s.mergeStartRow;t<=s.mergeEndRow;t++)n.setRowHeight(t,h/(s.mergeEndRow-s.mergeStartRow+1));else n.setRowHeight(e,h);return n.component.updateScrollBar(),!0}return!1}function QS(t,e,i,o,n,r){var s,l,a,h,d,c,u,g,p,f,v,m;const b=t.getChildByName("image");if(!b)return;const y="string"!=typeof b.attribute.image&&b.attribute.image||(null===(s=b.resources)||void 0===s?void 0:s.get(b.attribute.image).data);if(!y)return;const C=r._getCellStyle(e,i),w=null!==(l=DS("textAlign",C,e,i,r))&&void 0!==l?l:"left",x=null!==(a=DS("textBaseline",C,e,i,r))&&void 0!==a?a:"middle";let _;_=(null===(h=r.options.customConfig)||void 0===h?void 0:h.imageMargin)?r_(null===(d=r.options.customConfig)||void 0===d?void 0:d.imageMargin):null!==(c=r_(DS("padding",C,e,i,r)))&&void 0!==c?c:[0,0,0,0];const{width:S,height:A,isMerge:B}=tA(t,r),R=null!==(u=t.mergeStartCol)&&void 0!==u?u:t.col,M=null!==(g=t.mergeStartRow)&&void 0!==g?g:t.row,T=null!==(p=t.mergeEndCol)&&void 0!==p?p:t.col,k=null!==(f=t.mergeEndCol)&&void 0!==f?f:t.row,L=null!==(v=t._cellLeftIconWidth)&&void 0!==v?v:0,P=null!==(m=t._cellRightIconWidth)&&void 0!==m?m:0;if(b.keepAspectRatio){const{width:t,height:e}=IS(y.width||y.videoWidth,y.height||y.videoHeight,S-(_[1]+_[3]),A-(_[0]+_[2])),i=OS(0,0,S,A,t,e,w,x,_);for(let o=R;o<=T;o++)for(let n=M;n<=k;n++){const s=r.scenegraph.getCell(o,n).getChildByName("image");null==s||s.setAttributes({x:i.x,y:i.y,width:t,height:e})}}else for(let t=R;t<=T;t++)for(let e=M;e<=k;e++){const i=r.scenegraph.getCell(t,e).getChildByName("image");null==i||i.setAttributes({x:L+_[3],y:_[0],width:S-_[1]-_[3]-P-L,height:A-_[0]-_[2]})}if(t.getChildByName("play-icon")){const e=0,i=0,{width:o,height:n}=tA(t,r),s=Math.floor(Math.min(o-_[1]-_[3],n-_[2]-_[0])/2),l=e+(o>b.attribute.width?b.attribute.x-e+b.attribute.width/2:o/2),a=i+(n>b.attribute.height?b.attribute.y-i+b.attribute.height/2:n/2);for(let t=R;t<=T;t++)for(let e=M;e<=k;e++)r.scenegraph.getCell(t,e).getChildByName("play-icon").setAttributes({x:l-s/2,y:a-s/2,width:s,height:s})}t.forEachChildren((t=>{"icon-left"===t.role||("icon-right"===t.role||"icon-absolute-right"===t.role)&&t.setAttribute("x",t.attribute.x+o)})),t.forEachChildren((t=>{("rect"===t.type||t.role&&t.role.startsWith("icon"))&&("middle"===x?t.setAttribute("y",_[0]+(A-_[0]-_[2]-t.AABBBounds.height())/2):"bottom"===x?t.setAttribute("y",_[0]+A-_[0]-_[2]-t.AABBBounds.height()):t.setAttribute("y",_[0]))})),B&&eA(t.mergeStartCol,t.mergeEndCol,t.mergeStartRow,t.mergeEndRow,r)}function tA(t,e){return"cell"===t.role&&Q(t.mergeStartCol)&&Q(t.mergeEndCol)&&Q(t.mergeStartRow)&&Q(t.mergeEndRow)?{width:e.getColsWidth(t.mergeStartCol,t.mergeEndCol),height:e.getRowsHeight(t.mergeStartRow,t.mergeEndRow),isMerge:!0}:{width:t.attribute.width,height:t.attribute.height,isMerge:!1}}function eA(t,e,i,o,n){for(let r=t;r<=e;r++)for(let t=i;t<=o;t++){const e=n.scenegraph.getCell(r,t);if(e){const i=e.getChildByName("image");i&&i.setAttributes({dx:-n.getColsWidth(e.mergeStartCol,r-1),dy:-n.getRowsHeight(e.mergeStartRow,t-1)});const o=e.getChildByName("play-icon");o&&o.setAttributes({dx:-n.getColsWidth(e.mergeStartCol,r-1),dy:-n.getRowsHeight(e.mergeStartRow,t-1)})}}}function iA(t,e,i,o,n,r,s,l){const a=r.resources.get(r.attribute.image).data,{col:h,row:d}=s;if(t&&!oA(r)&&JS(h,d,a.width,a.height,l.scenegraph,i,s),e||oA(r)){const{width:t,height:e,isMerge:h}=tA(s,l),{width:d,height:c}=IS(a.width,a.height,t-i[1]-i[3],e-i[0]-i[2]),u=OS(0,0,t,e,d,c,o,n,i);r.setAttributes({x:u.x,y:u.y,width:d,height:c}),h&&eA(s.mergeStartCol,s.mergeEndCol,s.mergeStartRow,s.mergeEndRow,l)}}function oA(t){const e=FS();return t.attribute.image===e.damage_pic.svg}function nA(t,e,i){t.then((()=>{i(),e.scenegraph.updateNextFrame()})).catch((t=>{}))}function rA(t,e,i,o,n,r,s,l,a,h,d,c,u,g,p,f,v,m){var b,y;let C,w=!1;if(Fw(e)){if("cell"!==o.scenegraph.highPerformanceGetCell(n,r).role)return C;e=o.getCellValue(n,r),w=!0}if("text"===t||"link"===t||m){if("link"===t){const s=e,l=o._getCellStyle(n,r);"link"===t&&("templateLink"in i&&i.templateLink||!("linkDetect"in i)||!i.linkDetect||hx.test(s))&&(f?(f.text.fill=DS("linkColor",l,n,r,o),f.group.cursor="pointer"):f={text:{fill:DS("linkColor",l,n,r,o)},group:{cursor:"pointer"}})}let y,x=!0;if(m)y=m.elementsGroup,x=m.renderDefault;else{let t,e;if("body"!==o.getCellLocation(n,r)?(t=null==i?void 0:i.headerCustomRender,e=null==i?void 0:i.headerCustomLayout):(t=(null==i?void 0:i.customRender)||o.customRender,e=null==i?void 0:i.customLayout),e||t){const i=eS(e,t,n,r,l,a,!1,o.isAutoRowHeight(r),c,v,o);y=i.elementsGroup,x=i.renderDefault}}C=Tx.getFunction("createTextCellGroup")(o,e,h,0,d,n,r,s,l,a,c,u,g,p,y,x,f,v,w);const _=o.internalProps.layoutMap.getAxisConfigInPivotChart(n,r);if(_){const t=new(Tx.getComponent("axis"))(_,C.attribute.width,C.attribute.height,null!==(b=_.__vtablePadding)&&void 0!==b?b:c,o);C.clear(),C.appendChild(t.component),t.overlap()}else o.internalProps.layoutMap.isEmpty(n,r)?(C.setAttributes({fill:!1,stroke:!1}),C.clear()):o.internalProps.layoutMap.isAxisCell(n,r)&&C.clear()}else if("image"===t)C=Tx.getFunction("createImageCellGroup")(h,0,d,n,r,l,a,i.keepAspectRatio,i.imageAutoSizing,c,u,g,p,o,f,v,w);else if("video"===t)C=Tx.getFunction("createVideoCellGroup")(h,0,d,n,r,l,a,i.keepAspectRatio,i.imageAutoSizing,c,u,g,p,o,f,v,w);else if("chart"===t){const t=o.internalProps.layoutMap.getChartInstance(n,r);C=Tx.getFunction("createChartCellGroup")(null,h,0,d,n,r,l,a,c,e,i.chartModule,o.internalProps.layoutMap.getChartSpec(n,r),t,null!==(y=o.internalProps.layoutMap.getChartDataId(n,r))&&void 0!==y?y:"data",o,f,o.internalProps.layoutMap.isShareChartSpec(n,r),w)}else if("progressbar"===t){const t=o._getCellStyle(n,r),p=o.getCellOriginValue(n,r);C=Tx.getFunction("createTextCellGroup")(o,e,h,0,d,n,r,s,l,a,c,u,g,!1,null,!0,f,v,w);const m=Tx.getFunction("createProgressBarCell")(i,t,s,e,p,n,r,c,o,v);C.firstChild?C.insertBefore(m,C.firstChild):C.appendChild(m)}else"sparkline"===t?C=Tx.getFunction("createSparkLineCellGroup")(null,h,0,d,n,r,l,a,c,o,f,w):"checkbox"===t?C=Tx.getFunction("createCheckboxCellGroup")(null,h,0,d,n,r,s,l,a,c,u,g,p,o,f,i,v,w):"radio"===t&&(C=Tx.getFunction("createRadioCellGroup")(null,h,0,d,n,r,s,l,a,c,u,g,o,f,i));return C}function sA(t,e,i,o,n){var r,s,l,a,h,d,c,u,g,p,f,v,m,b,y,C;const w=i.scenegraph.highPerformanceGetCell(t,e,!0),x=i.getCellLocation(t,e);let _,S,A,B,R=i.getCellValue(t,e),M=!1;if(i.internalProps.customMergeCell){const o=i.getCustomMerge(t,e);if(o){const{range:t,text:n,style:r,customLayout:s,customRender:l}=o;S=t,_=S.start.col!==S.end.col||S.start.row!==S.end.row,R=n,A=r,(s||l)&&(B=eS(s,l,t.start.col,t.start.row,i.getColsWidth(t.start.col,t.end.col),i.getRowsHeight(t.start.row,t.end.row),!1,i.isAutoRowHeight(e),[0,0,0,0],S,i)),M=!0}}let T=t,k=e;S&&(T=S.start.col,k=S.start.row);const L="body"!==x?i.getHeaderDefine(T,k):i.getBodyColumnDefine(T,k);let P="body"!==x||(null==L?void 0:L.dragOrder)||!!(null==L?void 0:L.icon)||!!(null==L?void 0:L.tree);S||!i.internalProps.enableTreeNodeMerge&&"body"===x&&!(null==L?void 0:L.mergeCell)||(S=i.getCellRange(t,e),_=S.start.col!==S.end.col||S.start.row!==S.end.row);let E=!1;if(i.internalProps.enableTreeNodeMerge&&_){const t=i.getCellRawRecord(S.start.col,S.start.row),{vtableMergeName:o,vtableMerge:n}=null!=t?t:{};E=n,n&&(P=!0,i.options.groupTitleCustomLayout&&(B=eS(i.options.groupTitleCustomLayout,void 0,S.start.col,S.start.row,i.getColsWidth(S.start.col,S.end.col),i.getRowsHeight(S.start.row,S.end.row),!1,i.isAutoRowHeight(e),[0,0,0,0],S,i))),o&&(R=o)}const H=A||i._getCellStyle(S?S.start.col:t,S?S.start.row:e),F=null!==(r=H.autoWrapText)&&void 0!==r?r:i.internalProps.autoWrapText,z=G_(H,i,_?S.start.col:t,_?S.start.row:e,DS).theme;if(z.group.cornerRadius=j_(t,e,i),!o&&!_&&!((null==L?void 0:L.customLayout)||(null==L?void 0:L.customRender)||(null==L?void 0:L.headerCustomLayout)||(null==L?void 0:L.headerCustomRender))&&function(t,e,i,o,n,r){var s;const l=r.getBodyColumnType(t,e),a=r.isAutoRowHeight(e),h=r.getCellValue(t,e);return!(r.isHeader(t,e)||"cell"!==i.role||"text"!==l||o||a||n||"text"!==(null===(s=i.firstChild)||void 0===s?void 0:s.type)||Fw(h))}(t,e,w,F,P,i)){const o=i.getColWidth(t),n=i.getRowHeight(e);w.setAttributes({width:o,height:n,lineWidth:null!==(l=null===(s=null==z?void 0:z.group)||void 0===s?void 0:s.lineWidth)&&void 0!==l?l:void 0,fill:null!==(h=null===(a=null==z?void 0:z.group)||void 0===a?void 0:a.fill)&&void 0!==h?h:void 0,stroke:null!==(c=null===(d=null==z?void 0:z.group)||void 0===d?void 0:d.stroke)&&void 0!==c?c:void 0,strokeArrayWidth:null!==(g=null===(u=null==z?void 0:z.group)||void 0===u?void 0:u.strokeArrayWidth)&&void 0!==g?g:void 0,strokeArrayColor:null!==(f=null===(p=null==z?void 0:z.group)||void 0===p?void 0:p.strokeArrayColor)&&void 0!==f?f:void 0,cursor:null!==(m=null===(v=null==z?void 0:z.group)||void 0===v?void 0:v.cursor)&&void 0!==m?m:void 0,cornerRadius:null!==(y=null===(b=null==z?void 0:z.group)||void 0===b?void 0:b.cornerRadius)&&void 0!==y?y:0,y:i.scenegraph.getCellGroupY(e)}),w.forEachChildren((t=>{t.setAttributes({dx:0,dy:0})}));const r=w.getChildByName("text");if(r){const s=i.getCellValue(t,e),{text:l,moreThanMaxCharacters:a}=VS(s,i),h=jS(t,e,i),d=H.lineClamp,c=null!==(C=r_(DS("padding",H,t,e,i)))&&void 0!==C?C:[0,0,0,0],u=z.text.textAlign;let g=0;g="center"===u?c[3]+(o-(c[1]+c[3]))/2:"right"===u?c[3]+o-(c[1]+c[3]):c[3];const p={text:1!==l.length||F?l:l[0],moreThanMaxCharacters:a,maxLineWidth:o-(c[1]+c[3]+h),textBaseline:"top",autoWrapText:F,lineClamp:d,wordBreak:"break-word",heightLimit:n-Math.floor(c[0]+c[2]),pickable:!1,dx:"left"===u?h:0,x:g};if(r.setAttributes(z.text?Object.assign({},z.text,p):p),r.attribute.text){const t=z.text.textBaseline,e=n-(c[0]+c[2]);let i=0;i="middle"===t?c[0]+(e-r.AABBBounds.height())/2:"bottom"===t?c[0]+e-r.AABBBounds.height():c[0],r.setAttributes({y:i})}}return w}if(!o&&"empty"===w.role)return;const I=E||M?"text":i.isHeader(t,e)?i._getHeaderLayoutMap(t,e).headerType:i.getBodyColumnType(t,e),O=z._vtable.padding,D=z.text.textAlign,W=z.text.textBaseline;let N,G,j;if(S?(G=i.getColsWidth(S.start.col,S.end.col),j=i.getRowsHeight(S.start.row,S.end.row)):(G=i.getColWidth(t),j=i.getRowHeight(e)),Fw(R)?(w.removeAllChild(),nA(R,i,aA.bind(null,{type:I,value:R,define:L,table:i,col:t,row:e,cellWidth:G,cellHeight:j,oldCellGroup:w,padding:O,textAlign:D,textBaseline:W,mayHaveIcon:P,addNew:o,range:S,customResult:B,customStyle:A}))):N=lA(I,R,L,i,t,e,G,j,w,O,D,W,P,o,z,S,B),_){const{width:t}=N.attribute,{height:e}=N.attribute;N.contentWidth=t,N.contentHeight=e,n?function(t,e,i,o,n,r,s,l){const{col:a,row:h}=l;t.start.row!==t.end.row&&l.contentHeight!==i&&YS(l,i,0,s.isAutoRowHeight(h),o,0,r),t.start.col!==t.end.col&&l.contentWidth!==e&&XS(l,e,i,0,s.isAutoRowHeight(h),o,n,r,s.scenegraph),l.contentWidth=e,l.contentHeight=i;const d=s.getRowHeight(h);dA(l,s.getColWidth(a),d,t,s)}(S,G,j,O,D,W,i,N):hA(S,G,j,O,D,W,i)}return N}function lA(t,e,i,o,n,r,s,l,a,h,d,c,u,g,p,f,v){var m,b;if(Fw(e)&&(e=o.getCellValue(n,r)),!g&&(a.row!==r||a.col!==n))return null;if(!g&&a.parent&&o.reactCustomLayout){const t=a.getChildByName("custom-container");if(t){const{col:e,row:i}=t;o.reactCustomLayout.removeCustomCell(e,i)}}const y=rA(t,e,i,o,n,r,o.getColWidth(n),s,l,g?o.scenegraph.getColGroup(n):a.parent,g?0:o.scenegraph.getCellGroupY(r),h,d,c,u,p,f,v);return!g&&a.parent&&(a.parent.insertAfter(y,a),a.parent.removeChild(a),(null===(m=o.scenegraph)||void 0===m?void 0:m.proxy.cellCache.get(n))&&(null===(b=o.scenegraph)||void 0===b||b.proxy.cellCache.set(n,y))),y}function aA(t){const{type:e,value:i,define:o,table:n,col:r,row:s,cellWidth:l,cellHeight:a,oldCellGroup:h,padding:d,textAlign:c,textBaseline:u,mayHaveIcon:g,addNew:p,range:f,customResult:v,customStyle:m}=t,b=G_(m||n._getCellStyle(f?f.start.col:r,f?f.start.row:s),n,f?f.start.col:r,f?f.start.row:s,DS).theme;b.group.cornerRadius=j_(r,s,n),lA(e,i,o,n,r,s,l,a,h,d,c,u,g,p,b,f,v)}function hA(t,e,i,o,n,r,s){for(let l=t.start.col;l<=t.end.col;l++)for(let a=t.start.row;a<=t.end.row;a++){const h=s.scenegraph.highPerformanceGetCell(l,a,!0);if("cell"!==h.role)continue;t.start.row!==t.end.row&&h.contentHeight!==i&&YS(h,i,0,s.isAutoRowHeight(a),o,0,r),t.start.col!==t.end.col&&h.contentWidth!==e&&XS(h,e,i,0,s.isAutoRowHeight(a),o,n,r,s.scenegraph),h.contentWidth=e,h.contentHeight=i;const d=s.getRowHeight(a);dA(h,s.getColWidth(l),d,t,s)}}function dA(t,e,i,o,n){var r;const{col:s,row:l}=t,a=-n.getColsWidth(o.start.col,s-1),h=-n.getRowsHeight(o.start.row,l-1);t.forEachChildren((t=>{var e,i,o,n,r,s;"number"==typeof t._dx?(t.skipMergeUpdate=!0,t.setAttributes({dx:(null!==(e=t._dx)&&void 0!==e?e:0)+a}),t.skipMergeUpdate=!1):(t.skipMergeUpdate=!0,t._dx=null!==(i=t.attribute.dx)&&void 0!==i?i:0,t.setAttributes({dx:(null!==(o=t.attribute.dx)&&void 0!==o?o:0)+a}),t.skipMergeUpdate=!1),"number"==typeof t._dy?(t.skipMergeUpdate=!0,t.setAttributes({dy:(null!==(n=t._dy)&&void 0!==n?n:0)+h}),t.skipMergeUpdate=!1):(t._dy=null!==(r=t.attribute.dy)&&void 0!==r?r:0,t.skipMergeUpdate=!0,t.setAttributes({dy:(null!==(s=t.attribute.dy)&&void 0!==s?s:0)+h}),t.skipMergeUpdate=!1)}));const d=null!==(r=t.attribute.strokeArrayWidth)&&void 0!==r?r:t.attribute.lineWidth,c=rt(d),u=[0,0,0,0];s===o.start.col&&(u[3]=c?d[3]:d),l===o.start.row&&(u[0]=c?d[0]:d),s===o.end.col&&(u[1]=c?d[1]:d),l===o.end.row&&(u[2]=c?d[2]:d);const g=e!==t.attribute.width,p=i!==t.attribute.height;return t.skipMergeUpdate=!0,t.setAttributes({width:e,height:i,strokeArrayWidth:u}),t.skipMergeUpdate=!1,t.mergeStartCol=o.start.col,t.mergeStartRow=o.start.row,t.mergeEndCol=o.end.col,t.mergeEndRow=o.end.row,{widthChange:g,heightChange:p}}function cA(t,e,i,o){if(o.internalProps.customMergeCell){const n=o.getCustomMerge(t,e);if(n){const{range:r,text:s,style:l,customLayout:a,customRender:h}=n;if(a||h){const n=eS(a,h,r.start.col,r.start.row,o.getColsWidth(r.start.col,r.end.col),o.getRowsHeight(r.start.row,r.end.row),!1,o.isAutoRowHeight(e),[0,0,0,0],r,o).elementsGroup;i.childrenCount>0&&n?i.insertBefore(n,i.firstChild):n&&i.appendChild(n);const s=o.getRowHeight(e),l=o.getColWidth(t),{width:d}=i.attribute,{height:c}=i.attribute;return i.contentWidth=d,i.contentHeight=c,dA(i,l,s,r,o),r}}}}function uA(t){return!!("cell"===t.role&&at(t.mergeStartCol)&&at(t.mergeStartRow)&&at(t.mergeEndCol)&&at(t.mergeEndRow))}const gA=new Qy({}),pA=new tC({});function fA(t,e,i,o,n,r,s,l,a,h,d,c,u,g,p){const f=mw(tt(t)?t.text:t).split("\n")||[],v=p.getColsWidth(e,o),m=DS("size",n,e,i,p);let b=DS("outerRadius",n,e,i,p);const y=at(b)?2*b:m;let C=0;if(r){const t=DS("spaceBetweenTextAndIcon",n,e,i,p),o=v-(g[1]+g[3])-s-y-t;at(b)||(b=Math.round(m/2)),pA.setAttributes({text:{maxLineWidth:o,text:f,fontSize:l,fontStyle:a,fontWeight:h,fontFamily:d,lineHeight:c,wordBreak:"break-word",lineClamp:u},circle:{outerRadius:b},spaceBetweenTextAndIcon:t}),pA.render(),C=pA.AABBBounds.height()}else C=Math.max(m,f.length*c);return C}let vA="quick";const mA=new s(((t,e,i,o)=>{i(en)?o(en).to(CA).inSingletonScope():t(en).to(CA).inSingletonScope()}));new s(((t,e,i,o)=>{i(en)?o(en).to(on).inSingletonScope():t(en).to(on).inSingletonScope()}));const bA=new Map;function yA(t,e,i){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"normal";const n=`${t}-${e}-${i}-${o}`,r=bA.get(n);if(r)return r;const s=(l={fontSize:t,fontFamily:i,fontWeight:e,fontStyle:o},new He(Object.assign({defaultFontParams:{fontFamily:xo.fontFamily,fontSize:xo.fontSize},getTextBounds:Pa,specialCharSet:`{}()//&-/: .,@%'"~…=——${He.ALPHABET_CHAR_SET}${He.ALPHABET_CHAR_SET.toUpperCase()}0123456789`},{}),l));var l;return bA.set(n,s),s}class CA extends on{measureTextWidth(t,e){const{fontSize:i,fontFamily:o="Arial,sans-serif",fontWeight:n="normal",fontStyle:r="normal"}=e;return yA(i,n,o,r).measure(t,vA).width}measureText(t,e){const{fontSize:i,fontFamily:o="Arial,sans-serif",fontWeight:n="normal",fontStyle:r="normal"}=e;return yA(i,n,o,r).measure(t,vA)}}const wA=new class{measureText(t,e){const{fontSize:i,fontFamily:o="Arial,sans-serif",fontWeight:n="normal",fontStyle:r="normal"}=e;return yA(i,n,o,r).measure(t,vA)}measureTextWidth(t,e){const{fontSize:i,fontFamily:o="Arial,sans-serif",fontWeight:n="normal",fontStyle:r="normal"}=e;return yA(i,n,o,r).measure(t,vA).width}clipText(t,e,i){if(0===t.length)return{str:"",width:0};let o=this.measureTextWidth(t,e);return o<=i?{str:t,width:o}:(o=this.measureTextWidth(t[0],e),o>i?{str:"",width:0}:this._clipText(t,e,i,0,t.length-1))}_clipText(t,e,i,o,n){const r=Math.floor((o+n)/2),s=t.substring(0,r+1),l=this.measureTextWidth(s,e);let a;if(l>i){if(s.length<=1)return{str:"",width:0};const n=t.substring(0,r);return a=this.measureTextWidth(n,e),a<=i?{str:n,width:a}:this._clipText(t,e,i,o,r)}if(l<i){if(r>=t.length-1)return{str:t,width:this.measureTextWidth(t,e)};const o=t.substring(0,r+2);return a=this.measureTextWidth(o,e),a>=i?{str:s,width:l}:this._clipText(t,e,i,r,n)}return{str:s,width:l}}clipTextWithSuffix(t,e,i,o){if(""===o)return this.clipText(t,e,i);if(0===t.length)return{str:"",width:0};const n=this.measureTextWidth(t,e);if(n<=i)return{str:t,width:n};const r=this.measureTextWidth(o,e);if(r>i)return{str:"",width:0};i-=r;const s=this._clipText(t,e,i,0,t.length-1);return s.str+=o,s.width+=r,s}},xA=new Nh({ignoreBuf:!0});function _A(t){return xA.initAttributes(Object.assign(Object.assign({},t),{ignoreBuf:!0})),xA.AABBBounds}const SA=new vc({width:0,height:0,textConfig:[]});function AA(t,e,i){let o=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],n=arguments.length>4?arguments[4]:void 0;var r,s,l,a,h,d,c,u,g,p,f,v;"undefined"!=typeof window&&window.performance.now();const m=[],b=[];if(n)for(let o=e;o<=i;o++)m[o]=t.getRowHeight(o);const y=t.internalProps.layoutMap;t.isPivotTable()&&(y.enableUseGetBodyCache(),y.enableUseHeaderPathCache()),t.defaultHeaderRowHeight,t.defaultHeaderColWidth;const C="auto"===t.defaultHeaderRowHeight||rt(t.defaultHeaderRowHeight)&&t.defaultHeaderRowHeight.some((t=>"auto"===t)),w="autoHeight"===t.heightMode||"adaptive"===t.heightMode;if(w||C){e=null!=e?e:0,i=null!=i?i:t.rowCount-1,(0===e&&i===t.rowCount-1||o)&&t._clearRowRangeHeightsMap();for(let i=e;i<t.columnHeaderLevelCount;i++){let e=0,o=t.colCount-1;if((t.isPivotTable()&&!t.isPivotChart()||t.isPivotChart()&&!t.internalProps.layoutMap.indicatorsAsCol)&&MA(t,i)&&!Mx(t,t.rowHeaderLevelCount,i)&&(e=0,o=t.rowHeaderLevelCount),w||"auto"===t.getDefaultRowHeight(i)){const n=BA(i,e,o,t);b[i]=Math.round(n),t._setRowHeight(i,n)}}for(let e=t.rowCount-t.bottomFrozenRowCount;e<=i;e++)if(w||"auto"===t.getDefaultRowHeight(e)){const i=BA(e,0,t.colCount-1,t);n?b[e]=Math.round(i):t._setRowHeight(e,i)}if(i<t.columnHeaderLevelCount||!w);else if(t.internalProps.transpose||t.isPivotTable()&&!t.internalProps.layoutMap.indicatorsAsCol||!function(t){var e,i,o;const{layoutMap:n}=t.internalProps,r=t.columnHeaderLevelCount;if((t.internalProps.autoWrapText||t.internalProps.enableLineBreak||t.isPivotChart())&&("autoHeight"===t.options.heightMode||"adaptive"===t.options.heightMode))return!1;for(let s=0;s<t.colCount;s++){const l=n.getBody(s,r);if("radio"===l.cellType)return!1;if("function"==typeof l.style||"function"==typeof l.icon||(null===(e=l.define)||void 0===e?void 0:e.customRender)||(null===(i=l.define)||void 0===i?void 0:i.customLayout)||"function"==typeof(null===(o=l.define)||void 0===o?void 0:o.icon))return!1;const a=t._getCellStyle(s,r);if("function"==typeof a.padding||"function"==typeof a.fontSize||"function"==typeof a.lineHeight||!0===a.autoWrapText)return!1}return!0}(t))if(t.internalProps.transpose||t.isPivotTable()&&!t.internalProps.layoutMap.indicatorsAsCol)for(let o=Math.max(e,t.columnHeaderLevelCount);o<=i;o++){let e;e=RA(t,o)?BA(o,0,t.rowHeaderLevelCount,t):BA(o,0,t.colCount-1,t),n?b[o]=Math.round(e):t._setRowHeight(o,e)}else for(let o=Math.max(e,t.columnHeaderLevelCount);o<=i;o++){const e=BA(o,0,t.colCount-1,t);n?b[o]=Math.round(e):t._setRowHeight(o,e)}else{!function(t,e,i,o,n){if(!o.internalProps.useOneRowHeightFillAll){for(let r=e;r<=i;r++)n?n[r]=t:o._setRowHeight(r,t);o.internalProps.useOneRowHeightFillAll=!0}}(BA(t.columnHeaderLevelCount,0,t.colCount-1,t),t.columnHeaderLevelCount,t.rowCount-1-t.bottomFrozenRowCount,t,n?b:void 0);for(let e=t.rowCount-t.bottomFrozenRowCount;e<=i;e++){const i=BA(e,0,t.colCount-1,t);n?b[e]=Math.round(i):t._setRowHeight(e,i)}}}else if(("adaptive"===t.heightMode||t.autoFillHeight)&&t.clearRowHeightCache(),n)for(let o=e;o<=i;o++)b[o]=t.getRowHeight(o);if((0===e&&i===t.rowCount-1||o)&&t._clearRowRangeHeightsMap(),"adaptive"===t.heightMode){t._clearRowRangeHeightsMap();let e=t.tableNoFrameHeight,i=0,o=t.rowCount;if("only-body"===t.heightAdaptiveMode){const n=t.getRowsHeight(0,t.columnHeaderLevelCount-1),r=t.isPivotChart()?t.getBottomFrozenRowsHeight():0;e=t.tableNoFrameHeight-n-r,i=t.columnHeaderLevelCount,o=t.isPivotChart()?t.rowCount-t.bottomFrozenRowCount:t.rowCount}let l=0;for(let e=i;e<o;e++)l+=n&&null!==(r=b[e])&&void 0!==r?r:t.getRowHeight(e);const a=e/l;for(let r=i;r<o;r++){let l;l=r===o-1?e-(n?b.reduce(((t,e,n)=>n>=i&&n<=o-2?t+e:t),0):t.getRowsHeight(i,o-2)):Math.round((n&&null!==(s=b[r])&&void 0!==s?s:t.getRowHeight(r))*a),n?b[r]=l:t._setRowHeight(r,l,!1)}}else if(t.autoFillHeight){t._clearRowRangeHeightsMap();const e=t.tableNoFrameHeight;let i=0,o=0;for(let e=0;e<t.rowCount;e++){const r=n&&null!==(l=b[e])&&void 0!==l?l:t.getRowHeight(e);(e<t.columnHeaderLevelCount||t.isPivotChart()&&e>=t.rowCount-t.bottomFrozenRowCount)&&(o+=r),i+=r}if(t.scenegraph._dealAutoFillHeightOriginRowsHeight=i,i<e&&i-o>0){const r=t.columnHeaderLevelCount,s=t.isPivotChart()?t.rowCount-t.bottomFrozenRowCount:t.rowCount,l=(e-o)/(i-o);for(let i=r;i<s;i++){let h;h=i===s-1?e-o-(n?b.reduce(((t,e,i)=>i>=r&&i<=s-2?t+e:t),0):t.getRowsHeight(r,s-2)):Math.round((n&&null!==(a=b[i])&&void 0!==a?a:t.getRowHeight(i))*l),n?b[i]=h:t._setRowHeight(i,h,!1)}}}if(n){for(let o=e;o<=i;o++){const e=null!==(h=b[o])&&void 0!==h?h:t.getRowHeight(o);e!==(null!==(d=m[o])&&void 0!==d?d:t.getRowHeight(o))&&t._setRowHeight(o,e)}if("adaptive"===t.heightMode||t.autoFillHeight&&t.getAllRowsHeight()<=t.tableNoFrameHeight){for(let e=0;e<=t.columnHeaderLevelCount-1;e++){const i=t.getRowHeight(e);i!==(null!==(c=m[e])&&void 0!==c?c:t.getRowHeight(e))&&t.scenegraph.updateRowHeight(e,i-(null!==(u=m[e])&&void 0!==u?u:t.getRowHeight(e)),!0)}for(let e=t.rowCount-t.bottomFrozenRowCount;e<=t.rowCount-1;e++){const i=t.getRowHeight(e);i!==(null!==(g=m[e])&&void 0!==g?g:t.getRowHeight(e))&&t.scenegraph.updateRowHeight(e,i-(null!==(p=m[e])&&void 0!==p?p:t.getRowHeight(e)),!0)}}for(let e=t.scenegraph.proxy.rowStart;e<=t.scenegraph.proxy.rowEnd;e++){const i=t.getRowHeight(e);i!==(null!==(f=m[e])&&void 0!==f?f:t.getRowHeight(e))&&t.scenegraph.updateRowHeight(e,i-(null!==(v=m[e])&&void 0!==v?v:t.getRowHeight(e)),!0)}}t.isPivotTable()&&(y.disableUseGetBodyCache(),y.disableUseHeaderPathCache())}function BA(t,e,i,o){var n;let r;if(o.isPivotChart()&&t>=o.columnHeaderLevelCount&&t<o.rowCount-o.bottomFrozenRowCount)if(o.internalProps.layoutMap.indicatorsAsCol){const e=o.internalProps.layoutMap.getOptimunHeightForChart(t);if(e>0)return e}else{const e=o.getDefaultRowHeight(t);if(at(e))return e}for(let s=e;s<=i;s++){const e=TA(s,t,o);if(e&&(r=Q(r)?Math.max(e.height,r):e.height,!e.renderDefault))continue;if(o.isPivotChart()){const e=o.internalProps.layoutMap.getAxisConfigInPivotChart(s,t);if(e){const t=Tx.getFunction("computeAxisComponentHeight")(e,o);if("number"==typeof t){r=Q(r)?Math.max(t,r):t;continue}}}if(o.isPivotChart()&&(o.isLeftFrozenColumn(s)&&o.isBottomFrozenRow(t)||o.isRightFrozenColumn(s)&&o.isBottomFrozenRow(t)))continue;const i=kA(s,t,o.isHeader(s,t)?null===(n=o._getHeaderLayoutMap(s,t))||void 0===n?void 0:n.headerType:o.getBodyColumnType(s,t),o);r=Q(r)?Math.max(i,r):i}if(Q(r))return r;const s=o.getDefaultRowHeight(t);return at(s)?s:o.defaultRowHeight}function RA(t,e){var i,o,n;const{layoutMap:r}=t.internalProps;if((t.internalProps.autoWrapText||t.internalProps.enableLineBreak)&&("autoHeight"===t.options.heightMode||"adaptive"===t.options.heightMode))return!1;const s=r.getBody(t.rowHeaderLevelCount,e);if("function"==typeof s.style||"function"==typeof s.icon||(null===(i=s.define)||void 0===i?void 0:i.customRender)||(null===(o=s.define)||void 0===o?void 0:o.customLayout)||"function"==typeof(null===(n=s.define)||void 0===n?void 0:n.icon))return!1;const l=t._getCellStyle(t.rowHeaderLevelCount,e);return"function"!=typeof l.padding&&"function"!=typeof l.fontSize&&"function"!=typeof l.lineHeight&&!0!==l.autoWrapText}function MA(t,e){var i,o,n;const{layoutMap:r}=t.internalProps;if(t.internalProps.autoWrapText&&("autoHeight"===t.options.heightMode||"adaptive"===t.options.heightMode))return!1;const s=r.getHeader(t.rowHeaderLevelCount,e);if("function"==typeof s.style||"function"==typeof s.icons||(null===(i=s.define)||void 0===i?void 0:i.headerCustomRender)||(null===(o=s.define)||void 0===o?void 0:o.headerCustomLayout)||"function"==typeof(null===(n=s.define)||void 0===n?void 0:n.icon))return!1;const l=t._getCellStyle(t.rowHeaderLevelCount,e);return"function"!=typeof l.padding&&"function"!=typeof l.fontSize&&"function"!=typeof l.lineHeight&&!0!==l.autoWrapText}function TA(t,e,i){var o,n,r,s,l;const a=i.getCustomRender(t,e);let h=i.getCustomLayout(t,e);if(a||h){let d=1,c=0,u=!1,g=!1;if(i.isHeader(t,e)||(null===(o=i.getBodyColumnDefine(t,e))||void 0===o?void 0:o.mergeCell)||i.hasCustomMerge()){const o=i.getCellRange(t,e);d=o.end.row-o.start.row+1}const p={col:t,row:e,dataValue:i.getCellOriginValue(t,e),value:i.getCellValue(t,e)||"",rect:LA(t,e,i),table:i};if("react-custom-layout"===h&&(h=(null===(n=i.reactCustomLayout)||void 0===n?void 0:n.getCustomLayoutFunc(t,e))||$_),Z(h)){const e=h(p);e.rootContainer?(e.rootContainer=nS(e.rootContainer),oS(e.rootContainer,i.getColWidth(t),0),e.rootContainer.setStage(i.scenegraph.stage),c=null!==(r=e.rootContainer.AABBBounds.height())&&void 0!==r?r:0,u=e.renderDefault,g=e.enableCellPadding):(c=0,u=e.renderDefault,g=e.enableCellPadding)}else if("function"==typeof a){const t=a(p);c=null!==(s=null==t?void 0:t.expectedHeight)&&void 0!==s?s:0,u=null==t?void 0:t.renderDefault}else c=null!==(l=null==a?void 0:a.expectedHeight)&&void 0!==l?l:0,u=null==a?void 0:a.renderDefault;if(g){const o=r_(DS("padding",i._getCellStyle(t,e),t,e,i));c+=o[0]+o[2]}return{height:c/d,renderDefault:u}}}function kA(t,e,i,o){var n,r,s;let l=0;const a=o.getCellValue(t,e),h=o._getCellStyle(t,e);let d=0,c=0;const u=[];let g=0;const p=[];let f=0,v=!1;if("body"!==o.getCellLocation(t,e))v=!0;else{const i=o.getBodyColumnDefine(t,e);v=!!(null==i?void 0:i.icon)||!!(null==i?void 0:i.tree)||(null==i?void 0:i.dragOrder)}if(v){const i=o.getCellIcons(t,e);null==i||i.forEach((t=>{var e,i,o,n,r,s,l,a,h,v;t.positionType!==jC.absoluteRight&&t.positionType!==jC.inlineFront&&t.positionType!==jC.inlineEnd?(c+=(null!==(e=t.width)&&void 0!==e?e:0)+(null!==(i=t.marginLeft)&&void 0!==i?i:0)+(null!==(o=t.marginRight)&&void 0!==o?o:0),d=Math.max(d,null!==(n=t.height)&&void 0!==n?n:0)):t.positionType===jC.inlineFront?(u.push(t),g=Math.max(g,(null!==(r=t.height)&&void 0!==r?r:0)+(null!==(s=t.marginLeft)&&void 0!==s?s:0)+(null!==(l=t.marginRight)&&void 0!==l?l:0))):t.positionType===jC.inlineEnd&&(p.push(t),f=Math.max(f,(null!==(a=t.height)&&void 0!==a?a:0)+(null!==(h=t.marginLeft)&&void 0!==h?h:0)+(null!==(v=t.marginRight)&&void 0!==v?v:0)))}))}let m=1,b=t;if(o.isHeader(t,e)||(null===(n=o.getBodyColumnDefine(t,e))||void 0===n?void 0:n.mergeCell)||o.hasCustomMerge()){const i=o.getCellRange(t,e);m=i.end.row-i.start.row+1,t=i.start.col,b=i.end.col}const y=r_(DS("padding",h,t,e,o)),C=DS("fontSize",h,t,e,o),w=DS("fontStyle",h,t,e,o),x=DS("fontWeight",h,t,e,o),_=null!==(r=DS("lineHeight",h,t,e,o))&&void 0!==r?r:C,S=DS("fontFamily",h,t,e,o),A=DS("autoWrapText",h,t,e,o),B=DS("lineClamp",h,t,e,o);let R;if("text"!==i&&"link"!==i&&"progressbar"!==i&&"checkbox"!==i&&"radio"!==i)l=_;else if("checkbox"===i)l=function(t,e,i,o,n,r,s,l,a,h,d,c,u,g,p){const f=mw(tt(t)?t.text:t).split("\n")||[],v=p.getColsWidth(e,o),m=DS("size",n,e,i,p);let b=0;if(r){const t=DS("spaceBetweenTextAndIcon",n,e,i,p),o=v-(g[1]+g[3])-s-m-t;gA.setAttributes({text:{maxLineWidth:o,text:f,fontSize:l,fontStyle:a,fontWeight:h,fontFamily:d,lineHeight:c,wordBreak:"break-word",lineClamp:u},icon:{width:Math.floor(m/1.4),height:Math.floor(m/1.4)},box:{width:m,height:m},spaceBetweenTextAndIcon:t}),gA.render(),b=gA.AABBBounds.height()}else b=Math.max(m,f.length*c);return b}(a,t,e,b,h,A,c,C,w,x,S,_,B,y,o);else if("radio"===i)l=function(t,e,i,o,n,r,s,l,a,h,d,c,u,g,p){var f;if(rt(t)){let v=0;const m=p.getBodyColumnDefine(e,i),b=DS("spaceBetweenRadio",n,e,i,p),y=null!==(f=null==m?void 0:m.radioDirectionInCell)&&void 0!==f?f:"vertical";return"vertical"===y?t.forEach(((f,m)=>{const y=fA(f,e,i,o,n,r,s,l,a,h,d,c,u,g,p);v+=y,m!==t.length-1&&(v+=b)})):"horizontal"===y&&t.forEach((t=>{const f=fA(t,e,i,o,n,r,s,l,a,h,d,c,u,g,p);v=Math.max(f,v)})),v}return fA(t,e,i,o,n,r,s,l,a,h,d,c,u,g,p)}(a,t,e,b,h,A,c,C,w,x,S,_,B,y,o);else{R=a;const i=VS(R,o).text,n=o.getColsWidth(t,b);if(u.length||p.length)if(A){const t=Object.assign({text:null==a?void 0:a.toString(),fontFamily:S,fontSize:C,fontStyle:w,fontWeight:x,lineHeight:_});t.textBaseline="middle";const e=[...u.map((t=>$S(t))),t,...p.map((t=>$S(t)))];SA.setAttributes({width:n-(y[1]+y[3])-c,height:0,textConfig:e}),l=SA.AABBBounds.height()}else l=0,i.forEach(((t,e)=>{var n;(null===(n=o.options.customConfig)||void 0===n?void 0:n.multilinesForXTable)&&0!==e||(0===e&&u.length?l+=Math.max(_,g):e===i.length-1&&p.length?l+=Math.max(_,f):l+=_)}));else if(A){const r=jS(t,e,o),s=_A({maxLineWidth:n-(y[1]+y[3])-c-r,text:i,fontSize:C,fontStyle:w,fontWeight:x,fontFamily:S,lineHeight:_,wordBreak:"break-word",whiteSpace:1!==i.length||A?"normal":"no-wrap",lineClamp:B});l=s.height()||("number"==typeof _?_:C)}else l=(null===(s=o.options.customConfig)||void 0===s?void 0:s.multilinesForXTable)?_:i.length*_}return(Math.max(l,d)+y[0]+y[2])/m}function LA(t,e,i){return{left:0,top:0,right:i.getColWidth(t),bottom:i.getRowHeight(e),width:i.getColWidth(t),height:0}}function PA(t,e){if(!e||!e.proxy)return{colStart:0,colEnd:0,rowStart:0,rowEnd:0};const{mergeStartCol:i,mergeEndCol:o,mergeStartRow:n,mergeEndRow:r,col:s,row:l}=t,{colStart:a,colEnd:h,rowStart:d,rowEnd:c,bodyLeftCol:u,bodyRightCol:g,bodyTopRow:p,bodyBottomRow:f}=e.proxy;let v=i,m=o,b=n,y=r;return s>=u&&s<=g&&(v=Math.max(t.mergeStartCol,a),m=Math.min(t.mergeEndCol,h)),l>=p&&l<=f&&(b=Math.max(t.mergeStartRow,d),y=Math.min(t.mergeEndRow,c)),{colStart:v,colEnd:m,rowStart:b,rowEnd:y}}function EA(t,e,i,o){o||t.table._setRowHeight(e,t.table.getRowHeight(e)+i,!0);for(let o=0;o<t.table.colCount;o++){const n=t.getCell(o,e);if("empty"===n.role)continue;const r=Mx(t.table,o,e);r&&r.start.col!==o||(HA(t,n,o,e,n.attribute.height+i,i,t.table.isHeader(o,e)),t.updateCellContentWhileResize(o,e))}let n=0,r=0;e<t.table.frozenRowCount?(n=e+1,r=t.table.frozenRowCount-1):e>=t.table.rowCount-t.table.bottomFrozenRowCount?(n=e+1,r=t.table.rowCount-1):(n=e+1,r=Math.min(t.proxy.rowEnd,t.table.rowCount-t.table.bottomFrozenRowCount-1));for(let e=0;e<t.table.colCount;e++)for(let o=n;o<=r;o++){const n=t.highPerformanceGetCell(e,o);"cell"===n.role&&n.setAttribute("y",n.attribute.y+i)}}function HA(t,e,i,o,n,r,s){e&&function(t,e,i,o,n,r,s){var l,a,h;if(e.attribute.height===n&&!e.needUpdateHeight)return;e.needUpdateHeight=!1,e.setAttribute("height",n);const d=null===(l=t.table.getCellRawRecord(i,o))||void 0===l?void 0:l.vtableMerge,c=!!t.table.getCustomMerge(i,o),u=d||c?"text":t.table.isHeader(i,o)?t.table._getHeaderLayoutMap(i,o).headerType:t.table.getBodyColumnType(i,o);if("progressbar"===u){const s=t.table.getBodyColumnDefine(i,o),l=t.table._getCellStyle(i,o),a=t.table.getCellValue(i,o),h=t.table.getCellOriginValue(i,o),d=r_(DS("padding",l,i,o,t.table));let c;(null==s?void 0:s.mergeCell)&&(c=t.table.getCellRange(i,o));const u=Tx.getFunction("createProgressBarCell")(s,l,e.attribute.width,a,h,i,o,d,t.table,c),g=e.getChildByName("progress-bar");e.insertBefore(u,g),e.removeChild(g),g.removeAllChild(),g.release(),FA(e,n,r,t.table.isAutoRowHeight(o),!0,t.table)}else if("sparkline"===u){e.removeAllChild();const n=t.table._getCellStyle(i,o),r=r_(DS("padding",n,i,o,t.table));Tx.getFunction("createSparkLineCellGroup")(e,e.parent,e.attribute.x,e.attribute.y,i,o,e.attribute.width,e.attribute.height,r,t.table,G_(n,t.table,i,o,DS).theme,!1)}else if("image"===u||"video"===u)QS(e,i,o,0,0,t.table);else if("axis"===(null===(a=e.firstChild)||void 0===a?void 0:a.name))null===(h=e.firstChild)||void 0===h||h.originAxis.resize(e.attribute.width,e.attribute.height);else{let s=!0;const l=e.getChildByName(Q_)||e.getChildByName(tS);if(l){let n;e.removeChild(l);const r=cA(i,o,e,t.table);if(r)for(let e=r.start.row;e<=r.end.row;e++){if(e===o)continue;const n=t.getCell(i,e),r=n.getChildByName(Q_)||n.getChildByName(tS);r.removeAllChild(),n.removeChild(r),cA(i,e,n,t.table)}else{let r,l;const a=t.table.getCellLocation(i,o),{vtableMerge:h}=t.table.getCellRawRecord(i,o)||{};if(h&&t.table.options.groupTitleCustomLayout)l=t.table.options.groupTitleCustomLayout;else if("body"!==a){const e=t.table.getHeaderDefine(i,o);r=null==e?void 0:e.headerCustomRender,l=null==e?void 0:e.headerCustomLayout}else{const e=t.table.getBodyColumnDefine(i,o);r=(null==e?void 0:e.customRender)||t.table.customRender,l=null==e?void 0:e.customLayout}if((r||l)&&uA(e))for(let i=e.mergeStartCol;i<=e.mergeEndCol;i++)for(let n=e.mergeStartRow;n<=e.mergeEndRow;n++)n!==o&&t.updateCellContent(i,n);if(l||r){const a=r_(DS("padding",t.table._getCellStyle(i,o),i,o,t.table));let h=e.attribute.width,d=e.attribute.height;uA(e)&&(h=t.table.getColsWidth(e.mergeStartCol,e.mergeEndCol),d=t.table.getRowsHeight(e.mergeStartRow,e.mergeEndRow));const c=eS(l,r,i,o,h,d,!1,t.table.isAutoRowHeight(o),a,uA(e)?{start:{col:e.mergeStartCol,row:e.mergeStartRow},end:{col:e.mergeEndCol,row:e.mergeEndRow}}:void 0,t.table);n=c.elementsGroup,s=c.renderDefault}e.childrenCount>0&&n?e.insertBefore(n,e.firstChild):n&&e.appendChild(n)}}FA(e,n,r,t.table.isAutoRowHeight(o),s,t.table)}}(t,e,i,o,n,r)}function FA(t,e,i,o,n,r){if(uA(t)){e=0;for(let i=t.mergeStartRow;i<=t.mergeEndRow;i++)e+=r.getRowHeight(i);const{colStart:i,colEnd:s,rowStart:l,rowEnd:a}=PA(t,r.scenegraph);for(let h=i;h<=s;h++)for(let s=l;s<=a;s++){const a=r.scenegraph.getCell(h,s);if(a.forEachChildren((t=>{t.setAttributes({dx:0,dy:0})})),n){const t=r._getCellStyle(i,l);YS(a,e,0,o,r_(t.padding),t.textAlign,t.textBaseline)}const d=r.getRowHeight(s),c=r.getColWidth(h);a.contentHeight=e;const{widthChange:u}=dA(a,c,d,{start:{col:t.mergeStartCol,row:t.mergeStartRow},end:{col:t.mergeEndCol,row:t.mergeEndRow}},r);u&&(a.needUpdateWidth=!0)}}else{const i=r._getCellStyle(t.col,t.row);YS(t,e,0,o,r_(i.padding),i.textAlign,i.textBaseline)}}function zA(t,e,i,o){var n,r,s,l,a,h,d;let c=!1;const u=null!==(n=null==t?void 0:t.attribute.width)&&void 0!==n?n:0;if(null==t||t.setAttribute("width",u+e),null==t||t.forEachChildren(((t,n)=>{if(function(t,e,i,o,n,r,s,l,a){var h,d,c,u,g;if(e.attribute.width===r&&!e.needUpdateWidth)return!1;e.needUpdateWidth=!1,e.setAttribute("width",r);const p=e;if(!p)return!1;const f=t.table.isAutoRowHeight(o),v=null===(h=t.table.getCellRawRecord(i,o))||void 0===h?void 0:h.vtableMerge,m=!!t.table.getCustomMerge(i,o),b=v||m?"text":t.table.isHeader(i,o)?t.table._getHeaderLayoutMap(i,o).headerType:t.table.getBodyColumnType(i,o);let y=!1;if("progressbar"===b){const e=t.table.getBodyColumnDefine(i,o),n=t.table._getCellStyle(i,o),l=t.table.getCellValue(i,o),a=t.table.getCellOriginValue(i,o),h=r_(DS("padding",n,i,o,t.table));let d;(null==e?void 0:e.mergeCell)&&(d=t.table.getCellRange(i,o));const c=Tx.getFunction("createProgressBarCell")(e,n,p.attribute.width,l,a,i,o,h,t.table,d),u=p.getChildByName("progress-bar");p.insertBefore(c,u),p.removeChild(u),u.removeAllChild(),u.release();const g=IA(p,r,s,f,!0,t.table);y=y||g}else if("sparkline"===b){p.removeAllChild();const e=t.table._getCellStyle(i,o),n=r_(DS("padding",e,i,o,t.table));Tx.getFunction("createSparkLineCellGroup")(p,p.parent,p.attribute.x,p.attribute.y,i,o,p.attribute.width,p.attribute.height,n,t.table,G_(e,t.table,i,o,DS).theme,!1)}else if("image"===b||"video"===b)QS(p,i,o,s,0,t.table);else if("axis"===(null===(d=p.firstChild)||void 0===d?void 0:d.name)){const e=t.table.internalProps.layoutMap.getAxisConfigInPivotChart(i,o),n=r_(DS("padding",t.table._getCellStyle(i,o),i,o,t.table));if(e){const i=new(Tx.getComponent("axis"))(e,p.attribute.width,p.attribute.height,null!==(c=e.__vtablePadding)&&void 0!==c?c:n,t.table);p.clear(),p.appendChild(i.component),i.overlap()}}else if("axis"===(null===(u=e.firstChild)||void 0===u?void 0:u.name))null===(g=e.firstChild)||void 0===g||g.originAxis.resize(e.attribute.width,e.attribute.height);else{let n=!0;const l=e.getChildByName(Q_)||e.getChildByName(tS);if(l){let r;e.removeChild(l);const s=cA(i,o,e,t.table);if(s)for(let e=s.start.col;e<=s.end.col;e++){if(e===i)continue;const n=t.getCell(e,o),r=n.getChildByName(Q_)||n.getChildByName(tS);r.removeAllChild(),n.removeChild(r),cA(e,o,n,t.table)}else{let s,l;const a=t.table.getCellLocation(i,o),{vtableMerge:h}=t.table.getCellRawRecord(i,o)||{};if(h&&t.table.options.groupTitleCustomLayout)l=t.table.options.groupTitleCustomLayout;else if("body"!==a){const e=t.table.getHeaderDefine(i,o);s=null==e?void 0:e.headerCustomRender,l=null==e?void 0:e.headerCustomLayout}else{const e=t.table.getBodyColumnDefine(i,o);s=(null==e?void 0:e.customRender)||t.table.customRender,l=null==e?void 0:e.customLayout}if((s||l)&&uA(p))for(let e=p.mergeStartCol;e<=p.mergeEndCol;e++)if(e!==i)for(let i=p.mergeStartRow;i<=p.mergeEndRow;i++)t.updateCellContent(e,i);if(l||s){const e=r_(DS("padding",t.table._getCellStyle(i,o),i,o,t.table));let a=p.attribute.width,h=p.attribute.height;uA(p)&&(a=t.table.getColsWidth(p.mergeStartCol,p.mergeEndCol),h=t.table.getRowsHeight(p.mergeStartRow,p.mergeEndRow));const d=eS(l,s,i,o,a,h,!1,t.table.isAutoRowHeight(o),e,uA(p)?{start:{col:p.mergeStartCol,row:p.mergeStartRow},end:{col:p.mergeEndCol,row:p.mergeEndRow}}:void 0,t.table);r=d.elementsGroup,n=d.renderDefault,y=!0}e.childrenCount>0&&r?e.insertBefore(r,e.firstChild):r&&e.appendChild(r)}}const a=IA(p,r,s,f,n,t.table);y=y||a}a||(a=t.table._getCellStyle(i,o).autoWrapText);return!(!f||!a)&&y}(o,t,t.col,t.row,0,u+e,e,"row-body"!==i||(t.col,o.table.rowHeaderLevelCount),o.table.internalProps.autoWrapText)){const e=Mx(o.table,t.col,t.row);if(e&&e.end.row-e.start.row)for(let t=e.start.row;t<=e.end.row;t++)OA(o,t);else OA(o,t.row);c=!0}})),c){let t,e,n,c=0;for(let u=0;u<o.table.colCount;u++){if("col-corner"===i?(n=0,t=o.getColGroup(u,!0),e=null!==(r=o.colHeaderGroup.attribute.height)&&void 0!==r?r:0):"row-body"===i?(n=o.table.frozenRowCount,t=o.getColGroup(u,!1),e=null!==(s=o.bodyGroup.attribute.height)&&void 0!==s?s:0):"bottom"===i?(n=o.table.rowCount-o.table.bottomFrozenRowCount,t=o.getColGroupInBottom(u),e=null!==(l=o.bottomFrozenGroup.attribute.height)&&void 0!==l?l:0):"left-bottom"===i?(n=o.table.rowCount-o.table.bottomFrozenRowCount,t=o.getColGroupInLeftBottomCorner(u),e=null!==(a=o.leftBottomCornerGroup.attribute.height)&&void 0!==a?a:0):"right-top"===i?(n=0,t=o.getColGroupInRightTopCorner(u),e=null!==(h=o.rightTopCornerGroup.attribute.height)&&void 0!==h?h:0):"right-bottom"===i&&(n=o.table.rowCount-o.table.bottomFrozenRowCount,t=o.getColGroupInRightBottomCorner(u),e=null!==(d=o.rightBottomCornerGroup.attribute.height)&&void 0!==d?d:0),!t)continue;let g=0;t.forEachChildren((t=>{var e;t.setAttribute("y",g),g+=null!==(e=o.table.getRowHeight(t.row))&&void 0!==e?e:0})),c=g}o.updateContainerHeight(n,c-e);for(let t=0;t<o.table.frozenColCount;t++){const e=o.getColGroupInLeftBottomCorner(t);let i=0;null==e||e.forEachChildren((t=>{t.setAttribute("y",i),i+=o.table.getRowHeight(t.row)}))}for(let t=o.table.colCount-o.table.rightFrozenColCount;t<o.table.colCount;t++){const e=o.getColGroupInRightBottomCorner(t);let i=0;null==e||e.forEachChildren((t=>{t.setAttribute("y",i),i+=o.table.getRowHeight(t.row)}))}for(let t=o.table.frozenColCount;t<o.table.colCount-o.table.rightFrozenColCount;t++){const e=o.getColGroupInBottom(t);let i=0;null==e||e.forEachChildren((t=>{t.setAttribute("y",i),i+=o.table.getRowHeight(t.row)}))}}}function IA(t,e,i,o,n,r){if(uA(t)){e=0;let s=!1;for(let i=t.mergeStartCol;i<=t.mergeEndCol;i++)e+=r.getColWidth(i);let l=0;for(let e=t.mergeStartRow;e<=t.mergeEndRow;e++)l+=r.getRowHeight(e);const{colStart:a,colEnd:h,rowStart:d,rowEnd:c}=PA(t,r.scenegraph);for(let u=a;u<=h;u++)for(let h=d;h<=c;h++){if(u===t.col&&h!==t.row)continue;const c=r.scenegraph.getCell(u,h);c.forEachChildren((t=>{t.setAttributes({dx:0,dy:0})}));let g=!1;if(n){const t=r._getCellStyle(a,d);g=XS(c,e,l,i,o,r_(t.padding),t.textAlign,t.textBaseline,r.scenegraph);const n=jS(c.col,c.row,r);if(n){const t=c.getChildByName("text"),e=c.getChildByName("expand")||c.getChildByName("collapse");"icon-left"!==(null==e?void 0:e.role)&&t&&t.setAttribute("dx",n)}}const p=r.getRowHeight(h),f=r.getColWidth(u);c.contentWidth=e;const{heightChange:v}=dA(c,f,p,{start:{col:t.mergeStartCol,row:t.mergeStartRow},end:{col:t.mergeEndCol,row:t.mergeEndRow}},r);v&&(c.needUpdateHeight=!0),s=s||g}return s}const s=r._getCellStyle(t.col,t.row),l=r_(s.padding),a=s.textAlign,h=s.textBaseline;return XS(t,e,r.getRowHeight(t.row),i,o,l,a,h,r.scenegraph)}function OA(t,e){const i=Math.round(BA(e,0,t.table.colCount-1,t.table));t.table._setRowHeight(e,i,!0);for(let o=0;o<t.table.colCount;o++){const n=i,r=t.highPerformanceGetCell(o,e);if("empty"===r.role)return;HA(t,r,o,e,n,n-r.attribute.height,t.table.isHeader(o,e))}}var DA;!function(t){t.dropDown="dropDown",t.contextmenu="contextmenu",t.custom="custom"}(DA||(DA={}));const WA=12,NA="Arial,sans-serif",GA="#000",jA="#2E68CF",VA="#EEE",UA=30,$A="#FFF",XA=4,YA=.5,KA="#CCC",qA=6,ZA=9,JA=200;const QA=FS();class tB{constructor(){const t=QA.drillDown;this.icon=new U_({x:-1e3,y:-1e3,image:t.svg,width:t.width,height:t.height,dx:-t.width/2,dy:-t.height/2,visible:!1,funcType:t.funcType,cursor:t.cursor}),this.icon.role="icon-drill"}appand(t){t.appendChild(this.icon)}update(t,e,i,o,n,r){if(!t||o&&n)return this.icon.setAttributes({x:-1e3,y:-1e3,visible:!1}),void r.updateNextFrame();const s=QA.drillDown,l=QA.drillUp;this.icon.setAttributes({x:e,y:i,image:o?s.svg:l.svg,visible:!0}),this.icon.loadImage(this.icon.attribute.image),r.updateNextFrame()}}class eB{constructor(t){const e=t.theme.dragHeaderSplitLine.lineWidth,i=t.theme.dragHeaderSplitLine.lineColor,o=t.theme.dragHeaderSplitLine.shadowBlockColor;this.columnMoverLabel=tc({visible:!1,pickable:!1,x:0,y:0,symbolType:"triangle",fill:i}),this.columnMoverLine=oc({visible:!1,pickable:!1,stroke:i,lineWidth:e,x:0,y:0,points:[{x:0,y:0},{x:0,y:0}]}),this.columnMoverBack=sc({visible:!1,pickable:!1,fill:o,x:0,y:0,width:0,height:0}),this.table=t}appand(t){t.appendChild(this.columnMoverLabel),t.appendChild(this.columnMoverLine),t.appendChild(this.columnMoverBack)}show(t,e,i){const o=this.table.getCellLocation(t,e),n=Mx(this.table,t,e);n&&(t=n.start.col,e=n.start.row);let r=0,s=0,l=0,a=0,h=0,d=0,c=0,u=0,g=Math.PI;const p=[];"columnHeader"===o?(r=this.table.getColsWidth(0,t-1)-this.table.stateManager.scroll.horizontalBarPos,s=this.table.getRowsHeight(0,this.table.frozenRowCount-1),a=this.table.tableNoFrameHeight,l=n?this.table.getColsWidth(n.start.col,n.end.col):this.table.getColWidth(t),h=r-i,c=r+l,u=2,p.push({x:0,y:0}),p.push({x:0,y:this.table.tableNoFrameHeight})):("rowHeader"===o||this.table.internalProps.layoutMap.isSeriesNumberInBody(t,e))&&(s=this.table.getRowsHeight(0,e-1)-this.table.stateManager.scroll.verticalBarPos,r=this.table.getColsWidth(0,this.table.frozenColCount-1),l=this.table.tableNoFrameWidth,a=n?this.table.getRowsHeight(n.start.row,n.end.row):this.table.getRowHeight(e),d=s-i,c=2,u=s+a,g=Math.PI/2,p.push({x:0,y:0}),p.push({x:this.table.tableNoFrameWidth,y:0})),this.columnMoverBack.setAttributes({visible:!0,x:r-h,y:s-d,width:l,height:a,dx:h,dy:d}),this.columnMoverLine.setAttributes({x:c,y:u,visible:!0,points:p}),this.columnMoverLabel.setAttributes({visible:!0,x:c,y:u,angle:g})}hide(){this.columnMoverLabel.setAttribute("visible",!1),this.columnMoverLine.setAttribute("visible",!1),this.columnMoverBack.setAttribute("visible",!1)}update(t,e,i,o){"number"==typeof t&&"number"==typeof e?(this.columnMoverLabel.setAttribute("x",e),this.columnMoverLine.setAttribute("x",e),this.columnMoverBack.setAttribute("x",t)):"number"==typeof i&&"number"==typeof o&&(this.columnMoverLabel.setAttribute("y",o),this.columnMoverLine.setAttribute("y",o),this.columnMoverBack.setAttribute("y",i))}updateStyle(){const t=this.table.theme.dragHeaderSplitLine.lineWidth,e=this.table.theme.dragHeaderSplitLine.lineColor,i=this.table.theme.dragHeaderSplitLine.shadowBlockColor;this.columnMoverLabel.setAttributes({fill:e}),this.columnMoverLine.setAttributes({stroke:e,lineWidth:t}),this.columnMoverBack.setAttributes({fill:i})}}function iB(t,e,i){if(i)return Math.min(e.tableNoFrameWidth,e.getAllColsWidth())-e.getColsWidth(t,e.colCount-1);let o=e.getColsWidth(0,t);return t>=e.frozenColCount&&(o-=e.scrollLeft),o}function oB(t,e,i){if(i)return Math.min(e.tableNoFrameWidth,e.getAllRowsHeight())-e.getRowsHeight(t,e.rowCount-1);let o=e.getRowsHeight(0,t);return t>=e.frozenRowCount&&(o-=e.scrollTop),o}class nB{constructor(t){var e,i,o,n,r,s,l,a,h,d,c,u,g,p,f,v,m;this.table=t;const b=this.table.theme;this.createScrollBar();const y=null===(e=b.columnResize)||void 0===e?void 0:e.lineColor,C=null===(i=b.columnResize)||void 0===i?void 0:i.lineWidth,w=null===(o=b.columnResize)||void 0===o?void 0:o.bgColor,x=null===(n=b.columnResize)||void 0===n?void 0:n.width,_=null===(s=null===(r=b.columnResize)||void 0===r?void 0:r.labelVisible)||void 0===s||s,S=null===(l=b.columnResize)||void 0===l?void 0:l.labelColor,A=null===(a=b.columnResize)||void 0===a?void 0:a.labelFontSize,B=null===(h=b.columnResize)||void 0===h?void 0:h.labelFontFamily,R=null===(d=b.columnResize)||void 0===d?void 0:d.labelBackgroundFill,M=null===(c=b.columnResize)||void 0===c?void 0:c.labelBackgroundCornerRadius;this.labelVisible=_,this.columnResizeLine=oc({visible:!1,pickable:!1,stroke:y,lineWidth:C,x:0,y:0,points:[{x:0,y:0},{x:0,y:0}]}),this.columnResizeBgLine=oc({visible:!1,pickable:!1,stroke:w,lineWidth:x,x:0,y:0,points:[{x:0,y:0},{x:0,y:0}]});const T=Gh({visible:!1,pickable:!1,x:0,y:0,fontSize:A,fill:S,fontFamily:B,text:"",textBaseline:"top",dx:16,dy:-A/2}),k=sc({visible:!1,pickable:!1,fill:R,x:0,y:0,width:5*A*.8,height:A+8,cornerRadius:M,dx:12,dy:-A/2-4});this.columnResizeLabel=vs({visible:!1,pickable:!1,x:0,y:0}),this.columnResizeLabel.appendChild(k),this.columnResizeLabel.appendChild(T),this.rowResizeLine=oc({visible:!1,pickable:!1,stroke:y,lineWidth:C,x:0,y:0,points:[{x:0,y:0},{x:0,y:0}]}),this.rowResizeBgLine=oc({visible:!1,pickable:!1,stroke:w,lineWidth:x,x:0,y:0,points:[{x:0,y:0},{x:0,y:0}]});const L=Gh({visible:!1,pickable:!1,x:0,y:0,fontSize:A,fill:S,fontFamily:B,text:"",textBaseline:"top",dx:16,dy:-A/2}),P=sc({visible:!1,pickable:!1,fill:R,x:0,y:0,width:5*A*.8,height:A+8,cornerRadius:M,dx:12,dy:-A/2-4});this.rowResizeLabel=vs({visible:!1,pickable:!1,x:0,y:0}),this.rowResizeLabel.appendChild(P),this.rowResizeLabel.appendChild(L),this.cellMover=new eB(this.table);const E=null===(g=null===(u=b.frozenColumnLine)||void 0===u?void 0:u.shadow)||void 0===g?void 0:g.width,H=null===(f=null===(p=b.frozenColumnLine)||void 0===p?void 0:p.shadow)||void 0===f?void 0:f.startColor,F=null===(m=null===(v=b.frozenColumnLine)||void 0===v?void 0:v.shadow)||void 0===m?void 0:m.endColor;this.frozenShadowLine=sc({visible:!0,pickable:!1,x:0,y:0,width:E,height:0,fill:{gradient:"linear",x0:0,y0:0,x1:1,y1:0,stops:[{color:H,offset:0},{color:F,offset:1}]}}),this.rightFrozenShadowLine=sc({visible:!0,pickable:!1,x:0,y:0,width:E,height:0,fill:{gradient:"linear",x0:0,y0:0,x1:1,y1:0,stops:[{color:F,offset:0},{color:H,offset:1}]}}),this.menu=new class{constructor(t){this._table=t,this._menuInstance=new zS({x:0,y:0,fill:$A,stroke:KA,cornerRadius:XA,lineWidth:YA}),this._menuInfo={x:-1,y:-1,col:-1,row:-1,type:DA.dropDown,menuInfo:[],highlightIndex:-1}}bindTableComponent(t){t.appendChild(this._menuInstance),this.bindEvent()}release(){}attach(t,e,i,o,n,r){if(n===DA.dropDown&&this.checkDropDownMenuChange(i,o)){const t=this.getMenuInfo(i,o,n);if(!t)return;const{menuInfo:e,highlightIndex:r}=t;this.updateMenuInfo(i,o,n,e,r),this.updateMenuInstance(e,r)}else if(n===DA.contextmenu&&this.checkContextMenuChange(t,e)){const t=this.getMenuInfo(i,o,n);if(!t)return;const{menuInfo:e,highlightIndex:r}=t;this.updateMenuInfo(i,o,n,e,r),this.updateMenuInstance(e,r)}this.updatePosition(t-this._table.scenegraph.x,e-this._table.scenegraph.y),this.addToScene()}updateMenuInfo(t,e,i,o,n){this._menuInfo.col=t,this._menuInfo.row=e,this._menuInfo.type=i,this._menuInfo.menuInfo=o,this._menuInfo.highlightIndex=n}checkDropDownMenuChange(t,e){const{type:i,col:o,row:n}=this._menuInfo;return i!==DA.dropDown||t!==o||e!==n}checkContextMenuChange(t,e){var i;const{type:o,menuInfo:n}=this._menuInfo;return o!==DA.contextmenu||n!==(null===(i=this._table.internalProps.menu)||void 0===i?void 0:i.contextMenuItems)}updateMenuInstance(t,e){this._menuInstance.removeAllChild();let i=qA;const o=qA;let n=0;t.forEach(((t,r)=>{var s,l;const a=e===r;let h,d;"string"==typeof t?d=t:"object"==typeof t&&(d=t.text,h=a?t.selectedIcon:t.icon);const c=new zS({y:i,x:o,height:UA,fill:$A});c.role="menu-item",this._menuInstance.appendChild(c),c.stateProxy=t=>"hover"===t?{fill:VA}:{fill:$A},c.addEventListener("pointerenter",(t=>{c.addState("hover",!0,!1),this._table.scenegraph.updateNextFrame()})),c.addEventListener("pointerleave",(t=>{c.removeState("hover",!1),this._table.scenegraph.updateNextFrame()}));const u=new Nh({x:ZA,y:ZA,fill:a?jA:GA,text:d,textBaseline:"top",fontSize:WA,fontFamily:NA,pickable:!1,maxLineWidth:JA,ellipsis:"…"});if(c.addChild(u),h){u.AABBBounds.height();const t=null!==(s=h.width)&&void 0!==s?s:16,e=null!==(l=h.height)&&void 0!==l?l:16,i=new U_({x:ZA,y:(UA-e)/2,width:t,height:e,image:h.svg,pickable:!1});i.role="menu-icon",c.insertBefore(i,u),u.setAttribute("x",t+ZA)}n=Math.max(c.AABBBounds.width(),n),i+=UA})),this._menuInstance.setAttributes({width:n+2*ZA+2*qA,height:i+qA}),this._menuInstance.forEachChildren((t=>{t.setAttribute("width",n+2*ZA)}))}updatePosition(t,e){this._menuInstance.setAttributes({x:this._menuInfo.type===DA.dropDown?t-this._menuInstance.attribute.width:t,y:e}),this._menuInfo.x=DA.dropDown?t-this._menuInstance.attribute.width:t,this._menuInfo.y=e}addToScene(){this._table.scenegraph.updateNextFrame()}detach(){this._menuInstance.setAttributes({x:-1e3,y:-1e3}),this._table.scenegraph.updateNextFrame()}getMenuInfo(t,e,i){var o;if(i===DA.dropDown){const{dropDownMenu:i=this._table.globalDropDownMenu,pivotInfo:o}=this._table._getHeaderLayoutMap(t,e);let n=-1;if(Array.isArray(i))for(let o=0;o<i.length;o++)if(this._table._dropDownMenuIsHighlight(t,e,o)){n=o;break}return{menuInfo:i,highlightIndex:n}}if(i===DA.contextmenu){const i=null===(o=this._table.internalProps.menu)||void 0===o?void 0:o.contextMenuItems;let n;if(Array.isArray(i))n=i;else if("function"==typeof i){const{field:o}=this._table.isHeader(t,e)?this._table.getHeaderDefine(t,e):this._table.getBodyColumnDefine(t,e);n=i(o,e,t)}return{menuInfo:n,highlightIndex:-1}}}bindEvent(){this._menuInstance.addEventListener("click",(t=>{const{target:e}=t;if(e&&"menu-item"===e.role){const i=this.getEventInfo(e),o=this._table.getMenuInfo(this._menuInfo.col,this._menuInfo.row,this._menuInfo.type),n=Object.assign(i,o);n.event=t.nativeEvent,this._table.fireListeners(Xw.DROPDOWN_MENU_CLICK,n)}}))}getEventInfo(t){const e=t.parent;let i=0;e.forEachChildren(((e,o)=>e===t&&(i=o-1,!0)));const o="string"==typeof this._menuInfo.menuInfo[i]?this._menuInfo.menuInfo[i]:this._menuInfo.menuInfo[i].text,n="string"==typeof this._menuInfo.menuInfo[i]?o:this._menuInfo.menuInfo[i].menuKey||o;return{col:this._menuInfo.col,row:this._menuInfo.row,dropDownIndex:i,highlight:i===this._menuInfo.highlightIndex,text:o,menuKey:n}}get bounds(){return this._menuInstance.globalAABBBounds}}(this.table),this.drillIcon=new tB}addToGroup(t){t.addChild(this.frozenShadowLine),t.addChild(this.rightFrozenShadowLine),t.addChild(this.columnResizeBgLine),t.addChild(this.columnResizeLine),t.addChild(this.columnResizeLabel),t.addChild(this.rowResizeBgLine),t.addChild(this.rowResizeLine),t.addChild(this.rowResizeLabel),this.table.theme.scrollStyle.hoverOn&&!this.table.theme.scrollStyle.barToSide?(t.addChild(this.hScrollBar),t.addChild(this.vScrollBar)):(t.stage.defaultLayer.addChild(this.hScrollBar),t.stage.defaultLayer.addChild(this.vScrollBar)),this.menu.bindTableComponent(t),this.drillIcon.appand(t),this.cellMover.appand(t)}createScrollBar(){var t,e,i,o,n,r;const s=this.table.theme,l=null===(t=s.scrollStyle)||void 0===t?void 0:t.scrollRailColor,a=null===(e=s.scrollStyle)||void 0===e?void 0:e.scrollSliderColor,h=null===(i=s.scrollStyle)||void 0===i?void 0:i.scrollSliderCornerRadius,d=null===(o=s.scrollStyle)||void 0===o?void 0:o.width,c=null===(n=s.scrollStyle)||void 0===n?void 0:n.horizontalPadding,u=null===(r=s.scrollStyle)||void 0===r?void 0:r.verticalPadding;let g;g=Q(h)?{cornerRadius:h,fill:a}:{fill:a},this.hScrollBar=new Am({direction:"horizontal",x:2*-this.table.tableNoFrameWidth,y:2*-this.table.tableNoFrameHeight,width:this.table.tableNoFrameWidth,height:d,padding:c,railStyle:{fill:l},sliderStyle:g,range:[0,.1],visible:!1}),this.hScrollBar.render(),this.hScrollBar.hideAll(),this.vScrollBar=new Am({direction:"vertical",x:2*-this.table.tableNoFrameWidth,y:2*-this.table.tableNoFrameHeight,width:d,height:this.table.tableNoFrameHeight-this.table.getFrozenRowsHeight(),padding:u,railStyle:{fill:l},sliderStyle:g,range:[0,.1],visible:!1}),this.vScrollBar.render(),this.vScrollBar.hideAll()}updateScrollBar(){var t,e,i,o,n,r,s;const l=this.table.stateManager.scroll.horizontalBarPos,a=this.table.stateManager.scroll.verticalBarPos,h=this.table.theme,d=null===(t=h.scrollStyle)||void 0===t?void 0:t.width,c=null===(e=h.scrollStyle)||void 0===e?void 0:e.visible,u=null!==(o=null===(i=h.scrollStyle)||void 0===i?void 0:i.horizontalVisible)&&void 0!==o?o:c,g=null!==(r=null===(n=h.scrollStyle)||void 0===n?void 0:n.verticalVisible)&&void 0!==r?r:c,p=Math.ceil(this.table.scenegraph.tableGroup.attribute.width),f=Math.ceil(this.table.scenegraph.tableGroup.attribute.height),v=this.table.getAllRowsHeight(),m=this.table.getAllColsWidth(),b=this.table.getFrozenRowsHeight(),y=this.table.getFrozenColsWidth(),C=this.table.getBottomFrozenRowsHeight(),w=this.table.getRightFrozenColsWidth(),x=(null===(s=this.table.options.customConfig)||void 0===s?void 0:s._disableColumnAndRowSizeRound)?1:0;if(m>p+x){const t=Math.min(f,v),e=Math.max(.05,(p-y)/(m-y)),i=this.table.theme.scrollStyle.hoverOn;let o=0;o=this.table.theme.scrollStyle.barToSide?this.table.tableNoFrameHeight-(i?d:-this.table.scenegraph.tableGroup.attribute.y)+this.table.tableY:t-(i?d:-this.table.scenegraph.tableGroup.attribute.y),this.hScrollBar.setAttributes({x:y+(i?0:this.table.scenegraph.tableGroup.attribute.x),y:o,width:p-y-w,range:[0,e],visible:"always"===u});const n=this.hScrollBar.AABBBounds&&this.hScrollBar.globalAABBBounds;this.hScrollBar._viewPosition={x:n.x1,y:n.y1},"always"===u&&this.hScrollBar.showAll()}else this.hScrollBar.setAttributes({x:2*-this.table.tableNoFrameWidth,y:2*-this.table.tableNoFrameHeight,width:0,visible:!1});if(v>f+x){const t=Math.min(p,m),e=Math.max(.05,(f-b)/(v-b));let i=0;const o=this.table.theme.scrollStyle.hoverOn;i=this.table.theme.scrollStyle.barToSide?this.table.tableNoFrameWidth-(o?d:-this.table.scenegraph.tableGroup.attribute.x)+this.table.tableX:t-(o?d:-this.table.scenegraph.tableGroup.attribute.x),this.vScrollBar.setAttributes({x:i,y:b+(o?0:this.table.scenegraph.tableGroup.attribute.y),height:f-b-C,range:[0,e],visible:"always"===g});const n=this.vScrollBar.AABBBounds&&this.vScrollBar.globalAABBBounds;this.vScrollBar._viewPosition={x:n.x1,y:n.y1},"always"===g&&this.vScrollBar.showAll()}else this.vScrollBar.setAttributes({x:2*-this.table.tableNoFrameWidth,y:2*-this.table.tableNoFrameHeight,height:0,visible:!1});this.table.stateManager.setScrollLeft(l),this.table.stateManager.setScrollTop(a)}hideResizeCol(){this.columnResizeLine.setAttribute("visible",!1),this.columnResizeBgLine.setAttribute("visible",!1),this.columnResizeLabel.setAttribute("visible",!1),this.columnResizeLabel.hideAll()}showResizeCol(t,e,i){const o=iB(t,this.table,i);this.columnResizeLine.setAttributes({visible:!0,x:o,points:[{x:0,y:0},{x:0,y:this.table.getRowsHeight(0,this.table.rowCount-1)}]}),this.columnResizeBgLine.setAttributes({visible:!0,x:o,points:[{x:0,y:0},{x:0,y:this.table.getRowsHeight(0,this.table.rowCount-1)}]}),this.labelVisible&&(this.columnResizeLabel.showAll(),this.columnResizeLabel.setAttributes({visible:!0,x:o,y:e}),this.columnResizeLabel.lastChild.setAttribute("text",`${this.table.getColWidth(t)}px`))}updateResizeCol(t,e,i){const o=iB(t,this.table,i);this.columnResizeLine.setAttributes({x:o,points:[{x:0,y:0},{x:0,y:this.table.getRowsHeight(0,this.table.rowCount-1)}]}),this.columnResizeBgLine.setAttributes({x:o,points:[{x:0,y:0},{x:0,y:this.table.getRowsHeight(0,this.table.rowCount-1)}]}),this.labelVisible&&(this.columnResizeLabel.setAttributes({x:o,y:e}),this.columnResizeLabel.lastChild.setAttribute("text",`${Math.floor(this.table.getColWidth(t))}px`))}hideResizeRow(){this.rowResizeLine.setAttribute("visible",!1),this.rowResizeBgLine.setAttribute("visible",!1),this.rowResizeLabel.setAttribute("visible",!1),this.rowResizeLabel.hideAll()}showResizeRow(t,e,i){const o=oB(t,this.table,i);this.rowResizeLine.setAttributes({visible:!0,y:o,points:[{y:0,x:0},{y:0,x:this.table.getColsWidth(0,this.table.colCount-1)}]}),this.rowResizeBgLine.setAttributes({visible:!0,y:o,points:[{y:0,x:0},{y:0,x:this.table.getColsWidth(0,this.table.colCount-1)}]}),this.labelVisible&&(this.rowResizeLabel.showAll(),this.rowResizeLabel.setAttributes({visible:!0,y:o,x:e}),this.rowResizeLabel.lastChild.setAttribute("text",`${this.table.getRowHeight(t)}px`))}updateResizeRow(t,e,i){const o=oB(t,this.table,i);this.rowResizeLine.setAttributes({y:o,points:[{y:0,x:0},{y:0,x:this.table.getColsWidth(0,this.table.colCount-1)}]}),this.rowResizeBgLine.setAttributes({y:o,points:[{y:0,x:0},{y:0,x:this.table.getColsWidth(0,this.table.colCount-1)}]}),this.labelVisible&&(this.rowResizeLabel.setAttributes({y:o,x:e}),this.rowResizeLabel.lastChild.setAttribute("text",`${Math.floor(this.table.getRowHeight(t))}px`))}hideMoveCol(){this.cellMover.hide()}showMoveCol(t,e,i){this.cellMover.show(t,e,i)}updateMoveCol(t,e,i,o){this.cellMover.update(t,e,i,o)}setFrozenColumnShadow(t,e){if(t<0)this.frozenShadowLine.setAttributes({visible:!1});else{const i=iB(t,this.table,e);this.frozenShadowLine.setAttributes({visible:!0,x:i,height:this.table.getDrawRange().height})}}setRightFrozenColumnShadow(t){if(t>=this.table.colCount)this.rightFrozenShadowLine.setAttributes({visible:!1});else{const e=iB(t,this.table,!0);this.rightFrozenShadowLine.setAttributes({visible:!0,x:e-this.rightFrozenShadowLine.attribute.width,height:this.table.getDrawRange().height})}}hideVerticalScrollBar(){var t;const e=this.table.theme.scrollStyle.visible,i=null!==(t=this.table.theme.scrollStyle.verticalVisible)&&void 0!==t?t:e;"focus"!==i&&"scrolling"!==i||(this.vScrollBar.setAttribute("visible",!1),this.vScrollBar.hideAll(),this.table.scenegraph.updateNextFrame())}showVerticalScrollBar(){var t;const e=this.table.theme.scrollStyle.visible,i=null!==(t=this.table.theme.scrollStyle.verticalVisible)&&void 0!==t?t:e;"focus"!==i&&"scrolling"!==i||(this.vScrollBar.setAttribute("visible",!0),this.vScrollBar.showAll(),this.table.scenegraph.updateNextFrame())}hideHorizontalScrollBar(){var t;const e=this.table.theme.scrollStyle.visible,i=null!==(t=this.table.theme.scrollStyle.horizontalVisible)&&void 0!==t?t:e;"focus"!==i&&"scrolling"!==i||(this.hScrollBar.setAttribute("visible",!1),this.hScrollBar.hideAll(),this.table.scenegraph.updateNextFrame())}showHorizontalScrollBar(){var t;const e=this.table.theme.scrollStyle.visible,i=null!==(t=this.table.theme.scrollStyle.horizontalVisible)&&void 0!==t?t:e;"focus"!==i&&"scrolling"!==i||(this.hScrollBar.setAttribute("visible",!0),this.hScrollBar.showAll(),this.table.scenegraph.updateNextFrame())}updateVerticalScrollBarPos(t){const e=this.vScrollBar.attribute.range,i=e[1]-e[0],o=t*(1-i);this.vScrollBar.setAttribute("range",[o,o+i]);const n=this.vScrollBar.AABBBounds&&this.vScrollBar.globalAABBBounds;this.vScrollBar._viewPosition={x:n.x1,y:n.y1}}updateHorizontalScrollBarPos(t){const e=this.hScrollBar.attribute.range,i=e[1]-e[0],o=t*(1-i);this.hScrollBar.setAttribute("range",[o,o+i]);const n=this.hScrollBar.AABBBounds&&this.hScrollBar.globalAABBBounds;this.hScrollBar._viewPosition={x:n.x1,y:n.y1}}updateStyle(){var t,e,i,o,n,r,s,l,a,h,d,c,u,g,p,f,v,m,b,y,C,w,x;const _=this.table.theme,S=null===(t=_.scrollStyle)||void 0===t?void 0:t.scrollRailColor,A=null===(e=_.scrollStyle)||void 0===e?void 0:e.scrollSliderColor,B=null===(i=_.scrollStyle)||void 0===i?void 0:i.scrollSliderCornerRadius,R=null===(o=_.scrollStyle)||void 0===o?void 0:o.width,M=null===(n=_.scrollStyle)||void 0===n?void 0:n.horizontalPadding,T=null===(r=_.scrollStyle)||void 0===r?void 0:r.verticalPadding;let k;k=Q(B)?{cornerRadius:B,fill:A}:{fill:A},this.hScrollBar.setAttributes({height:R,padding:M,railStyle:{fill:S},sliderStyle:k}),this.vScrollBar.setAttributes({width:R,padding:T,railStyle:{fill:S},sliderStyle:k});const L=null===(s=_.columnResize)||void 0===s?void 0:s.lineColor,P=null===(l=_.columnResize)||void 0===l?void 0:l.lineWidth,E=null===(a=_.columnResize)||void 0===a?void 0:a.bgColor,H=null===(h=_.columnResize)||void 0===h?void 0:h.width;this.columnResizeLine.setAttributes({stroke:L,lineWidth:P}),this.columnResizeBgLine=oc({stroke:E,lineWidth:H});const F=null===(d=_.columnResize)||void 0===d?void 0:d.labelColor,z=null===(c=_.columnResize)||void 0===c?void 0:c.labelFontSize,I=null===(u=_.columnResize)||void 0===u?void 0:u.labelFontFamily,O=null===(g=_.columnResize)||void 0===g?void 0:g.labelBackgroundFill,D=null===(p=_.columnResize)||void 0===p?void 0:p.labelBackgroundCornerRadius,W=null===(v=null===(f=_.columnResize)||void 0===f?void 0:f.labelVisible)||void 0===v||v;this.labelVisible=W,this.columnResizeLabel.lastChild.setAttributes({fontSize:z,fill:F,fontFamily:I,dy:-z/2}),this.columnResizeLabel.firstChild.setAttributes({fill:O,width:5*z*.8,height:z+8,cornerRadius:D,dy:-z/2-4}),this.rowResizeLabel.lastChild.setAttributes({fontSize:z,fill:F,fontFamily:I,dy:-z/2}),this.rowResizeLabel.firstChild.setAttributes({fill:O,width:5*z*.8,height:z+8,cornerRadius:D,dy:-z/2-4});const N=null===(b=null===(m=_.frozenColumnLine)||void 0===m?void 0:m.shadow)||void 0===b?void 0:b.width,G=null===(C=null===(y=_.frozenColumnLine)||void 0===y?void 0:y.shadow)||void 0===C?void 0:C.startColor,j=null===(x=null===(w=_.frozenColumnLine)||void 0===w?void 0:w.shadow)||void 0===x?void 0:x.endColor;this.frozenShadowLine.setAttributes({width:N,fill:{gradient:"linear",x0:0,y0:0,x1:1,y1:0,stops:[{color:G,offset:0},{color:j,offset:1}]}}),this.rightFrozenShadowLine.setAttributes({width:N,fill:{gradient:"linear",x0:0,y0:0,x1:1,y1:0,stops:[{color:j,offset:0},{color:G,offset:1}]}}),this.cellMover.updateStyle()}}function rB(t,e,i,o,n){var r,s,l,a,h,d;if(!e)return;const c="table"===i,{shadowBlur:u,shadowOffsetX:g,shadowOffsetY:p,shadowColor:f,cornerRadius:v,borderColor:m,borderLineWidth:b,borderLineDash:y}=e;let C=!1;const w={},x={pickable:!1};u&&c&&(x.shadowBlur=u,x.shadowOffsetX=g,x.shadowOffsetY=p,x.shadowColor=f,x.stroke=!0,x.stroke=f,x.lineWidth=1,C=!0),b&&(x.stroke=!0,x.fill=!1,x.stroke=lB(null!=m?m:"#E1E4E8",o,b),x.lineWidth=b,y&&(x.lineDash=y),x.lineCap="butt"),Array.isArray(m)&&(x.strokeArrayColor=r_(m)),Array.isArray(b)&&(x.strokeArrayWidth=r_(b),x.lineWidth=1),v&&(x.cornerRadius=v,w.cornerRadius=v);const _=x.strokeArrayWidth?x.strokeArrayWidth[0]:null!==(r=x.lineWidth)&&void 0!==r?r:0,S=x.strokeArrayWidth?x.strokeArrayWidth[1]:null!==(s=x.lineWidth)&&void 0!==s?s:0,A=x.strokeArrayWidth?x.strokeArrayWidth[2]:null!==(l=x.lineWidth)&&void 0!==l?l:0,B=x.strokeArrayWidth?x.strokeArrayWidth[3]:null!==(a=x.lineWidth)&&void 0!==a?a:0;if(t.setAttributes(w),!n)if(x.stroke)if(x.x=B/2,x.y=_/2,x.pickable=!1,c){if(v)if(Array.isArray(v)){const t=r_(v);x.cornerRadius=t,w.cornerRadius=t,t[0]&&(t[0]=t[0]+Math.min(B,_)/2),t[1]&&(t[1]=t[1]+Math.min(_,S)/2),t[2]&&(t[2]=t[2]+Math.min(S,A)/2),t[3]&&(t[3]=t[3]+Math.min(A,B)/2)}else if(rt(b)){const t=[];x.cornerRadius=t,w.cornerRadius=t,t[0]=v+Math.min(B,_)/2,t[1]=v+Math.min(_,S)/2,t[2]=v+Math.min(S,A)/2,t[3]=v+Math.min(A,B)/2}else x.cornerRadius=v+(null!==(h=x.lineWidth)&&void 0!==h?h:0)/2,w.cornerRadius=v+(null!==(d=x.lineWidth)&&void 0!==d?d:0)/2;let i,o;if(e.innerBorder?(x.x=t.attribute.x+B/2,x.y=t.attribute.y+_/2,x.width=t.attribute.width-B/2-S/2,x.height=t.attribute.height-_/2-A/2):(x.x=t.attribute.x-B/2,x.y=t.attribute.y-_/2,x.width=t.attribute.width+B/2+S/2,x.height=t.attribute.height+_/2+A/2),C){x.fill="white",x.notAdjustPos=!0,o=vs(x),o.name="table-border-rect",i=sc({x:B/2,y:_/2,width:t.attribute.width,height:t.attribute.height,fill:"red",cornerRadius:t.attribute.cornerRadius,globalCompositeOperation:"destination-out"}),o.addChild(i);const e=sc({x:B/2,y:_/2,width:t.attribute.width,height:t.attribute.height,fill:"transparent",pickable:!1,globalCompositeOperation:"source-over"});o.addChild(e)}else o=sc(x),o.name="table-border-rect";e.innerBorder&&!C?t.parent.insertAfter(o,t):t.parent.insertBefore(o,t),t.border=o}else{x.width=t.attribute.width-B/2-S/2,x.height=t.attribute.height-_/2-A/2;const e=sc(x);e.name="border-rect",t.addChild(e),t.border=e}else{const e=sc({fill:!1,stroke:!1,pickable:!1,lineWidth:0});e.name="border-rect",t.addChild(e),t.border=e}}function sB(t,e,i){var o;if(!e)return;const{borderColor:n}=e;null===(o=t.border)||void 0===o||o.setAttribute("stroke",lB(n,i))}function lB(t,e,i){let o=!0;return!e&&!rt(i)||rt(t)?e?o=e:e||rt(t)?rt(t)&&(o=!0):o=t:o=(null!=e?e:i).map((e=>!!e&&t)),o}function aB(t){var e,i,o,n;if(!t.border)return;const r=t.border.attribute.strokeArrayWidth?t.border.attribute.strokeArrayWidth[0]:null!==(e=t.border.attribute.lineWidth)&&void 0!==e?e:0,s=t.border.attribute.strokeArrayWidth?t.border.attribute.strokeArrayWidth[1]:null!==(i=t.border.attribute.lineWidth)&&void 0!==i?i:0,l=t.border.attribute.strokeArrayWidth?t.border.attribute.strokeArrayWidth[2]:null!==(o=t.border.attribute.lineWidth)&&void 0!==o?o:0,a=t.border.attribute.strokeArrayWidth?t.border.attribute.strokeArrayWidth[3]:null!==(n=t.border.attribute.lineWidth)&&void 0!==n?n:0;t.border.setAttributes({width:t.attribute.width-a/2-s/2,height:t.attribute.height-r/2-l/2}),"group"===t.border.type&&t.border.firstChild.setAttributes({width:t.attribute.width,height:t.attribute.height})}function hB(t,e){t.setAttribute("cornerRadius",e),t.border&&t.border.setAttribute("cornerRadius",e)}const dB=Ur();class cB extends fs{constructor(t,e){if(super(e),this.type="chart",this.numberType=dB,this.isShareChartSpec=t,e.chartInstance)this.chartInstance=e.chartInstance;else{const t=this.chartInstance=new e.ClassType(e.spec,St({},this.attribute.tableChartOption,{renderCanvas:e.canvas,mode:"node"===this.attribute.mode?"node":"desktop-browser",modeParams:this.attribute.modeParams,canvasControled:!1,viewBox:{x1:0,x2:0,y1:0,y2:0},dpr:e.dpr,interactive:!1,animation:!1,autoFit:!1}));t.renderSync(),t.getStage().enableDirtyBounds(),e.chartInstance=this.chartInstance=t}}activate(t){var e,i,o,n;this.active=!0;const{col:r,row:s}=this.parent,{x1:l,y1:a,x2:h,y2:d}=this.getViewBox(),c=function(t,e,i){var o,n,r,s,l,a,h,d;const{layoutMap:c}=i.internalProps,u=new ze,g=i.scenegraph.tableGroup.globalAABBBounds;return u.x1=g.x1,u.x2=g.x2,u.y1=g.y1,u.y2=g.y2,c.isFrozenColumn(t,e)||c.isRightFrozenColumn(t,e)?c.isLeftBottomCorner(t,e)||c.isRightTopCorner(t,e)||(c.isFrozenColumn(t,e)||c.isRightFrozenColumn(t,e)?(u.y1=g.y1+i.getFrozenRowsHeight(),u.y2=g.y2-i.getBottomFrozenRowsHeight()):c.isBottomFrozenRow(t,e)&&(u.x1=g.x1+i.getFrozenColsWidth(),u.x2=g.x2-i.getRightFrozenColsWidth())):(u.x1=g.x1+i.getFrozenColsWidth(),u.x2=g.x2-i.getRightFrozenColsWidth(),u.y1=g.y1+i.getFrozenRowsHeight(),u.y2=g.y2-i.getBottomFrozenRowsHeight()),u.x1=u.x1+(null!==(n=null===(o=i.options.viewBox)||void 0===o?void 0:o.x1)&&void 0!==n?n:0),u.x2=u.x2+(null!==(s=null===(r=i.options.viewBox)||void 0===r?void 0:r.x1)&&void 0!==s?s:0),u.y1=u.y1+(null!==(a=null===(l=i.options.viewBox)||void 0===l?void 0:l.y1)&&void 0!==a?a:0),u.y2=u.y2+(null!==(d=null===(h=i.options.viewBox)||void 0===h?void 0:h.y1)&&void 0!==d?d:0),u}(r,s,t).intersect({x1:l-t.scrollLeft,x2:h-t.scrollLeft,y1:a-t.scrollTop,y2:d-t.scrollTop});this.activeChartInstance=new this.attribute.ClassType(this.attribute.spec,St({},this.attribute.tableChartOption,{renderCanvas:this.attribute.canvas,mode:"desktop-browser",canvasControled:!1,viewBox:{x1:0,x2:h-l,y1:0,y2:d-a},dpr:t.internalProps.pixelRatio,animation:!1,interactive:!0,autoFit:!1,beforeRender:e=>{const i=this.stage,o=e.window.getContext(),n=i.window.getViewBoxTransform(),r=i.window.getViewBox();o.inuse=!0,o.clearMatrix(),o.setTransform(n.a,n.b,n.c,n.d,n.e,n.f,!0),o.translate(r.x1,r.y1),o.setTransformForCurrent(!0),o.beginPath(),o.rect(c.x1,c.y1,c.x2-c.x1,c.y2-c.y1),o.clip(),o.clearMatrix(),t.options.canvas&&!e.needRender&&(e.pauseRender(),t.scenegraph.stage.dirtyBounds.union(this.globalAABBBounds),t.scenegraph.updateNextFrame())},afterRender(t){t.window.getContext().inuse=!1,t.needRender=!1,u.resumeRender()}}));const u=this.activeChartInstance.getStage(),g=this.globalTransMatrix.clone(),p=this.stage.window.getViewBoxTransform();g.multiply(p.a,p.b,p.c,p.d,p.e,p.f),u.window.setViewBoxTransform&&u.window.setViewBoxTransform(g.a,g.b,g.c,g.d,g.e,g.f),this.activeChartInstance.renderSync(),null===(i=null===(e=t.internalProps.layoutMap)||void 0===e?void 0:e.updateDataStateToActiveChartInstance)||void 0===i||i.call(e,this.activeChartInstance),this.activeChartInstance.on("click",(e=>{cB.temp&&t.scenegraph.updateChartState(null==e?void 0:e.datum)})),this.activeChartInstance.on("brushEnd",(e=>{var i;t.scenegraph.updateChartState(null===(i=null==e?void 0:e.value)||void 0===i?void 0:i.inBrushData),cB.temp=0,setTimeout((()=>{cB.temp=1}),0)})),null===(n=(o=t)._bindChartEvent)||void 0===n||n.call(o,this.activeChartInstance)}deactivate(){var t,e;this.active=!1,null===(t=this.activeChartInstance)||void 0===t||t.updateViewBox({x1:-1e3,x2:-800,y1:-1e3,y2:-800},!1,!1),null===(e=this.activeChartInstance)||void 0===e||e.release(),this.activeChartInstance=null}updateData(t){this.attribute.data=t}getViewBox(){var t,e,i,o,n,r,s,l;const a=this.parent,h=this.attribute.cellPadding,d=this.stage.table,{x1:c,y1:u,x2:g,y2:p}=a.globalAABBBounds;return{x1:Math.ceil(c+h[3]+d.scrollLeft+(null!==(e=null===(t=d.options.viewBox)||void 0===t?void 0:t.x1)&&void 0!==e?e:0)),x2:Math.ceil(c+a.attribute.width-h[1]+d.scrollLeft+(null!==(o=null===(i=d.options.viewBox)||void 0===i?void 0:i.x1)&&void 0!==o?o:0)),y1:Math.ceil(u+h[0]+d.scrollTop+(null!==(r=null===(n=d.options.viewBox)||void 0===n?void 0:n.y1)&&void 0!==r?r:0)),y2:Math.ceil(u+a.attribute.height-h[2]+d.scrollTop+(null!==(l=null===(s=d.options.viewBox)||void 0===s?void 0:s.y1)&&void 0!==l?l:0))}}}cB.temp=1;const uB=[],gB=[];let pB=5,fB=!1;function vB(t){Q(t)&&(pB=t)}function mB(t){var e,i,o,n,r,s;const{axes:l,dataId:a,data:h,spec:d,ClassType:c,canvas:u,mode:g,modeParams:p,dpr:f}=t.attribute;let{chartInstance:v}=t;v||(v=new c(d,{renderCanvas:u,mode:"node"===g?"node":"desktop-browser",modeParams:p,canvasControled:!1,viewBox:{x1:0,x2:0,y1:0,y2:0},dpr:f,interactive:!1,animation:!1,autoFit:!1}),v.renderSync(),t.chartInstance=v);const m=t.getViewBox();m.x2<=m.x1&&(m.x2=m.x1+1),m.y2<=m.y1&&(m.y2=m.y1+1),v.updateViewBox({x1:0,x2:m.x2-m.x1,y1:0,y2:m.y2-m.y1},!1,!1);const b=v.getStage(),y=t.globalTransMatrix.clone(),C=t.stage.window.getViewBoxTransform();y.multiply(C.a,C.b,C.c,C.d,C.e,C.f),b.window.setViewBoxTransform&&b.window.setViewBoxTransform(y.a,y.b,y.c,y.d,y.e,y.f);const{table:w}=t.getRootNode();let x=!1;if(w.options.specFormat){const e=w.options.specFormat(t.attribute.spec);if(e.needFormatSpec&&e.spec){const t=e.spec;v.updateSpecSync(t),x=!0}}if(!x)if(null==l||l.forEach(((t,e)=>{var i,o,n,r;"band"===t.type?v.updateModelSpec({type:"axes",index:e},{domain:t.domain.slice(0)},!0):v.updateModelSpecSync({type:"axes",index:e},{min:null!==(o=null===(i=t.range)||void 0===i?void 0:i.min)&&void 0!==o?o:0,max:null!==(r=null===(n=t.range)||void 0===n?void 0:n.max)&&void 0!==r?r:0},!0)})),null===(i=null===(e=w.internalProps.layoutMap)||void 0===e?void 0:e.updateDataStateToActiveChartInstance)||void 0===i||i.call(e,v),"string"==typeof a)v.updateDataSync(a,null!=h?h:[]);else{const t=[];for(const e in a){const i=a[e],s=d.series.find((t=>{var i;return(null===(i=null==t?void 0:t.data)||void 0===i?void 0:i.id)===e}));t.push({id:e,values:i?null!==(o=null==h?void 0:h.filter((t=>t.hasOwnProperty(i))))&&void 0!==o?o:[]:null!=h?h:[],fields:null===(n=null==s?void 0:s.data)||void 0===n?void 0:n.fields}),v.updateFullDataSync||v.updateDataSync(e,i?null!==(r=null==h?void 0:h.filter((t=>t.hasOwnProperty(i))))&&void 0!==r?r:[]:null!=h?h:[])}null===(s=v.updateFullDataSync)||void 0===s||s.call(v,t)}!function(t,e){var i;const{viewWidth:o,viewHeight:n}=t;if(o<yB&&n<yB)return e.cacheCanvas=CB(t),void(e.isShareChartSpec||(null===(i=e.chartInstance)||void 0===i||i.release(),e.chartInstance=null,e.setAttribute("chartInstance",null)));const r=Math.ceil(n/yB),s=Math.ceil(o/yB),l=[];for(let e=0;e<r;e++)for(let i=0;i<s;i++){const r=i*yB,s=e*yB,a=r+yB>o?o:r+yB,h=s+yB>n?n:s+yB,d=a-r,c=h-s,u=new ze;u.setValue(r,s,a,h);const g=CB(t,!1,u);l.push({canvas:g,x:r,y:s,width:d,height:c})}e.cacheCanvas=l}(v.getStage(),t)}function bB(t){fB=!0,gB.length>0?requestAnimationFrame((()=>{const e=gB.splice(0,pB);uB.splice(0,pB),e.forEach((t=>{mB(t),t.addUpdateBoundTag()})),t.render(),bB(t)})):fB=!1}const yB=2e3;function CB(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=arguments.length>2?arguments[2]:void 0;if("released"===t.releaseStatus)return null;const o=t.window.getViewBoxTransform(),n=function(t){let e=arguments.length>2?arguments[2]:void 0;const i=t.window.getViewBoxTransform(),o=nn.get(cn),n=e?-e.x1:0,r=e?-e.y1:0,s=e?e.x2:t.viewWidth,l=e?e.y2:t.viewHeight,a=e?e.width():t.viewWidth,h=e?e.height():t.viewHeight;return o.create({viewBox:{x1:n,y1:r,x2:s,y2:l},width:a*i.a,height:h*i.d,dpr:t.window.dpr,canvasControled:!0,offscreen:!0,title:""}),t.renderTo(o),o}(t,e,i);n.setViewBoxTransform(o.a,o.b,o.c,o.d,0,0),t.renderTo(n);const r=n.getNativeHandler();return r.nativeCanvas?r.nativeCanvas:null}var wB=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s};const xB=Symbol.for("ChartRender");let _B=class extends pl{constructor(){super(...arguments),this.numberType=dB}drawShape(t,e,i,o,n,r,s,l){var a,h,d,c;const u=Rn(t,null==r?void 0:r.theme).group,{dataId:g,data:p,spec:f}=t.attribute,{width:v=u.width,height:m=u.height}=(t.getViewBox(),t.attribute),{table:b}=t.getRootNode(),{active:y,cacheCanvas:C,activeChartInstance:w}=t;if(!y&&C)rt(C)?C.forEach((t=>{const{x:i,y:o,width:n,height:r,canvas:s}=t;e.drawImage(s,i,o,n,r)})):e.drawImage(C,i,o,v,m);else if(w){if(b.options.specFormat){const e=b.options.specFormat(t.attribute.spec);if(e.needFormatSpec&&e.spec){const t=e.spec;return void w.updateSpecSync(t)}}const e=t.getViewBox();w.updateViewBox({x1:0,x2:e.x2-e.x1,y1:0,y2:e.y2-e.y1},!1,!1);const i=w.getStage();i.needRender=!0;const o=t.globalTransMatrix.clone(),n=t.stage.window.getViewBoxTransform().clone();if(n.multiply(o.a,o.b,o.c,o.d,o.e,o.f),i.window.setViewBoxTransform(n.a,n.b,n.c,n.d,n.e,n.f),"string"==typeof g)w.updateDataSync(g,null!=p?p:[]);else{const t=[];for(const e in g){const i=g[e],o=f.series.find((t=>{var i;return(null===(i=null==t?void 0:t.data)||void 0===i?void 0:i.id)===e}));t.push({id:e,values:i?null!==(a=null==p?void 0:p.filter((t=>t.hasOwnProperty(i))))&&void 0!==a?a:[]:null!=p?p:[],fields:null===(h=null==o?void 0:o.data)||void 0===h?void 0:h.fields}),w.updateFullDataSync||w.updateDataSync(e,i?null!==(d=null==p?void 0:p.filter((t=>t.hasOwnProperty(i))))&&void 0!==d?d:[]:null!=p?p:[])}null===(c=w.updateFullDataSync)||void 0===c||c.call(w,t)}}else b.internalProps.renderChartAsync?(-1===uB.indexOf(`${t.parent.col}+${t.parent.row}`)&&(uB.push(`${t.parent.col}+${t.parent.row}`),gB.push(t)),fB||bB(b)):mB(t)}draw(t,e,i,o){this._draw(t,{},!1,i,o)}};_B=wB([y()],_B);var SB=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s};let AB=class{constructor(){this.time=Ti.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,o,n,r,s,l,a,h,d,c,u){const{shape:g}=t.attribute;if("circle"===g){const{width:n=a.width,height:r=a.height}=t.attribute;e.beginPath(),e.arc(i+n/2,o+r/2,Math.min(n,r)/2,0,2*Math.PI),e.closePath(),e.save(),e.clip()}}};AB=SB([y()],AB);let BB=class{constructor(){this.time=Ti.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,o,n,r,s,l,a,h,d,c,u){const{shape:g}=t.attribute;"circle"===g&&e.restore()}};function RB(t,e,i,o){var n;const{highlightScope:r,disableHeader:s,cellPos:l}=t.hover,a=t.table,h=a.isHeader(e,i);if(h&&s)return;let d;if(r===OC.single&&l.col===e&&l.row===i?d="cellBgColor":r===OC.column&&l.col===e?d=l.col===e&&l.row===i?"cellBgColor":"inlineColumnBgColor":r===OC.row&&l.row===i?d=l.col===e&&l.row===i?"cellBgColor":"inlineRowBgColor":r===OC.cross&&(l.col===e&&l.row===i?d="cellBgColor":l.col===e?d="inlineColumnBgColor":l.row===i&&(d="inlineRowBgColor")),d){let t;if(h){const r=a.getHeaderDefine(e,i);t=null==r?void 0:r.disableHeaderHover,o.firstChild&&"axis"===o.firstChild.name&&(null===(n=a.options.hover)||void 0===n?void 0:n.disableAxisHover)&&(t=!0)}else{const o=a.getBodyColumnDefine(e,i);t=null==o?void 0:o.disableHover}t&&(d=void 0)}return d}function MB(t,e,i,o){const{highlightScope:n,disableHeader:r,cellPos:s,ranges:l}=t.select;let a;if(1===(null==l?void 0:l.length)&&l[0].end.col===l[0].start.col&&l[0].end.row===l[0].start.row){const o=t.table,l=o.isHeader(e,i);if(l&&r)return;if(n===OC.single&&s.col===e&&s.row===i?a="cellBgColor":n===OC.column&&s.col===e?a=s.col===e&&s.row===i?"cellBgColor":"inlineColumnBgColor":n===OC.row&&s.row===i?a=s.col===e&&s.row===i?"cellBgColor":"inlineRowBgColor":n===OC.cross&&(s.col===e&&s.row===i?a="cellBgColor":s.col===e?a="inlineColumnBgColor":s.row===i&&(a="inlineRowBgColor")),a){let t;if(l){const n=o.getHeaderDefine(e,i);t=null==n?void 0:n.disableHeaderSelect}else{const n=o.getBodyColumnDefine(e,i);t=null==n?void 0:n.disableSelect}t&&(a=void 0)}}else if("replace"===t.table.theme.selectionStyle.selectionFillMode)for(let t=0;t<l.length;t++){const o=l[t],n=Math.min(o.start.col,o.end.col),r=Math.max(o.start.col,o.end.col),s=Math.min(o.start.row,o.end.row),h=Math.max(o.start.row,o.end.row);if(n<=e&&s<=i&&r>=e&&h>=i){a="cellBgColor";break}}return a}function TB(t,e,i){const o=t.getBodyColumnDefine(e,i),n=t.isHeader(e,i);return!(!(null==o?void 0:o.disableSelect)||n)||!(!n||!(null==o?void 0:o.disableHeaderSelect))}BB=SB([y()],BB);var kB=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s};let LB=class{constructor(){this.time=Ti.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,o,n,r,s,l,a,h,d,c,u){const{stroke:g=a.stroke,strokeArrayWidth:p=a.strokeArrayWidth,strokeArrayColor:f=a.strokeArrayColor}=t.attribute;g&&(Array.isArray(p)||Array.isArray(f))&&(u.doStroke=!1)}};LB=kB([y()],LB);let PB=class{constructor(){this.time=Ti.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,o,n,r,s,l,a,h,d,c){var u,g;const{stroke:p=a.stroke,strokeArrayColor:f=a.strokeArrayColor,strokeArrayWidth:v=a.strokeArrayWidth,lineWidth:m=a.lineWidth,strokeColor:b=a.stroke,cornerRadius:y=a.cornerRadius}=t.attribute;let C,w,{width:x=a.width,height:_=a.height}=t.attribute;if(p&&(Array.isArray(v)||0!==m)&&(Array.isArray(f)||Array.isArray(v))){if("number"==typeof m&&1&m||Array.isArray(v)&&v.some((t=>1&t))){const e=t.stage.table;if(!e)return;const n="bottom-right"===(null===(u=null==e?void 0:e.theme)||void 0===u?void 0:u.cellBorderClipDirection);if(n){if(i=Math.floor(i)-.5,o=Math.floor(o)-.5,"cell"===t.role){const e=t.col,n=t.row;0===e&&(i+=1),0===n&&(o+=1)}}else i=Math.floor(i)+.5,o=Math.floor(o)+.5;(null===(g=e.options.customConfig)||void 0===g?void 0:g._disableColumnAndRowSizeRound)&&(x=Math.round(x),_=Math.round(_));const{width:r,height:s}=VB(t,Math.ceil(x),Math.ceil(_),n);C=r,w=s}else C=Math.ceil(x),w=Math.ceil(_);0===y||rt(y)&&y.every((t=>0===t))?HB(t,e,i,o,a,p,v||m,f||b,C,w):(e.beginPath(),Fl(e,i,o,C,w,y,new Array(4).fill(0).map(((n,r)=>(n,s,l,h)=>{YB(r,n,s,l,h,t,e,i,o,a,p,v||m,f||b,C,w)}))),e.stroke())}}};function EB(t){if(!Array.isArray(t))return{isSplitDraw:!1,width:t};let e;for(let i=0;i<t.length;i++){const o=t[i];if(o)if(e){if(o!==e)return{isSplitDraw:!0}}else e=o}return{isSplitDraw:!1,width:e}}function HB(t,e,i,o,n,r,s,l,a,h,d,c){var u,g,p,f;const v=EB(s),m=!Array.isArray(s),b=!Array.isArray(r),y=Array.isArray(c),C=Array.isArray(l)||v.isSplitDraw;e.setStrokeStyle(t,t.attribute,i,o,n);const{lineDash:w=n.lineDash}=t.attribute;let x=!1;w.length&&w.some((t=>Array.isArray(t)))&&(x=!0),e.beginPath(),e.moveTo(i,o);const _=(b||r[0])&&(m||s[0]),S=(b||r[1])&&(m||s[1]),A=(b||r[2])&&(m||s[2]),B=(b||r[3])&&(m||s[3]);if(_){const t=(m?v.width:s[0])/2,n=(m?v.width:s[0])/2;y&&Array.isArray(c[0])?(e.moveTo(i-t+(a+t+n)*c[0][0],o),e.lineTo(i-t+(a+t+n)*(c[0][1]-c[0][0]),o),e.moveTo(i+a+n,o)):(e.moveTo(i-t,o),e.lineTo(i+a+n,o)),(C||x)&&(l&&l[0]?e.strokeStyle=l[0]:e.strokeStyle="transparent",m||(e.lineWidth=s[0]),e.lineDashOffset=e.currentMatrix.e/e.currentMatrix.a,x&&e.setLineDash(null!==(u=w[0])&&void 0!==u?u:[]),e.stroke(),e.beginPath(),e.moveTo(i+a,o))}else e.moveTo(i+a,o);if(S){const t=(m?v.width:s[1])/2,n=(m?v.width:s[1])/2;y&&Array.isArray(c[1])?(e.moveTo(i+a,o-t+h*c[1][0]),e.lineTo(i+a,o-t+(h+t+n)*(c[1][1]-c[1][0])),e.moveTo(i+a,o+h+n)):(e.moveTo(i+a,o-t),e.lineTo(i+a,o+h+n)),(C||x)&&(l&&l[1]?e.strokeStyle=l[1]:e.strokeStyle="transparent",m||(e.lineWidth=s[1]),e.lineDashOffset=e.currentMatrix.f/e.currentMatrix.d,x&&e.setLineDash(null!==(g=w[1])&&void 0!==g?g:[]),e.stroke(),e.beginPath(),e.moveTo(i+a,o+h))}else e.moveTo(i+a,o+h);if(A){const t=(m?v.width:s[2])/2,n=(m?v.width:s[2])/2;y&&Array.isArray(c[2])?(e.moveTo(i-t+(a+t+n)*c[2][0],o+h),e.lineTo(i-t+(a+t+n)*(c[2][1]-c[2][0]),o+h),e.moveTo(i-t,o+h)):(e.moveTo(i-t,o+h),e.lineTo(i+a+n,o+h)),(C||x)&&(l&&l[2]?e.strokeStyle=l[2]:e.strokeStyle="transparent",m||(e.lineWidth=s[2]),e.lineDashOffset=e.currentMatrix.e/e.currentMatrix.a,x&&e.setLineDash(null!==(p=w[2])&&void 0!==p?p:[]),e.stroke(),e.beginPath(),e.moveTo(i,o+h))}else e.moveTo(i,o+h);if(B){const t=(m?v.width:s[3])/2,n=(m?v.width:s[3])/2;y&&Array.isArray(c[3])?(e.moveTo(i,o-t+(h+t+n)*c[3][0]),e.lineTo(i,o-t+(h+t+n)*(c[3][1]-c[3][0])),e.moveTo(i,o-t)):(e.moveTo(i,o-t),e.lineTo(i,o+h+n)),(C||x)&&(l&&l[3]?e.strokeStyle=l[3]:e.strokeStyle="transparent",m||(e.lineWidth=s[3]),e.lineDashOffset=e.currentMatrix.f/e.currentMatrix.d,x&&e.setLineDash(null!==(f=w[3])&&void 0!==f?f:[]),e.stroke(),e.beginPath(),e.moveTo(i,o))}else e.moveTo(i,o);C||x||(!m&&v.width&&(e.lineWidth=v.width),e.stroke()),e.lineDashOffset=0,e.setLineDash([])}PB=kB([y()],PB);let FB=class{constructor(){this.time=Ti.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,o,n,r,s,l,a,h,d,c,u){var g;const{lineDash:p=a.lineDash,stroke:f=a.stroke,strokeArrayColor:v=a.strokeArrayColor,strokeArrayWidth:m=a.strokeArrayWidth}=t.attribute;f&&Array.isArray(p)&&p.length&&(null===(g=p[0])||void 0===g?void 0:g.length)&&!Array.isArray(v)&&!Array.isArray(m)&&(u.doStroke=!1)}};FB=kB([y()],FB);let zB=class{constructor(){this.time=Ti.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,o,n,r,s,l,a,h,d,c){var u,g,p,f,v,m;const{lineDash:b=a.lineDash,stroke:y=a.stroke,strokeArrayColor:C=a.strokeArrayColor,strokeArrayWidth:w=a.strokeArrayWidth,lineWidth:x=a.lineWidth}=t.attribute;if(!y||!(Array.isArray(b)&&b.length&&(null===(u=b[0])||void 0===u?void 0:u.length))||Array.isArray(C)||Array.isArray(w))return;const _=t.stage.table;if(!_)return;const S=rt(b[0])?function(t){return 1===t.length?[t[0],t[0],t[0],t[0]]:2===t.length?[t[0],t[1],t[0],t[1]]:t}(b):[b,b,b,b];let A,B,{width:R=a.width,height:M=a.height}=t.attribute;if((null===(g=_.options.customConfig)||void 0===g?void 0:g._disableColumnAndRowSizeRound)?(R=Math.round(R),M=Math.round(M)):(R=Math.ceil(R),M=Math.ceil(M)),1&x){const e="bottom-right"===_.theme.cellBorderClipDirection,n=0,r=0;e?(i=Math.floor(i)-.5,o=Math.floor(o)-.5,"cell"===t.role&&(0===t.col&&(i+=1),0===t.row&&(o+=1))):(i=Math.floor(i)+.5,o=Math.floor(o)+.5);const{width:s,height:l}=VB(t,Math.ceil(R+n),Math.ceil(M+r),e);A=s,B=l}else A=Math.ceil(R),B=Math.ceil(M);e.setStrokeStyle(t,t.attribute,i,o,a),e.beginPath(),e.moveTo(i,o),e.lineTo(i+A,o),e.lineDashOffset=e.currentMatrix.e/e.currentMatrix.a,e.setLineDash(null!==(p=S[0])&&void 0!==p?p:[]),e.stroke(),e.beginPath(),e.moveTo(i+A,o),e.lineTo(i+A,o+B),e.lineDashOffset=e.currentMatrix.f/e.currentMatrix.d,e.setLineDash(null!==(f=S[1])&&void 0!==f?f:[]),e.stroke(),e.beginPath(),e.moveTo(i,o+B),e.lineTo(i+A,o+B),e.lineDashOffset=e.currentMatrix.e/e.currentMatrix.a,e.setLineDash(null!==(v=S[2])&&void 0!==v?v:[]),e.stroke(),e.beginPath(),e.moveTo(i,o),e.lineTo(i,o+B),e.lineDashOffset=e.currentMatrix.f/e.currentMatrix.d,e.setLineDash(null!==(m=S[3])&&void 0!==m?m:[]),e.stroke(),e.lineDashOffset=0,e.setLineDash([])}};zB=kB([y()],zB);let IB=class{constructor(){this.time=Ti.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,o,n,r,s,l,a,h,d,c,u){const{lineWidth:g=a.lineWidth,stroke:p=a.stroke,lineDash:f=a.lineDash,strokeArrayWidth:v=a.strokeArrayWidth,strokeArrayColor:m=a.strokeArrayColor,notAdjustPos:b}=t.attribute;!0!==b&&p&&Array.isArray(f)&&!f.length&&!Array.isArray(m)&&!Array.isArray(v)&&1&g&&(u.doStroke=!1)}};IB=kB([y()],IB);let OB=class{constructor(){this.time=Ti.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,o,n,r,s,l,a,h,d,c){var u,g;const{lineWidth:p=a.lineWidth,stroke:f=a.stroke,lineDash:v=a.lineDash,strokeArrayWidth:m=a.strokeArrayWidth,strokeArrayColor:b=a.strokeArrayColor,notAdjustPos:y,cornerRadius:C=a.cornerRadius}=t.attribute;let{width:w=a.width,height:x=a.height}=t.attribute;if(!0!==y&&f&&Array.isArray(v)&&!v.length&&!Array.isArray(b)&&!Array.isArray(m)&&1&p){const n=t.stage.table;if(!n)return;(null===(u=n.options.customConfig)||void 0===u?void 0:u._disableColumnAndRowSizeRound)&&(w=Math.round(w),x=Math.round(x)),e.beginPath();const r="bottom-right"===(null===(g=null==n?void 0:n.theme)||void 0===g?void 0:g.cellBorderClipDirection),s=0,l=0;r?(i=Math.floor(i)-.5,o=Math.floor(o)-.5,"cell"===t.role&&(0===t.col&&(i+=1),0===t.row&&(o+=1))):(i=Math.floor(i)+.5,o=Math.floor(o)+.5);const{width:h,height:d}=VB(t,Math.ceil(w),Math.ceil(x),r);C?Fl(e,i,o,h+s,d+l,C):e.rect(i,o,h,d),e.setStrokeStyle(t,t.attribute,i,o,a),e.stroke()}}};OB=kB([y()],OB);let DB=class{constructor(){this.time=Ti.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,o,n,r,s,l,a,h,d,c,u){if("cell"===t.role){const e=t.stage.table;if(e){const i=function(t,e){var i,o,n,r,s,l,a,h,d,c,u;let g,p;if("cell"===t.role&&Q(t.mergeStartCol)&&Q(t.mergeStartRow)&&Q(t.mergeEndCol)&&Q(t.mergeEndRow)){const{colStart:i,colEnd:o,rowStart:n,rowEnd:r}=PA(t,e.scenegraph);for(let t=i;t<=o;t++)for(let i=n;i<=r;i++){const o=MB(e.stateManager,t,i);!o||g&&"cellBgColor"!==o||(g=o)}}else"cell"===t.role&&(g=MB(e.stateManager,t.col,t.row));if(!g)return;const f=e.internalProps.layoutMap;return f.isCornerHeader(t.col,t.row)?p=(null===(i=e.theme.cornerHeaderStyle)||void 0===i?void 0:i.select)||(null===(o=e.theme.headerStyle)||void 0===o?void 0:o.select):f.isColumnHeader(t.col,t.row)?p=null===(n=e.theme.headerStyle)||void 0===n?void 0:n.select:f.isRowHeader(t.col,t.row)?p=null===(r=e.theme.rowHeaderStyle)||void 0===r?void 0:r.select:f.isBottomFrozenRow(t.col,t.row)?p=(null===(s=e.theme.bottomFrozenStyle)||void 0===s?void 0:s.select)||(e.isListTable()?null===(l=e.theme.bodyStyle)||void 0===l?void 0:l.select:null===(a=e.theme.headerStyle)||void 0===a?void 0:a.select):f.isRightFrozenColumn(t.col,t.row)?p=(null===(h=e.theme.rightFrozenStyle)||void 0===h?void 0:h.select)||(e.isListTable()?null===(d=e.theme.bodyStyle)||void 0===d?void 0:d.select:null===(c=e.theme.rowHeaderStyle)||void 0===c?void 0:c.select):e.isHeader(t.col,t.row)||(p=null===(u=e.theme.bodyStyle)||void 0===u?void 0:u.select),DS(g,p,t.col,t.row,e)}(t,e);if(i)t.attribute._vtableHightLightFill=i;else if(e.stateManager.interactionState!==IC.scrolling){const i=function(t,e){var i,o,n,r,s,l,a,h,d,c,u;let g,p;if("cell"===t.role&&Q(t.mergeStartCol)&&Q(t.mergeStartRow)&&Q(t.mergeEndCol)&&Q(t.mergeEndRow)){const{colStart:i,colEnd:o,rowStart:n,rowEnd:r}=PA(t,e.scenegraph);for(let s=i;s<=o;s++)for(let i=n;i<=r;i++){const o=RB(e.stateManager,s,i,t);!o||g&&"cellBgColor"!==o||(g=o)}}else"cell"===t.role&&(g=RB(e.stateManager,t.col,t.row,t));if(!g)return;const f=e.internalProps.layoutMap;return f.isCornerHeader(t.col,t.row)?p=(null===(i=e.theme.cornerHeaderStyle)||void 0===i?void 0:i.hover)||(null===(o=e.theme.headerStyle)||void 0===o?void 0:o.hover):f.isColumnHeader(t.col,t.row)?p=null===(n=e.theme.headerStyle)||void 0===n?void 0:n.hover:f.isRowHeader(t.col,t.row)?p=null===(r=e.theme.rowHeaderStyle)||void 0===r?void 0:r.hover:f.isBottomFrozenRow(t.col,t.row)?p=(null===(s=e.theme.bottomFrozenStyle)||void 0===s?void 0:s.hover)||(e.isListTable()?null===(l=e.theme.bodyStyle)||void 0===l?void 0:l.hover:null===(a=e.theme.headerStyle)||void 0===a?void 0:a.hover):f.isRightFrozenColumn(t.col,t.row)?p=(null===(h=e.theme.rightFrozenStyle)||void 0===h?void 0:h.hover)||(e.isListTable()?null===(d=e.theme.bodyStyle)||void 0===d?void 0:d.hover:null===(c=e.theme.rowHeaderStyle)||void 0===c?void 0:c.hover):e.isHeader(t.col,t.row)||(p=null===(u=e.theme.bodyStyle)||void 0===u?void 0:u.hover),DS(g,p,t.col,t.row,e)}(t,e);i&&(t.attribute._vtableHightLightFill=i)}}}}};DB=kB([y()],DB);let WB=class{constructor(){this.time=Ti.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,o,n,r,s,l,a,h,d,c){if(t.attribute._vtableHightLightFill)if(d);else if(s){const n=t.attribute.fill;t.attribute.fill=t.attribute._vtableHightLightFill,e.setCommonStyle(t,t.attribute,i,o,a),e.fill(),t.attribute.fill=n,t.attribute._vtableHightLightFill=void 0}}};WB=kB([y()],WB);let NB=class{constructor(){this.time=Ti.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,o,n,r,s,l,a,h,d,c,u){var g,p,f,v,m,b;const y=t.stage.table;y&&("body"===t.role?jB(e,-(null!==(g=t.attribute.x)&&void 0!==g?g:0)+y.getFrozenColsWidth(),-(null!==(p=t.attribute.y)&&void 0!==p?p:0)+y.getFrozenRowsHeight(),t.parent.attribute.width-y.getFrozenColsWidth()-y.getRightFrozenColsWidth(),t.parent.attribute.height-y.getFrozenRowsHeight()-y.getBottomFrozenRowsHeight()):"row-header"===t.role?jB(e,0,-(null!==(f=t.attribute.y)&&void 0!==f?f:0)+y.getFrozenRowsHeight(),y.getFrozenColsWidth(),t.parent.attribute.height-y.getFrozenRowsHeight()-y.getBottomFrozenRowsHeight()):"col-header"===t.role?jB(e,-(null!==(v=t.attribute.x)&&void 0!==v?v:0)+y.getFrozenColsWidth(),0,t.parent.attribute.width-y.getFrozenColsWidth()-y.getRightFrozenColsWidth(),y.getFrozenRowsHeight()):"right-frozen"===t.role?jB(e,0,-(null!==(m=t.attribute.y)&&void 0!==m?m:0)+y.getFrozenRowsHeight(),y.getRightFrozenColsWidth(),t.parent.attribute.height-y.getFrozenRowsHeight()-y.getBottomFrozenRowsHeight()):"bottom-frozen"===t.role?jB(e,-(null!==(b=t.attribute.x)&&void 0!==b?b:0)+y.getFrozenColsWidth(),0,t.parent.attribute.width-y.getFrozenColsWidth()-y.getRightFrozenColsWidth(),y.getBottomFrozenRowsHeight()):"corner-header"===t.role?jB(e,0,0,y.getFrozenColsWidth(),y.getFrozenRowsHeight()):"corner-right-top-header"===t.role?jB(e,0,0,y.getRightFrozenColsWidth(),y.getFrozenRowsHeight()):"corner-right-bottom-header"===t.role?jB(e,0,0,y.getRightFrozenColsWidth(),y.getBottomFrozenRowsHeight()):"corner-left-bottom-header"===t.role&&jB(e,0,0,y.getFrozenColsWidth(),y.getBottomFrozenRowsHeight()))}};NB=kB([y()],NB);const GB=Math.pow(2,24);function jB(t,e,i,o,n){t.beginPath();const r=t.applyedMatrix;Math.abs(r.f)>GB||Math.abs(r.g)>GB?t.rect(e-GB,i-GB,o+2*GB,n+2*GB):t.rect(e,i,o,n)}function VB(t,e,i,o){const n=t.stage.table;if(!n)return{width:e,height:i};if("cell"===t.role){let r=t.col,s=t.row;const l=Mx(n,r,s);l&&(r=l.end.col,s=l.end.row),r!==n.colCount-1||o?(r===n.frozenColCount-1&&n.scrollLeft&&!o||0===r&&o)&&(e-=1):e-=1,s!==n.rowCount-1||o?(s===n.frozenRowCount-1&&n.scrollTop&&!o||0===s&&o)&&(i-=1):i-=1}else"corner-frozen"===t.role&&(n.scrollLeft&&!o&&(e-=1),n.scrollTop&&!o&&(i-=1));return{width:e,height:i}}var UB=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s};let $B=class{constructor(){this.time=Ti.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,o,n,r,s,l,a,h,d,c,u){const{stroke:g=a.stroke,strokeArrayWidth:p=a.strokeArrayWidth,strokeArrayColor:f=a.strokeArrayColor}=t.attribute;g&&(Array.isArray(g)||Array.isArray(p)||Array.isArray(f))&&(u.doStroke=!1)}};$B=UB([y()],$B);let XB=class{constructor(){this.time=Ti.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,o,n,r,s,l,a,h,d,c){const{width:u=a.width,height:g=a.height,stroke:p=a.stroke,strokeArrayColor:f=a.strokeArrayColor,strokeArrayWidth:v=a.strokeArrayWidth,lineWidth:m=a.lineWidth,strokeColor:b=a.stroke,cornerRadius:y=a.cornerRadius}=t.attribute;if(p&&(Array.isArray(v)||0!==m)&&(Array.isArray(p)||Array.isArray(f)||Array.isArray(v))){const n=0,r=0;"border-rect"!==t.name&&"table-border-rect"!==t.name&&("number"==typeof m&&1&m||Array.isArray(v)&&v.some((t=>1&t)))&&(i=Math.floor(i)+.5,o=Math.floor(o)+.5),0===y||rt(y)&&y.every((t=>0===t))?HB(t,e,i,o,a,p,v||m,f||b,Math.ceil(u+n),Math.ceil(g+r)):(e.beginPath(),Fl(e,i,o,u,g,y,new Array(4).fill(0).map(((s,l)=>(s,h,d,c)=>{YB(l,s,h,d,c,t,e,i,o,a,p,v||m,f||b,Math.ceil(u+n),Math.ceil(g+r))}))),e.stroke())}}};function YB(t,e,i,o,n,r,s,l,a,h,d,c,u,g,p){var f,v,m,b;const y=r,C=h,w=EB(c),x=!Array.isArray(c),_=!Array.isArray(d),S=Array.isArray(u)||w.isSplitDraw;s.setStrokeStyle(r,r.attribute,l,a,h);const{lineDash:A=C.lineDash}=y.attribute;let B=!1;A.length&&A.some((t=>Array.isArray(t)))&&(B=!0),s.moveTo(l,a);const R=(_||d[0])&&(x||c[0]),M=(_||d[1])&&(x||c[1]),T=(_||d[2])&&(x||c[2]),k=(_||d[3])&&(x||c[3]);R&&0===t?(x?w.width:c[0],x?w.width:c[0],s.moveTo(e,i),s.lineTo(o,n),(S||B)&&(u&&u[0]?s.strokeStyle=u[0]:s.strokeStyle="transparent",x||(s.lineWidth=c[0]),s.lineDashOffset=s.currentMatrix.e/s.currentMatrix.a,B&&s.setLineDash(null!==(f=A[0])&&void 0!==f?f:[]),s.stroke(),s.beginPath())):0===t&&s.moveTo(l+g,a),M&&1===t?(x?w.width:c[1],x?w.width:c[1],s.moveTo(e,i),s.lineTo(o,n),(S||B)&&(u&&u[1]?s.strokeStyle=u[1]:s.strokeStyle="transparent",x||(s.lineWidth=c[1]),s.lineDashOffset=s.currentMatrix.f/s.currentMatrix.d,B&&s.setLineDash(null!==(v=A[1])&&void 0!==v?v:[]),s.stroke(),s.beginPath(),s.moveTo(l+g,a+p))):1===t&&s.moveTo(l+g,a+p),T&&2===t?(x?w.width:c[2],x?w.width:c[2],s.moveTo(e,i),s.lineTo(o,n),(S||B)&&(u&&u[2]?s.strokeStyle=u[2]:s.strokeStyle="transparent",x||(s.lineWidth=c[2]),s.lineDashOffset=s.currentMatrix.e/s.currentMatrix.a,B&&s.setLineDash(null!==(m=A[2])&&void 0!==m?m:[]),s.stroke(),s.beginPath(),s.moveTo(l,a+p))):2===t&&s.moveTo(l,a+p),k&&3===t?(x?w.width:c[3],x?w.width:c[3],s.moveTo(e,i),s.lineTo(o,n),(S||B)&&(u&&u[3]?s.strokeStyle=u[3]:s.strokeStyle="transparent",x||(s.lineWidth=c[3]),s.lineDashOffset=s.currentMatrix.f/s.currentMatrix.d,B&&s.setLineDash(null!==(b=A[3])&&void 0!==b?b:[]),s.stroke(),s.beginPath(),s.moveTo(l,a))):3===t&&s.moveTo(l,a),S||B||(!x&&w.width&&(s.lineWidth=w.width),s.stroke()),s.lineDashOffset=0,s.setLineDash([]),s.closePath()}XB=UB([y()],XB);var KB=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s};let qB,ZB=class{constructor(){this.order=1,this.interceptors=[new JB]}afterDrawItem(t,e,i,o,n){for(let r=0;r<this.interceptors.length;r++)if(this.interceptors[r].afterDrawItem&&this.interceptors[r].afterDrawItem(t,e,i,o,n))return!0;return!1}beforeDrawItem(t,e,i,o,n){if((!t.in3dMode||i.in3dInterceptor)&&!t.shadowRoot&&!(t.baseGraphic||t.attribute.globalZIndex||t.interactiveGraphic))return!1;for(let r=0;r<this.interceptors.length;r++)if(this.interceptors[r].beforeDrawItem&&this.interceptors[r].beforeDrawItem(t,e,i,o,n))return!0;return!1}};ZB=KB([y()],ZB);class JB{constructor(){this.order=1}afterDrawItem(t,e,i,o,n){return"image"===t.type&&this.drawItem(t,e,i,o,n),!1}drawItem(t,e,i,o,n){const{image:r}=t.attribute;if(!r||!t.resources)return!1;if("loading"!==t.resources.get(r).state)return!1;if(!qB){const t=FS(),e=t.loading_pic.svg,i=t.loading_pic.width,o=t.loading_pic.height;qB=cc({width:i,height:o,image:e})}const{image:s}=qB.attribute;if(!r||!qB.resources)return!1;const l=qB.resources.get(s);if("success"!==l.state)return!1;const{context:a}=i;a.highPerformanceSave(),t.parent&&a.setTransformFromMatrix(t.parent.globalTransMatrix,!0),t.glyphHost&&t.glyphHost.parent&&a.setTransformFromMatrix(t.glyphHost.parent.globalTransMatrix,!0);const h=t.AABBBounds,{width:d,height:c}=IS(l.data.width,l.data.height,h.width(),h.height());return a.drawImage(l.data,h.x1+(h.width()-d)/2,h.y1+(h.height()-c)/2,d,c),a.highPerformanceRestore(),!0}}var QB=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s};let tR=class{constructor(){this.time=Ti.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,o,n,r,s,l,a,h,d,c,u){var g,p;const{text:f,underline:v=a.underline,lineThrough:m=a.lineThrough,direction:b=a.direction,whiteSpace:y=a.whiteSpace,fontSize:C=a.fontSize,verticalMode:w=a.verticalMode,ellipsis:x=a.ellipsis,textAlign:_=a.textAlign,textBaseline:S=a.textBaseline,x:A=a.x,y:B=a.y}=t.attribute;let R=!1;if(Array.isArray(t)){const e=null===(g=t.cache)||void 0===g?void 0:g.layoutData;x&&e&&e.lines.every((t=>""===t.str))&&(R=!0)}else{const{cache:e}=t;x&&e&&""===e.clipedText&&0===e.clipedWidth&&(R=!0)}if(!R)return;const M=nt(x)?x:"...",T=null!==(p=ur(t.attribute.lineHeight,C))&&void 0!==p?p:C;let k=0;T!==C&&("top"===S?k=(T-C)/2:"middle"===S||"bottom"===S&&(k=-(T-C)/2)),r&&(c?c(e,t.attribute,a):l&&(e.setStrokeStyle(t,t.attribute,A-i,B-o,a),e.strokeText(M,A,B+k))),n&&(d?d(e,t.attribute,a):s&&(e.setCommonStyle(t,t.attribute,A-i,B-o,a),e.fillText(M,A,B+k),this.drawUnderLine(v,m,t,A,B+k,0,a,e,M)))}drawUnderLine(t,e,i,o,n,r,s,l,a){if(e+t<=0)return;const{textAlign:h=s.textAlign,textBaseline:d=s.textBaseline,fontSize:c=s.fontSize,fontFamily:u=s.fontFamily,fontWeight:g=s.fontWeight,fontStyle:p=s.fontStyle,fill:f=s.fill,opacity:v=s.opacity,underlineOffset:m=s.underlineOffset,underlineDash:b=s.underlineDash,fillOpacity:y=s.fillOpacity}=i.attribute;if(!t&&!e)return;const C=wA.measureTextWidth(a,{fontSize:c,fontFamily:u,fontWeight:g,fontStyle:p}),w=Js(h,C),x=Qs(d,c,c),_={lineWidth:0,stroke:f,opacity:v,strokeOpacity:y};if(t){_.lineWidth=t,l.setStrokeStyle(i,_,o,n,s),l.setLineDash(b),l.beginPath();const e=n+x+c+m;l.moveTo(o+w,e,r),l.lineTo(o+w+C,e,r),l.stroke()}if(e){_.lineWidth=e,l.setStrokeStyle(i,_,o,n,s),l.beginPath();const t=n+x+c/2;l.moveTo(o+w,t,r),l.lineTo(o+w+C,t,r),l.stroke()}}};tR=QB([y()],tR);var eR=new s(((t,e,i,o)=>{i(Ol)?o(Ol).to($B).inSingletonScope():(t($B).toSelf().inSingletonScope(),t(Ys).toService($B)),i(Dl)?o(Dl).to(XB).inSingletonScope():(t(XB).toSelf().inSingletonScope(),t(Ys).toService(XB)),t(_B).toSelf().inSingletonScope(),t(xB).to(_B),t(rh).to(_B),t(AB).toSelf().inSingletonScope(),t(Us).toService(AB),t(BB).toSelf().inSingletonScope(),t(Us).toService(BB),t(DB).toSelf().inSingletonScope(),t(Vs).toService(DB),t(WB).toSelf().inSingletonScope(),t(Vs).toService(WB),t(PB).toSelf().inSingletonScope(),t(Vs).toService(PB),t(LB).toSelf().inSingletonScope(),t(Vs).toService(LB),t(FB).toSelf().inSingletonScope(),t(Vs).toService(FB),t(zB).toSelf().inSingletonScope(),t(Vs).toService(zB),t(IB).toSelf().inSingletonScope(),t(Vs).toService(IB),t(OB).toSelf().inSingletonScope(),t(Vs).toService(OB),t(NB).toSelf().inSingletonScope(),t(Vs).toService(NB),t(ZB).toSelf().inSingletonScope(),t(yh).toService(ZB),t(tR).toSelf().inSingletonScope(),t(qs).toService(tR)}));function iR(t,e,i,o){var n,r,s,l,a,h,d,c;t.internalProps.columnWidthConfig&&t._parseColumnWidthConfig(t.internalProps.columnWidthConfig),e=null!=e?e:0,i=null!=i?i:t.colCount-1,0===e&&i===t.colCount-1&&t._clearColRangeWidthsMap();const u=t.internalProps.layoutMap;t.isPivotTable()&&(u.enableUseGetBodyCache(),u.enableUseHeaderPathCache());const g=[],p=[];if(o)for(let e=0;e<t.colCount;e++)g[e]=t.getColWidth(e);for(let a=e;a<=i;a++){let e;if(t.internalProps.transpose||"only-header"!==(null===(r=null===(n=t.internalProps.layoutMap.columnObjects)||void 0===n?void 0:n[a])||void 0===r?void 0:r.columnWidthComputeMode)&&"only-header"!==t.columnWidthComputeMode||!("showHeader"in t.internalProps.layoutMap))e=t.internalProps.transpose||"only-body"!==(null===(l=null===(s=t.internalProps.layoutMap.columnObjects)||void 0===s?void 0:s[a])||void 0===l?void 0:l.columnWidthComputeMode)&&"only-body"!==t.columnWidthComputeMode?oR(a,0,t.rowCount-1,t):oR(a,t.internalProps.layoutMap.getBodyRange().start.row,t.internalProps.layoutMap.getBodyRange().end.row,t);else{const i=t.internalProps.layoutMap.showHeader;t.internalProps.layoutMap.showHeader=!0,e=oR(a,0,t.internalProps.layoutMap.headerLevelCount-1,t),t.internalProps.layoutMap.showHeader=i}t._setColContentWidth(a,e),t.getColWidth(a)!==e&&t._clearColRangeWidthsMap(a),o?p[a]=Math.round(t._adjustColWidth(a,e)):t._setColWidth(a,t._adjustColWidth(a,e),!1,!0)}if("adaptive"===t.widthMode){t._clearColRangeWidthsMap();const e=t.tableNoFrameWidth;let i=0,n=0,r=t.colCount;if("only-body"===t.widthAdaptiveMode){for(let e=0;e<t.colCount;e++){const n=o&&null!==(a=p[e])&&void 0!==a?a:t.getColWidth(e);(e<t.rowHeaderLevelCount||t.isPivotChart()&&e>=t.colCount-t.rightFrozenColCount)&&(i+=n)}n=t.rowHeaderLevelCount,r=t.isPivotChart()?t.colCount-t.rightFrozenColCount:t.colCount}aR(e-i,n,r,o,p,t)}else if(t.autoFillWidth){t._clearColRangeWidthsMap();const e=t.tableNoFrameWidth;let i=0,n=0;for(let e=0;e<t.colCount;e++){const r=o&&null!==(h=p[e])&&void 0!==h?h:t.getColWidth(e);(e<t.rowHeaderLevelCount||t.isPivotChart()&&e>=t.colCount-t.rightFrozenColCount)&&(i+=r),n+=r}n<e&&n>i&&aR(e-i,t.rowHeaderLevelCount,t.isPivotChart()?t.colCount-t.rightFrozenColCount:t.colCount,o,p,t)}if(o){for(let e=0;e<t.colCount;e++){const i=null!==(c=null!==(d=p[e])&&void 0!==d?d:t.getColWidth(e))&&void 0!==c?c:t.getColWidth(e);i!==g[e]&&t._setColWidth(e,i,!1,!0)}t.stateManager.checkFrozen();for(let e=0;e<t.colCount;e++){const i=t.getColWidth(e);i!==g[e]&&t.scenegraph.updateColWidth(e,i-g[e],!0,!0)}t.scenegraph.updateContainer(!0)}t.isPivotTable()&&(u.disableUseGetBodyCache(),u.disableUseHeaderPathCache())}function oR(t,e,i,o){let n=arguments.length>4&&void 0!==arguments[4]&&arguments[4],r=function(t,e){const i=e.getColWidthDefined(t);return e.internalProps._widthResizedColMap.has(t)?e.getColWidth(t):i}(t,o);return o.internalProps.transpose&&"auto"===r&&("only-header"===o.columnWidthComputeMode&&t>=o.rowHeaderLevelCount||"only-body"===o.columnWidthComputeMode&&t<o.rowHeaderLevelCount)&&(r=o.getDefaultColumnWidth(t)),n&&!o.internalProps.transpose?nR(r,t,e,i,n,o):"number"==typeof r?r:"auto"!==r&&"string"==typeof r?o._adjustColWidth(t,o._colWidthDefineToPxWidth(r)):nR(r,t,e,i,n,o)}function nR(t,e,i,o,n,r){var s,l,a,h,d;let c=0,u=1,g=1;if(o-i>5e3&&(g=Math.ceil((o-i)/5e3)),r.isPivotChart()&&e>=r.rowHeaderLevelCount&&e<r.colCount-r.rightFrozenColCount){if(r.internalProps.layoutMap.indicatorsAsCol)return r.defaultColWidth;{const t=r.internalProps.layoutMap.getOptimunWidthForChart(e);if(t>0)return t}}for(let p=i;p<=o;p+=u){if(r.isPivotChart()){const t=r.internalProps.layoutMap,i=t.getAxisConfigInPivotChart(e,p);if(i){const t=Tx.getFunction("computeAxisComponentWidth")(i,r);if("number"==typeof t){c=Math.max(t,c);continue}}else if(t.isLeftBottomCorner(e,p)||t.isRightTopCorner(e,p)||t.isRightBottomCorner(e,p))continue}const i=rR(e,p,r);if(i&&(c=Math.max(i.width,c),!i.renderDefault))continue;const o=t;if("number"==typeof o&&"standard"===r.widthMode&&!n){c=Math.max(o,c);continue}const f=r.isHeader(e,p)?null===(s=r._getHeaderLayoutMap(e,p))||void 0===s?void 0:s.headerType:r.getBodyColumnType(e,p);if(Q(f)&&"text"!==f&&"link"!==f&&"progressbar"!==f&&"checkbox"!==f&&"radio"!==f){c=Math.max(c,r.getColWidthDefinedNumber(e)||0);continue}let v=0;const m=r.internalProps.layoutMap;if(m.isHeader(e,p)){const t=m.getHeader(e,p);if("only-body"===(null===(l=null==t?void 0:t.define)||void 0===l?void 0:l.columnWidthComputeMode))continue;Q(null==t?void 0:t.hierarchyLevel)&&(v=(null!==(a=t.hierarchyLevel)&&void 0!==a?a:0)*(null!==(h=m.rowHierarchyIndent)&&void 0!==h?h:0),m.rowHierarchyTextStartAlignment&&!r.internalProps.headerHelper.getHierarchyIcon(e,p)&&(v+=r.internalProps.headerHelper.getHierarchyIconWidth()))}else if(r.isListTable()){u=g;const t=r.getBodyColumnDefine(e,p);if(null==t?void 0:t.tree){const t=r.dataSource.getIndexKey(r.getRecordShowIndexByCell(e,p));v=Array.isArray(t)&&r.getHierarchyState(e,p)!==WC.none?(t.length-1)*(null!==(d=m.hierarchyIndent)&&void 0!==d?d:0):0,m.hierarchyTextStartAlignment&&!r.internalProps.bodyHelper.getHierarchyIcon(e,p)&&(v+=r.internalProps.headerHelper.getHierarchyIconWidth())}}const b=sR(e,p,f,r);c=Math.max(b+v,c),u>1&&r.bottomFrozenRowCount>0&&p<r.rowCount-r.bottomFrozenRowCount&&p+u>=r.rowCount-r.bottomFrozenRowCount&&(p=r.rowCount-r.bottomFrozenRowCount-u,u=1,g=1)}const p=r.getMinColWidth(e),f=r.getMaxColWidth(e);return c<p?p:c>f?f:(c<=0&&(c=r.defaultColWidth),c)}function rR(t,e,i){var o,n,r,s,l;const a=i.getCustomRender(t,e);let h=i.getCustomLayout(t,e);if(a||h){let d=1,c=0,u=!1,g=!1;if(i.isHeader(t,e)||(null===(o=i.getBodyColumnDefine(t,e))||void 0===o?void 0:o.mergeCell)||i.hasCustomMerge()){const o=i.getCellRange(t,e);d=o.end.col-o.start.col+1}const p={col:t,row:e,dataValue:i.getCellOriginValue(t,e),value:i.getCellValue(t,e)||"",rect:lR(t,e,i),table:i};if("react-custom-layout"===h&&(h=(null===(n=i.reactCustomLayout)||void 0===n?void 0:n.getCustomLayoutFunc(t,e))||$_),Z(h)){const t=h(p);if(t.rootContainer){t.rootContainer=nS(t.rootContainer),oS(t.rootContainer,0,i.getRowHeight(e));const o=t.rootContainer.attribute.width;t.rootContainer.setStage(i.scenegraph.stage),c=o>0?o:null!==(r=t.rootContainer.AABBBounds.width())&&void 0!==r?r:0,u=t.renderDefault,g=t.enableCellPadding}else c=0,u=t.renderDefault,g=t.enableCellPadding}else if("function"==typeof a){const t=a(p);c=null!==(s=null==t?void 0:t.expectedWidth)&&void 0!==s?s:0,u=null==t?void 0:t.renderDefault}else c=null!==(l=null==a?void 0:a.expectedWidth)&&void 0!==l?l:0,u=null==a?void 0:a.renderDefault;if(c=Math.ceil(c),g){const o=r_(DS("padding",i._getCellStyle(t,e),t,e,i));c+=o[1]+o[3]}return{width:c/d,renderDefault:u}}}function sR(t,e,i,o){var n,r,s;let l=0;const a=o.getCellValue(t,e),h=o._getCellStyle(t,e);let d=0,c=!1;if("body"!==o.getCellLocation(t,e))c=!0;else{const i=o.getBodyColumnDefine(t,e);c=!!(null==i?void 0:i.icon)||!!(null==i?void 0:i.tree)||(null==i?void 0:i.dragOrder)}if(c){const i=o.getCellIcons(t,e);null==i||i.forEach((t=>{var e,i,o;t.positionType!==jC.absoluteRight&&(d+=(null!==(e=t.width)&&void 0!==e?e:0)+(null!==(i=t.marginLeft)&&void 0!==i?i:0)+(null!==(o=t.marginRight)&&void 0!==o?o:0))}))}let u=1;if(o.isHeader(t,e)||(null===(n=o.getBodyColumnDefine(t,e))||void 0===n?void 0:n.mergeCell)||o.hasCustomMerge()){const i=o.getCellRange(t,e);u=i.end.col-i.start.col+1}const g=r_(DS("padding",h,t,e,o)),p=g[1]+g[3],f=DS("fontSize",h,t,e,o),v=DS("fontFamily",h,t,e,o),m=DS("fontWeight",h,t,e,o);let b;if("checkbox"===i)b=tt(a)?a.text:a;else if("radio"===i)if(rt(a)){b="";const i=o.getBodyColumnDefine(t,e),n=null!==(r=null==i?void 0:i.radioDirectionInCell)&&void 0!==r?r:"vertical";"vertical"===n?a.forEach((t=>{b+=(tt(t)?t.text:t).toString()+"\n"})):"horizontal"===n&&a.forEach((t=>{b+=(tt(t)?t.text:t).toString()}))}else b=tt(a)?a.text:a;else b=a;const y=VS(b,o).text;if(y.length>=1&&(1!==y.length||""!==y[0])?y.forEach((t=>{const e=o.measureText(t,{fontSize:f,fontFamily:v,fontWeight:m}).width;l=Math.max((e+p+4+d)/u,l)})):l=Math.max((p+4+d)/u,l),!1!==o.internalProps.limitMaxAutoWidth&&(l=Math.min("number"==typeof o.internalProps.limitMaxAutoWidth?o.internalProps.limitMaxAutoWidth:450,l)),"checkbox"===i){const i=DS("size",h,t,e,o);if(l+=i,b){const i=DS("spaceBetweenTextAndIcon",h,t,e,o);l+=i}}else if("radio"===i){const i=DS("size",h,t,e,o),n=DS("outerRadius",h,t,e,o),r=at(n)?2*n:i,d=DS("spaceBetweenTextAndIcon",h,t,e,o);if(rt(a)){const i=o.getBodyColumnDefine(t,e),n=DS("spaceBetweenRadio",h,t,e,o),c=null!==(s=null==i?void 0:i.radioDirectionInCell)&&void 0!==s?s:"vertical";"vertical"===c?(l+=r,l+=d):"horizontal"===c&&(l+=(r+d)*a.length,l+=n*(a.length-1))}else l+=r,b&&(l+=d)}return l}function lR(t,e,i){return{left:0,top:0,right:i.getColWidth(t),bottom:i.getRowHeight(e),width:null,height:null}}function aR(t,e,i,o,n,r,s){var l,a,h,d;let c=0;const u=[],g=[];let p=0;for(let s=e;s<i;s++){const e=o&&null!==(l=n[s])&&void 0!==l?l:r.getColWidth(s),i=r.getMaxColWidth(s),h=r.getMinColWidth(s);e!==i&&e!==h?(c+=e,u.push(s)):t-=e,(null===(a=r.options.customConfig)||void 0===a?void 0:a.shrinkSparklineFirst)&&"sparkline"===r.getBodyColumnType(s,0)&&(g.push({col:s,width:e}),p+=e-r.defaultColWidth)}const f=t/c;if((null===(h=r.options.customConfig)||void 0===h?void 0:h.shrinkSparklineFirst)&&f<1&&c-t<p)for(let e=0;e<g.length;e++){const{col:i,width:l}=g[e],a=(c-t)/g.length,h=Math.floor(l-a);o?n[i]=r._adjustColWidth(i,h):s?r.scenegraph.setColWidth(i,r._adjustColWidth(i,h)):r._setColWidth(i,r._adjustColWidth(i,h),!1,!0)}else for(let e=0;e<u.length;e++){const i=u[e];let l;l=e===u.length-1?t-u.reduce(((t,e,s)=>{var l;return e!==i?t+(o?null!==(l=n[e])&&void 0!==l?l:r.getColWidth(i):r.getColWidth(e)):t}),0):Math.round((o&&null!==(d=n[i])&&void 0!==d?d:r.getColWidth(i))*f),o?n[i]=r._adjustColWidth(i,l):s?r.scenegraph.setColWidth(i,r._adjustColWidth(i,l)):r._setColWidth(i,r._adjustColWidth(i,l),!1,!0)}}const hR=new zS({});function dR(t,e,i,o,n,r,s,l,a,h){let d,c,u,g=0;t.lastChild&&t.lastChild.row===o-1?g=t.lastChild.attribute.y+t.lastChild.attribute.height:t.colHeight&&(g=t.colHeight);for(let p=o;p<=n;p++){const n=p;let f,v,m,b,y=l.getCellValue(e,n),C=i,w=l.getRowHeight(n),x=!1;if(l.internalProps.customMergeCell){const t=l.getCustomMerge(e,n);if(t){const{range:e,text:i,style:s,customLayout:a,customRender:h}=t;if(f=e,v=f.start.col!==f.end.col||f.start.row!==f.end.row,v){const t=uR(f,r,l,o>f.start.row);C=t.cellWidth,w=t.cellHeight}y=i,m=s,(a||h)&&(b=eS(a,h,e.start.col,e.start.row,l.getColsWidth(e.start.col,e.end.col),l.getRowsHeight(e.start.row,e.end.row),!1,l.isAutoRowHeight(n),[0,0,0,0],f,l)),x=!0}}let _,S=e,A=n;f&&(S=f.start.col,A=f.start.row),!l.isPivotTable()&&("columnHeader"===a||"cornerHeader"===a)&&n>=l.columnHeaderLevelCount&&(a="body"),_=!l.isPivotTable()&&l.isSeriesNumberInBody(e,n)?l.getBodyColumnDefine(S,A):"body"!==a?l.getHeaderDefine(S,A):l.getBodyColumnDefine(S,A);let B="body"!==a||(null==_?void 0:_.dragOrder)||!!(null==_?void 0:_.icon)||!!(null==_?void 0:_.tree);if(!f&&(l.internalProps.enableTreeNodeMerge||"body"!==a||(null==_?void 0:_.mergeCell))&&(f=l.getCellRange(e,n),v=f.start.col!==f.end.col||f.start.row!==f.end.row,v)){const t=uR(f,r,l,o>f.start.row);C=t.cellWidth,w=t.cellHeight}let R=!1;if(l.internalProps.enableTreeNodeMerge&&v){const t=l.getCellRawRecord(f.start.col,f.start.row),{vtableMergeName:e,vtableMerge:i}=null!=t?t:{};R=i,i&&(B=!0,l.options.groupTitleCustomLayout&&(b=eS(l.options.groupTitleCustomLayout,void 0,f.start.col,f.start.row,l.getColsWidth(f.start.col,f.end.col),l.getRowsHeight(f.start.row,f.end.row),!1,l.isAutoRowHeight(n),[0,0,0,0],f,l))),e&&(y=e)}const M=R||x?"text":(l.isHeader(e,n)?l._getHeaderLayoutMap(e,n).headerType:l.getBodyColumnType(e,n))||"text";if(Fw(y)){gR(e,n,0,g,C,w,t),nA(y,l,cR.bind(null,{type:M,value:y,define:_,table:l,col:e,row:n,colWidth:i,cellWidth:C,cellHeight:w,columnGroup:t,y:g,customStyle:m,mayHaveIcon:B,cellLocation:a,range:f,customResult:b,defaultRowHeight:s})),t.updateColumnRowNumber(n);const o=l.getRowHeight(n);t.updateColumnHeight(o),g+=o}else{const o=G_(m||l._getCellStyle(f?f.start.col:e,f?f.start.row:n),l,f?f.start.col:e,f?f.start.row:n,DS).theme;o.group.cornerRadius=j_(e,n,l),o.group.width=i,o.group.height=Array.isArray(s)?s[n]:s,o._vtable.padding&&(d=o._vtable.padding),o.text.textAlign&&(c=o.text.textAlign),o.text.textBaseline&&(u=o.text.textBaseline),"body"===a||o.group.fill||(o.group.fill="#fff");const r=rA(M,y,_,l,e,n,i,C,w,t,g,d,c,u,B,o,f,b);if(t.updateColumnRowNumber(n),v){const i=l.getRowHeight(n),{width:o}=(l.getColWidth(e),r.attribute),{height:s}=r.attribute;r.contentWidth=o,r.contentHeight=s,hA(f,o,s,d,c,u,l),t.updateColumnHeight(i),g+=i}else t.updateColumnHeight(w),g+=w}if(h&&n>h)break}return t.setAttribute("width",i),{width:i,height:g}}function cR(t){let e,i,o;const{type:n,value:r,define:s,table:l,col:a,row:h,colWidth:d,cellWidth:c,cellHeight:u,columnGroup:g,y:p,cellLocation:f,mayHaveIcon:v,customStyle:m,range:b,customResult:y,defaultRowHeight:C}=t,w=G_(m||l._getCellStyle(b?b.start.col:a,b?b.start.row:h),l,b?b.start.col:a,b?b.start.row:h,DS).theme;w.group.cornerRadius=j_(a,h,l),w.group.width=d,w.group.height=Array.isArray(C)?C[h]:C,w._vtable.padding&&(e=w._vtable.padding),w.text.textAlign&&(i=w.text.textAlign),w.text.textBaseline&&(o=w.text.textBaseline),"body"===f||w.group.fill||(w.group.fill="#fff"),rA(n,r,s,l,a,h,d,c,u,g,p,e,i,o,v,w,b,y)}function uR(t,e,i,o){let n=0,r=0;const s=e.get(`${t.start.col},${t.start.row};${t.end.col},${t.end.row}`);if(!s||o){for(let e=t.start.col;e<=t.end.col;e++)n+=i.getColWidth(e);for(let e=t.start.row;e<=t.end.row;e++)r+=i.getRowHeight(e);e.set(`${t.start.col},${t.start.row};${t.end.col},${t.end.row}`,{cellWidth:n,cellHeight:r})}else n=s.cellWidth,r=s.cellHeight;return{cellWidth:n,cellHeight:r}}function gR(t,e,i,o,n,r,s){const l=new zS({x:i,y:o,width:n,height:r});l.role="cell",l.col=t,l.row=e,s.addChild(l)}function pR(t,e,i,o,n,r,s,l,a,h){if(o>n||r>s)return;const{layoutMap:d,defaultRowHeight:c,defaultHeaderRowHeight:u,defaultColWidth:g}=a.internalProps;let p=0,f=0;for(let d=o;d<=n;d++){const o=d,n=a.getColWidth(o),g=new zS({x:e+p,y:i,width:n,height:0,clip:!1,pickable:!1});g.role="column",g.col=d,t.addChild(g);const{width:v,height:m}=dR(g,o,n,r,s,a.scenegraph.mergeMap,"columnHeader"===l&&at(u)?u:c,a,l,h);p+=v,f=Math.max(f,m)}t.setAttribute("width",p),t.setAttribute("height",f)}function fR(t){let e=t.firstChild;for(;"group"!==e.type;)e=e._next;return e}function vR(t){let e=t.lastChild;for(;"group"!==e.type;)e=e._prev;return e}function mR(t,e,i){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"left";for(let n=t;n<=e;n++){const t=i.scenegraph.getColGroup(n);t&&bR(t,i,o);const e=i.scenegraph.getColGroup(n,!0);e&&bR(e,i,o);const r=i.scenegraph.getColGroupInBottom(n);r&&bR(r,i,o)}const n=Math.min(i.scenegraph.proxy.colLimit,i.scenegraph.proxy.bodyRightCol-i.scenegraph.proxy.bodyLeftCol+1),r=i.getColsWidth(i.frozenColCount,i.frozenColCount+n),s=i.getColsWidth(i.frozenColCount,i.colCount-1);i.scenegraph.proxy.xLimitLeft=r/2,i.scenegraph.proxy.xLimitRight=s-r/2}function bR(t,e){if("left"===(arguments.length>2&&void 0!==arguments[2]?arguments[2]:"left")){let i;const o=function(t){let e=t._prev;for(;e&&"group"!==e.type;)e=e._prev;return e}(t);i=o?o.attribute.x+e.getColWidth(t._prev.col):e.getColsWidth(e.frozenColCount,t.col-1),t.setAttribute("x",i)}else{let i;const o=function(t){let e=t._next;for(;e&&"group"!==e.type;)e=e._next;return e}(t);i=o?o.attribute.x-e.getColWidth(t.col):e.getColsWidth(e.frozenColCount,t.col-1),t.setAttribute("x",i)}}hR.role="empty";var yR=function(t,e,i,o){return new(i||(i=Promise))((function(n,r){function s(t){try{a(o.next(t))}catch(t){r(t)}}function l(t){try{a(o.throw(t))}catch(t){r(t)}}function a(t){var e;t.done?n(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(s,l)}a((o=o.apply(t,e||[])).next())}))};function CR(t,e,i,o){return yR(this,void 0,void 0,(function*(){if(!e)return;const n=e.col,r=e.left;let s;if(s=i?o.bodyRightCol-o.colEnd:o.screenLeftCol-o.referenceCol,function(t,e,i,o,n){t>0?(wR(t,"left",n.screenLeftCol,i,o,n),n.updateDeltaX(o,i,e),n.table.scenegraph.setBodyAndColHeaderX(-o+n.deltaX)):t<0?(wR(-t,"right",n.screenLeftCol,i,o,n),n.updateDeltaX(o,i,e),n.table.scenegraph.setBodyAndColHeaderX(-o+n.deltaX)):(n.updateDeltaX(o,i,e),n.table.scenegraph.setBodyAndColHeaderX(-o+n.deltaX))}(s,n,r,t,o),i){const e=o.table.scenegraph.getColGroup(o.colEnd);if(e){const i=e.attribute.x+e.attribute.width-(o.table.tableNoFrameWidth-o.table.getFrozenColsWidth()-o.table.getRightFrozenColsWidth())-t;o.deltaX=-i,o.table.scenegraph.setBodyAndColHeaderX(-t+o.deltaX)}}o.table.scenegraph.updateNextFrame()}))}function wR(t,e,i,o,n,r){return yR(this,void 0,void 0,(function*(){if("left"===e&&r.colEnd+t>r.bodyRightCol?t=r.bodyRightCol-r.colEnd:"right"===e&&r.colStart-t<r.bodyLeftCol&&(t=r.colStart-r.bodyLeftCol),0!==t)if(t<0&&(e="left"===e?"right":"left",t=-t),t<r.colEnd-r.colStart){const n="left"===e?r.colStart:r.colEnd-t+1,s="left"===e?r.colStart+t-1:r.colEnd,l="left"===e?r.colEnd+1:r.colStart-t,a="left"===e?r.colEnd+t:r.colStart-1;iR(r.table,l,a),function(t,e,i,o){for(let n=t;n<=e;n++)o.table.scenegraph.bodyGroup.childrenCount>0&&"group"===o.table.scenegraph.bodyGroup.firstChild.type&&AR(o.table.scenegraph.bodyGroup,i,o),o.table.scenegraph.colHeaderGroup.childrenCount>0&&"group"===o.table.scenegraph.colHeaderGroup.firstChild.type&&AR(o.table.scenegraph.colHeaderGroup,i,o),o.table.scenegraph.bottomFrozenGroup.childrenCount>0&&"group"===o.table.scenegraph.bottomFrozenGroup.firstChild.type&&AR(o.table.scenegraph.bottomFrozenGroup,i,o)}(n,s,e,r);const h=l,d=a;r.colStart="left"===e?r.colStart+t:r.colStart-t,r.colEnd="left"===e?r.colEnd+t:r.colEnd-t,BR(h,d,r),mR(h,d,r.table,e);const c=r.table.scenegraph.getColGroup(i)||r.table.scenegraph.getColGroup(i,!0),u=o-(c.attribute.x+r.table.getFrozenColsWidth()+r.table.scenegraph.proxy.deltaX);r.table.scenegraph.proxy.deltaX+=u,r.currentCol="left"===e?r.currentCol+t:r.currentCol-t,r.totalCol=Math.max(0,Math.min(r.table.colCount-1,"left"===e?r.totalCol+t:r.totalCol-t)),r.referenceCol=r.colStart+Math.floor((r.colEnd-r.colStart)/2),r.colUpdatePos=l,r.colUpdateDirection=e,r.table.scenegraph.updateNextFrame()}else{const i="left"===e?r.colStart+t:r.colStart-t,o="left"===e?r.colEnd+t:r.colEnd-t;iR(r.table,i,o),function(t,e,i,o){o.table.scenegraph.colHeaderGroup.forEachChildren(((n,r)=>{"group"===n.type&&xR(n,"left"===i?n.col+e:n.col-e,0===r?t:n._prev.attribute.x+o.table.getColWidth(n._prev.col))})),o.table.scenegraph.bottomFrozenGroup.forEachChildren(((n,r)=>{"group"===n.type&&xR(n,"left"===i?n.col+e:n.col-e,0===r?t:n._prev.attribute.x+o.table.getColWidth(n._prev.col))})),o.table.scenegraph.bodyGroup.forEachChildren(((n,r)=>{"group"===n.type&&xR(n,"left"===i?n.col+e:n.col-e,0===r?t:n._prev.attribute.x+o.table.getColWidth(n._prev.col))}))}(r.table.getColsWidth(r.bodyLeftCol,i-1),t,e,r);const n=i,s=o;r.colStart=i,r.colEnd=o,BR(n,s,r),mR(n,s,r.table,o>r.bodyRightCol-(r.colEnd-r.colStart+1)?"right":"left"),r.currentCol="left"===e?r.currentCol+t:r.currentCol-t,r.totalCol=Math.max(0,Math.min(r.table.colCount-1,"left"===e?r.totalCol+t:r.totalCol-t)),r.referenceCol=r.colStart+Math.floor((r.colEnd-r.colStart)/2),r.colUpdatePos=r.colStart,r.colUpdateDirection=o>r.bodyRightCol-(r.colEnd-r.colStart+1)?"right":"left",r.table.scenegraph.updateNextFrame()}}))}function xR(t,e,i){t.col=e,t.forEachChildren((t=>{t.col=e,t.needUpdate=!0})),t.setAttribute("x",i),t.needUpdate=!0}function _R(t,e){if(!t)return;let i=t.firstChild;for(;i;)i=e.updateCellGroupContent(i)._next;t.needUpdate=!1,t.setAttribute("width",e.table.getColWidth(t.col))}function SR(t,e){if(!t)return;const i=e.screenTopRow,o=Math.max(e.bodyTopRow,i-1*e.screenRowCount),n=Math.min(e.bodyBottomRow,i+2*e.screenRowCount,e.table.rowCount-1);for(let i=o;i<=n;i++){const o=e.highPerformanceGetCell(t.col,i,!0);e.updateCellGroupContent(o)}e.rowUpdatePos=e.rowStart,t.needUpdate=!1,t.setAttribute("width",e.table.getColWidth(t.col))}function AR(t,e,i){if("left"===e){const e=fR(t),o=vR(t);xR(e,o.col+1,o.attribute.x+i.table.getColWidth(o.col)),t.appendChild(e),t.border&&t.appendChild(t.border)}else{const e=vR(t),o=fR(t);xR(e,o.col-1,o.attribute.x-i.table.getColWidth(o.col-1)),t.insertBefore(e,t.firstChild)}}function BR(t,e,i){for(let o=t;o<=e;o++){const t=i.table.scenegraph.getColGroup(o,!0);t&&_R(t,i);const e=i.table.scenegraph.getColGroupInBottom(o);e&&_R(e,i);const n=i.table.scenegraph.getColGroupInRightTopCorner(o);n&&_R(n,i);const r=i.table.scenegraph.getColGroupInRightBottomCorner(o);r&&_R(r,i);const s=i.table.scenegraph.getColGroup(o);s&&SR(s,i)}i.progress()}function RR(t,e,i,o,n){let r=arguments.length>6?arguments[6]:void 0;var s,l;if("up"===(arguments.length>5&&void 0!==arguments[5]?arguments[5]:"up"))for(let l=t;l<=e;l++)for(let t=i;t<=o;t++){const e=n.scenegraph.highPerformanceGetCell(l,t,!0);if("cell"!==e.role||!e.row)continue;let i;if(e._prev)i=(null===(s=e._prev)||void 0===s?void 0:s.attribute.y)+n.getRowHeight(e._prev.row);else if(r){if(i=n.scenegraph.highPerformanceGetCell(l,o+1,!0).attribute.y,Q(i))for(let e=t;e<=o;e++)i-=n.getRowHeight(e)}else i=MR(e.row,n);Q(i)&&e.setAttribute("y",i)}else for(let s=t;s<=e;s++)for(let t=o;t>=i;t--){const e=n.scenegraph.highPerformanceGetCell(s,t,!0);if("cell"!==e.role||!e.row)continue;let o;if(e._next)o=(null===(l=e._next)||void 0===l?void 0:l.attribute.y)-n.getRowHeight(e.row);else if(r){o=n.scenegraph.highPerformanceGetCell(s,i-1,!0).attribute.y;for(let e=i-1;e<t;e++)o+=n.getRowHeight(e)}else o=MR(e.row,n);Q(o)&&e.setAttribute("y",o)}const a=Math.min(n.scenegraph.proxy.rowLimit,n.scenegraph.proxy.bodyBottomRow-n.scenegraph.proxy.bodyTopRow+1),h=n.getRowsHeight(n.frozenRowCount,n.frozenRowCount+a),d=n.getRowsHeight(n.frozenRowCount,n.rowCount-1);n.scenegraph.proxy.yLimitTop=h/2,n.scenegraph.proxy.yLimitBottom=d-h/2}function MR(t,e){let i;return i=t<e.frozenRowCount?e.getRowsHeight(0,t-1):t>=e.rowCount-e.bottomFrozenRowCount?e.getRowsHeight(e.rowCount-e.bottomFrozenRowCount,t-1):e.getRowsHeight(e.frozenRowCount,t-1),i}var TR=function(t,e,i,o){return new(i||(i=Promise))((function(n,r){function s(t){try{a(o.next(t))}catch(t){r(t)}}function l(t){try{a(o.throw(t))}catch(t){r(t)}}function a(t){var e;t.done?n(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(s,l)}a((o=o.apply(t,e||[])).next())}))};function kR(t,e,i,o){return TR(this,void 0,void 0,(function*(){if(!e)return;const n=e.row,r=e.top;let s;if(s=i?o.bodyBottomRow-o.rowEnd:n-o.referenceRow,function(t,e,i,o,n){t>0?(LR(t,"up",e,i,o,n),n.updateDeltaY(o,i,e),n.updateBody(o-n.deltaY)):t<0?(LR(-t,"down",e,i,o,n),n.updateDeltaY(o,i,e),n.updateBody(o-n.deltaY)):(n.updateDeltaY(o,i,e),n.updateBody(o-n.deltaY))}(s,n,r,t,o),i){const e=o.table.scenegraph.highPerformanceGetCell(o.colStart,o.rowEnd,!0);if("cell"===e.role){const i=e.attribute.y+e.attribute.height-(o.table.tableNoFrameHeight-o.table.getFrozenRowsHeight()-o.table.getBottomFrozenRowsHeight())-t;o.deltaY=-i,o.updateBody(t-o.deltaY)}}}))}function LR(t,e,i,o,n,r){return TR(this,void 0,void 0,(function*(){if("up"===e&&r.rowEnd+t>r.bodyBottomRow?t=r.bodyBottomRow-r.rowEnd:"down"===e&&r.rowStart-t<r.bodyTopRow&&(t=r.rowStart-r.bodyTopRow),0!==t)if(t<0&&(e="up"===e?"down":"up",t=-t),t<r.rowEnd-r.rowStart){const o="up"===e?r.rowStart:r.rowEnd-t+1,n="up"===e?r.rowStart+t-1:r.rowEnd,s="up"===e?r.rowEnd+1:r.rowStart-t,l="up"===e?r.rowEnd+t:r.rowStart-1;let a,h;"autoHeight"===r.table.heightMode?(a=s,h=l):(a=Math.max(r.bodyTopRow,i-1*r.screenRowCount),h=Math.min(r.bodyBottomRow,i+2*r.screenRowCount,r.table.rowCount-1)),AA(r.table,a,h,!1),function(t,e,i,o){for(let n=0;n<o.table.frozenColCount;n++){const r=o.table.scenegraph.getColGroup(n);if(r)for(let n=t;n<=e;n++)PR(r,i,o)}for(let n=o.table.colCount-o.table.rightFrozenColCount;n<o.table.colCount;n++){const r=o.table.scenegraph.getColGroup(n);if(r)for(let n=t;n<=e;n++)PR(r,i,o)}for(let n=o.bodyLeftCol;n<=o.bodyRightCol;n++){const r=o.table.scenegraph.getColGroup(n);if(r)for(let n=t;n<=e;n++)PR(r,i,o)}}(o,n,e,r),r.rowStart="up"===e?r.rowStart+t:r.rowStart-t,r.rowEnd="up"===e?r.rowEnd+t:r.rowEnd-t;const d=ER(a,h,r,!0);"autoHeight"===r.table.heightMode&&(RR(r.bodyLeftCol,r.bodyRightCol,a,h,r.table,l>r.bodyBottomRow-(r.rowEnd-r.rowStart+1)?"down":"up",!0),RR(0,r.table.frozenColCount-1,a,h,r.table,l>r.bodyBottomRow-(r.rowEnd-r.rowStart+1)?"down":"up",!0),RR(r.table.colCount-r.table.rightFrozenColCount,r.table.colCount-1,a,h,r.table,l>r.bodyBottomRow-(r.rowEnd-r.rowStart+1)?"down":"up",!0)),r.currentRow="up"===e?r.currentRow+t:r.currentRow-t,r.totalRow=Math.max(0,Math.min(r.bodyBottomRow,"up"===e?r.totalRow+t:r.totalRow-t,r.table.rowCount-1)),r.referenceRow=r.rowStart+Math.floor((r.rowEnd-r.rowStart)/2),"autoHeight"===r.table.heightMode&&d?r.rowUpdatePos=Math.min(r.rowUpdatePos,r.rowEnd+1):r.rowUpdatePos=Math.min(r.rowUpdatePos,s),r.rowUpdateDirection=e,r.table.scenegraph.updateNextFrame(),yield r.progress()}else{const o="up"===e?r.rowStart+t:r.rowStart-t,n=Math.min(r.table.rowCount-1,"up"===e?r.rowEnd+t:r.rowEnd-t),s=r.table.getRowsHeight(r.bodyTopRow,o-1);let l,a;"autoHeight"===r.table.heightMode?(l=o,a=n):(l=Math.max(r.bodyTopRow,i-1*r.screenRowCount),a=Math.min(r.bodyBottomRow,i+2*r.screenRowCount,r.table.rowCount-1)),AA(r.table,l,a,!1),function(t,e,i,o){for(let n=0;n<o.table.frozenColCount;n++){const r=o.table.scenegraph.getColGroup(n);null==r||r.forEachChildren(((n,r)=>{o.updateCellGroupPosition(n,"up"===i?n.row+e:n.row-e,0===r?t:n._prev.attribute.y+o.table.getRowHeight(n._prev.row))}))}for(let n=o.table.colCount-o.table.rightFrozenColCount;n<o.table.colCount;n++){const r=o.table.scenegraph.getColGroup(n);null==r||r.forEachChildren(((n,r)=>{o.updateCellGroupPosition(n,"up"===i?n.row+e:n.row-e,0===r?t:n._prev.attribute.y+o.table.getRowHeight(n._prev.row))}))}for(let n=o.bodyLeftCol;n<=o.bodyRightCol;n++){const r=o.table.scenegraph.getColGroup(n);null==r||r.forEachChildren(((n,r)=>{o.updateCellGroupPosition(n,"up"===i?n.row+e:n.row-e,0===r?t:n._prev.attribute.y+o.table.getRowHeight(n._prev.row))}))}}(s,t,e,r),r.rowStart=o,r.rowEnd=n;const h=ER(l,a,r,!0);"autoHeight"===r.table.heightMode&&(RR(r.bodyLeftCol,r.bodyRightCol,l,a,r.table,n>r.bodyBottomRow-(r.rowEnd-r.rowStart+1)?"down":"up"),RR(0,r.table.frozenColCount-1,l,a,r.table,n>r.bodyBottomRow-(r.rowEnd-r.rowStart+1)?"down":"up"),RR(r.table.colCount-r.table.rightFrozenColCount,r.table.colCount-1,l,a,r.table,n>r.bodyBottomRow-(r.rowEnd-r.rowStart+1)?"down":"up")),r.currentRow="up"===e?r.currentRow+t:r.currentRow-t,r.totalRow=Math.max(0,Math.min(r.bodyBottomRow,"up"===e?r.totalRow+t:r.totalRow-t,r.table.rowCount-1)),r.referenceRow=r.rowStart+Math.floor((r.rowEnd-r.rowStart)/2),"autoHeight"===r.table.heightMode&&h?r.rowUpdatePos=r.rowEnd+1:r.rowUpdatePos=r.rowStart,r.rowUpdateDirection=n>r.bodyBottomRow-(r.rowEnd-r.rowStart+1)?"down":"up",r.table.scenegraph.updateNextFrame(),yield r.progress()}}))}function PR(t,e,i){if(t.childrenCount>=1)if("up"===e){const e=t.firstChild;i.updateCellGroupPosition(e,t.lastChild.row+1,t.lastChild.attribute.y+i.table.getRowHeight(t.lastChild.row)),t.appendChild(e)}else{const e=t.lastChild;i.updateCellGroupPosition(e,t.firstChild.row-1,t.firstChild.attribute.y-i.table.getRowHeight(e.row)),t.insertBefore(e,t.firstChild)}}function ER(t,e,i){let o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];for(let o=0;o<i.table.frozenColCount;o++)for(let n=t;n<=e;n++){const t=i.highPerformanceGetCell(o,n,!0);i.updateCellGroupContent(t)}for(let o=i.table.colCount-i.table.rightFrozenColCount;o<i.table.colCount;o++)for(let n=t;n<=e;n++){const t=i.highPerformanceGetCell(o,n);i.updateCellGroupContent(t)}let n=i.bodyLeftCol,r=i.bodyRightCol,s=!0;if(o){const t=i.screenLeftCol;n=Math.max(i.bodyLeftCol,t-1*i.screenColCount),r=Math.min(i.bodyRightCol,t+2*i.screenColCount),n===i.bodyLeftCol&&r===i.bodyRightCol||(s=!1)}for(let o=n;o<=r;o++)for(let n=t;n<=e;n++){const t=i.highPerformanceGetCell(o,n);i.updateCellGroupContent(t)}return i.table.scenegraph.updateNextFrame(),s}var HR=function(t,e,i,o){return new(i||(i=Promise))((function(n,r){function s(t){try{a(o.next(t))}catch(t){r(t)}}function l(t){try{a(o.throw(t))}catch(t){r(t)}}function a(t){var e;t.done?n(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(s,l)}a((o=o.apply(t,e||[])).next())}))};var FR=function(t,e,i,o){return new(i||(i=Promise))((function(n,r){function s(t){try{a(o.next(t))}catch(t){r(t)}}function l(t){try{a(o.throw(t))}catch(t){r(t)}}function a(t){var e;t.done?n(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(s,l)}a((o=o.apply(t,e||[])).next())}))};function zR(t){const{changedCells:e}=t.internalProps.stick;e.forEach((e=>{t.scenegraph.getCell(e.col,e.row).forEachChildren((t=>{t.setAttributes({dx:e.dx,dy:e.dy})}))})),e.clear();const{scrollTop:i,scrollLeft:o,frozenRowCount:n,frozenColCount:r}=t,s=t.getFrozenRowsHeight(),l=t.getFrozenColsWidth(),{row:a}=t.getRowAt(i+s+1),{col:h}=t.getColAt(o+l+1),d=Math.max(a,t.frozenRowCount),c=Math.max(h,t.frozenColCount),u=t.getAllRowsHeight()>t.tableNoFrameHeight?t.getRowAt(i+t.tableNoFrameHeight-t.getBottomFrozenRowsHeight()-1).row:t.rowCount-t.bottomFrozenRowCount-1,g=t.getAllColsWidth()>t.tableNoFrameWidth?t.getColAt(o+t.tableNoFrameWidth-t.getRightFrozenColsWidth()-1).col:t.colCount-t.rightFrozenColCount-1;if(!(g<0||u<0)){for(let i=0;i<n&&!(g<c);i++)[c,g].forEach((o=>{const n=t._getCellStyle(o,i);(null==n?void 0:n.textStick)&&"vertical"!==(null==n?void 0:n.textStick)&&DR(t.scenegraph.getCell(o,i),l+t.tableX,t.tableNoFrameWidth-t.getRightFrozenColsWidth()+t.tableX,e,null==n?void 0:n.textStickBaseOnAlign,t)}));for(let i=0;i<r&&!(u<d);i++)[d,u].forEach((o=>{const n=t._getCellStyle(i,o);(null==n?void 0:n.textStick)&&"tree"!==t.internalProps.layoutMap.rowHierarchyType&&"horizontal"!==(null==n?void 0:n.textStick)&&IR(t.scenegraph.getCell(i,o),s+t.tableY,t.tableNoFrameHeight-t.getBottomFrozenRowsHeight()+t.tableY,e,null==n?void 0:n.textStickBaseOnAlign,t)}));for(let i=c;i<=g&&!(u<d);i++)[d,u].forEach((o=>{const n=t._getCellStyle(i,o);(null==n?void 0:n.textStick)&&"horizontal"!==(null==n?void 0:n.textStick)&&IR(t.scenegraph.getCell(i,o),s+t.tableY,t.tableNoFrameHeight-t.getBottomFrozenRowsHeight()+t.tableY,e,null==n?void 0:n.textStickBaseOnAlign,t)}));for(let i=d;i<=u&&!(g<c);i++)[c,g].forEach((o=>{const n=t._getCellStyle(o,i);(null==n?void 0:n.textStick)&&"vertical"!==(null==n?void 0:n.textStick)&&DR(t.scenegraph.getCell(o,i),l+t.tableX,t.tableNoFrameWidth-t.getRightFrozenColsWidth()+t.tableX,e,null==n?void 0:n.textStickBaseOnAlign,t)}))}}function IR(t,e,i,o,n,r){if(at(t.mergeStartCol)&&at(t.mergeStartRow)&&at(t.mergeEndCol)&&at(t.mergeEndRow)){const{colStart:s,colEnd:l,rowStart:a,rowEnd:h}=PA(t,r.scenegraph);for(let t=s;t<=l;t++)for(let s=a;s<=h;s++)OR(r.scenegraph.getCell(t,s),e,i,o,n)}else OR(t,e,i,o,n)}function OR(t,e,i,o,n){var r,s,l,a,h,d,c,u,g,p,f,v,m,b,y,C,w;const x=t.getChildByName("text",!0)||t.getChildByName("image",!0);if(!x)return;if("image"===x.type){const{image:t}=x.attribute;if(!t||!x.resources)return;if("success"!==x.resources.get(t).state)return}const _=null!==(r=x.textBaseline)&&void 0!==r?r:"top";x.AABBBounds.width();const S=x.globalAABBBounds.y1,A=x.globalAABBBounds.y2;if("middle"===_&&n){const n=t.globalAABBBounds.y1+(null!==(l=null===(s=t.firstChild)||void 0===s?void 0:s.attribute.dy)&&void 0!==l?l:0),r=n+(null!==(h=null!==(a=t.contentHeight)&&void 0!==a?a:t.attribute.height)&&void 0!==h?h:0);if(n<e||r>i){const s=Math.max(n,e),l=Math.min(r,i),a=x.globalTransMatrix.f-(l+s)/2+x.AABBBounds.height()/2;!o.has(`${t.col}-${t.row}`)&&o.set(`${t.col}-${t.row}`,{col:t.col,row:t.row,dx:null!==(c=null===(d=t.firstChild)||void 0===d?void 0:d.attribute.dx)&&void 0!==c?c:0,dy:null!==(g=null===(u=t.firstChild)||void 0===u?void 0:u.attribute.dy)&&void 0!==g?g:0}),t.forEachChildren((t=>{var e;t.setAttribute("dy",(null!==(e=t.attribute.dy)&&void 0!==e?e:0)-a+2)}))}}else if(S<e){const i=S-e;!o.has(`${t.col}-${t.row}`)&&o.set(`${t.col}-${t.row}`,{col:t.col,row:t.row,dx:null!==(f=null===(p=t.firstChild)||void 0===p?void 0:p.attribute.dx)&&void 0!==f?f:0,dy:null!==(m=null===(v=t.firstChild)||void 0===v?void 0:v.attribute.dy)&&void 0!==m?m:0}),t.forEachChildren((t=>{var e;t.setAttribute("dy",(null!==(e=t.attribute.dy)&&void 0!==e?e:0)-i+2)}))}else if(A>i){const e=A-i;!o.has(`${t.col}-${t.row}`)&&o.set(`${t.col}-${t.row}`,{col:t.col,row:t.row,dx:null!==(y=null===(b=t.firstChild)||void 0===b?void 0:b.attribute.dx)&&void 0!==y?y:0,dy:null!==(w=null===(C=t.firstChild)||void 0===C?void 0:C.attribute.dy)&&void 0!==w?w:0}),t.forEachChildren((t=>{var i;t.setAttribute("dy",(null!==(i=t.attribute.dy)&&void 0!==i?i:0)-e)}))}}function DR(t,e,i,o,n,r){if(at(t.mergeStartCol)&&at(t.mergeStartRow)&&at(t.mergeEndCol)&&at(t.mergeEndRow)){const{colStart:s,colEnd:l,rowStart:a,rowEnd:h}=PA(t,r.scenegraph);for(let t=s;t<=l;t++)for(let s=a;s<=h;s++)WR(r.scenegraph.getCell(t,s),e,i,o,n)}else WR(t,e,i,o,n)}function WR(t,e,i,o,n){var r,s,l,a,h,d,c,u,g,p,f,v,m,b,y,C,w,x;const _=t.getChildByName("text",!0)||t.getChildByName("image",!0);if(!_)return;if("image"===_.type){const{image:t}=_.attribute;if(!t||!_.resources)return;if("success"!==_.resources.get(t).state)return}const S=null!==(s=null!==(r=_.attribute.textAlign)&&void 0!==r?r:_.textAlign)&&void 0!==s?s:"left";_.AABBBounds.width();const A=_.globalAABBBounds.x1,B=_.globalAABBBounds.x2;if("center"===S&&n){const n=t.globalAABBBounds.x1+(null!==(a=null===(l=t.firstChild)||void 0===l?void 0:l.attribute.dx)&&void 0!==a?a:0),r=n+(null!==(d=null!==(h=t.contentWidth)&&void 0!==h?h:t.attribute.width)&&void 0!==d?d:0);if(n<e||r>i){const s=Math.max(n,e),l=Math.min(r,i),a=_.globalTransMatrix.e-(l+s)/2;!o.has(`${t.col}-${t.row}`)&&o.set(`${t.col}-${t.row}`,{col:t.col,row:t.row,dx:null!==(u=null===(c=t.firstChild)||void 0===c?void 0:c.attribute.dx)&&void 0!==u?u:0,dy:null!==(p=null===(g=t.firstChild)||void 0===g?void 0:g.attribute.dy)&&void 0!==p?p:0}),t.forEachChildren((t=>{var e;t.setAttribute("dx",(null!==(e=t.attribute.dx)&&void 0!==e?e:0)-a+2)}))}}else if(A<e){const i=A-e;!o.has(`${t.col}-${t.row}`)&&o.set(`${t.col}-${t.row}`,{col:t.col,row:t.row,dx:null!==(v=null===(f=t.firstChild)||void 0===f?void 0:f.attribute.dx)&&void 0!==v?v:0,dy:null!==(b=null===(m=t.firstChild)||void 0===m?void 0:m.attribute.dy)&&void 0!==b?b:0}),t.forEachChildren((t=>{var e;t.setAttribute("dx",(null!==(e=t.attribute.dx)&&void 0!==e?e:0)-i+2)}))}else if(B>i){const e=B-i;!o.has(`${t.col}-${t.row}`)&&o.set(`${t.col}-${t.row}`,{col:t.col,row:t.row,dx:null!==(C=null===(y=t.firstChild)||void 0===y?void 0:y.attribute.dx)&&void 0!==C?C:0,dy:null!==(x=null===(w=t.firstChild)||void 0===w?void 0:w.attribute.dy)&&void 0!==x?x:0}),t.forEachChildren((t=>{var i;t.setAttribute("dx",(null!==(i=t.attribute.dx)&&void 0!==i?i:0)-e)}))}}function NR(t){var e,i;const o=t.internalProps.layoutMap.headerObjects,n=t.internalProps.layoutMap.columnObjects;for(let t=0;t<o.length;t++){const i=o[t];if(i&&(null===(e=i.style)||void 0===e?void 0:e.textStick))return!0}for(let t=0;t<n.length;t++){const e=n[t];if(e&&(null===(i=e.style)||void 0===i?void 0:i.textStick))return!0}return!!(t.theme.headerStyle.textStick||t.theme.rowHeaderStyle.textStick||t.theme.bodyStyle.textStick)}var GR=function(t,e,i,o){return new(i||(i=Promise))((function(n,r){function s(t){try{a(o.next(t))}catch(t){r(t)}}function l(t){try{a(o.throw(t))}catch(t){r(t)}}function a(t){var e;t.done?n(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(s,l)}a((o=o.apply(t,e||[])).next())}))};class jR{constructor(t){this.isRelease=!1,this.mode="column",this.rowLimit=200,this.currentRow=0,this.rowStart=0,this.rowEnd=0,this.referenceRow=0,this.screenTopRow=0,this.deltaY=0,this.deltaHeight=0,this.colLimit=100,this.screenLeftCol=0,this.deltaX=0,this.deltaWidth=0,this.cellCache=new Map,this.table=t,this.table.isPivotChart()?(this.rowLimit=Math.max(100,Math.ceil(2*t.tableNoFrameHeight/t.defaultRowHeight)),this.colLimit=Math.max(100,Math.ceil(2*t.tableNoFrameWidth/t.defaultColWidth))):"autoHeight"===this.table.heightMode?this.rowLimit=Math.max(100,Math.ceil(2*t.tableNoFrameHeight/t.defaultRowHeight)):("autoWidth"===this.table.widthMode||(this.rowLimit=Math.max(200,Math.ceil(2*t.tableNoFrameHeight/t.defaultRowHeight))),this.colLimit=Math.max(100,Math.ceil(2*t.tableNoFrameWidth/t.defaultColWidth))),this.table.internalProps.transpose?this.mode="row":this.table.isPivotTable()&&(this.mode="pivot"),this.table.options.maintainedDataCount&&(this.rowLimit=this.table.options.maintainedDataCount)}get bodyLeftCol(){return this.table.frozenColCount}setParamsForColumn(){this.bodyRightCol=this.table.colCount-1-this.table.rightFrozenColCount;const t=Math.min(this.colLimit,this.bodyRightCol-this.bodyLeftCol+1);this.totalActualBodyColCount=t,this.totalCol=this.bodyLeftCol+t-1,this.colStart=this.bodyLeftCol,this.colEnd=this.totalCol;const e=this.table.defaultColWidth;this.taskColCount=1*Math.ceil(this.table.tableNoFrameWidth/e);const i=e*t,o=e*(this.bodyRightCol-this.bodyLeftCol+1);this.xLimitLeft=i/2,this.xLimitRight=o-i/2;const n=5*this.table.tableNoFrameWidth;this.screenColCount=Math.ceil(this.table.tableNoFrameWidth/e),this.firstScreenColLimit=Math.max(15,this.bodyLeftCol+Math.min(this.colLimit,Math.ceil(n/e))),this.colUpdatePos=this.bodyRightCol}setParamsForRow(){this.bodyTopRow=this.table.frozenRowCount,this.bodyBottomRow=this.table.rowCount-1-this.table.bottomFrozenRowCount;const t=Math.min(this.rowLimit,this.bodyBottomRow-this.bodyTopRow+1);this.totalActualBodyRowCount=t,this.totalRow=this.bodyTopRow+t-1,this.rowStart=this.bodyTopRow,this.rowEnd=this.totalRow;const e=this.table.defaultRowHeight;this.taskRowCount=1*Math.ceil(this.table.tableNoFrameHeight/e);const i=e*t,o=e*(this.bodyBottomRow-this.bodyTopRow+1);this.yLimitTop=i/2,this.yLimitBottom=o-i/2;const n=5*this.table.tableNoFrameHeight;this.screenRowCount=Math.ceil(this.table.tableNoFrameHeight/e),this.firstScreenRowLimit=Math.max(30,this.bodyTopRow+Math.min(this.rowLimit,Math.ceil(n/e))),this.rowUpdatePos=this.bodyBottomRow}refreshRowCount(){this.bodyTopRow=this.table.frozenRowCount,this.bodyBottomRow=this.table.rowCount-1-this.table.bottomFrozenRowCount;const t=Math.min(this.rowLimit,this.bodyBottomRow-this.bodyTopRow+1);this.totalActualBodyRowCount=t,this.totalRow=this.rowStart+t-1,this.rowStart=this.bodyTopRow,this.rowEnd=this.totalRow}refreshColCount(){this.bodyRightCol=this.table.colCount-1-this.table.rightFrozenColCount;const t=Math.min(this.colLimit,this.bodyRightCol-this.bodyLeftCol+1);this.totalActualBodyColCount=t,this.totalCol=this.bodyLeftCol+t-1,this.colStart=this.bodyLeftCol,this.colEnd=this.totalCol}resize(){const t=this.table.defaultColWidth;this.taskColCount=1*Math.ceil(this.table.tableNoFrameWidth/t);const e=5*this.table.tableNoFrameWidth;this.screenColCount=Math.ceil(this.table.tableNoFrameWidth/t),this.firstScreenColLimit=this.bodyLeftCol+Math.min(this.colLimit,Math.ceil(e/t));const i=this.table.defaultRowHeight;this.taskRowCount=1*Math.ceil(this.table.tableNoFrameHeight/i);const o=5*this.table.tableNoFrameHeight;this.screenRowCount=Math.ceil(this.table.tableNoFrameHeight/i),this.firstScreenRowLimit=this.bodyTopRow+Math.min(this.rowLimit,Math.ceil(o/i))}createGroupForFirstScreen(t,e,i,o,n,r,s,l){!function(t,e,i,o,n,r,s,l,a){var h,d,c,u,g,p,f,v,m,b,y,C;const{table:w}=a,{leftBottomCornerGroup:x,rightTopCornerGroup:_,rightBottomCornerGroup:S}=w.scenegraph;let A,B,R;a.setParamsForRow(),a.setParamsForColumn(),"adaptive"===w.widthMode||w.options.autoWrapText&&("adaptive"===w.heightMode||"autoHeight"===w.heightMode)?(R=w.colCount-1,A=Math.min(a.firstScreenColLimit,w.colCount-1)):A=Math.min(a.firstScreenColLimit,w.colCount-1),"adaptive"===w.heightMode?(R=w.rowCount-1,B=Math.min(a.firstScreenRowLimit,w.rowCount-1)):B=Math.min(a.firstScreenRowLimit,w.rowCount-1),0===w.internalProps._widthResizedColMap.size&&iR(w,0,null!=R?R:A),0===w.internalProps._heightResizedRowMap.size&&AA(w,0,B),A<w.colCount-w.rightFrozenColCount&&iR(w,w.colCount-w.rightFrozenColCount,w.colCount-1),B<w.rowCount-w.bottomFrozenRowCount&&AA(w,w.rowCount-w.bottomFrozenRowCount,w.rowCount-1),w.scenegraph.colHeaderGroup.setAttribute("x",w.getFrozenColsWidth()),w.scenegraph.rowHeaderGroup.setAttribute("y",w.getFrozenRowsHeight()),w.scenegraph.bottomFrozenGroup.setAttribute("x",w.getFrozenColsWidth()),w.scenegraph.rightFrozenGroup.setAttribute("y",w.getFrozenRowsHeight()),w.scenegraph.bodyGroup.setAttributes({x:w.getFrozenColsWidth(),y:w.getFrozenRowsHeight()}),pR(t,s,l,0,w.frozenColCount-1,0,w.frozenRowCount-1,w.isListTable()?"columnHeader":"cornerHeader",w),A-w.rightFrozenColCount>=w.frozenColCount&&pR(e,s,l,w.frozenColCount,A-w.rightFrozenColCount,0,w.frozenRowCount-1,"columnHeader",w),w.frozenColCount>0&&(w.leftRowSeriesNumberCount>0&&pR(i,s,l,0,w.leftRowSeriesNumberCount-1,w.frozenRowCount,B-w.bottomFrozenRowCount,"rowHeader",w),w.rowHeaderLevelCount>0&&pR(i,s,l,w.leftRowSeriesNumberCount,w.leftRowSeriesNumberCount+w.rowHeaderLevelCount-1,w.frozenRowCount,B-w.bottomFrozenRowCount,"rowHeader",w),w.frozenColCount>w.rowHeaderLevelCount+w.leftRowSeriesNumberCount&&pR(i,s,l,w.rowHeaderLevelCount+w.leftRowSeriesNumberCount,w.frozenColCount-1,w.frozenRowCount,B-w.bottomFrozenRowCount,"body",w)),w.bottomFrozenRowCount>0&&(w.frozenColCount>0&&(w.leftRowSeriesNumberCount>0&&pR(x,s,l,0,w.leftRowSeriesNumberCount-1,w.rowCount-1-w.bottomFrozenRowCount+1,w.rowCount-1,"rowHeader",w),w.rowHeaderLevelCount>0&&pR(x,s,l,w.leftRowSeriesNumberCount,w.leftRowSeriesNumberCount+w.rowHeaderLevelCount-1,w.rowCount-1-w.bottomFrozenRowCount+1,w.rowCount-1,"rowHeader",w),w.frozenColCount>w.rowHeaderLevelCount+w.leftRowSeriesNumberCount&&pR(x,s,l,w.rowHeaderLevelCount+w.leftRowSeriesNumberCount,w.frozenColCount-1,w.rowCount-1-w.bottomFrozenRowCount+1,w.rowCount-1,"body",w)),A-w.rightFrozenColCount>=w.frozenColCount&&pR(n,s,l,w.frozenColCount,A-w.rightFrozenColCount,w.rowCount-1-w.bottomFrozenRowCount+1,w.rowCount-1,w.isPivotChart()?"rowHeader":"body",w)),w.rightFrozenColCount>0&&(pR(_,s,l,w.colCount-1-w.rightFrozenColCount+1,w.colCount-1,0,w.frozenRowCount-1,"columnHeader",w),pR(o,s,l,w.colCount-1-w.rightFrozenColCount+1,w.colCount-1,w.frozenRowCount,B-w.bottomFrozenRowCount,w.isPivotChart()?"rowHeader":"body",w)),w.bottomFrozenRowCount>0&&w.rightFrozenColCount>0&&pR(S,s,l,w.colCount-1-w.rightFrozenColCount+1,w.colCount-1,w.rowCount-1-w.bottomFrozenRowCount+1,w.rowCount-1,"body",w),A-w.rightFrozenColCount>=w.frozenColCount&&pR(r,s,l,w.frozenColCount,A-w.rightFrozenColCount,w.frozenRowCount,B-w.bottomFrozenRowCount,"body",w),r.firstChild||e.firstChild||t.firstChild||i.firstChild?(a.currentRow=null!==(u=null!==(d=null===(h=r.firstChild)||void 0===h?void 0:h.rowNumber)&&void 0!==d?d:null===(c=i.firstChild)||void 0===c?void 0:c.rowNumber)&&void 0!==u?u:a.totalRow,a.rowEnd=a.currentRow,a.rowUpdatePos=a.rowEnd+1,a.referenceRow=a.rowStart+Math.floor((a.rowEnd-a.rowStart)/2),a.currentCol=null!==(C=null!==(b=null!==(v=null!==(p=null===(g=r.lastChild)||void 0===g?void 0:g.col)&&void 0!==p?p:null===(f=e.lastChild)||void 0===f?void 0:f.col)&&void 0!==v?v:null===(m=i.lastChild)||void 0===m?void 0:m.col)&&void 0!==b?b:null===(y=t.lastChild)||void 0===y?void 0:y.col)&&void 0!==C?C:a.totalCol,a.colEnd=a.currentCol,a.colUpdatePos=a.colEnd+1,a.referenceCol=a.colStart+Math.floor((a.colEnd-a.colStart)/2),a.progress()):(a.currentRow=a.totalRow,a.rowEnd=a.currentRow,a.rowUpdatePos=a.rowEnd+1,a.referenceRow=a.rowStart+Math.floor((a.rowEnd-a.rowStart)/2),a.currentCol=a.totalCol,a.colEnd=a.currentCol,a.colUpdatePos=a.colEnd+1,a.referenceCol=a.colStart+Math.floor((a.colEnd-a.colStart)/2))}(t,e,i,o,n,r,s,l,this)}progress(){return GR(this,void 0,void 0,(function*(){if(!this.isProgressing)return this.isProgressing=!0,new Promise(((t,e)=>{setTimeout((()=>GR(this,void 0,void 0,(function*(){this.isProgressing=!1,this.isRelease||(this.colUpdatePos<=this.colEnd?(yield this.updateColCellGroupsAsync(),yield this.progress()):this.rowUpdatePos<=this.rowEnd?(yield this.updateRowCellGroupsAsync(),yield this.progress()):this.currentCol<this.totalCol?(yield this.createCol(),yield this.progress()):this.currentRow<this.totalRow&&(yield this.createRow(),yield this.progress()),zR(this.table),this.table.scenegraph.updateNextFrame(),t())}))),16)}))}))}createRow(){return GR(this,void 0,void 0,(function*(){this.taskRowCount&&this.createRowCellGroup(this.taskRowCount)}))}createCol(){return GR(this,void 0,void 0,(function*(){this.taskColCount&&this.createColGroup(this.taskRowCount)}))}createRowCellGroup(t){const e=Math.min(this.totalRow,this.currentRow+t);if(AA(this.table,this.currentRow+1,e,!1),this.rowEnd=e,this.table.frozenColCount){let t=0;for(let i=0;i<this.table.frozenColCount;i++){const o=this.table.scenegraph.getColGroup(i),n=this.table.isListTable()?"body":"rowHeader",{height:r}=dR(o,i,o.attribute.width,this.currentRow+1,e,this.table.scenegraph.mergeMap,this.table.internalProps.defaultRowHeight,this.table,n);t=Math.max(t,r),this.table.scenegraph.rowHeaderGroup.setAttribute("height",t)}}if(this.table.rightFrozenColCount){let t=0;for(let i=this.table.colCount-this.table.rightFrozenColCount;i<this.table.colCount;i++){const o=this.table.scenegraph.getColGroup(i),n=this.table.isPivotChart()?"rowHeader":"body",{height:r}=dR(o,i,o.attribute.width,this.currentRow+1,e,this.table.scenegraph.mergeMap,this.table.internalProps.defaultRowHeight,this.table,n);t=Math.max(t,r),this.table.scenegraph.rightFrozenGroup.setAttribute("height",t)}}let i=0;for(let t=this.bodyLeftCol;t<=this.bodyRightCol;t++){const o=this.table.scenegraph.getColGroup(t);if(!o)continue;const n=t<this.table.rowHeaderLevelCount?"rowHeader":"body",{height:r}=dR(o,t,o.attribute.width,this.currentRow+1,e,this.table.scenegraph.mergeMap,this.table.internalProps.defaultRowHeight,this.table,n);i=Math.max(i,r)}this.table.scenegraph.bodyGroup.setAttribute("height",i),this.currentRow=e,this.rowUpdatePos=this.rowEnd,this.table.scenegraph.updateContainer(),this.table.scenegraph.updateBorderSizeAndPosition()}createColGroup(t){const e=Math.min(this.totalCol,this.currentCol+t);iR(this.table,this.currentCol+1,e),this.colEnd=e;for(let t=0;t<this.table.rowCount;t++){const e=this.highPerformanceGetCell(this.currentCol,t);"cell"===e.role&&at(e.mergeStartCol)&&e.mergeStartCol>this.currentCol&&this.table.scenegraph.updateCellContent(e.col,e.row)}if(this.table.frozenRowCount){const t=this.table.scenegraph.colHeaderGroup.lastChild instanceof zS?this.table.scenegraph.colHeaderGroup.lastChild:this.table.scenegraph.colHeaderGroup.lastChild._prev,i=t.attribute.x+t.attribute.width,o=t.attribute.y;pR(this.table.scenegraph.colHeaderGroup,i,o,this.currentCol+1,e,0,this.table.frozenRowCount-1,"columnHeader",this.table)}if(this.table.bottomFrozenRowCount){const t=this.table.scenegraph.bottomFrozenGroup.lastChild instanceof zS?this.table.scenegraph.bottomFrozenGroup.lastChild:this.table.scenegraph.bottomFrozenGroup.lastChild._prev,i=t.attribute.x+t.attribute.width,o=t.attribute.y;pR(this.table.scenegraph.bottomFrozenGroup,i,o,this.currentCol+1,e,this.table.rowCount-this.table.bottomFrozenRowCount,this.table.rowCount-1,"columnHeader",this.table)}let i=this.table.scenegraph.bodyGroup.lastChild&&(this.table.scenegraph.bodyGroup.lastChild instanceof zS?this.table.scenegraph.bodyGroup.lastChild:this.table.scenegraph.bodyGroup.lastChild._prev);i||(i=this.table.scenegraph.colHeaderGroup.lastChild&&(this.table.scenegraph.colHeaderGroup.lastChild instanceof zS?this.table.scenegraph.colHeaderGroup.lastChild:this.table.scenegraph.colHeaderGroup.lastChild._prev));const o=i.attribute.x+i.attribute.width,n=i.attribute.y;pR(this.table.scenegraph.bodyGroup,o,n,this.currentCol+1,e,this.rowStart,this.rowEnd,"body",this.table),this.currentCol=e,this.colUpdatePos=this.colEnd,this.table.scenegraph.updateContainer(),this.table.scenegraph.updateBorderSizeAndPosition()}setY(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return GR(this,void 0,void 0,(function*(){const i=this.table.getRowsHeight(this.bodyTopRow,this.bodyTopRow+(this.rowEnd-this.rowStart+1))/2,o=this.table.getAllRowsHeight()-i,n=this.table.getTargetRowAt(t+this.table.scenegraph.colHeaderGroup.attribute.height);n&&(this.screenTopRow=n.row),t<i&&this.rowStart===this.bodyTopRow||t>o&&this.rowEnd===this.bodyBottomRow?(this.updateDeltaY(t),this.updateBody(t-this.deltaY)):this.table.scenegraph.bodyGroup.firstChild&&0!==this.table.scenegraph.bodyGroup.firstChild.childrenCount||this.table.scenegraph.rowHeaderGroup.firstChild&&0!==this.table.scenegraph.rowHeaderGroup.firstChild.childrenCount?this.dynamicSetY(t,n,e):(this.updateDeltaY(t),this.updateBody(t-this.deltaY))}))}setX(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return GR(this,void 0,void 0,(function*(){const i=this.table.getColsWidth(this.bodyLeftCol,this.bodyLeftCol+(this.colEnd-this.colStart+1))/2,o=this.table.getAllColsWidth()-i,n=this.table.getTargetColAt(t+this.table.scenegraph.rowHeaderGroup.attribute.width);n&&(this.screenLeftCol=n.col),t<i&&this.colStart===this.bodyLeftCol||t>o&&this.colEnd===this.bodyRightCol||this.table.scenegraph.bodyGroup.firstChild&&0===this.table.scenegraph.bodyGroup.firstChild.childrenCount?(this.updateDeltaX(t),this.table.scenegraph.setBodyAndColHeaderX(-t+this.deltaX)):this.dynamicSetX(t,n,e)}))}dynamicSetY(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return GR(this,void 0,void 0,(function*(){kR(t,e,i,this)}))}dynamicSetX(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return GR(this,void 0,void 0,(function*(){CR(t,e,i,this)}))}updateBody(t){this.table.scenegraph.setBodyAndRowHeaderY(-t)}updateRowCellGroupsAsync(){return GR(this,void 0,void 0,(function*(){this.updateCellGroups(this.taskRowCount)}))}updateCellGroups(t){const e=Math.min(this.bodyBottomRow,this.rowUpdatePos+t);"autoHeight"===this.table.heightMode&&AA(this.table,this.rowUpdatePos,e,!1),ER(this.rowUpdatePos,e,this),"autoHeight"===this.table.heightMode&&(RR(this.bodyLeftCol,this.bodyRightCol,this.rowUpdatePos,e,this.table,this.rowUpdateDirection,!0),RR(0,this.table.frozenColCount-1,this.rowUpdatePos,e,this.table,this.rowUpdateDirection,!0),RR(this.table.colCount-this.table.rightFrozenColCount,this.table.colCount-1,this.rowUpdatePos,e,this.table,this.rowUpdateDirection,!0)),this.rowUpdatePos=e+1}updateBottomFrozenCellGroups(){const t=this.table.rowCount-this.table.bottomFrozenRowCount,e=this.table.rowCount-1;"autoHeight"===this.table.heightMode&&AA(this.table,t,e,!1),ER(t,e,this),"autoHeight"===this.table.heightMode&&(RR(this.bodyLeftCol,this.bodyRightCol,t,e,this.table,this.rowUpdateDirection),RR(0,this.table.frozenColCount-1,t,e,this.table,this.rowUpdateDirection),RR(this.table.colCount-this.table.rightFrozenColCount,this.table.colCount-1,t,e,this.table,this.rowUpdateDirection))}updateRightFrozenCellGroups(){const t=this.table.colCount-this.table.rightFrozenColCount,e=this.table.colCount-1;"autoWidth"===this.table.widthMode&&iR(this.table,t,e,!1),BR(t,e,this),"autoHeight"===this.table.heightMode&&mR(t,e,this.table,this.colUpdateDirection)}updateColCellGroupsAsync(){return GR(this,void 0,void 0,(function*(){this.updateColGroups(this.taskRowCount)}))}updateColGroups(t){const e=Math.min(this.bodyRightCol,this.colUpdatePos+t);iR(this.table,this.colUpdatePos,e),BR(this.colUpdatePos,e,this),this.colUpdatePos=e+1}updateCellGroupPosition(t,e,i){t.row=e,t.mergeStartCol=void 0,t.mergeStartRow=void 0,t.mergeEndCol=void 0,t.mergeEndRow=void 0,t.setAttribute("y",i),t.needUpdate=!0,t.needUpdateForAutoRowHeight=!0}updateCellGroupContent(t){if(!t.needUpdate||"cell"!==t.role)return t;const e=this.table.scenegraph.updateCellContent(t.col,t.row);return t.needUpdate=!1,e||t}sortCellVertical(){return GR(this,void 0,void 0,(function*(){yield function(t){var e;return HR(this,void 0,void 0,(function*(){let i,o;t.table.scenegraph.bodyGroup.forEachChildren(((t,e)=>{"group"===t.type&&(t.needUpdate=!0,null==t||t.forEachChildren((t=>{t.needUpdate=!0})))})),"autoHeight"===t.table.heightMode?(i=t.rowStart,o=t.rowEnd):(i=Math.max(t.bodyTopRow,t.screenTopRow-1*t.screenRowCount),o=Math.min(t.bodyBottomRow,t.screenTopRow+2*t.screenRowCount,t.table.rowCount-1));const n=t.table.getAllRowsHeight();AA(t.table,i,o);const r=t.table.getAllRowsHeight();n!==r&&t.table.scenegraph.updateContainerHeight(t.table.frozenRowCount,r-n);for(let i=0;null!==(e=i<t.table.frozenColCount)&&void 0!==e&&e;i++){const e=t.table.scenegraph.getColGroup(i);null==e||e.setAttribute("chartInstance",void 0);for(let e=t.rowStart;e<=t.rowEnd;e++)t.table.scenegraph.updateCellContent(i,e);for(let e=t.table.rowCount-t.table.bottomFrozenRowCount;e<t.table.rowCount;e++)t.table.scenegraph.updateCellContent(i,e)}for(let e=t.colStart;e<=t.colEnd;e++){const i=t.table.scenegraph.getColGroup(e);null==i||i.setAttribute("chartInstance",void 0);for(let i=t.table.rowCount-t.table.bottomFrozenRowCount;i<t.table.rowCount;i++)t.table.scenegraph.updateCellContent(e,i)}for(let e=t.table.colCount-t.table.rightFrozenColCount;e<t.table.colCount;e++){const i=t.table.scenegraph.getColGroup(e);null==i||i.setAttribute("chartInstance",void 0);for(let i=t.rowStart;i<=t.rowEnd;i++)t.table.scenegraph.updateCellContent(e,i);for(let i=t.table.rowCount-t.table.bottomFrozenRowCount;i<t.table.rowCount;i++)t.table.scenegraph.updateCellContent(e,i)}ER(i,o,t),"autoHeight"===t.table.heightMode&&RR(t.bodyLeftCol,t.bodyRightCol,i,o,t.table,t.rowEnd>t.bodyBottomRow-(t.rowEnd-t.rowStart+1)?"down":"up"),t.rowUpdatePos=t.rowStart,t.rowUpdateDirection=t.rowEnd>t.bodyBottomRow-(t.rowEnd-t.rowStart+1)?"down":"up",t.table.scenegraph.updateNextFrame(),"autoHeight"!==t.table.heightMode&&(yield t.progress())}))}(this)}))}sortCellHorizontal(){return GR(this,void 0,void 0,(function*(){yield function(t){return FR(this,void 0,void 0,(function*(){t.table.scenegraph.bodyGroup.forEachChildren(((t,e)=>{"group"===t.type&&(t.needUpdate=!0,null==t||t.forEachChildren((t=>{t.needUpdate=!0})))}));const e=Math.max(t.bodyLeftCol,t.screenLeftCol-1*t.screenColCount),i=Math.min(t.bodyRightCol,t.screenLeftCol+2*t.screenColCount);iR(t.table,e,i);for(let e=t.colStart;e<=t.colEnd;e++){const i=t.table.scenegraph.getColGroup(e);null==i||i.setAttribute("chartInstance",void 0);for(let i=t.table.rowCount-t.table.bottomFrozenRowCount;i<t.table.rowCount;i++)t.table.scenegraph.updateCellContent(e,i)}for(let e=t.table.colCount-t.table.rightFrozenColCount;e<t.table.colCount;e++){const i=t.table.scenegraph.getColGroup(e);null==i||i.setAttribute("chartInstance",void 0);for(let i=t.rowStart;i<=t.rowEnd;i++)t.table.scenegraph.updateCellContent(e,i);for(let i=t.table.rowCount-t.table.bottomFrozenRowCount;i<t.table.rowCount;i++)t.table.scenegraph.updateCellContent(e,i)}BR(e,i,t),t.colUpdatePos=t.colStart,t.colUpdateDirection=t.colEnd>t.bodyRightCol-(t.colEnd-t.colStart+1)?"right":"left",t.table.scenegraph.updateNextFrame(),yield t.progress()}))}(this)}))}highPerformanceGetCell(t,e,i){if(e>=this.table.frozenRowCount&&e<this.table.rowCount-this.table.bottomFrozenRowCount&&(e<this.rowStart||e>this.rowEnd))return hR;if(t>=this.table.frozenColCount&&t<this.table.colCount-this.table.rightFrozenColCount&&(t<this.colStart||t>this.colEnd))return hR;if(this.cellCache.get(t)){const o=this.cellCache.get(t);if((o._next||o._prev)&&Math.abs(o.row-e)<e){let n=VR(o,e);return n&&(i||"shadow-cell"!==n.role)||(n=this.table.scenegraph.getCell(t,e,i)),n.row&&this.cellCache.set(t,n),n}const n=this.table.scenegraph.getCell(t,e,i);return n.col===t&&n.row&&this.cellCache.set(t,n),n}const o=this.table.scenegraph.getCell(t,e,i);return o.col===t&&o.row&&this.cellCache.set(t,o),o}updateDeltaY(t,e,i){if(this.rowStart===this.bodyTopRow){const t=this.table.scenegraph.highPerformanceGetCell(this.colStart,this.rowStart,!0);if("cell"===t.role){const e=t.attribute.y;this.deltaY=-e}}else if(this.rowEnd===this.bodyBottomRow){const t=this.table.scenegraph.highPerformanceGetCell(this.colStart,this.rowEnd,!0);if("cell"===t.role){const e=t.attribute.y+t.attribute.height-(this.table.getAllRowsHeight()-this.table.getFrozenRowsHeight()-this.table.getBottomFrozenRowsHeight());this.deltaY=-e}}else if(Q(e)&&Q(i)){let o=this.table.scenegraph.highPerformanceGetCell(this.colStart,i,!0);"cell"!==o.role&&(o=this.table.scenegraph.highPerformanceGetCell(0,i,!0));const n=t-this.deltaY,r=e-n,s=o.attribute.y-n+this.table.getFrozenRowsHeight();this.deltaY=r-s}}updateDeltaX(t,e,i){if(this.colStart===this.bodyLeftCol){const t=this.table.scenegraph.getColGroup(this.colStart);if(t){const e=t.attribute.x;this.deltaX=-e}}else if(this.colEnd===this.bodyRightCol){const t=this.table.scenegraph.getColGroup(this.colEnd);if(t){const e=t.attribute.x+t.attribute.width-(this.table.getAllColsWidth()-this.table.getFrozenColsWidth()-this.table.getRightFrozenColsWidth());this.deltaX=-e}}else if(Q(e)&&Q(i)){const o=this.table.scenegraph.getColGroup(i)||this.table.scenegraph.getColGroup(i,!0),n=t-this.deltaX,r=e-n,s=o.attribute.x-n+this.table.getFrozenColsWidth();this.deltaX=r-s}}release(){this.isRelease=!0}}function VR(t,e){if(!t)return null;if(t.row===e)return t;const i=t._prev,o=t._next;return t.row>e&&i&&i.row===t.row-1?VR(i,e):t.row<e&&o&&o.row===t.row+1?VR(o,e):null}function UR(t,e,i){var o,n,r,s,l,a,h,d,c;const u=i.table,[g,p,f,v]=e.split("-"),m=parseInt(g,10),b=parseInt(p,10),y=parseInt(f,10),C=parseInt(v,10);let w,x=m,_=b,S=y,A=C;switch(t.role){case"rowHeader":w=u.getBodyVisibleRowRange(),w&&(_=Math.max(b,w.rowStart-1),A=Math.min(C,w.rowEnd+1));break;case"columnHeader":case"bottomFrozen":w=u.getBodyVisibleCellRange(),w&&(x=Math.max(m,w.colStart-1),S=Math.min(y,w.colEnd+1));break;case"cornerHeader":case"rightTopCorner":case"leftBottomCorner":case"rightBottomCorner":break;case"rightFrozen":w=u.getBodyVisibleCellRange(),w&&(_=Math.max(b,w.rowStart-1),A=Math.min(C,w.rowEnd+1));break;default:w=u.getBodyVisibleCellRange(),w&&(_=Math.max(b,w.rowStart-1),A=Math.min(C,w.rowEnd+1),x=Math.max(m,w.colStart-1),S=Math.min(y,w.colEnd+1))}const B=u.getColsWidth(x,S),R=u.getRowsHeight(_,A),M=i.highPerformanceGetCell(x,_).globalAABBBounds,T=i.highPerformanceGetCell(S,A).globalAABBBounds;t.rect.setAttributes({x:M.x1-i.tableGroup.attribute.x,y:M.y1-i.tableGroup.attribute.y,width:B,height:R,visible:!0}),t.fillhandle&&(null===(o=t.fillhandle)||void 0===o||o.setAttributes({x:T.x2-i.tableGroup.attribute.x-3,y:T.y2-i.tableGroup.attribute.y-3,width:6,height:6,visible:!0}));let k=!!u.frozenColCount&&m===u.frozenColCount;!k&&u.frozenColCount&&u.scrollLeft>0&&m>=u.frozenColCount&&u.getColsWidth(0,m-1)-u.scrollLeft<u.getFrozenColsWidth()&&(k=!0);let L=!!u.rightFrozenColCount&&u.rightFrozenColCount>0&&y===u.colCount-u.rightFrozenColCount-1;!L&&u.rightFrozenColCount&&y<u.colCount-u.rightFrozenColCount&&u.getColsWidth(0,y)-u.scrollLeft>u.tableNoFrameWidth-u.getRightFrozenColsWidth()&&(L=!0);let P=!u.frozenRowCount||b===u.frozenRowCount;!P&&u.frozenRowCount&&u.scrollTop>0&&b>=u.frozenRowCount&&u.getRowsHeight(0,b-1)-u.scrollTop<u.getFrozenRowsHeight()&&(P=!0);let E=!!u.bottomFrozenRowCount&&C===u.rowCount-u.bottomFrozenRowCount-1;if(!E&&u.bottomFrozenRowCount&&C<u.rowCount-u.bottomFrozenRowCount&&u.getRowsHeight(0,C)-u.scrollTop>u.tableNoFrameHeight-u.getBottomFrozenRowsHeight()&&(E=!0),k&&t.rect.attribute.stroke[3]||L&&t.rect.attribute.stroke[1]||P&&t.rect.attribute.stroke[0]||E&&t.rect.attribute.stroke[2]){if(k&&t.rect.attribute.stroke[3]&&i.tableGroup.insertAfter(t.rect,"columnHeader"===t.role?i.cornerHeaderGroup:"bottomFrozen"===t.role?i.leftBottomCornerGroup:i.rowHeaderGroup),E&&t.rect.attribute.stroke[2]&&i.tableGroup.insertAfter(t.rect,"rowHeader"===t.role?i.leftBottomCornerGroup:"rightFrozen"===t.role?i.rightBottomCornerGroup:i.bottomFrozenGroup),P&&t.rect.attribute.stroke[0]&&i.tableGroup.insertAfter(t.rect,"rowHeader"===t.role?i.cornerHeaderGroup:"rightFrozen"===t.role?i.rightTopCornerGroup:i.colHeaderGroup),L&&t.rect.attribute.stroke[1]&&i.tableGroup.insertAfter(t.rect,"columnHeader"===t.role?i.rightTopCornerGroup:"bottomFrozen"===t.role?i.rightBottomCornerGroup:i.rightFrozenGroup),t.rect.attribute.x<u.getFrozenColsWidth()&&u.scrollLeft>0&&("body"===t.role||"columnHeader"===t.role||"bottomFrozen"===t.role)){const e=t.rect.attribute.width-(u.getFrozenColsWidth()-t.rect.attribute.x);t.rect.setAttributes({x:t.rect.attribute.x+(u.getFrozenColsWidth()-t.rect.attribute.x),width:e>0?e:0}),null===(n=t.fillhandle)||void 0===n||n.setAttributes({visible:e>0})}if(u.getRightFrozenColsWidth()>0&&i.rightFrozenGroup.attribute.height>0&&t.rect.attribute.x+t.rect.attribute.width>i.rightFrozenGroup.attribute.x&&("body"===t.role||"columnHeader"===t.role||"bottomFrozen"===t.role)){const e=i.rightFrozenGroup.attribute.x-t.rect.attribute.x;t.rect.setAttributes({x:t.rect.attribute.x,width:e>0?e:0}),null===(r=t.fillhandle)||void 0===r||r.setAttributes({visible:e-B>0})}if(t.rect.attribute.y<i.colHeaderGroup.attribute.height&&u.scrollTop>0&&("body"===t.role||"rowHeader"===t.role||"rightFrozen"===t.role)){const e=t.rect.attribute.height-(i.colHeaderGroup.attribute.height-t.rect.attribute.y);t.rect.setAttributes({y:t.rect.attribute.y+(i.colHeaderGroup.attribute.height-t.rect.attribute.y),height:e>0?e:0}),null===(s=t.fillhandle)||void 0===s||s.setAttributes({visible:e>0})}if(i.bottomFrozenGroup.attribute.width>0&&i.bottomFrozenGroup.attribute.height>0&&t.rect.attribute.y+t.rect.attribute.height>i.bottomFrozenGroup.attribute.y&&("body"===t.role||"rowHeader"===t.role||"rightFrozen"===t.role)){const e=i.bottomFrozenGroup.attribute.y-t.rect.attribute.y;t.rect.setAttributes({y:t.rect.attribute.y,height:e>0?e:0}),null===(l=t.fillhandle)||void 0===l||l.setAttributes({visible:e-R>0})}}else i.tableGroup.insertAfter(t.rect,"body"===t.role?i.bodyGroup:"columnHeader"===t.role?i.colHeaderGroup:"rowHeader"===t.role?i.rowHeaderGroup:"cornerHeader"===t.role?i.cornerHeaderGroup:"rightTopCorner"===t.role?i.rightTopCornerGroup:"rightFrozen"===t.role?i.rightFrozenGroup:"leftBottomCorner"===t.role?i.leftBottomCornerGroup:"bottomFrozen"===t.role?i.bottomFrozenGroup:i.rightBottomCornerGroup);let H=0;"number"==typeof t.rect.attribute.lineWidth&&(H=Math.ceil(t.rect.attribute.lineWidth/2)),y===u.colCount-1&&(Array.isArray(t.rect.attribute.lineWidth)&&(H=Math.ceil((null!==(a=t.rect.attribute.lineWidth[1])&&void 0!==a?a:0)/2)),t.rect.setAttributes({width:t.rect.attribute.width-H})),0===m&&(Array.isArray(t.rect.attribute.lineWidth)&&(H=Math.ceil((null!==(h=t.rect.attribute.lineWidth[3])&&void 0!==h?h:0)/2)),t.rect.setAttributes({x:t.rect.attribute.x+H,width:t.rect.attribute.width-H})),C===u.rowCount-1&&(Array.isArray(t.rect.attribute.lineWidth)&&(H=Math.ceil((null!==(d=t.rect.attribute.lineWidth[2])&&void 0!==d?d:0)/2)),t.rect.setAttributes({height:t.rect.attribute.height-H})),0===b&&(Array.isArray(t.rect.attribute.lineWidth)&&(H=Math.ceil((null!==(c=t.rect.attribute.lineWidth[0])&&void 0!==c?c:0)/2)),t.rect.setAttributes({y:t.rect.attribute.y+H,height:t.rect.attribute.height-H}))}function $R(t,e){let i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];const o=t.table,n=e.start.col,r=e.start.row,s=e.end.col,l=e.end.row,a=e.skipBodyMerge;let h=Math.max(Math.min(s,n),0),d=Math.max(Math.min(l,r),0),c=Math.min(Math.max(s,n),o.colCount-1),u=Math.min(Math.max(l,r),o.rowCount-1);const g=()=>{let t=!1;for(let e=h;e<=c;e++){if(e===h)for(let i=d;i<=u;i++){if(!o.isHeader(e,i)&&a)continue;const n=Mx(o,e,i);if(n&&n.start.col<h){h=n.start.col,t=!0;break}}if(!t&&e===c)for(let i=d;i<=u;i++){if(!o.isHeader(e,i)&&a)continue;const n=Mx(o,e,i);if(n&&Math.min(n.end.col,o.colCount-1)>c){c=n.end.col,t=!0;break}}if(t)break}if(!t)for(let e=d;e<=u;e++){if(e===d)for(let i=h;i<=c;i++){if(!o.isHeader(i,e)&&a)continue;const n=Mx(o,i,e);if(n&&n.start.row<d){d=n.start.row,t=!0;break}}if(!t&&e===u)for(let i=h;i<=c;i++){if(!o.isHeader(i,e)&&a)continue;const n=Mx(o,i,e);if(n&&Math.min(n.end.row,o.rowCount-1)>u){u=n.end.row,t=!0;break}}if(t)break}t&&g()};i&&g(),t.selectingRangeComponents.forEach(((t,e)=>{var i;t.rect.delete(),null===(i=t.fillhandle)||void 0===i||i.delete()})),t.selectingRangeComponents=new Map;let p=!1,f=!1,v=!1,m=!1,b=!1,y=!1,C=!1,w=!1,x=!1;if(h<=o.frozenColCount-1&&d<=o.frozenRowCount-1&&(y=!0),c>=o.colCount-o.rightFrozenColCount&&d<=o.frozenRowCount-1&&(C=!0),h<=o.frozenColCount-1&&u>=o.rowCount-o.bottomFrozenRowCount&&(x=!0),c>=o.colCount-o.rightFrozenColCount&&u>=o.rowCount-o.bottomFrozenRowCount&&(w=!0),h<=o.frozenColCount-1&&u>=o.frozenRowCount&&d<=o.rowCount-o.bottomFrozenRowCount-1&&(p=!0),c>=o.colCount-o.rightFrozenColCount&&u>=o.frozenRowCount&&d<=o.rowCount-o.bottomFrozenRowCount-1&&(f=!0),d<=o.frozenRowCount-1&&c>=o.frozenColCount&&h<=o.colCount-o.rightFrozenColCount-1&&(v=!0),u>=o.rowCount-o.bottomFrozenRowCount&&c>=o.frozenColCount&&h<=o.colCount-o.rightFrozenColCount-1&&(m=!0),h<=o.colCount-o.rightFrozenColCount-1&&c>=o.frozenColCount&&d<=o.rowCount-o.bottomFrozenRowCount-1&&u>=o.frozenRowCount&&(b=!0),y){const e=Math.min(c,o.frozenColCount-1),i=Math.min(u,o.frozenRowCount-1),n=[!0,!v,!p,!0];t.createCellSelectBorder(h,d,e,i,"cornerHeader",`${h}${d}${c}${u}`,n)}if(C){const e=Math.max(h,o.colCount-o.rightFrozenColCount),i=Math.min(u,o.frozenRowCount-1),n=[!0,!0,!f,!v];t.createCellSelectBorder(e,d,c,i,"rightTopCorner",`${h}${d}${c}${u}`,n)}if(x){const e=Math.min(c,o.frozenColCount-1),i=Math.max(d,o.rowCount-o.bottomFrozenRowCount),n=[!p,!m,!0,!0];t.createCellSelectBorder(h,i,e,u,"leftBottomCorner",`${h}${d}${c}${u}`,n)}if(w){const e=Math.max(h,o.colCount-o.rightFrozenColCount),i=Math.max(d,o.rowCount-o.bottomFrozenRowCount),n=[!f,!0,!0,!m];t.createCellSelectBorder(e,i,c,u,"rightBottomCorner",`${h}${d}${c}${u}`,n)}if(v){const e=Math.max(h,o.frozenColCount),i=Math.min(c,o.colCount-o.rightFrozenColCount-1),n=Math.min(u,o.frozenRowCount-1),r=[!0,!C,!b,!y];t.createCellSelectBorder(e,d,i,n,"columnHeader",`${h}${d}${c}${u}`,r)}if(m){const e=Math.max(h,o.frozenColCount),i=Math.min(c,o.colCount-o.rightFrozenColCount-1),n=Math.max(d,o.rowCount-o.bottomFrozenRowCount),r=[!b,!w,!0,!x];t.createCellSelectBorder(e,n,i,u,"bottomFrozen",`${h}${d}${c}${u}`,r)}if(p){const e=Math.max(d,o.frozenRowCount),i=Math.min(u,o.rowCount-o.bottomFrozenRowCount-1),n=Math.min(c,o.frozenColCount-1),r=[!y,!b,!x,!0];t.createCellSelectBorder(h,e,n,i,"rowHeader",`${h}${d}${c}${u}`,r)}if(f){const e=Math.max(d,o.frozenRowCount),i=Math.min(u,o.rowCount-o.bottomFrozenRowCount-1),n=Math.max(h,o.colCount-o.rightFrozenColCount),r=[!C,!0,!w,!b];t.createCellSelectBorder(n,e,c,i,"rightFrozen",`${h}${d}${c}${u}`,r)}if(b){const e=Math.max(h,o.frozenColCount),i=Math.max(d,o.frozenRowCount),n=Math.min(c,o.colCount-o.rightFrozenColCount-1),r=Math.min(u,o.rowCount-o.bottomFrozenRowCount-1),s=[!v,!f,!m,!p];t.createCellSelectBorder(e,i,n,r,"body",`${h}${d}${c}${u}`,s)}}function XR(t){t.selectingRangeComponents.forEach(((t,e)=>{t.rect.setAttribute("opacity",0)})),t.selectedRangeComponents.forEach(((t,e)=>{t.rect.setAttribute("opacity",0)}))}function YR(t){t.selectingRangeComponents.forEach(((t,e)=>{t.rect.setAttribute("opacity",1)})),t.selectedRangeComponents.forEach(((t,e)=>{t.rect.setAttribute("opacity",1)}))}function KR(t){t.selectingRangeComponents.forEach(((e,i)=>{var o;t.selectedRangeComponents.get(i)&&(t.selectingRangeComponents.get(i).rect.delete(),null===(o=t.selectingRangeComponents.get(i).fillhandle)||void 0===o||o.delete()),t.selectedRangeComponents.set(i,e)})),t.selectingRangeComponents=new Map,t.updateNextFrame()}function qR(t){t.selectedRangeComponents.forEach(((t,e)=>{var i;t.rect.delete(),null===(i=t.fillhandle)||void 0===i||i.delete()})),t.selectedRangeComponents=new Map}function ZR(t){t.selectingRangeComponents.forEach(((t,e)=>{var i;t.rect.delete(),null===(i=t.fillhandle)||void 0===i||i.delete()})),t.selectingRangeComponents=new Map}function JR(t,e,i,o){const n=o.scenegraph,r=Cw(t.map((t=>t.row))).sort(((t,e)=>e-t)),s=Cw(e.map((t=>t.row))).sort(((t,e)=>t-e)),l=Cw(i.map((t=>t.row))).sort(((t,e)=>t-e));let a;if(l.length&&(a=iM(l[0]-1,l[l.length-1]+1,n)),s.length){const t=iM(s[0]-1,s[s.length-1]+1,n);a=Q(a)?Q(t)?Math.min(a,t):a:t}if(r.length){const t=iM(r[0]-1,r[r.length-1]+1,n);a=Q(a)?Q(t)?Math.min(a,t):a:t}r.forEach((t=>{!function(t,e){const i=e.proxy;t>=i.rowStart&&t<=i.rowEnd&&(tM(t,e),i.rowEnd--,i.currentRow--),i.bodyBottomRow--;const o=Math.min(i.rowLimit,i.bodyBottomRow-i.bodyTopRow+1);i.totalActualBodyRowCount=o,i.totalRow=Math.min(i.table.rowCount-1,i.rowStart+o-1)}(t,n)}));const h=o.rowHeightsMap;if(r.forEach((t=>{h.delete(t)})),r.length){!function(t){function e(e,i){e.row=i;const o=Mx(t.table,e.col,e.row);o?(e.mergeStartCol=o.start.col,e.mergeEndCol=o.end.col,e.mergeStartRow=o.start.row,e.mergeEndRow=o.end.row):(e.mergeStartCol=void 0,e.mergeEndCol=void 0,e.mergeStartRow=void 0,e.mergeEndRow=void 0)}t.bodyGroup.forEachChildren((i=>{let o=t.bodyRowStart;null==i||i.forEachChildren((t=>{e(t,o),o++}))})),t.rowHeaderGroup.forEachChildren((i=>{let o=t.bodyRowStart;null==i||i.forEachChildren((t=>{e(t,o),o++}))})),t.rightFrozenGroup.forEachChildren((i=>{let o=t.bodyRowStart;null==i||i.forEachChildren((t=>{e(t,o),o++}))})),t.bottomFrozenGroup.forEachChildren((i=>{let o=t.table.rowCount-t.table.bottomFrozenRowCount;null==i||i.forEachChildren((t=>{e(t,o),o++}))})),t.leftBottomCornerGroup.forEachChildren((i=>{let o=t.table.rowCount-t.table.bottomFrozenRowCount;null==i||i.forEachChildren((t=>{e(t,o),o++}))})),t.rightBottomCornerGroup.forEachChildren((i=>{let o=t.table.rowCount-t.table.bottomFrozenRowCount;null==i||i.forEachChildren((t=>{e(t,o),o++}))}))}(n);const t=eM(r[r.length-1]-1,r[0]-r.length+1,n);a=Q(a)?Q(t)?Math.min(a,t):a:t}let d;if(n.table._clearRowRangeHeightsMap(),s.forEach((t=>{const e=function(t,e){const i=e.proxy;i.bodyBottomRow++;const o=Math.min(i.rowLimit,i.bodyBottomRow-i.bodyTopRow+1);if(i.totalActualBodyRowCount=o,i.totalRow=i.rowStart+o-1,!(t<i.rowStart))return t>i.rowEnd?i.rowEnd-i.rowStart+1<i.rowLimit?(i.rowEnd++,i.currentRow++,QR(t,e),t):void 0:i.rowEnd-i.rowStart+1<i.rowLimit?(i.rowEnd++,i.currentRow++,QR(t,e),t):t}(t,n);d=null!=d?d:e,h.insert(t)})),function(t){function e(e,i,o){e.row=i,e.setAttribute("y",o);const n=Mx(t.table,e.col,e.row);n?(e.mergeStartCol=n.start.col,e.mergeEndCol=n.end.col,e.mergeStartRow=n.start.row,e.mergeEndRow=n.end.row):(e.mergeStartCol=void 0,e.mergeEndCol=void 0,e.mergeStartRow=void 0,e.mergeEndRow=void 0)}t.bodyGroup.forEachChildren((i=>{let o=t.bodyRowStart,n=t.getCellGroupY(o);null==i||i.forEachChildren((t=>{e(t,o,n),o++,n+=t.attribute.height}))})),t.rowHeaderGroup.forEachChildren((i=>{let o=t.bodyRowStart,n=t.getCellGroupY(o);null==i||i.forEachChildren((t=>{e(t,o,n),o++,n+=t.attribute.height}))})),t.rightFrozenGroup.forEachChildren((i=>{let o=t.bodyRowStart,n=t.getCellGroupY(o);null==i||i.forEachChildren((t=>{e(t,o,n),o++,n+=t.attribute.height}))})),t.bottomFrozenGroup.forEachChildren((i=>{let o=t.table.rowCount-t.table.bottomFrozenRowCount,n=0;null==i||i.forEachChildren((t=>{e(t,o,n),o++,n+=t.attribute.height}))})),t.leftBottomCornerGroup.forEachChildren((i=>{let o=t.table.rowCount-t.table.bottomFrozenRowCount,n=0;null==i||i.forEachChildren((t=>{e(t,o,n),o++,n+=t.attribute.height}))})),t.rightBottomCornerGroup.forEachChildren((i=>{let o=t.table.rowCount-t.table.bottomFrozenRowCount,n=0;null==i||i.forEachChildren((t=>{e(t,o,n),o++,n+=t.attribute.height}))}))}(n),s.length){const t=eM(s[0]-1,s[s.length-1]+1,n);a=Q(a)?Q(t)?Math.min(a,t):a:t}for(let t=0;t<o.colCount;t++)l.forEach((e=>{if(e<o.frozenRowCount||e>o.rowCount-1||e<n.table.rowCount-n.table.bottomFrozenRowCount&&(e<n.proxy.rowStart||e>n.proxy.rowEnd))tM(e,n);else{const i=Mx(n.table,t,e);if(i)for(let t=i.start.col;t<=i.end.col;t++)for(let e=i.start.row;e<=i.end.row;e++)sA(t,e,n.table,!1);else sA(t,e,n.table,!1)}}));if(l.length){const t=eM(l[0]-1,l[l.length-1]+1,n);a=Q(a)?Q(t)?Math.min(a,t):a:t}if(at(d)){for(let t=0;t<o.colCount;t++)for(let e=d;e<o.rowCount;e++){const i=n.highPerformanceGetCell(t,e,!0);i&&(i.needUpdate=!0)}a=Q(a)?Q(d)?Math.min(a,d):a:d}if(at(a)&&(n.proxy.rowUpdatePos=Math.min(n.proxy.rowUpdatePos,a)),s.length){if(!at(d)){const t=Math.min(...s);n.proxy.rowUpdatePos=Math.min(t,n.proxy.rowUpdatePos)}n.proxy.rowUpdateDirection="up",n.proxy.updateCellGroups(2*n.proxy.screenRowCount),u()}else r.length&&(function(t,e){if(e.table.isHasSeriesNumber())for(let i=t;i<=e.table.rowCount-1;i++)sA(0,i,e.table,!1)}(r[r.length-1],n),n.proxy.updateCellGroups(2*n.proxy.screenRowCount),u());n.proxy.progress();const c=o.getRowsHeight(o.frozenRowCount,o.rowCount-1-o.bottomFrozenRowCount);function u(){if((null==s?void 0:s[(null==s?void 0:s.length)-1])>=o.rowCount-o.bottomFrozenRowCount||(null==l?void 0:l[(null==l?void 0:l.length)-1])>=o.rowCount-o.bottomFrozenRowCount||(null==r?void 0:r[0])>=o.rowCount-o.bottomFrozenRowCount){for(let t=0;t<o.colCount;t++)for(let e=o.rowCount-o.bottomFrozenRowCount;e<o.rowCount;e++){const i=n.highPerformanceGetCell(t,e,!0);i&&(i.needUpdate=!0)}n.proxy.updateBottomFrozenCellGroups()}}n.updateContainerHeight(n.table.frozenRowCount,c-n.bodyGroup.attribute.height)}function QR(t,e){for(let i=0;i<e.table.colCount;i++){const o=new zS({x:0,y:0,width:e.table.getColWidth(i),height:e.table.getRowHeight(t)});if(o.role="cell",o.col=i,o.row=t,o.needUpdate=!0,!o)continue;const n=e.getColGroup(i);if(n)if(n.firstChild&&t<n.firstChild.row)n.insertBefore(o,n.firstChild),n.firstChild.row=n.firstChild.row+1;else if(n.lastChild&&t>n.lastChild.row)n.appendChild(o);else{const r=e.highPerformanceGetCell(i,t,!0);r!==o&&(n.insertBefore(o,r),r&&(r.row=r.row+1),r!==n.lastChild&&n.lastChild&&(n.lastChild.row=n.lastChild.row+1))}}}function tM(t,e){for(let i=0;i<e.table.colCount;i++){const o=e.getColGroup(i,!1);if(!o)continue;let n;o.forEachChildren((e=>e.row===t&&(n=e,!0))),n&&(o.updateColumnHeight(-n.attribute.height),o.removeChild(n))}}function eM(t,e,i){let o;for(let n=0;n<i.table.colCount;n++){const r=i.table.getCellRange(n,t);let s;r.start.row<=t+1&&r.end.row>=t+1&&(oM(r,i),s=r.start.row);const l=i.table.getCellRange(n,e);l.start.row<=e+1&&l.end.row>=e+1&&(oM(l,i),s=l.start.row),Q(s)&&(o=Q(o)?Math.min(o,s):s)}return o}function iM(t,e,i){let o;for(let n=0;n<i.table.colCount;n++){let r;const s=i.highPerformanceGetCell(n,t);s.mergeStartRow&&s.mergeEndRow&&s.mergeEndRow>t&&(oM({start:{row:s.mergeStartRow,col:"autoHeight"===i.table.heightMode?0:s.mergeStartCol},end:{row:s.mergeEndRow,col:"autoHeight"===i.table.heightMode?i.table.colCount-1:s.mergeEndCol}},i),r=s.mergeStartRow);const l=i.highPerformanceGetCell(n,e);l.mergeStartRow&&l.mergeEndRow&&l.mergeStartRow<e&&(oM({start:{row:l.mergeStartRow,col:"autoHeight"===i.table.heightMode?0:l.mergeStartCol},end:{row:l.mergeEndRow,col:"autoHeight"===i.table.heightMode?i.table.colCount-1:l.mergeEndCol}},i),r=l.mergeStartRow),Q(r)&&(o=Q(o)?Math.min(o,r):r)}return o}function oM(t,e){const{start:i,end:o}=t;for(let t=i.col;t<=o.col;t++)for(let n=i.row;n<=o.row;n++){const i=e.highPerformanceGetCell(t,n,!0);i&&(i.needUpdate=!0)}}function nM(t){var e,i,o,n;if(t.frozenColCount>t.table.frozenColCount){t.bodyGroup.setAttribute("height",t.rowHeaderGroup.attribute.height),t.bodyGroup.setAttribute("y",t.rowHeaderGroup.attribute.y),t.colHeaderGroup.setAttribute("height",t.cornerHeaderGroup.attribute.height);for(let e=0;e<t.frozenColCount-t.table.frozenColCount;e++)lM(t),aM(t),dM(t)}else if(t.frozenColCount<t.table.frozenColCount){t.rowHeaderGroup.setAttribute("height",t.bodyGroup.attribute.height),t.rowHeaderGroup.setAttribute("y",t.bodyGroup.attribute.y),t.cornerHeaderGroup.setAttribute("height",t.colHeaderGroup.attribute.height);for(let e=0;e<t.table.frozenColCount-t.frozenColCount;e++)rM(t),sM(t),hM(t)}(function(t){if(!t.table.reactCustomLayout)return;const{table:e,stage:i}=t,o=i.pluginService.findPluginsByName("ReactAttributePlugin")[0],{htmlMap:n}=o;for(const r in n){const s=n[r],{graphic:l,wrapContainer:a}=s;let h;if(t.frozenColCount>e.frozenColCount){const{col:i,row:o}=K_(l);o>=e.rowCount-e.bottomFrozenRowCount&&i<t.frozenColCount&&i>=e.frozenColCount&&l.attribute.react.container===e.frozenBottomDomContainer?h=e.bottomDomContainer:o>=e.frozenRowCount&&i<t.frozenColCount&&i>=e.frozenColCount&&l.attribute.react.container===e.frozenBodyDomContainer?h=e.bodyDomContainer:o<e.frozenRowCount&&i<t.frozenColCount&&i>=e.frozenColCount&&l.attribute.react.container===e.frozenHeaderDomContainer&&(h=e.headerDomContainer)}else if(t.frozenColCount<e.frozenColCount){const{col:i,row:o}=K_(l);o>=e.rowCount-e.bottomFrozenRowCount&&i<e.frozenColCount&&i>=t.frozenColCount&&l.attribute.react.container===e.bottomDomContainer?h=e.frozenBottomDomContainer:o>=e.frozenRowCount&&i<e.frozenColCount&&i>=t.frozenColCount&&l.attribute.react.container===e.bodyDomContainer?h=e.frozenBodyDomContainer:o<e.frozenRowCount&&i<e.frozenColCount&&i>=t.frozenColCount&&l.attribute.react.container===e.headerDomContainer&&(h=e.frozenHeaderDomContainer)}h&&(h.appendChild(a),s.nativeContainer=h,s.container=h,l.attribute.react.container=h,o.updateStyleOfWrapContainer(l,i,a,h,l.attribute.react))}})(t),t.deleteAllSelectBorder(),t.table.stateManager.select.ranges.forEach((e=>{t.updateCellSelectBorder(e)})),t.frozenColCount=t.table.frozenColCount,t.frozenRowCount=null!==(i=null===(e=t.colHeaderGroup.firstChild)||void 0===e?void 0:e.childrenCount)&&void 0!==i?i:0,t.proxy.colStart=null!==(n=null===(o=t.bodyGroup.firstChild)||void 0===o?void 0:o.col)&&void 0!==n?n:t.table.frozenColCount,t.bodyGroup.setAttribute("x",t.rowHeaderGroup.attribute.width),t.colHeaderGroup.setAttribute("x",t.cornerHeaderGroup.attribute.width),t.updateContainer(),t.updateBorderSizeAndPosition(),t.isPivot||t.table.transpose?t.table.options.frozenColCount?t.component.setFrozenColumnShadow(t.table.frozenColCount-1):t.table.options.rightFrozenColCount&&t.component.setRightFrozenColumnShadow(t.table.colCount-t.table.rightFrozenColCount):(t.component.setFrozenColumnShadow(t.table.frozenColCount-1),t.component.setRightFrozenColumnShadow(t.table.colCount-t.table.rightFrozenColCount)),t.hasFrozen=!0}function rM(t){const e=t.bodyGroup.firstChild instanceof zS?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 sM(t){const e=t.colHeaderGroup.firstChild instanceof zS?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 lM(t){var e;const i=t.rowHeaderGroup.lastChild instanceof zS?t.rowHeaderGroup.lastChild:null===(e=t.rowHeaderGroup.lastChild)||void 0===e?void 0:e._prev;i&&(cM(t.bodyGroup,i,t.bodyGroup.firstChild),t.bodyGroup.setAttribute("width",t.bodyGroup.attribute.width+i.attribute.width),t.rowHeaderGroup.setAttribute("width",t.rowHeaderGroup.attribute.width-i.attribute.width))}function aM(t){var e;const i=t.cornerHeaderGroup.lastChild instanceof zS?t.cornerHeaderGroup.lastChild:null===(e=t.cornerHeaderGroup.lastChild)||void 0===e?void 0:e._prev;i&&(cM(t.colHeaderGroup,i,t.colHeaderGroup.firstChild),t.colHeaderGroup.setAttribute("width",t.colHeaderGroup.attribute.width+i.attribute.width),t.cornerHeaderGroup.setAttribute("width",t.cornerHeaderGroup.attribute.width-i.attribute.width))}function hM(t){const e=t.bottomFrozenGroup.firstChild instanceof zS?t.bottomFrozenGroup.firstChild:null;e&&(t.leftBottomCornerGroup.appendChild(e),t.leftBottomCornerGroup.setAttribute("width",t.leftBottomCornerGroup.attribute.width+e.attribute.width),t.bottomFrozenGroup.setAttribute("width",t.bottomFrozenGroup.attribute.width-e.attribute.width),t.table.isPivotChart()&&e.forEachChildren((t=>{t.setAttributes({stroke:!1,fill:!1})})))}function dM(t){var e;const i=t.leftBottomCornerGroup.lastChild instanceof zS?t.leftBottomCornerGroup.lastChild:null===(e=t.leftBottomCornerGroup.lastChild)||void 0===e?void 0:e._prev;i&&(cM(t.bottomFrozenGroup,i,t.bottomFrozenGroup.firstChild),t.bottomFrozenGroup.setAttribute("width",t.bottomFrozenGroup.attribute.width+i.attribute.width),t.leftBottomCornerGroup.setAttribute("width",t.leftBottomCornerGroup.attribute.width-i.attribute.width),t.table.isPivotChart()&&i.forEachChildren((e=>{var i,o,n,r;const s=t.table._getCellStyle(e.col,e.row),l=t.table.getCellRange(e.col,e.row),a=G_(s,t.table,l?l.start.col:e.col,l?l.start.row:e.row,DS).theme;e.setAttributes({fill:null!==(o=null===(i=null==a?void 0:a.group)||void 0===i?void 0:i.fill)&&void 0!==o?o:void 0,stroke:null!==(r=null===(n=null==a?void 0:a.group)||void 0===n?void 0:n.stroke)&&void 0!==r?r:void 0})})))}function cM(t,e,i){e&&t&&(i?t.insertBefore(e,i):t.appendChild(e))}function uM(t){var e;for(let i=t.proxy.colStart;i<=t.proxy.colEnd;i++){const o=t.getColGroup(i);null===(e=null==o?void 0:o.getChildren())||void 0===e||e.forEach((t=>{t.children.forEach((t=>{"chart"===t.type&&(t.cacheCanvas=null,t.addUpdateBoundTag())}))}))}}function gM(t,e,i){t.forEachChildren((t=>{"chart"===t.type&&(t.cacheCanvas=null,t.setAttributes({width:Math.ceil(e-t.attribute.cellPadding[3]-t.attribute.cellPadding[1]),height:Math.ceil(i-t.attribute.cellPadding[0]-t.attribute.cellPadding[2])}))}))}function pM(t,e,i){return new zS({x:0,y:0,width:t,height:e,clip:null!=i&&i,pickable:!1})}function fM(t,e){return t.forEachChildrenSkipChild(((t,i)=>{t.setAttribute("x",e),e+=t.attribute.width})),e}function vM(t,e,i,o,n){const r=t.name;yM(i,o,(t=>t.name===r),(t=>{US(e,t),t.name=e.name}),n),n.updateNextFrame()}function mM(t){const{col:e,row:i,iconMark:o,order:n,oldSortCol:r,oldSortRow:s,oldIconMark:l,scene:a}=t,h=a.table.internalProps.headerHelper.getSortIcon(n,a.table,e,i);if(o&&vM(o,h,e,i,a),!function(t,e,i,o,n){const r=n.getCellRange(t,e),s=n.getCellRange(i,o);return r.start.col===s.start.col&&r.start.row===s.start.row&&r.end.col===s.end.col&&r.end.row===s.end.row}(e,i,r,s,a.table)){const t=a.table.internalProps.headerHelper.getSortIcon("normal",a.table,r,s);l?vM(l,t,r,s,a):function(t,e,i,o){const n=o.getCell(t,e);if(Q(n.mergeStartCol)&&Q(n.mergeStartRow)&&Q(n.mergeEndCol)&&Q(n.mergeEndRow))for(let t=n.mergeStartCol;t<=n.mergeEndCol;t++)for(let e=n.mergeStartRow;e<=n.mergeEndRow;e++){let n;o.getCell(t,e).forEachChildren((t=>"sort"===t.attribute.funcType&&(n=t,!0))),n&&(US(i,n),n.name=i.name)}else{let t;ww(n,"children",(e=>"sort"===e.attribute.funcType&&(t=e,!0))),t&&(US(i,t),t.name=i.name)}}(r,s,t,a)}}function bM(t,e,i){t.forEachChildren((t=>{"group"===t.type?bM(t,e,i):e(t)&&i(t)}))}function yM(t,e,i,o,n){const r=n.getCell(t,e);if("cell"===r.role&&Q(r.mergeStartCol)&&Q(r.mergeStartRow)&&Q(r.mergeEndCol)&&Q(r.mergeEndRow)){const{colStart:t,colEnd:e,rowStart:s,rowEnd:l}=PA(r,n);for(let r=t;r<=e;r++)for(let t=s;t<=l;t++)bM(n.highPerformanceGetCell(r,t),i,o)}else bM(r,i,o)}function CM(t,e){const{bgColor:i,borderColor:o,borderLineWidth:n,borderLineDash:r}=e,s={x:0,y:0,width:0,height:0,visible:!1,pickable:!0,fill:i};return s.stroke=lB(o,void 0),s.lineWidth=n,r&&(s.lineDash=r),s.lineCap="butt",Array.isArray(o)&&(s.strokeArrayColor=r_(o)),Array.isArray(n)&&(s.strokeArrayWidth=r_(n),s.lineWidth=1),t.setAttributes(s),t.role="corner-frozen",t}function wM(t,e,i,o){const n=o.scenegraph,r=xM(t.map((t=>t.col))).sort(((t,e)=>e-t)),s=xM(e.map((t=>t.col))).sort(((t,e)=>t-e)),l=xM(i.map((t=>t.col))).sort(((t,e)=>t-e));r.forEach((t=>{!function(t,e){const i=e.proxy;if(t>=e.table.rowHeaderLevelCount)if(t>=e.table.colCount-e.table.rightFrozenColCount);else{const i=e.getColGroup(t,!1);i&&i.parent===e.bodyGroup&&e.bodyGroup.removeChild(i);const o=e.getColGroupInBottom(t);o&&o.parent===e.bottomFrozenGroup&&e.bottomFrozenGroup.removeChild(o)}t>=i.colStart&&t<=i.colEnd&&(i.colEnd--,i.currentCol--),i.bodyRightCol--;const o=Math.min(i.colLimit,i.bodyRightCol-i.bodyLeftCol+1);i.totalActualBodyColCount=o,i.totalCol=i.colStart+o-1}(t,n)}));const a=o.colWidthsMap;let h;if(r.forEach((t=>{a.delAndReorder(t)})),r.length&&_M(n),n.table._clearColRangeWidthsMap(),s.forEach((t=>{const e=function(t,e){const i=e.proxy;i.bodyRightCol++;const o=Math.min(i.colLimit,i.bodyRightCol-i.bodyLeftCol+1);if(i.totalActualBodyColCount=o,i.totalCol=i.colStart+o-1,!(t<i.colStart))return t>i.colEnd?i.colEnd-i.colStart+1<i.colLimit?(i.colEnd++,i.currentCol++,SM(t,e),t):void 0:i.colEnd-i.colStart+1<i.colLimit?(i.colEnd++,i.currentCol++,SM(t,e),t):t}(t,n);_M(n),h=null!=h?h:e,a.addAndReorder(t)})),function(t){let e=t.bodyColStart,i=t.getCellGroupX(e);function o(i){i.col=e;const o=Mx(t.table,i.col,i.row);o&&(i.mergeStartCol=o.start.col,i.mergeStartCol=o.start.col,i.mergeEndCol=o.end.col,i.mergeEndCol=o.end.col),i.role}t.bodyGroup.forEachChildren((t=>{t.col=e,null==t||t.forEachChildren((t=>{o(t)})),t.setAttribute("x",i),i+=t.attribute.width,e++})),e=t.bodyColStart,i=t.getCellGroupX(e),t.colHeaderGroup.forEachChildren((t=>{t.col=e,null==t||t.forEachChildren((t=>{o(t)})),t.setAttribute("x",i),i+=t.attribute.width,e++})),e=t.bodyColStart,i=t.getCellGroupX(e),t.bottomFrozenGroup.forEachChildren((t=>{t.col=e,null==t||t.forEachChildren((t=>{o(t)})),t.setAttribute("x",i),i+=t.attribute.width,e++})),e=t.table.colCount-t.table.rightFrozenColCount,i=0,t.rightFrozenGroup.forEachChildren((t=>{t.col=e,null==t||t.forEachChildren((t=>{o(t)})),t.setAttribute("x",i),i+=t.attribute.width,e++})),e=t.table.colCount-t.table.rightFrozenColCount,i=0,t.rightTopCornerGroup.forEachChildren((t=>{t.col=e,null==t||t.forEachChildren((t=>{o(t)})),t.setAttribute("x",i),i+=t.attribute.width,e++})),e=t.table.colCount-t.table.rightFrozenColCount,i=0,t.rightBottomCornerGroup.forEachChildren((t=>{t.col=e,null==t||t.forEachChildren((t=>{o(t)})),t.setAttribute("x",i),i+=t.attribute.width,e++}))}(n),l.forEach((t=>{for(let e=0;e<o.rowCount;e++){const i=Mx(n.table,t,e);if(i)for(let t=i.start.col;t<=i.end.col;t++)for(let t=i.start.col;t<=i.end.col;t++)sA(t,e,n.table,!1);else sA(t,e,n.table,!1)}})),at(h)){for(let t=h;t<o.colCount;t++)for(let e=0;e<o.rowCount;e++){const i=n.highPerformanceGetCell(t,e,!0);i&&(i.needUpdate=!0)}n.proxy.colUpdatePos=h}if(s.length){if(!at(h)){const t=Math.min(...s);n.proxy.colUpdatePos=t}n.proxy.colUpdateDirection="left",n.proxy.updateColGroups(2*n.proxy.screenColCount),c(),n.proxy.progress()}else r.length&&(n.proxy.updateColGroups(2*n.proxy.screenColCount),c(),n.proxy.progress());const d=o.getColsWidth(o.frozenColCount,o.colCount-1);function c(){if((null==s?void 0:s[(null==s?void 0:s.length)-1])>=o.colCount-o.rightFrozenColCount||(null==l?void 0:l[(null==l?void 0:l.length)-1])>=o.colCount-o.rightFrozenColCount||(null==r?void 0:r[0])>=o.colCount-o.rightFrozenColCount){for(let t=o.colCount-o.rightFrozenColCount;t<o.colCount;t++)for(let e=0;e<o.rowCount;e++){const i=n.highPerformanceGetCell(t,e,!0);i&&(i.needUpdate=!0)}n.proxy.updateRightFrozenCellGroups()}}n.updateContainerWidth(n.table.frozenColCount,d-n.bodyGroup.attribute.width)}function xM(t){const e=[];for(let i=0;i<t.length;i++)-1===e.indexOf(t[i])&&e.push(t[i]);return e}function _M(t){let e=t.bodyColStart;function i(i){i.col=e;const o=Mx(t.table,i.col,i.row);o&&(i.mergeStartCol=o.start.col,i.mergeStartCol=o.start.col,i.mergeEndCol=o.end.col,i.mergeEndCol=o.end.col),i.role}t.bodyGroup.forEachChildren((t=>{t.col=e,null==t||t.forEachChildren((t=>{i(t)})),e++})),e=t.bodyColStart,t.colHeaderGroup.forEachChildren((t=>{t.col=e,null==t||t.forEachChildren((t=>{i(t)})),e++})),e=t.bodyColStart,t.bottomFrozenGroup.forEachChildren((t=>{t.col=e,null==t||t.forEachChildren((t=>{i(t)})),e++}))}function SM(t,e){if(e.colHeaderGroup&&e.table.columnHeaderLevelCount>0){const o=new zS({x:0,y:0,width:e.table.getColWidth(t),height:0,clip:!1,pickable:!1});o.role="column",o.col=t;const n=e.getColGroup(t,!0);n?e.colHeaderGroup.insertBefore(o,n):e.colHeaderGroup.appendChild(o),i(o,t,0,e.table.columnHeaderLevelCount-1)}if(e.bodyGroup){const o=new zS({x:0,y:0,width:e.table.getColWidth(t),height:0,clip:!1,pickable:!1});o.role="column",o.col=t;const n=e.getColGroup(t,!1);n?e.bodyGroup.insertBefore(o,n):e.bodyGroup.appendChild(o),i(o,t,e.bodyRowStart,e.bodyRowEnd)}if(e.bottomFrozenGroup&&e.table.bottomFrozenRowCount>0){const o=new zS({x:0,y:0,width:e.table.getColWidth(t),height:0,clip:!1,pickable:!1});o.role="column",o.col=t;const n=e.getColGroupInBottom(t);n?e.bottomFrozenGroup.insertBefore(o,n):e.bottomFrozenGroup.appendChild(o),i(o,t,e.table.rowCount-e.table.bottomFrozenRowCount,e.table.rowCount-1)}function i(t,i,o,n){for(let r=o;r<=n;r++){const o=new zS({x:0,y:0,width:e.table.getColWidth(i),height:e.table.getRowHeight(r)});o.role="cell",o.col=i,o.row=r,o.needUpdate=!0,t.appendChild(o)}}}oC(),nn.load(eR),nn.load(mA);class AM{constructor(t){let e,i;var o;this._needUpdateContainer=!1,this.table=t,this.hasFrozen=!1,this.clear=!0,this.mergeMap=new Map,o=this.table.theme.textPopTipStyle,St(Dm.poptip,Om,o),t.options.canvas&&t.options.viewBox?(bu.setEnv("browser"),e=t.options.viewBox.x2-t.options.viewBox.x1,i=t.options.viewBox.y2-t.options.viewBox.y1):"node"===sw.mode?(bu.setEnv("node",t.options.modeParams),e=t.canvasWidth,i=t.canvasHeight):(bu.setEnv("browser"),e=t.canvas.width,i=t.canvas.height),this.stage=Hu(Object.assign({canvas:t.canvas,width:e,height:i,disableDirtyBounds:!1,background:t.theme.underlayBackgroundColor,dpr:t.internalProps.pixelRatio,enableLayout:!0,beforeRender:t=>{this.table.options.beforeRender&&this.table.options.beforeRender(t)},afterRender:t=>{this.table.options.afterRender&&this.table.options.afterRender(t),this.table.fireListeners("after_render",null)},canvasControled:!t.options.canvas,viewBox:t.options.viewBox},t.options.renderOption)),this.stage.defaultLayer.setTheme({group:{boundsPadding:0,strokeBoundsBuffer:0,lineJoin:"round"},text:{ignoreBuf:!0}}),this.initSceneGraph(),this.stage.defaultLayer.add(this.tableGroup),this.stage.table=this.table,this.createComponent()}get width(){var t,e;return null!==(e=null===(t=this.tableGroup.attribute)||void 0===t?void 0:t.width)&&void 0!==e?e:0}get height(){var t,e;return null!==(e=null===(t=this.tableGroup.attribute)||void 0===t?void 0:t.height)&&void 0!==e?e:0}get x(){var t,e;return null!==(e=null===(t=this.tableGroup.attribute)||void 0===t?void 0:t.x)&&void 0!==e?e:0}get y(){var t,e;return null!==(e=null===(t=this.tableGroup.attribute)||void 0===t?void 0:t.y)&&void 0!==e?e:0}get bodyRowStart(){var t;return null!==(t=this.proxy.rowStart)&&void 0!==t?t:0}get bodyRowEnd(){var t;return null!==(t=this.proxy.rowEnd)&&void 0!==t?t:this.table.rowCount-1}get bodyColStart(){var t;return null!==(t=this.proxy.colStart)&&void 0!==t?t:0}get bodyColEnd(){var t;return null!==(t=this.proxy.colEnd)&&void 0!==t?t:this.table.colCount-1}initSceneGraph(){this.isPivot=this.table.isPivotTable(),function(t){const e=t.table.tableNoFrameWidth,i=t.table.tableNoFrameHeight;t.tableGroup=new zS({x:0,y:0,width:e,height:i,clip:!0,pickable:!1}),t.tableGroup.role="table";const o=pM(0,0,!t.table.options.enableTreeStickCell);o.role="col-header",t.colHeaderGroup=o;const n=pM(0,0,!t.table.options.enableTreeStickCell);n.role="corner-header",t.cornerHeaderGroup=n;const r=pM(0,0,!0);r.role="row-header",t.rowHeaderGroup=r;const s=pM(e,0,!0);s.role="body",t.bodyGroup=s;const l=pM(0,0,!0);l.role="right-frozen",t.rightFrozenGroup=l;const a=pM(0,0,!0);a.role="bottom-frozen",t.bottomFrozenGroup=a;const h=pM(0,0);h.role="component",t.componentGroup=h;const d=pM(0,0,!0);d.role="corner-right-top-header",t.rightTopCornerGroup=d;const c=pM(0,0,!0);c.role="corner-right-bottom-header",t.rightBottomCornerGroup=c;const u=pM(0,0,!0);u.role="corner-left-bottom-header",t.leftBottomCornerGroup=u,t.tableGroup.addChild(s),t.tableGroup.addChild(r),t.tableGroup.addChild(a),t.tableGroup.addChild(o),t.tableGroup.addChild(l),t.tableGroup.addChild(c),t.tableGroup.addChild(d),t.tableGroup.addChild(u),t.tableGroup.addChild(n),t.tableGroup.addChild(h)}(this)}clearCells(){var t,e;this.table.animationManager.clear(),(this.table.isPivotChart()||this.table._hasCustomRenderOrLayout())&&this.stage.pluginService.findPluginsByName("poptipForText").forEach((t=>{t.deactivate(this.stage.pluginService)})),this.clear=!0,this.hasFrozen=!1,this.mergeMap.clear(),this.colHeaderGroup.clear(),this.rowHeaderGroup.clear(),this.cornerHeaderGroup.clear(),this.bodyGroup.clear(),this.bottomFrozenGroup.clear(),this.rightFrozenGroup.clear(),this.rightTopCornerGroup.clear(),this.rightBottomCornerGroup.clear(),this.leftBottomCornerGroup.clear(),this.colHeaderGroup.setAttributes({x:0,y:0,width:0,height:0}),this.rowHeaderGroup.setAttributes({x:0,y:0,width:0,height:0}),this.cornerHeaderGroup.setAttributes({x:0,y:0,width:0,height:0}),this.bodyGroup.setAttributes({x:0,y:0,width:0,height:0}),this.rightFrozenGroup.setAttributes({x:0,y:0,width:0,height:0}),this.bottomFrozenGroup.setAttributes({x:0,y:0,width:0,height:0}),this.rightTopCornerGroup.setAttributes({x:0,y:0,width:0,height:0,visible:!1}),this.leftBottomCornerGroup.setAttributes({x:0,y:0,width:0,height:0,visible:!1}),this.rightBottomCornerGroup.setAttributes({x:0,y:0,width:0,height:0,visible:!1}),this.tableGroup.setAttributes({x:this.table.tableX,y:this.table.tableY,width:0,height:0}),this.tableGroup.border&&(this.tableGroup.parent.removeChild(this.tableGroup.border),delete this.tableGroup.border),null===(t=this.proxy)||void 0===t||t.release(),null===(e=this.table.reactCustomLayout)||void 0===e||e.clearCache()}updateStageBackground(){this.stage.background=this.table.theme.underlayBackgroundColor,this.stage.renderNextFrame()}createComponent(){this.component=new nB(this.table),this.component.addToGroup(this.componentGroup),this.selectedRangeComponents=new Map,this.selectingRangeComponents=new Map}updateComponent(){this.component.updateStyle()}createSceneGraph(){arguments.length>0&&void 0!==arguments[0]&&arguments[0]||(this.table.rowHeightsMap.clear(),this.table.internalProps.layoutMap.clearCellRangeMap()),(this.table.isPivotChart()||this.table._hasCustomRenderOrLayout())&&this.stage.pluginService.autoEnablePlugins.getContributions().forEach((t=>{"poptipForText"===t.name&&this.stage.pluginService.register(t)})),this.clear=!1,this.frozenColCount=this.table.frozenColCount,this.frozenRowCount=this.table.frozenRowCount,this.proxy=new jR(this.table),rB(this.tableGroup,this.table.theme.frameStyle,this.tableGroup.role,void 0,!0),this.table.isPivotChart()&&(CM(this.rightTopCornerGroup,this.table.theme.cornerRightTopCellStyle||this.table.theme.cornerHeaderStyle||{}),CM(this.leftBottomCornerGroup,this.table.theme.cornerLeftBottomCellStyle||this.table.theme.cornerHeaderStyle||{}),CM(this.rightBottomCornerGroup,this.table.theme.cornerRightBottomCellStyle||this.table.theme.cornerHeaderStyle||{})),this.proxy.createGroupForFirstScreen(this.cornerHeaderGroup,this.colHeaderGroup,this.rowHeaderGroup,this.rightFrozenGroup,this.bottomFrozenGroup,this.bodyGroup,0,0),this.afterScenegraphCreated()}renderSceneGraph(){this.stage.render()}getCell(t,e,i){var o,n,r,s,l,a;let h;if(h=this.table.rightFrozenColCount>0&&t>=this.table.colCount-this.table.rightFrozenColCount&&e<this.table.frozenRowCount?null===(o=this.rightTopCornerGroup.getColGroup(t))||void 0===o?void 0:o.getRowGroup(e):this.table.bottomFrozenRowCount>0&&e>=this.table.rowCount-this.table.bottomFrozenRowCount&&t<this.table.frozenColCount?null===(n=this.leftBottomCornerGroup.getColGroup(t))||void 0===n?void 0:n.getRowGroup(e):this.table.rightFrozenColCount>0&&this.table.bottomFrozenRowCount>0&&t>=this.table.colCount-this.table.rightFrozenColCount&&e>=this.table.rowCount-this.table.bottomFrozenRowCount?null===(r=this.rightBottomCornerGroup.getColGroup(t))||void 0===r?void 0:r.getRowGroup(e):this.table.rightFrozenColCount>0&&t>this.table.colCount-1-this.table.rightFrozenColCount?null===(s=this.rightFrozenGroup.getColGroup(t))||void 0===s?void 0:s.getRowGroup(e):this.table.bottomFrozenRowCount>0&&e>this.table.rowCount-1-this.table.bottomFrozenRowCount?null===(l=this.bottomFrozenGroup.getColGroup(t))||void 0===l?void 0:l.getRowGroup(e):null===(a=this.getColGroup(t,e<this.frozenRowCount))||void 0===a?void 0:a.getRowGroup(e),h&&"shadow-cell"===h.role&&!i){const i=this.table.getCellRange(t,e);i.start.col===t&&i.start.row===e||(h=this.getCell(i.start.col,i.start.row))}return h||hR}highPerformanceGetCell(t,e,i){return this.proxy.highPerformanceGetCell(t,e,i)}getColGroup(t){let e,i=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return e=t<this.frozenColCount&&i?this.cornerHeaderGroup.getColGroup(t):t<this.frozenColCount?this.rowHeaderGroup.getColGroup(t):i&&this.table.rightFrozenColCount>0&&t>this.table.colCount-1-this.table.rightFrozenColCount?this.rightTopCornerGroup.getColGroup(t):!i&&this.table.rightFrozenColCount>0&&t>this.table.colCount-1-this.table.rightFrozenColCount?this.rightFrozenGroup.getColGroup(t):i?this.colHeaderGroup.getColGroup(t):this.bodyGroup.getColGroup(t),e||void 0}getColGroupInBottom(t){if(this.table.bottomFrozenRowCount>0)return this.bottomFrozenGroup.getColGroup(t)}getColGroupInLeftBottomCorner(t){if(this.table.bottomFrozenRowCount>0)return this.leftBottomCornerGroup.getColGroup(t)}getColGroupInRightTopCorner(t){if(this.table.rightFrozenColCount>0)return this.rightTopCornerGroup.getColGroup(t)}getColGroupInRightBottomCorner(t){if(this.table.rightFrozenColCount>0&&this.table.bottomFrozenRowCount>0)return this.rightBottomCornerGroup.getColGroup(t)}getCellSize(t,e){const i=this.getCell(t,e),o=Mx(this.table,t,e);let n=i.attribute.width,r=i.attribute.height;return o&&(n/=o.end.col-o.start.col+1,r/=o.end.row-o.start.row+1),{width:n,height:r}}updateNextFrame(){this.updateContainerSync(),this.resetAllSelectComponent(),this.stage.renderNextFrame()}resetAllSelectComponent(){var t,e,i;(null===(e=null===(t=this.table.stateManager.select)||void 0===t?void 0:t.ranges)||void 0===e?void 0:e.length)>0&&((i=this).selectingRangeComponents.forEach(((t,e)=>{UR(t,e,i)})),i.selectedRangeComponents.forEach(((t,e)=>{UR(t,e,i)})))}hideHoverIcon(t,e){!function(t,e,i){-1!==t&&-1!==e&&(yM(t,e,(t=>"mouseenter_cell"===t.attribute.visibleTime),(t=>{t.setAttribute("opacity",0);const e=t.parent.getChildByName("icon-back");e&&e.setAttribute("visible",!1)}),i),i.updateNextFrame())}(t,e,this)}showHoverIcon(t,e){!function(t,e,i){-1!==t&&-1!==e&&(yM(t,e,(t=>"mouseenter_cell"===t.attribute.visibleTime),(t=>{t.setAttribute("opacity",1)}),i),i.updateNextFrame())}(t,e,this)}hideClickIcon(t,e){!function(t,e,i){-1!==t&&-1!==e&&(yM(t,e,(t=>"click_cell"===t.attribute.visibleTime),(t=>{t.setAttribute("opacity",0)}),i),i.updateNextFrame())}(t,e,this)}showClickIcon(t,e){!function(t,e,i){-1!==t&&-1!==e&&(yM(t,e,(t=>"click_cell"===t.attribute.visibleTime),(t=>{t.setAttribute("opacity",1)}),i),i.updateNextFrame())}(t,e,this)}getIcon(t,e,i,o){return function(t,e,i,o,n){let r;return n.getCell(t,e).forEachChildren((t=>{t.role&&t.role.startsWith("icon")&&t.containsPoint(i,o,xi.GLOBAL)&&(r=t)})),r}(t,e,i,o,this)}setIconHoverStyle(t,e,i,o){!function(t,e,i,o,n){var r,s;if((t.attribute.backgroundColor||t.attribute.hoverImage)&&yM(e,i,(e=>e.name===t.name),(t=>{var e,i,o,n,r,s,l,a;if(t.attribute.backgroundColor){let h=t.parent.getChildByName("icon-back");h?h.setAttributes({x:(null!==(e=t.attribute.x)&&void 0!==e?e:0)+(t.AABBBounds.width()-t.backgroundWidth)/2,y:(null!==(i=t.attribute.y)&&void 0!==i?i:0)+(t.AABBBounds.height()-t.backgroundHeight)/2,dx:null!==(o=t.attribute.dx)&&void 0!==o?o:0,dy:null!==(n=t.attribute.dy)&&void 0!==n?n:0,width:t.backgroundWidth,height:t.backgroundHeight,fill:t.attribute.backgroundColor,cornerRadius:5,visible:!0}):(h=sc({x:(null!==(r=t.attribute.x)&&void 0!==r?r:0)+(t.AABBBounds.width()-t.backgroundWidth)/2,y:(null!==(s=t.attribute.y)&&void 0!==s?s:0)+(t.AABBBounds.height()-t.backgroundHeight)/2,dx:null!==(l=t.attribute.dx)&&void 0!==l?l:0,dy:null!==(a=t.attribute.dy)&&void 0!==a?a:0,width:t.backgroundWidth,height:t.backgroundHeight,fill:t.attribute.backgroundColor,cornerRadius:5,pickable:!1,visible:!0}),h.name="icon-back"),t.parent.insertBefore(h,t)}t.attribute.hoverImage&&t.attribute.image!==t.attribute.hoverImage&&(t.image=t.attribute.hoverImage)}),n),t.tooltip){const{x1:o,x2:l,y1:a,y2:h}=t.globalAABBBounds,d={content:t.tooltip.title,referencePosition:{rect:{left:o,right:l,top:a,bottom:h,width:t.globalAABBBounds.width(),height:t.globalAABBBounds.height()},placement:t.tooltip.placement},disappearDelay:t.tooltip.disappearDelay,style:Object.assign({},null===(r=n.table.internalProps.theme)||void 0===r?void 0:r.tooltipStyle,null===(s=t.tooltip)||void 0===s?void 0:s.style)};n.table.internalProps.tooltipHandler.isBinded(d)||n.table.showTooltip(e,i,d)}}(t,e,i,0,this)}updateSortIcon(t){const{col:e,row:i,iconMark:o,order:n,oldSortCol:r,oldSortRow:s,oldIconMark:l}=t;mM({col:e,row:i,iconMark:o,order:n,oldSortCol:r,oldSortRow:s,oldIconMark:l,scene:this})}updateFrozenIcon(t,e){!function(t){for(let e=0;e<t.table.colCount;e++)for(let i=0;i<t.table.columnHeaderLevelCount;i++)yM(e,i,(t=>"frozen"===t.attribute.funcType),(o=>{const n=t.table.internalProps.headerHelper.getFrozenIcon(e,i);US(n,o),o.name=n.name}),t)}(this)}updateHierarchyIcon(t,e){!function(t,e,i){let o;o=i.table.isHeader(t,e)?i.table.internalProps.headerHelper.getHierarchyIcon(t,e):i.table.internalProps.bodyHelper.getHierarchyIcon(t,e),yM(t,e,(t=>t.attribute.funcType===VC.collapse||t.attribute.funcType===VC.expand),(t=>{US(o,t),t.name=o.name}),i)}(t,e,this)}setIconNormalStyle(t,e,i){!function(t,e,i,o){(t.attribute.backgroundColor||t.attribute.hoverImage)&&yM(e,i,(e=>e.name===t.name),(t=>{const e=t.parent.getChildByName("icon-back");e&&e.setAttribute("visible",!1),t.attribute.hoverImage&&t.attribute.image!==t.attribute.originImage&&(t.image=t.attribute.originImage)}),o)}(t,e,i,this)}residentHoverIcon(t,e){!function(t,e,i){yM(t,e,(t=>t.attribute.funcType===VC.dropDown),(t=>{t.oldVisibleTime=t.attribute.visibleTime,t.setAttribute("visibleTime","always"),t.setAttribute("opacity",1)}),i)}(t,e,this)}resetResidentHoverIcon(t,e){!function(t,e,i){yM(t,e,(t=>t.attribute.funcType===VC.dropDown),(t=>{t.oldVisibleTime&&t.setAttribute("visibleTime",t.oldVisibleTime),t.setAttribute("opacity","always"===t.attribute.visibleTime?1:0)}),i)}(t,e,this)}deactivateChart(t,e){var i,o;if(-1===t||-1===e)return;const n=this.getCell(t,e);null===(o=null===(i=null==n?void 0:n.firstChild)||void 0===i?void 0:i.deactivate)||void 0===o||o.call(i)}activateChart(t,e){var i,o;if(-1===t||-1===e)return;const n=this.getCell(t,e);null===(o=null===(i=null==n?void 0:n.firstChild)||void 0===i?void 0:i.activate)||void 0===o||o.call(i,this.table)}removeInteractionBorder(t,e){const i=this.getCell(t,e);i.setAttribute("highlightStroke",void 0),i.setAttribute("highlightStrokeArrayWidth",void 0),i.setAttribute("highlightStrokeArrayColor",void 0)}createCellSelectBorder(t,e,i,o,n,r,s){!function(t,e,i,o,n,r,s,l){var a,h,d,c,u,g,p,f;let v=!!(null===(a=t.table.options.excelOptions)||void 0===a?void 0:a.fillHandle);if((null===(h=t.table.stateManager.select.ranges)||void 0===h?void 0:h.length)>1)v=!1,t.removeFillHandleFromSelectComponents();else if(1===(null===(d=t.table.stateManager.select.ranges)||void 0===d?void 0:d.length)){const e=Math.max(t.table.stateManager.select.ranges[0].start.row,t.table.stateManager.select.ranges[0].end.row),i=Math.max(t.table.stateManager.select.ranges[0].start.col,t.table.stateManager.select.ranges[0].end.col);t.table.isHeader(i,e)&&(v=!1)}!Array.isArray(l)||!1!==l[1]&&!1!==l[2]||(v=!1);const m=Math.min(e,o),b=Math.min(i,n),y=Math.max(e,o),C=Math.max(i,n),w=t.highPerformanceGetCell(m,b).globalAABBBounds,x=t.highPerformanceGetCell(y,C).globalAABBBounds,_=t.table.theme,S=null===(c=_.selectionStyle)||void 0===c?void 0:c.cellBorderColor,A=null===(u=_.selectionStyle)||void 0===u?void 0:u.cellBorderLineWidth,B=sc({pickable:!1,fill:"replace"!==(null===(g=_.selectionStyle)||void 0===g?void 0:g.selectionFillMode)&&(null!==(f=null===(p=_.selectionStyle)||void 0===p?void 0:p.cellBgColor)&&void 0!==f?f:"rgba(0, 0, 255,0.1)"),lineWidth:A,stroke:l.map((t=>!!t&&S)),x:w.x1-t.tableGroup.attribute.x,y:w.y1-t.tableGroup.attribute.y,width:0,height:0,visible:!0});let R;v&&(R=sc({pickable:!1,fill:S,stroke:S,x:x.x2-3,y:x.y2-3,width:6,height:6,visible:!0})),t.lastSelectId=s,t.selectingRangeComponents.set(`${m}-${b}-${y}-${C}-${s}`,{rect:B,fillhandle:R,role:r}),t.tableGroup.insertAfter(B,"body"===r?t.bodyGroup:"columnHeader"===r?t.colHeaderGroup:"rowHeader"===r?t.rowHeaderGroup:"cornerHeader"===r?t.cornerHeaderGroup:"rightTopCorner"===r?t.rightTopCornerGroup:"rightFrozen"===r?t.rightFrozenGroup:"leftBottomCorner"===r?t.leftBottomCornerGroup:"bottomFrozen"===r?t.bottomFrozenGroup:t.rightBottomCornerGroup),v&&t.tableGroup.insertAfter(R,"body"===r?t.bodyGroup:"columnHeader"===r?t.colHeaderGroup:"rowHeader"===r?t.rowHeaderGroup:"cornerHeader"===r?t.cornerHeaderGroup:"rightTopCorner"===r?t.rightTopCornerGroup:"rightFrozen"===r?t.rightFrozenGroup:"leftBottomCorner"===r?t.leftBottomCornerGroup:"bottomFrozen"===r?t.bottomFrozenGroup:t.rightBottomCornerGroup)}(this,t,e,i,o,n,r,s)}moveSelectingRangeComponentsToSelectedRangeComponents(){KR(this)}deleteLastSelectedRangeComponents(){var t;(t=this).selectedRangeComponents.forEach(((e,i)=>{var o;i.split("-")[4]===t.lastSelectId&&(e.rect.delete(),null===(o=e.fillhandle)||void 0===o||o.delete(),t.selectedRangeComponents.delete(i))}))}deleteAllSelectBorder(){qR(this),ZR(this)}updateCellSelectBorder(t){$R(this,t,!(arguments.length>1&&void 0!==arguments[1])||arguments[1])}removeFillHandleFromSelectComponents(){this.selectedRangeComponents.forEach(((t,e)=>{var i;null===(i=t.fillhandle)||void 0===i||i.delete(),t.fillhandle=void 0}))}recreateAllSelectRangeComponents(){qR(this),this.table.stateManager.select.ranges.forEach((t=>{$R(this,t)})),KR(this)}updateColWidth(t,e,i,o){(function(t,e,i,o){o||t.table._setColWidth(e,t.table.getColWidth(e)+i,!0);const n=t.getColGroup(e,!0),r=t.getColGroupInRightTopCorner(e);n&&!r&&zA(n,i,"col-corner",t),r&&zA(r,i,"right-top",t);const s=t.getColGroup(e);s&&zA(s,i,"row-body",t);const l=t.getColGroupInLeftBottomCorner(e);l&&zA(l,i,"left-bottom",t);const a=t.getColGroupInBottom(e);a&&zA(a,i,"bottom",t);const h=t.getColGroupInRightBottomCorner(e);h&&zA(h,i,"right-bottom",t),e<t.frozenColCount?(t.cornerHeaderGroup.forEachChildrenSkipChild(((t,o)=>{t.col>e&&t.setAttribute("x",t.attribute.x+i)})),t.rowHeaderGroup.forEachChildrenSkipChild(((t,o)=>{t.col>e&&t.setAttribute("x",t.attribute.x+i)}))):(t.colHeaderGroup.forEachChildrenSkipChild(((t,o)=>{t.col>e&&t.setAttribute("x",t.attribute.x+i)})),t.bodyGroup.forEachChildrenSkipChild(((t,o)=>{t.col>e&&t.setAttribute("x",t.attribute.x+i)}))),l&&t.leftBottomCornerGroup.forEachChildrenSkipChild(((t,o)=>{t.col>e&&t.setAttribute("x",t.attribute.x+i)})),a&&t.bottomFrozenGroup.forEachChildrenSkipChild(((t,o)=>{t.col>e&&t.setAttribute("x",t.attribute.x+i)})),h&&t.rightBottomCornerGroup.forEachChildrenSkipChild(((t,o)=>{t.col>e&&t.setAttribute("x",t.attribute.x+i)}))})(this,t,Math.round(e),o),i||this.updateContainer(!0)}updateChartSizeForResizeColWidth(t){!function(t,e){const{table:i}=t,o=i.internalProps.layoutMap,n=-1===e?"all":i.internalProps.columnResizeType;if("column"===n){const o=t.getColGroup(e);if(null==o||o.forEachChildren((t=>{gM(t,i.getColWidth(t.col),i.getRowHeight(t.row))})),"adaptive"===i.widthMode&&e<i.colCount-1){const o=t.getColGroup(e+1);null==o||o.forEachChildren((t=>{gM(t,i.getColWidth(t.col),i.getRowHeight(t.row))}))}}else{let r,s,l,a=i.rowHeaderLevelCount,h=i.colCount-1;if("indicator"===n)if(o.indicatorsAsCol)r=o.getIndicatorKey(e,i.columnHeaderLevelCount);else{const t=o.getCellHeaderPaths(e,i.columnHeaderLevelCount-1),n=t.colHeaderPaths[t.colHeaderPaths.length-1];s=n.dimensionKey,l=n.value}else if("indicatorGroup"===n){const t=i.internalProps.layoutMap,e=t.getCellHeaderPaths(i.stateManager.columnResize.col,i.columnHeaderLevelCount),o=t.getHeadNodeByRowOrColDimensions(e.colHeaderPaths.slice(0,e.colHeaderPaths.length-1));a=o.startInTotal+i.frozenColCount,h=o.startInTotal+i.frozenColCount+o.size-1}for(let e=a;e<=h;e++){const a=t.getColGroup(e);if(a){if("indicator"===n){const t=o.getIndicatorKey(e,i.columnHeaderLevelCount);if(o.indicatorsAsCol&&t!==r)continue;if(!o.indicatorsAsCol){const t=o.getCellHeaderPaths(e,i.columnHeaderLevelCount-1),n=null==t?void 0:t.colHeaderPaths[t.colHeaderPaths.length-1];if(!n||s!==n.dimensionKey||l!==n.value)continue}}a.forEachChildren((t=>{gM(t,i.getColWidth(t.col),i.getRowHeight(t.row))}))}}}}(this,t)}updateChartSizeForResizeRowHeight(t){!function(t,e){var i;const{table:o}=t,n=o.internalProps.layoutMap,r=o.stateManager,s=-1===e?"all":o.internalProps.rowResizeType;let l,a,h,d=o.columnHeaderLevelCount,c=o.rowCount-1;if("indicator"===s)if(n.indicatorsAsCol){const t=n.getCellHeaderPaths(o.rowHeaderLevelCount-1,e),r=null===(i=t.rowHeaderPaths)||void 0===i?void 0:i[t.rowHeaderPaths.length-1];a=null==r?void 0:r.dimensionKey,h=null==r?void 0:r.value}else l=n.getIndicatorKey(o.rowHeaderLevelCount,e);else if("indicatorGroup"===s){const t=o.internalProps.layoutMap,i=t.getCellHeaderPaths(o.rowHeaderLevelCount,e),n=t.getHeadNodeByRowOrColDimensions(i.rowHeaderPaths.slice(0,i.rowHeaderPaths.length-1));d=n.startInTotal+o.frozenRowCount,c=n.startInTotal+o.frozenRowCount+n.size-1}for(let i=t.proxy.colStart;i<=t.proxy.colEnd;i++)if("row"===s){const n=t.highPerformanceGetCell(i,e);if("cell"!==n.role)continue;if(gM(n,o.getColWidth(n.col),o.getRowHeight(n.row)),"adaptive"===o.heightMode&&e<o.rowCount-1){const n=t.highPerformanceGetCell(i,e+1);gM(n,o.getColWidth(n.col),o.getRowHeight(n.row))}}else for(let e=d;e<=c;e++){if("indicator"===s){const t=n.getIndicatorKey(r.table.rowHeaderLevelCount,e);if(!n.indicatorsAsCol&&t!==l)continue;if(n.indicatorsAsCol){const t=n.getCellHeaderPaths(r.table.rowHeaderLevelCount-1,e),i=null==t?void 0:t.rowHeaderPaths[t.rowHeaderPaths.length-1];if(!i||a!==i.dimensionKey||h!==i.value)continue}}const d=t.highPerformanceGetCell(i,e);"cell"===d.role&&gM(d,o.getColWidth(d.col),o.getRowHeight(d.row))}}(this,t)}updateChartState(t){this.table.isPivotChart()&&function(t,e){const i=t.table;if(i.isPivotChart()){const o=i._selectedDataItemsInChart.length;if((null===e||0===(null==e?void 0:e.length)||0===Object.keys(e).length)&&0===o)return;const n=[];if(Array.isArray(e))e.forEach((t=>{if(t&&0!==t.key&&Object.keys(t).length>0){const e={};for(const i in t)i.startsWith("VGRAMMAR_")||i.startsWith("__VCHART")||(e[i]=t[i]);n.push(e)}}));else if(e&&0!==e.key&&Object.keys(e).length>0){const t={};for(const i in e)i.startsWith("VGRAMMAR_")||i.startsWith("__VCHART")||(t[i]=e[i]);n.push(t)}Rt(i._selectedDataItemsInChart,n)||(i._selectedDataItemsInChart=n,i.internalProps.layoutMap.updateDataStateToChartInstance(),uM(t),i.scenegraph.updateNextFrame())}}(this,t)}updateCheckboxCellState(t,e,i){var o,n;if(this.table.transpose)null===(o=this.bodyGroup.children)||void 0===o||o.forEach((t=>{var o;null===(o=t.getChildAt(e))||void 0===o||o.getChildren().forEach((t=>{"checkbox"===t.name&&t.setAttribute("checked",i)}))}));else{const e=this.getColGroup(t);null===(n=null==e?void 0:e.children)||void 0===n||n.forEach((t=>{t.getChildren().find((t=>{"checkbox"===t.name&&t.setAttribute("checked",i)}))}))}}updateHeaderCheckboxCellState(t,e,i){var o,n;this.table.transpose?null===(o=this.rowHeaderGroup.children)||void 0===o||o.forEach((t=>{t.getChildAt(e).getChildren().forEach((t=>{"checkbox"===t.name&&("indeterminate"===i?(t.setAttribute("indeterminate",!0),t.setAttribute("checked",void 0)):(t.setAttribute("indeterminate",void 0),t.setAttribute("checked",i)))}))})):null===(n=this.getColGroup(t,!0).children)||void 0===n||n.forEach((t=>{t.getChildren().find((t=>{"checkbox"===t.name&&("indeterminate"===i?(t.setAttribute("indeterminate",!0),t.setAttribute("checked",void 0)):(t.setAttribute("indeterminate",void 0),t.setAttribute("checked",i)))}))}))}updateAutoColWidth(t){this.table.internalProps._widthResizedColMap.delete(t);const e=this.table.getColWidth(t),i=oR(t,0,this.table.rowCount-1,this.table,!0);i!==e&&this.updateColWidth(t,i-e)}recalculateColWidths(){const t=this.table;"adaptive"===t.widthMode||t.autoFillWidth||t.internalProps.transpose?iR(this.table,0,this.table.colCount-1,!0):(t._clearColRangeWidthsMap(),t.frozenColCount>0&&iR(this.table,0,t.frozenColCount-1,!0),t.rightFrozenColCount>0&&iR(this.table,t.rightFrozenColCount,t.colCount-1,!0),iR(t,this.proxy.colStart,this.proxy.colEnd,!0))}recalculateRowHeights(){const t=this.table;t.internalProps.useOneRowHeightFillAll=!1,"adaptive"===t.heightMode||t.autoFillHeight?AA(this.table,0,this.table.rowCount-1,!0,!0):(t.frozenRowCount>0&&AA(this.table,0,t.frozenRowCount-1,!0,!0),t.bottomFrozenRowCount>0&&AA(this.table,t.bottomFrozenRowCount,t.rowCount-1,!0,!0),AA(t,this.proxy.rowStart,this.proxy.rowEnd,!0,!0))}resize(){this.proxy.resize(),("adaptive"===this.table.widthMode||this.table.autoFillWidth)&&(0===this.table.internalProps._widthResizedColMap.size?this.recalculateColWidths():this.dealWidthMode()),"adaptive"===this.table.heightMode?0===this.table.internalProps._heightResizedRowMap.size?this.recalculateRowHeights():this.dealHeightMode():this.table.autoFillHeight&&this.dealHeightMode(),this.resetFrozen(),this.updateTableSize(),this.updateBorderSizeAndPosition(),this.component.updateScrollBar(),("adaptive"===this.table.widthMode||"adaptive"===this.table.heightMode||this.table.autoFillWidth||this.table.autoFillHeight)&&this.updateChartSizeForResizeColWidth(-1),this.proxy.progress(),this.updateNextFrame()}updateTableSize(){var t,e,i,o,n,r,s,l,a,h,d,c,u;if(this.tableGroup.setAttributes({x:this.table.tableX,y:this.table.tableY,width:Math.min(this.table.tableNoFrameWidth,Math.max(this.colHeaderGroup.attribute.width,this.bodyGroup.attribute.width,this.bottomFrozenGroup.attribute.width,0)+Math.max(this.cornerHeaderGroup.attribute.width,this.rowHeaderGroup.attribute.width,this.leftBottomCornerGroup.attribute.width,0)+Math.max(this.rightTopCornerGroup.attribute.width,this.rightFrozenGroup.attribute.width,this.rightBottomCornerGroup.attribute.width,0)),height:Math.min(this.table.tableNoFrameHeight,Math.max(this.colHeaderGroup.attribute.height,this.cornerHeaderGroup.attribute.height,this.rightTopCornerGroup.attribute.height,0)+Math.max(this.rowHeaderGroup.attribute.height,this.bodyGroup.attribute.height,this.rightFrozenGroup.attribute.height,0)+Math.max(this.leftBottomCornerGroup.attribute.height,this.bottomFrozenGroup.attribute.height,this.rightBottomCornerGroup.attribute.height,0))}),this.tableGroup.border){const g=null===(t=this.tableGroup.border)||void 0===t?void 0:t.attribute;let p,f,v,m;(null==g?void 0:g.strokeArrayWidth)?(p=g.strokeArrayWidth?g.strokeArrayWidth[0]:null!==(e=g.lineWidth)&&void 0!==e?e:0,f=g.strokeArrayWidth?g.strokeArrayWidth[1]:null!==(i=g.lineWidth)&&void 0!==i?i:0,v=g.strokeArrayWidth?g.strokeArrayWidth[2]:null!==(o=g.lineWidth)&&void 0!==o?o:0,m=g.strokeArrayWidth?g.strokeArrayWidth[3]:null!==(n=g.lineWidth)&&void 0!==n?n:0):(p=null!==(r=null==g?void 0:g.lineWidth)&&void 0!==r?r:0,f=null!==(s=null==g?void 0:g.lineWidth)&&void 0!==s?s:0,v=null!==(l=null==g?void 0:g.lineWidth)&&void 0!==l?l:0,m=null!==(a=null==g?void 0:g.lineWidth)&&void 0!==a?a:0),"rect"===this.tableGroup.border.type?(null===(h=this.table.theme.frameStyle)||void 0===h?void 0:h.innerBorder)?this.tableGroup.border.setAttributes({x:this.table.tableX+m/2,y:this.table.tableY+p/2,width:this.tableGroup.attribute.width-m/2-f/2,height:this.tableGroup.attribute.height-p/2-v/2}):this.tableGroup.border.setAttributes({x:this.table.tableX-m/2,y:this.table.tableY-p/2,width:this.tableGroup.attribute.width+m/2+f/2,height:this.tableGroup.attribute.height+p/2+v/2}):"group"===this.tableGroup.border.type&&((null===(d=this.table.theme.frameStyle)||void 0===d?void 0:d.innerBorder)?(this.tableGroup.border.setAttributes({x:this.table.tableX+m/2,y:this.table.tableY+p/2,width:this.tableGroup.attribute.width-m/2-f/2,height:this.tableGroup.attribute.height-p/2-v/2}),null===(c=this.tableGroup.border.firstChild)||void 0===c||c.setAttributes({x:0,y:0,width:this.tableGroup.attribute.width-m/2-f/2,height:this.tableGroup.attribute.height-p/2-v/2})):(this.tableGroup.border.setAttributes({x:this.table.tableX-m/2,y:this.table.tableY-p/2,width:this.tableGroup.attribute.width+m/2+f/2,height:this.tableGroup.attribute.height+p/2+v/2}),null===(u=this.tableGroup.border.firstChild)||void 0===u||u.setAttributes({x:m/2,y:p/2,width:this.tableGroup.attribute.width,height:this.tableGroup.attribute.height})))}this.table.bottomFrozenRowCount>0&&(this.bottomFrozenGroup.setAttribute("y",this.tableGroup.attribute.height-this.table.getBottomFrozenRowsHeight()),this.leftBottomCornerGroup.setAttributes({visible:!0,y:this.tableGroup.attribute.height-this.table.getBottomFrozenRowsHeight(),height:this.table.getBottomFrozenRowsHeight(),width:this.table.getFrozenColsWidth()}),this.rightBottomCornerGroup.setAttributes({visible:!0,y:this.tableGroup.attribute.height-this.table.getBottomFrozenRowsHeight(),height:this.table.getBottomFrozenRowsHeight()})),this.table.rightFrozenColCount>0&&(this.rightFrozenGroup.setAttribute("x",this.tableGroup.attribute.width-this.table.getRightFrozenColsWidth()),this.rightTopCornerGroup.setAttributes({visible:!0,x:this.tableGroup.attribute.width-this.table.getRightFrozenColsWidth(),width:this.table.getRightFrozenColsWidth(),height:this.table.getFrozenRowsHeight()}),this.rightBottomCornerGroup.setAttributes({visible:!0,x:this.tableGroup.attribute.width-this.table.getRightFrozenColsWidth(),width:this.table.getRightFrozenColsWidth()}))}updateRowHeight(t,e,i){EA(this,t,e=Math.round(e),i),this.updateContainerHeight(t,e)}updateRowsHeight(t,e,i){for(let o=0;o<t.length;o++){const n=t[o];if(n>=this.proxy.rowStart&&n<=this.proxy.rowEnd){const t=e[o];EA(this,n,Math.round(t),i),this._updateContainerHeight(n,t)}}this.updateTableSize(),this.component.updateScrollBar(),this.updateNextFrame()}updateContainerWidth(t,e){t<this.frozenColCount?(this.rowHeaderGroup.setDeltaWidth(e),this.cornerHeaderGroup.setDeltaWidth(e),this.colHeaderGroup.setDeltaX(e),this.bodyGroup.setDeltaX(e)):(this.colHeaderGroup.setDeltaWidth(e),this.bodyGroup.setDeltaWidth(e)),this.updateTableSize(),this.component.updateScrollBar(),this.updateNextFrame()}_updateContainerHeight(t,e){t<this.table.frozenRowCount?(this.colHeaderGroup.setDeltaHeight(e),this.cornerHeaderGroup.setDeltaHeight(e),this.rowHeaderGroup.setDeltaY(e),this.bodyGroup.setDeltaY(e),this.table.rightFrozenColCount&&this.rightFrozenGroup.setDeltaY(e)):t>=this.table.rowCount-this.table.bottomFrozenRowCount?(this.leftBottomCornerGroup.setDeltaHeight(e),this.bottomFrozenGroup.setDeltaHeight(e),this.table.rightFrozenColCount&&this.rightBottomCornerGroup.setDeltaHeight(e)):(this.rowHeaderGroup.setDeltaHeight(e),this.bodyGroup.setDeltaHeight(e),this.table.rightFrozenColCount&&this.rightFrozenGroup.setDeltaHeight(e))}updateContainerHeight(t,e){this._updateContainerHeight(t,e),this.updateTableSize(),this.component.updateScrollBar(),this.updateNextFrame()}setColWidth(t,e){const i=this.table.getColWidth(t);i!==e&&(this.updateColWidth(t,e-i),this.table._clearColRangeWidthsMap(t))}setRowHeight(t,e){const i=this.table.getRowHeight(t);i!==e&&((t>=this.proxy.rowStart&&t<=this.proxy.rowEnd||t>=this.table.rowCount-this.table.bottomFrozenRowCount&&t<=this.table.rowCount-1||t<this.table.frozenRowCount)&&this.updateRowHeight(t,e-i),this.table._clearRowRangeHeightsMap(t))}setX(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.table.scenegraph.proxy.setX(-t,e)}setY(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.table.scenegraph.proxy.setY(-t,e)}setBodyAndRowHeaderY(t){var e,i;const o=null===(e=this.bodyGroup.firstChild)||void 0===e?void 0:e.firstChild,n=null===(i=this.bodyGroup.firstChild)||void 0===i?void 0:i.lastChild;0===t&&o&&o.row===this.table.frozenRowCount&&o.attribute.y+t<0?t=-o.attribute.y:n&&this.table.tableNoFrameHeight<this.table.getAllRowsHeight()&&n.row===this.table.rowCount-this.table.bottomFrozenRowCount-1&&n.attribute.y+n.attribute.height+t<this.table.tableNoFrameHeight-this.table.getFrozenRowsHeight()-this.table.getBottomFrozenRowsHeight()&&(t=this.table.tableNoFrameHeight-this.table.getFrozenRowsHeight()-this.table.getBottomFrozenRowsHeight()-n.attribute.y-n.attribute.height),this.colHeaderGroup.attribute.height+t!==this.bodyGroup.attribute.y&&(this.bodyGroup.setAttribute("y",this.colHeaderGroup.attribute.height+t),this.rowHeaderGroup.setAttribute("y",this.cornerHeaderGroup.attribute.height+t),this.table.rightFrozenColCount>0&&this.rightFrozenGroup.setAttribute("y",this.rightTopCornerGroup.attribute.height+t),this.updateNextFrame())}setBodyAndColHeaderX(t){const e=this.bodyGroup.firstChild,i=this.bodyGroup.lastChild;0===t&&e&&e.col===this.table.frozenColCount&&e.attribute.x+t<0?t=-e.attribute.x:i&&this.table.tableNoFrameWidth<this.table.getAllColsWidth()&&i.col===this.table.colCount-this.table.rightFrozenColCount-1&&i.attribute.x+i.attribute.width+t<this.table.tableNoFrameWidth-this.table.getFrozenColsWidth()-this.table.getRightFrozenColsWidth()&&(t=this.table.tableNoFrameWidth-this.table.getFrozenColsWidth()-this.table.getRightFrozenColsWidth()-i.attribute.x-i.attribute.width),this.table.getFrozenColsWidth()+t!==this.bodyGroup.attribute.x&&(this.bodyGroup.setAttribute("x",this.table.getFrozenColsWidth()+t),this.colHeaderGroup.setAttribute("x",this.table.getFrozenColsWidth()+t),this.table.bottomFrozenRowCount>0&&this.bottomFrozenGroup.setAttribute("x",this.table.getFrozenColsWidth()+t),this.updateNextFrame())}afterScenegraphCreated(){this.isPivot||this.table.transpose?this.table.options.frozenColCount?this.component.setFrozenColumnShadow(this.table.frozenColCount-1):this.table.options.rightFrozenColCount?this.component.setRightFrozenColumnShadow(this.table.colCount-this.table.rightFrozenColCount):this.component.setFrozenColumnShadow(-1):(this.component.setFrozenColumnShadow(this.table.frozenColCount-1),this.component.setRightFrozenColumnShadow(this.table.colCount-this.table.rightFrozenColCount)),this.table.stateManager.checkFrozen(),this.updateContainer(),this.createFrameBorder(),this.updateBorderSizeAndPosition(),this.component.updateScrollBar(),zR(this.table),this.table.options.animationAppear&&function(t){var e,i,o,n;if(!t.options.animationAppear)return;let r,s,l,a;!0===t.options.animationAppear?(r=500,s=0,l="one-by-one",a="column"):(r=null!==(e=t.options.animationAppear.duration)&&void 0!==e?e:500,s=null!==(i=t.options.animationAppear.delay)&&void 0!==i?i:0,l=null!==(o=t.options.animationAppear.type)&&void 0!==o?o:"one-by-one",a=null!==(n=t.options.animationAppear.direction)&&void 0!==n?n:"row");const{scenegraph:h,frozenColCount:d,frozenRowCount:c}=t,{colStart:u,colEnd:g,rowStart:p,rowEnd:f}=h.proxy;for(let t=0;t<=g;t++)for(let e=0;e<=f;e++){const i=h.highPerformanceGetCell(t,e);i&&"cell"===i.role&&i.forEachChildren((i=>{i.setAttribute("opacity",0),i.animate().wait("one-by-one"===l?("row"===a?e:t)*(r-s):s).to({opacity:1},r,"linear")}))}}(this.table),this.updateNextFrame()}dealWidthMode(){const t=this.table;if("adaptive"===t.widthMode){t._clearColRangeWidthsMap();const e=t.tableNoFrameWidth;let i=0;for(let e=0;e<t.colCount;e++)(e<t.rowHeaderLevelCount||t.isPivotChart()&&e>=t.colCount-t.rightFrozenColCount)&&(i+=t.getColWidth(e));aR(e-i,t.rowHeaderLevelCount,t.isPivotChart()?t.colCount-t.rightFrozenColCount:t.colCount,!1,[],t,!0)}else if(t.autoFillWidth){t._clearColRangeWidthsMap();const e=t.tableNoFrameWidth;let i=0,o=0;for(let e=0;e<t.colCount;e++){const n=t.getColWidth(e);(e<t.rowHeaderLevelCount||t.isPivotChart()&&e>=t.colCount-t.rightFrozenColCount)&&(i+=n),o+=n}if(o<e&&o>i){aR(e-i,t.rowHeaderLevelCount,t.isPivotChart()?t.colCount-t.rightFrozenColCount:t.colCount,!1,[],t,!0)}}let e=0;this.bodyGroup.forEachChildrenSkipChild((t=>{e+=t.attribute.width})),this.bodyGroup.setAttribute("width",e);let i=0;this.colHeaderGroup.forEachChildrenSkipChild((t=>{i+=t.attribute.width})),this.colHeaderGroup.setAttribute("width",i);let o=0;this.rowHeaderGroup.forEachChildrenSkipChild((t=>{o+=t.attribute.width})),this.rowHeaderGroup.setAttribute("width",o);let n=0;this.cornerHeaderGroup.forEachChildrenSkipChild((t=>{n+=t.attribute.width})),this.cornerHeaderGroup.setAttribute("width",n),this.colHeaderGroup.setAttribute("x",this.cornerHeaderGroup.attribute.width),this.rowHeaderGroup.setAttribute("y",this.cornerHeaderGroup.attribute.height),this.bodyGroup.setAttributes({x:this.rowHeaderGroup.attribute.width,y:this.colHeaderGroup.attribute.height})}dealHeightMode(){var t;const e=this.table;if("adaptive"===e.heightMode){e._clearRowRangeHeightsMap();const t=e.getRowsHeight(0,e.columnHeaderLevelCount-1),i=e.isPivotChart()?e.getBottomFrozenRowsHeight():0,o=e.tableNoFrameHeight-t-i,n=e.columnHeaderLevelCount,r=e.isPivotChart()?e.rowCount-e.bottomFrozenRowCount:e.rowCount;let s=0;for(let t=n;t<r;t++)s+=e.getRowHeight(t);const l=o/s;for(let t=n;t<r;t++){let i;i=t===r-1?o-e.getRowsHeight(n,r-2):Math.round(e.getRowHeight(t)*l),this.setRowHeight(t,i)}}else if(e.autoFillHeight){e._clearRowRangeHeightsMap();const i=e.tableNoFrameHeight;let o=0,n=0;for(let t=0;t<e.rowCount;t++){const i=e.getRowHeight(t);(t<e.columnHeaderLevelCount||e.isPivotChart()&&t>=e.rowCount-e.bottomFrozenRowCount)&&(n+=i),o+=i}if((null!==(t=this._dealAutoFillHeightOriginRowsHeight)&&void 0!==t?t:o)<i&&o-n>0){const t=e.columnHeaderLevelCount,r=e.isPivotChart()?e.rowCount-e.bottomFrozenRowCount:e.rowCount,s=(i-n)/(o-n);for(let o=t;o<r;o++){let l;l=o===r-1?i-n-e.getRowsHeight(t,r-2):Math.round(e.getRowHeight(o)*s),this.setRowHeight(o,l)}}}}dealFrozen(){!function(t){var e,i;if(t.table.frozenColCount>t.table.rowHeaderLevelCount){t.rowHeaderGroup.setAttribute("height",t.bodyGroup.attribute.height),t.rowHeaderGroup.setAttribute("y",t.bodyGroup.attribute.y),t.cornerHeaderGroup.setAttribute("height",t.colHeaderGroup.attribute.height);for(let e=0;e<t.table.frozenColCount-t.table.rowHeaderLevelCount;e++)rM(t),sM(t),hM(t)}else if(t.table.frozenColCount<t.table.rowHeaderLevelCount){t.bodyGroup.setAttribute("height",t.rowHeaderGroup.attribute.height),t.bodyGroup.setAttribute("y",t.rowHeaderGroup.attribute.y),t.colHeaderGroup.setAttribute("height",t.cornerHeaderGroup.attribute.height);for(let e=0;e<t.table.rowHeaderLevelCount-t.table.frozenColCount;e++)lM(t),aM(t),dM(t)}t.bodyGroup.setAttribute("x",t.rowHeaderGroup.attribute.width),t.colHeaderGroup.setAttribute("x",t.cornerHeaderGroup.attribute.width),t.updateContainer(),t.updateBorderSizeAndPosition(),t.isPivot||t.table.transpose?t.table.options.frozenColCount?t.component.setFrozenColumnShadow(t.table.frozenColCount-1):t.table.options.frozenColCount&&t.component.setRightFrozenColumnShadow(t.table.colCount-t.table.rightFrozenColCount):(t.component.setFrozenColumnShadow(t.table.frozenColCount-1),t.component.setRightFrozenColumnShadow(t.table.colCount-t.table.rightFrozenColCount)),t.hasFrozen=!0,t.frozenColCount=t.table.frozenColCount,t.frozenRowCount=null!==(i=null===(e=t.colHeaderGroup.firstChild)||void 0===e?void 0:e.childrenCount)&&void 0!==i?i:0}(this)}resetFrozen(){nM(this)}updateCellLayoutWidthCertainWidth(t,e,i){const o=t.attribute.width;let n=!1;return t.forEachChildren(((t,r)=>{r+=e;const s=Mx(this.table,i,r);s?t=this.getCell(s.start.col,s.start.row):t.setAttribute("width",o);const l=r_(DS("padding",this.table._getCellStyle(i,r),i,r,this.table)),a=t.getChildByName("text");let h=0,d=0;if(a)h=a.AABBBounds.height()+(l[0]+l[2]),a.setAttribute("maxLineWidth",o-(l[1]+l[3])),d=a.AABBBounds.height()+(l[0]+l[2]);else{const e=t.getChildAt(1);h=e.AABBBounds.height()+(l[0]+l[2]),e._cellWidth=o-(l[1]+l[3]),e.layout(),d=e.AABBBounds.height()+(l[0]+l[2])}const c=this.table.getRowHeight(r);t.attribute.height!==d&&(t.setAttribute("height",d),(c===h||d>c)&&(n=!0))})),n}updateHeaderPosition(t,e,i,o,n){!function(t,e,i,o,n,r){const s=r.scenegraph;for(let i=t;i<=e;i++){const t=r.getColWidth(i),e=r.scenegraph.getColGroup(i,!0),o=r.scenegraph.getColGroup(i),n=r.scenegraph.getColGroupInBottom(i),s=r.scenegraph.getColGroupInLeftBottomCorner(i),l=r.scenegraph.getColGroupInRightBottomCorner(i);e&&(e.setAttribute("width",t),e.forEachChildren((e=>{e.setAttribute("width",t)}))),o&&(o.setAttribute("width",t),o.forEachChildren((e=>{e.setAttribute("width",t)}))),n&&(n.setAttribute("width",t),n.forEachChildren((e=>{e.setAttribute("width",t)}))),l&&(l.setAttribute("width",t),l.forEachChildren((e=>{e.setAttribute("width",t)}))),s&&(s.setAttribute("width",t),s.forEachChildren((e=>{e.setAttribute("width",t)})))}if(s.updateContainer(),"column"===n)for(let i=t;i<=e;i++){const t=r.scenegraph.getColGroup(i);null==t||t.setAttribute("chartInstance",void 0);for(let t=0;t<=r.frozenRowCount-1;t++)s.updateCellContent(i,t);for(let t=s.bodyRowStart;t<=s.bodyRowEnd;t++)s.updateCellContent(i,t);for(let t=r.rowCount-r.bottomFrozenRowCount;t<=r.rowCount-1;t++)s.updateCellContent(i,t)}else{for(let t=0;t<=r.frozenColCount-1;t++){const e=r.scenegraph.getColGroup(t);null==e||e.setAttribute("chartInstance",void 0);for(let e=i;e<=o;e++)s.updateCellContent(t,e)}for(let t=s.bodyColStart;t<=s.bodyColEnd;t++){const e=r.scenegraph.getColGroup(t);null==e||e.setAttribute("chartInstance",void 0);for(let e=i;e<=o;e++)s.updateCellContent(t,e)}for(let t=r.colCount-r.rightFrozenColCount;t<=r.colCount-1;t++){const e=r.scenegraph.getColGroup(t);null==e||e.setAttribute("chartInstance",void 0);for(let e=i;e<=o;e++)s.updateCellContent(t,e)}}}(t,e,i,o,n,this.table)}updateContainerAttrWidthAndX(){var t,e,i;const o=fM(this.cornerHeaderGroup,0),n=fM(this.rowHeaderGroup,0),r=this.colHeaderGroup.hasChildNodes()&&this.colHeaderGroup.firstChild?fM(this.colHeaderGroup,this.colHeaderGroup.firstChild.col>0?this.table.getColsWidth(null!==(t=this.table.frozenColCount)&&void 0!==t?t:0,this.colHeaderGroup.firstChild.col-1):0):0,s=this.bodyGroup.hasChildNodes()&&this.bodyGroup.firstChild?fM(this.bodyGroup,this.bodyGroup.firstChild.col>0?this.table.getColsWidth(null!==(e=this.table.frozenColCount)&&void 0!==e?e:0,this.bodyGroup.firstChild.col-1):0):0,l=fM(this.rightFrozenGroup.childrenCount>0?this.rightFrozenGroup:this.rightTopCornerGroup,0);this.bottomFrozenGroup.hasChildNodes()&&this.bottomFrozenGroup.firstChild&&fM(this.bottomFrozenGroup,this.bottomFrozenGroup.firstChild.col>0?this.table.getColsWidth(null!==(i=this.table.frozenColCount)&&void 0!==i?i:0,this.bottomFrozenGroup.firstChild.col-1):0),fM(this.leftBottomCornerGroup,0),fM(this.rightTopCornerGroup,0),fM(this.rightBottomCornerGroup,0),this.cornerHeaderGroup.setDeltaWidth(o-this.cornerHeaderGroup.attribute.width),this.leftBottomCornerGroup.setDeltaWidth(o-this.leftBottomCornerGroup.attribute.width),this.colHeaderGroup.setDeltaWidth(r-this.colHeaderGroup.attribute.width),this.rowHeaderGroup.setDeltaWidth(n-this.rowHeaderGroup.attribute.width),this.bottomFrozenGroup.setDeltaWidth(r-this.bottomFrozenGroup.attribute.width),this.rightFrozenGroup.setDeltaWidth(l-this.rightFrozenGroup.attribute.width),this.rightTopCornerGroup.setDeltaWidth(l-this.rightTopCornerGroup.attribute.width),this.rightBottomCornerGroup.setDeltaWidth(l-this.rightBottomCornerGroup.attribute.width),this.bodyGroup.setDeltaWidth(s-this.bodyGroup.attribute.width),this.colHeaderGroup.setAttribute("x",this.cornerHeaderGroup.attribute.width),this.bottomFrozenGroup.setAttribute("x",this.table.getFrozenColsWidth()),this.bodyGroup.setAttribute("x",this.rowHeaderGroup.attribute.width)}updateContainer(){arguments.length>0&&void 0!==arguments[0]&&arguments[0]?this._needUpdateContainer||(this._needUpdateContainer=!0,setTimeout((()=>{this.updateContainerSync()}),0)):(this._needUpdateContainer=!0,this.updateContainerSync())}updateContainerSync(){this._needUpdateContainer&&(this._needUpdateContainer=!1,this.updateContainerAttrWidthAndX(),this.updateTableSize(),this.component.updateScrollBar(),this.updateDomContainer(),this.updateNextFrame())}updateCellContentWhileResize(t,e){var i;const o=(null===(i=this.table.getCellRawRecord(t,e))||void 0===i?void 0:i.vtableMerge)?"text":this.table.isHeader(t,e)?this.table._getHeaderLayoutMap(t,e).headerType:this.table.getBodyColumnType(t,e),n=this.getCell(t,e);"image"!==o&&"video"!==o||QS(n,t,e,0,0,this.table)}createFrameBorder(){this.updateTableSize();const t=!this.isPivot&&!this.table.internalProps.transpose;rB(this.bodyGroup,this.table.theme.bodyStyle.frameStyle,this.bodyGroup.role,t?[!0,!0,!0,!1]:void 0),rB(this.rowHeaderGroup,this.isPivot||this.table.internalProps.transpose?this.table.theme.rowHeaderStyle.frameStyle:this.table.theme.bodyStyle.frameStyle,this.rowHeaderGroup.role,t?[!0,!1,!0,!0]:void 0),rB(this.colHeaderGroup,this.table.theme.headerStyle.frameStyle,this.colHeaderGroup.role,t?[!0,!0,!0,!1]:void 0),rB(this.cornerHeaderGroup,this.isPivot?this.table.theme.cornerHeaderStyle.frameStyle:this.table.theme.headerStyle.frameStyle,this.cornerHeaderGroup.role,t?[!0,!1,!0,!0]:void 0),rB(this.tableGroup,this.table.theme.frameStyle,this.tableGroup.role,void 0)}getResizeColAt(t,e,i){let o,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:8;if(!i){const i=this.table.getDrawRange();return e>=i.top&&e<=i.bottom&&(o=this.table.getCellAtRelativePosition(t-n,e),o.col===this.table.colCount-1)?o:{col:-1,row:-1}}return i.stage?(t<i.globalAABBBounds.x1+n?o={col:i.col-1,row:i.row,x:i.globalAABBBounds.x1}:i.globalAABBBounds.x2-n<t&&(o={col:i.col,row:i.row,x:i.globalAABBBounds.x2}),o&&this.table.rightFrozenColCount>0&&o.col>=this.table.colCount-this.table.rightFrozenColCount-1&&this.table.tableNoFrameWidth-this.table.getFrozenColsWidth()-this.table.getRightFrozenColsWidth()+this.table.scrollLeft<this.bodyGroup.attribute.width&&(o.col=o.col+1,o.rightFrozen=!0),o||{col:-1,row:-1}):{col:-1,row:-1}}getResizeRowAt(t,e,i){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:8;if(i){let t;if(e<i.globalAABBBounds.y1+o?t={col:i.col,row:i.row-1,y:i.globalAABBBounds.y1}:i.globalAABBBounds.y2-o<e&&(t={col:i.col,row:i.row,y:i.globalAABBBounds.y2}),t&&this.table.bottomFrozenRowCount>0&&t.row>=this.table.rowCount-this.table.bottomFrozenRowCount-1&&this.table.tableNoFrameHeight-this.table.getFrozenRowsHeight()-this.table.getBottomFrozenRowsHeight()+this.table.scrollTop<this.bodyGroup.attribute.height&&(t.row=t.row+1,t.bottomFrozen=!0),t)return t}return{col:-1,row:-1}}updateFrozen(){this.clear||(this.resetFrozen(),this.component.updateScrollBar())}dealWidthRightFrozen(t){this.clear?this.table.internalProps.rightFrozenColCount=t:function(t,e){const{table:i,proxy:o,rightTopCornerGroup:n,rightFrozenGroup:r,rightBottomCornerGroup:s,bottomFrozenGroup:l,bodyGroup:a,colHeaderGroup:h}=e,d=e.table.rightFrozenColCount;if(t>d){for(let o=i.colCount-d-1;o>=i.colCount-t;o--)cM(r,e.getColGroup(o),r.firstChild),cM(n,e.getColGroup(o,!0),n.firstChild),cM(s,e.getColGroupInBottom(o),s.firstChild);let o=0;r.forEachChildren((t=>{t.setAttribute("x",o),o+=t.attribute.width})),o=0,n.forEachChildren((t=>{t.setAttribute("x",o),o+=t.attribute.width})),o=0,s.forEachChildren((t=>{t.setAttribute("x",o),o+=t.attribute.width}))}else if(t<d){for(let o=i.colCount-d;o<i.colCount-t;o++){const t=e.getColGroup(o);t.setAttribute("x",a.lastChild.attribute.x+i.getColWidth(a.lastChild.col)),a.appendChild(t);const n=e.getColGroupInRightTopCorner(o);n.setAttribute("x",h.lastChild.attribute.x+i.getColWidth(h.lastChild.col)),h.appendChild(n);const r=e.getColGroupInRightBottomCorner(o);r.setAttribute("x",l.lastChild.attribute.x+i.getColWidth(l.lastChild.col)),l.appendChild(r)}let o=0;r.forEachChildren((t=>{t.setAttribute("x",o),o+=t.attribute.width})),o=0,n.forEachChildren((t=>{t.setAttribute("x",o),o+=t.attribute.width})),o=0,s.forEachChildren((t=>{t.setAttribute("x",o),o+=t.attribute.width}))}r.setAttribute("width",i.getColsWidth(i.colCount-t,i.colCount-1)),n.setAttribute("width",i.getColsWidth(i.colCount-t,i.colCount-1)),s.setAttribute("width",i.getColsWidth(i.colCount-t,i.colCount-1)),i.internalProps.rightFrozenColCount=t,e.updateContainer(),e.component.updateScrollBar(),e.updateNextFrame()}(t,this)}dealWidthBottomFrozen(t){this.clear?this.table.internalProps.bottomFrozenRowCount=t:function(t,e){const{table:i,proxy:o,bottomFrozenGroup:n,leftBottomCornerGroup:r,rightBottomCornerGroup:s}=e;n.childrenCount||(o.table.isPivotChart()||(pR(r,0,0,0,i.frozenColCount-1,0,-1,"rowHeader",i),pR(s,0,0,i.colCount-i.rightFrozenColCount,i.colCount-1,0,-1,"body",i)),pR(n,0,0,o.colStart,o.colEnd,0,-1,"body",i));const l=e.table.bottomFrozenRowCount;if(t>l){for(let o=0;o<i.frozenColCount;o++){const n=e.getColGroupInLeftBottomCorner(o);for(let r=i.rowCount-l-1;r>=i.rowCount-t;r--)cM(n,e.getCell(o,r,!0),n.firstChild);let r=0;n.forEachChildren((t=>{t.setAttribute("y",r),r+=i.getRowHeight(t.row)}))}for(let n=o.colStart;n<=o.colEnd;n++){const o=e.getColGroupInBottom(n);for(let r=i.rowCount-l-1;r>=i.rowCount-t;r--)cM(o,e.getCell(n,r,!0),o.firstChild);let r=0;o.forEachChildren((t=>{t.setAttribute("y",r),r+=i.getRowHeight(t.row)}))}if(i.rightFrozenColCount>0)for(let o=i.colCount-i.rightFrozenColCount;o<i.colCount;o++){const n=e.getColGroupInRightBottomCorner(o);for(let r=i.rowCount-l-1;r>=i.rowCount-t;r--)cM(n,e.getCell(o,r,!0),n.firstChild);let r=0;n.forEachChildren((t=>{t.setAttribute("y",r),r+=i.getRowHeight(t.row)}))}}else if(t<l){for(let o=0;o<i.rowHeaderLevelCount;o++){const n=e.getColGroup(o);for(let r=i.rowCount-l;r<i.rowCount-t;r++){const t=e.getCell(o,r,!0);t.setAttribute("y",n.lastChild.attribute.y+i.getRowHeight(n.lastChild.row)),n.appendChild(t)}const r=e.getColGroupInLeftBottomCorner(o);let s=0;r.forEachChildren((t=>{t.setAttribute("y",s),s+=i.getRowHeight(t.row)}))}for(let n=o.colStart;n<=o.colEnd;n++){const o=e.getColGroup(n);for(let r=i.rowCount-l;r<i.rowCount-t;r++){const t=e.getCell(n,r,!0);t.setAttribute("y",o.lastChild.attribute.y+i.getRowHeight(o.lastChild.row)),o.appendChild(t)}const r=e.getColGroupInBottom(n);let s=0;r.forEachChildren((t=>{t.setAttribute("y",s),s+=i.getRowHeight(t.row)}))}if(i.rightFrozenColCount>0)for(let o=i.colCount-i.rightFrozenColCount;o<i.colCount;o++){const n=e.getColGroup(o);for(let r=i.rowCount-l;r<i.rowCount-t;r++){const t=e.getCell(o,r,!0);t.setAttribute("y",n.lastChild.attribute.y+i.getRowHeight(n.lastChild.row)),n.appendChild(t)}const r=e.getColGroupInRightBottomCorner(o);let s=0;r.forEachChildren((t=>{t.setAttribute("y",s),s+=i.getRowHeight(t.row)}))}}n.setAttribute("height",i.getRowsHeight(i.rowCount-t,i.rowCount-1)),r.setAttribute("height",i.getRowsHeight(i.rowCount-t,i.rowCount-1)),s.setAttribute("height",i.getRowsHeight(i.rowCount-t,i.rowCount-1)),i.internalProps.bottomFrozenRowCount=t,e.updateContainer(),e.component.updateScrollBar(),e.updateNextFrame()}(t,this)}updateBorderSizeAndPosition(){this.bodyGroup.border&&(this.bodyGroup.appendChild(this.bodyGroup.border),aB(this.bodyGroup),this.rowHeaderGroup.attribute.width,sB(this.bodyGroup,this.table.theme.bodyStyle.frameStyle)),this.colHeaderGroup.border&&(this.colHeaderGroup.appendChild(this.colHeaderGroup.border),aB(this.colHeaderGroup),this.cornerHeaderGroup.attribute.width,sB(this.colHeaderGroup,this.table.theme.headerStyle.frameStyle)),this.rowHeaderGroup.border&&(this.rowHeaderGroup.appendChild(this.rowHeaderGroup.border),aB(this.rowHeaderGroup)),this.cornerHeaderGroup.border&&(this.cornerHeaderGroup.appendChild(this.cornerHeaderGroup.border),aB(this.cornerHeaderGroup)),function(t){if(!t.theme.frameStyle.cornerRadius)return;const e=t.theme.frameStyle.cornerRadius,{cornerHeaderGroup:i,colHeaderGroup:o,rowHeaderGroup:n,bodyGroup:r,rightTopCornerGroup:s,leftBottomCornerGroup:l,rightBottomCornerGroup:a,rightFrozenGroup:h,bottomFrozenGroup:d}=t.scenegraph;i.setAttribute("cornerRadius",0),o.setAttribute("cornerRadius",0),n.setAttribute("cornerRadius",0),r.setAttribute("cornerRadius",0),s.setAttribute("cornerRadius",0),l.setAttribute("cornerRadius",0),a.setAttribute("cornerRadius",0),h.setAttribute("cornerRadius",0),d.setAttribute("cornerRadius",0);const c=Iw(e);i.attribute.width>0&&i.attribute.height>0?hB(i,[c[0],0,0,0]):o.attribute.height>0?hB(o,[c[0],0,0,0]):n.attribute.width>0?hB(n,[c[0],0,0,0]):hB(r,[c[0],0,0,0]),l.attribute.width>0&&l.attribute.height>0?hB(l,[0,0,0,c[3]]):d.attribute.height>0?hB(d,[0,0,0,c[3]]):n.attribute.width>0?hB(n,[0,0,0,c[3]]):hB(r,[0,0,0,c[3]]),s.attribute.width>0&&s.attribute.height>0?hB(s,[0,c[1],0,0]):o.attribute.height>0?hB(o,[0,c[1],0,0]):h.attribute.width>0?hB(h,[0,c[1],0,0]):hB(r,[0,c[1],0,0]),a.attribute.width>0&&a.attribute.height>0?hB(a,[0,0,c[2],0]):h.attribute.width>0?hB(h,[0,0,c[2],0]):d.attribute.height>0?hB(d,[0,0,c[2],0]):hB(r,[0,0,c[2],0])}(this.table)}sortCell(){this.isPivot||(this.table.transpose?this.proxy.sortCellHorizontal():this.proxy.sortCellVertical())}getCellOverflowText(t,e){var i,o;const n=this.getCell(t,e).getChildByName("text",!0);if(n&&"text"===n.type){if(n.attribute.moreThanMaxCharacters)return this.table.getCellValue(t,e);const r=rt(n.attribute.text)?n.attribute.text.join(""):n.attribute.text;let s="";if(nt(n.cache.clipedText)?s=n.cache.clipedText:null===(o=null===(i=n.cache.layoutData)||void 0===i?void 0:i.lines)||void 0===o||o.forEach((t=>{s+=t.str})),s!==r)return this.table.getCellValue(t,e)}else if(n&&"richtext"===n.type){const i=n;if(i.attribute.ellipsis&&i._frameCache&&i.attribute.height<i._frameCache.actualHeight)return i.attribute.textConfig.find((t=>t.text)),this.table.getCellValue(t,e)}return null}updateDrill(t,e,i,o,n){this.component.drillIcon.update(t,e,i,o,n,this)}updateCellContent(t,e){if(!this.clear)return sA(t,e,this.table)}setPixelRatio(t){this.stage.disableDirtyBounds(),this.stage.window.setDpr(t),this.stage.render(),this.stage.enableDirtyBounds()}updateRow(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];this.table.internalProps.layoutMap.clearCellRangeMap(),this.table.internalProps.useOneRowHeightFillAll=!1;const o=Cw(e.map((t=>t.row))).sort(((t,e)=>t-e)),n=Cw(i.map((t=>t.row))).sort(((t,e)=>t-e)),r=this.table.getAllRowsHeight()-[...o,...n].reduce(((t,e)=>t+this.table.getRowHeight(e)),0)<=this.table.tableNoFrameHeight;if(JR(t,e,i,this.table),this.recalculateColWidths(),"adaptive"===this.table.heightMode||this.table.autoFillHeight&&(this.table.getAllRowsHeight()<=this.table.tableNoFrameHeight||r))this.table.scenegraph.recalculateRowHeights();else if("autoHeight"===this.table.heightMode)for(let t=0;t<n.length;t++){const e=n[t],i=this.table.getRowHeight(e),o=BA(e,0,this.table.colCount-1,this.table);(e>=this.proxy.rowStart&&e<=this.proxy.rowEnd||e>=this.table.rowCount-this.table.bottomFrozenRowCount&&e<=this.table.rowCount-1)&&this.table.scenegraph.updateRowHeight(e,o-i)}this.table.stateManager.checkFrozen(),this.isPivot||this.table.transpose?this.table.options.frozenColCount?this.component.setFrozenColumnShadow(this.table.frozenColCount-1):this.table.options.rightFrozenColCount&&this.component.setRightFrozenColumnShadow(this.table.colCount-this.table.rightFrozenColCount):(this.component.setFrozenColumnShadow(this.table.frozenColCount-1),this.component.setRightFrozenColumnShadow(this.table.colCount-this.table.rightFrozenColCount)),this.component.updateScrollBar(),this.updateNextFrame()}updateCol(t,e){wM(t,e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],this.table),this.recalculateColWidths(),this.recalculateRowHeights(),this.table.stateManager.checkFrozen(),this.isPivot||this.table.transpose?this.table.options.frozenColCount?this.component.setFrozenColumnShadow(this.table.frozenColCount-1):this.table.options.rightFrozenColCount&&this.component.setRightFrozenColumnShadow(this.table.colCount-this.table.rightFrozenColCount):(this.component.setFrozenColumnShadow(this.table.frozenColCount-1),this.component.setRightFrozenColumnShadow(this.table.colCount-this.table.rightFrozenColCount)),this.component.updateScrollBar(),this.updateNextFrame()}getColumnGroupX(t){return t<this.table.rowHeaderLevelCount?this.table.getColsWidth(0,t-1):t<this.table.colCount-this.table.rightFrozenColCount?this.table.getColsWidth(this.table.rowHeaderLevelCount,t-1):t<this.table.colCount?this.table.getColsWidth(this.table.colCount-this.table.bottomFrozenRowCount,t-1):0}getCellGroupY(t){return t<this.table.frozenRowCount?this.table.getRowsHeight(0,t-1):t<this.table.rowCount-this.table.bottomFrozenRowCount?this.table.getRowsHeight(this.table.frozenRowCount,t-1):t<this.table.rowCount?this.table.getRowsHeight(this.table.rowCount-this.table.bottomFrozenRowCount,t-1):0}getCellGroupX(t){return t<this.table.rowHeaderLevelCount?this.table.getColsWidth(0,t-1):t<this.table.colCount-this.table.rightFrozenColCount?this.table.getColsWidth(this.table.rowHeaderLevelCount,t-1):t<this.table.colCount?this.table.getColsWidth(this.table.colCount-this.table.rightFrozenColCount,t-1):0}updateDomContainer(){!function(t){const{headerDomContainer:e,bodyDomContainer:i,frozenBodyDomContainer:o,frozenHeaderDomContainer:n,rightFrozenBodyDomContainer:r,rightFrozenHeaderDomContainer:s,bottomDomContainer:l,frozenBottomDomContainer:a,rightFrozenBottomDomContainer:h}=t.internalProps;if(!(e||i||o||n||r||s||l||a||h))return;const d=t.getAllColsWidth(),c=Math.min(d,t.tableNoFrameWidth),u=t.getFrozenColsWidth(),g=t.getRightFrozenColsWidth(),p=u+g,f=Math.min(d-p,c-p),v=t.getAllRowsHeight(),m=Math.min(v,t.tableNoFrameHeight),b=t.getFrozenRowsHeight(),y=t.getBottomFrozenRowsHeight(),C=b+y,w=Math.min(v-C,m-C);t.frozenColCount>0?(e.style.left=`${t.tableX+u}px`,i.style.left=`${t.tableX+u}px`,l.style.left=`${t.tableX+u}px`):0===t.frozenColCount&&(e.style.left=`${t.tableX}px`,i.style.left=`${t.tableX}px`,l.style.left=`${t.tableX}px`),o.style.left=`${t.tableX}px`,n.style.left=`${t.tableX}px`,e.style.width=`${f}px`,e.style.height=`${b}px`,i.style.top=`${t.tableY}px`,i.style.width=`${f}px`,i.style.height=`${w}px`,i.style.top=`${t.tableY+b}px`,o.style.width=`${u}px`,o.style.height=`${w}px`,o.style.top=`${t.tableY+b}px`,n.style.width=`${u}px`,n.style.height=`${b}px`,n.style.top=`${t.tableY}px`,r.style.width=`${g}px`,r.style.height=`${w}px`,r.style.top=`${t.tableY+b}px`,r.style.left=t.tableX+c-g+"px",s.style.width=`${g}px`,s.style.height=`${b}px`,s.style.top=`${t.tableY}px`,s.style.left=t.tableX+c-g+"px",l.style.width=`${f}px`,l.style.height=`${y}px`,l.style.top=t.tableY+m-y+"px",a.style.width=`${u}px`,a.style.height=`${y}px`,a.style.top=t.tableY+m-y+"px",h.style.width=`${g}px`,h.style.height=`${y}px`,h.style.top=t.tableY+m-y+"px",h.style.left=t.tableX+c-g+"px"}(this.table)}}function BM(t,e,i){const o=t.highPerformanceGetCell(e,i);if("cell"===o.role&&Q(o.mergeStartCol)&&Q(o.mergeStartRow)&&Q(o.mergeEndCol)&&Q(o.mergeEndRow)){const{colStart:e,colEnd:i,rowStart:n,rowEnd:r}=PA(o,t);for(let o=e;o<=i;o++)for(let e=n;e<=r;e++)t.highPerformanceGetCell(o,e).addUpdateBoundTag()}else o.addUpdateBoundTag()}function RM(t,e,i,o,n){const r=t.table;for(let i=0;i<r.columnHeaderLevelCount;i++)BM(t,e,i);const s=t.getColGroup(e);return null==s||s.addUpdateBoundTag(),!0}function MM(t,e,i,o,n,r){const s=t.table;for(let i=0;i<s.columnHeaderLevelCount;i++)BM(t,e,i);const l=t.getColGroup(e);return null==l||l.addUpdateBoundTag(),!0}function TM(t,e,i,o,n){const r=t.table;for(let e=0;e<r.colCount;e++)BM(t,e,i);return!0}function kM(t,e,i,o,n,r){const s=t.table;for(let e=0;e<s.colCount;e++)BM(t,e,i);return!0}function LM(t,e,i){const{table:o}=t,{scenegraph:n}=o,{highlightScope:r,singleStyle:s,disableHeader:l,cellPos:a,cellPosContainHeader:h}=t.hover,d=a.col,c=a.row;if(r===OC.none||l&&(h.col!==e||h.row!==i)){const t=h.col,o=h.row;n.hideHoverIcon(t,o),n.showHoverIcon(e,i),h.col=e,h.row=i}if((l&&o.isHeader(e,i)||r===OC.none)&&(e=-1,i=-1),d===e&&c===i)return;n.deactivateChart(d,c),n.activateChart(e,i);let u=!1;const{ranges:g,highlightScope:p}=t.select;if(-1!==d&&-1!==c&&(u=function(t,e,i,o,n,r,s){let l=!1;return r===OC.single?l=!!function(t,e,i,o,n){return BM(t,e,i),!0}(t,e,i):r===OC.row?l=!!TM(t,0,i):r===OC.column?l=!!RM(t,e):r===OC.cross&&(l=!!TM(t,0,i),l=!!RM(t,e)),l}(n,d,c,0,0,r),l||n.hideHoverIcon(d,c)),-1===e||-1===i)return a.col=-1,a.row=-1,void(!u||d===e&&c===i||t.table.scenegraph.updateNextFrame());r===OC.single?u=!!function(t,e,i,o,n){return BM(t,e,i),!0}(n,e,i):r===OC.row?u=!!kM(n,0,i):r===OC.column?u=!!MM(n,e):r===OC.cross&&(u=!!kM(n,0,i),u=!!MM(n,e)),r===OC.none||l||n.showHoverIcon(e,i),a.col=e,a.row=i,u&&t.table.scenegraph.updateNextFrame()}function PM(t,e,i,o){var n;let r,s=null,l=!1;if(Array.isArray(i.sortState))for(let o=0;o<i.sortState.length&&(r=i.sortState[o],r&&(s=i._getHeaderCellBySortState(r)),s&&(l=EM(t,e,s.col,s.row,i)),!l);o++);else r=i.sortState,r&&(s=i._getHeaderCellBySortState(r)),s&&(l=EM(t,e,s.col,s.row,i));const a=i.getHeaderDefine(t,e);if(r&&l&&(null==a?void 0:a.sort)?r.order="asc"===r.order?"desc":"desc"===r.order?"normal":"asc":(null==a?void 0:a.sort)?r={field:i.getHeaderField(t,e),order:"asc"}:l&&(null==a?void 0:a.showSort)||(r={field:i.getHeaderField(t,e),order:"normal"}),r.event=o,i.fireListeners(Xw.SORT_CLICK,r).includes(!1))return;let h=!1,d=i.internalProps.sortState?Array.isArray(i.internalProps.sortState)&&(h=!0)?i.internalProps.sortState:[i.internalProps.sortState]:[];if(Array.isArray(d)){const t=d.findIndex((t=>t.field===r.field));t>=0?d[t]=r:d.push(r)}d=d.filter((t=>"normal"!==t.order)),d=i.internalProps.multipleSort&&(h=!0)?d:d.splice(-1),d=h&&d.length?d:d[0],i.internalProps.sortState=d,i.stateManager.setSortState(d),(null==a?void 0:a.sort)&&function(t,e,i){t=Array.isArray(t)||!t?t:[t],e.dataSource.sort((t||[]).map((t=>{var i,o;const n=e.internalProps.layoutMap.headerObjects.find((e=>e&&e.field===t.field));return{field:t.field,order:t.order||"asc",orderFn:"function"==typeof(null===(i=null==n?void 0:n.define)||void 0===i?void 0:i.sort)?null===(o=null==n?void 0:n.define)||void 0===o?void 0:o.sort:yw}})))}(d,i),i.internalProps.useOneRowHeightFillAll=!1,i.internalProps.layoutMap.clearCellRangeMap(),i.scenegraph.sortCell();const c=!!(null===(n=i.stateManager.select.ranges)||void 0===n?void 0:n.length);i.stateManager.updateSelectPos(-1,-1),i.stateManager.endSelectCells(!0,c)}function EM(t,e,i,o,n){return n._getLayoutCellId(t,e)===n._getLayoutCellId(i,o)}const HM=Lw(Xw,{PIVOT_SORT_CLICK:"pivot_sort_click",DRILLMENU_CLICK:"drillmenu_click"});function FM(t,e,i,o,n){for(let i=t;i<=e;i++)n._clearColRangeWidthsMap(i);for(let t=i;t<=o;t++)n._clearRowRangeHeightsMap(t)}function zM(t){var e;if(!t)return;const i=(null===(e=t.role)||void 0===e?void 0:e.startsWith("icon"))?t:"richtext"===t.type?t._currentHoverIcon:void 0;return i?"richtext"===t.type?{icon:i,position:{left:t.globalAABBBounds.x1+i.globalAABBBounds.x1,right:t.globalAABBBounds.x1+i.globalAABBBounds.x2,top:t.globalAABBBounds.y1+i.globalAABBBounds.y1,bottom:t.globalAABBBounds.y1+i.globalAABBBounds.y2,width:i.globalAABBBounds.x2-i.globalAABBBounds.x1,height:i.globalAABBBounds.y2-i.globalAABBBounds.y1},type:"richtext-icon"}:{icon:i,position:{left:i.globalAABBBounds.x1,right:i.globalAABBBounds.x2,top:i.globalAABBBounds.y1,bottom:i.globalAABBBounds.y2,width:i.globalAABBBounds.x2-i.globalAABBBounds.x1,height:i.globalAABBBounds.y2-i.globalAABBBounds.y1},type:"icon"}:void 0}function IM(t,e){"adaptive"===e.table.widthMode&&e.columnResize.col<e.table.colCount-1?(e.table.scenegraph.updateColWidth(e.columnResize.col,t),e.table.scenegraph.updateColWidth(e.columnResize.col+1,-t),e.table.internalProps._widthResizedColMap.add(e.columnResize.col),e.table.internalProps._widthResizedColMap.add(e.columnResize.col+1)):(e.table.scenegraph.updateColWidth(e.columnResize.col,t),e.table.internalProps._widthResizedColMap.add(e.columnResize.col))}function OM(t,e){"adaptive"===e.table.heightMode&&e.rowResize.row<e.table.rowCount-1?(e.table.scenegraph.updateRowHeight(e.rowResize.row,t),e.table.scenegraph.updateRowHeight(e.rowResize.row+1,-t),e.table.internalProps._heightResizedRowMap.add(e.rowResize.row),e.table.internalProps._heightResizedRowMap.add(e.rowResize.row+1)):(e.table.scenegraph.updateRowHeight(e.rowResize.row,t),e.table.internalProps._heightResizedRowMap.add(e.rowResize.row))}Lw(Xw,{VCHART_EVENT_TYPE:"vchart_event_type"});function DM(t){if(t.eventManager.bindSparklineHoverEvent)return;let e=!1;e=t.isPivotTable()?t.internalProps.layoutMap.indicatorsDefine.some((t=>"string"!=typeof t&&"sparkline"===t.cellType)):t.internalProps.layoutMap.columnObjects.some((t=>"sparkline"===t.cellType||"function"==typeof t.cellType)),e&&(t.eventManager.bindSparklineHoverEvent=!0,t.on(Xw.MOUSEMOVE_CELL,(e=>{const{col:i,row:o,x:n,y:r}=e;"sparkline"!==t.getBodyColumnType(i,o)&&t.stateManager.updateSparklineHoverPose(-1,-1,0,0),t.stateManager.updateSparklineHoverPose(i,o,n,r)})),t.on(Xw.MOUSELEAVE_TABLE,(e=>{t.stateManager.updateSparklineHoverPose(-1,-1,0,0)})))}function WM(t,e){let i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];var o;let{deltaX:n,deltaY:r}=t;t.shiftKey&&t.deltaY&&(n=r,r=0);const[s,l]=function(t,e,i){var o,n;const r=Math.abs(t/e),s=r<=.5?0:t,l=r>2?0:e;return[Math.ceil(s*(null!==(o=i.horizontal)&&void 0!==o?o:0)),Math.ceil(l*(null!==(n=i.vertical)&&void 0!==n?n:0))]}(n,r,{horizontal:1,vertical:1});(s||l)&&e.interactionState!==IC.scrolling&&e.updateInteractionState(IC.scrolling),s&&(e.setScrollLeft(e.scroll.horizontalBarPos+s,t),e.showHorizontalScrollBar(!0)),l&&(e.setScrollTop(e.scroll.verticalBarPos+l,t),e.showVerticalScrollBar(!0)),i&&e.resetInteractionState(e.interactionStateBeforeScroll),(null===(o=t.nativeEvent)||void 0===o?void 0:o.cancelable)&&("none"===e.table.internalProps.overscrollBehavior||Math.abs(r)>=Math.abs(n)&&0!==r&&NM(r,e)||Math.abs(r)<=Math.abs(n)&&0!==n&&GM(n,e))&&t.nativeEvent.preventDefault()}function NM(t,e){return 0!=e.table.getAllRowsHeight()-e.table.scenegraph.height&&!function(t,e){return 0!=e.table.getAllRowsHeight()-e.table.scenegraph.height&&t<=0&&e.scroll.verticalBarPos<1}(t,e)&&!function(t,e){var i;const o=(null===(i=e.table.options.customConfig)||void 0===i?void 0:i._disableColumnAndRowSizeRound)?1:0,n=e.table.getAllRowsHeight()-e.table.scenegraph.height;return 0!==n&&t>=0&&Math.abs(e.scroll.verticalBarPos-n)<1+o}(t,e)}function GM(t,e){return 0!=e.table.getAllColsWidth()-e.table.scenegraph.width&&!function(t,e){return 0!=e.table.getAllColsWidth()-e.table.scenegraph.width&&t<=0&&e.scroll.horizontalBarPos<1}(t,e)&&!function(t,e){var i;const o=(null===(i=e.table.options.customConfig)||void 0===i?void 0:i._disableColumnAndRowSizeRound)?1:0,n=e.table.getAllColsWidth()-e.table.scenegraph.width;return 0!==n&&t>=0&&Math.abs(e.scroll.horizontalBarPos-n)<1+o}(t,e)}class jM{constructor(t){this.stateManager=t}setScrollHandle(t){this.scrollHandle=t}startInertia(t,e,i){this.lastTime=Date.now(),this.speedX=t,this.speedY=e,this.friction=i,this.runingId||(this.runingId=requestAnimationFrame(this.inertia.bind(this)))}inertia(){var t;const e=Date.now(),i=e-this.lastTime;let o=!0;const n=Math.pow(this.friction,i/16),r=n*this.speedX,s=n*this.speedY;let l=0,a=0;Math.abs(r)>.05&&(o=!1,l=(this.speedX+r)/2*i),Math.abs(s)>.05&&(o=!1,a=(this.speedY+s)/2*i),null===(t=this.scrollHandle)||void 0===t||t.call(this,l,a),o?this.runingId=null:(this.lastTime=e,this.speedX=r,this.speedY=s,this.runingId=requestAnimationFrame(this.inertia.bind(this)))}endInertia(){cancelAnimationFrame(this.runingId),this.runingId=null}isInertiaScrolling(){return!!this.runingId}}function VM(t){const e=t.table,i=e.stateManager;e.scenegraph.tableGroup.addEventListener("pointermove",(o=>{var n,r,s,l,a,h,d,c,u,g,p,f,v,m,b,y,C,w,x;const _=null!==(r=null===(n=e.eventManager.LastPointerXY)||void 0===n?void 0:n.x)&&void 0!==r?r:o.x,S=null!==(l=null===(s=e.eventManager.LastPointerXY)||void 0===s?void 0:s.y)&&void 0!==l?l:o.y;e.eventManager.LastPointerXY={x:o.x,y:o.y},t.touchSetTimeout&&(clearTimeout(t.touchSetTimeout),t.touchSetTimeout=void 0);const A=Y_(o);if(A.eventArgs&&e.hasListeners(Xw.MOUSEMOVE_TABLE)&&e.fireListeners(Xw.MOUSEMOVE_TABLE,{col:A.eventArgs.col,row:A.eventArgs.row,x:A.abstractPos.x,y:A.abstractPos.y,event:o.nativeEvent,target:null===(a=null==A?void 0:A.eventArgs)||void 0===a?void 0:a.target,mergeCellInfo:null===(h=A.eventArgs)||void 0===h?void 0:h.mergeInfo}),i.interactionState===IC.grabing&&!(null===(d=e.editorManager)||void 0===d?void 0:d.editingEditor))return void(Math.abs(_-o.x)+Math.abs(S-o.y)>=1&&(i.isResizeCol()||(i.isMoveCol()?t.dealColumnMover(A):i.isFillHandle()?t.dealFillSelect(A,!0):(null===(c=e.options.select)||void 0===c?void 0:c.disableDragSelect)||t.dealTableSelect(A,!0))));!(null===(u=e.options.select)||void 0===u?void 0:u.disableDragSelect)&&e.eventManager.isDraging&&i.isSelecting()&&!(null===(g=e.editorManager)||void 0===g?void 0:g.editingEditor)&&t.dealTableSelect(A,!0);const B=o.path.find((t=>"cell"===t.role));if(e.hasListeners(Xw.MOUSELEAVE_CELL)&&(-1===e.stateManager.hover.cellPos.col||-1===e.stateManager.hover.cellPos.row||(null==B?void 0:B.col)===e.stateManager.hover.cellPos.col&&(null==B?void 0:B.row)===e.stateManager.hover.cellPos.row||e.fireListeners(Xw.MOUSELEAVE_CELL,{col:e.stateManager.hover.cellPos.col,row:e.stateManager.hover.cellPos.row,cellRange:e.getCellRangeRelativeRect({col:e.stateManager.hover.cellPos.col,row:e.stateManager.hover.cellPos.row}),scaleRatio:e.canvas.getBoundingClientRect().width/e.canvas.offsetWidth,event:o.nativeEvent,target:null===(p=null==A?void 0:A.eventArgs)||void 0===p?void 0:p.target})),e.hasListeners(Xw.MOUSEENTER_CELL)&&("cell"!==(null==B?void 0:B.role)||!Q(B.col)||!Q(B.row)||B.col===e.stateManager.hover.cellPos.col&&B.row===e.stateManager.hover.cellPos.row||B.col===(null===(f=e.stateManager.hover.cellPosContainHeader)||void 0===f?void 0:f.col)&&B.row===(null===(v=e.stateManager.hover.cellPosContainHeader)||void 0===v?void 0:v.row)||e.fireListeners(Xw.MOUSEENTER_CELL,{col:B.col,row:B.row,cellRange:e.getCellRangeRelativeRect({col:B.col,row:B.row}),scaleRatio:e.canvas.getBoundingClientRect().width/e.canvas.offsetWidth,event:o.nativeEvent,target:null===(m=null==A?void 0:A.eventArgs)||void 0===m?void 0:m.target,mergeCellInfo:null===(b=A.eventArgs)||void 0===b?void 0:b.mergeInfo})),t.dealIconHover(A),t.dealTableHover(A),A.eventArgs&&e.hasListeners(Xw.MOUSEMOVE_CELL)){let t,i;if(null===(y=A.eventArgs)||void 0===y?void 0:y.target){const e=zM(null===(C=A.eventArgs)||void 0===C?void 0:C.target);e&&(t=e.icon,i=e.position)}e.fireListeners(Xw.MOUSEMOVE_CELL,{col:A.eventArgs.col,row:A.eventArgs.row,x:A.abstractPos.x,y:A.abstractPos.y,event:o.nativeEvent,targetIcon:t?{name:t.name,position:i,funcType:t.attribute.funcType}:void 0,target:null===(w=null==A?void 0:A.eventArgs)||void 0===w?void 0:w.target,mergeCellInfo:null===(x=A.eventArgs)||void 0===x?void 0:x.mergeInfo})}})),e.scenegraph.tableGroup.addEventListener("pointerout",(e=>{var i;const o=Y_(e),n=null===(i=null==o?void 0:o.eventArgs)||void 0===i?void 0:i.target;"table"===(null==n?void 0:n.role)&&t.dealTableHover()})),e.scenegraph.tableGroup.addEventListener("pointerover",(t=>{var i,o;const n=Y_(t),r=null===(i=null==n?void 0:n.eventArgs)||void 0===i?void 0:i.target;if(r&&e.hasListeners(Xw.MOUSEOVER_CHART_SYMBOL)&&"symbol"===r.type){const i=t.composedPath().find((t=>"cell"===t.roll));if(i){const{col:r,row:s}=i,l={col:r,row:s,field:e.getHeaderField(r,s),value:e.getCellValue(r,s),dataValue:e.getCellOriginValue(r,s),cellHeaderPaths:e.internalProps.layoutMap.getCellHeaderPaths(r,s),title:e.getBodyColumnDefine(r,s).title,cellRange:e.getCellRelativeRect(r,s),event:t.nativeEvent,sparkline:{pointData:void 0},scaleRatio:e.canvas.getBoundingClientRect().width/e.canvas.offsetWidth,target:null===(o=null==n?void 0:n.eventArgs)||void 0===o?void 0:o.target};e.fireListeners(Xw.MOUSEOVER_CHART_SYMBOL,l)}}})),e.scenegraph.tableGroup.addEventListener("pointerenter",(t=>{(e.theme.scrollStyle.horizontalVisible&&"focus"===e.theme.scrollStyle.horizontalVisible||!e.theme.scrollStyle.horizontalVisible&&"focus"===e.theme.scrollStyle.visible)&&i.showHorizontalScrollBar(),(e.theme.scrollStyle.verticalVisible&&"focus"===e.theme.scrollStyle.verticalVisible||!e.theme.scrollStyle.verticalVisible&&"focus"===e.theme.scrollStyle.visible)&&i.showVerticalScrollBar(),e.hasListeners(Xw.MOUSEENTER_TABLE)&&e.fireListeners(Xw.MOUSEENTER_TABLE,{event:t.nativeEvent})})),e.scenegraph.tableGroup.addEventListener("pointerleave",(o=>{i.isResizeCol()||i.isMoveCol()||i.isSelecting()||(i.updateInteractionState(IC.default),i.updateCursor()),(e.theme.scrollStyle.horizontalVisible&&"focus"===e.theme.scrollStyle.horizontalVisible||!e.theme.scrollStyle.horizontalVisible&&"focus"===e.theme.scrollStyle.visible)&&i.hideHorizontalScrollBar(),(e.theme.scrollStyle.verticalVisible&&"focus"===e.theme.scrollStyle.verticalVisible||!e.theme.scrollStyle.verticalVisible&&"focus"===e.theme.scrollStyle.visible)&&i.hideVerticalScrollBar(),e.hasListeners(Xw.MOUSELEAVE_CELL)&&-1!==e.stateManager.hover.cellPos.col&&-1!==e.stateManager.hover.cellPos.row&&e.fireListeners(Xw.MOUSELEAVE_CELL,{col:e.stateManager.hover.cellPos.col,row:e.stateManager.hover.cellPos.row,cellRange:e.getCellRangeRelativeRect({col:e.stateManager.hover.cellPos.col,row:e.stateManager.hover.cellPos.row}),scaleRatio:e.canvas.getBoundingClientRect().width/e.canvas.offsetWidth,event:o.nativeEvent,target:void 0}),t.dealTableHover();const n=o.target;n&&!n.isDescendantsOf(e.scenegraph.tableGroup)&&e.fireListeners(Xw.MOUSELEAVE_TABLE,{event:o.nativeEvent})}));const o=o=>{var n;const r=o.target;if(!e.getElement().contains(r)){zw(null===(n=e.editorManager)||void 0===n?void 0:n.completeEdit(o),(e=>{!1!==e&&(i.updateInteractionState(IC.default),t.dealTableHover())}))}},n=o=>{var n;const r=o.target;if(!e.getElement().contains(r)){zw(null===(n=e.editorManager)||void 0===n?void 0:n.completeEdit(o),(o=>{var n,r;if(!1!==o&&(null===(n=e.options.select)||void 0===n?void 0:n.outsideClickDeselect)){const e=!!(null===(r=i.select.ranges)||void 0===r?void 0:r.length);t.dealTableSelect(),i.endSelectCells(!0,e)}}))}};t.globalEventListeners.push({name:"pointerup",env:"document",callback:o}),t.globalEventListeners.push({name:"pointerdown",env:"document",callback:n}),bu.addEventListener("pointerup",o),bu.addEventListener("pointerdown",n),e.scenegraph.tableGroup.addEventListener("pointerdown",(o=>{var n,r,s,l,a;if(e.hasListeners(Xw.MOUSEDOWN_TABLE)&&e.fireListeners(Xw.MOUSEDOWN_TABLE,{event:o.nativeEvent}),e.eventManager.isDown=!0,e.eventManager.LastBodyPointerXY={x:o.x,y:o.y},e.eventManager.LastPointerXY={x:o.x,y:o.y},0!==o.button)return;const h=Y_(o);if(t.downIcon=void 0,i.interactionState!==IC.default)return;if(e.isPivotChart()&&"chart"!==(null===(n=null==h?void 0:h.eventArgs)||void 0===n?void 0:n.target.type)&&e.scenegraph.updateChartState(null),(null===(r=h.eventArgs)||void 0===r?void 0:r.target)!==(null===(s=i.residentHoverIcon)||void 0===s?void 0:s.icon)&&i.hideMenu(),"chart"===(null===(l=null==h?void 0:h.eventArgs)||void 0===l?void 0:l.target.type))return;zw(null===(a=e.editorManager)||void 0===a?void 0:a.completeEdit(o.nativeEvent),(n=>{var r,s,l,a,d,c,u;if(!1===n)return;const g=(null===(l=null===(s=null===(r=null==h?void 0:h.eventArgs)||void 0===r?void 0:r.target)||void 0===s?void 0:s.role)||void 0===l?void 0:l.startsWith("icon"))?h.eventArgs.target:(null===(a=o.target.role)||void 0===a?void 0:a.startsWith("icon"))?o.target:void 0;if(t.downIcon=g,g&&!1!==g.attribute.interactive)g.attribute.funcType===VC.dragReorder&&(i.startMoveCol(h.eventArgs.col,h.eventArgs.row,h.abstractPos.x,h.abstractPos.y,null===(c=null===(d=h.eventArgs)||void 0===d?void 0:d.event)||void 0===c?void 0:c.nativeEvent),i.updateInteractionState(IC.grabing));else if("touch"===o.pointerType)t.touchEnd=!1,t.touchSetTimeout=setTimeout((()=>{t.isTouchdown=!1,t.touchMove=!0,(!t.touchEnd&&(t.checkColumnResize(h,!0)||t.checkRowResize(h,!0))||!t.touchEnd&&t.chechColumnMover(h)||t.dealTableSelect(h)&&!t.touchEnd)&&i.updateInteractionState(IC.grabing)}),500),t.dealTableHover(h);else{if(!t.checkCellFillhandle(h)&&(t.checkColumnResize(h,!0)||t.checkRowResize(h,!0)))return e.scenegraph.updateChartState(null),void i.updateInteractionState(IC.grabing);if(t.chechColumnMover(h))return void i.updateInteractionState(IC.grabing);if(t.checkCellFillhandle(h,!0)&&t.dealFillSelect(h))return void i.updateInteractionState(IC.grabing);t.dealTableSelect(h)&&i.updateInteractionState(IC.grabing)}if(e.hasListeners(Xw.MOUSEDOWN_CELL)){const t=Y_(o);t.eventArgs&&e.fireListeners(Xw.MOUSEDOWN_CELL,{col:t.eventArgs.col,row:t.eventArgs.row,event:o.nativeEvent,target:null===(u=null==t?void 0:t.eventArgs)||void 0===u?void 0:u.target,mergeCellInfo:t.eventArgs.mergeInfo})}}))})),e.scenegraph.tableGroup.addEventListener("pointerup",(t=>{var o,n,r,s;if(0===t.button){if("grabing"===i.interactionState){if(i.updateInteractionState(IC.default),i.isResizeCol())$M(e);else if(i.isResizeRow())XM(e);else if(i.isMoveCol()){const i=Y_(t);e.stateManager.endMoveCol()&&i.eventArgs&&e.hasListeners(Xw.CHANGE_HEADER_POSITION)&&e.fireListeners(Xw.CHANGE_HEADER_POSITION,{target:{col:i.eventArgs.col,row:i.eventArgs.row},source:{col:e.stateManager.columnMove.colSource,row:e.stateManager.columnMove.rowSource},event:t.nativeEvent})}else if(i.isSelecting()){e.stateManager.endSelectCells(),e.stateManager.isFillHandle()&&e.stateManager.endFillSelect();const i=Y_(t);if(e.eventManager.isDraging&&i.eventArgs&&e.hasListeners(Xw.DRAG_SELECT_END)){const r={event:t.nativeEvent,cells:[],col:i.eventArgs.target.col,row:i.eventArgs.target.row,scaleRatio:e.canvas.getBoundingClientRect().width/e.canvas.offsetWidth,target:null===(o=null==i?void 0:i.eventArgs)||void 0===o?void 0:o.target,mergeCellInfo:null===(n=i.eventArgs)||void 0===n?void 0:n.mergeInfo};r.cells=e.getSelectedCellInfos(),e.fireListeners(Xw.DRAG_SELECT_END,r)}}}else i.interactionState===IC.scrolling&&i.updateInteractionState(IC.default);if(e.hasListeners(Xw.MOUSEUP_CELL)){const i=Y_(t);i.eventArgs&&e.fireListeners(Xw.MOUSEUP_CELL,{col:i.eventArgs.col,row:i.eventArgs.row,event:t.nativeEvent,target:null===(r=null==i?void 0:i.eventArgs)||void 0===r?void 0:r.target,mergeCellInfo:null===(s=i.eventArgs)||void 0===s?void 0:s.mergeInfo})}}})),e.scenegraph.tableGroup.addEventListener("rightdown",(t=>{var o,n,r,s;const l=Y_(t);if(l.eventArgs){i.triggerContextMenu(l.eventArgs.col,l.eventArgs.row,l.abstractPos.x,l.abstractPos.y);const{col:a,row:h}=l.eventArgs;if(e.hasListeners(Xw.CONTEXTMENU_CELL)){const i=e.getCellInfo(a,h);let d,c;if(null===(o=l.eventArgs)||void 0===o?void 0:o.target){const t=zM(null===(n=l.eventArgs)||void 0===n?void 0:n.target);t&&(d=t.icon,c=t.position)}const u=Object.assign(Object.assign({},i),{event:t.nativeEvent,cells:[],targetIcon:d?{name:d.name,position:c,funcType:d.attribute.funcType}:void 0,target:null===(r=null==l?void 0:l.eventArgs)||void 0===r?void 0:r.target,mergeCellInfo:null===(s=l.eventArgs)||void 0===s?void 0:s.mergeInfo});!function(t,e,i){for(let o=0;o<t.length;o++){const n=t[o],r=Math.min(n.start.col,n.end.col),s=Math.max(n.start.col,n.end.col),l=Math.min(n.start.row,n.end.row),a=Math.max(n.start.row,n.end.row);if(r<=e&&e<=s&&l<=i&&i<=a||s<=e&&e<=r&&a<=i&&i<=l)return!0}return!1}(e.stateManager.select.ranges,a,h)?u.cells=[[i]]:u.cells=e.getSelectedCellInfos(),e.fireListeners(Xw.CONTEXTMENU_CELL,u)}}})),e.scenegraph.tableGroup.addEventListener("pointertap",(o=>{var n,r,s,l,a;if(e.stateManager.columnResize.resizing)return;const h=Y_(o);if(!t.touchMove&&0===o.button&&h.eventArgs&&e.hasListeners(Xw.CLICK_CELL)){const{col:t,row:i}=h.eventArgs,a=e.getCellInfo(t,i);let d,c;if(null===(n=h.eventArgs)||void 0===n?void 0:n.target){const t=zM(null===(r=h.eventArgs)||void 0===r?void 0:r.target);t&&(d=t.icon,c=t.position)}const u=Object.assign(Object.assign({},a),{event:o.nativeEvent,federatedEvent:o,cells:[],targetIcon:d?{name:d.name,position:c,funcType:d.attribute.funcType}:void 0,target:null===(s=null==h?void 0:h.eventArgs)||void 0===s?void 0:s.target,mergeCellInfo:null===(l=h.eventArgs)||void 0===l?void 0:l.mergeInfo});e.fireListeners(Xw.CLICK_CELL,u)}if(!e.stateManager.columnResize.resizing&&!e.stateManager.columnMove.moving&&(t.dealIconClick(o,h),(null==h?void 0:h.eventArgs)&&t.touchSetTimeout&&"touch"===o.pointerType)){const e=Y_(o);if(t.touchSetTimeout){clearTimeout(t.touchSetTimeout);const o=!!(null===(a=i.select.ranges)||void 0===a?void 0:a.length);t.dealTableSelect(e),i.endSelectCells(!0,o),t.touchSetTimeout=void 0}}})),e.scenegraph.stage.addEventListener("pointerdown",(o=>{var n,r,s,l;const a=Y_(o);(null===(n=a.eventArgs)||void 0===n?void 0:n.target)&&(null===(r=a.eventArgs)||void 0===r?void 0:r.target)===(null===(s=i.residentHoverIcon)||void 0===s?void 0:s.icon)||i.hideMenu();zw(null===(l=e.editorManager)||void 0===l?void 0:l.completeEdit(o.nativeEvent),(n=>{var r;if(!1===n)return;const s=(null===(r=o.target.role)||void 0===r?void 0:r.startsWith("icon"))?o.target:void 0;if(t.downIcon=s,s||t.checkCellFillhandle(a)||i.columnResize.resizing||!t.checkColumnResize(a,!0));else{e.scenegraph.updateChartState(null),i.updateInteractionState(IC.grabing);const{eventArgs:t}=a;(null==t?void 0:t.targetCell)||e.getCellAt(a.abstractPos.x-8,a.abstractPos.y)&&e.hasListeners(Xw.MOUSEDOWN_TABLE)&&e.fireListeners(Xw.MOUSEDOWN_TABLE,{event:o.nativeEvent})}}))})),e.scenegraph.stage.addEventListener("pointerup",(t=>{"grabing"===i.interactionState&&(i.updateInteractionState(IC.default),i.isResizeCol()&&$M(e))})),e.scenegraph.stage.addEventListener("pointertap",(o=>{var n,r,s;const l=o.target;if(e.eventManager.isDraging||!l||!l.isDescendantsOf(e.scenegraph.stage)&&l.stage!==l||l.isDescendantsOf(e.scenegraph.tableGroup))e.eventManager.isDraging&&i.isSelecting()&&i.endSelectCells();else{i.updateInteractionState(IC.default),t.dealTableHover();const o=!!(null===(n=i.select.ranges)||void 0===n?void 0:n.length);(null===(s=null===(r=e.options.select)||void 0===r?void 0:r.blankAreaClickDeselect)||void 0===s||s)&&t.dealTableSelect(),i.endSelectCells(!0,o),i.updateCursor(),e.scenegraph.updateChartState(null)}})),e.scenegraph.stage.addEventListener("pointermove",(o=>{const n=Y_(o);i.isResizeCol()||t.checkColumnResize(n)?e.stateManager.select&&t.checkCellFillhandle(n)?i.updateCursor("crosshair"):i.updateCursor("col-resize"):i.isResizeRow()||t.checkRowResize(n)?e.stateManager.select&&t.checkCellFillhandle(n)?i.updateCursor("crosshair"):i.updateCursor("row-resize"):i.isMoveCol()||i.updateCursor()})),e.scenegraph.tableGroup.addEventListener("checkbox_state_change",(t=>{var i,o;const n=Y_(t),{col:r,row:s}=n.eventArgs,l=e.getCellInfo(r,s),a=Mx(e,r,s);if(a)for(let i=a.start.col;i<=a.end.col;i++)for(let o=a.start.row;o<=a.end.row;o++)e.scenegraph.getCell(i,o).forEachChildren((e=>{"checkbox"===e.name&&e.setAttributes({checked:t.target.attribute.checked,indeterminate:t.target.attribute.indeterminate})}));const h=Object.assign(Object.assign({},l),{event:t.nativeEvent,target:null===(i=null==n?void 0:n.eventArgs)||void 0===i?void 0:i.target,mergeCellInfo:null===(o=null==n?void 0:n.eventArgs)||void 0===o?void 0:o.mergeInfo,checked:t.detail.checked});if(e.isHeader(r,s))e.stateManager.setHeaderCheckedState(l.field,t.detail.checked),"checkbox"===e.getCellType(r,s)&&e.scenegraph.updateCheckboxCellState(r,s,t.detail.checked);else if(e.stateManager.setCheckedState(r,s,l.field,t.detail.checked),"checkbox"===e.getCellType(r,s)){const t=e.stateManager.headerCheckedState[l.field],i=e.stateManager.updateHeaderCheckedState(l.field,r,s);t!==i&&e.scenegraph.updateHeaderCheckboxCellState(r,s,i)}e.fireListeners(Xw.CHECKBOX_STATE_CHANGE,h),e.scenegraph.updateNextFrame()})),e.scenegraph.tableGroup.addEventListener("radio_checked",(t=>{var i,o,n;const r=Y_(t),{col:s,row:l,target:a}=r.eventArgs,h=e.getCellInfo(s,l),d=null===(i=Z_.exec(a.id))||void 0===i?void 0:i[1],c=Mx(e,s,l);if(c)for(let t=c.start.col;t<=c.end.col;t++)for(let i=c.start.row;i<=c.end.row;i++)e.scenegraph.getCell(t,i).forEachChildren((t=>{"radio"===t.name&&t.id===a.id&&t.setAttributes({checked:!0})}));const u=e.getBodyColumnDefine(s,l).radioCheckType||"column";if("cell"===u)if(c)for(let t=c.start.col;t<=c.end.col;t++)for(let i=c.start.row;i<=c.end.row;i++)e.scenegraph.getCell(t,i).forEachChildren((t=>{"radio"===t.name&&t.id!==a.id&&t.setAttributes({checked:!1})}));else e.scenegraph.getCell(s,l).forEachChildren((t=>{"radio"===t.name&&t.id!==a.id&&t.setAttributes({checked:!1})}));else"column"===u&&e.scenegraph.getColGroup(s).forEachChildren((t=>{t.forEachChildren((t=>{"radio"===t.name&&t.id!==a.id&&t.setAttributes({checked:!1})}))}));const g=d?Number(d):void 0;e.stateManager.setRadioState(s,l,h.field,u,g);const p=Object.assign(Object.assign({},h),{event:t.nativeEvent,target:null===(o=null==r?void 0:r.eventArgs)||void 0===o?void 0:o.target,mergeCellInfo:null===(n=null==r?void 0:r.eventArgs)||void 0===n?void 0:n.mergeInfo,radioIndexInCell:g});e.fireListeners(Xw.RADIO_STATE_CHANGE,p),e.scenegraph.updateNextFrame()})),e.scenegraph.stage.addEventListener("wheel",(t=>{var o;null===(o=e.editorManager)||void 0===o||o.completeEdit(),e.eventManager._enableTableScroll&&WM(t,i)}))}function UM(t){const e=t.table;t.gesture=new Ug(e.scenegraph.tableGroup,{tap:{interval:300}}),t.gesture.on("doubletap",(t=>{!function(t,e){var i,o,n,r,s,l;const a=Y_(t);let h=-1,d=-1;a.eventArgs&&(h=a.eventArgs.col,d=a.eventArgs.row);const c=e.getCellValue(h,d),u=null===(o=null===(i=a.eventArgs)||void 0===i?void 0:i.targetCell)||void 0===o?void 0:o.globalAABBBounds;if(u&&e.internalProps.focusControl.setFocusRect(new tx(u.x1+e.scrollLeft,u.y1+e.scrollTop,u.x2-u.x1,u.y2-u.y1),c),e.hasListeners(Xw.DBLCLICK_CELL)){const i=e.getCellInfo(h,d);let o,c;if(null===(n=a.eventArgs)||void 0===n?void 0:n.target){const t=zM(null===(r=a.eventArgs)||void 0===r?void 0:r.target);t&&(o=t.icon,c=t.position)}const u=Object.assign(Object.assign({},i),{event:t.nativeEvent,federatedEvent:t,cells:[],targetIcon:o?{name:o.name,position:c,funcType:o.attribute.funcType}:void 0,target:null===(s=null==a?void 0:a.eventArgs)||void 0===s?void 0:s.target,mergeCellInfo:null===(l=null==a?void 0:a.eventArgs)||void 0===l?void 0:l.mergeInfo});e.fireListeners(Xw.DBLCLICK_CELL,u)}}(t,e)}))}function $M(t){t.stateManager.endResizeCol();const e=[];for(let i=0;i<t.colCount;i++)e.push(t.getColWidth(i));t.fireListeners(Xw.RESIZE_COLUMN_END,{col:t.stateManager.columnResize.col,colWidths:e})}function XM(t){t.stateManager.endResizeRow(),t.fireListeners(Xw.RESIZE_ROW_END,{row:t.stateManager.rowResize.row,rowHeight:t.getRowHeight(t.stateManager.rowResize.row)})}let YM=1;function KM(){return xw?YM=1:(YM=Math.ceil(window.devicePixelRatio||1),YM>1&&YM%2!=0&&(YM+=1)),YM}function qM(t){return!!t.changedTouches}function ZM(t,e,i){if(i.indicatorsAsCol){if(i.hasTwoIndicatorAxes&&e===i.columnHeaderLevelCount-1&&t>=i.rowHeaderLevelCount&&t<i.colCount-i.rightFrozenColCount)return"top";if(e===i.rowCount-i.bottomFrozenRowCount&&t>=i.rowHeaderLevelCount&&t<i.colCount-i.rightFrozenColCount)return"bottom";if(t===i.rowHeaderLevelCount-1&&e>=i.rowHeaderLevelCount&&e<i.rowCount-i.bottomFrozenRowCount)return"left"}else{if(t===i.rowHeaderLevelCount-1&&e>=i.columnHeaderLevelCount&&e<i.rowCount-i.bottomFrozenRowCount)return"left";if(t===i.colCount-i.rightFrozenColCount&&e>=i.columnHeaderLevelCount&&e<i.rowCount-i.bottomFrozenRowCount)return"right";if(e===i.rowCount-i.bottomFrozenRowCount&&t>=i.rowHeaderLevelCount&&t<i.colCount-i.rightFrozenColCount)return"bottom"}return"bottom"}KM();let JM;const QM=t=>{const e=t.value;return Number(e)>80?"#20a8d8":Number(e)>50?"#4dbd74":Number(e)>20?"#ffc107":"#f86c6b"};class tT extends QC{static get DEFAULT(){return JM||(JM=new tT)}constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};var e,i,o,n,r,s,l,a,h,d,c,u,g,p,f;super(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}),this._showBar=null===(e=t.showBar)||void 0===e||e,this._barColor=null!==(i=t.barColor)&&void 0!==i?i:QM,this._barPositiveColor=null!==(o=t.barPositiveColor)&&void 0!==o?o:"#4dbd74",this._barNegativeColor=null!==(n=t.barNegativeColor)&&void 0!==n?n:"#f86c6b",this._barAxisColor=null!==(r=t.barAxisColor)&&void 0!==r?r:"black",this._barBgColor=t.barBgColor,this._barHeight=null!==(s=t.barHeight)&&void 0!==s?s:3,this._barHeight=null!==(l=t.barHeight)&&void 0!==l?l:3,this._barBottom=null!==(a=t.barBottom)&&void 0!==a?a:0,this._barPadding=null!==(h=t.barPadding)&&void 0!==h?h:[0,0,0,0],this._showBarMark=null!==(d=t.showBarMark)&&void 0!==d&&d,this._barMarkPositiveColor=null!==(c=t.barMarkPositiveColor)&&void 0!==c?c:"#4dbd74",this._barMarkNegativeColor=null!==(u=t.barMarkNegativeColor)&&void 0!==u?u:"#f86c6b",this._barMarkWidth=null!==(g=t.barMarkWidth)&&void 0!==g?g:2,this._barMarkPosition=null!==(p=t.barMarkPosition)&&void 0!==p?p:"right",this._barRightToLeft=null!==(f=t.barRightToLeft)&&void 0!==f&&f}get showBar(){return this._showBar}set showBar(t){this._showBar=t}get barColor(){return this._barColor}set barColor(t){this._barColor=t}get barBgColor(){return this._barBgColor}set barBgColor(t){this._barBgColor=t}get barHeight(){return this._barHeight}set barHeight(t){this._barHeight=t}get barBottom(){return this._barBottom}set barBottom(t){this._barBottom=t}get barPositiveColor(){return this._barPositiveColor}set barPositiveColor(t){this._barPositiveColor=t}get barNegativeColor(){return this._barNegativeColor}set barNegativeColor(t){this._barNegativeColor=t}get barAxisColor(){return this._barAxisColor}set barAxisColor(t){this._barAxisColor=t}get barPadding(){return this._barPadding}set barPadding(t){this._barPadding=t}get showBarMark(){return this._showBarMark}set showBarMark(t){this._showBarMark=t}get barMarkPositiveColor(){return this._barMarkPositiveColor}set barMarkPositiveColor(t){this._barMarkPositiveColor=t}get barMarkNegativeColor(){return this._barMarkNegativeColor}set barMarkNegativeColor(t){this._barMarkNegativeColor=t}get barMarkWidth(){return this._barMarkWidth}set barMarkWidth(t){this._barMarkWidth=t}get barMarkPosition(){return this._barMarkPosition}set barMarkPosition(t){this._barMarkPosition=t}get barRightToLeft(){return this._barRightToLeft}set barRightToLeft(t){this._barRightToLeft=t}clone(){return new tT(this,null)}}const eT=["type","content","font","color","width","height","marginRight","marginLeft","src","svg","name","path","positionType","tooltip","hover","cursor","shape","interactive"];class iT{constructor(t){this._table=t;const e=FS();this.expandIcon=e[UC.expandIconName],this.collapseIcon=e[UC.collapseIconName]}getIcons(t,e,i,o,n){const r=[],s=this.getHierarchyIcon(t,e);s&&r.push(s);const{icon:l}=this._table.getBodyColumnDefine(t,e);if(l){let n;n="function"==typeof l?l({col:t,row:e,value:i,dataValue:o,table:this._table}):l;const s=FS(),a=t=>{let e;e="string"==typeof t?s[t]:t,e&&r.push(e)};Array.isArray(n)?n.forEach(((t,e)=>{a(t)})):a(n)}return n&&r.forEach(((i,o)=>{(i.content||i.src)&&(r[o]=this.getCellIconFromRecordValue(i,t,e))})),r}getStyleClass(t){switch(t){case"text":case"link":return ew;case"image":case"video":return tw;case"chart":case"sparkline":return QC;case"progressbar":return tT;case"checkbox":return ow;case"radio":return nw}return ew}getCellIconFromRecordValue(t,e,i){if(Array.isArray(t))return t.map((t=>this.getCellIconFromRecordValue(t,e,i)));if(!Gw.isObject(t)||"function"==typeof t)return this._table.getFieldData(t,e,i);const o={},n=t;return eT.forEach((t=>{var r,s;if(void 0!==n[t]){const l=this._table.getFieldData(n[t],e,i);Q(l)?o[t]=l:(null===(s=(r=this._table)._hasField)||void 0===s?void 0:s.call(r,n[t],e,i))||(o[t]=n[t])}})),o}getHierarchyIcon(t,e){const i=this._table.getHierarchyState(t,e);return i===WC.expand?this.expandIcon:i===WC.collapse?this.collapseIcon:void 0}getHierarchyIconWidth(){var t,e;return this.expandIcon.width+(null!==(t=this.expandIcon.marginLeft)&&void 0!==t?t:0)+(null!==(e=this.expandIcon.marginRight)&&void 0!==e?e:0)}}function oT(t,e){const i=document.createElement(t);return e&&i.classList.add(...e),i}!function(){if("node"===sw.mode)return;const t=document.createElement("style");t.id="vtable-menu-styleSheet",t.textContent="\n@keyframes vtable__menu-element--shown-animation {\n\t0% {\n\t\topacity: 0;\n\t}\n\t100% {\n\t\topacity: 1;\n\t}\n}\n.vtable__menu-element {\n\tposition: absolute;\n\tbox-sizing: border-box;\n\tborder-radius: 4px;\n\tbackground-color: #fff;\n\tpadding: 6px 0;\n\t/* pointer-events: none; */\n\tuser-select: none;\n\tcolor: #000;\n\tmax-width: 300px;\n\tz-index: 99999;\n\tborder: #CCC 0.5px solid;\n\tcursor: default;\n\twidth: max-content;\n\tbox-shadow: 0px 8px 16px rgba(27, 31, 35, 0.12);\n max-height: 100%;\n overflow-y: auto;\n}\n.vtable__menu-element--hidden {\n\topacity: 0;\n\t/* transform: translate(-50%, -50%); */\n\ttransition: opacity 75ms linear;\n\tz-index: -9999;\n}\n.vtable__menu-element--shown {\n\topacity: 1;\n\t/* transform: translate(-50%, -50%); */\n\tanimation: vtable__menu-element--shown-animation 150ms ease-out;\n}\n.vtable__menu-element__content {\n\tfont-family: Roboto;\n\tfont-size: 12px;\n\toverflow: hidden;\n\tdisplay: inline-block;\n\t/* height: 100%; */\n\tline-height: 30px;\n}\n.vtable__menu-element__item {\n\theight: 32px;\n\tpadding: 0px 12px;\n\tcursor: pointer;\n\tposition: relative;\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: flex-start;\n}\n.vtable__menu-element__item:hover {\n\tbackground-color: rgba(27, 31, 35, 0.06);\n}\n.vtable__menu-element__icon{\n\t/* vertical-align: top; */\n\tdisplay: flex;\n\t/* line-height: 30px; */\n\tmargin-right: 6px;\n}\n.vtable__menu-element__no-event {\n\tpointer-events: none;\n}\n.vtable__menu-element--select {\n\tcolor: #2E68CF;\n}.vtable__menu-element--normal {\n\tcolor: rgba(20, 20, 20, 0.9);;\n}\n.vtable__menu-element__split {\n\theight: 0px;\n\tborder: 1px solid rgb(209, 213, 218);\n\tmargin: 5px 0;\n}\n.vtable__menu-element__title {\n\tcolor: rgb(149, 149, 149);\n}\n.vtable__menu-element__arrow {\n\tposition: absolute;\n\tright: 3px;\n\tfont-weight: bold;\n\tmargin-top: 1px;\n}\n.vtable__menu-element__item-text {\n\tmargin-right: 15px;\n}\n",document.head.appendChild(t)}();const nT="vtable__menu-element",rT=`${nT}__item`,sT=`${nT}__content`,lT=`${nT}--hidden`,aT=`${nT}--shown`,hT=`${nT}--normal`,dT=`${nT}--select`,cT=`${nT}__icon`,uT=`${nT}__split`,gT=`${nT}__title`,pT=`${nT}__arrow`,fT=`${nT}__no-event`,vT=`${nT}__item-text`;function mT(){return oT("div",[nT,lT])}function bT(t,e,i,o,n,r){const s=t.getCellRange(o,n);for(let o=0;o<e.length;o++){const n=e[o];let{col:r,row:l}=n;const{field:a,menuKey:h}=n;if("number"!=typeof r||"number"!=typeof l)if(t.isPivotTable()){const e=t.internalProps.layoutMap.getPivotCellAdress(a);if(!e)continue;r=e.col,l=e.row}else{const e=t.internalProps.layoutMap.getHeaderCellAddressByField(a);if(!e)continue;r=e.col,l=e.row}if(Q(r)&&Q(l)&&Ow(s,r,l)&&i===h)return!0}return!1}class yT{constructor(t){var e,i,o,n,r,s,l,a,h,d;this._handler=new Zw,this._rootElement=mT(),this._secondElement=mT(),this._secondElement.sub=!0,this._showChildrenIndex=-1,this._rootElement.addEventListener("wheel",(t=>{t.stopPropagation()})),null===(e=this._rootElement)||void 0===e||e.addEventListener("mousedown",(t=>{t.stopPropagation(),t.preventDefault()})),null===(i=this._rootElement)||void 0===i||i.addEventListener("touchend",(e=>{if(e.stopPropagation(),e.preventDefault(),this._rootElement.classList.contains(lT))return;const{col:i,row:o,dropDownIndex:n,menuKey:r,text:s,hasChildren:l}=e.target;if("number"!=typeof n||l)return void e.stopPropagation();const a=t.isPivotTable()?t.internalProps.layoutMap.getPivotDimensionInfo(i,o):t.getHeaderField(i,o),h=t._dropDownMenuIsHighlight(i,o,n);t.fireListeners(Xw.DROPDOWN_MENU_CLICK,{col:i,row:o,field:a,menuKey:r,text:s,highlight:h,cellLocation:t.getCellLocation(i,o),event:e}),t.fireListeners(Xw.DROPDOWN_MENU_CLEAR,null),t.fireListeners(Xw.HIDE_MENU,null),e.stopPropagation()})),null===(o=this._rootElement)||void 0===o||o.addEventListener("click",(e=>{if(e.stopPropagation(),e.preventDefault(),this._rootElement.classList.contains(lT))return;const{col:i,row:o,dropDownIndex:n,menuKey:r,text:s,hasChildren:l}=e.target;if("number"!=typeof n||l)return void e.stopPropagation();const a=t.isPivotTable()?t.internalProps.layoutMap.getPivotDimensionInfo(i,o):t.getHeaderField(i,o),h=t._dropDownMenuIsHighlight(i,o,n);t.fireListeners(Xw.DROPDOWN_MENU_CLICK,{col:i,row:o,field:a,menuKey:r,text:s,highlight:h,cellLocation:t.getCellLocation(i,o),event:e}),t.fireListeners(Xw.DROPDOWN_MENU_CLEAR,null),t.fireListeners(Xw.HIDE_MENU,null),e.stopPropagation()})),null===(n=this._rootElement)||void 0===n||n.addEventListener("mousemove",(e=>{var i,o;if(this._rootElement.classList.contains(lT))return;e.stopPropagation();const{hasChildren:n,dropDownIndex:r,col:s,row:l,sub:a}=e.target;if(n){this._showChildrenIndex=r;const o=this._secondElement;null==o||o.classList.remove(lT),null==o||o.classList.add(aT),o.innerHTML="";const n=null===(i=this._menuInstanceInfo.content[r])||void 0===i?void 0:i.children;for(let e=0;e<n.length;e++){const i=n[e],r=CT(i,!!t.stateManager.menu.dropDownMenuHighlight&&bT(t,t.stateManager.menu.dropDownMenuHighlight,"object"==typeof i?(null==i?void 0:i.menuKey)||(null==i?void 0:i.text):i,s,l));r.col=s,r.row=l,r.dropDownIndex=e,"string"==typeof i?(r.text=i,r.menuKey=i):"object"==typeof i&&(r.text=i.text,r.menuKey=i.menuKey||i.text),r.sub=!0,r.sub=!0,o.appendChild(r)}const a=e.target.getBoundingClientRect();this._bindSecondElement(t,s,l,a.right,a.top)}else if(n&&this._showChildrenIndex===r){const t=this._secondElement;null==t||t.classList.remove(lT),null==t||t.classList.add(aT)}else!a&&(null===(o=this._secondElement)||void 0===o?void 0:o.classList.contains(aT))&&setTimeout((()=>{if(!0!==this._mouseEnterSecondElement){this._showChildrenIndex=-1;const t=this._secondElement;null==t||t.classList.remove(aT),null==t||t.classList.add(lT)}}),300)})),null===(r=this._secondElement)||void 0===r||r.addEventListener("wheel",(t=>{t.stopPropagation()})),null===(s=this._secondElement)||void 0===s||s.addEventListener("mousemove",(t=>{this._rootElement.classList.contains(lT)||t.stopPropagation()})),null===(l=this._secondElement)||void 0===l||l.addEventListener("mouseenter",(t=>{this._mouseEnterSecondElement=!0})),null===(a=this._secondElement)||void 0===a||a.addEventListener("mouseleave",(t=>{this._mouseEnterSecondElement=!1})),null===(h=this._secondElement)||void 0===h||h.addEventListener("mousedown",(t=>{t.stopPropagation(),t.preventDefault()})),null===(d=this._secondElement)||void 0===d||d.addEventListener("click",(e=>{if(e.stopPropagation(),e.preventDefault(),this._secondElement.classList.contains(lT))return;const{col:i,row:o,dropDownIndex:n,menuKey:r,text:s,hasChildren:l}=e.target;if("number"!=typeof n||l)return void e.stopPropagation();const a=t.isPivotTable()?t.internalProps.layoutMap.getPivotDimensionInfo(i,o):t.getHeaderField(i,o);let h=!1;this._menuInstanceInfo.content.forEach(((e,n)=>{if("object"==typeof e&&e.children&&e.children.length)for(let n=0;n<e.children.length;n++){const s=e.children[n];if(bT(t,t.stateManager.menu.dropDownMenuHighlight,"object"==typeof s?null==s?void 0:s.menuKey:s,i,o)&&r===("object"==typeof s?null==s?void 0:s.menuKey:s))return void(h=!0)}})),t.fireListeners(Xw.DROPDOWN_MENU_CLICK,{col:i,row:o,field:a,cellHeaderPaths:t.isPivotTable()?t.getCellHeaderPaths(i,o):void 0,menuKey:r,text:s,highlight:h,cellLocation:t.getCellLocation(i,o),event:e}),t.fireListeners(Xw.DROPDOWN_MENU_CLEAR,null),t.fireListeners(Xw.HIDE_MENU,null),e.stopPropagation()}))}get rootElement(){return this._rootElement}release(){this.unbindFromCell();const t=this._rootElement;(null==t?void 0:t.parentElement)&&t.parentElement.removeChild(t),this._handler.release(),delete this._rootElement}bindToCell(t,e,i,o){var n,r;const s=this._rootElement,l=this._secondElement;if(this._menuInstanceInfo=o,null==s||s.classList.remove(aT),null==s||s.classList.add(lT),null==l||l.classList.remove(aT),null==l||l.classList.add(lT),this._canBindToCell(t,e,i)){if(s.innerHTML="",Array.isArray(o.content)){const l=o.content;for(let o=0;null!==(n=o<(null==l?void 0:l.length))&&void 0!==n&&n;o++){const n=l[o];let a=!!t.stateManager.menu.dropDownMenuHighlight&&bT(t,t.stateManager.menu.dropDownMenuHighlight,"object"==typeof n?(null==n?void 0:n.menuKey)||(null==n?void 0:n.text):n,e,i);if(t.stateManager.menu.dropDownMenuHighlight&&"object"==typeof n&&Array.isArray(n.children)&&n.children.length)for(let o=0;o<n.children.length;o++){const r=n.children[o];if(bT(t,t.stateManager.menu.dropDownMenuHighlight,"object"==typeof r?(null==r?void 0:r.menuKey)||(null==r?void 0:r.text):r,e,i)){a=!0;break}}const h=CT(n,a);h.col=e,h.row=i,h.dropDownIndex=o,"string"==typeof n?(h.text=n,h.menuKey=n):"object"==typeof n&&(h.text=n.text,h.menuKey=n.menuKey||n.text,(null===(r=n.children)||void 0===r?void 0:r.length)&&(h.hasChildren=!0)),s.appendChild(h)}}if(this._bindToCell(t,e,i,o.position,o.referencePosition))return null==s||s.classList.add(aT),null==s||s.classList.remove(lT),!0}else this.unbindFromCell();return!1}unbindFromCell(){const t=this._rootElement,e=this._secondElement;this._menuInstanceInfo=void 0,(null==t?void 0:t.parentElement)&&(t.classList.remove(aT),t.classList.add(lT)),(null==e?void 0:e.parentElement)&&(e.classList.remove(aT),e.classList.add(lT))}_canBindToCell(t,e,i){const o=t.getCellRangeRelativeRect({col:e,row:i}),n=t.getElement(),{top:r,bottom:s,left:l,right:a}=o;if(t.isFrozenCell(e,i))return!0;if(s<t.getFrozenRowsHeight()||a<t.getFrozenColsWidth()||l>t.tableNoFrameWidth-t.getRightFrozenColsWidth()||r>t.tableNoFrameHeight-t.getBottomFrozenRowsHeight())return!1;const{offsetHeight:h,offsetWidth:d}=n;return!(h<r||d<l)}_bindToCell(t,e,i,o,n){const r=this._rootElement,s=t.getElement(),{width:l,height:a}=t.internalProps.element.getBoundingClientRect();if(r){r.parentElement!==s&&s.appendChild(r),r.style.left="0px";const t=.8*l;r.style.maxWidth=`${t}px`;const e=r.offsetWidth,i=r.offsetHeight;let h,d;return o?(h=o.x,d=o.y):n&&(h=n.rect.right-e,d=n.rect.bottom),d+i>a&&(d=a-i),d<0&&(d/=2),r.style.top=`${d}px`,h<0?h=0:h+e>l&&(h=l-e),r.style.left=`${h}px`,!0}return!1}_bindSecondElement(t,e,i,o,n){const r=this._secondElement,s=this._rootElement,l=t.getElement(),{width:a,left:h,top:d}=t.internalProps.element.getBoundingClientRect(),{x:c,y:u,width:g}=s.getBoundingClientRect();if(r){r.parentElement!==l&&l.appendChild(r),r.style.left="0px";const t=.8*a;r.style.maxWidth=`${t}px`;const e=r.clientWidth,i=n-4-d,s=o-h;r.style.top=`${i}px`;let c=s;return c+e>a?c=c-e-g:c+=4,r.style.left=`${c}px`,!0}return!1}pointInMenuElement(t,e){const i=this._rootElement,{x:o,y:n,width:r,height:s}=i.getBoundingClientRect();if(t>o-5&&t<o+r+5&&e>n-5&&e<n+s+5)return!0;if(this._secondElement){const{x:o,y:n,width:r,height:s}=i.getBoundingClientRect();if(t>o-5&&t<o+r+5&&e>n-5&&e<n+s+5)return!0}return!1}}function CT(t,e){var i,o,n;const r=oT("div",[rT,e?dT:hT]);if("string"==typeof t){const e=oT("span",[sT,fT,vT]);e.innerHTML=t,r.appendChild(e)}else if("object"==typeof t){const s=null!==(i=t.type)&&void 0!==i?i:"item";if("split"===s)return null==r||r.classList.add(uT),r;if(null===(o=null==t?void 0:t.icon)||void 0===o?void 0:o.svg)if(hx.test(t.icon.svg)){const e=new Image;t.icon.width?e.style.width=t.icon.width.toString()+"px":e.style.width="16px",t.icon.height?e.style.height=t.icon.height.toString()+"px":e.style.height="16px",e.src=t.icon.svg,r.appendChild(e)}else{const i=oT("span",[cT,fT]);i.innerHTML=e&&t.selectedIcon&&t.selectedIcon.svg?t.selectedIcon.svg:t.icon.svg,t.icon.width&&i.children[0].setAttribute("width",t.icon.width.toString()),t.icon.height&&i.children[0].setAttribute("height",t.icon.height.toString()),r.appendChild(i)}const l=oT("span",[sT,fT,vT]);if(l.innerHTML=t.text,r.appendChild(l),"title"===s)null==r||r.classList.add(fT,gT);else if(null===(n=null==t?void 0:t.children)||void 0===n?void 0:n.length){const t=oT("span",[sT,fT,pT]);t.innerHTML=e?'<svg width="8" height="12" viewBox="0 0 10 17" fill="none" xmlns="http://www.w3.org/2000/svg" style="vertical-align: baseline"><path d="M1.78186 16.7729L0.300378 15.2915L6.8189 8.77295L0.300377 2.25443L1.78186 0.77295L9.78186 8.77295L1.78186 16.7729Z" fill="#2E68CF" fill-opacity="0.65"></path></svg>':'<svg width="8" height="12" viewBox="0 0 10 17" fill="none" xmlns="http://www.w3.org/2000/svg" style="vertical-align: baseline"><path d="M1.78186 16.7729L0.300378 15.2915L6.8189 8.77295L0.300377 2.25443L1.78186 0.77295L9.78186 8.77295L1.78186 16.7729Z" fill="#141414" fill-opacity="0.65"></path></svg>',r.appendChild(t)}}return r}let wT;const xT={CHANGE_STYLE:"change_style"};class _T extends YC{static get EVENT_TYPE(){return xT}static get DEFAULT(){return wT||(wT=new _T)}constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};var i,o,n,r,s,l,a,h,d,c,u,g,p,f,v,m,b,y,C,w,x,_,S,A,B,R,M,T,k,L,P,E;super(),this._defaultPadding=[10,16,10,16],this._color=null!==(i=t.color)&&void 0!==i?i:null==e?void 0:e.color,this._strokeColor=null!==(o=null==t?void 0:t.strokeColor)&&void 0!==o?o:null==e?void 0:e.strokeColor,this._fontSize=null!==(n=t.fontSize)&&void 0!==n?n:null==e?void 0:e.fontSize,this._fontFamily=null!==(r=t.fontFamily)&&void 0!==r?r:null==e?void 0:e.fontFamily,this._fontWeight=null!==(s=t.fontWeight)&&void 0!==s?s:null==e?void 0:e.fontWeight,this._fontVariant=null!==(l=t.fontVariant)&&void 0!==l?l:null==e?void 0:e.fontVariant,this._fontStyle=null!==(a=t.fontStyle)&&void 0!==a?a:null==e?void 0:e.fontStyle,this._textOverflow=(null!==(h=t.textOverflow)&&void 0!==h?h:null==e?void 0:e.textOverflow)||"ellipsis",this._textStick=null!==(c=null!==(d=t.textStick)&&void 0!==d?d:null==e?void 0:e.textStick)&&void 0!==c&&c,this._textStickBaseOnAlign=null!==(g=null!==(u=t.textStickBaseOnAlign)&&void 0!==u?u:null==e?void 0:e.textStickBaseOnAlign)&&void 0!==g&&g,this._marked=null!==(f=null!==(p=t.marked)&&void 0!==p?p:null==e?void 0:e.marked)&&void 0!==f&&f,this._textAlign=(null!==(v=t.textAlign)&&void 0!==v?v:null==e?void 0:e.textAlign)||"left",this._textBaseline=(null!==(m=t.textBaseline)&&void 0!==m?m:null==e?void 0:e.textBaseline)||"middle",this._bgColor=null!==(b=t.bgColor)&&void 0!==b?b:null==e?void 0:e.bgColor,this._padding=null!==(C=null!==(y=t.padding)&&void 0!==y?y:null==e?void 0:e.padding)&&void 0!==C?C:this._defaultPadding,this._borderColor=null!==(w=t.borderColor)&&void 0!==w?w:null==e?void 0:e.borderColor,this._lineHeight=null!==(x=t.lineHeight)&&void 0!==x?x:null==e?void 0:e.lineHeight,this._underline=null!==(_=t.underline)&&void 0!==_?_:null==e?void 0:e.underline,this._underlineColor=null!==(S=t.underlineColor)&&void 0!==S?S:null==e?void 0:e.underlineColor,this._underlineDash=null!==(A=t.underlineDash)&&void 0!==A?A:null==e?void 0:e.underlineDash,this._underlineOffset=null!==(B=t.underlineOffset)&&void 0!==B?B:null==e?void 0:e.underlineOffset,this._lineThrough=null!==(R=t.lineThrough)&&void 0!==R?R:null==e?void 0:e.lineThrough,this._lineThroughColor=null!==(M=t.lineThroughColor)&&void 0!==M?M:null==e?void 0:e.lineThroughColor,this._lineThroughDash=null!==(T=t.lineThroughDash)&&void 0!==T?T:null==e?void 0:e.lineThroughDash,this._linkColor=null!==(k=t.linkColor)&&void 0!==k?k:null==e?void 0:e.linkColor,this._cursor=null!==(L=t.cursor)&&void 0!==L?L:null==e?void 0:e.cursor,this._borderLineWidth=null!==(P=t.borderLineWidth)&&void 0!==P?P:null==e?void 0:e.borderLineWidth,this._borderLineDash=null!==(E=t.borderLineDash)&&void 0!==E?E:null==e?void 0:e.borderLineDash}get bgColor(){return this._bgColor}set bgColor(t){this._bgColor=t}get color(){return this._color}set color(t){this._color=t}get strokeColor(){return this._strokeColor}set strokeColor(t){this._strokeColor=t}get fontSize(){return this._fontSize}set fontSize(t){this._fontSize=t}get fontFamily(){return this._fontFamily}set fontFamily(t){this._fontFamily=t}get fontWeight(){return this._fontWeight}set fontWeight(t){this._fontWeight=t}get fontVariant(){return this._fontVariant}set fontVariant(t){this._fontVariant=t}get fontStyle(){return this._fontStyle}set fontStyle(t){this._fontStyle=t}get textOverflow(){return this._textOverflow}set textOverflow(t){this._textOverflow=t}get padding(){var t;return null!==(t=this._padding)&&void 0!==t?t:this._defaultPadding}set padding(t){this._padding=t}get borderColor(){return this._borderColor}set borderColor(t){this._borderColor=t}get textStick(){return this._textStick}set textStick(t){this._textStick=t}get textStickBaseOnAlign(){return this._textStickBaseOnAlign}set textStickBaseOnAlign(t){this._textStickBaseOnAlign=t}get marked(){return this._marked}set marked(t){this._marked=t}get textAlign(){return this._textAlign}set textAlign(t){this._textAlign=t}get textBaseline(){return this._textBaseline}set textBaseline(t){this._textBaseline=t}get lineHeight(){return this._lineHeight}set lineHeight(t){this._lineHeight=t}get underline(){return this._underline}set underline(t){this._underline=t}get underlineColor(){return this._underlineColor}set underlineColor(t){this._underlineColor=t}get underlineDash(){return this._underlineDash}set underlineDash(t){this._underlineDash=t}get underlineOffset(){return this._underlineOffset}set underlineOffset(t){this._underlineOffset=t}get lineThrough(){return this._lineThrough}set lineThrough(t){this._lineThrough=t}get lineThroughColor(){return this._lineThroughColor}set lineThroughColor(t){this._lineThroughColor=t}get lineThroughDash(){return this._lineThroughDash}set lineThroughDash(t){this._lineThroughDash=t}get linkColor(){return this._linkColor}set linkColor(t){this._linkColor=t}get cursor(){return this._cursor}set cursor(t){this._cursor=t}get borderLineWidth(){return this._borderLineWidth}set borderLineWidth(t){this._borderLineWidth=t}get borderLineDash(){return this._borderLineDash}set borderLineDash(t){this._borderLineDash=t}clone(){return new _T(this)}}let ST,AT,BT;class RT extends _T{static get DEFAULT(){return ST||(ST=new RT)}constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};var i;super(t,e),this.textAlign=(null!==(i=t.textAlign)&&void 0!==i?i:null==e?void 0:e.textAlign)||"center"}clone(){return new RT(this)}}class MT extends _T{static get DEFAULT(){return AT||(AT=new MT)}constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;var i,o;super(t,e),this._autoWrapText=null!==(i=null==t?void 0:t.autoWrapText)&&void 0!==i?i:null==e?void 0:e.autoWrapText,this._lineClamp=null!==(o=null==t?void 0:t.lineClamp)&&void 0!==o?o:null==e?void 0:e.lineClamp}clone(){return new MT(this,null)}get lineClamp(){return this._lineClamp}set lineClamp(t){this._lineClamp=t}get autoWrapText(){return this._autoWrapText}set autoWrapText(t){this._autoWrapText=t}}class TT extends _T{static get DEFAULT(){return BT||(BT=new TT)}constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};var o,n,r,s,l,a,h,d,c,u,g,p,f,v,m,b,y,C,w,x,_,S;super(t,e),this._size=(null!==(n=null!==(o=null==t?void 0:t.size)&&void 0!==o?o:null==e?void 0:e.size)&&void 0!==n?n:null==i?void 0:i.size)||14,this._spaceBetweenTextAndIcon=(null!==(s=null!==(r=null==t?void 0:t.spaceBetweenTextAndIcon)&&void 0!==r?r:null==e?void 0:e.spaceBetweenTextAndIcon)&&void 0!==s?s:null==i?void 0:i.spaceBetweenTextAndIcon)||8,this._defaultFill=null!==(a=null===(l=null==t?void 0:t.checkboxStyle)||void 0===l?void 0:l.defaultFill)&&void 0!==a?a:null==i?void 0:i.defaultFill,this._defaultStroke=null!==(d=null===(h=null==t?void 0:t.checkboxStyle)||void 0===h?void 0:h.defaultStroke)&&void 0!==d?d:null==i?void 0:i.defaultStroke,this._disableFill=null!==(u=null===(c=null==t?void 0:t.checkboxStyle)||void 0===c?void 0:c.disableFill)&&void 0!==u?u:null==i?void 0:i.disableFill,this._checkedFill=null!==(p=null===(g=null==t?void 0:t.checkboxStyle)||void 0===g?void 0:g.checkedFill)&&void 0!==p?p:null==i?void 0:i.checkedFill,this._checkedStroke=null!==(v=null===(f=null==t?void 0:t.checkboxStyle)||void 0===f?void 0:f.checkedStroke)&&void 0!==v?v:null==i?void 0:i.checkedStroke,this._disableCheckedFill=null!==(b=null===(m=null==t?void 0:t.checkboxStyle)||void 0===m?void 0:m.disableCheckedFill)&&void 0!==b?b:null==i?void 0:i.disableCheckedFill,this._disableCheckedStroke=null!==(C=null===(y=null==t?void 0:t.checkboxStyle)||void 0===y?void 0:y.disableCheckedStroke)&&void 0!==C?C:null==i?void 0:i.disableCheckedStroke,this._checkIconImage=null!==(x=null===(w=null==t?void 0:t.checkboxStyle)||void 0===w?void 0:w.checkIconImage)&&void 0!==x?x:null==i?void 0:i.checkIconImage,this._indeterminateIconImage=null!==(S=null===(_=null==t?void 0:t.checkboxStyle)||void 0===_?void 0:_.indeterminateIconImage)&&void 0!==S?S:null==i?void 0:i.indeterminateIconImage}get size(){return this._size}set size(t){this._size=t}get spaceBetweenTextAndIcon(){return this._spaceBetweenTextAndIcon}set spaceBetweenTextAndIcon(t){this._spaceBetweenTextAndIcon=t}get defaultFill(){return this._defaultFill}set defaultFill(t){this._defaultFill=t}get defaultStroke(){return this._defaultStroke}set defaultStroke(t){this._defaultStroke=t}get disableFill(){return this._disableFill}set disableFill(t){this._disableFill=t}get checkedFill(){return this._checkedFill}set checkedFill(t){this._checkedFill=t}get checkedStroke(){return this._checkedStroke}set checkedStroke(t){this._checkedStroke=t}get disableCheckedFill(){return this._disableCheckedFill}set disableCheckedFill(t){this._disableCheckedFill=t}get disableCheckedStroke(){return this._disableCheckedStroke}set disableCheckedStroke(t){this._disableCheckedStroke=t}get checkIconImage(){return this._checkIconImage}set checkIconImage(t){this._checkIconImage=t}get indeterminateIconImage(){return this._indeterminateIconImage}set indeterminateIconImage(t){this._indeterminateIconImage=t}getStyle(t){return new TT(t,this)}clone(){return new TT(this)}}function kT(t,e,i,o,n,r){var s;return t||e?t instanceof _T?t:"function"==typeof t?kT(t(i),e,i,o,n,r):(t||(t={}),n&&!Q(t.autoWrapText)&&(t.autoWrapText=!0),o===TT?new TT(null!=t?t:{},null!=e?e:{},null!==(s=r.checkboxStyle)&&void 0!==s?s:{}):new o(null!=t?t:{},null!=e?e:{})):o.DEFAULT}class LT{constructor(t){this._table=t;const e=FS();this.freezeIcon=e[UC.freezeIconName],this.frozenIcon=e[UC.frozenIconName],this.frozenCurrentIcon=e[UC.frozenCurrentIconName],this.normalIcon=e[UC.normalIconName],this.upIcon=e[UC.upwardIconName],this.downIcon=e[UC.downwardIconName],this.dropDownAbsoluteIcon=e[UC.dropdownIconName],this.expandIcon=e[UC.expandIconName],this.collapseIcon=e[UC.collapseIconName]}getIcons(t,e){const i=[];if(this._table.isPivotTable()){const{showSort:o,sort:n}=this._table.internalProps.layoutMap.getHeader(t,e);if(o){let o=this._table.getPivotSortState(t,e);o&&(o=o.toUpperCase());const n="ASC"===o?this.upIcon:"DESC"===o?this.downIcon:this.normalIcon;n&&i.push(n)}else if(n){const o=this.getSortIconForPivotTable(this._table.getPivotSortState(t,e),this._table,t,e);o&&i.push(o)}}else{const o=this._table.sortState;let n;n=void 0;const r=this._table.getCellRange(t,e);if(o)if(Array.isArray(o))for(let t=0;t<o.length;t++){const e=o[t],i=this._table._getHeaderCellBySortState(e);if(i&&Ow(r,i.col,i.row)){({order:n}=e);break}}else{const t=this._table._getHeaderCellBySortState(o);t&&Ow(r,t.col,t.row)&&({order:n}=o)}const s=this.getSortIcon(n,this._table,t,e);s&&i.push(s)}if(this._table.showFrozenIcon&&t<this._table.allowFrozenColCount){const o=this.getFrozenIcon(t,e);o&&i.push(o)}if(this.checkDropDownIcon(this._table,t,e)){const t=this.dropDownAbsoluteIcon;i.push(t)}const o=this.getDropDownStateIcons(this._table,t,e);o.length&&i.push(...o);const{headerIcon:n}=this._table._getHeaderLayoutMap(t,e),r=this.getHierarchyIcon(t,e);if(r&&i.push(r),n){let o;o="function"==typeof n?n({col:t,row:e,value:this._table.getCellValue(t,e),dataValue:this._table.getCellOriginValue(t,e),table:this._table}):n;const r=FS(),s=t=>{let e;e="string"==typeof t?r[t]:t,e&&i.push(e)};Array.isArray(o)?o.forEach(((t,e)=>{s(t)})):s(o)}return i}getFrozenIcon(t,e){if(this._table.isPivotTable()||this._table.transpose)return null;if(this._table.rightFrozenColCount&&t>=this._table.colCount-this._table.rightFrozenColCount)return null;const i=this._table.getHeaderDefine(t,e);if(i.columns&&i.columns.length>0)return null;let o=this.freezeIcon;return this._table.options.frozenColCount-1>t?o=this.frozenIcon:this._table.options.frozenColCount-1===t&&(o=this.frozenCurrentIcon),o}getSortIcon(t,e,i,o){const n="asc"===t?this.upIcon:"desc"===t?this.downIcon:this.normalIcon,r=e.getHeaderDefine(i,o);return!r||!1===r.showSort||!Q(r.showSort)&&!r.sort||r.columns&&r.columns.length>0?null:n}getSortIconForPivotTable(t,e,i,o){const n=e.getHeaderDefine(i,o);return!n||!1===n.showSort||!Q(n.showSort)&&!n.sort||n.columns&&n.columns.length>0?null:"ASC"===(null==t?void 0:t.toUpperCase())?this.upIcon:"DESC"===(null==t?void 0:t.toUpperCase())?this.downIcon:this.normalIcon}getDropDownStateIcons(t,e,i){var o,n,r;const s=t.getHeaderDefine(e,i),l=t._getHeaderLayoutMap(e,i),{dropDownMenu:a}=l,h=[];if(Array.isArray(a)&&a.length||Array.isArray(t.globalDropDownMenu)&&t.globalDropDownMenu.length&&!(null===(o=null==s?void 0:s.columns)||void 0===o?void 0:o.length)){const o=a||t.globalDropDownMenu;let s=-1,l=-1;for(let a=0;a<o.length;a++){const h=o[a];if("object"==typeof h&&h.children&&h.children.length)for(let o=0;o<h.children.length;o++){const d=h.children[o];if((null===(n=t.stateManager.menu)||void 0===n?void 0:n.dropDownMenuHighlight)&&bT(t,null===(r=t.stateManager.menu)||void 0===r?void 0:r.dropDownMenuHighlight,"object"==typeof d?null==d?void 0:d.menuKey:d,e,i)){s=a,l=o;break}}if(t._dropDownMenuIsHighlight(e,i,a)){s=a;break}}if(-1!==s){let e;e=-1!==l?(a||t.globalDropDownMenu)[s].children[l]:(a||t.globalDropDownMenu)[s],e.stateIcon&&(e.stateIcon.svg?h.push({type:"svg",name:e.stateIcon.src||e.stateIcon.svg,width:e.stateIcon.width||22,height:e.stateIcon.height||22,svg:e.stateIcon.svg,positionType:jC.right,marginRight:0,funcType:VC.dropDownState,interactive:!1}):e.stateIcon.src&&h.push({type:"image",name:e.stateIcon.src||e.stateIcon.svg,width:e.stateIcon.width||22,height:e.stateIcon.height||22,src:e.stateIcon.src,positionType:jC.right,marginRight:0,funcType:VC.dropDownState,interactive:!1}))}}return h}getDropDownIconRect(t,e,i){var o,n,r,s,l,a,h,d;const c=null!==(s=null!==(n=null===(o=this.downIcon.hover)||void 0===o?void 0:o.width)&&void 0!==n?n:null===(r=this.downIcon)||void 0===r?void 0:r.width)&&void 0!==s?s:0,u=null!==(d=null!==(a=null===(l=this.downIcon.hover)||void 0===l?void 0:l.height)&&void 0!==a?a:null===(h=this.downIcon)||void 0===h?void 0:h.height)&&void 0!==d?d:0,g=t.right-2-c,p=t.right-2;let f;return f="middle"===i?t.top+t.height/2-c/2:"top"===i?t.top+e/2:"bottom"===i?t.bottom-2*e:t.top,{left:g,right:p,top:f,bottom:u+f,width:c,height:u}}getHierarchyIcon(t,e){const{hierarchyState:i}=this._table._getHeaderLayoutMap(t,e);if(i){if(i===WC.expand)return this.expandIcon;if(i===WC.collapse)return this.collapseIcon}}getHierarchyIconWidth(){var t,e;return this.expandIcon.width+(null!==(t=this.expandIcon.marginLeft)&&void 0!==t?t:0)+(null!==(e=this.expandIcon.marginRight)&&void 0!==e?e:0)}checkDropDownIcon(t,e,i){var o;if(t.isPivotTable()){const o=t._getHeaderLayoutMap(e,i);if(Array.isArray(o.dropDownMenu)&&o.dropDownMenu.length)return!0}else{const n=t.getHeaderDefine(e,i);if(Array.isArray(n.dropDownMenu)&&n.dropDownMenu.length||(!Array.isArray(n.dropDownMenu)||0!==n.dropDownMenu.length)&&Array.isArray(t.globalDropDownMenu)&&t.globalDropDownMenu.length&&!(null===(o=null==n?void 0:n.columns)||void 0===o?void 0:o.length))return!0}return!1}getStyleClass(t){switch(t){case"text":case"link":return MT;case"image":case"video":return RT;case"checkbox":return TT}}setTableColumnsEditor(){const t=(e,i)=>{null==e||e.forEach(((e,o)=>{e.editor&&(i[o].editor=e.editor),e.columns&&t(e.columns,i[o].columns)}))};t(this._table.options.columns,this._table.internalProps.columns)}}class PT extends EventTarget{constructor(t,e){if(super(),this._table=t,"node"===sw.mode)return;const i=document.createElement("div");i.style.opacity="0",i.dataset.vtable="vtable",i.style.pointerEvents="none",i.classList.add("input-container");const o=this._input=document.createElement("input");i.appendChild(o),o.classList.add("table-focus-control"),o.dataset.vtable="vtable",o.readOnly=!0,e.appendChild(i),this._container=i}focus(){this._input.focus({preventScroll:!0})}setFocusRect(t,e){const i=this._input;i.value=e,i.select();const o=t.top-this._table.scrollTop,n=t.left-this._table.scrollLeft;i.style.top=`${o.toFixed()}px`,i.style.left=`${n.toFixed()}px`,i.style.width=`${t.width.toFixed()}px`,i.style.height=`${t.height.toFixed()}px`}get input(){return this._input}release(){var t;null===(t=this._container.parentElement)||void 0===t||t.removeChild(this._container)}}class ET{constructor(t){this.isUpdate=!1,this._keys=[],this._sorted=!1,this.data=new Map,this._keys.length=0,this.cumulativeSum=new Map,this.difference=new Map,this.totalSum=0,this.table=t}get length(){return this.data.size}clear(){this._keys=[],this.data.clear(),this.cumulativeSum.clear(),this.difference.clear(),this.totalSum=0}clearRange(){this.cumulativeSum.clear(),this.difference.clear()}add(t,e){if(!Q(e))return;const i=this.table.getRowHeight(t);this.data.has(t)||(this._keys.push(t),this._sorted=!1),this.data.set(t,e),this.totalSum+=e,this.updateDifference(t,e-i)}remove(t){if(this.data.has(t)){const e=this.data.get(t);this.data.delete(t);const i=this._keys.indexOf(t);-1!==i&&this._keys.splice(i,1),this.totalSum-=e;const o=this.table.getRowHeight(t);this.updateDifference(t,o-e)}}put(t,e){if(Q(e))if(this.data.has(t)){const i=this.data.get(t);if(i===e)return;this.data.set(t,e);const o=e-i;this.totalSum+=o,this.updateDifference(t,o)}else this.add(t,e)}get(t){return this.data.get(t)}has(t){return this.data.has(t)}_sort(){const{_keys:t}=this;this._sorted||(t.sort(((t,e)=>t<e?-1:t>e?1:0)),this._sorted=!0)}updateDifference(t,e){var i;const o=null!==(i=this.difference.get(t))&&void 0!==i?i:0;this.difference.set(t,o+e),this.update()}getSumInRange(t,e){return this.calculatePrefixSum(e)-this.calculatePrefixSum(t-1)}updateCumulativeSum(t,e){for(const[i,o]of this.cumulativeSum)i>=t&&this.cumulativeSum.set(i,o+e)}calculatePrefixSum(t){if(t<0)return 0;if(this.cumulativeSum.has(t)){let e=this.cumulativeSum.get(t);for(const[i,o]of this.difference)i<=t&&(e+=o);return e}return this.dealDiffenence(),this.getCumulativeSum(t)}getCumulativeSum(t){var e;let i=0;for(let o=t;o>=0;o--){if(this.cumulativeSum.has(o)){i+=this.cumulativeSum.get(o);break}i+=null!==(e=this.data.get(o))&&void 0!==e?e:this.table.getRowHeight(o)}return this.cumulativeSum.set(t,i),i}update(){this.isUpdate||(this.isUpdate=!0,setTimeout((()=>{this.dealDiffenence(),this.isUpdate=!1}),0))}dealDiffenence(){for(const[t]of this.cumulativeSum)for(const[e,i]of this.difference)if(t>=e){const e=this.cumulativeSum.get(t);this.cumulativeSum.set(t,e+i)}this.difference.clear()}insert(t,e){for(let e=t;e<=this.getLastIndex();e++)this.cumulativeSum.delete(e);const i=this.getLastIndex()+1;this.adjustOrder(t,t+1,i-t),Q(e)&&this.put(t,e)}getLastIndex(){return this._sort(),this._keys[this._keys.length-1]}delLast(){const t=this.getLastIndex();this.remove(t)}delete(t){if(!this.has(t))return;for(let e=t;e<=this.getLastIndex();e++)this.cumulativeSum.delete(e);const e=this.getLastIndex();this.adjustOrder(t+1,t,e-t),this.delLast()}adjustOrder(t,e,i){this.clearRange(),this._sort();const{_keys:o}=this;if(t>e){const n=[];for(let r=HT(o,t+i-1);r>=0;r--){const s=o[r];if(s>=t)n.push(this.get(s));else if(e<=s&&s<t)this.put(s+i,this.get(s));else if(s<e)break}for(let t=0;t<i;t++)this.put(e+t,n[i-1-t])}const{length:n}=o;if(t<e){const r=[];for(let s=HT(o,t);s<n;s++){const n=o[s];if(n>=t&&n<t+i)r.push(this.get(n));else if(t+i<=n&&n<=e)this.put(n-i,this.get(n));else if(n>e)break}for(let t=0;t<i;t++)this.put(e+t,r[t])}}exchangeOrder(t,e,i,o,n){const{_keys:r}=this;if(this._sorted||(r.sort(((t,e)=>t<e?-1:t>e?1:0)),this._sorted=!0),t>i){const o=[],s=[];for(let n=HT(r,i);n<t+e;n++){const i=r[n];i>=t&&i<t+e?s.push(this.get(i)):o.push(this.get(i))}for(let t=0;t<e;t++)this.put(n+t,s[t]);for(let t=0;t<o.length;t++)this.put(n+e+t,o[t])}else{const s=[],l=[];for(let n=HT(r,t);n<i+o;n++){const i=r[n];i>=t&&i<t+e?l.push(this.get(i)):s.push(this.get(i))}for(let t=0;t<e;t++)this.put(n+t,l[t]);for(let e=0;e<s.length;e++)this.put(t+e,s[e])}}}function HT(t,e){let i=0,o=t.length-1;for(;i<=o;){const n=Math.floor((i+o)/2);if(t[n]===e)return n;t[n]>e?o=n-1:i=n+1}return o<0?0:o}class FT{constructor(t){this._table=t;const e=FS();this.dragReorderIconName=e[UC.dragReorderIconName]}getIcons(t,e){return[this.dragReorderIconName]}}class zT{constructor(t,e,i){this.table=t,this.customCellStyle=e,this.customCellStyleArrangement=i}getCustomCellStyle(t,e){const i=this.getCustomCellStyleId(t,e);if(i){const t=this.getCustomCellStyleOption(i);return null==t?void 0:t.style}}getCustomCellStyleId(t,e){let i;return this.customCellStyleArrangement.forEach((o=>{o.cellPosition.range?o.cellPosition.range.start.col<=t&&o.cellPosition.range.end.col>=t&&o.cellPosition.range.start.row<=e&&o.cellPosition.range.end.row>=e&&(i=o.customStyleId):o.cellPosition.col===t&&o.cellPosition.row===e&&(i=o.customStyleId)})),i}getCustomCellStyleOption(t){return this.customCellStyle.find((e=>e.id===t))}registerCustomCellStyle(t,e){const i=this.customCellStyle.findIndex((e=>e.id===t));-1===i?this.customCellStyle.push({id:t,style:e}):this.customCellStyle[i]={id:t,style:e},this.customCellStyleArrangement.forEach((e=>{const i=e.cellPosition;if(e.customStyleId===t)if(i.range)for(let t=i.range.start.col;t<=i.range.end.col;t++)for(let e=i.range.start.row;e<=i.range.end.row;e++)this.table.scenegraph.updateCellContent(t,e);else this.table.scenegraph.updateCellContent(i.col,i.row)})),this.table.scenegraph.updateNextFrame()}arrangeCustomCellStyle(t,e){const i=this.customCellStyleArrangement.findIndex((e=>e.cellPosition.range&&t.range?e.cellPosition.range.start.col===t.range.start.col&&e.cellPosition.range.start.row===t.range.start.row&&e.cellPosition.range.end.col===t.range.end.col&&e.cellPosition.range.end.row===t.range.end.row:e.cellPosition.col===t.col&&e.cellPosition.row===t.row));if(-1===i)this.customCellStyleArrangement.push({cellPosition:{col:t.col,row:t.row,range:t.range},customStyleId:e});else{if(this.customCellStyleArrangement[i].customStyleId===e)return;this.customCellStyleArrangement[i].customStyleId=e}if(t.range)for(let e=t.range.start.col;e<=t.range.end.col;e++)for(let i=t.range.start.row;i<=t.range.end.row;i++)this.table.scenegraph.updateCellContent(e,i);else this.table.scenegraph.updateCellContent(t.col,t.row);this.table.scenegraph.updateNextFrame()}updateCustomCell(t,e){this.customCellStyle.length=0,this.customCellStyleArrangement.length=0,t.forEach((t=>{this.registerCustomCellStyle(t.id,t.style)})),e.forEach((t=>{this.arrangeCustomCellStyle(t.cellPosition,t.customStyleId)}))}hasCustomCellStyle(t){return this.customCellStyle.some((e=>e.id===t))}}function IT(t,e){t=t.clone();for(const i in e){const o=e[i];o&&(t[`_${i}`]=o)}return t}class OT{constructor(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"grid",o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:void 0;this.sizeIncludeParent=!1,this.tree={id:0,dimensionKey:"",value:"",children:[],level:-1,levelSpan:1,startIndex:0,size:0,startInTotal:0,hierarchyState:void 0},this.totalLevel=0,this.dimensionKeys=new Qw,this.dimensionKeysIncludeVirtual=new Qw,this.cache=new Map,this.sizeIncludeParent=null!=o,this.rowExpandLevel=o,this.hierarchyType=i,this.sharedVar=e,this.reset(t)}reset(t){this.cache.clear(),this.dimensionKeys=new Qw,this.dimensionKeysIncludeVirtual=new Qw,this.tree.children=t,this.setTreeNode(this.tree,0,this.tree)}setTreeNode(t,e,i){var o,n;t.startIndex=e,t.startInTotal=(null!==(o=i.startInTotal)&&void 0!==o?o:0)+t.startIndex,(null!==(n=t.dimensionKey)&&void 0!==n?n:t.indicatorKey)&&(t.virtual||this.dimensionKeys.contain(t.indicatorKey?dx:t.dimensionKey)||this.dimensionKeys.put(t.level,t.indicatorKey?dx:t.dimensionKey),this.dimensionKeysIncludeVirtual.contain(t.indicatorKey?dx:t.dimensionKey)||this.dimensionKeysIncludeVirtual.put(t.level,t.indicatorKey?dx:t.dimensionKey),t.id||(t.id=++this.sharedVar.seqId));let r=t.dimensionKey&&this.sizeIncludeParent?1:0;const s=t.children||t.columns;return"grid"===this.hierarchyType?(null==s?void 0:s.length)>=1?s.forEach((e=>{var i;e.level=(null!==(i=t.level)&&void 0!==i?i:0)+1,this.totalLevel=Math.max(this.totalLevel,e.level+1),r+=this.setTreeNode(e,r,t)})):r=1:t.hierarchyState===WC.expand&&(null==s?void 0:s.length)>=1?s.forEach((e=>{var i;e.level=(null!==(i=t.level)&&void 0!==i?i:0)+1,this.totalLevel=Math.max(this.totalLevel,e.level+1),r+=this.setTreeNode(e,r,t)})):t.hierarchyState===WC.collapse&&(null==s?void 0:s.length)>=1?s.forEach((e=>{var i;e.level=(null!==(i=t.level)&&void 0!==i?i:0)+1,this.totalLevel=Math.max(this.totalLevel,e.level+1),this.setTreeNode(e,r,t)})):!t.hierarchyState&&t.level+1<this.rowExpandLevel&&((null==s?void 0:s.length)>=1||!0===s)?(t.hierarchyState=WC.expand,(null==s?void 0:s.length)>=1&&s.forEach((e=>{var i;e.level=(null!==(i=t.level)&&void 0!==i?i:0)+1,this.totalLevel=Math.max(this.totalLevel,e.level+1),r+=this.setTreeNode(e,r,t)}))):(null==s?void 0:s.length)>=1||!0===s?(t.hierarchyState=WC.collapse,(null==s?void 0:s.length)>=1&&s.forEach((e=>{var i;e.level=(null!==(i=t.level)&&void 0!==i?i:0)+1,this.totalLevel=Math.max(this.totalLevel,e.level+1),this.setTreeNode(e,r,t)}))):(t.hierarchyState=WC.none,r=1),t.size=r,r}getTreePath(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:30;const i=[];return this.searchPath(t,this.tree,i,e),i.shift(),i}getTreePathByCellIds(t){const e=[];let i=this.tree.children;for(let o=0;o<t.length;o++){const n=t[o],r=this.findNodeById(i,n);if(!r)break;e.push(r),i=r.children}return e}findNodeById(t,e){return t.find((t=>t.id===e))}searchPath(t,e,i,o){if(!e)return;if(t<e.startIndex||t>=e.startIndex+e.size)return;if(i.push(e),!e.children||0===e.children.length||e.level>=o)return;const n=t-e.startIndex;if(this.cache.has(e.level+1)){const t=this.cache.get(e.level+1);if(n>=t.startIndex&&n<t.startIndex+t.size)return void this.searchPath(n,t,i,o)}let r=0,s=e.children.length-1;for(;r<=s;){const t=Math.floor((r+s)/2),l=e.children[t];if(n>=l.startIndex&&n<l.startIndex+l.size){this.cache.set(l.level,l);const t=[];this.cache.forEach(((e,i)=>{i>l.level&&t.push(i)})),t.forEach((t=>{this.cache.delete(t)})),this.searchPath(n,l,i,o);break}n<l.startIndex?s=t-1:r=t+1}}movePosition(t,e,i){let o,n,r;const s=(l,a)=>{if(void 0!==n&&void 0!==r)return;l.level===t&&(l.startInTotal===e&&(n=a),l.startInTotal<=i&&i<=l.startInTotal+l.size-1&&(r=a));const h=l.children||l.columns;if(h&&l.level<t){o=l;for(let t=0;t<h.length;t++)(e>=h[t].startInTotal&&e<=h[t].startInTotal+h[t].size||i>=h[t].startInTotal&&i<=h[t].startInTotal+h[t].size)&&s(h[t],t)}};s(this.tree,0);const l=o.children||o.columns,a=l.splice(n,1);a.unshift(r,0),Array.prototype.splice.apply(l,a)}getCopiedTree(){const t=Ct(this.tree.children);return DT(t),t}}function DT(t){for(let e=0;e<t.length;e++){const i=t[e];delete i.level,delete i.startIndex,delete i.id,delete i.levelSpan,delete i.size,delete i.startInTotal;const o=i.children||i.columns;o&&DT(o)}}function WT(t,e){const i=function(t,e){if(!t.internalProps.frozenRowCount)return null;let{scrollTop:i}=t;const o=t.internalProps.frozenRowCount;for(let n=0;n<o;n++){const o=t.getRowHeight(n),r=i+o;if(r>e)return{top:i,row:n,bottom:r,height:o};i=r}return null}(e,t);if(i)return i;let o=jT(t,e);return o||(o={top:-1,row:-1,bottom:-1,height:-1}),o}function NT(t,e){const i=function(t,e){if(!t.internalProps.frozenColCount)return null;let{scrollLeft:i}=t;const o=t.internalProps.frozenColCount;for(let n=0;n<o;n++){const o=t.getColWidth(n),r=i+o;if(r>e)return{left:i,col:n,right:r,width:o};i=r}return null}(e,t);if(i)return i;let o=GT(t,e);return o||(o={left:-1,col:-1,right:-1,width:1}),o}function GT(t,e){if(0===t)return{left:0,col:0,right:0,width:0};const i=function(t,e){if(e._colRangeWidthsMap.get("$0$"+(e.colCount-1))){let i=0,o=e.colCount-1;for(;o-i>1;){const n=Math.floor((i+o)/2);if(t<e._colRangeWidthsMap.get(`$0$${n}`))o=n;else{if(!(t>e._colRangeWidthsMap.get(`$0$${n}`)))return n;i=n}}return o}return Math.min(Math.ceil(t/e.internalProps.defaultColWidth),e.colCount-1)}(t,e),o=e.getColsWidth(0,i);return t>=o?((i,o)=>{let n=o-e.getColWidth(i);const{colCount:r}=e.internalProps;for(let o=i;o<r;o++){const i=e.getColWidth(o),r=n+i;if(Math.round(n)<=Math.round(t)&&Math.round(t)<Math.round(r))return{left:n,col:o,right:r,width:i};n=r}return null})(i,o):((i,o)=>{let n=o;for(let o=i;o>=0;o--){const i=e.getColWidth(o),r=n-i;if(Math.round(r)<=Math.round(t)&&Math.round(t)<Math.round(n))return{left:r,col:o,right:n,width:i};n=r}return null})(i,o)}function jT(t,e){if(0===t)return{top:0,row:0,bottom:0,height:0};const i=function(t,e){let i=e.internalProps.defaultRowHeight;return e._rowRangeHeightsMap.get("$0$"+(e.rowCount-1))&&(i=e._rowRangeHeightsMap.get("$0$"+(e.rowCount-1))/e.rowCount),Math.min(Math.ceil(t/i),e.rowCount-1)}(t,e),o=e.getRowsHeight(0,i);return t>=o?((i,o)=>{let n=o-e.getRowHeight(i);const{rowCount:r}=e.internalProps;for(let o=i;o<r;o++){const i=e.getRowHeight(o),r=n+i;if(Math.round(n)<=Math.round(t)&&Math.round(t)<Math.round(r))return{top:n,row:o,bottom:r,height:i};n=r}return null})(i,o):((i,o)=>{let n=o;for(let o=i;o>=0;o--){const i=e.getRowHeight(o),r=n-i;if(Math.round(r)<=Math.round(t)&&Math.round(t)<Math.round(n))return{top:r,row:o,bottom:n,height:i};n=r}return null})(i,o)}function VT(t,e,i){if(0===t)return{left:0,col:0,right:0,width:0};if(e&&t>i.tableNoFrameWidth-i.getRightFrozenColsWidth()&&t<i.tableNoFrameWidth&&t<=i.getAllColsWidth())for(let e=0;e<i.rightFrozenColCount;e++)if(t>i.tableNoFrameWidth-i.getColsWidth(i.colCount-e-1,i.colCount-1))return{col:i.colCount-e-1,left:void 0,right:void 0,width:void 0};return GT(t,i)}function UT(t,e,i){if(0===t)return{top:0,row:0,bottom:0,height:0};if(e&&t>i.tableNoFrameHeight-i.getBottomFrozenRowsHeight()&&t<i.tableNoFrameHeight)for(let e=0;e<i.rightFrozenColCount;e++)if(t>i.tableNoFrameHeight-i.getRowsHeight(i.rowCount-e-1,i.rowCount-1))return{row:i.rowCount-e-1,top:void 0,bottom:void 0,height:void 0};return jT(t,i)}function $T(t){return 2===t.length&&ht(t[0])&&ht(t[1])&&t[1]>=t[0]}function XT(t){const e=t[1]-t[0],i=t[1]*t[0]<0;let o=t[0]<=0?0-t[0]:0,n=t[1]>0?t[1]-0:0;return 0===e?t[0]<0?(o=1,n=0):t[0]>0&&(o=0,n=1):(o/=e,n/=e),{total:e,negative:o,positive:n,includeZero:i,domain:t,extendable_min:!0,extendable_max:!0}}function YT(t,e){const{positive:i,negative:o,extendable_min:n,extendable_max:r,domain:s}=t,{positive:l,negative:a,extendable_min:h,extendable_max:d,domain:c}=e;if(l>0){if(!h)return!1;let t=o/i;r&&(t=o/Math.max(i,l),s[1]=-s[0]/t),c[0]=-c[1]*t}else if(a>0){if(!d)return!1;let t=i/o;n&&(t=i/Math.max(o,o),s[0]=-s[1]/t),c[1]=-c[0]*t}return!0}function KT(t,e){const{extendable_min:i,extendable_max:o,domain:n}=t,{positive:r,negative:s,domain:l}=e;return!(0===r&&0===s||r>0&&!o||s>0&&!i||(n[0]=l[0],n[1]=l[1],0))}function qT(t,e){const{positive:i,negative:o,extendable_max:n,domain:r}=t,{positive:s,negative:l,extendable_min:a,domain:h}=e;if(n&&a){const t=Math.max(o,l)/Math.max(i,s);r[1]=-r[0]/t,h[0]=-h[1]*t}else if(a){const t=o/i;h[0]=-h[1]*t}else{if(!n)return!1;{const t=l/s;r[1]=-r[0]/t}}return!0}function ZT(t,e){const{extendable_min:i,domain:o}=t,{extendable_max:n,domain:r}=e;return!(!i||!n||(o[0]=-o[1],r[1]=-r[0],0))}function JT(t,e){const i=[t.min,t.max],o=[e.min,e.max];if(!$T(i)||!$T(o))return;const n=XT(i),r=XT(o),{positive:s,negative:l,extendable_min:a,extendable_max:h,includeZero:d}=n,{positive:c,negative:u,extendable_min:g,extendable_max:p,includeZero:f}=r;if(0===s&&0===l){if(!KT(n,r))return}else if(0===c&&0===u){if(!KT(r,n))return}else if(d||f)if(d&&!f){if(!YT(n,r))return}else if(f&&!d){if(!YT(r,n))return}else{if(l===u)return;if(l>u){if(!qT(n,r))return}else if(!qT(r,n))return}else{if(0===l&&0===c){if(!ZT(n,r))return}else if(0===u&&0===s&&!ZT(r,n))return;if(0===l&&0===u)if(0===i[0]&&o[0]>0){if(!g)return;o[0]=0}else{if(!(0===o[0]&&i[0]>0))return;if(!a)return;i[0]=0}if(0===s&&0===c)if(0===i[1]&&o[1]>0){if(!p)return;o[1]=0}else{if(!(0===o[1]&&i[1]>0))return;if(!h)return;i[1]=0}}return{range1:i,range2:o}}function QT(t,e,i){var o,n,r,s,l,a,h;if(i._table.isPivotChart())if(i.indicatorsAsCol){if(i.hasTwoIndicatorAxes&&e===i.columnHeaderLevelCount-1&&t>=i.rowHeaderLevelCount&&t<i.colCount-i.rightFrozenColCount){const o=ok("top",t,e+1,t,i.columnHeaderLevelCount-1,t,e,1,i);if(!o)return;const n=r_(DS("padding",i._table._getCellStyle(t,e+1),t,e+1,i._table)),{range:r,ticks:s,axisOption:l,isZeroAlign:a,theme:h}=o;if(a){const o=ok("bottom",t,e+1,t,i.columnHeaderLevelCount-1,t,e,0,i);if(o){const{range:t}=o,e=JT(r,t);e&&(r.min=e.range1[0],r.max=e.range1[1])}}return at(null==l?void 0:l.min)&&(r.min=l.min,r.min>0&&(l.zero=!1)),at(null==l?void 0:l.max)&&(r.max=l.max,r.max<0&&(l.zero=!1)),St({range:r},l,{orient:"top",type:(null==l?void 0:l.type)||"linear",label:{flush:!0},__ticksForVTable:s,__vtableChartTheme:h,__vtablePadding:n})}if(e===i.rowCount-i.bottomFrozenRowCount&&t>=i.rowHeaderLevelCount&&t<i.colCount-i.rightFrozenColCount){const o=i.getIndicatorKeyInChartSpec(t,e);let n=null;null==o||o.forEach((t=>{const e=i.getIndicatorInfo(t);e&&(n=e)}));const r=ok("bottom",t,e-1,t,e,t,e,0,i);if(!r)return;const s=r_(DS("padding",i._table._getCellStyle(t,e-1),t,e-1,i._table)),{range:l,ticks:a,axisOption:h,isZeroAlign:d,theme:c}=r;if(d){const o=ok("top",t,e-1,t,e,t,e,1,i);if(o){const{range:t}=o,e=JT(l,t);e&&(l.min=e.range1[0],l.max=e.range1[1])}}return at(null==h?void 0:h.min)&&(l.min=h.min,l.min>0&&(h.zero=!1)),at(null==h?void 0:h.max)&&(l.max=h.max,l.max<0&&(h.zero=!1)),St({title:{visible:!0,text:null==n?void 0:n.title},range:l},h,{orient:"bottom",type:(null==h?void 0:h.type)||"linear",label:{flush:!0},__ticksForVTable:a,__vtableChartTheme:c,__vtablePadding:s})}if(t===i.rowHeaderLevelCount-1&&e>=i.columnHeaderLevelCount&&e<i.rowCount-i.bottomFrozenRowCount){let l=i.getDimensionKeyInChartSpec(i.rowHeaderLevelCount,e);rt(l)&&(l=l[0]);const a=null!==(o=i.dataset.collectedValues[l])&&void 0!==o?o:[],h=i.getRowKeysPath(t,e),d=null!==(n=a[null!=h?h:""])&&void 0!==n?n:[],{axisOption:c,theme:u,chartType:g}=tk(t+1,e,"left",i);if(!1===(null==c?void 0:c.visible))return;const p=r_(DS("padding",i._table._getCellStyle(t+1,e),t+1,e,i._table)),f=i.getRawChartSpec(t+1,e);return St({domain:"linear"===(null==c?void 0:c.type)?void 0:Array.from(d),range:"linear"===(null==c?void 0:c.type)?d:void 0,title:{autoRotate:!0}},c,{orient:"left",type:null!==(r=null==c?void 0:c.type)&&void 0!==r?r:"band",__vtableChartTheme:u,inverse:rk(c,"horizontal"===(null!==(s=null==f?void 0:f.direction)&&void 0!==s?s:"scatter"===g?"vertical":"horizontal")),__vtablePadding:p})}}else{if(t===i.rowHeaderLevelCount-1&&e>=i.columnHeaderLevelCount&&e<i.rowCount-i.bottomFrozenRowCount){const o=i.getIndicatorKeyInChartSpec(t,e);let n=null;null==o||o.forEach((t=>{const e=i.getIndicatorInfo(t);e&&(n=e)}));const r=ok("left",t+1,e,t,e,t,e,0,i);if(!r)return;const s=r_(DS("padding",i._table._getCellStyle(t+1,e),t+1,e,i._table)),{range:l,ticks:a,axisOption:h,isZeroAlign:d,theme:c}=r;if(d){const o=ok("right",t+1,e,t,e,t,e,1,i);if(o){const{range:t}=o,e=JT(l,t);e&&(l.min=e.range1[0],l.max=e.range1[1])}}return at(null==h?void 0:h.min)&&(l.min=h.min,l.min>0&&(h.zero=!1)),at(null==h?void 0:h.max)&&(l.max=h.max,l.max<0&&(h.zero=!1)),St({title:{visible:!0,text:null==n?void 0:n.title,autoRotate:!0},range:l},h,{orient:"left",type:(null==h?void 0:h.type)||"linear",label:{flush:!0},__ticksForVTable:a,__vtableChartTheme:c,__vtablePadding:s})}if(t===i.colCount-i.rightFrozenColCount&&e>=i.columnHeaderLevelCount&&e<i.rowCount-i.bottomFrozenRowCount){const o=ok("right",t-1,e,i.rowHeaderLevelCount-1,e,t,e,1,i);if(!o)return;const n=r_(DS("padding",i._table._getCellStyle(t-1,e),t-1,e,i._table)),{range:r,ticks:s,axisOption:l,isZeroAlign:a,theme:h}=o;if(a){const o=ok("left",t-1,e,i.rowHeaderLevelCount-1,e,t,e,0,i);if(o){const{range:t}=o,e=JT(r,t);e&&(r.min=e.range1[0],r.max=e.range1[1])}}return at(null==l?void 0:l.min)&&(r.min=l.min,r.min>0&&(l.zero=!1)),at(null==l?void 0:l.max)&&(r.max=l.max,r.max<0&&(l.zero=!1)),St({range:r,title:{autoRotate:!0}},l,{orient:"right",type:(null==l?void 0:l.type)||"linear",label:{flush:!0},__ticksForVTable:s,__vtableChartTheme:h,__vtablePadding:n})}if(e===i.rowCount-i.bottomFrozenRowCount&&t>=i.rowHeaderLevelCount&&t<i.colCount-i.rightFrozenColCount){let o=i.getDimensionKeyInChartSpec(t,i.columnHeaderLevelCount);rt(o)&&(o=o[0]);const n=null!==(l=i.dataset.collectedValues[o])&&void 0!==l?l:[],r=i.getColKeysPath(t,e),s=null!==(a=null==n?void 0:n[null!=r?r:""])&&void 0!==a?a:[],{axisOption:d,isPercent:c,theme:u,chartType:g}=tk(t,e-1,"bottom",i);if(!1===(null==d?void 0:d.visible))return;const p=r_(DS("padding",i._table._getCellStyle(t,e-1),t,e-1,i._table));return St({domain:"linear"===(null==d?void 0:d.type)?void 0:Array.from(s),range:"linear"===(null==d?void 0:d.type)?s:void 0},d,{orient:"bottom",type:null!==(h=null==d?void 0:d.type)&&void 0!==h?h:"band",__vtableChartTheme:u,__vtablePadding:p})}}}function tk(t,e,i,o){var n,r;const s=o.getRawChartSpec(t,e),l=null!==(n=s.axes)&&void 0!==n?n:[];if(o._table.pivotChartAxes.forEach((t=>{-1===l.findIndex((e=>t.orient===e.orient))&&l.push(t)})),s&&rt(l)){const t=l.find((t=>t.orient===i));if(t){const{seriesIndex:e,seriesId:n}=t;let l,a;return Q(n)&&rt(s.series)?l=(rt(n)?n:[n]).map((t=>{const e=s.series.findIndex((e=>e.id===t));return e>=0&&(a=s.series[e]),e})):Q(e)&&rt(s.series)&&(l=e),{axisOption:t,isPercent:s.percent,isZeroAlign:ek(s,i,o),seriesIndice:l,theme:s.theme,chartType:null!==(r=null==a?void 0:a.type)&&void 0!==r?r:s.type}}}return{axisOption:o._table.pivotChartAxes.find((t=>t.orient===i)),isPercent:!1,isZeroAlign:ek(s,i,o),theme:s.theme,chartType:s.type}}function ek(t,e,i){const o=[];let n;if("left"===e||"right"===e?o.push("left","right"):"top"!==e&&"bottom"!==e||o.push("top","bottom"),n=t&&rt(t.axes)?t.axes:i._table.pivotChartAxes,rt(n)){const t=[];n.forEach((e=>{o.includes(e.orient)&&t.push(e)}));for(let e=0;e<t.length;e++){const i=t[e];if(i.sync&&i.sync.zeroAlign&&i.sync.axisId&&t.find((t=>t.id===i.sync.axisId)))return!0}}return!1}function ik(t,e,i,o,n){var r;if(rt(n)){const r={min:1/0,max:-1/0};for(let s=0;s<n.length;s++){const l=ik(t,e,i,o,n[s]);l&&(r.min=Math.min(r.min,l.min),r.max=Math.max(r.max,l.max))}return isFinite(r.min)&&isFinite(r.max)?r:null}let s=null==e?void 0:e[n];if(rt(s)&&(s=s[0]),!s)return null;const l=t[s],a=St({},null!==(r=null==l?void 0:l[null!=o?o:""])&&void 0!==r?r:{min:0,max:1});return a.positiveMax&&a.positiveMax>a.max&&(a.max=a.positiveMax),a.negativeMin&&a.negativeMin<a.min&&(a.min=a.negativeMin),a.min===a.max&&(a.min>0?a.min=0:a.max=0),a}function ok(t,e,i,o,n,r,s,l,a){const{axisOption:h,isPercent:d,isZeroAlign:c,seriesIndice:u,theme:g,chartType:p}=tk(e,i,t,a);if(!1===(null==h?void 0:h.visible))return;const f=a.getIndicatorKeyInChartSpec(o,n);let v;v="top"===t||"bottom"===t?a.getColKeysPath(r,s):a.getRowKeysPath(r,s);const m=ik(a.dataset.collectedValues,f,c,v,null!=u?u:l);if(!m)return;d&&(m.min=m.min<0?-1:0,m.max=m.max>0?1:0);const b=Tx.getFunction("getAxisDomainRangeAndLabels"),{range:y,ticks:C}=b(m.min,m.max,h,c,"bottom"===t||"top"===t?a._table.getColWidth(r)||a._table.tableNoFrameWidth:a._table.getRowHeight(s)||a._table.tableNoFrameHeight);return m.min=isNaN(y[0])?0:y[0],m.max=isNaN(y[1])?1:y[1],at(null==h?void 0:h.min)&&(m.min=h.min,m.min>0&&(h.zero=!1)),at(null==h?void 0:h.max)&&(m.max=h.max,m.max<0&&(h.zero=!1)),{axisOption:h,isZeroAlign:c,range:m,ticks:C,theme:g,chartType:p}}var nk;function rk(t,e){let i=null==t?void 0:t.inverse;return e&&!("bottom"===(o=null==t?void 0:t.orient)||"top"===o)&&(i=!Q(null==t?void 0:t.inverse)||!(null==t?void 0:t.inverse)),i;var o}!function(t){t.vertical="vertical",t.horizontal="horizontal"}(nk||(nk={}));const sk={};class lk extends Xn{onUpdate(t,e,i){if(this.from.x!==this.to.x){const i=t?this.to.x:this.from.x+Math.floor((this.to.x-this.from.x)*e);this.params.table.scrollLeft=i}if(this.from.y!==this.to.y){const i=t?this.to.y:this.from.y+Math.floor((this.to.y-this.from.y)*e);this.params.table.scrollTop=i}}}class ak{constructor(t){this.table=t,this.timeline=new Un,this.ticker=new jn([this.timeline]),this.tempGraphic=sc({})}scrollTo(t,e){var i,o,n,s;const l={x:this.table.scrollLeft,y:this.table.scrollTop},a=this.table.getCellRect(null!==(i=t.col)&&void 0!==i?i:0,null!==(o=t.row)&&void 0!==o?o:0),h={x:at(t.col)?a.left-this.table.getFrozenColsWidth():this.table.scrollLeft,y:at(t.row)?a.top-this.table.getFrozenRowsHeight():this.table.scrollTop},d=q(e)?e?3e3:0:null!==(n=null==e?void 0:e.duration)&&void 0!==n?n:3e3,c=q(e)?e?"linear":"":null!==(s=null==e?void 0:e.easing)&&void 0!==s?s:"linear";new Kn(r.GenAutoIncrementId(),this.timeline).bind(this.tempGraphic).play(new lk(l,h,d,c,{graphic:this.tempGraphic,table:this.table})),this.ticker.start()}clear(){this.timeline.clear(),this.ticker.stop()}}const{toBoxArray:hk}=Uw,{isTouchEvent:dk}=Vw,ck=/^\$(\d+)\$(\d+)$/;!function(){if("node"===sw.mode)return;const t=document.createElement("style");t.id="vtable-style-styleSheet",t.textContent="\n.vtable .input-container {\n\tposition: absolute;\n\ttop:0px;\n}\n.vtable .table-scrollable {\n\tposition: absolute;\n\toverflow: scroll;\n}\n.vtable .table-scrollable::-webkit-scrollbar-button{\n\tbackground-color: transparent;\n}\n.vtable .table-scrollable::-webkit-scrollbar-track-piece{\n\tbackground-color: transparent;\n}\n.vtable .table-scrollable::-webkit-scrollbar-corner {\n\tbackground-color: transparent;\n}\n.vtable .table-scrollable::-webkit-scrollbar-thumb {\n\tborder-radius : 4px;\n\tbackground-color : rgba(100, 100, 100, .5);\n}\n\n.vtable .table-scroll-end-point {\n\topacity: 0;\n\tposition: relative;\n}\n.vtable {\n\t/* 设置overflow: auto 应该是为了滚动条的某个问题 但设置了auto之后 dom的下拉菜单只能显示在vtable节点中 超出会截断;现在去掉auto 暂时滚动条的问题没有发现 */\n\t/* overflow: auto; */\n\tposition: relative;\n\twidth: 100%;\n\theight: 100%;\n\ttext-align: left;\n -webkit-font-smoothing:auto;\n\n overflow: hidden; // for react-vtable dom custom element\n}\n\n.vtable-gantt {\n\t/* 设置overflow: auto 应该是为了滚动条的某个问题 但设置了auto之后 dom的下拉菜单只能显示在vtable节点中 超出会截断;现在去掉auto 暂时滚动条的问题没有发现 */\n\t/* overflow: auto; */\n\tposition: absolute;\n\twidth: 100%;\n\theight: 100%;\n\ttext-align: left;\n -webkit-font-smoothing:auto;\n\n overflow: hidden; // for react-vtable dom custom element\n}\n.vtable .table-component-container {\n pointer-events: none;\n overflow: hidden;\n position: absolute;\n top: 0px;\n left: 0px;\n}\n.vtable > canvas {\n\tposition: absolute;\n\twidth: 0;\n\theight: 0;\n}\n.vtable .table-focus-control {\n\tposition: relative !important;\n\twidth: 1px;\n\theight: 1px;\n\topacity: 0;\n\tpadding: 0;\n\tmargin: 0;\n\tbox-sizing: border-box;\n\tpointer-events: none;\n\tmax-width: 500px;\n\tmax-height: 500px;\n\tfloat: none !important;\n}\n.vtable input.table-focus-control::-ms-clear {\n\tvisibility: hidden;\n}\n.vtable input.table-focus-control.composition {\n\topacity: 1;\n\tmax-width: none;\n\tmax-height: none;\n}\n",document.head.appendChild(t)}();class uk extends YC{static get EVENT_TYPE(){return Xw}constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};var i,o,n,r,s,l,a,h,d,c;if(super(),this.showFrozenIcon=!0,this.version="1.10.3",this.id=`VTable${Date.now()}`,this.isReleased=!1,this._chartEventMap={},this.throttleInvalidate=function(t,e){let i=null;return function(){for(var o=arguments.length,n=new Array(o),r=0;r<o;r++)n[r]=arguments[r];i||(i=setTimeout((()=>{t.apply(this,n),i=null}),e))}}(this.render.bind(this),200),!t&&"node"!==e.mode&&!e.canvas)throw new Error("vtable's container is undefined");const{frozenColCount:u=0,frozenRowCount:g,defaultRowHeight:p=40,defaultHeaderRowHeight:f,defaultColWidth:v=80,defaultHeaderColWidth:m,widthMode:b="standard",heightMode:y="standard",autoFillWidth:C=!1,autoFillHeight:w=!1,widthAdaptiveMode:x="only-body",heightAdaptiveMode:_="only-body",keyboardOptions:S,eventOptions:A,rowSeriesNumber:B,columnResizeMode:R,rowResizeMode:M="none",dragHeaderMode:T,showFrozenIcon:k,allowFrozenColCount:L,padding:P,hover:E,menu:H,select:F,customRender:z,pixelRatio:I=YM,renderChartAsync:O,renderChartAsyncBatchCount:D,mode:W,modeParams:N,canvasWidth:G,canvasHeight:j,overscrollBehavior:V,limitMinWidth:U,limitMinHeight:$,clearDOM:X=!0}=e;this.container=t,this.options=e,this._widthMode=b,this._heightMode=y,this._widthAdaptiveMode=x,this._heightAdaptiveMode=_,this._autoFillWidth=C,this._autoFillHeight=w,this.customRender=z,this.padding={top:0,right:0,left:0,bottom:0},P&&("number"==typeof P?(this.padding.top=P,this.padding.left=P,this.padding.bottom=P,this.padding.right=P):(P.top&&(this.padding.top=P.top),P.bottom&&(this.padding.bottom=P.bottom),P.left&&(this.padding.left=P.left),P.right&&(this.padding.right=P.right))),Q(j)&&Q(G)&&(this.canvasSizeSeted=!0),this.tableNoFrameWidth=0,this.tableNoFrameHeight=0,this.canvasWidth=G,this.canvasHeight=j,this.columnWidthComputeMode=null!==(i=e.columnWidthComputeMode)&&void 0!==i?i:"normal";const Y=this.internalProps={};if(void 0!==k&&(this.showFrozenIcon=k),"number"==typeof L&&L<=0&&(this.showFrozenIcon=!1),this.options.canvas?(Y.element=this.options.canvas.parentElement,Y.element.style.position="relative",Y.focusControl=new PT(this,Y.element),Y.canvas=this.options.canvas,Y.context=Y.canvas.getContext("2d")):"node"!==sw.mode&&(Y.element=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"vtable";var i,o;const n=document.createElement("div");n.setAttribute("tabindex","0"),n.classList.add(e),n.style.outline="none",n.style.margin=`${t.top}px ${t.right}px ${t.bottom}px ${t.left}px`;const r=(n.offsetWidth||(null===(i=n.parentElement)||void 0===i?void 0:i.offsetWidth)||1)-1,s=(n.offsetHeight||(null===(o=n.parentElement)||void 0===o?void 0:o.offsetHeight)||1)-1;return n.style.width=r&&r-t.left-t.right+"px"||"0px",n.style.height=s&&s-t.top-t.bottom+"px"||"0px",n}(this.padding),Y.focusControl=new PT(this,Y.element),Y.canvas=document.createElement("canvas"),Y.element.appendChild(Y.canvas),Y.context=Y.canvas.getContext("2d"),(null===(o=e.customConfig)||void 0===o?void 0:o.createReactContainer)&&function(t){const{internalProps:e}=t;e.bodyDomContainer=document.createElement("div"),e.bodyDomContainer.id="vtable-body-dom-container",e.bodyDomContainer.classList.add("table-component-container"),e.element.appendChild(e.bodyDomContainer),e.headerDomContainer=document.createElement("div"),e.headerDomContainer.id="vtable-header-dom-container",e.headerDomContainer.classList.add("table-component-container"),e.element.appendChild(e.headerDomContainer),e.frozenBodyDomContainer=document.createElement("div"),e.frozenBodyDomContainer.id="vtable-frozen-body-dom-container",e.frozenBodyDomContainer.classList.add("table-component-container"),e.element.appendChild(e.frozenBodyDomContainer),e.frozenHeaderDomContainer=document.createElement("div"),e.frozenHeaderDomContainer.id="vtable-frozen-header-dom-container",e.frozenHeaderDomContainer.classList.add("table-component-container"),e.element.appendChild(e.frozenHeaderDomContainer),e.rightFrozenBodyDomContainer=document.createElement("div"),e.rightFrozenBodyDomContainer.id="vtable-right-frozen-body-dom-container",e.rightFrozenBodyDomContainer.classList.add("table-component-container"),e.element.appendChild(e.rightFrozenBodyDomContainer),e.rightFrozenHeaderDomContainer=document.createElement("div"),e.rightFrozenHeaderDomContainer.id="vtable-right-frozen-header-dom-container",e.rightFrozenHeaderDomContainer.classList.add("table-component-container"),e.element.appendChild(e.rightFrozenHeaderDomContainer),e.frozenBottomDomContainer=document.createElement("div"),e.frozenBottomDomContainer.id="vtable-frozen-bottom-dom-container",e.frozenBottomDomContainer.classList.add("table-component-container"),e.element.appendChild(e.frozenBottomDomContainer),e.bottomDomContainer=document.createElement("div"),e.bottomDomContainer.id="vtable-bottom-dom-container",e.bottomDomContainer.classList.add("table-component-container"),e.element.appendChild(e.bottomDomContainer),e.rightFrozenBottomDomContainer=document.createElement("div"),e.rightFrozenBottomDomContainer.id="vtable-right-frozen-bottom-dom-container",e.rightFrozenBottomDomContainer.classList.add("table-component-container"),e.element.appendChild(e.rightFrozenBottomDomContainer)}(this)),Y.handler=new Zw,at(this.options.resizeTime)&&(Y.handler.resizeTime=this.options.resizeTime),Y.pixelRatio=I,Y.frozenColCount=u,Y.frozenRowCount=g,Y.defaultRowHeight=p,Y.defaultHeaderRowHeight=null!=f?f:p,Y.defaultColWidth=v,Y.defaultHeaderColWidth=null!=m?m:v,Y.keyboardOptions=S,Y.eventOptions=A,Y.rowSeriesNumber=B,Y.columnResizeMode=R,Y.rowResizeMode=M,Y.dragHeaderMode=null!=T?T:"none",Y.renderChartAsync=O,vB(D),Y.overscrollBehavior=null!=V?V:"auto",Y._rowHeightsMap=new ET(this),Y._rowRangeHeightsMap=new Map,Y._colRangeWidthsMap=new Map,Y._widthResizedColMap=new Set,Y._heightResizedRowMap=new Set,this.colWidthsMap=new Qw,this.colContentWidthsMap=new Qw,this.colWidthsLimit={},Y.calcWidthContext={_:Y,get full(){var t;return"node"===sw.mode?G/(null!=I?I:1):this._.canvas.width/(null!==(t=this._.context.pixelRatio)&&void 0!==t?t:window.devicePixelRatio)}},Y.cellTextOverflows={},Y.focusedTable=!1,Y.theme=Bx.of(null!==(n=e.theme)&&void 0!==n?n:Bx.DEFAULT),Y.theme.isPivot=this.isPivotTable(),ES(Y.theme.functionalIconsStyle),t?(X&&(t.innerHTML=""),t.appendChild(Y.element),this._updateSize()):this._updateSize(),Y.bodyHelper=new iT(this),Y.headerHelper=new LT(this),Y.rowSeriesNumberHelper=new FT(this),Y.autoWrapText=e.autoWrapText,Y.enableLineBreak=e.enableLineBreak,Y.allowFrozenColCount=null!==(r=e.allowFrozenColCount)&&void 0!==r?r:0,Y.limitMaxAutoWidth=null!==(s=e.limitMaxAutoWidth)&&void 0!==s?s:450,Y.limitMinWidth=null!=U?"number"==typeof U?U:U?10:0:10,Y.limitMinHeight=null!=$?"number"==typeof $?$:$?10:0:10,this.scenegraph=new AM(this),this.stateManager=new class{constructor(t){this.fastScrolling=!1,this.checkedState=[],this.headerCheckedState={},this._checkboxCellTypeFields=[],this._headerCheckFuncs={},this.radioState={},this.resetInteractionState=Kw((t=>{this.updateInteractionState(null!=t?t:IC.default)}),100),this.table=t,this.initState(),this.updateVerticalScrollBar=this.updateVerticalScrollBar.bind(this),this.updateHorizontalScrollBar=this.updateHorizontalScrollBar.bind(this)}initState(){this._initState(),this.setHoverState(),this.setSelectState(),this.setFrozenState()}updateOptionSetState(){this._updateOptionSetState(),this.setHoverState(),this.setSelectState(),this.setFrozenState()}_updateOptionSetState(){this.interactionState=IC.default,this.hoverIcon={col:-1,row:-1,icon:null},this.columnResize={col:-1,x:0,resizing:!1},this.rowResize={row:-1,y:0,resizing:!1},this.columnMove={colSource:-1,colTarget:-1,rowSource:-1,rowTarget:-1,x:0,y:0,moving:!1},this.menu={x:-1,y:-1,isShow:!1,itemList:[],bounds:new ze,highlightIndex:-1,dropDownMenuHighlight:[]},this.sort=[{col:-1,row:-1,order:"normal"}],this.frozen={col:-1},this.tablePosition={absoluteX:0,absoluteY:0},this.drill={col:-1,row:-1},this.sparkLine={col:-1,row:-1}}_initState(){this.interactionState=IC.default,this.select={highlightScope:OC.single,ranges:[],cellPos:{col:-1,row:-1},selecting:!1},this.fillHandle={isFilling:!1,startX:void 0,startY:void 0},this.hover={highlightScope:OC.single,cellPos:{col:-1,row:-1}},this.hoverIcon={col:-1,row:-1,icon:null},this.columnResize={col:-1,x:0,resizing:!1},this.rowResize={row:-1,y:0,resizing:!1},this.columnMove={colSource:-1,colTarget:-1,rowSource:-1,rowTarget:-1,x:0,y:0,moving:!1},this.menu={x:-1,y:-1,isShow:!1,itemList:[],bounds:new ze,highlightIndex:-1,dropDownMenuHighlight:[]},this.sort=[{col:-1,row:-1,order:"normal"}],this.frozen={col:-1},this.scroll={horizontalBarPos:0,verticalBarPos:0},this.tablePosition={absoluteX:0,absoluteY:0},this.drill={col:-1,row:-1},this.sparkLine={col:-1,row:-1}}setHoverState(){var t;const{highlightMode:e,disableHover:i,disableHeaderHover:o}=null!==(t=this.table.options.hover)&&void 0!==t?t:{highlightMode:"cell"};i?this.hover.highlightScope=OC.none:"cross"===e?this.hover.highlightScope=OC.cross:"row"===e?this.hover.highlightScope=OC.row:"column"===e?this.hover.highlightScope=OC.column:"cell"===e&&(this.hover.highlightScope=OC.single),this.hover.singleStyle=!i,this.hover.disableHeader=o,(this.hover.highlightScope===OC.none||o)&&(this.hover.cellPosContainHeader={col:-1,row:-1})}setSelectState(){const{headerSelectMode:t,disableSelect:e,disableHeaderSelect:i,highlightMode:o}=Object.assign({},{headerSelectMode:"inline",disableSelect:!1,disableHeaderSelect:!1,highlightMode:"cell"},this.table.options.select);this.select.highlightScope=e?OC.none:"cross"===o?OC.cross:"row"===o?OC.row:"column"===o?OC.column:OC.single,this.select.singleStyle=!e,this.select.disableHeader=i,this.select.headerSelectMode=t}isSelected(t,e){let i=!1;return this.select.ranges.forEach((o=>{Ow(o,t,e)&&(i=!0)})),i}setSortState(t){const e=this,i=(t=!t||Array.isArray(t)?t:[t])&&t.reduce(((t,i)=>{var o,n,r;const s=null===(o=function(t){const i=[];return function t(o){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;o.forEach((o=>{var r;const s=o.startInTotal?null!==(r=o.startInTotal+e.table.internalProps.layoutMap.leftRowSeriesNumberColumnCount)&&void 0!==r?r:0:n;o.columns?t(o.columns,s):i.push(Object.assign(Object.assign({},o),{startIndex:s}))}))}(t),i}(this.table.internalProps.columns))||void 0===o?void 0:o.find((t=>(null==t?void 0:t.field)===(null==i?void 0:i.field)));return this.table.internalProps.transpose?t.push({field:i.field,order:i.order,row:null!==(n=s.startInTotal+this.table.internalProps.layoutMap.leftRowSeriesNumberColumnCount)&&void 0!==n?n:0,col:s.level}):t.push({field:i.field,order:i.order,col:null!==(r=s.startInTotal+this.table.internalProps.layoutMap.leftRowSeriesNumberColumnCount)&&void 0!==r?r:0,row:s.level}),t}),[]);this.sort=i||[]}setFrozenState(){this.frozen.col=this.table.frozenColCount-1}updateInteractionState(t){if(this.interactionState===t)return;t===IC.scrolling&&(this.interactionStateBeforeScroll=this.interactionState);const e=this.interactionState;this.interactionState=t,e===IC.scrolling&&IC.default}updateHoverhighlightScope(t){this.hover.highlightScope!==t&&(this.hover.highlightScope=t)}updateHoverPos(t,e){LM(this,t,e)}updateSelectPos(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=arguments.length>3&&void 0!==arguments[3]&&arguments[3],n=arguments.length>4&&void 0!==arguments[4]&&arguments[4],r=arguments.length>5&&void 0!==arguments[5]&&arguments[5],s=arguments.length>6&&void 0!==arguments[6]&&arguments[6];-1!==e&&-1!==e&&(this.select.selecting=!0),function(t,e,i,o,n,r){let s=arguments.length>6&&void 0!==arguments[6]&&arguments[6],l=arguments.length>7&&void 0!==arguments[7]&&arguments[7];var a,h;const{table:d,interactionState:c}=t,{scenegraph:u}=d,{highlightScope:g,disableHeader:p,cellPos:f}=t.select;if((p&&d.isHeader(e,i)||"none"===g)&&(-1===e||-1===i||s||d._makeVisibleCell(e,i),e=-1,i=-1),-1!==e&&-1!==i&&!s)if(c===IC.grabing&&t.select.ranges.length>0){const o=t.select.ranges[t.select.ranges.length-1];e>o.start.col&&e>o.end.col&&d._makeVisibleCell(e+1,i),i>o.start.row&&i>o.end.row&&d._makeVisibleCell(e,i+1),e<o.start.col&&e<o.end.col&&d._makeVisibleCell(e-1,i),i<o.start.row&&i<o.end.row&&d._makeVisibleCell(e,i-1)}else d._makeVisibleCell(e,i);if(r){t.select.ranges=[],u.deleteAllSelectBorder();let e=0,i=0;const{disableHeaderSelect:o,disableRowSeriesNumberSelect:n}=(null===(a=d.options.keyboardOptions)||void 0===a?void 0:a.selectAllOnCtrlA)||{};o&&(e=d.rowHeaderLevelCount,i=d.columnHeaderLevelCount),(n||o&&d.transpose)&&d.options.rowSeriesNumber&&(e+=1),t.select.ranges.push({start:{col:e,row:i},end:{col:d.colCount-1,row:d.rowCount-1}});const r=t.select.ranges[t.select.ranges.length-1];u.updateCellSelectBorder(r,!1)}else if(-1===f.col||-1===f.row||-1!==e&&-1!==i)if(c!==IC.default||d.eventManager.isDraging||d.stateManager.isResizeCol()){if((c===IC.grabing||d.eventManager.isDraging)&&!d.stateManager.isResizeCol()){let o=!0;-1===f.col&&(f.col=e),-1===f.row&&(f.row=i),f.col=e,f.row=i;const n=t.select.ranges[t.select.ranges.length-1];if(n){if(d.internalProps.layoutMap.isSeriesNumberInBody(n.start.col,n.start.row))o=!1,n.end={col:d.colCount-1,row:i};else if(t.fillHandle.isFilling){if("top"===t.fillHandle.direction)if(i===t.fillHandle.beforeFillMinRow&&i===t.fillHandle.beforeFillMaxRow)n.start.row=n.end.row=i;else if(i<=t.fillHandle.beforeFillMinRow){if(n.start.row<n.end.row){const t=n.start.row;n.start.row=n.end.row,n.end.row=t}n.end.row=i}else i===t.fillHandle.beforeFillMaxRow&&(n.start.row>n.end.row?n.start.row=i:n.end.row=i);else if("bottom"===t.fillHandle.direction){if(i>=t.fillHandle.beforeFillMaxRow){if(n.start.row>n.end.row){const t=n.start.row;n.start.row=n.end.row,n.end.row=t}n.end.row=i}}else if("left"===t.fillHandle.direction)if(e===t.fillHandle.beforeFillMinCol&&e===t.fillHandle.beforeFillMaxCol)n.start.col=n.end.col=e;else if(e<=t.fillHandle.beforeFillMinCol){if(n.start.col<n.end.col){const t=n.start.col;n.start.col=n.end.col,n.end.col=t}n.end.col=e}else e===t.fillHandle.beforeFillMaxCol&&(n.start.col>n.end.col?n.start.col=e:n.end.col=e);else if("right"===t.fillHandle.direction&&e>=t.fillHandle.beforeFillMaxCol){if(n.start.col>n.end.col){const t=n.start.col;n.start.col=n.end.col,n.end.col=t}n.end.col=e}}else{n.end={col:e,row:i};const o=l?{start:{col:e,row:i},end:{col:e,row:i}}:d.getCellRange(e,i);n.start.col<o.end.col?n.end.col=o.end.col:n.start.col>o.start.col&&(n.end.col=o.start.col),n.start.row<o.end.row?n.end.row=o.end.row:n.start.row>o.start.row&&(n.end.row=o.start.row),"body"===t.select.headerSelectMode&&(d.isRowHeader(e,i)?(n.start.col=d.rowHeaderLevelCount+d.leftRowSeriesNumberCount,n.end.col=d.colCount-1):d.isColumnHeader(e,i)?(n.start.row=d.columnHeaderLevelCount,n.end.row=d.rowCount-1):d.internalProps.layoutMap.isSeriesNumberInBody(e,i)?(n.start.col=d.leftRowSeriesNumberCount,n.end.col=d.colCount-1):d.isCornerHeader(e,i)?(n.start.col=d.rowHeaderLevelCount+d.leftRowSeriesNumberCount,n.start.row=d.columnHeaderLevelCount,n.end.col=d.colCount-1,n.end.row=d.rowCount-1):d.isSeriesNumber(e,i)&&(n.start.col=d.leftRowSeriesNumberCount,n.start.row=d.columnHeaderLevelCount,n.end.col=d.colCount-1,n.end.row=d.rowCount-1)),l&&(n.skipBodyMerge=!0)}u.updateCellSelectBorder(n,o)}}}else{const r=t.select.ranges[t.select.ranges.length-1];if(o&&r){if(n||(f.col=e,f.row=i),"cell"!==t.select.headerSelectMode&&d.isColumnHeader(e,i)){const o=Math.min(r.start.col,r.end.col,e),n=Math.max(r.start.col,r.end.col,e),s=Math.min(r.start.row,r.end.row,i),l=d.rowCount-1;"body"===t.select.headerSelectMode?(r.start={col:o,row:d.columnHeaderLevelCount},r.end={col:n,row:d.rowCount-1}):(r.start={col:o,row:s},r.end={col:n,row:l})}else if("cell"!==t.select.headerSelectMode&&d.isRowHeader(e,i)){const o=Math.min(r.start.col,r.end.col,e),n=d.colCount-1,s=Math.min(r.start.row,r.end.row,i),l=Math.max(r.start.row,r.end.row,i);"body"===t.select.headerSelectMode?(r.start={col:d.leftRowSeriesNumberCount+d.rowHeaderLevelCount,row:s},r.end={col:d.colCount-1,row:l}):(r.start={col:o,row:s},r.end={col:n,row:l})}else if("cell"!==t.select.headerSelectMode&&d.isSeriesNumberInBody(e,i)){const o=Math.min(r.start.col,r.end.col,e),n=d.colCount-1,s=Math.min(r.start.row,r.end.row,i),l=Math.max(r.start.row,r.end.row,i);"body"===t.select.headerSelectMode?(r.start={col:d.leftRowSeriesNumberCount,row:s},r.end={col:d.colCount-1,row:l}):(r.start={col:o,row:s},r.end={col:n,row:l})}else r.end={col:e,row:i};u.deleteLastSelectedRangeComponents(),u.updateCellSelectBorder(r)}else{let o=!0;if(-1===f.col||-1===f.row||n||(t.select.ranges=[],u.deleteAllSelectBorder()),"cell"!==t.select.headerSelectMode&&d.isColumnHeader(e,i)){const o=d.getCellRange(e,i);"body"===t.select.headerSelectMode?t.select.ranges.push({start:{col:o.start.col,row:d.columnHeaderLevelCount},end:{col:o.end.col,row:d.rowCount-1},skipBodyMerge:!0}):t.select.ranges.push({start:{col:o.start.col,row:i},end:{col:o.end.col,row:d.rowCount-1},skipBodyMerge:!0})}else if("cell"!==t.select.headerSelectMode&&d.isRowHeader(e,i)){const o=d.getCellRange(e,i);"body"===t.select.headerSelectMode?t.select.ranges.push({start:{col:d.rowHeaderLevelCount+d.leftRowSeriesNumberCount,row:o.start.row},end:{col:d.colCount-1,row:o.end.row},skipBodyMerge:!0}):t.select.ranges.push({start:{col:e,row:o.start.row},end:{col:d.colCount-1,row:o.end.row},skipBodyMerge:!0})}else if(d.internalProps.layoutMap.isSeriesNumberInHeader(e,i))o=!1,"body"===t.select.headerSelectMode?t.select.ranges.push({start:{col:d.leftRowSeriesNumberCount,row:d.columnHeaderLevelCount},end:{col:d.colCount-1,row:d.rowCount-1},skipBodyMerge:!0}):t.select.ranges.push({start:{col:0,row:0},end:{col:d.colCount-1,row:d.rowCount-1},skipBodyMerge:!0});else if(d.internalProps.layoutMap.isSeriesNumberInBody(e,i))o=!1,"body"===t.select.headerSelectMode?t.select.ranges.push({start:{col:d.leftRowSeriesNumberCount,row:i},end:{col:d.colCount-1,row:i},skipBodyMerge:!0}):t.select.ranges.push({start:{col:e,row:i},end:{col:d.colCount-1,row:i},skipBodyMerge:!0});else if(d.internalProps.layoutMap.isCornerHeader(e,i))o=!1,"body"===t.select.headerSelectMode?t.select.ranges.push({start:{col:d.rowHeaderLevelCount+d.leftRowSeriesNumberCount,row:d.columnHeaderLevelCount},end:{col:d.colCount-1,row:d.rowCount-1},skipBodyMerge:!0}):t.select.ranges.push({start:{col:d.leftRowSeriesNumberCount,row:0},end:{col:d.colCount-1,row:d.rowCount-1},skipBodyMerge:!0});else if(e>=0&&i>=0){const o=l?{start:{col:e,row:i},end:{col:e,row:i}}:d.getCellRange(e,i);t.select.ranges.push({start:{col:o.start.col,row:o.start.row},end:{col:o.end.col,row:o.end.row},skipBodyMerge:l||void 0})}f.col=e,f.row=i;const r=null===(h=t.select.ranges)||void 0===h?void 0:h[t.select.ranges.length-1];r&&u.updateCellSelectBorder(r,o)}}else f.col=-1,f.row=-1,t.select.ranges=[],u.deleteAllSelectBorder();u.updateNextFrame()}(this,t,e,i,o,n,r,s)}checkCellRangeInSelect(t,e){return function(t,e,i,o){for(let o=0;o<i.length;o++)if(Ww(i[o],{start:t,end:e}))return!0;return!1}(t,e,this.select.ranges,this.select.highlightScope)}updateHoverIcon(t,e,i,o){var n,r,s,l,a,h,d,c,u;if((null===(n=this.residentHoverIcon)||void 0===n?void 0:n.icon)&&i===(null===(r=this.residentHoverIcon)||void 0===r?void 0:r.icon))return;const g=zM(i);if(g)if("richtext-icon"===g.type){const i=g.icon;if(this.hoverIcon.icon&&this.hoverIcon.icon!==(null===(l=this.residentHoverIcon)||void 0===l?void 0:l.icon)&&(this.table.scenegraph.setIconNormalStyle(this.hoverIcon.icon,this.hoverIcon.col,this.hoverIcon.row),this.hoverIcon.col=-1,this.hoverIcon.col=-1,this.hoverIcon.icon=null,this.table.scenegraph.updateNextFrame()),i.attribute.tooltip){const o={content:i.attribute.tooltip.title,referencePosition:{rect:g.position,placement:i.attribute.tooltip.placement},style:Object.assign({},null===(a=this.table.internalProps.theme)||void 0===a?void 0:a.tooltipStyle,null===(h=i.tooltip)||void 0===h?void 0:h.style,null===(c=null===(d=i.attribute)||void 0===d?void 0:d.tooltip)||void 0===c?void 0:c.style),disappearDelay:i.attribute.tooltip.disappearDelay};this.table.internalProps.tooltipHandler.isBinded(o)||this.table.showTooltip(t,e,o)}}else{const i=g.icon;i!==this.hoverIcon.icon&&(this.hoverIcon.icon&&this.hoverIcon.icon!==(null===(u=this.residentHoverIcon)||void 0===u?void 0:u.icon)&&this.table.scenegraph.setIconNormalStyle(this.hoverIcon.icon,this.hoverIcon.col,this.hoverIcon.row),this.hoverIcon.col=t,this.hoverIcon.row=e,this.hoverIcon.icon=i,this.table.scenegraph.setIconHoverStyle(i,t,e,o),this.table.scenegraph.updateNextFrame())}else this.hoverIcon.icon&&this.hoverIcon.icon!==(null===(s=this.residentHoverIcon)||void 0===s?void 0:s.icon)&&(this.table.scenegraph.setIconNormalStyle(this.hoverIcon.icon,this.hoverIcon.col,this.hoverIcon.row),this.hoverIcon.col=-1,this.hoverIcon.col=-1,this.hoverIcon.icon=null,this.table.scenegraph.updateNextFrame())}isResizeCol(){return this.columnResize.resizing}isResizeRow(){return this.rowResize.resizing}isFillHandle(){return this.fillHandle.isFilling}isSelecting(){return this.select.selecting}endSelectCells(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(this.select.selecting){if(this.select.selecting=!1,0===this.select.ranges.length)return;const e=this.select.ranges[this.select.ranges.length-1];let i=!1;for(let t=0;t<this.select.ranges.length-1;t++){const o=this.select.ranges[t];if(o&&o.start.col===e.start.col&&o.start.row===e.start.row&&o.end.col===e.end.col&&o.end.row===e.end.row){i=!0;break}}i?(this.select.ranges.pop(),ZR(this.table.scenegraph),this.table.scenegraph.selectingRangeComponents.clear()):this.table.scenegraph.moveSelectingRangeComponentsToSelectedRangeComponents();const o=this.select.ranges[this.select.ranges.length-1].end.col,n=this.select.ranges[this.select.ranges.length-1].end.row;t&&this.table.fireListeners(Xw.SELECTED_CELL,{ranges:this.select.ranges,col:o,row:n})}else e&&0===this.select.ranges.length&&this.table.fireListeners(Xw.SELECTED_CLEAR,{})}endResizeCol(){setTimeout((()=>{this.columnResize.resizing=!1}),0),this.table.scenegraph.updateChartSizeForResizeColWidth(this.columnResize.col),this.checkFrozen(),this.table.scenegraph.component.hideResizeCol(),this.table.scenegraph.updateNextFrame()}startResizeCol(t,e,i,o){var n;this.columnResize.resizing=!0,this.columnResize.col=t,this.columnResize.x=e,this.columnResize.isRightFrozen=o,this.table.scenegraph.component.showResizeCol(t,i,o);const r=!!(null===(n=this.select.ranges)||void 0===n?void 0:n.length);this.updateSelectPos(-1,-1),this.endSelectCells(!0,r),this.table.scenegraph.updateNextFrame()}updateResizeCol(t,e){!function(t,e,i){t=Math.ceil(t),e=Math.ceil(e);let o=i.columnResize.isRightFrozen?i.columnResize.x-t:t-i.columnResize.x;if(Math.abs(o)<1)return;const n=i.table.getColWidth(i.columnResize.col);let r=n;r+=o;const s=i.table.getMinColWidth(i.columnResize.col),l=i.table.getMaxColWidth(i.columnResize.col);if(r<s||r>l){if(n===s||n===l)return;o=n-s>l-n?l-n:s-n}let a=i.table.getColWidth(i.columnResize.col)+o;if(a<i.table.internalProps.limitMinWidth&&(a=i.table.internalProps.limitMinWidth,o=a-i.table.getColWidth(i.columnResize.col)),"adaptive"===i.table.widthMode&&i.columnResize.col<i.table.colCount-1){const t=i.table.getColWidth(i.columnResize.col+1),e=i.table.getMinColWidth(i.columnResize.col+1),n=i.table.getMaxColWidth(i.columnResize.col+1);let r=t;if(r-=o,r<e||r>n){if(t===e||t===n)return;o=t-e>n-t?n-t:e-t}r-o<i.table.internalProps.limitMinWidth&&(o=r-i.table.internalProps.limitMinWidth)}o=Math.ceil(o),i.columnResize.col<i.table.rowHeaderLevelCount||i.columnResize.col>=i.table.colCount-i.table.rightFrozenColCount?IM(o,i):"indicator"===i.table.internalProps.columnResizeType?function(t,e){const i=e.table.internalProps.layoutMap;let o,n,r;if(i.indicatorsAsCol)o=i.getIndicatorKey(e.columnResize.col,e.table.columnHeaderLevelCount);else{const t=i.getCellHeaderPaths(e.columnResize.col,e.table.columnHeaderLevelCount-1),o=t.colHeaderPaths[t.colHeaderPaths.length-1];n=o.dimensionKey,r=o.value}for(let s=e.table.rowHeaderLevelCount;s<e.table.colCount-e.table.rightFrozenColCount;s++){const l=i.getIndicatorKey(s,e.table.columnHeaderLevelCount);if(i.indicatorsAsCol&&l===o)e.table.scenegraph.updateColWidth(s,t),e.table.internalProps._widthResizedColMap.add(s);else if(!i.indicatorsAsCol){const o=i.getCellHeaderPaths(s,e.table.columnHeaderLevelCount-1),l=null==o?void 0:o.colHeaderPaths[o.colHeaderPaths.length-1];l&&n===l.dimensionKey&&r===l.value&&(e.table.scenegraph.updateColWidth(s,t),e.table.internalProps._widthResizedColMap.add(s))}}}(o,i):"indicatorGroup"===i.table.internalProps.columnResizeType?function(t,e){const i=e.table.internalProps.layoutMap,o=i.getCellHeaderPaths(e.columnResize.col,e.table.columnHeaderLevelCount),n=i.getHeadNodeByRowOrColDimensions(o.colHeaderPaths.slice(0,o.colHeaderPaths.length-1)),r=n.startInTotal+e.table.frozenColCount,s=n.startInTotal+e.table.frozenColCount+n.size-1,l=e.table.getColsWidth(r,s),a=t;for(let t=r;t<=s;t++){if(!(e.table.internalProps.transpose||e.table.isPivotTable()&&!i.indicatorsAsCol)){const o=i.getBody(t,e.table.columnHeaderLevelCount);if(null==o?void 0:o.disableColumnResize)continue}let o=e.table.getColWidth(t)/l*a;o>0&&o<.5?o=.5:o<0&&o>=-.5&&(o=-.5),e.table.scenegraph.updateColWidth(t,o),e.table.internalProps._widthResizedColMap.add(t)}}(o,i):"all"===i.table.internalProps.columnResizeType?function(t,e){const i=e.table.internalProps.layoutMap;for(let o=e.table.frozenColCount;o<e.table.colCount-e.table.rightFrozenColCount;o++){if(!(e.table.internalProps.transpose||e.table.isPivotTable()&&!i.indicatorsAsCol)){const t=i.getBody(o,e.table.columnHeaderLevelCount);if(null==t?void 0:t.disableColumnResize)continue}e.table.scenegraph.updateColWidth(o,t),e.table.internalProps._widthResizedColMap.add(o)}}(o,i):IM(o,i),i.columnResize.x=t,i.table.scenegraph.component.updateResizeCol(i.columnResize.col,e,i.columnResize.isRightFrozen),i.columnResize.col<i.table.frozenColCount&&!i.table.isPivotTable()&&!i.table.transpose?i.table.scenegraph.component.setFrozenColumnShadow(i.table.frozenColCount-1,i.columnResize.isRightFrozen):i.table.options.frozenColCount&&i.table.scenegraph.component.setFrozenColumnShadow(i.table.frozenColCount-1),(i.columnResize.col>=i.table.colCount-i.table.rightFrozenColCount&&!i.table.isPivotTable()&&!i.table.transpose||i.table.options.rightFrozenColCount)&&i.table.scenegraph.component.setRightFrozenColumnShadow(i.table.colCount-i.table.rightFrozenColCount),i.table.scenegraph.updateNextFrame()}(t,e,this)}endResizeRow(){setTimeout((()=>{this.rowResize.resizing=!1}),0),this.table.scenegraph.updateChartSizeForResizeRowHeight(this.rowResize.row),this.table.scenegraph.component.hideResizeRow(),this.table.scenegraph.updateNextFrame()}startResizeRow(t,e,i,o){var n;this.rowResize.resizing=!0,this.rowResize.row=t,this.rowResize.y=i,this.rowResize.isBottomFrozen=o,this.table.scenegraph.component.showResizeRow(t,e,o);const r=!!(null===(n=this.select.ranges)||void 0===n?void 0:n.length);this.updateSelectPos(-1,-1),this.endSelectCells(!0,r),this.table.scenegraph.updateNextFrame()}updateResizeRow(t,e){!function(t,e,i){t=Math.ceil(t),e=Math.ceil(e);let o=i.rowResize.isBottomFrozen?i.rowResize.y-e:e-i.rowResize.y;if(Math.abs(o)<1)return;i.table.getRowHeight(i.rowResize.row);let n=i.table.getRowHeight(i.rowResize.row)+o;if(n<i.table.internalProps.limitMinHeight&&(n=i.table.internalProps.limitMinHeight,o=n-i.table.getRowHeight(i.rowResize.row)),"adaptive"===i.table.heightMode&&i.rowResize.row<i.table.rowCount-1){let t=i.table.getRowHeight(i.rowResize.row+1);t-=o,t-o<i.table.internalProps.limitMinHeight&&(o=t-i.table.internalProps.limitMinHeight)}o=Math.ceil(o),i.rowResize.row<i.table.columnHeaderLevelCount||i.rowResize.row>=i.table.rowCount-i.table.bottomFrozenRowCount?OM(o,i):"indicator"===i.table.internalProps.rowResizeType?function(t,e){var i,o;const n=e.table.internalProps.layoutMap;let r,s,l;if(n.indicatorsAsCol){const t=n.getCellHeaderPaths(e.table.rowHeaderLevelCount-1,e.rowResize.row),o=null===(i=t.rowHeaderPaths)||void 0===i?void 0:i[t.rowHeaderPaths.length-1];s=null==o?void 0:o.dimensionKey,l=null==o?void 0:o.value}else r=n.getIndicatorKey(e.table.rowHeaderLevelCount,e.rowResize.row);for(let i=e.table.columnHeaderLevelCount;i<e.table.rowCount-e.table.bottomFrozenRowCount;i++){const a=n.getIndicatorKey(e.table.rowHeaderLevelCount,i);if(n.indicatorsAsCol||a!==r){if(n.indicatorsAsCol){const r=n.getCellHeaderPaths(e.table.rowHeaderLevelCount-1,i),a=null===(o=null==r?void 0:r.rowHeaderPaths)||void 0===o?void 0:o[r.rowHeaderPaths.length-1];a&&s===a.dimensionKey&&l===a.value&&(e.table.scenegraph.updateRowHeight(i,t),e.table.internalProps._heightResizedRowMap.add(i))}}else e.table.scenegraph.updateRowHeight(i,t),e.table.internalProps._heightResizedRowMap.add(i)}}(o,i):"indicatorGroup"===i.table.internalProps.rowResizeType?function(t,e){const i=e.table.internalProps.layoutMap,o=i.getCellHeaderPaths(e.table.rowHeaderLevelCount,e.rowResize.row),n=i.getHeadNodeByRowOrColDimensions(o.rowHeaderPaths.slice(0,o.rowHeaderPaths.length-1)),r=n.startInTotal+e.table.frozenRowCount,s=n.startInTotal+e.table.frozenRowCount+n.size-1,l=e.table.getRowsHeight(r,s),a=t;for(let t=r;t<=s;t++){let i=e.table.getRowHeight(t)/l*a;i>0&&i<.5?i=.5:i<0&&i>=-.5&&(i=-.51),e.table.scenegraph.updateRowHeight(t,i),e.table.internalProps._heightResizedRowMap.add(t)}}(o,i):"all"===i.table.internalProps.rowResizeType?function(t,e){for(let i=e.table.frozenRowCount;i<e.table.rowCount-e.table.bottomFrozenRowCount;i++)e.table.scenegraph.updateRowHeight(i,t),e.table.internalProps._heightResizedRowMap.add(i)}(o,i):OM(o,i),i.rowResize.y=e,i.table.scenegraph.component.updateResizeRow(i.rowResize.row,t,i.rowResize.isBottomFrozen),i.table.scenegraph.updateNextFrame()}(t,e,this)}startFillSelect(t,e){this.fillHandle.isFilling=!0,this.fillHandle.startX=t,this.fillHandle.startY=e;const i=this.select.ranges[this.select.ranges.length-1];this.fillHandle.beforeFillMinCol=Math.min(i.start.col,i.end.col),this.fillHandle.beforeFillMinRow=Math.min(i.start.row,i.end.row),this.fillHandle.beforeFillMaxCol=Math.max(i.start.col,i.end.col),this.fillHandle.beforeFillMaxRow=Math.max(i.start.row,i.end.row),this.table.fireListeners(Xw.MOUSEDOWN_FILL_HANDLE,{})}endFillSelect(){this.fillHandle.isFilling=!1,this.fillHandle.startX=void 0,this.fillHandle.startY=void 0,this.fillHandle.directionRow=void 0;const t=Math.min(this.select.ranges[0].start.col,this.select.ranges[0].end.col),e=Math.min(this.select.ranges[0].start.row,this.select.ranges[0].end.row),i=Math.max(this.select.ranges[0].start.col,this.select.ranges[0].end.col),o=Math.max(this.select.ranges[0].start.row,this.select.ranges[0].end.row);this.fillHandle.beforeFillMinCol===t&&this.fillHandle.beforeFillMinRow===e&&this.fillHandle.beforeFillMaxCol===i&&this.fillHandle.beforeFillMaxRow===o||this.table.eventManager.isDraging&&this.table.fireListeners(Xw.DRAG_FILL_HANDLE_END,{direction:this.fillHandle.direction}),this.fillHandle.beforeFillMaxCol=void 0,this.fillHandle.beforeFillMaxRow=void 0,this.fillHandle.beforeFillMinCol=void 0,this.fillHandle.beforeFillMinRow=void 0}startMoveCol(t,e,i,o,n){(function(t,e,i,o,n){var r;if(!("canMoveHeaderPosition"in n.table.internalProps.layoutMap))return;n.columnMove.moving=!0,n.columnMove.colSource=t,n.columnMove.rowSource=e,n.columnMove.x=i-n.table.tableX,n.columnMove.y=o-n.table.tableY;const s=n.table.getCellLocation(t,e),l="columnHeader"===s?n.columnMove.x:"rowHeader"===s||n.table.internalProps.layoutMap.isSeriesNumberInBody(t,e)?n.columnMove.y:0;n.table.scenegraph.component.showMoveCol(t,e,l);const a=!!(null===(r=n.select.ranges)||void 0===r?void 0:r.length);n.table.stateManager.updateSelectPos(-1,-1),n.table.stateManager.endSelectCells(!0,a),n.table.scenegraph.updateNextFrame()})(t,e,i,o,this),this.table.fireListeners(Xw.CHANGE_HEADER_POSITION_START,{col:t,row:e,x:i,y:o,event:n})}updateMoveCol(t,e,i,o){!function(t,e,i,o,n){if(!("canMoveHeaderPosition"in n.table.internalProps.layoutMap))return;const r=function(t,e,i){const o=i.getCellRange(t.col,t.row);if(i.isColumnHeader(t.col,t.row)){const n=i.getCellRange(e.col,o.start.row);e.row>=i.columnHeaderLevelCount&&(e.row=i.columnHeaderLevelCount-1),e.col>=t.col?e.col=n.end.col:e.col=n.start.col}else if(i.isRowHeader(t.col,t.row)){const n=i.internalProps.layoutMap,r=i.getCellRange(o.start.col,e.row);if(e.col>=i.rowHeaderLevelCount+n.leftRowSeriesNumberColumnCount&&(e.col=i.rowHeaderLevelCount+n.leftRowSeriesNumberColumnCount-1),"tree"===n.rowHierarchyType){const o=n.getCellHeaderPathsWithTreeNode(t.col,t.row).rowHeaderPaths,r=n.getCellHeaderPathsWithTreeNode(e.col,e.row).rowHeaderPaths;if(o.length<=r.length){const n=r[o.length-1];n&&(e.row>=t.row?e.row=n.startInTotal+n.size-1+i.columnHeaderLevelCount:e.row=n.startInTotal+i.columnHeaderLevelCount)}}else e.row>=t.row?e.row=r.end.row:e.row=r.start.row}return e}({col:n.columnMove.colSource,row:n.columnMove.rowSource},{col:t,row:e},n.table);if(n.table.internalProps.layoutMap.canMoveHeaderPosition({col:n.columnMove.colSource,row:n.columnMove.rowSource},{col:r.col,row:r.row})){let s,l,a,h;n.columnMove.x=i-n.table.tableX,n.columnMove.y=o-n.table.tableY,n.columnMove.colTarget=r.col,n.columnMove.rowTarget=r.row,n.updateCursor("grabbing");const d=n.table.getCellLocation(n.columnMove.colSource,n.columnMove.rowSource);"columnHeader"===d?(l=n.columnMove.x,s=n.table.isLeftFrozenColumn(t)?n.columnMove.colTarget>=n.columnMove.colSource?n.table.getColsWidth(0,n.columnMove.colTarget):n.table.getColsWidth(0,n.columnMove.colTarget-1):n.table.isRightFrozenColumn(t)?n.table.tableNoFrameWidth-n.table.getColsWidth(r.col+1,n.table.colCount-1):(n.columnMove.colTarget>=n.columnMove.colSource?n.table.getColsWidth(0,n.columnMove.colTarget):n.table.getColsWidth(0,n.columnMove.colTarget-1))-n.table.stateManager.scroll.horizontalBarPos):("rowHeader"===d||n.table.internalProps.layoutMap.isSeriesNumberInBody(t,e))&&(h=n.columnMove.y,a=n.table.isFrozenRow(e)?n.columnMove.rowTarget>=n.columnMove.rowSource?n.table.getRowsHeight(0,n.columnMove.rowTarget):n.table.getRowsHeight(0,n.columnMove.rowTarget-1):n.table.isBottomFrozenRow(e)?n.table.tableNoFrameHeight-n.table.getRowsHeight(r.row+1,n.table.rowCount-1):(n.columnMove.rowTarget>=n.columnMove.rowSource?n.table.getRowsHeight(0,n.columnMove.rowTarget):n.table.getRowsHeight(0,n.columnMove.rowTarget-1))-n.table.stateManager.scroll.verticalBarPos),n.table.scenegraph.component.updateMoveCol(l,s,h,a),n.table.scenegraph.updateNextFrame()}else n.updateCursor("not-allowed"),n.columnMove.colTarget=n.columnMove.colSource,n.columnMove.rowTarget=n.columnMove.rowSource}(t,e,i,o,this)}isMoveCol(){return this.columnMove.moving}endMoveCol(){return function(t){var e,i;let o=!1;if("canMoveHeaderPosition"in t.table.internalProps.layoutMap&&t.columnMove.moving&&t.columnMove.colSource>=0&&t.columnMove.rowSource>=0&&t.columnMove.colTarget>=0&&t.columnMove.rowTarget>=0&&!0!==(null===(e=t.table.options.customConfig)||void 0===e?void 0:e.notUpdateInColumnRowMove)){const e=t.table.getCellRange(t.columnMove.colSource,t.columnMove.rowSource),i=t.table.getCellRange(t.columnMove.colTarget,t.columnMove.rowTarget),n=t.table._moveHeaderPosition({col:t.columnMove.colSource,row:t.columnMove.rowSource},{col:t.columnMove.colTarget,row:t.columnMove.rowTarget});if(!n||n.targetIndex===n.sourceIndex)return t.updateCursor(),t.columnMove.moving=!1,delete t.columnMove.colSource,delete t.columnMove.rowSource,delete t.columnMove.colTarget,delete t.columnMove.rowTarget,t.table.scenegraph.component.hideMoveCol(),t.table.scenegraph.updateNextFrame(),!1;{t.table.internalProps.useOneRowHeightFillAll=!1,t.table.internalProps.layoutMap.clearCellRangeMap();const r=t.table.getCellRange(t.columnMove.colSource,t.columnMove.rowSource),s=t.table.getCellRange(t.columnMove.colTarget,t.columnMove.rowTarget),l=Math.min(r.start.col,s.start.col,e.start.col,i.start.col),a=Math.max(r.end.col,s.end.col,e.end.col,i.end.col),h=Math.min(r.start.row,s.start.row,e.start.row,i.start.row);let d=Math.max(r.end.row,s.end.row,e.end.row,i.end.row);"row"===n.moveType&&"tree"===t.table.internalProps.layoutMap.rowHierarchyType&&(d=n.targetIndex>n.sourceIndex?d+n.targetSize-1:d+n.sourceSize-1),!t.table.transpose&&t.table.internalProps.layoutMap.isSeriesNumberInBody(t.columnMove.colSource,t.columnMove.rowSource)&&(t.table.changeRecordOrder(n.sourceIndex,n.targetIndex),t.changeCheckboxAndRadioOrder(n.sourceIndex,n.targetIndex)),"column"===n.moveType?FM(l,a,0,-1,t.table):FM(0,-1,h,d,t.table),t.table.clearCellStyleCache(),t.table.internalProps.layoutMap.isSeriesNumberInBody(t.columnMove.colSource,t.columnMove.rowSource)?t.table.scenegraph.updateHeaderPosition(t.table.scenegraph.proxy.colStart,t.table.scenegraph.proxy.colEnd,t.table.scenegraph.proxy.rowStart,t.table.scenegraph.proxy.rowEnd,n.moveType):"column"===n.moveType?t.table.scenegraph.updateHeaderPosition(l,a,0,-1,n.moveType):t.table.scenegraph.updateHeaderPosition(0,-1,h,d,n.moveType),"adjustFrozenCount"===t.table.internalProps.frozenColDragHeaderMode&&t.table.isListTable()&&(t.table.isLeftFrozenColumn(t.columnMove.colTarget)&&!t.table.isLeftFrozenColumn(t.columnMove.colSource)?t.table.frozenColCount+=r.end.col-r.start.col+1:t.table.isLeftFrozenColumn(t.columnMove.colSource)&&!t.table.isLeftFrozenColumn(t.columnMove.colTarget)&&(t.table.frozenColCount-=r.end.col-r.start.col+1),t.table.isRightFrozenColumn(t.columnMove.colTarget)&&!t.table.isRightFrozenColumn(t.columnMove.colSource)?t.table.rightFrozenColCount+=r.end.col-r.start.col+1:t.table.isRightFrozenColumn(t.columnMove.colSource)&&!t.table.isRightFrozenColumn(t.columnMove.colTarget)&&(t.table.rightFrozenColCount-=r.end.col-r.start.col+1)),o=!0}}return setTimeout((()=>{t.columnMove.moving=!1,delete t.columnMove.colSource,delete t.columnMove.rowSource,delete t.columnMove.colTarget,delete t.columnMove.rowTarget}),0),t.table.scenegraph.component.hideMoveCol(),t.columnResize.col<t.table.frozenColCount&&!t.table.isPivotTable()&&!t.table.transpose?(t.table.scenegraph.component.setFrozenColumnShadow(t.table.frozenColCount-1,t.columnResize.isRightFrozen),t.table.scenegraph.component.setRightFrozenColumnShadow(t.table.colCount-t.table.rightFrozenColCount)):t.columnResize.col>=t.table.colCount-t.table.rightFrozenColCount&&!t.table.isPivotTable()&&!t.table.transpose?t.table.scenegraph.component.setRightFrozenColumnShadow(t.table.colCount-t.table.rightFrozenColCount):t.table.options.frozenColCount?t.table.scenegraph.component.setFrozenColumnShadow(t.table.frozenColCount-1):t.table.options.rightFrozenColCount&&t.table.scenegraph.component.setRightFrozenColumnShadow(t.table.colCount-t.table.rightFrozenColCount),t.table.scenegraph.updateNextFrame(),!0===(null===(i=t.table.options.customConfig)||void 0===i?void 0:i.notUpdateInColumnRowMove)||o}(this)}checkFrozen(){var t,e,i;let o=this.table.isListTable()&&!this.table.internalProps.transpose?this.table.options.frozenColCount:this.table.isPivotChart()?null!==(t=this.table.rowHeaderLevelCount)&&void 0!==t?t:0:Math.max((null!==(e=this.table.rowHeaderLevelCount)&&void 0!==e?e:0)+this.table.internalProps.layoutMap.leftRowSeriesNumberColumnCount,null!==(i=this.table.options.frozenColCount)&&void 0!==i?i:0);if(o){if(o>this.table.colCount&&(o=this.table.colCount),this.table.tableNoFrameWidth-this.table.getColsWidth(0,o-1)<=120)return this.table._setFrozenColCount(0),this.setFrozenCol(-1),!1;if(this.table.frozenColCount!==o)return this.table._setFrozenColCount(o),this.setFrozenCol(o),!1}return!0}setFrozenCol(t){t!==this.frozen.col?(this.frozen.col=t,this.table.scenegraph.updateFrozen(),this.table.scenegraph.updateFrozenIcon(0,this.table.colCount-1)):this.table.scenegraph.updateFrozenIcon(0,this.table.colCount-1)}checkVerticalScrollBarEnd(){var t,e;const i=this.table.getAllRowsHeight(),o=this.scroll.verticalBarPos,n=this.table.tableNoFrameHeight;o+n>=i&&this.table.fireListeners(Xw.SCROLL_VERTICAL_END,{scrollTop:o,scrollLeft:this.scroll.horizontalBarPos,scrollHeight:null===(t=this.table.theme.scrollStyle)||void 0===t?void 0:t.width,scrollWidth:null===(e=this.table.theme.scrollStyle)||void 0===e?void 0:e.width,viewHeight:n,viewWidth:this.table.tableNoFrameWidth})}checkHorizontalScrollBarEnd(){var t,e;const i=this.table.getAllColsWidth(),o=this.scroll.horizontalBarPos,n=this.table.tableNoFrameWidth;o+n>=i&&this.table.fireListeners(Xw.SCROLL_HORIZONTAL_END,{scrollTop:this.scroll.verticalBarPos,scrollLeft:o,scrollHeight:null===(t=this.table.theme.scrollStyle)||void 0===t?void 0:t.width,scrollWidth:null===(e=this.table.theme.scrollStyle)||void 0===e?void 0:e.width,viewHeight:this.table.tableNoFrameHeight,viewWidth:n})}updateVerticalScrollBar(t){var e,i;const o=this.table.getAllRowsHeight(),n=this.scroll.verticalBarPos;this.scroll.verticalBarPos=Math.ceil(t*(o-this.table.scenegraph.height)),Q(this.scroll.verticalBarPos)&&!isNaN(this.scroll.verticalBarPos)||(this.scroll.verticalBarPos=0),this.table.scenegraph.setY(-this.scroll.verticalBarPos,1===t),this.scroll.verticalBarPos-=this.table.scenegraph.proxy.deltaY,this.table.scenegraph.proxy.deltaY=0,this.updateHoverPos(-1,-1),this.table.fireListeners(Xw.SCROLL,{event:void 0,scrollTop:this.scroll.verticalBarPos,scrollLeft:this.scroll.horizontalBarPos,scrollHeight:null===(e=this.table.theme.scrollStyle)||void 0===e?void 0:e.width,scrollWidth:null===(i=this.table.theme.scrollStyle)||void 0===i?void 0:i.width,viewHeight:this.table.tableNoFrameHeight,viewWidth:this.table.tableNoFrameWidth,scrollDirection:"vertical",scrollRatioY:t}),n!==this.scroll.verticalBarPos&&this.checkVerticalScrollBarEnd()}updateHorizontalScrollBar(t){var e,i;const o=this.table.getAllColsWidth(),n=this.scroll.horizontalBarPos;this.scroll.horizontalBarPos=Math.ceil(t*(o-this.table.scenegraph.width)),Q(this.scroll.horizontalBarPos)&&!isNaN(this.scroll.horizontalBarPos)||(this.scroll.horizontalBarPos=0),this.table.scenegraph.setX(-this.scroll.horizontalBarPos,1===t),this.scroll.horizontalBarPos-=this.table.scenegraph.proxy.deltaX,this.table.scenegraph.proxy.deltaX=0,this.updateHoverPos(-1,-1),this.table.fireListeners(Xw.SCROLL,{event:void 0,scrollTop:this.scroll.verticalBarPos,scrollLeft:this.scroll.horizontalBarPos,scrollHeight:null===(e=this.table.theme.scrollStyle)||void 0===e?void 0:e.width,scrollWidth:null===(i=this.table.theme.scrollStyle)||void 0===i?void 0:i.width,viewHeight:this.table.tableNoFrameHeight,viewWidth:this.table.tableNoFrameWidth,scrollDirection:"horizontal",scrollRatioX:t}),n!==this.scroll.horizontalBarPos&&this.checkHorizontalScrollBarEnd()}setScrollTop(t,e){let i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];var o,n,r;const s=this.table.getAllRowsHeight(),l=(null===(o=this.table.options.customConfig)||void 0===o?void 0:o._disableColumnAndRowSizeRound)?1:0;t=Math.max(0,Math.min(t,s-this.table.scenegraph.height-l)),((t=Math.ceil(t))!==this.scroll.verticalBarPos||this.table.isPivotChart())&&this.updateHoverPos(-1,-1);const a=this.scroll.verticalBarPos;this.scroll.verticalBarPos=t,Q(this.scroll.verticalBarPos)&&!isNaN(this.scroll.verticalBarPos)||(this.scroll.verticalBarPos=0),this.table.scenegraph.setY(-t);const h=t/(s-this.table.scenegraph.height);this.table.scenegraph.component.updateVerticalScrollBarPos(h),a!==t&&i&&(this.table.fireListeners(Xw.SCROLL,{event:null==e?void 0:e.nativeEvent,scrollTop:this.scroll.verticalBarPos,scrollLeft:this.scroll.horizontalBarPos,scrollHeight:null===(n=this.table.theme.scrollStyle)||void 0===n?void 0:n.width,scrollWidth:null===(r=this.table.theme.scrollStyle)||void 0===r?void 0:r.width,viewHeight:this.table.tableNoFrameHeight,viewWidth:this.table.tableNoFrameWidth,scrollDirection:"vertical",scrollRatioY:h}),this.checkVerticalScrollBarEnd())}setScrollLeft(t,e){let i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];var o,n,r;this.table.scrollLeft;const s=this.table.getAllColsWidth(),l=(this.table.getFrozenColsWidth(),(null===(o=this.table.options.customConfig)||void 0===o?void 0:o._disableColumnAndRowSizeRound)?1:0);t=Math.max(0,Math.min(t,s-this.table.scenegraph.width-l)),(t=Math.ceil(t))!==this.scroll.horizontalBarPos&&this.updateHoverPos(-1,-1);const a=this.scroll.horizontalBarPos;this.scroll.horizontalBarPos=t,Q(this.scroll.horizontalBarPos)&&!isNaN(this.scroll.horizontalBarPos)||(this.scroll.horizontalBarPos=0),this.table.scenegraph.setX(-t);const h=t/(s-this.table.scenegraph.width);this.table.scenegraph.component.updateHorizontalScrollBarPos(h),a!==t&&i&&(this.table.fireListeners(Xw.SCROLL,{event:null==e?void 0:e.nativeEvent,scrollTop:this.scroll.verticalBarPos,scrollLeft:this.scroll.horizontalBarPos,scrollHeight:null===(n=this.table.theme.scrollStyle)||void 0===n?void 0:n.width,scrollWidth:null===(r=this.table.theme.scrollStyle)||void 0===r?void 0:r.width,viewHeight:this.table.tableNoFrameHeight,viewWidth:this.table.tableNoFrameWidth,scrollDirection:"horizontal",scrollRatioX:h}),this.checkHorizontalScrollBarEnd())}hideVerticalScrollBar(){this.table.scenegraph.component.hideVerticalScrollBar()}showVerticalScrollBar(t){this.table.scenegraph.component.showVerticalScrollBar(),t&&(clearTimeout(this._clearVerticalScrollBar),this._clearVerticalScrollBar=setTimeout((()=>{var t;null===(t=this.table.scenegraph)||void 0===t||t.component.hideVerticalScrollBar()}),1e3))}hideHorizontalScrollBar(){this.table.scenegraph.component.hideHorizontalScrollBar()}showHorizontalScrollBar(t){this.table.scenegraph.component.showHorizontalScrollBar(),t&&(clearTimeout(this._clearHorizontalScrollBar),this._clearHorizontalScrollBar=setTimeout((()=>{var t;null===(t=this.table.scenegraph)||void 0===t||t.component.hideHorizontalScrollBar()}),1e3))}triggerContextMenu(t,e,i,o){this.menu.isShow&&this.menu.x===i&&this.menu.y===o?this.hideMenu():this.showContextMenu(t,e,i,o)}showContextMenu(t,e,i,o){var n;(null===(n=this.table.internalProps.menu)||void 0===n?void 0:n.contextMenuItems)&&("html"===this.table.internalProps.menu.renderMode?this.menu.isShow=!0:(this.menu.isShow=!0,this.menu.x=i,this.menu.y=o,this.table.scenegraph.component.menu.attach(i,o,t,e,DA.contextmenu)),this.table.fireListeners(Xw.SHOW_MENU,{x:i,y:o,col:t,row:e,type:"contextmenu"}))}triggerDropDownMenu(t,e,i,o,n){this.table.fireListeners(Xw.DROPDOWN_ICON_CLICK,{col:t,row:e,event:n}),this.menu.isShow?this.hideMenu():this.showDropDownMenu(t,e,i,o)}showDropDownMenu(t,e,i,o){"html"===this.table.internalProps.menu.renderMode?this.menu.isShow=!0:(this.menu.isShow=!0,this.table.scenegraph.component.menu.attach(i,o,t,e,DA.dropDown),this.menu.bounds=this.table.scenegraph.component.menu.bounds),this.table.fireListeners(Xw.SHOW_MENU,{x:i,y:o,col:t,row:e,type:"dropDown"}),this.residentHoverIcon&&this.table.scenegraph.setIconNormalStyle(this.residentHoverIcon.icon,this.residentHoverIcon.col,this.residentHoverIcon.row);const n=this.table.scenegraph.getCell(t,e);let r;n.forEachChildren((t=>t.attribute.funcType===VC.dropDown&&(r=t,!0))),r&&(this.residentHoverIcon={col:t,row:e,icon:r},this.table.scenegraph.setIconHoverStyle(this.residentHoverIcon.icon,this.residentHoverIcon.col,this.residentHoverIcon.row,n),this.table.scenegraph.residentHoverIcon(t,e))}hideMenu(){this.menu.isShow&&(this.table.fireListeners(Xw.DROPDOWN_MENU_CLEAR,null),this.table.fireListeners(Xw.HIDE_MENU,null),this.menu.isShow=!1,this.table.scenegraph.component.menu.detach(),this.residentHoverIcon&&(this.table.scenegraph.setIconNormalStyle(this.residentHoverIcon.icon,this.residentHoverIcon.col,this.residentHoverIcon.row),this.table.scenegraph.resetResidentHoverIcon(this.residentHoverIcon.col,this.residentHoverIcon.row),this.residentHoverIcon=null))}setDropDownMenuHighlight(t){this.menu.dropDownMenuHighlight=t;for(let e=0;e<t.length;e++){const{col:i,row:o}=t[e],n=this.table.getCellRange(i,o);if(n)for(let t=n.start.col;t<=n.end.col;t++)for(let e=n.start.row;e<=n.end.row;e++)this.table.scenegraph.updateCellContent(t,e)}}dropDownMenuIsHighlight(t,e,i){const o=this.menu.dropDownMenuHighlight;if(Array.isArray(o))for(let n=0;n<o.length;n++){const r=o[n];let{col:s,row:l}=r;const{field:a,menuKey:h}=r;if("number"!=typeof s||"number"!=typeof l)if(this.table.isPivotTable()){const t=this.table.internalProps.layoutMap.getPivotCellAdress(a);if(!t)continue;s=t.col,l=t.row}else{const t=this.table.internalProps.layoutMap.getHeaderCellAddressByField(a);if(!t)continue;s=t.col,l=t.row}if(Q(s)&&Q(l)&&this.table.isCellRangeEqual(t,e,s,l)){const o=this.table._getHeaderLayoutMap(null!=s?s:t,null!=l?l:e).dropDownMenu||this.table.globalDropDownMenu;if(o)for(let t=0;t<o.length;t++){const e=o[t];if(tt(e)&&(e.menuKey||e.text)===(h||"")&&t===i)return!0;if(nt(e)&&e===h&&t===i)return!0}}}return!1}triggerSort(t,e,i,o){if(this.table.isPivotTable()){const i=this.table.getPivotSortState(t,e),n=i?i.toUpperCase():"NORMAL",r="ASC"===n?"DESC":"DESC"===n?"NORMAL":"ASC";return this.table.sort(t,e,r),void this.table.fireListeners(HM.PIVOT_SORT_CLICK,{col:t,row:e,order:n||"normal",dimensionInfo:this.table.internalProps.layoutMap.getPivotDimensionInfo(t,e),cellLocation:this.table.getCellLocation(t,e),event:o})}const n=[...this.sort],r=this.table.internalProps.multipleSort||!n.length?null:this.sort[this.sort.length-1];PM(t,e,this.table,o);const s=this.table.getCellRange(t,e),l=this.sort.find((t=>t.col===s.start.col&&t.row===s.start.row)),a=this.table.internalProps.multipleSort||!r?null:r.col,h=this.table.internalProps.multipleSort||!r?null:r.row,d=n.findIndex((i=>i.col===t&&i.row===e));d>=0&&n.splice(d,1),this.table.scenegraph.updateSortIcon({col:t,row:e,iconMark:i,order:null==l?void 0:l.order,oldSortCol:a,oldSortRow:h,oldIconMark:null==r?void 0:r.icon}),l&&(l.icon=i),this.table.internalProps.multipleSort||n.forEach((t=>{this.table.scenegraph.updateSortIcon({col:null,row:null,iconMark:null,order:"normal",oldSortCol:t.col,oldSortRow:t.row,oldIconMark:null})})),this.table.fireListeners(HM.AFTER_SORT,{order:null==l?void 0:l.order,field:this.table.getHeaderField(t,e),event:o})}updateSortState(t){var e,i,o,n,r,s,l,a;t=Array.isArray(t)?t:[t];for(let a=0;a<t.length;a++){if(t[a].field===(null===(e=this.sort[a])||void 0===e?void 0:e.field)&&t[t.length-1].order===(null===(i=this.sort[a])||void 0===i?void 0:i.order))return;const h=this.table.internalProps.multipleSort?null:(null===(o=this.sort[a])||void 0===o?void 0:o.col)||null,d=this.table.internalProps.multipleSort?null:(null===(n=this.sort[a])||void 0===n?void 0:n.row)||null;"asc"===(null===(r=this.sort[a])||void 0===r?void 0:r.order)||null===(s=this.sort[a])||void 0===s||s.order,this.setSortState(t.slice(0,a+1));const c=this.table.internalProps.layoutMap.getHeaderCellAddressByField(t[a].field);let u;this.sort[a].col=c.col,this.sort[a].row=c.row,ww(this.table.scenegraph.getCell(this.sort[a].col,this.sort[a].row),"children",(t=>"sort"===t.attribute.funcType&&(u=t,!0))),this.table.scenegraph.updateSortIcon({col:this.sort[a].col,row:this.sort[a].row,iconMark:u,order:this.sort[a].order,oldSortCol:h,oldSortRow:d,oldIconMark:null===(l=this.sort[a])||void 0===l?void 0:l.icon})}const h=[];this.table.internalProps.layoutMap.columnTree.tree.children.forEach((e=>{t.some((t=>t.field===e.field))||h.push(e)}));for(let t=0;t<h.length;t++){const e=h[t];this.table.scenegraph.updateSortIcon({col:null,row:null,iconMark:null,order:null,oldSortCol:null!==(a=e.startInTotal+this.table.internalProps.layoutMap.leftRowSeriesNumberColumnCount)&&void 0!==a?a:0,oldSortRow:e.level,oldIconMark:null})}}triggerFreeze(t,e,i){if(!this.table.isPivotTable()&&!this.table.transpose){if(function(t,e,i){i.frozenColCount>0?t!==i.frozenColCount-1?i.setFrozenColCount(t+1):i.setFrozenColCount(0):i.setFrozenColCount(t+1)}(t,0,this.table),this.table.hasListeners(HM.FREEZE_CLICK)){const i=this.table.internalProps.layoutMap.columnObjects.slice(0,t+1);this.table.fireListeners(HM.FREEZE_CLICK,{col:t,row:e,fields:i.reduce(((t,e)=>t.concat(e.field)),[]),colCount:this.table.frozenColCount})}this.frozen.icon=i}}updateCursor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";this.table.getElement().style.cursor=t}updateDrillState(t,e,i,o,n,r){this.drill.dimensionKey=t,this.drill.title=e,this.drill.drillDown=i,this.drill.drillUp=o,this.drill.col=n,this.drill.row=r,function(t,e,i,o,n){const r=n.getCellLocation(t,e);let s=0,l=0,a=!1;"columnHeader"===r?(s=n.getColsWidth(0,n.rowHeaderLevelCount-1)-(0===n.frozenColCount?n.scrollLeft:0),l=n.getRowsHeight(0,e-1)+n.getRowHeight(e)/2,a=!0):"rowHeader"===r&&(l=n.getRowsHeight(0,n.columnHeaderLevelCount-1),s=n.getColsWidth(0,t-1)+n.getColWidth(t)/2,a=!0),n.scenegraph.updateDrill(a,s,l,i,o)}(n,r,i,o,this.table)}updateSparklineHoverPose(t,e,i,o){-1!==this.sparkLine.col&&-1!==this.sparkLine.row&&function(t,e,i){const o=i.scenegraph.getCell(t,e).getChildByName("sparkline"),n=null==o?void 0:o.getChildByName("highlight-line"),r=null==o?void 0:o.getChildByName("highlight-symbol");n&&n.setAttributes({visible:!1,pickable:!1}),r&&r.setAttributes({visible:!1,pickable:!1}),i.scenegraph.updateNextFrame()}(this.sparkLine.col,this.sparkLine.row,this.table);let n=!1;-1!==t&&-1!==e&&(n=function(t,e,i,o,n){var r,s;const l=n.scenegraph.getCell(t,e).getChildByName("sparkline"),a=null==l?void 0:l.getChildByName("sparkline-line"),h=null==l?void 0:l.getChildByName("sparkline-symbol-group");if(!a)return!1;const d=a.bandwidth,c=a.min,u=a.max,g=a.attribute.points;let p;i-=l.globalAABBBounds.x1,l.globalAABBBounds.y1;for(let t=0;t<g.length;t++){const{x:e,y:o,defined:n,rawData:f}=g[t];if(Math.abs(i-e)<d/2&&(p={point:g[t],points:g,pointsBandWidth:d,pointData:f},n)){const t=l.getChildByName("highlight-line");if(t)t.setAttributes({points:[{x:e,y:u},{x:e,y:c}],visible:!0,pickable:!0});else{const t=oc({points:[{x:e,y:u},{x:e,y:c}],lineWidth:null===(r=a.hover)||void 0===r?void 0:r.strokeWidth,stroke:null===(s=a.hover)||void 0===s?void 0:s.stroke});t.name="highlight-line",l.addChild(t)}const i=l.getChildByName("highlight-symbol");if(i)i.setAttributes({x:e,y:o,visible:!0,pickable:!0});else{const t=tc({x:e,y:o,stroke:h.hover.stroke,lineWidth:h.hover.strokeWidth,fill:h.hover.fill,size:2*h.hover.size,symbolType:"circle"});t.name="highlight-symbol",l.addChild(t)}break}}if(n.scenegraph.updateNextFrame(),p){const i={col:t,row:e,field:n.getHeaderField(t,e),value:n.getCellValue(t,e),dataValue:n.getCellOriginValue(t,e),cellHeaderPaths:n.internalProps.layoutMap.getCellHeaderPaths(t,e),title:n.getBodyColumnDefine(t,e).title,cellRange:n.getCellRelativeRect(t,e),sparkline:{pointData:p.pointData},scaleRatio:n.canvas.getBoundingClientRect().width/n.canvas.offsetWidth};n.fireListeners(Xw.MOUSEOVER_CHART_SYMBOL,i)}return!0}(t,e,i,0,this.table)),n?(this.sparkLine.col=t,this.sparkLine.row=e):(this.sparkLine.col=-1,this.sparkLine.row=-1)}setCheckedState(t,e,i,o){return function(t,e,i,o,n){const r=n.table.getRecordShowIndexByCell(t,e);if(r>=0){const t=n.table.dataSource.getIndexKey(r);n.checkedState[t]||(n.checkedState[t]={}),n.checkedState[t][i]=o}}(t,e,i,o,this)}setHeaderCheckedState(t,e){return function(t,e,i){var o;i.headerCheckedState[t]=e,null===(o=i.checkedState)||void 0===o||o.forEach((i=>{i[t]=e}))}(t,e,this)}syncCheckedState(t,e,i,o){return function(t,e,i,o,n){var r,s;if(n.table.isHeader(t,e)){if(Q(n.headerCheckedState[i]))return n.headerCheckedState[i];if("function"==typeof o)return;if(Q(o))n.headerCheckedState[i]=o;else if((null===(r=n.checkedState)||void 0===r?void 0:r.length)>0)return n.updateHeaderCheckedState(i,t,e);return n.headerCheckedState[i]}const l=n.table.getRecordShowIndexByCell(t,e);if(l>=0){const t=n.table.dataSource.getIndexKey(l);if(Q(null===(s=n.checkedState[t])||void 0===s?void 0:s[i]))return n.checkedState[t][i];n.checkedState[t]||(n.checkedState[t]={}),n.checkedState[t][i]=o}return o}(t,e,i,o,this)}initCheckedState(t){return function(t,e){e.checkedState=[],e.headerCheckedState={},e.radioState={};let i=!1;e._checkboxCellTypeFields=[],e._headerCheckFuncs={},e.table.internalProps.layoutMap.headerObjects.forEach(((t,o)=>{if("checkbox"===t.headerType){const o=t.define.checked;null==o||"function"==typeof o?(i=!0,"function"==typeof o&&(e._headerCheckFuncs[t.field]=o)):e.headerCheckedState[t.field]=o,"checkbox"!==t.define.cellType||t.fieldFormat||e._checkboxCellTypeFields.push(t.field)}})),i&&t.forEach(((t,i)=>{e._checkboxCellTypeFields.forEach((o=>{const n=t[o];let r;if(tt(n)?r=n.checked:"boolean"==typeof n&&(r=n),null==r){const t=e._headerCheckFuncs[o];if(t){const s=e.table.getCellAddrByFieldRecord(o,i);r=Hw(t,{col:s.col,row:s.row,table:e.table,context:null,value:n})}}e.checkedState[i]||(e.checkedState[i]={}),e.checkedState[i][o]=r}))}))}(t,this)}updateHeaderCheckedState(t,e,i){return function(t,e,i,o){const n=e.checkedState.every(((n,r)=>{const s=e.table.getTableIndexByRecordIndex(r);return!!(e.table.transpose?e.table.getCustomMerge(s,o):e.table.getCustomMerge(i,s))||!0===(null==n?void 0:n[t])}));return n?(e.headerCheckedState[t]=!0,n):e.checkedState.every(((n,r)=>{const s=e.table.getTableIndexByRecordIndex(r);return!!(e.table.transpose?e.table.getCustomMerge(s,o):e.table.getCustomMerge(i,s))||!1===(null==n?void 0:n[t])}))?(e.headerCheckedState[t]=!1,!1):!!e.checkedState.find((e=>!0===(null==e?void 0:e[t])))&&(e.headerCheckedState[t]="indeterminate","indeterminate")}(t,this,e,i)}initLeftRecordsCheckState(t){return function(t,e){for(let i=e.checkedState.length;i<t.length;i++){const o=t[i];e._checkboxCellTypeFields.forEach((t=>{const n=o[t];let r;tt(n)?r=n.checked:"boolean"==typeof n&&(r=n),e.checkedState[i]||(e.checkedState[i]={}),e.checkedState[i][t]=r}))}}(t,this)}setRadioState(t,e,i,o,n){!function(t,e,i,o,n,r){const s=r.table.getRecordShowIndexByCell(t,e);if(s>=0){const t=r.table.dataSource.getIndexKey(s);"column"===o?at(n)?(r.radioState[i]={},r.radioState[i][t]=n):r.radioState[i]=t:(r.radioState[i]||(r.radioState[i]={}),at(n)?r.radioState[i][t]=n:r.radioState[i][t]=!0)}}(t,e,i,o,n,this)}syncRadioState(t,e,i,o,n,r){return function(t,e,i,o,n,r,s){var l,a,h,d,c;const u=s.table.getRecordShowIndexByCell(t,e);if(u>=0){const t=s.table.dataSource.getIndexKey(u);if("column"===o){if(!Q(s.radioState[i])&&r)return at(n)?(s.radioState[i]={},s.radioState[i][t]=n):s.radioState[i]=t,!0;if(at(s.radioState[i])&&!at(n))return s.radioState[i]===t;if(at(s.radioState[i])&&at(n))return!1;if(tt(s.radioState[i])&&!at(n))return!1;if(tt(s.radioState[i])&&at(n))return s.radioState[i][t]===n}else if("cell"===o){if(!Q(s.radioState[i])&&r)return s.radioState[i]={},at(n)?s.radioState[i][t]=n:s.radioState[i][t]=!0,!0;if(!Q(null===(l=s.radioState[i])||void 0===l?void 0:l[t])&&r)return at(n)?s.radioState[i][t]=n:s.radioState[i][t]=!0,!0;if(q(null===(a=s.radioState[i])||void 0===a?void 0:a[t])&&!at(n))return s.radioState[i][t];if(q(null===(h=s.radioState[i])||void 0===h?void 0:h[t])&&at(n))return!1;if(at(null===(d=s.radioState[i])||void 0===d?void 0:d[t])&&!at(n))return!1;if(at(null===(c=s.radioState[i])||void 0===c?void 0:c[t])&&at(n))return s.radioState[i][t]===n}}return r}(t,e,i,o,n,r,this)}changeCheckboxAndRadioOrder(t,e){this.checkedState.length&&function(t,e,i){const{checkedState:o,table:n}=i;if(n.internalProps.transpose?(t=n.getRecordShowIndexByCell(t,0),e=n.getRecordShowIndexByCell(e,0)):(t=n.getRecordShowIndexByCell(0,t),e=n.getRecordShowIndexByCell(0,e)),t>e){const i=o[t];for(let i=t;i>e;i--)o[i]=o[i-1];o[e]=i}else if(t<e){const i=o[t];for(let i=t;i<e;i++)o[i]=o[i+1];o[e]=i}}(t,e,this),this.radioState.length&&function(t,e,i){const{radioState:o,table:n}=i;if(n.internalProps.transpose?(t=n.getRecordShowIndexByCell(t,0),e=n.getRecordShowIndexByCell(e,0)):(t=n.getRecordShowIndexByCell(0,t),e=n.getRecordShowIndexByCell(0,e)),t>e){const i=o[t];for(let i=t;i>e;i--)o[i]=o[i-1];o[e]=i}else if(t<e){const i=o[t];for(let i=t;i<e;i++)o[i]=o[i+1];o[e]=i}}(t,e,this)}}(this),this.eventManager=new class{constructor(t){this.isDown=!1,this.isDraging=!1,this.globalEventListeners=[],this._enableTableScroll=!0,this.table=t,this.handleTextStickBindId=[],this.inertiaScroll=new jM(t.stateManager),"node"===sw.mode||t.options.disableInteraction||(this.bindOuterEvent(),setTimeout((()=>{this.bindSelfEvent()}),0))}bindOuterEvent(){VM(this),function(t){const e=t.table,i=e.stateManager,o=e.internalProps.handler;function n(t){var i;if(e.hasListeners(Xw.KEYDOWN)){const o={keyCode:null!==(i=t.keyCode)&&void 0!==i?i:t.which,code:t.code,event:t,scaleRatio:e.canvas.getBoundingClientRect().width/e.canvas.offsetWidth};e.fireListeners(Xw.KEYDOWN,o)}}o.on(e.getElement(),"blur",(e=>{t.dealTableHover()})),o.on(e.getElement(),"keydown",(o=>{var r,s,l,a,h,d,c,u,g,p,f,v,m,b,y,C,w,x,_;if("a"===o.key&&(o.ctrlKey||o.metaKey))(null===(r=e.keyboardOptions)||void 0===r?void 0:r.selectAllOnCtrlA)&&(o.preventDefault(),t.deelTableSelectAll());else if(i.select.cellPos.col>=0&&i.select.cellPos.row>=0&&("ArrowUp"===o.key||"ArrowDown"===o.key||"ArrowLeft"===o.key||"ArrowRight"===o.key)){if((null===(l=null===(s=e.options.keyboardOptions)||void 0===s?void 0:s.moveEditCellOnArrowKeys)||void 0===l||!l)&&(null===(a=e.editorManager)||void 0===a?void 0:a.editingEditor))return;let t,n;if(o.preventDefault(),o.stopPropagation(),"ArrowUp"===o.key?o.ctrlKey||o.metaKey?(t=i.select.cellPos.col,n=0):(o.shiftKey,t=i.select.cellPos.col,n=Math.min(e.rowCount-1,Math.max(0,i.select.cellPos.row-1))):"ArrowDown"===o.key?o.ctrlKey||o.metaKey?(t=i.select.cellPos.col,n=e.rowCount-1):(o.shiftKey,t=i.select.cellPos.col,n=Math.min(e.rowCount-1,Math.max(0,i.select.cellPos.row+1))):"ArrowLeft"===o.key?o.ctrlKey||o.metaKey?(t=0,n=i.select.cellPos.row):(o.shiftKey,n=i.select.cellPos.row,t=Math.min(e.colCount-1,Math.max(0,i.select.cellPos.col-1))):"ArrowRight"===o.key&&(o.ctrlKey||o.metaKey?(t=e.colCount-1,n=i.select.cellPos.row):(o.shiftKey,n=i.select.cellPos.row,t=Math.min(e.colCount-1,Math.max(0,i.select.cellPos.col+1)))),TB(e,t,n))return;e.selectCell(t,n,o.shiftKey),null!==(d=null===(h=e.options.keyboardOptions)||void 0===h?void 0:h.moveEditCellOnArrowKeys)&&void 0!==d&&d&&(null===(c=e.editorManager)||void 0===c?void 0:c.editingEditor)&&(e.editorManager.completeEdit(),e.getElement().focus(),e.getEditor(t,n)&&e.editorManager.startEditCell(t,n))}else if("Escape"===o.key)null===(u=e.editorManager)||void 0===u||u.cancelEdit();else if("Enter"===o.key){if(null===(g=e.editorManager)||void 0===g?void 0:g.editingEditor){if(n(o),e.editorManager.completeEdit(),e.getElement().focus(),!0===(null===(p=e.options.keyboardOptions)||void 0===p?void 0:p.moveFocusCellOnEnter)){const t=i.select.cellPos.col,n=Math.min(e.rowCount-1,Math.max(0,i.select.cellPos.row+1));if(TB(e,t,n))return;e.selectCell(t,n,o.shiftKey)}return}if(!0===(null===(f=e.options.keyboardOptions)||void 0===f?void 0:f.moveFocusCellOnEnter)){const t=i.select.cellPos.col,n=Math.min(e.rowCount-1,Math.max(0,i.select.cellPos.row+1));if(TB(e,t,n))return;e.selectCell(t,n,o.shiftKey)}else if((null===(m=null===(v=e.options.keyboardOptions)||void 0===v?void 0:v.editCellOnEnter)||void 0===m||m)&&1===(null!==(y=null===(b=e.stateManager.select.ranges)||void 0===b?void 0:b.length)&&void 0!==y?y:0)){const t=e.stateManager.select.ranges[0].start.col,i=e.stateManager.select.ranges[0].start.row,o=e.stateManager.select.ranges[0].end.col,n=e.stateManager.select.ranges[0].end.row;t===o&&i===n&&e.getEditor(t,i)&&e.editorManager.startEditCell(t,i)}}else if("Tab"===o.key){if((null===(w=null===(C=e.options.keyboardOptions)||void 0===C?void 0:C.moveFocusCellOnTab)||void 0===w||w)&&(o.preventDefault(),i.select.cellPos.col>=0&&i.select.cellPos.row>=0)){let t,o;if(i.select.cellPos.col===e.colCount-1?(o=Math.min(e.rowCount-1,i.select.cellPos.row+1),t=e.rowHeaderLevelCount):i.select.cellPos.row===e.rowCount-1?(o=e.rowCount-1,t=e.rowHeaderLevelCount):(o=i.select.cellPos.row,t=i.select.cellPos.col+1),TB(e,t,o))return;e.selectCell(t,o),(null===(x=e.editorManager)||void 0===x?void 0:x.editingEditor)&&(e.editorManager.completeEdit(),e.getElement().focus(),e.getEditor(t,o)&&e.editorManager.startEditCell(t,o))}}else if(!(o.ctrlKey||o.metaKey||o.shiftKey)){const t=e.options.editCellTrigger;if(("keydown"===t||Array.isArray(t)&&t.includes("keydown"))&&!(null===(_=e.editorManager)||void 0===_?void 0:_.editingEditor)){const t=/^[a-zA-Z0-9+\-*\/%=.,\s]$/;o.key.match(t)&&e.editorManager.startEditCell(i.select.cellPos.col,i.select.cellPos.row,"")}}n(o)})),o.on(e.getElement(),"copy",(t=>{var i,o;if(null===(i=e.keyboardOptions)||void 0===i?void 0:i.copySelected){const i=e.getCopyValue();if(Q(i)){if(t.preventDefault(),null===(o=navigator.clipboard)||void 0===o?void 0:o.write){const t=t=>{const e=["<table>"],i=['<meta name="author" content="Visactor"/>','<style type="text/css">td{white-space:normal}br{mso-data-placement:same-cell}</style>'].join(""),o=t.split("\r\n");return o.forEach((function(t,i){const n=t.split("\t"),r=[];0===i&&e.push("<tbody>"),n.forEach((function(t,e){const i=t?t.toString().replace(/&/g,"&amp;").replace(/'/g,"&#39;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\n/g,"<br>").replace(/(<br(\s*|\/)>(\r\n|\n)?|\r\n|\n)/g,"<br>\r\n").replace(/\x20{2,}/gi,(t=>`<span style="mso-spacerun: yes">${"&nbsp;".repeat(t.length-1)} </span>`)).replace(/\t/gi,"&#9;"):" ";r.push(`<td>${i}</td>`)})),e.push("<tr>",...r,"</tr>"),i===o.length-1&&e.push("</tbody>")})),e.push("</table>"),[i,e.join("")].join("")},e=t(i);navigator.clipboard.write([new ClipboardItem({"text/html":new Blob([e],{type:"text/html"}),"text/plain":new Blob([i],{type:"text/plain"})})])}else Nw?window.clipboardData.setData("Text",i):t.clipboardData.setData("text/plain",i);e.fireListeners(Xw.COPY_DATA,{cellRange:e.stateManager.select.ranges,copyData:i})}}})),o.on(e.getElement(),"paste",(t=>{var i,o,n,r;if((null===(i=e.keyboardOptions)||void 0===i?void 0:i.pasteValueToCell)&&e.changeCellValues){if(null===(o=e.editorManager)||void 0===o?void 0:o.editingEditor)return;if((null===(n=e.stateManager.select.ranges)||void 0===n?void 0:n.length)>0)if(null===(r=navigator.clipboard)||void 0===r?void 0:r.read)navigator.clipboard.read().then((t=>{for(const e of t)e.types.includes("text/html")?l(e):1===e.types.length&&"text/plain"===e.types[0]&&h(e)}));else{const i=e.stateManager.select.ranges,o=Math.min(i[0].start.col,i[0].end.col),n=Math.min(i[0].start.row,i[0].end.row),r=(t.clipboardData||window.Clipboard).getData("text").split("\n"),s=[];r.forEach((function(t,e){const i=t.split("\t"),o=[];s.push(o),i.forEach((function(t,e){e===i.length-1&&(t=t.trim()),o.push(t)}))})),e.changeCellValues(o,n,s)}}})),o.on(e.getElement(),"contextmenu",(t=>{var i;!1!==(null===(i=e.eventOptions)||void 0===i?void 0:i.preventDefaultContextMenu)&&t.preventDefault()})),e.options.canvas||o.on(e.getContainer(),"resize",(t=>{var i;0===t.width&&0===t.height||((e.autoFillWidth||e.autoFillHeight)&&(null===(i=e.editorManager)||void 0===i||i.completeEdit()),Q(e.options.pixelRatio)||e.setPixelRatio(KM()),t.windowSizeNotChange||e.resize())}));const r=/<tr[^>]*>([\s\S]*?)<\/tr>/g,s=/<td[^>]*>([\s\S]*?)<\/td>/g;function l(t){const i=e.stateManager.select.ranges,o=i.length,n=Math.min(i[o-1].start.col,i[o-1].end.col),l=Math.min(i[o-1].start.row,i[o-1].end.row),h=Math.max(i[o-1].start.col,i[o-1].end.col),c=Math.max(i[o-1].start.row,i[o-1].end.row);let u=0,g=0,p=[];t.getType("text/html").then((t=>{t.text().then((t=>{var i,o;if(t&&/(<table)|(<TABLE)/g.test(t)){const a=Array.from(t.matchAll(r));for(const t of a){const e=t[1],o=Array.from(e.matchAll(s)).map((t=>t[1].replace(/(<(?!br)([^>]+)>)/gi,"").replace(/<br(\s*|\/)>[\r\n]?/gim,"\n").replace(/&amp;/g,"&").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&#9;/gi,"\t").replace(/&nbsp;/g," ")));p.push(o),u=Math.max(u,null!==(i=null==o?void 0:o.length)&&void 0!==i?i:0)}g=null!==(o=p.length)&&void 0!==o?o:0,p=d(p,g,u,c-l+1,h-n+1),e.changeCellValues(n,l,p,!0)}else navigator.clipboard.read().then((t=>{for(const e of t)e.types.includes("text/plain")&&e.getType("text/plain").then((t=>{t.text().then(a)}))}))}))}))}function a(t){var i;const o=e.stateManager.select.ranges,n=o.length,r=Math.min(o[n-1].start.col,o[n-1].end.col),s=Math.min(o[n-1].start.row,o[n-1].end.row),l=Math.max(o[n-1].start.col,o[n-1].end.col),a=Math.max(o[n-1].start.row,o[n-1].end.row);let h=0,c=0,u=[];t.split("\n").forEach((function(t,e){var i;const o=t.split("\t"),n=[];u.push(n),o.forEach((function(t,e){e===o.length-1&&(t=t.trim()),n.push(t)})),h=Math.max(h,null!==(i=null==n?void 0:n.length)&&void 0!==i?i:0)})),c=null!==(i=u.length)&&void 0!==i?i:0,u=d(u,c,h,a-s+1,l-r+1),e.changeCellValues(r,s,u,!0)}function h(t){const i=e.stateManager.select.ranges,o=i.length,n=Math.min(i[o-1].start.col,i[o-1].end.col),r=Math.min(i[o-1].start.row,i[o-1].end.row),s=Math.max(i[o-1].start.col,i[o-1].end.col),l=Math.max(i[o-1].start.row,i[o-1].end.row);let a=0,h=0;t.getType("text/plain").then((t=>{t.text().then((t=>{var i;const o=t.replace(/\r(?!\n)/g,"\r\n").split("\r\n");let c=[];o.length>1&&""===o[o.length-1]&&o.pop(),o.forEach((function(t,e){var i;const o=t.split("\t"),n=[];c.push(n),o.forEach((function(t,e){t.includes("\n")&&(t=t.replace(/^"(.*)"$/,"$1").replace(/["]*/g,(t=>new Array(Math.floor(t.length/2)).fill('"').join("")))),n.push(t)})),a=Math.max(a,null!==(i=null==n?void 0:n.length)&&void 0!==i?i:0)})),h=null!==(i=c.length)&&void 0!==i?i:0,c=d(c,h,a,l-r+1,s-n+1),e.changeCellValues(n,r,c,!0)}))}))}function d(t,e,i,o,n){if(n>i||o>e){if(n%i==0&&o%e==0){const r=[];for(let s=0;s<o;s++){const o=[];r.push(o);for(let r=0;r<n;r++){const n=s%e,l=r%i;o.push(t[n][l])}}return r}return t}return t}const c=t=>{e.eventManager.LastBodyPointerXY={x:t.x,y:t.y},e.eventManager.isDown=!0};t.globalEventListeners.push({name:"pointerdown",env:"body",callback:c}),document.body.addEventListener("pointerdown",c);const u=t=>{t.target!==e.canvas&&(t=>{var o,n,r,s,l,a;if(i.menu.isShow&&setTimeout((()=>{e.internalProps.menuHandler.pointInMenuElement(t.clientX,t.clientY)||i.menu.isShow&&i.hideMenu()}),0),i.isResizeCol())$M(e);else if(i.isResizeRow())XM(e);else if(i.isMoveCol())e.stateManager.endMoveCol()&&-1!==(null===(o=e.stateManager.columnMove)||void 0===o?void 0:o.colSource)&&-1!==(null===(n=e.stateManager.columnMove)||void 0===n?void 0:n.rowSource)&&-1!==(null===(r=e.stateManager.columnMove)||void 0===r?void 0:r.colTarget)&&-1!==(null===(s=e.stateManager.columnMove)||void 0===s?void 0:s.rowTarget)&&e.hasListeners(Xw.CHANGE_HEADER_POSITION)&&e.fireListeners(Xw.CHANGE_HEADER_POSITION,{target:{col:e.stateManager.columnMove.colTarget,row:e.stateManager.columnMove.rowTarget},source:{col:e.stateManager.columnMove.colSource,row:e.stateManager.columnMove.rowSource},event:t});else if(i.isSelecting()&&(null===(a=null===(l=e.stateManager.select)||void 0===l?void 0:l.ranges)||void 0===a?void 0:a.length)){const i=e.stateManager.select.ranges[e.stateManager.select.ranges.length-1].end.col,o=e.stateManager.select.ranges[e.stateManager.select.ranges.length-1].end.row;if(e.stateManager.endSelectCells(),e.hasListeners(Xw.DRAG_SELECT_END)){const n={event:t,cells:[],col:i,row:o,scaleRatio:e.canvas.getBoundingClientRect().width/e.canvas.offsetWidth,target:void 0};n.cells=e.getSelectedCellInfos(),e.fireListeners(Xw.DRAG_SELECT_END,n)}}})(t),e.eventManager.LastBodyPointerXY=null,e.eventManager.isDown=!1,e.eventManager.isDraging=!1,e.eventManager.inertiaScroll.endInertia(),"grabing"===i.interactionState&&i.isResizeCol()?$M(e):"grabing"===i.interactionState&&i.isResizeRow()&&XM(e)};t.globalEventListeners.push({name:"pointerup",env:"document",callback:u}),document.addEventListener("pointerup",u);const g=o=>{var n,r,s,l,a;if(e.eventManager.isDown&&e.eventManager.LastBodyPointerXY){const t=null!==(r=null===(n=e.eventManager.LastBodyPointerXY)||void 0===n?void 0:n.x)&&void 0!==r?r:o.x,i=null!==(l=null===(s=e.eventManager.LastBodyPointerXY)||void 0===s?void 0:s.y)&&void 0!==l?l:o.y;(Math.abs(t-o.x)>1||Math.abs(i-o.y)>1)&&(e.eventManager.isDraging=!0)}const{x:h,y:d}=e._getMouseAbstractPoint(o,!1);i.interactionState===IC.grabing&&(i.isResizeCol()?(t.dealColumnResize(h,d),e.hasListeners(Xw.RESIZE_COLUMN)&&e.fireListeners(Xw.RESIZE_COLUMN,{col:e.stateManager.columnResize.col,colWidth:e.getColWidth(e.stateManager.columnResize.col)})):i.isResizeRow()&&(t.dealRowResize(h,d),e.hasListeners(Xw.RESIZE_ROW)&&e.fireListeners(Xw.RESIZE_ROW,{row:e.stateManager.rowResize.row,rowHeight:e.getRowHeight(e.stateManager.rowResize.row)})));const c=e.stateManager.isSelecting();if(t._enableTableScroll&&t.isDraging&&c&&(null===(a=e.stateManager.select.ranges)||void 0===a?void 0:a.length)>0){const t=e.getDrawRange(),i=e.getFrozenRowsHeight(),o=e.getBottomFrozenRowsHeight(),n=e.getFrozenColsWidth(),r=e.getRightFrozenColsWidth(),s=e.stateManager.select.ranges[e.stateManager.select.ranges.length-1].start;if(e.isSeriesNumber(s.col,s.row))return;const l=e.stateManager.select.ranges[e.stateManager.select.ranges.length-1].end,a=(!1===e.isFrozenRow(s.row)||!1===e.isFrozenRow(l.row))&&e.getAllRowsHeight()>e.tableNoFrameHeight,c=(!1===e.isFrozenColumn(s.col)||!1===e.isFrozenColumn(l.col))&&e.getAllColsWidth()>e.tableNoFrameWidth;if((d>t.bottom-o||d<t.top+i)&&a||(h>t.right-r||h<t.left+n)&&c){e.eventManager.scrollXSpeed=0,e.eventManager.scrollYSpeed=0;let s=!1,l=!1,u=!1,g=!1;d>t.bottom-o&&a&&e.scrollTop+e.tableNoFrameHeight<e.getAllRowsHeight()?(s=!0,e.eventManager.scrollYSpeed=-(d-t.bottom+o)/50):d<t.top+i&&a&&e.scrollTop>0&&(l=!0,e.eventManager.scrollYSpeed=-(d-t.top-i)/50),h>t.right-r&&c&&e.scrollLeft+e.tableNoFrameWidth<e.getAllColsWidth()?(u=!0,e.eventManager.scrollXSpeed=-(h-t.right+r)/50):h<t.left+n&&c&&e.scrollLeft>0&&(g=!0,e.eventManager.scrollXSpeed=-(h-t.left-n)/50),e.eventManager.inertiaScroll.startInertia(e.eventManager.scrollXSpeed,e.eventManager.scrollYSpeed,1),e.eventManager.inertiaScroll.setScrollHandle(((a,c)=>{let p,f;WM({deltaX:-a,deltaY:-c},e.stateManager,!1),s?f=e.scrollTop+t.height-o-20:l&&(f=e.scrollTop+i+20),u?p=e.scrollLeft+t.width-r-20:g&&(p=e.scrollLeft+n+20);let v=!1,m=!1;u||g||(h>e.tableNoFrameWidth-e.getRightFrozenColsWidth()&&h<e.tableNoFrameWidth||h>0&&h<e.getFrozenColsWidth()?(p=h,m=!0):p=e.scrollLeft+h),s||l||(d>e.tableNoFrameHeight-e.getBottomFrozenRowsHeight()&&d<e.tableNoFrameHeight||d>0&&d<e.getFrozenRowsHeight()?(f=d,v=!0):f=e.scrollTop+d),e.stateManager.updateInteractionState(IC.grabing);const b=e.getTargetColAtConsiderRightFrozen(p,m),y=e.getTargetRowAtConsiderBottomFrozen(f,v);Q(b)&&Q(y)&&e.stateManager.updateSelectPos(b.col,y.row,!1,!1,!1,!0)}))}else e.eventManager.inertiaScroll.isInertiaScrolling()?e.eventManager.inertiaScroll.endInertia():e.eventManager.scrollYSpeed=0}};t.globalEventListeners.push({name:"pointermove",env:"body",callback:g}),document.body.addEventListener("pointermove",g)}(this),function(t){const e=t.table,i=e.stateManager,o=e.scenegraph;o.component.vScrollBar.addEventListener("pointerover",(t=>{i.showVerticalScrollBar()})),o.component.hScrollBar.addEventListener("pointerover",(t=>{i.showHorizontalScrollBar()})),o.component.vScrollBar.addEventListener("pointerout",(t=>{i.interactionState!==IC.scrolling&&i.hideVerticalScrollBar()})),o.component.hScrollBar.addEventListener("pointerout",(t=>{i.interactionState!==IC.scrolling&&i.hideHorizontalScrollBar()})),o.component.vScrollBar.addEventListener("pointermove",(t=>{o.table.stateManager.updateCursor("default"),t.stopPropagation()})),o.component.vScrollBar.addEventListener("pointerdown",(t=>{t.stopPropagation(),o.table.hasListeners(Xw.MOUSEDOWN_TABLE)&&o.table.fireListeners(Xw.MOUSEDOWN_TABLE,{event:t.nativeEvent})})),o.component.vScrollBar.addEventListener("scrollDown",(t=>{var e;o.table.eventManager.LastBodyPointerXY={x:t.x,y:t.y},o.table.eventManager.isDown=!0,i.interactionState!==IC.scrolling&&i.updateInteractionState(IC.scrolling),o.table.stateManager.hideMenu(),null===(e=o.table.editorManager)||void 0===e||e.completeEdit(),o.table.hasListeners(Xw.MOUSEDOWN_TABLE)&&o.table.fireListeners(Xw.MOUSEDOWN_TABLE,{event:t.nativeEvent})})),o.component.vScrollBar.addEventListener("pointerup",(()=>{i.fastScrolling=!1,o.table.eventManager.isDraging=!1,i.interactionState===IC.scrolling&&i.updateInteractionState(IC.default)})),o.component.vScrollBar.addEventListener("pointerupoutside",(()=>{i.fastScrolling=!1,i.interactionState===IC.scrolling&&i.updateInteractionState(IC.default)})),o.component.vScrollBar.addEventListener("scrollUp",(t=>{o.table.eventManager.isDraging=!1})),o.component.hScrollBar.addEventListener("pointermove",(t=>{o.table.stateManager.updateCursor("default"),t.stopPropagation()})),o.component.hScrollBar.addEventListener("pointerdown",(t=>{t.stopPropagation(),o.table.hasListeners(Xw.MOUSEDOWN_TABLE)&&o.table.fireListeners(Xw.MOUSEDOWN_TABLE,{event:t.nativeEvent})})),o.component.hScrollBar.addEventListener("scrollDown",(t=>{var e;o.table.eventManager.LastBodyPointerXY={x:t.x,y:t.y},o.table.eventManager.isDown=!0,i.interactionState!==IC.scrolling&&i.updateInteractionState(IC.scrolling),o.table.stateManager.hideMenu(),null===(e=o.table.editorManager)||void 0===e||e.completeEdit(),o.table.hasListeners(Xw.MOUSEDOWN_TABLE)&&o.table.fireListeners(Xw.MOUSEDOWN_TABLE,{event:t.nativeEvent})})),o.component.hScrollBar.addEventListener("pointerup",(()=>{i.fastScrolling=!1,o.table.eventManager.isDraging=!1,i.interactionState===IC.scrolling&&i.updateInteractionState(IC.default)})),o.component.hScrollBar.addEventListener("pointerupoutside",(()=>{i.fastScrolling=!1,i.interactionState===IC.scrolling&&i.updateInteractionState(IC.default)})),o.component.hScrollBar.addEventListener("scrollUp",(t=>{o.table.eventManager.isDraging=!1}));const n=pw(i.updateVerticalScrollBar,20),r=pw(i.updateHorizontalScrollBar,20);o.component.vScrollBar.addEventListener("scrollDrag",(t=>{o.table.eventManager.isDown&&(o.table.eventManager.isDraging=!0),i.fastScrolling=!0,i.interactionState!==IC.scrolling&&i.updateInteractionState(IC.scrolling);const e=t.detail.value[0]/(1-t.detail.value[1]+t.detail.value[0]);n(e,t)})),o.component.hScrollBar.addEventListener("scrollDrag",(t=>{o.table.eventManager.isDown&&(o.table.eventManager.isDraging=!0),i.fastScrolling=!0,i.interactionState!==IC.scrolling&&i.updateInteractionState(IC.scrolling);const e=t.detail.value[0]/(1-t.detail.value[1]+t.detail.value[0]);r(e)}))}(this),function(t){const e=t.table,i=e.stateManager,o=e.scenegraph;t.touchMovePoints=[],e.scenegraph.tableGroup.addEventListener("touchstart",(e=>{e.target.isChildOf(o.component.vScrollBar)||e.target.isChildOf(o.component.vScrollBar)||(t.isTouchdown=!0,t.touchMovePoints.push({x:e.page.x,y:e.page.y,timestamp:Date.now()}))}));const n=o=>{var n,r;if(t.touchMove&&o.preventDefault(),t.isTouchdown&&qM(o))if((null===(r=null===(n=t.downIcon)||void 0===n?void 0:n.attribute)||void 0===r?void 0:r.funcType)===VC.dragReorder)o.preventDefault();else if(t.touchMovePoints.length>4&&t.touchMovePoints.shift(),t.touchMovePoints.push({x:o.changedTouches[0].pageX,y:o.changedTouches[0].pageY,timestamp:Date.now()}),t._enableTableScroll){const n=-t.touchMovePoints[t.touchMovePoints.length-1].x+t.touchMovePoints[t.touchMovePoints.length-2].x,r=-t.touchMovePoints[t.touchMovePoints.length-1].y+t.touchMovePoints[t.touchMovePoints.length-2].y;WM({deltaX:n,deltaY:r},i),o.cancelable&&("none"===e.internalProps.overscrollBehavior||Math.abs(r)>=Math.abs(n)&&0!==r&&NM(r,i)||Math.abs(r)<=Math.abs(n)&&0!==n&&GM(n,i))&&o.preventDefault()}};window.addEventListener("touchmove",n,{passive:!1}),t.globalEventListeners.push({name:"touchmove",env:"window",callback:n});const r=i=>{var o,n,r,s;if(t.touchEnd=!0,t.touchMove=!1,t.isTouchdown&&qM(i)){if((null===(n=null===(o=t.downIcon)||void 0===o?void 0:o.attribute)||void 0===n?void 0:n.funcType)===VC.dragReorder)i.preventDefault();else if((null===(r=t.touchMovePoints)||void 0===r?void 0:r.length)&&(t.touchMovePoints.length>4&&t.touchMovePoints.shift(),t.touchMovePoints.push({x:i.changedTouches[0].pageX,y:i.changedTouches[0].pageY,timestamp:Date.now()}),t._enableTableScroll)){const i=t.touchMovePoints[0],o=t.touchMovePoints[(null===(s=t.touchMovePoints)||void 0===s?void 0:s.length)-1],n=(o.x-i.x)/(o.timestamp-i.timestamp),r=(o.y-i.y)/(o.timestamp-i.timestamp);t.inertiaScroll.startInertia(n,r,.95),e.eventManager.inertiaScroll.setScrollHandle(((t,i)=>{WM({deltaX:-t,deltaY:-i},e.stateManager)}))}t.isTouchdown=!1,t.touchMovePoints=[]}};window.addEventListener("touchend",r),t.globalEventListeners.push({name:"touchend",env:"window",callback:r});const s=e=>{t.touchEnd=!0,t.touchMove=!1,t.isTouchdown&&(t.isTouchdown=!1,t.touchMovePoints=[])};window.addEventListener("touchcancel",s),t.globalEventListeners.push({name:"touchcancel",env:"window",callback:s})}(this),UM(this)}updateEventBinder(){setTimeout((()=>{var t;this.table.isReleased||(NR(this.table)&&0===(null===(t=this.handleTextStickBindId)||void 0===t?void 0:t.length)?(this.handleTextStickBindId.push(this.table.on(Xw.SCROLL,(t=>{zR(this.table)}))),this.handleTextStickBindId.push(this.table.on(Xw.RESIZE_COLUMN_END,(t=>{zR(this.table)}))),this.handleTextStickBindId.push(this.table.on(Xw.RESIZE_ROW_END,(t=>{zR(this.table)})))):!NR(this.table)&&this.handleTextStickBindId&&(this.handleTextStickBindId.forEach((t=>{this.table.off(t)})),this.handleTextStickBindId=[]),DM(this.table))}),0)}bindSelfEvent(){if(this.table.isReleased)return;const t=this.table.stateManager;var e;this.table.on(Xw.ICON_CLICK,(e=>{var i;const{col:o,row:n,x:r,y:s,funcType:l,icon:a,event:h}=e;if(l===VC.dropDown)t.triggerDropDownMenu(o,n,r,s,h);else if(l===VC.sort)t.triggerSort(o,n,a,h);else if(l===VC.frozen)t.triggerFreeze(o,n,a);else if(l===VC.drillDown)(d=this.table).fireListeners(HM.DRILLMENU_CLICK,d.stateManager.drill);else if(l===VC.collapse||l===VC.expand){const e=!!(null===(i=t.select.ranges)||void 0===i?void 0:i.length);t.updateSelectPos(-1,-1),t.endSelectCells(!0,e),this.table.toggleHierarchyState(o,n)}var d})),this.table.on(Xw.DROPDOWN_MENU_CLICK,(()=>{t.hideMenu()})),this.updateEventBinder(),e=this.table,"browser"===sw.mode&&e.on(Xw.CLICK_CELL,(t=>{const{col:i,row:o}=t;if("image"===t.target.type&&t.target.role&&t.target.role.startsWith("icon"))return;let n;n=e.internalProps.layoutMap.isHeader(i,o)?e.isPivotTable()?e._getHeaderLayoutMap(i,o).headerType:e.getHeaderDefine(i,o).headerType:e.getBodyColumnType(i,o);const r=e.isHeader(i,o)?e.getHeaderDefine(i,o):e.getBodyColumnDefine(i,o),s=e.getCellValue(i,o),l=e.getCellOriginValue(i,o);if("link"===n){if(!1===r.linkJump)return;const t=r.templateLink,n=!1!==r.linkDetect;let a;if(t){const n=e.getCellOriginRecord(i,o),r=Object.assign({__value:s,__dataValue:l},n),h=/\{\s*(\S+?)\s*\}/g;a=t.replace(h,((t,e)=>r[e]))}else if(n){if(!hx.test(s))return;a=s}else a=s;const h=r.linkTarget,d=r.linkWindowFeatures;window.open(a,h,d)}else if("image"===n){const{clickToPreview:t}=r;if(!1===t)return;const e=document.createElement("div");e.style.width="100%",e.style.height="100%",e.style.position="absolute",e.style.top="0",e.style.left="0",e.style.backgroundColor="rgba(30, 30, 30, 0.4)",e.style.display="flex",e.style.justifyContent="center",e.style.alignItems="center",e.style.overflow="hidden",e.style.zIndex="9999",e.addEventListener("click",(t=>{t.target===e&&document.body.removeChild(e)}));const i=new Image;i.src=s,i.style.maxWidth="80%",i.style.maxHeight="80%",e.appendChild(i),document.body.appendChild(e)}else if("video"===n){const{clickToPreview:t}=r;if(!1===t)return;const e=document.createElement("div");e.style.width="100%",e.style.height="100%",e.style.position="absolute",e.style.top="0",e.style.left="0",e.style.backgroundColor="rgba(30, 30, 30, 0.4)",e.style.display="flex",e.style.justifyContent="center",e.style.alignItems="center",e.style.overflow="hidden",e.style.zIndex="9999",e.addEventListener("click",(t=>{t.target===e&&document.body.removeChild(e)}));const i=document.createElement("video");i.src=s,i.style.maxWidth="80%",i.style.maxHeight="80%",i.setAttribute("preload","auto"),i.setAttribute("controls","true"),e.appendChild(i),document.body.appendChild(e)}})),this.table.on(Xw.DBLCLICK_CELL,(t=>{var e;if(t.federatedEvent){const i=Y_(t.federatedEvent),o=this.table.scenegraph.getResizeColAt(i.abstractPos.x,i.abstractPos.y,null===(e=i.eventArgs)||void 0===e?void 0:e.targetCell);if(this.table.eventManager.checkCellFillhandle(i))this.table.fireListeners(Xw.DBLCLICK_FILL_HANDLE,{});else if(this.table._canResizeColumn(o.col,o.row)&&o.col>=0){this.table.scenegraph.updateAutoColWidth(o.col),this.table.internalProps._widthResizedColMap.add(o.col),this.table.scenegraph.updateChartSizeForResizeColWidth(o.col);const t=this.table.stateManager;t.columnResize.col<t.table.frozenColCount&&!t.table.isPivotTable()&&!t.table.transpose&&t.table.scenegraph.component.setFrozenColumnShadow(t.table.frozenColCount-1,t.columnResize.isRightFrozen);const e=[];for(let t=0;t<this.table.colCount;t++)e.push(this.table.getColWidth(t));this.table.fireListeners(Xw.RESIZE_COLUMN_END,{col:o.col,colWidths:e})}}})),this.table.isPivotTable()&&function(t){const e=t.internalProps.layoutMap.rowsDefine,i=t.internalProps.layoutMap.columnsDefine;for(let t=0;t<e.length;t++){const i=e[t];if("string"!=typeof i&&(i.drillDown||i.drillUp))return!0}for(let t=0;t<i.length;t++){const e=i[t];if("string"!=typeof e&&(e.drillDown||e.drillUp))return!0}return!1}(this.table)&&function(t){t.on(Xw.MOUSEENTER_CELL,(e=>{const{col:i,row:o}=e;if(-1===i||-1===o)return;const n=t.internalProps.layoutMap.getHeaderDimension(i,o);(null==n?void 0:n.drillDown)||(null==n?void 0:n.drillUp)?t.stateManager.updateDrillState(n.dimensionKey,n.title,n.drillDown,n.drillUp,i,o):t.stateManager.updateDrillState(void 0,void 0,!1,!1,-1,-1)})),t.on(Xw.MOUSELEAVE_TABLE,(e=>{t.stateManager.updateDrillState(void 0,void 0,!1,!1,-1,-1)}))}(this.table),DM(this.table),function(t){t.isPivotChart()&&t.scenegraph.tableGroup.addEventListener("click",(e=>{var i;if(!t.stateManager.columnMove.moving&&!t.stateManager.columnResize.resizing)if("axis-label"===e.target.name){const i=Y_(e),{col:o,row:n}=i.eventArgs,r=t.internalProps.layoutMap;let s,l;r.indicatorsAsCol?(s=r.getDimensionKeyInChartSpec(r.rowHeaderLevelCount,n),l=r.getCellHeaderPaths(r.rowHeaderLevelCount-2,n).rowHeaderPaths):(s=r.getDimensionKeyInChartSpec(o,r.columnHeaderLevelCount),l=r.getCellHeaderPaths(o,r.columnHeaderLevelCount-1).colHeaderPaths);const a=l.map((t=>({key:t.dimensionKey,value:t.value}))).filter((t=>t.key));if(a.push({key:s,value:e.target.attribute.text}),t._selectedDimensionInChart.length&&function(t,e){if(t.length!==e.length)return!1;for(let i=0;i<t.length;i++)if(t[i].key!==e[i].key||t[i].value!==e[i].value)return!1;return!0}(t._selectedDimensionInChart,a))return;t._selectedDimensionInChart=a,r.updateDataStateToChartInstance(),uM(t.scenegraph),t.scenegraph.updateNextFrame()}else(null===(i=t._selectedDimensionInChart)||void 0===i?void 0:i.length)&&(t._selectedDimensionInChart.length=0,t.internalProps.layoutMap.updateDataStateToChartInstance(),uM(t.scenegraph),t.scenegraph.updateNextFrame())}))}(this.table),function(t){t.isPivotChart()&&(t.on(Xw.MOUSEENTER_CELL,(e=>{t.scenegraph.getCell(e.col,e.row).forEachChildren((i=>{if("axis"===i.name){const i=ZM(e.col,e.row,t.internalProps.layoutMap);e.axisPosition=i,t.fireListeners(Xw.MOUSEENTER_AXIS,e)}}))})),t.on(Xw.MOUSELEAVE_CELL,(e=>{t.scenegraph.getCell(e.col,e.row).forEachChildren((i=>{if("axis"===i.name){const i=ZM(e.col,e.row,t.internalProps.layoutMap);e.axisPosition=i,t.fireListeners(Xw.MOUSELEAVE_AXIS,e)}}))})))}(this.table)}dealTableHover(t){if(!t)return void this.table.stateManager.updateHoverPos(-1,-1);const{eventArgs:e}=t;e?this.table.stateManager.updateHoverPos(e.col,e.row):this.table.stateManager.updateHoverPos(-1,-1)}dealIconHover(t){const{eventArgs:e}=t;e?this.table.stateManager.updateHoverIcon(e.col,e.row,e.target,e.targetCell):this.table.stateManager.updateHoverIcon(-1,-1,void 0,void 0)}dealMenuHover(t){}dealTableSelect(t,e){var i,o,n;if(!t)return this.table.stateManager.updateSelectPos(-1,-1),!1;const{eventArgs:r}=t;if(r){if("checkbox"===r.target.name||"radio"===r.target.name)return!1;const s=this.table.getBodyColumnDefine(r.col,r.row);return this.table.isHeader(r.col,r.row)&&((null==s?void 0:s.disableHeaderSelect)||(null===(i=this.table.stateManager.select)||void 0===i?void 0:i.disableHeader))||!this.table.isHeader(r.col,r.row)&&(null==s?void 0:s.disableSelect)?(e||this.table.stateManager.updateSelectPos(-1,-1),!1):!this.table.isPivotChart()||"axis-label"!==(null===(o=null==t?void 0:t.eventArgs)||void 0===o?void 0:o.target.name)&&"chart"!==(null===(n=null==t?void 0:t.eventArgs)||void 0===n?void 0:n.target.type)?(this.table.stateManager.updateSelectPos(r.col,r.row,r.event.shiftKey,r.event.ctrlKey||r.event.metaKey,!1,e),!0):(this.table.stateManager.updateSelectPos(-1,-1),!1)}return!1}dealFillSelect(t,e){var i,o;const{eventArgs:n}=t;if(n){if((null===(o=null===(i=this.table.stateManager.select)||void 0===i?void 0:i.ranges)||void 0===o?void 0:o.length)&&this.table.stateManager.isFillHandle()){let i,o;const r=this.table.stateManager.select.ranges[this.table.stateManager.select.ranges.length-1];e&&(Q(this.table.stateManager.fillHandle.directionRow)||(Math.abs(this.table.stateManager.fillHandle.startY-t.abstractPos.y)>=Math.abs(this.table.stateManager.fillHandle.startX-t.abstractPos.x)?this.table.stateManager.fillHandle.directionRow=!0:this.table.stateManager.fillHandle.directionRow=!1),Math.abs(this.table.stateManager.fillHandle.startY-t.abstractPos.y)>=Math.abs(this.table.stateManager.fillHandle.startX-t.abstractPos.x)?this.table.stateManager.fillHandle.startY-t.abstractPos.y>0?this.table.stateManager.fillHandle.direction="top":this.table.stateManager.fillHandle.direction="bottom":this.table.stateManager.fillHandle.startX-t.abstractPos.x>0?this.table.stateManager.fillHandle.direction="left":this.table.stateManager.fillHandle.direction="right",this.table.stateManager.fillHandle.directionRow?(i=n.row,o=r.end.col):(i=r.end.row,o=n.col)),this.table.stateManager.updateSelectPos(e?o:r.end.col,e?i:r.end.row,!0,n.event.ctrlKey||n.event.metaKey,!1,e)}else this.table.stateManager.updateSelectPos(n.col,n.row,n.event.shiftKey,n.event.ctrlKey||n.event.metaKey,!1,e);return!0}return!1}deelTableSelectAll(){this.table.stateManager.updateSelectPos(-1,-1,!1,!1,!0),this.table.fireListeners(Xw.SELECTED_CELL,{ranges:this.table.stateManager.select.ranges,col:0,row:0})}dealMenuSelect(t){}checkColumnResize(t,e){const{eventArgs:i}=t;if(this.table.options.enableTreeStickCell&&!i)return!1;const o=this.table.scenegraph.getResizeColAt(t.abstractPos.x,t.abstractPos.y,null==i?void 0:i.targetCell);return!!(this.table._canResizeColumn(o.col,o.row)&&o.col>=0)&&(e&&this.table.stateManager.startResizeCol(o.col,t.abstractPos.x,t.abstractPos.y,o.rightFrozen),!0)}checkRowResize(t,e){const{eventArgs:i}=t;if(i){const o=this.table.scenegraph.getResizeRowAt(t.abstractPos.x,t.abstractPos.y,i.targetCell);if(this.table._canResizeRow(o.col,o.row)&&o.row>=0)return e&&this.table.stateManager.startResizeRow(o.row,t.abstractPos.x,t.abstractPos.y,o.bottomFrozen),!0}return!1}checkCellFillhandle(t,e){var i,o,n,r;if(null===(i=this.table.options.excelOptions)||void 0===i?void 0:i.fillHandle){const{eventArgs:i}=t;if(i&&(null===(n=null===(o=this.table.stateManager.select)||void 0===o?void 0:o.ranges)||void 0===n?void 0:n.length)){const i=Math.max(this.table.stateManager.select.ranges[this.table.stateManager.select.ranges.length-1].start.col,this.table.stateManager.select.ranges[this.table.stateManager.select.ranges.length-1].end.col),o=Math.max(this.table.stateManager.select.ranges[this.table.stateManager.select.ranges.length-1].start.row,this.table.stateManager.select.ranges[this.table.stateManager.select.ranges.length-1].end.row),n=this.table.scenegraph.highPerformanceGetCell(i,o).globalAABBBounds,s=Math.abs(t.abstractPos.x-n.x2),l=Math.abs(t.abstractPos.y-n.y2),a=18;if((null===(r=this.table.stateManager.fillHandle)||void 0===r?void 0:r.isFilling)||s<=a/2&&l<=a/2)return e&&this.table.stateManager.startFillSelect(t.abstractPos.x,t.abstractPos.y),!0}}return!1}dealColumnResize(t,e){this.table.stateManager.updateResizeCol(t,e)}dealRowResize(t,e){this.table.stateManager.updateResizeRow(t,e)}chechColumnMover(t){var e,i,o;const{eventArgs:n}=t;return!!(n&&this.table.isHeader(n.col,n.row)&&(function(t,e,i){for(let o=0;o<i.length;o++)if(Ow(i[o],t,e))return!0;return!1}(n.col,n.row,this.table.stateManager.select.ranges)||(null===(e=this.table.options.select)||void 0===e?void 0:e.disableHeaderSelect)||(null===(i=this.table.options.select)||void 0===i?void 0:i.disableSelect))&&this.table._canDragHeaderPosition(n.col,n.row))&&(this.table.stateManager.startMoveCol(n.col,n.row,t.abstractPos.x,t.abstractPos.y,null===(o=null==n?void 0:n.event)||void 0===o?void 0:o.nativeEvent),!0)}dealColumnMover(t){const{eventArgs:e}=t;Q(e.col)&&Q(e.row)&&this.table.stateManager.updateMoveCol(e.col,e.row,t.abstractPos.x,t.abstractPos.y)}startColumnResize(t){}dealIconClick(t,e){const{eventArgs:i}=e,{target:o,event:n,col:r,row:s}=i||{target:t.target,event:t,col:-1,row:-1},l=o;if(l.role&&l.role.startsWith("icon-"))return this.table.fireListeners(Xw.ICON_CLICK,{name:l.name,x:(l.globalAABBBounds.x1+l.globalAABBBounds.x2)/2,y:l.globalAABBBounds.y2,col:r,row:s,funcType:l.attribute.funcType,icon:l,event:n}),!0;if(o instanceof vc){const t=o.pickIcon(n.global);if(t)return this.table.fireListeners(Xw.ICON_CLICK,{name:t.attribute.id,x:t.globalX+t.globalAABBBounds.width()/2,y:t.globalY+t.AABBBounds.height(),col:r,row:s,funcType:t.attribute.funcType,icon:t,event:n}),!0}return!1}release(){this.gesture.release(),this.globalEventListeners.forEach((t=>{"document"===t.env?document.removeEventListener(t.name,t.callback):"body"===t.env?document.body.removeEventListener(t.name,t.callback):"window"===t.env&&window.removeEventListener(t.name,t.callback)})),this.globalEventListeners=[]}enableScroll(){this._enableTableScroll=!0}disableScroll(){this._enableTableScroll=!1}}(this),this.animationManager=new ak(this),e.legends){Y.legends=[];const t=Tx.getFunction("createLegend");if(Array.isArray(e.legends)){for(let i=0;i<e.legends.length;i++)Y.legends.push(t(e.legends[i],this));this.scenegraph.tableGroup.setAttributes({x:this.tableX,y:this.tableY})}else Y.legends.push(t(e.legends,this)),this.scenegraph.tableGroup.setAttributes({x:this.tableX,y:this.tableY})}if(Y.tooltip=Object.assign({parentElement:this.getElement(),renderMode:"html",isShowOverflowTextTooltip:!1,confine:!0},e.tooltip),"html"===Y.tooltip.renderMode){const t=Tx.getComponent("tooltipHandler");t&&(Y.tooltipHandler=new t(this,Y.tooltip.confine))}if(Y.menu=Object.assign({renderMode:"html"},e.menu),Array.isArray(null===(l=e.menu)||void 0===l?void 0:l.dropDownMenuHighlight)&&this.setDropDownMenuHighlight(null===(a=e.menu)||void 0===a?void 0:a.dropDownMenuHighlight),Array.isArray(null===(h=e.menu)||void 0===h?void 0:h.defaultHeaderMenuItems)&&(this.globalDropDownMenu=e.menu.defaultHeaderMenuItems),"html"===Y.menu.renderMode){const t=Tx.getComponent("menuHandler");Y.menuHandler=new t(this)}this.headerStyleCache=new Map,this.bodyStyleCache=new Map,this.bodyMergeTitleCache=new Map,this.bodyBottomStyleCache=new Map,Y.stick={changedCells:new Map},Y.customMergeCell=e.customMergeCell,this.customCellStylePlugin=new zT(this,null!==(d=e.customCellStyle)&&void 0!==d?d:[],null!==(c=e.customCellStyleArrangement)&&void 0!==c?c:[])}getContainer(){return this.container}getElement(){return this.internalProps.element}get canvas(){return this.internalProps.canvas}setCanvasSize(t,e){this.canvasWidth=t,this.canvasHeight=e,this.options.canvasHeight=e,this.options.canvasWidth=t,this.resize()}resize(){var t;this._updateSize(),null===(t=this.internalProps.legends)||void 0===t||t.forEach((t=>{null==t||t.resize()})),this.internalProps.title&&this.internalProps.title.resize(),this.internalProps.emptyTip&&this.internalProps.emptyTip.resize(),this.scenegraph.resize()}get rowCount(){return this.internalProps.rowCount}set rowCount(t){this.internalProps.rowCount=t}get colCount(){var t;return null!==(t=this.internalProps.colCount)&&void 0!==t?t:0}set colCount(t){this.internalProps.colCount=t}get frozenColCount(){var t,e,i,o,n;return null!==(n=null!==(i=null===(e=null===(t=this.internalProps)||void 0===t?void 0:t.layoutMap)||void 0===e?void 0:e.frozenColCount)&&void 0!==i?i:null===(o=this.internalProps)||void 0===o?void 0:o.frozenColCount)&&void 0!==n?n:0}set frozenColCount(t){t>=this.colCount&&(t=0),this.internalProps.frozenColCount=t,this.options.frozenColCount=t,this.tableNoFrameWidth-this.getColsWidth(0,t-1)<=120&&(this.internalProps.frozenColCount=0),this.stateManager.setFrozenCol(this.internalProps.frozenColCount)}setFrozenColCount(t){t>=this.colCount&&(t=0),this.internalProps.frozenColCount=t,this.options.frozenColCount=t,this.tableNoFrameWidth-this.getColsWidth(0,t-1)<=120&&(this.internalProps.frozenColCount=0),this.stateManager.setFrozenCol(this.internalProps.frozenColCount)}_setFrozenColCount(t){t>=this.colCount&&(t=0),this.internalProps.frozenColCount=t}_resetFrozenColCount(){this.options.frozenColCount&&(this.tableNoFrameWidth-this.getColsWidth(0,this.options.frozenColCount-1)<=120?this._setFrozenColCount(0):this.frozenColCount!==this.options.frozenColCount&&this._setFrozenColCount(this.options.frozenColCount))}get frozenRowCount(){var t,e,i,o,n;return null!==(n=null!==(i=null===(e=null===(t=this.internalProps)||void 0===t?void 0:t.layoutMap)||void 0===e?void 0:e.frozenRowCount)&&void 0!==i?i:null===(o=this.internalProps)||void 0===o?void 0:o.frozenRowCount)&&void 0!==n?n:0}set frozenRowCount(t){this.internalProps.frozenRowCount=t}get rightFrozenColCount(){var t,e,i,o,n;return null!==(n=null!==(i=null===(e=null===(t=this.internalProps)||void 0===t?void 0:t.layoutMap)||void 0===e?void 0:e.rightFrozenColCount)&&void 0!==i?i:null===(o=this.internalProps)||void 0===o?void 0:o.rightFrozenColCount)&&void 0!==n?n:0}set rightFrozenColCount(t){this.scenegraph.dealWidthRightFrozen(t)}get bottomFrozenRowCount(){var t,e,i,o,n;return null!==(n=null!==(i=null===(e=null===(t=this.internalProps)||void 0===t?void 0:t.layoutMap)||void 0===e?void 0:e.bottomFrozenRowCount)&&void 0!==i?i:null===(o=this.internalProps)||void 0===o?void 0:o.bottomFrozenRowCount)&&void 0!==n?n:0}set bottomFrozenRowCount(t){this.scenegraph.dealWidthBottomFrozen(t)}get defaultRowHeight(){return this.internalProps.defaultRowHeight}set defaultRowHeight(t){this.internalProps.defaultRowHeight=t,this.options.defaultRowHeight=t}get defaultHeaderRowHeight(){return this.internalProps.defaultHeaderRowHeight}set defaultHeaderRowHeight(t){this.internalProps.defaultHeaderRowHeight=t,this.options.defaultHeaderRowHeight=t}get defaultColWidth(){return this.internalProps.defaultColWidth}set defaultColWidth(t){this.internalProps.defaultColWidth=t,this.options.defaultColWidth=t}get defaultHeaderColWidth(){return this.internalProps.defaultHeaderColWidth}set defaultHeaderColWidth(t){this.internalProps.defaultHeaderColWidth=t,this.options.defaultHeaderColWidth=t}get colWidthsMap(){return this.internalProps._colWidthsMap}set colWidthsMap(t){this.internalProps._colWidthsMap=t}get colContentWidthsMap(){return this.internalProps._colContentWidthsMap}set colContentWidthsMap(t){this.internalProps._colContentWidthsMap=t}get _colRangeWidthsMap(){return this.internalProps._colRangeWidthsMap}set _colRangeWidthsMap(t){this.internalProps._colRangeWidthsMap=t}get _rowRangeHeightsMap(){return this.internalProps._rowRangeHeightsMap}set _rowRangeHeightsMap(t){this.internalProps._rowRangeHeightsMap=t}get rowHeightsMap(){return this.internalProps._rowHeightsMap}set rowHeightsMap(t){this.internalProps._rowHeightsMap=t}get colWidthsLimit(){return this.internalProps._colWidthsLimit}set colWidthsLimit(t){this.internalProps._colWidthsLimit=t}get keyboardOptions(){var t;return null!==(t=this.internalProps.keyboardOptions)&&void 0!==t?t:null}set keyboardOptions(t){this.internalProps.keyboardOptions=null!=t?t:void 0}get eventOptions(){var t;return null!==(t=this.internalProps.eventOptions)&&void 0!==t?t:null}set eventOptions(t){this.internalProps.eventOptions=null!=t?t:void 0}get widthMode(){return this._widthMode}set widthMode(t){t!==this._widthMode&&(this._widthMode=t,this.options.widthMode=t)}get heightMode(){return this._heightMode}set heightMode(t){t!==this._heightMode&&(this._heightMode=t,this.options.heightMode=t)}get autoFillWidth(){return this._autoFillWidth}set autoFillWidth(t){t!==this._autoFillWidth&&(this._autoFillWidth=t)}get autoFillHeight(){return this._autoFillHeight}set autoFillHeight(t){t!==this._autoFillHeight&&(this._autoFillHeight=t)}get widthAdaptiveMode(){return this._widthAdaptiveMode}set widthAdaptiveMode(t){t!==this._widthAdaptiveMode&&(this._widthAdaptiveMode=t)}get heightAdaptiveMode(){return this._heightAdaptiveMode}set heightAdaptiveMode(t){t!==this._heightAdaptiveMode&&(this._heightAdaptiveMode=t)}_colWidthDefineToPxWidth(t){return"auto"===t?0:N_(this,t)}_getColWidthLimits(t){const e=this.colWidthsLimit[t];if(!e)return null;const i={};return e.min&&(i.min=N_(this,e.min),i.minDef=e.min),e.max&&(i.max=N_(this,e.max),i.maxDef=e.max),i}_adjustColWidth(t,e){const i=this._getColWidthLimits(t);return Math.max(function(t,e){return t?t.min&&t.min>e?t.min:t.max&&t.max<e?t.max:e:e}(i,e),0)}setPixelRatio(t){if(t!==this.internalProps.pixelRatio){this.internalProps.pixelRatio=t;const e=this.options.canvasWidth;this.internalProps.calcWidthContext={_:this.internalProps,get full(){var i;return"node"===sw.mode?e/(null!=t?t:1):this._.canvas.width/(null!==(i=this._.context.pixelRatio)&&void 0!==i?i:window.devicePixelRatio)}},this.scenegraph.setPixelRatio(t)}}_updateSize(){var t,e,i,o,n,r,s,l,a,h,d,c,u,g,p,f,v,m,b,y,C,w,x,_,S,A;const{padding:B}=this;let R=0,M=0;if(this.tableX=0,this.tableY=0,this.options.canvas&&this.options.viewBox)R=this.options.viewBox.x2-this.options.viewBox.x1,M=this.options.viewBox.y2-this.options.viewBox.y1,(null===(t=null==this?void 0:this.scenegraph)||void 0===t?void 0:t.stage)&&(this.options.viewBox?this.scenegraph.stage.setViewBox(this.options.viewBox,!1):this.scenegraph.stage.resize(R,M));else if("browser"===sw.mode){const t=this.getElement();let s=0,l=0;if(this.canvasSizeSeted)s=this.canvasWidth,l=this.canvasHeight;else if(t.parentElement){const e=t.parentElement.style||window.getComputedStyle(t.parentElement);s=t.parentElement.offsetWidth-parseInt(e.paddingLeft||"0px",10)-parseInt(e.paddingRight||"0px",10),l=t.parentElement.offsetHeight-parseInt(e.paddingTop||"0px",10)-parseInt(e.paddingBottom||"0px",20)}const a=null!=s?s:0,h=null!=l?l:0;t.style.width=a&&a-B.left-B.right+"px"||"0px",t.style.height=h&&h-B.top-B.bottom+"px"||"0px";const{canvas:d}=this.internalProps;R=null!==(i=null===(e=d.parentElement)||void 0===e?void 0:e.offsetWidth)&&void 0!==i?i:0,M=null!==(n=null===(o=d.parentElement)||void 0===o?void 0:o.offsetHeight)&&void 0!==n?n:0,(null===(r=null==this?void 0:this.scenegraph)||void 0===r?void 0:r.stage)?this.scenegraph.stage.resize(R,M):(d.style.width="",d.style.height="",d.width=R,d.height=M,d.style.width=`${R}px`,d.style.height=`${M}px`)}else"node"===sw.mode&&(R=this.canvasWidth-1,M=this.canvasHeight-1);const T=Math.floor(R-function(t){var e;return(null==t?void 0:t.hoverOn)||(null==t?void 0:t.verticalVisible)&&"none"===(null==t?void 0:t.verticalVisible)||!(null==t?void 0:t.verticalVisible)&&"none"===(null==t?void 0:t.visible)?0:null!==(e=null==t?void 0:t.width)&&void 0!==e?e:7}(this.getTheme().scrollStyle)),k=Math.floor(M-function(t){var e;return(null==t?void 0:t.hoverOn)||(null==t?void 0:t.horizontalVisible)&&"none"===(null==t?void 0:t.horizontalVisible)||!(null==t?void 0:t.horizontalVisible)&&"none"===(null==t?void 0:t.visible)?0:null!==(e=null==t?void 0:t.width)&&void 0!==e?e:7}(this.getTheme().scrollStyle));if(null===(s=this.internalProps.theme)||void 0===s?void 0:s.frameStyle){const t=hk(null!==(a=null===(l=this.internalProps.theme.frameStyle)||void 0===l?void 0:l.borderLineWidth)&&void 0!==a?a:[null]),e=hk(null!==(d=null===(h=this.internalProps.theme.frameStyle)||void 0===h?void 0:h.shadowBlur)&&void 0!==d?d:[0]);(null===(c=this.theme.frameStyle)||void 0===c?void 0:c.innerBorder)?(this.tableX=0,this.tableY=0,this.tableNoFrameWidth=T-(null!==(u=e[1])&&void 0!==u?u:0),this.tableNoFrameHeight=k-(null!==(g=e[2])&&void 0!==g?g:0)):(this.tableX=(null!==(p=t[3])&&void 0!==p?p:0)+(null!==(f=e[3])&&void 0!==f?f:0),this.tableY=(null!==(v=t[0])&&void 0!==v?v:0)+(null!==(m=e[0])&&void 0!==m?m:0),this.tableNoFrameWidth=T-((null!==(b=t[1])&&void 0!==b?b:0)+(null!==(y=e[1])&&void 0!==y?y:0))-((null!==(C=t[3])&&void 0!==C?C:0)+(null!==(w=e[3])&&void 0!==w?w:0)),this.tableNoFrameHeight=k-((null!==(x=t[0])&&void 0!==x?x:0)+(null!==(_=e[0])&&void 0!==_?_:0))-((null!==(S=t[2])&&void 0!==S?S:0)+(null!==(A=e[2])&&void 0!==A?A:0)))}}updateViewBox(t){var e,i,o,n,r,s,l,a;const h=null!==(n=null!==(i=null===(e=this.options)||void 0===e?void 0:e.viewBox.x2)&&void 0!==i?i:0-(null===(o=this.options)||void 0===o?void 0:o.viewBox.x1))&&void 0!==n?n:0,d=null!==(a=null!==(s=null===(r=this.options)||void 0===r?void 0:r.viewBox.y2)&&void 0!==s?s:0-(null===(l=this.options)||void 0===l?void 0:l.viewBox.y1))&&void 0!==a?a:0,c=t.x2-t.x1,u=t.y2-t.y1;this.options.viewBox=t,h!==c||d!==u?this.resize():this.scenegraph.stage.setViewBox(this.options.viewBox,!0)}setViewBoxTransform(t,e,i,o,n,r){this.internalProps.modifiedViewBoxTransform=!0,this.scenegraph.stage.window.setViewBoxTransform(t,e,i,o,n,r)}get rowHierarchyType(){return"grid"}getColsWidth(t,e){var i;if(t>e)return 0;t=Math.max(t,0),e=Math.min(e,(null!==(i=this.colCount)&&void 0!==i?i:1/0)-1);const o=this._colRangeWidthsMap.get(`$${t}$${e}`);if(null!=o)return o;const n=this._colRangeWidthsMap.get(`$${t}$${e-1}`);if(null!=n){const i=n+this.getColWidth(e);return t>=0&&e>=0&&!Number.isNaN(i)&&this._colRangeWidthsMap.set(`$${t}$${e}`,Math.round(i)),Math.round(i)}let r=0;for(let i=t;i<=e;i++)r+=this.getColWidth(i);return t>=0&&e>=0&&this._colRangeWidthsMap.set(`$${t}$${e}`,Math.round(r)),Math.round(r)}getRowHeight(t){var e;if(Q(this.rowHeightsMap.get(t))){if(null===(e=this.options.customConfig)||void 0===e?void 0:e._disableColumnAndRowSizeRound){const e=this.rowHeightsMap.get(t);let i;return i=t<this.frozenRowCount?this.rowHeightsMap.getSumInRange(0,t):t>=this.rowCount-this.bottomFrozenRowCount?this.rowHeightsMap.getSumInRange(t,this.rowCount-1):this.rowHeightsMap.getSumInRange(this.frozenRowCount,t),i=Number(i.toFixed(2)),Number.isInteger(i)?Math.ceil(e):Math.floor(e)}return this.rowHeightsMap.get(t)}const i=this.getDefaultRowHeight(t);return at(i)?i:this.defaultRowHeight}getDefaultColumnWidth(t){var e,i;return this.isRowHeader(t,0)||this.isCornerHeader(t,0)?Array.isArray(this.defaultHeaderColWidth)?null!==(e=this.defaultHeaderColWidth[t])&&void 0!==e?e:this.defaultColWidth:this.defaultHeaderColWidth:this.isRightFrozenColumn(t,this.columnHeaderLevelCount)&&this.isPivotTable()?Array.isArray(this.defaultHeaderColWidth)?null!==(i=this.defaultHeaderColWidth[this.rowHeaderLevelCount-this.rightFrozenColCount])&&void 0!==i?i:this.defaultColWidth:this.defaultHeaderColWidth:this.defaultColWidth}getDefaultRowHeight(t){var e,i;return this.isColumnHeader(0,t)||this.isCornerHeader(0,t)||this.isSeriesNumberInHeader(0,t)?Array.isArray(this.defaultHeaderRowHeight)?null!==(e=this.defaultHeaderRowHeight[t])&&void 0!==e?e:this.internalProps.defaultRowHeight:this.defaultHeaderRowHeight:this.isBottomFrozenRow(t)?Array.isArray(this.defaultHeaderRowHeight)?null!==(i=this.defaultHeaderRowHeight[this.columnHeaderLevelCount>0?this.columnHeaderLevelCount-this.bottomFrozenRowCount:0])&&void 0!==i?i:this.internalProps.defaultRowHeight:this.defaultHeaderRowHeight:this.internalProps.defaultRowHeight}_setRowHeight(t,e,i){var o;this.rowHeightsMap.put(t,(null===(o=this.options.customConfig)||void 0===o?void 0:o._disableColumnAndRowSizeRound)?e:Math.round(e)),i&&this._clearRowRangeHeightsMap(t)}setRowHeight(t,e){this.scenegraph.setRowHeight(t,e),this.scenegraph.updateChartSizeForResizeRowHeight(t),this.internalProps._heightResizedRowMap.add(t)}getRowsHeight(t,e){var i,o;if(t>e||0===this.rowCount)return 0;t=Math.max(t,0),e=Math.min(e,(null!==(i=this.rowCount)&&void 0!==i?i:1/0)-1);let n=0;if("standard"!==this.heightMode||this.autoFillHeight||!this.internalProps.layoutMap||this.hasAutoImageColumn()||0!==this.internalProps._heightResizedRowMap.size){if(null===(o=this.options.customConfig)||void 0===o?void 0:o._disableColumnAndRowSizeRound){const i=this.rowHeightsMap.getSumInRange(t,e);let o;return o=e<this.frozenRowCount?this.rowHeightsMap.getSumInRange(0,e):e>=this.rowCount-this.bottomFrozenRowCount?this.rowHeightsMap.getSumInRange(e,this.rowCount-1):this.rowHeightsMap.getSumInRange(this.frozenRowCount,e),o=Number(o.toFixed(2)),Number.isInteger(o)?Math.ceil(i):Math.floor(i)}n=this.rowHeightsMap.getSumInRange(t,e)}else{for(let i=t;i<Math.min(e+1,this.columnHeaderLevelCount);i++)n+=this.getRowHeight(i);e>=this.columnHeaderLevelCount&&(n+=this.defaultRowHeight*(Math.min(e,this.rowCount-this.bottomFrozenRowCount-1)-Math.max(this.columnHeaderLevelCount,t)+1));for(let t=this.rowCount-this.bottomFrozenRowCount;t<e+1;t++)n+=this.getRowHeight(t)}return Math.round(n)}getColWidthDefined(t){var e;const{layoutMap:i}=this.internalProps;if("autoWidth"===this.widthMode)return"auto";const{width:o}=null!==(e=null==i?void 0:i.getColumnWidthDefined(t))&&void 0!==e?e:{};return"number"==typeof o&&o<=0?0:o||this.getDefaultColumnWidth(t)}getColWidthDefinedNumber(t){const e=this.getColWidthDefined(t);return this._adjustColWidth(t,this._colWidthDefineToPxWidth(e))}isAutoRowHeight(t){return"autoHeight"===this.heightMode||t>=0&&t<this.columnHeaderLevelCount&&"auto"===this.getDefaultRowHeight(t)}getColWidth(t){var e;const i=null!==(e=this.colWidthsMap.get(t))&&void 0!==e?e:this.getDefaultColumnWidth(t);return"adaptive"===this.widthMode&&"number"==typeof i||this.transpose&&"number"==typeof i?this._colWidthDefineToPxWidth(i):this._adjustColWidth(t,this._colWidthDefineToPxWidth(i))}_setColWidth(t,e,i,o){this.colWidthsMap.put(t,"number"==typeof e?Math.round(e):e),i&&this._clearColRangeWidthsMap(t),o||this.stateManager.checkFrozen()}setColWidth(t,e){this.scenegraph.setColWidth(t,e),this.scenegraph.updateChartSizeForResizeColWidth(t),this.internalProps._widthResizedColMap.add(t)}_clearColRangeWidthsMap(t){if("number"!=typeof t)this._colRangeWidthsMap.clear();else{const e=this._colRangeWidthsMap.keys();for(const i of e){const e=ck.exec(i);if(e){const o=Number(e[1]),n=Number(e[2]);t>=o&&t<=n&&this._colRangeWidthsMap.delete(i)}}}}_clearRowRangeHeightsMap(t){this.rowHeightsMap.clearRange()}_getColContentWidth(t){return Number(this.colContentWidthsMap.get(t))}_setColContentWidth(t,e){this.colContentWidthsMap.put(t,e)}getAllRowsHeight(){return this.internalProps.rowCount<=0?0:this.getRowsHeight(0,this.internalProps.rowCount-1)}getAllColsWidth(){return this.internalProps.colCount<=0?0:this.getColsWidth(0,this.internalProps.colCount-1)}getMaxColWidth(t){var e;const i=this.colWidthsLimit[t];let o=null!==(e=i&&i.max)&&void 0!==e?e:1/0;return"string"==typeof o&&(o=N_(this,o)),o}setMaxColWidth(t,e){(this.colWidthsLimit[t]||(this.colWidthsLimit[t]={})).max=e}getMinColWidth(t){var e;const i=this.colWidthsLimit[t];let o=null!==(e=i&&i.min)&&void 0!==e?e:0;return"string"==typeof o&&(o=N_(this,o)),o}setMinColWidth(t,e){(this.colWidthsLimit[t]||(this.colWidthsLimit[t]={})).min=e}getCellRect(t,e){var i,o;const n=this.isFrozenCell(t,e);let r;const s=this.getColWidth(t);let l;r=n&&n.col&&this.isRightFrozenColumn(t,e)?this.getAllColsWidth()<=this.tableNoFrameWidth?this.getColsWidth(0,t-1)||0:this.tableNoFrameWidth-(null!==(i=this.getColsWidth(t,this.colCount-1))&&void 0!==i?i:0):this.getColsWidth(0,t-1)||0;const a=this.getRowHeight(e);return l=n&&n.row&&this.isBottomFrozenRow(t,e)?this.getAllRowsHeight()<=this.tableNoFrameHeight?this.getRowsHeight(0,e-1):this.tableNoFrameHeight-(null!==(o=this.getRowsHeight(e,this.rowCount-1))&&void 0!==o?o:0):this.getRowsHeight(0,e-1),new tx(Math.round(r),Math.round(l),Math.round(s),Math.round(a))}getMergeCellRect(t,e){const i=this.getCellRange(t,e),o=this.getColsWidth(0,i.start.col-1)||0,n=this.getColsWidth(i.start.col,i.end.col),r=this.getRowsHeight(0,i.start.row-1)||0,s=this.getRowsHeight(i.start.row,i.end.row);return new tx(Math.round(o),Math.round(r),Math.round(n),Math.round(s))}getCellRelativeRect(t,e){const i=this.isFrozenCell(t,e);let o=!0,n=!0;(null==i?void 0:i.col)&&(null==i?void 0:i.row)?(o=!1,n=!1):(null==i?void 0:i.col)?o=!1:(null==i?void 0:i.row)&&(n=!1);const r=this.getCellRect(t,e);return this._toRelativeRect(r,o,n)}getCellRangeRelativeRect(t){if(t.start){const e=this.isFrozenCell(t.start.col,t.start.row);let i=!0,o=!0;return(null==e?void 0:e.col)&&(null==e?void 0:e.row)?(i=!1,o=!1):(null==e?void 0:e.col)?i=!1:(null==e?void 0:e.row)&&(o=!1),this._toRelativeRect(this.getCellsRect(t.start.col,t.start.row,t.end.col,t.end.row),i,o)}const e=this.getCellRange(t.col,t.row),i=this.isFrozenCell(t.col,t.row);let o=!0,n=!0;return(null==i?void 0:i.col)&&(null==i?void 0:i.row)?(o=!1,n=!1):(null==i?void 0:i.col)?o=!1:(null==i?void 0:i.row)&&(n=!1),this._toRelativeRect(this.getCellsRect(e.start.col,e.start.row,e.end.col,e.end.row),o,n)}getVisibleCellRangeRelativeRect(t){let e;return e=t.start?t:this.getCellRange(t.col,t.row),this._getVisiableRect(this.getCellRangeRelativeRect(t),e)}_getVisiableRect(t,e){const i=e.start.col>=this.frozenColCount?Math.max(t.left,this.frozenColCount>=1?this.getColsWidth(0,this.frozenColCount-1):0):t.left,o=Math.min(t.right,this.tableNoFrameWidth),n=t.copy();n.left=i,n.right=o;const r=e.start.row>=this.frozenRowCount?Math.max(t.top,this.frozenRowCount>=1?this.getRowsHeight(0,this.frozenRowCount-1):0):t.top,s=Math.min(t.bottom,this.tableNoFrameHeight);return n.top=r,n.bottom=s,n}getCellsRect(t,e,i,o){var n,r,s,l,a,h;let d=this.getColsWidth(0,t-1)||0,c=this.getColsWidth(t,i);const u=this.scrollLeft;this.isLeftFrozenColumn(t)&&this.isRightFrozenColumn(i)?c=this.tableNoFrameWidth-(null!==(n=this.getColsWidth(t+1,this.colCount-1))&&void 0!==n?n:0)-d:this.isLeftFrozenColumn(t)&&!this.isLeftFrozenColumn(i)?c=Math.max(c-u,this.getColsWidth(t,this.frozenColCount-1)):!this.isRightFrozenColumn(t)&&this.isRightFrozenColumn(i)?(d=Math.min(d-u,this.tableNoFrameWidth-this.getRightFrozenColsWidth()),c=this.tableNoFrameWidth-(null!==(r=this.getColsWidth(t+1,this.colCount-1))&&void 0!==r?r:0)-d):this.isRightFrozenColumn(t)&&(d=this.tableNoFrameWidth-(null!==(s=this.getColsWidth(t,this.colCount-1))&&void 0!==s?s:0));let g=this.getRowsHeight(0,e-1),p=this.getRowsHeight(e,o);const f=this.scrollTop;return this.isTopFrozenRow(e)&&this.isBottomFrozenRow(o)?p=this.tableNoFrameHeight-(null!==(l=this.getRowsHeight(e+1,this.rowCount-1))&&void 0!==l?l:0)-g:this.isTopFrozenRow(e)&&!this.isTopFrozenRow(o)?p=Math.max(p-f,this.getRowsHeight(e,this.frozenRowCount-1)):!this.isBottomFrozenRow(e)&&this.isBottomFrozenRow(o)?(g=Math.min(g-f,this.tableNoFrameHeight-this.getBottomFrozenRowsHeight()),p=this.tableNoFrameHeight-(null!==(a=this.getRowsHeight(e+1,this.rowCount-1))&&void 0!==a?a:0)-g):this.isBottomFrozenRow(e)&&(g=this.tableNoFrameHeight-(null!==(h=this.getRowsHeight(e,this.rowCount-1))&&void 0!==h?h:0)),new tx(Math.round(d),Math.round(g),Math.round(c),Math.round(p))}getCellsRectWidth(t,e,i,o){const n=this.isFrozenCell(t,e),r=this.isFrozenCell(i,o);let s=this.getColsWidth(t,i);if(n&&n.col){const e=this.scrollLeft;r&&r.col||(s-=e,s=Math.max(s,this.getColsWidth(t,this.frozenColCount-1)))}return s}getCellRangeRect(t){if(t.start)return this.getCellsRect(t.start.col,t.start.row,t.end.col,t.end.row);const e=this.getCellRange(t.col,t.row);return this.getCellsRect(e.start.col,e.start.row,e.end.col,e.end.row)}getCellRangeRectWidth(t){if(t.start)return this.getCellsRectWidth(t.start.col,t.start.row,t.end.col,t.end.row);const e=this.getCellRange(t.col,t.row);return this.getCellsRectWidth(e.start.col,e.start.row,e.end.col,e.end.row)}isFrozenCell(t,e){const i=this.isFrozenRow(e),o=this.isFrozenColumn(t);return i||o?{row:i,col:o}:null}getRowAt(t){return WT(t,this)}getColAt(t){return NT(t,this)}getCellAt(t,e){return function(t,e,i){const o=WT(e,i),{row:n,top:r,bottom:s,height:l}=o,a=NT(t,i),{col:h,left:d,right:c,width:u}=a;return{row:n,col:h,rect:{left:d,right:c,top:r,bottom:s,width:u,height:l}}}(t,e,this)}getCellAtRelativePosition(t,e){return function(t,e,i){t-=i.tableX;let o=!1;(e-=i.tableY)>0&&e<i.getFrozenRowsHeight()&&(o=!0);let n=!1;t>0&&t<i.getFrozenColsWidth()&&(n=!0);let r=!1;e>i.tableNoFrameHeight-i.getBottomFrozenRowsHeight()&&e<i.tableNoFrameHeight&&e<=i.getAllRowsHeight()&&(r=!0);let s=!1;t>i.tableNoFrameWidth-i.getRightFrozenColsWidth()&&t<i.tableNoFrameWidth&&t<=i.getAllColsWidth()&&(s=!0);const l=VT(n||s?t:t+i.scrollLeft,s,i),a=UT(o||r?e:e+i.scrollTop,r,i);if(l&&a){const{row:t,top:e,bottom:i,height:o}=a,{col:n,left:r,right:s,width:h}=l;return{row:t,col:n,rect:{left:r,right:s,top:e,bottom:i,width:h,height:o}}}return{col:-1,row:-1}}(t,e,this)}_checkRowCol(t,e){return t>=0&&t<this.colCount&&e>=0&&e<this.rowCount}_makeVisibleCell(t,e){if(this._checkRowCol(t,e)){const i=this.isFrozenCell(t,e);if(i&&i.col&&i.row)return;const o=this.getCellRect(t,e),n=function(t){let e=0,i=0;t.frozenColCount>0&&(e=t.getFrozenColsWidth()),t.rightFrozenColCount>0&&(i=t.getRightFrozenColsWidth());let o=0,n=0;return t.frozenRowCount>0&&(o=t.getFrozenRowsHeight()),t.bottomFrozenRowCount>0&&(n=t.getBottomFrozenRowsHeight()),new tx(t.scrollLeft+e,t.scrollTop+o,t.tableNoFrameWidth-e-i,t.tableNoFrameHeight-o-n)}(this);if(n.contains(o))return;i&&i.col||this.getColsWidth(0,this.frozenColCount-1)+o.width>this.canvas.width||(o.left<n.left?this.scrollLeft-=n.left-o.left:n.right<o.right&&(this.scrollLeft-=n.right-o.right)),i&&i.row||this.getRowsHeight(0,this.frozenRowCount-1)+o.height>this.canvas.height||(o.top<n.top?this.scrollTop-=n.top-o.top:n.bottom<o.bottom&&(this.scrollTop-=n.bottom-o.bottom))}}render(){this.scenegraph.renderSceneGraph()}renderAsync(){return this.scenegraph.updateNextFrame(),new Promise(((t,e)=>{setTimeout((()=>{t()}),0)}))}_toRelativeRect(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];var o,n,r,s;const l=t.copy(),a=this.getVisibleRect();return l.offsetLeft(this.tableX-(e?a.left:0)),l.offsetTop(this.tableY-(i?a.top:0)),l.offsetLeft(null!==(n=null===(o=this.options.viewBox)||void 0===o?void 0:o.x1)&&void 0!==n?n:0),l.offsetTop(null!==(s=null===(r=this.options.viewBox)||void 0===r?void 0:r.y1)&&void 0!==s?s:0),l}getVisibleRect(){const{scrollTop:t,scrollLeft:e}=this,i=this.tableNoFrameWidth,o=this.tableNoFrameHeight;return new tx(e,t,i,o)}get visibleRowCount(){const{frozenRowCount:t}=this,e=this.getVisibleRect(),i=t>0?e.top+this.getRowsHeight(0,t-1):e.top,o=this.getTargetRowAt(i);if(!o)return 0;const n=Math.max(o.top>=i?o.row:o.row+1,t);let r=this.getRowsHeight(0,n-1),s=0;const{rowCount:l}=this;for(let t=n;t<l;t++){const i=r+this.getRowHeight(t);if(e.bottom<i)break;s++,r=i}return s}getBodyVisibleCellRange(){const{scrollTop:t,scrollLeft:e}=this,i=this.getFrozenRowsHeight(),o=this.getFrozenColsWidth(),n=this.getBottomFrozenRowsHeight(),r=this.getRightFrozenColsWidth(),{row:s}=this.getRowAt(t+i+1),{col:l}=this.getColAt(e+o+1),a=this.getAllRowsHeight()>this.tableNoFrameHeight?this.getRowAt(t+this.tableNoFrameHeight-1-n).row:this.rowCount-1,h=this.getAllColsWidth()>this.tableNoFrameWidth?this.getColAt(e+this.tableNoFrameWidth-1-r).col:this.colCount-1;return h<0||a<0?null:{rowStart:s,colStart:l,rowEnd:a,colEnd:h}}getBodyVisibleRowRange(){const{scrollTop:t}=this,e=this.getFrozenRowsHeight(),i=this.getBottomFrozenRowsHeight(),{row:o}=this.getRowAt(t+e+1),n=this.getAllRowsHeight()>this.tableNoFrameHeight?this.getRowAt(t+this.tableNoFrameHeight-1-i).row:this.rowCount-1;return n<0?null:{rowStart:o,rowEnd:n}}getBodyVisibleColRange(){const{scrollLeft:t}=this,e=this.getFrozenColsWidth(),i=this.getRightFrozenColsWidth(),{col:o}=this.getColAt(t+e+1),n=this.getAllColsWidth()>this.tableNoFrameWidth?this.getColAt(t+this.tableNoFrameWidth-1-i).col:this.colCount-1;return n<0?null:{colStart:o,colEnd:n}}get visibleColCount(){const{frozenColCount:t}=this,e=this.getVisibleRect(),i=t>0?e.left+this.getColsWidth(0,t-1):e.left,o=this.getTargetColAt(i);if(!o)return 0;const n=Math.max(o.left>=i?o.col:o.col+1,t);let r=this.getColsWidth(0,n-1),s=0;const{colCount:l}=this;for(let t=n;t<l;t++){const i=r+this.getColWidth(t);if(e.right<i)break;s++,r=i}return s}get scrollTop(){return this.stateManager.scroll.verticalBarPos}set scrollTop(t){this.stateManager.setScrollTop(t)}get scrollLeft(){return this.stateManager.scroll.horizontalBarPos}set scrollLeft(t){this.stateManager.setScrollLeft(t)}getScrollLeft(){return this.scrollLeft}getScrollTop(){return this.scrollTop}setScrollLeft(t){this.scrollLeft=Math.ceil(t)}setScrollTop(t){this.scrollTop=Math.ceil(t)}getCellOverflowText(t,e){return this.scenegraph.getCellOverflowText(t,e)}addReleaseObj(t){if(!t||!t.release||"function"!=typeof t.release)throw new Error("not releaseObj!");(this.internalProps.releaseList=this.internalProps.releaseList||[]).push(t)}dispose(){this.release()}release(){var t,e,i,o,n,r,s,l,a,h,d,c,u,g,p,f;const v=this.internalProps;null===(e=null===(t=v.tooltipHandler)||void 0===t?void 0:t.release)||void 0===e||e.call(t),null===(o=null===(i=v.menuHandler)||void 0===i?void 0:i.release)||void 0===o||o.call(i),aS.clearAll(),null===(n=super.release)||void 0===n||n.call(this),null===(s=null===(r=v.handler)||void 0===r?void 0:r.release)||void 0===s||s.call(r),this.eventManager.release(),null===(a=null===(l=v.focusControl)||void 0===l?void 0:l.release)||void 0===a||a.call(l),null===(h=v.legends)||void 0===h||h.forEach((t=>{null==t||t.release()})),null===(d=v.title)||void 0===d||d.release(),v.title=null,null===(c=v.emptyTip)||void 0===c||c.release(),v.emptyTip=null,v.layoutMap.release(),v.releaseList&&(v.releaseList.forEach((t=>{var e;return null===(e=null==t?void 0:t.release)||void 0===e?void 0:e.call(t)})),v.releaseList=null),this.scenegraph.stage.release(),this.scenegraph.proxy.release(),v.focusControl.release();const{parentElement:m}=v.element;m&&!this.options.canvas&&m.removeChild(v.element),null===(p=null===(g=null===(u=this.editorManager)||void 0===u?void 0:u.editingEditor)||void 0===g?void 0:g.onEnd)||void 0===p||p.call(g),this.isReleased=!0,this.scenegraph=null,this.internalProps=null,null===(f=this.reactCustomLayout)||void 0===f||f.clearCache()}fireListeners(t,e){return super.fireListeners(t,e)}updateOption(t){var e,i,o,n,r,s,l,a,h,d,c,u;this.options=t,this._hasAutoImageColumn=void 0;const{frozenColCount:g=0,defaultRowHeight:p=40,defaultHeaderRowHeight:f,defaultColWidth:v=80,defaultHeaderColWidth:m=80,keyboardOptions:b,eventOptions:y,rowSeriesNumber:C,columnResizeMode:w,rowResizeMode:x="none",dragHeaderMode:_,showFrozenIcon:S,allowFrozenColCount:A,padding:B,hover:R,menu:M,select:T,pixelRatio:k,widthMode:L,heightMode:P,autoFillWidth:E,autoFillHeight:H,widthAdaptiveMode:F,heightAdaptiveMode:z,customRender:I,renderChartAsync:O,renderChartAsyncBatchCount:D,overscrollBehavior:W,limitMinWidth:N,limitMinHeight:G}=t;k&&k!==this.internalProps.pixelRatio&&(this.internalProps.pixelRatio=k),B&&("number"==typeof B?(this.padding.top=B,this.padding.left=B,this.padding.bottom=B,this.padding.right=B):(B.top&&(this.padding.top=B.top),B.bottom&&(this.padding.bottom=B.bottom),B.left&&(this.padding.left=B.left),B.right&&(this.padding.right=B.right))),this.showFrozenIcon="boolean"!=typeof S||S,"number"==typeof A&&A<=0&&(this.showFrozenIcon=!1),this.widthMode=null!=L?L:"standard",this.heightMode=null!=P?P:"standard",this._widthAdaptiveMode=null!=F?F:"only-body",this._heightAdaptiveMode=null!=z?z:"only-body",this.autoFillWidth=null!=E&&E,this.autoFillHeight=null!=H&&H,this.customRender=I;const j=this.internalProps;if("node"===sw.mode||t.canvas||function(t,e){var i,o;t.style.margin=`${e.top}px ${e.right}px ${e.bottom}px ${e.left}px`;const n=(t.offsetWidth||(null===(i=t.parentElement)||void 0===i?void 0:i.offsetWidth)||1)-1,r=(t.offsetHeight||(null===(o=t.parentElement)||void 0===o?void 0:o.offsetHeight)||1)-1;t.style.width=n&&n-e.left-e.right+"px"||"0px",t.style.height=r&&r-e.top-e.bottom+"px"||"0px"}(j.element,this.padding),this.columnWidthComputeMode=null!==(e=t.columnWidthComputeMode)&&void 0!==e?e:"normal",j.frozenColCount=g,j.defaultRowHeight=p,j.defaultHeaderRowHeight=null!=f?f:p,j.defaultColWidth=v,j.defaultHeaderColWidth=null!=m?m:v,j.keyboardOptions=b,j.eventOptions=y,j.rowSeriesNumber=C,j.columnResizeMode=w,j.rowResizeMode=x,j.dragHeaderMode=null!=_?_:"none",j.renderChartAsync=O,vB(D),j.overscrollBehavior=null!=W?W:"auto",j.cellTextOverflows={},j._rowHeightsMap=new ET(this),j._rowRangeHeightsMap=new Map,j._colRangeWidthsMap=new Map,j._widthResizedColMap=new Set,j._heightResizedRowMap=new Set,this.colWidthsMap=new Qw,this.colContentWidthsMap=new Qw,this.colWidthsLimit={},j.stick.changedCells.clear(),j.theme=Bx.of(null!==(i=t.theme)&&void 0!==i?i:Bx.DEFAULT),j.theme.isPivot=this.isPivotTable(),ES(j.theme.functionalIconsStyle),this.scenegraph.updateStageBackground(),j.autoWrapText=t.autoWrapText,j.enableLineBreak=t.enableLineBreak,j.allowFrozenColCount=null!==(o=t.allowFrozenColCount)&&void 0!==o?o:0,j.limitMaxAutoWidth=null!==(n=t.limitMaxAutoWidth)&&void 0!==n?n:450,j.limitMinWidth=null!=N?"number"==typeof N?N:N?10:0:10,j.limitMinHeight=null!=G?"number"==typeof G?G:G?10:0:10,null===(r=j.legends)||void 0===r||r.forEach((t=>{null==t||t.release()})),null===(s=j.title)||void 0===s||s.release(),j.title=null,null===(l=j.emptyTip)||void 0===l||l.release(),j.emptyTip=null,j.layoutMap.release(),this.scenegraph.clearCells(),this.scenegraph.updateComponent(),this.stateManager.updateOptionSetState(),this._updateSize(),this.eventManager.updateEventBinder(),t.legends){j.legends=[];const e=Tx.getFunction("createLegend");if(Array.isArray(t.legends)){for(let i=0;i<t.legends.length;i++)j.legends.push(e(t.legends[i],this));this.scenegraph.tableGroup.setAttributes({x:this.tableX,y:this.tableY})}else j.legends.push(e(t.legends,this)),this.scenegraph.tableGroup.setAttributes({x:this.tableX,y:this.tableY})}if(j.tooltip=Object.assign({parentElement:this.getElement(),renderMode:"html",isShowOverflowTextTooltip:!1,confine:!0},t.tooltip),"html"===j.tooltip.renderMode&&!j.tooltipHandler){const t=Tx.getComponent("tooltipHandler");j.tooltipHandler=new t(this,j.tooltip.confine)}if(j.menu=Object.assign({renderMode:"html"},t.menu),Array.isArray(null===(a=t.menu)||void 0===a?void 0:a.dropDownMenuHighlight)&&this.setDropDownMenuHighlight(null===(h=t.menu)||void 0===h?void 0:h.dropDownMenuHighlight),Array.isArray(null===(d=t.menu)||void 0===d?void 0:d.defaultHeaderMenuItems)&&(this.globalDropDownMenu=t.menu.defaultHeaderMenuItems),"html"===j.menu.renderMode&&!j.menuHandler){const t=Tx.getComponent("menuHandler");j.menuHandler=new t(this)}this.clearCellStyleCache(),this.clearColWidthCache(),this.clearRowHeightCache(),j.customMergeCell=t.customMergeCell,this.customCellStylePlugin.updateCustomCell(null!==(c=t.customCellStyle)&&void 0!==c?c:[],null!==(u=t.customCellStyleArrangement)&&void 0!==u?u:[])}renderWithRecreateCells(){const t={col:this.stateManager.hover.cellPos.col,row:this.stateManager.hover.cellPos.row};this.refreshHeader(),this.internalProps.useOneRowHeightFillAll=!1,this.scenegraph.clearCells(),this.clearCellStyleCache(),this.scenegraph.createSceneGraph(),this.stateManager.updateHoverPos(t.col,t.row),this.render()}getFrozenRowsHeight(){return this.getRowsHeight(0,this.frozenRowCount-1)}getFrozenColsWidth(){return this.getColsWidth(0,this.frozenColCount-1)}getBottomFrozenRowsHeight(){if(this.bottomFrozenRowCount>0){let t=0;for(let e=this.rowCount-this.bottomFrozenRowCount;e<=this.rowCount-1;e++)t+=this.getRowHeight(e);return t}return 0}getRightFrozenColsWidth(){if(this.rightFrozenColCount>0){let t=0;for(let e=this.colCount-this.rightFrozenColCount;e<=this.colCount-1;e++)t+=this.getColWidth(e);return t}return 0}getDrawRange(){const t=Math.min(this.tableNoFrameWidth,this.getAllColsWidth()),e=Math.min(this.tableNoFrameHeight,this.getAllRowsHeight());return new tx(this.tableX,this.tableY,t,e)}_getMouseAbstractPoint(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];var i,o,n,r;let s;if(!t)return{inTable:!1,x:void 0,y:void 0};s=dk(t)?t.changedTouches[0]:t;const l=s.clientX||s.pageX+window.scrollX,a=s.clientY||s.pageY+window.scrollY,h=this.internalProps.canvas.getBoundingClientRect();let d=!0;h.right<=l&&(d=!1),h.bottom<=a&&(d=!1);const c=h.width,u=c/(this.canvas.offsetWidth||c),g=h.height,p=g/(this.canvas.offsetHeight||g),f={x:(l-h.left)/u+(e?this.scrollLeft:0)-(null!==(o=null===(i=this.options.viewBox)||void 0===i?void 0:i.x1)&&void 0!==o?o:0),y:(a-h.top)/p+(e?this.scrollTop:0)-(null!==(r=null===(n=this.options.viewBox)||void 0===n?void 0:n.y1)&&void 0!==r?r:0),inTable:d};return this.internalProps.modifiedViewBoxTransform&&this.scenegraph.stage.window.getViewBoxTransform()&&this.scenegraph.stage.window.getViewBoxTransform().transformPoint(f,f),f}getTheme(){return this.internalProps.theme}getTargetColAt(t){return GT(t,this)}getTargetRowAt(t){const e=jT(t,this);return e&&(e.row=Math.min(e.row,this.rowCount-1)),e}getTargetColAtConsiderRightFrozen(t,e){return VT(t,e,this)}getTargetRowAtConsiderBottomFrozen(t,e){return UT(t,e,this)}clearSelected(){this.stateManager.updateSelectPos(-1,-1)}selectCell(t,e,i,o){let n=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];var r;const s=!!(null===(r=this.stateManager.select.ranges)||void 0===r?void 0:r.length);this.stateManager.updateSelectPos(t,e,i,o,!1,!n),this.stateManager.endSelectCells(!0,s)}selectCells(t){const{scrollLeft:e,scrollTop:i}=this;t.forEach(((t,e)=>{t.start.col===t.end.col&&t.start.row===t.end.row?this.stateManager.updateSelectPos(t.start.col,t.start.row,!1,e>=1,!1,!1,!0):(this.stateManager.updateSelectPos(t.start.col,t.start.row,!1,e>=1,!1,!1,!0),this.stateManager.updateInteractionState(IC.grabing),this.stateManager.updateSelectPos(t.end.col,t.end.row,!1,e>=1,!1,!1,!0)),this.stateManager.endSelectCells(!1,!1),this.stateManager.updateInteractionState(IC.default)})),this.setScrollTop(i),this.setScrollLeft(e)}get recordsCount(){var t;return null===(t=this.records)||void 0===t?void 0:t.length}get allowFrozenColCount(){return this.internalProps.allowFrozenColCount}get rowHeaderLevelCount(){return this.internalProps.layoutMap.rowHeaderLevelCount}get columnHeaderLevelCount(){return this.internalProps.layoutMap.columnHeaderLevelCount}get records(){return this.internalProps.records}get dataSource(){return this.internalProps.dataSource}set dataSource(t){this.scenegraph.clearCells(),W_(this,t),this.refreshRowColCount(),this.scenegraph.createSceneGraph(),this.render()}get autoWrapText(){return this.internalProps.autoWrapText}set autoWrapText(t){this.internalProps.autoWrapText=t,this.options.autoWrapText=t}get enableLineBreak(){return this.internalProps.enableLineBreak}set enableLineBreak(t){this.internalProps.enableLineBreak=t,this.options.enableLineBreak=t}updateAutoWrapText(t){this.internalProps.autoWrapText!==t&&(this.internalProps.autoWrapText=t,this.options.autoWrapText=t,this.scenegraph.clearCells(),this.clearCellStyleCache(),this.scenegraph.createSceneGraph(),this.render())}get theme(){return this.internalProps.theme}set theme(t){this.internalProps.theme=Bx.of(null!=t?t:Bx.DEFAULT),this.internalProps.theme.isPivot=this.isPivotTable(),this.options.theme=t,ES(this.internalProps.theme.functionalIconsStyle)}updateTheme(t){const e={col:this.stateManager.hover.cellPos.col,row:this.stateManager.hover.cellPos.row};this.internalProps.theme=Bx.of(null!=t?t:Bx.DEFAULT),this.internalProps.theme.isPivot=this.isPivotTable(),ES(this.internalProps.theme.functionalIconsStyle),this.options.theme=t,this.scenegraph.updateComponent(),this.scenegraph.updateStageBackground(),this.scenegraph.clearCells(),this.clearCellStyleCache(),this.scenegraph.createSceneGraph(),this.stateManager.updateHoverPos(e.col,e.row),this.render()}getBodyField(t,e){return this.internalProps.layoutMap.getBody(t,e).field}getBodyColumnDefine(t,e){const i=this.internalProps.layoutMap.getBody(t,e);return null==i?void 0:i.define}getBodyColumnType(t,e){var i,o;return DS("cellType",{cellType:null!==(o=null===(i=this.internalProps.layoutMap.getBody(t,e))||void 0===i?void 0:i.cellType)&&void 0!==o?o:"text"},t,e,this)}getCellType(t,e){let i;return this.isSeriesNumberInHeader(t,e)?this.internalProps.layoutMap.getSeriesNumberHeader(t,e).cellType:(i=this.isHeader(t,e)?this.internalProps.layoutMap.getHeader(t,e).headerType:this.internalProps.layoutMap.getBody(t,e).cellType,DS("cellType",{cellType:i},t,e,this))}getHeaderField(t,e){return this.internalProps.layoutMap.getHeaderField(t,e)}getHeaderDefine(t,e){const i=this.internalProps.layoutMap.getHeader(t,e);return null==i?void 0:i.define}getCellLocation(t,e){return this.internalProps.layoutMap.getCellLocation(t,e)}getCellHeaderPaths(t,e){return this.internalProps.layoutMap.getCellHeaderPaths(t,e)}getHeadersDefine(t,e){const i=[];for(;;){const o=this.getHeaderDefine(t,e);if(!o||!o.field&&!o.columns)break;i.push(o),e++}return i}_getHeaderLayoutMap(t,e){return this.internalProps.layoutMap.getHeader(t,e)}_getBodyLayoutMap(t,e){return this.internalProps.layoutMap.getBody(t,e)}getContext(){return this.internalProps.context}getRecordByCell(t,e){if(!this.internalProps.layoutMap.isHeader(t,e))return this.getCellOriginRecord(t,e)}getRecordByRowCol(t,e){return this.getRecordByCell(t,e)}getRecordStartRowByRecordIndex(t){return this.internalProps.layoutMap.getRecordStartRowByRecordIndex(t)}_getHeaderCellBySortState(t){const{layoutMap:e}=this.internalProps,i=e.headerObjects.find((e=>e&&e.field===t.field));if(i)return e.getHeaderCellAdressById(i.id)}getCellRange(t,e){var i;if(this.internalProps.customMergeCell){const i=this.internalProps.customMergeCell(t,e,this);if(i&&i.range&&(Q(i.text)||i.customLayout||i.customRender))return i.range}return null===(i=this.internalProps.layoutMap)||void 0===i?void 0:i.getCellRange(t,e)}hasCustomMerge(){return!!this.internalProps.customMergeCell}getCustomMerge(t,e){if(this.internalProps.customMergeCell){const i=this.internalProps.customMergeCell(t,e,this);if(i&&i.range&&(Q(i.text)||i.customLayout||this.customRender)){if(i.style){const o=this.internalProps.bodyHelper.getStyleClass("text"),n=rw(i.style,this.theme.bodyStyle,{col:t,row:e,table:this,value:i.text,dataValue:this.getCellOriginValue(t,e),cellHeaderPaths:this.getCellHeaderPaths(t,e)},o,this.options.autoWrapText,this.theme);i.style=n}return i}}}isCellRangeEqual(t,e,i,o){return this.internalProps.layoutMap.isCellRangeEqual(t,e,i,o)}_getLayoutCellId(t,e){return this.internalProps.layoutMap.getCellId(t,e)}getHeaderDescription(t,e){var i;const o=this._getHeaderLayoutMap(t,e),n=null==o?void 0:o.define,r=null!==(i=null==n?void 0:n.description)&&void 0!==i?i:null==o?void 0:o.description;return"function"==typeof r?r({col:t,row:e,value:this.getCellValue(t,e),dataValue:this.getCellOriginValue(t,e)}):r}setDropDownMenuHighlight(t){this.stateManager.setDropDownMenuHighlight(t)}_dropDownMenuIsHighlight(t,e,i){return this.stateManager.dropDownMenuIsHighlight(t,e,i)}isSeriesNumberInBody(t,e){return this.internalProps.layoutMap&&this.internalProps.layoutMap.isSeriesNumberInBody(t,e)}isSeriesNumberInHeader(t,e){return this.internalProps.layoutMap&&this.internalProps.layoutMap.isSeriesNumberInHeader(t,e)}isHeader(t,e){return this.internalProps.layoutMap&&this.internalProps.layoutMap.isHeader(t,e)}isColumnHeader(t,e){var i;return null===(i=this.internalProps.layoutMap)||void 0===i?void 0:i.isColumnHeader(t,e)}isRowHeader(t,e){var i;return null===(i=this.internalProps.layoutMap)||void 0===i?void 0:i.isRowHeader(t,e)}isCornerHeader(t,e){var i;return null===(i=this.internalProps.layoutMap)||void 0===i?void 0:i.isCornerHeader(t,e)}isFrozenColumn(t,e){return this.isLeftFrozenColumn(t,e)||this.isRightFrozenColumn(t,e)}isLeftFrozenColumn(t,e){var i;return null===(i=this.internalProps.layoutMap)||void 0===i?void 0:i.isFrozenColumn(t,e)}isRightFrozenColumn(t,e){var i;return null===(i=this.internalProps.layoutMap)||void 0===i?void 0:i.isRightFrozenColumn(t,e)}isFrozenRow(t,e){return this.isTopFrozenRow(t,e)||this.isBottomFrozenRow(t,e)}isTopFrozenRow(t,e){var i;return null===(i=this.internalProps.layoutMap)||void 0===i?void 0:i.isFrozenRow(t,e)}isBottomFrozenRow(t,e){var i;return null===(i=this.internalProps.layoutMap)||void 0===i?void 0:i.isBottomFrozenRow(t,e)}getCellInfo(t,e){if(t>=0&&e>=0){const i=this.isHeader(t,e)?this.getHeaderDefine(t,e):this.getBodyColumnDefine(t,e);return{col:t,row:e,field:this.getHeaderField(t,e),cellHeaderPaths:this.internalProps.layoutMap.getCellHeaderPaths(t,e),title:null==i?void 0:i.title,cellType:this.getCellType(t,e),originData:this.getCellOriginRecord(t,e),cellRange:this.getCellRangeRelativeRect({col:t,row:e}),value:this.getCellValue(t,e),dataValue:this.getCellOriginValue(t,e),cellLocation:this.getCellLocation(t,e),scaleRatio:this.canvas.getBoundingClientRect().width/this.canvas.offsetWidth}}}_hasField(t,e,i){var o;if(null===t)return!1;if(this.internalProps.layoutMap.isHeader(e,i))return!1;const n=this.getRecordShowIndexByCell(e,i);return null===(o=this.internalProps.dataSource)||void 0===o?void 0:o.hasField(n,t)}_getCellStyle(t,e){return function(t,e,i){var o,n,r,s,l,a,h,d,c;const u=i.customCellStylePlugin.getCustomCellStyle(t,e),{layoutMap:g}=i.internalProps;if(g.isHeader(t,e)){let l;if(!i.isPivotTable()||i.isBottomFrozenRow(e)||i.isRightFrozenColumn(t))l=`${t}-${e}`;else{const o=i.getHeaderDefine(t,e),n=i.isCornerHeader(t,e);l=(null==o?void 0:o.dimensionKey)?n?`dim-cor-${o.dimensionKey}`:`dim-${o.dimensionKey}`:(null==o?void 0:o.indicatorKey)?`ind-${o.indicatorKey}`:`${t}-${e}`}let a=i.headerStyleCache.get(l);if(a)return u?IT(a,u):a;const h=g.getHeader(t,e);let d;if(i.isPivotChart()&&function(t,e,i){if(!i._table.isPivotChart())return!1;if(i.indicatorsAsCol){if(i.hasTwoIndicatorAxes&&e===i.columnHeaderLevelCount-1&&t>=i.rowHeaderLevelCount&&t<i.colCount-i.rightFrozenColCount)return!0;if(e===i.rowCount-i.bottomFrozenRowCount&&t>=i.rowHeaderLevelCount&&t<i.colCount-i.rightFrozenColCount)return!0}else if(e===i.rowCount-i.bottomFrozenRowCount&&t>=i.rowHeaderLevelCount&&t<i.colCount-i.rightFrozenColCount)return!0;return!1}(t,e,g)&&g.isAxisCell(t,e)?d=null!==(n=null===(o=g.getBody(t,i.rowHeaderLevelCount).style)||void 0===o?void 0:o.padding)&&void 0!==n?n:i.theme.bodyStyle.padding:i.isPivotChart()&&function(t,e,i){if(!i._table.isPivotChart())return!1;if(i.indicatorsAsCol){if(t===i.rowHeaderLevelCount-1&&e>=i.columnHeaderLevelCount&&e<i.rowCount-i.bottomFrozenRowCount)return!0}else{if(t===i.rowHeaderLevelCount-1&&e>=i.columnHeaderLevelCount&&e<i.rowCount-i.bottomFrozenRowCount)return!0;if(t===i.colCount-i.rightFrozenColCount&&e>=i.columnHeaderLevelCount&&e<i.rowCount-i.bottomFrozenRowCount)return!0}return!1}(t,e,g)&&g.isAxisCell(t,e)&&(d=null!==(s=null===(r=g.getBody(i.columnHeaderLevelCount,e).style)||void 0===r?void 0:r.padding)&&void 0!==s?s:i.theme.bodyStyle.padding),(!h||h.isEmpty)&&(g.isLeftBottomCorner(t,e)||g.isRightBottomCorner(t,e)||g.isCornerHeader(t,e)||g.isRightTopCorner(t,e)))return sk;const c=i.internalProps.headerHelper.getStyleClass((null==h?void 0:h.headerType)||"text");if(g.isBottomFrozenRow(t,e)&&i.theme.bottomFrozenStyle)a=kT(d?{padding:d}:{},i.theme.bottomFrozenStyle,{col:t,row:e,table:i,value:i.getCellValue(t,e),dataValue:i.getCellOriginValue(t,e),cellHeaderPaths:i.getCellHeaderPaths(t,e)},c,i.options.autoWrapText,i.theme);else if(g.isRightFrozenColumn(t,e)&&i.theme.rightFrozenStyle)a=kT(d?{padding:d}:{},i.theme.rightFrozenStyle,{col:t,row:e,table:i,value:i.getCellValue(t,e),dataValue:i.getCellOriginValue(t,e),cellHeaderPaths:i.getCellHeaderPaths(t,e)},c,i.options.autoWrapText,i.theme);else{const o=(null==h?void 0:h.style)||{};d&&(o.padding=d),a=kT(o,g.isColumnHeader(t,e)||g.isBottomFrozenRow(t,e)?i.theme.headerStyle:g.isRowHeader(t,e)||g.isRightFrozenColumn(t,e)?i.theme.rowHeaderStyle:i.theme.cornerHeaderStyle,{col:t,row:e,table:i,value:i.getCellValue(t,e),dataValue:i.getCellOriginValue(t,e),cellHeaderPaths:i.getCellHeaderPaths(t,e)},c,i.options.autoWrapText,i.theme)}return i.headerStyleCache.set(l,a),u?IT(a,u):a}let p,f;(null===(a=null===(l=i.internalProps)||void 0===l?void 0:l.dataConfig)||void 0===a?void 0:a.mappingRules)&&!i.isHeader(t,e)&&(null===(c=null===(d=null===(h=i.internalProps)||void 0===h?void 0:h.dataConfig)||void 0===d?void 0:d.mappingRules)||void 0===c||c.forEach(((o,n)=>{o.bgColor&&i.internalProps.layoutMap.getIndicatorKey(t,e)===o.bgColor.indicatorKey&&(p=o.bgColor.mapping)})));const v=i.getCellType(t,e),m=i.getCellOriginRecord(t,e);let b;if(f=(null==m?void 0:m.vtableMerge)?"merge-title":i.isSeriesNumberInBody(t,e)?`${t}-series-`+v:i.isListTable()&&!i.transpose||i.isPivotTable()&&i.internalProps.layoutMap.indicatorsAsCol?t+v:e+v,b=(null==m?void 0:m.vtableMerge)?i.bodyMergeTitleCache.get(f):g.isBottomFrozenRow(e)?i.bodyBottomStyleCache.get(f):i.bodyStyleCache.get(f),b)return u?IT(b,u):b;const y=g.getBody(t,e),C=i.internalProps.bodyHelper.getStyleClass(i.getCellType(t,e)),w=null==y?void 0:y.style;return b=rw(w,(null==m?void 0:m.vtableMerge)&&i.theme.groupTitleStyle?i.theme.groupTitleStyle:g.isBottomFrozenRow(e)&&i.theme.bottomFrozenStyle?i.theme.bottomFrozenStyle:g.isRightFrozenColumn(t)&&i.theme.rightFrozenStyle?i.theme.rightFrozenStyle:i.theme.bodyStyle,{col:t,row:e,table:i,value:i.getCellValue(t,e),dataValue:i.getCellOriginValue(t,e),cellHeaderPaths:i.getCellHeaderPaths(t,e)},C,i.options.autoWrapText,i.theme),p&&(b=IT(b,{bgColor:p})),Z(w)||(g.isBottomFrozenRow(e)?i.bodyBottomStyleCache.set(f,b):i.bodyStyleCache.set(f,b)),u?IT(b,u):b}(t,e,this)}clearCellStyleCache(){this.headerStyleCache.clear(),this.bodyStyleCache.clear(),this.bodyMergeTitleCache.clear(),this.bodyBottomStyleCache.clear()}clearRowHeightCache(){this.internalProps._rowHeightsMap.clear(),this._clearRowRangeHeightsMap()}clearColWidthCache(){this.internalProps._colWidthsMap.clear(),this._clearColRangeWidthsMap()}_canResizeColumn(t,e){if(!(t>=0&&e>=0))return!1;if(this.isCellRangeEqual(t,e,t+1,e))return!1;if("none"===this.internalProps.columnResizeMode)return!1;if("header"===this.internalProps.columnResizeMode){if(!this.isHeader(t,e))return!1}else if("body"===this.internalProps.columnResizeMode&&this.isHeader(t,e))return!1;const i=this.colWidthsLimit[t];return!(i&&i.min&&i.max)||i.max!==i.min}_canResizeRow(t,e){if(!(t>=0&&e>=0))return!1;if(this.isCellRangeEqual(t,e,t,e+1))return!1;if("none"===this.internalProps.rowResizeMode)return!1;if("header"===this.internalProps.rowResizeMode){if(!this.isHeader(t,e))return!1}else if("body"===this.internalProps.rowResizeMode&&this.isHeader(t,e))return!1;return!0}_canDragHeaderPosition(t,e){var i,o;if(this.isHeader(t,e)&&(this.stateManager.isSelected(t,e)||(null===(i=this.options.select)||void 0===i?void 0:i.disableHeaderSelect)||(null===(o=this.options.select)||void 0===o?void 0:o.disableSelect))){if("disabled"===this.internalProps.frozenColDragHeaderMode&&this.isFrozenColumn(t))return!1;if(this.stateManager.isSelected(t,e)){const i=this.stateManager.select.ranges[0];if(this.isColumnHeader(t,e)){if(i.end.row!==this.rowCount-1)return!1}else{if(!this.isRowHeader(t,e))return!1;if(i.end.col!==this.colCount-1)return!1}}const i=this.getHeaderDefine(t,e);if(!i)return!1;if(void 0===i.dragHeader){if("all"===this.internalProps.dragHeaderMode)return!0;if("column"===this.internalProps.dragHeaderMode){if(this.isColumnHeader(t,e))return!0}else if("row"===this.internalProps.dragHeaderMode&&this.isRowHeader(t,e))return!0;return!1}return i.dragHeader}return!1}getCellIcons(t,e){var i,o,n;let r;if(this.isHeader(t,e))r=this.internalProps.headerHelper.getIcons(t,e);else if(this.internalProps.layoutMap.isSeriesNumber(t,e)){this.options.groupBy&&(null===(i=this.getCellRawRecord(t,e))||void 0===i?void 0:i.vtableMerge)||(null===(n=null===(o=this.internalProps.layoutMap.getSeriesNumberBody(t,e))||void 0===o?void 0:o.define)||void 0===n?void 0:n.dragOrder)&&(r=this.internalProps.rowSeriesNumberHelper.getIcons(t,e));const s=this.getCellValue(t,e),l=this.getCellOriginValue(t,e),a=this.internalProps.context,h=this.internalProps.bodyHelper.getIcons(t,e,s,l,a);(null==r?void 0:r.length)>0?r=r.concat(h):(null==h?void 0:h.length)>0&&(r=h)}else{const i=this.getCellValue(t,e),o=this.getCellOriginValue(t,e),n=this.internalProps.context;r=this.internalProps.bodyHelper.getIcons(t,e,i,o,n)}return r}showDropDownMenu(t,e,i){let o="dropdown-menu";i&&(o=Array.isArray(i.content)?"dropdown-menu":"container"),"html"===this.internalProps.menu.renderMode&&(this.stateManager.menu.isShow=!0,this.internalProps.menuHandler._bindToCell(t,e,o,i))}showTooltip(t,e,i){"html"===this.internalProps.tooltip.renderMode&&this.internalProps.tooltipHandler._bindToCell(t,e,i)}getCellStyle(t,e){const i=this._getCellStyle(t,e),o=G_(i,this,t,e,DS).theme,{autoWrapText:n,lineClamp:r,textOverflow:s}=i;return{textAlign:o.text.textAlign,textBaseline:o.text.textBaseline,bgColor:q(o.group.fill)?DS("bgColor",i,t,e,this):o.group.fill,color:q(o.text.fill)?DS("color",i,t,e,this):o.text.fill,strokeColor:q(o.text.stroke)?DS("strokeColor",i,t,e,this):o.text.stroke,fontFamily:o.text.fontFamily,fontSize:o.text.fontSize,fontWeight:o.text.fontWeight,fontVariant:o.text.fontVariant,fontStyle:o.text.fontStyle,lineHeight:o.text.lineHeight,autoWrapText:null!=n&&n,lineClamp:null!=r?r:"auto",textOverflow:s,borderColor:q(o.group.stroke)?DS("borderColor",i,t,e,this):o.group.stroke,borderLineWidth:o.group.lineWidth,borderLineDash:o.group.lineDash,underline:!!o.text.underline,underlineDash:o.text.underlineDash,underlineOffset:o.text.underlineOffset,lineThrough:!!o.text.lineThrough,padding:o._vtable.padding,underlineWidth:o.text.underline,lineThroughLineWidth:o.text.lineThrough,_strokeArrayWidth:o.group.strokeArrayWidth,_strokeArrayColor:o.group.strokeArrayColor,_linkColor:DS("linkColor",i,t,e,this)}}getAllBodyCells(t,e){const i=this.rowHeaderLevelCount,o=this.columnHeaderLevelCount,n=this.colCount-1,r=this.rowCount-1;return Array(Math.min(null!=e?e:2e3,r-o+1,this.rowCount)).fill(0).map(((e,r)=>Array(Math.min(null!=t?t:2e3,n-i+1,this.colCount)).fill(0).map(((t,e)=>this.getCellInfo(e+i,r+o)))))}getAllCells(t,e){const i=this.colCount-1,o=this.rowCount-1;return Array(Math.min(null!=e?e:2e3,o-0+1,this.rowCount)).fill(0).map(((e,o)=>Array(Math.min(null!=t?t:2e3,i-0+1,this.colCount)).fill(0).map(((t,e)=>this.getCellInfo(e+0,o+0)))))}getAllColumnHeaderCells(){const t=this.rowHeaderLevelCount,e=this.colCount-1,i=this.columnHeaderLevelCount-1;return Array(i-0+1).fill(0).map(((i,o)=>Array(e-t+1).fill(0).map(((e,i)=>this.getCellInfo(i+t,o+0)))))}getAllRowHeaderCells(){const t=this.columnHeaderLevelCount,e=this.rowHeaderLevelCount-1,i=this.rowCount-1;return Array(i-t+1).fill(0).map(((i,o)=>Array(e-0+1).fill(0).map(((e,i)=>this.getCellInfo(i+0,o+t)))))}getCopyValue(){var t,e,i;if((null===(e=null===(t=this.stateManager.select)||void 0===t?void 0:t.ranges)||void 0===e?void 0:e.length)>0){const t=this.stateManager.select.ranges;let e=Math.min(t[0].start.col,t[0].end.col),o=Math.max(t[0].start.col,t[0].end.col),n=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),o=Math.max(o,t.start.col,t.end.col),n=Math.min(n,t.start.row,t.end.row),r=Math.max(r,t.start.row,t.end.row)}));const s=e=>{let i=!1;return t.forEach((t=>{const o=Math.min(t.start.row,t.end.row),n=Math.max(t.start.row,t.end.row);o<=e&&n>=e&&(i=!0)})),i},l=e=>{let i=!1;return t.forEach((t=>{const o=Math.min(t.start.col,t.end.col),n=Math.max(t.start.col,t.end.col);o<=e&&n>=e&&(i=!0)})),i},a=(e,i)=>{let o;return t.forEach((t=>{const n=Math.min(t.start.row,t.end.row),r=Math.max(t.start.row,t.end.row),s=Math.min(t.start.col,t.end.col),l=Math.max(t.start.col,t.end.col);s<=e&&l>=e&&n<=i&&r>=i&&(o=t)})),o},h=(t,e,i)=>{const o=this.getCellRange(t,e);let n=o.start.col,r=o.start.row;if(i){const t=Math.min(i.start.col,i.end.col),e=Math.min(i.start.row,i.end.row);n=Math.max(t,o.start.col),r=Math.max(e,o.start.row)}return n!==t||r!==e?"":this.getCellValue(t,e)};let d="";for(let t=n;t<=r;t++)if(s(t)){for(let i=e;i<=o;i++)if(l(i)){const e=a(i,t);if(e){const n=h(i,t,e);if("undefined"!=typeof Promise&&n instanceof Promise);else{const t=Q(n)?`${n}`:"";/^\[object .*\]$/.exec(t)||(d+=t)}(i<e.end.col||i<o)&&(d+="\t")}else d+="\t"}t<r&&(d+="\r\n")}return(null===(i=this.options)||void 0===i?void 0:i.formatCopyValue)&&(d=this.options.formatCopyValue(d)),d}return""}getSelectedCellInfos(){var t;if(!(null===(t=this.stateManager.select)||void 0===t?void 0:t.ranges))return null;const e=this.stateManager.select.ranges;if(!e.length)return[];let i=Math.min(e[0].start.col,e[0].end.col),o=Math.max(e[0].start.col,e[0].end.col),n=Math.min(e[0].start.row,e[0].end.row),r=Math.max(e[0].start.row,e[0].end.row);e.forEach((t=>{i=Math.min(i,t.start.col,t.end.col),o=Math.max(o,t.start.col,t.end.col),n=Math.min(n,t.start.row,t.end.row),r=Math.max(r,t.start.row,t.end.row)}));const s=t=>{let i=!1;return e.forEach((e=>{const o=Math.min(e.start.row,e.end.row),n=Math.max(e.start.row,e.end.row);o<=t&&n>=t&&(i=!0)})),i},l=t=>{let i=!1;return e.forEach((e=>{const o=Math.min(e.start.col,e.end.col),n=Math.max(e.start.col,e.end.col);o<=t&&n>=t&&(i=!0)})),i},a=(t,i)=>{let o;return e.forEach((e=>{const n=Math.min(e.start.row,e.end.row),r=Math.max(e.start.row,e.end.row),s=Math.min(e.start.col,e.end.col),l=Math.max(e.start.col,e.end.col);s<=t&&l>=t&&n<=i&&r>=i&&(o=e)})),o},h=[];for(let t=n;t<=r;t++)if(s(t)){const e=[];for(let n=i;n<=o;n++)if(l(n)&&a(n,t)){const i=this.getCellInfo(n,t);e.push(i)}h.push(e)}return h}getSelectedCellRanges(){const t=this.stateManager.select.ranges;return t.length?Ct(t):[]}measureText(t,e){return wA.measureText(t,e)}measureTextBounds(t){return _A(t)}getCustomRender(t,e){let i;if("body"!==this.getCellLocation(t,e)){const o=this.getHeaderDefine(t,e);i=null==o?void 0:o.headerCustomRender}else{const o=this.getBodyColumnDefine(t,e);i=(null==o?void 0:o.customRender)||this.customRender}return i}getCustomLayout(t,e){let i;if("body"!==this.getCellLocation(t,e)){const o=this.getHeaderDefine(t,e);i=null==o?void 0:o.headerCustomLayout}else{const o=this.getBodyColumnDefine(t,e);i=null==o?void 0:o.customLayout}return i}hasAutoImageColumn(){return void 0===this._hasAutoImageColumn&&(this._hasAutoImageColumn=function(t){const{columns:e,rows:i,indicators:o}=t.options;if(t.isPivotTable()){if(rt(e)&&e.length>0)for(let t=0;t<e.length;t++){const i=e[t];if(!nt(i)&&("image"===i.headerType||"video"===i.headerType||"function"==typeof i.headerType)&&i.imageAutoSizing)return!0}if(rt(i)&&i.length>0)for(let t=0;t<i.length;t++){const e=i[t];if(!nt(e)&&("image"===e.headerType||"video"===e.headerType||"function"==typeof e.headerType)&&e.imageAutoSizing)return!0}if(rt(o)&&o.length>0)for(let t=0;t<o.length;t++){const e=o[t];if(!nt(e)&&(("image"===e.cellType||"video"===e.cellType||"function"==typeof e.cellType)&&e.imageAutoSizing||("image"===e.headerType||"video"===e.headerType||"function"==typeof e.headerType)&&e.imageAutoSizing))return!0}}else if(rt(e)&&e.length>0)for(let t=0;t<e.length;t++){const i=e[t];if(("image"===i.cellType||"video"===i.cellType||"function"==typeof i.cellType)&&i.imageAutoSizing||("image"===i.headerType||"video"===i.headerType||"function"==typeof i.headerType)&&i.imageAutoSizing)return!0}return!1}(this)),this._hasAutoImageColumn}_getActiveChartInstance(){var t,e,i,o,n,r;const s=this.scenegraph.getCell(null===(e=null===(t=this.stateManager.hover)||void 0===t?void 0:t.cellPos)||void 0===e?void 0:e.col,null===(o=null===(i=this.stateManager.hover)||void 0===i?void 0:i.cellPos)||void 0===o?void 0:o.row);return"chart"===(null===(r=null===(n=null==s?void 0:s.getChildren())||void 0===n?void 0:n[0])||void 0===r?void 0:r.type)?s.getChildren()[0].activeChartInstance:null}cellIsInVisualView(t,e){var i,o,n,r;const s=this.getDrawRange(),l=this.getCellRelativeRect(t,e);if(t<this.frozenColCount&&e<this.frozenRowCount)return!0;let a,h,d,c;if(this.frozenRowCount>=1&&(a=this.getCellRangeRelativeRect({start:{col:0,row:0},end:{col:this.colCount-1,row:this.frozenRowCount-1}})),this.frozenColCount>=1&&(h=this.getCellRangeRelativeRect({start:{col:0,row:0},end:{col:this.frozenColCount-1,row:this.rowCount-1}})),this.bottomFrozenRowCount>=1&&(d=this.getCellRangeRelativeRect({start:{col:0,row:this.rowCount-this.bottomFrozenRowCount},end:{col:this.colCount-1,row:this.rowCount-1}})),this.rightFrozenColCount>=1&&(c=this.getCellRangeRelativeRect({start:{col:this.colCount-this.rightFrozenColCount,row:0},end:{col:this.colCount-1,row:this.rowCount-1}})),l.top>=s.top&&l.bottom<=s.bottom&&l.left>=s.left&&l.right<=s.right){if(this.isFrozenCell(t,e))return!0;if(l.top>=(null!==(i=null==a?void 0:a.bottom)&&void 0!==i?i:l.top)&&l.left>=(null!==(o=null==h?void 0:h.right)&&void 0!==o?o:l.left)&&l.bottom<=(null!==(n=null==d?void 0:d.top)&&void 0!==n?n:l.bottom)&&l.right<=(null!==(r=null==c?void 0:c.left)&&void 0!==r?r:l.right))return!0}return!1}getCustomMergeValue(t,e){if(this.internalProps.customMergeCell){const i=this.getCustomMerge(t,e);if(i){const{text:t}=i;return t}}}exportImg(){return this.scenegraph.stage.toCanvas().toDataURL()}exportCellImg(t,e,i){var o,n,r,s;const l=this.cellIsInVisualView(t,e),{scrollTop:a,scrollLeft:h}=this;l||this.scrollToCell({col:t,row:e});const d=this.getCellRelativeRect(t,e);(null===(n=null===(o=this.stateManager.select)||void 0===o?void 0:o.ranges)||void 0===n?void 0:n.length)>0&&XR(this.scenegraph);const{col:c,row:u}=this.stateManager.hover.cellPos;let g,p;if(this.stateManager.updateHoverPos(-1,-1),this.scenegraph.component.hideVerticalScrollBar(),this.scenegraph.component.hideHorizontalScrollBar(),this.scenegraph.tableGroup.border.setAttribute("visible",!1),null==i?void 0:i.disableBackground){const i=this.scenegraph.getCell(t,e);g=i.attribute.fill,i.setAttribute("fill","transparent")}if(null==i?void 0:i.disableBorder){const i=this.scenegraph.getCell(t,e);p=i.attribute.stroke,i.setAttribute("stroke",!1)}this.scenegraph.renderSceneGraph();let f=0;"bottom-right"===this.theme.cellBorderClipDirection&&(f=1);const v=this.scenegraph.stage.toCanvas(!1,(new Ie).set(d.left+this.tableX+1,d.top+this.tableY+1,d.right+this.tableX-f,d.bottom+this.tableY-f));return l||(this.setScrollTop(a),this.setScrollLeft(h)),this.scenegraph.tableGroup.border.setAttribute("visible",!0),g&&this.scenegraph.getCell(t,e).setAttribute("fill",g),p&&this.scenegraph.getCell(t,e).setAttribute("stroke",p),(null===(s=null===(r=this.stateManager.select)||void 0===r?void 0:r.ranges)||void 0===s?void 0:s.length)>0&&YR(this.scenegraph),this.stateManager.updateHoverPos(c,u),this.scenegraph.updateNextFrame(),v.toDataURL()}exportCellRangeImg(t){var e,i,o,n;const{scrollTop:r,scrollLeft:s}=this,l=Math.min(t.start.col,t.end.col),a=Math.min(t.start.row,t.end.row),h=Math.max(t.start.col,t.end.col),d=Math.max(t.start.row,t.end.row),c=this.cellIsInVisualView(l,a),u=this.cellIsInVisualView(h,d);c&&u||this.scrollToCell({col:l,row:a});const g=this.getCellRangeRelativeRect({start:{col:l,row:a},end:{col:h,row:d}});(null===(i=null===(e=this.stateManager.select)||void 0===e?void 0:e.ranges)||void 0===i?void 0:i.length)>0&&XR(this.scenegraph);const{col:p,row:f}=this.stateManager.hover.cellPos;this.stateManager.updateHoverPos(-1,-1),this.scenegraph.component.hideVerticalScrollBar(),this.scenegraph.component.hideHorizontalScrollBar(),this.scenegraph.renderSceneGraph();const v=this.scenegraph.stage.toCanvas(!1,(new Ie).set(g.left+this.tableX+1,g.top+this.tableY+1,g.right+this.tableX,g.bottom+this.tableY)).toDataURL();return c&&u||(this.setScrollTop(r),this.setScrollLeft(s)),(null===(n=null===(o=this.stateManager.select)||void 0===o?void 0:o.ranges)||void 0===n?void 0:n.length)>0&&YR(this.scenegraph),this.stateManager.updateHoverPos(p,f),v}exportCanvas(){return this.scenegraph.stage.toCanvas()}getImageBuffer(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"image/png";if("node"!==this.options.mode)return;this.render();const e=this.scenegraph.stage;if(e){const i=this.tableX+this.getAllColsWidth(),o=this.tableY+this.getAllRowsHeight();return i>=this.canvasWidth&&o>=this.canvasHeight?(e.render(),e.window.getImageBuffer(t)):this.scenegraph.stage.toCanvas(!1,(new Ie).set(0,0,Math.min(this.canvasWidth,i),Math.min(this.canvasHeight,o))).toBuffer(t)}return null}getBodyIndexByTableIndex(t,e){return{col:t-this.rowHeaderLevelCount,row:e-this.columnHeaderLevelCount}}getTableIndexByBodyIndex(t,e){return{col:t+this.rowHeaderLevelCount,row:e+this.columnHeaderLevelCount}}onVChartEvent(t,e,i){this._chartEventMap[t]||(this._chartEventMap[t]=[]),"function"==typeof e?this._chartEventMap[t].push({callback:e}):this._chartEventMap[t].push({callback:i,query:e})}offVChartEvent(t,e){this._chartEventMap[t]&&(this._chartEventMap[t]=e?this._chartEventMap[t].filter((t=>t.callback!==e)):[])}_bindChartEvent(t){if(t)for(const e in this._chartEventMap)(this._chartEventMap[e]||[]).forEach((i=>{i.query?t.on(e,i.query,i.callback):t.on(e,i.callback)}))}changeRecordOrder(t,e){}hasCustomCellStyle(t){return this.customCellStylePlugin.hasCustomCellStyle(t)}registerCustomCellStyle(t,e){this.customCellStylePlugin.registerCustomCellStyle(t,e)}arrangeCustomCellStyle(t,e){this.customCellStylePlugin.arrangeCustomCellStyle(t,e)}isSeriesNumber(t,e){return this.internalProps.layoutMap.isSeriesNumber(t,e)}isHasSeriesNumber(){var t;return(null===(t=this.internalProps.layoutMap)||void 0===t?void 0:t.leftRowSeriesNumberColumnCount)>0}get leftRowSeriesNumberCount(){var t,e;return null!==(e=null===(t=this.internalProps.layoutMap)||void 0===t?void 0:t.leftRowSeriesNumberColumnCount)&&void 0!==e?e:0}setMinMaxLimitWidth(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];var e,i;const o=this.internalProps;for(let n=0;n<o.layoutMap.columnWidths.length;n++){if(this.internalProps._widthResizedColMap.has(n))continue;const{width:r,minWidth:s,maxWidth:l}=null!==(i=null===(e=o.layoutMap.columnWidths)||void 0===e?void 0:e[n])&&void 0!==i?i:{};t&&r&&("string"==typeof r&&"auto"!==r||"number"==typeof r&&r>0)&&this._setColWidth(n,r),s&&("number"==typeof s&&s>0||"string"==typeof s)&&this.setMinColWidth(n,s),l&&("number"==typeof l&&l>0||"string"==typeof l)&&this.setMaxColWidth(n,l)}}setSortedIndexMap(t,e){var i;null===(i=this.dataSource)||void 0===i||i.setSortedIndexMap(t,e)}checkReactCustomLayout(t){this.reactCustomLayout||(this.reactCustomLayout=new X_(t,this))}get bodyDomContainer(){return this.internalProps.bodyDomContainer}get headerDomContainer(){return this.internalProps.headerDomContainer}get frozenBodyDomContainer(){return this.internalProps.frozenBodyDomContainer}get frozenHeaderDomContainer(){return this.internalProps.frozenHeaderDomContainer}get rightFrozenBodyDomContainer(){return this.internalProps.rightFrozenBodyDomContainer}get rightFrozenHeaderDomContainer(){return this.internalProps.rightFrozenHeaderDomContainer}get frozenBottomDomContainer(){return this.internalProps.frozenBottomDomContainer}get bottomDomContainer(){return this.internalProps.bottomDomContainer}get rightFrozenBottomDomContainer(){return this.internalProps.rightFrozenBottomDomContainer}showMoverLine(t,e){this.scenegraph.component.showMoveCol(t,e,0),this.scenegraph.renderSceneGraph()}hideMoverLine(t,e){this.scenegraph.component.hideMoveCol(),this.scenegraph.renderSceneGraph()}disableScroll(){this.eventManager.disableScroll()}enableScroll(){this.eventManager.enableScroll()}getGroupTitleLevel(t,e){}scrollToRow(t,e){e?this.animationManager.scrollTo({row:t},e):this.scrollToCell({row:t})}scrollToCol(t,e){e?this.animationManager.scrollTo({col:t},e):this.scrollToCell({col:t})}scrollToCell(t,e){if(e)return void this.animationManager.scrollTo(t,e);const i=this.getDrawRange();if(Q(t.col)&&t.col>=this.frozenColCount){const e=this.getFrozenColsWidth(),o=this.getColsWidth(0,t.col-1);this.scrollLeft=Math.min(o-e,this.getAllColsWidth()-i.width)}if(Q(t.row)&&t.row>=this.frozenRowCount){const e=this.getFrozenRowsHeight(),o=this.getRowsHeight(0,t.row-1);this.scrollTop=Math.min(o-e,this.getAllRowsHeight()-i.height)}this.render()}}const gk={},pk={};function fk(t,e,i){const o=t[e];return t[e]=i,o}function vk(t){for(const e in t)delete t[e]}var mk=Object.freeze({__proto__:null,chartModule:function(t,e){return null!=e?fk(gk,t,e):gk[t]},clearAll:function(){vk(sx),vk(lS),vk(gk)},editor:function(t,e){return null!=e?fk(pk,t,e):pk[t]},icon:function(t,e){return null!=e?fk(lS,t,e):lS[t]},theme:function(t,e){return null!=e?fk(sx,t,e):sx[t]}});const bk=(t,e)=>{var i,o;if(!(null==e?void 0:e.fields))return t;if(0===t.length)return t;const n=e.fields,r=t[0],s={},l=[];for(const e in n)if(Object.prototype.hasOwnProperty.call(n,e)){const a=n[e];if(!a.type){let o=r;e in r||(o=null!==(i=t.find((t=>e in t)))&&void 0!==i?i:r),a.type="number"==typeof o[e]?"linear":"ordinal"}let h;if("number"==typeof a.sortIndex&&(h={key:e,type:a.type,index:a.sortIndex,sortIndex:{},sortIndexCount:0,sortReverse:!0===a.sortReverse},l.push(h)),(null===(o=a.domain)||void 0===o?void 0:o.length)>0)if("ordinal"===a.type){a._domainCache={},s[e]=a;const t={};a.domain.forEach(((e,i)=>{t[e]=i,a._domainCache[e]=i})),h&&(h.sortIndex=t,h.sortIndexCount=a.domain.length)}else a.domain.length>=2&&(s[e]=a)}return Object.keys(s).length>0&&(t=t.filter((t=>{for(const e in s){const i=s[e];if("ordinal"===i.type){if(!(t[e]in i._domainCache))return!1}else if(i.domain[0]>t[e]||i.domain[1]<t[e])return!1}return!0}))),l.sort(((t,e)=>t.index-e.index)),t.sort(((t,e)=>function(t,e,i){for(let o=0;o<i.length;o++){const n=i[o];let r=0;if("ordinal"===n.type?(void 0===n.sortIndex[e[n.key]]&&(n.sortIndex[e[n.key]]=n.sortIndexCount++),void 0===n.sortIndex[t[n.key]]&&(n.sortIndex[t[n.key]]=n.sortIndexCount++),r=n.sortIndex[t[n.key]]-n.sortIndex[e[n.key]]):"linear"===n.type&&(r=t[n.key]-e[n.key]),n.sortReverse&&(r=-r),0!==r)return r}return 0}(t,e,l))),t};let yk=0;function Ck(){return yk>1e8&&(yk=0),(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"dataset")+"_"+yk++}class wk{constructor(t){var e;let i;this.options=t,this.isDataSet=!0,this.transformMap={},this.parserMap={},this.dataViewMap={},this.target=new Y,i=(null==t?void 0:t.name)?t.name:Ck("dataset"),this.name=i,this._logger=null!==(e=null==t?void 0:t.logger)&&void 0!==e?e:Nt.getInstance()}setLogger(t){this._logger=t}getDataView(t){return this.dataViewMap[t]}setDataView(t,e){var i;this.dataViewMap[t]&&(null===(i=this._logger)||void 0===i||i.error(`Error: dataView ${t} 之前已存在,请重新命名`)),this.dataViewMap[t]=e}removeDataView(t){this.dataViewMap[t]=null,delete this.dataViewMap[t]}registerParser(t,e){var i;this.parserMap[t]&&(null===(i=this._logger)||void 0===i||i.warn(`Warn: transform ${t} 之前已注册,执行覆盖逻辑`)),this.parserMap[t]=e}removeParser(t){this.parserMap[t]=null,delete this.parserMap[t]}getParser(t){return this.parserMap[t]||this.parserMap.default}registerTransform(t,e){var i;this.transformMap[t]&&(null===(i=this._logger)||void 0===i||i.warn(`Warn: transform ${t} 之前已注册,执行覆盖逻辑`)),this.transformMap[t]=e}removeTransform(t){this.transformMap[t]=null,delete this.transformMap[t]}getTransform(t){return this.transformMap[t]}multipleDataViewAddListener(t,e,i){this._callMap||(this._callMap=new Map);let o=this._callMap.get(i);o||(o=()=>{t.some((t=>t.isRunning))||i()}),t.forEach((t=>{t.target.addListener(e,o)})),this._callMap.set(i,o)}allDataViewAddListener(t,e){this.multipleDataViewAddListener(Object.values(this.dataViewMap),t,e)}multipleDataViewRemoveListener(t,e,i){if(this._callMap){const o=this._callMap.get(i);o&&t.forEach((t=>{t.target.removeListener(e,o)})),this._callMap.delete(i)}}multipleDataViewUpdateInParse(t){t.forEach((t=>{var e;return null===(e=this.getDataView(t.name))||void 0===e?void 0:e.markRunning()})),t.forEach((t=>{var e;return null===(e=this.getDataView(t.name))||void 0===e?void 0:e.parseNewData(t.data,t.options)}))}multipleDataViewUpdateInRawData(t){t.forEach((t=>{var e;return null===(e=this.getDataView(t.name))||void 0===e?void 0:e.markRunning()})),t.forEach((t=>{var e;return null===(e=this.getDataView(t.name))||void 0===e?void 0:e.updateRawData(t.data,t.options)}))}destroy(){this.transformMap=null,this.parserMap=null,this.dataViewMap=null,this._callMap=null,this.target.removeAllListeners()}}const xk="_data-view-diff-rank";class _k{constructor(t,e){var i=this;let o;this.dataSet=t,this.options=e,this.isDataView=!0,this.target=new Y,this.parseOption=null,this.transformsArr=[],this.isRunning=!1,this.rawData={},this.history=!1,this.parserData={},this.latestData={},this._fields=null,this.reRunAllTransform=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{pushHistory:!0,emitMessage:!0};return i.isRunning=!0,i.resetTransformData(),i.transformsArr.forEach((e=>{i.executeTransform(e,{pushHistory:t.pushHistory,emitMessage:!1}),i.isLastTransform(e)&&i.diffLastData()})),i.isRunning=!1,!1!==t.emitMessage&&i.target.emit("change",[]),i},this.markRunning=()=>{this.isRunning=!0,this.target.emit("markRunning",[])},o=(null==e?void 0:e.name)?e.name:Ck("dataview"),this.name=o,(null==e?void 0:e.history)&&(this.history=e.history,this.historyData=[]),this.dataSet.setDataView(o,this),this.setFields(null==e?void 0:e.fields)}parse(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];var o;this.isRunning=!0,i&&this.target.emit("beforeParse",[]),e&&(this.parseOption=e);const n=this.cloneParseData(t,e);if(null==e?void 0:e.type){const t=(null!==(o=this.dataSet.getParser(e.type))&&void 0!==o?o:this.dataSet.getParser("bytejson"))(n,e.options,this);this.rawData=n,this.parserData=t,this.history&&this.historyData.push(n,t),this.latestData=t}else this.parserData=n,this.rawData=n,this.history&&this.historyData.push(n),this.latestData=n;return this.isRunning=!1,i&&this.target.emit("afterParse",[]),this}transform(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(this.isRunning=!0,t&&t.type){let i=!0;if("fields"===t.type){this._fields=t.options.fields;const e=this.transformsArr.findIndex((e=>e.type===t.type));e>=0&&(i=!1,this.transformsArr[e].options.fields=this._fields)}if(i&&this.transformsArr.push(t),e){const e=this.isLastTransform(t);this.executeTransform(t),e&&this.diffLastData()}}return this.sortTransform(),this.isRunning=!1,this}isLastTransform(t){return this.transformsArr[this.transformsArr.length-1]===t}sortTransform(){this.transformsArr.length>=2&&this.transformsArr.sort(((t,e)=>{var i,o;return(null!==(i=t.level)&&void 0!==i?i:0)-(null!==(o=e.level)&&void 0!==o?o:0)}))}executeTransform(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{pushHistory:!0,emitMessage:!0};const{pushHistory:i,emitMessage:o}=e,n=this.dataSet.getTransform(t.type)(this.latestData,t.options);this.history&&!1!==i&&this.historyData.push(n),this.latestData=n,!1!==o&&this.target.emit("change",[])}resetTransformData(){this.latestData=this.parserData,this.history&&(this.historyData.length=0,this.historyData.push(this.rawData,this.parserData))}enableDiff(t){this._diffData=!0,this._diffKeys=t,this._diffMap=new Map,this._diffRank=0}disableDiff(){this._diffData=!1,this._diffMap=null,this._diffRank=null}resetDiff(){this._diffMap=new Map,this._diffRank=0}diffLastData(){var t;if(!this._diffData)return;if(!this.latestData.forEach)return;if(!(null===(t=this._diffKeys)||void 0===t?void 0:t.length))return;const e=this._diffRank+1;if(0===this._diffRank)this.latestData.forEach((t=>{t[xk]=e,this._diffMap.set(this._diffKeys.reduce(((e,i)=>e+t[i]),""),t)})),this.latestDataAUD={add:Array.from(this.latestData),del:[],update:[]};else{let t;this.latestDataAUD={add:[],del:[],update:[]},this.latestData.forEach((i=>{i[xk]=e,t=this._diffKeys.reduce(((t,e)=>t+i[e]),""),this._diffMap.get(t)?this.latestDataAUD.update.push(i):this.latestDataAUD.add.push(i),this._diffMap.set(t,i)})),this._diffMap.forEach(((t,i)=>{t[xk]<e&&(this.latestDataAUD.del.push(t),this._diffMap.delete(i))}))}this._diffRank=e}cloneParseData(t,e){let i=!1;return t instanceof _k||!0!==(null==e?void 0:e.clone)||(i=!0),i?Ct(t):t}parseNewData(t,e){this.parse(t,e||this.parseOption),this.reRunAllTransform()}updateRawData(t,e){const i=this.cloneParseData(t,e);this.rawData=i,this.parserData=i,this.latestData=i,this.reRunAllTransform()}getFields(){var t;return this._fields?this._fields:"dataview"===(null===(t=this.parseOption)||void 0===t?void 0:t.type)&&1===this.rawData.length&&this.rawData[0].getFields?this.rawData[0].getFields():null}setFields(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this._fields=t&&e?St({},this._fields,t):t;const i=this.transformsArr.find((t=>"fields"===t.type));!J(this._fields)&&J(i)?(this.dataSet.registerTransform("fields",bk),this.transform({type:"fields",options:{fields:this._fields}},!1)):i&&(i.options.fields=this._fields)}destroy(){this.dataSet.removeDataView(this.name),this._diffMap=null,this._diffRank=null,this.latestData=null,this.rawData=null,this.parserData=null,this.transformsArr=null,this.target=null}}function Sk(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:["data"];const i=t;let o;if(!Q(i)||"object"!=typeof i)return i;if(function(t){return t instanceof _k}(i)||function(t){try{return t instanceof Element}catch(e){const i=["children","innerHTML","classList","setAttribute","tagName","getBoundingClientRect"],o=Object.keys(t);return i.every((t=>o.includes(t)))}}(i))return i;const n=rt(i),r=i.length;o=n?new Array(r):"object"==typeof i?{}:q(i)||at(i)||nt(i)?i:lt(i)?new Date(+i):void 0;const s=n?void 0:Object.keys(Object(i));let l=-1;if(o)for(;++l<(s||i).length;){const t=s?s[l]:l,n=i[t];(null==e?void 0:e.includes(t.toString()))?o[t]=n:o[t]=Sk(n,e)}return o}function Ak(t){var e,i;const o=Object.assign({},t);return vt(t.style)||(o.textStyle=Bk(t.style)),vt(t.textStyle)||St(o.textStyle,Bk(t.textStyle)),(null===(e=t.shape)||void 0===e?void 0:e.style)&&Bk(o.shape.style),(null===(i=t.background)||void 0===i?void 0:i.style)&&Bk(o.background.style),o}function Bk(t){return vt(t)||t.angle&&(t.angle=ye(t.angle)),t}function Rk(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return vt(t.style)||(t.style=Bk(t.style)),vt(t.state)||Object.keys(t.state).forEach((e=>{vt(t.state[e])||(t.state[e]=Bk(t.state[e]))})),t}function Mk(t){return vt(t)?null:(Object.keys(t).forEach((e=>{vt(t[e])||(t[e]=Bk(t[e]))})),t)}const Tk={left:{textAlign:"center",textBaseline:"bottom"},right:{textAlign:"center",textBaseline:"bottom"},radius:{},angle:{}},kk="PingFang SC,Microsoft Yahei,system-ui,-apple-system,segoe ui,Roboto,Helvetica,Arial,sans-serif, apple color emoji,segoe ui emoji,segoe ui symbol",Lk=14,Pk=14,Ek=4,Hk={domainLine:{visible:!0,style:{lineWidth:1,stroke:"#D9DDE4",strokeOpacity:1}},grid:{visible:!0,style:{lineWidth:1,stroke:"#EBEDF2",strokeOpacity:1,lineDash:[]}},subGrid:{visible:!1,style:{lineWidth:1,stroke:"#EBEDF2",strokeOpacity:1,lineDash:[4,4]}},tick:{visible:!0,tickSize:Ek,style:{lineWidth:1,stroke:"#D9DDE4",strokeOpacity:1}},subTick:{visible:!1,tickSize:Ek/2,style:{lineWidth:1,stroke:"#D9DDE4",strokeOpacity:1}},label:{visible:!0,space:1,style:{fontSize:Pk,fill:"#89909D",fontWeight:"normal",fillOpacity:1},autoLimit:!0},title:{space:10,style:{fontSize:Pk,fill:"#333333",fontWeight:"normal",fillOpacity:1}}};function Fk(t){var e,i,o,n,r,s,l,a,h,d,c,u,g;const p=St({},t);let f,v=null!==(i=null===(e=p.title)||void 0===e?void 0:e.angle)&&void 0!==i?i:0;"left"!==p.orient&&"right"!==p.orient||(null===(o=p.title)||void 0===o?void 0:o.autoRotate)&&J(p.title.angle)&&(v="left"===p.orient?-90:90,f=Tk[p.orient]);const m=function(t,e){if(!t||!it(t))return t;const i={};return Object.keys(t).forEach((o=>{const n=t[o];let r=!1;e.forEach((t=>{(nt(t)&&t===o||t instanceof RegExp&&o.match(t))&&(r=!0)})),r||(i[o]=n)})),i}(p.label,["style","formatMethod","state"]);return{orient:p.orient,select:p.select,hover:p.hover,line:(b=p.domainLine,Rk(b),Rk(b.startSymbol),Rk(b.endSymbol),b),label:Object.assign({style:Bk(p.label.style),formatMethod:p.label.formatMethod?(t,e,i)=>p.label.formatMethod(e.rawValue,e):null,state:Mk(p.label.state)},m),tick:{visible:p.tick.visible,length:p.tick.tickSize,inside:p.tick.inside,alignWithLabel:p.tick.alignWithLabel,style:Bk(p.tick.style),state:Mk(p.tick.state),dataFilter:p.tick.dataFilter},subTick:{visible:p.subTick.visible,length:p.subTick.tickSize,inside:p.subTick.inside,count:p.subTick.tickCount,style:Bk(p.subTick.style),state:Mk(p.subTick.state)},grid:{type:"line",visible:p.grid.visible,alternateColor:p.grid.alternateColor,alignWithLabel:p.grid.alignWithLabel,style:Bk(p.grid.style)},subGrid:{type:"line",visible:p.subGrid.visible,alternateColor:p.subGrid.alternateColor,style:Bk(p.subGrid.style)},title:{visible:p.title.visible,position:p.title.position,space:p.title.space,autoRotate:!1,angle:v?ye(v):null,textStyle:St({},f,Bk(p.title.style)),padding:p.title.padding,shape:{visible:null===(n=p.title.shape)||void 0===n?void 0:n.visible,space:null===(r=p.title.shape)||void 0===r?void 0:r.space,style:Bk(null===(s=p.title.shape)||void 0===s?void 0:s.style)},background:{visible:null===(l=p.title.background)||void 0===l?void 0:l.visible,style:Bk(null===(a=p.title.background)||void 0===a?void 0:a.style)},state:{text:Mk(p.title.state),shape:Mk(null===(h=p.title.shape)||void 0===h?void 0:h.state),background:Mk(null===(d=p.title.background)||void 0===d?void 0:d.state)}},panel:{visible:null===(c=p.background)||void 0===c?void 0:c.visible,style:Bk(null===(u=p.background)||void 0===u?void 0:u.style),state:Mk(null===(g=p.background)||void 0===g?void 0:g.state)}};var b}class zk{constructor(t,e,i,o){this.seqId=0,this.leftRowSeriesNumberColumnCount=0,this.rightRowSeriesNumberColumnCount=0,this.bodyRowSpanCount=1,this._transpose=!1,this._showHeader=!0,this._recordsCount=0,this._hasAggregation=!1,this._hasAggregationOnTopCount=0,this._hasAggregationOnBottomCount=0,this._cellRangeMap=new Map,this._showHeader=i,this._table=t,this._columns=[],this._columnsIncludeHided=[],this._headerCellIds=[],this.hierarchyIndent=null!=o?o:20,this.hierarchyTextStartAlignment=t.options.hierarchyTextStartAlignment,this.columnTree=new OT(e,{seqId:0}),this._headerObjectsIncludeHided=this._addHeaders(0,e,[]),this._headerObjects=this._headerObjectsIncludeHided.filter((t=>!0!==t.define.hide)),this._headerObjectMap=this._headerObjects.reduce(((t,e)=>(t[e.id]=e,t)),{}),this.rowHierarchyType=function(t){if(t._table.options.groupBy)return!0;const{columns:e}=t._table.options;if(rt(e)&&e.length>0)for(let t=0;t<e.length;t++){const i=e[t];if(!nt(i)&&i.tree)return!0}return!1}(this)?"tree":"grid",this._hasAggregation=function(t){const e=t.columnObjects;for(let t=0;t<e.length;t++){const i=e[t];if(null==i?void 0:i.aggregation)return!0}return!1}(this),this._hasAggregationOnBottomCount=function(t){const e=t.columnObjects;let i=0;for(let t=0;t<e.length;t++){const o=e[t];(null==o?void 0:o.aggregation)&&(Array.isArray(null==o?void 0:o.aggregation)?i=Math.max(i,o.aggregation.filter((t=>!t.showOnTop)).length):o.aggregation.showOnTop||(i=Math.max(i,1)))}return i}(this),this._hasAggregationOnTopCount=function(t){const e=t.columnObjects;let i=0;for(let t=0;t<e.length;t++){const o=e[t];(null==o?void 0:o.aggregation)&&(Array.isArray(null==o?void 0:o.aggregation)?i=Math.max(i,o.aggregation.filter((t=>t.showOnTop)).length):o.aggregation.showOnTop&&(i=Math.max(i,1)))}return i}(this),this.handleRowSeriesNumber(t.internalProps.rowSeriesNumber)}handleRowSeriesNumber(t){var e,i;t&&(Array.isArray(t)?this.rowSeriesNumberColumn=t.map((e=>{var i,o;return{id:this.seqId++,title:e.title,define:e,cellType:null!==(i=e.cellType)&&void 0!==i?i:"text",headerType:null!==(o=t.cellType)&&void 0!==o?o:"text",style:e.style,width:e.width,format:e.format,field:e.field,icon:e.icon,headerIcon:e.headerIcon,isChildNode:!1}})):this.rowSeriesNumberColumn=[{id:this.seqId++,title:t.title,define:t,cellType:null!==(e=t.cellType)&&void 0!==e?e:"text",headerType:null!==(i=t.cellType)&&void 0!==i?i:"text",style:t.style,width:t.width,format:t.format,field:"",icon:t.icon,headerIcon:t.headerIcon,isChildNode:!1}],this.leftRowSeriesNumberColumn=this.rowSeriesNumberColumn.filter((t=>!0)),this.rightRowSeriesNumberColumn=this.rowSeriesNumberColumn.filter((t=>!1)),this.leftRowSeriesNumberColumnCount=this.leftRowSeriesNumberColumn.length,this.rightRowSeriesNumberColumnCount=this.rightRowSeriesNumberColumn.length)}get transpose(){return this._transpose}set transpose(t){this._transpose=t}get showHeader(){return this._showHeader}set showHeader(t){this._showHeader=t}isSeriesNumberInHeader(t,e){if(this.leftRowSeriesNumberColumnCount>0&&t>=0&&e>=0&&t<this.leftRowSeriesNumberColumnCount){if(this.transpose)return!1;if(e<this.headerLevelCount)return!0}if(this.rightRowSeriesNumberColumnCount>0&&e>=0&&t>=this.colCount-this.rightRowSeriesNumberColumnCount){if(this.transpose)return!1;if(e<this.headerLevelCount)return!0}return!1}isSeriesNumberInBody(t,e){if(this.leftRowSeriesNumberColumnCount>0&&t>=0&&t<this.leftRowSeriesNumberColumnCount){if(this.transpose)return!0;if(e>=this.headerLevelCount)return!0}if(this.rightRowSeriesNumberColumnCount>0&&t>=this.colCount-this.rightRowSeriesNumberColumnCount){if(this.transpose)return!0;if(e>=this.headerLevelCount)return!0}return!1}isSeriesNumber(t,e){if(Q(t)&&Q(e)){if(this.leftRowSeriesNumberColumnCount>0&&t>=0&&e>=0&&t<this.leftRowSeriesNumberColumnCount)return!0;if(this.rightRowSeriesNumberColumnCount>0&&e>=0&&t>=this.colCount-this.rightRowSeriesNumberColumnCount)return!0}return!1}getSeriesNumberHeader(t,e){if(this.leftRowSeriesNumberColumnCount>0&&t>=0&&t<this.leftRowSeriesNumberColumnCount){if(this.transpose)return;if(e<this.headerLevelCount)return Object.assign({},this.leftRowSeriesNumberColumn[t],{style:this._table.internalProps.rowSeriesNumber.headerStyle})}if(this.rightRowSeriesNumberColumnCount>0&&t>=this.colCount-this.rightRowSeriesNumberColumnCount&&e<this.headerLevelCount){if(this.transpose)return;if(e<this.headerLevelCount)return this.rightRowSeriesNumberColumn[t-(this.colCount-this.rightRowSeriesNumberColumnCount)]}}getSeriesNumberBody(t,e){if(this.leftRowSeriesNumberColumnCount>0&&t>=0&&t<this.leftRowSeriesNumberColumnCount){if(this.transpose)return this.leftRowSeriesNumberColumn[t];if(e>=this.headerLevelCount)return this.leftRowSeriesNumberColumn[t]}if(this.rightRowSeriesNumberColumnCount>0&&t>=this.colCount-this.rightRowSeriesNumberColumnCount){if(this.transpose)return this.rightRowSeriesNumberColumn[t-(this.colCount-this.rightRowSeriesNumberColumnCount)];if(e>=this.headerLevelCount)return this.rightRowSeriesNumberColumn[t-(this.colCount-this.rightRowSeriesNumberColumnCount)]}}isHeader(t,e){return!!(this.transpose&&t>=this.leftRowSeriesNumberColumnCount&&t<this.headerLevelCount+this.leftRowSeriesNumberColumnCount)||!this.transpose&&e>=0&&e<this.headerLevelCount}isAggregation(t,e){if(this.hasAggregation){if(this.hasAggregationOnBottomCount)if(this.transpose){if(t>=this.colCount-this.hasAggregationOnBottomCount)return!0}else if(e>=this.rowCount-this.hasAggregationOnBottomCount)return!0;if(this.hasAggregationOnTopCount)if(this.transpose){if(t>=this.rowHeaderLevelCount&&t<this.rowHeaderLevelCount+this.hasAggregationOnTopCount)return!0}else if(e>=this.columnHeaderLevelCount&&e<this.columnHeaderLevelCount+this.hasAggregationOnTopCount)return!0}return!1}isTopAggregation(t,e){if(this.hasAggregationOnTopCount)if(this.transpose){if(t>=this.rowHeaderLevelCount&&t<this.rowHeaderLevelCount+this.hasAggregationOnTopCount)return!0}else if(e>=this.columnHeaderLevelCount&&e<this.columnHeaderLevelCount+this.hasAggregationOnTopCount)return!0;return!1}isBottomAggregation(t,e){if(this.hasAggregationOnBottomCount)if(this.transpose){if(t>=this.colCount-this.hasAggregationOnBottomCount)return!0}else if(e>=this.rowCount-this.hasAggregationOnBottomCount)return!0;return!1}get hasAggregation(){return this._hasAggregation}get hasAggregationOnTopCount(){return this._hasAggregationOnTopCount}get hasAggregationOnBottomCount(){return this._hasAggregationOnBottomCount}getAggregatorsByCell(t,e){return this.getColumnDefine(t,e).vtable_aggregator}getAggregatorsByCellRange(t,e,i,o){let n=[];if(!this.transpose){for(let o=t;o<=i;o++){const t=this.getColumnDefine(o,e);t.vtable_aggregator&&(n=n.concat(Array.isArray(t.vtable_aggregator)?t.vtable_aggregator:[t.vtable_aggregator]))}return n}for(let i=e;i<=o;i++){const e=this.getColumnDefine(t,i);e.vtable_aggregator&&(n=n.concat(Array.isArray(e.vtable_aggregator)?e.vtable_aggregator:[e.vtable_aggregator]))}return[]}getAggregatorOnTop(t,e){const i=this.getColumnDefine(t,e),o=i.vtable_aggregator,n=i.aggregation;if(Array.isArray(n)){const i=n.reduce(((t,e,i)=>(e.showOnTop&&t.push(i),t)),[]).map((t=>o[t]));return this.transpose?i[t-this.rowHeaderLevelCount]:i[e-this.columnHeaderLevelCount]}return this.transpose&&t-this.rowHeaderLevelCount==0?(null==n?void 0:n.showOnTop)?o:null:this.transpose||e-this.columnHeaderLevelCount!=0?null:(null==n?void 0:n.showOnTop)?o:null}getAggregatorOnBottom(t,e){const i=this.getColumnDefine(t,e),o=i.vtable_aggregator,n=i.aggregation;if(Array.isArray(n)){const i=n.reduce(((t,e,i)=>(e.showOnTop||t.push(i),t)),[]).map((t=>o[t]));return this.transpose?i[t-(this.colCount-this.hasAggregationOnBottomCount)]:i[e-(this.rowCount-this.hasAggregationOnBottomCount)]}return this.transpose&&t-(this.colCount-this.hasAggregationOnBottomCount)==0?(null==n?void 0:n.showOnTop)?null:o:this.transpose||e-(this.rowCount-this.hasAggregationOnBottomCount)!=0||(null==n?void 0:n.showOnTop)?null:o}getAggregatorCellAddress(t,e,i,o){const n=[],r=this.hasAggregationOnTopCount,s=this.hasAggregationOnBottomCount;if(this.transpose){for(let i=e;i<=o;i++)if(this.getColumnDefine(t,i).vtable_aggregator){for(let t=0;t<r;t++)n.push({col:this.headerLevelCount+t,row:i});for(let t=0;t<s;t++)n.push({col:this.rowCount-s+t,row:i})}}else for(let o=t;o<=i;o++)if(this.getColumnDefine(o,e).vtable_aggregator){for(let t=0;t<r;t++)n.push({col:o,row:this.headerLevelCount+t});for(let t=0;t<s;t++)n.push({col:o,row:this.rowCount-s+t})}return n}getCellLocation(t,e){return this.isHeader(t,e)?this.transpose?"rowHeader":"columnHeader":"body"}isRowHeader(t,e){return!!(this.transpose&&t>=this.leftRowSeriesNumberColumnCount&&t<this.headerLevelCount+this.leftRowSeriesNumberColumnCount)}isColumnHeader(t,e){return!this.transpose&&e>=0&&e<=this.headerLevelCount-1&&t>=this.leftRowSeriesNumberColumnCount&&t<this.colCount-this.rightRowSeriesNumberColumnCount}isFrozenColumn(t,e){if(Q(e)){if(t>=0&&t<this.frozenColCount&&e>=this.frozenRowCount&&e<this.rowCount-this.bottomFrozenRowCount)return!0}else if(this.frozenColCount>0&&t>=0&&t<this.frozenColCount)return!0;return!1}isRightFrozenColumn(t,e){if(Q(e)){if(t>=this.colCount-this.rightFrozenColCount&&e>=this.frozenRowCount&&e<this.rowCount-this.bottomFrozenRowCount)return!0}else if(this.rightFrozenColCount>0&&t>=this.colCount-this.rightFrozenColCount)return!0;return!1}isFrozenRow(t,e){if(Q(e)){if(e>=0&&e<this.frozenRowCount&&t>=this.frozenColCount&&t<this.colCount-this.rightFrozenColCount)return!0}else if(e=t,this.frozenRowCount>0&&e>=0&&e<this.frozenRowCount)return!0;return!1}isBottomFrozenRow(t,e){if(Q(e)){if(e>=this.rowCount-this.bottomFrozenRowCount&&t>=this.frozenColCount&&t<this.colCount-this.rightFrozenColCount)return!0}else if(e=t,this.bottomFrozenRowCount>0&&e>=this.rowCount-this.bottomFrozenRowCount)return!0;return!1}isLeftBottomCorner(t,e){return t>=0&&t<this.rowHeaderLevelCount&&e>=this.rowCount-this.bottomFrozenRowCount}isRightTopCorner(t,e){return t>=this.colCount-this.rightFrozenColCount&&e>=0&&e<this.columnHeaderLevelCount}isRightBottomCorner(t,e){return t>=this.colCount-this.rightFrozenColCount&&e>=this.rowCount-this.bottomFrozenRowCount}isCornerHeader(t,e){return!1}getColumnHeaderRange(){var t,e;return this.transpose?{start:{col:0,row:0},end:{col:this._headerCellIds.length-1,row:(null!==(t=this.rowCount)&&void 0!==t?t:0)-1}}:{start:{col:0,row:0},end:{col:(null!==(e=this.colCount)&&void 0!==e?e:0)-1,row:this._headerCellIds.length-1}}}getRowHeaderRange(){var t,e;return this.transpose?{start:{col:0,row:0},end:{col:this._headerCellIds.length-1,row:(null!==(t=this.rowCount)&&void 0!==t?t:0)-1}}:{start:{col:0,row:0},end:{col:(null!==(e=this.colCount)&&void 0!==e?e:0)-1,row:this._headerCellIds.length-1}}}getCornerHeaderRange(){}getBodyRange(){var t,e,i,o;return this.transpose?{start:{col:this.headerLevelCount,row:0},end:{col:(null!==(t=this.colCount)&&void 0!==t?t:0)-1,row:(null!==(e=this.rowCount)&&void 0!==e?e:0)-1}}:{start:{col:0,row:this.headerLevelCount},end:{col:(null!==(i=this.colCount)&&void 0!==i?i:0)-1,row:(null!==(o=this.rowCount)&&void 0!==o?o:0)-1}}}get headerLevelCount(){return this.showHeader?this._headerCellIds.length:0}get columnHeaderLevelCount(){return this.transpose?0:this.headerLevelCount}get rowHeaderLevelCount(){return this.transpose?this.headerLevelCount:0}get frozenColCount(){return this._table.internalProps.frozenColCount?this.colCount>this._table.internalProps.frozenColCount?this._table.internalProps.frozenColCount:this.colCount:0}get frozenRowCount(){return this._table.internalProps.frozenRowCount?this.rowCount>=this._table.internalProps.frozenRowCount?this._table.internalProps.frozenRowCount:this.rowCount:0}get bottomFrozenRowCount(){return this._table.internalProps.bottomFrozenRowCount?this.rowCount-this.headerLevelCount>=this._table.internalProps.bottomFrozenRowCount?this._table.internalProps.bottomFrozenRowCount:this.rowCount-this.headerLevelCount:0}get rightFrozenColCount(){return this._table.internalProps.rightFrozenColCount?this.colCount-this.frozenColCount>=this._table.internalProps.rightFrozenColCount?this._table.internalProps.rightFrozenColCount:Math.max(0,this.colCount-this.frozenColCount):0}get colCount(){return this.transpose?this.headerLevelCount+this.recordsCount+this.leftRowSeriesNumberColumnCount+this.rightRowSeriesNumberColumnCount:this._columns.length+this.leftRowSeriesNumberColumnCount+this.rightRowSeriesNumberColumnCount}get rowCount(){return this.transpose?this._columns.length:this.headerLevelCount+this.recordsCount}get bodyRowCount(){return this.transpose?this._columns.length:this.rowCount-this.bottomFrozenRowCount-this.headerLevelCount}get bodyColCount(){return this.transpose?this.colCount-this.rightFrozenColCount-this.rowHeaderLevelCount:this._columns.length}get recordsCount(){return this._recordsCount}set recordsCount(t){this._recordsCount=t}get headerObjects(){return this._headerObjects}get columnObjects(){return this._columns}get headerObjectsIncludeHided(){return this._headerObjectsIncludeHided}get columnWidths(){if(this.leftRowSeriesNumberColumnCount){const t=this.leftRowSeriesNumberColumn.map((t=>({width:t.width,minWidth:t.minWidth,maxWidth:t.maxWidth})));return t.push(...this._columns.map((t=>({width:t.width,minWidth:t.minWidth,maxWidth:t.maxWidth})))),t}return this._columns.map((t=>({width:t.width,minWidth:t.minWidth,maxWidth:t.maxWidth})))}getColumnWidthDefined(t){var e;if(t>=0){if(t<this.leftRowSeriesNumberColumnCount)return this.leftRowSeriesNumberColumn[t];if(this.transpose){let i,o,n=0;if(t>=this.rowHeaderLevelCount+this.leftRowSeriesNumberColumnCount){let t;return this.columnObjects.forEach(((e,r)=>{"number"==typeof e.width?n=Math.max(e.width,n):"auto"===e.width&&(t=!0),"number"==typeof e.minWidth&&(o=Math.max(e.minWidth,o)),"number"==typeof e.maxWidth&&(i=Math.max(e.maxWidth,i))})),n=n>0?n:t?"auto":void 0,{width:n,minWidth:o,maxWidth:i}}if(this.isRowHeader(t,0)){const i=Array.isArray(this._table.defaultHeaderColWidth)?null!==(e=this._table.defaultHeaderColWidth[t])&&void 0!==e?e:this._table.defaultColWidth:this._table.defaultHeaderColWidth;return"auto"===i?{width:"auto"}:{width:i}}}return this._columns[t-this.leftRowSeriesNumberColumnCount]}}getCellId(t,e){var i,o,n,r;return this.transpose?t>=this.headerLevelCount+this.leftRowSeriesNumberColumnCount?null===(i=this._columns[e])||void 0===i?void 0:i.id:this.isSeriesNumber(t,e)?e+"_series_number":null===(o=this._headerCellIds[t-this.leftRowSeriesNumberColumnCount])||void 0===o?void 0:o[e]:this.isSeriesNumber(t,e)?this.rowSeriesNumberColumn[t].id:this.headerLevelCount<=e?null===(n=this._columns[t-this.leftRowSeriesNumberColumnCount])||void 0===n?void 0:n.id:null===(r=this._headerCellIds[e])||void 0===r?void 0:r[t-this.leftRowSeriesNumberColumnCount]}getHeader(t,e){if(this.isSeriesNumberInHeader(t,e))return this.getSeriesNumberHeader(t,e);const i=this.getCellId(t,e);return this._headerObjectMap[i]}getHeaderField(t,e){var i;const o=this.getCellId(t,e);return(null===(i=this._headerObjectMap[o])||void 0===i?void 0:i.field)||(this.transpose?this._columns[e]&&this._columns[e].field:this._columns[t-this.leftRowSeriesNumberColumnCount]&&this._columns[t-this.leftRowSeriesNumberColumnCount].field)}getHeaderCellAdressById(t){for(let e=0;e<this._headerCellIds.length;e++){const i=this._headerCellIds[e];for(let o=0;o<i.length;o++)if(i[o]===t)return this.transpose?{col:e,row:o}:{col:o+this.leftRowSeriesNumberColumnCount,row:e}}}getHeaderCellAddressByField(t){const e=this.headerObjects.find((e=>e&&e.field===t));return e&&this.getHeaderCellAdressById(e.id)}getBody(t,e){return this.isSeriesNumber(t,e)?this.getSeriesNumberBody(t,e):this.transpose?this._columns[e]:this._columns[t-this.leftRowSeriesNumberColumnCount]}getBodyLayoutRangeById(t){var e,i;if(this.transpose){for(let i=0;i<(null!==(e=this.rowCount)&&void 0!==e?e:0);i++)if(t===this._columns[i].id)return{start:{col:0,row:i},end:{col:0,row:i}}}else for(let e=this.leftRowSeriesNumberColumnCount;e<(null!==(i=this.colCount)&&void 0!==i?i:0);e++)if(t===this._columns[e-this.leftRowSeriesNumberColumnCount].id)return{start:{col:e,row:0},end:{col:e,row:0}};return{start:{col:-1,row:-1},end:{col:-1,row:-1}}}getCellRange(t,e){return function(t,e,i){var o,n,r;if(-1===t||-1===e)return{start:{col:t,row:e},end:{col:t,row:e}};if(i._cellRangeMap.has(`$${t}$${e}`))return i._cellRangeMap.get(`$${t}$${e}`);let s={start:{col:t,row:e},end:{col:t,row:e}};if(i.transpose)s=function(t,e,i){var o,n,r,s;const l={start:{col:t,row:e},end:{col:t,row:e}};if(i.headerLevelCount+i.leftRowSeriesNumberColumnCount<=t||-1===t&&-1===e){if(i.headerLevelCount+i.leftRowSeriesNumberColumnCount<=t&&(null===(n=null===(o=i.columnObjects[e])||void 0===o?void 0:o.define)||void 0===n?void 0:n.mergeCell)){const o=i._table.getCellValue(t,e);for(let n=t-1;n>=i.headerLevelCount+i.leftRowSeriesNumberColumnCount;n--){const t=i._table.getCellValue(n,e);if("boolean"==typeof i.columnObjects[e].define.mergeCell){if(o!==t)break}else if(!i.columnObjects[e].define.mergeCell(o,t))break;l.start.col=n}for(let n=t+1;n<(null!==(r=i.colCount)&&void 0!==r?r:0);n++){const t=i._table.getCellValue(n,e);if("boolean"==typeof i.columnObjects[e].define.mergeCell){if(o!==t)break}else if(!i.columnObjects[e].define.mergeCell(o,t))break;l.end.col=n}}return l}const a=i.getCellId(t,e);for(let o=e-1;o>=0&&a===i.getCellId(t,o);o--)l.start.row=o;for(let o=e+1;o<(null!==(s=i.rowCount)&&void 0!==s?s:0)&&a===i.getCellId(t,o);o++)l.end.row=o;for(let o=t-1;o>=0&&a===i.getCellId(o,e);o--)l.start.col=o;for(let o=t+1;o<i.headerLevelCount+i.leftRowSeriesNumberColumnCount&&a===i.getCellId(o,e);o++)l.end.col=o;return l}(t,e,i);else if(i.headerLevelCount<=e){if(i.headerLevelCount<=e&&(null===(n=null===(o=i.columnObjects[t-i.leftRowSeriesNumberColumnCount])||void 0===o?void 0:o.define)||void 0===n?void 0:n.mergeCell)){const o=i._table.getCellValue(t,e);for(let n=e-1;n>=i.headerLevelCount;n--){const e=i._table.getCellValue(t,n);if("boolean"==typeof i.columnObjects[t-i.leftRowSeriesNumberColumnCount].define.mergeCell){if(o!==e)break}else if(!i.columnObjects[t-i.leftRowSeriesNumberColumnCount].define.mergeCell(o,e))break;s.start.row=n}for(let n=e+1;n<i.rowCount;n++){const e=i._table.getCellValue(t,n);if("boolean"==typeof i.columnObjects[t-i.leftRowSeriesNumberColumnCount].define.mergeCell){if(o!==e)break}else if(!i.columnObjects[t-i.leftRowSeriesNumberColumnCount].define.mergeCell(o,e))break;s.end.row=n}}!function(t,e,i,o){if("tree"!==o.rowHierarchyType)return;const n=o._table.getCellRawRecord(t,e);(null==n?void 0:n.vtableMerge)&&(i.start.col=o.rowHeaderLevelCount,i.end.col=o.colCount-1,i.start.row=i.end.row=e)}(t,e,s,i)}else{const o=i.getCellId(t,e);for(let n=t-1;n>=0&&o===i.getCellId(n,e);n--)s.start.col=n;for(let n=t+1;n<(null!==(r=i.colCount)&&void 0!==r?r:0)&&o===i.getCellId(n,e);n++)s.end.col=n;for(let n=e-1;n>=0&&o===i.getCellId(t,n);n--)s.start.row=n;for(let n=e+1;n<i.headerLevelCount&&o===i.getCellId(t,n);n++)s.end.row=n}return i._cellRangeMap.set(`$${t}$${e}`,s),s}(t,e,this)}isCellRangeEqual(t,e,i,o){const n=this.getCellRange(t,e),r=this.getCellRange(i,o);return n.start.col===r.start.col&&n.end.col===r.end.col&&n.start.row===r.start.row&&n.end.row===r.end.row}getRecordShowIndexByCell(t,e){const i=this.hasAggregationOnTopCount?this.headerLevelCount+1:this.headerLevelCount;return this.transpose?t<i?-1:t-i:e<i?-1:e-i}getRecordStartRowByRecordIndex(t){return(this.hasAggregationOnTopCount?this.headerLevelCount+1:this.headerLevelCount)+t}_addHeaders(t,e,i,o){const n=[],r=this._newRow(t,o);return e.forEach((e=>{var s,l,a,h;const d=this._columns.length,c=this.seqId++,u={id:c,title:null!==(s=e.title)&&void 0!==s?s:e.caption,headerIcon:e.headerIcon,field:e.field,style:e.headerStyle,headerType:null!==(l=e.headerType)&&void 0!==l?l:"text",dropDownMenu:e.dropDownMenu,define:e,columnWidthComputeMode:e.columnWidthComputeMode};n[c]=u;for(let e=t-1;e>=0;e--)this._headerCellIds[e]&&(this._headerCellIds[e][d]=i[e]);if(o?this._headerCellIds[t-1]&&(r[d]=this._headerCellIds[t-1][d]):r[d]=c,e.columns)this._addHeaders(t+1,e.columns,[...i,c],e.hideColumnsSubHeader||o).forEach((t=>n.push(t)));else{const i={id:this.seqId++,field:e.field,fieldFormat:e.fieldFormat,width:e.width,minWidth:e.minWidth,maxWidth:e.maxWidth,icon:e.icon,cellType:null!==(h=null!==(a=e.cellType)&&void 0!==a?a:e.columnType)&&void 0!==h?h:"text",chartModule:"chartModule"in e?e.chartModule:null,chartSpec:"chartSpec"in e?e.chartSpec:null,sparklineSpec:"sparklineSpec"in e?e.sparklineSpec:cx,style:e.style,define:e,columnWidthComputeMode:e.columnWidthComputeMode,disableColumnResize:null==e?void 0:e.disableColumnResize,aggregation:e.aggregation,isChildNode:t>=1};if(this._columnsIncludeHided.push(i),!0!==e.hide){this._columns.push(i);for(let e=t+1;e<this._headerCellIds.length;e++)this._headerCellIds[e][d]=c}}})),n}_newRow(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(this._headerCellIds[t]){const e=this._headerCellIds[t-1];if(e.length>this._headerCellIds[t].length)for(let i=this._headerCellIds[t].length;i<e.length;i++)this._headerCellIds[t][i]=e[i];return this._headerCellIds[t]}if(e)return[];const i=this._headerCellIds[t]=[];if(!this._columns.length)return i;const o=this._headerCellIds[t-1];for(let t=0;t<o.length;t++)i[t]=o[t];return i}getCellHeaderPaths(t,e){if(this.isSeriesNumber(t,e))return;let i=[],o=[];return this.transpose?o=[{field:this._columns[e].field}]:i=[{field:this._columns[t-this.leftRowSeriesNumberColumnCount].field}],{colHeaderPaths:i,rowHeaderPaths:o,cellLocation:this.getCellLocation(t,e)}}getParentCellId(t,e){if(0!==e){if(this.isColumnHeader(t,e))return this.getCellId(t,e-1);if(this.isRowHeader(t,e)){if(this.isSeriesNumberInBody(t-1,e))return;return this.getCellId(t-1,e)}}}canMoveHeaderPosition(t,e){if(this.isSeriesNumberInHeader(e.col,e.row)||this.isSeriesNumberInHeader(t.col,t.row))return!1;if(!this.transpose&&this.isSeriesNumberInBody(e.col,e.row)&&this.isSeriesNumberInBody(t.col,t.row)){const i=this.getRecordShowIndexByCell(0,t.row),o=this.getRecordShowIndexByCell(0,e.row);return this._table.dataSource.isCanExchangeOrder(i,o)}if(this.transpose&&this.isSeriesNumberInBody(e.col,e.row)&&this.isSeriesNumberInBody(t.col,t.row)&&(this.getBody(t.col+this.leftRowSeriesNumberColumnCount,t.row).isChildNode&&this.getBody(e.col+this.leftRowSeriesNumberColumnCount,e.row).isChildNode?(t.col=t.col+this.leftRowSeriesNumberColumnCount+this.rowHeaderLevelCount-1,e.col=e.col+this.leftRowSeriesNumberColumnCount+this.rowHeaderLevelCount-1):(t.col=t.col+this.leftRowSeriesNumberColumnCount,e.col=e.col+this.leftRowSeriesNumberColumnCount)),t.col<0||t.row<0||e.col<0||e.row<0)return!1;if("disabled"===this._table.internalProps.frozenColDragHeaderMode&&this._table.isFrozenColumn(e.col))return!1;const i=this.getCellRange(t.col,t.row);return this.isColumnHeader(t.col,t.row)?this.getParentCellId(t.col,i.start.row)===this.getParentCellId(e.col,i.start.row):!!this.isRowHeader(t.col,t.row)&&this.getParentCellId(i.start.col,t.row)===this.getParentCellId(i.start.col,e.row)}moveHeaderPosition(t,e){if(this.canMoveHeaderPosition(t,e)){let i=this.getCellRange(t.col,t.row);if(this.isColumnHeader(t.col,t.row)){const o=i.end.col-i.start.col+1;let n;const r=this.getCellRange(e.col,i.start.row);if(n=e.col>=t.col?r.end.col-o+1:r.start.col,n===i.start.col)return null;for(let t=0;t<this._headerCellIds.length;t++){const e=this._headerCellIds[t].splice(i.start.col-this.leftRowSeriesNumberColumnCount,o);e.unshift(n-this.leftRowSeriesNumberColumnCount,0),Array.prototype.splice.apply(this._headerCellIds[t],e)}const s=this._columns.splice(i.start.col-this.leftRowSeriesNumberColumnCount,o);return s.unshift(n-this.leftRowSeriesNumberColumnCount,0),Array.prototype.splice.apply(this._columns,s),this.columnTree.movePosition(i.start.row,i.start.col-this.leftRowSeriesNumberColumnCount,n-this.leftRowSeriesNumberColumnCount),this.columnTree.reset(this.columnTree.tree.children,!0),this._cellRangeMap=new Map,{sourceIndex:i.start.col,targetIndex:n,sourceSize:o,targetSize:r.end.col-r.start.col+1,moveType:"column"}}if(this.isRowHeader(t.col,t.row)||this.isSeriesNumberInBody(t.col,t.row)&&this.transpose){this.isSeriesNumberInBody(t.col,t.row)&&(i=this.getCellRange(t.col+this.leftRowSeriesNumberColumnCount,t.row));const o=i.end.row-i.start.row+1;let n;const r=this.getCellRange(i.start.col,e.row);if(n=e.row>=t.row?r.end.row-o+1:r.start.row,n===i.start.row)return null;for(let t=0;t<this._headerCellIds.length;t++){const e=this._headerCellIds[t].splice(i.start.row,o);e.unshift(n,0),Array.prototype.splice.apply(this._headerCellIds[t],e)}const s=this._columns.splice(i.start.row,o);return s.unshift(n,0),Array.prototype.splice.apply(this._columns,s),this.columnTree.movePosition(i.start.col-this.leftRowSeriesNumberColumnCount,i.start.row,n+(e.row>t.row?i.end.row-i.start.row:0)),this.columnTree.reset(this.columnTree.tree.children,!0),this._cellRangeMap=new Map,{sourceIndex:i.start.row,targetIndex:n,sourceSize:o,targetSize:r.end.row-r.start.row+1,moveType:"row"}}if(this.isSeriesNumberInBody(t.col,t.row))return{sourceIndex:t.row,targetIndex:e.row,sourceSize:1,targetSize:1,moveType:"row"}}return null}toggleHierarchyState(t){return{addCellPositions:t.add.map((t=>({col:0,row:this._table.frozenRowCount+t}))),removeCellPositions:t.remove.map((t=>({col:0,row:this._table.frozenRowCount+t})))}}setChartInstance(t,e,i){const o=this.transpose?this._columns[e]:this._columns[t-this.leftRowSeriesNumberColumnCount];"function"!=typeof o.chartSpec&&(o.chartInstance=i)}getChartInstance(t,e){return(this.transpose?this._columns[e]:this._columns[t-this.leftRowSeriesNumberColumnCount]).chartInstance}checkHasChart(){return function(t){let e=!1;for(let i=0;i<t.columnObjects.length;i++)if(t.columnObjects[i].chartSpec){e=!0;break}return e}(this)}getAxisConfigInPivotChart(t,e){}isEmpty(t,e){return!1}isAxisCell(t,e){return!1}getChartAxes(t,e){return[]}isShareChartSpec(t,e){const i=this.getBody(t,e);return"function"!=typeof(null==i?void 0:i.chartSpec)}getChartSpec(t,e){return this.getRawChartSpec(t,e)}getRawChartSpec(t,e){const i=this.getBody(t,e),o=null==i?void 0:i.chartSpec;return"function"==typeof o?o({col:t,row:e,dataValue:this._table.getCellOriginValue(t,e)||"",value:this._table.getCellValue(t,e)||"",rect:this._table.getCellRangeRelativeRect(this._table.getCellRange(t,e)),table:this._table}):o}getChartDataId(t,e){return function(t,e,i){var o;const n=i.getRawChartSpec(t,e);if(null==n?void 0:n.series){const t={};return(null===(o=n.data)||void 0===o?void 0:o.id)&&(t[n.data.id]=void 0),null==n||n.series.forEach((e=>{var i,o,r,s,l,a,h,d,c,u,g;if(!(null===(i=e.data)||void 0===i?void 0:i.fromDataId))if(null===(o=e.data)||void 0===o?void 0:o.transforms)t[null!==(g=null!==(c=null===(d=e.data)||void 0===d?void 0:d.id)&&void 0!==c?c:null===(u=n.data)||void 0===u?void 0:u.id)&&void 0!==g?g:"data"]=void 0;else{const i="horizontal"===e.direction?e.xField:e.yField;t[null!==(a=null!==(s=null===(r=e.data)||void 0===r?void 0:r.id)&&void 0!==s?s:null===(l=n.data)||void 0===l?void 0:l.id)&&void 0!==a?a:"data"]=(null===(h=e.data)||void 0===h?void 0:h.id)?i:void 0}})),t}return n.data.id}(t,e,this)}release(){const t=this._table._getActiveChartInstance();null==t||t.release(),this.columnObjects.forEach((t=>{var e;null===(e=t.chartInstance)||void 0===e||e.release()}))}clearCellRangeMap(){this._cellRangeMap.clear()}updateColumnTitle(t,e,i){const o=this._table.internalProps.layoutMap.getHeader(t,e);o.title=i,o.define.title=i}getColumnByField(t){var e;return null===(e=this.columnObjects)||void 0===e?void 0:e.reduce(((e,i,o)=>(i.field===t&&e.push({col:o,columnDefine:i}),e)),[])}getColumnDefine(t,e){if(t>=0)return t<this.leftRowSeriesNumberColumnCount?this.leftRowSeriesNumberColumn[t].define:this.transpose?this._columns[e].define:this._columns[t-this.leftRowSeriesNumberColumnCount].define}}class Ik{constructor(t){this.table=t,this.bindEvent()}bindEvent(){this.table.internalProps.handler;const t=this.table.options.editCellTrigger;this.table.on(Xw.DBLCLICK_CELL,(e=>{var i;if(!t||"doubleclick"===t||Array.isArray(t)&&t.includes("doubleclick")){const{col:t,row:o}=e,n=Y_(e.federatedEvent),r=this.table.scenegraph.getResizeColAt(n.abstractPos.x,n.abstractPos.y,null===(i=n.eventArgs)||void 0===i?void 0:i.targetCell);if(this.table._canResizeColumn(r.col,r.row)&&r.col>=0)return;this.startEditCell(t,o)}})),this.table.on(Xw.CLICK_CELL,(e=>{if("click"===t||Array.isArray(t)&&t.includes("click")){const{col:t,row:i}=e;this.startEditCell(t,i)}}))}startEditCell(t,e,i){var o,n,r,s,l;if(this.editingEditor)return;const a=this.table.getEditor(t,e);if(a){if(null===(n=null===(o=this.table.internalProps.layoutMap)||void 0===o?void 0:o.isAggregation)||void 0===n?void 0:n.call(o,t,e))return;this.editingEditor||(this.editCell={col:t,row:e}),this.editingEditor=a;const h=Q(i)?i:this.table.getCellOriginValue(t,e),d=this.table.getCellRangeRelativeRect(this.table.getCellRange(t,e)),c={rect:{left:d.left,top:d.top,width:d.width,height:d.height}};a.beginEditing,null===(r=a.beginEditing)||void 0===r||r.call(a,this.table.getElement(),c,h),a.bindSuccessCallback,null===(s=a.bindSuccessCallback)||void 0===s||s.call(a,(()=>{this.completeEdit()})),null===(l=a.onStart)||void 0===l||l.call(a,{value:h,endEdit:()=>{this.completeEdit()},referencePosition:c,container:this.table.getElement(),col:t,row:e})}}completeEdit(t){var e,i;if(!this.editingEditor)return!0;const o=null==t?void 0:t.target,{editingEditor:n}=this;if(o)if(n.targetIsOnEditor){if(n.targetIsOnEditor(o))return!1}else if(!n.isEditorElement||n.isEditorElement(o))return!1;if(this.editingEditor.getValue,this.editingEditor.validateValue){const t=null===(i=(e=this.editingEditor).validateValue)||void 0===i?void 0:i.call(e);return Fw(t)?new Promise(((e,i)=>{t.then((t=>{t?(this.doExit(),e(!0)):e(!1)})).catch((t=>{i(t)}))})):!!t&&(this.doExit(),!0)}return this.doExit(),!0}doExit(){var t,e,i,o,n,r;const s=null===(e=(t=this.editingEditor).getValue)||void 0===e?void 0:e.call(t),l=this.table.getCellRange(this.editCell.col,this.editCell.row),a=[];for(let t=l.start.row;t<=l.end.row;t++){const t=[];for(let e=l.start.col;e<=l.end.col;e++)t.push(s);a.push(t)}this.table.changeCellValues(l.start.col,l.start.row,a),this.editingEditor.exit,null===(o=(i=this.editingEditor).exit)||void 0===o||o.call(i),null===(r=(n=this.editingEditor).onEnd)||void 0===r||r.call(n),this.editingEditor=null}cancelEdit(){var t,e,i,o;this.editingEditor&&(null===(e=(t=this.editingEditor).exit)||void 0===e||e.call(t),null===(o=(i=this.editingEditor).onEnd)||void 0===o||o.call(i),this.editingEditor=null)}}function Ok(t){return nt(t)?{groupByRules:[t]}:rt(t)?{groupByRules:t.map((t=>nt(t)?t:t.key))}:{}}function Dk(t,e,i,o){if("group"===o)return o;if("sort"===o&&!i.options.groupBy)return o;let n="normal";return i.options.groupBy?n="group":!i.isHeader(t,e)&&i.dataSource.lastOrderField&&i.getBodyField(t,e)===i.dataSource.lastOrderField&&(n="sort"),n}function Wk(t){let e=t.sortState;e=!e||Array.isArray(e)?e:[e],e&&(e=e.map((e=>{var i;return e.orderFn=null!==(i=t._getSortFuncFromHeaderOption(void 0,e.field))&&void 0!==i?i:yw,e})),t.dataSource.sort(e))}class Nk extends uk{constructor(t,e){var i,o,n,r;"node"===sw.mode?(e=t,t=null):t instanceof HTMLElement||(e=t,t=t.container?t.container:null),super(t,e),this.showHeader=!0;const s=this.internalProps;if(s.frozenColDragHeaderMode=e.frozenColDragHeaderMode,this.pagination=e.pagination,s.sortState=e.sortState,s.multipleSort=!!e.multipleSort,s.dataConfig=e.groupBy?Ok(e.groupBy):{},s.columns=e.columns?Sk(e.columns,["children"]):e.header?Sk(e.header,["children"]):[],V_(this),s.enableTreeNodeMerge=null!==(o=null!==(i=e.enableTreeNodeMerge)&&void 0!==i?i:Q(e.groupBy))&&void 0!==o&&o,this.internalProps.headerHelper.setTableColumnsEditor(),this.showHeader=null===(n=e.showHeader)||void 0===n||n,this.transpose=null!==(r=e.transpose)&&void 0!==r&&r,"node"!==sw.mode&&(this.editorManager=new Ik(this)),this.refreshHeader(),this.internalProps.useOneRowHeightFillAll=!1,e.dataSource?W_(this,e.dataSource):e.records?this.setRecords(e.records,{sortState:s.sortState}):this.setRecords([]),e.title){const t=Tx.getComponent("title");s.title=new t(e.title,this),this.scenegraph.resize()}if(this.options.emptyTip)if(this.internalProps.emptyTip)this.internalProps.emptyTip.resetVisible();else{const t=Tx.getComponent("emptyTip");this.internalProps.emptyTip=new t(this.options.emptyTip,this),this.internalProps.emptyTip.resetVisible()}if(e.enableTreeStickCell){const t=Tx.getComponent("listTreeStickCellPlugin");this.listTreeStickCellPlugin=new t(this)}setTimeout((()=>{this.fireListeners(Xw.INITIALIZED,null)}),0)}isListTable(){return!0}isPivotTable(){return!1}isPivotChart(){return!1}get sortState(){return this.internalProps.sortState}get records(){var t;return null===(t=this.dataSource)||void 0===t?void 0:t.records}get recordsCount(){return this.dataSource.records.length}updateColumns(t){var e,i,o,n;const r={col:this.stateManager.hover.cellPos.col,row:this.stateManager.hover.cellPos.row};this.internalProps.columns=Sk(t,["children"]),V_(this),this.options.columns=t,this.internalProps.headerHelper.setTableColumnsEditor(),this._hasAutoImageColumn=void 0,this.refreshHeader(),null===(i=(e=this.dataSource).updateColumns)||void 0===i||i.call(e,this.internalProps.columns),this.records&&function(t){for(let e=0;e<t.length;e++)if(t[e].aggregation)return!0;return!1}(t)&&this.dataSource.processRecords(null!==(n=null===(o=this.dataSource.dataSourceObj)||void 0===o?void 0:o.records)&&void 0!==n?n:this.dataSource.dataSourceObj),this.internalProps.useOneRowHeightFillAll=!1,this.scenegraph.clearCells(),this.headerStyleCache=new Map,this.bodyStyleCache=new Map,this.bodyBottomStyleCache=new Map,this.scenegraph.createSceneGraph(),this.stateManager.updateHoverPos(r.col,r.row),this.renderAsync(),this.eventManager.updateEventBinder()}get columns(){return this.internalProps.layoutMap.columnTree.getCopiedTree()}get header(){return this.internalProps.columns}set header(t){this.internalProps.columns=t,V_(this),this.options.header=t,this.refreshHeader(),this.internalProps.useOneRowHeightFillAll=!1,this.renderAsync()}get transpose(){var t;return null!==(t=this.internalProps.transpose)&&void 0!==t&&t}set transpose(t){this.internalProps.transpose!==t&&(this.internalProps.transpose=t,this.internalProps.layoutMap&&(this.internalProps.layoutMap.transpose=t,this.refreshRowColCount(),this._resetFrozenColCount(),this.renderAsync()))}getCellValue(t,e,i){if(-1===t||-1===e)return null;if(!i){const i=this.getCustomMergeValue(t,e);if(i)return i}const o=this;if(o.internalProps.layoutMap.isSeriesNumber(t,e)){if(o.internalProps.layoutMap.isSeriesNumberInHeader(t,e)){const{title:i}=o.internalProps.layoutMap.getSeriesNumberHeader(t,e);return i}if(this.options.groupBy){const{vtableMerge:i}=o.getCellRawRecord(t,e);if(i)return"";const n=this.dataSource.currentIndexedData[e-this.columnHeaderLevelCount];return n[n.length-1]+1}const{format:i}=o.internalProps.layoutMap.getSeriesNumberBody(t,e);return"function"==typeof i?i(t,e,this):e-this.columnHeaderLevelCount+1}if(o.internalProps.layoutMap.isHeader(t,e)){const{title:i}=o.internalProps.layoutMap.getHeader(t,e);return"function"==typeof i?i():i}if(o.internalProps.layoutMap.isAggregation(t,e)){if(o.internalProps.layoutMap.isTopAggregation(t,e)){const i=o.internalProps.layoutMap.getAggregatorOnTop(t,e);return(null==i?void 0:i.formatValue)?i.formatValue(t,e,this):""}if(o.internalProps.layoutMap.isBottomAggregation(t,e)){const i=o.internalProps.layoutMap.getAggregatorOnBottom(t,e);return(null==i?void 0:i.formatValue)?i.formatValue(t,e,this):""}}const{field:n,fieldFormat:r}=o.internalProps.layoutMap.getBody(t,e);return o.getFieldData(r||n,t,e)}getCellOriginValue(t,e){if(-1===t||-1===e)return null;const i=this;if(i.internalProps.layoutMap.isSeriesNumber(t,e)){if(i.internalProps.layoutMap.isSeriesNumberInHeader(t,e)){const{title:o}=i.internalProps.layoutMap.getSeriesNumberHeader(t,e);return o}const{format:o}=i.internalProps.layoutMap.getSeriesNumberBody(t,e);return"function"==typeof o?o(t,e,this):e-this.columnHeaderLevelCount}if(i.internalProps.layoutMap.isHeader(t,e)){const{title:o}=i.internalProps.layoutMap.getHeader(t,e);return"function"==typeof o?o():o}if(i.internalProps.layoutMap.isAggregation(t,e)){if(i.internalProps.layoutMap.isTopAggregation(t,e)){const o=i.internalProps.layoutMap.getAggregatorOnTop(t,e);return null==o?void 0:o.value()}if(i.internalProps.layoutMap.isBottomAggregation(t,e)){const o=i.internalProps.layoutMap.getAggregatorOnBottom(t,e);return null==o?void 0:o.value()}}const{field:o}=i.internalProps.layoutMap.getBody(t,e);return i.getFieldData(o,t,e)}getCellRawValue(t,e){if(-1===t||-1===e)return null;const i=this;if(i.internalProps.layoutMap.isHeader(t,e)){const{title:o}=i.internalProps.layoutMap.getHeader(t,e);return"function"==typeof o?o():o}const{field:o}=i.internalProps.layoutMap.getBody(t,e);return i.getRawFieldData(o,t,e)}getRecordShowIndexByCell(t,e){const{layoutMap:i}=this.internalProps;return i.getRecordShowIndexByCell(t,e)}getRecordIndexByCell(t,e){const{layoutMap:i}=this.internalProps,o=i.getRecordShowIndexByCell(t,e);return this.dataSource.currentPagerIndexedData[o]}getTableIndexByRecordIndex(t){return this.transpose?this.dataSource.getTableIndex(t)+this.rowHeaderLevelCount:this.dataSource.getTableIndex(t)+this.columnHeaderLevelCount}getTableIndexByField(t){const e=this.internalProps.layoutMap.columnObjects.find((e=>e.field===t));if(!e)return-1;const i=this.internalProps.layoutMap.getBodyLayoutRangeById(e.id);return this.transpose?i.start.row:i.start.col}getCellAddrByFieldRecord(t,e){return this.transpose?{col:this.getTableIndexByRecordIndex(e),row:this.getTableIndexByField(t)}:{col:this.getTableIndexByField(t),row:this.getTableIndexByRecordIndex(e)}}getCellOriginRecord(t,e){const i=this.getRecordShowIndexByCell(t,e);if(i>-1)return this.dataSource.get(i)}getCellRawRecord(t,e){const i=this.getRecordShowIndexByCell(t,e);if(i>-1)return this.dataSource.getRaw(i)}_canResizeColumn(t,e){const i=super._canResizeColumn(t,e);if(i&&!this.transpose){const i=this.internalProps.layoutMap.getBody(t,this.columnHeaderLevelCount),o=this.internalProps.layoutMap.isSeriesNumber(t,e);if(null==i?void 0:i.disableColumnResize)return!1;if(o&&!0===this.internalProps.rowSeriesNumber.disableColumnResize)return!1}return i}updateOption(t){var e,i,o,n;const r=this.internalProps;if(super.updateOption(t),r.frozenColDragHeaderMode=t.frozenColDragHeaderMode,this.pagination=t.pagination,r.sortState=t.sortState,r.dataConfig=t.groupBy?Ok(t.groupBy):{},this.showHeader=null===(e=t.showHeader)||void 0===e||e,r.columns=t.columns?Sk(t.columns,["children"]):t.header?Sk(t.header,["children"]):[],V_(this),r.enableTreeNodeMerge=null!==(o=null!==(i=t.enableTreeNodeMerge)&&void 0!==i?i:Q(t.groupBy))&&void 0!==o&&o,this.internalProps.headerHelper.setTableColumnsEditor(),this.transpose=null!==(n=t.transpose)&&void 0!==n&&n,this.refreshHeader(),this.internalProps.useOneRowHeightFillAll=!1,r.releaseList&&(r.releaseList.forEach((t=>{var e;return null===(e=null==t?void 0:t.release)||void 0===e?void 0:e.call(t)})),r.releaseList=null),t.dataSource?W_(this,t.dataSource):t.records?this.setRecords(t.records,{sortState:t.sortState}):(this._resetFrozenColCount(),this.scenegraph.createSceneGraph(),this.render()),t.title){const e=Tx.getComponent("title");r.title=new e(t.title,this),this.scenegraph.resize()}if(this.options.emptyTip)if(this.internalProps.emptyTip)this.internalProps.emptyTip.resetVisible();else{const t=Tx.getComponent("emptyTip");this.internalProps.emptyTip=new t(this.options.emptyTip,this),this.internalProps.emptyTip.resetVisible()}return new Promise((t=>{setTimeout(t,0)}))}updatePagination(t){this.pagination&&("number"==typeof t.currentPage&&t.currentPage>=0&&(this.pagination.currentPage=t.currentPage),t.perPageCount&&(this.pagination.perPageCount=t.perPageCount||this.pagination.perPageCount),this.internalProps.layoutMap.clearCellRangeMap(),this.internalProps.useOneRowHeightFillAll=!1,this.scenegraph.clearCells(),this.dataSource.updatePagination(this.pagination),this.refreshRowColCount(),this.stateManager.initCheckedState(this.records),this.scenegraph.createSceneGraph(),this.renderAsync())}refreshHeader(){var t;const e=this.internalProps,i=this.transpose,o=this.showHeader;(e.layoutMap=new zk(this,null!==(t=e.columns)&&void 0!==t?t:[],o,this.options.hierarchyIndent)).transpose=i,i||this.setMinMaxLimitWidth(!0),this.refreshRowColCount()}refreshRowColCount(){var t,e,i,o,n,r,s,l,a,h,d,c,u,g,p,f,v,m;const b=this,{layoutMap:y}=b.internalProps;if(!y)return;const C=null!==(e=null===(t=b.internalProps.dataSource)||void 0===t?void 0:t.length)&&void 0!==e?e:0;y.recordsCount=C+(C>0?y.hasAggregationOnTopCount+y.hasAggregationOnBottomCount:0),b.transpose?(b.rowCount=null!==(i=y.rowCount)&&void 0!==i?i:0,b.colCount=null!==(o=y.colCount)&&void 0!==o?o:0,this.internalProps.frozenColCount=Math.max((null!==(n=y.headerLevelCount)&&void 0!==n?n:0)+y.leftRowSeriesNumberColumnCount,null!==(r=this.options.frozenColCount)&&void 0!==r?r:0),this.internalProps.frozenRowCount=null!==(s=this.options.frozenRowCount)&&void 0!==s?s:0,b.bottomFrozenRowCount!==(null!==(l=this.options.bottomFrozenRowCount)&&void 0!==l?l:0)&&(b.bottomFrozenRowCount=null!==(a=this.options.bottomFrozenRowCount)&&void 0!==a?a:0),b.rightFrozenColCount!==(null!==(h=this.options.rightFrozenColCount)&&void 0!==h?h:0)&&(b.rightFrozenColCount=null!==(d=this.options.rightFrozenColCount)&&void 0!==d?d:0)):(b.colCount=null!==(c=y.colCount)&&void 0!==c?c:0,b.rowCount=y.recordsCount*y.bodyRowSpanCount+y.headerLevelCount,this.internalProps.frozenColCount=null!==(u=this.options.frozenColCount)&&void 0!==u?u:0,b.frozenRowCount=Math.max(y.headerLevelCount,null!==(g=this.options.frozenRowCount)&&void 0!==g?g:0),b.bottomFrozenRowCount!==(null!==(p=this.options.bottomFrozenRowCount)&&void 0!==p?p:0)&&(b.bottomFrozenRowCount=null!==(f=this.options.bottomFrozenRowCount)&&void 0!==f?f:0),b.rightFrozenColCount!==(null!==(v=this.options.rightFrozenColCount)&&void 0!==v?v:0)&&(b.rightFrozenColCount=null!==(m=this.options.rightFrozenColCount)&&void 0!==m?m:0)),this.stateManager.setFrozenCol(this.internalProps.frozenColCount)}getFieldData(t,e,i){if(null===t)return null;if(this.internalProps.layoutMap.isHeader(e,i))return null;const o=this.getRecordShowIndexByCell(this.transpose?e-this.internalProps.layoutMap.leftRowSeriesNumberColumnCount:e,i);return this.internalProps.dataSource.getField(o,t,e,i,this)}getRawFieldData(t,e,i){if(null===t)return null;if(this.internalProps.layoutMap.isHeader(e,i))return null;const o=this.getRecordShowIndexByCell(e,i);return this.internalProps.dataSource.getRawField(o,t,e,i,this)}_moveHeaderPosition(t,e){const i=this.getCellRange(t.col,t.row),o=this.getCellRange(e.col,e.row),n=this.internalProps.layoutMap.moveHeaderPosition(t,e);return n?("column"===n.moveType?(this.colWidthsMap.exchangeOrder(i.start.col,i.end.col-i.start.col+1,o.start.col,o.end.col-o.start.col+1,n.targetIndex),this.transpose||(this.colWidthsLimit={},this.setMinMaxLimitWidth())):n.targetIndex>n.sourceIndex?this.rowHeightsMap.exchangeOrder(n.sourceIndex,n.sourceSize,n.targetIndex+n.sourceSize-n.targetSize,n.targetSize,n.targetIndex):this.rowHeightsMap.exchangeOrder(n.sourceIndex,n.sourceSize,n.targetIndex,n.targetSize,n.targetIndex),n):null}changeRecordOrder(t,e){this.transpose?(t=this.getRecordShowIndexByCell(t,0),e=this.getRecordShowIndexByCell(e,0)):(t=this.getRecordShowIndexByCell(0,t),e=this.getRecordShowIndexByCell(0,e)),this.dataSource.reorderRecord(t,e)}getCellAddress(t,e){let i;for(let e=0;e<this.internalProps.records.length;e++){const o=this.internalProps.records[e];if("function"==typeof t)t(o)&&(i=e);else{let n=!0;for(const e in t)if(o[e]!==t[e]){n=!1;break}n&&(i=e)}if(Q(i))break}const o=this.getCellRangeByField(e,i);if(o)return{row:o.start.row,col:o.start.col}}getCellRangeByField(t,e){const{layoutMap:i}=this.internalProps,o=i.columnObjects.find((e=>e.field===t));if(o){const t=i.getBodyLayoutRangeById(o.id);let n;return Q(e)&&(n=i.getRecordStartRowByRecordIndex(e)),this.transpose?{start:{row:t.start.row,col:Q(n)?n+t.start.col:void 0},end:{row:t.end.row,col:Q(n)?n+t.end.col:void 0}}:{start:{col:t.start.col,row:Q(n)?n+t.start.row:void 0},end:{col:t.end.col,row:Q(n)?n+t.end.row:void 0}}}return null}getHierarchyState(t,e){if(!this.options.groupBy&&!this.getBodyColumnDefine(t,e).tree)return WC.none;const i=this.getRecordShowIndexByCell(t,e);return this.dataSource.getHierarchyState(i)}toggleHierarchyState(t,e){this.stateManager.updateHoverIcon(t,e,void 0,void 0);const i=this.getHierarchyState(t,e);if(i===WC.expand)this._refreshHierarchyState(t,e),this.fireListeners(Xw.TREE_HIERARCHY_STATE_CHANGE,{col:t,row:e,hierarchyState:WC.collapse});else if(i===WC.collapse){const i=this.getCellOriginRecord(t,e);Array.isArray(i.children)&&this._refreshHierarchyState(t,e),this.fireListeners(Xw.TREE_HIERARCHY_STATE_CHANGE,{col:t,row:e,hierarchyState:WC.expand,originData:i})}}_refreshHierarchyState(t,e){var i;let o=!1,n=!1;const r=this.internalProps.layoutMap.checkHasChart();r&&(this.autoFillWidth&&(o=this.getAllColsWidth()<=this.tableNoFrameWidth),this.autoFillHeight&&(n=this.getAllRowsHeight()<=this.tableNoFrameHeight));const s=this.getRecordShowIndexByCell(t,e),l=this.dataSource.toggleHierarchyState(s,this.scenegraph.proxy.rowStart-this.columnHeaderLevelCount,Math.max(this.scenegraph.proxy.rowEnd-this.columnHeaderLevelCount,this.scenegraph.proxy.rowStart-this.columnHeaderLevelCount+this.scenegraph.proxy.rowLimit-1)),a=this.internalProps.layoutMap.toggleHierarchyState(l);this.refreshRowColCount();for(let t=this.rowCount-this.bottomFrozenRowCount;t<this.rowCount;t++){const e=BA(t,0,this.colCount-1,this);this._setRowHeight(t,e)}this.clearCellStyleCache(),this.internalProps.layoutMap.clearCellRangeMap(),this.internalProps.useOneRowHeightFillAll=!1;const h=[{col:t,row:e}];if((null===(i=a.removeCellPositions)||void 0===i?void 0:i.length)>0&&a.removeCellPositions[a.removeCellPositions.length-1].row>=this.scenegraph.proxy.rowEnd){for(let t=0;t<=a.removeCellPositions.length-1;t++)a.removeCellPositions[t].row<=this.scenegraph.proxy.rowEnd&&h.push({col:a.removeCellPositions[t].col,row:a.removeCellPositions[t].row});a.removeCellPositions=[],this.scenegraph.proxy.refreshRowCount()}this.scenegraph.updateRow(a.removeCellPositions,a.addCellPositions,h),r&&(this.autoFillWidth&&!o&&(o=this.getAllColsWidth()<=this.tableNoFrameWidth),this.autoFillHeight&&!n&&(n=this.getAllRowsHeight()<=this.tableNoFrameHeight),("adaptive"===this.widthMode||o||"adaptive"===this.heightMode||n)&&this.scenegraph.updateChartSizeForResizeColWidth(-1))}_hasHierarchyTreeHeader(){var t,e;return null===(e=null!==(t=this.options.columns)&&void 0!==t?t:this.options.header)||void 0===e?void 0:e.some(((t,e)=>t.tree))}getMenuInfo(t,e,i){return{field:this.getHeaderField(t,e),value:this.getCellValue(t,e),cellLocation:this.getCellLocation(t,e),event:void 0}}_getSortFuncFromHeaderOption(t,e,i){if(t||(t=this.internalProps.columns),e&&t&&t.length>0)for(let o=0;o<t.length;o++){const n=t[o];if((i&&i===n.fieldKey||!i&&n.field===e)&&n.sort&&"function"==typeof n.sort)return n.sort;if(n.columns){const t=this._getSortFuncFromHeaderOption(n.columns,e,i);if(t)return t}}}updateSortState(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];var i;if(t)this.internalProps.sortState=t;else if(this.internalProps.sortState)if(Array.isArray(this.internalProps.sortState))for(let e=0;e<this.internalProps.sortState.length;e++)(t=null===(i=this.internalProps.sortState)||void 0===i?void 0:i[e])&&(t.order="normal");else this.internalProps.sortState.order="normal",t=this.internalProps.sortState;(t=Array.isArray(t)?t:[t]).some((t=>t.field))&&e&&this.internalProps.layoutMap.headerObjects.some((t=>!1!==t.define.sort))&&(this.dataSource.sort(t.map((t=>{const e=this._getSortFuncFromHeaderOption(this.internalProps.columns,t.field);return this.internalProps.layoutMap.headerObjects.find((e=>e&&e.field===t.field)),{field:t.field,order:t.order,orderFn:e}}))),this.internalProps.layoutMap.clearCellRangeMap(),this.internalProps.useOneRowHeightFillAll=!1,this.scenegraph.sortCell()),t.length&&this.stateManager.updateSortState(t)}updateFilterRules(t){this.scenegraph.clearCells(),this.sortState?(this.dataSource.updateFilterRulesForSorted(t),Wk(this)):this.dataSource.updateFilterRules(t),this.refreshRowColCount(),this.stateManager.initCheckedState(this.records),this.scenegraph.createSceneGraph()}getCheckboxState(t){if(this.stateManager.checkedState.length<this.rowCount-this.columnHeaderLevelCount&&this.stateManager.initLeftRecordsCheckState(this.records),Q(t)){let e=this.stateManager.checkedState;return this.options.groupBy&&(e=function(t){const e=[],i=t.dataSource,o=i.dataConfig.groupByRules.length+1;return i.currentIndexedData.forEach(((n,r)=>{if(rt(n)&&n.length===o){const{vtableOriginIndex:o}=i.getRawRecord(n);e[o]=t.stateManager.checkedState[n]}})),e}(this)),e.map((e=>e[t]))}return this.stateManager.checkedState}getCellCheckboxState(t,e){var i;const o=this.getBodyColumnDefine(t,e),n=null==o?void 0:o.field,r=this.getCellType(t,e);if(Q(n)&&"checkbox"===r){const o=this.dataSource.getIndexKey(this.getRecordShowIndexByCell(t,e));return null===(i=this.stateManager.checkedState[o])||void 0===i?void 0:i[n]}}getRadioState(t){return Q(t)?this.stateManager.radioState[t]:this.stateManager.radioState}getCellRadioState(t,e){return function(t,e,i){var o;const n=i.getBodyColumnDefine(t,e),r=null==n?void 0:n.field,s=i.getCellType(t,e);if(Q(r)&&"checkbox"===s){const n=i.dataSource.getIndexKey(i.getRecordShowIndexByCell(t,e)),s=null===(o=i.stateManager.radioState)||void 0===o?void 0:o[r];if(at(s)){if(s===n)return!0}else if(tt(s)){const t=s[n];if(at(t))return t}}return!1}(t,e,this)}setCellCheckboxState(t,e,i){!function(t,e,i,o){const n=o.scenegraph.getCell(t,e),r=null==n?void 0:n.getChildByName("checkbox");if(!r)return;const{checked:s,indeterminate:l}=r.attribute;l?(i||r._handlePointerUp(),r._handlePointerUp()):s?i||r._handlePointerUp():i&&r._handlePointerUp()}(t,e,i,this)}setCellRadioState(t,e,i){!function(t,e,i,o){const n=o.scenegraph.getCell(t,e);if(n)if(at(i)){const t=n.getChildAt(i);null==t||t._handlePointerUp()}else{const t=n.getChildByName("radio");null==t||t._handlePointerUp()}}(t,e,i,this)}setRecords(t,e){var i,o;let n;null===(i=this.internalProps.dataSource)||void 0===i||i.release(),this.internalProps.releaseList=null===(o=this.internalProps.releaseList)||void 0===o?void 0:o.filter((t=>!t.dataSourceObj)),this.internalProps.dataSource=null,Array.isArray(e)||(null==e?void 0:e.order)?n=e:e?n=e.sortState:null===e&&(n=null),"undefined"!=typeof window&&window.performance.now();const r={col:this.stateManager.hover.cellPos.col,row:this.stateManager.hover.cellPos.row};if(this.scenegraph.clearCells(),void 0!==n&&(this.internalProps.sortState=this.internalProps.multipleSort?Array.isArray(n)?n:[n]:n,this.stateManager.setSortState(this.sortState)),t){if(D_(this,t),this.sortState){const t=Array.isArray(this.sortState)?this.sortState:[this.sortState];t.some((t=>t.order&&t.field&&"normal"!==t.order))&&this.internalProps.layoutMap.headerObjectsIncludeHided.some((t=>!1!==t.define.sort))&&this.dataSource.sort(t.map((t=>{const e=this._getSortFuncFromHeaderOption(void 0,t.field);return this.internalProps.layoutMap.headerObjectsIncludeHided.find((e=>e&&e.field===t.field)),{field:t.field,order:t.order||"asc",orderFn:null!=e?e:yw}})))}this.refreshRowColCount()}else D_(this,t);if(this.stateManager.initCheckedState(t),this.clearCellStyleCache(),this.scenegraph.createSceneGraph(),this.stateManager.updateHoverPos(r.col,r.row),this.internalProps.title&&!this.internalProps.title.isReleased&&(this._updateSize(),this.internalProps.title.resize(),this.scenegraph.resize()),this.options.emptyTip)if(this.internalProps.emptyTip)this.internalProps.emptyTip.resetVisible();else{const t=Tx.getComponent("emptyTip");this.internalProps.emptyTip=new t(this.options.emptyTip,this),this.internalProps.emptyTip.resetVisible()}this.render(),Q(r.col)&&Q(r.row)&&r.col>=0&&r.row>=0&&setTimeout((()=>{var t;null===(t=this.internalProps)||void 0===t||t.tooltipHandler.showTooltip(r.col,r.row)}),0)}setRecordChildren(t,e,i){const o=this.getCellOriginRecord(e,i);o.children=t;const n=this.getRecordShowIndexByCell(e,i);this.dataSource.setRecord(o,n),this._refreshHierarchyState(e,i)}startEditCell(t,e,i){var o;if(Q(t)&&Q(e))this.eventManager.isDraging=!1,this.selectCell(t,e),this.editorManager.startEditCell(t,e,i);else if(null===(o=this.stateManager.select)||void 0===o?void 0:o.cellPos){const{col:t,row:e}=this.stateManager.select.cellPos;Q(t)&&Q(e)&&this.editorManager.startEditCell(t,e,i)}}completeEditCell(){this.editorManager.completeEdit()}getEditor(t,e){var i,o;const n=this.getBodyColumnDefine(t,e);let r=this.isHeader(t,e)?null!==(i=null==n?void 0:n.headerEditor)&&void 0!==i?i:this.options.headerEditor:null!==(o=null==n?void 0:n.editor)&&void 0!==o?o:this.options.editor;return"function"==typeof r&&(r=r({col:t,row:e,dataValue:this.getCellOriginValue(t,e),value:this.getCellValue(t,e)||"",table:this})),"string"==typeof r?function(t){if(pk[t])return pk[t]}(r):r}isHasEditorDefine(t,e){var i,o;const n=this.getBodyColumnDefine(t,e);let r=this.isHeader(t,e)?null!==(i=null==n?void 0:n.headerEditor)&&void 0!==i?i:this.options.headerEditor:null!==(o=null==n?void 0:n.editor)&&void 0!==o?o:this.options.editor;return"function"==typeof r&&(r=r({col:t,row:e,dataValue:this.getCellOriginValue(t,e),value:this.getCellValue(t,e)||"",table:this})),Q(r)}changeCellValue(t,e,i){return function(t,e,i,o,n){if(o&&n.isHasEditorDefine(t,e)||!1===o){const o=n.getRecordShowIndexByCell(t,e),{field:r}=n.internalProps.layoutMap.getBody(t,e),s=n.getCellRawValue(t,e),l=n.getCellOriginValue(t,e);n.isHeader(t,e)?n.internalProps.layoutMap.updateColumnTitle(t,e,i):n.dataSource.changeFieldValue(i,o,r,t,e,n);const a=n.getCellRange(t,e),h=n.internalProps.layoutMap.getAggregatorsByCell(t,e);if(h){if(Array.isArray(h))for(let t=0;t<(null==h?void 0:h.length);t++)h[t].recalculate();else h.recalculate();const t=n.internalProps.layoutMap.getAggregatorCellAddress(a.start.col,a.start.row,a.end.col,a.end.row);for(let e=0;e<t.length;e++){const i=n.getCellRange(t[e].col,t[e].row);for(let t=i.start.col;t<=i.end.col;t++)for(let e=i.start.row;e<=i.end.row;e++)n.scenegraph.updateCellContent(t,e)}}for(let t=a.start.col;t<=a.end.col;t++)for(let e=a.start.row;e<=a.end.row;e++)n.scenegraph.updateCellContent(t,e);if("adaptive"===n.widthMode||n.autoFillWidth&&n.getAllColsWidth()<=n.tableNoFrameWidth)0===n.internalProps._widthResizedColMap.size&&n.scenegraph.recalculateColWidths();else if(!n.internalProps._widthResizedColMap.has(t)){const e=n.getColWidth(t),i=oR(t,0,n.rowCount-1,n,!1);i!==e&&n.scenegraph.updateColWidth(t,i-e)}if("adaptive"===n.heightMode||n.autoFillHeight&&n.getAllRowsHeight()<=n.tableNoFrameHeight)0===n.internalProps._heightResizedRowMap.size&&n.scenegraph.recalculateRowHeights();else if("autoHeight"===n.heightMode&&!n.internalProps._heightResizedRowMap.has(e)){const t=n.getRowHeight(e),i=BA(e,0,n.colCount-1,n);n.scenegraph.updateRowHeight(e,i-t)}n.fireListeners(Xw.CHANGE_CELL_VALUE,{col:t,row:e,rawValue:s,currentValue:l,changedValue:n.getCellOriginValue(t,e)}),n.scenegraph.updateNextFrame()}}(t,e,i,arguments.length>3&&void 0!==arguments[3]&&arguments[3],this)}changeCellValues(t,e,i){return function(t,e,i,o,n){var r,s;let l=t,a=e;const h=[],d=[];let c;for(let o=0;o<i.length&&!(e+o>n.rowCount-1);o++){const r=i[o],s=[],l=[];h.push(s),d.push(l);for(let i=0;i<r.length&&!(t+i>n.colCount-1);i++){c=Dk(t+i,e+o,n,c);const r=n.getCellRawValue(t+i,e+o);s.push(r);const a=n.getCellOriginValue(t+i,e+o);l.push(a)}}for(let c=0;c<i.length&&!(e+c>n.rowCount-1);c++){a=e+c;const u=i[c];let g=t;for(let i=0;i<u.length&&!(t+i>n.colCount-1);i++){g=t+i;let l=!1;if(!1===o)l=!0;else if(n.isHasEditorDefine(t+i,e+c)){const o=n.getEditor(t+i,e+c),a=d[c][i],h=u[i],g=null===(s=null===(r=null==o?void 0:o.validateValue)||void 0===r?void 0:r.call(o,h,a))||void 0===s||s;l=!!Fw(g)||g}if(l){const o=u[i],r=n.getRecordShowIndexByCell(t+i,e+c),{field:s}=n.internalProps.layoutMap.getBody(t+i,e+c),l=h[c][i],a=d[c][i];n.isHeader(t+i,e+c)?n.internalProps.layoutMap.updateColumnTitle(t+i,e+c,o):n.dataSource.changeFieldValue(o,r,s,t+i,e+c,n),n.fireListeners(Xw.CHANGE_CELL_VALUE,{col:t+i,row:e+c,rawValue:l,currentValue:a,changedValue:n.getCellOriginValue(t+i,e+c)})}}l=Math.max(l,g)}const u=n.getCellRange(t,e),g=n.getCellRange(l,a),p=n.internalProps.layoutMap.getAggregatorsByCellRange(u.start.col,u.start.row,g.end.col,g.end.row);if(p){for(let t=0;t<(null==p?void 0:p.length);t++)p[t].recalculate();if("normal"===c){const t=n.internalProps.layoutMap.getAggregatorCellAddress(u.start.col,u.start.row,g.end.col,g.end.row);for(let e=0;e<t.length;e++){const i=n.getCellRange(t[e].col,t[e].row);for(let t=i.start.col;t<=i.end.col;t++)for(let e=i.start.row;e<=i.end.row;e++)n.scenegraph.updateCellContent(t,e)}}}if("group"===c&&n.dataSource.updateRecordsForGroup([],[]),"sort"===c||"group"===c)return n.dataSource.sortedIndexMap.clear(),Wk(n),n.refreshRowColCount(),n.internalProps.layoutMap.clearCellRangeMap(),n.scenegraph.clearCells(),void n.scenegraph.createSceneGraph();for(let t=u.start.col;t<=g.end.col;t++)for(let e=u.start.row;e<=g.end.row;e++)n.scenegraph.updateCellContent(t,e);if("adaptive"===n.widthMode||n.autoFillWidth&&n.getAllColsWidth()<=n.tableNoFrameWidth)0===n.internalProps._widthResizedColMap.size&&n.scenegraph.recalculateColWidths();else for(let e=t;e<=g.end.col;e++)if(!n.internalProps._widthResizedColMap.has(e)){const t=n.getColWidth(e),i=oR(e,0,n.rowCount-1,n,!1);i!==t&&n.scenegraph.updateColWidth(e,i-t)}if("adaptive"===n.heightMode||n.autoFillHeight&&n.getAllRowsHeight()<=n.tableNoFrameHeight)n.scenegraph.recalculateRowHeights();else if("autoHeight"===n.heightMode){const t=[],i=[];for(let o=e;o<=g.end.row;o++)if(n.rowHeightsMap.get(o)){const e=n.getRowHeight(o),r=BA(o,0,n.colCount-1,n);t.push(o),i.push(r-e)}n.scenegraph.updateRowsHeight(t,i)}n.scenegraph.updateNextFrame()}(t,e,i,arguments.length>3&&void 0!==arguments[3]&&arguments[3],this)}addRecord(t,e){!function(t,e,i){var o,n;if(i.options.groupBy)null===(n=(o=i.dataSource).addRecordsForGroup)||void 0===n||n.call(o,[t],e),i.refreshRowColCount(),i.internalProps.layoutMap.clearCellRangeMap(),i.scenegraph.clearCells(),i.scenegraph.createSceneGraph();else if(i.sortState)i.dataSource.addRecordForSorted(t),Wk(i),i.refreshRowColCount(),i.scenegraph.clearCells(),i.scenegraph.createSceneGraph();else{(void 0===e||e>i.dataSource.sourceLength)&&(e=i.dataSource.sourceLength);const o=i.transpose?i.rowHeaderLevelCount:i.columnHeaderLevelCount;i.dataSource.addRecord(t,e);const n=i.rowCount;if(i.refreshRowColCount(),0===i.scenegraph.proxy.totalActualBodyRowCount)return i.scenegraph.clearCells(),void i.scenegraph.createSceneGraph();const r=i.transpose?i.colCount:i.rowCount;if(i.pagination){const{perPageCount:t,currentPage:s}=i.pagination,l=t*(s||0)+t;if(e<l)if(e<l-t)i.scenegraph.clearCells(),i.scenegraph.createSceneGraph();else{const s=e-(l-t)+o;if(n-o===i.pagination.perPageCount){const t=[];for(let e=s;e<r;e++)i.transpose?t.push({col:e,row:0}):t.push({col:0,row:e});i.transpose?i.scenegraph.updateCol([],[],t):i.scenegraph.updateRow([],[],t)}else{const t=[];for(let e=s;e<Math.min(r,s+1);e++)i.transpose?t.push({col:e,row:0}):t.push({col:0,row:e});i.transpose?i.scenegraph.updateCol([],t,[]):i.scenegraph.updateRow([],t,[])}}}else{const t=[];for(let n=e+o;n<e+o+1;n++)i.transpose?t.push({col:n,row:0}):t.push({col:0,row:n});const n=[],r=i.internalProps.layoutMap.hasAggregationOnTopCount,s=i.internalProps.layoutMap.hasAggregationOnBottomCount;for(let t=o;t<o+r;t++)i.transpose?n.push({col:t,row:0}):n.push({col:0,row:t});for(let t=(i.transpose?i.colCount:i.rowCount)-s;t<(i.transpose?i.colCount:i.rowCount);t++)i.transpose?n.push({col:t,row:0}):n.push({col:0,row:t});i.transpose?i.scenegraph.updateCol([],t,[]):i.scenegraph.updateRow([],t,[])}}}(t,e,this)}addRecords(t,e){!function(t,e,i){var o,n;if(i.options.groupBy)null===(n=(o=i.dataSource).addRecordsForGroup)||void 0===n||n.call(o,t,e),i.refreshRowColCount(),i.internalProps.layoutMap.clearCellRangeMap(),i.scenegraph.clearCells(),i.scenegraph.createSceneGraph();else if(i.sortState)i.dataSource.addRecordsForSorted(t),Wk(i),i.refreshRowColCount(),i.scenegraph.clearCells(),i.scenegraph.createSceneGraph();else{void 0===e||e>i.dataSource.sourceLength?e=i.dataSource.sourceLength:e<0&&(e=0);const o=i.transpose?i.rowHeaderLevelCount:i.columnHeaderLevelCount;i.dataSource.addRecords(t,e);const n=i.transpose?i.colCount:i.rowCount;if(i.refreshRowColCount(),0===i.scenegraph.proxy.totalActualBodyRowCount)return i.scenegraph.clearCells(),void i.scenegraph.createSceneGraph();const r=i.transpose?i.colCount:i.rowCount;if(i.pagination){const{perPageCount:s,currentPage:l}=i.pagination,a=s*(l||0)+s;if(e<a)if(e<a-s)i.scenegraph.clearCells(),i.scenegraph.createSceneGraph();else{const l=e-(a-s)+o;if(n-o===i.pagination.perPageCount){const t=[];for(let e=l;e<r;e++)i.transpose?t.push({col:e,row:0}):t.push({col:0,row:e});i.transpose?i.scenegraph.updateCol([],[],t):i.scenegraph.updateRow([],[],t)}else{const e=[];for(let o=l;o<Math.min(r,l+(Array.isArray(t)?t.length:1));o++)i.transpose?e.push({col:o,row:0}):e.push({col:0,row:o});i.transpose?i.scenegraph.updateCol([],e,[]):i.scenegraph.updateRow([],e,[])}}}else{const n=[];for(let r=e+o;r<e+o+(Array.isArray(t)?t.length:1);r++)i.transpose?n.push({col:r,row:0}):n.push({col:0,row:r});const r=i.internalProps.layoutMap.hasAggregationOnTopCount,s=i.internalProps.layoutMap.hasAggregationOnBottomCount,l=[];for(let t=o;t<o+r;t++)i.transpose?l.push({col:t,row:0}):l.push({col:0,row:t});for(let t=(i.transpose?i.colCount:i.rowCount)-s;t<(i.transpose?i.colCount:i.rowCount);t++)i.transpose?l.push({col:t,row:0}):l.push({col:0,row:t});i.transpose?i.scenegraph.updateCol([],n,l):i.scenegraph.updateRow([],n,l)}}}(t,e,this)}deleteRecords(t){!function(t,e){var i,o;if((null==t?void 0:t.length)>0)if(e.options.groupBy)null===(o=(i=e.dataSource).deleteRecordsForGroup)||void 0===o||o.call(i,t),e.refreshRowColCount(),e.internalProps.layoutMap.clearCellRangeMap(),e.scenegraph.clearCells(),e.scenegraph.createSceneGraph();else if(e.sortState)e.dataSource.deleteRecordsForSorted(t),Wk(e),e.refreshRowColCount(),e.scenegraph.clearCells(),e.scenegraph.createSceneGraph();else{const i=e.dataSource.deleteRecords(t);if(0===i.length)return;const o=e.transpose?e.colCount:e.rowCount;e.refreshRowColCount();const n=e.transpose?e.colCount:e.rowCount,r=i.sort(((t,e)=>t-e)),s=r[0];if(e.pagination){const{perPageCount:t,currentPage:i}=e.pagination,r=t*(i||0)+t;if(s<r)if(s<r-t)e.scenegraph.clearCells(),e.scenegraph.createSceneGraph();else{const i=e.transpose?e.rowHeaderLevelCount:e.columnHeaderLevelCount,l=e.internalProps.layoutMap.hasAggregationOnTopCount,a=[],h=[];for(let i=s-(r-t)+(e.transpose?e.rowHeaderLevelCount:e.columnHeaderLevelCount)+l;i<n;i++)e.transpose?a.push({col:i,row:0}):a.push({col:0,row:i});for(let t=i;t<i+l;t++)e.transpose?a.push({col:t,row:0}):a.push({col:0,row:t});if(n<o)for(let t=n;t<o;t++)e.transpose?h.push({col:t,row:0}):h.push({col:0,row:t});e.transpose?e.scenegraph.updateCol(h,[],a):e.scenegraph.updateRow(h,[],a)}}else{const t=[],i=e.transpose?e.rowHeaderLevelCount:e.columnHeaderLevelCount,o=e.internalProps.layoutMap.hasAggregationOnTopCount,n=e.internalProps.layoutMap.hasAggregationOnBottomCount;for(let n=0;n<r.length;n++){const s=r[n]+i+o;e.transpose?t.push({col:s,row:0}):t.push({col:0,row:s})}const s=[];for(let t=i;t<i+o;t++)e.transpose?s.push({col:t,row:0}):s.push({col:0,row:t});for(let t=(e.transpose?e.colCount:e.rowCount)-n;t<(e.transpose?e.colCount:e.rowCount);t++)e.transpose?s.push({col:t,row:0}):s.push({col:0,row:t});e.transpose?e.scenegraph.updateCol(t,[],s):e.scenegraph.updateRow(t,[],s)}}}(t,this)}updateRecords(t,e){!function(t,e,i){var o,n;if((null==e?void 0:e.length)>0)if(i.options.groupBy)null===(n=(o=i.dataSource).updateRecordsForGroup)||void 0===n||n.call(o,t,e),i.refreshRowColCount(),i.internalProps.layoutMap.clearCellRangeMap(),i.scenegraph.clearCells(),i.scenegraph.createSceneGraph();else if(i.sortState)i.dataSource.updateRecordsForSorted(t,e),Wk(i),i.refreshRowColCount(),i.scenegraph.clearCells(),i.scenegraph.createSceneGraph();else{const o=i.dataSource.updateRecords(t,e);if(0===o.length)return;const n=o.sort(((t,e)=>t-e));if(i.pagination){const{perPageCount:t,currentPage:e}=i.pagination,o=i.transpose?i.rowHeaderLevelCount:i.columnHeaderLevelCount,r=i.internalProps.layoutMap.hasAggregationOnTopCount,s=t*(e||0)+t,l=[];for(let e=0;e<n.length;e++){const o=n[e];if(o<s&&o>=s-t){const e=o-(s-t)+(i.transpose?i.rowHeaderLevelCount:i.columnHeaderLevelCount)+r;l.push(e)}}if(l.length>=1){const t=[];for(let e=0;e<l.length;e++){const o=l[e];i.transpose?t.push({col:o,row:0}):t.push({col:0,row:o})}for(let e=o;e<o+r;e++)i.transpose?t.push({col:e,row:0}):t.push({col:0,row:e});i.transpose?i.scenegraph.updateCol([],[],t):i.scenegraph.updateRow([],[],t)}}else{const t=[],e=i.transpose?i.rowHeaderLevelCount:i.columnHeaderLevelCount,o=i.internalProps.layoutMap.hasAggregationOnTopCount,r=i.internalProps.layoutMap.hasAggregationOnBottomCount;for(let r=0;r<n.length;r++){const s=n[r]+e+o;i.transpose?t.push({col:s,row:0}):t.push({col:0,row:s})}for(let n=e;n<e+o;n++)i.transpose?t.push({col:n,row:0}):t.push({col:0,row:n});for(let e=(i.transpose?i.colCount:i.rowCount)-r;e<(i.transpose?i.colCount:i.rowCount);e++)i.transpose?t.push({col:e,row:0}):t.push({col:0,row:e});i.transpose?i.scenegraph.updateCol([],[],t):i.scenegraph.updateRow([],[],t)}}}(t,e,this)}_hasCustomRenderOrLayout(){var t,e,i,o;const{headerObjects:n}=this.internalProps.layoutMap;if(this.options.customRender)return!0;for(let r=0;r<n.length;r++){const s=n[r];if((null===(t=null==s?void 0:s.define)||void 0===t?void 0:t.customLayout)||(null===(e=null==s?void 0:s.define)||void 0===e?void 0:e.headerCustomLayout)||(null===(i=null==s?void 0:s.define)||void 0===i?void 0:i.customRender)||(null===(o=null==s?void 0:s.define)||void 0===o?void 0:o.headerCustomRender))return!0}return!1}getAggregateValuesByField(t){const e=this.internalProps.layoutMap.getColumnByField(t),i=[];for(let t=0;t<e.length;t++){const o=e[t].columnDefine.aggregator;if(delete e[t].columnDefine,o){const n={col:e[t].col,aggregateValue:null};if(n.aggregateValue=[],Array.isArray(o))for(let t=0;t<o.length;t++)n.aggregateValue.push({aggregationType:o[t].type,value:o[t].value()});else n.aggregateValue.push({aggregationType:o.type,value:o.value()});i.push(n)}}return i}isAggregation(t,e){return this.internalProps.layoutMap.isAggregation(t,e)}getGroupTitleLevel(t,e){var i;if(!this.options.groupBy)return;const o=this.dataSource.getIndexKey(this.getRecordShowIndexByCell(t,e)),n=null!==(i=this.dataSource.getGroupLength())&&void 0!==i?i:0;let r=rt(o)?o.length-1:0;return n>0&&r===n&&(r=void 0),r}getBodyRowIndexByRecordIndex(t){return this.dataSource.getTableIndex(t)}}function Gk(t){return"bottom"===t||"top"===t}class jk{constructor(){this._scale=new Xb,this._scales=[this._scale]}valueToPosition(t){return this._scale.scale(t)}getPosition(t){let e=0,i=this._scale;if(1===this._scales.length||1===t.length)e=this.valueToPosition(t[0]);else{const o=Math.min(t.length,this._scales.length);for(let i=0;i<o;i++)e+=this._scales[i].scale(t[i]);i=this._scales[o-1]}return{position:e,bandScale:i}}calcScales(t,e){var i,o;const{bandPadding:n,paddingInner:r,paddingOuter:s}=this,l=rt(n),a=rt(r),h=rt(s);for(let d=0;d<this._scales.length;d++){const c=l?n[d]:n,u=a?r[d]:r,g=h?s[d]:s;this._scales[d].paddingInner(null!==(i=null!=u?u:c)&&void 0!==i?i:t,!0).paddingOuter(null!==(o=null!=g?g:c)&&void 0!==o?o:e)}}dataToPosition(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};var i;if(0===t.length||0===this._scales.length)return 0;const{position:o,bandScale:n}=this.getPosition(t);return o+n.bandwidth()*(null!==(i=e.bandPosition)&&void 0!==i?i:.5)}updateScaleDomain(t){for(let e=0;e<this._scales.length;e++)this._scales[e].domain(t)}updateRange(t){const[e,i]=this._scale.range();t[0]===e&&t[1]===i||this._scale.range(t)}}const Vk=Math.sqrt(50),Uk=Math.sqrt(10),$k=Math.sqrt(2);class Xk{constructor(t){this._extend={},this.type=null!=t?t:"linear",this._scale="log"===t?new by:"symlog"===t?new yy:new py,this._scales=[this._scale]}setExtraAttrFromSpec(t,e,i,o,n,r){this.nice=!1,this.zero=e,this.zero&&(i.min=Math.min(i.min,0),i.max=Math.max(i.max,0)),this.domain=i,this.expand=o,"log"===this.type?this._scale.base(null!=n?n:10):"symlog"===this.type&&this._scale.constant(null!=r?r:10)}transformScaleDomain(){"symlog"===this.type||"log"===this.type||this.setScaleNice()}setScaleNice(){"log"===this.type?this.setLogScaleNice():this.setLinearScaleNice()}setLogScaleNice(){var t,e,i,o,n,r;J(null===(t=this.domain)||void 0===t?void 0:t.min)&&J(null===(e=this.domain)||void 0===e?void 0:e.max)?this.nice&&this._scale.nice():Q(null===(i=this.domain)||void 0===i?void 0:i.min)&&J(null===(o=this.domain)||void 0===o?void 0:o.max)?this.nice&&this._scale.niceMax():J(null===(n=this.domain)||void 0===n?void 0:n.min)&&Q(null===(r=this.domain)||void 0===r?void 0:r.max)&&this.nice&&this._scale.niceMin()}setLinearScaleNice(){var t,e,i,o,n,r,s,l;let a=null!==(e=null!==(t=this.forceTickCount)&&void 0!==t?t:this.tickCount)&&void 0!==e?e:10;"accurateFirst"===this.niceType&&(a=Math.max(10,a)),J(null===(i=this.domain)||void 0===i?void 0:i.min)&&J(null===(o=this.domain)||void 0===o?void 0:o.max)?this.nice&&this._scale.nice(a):Q(null===(n=this.domain)||void 0===n?void 0:n.min)&&J(null===(r=this.domain)||void 0===r?void 0:r.max)?this.nice&&this._scale.niceMax(a):J(null===(s=this.domain)||void 0===s?void 0:s.min)&&Q(null===(l=this.domain)||void 0===l?void 0:l.max)?this.nice&&this._scale.niceMin(a):this.nice&&this._scale.nice(a)}dataToPosition(t){return this.valueToPosition(t[0])}valueToPosition(t){return this._scale.scale(t)}computeLinearDomain(t){const e=[];return t.forEach((t=>{const{min:i,max:o}=t;e[0]=void 0===e[0]?i:Math.min(e[0],i),e[1]=void 0===e[1]?o:Math.max(e[1],o)})),this.expandDomain(e),this.includeZero(e),this.setDomainMinMax(e),e}expandDomain(t){if(!this.expand)return;const e=t[0],i=t[t.length-1];Q(this.expand.min)&&(t[0]=e-(i-e)*this.expand.min),Q(this.expand.max)&&(t[t.length-1]=i+(i-e)*this.expand.max)}niceDomain(t){if(Q(t[0])||Q(t[1])||"linear"!==this.type)return t;if(Math.abs(Et(t)-Pt(t))<=1e-12){let e=t[0];const i=e>=0?1:-1;if(e=Math.abs(e),e<1)t[0]=0,t[1]=1;else{let i=e/5;const o=Math.floor(Math.log(i)/Math.LN10),n=i/Math.pow(10,o);i=(n>=Vk?10:n>=Uk?5:n>=$k?2:1)*Math.pow(10,o),t[0]=0,t[1]=10*i}i<0&&(t.reverse(),t[0]*=-1,t[1]*=-1)}return t}niceMinMax(){var t,e,i,o,n,r,s,l;if(this.nice){let a=null!==(e=null!==(t=this.forceTickCount)&&void 0!==t?t:this.tickCount)&&void 0!==e?e:10;"accurateFirst"===this.niceType&&(a=Math.max(10,a)),J(null===(i=this.domain)||void 0===i?void 0:i.min)&&J(null===(o=this.domain)||void 0===o?void 0:o.max)?this._scale.nice(a):Q(null===(n=this.domain)||void 0===n?void 0:n.min)&&J(null===(r=this.domain)||void 0===r?void 0:r.max)?this._scale.niceMax(a):J(null===(s=this.domain)||void 0===s?void 0:s.min)&&Q(null===(l=this.domain)||void 0===l?void 0:l.max)?this._scale.niceMin(a):this._scale.nice(a)}}includeZero(t){this.zero&&(t[0]=Math.min(t[0],0),t[t.length-1]=Math.max(t[t.length-1],0))}setExtendDomain(t,e){if(void 0===e)return void delete this._extend[t];this._extend[t]=e;const i=this._scale.domain();this.extendDomain(i),this.includeZero(i),this.setDomainMinMax(i),this.niceDomain(i),this._scale.domain(i,this.nice),this.niceMinMax()}extendDomain(t){let e;const i=t.length-1,o=t[0]-t[i]>0,n=o?i:0,r=o?0:i;for(const i in this._extend)e=this._extend[i],e>t[r]&&(t[r]=e),e<t[n]&&(t[n]=e)}setDomainMinMax(t){if(!this.domain)return;const{min:e,max:i}=this.domain;Q(e)&&(t[0]=e),Q(i)&&(t[1]=i)}setZero(t){this.zero!==t&&(this.zero=t,this.updateScaleDomain())}updateScaleDomain(){const t=this.computeDomain([this.domain]);this.updateScaleDomainByModel(t)}computeDomain(t){return this.computeLinearDomain(t)}updateScaleDomainByModel(t){t=null!=t?t:this._scale.domain(),this.extendDomain(t),this.includeZero(t),this.setDomainMinMax(t),this.niceDomain(t),this._scale.domain(t,this.nice),this.niceMinMax()}updateRange(t){const[e,i]=this._scale.range();t[0]===e&&t[1]===i||this._scale.range(t)}}function Yk(t,e){var i;const o=e.option;vt(t)||(null===(i=null==o?void 0:o.label)||void 0===i?void 0:i.flush)&&function(t,e){const{width:i,height:o}=e.getLayoutRect(),n=Gk(e.orient),r=!0===e.option.inverse,s=t[0],l=Lt(t);if(n)if(r){const t=i,e=0,o=s.AABBBounds.x2,n=l.AABBBounds.x1;o>t&&s.setAttributes({x:t,textAlign:"right"}),n<e&&l.setAttributes({x:e,textAlign:"left"})}else{const t=0,e=i,o=s.AABBBounds.x1,n=l.AABBBounds.x2;o<t&&s.setAttributes({x:t,textAlign:"left"}),n>e&&l.setAttributes({x:e,textAlign:"right"})}else if(r){const t=s.AABBBounds.y1,e=l.AABBBounds.y2,i=0,n=o;t<i&&s.setAttributes({y:i,textBaseline:"top"}),e>n&&l.setAttributes({y:n,textBaseline:"bottom"})}else{const t=o,e=0,i=s.AABBBounds.y2,n=l.AABBBounds.y1;i>t&&s.setAttributes({y:t,textBaseline:"bottom"}),n<e&&l.setAttributes({y:e,textBaseline:"top"})}}(t,e)}const Kk=t=>t;class qk{constructor(t,e,i,o,n){var r,s,l;if(this.x=0,this.y=0,this.padding=o,this.table=n,this.orient=null!==(r=t.orient)&&void 0!==r?r:"left",this.type=null!==(s=t.type)&&void 0!==s?s:"band",this.option=St({},function(t){var e,i;return(null===(i=null===(e=null==t?void 0:t.colorScheme)||void 0===e?void 0:e.default)||void 0===i?void 0:i.palette)?St({},Hk,{tick:{style:{stroke:t.colorScheme.default.palette.axisDomainColor||"#D9DDE4"}},subTick:{style:{stroke:t.colorScheme.default.palette.axisDomainColor||"#D9DDE4"}},label:{style:{fill:t.colorScheme.default.palette.axisLabelFontColor||"#89909D"}},title:{style:{fill:t.colorScheme.default.palette.secondaryFontColor||"#333333"}}}):Hk}(t.__vtableChartTheme),function(t,e){let i;return"left"===t?i=e.axisStyle.leftAxisStyle:"right"===t?i=e.axisStyle.rightAxisStyle:"top"===t?i=e.axisStyle.topAxisStyle:"bottom"===t&&(i=e.axisStyle.bottomAxisStyle),St({},e.axisStyle.defaultAxisStyle,i)}(this.orient,n.theme),function(t,e,i){if(!i)return{};const o=i.axis;let n,r;return"linear"===e||"log"===e||"symlog"===e?n=i.axisLinear:"band"===e&&(n=i.axisBand),"top"===t||"bottom"===t?r=i.axisX:"left"!==t&&"right"!==t||(r=i.axisY),St({},o,n,r)}(this.orient,this.type,t.__vtableChartTheme),t),"left"===this.orient||"right"===this.orient){const t=0,n=0;this.width=e,this.height=i-o[0]-o[2]-n,this.y=o[0]+t}else if("top"===this.orient||"bottom"===this.orient){const t=0,n=0;this.width=e-o[1]-o[3]-n,this.height=i,this.x=o[3]+t}this.visible=null===(l=t.visible)||void 0===l||l,this.inverse="inverse"in t&&!!t.inverse,"band"===t.type&&(this.data=t.domain),this.initScale(),this.initData(),this.createComponent(),this.initEvent()}initScale(){const t=this.option;"band"===this.type||"point"===this.type?(this.scale=new jk,this.scale.bandPadding=t.bandPadding,this.scale.paddingInner=t.paddingInner,this.scale.paddingOuter=t.paddingOuter,this.scale.calcScales(.1,.3),this.scale.updateScaleDomain(this.data),this.updateScaleRange()):"linear"!==this.type&&"time"!==this.type&&"log"!==this.type&&"symlog"!==this.type||(this.scale=new Xk(this.type),this.scale.setExtraAttrFromSpec(t.nice,t.zero,t.range,t.expand,t.base,t.constant),this.scale.transformScaleDomain(),this.scale.updateScaleDomain(),this.updateScaleRange())}initData(){var t,e,i;this.table._vDataSet||(this.table._vDataSet=new wk),function(t,e,i){t.getParser(e)||t.registerParser(e,i)}(this.table._vDataSet,"scale",Kk),t=this.table._vDataSet,e="ticks",i=Ty,t.getTransform(e)||t.registerTransform(e,i);const o=this.option.label||{},n=this.option.tick||{},r=new _k(this.table._vDataSet).parse(this.scale._scale,{type:"scale"}).transform({type:"ticks",options:{sampling:!1!==this.option.sampling,tickCount:n.tickCount,forceTickCount:n.forceTickCount,tickStep:n.tickStep,tickMode:n.tickMode,noDecimals:n.noDecimals,axisOrientType:this.orient,coordinateType:"cartesian",labelStyle:o.style,labelFormatter:o.formatMethod,labelGap:o.minGap,labelLastVisible:o.lastVisible,labelFlush:o.flush}},!1);this.tickData=r,this.computeData()}computeData(){this.tickData.reRunAllTransform()}initEvent(){}createComponent(){const t=Fk(this.option),e=this.getUpdateAttribute();e.verticalFactor="top"===this.orient||"right"===this.orient?-1:1,this.component=new wb(St({disableTriggerEvent:this.table.options.disableInteraction},t,e)),this.component.setAttributes(this.setLayoutStartPosition({x:this.x,y:this.y})),this.component.originAxis=this}resize(t,e){this.width=t-("top"===this.orient||"bottom"===this.orient?this.padding[1]+this.padding[3]:0),this.height=e-("left"===this.orient||"right"===this.orient?this.padding[2]+this.padding[0]:0),this.updateScaleRange(),this.computeData();const i=Fk(this.option),o=this.getUpdateAttribute();o.verticalFactor="top"===this.orient||"right"===this.orient?-1:1,this.component.setAttributes(St({},i,o)),this.component.setAttributes(this.setLayoutStartPosition({x:this.x,y:this.y})),this.overlap()}overlap(){!function(t,e){const i=t.find((t=>"axis-label-container-layer-0"===t.name),!0),o=t.find((t=>"axis-label-container-layer-1"===t.name),!0);Yk(i?i.getChildren():[],e),Yk(o?o.getChildren():[],e)}(this.component,this)}getLayoutRect(){return{width:this.width,height:this.height}}getUpdateAttribute(){this.table.tableNoFrameHeight,this.table.tableNoFrameWidth;const{width:t,height:e}=this.getLayoutRect(),i=Gk(this.orient),o="left"===(n=this.orient)||"right"===n;var n;let r={x:0,y:0},s=0;i?(r={x:t,y:0},s=t):o&&(r={x:0,y:e},s=e);const l="top"===this.orient||"bottom"===this.orient?e:t;return{start:{x:0,y:0},end:r,title:{text:this.option.title.text,maxWidth:this._getTitleLimit(i)},items:this.getLabelItems(s),verticalLimitSize:l,verticalMinSize:l}}getLabelItems(t){return[this.tickData.latestData.map((e=>({id:e.value,label:e.value,value:0===t?0:this.scale.dataToPosition([e.value])/t,rawValue:e.value}))).filter((t=>t.value>=0&&t.value<=1))]}updateScaleRange(){var t,e,i,o,n,r,s,l;const a=null!==(e=null===(t=this.option.innerOffset)||void 0===t?void 0:t.right)&&void 0!==e?e:0,h=null!==(o=null===(i=this.option.innerOffset)||void 0===i?void 0:i.left)&&void 0!==o?o:0,d=null!==(r=null===(n=this.option.innerOffset)||void 0===n?void 0:n.top)&&void 0!==r?r:0,c=null!==(l=null===(s=this.option.innerOffset)||void 0===s?void 0:s.bottom)&&void 0!==l?l:0,{width:u,height:g}=this.getLayoutRect(),p=this.option.inverse||!1;let f=[0,0];Gk(this.orient)?ht(u)&&(f=p?[u-a,h]:[h,u-a]):ht(g)&&(f=p?[d,g-c]:[g-c,d]),this.scale.updateRange(f)}setLayoutStartPosition(t){let{x:e,y:i}=t;return ht(e)&&(e+=Number("left"===this.orient)*this.getLayoutRect().width),ht(i)&&(i+=Number("top"===this.orient)*this.getLayoutRect().height),{x:e,y:i}}_getTitleLimit(t){var e,i,o;if(this.option.title.visible&&J(null===(e=this.option.title.style)||void 0===e?void 0:e.maxLineWidth)){let e=(null===(i=this.option.title.style)||void 0===i?void 0:i.angle)||0;if((null===(o=this.option.title)||void 0===o?void 0:o.autoRotate)&&J(this.option.title.angle)&&(e="left"===this.option.orient?-90:90),t){const t=this.getLayoutRect().width,i=Math.abs(Math.cos(ye(e)));return i<1e-6?1/0:t/i}const n=this.getLayoutRect().height,r=Math.abs(Math.sin(ye(e)));return r<1e-6?1/0:n/r}return null}getScale(){return this.scale._scale}getDomainSpec(){return this.scale.domain}}function Zk(t,e){var i,o,n,r,s,l,a,h,d,c,u,g,p,f,v,m;const b=St({},Hk,t);let y=0;!1!==b.tick.visible&&(y=null!==(i=b.tick.width)&&void 0!==i?i:4);let C=0;if(b.label.visible){if("band"===b.type)b.domain.forEach((t=>{var i,o,n,r,s,l,a,h,d,c,u,g,p,f,v,m;b.label.formatMethod&&(t=b.label.formatMethod(t));const{width:y,height:w}=e.measureText(t,{fontSize:null!==(n=null===(o=null===(i=b.label)||void 0===i?void 0:i.style)||void 0===o?void 0:o.fontSize)&&void 0!==n?n:Lk,fontWeight:null!==(l=null===(s=null===(r=b.label)||void 0===r?void 0:r.style)||void 0===s?void 0:s.fontWeight)&&void 0!==l?l:"normal",fontFamily:null!==(d=null===(h=null===(a=b.label)||void 0===a?void 0:a.style)||void 0===h?void 0:h.fontFamily)&&void 0!==d?d:kk}),x=(null===(u=null===(c=b.label)||void 0===c?void 0:c.style)||void 0===u?void 0:u.maxLineWidth)||1/0,_=(null!==(f=null===(p=null===(g=b.label)||void 0===g?void 0:g.style)||void 0===p?void 0:p.angle)&&void 0!==f?f:0)+("vertical"===(null===(m=null===(v=b.label)||void 0===v?void 0:v.style)||void 0===m?void 0:m.direction)?90:0);C=Math.max(C,tL(Math.min(y,x),w,_).width)}));else{let i;if(rt(t.__ticksForVTable))i=t.__ticksForVTable;else{const t=b.range,e=Math.abs(t.min)>1?Math.round(t.min):t.min,o=Math.abs(t.max)>1?Math.round(t.max):t.max;i=[Qk(e),Qk(o)]}i.forEach((t=>{var i,o,n,r,s,l,a,h,d,c,u,g,p,f,v,m;b.label.formatMethod&&(t=b.label.formatMethod(t));const{width:y,height:w}=e.measureText(t,{fontSize:null!==(n=null===(o=null===(i=b.label)||void 0===i?void 0:i.style)||void 0===o?void 0:o.fontSize)&&void 0!==n?n:Lk,fontWeight:null!==(l=null===(s=null===(r=b.label)||void 0===r?void 0:r.style)||void 0===s?void 0:s.fontWeight)&&void 0!==l?l:"normal",fontFamily:null!==(d=null===(h=null===(a=b.label)||void 0===a?void 0:a.style)||void 0===h?void 0:h.fontFamily)&&void 0!==d?d:kk}),x=(null===(u=null===(c=b.label)||void 0===c?void 0:c.style)||void 0===u?void 0:u.maxLineWidth)||1/0,_=(null!==(f=null===(p=null===(g=b.label)||void 0===g?void 0:g.style)||void 0===p?void 0:p.angle)&&void 0!==f?f:0)+("vertical"===(null===(m=null===(v=b.label)||void 0===v?void 0:v.style)||void 0===m?void 0:m.direction)?90:0);C=Math.max(C,tL(Math.min(y,x),w,_).width)}))}C+=null!==(o=b.label.space)&&void 0!==o?o:4}let w=0;if(b.title.visible&&nt(b.title.text)){const{width:i,height:o}=e.measureText(b.title.text,{fontSize:null!==(s=null===(r=null===(n=b.title)||void 0===n?void 0:n.style)||void 0===r?void 0:r.fontSize)&&void 0!==s?s:Lk,fontWeight:null!==(h=null===(a=null===(l=b.title)||void 0===l?void 0:l.style)||void 0===a?void 0:a.fontWeight)&&void 0!==h?h:"normal",fontFamily:null!==(u=null===(c=null===(d=b.title)||void 0===d?void 0:d.style)||void 0===c?void 0:c.fontFamily)&&void 0!==u?u:kk}),y=(null===(p=null===(g=b.label)||void 0===g?void 0:g.style)||void 0===p?void 0:p.maxLineWidth)||1/0,C=tL(Math.min(i,y),o,null===(v=null===(f=b.title)||void 0===f?void 0:f.style)||void 0===v?void 0:v.angle);w="left"!==t.orient&&"right"!==t.orient||!b.title.autoRotate?C.width:C.height,w+=null!==(m=b.title.space)&&void 0!==m?m:4}return y+C+w+1}function Jk(t,e){var i,o,n,r,s,l,a,h,d,c,u,g,p,f,v,m;const b=St({},Hk,t);let y=0;!1!==b.tick.visible&&(y=null!==(i=b.tick.width)&&void 0!==i?i:4);let C=0;if(b.label.visible){if("band"===b.type)b.domain.forEach((t=>{var i,o,n,r,s,l,a,h,d,c,u,g,p,f,v,m;b.label.formatMethod&&(t=b.label.formatMethod(t));const{width:y,height:w}=e.measureText(t,{fontSize:null!==(n=null===(o=null===(i=b.label)||void 0===i?void 0:i.style)||void 0===o?void 0:o.fontSize)&&void 0!==n?n:Lk,fontWeight:null!==(l=null===(s=null===(r=b.label)||void 0===r?void 0:r.style)||void 0===s?void 0:s.fontWeight)&&void 0!==l?l:"normal",fontFamily:null!==(d=null===(h=null===(a=b.label)||void 0===a?void 0:a.style)||void 0===h?void 0:h.fontFamily)&&void 0!==d?d:kk}),x=(null===(u=null===(c=b.label)||void 0===c?void 0:c.style)||void 0===u?void 0:u.maxLineWidth)||1/0,_=(null!==(f=null===(p=null===(g=b.label)||void 0===g?void 0:g.style)||void 0===p?void 0:p.angle)&&void 0!==f?f:0)+("vertical"===(null===(m=null===(v=b.label)||void 0===v?void 0:v.style)||void 0===m?void 0:m.direction)?90:0);C=Math.max(C,tL(Math.min(y,x),w,_).height)}));else{let i;if(rt(t.__ticksForVTable))i=t.__ticksForVTable;else{const t=b.range,e=Math.abs(t.min)>1?Math.round(t.min):t.min,o=Math.abs(t.max)>1?Math.round(t.max):t.max;i=[Qk(e),Qk(o)]}i.forEach((t=>{var i,o,n,r,s,l,a,h,d,c,u,g,p,f,v,m;b.label.formatMethod&&(t=b.label.formatMethod(t));const{width:y,height:w}=e.measureText(t,{fontSize:null!==(n=null===(o=null===(i=b.label)||void 0===i?void 0:i.style)||void 0===o?void 0:o.fontSize)&&void 0!==n?n:Lk,fontWeight:null!==(l=null===(s=null===(r=b.label)||void 0===r?void 0:r.style)||void 0===s?void 0:s.fontWeight)&&void 0!==l?l:"normal",fontFamily:null!==(d=null===(h=null===(a=b.label)||void 0===a?void 0:a.style)||void 0===h?void 0:h.fontFamily)&&void 0!==d?d:kk}),x=(null===(u=null===(c=b.label)||void 0===c?void 0:c.style)||void 0===u?void 0:u.maxLineWidth)||1/0,_=(null!==(f=null===(p=null===(g=b.label)||void 0===g?void 0:g.style)||void 0===p?void 0:p.angle)&&void 0!==f?f:0)+("vertical"===(null===(m=null===(v=b.label)||void 0===v?void 0:v.style)||void 0===m?void 0:m.direction)?90:0);C=Math.max(C,tL(Math.min(y,x),w,_).height)}))}C+=null!==(o=b.label.space)&&void 0!==o?o:4}let w=0;if(b.title.visible&&b.title.text){const{width:i,height:o}=e.measureText(b.title.text,{fontSize:null!==(s=null===(r=null===(n=b.title)||void 0===n?void 0:n.style)||void 0===r?void 0:r.fontSize)&&void 0!==s?s:Lk,fontWeight:null!==(h=null===(a=null===(l=b.title)||void 0===l?void 0:l.style)||void 0===a?void 0:a.fontWeight)&&void 0!==h?h:"normal",fontFamily:null!==(u=null===(c=null===(d=b.title)||void 0===d?void 0:d.style)||void 0===c?void 0:c.fontFamily)&&void 0!==u?u:kk}),y=(null===(p=null===(g=b.label)||void 0===g?void 0:g.style)||void 0===p?void 0:p.maxLineWidth)||1/0,C=tL(Math.min(i,y),o,null===(v=null===(f=b.title)||void 0===f?void 0:f.style)||void 0===v?void 0:v.angle);w="bottom"!==t.orient&&"top"!==t.orient||!b.title.autoRotate?C.height:C.width,w+=null!==(m=b.title.space)&&void 0!==m?m:4}return y+C+w+1}function Qk(t){return"number"!=typeof t&&(t=Number(t)),Number(t.toPrecision(1)).toString()}function tL(t,e){const i=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:0)*Math.PI/180,o=-t/2,n=-e/2,r=t/2,s=-e/2,l=t/2,a=e/2,h=-t/2,d=e/2,c={x:o*Math.cos(i)-n*Math.sin(i),y:o*Math.sin(i)+n*Math.cos(i)},u={x:r*Math.cos(i)-s*Math.sin(i),y:r*Math.sin(i)+s*Math.cos(i)},g={x:l*Math.cos(i)-a*Math.sin(i),y:l*Math.sin(i)+a*Math.cos(i)},p={x:h*Math.cos(i)-d*Math.sin(i),y:h*Math.sin(i)+d*Math.cos(i)},f=Math.min(c.x,u.x,g.x,p.x),v=Math.max(c.x,u.x,g.x,p.x),m=Math.min(c.y,u.y,g.y,p.y);return{width:v-f,height:Math.max(c.y,u.y,g.y,p.y)-m}}class eL{constructor(t,e){this._emptyTipOption={spaceBetweenTextAndIcon:20,text:"no data",textStyle:{fontSize:14,color:"#000"},icon:{image:'<svg t="1716726614852" class="icon" viewBox="0 0 1194 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2621" width="200" height="200"><path d="M1038.694079 367.237067c13.265507 23.342857-16.633865-40.004445-63.05621-40.004446H219.018794c-26.558738 0-46.46393 13.334815-63.05621 40.004446S0.006238 607.277601 0.006238 650.608819V940.647979a82.351494 82.351494 0 0 0 82.961402 83.349526H1111.702885a82.337632 82.337632 0 0 0 82.975264-83.349526V650.608819c0-43.331218-155.970208-283.371753-155.970208-283.371752zM730.066575 667.284269a136.328386 136.328386 0 0 1-132.738243 133.33429 133.417459 133.417459 0 0 1-132.738243-133.33429v-6.681269a40.6698 40.6698 0 0 0-36.497473-26.66963H73.015044l119.458874-220.02445s23.231965-40.004445 53.103614-40.004446h713.481918c26.544876 0 29.871649 10.008042 46.436207 40.004446L1128.33675 633.947231H769.904682c-26.184476 0-39.838107 7.623855-39.838107 33.337038zM338.505391 210.559919l-89.601086-86.69016a22.178487 22.178487 0 0 1 0-33.26773 21.984425 21.984425 0 0 1 33.170699 0l89.601087 86.676299a22.317102 22.317102 0 0 1 0 33.26773 24.950798 24.950798 0 0 1-33.1707 0z m252.197118-40.059891a25.532983 25.532983 0 0 1-6.639685-16.633865l-3.326773-126.694606A28.263709 28.263709 0 0 1 603.995739 0.515788c13.251646-3.326773 23.204242 10.021904 26.544877 23.342858V153.866163a28.249847 28.249847 0 0 1-23.259688 26.66963c-6.611961-3.312911-13.279369-3.312911-16.578419-10.035765z m235.646421 33.337038a22.372548 22.372548 0 0 1 0-33.337038l86.288175-90.030795a22.039871 22.039871 0 0 1 33.170699 0 22.289379 22.289379 0 0 1 0 33.364761l-82.961401 90.003072a25.962691 25.962691 0 0 1-36.483611 0z" fill="#8a8a8a" p-id="2622"></path></svg>',width:100,height:100}},this.isReleased=!1,this.table=e,this._emptyTipOption=Object.assign(this._emptyTipOption,!0===t?{}:t),this._emptyTipComponent=this._createOrUpdateEmptyTipComponent(this._getEmptyTipAttrs())}_createOrUpdateEmptyTipComponent(t){if(this._emptyTipComponent)Rt(t,this._cacheAttrs)||this._emptyTipComponent.setAttributes(t);else{const e=new eC(t);e.name="emptyTip",this.table.scenegraph.stage.defaultLayer.appendChild(e),this._emptyTipComponent=e}return this._emptyTipComponent}resize(){var t;if(!this._emptyTipComponent)return;const e=this.table.transpose||!1===this.table.options.indicatorsAsCol?this.table.getFrozenColsWidth():0,i=!this.table.transpose||this.table.options.indicatorsAsCol?this.table.getFrozenRowsHeight():0,o=(this.table.columnHeaderLevelCount>0&&this.table.isListTable()?this.table.getDrawRange().width:this.table.tableNoFrameWidth)-e-this.table.getTheme().scrollStyle.width,n=(this.table.rowHeaderLevelCount>0&&this.table.isListTable()?this.table.getDrawRange().height:this.table.tableNoFrameHeight)-i-this.table.getTheme().scrollStyle.width;this._emptyTipComponent.setAttributes({spaceBetweenTextAndIcon:this._emptyTipOption.spaceBetweenTextAndIcon,x:this.table.tableX+e,y:this.table.tableY+i,width:o,height:n,text:Object.assign(Object.assign({text:this._emptyTipOption.text},this._emptyTipOption.textStyle),{fill:null===(t=this._emptyTipOption.textStyle)||void 0===t?void 0:t.color}),icon:Object.assign({},this._emptyTipOption.icon)})}release(){this._emptyTipComponent&&this.table.scenegraph.stage.defaultLayer.removeChild(this._emptyTipComponent),this._emptyTipComponent=null,this.isReleased=!0}resetVisible(){(this.table.recordsCount&&0!==this.table.recordsCount||this.table.internalProps.layoutMap.rowCount!==this.table.internalProps.layoutMap.columnHeaderLevelCount)&&this.table.internalProps.layoutMap.colCount!==this.table.internalProps.layoutMap.rowHeaderLevelCount?this.table.scenegraph.stage.defaultLayer.children.includes(this._emptyTipComponent)&&this.table.scenegraph.stage.defaultLayer.removeChild(this._emptyTipComponent):this.table.scenegraph.stage.defaultLayer.children.includes(this._emptyTipComponent)||this.table.scenegraph.stage.defaultLayer.appendChild(this._emptyTipComponent)}_getEmptyTipAttrs(){var t;const e=this.table.transpose||!1===this.table.options.indicatorsAsCol?this.table.getFrozenColsWidth():0,i=!this.table.transpose||this.table.options.indicatorsAsCol?this.table.getFrozenRowsHeight():0,o=(this.table.columnHeaderLevelCount>0&&this.table.isListTable()?this.table.getDrawRange().width:this.table.tableNoFrameWidth)-e-this.table.getTheme().scrollStyle.width,n=(this.table.rowHeaderLevelCount>0&&this.table.isListTable()?this.table.getDrawRange().height:this.table.tableNoFrameHeight)-i-this.table.getTheme().scrollStyle.width;return{spaceBetweenTextAndIcon:this._emptyTipOption.spaceBetweenTextAndIcon,x:this.table.tableX+e,y:this.table.tableY+i,width:o,height:n,text:Object.assign(Object.assign({text:this._emptyTipOption.text},this._emptyTipOption.textStyle),{fill:null===(t=this._emptyTipOption.textStyle)||void 0===t?void 0:t.color}),icon:Object.assign({},this._emptyTipOption.icon)}}}var iL=function(t,e){var i={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(i[o]=t[o]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(o=Object.getOwnPropertySymbols(t);n<o.length;n++)e.indexOf(o[n])<0&&Object.prototype.propertyIsEnumerable.call(t,o[n])&&(i[o[n]]=t[o[n]])}return i};const oL={orient:"bottom",position:"middle",padding:30,title:{visible:!1,padding:0,textStyle:{fontSize:14,fill:"#000000",fontWeight:"normal"},space:12},item:{visible:!0,spaceCol:10,spaceRow:10,padding:2,background:{state:{selectedHover:{fill:"gray",fillOpacity:.7},unSelectedHover:{fill:"gray",fillOpacity:.2}}},shape:{space:4,state:{unSelected:{fillOpacity:.5}}},label:{space:4,style:{fill:"#89909D",fontSize:14},state:{unSelected:{fillOpacity:.5}}}},allowAllCanceled:!0,visible:!0};class nL{constructor(t,e){var i,o,n,r;this.table=e,this.option=Ct(t),this.orient=null!==(i=t.orient)&&void 0!==i?i:"left",this.visible=null===(o=t.visible)||void 0===o||o,this.position=null!==(n=t.position)&&void 0!==n?n:"middle",this.selectedData=null!==(r=t.defaultSelected)&&void 0!==r?r:null,this.createComponent(),this.initEvent()}createComponent(){const t=this.getLegendAttributes({width:this.table.tableNoFrameWidth,height:this.table.tableNoFrameHeight}),e=new Vy(St({},t,{defaultSelected:this.selectedData,disableTriggerEvent:this.table.options.disableInteraction}));e.name="legend",this.legendComponent=e,!1===this.visible&&(e.setAttributes({maxWidth:0,width:0,maxHeight:0,height:0,clip:!0}),e.hideAll()),this.table.scenegraph.stage.defaultLayer.appendChild(e),this.adjustTableSize(t)}resize(){this.legendComponent&&(this.legendComponent.setAttributes({width:this.table.tableNoFrameWidth,height:this.table.tableNoFrameHeight}),this.adjustTableSize(this.legendComponent.attribute))}adjustTableSize(t){var e,i;let o=isFinite(this.legendComponent.AABBBounds.width())?this.legendComponent.AABBBounds.width():0,n=isFinite(this.legendComponent.AABBBounds.height())?this.legendComponent.AABBBounds.height():0;if(o<=0||n<=0)return;const r=this.table.tableNoFrameWidth,s=this.table.tableNoFrameHeight,l=r_(null!==(i=null!==(e=t.padding)&&void 0!==e?e:this.option.padding)&&void 0!==i?i:10);let a=0,h=0;"left"===this.orient?(a=l[3],h=0,o+=l[1]+l[3]):"top"===this.orient?(a=0,h=l[0],n+=l[0]+l[2]):"right"===this.orient?(a=r-o-l[1],h=0,o+=l[1]+l[3]):"bottom"===this.orient&&(a=0,h=s-n-l[2],n+=l[0]+l[2]);const d="bottom"===this.orient||"top"===this.orient?"horizontal":"vertical",c=this.position;let u=0,g=0;"horizontal"===d?u="middle"===c?(r-o)/2:"end"===c?r-o-l[1]:l[3]:g="middle"===c?(s-n)/2:"end"===c?s-n-l[2]:l[0],this.legendComponent.setAttributes({dx:u,dy:g,x:a,y:h}),"left"===this.orient?(this.table.tableNoFrameWidth=this.table.tableNoFrameWidth-Math.ceil(o),this.table.tableX+=Math.ceil(o)):"top"===this.orient?(this.table.tableNoFrameHeight=this.table.tableNoFrameHeight-Math.ceil(n),this.table.tableY+=Math.ceil(n)):"right"===this.orient?this.table.tableNoFrameWidth=this.table.tableNoFrameWidth-Math.ceil(o):"bottom"===this.orient&&(this.table.tableNoFrameHeight=this.table.tableNoFrameHeight-Math.ceil(n))}getLegendAttributes(t){var e,i;const o="bottom"===this.orient||"top"===this.orient?"horizontal":"vertical",n=function(t,e){const i=St({},oL,t),{title:o={},item:n={},pager:r={},background:s={},type:l,id:a,visible:h,orient:d,position:c,data:u,filter:g,regionId:p,regionIndex:f,seriesIndex:v,seriesId:m,padding:b}=i,y=iL(i,["title","item","pager","background","type","id","visible","orient","position","data","filter","regionId","regionIndex","seriesIndex","seriesId","padding"]);return o.visible&&(y.title=Ak(o)),vt(n.focusIconStyle)||Bk(n.focusIconStyle),Rk(n.shape),Rk(n.label),Rk(n.value),Rk(n.background),I_(n.maxWidth)&&(n.maxWidth=Number(n.maxWidth.substring(0,n.maxWidth.length-1))*e.width/100),I_(n.width)&&(n.width=Number(n.width.substring(0,n.width.length-1))*e.width/100),I_(n.height)&&(n.height=Number(n.height.substring(0,n.height.length-1))*e.width/100),y.item=n,vt(r.textStyle)||Bk(r.textStyle),Rk(r.handler),y.pager=r,s.visible&&!vt(s.style)&&(St(y,s.style),Q(s.padding)&&(y.padding=s.padding)),y}(this.option,t),r=r_(null!==(i=null!==(e=n.padding)&&void 0!==e?e:this.option.padding)&&void 0!==i?i:10);return Object.assign({layout:o,items:this.getLegendItems(),maxWidth:t.width-r[1]-r[3],maxHeight:t.height-r[0]-r[2]},n)}getLegendItems(){return this.option.data}initEvent(){this.legendComponent&&(this.legendComponent.addEventListener(Iy.legendItemClick,(t=>{const e=mt(t,"detail.currentSelected");this.table.fireListeners(Xw.LEGEND_ITEM_CLICK,{model:this,value:e,event:t})})),this.legendComponent.addEventListener(Iy.legendItemHover,(t=>{const e=mt(t,"detail");this.table.fireListeners(Xw.LEGEND_ITEM_HOVER,{model:this,value:e,event:t})})),this.legendComponent.addEventListener(Iy.legendItemUnHover,(t=>{const e=mt(t,"detail");this.table.fireListeners(Xw.LEGEND_ITEM_UNHOVER,{model:this,value:e,event:t})})),this.legendComponent.addEventListener("legendItemAttributeUpdate",(t=>{this.table.scenegraph.updateNextFrame()})))}getLegendBounds(){return{width:isFinite(this.legendComponent.AABBBounds.width())?this.legendComponent.AABBBounds.width():0,height:isFinite(this.legendComponent.AABBBounds.height())?this.legendComponent.AABBBounds.height():0}}release(){this.legendComponent&&this.table.scenegraph.stage.defaultLayer.removeChild(this.legendComponent),this.legendComponent=null}}var rL=function(t,e){var i={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(i[o]=t[o]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(o=Object.getOwnPropertySymbols(t);n<o.length;n++)e.indexOf(o[n])<0&&Object.prototype.propertyIsEnumerable.call(t,o[n])&&(i[o[n]]=t[o[n]])}return i};const sL={orient:"right",position:"middle",padding:30,title:{visible:!1,padding:0,textStyle:{fontSize:14,fontWeight:"normal",fill:{type:"palette",key:"titleFontColor"}},space:12},handler:{visible:!0},startText:{style:{fontSize:14,fontWeight:"normal",fill:{type:"palette",key:"labelFontColor"}}},endText:{style:{fontSize:14,fontWeight:"normal",fill:{type:"palette",key:"labelFontColor"}}},handlerText:{style:{fontSize:14,fontWeight:"normal",fill:{type:"palette",key:"labelFontColor"}}}},lL={horizontal:Object.assign(Object.assign({},sL),{rail:{width:200,height:8,style:{fill:"rgba(0,0,0,0.04)"}}}),vertical:Object.assign(Object.assign({},sL),{rail:{width:8,height:200,style:{fill:"rgba(0,0,0,0.04)"}}})},aL={horizontal:Object.assign({sizeBackground:{fill:"#cdcdcd"},track:{style:{fill:"rgba(20,20,20,0.1)"}},rail:{width:200,height:4,style:{fill:"rgba(0,0,0,0.04)"}}},sL),vertical:Object.assign({sizeBackground:{fill:"#cdcdcd"},track:{style:{fill:"rgba(20,20,20,0.1)"}},rail:{width:4,height:200,style:{fill:"rgba(0,0,0,0.04)"}}},sL)};class hL{constructor(t,e){var i,o,n,r;this.table=e,this.option=Ct(t),this.orient=null!==(i=t.orient)&&void 0!==i?i:"left",this.visible=null===(o=t.visible)||void 0===o||o,this.position=null!==(n=t.position)&&void 0!==n?n:"middle",this.selectedData=null!==(r=t.defaultSelected)&&void 0!==r?r:null,this.createComponent(),this.initEvent()}createComponent(){const t=this.getLegendAttributes({width:this.table.tableNoFrameWidth,height:this.table.tableNoFrameHeight});let e;e="color"===this.option.type?new Ky(St({},t,{slidable:!0})):new Zy(St({},t,{slidable:!0})),e.name="legend",this.legendComponent=e,this.table.scenegraph.stage.defaultLayer.appendChild(e),this.adjustTableSize(t)}resize(){this.legendComponent&&(this.legendComponent.setAttributes({width:this.table.tableNoFrameWidth,height:this.table.tableNoFrameHeight}),this.adjustTableSize(this.legendComponent.attribute))}adjustTableSize(t){var e,i;let o=isFinite(this.legendComponent.AABBBounds.width())?this.legendComponent.AABBBounds.width():0,n=isFinite(this.legendComponent.AABBBounds.height())?this.legendComponent.AABBBounds.height():0;if(o<=0||n<=0)return;const r=this.table.tableNoFrameWidth,s=this.table.tableNoFrameHeight,l=r_(null!==(i=null!==(e=t.padding)&&void 0!==e?e:this.option.padding)&&void 0!==i?i:10);let a=0,h=0;"left"===this.orient?(a=l[3],h=0,o+=l[1]+l[3]):"top"===this.orient?(a=0,h=l[0],n+=l[0]+l[2]):"right"===this.orient?(a=r-o-l[1],h=0,o+=l[1]+l[3]):"bottom"===this.orient&&(a=0,h=s-n-l[2],n+=l[0]+l[2]);const d="bottom"===this.orient||"top"===this.orient?"horizontal":"vertical",c=this.position;let u=0,g=0;"horizontal"===d?u="middle"===c?(r-o)/2:"end"===c?r-o-l[1]:l[3]:g="middle"===c?(s-n)/2:"end"===c?s-n-l[2]:l[0],this.legendComponent.setAttributes({dx:u,dy:g,x:a,y:h}),"left"===this.orient?(this.table.tableNoFrameWidth=this.table.tableNoFrameWidth-Math.ceil(o),this.table.tableX+=Math.ceil(o)):"top"===this.orient?(this.table.tableNoFrameHeight=this.table.tableNoFrameHeight-Math.ceil(n),this.table.tableY+=Math.ceil(n)):"right"===this.orient?this.table.tableNoFrameWidth=this.table.tableNoFrameWidth-Math.ceil(o):"bottom"===this.orient&&(this.table.tableNoFrameHeight=this.table.tableNoFrameHeight-Math.ceil(n))}getLegendAttributes(t){const e="bottom"===this.orient||"top"===this.orient?"horizontal":"vertical",i="horizontal"===e?"bottom":this.orient;return Object.assign(Object.assign({},function(t,e){const i=St({},("color"===t.type?lL:aL)["bottom"===t.orient||"top"===t.orient?"horizontal":"vertical"],t),{title:o={},handler:n={},rail:r={},track:s={},startText:l,endText:a,handlerText:h,sizeBackground:d,background:c={},type:u,id:g,visible:p,orient:f,position:v,data:m,defaultSelected:b,field:y,filter:C,regionId:w,regionIndex:x,seriesIndex:_,seriesId:S,padding:A}=i,B=rL(i,["title","handler","rail","track","startText","endText","handlerText","sizeBackground","background","type","id","visible","orient","position","data","defaultSelected","field","filter","regionId","regionIndex","seriesIndex","seriesId","padding"]);return o.visible&&(B.title=Ak(o)),B.showHandler=!1!==n.visible,vt(n.style)||(B.handlerStyle=Bk(n.style)),Q(r.width)&&(B.railWidth=r.width),Q(r.height)&&(B.railHeight=r.height),vt(r.style)||(B.railStyle=Bk(r.style)),vt(s.style)||(B.trackStyle=Bk(s.style)),B.startText=Rk(l),B.endText=Rk(a),B.handlerText=Rk(h),vt(d)||(B.sizeBackground=Bk(d)),c.visible&&!vt(c.style)&&(St(B,c.style),Q(c.padding)&&(B.padding=c.padding)),B}(this.option)),{layout:e,align:i,min:this.option.min,max:this.option.max,value:this.option.value,["color"===this.option.type?"colors":"sizeRange"]:"color"===this.option.type?this.option.colors:this.option.sizeRange})}initEvent(){this.legendComponent&&this.legendComponent.addEventListener("change",(t=>{const e=mt(t,"detail.value");this.table.fireListeners(Xw.LEGEND_CHANGE,{model:this,value:e,event:t}),this.table.scenegraph.updateNextFrame()}))}getLegendBounds(){return{width:isFinite(this.legendComponent.AABBBounds.width())?this.legendComponent.AABBBounds.width():0,height:isFinite(this.legendComponent.AABBBounds.height())?this.legendComponent.AABBBounds.height():0}}release(){this.legendComponent&&this.table.scenegraph.stage.defaultLayer.removeChild(this.legendComponent),this.legendComponent=null}}function dL(t,e){return"color"===t.type||"size"===t.type?new hL(t,e):new nL(t,e)}class cL{constructor(t){this._table=t}release(){this.unbindMenuElement(),this._menuElement&&this._menuElement.release(),this._menuElement=void 0}_getMenuElement(){return this._menuElement||(this._menuElement=this.createMenuElementInternal()),this._menuElement}bindMenuElement(t,e,i){return this._getMenuElement().bindToCell(this._table,t,e,i)}unbindMenuElement(){this._getMenuElement().unbindFromCell()}pointInMenuElement(t,e){return this._getMenuElement().pointInMenuElement(t,e)}}const uL="vtable__menu-element",gL=`${uL}--hidden`,pL=`${uL}--shown`;class fL{constructor(t){var e,i,o;this._handler=new Zw,this._rootElement=oT("div",[uL,gL]),this._rootElement.addEventListener("wheel",(t=>{t.stopPropagation()})),null===(e=this._rootElement)||void 0===e||e.addEventListener("mousedown",(t=>{t.stopPropagation(),t.preventDefault()})),null===(i=this._rootElement)||void 0===i||i.addEventListener("click",(e=>{if(e.stopPropagation(),e.preventDefault(),this._rootElement.classList.contains(gL))return;const{col:i,row:o,dropDownIndex:n,menuKey:r,text:s,hasChildren:l}=e.target;if("number"!=typeof n||l)return void e.stopPropagation();const a=t.isPivotTable()?t.internalProps.layoutMap.getPivotDimensionInfo(i,o):t.getHeaderField(i,o),h=t._dropDownMenuIsHighlight(i,o,n);t.fireListeners(Xw.DROPDOWN_MENU_CLICK,{col:i,row:o,field:a,menuKey:r,text:s,highlight:h,cellLocation:t.getCellLocation(i,o),event:e}),t.fireListeners(Xw.DROPDOWN_MENU_CLEAR,null),t.fireListeners(Xw.HIDE_MENU,null),e.stopPropagation()})),null===(o=this._rootElement)||void 0===o||o.addEventListener("mousemove",(t=>{this._rootElement.classList.contains(gL)||t.stopPropagation()}))}get rootElement(){return this._rootElement}release(){this.unbindFromCell();const t=this._rootElement;(null==t?void 0:t.parentElement)&&t.parentElement.removeChild(t),this._handler.release(),delete this._rootElement}bindToCell(t,e,i,o){const n=this._rootElement;if(this._menuInstanceInfo=o,null==n||n.classList.remove(pL),null==n||n.classList.add(gL),this._canBindToCell(t,e,i)){if(n.innerHTML="",n.appendChild(o.content),this._bindCell(t,e,i,o.position,o.referencePosition))return null==n||n.classList.add(pL),null==n||n.classList.remove(gL),!0}else this.unbindFromCell();return!1}unbindFromCell(){const t=this._rootElement;this._menuInstanceInfo=void 0,(null==t?void 0:t.parentElement)&&(t.classList.remove(pL),t.classList.add(gL))}_canBindToCell(t,e,i){const o=t.getCellRangeRelativeRect({col:e,row:i}),n=t.getElement(),{top:r,bottom:s,left:l,right:a}=o;if(t.isFrozenCell(e,i))return!0;if(s<t.getFrozenRowsHeight()||a<t.getFrozenColsWidth()||l>t.tableNoFrameWidth-t.getRightFrozenColsWidth()||r>t.tableNoFrameHeight-t.getBottomFrozenRowsHeight())return!1;const{offsetHeight:h,offsetWidth:d}=n;return!(h<r||d<l)}_bindCell(t,e,i,o,n){const r=this._rootElement,s=t.getElement(),{width:l,height:a}=t.internalProps.element.getBoundingClientRect();if(r){r.parentElement!==s&&s.appendChild(r),r.style.left="0px";const t=.8*l;r.style.maxWidth=`${t}px`;const e=r.clientWidth,i=r.clientHeight;let h,d;return o&&(h=o.x,d=o.y),n&&(h=n.rect.right-e,d=n.rect.bottom),d+i>a&&(d=a-i,h+=e-2),d<0&&(d/=2),r.style.top=`${d}px`,h<0?h=0:h+e>l&&(h=l-e),r.style.left=`${h}px`,!0}return!1}pointInMenuElement(t,e){const i=this._rootElement,{x:o,y:n,width:r,height:s}=i.getBoundingClientRect();return t>o-5&&t<o+r+5&&e>n-5&&e<n+s+5}}class vL extends cL{createMenuElementInternal(){return new yT(this._table)}}let mL=class extends cL{createMenuElementInternal(){return new fL(this._table)}};const bL={"dropdown-menu":function(t){return new vL(t)},"context-menu":function(t){return new vL(t)},container:t=>new mL(t)};class yL{constructor(t){this._table=t,this._menuInstances={},this._bindTableEvent(t)}release(){const t=this._menuInstances;for(const e in t)t[e].release();delete this._menuInstances,this._attachInfo=null}_bindToCell(t,e,i,o){var n;const r=this._attachInfo,s=this._getMenuInstanceInfo(t,e,i,o);if(!r||s&&r.instance===s.instance||(null===(n=r.instance)||void 0===n||n.unbindMenuElement(),this._attachInfo=null),!s)return;const{instance:l,info:a}=s;if(l&&l.bindMenuElement(t,e,a)){const i=this._table.getCellRange(t,e);this._attachInfo={range:i,instance:l}}}_unbindFromCell(){const t=this._attachInfo;if(!t)return;const{instance:e}=t;null==e||e.unbindMenuElement(),this._attachInfo=null}_isBindToCell(t,e){const i=this._attachInfo;return!!i&&Ow(i.range,t,e)}pointInMenuElement(t,e){if(!this._attachInfo)return!1;const i=this._attachInfo,{instance:o}=i;return o.pointInMenuElement(t,e)}_bindTableEvent(t){t.on(Xw.DROPDOWN_ICON_CLICK,(t=>{this._attachInfo&&this._isBindToCell(t.col,t.row)?this._unbindFromCell():this._bindToCell(t.col,t.row,"dropdown-menu")})),t.on(Xw.DROPDOWN_MENU_CLEAR,(t=>{this._unbindFromCell()})),t.on(Xw.CONTEXTMENU_CELL,(e=>{var i,o,n,r;if("html"===(null===(i=t.internalProps.menu)||void 0===i?void 0:i.renderMode)){const i=t._getMouseAbstractPoint(e.event,!1);let s=null;i.inTable&&"function"==typeof(null===(o=t.internalProps.menu)||void 0===o?void 0:o.contextMenuItems)?s=t.internalProps.menu.contextMenuItems(t.getHeaderField(e.col,e.row),e.row,e.col,t):i.inTable&&Array.isArray(null===(n=t.internalProps.menu)||void 0===n?void 0:n.contextMenuItems)&&(s=null===(r=t.internalProps.menu)||void 0===r?void 0:r.contextMenuItems),this._bindToCell(e.col,e.row,"context-menu",{content:s,position:{x:i.x,y:i.y}})}}))}_getMenuInstanceInfo(t,e,i,o){const n=this._table,r=this._menuInstances,s=function(t,e,i,o,n){var r;const{lineHeight:s,textBaseline:l,textStick:a}=t._getCellStyle(e,i);let h=t.getCellRangeRelativeRect(t.getCellRange(e,i));a&&(h=t.getVisibleCellRangeRelativeRect({col:e,row:i}));let{left:d,right:c,bottom:u,top:g,width:p,height:f}=h;if(t.isHeader(e,i)&&({left:d,right:c,bottom:u,top:g,width:p,height:f}=t.internalProps.headerHelper.getDropDownIconRect(h,s,l||"middle")),null==n?void 0:n.content)return{type:o,position:n.position,referencePosition:null!==(r=n.referencePosition)&&void 0!==r?r:{rect:{left:d,right:c,top:g,bottom:u,width:p,height:f}},content:n.content};if("dropdown-menu"===o){const{dropDownMenu:n=t.globalDropDownMenu,pivotInfo:r}=t._getHeaderLayoutMap(e,i);return{type:o,referencePosition:{rect:{left:d,right:c,top:g,bottom:u,width:p,height:f}},content:n,pivotInfo:r}}return null}(n,t,e,i,o);return s?{instance:r&&r[i]||r&&(r[i]=bL[i](n)),type:i,info:s}:null}}class CL{constructor(t,e){this.isReleased=!1,this.table=e,this._titleOption=St({orient:"top"},t),!1!==t.visible&&(this._titleComponent=this._createOrUpdateTitleComponent(this._getTitleAttrs()))}_createOrUpdateTitleComponent(t){if(this._titleComponent)Rt(t,this._cacheAttrs)||this._titleComponent.setAttributes(t);else{const e=new Jy(t);e.name="title",this.table.scenegraph.stage.defaultLayer.appendChild(e),this._titleComponent=e}return this._adjustTableSize(this._titleComponent.attribute),this._titleComponent}resize(){var t,e,i,o,n;if(!this._titleComponent)return;const r=r_(null!==(t=this._titleOption.padding)&&void 0!==t?t:10),s=null!==(e=this._titleOption.width)&&void 0!==e?e:("adaptive"===this.table.widthMode?this.table.tableNoFrameWidth:Math.min(this.table.tableNoFrameWidth,this.table.getDrawRange().width))-r[1]-r[3],l=null!==(i=this._titleOption.height)&&void 0!==i?i:("adaptive"===this.table.heightMode?this.table.tableNoFrameHeight:Math.min(this.table.tableNoFrameHeight,this.table.getDrawRange().height))-r[0]-r[2];this._titleComponent.setAttributes({x:(null!==(o=this._titleOption.x)&&void 0!==o?o:"right"===this._titleOption.orient)?this.table.tableX+Math.min(this.table.tableNoFrameWidth,this.table.getDrawRange().width):this.table.tableX,y:(null!==(n=this._titleOption.y)&&void 0!==n?n:"bottom"===this._titleOption.orient)?this.table.tableY+this.table.tableNoFrameHeight:this.table.tableY,width:"top"===this._titleOption.orient||"bottom"===this._titleOption.orient?s:this._titleOption.width,height:"left"===this._titleOption.orient||"right"===this._titleOption.orient?l:this._titleOption.height,textStyle:Object.assign({width:s},this._titleOption.textStyle),subtextStyle:Object.assign({width:s},this._titleOption.subtextStyle)}),this._adjustTableSize(this._titleComponent.attribute)}_adjustTableSize(t){var e,i,o,n;const r=isFinite(null===(e=this._titleComponent)||void 0===e?void 0:e.AABBBounds.width())?this._titleComponent.AABBBounds.width():0,s=isFinite(null===(i=this._titleComponent)||void 0===i?void 0:i.AABBBounds.height())?this._titleComponent.AABBBounds.height():0;"left"===this._titleOption.orient?(this.table.tableNoFrameWidth=this.table.tableNoFrameWidth-Math.ceil(r),this.table.tableX+=Math.ceil(r)):"top"===this._titleOption.orient?(this.table.tableNoFrameHeight=this.table.tableNoFrameHeight-Math.ceil(s),this.table.tableY+=Math.ceil(s)):"right"===this._titleOption.orient?this.table.tableNoFrameWidth=this.table.tableNoFrameWidth-Math.ceil(r):"bottom"===this._titleOption.orient&&(this.table.tableNoFrameHeight=this.table.tableNoFrameHeight-Math.ceil(s)),this._cacheAttrs=t,"right"!==this._titleOption.orient&&"bottom"!==this._titleOption.orient||this._titleComponent.setAttributes({x:(null!==(o=this._titleOption.x)&&void 0!==o?o:"right"===this._titleOption.orient)?this.table.tableX+this.table.tableNoFrameWidth:this.table.tableX,y:(null!==(n=this._titleOption.y)&&void 0!==n?n:"bottom"===this._titleOption.orient)?this.table.tableY+this.table.tableNoFrameHeight:this.table.tableY})}release(){this._titleComponent&&this.table.scenegraph.stage.defaultLayer.removeChild(this._titleComponent),this._titleComponent=null,this.isReleased=!0}_getTitleAttrs(){var t,e,i,o,n,r,s,l,a,h,d;const c=this._titleOption.text||this._titleOption.subtext?10:0,u=r_(null!==(t=this._titleOption.padding)&&void 0!==t?t:c),g=null!==(e=this._titleOption.width)&&void 0!==e?e:Math.min(this.table.tableNoFrameWidth,this.table.getDrawRange().width)-u[1]-u[3],p=null!==(i=this._titleOption.height)&&void 0!==i?i:Math.min(this.table.tableNoFrameHeight,this.table.getDrawRange().height)-u[0]-u[2];return{text:null!==(o=this._titleOption.text)&&void 0!==o?o:"",subtext:null!==(n=this._titleOption.subtext)&&void 0!==n?n:"",x:(null!==(r=this._titleOption.x)&&void 0!==r?r:"right"===this._titleOption.orient)?this.table.tableX+Math.min(this.table.tableNoFrameWidth,this.table.getDrawRange().width):this.table.tableX,y:(null!==(s=this._titleOption.y)&&void 0!==s?s:"bottom"===this._titleOption.orient)?this.table.tableY+this.table.tableNoFrameHeight:this.table.tableY,width:"top"===this._titleOption.orient||"bottom"===this._titleOption.orient?g:this._titleOption.width,height:"left"===this._titleOption.orient||"right"===this._titleOption.orient?p:this._titleOption.height,minWidth:this._titleOption.minWidth,maxWidth:this._titleOption.maxWidth,minHeight:this._titleOption.minHeight,maxHeight:this._titleOption.maxHeight,padding:this._titleOption.padding,align:null!==(l=this._titleOption.align)&&void 0!==l?l:"left",verticalAlign:null!==(a=this._titleOption.verticalAlign)&&void 0!==a?a:"top",textStyle:Object.assign({width:g},this._titleOption.textStyle),subtextStyle:Object.assign({width:g},this._titleOption.subtextStyle),dx:null!==(h=this._titleOption.dx)&&void 0!==h?h:0,dy:null!==(d=this._titleOption.dy)&&void 0!==d?d:0}}}class wL{constructor(t){this._table=t}release(){var t,e;this.unbindTooltipElement(),this._tooltipElement&&(null===(e=(t=this._tooltipElement).release)||void 0===e||e.call(t)),this._tooltipElement=void 0}_getTooltipElement(){return this._tooltipElement||(this._tooltipElement=this.createTooltipElementInternal()),this._tooltipElement}bindTooltipElement(t,e,i,o){return this._getTooltipElement().bindToCell(this._table,t,e,i,o)}moveTooltipElement(t,e,i,o){this._getTooltipElement().move(this._table,t,e,i,o)}unbindTooltipElement(){this._getTooltipElement().unbindFromCell()}locateTooltipElement(t,e,i,o,n){this._getTooltipElement()._locate(this._table,t,e,i,o,n)}}!function(){if("node"===sw.mode)return;const t=document.createElement("style");t.id="vtable-tooltip-styleSheet",t.textContent="\n@keyframes vtable__bubble-tooltip-element--shown-animation {\n\t0% {\n\t\topacity: 0;\n\t}\n\t100% {\n\t\topacity: 1;\n\t}\n}\n.vtable__bubble-tooltip-element {\n\tposition: absolute;\n\t\n\t// pointer-events: none;\n\t//user-select: none;\n\tmax-width: 300px;\n\tz-index: 99999;\n\n\tbackground: #FFFFFF;\n border: 1px solid #E6E8ED;\n box-sizing: border-box;\n border-radius: 4px;\n box-shadow: 0px 2px 4px rgb(27 31 35 / 8%);\n color: #141414;\n font-size: 13px;\n}\n.vtable__bubble-tooltip-element--hidden {\n\topacity: 0;\n pointer-events: none;\n\tuser-select: none;\n\t/* transform: translate(-50%, -50%); */\n\ttransition: opacity 75ms linear;\n}\n.vtable__bubble-tooltip-element--shown {\n\topacity: 1;\n\t/* transform: translate(-50%, -50%); */\n\tanimation: vtable__bubble-tooltip-element--shown-animation 150ms ease-out;\n}\n.vtable__bubble-tooltip-element__content {\n\t/* font-size: .75rem; */\n\tpadding: 6px 8px;\n\tmin-height: 1em;\n\tline-height: 1.5;\n\twidth: 100%;\n\tdisplay: block;\n\twhite-space: pre-wrap;\n\tmargin: 0;\n\tbox-sizing: border-box;\n\toverflow: auto;\n\tword-wrap: break-word;\n\tposition: relative;\n\tbackground-color: #FFF;\n\tz-index: 2;\n\tborder-radius: 4px;\n}\n/* WebKit Microsoft Edge(新版): */\n.vtable__bubble-tooltip-element__content::-webkit-scrollbar {\n width: 0;\n height: 0;\n background-color: transparent;\n}\n/* Opera Firefox */\n.vtable__bubble-tooltip-element__content > scrollbar-track {\n width: 0;\n height: 0;\n background-color: transparent;\n}\n/* Internet Explorer 11 和 Microsoft Edge(旧版) */\n.vtable__bubble-tooltip-element__content > scrollbar {\n width: 0;\n height: 0;\n background-color: transparent;\n}\n.vtable__bubble-tooltip-element__triangle {\n\t/* font-size: .75rem; */\n\tposition: absolute;\n\twidth: 10px;\n\theight: 10px;\n\tdisplay: block;\n\ttransform: rotate(45deg);\n transform-origin: 50% 50% 0;\n\tz-index: 1;\n\tbackground-color: #FFF;\n\tborder: 1px solid #E6E8ED;\n}\n",document.head.appendChild(t)}();const xL="vtable__bubble-tooltip-element",_L=`${xL}__content`,SL=`${xL}__triangle`,AL=`${xL}--hidden`,BL=`${xL}--shown`;class RL{constructor(){this._handler=new Zw;const t=this._rootElement=oT("div",[xL,AL]),e=oT("div",[_L]),i=oT("span",[SL]);t.appendChild(i),t.appendChild(e),this._messageElement=t.querySelector(`.${_L}`)||void 0,this._triangleElement=t.querySelector(`.${SL}`)||void 0,t.addEventListener("mousemove",(()=>{this._disappearDelayId&&clearTimeout(this._disappearDelayId)})),t.addEventListener("mouseleave",(()=>{this._disappearDelay=void 0,this.unbindFromCell()})),e.addEventListener("wheel",(t=>{t.stopPropagation()})),e.addEventListener("copy",(t=>{(function(t){const e=window.getSelection();if(e.rangeCount){const i=e.getRangeAt(0);return i.endOffset>i.startOffset&&t.contains(i.commonAncestorContainer)}return!1})(e)&&t.stopPropagation()}))}bindToCell(t,e,i,o,n){var r,s,l,a,h,d,c,u,g,p,f,v,m,b,y,C,w,x,_;this._disappearDelay=null==o?void 0:o.disappearDelay,this._disappearDelayId&&clearTimeout(this._disappearDelayId);const S=this._rootElement,A=this._messageElement,B=this._triangleElement;if(null==S||S.classList.remove(BL),null==S||S.classList.add(AL),this._canBindToCell(t,e,i)){if(A.setAttribute("style",""),B.setAttribute("style",""),(null==o?void 0:o.className)&&S.classList.add(o.className),(null===(r=null==o?void 0:o.style)||void 0===r?void 0:r.bgColor)&&(A.style.backgroundColor=null===(s=null==o?void 0:o.style)||void 0===s?void 0:s.bgColor),(null===(l=null==o?void 0:o.style)||void 0===l?void 0:l.bgColor)&&(B.style.backgroundColor=null===(a=null==o?void 0:o.style)||void 0===a?void 0:a.bgColor),B.style.display=!0===(null===(h=null==o?void 0:o.style)||void 0===h?void 0:h.arrowMark)?"block":"none",(null===(d=null==o?void 0:o.style)||void 0===d?void 0:d.fontSize)&&(A.style.fontSize=(null!==(u=null===(c=null==o?void 0:o.style)||void 0===c?void 0:c.fontSize)&&void 0!==u?u:12)+"px"),(null===(g=null==o?void 0:o.style)||void 0===g?void 0:g.fontFamily)&&(A.style.fontFamily=null===(p=null==o?void 0:o.style)||void 0===p?void 0:p.fontFamily),(null===(f=null==o?void 0:o.style)||void 0===f?void 0:f.color)&&(A.style.color=null===(v=null==o?void 0:o.style)||void 0===v?void 0:v.color),(null===(m=null==o?void 0:o.style)||void 0===m?void 0:m.padding)&&(A.style.padding=`${null===(b=null==o?void 0:o.style)||void 0===b?void 0:b.padding.join("px ")}px`),(null===(y=null==o?void 0:o.style)||void 0===y?void 0:y.maxHeight)&&(A.style.maxHeight=`${null===(C=null==o?void 0:o.style)||void 0===C?void 0:C.maxHeight}px`),(null===(w=null==o?void 0:o.style)||void 0===w?void 0:w.maxWidth)&&(A.style.maxWidth=`${null===(x=null==o?void 0:o.style)||void 0===x?void 0:x.maxWidth}px`),A&&(A.textContent=null==o?void 0:o.content),this._bindToCell(t,e,i,null==o?void 0:o.position,null==o?void 0:o.referencePosition,n,null===(_=null==o?void 0:o.style)||void 0===_?void 0:_.arrowMark))return null==S||S.classList.add(BL),null==S||S.classList.remove(AL),!0}else this.unbindFromCell();return!1}release(){var t,e;this.unbindFromCell();const i=this._rootElement;(null==i?void 0:i.parentElement)&&i.parentElement.removeChild(i),null===(e=null===(t=this._handler)||void 0===t?void 0:t.release)||void 0===e||e.call(t),delete this._rootElement,delete this._messageElement}move(t,e,i,o,n){const r=this._rootElement;this._canBindToCell(t,e,i)?(this._bindToCell(t,e,i,null==o?void 0:o.position,null==o?void 0:o.referencePosition,n),null==r||r.classList.add(BL),null==r||r.classList.remove(AL)):this.unbindFromCell()}unbindFromCell(){var t;if(this._disappearDelay)this._disappearDelayId=setTimeout((()=>{const t=this._rootElement;(null==t?void 0:t.parentElement)&&(t.classList.remove(BL),t.classList.add(AL))}),null!==(t=this._disappearDelay)&&void 0!==t?t:0);else{const t=this._rootElement;(null==t?void 0:t.parentElement)&&(t.classList.remove(BL),t.classList.add(AL))}}_canBindToCell(t,e,i){const o=t.getCellRangeRelativeRect({col:e,row:i}),n=t.getElement(),{bottom:r,left:s,right:l,top:a}=o;if(t.isFrozenCell(e,i))return!0;if(r<t.getFrozenRowsHeight()||l<t.getFrozenColsWidth()||s>t.tableNoFrameWidth-t.getRightFrozenColsWidth()||a>t.tableNoFrameHeight-t.getBottomFrozenRowsHeight())return!1;const{offsetHeight:h,offsetWidth:d}=n;return!(a>h||s>d)}_bindToCell(t,e,i,o,n,r,s){const l=this._rootElement,a=t.getCellRangeRelativeRect({col:e,row:i}),h=t.internalProps.tooltip.parentElement,d=t.internalProps.element.offsetWidth,{width:c}=a;if(l){let a,u;l.parentElement!==h&&h.appendChild(l),l.style.left="0px";const g=Math.min(.8*d,4*c);l.style.maxWidth=`${g}px`;const p=l.clientWidth,f=l.clientHeight;if(!o&&!n)return!1;{const l=this.getComputedPosition(t,e,i,o,n,r,s);u=l.x,a=l.y}l.style.left=`${u}px`,l.style.top=`${a}px`,bw()&&(l.style.fontSize="11px");const{x1:v,x2:m,y1:b,y2:y}=t.stateManager.menu.bounds,C=u,w=C+p,x=a,_=C+f;return!(t.stateManager.menu.isShow&&v<w&&m>C&&y>x&&b<_)}return!1}getComputedPosition(t,e,i,o,n,r,s){var l;const a=this._rootElement,h=t.getCellRangeRelativeRect({col:e,row:i}),{x:d,y:c}=t.internalProps.tooltip.parentElement.getBoundingClientRect(),{width:u,height:g,x:p,y:f}=t.internalProps.element.getBoundingClientRect(),{width:v}=h;let m,b;const y=Math.min(.8*u,4*v);a.style.maxWidth=`${y}px`;const C=a.clientWidth,w=a.clientHeight,x=s?6:0;if(o)b=o.x,m=o.y+x,this._triangleElement.style.left="50%",this._triangleElement.style.marginLeft="-5px",this._triangleElement.style.top="-5px";else if(n){let t=null!==(l=n.placement)&&void 0!==l?l:DC.bottom;const e=n.rect.left+n.rect.width/2,i=n.rect.top+n.rect.height/2,o=n.rect.top,s=n.rect.bottom,a=n.rect.left,h=n.rect.right;let d=0;const c=()=>{d++,d>=4||(this.removeStyleFromTriangle(),t===DC.top?(b=e-C/2,m=o-w-x,this._triangleElement.style.left="50%",this._triangleElement.style.marginLeft="-5px",this._triangleElement.style.bottom="-5px",r&&m<0&&(t=DC.right,c())):t===DC.bottom?(b=e-C/2,m=s+x,this._triangleElement.style.left="50%",this._triangleElement.style.marginLeft="-5px",this._triangleElement.style.top="-5px",r&&m+w>g&&(t=DC.left,c())):t===DC.left?(m=i-w/2,b=a-C-x,this._triangleElement.style.top="50%",this._triangleElement.style.marginTop="-5px",this._triangleElement.style.right="-5px",r&&b<0&&(t=DC.top,c())):t===DC.right&&(m=i-w/2,b=h+x,this._triangleElement.style.top="50%",this._triangleElement.style.marginTop="-5px",this._triangleElement.style.left="-5px",r&&b+C>u&&(t=DC.bottom,c())))};c()}return r&&(b<0?b=0:b+a.offsetWidth>u&&(b=u-a.offsetWidth)),{x:b+p-d,y:m+f-c}}removeStyleFromTriangle(){this._triangleElement.style.left="",this._triangleElement.style.right="",this._triangleElement.style.top="",this._triangleElement.style.bottom="",this._triangleElement.style.marginLeft="",this._triangleElement.style.marginTop=""}_locate(t,e,i,o,n,r){const s=this.getComputedPosition(t,e,i,o,n,r),l=s.x,a=s.y;this._rootElement.style.left=`${l}px`,this._rootElement.style.top=`${a}px`}}class ML extends wL{createTooltipElementInternal(){return new RL}}const TL=function(t){return new ML(t)};class kL{constructor(t,e){this._table=t,this._tooltipInstances={},this._bindTableEvent(t),this.confine=e}release(){var t,e;const i=this._tooltipInstances;for(const o in i)null===(e=null===(t=i[o])||void 0===t?void 0:t.release)||void 0===e||e.call(t);delete this._tooltipInstances,this._attachInfo=null}_bindToCell(t,e,i){var o;const n=this._attachInfo,r=this._getTooltipInstanceInfo(t,e);if(!n||r&&n.instance===r||(null===(o=n.instance)||void 0===o||o.unbindTooltipElement(),this._attachInfo=null),r&&r&&r.bindTooltipElement(t,e,i,this.confine)){const o=this._table.getCellRange(t,e);this._attachInfo={range:o,instance:r,tooltipOptions:i}}}_move(t,e,i){const o=this._attachInfo;if(!o||!Ow(o.range,t,e))return;const{instance:n}=o;null==n||n.moveTooltipElement(t,e,i,this.confine)}moveToPosition(t,e,i,o){const n=this._attachInfo;if(!n||!Ow(n.range,t,e))return;const{instance:r}=n;this._attachInfo.tooltipOptions.position=i,this._attachInfo.tooltipOptions.referencePosition=o,null==r||r.locateTooltipElement(t,e,i,o,this.confine)}_unbindFromCell(){const t=this._attachInfo;if(!t)return;const{instance:e}=t;null==e||e.unbindTooltipElement(),this._attachInfo=null}_isBindCell(t,e){const i=this._attachInfo;return!!i&&Ow(i.range,t,e)}_bindTableEvent(t){t.on(Xw.MOUSEENTER_CELL,(e=>{if(bw())return;const{x1:i,x2:o,y1:n,y2:r}=t.stateManager.menu.bounds;if(t.stateManager.menu.isShow&&"number"==typeof e.x&&"number"==typeof e.y&&e.x>i&&e.x<o&&e.y>n&&e.y<r)return;const{col:s,row:l}=e;this.showTooltip(s,l)})),t.on(Xw.MOUSEMOVE_CELL,(e=>{var i,o;if(!bw()){if(null===(o=null===(i=this._attachInfo)||void 0===i?void 0:i.tooltipOptions)||void 0===o?void 0:o.referencePosition){const i=this._attachInfo.tooltipOptions.referencePosition,{event:o}=e,{left:n,right:r,top:s,bottom:l}=i.rect,a=t._getMouseAbstractPoint(o,!1);a.inTable&&a.x>=n-5&&a.x<=r+5&&a.y>=s-5&&a.y<=l+5||this._unbindFromCell()}this._attachInfo&&t.stateManager.menu.isShow&&this._bindToCell(e.col,e.row)}})),t.on(Xw.MOUSELEAVE_CELL,(t=>{this._unbindFromCell()})),t.on(Xw.SELECTED_CELL,(t=>{this._isBindCell(t.col,t.row)&&this._unbindFromCell()})),t.on(Xw.MOUSELEAVE_TABLE,(t=>{this._unbindFromCell()})),t.on(Xw.SCROLL,(t=>{this._unbindFromCell()}))}showTooltip(t,e){var i,o,n;let r;const s=this._table,l=s.getHeaderDescription(t,e);if(l){const o=s.getCellRangeRelativeRect({col:t,row:e});r={content:l,referencePosition:{placement:DC.bottom,rect:o},disappearDelay:null!==(i=s.internalProps.tooltip.overflowTextTooltipDisappearDelay)&&void 0!==i?i:0,style:s.theme.tooltipStyle}}else if(null===(o=s.internalProps.tooltip)||void 0===o?void 0:o.isShowOverflowTextTooltip){const i=s.getCellOverflowText(t,e),o=s.getCellRangeRelativeRect({col:t,row:e});i&&(r={content:l?`${l}\n ${i}`:i,referencePosition:{placement:DC.bottom,rect:o},disappearDelay:null!==(n=s.internalProps.tooltip.overflowTextTooltipDisappearDelay)&&void 0!==n?n:0,style:s.theme.tooltipStyle})}r?this._bindToCell(t,e,r):this._unbindFromCell()}_getTooltipInstanceInfo(t,e){const i=this._table,o=this._tooltipInstances;return o&&o["bubble-tooltip"]||o&&(o["bubble-tooltip"]=TL(i))}isBinded(t){var e;return JSON.stringify(t)===JSON.stringify(null===(e=this._attachInfo)||void 0===e?void 0:e.tooltipOptions)}}class LL{constructor(t){this.titleRows=[],this.showedTitleRows=[],this.rowNow=-1,this.skipStartRow=-1,this.skipEndRow=-1,this.table=t,this.table.on("scroll",(t=>{"vertical"===t.scrollDirection&&this.updateGroupTitle()})),this.table.on("resize_column",(t=>{this.updateGroupTitle()}))}updateGroupTitle(){0===this.table.scrollTop?(this.titleRows=[],this.showedTitleRows=[]):-1!==this.skipStartRow&&-1!==this.skipEndRow&&this.skipStartRow!==this.table.scenegraph.proxy.bodyTopRow-1?(this.table.scenegraph.proxy.screenTopRow<=this.skipStartRow||this.table.scenegraph.proxy.screenTopRow>=this.skipEndRow)&&(this.skipStartRow=-1,this.skipEndRow=-1,this.updateGroupTitleInfo()):(this.skipStartRow=-1,this.skipEndRow=-1,this.updateGroupTitleInfo()),this.updateScenegraph()}updateGroupTitleInfo(){this.rowNow=this.table.scenegraph.proxy.screenTopRow+this.titleRows.length;const t=this.table.getRecordIndexByCell(0,this.rowNow),e=this.table.getRecordIndexByCell(0,this.rowNow+1);this.getTitleRowsByRecordIndex(t,e)}getTitleRowsByRecordIndex(t,e){rt(t)||(t=[t]),rt(e)||(e=[e]);for(let e=0;e<t.length;e++){const i=t.slice(0,e+1);this.table.dataSource.getRaw(i)}const i=[],o=e.length===t.length+1;let n=t.slice(0,o?t.length:t.length-1);const r=this.table.dataSource.currentIndexedData;for(let e=this.rowNow-this.table.columnHeaderLevelCount;e>=0;e--){const o=r[e];if(rt(o)&&n.length===o.length){let t=!0;for(let e=0;e<o.length;e++)if(o[e]!==n[e]){t=!1;break}t&&(i.push(e+this.table.columnHeaderLevelCount),n=n.slice(0,n.length-1))}else if(o===t[0]){i.push(e+this.table.columnHeaderLevelCount);break}}this.titleRows=i.reverse()}updateScenegraph(){const{table:t}=this,{shadowGroup:e,shadowGroupFrozen:i}=function(t){const e=t.scenegraph.colHeaderGroup,i=t.scenegraph.cornerHeaderGroup;if(!e.border){const i=sc({x:0,y:0,width:0,height:0,cursor:"pointer"});e.add(i),e.border=i,i.attachShadow(i.shadowRoot),i.name="border-rect",i.addEventListener("click",(e=>{const i=t.listTreeStickCellPlugin.titleRows,{shadowTarget:o}=e.pickParams,n=K_(o),{col:r,row:s}=n;HL(s-i.indexOf(s),t)}))}if(!i.border){const e=sc({x:0,y:0,width:0,height:0,cursor:"pointer"});i.add(e),i.border=e,e.attachShadow(e.shadowRoot),e.name="border-rect",e.addEventListener("click",(e=>{const i=t.listTreeStickCellPlugin.titleRows,{shadowTarget:o}=e.pickParams,n=K_(o),{col:r,row:s}=n;HL(s-i.indexOf(s),t)}))}const o=e.border.shadowRoot,n=i.border.shadowRoot;return o.removeAllChild(),n.removeAllChild(),{shadowGroup:o,shadowGroupFrozen:n}}(t);this.showedTitleRows.length=0;let o=0;for(let n=0;n<t.colCount;n++){let r;n<t.frozenColCount?(r=new zS({x:t.getColsWidth(0,n-1),y:t.getFrozenRowsHeight()}),i.add(r)):(r=new zS({x:t.getColsWidth(t.frozenColCount,n-1),y:t.getFrozenRowsHeight()}),e.add(r)),r.col=n;for(let e=0;e<this.titleRows.length;e++){const i=this.titleRows[e];if(PL(i,this.rowNow,t.scenegraph.proxy.screenTopRow,this.titleRows)){0===n&&o++;continue}0===n&&this.showedTitleRows.push(i);const s=t.scenegraph.getCell(n,i);if("cell"===s.role){const t=EL(s);t.setAttributes({y:40*e}),r.add(t)}else{const o=sA(n,i,t,!0,!0);o.setAttributes({y:40*e}),r.add(o)}}}o>0&&-1===this.skipStartRow&&-1===this.skipEndRow&&(this.skipStartRow=t.scenegraph.proxy.screenTopRow-1,this.skipEndRow=t.scenegraph.proxy.screenTopRow+1)}}function PL(t,e,i,o){return t===e&&t!==i+o.length-1||t===i+o.indexOf(t)+1&&t<e}function EL(t){const e=t.clone();if(e.role=t.role,e.col=t.col,e.row=t.row,e.mergeStartCol=t.mergeStartCol,e.mergeStartRow=t.mergeStartRow,e.mergeEndCol=t.mergeEndCol,e.mergeEndRow=t.mergeEndRow,e.contentWidth=t.contentWidth,e.contentHeight=t.contentHeight,"cell"===e.role){const t=sc({x:0,y:0,width:e.attribute.width,height:e.attribute.height});e.add(t)}if("group"===t.type){const i=e;t.forEachChildren((t=>{const e=EL(t);i.add(e)}))}return e}function HL(t,e){const i=e.getDrawRange();if(Q(t)&&t>=e.frozenRowCount){const o=e.getFrozenRowsHeight(),n=e.getRowsHeight(0,t-1);e.scrollTop=Math.min(n-o,e.getAllRowsHeight()-i.height)-1}e.scenegraph.updateNextFrame()}const FL={};function zL(t,e,i,o,n,r,s,l,a,h,d,c,u,g,p,f,v,m){var b,y,C,w,x,_,S,A,B,R,M,T,k,L,P,E,H,F,z,I,O,D,W,N,G;const j=Lw(FL,gk)[d],V=WS("padding",p._getCellStyle(n,r),n,r,p);if(Q(V)&&(a=V),!t){const a=NS(n,r,f,p);m&&(t=p.scenegraph.highPerformanceGetCell(n,r,!0))&&"cell"===t.role&&t.setAttributes({x:i,y:o,width:s,height:l,lineWidth:null!==(y=null===(b=null==f?void 0:f.group)||void 0===b?void 0:b.lineWidth)&&void 0!==y?y:void 0,fill:null!==(w=null===(C=null==f?void 0:f.group)||void 0===C?void 0:C.fill)&&void 0!==w?w:void 0,stroke:null!==(_=null===(x=null==f?void 0:f.group)||void 0===x?void 0:x.stroke)&&void 0!==_?_:void 0,strokeArrayWidth:a,strokeArrayColor:null!==(A=null===(S=null==f?void 0:f.group)||void 0===S?void 0:S.strokeArrayColor)&&void 0!==A?A:void 0,cursor:null!==(R=null===(B=null==f?void 0:f.group)||void 0===B?void 0:B.cursor)&&void 0!==R?R:void 0,lineDash:null!==(T=null===(M=null==f?void 0:f.group)||void 0===M?void 0:M.lineDash)&&void 0!==T?T:void 0,lineCap:"butt",clip:!0,cornerRadius:f.group.cornerRadius}),t&&"cell"===t.role||((t=new zS({x:i,y:o,width:s,height:l,lineWidth:null!==(L=null===(k=null==f?void 0:f.group)||void 0===k?void 0:k.lineWidth)&&void 0!==L?L:void 0,fill:null!==(E=null===(P=null==f?void 0:f.group)||void 0===P?void 0:P.fill)&&void 0!==E?E:void 0,stroke:null!==(F=null===(H=null==f?void 0:f.group)||void 0===H?void 0:H.stroke)&&void 0!==F?F:void 0,strokeArrayWidth:a,strokeArrayColor:null!==(I=null===(z=null==f?void 0:f.group)||void 0===z?void 0:z.strokeArrayColor)&&void 0!==I?I:void 0,cursor:null!==(D=null===(O=null==f?void 0:f.group)||void 0===O?void 0:O.cursor)&&void 0!==D?D:void 0,lineDash:null!==(N=null===(W=null==f?void 0:f.group)||void 0===W?void 0:W.lineDash)&&void 0!==N?N:void 0,lineCap:"butt",clip:!0,cornerRadius:f.group.cornerRadius})).role="cell",t.col=n,t.row=r,null==e||e.addCellGroup(t))}t.AABBBounds.width();const U=new cB(v,{stroke:!1,x:a[3],y:a[0],canvas:null!==(G=p.canvas)&&void 0!==G?G:p.scenegraph.stage.window.getContext().canvas,mode:p.options.mode,modeParams:p.options.modeParams,spec:c,ClassType:j,width:s-a[3]-a[1],height:l-a[2]-a[0],chartInstance:u,dataId:g,data:p.getCellValue(n,r),cellPadding:a,dpr:p.internalProps.pixelRatio,axes:p.isPivotChart()?p.internalProps.layoutMap.getChartAxes(n,r):[],tableChartOption:p.options.chartOption});return t.appendChild(U),p.internalProps.layoutMap.setChartInstance(n,r,U.chartInstance),t}function IL(t,e,i,o,n,r,s,l,a,h,d,c,u,g,p,f,v,m){var b,y,C,w,x,_,S,A,B,R,M,T,k,L,P,E,H,F,z,I,O,D,W,N;if(!t){const s=NS(n,r,p,g);m&&(t=g.scenegraph.highPerformanceGetCell(n,r,!0))&&"cell"===t.role&&t.setAttributes({x:i,y:o,width:l,height:a,lineWidth:null!==(y=null===(b=null==p?void 0:p.group)||void 0===b?void 0:b.lineWidth)&&void 0!==y?y:void 0,fill:null!==(w=null===(C=null==p?void 0:p.group)||void 0===C?void 0:C.fill)&&void 0!==w?w:void 0,stroke:null!==(_=null===(x=null==p?void 0:p.group)||void 0===x?void 0:x.stroke)&&void 0!==_?_:void 0,strokeArrayWidth:s,strokeArrayColor:null!==(A=null===(S=null==p?void 0:p.group)||void 0===S?void 0:S.strokeArrayColor)&&void 0!==A?A:void 0,cursor:null!==(R=null===(B=null==p?void 0:p.group)||void 0===B?void 0:B.cursor)&&void 0!==R?R:void 0,lineDash:null!==(T=null===(M=null==p?void 0:p.group)||void 0===M?void 0:M.lineDash)&&void 0!==T?T:void 0,lineCap:"butt",clip:!0,cornerRadius:p.group.cornerRadius}),t&&"cell"===t.role||((t=new zS({x:i,y:o,width:l,height:a,lineWidth:null!==(L=null===(k=null==p?void 0:p.group)||void 0===k?void 0:k.lineWidth)&&void 0!==L?L:void 0,fill:null!==(E=null===(P=null==p?void 0:p.group)||void 0===P?void 0:P.fill)&&void 0!==E?E:void 0,stroke:null!==(F=null===(H=null==p?void 0:p.group)||void 0===H?void 0:H.stroke)&&void 0!==F?F:void 0,strokeArrayWidth:s,strokeArrayColor:null!==(I=null===(z=null==p?void 0:p.group)||void 0===z?void 0:z.strokeArrayColor)&&void 0!==I?I:void 0,cursor:null!==(D=null===(O=null==p?void 0:p.group)||void 0===O?void 0:O.cursor)&&void 0!==D?D:void 0,lineDash:null!==(N=null===(W=null==p?void 0:p.group)||void 0===W?void 0:W.lineDash)&&void 0!==N?N:void 0,lineCap:"butt",clip:!0,cornerRadius:p.group.cornerRadius})).role="cell",t.col=n,t.row=r,null==e||e.addCellGroup(t))}let G;if(u){let t=n,e=r;v&&(t=v.start.col,e=v.start.row),G=g.getCellIcons(t,e)}let j=0,V=0;if(Array.isArray(G)&&0!==G.length){const{leftIconWidth:e,rightIconWidth:i,absoluteLeftIconWidth:o,absoluteRightIconWidth:n}=KS(G,t,v,g);j=e+i,V=e,t.forEachChildren((t=>{"icon-left"===t.role?t.setAttribute("x",t.attribute.x+h[3]):"icon-right"===t.role?t.setAttribute("x",t.attribute.x+l-i-h[1]):"icon-absolute-right"===t.role&&t.setAttribute("x",t.attribute.x+l-n-h[1])})),t.forEachChildren((t=>{"middle"===c?t.setAttribute("y",(a-t.AABBBounds.height())/2):"bottom"===c?t.setAttribute("y",a-t.AABBBounds.height()-h[2]):t.setAttribute("y",h[0])}))}const U=function(t,e,i,o,n,r,s,l,a){var h,d,c,u;const g=a._getCellStyle(t,e),p=DS("size",g,t,e,a),f=DS("spaceBetweenTextAndIcon",g,t,e,a),v=DS("defaultFill",g,t,e,a),m=DS("defaultStroke",g,t,e,a),b=DS("disableFill",g,t,e,a),y=DS("checkedFill",g,t,e,a),C=DS("checkedStroke",g,t,e,a),w=DS("disableCheckedFill",g,t,e,a),x=DS("disableCheckedStroke",g,t,e,a),_=DS("checkIconImage",g,t,e,a),S=DS("indeterminateIconImage",g,t,e,a),A=a.getCellValue(t,e),B=a.getCellOriginValue(t,e);let R,M,T=null!==(h=A)&&void 0!==h?h:"";tt(A)?(R=A.checked,M=A.disable,T=null!==(d=A.text)&&void 0!==d?d:""):"boolean"==typeof A&&(R=A,T=""),R=a.stateManager.syncCheckedState(t,e,l.field,R);const k=jS(t,e,a),L=a._getCellStyle(t,e),P=null!==(c=L.autoWrapText)&&void 0!==c?c:a.internalProps.autoWrapText,{lineClamp:E}=L,{checked:H,disable:F}=l;if(null==R||"function"==typeof R){const i=Hw(H,{col:t,row:e,table:a,context:null,value:A,dataValue:B});R=a.stateManager.syncCheckedState(t,e,l.field,i)}const z=Hw(F,{col:t,row:e,table:a,context:null,value:A,dataValue:B}),I="auto"===i,O=a.isAutoRowHeight(e),D={text:1===T.length?T[0]:T,maxLineWidth:I?1/0:o-(r[1]+r[3]+k)-p-f,textBaseline:"top",autoWrapText:P,lineClamp:E,wordBreak:"break-word",heightLimit:O?-1:n-Math.floor(r[0]+r[2]),pickable:!1,dx:k,whiteSpace:1!==T.length||P?"normal":"no-wrap"},W={x:0,y:0,text:s.text?Object.assign({},s.text,D):D,icon:{width:Math.floor(p/1.4),height:Math.floor(p/1.4)},box:{width:p,height:p},spaceBetweenTextAndIcon:f,disabled:null!==(u=null!=M?M:z)&&void 0!==u&&u};"indeterminate"===R?(W.checked=void 0,W.indeterminate=!0):(W.checked=R,W.indeterminate=void 0),v&&(W.box.fill=v),m&&(W.box.stroke=m),b&&(W.box.disableFill=b),y&&(W.box.checkedFill=y),C&&(W.box.checkedStroke=C),w&&(W.box.disableCheckedFill=w),x&&(W.box.disableCheckedStroke=x),_&&(W.icon.checkIconImage=_),S&&(W.icon.indeterminateIconImage=S);const N=new Qy(W);return N.name="checkbox",N}(n,r,s-j,l,a,h,p,f,g);return U&&t.appendChild(U),U.render(),l-=h[1]+h[3]+j,a-=h[0]+h[2],"center"===d?U.setAttribute("x",h[3]+V+(l-U.AABBBounds.width())/2):"right"===d?U.setAttribute("x",h[3]+V+l-U.AABBBounds.width()):U.setAttribute("x",h[3]+V),"middle"===c?U.setAttribute("y",h[0]+(a-U.AABBBounds.height())/2):"bottom"===c?U.setAttribute("y",h[0]+a-U.AABBBounds.height()):U.setAttribute("y",h[0]),t}function OL(t,e,i,o,n,r,s,l,a,h,d,c,u,g,p){var f,v,m,b,y,C,w,x,_,S,A,B;if(!t){const s=NS(n,r,g,u);(t=new zS({x:i,y:o,width:l,height:a,lineWidth:null!==(v=null===(f=null==g?void 0:g.group)||void 0===f?void 0:f.lineWidth)&&void 0!==v?v:void 0,fill:null!==(b=null===(m=null==g?void 0:g.group)||void 0===m?void 0:m.fill)&&void 0!==b?b:void 0,stroke:null!==(C=null===(y=null==g?void 0:g.group)||void 0===y?void 0:y.stroke)&&void 0!==C?C:void 0,strokeArrayWidth:s,strokeArrayColor:null!==(x=null===(w=null==g?void 0:g.group)||void 0===w?void 0:w.strokeArrayColor)&&void 0!==x?x:void 0,cursor:null!==(S=null===(_=null==g?void 0:g.group)||void 0===_?void 0:_.cursor)&&void 0!==S?S:void 0,lineDash:null!==(B=null===(A=null==g?void 0:g.group)||void 0===A?void 0:A.lineDash)&&void 0!==B?B:void 0,lineCap:"butt",clip:!0,cornerRadius:g.group.cornerRadius})).role="cell",t.col=n,t.row=r,null==e||e.addCellGroup(t)}const{width:R,height:M}=function(t,e,i,o,n,r,s,l,a,h){var d,c;const u=h._getCellStyle(t,e);let g=DS("size",u,t,e,h),p=DS("innerRadius",u,t,e,h),f=DS("outerRadius",u,t,e,h);const v=DS("spaceBetweenTextAndIcon",u,t,e,h),m=DS("spaceBetweenRadio",u,t,e,h),b=DS("defaultFill",u,t,e,h),y=DS("defaultStroke",u,t,e,h),C=DS("disableFill",u,t,e,h),w=DS("checkedFill",u,t,e,h),x=DS("checkedStroke",u,t,e,h),_=DS("disableCheckedFill",u,t,e,h),S=DS("disableCheckedStroke",u,t,e,h);at(f)?g=2*f:f=Math.round(g/2),(!at(p)||p<0)&&(p=Math.round(f/7*3));const A=h.getCellValue(t,e),B=h.getCellOriginValue(t,e),R=jS(t,e,h),M=h._getCellStyle(t,e),T=null!==(d=M.autoWrapText)&&void 0!==d?d:h.internalProps.autoWrapText,{lineClamp:k}=M,L="auto"===i,P="autoHeight"===h.heightMode,E={maxLineWidth:L?1/0:o-(r[1]+r[3]+R)-g-v,textBaseline:"top",autoWrapText:T,lineClamp:k,wordBreak:"break-word",heightLimit:P?-1:n-Math.floor(r[0]+r[2]),pickable:!1,dx:R},H={x:0,y:0,text:s.text?Object.assign({},s.text,E):E,circle:{innerRadius:p,outerRadius:f},spaceBetweenTextAndIcon:v};b&&(H.circle.fill=b),y&&(H.circle.stroke=y),C&&(H.circle.disableFill=C),w&&(H.circle.checkedFill=w),x&&(H.circle.checkedStroke=x),_&&(H.circle.disableCheckedFill=_),S&&(H.circle.disableCheckedStroke=S);let F=0,z=0;const I=null!==(c=l.radioDirectionInCell)&&void 0!==c?c:"vertical";if(rt(A))A.forEach(((i,o)=>{const n=DL(i,B,o,t,e,l,T,H,h);n&&a.appendChild(n),n.id=`radio-${t}-${e}-${o}`,n.render();const r=n.AABBBounds;"vertical"===I?(n.setAttribute("y",z),z+=r.height()+(o!==A.length-1?m:0),F=Math.max(F,r.width())):"horizontal"===I&&(n.setAttribute("x",F),F+=r.width()+(o!==A.length-1?m:0),z=Math.max(z,r.height()))}));else{const i=DL(A,B,void 0,t,e,l,T,H,h);i&&a.appendChild(i),i.id=`radio-${t}-${e}`,i.render();const o=i.AABBBounds;F=o.width(),z=o.height()}return{width:F,height:z}}(n,r,s,l,a,h,g,p,t,u);return l-=h[1]+h[3],a-=h[0]+h[2],t.forEachChildren((t=>{"center"===d?t.setAttribute("x",h[3]+t.attribute.x+(l-R)/2):"right"===d?t.setAttribute("x",h[3]+t.attribute.x+l-R):t.setAttribute("x",h[3]+t.attribute.x),"middle"===c?t.setAttribute("y",h[0]+t.attribute.y+(a-M)/2):"bottom"===c?t.setAttribute("y",h[0]+t.attribute.y+a-M):t.setAttribute("y",h[0]+t.attribute.y)})),t}function DL(t,e,i,o,n,r,s,l,a){const h=function(t,e,i,o,n,r,s){var l,a;const h=null!==(l=r.radioCheckType)&&void 0!==l?l:"column";let d,c;return tt(t)?d=t.checked:"boolean"==typeof t&&(d=t),d=s.stateManager.syncRadioState(o,n,r.field,h,i,d),null!=d&&"function"!=typeof d||(c=Hw(r.checked,{col:o,row:n,table:s,context:null,value:t,dataValue:e}),d=s.stateManager.syncRadioState(o,n,r.field,h,i,c)),null!==(a=null!=d?d:c)&&void 0!==a&&a}(t,e,i,o,n,r,a),d=function(t,e,i,o,n,r){var s;let l;tt(t)&&(l=t.disable);const a=Hw(n.disable,{col:i,row:o,table:r,context:null,value:t,dataValue:e});return null!==(s=null!=l?l:a)&&void 0!==s&&s}(t,e,o,n,r,a),c=tt(t)?t.text:q(t)?"":null!=t?t:"",u=St({},l,{checked:h,disabled:d,text:{text:1===c.length?c[0]:c,whiteSpace:1!==c.length||s?"normal":"no-wrap"},boundsPadding:0}),g=new tC(u);return g.name="radio",g}const WL=new class extends Xb{constructor(t){super(!1),this.type=Bb.Point,this._padding=0,this.paddingInner(1,t),this.padding=this.paddingOuter,this.paddingInner=void 0,this.paddingOuter=void 0}},NL=new py;function GL(t,e,i,o,n,r,s,l,a,h,d,c){var u,g,p,f,v,m,b,y,C,w,x,_,S,A,B,R,M,T,k,L,P,E,H,F;if(!t){const a=NS(n,r,d,h);c&&(t=h.scenegraph.highPerformanceGetCell(n,r,!0))&&"cell"===t.role&&t.setAttributes({x:i,y:o,width:s,height:l,lineWidth:null!==(g=null===(u=null==d?void 0:d.group)||void 0===u?void 0:u.lineWidth)&&void 0!==g?g:void 0,fill:null!==(f=null===(p=null==d?void 0:d.group)||void 0===p?void 0:p.fill)&&void 0!==f?f:void 0,stroke:null!==(m=null===(v=null==d?void 0:d.group)||void 0===v?void 0:v.stroke)&&void 0!==m?m:void 0,strokeArrayWidth:a,strokeArrayColor:null!==(y=null===(b=null==d?void 0:d.group)||void 0===b?void 0:b.strokeArrayColor)&&void 0!==y?y:void 0,cursor:null!==(w=null===(C=null==d?void 0:d.group)||void 0===C?void 0:C.cursor)&&void 0!==w?w:void 0,lineDash:null!==(_=null===(x=null==d?void 0:d.group)||void 0===x?void 0:x.lineDash)&&void 0!==_?_:void 0,lineCap:"butt",clip:!0,cornerRadius:d.group.cornerRadius}),t&&"cell"===t.role||((t=new zS({x:i,y:o,width:s,height:l,lineWidth:null!==(A=null===(S=null==d?void 0:d.group)||void 0===S?void 0:S.lineWidth)&&void 0!==A?A:void 0,fill:null!==(R=null===(B=null==d?void 0:d.group)||void 0===B?void 0:B.fill)&&void 0!==R?R:void 0,stroke:null!==(T=null===(M=null==d?void 0:d.group)||void 0===M?void 0:M.stroke)&&void 0!==T?T:void 0,strokeArrayWidth:a,strokeArrayColor:null!==(L=null===(k=null==d?void 0:d.group)||void 0===k?void 0:k.strokeArrayColor)&&void 0!==L?L:void 0,cursor:null!==(E=null===(P=null==d?void 0:d.group)||void 0===P?void 0:P.cursor)&&void 0!==E?E:void 0,lineDash:null!==(F=null===(H=null==d?void 0:d.group)||void 0===H?void 0:H.lineDash)&&void 0!==F?F:void 0,lineCap:"butt",clip:!0,cornerRadius:d.group.cornerRadius})).role="cell",t.col=n,t.row=r,null==e||e.addCellGroup(t))}const z=function(t,e,i,o,n,r){let s,l;const a=r.internalProps.layoutMap.getBody(t,e).sparklineSpec,h=r.getCellValue(t,e);if(!Array.isArray(h))return;const d=n[3],c=n[0];i-=n[1]+n[3];const u=o-=n[0]+n[2];if("function"==typeof a){const n={col:t,row:e,dataValue:r.getCellOriginValue(t,e)||"",value:r.getCellValue(t,e)||"",rect:r.getCellRangeRelativeRect(r.getCellRange(t,e)),table:r};s=a(n),l=jL(s,d,c,i,o)}else s=a,l=jL(a,d,c,i,o);const g=[],p=[];let f,v;if("object"==typeof s.xField)WL.domain(s.xField.domain),f=s.xField.field;else if("string"==typeof s.xField){const t=h.map((t=>t[s.xField]));WL.domain(t),f=s.xField}else Array.isArray(h)&&(WL.domain(Array.from({length:h.length},((t,e)=>e))),f=s.xField);if(WL.range([0,i]),"object"==typeof s.yField)NL.domain(s.yField.domain),v=s.yField.field;else if("string"==typeof s.yField){const t=VL(h,s.yField);NL.domain([Math.min(...t),Math.max(...t)]),v=s.yField}else if(Array.isArray(h)){const t=VL(h);NL.domain([Math.min(...t),Math.max(...t)]),v=s.yField}if(NL.range([0,o]),"object"==typeof s.xField&&Array.isArray(s.xField.domain)){const t=h.map((t=>t[s.xField.field])),e=s.xField.domain;for(let i=0;i<e.length;i++){let o=!1;for(let n=0;n<t.length;n++)if(e[i]===t[n]){const t=h[n];if(!Q(t[f])||!Q(t[v]))break;g.push({x:0+WL.scale(t[f]),y:u-NL.scale(t[v]),defined:Q(t[v])}),p.push(t),o=!0;break}o||(g.push({x:0+WL.scale(e[i]),y:0,defined:!1}),p.push({[f]:e[i],[v]:null}))}}else for(let t=0;t<h.length;t++){const e=h[t];g.push({x:0+WL.scale(f?e[f]:t),y:u-NL.scale(v?e[v]:e),defined:Q(v?e[v]:e),rawData:e}),p.push(e)}const m=l.getChildByName("sparkline-line");m&&m.setAttribute("points",g),m.bandwidth=WL.step(),m.min=NL.range()[0],m.max=NL.range()[1];const b=l.getChildByName("sparkline-symbol-group");if(b){const t="isolatedPoint"===s.pointShowRule;if("all"===s.pointShowRule)for(let t=0;t<g.length;t++){const{x:e,y:i,defined:o}=g[t];if(o){const t=tc({x:e,y:i});b.appendChild(t)}}else if(t)for(let t=0;t<g.length;t++){const{x:e,y:i,defined:o}=g[t];if(o&&(!g[t-1]||!g[t-1].defined)&&(!g[t+1]||!g[t+1].defined)){const t=tc({x:e,y:i});b.appendChild(t)}}}return l}(n,r,s,l,a,h);return z&&t.appendChild(z),t}function jL(t,e,i,o,n){var r,s,l,a,h,d,c,u,g,p,f,v,m,b,y,C,w,x,_,S,A,B;let R;R="function"==typeof t?t(null):t;const M=new zS({x:e,y:i,width:o,height:n,stroke:!1,fill:!1});if(M.name="sparkline","line"===R.type){const t=oc({x:0,y:0,curveType:R.smooth?"monotoneX":"linear",stroke:null!==(l=null===(s=null===(r=R.line)||void 0===r?void 0:r.style)||void 0===s?void 0:s.stroke)&&void 0!==l?l:"blue",lineWidth:null!==(d=null===(h=null===(a=R.line)||void 0===a?void 0:a.style)||void 0===h?void 0:h.strokeWidth)&&void 0!==d?d:2});t.name="sparkline-line",M.addChild(t),R.crosshair&&(t.hover=null!==(u=null===(c=R.crosshair)||void 0===c?void 0:c.style)&&void 0!==u?u:{stroke:"#000",interpolate:"linear"});const e=new zS({x:0,y:0,width:o,height:n,stroke:!1,fill:!1});e.name="sparkline-symbol-group",e.setTheme({symbol:{stroke:null!==(f=null===(p=null===(g=R.point)||void 0===g?void 0:g.style)||void 0===p?void 0:p.stroke)&&void 0!==f?f:"#000",lineWidth:null!==(b=null===(m=null===(v=R.point)||void 0===v?void 0:v.style)||void 0===m?void 0:m.strokeWidth)&&void 0!==b?b:1,fill:null!==(w=null===(C=null===(y=R.point)||void 0===y?void 0:y.style)||void 0===C?void 0:C.fill)&&void 0!==w?w:"#000",size:2*(null!==(S=null===(_=null===(x=R.point)||void 0===x?void 0:x.style)||void 0===_?void 0:_.size)&&void 0!==S?S:3),symbolType:"circle"}}),M.addChild(e),e.hover=null!==(B=null===(A=R.point)||void 0===A?void 0:A.hover)&&void 0!==B&&B}return M}function VL(t,e){const i=[];for(let o=0;o<t.length;o++){const n=t[o];Q(e)&&Q(n[e])?i.push(n[e]):!Q(e)&&Q(n)&&i.push(n)}return i}const UL=FS();function $L(t,e,i,o,n,r,s,l,a,h,d,c,u,g,p,f,v){var m,b,y,C,w,x,_,S,A,B,R,M,T,k,L,P,E,H,F,z,I,O,D,W,N,G,j,V,U,$;const X=WS("padding",g._getCellStyle(o,n),o,n,g);(null===(m=g.options.customConfig)||void 0===m?void 0:m.imageMargin)?h=r_(null===(b=g.options.customConfig)||void 0===b?void 0:b.imageMargin):Q(X)&&(h=X),(null===(y=null==p?void 0:p.text)||void 0===y?void 0:y.textAlign)&&(d=null===(C=null==p?void 0:p.text)||void 0===C?void 0:C.textAlign),(null===(w=null==p?void 0:p.text)||void 0===w?void 0:w.textBaseline)&&(c=null===(x=null==p?void 0:p.text)||void 0===x?void 0:x.textBaseline);const Y=NS(o,n,p,g);let K,q;if(v&&(K=g.scenegraph.highPerformanceGetCell(o,n,!0),K&&"cell"===K.role&&K.setAttributes({x:e,y:i,width:r,height:s,lineWidth:null!==(S=null===(_=null==p?void 0:p.group)||void 0===_?void 0:_.lineWidth)&&void 0!==S?S:void 0,fill:null!==(B=null===(A=null==p?void 0:p.group)||void 0===A?void 0:A.fill)&&void 0!==B?B:void 0,stroke:null!==(M=null===(R=null==p?void 0:p.group)||void 0===R?void 0:R.stroke)&&void 0!==M?M:void 0,strokeArrayWidth:Y,strokeArrayColor:null!==(k=null===(T=null==p?void 0:p.group)||void 0===T?void 0:T.strokeArrayColor)&&void 0!==k?k:void 0,cursor:null!==(P=null===(L=null==p?void 0:p.group)||void 0===L?void 0:L.cursor)&&void 0!==P?P:void 0,lineDash:null!==(H=null===(E=null==p?void 0:p.group)||void 0===E?void 0:E.lineDash)&&void 0!==H?H:void 0,lineCap:"butt",clip:!0,cornerRadius:p.group.cornerRadius})),K&&"cell"===K.role||(K=new zS({x:e,y:i,width:r,height:s,lineWidth:null!==(z=null===(F=null==p?void 0:p.group)||void 0===F?void 0:F.lineWidth)&&void 0!==z?z:void 0,fill:null!==(O=null===(I=null==p?void 0:p.group)||void 0===I?void 0:I.fill)&&void 0!==O?O:void 0,stroke:null!==(W=null===(D=null==p?void 0:p.group)||void 0===D?void 0:D.stroke)&&void 0!==W?W:void 0,strokeArrayWidth:Y,strokeArrayColor:null!==(G=null===(N=null==p?void 0:p.group)||void 0===N?void 0:N.strokeArrayColor)&&void 0!==G?G:void 0,cursor:null!==(V=null===(j=null==p?void 0:p.group)||void 0===j?void 0:j.cursor)&&void 0!==V?V:void 0,lineDash:null!==($=null===(U=null==p?void 0:p.group)||void 0===U?void 0:U.lineDash)&&void 0!==$?$:void 0,lineCap:"butt",clip:!0,cornerRadius:p.group.cornerRadius}),K.role="cell",K.col=o,K.row=n,null==t||t.addCellGroup(K)),u){let t=o,e=n;f&&(t=f.start.col,e=f.start.row),q=g.getCellIcons(t,e)}let Z=0,J=0;if(Array.isArray(q)&&0!==q.length){const{leftIconWidth:t,rightIconWidth:e,absoluteLeftIconWidth:i,absoluteRightIconWidth:o}=KS(q,K,f,g);Z=t,J=e,K.forEachChildren((t=>{"icon-left"===t.role?t.setAttribute("x",t.attribute.x+h[3]):"icon-right"===t.role?t.setAttribute("x",t.attribute.x+r-e-h[1]):"icon-absolute-right"===t.role&&t.setAttribute("x",t.attribute.x+r-o-h[1])})),K.forEachChildren((t=>{"middle"===c?t.setAttribute("y",(s-t.AABBBounds.height())/2):"bottom"===c?t.setAttribute("y",s-t.AABBBounds.height()-h[2]):t.setAttribute("y",h[0])})),K._cellLeftIconWidth=Z,K._cellRightIconWidth=J}const tt=g.getCellValue(o,n),et=document.createElement("video");et.addEventListener("loadeddata",(()=>{a&&JS(o,n,et.videoWidth,et.videoHeight,g.scenegraph,h,K);const{width:t,height:e,isMerge:i}=tA(K,g);if(l){const{width:i,height:o}=IS(et.videoWidth,et.videoHeight,t-h[1]-h[3],e-h[0]-h[2]),n=OS(0,0,t,e,i,o,d,c,h);it.setAttributes({width:i,height:o,x:n.x,y:n.y,dx:0})}else it.setAttributes({x:h[3],y:h[0],width:t-h[1]-h[3],height:e-h[2]-h[0],dy:0});i&&eA(K.mergeStartCol,K.mergeEndCol,K.mergeStartRow,K.mergeEndRow,g);const{width:r,height:s}=tA(K,g),u=Math.floor(Math.min(r-h[1]-h[3],s-h[2]-h[0])/2),p=0+(r>it.attribute.width?it.attribute.x-0+it.attribute.width/2:r/2),f=0+(s>it.attribute.height?it.attribute.y-0+it.attribute.height/2:s/2),v=new U_({x:p-u/2,y:f-u/2,width:u,height:u,image:UL.play.svg,cursor:UL.play.cursor});v.name="play-icon",K.appendChild(v),g.scenegraph.updateNextFrame()})),et.onerror=()=>{it.image=UL.damage_pic.svg},et.src=tt,et.setAttribute("preload","auto");const it=cc({x:h[3],y:h[0],width:r-h[1]-h[3],height:s-h[2]-h[0],image:et,cursor:"pointer"});return it.name="image",it.keepAspectRatio=l,it.textAlign=d,it.textBaseline=c,K.appendChild(it),K}function XL(t,e,i,o,n,r,s,l,a,h,d,c,u,g,p,f,v,m,b){var y,C,w,x,_,S,A,B,R,M,T,k,L,P,E,H,F,z,I,O,D,W,N,G,j,V,U,$,X,Y,K,q;const Z=t._getCellStyle(r,s),J=WS("padding",Z,r,s,t);Q(J)&&(d=J),(null===(y=null==v?void 0:v.text)||void 0===y?void 0:y.textAlign)&&(c=null===(C=null==v?void 0:v.text)||void 0===C?void 0:C.textAlign),(null===(w=null==v?void 0:v.text)||void 0===w?void 0:w.textBaseline)&&(u=null===(x=null==v?void 0:v.text)||void 0===x?void 0:x.textBaseline);const tt=t.isAutoRowHeight(s),et="auto"===l,it=null!==(_=Z.autoWrapText)&&void 0!==_?_:t.internalProps.autoWrapText,ot=Z.lineClamp,nt=NS(r,s,v,t);let rt;if(b&&(rt=t.scenegraph.getCell(r,s,!0),rt&&"cell"===rt.role&&rt.setAttributes({x:o,y:n,width:a,height:h,lineWidth:null!==(A=null===(S=null==v?void 0:v.group)||void 0===S?void 0:S.lineWidth)&&void 0!==A?A:void 0,fill:null!==(R=null===(B=null==v?void 0:v.group)||void 0===B?void 0:B.fill)&&void 0!==R?R:void 0,stroke:null!==(T=null===(M=null==v?void 0:v.group)||void 0===M?void 0:M.stroke)&&void 0!==T?T:void 0,strokeArrayWidth:null!=nt?nt:void 0,strokeArrayColor:null!==(L=null===(k=null==v?void 0:v.group)||void 0===k?void 0:k.strokeArrayColor)&&void 0!==L?L:void 0,cursor:null!==(E=null===(P=null==v?void 0:v.group)||void 0===P?void 0:P.cursor)&&void 0!==E?E:void 0,lineDash:null!==(F=null===(H=null==v?void 0:v.group)||void 0===H?void 0:H.lineDash)&&void 0!==F?F:void 0,lineCap:"butt",clip:!0,cornerRadius:v.group.cornerRadius})),rt&&"cell"===rt.role||(rt=new zS({x:o,y:n,width:a,height:h,lineWidth:null!==(I=null===(z=null==v?void 0:v.group)||void 0===z?void 0:z.lineWidth)&&void 0!==I?I:void 0,fill:null!==(D=null===(O=null==v?void 0:v.group)||void 0===O?void 0:O.fill)&&void 0!==D?D:void 0,stroke:null!==(N=null===(W=null==v?void 0:v.group)||void 0===W?void 0:W.stroke)&&void 0!==N?N:void 0,strokeArrayWidth:null!=nt?nt:void 0,strokeArrayColor:null!==(j=null===(G=null==v?void 0:v.group)||void 0===G?void 0:G.strokeArrayColor)&&void 0!==j?j:void 0,cursor:null!==(U=null===(V=null==v?void 0:v.group)||void 0===V?void 0:V.cursor)&&void 0!==U?U:void 0,lineDash:null!==(X=null===($=null==v?void 0:v.group)||void 0===$?void 0:$.lineDash)&&void 0!==X?X:void 0,lineCap:"butt",clip:!0,cornerRadius:v.group.cornerRadius}),rt.role="cell",rt.col=r,rt.row=s,null==i||i.addCellGroup(rt)),p&&rt.appendChild(p),f){const i=e;let o;if(g){let e=r,i=s;m&&(e=m.start.col,i=m.start.row),o=t.getCellIcons(e,i)}if(function(t,e,i,o,n,r,s,l,a,h,d,c,u,g,p){var f,v,m,b,y;let C,w=0,x=0,_=0;if(Array.isArray(e)&&0!==e.length){const{inlineFrontIcons:f,inlineEndIcons:S,contentLeftIcons:A,contentRightIcons:B,leftIconWidth:R,rightIconWidth:M,absoluteRightIconWidth:T}=KS(e,t,p,u);let k;if(w=R,x=M,_=T,0===f.length&&0===S.length){let e=0;at(u.theme._contentOffset)&&("left"===d?e=u.theme._contentOffset:"right"===d&&(e=-u.theme._contentOffset));const c=p?jS(p.start.col,p.start.row,u):jS(t.col,t.row,u),{text:f,moreThanMaxCharacters:m}=VS(i,u),b={text:1===f.length?f[0]:f,moreThanMaxCharacters:m,maxLineWidth:n?1/0:a-(o[1]+o[3])-w-x-c,textBaseline:"top",heightLimit:r&&!(null===(v=u.options.customConfig)||void 0===v?void 0:v.multilinesForXTable)?-1:h-Math.floor(o[0]+o[2]),pickable:!1,autoWrapText:s,lineClamp:l,wordBreak:"break-word",whiteSpace:1!==f.length||s?"normal":"no-wrap",dx:("left"===d?A.length?0:c:0)+e},y=new Nh(g.text?Object.assign({},g.text,b):b);y.name="text",k=y}else{const e=Object.assign({text:null==i?void 0:i.toString()},(null===(y=null===(b=null===(m=t.parent)||void 0===m?void 0:m.theme)||void 0===b?void 0:b.userTheme)||void 0===y?void 0:y.text)||{});g.text&&Object.assign(e,g.text),e.textBaseline="middle";const l=[...f.map((t=>$S(t))),e,...S.map((t=>$S(t)))];l[0].textAlign=d;const u=new vc({width:n?0:a-(o[1]+o[3])-w-x,height:r&&s?0:Math.ceil(h-(o[0]+o[2])),textConfig:l,verticalDirection:r&&s?"top":c,ellipsis:e.ellipsis});u.name="text",k=u,u.bindIconEvent(),!p||p.start.col===p.end.col&&p.start.row===p.end.row||(u.onBeforeAttributeUpdate=qS)}if(0!==A.length||0!==B.length){const e=new GS({x:0,y:0,fill:!1,stroke:!1,pickable:!1});e.name="content",e.setCellContentOption({autoWidth:n,autoHeight:r,cellWidth:a-(o[1]+o[3])-w-x,cellHeight:h-(o[0]+o[2]),align:d,baseline:c});const i={addedHierarchyOffset:0};A.forEach((o=>{const n=US(o,void 0,t.col,t.row,p,u,i);n.role="icon-content-left",n.name=o.name,e.addLeftOccupyingIcon(n)})),B.forEach((o=>{const n=US(o,void 0,t.col,t.row,p,u,i);n.role="icon-content-right",n.name=o.name,e.addRightOccupyingIcon(n)})),e.addContent(k),t.appendChild(e),e.layout(),C=e.AABBBounds.width(),e.AABBBounds.height()}else t.firstChild?t.insertBefore(k,t.firstChild):t.appendChild(k),C=k.AABBBounds.width(),k.AABBBounds.height()}else if(Q(i)){const{text:e,moreThanMaxCharacters:v}=VS(i,u),m=p?jS(p.start.col,p.start.row,u):jS(t.col,t.row,u);let b=0;at(u.theme._contentOffset)&&("left"===d?b=u.theme._contentOffset:"right"===d&&(b=-u.theme._contentOffset));const y={text:1===e.length?e[0]:e,moreThanMaxCharacters:v,maxLineWidth:n?1/0:a-(o[1]+o[3]+m),textBaseline:"top",autoWrapText:s,lineClamp:l,wordBreak:"break-word",heightLimit:r&&!(null===(f=u.options.customConfig)||void 0===f?void 0:f.multilinesForXTable)?-1:h-Math.floor(o[0]+o[2]),pickable:!1,dx:("left"===d?m:0)+b,whiteSpace:1!==e.length||s?"normal":"no-wrap"},w=new Nh(g.text?Object.assign({},g.text,y):y);w.name="text",w.textBaseline=c,t.appendChild(w),C=w.AABBBounds.width(),w.AABBBounds.height()}const S=n?w+C+x:a-(o[1]+o[3]),A=h-(o[0]+o[2]);t.forEachChildren((t=>{"icon-left"===t.role?t.setAttribute("x",t.attribute.x+o[3]):"icon-right"===t.role?t.setAttribute("x",t.attribute.x+S-x+o[3]):"icon-absolute-right"===t.role?t.setAttribute("x",t.attribute.x+S-_+o[3]+o[1]):"content"!==t.name&&"text"!==t.name||("center"===d&&"richtext"!==t.type?t.setAttribute("x",o[3]+w+(S-w-x)/2):"right"===d&&"richtext"!==t.type?t.setAttribute("x",o[3]+S-x):t.setAttribute("x",o[3]+w))})),t.forEachChildren((t=>{"middle"===c?t.setAttribute("y",o[0]+(A-t.AABBBounds.height())/2):"bottom"===c?t.setAttribute("y",o[0]+A-t.AABBBounds.height()):t.setAttribute("y",o[0])})),t.setAttributes({width:S+o[1]+o[3],height:A+o[0]+o[2]})}(rt,o,i,d,et,tt,it,"number"==typeof ot?ot:void 0,rt.attribute.width,rt.attribute.height,c,u,t,v,m),null===(Y=null==v?void 0:v._vtable)||void 0===Y?void 0:Y.marked){const t=Ac({x:rt.attribute.width,y:0,startAngle:Math.PI/2,endAngle:Math.PI,outerRadius:6,fill:"#3073F2",pickable:!1});t.name="mark",rt.appendChild(t)}}return p&&rt.setAttributes({width:Math.max(rt.attribute.width,null!==(K=p.attribute.width)&&void 0!==K?K:0),height:Math.max(rt.attribute.height,null!==(q=p.attribute.height)&&void 0!==q?q:0)}),rt}function YL(t,e,i,o,n,r,s,l,a,h){var d,c,u,g,p,f;t.dependField&&(n=null!==(c=null===(d=a.getCellOriginRecord(r,s))||void 0===d?void 0:d[t.dependField])&&void 0!==c?c:n),t.barType=null!==(u=t.barType)&&void 0!==u?u:"default",t.min=null!==(g=Hw(t.min,{col:r,row:s,table:a,value:o,dataValue:n,cellHeaderPaths:void 0}))&&void 0!==g?g:0,t.max=null!==(p=Hw(t.max,{col:r,row:s,table:a,value:o,dataValue:n,cellHeaderPaths:void 0}))&&void 0!==p?p:t.min+100;let v=0;v=h?a.getRowsHeight(h.start.row,h.end.row):a.getRowHeight(s);let m=i,b=v,y=0;at(a.theme._contentOffset)&&(y=a.theme._contentOffset);const C=new zS({x:-y,y:-y,width:m,height:b});C.name="progress-bar";const{showBar:w,barColor:x,barBgColor:_,barPositiveColor:S,barNegativeColor:A,barAxisColor:B,barRightToLeft:R,showBarMark:M,barMarkPositiveColor:T,barMarkNegativeColor:k,barMarkWidth:L,barMarkPosition:P}=e;let{barHeight:E,barBottom:H,barPadding:F}=e;1===F.length?F=[F[0],F[0],F[0],F[0]]:2===F.length?F=[F[0],F[1],F[0],F[1]]:3===F.length&&(F=[F[0],F[1],F[2],F[1]]),F=F.map(((t,e)=>{if("string"==typeof t&&jw.endsWith(t,"%")){const o=Number(t.substr(0,t.length-1));return 0===e||2===e?v*o/100:i*o/100}return Number(t)}));const z=r_(DS("borderLineWidth",e,r,s,a)),I=Math.max(F[0],Math.ceil(z[0]/2)),O=Math.max(F[1],Math.floor(z[1]/2)),D=Math.max(F[2],Math.floor(z[2]/2)),W=Math.max(F[3],Math.ceil(z[3]/2));m-=O+W,b-=D+I,s===a.rowCount-1&&[0,"0"].includes(H)&&(b-=1);const N=I,G=W,j=m;if("string"==typeof E&&jw.endsWith(E,"%")?(E=Number(E.substr(0,E.length-1)),E=b*E/100):E=Number(E),"string"==typeof H&&jw.endsWith(H,"%")?(H=Number(H.substr(0,H.length-1)),H=b*H/100):H=Number(H),Hw(w,{col:r,row:s,table:a,context:null,value:o,dataValue:n})){let e=`${n}`;jw.endsWith(e,"%")&&(e=e.substr(0,e.length-1));const i=Number(e);if(isNaN(i))return C;if("default"===(null!==(f=t.barType)&&void 0!==f?f:"default")){const e=i<t.min?0:i>t.max?1:(i-t.min)/(t.max-t.min),l=m,h=N+b-E-H;let d=Math.min(l*e,l);const c=R?G+j-d:G;r!==a.colCount-1||1!==e||R||(d-=1);const u=Hw(_,{col:r,row:s,table:a,context:null,value:o,dataValue:n,percentile:e});if(u){const t=sc({x:c,y:h,width:l,height:E,fill:u});C.addChild(t)}const g=sc({x:c,y:h,width:d,height:E,fill:Hw(x,{col:r,row:s,table:a,context:null,value:o,dataValue:n,percentile:e})||"#20a8d8"});C.addChild(g)}else if("negative"===t.barType){const e=t.min<0?-t.min:0,l=t.max>0?t.max:0,h=e/(e+l),d=1-h,c=i>0?i/l:0,u=i<0?-i/e:0,g=m,p=N+b-E-H,f=G,y=Hw(_,{col:r,row:s,table:a,context:null,value:o,dataValue:n,percentile:c});if(y){const t=sc({x:f,y:p,width:g,height:E,fill:y});C.addChild(t)}const w=R?d*g:h*g,x=Math.min(g*h*u,g),F=R?{left:f+w,top:p,width:x,height:E}:{left:f+w-x,top:p,width:x,height:E},z=Hw(A,{col:r,row:s,table:a,context:null,value:o,dataValue:n,percentile:u})||"#20a8d8",I=sc({x:F.left,y:F.top,width:F.width,height:F.height,fill:z});C.addChild(I);let O=Math.min(g*d*c,g);r!==a.colCount-1||1!==c||R||(O-=1);const D=R?{left:f+w-O,top:p,width:O,height:E}:{left:f+w,top:p,width:O,height:E},W=Hw(S,{col:r,row:s,table:a,context:null,value:o,dataValue:n,percentile:c})||"#20a8d8",j=sc({x:D.left,y:D.top,width:D.width,height:D.height,fill:W});C.addChild(j);const V=R?F.left:D.left,U=oc({x:0,y:0,stroke:Hw(B,{col:r,row:s,table:a,context:null,value:o,dataValue:n,percentile:c}),lineWidth:1,lineDash:[2,2],points:[{x:V,y:0},{x:V,y:v}]});if(C.addChild(U),M&&(c||u)){const t=L,e=[];let i;if(c>0)if(i=Hw(T,{col:r,row:s,table:a,context:null,value:o,dataValue:n,percentile:c})||"#20a8d8","right"===P){const t=R?D.left+L/2:D.left+D.width-L/2;e.push({x:t,y:D.top}),e.push({x:t,y:D.top+D.height})}else"bottom"===P&&(e.push({x:D.left,y:D.top+D.height-L/2}),e.push({x:D.left+D.width,y:D.top+D.height-L/2}));else if(u>0)if(i=Hw(k,{col:r,row:s,table:a,context:null,value:o,dataValue:n,percentile:u})||"#20a8d8","right"===P){const t=R?F.left+F.width-L/2:F.left+L/2;e.push({x:t,y:F.top}),e.push({x:t,y:F.top+F.height})}else"bottom"===P&&(e.push({x:F.left,y:F.top+F.height-L/2}),e.push({x:F.left+F.width,y:F.top+F.height-L/2}));const l=oc({x:0,y:0,stroke:i,lineWidth:t,points:e});C.addChild(l)}}else if("negative_no_axis"===t.barType){const e=t.min<0?-t.min:0,l=t.max>0?t.max:0,h=Math.max(e,l),d=0===h?0:Math.abs(i)/h,c=m;let u=Math.min(c*d,c);r!==a.colCount-1||1!==d||R||(u-=1);const g=N+b-E-H,p=R?G+j-u:G,f=Hw(_,{col:r,row:s,table:a,context:null,value:o,dataValue:n,percentile:d});if(f){const t=sc({x:p,y:g,width:c,height:E,fill:f});C.addChild(t)}const v={left:p,top:g,width:u,height:E};let y;y=i>=0?Hw(S,{col:r,row:s,table:a,context:null,value:o,percentile:d,dataValue:n})||"#20a8d8":Hw(A,{col:r,row:s,table:a,context:null,value:o,dataValue:n,percentile:d})||"#20a8d8";const w=sc({x:v.left,y:v.top,width:v.width,height:v.height,fill:y});if(C.addChild(w),M&&i){const t=L,e=[];let l;if(l=i>=0?Hw(T,{col:r,row:s,table:a,context:null,value:o,dataValue:n,percentile:d})||"#20a8d8":Hw(k,{col:r,row:s,table:a,context:null,value:o,dataValue:n,percentile:d})||"#20a8d8","right"===P){const t=R?v.left+L/2:v.left+v.width-L/2;e.push({x:t,y:v.top}),e.push({x:t,y:v.top+v.height})}else"bottom"===P&&(e.push({x:v.left,y:v.top+v.height-L/2}),e.push({x:v.left+v.width,y:v.top+v.height-L/2}));const h=oc({x:0,y:0,stroke:l,lineWidth:t,points:e});C.addChild(h)}}}return C}function KL(t,e,i,o,n,r){var s,l,a,h,d,c,u,g,p;if((null==i?void 0:i.zero)&&(t=Math.min(t,0),e=Math.max(e,0)),null==i?void 0:i.expand){const o=t,n=e;Q(i.expand.min)&&(t=o-(n-o)*i.expand.min),Q(i.expand.max)&&(e=n+(n-o)*i.expand.max)}let f,v;if(at(null==i?void 0:i.min)&&(t=i.min),at(null==i?void 0:i.max)&&(e=i.max),"log"===(null==i?void 0:i.type)?(f=new by,f.base(null!==(s=null==i?void 0:i.base)&&void 0!==s?s:10)):"symlog"===(null==i?void 0:i.type)?(f=new yy,f.constant(null!==(l=null==i?void 0:i.constant)&&void 0!==l?l:10)):f=new py,f.domain([t,e],!!(null==i?void 0:i.nice)),null==i?void 0:i.nice){let t=null!==(c=null!==(h=null===(a=i.tick)||void 0===a?void 0:a.forceTickCount)&&void 0!==h?h:null===(d=i.tick)||void 0===d?void 0:d.tickCount)&&void 0!==c?c:10;Z(t)&&(t=t({axisLength:n,labelStyle:null!==(g=null===(u=null==i?void 0:i.label)||void 0===u?void 0:u.style)&&void 0!==g?g:{fontSize:Pk}})),"accurateFirst"===i.niceType&&(t=Math.max(10,t)),J(i.min)&&J(i.max)?f.nice(t):Q(i.min)&&J(i.max)?f.niceMax(t):J(i.min)&&Q(i.max)&&f.niceMin(t)}return delete f._niceType,r||(v=f.ticks(at(null==i?void 0:i.tickCount)?null==i?void 0:i.tickCount:5,{noDecimals:null===(p=null==i?void 0:i.tick)||void 0===p?void 0:p.noDecimals})),{range:f.domain(),ticks:v}}Tx.registerComponent("axis",qk),Tx.registerFunction("computeAxisComponentWidth",Zk),Tx.registerFunction("computeAxisComponentHeight",Jk),Tx.registerFunction("getAxisConfigInPivotChart",QT),Tx.registerComponent("emptyTip",eL),Tx.registerFunction("createLegend",dL),Tx.registerComponent("menuHandler",yL),Tx.registerComponent("title",CL),Tx.registerComponent("tooltipHandler",kL),Tx.registerComponent("listTreeStickCellPlugin",LL),Tx.registerFunction("createChartCellGroup",zL),Tx.registerFunction("getAxisDomainRangeAndLabels",KL),Tx.registerFunction("createCheckboxCellGroup",IL),Tx.registerFunction("createImageCellGroup",ZS),Tx.registerFunction("createProgressBarCell",YL),Tx.registerFunction("createRadioCellGroup",OL),Tx.registerFunction("createSparkLineCellGroup",GL),Tx.registerFunction("createTextCellGroup",XL),Tx.registerFunction("createVideoCellGroup",$L);class qL extends Nk{}class ZL extends fs{constructor(t){var e,i,o,n,r,s,l,a,h,d,c,u,g,p;t.direction&&(t.flexDirection=t.direction),!t.justifyContent||"start"!==t.justifyContent&&"end"!==t.justifyContent||(t.justifyContent="flex-"+t.justifyContent),!t.alignItems||"start"!==t.alignItems&&"end"!==t.alignItems||(t.alignItems="flex-"+t.alignItems),!t.alignContent||"start"!==t.alignContent&&"end"!==t.alignContent||(t.alignContent="flex-"+t.alignContent),t.display="flex",t.flexDirection||(t.flexDirection="row"),t.clip=!0,t.fill=null===(e=null==t?void 0:t.background)||void 0===e?void 0:e.fill,t.stroke=null===(i=null==t?void 0:t.background)||void 0===i?void 0:i.stroke,t.lineWidth=null===(o=null==t?void 0:t.background)||void 0===o?void 0:o.lineWidth,t.cornerRadius=null===(n=null==t?void 0:t.background)||void 0===n?void 0:n.cornerRadius;const f=rt(t.boundsPadding),v=[null!==(s=null!==(r=t.marginTop)&&void 0!==r?r:f?t.boundsPadding[0]:t.boundsPadding)&&void 0!==s?s:0,null!==(a=null!==(l=t.marginRight)&&void 0!==l?l:f?t.boundsPadding[1]:t.boundsPadding)&&void 0!==a?a:0,null!==(c=null!==(h=t.marginBottom)&&void 0!==h?h:f?null!==(d=t.boundsPadding[2])&&void 0!==d?d:t.boundsPadding[0]:t.boundsPadding)&&void 0!==c?c:0,null!==(p=null!==(u=t.marginLeft)&&void 0!==u?u:f?null!==(g=t.boundsPadding[3])&&void 0!==g?g:t.boundsPadding[1]:t.boundsPadding)&&void 0!==p?p:0];t.boundsPadding=v,super(t)}}var JL=Object.freeze({__proto__:null,Arc:class extends Sc{constructor(t){var e,i,o,n,r,s,l,a,h,d;const c=rt(t.boundsPadding),u=[null!==(i=null!==(e=t.marginTop)&&void 0!==e?e:c?t.boundsPadding[0]:t.boundsPadding)&&void 0!==i?i:0,null!==(n=null!==(o=t.marginRight)&&void 0!==o?o:c?t.boundsPadding[1]:t.boundsPadding)&&void 0!==n?n:0,null!==(l=null!==(r=t.marginBottom)&&void 0!==r?r:c?null!==(s=t.boundsPadding[2])&&void 0!==s?s:t.boundsPadding[0]:t.boundsPadding)&&void 0!==l?l:0,null!==(d=null!==(a=t.marginLeft)&&void 0!==a?a:c?null!==(h=t.boundsPadding[3])&&void 0!==h?h:t.boundsPadding[1]:t.boundsPadding)&&void 0!==d?d:0];t.boundsPadding=u,super(t)}},CheckBox:Qy,Circle:class extends Ih{constructor(t){var e,i,o,n,r,s,l,a,h,d;const c=rt(t.boundsPadding),u=[null!==(i=null!==(e=t.marginTop)&&void 0!==e?e:c?t.boundsPadding[0]:t.boundsPadding)&&void 0!==i?i:0,null!==(n=null!==(o=t.marginRight)&&void 0!==o?o:c?t.boundsPadding[1]:t.boundsPadding)&&void 0!==n?n:0,null!==(l=null!==(r=t.marginBottom)&&void 0!==r?r:c?null!==(s=t.boundsPadding[2])&&void 0!==s?s:t.boundsPadding[0]:t.boundsPadding)&&void 0!==l?l:0,null!==(d=null!==(a=t.marginLeft)&&void 0!==a?a:c?null!==(h=t.boundsPadding[3])&&void 0!==h?h:t.boundsPadding[1]:t.boundsPadding)&&void 0!==d?d:0];t.boundsPadding=u,super(t)}},Container:ZL,Group:class extends fs{constructor(t){var e,i,o,n,r,s,l,a,h,d;const c=rt(t.boundsPadding),u=[null!==(i=null!==(e=t.marginTop)&&void 0!==e?e:c?t.boundsPadding[0]:t.boundsPadding)&&void 0!==i?i:0,null!==(n=null!==(o=t.marginRight)&&void 0!==o?o:c?t.boundsPadding[1]:t.boundsPadding)&&void 0!==n?n:0,null!==(l=null!==(r=t.marginBottom)&&void 0!==r?r:c?null!==(s=t.boundsPadding[2])&&void 0!==s?s:t.boundsPadding[0]:t.boundsPadding)&&void 0!==l?l:0,null!==(d=null!==(a=t.marginLeft)&&void 0!==a?a:c?null!==(h=t.boundsPadding[3])&&void 0!==h?h:t.boundsPadding[1]:t.boundsPadding)&&void 0!==d?d:0];t.boundsPadding=u,super(t)}},GroupElement:class extends ZL{constructor(t){t.flexWrap="nowrap",super(t)}},Icon:class extends dc{constructor(t){var e,i,o,n,r,s,l,a,h,d,c,u;let g;nt(t.iconName)&&(g=FS()[t.iconName],g&&(t.width=null!==(e=t.width)&&void 0!==e?e:g.width,t.height=null!==(i=t.height)&&void 0!==i?i:g.height,t.svg=g.svg,t.cursor=g.cursor)),t.svg&&(t.image=t.svg);const p=rt(t.boundsPadding),f=[null!==(n=null!==(o=t.marginTop)&&void 0!==o?o:p?t.boundsPadding[0]:t.boundsPadding)&&void 0!==n?n:0,null!==(s=null!==(r=t.marginRight)&&void 0!==r?r:p?t.boundsPadding[1]:t.boundsPadding)&&void 0!==s?s:0,null!==(h=null!==(l=t.marginBottom)&&void 0!==l?l:p?null!==(a=t.boundsPadding[2])&&void 0!==a?a:t.boundsPadding[0]:t.boundsPadding)&&void 0!==h?h:0,null!==(u=null!==(d=t.marginLeft)&&void 0!==d?d:p?null!==(c=t.boundsPadding[3])&&void 0!==c?c:t.boundsPadding[1]:t.boundsPadding)&&void 0!==u?u:0];t.boundsPadding=f,super(t),this.cache=g}},Image:class extends dc{constructor(t){var e,i,o,n,r,s,l,a,h,d;t.src&&(t.image=t.src),"circle"===t.shape&&(t.cornerRadius=t.width/2);const c=rt(t.boundsPadding),u=[null!==(i=null!==(e=t.marginTop)&&void 0!==e?e:c?t.boundsPadding[0]:t.boundsPadding)&&void 0!==i?i:0,null!==(n=null!==(o=t.marginRight)&&void 0!==o?o:c?t.boundsPadding[1]:t.boundsPadding)&&void 0!==n?n:0,null!==(l=null!==(r=t.marginBottom)&&void 0!==r?r:c?null!==(s=t.boundsPadding[2])&&void 0!==s?s:t.boundsPadding[0]:t.boundsPadding)&&void 0!==l?l:0,null!==(d=null!==(a=t.marginLeft)&&void 0!==a?a:c?null!==(h=t.boundsPadding[3])&&void 0!==h?h:t.boundsPadding[1]:t.boundsPadding)&&void 0!==d?d:0];t.boundsPadding=u,super(t)}},Line:ic,Radio:tC,Rect:class extends rc{constructor(t){var e,i,o,n,r,s,l,a,h,d;const c=rt(t.boundsPadding),u=[null!==(i=null!==(e=t.marginTop)&&void 0!==e?e:c?t.boundsPadding[0]:t.boundsPadding)&&void 0!==i?i:0,null!==(n=null!==(o=t.marginRight)&&void 0!==o?o:c?t.boundsPadding[1]:t.boundsPadding)&&void 0!==n?n:0,null!==(l=null!==(r=t.marginBottom)&&void 0!==r?r:c?null!==(s=t.boundsPadding[2])&&void 0!==s?s:t.boundsPadding[0]:t.boundsPadding)&&void 0!==l?l:0,null!==(d=null!==(a=t.marginLeft)&&void 0!==a?a:c?null!==(h=t.boundsPadding[3])&&void 0!==h?h:t.boundsPadding[1]:t.boundsPadding)&&void 0!==d?d:0];t.boundsPadding=u,super(t)}},Tag:class extends Im{constructor(t){var e,i,o,n,r,s,l,a,h,d;const c=rt(t.boundsPadding),u=[null!==(i=null!==(e=t.marginTop)&&void 0!==e?e:c?t.boundsPadding[0]:t.boundsPadding)&&void 0!==i?i:0,null!==(n=null!==(o=t.marginRight)&&void 0!==o?o:c?t.boundsPadding[1]:t.boundsPadding)&&void 0!==n?n:0,null!==(l=null!==(r=t.marginBottom)&&void 0!==r?r:c?null!==(s=t.boundsPadding[2])&&void 0!==s?s:t.boundsPadding[0]:t.boundsPadding)&&void 0!==l?l:0,null!==(d=null!==(a=t.marginLeft)&&void 0!==a?a:c?null!==(h=t.boundsPadding[3])&&void 0!==h?h:t.boundsPadding[1]:t.boundsPadding)&&void 0!==d?d:0];t.boundsPadding=u,super(t)}getSize(t){this.AABBBounds.width()}},Text:class extends Nh{constructor(t){var e,i,o,n,r,s,l,a,h,d,c;t.textBaseline||(t.textBaseline="top");const u=rt(t.boundsPadding),g=[null!==(i=null!==(e=t.marginTop)&&void 0!==e?e:u?t.boundsPadding[0]:t.boundsPadding)&&void 0!==i?i:0,null!==(n=null!==(o=t.marginRight)&&void 0!==o?o:u?t.boundsPadding[1]:t.boundsPadding)&&void 0!==n?n:0,null!==(l=null!==(r=t.marginBottom)&&void 0!==r?r:u?null!==(s=t.boundsPadding[2])&&void 0!==s?s:t.boundsPadding[0]:t.boundsPadding)&&void 0!==l?l:0,null!==(d=null!==(a=t.marginLeft)&&void 0!==a?a:u?null!==(h=t.boundsPadding[3])&&void 0!==h?h:t.boundsPadding[1]:t.boundsPadding)&&void 0!==d?d:0];t.boundsPadding=g,t.fill=null!==(c=t.fill)&&void 0!==c?c:"#000",super(t)}getSize(t){this.AABBBounds.width()}},percentCalc:function(t){return{percent:t,delta:arguments.length>1&&void 0!==arguments[1]?arguments[1]:0}}});oC();const QL=(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 tP(t,e,i){let o,n,r,s,l,a,h=0,d=!1,c=!1,u=!0;const g=!e&&0!==e&&"function"==typeof requestAnimationFrame;if("function"!=typeof t)throw new TypeError("Expected a function");function p(e){const i=o,r=n;return n=void 0,o=void 0,h=e,s=t.apply(r,i),s}function f(t,e){return g?requestAnimationFrame(t):setTimeout(t,e)}function v(t){const i=t-a;return void 0===a||i>=e||i<0||d&&t-h>=r}function m(){const t=Date.now();if(v(t))return function(t){return l=void 0,u&&o?p(t):(n=void 0,o=void 0,s)}(t);l=f(m,function(t){const i=t-h,o=e&&-(t-a);return d?Math.min(o,r-i):o}(t))}return e=+e||0,QL(i,"object")&&(c=!!i.leading,d="maxWait"in i,d&&(r=Math.max(+i.maxWait||0,e)),u="trailing"in i?!!i.trailing:u),function(...t){const i=Date.now(),r=v(i);if(o=t,n=this,a=i,r){if(void 0===l)return function(t){return h=t,l=f(m,e),c?p(t):s}(a);if(d)return l=f(m,e),p(a)}return void 0===l&&(l=f(m,e)),s}}let eP=1;class iP{resizeTime=100;element;cb;observer;lastSize={width:0,height:0};callBackDebounce;constructor(t,e,i){if(this.element=t,this.cb=e,this.lastSize=this.getSize(),i&&(this.resizeTime=Math.max(i,16)),this.callBackDebounce=tP(this.callBack,this.resizeTime),window?.addEventListener("resize",this.onResize),"ResizeObserver"in window){const t=window.ResizeObserver;this.observer=new t(this.mutationResize),this.observer?.observe(this.element)}else"MutationObserver"in window&&(this.observer=new MutationObserver(this.mutationResize),this.observer.observe(this.element,{attributes:!0,attributeFilter:["style"]}))}mutationResize=()=>{this.onResize()};disConnect(){window.removeEventListener("resize",this.onResize),this.observer&&(this.observer.disconnect(),this.observer=void 0)}callBack=()=>{const t=this.getSize();let e=!1;t.width===this.lastSize.width&&t.height===this.lastSize.height&&(e=!0),this.lastSize=t,this.cb&&this.cb({...this.lastSize,windowSizeNotChange:e})};setSize(t){this.lastSize=t}onResize=()=>{this.callBackDebounce()};checkSize(){const t=this.getSize();return t.width!==this.lastSize.width||t.height!==this.lastSize.height}getSize(){return this.element?{width:Math.floor(this.element.clientWidth),height:Math.floor(this.element.clientHeight)}:{...this.lastSize}}}class oP{resizeTime;listeners={};reseizeListeners={};on(t,e,i,...o){if("node"===rC.mode)return-1;const n=eP++;if(t?.addEventListener)if("resize"!==e||t===window)t?.addEventListener(e,i,...o);else{const e=new iP(t,i,this.resizeTime);this.reseizeListeners[n]=e}const r={target:t,type:e,listener:i,options:o};return this.listeners[n]=r,n}once(t,e,i,...o){if("node"===rC.mode)return-1;const n=this.on(t,e,((...t)=>{this.off(n),i(...t)}),...o);return n}off(t){if("node"===rC.mode)return;if(null==t)return;const e=this.listeners?.[t];e&&(delete this.listeners[t],e.target.removeEventListener&&e.target.removeEventListener(e.type,e.listener,...e.options))}fire(t,e,...i){if("node"!==rC.mode)for(const o in this.listeners){const n=this.listeners[o];n.target===t&&n.type===e&&n.listener.call(n.target,...i)}}hasListener(t,e){if("node"===rC.mode)return!1;let i=!1;for(const o in this.listeners){const n=this.listeners[o];n.target===t&&n.type===e&&(i=!0)}return i}clear(){if("node"!==rC.mode){for(const t in this.listeners){const e=this.listeners[t];e.target.removeEventListener&&e.target.removeEventListener(e.type,e.listener,...e.options)}for(const t in this.reseizeListeners){const e=this.reseizeListeners[t];e?.disConnect()}this.listeners={}}}release(){"node"!==rC.mode&&(this.clear(),this.listeners={})}}let nP=1;function rP(){return mC?nP=1:(nP=Math.ceil(window.devicePixelRatio||1),nP>1&&nP%2!=0&&(nP+=1)),nP}rP();class sP{_gantt;_eventHandler;isDown=!1;isDraging=!1;lastDragPointerXYOnWindow;globalEventListeners=[];poniterState;constructor(t){this._gantt=t,this._eventHandler=new oP,this.bindEvent()}release(){this._eventHandler.release(),this.globalEventListeners.forEach((t=>{"document"===t.env?document.removeEventListener(t.name,t.callback):"body"===t.env?document.body.removeEventListener(t.name,t.callback):"window"===t.env&&window.removeEventListener(t.name,t.callback)})),this.globalEventListeners=[]}bindEvent(){!function(t){const i=t._gantt.scenegraph,n=t._gantt,r=n.stateManager;i.tableGroup.addEventListener("pointerdown",(t=>{if(0!==t.button)return;let i,o,s;t.detailPath.find((t=>"task-bar"===t.name?(i=t,!0):"task-creation-button"===t.name||("task-bar-link-point-left"===t.name?(o=t,!0):"task-bar-link-point-right"===t.name?(s=t,!0):!!t.attribute.vtable_link&&(t.attribute.vtable_link,!0)))),i?"task-bar-hover-shadow-left-icon"===t.target.name?(r.startResizeTaskBar(i,t.nativeEvent.x,t.nativeEvent.y,t.offset.y,"left"),r.updateInteractionState(e.grabing)):"task-bar-hover-shadow-right-icon"===t.target.name?(r.startResizeTaskBar(i,t.nativeEvent.x,t.nativeEvent.y,t.offset.y,"right"),r.updateInteractionState(e.grabing)):n.parsedOptions.taskBarMoveable&&(r.startMoveTaskBar(i,t.nativeEvent.x,t.nativeEvent.y,t.offset.y),r.updateInteractionState(e.grabing)):o?(r.startCreateDependencyLine(o,t.nativeEvent.x,t.nativeEvent.y,t.offset.y,"left"),r.updateInteractionState(e.grabing)):s&&(r.startCreateDependencyLine(s,t.nativeEvent.x,t.nativeEvent.y,t.offset.y,"right"),r.updateInteractionState(e.grabing))})),i.tableGroup.addEventListener("pointermove",(t=>{if(r.interactionState===e.default){const e=t.detailPath.find((t=>"task-bar"===t.name));if(e){if(i._gantt.stateManager.hoverTaskBar.target!==e&&(i._gantt.stateManager.hoverTaskBar.target=e,r.showTaskBarHover(),i._gantt.hasListeners(o.MOUSEENTER_TASK_BAR))){const e=yC(t.offset.y,i._gantt),n=i._gantt.getRecordByIndex(e);i._gantt.fireListeners(o.MOUSEENTER_TASK_BAR,{event:t.nativeEvent,index:e,record:n})}}else{if(i._gantt.stateManager.hoverTaskBar.target&&(r.hideTaskBarHover(t),i._gantt.hasListeners(o.MOUSELEAVE_TASK_BAR))){const e=yC(t.offset.y,i._gantt),n=i._gantt.getRecordByIndex(e);i._gantt.fireListeners(o.MOUSELEAVE_TASK_BAR,{event:t.nativeEvent,index:e,record:n})}if(n.parsedOptions.taskBarCreatable){const e=yC(t.offset.y,n),i=n.getTaskInfoByTaskListIndex(e);if(!i.taskDays&&i.taskRecord){const o=function(t,e){const i=t+e.stateManager.scroll.horizontalBarPos;return Math.floor(i/e.parsedOptions.timelineColWidth)}(t.offset.x,n),r=o*n.parsedOptions.timelineColWidth-n.stateManager.scroll.horizontalBarPos,s=e*n.parsedOptions.rowHeight-n.stateManager.scroll.verticalBarPos;return void n.scenegraph.showTaskCreationButton(r,s,e,i.taskRecord)}}}n.scenegraph.hideTaskCreationButton()}else if(r.interactionState===e.grabing){let e,o,n;t.detailPath.find((t=>"task-bar"===t.name?(e=t,!0):"task-creation-button"===t.name||("task-bar-link-point-left"===t.name?(o=t,!0):"task-bar-link-point-right"===t.name?(n=t,!0):!!t.attribute.vtable_link&&(t.attribute.vtable_link,!0)))),e=e??o?.parent?.attribute.attachedToTaskBarNode??n?.parent?.attribute.attachedToTaskBarNode,i._gantt.stateManager.isCreatingDependencyLine()&&!e?r.hideSecondTaskBarSelectedBorder():i._gantt.stateManager.isCreatingDependencyLine()&&o&&i._gantt.stateManager.selectedTaskBar.target!==e?(r.highlightLinkPointNode(o),r.creatingDenpendencyLink.lastHighLightLinkPoint=o,r.creatingDenpendencyLink.secondTaskBarPosition="left"):i._gantt.stateManager.isCreatingDependencyLine()&&n&&i._gantt.stateManager.selectedTaskBar.target!==e?(r.highlightLinkPointNode(n),r.creatingDenpendencyLink.lastHighLightLinkPoint=n,r.creatingDenpendencyLink.secondTaskBarPosition="right"):i._gantt.stateManager.isCreatingDependencyLine()&&e&&i._gantt.stateManager.selectedTaskBar.target!==e&&(r.unhighlightLinkPointNode(r.creatingDenpendencyLink.lastHighLightLinkPoint),r.creatingDenpendencyLink.secondTaskBarNode&&r.creatingDenpendencyLink.secondTaskBarNode===e||(r.creatingDenpendencyLink.secondTaskBarNode&&r.creatingDenpendencyLink.secondTaskBarNode!==e&&r.hideSecondTaskBarSelectedBorder(),r.creatingDenpendencyLink.secondTaskBarNode=e,r.showSecondTaskBarSelectedBorder()))}})),i.tableGroup.addEventListener("pointerup",(e=>{let s,l=!1,a=!1,h=!1,d=!1,c=!1;const u=e.detailPath.find((t=>"task-bar"===t.name?(l=!0,!0):"task-creation-button"===t.name?(a=!0,!1):"task-bar-link-point-left"===t.name?(d=!0,!1):"task-bar-link-point-right"===t.name?(c=!0,!1):!!t.attribute.vtable_link&&(h=!0,s=t.attribute.vtable_link,!1)));if(l&&i._gantt.parsedOptions.taskBarSelectable&&"down"===t.poniterState){if(r.hideDependencyLinkSelectedLine(),i._gantt.stateManager.selectedTaskBar.target=u,r.showTaskBarSelectedBorder(),n.hasListeners(o.CLICK_TASK_BAR)){const t=yC(e.offset.y,n),i=n.getRecordByIndex(t);n.fireListeners(o.CLICK_TASK_BAR,{event:e.nativeEvent,index:t,record:i})}}else if(a&&"down"===t.poniterState){r.hideDependencyLinkSelectedLine(),r.hideTaskBarSelectedBorder();const t=yC(e.offset.y,n),i=n.getTaskInfoByTaskListIndex(t);if(i.taskRecord){const r=n.parsedOptions.dateFormat??"yyyy-mm-dd";i.taskRecord[n.parsedOptions.startDateField]=i.taskRecord[n.parsedOptions.endDateField]=aC(new Date(n.parsedOptions._minDateTime+Math.floor((e.offset.x+n.stateManager.scroll.horizontalBarPos)/n.parsedOptions.colWidthPerDay)*bC),r),n.scenegraph.hideTaskCreationButton(),n.updateTaskRecord(i.taskRecord,t),n.hasListeners(o.CREATE_TASK_SCHEDULE)&&n.fireListeners(o.CREATE_TASK_SCHEDULE,{event:e.nativeEvent,index:t,startDate:i.taskRecord[n.parsedOptions.startDateField],endDate:i.taskRecord[n.parsedOptions.endDateField],record:i.taskRecord})}}else if(h&&i._gantt.parsedOptions.dependencyLinkSelectable&&"down"===t.poniterState)r.hideDependencyLinkSelectedLine(),r.hideTaskBarSelectedBorder(),i._gantt.stateManager.selectedDenpendencyLink.link=s,r.showDependencyLinkSelectedLine();else if(d&&"draging"===t.poniterState){if(r.isCreatingDependencyLine()){const t=r.endCreateDependencyLine(e.offset.y);n.hasListeners(o.CREATE_DEPENDENCY_LINK)&&n.fireListeners(o.CREATE_DEPENDENCY_LINK,{event:e.nativeEvent,link:t})}}else if(c&&"draging"===t.poniterState){if(r.isCreatingDependencyLine()){const t=r.endCreateDependencyLine(e.offset.y);n.hasListeners(o.CREATE_DEPENDENCY_LINK)&&n.fireListeners(o.CREATE_DEPENDENCY_LINK,{event:e.nativeEvent,link:t})}}else r.hideDependencyLinkSelectedLine(),r.hideTaskBarSelectedBorder()})),i.tableGroup.addEventListener("pointerenter",(t=>{(n.parsedOptions.scrollStyle.horizontalVisible&&"focus"===n.parsedOptions.scrollStyle.horizontalVisible||!n.parsedOptions.scrollStyle.horizontalVisible&&"focus"===n.parsedOptions.scrollStyle.visible)&&i.scrollbarComponent.showHorizontalScrollBar(),(n.parsedOptions.scrollStyle.verticalVisible&&"focus"===n.parsedOptions.scrollStyle.verticalVisible||!n.parsedOptions.scrollStyle.verticalVisible&&"focus"===n.parsedOptions.scrollStyle.visible)&&i.scrollbarComponent.showVerticalScrollBar()})),i.tableGroup.addEventListener("pointerleave",(t=>{(n.parsedOptions.scrollStyle.horizontalVisible&&"focus"===n.parsedOptions.scrollStyle.horizontalVisible||!n.parsedOptions.scrollStyle.horizontalVisible&&"focus"===n.parsedOptions.scrollStyle.visible)&&i.scrollbarComponent.hideHorizontalScrollBar(),(n.parsedOptions.scrollStyle.verticalVisible&&"focus"===n.parsedOptions.scrollStyle.verticalVisible||!n.parsedOptions.scrollStyle.verticalVisible&&"focus"===n.parsedOptions.scrollStyle.visible)&&i.scrollbarComponent.hideVerticalScrollBar()}))}(this),function(t){const i=t._gantt;t._gantt.scenegraph;const o=i.stateManager,n=t._eventHandler;n.on(i.getElement(),"wheel",(e=>{vC(e,o,t._gantt)})),n.on(i.getContainer(),"resize",(t=>{0===t.width&&0===t.height||(Q(i.options.pixelRatio)||i.setPixelRatio(rP()),t.windowSizeNotChange||i._resize())})),i.taskListTableInstance&&i.parsedOptions.verticalSplitLineMoveable&&n.on(i.verticalSplitResizeLine,"mousedown",(t=>{o.updateInteractionState(e.grabing),o.startResizeTableWidth(t)}));i.parsedOptions.verticalSplitLineHighlight&&(i.verticalSplitResizeLine&&n.on(i.verticalSplitResizeLine,"mouseover",(t=>{i.verticalSplitResizeLine.childNodes[1].style.opacity="1"})),i.verticalSplitResizeLine&&n.on(i.verticalSplitResizeLine,"mouseout",(t=>{i.verticalSplitResizeLine.childNodes[1].style.opacity="0"})));const r=t=>{i.eventManager.lastDragPointerXYOnWindow={x:t.x,y:t.y},i.eventManager.poniterState="down"};t.globalEventListeners.push({name:"mousedown",env:"document",callback:r}),bu.addEventListener("mousedown",r);const s=t=>{if("down"===i.eventManager.poniterState){const e=i.eventManager.lastDragPointerXYOnWindow.x??t.x,o=t.x-e,n=i.eventManager.lastDragPointerXYOnWindow.y??t.y,r=t.y-n;(Math.abs(o)>=1||Math.abs(r)>=1)&&(i.eventManager.poniterState="draging")}if(o.interactionState===e.grabing&&"draging"===i.eventManager.poniterState){const e=i.eventManager.lastDragPointerXYOnWindow?.x??t.x;Math.abs(e-t.x)>=1&&(o.isResizingTableWidth()?(o.hideDependencyLinkSelectedLine(),o.hideTaskBarSelectedBorder(),o.dealResizeTableWidth(t)):o.isMoveingTaskBar()?(o.hideDependencyLinkSelectedLine(),o.hideTaskBarSelectedBorder(),o.dealTaskBarMove(t)):o.isResizingTaskBar()?(o.hideDependencyLinkSelectedLine(),o.hideTaskBarSelectedBorder(),o.dealTaskBarResize(t)):o.isCreatingDependencyLine()&&o.dealCreateDependencyLine(t),i.eventManager.lastDragPointerXYOnWindow={x:t.x,y:t.y})}};t.globalEventListeners.push({name:"mousemove",env:"document",callback:s}),bu.addEventListener("mousemove",s);const l=t=>{"grabing"===o.interactionState&&(o.updateInteractionState(e.default),o.isResizingTableWidth()?o.endResizeTableWidth():o.isMoveingTaskBar()?o.endMoveTaskBar(t.x):o.isResizingTaskBar()&&o.endResizeTaskBar(t.x)),i.eventManager.lastDragPointerXYOnWindow=void 0,i.eventManager.poniterState="up"};t.globalEventListeners.push({name:"mouseup",env:"document",callback:l}),bu.addEventListener("mouseup",l)}(this)}}function lP(t){const{scroll:e}=t.stateManager,{verticalBarPos:i}=e;t.taskListTableInstance.stateManager.setScrollTop(i,void 0,!1)}class aP{friction;lastTime;speedX;speedY;runingId;stopped;scrollHandle;constructor(){}setScrollHandle(t){this.scrollHandle=t}startInertia(t,e,i){this.stopped=!1,this.lastTime=Date.now(),this.speedX=t,this.speedY=e,this.friction=i,this.runingId||(this.runingId=requestAnimationFrame(this.inertia.bind(this)))}inertia(){if(this.stopped)return;const t=Date.now(),e=t-this.lastTime;let i=!0;const o=Math.pow(this.friction,e/16),n=o*this.speedX,r=o*this.speedY;let s=0,l=0;Math.abs(n)>.05&&(i=!1,s=(this.speedX+n)/2*e),Math.abs(r)>.05&&(i=!1,l=(this.speedY+r)/2*e),this.scrollHandle?.(s,l),i?this.runingId=null:(this.lastTime=t,this.speedX=n,this.speedY=r,this.runingId=requestAnimationFrame(this.inertia.bind(this)))}endInertia(){cancelAnimationFrame(this.runingId),this.runingId=null,this.stopped=!0}isInertiaScrolling(){return!!this.runingId}}class hP{_gantt;scroll;fastScrolling;interactionState=e.default;moveTaskBar;hoverTaskBar;resizeTaskBar;selectedTaskBar;resizeTableWidth;selectedDenpendencyLink;creatingDenpendencyLink;resetInteractionState=tP((()=>{this.updateInteractionState(e.default)}),100);constructor(t){this._gantt=t,this.scroll={horizontalBarPos:0,verticalBarPos:0},this.moveTaskBar={targetStartX:null,deltaX:0,startOffsetY:null,startX:null,startY:null,moving:!1,target:null,moveTaskBarXSpeed:0,moveTaskBarXInertia:new aP},this.hoverTaskBar={targetStartX:null,startX:null,target:null},this.selectedTaskBar={target:null},this.resizeTaskBar={startOffsetY:null,targetStartX:null,startX:null,startY:null,target:null,resizing:!1,onIconName:""},this.resizeTableWidth={lastX:null,resizing:!1},this.selectedDenpendencyLink={link:null},this.creatingDenpendencyLink={startClickedPoint:null,startX:null,startY:null,startOffsetY:null,targetStartX:null,creating:!1,secondTaskBarNode:null},this.updateVerticalScrollBar=this.updateVerticalScrollBar.bind(this),this.updateHorizontalScrollBar=this.updateHorizontalScrollBar.bind(this),function(t){t.taskListTableInstance&&t.taskListTableInstance?.on("scroll",(e=>{if("vertical"===e.scrollDirection){const{scroll:e}=t.taskListTableInstance.stateManager,{verticalBarPos:i}=e;t.stateManager.setScrollTop(i,!1)}}))}(this._gantt),function(t){t.taskListTableInstance?.on("change_cell_value",(e=>{const{col:i,row:o,rawValue:n,changedValue:r}=e;t._refreshTaskBar(o-t.taskListTableInstance.columnHeaderLevelCount)}))}(this._gantt),function(t){t.taskListTableInstance?.on("change_header_position",(e=>{t.scenegraph.refreshTaskBars();const i=t.stateManager.scroll.horizontalBarPos,o=t.stateManager.scroll.verticalBarPos;t.scenegraph.setX(-i),t.scenegraph.setY(-o)}))}(this._gantt),function(t){t.taskListTableInstance?.on("tree_hierarchy_state_change",(e=>{t._syncPropsFromTable(),t.verticalSplitResizeLine.style.height=t.drawHeight+"px",t.scenegraph.refreshTaskBarsAndGrid();const i=t.stateManager.scroll.horizontalBarPos,o=t.stateManager.scroll.verticalBarPos;t.scenegraph.setX(-i),t.scenegraph.setY(-o)}))}(this._gantt),function(t){t.taskListTableInstance?.on("after_sort",(e=>{t.scenegraph.refreshTaskBars();const i=t.stateManager.scroll.horizontalBarPos,o=t.stateManager.scroll.verticalBarPos;t.scenegraph.setX(-i),t.scenegraph.setY(-o)}))}(this._gantt)}setScrollTop(t,e=!0){const i=this._gantt.getAllRowsHeight();t=Math.max(0,Math.min(t,i-this._gantt.scenegraph.height)),t=Math.ceil(t);const n=this.scroll.verticalBarPos;this.scroll.verticalBarPos=t,Q(this.scroll.verticalBarPos)&&!isNaN(this.scroll.verticalBarPos)||(this.scroll.verticalBarPos=0),this._gantt.scenegraph.setY(-t);const r=t/(i-this._gantt.scenegraph.height);this._gantt.scenegraph.scrollbarComponent.updateVerticalScrollBarPos(r),n!==t&&e&&(lP(this._gantt),this._gantt.fireListeners(o.SCROLL,{scrollTop:this.scroll.verticalBarPos,scrollLeft:this.scroll.horizontalBarPos,scrollDirection:"vertical",scrollRatioY:r}))}get scrollLeft(){return this.scroll.horizontalBarPos}get scrollTop(){return this.scroll.verticalBarPos}setScrollLeft(t,e=!0){const i=this._gantt._getAllColsWidth();t=Math.max(0,Math.min(t,i-this._gantt.scenegraph.width)),t=Math.ceil(t);const n=this.scroll.horizontalBarPos;this.scroll.horizontalBarPos=t,Q(this.scroll.horizontalBarPos)&&!isNaN(this.scroll.horizontalBarPos)||(this.scroll.horizontalBarPos=0),this._gantt.scenegraph.setX(-t);const r=t/(i-this._gantt.scenegraph.width);this._gantt.scenegraph.scrollbarComponent.updateHorizontalScrollBarPos(r),n!==t&&e&&this._gantt.fireListeners(o.SCROLL,{scrollTop:this.scroll.verticalBarPos,scrollLeft:this.scroll.horizontalBarPos,scrollDirection:"horizontal",scrollRatioX:r})}updateInteractionState(t){if(this.interactionState===t)return;const i=this.interactionState;this.interactionState=t,i===e.scrolling&&e.default}updateVerticalScrollBar(t){const e=this._gantt.getAllRowsHeight();this.scroll.verticalBarPos,this.scroll.verticalBarPos=Math.ceil(t*(e-this._gantt.scenegraph.height)),Q(this.scroll.verticalBarPos)&&!isNaN(this.scroll.verticalBarPos)||(this.scroll.verticalBarPos=0),this._gantt.scenegraph.setY(-this.scroll.verticalBarPos,1===t),lP(this._gantt),this._gantt.fireListeners(o.SCROLL,{scrollTop:this.scroll.verticalBarPos,scrollLeft:this.scroll.horizontalBarPos,scrollDirection:"vertical",scrollRatioY:t})}updateHorizontalScrollBar(t){const e=this._gantt._getAllColsWidth();this.scroll.horizontalBarPos,this.scroll.horizontalBarPos=Math.ceil(t*(e-this._gantt.scenegraph.width)),Q(this.scroll.horizontalBarPos)&&!isNaN(this.scroll.horizontalBarPos)||(this.scroll.horizontalBarPos=0),this._gantt.scenegraph.setX(-this.scroll.horizontalBarPos,1===t),this._gantt.fireListeners(o.SCROLL,{scrollTop:this.scroll.verticalBarPos,scrollLeft:this.scroll.horizontalBarPos,scrollDirection:"horizontal",scrollRatioY:t})}startMoveTaskBar(t,e,i,o){"task-bar-hover-shadow"===t.name&&(t=t.parent),this.moveTaskBar.moving=!0,this.moveTaskBar.target=t,this.moveTaskBar.targetStartX=t.attribute.x,this.moveTaskBar.startX=e,this.moveTaskBar.startY=i,this.moveTaskBar.startOffsetY=o}isMoveingTaskBar(){return this.moveTaskBar.moving}endMoveTaskBar(t){this.moveTaskBar.moveTaskBarXInertia.isInertiaScrolling()&&this.moveTaskBar.moveTaskBarXInertia.endInertia();const e=yC(this.moveTaskBar.startOffsetY,this._gantt),i=this.moveTaskBar.deltaX,n=Math.round(i/this._gantt.parsedOptions.colWidthPerDay),r=n*this._gantt.parsedOptions.colWidthPerDay,s=this.moveTaskBar.targetStartX+r,l=this._gantt.stateManager.moveTaskBar.target;if(cP(e,l,s-l.attribute.x,null,this),Math.abs(n)>=1){const t=yC(this.moveTaskBar.startOffsetY,this._gantt),e=this._gantt.getRecordByIndex(t),i=e[this._gantt.parsedOptions.startDateField],r=e[this._gantt.parsedOptions.endDateField];if(this._gantt._updateDateToTaskRecord("move",n,t),this._gantt.hasListeners(o.CHANGE_DATE_RANGE)){const e=this._gantt.getRecordByIndex(t);this._gantt.fireListeners(o.CHANGE_DATE_RANGE,{startDate:e[this._gantt.parsedOptions.startDateField],endDate:e[this._gantt.parsedOptions.endDateField],oldStartDate:i,oldEndDate:r,index:t,record:e})}}this._gantt.scenegraph.updateNextFrame(),this.moveTaskBar.moving=!1,this.moveTaskBar.target=null,this.moveTaskBar.deltaX=0,this.moveTaskBar.moveTaskBarXSpeed=0}dealTaskBarMove(t){const e=this.moveTaskBar.target,i=yC(this.moveTaskBar.startOffsetY,this._gantt),o=this._gantt.eventManager.lastDragPointerXYOnWindow.x,n=t.x-o;this.moveTaskBar.deltaX+=n,cP(i,e,n,null,this),e.attribute.x<=this._gantt.stateManager.scrollLeft&&n<0?(this.moveTaskBar.moveTaskBarXSpeed=-this._gantt.parsedOptions.colWidthPerDay/100,this.moveTaskBar.moveTaskBarXInertia.startInertia(this.moveTaskBar.moveTaskBarXSpeed,0,1),this.moveTaskBar.moveTaskBarXInertia.setScrollHandle(((t,o)=>{this.moveTaskBar.deltaX+=t,cP(i,e,t,null,this),this._gantt.stateManager.setScrollLeft(e.attribute.x),0===this._gantt.stateManager.scrollLeft&&this.moveTaskBar.moveTaskBarXInertia.endInertia()}))):e.attribute.x+e.attribute.width>=this._gantt.stateManager.scrollLeft+this._gantt.tableNoFrameWidth&&n>0?(this.moveTaskBar.moveTaskBarXSpeed=this._gantt.parsedOptions.colWidthPerDay/100,this.moveTaskBar.moveTaskBarXInertia.startInertia(this.moveTaskBar.moveTaskBarXSpeed,0,1),this.moveTaskBar.moveTaskBarXInertia.setScrollHandle(((t,o)=>{this.moveTaskBar.deltaX+=t,cP(i,e,t,null,this),this._gantt.stateManager.setScrollLeft(e.attribute.x+e.attribute.width-this._gantt.tableNoFrameWidth),this._gantt.stateManager.scrollLeft===this._gantt._getAllColsWidth()-this._gantt.tableNoFrameWidth&&this.moveTaskBar.moveTaskBarXInertia.endInertia()}))):this.moveTaskBar.moveTaskBarXInertia.isInertiaScrolling()?this.moveTaskBar.moveTaskBarXInertia.endInertia():this.moveTaskBar.moveTaskBarXSpeed=0,this._gantt.scenegraph.updateNextFrame()}startResizeTaskBar(t,e,i,o,n){this.resizeTaskBar.onIconName=n,this.resizeTaskBar.resizing=!0,this.resizeTaskBar.target=t,this.resizeTaskBar.targetStartX=t.attribute.x,this.resizeTaskBar.startX=e,this.resizeTaskBar.startY=i,this.resizeTaskBar.startOffsetY=o}isResizingTaskBar(){return this.resizeTaskBar.resizing}endResizeTaskBar(t){const e=this._gantt.stateManager.resizeTaskBar.onIconName,i=t-this.resizeTaskBar.startX;if(Math.abs(i)>=1){let t=Math.round(i/this._gantt.parsedOptions.colWidthPerDay);t="left"===e?-t:t;const n=this._gantt.stateManager.resizeTaskBar.target,r=this._gantt.stateManager.resizeTaskBar.target.barRect,s=this._gantt.stateManager.resizeTaskBar.target.progressRect,l=yC(this.resizeTaskBar.startOffsetY,this._gantt),a=this._gantt.getRecordByIndex(l),h=a[this._gantt.parsedOptions.startDateField],d=a[this._gantt.parsedOptions.endDateField],{taskDays:c,progress:u}=this._gantt.getTaskInfoByTaskListIndex(l);t<0&&c+t<=0&&(t=1-c);const g=("left"===e?-t:t)*this._gantt.parsedOptions.colWidthPerDay,p=this.resizeTaskBar.targetStartX+g,f=this._gantt.parsedOptions.colWidthPerDay*(c+t);if("left"===e?(cP(l,n,p-n.attribute.x,f,this),r?.setAttribute("width",n.attribute.width),s?.setAttribute("width",u/100*n.attribute.width),this._gantt._updateDateToTaskRecord("start-move",-t,l)):"right"===e&&(cP(l,n,0,f,this),r?.setAttribute("width",n.attribute.width),s?.setAttribute("width",u/100*n.attribute.width),this._gantt._updateDateToTaskRecord("end-move",t,l)),this.showTaskBarHover(),dP(this._gantt,n,l),this.resizeTaskBar.resizing=!1,this.resizeTaskBar.target=null,Math.abs(t)>=1&&this._gantt.hasListeners(o.CHANGE_DATE_RANGE)){const t=this._gantt.getRecordByIndex(l);this._gantt.fireListeners(o.CHANGE_DATE_RANGE,{startDate:t[this._gantt.parsedOptions.startDateField],endDate:t[this._gantt.parsedOptions.endDateField],oldStartDate:h,oldEndDate:d,index:l,record:t})}this._gantt.scenegraph.updateNextFrame()}}dealTaskBarResize(t){const e=this._gantt.eventManager.lastDragPointerXYOnWindow.x,i=t.x-e,o=this._gantt.stateManager.resizeTaskBar.target,n=o.barRect,r=o.progressRect,s=o.textLabel,l=this._gantt.parsedOptions.progressField,a=yC(this.resizeTaskBar.startOffsetY,this._gantt),h=this._gantt.getRecordByIndex(a)[l];let d="left"===this._gantt.stateManager.resizeTaskBar.onIconName?-i:i,c=o.attribute.width+d;d<0&&c<=this._gantt.parsedOptions.colWidthPerDay&&(d=this._gantt.parsedOptions.colWidthPerDay-o.attribute.width,c+=d),cP(a,o,"left"===this._gantt.stateManager.resizeTaskBar.onIconName?-d:0,c,this),n?.setAttribute("width",o.attribute.width),r?.setAttribute("width",h/100*o.attribute.width),s?.setAttribute("maxLineWidth",c-20),this.showTaskBarHover(),dP(this._gantt,o,a),this._gantt.scenegraph.updateNextFrame()}startCreateDependencyLine(t,e,i,o,n){this.creatingDenpendencyLink.creating=!0,this.creatingDenpendencyLink.startClickedPoint=t,this.creatingDenpendencyLink.startX=e,this.creatingDenpendencyLink.startY=i,this.creatingDenpendencyLink.startOffsetY=o,this.creatingDenpendencyLink.firstTaskBarPosition=n,this.highlightLinkPointNode(t)}isCreatingDependencyLine(){return this.creatingDenpendencyLink.creating}endCreateDependencyLine(t){const e=this._gantt.parsedOptions.taskKeyField,o=yC(this.creatingDenpendencyLink.startOffsetY,this._gantt),n=yC(t,this._gantt),r={linkedFromTaskKey:this._gantt.getRecordByIndex(o)[e],linkedToTaskKey:this._gantt.getRecordByIndex(n)[e],type:"left"===this.creatingDenpendencyLink.firstTaskBarPosition&&"left"===this.creatingDenpendencyLink.secondTaskBarPosition?i.StartToStart:"right"===this.creatingDenpendencyLink.firstTaskBarPosition&&"left"===this.creatingDenpendencyLink.secondTaskBarPosition?i.FinishToStart:"right"===this.creatingDenpendencyLink.firstTaskBarPosition&&"right"===this.creatingDenpendencyLink.secondTaskBarPosition?i.FinishToFinish:i.StartToFinish};return this._gantt.addLink(r),this.hideTaskBarSelectedBorder(),this._gantt.scenegraph.updateNextFrame(),this.creatingDenpendencyLink.creating=!1,r}dealCreateDependencyLine(t){const e=this.creatingDenpendencyLink.startX,i=this.creatingDenpendencyLink.startY,o=t.x-e,n=t.y-i,r=this.creatingDenpendencyLink.startClickedPoint,s=r.attribute.x+r.attribute.width/2,l=r.attribute.y+r.attribute.height/2;this._gantt.scenegraph.taskBar.updateCreatingDependencyLine(s,l,s+o,l+n),this._gantt.scenegraph.updateNextFrame()}startResizeTableWidth(t){this.resizeTableWidth.resizing=!0,this.resizeTableWidth.lastX=t.pageX}isResizingTableWidth(){return this.resizeTableWidth.resizing}endResizeTableWidth(){this.resizeTableWidth.resizing=!1}dealResizeTableWidth(t){if(!this.resizeTableWidth.resizing)return;const e=t.pageX-this.resizeTableWidth.lastX;if(Math.abs(e)>=1){let i=this._gantt.taskTableWidth+e;const o=Math.min(this._gantt.taskListTableInstance.getAllColsWidth()+this._gantt.parsedOptions.outerFrameStyle.borderLineWidth,this._gantt.options.taskListTable.maxTableWidth??1e5),n=Math.max(this._gantt.parsedOptions.outerFrameStyle.borderLineWidth,this._gantt.options.taskListTable.minTableWidth??0);e>0&&i>o&&(i=o),e<0&&i<n&&(i=n),this._gantt.taskTableWidth=i,this._gantt.element.style.left=this._gantt.taskTableWidth?`${this._gantt.taskTableWidth}px`:"0px",this._gantt.verticalSplitResizeLine.style.left=this._gantt.taskTableWidth?this._gantt.taskTableWidth-7+"px":"0px",this._gantt._resize(),this.resizeTableWidth.lastX=t.pageX}}showTaskBarHover(){const t=this._gantt.stateManager.hoverTaskBar.target,e=t.attribute.x,i=t.attribute.y,o=t.attribute.width,n=t.attribute.height;this._gantt.scenegraph.taskBar.showHoverBar(e,i,o,n,t),this._gantt.scenegraph.updateNextFrame()}hideTaskBarHover(t){this._gantt.stateManager.hoverTaskBar.target=null,this._gantt.scenegraph.taskBar.hideHoverBar(),this._gantt.scenegraph.updateNextFrame()}showTaskBarSelectedBorder(){const t=this._gantt.parsedOptions.dependencyLinkCreatable,e=this._gantt.stateManager.selectedTaskBar.target,i=e.attribute.x,o=e.attribute.y,n=e.attribute.width,r=e.attribute.height;this._gantt.scenegraph.taskBar.createSelectedBorder(i,o,n,r,e,t),this._gantt.scenegraph.updateNextFrame()}hideTaskBarSelectedBorder(){this._gantt.stateManager.selectedTaskBar.target=null,this._gantt.scenegraph.taskBar.removeSelectedBorder(),this._gantt.scenegraph.updateNextFrame()}showSecondTaskBarSelectedBorder(){const t=this._gantt.stateManager.creatingDenpendencyLink.secondTaskBarNode,e=t.attribute.x,i=t.attribute.y,o=t.attribute.width,n=t.attribute.height;this._gantt.scenegraph.taskBar.createSelectedBorder(e,i,o,n,t,!0),this._gantt.scenegraph.updateNextFrame()}hideSecondTaskBarSelectedBorder(){this._gantt.stateManager.creatingDenpendencyLink.secondTaskBarNode=null,this._gantt.scenegraph.taskBar.removeSecondSelectedBorder(),this._gantt.scenegraph.updateNextFrame()}showDependencyLinkSelectedLine(){const t=this._gantt.stateManager.selectedDenpendencyLink.link;this._gantt.scenegraph.dependencyLink.createSelectedLinkLine(t);const{taskKeyField:e,dependencyLinks:i}=this._gantt.parsedOptions,{linkedToTaskKey:o,linkedFromTaskKey:n,type:r}=t,s=SC(this._gantt.records,e,o),l=SC(this._gantt.records,e,n),a=this._gantt.getTaskShowIndexByRecordIndex(l.index),h=this._gantt.getTaskShowIndexByRecordIndex(s.index),d=this._gantt.scenegraph.taskBar.getTaskBarNodeByIndex(a);this._gantt.scenegraph.taskBar.createSelectedBorder(d.attribute.x,d.attribute.y,d.attribute.width,d.attribute.height,d,!1);const c=this._gantt.scenegraph.taskBar.getTaskBarNodeByIndex(h);this._gantt.scenegraph.taskBar.createSelectedBorder(c.attribute.x,c.attribute.y,c.attribute.width,c.attribute.height,c,!1),this._gantt.scenegraph.updateNextFrame()}hideDependencyLinkSelectedLine(){this._gantt.stateManager.selectedDenpendencyLink.link=null,this._gantt.scenegraph.dependencyLink.removeSelectedLinkLine(),this._gantt.scenegraph.taskBar.removeSelectedBorder(),this._gantt.scenegraph.updateNextFrame()}highlightLinkPointNode(t){if(t?.children.length>0){const e=t.children[0];e.setAttribute("fill",this._gantt.parsedOptions.dependencyLinkLineCreatingPointStyle.fillColor),e.setAttribute("stroke",this._gantt.parsedOptions.dependencyLinkLineCreatingPointStyle.strokeColor),e.setAttribute("radius",this._gantt.parsedOptions.dependencyLinkLineCreatingPointStyle.radius),e.setAttribute("lineWidth",this._gantt.parsedOptions.dependencyLinkLineCreatingPointStyle.strokeWidth),this._gantt.scenegraph.updateNextFrame()}}unhighlightLinkPointNode(t){if(t?.children.length>0){const e=t.children[0];e.setAttribute("fill",this._gantt.parsedOptions.dependencyLinkLineCreatePointStyle.fillColor),e.setAttribute("stroke",this._gantt.parsedOptions.dependencyLinkLineCreatePointStyle.strokeColor),e.setAttribute("radius",this._gantt.parsedOptions.dependencyLinkLineCreatePointStyle.radius),e.setAttribute("lineWidth",this._gantt.parsedOptions.dependencyLinkLineCreatePointStyle.strokeWidth),this._gantt.scenegraph.updateNextFrame()}}}function dP(t,e,i){const o=t.parsedOptions.taskBarCustomLayout;if(o){let n;if("function"==typeof o){const{startDate:r,endDate:s,taskDays:l,progress:a,taskRecord:h}=t.getTaskInfoByTaskListIndex(i);n=o({width:e.attribute.width,height:e.attribute.height,index:i,startDate:r,endDate:s,taskDays:l,progress:a,taskRecord:h,ganttInstance:t})}else n=o;if(n){const t=n.rootContainer;t.name="task-bar-custom-render";const i=e.children.findIndex((t=>"task-bar-custom-render"===t.name)),o=e.children[i];e.removeChild(o),e.insertInto(t,i)}}}function cP(t,e,i,o,n){const r=n._gantt.getRecordByIndex(t);i&&e.setAttribute("x",e.attribute.x+i),o&&e.setAttribute("width",o);const s=r.vtable_gantt_linkedTo,l=r.vtable_gantt_linkedFrom;for(let i=0;i<s?.length;i++){const o=s[i],r=o.vtable_gantt_linkLineNode,l=o.vtable_gantt_linkArrowNode,{linkedToTaskKey:a,linkedFromTaskKey:h,type:d}=o,{taskKeyField:c,minDate:u}=n._gantt.parsedOptions,g=SC(n._gantt.records,c,h),{startDate:p,endDate:f}=n._gantt.getTaskInfoByTaskListIndex(t),{startDate:v,endDate:m}=n._gantt.getTaskInfoByTaskListIndex(g.index),{linePoints:b,arrowPoints:y}=zC(d,v,m,g.index,p,f,t,u,n._gantt.parsedOptions.rowHeight,n._gantt.parsedOptions.colWidthPerDay,null,e);r.setAttribute("points",b),l.setAttribute("points",y)}for(let i=0;i<l?.length;i++){const o=l[i],r=o.vtable_gantt_linkLineNode,s=o.vtable_gantt_linkArrowNode,{linkedToTaskKey:a,linkedFromTaskKey:h,type:d}=o,{taskKeyField:c,minDate:u}=n._gantt.parsedOptions,g=SC(n._gantt.records,c,a),{startDate:p,endDate:f}=n._gantt.getTaskInfoByTaskListIndex(t),{startDate:v,endDate:m}=n._gantt.getTaskInfoByTaskListIndex(g.index),{linePoints:b,arrowPoints:y}=zC(d,p,f,t,v,m,g.index,u,n._gantt.parsedOptions.rowHeight,n._gantt.parsedOptions.colWidthPerDay,e,null);r.setAttribute("points",b),s.setAttribute("points",y)}}let uP=1,gP=class{listenersData={listeners:{},listenerData:{}};on(t,e){const i=this.listenersData.listeners[t]||(this.listenersData.listeners[t]=[]);i.push(e);const o=uP++;return this.listenersData.listenerData[o]={type:t,listener:e,remove:()=>{delete this.listenersData.listenerData[o];const n=i.indexOf(e);i.splice(n,1),this.listenersData.listeners[t].length||delete this.listenersData.listeners[t]}},o}off(t,e){if(e){const i=t;this.removeEventListener(i,e)}else{const e=t;if(!this.listenersData)return;this.listenersData.listenerData[e]?.remove()}}addEventListener(t,e,i){this.on(t,e)}removeEventListener(t,e){if(this.listenersData)for(const i in this.listenersData.listenerData){const o=this.listenersData.listenerData[i];o.type===t&&o.listener===e&&this.off(i)}}hasListeners(t){return!!this.listenersData&&!!this.listenersData.listeners[t]}fireListeners(t,e){if(!this.listenersData)return[];const i=this.listenersData.listeners[t];return i?i.map((t=>t.call(this,e))).filter((t=>Q(t))):[]}release(){delete this.listenersData}};class pP{records;minDate;maxDate;_gantt;constructor(t){this._gantt=t,this.records=t.records,this.minDate=t.parsedOptions.minDate,this.maxDate=t.parsedOptions.maxDate,this.processRecords()}processRecords(){const t=!this.minDate,e=!this.maxDate;let i=Number.MAX_SAFE_INTEGER,o=Number.MIN_SAFE_INTEGER;if(t||e){for(let n=0;n<this.records.length;n++){const r=this.records[n];if(t){const t=fC(r[this._gantt.parsedOptions.startDateField]);i=Math.min(i,t.getTime())}if(e){const t=fC(r[this._gantt.parsedOptions.endDateField]);o=Math.max(o,t.getTime())}}t&&(this.minDate=fC(i)),e&&(this.maxDate=fC(o)),this._gantt.parsedOptions.minDate=this.minDate,this._gantt.parsedOptions.maxDate=this.maxDate,this._gantt.parsedOptions._minDateTime=this._gantt.parsedOptions.minDate.getTime(),this._gantt.parsedOptions._maxDateTime=this._gantt.parsedOptions.maxDate.getTime()}}}var fP=Object.freeze({__proto__:null,formatDate:aC,getTodayNearDay:function(t,e){const i=(new Date).getTime(),o=new Date(i+864e5*t);if(e){const t=o.getFullYear().toString(),i=(o.getMonth()+1).toString().padStart(2,"0"),n=o.getDate().toString().padStart(2,"0");return e=(e=(e=e.replace("yyyy",t)).replace("mm",i)).replace("dd",n)}return o},getWeekNumber:pC,getWeekday:function(t,e="long"){const i=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],o=new Date(t);return"short"===e?i[o.getDay()].substr(0,3):"long"===e?i[o.getDay()]:'Invalid format specified. Please use "short" or "long".'}}),vP=Object.freeze({__proto__:null,Arc:Sc,Area:xc,Circle:Ih,Group:fs,Image:dc,Line:ic,Path:yc,Rect:rc,RichText:vc,Text:Nh}),mP=Object.freeze({__proto__:null,CustomLayout:JL,register:mk,themes:Rx});t.Gantt=class extends gP{options;container;tableNoFrameWidth;tableNoFrameHeight;tableX;tableY;scenegraph;stateManager;eventManager;taskListTableInstance;canvas;element;verticalSplitResizeLine;horizontalSplitLine;context;timeLineHeaderLevel;itemCount;drawHeight;headerHeight;gridHeight;parsedOptions={};taskTableWidth;taskTableColumns;records;data;constructor(t,i){super(),this.container=t,this.options=i,this.taskTableWidth="number"==typeof i?.taskListTable?.tableWidth?i?.taskListTable?.tableWidth:-1,this.taskTableColumns=i?.taskListTable?.columns??[],this.records=i?.records??[],this._sortScales(),CC(this),this.data=new pP(this),this._generateTimeLineDateMap(),this.timeLineHeaderLevel=this.parsedOptions.sortedTimelineScales.length,this.element=function(t,e="vtable-gantt"){const i=document.createElement("div");i.setAttribute("tabindex","0"),i.classList.add(e),i.style.outline="none",i.style.margin=`${t.top}px ${t.right}px ${t.bottom}px ${t.left}px`;const o=(i.offsetWidth||i.parentElement?.offsetWidth||1)-1,n=(i.offsetHeight||i.parentElement?.offsetHeight||1)-1;return i.style.width=o&&o-t.left-t.right+"px"||"0px",i.style.height=n&&n-t.top-t.bottom+"px"||"0px",i}({top:0,right:0,left:0,bottom:0},"vtable-gantt"),this.element.style.left=this.taskTableWidth?`${this.taskTableWidth}px`:"0px",this.canvas=document.createElement("canvas"),this.element.appendChild(this.canvas),this.context=this.canvas.getContext("2d"),t?(t.appendChild(this.element),this._updateSize()):this._updateSize(),this._generateListTable(),this._syncPropsFromTable(),function(t){if(t.taskListTableInstance){t.verticalSplitResizeLine=document.createElement("div"),t.verticalSplitResizeLine.style.position="absolute",t.verticalSplitResizeLine.style.top=t.tableY+"px",t.verticalSplitResizeLine.style.left=(t.taskTableWidth?t.taskTableWidth-7+t.parsedOptions.verticalSplitLine.lineWidth/2:0)+"px",t.verticalSplitResizeLine.style.width="14px",t.verticalSplitResizeLine.style.height=t.drawHeight+"px",t.verticalSplitResizeLine.style.backgroundColor="rgba(0,0,0,0)",t.verticalSplitResizeLine.style.zIndex="100",t.parsedOptions.verticalSplitLineMoveable&&(t.verticalSplitResizeLine.style.cursor="col-resize"),t.verticalSplitResizeLine.style.userSelect="none",t.verticalSplitResizeLine.style.opacity="1";const e=document.createElement("div");if(e.style.position="absolute",e.style.top="0px",e.style.left=(14-t.parsedOptions.verticalSplitLine.lineWidth)/2+"px",e.style.width=t.parsedOptions.verticalSplitLine.lineWidth+"px",e.style.height="100%",e.style.backgroundColor=t.parsedOptions.verticalSplitLine.lineColor,e.style.zIndex="100",e.style.userSelect="none",e.style.pointerEvents="none",e.style.transition="background-color 0.3s",t.verticalSplitResizeLine.appendChild(e),t.parsedOptions.verticalSplitLineHighlight){const e=document.createElement("div");e.style.position="absolute",e.style.top="0px",e.style.left=(14-t.parsedOptions.verticalSplitLineHighlight.lineWidth??2)/2+"px",e.style.width=(t.parsedOptions.verticalSplitLineHighlight.lineWidth??2)+"px",e.style.height="100%",e.style.backgroundColor=t.parsedOptions.verticalSplitLineHighlight.lineColor,e.style.zIndex="100",e.style.cursor="col-resize",e.style.userSelect="none",e.style.pointerEvents="none",e.style.opacity="0",e.style.transition="background-color 0.3s",t.verticalSplitResizeLine.appendChild(e)}t.container.appendChild(t.verticalSplitResizeLine)}}(this),this.scenegraph=new class{dateStepWidth;rowHeight;_scales;timelineHeader;grid;dependencyLink;taskBar;_gantt;tableGroup;scrollbarComponent;markLine;frameBorder;taskCreationButton;stage;tableGroupWidth;tableGroupHeight;constructor(t){let e,i;this._gantt=t,this.tableGroupWidth=t.tableNoFrameWidth,this.tableGroupHeight=Math.min(t.tableNoFrameHeight,t.drawHeight),"node"===rC.mode||(bu.setEnv("browser"),e=t.canvas.width,i=t.canvas.height),this.stage=Hu({canvas:t.canvas,width:e,height:i,disableDirtyBounds:!1,background:t.parsedOptions.underlayBackgroundColor,enableLayout:!0,autoRender:!1,context:{appName:"vtable"},pluginList:["poptipForText"]}),this.stage.gantt=this._gantt,this.stage.table=this._gantt,this.stage.defaultLayer.setTheme({group:{boundsPadding:0,strokeBoundsBuffer:0,lineJoin:"round"},text:{ignoreBuf:!0}}),this.initSceneGraph()}initSceneGraph(){const t=this;t.tableGroup=new fs({x:t._gantt.tableX,y:t._gantt.tableY,width:this.tableGroupWidth,height:this.tableGroupHeight,clip:!0,pickable:!1}),t.stage.defaultLayer.add(t.tableGroup),t.tableGroup.name="table",t.timelineHeader=new AC(t),t.grid=new nC(t),t.dependencyLink=new FC(t),t.taskBar=new TC(t),t.markLine=new kC(t),t.frameBorder=new LC(t),t.scrollbarComponent=new sC(t._gantt),t.stage.defaultLayer.addChild(t.scrollbarComponent.hScrollBar),t.stage.defaultLayer.addChild(t.scrollbarComponent.vScrollBar)}afterCreateSceneGraph(){this.scrollbarComponent.updateScrollBar(),function(t){const i=t._gantt,o=i.stateManager,n=i.scenegraph;n.scrollbarComponent.vScrollBar.addEventListener("pointerover",(t=>{n.scrollbarComponent.showVerticalScrollBar()})),n.scrollbarComponent.hScrollBar.addEventListener("pointerover",(t=>{n.scrollbarComponent.showHorizontalScrollBar()})),n.scrollbarComponent.vScrollBar.addEventListener("pointerout",(t=>{o.interactionState!==e.scrolling&&n.scrollbarComponent.hideVerticalScrollBar()})),n.scrollbarComponent.hScrollBar.addEventListener("pointerout",(t=>{o.interactionState!==e.scrolling&&n.scrollbarComponent.hideHorizontalScrollBar()})),n.scrollbarComponent.vScrollBar.addEventListener("pointermove",(t=>{t.stopPropagation()})),n.scrollbarComponent.vScrollBar.addEventListener("scrollDown",(t=>{n._gantt.eventManager.isDown=!0})),n.scrollbarComponent.vScrollBar.addEventListener("pointerup",(()=>{n._gantt.eventManager.isDraging=!1,o.interactionState===e.scrolling&&o.updateInteractionState(e.default)})),n.scrollbarComponent.vScrollBar.addEventListener("pointerupoutside",(()=>{o.interactionState===e.scrolling&&o.updateInteractionState(e.default)})),n.scrollbarComponent.vScrollBar.addEventListener("scrollUp",(t=>{n._gantt.eventManager.isDraging=!1})),n.scrollbarComponent.hScrollBar.addEventListener("pointermove",(t=>{t.stopPropagation()})),n.scrollbarComponent.hScrollBar.addEventListener("pointerdown",(t=>{t.stopPropagation()})),n.scrollbarComponent.hScrollBar.addEventListener("scrollDown",(t=>{n._gantt.eventManager.isDown=!0,o.interactionState!==e.scrolling&&o.updateInteractionState(e.scrolling)})),n.scrollbarComponent.hScrollBar.addEventListener("pointerup",(()=>{o.interactionState===e.scrolling&&o.updateInteractionState(e.default)})),n.scrollbarComponent.hScrollBar.addEventListener("pointerupoutside",(()=>{o.interactionState===e.scrolling&&o.updateInteractionState(e.default)})),n.scrollbarComponent.hScrollBar.addEventListener("scrollUp",(t=>{n._gantt.eventManager.isDraging=!1}));const r=lC(o.updateVerticalScrollBar,20),s=lC(o.updateHorizontalScrollBar,20);n.scrollbarComponent.vScrollBar.addEventListener("scrollDrag",(t=>{n._gantt.eventManager.isDown&&(n._gantt.eventManager.isDraging=!0),o.interactionState!==e.scrolling&&o.updateInteractionState(e.scrolling);const i=t.detail.value[0]/(1-t.detail.value[1]+t.detail.value[0]);r(i,t)})),n.scrollbarComponent.hScrollBar.addEventListener("scrollDrag",(t=>{n._gantt.eventManager.isDown&&(n._gantt.eventManager.isDraging=!0),o.fastScrolling=!0,o.interactionState!==e.scrolling&&o.updateInteractionState(e.scrolling);const i=t.detail.value[0]/(1-t.detail.value[1]+t.detail.value[0]);s(i)}))}(this._gantt.eventManager)}refreshAll(){this.tableGroupHeight=Math.min(this._gantt.tableNoFrameHeight,this._gantt.drawHeight),this.tableGroup.setAttribute("height",this.tableGroupHeight),this.timelineHeader.refresh(),this.grid.refresh(),this.taskBar.refresh(),this.markLine.refresh(),this.frameBorder.resize(),this.scrollbarComponent.updateScrollBar(),this.updateNextFrame()}refreshTaskBars(){this.dependencyLink.refresh(),this.taskBar.refresh(),this.updateNextFrame()}refreshTaskBarsAndGrid(){this.tableGroupHeight=Math.min(this._gantt.tableNoFrameHeight,this._gantt.drawHeight),this.tableGroup.setAttribute("height",this.tableGroupHeight),this.grid.refresh(),this.taskBar.refresh(),this.markLine.refresh(),this.frameBorder.resize(),this.scrollbarComponent.updateScrollBar(),this.updateNextFrame()}updateTableSize(){this.tableGroupHeight=Math.min(this._gantt.tableNoFrameHeight,this._gantt.drawHeight),this.tableGroup.setAttributes({x:this._gantt.tableX,y:this._gantt.tableY,width:this._gantt.tableNoFrameWidth,height:this.tableGroupHeight}),this.grid.resize(),this.taskBar.resize(),this.frameBorder.resize()}renderSceneGraph(){this.stage.render()}updateNextFrame(){this.stage.renderNextFrame()}get width(){return this.tableGroup.attribute?.width??0}get height(){return this.tableGroup.attribute?.height??0}get x(){return this.tableGroup.attribute?.x??0}get y(){return this.tableGroup.attribute?.y??0}setX(t,e=!1){this.timelineHeader.setX(t),this.grid.setX(t),this.taskBar.setX(t),this.dependencyLink.setX(t),this.markLine.setX(t),this.updateNextFrame()}setY(t,e=!1){this.grid.setY(t),this.taskBar.setY(t),this.dependencyLink.setY(t),this.updateNextFrame()}setPixelRatio(t){this.stage.disableDirtyBounds(),this.stage.window.setDpr(t),this.stage.render(),this.stage.enableDirtyBounds()}resize(){this.updateTableSize(),this.scrollbarComponent.updateScrollBar(),this.updateNextFrame()}release(){this.stage.release()}getTaskBarNodeByY(t){yC(t,this._gantt)}showTaskCreationButton(t,e,i,o){this.taskCreationButton||(this.taskCreationButton=new HC(this._gantt.scenegraph)),this.taskCreationButton.show(t,e,this._gantt.parsedOptions.colWidthPerDay,this._gantt.parsedOptions.rowHeight),this.updateNextFrame()}hideTaskCreationButton(){this.taskCreationButton&&(this.taskCreationButton.hide(),this.updateNextFrame())}}(this),this.stateManager=new hP(this),this.eventManager=new sP(this),this.scenegraph.afterCreateSceneGraph(),this._scrollToMarkLine()}renderTaskBarsTable(){this.scenegraph.updateNextFrame()}_updateSize(){let t=0,e=0;if("browser"===rC.mode){const i=this.getElement();let o=0,n=0;if(i.parentElement){const t=i.parentElement.style||window.getComputedStyle(i.parentElement);o=i.parentElement.offsetWidth-parseInt(t.paddingLeft||"0px",10)-parseInt(t.paddingRight||"0px",10),n=i.parentElement.offsetHeight-parseInt(t.paddingTop||"0px",10)-parseInt(t.paddingBottom||"0px",20)}const r=(o??1)-1-this.taskTableWidth,s=(n??1)-1;i.style.width=r&&`${r}px`||"0px",i.style.height=s&&`${s}px`||"0px";const{canvas:l}=this;t=l.parentElement?.offsetWidth??1,e=l.parentElement?.offsetHeight??1,this?.scenegraph?.stage?this.scenegraph.stage.resize(t,e):(l.style.width="",l.style.height="",l.width=t,l.height=e,l.style.width=`${t}px`,l.style.height=`${e}px`)}const i=Math.floor(t-(o=this.parsedOptions.scrollStyle,o?.hoverOn||o?.verticalVisible&&"none"===o?.verticalVisible||!o?.verticalVisible&&"none"===o?.visible?0:o?.width??7));var o;const n=Math.floor(e-function(t){return t?.hoverOn||t?.horizontalVisible&&"none"===t?.horizontalVisible||!t?.horizontalVisible&&"none"===t?.visible?0:t?.width??7}(this.parsedOptions.scrollStyle));if(this.tableNoFrameWidth=t,this.tableNoFrameHeight=Math.floor(e),this.parsedOptions.outerFrameStyle){const t=this.parsedOptions.outerFrameStyle?.borderLineWidth;this.tableX=this.taskTableColumns.length>=1||this.options?.rowSeriesNumber?this.parsedOptions.verticalSplitLine.lineWidth??0:t,this.tableY=t,this.tableNoFrameWidth=Math.min(i-t-this.tableX,this._getAllColsWidth()),this.tableNoFrameHeight=n-2*t}}_generateListTable(){if(this.taskTableColumns.length>=1||this.options?.rowSeriesNumber){const t=this._generateListTableOptions();if(this.taskListTableInstance=new qL(this.container,t),"auto"!==this.options?.taskListTable?.tableWidth&&-1!==this.taskTableWidth||(this.taskTableWidth=this.taskListTableInstance.getAllColsWidth()+this.parsedOptions.outerFrameStyle.borderLineWidth,this.options?.taskListTable?.maxTableWidth&&(this.taskTableWidth=Math.min(this.options?.taskListTable?.maxTableWidth,this.taskTableWidth)),this.options?.taskListTable?.minTableWidth&&(this.taskTableWidth=Math.max(this.options?.taskListTable?.minTableWidth,this.taskTableWidth)),this.element.style.left=this.taskTableWidth?`${this.taskTableWidth}px`:"0px",this.taskListTableInstance.setCanvasSize(this.taskTableWidth,this.tableNoFrameHeight+2*this.parsedOptions.outerFrameStyle.borderLineWidth),this._updateSize()),this.taskListTableInstance.columnHeaderLevelCount>1)if(this.taskListTableInstance.columnHeaderLevelCount===this.parsedOptions.timeLineHeaderRowHeights.length)for(let t=0;t<this.taskListTableInstance.columnHeaderLevelCount;t++)this.taskListTableInstance.setRowHeight(t,this.parsedOptions.timeLineHeaderRowHeights[t]);else{const t=this.getAllHeaderRowsHeight()/this.taskListTableInstance.columnHeaderLevelCount;for(let e=0;e<this.taskListTableInstance.columnHeaderLevelCount;e++)this.taskListTableInstance.setRowHeight(e,t)}}}_generateListTableOptions(){const t={},e=["container","records","rowSeriesNumber","overscrollBehavior","pixelRatio"];for(const i in this.options)e.indexOf(i)>=0&&(t[i]=this.options[i]);for(const e in this.options.taskListTable)t[e]=this.options.taskListTable[e],"columns"===e&&(t[e][t[e].length-1].disableColumnResize=!0);if(this.options.taskListTable?.theme)if(t.theme=this.options.taskListTable?.theme,t.theme.bodyStyle&&!function(t,e){const i=Object.getOwnPropertyDescriptor(t,e);return!(!i||!i.set&&!0!==i.writable)}(t.theme,"bodyStyle")){t.theme=(this.options.taskListTable?.theme).extends((this.options.taskListTable?.theme).getExtendTheme());const e=t.theme.getExtendTheme();t.theme.clearBodyStyleCache(),t.theme.headerStyle?.bgColor||(e.headerStyle?e.headerStyle.bgColor||(e.headerStyle.bgColor=this.parsedOptions.timelineHeaderBackgroundColor):e.headerStyle={bgColor:this.parsedOptions.timelineHeaderBackgroundColor}),e.bodyStyle?e.bodyStyle.frameStyle={borderLineWidth:[this.parsedOptions.horizontalSplitLine?.lineWidth??0,0,0,0],borderColor:this.parsedOptions.horizontalSplitLine?.lineColor}:e.bodyStyle={frameStyle:{borderLineWidth:[this.parsedOptions.horizontalSplitLine?.lineWidth??0,0,0,0],borderColor:this.parsedOptions.horizontalSplitLine?.lineColor}},e.cellInnerBorder=!1,e.frameStyle=Object.assign({},this.parsedOptions.outerFrameStyle,{shadowBlur:0,cornerRadius:[this.parsedOptions.outerFrameStyle?.cornerRadius??0,0,0,this.parsedOptions.outerFrameStyle?.cornerRadius??0],borderLineWidth:[this.parsedOptions.outerFrameStyle?.borderLineWidth??0,0,this.parsedOptions.outerFrameStyle?.borderLineWidth??0,this.parsedOptions.outerFrameStyle?.borderLineWidth??0]}),e.scrollStyle=Object.assign({},this.options.taskListTable?.theme?.scrollStyle,this.parsedOptions.scrollStyle,{verticalVisible:"none"}),e.columnResize=Object.assign({labelColor:"rgba(0,0,0,0)",labelBackgroundFill:"rgba(0,0,0,0)"},e?.columnResize),e.underlayBackgroundColor||(e.underlayBackgroundColor=this.parsedOptions.underlayBackgroundColor)}else t.theme.headerStyle?t.theme.headerStyle.bgColor||(t.theme.headerStyle.bgColor=this.parsedOptions.timelineHeaderBackgroundColor):t.theme.headerStyle={bgColor:this.parsedOptions.timelineHeaderBackgroundColor},t.theme.headerStyle=Object.assign({},Cx.headerStyle,{bgColor:this.parsedOptions.timelineHeaderBackgroundColor},this.options.taskListTable?.theme?.headerStyle),t.theme.bodyStyle=Object.assign({},Cx.bodyStyle,this.options.taskListTable?.theme?.bodyStyle,{frameStyle:{borderLineWidth:[this.parsedOptions.horizontalSplitLine?.lineWidth??0,0,0,0],borderColor:this.parsedOptions.horizontalSplitLine?.lineColor}}),t.theme.cellInnerBorder=!1,t.theme.frameStyle=Object.assign({},this.parsedOptions.outerFrameStyle,{cornerRadius:[this.parsedOptions.outerFrameStyle?.cornerRadius??0,0,0,this.parsedOptions.outerFrameStyle?.cornerRadius??0],borderLineWidth:[this.parsedOptions.outerFrameStyle?.borderLineWidth??0,0,this.parsedOptions.outerFrameStyle?.borderLineWidth??0,this.parsedOptions.outerFrameStyle?.borderLineWidth??0]}),t.theme.scrollStyle=Object.assign({},this.options.taskListTable?.theme?.scrollStyle,this.parsedOptions.scrollStyle,{verticalVisible:"none"}),t.theme.columnResize=Object.assign({labelColor:"rgba(0,0,0,0)",labelBackgroundFill:"rgba(0,0,0,0)"},this.options.taskListTable?.theme?.columnResize),t.theme.underlayBackgroundColor||(t.theme.underlayBackgroundColor=this.parsedOptions.underlayBackgroundColor);else t.theme={scrollStyle:Object.assign({},this.options.taskListTable?.theme?.scrollStyle,this.parsedOptions.scrollStyle,{verticalVisible:"none"}),headerStyle:Object.assign({},Cx.headerStyle,{bgColor:this.parsedOptions.timelineHeaderBackgroundColor},this.options.taskListTable?.theme?.headerStyle),bodyStyle:Object.assign({},Cx.bodyStyle,this.options.taskListTable?.theme?.bodyStyle,{frameStyle:{borderLineWidth:[this.parsedOptions.horizontalSplitLine?.lineWidth??0,0,0,0],borderColor:this.parsedOptions.horizontalSplitLine?.lineColor}}),cellInnerBorder:!1,frameStyle:Object.assign({},this.parsedOptions.outerFrameStyle,{cornerRadius:[this.parsedOptions.outerFrameStyle?.cornerRadius??0,0,0,this.parsedOptions.outerFrameStyle?.cornerRadius??0],borderLineWidth:[this.parsedOptions.outerFrameStyle?.borderLineWidth??0,0,this.parsedOptions.outerFrameStyle?.borderLineWidth??0,this.parsedOptions.outerFrameStyle?.borderLineWidth??0]}),columnResize:Object.assign({labelColor:"rgba(0,0,0,0)",labelBackgroundFill:"rgba(0,0,0,0)"},this.options.taskListTable?.theme?.columnResize),underlayBackgroundColor:this.parsedOptions.underlayBackgroundColor};return t.canvasWidth=this.taskTableWidth,t.canvasHeight=this.canvas.height,t.defaultHeaderRowHeight=this.getAllHeaderRowsHeight(),t.defaultRowHeight=this.parsedOptions.rowHeight,t.clearDOM=!1,t}getElement(){return this.element}getContainer(){return this.element.parentElement}_sortScales(){const{timelineHeader:t}=this.options;if(t){const e=t.scales,i=["year","quarter","month","week","day"],o=e.slice().sort(((t,e)=>{const o=i.indexOf(t.unit),n=i.indexOf(e.unit);return-1===o?1:-1===n?-1:o-n})),n=e.slice().sort(((t,e)=>{const o=i.indexOf(t.unit),n=i.indexOf(e.unit);return-1===o?1:-1===n?-1:n-o}));this.parsedOptions.sortedTimelineScales=o,this.parsedOptions.reverseSortedTimelineScales=n}}_generateTimeLineDateMap(){const t=fC(this.parsedOptions.minDate),e=fC(this.parsedOptions.maxDate);let i=1e6;for(const i of this.parsedOptions.reverseSortedTimelineScales){const o=fC(t);i.timelineDates=wC(o,e,i)}const o=this.parsedOptions.reverseSortedTimelineScales[0],{unit:n,step:r}=o;"day"===n?i=r:"month"===n?i=30:"week"===n?i=7:"quarter"===n?i=90:"year"===n&&(i=365),this.parsedOptions.colWidthPerDay=this.parsedOptions.timelineColWidth/i}getAllRowsHeight(){return this.getAllHeaderRowsHeight()+this.itemCount*this.parsedOptions.rowHeight}getAllHeaderRowsHeight(){return this.parsedOptions.timeLineHeaderRowHeights.reduce(((t,e,i)=>t+e),0)}_getAllColsWidth(){return this.parsedOptions.colWidthPerDay*(Math.ceil(Math.abs(fC(this.parsedOptions.maxDate).getTime()-fC(this.parsedOptions.minDate).getTime())/864e5)+1)}getAllTaskBarsHeight(){return this.itemCount*this.parsedOptions.rowHeight}getTaskShowIndexByRecordIndex(t){return this.taskListTableInstance.getBodyRowIndexByRecordIndex(t)}getRecordByIndex(t){return this.taskListTableInstance?this.taskListTableInstance.getRecordByRowCol(0,t+this.taskListTableInstance.columnHeaderLevelCount):this.records[t]}_refreshTaskBar(t){this.scenegraph.taskBar.updateTaskBarNode(t),this.scenegraph.updateNextFrame()}_updateRecordToListTable(t,e){this.taskListTableInstance.updateRecords([t],[e])}getTaskInfoByTaskListIndex(t){const e=this.getRecordByIndex(t),i=this.parsedOptions.startDateField,o=this.parsedOptions.endDateField,n=this.parsedOptions.progressField,r=fC(e?.[i]).getTime(),s=fC(e?.[o]).getTime();if(s<this.parsedOptions._minDateTime||r>this.parsedOptions._maxDateTime||!e?.[i]||!e?.[o])return{taskDays:0,progress:0,startDate:null,endDate:null,taskRecord:e};const l=fC(Math.min(Math.max(this.parsedOptions._minDateTime,r),this.parsedOptions._maxDateTime)),a=fC(Math.max(Math.min(this.parsedOptions._maxDateTime,s),this.parsedOptions._minDateTime)),h=function(t){return"string"==typeof t&&(t=t.replace("%",""),t=parseFloat(t)),t<=1&&(t*=100),Math.round(t)}(e[n]);return{taskRecord:e,taskDays:Math.ceil(Math.abs(a.getTime()-l.getTime())/864e5)+1,startDate:l,endDate:a,progress:h}}_updateDateToTaskRecord(t,e,i){const o=this.getRecordByIndex(i),n=this.parsedOptions.startDateField,r=this.parsedOptions.endDateField,s=this.parsedOptions.dateFormat??function(t){const e=["yyyy-mm-dd","dd-mm-yyyy","mm/dd/yyyy","yyyy/mm/dd","dd/mm/yyyy","yyyy.mm.dd","dd.mm.yyyy","mm.dd.yyyy"];t=t.replace(/\s+/g,"");for(let i=0;i<e.length;i++){const o=e[i],n=t.split(cC(o)),r=hC(n,o);if(3===n.length&&r)return o}return null}(o[n]),l=fC(o[n]),a=fC(o[r]);if("move"===t){const t=aC(fC(e*bC+l.getTime()),s),i=aC(fC(e*bC+a.getTime()),s);o[n]=t,o[r]=i}else if("start-move"===t){const t=aC(fC(e*bC+l.getTime()),s);o[n]=t}else if("end-move"===t){const t=aC(fC(e*bC+a.getTime()),s);o[r]=t}this._updateRecordToListTable(o,i)}updateTaskRecord(t,e){this._updateRecordToListTable(t,e),this._refreshTaskBar(e)}setPixelRatio(t){this.taskListTableInstance?.setPixelRatio(t),this.parsedOptions.pixelRatio=t,this.scenegraph.setPixelRatio(t)}_resize(){this._updateSize(),this.taskListTableInstance?.setCanvasSize(this.taskTableWidth,this.tableNoFrameHeight+2*this.parsedOptions.outerFrameStyle.borderLineWidth),this._syncPropsFromTable(),this.scenegraph.resize(),_C(this)}_syncPropsFromTable(){this.itemCount=this.taskListTableInstance?this.taskListTableInstance.rowCount-this.taskListTableInstance.columnHeaderLevelCount:this.records.length,this.headerHeight=this.getAllHeaderRowsHeight(),this.drawHeight=Math.min(this.headerHeight+this.parsedOptions.rowHeight*this.itemCount,this.tableNoFrameHeight),this.gridHeight=this.drawHeight-this.headerHeight}getContext(){return this.context}release(){super.release?.(),this.eventManager.release(),this.taskListTableInstance?.release();const{parentElement:t}=this.element;t&&(t.removeChild(this.element),this.verticalSplitResizeLine&&t.removeChild(this.verticalSplitResizeLine),this.horizontalSplitLine&&t.removeChild(this.horizontalSplitLine)),this.scenegraph=null}setRecords(t){this.records=t,this.taskListTableInstance.setRecords(t),this._syncPropsFromTable(),this.verticalSplitResizeLine.style.height=this.drawHeight+"px",this.scenegraph.refreshTaskBarsAndGrid();const e=this.stateManager.scroll.horizontalBarPos,i=this.stateManager.scroll.verticalBarPos;this.scenegraph.setX(-e),this.scenegraph.setY(-i)}updateScales(t){if(this.options.timelineHeader.scales=t,this._sortScales(),CC(this),this._generateTimeLineDateMap(),this.timeLineHeaderLevel=this.parsedOptions.sortedTimelineScales.length,this.scenegraph.refreshAll(),_C(this),this.taskListTableInstance)if(this.taskListTableInstance.columnHeaderLevelCount===this.parsedOptions.timeLineHeaderRowHeights.length)for(let t=0;t<this.taskListTableInstance.columnHeaderLevelCount;t++)this.taskListTableInstance.setRowHeight(t,this.parsedOptions.timeLineHeaderRowHeights[t]);else{const t=this.getAllHeaderRowsHeight()/this.taskListTableInstance.columnHeaderLevelCount;for(let e=0;e<this.taskListTableInstance.columnHeaderLevelCount;e++)this.taskListTableInstance.setRowHeight(e,t)}}_scrollToMarkLine(){if(this.parsedOptions.scrollToMarkLineDate){const t=this.parsedOptions.minDate,e=(this.parsedOptions.scrollToMarkLineDate.getTime()-t.getTime())/864e5*this.parsedOptions.colWidthPerDay-this.tableNoFrameWidth/2;this.stateManager.setScrollLeft(e)}}addLink(t){this.parsedOptions.dependencyLinks.push(t),this.scenegraph.dependencyLink.initLinkLine(this.parsedOptions.dependencyLinks.length-1),this.scenegraph.updateNextFrame()}deleteLink(t){const e=this.parsedOptions.dependencyLinks.findIndex((e=>e.type===t.type&&e.linkedFromTaskKey===t.linkedFromTaskKey&&e.linkedToTaskKey===t.linkedToTaskKey));if(-1!==e){const t=this.parsedOptions.dependencyLinks[e];this.parsedOptions.dependencyLinks.splice(e,1),this.scenegraph.dependencyLink.deleteLink(t),this.scenegraph.updateNextFrame()}}},t.TYPES=n,t.VRender=vP,t.VTable=mP,t.tools=fP,t.version="1.10.3"}));
15
+ ***************************************************************************** */let PC=class{time=Ti.beforeFillStroke;useStyle=!0;order=0;supportedAppName="vtable";drawShape(t,e,i,o,n,r,s,l,a,h,d,c,u){"date-header-cell"===t.name&&t.forEachChildren((t=>{if("date-header-cell-text"===t.name&&!0===t.attribute.textStick){const e=t;e.setAttribute("dx",0);const i=e.globalAABBBounds,o=e.stage.globalAABBBounds,n=e.parent.globalAABBBounds,r=o.intersect(n);o.intersect(n)&&(i.width()>=r.width()&&e.attribute.last_dx?e.setAttribute("dx",e.attribute.last_dx??0):o.x1>=i.x1?(e.setAttribute("dx",o.x1-i.x1),e.setAttribute("last_dx",o.x1-i.x1)):o.x2<=i.x2&&(e.setAttribute("dx",o.x2-i.x2),e.setAttribute("last_dx",o.x1-i.x1)))}}))}};PC=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s}([y()],PC);var EC=new s(((t,e,i,o)=>{t(PC).toSelf().inSingletonScope(),t(Vs).toService(PC)}));class HC{_scene;group;lineVertical;lineHorizontal;constructor(t){this._scene=t,this.createAddButton()}createAddButton(){this._scene._gantt.parsedOptions.taskBarCreationCustomLayout?this.group=new fs({x:0,y:0,width:100,height:100}):(this.group=new fs({x:0,y:0,width:100,height:100,lineDash:this._scene._gantt.parsedOptions.taskBarCreationButtonStyle.lineDash,cursor:"pointer",lineWidth:this._scene._gantt.parsedOptions.taskBarCreationButtonStyle.lineWidth,stroke:this._scene._gantt.parsedOptions.taskBarCreationButtonStyle.lineColor,cornerRadius:this._scene._gantt.parsedOptions.taskBarCreationButtonStyle.cornerRadius??0,fill:this._scene._gantt.parsedOptions.taskBarCreationButtonStyle.backgroundColor}),this.lineVertical=oc({pickable:!1,stroke:this._scene._gantt.parsedOptions.taskBarCreationButtonStyle.lineColor,lineWidth:this._scene._gantt.parsedOptions.taskBarCreationButtonStyle.lineWidth,points:[{x:50,y:0},{x:50,y:100}]}),this.group.appendChild(this.lineVertical),this.lineHorizontal=oc({pickable:!1,stroke:this._scene._gantt.parsedOptions.taskBarCreationButtonStyle.lineColor,lineWidth:this._scene._gantt.parsedOptions.taskBarCreationButtonStyle.lineWidth,points:[{x:0,y:50},{x:100,y:50}]}),this.group.appendChild(this.lineHorizontal)),this.group.name="task-creation-button",this._scene.taskBar.group.addChild(this.group)}show(t,e,i,o){if(this._scene._gantt.parsedOptions.taskBarCreationCustomLayout)this.group.appendChild(this._scene._gantt.parsedOptions.taskBarCreationCustomLayout({width:i,height:o,ganttInstance:this._scene._gantt}).rootContainer);else{const t=Math.min(i,o)/6;this.lineHorizontal.setAttribute("points",[{x:(i-4*t)/2,y:o/2},{x:(i-4*t)/2+4*t,y:o/2}]),this.lineVertical.setAttribute("points",[{x:i/2,y:(o-4*t)/2},{x:i/2,y:(o-4*t)/2+4*t}])}this.group.setAttribute("x",t),this.group.setAttribute("y",e),this.group.setAttribute("width",i),this.group.setAttribute("height",o),this.group.setAttribute("visibleAll",!0)}hide(){this.group.setAttribute("visibleAll",!1),this._scene._gantt.parsedOptions.taskBarCreationCustomLayout&&this.group.removeAllChild()}}class FC{group;linkLinesContainer;_scene;width;height;selectedEffectNodes;constructor(t){this._scene=t,this.width=t._gantt.tableNoFrameWidth,this.height=t._gantt.gridHeight,this.group=new fs({x:0,y:t._gantt.getAllHeaderRowsHeight(),width:this.width,height:this.height,pickable:!1,clip:!0}),this.group.name="dependency-link-container",t.tableGroup.addChild(this.group),this.initLinkLines()}initLinkLines(){this.linkLinesContainer=new fs({x:0,y:0,width:this._scene._gantt._getAllColsWidth(),height:this._scene._gantt.getAllTaskBarsHeight(),pickable:!1,clip:!0}),this.group.appendChild(this.linkLinesContainer);for(let t=0;t<this._scene._gantt.parsedOptions.dependencyLinks?.length;t++)this.initLinkLine(t)}initLinkLine(t){const{taskKeyField:e,dependencyLinks:o}=this._scene._gantt.parsedOptions,n=o[t],{linkedToTaskKey:r,linkedFromTaskKey:s,type:l}=n,a=SC(this._scene._gantt.records,e,r);a.record.vtable_gantt_linkedTo||(a.record.vtable_gantt_linkedTo=[]),a.record.vtable_gantt_linkedTo.push(n);const h=SC(this._scene._gantt.records,e,s);h.record.vtable_gantt_linkedFrom||(h.record.vtable_gantt_linkedFrom=[]),h.record.vtable_gantt_linkedFrom.push(n);const d=this._scene._gantt.getTaskShowIndexByRecordIndex(h.index),c=this._scene._gantt.getTaskShowIndexByRecordIndex(a.index),{startDate:u,endDate:g,taskDays:p}=this._scene._gantt.getTaskInfoByTaskListIndex(c),{startDate:f,endDate:v,taskDays:m}=this._scene._gantt.getTaskInfoByTaskListIndex(d);if(!m||!p)return;const b=fC(this._scene._gantt.parsedOptions.minDate),{arrowPoints:y,linePoints:C}=function(t,e,o,n,r,s,l,a,h,d){const c=20,u=10,g=5;let p,f,v=[],m=[];if(t===i.FinishToStart){p=o,f=r;const t=d*(Math.ceil(Math.abs(p.getTime()-a.getTime())/864e5)+1),e=d*Math.ceil(Math.abs(f.getTime()-a.getTime())/864e5);v=[{x:t,y:h*(n+.5)},{x:t+c,y:h*(n+.5)},{x:t+c,y:h*(n+(n>l?0:1))},{x:e-c,y:h*(n+(n>l?0:1))},{x:e-c,y:h*(l+.5)},{x:e,y:h*(l+.5)}],t+c<=e-c&&v.splice(2,3,{x:t+c,y:h*(l+.5)});const i=v[v.length-1];m=[{x:i.x,y:i.y},{x:i.x-u,y:i.y-g},{x:i.x-u,y:i.y+g},{x:i.x,y:i.y}]}else if(t===i.StartToFinish){p=e,f=s;const t=d*Math.ceil(Math.abs(p.getTime()-a.getTime())/864e5),i=d*(Math.ceil(Math.abs(f.getTime()-a.getTime())/864e5)+1);v=[{x:t,y:h*(n+.5)},{x:t-c,y:h*(n+.5)},{x:t-c,y:h*(n+(n>l?0:1))},{x:i+c,y:h*(n+(n>l?0:1))},{x:i+c,y:h*(l+.5)},{x:i,y:h*(l+.5)}],t-c>=i+c&&v.splice(2,3,{x:t-c,y:h*(l+.5)});const o=v[v.length-1];m=[{x:o.x,y:o.y},{x:o.x+u,y:o.y-g},{x:o.x+u,y:o.y+g},{x:o.x,y:o.y}]}else if(t===i.StartToStart){p=e,f=r;const t=d*Math.ceil(Math.abs(p.getTime()-a.getTime())/864e5),i=d*Math.ceil(Math.abs(f.getTime()-a.getTime())/864e5);v=[{x:t,y:h*(n+.5)},{x:Math.min(t,i)-c,y:h*(n+.5)},{x:Math.min(t,i)-c,y:h*(l+.5)},{x:i,y:h*(l+.5)}];const o=v[v.length-1];m=[{x:o.x,y:o.y},{x:o.x-u,y:o.y-g},{x:o.x-u,y:o.y+g},{x:o.x,y:o.y}]}else if(t===i.FinishToFinish){p=o,f=s;const t=d*(Math.ceil(Math.abs(p.getTime()-a.getTime())/864e5)+1),e=d*(Math.ceil(Math.abs(f.getTime()-a.getTime())/864e5)+1);v=[{x:t,y:h*(n+.5)},{x:Math.max(t,e)+c,y:h*(n+.5)},{x:Math.max(t,e)+c,y:h*(l+.5)},{x:e,y:h*(l+.5)}];const i=v[v.length-1];m=[{x:i.x,y:i.y},{x:i.x+u,y:i.y-g},{x:i.x+u,y:i.y+g},{x:i.x,y:i.y}]}return{linePoints:v,arrowPoints:m}}(l,f,v,d,u,g,c,b,this._scene._gantt.parsedOptions.rowHeight,this._scene._gantt.parsedOptions.colWidthPerDay),w=this._scene._gantt.parsedOptions.dependencyLinkLineStyle,x=oc({pickable:!0,stroke:w.lineColor,lineWidth:w.lineWidth,lineDash:w.lineDash,points:C,pickStrokeBuffer:3,vtable_link:n});this.linkLinesContainer.appendChild(x),n.vtable_gantt_linkLineNode=x;const _=new Rc({fill:w.lineColor,points:y});this.linkLinesContainer.appendChild(_),n.vtable_gantt_linkArrowNode=_}setX(t){this.linkLinesContainer.setAttribute("x",t)}setY(t){this.linkLinesContainer.setAttribute("y",t)}refresh(){this.width=this._scene._gantt.tableNoFrameWidth,this.height=this._scene._gantt.gridHeight,this.group.setAttributes({height:this.height,width:this.width,y:this._scene._gantt.getAllHeaderRowsHeight()}),this.linkLinesContainer.removeAllChild(),this.group.removeChild(this.linkLinesContainer),this.initLinkLines()}resize(){this.width=this._scene._gantt.tableNoFrameWidth,this.height=this._scene._gantt.gridHeight,this.group.setAttribute("width",this.width),this.group.setAttribute("height",this.height)}createSelectedLinkLine(t){const e=t.vtable_gantt_linkLineNode,i=t.vtable_gantt_linkArrowNode,o=e.clone(),n=i.clone();o.setAttribute("stroke",this._scene._gantt.parsedOptions.dependencyLinkSelectedLineStyle.lineColor),o.setAttribute("lineWidth",this._scene._gantt.parsedOptions.dependencyLinkSelectedLineStyle.lineWidth),o.setAttribute("shadowColor",this._scene._gantt.parsedOptions.dependencyLinkSelectedLineStyle.shadowColor),o.setAttribute("shadowOffsetX",this._scene._gantt.parsedOptions.dependencyLinkSelectedLineStyle.shadowOffset),o.setAttribute("shadowOffsetY",this._scene._gantt.parsedOptions.dependencyLinkSelectedLineStyle.shadowOffset),o.setAttribute("shadowBlur",this._scene._gantt.parsedOptions.dependencyLinkSelectedLineStyle.shadowBlur),this.linkLinesContainer.appendChild(o),n.setAttribute("fill",this._scene._gantt.parsedOptions.dependencyLinkSelectedLineStyle.lineColor),this.linkLinesContainer.appendChild(n),this.selectedEffectNodes=[o,n]}removeSelectedLinkLine(){this.selectedEffectNodes?.forEach((t=>{t.delete()})),this.selectedEffectNodes=[]}deleteLink(t){const e=t.vtable_gantt_linkLineNode,i=t.vtable_gantt_linkArrowNode;e.delete(),i.delete()}}function zC(t,e,o,n,r,s,l,a,h,d,c,u){const g=20,p=10;let f,v,m=[],b=[];if(t===i.FinishToStart){f=o,v=r;const t=c?c.attribute.x+c.attribute.width:d*(Math.ceil(Math.abs(f.getTime()-a.getTime())/864e5)+1),e=u?u.attribute.x:d*Math.ceil(Math.abs(v.getTime()-a.getTime())/864e5);m=[{x:t,y:h*(n+.5)},{x:t+g,y:h*(n+.5)},{x:t+g,y:h*(n+(n>l?0:1))},{x:e-g,y:h*(n+(n>l?0:1))},{x:e-g,y:h*(l+.5)},{x:e,y:h*(l+.5)}],t+g<=e-g&&m.splice(2,3,{x:t+g,y:h*(l+.5)});const i=m[m.length-1];b=[{x:i.x,y:i.y},{x:i.x-p,y:i.y-5},{x:i.x-p,y:i.y+5},{x:i.x,y:i.y}]}else if(t===i.StartToFinish){f=e,v=s;const t=c?c.attribute.x:d*Math.ceil(Math.abs(f.getTime()-a.getTime())/864e5),i=u?u.attribute.x+u.attribute.width:d*(Math.ceil(Math.abs(v.getTime()-a.getTime())/864e5)+1);m=[{x:t,y:h*(n+.5)},{x:t-g,y:h*(n+.5)},{x:t-g,y:h*(n+(n>l?0:1))},{x:i+g,y:h*(n+(n>l?0:1))},{x:i+g,y:h*(l+.5)},{x:i,y:h*(l+.5)}],t-g>=i+g&&m.splice(2,3,{x:t-g,y:h*(l+.5)});const o=m[m.length-1];b=[{x:o.x,y:o.y},{x:o.x+p,y:o.y-5},{x:o.x+p,y:o.y+5},{x:o.x,y:o.y}]}else if(t===i.StartToStart){f=e,v=r;const t=c?c.attribute.x:d*Math.ceil(Math.abs(f.getTime()-a.getTime())/864e5),i=u?u.attribute.x:d*Math.ceil(Math.abs(v.getTime()-a.getTime())/864e5);m=[{x:t,y:h*(n+.5)},{x:Math.min(t,i)-g,y:h*(n+.5)},{x:Math.min(t,i)-g,y:h*(l+.5)},{x:i,y:h*(l+.5)}];const o=m[m.length-1];b=[{x:o.x,y:o.y},{x:o.x-p,y:o.y-5},{x:o.x-p,y:o.y+5},{x:o.x,y:o.y}]}else if(t===i.FinishToFinish){f=o,v=s;const t=c?c.attribute.x+c.attribute.width:d*(Math.ceil(Math.abs(f.getTime()-a.getTime())/864e5)+1),e=u?u.attribute.x+u.attribute.width:d*(Math.ceil(Math.abs(v.getTime()-a.getTime())/864e5)+1);m=[{x:t,y:h*(n+.5)},{x:Math.max(t,e)+g,y:h*(n+.5)},{x:Math.max(t,e)+g,y:h*(l+.5)},{x:e,y:h*(l+.5)}];const i=m[m.length-1];b=[{x:i.x,y:i.y},{x:i.x+p,y:i.y-5},{x:i.x+p,y:i.y+5},{x:i.x,y:i.y}]}return{linePoints:m,arrowPoints:b}}nn.load(EC);var IC,OC,DC,WC,NC,GC,jC,VC,UC;!function(t){t.default="default",t.grabing="grabing",t.scrolling="scrolling"}(IC||(IC={})),function(t){t.single="single",t.column="column",t.row="row",t.cross="cross",t.none="none"}(OC||(OC={})),function(t){t.top="top",t.bottom="bottom",t.left="left",t.right="right"}(DC||(DC={})),function(t){t.expand="expand",t.collapse="collapse",t.none="none"}(WC||(WC={})),function(t){t.RECORD="RECORD",t.NONE="NONE",t.SUM="SUM",t.MIN="MIN",t.MAX="MAX",t.AVG="AVG",t.COUNT="COUNT",t.CUSTOM="CUSTOM",t.RECALCULATE="RECALCULATE"}(NC||(NC={})),function(t){t.ASC="ASC",t.DESC="DESC",t.NORMAL="NORMAL",t.desc="desc",t.asc="asc",t.normal="normal"}(GC||(GC={})),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"}(jC||(jC={})),function(t){t.frozen="frozen",t.sort="sort",t.dropDown="dropDown",t.dropDownState="dropDownState",t.play="play",t.damagePic="damagePic",t.expand="expand",t.collapse="collapse",t.drillDown="drillDown",t.drillUp="drillUp",t.dragReorder="dragReorder"}(VC||(VC={})),function(t){t.upwardIconName="sort_upward",t.downwardIconName="sort_downward",t.normalIconName="sort_normal",t.freezeIconName="freeze",t.frozenIconName="frozen",t.frozenCurrentIconName="frozenCurrent",t.dropdownIconName="dropdownIcon",t.expandIconName="expand",t.collapseIconName="collapse",t.dragReorderIconName="dragReorder"}(UC||(UC={}));let $C,XC=1,YC=class{constructor(){this.listenersData={listeners:{},listenerData:{}}}on(t,e){const i=this.listenersData.listeners[t]||(this.listenersData.listeners[t]=[]);i.push(e);const o=XC++;return this.listenersData.listenerData[o]={type:t,listener:e,remove:()=>{delete this.listenersData.listenerData[o];const n=i.indexOf(e);i.splice(n,1),this.listenersData.listeners[t].length||delete this.listenersData.listeners[t]}},o}off(t,e){var i;if(e){const i=t;this.removeEventListener(i,e)}else{const e=t;if(!this.listenersData)return;null===(i=this.listenersData.listenerData[e])||void 0===i||i.remove()}}addEventListener(t,e,i){this.on(t,e)}removeEventListener(t,e){if(this.listenersData)for(const i in this.listenersData.listenerData){const o=this.listenersData.listenerData[i];o.type===t&&o.listener===e&&this.off(i)}}hasListeners(t){return!!this.listenersData&&!!this.listenersData.listeners[t]}fireListeners(t,e){if(!this.listenersData)return[];const i=this.listenersData.listeners[t];return i?i.map((t=>t.call(this,e))).filter((t=>Q(t))):[]}release(){delete this.listenersData}};const KC={CHANGE_STYLE:"change_style"};let qC,ZC,JC,QC=class t extends YC{static get EVENT_TYPE(){return KC}static get DEFAULT(){return $C||($C=new t)}constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};var i,o,n,r,s,l,a,h,d,c,u,g,p,f,v,m,b,y,C,w,x,_,S,A,B,R,M,T,k,L,P;super(),this._defaultPadding=[10,16,10,16],this._textAlign=null!==(i=null==t?void 0:t.textAlign)&&void 0!==i?i:null==e?void 0:e.textAlign,this._textBaseline=null!==(o=null==t?void 0:t.textBaseline)&&void 0!==o?o:null==e?void 0:e.textBaseline,this._color=null!==(n=null==t?void 0:t.color)&&void 0!==n?n:null==e?void 0:e.color,this._strokeColor=null!==(r=null==t?void 0:t.strokeColor)&&void 0!==r?r:null==e?void 0:e.strokeColor,this._fontSize=null!==(s=t.fontSize)&&void 0!==s?s:null==e?void 0:e.fontSize,this._fontFamily=null!==(l=t.fontFamily)&&void 0!==l?l:null==e?void 0:e.fontFamily,this._fontWeight=null!==(a=t.fontWeight)&&void 0!==a?a:null==e?void 0:e.fontWeight,this._fontVariant=null!==(h=t.fontVariant)&&void 0!==h?h:null==e?void 0:e.fontVariant,this._fontStyle=null!==(d=t.fontStyle)&&void 0!==d?d:null==e?void 0:e.fontStyle,this._padding=null!==(u=null!==(c=null==t?void 0:t.padding)&&void 0!==c?c:null==e?void 0:e.padding)&&void 0!==u?u:this._defaultPadding,this._borderColor=null!==(g=null==t?void 0:t.borderColor)&&void 0!==g?g:null==e?void 0:e.borderColor,this._textOverflow=null!==(p=null==t?void 0:t.textOverflow)&&void 0!==p?p:null==e?void 0:e.textOverflow,this._textStick=null!==(v=null!==(f=t.textStick)&&void 0!==f?f:null==e?void 0:e.textStick)&&void 0!==v&&v,this._textStickBaseOnAlign=null!==(b=null!==(m=t.textStickBaseOnAlign)&&void 0!==m?m:null==e?void 0:e.textStickBaseOnAlign)&&void 0!==b&&b,this._bgColor=null!==(y=null==t?void 0:t.bgColor)&&void 0!==y?y:null==e?void 0:e.bgColor,this._lineHeight=null!==(C=null==t?void 0:t.lineHeight)&&void 0!==C?C:null==e?void 0:e.lineHeight,this._underline=null!==(w=null==t?void 0:t.underline)&&void 0!==w?w:null==e?void 0:e.underline,this._underlineColor=null!==(x=null==t?void 0:t.underlineColor)&&void 0!==x?x:null==e?void 0:e.underlineColor,this._underlineDash=null!==(_=null==t?void 0:t.underlineDash)&&void 0!==_?_:null==e?void 0:e.underlineDash,this._underlineOffset=null!==(S=null==t?void 0:t.underlineOffset)&&void 0!==S?S:null==e?void 0:e.underlineOffset,this._lineThrough=null!==(A=null==t?void 0:t.lineThrough)&&void 0!==A?A:null==e?void 0:e.lineThrough,this._lineThroughColor=null!==(B=null==t?void 0:t.lineThroughColor)&&void 0!==B?B:null==e?void 0:e.lineThroughColor,this._lineThroughDash=null!==(R=null==t?void 0:t.lineThroughDash)&&void 0!==R?R:null==e?void 0:e.lineThroughDash,this._linkColor=null!==(M=null==t?void 0:t.linkColor)&&void 0!==M?M:null==e?void 0:e.linkColor,this._cursor=null!==(T=t.cursor)&&void 0!==T?T:null==e?void 0:e.cursor,this._borderLineWidth=null!==(k=t.borderLineWidth)&&void 0!==k?k:null==e?void 0:e.borderLineWidth,this._borderLineDash=null!==(L=t.borderLineDash)&&void 0!==L?L:null==e?void 0:e.borderLineDash,this._marked=null!==(P=t.marked)&&void 0!==P?P:null==e?void 0:e.marked}get color(){return this._color}set color(t){this._color=t}get strokeColor(){return this._strokeColor}set strokeColor(t){this._strokeColor=t}get fontSize(){return this._fontSize}set fontSize(t){this._fontSize=t}get fontFamily(){return this._fontFamily}set fontFamily(t){this._fontFamily=t}get fontWeight(){return this._fontWeight}set fontWeight(t){this._fontWeight=t}get fontVariant(){return this._fontVariant}set fontVariant(t){this._fontVariant=t}get fontStyle(){return this._fontStyle}set fontStyle(t){this._fontStyle=t}get padding(){return this._padding}set padding(t){this._padding=t}get textOverflow(){return this._textOverflow}set textOverflow(t){this._textOverflow=t}get bgColor(){return this._bgColor}set bgColor(t){this._bgColor=t}get borderColor(){return this._borderColor}set borderColor(t){this._borderColor=t}get textStick(){return this._textStick}set textStick(t){this._textStick=t}get textStickBaseOnAlign(){return this._textStickBaseOnAlign}set textStickBaseOnAlign(t){this._textStickBaseOnAlign=t}get textAlign(){return this._textAlign}set textAlign(t){this._textAlign=t}get textBaseline(){return this._textBaseline}set textBaseline(t){this._textBaseline=t}get lineHeight(){return this._lineHeight}set lineHeight(t){this._lineHeight=t}get underline(){return this._underline}set underline(t){this._underline=t}get underlineColor(){return this._underlineColor}set underlineColor(t){this._underlineColor=t}get underlineDash(){return this._underlineDash}set underlineDash(t){this._underlineDash=t}get underlineOffset(){return this._underlineOffset}set underlineOffset(t){this._underlineOffset=t}get lineThrough(){return this._lineThrough}set lineThrough(t){this._lineThrough=t}get lineThroughColor(){return this._lineThroughColor}set lineThroughColor(t){this._lineThroughColor=t}get lineThroughDash(){return this._lineThroughDash}set lineThroughDash(t){this._lineThroughDash=t}get linkColor(){return this._linkColor}set linkColor(t){this._linkColor=t}get cursor(){return this._cursor}set cursor(t){this._cursor=t}get borderLineWidth(){return this._borderLineWidth}set borderLineWidth(t){this._borderLineWidth=t}get borderLineDash(){return this._borderLineDash}set borderLineDash(t){this._borderLineDash=t}get marked(){return this._marked}set marked(t){this._marked=t}clone(){return new t(this,null)}},tw=class t extends QC{static get DEFAULT(){return qC||(qC=new t)}constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},arguments.length>1&&void 0!==arguments[1]?arguments[1]:{})}clone(){return new t(this,null)}};class ew extends QC{static get DEFAULT(){return ZC||(ZC=new ew)}constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};var i,o;super(t,e),this._autoWrapText=null!==(i=null==t?void 0:t.autoWrapText)&&void 0!==i?i:null==e?void 0:e.autoWrapText,this._lineClamp=null!==(o=null==t?void 0:t.lineClamp)&&void 0!==o?o:null==e?void 0:e.lineClamp}clone(){return new ew(this,null)}get lineClamp(){return this._lineClamp}set lineClamp(t){this._lineClamp=t}get autoWrapText(){return this._autoWrapText}set autoWrapText(t){this._autoWrapText=t}}let iw,ow=class t extends QC{static get DEFAULT(){return JC||(JC=new t)}constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};var o,n,r,s,l,a,h,d,c,u,g,p,f,v,m,b,y,C,w,x,_,S;super(t,e),this._size=(null!==(n=null!==(o=null==t?void 0:t.size)&&void 0!==o?o:null==e?void 0:e.size)&&void 0!==n?n:null==i?void 0:i.size)||14,this._spaceBetweenTextAndIcon=(null!==(s=null!==(r=null==t?void 0:t.spaceBetweenTextAndIcon)&&void 0!==r?r:null==e?void 0:e.spaceBetweenTextAndIcon)&&void 0!==s?s:null==i?void 0:i.spaceBetweenTextAndIcon)||8,this._defaultFill=null!==(a=null===(l=null==t?void 0:t.checkboxStyle)||void 0===l?void 0:l.defaultFill)&&void 0!==a?a:null==i?void 0:i.defaultFill,this._defaultStroke=null!==(d=null===(h=null==t?void 0:t.checkboxStyle)||void 0===h?void 0:h.defaultStroke)&&void 0!==d?d:null==i?void 0:i.defaultStroke,this._disableFill=null!==(u=null===(c=null==t?void 0:t.checkboxStyle)||void 0===c?void 0:c.disableFill)&&void 0!==u?u:null==i?void 0:i.disableFill,this._checkedFill=null!==(p=null===(g=null==t?void 0:t.checkboxStyle)||void 0===g?void 0:g.checkedFill)&&void 0!==p?p:null==i?void 0:i.checkedFill,this._checkedStroke=null!==(v=null===(f=null==t?void 0:t.checkboxStyle)||void 0===f?void 0:f.checkedStroke)&&void 0!==v?v:null==i?void 0:i.checkedStroke,this._disableCheckedFill=null!==(b=null===(m=null==t?void 0:t.checkboxStyle)||void 0===m?void 0:m.disableCheckedFill)&&void 0!==b?b:null==i?void 0:i.disableCheckedFill,this._disableCheckedStroke=null!==(C=null===(y=null==t?void 0:t.checkboxStyle)||void 0===y?void 0:y.disableCheckedStroke)&&void 0!==C?C:null==i?void 0:i.disableCheckedStroke,this._checkIconImage=null!==(x=null===(w=null==t?void 0:t.checkboxStyle)||void 0===w?void 0:w.checkIconImage)&&void 0!==x?x:null==i?void 0:i.checkIconImage,this._indeterminateIconImage=null!==(S=null===(_=null==t?void 0:t.checkboxStyle)||void 0===_?void 0:_.indeterminateIconImage)&&void 0!==S?S:null==i?void 0:i.indeterminateIconImage}get size(){return this._size}set size(t){this._size=t}get spaceBetweenTextAndIcon(){return this._spaceBetweenTextAndIcon}set spaceBetweenTextAndIcon(t){this._spaceBetweenTextAndIcon=t}get defaultFill(){return this._defaultFill}set defaultFill(t){this._defaultFill=t}get defaultStroke(){return this._defaultStroke}set defaultStroke(t){this._defaultStroke=t}get disableFill(){return this._disableFill}set disableFill(t){this._disableFill=t}get checkedFill(){return this._checkedFill}set checkedFill(t){this._checkedFill=t}get checkedStroke(){return this._checkedStroke}set checkedStroke(t){this._checkedStroke=t}get disableCheckedFill(){return this._disableCheckedFill}set disableCheckedFill(t){this._disableCheckedFill=t}get disableCheckedStroke(){return this._disableCheckedStroke}set disableCheckedStroke(t){this._disableCheckedStroke=t}get checkIconImage(){return this._checkIconImage}set checkIconImage(t){this._checkIconImage=t}get indeterminateIconImage(){return this._indeterminateIconImage}set indeterminateIconImage(t){this._indeterminateIconImage=t}getStyle(e){return new t(e,this)}clone(){return new t(this)}};class nw extends QC{static get DEFAULT(){return iw||(iw=new nw)}constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};var o,n,r,s,l,a,h,d,c,u,g,p,f,v,m,b,y,C,w,x,_,S,A,B;super(t,e),this._size=(null!==(n=null!==(o=null==t?void 0:t.size)&&void 0!==o?o:null==e?void 0:e.size)&&void 0!==n?n:null==i?void 0:i.size)||14,this._spaceBetweenTextAndIcon=(null!==(s=null!==(r=null==t?void 0:t.spaceBetweenTextAndIcon)&&void 0!==r?r:null==e?void 0:e.spaceBetweenTextAndIcon)&&void 0!==s?s:null==i?void 0:i.spaceBetweenTextAndIcon)||8,this._spaceBetweenRadio=(null!==(a=null!==(l=null==t?void 0:t.spaceBetweenRadio)&&void 0!==l?l:null==e?void 0:e.spaceBetweenRadio)&&void 0!==a?a:null==i?void 0:i.spaceBetweenRadio)||2,this._innerRadius=null!==(d=null===(h=null==t?void 0:t.radioStyle)||void 0===h?void 0:h.innerRadius)&&void 0!==d?d:null==i?void 0:i.innerRadius,this._outerRadius=null!==(u=null===(c=null==t?void 0:t.radioStyle)||void 0===c?void 0:c.outerRadius)&&void 0!==u?u:null==i?void 0:i.outerRadius,this._defaultFill=null!==(p=null===(g=null==t?void 0:t.radioStyle)||void 0===g?void 0:g.defaultFill)&&void 0!==p?p:null==i?void 0:i.defaultFill,this._defaultStroke=null!==(v=null===(f=null==t?void 0:t.radioStyle)||void 0===f?void 0:f.defaultStroke)&&void 0!==v?v:null==i?void 0:i.defaultStroke,this._disableFill=null!==(b=null===(m=null==t?void 0:t.radioStyle)||void 0===m?void 0:m.disableFill)&&void 0!==b?b:null==i?void 0:i.disableFill,this._checkedFill=null!==(C=null===(y=null==t?void 0:t.radioStyle)||void 0===y?void 0:y.checkedFill)&&void 0!==C?C:null==i?void 0:i.checkedFill,this._checkedStroke=null!==(x=null===(w=null==t?void 0:t.radioStyle)||void 0===w?void 0:w.checkedStroke)&&void 0!==x?x:null==i?void 0:i.checkedStroke,this._disableCheckedFill=null!==(S=null===(_=null==t?void 0:t.radioStyle)||void 0===_?void 0:_.disableCheckedFill)&&void 0!==S?S:null==i?void 0:i.disableCheckedFill,this._disableCheckedStroke=null!==(B=null===(A=null==t?void 0:t.radioStyle)||void 0===A?void 0:A.disableCheckedStroke)&&void 0!==B?B:null==i?void 0:i.disableCheckedStroke}get size(){return this._size}set size(t){this._size=t}get spaceBetweenTextAndIcon(){return this._spaceBetweenTextAndIcon}set spaceBetweenTextAndIcon(t){this._spaceBetweenTextAndIcon=t}get spaceBetweenRadio(){return this._spaceBetweenRadio}set spaceBetweenRadio(t){this._spaceBetweenRadio=t}get innerRadius(){return this._innerRadius}set innerRadius(t){this._innerRadius=t}get outerRadius(){return this._outerRadius}set outerRadius(t){this._outerRadius=t}get defaultFill(){return this._defaultFill}set defaultFill(t){this._defaultFill=t}get defaultStroke(){return this._defaultStroke}set defaultStroke(t){this._defaultStroke=t}get disableFill(){return this._disableFill}set disableFill(t){this._disableFill=t}get checkedFill(){return this._checkedFill}set checkedFill(t){this._checkedFill=t}get checkedStroke(){return this._checkedStroke}set checkedStroke(t){this._checkedStroke=t}get disableCheckedFill(){return this._disableCheckedFill}set disableCheckedFill(t){this._disableCheckedFill=t}get disableCheckedStroke(){return this._disableCheckedStroke}set disableCheckedStroke(t){this._disableCheckedStroke=t}getStyle(t){return new nw(t,this)}clone(){return new nw(this)}}function rw(t,e,i){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:QC,n=arguments.length>4?arguments[4]:void 0,r=arguments.length>5?arguments[5]:void 0;var s,l;return t||e?t instanceof QC?t:"function"==typeof t?rw(t(i),e,i,o,n,r):(t||(t={}),n&&!Q(t.autoWrapText)&&(t.autoWrapText=!0),o===ow?new ow(null!=t?t:{},null!=e?e:{},null!==(s=r.checkboxStyle)&&void 0!==s?s:{}):o===nw?new nw(null!=t?t:{},null!=e?e:{},null!==(l=r.radioStyle)&&void 0!==l?l:{}):new o(null!=t?t:{},null!=e?e:{})):o.DEFAULT}class sw{static get mode(){return sw._mode||(sw._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}()),sw._mode}static set mode(t){sw._mode=t}static RegisterCreateCanvas(t){sw.CreateCanvas=t}static RegisterLoadImage(t){sw.LoadImage=t}static GetCreateCanvasFunc(){return sw.CreateCanvas?sw.CreateCanvas:"worker"===sw.mode?function(){return new OffscreenCanvas(arguments.length>0&&void 0!==arguments[0]?arguments[0]:200,arguments.length>1&&void 0!==arguments[1]?arguments[1]:200)}:void 0}static RegisterRequestAnimationFrame(t){sw.RequestAnimationFrame=t()}static GetRequestAnimationFrame(){if(sw.RequestAnimationFrame)return sw.RequestAnimationFrame}static RegisterCancelAnimationFrame(t){sw.CancelAnimationFrame=t()}static GetCancelAnimationFrame(){if(sw.CancelAnimationFrame)return sw.CancelAnimationFrame}}sw.dpr=0;const lw=(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,aw=t=>lw(t,"object"),hw=t=>lw(t,"string"),dw=t=>lw(t,"number"),cw=t=>lw(t,"boolean");function uw(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),o=1;o<e;o++)i[o-1]=arguments[o];if(!i.length)return t||{};const n=i.shift();if(aw(t)&&aw(n))for(const e in n)aw(n[e])?(t[e]||Object.assign(t,{[e]:{}}),aw(t[e])||Object.assign(t,{[e]:n[e]}),uw(t[e],n[e])):null!==n[e]&&void 0!==n[e]&&Object.assign(t,{[e]:n[e]});return uw(t,...i)}function gw(t){return"function"==typeof t&&(t=t()),Q(t)?`${t}`:""}function pw(t,e){let i=null;return function(){for(var o=arguments.length,n=new Array(o),r=0;r<o;r++)n[r]=arguments[r];i||(t.apply(this,n),i=setTimeout((()=>{i=null}),e))}}function fw(t,e){for(t=`${t}`;t.length<e;)t="0"+t;return t}function vw(t,e,i){t=(t=t.replace(/^\s*|\s*$/,"")).replace(/^#?([a-f0-9])([a-f0-9])([a-f0-9])$/i,"#$1$1$2$2$3$3");const o=Math.round(256*e)*(i?-1:1),n=t.match(new RegExp("^rgba?\\(\\s*(\\d|[1-9]\\d|1\\d{2}|2[0-4][0-9]|25[0-5])\\s*,\\s*(\\d|[1-9]\\d|1\\d{2}|2[0-4][0-9]|25[0-5])\\s*,\\s*(\\d|[1-9]\\d|1\\d{2}|2[0-4][0-9]|25[0-5])(?:\\s*,\\s*(0|1|0?\\.\\d+))?\\s*\\)$","i")),r=n&&Q(n[4])?n[4]:null,s=n?[n[1],n[2],n[3]]:t.replace(/^#?([a-f0-9][a-f0-9])([a-f0-9][a-f0-9])([a-f0-9][a-f0-9])/i,(function(){return`${parseInt(arguments[1],16)},${parseInt(arguments[2],16)},${parseInt(arguments[3],16)}`})).split(/,/);return n?`rgb${null!==r?"a":""}(${Math[i?"max":"min"](parseInt(s[0],10)+o,i?0:255)}, ${Math[i?"max":"min"](parseInt(s[1],10)+o,i?0:255)}, ${Math[i?"max":"min"](parseInt(s[2],10)+o,i?0:255)}${null!==r?`, ${r}`:""})`:["#",fw(Math[i?"max":"min"](parseInt(s[0],10)+o,i?0:255).toString(16),2),fw(Math[i?"max":"min"](parseInt(s[1],10)+o,i?0:255).toString(16),2),fw(Math[i?"max":"min"](parseInt(s[2],10)+o,i?0:255).toString(16),2)].join("")}function mw(t){return hw(t)||dw(t)||cw(t)?t.toString():""}function bw(){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 yw(t,e,i){return"desc"!==i?t===e?0:t>e?1:-1:t===e?0:t<e?1:-1}function Cw(t){const e=[];for(let i=0;i<t.length;i++)-1===e.indexOf(t[i])&&e.push(t[i]);return e}function ww(t,e,i){i(t),(null==t?void 0:t[e])&&Array.isArray(null==t?void 0:t[e])&&t[e].forEach((t=>ww(t,e,i)))}const xw="undefined"==typeof window||void 0===window.window;let _w,Sw;const Aw={get find(){return _w||(_w=Array.prototype.find?(t,e)=>Array.prototype.find.call(t,e):(t,e)=>{const i=Aw.findIndex(t,e);return i>=0?t[i]:void 0},_w)},get findIndex(){return Sw||(Sw=Array.prototype.findIndex?(t,e)=>Array.prototype.findIndex.call(t,e):(t,e)=>{const{length:i}=t;for(let o=0;o<i;o++)if(e(t[o],o,t))return o;return-1},Sw)}};const{IE:Bw,Chrome:Rw,Firefox:Mw,Edge:Tw,Safari:kw}=function(){if(xw)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 Lw(){const t={};for(var e=arguments.length,i=new Array(e),o=0;o<e;o++)i[o]=arguments[o];return i.forEach((e=>{for(const i in e)Object.defineProperty(t,i,{get:()=>e[i],set(t){e[i]=t},configurable:!0,enumerable:!0})})),t}function Pw(t,e){let i=t;for(let t=0;t<(arguments.length<=2?0:arguments.length-2)&&null!=i;t++)i=e(i,t+2<2||arguments.length<=t+2?void 0:arguments[t+2]);return i}function Ew(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),o=1;o<e;o++)i[o-1]=arguments[o];return Pw(t,((t,e)=>t[e]),...i)}function Hw(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),o=1;o<e;o++)i[o-1]=arguments[o];return"function"==typeof t?t(...i):t}function Fw(t){return Boolean(t&&"function"==typeof t.then)}function zw(t,e){Fw(t)?t.then((t=>{e(t)})).catch((t=>{})):e(t)}function Iw(t){return Array.isArray(t)?3===t.length?[t[0],t[1],t[2],t[1]]:2===t.length?[t[0],t[1],t[0],t[1]]:1===t.length?[t[0],t[0],t[0],t[0]]:[t[0],t[1],t[2],t[3]]:[t,t,t,t]}function Ow(t,e,i){return t.start.col<=e&&e<=t.end.col&&t.start.row<=i&&i<=t.end.row||t.end.col<=e&&e<=t.start.col&&t.end.row<=i&&i<=t.start.row}function Dw(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 Ww(t,e){const i=Dw(t),o=Dw(e);return Math.max(i.start.col,o.start.col)<=Math.min(i.end.col,o.end.col)&&Math.max(i.start.row,o.start.row)<=Math.min(i.end.row,o.end.row)}const Nw=Bw,Gw={isObject:function(t){return t===Object(t)}},jw={endsWith:function(t,e,i){const o=mw(t);("number"!=typeof i||!isFinite(i)||Math.floor(i)!==i||i>o.length)&&(i=o.length),i-=e.length;const n=o.lastIndexOf(e,i);return-1!==n&&n===i}},Vw={isTouchEvent:function(t){return!!t.changedTouches}},Uw={toBoxArray:Iw},$w=Function.prototype,Xw={CLICK_CELL:"click_cell",DBLCLICK_CELL:"dblclick_cell",MOUSEDOWN_CELL:"mousedown_cell",MOUSEUP_CELL:"mouseup_cell",SELECTED_CELL:"selected_cell",SELECTED_CLEAR:"selected_clear",KEYDOWN:"keydown",MOUSEENTER_TABLE:"mouseenter_table",MOUSELEAVE_TABLE:"mouseleave_table",MOUSEDOWN_TABLE:"mousedown_table",MOUSEMOVE_TABLE:"mousemove_table",MOUSEMOVE_CELL:"mousemove_cell",MOUSEENTER_CELL:"mouseenter_cell",MOUSELEAVE_CELL:"mouseleave_cell",CONTEXTMENU_CELL:"contextmenu_cell",RESIZE_COLUMN:"resize_column",RESIZE_COLUMN_END:"resize_column_end",RESIZE_ROW:"resize_row",RESIZE_ROW_END:"resize_row_end",CHANGE_HEADER_POSITION_START:"change_header_position_start",CHANGE_HEADER_POSITION:"change_header_position",SORT_CLICK:"sort_click",AFTER_SORT:"after_sort",FREEZE_CLICK:"freeze_click",SCROLL:"scroll",SCROLL_HORIZONTAL_END:"scroll_horizontal_end",SCROLL_VERTICAL_END:"scroll_vertical_end",DROPDOWN_MENU_CLICK:"dropdown_menu_click",MOUSEOVER_CHART_SYMBOL:"mouseover_chart_symbol",DRAG_SELECT_END:"drag_select_end",COPY_DATA:"copy_data",DROPDOWN_ICON_CLICK:"dropdown_icon_click",DROPDOWN_MENU_CLEAR:"dropdown_menu_clear",TREE_HIERARCHY_STATE_CHANGE:"tree_hierarchy_state_change",SHOW_MENU:"show_menu",HIDE_MENU:"hide_menu",ICON_CLICK:"icon_click",LEGEND_ITEM_CLICK:"legend_item_click",LEGEND_ITEM_HOVER:"legend_item_hover",LEGEND_ITEM_UNHOVER:"legend_item_unHover",LEGEND_CHANGE:"legend_change",MOUSEENTER_AXIS:"mouseenter_axis",MOUSELEAVE_AXIS:"mouseleave_axis",CHECKBOX_STATE_CHANGE:"checkbox_state_change",RADIO_STATE_CHANGE:"radio_state_change",AFTER_RENDER:"after_render",INITIALIZED:"initialized",CHANGE_CELL_VALUE:"change_cell_value",DRAG_FILL_HANDLE_END:"drag_fill_handle_end",MOUSEDOWN_FILL_HANDLE:"mousedown_fill_handle",DBLCLICK_FILL_HANDLE:"dblclick_fill_handle"},Yw=(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 Kw(t,e,i){let o,n,r,s,l,a,h=0,d=!1,c=!1,u=!0;const g=!e&&0!==e&&"function"==typeof requestAnimationFrame;if("function"!=typeof t)throw new TypeError("Expected a function");function p(e){const i=o,r=n;return n=void 0,o=void 0,h=e,s=t.apply(r,i),s}function f(t,e){return g?requestAnimationFrame(t):setTimeout(t,e)}function v(t){const i=t-a;return void 0===a||i>=e||i<0||d&&t-h>=r}function m(){const t=Date.now();if(v(t))return function(t){return l=void 0,u&&o?p(t):(n=void 0,o=void 0,s)}(t);l=f(m,function(t){const i=t-h,o=e&&-(t-a);return d?Math.min(o,r-i):o}(t))}return e=+e||0,Yw(i,"object")&&(c=!!i.leading,d="maxWait"in i,d&&(r=Math.max(+i.maxWait||0,e)),u="trailing"in i?!!i.trailing:u),function(){const t=Date.now(),i=v(t);for(var r=arguments.length,u=new Array(r),g=0;g<r;g++)u[g]=arguments[g];if(o=u,n=this,a=t,i){if(void 0===l)return function(t){return h=t,l=f(m,e),c?p(t):s}(a);if(d)return l=f(m,e),p(a)}return void 0===l&&(l=f(m,e)),s}}let qw=1,Zw=class{constructor(){this.listeners={},this.reseizeListeners={}}on(t,e,i){if("node"===sw.mode)return-1;const o=qw++;for(var n=arguments.length,r=new Array(n>3?n-3:0),s=3;s<n;s++)r[s-3]=arguments[s];if(null==t?void 0:t.addEventListener)if("resize"!==e||t===window)null==t||t.addEventListener(e,i,...r);else{const e=new class{constructor(t,e,i){var o;if(this.resizeTime=100,this.lastSize={width:0,height:0},this.mutationResize=()=>{this.onResize()},this.callBack=()=>{const t=this.getSize();let e=!1;t.width===this.lastSize.width&&t.height===this.lastSize.height&&(e=!0),this.lastSize=t,this.cb&&this.cb(Object.assign(Object.assign({},this.lastSize),{windowSizeNotChange:e}))},this.onResize=()=>{this.callBackDebounce()},this.element=t,this.cb=e,this.lastSize=this.getSize(),i&&(this.resizeTime=Math.max(i,16)),this.callBackDebounce=Kw(this.callBack,this.resizeTime),null===window||void 0===window||window.addEventListener("resize",this.onResize),"ResizeObserver"in window){const t=window.ResizeObserver;this.observer=new t(this.mutationResize),null===(o=this.observer)||void 0===o||o.observe(this.element)}else"MutationObserver"in window&&(this.observer=new MutationObserver(this.mutationResize),this.observer.observe(this.element,{attributes:!0,attributeFilter:["style"]}))}disConnect(){window.removeEventListener("resize",this.onResize),this.observer&&(this.observer.disconnect(),this.observer=void 0)}setSize(t){this.lastSize=t}checkSize(){const t=this.getSize();return t.width!==this.lastSize.width||t.height!==this.lastSize.height}getSize(){return this.element?{width:Math.floor(this.element.clientWidth),height:Math.floor(this.element.clientHeight)}:Object.assign({},this.lastSize)}}(t,i,this.resizeTime);this.reseizeListeners[o]=e}const l={target:t,type:e,listener:i,options:r};return this.listeners[o]=l,o}once(t,e,i){var o=this;if("node"===sw.mode)return-1;for(var n=arguments.length,r=new Array(n>3?n-3:0),s=3;s<n;s++)r[s-3]=arguments[s];const l=this.on(t,e,(function(){o.off(l),i(...arguments)}),...r);return l}off(t){var e;if("node"===sw.mode)return;if(null===t)return;const i=null===(e=this.listeners)||void 0===e?void 0:e[t];i&&(delete this.listeners[t],i.target.removeEventListener&&i.target.removeEventListener(i.type,i.listener,...i.options))}fire(t,e){if("node"!==sw.mode){for(var i=arguments.length,o=new Array(i>2?i-2:0),n=2;n<i;n++)o[n-2]=arguments[n];for(const i in this.listeners){const n=this.listeners[i];n.target===t&&n.type===e&&n.listener.call(n.target,...o)}}}hasListener(t,e){if("node"===sw.mode)return!1;let i=!1;for(const o in this.listeners){const n=this.listeners[o];n.target===t&&n.type===e&&(i=!0)}return i}clear(){if("node"!==sw.mode){for(const t in this.listeners){const e=this.listeners[t];e.target.removeEventListener&&e.target.removeEventListener(e.type,e.listener,...e.options)}for(const t in this.reseizeListeners){const e=this.reseizeListeners[t];null==e||e.disConnect()}this.listeners={}}}release(){"node"!==sw.mode&&(this.clear(),this.listeners={})}};const Jw=(t,e)=>{let i=0,o=t.length-1;for(;i<=o;){const n=Math.floor((i+o)/2);if(t[n]===e)return n;t[n]>e?o=n-1:i=n+1}return o<0?0:o};class Qw{constructor(){this._keys=[],this._vals={},this._sorted=!1}count(){return this._keys.length}values(){return this._vals}valueArr(){return Object.values(this._vals)}adjustOrder(t,e,i){const{_keys:o}=this;if(this._sorted||(o.sort(((t,e)=>t<e?-1:t>e?1:0)),this._sorted=!0),t>e){const n=[];for(let r=Jw(o,t+i-1);r>=0;r--){const s=o[r];if(s>=t)n.push(this.get(s));else if(e<=s&&s<t)this.put(s+i,this.get(s));else if(s<e)break}for(let t=0;t<i;t++)this.put(e+t,n[i-1-t])}const{length:n}=o;if(t<e){const r=[];for(let s=Jw(o,t);s<n;s++){const n=o[s];if(n>=t&&n<t+i)r.push(this.get(n));else if(t+i<=n&&n<=e)this.put(n-i,this.get(n));else if(n>e)break}for(let t=0;t<i;t++)this.put(e+t,r[t])}}exchangeOrder(t,e,i,o,n){const{_keys:r}=this;if(this._sorted||(r.sort(((t,e)=>t<e?-1:t>e?1:0)),this._sorted=!0),t>i){const o=[],s=[];for(let n=Jw(r,i);n<t+e;n++){const i=r[n];i>=t&&i<t+e?s.push(this.get(i)):o.push(this.get(i))}for(let t=0;t<e;t++)this.put(n+t,s[t]);for(let t=0;t<o.length;t++)this.put(n+e+t,o[t])}else{const s=[],l=[];for(let n=Jw(r,t);n<i+o;n++){const i=r[n];i>=t&&i<t+e?l.push(this.get(i)):s.push(this.get(i))}for(let t=0;t<e;t++)this.put(n+t,l[t]);for(let e=0;e<s.length;e++)this.put(t+e,s[e])}}del(t){delete this._vals[t];const e=this._keys.indexOf(t);-1!==e&&this._keys.splice(e,1)}put(t,e){t in this._vals||(this._keys.push(t),this._sorted=!1),this._vals[t]=e}get(t){return this._vals[t]}has(t){return Q(this._vals[t])}contain(t){return Object.values(this._vals).indexOf(t)>=0}each(t,e,i){const{_keys:o}=this,{length:n}=o;this._sorted||(o.sort(((t,e)=>t<e?-1:t>e?1:0)),this._sorted=!0);for(let r=Jw(o,t);r<n;r++){const n=o[r];if(t<=n&&n<=e){if(!1===i(this.get(n),n))break}else if(e<n)return}}clear(){this._keys.length=0,this._vals={},this._sorted=!1}getLastIndex(){return this._keys[this._keys.length-1]}delLast(){const t=this.getLastIndex();this.del(t)}delAndReorder(t){if(!this.has(t))return;const e=this.getLastIndex();this.adjustOrder(t+1,t,e-t),this.delLast()}addAndReorder(t,e){const i=this.getLastIndex();this.adjustOrder(t,t+1,i-t),Q(e)&&this.put(t,e)}}let tx=class t{constructor(t,e,i,o){this.bounds=new ze,this.bounds.set(t,e,t+i,e+o)}static bounds(e,i,o,n){return new t(e,i,Math.round(o-e),Math.round(n-i))}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 ex={name:"DARK",underlayBackgroundColor:"transparent",defaultStyle:{color:"#D3D5DA",bgColor:"#373b45",fontSize:12,fontFamily:"PingFang SC",fontWeight:500,lineHeight:12,borderColor:"#444A54",padding:[8,12,8,12],hover:{cellBgColor:"#2F4774"}},headerStyle:{color:"#D3D5DA",bgColor:"#373b45",fontSize:12,fontFamily:"PingFang SC",fontWeight:500,lineHeight:12,borderColor:"#444A54",padding:[8,12,8,12],hover:{cellBgColor:"#2F4774"}},rowHeaderStyle:{},cornerHeaderStyle:{},bodyStyle:{color:"#e5e7ea",bgColor:function(t){const{row:e,table:i}=t;return 1&e-i.frozenRowCount?"#282a2e":"#2d3137"},fontSize:12,fontFamily:"PingFang SC",fontWeight:500,lineHeight:12,borderColor:"#444A54",padding:[8,12,8,12],hover:{cellBgColor:"#29364D"}},frameStyle:{borderColor:"#d1d5da",borderLineWidth:1,borderLineDash:[],cornerRadius:10,shadowBlur:6,shadowOffsetX:0,shadowOffsetY:0,shadowColor:"rgba(00, 24, 47, 0.06)"},columnResize:{lineWidth:1,lineColor:"#416EFF",bgColor:"#D9E2FF",width:3},frozenColumnLine:{shadow:{width:4,startColor:"rgba(00, 24, 47, 0.05)",endColor:"rgba(00, 24, 47, 0)"}},selectionStyle:{cellBgColor:"rgba(255, 255, 255, 0.1)",cellBorderColor:"#4284FF",cellBorderLineWidth:2},tooltipStyle:{bgColor:"#FFF",color:"#000",fontSize:12,fontFamily:"Arial,sans-serif"},functionalIconsStyle:{sort_color:"#FFFFFF",sort_color_opacity:"0.75",sort_color_2:"#416EFF",sort_color_opacity_2:"1",frozen_color:"#FFFFFF",frozen_color_opacity:"0.75",collapse_color:"#FFF",collapse_color_opacity:"0.75",expand_color:"#FFF",expand_color_opacity:"0.75",dragReorder_color:"#FFF",dragReorder_color_opacity:"0.75"}};var ix={name:"BRIGHT",underlayBackgroundColor:"#FFF",defaultStyle:{color:"#FFF",bgColor:"#5389FF",borderColor:"#5286FA",hover:{cellBgColor:"#2E67E3"}},headerStyle:{color:"#FFF",bgColor:"#5389FF",borderColor:"#A1C1FF",hover:{cellBgColor:"#2E67E3"}},bodyStyle:{color:"#000",bgColor:function(t){const{row:e,table:i}=t;return 1&e-i.frozenRowCount?"#FFF":"#F4F8FF"},borderColor:"#E0EAFE",hover:{cellBgColor:"#E9EFFD"}},frameStyle:{borderColor:"#E1E4E8",borderLineWidth:1,borderLineDash:[],cornerRadius:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,shadowColor:"black"},columnResize:{lineWidth:1,lineColor:"#416EFF",bgColor:"#D9E2FF",width:3},frozenColumnLine:{shadow:{width:3,startColor:"#CBDCFE",endColor:"#CBDCFE"}},selectionStyle:{cellBgColor:"rgba(0, 0, 255,0.1)"},tooltipStyle:{bgColor:"#FFF",color:"#000",fontSize:12,fontFamily:"Arial,sans-serif"}};var ox={name:"ARCO",underlayBackgroundColor:"#FFF",defaultStyle:{color:"#1B1F23",bgColor:"#EEF1F5",fontSize:14,fontFamily:"Arial,sans-serif",fontWeight:600,lineHeight:14,borderColor:"#e1e4e8",padding:[8,12,8,12]},headerStyle:{color:"#1B1F23",bgColor:"#EEF1F5",fontSize:14,fontFamily:"Arial,sans-serif",fontWeight:600,lineHeight:14,borderColor:"#e1e4e8",padding:[8,12,8,12],hover:{cellBgColor:"#c8daf6"}},rowHeaderStyle:{color:"#1B1F23",bgColor:"#EEF1F5",fontSize:12,fontFamily:"PingFang SC",fontWeight:500,lineHeight:12,borderColor:"#e1e4e8",padding:[8,12,8,12],hover:{cellBgColor:"#c8daf6"}},cornerHeaderStyle:{color:"#1B1F23",bgColor:"#EEF1F5",fontSize:12,fontFamily:"PingFang SC",fontWeight:500,lineHeight:12,borderColor:"#e1e4e8",padding:[8,12,8,12],hover:{cellBgColor:"#c8daf6"}},bodyStyle:{padding:[8,12,8,12],color:"#141414",fontSize:14,fontFamily:"Arial,sans-serif",fontWeight:400,textAlign:"left",bgColor:function(t){const{row:e,table:i}=t;return 1&e-i.frozenRowCount?"#fbfbfc":"#FFF"},borderColor:"#e1e4e8",lineHeight:14,hover:{cellBgColor:"#F7F8FA",inlineRowBgColor:"#F3F8FF",inlineColumnBgColor:"#F3F8FF"}},frameStyle:{borderColor:"#d1d5da",borderLineWidth:1,borderLineDash:[],cornerRadius:4,shadowBlur:6,shadowOffsetX:0,shadowOffsetY:0,shadowColor:"rgba(00, 24, 47, 0.06)"},columnResize:{lineWidth:1,lineColor:"#416EFF",bgColor:"#D9E2FF",width:3},frozenColumnLine:{shadow:{width:4,startColor:"rgba(00, 24, 47, 0.05)",endColor:"rgba(00, 24, 47, 0)"}},selectionStyle:{cellBgColor:"rgba(0, 0, 255,0.1)",cellBorderLineWidth:2,cellBorderColor:"#3073f2"},tooltipStyle:{bgColor:"#FFF",color:"#000",fontSize:12,fontFamily:"Arial,sans-serif"}};var nx={name:"DEFAULT",underlayBackgroundColor:"#FFF",defaultStyle:{borderColor:"#E1E4E8",color:"#000",bgColor:"#ECF1F5"},headerStyle:{fontSize:16,fontWeight:"bold",bgColor:"#ECF1F5",hover:{cellBgColor:"#CCE0FF",inlineRowBgColor:"#F3F8FF",inlineColumnBgColor:"#F3F8FF"}},rowHeaderStyle:{fontSize:16,fontWeight:"bold",bgColor:"#ECF1F5",hover:{cellBgColor:"#CCE0FF",inlineRowBgColor:"#F3F8FF",inlineColumnBgColor:"#F3F8FF"}},cornerHeaderStyle:{fontSize:16,fontWeight:"bold"},bodyStyle:{fontSize:14,bgColor:function(t){const{row:e,table:i}=t;return 1&e-i.frozenRowCount?"#FDFDFD":"#FAF9FB"},hover:{cellBgColor:"#CCE0FF",inlineRowBgColor:"#F3F8FF",inlineColumnBgColor:"#F3F8FF"}},frameStyle:{borderColor:"#E1E4E8",borderLineWidth:1,borderLineDash:[],cornerRadius:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,shadowColor:"black"},columnResize:{lineWidth:1,lineColor:"#416EFF",bgColor:"#D9E2FF",width:3},frozenColumnLine:{shadow:{width:3,startColor:"rgba(225, 228, 232, 0.6)",endColor:"rgba(225, 228, 232, 0.6)"}},selectionStyle:{cellBgColor:"rgba(0, 0, 255,0.1)",cellBorderLineWidth:2,cellBorderColor:"#0000ff"},tooltipStyle:{bgColor:"#FFF",color:"#000",fontSize:12,fontFamily:"Arial,sans-serif"}};var rx={name:"SIMPLIFY",underlayBackgroundColor:"#FFF",defaultStyle:{borderColor:function(t){const{col:e,table:i}=t,{colCount:o,frozenColCount:n}=i,r="#ccc7c7";return n-1===e||o-1===e?[r,"#f2f2f2","#ccc7c7",null]:[r,null,"#ccc7c7",null]},hover:{cellBorderColor:"#0000FF",cellBgColor:"#D0E0E3"},bgColor:"#FFF"},headerStyle:{color:"rgba(0, 0, 0, 0.87)",borderColor:function(t){const{row:e,table:{frozenRowCount:i}}=t;return i-1===e?["#f2f2f2","#f2f2f2","#ccc7c7","#f2f2f2"]:["#f2f2f2"]}},bodyStyle:{color:"rgba(0, 0, 0, 0.87)"},frameStyle:{borderColor:"#f2f2f2",borderLineWidth:1},columnResize:{lineWidth:1,lineColor:"#416EFF",bgColor:"#D9E2FF"},selectionStyle:{cellBorderColor:"#FD5",cellBgColor:"rgba(111, 168, 220, 0.1)"},tooltipStyle:{bgColor:"#FFF",color:"#000",fontSize:12,fontFamily:"Arial,sans-serif"}};const sx={},lx="Arial,sans-serif",ax=[],hx=/^(https?|ftp|file):\/\/[-A-Za-z0-9+&@#/%?=~_|!:,.;]+[-A-Za-z0-9+&@#/%=~_|]/,dx="$$indicator$$",cx={type:"line"};function ux(t){return t||{}}const gx={visible:!0,position:"auto",padding:8,titleStyle:{fontSize:12,fontWeight:"bold",fill:"#4E5969"},contentStyle:{fontSize:12,fill:"#4E5969"},panel:{visible:!0,fill:"#fff",stroke:"#ffffff",lineWidth:0,cornerRadius:3,shadowBlur:12,shadowOffsetX:0,shadowOffsetY:4,shadowColor:"rgba(0, 0, 0, 0.1)",size:0,space:12}};function px(t,e,i,o){var n,r,s;return null!==(s=null!==(r=null!==(n=Ew(t,...i))&&void 0!==n?n:Ew(e,...i))&&void 0!==r?r:o&&Ew(t,...o))&&void 0!==s?s:o&&Ew(e,...o)}class fx{constructor(t,e){this._defaultStyle=null,this._header=null,this._cornerHeader=null,this._cornerRightTopCell=null,this._cornerLeftBottomCell=null,this._cornerRightBottomCell=null,this._rightFrozen=null,this._bottomFrozen=null,this._rowHeader=null,this._body=null,this._groupTitle=null,this._scroll=null,this._tooltip=null,this._frameStyle=null,this._columnResize=null,this._dragHeaderSplitLine=null,this._frozenColumnLine=null,this._selectionStyle=null,this._axisStyle=null,this._checkboxStyle=null,this._radioStyle=null,this._textPopTipStyle=null,this._internalIconsStyle=null,this.isPivot=!1,this.name="",this.internalTheme={obj:t,superTheme:e},this.name=px(t,e,["name"])}getExtendTheme(){return this.internalTheme.obj}clearBodyStyleCache(){this._body=null}get font(){const{obj:t,superTheme:e}=this.internalTheme;return px(t,e,["font"],["bodyStyle","font"])}get underlayBackgroundColor(){const{obj:t,superTheme:e}=this.internalTheme;return px(t,e,["underlayBackgroundColor"])}get cellInnerBorder(){var t;const{obj:e,superTheme:i}=this.internalTheme;return null===(t=px(e,i,["cellInnerBorder"]))||void 0===t||t}get cellBorderClipDirection(){var t;const{obj:e,superTheme:i}=this.internalTheme;return null!==(t=px(e,i,["cellBorderClipDirection"]))&&void 0!==t?t:"top-left"}get _contentOffset(){var t;const{obj:e,superTheme:i}=this.internalTheme;return null!==(t=px(e,i,["_contentOffset"]))&&void 0!==t?t:0}get defaultStyle(){const t=this;if(!this._defaultStyle){const{obj:e,superTheme:i}=this.internalTheme,o=uw({},i.defaultStyle,e.defaultStyle);this._defaultStyle={get fontSize(){var t;return null!==(t=o.fontSize)&&void 0!==t?t:16},get fontFamily(){var t;return null!==(t=o.fontFamily)&&void 0!==t?t:lx},get fontWeight(){return o.fontWeight},get fontVariant(){return o.fontVariant},get fontStyle(){return o.fontStyle},get bgColor(){var t;return null!==(t=o.bgColor)&&void 0!==t?t:"#FFF"},get color(){var t;return null!==(t=o.color)&&void 0!==t?t:"#000"},get borderColor(){var t;return null!==(t=o.borderColor)&&void 0!==t?t:"#000"},get borderLineWidth(){var t;return null!==(t=o.borderLineWidth)&&void 0!==t?t:1},get borderLineDash(){var t;return null!==(t=o.borderLineDash)&&void 0!==t?t:ax},get hover(){if(o.hover)return{get cellBgColor(){var t,e;return null!==(e=null===(t=o.hover)||void 0===t?void 0:t.cellBgColor)&&void 0!==e?e:void 0},get inlineColumnBgColor(){var t,e,i,n,r,s;return null!==(s=null!==(e=null===(t=o.hover)||void 0===t?void 0:t.inlineColumnBgColor)&&void 0!==e?e:(null===(i=o.hover)||void 0===i?void 0:i.cellBgColor)&&"string"==typeof(null===(n=o.hover)||void 0===n?void 0:n.cellBgColor)?vw(null===(r=o.hover)||void 0===r?void 0:r.cellBgColor,.1,!1):void 0)&&void 0!==s?s:void 0},get inlineRowBgColor(){var t,e,i,n,r,s;return null!==(s=null!==(e=null===(t=o.hover)||void 0===t?void 0:t.inlineRowBgColor)&&void 0!==e?e:(null===(i=o.hover)||void 0===i?void 0:i.cellBgColor)&&"string"==typeof(null===(n=o.hover)||void 0===n?void 0:n.cellBgColor)?vw(null===(r=o.hover)||void 0===r?void 0:r.cellBgColor,.1,!1):void 0)&&void 0!==s?s:void 0}}},get select(){if(o.select)return{get inlineColumnBgColor(){var e,i,n,r,s,l;return null!==(l=null!==(r=null!==(i=null===(e=o.select)||void 0===e?void 0:e.inlineColumnBgColor)&&void 0!==i?i:null===(n=t.selectionStyle)||void 0===n?void 0:n.inlineColumnBgColor)&&void 0!==r?r:(null===(s=t.selectionStyle)||void 0===s?void 0:s.cellBgColor)&&"string"==typeof t.selectionStyle.cellBgColor?vw(t.selectionStyle.cellBgColor,.1,!1):void 0)&&void 0!==l?l:void 0},get inlineRowBgColor(){var e,i,n,r,s;return null!==(s=null!==(n=null!==(i=null===(e=o.select)||void 0===e?void 0:e.inlineRowBgColor)&&void 0!==i?i:t.selectionStyle.inlineRowBgColor)&&void 0!==n?n:(null===(r=t.selectionStyle)||void 0===r?void 0:r.cellBgColor)&&"string"==typeof t.selectionStyle.cellBgColor?vw(t.selectionStyle.cellBgColor,.1,!1):void 0)&&void 0!==s?s:void 0}}},get padding(){var t;return null!==(t=o.padding)&&void 0!==t?t:[10,16,10,16]},get textAlign(){var t;return null!==(t=o.textAlign)&&void 0!==t?t:"left"},get textBaseline(){var t;return null!==(t=o.textBaseline)&&void 0!==t?t:"middle"},get textOverflow(){var t;return null!==(t=o.textOverflow)&&void 0!==t?t:"ellipsis"},get lineHeight(){return o.lineHeight},get autoWrapText(){var t;return null!==(t=o.autoWrapText)&&void 0!==t&&t},get lineClamp(){var t;return null!==(t=o.lineClamp)&&void 0!==t?t:"auto"},get linkColor(){var t;return null!==(t=o.linkColor)&&void 0!==t?t:"#3772ff"},get cursor(){var t;return null!==(t=o.cursor)&&void 0!==t?t:"auto"},get marked(){var t;return null!==(t=o.marked)&&void 0!==t&&t},get underline(){var t;return null!==(t=o.underline)&&void 0!==t&&t},get underlineColor(){return o.underlineColor},get underlineDash(){return o.underlineDash},get underlineOffset(){return o.underlineOffset},get lineThrough(){var t;return null!==(t=o.lineThrough)&&void 0!==t&&t},get lineThroughColor(){return o.lineThroughColor},get lineThroughDash(){return o.lineThroughDash}}}return this._defaultStyle}get cornerHeaderStyle(){if(!this._cornerHeader){const{obj:t,superTheme:e}=this.internalTheme,i=uw({},this.defaultStyle,e.cornerHeaderStyle,t.cornerHeaderStyle);this._cornerHeader=this.getStyle(i)}return this._cornerHeader}get cornerRightTopCellStyle(){if(!this._cornerRightTopCell){const{obj:t,superTheme:e}=this.internalTheme;if(!e.cornerRightTopCellStyle&&!t.cornerRightTopCellStyle)return this._cornerRightTopCell;const i=uw({},this.defaultStyle,e.cornerRightTopCellStyle,t.cornerRightTopCellStyle);this._cornerRightTopCell=this.getStyle(i)}return this._cornerRightTopCell}get cornerLeftBottomCellStyle(){if(!this._cornerLeftBottomCell){const{obj:t,superTheme:e}=this.internalTheme;if(!e.cornerLeftBottomCellStyle&&!t.cornerLeftBottomCellStyle)return this._cornerLeftBottomCell;const i=uw({},this.defaultStyle,e.cornerLeftBottomCellStyle,t.cornerLeftBottomCellStyle);this._cornerLeftBottomCell=this.getStyle(i)}return this._cornerLeftBottomCell}get cornerRightBottomCellStyle(){if(!this._cornerRightBottomCell){const{obj:t,superTheme:e}=this.internalTheme;if(!e.cornerRightBottomCellStyle&&!t.cornerRightBottomCellStyle)return this._cornerRightBottomCell;const i=uw({},this.defaultStyle,e.cornerRightBottomCellStyle,t.cornerRightBottomCellStyle);this._cornerRightBottomCell=this.getStyle(i)}return this._cornerRightBottomCell}get rightFrozenStyle(){if(!this._rightFrozen){const{obj:t,superTheme:e}=this.internalTheme;if(!e.rightFrozenStyle&&!t.rightFrozenStyle)return this._rightFrozen;const i=uw({},this.defaultStyle,this.rowHeaderStyle,e.rightFrozenStyle,t.rightFrozenStyle);this._rightFrozen=this.getStyle(i)}return this._rightFrozen}get bottomFrozenStyle(){if(!this._bottomFrozen){const{obj:t,superTheme:e}=this.internalTheme;if(!e.bottomFrozenStyle&&!t.bottomFrozenStyle)return this._bottomFrozen;const i=uw({},this.defaultStyle,this.headerStyle,e.bottomFrozenStyle,t.bottomFrozenStyle);this._bottomFrozen=this.getStyle(i)}return this._bottomFrozen}get rowHeaderStyle(){var t;if(!this._rowHeader){const{obj:e,superTheme:i}=this.internalTheme,o=uw({},this.defaultStyle,i.rowHeaderStyle,null!==(t=e.rowHeaderStyle)&&void 0!==t?t:this.isPivot?null:e.headerStyle);this._rowHeader=this.getStyle(o)}return this._rowHeader}get headerStyle(){if(!this._header){const{obj:t,superTheme:e}=this.internalTheme,i=uw({},this.defaultStyle,e.headerStyle,t.headerStyle);this._header=this.getStyle(i)}return this._header}get bodyStyle(){if(!this._body){const{obj:t,superTheme:e}=this.internalTheme,i=uw({},this.defaultStyle,e.bodyStyle,t.bodyStyle);this._body=this.getStyle(i)}return this._body}get groupTitleStyle(){if(!this._groupTitle){const{obj:t,superTheme:e}=this.internalTheme;if(!e.groupTitleStyle&&!t.groupTitleStyle)return this._groupTitle;const i=uw({},this.defaultStyle,e.groupTitleStyle,t.groupTitleStyle);this._groupTitle=this.getStyle(i)}return this._groupTitle}get frameStyle(){if(!this._frameStyle){const{obj:t,superTheme:e}=this.internalTheme,i=uw({},e.frameStyle,t.frameStyle);this._frameStyle={get borderColor(){return i.borderColor},get borderLineWidth(){return i.borderLineWidth},get borderLineDash(){return i.borderLineDash},get innerBorder(){return i.innerBorder},get shadowBlur(){return i.shadowBlur},get shadowColor(){return i.shadowColor},get shadowOffsetX(){return i.shadowOffsetX},get shadowOffsetY(){return i.shadowOffsetY},get cornerRadius(){return i.cornerRadius}}}return this._frameStyle}get scrollStyle(){if(!this._scroll){const{obj:t,superTheme:e}=this.internalTheme,i=uw({},e.scrollStyle,t.scrollStyle);this._scroll={get scrollSliderColor(){var t;return null!==(t=i.scrollSliderColor)&&void 0!==t?t:"#C0C0C0"},get scrollSliderCornerRadius(){return i.scrollSliderCornerRadius},get scrollRailColor(){return i.scrollRailColor},get visible(){var t;return null!==(t=i.visible)&&void 0!==t?t:"scrolling"},get verticalVisible(){return i.verticalVisible},get horizontalVisible(){return i.horizontalVisible},get width(){var t;return null!==(t=i.width)&&void 0!==t?t:7},get hoverOn(){var t;return null===(t=i.hoverOn)||void 0===t||t},get barToSide(){var t;return null!==(t=i.barToSide)&&void 0!==t&&t},get horizontalPadding(){var t;return null!==(t=i.horizontalPadding)&&void 0!==t?t:0},get verticalPadding(){var t;return null!==(t=i.verticalPadding)&&void 0!==t?t:0}}}return this._scroll}get tooltipStyle(){if(!this._tooltip){const{obj:t,superTheme:e}=this.internalTheme,i=uw({},e.tooltipStyle,t.tooltipStyle);this._tooltip={get fontFamily(){var t;return null!==(t=i.fontFamily)&&void 0!==t?t:lx},get fontSize(){var t;return null!==(t=i.fontSize)&&void 0!==t?t:16},get bgColor(){var t;return null!==(t=i.bgColor)&&void 0!==t?t:"#000"},get padding(){var t;return null!==(t=i.padding)&&void 0!==t?t:[6,8]},get color(){var t;return null!==(t=i.color)&&void 0!==t?t:"#FFF"},get maxWidth(){return i.maxWidth},get maxHeight(){return i.maxHeight}}}return this._tooltip}get columnResize(){if(!this._columnResize){const{obj:t,superTheme:e}=this.internalTheme,i=uw({},e.columnResize,t.columnResize);this._columnResize={get lineColor(){var t;return null!==(t=i.lineColor)&&void 0!==t?t:"#416EFF"},get bgColor(){var t;return null!==(t=i.bgColor)&&void 0!==t?t:"#D9E2FF"},get lineWidth(){var t;return null!==(t=i.lineWidth)&&void 0!==t?t:1},get width(){var t;return null!==(t=i.width)&&void 0!==t?t:i.lineWidth+2},get labelColor(){var t;return null!==(t=i.labelColor)&&void 0!==t?t:"#FFF"},get labelFontSize(){var t;return null!==(t=i.labelFontSize)&&void 0!==t?t:10},get labelFontFamily(){var t;return null!==(t=i.labelFontFamily)&&void 0!==t?t:"sans-serif"},get labelBackgroundFill(){var t;return null!==(t=i.labelBackgroundFill)&&void 0!==t?t:"#3073F2"},get labelBackgroundCornerRadius(){var t;return null!==(t=i.labelBackgroundCornerRadius)&&void 0!==t?t:5},get labelVisible(){var t;return null===(t=i.labelVisible)||void 0===t||t}}}return this._columnResize}get dragHeaderSplitLine(){if(!this._dragHeaderSplitLine){const{obj:t,superTheme:e}=this.internalTheme,i=uw({},e.dragHeaderSplitLine,t.dragHeaderSplitLine);this._dragHeaderSplitLine={get lineColor(){var t;return null!==(t=i.lineColor)&&void 0!==t?t:"blue"},get lineWidth(){var t;return null!==(t=i.lineWidth)&&void 0!==t?t:2},get shadowBlockColor(){var t;return null!==(t=i.shadowBlockColor)&&void 0!==t?t:"rgba(204,204,204,0.3)"}}}return this._dragHeaderSplitLine}get frozenColumnLine(){if(!this._frozenColumnLine){const{obj:t,superTheme:e}=this.internalTheme,i=uw({},e.frozenColumnLine,t.frozenColumnLine);this._frozenColumnLine={get shadow(){if(i.shadow)return{get width(){var t,e;return null!==(e=null===(t=i.shadow)||void 0===t?void 0:t.width)&&void 0!==e?e:24},get startColor(){var t,e;return null!==(e=null===(t=i.shadow)||void 0===t?void 0:t.startColor)&&void 0!==e?e:"rgba(00, 24, 47, 0.06)"},get endColor(){var t,e;return null!==(e=null===(t=i.shadow)||void 0===t?void 0:t.endColor)&&void 0!==e?e:"rgba(00, 24, 47, 0)"}}},get border(){if(i.border)return{get lineColor(){var t,e;return null!==(e=null===(t=i.border)||void 0===t?void 0:t.lineColor)&&void 0!==e?e:"rgba(00, 24, 47, 0.06)"},get bgColor(){var t,e,o,n;return null!==(n=null!==(e=null===(t=i.border)||void 0===t?void 0:t.bgColor)&&void 0!==e?e:null===(o=i.border)||void 0===o?void 0:o.lineColor)&&void 0!==n?n:"rgba(00, 24, 47, 0.06)"},get lineWidth(){var t,e;return null!==(e=null===(t=i.border)||void 0===t?void 0:t.lineWidth)&&void 0!==e?e:4},get width(){var t,e,o,n;return null!==(n=null!==(e=null===(t=i.border)||void 0===t?void 0:t.width)&&void 0!==e?e:null===(o=i.border)||void 0===o?void 0:o.lineWidth)&&void 0!==n?n:4}}}}}return this._frozenColumnLine}get selectionStyle(){if(!this._selectionStyle){const{obj:t,superTheme:e}=this.internalTheme,i=uw({},e.selectionStyle,t.selectionStyle);this._selectionStyle={get cellBgColor(){var t;return null!==(t=null==i?void 0:i.cellBgColor)&&void 0!==t?t:"rgba(0, 0, 255,0.1)"},get cellBorderColor(){var t;return null!==(t=null==i?void 0:i.cellBorderColor)&&void 0!==t?t:"#3073f2"},get cellBorderLineWidth(){var t;return null!==(t=null==i?void 0:i.cellBorderLineWidth)&&void 0!==t?t:2},get inlineColumnBgColor(){return null==i?void 0:i.inlineColumnBgColor},get inlineRowBgColor(){return null==i?void 0:i.inlineRowBgColor},get selectionFillMode(){var t;return null!==(t=null==i?void 0:i.selectionFillMode)&&void 0!==t?t:"overlay"}}}return this._selectionStyle}get axisStyle(){if(!this._axisStyle){const{obj:t,superTheme:e}=this.internalTheme,i=uw({},e.axisStyle,t.axisStyle);this._axisStyle=function(t){return{defaultAxisStyle:ux(t.defaultAxisStyle),leftAxisStyle:ux(t.leftAxisStyle),rightAxisStyle:ux(t.rightAxisStyle),topAxisStyle:ux(t.topAxisStyle),bottomAxisStyle:ux(t.bottomAxisStyle)}}(i)}return this._axisStyle}get checkboxStyle(){if(!this._checkboxStyle){const{obj:t,superTheme:e}=this.internalTheme,i=uw({},e.checkboxStyle,t.checkboxStyle);this._checkboxStyle=i}return this._checkboxStyle}get radioStyle(){if(!this._radioStyle){const{obj:t,superTheme:e}=this.internalTheme,i=uw({},e.radioStyle,t.radioStyle);this._radioStyle=i}return this._radioStyle}get textPopTipStyle(){if(!this._textPopTipStyle){const{obj:t,superTheme:e}=this.internalTheme,i=uw({},gx,e.textPopTipStyle,t.textPopTipStyle);this._textPopTipStyle=i}return this._textPopTipStyle}get functionalIconsStyle(){if(!this._internalIconsStyle){const{obj:t,superTheme:e}=this.internalTheme,i=uw({},e.functionalIconsStyle,t.functionalIconsStyle);this._internalIconsStyle=i}return this._internalIconsStyle}hasProperty(t){const{obj:e,superTheme:i}=this.internalTheme;return vx(e,t)||vx(i,t)}extends(t){return new fx(uw({},t),uw(this.internalTheme.superTheme,this.internalTheme.obj))}getStyle(t){const e=this;return{get fontSize(){return t.fontSize},get fontFamily(){return t.fontFamily},get fontWeight(){return t.fontWeight},get fontVariant(){return t.fontVariant},get fontStyle(){return t.fontStyle},get bgColor(){return t.bgColor},get color(){return t.color},get strokeColor(){return t.strokeColor},get borderColor(){return t.borderColor},get borderLineWidth(){return t.borderLineWidth},get borderLineDash(){return t.borderLineDash},get hover(){if(t.hover)return{get cellBgColor(){var e,i;return null!==(i=null===(e=t.hover)||void 0===e?void 0:e.cellBgColor)&&void 0!==i?i:void 0},get inlineColumnBgColor(){var e,i,o,n,r,s;return null!==(s=null!==(i=null===(e=t.hover)||void 0===e?void 0:e.inlineColumnBgColor)&&void 0!==i?i:(null===(o=t.hover)||void 0===o?void 0:o.cellBgColor)&&"string"==typeof(null===(n=t.hover)||void 0===n?void 0:n.cellBgColor)?vw(null===(r=t.hover)||void 0===r?void 0:r.cellBgColor,.1,!1):void 0)&&void 0!==s?s:void 0},get inlineRowBgColor(){var e,i,o,n,r,s;return null!==(s=null!==(i=null===(e=t.hover)||void 0===e?void 0:e.inlineRowBgColor)&&void 0!==i?i:(null===(o=t.hover)||void 0===o?void 0:o.cellBgColor)&&"string"==typeof(null===(n=t.hover)||void 0===n?void 0:n.cellBgColor)?vw(null===(r=t.hover)||void 0===r?void 0:r.cellBgColor,.1,!1):void 0)&&void 0!==s?s:void 0}}},get select(){return{get inlineColumnBgColor(){var i,o,n,r,s,l;return null!==(l=null!==(r=null!==(o=null===(i=t.select)||void 0===i?void 0:i.inlineColumnBgColor)&&void 0!==o?o:null===(n=e.selectionStyle)||void 0===n?void 0:n.inlineColumnBgColor)&&void 0!==r?r:(null===(s=e.selectionStyle)||void 0===s?void 0:s.cellBgColor)&&"string"==typeof e.selectionStyle.cellBgColor?vw(e.selectionStyle.cellBgColor,.1,!1):void 0)&&void 0!==l?l:void 0},get inlineRowBgColor(){var i,o,n,r,s;return null!==(s=null!==(n=null!==(o=null===(i=t.select)||void 0===i?void 0:i.inlineRowBgColor)&&void 0!==o?o:e.selectionStyle.inlineRowBgColor)&&void 0!==n?n:(null===(r=e.selectionStyle)||void 0===r?void 0:r.cellBgColor)&&"string"==typeof e.selectionStyle.cellBgColor?vw(e.selectionStyle.cellBgColor,.1,!1):void 0)&&void 0!==s?s:void 0},get cellBgColor(){var i,o,n;if("replace"===e.selectionStyle.selectionFillMode)return null!==(n=null!==(o=null===(i=t.select)||void 0===i?void 0:i.cellBgColor)&&void 0!==o?o:e.selectionStyle.cellBgColor)&&void 0!==n?n:void 0}}},get frameStyle(){if(t.frameStyle)return{get borderColor(){var e,i;return null!==(i=null===(e=t.frameStyle)||void 0===e?void 0:e.borderColor)&&void 0!==i?i:void 0},get borderLineWidth(){var e,i;return null!==(i=null===(e=t.frameStyle)||void 0===e?void 0:e.borderLineWidth)&&void 0!==i?i:void 0},get borderLineDash(){var e,i;return null!==(i=null===(e=t.frameStyle)||void 0===e?void 0:e.borderLineDash)&&void 0!==i?i:void 0}}},get padding(){return t.padding},get textAlign(){return t.textAlign},get textBaseline(){return t.textBaseline},get textOverflow(){return t.textOverflow},get lineHeight(){return t.lineHeight},get autoWrapText(){return t.autoWrapText},get lineClamp(){return t.lineClamp},get linkColor(){return t.linkColor},get cursor(){return t.cursor},get textStick(){return t.textStick},get marked(){return t.marked},get underline(){var e;return null!==(e=t.underline)&&void 0!==e&&e},get underlineColor(){return t.underlineColor},get underlineDash(){return t.underlineDash},get underlineOffset(){return t.underlineOffset},get lineThrough(){var e;return null!==(e=t.lineThrough)&&void 0!==e&&e},get lineThroughColor(){return t.lineThroughColor},get lineThroughDash(){return t.lineThroughDash}}}}function vx(t,e){if(t instanceof fx)return t.hasProperty(e);let i=t;if(!i)return!1;for(let t=0;t<e.length;t++)if(i=i[e[t]],!i)return!1;return!!i}const mx=new fx(ex,ex),bx=new fx(ix,ix),yx=new fx(ox,ox),Cx=new fx(nx,nx),wx=new fx(rx,rx),xx={DEFAULT:Cx,SIMPLIFY:wx,ARCO:yx,DARK:mx,BRIGHT:bx},_x={TableTheme:fx};function Sx(t){if(!t)return null;if("string"==typeof t){const e=function(t,e){if(t[e])return t[e];const i=e.toLowerCase();if(t[i])return t[i];const o=e.toLowerCase();if(t[o])return t[o];for(const e in t)if(e.toLowerCase()===i)return t[e]}(Ax(),t);return e?e instanceof fx?e:new fx(e,e):null}return t instanceof fx?t:new fx(t,t)}function Ax(){return Lw(xx,sx)}var Bx={DARK:mx,BRIGHT:bx,ARCO:yx,DEFAULT:Cx,SIMPLIFY:wx,theme:_x,of:Sx,get:Ax},Rx=Object.freeze({__proto__:null,ARCO:yx,BRIGHT:bx,DARK:mx,DEFAULT:Cx,SIMPLIFY:wx,TableTheme:fx,default:Bx,get:Ax,of:Sx,theme:_x});function Mx(t,e,i){var o;if(t.internalProps.customMergeCell){const o=t.getCustomMerge(e,i);if(o)return o.range}if(!t.internalProps.enableTreeNodeMerge&&!t.isHeader(e,i)&&!(null===(o=t.getBodyColumnDefine(e,i))||void 0===o?void 0:o.mergeCell))return!1;const n=t.getCellRange(e,i);return!(n.start.col===n.end.col&&n.start.row===n.end.row)&&n}class Tx{static registerComponent(t,e){Tx._components[t]=e}static getComponent(t){return Tx._components[t]}static registerFunction(t,e){Tx._functions[t]=e}static getFunction(t){return Tx._functions[t]}static registerCellType(t,e){Tx._cellTypes[t]=e}static getCellType(t){return Tx._cellTypes[t]}}function kx(t,e,i,o,n,r){const s=function(t,e){const i=new Array(e);for(let o=0;o<e;o++)i[o]=t(o);return i}(t,i);s.sort(((t,e)=>o(r(t),r(e),n)));for(let t=0;t<i;t++)e(t,s[t])}Tx._components={},Tx._functions={},Tx._cellTypes={};class Lx{constructor(t){var e;this.className="Aggregator",this.isRecord=!0,this.records=[],this.key=t.key,this.field=t.dimension,this.formatFun=t.formatFun,this.isRecord=null!==(e=t.isRecord)&&void 0!==e?e:this.isRecord}clearCacheValue(){this._formatedValue=void 0}formatValue(t,e,i){return this._formatedValue||(this.formatFun?this._formatedValue=this.formatFun(this.value(),t,e,i):this._formatedValue=this.value()),this._formatedValue}reset(){this.records=[],this.clearCacheValue()}}class Px extends Lx{constructor(){super(...arguments),this.type=NC.RECORD,this.isRecord=!0}push(t){t&&this.isRecord&&this.records&&("Aggregator"===t.className?this.records.push(...t.records):this.records.push(t)),this.clearCacheValue()}deleteRecord(t){t&&this.isRecord&&this.records&&(this.records=this.records.filter((e=>e!==t))),this.clearCacheValue()}updateRecord(t,e){t&&e&&(this.isRecord&&this.records&&(this.records=this.records.map((i=>i===t?e:i))),this.clearCacheValue())}value(){return this.records}reset(){this.records=[]}recalculate(){}}class Ex extends Lx{constructor(){super(...arguments),this.type=NC.NONE,this.isRecord=!0}push(t){t&&(this.isRecord&&(this.records=[t]),this.field&&(this.fieldValue=t[this.field])),this.clearCacheValue()}deleteRecord(t){t&&(this.isRecord&&this.records&&(this.records=this.records.filter((e=>e!==t))),this.field&&this.records.length&&(this.fieldValue=this.records[this.records.length-1][this.field])),this.clearCacheValue()}updateRecord(t,e){t&&e&&(this.isRecord&&this.records&&(this.records=this.records.map((i=>i===t?e:i))),this.field&&this.records.length&&(this.fieldValue=this.records[this.records.length-1][this.field]),this.clearCacheValue())}value(){return this.fieldValue}reset(){this.records=[],this.fieldValue=void 0}recalculate(){}}class Hx extends Lx{constructor(t){super(t),this.type=NC.CUSTOM,this.isRecord=!0,this.values=[],this.aggregationFun=t.aggregationFun}push(t){t&&(this.isRecord&&this.records&&("Aggregator"===t.className?this.records.push(...t.records):this.records.push(t)),this.field&&this.values.push(t[this.field])),this.clearCacheValue()}updateRecord(t,e){t&&e&&(this.isRecord&&this.records&&(this.records=this.records.map((i=>i===t?e:i))),this.field&&this.records.length&&(this.values=this.records.map((t=>t[this.field]))),this.clearCacheValue())}deleteRecord(t){t&&(this.isRecord&&this.records&&(this.records=this.records.filter((e=>e!==t))),this.field&&this.records.length&&(this.values=this.records.map((t=>t[this.field])))),this.clearCacheValue()}value(){var t;return this.fieldValue||(this.fieldValue=null===(t=this.aggregationFun)||void 0===t?void 0:t.call(this,this.values,this.records,this.field)),this.fieldValue}reset(){this.records=[],this.fieldValue=void 0}recalculate(){}}class Fx extends Lx{constructor(t){var e;super(t),this.type=NC.SUM,this.sum=0,this.positiveSum=0,this.nagetiveSum=0,this.needSplitPositiveAndNegativeForSum=!1,this.needSplitPositiveAndNegativeForSum=null!==(e=t.needSplitPositiveAndNegative)&&void 0!==e&&e}push(t){if(t)if(this.isRecord&&this.records&&("Aggregator"===t.className?this.records.push(...t.records):this.records.push(t)),"Aggregator"===t.className){const e=t.value();this.sum+=null!=e?e:0,this.needSplitPositiveAndNegativeForSum&&(e>0?this.positiveSum+=e:e<0&&(this.nagetiveSum+=e))}else if(this.field&&!isNaN(parseFloat(t[this.field]))){const e=parseFloat(t[this.field]);this.sum+=e,this.needSplitPositiveAndNegativeForSum&&(e>0?this.positiveSum+=e:e<0&&(this.nagetiveSum+=e))}this.clearCacheValue()}deleteRecord(t){if(t)if(this.isRecord&&this.records&&(this.records=this.records.filter((e=>e!==t))),"Aggregator"===t.className){const e=t.value();this.sum-=null!=e?e:0,this.needSplitPositiveAndNegativeForSum&&(e>0?this.positiveSum-=e:e<0&&(this.nagetiveSum-=e))}else if(this.field&&!isNaN(parseFloat(t[this.field]))){const e=parseFloat(t[this.field]);this.sum-=e,this.needSplitPositiveAndNegativeForSum&&(e>0?this.positiveSum-=e:e<0&&(this.nagetiveSum-=e))}this.clearCacheValue()}updateRecord(t,e){if(t&&e){if(this.isRecord&&this.records&&(this.records=this.records.map((i=>i===t?e:i))),"Aggregator"===t.className){const i=t.value(),o=e.value();this.sum+=o-i,this.needSplitPositiveAndNegativeForSum&&(i>0?this.positiveSum-=i:i<0&&(this.nagetiveSum-=i),o>0?this.positiveSum+=o:o<0&&(this.nagetiveSum+=o))}else if(this.field&&!isNaN(parseFloat(t[this.field]))){const i=parseFloat(t[this.field]),o=parseFloat(e[this.field]);this.sum+=o-i,this.needSplitPositiveAndNegativeForSum&&(i>0?this.positiveSum-=i:i<0&&(this.nagetiveSum-=i),o>0?this.positiveSum+=o:o<0&&(this.nagetiveSum+=o))}this.clearCacheValue()}}value(){var t;return(null===(t=this.records)||void 0===t?void 0:t.length)>=1?this.sum:void 0}positiveValue(){return this.positiveSum}negativeValue(){return this.nagetiveSum}reset(){super.reset(),this.records=[],this.sum=0}recalculate(){if(this.sum=0,this._formatedValue=void 0,this.records)for(let t=0;t<this.records.length;t++){const e=this.records[t];if("Aggregator"===e.className){const t=e.value();this.sum+=null!=t?t:0,this.needSplitPositiveAndNegativeForSum&&(t>0?this.positiveSum+=t:t<0&&(this.nagetiveSum+=t))}else if(this.field&&!isNaN(parseFloat(e[this.field]))){const t=parseFloat(e[this.field]);this.sum+=t,this.needSplitPositiveAndNegativeForSum&&(t>0?this.positiveSum+=t:t<0&&(this.nagetiveSum+=t))}}}}class zx extends Lx{constructor(){super(...arguments),this.type=NC.COUNT,this.count=0}push(t){t&&(this.isRecord&&this.records&&("Aggregator"===t.className?this.records.push(...t.records):this.records.push(t)),"Aggregator"===t.className?this.count+=t.value():this.count++),this.clearCacheValue()}deleteRecord(t){t&&(this.isRecord&&this.records&&(this.records=this.records.filter((e=>e!==t))),"Aggregator"===t.className?this.count-=t.value():this.count--),this.clearCacheValue()}updateRecord(t,e){t&&e&&(this.isRecord&&this.records&&(this.records=this.records.map((i=>i===t?e:i))),"Aggregator"===t.className&&(this.count+=e.value()-t.value()))}value(){return this.count}reset(){this.records=[],this.count=0}recalculate(){if(this.count=0,this._formatedValue=void 0,this.records)for(let t=0;t<this.records.length;t++){const e=this.records[t];"Aggregator"===e.className?this.count+=e.value():this.count++}}}class Ix extends Lx{constructor(){super(...arguments),this.type=NC.AVG,this.sum=0,this.count=0}push(t){t&&(this.isRecord&&this.records&&("Aggregator"===t.className?this.records.push(...t.records):this.records.push(t)),"Aggregator"===t.className&&t.type===NC.AVG?(this.sum+=t.sum,this.count+=t.count):this.field&&!isNaN(parseFloat(t[this.field]))&&(this.sum+=parseFloat(t[this.field]),this.count++)),this.clearCacheValue()}deleteRecord(t){t&&(this.isRecord&&this.records&&(this.records=this.records.filter((e=>e!==t))),"Aggregator"===t.className&&t.type===NC.AVG?(this.sum-=t.sum,this.count-=t.count):this.field&&!isNaN(parseFloat(t[this.field]))&&(this.sum-=parseFloat(t[this.field]),this.count--)),this.clearCacheValue()}updateRecord(t,e){t&&e&&(this.isRecord&&this.records&&(this.records=this.records.map((i=>i===t?e:i))),"Aggregator"===t.className&&t.type===NC.AVG?(this.sum+=e.sum-t.sum,this.count+=e.count-t.count):this.field&&!isNaN(parseFloat(t[this.field]))&&(this.sum+=parseFloat(e[this.field])-parseFloat(t[this.field])),this.clearCacheValue())}value(){var t;return(null===(t=this.records)||void 0===t?void 0:t.length)>=1?this.sum/this.count:void 0}reset(){this.records=[],this.sum=0,this.count=0}recalculate(){if(this.sum=0,this.count=0,this._formatedValue=void 0,this.records)for(let t=0;t<this.records.length;t++){const e=this.records[t];"Aggregator"===e.className&&e.type===NC.AVG?(this.sum+=e.sum,this.count+=e.count):this.field&&!isNaN(parseFloat(e[this.field]))&&(this.sum+=parseFloat(e[this.field]),this.count++)}}}class Ox extends Lx{constructor(){super(...arguments),this.type=NC.MAX,this.max=Number.MIN_SAFE_INTEGER}push(t){t&&(this.isRecord&&this.records&&("Aggregator"===t.className?this.records.push(...t.records):this.records.push(t)),"Aggregator"===t.className?this.max=t.max>this.max?t.max:this.max:"number"==typeof t?this.max=t>this.max?t:this.max:this.field&&"number"==typeof t[this.field]?this.max=t[this.field]>this.max?t[this.field]:this.max:this.field&&!isNaN(t[this.field])&&(this.max=parseFloat(t[this.field])>this.max?parseFloat(t[this.field]):this.max)),this.clearCacheValue()}deleteRecord(t){t&&(this.isRecord&&this.records&&(this.records=this.records.filter((e=>e!==t))),this.recalculate())}updateRecord(t,e){t&&e&&(this.isRecord&&this.records&&(this.records=this.records.map((i=>i===t?e:i))),this.recalculate())}value(){var t;return(null===(t=this.records)||void 0===t?void 0:t.length)>=1?this.max:void 0}reset(){this.records=[],this.max=Number.MIN_SAFE_INTEGER}recalculate(){if(this.max=Number.MIN_SAFE_INTEGER,this._formatedValue=void 0,this.records)for(let t=0;t<this.records.length;t++){const e=this.records[t];"Aggregator"===e.className?this.max=e.max>this.max?e.max:this.max:"number"==typeof e?this.max=e>this.max?e:this.max:this.field&&"number"==typeof e[this.field]?this.max=e[this.field]>this.max?e[this.field]:this.max:this.field&&!isNaN(e[this.field])&&(this.max=parseFloat(e[this.field])>this.max?parseFloat(e[this.field]):this.max)}}}class Dx extends Lx{constructor(){super(...arguments),this.type=NC.MIN,this.min=Number.MAX_SAFE_INTEGER}push(t){t&&(this.isRecord&&this.records&&("Aggregator"===t.className?this.records.push(...t.records):this.records.push(t)),"Aggregator"===t.className?this.min=t.min<this.min?t.min:this.min:"number"==typeof t?this.min=t<this.min?t:this.min:this.field&&"number"==typeof t[this.field]?this.min=t[this.field]<this.min?t[this.field]:this.min:this.field&&!isNaN(t[this.field])&&(this.min=parseFloat(t[this.field])<this.min?parseFloat(t[this.field]):this.min)),this.clearCacheValue()}deleteRecord(t){t&&(this.isRecord&&this.records&&(this.records=this.records.filter((e=>e!==t))),this.recalculate())}updateRecord(t,e){t&&e&&(this.isRecord&&this.records&&(this.records=this.records.map((i=>i===t?e:i))),this.recalculate())}value(){var t;return(null===(t=this.records)||void 0===t?void 0:t.length)>=1?this.min:void 0}reset(){this.records=[],this.min=Number.MAX_SAFE_INTEGER}recalculate(){if(this.min=Number.MAX_SAFE_INTEGER,this._formatedValue=void 0,this.records)for(let t=0;t<this.records.length;t++){const e=this.records[t];"Aggregator"===e.className?this.min=e.min<this.min?e.min:this.min:"number"==typeof e?this.min=e<this.min?e:this.min:this.field&&"number"==typeof e[this.field]?this.min=e[this.field]<this.min?e[this.field]:this.min:this.field&&!isNaN(e[this.field])&&(this.min=parseFloat(e[this.field])<this.min?parseFloat(e[this.field]):this.min)}}}const Wx={SOURCE_LENGTH_UPDATE:"source_length_update",CHANGE_ORDER:"change_order"};function Nx(t,e){const i=Hw(t);if(Fw(i)){const t=i.then((t=>(e(t),t)));return e(t),t}return i}function Gx(t,e,i,o,n,r){if(null==t)return;if(Fw(t))return t.then((t=>Gx(t,e,i,o,n,r)));const s=function(t){if(Gw.isObject(t)){const e=t;if(Q(e.get)&&Q(e.set))return!0}return!1}(e)?e.get:e;if(s in t)return Nx(t[s],r);if("function"==typeof s)return Nx(s(t,i,o,n),r);if(Array.isArray(s))return Nx(function(t,e){let i,o=t;for(;(i=e.shift())&&(o=o[i],o););return o}(t,[...s]),r);const l=`${s}`.split(".");return l.length<=1?Nx(t[s],r):Nx(Pw(t,((t,e)=>Gx(t,e,i,o,n,$w)),...l),r)}function jx(t,e){if(!t)return e;const i=t[e];return Q(i)?i:e}let Vx=class extends YC{static get EVENT_TYPE(){return Wx}constructor(t,e,i,o,n,r){var s;super(),this.currentIndexedData=[],this.hierarchyExpandLevel=0,this.hasHierarchyStateExpand=!1,this.beforeChangedRecordsMap=[],this.registedAggregators={},this.fieldAggregators=[],this.registerAggregators(),this.dataSourceObj=t,this.dataConfig=e,this._get=null==t?void 0:t.get,this.columns=o,this._source=(null==t?void 0:t.records)?this.processRecords(null==t?void 0:t.records):t,this._sourceLength=(null===(s=this._source)||void 0===s?void 0:s.length)||0,this.sortedIndexMap=new Map,this._currentPagerIndexedData=[],this.userPagination=i,this.pagination=i||{totalCount:this._sourceLength,perPageCount:this._sourceLength,currentPage:0},r>=1&&(this.hierarchyExpandLevel=r),this.currentIndexedData=Array.from({length:this._sourceLength},((t,e)=>e)),"tree"===n&&this.initTreeHierarchyState(),this.rowHierarchyType=n,this.updatePagerData()}initTreeHierarchyState(){var t;this.currentIndexedData=Array.from({length:this._sourceLength},((t,e)=>e));let e=this._sourceLength;for(let i=0;i<e;i++){const o=this.currentIndexedData[i],n=this.getOriginalRecord(o),r=null!==(t=n.filteredChildren)&&void 0!==t?t:n.children;if((null==r?void 0:r.length)>0){if(this.hierarchyExpandLevel>1?!n.hierarchyState&&(n.hierarchyState=WC.expand):!n.hierarchyState&&(n.hierarchyState=WC.collapse),this.hasHierarchyStateExpand=!0,n.hierarchyState===WC.collapse)continue;const t=this.initChildrenNodeHierarchy(o,this.hierarchyExpandLevel,2,n);i+=t,e+=t}else!0===n.children&&!n.hierarchyState&&(n.hierarchyState=WC.collapse)}}registerAggregator(t,e){this.registedAggregators[t]=e}registerAggregators(){this.registerAggregator(NC.RECORD,Px),this.registerAggregator(NC.SUM,Fx),this.registerAggregator(NC.COUNT,zx),this.registerAggregator(NC.MAX,Ox),this.registerAggregator(NC.MIN,Dx),this.registerAggregator(NC.AVG,Ix),this.registerAggregator(NC.NONE,Ex),this.registerAggregator(NC.CUSTOM,Hx)}updateColumns(t){this.columns=t}_generateFieldAggragations(){const t=this.columns;this.fieldAggregators=[];for(let e=0;e<(null==t?void 0:t.length);e++){delete t[e].vtable_aggregator;const i=t[e].field,o=t[e].aggregation;if(o)if(Array.isArray(o))for(let n=0;n<o.length;n++){const r=o[n],s=new this.registedAggregators[r.aggregationType]({dimension:i,formatFun:r.formatFun,isRecord:!0,aggregationFun:r.aggregationFun});this.fieldAggregators.push(s),t[e].vtable_aggregator||(t[e].vtable_aggregator=[]),t[e].vtable_aggregator.push(s)}else{const n=new this.registedAggregators[o.aggregationType]({dimension:i,formatFun:o.formatFun,isRecord:!0,aggregationFun:o.aggregationFun});this.fieldAggregators.push(n),t[e].vtable_aggregator=n}}}processRecords(t){var e,i,o,n,r,s,l,a;this._generateFieldAggragations();const h=[],d=this.fieldAggregators.length>=1;if((null===(i=null===(e=this.dataConfig)||void 0===e?void 0:e.filterRules)||void 0===i?void 0:i.length)>=1||(null===(o=this.lastFilterRules)||void 0===o?void 0:o.length)>=1||d){for(let e=0,i=t.length;e<i;e++){const i=t[e];(null===(r=null===(n=this.dataConfig)||void 0===n?void 0:n.filterRules)||void 0===r?void 0:r.length)>=1?this.filterRecord(i)&&(h.push(i),"tree"===this.rowHierarchyType&&i.children&&(i.filteredChildren=this.filteredChildren(i.children)),d&&this.processRecord(i)):(null===(s=this.lastFilterRules)||void 0===s?void 0:s.length)>=1?(this.clearFilteredChildren(i),d&&this.processRecord(i)):d&&this.processRecord(i)}if((null===(a=null===(l=this.dataConfig)||void 0===l?void 0:l.filterRules)||void 0===a?void 0:a.length)>=1)return h}return t}filteredChildren(t){const e=[];for(let i=0,o=t.length;i<o;i++){const o=t[i];this.filterRecord(o)&&(e.push(o),o.children&&(o.filteredChildren=this.filteredChildren(o.children)))}return e}processRecord(t){for(let e=0;e<this.fieldAggregators.length;e++)this.fieldAggregators[e].push(t)}initChildrenNodeHierarchy(t,e,i,o){var n,r,s;let l=0;const a=o.filteredChildren?o.filteredChildren.length:null!==(r=null===(n=o.children)||void 0===n?void 0:n.length)&&void 0!==r?r:0;for(let n=0;n<a;n++){(i<=e||o.hierarchyState===WC.expand)&&(l+=1);const r=o.filteredChildren?o.filteredChildren[n]:o.children[n],a=Array.isArray(t)?t.concat(n):[t,n];(i<=e||o.hierarchyState===WC.expand)&&this.currentIndexedData.splice(this.currentIndexedData.indexOf(t)+l,0,a),(r.filteredChildren?r.filteredChildren.length>0:(null===(s=r.children)||void 0===s?void 0:s.length)>0)&&(i<e||r.hierarchyState===WC.expand?(!r.hierarchyState&&(r.hierarchyState=WC.expand),this.hasHierarchyStateExpand=!0):!r.hierarchyState&&(r.hierarchyState=WC.collapse)),r.hierarchyState===WC.expand&&(l+=this.initChildrenNodeHierarchy(a,e,i+1,r)),!0===r.children&&!r.hierarchyState&&(r.hierarchyState=WC.collapse)}return l}updatePagination(t){this.pagination=t||{totalCount:this._sourceLength,perPageCount:this._sourceLength,currentPage:0},this.updatePagerData()}updatePagerData(){const{currentIndexedData:t}=this,{perPageCount:e,currentPage:i}=this.pagination,o=e*(i||0),n=o+e;if(this._currentPagerIndexedData.length=0,t&&t.length>0){let e=-1;for(let i=0;i<t.length;i++)if((Array.isArray(t[i])&&1===t[i].length||!Array.isArray(t[i]))&&e++,e>=o&&e<n)this._currentPagerIndexedData.push(t[i]);else if(e>=n)break}else if(this._sourceLength>0)throw new Error("currentIndexedData should has values!")}get records(){return Array.isArray(this._source)?this._source:[]}get source(){return this._source}get(t){return this.getOriginalRecord(jx(this.currentPagerIndexedData,t))}getRaw(t){return this.getRawRecord(jx(this.currentPagerIndexedData,t))}getIndexKey(t){return jx(this.currentPagerIndexedData,t)}getTableIndex(t){return Array.isArray(t)?this.currentPagerIndexedData.findIndex((e=>Ht(e,t))):this.currentPagerIndexedData.findIndex((e=>e===t))}getField(t,e,i,o,n){return this.getOriginalField(jx(this.currentPagerIndexedData,t),e,i,o,n)}getRawField(t,e,i,o,n){return this.getRawFieldData(jx(this.currentPagerIndexedData,t),e,i,o,n)}hasField(t,e){return this.hasOriginalField(jx(this.currentPagerIndexedData,t),e)}getHierarchyState(t){var e;const i=this.getOriginalRecord(this.currentIndexedData[t]);return null!==(e=null==i?void 0:i.hierarchyState)&&void 0!==e?e:null}toggleHierarchyState(t,e,i){const o=this.currentIndexedData.slice(0),n=this.getIndexKey(t),r=this.getHierarchyState(t),s=this.getOriginalRecord(n);if(this.clearSortedIndexMap(),r===WC.collapse)s.hierarchyState=WC.expand,this.pushChildrenNode(n,WC.expand,s),this.hasHierarchyStateExpand=!0;else if(r===WC.expand){let t=0;const e=(i,o,n)=>{if(!o||o===WC.collapse||o===WC.none)return;const r=n.filteredChildren?n.filteredChildren:n.children;if(r)for(let o=0;o<r.length;o++){t+=1;const n=Array.isArray(i)?i.concat([o]):[i,o];e(n,r[o].hierarchyState,r[o])}};e(n,r,s),this.currentIndexedData.splice(this.currentIndexedData.indexOf(n)+1,t),s.hierarchyState=WC.collapse}this.updatePagerData();const l=[],a=[];if(r===WC.collapse){const e=this.currentIndexedData.length-o.length;for(let i=0;i<e;i++)l.push(t+i+1)}else if(r===WC.expand){const e=o.length-this.currentIndexedData.length;for(let i=0;i<e;i++)a.push(t+i+1)}return{add:l,remove:a}}pushChildrenNode(t,e,i){var o,n;if(!e||e===WC.collapse||e===WC.none)return 0;let r=0;const s=i.filteredChildren?i.filteredChildren:i.children;if(s){const e=Array.from({length:s.length},((t,e)=>e));null===(o=this.lastSortStates)||void 0===o||o.forEach((i=>{"normal"!==i.order&&kx((t=>Q(e[t])?e[t]:e[t]=t),((t,i)=>{e[t]=i}),s.length,i.orderFn,i.order,(e=>this.getOriginalField(Array.isArray(t)?t.concat([e]):[t,e],i.field)))}));for(let i=0;i<e.length;i++){r+=1;const o=Array.isArray(t)?t.concat([e[i]]):[t,e[i]];this.currentIndexedData.splice(this.currentIndexedData.indexOf(t)+r,0,o);const l=this.getOriginalRecord(o);!l.hierarchyState&&(null!==(n=l.filteredChildren)&&void 0!==n?n:l.children)&&(l.hierarchyState=WC.collapse),r+=this.pushChildrenNode(o,l.hierarchyState,s[e[i]])}}return r}changeFieldValue(t,e,i,o,n,r){var s;if(null!==i&&e>=0){const o=this.getIndexKey(e);if(!this.beforeChangedRecordsMap[o]){const t=this.getOriginalRecord(o);this.beforeChangedRecordsMap[o]=null!==(s=Ct(t))&&void 0!==s?s:{}}if("string"==typeof i||"number"==typeof i){const e=this.beforeChangedRecordsMap[o][i],n=this.getOriginalRecord(o);let r=t;"number"==typeof e&&function(t){return/^-?\d+(\.\d+)?$/.test(t)}(t)&&(r=parseFloat(t)),Fw(n)?n.then((t=>{t[i]=r})).catch((t=>{})):n?n[i]=r:(this.records[o]={},this.records[o][i]=r)}}}setRecord(t,e){var i,o;let n=!0;if((null===(o=null===(i=this.dataConfig)||void 0===i?void 0:i.filterRules)||void 0===o?void 0:o.length)>=1&&(this.filterRecord(t)?"tree"===this.rowHierarchyType&&t.children&&(t.filteredChildren=this.filteredChildren(t.children)):n=!1),n&&Array.isArray(this.records)){const i=this.getIndexKey(e);Array.isArray(i)||this.records.splice(i,1,t)}}addRecord(t,e){var i;if(Array.isArray(this.records)){this.records.splice(e,0,t),this.adjustBeforeChangedRecordsMap(e,1),this.currentIndexedData.push(this.currentIndexedData.length),this._sourceLength+=1;for(let e=0;e<this.fieldAggregators.length;e++)this.fieldAggregators[e].push(t);if("tree"===this.rowHierarchyType&&this.initTreeHierarchyState(),this.userPagination){this.pagination.totalCount=this._sourceLength;const{perPageCount:t,currentPage:i}=this.pagination;e<t*(i||0)+t&&this.updatePagerData()}else this.pagination.perPageCount=this._sourceLength,this.pagination.totalCount=this._sourceLength,this.updatePagerData();(null===(i=this.dataSourceObj)||void 0===i?void 0:i.added)&&this.dataSourceObj.added(e,1)}}addRecords(t,e){var i;if(Array.isArray(this.records)){if(Array.isArray(t)){this.records.splice(e,0,...t),this.adjustBeforeChangedRecordsMap(e,t.length);for(let e=0;e<t.length;e++)this.currentIndexedData.push(this.currentIndexedData.length);this._sourceLength+=t.length;for(let e=0;e<this.fieldAggregators.length;e++)for(let i=0;i<t.length;i++)this.fieldAggregators[e].push(t[i])}if(this.userPagination){this.pagination.totalCount=this._sourceLength;const{perPageCount:t,currentPage:i}=this.pagination;e<t*(i||0)+t&&this.updatePagerData()}else this.pagination.perPageCount=this._sourceLength,this.pagination.totalCount=this._sourceLength,this.updatePagerData();(null===(i=this.dataSourceObj)||void 0===i?void 0:i.added)&&this.dataSourceObj.added(e,t.length)}}addRecordForSorted(t){Array.isArray(this.records)&&(this.beforeChangedRecordsMap=[],this.records.push(t),this.currentIndexedData.push(this.currentIndexedData.length),this._sourceLength+=1,this.sortedIndexMap.clear(),this.userPagination||(this.pagination.perPageCount=this._sourceLength,this.pagination.totalCount=this._sourceLength))}addRecordsForSorted(t){if(Array.isArray(this.records)){if(this.beforeChangedRecordsMap=[],Array.isArray(t)){this.records.push(...t);for(let e=0;e<t.length;e++)this.currentIndexedData.push(this.currentIndexedData.length);this._sourceLength+=t.length,this.sortedIndexMap.clear()}this.userPagination||(this.pagination.perPageCount=this._sourceLength,this.pagination.totalCount=this._sourceLength)}}adjustBeforeChangedRecordsMap(t,e){for(let i=this.beforeChangedRecordsMap.length-1;i>=t;i--){const t=this.beforeChangedRecordsMap[i];delete this.beforeChangedRecordsMap[i],this.beforeChangedRecordsMap[i+e]=t}}deleteRecords(t){var e;if(Array.isArray(this.records)){const i=[],o=t.sort(((t,e)=>e-t));for(let t=0;t<o.length;t++){const e=o[t];if(e>=this._sourceLength||e<0)continue;delete this.beforeChangedRecordsMap[e],i.push(e);const n=this.records[e];for(let t=0;t<this.fieldAggregators.length;t++)this.fieldAggregators[t].deleteRecord(n);this.records.splice(e,1),this.currentIndexedData.pop(),this._sourceLength-=1}return this.userPagination||(this.pagination.perPageCount=this._sourceLength,this.pagination.totalCount=this._sourceLength),this.updatePagerData(),(null===(e=this.dataSourceObj)||void 0===e?void 0:e.deleted)&&this.dataSourceObj.deleted(i),i}return[]}deleteRecordsForSorted(t){if(Array.isArray(this.records)){const e=t.sort(((t,e)=>e-t));for(let t=0;t<e.length;t++){const i=e[t];if(i>=this._sourceLength||i<0)continue;const o=this.currentIndexedData[i];delete this.beforeChangedRecordsMap[o],this.records.splice(o,1),this._sourceLength-=1}this.sortedIndexMap.clear(),this.userPagination||(this.pagination.perPageCount=this._sourceLength,this.pagination.totalCount=this._sourceLength)}}updateRecords(t,e){const i=[];for(let o=0;o<e.length;o++){const n=e[o];if(!(n>=this._sourceLength||n<0)){delete this.beforeChangedRecordsMap[n],i.push(n);for(let e=0;e<this.fieldAggregators.length;e++)this.fieldAggregators[e].updateRecord(this.records[n],t[o]);this.records[n]=t[o]}}return this.userPagination&&this.updatePagerData(),i}updateRecordsForSorted(t,e){for(let i=0;i<e.length;i++){const o=e[i];if(o>=this._sourceLength||o<0)continue;const n=this.currentIndexedData[o];if("number"!=typeof n)return;delete this.beforeChangedRecordsMap[n],this.records[n]=t[i]}this.sortedIndexMap.clear()}sort(t){t=(Array.isArray(t)?t:[t]).filter((t=>{const e=this.columns.find((e=>e.field===t.field));return!1!==(null==e?void 0:e.sort)&&"normal"!==t.order})),this.lastSortStates=t;let e=t.map((t=>this.sortedIndexMap.get(null==t?void 0:t.field)||{asc:[],desc:[],normal:[]})),i=null;if(e.length>0&&(i=t.reduce(((t,i,o)=>{var n;const r=null===(n=e[o])||void 0===n?void 0:n[i.order];return r&&r.length>0?r:t}),null),i&&i.length>0))return this.currentIndexedData=i,this.updatePagerData(),void this.fireListeners(Wx.CHANGE_ORDER,null);const o=Array.from({length:this._sourceLength},((t,e)=>e));if(o.sort(((e,i)=>t.reduce(((t,o)=>0!==t?t:(o.orderFn||("desc"!==o.order?(t,e)=>t===e?0:t>e?1:-1:(t,e)=>t===e?0:t<e?1:-1))(this.getOriginalField(e,o.field),this.getOriginalField(i,o.field),o.order)),0))),this.currentIndexedData=o,this.hierarchyExpandLevel){let t=o.length;for(let e=0;e<t;e++){const i=this.getOriginalRecord(o[e]),n=this.pushChildrenNode(o[e],i.hierarchyState,this.getOriginalRecord(o[e]));t+=n,e+=n}}if(!e.length){e=t.map((()=>({asc:[],desc:[],normal:[]})));for(let i=0;i<t.length;i++)this.sortedIndexMap.set(t[i].field,e[i])}t.forEach(((t,i)=>{e[i][t.order]=o.slice()})),this.updatePagerData(),this.fireListeners(Wx.CHANGE_ORDER,null)}setSortedIndexMap(t,e){this.sortedIndexMap.set(t,e)}clearFilteredChildren(t){var e,i;t.filteredChildren=void 0;for(let o=0;null!==(i=o<(null===(e=t.children)||void 0===e?void 0:e.length))&&void 0!==i&&i;o++)this.clearFilteredChildren(t.children[o])}filterRecord(t){var e,i,o;let n=!0;for(let r=0;r<(null===(e=this.dataConfig.filterRules)||void 0===e?void 0:e.length);r++){const e=null===(i=this.dataConfig)||void 0===i?void 0:i.filterRules[r];if(e.filterKey){const i=t[e.filterKey];if(-1===e.filteredValues.indexOf(i)){n=!1;break}}else if(!(null===(o=e.filterFunc)||void 0===o?void 0:o.call(e,t))){n=!1;break}}return n}updateFilterRulesForSorted(t){var e,i,o;this.lastFilterRules=this.dataConfig.filterRules,this.dataConfig.filterRules=t,this._source=this.processRecords(null!==(i=null===(e=this.dataSourceObj)||void 0===e?void 0:e.records)&&void 0!==i?i:this.dataSourceObj),this._sourceLength=(null===(o=this._source)||void 0===o?void 0:o.length)||0,this.sortedIndexMap.clear(),this.currentIndexedData=Array.from({length:this._sourceLength},((t,e)=>e)),this.userPagination||(this.pagination.perPageCount=this._sourceLength,this.pagination.totalCount=this._sourceLength)}updateFilterRules(t){var e,i,o;this.lastFilterRules=this.dataConfig.filterRules,this.dataConfig.filterRules=t,this._source=this.processRecords(null!==(i=null===(e=this.dataSourceObj)||void 0===e?void 0:e.records)&&void 0!==i?i:this.dataSourceObj),this._sourceLength=(null===(o=this._source)||void 0===o?void 0:o.length)||0,this.currentIndexedData=Array.from({length:this._sourceLength},((t,e)=>e)),this.userPagination||(this.pagination.perPageCount=this._sourceLength,this.pagination.totalCount=this._sourceLength,"tree"===this.rowHierarchyType&&this.initTreeHierarchyState()),this.updatePagerData()}clearSortedIndexMap(){this.lastSortStates&&this.lastSortStates.length>0&&this.sortedIndexMap.forEach(((t,e)=>{this.lastSortStates.some((t=>t.field===e))?this.lastSortStates.forEach((e=>{"asc"===e.order?(t.desc=[],t.normal=[]):"desc"===e.order?(t.asc=[],t.normal=[]):(t.asc=[],t.desc=[])})):this.sortedIndexMap.delete(e)}))}get sourceLength(){return this._sourceLength}set sourceLength(t){this._sourceLength!==t&&(this._sourceLength=t,this.fireListeners(Wx.SOURCE_LENGTH_UPDATE,this._sourceLength))}get length(){return this.currentPagerIndexedData.length}get dataSource(){return this}get currentPagerIndexedData(){return this._currentPagerIndexedData.length>0?this._currentPagerIndexedData:[]}release(){var t;null===(t=super.release)||void 0===t||t.call(this),this.lastFilterRules=null}clearSortedMap(){this.currentIndexedData&&(this.currentIndexedData.length=0),this.currentIndexedData=null,this.sortedIndexMap.forEach((t=>{t.asc&&(t.asc.length=0),t.desc&&(t.desc.length=0)})),this.sortedIndexMap.clear()}clearCurrentIndexedData(){this.currentIndexedData=null,this.currentPagerIndexedData.length=0}getOriginalRecord(t){let e;return e=this.dataSourceObj.records?Array.isArray(t)?Ux(this.records,t):this.records[t]:this._get(t),Nx(e,(e=>{this.recordPromiseCallBack(t,e)}))}getRawRecord(t){var e;if(null===(e=this.beforeChangedRecordsMap)||void 0===e?void 0:e[t])return this.beforeChangedRecordsMap[t];let i;return i=this.dataSourceObj.records?Array.isArray(t)?Ux(this.records,t):this.records[t]:this._get(t),Nx(i,(e=>{this.recordPromiseCallBack(t,e)}))}getOriginalField(t,e,i,o,n){if(null!==e)return Gx(this.getOriginalRecord(t),e,i,o,n,(i=>{this.fieldPromiseCallBack(t,e,i)}))}getRawFieldData(t,e,i,o,n){if(null!==e)return Gx(this.getRawRecord(t),e,i,o,n,(i=>{this.fieldPromiseCallBack(t,e,i)}))}hasOriginalField(t,e){if(null===e)return!1;if("function"==typeof e)return!0;const i=this.getOriginalRecord(t);return Boolean(i&&e in i)}fieldPromiseCallBack(t,e,i){}recordPromiseCallBack(t,e){}isCanExchangeOrder(t,e){if(this.hasHierarchyStateExpand){let i=this.currentPagerIndexedData[t],o=this.currentPagerIndexedData[e];if(i=Array.isArray(i)?[...i]:[i],o=Array.isArray(o)?[...o]:[o],e>t&&o.length>i.length){let t=this.currentPagerIndexedData[e+1];t=Array.isArray(t)?[...t]:[t],t.length<o.length&&o.splice(o.length-1,1)}if(i.length===o.length){for(let t=0;t<=i.length-2;t++)if(i[t]!==o[t])return!1;return!0}return!1}return!0}reorderRecord(t,e){var i,o;if(!(null===(i=this.lastSortStates)||void 0===i?void 0:i.some((t=>"asc"===t.order||"desc"===t.order)))&&this.isCanExchangeOrder(t,e))if(this.hasHierarchyStateExpand){let i,n,r=this.currentPagerIndexedData[t],s=this.currentPagerIndexedData[e];if(r=Array.isArray(r)?[...r]:[r],s=Array.isArray(s)?[...s]:[s],r.length>1||s.length>1){if(e>t&&s.length>r.length){let t=this.currentPagerIndexedData[e+1];t=Array.isArray(t)?[...t]:[t],t.length<s.length&&s.splice(s.length-1,1)}if(i=r.splice(r.length-1,1)[0],n=s.splice(s.length-1,1)[0],r.length>=1){const t=this.getOriginalRecord(r),e=t.filteredChildren?t.filteredChildren.splice(i,1):t.children.splice(i,1);e.unshift(n,0),Array.prototype.splice.apply(null!==(o=t.filteredChildren)&&void 0!==o?o:t.children,e)}else{const t=this.records.splice(i,1);t.unshift(n,0),Array.prototype.splice.apply(this.records,t)}}else{i=this.currentPagerIndexedData[t],n=this.currentPagerIndexedData[e];const o=this.records.splice(i,1);o.unshift(n,0),Array.prototype.splice.apply(this.records,o)}this.restoreTreeHierarchyState(),this.updatePagerData()}else{const i=this.records.splice(t,1);i.unshift(e,0),Array.prototype.splice.apply(this.records,i)}}restoreTreeHierarchyState(){var t,e;if(this.hierarchyExpandLevel){for(let e=0;e<this._sourceLength;e++){const i=this.getOriginalRecord(e);(null!==(t=i.filteredChildren)&&void 0!==t?t:i.children)&&!i.hierarchyState&&(i.hierarchyState=WC.collapse)}this.currentIndexedData=Array.from({length:this._sourceLength},((t,e)=>e));let i=this._sourceLength;for(let t=0;t<i;t++){const o=this.currentIndexedData[t],n=this.getOriginalRecord(o),r=null!==(e=n.filteredChildren)&&void 0!==e?e:n.children;if((null==r?void 0:r.length)>0&&n.hierarchyState===WC.expand){this.hasHierarchyStateExpand=!0;const e=this.restoreChildrenNodeHierarchy(o,n);t+=e,i+=e}else!0===n.children&&!n.hierarchyState&&(n.hierarchyState=WC.collapse)}}}restoreChildrenNodeHierarchy(t,e){var i,o;let n=0;const r=null!==(i=e.filteredChildren)&&void 0!==i?i:e.children,s=null!==(o=null==r?void 0:r.length)&&void 0!==o?o:0;for(let i=0;i<s;i++){e.hierarchyState===WC.expand&&(n+=1);const o=r[i],s=Array.isArray(t)?t.concat(i):[t,i];e.hierarchyState===WC.expand&&this.currentIndexedData.splice(this.currentIndexedData.indexOf(t)+n,0,s),n+=this.restoreChildrenNodeHierarchy(s,o)}return n}};function Ux(t,e){var i;let o=t;for(let t=0;t<e.length;t++){const n=e[t];if(!o[n])return;o=o[n];const r=null!==(i=o.filteredChildren)&&void 0!==i?i:null==o?void 0:o.children;r&&t+1<e.length&&(o=r)}return o}Vx.EMPTY=new Vx({get(){},length:0});class $x extends Vx{static get EVENT_TYPE(){return Vx.EVENT_TYPE}static ofArray(t,e,i,o,n,r){return new $x({get:e=>t[e],length:t.length,records:t},e,i,o,n,r)}constructor(t,e,i,o,n,r){rt(null==e?void 0:e.groupByRules)&&(n="tree"),super(t,e,i,o,n,r),this._recordCache=[],this._fieldCache={}}getOriginalRecord(t){return this._recordCache&&this._recordCache[t]?this._recordCache[t]:super.getOriginalRecord(t)}getRawRecord(t){var e;return(null===(e=this.beforeChangedRecordsMap)||void 0===e?void 0:e[t])?this.beforeChangedRecordsMap[t]:this._recordCache&&this._recordCache[t]?this._recordCache[t]:super.getRawRecord(t)}getOriginalField(t,e,i,o,n){const r=this._fieldCache&&this._fieldCache[t];if(r){const t=r.get(e);if(t)return t}return super.getOriginalField(t,e,i,o,n)}clearCache(){this._recordCache&&(this._recordCache=[]),this._fieldCache&&(this._fieldCache={})}fieldPromiseCallBack(t,e,i){!function(t,e,i,o){(t[e]||(t[e]=new Map)).set(i,o)}(this._fieldCache,t,e,i)}recordPromiseCallBack(t,e){this._recordCache&&(this._recordCache[t]=e)}get records(){return Array.isArray(this._recordCache)&&this._recordCache.length>0?this._recordCache:super.records}release(){var t;null===(t=super.release)||void 0===t||t.call(this),this._recordCache=null,this._fieldCache=null}_generateFieldAggragations(){var t;if(super._generateFieldAggragations(),rt(null===(t=this.dataConfig)||void 0===t?void 0:t.groupByRules)){const t=this.dataConfig.groupByRules;this.groupAggregator=new this.registedAggregators[NC.CUSTOM]({dimension:"",aggregationFun:(e,i,o)=>{const n=new Map,r=[];for(let e=0;e<i.length;e++)Xx(i[e],r,n,t,0),i[e].vtableOriginIndex=e;return r}}),this.fieldAggregators.push(this.groupAggregator)}}processRecords(t){var e;const i=super.processRecords(t);return(null===(e=this.groupAggregator)||void 0===e?void 0:e.value())||i}getGroupLength(){var t,e,i;return null!==(i=null===(e=null===(t=this.dataConfig)||void 0===t?void 0:t.groupByRules)||void 0===e?void 0:e.length)&&void 0!==i?i:0}updateGroup(){var t,e,i;this.clearCache();const o=this.source;this._source=this.processRecords(null!==(e=null===(t=this.dataSourceObj)||void 0===t?void 0:t.records)&&void 0!==e?e:this.dataSourceObj),o&&Yx(o,this.source),this.sourceLength=(null===(i=this.source)||void 0===i?void 0:i.length)||0,this.sortedIndexMap.clear(),this.currentIndexedData=Array.from({length:this.sourceLength},((t,e)=>e)),this.userPagination||(this.pagination.perPageCount=this.sourceLength,this.pagination.totalCount=this.sourceLength),this.initTreeHierarchyState(),this.updatePagerData()}addRecordsForGroup(t,e){rt(t)&&0!==t.length&&((void 0===e||e>this.dataSourceObj.records)&&(e=this.dataSourceObj.records),this.dataSourceObj.records.splice(e,0,...t),this.updateGroup())}deleteRecordsForGroup(t){if(!rt(t)||0===t.length)return;const e=t.sort(((t,e)=>e-t));for(let t=0;t<e.length;t++){const i=e[t];i>=this.sourceLength||i<0||(delete this.beforeChangedRecordsMap[i],this.dataSourceObj.records.splice(i,1),this.sourceLength-=1)}this.updateGroup()}updateRecordsForGroup(t,e){for(let i=0;i<e.length;i++){const o=e[i];o>=this.sourceLength||o<0||(delete this.beforeChangedRecordsMap[o],this.dataSourceObj.records[o]=t[i])}this.updateGroup()}}function Xx(t,e,i,o,n){const r=o[n];if(!Q(r))return void e.push(t);const s=t[r];if(void 0!==s){if(i.has(s)){const r=i.get(s);return Xx(t,e[r].children,e[r].map,o,n+1)}return i.set(s,e.length),e.push({vtableMerge:!0,vtableMergeName:s,children:[],map:new Map}),Xx(t,e[e.length-1].children,e[e.length-1].map,o,n+1)}}function Yx(t,e,i,o){if(!i){i=new Map;for(let e=0;e<t.length;e++){const o=t[e];o.vtableMerge&&i.set(o.vtableMergeName,e)}}if(!o){o=new Map;for(let t=0;t<e.length;t++){const i=e[t];i.vtableMerge&&o.set(i.vtableMergeName,t)}}for(let i=0;i<t.length;i++){const n=t[i],r=e[o.get(n.vtableMergeName)];Q(r)&&(r.hierarchyState=t[i].hierarchyState),rt(n.children)&&rt(r.children)&&0!==n.map.size&&0!==r.map.size&&Yx(n.children,r.children,n.map,r.map)}}var Kx={exports:{}},qx={},Zx=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"),Jx=["style","variant","weight","size","lineHeight","family"],Qx=/([\.0-9]+)(.*)/,t_=function(t,e,i){var o=t.match(Qx);if(o){t=parseFloat(o[1]);var n=o[2].toLowerCase().trim(),r=Math.round(t);switch(r===t&&(t=r),n){case"em":if(null===e)return;return t*e;case"px":return t;case"pt":return t/(72/i);case"pc":return t/(6/i);case"mm":return t*(i/25.4);case"cm":return t*(i/2.54);case"in":return t*i;case"%":if(null===e)return;return e*(t/100)}}},e_={size:t_,lineHeight:t_},i_={serif:1,"sans-serif":1,cursive:1,fantasy:1,monospace:1},o_=Kx.exports=function(t,e,i){var o=t+"-"+(e||"null")+"@"+i;if(i=i||96,void 0!==qx[o])return qx[o];if(e&&(e=o_(e,null,i)),"inherit"===t)return e;var n=Zx.exec(t);if(n){n.shift();for(var r={},s=0;s<n.length;s++){var l=Jx[s],a=n[s];if(e_[l]&&a){var h=e&&e[l]||null,d=e_[l](a,h,i);a=void 0===d&&"lineHeight"===l&&a?r.size*parseFloat(a):d}if(a&&"normal"!==a){if("inherit"===a){if(!e)return;a=e[l]}a.trim&&(a=a.trim()),r[l]=a}}Object.keys(r).length||(r=null),qx[o]=r;var c=[];r.style&&c.push(r.style),r.variant&&c.push(r.variant),r.weight&&"400"!==r.weight&&"normal"!==r.weight&&c.push(r.weight),c.push(r.size+"px"),r.lineHeight&&(c[c.length-1]+="/"+r.lineHeight+"px");var u=r.family.split(",");return r.family=u.map((function(t){return t=t.trim(),i_[t.toLowerCase()]&&(t=t.toLowerCase()),t})),c.push(r.family),Object.defineProperty(r,"toString",{value:function(){return c.map((function(t){return Array.isArray(t)?t.map((function(t){return t.indexOf(" ")>-1?'"'+t.replace(/["']/g,"")+'"':t})).join(", "):t})).join(" ")}}),r}qx[o]=null};Kx.exports.generics=i_;var n_=$(Kx.exports);function r_(t){var e,i,o,n;if(at(t)||nt(t)||rt(t)){let e=or(t);return"number"==typeof e||"string"==typeof e?e=[e,e,e,e]:Array.isArray(e)&&(e=e.slice(0)),e}return t&&(isFinite(t.bottom)||isFinite(t.left)||isFinite(t.right)||isFinite(t.top))?[null!==(e=t.top)&&void 0!==e?e:0,null!==(i=t.right)&&void 0!==i?i:0,null!==(o=t.bottom)&&void 0!==o?o:0,null!==(n=t.left)&&void 0!==n?n:0]:[0,0,0,0]}const s_=0,l_=1,a_=2,h_=3,d_=10,c_=11,u_=12,g_=9,p_=13,f_=10,v_=12,m_=32,b_=37,y_=46,C_=48,w_=57,x_=65,__=90,S_=97,A_=122;function B_(t){return function(t){return t>=S_&&t<=A_}(t)||function(t){return t>=x_&&t<=__}(t)}function R_(t){return t===g_||t===f_||t===v_||t===p_||t===m_}function M_(t){return t>=C_&&t<=w_}function T_(t){return t===y_}function k_(t){return B_(t)||t===b_}function L_(t){return new Error(`calc parse error: ${t}`)}const P_={"*":3,"/":3,"+":2,"-":2};function E_(t,e){function i(t){const i=t.pop(),o=t.pop(),n=t.pop();if(!(n&&n.nodeType&&o&&o.type===a_&&i&&i.nodeType))throw L_(e);return{nodeType:c_,left:n,op:o,right:i}}const o=[];for(;t.length;){const n=t.shift();if(n.type===s_&&"("===n.value){let i=0;const n=Aw.findIndex(t,(t=>{if(t.type===s_&&"("===t.value)i++;else if(t.type===s_&&")"===t.value){if(!i)return!0;i--}return!1}));if(-1===n)throw L_(e);o.push(E_(t.splice(0,n),e)),t.shift()}else if(n.type===a_){if(o.length>=3){const t=o[o.length-2].value;P_[n.value]<=P_[t]&&o.push(i(o))}o.push(n)}else if(n.type===l_){const{value:t,unit:e}=n;o.push({nodeType:d_,value:t,unit:e})}else n.type===h_&&o.push({nodeType:u_,value:n.value})}for(;o.length>1;)o.push(i(o));return o[0]}function H_(t){return E_(function(t){const e=t.replace(/calc\(/g,"(").trim(),i=[],o=e.length;for(let s=0;s<o;s++){const o=e[s],l=o.charCodeAt(0);if("("===o||")"===o)i.push({value:o,type:s_});else if("*"===o||"/"===o)i.push({value:o,type:a_});else if("+"===o||"-"===o)s=n(o,s+1)-1;else if(M_(l)||T_(l))s=r(o,s+1)-1;else if(!R_(l))throw L_(t)}function n(t,n){if(n<o){const i=e[n],o=i.charCodeAt(0);if(M_(o)||T_(o))return r(t+i,n+1)}return i.push({value:t,type:a_}),n}function r(n,r){let l=r;for(;l<o;l++){const i=e[l],o=i.charCodeAt(0);if(M_(o))n+=i;else{if("."!==i){if(k_(o))return s(n,i,l+1);break}if(n.indexOf(".")>=0)throw L_(t);n+=i}}if("."===n)throw L_(t);return i.push({value:parseFloat(n),type:h_}),l}function s(t,n,r){let s=r;for(;s<o;s++){const t=e[s];if(!k_(t.charCodeAt(0)))break;n+=t}return i.push({value:parseFloat(t),unit:n,type:l_}),s}return i}(t),t)}function F_(t,e){if(t.nodeType===c_){const i=F_(t.left,e),o=F_(t.right,e);switch(t.op.value){case"+":return i+o;case"-":return i-o;case"*":return i*o;case"/":return i/o;default:throw new Error(`calc error. unknown operator: ${t.op.value}`)}}else if(t.nodeType===d_)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===u_)return t.value;throw new Error("calc error.")}function z_(t,e){return F_(H_(t),e)}function I_(t){return!!nt(t)&&!!t.endsWith("%")&&function(t){return!(J(t)||!at(t)&&+t!=+t)}(t.substring(0,t.length-1))}function O_(t,e){const{dataSourceEventIds:i}=t.internalProps;i&&i.forEach((e=>t.internalProps.handler.off(e))),e(t),t.internalProps.dataSourceEventIds=[t.internalProps.handler.on(t.internalProps.dataSource,Vx.EVENT_TYPE.CHANGE_ORDER,(()=>{t.dataSource.hierarchyExpandLevel&&t.refreshRowColCount(),t.render()}))]}function D_(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];O_(t,(()=>{t.internalProps.records=e;const i=t.internalProps.dataSource=$x.ofArray(e,t.internalProps.dataConfig,t.pagination,t.internalProps.columns,t.internalProps.layoutMap.rowHierarchyType,function(t){var e;return t.options.hierarchyExpandLevel?t.options.hierarchyExpandLevel:t.options.groupBy?1/0:(null===(e=t._hasHierarchyTreeHeader)||void 0===e?void 0:e.call(t))?1:void 0}(t));t.addReleaseObj(i)}))}function W_(t,e){O_(t,(()=>{if(e)if(e instanceof Vx)t.internalProps.dataSource=e;else{const i=t.internalProps.dataSource=new $x(e);t.addReleaseObj(i)}else t.internalProps.dataSource=Vx.EMPTY;t.internalProps.records=null}))}function N_(t,e){return Math.round((i=e,o=t.internalProps.calcWidthContext,"string"==typeof i?z_(i.trim(),o):i-0));var i,o}function G_(t,e,i,o,n){let r=!(arguments.length>5&&void 0!==arguments[5])||arguments[5];const s=r_(n("padding",t,i,o,e)),l=n("bgColor",t,i,o,e),a=n("font",t,i,o,e);let h,d,c,u,g;if(a){const{family:t,size:e,weight:i,style:o,variant:n}=function(t){return n_(t)}(a);h=t.join(" "),d=e,c=i,u=o,u=n}else h=n("fontFamily",t,i,o,e),d=n("fontSize",t,i,o,e),c=n("fontWeight",t,i,o,e),u=n("fontStyle",t,i,o,e),g=n("fontVariant",t,i,o,e);const p=n("textAlign",t,i,o,e),f=n("textBaseline",t,i,o,e),v=n("color",t,i,o,e),m=n("strokeColor",t,i,o,e),b=n("lineHeight",t,i,o,e),y=n("underline",t,i,o,e),C=n("underlineDash",t,i,o,e),w=n("underlineOffset",t,i,o,e),x=n("lineThrough",t,i,o,e),_=Math.max(1,Math.floor(d/10)),S=n("textOverflow",t,i,o,e),A=n("borderColor",t,i,o,e),B=n("borderLineWidth",t,i,o,e),R=n("borderLineDash",t,i,o,e),M=n("marked",t,i,o,e),T=n("cursor",t,i,o,e),k=!(s&&l&&a&&p&&f&&v&&S&&A&&B&&R&&"boolean"==typeof y&&"boolean"==typeof x&&"boolean"==typeof M);if(!r)return{hasFunctionPros:k};const L={text:{fontFamily:h,fontSize:d,fontWeight:c,fontStyle:u,fontVariant:g,fill:v,stroke:null!=m&&m,textAlign:p,textBaseline:f,lineHeight:null!=b?b:d,underline:y?_:void 0,underlineDash:C,underlineOffset:w,lineThrough:x?_:void 0,ellipsis:"clip"===S?"":"ellipsis"===S?"...":Q(S)?S:void 0},group:{fill:l,lineDash:R,lineWidth:B,stroke:A,cursor:"auto"===T||"default"===T?void 0:T},_vtable:{padding:s,marked:M}};if(Array.isArray(B)&&(L.group.strokeArrayWidth=r_(B)),Array.isArray(A)){const t=r_(A);L.group.stroke=!t.every((t=>!t))&&t,L.group.strokeArrayColor=r_(A)}return{theme:L,hasFunctionPros:k}}function j_(t,e,i){const o=i.theme.frameStyle.cornerRadius;if(Array.isArray(o)){if(0===t&&0===e)return[o[0],0,0,0];if(t===i.colCount-1&&0===e)return[0,o[1],0,0];if(0===t&&e===i.rowCount-1)return[0,0,0,o[3]];if(t===i.colCount-1&&e===i.rowCount-1)return[0,0,o[2],0]}else if(o){if(0===t&&0===e)return[o,0,0,0];if(t===i.colCount-1&&0===e)return[0,o,0,0];if(0===t&&e===i.rowCount-1)return[0,0,0,o];if(t===i.colCount-1&&e===i.rowCount-1)return[0,0,o,0]}return 0}function V_(t){for(let e=0;e<t.internalProps.columns.length;e++){const i=t.internalProps.columns[e];if(i.aggregation);else if(t.options.aggregation){let o;if(o="function"==typeof t.options.aggregation?t.options.aggregation({col:e,field:i.field}):t.options.aggregation,o)if(Array.isArray(o)){const t=[];o.forEach((e=>{t.push(Object.assign({showOnTop:!1},e))})),i.aggregation=t}else i.aggregation=Object.assign({showOnTop:!1},o)}}}let U_=class extends dc{constructor(t){super(t),"mouseenter_cell"!==this.attribute.visibleTime&&"click_cell"!==this.attribute.visibleTime||(this.attribute.opacity=0),this.attribute.hoverImage&&(this.attribute.originImage=this.attribute.image)}get backgroundWidth(){var t,e;return null!==(e=null!==(t=this.attribute.backgroundWidth)&&void 0!==t?t:this.attribute.width)&&void 0!==e?e:0}get backgroundHeight(){var t,e;return null!==(e=null!==(t=this.attribute.backgroundHeight)&&void 0!==t?t:this.attribute.height)&&void 0!==e?e:0}};function $_(t){return{rootContainer:new fs({}),renderDefault:!0}}class X_{constructor(t,e){this.removeAllContainer=t,this.table=e,this.customLayoutFuncCache=new Map,this.reactRemoveGraphicCache=new Map,this.headerCustomLayoutFuncCache=new Map,this.headerReactRemoveGraphicCache=new Map}hasReactCreateGraphic(t,e){return e?this.headerCustomLayoutFuncCache.has(t):this.customLayoutFuncCache.has(t)}setReactCreateGraphic(t,e,i){i?this.headerCustomLayoutFuncCache.set(t,e):this.customLayoutFuncCache.set(t,e)}setReactRemoveGraphic(t,e,i){i?this.headerReactRemoveGraphicCache.set(t,e):this.reactRemoveGraphicCache.set(t,e)}updateCustomCell(t,e){const i=this.table;if(i.isPivotTable()){const o=function(t,e,i){const o=e.internalProps.rowSeriesNumber?1:0,n=[],r=e.internalProps.layoutMap;if(i){const{headerObjects:e}=r,i=[];for(let o=0;o<e.length;o++){const n=e[o];n&&n.define.componentId===t&&i.push(n.id)}for(let t=0;t<i.length;t++){const e=i[t],o=r.getHeaderCellAdressById(e),s=r.getCellRange(o.col,o.row);n.push(s)}}else{let e;const{columnObjects:i,indicatorsAsCol:s}=r;for(let o=0;o<i.length;o++)if(i[o].define.componentId===t){e=o;break}if(s)for(let t=r.rowHeaderLevelCount+e;t<r.colCount;t+=i.length){const e={start:{col:t+o,row:r.columnHeaderLevelCount},end:{col:t+o,row:r.rowCount-1}};n.push(e)}else for(let t=r.columnHeaderLevelCount+e;t<r.rowCount;t+=i.length){const e={start:{col:r.rowHeaderLevelCount+o,row:t},end:{col:r.colCount-1,row:t}};n.push(e)}}return n}(t,i,e);for(let t=0;t<o.length;t++){const e=o[t];for(let t=e.start.col;t<=e.end.col;t++)for(let o=e.start.row;o<=e.end.row;o++)i.scenegraph.updateCellContent(t,o)}}else{const o=function(t,e,i){const o=e.internalProps.rowSeriesNumber?1:0;if(i){const i=e.internalProps.layoutMap,{headerObjects:o}=e.internalProps.layoutMap;let n;for(let e=0;e<o.length;e++){const i=o[e];if(i.define.componentId===t){n=i.id;break}}const r=i.getHeaderCellAdressById(n);return i.getCellRange(r.col,r.row)}const{columnObjects:n}=e.internalProps.layoutMap;for(let i=0;i<n.length;i++)if(n[i].define.componentId===t)return{start:{col:o+i,row:e.columnHeaderLevelCount},end:{col:o+i,row:e.rowCount-1}};return{start:{col:0,row:0},end:{col:e.colCount-1,row:e.rowCount-1}}}(t,i,e);for(let t=o.start.col;t<=o.end.col;t++)for(let e=o.start.row;e<=o.end.row;e++)i.scenegraph.updateCellContent(t,e)}"autoWidth"===i.widthMode&&i.scenegraph.recalculateColWidths(),"autoHeight"===i.heightMode&&i.scenegraph.recalculateRowHeights(),i.scenegraph.renderSceneGraph()}getCustomLayoutFunc(t,e){var i;if(this.table.isHeader(t,e)){const{componentId:o}=this.table.getHeaderDefine(t,e);return null!==(i=this.headerCustomLayoutFuncCache.get(o))&&void 0!==i?i:$_}const{componentId:o}=this.table.getBodyColumnDefine(t,e);return this.customLayoutFuncCache.get(o)||$_}removeCustomCell(t,e){let i;if(this.table.isHeader(t,e)){const o=this.table.getHeaderDefine(t,e),{componentId:n}=o;i=this.headerReactRemoveGraphicCache.get(n)}else{const o=this.table.getBodyColumnDefine(t,e),{componentId:n}=o;i=this.reactRemoveGraphicCache.get(n)}i&&i(t,e)}clearCache(){this.removeAllContainer()}}function Y_(t){const e={abstractPos:{x:t.viewport.x,y:t.viewport.y}},i=K_(t.target);return i&&(e.eventArgs={col:i.col,row:i.row,event:t,targetCell:i,mergeInfo:q_(i),target:t.target}),e}function K_(t){for(;t&&t.parent;){if("cell"===t.role)return t;t=t.parent}return null}function q_(t){if(Q(t.mergeStartCol)&&Q(t.mergeStartRow)&&Q(t.mergeEndCol)&&Q(t.mergeEndRow))return{colStart:t.mergeStartCol,colEnd:t.mergeEndCol,rowStart:t.mergeStartRow,rowEnd:t.mergeEndRow}}const Z_=/radio-\d+-\d+-(\d+)/,J_="_custom_",Q_="custom-container",tS=J_+"_0";function eS(t,e,i,o,n,r,s,l,a,h,d){var c,u,g;let p,f,v,m,b=!0,y=!1;if("react-custom-layout"===t&&(t=(null===(c=d.reactCustomLayout)||void 0===c?void 0:c.getCustomLayoutFunc(i,o))||$_),"function"==typeof t){const e=t({col:null!==(u=null==h?void 0:h.start.col)&&void 0!==u?u:i,row:null!==(g=null==h?void 0:h.start.row)&&void 0!==g?g:o,dataValue:d.getCellOriginValue(i,o),value:d.getCellValue(i,o)||"",rect:{left:0,top:0,right:n,bottom:r,width:n,height:r},table:d,originCol:i,originRow:o});e.rootContainer&&(e.rootContainer=nS(e.rootContainer)),e.rootContainer instanceof fs&&(m=e.rootContainer,m.name=Q_,m.col=i,m.row=o),b=e.renderDefault,y=e.enableCellPadding}else if("function"==typeof e){const t=e({col:i,row:o,dataValue:d.getCellOriginValue(i,o),value:d.getCellValue(i,o)||"",rect:{left:0,top:0,right:n,bottom:r,width:n,height:r},table:d});t&&(v=t.elements,b=t.renderDefault,p=t.expectedWidth,f=t.expectedHeight)}else e&&(p=e.expectedWidth,f=e.expectedHeight,v=e.elements,b=e.renderDefault);return v&&(m=function(t,e,i,o){const n=new fs({x:0,y:0,width:e,height:i,fill:!1,stroke:!1,pickable:!1});return n.name=Q_,function(t,e,i,o){const n=[],r=[0,0,0,0];for(let s=0;s<t.length;s++){const l=t[s],a=Object.assign({},l);for(const t in a)a.hasOwnProperty(t)&&Z(a[t])&&(a[t]=a[t](o));const h=a;Q(h.x)&&(h.x=nt(h.x)?iS(h.x,e-r[1]):Number(h.x)),Q(h.y)&&(h.y=nt(h.y)?iS(h.y,i-r[2]):Number(h.y)),"width"in a&&(a.width=nt(a.width)?iS(a.width,e-r[1]):Number(a.width)),"height"in a&&(a.height=nt(a.height)?iS(a.height,i-r[2]):Number(a.height)),"radius"in a&&(a.radius=nt(a.radius)?iS(a.radius,Math.min(e-r[1],i-r[2])):Number(a.radius)),"hover"in a&&(a.hover.x=nt(a.hover.x)?iS(a.hover.x,e-r[1]):Number(a.hover.x),a.hover.y=nt(a.hover.y)?iS(a.hover.y,i-r[2]):Number(a.hover.y),a.hover.width=nt(a.hover.width)?iS(a.hover.width,e-r[1]):Number(a.hover.width),a.hover.height=nt(a.hover.height)?iS(a.hover.height,i-r[2]):Number(a.hover.height),a.hover.x+=0,a.hover.y+=0),h.x=h.x+0,h.y=h.y+0,n.push(a)}return n}(t,e,i,o).forEach((t=>{var e,i,o,r,s,l,a,h,d,c,u,g,p,f,v,m,b,y,C,w,x,_,S,A,B,R,M,T;switch(t.clickable&&(t.pickable=t.clickable),t.type){case"arc":const k=Ac({x:t.x,y:t.y,dx:null!==(e=t.dx)&&void 0!==e?e:0,dy:null!==(i=t.dy)&&void 0!==i?i:0,fill:t.fill,stroke:t.stroke,outerRadius:t.radius,startAngle:t.startAngle,endAngle:t.endAngle,pickable:!!t.pickable,cursor:t.cursor});k.name=t.name,n.appendChild(k);break;case"text":if(t.background){const e=null!==(r=null===(o=t.background)||void 0===o?void 0:o.expandX)&&void 0!==r?r:0,i=null!==(l=null===(s=t.background)||void 0===s?void 0:s.expandY)&&void 0!==l?l:0,p=sc({x:t.x-e,y:t.y-i,dx:null!==(a=t.dx)&&void 0!==a?a:0,dy:null!==(h=t.dy)&&void 0!==h?h:0,width:t.width+2*e,height:t.height+2*i,cornerRadius:null!==(c=null===(d=t.background)||void 0===d?void 0:d.cornerRadius)&&void 0!==c?c:0,fill:null!==(g=null===(u=t.background)||void 0===u?void 0:u.fill)&&void 0!==g?g:"#888"});n.appendChild(p)}const L=new Nh(Object.assign({pickable:!!t.pickable,fill:null!==(p=t.color)&&void 0!==p?p:t.fill},t));L.name=t.name,n.appendChild(L);break;case"rect":const P=sc({x:t.x,y:t.y,dx:null!==(f=t.dx)&&void 0!==f?f:0,dy:null!==(v=t.dy)&&void 0!==v?v:0,width:t.width,height:t.height,cornerRadius:t.radius,fill:t.fill,stroke:t.stroke,pickable:!!t.pickable,cursor:t.cursor});P.name=t.name,n.appendChild(P);break;case"circle":const E=Oh({x:t.x,y:t.y,dx:null!==(m=t.dx)&&void 0!==m?m:0,dy:null!==(b=t.dy)&&void 0!==b?b:0,radius:t.radius,fill:t.fill,stroke:t.stroke,pickable:!!t.pickable,cursor:t.cursor});E.name=t.name,n.appendChild(E);break;case"icon":const H=new U_({x:t.x,y:t.y,dx:null!==(y=t.dx)&&void 0!==y?y:0,dy:null!==(C=t.dy)&&void 0!==C?C:0,width:t.width,height:t.height,image:t.svg,backgroundWidth:t.hover?null!==(w=t.hover.width)&&void 0!==w?w:t.width:void 0,backgroundHeight:t.hover?null!==(x=t.hover.width)&&void 0!==x?x:t.width:void 0,backgroundColor:t.hover?null!==(_=t.hover.bgColor)&&void 0!==_?_:"rgba(22,44,66,0.2)":void 0,pickable:!!t.pickable,cursor:t.cursor});H.name=t.name,H.role="icon-custom",n.appendChild(H);break;case"image":const F=new U_({x:t.x,y:t.y,dx:null!==(S=t.dx)&&void 0!==S?S:0,dy:null!==(A=t.dy)&&void 0!==A?A:0,width:t.width,height:t.height,image:t.src,backgroundWidth:t.hover?null!==(B=t.hover.width)&&void 0!==B?B:t.width:void 0,backgroundHeight:t.hover?null!==(R=t.hover.width)&&void 0!==R?R:t.width:void 0,backgroundColor:t.hover?null!==(M=t.hover.bgColor)&&void 0!==M?M:"rgba(22,44,66,0.2)":void 0,pickable:!!t.pickable,cursor:t.cursor,shape:t.shape});F.name=t.name,F.role="image-custom",n.appendChild(F);break;case"line":const z=oc({points:t.points,lineWidth:null!==(T=t.lineWidth)&&void 0!==T?T:1,stroke:t.stroke,pickable:!!t.pickable,cursor:t.cursor});z.name=t.name,n.appendChild(z)}})),n}(v,s?p:n,l?f:r,d.getCellValue(i,o))),y&&m.setAttributes({x:a[3],y:a[0],width:n-a[1]-a[3],height:r-a[0]-a[2]}),oS(m,n,r),!h||h.start.col===h.end.col&&h.start.row===h.end.row||rS(m,i,o,0),{elementsGroup:m,renderDefault:b}}function iS(t,e){return t.endsWith("px")?parseInt(t,10):t.endsWith("%")&&e?parseInt(t,10)/100*e:parseInt(t,10)}function oS(t,e,i){t&&t.forEachChildren((t=>{var o,n;t&&(tt(t.attribute.width)&&t.attribute.width.percent&&t.setAttribute("width",Math.max(0,t.attribute.width.percent/100*e+(null!==(o=t.attribute.width.delta)&&void 0!==o?o:0))),t.attribute.width<0&&t.setAttribute("width",0),tt(t.attribute.height)&&t.attribute.height.percent&&t.setAttribute("height",Math.max(0,t.attribute.height.percent/100*i+(null!==(n=t.attribute.height.delta)&&void 0!==n?n:0))),t.attribute.height<0&&t.setAttribute("height",0),"group"===t.type&&oS(t,t.attribute.width,t.attribute.height))}))}function nS(t){if(!t||!Q(t.$$typeof)&&!Q(t.vtype))return t;const e=t.type,{attribute:i,children:o,stateProxy:n}=t.props,r=e({attribute:i});return function(t,e){let i=!1;switch(t.type){case"richtext":case"rich/image":break;default:i=!0}i&&Object.keys(e).forEach((i=>{const o=Gg[i];o&&t.on(o,e[i])}))}(r,t.props),n&&(r.stateProxy=n),r.id=i.id,r.name=i.name,rt(o)?o.forEach((t=>{const e=nS(t);e&&e.type&&r.add(e)})):o&&r.add(nS(o)),r}function rS(t,e,i,o,n){t&&(t.name=`${J_}${null!=n?n:""}_${o}`,t.onBeforeAttributeUpdate=sS,"group"===t.type&&t.childrenCount&&t.forEachChildren(((t,r)=>{rS(t,e,i,r,(null!=n?n:"")+"_"+o)})))}function sS(t,e){const i=this;if(i.skipMergeUpdate)return;const o=K_(i);if(!o||!o.stage)return;const n=o.stage.table;i.skipAttributeUpdate=!0;const{mergeStartCol:r,mergeEndCol:s,mergeStartRow:l,mergeEndRow:a}=o;if(Q(r)&&Q(s)&&Q(l)&&Q(a)&&(r!==s||l!==a)){for(let e=r;e<=s;e++)for(let r=l;r<=a;r++){if(e===o.col&&r===o.row)continue;const s=n.scenegraph.highPerformanceGetCell(e,r);if("cell"===s.role){const e=s.getChildByName(i.name,!0);if(!e||e.skipAttributeUpdate)continue;for(const i in t)t[i]!==e.attribute[i]&&"dx"!==i&&"dy"!==i&&e.setAttribute(i,t[i])}}i.skipAttributeUpdate=void 0}}const lS={};class aS{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}}let hS,dS,cS,uS,gS,pS,fS,vS,mS,bS,yS,CS,wS,xS,_S,SS,AS,BS,RS,MS,TS,kS,LS,PS;function ES(t){var e,i,o,n,r,s,l,a,h,d,c,u,g,p,f,v,m,b,y,C,w,x,_,S;hS=null!==(e=null==t?void 0:t.sort_color)&&void 0!==e?e:"#282F38",dS=null!==(i=null==t?void 0:t.sort_color_opacity)&&void 0!==i?i:"0.35",cS=null!==(o=null==t?void 0:t.sort_color_2)&&void 0!==o?o:"#416EFF",uS=null!==(n=null==t?void 0:t.sort_color_opacity_2)&&void 0!==n?n:"1",gS=null!==(r=null==t?void 0:t.sort_size)&&void 0!==r?r:16,pS=null!==(s=null==t?void 0:t.sort_size_2)&&void 0!==s?s:22,fS=null!==(l=null==t?void 0:t.frozen_color)&&void 0!==l?l:"#282F38",vS=null!==(a=null==t?void 0:t.frozen_color_opacity)&&void 0!==a?a:"0.35",mS=null!==(h=null==t?void 0:t.frozen_color_opacity)&&void 0!==h?h:"0.2",bS=null!==(d=null==t?void 0:t.frozen_color_2)&&void 0!==d?d:"#416EFF",yS=null!==(c=null==t?void 0:t.frozen_color_opacity_2)&&void 0!==c?c:"1",CS=null!==(u=null==t?void 0:t.frozen_size)&&void 0!==u?u:22,wS=null!==(g=null==t?void 0:t.frozen_size_2)&&void 0!==g?g:22,xS=null!==(p=null==t?void 0:t.collapse_color)&&void 0!==p?p:"#141414",_S=null!==(f=null==t?void 0:t.collapse_color_opacity)&&void 0!==f?f:"0.65",SS=null!==(v=null==t?void 0:t.collapse_size)&&void 0!==v?v:16,AS=null!==(m=null==t?void 0:t.frozen_size_2)&&void 0!==m?m:22,BS=null!==(b=null==t?void 0:t.expand_color)&&void 0!==b?b:"#141414",RS=null!==(y=null==t?void 0:t.expand_color_opacity)&&void 0!==y?y:"0.65",MS=null!==(C=null==t?void 0:t.expand_size)&&void 0!==C?C:16,TS=null!==(w=null==t?void 0:t.expand_size_2)&&void 0!==w?w:22,kS=null!==(x=null==t?void 0:t.dragReorder_color)&&void 0!==x?x:"#666666",LS=null!==(_=null==t?void 0:t.dragReorder_color_opacity)&&void 0!==_?_:"1",PS=null!==(S=null==t?void 0:t.dragReorder_size)&&void 0!==S?S:20}aS.cache=new Map;const HS={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="${cS}" fill-opacity="${uS}"/><path d="M11.3335 7L4.66683 7L8.00016 2.83333L11.3335 7Z" fill="${hS}" fill-opacity="${dS}"/></svg> `,width:gS,height:gS,funcType:VC.sort,name:"sort_downward",positionType:jC.contentRight,marginLeft:3,hover:{width:pS,height:pS,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="${hS}" fill-opacity="${dS}"/><path d="M11.3335 7L4.66683 7L8.00016 2.83333L11.3335 7Z" fill="${cS}" fill-opacity="${uS}"/> </svg>`,width:gS,height:gS,funcType:VC.sort,positionType:jC.contentRight,name:"sort_upward",marginLeft:3,hover:{width:pS,height:pS,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="${hS}" fill-opacity="${dS}"/><path d="M11.3335 7L4.66683 7L8.00016 2.83333L11.3335 7Z" fill="${hS}" fill-opacity="${dS}"/></svg> `,width:gS,height:gS,funcType:VC.sort,positionType:jC.contentRight,name:"sort_normal",marginLeft:3,hover:{width:pS,height:pS,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="${fS}" fill-opacity="${mS}"/></g><defs><clipPath id="clip0"><rect width="22" height="22" fill="white"/></clipPath></defs></svg>`,width:CS,height:CS,name:"freeze",funcType:VC.frozen,positionType:jC.right,marginRight:0,hover:{width:wS,height:wS,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="${fS}" fill-opacity="${vS}"/></svg>`,width:CS,height:CS,name:"frozen",funcType:VC.frozen,positionType:jC.right,marginRight:0,hover:{width:wS,height:wS,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="${bS}" fill-opacity="${yS}"/></svg>`,width:CS,height:CS,funcType:VC.frozen,positionType:jC.right,name:"frozenCurrent",marginRight:0,hover:{width:wS,height:wS,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:VC.dropDown,positionType:jC.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:VC.play,positionType:jC.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:VC.damagePic,positionType:jC.left,name:"damage_pic",marginRight:0,hover:{width:24,height:24,bgColor:"rgba(101, 117, 168, 0.1)"},cursor:"pointer"}},get loading_pic(){return{type:"svg",svg:'<svg viewBox="0 0 400 300" fill="none" xmlns="http://www.w3.org/2000/svg"><mask id="a" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="50" y="65" width="301" height="170"><path d="M350.3 65H50v169.8h300.3V65Z" fill="#fff"/></mask><g mask="url(#a)"><path fill-rule="evenodd" clip-rule="evenodd" d="M58.3 233.2h32.8v-36.8H58.3v36.8Z" fill="#C7DEFF"/><path d="M91.1 224.5v8.8H58.3M82.4 196.2H58.3" stroke="#071F4D"/><path fill-rule="evenodd" clip-rule="evenodd" d="M305.4 182.5s-2.7 12.6 0 17.4c2.7 4.8 8.3 6.7 12.4 4.4 4.2-2.4 5.3-8.1 2.6-12.9-2.7-4.8-15-8.9-15-8.9ZM336 204.7c4.3 2 9.7-.4 12-5.4 2.3-5-1.5-17.3-1.5-17.3s-11.8 5.1-14.1 10.1c-2.3 5-.7 10.6 3.6 12.6Z" fill="#00E4E5"/><path fill-rule="evenodd" clip-rule="evenodd" d="M326.7 174s-10 11.8-10 18.6c0 6.7 4.5 12.2 10 12.2s10-5.5 10-12.3c0-6.8-10-18.5-10-18.5Z" fill="#00E4E5"/><path d="M332.3 181.5c2.3 3.6 4.4 7.8 4.4 10.9M316.7 192.5c0-3.1 2.1-7.2 4.3-10.8" stroke="#071F4D"/><path fill-rule="evenodd" clip-rule="evenodd" d="M343.1 227.3v-9.7h-34v9.7c0 3.7 3 6.6 6.6 6.6h20.9c3.6 0 6.5-2.9 6.5-6.6Z" fill="#071F4D"/><path fill-rule="evenodd" clip-rule="evenodd" d="M350.4 220.8V198H302v22.8c0 5.9 4.8 10.7 10.7 10.7h26.9c5.9 0 10.7-4.8 10.8-10.7Z" fill="#C7DEFF"/><path fill-rule="evenodd" clip-rule="evenodd" d="M331.7 74.2H117.8L87.4 203h213.8l30.5-128.8Z" fill="#fff"/><path fill-rule="evenodd" clip-rule="evenodd" d="M337 74.2h-6.2l-30.6 129.2h6.2L337 74.2Z" fill="#fff"/><path fill-rule="evenodd" clip-rule="evenodd" d="M303.8 203.5h2.4l30.7-129.3h-1.8l-31.3 129.3Z" fill="#C7DEFF"/><path d="m337 74.2-30.6 129.2h-5.9" stroke="#071F4D"/><path fill-rule="evenodd" clip-rule="evenodd" d="M229.9 202.1h-47.6l2 9.6h47.3l-1.7-9.6Z" fill="#C7DEFF"/><path fill-rule="evenodd" clip-rule="evenodd" d="M94.7 172.6 87.4 203h213.1l7.8-30.4H94.7Z" fill="#006EFF"/><path fill-rule="evenodd" clip-rule="evenodd" d="M94.7 172.6 87.4 203h213.1l7.8-30.4H94.7Z" fill="#006EFF"/><path d="M138.5 74.2h193.2l-23.4 98.6M94.5 172.7l11-46.3M104.8 155.4l-2.3 11.5h6.7M316 112.1l1.1-4.5" stroke="#071F4D"/><path fill-rule="evenodd" clip-rule="evenodd" d="M148.3 138.1h97V119h-97v19.1Z" fill="#00E4E5"/><path d="M303.1 80.6h20.3l-4.6 19.6M228.3 234.3c3.6 0 6.3-3.2 5.7-6.8l-4.1-24.1" stroke="#071F4D"/><path fill-rule="evenodd" clip-rule="evenodd" d="M226.2 229.5h-68.9v1.2c0 2 1.6 3.7 3.7 3.7h60.1c2.8 0 5-2.2 5.1-4.9Z" fill="#C7DEFF"/><path d="M180.699 226.8h-19.9c-2.8 0-4.6 3-3.3 5.5m0 0c.6 1.2 1.9 2 3.3 2h57.8M175.9 203.4l3.6 17.6M241.2 234.3h65.1M104.6 234.3h41.3" stroke="#071F4D"/><path d="M206.2 234.3h14.9c3.1 0 5.5-2.8 5-5.9l-4.3-24.9M160.7 226.8h46M62.2 226.1h-9.5c-1.2 0-2.2-1-2.2-2.2v-18.3c0-1.2 1-2.2 2.2-2.2h9.5" stroke="#071F4D"/><path d="M53.4 171.7H68c2.1 0 3.7 1.7 3.7 3.7v16.1M79.1 192v-21.8c0-2.5 2-4.6 4.6-4.6h2.2c2.5 0 4.5-2 4.5-4.5m0 0c0-2.5-2-4.5-4.5-4.5H56.1c-2.4 0-4.3-1.9-4.3-4.3V148M71.2 165.2h-18M64 181.7v10.1" stroke="#C7DEFF"/><path fill-rule="evenodd" clip-rule="evenodd" d="M85.7 120H124c4.3 0 7.7-3.5 7.7-7.7V65.5H94.2c-4.7 0-8.5 4.9-8.5 11V120Z" fill="#C7DEFF"/><path d="M85.7 110.7V73c0-4.1 3.4-7.5 7.5-7.5h38.5M146.2 73.8v-2.5c0-3.2-2-5.8-5.8-5.8-2.8 0-6 1.1-6 5.8v42.4c0 4.7-3.8 8.5-8.5 8.5h-15.6" stroke="#071F4D"/><path d="M119.7 122.3H87c-6.1 0-11.1-5-11.1-11.1m0 0h39M126.1 122.3c-6.1 0-11.1-5-11.1-11.1" stroke="#071F4D"/><path fill-rule="evenodd" clip-rule="evenodd" d="M85.4 122.1h37.2c-6.5-1.8-8-10.5-8-10.5H76.2c.6 8.8 9.2 10.5 9.2 10.5Z" fill="#071F4D"/><path fill-rule="evenodd" clip-rule="evenodd" d="M95.8 102.9h4.8V83.6h-4.8v19.3ZM106.6 102.9h4.8V77.6h-4.8v25.3ZM117.3 102.9h4.8V89.1h-4.8v13.8Z" fill="#fff"/><path d="M273.2 195.9h16.9M261.2 195.9h5" stroke="#fff"/><path d="M62.4 201.9v2.9M62.4 224.5v2.9" stroke="#071F4D"/><path d="m153.6 138.1 9.7-19.1M168.8 138.1l9.7-19.1M184.1 138.1l9.7-19.1M199.4 138.1l9.7-19.1M214.6 138.1l9.8-19.1M229.9 138.1l9.7-19.1" stroke="#fff"/><path d="M148.3 138.1h121.6V119H148.3v19.1Z" stroke="#071F4D"/></g></svg>',width:400,height:300,name:"loading_pic",positionType:jC.left}},get expand(){return{type:"svg",svg:`<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="none">\n <path d="M4.64988 6.81235C4.38797 6.48497 4.62106 6 5.04031 6L10.9597 6C11.3789 6 11.612 6.48497 11.3501 6.81235L8.39043 10.512C8.19027 10.7622 7.80973 10.7622 7.60957 10.512L4.64988 6.81235Z" fill="${BS}" fill-opacity="${RS}"/>\n </svg>`,width:MS,height:MS,funcType:VC.expand,name:"expand",positionType:jC.contentLeft,marginLeft:0,marginRight:4,hover:{width:TS,height:TS,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="${xS}" fill-opacity="${_S}"/>\n </svg>`,width:SS,height:SS,funcType:VC.collapse,name:"collapse",positionType:jC.contentLeft,marginLeft:0,marginRight:4,hover:{width:AS,height:AS,bgColor:"rgba(101, 117, 168, 0.1)"},cursor:"pointer"}},get drillDown(){return{name:"drillDown",type:"svg",positionType:jC.absolute,funcType:VC.drillDown,svg:'<svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><rect x="0" y="0" width="1024" height="1024" rx="20%" ry="20%" fill="#ffffff" /><path d="M810.666667 85.333333c70.688 0 128 57.312 128 128v597.333334c0 70.688-57.312 128-128 128H213.333333c-70.688 0-128-57.312-128-128V213.333333c0-70.688 57.312-128 128-128h597.333334z m0 85.333334H213.333333a42.666667 42.666667 0 0 0-42.613333 40.533333L170.666667 213.333333v597.333334a42.666667 42.666667 0 0 0 40.533333 42.613333L213.333333 853.333333h597.333334a42.666667 42.666667 0 0 0 42.613333-40.533333L853.333333 810.666667V213.333333a42.666667 42.666667 0 0 0-40.533333-42.613333L810.666667 170.666667zM549.333333 288a5.333333 5.333333 0 0 1 5.333334 5.333333V469.333333h176a5.333333 5.333333 0 0 1 5.333333 5.333334v74.666666a5.333333 5.333333 0 0 1-5.333333 5.333334H554.666667v176a5.333333 5.333333 0 0 1-5.333334 5.333333h-74.666666a5.333333 5.333333 0 0 1-5.333334-5.333333V554.666667H293.333333a5.333333 5.333333 0 0 1-5.333333-5.333334v-74.666666a5.333333 5.333333 0 0 1 5.333333-5.333334H469.333333V293.333333a5.333333 5.333333 0 0 1 5.333334-5.333333h74.666666z"></path></svg>',width:13,height:13,cursor:"pointer"}},get drillUp(){return{name:"drillUp",type:"svg",positionType:jC.absolute,funcType:VC.drillUp,svg:'<svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><rect x="0" y="0" width="1024" height="1024" rx="20%" ry="20%" fill="#ffffff" /><path d="M810.666667 85.333333c70.688 0 128 57.312 128 128v597.333334c0 70.688-57.312 128-128 128H213.333333c-70.688 0-128-57.312-128-128V213.333333c0-70.688 57.312-128 128-128h597.333334z m0 85.333334H213.333333a42.666667 42.666667 0 0 0-42.613333 40.533333L170.666667 213.333333v597.333334a42.666667 42.666667 0 0 0 40.533333 42.613333L213.333333 853.333333h597.333334a42.666667 42.666667 0 0 0 42.613333-40.533333L853.333333 810.666667V213.333333a42.666667 42.666667 0 0 0-40.533333-42.613333L810.666667 170.666667zM693.333333 469.333333a42.666667 42.666667 0 1 1 0 85.333334H330.666667a42.666667 42.666667 0 1 1 0-85.333334h362.666666z"></path></svg>',width:13,height:13,cursor:"pointer"}},get dragReorder(){return{type:"svg",svg:`<svg t="1710129136961" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5166" width="200" height="200"><path d="M362.666667 192m-64 0a64 64 0 1 0 128 0 64 64 0 1 0-128 0Z" fill="${kS}" fill-opacity="${LS}" p-id="5167"></path><path d="M661.333333 192m-64 0a64 64 0 1 0 128 0 64 64 0 1 0-128 0Z" fill="${kS}" fill-opacity="${LS}" p-id="5168"></path><path d="M362.666667 512m-64 0a64 64 0 1 0 128 0 64 64 0 1 0-128 0Z" fill="${kS}" fill-opacity="${LS}" p-id="5169"></path><path d="M661.333333 512m-64 0a64 64 0 1 0 128 0 64 64 0 1 0-128 0Z" fill="${kS}" fill-opacity="${LS}" p-id="5170"></path><path d="M362.666667 832m-64 0a64 64 0 1 0 128 0 64 64 0 1 0-128 0Z" fill="${kS}" fill-opacity="${LS}" p-id="5171"></path><path d="M661.333333 832m-64 0a64 64 0 1 0 128 0 64 64 0 1 0-128 0Z" fill="${kS}" fill-opacity="${LS}" p-id="5172"></path></svg>`,width:PS,height:PS,funcType:VC.dragReorder,positionType:jC.left,name:"dragReorder",marginLeft:-10,marginRight:10,cursor:"grab"}}};function FS(){return Lw(HS,lS)}let zS=class extends fs{clear(){this.removeAllChild()}getChildByName(t,e){let i=null;return this.forEachChildren((e=>e.name===t&&(i=e,!0))),e&&this.forEachChildren((e=>{if(e.getChildByName){const o=e.getChildByName(t,!0);if(o)return i=o,!0}return!1})),i}get width(){var t;let e=this.AABBBounds.width();return e!==1/0&&e!==-1/0||(e=0),Math.max(e,null!==(t=this.attribute.width)&&void 0!==t?t:0)}get height(){var t;let e=this.AABBBounds.height();return e!==1/0&&e!==-1/0||(e=0),Math.max(e,null!==(t=this.attribute.height)&&void 0!==t?t:0)}setDeltaWidth(t){var e;0!==t&&(this.setAttribute("width",(null!==(e=this.attribute.width)&&void 0!==e?e:0)+t),this.border&&(this.border.setAttribute("width",this.border.attribute.width+t),"group"===this.border.type&&this.border.firstChild.setAttribute("width",this.border.firstChild.attribute.width+t)))}setDeltaHeight(t){var e;0!==t&&(this.setAttribute("height",(null!==(e=this.attribute.height)&&void 0!==e?e:0)+t),this.border&&(this.border.setAttribute("height",this.border.attribute.height+t),"group"===this.border.type&&this.border.firstChild.setAttribute("width",this.border.firstChild.attribute.height+t)))}setDeltaX(t){0!==t&&this.setAttribute("x",this.attribute.x+t)}setDeltaY(t){0!==t&&this.setAttribute("y",this.attribute.y+t)}forEachChildrenSkipChild(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"border-rect";if(arguments.length>2&&void 0!==arguments[2]&&arguments[2]){let i=this._lastChild,o=0;for(;i;){if(i.name!==e&&t(i,o++))return;i=i._prev}}else{let i=this._firstChild,o=0;for(;i;){if(i.name!==e&&t(i,o++))return;i=i._next}}}getColGroup(t){let e=this._firstChild;if(!e)return null;for(let i=0;i<this.childrenCount;i++){if(e.col===t)return e;e=e._next}return null}getRowGroup(t){let e=this._firstChild;if(!e)return null;for(let i=0;i<this.childrenCount;i++){if(e.row===t)return e;e=e._next}return null}addCellGroup(t){if(0===this.childrenCount||this.lastChild.row===t.row-1)this.addChild(t);else{let e=this._firstChild;for(let i=0;i<this.childrenCount;i++){if(e.row===t.row-1)return void this.insertAfter(t,e);e=e._next}this.addChild(t)}}getChildAt(t){const e=super.getChildAt(t);return e&&"border-rect"===e.name?e._next:e}tryUpdateAABBBounds(){if("cell"===this.role){if(!this.shouldUpdateAABBBounds())return this._AABBBounds;const t=this.shouldSelfChangeUpdateAABBBounds(),e=this.doUpdateAABBBounds();return this.addUpdateLayoutTag(),function(t,e){t.stage&&t.stage.dirtyBounds&&t.stage.renderCount&&(t.isContainer&&!e||t.stage.dirty(t.globalAABBBounds))}(this,t),e}return super.tryUpdateAABBBounds()}doUpdateAABBBounds(){if("cell"===this.role){const t=this.attribute,{x:e,y:i,width:o,height:n}=t;return this._AABBBounds.setValue(e,i,e+o,i+n),this.parent&&this.parent.addChildUpdateBoundTag(),this.clearUpdateBoundTag(),this.shadowRoot&&this.shadowRoot.tryUpdateAABBBounds(),this._AABBBounds}return"body"===this.role||"row-header"===this.role||"col-header"===this.role||"right-frozen"===this.role||"bottom-frozen"===this.role||"corner-header"===this.role||"corner-right-top-header"===this.role||"corner-right-bottom-header"===this.role||"corner-left-bottom-header"===this.role?(this._AABBBounds.setValue(-1/0,-1/0,1/0,1/0),this.parent&&this.parent.addChildUpdateBoundTag(),this.clearUpdateBoundTag(),this.shadowRoot&&this.shadowRoot.tryUpdateAABBBounds(),this._AABBBounds):super.doUpdateAABBBounds()}updateColumnRowNumber(t){this.rowNumber?this.rowNumber=Math.max(this.rowNumber,t):this.rowNumber=t}updateColumnHeight(t){this.colHeight?this.colHeight+=t:this.colHeight=t}};function IS(t,e,i,o){const n=t/e;let r,s;return n>i/o?(r=i,s=r/n):(s=o,r=s*n),{width:r,height:s}}function OS(t,e,i,o,n,r){let s=arguments.length>6&&void 0!==arguments[6]?arguments[6]:"left",l=arguments.length>7&&void 0!==arguments[7]?arguments[7]:"middle",a=arguments.length>8&&void 0!==arguments[8]?arguments[8]:[0,0,0,0],h=arguments.length>9&&void 0!==arguments[9]?arguments[9]:0,d=arguments.length>10&&void 0!==arguments[10]?arguments[10]:0,c=arguments.length>11&&void 0!==arguments[11]?arguments[11]:0,u=arguments.length>12&&void 0!==arguments[12]?arguments[12]:0;const g=t+i,p=e+o;let f=t+a[3]+h;"right"===s||"end"===s?f=g-n-a[1]-d:"center"===s&&(f=t+(i-n+h-d)/2);let v=e+a[0]+c;return"bottom"===l||"alphabetic"===l||"ideographic"===l?v=p-r-a[2]-u:"middle"===l&&(v=e+(o-r+c-u)/2),{x:f,y:v}}function DS(t,e,i,o,n){const r=e&&Q(e[t])?e[t]:void 0;return"function"==typeof r?r({col:i,row:o,table:n,value:n.getCellValue(i,o),dataValue:n.getCellOriginValue(i,o),cellHeaderPaths:n.getCellHeaderPaths(i,o)}):r}function WS(t,e,i,o,n){const r=e&&Q(e[t])?e[t]:void 0;if("function"==typeof r)return r({col:i,row:o,table:n,value:n.getCellValue(i,o),dataValue:n.getCellOriginValue(i,o),cellHeaderPaths:n.getCellHeaderPaths(i,o)})}function NS(t,e,i,o){var n,r,s,l,a,h,d,c,u,g,p,f,v,m,b,y,C,w;let x=null!==(r=null===(n=null==i?void 0:i.group)||void 0===n?void 0:n.strokeArrayWidth)&&void 0!==r?r:void 0;return o.theme.cellInnerBorder||!function(t){return!!Q(t)&&(!rt(t)||t.some((t=>Q(t))))}(o.theme.frameStyle.borderLineWidth)||function(t){return 0===t||rt(t)&&t.every((t=>0===t))}(o.theme.frameStyle.borderLineWidth)||(0===t&&(x=null!=x?x:[null===(s=null==i?void 0:i.group)||void 0===s?void 0:s.lineWidth,null===(l=null==i?void 0:i.group)||void 0===l?void 0:l.lineWidth,null===(a=null==i?void 0:i.group)||void 0===a?void 0:a.lineWidth,null===(h=null==i?void 0:i.group)||void 0===h?void 0:h.lineWidth],x[3]=0),t===o.colCount-1&&(x=null!=x?x:[null===(d=null==i?void 0:i.group)||void 0===d?void 0:d.lineWidth,null===(c=null==i?void 0:i.group)||void 0===c?void 0:c.lineWidth,null===(u=null==i?void 0:i.group)||void 0===u?void 0:u.lineWidth,null===(g=null==i?void 0:i.group)||void 0===g?void 0:g.lineWidth],x[1]=0),0===e&&(x=null!=x?x:[null===(p=null==i?void 0:i.group)||void 0===p?void 0:p.lineWidth,null===(f=null==i?void 0:i.group)||void 0===f?void 0:f.lineWidth,null===(v=null==i?void 0:i.group)||void 0===v?void 0:v.lineWidth,null===(m=null==i?void 0:i.group)||void 0===m?void 0:m.lineWidth],x[0]=0),e===o.rowCount-1&&(x=null!=x?x:[null===(b=null==i?void 0:i.group)||void 0===b?void 0:b.lineWidth,null===(y=null==i?void 0:i.group)||void 0===y?void 0:y.lineWidth,null===(C=null==i?void 0:i.group)||void 0===C?void 0:C.lineWidth,null===(w=null==i?void 0:i.group)||void 0===w?void 0:w.lineWidth],x[2]=0)),x}class GS extends zS{constructor(t){super(t),this._autoWidth=!1,this._autoHeight=!1,this._leftGroup=new zS({pickable:!1,fill:!1,stroke:!1}),this._leftGroup.role="content-left",this._rightGroup=new zS({pickable:!1,fill:!1,stroke:!1}),this._rightGroup.role="content-right",this._centerGroup=new zS({pickable:!1,fill:!1,stroke:!1}),this._centerGroup.role="content-center",this.appendChild(this._leftGroup),this.appendChild(this._rightGroup),this.appendChild(this._centerGroup)}setCellContentOption(t){this._autoWidth=t.autoWidth,this._autoHeight=t.autoHeight,this._cellWidth=t.cellWidth,this._originCellWidth=t.cellWidth,this._cellHeight=t.cellHeight,this._align=t.align,this._baseline=t.baseline}addLeftOccupyingIcon(t){var e,i,o;t.setAttribute("x",this._leftGroup.width+(null!==(e=t.attribute.marginLeft)&&void 0!==e?e:0)),this._leftGroup.appendChild(t),this._leftGroup.setDeltaWidth((null!==(i=t.attribute.marginLeft)&&void 0!==i?i:0)+(null!==(o=t.attribute.marginRight)&&void 0!==o?o:0)+t.attribute.width)}addRightOccupyingIcon(t){var e,i,o;t.setAttribute("x",this._rightGroup.width+(null!==(e=t.attribute.marginLeft)&&void 0!==e?e:0)),this._rightGroup.appendChild(t),this._rightGroup.setDeltaWidth((null!==(i=t.attribute.marginLeft)&&void 0!==i?i:0)+(null!==(o=t.attribute.marginRight)&&void 0!==o?o:0)+t.attribute.width)}addContent(t){const e=this._centerGroup.lastChild;e&&t.setAttributes({x:e.attribute.x+e.AABBBounds.width()}),this._centerGroup.appendChild(t),t instanceof Nh&&(this._centerGroup.setAttribute("pickable",!1),t.setAttribute("textAlign","left"))}layout(){let t=this._leftGroup.width;t===1/0&&(t=0);let e=this._rightGroup.width;if(e===-1/0&&(e=0),this._autoWidth){const i=this._centerGroup.width;this._cellWidth=t+e+i,this.setAttribute("width",this._cellWidth)}else{const i=this._cellWidth-t-e;this.updateCenterLayout(i);const o=this._centerGroup.width;this._cellWidth=t+e+o,this.setAttribute("width",this._cellWidth)}this.updateHorizontalPos();const i=this._leftGroup.height,o=this._rightGroup.height,n=this._centerGroup.height;this._cellHeight=Math.max(i,o,n),this.setAttribute("height",this._cellHeight),this.updateVerticalPos()}updateCenterLayout(t){let e=t;this._centerGroup.forEachChildren((t=>{t instanceof U_&&(e-=t.AABBBounds.width())}));const i=this._centerGroup.getChildByName("text");i instanceof vc?i.setAttribute("width",e):i instanceof Nh&&i.setAttribute("maxLineWidth",e);let o=0;this._centerGroup.forEachChildren((t=>{t.setAttribute("x",o),o+=t.AABBBounds.width()}))}updateHorizontalPos(){this._leftGroup.setAttribute("x",0),this._rightGroup.setAttribute("x",this._cellWidth-this._rightGroup.width),this._centerGroup.setAttribute("x",this._leftGroup.width),"left"===this._align||"start"===this._align?this.setAttribute("dx",0):"center"===this._align?this.setAttribute("dx",-this.attribute.width/2):"right"!==this._align&&"end"!==this._align||this.setAttribute("dx",-this.attribute.width)}updateVerticalPos(){"top"===this._baseline?(this._leftGroup.setAttribute("y",0),this._rightGroup.setAttribute("y",0),this._centerGroup.setAttribute("y",0)):"middle"===this._baseline?(this._leftGroup.forEachChildren((t=>{t.setAttribute("y",(this._leftGroup.height-t.AABBBounds.height())/2)})),this._rightGroup.forEachChildren((t=>{t.setAttribute("y",(this._rightGroup.height-t.AABBBounds.height())/2)})),this._leftGroup.setAttribute("y",this._cellHeight/2-this._leftGroup.height/2),this._rightGroup.setAttribute("y",this._cellHeight/2-this._rightGroup.height/2),this._centerGroup.setAttribute("y",this._cellHeight/2-this._centerGroup.height/2)):"bottom"===this._baseline&&(this._leftGroup.forEachChildren((t=>{t.setAttribute("y",this._leftGroup.height-t.AABBBounds.height())})),this._rightGroup.forEachChildren((t=>{t.setAttribute("y",this._rightGroup.height-t.AABBBounds.height())})),this._leftGroup.setAttribute("y",this._cellHeight-this._leftGroup.height),this._rightGroup.setAttribute("y",this._cellHeight-this._rightGroup.height),this._centerGroup.setAttribute("y",this._cellHeight-this._centerGroup.height))}updateWidth(t){this._cellWidth=t,this._originCellWidth=t,this.layout()}updateHeight(t){this._cellHeight=t,this._cellWidth=this._originCellWidth,this.layout()}}function jS(t,e,i){var o,n,r,s,l;let a=0;const h=i.internalProps.layoutMap;if(h.isHeader(t,e)){const r=h.getHeader(t,e);Q(null==r?void 0:r.hierarchyLevel)&&(a=(null!==(o=r.hierarchyLevel)&&void 0!==o?o:0)*(null!==(n=h.rowHierarchyIndent)&&void 0!==n?n:0),h.rowHierarchyTextStartAlignment&&!i.internalProps.headerHelper.getHierarchyIcon(t,e)&&(a+=i.internalProps.headerHelper.getHierarchyIconWidth()))}else if(i.options.groupBy||(null===(r=i.getBodyColumnDefine(t,e))||void 0===r?void 0:r.tree)){const o=i.dataSource.getIndexKey(i.getRecordShowIndexByCell(t,e)),n=null!==(s=i.dataSource.getGroupLength())&&void 0!==s?s:0;let r=rt(o)?o.length-1:0;n>0&&r===n&&(r=0),a=Array.isArray(o)&&i.getHierarchyState(t,e)!==WC.none?r*(null!==(l=h.hierarchyIndent)&&void 0!==l?l:0):0,h.hierarchyTextStartAlignment&&!i.internalProps.bodyHelper.getHierarchyIcon(t,e)&&(a+=i.internalProps.bodyHelper.getHierarchyIconWidth())}return a}function VS(t,e){var i,o;let n,r=!1;for(nt(t)&&t.length>(e.options.maxCharactersNumber||200)&&(t=t.slice(0,e.options.maxCharactersNumber||200),t+="…",r=!0),n=e.internalProps.enableLineBreak||(null===(i=e.options.customConfig)||void 0===i?void 0:i.multilinesForXTable)?gw(t).replace(/\r?\n/g,"\n").replace(/\r/g,"\n").split("\n")||[]:[gw(t)];n.length&&n.length>1&&!n[n.length-1];)n.pop();if((null===(o=e.options.customConfig)||void 0===o?void 0:o.multilinesForXTable)&&!e.internalProps.autoWrapText)for(;n.length&&n.length>1&&!n[0];)n.shift();return{text:n,moreThanMaxCharacters:r}}function US(t,e,i,o,n,r,s){var l,a,h,d,c,u;const g={};"image"===t.type?g.image=t.src:("svg"===t.type||"svg"in t)&&(g.image=t.svg),g.width=t.width,g.height=t.height,g.visibleTime=null!==(l=t.visibleTime)&&void 0!==l?l:"always",g.funcType=t.funcType,g.interactive=t.interactive;let p=0;if(s&&0!==(null==s?void 0:s.addedHierarchyOffset)||!at(i)||!at(o)||!r||t.funcType!==VC.collapse&&t.funcType!==VC.expand&&t.positionType!==jC.contentLeft&&t.positionType!==jC.contentRight||(p=n?jS(n.start.col,n.start.row,r):jS(i,o,r),s&&(s.addedHierarchyOffset=1)),g.marginLeft=(null!==(a=t.marginLeft)&&void 0!==a?a:0)+p,g.marginRight=null!==(h=t.marginRight)&&void 0!==h?h:0,!1===t.interactive&&(g.pickable=!1),t.hover&&(g.backgroundWidth=null!==(d=t.hover.width)&&void 0!==d?d:t.width,g.backgroundHeight=null!==(c=t.hover.width)&&void 0!==c?c:t.width,g.backgroundColor=null!==(u=t.hover.bgColor)&&void 0!==u?u:"rgba(22,44,66,0.2)",g.hoverImage=t.hover.image),t.cursor&&(g.cursor=t.cursor),"shape"in t&&"circle"===t.shape&&(g.shape=t.shape),e)return e.setAttributes(g),e.loadImage(g.image),e;const f=new U_(g);return f.tooltip=t.tooltip,f}function $S(t){var e,i,o,n,r,s;const l={};return"image"===t.type?l.image=t.src:("svg"===t.type||"svg"in t)&&(l.image=t.svg),l.visibleTime=null!==(e=t.visibleTime)&&void 0!==e?e:"always",l.funcType=t.funcType,l.id=t.name,l.width=t.width,l.height=t.height,(t.marginRight||t.marginLeft)&&(l.margin=[0,null!==(i=t.marginRight)&&void 0!==i?i:0,0,null!==(o=t.marginLeft)&&void 0!==o?o:0]),t.hover&&(l.backgroundWidth=null!==(n=t.hover.width)&&void 0!==n?n:t.width,l.backgroundHeight=null!==(r=t.hover.height)&&void 0!==r?r:t.height,l.backgroundShowMode="hover",l.hoverImage=t.hover.image,l.backgroundStroke=!1,l.backgroundFill=null!==(s=t.hover.bgColor)&&void 0!==s?s:"rgba(22,44,66,0.2)"),t.cursor&&(l.cursor=t.cursor),l.tooltip=t.tooltip,l}function XS(t,e,i,o,n,r,s,l,a){var h,d,c,u;ht(t.contentWidth)&&(o=e-(null!==(h=t.contentWidth)&&void 0!==h?h:t.attribute.width));let g,p=0,f=0,v=0,m=0;t.forEachChildren((t=>{var e,i,o,n;"icon-left"===t.role?(p+=t.AABBBounds.width()+(null!==(e=t.attribute.marginLeft)&&void 0!==e?e:0)+(null!==(i=t.attribute.marginRight)&&void 0!==i?i:0),f=Math.max(f,t.AABBBounds.height())):"icon-right"===t.role&&(v+=t.AABBBounds.width()+(null!==(o=t.attribute.marginLeft)&&void 0!==o?o:0)+(null!==(n=t.attribute.marginRight)&&void 0!==n?n:0),m=Math.max(m,t.AABBBounds.height()))}));const b=t.getChildByName("text"),y=t.getChildByName("content");let C;b instanceof Nh?(g=b.AABBBounds.height(),b.setAttribute("maxLineWidth",e-p-v-(r[1]+r[3])-(null!==(d=b.attribute.dx)&&void 0!==d?d:0)-(null!==(c=a.table.theme._contentOffset)&&void 0!==c?c:0)),C=b.AABBBounds.height()):b instanceof vc?(g=b.AABBBounds.height(),b.setAttribute("width",e-p-v-(r[1]+r[3])),C=b.AABBBounds.height()):y&&(g=y.AABBBounds.height(),y.updateWidth(e-p-v-(r[1]+r[3])),C=y.AABBBounds.height());const w=Math.round(Math.max(f,m,g)+r[0]+r[2]);if(t.forEachChildren((i=>{var n;if("icon-left"===i.role);else if("icon-right"===i.role)i.setAttribute("x",i.attribute.x+o);else if("icon-absolute-right"===i.role)i.setAttribute("x",i.attribute.x+o);else if("content"===i.name||"text"===i.name&&"richtext"!==i.type){const t=null!==(n=i.attribute.textAlign)&&void 0!==n?n:s;"center"===t?i.setAttribute("x",r[3]+p+(e-(r[1]+r[3])-p-v)/2):"right"===t&&i.setAttribute("x",r[3]+e-(r[1]+r[3])-v)}else"mark"===i.name&&i.setAttribute("x",t.attribute.width)})),n){let e=Math.max(f,C,m);if(function(t,e,i,o){const n=t.table,r=Mx(n,e.col,e.row);if(r&&r.end.row-r.start.row){o/=r.end.row-r.start.row+1,i/=r.end.row-r.start.row+1;for(let t=r.start.row;t<=r.end.row;t++){const e=n.getRowHeight(t);if(e===o&&i!==e)return!0;if(i>e)return!0}}else{const t=n.getRowHeight(e.row);if(t===o&&i!==t)return!0;if(i>t)return!0}return!1}(a,t,Math.round(e+r[0]+r[2]),w))return!0;e=(null!==(u=t.contentHeight)&&void 0!==u?u:i)-(r[0]+r[2]),t.forEachChildren((t=>{"rect"!==t.type&&"chart"!==t.type&&t.name!==Q_&&("mark"===t.name?t.setAttribute("y",0):"middle"===l?t.setAttribute("y",r[0]+(e-t.AABBBounds.height())/2):"bottom"===l?t.setAttribute("y",r[0]+e-t.AABBBounds.height()):t.setAttribute("y",r[0]))}))}else"middle"!==l&&"bottom"!==l||t.forEachChildren((t=>{"rect"!==t.type&&"chart"!==t.type&&t.name!==Q_&&("mark"===t.name?t.setAttribute("y",0):"middle"===l?t.setAttribute("y",(i-r[2]+r[0]-t.AABBBounds.height())/2):"bottom"===l?t.setAttribute("y",i-t.AABBBounds.height()-r[2]):t.setAttribute("y",r[0]))}));return!1}function YS(t,e,i,o,n,r,s,l){var a;const h=e-Math.floor(n[0]+n[2]),d=t.getChildByName("text");d instanceof Nh&&!o?d.setAttributes({heightLimit:!1===(null===(a=l.options.customConfig)||void 0===a?void 0:a.limitContentHeight)?-1:h}):d instanceof vc&&!o?d.setAttributes({height:h}):t.getChildByName("content")&&t.getChildByName("content").updateHeight(h),t.forEachChildren((t=>{t.setAttribute("dy",0),"rect"===t.type||"chart"===t.type||t.name===Q_||("mark"===t.name?t.setAttribute("y",0):"middle"===s?t.setAttribute("y",n[0]+(h-t.AABBBounds.height())/2):"bottom"===s?t.setAttribute("y",n[0]+h-t.AABBBounds.height()):t.setAttribute("y",n[0]))}))}function KS(t,e,i,o){const n=[],r=[],s=[],l=[],a=[],h=[],d=[],c=[];let u=0,g=0,p=0,f=0,v=0,m=0;return t.forEach((t=>{switch(t.positionType){case jC.left:n.push(t);break;case jC.right:r.push(t);break;case jC.contentLeft:s.push(t);break;case jC.contentRight:l.push(t);break;case jC.absoluteRight:c.push(t);break;case jC.inlineFront:a.push(t);break;case jC.inlineEnd:h.push(t)}})),n.forEach((t=>{var n,r,s;const l=US(t,void 0,e.col,e.row,i,o);l.role="icon-left",l.name=t.name,l.setAttribute("x",u+(null!==(n=l.attribute.marginLeft)&&void 0!==n?n:0)),u+=l.AABBBounds.width()+(null!==(r=l.attribute.marginLeft)&&void 0!==r?r:0)+(null!==(s=l.attribute.marginRight)&&void 0!==s?s:0),g=Math.max(g,l.AABBBounds.height()),e.appendChild(l)})),r.forEach((t=>{var n,r,s;const l=US(t,void 0,e.col,e.row,i,o);l.role="icon-right",l.name=t.name,l.setAttribute("x",p+(null!==(n=l.attribute.marginLeft)&&void 0!==n?n:0)),p+=l.AABBBounds.width()+(null!==(r=l.attribute.marginLeft)&&void 0!==r?r:0)+(null!==(s=l.attribute.marginRight)&&void 0!==s?s:0),f=Math.max(f,l.AABBBounds.height()),e.appendChild(l)})),d.forEach((t=>{var n,r,s;const l=US(t,void 0,e.col,e.row,i,o);l.role="icon-absolute-left",l.name=t.name,l.setAttribute("x",v+(null!==(n=l.attribute.marginLeft)&&void 0!==n?n:0)),v+=l.AABBBounds.width()+(null!==(r=l.attribute.marginLeft)&&void 0!==r?r:0)+(null!==(s=l.attribute.marginRight)&&void 0!==s?s:0),e.appendChild(l)})),c.forEach((t=>{var n,r,s;const l=US(t,void 0,e.col,e.row,i,o);l.role="icon-absolute-right",l.name=t.name,l.setAttribute("x",m+(null!==(n=l.attribute.marginLeft)&&void 0!==n?n:0)),m+=l.AABBBounds.width()+(null!==(r=l.attribute.marginLeft)&&void 0!==r?r:0)+(null!==(s=l.attribute.marginRight)&&void 0!==s?s:0),e.appendChild(l)})),{leftIcons:n,rightIcons:r,contentLeftIcons:s,contentRightIcons:l,inlineFrontIcons:a,inlineEndIcons:h,absoluteLeftIcons:d,absoluteRightIcons:c,leftIconWidth:u,leftIconHeight:g,rightIconWidth:p,rightIconHeight:f,absoluteLeftIconWidth:v,absoluteRightIconWidth:m}}function qS(t,e){if(t.hasOwnProperty("hoverIconId")){const e=this;if(e.skipMergeUpdate)return;const i=K_(e);if(!i||!i.stage)return;const o=i.stage.table;e.skipAttributeUpdate=!0;const{mergeStartCol:n,mergeEndCol:r,mergeStartRow:s,mergeEndRow:l}=i;if(Q(n)&&Q(r)&&Q(s)&&Q(l)&&(n!==r||s!==l)){for(let a=n;a<=r;a++)for(let n=s;n<=l;n++){if(a===i.col&&n===i.row){if(t.hoverIconId!==e.attribute.hoverIconId){const i=e._frameCache.icons.get(t.hoverIconId);e.updateHoverIconState(i)}continue}const r=o.scenegraph.highPerformanceGetCell(a,n);if("cell"===r.role){const i=r.getChildByName(e.name,!0);if(!i||i.skipAttributeUpdate)continue;t.hoverIconId!==i.attribute.hoverIconId&&(i.setAttribute("hoverIconId",t.hoverIconId),r.addUpdateBoundTag())}}e.skipAttributeUpdate=void 0}}}function ZS(t,e,i,o,n,r,s,l,a,h,d,c,u,g,p,f,v){var m,b,y,C,w,x,_,S,A,B,R,M,T,k,L,P,E,H,F,z,I,O,D,W,N,G,j,V,U,$;const X=WS("padding",g._getCellStyle(o,n),o,n,g);(null===(m=g.options.customConfig)||void 0===m?void 0:m.imageMargin)?h=r_(null===(b=g.options.customConfig)||void 0===b?void 0:b.imageMargin):Q(X)&&(h=X),(null===(y=null==p?void 0:p.text)||void 0===y?void 0:y.textAlign)&&(d=null===(C=null==p?void 0:p.text)||void 0===C?void 0:C.textAlign),(null===(w=null==p?void 0:p.text)||void 0===w?void 0:w.textBaseline)&&(c=null===(x=null==p?void 0:p.text)||void 0===x?void 0:x.textBaseline);const Y=NS(o,n,p,g);let K,q;if(v&&(K=g.scenegraph.highPerformanceGetCell(o,n,!0),K&&"cell"===K.role&&K.setAttributes({x:e,y:i,width:r,height:s,lineWidth:null!==(S=null===(_=null==p?void 0:p.group)||void 0===_?void 0:_.lineWidth)&&void 0!==S?S:void 0,fill:null!==(B=null===(A=null==p?void 0:p.group)||void 0===A?void 0:A.fill)&&void 0!==B?B:void 0,stroke:null!==(M=null===(R=null==p?void 0:p.group)||void 0===R?void 0:R.stroke)&&void 0!==M?M:void 0,strokeArrayWidth:null!=Y?Y:void 0,strokeArrayColor:null!==(k=null===(T=null==p?void 0:p.group)||void 0===T?void 0:T.strokeArrayColor)&&void 0!==k?k:void 0,cursor:null!==(P=null===(L=null==p?void 0:p.group)||void 0===L?void 0:L.cursor)&&void 0!==P?P:void 0,lineDash:null!==(H=null===(E=null==p?void 0:p.group)||void 0===E?void 0:E.lineDash)&&void 0!==H?H:void 0,lineCap:"butt",clip:!0,cornerRadius:p.group.cornerRadius})),K&&"cell"===K.role||(K=new zS({x:e,y:i,width:r,height:s,lineWidth:null!==(z=null===(F=null==p?void 0:p.group)||void 0===F?void 0:F.lineWidth)&&void 0!==z?z:void 0,fill:null!==(O=null===(I=null==p?void 0:p.group)||void 0===I?void 0:I.fill)&&void 0!==O?O:void 0,stroke:null!==(W=null===(D=null==p?void 0:p.group)||void 0===D?void 0:D.stroke)&&void 0!==W?W:void 0,strokeArrayWidth:null!=Y?Y:void 0,strokeArrayColor:null!==(G=null===(N=null==p?void 0:p.group)||void 0===N?void 0:N.strokeArrayColor)&&void 0!==G?G:void 0,cursor:null!==(V=null===(j=null==p?void 0:p.group)||void 0===j?void 0:j.cursor)&&void 0!==V?V:void 0,lineDash:null!==($=null===(U=null==p?void 0:p.group)||void 0===U?void 0:U.lineDash)&&void 0!==$?$:void 0,lineCap:"butt",clip:!0,cornerRadius:p.group.cornerRadius}),K.role="cell",K.col=o,K.row=n,null==t||t.addCellGroup(K)),u){let t=o,e=n;f&&(t=f.start.col,e=f.start.row),q=g.getCellIcons(t,e)}let Z=0,J=0,tt=0;if(Array.isArray(q)&&0!==q.length){const{leftIconWidth:t,rightIconWidth:e,absoluteLeftIconWidth:i,absoluteRightIconWidth:o}=KS(q,K,f,g);Z=t+e,J=t,tt=e,K.forEachChildren((t=>{"icon-left"===t.role?t.setAttribute("x",t.attribute.x+h[3]):"icon-right"===t.role?t.setAttribute("x",t.attribute.x+r-e-h[1]):"icon-absolute-right"===t.role&&t.setAttribute("x",t.attribute.x+r-o-h[1])})),K.forEachChildren((t=>{"middle"===c?t.setAttribute("y",(s-t.AABBBounds.height())/2):"bottom"===c?t.setAttribute("y",s-t.AABBBounds.height()-h[2]):t.setAttribute("y",h[0])})),K._cellLeftIconWidth=J,K._cellRightIconWidth=tt}const et=g.getCellValue(o,n),it=cc({x:h[3],y:h[0],width:r-h[1]-h[3]-Z,height:s-h[0]-h[2],image:et,cursor:"pointer"});return it.name="image",it.keepAspectRatio=l,it.textAlign=d,it.textBaseline=c,l||a?it.resources&&it.resources.has(it.attribute.image)&&"success"===it.resources.get(it.attribute.image).state?setTimeout((()=>{iA(a,l,h,d,c,it,K,g)}),0):it.successCallback=()=>{iA(a,l,h,d,c,it,K,g),g.scenegraph.updateNextFrame()}:it.resources&&it.resources.has(it.attribute.image)&&"success"===it.resources.get(it.attribute.image).state?QS(K,o,n,0,0,g):it.successCallback=()=>{QS(K,o,n,0,0,g)},it.failCallback=()=>{const t=FS();it.image=t.damage_pic.svg},K.appendChild(it),K}function JS(t,e,i,o,n,r,s){let l=!1,a=null,h=null;const{width:d,height:c,isMerge:u}=tA(s,n.table);if(d<i+r[1]+r[3]&&(a=i+r[1]+r[3],l=!0),c<o+r[2]+r[0]&&(h=o+r[2]+r[0],l=!0),l){if("number"==typeof a)if(u)for(let t=s.mergeStartCol;t<=s.mergeEndCol;t++)n.setColWidth(t,a/(s.mergeEndCol-s.mergeStartCol+1));else n.setColWidth(t,a);if("number"==typeof h)if(u)for(let t=s.mergeStartRow;t<=s.mergeEndRow;t++)n.setRowHeight(t,h/(s.mergeEndRow-s.mergeStartRow+1));else n.setRowHeight(e,h);return n.component.updateScrollBar(),!0}return!1}function QS(t,e,i,o,n,r){var s,l,a,h,d,c,u,g,p,f,v,m;const b=t.getChildByName("image");if(!b)return;const y="string"!=typeof b.attribute.image&&b.attribute.image||(null===(s=b.resources)||void 0===s?void 0:s.get(b.attribute.image).data);if(!y)return;const C=r._getCellStyle(e,i),w=null!==(l=DS("textAlign",C,e,i,r))&&void 0!==l?l:"left",x=null!==(a=DS("textBaseline",C,e,i,r))&&void 0!==a?a:"middle";let _;_=(null===(h=r.options.customConfig)||void 0===h?void 0:h.imageMargin)?r_(null===(d=r.options.customConfig)||void 0===d?void 0:d.imageMargin):null!==(c=r_(DS("padding",C,e,i,r)))&&void 0!==c?c:[0,0,0,0];const{width:S,height:A,isMerge:B}=tA(t,r),R=null!==(u=t.mergeStartCol)&&void 0!==u?u:t.col,M=null!==(g=t.mergeStartRow)&&void 0!==g?g:t.row,T=null!==(p=t.mergeEndCol)&&void 0!==p?p:t.col,k=null!==(f=t.mergeEndCol)&&void 0!==f?f:t.row,L=null!==(v=t._cellLeftIconWidth)&&void 0!==v?v:0,P=null!==(m=t._cellRightIconWidth)&&void 0!==m?m:0;if(b.keepAspectRatio){const{width:t,height:e}=IS(y.width||y.videoWidth,y.height||y.videoHeight,S-(_[1]+_[3]),A-(_[0]+_[2])),i=OS(0,0,S,A,t,e,w,x,_);for(let o=R;o<=T;o++)for(let n=M;n<=k;n++){const s=r.scenegraph.getCell(o,n).getChildByName("image");null==s||s.setAttributes({x:i.x,y:i.y,width:t,height:e})}}else for(let t=R;t<=T;t++)for(let e=M;e<=k;e++){const i=r.scenegraph.getCell(t,e).getChildByName("image");null==i||i.setAttributes({x:L+_[3],y:_[0],width:S-_[1]-_[3]-P-L,height:A-_[0]-_[2]})}if(t.getChildByName("play-icon")){const e=0,i=0,{width:o,height:n}=tA(t,r),s=Math.floor(Math.min(o-_[1]-_[3],n-_[2]-_[0])/2),l=e+(o>b.attribute.width?b.attribute.x-e+b.attribute.width/2:o/2),a=i+(n>b.attribute.height?b.attribute.y-i+b.attribute.height/2:n/2);for(let t=R;t<=T;t++)for(let e=M;e<=k;e++)r.scenegraph.getCell(t,e).getChildByName("play-icon").setAttributes({x:l-s/2,y:a-s/2,width:s,height:s})}t.forEachChildren((t=>{"icon-left"===t.role||("icon-right"===t.role||"icon-absolute-right"===t.role)&&t.setAttribute("x",t.attribute.x+o)})),t.forEachChildren((t=>{("rect"===t.type||t.role&&t.role.startsWith("icon"))&&("middle"===x?t.setAttribute("y",_[0]+(A-_[0]-_[2]-t.AABBBounds.height())/2):"bottom"===x?t.setAttribute("y",_[0]+A-_[0]-_[2]-t.AABBBounds.height()):t.setAttribute("y",_[0]))})),B&&eA(t.mergeStartCol,t.mergeEndCol,t.mergeStartRow,t.mergeEndRow,r)}function tA(t,e){return"cell"===t.role&&Q(t.mergeStartCol)&&Q(t.mergeEndCol)&&Q(t.mergeStartRow)&&Q(t.mergeEndRow)?{width:e.getColsWidth(t.mergeStartCol,t.mergeEndCol),height:e.getRowsHeight(t.mergeStartRow,t.mergeEndRow),isMerge:!0}:{width:t.attribute.width,height:t.attribute.height,isMerge:!1}}function eA(t,e,i,o,n){for(let r=t;r<=e;r++)for(let t=i;t<=o;t++){const e=n.scenegraph.getCell(r,t);if(e){const i=e.getChildByName("image");i&&i.setAttributes({dx:-n.getColsWidth(e.mergeStartCol,r-1),dy:-n.getRowsHeight(e.mergeStartRow,t-1)});const o=e.getChildByName("play-icon");o&&o.setAttributes({dx:-n.getColsWidth(e.mergeStartCol,r-1),dy:-n.getRowsHeight(e.mergeStartRow,t-1)})}}}function iA(t,e,i,o,n,r,s,l){const a=r.resources.get(r.attribute.image).data,{col:h,row:d}=s;if(t&&!oA(r)&&JS(h,d,a.width,a.height,l.scenegraph,i,s),e||oA(r)){const{width:t,height:e,isMerge:h}=tA(s,l),{width:d,height:c}=IS(a.width,a.height,t-i[1]-i[3],e-i[0]-i[2]),u=OS(0,0,t,e,d,c,o,n,i);r.setAttributes({x:u.x,y:u.y,width:d,height:c}),h&&eA(s.mergeStartCol,s.mergeEndCol,s.mergeStartRow,s.mergeEndRow,l)}}function oA(t){const e=FS();return t.attribute.image===e.damage_pic.svg}function nA(t,e,i){t.then((()=>{i(),e.scenegraph.updateNextFrame()})).catch((t=>{}))}function rA(t,e){var i,o;const n=this;if(n.shadowRoot&&n.shadowRoot.childrenCount&&(Q(t.width)||Q(t.height))){const e=n.shadowRoot.findChildrenByName("shadow-rect")[0];e&&e.setAttributes({width:null!==(i=t.width)&&void 0!==i?i:e.attribute.width,height:null!==(o=t.height)&&void 0!==o?o:e.attribute.height})}}function sA(t,e,i,o,n,r,s,l,a,h,d,c,u,g,p,f,v,m){var b,y;let C,w=!1;if(Fw(e)){if("cell"!==o.scenegraph.highPerformanceGetCell(n,r).role)return C;e=o.getCellValue(n,r),w=!0}if("text"===t||"link"===t||m){if("link"===t){const s=e,l=o._getCellStyle(n,r);"link"===t&&("templateLink"in i&&i.templateLink||!("linkDetect"in i)||!i.linkDetect||hx.test(s))&&(f?(f.text.fill=DS("linkColor",l,n,r,o),f.group.cursor="pointer"):f={text:{fill:DS("linkColor",l,n,r,o)},group:{cursor:"pointer"}})}let y,x=!0;if(m)y=m.elementsGroup,x=m.renderDefault;else{let t,e;if("body"!==o.getCellLocation(n,r)?(t=null==i?void 0:i.headerCustomRender,e=null==i?void 0:i.headerCustomLayout):(t=(null==i?void 0:i.customRender)||o.customRender,e=null==i?void 0:i.customLayout),e||t){const i=eS(e,t,n,r,l,a,!1,o.isAutoRowHeight(r),c,v,o);y=i.elementsGroup,x=i.renderDefault}}C=Tx.getFunction("createTextCellGroup")(o,e,h,0,d,n,r,s,l,a,c,u,g,p,y,x,f,v,w);const _=o.internalProps.layoutMap.getAxisConfigInPivotChart(n,r);if(_){const t=new(Tx.getComponent("axis"))(_,C.attribute.width,C.attribute.height,null!==(b=_.__vtablePadding)&&void 0!==b?b:c,o);C.clear(),C.appendChild(t.component),t.overlap()}else o.internalProps.layoutMap.isEmpty(n,r)?(C.setAttributes({fill:!1,stroke:!1}),C.clear()):o.internalProps.layoutMap.isAxisCell(n,r)&&C.clear()}else if("image"===t)C=Tx.getFunction("createImageCellGroup")(h,0,d,n,r,l,a,i.keepAspectRatio,i.imageAutoSizing,c,u,g,p,o,f,v,w);else if("video"===t)C=Tx.getFunction("createVideoCellGroup")(h,0,d,n,r,l,a,i.keepAspectRatio,i.imageAutoSizing,c,u,g,p,o,f,v,w);else if("chart"===t){const t=o.internalProps.layoutMap.getChartInstance(n,r);C=Tx.getFunction("createChartCellGroup")(null,h,0,d,n,r,l,a,c,e,i.chartModule,o.internalProps.layoutMap.getChartSpec(n,r),t,null!==(y=o.internalProps.layoutMap.getChartDataId(n,r))&&void 0!==y?y:"data",o,f,o.internalProps.layoutMap.isShareChartSpec(n,r),w)}else if("progressbar"===t){const t=o._getCellStyle(n,r),p=o.getCellOriginValue(n,r);C=Tx.getFunction("createTextCellGroup")(o,e,h,0,d,n,r,s,l,a,c,u,g,!1,null,!0,f,v,w);const m=Tx.getFunction("createProgressBarCell")(i,t,s,e,p,n,r,c,o,v);C.firstChild?C.insertBefore(m,C.firstChild):C.appendChild(m)}else"sparkline"===t?C=Tx.getFunction("createSparkLineCellGroup")(null,h,0,d,n,r,l,a,c,o,f,w):"checkbox"===t?C=Tx.getFunction("createCheckboxCellGroup")(null,h,0,d,n,r,s,l,a,c,u,g,p,o,f,i,v,w):"radio"===t&&(C=Tx.getFunction("createRadioCellGroup")(null,h,0,d,n,r,s,l,a,c,u,g,o,f,i));return C.onBeforeAttributeUpdate=rA,C}function lA(t,e,i,o,n){var r,s,l,a,h,d,c,u,g,p,f,v,m,b,y,C;const w=i.scenegraph.highPerformanceGetCell(t,e,!0),x=i.getCellLocation(t,e);let _,S,A,B,R=i.getCellValue(t,e),M=!1;if(i.internalProps.customMergeCell){const o=i.getCustomMerge(t,e);if(o){const{range:t,text:n,style:r,customLayout:s,customRender:l}=o;S=t,_=S.start.col!==S.end.col||S.start.row!==S.end.row,R=n,A=r,(s||l)&&(B=eS(s,l,t.start.col,t.start.row,i.getColsWidth(t.start.col,t.end.col),i.getRowsHeight(t.start.row,t.end.row),!1,i.isAutoRowHeight(e),[0,0,0,0],S,i)),M=!0}}let T=t,k=e;S&&(T=S.start.col,k=S.start.row);const L="body"!==x?i.getHeaderDefine(T,k):i.getBodyColumnDefine(T,k);let P="body"!==x||(null==L?void 0:L.dragOrder)||!!(null==L?void 0:L.icon)||!!(null==L?void 0:L.tree);S||!i.internalProps.enableTreeNodeMerge&&"body"===x&&!(null==L?void 0:L.mergeCell)||(S=i.getCellRange(t,e),_=S.start.col!==S.end.col||S.start.row!==S.end.row);let E=!1;if(i.internalProps.enableTreeNodeMerge&&_){const t=i.getCellRawRecord(S.start.col,S.start.row),{vtableMergeName:o,vtableMerge:n}=null!=t?t:{};E=n,n&&(P=!0,i.options.groupTitleCustomLayout&&(B=eS(i.options.groupTitleCustomLayout,void 0,S.start.col,S.start.row,i.getColsWidth(S.start.col,S.end.col),i.getRowsHeight(S.start.row,S.end.row),!1,i.isAutoRowHeight(e),[0,0,0,0],S,i))),o&&(R=o)}const H=A||i._getCellStyle(S?S.start.col:t,S?S.start.row:e),F=null!==(r=H.autoWrapText)&&void 0!==r?r:i.internalProps.autoWrapText,z=G_(H,i,_?S.start.col:t,_?S.start.row:e,DS).theme;if(z.group.cornerRadius=j_(t,e,i),!o&&!_&&!((null==L?void 0:L.customLayout)||(null==L?void 0:L.customRender)||(null==L?void 0:L.headerCustomLayout)||(null==L?void 0:L.headerCustomRender))&&function(t,e,i,o,n,r){var s;const l=r.getBodyColumnType(t,e),a=r.isAutoRowHeight(e),h=r.getCellValue(t,e);return!(r.isHeader(t,e)||"cell"!==i.role||"text"!==l||o||a||n||"text"!==(null===(s=i.firstChild)||void 0===s?void 0:s.type)||Fw(h))}(t,e,w,F,P,i)){const o=i.getColWidth(t),n=i.getRowHeight(e);w.setAttributes({width:o,height:n,lineWidth:null!==(l=null===(s=null==z?void 0:z.group)||void 0===s?void 0:s.lineWidth)&&void 0!==l?l:void 0,fill:null!==(h=null===(a=null==z?void 0:z.group)||void 0===a?void 0:a.fill)&&void 0!==h?h:void 0,stroke:null!==(c=null===(d=null==z?void 0:z.group)||void 0===d?void 0:d.stroke)&&void 0!==c?c:void 0,strokeArrayWidth:null!==(g=null===(u=null==z?void 0:z.group)||void 0===u?void 0:u.strokeArrayWidth)&&void 0!==g?g:void 0,strokeArrayColor:null!==(f=null===(p=null==z?void 0:z.group)||void 0===p?void 0:p.strokeArrayColor)&&void 0!==f?f:void 0,cursor:null!==(m=null===(v=null==z?void 0:z.group)||void 0===v?void 0:v.cursor)&&void 0!==m?m:void 0,cornerRadius:null!==(y=null===(b=null==z?void 0:z.group)||void 0===b?void 0:b.cornerRadius)&&void 0!==y?y:0,y:i.scenegraph.getCellGroupY(e)}),w.forEachChildren((t=>{t.setAttributes({dx:0,dy:0})}));const r=w.getChildByName("text");if(r){const s=i.getCellValue(t,e),{text:l,moreThanMaxCharacters:a}=VS(s,i),h=jS(t,e,i),d=H.lineClamp,c=null!==(C=r_(DS("padding",H,t,e,i)))&&void 0!==C?C:[0,0,0,0],u=z.text.textAlign;let g=0;g="center"===u?c[3]+(o-(c[1]+c[3]))/2:"right"===u?c[3]+o-(c[1]+c[3]):c[3];const p={text:1!==l.length||F?l:l[0],moreThanMaxCharacters:a,maxLineWidth:o-(c[1]+c[3]+h),textBaseline:"top",autoWrapText:F,lineClamp:d,wordBreak:"break-word",heightLimit:n-Math.floor(c[0]+c[2]),pickable:!1,dx:"left"===u?h:0,x:g};if(r.setAttributes(z.text?Object.assign({},z.text,p):p),r.attribute.text){const t=z.text.textBaseline,e=n-(c[0]+c[2]);let i=0;i="middle"===t?c[0]+(e-r.AABBBounds.height())/2:"bottom"===t?c[0]+e-r.AABBBounds.height():c[0],r.setAttributes({y:i})}}return w}if(!o&&"empty"===w.role)return;const I=E||M?"text":i.isHeader(t,e)?i._getHeaderLayoutMap(t,e).headerType:i.getBodyColumnType(t,e),O=z._vtable.padding,D=z.text.textAlign,W=z.text.textBaseline;let N,G,j;if(S?(G=i.getColsWidth(S.start.col,S.end.col),j=i.getRowsHeight(S.start.row,S.end.row)):(G=i.getColWidth(t),j=i.getRowHeight(e)),Fw(R)?(w.removeAllChild(),nA(R,i,hA.bind(null,{type:I,value:R,define:L,table:i,col:t,row:e,cellWidth:G,cellHeight:j,oldCellGroup:w,padding:O,textAlign:D,textBaseline:W,mayHaveIcon:P,addNew:o,range:S,customResult:B,customStyle:A}))):N=aA(I,R,L,i,t,e,G,j,w,O,D,W,P,o,z,S,B),_){const{width:t}=N.attribute,{height:e}=N.attribute;N.contentWidth=t,N.contentHeight=e,n?function(t,e,i,o,n,r,s,l){const{col:a,row:h}=l;t.start.row!==t.end.row&&l.contentHeight!==i&&YS(l,i,0,s.isAutoRowHeight(h),o,0,r,s),t.start.col!==t.end.col&&l.contentWidth!==e&&XS(l,e,i,0,s.isAutoRowHeight(h),o,n,r,s.scenegraph),l.contentWidth=e,l.contentHeight=i;const d=s.getRowHeight(h);cA(l,s.getColWidth(a),d,t,s)}(S,G,j,O,D,W,i,N):dA(S,G,j,O,D,W,i)}return N}function aA(t,e,i,o,n,r,s,l,a,h,d,c,u,g,p,f,v){var m,b;if(Fw(e)&&(e=o.getCellValue(n,r)),!g&&(a.row!==r||a.col!==n))return null;if(!g&&a.parent&&o.reactCustomLayout){const t=a.getChildByName("custom-container");if(t){const{col:e,row:i}=t;o.reactCustomLayout.removeCustomCell(e,i)}}const y=sA(t,e,i,o,n,r,o.getColWidth(n),s,l,g?o.scenegraph.getColGroup(n):a.parent,g?0:o.scenegraph.getCellGroupY(r),h,d,c,u,p,f,v);return!g&&a.parent&&(a.parent.insertAfter(y,a),a.parent.removeChild(a),(null===(m=o.scenegraph)||void 0===m?void 0:m.proxy.cellCache.get(n))&&(null===(b=o.scenegraph)||void 0===b||b.proxy.cellCache.set(n,y))),y}function hA(t){const{type:e,value:i,define:o,table:n,col:r,row:s,cellWidth:l,cellHeight:a,oldCellGroup:h,padding:d,textAlign:c,textBaseline:u,mayHaveIcon:g,addNew:p,range:f,customResult:v,customStyle:m}=t,b=G_(m||n._getCellStyle(f?f.start.col:r,f?f.start.row:s),n,f?f.start.col:r,f?f.start.row:s,DS).theme;b.group.cornerRadius=j_(r,s,n),aA(e,i,o,n,r,s,l,a,h,d,c,u,g,p,b,f,v)}function dA(t,e,i,o,n,r,s){for(let l=t.start.col;l<=t.end.col;l++)for(let a=t.start.row;a<=t.end.row;a++){const h=s.scenegraph.highPerformanceGetCell(l,a,!0);if("cell"!==h.role)continue;t.start.row!==t.end.row&&h.contentHeight!==i&&YS(h,i,0,s.isAutoRowHeight(a),o,0,r,s),t.start.col!==t.end.col&&h.contentWidth!==e&&XS(h,e,i,0,s.isAutoRowHeight(a),o,n,r,s.scenegraph),h.contentWidth=e,h.contentHeight=i;const d=s.getRowHeight(a);cA(h,s.getColWidth(l),d,t,s)}}function cA(t,e,i,o,n){var r;const{col:s,row:l}=t,a=-n.getColsWidth(o.start.col,s-1),h=-n.getRowsHeight(o.start.row,l-1);t.forEachChildren((t=>{var e,i,o,n,r,s;"number"==typeof t._dx?(t.skipMergeUpdate=!0,t.setAttributes({dx:(null!==(e=t._dx)&&void 0!==e?e:0)+a}),t.skipMergeUpdate=!1):(t.skipMergeUpdate=!0,t._dx=null!==(i=t.attribute.dx)&&void 0!==i?i:0,t.setAttributes({dx:(null!==(o=t.attribute.dx)&&void 0!==o?o:0)+a}),t.skipMergeUpdate=!1),"number"==typeof t._dy?(t.skipMergeUpdate=!0,t.setAttributes({dy:(null!==(n=t._dy)&&void 0!==n?n:0)+h}),t.skipMergeUpdate=!1):(t._dy=null!==(r=t.attribute.dy)&&void 0!==r?r:0,t.skipMergeUpdate=!0,t.setAttributes({dy:(null!==(s=t.attribute.dy)&&void 0!==s?s:0)+h}),t.skipMergeUpdate=!1)}));const d=null!==(r=t.attribute.strokeArrayWidth)&&void 0!==r?r:t.attribute.lineWidth,c=rt(d),u=[0,0,0,0];s===o.start.col&&(u[3]=c?d[3]:d),l===o.start.row&&(u[0]=c?d[0]:d),s===o.end.col&&(u[1]=c?d[1]:d),l===o.end.row&&(u[2]=c?d[2]:d);const g=e!==t.attribute.width,p=i!==t.attribute.height;return t.skipMergeUpdate=!0,t.setAttributes({width:e,height:i,strokeArrayWidth:u}),t.skipMergeUpdate=!1,t.mergeStartCol=o.start.col,t.mergeStartRow=o.start.row,t.mergeEndCol=o.end.col,t.mergeEndRow=o.end.row,{widthChange:g,heightChange:p}}function uA(t,e,i,o){if(o.internalProps.customMergeCell){const n=o.getCustomMerge(t,e);if(n){const{range:r,text:s,style:l,customLayout:a,customRender:h}=n;if(a||h){const n=eS(a,h,r.start.col,r.start.row,o.getColsWidth(r.start.col,r.end.col),o.getRowsHeight(r.start.row,r.end.row),!1,o.isAutoRowHeight(e),[0,0,0,0],r,o).elementsGroup;i.childrenCount>0&&n?i.insertBefore(n,i.firstChild):n&&i.appendChild(n);const s=o.getRowHeight(e),l=o.getColWidth(t),{width:d}=i.attribute,{height:c}=i.attribute;return i.contentWidth=d,i.contentHeight=c,cA(i,l,s,r,o),r}}}}function gA(t){return!!("cell"===t.role&&at(t.mergeStartCol)&&at(t.mergeStartRow)&&at(t.mergeEndCol)&&at(t.mergeEndRow))}const pA=new Qy({}),fA=new tC({});function vA(t,e,i,o,n,r,s,l,a,h,d,c,u,g,p){const f=mw(tt(t)?t.text:t).split("\n")||[],v=p.getColsWidth(e,o),m=DS("size",n,e,i,p);let b=DS("outerRadius",n,e,i,p);const y=at(b)?2*b:m;let C=0;if(r){const t=DS("spaceBetweenTextAndIcon",n,e,i,p),o=v-(g[1]+g[3])-s-y-t;at(b)||(b=Math.round(m/2)),fA.setAttributes({text:{maxLineWidth:o,text:f,fontSize:l,fontStyle:a,fontWeight:h,fontFamily:d,lineHeight:c,wordBreak:"break-word",lineClamp:u},circle:{outerRadius:b},spaceBetweenTextAndIcon:t}),fA.render(),C=fA.AABBBounds.height()}else C=Math.max(m,f.length*c);return C}let mA="quick";const bA=new s(((t,e,i,o)=>{i(en)?o(en).to(wA).inSingletonScope():t(en).to(wA).inSingletonScope()}));new s(((t,e,i,o)=>{i(en)?o(en).to(on).inSingletonScope():t(en).to(on).inSingletonScope()}));const yA=new Map;function CA(t,e,i){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"normal";const n=`${t}-${e}-${i}-${o}`,r=yA.get(n);if(r)return r;const s=(l={fontSize:t,fontFamily:i,fontWeight:e,fontStyle:o},new He(Object.assign({defaultFontParams:{fontFamily:xo.fontFamily,fontSize:xo.fontSize},getTextBounds:Pa,specialCharSet:`{}()//&-/: .,@%'"~…=——${He.ALPHABET_CHAR_SET}${He.ALPHABET_CHAR_SET.toUpperCase()}0123456789`},{}),l));var l;return yA.set(n,s),s}class wA extends on{measureTextWidth(t,e){const{fontSize:i,fontFamily:o="Arial,sans-serif",fontWeight:n="normal",fontStyle:r="normal"}=e;return CA(i,n,o,r).measure(t,mA).width}measureText(t,e){const{fontSize:i,fontFamily:o="Arial,sans-serif",fontWeight:n="normal",fontStyle:r="normal"}=e;return CA(i,n,o,r).measure(t,mA)}}const xA=new class{measureText(t,e){const{fontSize:i,fontFamily:o="Arial,sans-serif",fontWeight:n="normal",fontStyle:r="normal"}=e;return CA(i,n,o,r).measure(t,mA)}measureTextWidth(t,e){const{fontSize:i,fontFamily:o="Arial,sans-serif",fontWeight:n="normal",fontStyle:r="normal"}=e;return CA(i,n,o,r).measure(t,mA).width}clipText(t,e,i){if(0===t.length)return{str:"",width:0};let o=this.measureTextWidth(t,e);return o<=i?{str:t,width:o}:(o=this.measureTextWidth(t[0],e),o>i?{str:"",width:0}:this._clipText(t,e,i,0,t.length-1))}_clipText(t,e,i,o,n){const r=Math.floor((o+n)/2),s=t.substring(0,r+1),l=this.measureTextWidth(s,e);let a;if(l>i){if(s.length<=1)return{str:"",width:0};const n=t.substring(0,r);return a=this.measureTextWidth(n,e),a<=i?{str:n,width:a}:this._clipText(t,e,i,o,r)}if(l<i){if(r>=t.length-1)return{str:t,width:this.measureTextWidth(t,e)};const o=t.substring(0,r+2);return a=this.measureTextWidth(o,e),a>=i?{str:s,width:l}:this._clipText(t,e,i,r,n)}return{str:s,width:l}}clipTextWithSuffix(t,e,i,o){if(""===o)return this.clipText(t,e,i);if(0===t.length)return{str:"",width:0};const n=this.measureTextWidth(t,e);if(n<=i)return{str:t,width:n};const r=this.measureTextWidth(o,e);if(r>i)return{str:"",width:0};i-=r;const s=this._clipText(t,e,i,0,t.length-1);return s.str+=o,s.width+=r,s}},_A=new Nh({ignoreBuf:!0});function SA(t){return _A.initAttributes(Object.assign(Object.assign({},t),{ignoreBuf:!0})),_A.AABBBounds}const AA=new vc({width:0,height:0,textConfig:[]});function BA(t,e,i){let o=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],n=arguments.length>4?arguments[4]:void 0;var r,s,l,a,h,d,c,u,g,p,f;"undefined"!=typeof window&&window.performance.now();const v=[],m=[];if(n)for(let o=e;o<=i;o++)v[o]=t.getRowHeight(o);const b=t.internalProps.layoutMap;t.isPivotTable()&&(b.enableUseGetBodyCache(),b.enableUseHeaderPathCache()),t.defaultHeaderRowHeight,t.defaultHeaderColWidth;const y="auto"===t.defaultHeaderRowHeight||rt(t.defaultHeaderRowHeight)&&t.defaultHeaderRowHeight.some((t=>"auto"===t)),C="autoHeight"===t.heightMode||"adaptive"===t.heightMode&&!1!==t.options.autoHeightInAdaptiveMode;if(C||y){e=null!=e?e:0,i=null!=i?i:t.rowCount-1,(0===e&&i===t.rowCount-1||o)&&t._clearRowRangeHeightsMap();for(let i=e;i<t.columnHeaderLevelCount;i++){let e=0,o=t.colCount-1;if((t.isPivotTable()&&!t.isPivotChart()||t.isPivotChart()&&!t.internalProps.layoutMap.indicatorsAsCol)&&TA(t,i)&&!Mx(t,t.rowHeaderLevelCount,i)&&(e=0,o=t.rowHeaderLevelCount),C||"auto"===t.getDefaultRowHeight(i)){const r=RA(i,e,o,t);m[i]=Math.round(r),"only-body"!==t.heightAdaptiveMode&&n||t._setRowHeight(i,r)}}for(let e=t.rowCount-t.bottomFrozenRowCount;e<=i;e++)if(C||"auto"===t.getDefaultRowHeight(e)){const i=RA(e,0,t.colCount-1,t);n?m[e]=Math.round(i):t._setRowHeight(e,i)}if(i<t.columnHeaderLevelCount||!C);else if(t.internalProps.transpose||t.isPivotTable()&&!t.internalProps.layoutMap.indicatorsAsCol||!function(t){var e,i,o;const{layoutMap:n}=t.internalProps,r=t.columnHeaderLevelCount;if((t.internalProps.autoWrapText||t.internalProps.enableLineBreak||t.isPivotChart())&&("autoHeight"===t.options.heightMode||"adaptive"===t.options.heightMode))return!1;for(let s=0;s<t.colCount;s++){const l=n.getBody(s,r);if("radio"===l.cellType)return!1;if("function"==typeof l.style||"function"==typeof l.icon||(null===(e=l.define)||void 0===e?void 0:e.customRender)||(null===(i=l.define)||void 0===i?void 0:i.customLayout)||"function"==typeof(null===(o=l.define)||void 0===o?void 0:o.icon))return!1;const a=t._getCellStyle(s,r);if("function"==typeof a.padding||"function"==typeof a.fontSize||"function"==typeof a.lineHeight||!0===a.autoWrapText)return!1}return!0}(t))if(t.internalProps.transpose||t.isPivotTable()&&!t.internalProps.layoutMap.indicatorsAsCol)for(let o=Math.max(e,t.columnHeaderLevelCount);o<=i;o++){let e;e=MA(t,o)?RA(o,0,t.rowHeaderLevelCount,t):RA(o,0,t.colCount-1,t),n?m[o]=Math.round(e):t._setRowHeight(o,e)}else for(let o=Math.max(e,t.columnHeaderLevelCount);o<=i;o++){const e=RA(o,0,t.colCount-1,t);n?m[o]=Math.round(e):t._setRowHeight(o,e)}else{!function(t,e,i,o,n){if(!o.internalProps.useOneRowHeightFillAll){for(let r=e;r<=i;r++)n?n[r]=t:o._setRowHeight(r,t);o.internalProps.useOneRowHeightFillAll=!0}}(RA(t.columnHeaderLevelCount,0,t.colCount-1,t),t.columnHeaderLevelCount,t.rowCount-1-t.bottomFrozenRowCount,t,n?m:void 0);for(let e=t.rowCount-t.bottomFrozenRowCount;e<=i;e++){const i=RA(e,0,t.colCount-1,t);n?m[e]=Math.round(i):t._setRowHeight(e,i)}}}else if(("adaptive"===t.heightMode||t.autoFillHeight)&&t.clearRowHeightCache(),n)for(let o=e;o<=i;o++)m[o]=t.getRowHeight(o);if((0===e&&i===t.rowCount-1||o)&&t._clearRowRangeHeightsMap(),"adaptive"===t.heightMode){t._clearRowRangeHeightsMap();let e=t.tableNoFrameHeight,i=0,o=t.rowCount;if("only-body"===t.heightAdaptiveMode){const n=t.getRowsHeight(0,t.columnHeaderLevelCount-1),r=t.isPivotChart()?t.getBottomFrozenRowsHeight():0;e=t.tableNoFrameHeight-n-r,i=t.columnHeaderLevelCount,o=t.isPivotChart()?t.rowCount-t.bottomFrozenRowCount:t.rowCount}let l=0;for(let e=i;e<o;e++)l+=n&&null!==(r=m[e])&&void 0!==r?r:t.getRowHeight(e);const a=e/l;for(let r=i;r<o;r++){let l;l=r===o-1?e-(n?m.reduce(((t,e,n)=>n>=i&&n<=o-2?t+e:t),0):t.getRowsHeight(i,o-2)):Math.round((n&&null!==(s=m[r])&&void 0!==s?s:t.getRowHeight(r))*a),n?m[r]=l:t._setRowHeight(r,l,!1)}}else if(t.autoFillHeight){t._clearRowRangeHeightsMap();const e=t.tableNoFrameHeight;let i=0,o=0;for(let e=0;e<t.rowCount;e++){const r=n&&null!==(l=m[e])&&void 0!==l?l:t.getRowHeight(e);(e<t.columnHeaderLevelCount||t.isPivotChart()&&e>=t.rowCount-t.bottomFrozenRowCount)&&(o+=r),i+=r}if(t.scenegraph._dealAutoFillHeightOriginRowsHeight=i,i<e&&i-o>0){const r=t.columnHeaderLevelCount,s=t.isPivotChart()?t.rowCount-t.bottomFrozenRowCount:t.rowCount,l=(e-o)/(i-o);for(let i=r;i<s;i++){let h;h=i===s-1?e-o-(n?m.reduce(((t,e,i)=>i>=r&&i<=s-2?t+e:t),0):t.getRowsHeight(r,s-2)):Math.round((n&&null!==(a=m[i])&&void 0!==a?a:t.getRowHeight(i))*l),n?m[i]=h:t._setRowHeight(i,h,!1)}}}if(n){for(let o=e;o<=i;o++){const e=null!==(h=m[o])&&void 0!==h?h:t.getRowHeight(o);Q(e)&&t._setRowHeight(o,e)}if("adaptive"===t.heightMode||t.autoFillHeight&&t.getAllRowsHeight()<=t.tableNoFrameHeight){for(let e=0;e<=t.columnHeaderLevelCount-1;e++){const i=t.getRowHeight(e);i!==(null!==(d=v[e])&&void 0!==d?d:t.getRowHeight(e))&&t.scenegraph.updateRowHeight(e,i-(null!==(c=v[e])&&void 0!==c?c:t.getRowHeight(e)),!0)}for(let e=t.rowCount-t.bottomFrozenRowCount;e<=t.rowCount-1;e++){const i=t.getRowHeight(e);i!==(null!==(u=v[e])&&void 0!==u?u:t.getRowHeight(e))&&t.scenegraph.updateRowHeight(e,i-(null!==(g=v[e])&&void 0!==g?g:t.getRowHeight(e)),!0)}}for(let e=t.scenegraph.proxy.rowStart;e<=t.scenegraph.proxy.rowEnd;e++){const i=t.getRowHeight(e);i!==(null!==(p=v[e])&&void 0!==p?p:t.getRowHeight(e))&&t.scenegraph.updateRowHeight(e,i-(null!==(f=v[e])&&void 0!==f?f:t.getRowHeight(e)),!0)}}t.isPivotTable()&&(b.disableUseGetBodyCache(),b.disableUseHeaderPathCache())}function RA(t,e,i,o){var n;let r;if(o.isPivotChart()&&t>=o.columnHeaderLevelCount&&t<o.rowCount-o.bottomFrozenRowCount)if(o.internalProps.layoutMap.indicatorsAsCol){const e=o.internalProps.layoutMap.getOptimunHeightForChart(t);if(e>0)return e}else{const e=o.getDefaultRowHeight(t);if(at(e))return e}for(let s=e;s<=i;s++){const e=kA(s,t,o);if(e&&(r=Q(r)?Math.max(e.height,r):e.height,!e.renderDefault))continue;if(o.isPivotChart()){const e=o.internalProps.layoutMap.getAxisConfigInPivotChart(s,t);if(e){const t=Tx.getFunction("computeAxisComponentHeight")(e,o);if("number"==typeof t){r=Q(r)?Math.max(t,r):t;continue}}}if(o.isPivotChart()&&(o.isLeftFrozenColumn(s)&&o.isBottomFrozenRow(t)||o.isRightFrozenColumn(s)&&o.isBottomFrozenRow(t)))continue;const i=LA(s,t,o.isHeader(s,t)?null===(n=o._getHeaderLayoutMap(s,t))||void 0===n?void 0:n.headerType:o.getBodyColumnType(s,t),o);r=Q(r)?Math.max(i,r):i}if(Q(r))return r;const s=o.getDefaultRowHeight(t);return at(s)?s:o.defaultRowHeight}function MA(t,e){var i,o,n;const{layoutMap:r}=t.internalProps;if((t.internalProps.autoWrapText||t.internalProps.enableLineBreak)&&("autoHeight"===t.options.heightMode||"adaptive"===t.options.heightMode))return!1;const s=r.getBody(t.rowHeaderLevelCount,e);if("function"==typeof s.style||"function"==typeof s.icon||(null===(i=s.define)||void 0===i?void 0:i.customRender)||(null===(o=s.define)||void 0===o?void 0:o.customLayout)||"function"==typeof(null===(n=s.define)||void 0===n?void 0:n.icon))return!1;const l=t._getCellStyle(t.rowHeaderLevelCount,e);return"function"!=typeof l.padding&&"function"!=typeof l.fontSize&&"function"!=typeof l.lineHeight&&!0!==l.autoWrapText}function TA(t,e){var i,o,n;const{layoutMap:r}=t.internalProps;if(t.internalProps.autoWrapText&&("autoHeight"===t.options.heightMode||"adaptive"===t.options.heightMode))return!1;const s=r.getHeader(t.rowHeaderLevelCount,e);if("function"==typeof s.style||"function"==typeof s.icons||(null===(i=s.define)||void 0===i?void 0:i.headerCustomRender)||(null===(o=s.define)||void 0===o?void 0:o.headerCustomLayout)||"function"==typeof(null===(n=s.define)||void 0===n?void 0:n.icon))return!1;const l=t._getCellStyle(t.rowHeaderLevelCount,e);return"function"!=typeof l.padding&&"function"!=typeof l.fontSize&&"function"!=typeof l.lineHeight&&!0!==l.autoWrapText}function kA(t,e,i){var o,n,r,s,l;const a=i.getCustomRender(t,e);let h=i.getCustomLayout(t,e);if(a||h){let d=1,c=0,u=!1,g=!1;if(i.isHeader(t,e)||(null===(o=i.getBodyColumnDefine(t,e))||void 0===o?void 0:o.mergeCell)||i.hasCustomMerge()){const o=i.getCellRange(t,e);d=o.end.row-o.start.row+1}const p={col:t,row:e,dataValue:i.getCellOriginValue(t,e),value:i.getCellValue(t,e)||"",rect:PA(t,e,i),table:i};if("react-custom-layout"===h&&(h=(null===(n=i.reactCustomLayout)||void 0===n?void 0:n.getCustomLayoutFunc(t,e))||$_),Z(h)){const e=h(p);e.rootContainer?(e.rootContainer=nS(e.rootContainer),oS(e.rootContainer,i.getColWidth(t),0),e.rootContainer.setStage(i.scenegraph.stage),c=null!==(r=e.rootContainer.AABBBounds.height())&&void 0!==r?r:0,u=e.renderDefault,g=e.enableCellPadding):(c=0,u=e.renderDefault,g=e.enableCellPadding)}else if("function"==typeof a){const t=a(p);c=null!==(s=null==t?void 0:t.expectedHeight)&&void 0!==s?s:0,u=null==t?void 0:t.renderDefault}else c=null!==(l=null==a?void 0:a.expectedHeight)&&void 0!==l?l:0,u=null==a?void 0:a.renderDefault;if(g){const o=r_(DS("padding",i._getCellStyle(t,e),t,e,i));c+=o[0]+o[2]}return{height:c/d,renderDefault:u}}}function LA(t,e,i,o){var n,r,s;let l=0;const a=o.getCellValue(t,e),h=o._getCellStyle(t,e);let d=0,c=0;const u=[];let g=0;const p=[];let f=0,v=!1;if("body"!==o.getCellLocation(t,e))v=!0;else{const i=o.getBodyColumnDefine(t,e);v=!!(null==i?void 0:i.icon)||!!(null==i?void 0:i.tree)||(null==i?void 0:i.dragOrder)}if(v){const i=o.getCellIcons(t,e);null==i||i.forEach((t=>{var e,i,o,n,r,s,l,a,h,v;t.positionType!==jC.absoluteRight&&t.positionType!==jC.inlineFront&&t.positionType!==jC.inlineEnd?(c+=(null!==(e=t.width)&&void 0!==e?e:0)+(null!==(i=t.marginLeft)&&void 0!==i?i:0)+(null!==(o=t.marginRight)&&void 0!==o?o:0),d=Math.max(d,null!==(n=t.height)&&void 0!==n?n:0)):t.positionType===jC.inlineFront?(u.push(t),g=Math.max(g,(null!==(r=t.height)&&void 0!==r?r:0)+(null!==(s=t.marginLeft)&&void 0!==s?s:0)+(null!==(l=t.marginRight)&&void 0!==l?l:0))):t.positionType===jC.inlineEnd&&(p.push(t),f=Math.max(f,(null!==(a=t.height)&&void 0!==a?a:0)+(null!==(h=t.marginLeft)&&void 0!==h?h:0)+(null!==(v=t.marginRight)&&void 0!==v?v:0)))}))}let m=1,b=t;if(o.isHeader(t,e)||(null===(n=o.getBodyColumnDefine(t,e))||void 0===n?void 0:n.mergeCell)||o.hasCustomMerge()){const i=o.getCellRange(t,e);m=i.end.row-i.start.row+1,t=i.start.col,b=i.end.col}const y=r_(DS("padding",h,t,e,o)),C=DS("fontSize",h,t,e,o),w=DS("fontStyle",h,t,e,o),x=DS("fontWeight",h,t,e,o),_=null!==(r=DS("lineHeight",h,t,e,o))&&void 0!==r?r:C,S=DS("fontFamily",h,t,e,o),A=DS("autoWrapText",h,t,e,o),B=DS("lineClamp",h,t,e,o);let R;if("text"!==i&&"link"!==i&&"progressbar"!==i&&"checkbox"!==i&&"radio"!==i)l=_;else if("checkbox"===i)l=function(t,e,i,o,n,r,s,l,a,h,d,c,u,g,p){const f=mw(tt(t)?t.text:t).split("\n")||[],v=p.getColsWidth(e,o),m=DS("size",n,e,i,p);let b=0;if(r){const t=DS("spaceBetweenTextAndIcon",n,e,i,p),o=v-(g[1]+g[3])-s-m-t;pA.setAttributes({text:{maxLineWidth:o,text:f,fontSize:l,fontStyle:a,fontWeight:h,fontFamily:d,lineHeight:c,wordBreak:"break-word",lineClamp:u},icon:{width:Math.floor(m/1.4),height:Math.floor(m/1.4)},box:{width:m,height:m},spaceBetweenTextAndIcon:t}),pA.render(),b=pA.AABBBounds.height()}else b=Math.max(m,f.length*c);return b}(a,t,e,b,h,A,c,C,w,x,S,_,B,y,o);else if("radio"===i)l=function(t,e,i,o,n,r,s,l,a,h,d,c,u,g,p){var f;if(rt(t)){let v=0;const m=p.getBodyColumnDefine(e,i),b=DS("spaceBetweenRadio",n,e,i,p),y=null!==(f=null==m?void 0:m.radioDirectionInCell)&&void 0!==f?f:"vertical";return"vertical"===y?t.forEach(((f,m)=>{const y=vA(f,e,i,o,n,r,s,l,a,h,d,c,u,g,p);v+=y,m!==t.length-1&&(v+=b)})):"horizontal"===y&&t.forEach((t=>{const f=vA(t,e,i,o,n,r,s,l,a,h,d,c,u,g,p);v=Math.max(f,v)})),v}return vA(t,e,i,o,n,r,s,l,a,h,d,c,u,g,p)}(a,t,e,b,h,A,c,C,w,x,S,_,B,y,o);else{R=a;const i=VS(R,o).text,n=o.getColsWidth(t,b);if(u.length||p.length)if(A){const t=Object.assign({text:null==a?void 0:a.toString(),fontFamily:S,fontSize:C,fontStyle:w,fontWeight:x,lineHeight:_});t.textBaseline="middle";const e=[...u.map((t=>$S(t))),t,...p.map((t=>$S(t)))];AA.setAttributes({width:n-(y[1]+y[3])-c,height:0,textConfig:e}),l=AA.AABBBounds.height()}else l=0,i.forEach(((t,e)=>{var n;(null===(n=o.options.customConfig)||void 0===n?void 0:n.multilinesForXTable)&&0!==e||(0===e&&u.length?l+=Math.max(_,g):e===i.length-1&&p.length?l+=Math.max(_,f):l+=_)}));else if(A){const r=jS(t,e,o),s=SA({maxLineWidth:n-(y[1]+y[3])-c-r,text:i,fontSize:C,fontStyle:w,fontWeight:x,fontFamily:S,lineHeight:_,wordBreak:"break-word",whiteSpace:1!==i.length||A?"normal":"no-wrap",lineClamp:B});l=s.height()||("number"==typeof _?_:C)}else l=(null===(s=o.options.customConfig)||void 0===s?void 0:s.multilinesForXTable)?_:i.length*_}return(Math.max(l,d)+y[0]+y[2])/m}function PA(t,e,i){return{left:0,top:0,right:i.getColWidth(t),bottom:i.getRowHeight(e),width:i.getColWidth(t),height:0}}function EA(t,e){if(!e||!e.proxy)return{colStart:0,colEnd:0,rowStart:0,rowEnd:0};const{mergeStartCol:i,mergeEndCol:o,mergeStartRow:n,mergeEndRow:r,col:s,row:l}=t,{colStart:a,colEnd:h,rowStart:d,rowEnd:c,bodyLeftCol:u,bodyRightCol:g,bodyTopRow:p,bodyBottomRow:f}=e.proxy;let v=i,m=o,b=n,y=r;return s>=u&&s<=g&&(v=Math.max(t.mergeStartCol,a),m=Math.min(t.mergeEndCol,h)),l>=p&&l<=f&&(b=Math.max(t.mergeStartRow,d),y=Math.min(t.mergeEndRow,c)),{colStart:v,colEnd:m,rowStart:b,rowEnd:y}}function HA(t,e,i,o){o||t.table._setRowHeight(e,t.table.getRowHeight(e)+i,!0);for(let o=0;o<t.table.colCount;o++){const n=t.getCell(o,e);if("empty"===n.role)continue;const r=Mx(t.table,o,e);r&&r.start.col!==o||(FA(t,n,o,e,n.attribute.height+i,i,t.table.isHeader(o,e)),t.updateCellContentWhileResize(o,e))}let n=0,r=0;e<t.table.frozenRowCount?(n=e+1,r=t.table.frozenRowCount-1):e>=t.table.rowCount-t.table.bottomFrozenRowCount?(n=e+1,r=t.table.rowCount-1):(n=e+1,r=Math.min(t.proxy.rowEnd,t.table.rowCount-t.table.bottomFrozenRowCount-1));for(let e=0;e<t.table.colCount;e++)for(let o=n;o<=r;o++){const n=t.highPerformanceGetCell(e,o);"cell"===n.role&&n.setAttribute("y",n.attribute.y+i)}}function FA(t,e,i,o,n,r,s){e&&function(t,e,i,o,n,r,s){var l,a,h;if(e.attribute.height===n&&!e.needUpdateHeight)return;e.needUpdateHeight=!1,e.setAttribute("height",n);const d=null===(l=t.table.getCellRawRecord(i,o))||void 0===l?void 0:l.vtableMerge,c=!!t.table.getCustomMerge(i,o),u=d||c?"text":t.table.isHeader(i,o)?t.table._getHeaderLayoutMap(i,o).headerType:t.table.getBodyColumnType(i,o);if("progressbar"===u){const s=t.table.getBodyColumnDefine(i,o),l=t.table._getCellStyle(i,o),a=t.table.getCellValue(i,o),h=t.table.getCellOriginValue(i,o),d=r_(DS("padding",l,i,o,t.table));let c;(null==s?void 0:s.mergeCell)&&(c=t.table.getCellRange(i,o));const u=Tx.getFunction("createProgressBarCell")(s,l,e.attribute.width,a,h,i,o,d,t.table,c),g=e.getChildByName("progress-bar");e.insertBefore(u,g),e.removeChild(g),g.removeAllChild(),g.release(),zA(e,n,r,t.table.isAutoRowHeight(o),!0,t.table)}else if("sparkline"===u){e.removeAllChild();const n=t.table._getCellStyle(i,o),r=r_(DS("padding",n,i,o,t.table));Tx.getFunction("createSparkLineCellGroup")(e,e.parent,e.attribute.x,e.attribute.y,i,o,e.attribute.width,e.attribute.height,r,t.table,G_(n,t.table,i,o,DS).theme,!1)}else if("image"===u||"video"===u)QS(e,i,o,0,0,t.table);else if("axis"===(null===(a=e.firstChild)||void 0===a?void 0:a.name))null===(h=e.firstChild)||void 0===h||h.originAxis.resize(e.attribute.width,e.attribute.height);else{let s=!0;const l=e.getChildByName(Q_)||e.getChildByName(tS);if(l){let n;e.removeChild(l);const r=uA(i,o,e,t.table);if(r)for(let e=r.start.row;e<=r.end.row;e++){if(e===o)continue;const n=t.getCell(i,e),r=n.getChildByName(Q_)||n.getChildByName(tS);r.removeAllChild(),n.removeChild(r),uA(i,e,n,t.table)}else{let r,l;const a=t.table.getCellLocation(i,o),{vtableMerge:h}=t.table.getCellRawRecord(i,o)||{};if(h&&t.table.options.groupTitleCustomLayout)l=t.table.options.groupTitleCustomLayout;else if("body"!==a){const e=t.table.getHeaderDefine(i,o);r=null==e?void 0:e.headerCustomRender,l=null==e?void 0:e.headerCustomLayout}else{const e=t.table.getBodyColumnDefine(i,o);r=(null==e?void 0:e.customRender)||t.table.customRender,l=null==e?void 0:e.customLayout}if((r||l)&&gA(e))for(let i=e.mergeStartCol;i<=e.mergeEndCol;i++)for(let n=e.mergeStartRow;n<=e.mergeEndRow;n++)n!==o&&t.updateCellContent(i,n);if(l||r){const a=r_(DS("padding",t.table._getCellStyle(i,o),i,o,t.table));let h=e.attribute.width,d=e.attribute.height;gA(e)&&(h=t.table.getColsWidth(e.mergeStartCol,e.mergeEndCol),d=t.table.getRowsHeight(e.mergeStartRow,e.mergeEndRow));const c=eS(l,r,i,o,h,d,!1,t.table.isAutoRowHeight(o),a,gA(e)?{start:{col:e.mergeStartCol,row:e.mergeStartRow},end:{col:e.mergeEndCol,row:e.mergeEndRow}}:void 0,t.table);n=c.elementsGroup,s=c.renderDefault}e.childrenCount>0&&n?e.insertBefore(n,e.firstChild):n&&e.appendChild(n)}}zA(e,n,r,t.table.isAutoRowHeight(o),s,t.table)}}(t,e,i,o,n,r)}function zA(t,e,i,o,n,r){if(gA(t)){e=0;for(let i=t.mergeStartRow;i<=t.mergeEndRow;i++)e+=r.getRowHeight(i);const{colStart:i,colEnd:s,rowStart:l,rowEnd:a}=EA(t,r.scenegraph);for(let h=i;h<=s;h++)for(let s=l;s<=a;s++){const a=r.scenegraph.getCell(h,s);if(a.forEachChildren((t=>{t.setAttributes({dx:0,dy:0})})),n){const t=r._getCellStyle(i,l);YS(a,e,0,o,r_(t.padding),t.textAlign,t.textBaseline,r)}const d=r.getRowHeight(s),c=r.getColWidth(h);a.contentHeight=e;const{widthChange:u}=cA(a,c,d,{start:{col:t.mergeStartCol,row:t.mergeStartRow},end:{col:t.mergeEndCol,row:t.mergeEndRow}},r);u&&(a.needUpdateWidth=!0)}}else{const i=r._getCellStyle(t.col,t.row);YS(t,e,0,o,r_(i.padding),i.textAlign,i.textBaseline,r)}}function IA(t,e,i,o){var n,r,s,l,a,h,d;let c=!1;const u=null!==(n=null==t?void 0:t.attribute.width)&&void 0!==n?n:0;if(null==t||t.setAttribute("width",u+e),null==t||t.forEachChildren(((t,n)=>{if(function(t,e,i,o,n,r,s,l,a){var h,d,c,u,g;if(e.attribute.width===r&&!e.needUpdateWidth)return!1;e.needUpdateWidth=!1,e.setAttribute("width",r);const p=e;if(!p)return!1;const f=t.table.isAutoRowHeight(o),v=null===(h=t.table.getCellRawRecord(i,o))||void 0===h?void 0:h.vtableMerge,m=!!t.table.getCustomMerge(i,o),b=v||m?"text":t.table.isHeader(i,o)?t.table._getHeaderLayoutMap(i,o).headerType:t.table.getBodyColumnType(i,o);let y=!1;if("progressbar"===b){const e=t.table.getBodyColumnDefine(i,o),n=t.table._getCellStyle(i,o),l=t.table.getCellValue(i,o),a=t.table.getCellOriginValue(i,o),h=r_(DS("padding",n,i,o,t.table));let d;(null==e?void 0:e.mergeCell)&&(d=t.table.getCellRange(i,o));const c=Tx.getFunction("createProgressBarCell")(e,n,p.attribute.width,l,a,i,o,h,t.table,d),u=p.getChildByName("progress-bar");p.insertBefore(c,u),p.removeChild(u),u.removeAllChild(),u.release();const g=OA(p,r,s,f,!0,t.table);y=y||g}else if("sparkline"===b){p.removeAllChild();const e=t.table._getCellStyle(i,o),n=r_(DS("padding",e,i,o,t.table));Tx.getFunction("createSparkLineCellGroup")(p,p.parent,p.attribute.x,p.attribute.y,i,o,p.attribute.width,p.attribute.height,n,t.table,G_(e,t.table,i,o,DS).theme,!1)}else if("image"===b||"video"===b)QS(p,i,o,s,0,t.table);else if("axis"===(null===(d=p.firstChild)||void 0===d?void 0:d.name)){const e=t.table.internalProps.layoutMap.getAxisConfigInPivotChart(i,o),n=r_(DS("padding",t.table._getCellStyle(i,o),i,o,t.table));if(e){const i=new(Tx.getComponent("axis"))(e,p.attribute.width,p.attribute.height,null!==(c=e.__vtablePadding)&&void 0!==c?c:n,t.table);p.clear(),p.appendChild(i.component),i.overlap()}}else if("axis"===(null===(u=e.firstChild)||void 0===u?void 0:u.name))null===(g=e.firstChild)||void 0===g||g.originAxis.resize(e.attribute.width,e.attribute.height);else{let n=!0;const l=e.getChildByName(Q_)||e.getChildByName(tS);if(l){let r;e.removeChild(l);const s=uA(i,o,e,t.table);if(s)for(let e=s.start.col;e<=s.end.col;e++){if(e===i)continue;const n=t.getCell(e,o),r=n.getChildByName(Q_)||n.getChildByName(tS);r.removeAllChild(),n.removeChild(r),uA(e,o,n,t.table)}else{let s,l;const a=t.table.getCellLocation(i,o),{vtableMerge:h}=t.table.getCellRawRecord(i,o)||{};if(h&&t.table.options.groupTitleCustomLayout)l=t.table.options.groupTitleCustomLayout;else if("body"!==a){const e=t.table.getHeaderDefine(i,o);s=null==e?void 0:e.headerCustomRender,l=null==e?void 0:e.headerCustomLayout}else{const e=t.table.getBodyColumnDefine(i,o);s=(null==e?void 0:e.customRender)||t.table.customRender,l=null==e?void 0:e.customLayout}if((s||l)&&gA(p))for(let e=p.mergeStartCol;e<=p.mergeEndCol;e++)if(e!==i)for(let i=p.mergeStartRow;i<=p.mergeEndRow;i++)t.updateCellContent(e,i);if(l||s){const e=r_(DS("padding",t.table._getCellStyle(i,o),i,o,t.table));let a=p.attribute.width,h=p.attribute.height;gA(p)&&(a=t.table.getColsWidth(p.mergeStartCol,p.mergeEndCol),h=t.table.getRowsHeight(p.mergeStartRow,p.mergeEndRow));const d=eS(l,s,i,o,a,h,!1,t.table.isAutoRowHeight(o),e,gA(p)?{start:{col:p.mergeStartCol,row:p.mergeStartRow},end:{col:p.mergeEndCol,row:p.mergeEndRow}}:void 0,t.table);r=d.elementsGroup,n=d.renderDefault,y=!0}e.childrenCount>0&&r?e.insertBefore(r,e.firstChild):r&&e.appendChild(r)}}const a=OA(p,r,s,f,n,t.table);y=y||a}a||(a=t.table._getCellStyle(i,o).autoWrapText);return!(!f||!a)&&y}(o,t,t.col,t.row,0,u+e,e,"row-body"!==i||(t.col,o.table.rowHeaderLevelCount),o.table.internalProps.autoWrapText)){const e=Mx(o.table,t.col,t.row);if(e&&e.end.row-e.start.row)for(let t=e.start.row;t<=e.end.row;t++)DA(o,t);else DA(o,t.row);c=!0}})),c){let t,e,n,c=0;for(let u=0;u<o.table.colCount;u++){if("col-corner"===i?(n=0,t=o.getColGroup(u,!0),e=null!==(r=o.colHeaderGroup.attribute.height)&&void 0!==r?r:0):"row-body"===i?(n=o.table.frozenRowCount,t=o.getColGroup(u,!1),e=null!==(s=o.bodyGroup.attribute.height)&&void 0!==s?s:0):"bottom"===i?(n=o.table.rowCount-o.table.bottomFrozenRowCount,t=o.getColGroupInBottom(u),e=null!==(l=o.bottomFrozenGroup.attribute.height)&&void 0!==l?l:0):"left-bottom"===i?(n=o.table.rowCount-o.table.bottomFrozenRowCount,t=o.getColGroupInLeftBottomCorner(u),e=null!==(a=o.leftBottomCornerGroup.attribute.height)&&void 0!==a?a:0):"right-top"===i?(n=0,t=o.getColGroupInRightTopCorner(u),e=null!==(h=o.rightTopCornerGroup.attribute.height)&&void 0!==h?h:0):"right-bottom"===i&&(n=o.table.rowCount-o.table.bottomFrozenRowCount,t=o.getColGroupInRightBottomCorner(u),e=null!==(d=o.rightBottomCornerGroup.attribute.height)&&void 0!==d?d:0),!t)continue;let g=0;t.forEachChildren((t=>{var e;t.setAttribute("y",g),g+=null!==(e=o.table.getRowHeight(t.row))&&void 0!==e?e:0})),c=g}o.updateContainerHeight(n,c-e);for(let t=0;t<o.table.frozenColCount;t++){const e=o.getColGroupInLeftBottomCorner(t);let i=0;null==e||e.forEachChildren((t=>{t.setAttribute("y",i),i+=o.table.getRowHeight(t.row)}))}for(let t=o.table.colCount-o.table.rightFrozenColCount;t<o.table.colCount;t++){const e=o.getColGroupInRightBottomCorner(t);let i=0;null==e||e.forEachChildren((t=>{t.setAttribute("y",i),i+=o.table.getRowHeight(t.row)}))}for(let t=o.table.frozenColCount;t<o.table.colCount-o.table.rightFrozenColCount;t++){const e=o.getColGroupInBottom(t);let i=0;null==e||e.forEachChildren((t=>{t.setAttribute("y",i),i+=o.table.getRowHeight(t.row)}))}}}function OA(t,e,i,o,n,r){if(gA(t)){e=0;let s=!1;for(let i=t.mergeStartCol;i<=t.mergeEndCol;i++)e+=r.getColWidth(i);let l=0;for(let e=t.mergeStartRow;e<=t.mergeEndRow;e++)l+=r.getRowHeight(e);const{colStart:a,colEnd:h,rowStart:d,rowEnd:c}=EA(t,r.scenegraph);for(let u=a;u<=h;u++)for(let h=d;h<=c;h++){if(u===t.col&&h!==t.row)continue;const c=r.scenegraph.getCell(u,h);c.forEachChildren((t=>{t.setAttributes({dx:0,dy:0})}));let g=!1;if(n){const t=r._getCellStyle(a,d);g=XS(c,e,l,i,o,r_(t.padding),t.textAlign,t.textBaseline,r.scenegraph);const n=jS(c.col,c.row,r);if(n){const t=c.getChildByName("text"),e=c.getChildByName("expand")||c.getChildByName("collapse");"icon-left"!==(null==e?void 0:e.role)&&t&&t.setAttribute("dx",n)}}const p=r.getRowHeight(h),f=r.getColWidth(u);c.contentWidth=e;const{heightChange:v}=cA(c,f,p,{start:{col:t.mergeStartCol,row:t.mergeStartRow},end:{col:t.mergeEndCol,row:t.mergeEndRow}},r);v&&(c.needUpdateHeight=!0),s=s||g}return s}const s=r._getCellStyle(t.col,t.row),l=r_(s.padding),a=s.textAlign,h=s.textBaseline;return XS(t,e,r.getRowHeight(t.row),i,o,l,a,h,r.scenegraph)}function DA(t,e){const i=Math.round(RA(e,0,t.table.colCount-1,t.table));t.table._setRowHeight(e,i,!0);for(let o=0;o<t.table.colCount;o++){const n=i,r=t.highPerformanceGetCell(o,e);if("empty"===r.role)return;FA(t,r,o,e,n,n-r.attribute.height,t.table.isHeader(o,e))}}var WA;!function(t){t.dropDown="dropDown",t.contextmenu="contextmenu",t.custom="custom"}(WA||(WA={}));const NA=12,GA="Arial,sans-serif",jA="#000",VA="#2E68CF",UA="#EEE",$A=30,XA="#FFF",YA=4,KA=.5,qA="#CCC",ZA=6,JA=9,QA=200;const tB=FS();class eB{constructor(){const t=tB.drillDown;this.icon=new U_({x:-1e3,y:-1e3,image:t.svg,width:t.width,height:t.height,dx:-t.width/2,dy:-t.height/2,visible:!1,funcType:t.funcType,cursor:t.cursor}),this.icon.role="icon-drill"}appand(t){t.appendChild(this.icon)}update(t,e,i,o,n,r){if(!t||o&&n)return this.icon.setAttributes({x:-1e3,y:-1e3,visible:!1}),void r.updateNextFrame();const s=tB.drillDown,l=tB.drillUp;this.icon.setAttributes({x:e,y:i,image:o?s.svg:l.svg,visible:!0}),this.icon.loadImage(this.icon.attribute.image),r.updateNextFrame()}}class iB{constructor(t){const e=t.theme.dragHeaderSplitLine.lineWidth,i=t.theme.dragHeaderSplitLine.lineColor,o=t.theme.dragHeaderSplitLine.shadowBlockColor;this.columnMoverLabel=tc({visible:!1,pickable:!1,x:0,y:0,symbolType:"triangle",fill:i}),this.columnMoverLine=oc({visible:!1,pickable:!1,stroke:i,lineWidth:e,x:0,y:0,points:[{x:0,y:0},{x:0,y:0}]}),this.columnMoverBack=sc({visible:!1,pickable:!1,fill:o,x:0,y:0,width:0,height:0}),this.table=t}appand(t){t.appendChild(this.columnMoverLabel),t.appendChild(this.columnMoverLine),t.appendChild(this.columnMoverBack)}show(t,e,i){const o=this.table.getCellLocation(t,e),n=Mx(this.table,t,e);n&&(t=n.start.col,e=n.start.row);let r=0,s=0,l=0,a=0,h=0,d=0,c=0,u=0,g=Math.PI;const p=[];"columnHeader"===o?(r=this.table.getColsWidth(0,t-1)-this.table.stateManager.scroll.horizontalBarPos,s=this.table.getRowsHeight(0,this.table.frozenRowCount-1),a=this.table.tableNoFrameHeight,l=n?this.table.getColsWidth(n.start.col,n.end.col):this.table.getColWidth(t),h=r-i,c=r+l,u=2,p.push({x:0,y:0}),p.push({x:0,y:this.table.tableNoFrameHeight})):("rowHeader"===o||this.table.internalProps.layoutMap.isSeriesNumberInBody(t,e))&&(s=this.table.getRowsHeight(0,e-1)-this.table.stateManager.scroll.verticalBarPos,r=this.table.getColsWidth(0,this.table.frozenColCount-1),l=this.table.tableNoFrameWidth,a=n?this.table.getRowsHeight(n.start.row,n.end.row):this.table.getRowHeight(e),d=s-i,c=2,u=s+a,g=Math.PI/2,p.push({x:0,y:0}),p.push({x:this.table.tableNoFrameWidth,y:0})),this.columnMoverBack.setAttributes({visible:!0,x:r-h,y:s-d,width:l,height:a,dx:h,dy:d}),this.columnMoverLine.setAttributes({x:c,y:u,visible:!0,points:p}),this.columnMoverLabel.setAttributes({visible:!0,x:c,y:u,angle:g})}hide(){this.columnMoverLabel.setAttribute("visible",!1),this.columnMoverLine.setAttribute("visible",!1),this.columnMoverBack.setAttribute("visible",!1)}update(t,e,i,o){"number"==typeof t&&"number"==typeof e?(this.columnMoverLabel.setAttribute("x",e),this.columnMoverLine.setAttribute("x",e),this.columnMoverBack.setAttribute("x",t)):"number"==typeof i&&"number"==typeof o&&(this.columnMoverLabel.setAttribute("y",o),this.columnMoverLine.setAttribute("y",o),this.columnMoverBack.setAttribute("y",i))}updateStyle(){const t=this.table.theme.dragHeaderSplitLine.lineWidth,e=this.table.theme.dragHeaderSplitLine.lineColor,i=this.table.theme.dragHeaderSplitLine.shadowBlockColor;this.columnMoverLabel.setAttributes({fill:e}),this.columnMoverLine.setAttributes({stroke:e,lineWidth:t}),this.columnMoverBack.setAttributes({fill:i})}}function oB(t,e,i){if(i)return Math.min(e.tableNoFrameWidth,e.getAllColsWidth())-e.getColsWidth(t,e.colCount-1);let o=e.getColsWidth(0,t);return t>=e.frozenColCount&&(o-=e.scrollLeft),o}function nB(t,e,i){if(i)return Math.min(e.tableNoFrameWidth,e.getAllRowsHeight())-e.getRowsHeight(t,e.rowCount-1);let o=e.getRowsHeight(0,t);return t>=e.frozenRowCount&&(o-=e.scrollTop),o}class rB{constructor(t){var e,i,o,n,r,s,l,a,h,d,c,u,g,p,f,v,m;this.table=t;const b=this.table.theme;this.createScrollBar();const y=null===(e=b.columnResize)||void 0===e?void 0:e.lineColor,C=null===(i=b.columnResize)||void 0===i?void 0:i.lineWidth,w=null===(o=b.columnResize)||void 0===o?void 0:o.bgColor,x=null===(n=b.columnResize)||void 0===n?void 0:n.width,_=null===(s=null===(r=b.columnResize)||void 0===r?void 0:r.labelVisible)||void 0===s||s,S=null===(l=b.columnResize)||void 0===l?void 0:l.labelColor,A=null===(a=b.columnResize)||void 0===a?void 0:a.labelFontSize,B=null===(h=b.columnResize)||void 0===h?void 0:h.labelFontFamily,R=null===(d=b.columnResize)||void 0===d?void 0:d.labelBackgroundFill,M=null===(c=b.columnResize)||void 0===c?void 0:c.labelBackgroundCornerRadius;this.labelVisible=_,this.columnResizeLine=oc({visible:!1,pickable:!1,stroke:y,lineWidth:C,x:0,y:0,points:[{x:0,y:0},{x:0,y:0}]}),this.columnResizeBgLine=oc({visible:!1,pickable:!1,stroke:w,lineWidth:x,x:0,y:0,points:[{x:0,y:0},{x:0,y:0}]});const T=Gh({visible:!1,pickable:!1,x:0,y:0,fontSize:A,fill:S,fontFamily:B,text:"",textBaseline:"top",dx:16,dy:-A/2}),k=sc({visible:!1,pickable:!1,fill:R,x:0,y:0,width:5*A*.8,height:A+8,cornerRadius:M,dx:12,dy:-A/2-4});this.columnResizeLabel=vs({visible:!1,pickable:!1,x:0,y:0}),this.columnResizeLabel.appendChild(k),this.columnResizeLabel.appendChild(T),this.rowResizeLine=oc({visible:!1,pickable:!1,stroke:y,lineWidth:C,x:0,y:0,points:[{x:0,y:0},{x:0,y:0}]}),this.rowResizeBgLine=oc({visible:!1,pickable:!1,stroke:w,lineWidth:x,x:0,y:0,points:[{x:0,y:0},{x:0,y:0}]});const L=Gh({visible:!1,pickable:!1,x:0,y:0,fontSize:A,fill:S,fontFamily:B,text:"",textBaseline:"top",dx:16,dy:-A/2}),P=sc({visible:!1,pickable:!1,fill:R,x:0,y:0,width:5*A*.8,height:A+8,cornerRadius:M,dx:12,dy:-A/2-4});this.rowResizeLabel=vs({visible:!1,pickable:!1,x:0,y:0}),this.rowResizeLabel.appendChild(P),this.rowResizeLabel.appendChild(L),this.cellMover=new iB(this.table);const E=null===(g=null===(u=b.frozenColumnLine)||void 0===u?void 0:u.shadow)||void 0===g?void 0:g.width,H=null===(f=null===(p=b.frozenColumnLine)||void 0===p?void 0:p.shadow)||void 0===f?void 0:f.startColor,F=null===(m=null===(v=b.frozenColumnLine)||void 0===v?void 0:v.shadow)||void 0===m?void 0:m.endColor;this.frozenShadowLine=sc({visible:!0,pickable:!1,x:0,y:0,width:E,height:0,fill:{gradient:"linear",x0:0,y0:0,x1:1,y1:0,stops:[{color:H,offset:0},{color:F,offset:1}]}}),this.rightFrozenShadowLine=sc({visible:!0,pickable:!1,x:0,y:0,width:E,height:0,fill:{gradient:"linear",x0:0,y0:0,x1:1,y1:0,stops:[{color:F,offset:0},{color:H,offset:1}]}}),this.menu=new class{constructor(t){this._table=t,this._menuInstance=new zS({x:0,y:0,fill:XA,stroke:qA,cornerRadius:YA,lineWidth:KA}),this._menuInfo={x:-1,y:-1,col:-1,row:-1,type:WA.dropDown,menuInfo:[],highlightIndex:-1}}bindTableComponent(t){t.appendChild(this._menuInstance),this.bindEvent()}release(){}attach(t,e,i,o,n,r){if(n===WA.dropDown&&this.checkDropDownMenuChange(i,o)){const t=this.getMenuInfo(i,o,n);if(!t)return;const{menuInfo:e,highlightIndex:r}=t;this.updateMenuInfo(i,o,n,e,r),this.updateMenuInstance(e,r)}else if(n===WA.contextmenu&&this.checkContextMenuChange(t,e)){const t=this.getMenuInfo(i,o,n);if(!t)return;const{menuInfo:e,highlightIndex:r}=t;this.updateMenuInfo(i,o,n,e,r),this.updateMenuInstance(e,r)}this.updatePosition(t-this._table.scenegraph.x,e-this._table.scenegraph.y),this.addToScene()}updateMenuInfo(t,e,i,o,n){this._menuInfo.col=t,this._menuInfo.row=e,this._menuInfo.type=i,this._menuInfo.menuInfo=o,this._menuInfo.highlightIndex=n}checkDropDownMenuChange(t,e){const{type:i,col:o,row:n}=this._menuInfo;return i!==WA.dropDown||t!==o||e!==n}checkContextMenuChange(t,e){var i;const{type:o,menuInfo:n}=this._menuInfo;return o!==WA.contextmenu||n!==(null===(i=this._table.internalProps.menu)||void 0===i?void 0:i.contextMenuItems)}updateMenuInstance(t,e){this._menuInstance.removeAllChild();let i=ZA;const o=ZA;let n=0;t.forEach(((t,r)=>{var s,l;const a=e===r;let h,d;"string"==typeof t?d=t:"object"==typeof t&&(d=t.text,h=a?t.selectedIcon:t.icon);const c=new zS({y:i,x:o,height:$A,fill:XA});c.role="menu-item",this._menuInstance.appendChild(c),c.stateProxy=t=>"hover"===t?{fill:UA}:{fill:XA},c.addEventListener("pointerenter",(t=>{c.addState("hover",!0,!1),this._table.scenegraph.updateNextFrame()})),c.addEventListener("pointerleave",(t=>{c.removeState("hover",!1),this._table.scenegraph.updateNextFrame()}));const u=new Nh({x:JA,y:JA,fill:a?VA:jA,text:d,textBaseline:"top",fontSize:NA,fontFamily:GA,pickable:!1,maxLineWidth:QA,ellipsis:"…"});if(c.addChild(u),h){u.AABBBounds.height();const t=null!==(s=h.width)&&void 0!==s?s:16,e=null!==(l=h.height)&&void 0!==l?l:16,i=new U_({x:JA,y:($A-e)/2,width:t,height:e,image:h.svg,pickable:!1});i.role="menu-icon",c.insertBefore(i,u),u.setAttribute("x",t+JA)}n=Math.max(c.AABBBounds.width(),n),i+=$A})),this._menuInstance.setAttributes({width:n+2*JA+2*ZA,height:i+ZA}),this._menuInstance.forEachChildren((t=>{t.setAttribute("width",n+2*JA)}))}updatePosition(t,e){this._menuInstance.setAttributes({x:this._menuInfo.type===WA.dropDown?t-this._menuInstance.attribute.width:t,y:e}),this._menuInfo.x=WA.dropDown?t-this._menuInstance.attribute.width:t,this._menuInfo.y=e}addToScene(){this._table.scenegraph.updateNextFrame()}detach(){this._menuInstance.setAttributes({x:-1e3,y:-1e3}),this._table.scenegraph.updateNextFrame()}getMenuInfo(t,e,i){var o;if(i===WA.dropDown){const{dropDownMenu:i=this._table.globalDropDownMenu,pivotInfo:o}=this._table._getHeaderLayoutMap(t,e);let n=-1;if(Array.isArray(i))for(let o=0;o<i.length;o++)if(this._table._dropDownMenuIsHighlight(t,e,o)){n=o;break}return{menuInfo:i,highlightIndex:n}}if(i===WA.contextmenu){const i=null===(o=this._table.internalProps.menu)||void 0===o?void 0:o.contextMenuItems;let n;if(Array.isArray(i))n=i;else if("function"==typeof i){const{field:o}=this._table.isHeader(t,e)?this._table.getHeaderDefine(t,e):this._table.getBodyColumnDefine(t,e);n=i(o,e,t)}return{menuInfo:n,highlightIndex:-1}}}bindEvent(){this._menuInstance.addEventListener("click",(t=>{const{target:e}=t;if(e&&"menu-item"===e.role){const i=this.getEventInfo(e),o=this._table.getMenuInfo(this._menuInfo.col,this._menuInfo.row,this._menuInfo.type),n=Object.assign(i,o);n.event=t.nativeEvent,this._table.fireListeners(Xw.DROPDOWN_MENU_CLICK,n)}}))}getEventInfo(t){const e=t.parent;let i=0;e.forEachChildren(((e,o)=>e===t&&(i=o-1,!0)));const o="string"==typeof this._menuInfo.menuInfo[i]?this._menuInfo.menuInfo[i]:this._menuInfo.menuInfo[i].text,n="string"==typeof this._menuInfo.menuInfo[i]?o:this._menuInfo.menuInfo[i].menuKey||o;return{col:this._menuInfo.col,row:this._menuInfo.row,dropDownIndex:i,highlight:i===this._menuInfo.highlightIndex,text:o,menuKey:n}}get bounds(){return this._menuInstance.globalAABBBounds}}(this.table),this.drillIcon=new eB}addToGroup(t){t.addChild(this.frozenShadowLine),t.addChild(this.rightFrozenShadowLine),t.addChild(this.columnResizeBgLine),t.addChild(this.columnResizeLine),t.addChild(this.columnResizeLabel),t.addChild(this.rowResizeBgLine),t.addChild(this.rowResizeLine),t.addChild(this.rowResizeLabel),this.table.theme.scrollStyle.hoverOn&&!this.table.theme.scrollStyle.barToSide?(t.addChild(this.hScrollBar),t.addChild(this.vScrollBar)):(t.stage.defaultLayer.addChild(this.hScrollBar),t.stage.defaultLayer.addChild(this.vScrollBar)),this.menu.bindTableComponent(t),this.drillIcon.appand(t),this.cellMover.appand(t)}createScrollBar(){var t,e,i,o,n,r;const s=this.table.theme,l=null===(t=s.scrollStyle)||void 0===t?void 0:t.scrollRailColor,a=null===(e=s.scrollStyle)||void 0===e?void 0:e.scrollSliderColor,h=null===(i=s.scrollStyle)||void 0===i?void 0:i.scrollSliderCornerRadius,d=null===(o=s.scrollStyle)||void 0===o?void 0:o.width,c=null===(n=s.scrollStyle)||void 0===n?void 0:n.horizontalPadding,u=null===(r=s.scrollStyle)||void 0===r?void 0:r.verticalPadding;let g;g=Q(h)?{cornerRadius:h,fill:a}:{fill:a},this.hScrollBar=new Am({direction:"horizontal",x:2*-this.table.tableNoFrameWidth,y:2*-this.table.tableNoFrameHeight,width:this.table.tableNoFrameWidth,height:d,padding:c,railStyle:{fill:l},sliderStyle:g,range:[0,.1],visible:!1}),this.hScrollBar.render(),this.hScrollBar.hideAll(),this.vScrollBar=new Am({direction:"vertical",x:2*-this.table.tableNoFrameWidth,y:2*-this.table.tableNoFrameHeight,width:d,height:this.table.tableNoFrameHeight-this.table.getFrozenRowsHeight(),padding:u,railStyle:{fill:l},sliderStyle:g,range:[0,.1],visible:!1}),this.vScrollBar.render(),this.vScrollBar.hideAll()}updateScrollBar(){var t,e,i,o,n,r,s;const l=this.table.stateManager.scroll.horizontalBarPos,a=this.table.stateManager.scroll.verticalBarPos,h=this.table.theme,d=null===(t=h.scrollStyle)||void 0===t?void 0:t.width,c=null===(e=h.scrollStyle)||void 0===e?void 0:e.visible,u=null!==(o=null===(i=h.scrollStyle)||void 0===i?void 0:i.horizontalVisible)&&void 0!==o?o:c,g=null!==(r=null===(n=h.scrollStyle)||void 0===n?void 0:n.verticalVisible)&&void 0!==r?r:c,p=Math.ceil(this.table.scenegraph.tableGroup.attribute.width),f=Math.ceil(this.table.scenegraph.tableGroup.attribute.height),v=this.table.getAllRowsHeight(),m=this.table.getAllColsWidth(),b=this.table.getFrozenRowsHeight(),y=this.table.getFrozenColsWidth(),C=this.table.getBottomFrozenRowsHeight(),w=this.table.getRightFrozenColsWidth(),x=(null===(s=this.table.options.customConfig)||void 0===s?void 0:s._disableColumnAndRowSizeRound)?1:0;if(m>p+x){const t=Math.min(f,v),e=Math.max(.05,(p-y)/(m-y)),i=this.table.theme.scrollStyle.hoverOn;let o=0;o=this.table.theme.scrollStyle.barToSide?this.table.tableNoFrameHeight-(i?d:-this.table.scenegraph.tableGroup.attribute.y)+this.table.tableY:t-(i?d:-this.table.scenegraph.tableGroup.attribute.y),this.hScrollBar.setAttributes({x:y+(i?0:this.table.scenegraph.tableGroup.attribute.x),y:o,width:p-y-w,range:[0,e],visible:"always"===u});const n=this.hScrollBar.AABBBounds&&this.hScrollBar.globalAABBBounds;this.hScrollBar._viewPosition={x:n.x1,y:n.y1},"always"===u&&this.hScrollBar.showAll()}else this.hScrollBar.setAttributes({x:2*-this.table.tableNoFrameWidth,y:2*-this.table.tableNoFrameHeight,width:0,visible:!1});if(v>f+x){const t=Math.min(p,m),e=Math.max(.05,(f-b)/(v-b));let i=0;const o=this.table.theme.scrollStyle.hoverOn;i=this.table.theme.scrollStyle.barToSide?this.table.tableNoFrameWidth-(o?d:-this.table.scenegraph.tableGroup.attribute.x)+this.table.tableX:t-(o?d:-this.table.scenegraph.tableGroup.attribute.x),this.vScrollBar.setAttributes({x:i,y:b+(o?0:this.table.scenegraph.tableGroup.attribute.y),height:f-b-C,range:[0,e],visible:"always"===g});const n=this.vScrollBar.AABBBounds&&this.vScrollBar.globalAABBBounds;this.vScrollBar._viewPosition={x:n.x1,y:n.y1},"always"===g&&this.vScrollBar.showAll()}else this.vScrollBar.setAttributes({x:2*-this.table.tableNoFrameWidth,y:2*-this.table.tableNoFrameHeight,height:0,visible:!1});this.table.stateManager.setScrollLeft(l),this.table.stateManager.setScrollTop(a)}hideResizeCol(){this.columnResizeLine.setAttribute("visible",!1),this.columnResizeBgLine.setAttribute("visible",!1),this.columnResizeLabel.setAttribute("visible",!1),this.columnResizeLabel.hideAll()}showResizeCol(t,e,i){const o=oB(t,this.table,i);this.columnResizeLine.setAttributes({visible:!0,x:o,points:[{x:0,y:0},{x:0,y:this.table.getRowsHeight(0,this.table.rowCount-1)}]}),this.columnResizeBgLine.setAttributes({visible:!0,x:o,points:[{x:0,y:0},{x:0,y:this.table.getRowsHeight(0,this.table.rowCount-1)}]}),this.labelVisible&&(this.columnResizeLabel.showAll(),this.columnResizeLabel.setAttributes({visible:!0,x:o,y:e}),this.columnResizeLabel.lastChild.setAttribute("text",`${this.table.getColWidth(t)}px`))}updateResizeCol(t,e,i){const o=oB(t,this.table,i);this.columnResizeLine.setAttributes({x:o,points:[{x:0,y:0},{x:0,y:this.table.getRowsHeight(0,this.table.rowCount-1)}]}),this.columnResizeBgLine.setAttributes({x:o,points:[{x:0,y:0},{x:0,y:this.table.getRowsHeight(0,this.table.rowCount-1)}]}),this.labelVisible&&(this.columnResizeLabel.setAttributes({x:o,y:e}),this.columnResizeLabel.lastChild.setAttribute("text",`${Math.floor(this.table.getColWidth(t))}px`))}hideResizeRow(){this.rowResizeLine.setAttribute("visible",!1),this.rowResizeBgLine.setAttribute("visible",!1),this.rowResizeLabel.setAttribute("visible",!1),this.rowResizeLabel.hideAll()}showResizeRow(t,e,i){const o=nB(t,this.table,i);this.rowResizeLine.setAttributes({visible:!0,y:o,points:[{y:0,x:0},{y:0,x:this.table.getColsWidth(0,this.table.colCount-1)}]}),this.rowResizeBgLine.setAttributes({visible:!0,y:o,points:[{y:0,x:0},{y:0,x:this.table.getColsWidth(0,this.table.colCount-1)}]}),this.labelVisible&&(this.rowResizeLabel.showAll(),this.rowResizeLabel.setAttributes({visible:!0,y:o,x:e}),this.rowResizeLabel.lastChild.setAttribute("text",`${this.table.getRowHeight(t)}px`))}updateResizeRow(t,e,i){const o=nB(t,this.table,i);this.rowResizeLine.setAttributes({y:o,points:[{y:0,x:0},{y:0,x:this.table.getColsWidth(0,this.table.colCount-1)}]}),this.rowResizeBgLine.setAttributes({y:o,points:[{y:0,x:0},{y:0,x:this.table.getColsWidth(0,this.table.colCount-1)}]}),this.labelVisible&&(this.rowResizeLabel.setAttributes({y:o,x:e}),this.rowResizeLabel.lastChild.setAttribute("text",`${Math.floor(this.table.getRowHeight(t))}px`))}hideMoveCol(){this.cellMover.hide()}showMoveCol(t,e,i){this.cellMover.show(t,e,i)}updateMoveCol(t,e,i,o){this.cellMover.update(t,e,i,o)}setFrozenColumnShadow(t,e){if(t<0)this.frozenShadowLine.setAttributes({visible:!1});else{const i=oB(t,this.table,e);this.frozenShadowLine.setAttributes({visible:!0,x:i,height:this.table.getDrawRange().height})}}setRightFrozenColumnShadow(t){if(t>=this.table.colCount)this.rightFrozenShadowLine.setAttributes({visible:!1});else{const e=oB(t,this.table,!0);this.rightFrozenShadowLine.setAttributes({visible:!0,x:e-this.rightFrozenShadowLine.attribute.width,height:this.table.getDrawRange().height})}}hideVerticalScrollBar(){var t;const e=this.table.theme.scrollStyle.visible,i=null!==(t=this.table.theme.scrollStyle.verticalVisible)&&void 0!==t?t:e;"focus"!==i&&"scrolling"!==i||(this.vScrollBar.setAttribute("visible",!1),this.vScrollBar.hideAll(),this.table.scenegraph.updateNextFrame())}showVerticalScrollBar(){var t;const e=this.table.theme.scrollStyle.visible,i=null!==(t=this.table.theme.scrollStyle.verticalVisible)&&void 0!==t?t:e;"focus"!==i&&"scrolling"!==i||(this.vScrollBar.setAttribute("visible",!0),this.vScrollBar.showAll(),this.table.scenegraph.updateNextFrame())}hideHorizontalScrollBar(){var t;const e=this.table.theme.scrollStyle.visible,i=null!==(t=this.table.theme.scrollStyle.horizontalVisible)&&void 0!==t?t:e;"focus"!==i&&"scrolling"!==i||(this.hScrollBar.setAttribute("visible",!1),this.hScrollBar.hideAll(),this.table.scenegraph.updateNextFrame())}showHorizontalScrollBar(){var t;const e=this.table.theme.scrollStyle.visible,i=null!==(t=this.table.theme.scrollStyle.horizontalVisible)&&void 0!==t?t:e;"focus"!==i&&"scrolling"!==i||(this.hScrollBar.setAttribute("visible",!0),this.hScrollBar.showAll(),this.table.scenegraph.updateNextFrame())}updateVerticalScrollBarPos(t){const e=this.vScrollBar.attribute.range,i=e[1]-e[0],o=t*(1-i);this.vScrollBar.setAttribute("range",[o,o+i]);const n=this.vScrollBar.AABBBounds&&this.vScrollBar.globalAABBBounds;this.vScrollBar._viewPosition={x:n.x1,y:n.y1}}updateHorizontalScrollBarPos(t){const e=this.hScrollBar.attribute.range,i=e[1]-e[0],o=t*(1-i);this.hScrollBar.setAttribute("range",[o,o+i]);const n=this.hScrollBar.AABBBounds&&this.hScrollBar.globalAABBBounds;this.hScrollBar._viewPosition={x:n.x1,y:n.y1}}updateStyle(){var t,e,i,o,n,r,s,l,a,h,d,c,u,g,p,f,v,m,b,y,C,w,x;const _=this.table.theme,S=null===(t=_.scrollStyle)||void 0===t?void 0:t.scrollRailColor,A=null===(e=_.scrollStyle)||void 0===e?void 0:e.scrollSliderColor,B=null===(i=_.scrollStyle)||void 0===i?void 0:i.scrollSliderCornerRadius,R=null===(o=_.scrollStyle)||void 0===o?void 0:o.width,M=null===(n=_.scrollStyle)||void 0===n?void 0:n.horizontalPadding,T=null===(r=_.scrollStyle)||void 0===r?void 0:r.verticalPadding;let k;k=Q(B)?{cornerRadius:B,fill:A}:{fill:A},this.hScrollBar.setAttributes({height:R,padding:M,railStyle:{fill:S},sliderStyle:k}),this.vScrollBar.setAttributes({width:R,padding:T,railStyle:{fill:S},sliderStyle:k});const L=null===(s=_.columnResize)||void 0===s?void 0:s.lineColor,P=null===(l=_.columnResize)||void 0===l?void 0:l.lineWidth,E=null===(a=_.columnResize)||void 0===a?void 0:a.bgColor,H=null===(h=_.columnResize)||void 0===h?void 0:h.width;this.columnResizeLine.setAttributes({stroke:L,lineWidth:P}),this.columnResizeBgLine=oc({stroke:E,lineWidth:H});const F=null===(d=_.columnResize)||void 0===d?void 0:d.labelColor,z=null===(c=_.columnResize)||void 0===c?void 0:c.labelFontSize,I=null===(u=_.columnResize)||void 0===u?void 0:u.labelFontFamily,O=null===(g=_.columnResize)||void 0===g?void 0:g.labelBackgroundFill,D=null===(p=_.columnResize)||void 0===p?void 0:p.labelBackgroundCornerRadius,W=null===(v=null===(f=_.columnResize)||void 0===f?void 0:f.labelVisible)||void 0===v||v;this.labelVisible=W,this.columnResizeLabel.lastChild.setAttributes({fontSize:z,fill:F,fontFamily:I,dy:-z/2}),this.columnResizeLabel.firstChild.setAttributes({fill:O,width:5*z*.8,height:z+8,cornerRadius:D,dy:-z/2-4}),this.rowResizeLabel.lastChild.setAttributes({fontSize:z,fill:F,fontFamily:I,dy:-z/2}),this.rowResizeLabel.firstChild.setAttributes({fill:O,width:5*z*.8,height:z+8,cornerRadius:D,dy:-z/2-4});const N=null===(b=null===(m=_.frozenColumnLine)||void 0===m?void 0:m.shadow)||void 0===b?void 0:b.width,G=null===(C=null===(y=_.frozenColumnLine)||void 0===y?void 0:y.shadow)||void 0===C?void 0:C.startColor,j=null===(x=null===(w=_.frozenColumnLine)||void 0===w?void 0:w.shadow)||void 0===x?void 0:x.endColor;this.frozenShadowLine.setAttributes({width:N,fill:{gradient:"linear",x0:0,y0:0,x1:1,y1:0,stops:[{color:G,offset:0},{color:j,offset:1}]}}),this.rightFrozenShadowLine.setAttributes({width:N,fill:{gradient:"linear",x0:0,y0:0,x1:1,y1:0,stops:[{color:j,offset:0},{color:G,offset:1}]}}),this.cellMover.updateStyle()}}function sB(t,e,i,o,n){var r,s,l,a,h,d;if(!e)return;const c="table"===i,{shadowBlur:u,shadowOffsetX:g,shadowOffsetY:p,shadowColor:f,cornerRadius:v,borderColor:m,borderLineWidth:b,borderLineDash:y}=e;let C=!1;const w={},x={pickable:!1};u&&c&&(x.shadowBlur=u,x.shadowOffsetX=g,x.shadowOffsetY=p,x.shadowColor=f,x.stroke=!0,x.stroke=f,x.lineWidth=1,C=!0),b&&(x.stroke=!0,x.fill=!1,x.stroke=aB(null!=m?m:"#E1E4E8",o,b),x.lineWidth=b,y&&(x.lineDash=y),x.lineCap="butt"),Array.isArray(m)&&(x.strokeArrayColor=r_(m)),Array.isArray(b)&&(x.strokeArrayWidth=r_(b),x.lineWidth=1),v&&(x.cornerRadius=v,w.cornerRadius=v);const _=x.strokeArrayWidth?x.strokeArrayWidth[0]:null!==(r=x.lineWidth)&&void 0!==r?r:0,S=x.strokeArrayWidth?x.strokeArrayWidth[1]:null!==(s=x.lineWidth)&&void 0!==s?s:0,A=x.strokeArrayWidth?x.strokeArrayWidth[2]:null!==(l=x.lineWidth)&&void 0!==l?l:0,B=x.strokeArrayWidth?x.strokeArrayWidth[3]:null!==(a=x.lineWidth)&&void 0!==a?a:0;if(t.setAttributes(w),!n)if(x.stroke)if(x.x=B/2,x.y=_/2,x.pickable=!1,c){if(v)if(Array.isArray(v)){const t=r_(v);x.cornerRadius=t,w.cornerRadius=t,t[0]&&(t[0]=t[0]+Math.min(B,_)/2),t[1]&&(t[1]=t[1]+Math.min(_,S)/2),t[2]&&(t[2]=t[2]+Math.min(S,A)/2),t[3]&&(t[3]=t[3]+Math.min(A,B)/2)}else if(rt(b)){const t=[];x.cornerRadius=t,w.cornerRadius=t,t[0]=v+Math.min(B,_)/2,t[1]=v+Math.min(_,S)/2,t[2]=v+Math.min(S,A)/2,t[3]=v+Math.min(A,B)/2}else x.cornerRadius=v+(null!==(h=x.lineWidth)&&void 0!==h?h:0)/2,w.cornerRadius=v+(null!==(d=x.lineWidth)&&void 0!==d?d:0)/2;let i,o;if(e.innerBorder?(x.x=t.attribute.x+B/2,x.y=t.attribute.y+_/2,x.width=t.attribute.width-B/2-S/2,x.height=t.attribute.height-_/2-A/2):(x.x=t.attribute.x-B/2,x.y=t.attribute.y-_/2,x.width=t.attribute.width+B/2+S/2,x.height=t.attribute.height+_/2+A/2),C){x.fill="white",x.notAdjustPos=!0,o=vs(x),o.name="table-border-rect",i=sc({x:B/2,y:_/2,width:t.attribute.width,height:t.attribute.height,fill:"red",cornerRadius:t.attribute.cornerRadius,globalCompositeOperation:"destination-out"}),o.addChild(i);const e=sc({x:B/2,y:_/2,width:t.attribute.width,height:t.attribute.height,fill:"transparent",pickable:!1,globalCompositeOperation:"source-over"});o.addChild(e)}else o=sc(x),o.name="table-border-rect";e.innerBorder&&!C?t.parent.insertAfter(o,t):t.parent.insertBefore(o,t),t.border=o}else{x.width=t.attribute.width-B/2-S/2,x.height=t.attribute.height-_/2-A/2;const e=sc(x);e.name="border-rect",t.addChild(e),t.border=e}else{const e=sc({fill:!1,stroke:!1,pickable:!1,lineWidth:0});e.name="border-rect",t.addChild(e),t.border=e}}function lB(t,e,i){var o;if(!e)return;const{borderColor:n}=e;null===(o=t.border)||void 0===o||o.setAttribute("stroke",aB(n,i))}function aB(t,e,i){let o=!0;return!e&&!rt(i)||rt(t)?e?o=e:e||rt(t)?rt(t)&&(o=!0):o=t:o=(null!=e?e:i).map((e=>!!e&&t)),o}function hB(t){var e,i,o,n;if(!t.border)return;const r=t.border.attribute.strokeArrayWidth?t.border.attribute.strokeArrayWidth[0]:null!==(e=t.border.attribute.lineWidth)&&void 0!==e?e:0,s=t.border.attribute.strokeArrayWidth?t.border.attribute.strokeArrayWidth[1]:null!==(i=t.border.attribute.lineWidth)&&void 0!==i?i:0,l=t.border.attribute.strokeArrayWidth?t.border.attribute.strokeArrayWidth[2]:null!==(o=t.border.attribute.lineWidth)&&void 0!==o?o:0,a=t.border.attribute.strokeArrayWidth?t.border.attribute.strokeArrayWidth[3]:null!==(n=t.border.attribute.lineWidth)&&void 0!==n?n:0;t.border.setAttributes({width:t.attribute.width-a/2-s/2,height:t.attribute.height-r/2-l/2}),"group"===t.border.type&&t.border.firstChild.setAttributes({width:t.attribute.width,height:t.attribute.height})}function dB(t,e){t.setAttribute("cornerRadius",e),t.border&&t.border.setAttribute("cornerRadius",e)}const cB=Ur();class uB extends fs{constructor(t,e){if(super(e),this.type="chart",this.numberType=cB,this.isShareChartSpec=t,e.chartInstance)this.chartInstance=e.chartInstance;else{const t=this.chartInstance=new e.ClassType(e.spec,St({},this.attribute.tableChartOption,{renderCanvas:e.canvas,mode:"node"===this.attribute.mode?"node":"desktop-browser",modeParams:this.attribute.modeParams,canvasControled:!1,viewBox:{x1:0,x2:0,y1:0,y2:0},dpr:e.dpr,interactive:!1,animation:!1,autoFit:!1}));t.renderSync(),t.getStage().enableDirtyBounds(),e.chartInstance=this.chartInstance=t}}activate(t){var e,i,o,n;this.active=!0;const{col:r,row:s}=this.parent,{x1:l,y1:a,x2:h,y2:d}=this.getViewBox(),c=function(t,e,i){var o,n,r,s,l,a,h,d;const{layoutMap:c}=i.internalProps,u=new ze,g=i.scenegraph.tableGroup.globalAABBBounds;return u.x1=g.x1,u.x2=g.x2,u.y1=g.y1,u.y2=g.y2,c.isFrozenColumn(t,e)||c.isRightFrozenColumn(t,e)?c.isLeftBottomCorner(t,e)||c.isRightTopCorner(t,e)||(c.isFrozenColumn(t,e)||c.isRightFrozenColumn(t,e)?(u.y1=g.y1+i.getFrozenRowsHeight(),u.y2=g.y2-i.getBottomFrozenRowsHeight()):c.isBottomFrozenRow(t,e)&&(u.x1=g.x1+i.getFrozenColsWidth(),u.x2=g.x2-i.getRightFrozenColsWidth())):(u.x1=g.x1+i.getFrozenColsWidth(),u.x2=g.x2-i.getRightFrozenColsWidth(),u.y1=g.y1+i.getFrozenRowsHeight(),u.y2=g.y2-i.getBottomFrozenRowsHeight()),u.x1=u.x1+(null!==(n=null===(o=i.options.viewBox)||void 0===o?void 0:o.x1)&&void 0!==n?n:0),u.x2=u.x2+(null!==(s=null===(r=i.options.viewBox)||void 0===r?void 0:r.x1)&&void 0!==s?s:0),u.y1=u.y1+(null!==(a=null===(l=i.options.viewBox)||void 0===l?void 0:l.y1)&&void 0!==a?a:0),u.y2=u.y2+(null!==(d=null===(h=i.options.viewBox)||void 0===h?void 0:h.y1)&&void 0!==d?d:0),u}(r,s,t).intersect({x1:l-t.scrollLeft,x2:h-t.scrollLeft,y1:a-t.scrollTop,y2:d-t.scrollTop});this.activeChartInstance=new this.attribute.ClassType(this.attribute.spec,St({},this.attribute.tableChartOption,{renderCanvas:this.attribute.canvas,mode:"desktop-browser",canvasControled:!1,viewBox:{x1:0,x2:h-l,y1:0,y2:d-a},dpr:t.internalProps.pixelRatio,animation:!1,interactive:!0,autoFit:!1,beforeRender:e=>{const i=this.stage,o=e.window.getContext(),n=i.window.getViewBoxTransform(),r=i.window.getViewBox();o.inuse=!0,o.clearMatrix(),o.setTransform(n.a,n.b,n.c,n.d,n.e,n.f,!0),o.translate(r.x1,r.y1),o.setTransformForCurrent(!0),o.beginPath(),o.rect(c.x1,c.y1,c.x2-c.x1,c.y2-c.y1),o.clip(),o.clearMatrix(),t.options.canvas&&!e.needRender&&(e.pauseRender(),t.scenegraph.stage.dirtyBounds.union(this.globalAABBBounds),t.scenegraph.updateNextFrame())},afterRender(t){t.window.getContext().inuse=!1,t.needRender=!1,u.resumeRender()}}));const u=this.activeChartInstance.getStage(),g=this.globalTransMatrix.clone(),p=this.stage.window.getViewBoxTransform();g.multiply(p.a,p.b,p.c,p.d,p.e,p.f),u.window.setViewBoxTransform&&u.window.setViewBoxTransform(g.a,g.b,g.c,g.d,g.e,g.f),this.activeChartInstance.renderSync(),null===(i=null===(e=t.internalProps.layoutMap)||void 0===e?void 0:e.updateDataStateToActiveChartInstance)||void 0===i||i.call(e,this.activeChartInstance),this.activeChartInstance.on("click",(e=>{uB.temp&&t.scenegraph.updateChartState(null==e?void 0:e.datum)})),this.activeChartInstance.on("brushEnd",(e=>{var i;t.scenegraph.updateChartState(null===(i=null==e?void 0:e.value)||void 0===i?void 0:i.inBrushData),uB.temp=0,setTimeout((()=>{uB.temp=1}),0)})),null===(n=(o=t)._bindChartEvent)||void 0===n||n.call(o,this.activeChartInstance)}deactivate(){var t,e;this.active=!1,null===(t=this.activeChartInstance)||void 0===t||t.updateViewBox({x1:-1e3,x2:-800,y1:-1e3,y2:-800},!1,!1),null===(e=this.activeChartInstance)||void 0===e||e.release(),this.activeChartInstance=null}updateData(t){this.attribute.data=t}getViewBox(){var t,e,i,o,n,r,s,l;const a=this.parent,h=this.attribute.cellPadding,d=this.stage.table,{x1:c,y1:u,x2:g,y2:p}=a.globalAABBBounds;return{x1:Math.ceil(c+h[3]+d.scrollLeft+(null!==(e=null===(t=d.options.viewBox)||void 0===t?void 0:t.x1)&&void 0!==e?e:0)),x2:Math.ceil(c+a.attribute.width-h[1]+d.scrollLeft+(null!==(o=null===(i=d.options.viewBox)||void 0===i?void 0:i.x1)&&void 0!==o?o:0)),y1:Math.ceil(u+h[0]+d.scrollTop+(null!==(r=null===(n=d.options.viewBox)||void 0===n?void 0:n.y1)&&void 0!==r?r:0)),y2:Math.ceil(u+a.attribute.height-h[2]+d.scrollTop+(null!==(l=null===(s=d.options.viewBox)||void 0===s?void 0:s.y1)&&void 0!==l?l:0))}}}uB.temp=1;const gB=[],pB=[];let fB=5,vB=!1;function mB(t){Q(t)&&(fB=t)}function bB(t){var e,i,o,n,r,s;const{axes:l,dataId:a,data:h,spec:d,ClassType:c,canvas:u,mode:g,modeParams:p,dpr:f}=t.attribute;let{chartInstance:v}=t;v||(v=new c(d,{renderCanvas:u,mode:"node"===g?"node":"desktop-browser",modeParams:p,canvasControled:!1,viewBox:{x1:0,x2:0,y1:0,y2:0},dpr:f,interactive:!1,animation:!1,autoFit:!1}),v.renderSync(),t.chartInstance=v);const m=t.getViewBox();m.x2<=m.x1&&(m.x2=m.x1+1),m.y2<=m.y1&&(m.y2=m.y1+1),v.updateViewBox({x1:0,x2:m.x2-m.x1,y1:0,y2:m.y2-m.y1},!1,!1);const b=v.getStage(),y=t.globalTransMatrix.clone(),C=t.stage.window.getViewBoxTransform();y.multiply(C.a,C.b,C.c,C.d,C.e,C.f),b.window.setViewBoxTransform&&b.window.setViewBoxTransform(y.a,y.b,y.c,y.d,y.e,y.f);const{table:w}=t.getRootNode();let x=!1;if(w.options.specFormat){const e=w.options.specFormat(t.attribute.spec);if(e.needFormatSpec&&e.spec){const t=e.spec;v.updateSpecSync(t),x=!0}}if(!x)if(null==l||l.forEach(((t,e)=>{var i,o,n,r;"band"===t.type?v.updateModelSpec({type:"axes",index:e},{domain:t.domain.slice(0)},!0):v.updateModelSpecSync({type:"axes",index:e},{min:null!==(o=null===(i=t.range)||void 0===i?void 0:i.min)&&void 0!==o?o:0,max:null!==(r=null===(n=t.range)||void 0===n?void 0:n.max)&&void 0!==r?r:0},!0)})),null===(i=null===(e=w.internalProps.layoutMap)||void 0===e?void 0:e.updateDataStateToActiveChartInstance)||void 0===i||i.call(e,v),"string"==typeof a)v.updateDataSync(a,null!=h?h:[]);else{const t=[];for(const e in a){const i=a[e],s=d.series.find((t=>{var i;return(null===(i=null==t?void 0:t.data)||void 0===i?void 0:i.id)===e}));t.push({id:e,values:i?null!==(o=null==h?void 0:h.filter((t=>t.hasOwnProperty(i))))&&void 0!==o?o:[]:null!=h?h:[],fields:null===(n=null==s?void 0:s.data)||void 0===n?void 0:n.fields}),v.updateFullDataSync||v.updateDataSync(e,i?null!==(r=null==h?void 0:h.filter((t=>t.hasOwnProperty(i))))&&void 0!==r?r:[]:null!=h?h:[])}null===(s=v.updateFullDataSync)||void 0===s||s.call(v,t)}!function(t,e){var i;const{viewWidth:o,viewHeight:n}=t;if(o<CB&&n<CB)return e.cacheCanvas=wB(t),void(e.isShareChartSpec||(null===(i=e.chartInstance)||void 0===i||i.release(),e.chartInstance=null,e.setAttribute("chartInstance",null)));const r=Math.ceil(n/CB),s=Math.ceil(o/CB),l=[];for(let e=0;e<r;e++)for(let i=0;i<s;i++){const r=i*CB,s=e*CB,a=r+CB>o?o:r+CB,h=s+CB>n?n:s+CB,d=a-r,c=h-s,u=new ze;u.setValue(r,s,a,h);const g=wB(t,!1,u);l.push({canvas:g,x:r,y:s,width:d,height:c})}e.cacheCanvas=l}(v.getStage(),t)}function yB(t){vB=!0,pB.length>0?requestAnimationFrame((()=>{const e=pB.splice(0,fB);gB.splice(0,fB),e.forEach((t=>{bB(t),t.addUpdateBoundTag()})),t.render(),yB(t)})):vB=!1}const CB=2e3;function wB(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=arguments.length>2?arguments[2]:void 0;if("released"===t.releaseStatus)return null;const o=t.window.getViewBoxTransform(),n=function(t){let e=arguments.length>2?arguments[2]:void 0;const i=t.window.getViewBoxTransform(),o=nn.get(cn),n=e?-e.x1:0,r=e?-e.y1:0,s=e?e.x2:t.viewWidth,l=e?e.y2:t.viewHeight,a=e?e.width():t.viewWidth,h=e?e.height():t.viewHeight;return o.create({viewBox:{x1:n,y1:r,x2:s,y2:l},width:a*i.a,height:h*i.d,dpr:t.window.dpr,canvasControled:!0,offscreen:!0,title:""}),t.renderTo(o),o}(t,e,i);n.setViewBoxTransform(o.a,o.b,o.c,o.d,0,0),t.renderTo(n);const r=n.getNativeHandler();return r.nativeCanvas?r.nativeCanvas:null}var xB=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s};const _B=Symbol.for("ChartRender");let SB=class extends pl{constructor(){super(...arguments),this.numberType=cB}drawShape(t,e,i,o,n,r,s,l){var a,h,d,c;const u=Rn(t,null==r?void 0:r.theme).group,{dataId:g,data:p,spec:f}=t.attribute,{width:v=u.width,height:m=u.height}=(t.getViewBox(),t.attribute),{table:b}=t.getRootNode(),{active:y,cacheCanvas:C,activeChartInstance:w}=t;if(!y&&C)rt(C)?C.forEach((t=>{const{x:i,y:o,width:n,height:r,canvas:s}=t;e.drawImage(s,i,o,n,r)})):e.drawImage(C,i,o,v,m);else if(w){if(b.options.specFormat){const e=b.options.specFormat(t.attribute.spec);if(e.needFormatSpec&&e.spec){const t=e.spec;return void w.updateSpecSync(t)}}const e=t.getViewBox();w.updateViewBox({x1:0,x2:e.x2-e.x1,y1:0,y2:e.y2-e.y1},!1,!1);const i=w.getStage();i.needRender=!0;const o=t.globalTransMatrix.clone(),n=t.stage.window.getViewBoxTransform().clone();if(n.multiply(o.a,o.b,o.c,o.d,o.e,o.f),i.window.setViewBoxTransform(n.a,n.b,n.c,n.d,n.e,n.f),"string"==typeof g)w.updateDataSync(g,null!=p?p:[]);else{const t=[];for(const e in g){const i=g[e],o=f.series.find((t=>{var i;return(null===(i=null==t?void 0:t.data)||void 0===i?void 0:i.id)===e}));t.push({id:e,values:i?null!==(a=null==p?void 0:p.filter((t=>t.hasOwnProperty(i))))&&void 0!==a?a:[]:null!=p?p:[],fields:null===(h=null==o?void 0:o.data)||void 0===h?void 0:h.fields}),w.updateFullDataSync||w.updateDataSync(e,i?null!==(d=null==p?void 0:p.filter((t=>t.hasOwnProperty(i))))&&void 0!==d?d:[]:null!=p?p:[])}null===(c=w.updateFullDataSync)||void 0===c||c.call(w,t)}}else b.internalProps.renderChartAsync?(-1===gB.indexOf(`${t.parent.col}+${t.parent.row}`)&&(gB.push(`${t.parent.col}+${t.parent.row}`),pB.push(t)),vB||yB(b)):bB(t)}draw(t,e,i,o){this._draw(t,{},!1,i,o)}};SB=xB([y()],SB);var AB=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s};let BB=class{constructor(){this.time=Ti.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,o,n,r,s,l,a,h,d,c,u){const{shape:g}=t.attribute;if("circle"===g){const{width:n=a.width,height:r=a.height}=t.attribute;e.beginPath(),e.arc(i+n/2,o+r/2,Math.min(n,r)/2,0,2*Math.PI),e.closePath(),e.save(),e.clip()}}};BB=AB([y()],BB);let RB=class{constructor(){this.time=Ti.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,o,n,r,s,l,a,h,d,c,u){const{shape:g}=t.attribute;"circle"===g&&e.restore()}};function MB(t,e,i,o){var n;const{highlightScope:r,disableHeader:s,cellPos:l}=t.hover,a=t.table,h=a.isHeader(e,i);if(h&&s)return;let d;if(r===OC.single&&l.col===e&&l.row===i?d="cellBgColor":r===OC.column&&l.col===e?d=l.col===e&&l.row===i?"cellBgColor":"inlineColumnBgColor":r===OC.row&&l.row===i?d=l.col===e&&l.row===i?"cellBgColor":"inlineRowBgColor":r===OC.cross&&(l.col===e&&l.row===i?d="cellBgColor":l.col===e?d="inlineColumnBgColor":l.row===i&&(d="inlineRowBgColor")),d){let t;if(h){const r=a.getHeaderDefine(e,i);t=null==r?void 0:r.disableHeaderHover,o.firstChild&&"axis"===o.firstChild.name&&(null===(n=a.options.hover)||void 0===n?void 0:n.disableAxisHover)&&(t=!0)}else{const o=a.getBodyColumnDefine(e,i);t=null==o?void 0:o.disableHover}t&&(d=void 0)}return d}function TB(t,e,i,o){const{highlightScope:n,disableHeader:r,cellPos:s,ranges:l}=t.select;let a;if(1===(null==l?void 0:l.length)&&l[0].end.col===l[0].start.col&&l[0].end.row===l[0].start.row){const o=t.table,l=o.isHeader(e,i);if(l&&r)return;if(n===OC.single&&s.col===e&&s.row===i?a="cellBgColor":n===OC.column&&s.col===e?a=s.col===e&&s.row===i?"cellBgColor":"inlineColumnBgColor":n===OC.row&&s.row===i?a=s.col===e&&s.row===i?"cellBgColor":"inlineRowBgColor":n===OC.cross&&(s.col===e&&s.row===i?a="cellBgColor":s.col===e?a="inlineColumnBgColor":s.row===i&&(a="inlineRowBgColor")),a){let t;if(l){const n=o.getHeaderDefine(e,i);t=null==n?void 0:n.disableHeaderSelect}else{const n=o.getBodyColumnDefine(e,i);t=null==n?void 0:n.disableSelect}t&&(a=void 0)}}else if("replace"===t.table.theme.selectionStyle.selectionFillMode)for(let t=0;t<l.length;t++){const o=l[t],n=Math.min(o.start.col,o.end.col),r=Math.max(o.start.col,o.end.col),s=Math.min(o.start.row,o.end.row),h=Math.max(o.start.row,o.end.row);if(n<=e&&s<=i&&r>=e&&h>=i){a="cellBgColor";break}}return a}function kB(t,e,i){const o=t.getBodyColumnDefine(e,i),n=t.isHeader(e,i);return!(!(null==o?void 0:o.disableSelect)||n)||!(!n||!(null==o?void 0:o.disableHeaderSelect))}RB=AB([y()],RB);var LB=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s};let PB=class{constructor(){this.time=Ti.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,o,n,r,s,l,a,h,d,c,u){const{stroke:g=a.stroke,strokeArrayWidth:p=a.strokeArrayWidth,strokeArrayColor:f=a.strokeArrayColor}=t.attribute;g&&(Array.isArray(p)||Array.isArray(f))&&(u.doStroke=!1)}};PB=LB([y()],PB);let EB=class{constructor(){this.time=Ti.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,o,n,r,s,l,a,h,d,c){var u,g;const{stroke:p=a.stroke,strokeArrayColor:f=a.strokeArrayColor,strokeArrayWidth:v=a.strokeArrayWidth,lineWidth:m=a.lineWidth,strokeColor:b=a.stroke,cornerRadius:y=a.cornerRadius}=t.attribute;let C,w,{width:x=a.width,height:_=a.height}=t.attribute;if(p&&(Array.isArray(v)||0!==m)&&(Array.isArray(f)||Array.isArray(v))){if("number"==typeof m&&1&m||Array.isArray(v)&&v.some((t=>1&t))){const e=t.stage.table;if(!e)return;const n="bottom-right"===(null===(u=null==e?void 0:e.theme)||void 0===u?void 0:u.cellBorderClipDirection);if(n){if(i=Math.floor(i)-.5,o=Math.floor(o)-.5,"cell"===t.role){const e=t.col,n=t.row;0===e&&(i+=1),0===n&&(o+=1)}}else i=Math.floor(i)+.5,o=Math.floor(o)+.5;(null===(g=e.options.customConfig)||void 0===g?void 0:g._disableColumnAndRowSizeRound)&&(x=Math.round(x),_=Math.round(_));const{width:r,height:s}=UB(t,Math.ceil(x),Math.ceil(_),n);C=r,w=s}else C=Math.ceil(x),w=Math.ceil(_);0===y||rt(y)&&y.every((t=>0===t))?FB(t,e,i,o,a,p,v||m,f||b,C,w):(e.beginPath(),Fl(e,i,o,C,w,y,new Array(4).fill(0).map(((n,r)=>(n,s,l,h)=>{KB(r,n,s,l,h,t,e,i,o,a,p,v||m,f||b,C,w)}))),e.stroke())}}};function HB(t){if(!Array.isArray(t))return{isSplitDraw:!1,width:t};let e;for(let i=0;i<t.length;i++){const o=t[i];if(o)if(e){if(o!==e)return{isSplitDraw:!0}}else e=o}return{isSplitDraw:!1,width:e}}function FB(t,e,i,o,n,r,s,l,a,h,d,c){var u,g,p,f;const v=HB(s),m=!Array.isArray(s),b=!Array.isArray(r),y=Array.isArray(c),C=Array.isArray(l)||v.isSplitDraw;e.setStrokeStyle(t,t.attribute,i,o,n);const{lineDash:w=n.lineDash}=t.attribute;let x=!1;w.length&&w.some((t=>Array.isArray(t)))&&(x=!0),e.beginPath(),e.moveTo(i,o);const _=(b||r[0])&&(m||s[0]),S=(b||r[1])&&(m||s[1]),A=(b||r[2])&&(m||s[2]),B=(b||r[3])&&(m||s[3]);if(_){const t=(m?v.width:s[0])/2,n=(m?v.width:s[0])/2;y&&Array.isArray(c[0])?(e.moveTo(i-t+(a+t+n)*c[0][0],o),e.lineTo(i-t+(a+t+n)*(c[0][1]-c[0][0]),o),e.moveTo(i+a+n,o)):(e.moveTo(i-t,o),e.lineTo(i+a+n,o)),(C||x)&&(l&&l[0]?e.strokeStyle=l[0]:e.strokeStyle="transparent",m||(e.lineWidth=s[0]),e.lineDashOffset=e.currentMatrix.e/e.currentMatrix.a,x&&e.setLineDash(null!==(u=w[0])&&void 0!==u?u:[]),e.stroke(),e.beginPath(),e.moveTo(i+a,o))}else e.moveTo(i+a,o);if(S){const t=(m?v.width:s[1])/2,n=(m?v.width:s[1])/2;y&&Array.isArray(c[1])?(e.moveTo(i+a,o-t+h*c[1][0]),e.lineTo(i+a,o-t+(h+t+n)*(c[1][1]-c[1][0])),e.moveTo(i+a,o+h+n)):(e.moveTo(i+a,o-t),e.lineTo(i+a,o+h+n)),(C||x)&&(l&&l[1]?e.strokeStyle=l[1]:e.strokeStyle="transparent",m||(e.lineWidth=s[1]),e.lineDashOffset=e.currentMatrix.f/e.currentMatrix.d,x&&e.setLineDash(null!==(g=w[1])&&void 0!==g?g:[]),e.stroke(),e.beginPath(),e.moveTo(i+a,o+h))}else e.moveTo(i+a,o+h);if(A){const t=(m?v.width:s[2])/2,n=(m?v.width:s[2])/2;y&&Array.isArray(c[2])?(e.moveTo(i-t+(a+t+n)*c[2][0],o+h),e.lineTo(i-t+(a+t+n)*(c[2][1]-c[2][0]),o+h),e.moveTo(i-t,o+h)):(e.moveTo(i-t,o+h),e.lineTo(i+a+n,o+h)),(C||x)&&(l&&l[2]?e.strokeStyle=l[2]:e.strokeStyle="transparent",m||(e.lineWidth=s[2]),e.lineDashOffset=e.currentMatrix.e/e.currentMatrix.a,x&&e.setLineDash(null!==(p=w[2])&&void 0!==p?p:[]),e.stroke(),e.beginPath(),e.moveTo(i,o+h))}else e.moveTo(i,o+h);if(B){const t=(m?v.width:s[3])/2,n=(m?v.width:s[3])/2;y&&Array.isArray(c[3])?(e.moveTo(i,o-t+(h+t+n)*c[3][0]),e.lineTo(i,o-t+(h+t+n)*(c[3][1]-c[3][0])),e.moveTo(i,o-t)):(e.moveTo(i,o-t),e.lineTo(i,o+h+n)),(C||x)&&(l&&l[3]?e.strokeStyle=l[3]:e.strokeStyle="transparent",m||(e.lineWidth=s[3]),e.lineDashOffset=e.currentMatrix.f/e.currentMatrix.d,x&&e.setLineDash(null!==(f=w[3])&&void 0!==f?f:[]),e.stroke(),e.beginPath(),e.moveTo(i,o))}else e.moveTo(i,o);C||x||(!m&&v.width&&(e.lineWidth=v.width),e.stroke()),e.lineDashOffset=0,e.setLineDash([])}EB=LB([y()],EB);let zB=class{constructor(){this.time=Ti.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,o,n,r,s,l,a,h,d,c,u){var g;const{lineDash:p=a.lineDash,stroke:f=a.stroke,strokeArrayColor:v=a.strokeArrayColor,strokeArrayWidth:m=a.strokeArrayWidth}=t.attribute;f&&Array.isArray(p)&&p.length&&(null===(g=p[0])||void 0===g?void 0:g.length)&&!Array.isArray(v)&&!Array.isArray(m)&&(u.doStroke=!1)}};zB=LB([y()],zB);let IB=class{constructor(){this.time=Ti.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,o,n,r,s,l,a,h,d,c){var u,g,p,f,v,m;const{lineDash:b=a.lineDash,stroke:y=a.stroke,strokeArrayColor:C=a.strokeArrayColor,strokeArrayWidth:w=a.strokeArrayWidth,lineWidth:x=a.lineWidth}=t.attribute;if(!y||!(Array.isArray(b)&&b.length&&(null===(u=b[0])||void 0===u?void 0:u.length))||Array.isArray(C)||Array.isArray(w))return;const _=t.stage.table;if(!_)return;const S=rt(b[0])?function(t){return 1===t.length?[t[0],t[0],t[0],t[0]]:2===t.length?[t[0],t[1],t[0],t[1]]:t}(b):[b,b,b,b];let A,B,{width:R=a.width,height:M=a.height}=t.attribute;if((null===(g=_.options.customConfig)||void 0===g?void 0:g._disableColumnAndRowSizeRound)?(R=Math.round(R),M=Math.round(M)):(R=Math.ceil(R),M=Math.ceil(M)),1&x){const e="bottom-right"===_.theme.cellBorderClipDirection,n=0,r=0;e?(i=Math.floor(i)-.5,o=Math.floor(o)-.5,"cell"===t.role&&(0===t.col&&(i+=1),0===t.row&&(o+=1))):(i=Math.floor(i)+.5,o=Math.floor(o)+.5);const{width:s,height:l}=UB(t,Math.ceil(R+n),Math.ceil(M+r),e);A=s,B=l}else A=Math.ceil(R),B=Math.ceil(M);e.setStrokeStyle(t,t.attribute,i,o,a),e.beginPath(),e.moveTo(i,o),e.lineTo(i+A,o),e.lineDashOffset=e.currentMatrix.e/e.currentMatrix.a,e.setLineDash(null!==(p=S[0])&&void 0!==p?p:[]),e.stroke(),e.beginPath(),e.moveTo(i+A,o),e.lineTo(i+A,o+B),e.lineDashOffset=e.currentMatrix.f/e.currentMatrix.d,e.setLineDash(null!==(f=S[1])&&void 0!==f?f:[]),e.stroke(),e.beginPath(),e.moveTo(i,o+B),e.lineTo(i+A,o+B),e.lineDashOffset=e.currentMatrix.e/e.currentMatrix.a,e.setLineDash(null!==(v=S[2])&&void 0!==v?v:[]),e.stroke(),e.beginPath(),e.moveTo(i,o),e.lineTo(i,o+B),e.lineDashOffset=e.currentMatrix.f/e.currentMatrix.d,e.setLineDash(null!==(m=S[3])&&void 0!==m?m:[]),e.stroke(),e.lineDashOffset=0,e.setLineDash([])}};IB=LB([y()],IB);let OB=class{constructor(){this.time=Ti.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,o,n,r,s,l,a,h,d,c,u){const{lineWidth:g=a.lineWidth,stroke:p=a.stroke,lineDash:f=a.lineDash,strokeArrayWidth:v=a.strokeArrayWidth,strokeArrayColor:m=a.strokeArrayColor,notAdjustPos:b}=t.attribute;!0!==b&&p&&Array.isArray(f)&&!f.length&&!Array.isArray(m)&&!Array.isArray(v)&&1&g&&(u.doStroke=!1)}};OB=LB([y()],OB);let DB=class{constructor(){this.time=Ti.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,o,n,r,s,l,a,h,d,c){var u,g;const{lineWidth:p=a.lineWidth,stroke:f=a.stroke,lineDash:v=a.lineDash,strokeArrayWidth:m=a.strokeArrayWidth,strokeArrayColor:b=a.strokeArrayColor,notAdjustPos:y,cornerRadius:C=a.cornerRadius}=t.attribute;let{width:w=a.width,height:x=a.height}=t.attribute;if(!0!==y&&f&&Array.isArray(v)&&!v.length&&!Array.isArray(b)&&!Array.isArray(m)&&1&p){const n=t.stage.table;if(!n)return;(null===(u=n.options.customConfig)||void 0===u?void 0:u._disableColumnAndRowSizeRound)&&(w=Math.round(w),x=Math.round(x)),e.beginPath();const r="bottom-right"===(null===(g=null==n?void 0:n.theme)||void 0===g?void 0:g.cellBorderClipDirection),s=0,l=0;r?(i=Math.floor(i)-.5,o=Math.floor(o)-.5,"cell"===t.role&&(0===t.col&&(i+=1),0===t.row&&(o+=1))):(i=Math.floor(i)+.5,o=Math.floor(o)+.5);const{width:h,height:d}=UB(t,Math.ceil(w),Math.ceil(x),r);C?Fl(e,i,o,h+s,d+l,C):e.rect(i,o,h,d),e.setStrokeStyle(t,t.attribute,i,o,a),e.stroke()}}};DB=LB([y()],DB);let WB=class{constructor(){this.time=Ti.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,o,n,r,s,l,a,h,d,c,u){if("cell"===t.role){const e=t.stage.table;if(e){const i=function(t,e){var i,o,n,r,s,l,a,h,d,c,u;let g,p;if("cell"===t.role&&Q(t.mergeStartCol)&&Q(t.mergeStartRow)&&Q(t.mergeEndCol)&&Q(t.mergeEndRow)){const{colStart:i,colEnd:o,rowStart:n,rowEnd:r}=EA(t,e.scenegraph);for(let t=i;t<=o;t++)for(let i=n;i<=r;i++){const o=TB(e.stateManager,t,i);!o||g&&"cellBgColor"!==o||(g=o)}}else"cell"===t.role&&(g=TB(e.stateManager,t.col,t.row));if(!g)return;const f=e.internalProps.layoutMap;return f.isCornerHeader(t.col,t.row)?p=(null===(i=e.theme.cornerHeaderStyle)||void 0===i?void 0:i.select)||(null===(o=e.theme.headerStyle)||void 0===o?void 0:o.select):f.isColumnHeader(t.col,t.row)?p=null===(n=e.theme.headerStyle)||void 0===n?void 0:n.select:f.isRowHeader(t.col,t.row)?p=null===(r=e.theme.rowHeaderStyle)||void 0===r?void 0:r.select:f.isBottomFrozenRow(t.col,t.row)?p=(null===(s=e.theme.bottomFrozenStyle)||void 0===s?void 0:s.select)||(e.isListTable()?null===(l=e.theme.bodyStyle)||void 0===l?void 0:l.select:null===(a=e.theme.headerStyle)||void 0===a?void 0:a.select):f.isRightFrozenColumn(t.col,t.row)?p=(null===(h=e.theme.rightFrozenStyle)||void 0===h?void 0:h.select)||(e.isListTable()?null===(d=e.theme.bodyStyle)||void 0===d?void 0:d.select:null===(c=e.theme.rowHeaderStyle)||void 0===c?void 0:c.select):e.isHeader(t.col,t.row)||(p=null===(u=e.theme.bodyStyle)||void 0===u?void 0:u.select),DS(g,p,t.col,t.row,e)}(t,e);if(i)t.attribute._vtableHightLightFill=i;else if(e.stateManager.interactionState!==IC.scrolling){const i=function(t,e){var i,o,n,r,s,l,a,h,d,c,u;let g,p;if("cell"===t.role&&Q(t.mergeStartCol)&&Q(t.mergeStartRow)&&Q(t.mergeEndCol)&&Q(t.mergeEndRow)){const{colStart:i,colEnd:o,rowStart:n,rowEnd:r}=EA(t,e.scenegraph);for(let s=i;s<=o;s++)for(let i=n;i<=r;i++){const o=MB(e.stateManager,s,i,t);!o||g&&"cellBgColor"!==o||(g=o)}}else"cell"===t.role&&(g=MB(e.stateManager,t.col,t.row,t));if(!g)return;const f=e.internalProps.layoutMap;return f.isCornerHeader(t.col,t.row)?p=(null===(i=e.theme.cornerHeaderStyle)||void 0===i?void 0:i.hover)||(null===(o=e.theme.headerStyle)||void 0===o?void 0:o.hover):f.isColumnHeader(t.col,t.row)?p=null===(n=e.theme.headerStyle)||void 0===n?void 0:n.hover:f.isRowHeader(t.col,t.row)?p=null===(r=e.theme.rowHeaderStyle)||void 0===r?void 0:r.hover:f.isBottomFrozenRow(t.col,t.row)?p=(null===(s=e.theme.bottomFrozenStyle)||void 0===s?void 0:s.hover)||(e.isListTable()?null===(l=e.theme.bodyStyle)||void 0===l?void 0:l.hover:null===(a=e.theme.headerStyle)||void 0===a?void 0:a.hover):f.isRightFrozenColumn(t.col,t.row)?p=(null===(h=e.theme.rightFrozenStyle)||void 0===h?void 0:h.hover)||(e.isListTable()?null===(d=e.theme.bodyStyle)||void 0===d?void 0:d.hover:null===(c=e.theme.rowHeaderStyle)||void 0===c?void 0:c.hover):e.isHeader(t.col,t.row)||(p=null===(u=e.theme.bodyStyle)||void 0===u?void 0:u.hover),DS(g,p,t.col,t.row,e)}(t,e);i&&(t.attribute._vtableHightLightFill=i)}}}}};WB=LB([y()],WB);let NB=class{constructor(){this.time=Ti.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,o,n,r,s,l,a,h,d,c){if(t.attribute._vtableHightLightFill)if(d);else if(s){const n=t.attribute.fill;t.attribute.fill=t.attribute._vtableHightLightFill,e.setCommonStyle(t,t.attribute,i,o,a),e.fill(),t.attribute.fill=n,t.attribute._vtableHightLightFill=void 0}}};NB=LB([y()],NB);let GB=class{constructor(){this.time=Ti.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,o,n,r,s,l,a,h,d,c,u){var g,p,f,v,m,b;const y=t.stage.table;y&&("body"===t.role?VB(e,-(null!==(g=t.attribute.x)&&void 0!==g?g:0)+y.getFrozenColsWidth(),-(null!==(p=t.attribute.y)&&void 0!==p?p:0)+y.getFrozenRowsHeight(),t.parent.attribute.width-y.getFrozenColsWidth()-y.getRightFrozenColsWidth(),t.parent.attribute.height-y.getFrozenRowsHeight()-y.getBottomFrozenRowsHeight()):"row-header"===t.role?VB(e,0,-(null!==(f=t.attribute.y)&&void 0!==f?f:0)+y.getFrozenRowsHeight(),y.getFrozenColsWidth(),t.parent.attribute.height-y.getFrozenRowsHeight()-y.getBottomFrozenRowsHeight()):"col-header"===t.role?VB(e,-(null!==(v=t.attribute.x)&&void 0!==v?v:0)+y.getFrozenColsWidth(),0,t.parent.attribute.width-y.getFrozenColsWidth()-y.getRightFrozenColsWidth(),y.getFrozenRowsHeight()):"right-frozen"===t.role?VB(e,0,-(null!==(m=t.attribute.y)&&void 0!==m?m:0)+y.getFrozenRowsHeight(),y.getRightFrozenColsWidth(),t.parent.attribute.height-y.getFrozenRowsHeight()-y.getBottomFrozenRowsHeight()):"bottom-frozen"===t.role?VB(e,-(null!==(b=t.attribute.x)&&void 0!==b?b:0)+y.getFrozenColsWidth(),0,t.parent.attribute.width-y.getFrozenColsWidth()-y.getRightFrozenColsWidth(),y.getBottomFrozenRowsHeight()):"corner-header"===t.role?VB(e,0,0,y.getFrozenColsWidth(),y.getFrozenRowsHeight()):"corner-right-top-header"===t.role?VB(e,0,0,y.getRightFrozenColsWidth(),y.getFrozenRowsHeight()):"corner-right-bottom-header"===t.role?VB(e,0,0,y.getRightFrozenColsWidth(),y.getBottomFrozenRowsHeight()):"corner-left-bottom-header"===t.role&&VB(e,0,0,y.getFrozenColsWidth(),y.getBottomFrozenRowsHeight()))}};GB=LB([y()],GB);const jB=Math.pow(2,24);function VB(t,e,i,o,n){t.beginPath();const r=t.applyedMatrix;Math.abs(r.f)>jB||Math.abs(r.g)>jB?t.rect(e-jB,i-jB,o+2*jB,n+2*jB):t.rect(e,i,o,n)}function UB(t,e,i,o){const n=t.stage.table;if(!n)return{width:e,height:i};if("cell"===t.role){let r=t.col,s=t.row;const l=Mx(n,r,s);l&&(r=l.end.col,s=l.end.row),r!==n.colCount-1||o?(r===n.frozenColCount-1&&n.scrollLeft&&!o||0===r&&o)&&(e-=1):e-=1,s!==n.rowCount-1||o?(s===n.frozenRowCount-1&&n.scrollTop&&!o||0===s&&o)&&(i-=1):i-=1}else"corner-frozen"===t.role&&(n.scrollLeft&&!o&&(e-=1),n.scrollTop&&!o&&(i-=1));return{width:e,height:i}}var $B=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s};let XB=class{constructor(){this.time=Ti.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,o,n,r,s,l,a,h,d,c,u){const{stroke:g=a.stroke,strokeArrayWidth:p=a.strokeArrayWidth,strokeArrayColor:f=a.strokeArrayColor}=t.attribute;g&&(Array.isArray(g)||Array.isArray(p)||Array.isArray(f))&&(u.doStroke=!1)}};XB=$B([y()],XB);let YB=class{constructor(){this.time=Ti.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,o,n,r,s,l,a,h,d,c){const{width:u=a.width,height:g=a.height,stroke:p=a.stroke,strokeArrayColor:f=a.strokeArrayColor,strokeArrayWidth:v=a.strokeArrayWidth,lineWidth:m=a.lineWidth,strokeColor:b=a.stroke,cornerRadius:y=a.cornerRadius}=t.attribute;if(p&&(Array.isArray(v)||0!==m)&&(Array.isArray(p)||Array.isArray(f)||Array.isArray(v))){const n=0,r=0;"border-rect"!==t.name&&"table-border-rect"!==t.name&&("number"==typeof m&&1&m||Array.isArray(v)&&v.some((t=>1&t)))&&(i=Math.floor(i)+.5,o=Math.floor(o)+.5),0===y||rt(y)&&y.every((t=>0===t))?FB(t,e,i,o,a,p,v||m,f||b,Math.ceil(u+n),Math.ceil(g+r)):(e.beginPath(),Fl(e,i,o,u,g,y,new Array(4).fill(0).map(((s,l)=>(s,h,d,c)=>{KB(l,s,h,d,c,t,e,i,o,a,p,v||m,f||b,Math.ceil(u+n),Math.ceil(g+r))}))),e.stroke())}}};function KB(t,e,i,o,n,r,s,l,a,h,d,c,u,g,p){var f,v,m,b;const y=r,C=h,w=HB(c),x=!Array.isArray(c),_=!Array.isArray(d),S=Array.isArray(u)||w.isSplitDraw;s.setStrokeStyle(r,r.attribute,l,a,h);const{lineDash:A=C.lineDash}=y.attribute;let B=!1;A.length&&A.some((t=>Array.isArray(t)))&&(B=!0),s.moveTo(l,a);const R=(_||d[0])&&(x||c[0]),M=(_||d[1])&&(x||c[1]),T=(_||d[2])&&(x||c[2]),k=(_||d[3])&&(x||c[3]);R&&0===t?(x?w.width:c[0],x?w.width:c[0],s.moveTo(e,i),s.lineTo(o,n),(S||B)&&(u&&u[0]?s.strokeStyle=u[0]:s.strokeStyle="transparent",x||(s.lineWidth=c[0]),s.lineDashOffset=s.currentMatrix.e/s.currentMatrix.a,B&&s.setLineDash(null!==(f=A[0])&&void 0!==f?f:[]),s.stroke(),s.beginPath())):0===t&&s.moveTo(l+g,a),M&&1===t?(x?w.width:c[1],x?w.width:c[1],s.moveTo(e,i),s.lineTo(o,n),(S||B)&&(u&&u[1]?s.strokeStyle=u[1]:s.strokeStyle="transparent",x||(s.lineWidth=c[1]),s.lineDashOffset=s.currentMatrix.f/s.currentMatrix.d,B&&s.setLineDash(null!==(v=A[1])&&void 0!==v?v:[]),s.stroke(),s.beginPath(),s.moveTo(l+g,a+p))):1===t&&s.moveTo(l+g,a+p),T&&2===t?(x?w.width:c[2],x?w.width:c[2],s.moveTo(e,i),s.lineTo(o,n),(S||B)&&(u&&u[2]?s.strokeStyle=u[2]:s.strokeStyle="transparent",x||(s.lineWidth=c[2]),s.lineDashOffset=s.currentMatrix.e/s.currentMatrix.a,B&&s.setLineDash(null!==(m=A[2])&&void 0!==m?m:[]),s.stroke(),s.beginPath(),s.moveTo(l,a+p))):2===t&&s.moveTo(l,a+p),k&&3===t?(x?w.width:c[3],x?w.width:c[3],s.moveTo(e,i),s.lineTo(o,n),(S||B)&&(u&&u[3]?s.strokeStyle=u[3]:s.strokeStyle="transparent",x||(s.lineWidth=c[3]),s.lineDashOffset=s.currentMatrix.f/s.currentMatrix.d,B&&s.setLineDash(null!==(b=A[3])&&void 0!==b?b:[]),s.stroke(),s.beginPath(),s.moveTo(l,a))):3===t&&s.moveTo(l,a),S||B||(!x&&w.width&&(s.lineWidth=w.width),s.stroke()),s.lineDashOffset=0,s.setLineDash([]),s.closePath()}YB=$B([y()],YB);var qB=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s};let ZB,JB=class{constructor(){this.order=1,this.interceptors=[new QB]}afterDrawItem(t,e,i,o,n){for(let r=0;r<this.interceptors.length;r++)if(this.interceptors[r].afterDrawItem&&this.interceptors[r].afterDrawItem(t,e,i,o,n))return!0;return!1}beforeDrawItem(t,e,i,o,n){if((!t.in3dMode||i.in3dInterceptor)&&!t.shadowRoot&&!(t.baseGraphic||t.attribute.globalZIndex||t.interactiveGraphic))return!1;for(let r=0;r<this.interceptors.length;r++)if(this.interceptors[r].beforeDrawItem&&this.interceptors[r].beforeDrawItem(t,e,i,o,n))return!0;return!1}};JB=qB([y()],JB);class QB{constructor(){this.order=1}afterDrawItem(t,e,i,o,n){return"image"===t.type&&this.drawItem(t,e,i,o,n),!1}drawItem(t,e,i,o,n){const{image:r}=t.attribute;if(!r||!t.resources)return!1;if("loading"!==t.resources.get(r).state)return!1;if(!ZB){const t=FS(),e=t.loading_pic.svg,i=t.loading_pic.width,o=t.loading_pic.height;ZB=cc({width:i,height:o,image:e})}const{image:s}=ZB.attribute;if(!r||!ZB.resources)return!1;const l=ZB.resources.get(s);if("success"!==l.state)return!1;const{context:a}=i;a.highPerformanceSave(),t.parent&&a.setTransformFromMatrix(t.parent.globalTransMatrix,!0),t.glyphHost&&t.glyphHost.parent&&a.setTransformFromMatrix(t.glyphHost.parent.globalTransMatrix,!0);const h=t.AABBBounds,{width:d,height:c}=IS(l.data.width,l.data.height,h.width(),h.height());return a.drawImage(l.data,h.x1+(h.width()-d)/2,h.y1+(h.height()-c)/2,d,c),a.highPerformanceRestore(),!0}}var tR=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s};let eR=class{constructor(){this.time=Ti.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,o,n,r,s,l,a,h,d,c,u){var g,p;const{text:f,underline:v=a.underline,lineThrough:m=a.lineThrough,direction:b=a.direction,whiteSpace:y=a.whiteSpace,fontSize:C=a.fontSize,verticalMode:w=a.verticalMode,ellipsis:x=a.ellipsis,textAlign:_=a.textAlign,textBaseline:S=a.textBaseline,x:A=a.x,y:B=a.y}=t.attribute;let R=!1;if(Array.isArray(t)){const e=null===(g=t.cache)||void 0===g?void 0:g.layoutData;x&&e&&e.lines.every((t=>""===t.str))&&(R=!0)}else{const{cache:e}=t;x&&e&&""===e.clipedText&&0===e.clipedWidth&&(R=!0)}if(!R)return;const M=nt(x)?x:"...",T=null!==(p=ur(t.attribute.lineHeight,C))&&void 0!==p?p:C;let k=0;T!==C&&("top"===S?k=(T-C)/2:"middle"===S||"bottom"===S&&(k=-(T-C)/2)),r&&(c?c(e,t.attribute,a):l&&(e.setStrokeStyle(t,t.attribute,A-i,B-o,a),e.strokeText(M,A,B+k))),n&&(d?d(e,t.attribute,a):s&&(e.setCommonStyle(t,t.attribute,A-i,B-o,a),e.fillText(M,A,B+k),this.drawUnderLine(v,m,t,A,B+k,0,a,e,M)))}drawUnderLine(t,e,i,o,n,r,s,l,a){if(e+t<=0)return;const{textAlign:h=s.textAlign,textBaseline:d=s.textBaseline,fontSize:c=s.fontSize,fontFamily:u=s.fontFamily,fontWeight:g=s.fontWeight,fontStyle:p=s.fontStyle,fill:f=s.fill,opacity:v=s.opacity,underlineOffset:m=s.underlineOffset,underlineDash:b=s.underlineDash,fillOpacity:y=s.fillOpacity}=i.attribute;if(!t&&!e)return;const C=xA.measureTextWidth(a,{fontSize:c,fontFamily:u,fontWeight:g,fontStyle:p}),w=Js(h,C),x=Qs(d,c,c),_={lineWidth:0,stroke:f,opacity:v,strokeOpacity:y};if(t){_.lineWidth=t,l.setStrokeStyle(i,_,o,n,s),l.setLineDash(b),l.beginPath();const e=n+x+c+m;l.moveTo(o+w,e,r),l.lineTo(o+w+C,e,r),l.stroke()}if(e){_.lineWidth=e,l.setStrokeStyle(i,_,o,n,s),l.beginPath();const t=n+x+c/2;l.moveTo(o+w,t,r),l.lineTo(o+w+C,t,r),l.stroke()}}};eR=tR([y()],eR);var iR=new s(((t,e,i,o)=>{i(Ol)?o(Ol).to(XB).inSingletonScope():(t(XB).toSelf().inSingletonScope(),t(Ys).toService(XB)),i(Dl)?o(Dl).to(YB).inSingletonScope():(t(YB).toSelf().inSingletonScope(),t(Ys).toService(YB)),t(SB).toSelf().inSingletonScope(),t(_B).to(SB),t(rh).to(SB),t(BB).toSelf().inSingletonScope(),t(Us).toService(BB),t(RB).toSelf().inSingletonScope(),t(Us).toService(RB),t(WB).toSelf().inSingletonScope(),t(Vs).toService(WB),t(NB).toSelf().inSingletonScope(),t(Vs).toService(NB),t(EB).toSelf().inSingletonScope(),t(Vs).toService(EB),t(PB).toSelf().inSingletonScope(),t(Vs).toService(PB),t(zB).toSelf().inSingletonScope(),t(Vs).toService(zB),t(IB).toSelf().inSingletonScope(),t(Vs).toService(IB),t(OB).toSelf().inSingletonScope(),t(Vs).toService(OB),t(DB).toSelf().inSingletonScope(),t(Vs).toService(DB),t(GB).toSelf().inSingletonScope(),t(Vs).toService(GB),t(JB).toSelf().inSingletonScope(),t(yh).toService(JB),t(eR).toSelf().inSingletonScope(),t(qs).toService(eR)}));function oR(t,e,i,o){var n,r,s,l,a,h,d,c;t.internalProps.columnWidthConfig&&t._parseColumnWidthConfig(t.internalProps.columnWidthConfig),e=null!=e?e:0,i=null!=i?i:t.colCount-1,0===e&&i===t.colCount-1&&t._clearColRangeWidthsMap();const u=t.internalProps.layoutMap;t.isPivotTable()&&(u.enableUseGetBodyCache(),u.enableUseHeaderPathCache());const g=[],p=[];if(o)for(let e=0;e<t.colCount;e++)g[e]=t.getColWidth(e);for(let a=e;a<=i;a++){let e;if(t.internalProps.transpose||"only-header"!==(null===(r=null===(n=t.internalProps.layoutMap.columnObjects)||void 0===n?void 0:n[a])||void 0===r?void 0:r.columnWidthComputeMode)&&"only-header"!==t.columnWidthComputeMode||!("showHeader"in t.internalProps.layoutMap))e=t.internalProps.transpose||"only-body"!==(null===(l=null===(s=t.internalProps.layoutMap.columnObjects)||void 0===s?void 0:s[a])||void 0===l?void 0:l.columnWidthComputeMode)&&"only-body"!==t.columnWidthComputeMode?nR(a,0,t.rowCount-1,t):nR(a,t.internalProps.layoutMap.getBodyRange().start.row,t.internalProps.layoutMap.getBodyRange().end.row,t);else{const i=t.internalProps.layoutMap.showHeader;t.internalProps.layoutMap.showHeader=!0,e=nR(a,0,t.internalProps.layoutMap.headerLevelCount-1,t),t.internalProps.layoutMap.showHeader=i}t._setColContentWidth(a,e),t.getColWidth(a)!==e&&t._clearColRangeWidthsMap(a),o?p[a]=Math.round(t._adjustColWidth(a,e)):t._setColWidth(a,t._adjustColWidth(a,e),!1,!0)}if("adaptive"===t.widthMode){t._clearColRangeWidthsMap();const e=t.tableNoFrameWidth;let i=0,n=0,r=t.colCount;if("only-body"===t.widthAdaptiveMode){for(let e=0;e<t.colCount;e++){const n=o&&null!==(a=p[e])&&void 0!==a?a:t.getColWidth(e);(e<t.rowHeaderLevelCount||t.isPivotChart()&&e>=t.colCount-t.rightFrozenColCount)&&(i+=n)}n=t.rowHeaderLevelCount,r=t.isPivotChart()?t.colCount-t.rightFrozenColCount:t.colCount}hR(e-i,n,r,o,p,t)}else if(t.autoFillWidth){t._clearColRangeWidthsMap();const e=t.tableNoFrameWidth;let i=0,n=0;for(let e=0;e<t.colCount;e++){const r=o&&null!==(h=p[e])&&void 0!==h?h:t.getColWidth(e);(e<t.rowHeaderLevelCount||t.isPivotChart()&&e>=t.colCount-t.rightFrozenColCount)&&(i+=r),n+=r}n<e&&n>i&&hR(e-i,t.rowHeaderLevelCount,t.isPivotChart()?t.colCount-t.rightFrozenColCount:t.colCount,o,p,t)}if(o){for(let e=0;e<t.colCount;e++){const i=null!==(c=null!==(d=p[e])&&void 0!==d?d:t.getColWidth(e))&&void 0!==c?c:t.getColWidth(e);i!==g[e]&&t._setColWidth(e,i,!1,!0)}t.stateManager.checkFrozen();for(let e=0;e<t.colCount;e++){const i=t.getColWidth(e);i!==g[e]&&t.scenegraph.updateColWidth(e,i-g[e],!0,!0)}t.scenegraph.updateContainer(!0)}t.isPivotTable()&&(u.disableUseGetBodyCache(),u.disableUseHeaderPathCache())}function nR(t,e,i,o){let n=arguments.length>4&&void 0!==arguments[4]&&arguments[4],r=function(t,e){const i=e.getColWidthDefined(t);return e.internalProps._widthResizedColMap.has(t)?e.getColWidth(t):i}(t,o);return o.internalProps.transpose&&"auto"===r&&("only-header"===o.columnWidthComputeMode&&t>=o.rowHeaderLevelCount||"only-body"===o.columnWidthComputeMode&&t<o.rowHeaderLevelCount)&&(r=o.getDefaultColumnWidth(t)),n&&!o.internalProps.transpose?rR(r,t,e,i,n,o):"number"==typeof r?r:"auto"!==r&&"string"==typeof r?o._adjustColWidth(t,o._colWidthDefineToPxWidth(r)):rR(r,t,e,i,n,o)}function rR(t,e,i,o,n,r){var s,l,a,h,d;let c=0,u=1,g=1;if(o-i>5e3&&(g=Math.ceil((o-i)/5e3)),r.isPivotChart()&&e>=r.rowHeaderLevelCount&&e<r.colCount-r.rightFrozenColCount){if(r.internalProps.layoutMap.indicatorsAsCol)return r.defaultColWidth;{const t=r.internalProps.layoutMap.getOptimunWidthForChart(e);if(t>0)return t}}for(let p=i;p<=o;p+=u){if(r.isPivotChart()){const t=r.internalProps.layoutMap,i=t.getAxisConfigInPivotChart(e,p);if(i){const t=Tx.getFunction("computeAxisComponentWidth")(i,r);if("number"==typeof t){c=Math.max(t,c);continue}}else if(t.isLeftBottomCorner(e,p)||t.isRightTopCorner(e,p)||t.isRightBottomCorner(e,p))continue}const i=sR(e,p,r);if(i&&(c=Math.max(i.width,c),!i.renderDefault))continue;const o=t;if("number"==typeof o&&"standard"===r.widthMode&&!n){c=Math.max(o,c);continue}const f=r.isHeader(e,p)?null===(s=r._getHeaderLayoutMap(e,p))||void 0===s?void 0:s.headerType:r.getBodyColumnType(e,p);if(Q(f)&&"text"!==f&&"link"!==f&&"progressbar"!==f&&"checkbox"!==f&&"radio"!==f){c=Math.max(c,r.getColWidthDefinedNumber(e)||0);continue}let v=0;const m=r.internalProps.layoutMap;if(m.isHeader(e,p)){const t=m.getHeader(e,p);if("only-body"===(null===(l=null==t?void 0:t.define)||void 0===l?void 0:l.columnWidthComputeMode))continue;Q(null==t?void 0:t.hierarchyLevel)&&(v=(null!==(a=t.hierarchyLevel)&&void 0!==a?a:0)*(null!==(h=m.rowHierarchyIndent)&&void 0!==h?h:0),m.rowHierarchyTextStartAlignment&&!r.internalProps.headerHelper.getHierarchyIcon(e,p)&&(v+=r.internalProps.headerHelper.getHierarchyIconWidth()))}else if(r.isListTable()){u=g;const t=r.getBodyColumnDefine(e,p);if(null==t?void 0:t.tree){const t=r.dataSource.getIndexKey(r.getRecordShowIndexByCell(e,p));v=Array.isArray(t)&&r.getHierarchyState(e,p)!==WC.none?(t.length-1)*(null!==(d=m.hierarchyIndent)&&void 0!==d?d:0):0,m.hierarchyTextStartAlignment&&!r.internalProps.bodyHelper.getHierarchyIcon(e,p)&&(v+=r.internalProps.headerHelper.getHierarchyIconWidth())}}const b=lR(e,p,f,r);c=Math.max(b+v,c),u>1&&r.bottomFrozenRowCount>0&&p<r.rowCount-r.bottomFrozenRowCount&&p+u>=r.rowCount-r.bottomFrozenRowCount&&(p=r.rowCount-r.bottomFrozenRowCount-u,u=1,g=1)}const p=r.getMinColWidth(e),f=r.getMaxColWidth(e);return c<p?p:c>f?f:(c<=0&&(c=r.defaultColWidth),c)}function sR(t,e,i){var o,n,r,s,l;const a=i.getCustomRender(t,e);let h=i.getCustomLayout(t,e);if(a||h){let d=1,c=0,u=!1,g=!1;if(i.isHeader(t,e)||(null===(o=i.getBodyColumnDefine(t,e))||void 0===o?void 0:o.mergeCell)||i.hasCustomMerge()){const o=i.getCellRange(t,e);d=o.end.col-o.start.col+1}const p={col:t,row:e,dataValue:i.getCellOriginValue(t,e),value:i.getCellValue(t,e)||"",rect:aR(t,e,i),table:i};if("react-custom-layout"===h&&(h=(null===(n=i.reactCustomLayout)||void 0===n?void 0:n.getCustomLayoutFunc(t,e))||$_),Z(h)){const t=h(p);if(t.rootContainer){t.rootContainer=nS(t.rootContainer),oS(t.rootContainer,0,i.getRowHeight(e));const o=t.rootContainer.attribute.width;t.rootContainer.setStage(i.scenegraph.stage),c=o>0?o:null!==(r=t.rootContainer.AABBBounds.width())&&void 0!==r?r:0,u=t.renderDefault,g=t.enableCellPadding}else c=0,u=t.renderDefault,g=t.enableCellPadding}else if("function"==typeof a){const t=a(p);c=null!==(s=null==t?void 0:t.expectedWidth)&&void 0!==s?s:0,u=null==t?void 0:t.renderDefault}else c=null!==(l=null==a?void 0:a.expectedWidth)&&void 0!==l?l:0,u=null==a?void 0:a.renderDefault;if(c=Math.ceil(c),g){const o=r_(DS("padding",i._getCellStyle(t,e),t,e,i));c+=o[1]+o[3]}return{width:c/d,renderDefault:u}}}function lR(t,e,i,o){var n,r,s;let l=0;const a=o.getCellValue(t,e),h=o._getCellStyle(t,e);let d=0,c=!1;if("body"!==o.getCellLocation(t,e))c=!0;else{const i=o.getBodyColumnDefine(t,e);c=!!(null==i?void 0:i.icon)||!!(null==i?void 0:i.tree)||(null==i?void 0:i.dragOrder)}if(c){const i=o.getCellIcons(t,e);null==i||i.forEach((t=>{var e,i,o;t.positionType!==jC.absoluteRight&&(d+=(null!==(e=t.width)&&void 0!==e?e:0)+(null!==(i=t.marginLeft)&&void 0!==i?i:0)+(null!==(o=t.marginRight)&&void 0!==o?o:0))}))}let u=1;if(o.isHeader(t,e)||(null===(n=o.getBodyColumnDefine(t,e))||void 0===n?void 0:n.mergeCell)||o.hasCustomMerge()){const i=o.getCellRange(t,e);u=i.end.col-i.start.col+1}const g=r_(DS("padding",h,t,e,o)),p=g[1]+g[3],f=DS("fontSize",h,t,e,o),v=DS("fontFamily",h,t,e,o),m=DS("fontWeight",h,t,e,o);let b;if("checkbox"===i)b=tt(a)?a.text:a;else if("radio"===i)if(rt(a)){b="";const i=o.getBodyColumnDefine(t,e),n=null!==(r=null==i?void 0:i.radioDirectionInCell)&&void 0!==r?r:"vertical";"vertical"===n?a.forEach((t=>{b+=(tt(t)?t.text:t).toString()+"\n"})):"horizontal"===n&&a.forEach((t=>{b+=(tt(t)?t.text:t).toString()}))}else b=tt(a)?a.text:a;else b=a;const y=VS(b,o).text;if(y.length>=1&&(1!==y.length||""!==y[0])?y.forEach((t=>{const e=o.measureText(t,{fontSize:f,fontFamily:v,fontWeight:m}).width;l=Math.max((e+p+4+d)/u,l)})):l=Math.max((p+4+d)/u,l),!1!==o.internalProps.limitMaxAutoWidth&&(l=Math.min("number"==typeof o.internalProps.limitMaxAutoWidth?o.internalProps.limitMaxAutoWidth:450,l)),"checkbox"===i){const i=DS("size",h,t,e,o);if(l+=i,b){const i=DS("spaceBetweenTextAndIcon",h,t,e,o);l+=i}}else if("radio"===i){const i=DS("size",h,t,e,o),n=DS("outerRadius",h,t,e,o),r=at(n)?2*n:i,d=DS("spaceBetweenTextAndIcon",h,t,e,o);if(rt(a)){const i=o.getBodyColumnDefine(t,e),n=DS("spaceBetweenRadio",h,t,e,o),c=null!==(s=null==i?void 0:i.radioDirectionInCell)&&void 0!==s?s:"vertical";"vertical"===c?(l+=r,l+=d):"horizontal"===c&&(l+=(r+d)*a.length,l+=n*(a.length-1))}else l+=r,b&&(l+=d)}return l}function aR(t,e,i){return{left:0,top:0,right:i.getColWidth(t),bottom:i.getRowHeight(e),width:null,height:null}}function hR(t,e,i,o,n,r,s){var l,a,h,d;let c=0;const u=[],g=[];let p=0;for(let s=e;s<i;s++){const e=o&&null!==(l=n[s])&&void 0!==l?l:r.getColWidth(s),i=r.getMaxColWidth(s),h=r.getMinColWidth(s);e!==i&&e!==h?(c+=e,u.push(s)):t-=e,(null===(a=r.options.customConfig)||void 0===a?void 0:a.shrinkSparklineFirst)&&"sparkline"===r.getBodyColumnType(s,0)&&(g.push({col:s,width:e}),p+=e-r.defaultColWidth)}const f=t/c;if((null===(h=r.options.customConfig)||void 0===h?void 0:h.shrinkSparklineFirst)&&f<1&&c-t<p)for(let e=0;e<g.length;e++){const{col:i,width:l}=g[e],a=(c-t)/g.length,h=Math.floor(l-a);o?n[i]=r._adjustColWidth(i,h):s?r.scenegraph.setColWidth(i,r._adjustColWidth(i,h)):r._setColWidth(i,r._adjustColWidth(i,h),!1,!0)}else for(let e=0;e<u.length;e++){const i=u[e];let l;l=e===u.length-1?t-u.reduce(((t,e,s)=>{var l;return e!==i?t+(o?null!==(l=n[e])&&void 0!==l?l:r.getColWidth(i):r.getColWidth(e)):t}),0):Math.round((o&&null!==(d=n[i])&&void 0!==d?d:r.getColWidth(i))*f),o?n[i]=r._adjustColWidth(i,l):s?r.scenegraph.setColWidth(i,r._adjustColWidth(i,l)):r._setColWidth(i,r._adjustColWidth(i,l),!1,!0)}}const dR=new zS({});function cR(t,e,i,o,n,r,s,l,a,h){let d,c,u,g=0;t.lastChild&&t.lastChild.row===o-1?g=t.lastChild.attribute.y+t.lastChild.attribute.height:t.colHeight&&(g=t.colHeight);for(let p=o;p<=n;p++){const n=p;let f,v,m,b,y=l.getCellValue(e,n),C=i,w=l.getRowHeight(n),x=!1;if(l.internalProps.customMergeCell){const t=l.getCustomMerge(e,n);if(t){const{range:e,text:i,style:s,customLayout:a,customRender:h}=t;if(f=e,v=f.start.col!==f.end.col||f.start.row!==f.end.row,v){const t=gR(f,r,l,o>f.start.row);C=t.cellWidth,w=t.cellHeight}y=i,m=s,(a||h)&&(b=eS(a,h,e.start.col,e.start.row,l.getColsWidth(e.start.col,e.end.col),l.getRowsHeight(e.start.row,e.end.row),!1,l.isAutoRowHeight(n),[0,0,0,0],f,l)),x=!0}}let _,S=e,A=n;f&&(S=f.start.col,A=f.start.row),!l.isPivotTable()&&("columnHeader"===a||"cornerHeader"===a)&&n>=l.columnHeaderLevelCount&&(a="body"),_=!l.isPivotTable()&&l.isSeriesNumberInBody(e,n)?l.getBodyColumnDefine(S,A):"body"!==a?l.getHeaderDefine(S,A):l.getBodyColumnDefine(S,A);let B="body"!==a||(null==_?void 0:_.dragOrder)||!!(null==_?void 0:_.icon)||!!(null==_?void 0:_.tree);if(!f&&(l.internalProps.enableTreeNodeMerge||"body"!==a||(null==_?void 0:_.mergeCell))&&(f=l.getCellRange(e,n),v=f.start.col!==f.end.col||f.start.row!==f.end.row,v)){const t=gR(f,r,l,o>f.start.row);C=t.cellWidth,w=t.cellHeight}let R=!1;if(l.internalProps.enableTreeNodeMerge&&v){const t=l.getCellRawRecord(f.start.col,f.start.row),{vtableMergeName:e,vtableMerge:i}=null!=t?t:{};R=i,i&&(B=!0,l.options.groupTitleCustomLayout&&(b=eS(l.options.groupTitleCustomLayout,void 0,f.start.col,f.start.row,l.getColsWidth(f.start.col,f.end.col),l.getRowsHeight(f.start.row,f.end.row),!1,l.isAutoRowHeight(n),[0,0,0,0],f,l))),e&&(y=e)}const M=R||x?"text":(l.isHeader(e,n)?l._getHeaderLayoutMap(e,n).headerType:l.getBodyColumnType(e,n))||"text";if(Fw(y)){pR(e,n,0,g,C,w,t),nA(y,l,uR.bind(null,{type:M,value:y,define:_,table:l,col:e,row:n,colWidth:i,cellWidth:C,cellHeight:w,columnGroup:t,y:g,customStyle:m,mayHaveIcon:B,cellLocation:a,range:f,customResult:b,defaultRowHeight:s})),t.updateColumnRowNumber(n);const o=l.getRowHeight(n);t.updateColumnHeight(o),g+=o}else{const o=G_(m||l._getCellStyle(f?f.start.col:e,f?f.start.row:n),l,f?f.start.col:e,f?f.start.row:n,DS).theme;o.group.cornerRadius=j_(e,n,l),o.group.width=i,o.group.height=Array.isArray(s)?s[n]:s,o._vtable.padding&&(d=o._vtable.padding),o.text.textAlign&&(c=o.text.textAlign),o.text.textBaseline&&(u=o.text.textBaseline),"body"===a||o.group.fill||(o.group.fill="#fff");const r=sA(M,y,_,l,e,n,i,C,w,t,g,d,c,u,B,o,f,b);if(t.updateColumnRowNumber(n),v){const i=l.getRowHeight(n),{width:o}=(l.getColWidth(e),r.attribute),{height:s}=r.attribute;r.contentWidth=o,r.contentHeight=s,dA(f,o,s,d,c,u,l),t.updateColumnHeight(i),g+=i}else t.updateColumnHeight(w),g+=w}if(h&&n>h)break}return t.setAttribute("width",i),{width:i,height:g}}function uR(t){let e,i,o;const{type:n,value:r,define:s,table:l,col:a,row:h,colWidth:d,cellWidth:c,cellHeight:u,columnGroup:g,y:p,cellLocation:f,mayHaveIcon:v,customStyle:m,range:b,customResult:y,defaultRowHeight:C}=t,w=G_(m||l._getCellStyle(b?b.start.col:a,b?b.start.row:h),l,b?b.start.col:a,b?b.start.row:h,DS).theme;w.group.cornerRadius=j_(a,h,l),w.group.width=d,w.group.height=Array.isArray(C)?C[h]:C,w._vtable.padding&&(e=w._vtable.padding),w.text.textAlign&&(i=w.text.textAlign),w.text.textBaseline&&(o=w.text.textBaseline),"body"===f||w.group.fill||(w.group.fill="#fff"),sA(n,r,s,l,a,h,d,c,u,g,p,e,i,o,v,w,b,y)}function gR(t,e,i,o){let n=0,r=0;const s=e.get(`${t.start.col},${t.start.row};${t.end.col},${t.end.row}`);if(!s||o){for(let e=t.start.col;e<=t.end.col;e++)n+=i.getColWidth(e);for(let e=t.start.row;e<=t.end.row;e++)r+=i.getRowHeight(e);e.set(`${t.start.col},${t.start.row};${t.end.col},${t.end.row}`,{cellWidth:n,cellHeight:r})}else n=s.cellWidth,r=s.cellHeight;return{cellWidth:n,cellHeight:r}}function pR(t,e,i,o,n,r,s){const l=new zS({x:i,y:o,width:n,height:r});l.role="cell",l.col=t,l.row=e,s.addChild(l)}function fR(t,e,i,o,n,r,s,l,a,h){if(o>n||r>s)return;const{layoutMap:d,defaultRowHeight:c,defaultHeaderRowHeight:u,defaultColWidth:g}=a.internalProps;let p=0,f=0;for(let d=o;d<=n;d++){const o=d,n=a.getColWidth(o),g=new zS({x:e+p,y:i,width:n,height:0,clip:!1,pickable:!1});g.role="column",g.col=d,t.addChild(g);const{width:v,height:m}=cR(g,o,n,r,s,a.scenegraph.mergeMap,"columnHeader"===l&&at(u)?u:c,a,l,h);p+=v,f=Math.max(f,m)}t.setAttribute("width",p),t.setAttribute("height",f)}function vR(t){let e=t.firstChild;for(;"group"!==e.type;)e=e._next;return e}function mR(t){let e=t.lastChild;for(;"group"!==e.type;)e=e._prev;return e}function bR(t,e,i){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"left";for(let n=t;n<=e;n++){const t=i.scenegraph.getColGroup(n);t&&yR(t,i,o);const e=i.scenegraph.getColGroup(n,!0);e&&yR(e,i,o);const r=i.scenegraph.getColGroupInBottom(n);r&&yR(r,i,o)}const n=Math.min(i.scenegraph.proxy.colLimit,i.scenegraph.proxy.bodyRightCol-i.scenegraph.proxy.bodyLeftCol+1),r=i.getColsWidth(i.frozenColCount,i.frozenColCount+n),s=i.getColsWidth(i.frozenColCount,i.colCount-1);i.scenegraph.proxy.xLimitLeft=r/2,i.scenegraph.proxy.xLimitRight=s-r/2}function yR(t,e){if("left"===(arguments.length>2&&void 0!==arguments[2]?arguments[2]:"left")){let i;const o=function(t){let e=t._prev;for(;e&&"group"!==e.type;)e=e._prev;return e}(t);i=o?o.attribute.x+e.getColWidth(t._prev.col):e.getColsWidth(e.frozenColCount,t.col-1),t.setAttribute("x",i)}else{let i;const o=function(t){let e=t._next;for(;e&&"group"!==e.type;)e=e._next;return e}(t);i=o?o.attribute.x-e.getColWidth(t.col):e.getColsWidth(e.frozenColCount,t.col-1),t.setAttribute("x",i)}}dR.role="empty";var CR=function(t,e,i,o){return new(i||(i=Promise))((function(n,r){function s(t){try{a(o.next(t))}catch(t){r(t)}}function l(t){try{a(o.throw(t))}catch(t){r(t)}}function a(t){var e;t.done?n(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(s,l)}a((o=o.apply(t,e||[])).next())}))};function wR(t,e,i,o){return CR(this,void 0,void 0,(function*(){if(!e)return;const n=e.col,r=e.left;let s;if(s=i?o.bodyRightCol-o.colEnd:o.screenLeftCol-o.referenceCol,function(t,e,i,o,n){t>0?(xR(t,"left",n.screenLeftCol,i,o,n),n.updateDeltaX(o,i,e),n.table.scenegraph.setBodyAndColHeaderX(-o+n.deltaX)):t<0?(xR(-t,"right",n.screenLeftCol,i,o,n),n.updateDeltaX(o,i,e),n.table.scenegraph.setBodyAndColHeaderX(-o+n.deltaX)):(n.updateDeltaX(o,i,e),n.table.scenegraph.setBodyAndColHeaderX(-o+n.deltaX))}(s,n,r,t,o),i){const e=o.table.scenegraph.getColGroup(o.colEnd);if(e){const i=e.attribute.x+e.attribute.width-(o.table.tableNoFrameWidth-o.table.getFrozenColsWidth()-o.table.getRightFrozenColsWidth())-t;o.deltaX=-i,o.table.scenegraph.setBodyAndColHeaderX(-t+o.deltaX)}}o.table.scenegraph.updateNextFrame()}))}function xR(t,e,i,o,n,r){return CR(this,void 0,void 0,(function*(){if("left"===e&&r.colEnd+t>r.bodyRightCol?t=r.bodyRightCol-r.colEnd:"right"===e&&r.colStart-t<r.bodyLeftCol&&(t=r.colStart-r.bodyLeftCol),0!==t)if(t<0&&(e="left"===e?"right":"left",t=-t),t<r.colEnd-r.colStart){const n="left"===e?r.colStart:r.colEnd-t+1,s="left"===e?r.colStart+t-1:r.colEnd,l="left"===e?r.colEnd+1:r.colStart-t,a="left"===e?r.colEnd+t:r.colStart-1;oR(r.table,l,a),function(t,e,i,o){for(let n=t;n<=e;n++)o.table.scenegraph.bodyGroup.childrenCount>0&&"group"===o.table.scenegraph.bodyGroup.firstChild.type&&BR(o.table.scenegraph.bodyGroup,i,o),o.table.scenegraph.colHeaderGroup.childrenCount>0&&"group"===o.table.scenegraph.colHeaderGroup.firstChild.type&&BR(o.table.scenegraph.colHeaderGroup,i,o),o.table.scenegraph.bottomFrozenGroup.childrenCount>0&&"group"===o.table.scenegraph.bottomFrozenGroup.firstChild.type&&BR(o.table.scenegraph.bottomFrozenGroup,i,o)}(n,s,e,r);const h=l,d=a;r.colStart="left"===e?r.colStart+t:r.colStart-t,r.colEnd="left"===e?r.colEnd+t:r.colEnd-t,RR(h,d,r),bR(h,d,r.table,e);const c=r.table.scenegraph.getColGroup(i)||r.table.scenegraph.getColGroup(i,!0),u=o-(c.attribute.x+r.table.getFrozenColsWidth()+r.table.scenegraph.proxy.deltaX);r.table.scenegraph.proxy.deltaX+=u,r.currentCol="left"===e?r.currentCol+t:r.currentCol-t,r.totalCol=Math.max(0,Math.min(r.table.colCount-1,"left"===e?r.totalCol+t:r.totalCol-t)),r.referenceCol=r.colStart+Math.floor((r.colEnd-r.colStart)/2),r.colUpdatePos=l,r.colUpdateDirection=e,r.table.scenegraph.updateNextFrame()}else{const i="left"===e?r.colStart+t:r.colStart-t,o="left"===e?r.colEnd+t:r.colEnd-t;oR(r.table,i,o),function(t,e,i,o){o.table.scenegraph.colHeaderGroup.forEachChildren(((n,r)=>{"group"===n.type&&_R(n,"left"===i?n.col+e:n.col-e,0===r?t:n._prev.attribute.x+o.table.getColWidth(n._prev.col))})),o.table.scenegraph.bottomFrozenGroup.forEachChildren(((n,r)=>{"group"===n.type&&_R(n,"left"===i?n.col+e:n.col-e,0===r?t:n._prev.attribute.x+o.table.getColWidth(n._prev.col))})),o.table.scenegraph.bodyGroup.forEachChildren(((n,r)=>{"group"===n.type&&_R(n,"left"===i?n.col+e:n.col-e,0===r?t:n._prev.attribute.x+o.table.getColWidth(n._prev.col))}))}(r.table.getColsWidth(r.bodyLeftCol,i-1),t,e,r);const n=i,s=o;r.colStart=i,r.colEnd=o,RR(n,s,r),bR(n,s,r.table,o>r.bodyRightCol-(r.colEnd-r.colStart+1)?"right":"left"),r.currentCol="left"===e?r.currentCol+t:r.currentCol-t,r.totalCol=Math.max(0,Math.min(r.table.colCount-1,"left"===e?r.totalCol+t:r.totalCol-t)),r.referenceCol=r.colStart+Math.floor((r.colEnd-r.colStart)/2),r.colUpdatePos=r.colStart,r.colUpdateDirection=o>r.bodyRightCol-(r.colEnd-r.colStart+1)?"right":"left",r.table.scenegraph.updateNextFrame()}}))}function _R(t,e,i){t.col=e,t.forEachChildren((t=>{t.col=e,t.needUpdate=!0})),t.setAttribute("x",i),t.needUpdate=!0}function SR(t,e){if(!t)return;let i=t.firstChild;for(;i;)i=e.updateCellGroupContent(i)._next;t.needUpdate=!1,t.setAttribute("width",e.table.getColWidth(t.col))}function AR(t,e){if(!t)return;const i=e.screenTopRow,o=Math.max(e.bodyTopRow,i-1*e.screenRowCount),n=Math.min(e.bodyBottomRow,i+2*e.screenRowCount,e.table.rowCount-1);for(let i=o;i<=n;i++){const o=e.highPerformanceGetCell(t.col,i,!0);e.updateCellGroupContent(o)}e.rowUpdatePos=e.rowStart,t.needUpdate=!1,t.setAttribute("width",e.table.getColWidth(t.col))}function BR(t,e,i){if("left"===e){const e=vR(t),o=mR(t);_R(e,o.col+1,o.attribute.x+i.table.getColWidth(o.col)),t.appendChild(e),t.border&&t.appendChild(t.border)}else{const e=mR(t),o=vR(t);_R(e,o.col-1,o.attribute.x-i.table.getColWidth(o.col-1)),t.insertBefore(e,t.firstChild)}}function RR(t,e,i){for(let o=t;o<=e;o++){const t=i.table.scenegraph.getColGroup(o,!0);t&&SR(t,i);const e=i.table.scenegraph.getColGroupInBottom(o);e&&SR(e,i);const n=i.table.scenegraph.getColGroupInRightTopCorner(o);n&&SR(n,i);const r=i.table.scenegraph.getColGroupInRightBottomCorner(o);r&&SR(r,i);const s=i.table.scenegraph.getColGroup(o);s&&AR(s,i)}i.progress()}function MR(t,e,i,o,n){let r=arguments.length>6?arguments[6]:void 0;var s,l;if("up"===(arguments.length>5&&void 0!==arguments[5]?arguments[5]:"up"))for(let l=t;l<=e;l++)for(let t=i;t<=o;t++){const e=n.scenegraph.highPerformanceGetCell(l,t,!0);if("cell"!==e.role||!e.row)continue;let i;if(e._prev)i=(null===(s=e._prev)||void 0===s?void 0:s.attribute.y)+n.getRowHeight(e._prev.row);else if(r){if(i=n.scenegraph.highPerformanceGetCell(l,o+1,!0).attribute.y,Q(i))for(let e=t;e<=o;e++)i-=n.getRowHeight(e)}else i=TR(e.row,n);Q(i)&&e.setAttribute("y",i)}else for(let s=t;s<=e;s++)for(let t=o;t>=i;t--){const e=n.scenegraph.highPerformanceGetCell(s,t,!0);if("cell"!==e.role||!e.row)continue;let o;if(e._next)o=(null===(l=e._next)||void 0===l?void 0:l.attribute.y)-n.getRowHeight(e.row);else if(r){o=n.scenegraph.highPerformanceGetCell(s,i-1,!0).attribute.y;for(let e=i-1;e<t;e++)o+=n.getRowHeight(e)}else o=TR(e.row,n);Q(o)&&e.setAttribute("y",o)}const a=Math.min(n.scenegraph.proxy.rowLimit,n.scenegraph.proxy.bodyBottomRow-n.scenegraph.proxy.bodyTopRow+1),h=n.getRowsHeight(n.frozenRowCount,n.frozenRowCount+a),d=n.getRowsHeight(n.frozenRowCount,n.rowCount-1);n.scenegraph.proxy.yLimitTop=h/2,n.scenegraph.proxy.yLimitBottom=d-h/2}function TR(t,e){let i;return i=t<e.frozenRowCount?e.getRowsHeight(0,t-1):t>=e.rowCount-e.bottomFrozenRowCount?e.getRowsHeight(e.rowCount-e.bottomFrozenRowCount,t-1):e.getRowsHeight(e.frozenRowCount,t-1),i}var kR=function(t,e,i,o){return new(i||(i=Promise))((function(n,r){function s(t){try{a(o.next(t))}catch(t){r(t)}}function l(t){try{a(o.throw(t))}catch(t){r(t)}}function a(t){var e;t.done?n(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(s,l)}a((o=o.apply(t,e||[])).next())}))};function LR(t,e,i,o){return kR(this,void 0,void 0,(function*(){if(!e)return;const n=e.row,r=e.top;let s;if(s=i?o.bodyBottomRow-o.rowEnd:n-o.referenceRow,function(t,e,i,o,n){t>0?(PR(t,"up",e,i,o,n),n.updateDeltaY(o,i,e),n.updateBody(o-n.deltaY)):t<0?(PR(-t,"down",e,i,o,n),n.updateDeltaY(o,i,e),n.updateBody(o-n.deltaY)):(n.updateDeltaY(o,i,e),n.updateBody(o-n.deltaY))}(s,n,r,t,o),i){const e=o.table.scenegraph.highPerformanceGetCell(o.colStart,o.rowEnd,!0);if("cell"===e.role){const i=e.attribute.y+e.attribute.height-(o.table.tableNoFrameHeight-o.table.getFrozenRowsHeight()-o.table.getBottomFrozenRowsHeight())-t;o.deltaY=-i,o.updateBody(t-o.deltaY)}}}))}function PR(t,e,i,o,n,r){return kR(this,void 0,void 0,(function*(){if("up"===e&&r.rowEnd+t>r.bodyBottomRow?t=r.bodyBottomRow-r.rowEnd:"down"===e&&r.rowStart-t<r.bodyTopRow&&(t=r.rowStart-r.bodyTopRow),0!==t)if(t<0&&(e="up"===e?"down":"up",t=-t),t<r.rowEnd-r.rowStart){const o="up"===e?r.rowStart:r.rowEnd-t+1,n="up"===e?r.rowStart+t-1:r.rowEnd,s="up"===e?r.rowEnd+1:r.rowStart-t,l="up"===e?r.rowEnd+t:r.rowStart-1;let a,h;"autoHeight"===r.table.heightMode?(a=s,h=l):(a=Math.max(r.bodyTopRow,i-1*r.screenRowCount),h=Math.min(r.bodyBottomRow,i+2*r.screenRowCount,r.table.rowCount-1)),BA(r.table,a,h,!1),function(t,e,i,o){for(let n=0;n<o.table.frozenColCount;n++){const r=o.table.scenegraph.getColGroup(n);if(r)for(let n=t;n<=e;n++)ER(r,i,o)}for(let n=o.table.colCount-o.table.rightFrozenColCount;n<o.table.colCount;n++){const r=o.table.scenegraph.getColGroup(n);if(r)for(let n=t;n<=e;n++)ER(r,i,o)}for(let n=o.bodyLeftCol;n<=o.bodyRightCol;n++){const r=o.table.scenegraph.getColGroup(n);if(r)for(let n=t;n<=e;n++)ER(r,i,o)}}(o,n,e,r),r.rowStart="up"===e?r.rowStart+t:r.rowStart-t,r.rowEnd="up"===e?r.rowEnd+t:r.rowEnd-t;const d=HR(a,h,r,!0);"autoHeight"===r.table.heightMode&&(MR(r.bodyLeftCol,r.bodyRightCol,a,h,r.table,l>r.bodyBottomRow-(r.rowEnd-r.rowStart+1)?"down":"up",!0),MR(0,r.table.frozenColCount-1,a,h,r.table,l>r.bodyBottomRow-(r.rowEnd-r.rowStart+1)?"down":"up",!0),MR(r.table.colCount-r.table.rightFrozenColCount,r.table.colCount-1,a,h,r.table,l>r.bodyBottomRow-(r.rowEnd-r.rowStart+1)?"down":"up",!0)),r.currentRow="up"===e?r.currentRow+t:r.currentRow-t,r.totalRow=Math.max(0,Math.min(r.bodyBottomRow,"up"===e?r.totalRow+t:r.totalRow-t,r.table.rowCount-1)),r.referenceRow=r.rowStart+Math.floor((r.rowEnd-r.rowStart)/2),"autoHeight"===r.table.heightMode&&d?r.rowUpdatePos=Math.min(r.rowUpdatePos,r.rowEnd+1):r.rowUpdatePos=Math.min(r.rowUpdatePos,s),r.rowUpdateDirection=e,r.table.scenegraph.updateNextFrame(),yield r.progress()}else{const o="up"===e?r.rowStart+t:r.rowStart-t,n=Math.min(r.table.rowCount-1,"up"===e?r.rowEnd+t:r.rowEnd-t),s=r.table.getRowsHeight(r.bodyTopRow,o-1);let l,a;"autoHeight"===r.table.heightMode?(l=o,a=n):(l=Math.max(r.bodyTopRow,i-1*r.screenRowCount),a=Math.min(r.bodyBottomRow,i+2*r.screenRowCount,r.table.rowCount-1)),BA(r.table,l,a,!1),function(t,e,i,o){for(let n=0;n<o.table.frozenColCount;n++){const r=o.table.scenegraph.getColGroup(n);null==r||r.forEachChildren(((n,r)=>{o.updateCellGroupPosition(n,"up"===i?n.row+e:n.row-e,0===r?t:n._prev.attribute.y+o.table.getRowHeight(n._prev.row))}))}for(let n=o.table.colCount-o.table.rightFrozenColCount;n<o.table.colCount;n++){const r=o.table.scenegraph.getColGroup(n);null==r||r.forEachChildren(((n,r)=>{o.updateCellGroupPosition(n,"up"===i?n.row+e:n.row-e,0===r?t:n._prev.attribute.y+o.table.getRowHeight(n._prev.row))}))}for(let n=o.bodyLeftCol;n<=o.bodyRightCol;n++){const r=o.table.scenegraph.getColGroup(n);null==r||r.forEachChildren(((n,r)=>{o.updateCellGroupPosition(n,"up"===i?n.row+e:n.row-e,0===r?t:n._prev.attribute.y+o.table.getRowHeight(n._prev.row))}))}}(s,t,e,r),r.rowStart=o,r.rowEnd=n;const h=HR(l,a,r,!0);"autoHeight"===r.table.heightMode&&(MR(r.bodyLeftCol,r.bodyRightCol,l,a,r.table,n>r.bodyBottomRow-(r.rowEnd-r.rowStart+1)?"down":"up"),MR(0,r.table.frozenColCount-1,l,a,r.table,n>r.bodyBottomRow-(r.rowEnd-r.rowStart+1)?"down":"up"),MR(r.table.colCount-r.table.rightFrozenColCount,r.table.colCount-1,l,a,r.table,n>r.bodyBottomRow-(r.rowEnd-r.rowStart+1)?"down":"up")),r.currentRow="up"===e?r.currentRow+t:r.currentRow-t,r.totalRow=Math.max(0,Math.min(r.bodyBottomRow,"up"===e?r.totalRow+t:r.totalRow-t,r.table.rowCount-1)),r.referenceRow=r.rowStart+Math.floor((r.rowEnd-r.rowStart)/2),"autoHeight"===r.table.heightMode&&h?r.rowUpdatePos=r.rowEnd+1:r.rowUpdatePos=r.rowStart,r.rowUpdateDirection=n>r.bodyBottomRow-(r.rowEnd-r.rowStart+1)?"down":"up",r.table.scenegraph.updateNextFrame(),yield r.progress()}}))}function ER(t,e,i){if(t.childrenCount>=1)if("up"===e){const e=t.firstChild;i.updateCellGroupPosition(e,t.lastChild.row+1,t.lastChild.attribute.y+i.table.getRowHeight(t.lastChild.row)),t.appendChild(e)}else{const e=t.lastChild;i.updateCellGroupPosition(e,t.firstChild.row-1,t.firstChild.attribute.y-i.table.getRowHeight(e.row)),t.insertBefore(e,t.firstChild)}}function HR(t,e,i){let o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];for(let o=0;o<i.table.frozenColCount;o++)for(let n=t;n<=e;n++){const t=i.highPerformanceGetCell(o,n,!0);i.updateCellGroupContent(t)}for(let o=i.table.colCount-i.table.rightFrozenColCount;o<i.table.colCount;o++)for(let n=t;n<=e;n++){const t=i.highPerformanceGetCell(o,n);i.updateCellGroupContent(t)}let n=i.bodyLeftCol,r=i.bodyRightCol,s=!0;if(o){const t=i.screenLeftCol;n=Math.max(i.bodyLeftCol,t-1*i.screenColCount),r=Math.min(i.bodyRightCol,t+2*i.screenColCount),n===i.bodyLeftCol&&r===i.bodyRightCol||(s=!1)}for(let o=n;o<=r;o++)for(let n=t;n<=e;n++){const t=i.highPerformanceGetCell(o,n);i.updateCellGroupContent(t)}return i.table.scenegraph.updateNextFrame(),s}var FR=function(t,e,i,o){return new(i||(i=Promise))((function(n,r){function s(t){try{a(o.next(t))}catch(t){r(t)}}function l(t){try{a(o.throw(t))}catch(t){r(t)}}function a(t){var e;t.done?n(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(s,l)}a((o=o.apply(t,e||[])).next())}))};var zR=function(t,e,i,o){return new(i||(i=Promise))((function(n,r){function s(t){try{a(o.next(t))}catch(t){r(t)}}function l(t){try{a(o.throw(t))}catch(t){r(t)}}function a(t){var e;t.done?n(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(s,l)}a((o=o.apply(t,e||[])).next())}))};function IR(t){const{changedCells:e}=t.internalProps.stick;e.forEach((e=>{t.scenegraph.getCell(e.col,e.row).forEachChildren((t=>{t.setAttributes({dx:e.dx,dy:e.dy})}))})),e.clear();const{scrollTop:i,scrollLeft:o,frozenRowCount:n,frozenColCount:r}=t,s=t.getFrozenRowsHeight(),l=t.getFrozenColsWidth(),{row:a}=t.getRowAt(i+s+1),{col:h}=t.getColAt(o+l+1),d=Math.max(a,t.frozenRowCount),c=Math.max(h,t.frozenColCount),u=t.getAllRowsHeight()>t.tableNoFrameHeight?t.getRowAt(i+t.tableNoFrameHeight-t.getBottomFrozenRowsHeight()-1).row:t.rowCount-t.bottomFrozenRowCount-1,g=t.getAllColsWidth()>t.tableNoFrameWidth?t.getColAt(o+t.tableNoFrameWidth-t.getRightFrozenColsWidth()-1).col:t.colCount-t.rightFrozenColCount-1;if(!(g<0||u<0)){for(let i=0;i<n&&!(g<c);i++)[c,g].forEach((o=>{const n=t._getCellStyle(o,i);(null==n?void 0:n.textStick)&&"vertical"!==(null==n?void 0:n.textStick)&&WR(t.scenegraph.getCell(o,i),l+t.tableX,t.tableNoFrameWidth-t.getRightFrozenColsWidth()+t.tableX,e,null==n?void 0:n.textStickBaseOnAlign,t)}));for(let i=0;i<r&&!(u<d);i++)[d,u].forEach((o=>{const n=t._getCellStyle(i,o);(null==n?void 0:n.textStick)&&"tree"!==t.internalProps.layoutMap.rowHierarchyType&&"horizontal"!==(null==n?void 0:n.textStick)&&OR(t.scenegraph.getCell(i,o),s+t.tableY,t.tableNoFrameHeight-t.getBottomFrozenRowsHeight()+t.tableY,e,null==n?void 0:n.textStickBaseOnAlign,t)}));for(let i=c;i<=g&&!(u<d);i++)[d,u].forEach((o=>{const n=t._getCellStyle(i,o);(null==n?void 0:n.textStick)&&"horizontal"!==(null==n?void 0:n.textStick)&&OR(t.scenegraph.getCell(i,o),s+t.tableY,t.tableNoFrameHeight-t.getBottomFrozenRowsHeight()+t.tableY,e,null==n?void 0:n.textStickBaseOnAlign,t)}));for(let i=d;i<=u&&!(g<c);i++)[c,g].forEach((o=>{const n=t._getCellStyle(o,i);(null==n?void 0:n.textStick)&&"vertical"!==(null==n?void 0:n.textStick)&&WR(t.scenegraph.getCell(o,i),l+t.tableX,t.tableNoFrameWidth-t.getRightFrozenColsWidth()+t.tableX,e,null==n?void 0:n.textStickBaseOnAlign,t)}))}}function OR(t,e,i,o,n,r){if(at(t.mergeStartCol)&&at(t.mergeStartRow)&&at(t.mergeEndCol)&&at(t.mergeEndRow)){const{colStart:s,colEnd:l,rowStart:a,rowEnd:h}=EA(t,r.scenegraph);for(let t=s;t<=l;t++)for(let s=a;s<=h;s++)DR(r.scenegraph.getCell(t,s),e,i,o,n)}else DR(t,e,i,o,n)}function DR(t,e,i,o,n){var r,s,l,a,h,d,c,u,g,p,f,v,m,b,y,C,w;const x=t.getChildByName("text",!0)||t.getChildByName("image",!0);if(!x)return;if("image"===x.type){const{image:t}=x.attribute;if(!t||!x.resources)return;if("success"!==x.resources.get(t).state)return}const _=null!==(r=x.textBaseline)&&void 0!==r?r:"top";x.AABBBounds.width();const S=x.globalAABBBounds.y1,A=x.globalAABBBounds.y2;if("middle"===_&&n){const n=t.globalAABBBounds.y1+(null!==(l=null===(s=t.firstChild)||void 0===s?void 0:s.attribute.dy)&&void 0!==l?l:0),r=n+(null!==(h=null!==(a=t.contentHeight)&&void 0!==a?a:t.attribute.height)&&void 0!==h?h:0);if(n<e||r>i){const s=Math.max(n,e),l=Math.min(r,i),a=x.globalTransMatrix.f-(l+s)/2+x.AABBBounds.height()/2;!o.has(`${t.col}-${t.row}`)&&o.set(`${t.col}-${t.row}`,{col:t.col,row:t.row,dx:null!==(c=null===(d=t.firstChild)||void 0===d?void 0:d.attribute.dx)&&void 0!==c?c:0,dy:null!==(g=null===(u=t.firstChild)||void 0===u?void 0:u.attribute.dy)&&void 0!==g?g:0}),t.forEachChildren((t=>{var e;t.setAttribute("dy",(null!==(e=t.attribute.dy)&&void 0!==e?e:0)-a+2)}))}}else if(S<e){const i=S-e;!o.has(`${t.col}-${t.row}`)&&o.set(`${t.col}-${t.row}`,{col:t.col,row:t.row,dx:null!==(f=null===(p=t.firstChild)||void 0===p?void 0:p.attribute.dx)&&void 0!==f?f:0,dy:null!==(m=null===(v=t.firstChild)||void 0===v?void 0:v.attribute.dy)&&void 0!==m?m:0}),t.forEachChildren((t=>{var e;t.setAttribute("dy",(null!==(e=t.attribute.dy)&&void 0!==e?e:0)-i+2)}))}else if(A>i){const e=A-i;!o.has(`${t.col}-${t.row}`)&&o.set(`${t.col}-${t.row}`,{col:t.col,row:t.row,dx:null!==(y=null===(b=t.firstChild)||void 0===b?void 0:b.attribute.dx)&&void 0!==y?y:0,dy:null!==(w=null===(C=t.firstChild)||void 0===C?void 0:C.attribute.dy)&&void 0!==w?w:0}),t.forEachChildren((t=>{var i;t.setAttribute("dy",(null!==(i=t.attribute.dy)&&void 0!==i?i:0)-e)}))}}function WR(t,e,i,o,n,r){if(at(t.mergeStartCol)&&at(t.mergeStartRow)&&at(t.mergeEndCol)&&at(t.mergeEndRow)){const{colStart:s,colEnd:l,rowStart:a,rowEnd:h}=EA(t,r.scenegraph);for(let t=s;t<=l;t++)for(let s=a;s<=h;s++)NR(r.scenegraph.getCell(t,s),e,i,o,n)}else NR(t,e,i,o,n)}function NR(t,e,i,o,n){var r,s,l,a,h,d,c,u,g,p,f,v,m,b,y,C,w,x;const _=t.getChildByName("text",!0)||t.getChildByName("image",!0);if(!_)return;if("image"===_.type){const{image:t}=_.attribute;if(!t||!_.resources)return;if("success"!==_.resources.get(t).state)return}const S=null!==(s=null!==(r=_.attribute.textAlign)&&void 0!==r?r:_.textAlign)&&void 0!==s?s:"left";_.AABBBounds.width();const A=_.globalAABBBounds.x1,B=_.globalAABBBounds.x2;if("center"===S&&n){const n=t.globalAABBBounds.x1+(null!==(a=null===(l=t.firstChild)||void 0===l?void 0:l.attribute.dx)&&void 0!==a?a:0),r=n+(null!==(d=null!==(h=t.contentWidth)&&void 0!==h?h:t.attribute.width)&&void 0!==d?d:0);if(n<e||r>i){const s=Math.max(n,e),l=Math.min(r,i),a=_.globalTransMatrix.e-(l+s)/2;!o.has(`${t.col}-${t.row}`)&&o.set(`${t.col}-${t.row}`,{col:t.col,row:t.row,dx:null!==(u=null===(c=t.firstChild)||void 0===c?void 0:c.attribute.dx)&&void 0!==u?u:0,dy:null!==(p=null===(g=t.firstChild)||void 0===g?void 0:g.attribute.dy)&&void 0!==p?p:0}),t.forEachChildren((t=>{var e;t.setAttribute("dx",(null!==(e=t.attribute.dx)&&void 0!==e?e:0)-a+2)}))}}else if(A<e){const i=A-e;!o.has(`${t.col}-${t.row}`)&&o.set(`${t.col}-${t.row}`,{col:t.col,row:t.row,dx:null!==(v=null===(f=t.firstChild)||void 0===f?void 0:f.attribute.dx)&&void 0!==v?v:0,dy:null!==(b=null===(m=t.firstChild)||void 0===m?void 0:m.attribute.dy)&&void 0!==b?b:0}),t.forEachChildren((t=>{var e;t.setAttribute("dx",(null!==(e=t.attribute.dx)&&void 0!==e?e:0)-i+2)}))}else if(B>i){const e=B-i;!o.has(`${t.col}-${t.row}`)&&o.set(`${t.col}-${t.row}`,{col:t.col,row:t.row,dx:null!==(C=null===(y=t.firstChild)||void 0===y?void 0:y.attribute.dx)&&void 0!==C?C:0,dy:null!==(x=null===(w=t.firstChild)||void 0===w?void 0:w.attribute.dy)&&void 0!==x?x:0}),t.forEachChildren((t=>{var i;t.setAttribute("dx",(null!==(i=t.attribute.dx)&&void 0!==i?i:0)-e)}))}}function GR(t){var e,i;const o=t.internalProps.layoutMap.headerObjects,n=t.internalProps.layoutMap.columnObjects;for(let t=0;t<o.length;t++){const i=o[t];if(i&&(null===(e=i.style)||void 0===e?void 0:e.textStick))return!0}for(let t=0;t<n.length;t++){const e=n[t];if(e&&(null===(i=e.style)||void 0===i?void 0:i.textStick))return!0}return!!(t.theme.headerStyle.textStick||t.theme.rowHeaderStyle.textStick||t.theme.bodyStyle.textStick)}var jR=function(t,e,i,o){return new(i||(i=Promise))((function(n,r){function s(t){try{a(o.next(t))}catch(t){r(t)}}function l(t){try{a(o.throw(t))}catch(t){r(t)}}function a(t){var e;t.done?n(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(s,l)}a((o=o.apply(t,e||[])).next())}))};class VR{constructor(t){this.isRelease=!1,this.mode="column",this.rowLimit=200,this.currentRow=0,this.rowStart=0,this.rowEnd=0,this.referenceRow=0,this.screenTopRow=0,this.deltaY=0,this.deltaHeight=0,this.colLimit=100,this.screenLeftCol=0,this.deltaX=0,this.deltaWidth=0,this.cellCache=new Map,this.table=t,this.table.isPivotChart()?(this.rowLimit=Math.max(100,Math.ceil(2*t.tableNoFrameHeight/t.defaultRowHeight)),this.colLimit=Math.max(100,Math.ceil(2*t.tableNoFrameWidth/t.defaultColWidth))):"autoHeight"===this.table.heightMode?this.rowLimit=Math.max(100,Math.ceil(2*t.tableNoFrameHeight/t.defaultRowHeight)):("autoWidth"===this.table.widthMode||(this.rowLimit=Math.max(200,Math.ceil(2*t.tableNoFrameHeight/t.defaultRowHeight))),this.colLimit=Math.max(100,Math.ceil(2*t.tableNoFrameWidth/t.defaultColWidth))),this.table.internalProps.transpose?this.mode="row":this.table.isPivotTable()&&(this.mode="pivot"),this.table.options.maintainedDataCount&&(this.rowLimit=this.table.options.maintainedDataCount)}get bodyLeftCol(){return this.table.frozenColCount}setParamsForColumn(){this.bodyRightCol=this.table.colCount-1-this.table.rightFrozenColCount;const t=Math.min(this.colLimit,this.bodyRightCol-this.bodyLeftCol+1);this.totalActualBodyColCount=t,this.totalCol=this.bodyLeftCol+t-1,this.colStart=this.bodyLeftCol,this.colEnd=this.totalCol;const e=this.table.defaultColWidth;this.taskColCount=1*Math.ceil(this.table.tableNoFrameWidth/e);const i=e*t,o=e*(this.bodyRightCol-this.bodyLeftCol+1);this.xLimitLeft=i/2,this.xLimitRight=o-i/2;const n=5*this.table.tableNoFrameWidth;this.screenColCount=Math.ceil(this.table.tableNoFrameWidth/e),this.firstScreenColLimit=Math.max(15,this.bodyLeftCol+Math.min(this.colLimit,Math.ceil(n/e))),this.colUpdatePos=this.bodyRightCol}setParamsForRow(){this.bodyTopRow=this.table.frozenRowCount,this.bodyBottomRow=this.table.rowCount-1-this.table.bottomFrozenRowCount;const t=Math.min(this.rowLimit,this.bodyBottomRow-this.bodyTopRow+1);this.totalActualBodyRowCount=t,this.totalRow=this.bodyTopRow+t-1,this.rowStart=this.bodyTopRow,this.rowEnd=this.totalRow;const e=this.table.defaultRowHeight;this.taskRowCount=1*Math.ceil(this.table.tableNoFrameHeight/e);const i=e*t,o=e*(this.bodyBottomRow-this.bodyTopRow+1);this.yLimitTop=i/2,this.yLimitBottom=o-i/2;const n=5*this.table.tableNoFrameHeight;this.screenRowCount=Math.ceil(this.table.tableNoFrameHeight/e),this.firstScreenRowLimit=Math.max(30,this.bodyTopRow+Math.min(this.rowLimit,Math.ceil(n/e))),this.rowUpdatePos=this.bodyBottomRow}refreshRowCount(){this.bodyTopRow=this.table.frozenRowCount,this.bodyBottomRow=this.table.rowCount-1-this.table.bottomFrozenRowCount;const t=Math.min(this.rowLimit,this.bodyBottomRow-this.bodyTopRow+1);this.totalActualBodyRowCount=t,this.totalRow=this.rowStart+t-1,this.rowStart=this.bodyTopRow,this.rowEnd=this.totalRow}refreshColCount(){this.bodyRightCol=this.table.colCount-1-this.table.rightFrozenColCount;const t=Math.min(this.colLimit,this.bodyRightCol-this.bodyLeftCol+1);this.totalActualBodyColCount=t,this.totalCol=this.bodyLeftCol+t-1,this.colStart=this.bodyLeftCol,this.colEnd=this.totalCol}resize(){const t=this.table.defaultColWidth;this.taskColCount=1*Math.ceil(this.table.tableNoFrameWidth/t);const e=5*this.table.tableNoFrameWidth;this.screenColCount=Math.ceil(this.table.tableNoFrameWidth/t),this.firstScreenColLimit=this.bodyLeftCol+Math.min(this.colLimit,Math.ceil(e/t));const i=this.table.defaultRowHeight;this.taskRowCount=1*Math.ceil(this.table.tableNoFrameHeight/i);const o=5*this.table.tableNoFrameHeight;this.screenRowCount=Math.ceil(this.table.tableNoFrameHeight/i),this.firstScreenRowLimit=this.bodyTopRow+Math.min(this.rowLimit,Math.ceil(o/i))}createGroupForFirstScreen(t,e,i,o,n,r,s,l){!function(t,e,i,o,n,r,s,l,a){var h,d,c,u,g,p,f,v,m,b,y,C;const{table:w}=a,{leftBottomCornerGroup:x,rightTopCornerGroup:_,rightBottomCornerGroup:S}=w.scenegraph;let A,B,R;a.setParamsForRow(),a.setParamsForColumn(),"adaptive"===w.widthMode||w.options.autoWrapText&&("adaptive"===w.heightMode||"autoHeight"===w.heightMode)?(R=w.colCount-1,A=Math.min(a.firstScreenColLimit,w.colCount-1)):A=Math.min(a.firstScreenColLimit,w.colCount-1),"adaptive"===w.heightMode?(R=w.rowCount-1,B=Math.min(a.firstScreenRowLimit,w.rowCount-1)):B=Math.min(a.firstScreenRowLimit,w.rowCount-1),0===w.internalProps._widthResizedColMap.size&&oR(w,0,null!=R?R:A),0===w.internalProps._heightResizedRowMap.size&&BA(w,0,B),A<w.colCount-w.rightFrozenColCount&&oR(w,w.colCount-w.rightFrozenColCount,w.colCount-1),B<w.rowCount-w.bottomFrozenRowCount&&BA(w,w.rowCount-w.bottomFrozenRowCount,w.rowCount-1),w.scenegraph.colHeaderGroup.setAttribute("x",w.getFrozenColsWidth()),w.scenegraph.rowHeaderGroup.setAttribute("y",w.getFrozenRowsHeight()),w.scenegraph.bottomFrozenGroup.setAttribute("x",w.getFrozenColsWidth()),w.scenegraph.rightFrozenGroup.setAttribute("y",w.getFrozenRowsHeight()),w.scenegraph.bodyGroup.setAttributes({x:w.getFrozenColsWidth(),y:w.getFrozenRowsHeight()}),fR(t,s,l,0,w.frozenColCount-1,0,w.frozenRowCount-1,w.isListTable()?"columnHeader":"cornerHeader",w),A-w.rightFrozenColCount>=w.frozenColCount&&fR(e,s,l,w.frozenColCount,A-w.rightFrozenColCount,0,w.frozenRowCount-1,"columnHeader",w),w.frozenColCount>0&&(w.leftRowSeriesNumberCount>0&&fR(i,s,l,0,w.leftRowSeriesNumberCount-1,w.frozenRowCount,B-w.bottomFrozenRowCount,"rowHeader",w),w.rowHeaderLevelCount>0&&fR(i,s,l,w.leftRowSeriesNumberCount,w.leftRowSeriesNumberCount+w.rowHeaderLevelCount-1,w.frozenRowCount,B-w.bottomFrozenRowCount,"rowHeader",w),w.frozenColCount>w.rowHeaderLevelCount+w.leftRowSeriesNumberCount&&fR(i,s,l,w.rowHeaderLevelCount+w.leftRowSeriesNumberCount,w.frozenColCount-1,w.frozenRowCount,B-w.bottomFrozenRowCount,"body",w)),w.bottomFrozenRowCount>0&&(w.frozenColCount>0&&(w.leftRowSeriesNumberCount>0&&fR(x,s,l,0,w.leftRowSeriesNumberCount-1,w.rowCount-1-w.bottomFrozenRowCount+1,w.rowCount-1,"rowHeader",w),w.rowHeaderLevelCount>0&&fR(x,s,l,w.leftRowSeriesNumberCount,w.leftRowSeriesNumberCount+w.rowHeaderLevelCount-1,w.rowCount-1-w.bottomFrozenRowCount+1,w.rowCount-1,"rowHeader",w),w.frozenColCount>w.rowHeaderLevelCount+w.leftRowSeriesNumberCount&&fR(x,s,l,w.rowHeaderLevelCount+w.leftRowSeriesNumberCount,w.frozenColCount-1,w.rowCount-1-w.bottomFrozenRowCount+1,w.rowCount-1,"body",w)),A-w.rightFrozenColCount>=w.frozenColCount&&fR(n,s,l,w.frozenColCount,A-w.rightFrozenColCount,w.rowCount-1-w.bottomFrozenRowCount+1,w.rowCount-1,w.isPivotChart()?"rowHeader":"body",w)),w.rightFrozenColCount>0&&(fR(_,s,l,w.colCount-1-w.rightFrozenColCount+1,w.colCount-1,0,w.frozenRowCount-1,"columnHeader",w),fR(o,s,l,w.colCount-1-w.rightFrozenColCount+1,w.colCount-1,w.frozenRowCount,B-w.bottomFrozenRowCount,w.isPivotChart()?"rowHeader":"body",w)),w.bottomFrozenRowCount>0&&w.rightFrozenColCount>0&&fR(S,s,l,w.colCount-1-w.rightFrozenColCount+1,w.colCount-1,w.rowCount-1-w.bottomFrozenRowCount+1,w.rowCount-1,"body",w),A-w.rightFrozenColCount>=w.frozenColCount&&fR(r,s,l,w.frozenColCount,A-w.rightFrozenColCount,w.frozenRowCount,B-w.bottomFrozenRowCount,"body",w),r.firstChild||e.firstChild||t.firstChild||i.firstChild?(a.currentRow=null!==(u=null!==(d=null===(h=r.firstChild)||void 0===h?void 0:h.rowNumber)&&void 0!==d?d:null===(c=i.firstChild)||void 0===c?void 0:c.rowNumber)&&void 0!==u?u:a.totalRow,a.rowEnd=a.currentRow,a.rowUpdatePos=a.rowEnd+1,a.referenceRow=a.rowStart+Math.floor((a.rowEnd-a.rowStart)/2),a.currentCol=null!==(C=null!==(b=null!==(v=null!==(p=null===(g=r.lastChild)||void 0===g?void 0:g.col)&&void 0!==p?p:null===(f=e.lastChild)||void 0===f?void 0:f.col)&&void 0!==v?v:null===(m=i.lastChild)||void 0===m?void 0:m.col)&&void 0!==b?b:null===(y=t.lastChild)||void 0===y?void 0:y.col)&&void 0!==C?C:a.totalCol,a.colEnd=a.currentCol,a.colUpdatePos=a.colEnd+1,a.referenceCol=a.colStart+Math.floor((a.colEnd-a.colStart)/2),a.progress()):(a.currentRow=a.totalRow,a.rowEnd=a.currentRow,a.rowUpdatePos=a.rowEnd+1,a.referenceRow=a.rowStart+Math.floor((a.rowEnd-a.rowStart)/2),a.currentCol=a.totalCol,a.colEnd=a.currentCol,a.colUpdatePos=a.colEnd+1,a.referenceCol=a.colStart+Math.floor((a.colEnd-a.colStart)/2))}(t,e,i,o,n,r,s,l,this)}progress(){return jR(this,void 0,void 0,(function*(){if(!this.isProgressing)return this.isProgressing=!0,new Promise(((t,e)=>{setTimeout((()=>jR(this,void 0,void 0,(function*(){this.isProgressing=!1,this.isRelease||(this.colUpdatePos<=this.colEnd?(yield this.updateColCellGroupsAsync(),yield this.progress()):this.rowUpdatePos<=this.rowEnd?(yield this.updateRowCellGroupsAsync(),yield this.progress()):this.currentCol<this.totalCol?(yield this.createCol(),yield this.progress()):this.currentRow<this.totalRow&&(yield this.createRow(),yield this.progress()),IR(this.table),this.table.scenegraph.updateNextFrame(),t())}))),16)}))}))}createRow(){return jR(this,void 0,void 0,(function*(){this.taskRowCount&&this.createRowCellGroup(this.taskRowCount)}))}createCol(){return jR(this,void 0,void 0,(function*(){this.taskColCount&&this.createColGroup(this.taskRowCount)}))}createRowCellGroup(t){const e=Math.min(this.totalRow,this.currentRow+t);if(BA(this.table,this.currentRow+1,e,!1),this.rowEnd=e,this.table.frozenColCount){let t=0;for(let i=0;i<this.table.frozenColCount;i++){const o=this.table.scenegraph.getColGroup(i),n=this.table.isListTable()?"body":"rowHeader",{height:r}=cR(o,i,o.attribute.width,this.currentRow+1,e,this.table.scenegraph.mergeMap,this.table.internalProps.defaultRowHeight,this.table,n);t=Math.max(t,r),this.table.scenegraph.rowHeaderGroup.setAttribute("height",t)}}if(this.table.rightFrozenColCount){let t=0;for(let i=this.table.colCount-this.table.rightFrozenColCount;i<this.table.colCount;i++){const o=this.table.scenegraph.getColGroup(i),n=this.table.isPivotChart()?"rowHeader":"body",{height:r}=cR(o,i,o.attribute.width,this.currentRow+1,e,this.table.scenegraph.mergeMap,this.table.internalProps.defaultRowHeight,this.table,n);t=Math.max(t,r),this.table.scenegraph.rightFrozenGroup.setAttribute("height",t)}}let i=0;for(let t=this.bodyLeftCol;t<=this.bodyRightCol;t++){const o=this.table.scenegraph.getColGroup(t);if(!o)continue;const n=t<this.table.rowHeaderLevelCount?"rowHeader":"body",{height:r}=cR(o,t,o.attribute.width,this.currentRow+1,e,this.table.scenegraph.mergeMap,this.table.internalProps.defaultRowHeight,this.table,n);i=Math.max(i,r)}this.table.scenegraph.bodyGroup.setAttribute("height",i),this.currentRow=e,this.rowUpdatePos=this.rowEnd,this.table.scenegraph.updateContainer(),this.table.scenegraph.updateBorderSizeAndPosition()}createColGroup(t){const e=Math.min(this.totalCol,this.currentCol+t);oR(this.table,this.currentCol+1,e),this.colEnd=e;for(let t=0;t<this.table.rowCount;t++){const e=this.highPerformanceGetCell(this.currentCol,t);"cell"===e.role&&at(e.mergeStartCol)&&e.mergeStartCol>this.currentCol&&this.table.scenegraph.updateCellContent(e.col,e.row)}if(this.table.frozenRowCount){const t=this.table.scenegraph.colHeaderGroup.lastChild instanceof zS?this.table.scenegraph.colHeaderGroup.lastChild:this.table.scenegraph.colHeaderGroup.lastChild._prev,i=t.attribute.x+t.attribute.width,o=t.attribute.y;fR(this.table.scenegraph.colHeaderGroup,i,o,this.currentCol+1,e,0,this.table.frozenRowCount-1,"columnHeader",this.table)}if(this.table.bottomFrozenRowCount){const t=this.table.scenegraph.bottomFrozenGroup.lastChild instanceof zS?this.table.scenegraph.bottomFrozenGroup.lastChild:this.table.scenegraph.bottomFrozenGroup.lastChild._prev,i=t.attribute.x+t.attribute.width,o=t.attribute.y;fR(this.table.scenegraph.bottomFrozenGroup,i,o,this.currentCol+1,e,this.table.rowCount-this.table.bottomFrozenRowCount,this.table.rowCount-1,"columnHeader",this.table)}let i=this.table.scenegraph.bodyGroup.lastChild&&(this.table.scenegraph.bodyGroup.lastChild instanceof zS?this.table.scenegraph.bodyGroup.lastChild:this.table.scenegraph.bodyGroup.lastChild._prev);i||(i=this.table.scenegraph.colHeaderGroup.lastChild&&(this.table.scenegraph.colHeaderGroup.lastChild instanceof zS?this.table.scenegraph.colHeaderGroup.lastChild:this.table.scenegraph.colHeaderGroup.lastChild._prev));const o=i.attribute.x+i.attribute.width,n=i.attribute.y;fR(this.table.scenegraph.bodyGroup,o,n,this.currentCol+1,e,this.rowStart,this.rowEnd,"body",this.table),this.currentCol=e,this.colUpdatePos=this.colEnd,this.table.scenegraph.updateContainer(),this.table.scenegraph.updateBorderSizeAndPosition()}setY(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return jR(this,void 0,void 0,(function*(){const i=this.table.getRowsHeight(this.bodyTopRow,this.bodyTopRow+(this.rowEnd-this.rowStart+1))/2,o=this.table.getAllRowsHeight()-i,n=this.table.getTargetRowAt(t+this.table.scenegraph.colHeaderGroup.attribute.height);n&&(this.screenTopRow=n.row),t<i&&this.rowStart===this.bodyTopRow||t>o&&this.rowEnd===this.bodyBottomRow?(this.updateDeltaY(t),this.updateBody(t-this.deltaY)):this.table.scenegraph.bodyGroup.firstChild&&0!==this.table.scenegraph.bodyGroup.firstChild.childrenCount||this.table.scenegraph.rowHeaderGroup.firstChild&&0!==this.table.scenegraph.rowHeaderGroup.firstChild.childrenCount?this.dynamicSetY(t,n,e):(this.updateDeltaY(t),this.updateBody(t-this.deltaY))}))}setX(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return jR(this,void 0,void 0,(function*(){const i=this.table.getColsWidth(this.bodyLeftCol,this.bodyLeftCol+(this.colEnd-this.colStart+1))/2,o=this.table.getAllColsWidth()-i,n=this.table.getTargetColAt(t+this.table.scenegraph.rowHeaderGroup.attribute.width);n&&(this.screenLeftCol=n.col),t<i&&this.colStart===this.bodyLeftCol||t>o&&this.colEnd===this.bodyRightCol||this.table.scenegraph.bodyGroup.firstChild&&0===this.table.scenegraph.bodyGroup.firstChild.childrenCount?(this.updateDeltaX(t),this.table.scenegraph.setBodyAndColHeaderX(-t+this.deltaX)):this.dynamicSetX(t,n,e)}))}dynamicSetY(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return jR(this,void 0,void 0,(function*(){LR(t,e,i,this)}))}dynamicSetX(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return jR(this,void 0,void 0,(function*(){wR(t,e,i,this)}))}updateBody(t){this.table.scenegraph.setBodyAndRowHeaderY(-t)}updateRowCellGroupsAsync(){return jR(this,void 0,void 0,(function*(){this.updateCellGroups(this.taskRowCount)}))}updateCellGroups(t){const e=Math.min(this.bodyBottomRow,this.rowUpdatePos+t);"autoHeight"===this.table.heightMode&&BA(this.table,this.rowUpdatePos,e,!1),HR(this.rowUpdatePos,e,this),"autoHeight"===this.table.heightMode&&(MR(this.bodyLeftCol,this.bodyRightCol,this.rowUpdatePos,e,this.table,this.rowUpdateDirection,!0),MR(0,this.table.frozenColCount-1,this.rowUpdatePos,e,this.table,this.rowUpdateDirection,!0),MR(this.table.colCount-this.table.rightFrozenColCount,this.table.colCount-1,this.rowUpdatePos,e,this.table,this.rowUpdateDirection,!0)),this.rowUpdatePos=e+1}updateBottomFrozenCellGroups(){const t=this.table.rowCount-this.table.bottomFrozenRowCount,e=this.table.rowCount-1;"autoHeight"===this.table.heightMode&&BA(this.table,t,e,!1),HR(t,e,this),"autoHeight"===this.table.heightMode&&(MR(this.bodyLeftCol,this.bodyRightCol,t,e,this.table,this.rowUpdateDirection),MR(0,this.table.frozenColCount-1,t,e,this.table,this.rowUpdateDirection),MR(this.table.colCount-this.table.rightFrozenColCount,this.table.colCount-1,t,e,this.table,this.rowUpdateDirection))}updateRightFrozenCellGroups(){const t=this.table.colCount-this.table.rightFrozenColCount,e=this.table.colCount-1;"autoWidth"===this.table.widthMode&&oR(this.table,t,e,!1),RR(t,e,this),"autoHeight"===this.table.heightMode&&bR(t,e,this.table,this.colUpdateDirection)}updateColCellGroupsAsync(){return jR(this,void 0,void 0,(function*(){this.updateColGroups(this.taskRowCount)}))}updateColGroups(t){const e=Math.min(this.bodyRightCol,this.colUpdatePos+t);oR(this.table,this.colUpdatePos,e),RR(this.colUpdatePos,e,this),this.colUpdatePos=e+1}updateCellGroupPosition(t,e,i){t.row=e,t.mergeStartCol=void 0,t.mergeStartRow=void 0,t.mergeEndCol=void 0,t.mergeEndRow=void 0,t.setAttribute("y",i),t.needUpdate=!0,t.needUpdateForAutoRowHeight=!0}updateCellGroupContent(t){if(!t.needUpdate||"cell"!==t.role)return t;const e=this.table.scenegraph.updateCellContent(t.col,t.row);return t.needUpdate=!1,e||t}sortCellVertical(){return jR(this,void 0,void 0,(function*(){yield function(t){var e;return FR(this,void 0,void 0,(function*(){let i,o;t.table.scenegraph.bodyGroup.forEachChildren(((t,e)=>{"group"===t.type&&(t.needUpdate=!0,null==t||t.forEachChildren((t=>{t.needUpdate=!0})))})),"autoHeight"===t.table.heightMode?(i=t.rowStart,o=t.rowEnd):(i=Math.max(t.bodyTopRow,t.screenTopRow-1*t.screenRowCount),o=Math.min(t.bodyBottomRow,t.screenTopRow+2*t.screenRowCount,t.table.rowCount-1));const n=t.table.getAllRowsHeight();BA(t.table,i,o);const r=t.table.getAllRowsHeight();n!==r&&t.table.scenegraph.updateContainerHeight(t.table.frozenRowCount,r-n);for(let i=0;null!==(e=i<t.table.frozenColCount)&&void 0!==e&&e;i++){const e=t.table.scenegraph.getColGroup(i);null==e||e.setAttribute("chartInstance",void 0);for(let e=t.rowStart;e<=t.rowEnd;e++)t.table.scenegraph.updateCellContent(i,e);for(let e=t.table.rowCount-t.table.bottomFrozenRowCount;e<t.table.rowCount;e++)t.table.scenegraph.updateCellContent(i,e)}for(let e=t.colStart;e<=t.colEnd;e++){const i=t.table.scenegraph.getColGroup(e);null==i||i.setAttribute("chartInstance",void 0);for(let i=t.table.rowCount-t.table.bottomFrozenRowCount;i<t.table.rowCount;i++)t.table.scenegraph.updateCellContent(e,i)}for(let e=t.table.colCount-t.table.rightFrozenColCount;e<t.table.colCount;e++){const i=t.table.scenegraph.getColGroup(e);null==i||i.setAttribute("chartInstance",void 0);for(let i=t.rowStart;i<=t.rowEnd;i++)t.table.scenegraph.updateCellContent(e,i);for(let i=t.table.rowCount-t.table.bottomFrozenRowCount;i<t.table.rowCount;i++)t.table.scenegraph.updateCellContent(e,i)}HR(i,o,t),"autoHeight"===t.table.heightMode&&MR(t.bodyLeftCol,t.bodyRightCol,i,o,t.table,t.rowEnd>t.bodyBottomRow-(t.rowEnd-t.rowStart+1)?"down":"up"),t.rowUpdatePos=t.rowStart,t.rowUpdateDirection=t.rowEnd>t.bodyBottomRow-(t.rowEnd-t.rowStart+1)?"down":"up",t.table.scenegraph.updateNextFrame(),"autoHeight"!==t.table.heightMode&&(yield t.progress())}))}(this)}))}sortCellHorizontal(){return jR(this,void 0,void 0,(function*(){yield function(t){return zR(this,void 0,void 0,(function*(){t.table.scenegraph.bodyGroup.forEachChildren(((t,e)=>{"group"===t.type&&(t.needUpdate=!0,null==t||t.forEachChildren((t=>{t.needUpdate=!0})))}));const e=Math.max(t.bodyLeftCol,t.screenLeftCol-1*t.screenColCount),i=Math.min(t.bodyRightCol,t.screenLeftCol+2*t.screenColCount);oR(t.table,e,i);for(let e=t.colStart;e<=t.colEnd;e++){const i=t.table.scenegraph.getColGroup(e);null==i||i.setAttribute("chartInstance",void 0);for(let i=t.table.rowCount-t.table.bottomFrozenRowCount;i<t.table.rowCount;i++)t.table.scenegraph.updateCellContent(e,i)}for(let e=t.table.colCount-t.table.rightFrozenColCount;e<t.table.colCount;e++){const i=t.table.scenegraph.getColGroup(e);null==i||i.setAttribute("chartInstance",void 0);for(let i=t.rowStart;i<=t.rowEnd;i++)t.table.scenegraph.updateCellContent(e,i);for(let i=t.table.rowCount-t.table.bottomFrozenRowCount;i<t.table.rowCount;i++)t.table.scenegraph.updateCellContent(e,i)}RR(e,i,t),t.colUpdatePos=t.colStart,t.colUpdateDirection=t.colEnd>t.bodyRightCol-(t.colEnd-t.colStart+1)?"right":"left",t.table.scenegraph.updateNextFrame(),yield t.progress()}))}(this)}))}highPerformanceGetCell(t,e,i){if(e>=this.table.frozenRowCount&&e<this.table.rowCount-this.table.bottomFrozenRowCount&&(e<this.rowStart||e>this.rowEnd))return dR;if(t>=this.table.frozenColCount&&t<this.table.colCount-this.table.rightFrozenColCount&&(t<this.colStart||t>this.colEnd))return dR;if(this.cellCache.get(t)){const o=this.cellCache.get(t);if((o._next||o._prev)&&Math.abs(o.row-e)<e){let n=UR(o,e);return n&&(i||"shadow-cell"!==n.role)||(n=this.table.scenegraph.getCell(t,e,i)),n.row&&this.cellCache.set(t,n),n}const n=this.table.scenegraph.getCell(t,e,i);return n.col===t&&n.row&&this.cellCache.set(t,n),n}const o=this.table.scenegraph.getCell(t,e,i);return o.col===t&&o.row&&this.cellCache.set(t,o),o}updateDeltaY(t,e,i){if(this.rowStart===this.bodyTopRow){const t=this.table.scenegraph.highPerformanceGetCell(this.colStart,this.rowStart,!0);if("cell"===t.role){const e=t.attribute.y;this.deltaY=-e}}else if(this.rowEnd===this.bodyBottomRow){const t=this.table.scenegraph.highPerformanceGetCell(this.colStart,this.rowEnd,!0);if("cell"===t.role){const e=t.attribute.y+t.attribute.height-(this.table.getAllRowsHeight()-this.table.getFrozenRowsHeight()-this.table.getBottomFrozenRowsHeight());this.deltaY=-e}}else if(Q(e)&&Q(i)){let o=this.table.scenegraph.highPerformanceGetCell(this.colStart,i,!0);"cell"!==o.role&&(o=this.table.scenegraph.highPerformanceGetCell(0,i,!0));const n=t-this.deltaY,r=e-n,s=o.attribute.y-n+this.table.getFrozenRowsHeight();this.deltaY=r-s}}updateDeltaX(t,e,i){if(this.colStart===this.bodyLeftCol){const t=this.table.scenegraph.getColGroup(this.colStart);if(t){const e=t.attribute.x;this.deltaX=-e}}else if(this.colEnd===this.bodyRightCol){const t=this.table.scenegraph.getColGroup(this.colEnd);if(t){const e=t.attribute.x+t.attribute.width-(this.table.getAllColsWidth()-this.table.getFrozenColsWidth()-this.table.getRightFrozenColsWidth());this.deltaX=-e}}else if(Q(e)&&Q(i)){const o=this.table.scenegraph.getColGroup(i)||this.table.scenegraph.getColGroup(i,!0),n=t-this.deltaX,r=e-n,s=o.attribute.x-n+this.table.getFrozenColsWidth();this.deltaX=r-s}}release(){this.isRelease=!0}}function UR(t,e){if(!t)return null;if(t.row===e)return t;const i=t._prev,o=t._next;return t.row>e&&i&&i.row===t.row-1?UR(i,e):t.row<e&&o&&o.row===t.row+1?UR(o,e):null}function $R(t,e,i){var o,n,r,s,l,a,h,d,c;const u=i.table,[g,p,f,v]=e.split("-"),m=parseInt(g,10),b=parseInt(p,10),y=parseInt(f,10),C=parseInt(v,10);let w,x=m,_=b,S=y,A=C;switch(t.role){case"rowHeader":w=u.getBodyVisibleRowRange(),w&&(_=Math.max(b,w.rowStart-1),A=Math.min(C,w.rowEnd+1));break;case"columnHeader":case"bottomFrozen":w=u.getBodyVisibleCellRange(),w&&(x=Math.max(m,w.colStart-1),S=Math.min(y,w.colEnd+1));break;case"cornerHeader":case"rightTopCorner":case"leftBottomCorner":case"rightBottomCorner":break;case"rightFrozen":w=u.getBodyVisibleCellRange(),w&&(_=Math.max(b,w.rowStart-1),A=Math.min(C,w.rowEnd+1));break;default:w=u.getBodyVisibleCellRange(),w&&(_=Math.max(b,w.rowStart-1),A=Math.min(C,w.rowEnd+1),x=Math.max(m,w.colStart-1),S=Math.min(y,w.colEnd+1))}const B=u.getColsWidth(x,S),R=u.getRowsHeight(_,A),M=i.highPerformanceGetCell(x,_).globalAABBBounds,T=i.highPerformanceGetCell(S,A).globalAABBBounds;t.rect.setAttributes({x:M.x1-i.tableGroup.attribute.x,y:M.y1-i.tableGroup.attribute.y,width:B,height:R,visible:!0}),t.fillhandle&&(null===(o=t.fillhandle)||void 0===o||o.setAttributes({x:T.x2-i.tableGroup.attribute.x-3,y:T.y2-i.tableGroup.attribute.y-3,width:6,height:6,visible:!0}));let k=!!u.frozenColCount&&m===u.frozenColCount;!k&&u.frozenColCount&&u.scrollLeft>0&&m>=u.frozenColCount&&u.getColsWidth(0,m-1)-u.scrollLeft<u.getFrozenColsWidth()&&(k=!0);let L=!!u.rightFrozenColCount&&u.rightFrozenColCount>0&&y===u.colCount-u.rightFrozenColCount-1;!L&&u.rightFrozenColCount&&y<u.colCount-u.rightFrozenColCount&&u.getColsWidth(0,y)-u.scrollLeft>u.tableNoFrameWidth-u.getRightFrozenColsWidth()&&(L=!0);let P=!u.frozenRowCount||b===u.frozenRowCount;!P&&u.frozenRowCount&&u.scrollTop>0&&b>=u.frozenRowCount&&u.getRowsHeight(0,b-1)-u.scrollTop<u.getFrozenRowsHeight()&&(P=!0);let E=!!u.bottomFrozenRowCount&&C===u.rowCount-u.bottomFrozenRowCount-1;if(!E&&u.bottomFrozenRowCount&&C<u.rowCount-u.bottomFrozenRowCount&&u.getRowsHeight(0,C)-u.scrollTop>u.tableNoFrameHeight-u.getBottomFrozenRowsHeight()&&(E=!0),k&&t.rect.attribute.stroke[3]||L&&t.rect.attribute.stroke[1]||P&&t.rect.attribute.stroke[0]||E&&t.rect.attribute.stroke[2]){if(k&&t.rect.attribute.stroke[3]&&i.tableGroup.insertAfter(t.rect,"columnHeader"===t.role?i.cornerHeaderGroup:"bottomFrozen"===t.role?i.leftBottomCornerGroup:i.rowHeaderGroup),E&&t.rect.attribute.stroke[2]&&i.tableGroup.insertAfter(t.rect,"rowHeader"===t.role?i.leftBottomCornerGroup:"rightFrozen"===t.role?i.rightBottomCornerGroup:i.bottomFrozenGroup),P&&t.rect.attribute.stroke[0]&&i.tableGroup.insertAfter(t.rect,"rowHeader"===t.role?i.cornerHeaderGroup:"rightFrozen"===t.role?i.rightTopCornerGroup:i.colHeaderGroup),L&&t.rect.attribute.stroke[1]&&i.tableGroup.insertAfter(t.rect,"columnHeader"===t.role?i.rightTopCornerGroup:"bottomFrozen"===t.role?i.rightBottomCornerGroup:i.rightFrozenGroup),t.rect.attribute.x<u.getFrozenColsWidth()&&u.scrollLeft>0&&("body"===t.role||"columnHeader"===t.role||"bottomFrozen"===t.role)){const e=t.rect.attribute.width-(u.getFrozenColsWidth()-t.rect.attribute.x);t.rect.setAttributes({x:t.rect.attribute.x+(u.getFrozenColsWidth()-t.rect.attribute.x),width:e>0?e:0}),null===(n=t.fillhandle)||void 0===n||n.setAttributes({visible:e>0})}if(u.getRightFrozenColsWidth()>0&&i.rightFrozenGroup.attribute.height>0&&t.rect.attribute.x+t.rect.attribute.width>i.rightFrozenGroup.attribute.x&&("body"===t.role||"columnHeader"===t.role||"bottomFrozen"===t.role)){const e=i.rightFrozenGroup.attribute.x-t.rect.attribute.x;t.rect.setAttributes({x:t.rect.attribute.x,width:e>0?e:0}),null===(r=t.fillhandle)||void 0===r||r.setAttributes({visible:e-B>0})}if(t.rect.attribute.y<i.colHeaderGroup.attribute.height&&u.scrollTop>0&&("body"===t.role||"rowHeader"===t.role||"rightFrozen"===t.role)){const e=t.rect.attribute.height-(i.colHeaderGroup.attribute.height-t.rect.attribute.y);t.rect.setAttributes({y:t.rect.attribute.y+(i.colHeaderGroup.attribute.height-t.rect.attribute.y),height:e>0?e:0}),null===(s=t.fillhandle)||void 0===s||s.setAttributes({visible:e>0})}if(i.bottomFrozenGroup.attribute.width>0&&i.bottomFrozenGroup.attribute.height>0&&t.rect.attribute.y+t.rect.attribute.height>i.bottomFrozenGroup.attribute.y&&("body"===t.role||"rowHeader"===t.role||"rightFrozen"===t.role)){const e=i.bottomFrozenGroup.attribute.y-t.rect.attribute.y;t.rect.setAttributes({y:t.rect.attribute.y,height:e>0?e:0}),null===(l=t.fillhandle)||void 0===l||l.setAttributes({visible:e-R>0})}}else i.tableGroup.insertAfter(t.rect,"body"===t.role?i.bodyGroup:"columnHeader"===t.role?i.colHeaderGroup:"rowHeader"===t.role?i.rowHeaderGroup:"cornerHeader"===t.role?i.cornerHeaderGroup:"rightTopCorner"===t.role?i.rightTopCornerGroup:"rightFrozen"===t.role?i.rightFrozenGroup:"leftBottomCorner"===t.role?i.leftBottomCornerGroup:"bottomFrozen"===t.role?i.bottomFrozenGroup:i.rightBottomCornerGroup);let H=0;"number"==typeof t.rect.attribute.lineWidth&&(H=Math.ceil(t.rect.attribute.lineWidth/2)),y===u.colCount-1&&(Array.isArray(t.rect.attribute.lineWidth)&&(H=Math.ceil((null!==(a=t.rect.attribute.lineWidth[1])&&void 0!==a?a:0)/2)),t.rect.setAttributes({width:t.rect.attribute.width-H})),0===m&&(Array.isArray(t.rect.attribute.lineWidth)&&(H=Math.ceil((null!==(h=t.rect.attribute.lineWidth[3])&&void 0!==h?h:0)/2)),t.rect.setAttributes({x:t.rect.attribute.x+H,width:t.rect.attribute.width-H})),C===u.rowCount-1&&(Array.isArray(t.rect.attribute.lineWidth)&&(H=Math.ceil((null!==(d=t.rect.attribute.lineWidth[2])&&void 0!==d?d:0)/2)),t.rect.setAttributes({height:t.rect.attribute.height-H})),0===b&&(Array.isArray(t.rect.attribute.lineWidth)&&(H=Math.ceil((null!==(c=t.rect.attribute.lineWidth[0])&&void 0!==c?c:0)/2)),t.rect.setAttributes({y:t.rect.attribute.y+H,height:t.rect.attribute.height-H}))}function XR(t,e){let i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];const o=t.table,n=e.start.col,r=e.start.row,s=e.end.col,l=e.end.row,a=e.skipBodyMerge;let h=Math.max(Math.min(s,n),0),d=Math.max(Math.min(l,r),0),c=Math.min(Math.max(s,n),o.colCount-1),u=Math.min(Math.max(l,r),o.rowCount-1);const g=()=>{let t=!1;for(let e=h;e<=c;e++){if(e===h)for(let i=d;i<=u;i++){if(!o.isHeader(e,i)&&a)continue;const n=Mx(o,e,i);if(n&&n.start.col<h){h=n.start.col,t=!0;break}}if(!t&&e===c)for(let i=d;i<=u;i++){if(!o.isHeader(e,i)&&a)continue;const n=Mx(o,e,i);if(n&&Math.min(n.end.col,o.colCount-1)>c){c=n.end.col,t=!0;break}}if(t)break}if(!t)for(let e=d;e<=u;e++){if(e===d)for(let i=h;i<=c;i++){if(!o.isHeader(i,e)&&a)continue;const n=Mx(o,i,e);if(n&&n.start.row<d){d=n.start.row,t=!0;break}}if(!t&&e===u)for(let i=h;i<=c;i++){if(!o.isHeader(i,e)&&a)continue;const n=Mx(o,i,e);if(n&&Math.min(n.end.row,o.rowCount-1)>u){u=n.end.row,t=!0;break}}if(t)break}t&&g()};i&&g(),t.selectingRangeComponents.forEach(((t,e)=>{var i;t.rect.delete(),null===(i=t.fillhandle)||void 0===i||i.delete()})),t.selectingRangeComponents=new Map;let p=!1,f=!1,v=!1,m=!1,b=!1,y=!1,C=!1,w=!1,x=!1;if(h<=o.frozenColCount-1&&d<=o.frozenRowCount-1&&(y=!0),c>=o.colCount-o.rightFrozenColCount&&d<=o.frozenRowCount-1&&(C=!0),h<=o.frozenColCount-1&&u>=o.rowCount-o.bottomFrozenRowCount&&(x=!0),c>=o.colCount-o.rightFrozenColCount&&u>=o.rowCount-o.bottomFrozenRowCount&&(w=!0),h<=o.frozenColCount-1&&u>=o.frozenRowCount&&d<=o.rowCount-o.bottomFrozenRowCount-1&&(p=!0),c>=o.colCount-o.rightFrozenColCount&&u>=o.frozenRowCount&&d<=o.rowCount-o.bottomFrozenRowCount-1&&(f=!0),d<=o.frozenRowCount-1&&c>=o.frozenColCount&&h<=o.colCount-o.rightFrozenColCount-1&&(v=!0),u>=o.rowCount-o.bottomFrozenRowCount&&c>=o.frozenColCount&&h<=o.colCount-o.rightFrozenColCount-1&&(m=!0),h<=o.colCount-o.rightFrozenColCount-1&&c>=o.frozenColCount&&d<=o.rowCount-o.bottomFrozenRowCount-1&&u>=o.frozenRowCount&&(b=!0),y){const e=Math.min(c,o.frozenColCount-1),i=Math.min(u,o.frozenRowCount-1),n=[!0,!v,!p,!0];t.createCellSelectBorder(h,d,e,i,"cornerHeader",`${h}${d}${c}${u}`,n)}if(C){const e=Math.max(h,o.colCount-o.rightFrozenColCount),i=Math.min(u,o.frozenRowCount-1),n=[!0,!0,!f,!v];t.createCellSelectBorder(e,d,c,i,"rightTopCorner",`${h}${d}${c}${u}`,n)}if(x){const e=Math.min(c,o.frozenColCount-1),i=Math.max(d,o.rowCount-o.bottomFrozenRowCount),n=[!p,!m,!0,!0];t.createCellSelectBorder(h,i,e,u,"leftBottomCorner",`${h}${d}${c}${u}`,n)}if(w){const e=Math.max(h,o.colCount-o.rightFrozenColCount),i=Math.max(d,o.rowCount-o.bottomFrozenRowCount),n=[!f,!0,!0,!m];t.createCellSelectBorder(e,i,c,u,"rightBottomCorner",`${h}${d}${c}${u}`,n)}if(v){const e=Math.max(h,o.frozenColCount),i=Math.min(c,o.colCount-o.rightFrozenColCount-1),n=Math.min(u,o.frozenRowCount-1),r=[!0,!C,!b,!y];t.createCellSelectBorder(e,d,i,n,"columnHeader",`${h}${d}${c}${u}`,r)}if(m){const e=Math.max(h,o.frozenColCount),i=Math.min(c,o.colCount-o.rightFrozenColCount-1),n=Math.max(d,o.rowCount-o.bottomFrozenRowCount),r=[!b,!w,!0,!x];t.createCellSelectBorder(e,n,i,u,"bottomFrozen",`${h}${d}${c}${u}`,r)}if(p){const e=Math.max(d,o.frozenRowCount),i=Math.min(u,o.rowCount-o.bottomFrozenRowCount-1),n=Math.min(c,o.frozenColCount-1),r=[!y,!b,!x,!0];t.createCellSelectBorder(h,e,n,i,"rowHeader",`${h}${d}${c}${u}`,r)}if(f){const e=Math.max(d,o.frozenRowCount),i=Math.min(u,o.rowCount-o.bottomFrozenRowCount-1),n=Math.max(h,o.colCount-o.rightFrozenColCount),r=[!C,!0,!w,!b];t.createCellSelectBorder(n,e,c,i,"rightFrozen",`${h}${d}${c}${u}`,r)}if(b){const e=Math.max(h,o.frozenColCount),i=Math.max(d,o.frozenRowCount),n=Math.min(c,o.colCount-o.rightFrozenColCount-1),r=Math.min(u,o.rowCount-o.bottomFrozenRowCount-1),s=[!v,!f,!m,!p];t.createCellSelectBorder(e,i,n,r,"body",`${h}${d}${c}${u}`,s)}}function YR(t){t.selectingRangeComponents.forEach(((t,e)=>{t.rect.setAttribute("opacity",0)})),t.selectedRangeComponents.forEach(((t,e)=>{t.rect.setAttribute("opacity",0)}))}function KR(t){t.selectingRangeComponents.forEach(((t,e)=>{t.rect.setAttribute("opacity",1)})),t.selectedRangeComponents.forEach(((t,e)=>{t.rect.setAttribute("opacity",1)}))}function qR(t){t.selectingRangeComponents.forEach(((e,i)=>{var o;t.selectedRangeComponents.get(i)&&(t.selectingRangeComponents.get(i).rect.delete(),null===(o=t.selectingRangeComponents.get(i).fillhandle)||void 0===o||o.delete()),t.selectedRangeComponents.set(i,e)})),t.selectingRangeComponents=new Map,t.updateNextFrame()}function ZR(t){t.selectedRangeComponents.forEach(((t,e)=>{var i;t.rect.delete(),null===(i=t.fillhandle)||void 0===i||i.delete()})),t.selectedRangeComponents=new Map}function JR(t){t.selectingRangeComponents.forEach(((t,e)=>{var i;t.rect.delete(),null===(i=t.fillhandle)||void 0===i||i.delete()})),t.selectingRangeComponents=new Map}function QR(t,e,i,o){const n=o.scenegraph,r=Cw(t.map((t=>t.row))).sort(((t,e)=>e-t)),s=Cw(e.map((t=>t.row))).sort(((t,e)=>t-e)),l=Cw(i.map((t=>t.row))).sort(((t,e)=>t-e));let a;if(l.length&&(a=oM(l[0]-1,l[l.length-1]+1,n)),s.length){const t=oM(s[0]-1,s[s.length-1]+1,n);a=Q(a)?Q(t)?Math.min(a,t):a:t}if(r.length){const t=oM(r[0]-1,r[r.length-1]+1,n);a=Q(a)?Q(t)?Math.min(a,t):a:t}r.forEach((t=>{!function(t,e){const i=e.proxy;t>=i.rowStart&&t<=i.rowEnd&&(eM(t,e),i.rowEnd--,i.currentRow--),i.bodyBottomRow--;const o=Math.min(i.rowLimit,i.bodyBottomRow-i.bodyTopRow+1);i.totalActualBodyRowCount=o,i.totalRow=Math.min(i.table.rowCount-1,i.rowStart+o-1)}(t,n)}));const h=o.rowHeightsMap;if(r.forEach((t=>{h.delete(t)})),r.length){!function(t){function e(e,i){e.row=i;const o=Mx(t.table,e.col,e.row);o?(e.mergeStartCol=o.start.col,e.mergeEndCol=o.end.col,e.mergeStartRow=o.start.row,e.mergeEndRow=o.end.row):(e.mergeStartCol=void 0,e.mergeEndCol=void 0,e.mergeStartRow=void 0,e.mergeEndRow=void 0)}t.bodyGroup.forEachChildren((i=>{let o=t.bodyRowStart;null==i||i.forEachChildren((t=>{e(t,o),o++}))})),t.rowHeaderGroup.forEachChildren((i=>{let o=t.bodyRowStart;null==i||i.forEachChildren((t=>{e(t,o),o++}))})),t.rightFrozenGroup.forEachChildren((i=>{let o=t.bodyRowStart;null==i||i.forEachChildren((t=>{e(t,o),o++}))})),t.bottomFrozenGroup.forEachChildren((i=>{let o=t.table.rowCount-t.table.bottomFrozenRowCount;null==i||i.forEachChildren((t=>{e(t,o),o++}))})),t.leftBottomCornerGroup.forEachChildren((i=>{let o=t.table.rowCount-t.table.bottomFrozenRowCount;null==i||i.forEachChildren((t=>{e(t,o),o++}))})),t.rightBottomCornerGroup.forEachChildren((i=>{let o=t.table.rowCount-t.table.bottomFrozenRowCount;null==i||i.forEachChildren((t=>{e(t,o),o++}))}))}(n);const t=iM(r[r.length-1]-1,r[0]-r.length+1,n);a=Q(a)?Q(t)?Math.min(a,t):a:t}let d;if(n.table._clearRowRangeHeightsMap(),s.forEach((t=>{const e=function(t,e){const i=e.proxy;i.bodyBottomRow++;const o=Math.min(i.rowLimit,i.bodyBottomRow-i.bodyTopRow+1);if(i.totalActualBodyRowCount=o,i.totalRow=i.rowStart+o-1,!(t<i.rowStart))return t>i.rowEnd?i.rowEnd-i.rowStart+1<i.rowLimit?(i.rowEnd++,i.currentRow++,tM(t,e),t):void 0:i.rowEnd-i.rowStart+1<i.rowLimit?(i.rowEnd++,i.currentRow++,tM(t,e),t):t}(t,n);d=null!=d?d:e,h.insert(t)})),function(t){function e(e,i,o){e.row=i,e.setAttribute("y",o);const n=Mx(t.table,e.col,e.row);n?(e.mergeStartCol=n.start.col,e.mergeEndCol=n.end.col,e.mergeStartRow=n.start.row,e.mergeEndRow=n.end.row):(e.mergeStartCol=void 0,e.mergeEndCol=void 0,e.mergeStartRow=void 0,e.mergeEndRow=void 0)}t.bodyGroup.forEachChildren((i=>{let o=t.bodyRowStart,n=t.getCellGroupY(o);null==i||i.forEachChildren((t=>{e(t,o,n),o++,n+=t.attribute.height}))})),t.rowHeaderGroup.forEachChildren((i=>{let o=t.bodyRowStart,n=t.getCellGroupY(o);null==i||i.forEachChildren((t=>{e(t,o,n),o++,n+=t.attribute.height}))})),t.rightFrozenGroup.forEachChildren((i=>{let o=t.bodyRowStart,n=t.getCellGroupY(o);null==i||i.forEachChildren((t=>{e(t,o,n),o++,n+=t.attribute.height}))})),t.bottomFrozenGroup.forEachChildren((i=>{let o=t.table.rowCount-t.table.bottomFrozenRowCount,n=0;null==i||i.forEachChildren((t=>{e(t,o,n),o++,n+=t.attribute.height}))})),t.leftBottomCornerGroup.forEachChildren((i=>{let o=t.table.rowCount-t.table.bottomFrozenRowCount,n=0;null==i||i.forEachChildren((t=>{e(t,o,n),o++,n+=t.attribute.height}))})),t.rightBottomCornerGroup.forEachChildren((i=>{let o=t.table.rowCount-t.table.bottomFrozenRowCount,n=0;null==i||i.forEachChildren((t=>{e(t,o,n),o++,n+=t.attribute.height}))}))}(n),s.length){const t=iM(s[0]-1,s[s.length-1]+1,n);a=Q(a)?Q(t)?Math.min(a,t):a:t}for(let t=0;t<o.colCount;t++)l.forEach((e=>{if(e<o.frozenRowCount||e>o.rowCount-1||e<n.table.rowCount-n.table.bottomFrozenRowCount&&(e<n.proxy.rowStart||e>n.proxy.rowEnd))eM(e,n);else{const i=Mx(n.table,t,e);if(i)for(let t=i.start.col;t<=i.end.col;t++)for(let e=i.start.row;e<=i.end.row;e++)lA(t,e,n.table,!1);else lA(t,e,n.table,!1)}}));if(l.length){const t=iM(l[0]-1,l[l.length-1]+1,n);a=Q(a)?Q(t)?Math.min(a,t):a:t}if(at(d)){for(let t=0;t<o.colCount;t++)for(let e=d;e<o.rowCount;e++){const i=n.highPerformanceGetCell(t,e,!0);i&&(i.needUpdate=!0)}a=Q(a)?Q(d)?Math.min(a,d):a:d}if(at(a)&&(n.proxy.rowUpdatePos=Math.min(n.proxy.rowUpdatePos,a)),s.length){if(!at(d)){const t=Math.min(...s);n.proxy.rowUpdatePos=Math.min(t,n.proxy.rowUpdatePos)}n.proxy.rowUpdateDirection="up",n.proxy.updateCellGroups(2*n.proxy.screenRowCount),u()}else r.length&&(function(t,e){if(e.table.isHasSeriesNumber())for(let i=t;i<=e.table.rowCount-1;i++)lA(0,i,e.table,!1)}(r[r.length-1],n),n.proxy.updateCellGroups(2*n.proxy.screenRowCount),u());n.proxy.progress();const c=o.getRowsHeight(o.frozenRowCount,o.rowCount-1-o.bottomFrozenRowCount);function u(){if((null==s?void 0:s[(null==s?void 0:s.length)-1])>=o.rowCount-o.bottomFrozenRowCount||(null==l?void 0:l[(null==l?void 0:l.length)-1])>=o.rowCount-o.bottomFrozenRowCount||(null==r?void 0:r[0])>=o.rowCount-o.bottomFrozenRowCount){for(let t=0;t<o.colCount;t++)for(let e=o.rowCount-o.bottomFrozenRowCount;e<o.rowCount;e++){const i=n.highPerformanceGetCell(t,e,!0);i&&(i.needUpdate=!0)}n.proxy.updateBottomFrozenCellGroups()}}n.updateContainerHeight(n.table.frozenRowCount,c-n.bodyGroup.attribute.height)}function tM(t,e){for(let i=0;i<e.table.colCount;i++){const o=new zS({x:0,y:0,width:e.table.getColWidth(i),height:e.table.getRowHeight(t)});if(o.role="cell",o.col=i,o.row=t,o.needUpdate=!0,!o)continue;const n=e.getColGroup(i);if(n)if(n.firstChild&&t<n.firstChild.row)n.insertBefore(o,n.firstChild),n.firstChild.row=n.firstChild.row+1;else if(n.lastChild&&t>n.lastChild.row)n.appendChild(o);else{const r=e.highPerformanceGetCell(i,t,!0);r!==o&&(n.insertBefore(o,r),r&&(r.row=r.row+1),r!==n.lastChild&&n.lastChild&&(n.lastChild.row=n.lastChild.row+1))}}}function eM(t,e){for(let i=0;i<e.table.colCount;i++){const o=e.getColGroup(i,!1);if(!o)continue;let n;o.forEachChildren((e=>e.row===t&&(n=e,!0))),n&&(o.updateColumnHeight(-n.attribute.height),o.removeChild(n))}}function iM(t,e,i){let o;for(let n=0;n<i.table.colCount;n++){const r=i.table.getCellRange(n,t);let s;r.start.row<=t+1&&r.end.row>=t+1&&(nM(r,i),s=r.start.row);const l=i.table.getCellRange(n,e);l.start.row<=e+1&&l.end.row>=e+1&&(nM(l,i),s=l.start.row),Q(s)&&(o=Q(o)?Math.min(o,s):s)}return o}function oM(t,e,i){let o;for(let n=0;n<i.table.colCount;n++){let r;const s=i.highPerformanceGetCell(n,t);s.mergeStartRow&&s.mergeEndRow&&s.mergeEndRow>t&&(nM({start:{row:s.mergeStartRow,col:"autoHeight"===i.table.heightMode?0:s.mergeStartCol},end:{row:s.mergeEndRow,col:"autoHeight"===i.table.heightMode?i.table.colCount-1:s.mergeEndCol}},i),r=s.mergeStartRow);const l=i.highPerformanceGetCell(n,e);l.mergeStartRow&&l.mergeEndRow&&l.mergeStartRow<e&&(nM({start:{row:l.mergeStartRow,col:"autoHeight"===i.table.heightMode?0:l.mergeStartCol},end:{row:l.mergeEndRow,col:"autoHeight"===i.table.heightMode?i.table.colCount-1:l.mergeEndCol}},i),r=l.mergeStartRow),Q(r)&&(o=Q(o)?Math.min(o,r):r)}return o}function nM(t,e){const{start:i,end:o}=t;for(let t=i.col;t<=o.col;t++)for(let n=i.row;n<=o.row;n++){const i=e.highPerformanceGetCell(t,n,!0);i&&(i.needUpdate=!0)}}function rM(t){var e,i,o,n;if(t.frozenColCount>t.table.frozenColCount){t.bodyGroup.setAttribute("height",t.rowHeaderGroup.attribute.height),t.bodyGroup.setAttribute("y",t.rowHeaderGroup.attribute.y),t.colHeaderGroup.setAttribute("height",t.cornerHeaderGroup.attribute.height);for(let e=0;e<t.frozenColCount-t.table.frozenColCount;e++)aM(t),hM(t),cM(t)}else if(t.frozenColCount<t.table.frozenColCount){t.rowHeaderGroup.setAttribute("height",t.bodyGroup.attribute.height),t.rowHeaderGroup.setAttribute("y",t.bodyGroup.attribute.y),t.cornerHeaderGroup.setAttribute("height",t.colHeaderGroup.attribute.height);for(let e=0;e<t.table.frozenColCount-t.frozenColCount;e++)sM(t),lM(t),dM(t)}(function(t){if(!t.table.reactCustomLayout)return;const{table:e,stage:i}=t,o=i.pluginService.findPluginsByName("ReactAttributePlugin")[0],{htmlMap:n}=o;for(const r in n){const s=n[r],{graphic:l,wrapContainer:a}=s;let h;if(t.frozenColCount>e.frozenColCount){const{col:i,row:o}=K_(l);o>=e.rowCount-e.bottomFrozenRowCount&&i<t.frozenColCount&&i>=e.frozenColCount&&l.attribute.react.container===e.frozenBottomDomContainer?h=e.bottomDomContainer:o>=e.frozenRowCount&&i<t.frozenColCount&&i>=e.frozenColCount&&l.attribute.react.container===e.frozenBodyDomContainer?h=e.bodyDomContainer:o<e.frozenRowCount&&i<t.frozenColCount&&i>=e.frozenColCount&&l.attribute.react.container===e.frozenHeaderDomContainer&&(h=e.headerDomContainer)}else if(t.frozenColCount<e.frozenColCount){const{col:i,row:o}=K_(l);o>=e.rowCount-e.bottomFrozenRowCount&&i<e.frozenColCount&&i>=t.frozenColCount&&l.attribute.react.container===e.bottomDomContainer?h=e.frozenBottomDomContainer:o>=e.frozenRowCount&&i<e.frozenColCount&&i>=t.frozenColCount&&l.attribute.react.container===e.bodyDomContainer?h=e.frozenBodyDomContainer:o<e.frozenRowCount&&i<e.frozenColCount&&i>=t.frozenColCount&&l.attribute.react.container===e.headerDomContainer&&(h=e.frozenHeaderDomContainer)}h&&(h.appendChild(a),s.nativeContainer=h,s.container=h,l.attribute.react.container=h,o.updateStyleOfWrapContainer(l,i,a,h,l.attribute.react))}})(t),t.deleteAllSelectBorder(),t.table.stateManager.select.ranges.forEach((e=>{t.updateCellSelectBorder(e)})),t.frozenColCount=t.table.frozenColCount,t.frozenRowCount=null!==(i=null===(e=t.colHeaderGroup.firstChild)||void 0===e?void 0:e.childrenCount)&&void 0!==i?i:0,t.proxy.colStart=null!==(n=null===(o=t.bodyGroup.firstChild)||void 0===o?void 0:o.col)&&void 0!==n?n:t.table.frozenColCount,t.bodyGroup.setAttribute("x",t.rowHeaderGroup.attribute.width),t.colHeaderGroup.setAttribute("x",t.cornerHeaderGroup.attribute.width),t.updateContainer(),t.updateBorderSizeAndPosition(),t.isPivot||t.table.transpose?t.table.options.frozenColCount?t.component.setFrozenColumnShadow(t.table.frozenColCount-1):t.table.options.rightFrozenColCount&&t.component.setRightFrozenColumnShadow(t.table.colCount-t.table.rightFrozenColCount):(t.component.setFrozenColumnShadow(t.table.frozenColCount-1),t.component.setRightFrozenColumnShadow(t.table.colCount-t.table.rightFrozenColCount)),t.hasFrozen=!0}function sM(t){const e=t.bodyGroup.firstChild instanceof zS?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 lM(t){const e=t.colHeaderGroup.firstChild instanceof zS?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 aM(t){var e;const i=t.rowHeaderGroup.lastChild instanceof zS?t.rowHeaderGroup.lastChild:null===(e=t.rowHeaderGroup.lastChild)||void 0===e?void 0:e._prev;i&&(uM(t.bodyGroup,i,t.bodyGroup.firstChild),t.bodyGroup.setAttribute("width",t.bodyGroup.attribute.width+i.attribute.width),t.rowHeaderGroup.setAttribute("width",t.rowHeaderGroup.attribute.width-i.attribute.width))}function hM(t){var e;const i=t.cornerHeaderGroup.lastChild instanceof zS?t.cornerHeaderGroup.lastChild:null===(e=t.cornerHeaderGroup.lastChild)||void 0===e?void 0:e._prev;i&&(uM(t.colHeaderGroup,i,t.colHeaderGroup.firstChild),t.colHeaderGroup.setAttribute("width",t.colHeaderGroup.attribute.width+i.attribute.width),t.cornerHeaderGroup.setAttribute("width",t.cornerHeaderGroup.attribute.width-i.attribute.width))}function dM(t){const e=t.bottomFrozenGroup.firstChild instanceof zS?t.bottomFrozenGroup.firstChild:null;e&&(t.leftBottomCornerGroup.appendChild(e),t.leftBottomCornerGroup.setAttribute("width",t.leftBottomCornerGroup.attribute.width+e.attribute.width),t.bottomFrozenGroup.setAttribute("width",t.bottomFrozenGroup.attribute.width-e.attribute.width),t.table.isPivotChart()&&e.forEachChildren((t=>{t.setAttributes({stroke:!1,fill:!1})})))}function cM(t){var e;const i=t.leftBottomCornerGroup.lastChild instanceof zS?t.leftBottomCornerGroup.lastChild:null===(e=t.leftBottomCornerGroup.lastChild)||void 0===e?void 0:e._prev;i&&(uM(t.bottomFrozenGroup,i,t.bottomFrozenGroup.firstChild),t.bottomFrozenGroup.setAttribute("width",t.bottomFrozenGroup.attribute.width+i.attribute.width),t.leftBottomCornerGroup.setAttribute("width",t.leftBottomCornerGroup.attribute.width-i.attribute.width),t.table.isPivotChart()&&i.forEachChildren((e=>{var i,o,n,r;const s=t.table._getCellStyle(e.col,e.row),l=t.table.getCellRange(e.col,e.row),a=G_(s,t.table,l?l.start.col:e.col,l?l.start.row:e.row,DS).theme;e.setAttributes({fill:null!==(o=null===(i=null==a?void 0:a.group)||void 0===i?void 0:i.fill)&&void 0!==o?o:void 0,stroke:null!==(r=null===(n=null==a?void 0:a.group)||void 0===n?void 0:n.stroke)&&void 0!==r?r:void 0})})))}function uM(t,e,i){e&&t&&(i?t.insertBefore(e,i):t.appendChild(e))}function gM(t){var e;for(let i=t.proxy.colStart;i<=t.proxy.colEnd;i++){const o=t.getColGroup(i);null===(e=null==o?void 0:o.getChildren())||void 0===e||e.forEach((t=>{t.children.forEach((t=>{"chart"===t.type&&(t.cacheCanvas=null,t.addUpdateBoundTag())}))}))}}function pM(t,e,i){t.forEachChildren((t=>{"chart"===t.type&&(t.cacheCanvas=null,t.setAttributes({width:Math.ceil(e-t.attribute.cellPadding[3]-t.attribute.cellPadding[1]),height:Math.ceil(i-t.attribute.cellPadding[0]-t.attribute.cellPadding[2])}))}))}function fM(t,e,i){return new zS({x:0,y:0,width:t,height:e,clip:null!=i&&i,pickable:!1})}function vM(t,e){return t.forEachChildrenSkipChild(((t,i)=>{t.setAttribute("x",e),e+=t.attribute.width})),e}function mM(t,e,i,o,n){const r=t.name;CM(i,o,(t=>t.name===r),(t=>{US(e,t),t.name=e.name}),n),n.updateNextFrame()}function bM(t){const{col:e,row:i,iconMark:o,order:n,oldSortCol:r,oldSortRow:s,oldIconMark:l,scene:a}=t,h=a.table.internalProps.headerHelper.getSortIcon(n,a.table,e,i);if(o&&mM(o,h,e,i,a),!function(t,e,i,o,n){const r=n.getCellRange(t,e),s=n.getCellRange(i,o);return r.start.col===s.start.col&&r.start.row===s.start.row&&r.end.col===s.end.col&&r.end.row===s.end.row}(e,i,r,s,a.table)){const t=a.table.internalProps.headerHelper.getSortIcon("normal",a.table,r,s);l?mM(l,t,r,s,a):function(t,e,i,o){const n=o.getCell(t,e);if(Q(n.mergeStartCol)&&Q(n.mergeStartRow)&&Q(n.mergeEndCol)&&Q(n.mergeEndRow))for(let t=n.mergeStartCol;t<=n.mergeEndCol;t++)for(let e=n.mergeStartRow;e<=n.mergeEndRow;e++){let n;o.getCell(t,e).forEachChildren((t=>"sort"===t.attribute.funcType&&(n=t,!0))),n&&(US(i,n),n.name=i.name)}else{let t;ww(n,"children",(e=>"sort"===e.attribute.funcType&&(t=e,!0))),t&&(US(i,t),t.name=i.name)}}(r,s,t,a)}}function yM(t,e,i){t.forEachChildren((t=>{"group"===t.type?yM(t,e,i):e(t)&&i(t)}))}function CM(t,e,i,o,n){const r=n.getCell(t,e);if("cell"===r.role&&Q(r.mergeStartCol)&&Q(r.mergeStartRow)&&Q(r.mergeEndCol)&&Q(r.mergeEndRow)){const{colStart:t,colEnd:e,rowStart:s,rowEnd:l}=EA(r,n);for(let r=t;r<=e;r++)for(let t=s;t<=l;t++)yM(n.highPerformanceGetCell(r,t),i,o)}else yM(r,i,o)}function wM(t,e){const{bgColor:i,borderColor:o,borderLineWidth:n,borderLineDash:r}=e,s={x:0,y:0,width:0,height:0,visible:!1,pickable:!0,fill:i};return s.stroke=aB(o,void 0),s.lineWidth=n,r&&(s.lineDash=r),s.lineCap="butt",Array.isArray(o)&&(s.strokeArrayColor=r_(o)),Array.isArray(n)&&(s.strokeArrayWidth=r_(n),s.lineWidth=1),t.setAttributes(s),t.role="corner-frozen",t}function xM(t,e,i,o){const n=o.scenegraph,r=_M(t.map((t=>t.col))).sort(((t,e)=>e-t)),s=_M(e.map((t=>t.col))).sort(((t,e)=>t-e)),l=_M(i.map((t=>t.col))).sort(((t,e)=>t-e));r.forEach((t=>{!function(t,e){const i=e.proxy;if(t>=e.table.rowHeaderLevelCount)if(t>=e.table.colCount-e.table.rightFrozenColCount);else{const i=e.getColGroup(t,!1);i&&i.parent===e.bodyGroup&&e.bodyGroup.removeChild(i);const o=e.getColGroupInBottom(t);o&&o.parent===e.bottomFrozenGroup&&e.bottomFrozenGroup.removeChild(o)}t>=i.colStart&&t<=i.colEnd&&(i.colEnd--,i.currentCol--),i.bodyRightCol--;const o=Math.min(i.colLimit,i.bodyRightCol-i.bodyLeftCol+1);i.totalActualBodyColCount=o,i.totalCol=i.colStart+o-1}(t,n)}));const a=o.colWidthsMap;let h;if(r.forEach((t=>{a.delAndReorder(t)})),r.length&&SM(n),n.table._clearColRangeWidthsMap(),s.forEach((t=>{const e=function(t,e){const i=e.proxy;i.bodyRightCol++;const o=Math.min(i.colLimit,i.bodyRightCol-i.bodyLeftCol+1);if(i.totalActualBodyColCount=o,i.totalCol=i.colStart+o-1,!(t<i.colStart))return t>i.colEnd?i.colEnd-i.colStart+1<i.colLimit?(i.colEnd++,i.currentCol++,AM(t,e),t):void 0:i.colEnd-i.colStart+1<i.colLimit?(i.colEnd++,i.currentCol++,AM(t,e),t):t}(t,n);SM(n),h=null!=h?h:e,a.addAndReorder(t)})),function(t){let e=t.bodyColStart,i=t.getCellGroupX(e);function o(i){i.col=e;const o=Mx(t.table,i.col,i.row);o&&(i.mergeStartCol=o.start.col,i.mergeStartCol=o.start.col,i.mergeEndCol=o.end.col,i.mergeEndCol=o.end.col),i.role}t.bodyGroup.forEachChildren((t=>{t.col=e,null==t||t.forEachChildren((t=>{o(t)})),t.setAttribute("x",i),i+=t.attribute.width,e++})),e=t.bodyColStart,i=t.getCellGroupX(e),t.colHeaderGroup.forEachChildren((t=>{t.col=e,null==t||t.forEachChildren((t=>{o(t)})),t.setAttribute("x",i),i+=t.attribute.width,e++})),e=t.bodyColStart,i=t.getCellGroupX(e),t.bottomFrozenGroup.forEachChildren((t=>{t.col=e,null==t||t.forEachChildren((t=>{o(t)})),t.setAttribute("x",i),i+=t.attribute.width,e++})),e=t.table.colCount-t.table.rightFrozenColCount,i=0,t.rightFrozenGroup.forEachChildren((t=>{t.col=e,null==t||t.forEachChildren((t=>{o(t)})),t.setAttribute("x",i),i+=t.attribute.width,e++})),e=t.table.colCount-t.table.rightFrozenColCount,i=0,t.rightTopCornerGroup.forEachChildren((t=>{t.col=e,null==t||t.forEachChildren((t=>{o(t)})),t.setAttribute("x",i),i+=t.attribute.width,e++})),e=t.table.colCount-t.table.rightFrozenColCount,i=0,t.rightBottomCornerGroup.forEachChildren((t=>{t.col=e,null==t||t.forEachChildren((t=>{o(t)})),t.setAttribute("x",i),i+=t.attribute.width,e++}))}(n),l.forEach((t=>{for(let e=0;e<o.rowCount;e++){const i=Mx(n.table,t,e);if(i)for(let t=i.start.col;t<=i.end.col;t++)for(let t=i.start.col;t<=i.end.col;t++)lA(t,e,n.table,!1);else lA(t,e,n.table,!1)}})),at(h)){for(let t=h;t<o.colCount;t++)for(let e=0;e<o.rowCount;e++){const i=n.highPerformanceGetCell(t,e,!0);i&&(i.needUpdate=!0)}n.proxy.colUpdatePos=h}if(s.length){if(!at(h)){const t=Math.min(...s);n.proxy.colUpdatePos=t}n.proxy.colUpdateDirection="left",n.proxy.updateColGroups(2*n.proxy.screenColCount),c(),n.proxy.progress()}else r.length&&(n.proxy.updateColGroups(2*n.proxy.screenColCount),c(),n.proxy.progress());const d=o.getColsWidth(o.frozenColCount,o.colCount-1);function c(){if((null==s?void 0:s[(null==s?void 0:s.length)-1])>=o.colCount-o.rightFrozenColCount||(null==l?void 0:l[(null==l?void 0:l.length)-1])>=o.colCount-o.rightFrozenColCount||(null==r?void 0:r[0])>=o.colCount-o.rightFrozenColCount){for(let t=o.colCount-o.rightFrozenColCount;t<o.colCount;t++)for(let e=0;e<o.rowCount;e++){const i=n.highPerformanceGetCell(t,e,!0);i&&(i.needUpdate=!0)}n.proxy.updateRightFrozenCellGroups()}}n.updateContainerWidth(n.table.frozenColCount,d-n.bodyGroup.attribute.width)}function _M(t){const e=[];for(let i=0;i<t.length;i++)-1===e.indexOf(t[i])&&e.push(t[i]);return e}function SM(t){let e=t.bodyColStart;function i(i){i.col=e;const o=Mx(t.table,i.col,i.row);o&&(i.mergeStartCol=o.start.col,i.mergeStartCol=o.start.col,i.mergeEndCol=o.end.col,i.mergeEndCol=o.end.col),i.role}t.bodyGroup.forEachChildren((t=>{t.col=e,null==t||t.forEachChildren((t=>{i(t)})),e++})),e=t.bodyColStart,t.colHeaderGroup.forEachChildren((t=>{t.col=e,null==t||t.forEachChildren((t=>{i(t)})),e++})),e=t.bodyColStart,t.bottomFrozenGroup.forEachChildren((t=>{t.col=e,null==t||t.forEachChildren((t=>{i(t)})),e++}))}function AM(t,e){if(e.colHeaderGroup&&e.table.columnHeaderLevelCount>0){const o=new zS({x:0,y:0,width:e.table.getColWidth(t),height:0,clip:!1,pickable:!1});o.role="column",o.col=t;const n=e.getColGroup(t,!0);n?e.colHeaderGroup.insertBefore(o,n):e.colHeaderGroup.appendChild(o),i(o,t,0,e.table.columnHeaderLevelCount-1)}if(e.bodyGroup){const o=new zS({x:0,y:0,width:e.table.getColWidth(t),height:0,clip:!1,pickable:!1});o.role="column",o.col=t;const n=e.getColGroup(t,!1);n?e.bodyGroup.insertBefore(o,n):e.bodyGroup.appendChild(o),i(o,t,e.bodyRowStart,e.bodyRowEnd)}if(e.bottomFrozenGroup&&e.table.bottomFrozenRowCount>0){const o=new zS({x:0,y:0,width:e.table.getColWidth(t),height:0,clip:!1,pickable:!1});o.role="column",o.col=t;const n=e.getColGroupInBottom(t);n?e.bottomFrozenGroup.insertBefore(o,n):e.bottomFrozenGroup.appendChild(o),i(o,t,e.table.rowCount-e.table.bottomFrozenRowCount,e.table.rowCount-1)}function i(t,i,o,n){for(let r=o;r<=n;r++){const o=new zS({x:0,y:0,width:e.table.getColWidth(i),height:e.table.getRowHeight(r)});o.role="cell",o.col=i,o.row=r,o.needUpdate=!0,t.appendChild(o)}}}oC(),nn.load(iR),nn.load(bA);class BM{constructor(t){let e,i;var o;this._needUpdateContainer=!1,this.table=t,this.hasFrozen=!1,this.clear=!0,this.mergeMap=new Map,o=this.table.theme.textPopTipStyle,St(Dm.poptip,Om,o),t.options.canvas&&t.options.viewBox?(bu.setEnv("browser"),e=t.options.viewBox.x2-t.options.viewBox.x1,i=t.options.viewBox.y2-t.options.viewBox.y1):"node"===sw.mode?(bu.setEnv("node",t.options.modeParams),e=t.canvasWidth,i=t.canvasHeight):(bu.setEnv("browser"),e=t.canvas.width,i=t.canvas.height),this.stage=Hu(Object.assign({canvas:t.canvas,width:e,height:i,disableDirtyBounds:!1,background:t.theme.underlayBackgroundColor,dpr:t.internalProps.pixelRatio,enableLayout:!0,beforeRender:t=>{this.table.options.beforeRender&&this.table.options.beforeRender(t)},afterRender:t=>{this.table.options.afterRender&&this.table.options.afterRender(t),this.table.fireListeners("after_render",null)},canvasControled:!t.options.canvas,viewBox:t.options.viewBox},t.options.renderOption)),this.stage.defaultLayer.setTheme({group:{boundsPadding:0,strokeBoundsBuffer:0,lineJoin:"round"},text:{ignoreBuf:!0}}),this.initSceneGraph(),this.stage.defaultLayer.add(this.tableGroup),this.stage.table=this.table,this.createComponent()}get width(){var t,e;return null!==(e=null===(t=this.tableGroup.attribute)||void 0===t?void 0:t.width)&&void 0!==e?e:0}get height(){var t,e;return null!==(e=null===(t=this.tableGroup.attribute)||void 0===t?void 0:t.height)&&void 0!==e?e:0}get x(){var t,e;return null!==(e=null===(t=this.tableGroup.attribute)||void 0===t?void 0:t.x)&&void 0!==e?e:0}get y(){var t,e;return null!==(e=null===(t=this.tableGroup.attribute)||void 0===t?void 0:t.y)&&void 0!==e?e:0}get bodyRowStart(){var t;return null!==(t=this.proxy.rowStart)&&void 0!==t?t:0}get bodyRowEnd(){var t;return null!==(t=this.proxy.rowEnd)&&void 0!==t?t:this.table.rowCount-1}get bodyColStart(){var t;return null!==(t=this.proxy.colStart)&&void 0!==t?t:0}get bodyColEnd(){var t;return null!==(t=this.proxy.colEnd)&&void 0!==t?t:this.table.colCount-1}initSceneGraph(){this.isPivot=this.table.isPivotTable(),function(t){const e=t.table.tableNoFrameWidth,i=t.table.tableNoFrameHeight;t.tableGroup=new zS({x:0,y:0,width:e,height:i,clip:!0,pickable:!1}),t.tableGroup.role="table";const o=fM(0,0,!t.table.options.enableTreeStickCell);o.role="col-header",t.colHeaderGroup=o;const n=fM(0,0,!t.table.options.enableTreeStickCell);n.role="corner-header",t.cornerHeaderGroup=n;const r=fM(0,0,!0);r.role="row-header",t.rowHeaderGroup=r;const s=fM(e,0,!0);s.role="body",t.bodyGroup=s;const l=fM(0,0,!0);l.role="right-frozen",t.rightFrozenGroup=l;const a=fM(0,0,!0);a.role="bottom-frozen",t.bottomFrozenGroup=a;const h=fM(0,0);h.role="component",t.componentGroup=h;const d=fM(0,0,!0);d.role="corner-right-top-header",t.rightTopCornerGroup=d;const c=fM(0,0,!0);c.role="corner-right-bottom-header",t.rightBottomCornerGroup=c;const u=fM(0,0,!0);u.role="corner-left-bottom-header",t.leftBottomCornerGroup=u,t.tableGroup.addChild(s),t.tableGroup.addChild(r),t.tableGroup.addChild(a),t.tableGroup.addChild(o),t.tableGroup.addChild(l),t.tableGroup.addChild(c),t.tableGroup.addChild(d),t.tableGroup.addChild(u),t.tableGroup.addChild(n),t.tableGroup.addChild(h)}(this)}clearCells(){var t,e;this.table.animationManager.clear(),(this.table.isPivotChart()||this.table._hasCustomRenderOrLayout())&&this.stage.pluginService.findPluginsByName("poptipForText").forEach((t=>{t.deactivate(this.stage.pluginService)})),this.clear=!0,this.hasFrozen=!1,this.mergeMap.clear(),this.colHeaderGroup.clear(),this.rowHeaderGroup.clear(),this.cornerHeaderGroup.clear(),this.bodyGroup.clear(),this.bottomFrozenGroup.clear(),this.rightFrozenGroup.clear(),this.rightTopCornerGroup.clear(),this.rightBottomCornerGroup.clear(),this.leftBottomCornerGroup.clear(),this.colHeaderGroup.setAttributes({x:0,y:0,width:0,height:0}),this.rowHeaderGroup.setAttributes({x:0,y:0,width:0,height:0}),this.cornerHeaderGroup.setAttributes({x:0,y:0,width:0,height:0}),this.bodyGroup.setAttributes({x:0,y:0,width:0,height:0}),this.rightFrozenGroup.setAttributes({x:0,y:0,width:0,height:0}),this.bottomFrozenGroup.setAttributes({x:0,y:0,width:0,height:0}),this.rightTopCornerGroup.setAttributes({x:0,y:0,width:0,height:0,visible:!1}),this.leftBottomCornerGroup.setAttributes({x:0,y:0,width:0,height:0,visible:!1}),this.rightBottomCornerGroup.setAttributes({x:0,y:0,width:0,height:0,visible:!1}),this.tableGroup.setAttributes({x:this.table.tableX,y:this.table.tableY,width:0,height:0}),this.tableGroup.border&&(this.tableGroup.parent.removeChild(this.tableGroup.border),delete this.tableGroup.border),null===(t=this.proxy)||void 0===t||t.release(),null===(e=this.table.reactCustomLayout)||void 0===e||e.clearCache()}updateStageBackground(){this.stage.background=this.table.theme.underlayBackgroundColor,this.stage.renderNextFrame()}createComponent(){this.component=new rB(this.table),this.component.addToGroup(this.componentGroup),this.selectedRangeComponents=new Map,this.selectingRangeComponents=new Map}updateComponent(){this.component.updateStyle()}createSceneGraph(){arguments.length>0&&void 0!==arguments[0]&&arguments[0]||(this.table.rowHeightsMap.clear(),this.table.internalProps.layoutMap.clearCellRangeMap()),(this.table.isPivotChart()||this.table._hasCustomRenderOrLayout())&&this.stage.pluginService.autoEnablePlugins.getContributions().forEach((t=>{"poptipForText"===t.name&&this.stage.pluginService.register(t)})),this.clear=!1,this.frozenColCount=this.table.frozenColCount,this.frozenRowCount=this.table.frozenRowCount,this.proxy=new VR(this.table),sB(this.tableGroup,this.table.theme.frameStyle,this.tableGroup.role,void 0,!0),this.table.isPivotChart()&&(wM(this.rightTopCornerGroup,this.table.theme.cornerRightTopCellStyle||this.table.theme.cornerHeaderStyle||{}),wM(this.leftBottomCornerGroup,this.table.theme.cornerLeftBottomCellStyle||this.table.theme.cornerHeaderStyle||{}),wM(this.rightBottomCornerGroup,this.table.theme.cornerRightBottomCellStyle||this.table.theme.cornerHeaderStyle||{})),this.proxy.createGroupForFirstScreen(this.cornerHeaderGroup,this.colHeaderGroup,this.rowHeaderGroup,this.rightFrozenGroup,this.bottomFrozenGroup,this.bodyGroup,0,0),this.afterScenegraphCreated()}renderSceneGraph(){this.stage.render()}getCell(t,e,i){var o,n,r,s,l,a;let h;if(h=this.table.rightFrozenColCount>0&&t>=this.table.colCount-this.table.rightFrozenColCount&&e<this.table.frozenRowCount?null===(o=this.rightTopCornerGroup.getColGroup(t))||void 0===o?void 0:o.getRowGroup(e):this.table.bottomFrozenRowCount>0&&e>=this.table.rowCount-this.table.bottomFrozenRowCount&&t<this.table.frozenColCount?null===(n=this.leftBottomCornerGroup.getColGroup(t))||void 0===n?void 0:n.getRowGroup(e):this.table.rightFrozenColCount>0&&this.table.bottomFrozenRowCount>0&&t>=this.table.colCount-this.table.rightFrozenColCount&&e>=this.table.rowCount-this.table.bottomFrozenRowCount?null===(r=this.rightBottomCornerGroup.getColGroup(t))||void 0===r?void 0:r.getRowGroup(e):this.table.rightFrozenColCount>0&&t>this.table.colCount-1-this.table.rightFrozenColCount?null===(s=this.rightFrozenGroup.getColGroup(t))||void 0===s?void 0:s.getRowGroup(e):this.table.bottomFrozenRowCount>0&&e>this.table.rowCount-1-this.table.bottomFrozenRowCount?null===(l=this.bottomFrozenGroup.getColGroup(t))||void 0===l?void 0:l.getRowGroup(e):null===(a=this.getColGroup(t,e<this.frozenRowCount))||void 0===a?void 0:a.getRowGroup(e),h&&"shadow-cell"===h.role&&!i){const i=this.table.getCellRange(t,e);i.start.col===t&&i.start.row===e||(h=this.getCell(i.start.col,i.start.row))}return h||dR}highPerformanceGetCell(t,e,i){return this.proxy.highPerformanceGetCell(t,e,i)}getColGroup(t){let e,i=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return e=t<this.frozenColCount&&i?this.cornerHeaderGroup.getColGroup(t):t<this.frozenColCount?this.rowHeaderGroup.getColGroup(t):i&&this.table.rightFrozenColCount>0&&t>this.table.colCount-1-this.table.rightFrozenColCount?this.rightTopCornerGroup.getColGroup(t):!i&&this.table.rightFrozenColCount>0&&t>this.table.colCount-1-this.table.rightFrozenColCount?this.rightFrozenGroup.getColGroup(t):i?this.colHeaderGroup.getColGroup(t):this.bodyGroup.getColGroup(t),e||void 0}getColGroupInBottom(t){if(this.table.bottomFrozenRowCount>0)return this.bottomFrozenGroup.getColGroup(t)}getColGroupInLeftBottomCorner(t){if(this.table.bottomFrozenRowCount>0)return this.leftBottomCornerGroup.getColGroup(t)}getColGroupInRightTopCorner(t){if(this.table.rightFrozenColCount>0)return this.rightTopCornerGroup.getColGroup(t)}getColGroupInRightBottomCorner(t){if(this.table.rightFrozenColCount>0&&this.table.bottomFrozenRowCount>0)return this.rightBottomCornerGroup.getColGroup(t)}getCellSize(t,e){const i=this.getCell(t,e),o=Mx(this.table,t,e);let n=i.attribute.width,r=i.attribute.height;return o&&(n/=o.end.col-o.start.col+1,r/=o.end.row-o.start.row+1),{width:n,height:r}}updateNextFrame(){this.updateContainerSync(),this.resetAllSelectComponent(),this.stage.renderNextFrame()}resetAllSelectComponent(){var t,e,i;(null===(e=null===(t=this.table.stateManager.select)||void 0===t?void 0:t.ranges)||void 0===e?void 0:e.length)>0&&((i=this).selectingRangeComponents.forEach(((t,e)=>{$R(t,e,i)})),i.selectedRangeComponents.forEach(((t,e)=>{$R(t,e,i)})))}hideHoverIcon(t,e){!function(t,e,i){-1!==t&&-1!==e&&(CM(t,e,(t=>"mouseenter_cell"===t.attribute.visibleTime),(t=>{t.setAttribute("opacity",0);const e=t.parent.getChildByName("icon-back");e&&e.setAttribute("visible",!1)}),i),i.updateNextFrame())}(t,e,this)}showHoverIcon(t,e){!function(t,e,i){-1!==t&&-1!==e&&(CM(t,e,(t=>"mouseenter_cell"===t.attribute.visibleTime),(t=>{t.setAttribute("opacity",1)}),i),i.updateNextFrame())}(t,e,this)}hideClickIcon(t,e){!function(t,e,i){-1!==t&&-1!==e&&(CM(t,e,(t=>"click_cell"===t.attribute.visibleTime),(t=>{t.setAttribute("opacity",0)}),i),i.updateNextFrame())}(t,e,this)}showClickIcon(t,e){!function(t,e,i){-1!==t&&-1!==e&&(CM(t,e,(t=>"click_cell"===t.attribute.visibleTime),(t=>{t.setAttribute("opacity",1)}),i),i.updateNextFrame())}(t,e,this)}getIcon(t,e,i,o){return function(t,e,i,o,n){let r;return n.getCell(t,e).forEachChildren((t=>{t.role&&t.role.startsWith("icon")&&t.containsPoint(i,o,xi.GLOBAL)&&(r=t)})),r}(t,e,i,o,this)}setIconHoverStyle(t,e,i,o){!function(t,e,i,o,n){var r,s;if((t.attribute.backgroundColor||t.attribute.hoverImage)&&CM(e,i,(e=>e.name===t.name),(t=>{var e,i,o,n,r,s,l,a;if(t.attribute.backgroundColor){let h=t.parent.getChildByName("icon-back");h?h.setAttributes({x:(null!==(e=t.attribute.x)&&void 0!==e?e:0)+(t.AABBBounds.width()-t.backgroundWidth)/2,y:(null!==(i=t.attribute.y)&&void 0!==i?i:0)+(t.AABBBounds.height()-t.backgroundHeight)/2,dx:null!==(o=t.attribute.dx)&&void 0!==o?o:0,dy:null!==(n=t.attribute.dy)&&void 0!==n?n:0,width:t.backgroundWidth,height:t.backgroundHeight,fill:t.attribute.backgroundColor,cornerRadius:5,visible:!0}):(h=sc({x:(null!==(r=t.attribute.x)&&void 0!==r?r:0)+(t.AABBBounds.width()-t.backgroundWidth)/2,y:(null!==(s=t.attribute.y)&&void 0!==s?s:0)+(t.AABBBounds.height()-t.backgroundHeight)/2,dx:null!==(l=t.attribute.dx)&&void 0!==l?l:0,dy:null!==(a=t.attribute.dy)&&void 0!==a?a:0,width:t.backgroundWidth,height:t.backgroundHeight,fill:t.attribute.backgroundColor,cornerRadius:5,pickable:!1,visible:!0}),h.name="icon-back"),t.parent.insertBefore(h,t)}t.attribute.hoverImage&&t.attribute.image!==t.attribute.hoverImage&&(t.image=t.attribute.hoverImage)}),n),t.tooltip){const{x1:o,x2:l,y1:a,y2:h}=t.globalAABBBounds,d={content:t.tooltip.title,referencePosition:{rect:{left:o,right:l,top:a,bottom:h,width:t.globalAABBBounds.width(),height:t.globalAABBBounds.height()},placement:t.tooltip.placement},disappearDelay:t.tooltip.disappearDelay,style:Object.assign({},null===(r=n.table.internalProps.theme)||void 0===r?void 0:r.tooltipStyle,null===(s=t.tooltip)||void 0===s?void 0:s.style)};n.table.internalProps.tooltipHandler.isBinded(d)||n.table.showTooltip(e,i,d)}}(t,e,i,0,this)}updateSortIcon(t){const{col:e,row:i,iconMark:o,order:n,oldSortCol:r,oldSortRow:s,oldIconMark:l}=t;bM({col:e,row:i,iconMark:o,order:n,oldSortCol:r,oldSortRow:s,oldIconMark:l,scene:this})}updateFrozenIcon(t,e){!function(t){for(let e=0;e<t.table.colCount;e++)for(let i=0;i<t.table.columnHeaderLevelCount;i++)CM(e,i,(t=>"frozen"===t.attribute.funcType),(o=>{const n=t.table.internalProps.headerHelper.getFrozenIcon(e,i);US(n,o),o.name=n.name}),t)}(this)}updateHierarchyIcon(t,e){!function(t,e,i){let o;o=i.table.isHeader(t,e)?i.table.internalProps.headerHelper.getHierarchyIcon(t,e):i.table.internalProps.bodyHelper.getHierarchyIcon(t,e),CM(t,e,(t=>t.attribute.funcType===VC.collapse||t.attribute.funcType===VC.expand),(t=>{US(o,t),t.name=o.name}),i)}(t,e,this)}setIconNormalStyle(t,e,i){!function(t,e,i,o){(t.attribute.backgroundColor||t.attribute.hoverImage)&&CM(e,i,(e=>e.name===t.name),(t=>{const e=t.parent.getChildByName("icon-back");e&&e.setAttribute("visible",!1),t.attribute.hoverImage&&t.attribute.image!==t.attribute.originImage&&(t.image=t.attribute.originImage)}),o)}(t,e,i,this)}residentHoverIcon(t,e){!function(t,e,i){CM(t,e,(t=>t.attribute.funcType===VC.dropDown),(t=>{t.oldVisibleTime=t.attribute.visibleTime,t.setAttribute("visibleTime","always"),t.setAttribute("opacity",1)}),i)}(t,e,this)}resetResidentHoverIcon(t,e){!function(t,e,i){CM(t,e,(t=>t.attribute.funcType===VC.dropDown),(t=>{t.oldVisibleTime&&t.setAttribute("visibleTime",t.oldVisibleTime),t.setAttribute("opacity","always"===t.attribute.visibleTime?1:0)}),i)}(t,e,this)}deactivateChart(t,e){var i,o;if(-1===t||-1===e)return;const n=this.getCell(t,e);null===(o=null===(i=null==n?void 0:n.firstChild)||void 0===i?void 0:i.deactivate)||void 0===o||o.call(i)}activateChart(t,e){var i,o;if(-1===t||-1===e)return;const n=this.getCell(t,e);null===(o=null===(i=null==n?void 0:n.firstChild)||void 0===i?void 0:i.activate)||void 0===o||o.call(i,this.table)}removeInteractionBorder(t,e){const i=this.getCell(t,e);i.setAttribute("highlightStroke",void 0),i.setAttribute("highlightStrokeArrayWidth",void 0),i.setAttribute("highlightStrokeArrayColor",void 0)}createCellSelectBorder(t,e,i,o,n,r,s){!function(t,e,i,o,n,r,s,l){var a,h,d,c,u,g,p,f;let v=!!(null===(a=t.table.options.excelOptions)||void 0===a?void 0:a.fillHandle);if((null===(h=t.table.stateManager.select.ranges)||void 0===h?void 0:h.length)>1)v=!1,t.removeFillHandleFromSelectComponents();else if(1===(null===(d=t.table.stateManager.select.ranges)||void 0===d?void 0:d.length)){const e=Math.max(t.table.stateManager.select.ranges[0].start.row,t.table.stateManager.select.ranges[0].end.row),i=Math.max(t.table.stateManager.select.ranges[0].start.col,t.table.stateManager.select.ranges[0].end.col);t.table.isHeader(i,e)&&(v=!1)}!Array.isArray(l)||!1!==l[1]&&!1!==l[2]||(v=!1);const m=Math.min(e,o),b=Math.min(i,n),y=Math.max(e,o),C=Math.max(i,n),w=t.highPerformanceGetCell(m,b).globalAABBBounds,x=t.highPerformanceGetCell(y,C).globalAABBBounds,_=t.table.theme,S=null===(c=_.selectionStyle)||void 0===c?void 0:c.cellBorderColor,A=null===(u=_.selectionStyle)||void 0===u?void 0:u.cellBorderLineWidth,B=sc({pickable:!1,fill:"replace"!==(null===(g=_.selectionStyle)||void 0===g?void 0:g.selectionFillMode)&&(null!==(f=null===(p=_.selectionStyle)||void 0===p?void 0:p.cellBgColor)&&void 0!==f?f:"rgba(0, 0, 255,0.1)"),lineWidth:A,stroke:l.map((t=>!!t&&S)),x:w.x1-t.tableGroup.attribute.x,y:w.y1-t.tableGroup.attribute.y,width:0,height:0,visible:!0});let R;v&&(R=sc({pickable:!1,fill:S,stroke:S,x:x.x2-3,y:x.y2-3,width:6,height:6,visible:!0})),t.lastSelectId=s,t.selectingRangeComponents.set(`${m}-${b}-${y}-${C}-${s}`,{rect:B,fillhandle:R,role:r}),t.tableGroup.insertAfter(B,"body"===r?t.bodyGroup:"columnHeader"===r?t.colHeaderGroup:"rowHeader"===r?t.rowHeaderGroup:"cornerHeader"===r?t.cornerHeaderGroup:"rightTopCorner"===r?t.rightTopCornerGroup:"rightFrozen"===r?t.rightFrozenGroup:"leftBottomCorner"===r?t.leftBottomCornerGroup:"bottomFrozen"===r?t.bottomFrozenGroup:t.rightBottomCornerGroup),v&&t.tableGroup.insertAfter(R,"body"===r?t.bodyGroup:"columnHeader"===r?t.colHeaderGroup:"rowHeader"===r?t.rowHeaderGroup:"cornerHeader"===r?t.cornerHeaderGroup:"rightTopCorner"===r?t.rightTopCornerGroup:"rightFrozen"===r?t.rightFrozenGroup:"leftBottomCorner"===r?t.leftBottomCornerGroup:"bottomFrozen"===r?t.bottomFrozenGroup:t.rightBottomCornerGroup)}(this,t,e,i,o,n,r,s)}moveSelectingRangeComponentsToSelectedRangeComponents(){qR(this)}deleteLastSelectedRangeComponents(){var t;(t=this).selectedRangeComponents.forEach(((e,i)=>{var o;i.split("-")[4]===t.lastSelectId&&(e.rect.delete(),null===(o=e.fillhandle)||void 0===o||o.delete(),t.selectedRangeComponents.delete(i))}))}deleteAllSelectBorder(){ZR(this),JR(this)}updateCellSelectBorder(t){XR(this,t,!(arguments.length>1&&void 0!==arguments[1])||arguments[1])}removeFillHandleFromSelectComponents(){this.selectedRangeComponents.forEach(((t,e)=>{var i;null===(i=t.fillhandle)||void 0===i||i.delete(),t.fillhandle=void 0}))}recreateAllSelectRangeComponents(){ZR(this),this.table.stateManager.select.ranges.forEach((t=>{XR(this,t)})),qR(this)}updateColWidth(t,e,i,o){(function(t,e,i,o){o||t.table._setColWidth(e,t.table.getColWidth(e)+i,!0);const n=t.getColGroup(e,!0),r=t.getColGroupInRightTopCorner(e);n&&!r&&IA(n,i,"col-corner",t),r&&IA(r,i,"right-top",t);const s=t.getColGroup(e);s&&IA(s,i,"row-body",t);const l=t.getColGroupInLeftBottomCorner(e);l&&IA(l,i,"left-bottom",t);const a=t.getColGroupInBottom(e);a&&IA(a,i,"bottom",t);const h=t.getColGroupInRightBottomCorner(e);h&&IA(h,i,"right-bottom",t),e<t.frozenColCount?(t.cornerHeaderGroup.forEachChildrenSkipChild(((t,o)=>{t.col>e&&t.setAttribute("x",t.attribute.x+i)})),t.rowHeaderGroup.forEachChildrenSkipChild(((t,o)=>{t.col>e&&t.setAttribute("x",t.attribute.x+i)}))):(t.colHeaderGroup.forEachChildrenSkipChild(((t,o)=>{t.col>e&&t.setAttribute("x",t.attribute.x+i)})),t.bodyGroup.forEachChildrenSkipChild(((t,o)=>{t.col>e&&t.setAttribute("x",t.attribute.x+i)}))),l&&t.leftBottomCornerGroup.forEachChildrenSkipChild(((t,o)=>{t.col>e&&t.setAttribute("x",t.attribute.x+i)})),a&&t.bottomFrozenGroup.forEachChildrenSkipChild(((t,o)=>{t.col>e&&t.setAttribute("x",t.attribute.x+i)})),h&&t.rightBottomCornerGroup.forEachChildrenSkipChild(((t,o)=>{t.col>e&&t.setAttribute("x",t.attribute.x+i)}))})(this,t,Math.round(e),o),i||this.updateContainer(!0)}updateChartSizeForResizeColWidth(t){!function(t,e){const{table:i}=t,o=i.internalProps.layoutMap,n=-1===e?"all":i.internalProps.columnResizeType;if("column"===n){const o=t.getColGroup(e);if(null==o||o.forEachChildren((t=>{pM(t,i.getColWidth(t.col),i.getRowHeight(t.row))})),"adaptive"===i.widthMode&&e<i.colCount-1){const o=t.getColGroup(e+1);null==o||o.forEachChildren((t=>{pM(t,i.getColWidth(t.col),i.getRowHeight(t.row))}))}}else{let r,s,l,a=i.rowHeaderLevelCount,h=i.colCount-1;if("indicator"===n)if(o.indicatorsAsCol)r=o.getIndicatorKey(e,i.columnHeaderLevelCount);else{const t=o.getCellHeaderPaths(e,i.columnHeaderLevelCount-1),n=t.colHeaderPaths[t.colHeaderPaths.length-1];s=n.dimensionKey,l=n.value}else if("indicatorGroup"===n){const t=i.internalProps.layoutMap,e=t.getCellHeaderPaths(i.stateManager.columnResize.col,i.columnHeaderLevelCount),o=t.getHeadNodeByRowOrColDimensions(e.colHeaderPaths.slice(0,e.colHeaderPaths.length-1));a=o.startInTotal+i.frozenColCount,h=o.startInTotal+i.frozenColCount+o.size-1}for(let e=a;e<=h;e++){const a=t.getColGroup(e);if(a){if("indicator"===n){const t=o.getIndicatorKey(e,i.columnHeaderLevelCount);if(o.indicatorsAsCol&&t!==r)continue;if(!o.indicatorsAsCol){const t=o.getCellHeaderPaths(e,i.columnHeaderLevelCount-1),n=null==t?void 0:t.colHeaderPaths[t.colHeaderPaths.length-1];if(!n||s!==n.dimensionKey||l!==n.value)continue}}a.forEachChildren((t=>{pM(t,i.getColWidth(t.col),i.getRowHeight(t.row))}))}}}}(this,t)}updateChartSizeForResizeRowHeight(t){!function(t,e){var i;const{table:o}=t,n=o.internalProps.layoutMap,r=o.stateManager,s=-1===e?"all":o.internalProps.rowResizeType;let l,a,h,d=o.columnHeaderLevelCount,c=o.rowCount-1;if("indicator"===s)if(n.indicatorsAsCol){const t=n.getCellHeaderPaths(o.rowHeaderLevelCount-1,e),r=null===(i=t.rowHeaderPaths)||void 0===i?void 0:i[t.rowHeaderPaths.length-1];a=null==r?void 0:r.dimensionKey,h=null==r?void 0:r.value}else l=n.getIndicatorKey(o.rowHeaderLevelCount,e);else if("indicatorGroup"===s){const t=o.internalProps.layoutMap,i=t.getCellHeaderPaths(o.rowHeaderLevelCount,e),n=t.getHeadNodeByRowOrColDimensions(i.rowHeaderPaths.slice(0,i.rowHeaderPaths.length-1));d=n.startInTotal+o.frozenRowCount,c=n.startInTotal+o.frozenRowCount+n.size-1}for(let i=t.proxy.colStart;i<=t.proxy.colEnd;i++)if("row"===s){const n=t.highPerformanceGetCell(i,e);if("cell"!==n.role)continue;if(pM(n,o.getColWidth(n.col),o.getRowHeight(n.row)),"adaptive"===o.heightMode&&e<o.rowCount-1){const n=t.highPerformanceGetCell(i,e+1);pM(n,o.getColWidth(n.col),o.getRowHeight(n.row))}}else for(let e=d;e<=c;e++){if("indicator"===s){const t=n.getIndicatorKey(r.table.rowHeaderLevelCount,e);if(!n.indicatorsAsCol&&t!==l)continue;if(n.indicatorsAsCol){const t=n.getCellHeaderPaths(r.table.rowHeaderLevelCount-1,e),i=null==t?void 0:t.rowHeaderPaths[t.rowHeaderPaths.length-1];if(!i||a!==i.dimensionKey||h!==i.value)continue}}const d=t.highPerformanceGetCell(i,e);"cell"===d.role&&pM(d,o.getColWidth(d.col),o.getRowHeight(d.row))}}(this,t)}updateChartState(t){this.table.isPivotChart()&&function(t,e){const i=t.table;if(i.isPivotChart()){const o=i._selectedDataItemsInChart.length;if((null===e||0===(null==e?void 0:e.length)||0===Object.keys(e).length)&&0===o)return;const n=[];if(Array.isArray(e))e.forEach((t=>{if(t&&0!==t.key&&Object.keys(t).length>0){const e={};for(const i in t)i.startsWith("VGRAMMAR_")||i.startsWith("__VCHART")||(e[i]=t[i]);n.push(e)}}));else if(e&&0!==e.key&&Object.keys(e).length>0){const t={};for(const i in e)i.startsWith("VGRAMMAR_")||i.startsWith("__VCHART")||(t[i]=e[i]);n.push(t)}Rt(i._selectedDataItemsInChart,n)||(i._selectedDataItemsInChart=n,i.internalProps.layoutMap.updateDataStateToChartInstance(),gM(t),i.scenegraph.updateNextFrame())}}(this,t)}updateCheckboxCellState(t,e,i){var o,n;if(this.table.transpose)null===(o=this.bodyGroup.children)||void 0===o||o.forEach((t=>{var o;null===(o=t.getChildAt(e))||void 0===o||o.getChildren().forEach((t=>{"checkbox"===t.name&&t.setAttribute("checked",i)}))}));else{const e=this.getColGroup(t);null===(n=null==e?void 0:e.children)||void 0===n||n.forEach((t=>{t.getChildren().find((t=>{"checkbox"===t.name&&t.setAttribute("checked",i)}))}))}}updateHeaderCheckboxCellState(t,e,i){var o,n;this.table.transpose?null===(o=this.rowHeaderGroup.children)||void 0===o||o.forEach((t=>{t.getChildAt(e).getChildren().forEach((t=>{"checkbox"===t.name&&("indeterminate"===i?(t.setAttribute("indeterminate",!0),t.setAttribute("checked",void 0)):(t.setAttribute("indeterminate",void 0),t.setAttribute("checked",i)))}))})):null===(n=this.getColGroup(t,!0).children)||void 0===n||n.forEach((t=>{t.getChildren().find((t=>{"checkbox"===t.name&&("indeterminate"===i?(t.setAttribute("indeterminate",!0),t.setAttribute("checked",void 0)):(t.setAttribute("indeterminate",void 0),t.setAttribute("checked",i)))}))}))}updateAutoColWidth(t){this.table.internalProps._widthResizedColMap.delete(t);const e=this.table.getColWidth(t),i=nR(t,0,this.table.rowCount-1,this.table,!0);i!==e&&this.updateColWidth(t,i-e)}recalculateColWidths(){const t=this.table;"adaptive"===t.widthMode||t.autoFillWidth||t.internalProps.transpose?oR(this.table,0,this.table.colCount-1,!0):(t._clearColRangeWidthsMap(),t.frozenColCount>0&&oR(this.table,0,t.frozenColCount-1,!0),t.rightFrozenColCount>0&&oR(this.table,t.rightFrozenColCount,t.colCount-1,!0),oR(t,this.proxy.colStart,this.proxy.colEnd,!0))}recalculateRowHeights(){const t=this.table;t.internalProps.useOneRowHeightFillAll=!1,"adaptive"===t.heightMode||t.autoFillHeight?BA(this.table,0,this.table.rowCount-1,!0,!0):(t.frozenRowCount>0&&BA(this.table,0,t.frozenRowCount-1,!0,!0),t.bottomFrozenRowCount>0&&BA(this.table,t.bottomFrozenRowCount,t.rowCount-1,!0,!0),BA(t,this.proxy.rowStart,this.proxy.rowEnd,!0,!0))}resize(){this.proxy.resize(),("adaptive"===this.table.widthMode||this.table.autoFillWidth)&&(0===this.table.internalProps._widthResizedColMap.size?this.recalculateColWidths():this.dealWidthMode()),"adaptive"===this.table.heightMode?0===this.table.internalProps._heightResizedRowMap.size?this.recalculateRowHeights():this.dealHeightMode():this.table.autoFillHeight&&this.dealHeightMode(),this.resetFrozen(),this.updateTableSize(),this.updateBorderSizeAndPosition(),this.component.updateScrollBar(),("adaptive"===this.table.widthMode||"adaptive"===this.table.heightMode||this.table.autoFillWidth||this.table.autoFillHeight)&&this.updateChartSizeForResizeColWidth(-1),this.proxy.progress(),this.updateNextFrame()}updateTableSize(){var t,e,i,o,n,r,s,l,a,h,d,c,u;if(this.tableGroup.setAttributes({x:this.table.tableX,y:this.table.tableY,width:Math.min(this.table.tableNoFrameWidth,Math.max(this.colHeaderGroup.attribute.width,this.bodyGroup.attribute.width,this.bottomFrozenGroup.attribute.width,0)+Math.max(this.cornerHeaderGroup.attribute.width,this.rowHeaderGroup.attribute.width,this.leftBottomCornerGroup.attribute.width,0)+Math.max(this.rightTopCornerGroup.attribute.width,this.rightFrozenGroup.attribute.width,this.rightBottomCornerGroup.attribute.width,0)),height:Math.min(this.table.tableNoFrameHeight,Math.max(this.colHeaderGroup.attribute.height,this.cornerHeaderGroup.attribute.height,this.rightTopCornerGroup.attribute.height,0)+Math.max(this.rowHeaderGroup.attribute.height,this.bodyGroup.attribute.height,this.rightFrozenGroup.attribute.height,0)+Math.max(this.leftBottomCornerGroup.attribute.height,this.bottomFrozenGroup.attribute.height,this.rightBottomCornerGroup.attribute.height,0))}),this.tableGroup.border){const g=null===(t=this.tableGroup.border)||void 0===t?void 0:t.attribute;let p,f,v,m;(null==g?void 0:g.strokeArrayWidth)?(p=g.strokeArrayWidth?g.strokeArrayWidth[0]:null!==(e=g.lineWidth)&&void 0!==e?e:0,f=g.strokeArrayWidth?g.strokeArrayWidth[1]:null!==(i=g.lineWidth)&&void 0!==i?i:0,v=g.strokeArrayWidth?g.strokeArrayWidth[2]:null!==(o=g.lineWidth)&&void 0!==o?o:0,m=g.strokeArrayWidth?g.strokeArrayWidth[3]:null!==(n=g.lineWidth)&&void 0!==n?n:0):(p=null!==(r=null==g?void 0:g.lineWidth)&&void 0!==r?r:0,f=null!==(s=null==g?void 0:g.lineWidth)&&void 0!==s?s:0,v=null!==(l=null==g?void 0:g.lineWidth)&&void 0!==l?l:0,m=null!==(a=null==g?void 0:g.lineWidth)&&void 0!==a?a:0),"rect"===this.tableGroup.border.type?(null===(h=this.table.theme.frameStyle)||void 0===h?void 0:h.innerBorder)?this.tableGroup.border.setAttributes({x:this.table.tableX+m/2,y:this.table.tableY+p/2,width:this.tableGroup.attribute.width-m/2-f/2,height:this.tableGroup.attribute.height-p/2-v/2}):this.tableGroup.border.setAttributes({x:this.table.tableX-m/2,y:this.table.tableY-p/2,width:this.tableGroup.attribute.width+m/2+f/2,height:this.tableGroup.attribute.height+p/2+v/2}):"group"===this.tableGroup.border.type&&((null===(d=this.table.theme.frameStyle)||void 0===d?void 0:d.innerBorder)?(this.tableGroup.border.setAttributes({x:this.table.tableX+m/2,y:this.table.tableY+p/2,width:this.tableGroup.attribute.width-m/2-f/2,height:this.tableGroup.attribute.height-p/2-v/2}),null===(c=this.tableGroup.border.firstChild)||void 0===c||c.setAttributes({x:0,y:0,width:this.tableGroup.attribute.width-m/2-f/2,height:this.tableGroup.attribute.height-p/2-v/2})):(this.tableGroup.border.setAttributes({x:this.table.tableX-m/2,y:this.table.tableY-p/2,width:this.tableGroup.attribute.width+m/2+f/2,height:this.tableGroup.attribute.height+p/2+v/2}),null===(u=this.tableGroup.border.firstChild)||void 0===u||u.setAttributes({x:m/2,y:p/2,width:this.tableGroup.attribute.width,height:this.tableGroup.attribute.height})))}this.table.bottomFrozenRowCount>0&&(this.bottomFrozenGroup.setAttribute("y",this.tableGroup.attribute.height-this.table.getBottomFrozenRowsHeight()),this.leftBottomCornerGroup.setAttributes({visible:!0,y:this.tableGroup.attribute.height-this.table.getBottomFrozenRowsHeight(),height:this.table.getBottomFrozenRowsHeight(),width:this.table.getFrozenColsWidth()}),this.rightBottomCornerGroup.setAttributes({visible:!0,y:this.tableGroup.attribute.height-this.table.getBottomFrozenRowsHeight(),height:this.table.getBottomFrozenRowsHeight()})),this.table.rightFrozenColCount>0&&(this.rightFrozenGroup.setAttribute("x",this.tableGroup.attribute.width-this.table.getRightFrozenColsWidth()),this.rightTopCornerGroup.setAttributes({visible:!0,x:this.tableGroup.attribute.width-this.table.getRightFrozenColsWidth(),width:this.table.getRightFrozenColsWidth(),height:this.table.getFrozenRowsHeight()}),this.rightBottomCornerGroup.setAttributes({visible:!0,x:this.tableGroup.attribute.width-this.table.getRightFrozenColsWidth(),width:this.table.getRightFrozenColsWidth()}))}updateRowHeight(t,e,i){HA(this,t,e=Math.round(e),i),this.updateContainerHeight(t,e)}updateRowsHeight(t,e,i){for(let o=0;o<t.length;o++){const n=t[o];if(n>=this.proxy.rowStart&&n<=this.proxy.rowEnd){const t=e[o];HA(this,n,Math.round(t),i),this._updateContainerHeight(n,t)}}this.updateTableSize(),this.component.updateScrollBar(),this.updateNextFrame()}updateContainerWidth(t,e){t<this.frozenColCount?(this.rowHeaderGroup.setDeltaWidth(e),this.cornerHeaderGroup.setDeltaWidth(e),this.colHeaderGroup.setDeltaX(e),this.bodyGroup.setDeltaX(e)):(this.colHeaderGroup.setDeltaWidth(e),this.bodyGroup.setDeltaWidth(e)),this.updateTableSize(),this.component.updateScrollBar(),this.updateNextFrame()}_updateContainerHeight(t,e){t<this.table.frozenRowCount?(this.colHeaderGroup.setDeltaHeight(e),this.cornerHeaderGroup.setDeltaHeight(e),this.rowHeaderGroup.setDeltaY(e),this.bodyGroup.setDeltaY(e),this.table.rightFrozenColCount&&this.rightFrozenGroup.setDeltaY(e)):t>=this.table.rowCount-this.table.bottomFrozenRowCount?(this.leftBottomCornerGroup.setDeltaHeight(e),this.bottomFrozenGroup.setDeltaHeight(e),this.table.rightFrozenColCount&&this.rightBottomCornerGroup.setDeltaHeight(e)):(this.rowHeaderGroup.setDeltaHeight(e),this.bodyGroup.setDeltaHeight(e),this.table.rightFrozenColCount&&this.rightFrozenGroup.setDeltaHeight(e))}updateContainerHeight(t,e){this._updateContainerHeight(t,e),this.updateTableSize(),this.component.updateScrollBar(),this.updateNextFrame()}setColWidth(t,e){const i=this.table.getColWidth(t);i!==e&&(this.updateColWidth(t,e-i),this.table._clearColRangeWidthsMap(t))}setRowHeight(t,e){const i=this.table.getRowHeight(t);i!==e&&((t>=this.proxy.rowStart&&t<=this.proxy.rowEnd||t>=this.table.rowCount-this.table.bottomFrozenRowCount&&t<=this.table.rowCount-1||t<this.table.frozenRowCount)&&this.updateRowHeight(t,e-i),this.table._clearRowRangeHeightsMap(t))}setX(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.table.scenegraph.proxy.setX(-t,e)}setY(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.table.scenegraph.proxy.setY(-t,e)}setBodyAndRowHeaderY(t){var e,i;const o=null===(e=this.bodyGroup.firstChild)||void 0===e?void 0:e.firstChild,n=null===(i=this.bodyGroup.firstChild)||void 0===i?void 0:i.lastChild;0===t&&o&&o.row===this.table.frozenRowCount&&o.attribute.y+t<0?t=-o.attribute.y:n&&this.table.tableNoFrameHeight<this.table.getAllRowsHeight()&&n.row===this.table.rowCount-this.table.bottomFrozenRowCount-1&&n.attribute.y+n.attribute.height+t<this.table.tableNoFrameHeight-this.table.getFrozenRowsHeight()-this.table.getBottomFrozenRowsHeight()&&(t=this.table.tableNoFrameHeight-this.table.getFrozenRowsHeight()-this.table.getBottomFrozenRowsHeight()-n.attribute.y-n.attribute.height),this.colHeaderGroup.attribute.height+t!==this.bodyGroup.attribute.y&&(this.bodyGroup.setAttribute("y",this.colHeaderGroup.attribute.height+t),this.rowHeaderGroup.setAttribute("y",this.cornerHeaderGroup.attribute.height+t),this.table.rightFrozenColCount>0&&this.rightFrozenGroup.setAttribute("y",this.rightTopCornerGroup.attribute.height+t),this.updateNextFrame())}setBodyAndColHeaderX(t){const e=this.bodyGroup.firstChild,i=this.bodyGroup.lastChild;0===t&&e&&e.col===this.table.frozenColCount&&e.attribute.x+t<0?t=-e.attribute.x:i&&this.table.tableNoFrameWidth<this.table.getAllColsWidth()&&i.col===this.table.colCount-this.table.rightFrozenColCount-1&&i.attribute.x+i.attribute.width+t<this.table.tableNoFrameWidth-this.table.getFrozenColsWidth()-this.table.getRightFrozenColsWidth()&&(t=this.table.tableNoFrameWidth-this.table.getFrozenColsWidth()-this.table.getRightFrozenColsWidth()-i.attribute.x-i.attribute.width),this.table.getFrozenColsWidth()+t!==this.bodyGroup.attribute.x&&(this.bodyGroup.setAttribute("x",this.table.getFrozenColsWidth()+t),this.colHeaderGroup.setAttribute("x",this.table.getFrozenColsWidth()+t),this.table.bottomFrozenRowCount>0&&this.bottomFrozenGroup.setAttribute("x",this.table.getFrozenColsWidth()+t),this.updateNextFrame())}afterScenegraphCreated(){this.isPivot||this.table.transpose?this.table.options.frozenColCount?this.component.setFrozenColumnShadow(this.table.frozenColCount-1):this.table.options.rightFrozenColCount?this.component.setRightFrozenColumnShadow(this.table.colCount-this.table.rightFrozenColCount):this.component.setFrozenColumnShadow(-1):(this.component.setFrozenColumnShadow(this.table.frozenColCount-1),this.component.setRightFrozenColumnShadow(this.table.colCount-this.table.rightFrozenColCount)),this.table.stateManager.checkFrozen(),this.updateContainer(),this.createFrameBorder(),this.updateBorderSizeAndPosition(),this.component.updateScrollBar(),IR(this.table),this.table.options.animationAppear&&function(t){var e,i,o,n;if(!t.options.animationAppear)return;let r,s,l,a;!0===t.options.animationAppear?(r=500,s=0,l="one-by-one",a="column"):(r=null!==(e=t.options.animationAppear.duration)&&void 0!==e?e:500,s=null!==(i=t.options.animationAppear.delay)&&void 0!==i?i:0,l=null!==(o=t.options.animationAppear.type)&&void 0!==o?o:"one-by-one",a=null!==(n=t.options.animationAppear.direction)&&void 0!==n?n:"row");const{scenegraph:h,frozenColCount:d,frozenRowCount:c}=t,{colStart:u,colEnd:g,rowStart:p,rowEnd:f}=h.proxy;for(let t=0;t<=g;t++)for(let e=0;e<=f;e++){const i=h.highPerformanceGetCell(t,e);i&&"cell"===i.role&&i.forEachChildren((i=>{i.setAttribute("opacity",0),i.animate().wait("one-by-one"===l?("row"===a?e:t)*(r-s):s).to({opacity:1},r,"linear")}))}}(this.table),this.updateNextFrame()}dealWidthMode(){const t=this.table;if("adaptive"===t.widthMode){t._clearColRangeWidthsMap();const e=t.tableNoFrameWidth;let i=0;for(let e=0;e<t.colCount;e++)(e<t.rowHeaderLevelCount||t.isPivotChart()&&e>=t.colCount-t.rightFrozenColCount)&&(i+=t.getColWidth(e));hR(e-i,t.rowHeaderLevelCount,t.isPivotChart()?t.colCount-t.rightFrozenColCount:t.colCount,!1,[],t,!0)}else if(t.autoFillWidth){t._clearColRangeWidthsMap();const e=t.tableNoFrameWidth;let i=0,o=0;for(let e=0;e<t.colCount;e++){const n=t.getColWidth(e);(e<t.rowHeaderLevelCount||t.isPivotChart()&&e>=t.colCount-t.rightFrozenColCount)&&(i+=n),o+=n}if(o<e&&o>i){hR(e-i,t.rowHeaderLevelCount,t.isPivotChart()?t.colCount-t.rightFrozenColCount:t.colCount,!1,[],t,!0)}}let e=0;this.bodyGroup.forEachChildrenSkipChild((t=>{e+=t.attribute.width})),this.bodyGroup.setAttribute("width",e);let i=0;this.colHeaderGroup.forEachChildrenSkipChild((t=>{i+=t.attribute.width})),this.colHeaderGroup.setAttribute("width",i);let o=0;this.rowHeaderGroup.forEachChildrenSkipChild((t=>{o+=t.attribute.width})),this.rowHeaderGroup.setAttribute("width",o);let n=0;this.cornerHeaderGroup.forEachChildrenSkipChild((t=>{n+=t.attribute.width})),this.cornerHeaderGroup.setAttribute("width",n),this.colHeaderGroup.setAttribute("x",this.cornerHeaderGroup.attribute.width),this.rowHeaderGroup.setAttribute("y",this.cornerHeaderGroup.attribute.height),this.bodyGroup.setAttributes({x:this.rowHeaderGroup.attribute.width,y:this.colHeaderGroup.attribute.height})}dealHeightMode(){var t;const e=this.table;if("adaptive"===e.heightMode){e._clearRowRangeHeightsMap();const t=e.getRowsHeight(0,e.columnHeaderLevelCount-1),i=e.isPivotChart()?e.getBottomFrozenRowsHeight():0,o=e.tableNoFrameHeight-t-i,n=e.columnHeaderLevelCount,r=e.isPivotChart()?e.rowCount-e.bottomFrozenRowCount:e.rowCount;let s=0;for(let t=n;t<r;t++)s+=e.getRowHeight(t);const l=o/s;for(let t=n;t<r;t++){let i;i=t===r-1?o-e.getRowsHeight(n,r-2):Math.round(e.getRowHeight(t)*l),this.setRowHeight(t,i)}}else if(e.autoFillHeight){e._clearRowRangeHeightsMap();const i=e.tableNoFrameHeight;let o=0,n=0;for(let t=0;t<e.rowCount;t++){const i=e.getRowHeight(t);(t<e.columnHeaderLevelCount||e.isPivotChart()&&t>=e.rowCount-e.bottomFrozenRowCount)&&(n+=i),o+=i}if((null!==(t=this._dealAutoFillHeightOriginRowsHeight)&&void 0!==t?t:o)<i&&o-n>0){const t=e.columnHeaderLevelCount,r=e.isPivotChart()?e.rowCount-e.bottomFrozenRowCount:e.rowCount,s=(i-n)/(o-n);for(let o=t;o<r;o++){let l;l=o===r-1?i-n-e.getRowsHeight(t,r-2):Math.round(e.getRowHeight(o)*s),this.setRowHeight(o,l)}}}}dealFrozen(){!function(t){var e,i;if(t.table.frozenColCount>t.table.rowHeaderLevelCount){t.rowHeaderGroup.setAttribute("height",t.bodyGroup.attribute.height),t.rowHeaderGroup.setAttribute("y",t.bodyGroup.attribute.y),t.cornerHeaderGroup.setAttribute("height",t.colHeaderGroup.attribute.height);for(let e=0;e<t.table.frozenColCount-t.table.rowHeaderLevelCount;e++)sM(t),lM(t),dM(t)}else if(t.table.frozenColCount<t.table.rowHeaderLevelCount){t.bodyGroup.setAttribute("height",t.rowHeaderGroup.attribute.height),t.bodyGroup.setAttribute("y",t.rowHeaderGroup.attribute.y),t.colHeaderGroup.setAttribute("height",t.cornerHeaderGroup.attribute.height);for(let e=0;e<t.table.rowHeaderLevelCount-t.table.frozenColCount;e++)aM(t),hM(t),cM(t)}t.bodyGroup.setAttribute("x",t.rowHeaderGroup.attribute.width),t.colHeaderGroup.setAttribute("x",t.cornerHeaderGroup.attribute.width),t.updateContainer(),t.updateBorderSizeAndPosition(),t.isPivot||t.table.transpose?t.table.options.frozenColCount?t.component.setFrozenColumnShadow(t.table.frozenColCount-1):t.table.options.frozenColCount&&t.component.setRightFrozenColumnShadow(t.table.colCount-t.table.rightFrozenColCount):(t.component.setFrozenColumnShadow(t.table.frozenColCount-1),t.component.setRightFrozenColumnShadow(t.table.colCount-t.table.rightFrozenColCount)),t.hasFrozen=!0,t.frozenColCount=t.table.frozenColCount,t.frozenRowCount=null!==(i=null===(e=t.colHeaderGroup.firstChild)||void 0===e?void 0:e.childrenCount)&&void 0!==i?i:0}(this)}resetFrozen(){rM(this)}updateCellLayoutWidthCertainWidth(t,e,i){const o=t.attribute.width;let n=!1;return t.forEachChildren(((t,r)=>{r+=e;const s=Mx(this.table,i,r);s?t=this.getCell(s.start.col,s.start.row):t.setAttribute("width",o);const l=r_(DS("padding",this.table._getCellStyle(i,r),i,r,this.table)),a=t.getChildByName("text");let h=0,d=0;if(a)h=a.AABBBounds.height()+(l[0]+l[2]),a.setAttribute("maxLineWidth",o-(l[1]+l[3])),d=a.AABBBounds.height()+(l[0]+l[2]);else{const e=t.getChildAt(1);h=e.AABBBounds.height()+(l[0]+l[2]),e._cellWidth=o-(l[1]+l[3]),e.layout(),d=e.AABBBounds.height()+(l[0]+l[2])}const c=this.table.getRowHeight(r);t.attribute.height!==d&&(t.setAttribute("height",d),(c===h||d>c)&&(n=!0))})),n}updateHeaderPosition(t,e,i,o,n){!function(t,e,i,o,n,r){const s=r.scenegraph;for(let i=t;i<=e;i++){const t=r.getColWidth(i),e=r.scenegraph.getColGroup(i,!0),o=r.scenegraph.getColGroup(i),n=r.scenegraph.getColGroupInBottom(i),s=r.scenegraph.getColGroupInLeftBottomCorner(i),l=r.scenegraph.getColGroupInRightBottomCorner(i);e&&(e.setAttribute("width",t),e.forEachChildren((e=>{e.setAttribute("width",t)}))),o&&(o.setAttribute("width",t),o.forEachChildren((e=>{e.setAttribute("width",t)}))),n&&(n.setAttribute("width",t),n.forEachChildren((e=>{e.setAttribute("width",t)}))),l&&(l.setAttribute("width",t),l.forEachChildren((e=>{e.setAttribute("width",t)}))),s&&(s.setAttribute("width",t),s.forEachChildren((e=>{e.setAttribute("width",t)})))}if(s.updateContainer(),"column"===n)for(let i=t;i<=e;i++){const t=r.scenegraph.getColGroup(i);null==t||t.setAttribute("chartInstance",void 0);for(let t=0;t<=r.frozenRowCount-1;t++)s.updateCellContent(i,t);for(let t=s.bodyRowStart;t<=s.bodyRowEnd;t++)s.updateCellContent(i,t);for(let t=r.rowCount-r.bottomFrozenRowCount;t<=r.rowCount-1;t++)s.updateCellContent(i,t)}else{for(let t=0;t<=r.frozenColCount-1;t++){const e=r.scenegraph.getColGroup(t);null==e||e.setAttribute("chartInstance",void 0);for(let e=i;e<=o;e++)s.updateCellContent(t,e)}for(let t=s.bodyColStart;t<=s.bodyColEnd;t++){const e=r.scenegraph.getColGroup(t);null==e||e.setAttribute("chartInstance",void 0);for(let e=i;e<=o;e++)s.updateCellContent(t,e)}for(let t=r.colCount-r.rightFrozenColCount;t<=r.colCount-1;t++){const e=r.scenegraph.getColGroup(t);null==e||e.setAttribute("chartInstance",void 0);for(let e=i;e<=o;e++)s.updateCellContent(t,e)}}}(t,e,i,o,n,this.table)}updateContainerAttrWidthAndX(){var t,e,i;const o=vM(this.cornerHeaderGroup,0),n=vM(this.rowHeaderGroup,0),r=this.colHeaderGroup.hasChildNodes()&&this.colHeaderGroup.firstChild?vM(this.colHeaderGroup,this.colHeaderGroup.firstChild.col>0?this.table.getColsWidth(null!==(t=this.table.frozenColCount)&&void 0!==t?t:0,this.colHeaderGroup.firstChild.col-1):0):0,s=this.bodyGroup.hasChildNodes()&&this.bodyGroup.firstChild?vM(this.bodyGroup,this.bodyGroup.firstChild.col>0?this.table.getColsWidth(null!==(e=this.table.frozenColCount)&&void 0!==e?e:0,this.bodyGroup.firstChild.col-1):0):0,l=vM(this.rightFrozenGroup.childrenCount>0?this.rightFrozenGroup:this.rightTopCornerGroup,0);this.bottomFrozenGroup.hasChildNodes()&&this.bottomFrozenGroup.firstChild&&vM(this.bottomFrozenGroup,this.bottomFrozenGroup.firstChild.col>0?this.table.getColsWidth(null!==(i=this.table.frozenColCount)&&void 0!==i?i:0,this.bottomFrozenGroup.firstChild.col-1):0),vM(this.leftBottomCornerGroup,0),vM(this.rightTopCornerGroup,0),vM(this.rightBottomCornerGroup,0),this.cornerHeaderGroup.setDeltaWidth(o-this.cornerHeaderGroup.attribute.width),this.leftBottomCornerGroup.setDeltaWidth(o-this.leftBottomCornerGroup.attribute.width),this.colHeaderGroup.setDeltaWidth(r-this.colHeaderGroup.attribute.width),this.rowHeaderGroup.setDeltaWidth(n-this.rowHeaderGroup.attribute.width),this.bottomFrozenGroup.setDeltaWidth(r-this.bottomFrozenGroup.attribute.width),this.rightFrozenGroup.setDeltaWidth(l-this.rightFrozenGroup.attribute.width),this.rightTopCornerGroup.setDeltaWidth(l-this.rightTopCornerGroup.attribute.width),this.rightBottomCornerGroup.setDeltaWidth(l-this.rightBottomCornerGroup.attribute.width),this.bodyGroup.setDeltaWidth(s-this.bodyGroup.attribute.width),this.colHeaderGroup.setAttribute("x",this.cornerHeaderGroup.attribute.width),this.bottomFrozenGroup.setAttribute("x",this.table.getFrozenColsWidth()),this.bodyGroup.setAttribute("x",this.rowHeaderGroup.attribute.width)}updateContainer(){arguments.length>0&&void 0!==arguments[0]&&arguments[0]?this._needUpdateContainer||(this._needUpdateContainer=!0,setTimeout((()=>{this.updateContainerSync()}),0)):(this._needUpdateContainer=!0,this.updateContainerSync())}updateContainerSync(){this._needUpdateContainer&&(this._needUpdateContainer=!1,this.updateContainerAttrWidthAndX(),this.updateTableSize(),this.component.updateScrollBar(),this.updateDomContainer(),this.updateNextFrame())}updateCellContentWhileResize(t,e){var i;const o=(null===(i=this.table.getCellRawRecord(t,e))||void 0===i?void 0:i.vtableMerge)?"text":this.table.isHeader(t,e)?this.table._getHeaderLayoutMap(t,e).headerType:this.table.getBodyColumnType(t,e),n=this.getCell(t,e);"image"!==o&&"video"!==o||QS(n,t,e,0,0,this.table)}createFrameBorder(){this.updateTableSize();const t=!this.isPivot&&!this.table.internalProps.transpose;sB(this.bodyGroup,this.table.theme.bodyStyle.frameStyle,this.bodyGroup.role,t?[!0,!0,!0,!1]:void 0),sB(this.rowHeaderGroup,this.isPivot||this.table.internalProps.transpose?this.table.theme.rowHeaderStyle.frameStyle:this.table.theme.bodyStyle.frameStyle,this.rowHeaderGroup.role,t?[!0,!1,!0,!0]:void 0),sB(this.colHeaderGroup,this.table.theme.headerStyle.frameStyle,this.colHeaderGroup.role,t?[!0,!0,!0,!1]:void 0),sB(this.cornerHeaderGroup,this.isPivot?this.table.theme.cornerHeaderStyle.frameStyle:this.table.theme.headerStyle.frameStyle,this.cornerHeaderGroup.role,t?[!0,!1,!0,!0]:void 0),sB(this.tableGroup,this.table.theme.frameStyle,this.tableGroup.role,void 0)}getResizeColAt(t,e,i){let o,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:8;if(!i){const i=this.table.getDrawRange();return e>=i.top&&e<=i.bottom&&(o=this.table.getCellAtRelativePosition(t-n,e),o.col===this.table.colCount-1)?o:{col:-1,row:-1}}return i.stage?(t<i.globalAABBBounds.x1+n?o={col:i.col-1,row:i.row,x:i.globalAABBBounds.x1}:i.globalAABBBounds.x2-n<t&&(o={col:i.col,row:i.row,x:i.globalAABBBounds.x2}),o&&this.table.rightFrozenColCount>0&&o.col>=this.table.colCount-this.table.rightFrozenColCount-1&&this.table.tableNoFrameWidth-this.table.getFrozenColsWidth()-this.table.getRightFrozenColsWidth()+this.table.scrollLeft<this.bodyGroup.attribute.width&&(o.col=o.col+1,o.rightFrozen=!0),o||{col:-1,row:-1}):{col:-1,row:-1}}getResizeRowAt(t,e,i){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:8;if(i){let t;if(e<i.globalAABBBounds.y1+o?t={col:i.col,row:i.row-1,y:i.globalAABBBounds.y1}:i.globalAABBBounds.y2-o<e&&(t={col:i.col,row:i.row,y:i.globalAABBBounds.y2}),t&&this.table.bottomFrozenRowCount>0&&t.row>=this.table.rowCount-this.table.bottomFrozenRowCount-1&&this.table.tableNoFrameHeight-this.table.getFrozenRowsHeight()-this.table.getBottomFrozenRowsHeight()+this.table.scrollTop<this.bodyGroup.attribute.height&&(t.row=t.row+1,t.bottomFrozen=!0),t)return t}return{col:-1,row:-1}}updateFrozen(){this.clear||(this.resetFrozen(),this.component.updateScrollBar())}dealWidthRightFrozen(t){this.clear?this.table.internalProps.rightFrozenColCount=t:function(t,e){const{table:i,proxy:o,rightTopCornerGroup:n,rightFrozenGroup:r,rightBottomCornerGroup:s,bottomFrozenGroup:l,bodyGroup:a,colHeaderGroup:h}=e,d=e.table.rightFrozenColCount;if(t>d){for(let o=i.colCount-d-1;o>=i.colCount-t;o--)uM(r,e.getColGroup(o),r.firstChild),uM(n,e.getColGroup(o,!0),n.firstChild),uM(s,e.getColGroupInBottom(o),s.firstChild);let o=0;r.forEachChildren((t=>{t.setAttribute("x",o),o+=t.attribute.width})),o=0,n.forEachChildren((t=>{t.setAttribute("x",o),o+=t.attribute.width})),o=0,s.forEachChildren((t=>{t.setAttribute("x",o),o+=t.attribute.width}))}else if(t<d){for(let o=i.colCount-d;o<i.colCount-t;o++){const t=e.getColGroup(o);t.setAttribute("x",a.lastChild.attribute.x+i.getColWidth(a.lastChild.col)),a.appendChild(t);const n=e.getColGroupInRightTopCorner(o);n.setAttribute("x",h.lastChild.attribute.x+i.getColWidth(h.lastChild.col)),h.appendChild(n);const r=e.getColGroupInRightBottomCorner(o);r.setAttribute("x",l.lastChild.attribute.x+i.getColWidth(l.lastChild.col)),l.appendChild(r)}let o=0;r.forEachChildren((t=>{t.setAttribute("x",o),o+=t.attribute.width})),o=0,n.forEachChildren((t=>{t.setAttribute("x",o),o+=t.attribute.width})),o=0,s.forEachChildren((t=>{t.setAttribute("x",o),o+=t.attribute.width}))}r.setAttribute("width",i.getColsWidth(i.colCount-t,i.colCount-1)),n.setAttribute("width",i.getColsWidth(i.colCount-t,i.colCount-1)),s.setAttribute("width",i.getColsWidth(i.colCount-t,i.colCount-1)),i.internalProps.rightFrozenColCount=t,e.updateContainer(),e.component.updateScrollBar(),e.updateNextFrame()}(t,this)}dealWidthBottomFrozen(t){this.clear?this.table.internalProps.bottomFrozenRowCount=t:function(t,e){const{table:i,proxy:o,bottomFrozenGroup:n,leftBottomCornerGroup:r,rightBottomCornerGroup:s}=e;n.childrenCount||(o.table.isPivotChart()||(fR(r,0,0,0,i.frozenColCount-1,0,-1,"rowHeader",i),fR(s,0,0,i.colCount-i.rightFrozenColCount,i.colCount-1,0,-1,"body",i)),fR(n,0,0,o.colStart,o.colEnd,0,-1,"body",i));const l=e.table.bottomFrozenRowCount;if(t>l){for(let o=0;o<i.frozenColCount;o++){const n=e.getColGroupInLeftBottomCorner(o);for(let r=i.rowCount-l-1;r>=i.rowCount-t;r--)uM(n,e.getCell(o,r,!0),n.firstChild);let r=0;n.forEachChildren((t=>{t.setAttribute("y",r),r+=i.getRowHeight(t.row)}))}for(let n=o.colStart;n<=o.colEnd;n++){const o=e.getColGroupInBottom(n);for(let r=i.rowCount-l-1;r>=i.rowCount-t;r--)uM(o,e.getCell(n,r,!0),o.firstChild);let r=0;o.forEachChildren((t=>{t.setAttribute("y",r),r+=i.getRowHeight(t.row)}))}if(i.rightFrozenColCount>0)for(let o=i.colCount-i.rightFrozenColCount;o<i.colCount;o++){const n=e.getColGroupInRightBottomCorner(o);for(let r=i.rowCount-l-1;r>=i.rowCount-t;r--)uM(n,e.getCell(o,r,!0),n.firstChild);let r=0;n.forEachChildren((t=>{t.setAttribute("y",r),r+=i.getRowHeight(t.row)}))}}else if(t<l){for(let o=0;o<i.rowHeaderLevelCount;o++){const n=e.getColGroup(o);for(let r=i.rowCount-l;r<i.rowCount-t;r++){const t=e.getCell(o,r,!0);t.setAttribute("y",n.lastChild.attribute.y+i.getRowHeight(n.lastChild.row)),n.appendChild(t)}const r=e.getColGroupInLeftBottomCorner(o);let s=0;r.forEachChildren((t=>{t.setAttribute("y",s),s+=i.getRowHeight(t.row)}))}for(let n=o.colStart;n<=o.colEnd;n++){const o=e.getColGroup(n);for(let r=i.rowCount-l;r<i.rowCount-t;r++){const t=e.getCell(n,r,!0);t.setAttribute("y",o.lastChild.attribute.y+i.getRowHeight(o.lastChild.row)),o.appendChild(t)}const r=e.getColGroupInBottom(n);let s=0;r.forEachChildren((t=>{t.setAttribute("y",s),s+=i.getRowHeight(t.row)}))}if(i.rightFrozenColCount>0)for(let o=i.colCount-i.rightFrozenColCount;o<i.colCount;o++){const n=e.getColGroup(o);for(let r=i.rowCount-l;r<i.rowCount-t;r++){const t=e.getCell(o,r,!0);t.setAttribute("y",n.lastChild.attribute.y+i.getRowHeight(n.lastChild.row)),n.appendChild(t)}const r=e.getColGroupInRightBottomCorner(o);let s=0;r.forEachChildren((t=>{t.setAttribute("y",s),s+=i.getRowHeight(t.row)}))}}n.setAttribute("height",i.getRowsHeight(i.rowCount-t,i.rowCount-1)),r.setAttribute("height",i.getRowsHeight(i.rowCount-t,i.rowCount-1)),s.setAttribute("height",i.getRowsHeight(i.rowCount-t,i.rowCount-1)),i.internalProps.bottomFrozenRowCount=t,e.updateContainer(),e.component.updateScrollBar(),e.updateNextFrame()}(t,this)}updateBorderSizeAndPosition(){this.bodyGroup.border&&(this.bodyGroup.appendChild(this.bodyGroup.border),hB(this.bodyGroup),this.rowHeaderGroup.attribute.width,lB(this.bodyGroup,this.table.theme.bodyStyle.frameStyle)),this.colHeaderGroup.border&&(this.colHeaderGroup.appendChild(this.colHeaderGroup.border),hB(this.colHeaderGroup),this.cornerHeaderGroup.attribute.width,lB(this.colHeaderGroup,this.table.theme.headerStyle.frameStyle)),this.rowHeaderGroup.border&&(this.rowHeaderGroup.appendChild(this.rowHeaderGroup.border),hB(this.rowHeaderGroup)),this.cornerHeaderGroup.border&&(this.cornerHeaderGroup.appendChild(this.cornerHeaderGroup.border),hB(this.cornerHeaderGroup)),function(t){if(!t.theme.frameStyle.cornerRadius)return;const e=t.theme.frameStyle.cornerRadius,{cornerHeaderGroup:i,colHeaderGroup:o,rowHeaderGroup:n,bodyGroup:r,rightTopCornerGroup:s,leftBottomCornerGroup:l,rightBottomCornerGroup:a,rightFrozenGroup:h,bottomFrozenGroup:d}=t.scenegraph;i.setAttribute("cornerRadius",0),o.setAttribute("cornerRadius",0),n.setAttribute("cornerRadius",0),r.setAttribute("cornerRadius",0),s.setAttribute("cornerRadius",0),l.setAttribute("cornerRadius",0),a.setAttribute("cornerRadius",0),h.setAttribute("cornerRadius",0),d.setAttribute("cornerRadius",0);const c=Iw(e);i.attribute.width>0&&i.attribute.height>0?dB(i,[c[0],0,0,0]):o.attribute.height>0?dB(o,[c[0],0,0,0]):n.attribute.width>0?dB(n,[c[0],0,0,0]):dB(r,[c[0],0,0,0]),l.attribute.width>0&&l.attribute.height>0?dB(l,[0,0,0,c[3]]):d.attribute.height>0?dB(d,[0,0,0,c[3]]):n.attribute.width>0?dB(n,[0,0,0,c[3]]):dB(r,[0,0,0,c[3]]),s.attribute.width>0&&s.attribute.height>0?dB(s,[0,c[1],0,0]):o.attribute.height>0?dB(o,[0,c[1],0,0]):h.attribute.width>0?dB(h,[0,c[1],0,0]):dB(r,[0,c[1],0,0]),a.attribute.width>0&&a.attribute.height>0?dB(a,[0,0,c[2],0]):h.attribute.width>0?dB(h,[0,0,c[2],0]):d.attribute.height>0?dB(d,[0,0,c[2],0]):dB(r,[0,0,c[2],0])}(this.table)}sortCell(){this.isPivot||(this.table.transpose?this.proxy.sortCellHorizontal():this.proxy.sortCellVertical())}getCellOverflowText(t,e){var i,o;const n=this.getCell(t,e).getChildByName("text",!0);if(n&&"text"===n.type){if(n.attribute.moreThanMaxCharacters)return this.table.getCellValue(t,e);const r=rt(n.attribute.text)?n.attribute.text.join(""):n.attribute.text;let s="";if(nt(n.cache.clipedText)?s=n.cache.clipedText:null===(o=null===(i=n.cache.layoutData)||void 0===i?void 0:i.lines)||void 0===o||o.forEach((t=>{s+=t.str})),s!==r)return this.table.getCellValue(t,e)}else if(n&&"richtext"===n.type){const i=n;if(i.attribute.ellipsis&&i._frameCache&&i.attribute.height<i._frameCache.actualHeight)return i.attribute.textConfig.find((t=>t.text)),this.table.getCellValue(t,e)}return null}updateDrill(t,e,i,o,n){this.component.drillIcon.update(t,e,i,o,n,this)}updateCellContent(t,e){if(!this.clear)return lA(t,e,this.table)}setPixelRatio(t){this.stage.disableDirtyBounds(),this.stage.window.setDpr(t),this.stage.render(),this.stage.enableDirtyBounds()}updateRow(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];this.table.internalProps.layoutMap.clearCellRangeMap(),this.table.internalProps.useOneRowHeightFillAll=!1;const o=Cw(e.map((t=>t.row))).sort(((t,e)=>t-e)),n=Cw(i.map((t=>t.row))).sort(((t,e)=>t-e)),r=this.table.getAllRowsHeight()-[...o,...n].reduce(((t,e)=>t+this.table.getRowHeight(e)),0)<=this.table.tableNoFrameHeight;if(QR(t,e,i,this.table),this.recalculateColWidths(),"adaptive"===this.table.heightMode||this.table.autoFillHeight&&(this.table.getAllRowsHeight()<=this.table.tableNoFrameHeight||r))this.table.scenegraph.recalculateRowHeights();else if("autoHeight"===this.table.heightMode)for(let t=0;t<n.length;t++){const e=n[t],i=this.table.getRowHeight(e),o=RA(e,0,this.table.colCount-1,this.table);(e>=this.proxy.rowStart&&e<=this.proxy.rowEnd||e>=this.table.rowCount-this.table.bottomFrozenRowCount&&e<=this.table.rowCount-1)&&this.table.scenegraph.updateRowHeight(e,o-i)}this.table.stateManager.checkFrozen(),this.isPivot||this.table.transpose?this.table.options.frozenColCount?this.component.setFrozenColumnShadow(this.table.frozenColCount-1):this.table.options.rightFrozenColCount&&this.component.setRightFrozenColumnShadow(this.table.colCount-this.table.rightFrozenColCount):(this.component.setFrozenColumnShadow(this.table.frozenColCount-1),this.component.setRightFrozenColumnShadow(this.table.colCount-this.table.rightFrozenColCount)),this.component.updateScrollBar(),this.updateNextFrame()}updateCol(t,e){xM(t,e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],this.table),this.recalculateColWidths(),this.recalculateRowHeights(),this.table.stateManager.checkFrozen(),this.isPivot||this.table.transpose?this.table.options.frozenColCount?this.component.setFrozenColumnShadow(this.table.frozenColCount-1):this.table.options.rightFrozenColCount&&this.component.setRightFrozenColumnShadow(this.table.colCount-this.table.rightFrozenColCount):(this.component.setFrozenColumnShadow(this.table.frozenColCount-1),this.component.setRightFrozenColumnShadow(this.table.colCount-this.table.rightFrozenColCount)),this.component.updateScrollBar(),this.updateNextFrame()}getColumnGroupX(t){return t<this.table.rowHeaderLevelCount?this.table.getColsWidth(0,t-1):t<this.table.colCount-this.table.rightFrozenColCount?this.table.getColsWidth(this.table.rowHeaderLevelCount,t-1):t<this.table.colCount?this.table.getColsWidth(this.table.colCount-this.table.bottomFrozenRowCount,t-1):0}getCellGroupY(t){return t<this.table.frozenRowCount?this.table.getRowsHeight(0,t-1):t<this.table.rowCount-this.table.bottomFrozenRowCount?this.table.getRowsHeight(this.table.frozenRowCount,t-1):t<this.table.rowCount?this.table.getRowsHeight(this.table.rowCount-this.table.bottomFrozenRowCount,t-1):0}getCellGroupX(t){return t<this.table.rowHeaderLevelCount?this.table.getColsWidth(0,t-1):t<this.table.colCount-this.table.rightFrozenColCount?this.table.getColsWidth(this.table.rowHeaderLevelCount,t-1):t<this.table.colCount?this.table.getColsWidth(this.table.colCount-this.table.rightFrozenColCount,t-1):0}updateDomContainer(){!function(t){const{headerDomContainer:e,bodyDomContainer:i,frozenBodyDomContainer:o,frozenHeaderDomContainer:n,rightFrozenBodyDomContainer:r,rightFrozenHeaderDomContainer:s,bottomDomContainer:l,frozenBottomDomContainer:a,rightFrozenBottomDomContainer:h}=t.internalProps;if(!(e||i||o||n||r||s||l||a||h))return;const d=t.getAllColsWidth(),c=Math.min(d,t.tableNoFrameWidth),u=t.getFrozenColsWidth(),g=t.getRightFrozenColsWidth(),p=u+g,f=Math.min(d-p,c-p),v=t.getAllRowsHeight(),m=Math.min(v,t.tableNoFrameHeight),b=t.getFrozenRowsHeight(),y=t.getBottomFrozenRowsHeight(),C=b+y,w=Math.min(v-C,m-C);t.frozenColCount>0?(e.style.left=`${t.tableX+u}px`,i.style.left=`${t.tableX+u}px`,l.style.left=`${t.tableX+u}px`):0===t.frozenColCount&&(e.style.left=`${t.tableX}px`,i.style.left=`${t.tableX}px`,l.style.left=`${t.tableX}px`),o.style.left=`${t.tableX}px`,n.style.left=`${t.tableX}px`,e.style.width=`${f}px`,e.style.height=`${b}px`,i.style.top=`${t.tableY}px`,i.style.width=`${f}px`,i.style.height=`${w}px`,i.style.top=`${t.tableY+b}px`,o.style.width=`${u}px`,o.style.height=`${w}px`,o.style.top=`${t.tableY+b}px`,n.style.width=`${u}px`,n.style.height=`${b}px`,n.style.top=`${t.tableY}px`,r.style.width=`${g}px`,r.style.height=`${w}px`,r.style.top=`${t.tableY+b}px`,r.style.left=t.tableX+c-g+"px",s.style.width=`${g}px`,s.style.height=`${b}px`,s.style.top=`${t.tableY}px`,s.style.left=t.tableX+c-g+"px",l.style.width=`${f}px`,l.style.height=`${y}px`,l.style.top=t.tableY+m-y+"px",a.style.width=`${u}px`,a.style.height=`${y}px`,a.style.top=t.tableY+m-y+"px",h.style.width=`${g}px`,h.style.height=`${y}px`,h.style.top=t.tableY+m-y+"px",h.style.left=t.tableX+c-g+"px"}(this.table)}}function RM(t,e,i){const o=t.highPerformanceGetCell(e,i);if("cell"===o.role&&Q(o.mergeStartCol)&&Q(o.mergeStartRow)&&Q(o.mergeEndCol)&&Q(o.mergeEndRow)){const{colStart:e,colEnd:i,rowStart:n,rowEnd:r}=EA(o,t);for(let o=e;o<=i;o++)for(let e=n;e<=r;e++)t.highPerformanceGetCell(o,e).addUpdateBoundTag()}else o.addUpdateBoundTag()}function MM(t,e,i,o,n){const r=t.table;for(let i=0;i<r.columnHeaderLevelCount;i++)RM(t,e,i);const s=t.getColGroup(e);return null==s||s.addUpdateBoundTag(),!0}function TM(t,e,i,o,n,r){const s=t.table;for(let i=0;i<s.columnHeaderLevelCount;i++)RM(t,e,i);const l=t.getColGroup(e);return null==l||l.addUpdateBoundTag(),!0}function kM(t,e,i,o,n){const r=t.table;for(let e=0;e<r.colCount;e++)RM(t,e,i);return!0}function LM(t,e,i,o,n,r){const s=t.table;for(let e=0;e<s.colCount;e++)RM(t,e,i);return!0}function PM(t,e,i){const{table:o}=t,{scenegraph:n}=o,{highlightScope:r,singleStyle:s,disableHeader:l,cellPos:a,cellPosContainHeader:h}=t.hover,d=a.col,c=a.row;if(r===OC.none||l&&(h.col!==e||h.row!==i)){const t=h.col,o=h.row;n.hideHoverIcon(t,o),n.showHoverIcon(e,i),h.col=e,h.row=i}if((l&&o.isHeader(e,i)||r===OC.none)&&(e=-1,i=-1),d===e&&c===i)return;n.deactivateChart(d,c),n.activateChart(e,i);let u=!1;const{ranges:g,highlightScope:p}=t.select;if(-1!==d&&-1!==c&&(u=function(t,e,i,o,n,r,s){let l=!1;return r===OC.single?l=!!function(t,e,i,o,n){return RM(t,e,i),!0}(t,e,i):r===OC.row?l=!!kM(t,0,i):r===OC.column?l=!!MM(t,e):r===OC.cross&&(l=!!kM(t,0,i),l=!!MM(t,e)),l}(n,d,c,0,0,r),l||n.hideHoverIcon(d,c)),-1===e||-1===i)return a.col=-1,a.row=-1,void(!u||d===e&&c===i||t.table.scenegraph.updateNextFrame());r===OC.single?u=!!function(t,e,i,o,n){return RM(t,e,i),!0}(n,e,i):r===OC.row?u=!!LM(n,0,i):r===OC.column?u=!!TM(n,e):r===OC.cross&&(u=!!LM(n,0,i),u=!!TM(n,e)),r===OC.none||l||n.showHoverIcon(e,i),a.col=e,a.row=i,u&&t.table.scenegraph.updateNextFrame()}function EM(t,e,i,o){var n;let r,s=null,l=!1;if(Array.isArray(i.sortState))for(let o=0;o<i.sortState.length&&(r=i.sortState[o],r&&(s=i._getHeaderCellBySortState(r)),s&&(l=HM(t,e,s.col,s.row,i)),!l);o++);else r=i.sortState,r&&(s=i._getHeaderCellBySortState(r)),s&&(l=HM(t,e,s.col,s.row,i));const a=i.getHeaderDefine(t,e);if(r&&l&&(null==a?void 0:a.sort)?r.order="asc"===r.order?"desc":"desc"===r.order?"normal":"asc":(null==a?void 0:a.sort)?r={field:i.getHeaderField(t,e),order:"asc"}:l&&(null==a?void 0:a.showSort)||(r={field:i.getHeaderField(t,e),order:"normal"}),r.event=o,i.fireListeners(Xw.SORT_CLICK,r).includes(!1))return;let h=!1,d=i.internalProps.sortState?Array.isArray(i.internalProps.sortState)&&(h=!0)?i.internalProps.sortState:[i.internalProps.sortState]:[];if(Array.isArray(d)){const t=d.findIndex((t=>t.field===r.field));t>=0?d[t]=r:d.push(r)}d=d.filter((t=>"normal"!==t.order)),d=i.internalProps.multipleSort&&(h=!0)?d:d.splice(-1),d=h&&d.length?d:d[0],i.internalProps.sortState=d,i.stateManager.setSortState(d),(null==a?void 0:a.sort)&&function(t,e,i){t=Array.isArray(t)||!t?t:[t],e.dataSource.sort((t||[]).map((t=>{var i,o;const n=e.internalProps.layoutMap.headerObjects.find((e=>e&&e.field===t.field));return{field:t.field,order:t.order||"asc",orderFn:"function"==typeof(null===(i=null==n?void 0:n.define)||void 0===i?void 0:i.sort)?null===(o=null==n?void 0:n.define)||void 0===o?void 0:o.sort:yw}})))}(d,i),i.internalProps.useOneRowHeightFillAll=!1,i.internalProps.layoutMap.clearCellRangeMap(),i.scenegraph.sortCell();const c=!!(null===(n=i.stateManager.select.ranges)||void 0===n?void 0:n.length);i.stateManager.updateSelectPos(-1,-1),i.stateManager.endSelectCells(!0,c)}function HM(t,e,i,o,n){return n._getLayoutCellId(t,e)===n._getLayoutCellId(i,o)}const FM=Lw(Xw,{PIVOT_SORT_CLICK:"pivot_sort_click",DRILLMENU_CLICK:"drillmenu_click"});function zM(t,e,i,o,n){for(let i=t;i<=e;i++)n._clearColRangeWidthsMap(i);for(let t=i;t<=o;t++)n._clearRowRangeHeightsMap(t)}function IM(t){var e;if(!t)return;const i=(null===(e=t.role)||void 0===e?void 0:e.startsWith("icon"))?t:"richtext"===t.type?t._currentHoverIcon:void 0;return i?"richtext"===t.type?{icon:i,position:{left:t.globalAABBBounds.x1+i.globalAABBBounds.x1,right:t.globalAABBBounds.x1+i.globalAABBBounds.x2,top:t.globalAABBBounds.y1+i.globalAABBBounds.y1,bottom:t.globalAABBBounds.y1+i.globalAABBBounds.y2,width:i.globalAABBBounds.x2-i.globalAABBBounds.x1,height:i.globalAABBBounds.y2-i.globalAABBBounds.y1},type:"richtext-icon"}:{icon:i,position:{left:i.globalAABBBounds.x1,right:i.globalAABBBounds.x2,top:i.globalAABBBounds.y1,bottom:i.globalAABBBounds.y2,width:i.globalAABBBounds.x2-i.globalAABBBounds.x1,height:i.globalAABBBounds.y2-i.globalAABBBounds.y1},type:"icon"}:void 0}function OM(t,e){"adaptive"===e.table.widthMode&&e.columnResize.col<e.table.colCount-1?(e.table.scenegraph.updateColWidth(e.columnResize.col,t),e.table.scenegraph.updateColWidth(e.columnResize.col+1,-t),e.table.internalProps._widthResizedColMap.add(e.columnResize.col),e.table.internalProps._widthResizedColMap.add(e.columnResize.col+1)):(e.table.scenegraph.updateColWidth(e.columnResize.col,t),e.table.internalProps._widthResizedColMap.add(e.columnResize.col))}function DM(t,e){"adaptive"===e.table.heightMode&&e.rowResize.row<e.table.rowCount-1?(e.table.scenegraph.updateRowHeight(e.rowResize.row,t),e.table.scenegraph.updateRowHeight(e.rowResize.row+1,-t),e.table.internalProps._heightResizedRowMap.add(e.rowResize.row),e.table.internalProps._heightResizedRowMap.add(e.rowResize.row+1)):(e.table.scenegraph.updateRowHeight(e.rowResize.row,t),e.table.internalProps._heightResizedRowMap.add(e.rowResize.row))}Lw(Xw,{VCHART_EVENT_TYPE:"vchart_event_type"});function WM(t){if(t.eventManager.bindSparklineHoverEvent)return;let e=!1;e=t.isPivotTable()?t.internalProps.layoutMap.indicatorsDefine.some((t=>"string"!=typeof t&&"sparkline"===t.cellType)):t.internalProps.layoutMap.columnObjects.some((t=>"sparkline"===t.cellType||"function"==typeof t.cellType)),e&&(t.eventManager.bindSparklineHoverEvent=!0,t.on(Xw.MOUSEMOVE_CELL,(e=>{const{col:i,row:o,x:n,y:r}=e;"sparkline"!==t.getBodyColumnType(i,o)&&t.stateManager.updateSparklineHoverPose(-1,-1,0,0),t.stateManager.updateSparklineHoverPose(i,o,n,r)})),t.on(Xw.MOUSELEAVE_TABLE,(e=>{t.stateManager.updateSparklineHoverPose(-1,-1,0,0)})))}function NM(t,e){let i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];var o;let{deltaX:n,deltaY:r}=t;t.shiftKey&&t.deltaY&&(n=r,r=0);const[s,l]=function(t,e,i){var o,n;const r=Math.abs(t/e),s=r<=.5?0:t,l=r>2?0:e;return[Math.ceil(s*(null!==(o=i.horizontal)&&void 0!==o?o:0)),Math.ceil(l*(null!==(n=i.vertical)&&void 0!==n?n:0))]}(n,r,{horizontal:1,vertical:1});(s||l)&&e.interactionState!==IC.scrolling&&e.updateInteractionState(IC.scrolling),s&&(e.setScrollLeft(e.scroll.horizontalBarPos+s,t),e.showHorizontalScrollBar(!0)),l&&(e.setScrollTop(e.scroll.verticalBarPos+l,t),e.showVerticalScrollBar(!0)),i&&e.resetInteractionState(e.interactionStateBeforeScroll),(null===(o=t.nativeEvent)||void 0===o?void 0:o.cancelable)&&("none"===e.table.internalProps.overscrollBehavior||Math.abs(r)>=Math.abs(n)&&0!==r&&GM(r,e)||Math.abs(r)<=Math.abs(n)&&0!==n&&jM(n,e))&&t.nativeEvent.preventDefault()}function GM(t,e){return 0!=e.table.getAllRowsHeight()-e.table.scenegraph.height&&!function(t,e){return 0!=e.table.getAllRowsHeight()-e.table.scenegraph.height&&t<=0&&e.scroll.verticalBarPos<1}(t,e)&&!function(t,e){var i;const o=(null===(i=e.table.options.customConfig)||void 0===i?void 0:i._disableColumnAndRowSizeRound)?1:0,n=e.table.getAllRowsHeight()-e.table.scenegraph.height;return 0!==n&&t>=0&&Math.abs(e.scroll.verticalBarPos-n)<1+o}(t,e)}function jM(t,e){return 0!=e.table.getAllColsWidth()-e.table.scenegraph.width&&!function(t,e){return 0!=e.table.getAllColsWidth()-e.table.scenegraph.width&&t<=0&&e.scroll.horizontalBarPos<1}(t,e)&&!function(t,e){var i;const o=(null===(i=e.table.options.customConfig)||void 0===i?void 0:i._disableColumnAndRowSizeRound)?1:0,n=e.table.getAllColsWidth()-e.table.scenegraph.width;return 0!==n&&t>=0&&Math.abs(e.scroll.horizontalBarPos-n)<1+o}(t,e)}class VM{constructor(t){this.stateManager=t}setScrollHandle(t){this.scrollHandle=t}startInertia(t,e,i){this.lastTime=Date.now(),this.speedX=t,this.speedY=e,this.friction=i,this.runingId||(this.runingId=requestAnimationFrame(this.inertia.bind(this)))}inertia(){var t;const e=Date.now(),i=e-this.lastTime;let o=!0;const n=Math.pow(this.friction,i/16),r=n*this.speedX,s=n*this.speedY;let l=0,a=0;Math.abs(r)>.05&&(o=!1,l=(this.speedX+r)/2*i),Math.abs(s)>.05&&(o=!1,a=(this.speedY+s)/2*i),null===(t=this.scrollHandle)||void 0===t||t.call(this,l,a),o?this.runingId=null:(this.lastTime=e,this.speedX=r,this.speedY=s,this.runingId=requestAnimationFrame(this.inertia.bind(this)))}endInertia(){cancelAnimationFrame(this.runingId),this.runingId=null}isInertiaScrolling(){return!!this.runingId}}function UM(t){const e=t.table,i=e.stateManager;e.scenegraph.tableGroup.addEventListener("pointermove",(o=>{var n,r,s,l,a,h,d,c,u,g,p,f,v,m,b,y,C,w,x;const _=null!==(r=null===(n=e.eventManager.LastPointerXY)||void 0===n?void 0:n.x)&&void 0!==r?r:o.x,S=null!==(l=null===(s=e.eventManager.LastPointerXY)||void 0===s?void 0:s.y)&&void 0!==l?l:o.y;e.eventManager.LastPointerXY={x:o.x,y:o.y},t.touchSetTimeout&&(clearTimeout(t.touchSetTimeout),t.touchSetTimeout=void 0);const A=Y_(o);if(A.eventArgs&&e.hasListeners(Xw.MOUSEMOVE_TABLE)&&e.fireListeners(Xw.MOUSEMOVE_TABLE,{col:A.eventArgs.col,row:A.eventArgs.row,x:A.abstractPos.x,y:A.abstractPos.y,event:o.nativeEvent,target:null===(a=null==A?void 0:A.eventArgs)||void 0===a?void 0:a.target,mergeCellInfo:null===(h=A.eventArgs)||void 0===h?void 0:h.mergeInfo}),i.interactionState===IC.grabing&&!(null===(d=e.editorManager)||void 0===d?void 0:d.editingEditor))return void(Math.abs(_-o.x)+Math.abs(S-o.y)>=1&&(i.isResizeCol()||(i.isMoveCol()?t.dealColumnMover(A):i.isFillHandle()?t.dealFillSelect(A,!0):(null===(c=e.options.select)||void 0===c?void 0:c.disableDragSelect)||t.dealTableSelect(A,!0))));!(null===(u=e.options.select)||void 0===u?void 0:u.disableDragSelect)&&e.eventManager.isDraging&&i.isSelecting()&&!(null===(g=e.editorManager)||void 0===g?void 0:g.editingEditor)&&t.dealTableSelect(A,!0);const B=o.path.find((t=>"cell"===t.role));if(e.hasListeners(Xw.MOUSELEAVE_CELL)&&(-1===e.stateManager.hover.cellPos.col||-1===e.stateManager.hover.cellPos.row||(null==B?void 0:B.col)===e.stateManager.hover.cellPos.col&&(null==B?void 0:B.row)===e.stateManager.hover.cellPos.row||e.fireListeners(Xw.MOUSELEAVE_CELL,{col:e.stateManager.hover.cellPos.col,row:e.stateManager.hover.cellPos.row,cellRange:e.getCellRangeRelativeRect({col:e.stateManager.hover.cellPos.col,row:e.stateManager.hover.cellPos.row}),scaleRatio:e.canvas.getBoundingClientRect().width/e.canvas.offsetWidth,event:o.nativeEvent,target:null===(p=null==A?void 0:A.eventArgs)||void 0===p?void 0:p.target})),e.hasListeners(Xw.MOUSEENTER_CELL)&&("cell"!==(null==B?void 0:B.role)||!Q(B.col)||!Q(B.row)||B.col===e.stateManager.hover.cellPos.col&&B.row===e.stateManager.hover.cellPos.row||B.col===(null===(f=e.stateManager.hover.cellPosContainHeader)||void 0===f?void 0:f.col)&&B.row===(null===(v=e.stateManager.hover.cellPosContainHeader)||void 0===v?void 0:v.row)||e.fireListeners(Xw.MOUSEENTER_CELL,{col:B.col,row:B.row,cellRange:e.getCellRangeRelativeRect({col:B.col,row:B.row}),scaleRatio:e.canvas.getBoundingClientRect().width/e.canvas.offsetWidth,event:o.nativeEvent,target:null===(m=null==A?void 0:A.eventArgs)||void 0===m?void 0:m.target,mergeCellInfo:null===(b=A.eventArgs)||void 0===b?void 0:b.mergeInfo})),t.dealIconHover(A),t.dealTableHover(A),A.eventArgs&&e.hasListeners(Xw.MOUSEMOVE_CELL)){let t,i;if(null===(y=A.eventArgs)||void 0===y?void 0:y.target){const e=IM(null===(C=A.eventArgs)||void 0===C?void 0:C.target);e&&(t=e.icon,i=e.position)}e.fireListeners(Xw.MOUSEMOVE_CELL,{col:A.eventArgs.col,row:A.eventArgs.row,x:A.abstractPos.x,y:A.abstractPos.y,event:o.nativeEvent,targetIcon:t?{name:t.name,position:i,funcType:t.attribute.funcType}:void 0,target:null===(w=null==A?void 0:A.eventArgs)||void 0===w?void 0:w.target,mergeCellInfo:null===(x=A.eventArgs)||void 0===x?void 0:x.mergeInfo})}})),e.scenegraph.tableGroup.addEventListener("pointerout",(e=>{var i;const o=Y_(e),n=null===(i=null==o?void 0:o.eventArgs)||void 0===i?void 0:i.target;"table"===(null==n?void 0:n.role)&&t.dealTableHover()})),e.scenegraph.tableGroup.addEventListener("pointerover",(t=>{var i,o;const n=Y_(t),r=null===(i=null==n?void 0:n.eventArgs)||void 0===i?void 0:i.target;if(r&&e.hasListeners(Xw.MOUSEOVER_CHART_SYMBOL)&&"symbol"===r.type){const i=t.composedPath().find((t=>"cell"===t.roll));if(i){const{col:r,row:s}=i,l={col:r,row:s,field:e.getHeaderField(r,s),value:e.getCellValue(r,s),dataValue:e.getCellOriginValue(r,s),cellHeaderPaths:e.internalProps.layoutMap.getCellHeaderPaths(r,s),title:e.getBodyColumnDefine(r,s).title,cellRange:e.getCellRelativeRect(r,s),event:t.nativeEvent,sparkline:{pointData:void 0},scaleRatio:e.canvas.getBoundingClientRect().width/e.canvas.offsetWidth,target:null===(o=null==n?void 0:n.eventArgs)||void 0===o?void 0:o.target};e.fireListeners(Xw.MOUSEOVER_CHART_SYMBOL,l)}}})),e.scenegraph.tableGroup.addEventListener("pointerenter",(t=>{(e.theme.scrollStyle.horizontalVisible&&"focus"===e.theme.scrollStyle.horizontalVisible||!e.theme.scrollStyle.horizontalVisible&&"focus"===e.theme.scrollStyle.visible)&&i.showHorizontalScrollBar(),(e.theme.scrollStyle.verticalVisible&&"focus"===e.theme.scrollStyle.verticalVisible||!e.theme.scrollStyle.verticalVisible&&"focus"===e.theme.scrollStyle.visible)&&i.showVerticalScrollBar(),e.hasListeners(Xw.MOUSEENTER_TABLE)&&e.fireListeners(Xw.MOUSEENTER_TABLE,{event:t.nativeEvent})})),e.scenegraph.tableGroup.addEventListener("pointerleave",(o=>{i.isResizeCol()||i.isMoveCol()||i.isSelecting()||(i.updateInteractionState(IC.default),i.updateCursor()),(e.theme.scrollStyle.horizontalVisible&&"focus"===e.theme.scrollStyle.horizontalVisible||!e.theme.scrollStyle.horizontalVisible&&"focus"===e.theme.scrollStyle.visible)&&i.hideHorizontalScrollBar(),(e.theme.scrollStyle.verticalVisible&&"focus"===e.theme.scrollStyle.verticalVisible||!e.theme.scrollStyle.verticalVisible&&"focus"===e.theme.scrollStyle.visible)&&i.hideVerticalScrollBar(),e.hasListeners(Xw.MOUSELEAVE_CELL)&&-1!==e.stateManager.hover.cellPos.col&&-1!==e.stateManager.hover.cellPos.row&&e.fireListeners(Xw.MOUSELEAVE_CELL,{col:e.stateManager.hover.cellPos.col,row:e.stateManager.hover.cellPos.row,cellRange:e.getCellRangeRelativeRect({col:e.stateManager.hover.cellPos.col,row:e.stateManager.hover.cellPos.row}),scaleRatio:e.canvas.getBoundingClientRect().width/e.canvas.offsetWidth,event:o.nativeEvent,target:void 0}),t.dealTableHover();const n=o.target;n&&!n.isDescendantsOf(e.scenegraph.tableGroup)&&e.fireListeners(Xw.MOUSELEAVE_TABLE,{event:o.nativeEvent})}));const o=o=>{var n;const r=o.target;if(!e.getElement().contains(r)){zw(null===(n=e.editorManager)||void 0===n?void 0:n.completeEdit(o),(e=>{!1!==e&&(i.updateInteractionState(IC.default),t.dealTableHover())}))}},n=o=>{var n;const r=o.target;if(!e.getElement().contains(r)){zw(null===(n=e.editorManager)||void 0===n?void 0:n.completeEdit(o),(o=>{var n,r;if(!1!==o&&(null===(n=e.options.select)||void 0===n?void 0:n.outsideClickDeselect)){const e=!!(null===(r=i.select.ranges)||void 0===r?void 0:r.length);t.dealTableSelect(),i.endSelectCells(!0,e)}}))}};t.globalEventListeners.push({name:"pointerup",env:"document",callback:o}),t.globalEventListeners.push({name:"pointerdown",env:"document",callback:n}),bu.addEventListener("pointerup",o),bu.addEventListener("pointerdown",n),e.scenegraph.tableGroup.addEventListener("pointerdown",(o=>{var n,r,s,l,a;if(e.hasListeners(Xw.MOUSEDOWN_TABLE)&&e.fireListeners(Xw.MOUSEDOWN_TABLE,{event:o.nativeEvent}),e.eventManager.isDown=!0,e.eventManager.LastBodyPointerXY={x:o.x,y:o.y},e.eventManager.LastPointerXY={x:o.x,y:o.y},0!==o.button)return;const h=Y_(o);if(t.downIcon=void 0,i.interactionState!==IC.default)return;if(e.isPivotChart()&&"chart"!==(null===(n=null==h?void 0:h.eventArgs)||void 0===n?void 0:n.target.type)&&e.scenegraph.updateChartState(null),(null===(r=h.eventArgs)||void 0===r?void 0:r.target)!==(null===(s=i.residentHoverIcon)||void 0===s?void 0:s.icon)&&i.hideMenu(),"chart"===(null===(l=null==h?void 0:h.eventArgs)||void 0===l?void 0:l.target.type))return;zw(null===(a=e.editorManager)||void 0===a?void 0:a.completeEdit(o.nativeEvent),(n=>{var r,s,l,a,d,c,u;if(!1===n)return;const g=(null===(l=null===(s=null===(r=null==h?void 0:h.eventArgs)||void 0===r?void 0:r.target)||void 0===s?void 0:s.role)||void 0===l?void 0:l.startsWith("icon"))?h.eventArgs.target:(null===(a=o.target.role)||void 0===a?void 0:a.startsWith("icon"))?o.target:void 0;if(t.downIcon=g,g&&!1!==g.attribute.interactive)g.attribute.funcType===VC.dragReorder&&(i.startMoveCol(h.eventArgs.col,h.eventArgs.row,h.abstractPos.x,h.abstractPos.y,null===(c=null===(d=h.eventArgs)||void 0===d?void 0:d.event)||void 0===c?void 0:c.nativeEvent),i.updateInteractionState(IC.grabing));else if("touch"===o.pointerType)t.touchEnd=!1,t.touchSetTimeout=setTimeout((()=>{t.isTouchdown=!1,t.touchMove=!0,(!t.touchEnd&&(t.checkColumnResize(h,!0)||t.checkRowResize(h,!0))||!t.touchEnd&&t.chechColumnMover(h)||t.dealTableSelect(h)&&!t.touchEnd)&&i.updateInteractionState(IC.grabing)}),500),t.dealTableHover(h);else{if(!t.checkCellFillhandle(h)&&(t.checkColumnResize(h,!0)||t.checkRowResize(h,!0)))return e.scenegraph.updateChartState(null),void i.updateInteractionState(IC.grabing);if(t.chechColumnMover(h))return void i.updateInteractionState(IC.grabing);if(t.checkCellFillhandle(h,!0)&&t.dealFillSelect(h))return void i.updateInteractionState(IC.grabing);t.dealTableSelect(h)&&i.updateInteractionState(IC.grabing)}if(e.hasListeners(Xw.MOUSEDOWN_CELL)){const t=Y_(o);t.eventArgs&&e.fireListeners(Xw.MOUSEDOWN_CELL,{col:t.eventArgs.col,row:t.eventArgs.row,event:o.nativeEvent,target:null===(u=null==t?void 0:t.eventArgs)||void 0===u?void 0:u.target,mergeCellInfo:t.eventArgs.mergeInfo})}}))})),e.scenegraph.tableGroup.addEventListener("pointerup",(t=>{var o,n,r,s;if(0===t.button){if("grabing"===i.interactionState){if(i.updateInteractionState(IC.default),i.isResizeCol())XM(e);else if(i.isResizeRow())YM(e);else if(i.isMoveCol()){const i=Y_(t);e.stateManager.endMoveCol()&&i.eventArgs&&e.hasListeners(Xw.CHANGE_HEADER_POSITION)&&e.fireListeners(Xw.CHANGE_HEADER_POSITION,{target:{col:i.eventArgs.col,row:i.eventArgs.row},source:{col:e.stateManager.columnMove.colSource,row:e.stateManager.columnMove.rowSource},event:t.nativeEvent})}else if(i.isSelecting()){e.stateManager.endSelectCells(),e.stateManager.isFillHandle()&&e.stateManager.endFillSelect();const i=Y_(t);if(e.eventManager.isDraging&&i.eventArgs&&e.hasListeners(Xw.DRAG_SELECT_END)){const r={event:t.nativeEvent,cells:[],col:i.eventArgs.target.col,row:i.eventArgs.target.row,scaleRatio:e.canvas.getBoundingClientRect().width/e.canvas.offsetWidth,target:null===(o=null==i?void 0:i.eventArgs)||void 0===o?void 0:o.target,mergeCellInfo:null===(n=i.eventArgs)||void 0===n?void 0:n.mergeInfo};r.cells=e.getSelectedCellInfos(),e.fireListeners(Xw.DRAG_SELECT_END,r)}}}else i.interactionState===IC.scrolling&&i.updateInteractionState(IC.default);if(e.hasListeners(Xw.MOUSEUP_CELL)){const i=Y_(t);i.eventArgs&&e.fireListeners(Xw.MOUSEUP_CELL,{col:i.eventArgs.col,row:i.eventArgs.row,event:t.nativeEvent,target:null===(r=null==i?void 0:i.eventArgs)||void 0===r?void 0:r.target,mergeCellInfo:null===(s=i.eventArgs)||void 0===s?void 0:s.mergeInfo})}}})),e.scenegraph.tableGroup.addEventListener("rightdown",(t=>{var o,n,r,s;const l=Y_(t);if(l.eventArgs){i.triggerContextMenu(l.eventArgs.col,l.eventArgs.row,l.abstractPos.x,l.abstractPos.y);const{col:a,row:h}=l.eventArgs;if(e.hasListeners(Xw.CONTEXTMENU_CELL)){const i=e.getCellInfo(a,h);let d,c;if(null===(o=l.eventArgs)||void 0===o?void 0:o.target){const t=IM(null===(n=l.eventArgs)||void 0===n?void 0:n.target);t&&(d=t.icon,c=t.position)}const u=Object.assign(Object.assign({},i),{event:t.nativeEvent,cells:[],targetIcon:d?{name:d.name,position:c,funcType:d.attribute.funcType}:void 0,target:null===(r=null==l?void 0:l.eventArgs)||void 0===r?void 0:r.target,mergeCellInfo:null===(s=l.eventArgs)||void 0===s?void 0:s.mergeInfo});!function(t,e,i){for(let o=0;o<t.length;o++){const n=t[o],r=Math.min(n.start.col,n.end.col),s=Math.max(n.start.col,n.end.col),l=Math.min(n.start.row,n.end.row),a=Math.max(n.start.row,n.end.row);if(r<=e&&e<=s&&l<=i&&i<=a||s<=e&&e<=r&&a<=i&&i<=l)return!0}return!1}(e.stateManager.select.ranges,a,h)?u.cells=[[i]]:u.cells=e.getSelectedCellInfos(),e.fireListeners(Xw.CONTEXTMENU_CELL,u)}}})),e.scenegraph.tableGroup.addEventListener("pointertap",(o=>{var n,r,s,l,a;if(e.stateManager.columnResize.resizing)return;const h=Y_(o);if(!t.touchMove&&0===o.button&&h.eventArgs&&e.hasListeners(Xw.CLICK_CELL)){const{col:t,row:i}=h.eventArgs,a=e.getCellInfo(t,i);let d,c;if(null===(n=h.eventArgs)||void 0===n?void 0:n.target){const t=IM(null===(r=h.eventArgs)||void 0===r?void 0:r.target);t&&(d=t.icon,c=t.position)}const u=Object.assign(Object.assign({},a),{event:o.nativeEvent,federatedEvent:o,cells:[],targetIcon:d?{name:d.name,position:c,funcType:d.attribute.funcType}:void 0,target:null===(s=null==h?void 0:h.eventArgs)||void 0===s?void 0:s.target,mergeCellInfo:null===(l=h.eventArgs)||void 0===l?void 0:l.mergeInfo});e.fireListeners(Xw.CLICK_CELL,u)}if(!e.stateManager.columnResize.resizing&&!e.stateManager.columnMove.moving&&(t.dealIconClick(o,h),(null==h?void 0:h.eventArgs)&&t.touchSetTimeout&&"touch"===o.pointerType)){const e=Y_(o);if(t.touchSetTimeout){clearTimeout(t.touchSetTimeout);const o=!!(null===(a=i.select.ranges)||void 0===a?void 0:a.length);t.dealTableSelect(e),i.endSelectCells(!0,o),t.touchSetTimeout=void 0}}})),e.scenegraph.stage.addEventListener("pointerdown",(o=>{var n,r,s,l;const a=Y_(o);(null===(n=a.eventArgs)||void 0===n?void 0:n.target)&&(null===(r=a.eventArgs)||void 0===r?void 0:r.target)===(null===(s=i.residentHoverIcon)||void 0===s?void 0:s.icon)||i.hideMenu();zw(null===(l=e.editorManager)||void 0===l?void 0:l.completeEdit(o.nativeEvent),(n=>{var r;if(!1===n)return;const s=(null===(r=o.target.role)||void 0===r?void 0:r.startsWith("icon"))?o.target:void 0;if(t.downIcon=s,s||t.checkCellFillhandle(a)||i.columnResize.resizing||!t.checkColumnResize(a,!0));else{e.scenegraph.updateChartState(null),i.updateInteractionState(IC.grabing);const{eventArgs:t}=a;(null==t?void 0:t.targetCell)||e.getCellAt(a.abstractPos.x-8,a.abstractPos.y)&&e.hasListeners(Xw.MOUSEDOWN_TABLE)&&e.fireListeners(Xw.MOUSEDOWN_TABLE,{event:o.nativeEvent})}}))})),e.scenegraph.stage.addEventListener("pointerup",(t=>{"grabing"===i.interactionState&&(i.updateInteractionState(IC.default),i.isResizeCol()&&XM(e))})),e.scenegraph.stage.addEventListener("pointertap",(o=>{var n,r,s;const l=o.target;if(e.eventManager.isDraging||!l||!l.isDescendantsOf(e.scenegraph.stage)&&l.stage!==l||l.isDescendantsOf(e.scenegraph.tableGroup))e.eventManager.isDraging&&i.isSelecting()&&i.endSelectCells();else{i.updateInteractionState(IC.default),t.dealTableHover();const o=!!(null===(n=i.select.ranges)||void 0===n?void 0:n.length);(null===(s=null===(r=e.options.select)||void 0===r?void 0:r.blankAreaClickDeselect)||void 0===s||s)&&t.dealTableSelect(),i.endSelectCells(!0,o),i.updateCursor(),e.scenegraph.updateChartState(null)}})),e.scenegraph.stage.addEventListener("pointermove",(o=>{const n=Y_(o);i.isResizeCol()||t.checkColumnResize(n)?e.stateManager.select&&t.checkCellFillhandle(n)?i.updateCursor("crosshair"):i.updateCursor("col-resize"):i.isResizeRow()||t.checkRowResize(n)?e.stateManager.select&&t.checkCellFillhandle(n)?i.updateCursor("crosshair"):i.updateCursor("row-resize"):i.isMoveCol()||i.updateCursor()})),e.scenegraph.tableGroup.addEventListener("checkbox_state_change",(t=>{var i,o;const n=Y_(t),{col:r,row:s}=n.eventArgs,l=e.getCellInfo(r,s),a=Mx(e,r,s);if(a)for(let i=a.start.col;i<=a.end.col;i++)for(let o=a.start.row;o<=a.end.row;o++)e.scenegraph.getCell(i,o).forEachChildren((e=>{"checkbox"===e.name&&e.setAttributes({checked:t.target.attribute.checked,indeterminate:t.target.attribute.indeterminate})}));const h=Object.assign(Object.assign({},l),{event:t.nativeEvent,target:null===(i=null==n?void 0:n.eventArgs)||void 0===i?void 0:i.target,mergeCellInfo:null===(o=null==n?void 0:n.eventArgs)||void 0===o?void 0:o.mergeInfo,checked:t.detail.checked});if(e.isHeader(r,s))e.stateManager.setHeaderCheckedState(l.field,t.detail.checked),"checkbox"===e.getCellType(r,s)&&e.scenegraph.updateCheckboxCellState(r,s,t.detail.checked);else if(e.stateManager.setCheckedState(r,s,l.field,t.detail.checked),"checkbox"===e.getCellType(r,s)){const t=e.stateManager.headerCheckedState[l.field],i=e.stateManager.updateHeaderCheckedState(l.field,r,s);t!==i&&e.scenegraph.updateHeaderCheckboxCellState(r,s,i)}e.fireListeners(Xw.CHECKBOX_STATE_CHANGE,h),e.scenegraph.updateNextFrame()})),e.scenegraph.tableGroup.addEventListener("radio_checked",(t=>{var i,o,n;const r=Y_(t),{col:s,row:l,target:a}=r.eventArgs,h=e.getCellInfo(s,l),d=null===(i=Z_.exec(a.id))||void 0===i?void 0:i[1],c=Mx(e,s,l);if(c)for(let t=c.start.col;t<=c.end.col;t++)for(let i=c.start.row;i<=c.end.row;i++)e.scenegraph.getCell(t,i).forEachChildren((t=>{"radio"===t.name&&t.id===a.id&&t.setAttributes({checked:!0})}));const u=e.getBodyColumnDefine(s,l).radioCheckType||"column";if("cell"===u)if(c)for(let t=c.start.col;t<=c.end.col;t++)for(let i=c.start.row;i<=c.end.row;i++)e.scenegraph.getCell(t,i).forEachChildren((t=>{"radio"===t.name&&t.id!==a.id&&t.setAttributes({checked:!1})}));else e.scenegraph.getCell(s,l).forEachChildren((t=>{"radio"===t.name&&t.id!==a.id&&t.setAttributes({checked:!1})}));else"column"===u&&e.scenegraph.getColGroup(s).forEachChildren((t=>{t.forEachChildren((t=>{"radio"===t.name&&t.id!==a.id&&t.setAttributes({checked:!1})}))}));const g=d?Number(d):void 0;e.stateManager.setRadioState(s,l,h.field,u,g);const p=Object.assign(Object.assign({},h),{event:t.nativeEvent,target:null===(o=null==r?void 0:r.eventArgs)||void 0===o?void 0:o.target,mergeCellInfo:null===(n=null==r?void 0:r.eventArgs)||void 0===n?void 0:n.mergeInfo,radioIndexInCell:g});e.fireListeners(Xw.RADIO_STATE_CHANGE,p),e.scenegraph.updateNextFrame()})),e.scenegraph.stage.addEventListener("wheel",(t=>{var o;null===(o=e.editorManager)||void 0===o||o.completeEdit(),e.eventManager._enableTableScroll&&NM(t,i)}))}function $M(t){const e=t.table;t.gesture=new Ug(e.scenegraph.tableGroup,{tap:{interval:300}}),t.gesture.on("doubletap",(t=>{!function(t,e){var i,o,n,r,s,l;const a=Y_(t);let h=-1,d=-1;a.eventArgs&&(h=a.eventArgs.col,d=a.eventArgs.row);const c=e.getCellValue(h,d),u=null===(o=null===(i=a.eventArgs)||void 0===i?void 0:i.targetCell)||void 0===o?void 0:o.globalAABBBounds;if(u&&e.internalProps.focusControl.setFocusRect(new tx(u.x1+e.scrollLeft,u.y1+e.scrollTop,u.x2-u.x1,u.y2-u.y1),c),e.hasListeners(Xw.DBLCLICK_CELL)){const i=e.getCellInfo(h,d);let o,c;if(null===(n=a.eventArgs)||void 0===n?void 0:n.target){const t=IM(null===(r=a.eventArgs)||void 0===r?void 0:r.target);t&&(o=t.icon,c=t.position)}const u=Object.assign(Object.assign({},i),{event:t.nativeEvent,federatedEvent:t,cells:[],targetIcon:o?{name:o.name,position:c,funcType:o.attribute.funcType}:void 0,target:null===(s=null==a?void 0:a.eventArgs)||void 0===s?void 0:s.target,mergeCellInfo:null===(l=null==a?void 0:a.eventArgs)||void 0===l?void 0:l.mergeInfo});e.fireListeners(Xw.DBLCLICK_CELL,u)}}(t,e)}))}function XM(t){t.stateManager.endResizeCol();const e=[];for(let i=0;i<t.colCount;i++)e.push(t.getColWidth(i));t.fireListeners(Xw.RESIZE_COLUMN_END,{col:t.stateManager.columnResize.col,colWidths:e})}function YM(t){t.stateManager.endResizeRow(),t.fireListeners(Xw.RESIZE_ROW_END,{row:t.stateManager.rowResize.row,rowHeight:t.getRowHeight(t.stateManager.rowResize.row)})}let KM=1;function qM(){return xw?KM=1:(KM=Math.ceil(window.devicePixelRatio||1),KM>1&&KM%2!=0&&(KM+=1)),KM}function ZM(t){return!!t.changedTouches}function JM(t,e,i){if(i.indicatorsAsCol){if(i.hasTwoIndicatorAxes&&e===i.columnHeaderLevelCount-1&&t>=i.rowHeaderLevelCount&&t<i.colCount-i.rightFrozenColCount)return"top";if(e===i.rowCount-i.bottomFrozenRowCount&&t>=i.rowHeaderLevelCount&&t<i.colCount-i.rightFrozenColCount)return"bottom";if(t===i.rowHeaderLevelCount-1&&e>=i.rowHeaderLevelCount&&e<i.rowCount-i.bottomFrozenRowCount)return"left"}else{if(t===i.rowHeaderLevelCount-1&&e>=i.columnHeaderLevelCount&&e<i.rowCount-i.bottomFrozenRowCount)return"left";if(t===i.colCount-i.rightFrozenColCount&&e>=i.columnHeaderLevelCount&&e<i.rowCount-i.bottomFrozenRowCount)return"right";if(e===i.rowCount-i.bottomFrozenRowCount&&t>=i.rowHeaderLevelCount&&t<i.colCount-i.rightFrozenColCount)return"bottom"}return"bottom"}qM();let QM;const tT=t=>{const e=t.value;return Number(e)>80?"#20a8d8":Number(e)>50?"#4dbd74":Number(e)>20?"#ffc107":"#f86c6b"};class eT extends QC{static get DEFAULT(){return QM||(QM=new eT)}constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};var e,i,o,n,r,s,l,a,h,d,c,u,g,p,f;super(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}),this._showBar=null===(e=t.showBar)||void 0===e||e,this._barColor=null!==(i=t.barColor)&&void 0!==i?i:tT,this._barPositiveColor=null!==(o=t.barPositiveColor)&&void 0!==o?o:"#4dbd74",this._barNegativeColor=null!==(n=t.barNegativeColor)&&void 0!==n?n:"#f86c6b",this._barAxisColor=null!==(r=t.barAxisColor)&&void 0!==r?r:"black",this._barBgColor=t.barBgColor,this._barHeight=null!==(s=t.barHeight)&&void 0!==s?s:3,this._barHeight=null!==(l=t.barHeight)&&void 0!==l?l:3,this._barBottom=null!==(a=t.barBottom)&&void 0!==a?a:0,this._barPadding=null!==(h=t.barPadding)&&void 0!==h?h:[0,0,0,0],this._showBarMark=null!==(d=t.showBarMark)&&void 0!==d&&d,this._barMarkPositiveColor=null!==(c=t.barMarkPositiveColor)&&void 0!==c?c:"#4dbd74",this._barMarkNegativeColor=null!==(u=t.barMarkNegativeColor)&&void 0!==u?u:"#f86c6b",this._barMarkWidth=null!==(g=t.barMarkWidth)&&void 0!==g?g:2,this._barMarkPosition=null!==(p=t.barMarkPosition)&&void 0!==p?p:"right",this._barRightToLeft=null!==(f=t.barRightToLeft)&&void 0!==f&&f}get showBar(){return this._showBar}set showBar(t){this._showBar=t}get barColor(){return this._barColor}set barColor(t){this._barColor=t}get barBgColor(){return this._barBgColor}set barBgColor(t){this._barBgColor=t}get barHeight(){return this._barHeight}set barHeight(t){this._barHeight=t}get barBottom(){return this._barBottom}set barBottom(t){this._barBottom=t}get barPositiveColor(){return this._barPositiveColor}set barPositiveColor(t){this._barPositiveColor=t}get barNegativeColor(){return this._barNegativeColor}set barNegativeColor(t){this._barNegativeColor=t}get barAxisColor(){return this._barAxisColor}set barAxisColor(t){this._barAxisColor=t}get barPadding(){return this._barPadding}set barPadding(t){this._barPadding=t}get showBarMark(){return this._showBarMark}set showBarMark(t){this._showBarMark=t}get barMarkPositiveColor(){return this._barMarkPositiveColor}set barMarkPositiveColor(t){this._barMarkPositiveColor=t}get barMarkNegativeColor(){return this._barMarkNegativeColor}set barMarkNegativeColor(t){this._barMarkNegativeColor=t}get barMarkWidth(){return this._barMarkWidth}set barMarkWidth(t){this._barMarkWidth=t}get barMarkPosition(){return this._barMarkPosition}set barMarkPosition(t){this._barMarkPosition=t}get barRightToLeft(){return this._barRightToLeft}set barRightToLeft(t){this._barRightToLeft=t}clone(){return new eT(this,null)}}const iT=["type","content","font","color","width","height","marginRight","marginLeft","src","svg","name","path","positionType","tooltip","hover","cursor","shape","interactive"];class oT{constructor(t){this._table=t;const e=FS();this.expandIcon=e[UC.expandIconName],this.collapseIcon=e[UC.collapseIconName]}getIcons(t,e,i,o,n){const r=[],s=this.getHierarchyIcon(t,e);s&&r.push(s);const{icon:l}=this._table.getBodyColumnDefine(t,e);if(l){let n;n="function"==typeof l?l({col:t,row:e,value:i,dataValue:o,table:this._table}):l;const s=FS(),a=t=>{let e;e="string"==typeof t?s[t]:t,e&&r.push(e)};Array.isArray(n)?n.forEach(((t,e)=>{a(t)})):a(n)}return n&&r.forEach(((i,o)=>{(i.content||i.src)&&(r[o]=this.getCellIconFromRecordValue(i,t,e))})),r}getStyleClass(t){switch(t){case"text":case"link":return ew;case"image":case"video":return tw;case"chart":case"sparkline":return QC;case"progressbar":return eT;case"checkbox":return ow;case"radio":return nw}return ew}getCellIconFromRecordValue(t,e,i){if(Array.isArray(t))return t.map((t=>this.getCellIconFromRecordValue(t,e,i)));if(!Gw.isObject(t)||"function"==typeof t)return this._table.getFieldData(t,e,i);const o={},n=t;return iT.forEach((t=>{var r,s;if(void 0!==n[t]){const l=this._table.getFieldData(n[t],e,i);Q(l)?o[t]=l:(null===(s=(r=this._table)._hasField)||void 0===s?void 0:s.call(r,n[t],e,i))||(o[t]=n[t])}})),o}getHierarchyIcon(t,e){const i=this._table.getHierarchyState(t,e);return i===WC.expand?this.expandIcon:i===WC.collapse?this.collapseIcon:void 0}getHierarchyIconWidth(){var t,e;return this.expandIcon.width+(null!==(t=this.expandIcon.marginLeft)&&void 0!==t?t:0)+(null!==(e=this.expandIcon.marginRight)&&void 0!==e?e:0)}}function nT(t,e){const i=document.createElement(t);return e&&i.classList.add(...e),i}!function(){if("node"===sw.mode)return;const t=document.createElement("style");t.id="vtable-menu-styleSheet",t.textContent="\n@keyframes vtable__menu-element--shown-animation {\n\t0% {\n\t\topacity: 0;\n\t}\n\t100% {\n\t\topacity: 1;\n\t}\n}\n.vtable__menu-element {\n\tposition: absolute;\n\tbox-sizing: border-box;\n\tborder-radius: 4px;\n\tbackground-color: #fff;\n\tpadding: 6px 0;\n\t/* pointer-events: none; */\n\tuser-select: none;\n\tcolor: #000;\n\tmax-width: 300px;\n\tz-index: 99999;\n\tborder: #CCC 0.5px solid;\n\tcursor: default;\n\twidth: max-content;\n\tbox-shadow: 0px 8px 16px rgba(27, 31, 35, 0.12);\n max-height: 100%;\n overflow-y: auto;\n}\n.vtable__menu-element--hidden {\n\topacity: 0;\n\t/* transform: translate(-50%, -50%); */\n\ttransition: opacity 75ms linear;\n\tz-index: -9999;\n}\n.vtable__menu-element--shown {\n\topacity: 1;\n\t/* transform: translate(-50%, -50%); */\n\tanimation: vtable__menu-element--shown-animation 150ms ease-out;\n}\n.vtable__menu-element__content {\n\tfont-family: Roboto;\n\tfont-size: 12px;\n\toverflow: hidden;\n\tdisplay: inline-block;\n\t/* height: 100%; */\n\tline-height: 30px;\n}\n.vtable__menu-element__item {\n\theight: 32px;\n\tpadding: 0px 12px;\n\tcursor: pointer;\n\tposition: relative;\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: flex-start;\n}\n.vtable__menu-element__item:hover {\n\tbackground-color: rgba(27, 31, 35, 0.06);\n}\n.vtable__menu-element__icon{\n\t/* vertical-align: top; */\n\tdisplay: flex;\n\t/* line-height: 30px; */\n\tmargin-right: 6px;\n}\n.vtable__menu-element__no-event {\n\tpointer-events: none;\n}\n.vtable__menu-element--select {\n\tcolor: #2E68CF;\n}.vtable__menu-element--normal {\n\tcolor: rgba(20, 20, 20, 0.9);;\n}\n.vtable__menu-element__split {\n\theight: 0px;\n\tborder: 1px solid rgb(209, 213, 218);\n\tmargin: 5px 0;\n}\n.vtable__menu-element__title {\n\tcolor: rgb(149, 149, 149);\n}\n.vtable__menu-element__arrow {\n\tposition: absolute;\n\tright: 3px;\n\tfont-weight: bold;\n\tmargin-top: 1px;\n}\n.vtable__menu-element__item-text {\n\tmargin-right: 15px;\n}\n",document.head.appendChild(t)}();const rT="vtable__menu-element",sT=`${rT}__item`,lT=`${rT}__content`,aT=`${rT}--hidden`,hT=`${rT}--shown`,dT=`${rT}--normal`,cT=`${rT}--select`,uT=`${rT}__icon`,gT=`${rT}__split`,pT=`${rT}__title`,fT=`${rT}__arrow`,vT=`${rT}__no-event`,mT=`${rT}__item-text`;function bT(){return nT("div",[rT,aT])}function yT(t,e,i,o,n,r){const s=t.getCellRange(o,n);for(let o=0;o<e.length;o++){const n=e[o];let{col:r,row:l}=n;const{field:a,menuKey:h}=n;if("number"!=typeof r||"number"!=typeof l)if(t.isPivotTable()){const e=t.internalProps.layoutMap.getPivotCellAdress(a);if(!e)continue;r=e.col,l=e.row}else{const e=t.internalProps.layoutMap.getHeaderCellAddressByField(a);if(!e)continue;r=e.col,l=e.row}if(Q(r)&&Q(l)&&Ow(s,r,l)&&i===h)return!0}return!1}class CT{constructor(t){var e,i,o,n,r,s,l,a,h,d;this._handler=new Zw,this._rootElement=bT(),this._secondElement=bT(),this._secondElement.sub=!0,this._showChildrenIndex=-1,this._rootElement.addEventListener("wheel",(t=>{t.stopPropagation()})),null===(e=this._rootElement)||void 0===e||e.addEventListener("mousedown",(t=>{t.stopPropagation(),t.preventDefault()})),null===(i=this._rootElement)||void 0===i||i.addEventListener("touchend",(e=>{if(e.stopPropagation(),e.preventDefault(),this._rootElement.classList.contains(aT))return;const{col:i,row:o,dropDownIndex:n,menuKey:r,text:s,hasChildren:l}=e.target;if("number"!=typeof n||l)return void e.stopPropagation();const a=t.isPivotTable()?t.internalProps.layoutMap.getPivotDimensionInfo(i,o):t.getHeaderField(i,o),h=t._dropDownMenuIsHighlight(i,o,n);t.fireListeners(Xw.DROPDOWN_MENU_CLICK,{col:i,row:o,field:a,menuKey:r,text:s,highlight:h,cellLocation:t.getCellLocation(i,o),event:e}),t.fireListeners(Xw.DROPDOWN_MENU_CLEAR,null),t.fireListeners(Xw.HIDE_MENU,null),e.stopPropagation()})),null===(o=this._rootElement)||void 0===o||o.addEventListener("click",(e=>{if(e.stopPropagation(),e.preventDefault(),this._rootElement.classList.contains(aT))return;const{col:i,row:o,dropDownIndex:n,menuKey:r,text:s,hasChildren:l}=e.target;if("number"!=typeof n||l)return void e.stopPropagation();const a=t.isPivotTable()?t.internalProps.layoutMap.getPivotDimensionInfo(i,o):t.getHeaderField(i,o),h=t._dropDownMenuIsHighlight(i,o,n);t.fireListeners(Xw.DROPDOWN_MENU_CLICK,{col:i,row:o,field:a,menuKey:r,text:s,highlight:h,cellLocation:t.getCellLocation(i,o),event:e}),t.fireListeners(Xw.DROPDOWN_MENU_CLEAR,null),t.fireListeners(Xw.HIDE_MENU,null),e.stopPropagation()})),null===(n=this._rootElement)||void 0===n||n.addEventListener("mousemove",(e=>{var i,o;if(this._rootElement.classList.contains(aT))return;e.stopPropagation();const{hasChildren:n,dropDownIndex:r,col:s,row:l,sub:a}=e.target;if(n){this._showChildrenIndex=r;const o=this._secondElement;null==o||o.classList.remove(aT),null==o||o.classList.add(hT),o.innerHTML="";const n=null===(i=this._menuInstanceInfo.content[r])||void 0===i?void 0:i.children;for(let e=0;e<n.length;e++){const i=n[e],r=wT(i,!!t.stateManager.menu.dropDownMenuHighlight&&yT(t,t.stateManager.menu.dropDownMenuHighlight,"object"==typeof i?(null==i?void 0:i.menuKey)||(null==i?void 0:i.text):i,s,l));r.col=s,r.row=l,r.dropDownIndex=e,"string"==typeof i?(r.text=i,r.menuKey=i):"object"==typeof i&&(r.text=i.text,r.menuKey=i.menuKey||i.text),r.sub=!0,r.sub=!0,o.appendChild(r)}const a=e.target.getBoundingClientRect();this._bindSecondElement(t,s,l,a.right,a.top)}else if(n&&this._showChildrenIndex===r){const t=this._secondElement;null==t||t.classList.remove(aT),null==t||t.classList.add(hT)}else!a&&(null===(o=this._secondElement)||void 0===o?void 0:o.classList.contains(hT))&&setTimeout((()=>{if(!0!==this._mouseEnterSecondElement){this._showChildrenIndex=-1;const t=this._secondElement;null==t||t.classList.remove(hT),null==t||t.classList.add(aT)}}),300)})),null===(r=this._secondElement)||void 0===r||r.addEventListener("wheel",(t=>{t.stopPropagation()})),null===(s=this._secondElement)||void 0===s||s.addEventListener("mousemove",(t=>{this._rootElement.classList.contains(aT)||t.stopPropagation()})),null===(l=this._secondElement)||void 0===l||l.addEventListener("mouseenter",(t=>{this._mouseEnterSecondElement=!0})),null===(a=this._secondElement)||void 0===a||a.addEventListener("mouseleave",(t=>{this._mouseEnterSecondElement=!1})),null===(h=this._secondElement)||void 0===h||h.addEventListener("mousedown",(t=>{t.stopPropagation(),t.preventDefault()})),null===(d=this._secondElement)||void 0===d||d.addEventListener("click",(e=>{if(e.stopPropagation(),e.preventDefault(),this._secondElement.classList.contains(aT))return;const{col:i,row:o,dropDownIndex:n,menuKey:r,text:s,hasChildren:l}=e.target;if("number"!=typeof n||l)return void e.stopPropagation();const a=t.isPivotTable()?t.internalProps.layoutMap.getPivotDimensionInfo(i,o):t.getHeaderField(i,o);let h=!1;this._menuInstanceInfo.content.forEach(((e,n)=>{if("object"==typeof e&&e.children&&e.children.length)for(let n=0;n<e.children.length;n++){const s=e.children[n];if(yT(t,t.stateManager.menu.dropDownMenuHighlight,"object"==typeof s?null==s?void 0:s.menuKey:s,i,o)&&r===("object"==typeof s?null==s?void 0:s.menuKey:s))return void(h=!0)}})),t.fireListeners(Xw.DROPDOWN_MENU_CLICK,{col:i,row:o,field:a,cellHeaderPaths:t.isPivotTable()?t.getCellHeaderPaths(i,o):void 0,menuKey:r,text:s,highlight:h,cellLocation:t.getCellLocation(i,o),event:e}),t.fireListeners(Xw.DROPDOWN_MENU_CLEAR,null),t.fireListeners(Xw.HIDE_MENU,null),e.stopPropagation()}))}get rootElement(){return this._rootElement}release(){this.unbindFromCell();const t=this._rootElement;(null==t?void 0:t.parentElement)&&t.parentElement.removeChild(t),this._handler.release(),delete this._rootElement}bindToCell(t,e,i,o){var n,r;const s=this._rootElement,l=this._secondElement;if(this._menuInstanceInfo=o,null==s||s.classList.remove(hT),null==s||s.classList.add(aT),null==l||l.classList.remove(hT),null==l||l.classList.add(aT),this._canBindToCell(t,e,i)){if(s.innerHTML="",Array.isArray(o.content)){const l=o.content;for(let o=0;null!==(n=o<(null==l?void 0:l.length))&&void 0!==n&&n;o++){const n=l[o];let a=!!t.stateManager.menu.dropDownMenuHighlight&&yT(t,t.stateManager.menu.dropDownMenuHighlight,"object"==typeof n?(null==n?void 0:n.menuKey)||(null==n?void 0:n.text):n,e,i);if(t.stateManager.menu.dropDownMenuHighlight&&"object"==typeof n&&Array.isArray(n.children)&&n.children.length)for(let o=0;o<n.children.length;o++){const r=n.children[o];if(yT(t,t.stateManager.menu.dropDownMenuHighlight,"object"==typeof r?(null==r?void 0:r.menuKey)||(null==r?void 0:r.text):r,e,i)){a=!0;break}}const h=wT(n,a);h.col=e,h.row=i,h.dropDownIndex=o,"string"==typeof n?(h.text=n,h.menuKey=n):"object"==typeof n&&(h.text=n.text,h.menuKey=n.menuKey||n.text,(null===(r=n.children)||void 0===r?void 0:r.length)&&(h.hasChildren=!0)),s.appendChild(h)}}if(this._bindToCell(t,e,i,o.position,o.referencePosition))return null==s||s.classList.add(hT),null==s||s.classList.remove(aT),!0}else this.unbindFromCell();return!1}unbindFromCell(){const t=this._rootElement,e=this._secondElement;this._menuInstanceInfo=void 0,(null==t?void 0:t.parentElement)&&(t.classList.remove(hT),t.classList.add(aT)),(null==e?void 0:e.parentElement)&&(e.classList.remove(hT),e.classList.add(aT))}_canBindToCell(t,e,i){const o=t.getCellRangeRelativeRect({col:e,row:i}),n=t.getElement(),{top:r,bottom:s,left:l,right:a}=o;if(t.isFrozenCell(e,i))return!0;if(s<t.getFrozenRowsHeight()||a<t.getFrozenColsWidth()||l>t.tableNoFrameWidth-t.getRightFrozenColsWidth()||r>t.tableNoFrameHeight-t.getBottomFrozenRowsHeight())return!1;const{offsetHeight:h,offsetWidth:d}=n;return!(h<r||d<l)}_bindToCell(t,e,i,o,n){const r=this._rootElement,s=t.getElement(),{width:l,height:a}=t.internalProps.element.getBoundingClientRect();if(r){r.parentElement!==s&&s.appendChild(r),r.style.left="0px";const t=.8*l;r.style.maxWidth=`${t}px`;const e=r.offsetWidth,i=r.offsetHeight;let h,d;return o?(h=o.x,d=o.y):n&&(h=n.rect.right-e,d=n.rect.bottom),d+i>a&&(d=a-i),d<0&&(d/=2),r.style.top=`${d}px`,h<0?h=0:h+e>l&&(h=l-e),r.style.left=`${h}px`,!0}return!1}_bindSecondElement(t,e,i,o,n){const r=this._secondElement,s=this._rootElement,l=t.getElement(),{width:a,left:h,top:d}=t.internalProps.element.getBoundingClientRect(),{x:c,y:u,width:g}=s.getBoundingClientRect();if(r){r.parentElement!==l&&l.appendChild(r),r.style.left="0px";const t=.8*a;r.style.maxWidth=`${t}px`;const e=r.clientWidth,i=n-4-d,s=o-h;r.style.top=`${i}px`;let c=s;return c+e>a?c=c-e-g:c+=4,r.style.left=`${c}px`,!0}return!1}pointInMenuElement(t,e){const i=this._rootElement,{x:o,y:n,width:r,height:s}=i.getBoundingClientRect();if(t>o-5&&t<o+r+5&&e>n-5&&e<n+s+5)return!0;if(this._secondElement){const{x:o,y:n,width:r,height:s}=i.getBoundingClientRect();if(t>o-5&&t<o+r+5&&e>n-5&&e<n+s+5)return!0}return!1}}function wT(t,e){var i,o,n;const r=nT("div",[sT,e?cT:dT]);if("string"==typeof t){const e=nT("span",[lT,vT,mT]);e.innerHTML=t,r.appendChild(e)}else if("object"==typeof t){const s=null!==(i=t.type)&&void 0!==i?i:"item";if("split"===s)return null==r||r.classList.add(gT),r;if(null===(o=null==t?void 0:t.icon)||void 0===o?void 0:o.svg)if(hx.test(t.icon.svg)){const e=new Image;t.icon.width?e.style.width=t.icon.width.toString()+"px":e.style.width="16px",t.icon.height?e.style.height=t.icon.height.toString()+"px":e.style.height="16px",e.src=t.icon.svg,r.appendChild(e)}else{const i=nT("span",[uT,vT]);i.innerHTML=e&&t.selectedIcon&&t.selectedIcon.svg?t.selectedIcon.svg:t.icon.svg,t.icon.width&&i.children[0].setAttribute("width",t.icon.width.toString()),t.icon.height&&i.children[0].setAttribute("height",t.icon.height.toString()),r.appendChild(i)}const l=nT("span",[lT,vT,mT]);if(l.innerHTML=t.text,r.appendChild(l),"title"===s)null==r||r.classList.add(vT,pT);else if(null===(n=null==t?void 0:t.children)||void 0===n?void 0:n.length){const t=nT("span",[lT,vT,fT]);t.innerHTML=e?'<svg width="8" height="12" viewBox="0 0 10 17" fill="none" xmlns="http://www.w3.org/2000/svg" style="vertical-align: baseline"><path d="M1.78186 16.7729L0.300378 15.2915L6.8189 8.77295L0.300377 2.25443L1.78186 0.77295L9.78186 8.77295L1.78186 16.7729Z" fill="#2E68CF" fill-opacity="0.65"></path></svg>':'<svg width="8" height="12" viewBox="0 0 10 17" fill="none" xmlns="http://www.w3.org/2000/svg" style="vertical-align: baseline"><path d="M1.78186 16.7729L0.300378 15.2915L6.8189 8.77295L0.300377 2.25443L1.78186 0.77295L9.78186 8.77295L1.78186 16.7729Z" fill="#141414" fill-opacity="0.65"></path></svg>',r.appendChild(t)}}return r}let xT;const _T={CHANGE_STYLE:"change_style"};class ST extends YC{static get EVENT_TYPE(){return _T}static get DEFAULT(){return xT||(xT=new ST)}constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};var i,o,n,r,s,l,a,h,d,c,u,g,p,f,v,m,b,y,C,w,x,_,S,A,B,R,M,T,k,L,P,E;super(),this._defaultPadding=[10,16,10,16],this._color=null!==(i=t.color)&&void 0!==i?i:null==e?void 0:e.color,this._strokeColor=null!==(o=null==t?void 0:t.strokeColor)&&void 0!==o?o:null==e?void 0:e.strokeColor,this._fontSize=null!==(n=t.fontSize)&&void 0!==n?n:null==e?void 0:e.fontSize,this._fontFamily=null!==(r=t.fontFamily)&&void 0!==r?r:null==e?void 0:e.fontFamily,this._fontWeight=null!==(s=t.fontWeight)&&void 0!==s?s:null==e?void 0:e.fontWeight,this._fontVariant=null!==(l=t.fontVariant)&&void 0!==l?l:null==e?void 0:e.fontVariant,this._fontStyle=null!==(a=t.fontStyle)&&void 0!==a?a:null==e?void 0:e.fontStyle,this._textOverflow=(null!==(h=t.textOverflow)&&void 0!==h?h:null==e?void 0:e.textOverflow)||"ellipsis",this._textStick=null!==(c=null!==(d=t.textStick)&&void 0!==d?d:null==e?void 0:e.textStick)&&void 0!==c&&c,this._textStickBaseOnAlign=null!==(g=null!==(u=t.textStickBaseOnAlign)&&void 0!==u?u:null==e?void 0:e.textStickBaseOnAlign)&&void 0!==g&&g,this._marked=null!==(f=null!==(p=t.marked)&&void 0!==p?p:null==e?void 0:e.marked)&&void 0!==f&&f,this._textAlign=(null!==(v=t.textAlign)&&void 0!==v?v:null==e?void 0:e.textAlign)||"left",this._textBaseline=(null!==(m=t.textBaseline)&&void 0!==m?m:null==e?void 0:e.textBaseline)||"middle",this._bgColor=null!==(b=t.bgColor)&&void 0!==b?b:null==e?void 0:e.bgColor,this._padding=null!==(C=null!==(y=t.padding)&&void 0!==y?y:null==e?void 0:e.padding)&&void 0!==C?C:this._defaultPadding,this._borderColor=null!==(w=t.borderColor)&&void 0!==w?w:null==e?void 0:e.borderColor,this._lineHeight=null!==(x=t.lineHeight)&&void 0!==x?x:null==e?void 0:e.lineHeight,this._underline=null!==(_=t.underline)&&void 0!==_?_:null==e?void 0:e.underline,this._underlineColor=null!==(S=t.underlineColor)&&void 0!==S?S:null==e?void 0:e.underlineColor,this._underlineDash=null!==(A=t.underlineDash)&&void 0!==A?A:null==e?void 0:e.underlineDash,this._underlineOffset=null!==(B=t.underlineOffset)&&void 0!==B?B:null==e?void 0:e.underlineOffset,this._lineThrough=null!==(R=t.lineThrough)&&void 0!==R?R:null==e?void 0:e.lineThrough,this._lineThroughColor=null!==(M=t.lineThroughColor)&&void 0!==M?M:null==e?void 0:e.lineThroughColor,this._lineThroughDash=null!==(T=t.lineThroughDash)&&void 0!==T?T:null==e?void 0:e.lineThroughDash,this._linkColor=null!==(k=t.linkColor)&&void 0!==k?k:null==e?void 0:e.linkColor,this._cursor=null!==(L=t.cursor)&&void 0!==L?L:null==e?void 0:e.cursor,this._borderLineWidth=null!==(P=t.borderLineWidth)&&void 0!==P?P:null==e?void 0:e.borderLineWidth,this._borderLineDash=null!==(E=t.borderLineDash)&&void 0!==E?E:null==e?void 0:e.borderLineDash}get bgColor(){return this._bgColor}set bgColor(t){this._bgColor=t}get color(){return this._color}set color(t){this._color=t}get strokeColor(){return this._strokeColor}set strokeColor(t){this._strokeColor=t}get fontSize(){return this._fontSize}set fontSize(t){this._fontSize=t}get fontFamily(){return this._fontFamily}set fontFamily(t){this._fontFamily=t}get fontWeight(){return this._fontWeight}set fontWeight(t){this._fontWeight=t}get fontVariant(){return this._fontVariant}set fontVariant(t){this._fontVariant=t}get fontStyle(){return this._fontStyle}set fontStyle(t){this._fontStyle=t}get textOverflow(){return this._textOverflow}set textOverflow(t){this._textOverflow=t}get padding(){var t;return null!==(t=this._padding)&&void 0!==t?t:this._defaultPadding}set padding(t){this._padding=t}get borderColor(){return this._borderColor}set borderColor(t){this._borderColor=t}get textStick(){return this._textStick}set textStick(t){this._textStick=t}get textStickBaseOnAlign(){return this._textStickBaseOnAlign}set textStickBaseOnAlign(t){this._textStickBaseOnAlign=t}get marked(){return this._marked}set marked(t){this._marked=t}get textAlign(){return this._textAlign}set textAlign(t){this._textAlign=t}get textBaseline(){return this._textBaseline}set textBaseline(t){this._textBaseline=t}get lineHeight(){return this._lineHeight}set lineHeight(t){this._lineHeight=t}get underline(){return this._underline}set underline(t){this._underline=t}get underlineColor(){return this._underlineColor}set underlineColor(t){this._underlineColor=t}get underlineDash(){return this._underlineDash}set underlineDash(t){this._underlineDash=t}get underlineOffset(){return this._underlineOffset}set underlineOffset(t){this._underlineOffset=t}get lineThrough(){return this._lineThrough}set lineThrough(t){this._lineThrough=t}get lineThroughColor(){return this._lineThroughColor}set lineThroughColor(t){this._lineThroughColor=t}get lineThroughDash(){return this._lineThroughDash}set lineThroughDash(t){this._lineThroughDash=t}get linkColor(){return this._linkColor}set linkColor(t){this._linkColor=t}get cursor(){return this._cursor}set cursor(t){this._cursor=t}get borderLineWidth(){return this._borderLineWidth}set borderLineWidth(t){this._borderLineWidth=t}get borderLineDash(){return this._borderLineDash}set borderLineDash(t){this._borderLineDash=t}clone(){return new ST(this)}}let AT,BT,RT;class MT extends ST{static get DEFAULT(){return AT||(AT=new MT)}constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};var i;super(t,e),this.textAlign=(null!==(i=t.textAlign)&&void 0!==i?i:null==e?void 0:e.textAlign)||"center"}clone(){return new MT(this)}}class TT extends ST{static get DEFAULT(){return BT||(BT=new TT)}constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;var i,o;super(t,e),this._autoWrapText=null!==(i=null==t?void 0:t.autoWrapText)&&void 0!==i?i:null==e?void 0:e.autoWrapText,this._lineClamp=null!==(o=null==t?void 0:t.lineClamp)&&void 0!==o?o:null==e?void 0:e.lineClamp}clone(){return new TT(this,null)}get lineClamp(){return this._lineClamp}set lineClamp(t){this._lineClamp=t}get autoWrapText(){return this._autoWrapText}set autoWrapText(t){this._autoWrapText=t}}class kT extends ST{static get DEFAULT(){return RT||(RT=new kT)}constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};var o,n,r,s,l,a,h,d,c,u,g,p,f,v,m,b,y,C,w,x,_,S;super(t,e),this._size=(null!==(n=null!==(o=null==t?void 0:t.size)&&void 0!==o?o:null==e?void 0:e.size)&&void 0!==n?n:null==i?void 0:i.size)||14,this._spaceBetweenTextAndIcon=(null!==(s=null!==(r=null==t?void 0:t.spaceBetweenTextAndIcon)&&void 0!==r?r:null==e?void 0:e.spaceBetweenTextAndIcon)&&void 0!==s?s:null==i?void 0:i.spaceBetweenTextAndIcon)||8,this._defaultFill=null!==(a=null===(l=null==t?void 0:t.checkboxStyle)||void 0===l?void 0:l.defaultFill)&&void 0!==a?a:null==i?void 0:i.defaultFill,this._defaultStroke=null!==(d=null===(h=null==t?void 0:t.checkboxStyle)||void 0===h?void 0:h.defaultStroke)&&void 0!==d?d:null==i?void 0:i.defaultStroke,this._disableFill=null!==(u=null===(c=null==t?void 0:t.checkboxStyle)||void 0===c?void 0:c.disableFill)&&void 0!==u?u:null==i?void 0:i.disableFill,this._checkedFill=null!==(p=null===(g=null==t?void 0:t.checkboxStyle)||void 0===g?void 0:g.checkedFill)&&void 0!==p?p:null==i?void 0:i.checkedFill,this._checkedStroke=null!==(v=null===(f=null==t?void 0:t.checkboxStyle)||void 0===f?void 0:f.checkedStroke)&&void 0!==v?v:null==i?void 0:i.checkedStroke,this._disableCheckedFill=null!==(b=null===(m=null==t?void 0:t.checkboxStyle)||void 0===m?void 0:m.disableCheckedFill)&&void 0!==b?b:null==i?void 0:i.disableCheckedFill,this._disableCheckedStroke=null!==(C=null===(y=null==t?void 0:t.checkboxStyle)||void 0===y?void 0:y.disableCheckedStroke)&&void 0!==C?C:null==i?void 0:i.disableCheckedStroke,this._checkIconImage=null!==(x=null===(w=null==t?void 0:t.checkboxStyle)||void 0===w?void 0:w.checkIconImage)&&void 0!==x?x:null==i?void 0:i.checkIconImage,this._indeterminateIconImage=null!==(S=null===(_=null==t?void 0:t.checkboxStyle)||void 0===_?void 0:_.indeterminateIconImage)&&void 0!==S?S:null==i?void 0:i.indeterminateIconImage}get size(){return this._size}set size(t){this._size=t}get spaceBetweenTextAndIcon(){return this._spaceBetweenTextAndIcon}set spaceBetweenTextAndIcon(t){this._spaceBetweenTextAndIcon=t}get defaultFill(){return this._defaultFill}set defaultFill(t){this._defaultFill=t}get defaultStroke(){return this._defaultStroke}set defaultStroke(t){this._defaultStroke=t}get disableFill(){return this._disableFill}set disableFill(t){this._disableFill=t}get checkedFill(){return this._checkedFill}set checkedFill(t){this._checkedFill=t}get checkedStroke(){return this._checkedStroke}set checkedStroke(t){this._checkedStroke=t}get disableCheckedFill(){return this._disableCheckedFill}set disableCheckedFill(t){this._disableCheckedFill=t}get disableCheckedStroke(){return this._disableCheckedStroke}set disableCheckedStroke(t){this._disableCheckedStroke=t}get checkIconImage(){return this._checkIconImage}set checkIconImage(t){this._checkIconImage=t}get indeterminateIconImage(){return this._indeterminateIconImage}set indeterminateIconImage(t){this._indeterminateIconImage=t}getStyle(t){return new kT(t,this)}clone(){return new kT(this)}}function LT(t,e,i,o,n,r){var s;return t||e?t instanceof ST?t:"function"==typeof t?LT(t(i),e,i,o,n,r):(t||(t={}),n&&!Q(t.autoWrapText)&&(t.autoWrapText=!0),o===kT?new kT(null!=t?t:{},null!=e?e:{},null!==(s=r.checkboxStyle)&&void 0!==s?s:{}):new o(null!=t?t:{},null!=e?e:{})):o.DEFAULT}class PT{constructor(t){this._table=t;const e=FS();this.freezeIcon=e[UC.freezeIconName],this.frozenIcon=e[UC.frozenIconName],this.frozenCurrentIcon=e[UC.frozenCurrentIconName],this.normalIcon=e[UC.normalIconName],this.upIcon=e[UC.upwardIconName],this.downIcon=e[UC.downwardIconName],this.dropDownAbsoluteIcon=e[UC.dropdownIconName],this.expandIcon=e[UC.expandIconName],this.collapseIcon=e[UC.collapseIconName]}getIcons(t,e){const i=[];if(this._table.isPivotTable()){const{showSort:o,sort:n}=this._table.internalProps.layoutMap.getHeader(t,e);if(o){let o=this._table.getPivotSortState(t,e);o&&(o=o.toUpperCase());const n="ASC"===o?this.upIcon:"DESC"===o?this.downIcon:this.normalIcon;n&&i.push(n)}else if(n){const o=this.getSortIconForPivotTable(this._table.getPivotSortState(t,e),this._table,t,e);o&&i.push(o)}}else{const o=this._table.sortState;let n;n=void 0;const r=this._table.getCellRange(t,e);if(o)if(Array.isArray(o))for(let t=0;t<o.length;t++){const e=o[t],i=this._table._getHeaderCellBySortState(e);if(i&&Ow(r,i.col,i.row)){({order:n}=e);break}}else{const t=this._table._getHeaderCellBySortState(o);t&&Ow(r,t.col,t.row)&&({order:n}=o)}const s=this.getSortIcon(n,this._table,t,e);s&&i.push(s)}if(this._table.showFrozenIcon&&t<this._table.allowFrozenColCount){const o=this.getFrozenIcon(t,e);o&&i.push(o)}if(this.checkDropDownIcon(this._table,t,e)){const t=this.dropDownAbsoluteIcon;i.push(t)}const o=this.getDropDownStateIcons(this._table,t,e);o.length&&i.push(...o);const{headerIcon:n}=this._table._getHeaderLayoutMap(t,e),r=this.getHierarchyIcon(t,e);if(r&&i.push(r),n){let o;o="function"==typeof n?n({col:t,row:e,value:this._table.getCellValue(t,e),dataValue:this._table.getCellOriginValue(t,e),table:this._table}):n;const r=FS(),s=t=>{let e;e="string"==typeof t?r[t]:t,e&&i.push(e)};Array.isArray(o)?o.forEach(((t,e)=>{s(t)})):s(o)}return i}getFrozenIcon(t,e){if(this._table.isPivotTable()||this._table.transpose)return null;if(this._table.rightFrozenColCount&&t>=this._table.colCount-this._table.rightFrozenColCount)return null;const i=this._table.getHeaderDefine(t,e);if(i.columns&&i.columns.length>0)return null;let o=this.freezeIcon;return this._table.options.frozenColCount-1>t?o=this.frozenIcon:this._table.options.frozenColCount-1===t&&(o=this.frozenCurrentIcon),o}getSortIcon(t,e,i,o){const n="asc"===t?this.upIcon:"desc"===t?this.downIcon:this.normalIcon,r=e.getHeaderDefine(i,o);return!r||!1===r.showSort||!Q(r.showSort)&&!r.sort||r.columns&&r.columns.length>0?null:n}getSortIconForPivotTable(t,e,i,o){const n=e.getHeaderDefine(i,o);return!n||!1===n.showSort||!Q(n.showSort)&&!n.sort||n.columns&&n.columns.length>0?null:"ASC"===(null==t?void 0:t.toUpperCase())?this.upIcon:"DESC"===(null==t?void 0:t.toUpperCase())?this.downIcon:this.normalIcon}getDropDownStateIcons(t,e,i){var o,n,r;const s=t.getHeaderDefine(e,i),l=t._getHeaderLayoutMap(e,i),{dropDownMenu:a}=l,h=[];if(Array.isArray(a)&&a.length||Array.isArray(t.globalDropDownMenu)&&t.globalDropDownMenu.length&&!(null===(o=null==s?void 0:s.columns)||void 0===o?void 0:o.length)){const o=a||t.globalDropDownMenu;let s=-1,l=-1;for(let a=0;a<o.length;a++){const h=o[a];if("object"==typeof h&&h.children&&h.children.length)for(let o=0;o<h.children.length;o++){const d=h.children[o];if((null===(n=t.stateManager.menu)||void 0===n?void 0:n.dropDownMenuHighlight)&&yT(t,null===(r=t.stateManager.menu)||void 0===r?void 0:r.dropDownMenuHighlight,"object"==typeof d?null==d?void 0:d.menuKey:d,e,i)){s=a,l=o;break}}if(t._dropDownMenuIsHighlight(e,i,a)){s=a;break}}if(-1!==s){let e;e=-1!==l?(a||t.globalDropDownMenu)[s].children[l]:(a||t.globalDropDownMenu)[s],e.stateIcon&&(e.stateIcon.svg?h.push({type:"svg",name:e.stateIcon.src||e.stateIcon.svg,width:e.stateIcon.width||22,height:e.stateIcon.height||22,svg:e.stateIcon.svg,positionType:jC.right,marginRight:0,funcType:VC.dropDownState,interactive:!1}):e.stateIcon.src&&h.push({type:"image",name:e.stateIcon.src||e.stateIcon.svg,width:e.stateIcon.width||22,height:e.stateIcon.height||22,src:e.stateIcon.src,positionType:jC.right,marginRight:0,funcType:VC.dropDownState,interactive:!1}))}}return h}getDropDownIconRect(t,e,i){var o,n,r,s,l,a,h,d;const c=null!==(s=null!==(n=null===(o=this.downIcon.hover)||void 0===o?void 0:o.width)&&void 0!==n?n:null===(r=this.downIcon)||void 0===r?void 0:r.width)&&void 0!==s?s:0,u=null!==(d=null!==(a=null===(l=this.downIcon.hover)||void 0===l?void 0:l.height)&&void 0!==a?a:null===(h=this.downIcon)||void 0===h?void 0:h.height)&&void 0!==d?d:0,g=t.right-2-c,p=t.right-2;let f;return f="middle"===i?t.top+t.height/2-c/2:"top"===i?t.top+e/2:"bottom"===i?t.bottom-2*e:t.top,{left:g,right:p,top:f,bottom:u+f,width:c,height:u}}getHierarchyIcon(t,e){const{hierarchyState:i}=this._table._getHeaderLayoutMap(t,e);if(i){if(i===WC.expand)return this.expandIcon;if(i===WC.collapse)return this.collapseIcon}}getHierarchyIconWidth(){var t,e;return this.expandIcon.width+(null!==(t=this.expandIcon.marginLeft)&&void 0!==t?t:0)+(null!==(e=this.expandIcon.marginRight)&&void 0!==e?e:0)}checkDropDownIcon(t,e,i){var o;if(t.isPivotTable()){const o=t._getHeaderLayoutMap(e,i);if(Array.isArray(o.dropDownMenu)&&o.dropDownMenu.length)return!0}else{const n=t.getHeaderDefine(e,i);if(Array.isArray(n.dropDownMenu)&&n.dropDownMenu.length||(!Array.isArray(n.dropDownMenu)||0!==n.dropDownMenu.length)&&Array.isArray(t.globalDropDownMenu)&&t.globalDropDownMenu.length&&!(null===(o=null==n?void 0:n.columns)||void 0===o?void 0:o.length))return!0}return!1}getStyleClass(t){switch(t){case"text":case"link":return TT;case"image":case"video":return MT;case"checkbox":return kT}}setTableColumnsEditor(){const t=(e,i)=>{null==e||e.forEach(((e,o)=>{e.editor&&(i[o].editor=e.editor),e.columns&&t(e.columns,i[o].columns)}))};t(this._table.options.columns,this._table.internalProps.columns)}}class ET extends EventTarget{constructor(t,e){if(super(),this._table=t,"node"===sw.mode)return;const i=document.createElement("div");i.style.opacity="0",i.dataset.vtable="vtable",i.style.pointerEvents="none",i.classList.add("input-container");const o=this._input=document.createElement("input");i.appendChild(o),o.classList.add("table-focus-control"),o.dataset.vtable="vtable",o.readOnly=!0,e.appendChild(i),this._container=i}focus(){this._input.focus({preventScroll:!0})}setFocusRect(t,e){const i=this._input;i.value=e,i.select();const o=t.top-this._table.scrollTop,n=t.left-this._table.scrollLeft;i.style.top=`${o.toFixed()}px`,i.style.left=`${n.toFixed()}px`,i.style.width=`${t.width.toFixed()}px`,i.style.height=`${t.height.toFixed()}px`}get input(){return this._input}release(){var t;null===(t=this._container.parentElement)||void 0===t||t.removeChild(this._container)}}class HT{constructor(t){this.isUpdate=!1,this._keys=[],this._sorted=!1,this.data=new Map,this._keys.length=0,this.cumulativeSum=new Map,this.difference=new Map,this.totalSum=0,this.table=t}get length(){return this.data.size}clear(){this._keys=[],this.data.clear(),this.cumulativeSum.clear(),this.difference.clear(),this.totalSum=0}clearRange(){this.cumulativeSum.clear(),this.difference.clear()}add(t,e){if(!Q(e))return;const i=this.table.getRowHeight(t);this.data.has(t)||(this._keys.push(t),this._sorted=!1),this.data.set(t,e),this.totalSum+=e,this.updateDifference(t,e-i)}remove(t){if(this.data.has(t)){const e=this.data.get(t);this.data.delete(t);const i=this._keys.indexOf(t);-1!==i&&this._keys.splice(i,1),this.totalSum-=e;const o=this.table.getRowHeight(t);this.updateDifference(t,o-e)}}put(t,e){if(Q(e))if(this.data.has(t)){const i=this.data.get(t);if(i===e)return;this.data.set(t,e);const o=e-i;this.totalSum+=o,this.updateDifference(t,o)}else this.add(t,e)}get(t){return this.data.get(t)}has(t){return this.data.has(t)}_sort(){const{_keys:t}=this;this._sorted||(t.sort(((t,e)=>t<e?-1:t>e?1:0)),this._sorted=!0)}updateDifference(t,e){var i;const o=null!==(i=this.difference.get(t))&&void 0!==i?i:0;this.difference.set(t,o+e),this.update()}getSumInRange(t,e){return this.calculatePrefixSum(e)-this.calculatePrefixSum(t-1)}updateCumulativeSum(t,e){for(const[i,o]of this.cumulativeSum)i>=t&&this.cumulativeSum.set(i,o+e)}calculatePrefixSum(t){if(t<0)return 0;if(this.cumulativeSum.has(t)){let e=this.cumulativeSum.get(t);for(const[i,o]of this.difference)i<=t&&(e+=o);return e}return this.dealDiffenence(),this.getCumulativeSum(t)}getCumulativeSum(t){var e;let i=0;for(let o=t;o>=0;o--){if(this.cumulativeSum.has(o)){i+=this.cumulativeSum.get(o);break}i+=null!==(e=this.data.get(o))&&void 0!==e?e:this.table.getRowHeight(o)}return this.cumulativeSum.set(t,i),i}update(){this.isUpdate||(this.isUpdate=!0,setTimeout((()=>{this.dealDiffenence(),this.isUpdate=!1}),0))}dealDiffenence(){for(const[t]of this.cumulativeSum)for(const[e,i]of this.difference)if(t>=e){const e=this.cumulativeSum.get(t);this.cumulativeSum.set(t,e+i)}this.difference.clear()}insert(t,e){for(let e=t;e<=this.getLastIndex();e++)this.cumulativeSum.delete(e);const i=this.getLastIndex()+1;this.adjustOrder(t,t+1,i-t),Q(e)&&this.put(t,e)}getLastIndex(){return this._sort(),this._keys[this._keys.length-1]}delLast(){const t=this.getLastIndex();this.remove(t)}delete(t){if(!this.has(t))return;for(let e=t;e<=this.getLastIndex();e++)this.cumulativeSum.delete(e);const e=this.getLastIndex();this.adjustOrder(t+1,t,e-t),this.delLast()}adjustOrder(t,e,i){this.clearRange(),this._sort();const{_keys:o}=this;if(t>e){const n=[];for(let r=FT(o,t+i-1);r>=0;r--){const s=o[r];if(s>=t)n.push(this.get(s));else if(e<=s&&s<t)this.put(s+i,this.get(s));else if(s<e)break}for(let t=0;t<i;t++)this.put(e+t,n[i-1-t])}const{length:n}=o;if(t<e){const r=[];for(let s=FT(o,t);s<n;s++){const n=o[s];if(n>=t&&n<t+i)r.push(this.get(n));else if(t+i<=n&&n<=e)this.put(n-i,this.get(n));else if(n>e)break}for(let t=0;t<i;t++)this.put(e+t,r[t])}}exchangeOrder(t,e,i,o,n){const{_keys:r}=this;if(this._sorted||(r.sort(((t,e)=>t<e?-1:t>e?1:0)),this._sorted=!0),t>i){const o=[],s=[];for(let n=FT(r,i);n<t+e;n++){const i=r[n];i>=t&&i<t+e?s.push(this.get(i)):o.push(this.get(i))}for(let t=0;t<e;t++)this.put(n+t,s[t]);for(let t=0;t<o.length;t++)this.put(n+e+t,o[t])}else{const s=[],l=[];for(let n=FT(r,t);n<i+o;n++){const i=r[n];i>=t&&i<t+e?l.push(this.get(i)):s.push(this.get(i))}for(let t=0;t<e;t++)this.put(n+t,l[t]);for(let e=0;e<s.length;e++)this.put(t+e,s[e])}}}function FT(t,e){let i=0,o=t.length-1;for(;i<=o;){const n=Math.floor((i+o)/2);if(t[n]===e)return n;t[n]>e?o=n-1:i=n+1}return o<0?0:o}class zT{constructor(t){this._table=t;const e=FS();this.dragReorderIconName=e[UC.dragReorderIconName]}getIcons(t,e){return[this.dragReorderIconName]}}class IT{constructor(t,e,i){this.table=t,this.customCellStyle=e,this.customCellStyleArrangement=i}getCustomCellStyle(t,e){const i=this.getCustomCellStyleId(t,e);if(i){const t=this.getCustomCellStyleOption(i);return null==t?void 0:t.style}}getCustomCellStyleId(t,e){let i;const o=this.table.getCellRange(t,e);for(let t=o.start.col;t<=o.end.col;t++)for(let e=o.start.row;e<=o.end.row;e++)this.customCellStyleArrangement.forEach((o=>{o.cellPosition.range?o.cellPosition.range.start.col<=t&&o.cellPosition.range.end.col>=t&&o.cellPosition.range.start.row<=e&&o.cellPosition.range.end.row>=e&&(i=o.customStyleId):o.cellPosition.col===t&&o.cellPosition.row===e&&(i=o.customStyleId)}));return i}getCustomCellStyleOption(t){return this.customCellStyle.find((e=>e.id===t))}registerCustomCellStyle(t,e){const i=this.customCellStyle.findIndex((e=>e.id===t));-1===i?this.customCellStyle.push({id:t,style:e}):this.customCellStyle[i]={id:t,style:e},this.customCellStyleArrangement.forEach((e=>{const i=e.cellPosition;if(e.customStyleId===t)if(i.range)for(let t=i.range.start.col;t<=i.range.end.col;t++)for(let e=i.range.start.row;e<=i.range.end.row;e++)this.table.scenegraph.updateCellContent(t,e);else this.table.scenegraph.updateCellContent(i.col,i.row)})),this.table.scenegraph.updateNextFrame()}arrangeCustomCellStyle(t,e){const i=this.customCellStyleArrangement.findIndex((e=>e.cellPosition.range&&t.range?e.cellPosition.range.start.col===t.range.start.col&&e.cellPosition.range.start.row===t.range.start.row&&e.cellPosition.range.end.col===t.range.end.col&&e.cellPosition.range.end.row===t.range.end.row:e.cellPosition.col===t.col&&e.cellPosition.row===t.row));if(-1!==i||e){if(-1===i&&e)this.customCellStyleArrangement.push({cellPosition:{col:t.col,row:t.row,range:t.range},customStyleId:e});else{if(this.customCellStyleArrangement[i].customStyleId===e)return;e?this.customCellStyleArrangement[i].customStyleId=e:this.customCellStyleArrangement.splice(i,1)}if(t.range)for(let e=t.range.start.col;e<=t.range.end.col;e++)for(let i=t.range.start.row;i<=t.range.end.row;i++){const t=this.table.getCellRange(e,i);for(let e=t.start.col;e<=t.end.col;e++)for(let i=t.start.row;i<=t.end.row;i++)this.table.scenegraph.updateCellContent(e,i)}else this.table.scenegraph.updateCellContent(t.col,t.row);this.table.scenegraph.updateNextFrame()}}updateCustomCell(t,e){this.customCellStyle.length=0,this.customCellStyleArrangement.length=0,t.forEach((t=>{this.registerCustomCellStyle(t.id,t.style)})),e.forEach((t=>{this.arrangeCustomCellStyle(t.cellPosition,t.customStyleId)}))}hasCustomCellStyle(t){return this.customCellStyle.some((e=>e.id===t))}}function OT(t,e){t=t.clone();for(const i in e){const o=e[i];o&&(t[`_${i}`]=o)}return t}class DT{constructor(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"grid",o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:void 0;this.sizeIncludeParent=!1,this.tree={id:0,dimensionKey:"",value:"",children:[],level:-1,levelSpan:1,startIndex:0,size:0,startInTotal:0,hierarchyState:void 0},this.totalLevel=0,this.dimensionKeys=new Qw,this.dimensionKeysIncludeVirtual=new Qw,this.cache=new Map,this.sizeIncludeParent=null!=o,this.rowExpandLevel=o,this.hierarchyType=i,this.sharedVar=e,this.reset(t)}reset(t){this.cache.clear(),this.dimensionKeys=new Qw,this.dimensionKeysIncludeVirtual=new Qw,this.tree.children=t,this.setTreeNode(this.tree,0,this.tree)}setTreeNode(t,e,i){var o,n;t.startIndex=e,t.startInTotal=(null!==(o=i.startInTotal)&&void 0!==o?o:0)+t.startIndex,(null!==(n=t.dimensionKey)&&void 0!==n?n:t.indicatorKey)&&(t.virtual||this.dimensionKeys.contain(t.indicatorKey?dx:t.dimensionKey)||this.dimensionKeys.put(t.level,t.indicatorKey?dx:t.dimensionKey),this.dimensionKeysIncludeVirtual.contain(t.indicatorKey?dx:t.dimensionKey)||this.dimensionKeysIncludeVirtual.put(t.level,t.indicatorKey?dx:t.dimensionKey),t.id||(t.id=++this.sharedVar.seqId));let r=t.dimensionKey&&this.sizeIncludeParent?1:0;const s=t.children||t.columns;return"grid"===this.hierarchyType?(null==s?void 0:s.length)>=1?s.forEach((e=>{var i;e.level=(null!==(i=t.level)&&void 0!==i?i:0)+1,this.totalLevel=Math.max(this.totalLevel,e.level+1),r+=this.setTreeNode(e,r,t)})):r=1:t.hierarchyState===WC.expand&&(null==s?void 0:s.length)>=1?s.forEach((e=>{var i;e.level=(null!==(i=t.level)&&void 0!==i?i:0)+1,this.totalLevel=Math.max(this.totalLevel,e.level+1),r+=this.setTreeNode(e,r,t)})):t.hierarchyState===WC.collapse&&(null==s?void 0:s.length)>=1?s.forEach((e=>{var i;e.level=(null!==(i=t.level)&&void 0!==i?i:0)+1,this.totalLevel=Math.max(this.totalLevel,e.level+1),this.setTreeNode(e,r,t)})):!t.hierarchyState&&t.level+1<this.rowExpandLevel&&((null==s?void 0:s.length)>=1||!0===s)?(t.hierarchyState=WC.expand,(null==s?void 0:s.length)>=1&&s.forEach((e=>{var i;e.level=(null!==(i=t.level)&&void 0!==i?i:0)+1,this.totalLevel=Math.max(this.totalLevel,e.level+1),r+=this.setTreeNode(e,r,t)}))):(null==s?void 0:s.length)>=1||!0===s?(t.hierarchyState=WC.collapse,(null==s?void 0:s.length)>=1&&s.forEach((e=>{var i;e.level=(null!==(i=t.level)&&void 0!==i?i:0)+1,this.totalLevel=Math.max(this.totalLevel,e.level+1),this.setTreeNode(e,r,t)}))):(t.hierarchyState=WC.none,r=1),t.size=r,r}getTreePath(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:30;const i=[];return this.searchPath(t,this.tree,i,e),i.shift(),i}getTreePathByCellIds(t){const e=[];let i=this.tree.children;for(let o=0;o<t.length;o++){const n=t[o],r=this.findNodeById(i,n);if(!r)break;e.push(r),i=r.children}return e}findNodeById(t,e){return t.find((t=>t.id===e))}searchPath(t,e,i,o){if(!e)return;if(t<e.startIndex||t>=e.startIndex+e.size)return;if(i.push(e),!e.children||0===e.children.length||e.level>=o)return;const n=t-e.startIndex;if(this.cache.has(e.level+1)){const t=this.cache.get(e.level+1);if(n>=t.startIndex&&n<t.startIndex+t.size)return void this.searchPath(n,t,i,o)}let r=0,s=e.children.length-1;for(;r<=s;){const t=Math.floor((r+s)/2),l=e.children[t];if(n>=l.startIndex&&n<l.startIndex+l.size){this.cache.set(l.level,l);const t=[];this.cache.forEach(((e,i)=>{i>l.level&&t.push(i)})),t.forEach((t=>{this.cache.delete(t)})),this.searchPath(n,l,i,o);break}n<l.startIndex?s=t-1:r=t+1}}movePosition(t,e,i){let o,n,r;const s=(l,a)=>{if(void 0!==n&&void 0!==r)return;l.level===t&&(l.startInTotal===e&&(n=a),l.startInTotal<=i&&i<=l.startInTotal+l.size-1&&(r=a));const h=l.children||l.columns;if(h&&l.level<t){o=l;for(let t=0;t<h.length;t++)(e>=h[t].startInTotal&&e<=h[t].startInTotal+h[t].size||i>=h[t].startInTotal&&i<=h[t].startInTotal+h[t].size)&&s(h[t],t)}};s(this.tree,0);const l=o.children||o.columns,a=l.splice(n,1);a.unshift(r,0),Array.prototype.splice.apply(l,a)}getCopiedTree(){const t=Ct(this.tree.children);return WT(t),t}}function WT(t){for(let e=0;e<t.length;e++){const i=t[e];delete i.level,delete i.startIndex,delete i.id,delete i.levelSpan,delete i.size,delete i.startInTotal;const o=i.children||i.columns;o&&WT(o)}}function NT(t,e){const i=function(t,e){if(!t.internalProps.frozenRowCount)return null;let{scrollTop:i}=t;const o=t.internalProps.frozenRowCount;for(let n=0;n<o;n++){const o=t.getRowHeight(n),r=i+o;if(r>e)return{top:i,row:n,bottom:r,height:o};i=r}return null}(e,t);if(i)return i;let o=VT(t,e);return o||(o={top:-1,row:-1,bottom:-1,height:-1}),o}function GT(t,e){const i=function(t,e){if(!t.internalProps.frozenColCount)return null;let{scrollLeft:i}=t;const o=t.internalProps.frozenColCount;for(let n=0;n<o;n++){const o=t.getColWidth(n),r=i+o;if(r>e)return{left:i,col:n,right:r,width:o};i=r}return null}(e,t);if(i)return i;let o=jT(t,e);return o||(o={left:-1,col:-1,right:-1,width:1}),o}function jT(t,e){if(0===t)return{left:0,col:0,right:0,width:0};const i=function(t,e){if(e._colRangeWidthsMap.get("$0$"+(e.colCount-1))){let i=0,o=e.colCount-1;for(;o-i>1;){const n=Math.floor((i+o)/2);if(t<e._colRangeWidthsMap.get(`$0$${n}`))o=n;else{if(!(t>e._colRangeWidthsMap.get(`$0$${n}`)))return n;i=n}}return o}return Math.min(Math.ceil(t/e.internalProps.defaultColWidth),e.colCount-1)}(t,e),o=e.getColsWidth(0,i);return t>=o?((i,o)=>{let n=o-e.getColWidth(i);const{colCount:r}=e.internalProps;for(let o=i;o<r;o++){const i=e.getColWidth(o),r=n+i;if(Math.round(n)<=Math.round(t)&&Math.round(t)<Math.round(r))return{left:n,col:o,right:r,width:i};n=r}return null})(i,o):((i,o)=>{let n=o;for(let o=i;o>=0;o--){const i=e.getColWidth(o),r=n-i;if(Math.round(r)<=Math.round(t)&&Math.round(t)<Math.round(n))return{left:r,col:o,right:n,width:i};n=r}return null})(i,o)}function VT(t,e){if(0===t)return{top:0,row:0,bottom:0,height:0};const i=function(t,e){let i=e.internalProps.defaultRowHeight;return e._rowRangeHeightsMap.get("$0$"+(e.rowCount-1))&&(i=e._rowRangeHeightsMap.get("$0$"+(e.rowCount-1))/e.rowCount),Math.min(Math.ceil(t/i),e.rowCount-1)}(t,e),o=e.getRowsHeight(0,i);return t>=o?((i,o)=>{let n=o-e.getRowHeight(i);const{rowCount:r}=e.internalProps;for(let o=i;o<r;o++){const i=e.getRowHeight(o),r=n+i;if(Math.round(n)<=Math.round(t)&&Math.round(t)<Math.round(r))return{top:n,row:o,bottom:r,height:i};n=r}return null})(i,o):((i,o)=>{let n=o;for(let o=i;o>=0;o--){const i=e.getRowHeight(o),r=n-i;if(Math.round(r)<=Math.round(t)&&Math.round(t)<Math.round(n))return{top:r,row:o,bottom:n,height:i};n=r}return null})(i,o)}function UT(t,e,i){if(0===t)return{left:0,col:0,right:0,width:0};if(e&&t>i.tableNoFrameWidth-i.getRightFrozenColsWidth()&&t<i.tableNoFrameWidth&&t<=i.getAllColsWidth())for(let e=0;e<i.rightFrozenColCount;e++)if(t>i.tableNoFrameWidth-i.getColsWidth(i.colCount-e-1,i.colCount-1))return{col:i.colCount-e-1,left:void 0,right:void 0,width:void 0};return jT(t,i)}function $T(t,e,i){if(0===t)return{top:0,row:0,bottom:0,height:0};if(e&&t>i.tableNoFrameHeight-i.getBottomFrozenRowsHeight()&&t<i.tableNoFrameHeight)for(let e=0;e<i.rightFrozenColCount;e++)if(t>i.tableNoFrameHeight-i.getRowsHeight(i.rowCount-e-1,i.rowCount-1))return{row:i.rowCount-e-1,top:void 0,bottom:void 0,height:void 0};return VT(t,i)}function XT(t){return 2===t.length&&ht(t[0])&&ht(t[1])&&t[1]>=t[0]}function YT(t){const e=t[1]-t[0],i=t[1]*t[0]<0;let o=t[0]<=0?0-t[0]:0,n=t[1]>0?t[1]-0:0;return 0===e?t[0]<0?(o=1,n=0):t[0]>0&&(o=0,n=1):(o/=e,n/=e),{total:e,negative:o,positive:n,includeZero:i,domain:t,extendable_min:!0,extendable_max:!0}}function KT(t,e){const{positive:i,negative:o,extendable_min:n,extendable_max:r,domain:s}=t,{positive:l,negative:a,extendable_min:h,extendable_max:d,domain:c}=e;if(l>0){if(!h)return!1;let t=o/i;r&&(t=o/Math.max(i,l),s[1]=-s[0]/t),c[0]=-c[1]*t}else if(a>0){if(!d)return!1;let t=i/o;n&&(t=i/Math.max(o,o),s[0]=-s[1]/t),c[1]=-c[0]*t}return!0}function qT(t,e){const{extendable_min:i,extendable_max:o,domain:n}=t,{positive:r,negative:s,domain:l}=e;return!(0===r&&0===s||r>0&&!o||s>0&&!i||(n[0]=l[0],n[1]=l[1],0))}function ZT(t,e){const{positive:i,negative:o,extendable_max:n,domain:r}=t,{positive:s,negative:l,extendable_min:a,domain:h}=e;if(n&&a){const t=Math.max(o,l)/Math.max(i,s);r[1]=-r[0]/t,h[0]=-h[1]*t}else if(a){const t=o/i;h[0]=-h[1]*t}else{if(!n)return!1;{const t=l/s;r[1]=-r[0]/t}}return!0}function JT(t,e){const{extendable_min:i,domain:o}=t,{extendable_max:n,domain:r}=e;return!(!i||!n||(o[0]=-o[1],r[1]=-r[0],0))}function QT(t,e){const i=[t.min,t.max],o=[e.min,e.max];if(!XT(i)||!XT(o))return;const n=YT(i),r=YT(o),{positive:s,negative:l,extendable_min:a,extendable_max:h,includeZero:d}=n,{positive:c,negative:u,extendable_min:g,extendable_max:p,includeZero:f}=r;if(0===s&&0===l){if(!qT(n,r))return}else if(0===c&&0===u){if(!qT(r,n))return}else if(d||f)if(d&&!f){if(!KT(n,r))return}else if(f&&!d){if(!KT(r,n))return}else{if(l===u)return;if(l>u){if(!ZT(n,r))return}else if(!ZT(r,n))return}else{if(0===l&&0===c){if(!JT(n,r))return}else if(0===u&&0===s&&!JT(r,n))return;if(0===l&&0===u)if(0===i[0]&&o[0]>0){if(!g)return;o[0]=0}else{if(!(0===o[0]&&i[0]>0))return;if(!a)return;i[0]=0}if(0===s&&0===c)if(0===i[1]&&o[1]>0){if(!p)return;o[1]=0}else{if(!(0===o[1]&&i[1]>0))return;if(!h)return;i[1]=0}}return{range1:i,range2:o}}function tk(t,e,i){var o,n,r,s,l,a,h;if(i._table.isPivotChart())if(i.indicatorsAsCol){if(i.hasTwoIndicatorAxes&&e===i.columnHeaderLevelCount-1&&t>=i.rowHeaderLevelCount&&t<i.colCount-i.rightFrozenColCount){const o=nk("top",t,e+1,t,i.columnHeaderLevelCount-1,t,e,1,i);if(!o)return;const n=r_(DS("padding",i._table._getCellStyle(t,e+1),t,e+1,i._table)),{range:r,ticks:s,axisOption:l,isZeroAlign:a,theme:h}=o;if(a){const o=nk("bottom",t,e+1,t,i.columnHeaderLevelCount-1,t,e,0,i);if(o){const{range:t}=o,e=QT(r,t);e&&(r.min=e.range1[0],r.max=e.range1[1])}}return at(null==l?void 0:l.min)&&(r.min=l.min,r.min>0&&(l.zero=!1)),at(null==l?void 0:l.max)&&(r.max=l.max,r.max<0&&(l.zero=!1)),St({range:r},l,{orient:"top",type:(null==l?void 0:l.type)||"linear",label:{flush:!0},__ticksForVTable:s,__vtableChartTheme:h,__vtablePadding:n})}if(e===i.rowCount-i.bottomFrozenRowCount&&t>=i.rowHeaderLevelCount&&t<i.colCount-i.rightFrozenColCount){const o=i.getIndicatorKeyInChartSpec(t,e);let n=null;null==o||o.forEach((t=>{const e=i.getIndicatorInfo(t);e&&(n=e)}));const r=nk("bottom",t,e-1,t,e,t,e,0,i);if(!r)return;const s=r_(DS("padding",i._table._getCellStyle(t,e-1),t,e-1,i._table)),{range:l,ticks:a,axisOption:h,isZeroAlign:d,theme:c}=r;if(d){const o=nk("top",t,e-1,t,e,t,e,1,i);if(o){const{range:t}=o,e=QT(l,t);e&&(l.min=e.range1[0],l.max=e.range1[1])}}return at(null==h?void 0:h.min)&&(l.min=h.min,l.min>0&&(h.zero=!1)),at(null==h?void 0:h.max)&&(l.max=h.max,l.max<0&&(h.zero=!1)),St({title:{visible:!0,text:null==n?void 0:n.title},range:l},h,{orient:"bottom",type:(null==h?void 0:h.type)||"linear",label:{flush:!0},__ticksForVTable:a,__vtableChartTheme:c,__vtablePadding:s})}if(t===i.rowHeaderLevelCount-1&&e>=i.columnHeaderLevelCount&&e<i.rowCount-i.bottomFrozenRowCount){let l=i.getDimensionKeyInChartSpec(i.rowHeaderLevelCount,e);rt(l)&&(l=l[0]);const a=null!==(o=i.dataset.collectedValues[l])&&void 0!==o?o:[],h=i.getRowKeysPath(t,e),d=null!==(n=a[null!=h?h:""])&&void 0!==n?n:[],{axisOption:c,theme:u,chartType:g}=ek(t+1,e,"left",i);if(!1===(null==c?void 0:c.visible))return;const p=r_(DS("padding",i._table._getCellStyle(t+1,e),t+1,e,i._table)),f=i.getRawChartSpec(t+1,e);return St({domain:"linear"===(null==c?void 0:c.type)?void 0:Array.from(d),range:"linear"===(null==c?void 0:c.type)?d:void 0,title:{autoRotate:!0}},c,{orient:"left",type:null!==(r=null==c?void 0:c.type)&&void 0!==r?r:"band",__vtableChartTheme:u,inverse:sk(c,"horizontal"===(null!==(s=null==f?void 0:f.direction)&&void 0!==s?s:"scatter"===g?"vertical":"horizontal")),__vtablePadding:p})}}else{if(t===i.rowHeaderLevelCount-1&&e>=i.columnHeaderLevelCount&&e<i.rowCount-i.bottomFrozenRowCount){const o=i.getIndicatorKeyInChartSpec(t,e);let n=null;null==o||o.forEach((t=>{const e=i.getIndicatorInfo(t);e&&(n=e)}));const r=nk("left",t+1,e,t,e,t,e,0,i);if(!r)return;const s=r_(DS("padding",i._table._getCellStyle(t+1,e),t+1,e,i._table)),{range:l,ticks:a,axisOption:h,isZeroAlign:d,theme:c}=r;if(d){const o=nk("right",t+1,e,t,e,t,e,1,i);if(o){const{range:t}=o,e=QT(l,t);e&&(l.min=e.range1[0],l.max=e.range1[1])}}return at(null==h?void 0:h.min)&&(l.min=h.min,l.min>0&&(h.zero=!1)),at(null==h?void 0:h.max)&&(l.max=h.max,l.max<0&&(h.zero=!1)),St({title:{visible:!0,text:null==n?void 0:n.title,autoRotate:!0},range:l},h,{orient:"left",type:(null==h?void 0:h.type)||"linear",label:{flush:!0},__ticksForVTable:a,__vtableChartTheme:c,__vtablePadding:s})}if(t===i.colCount-i.rightFrozenColCount&&e>=i.columnHeaderLevelCount&&e<i.rowCount-i.bottomFrozenRowCount){const o=nk("right",t-1,e,i.rowHeaderLevelCount-1,e,t,e,1,i);if(!o)return;const n=r_(DS("padding",i._table._getCellStyle(t-1,e),t-1,e,i._table)),{range:r,ticks:s,axisOption:l,isZeroAlign:a,theme:h}=o;if(a){const o=nk("left",t-1,e,i.rowHeaderLevelCount-1,e,t,e,0,i);if(o){const{range:t}=o,e=QT(r,t);e&&(r.min=e.range1[0],r.max=e.range1[1])}}return at(null==l?void 0:l.min)&&(r.min=l.min,r.min>0&&(l.zero=!1)),at(null==l?void 0:l.max)&&(r.max=l.max,r.max<0&&(l.zero=!1)),St({range:r,title:{autoRotate:!0}},l,{orient:"right",type:(null==l?void 0:l.type)||"linear",label:{flush:!0},__ticksForVTable:s,__vtableChartTheme:h,__vtablePadding:n})}if(e===i.rowCount-i.bottomFrozenRowCount&&t>=i.rowHeaderLevelCount&&t<i.colCount-i.rightFrozenColCount){let o=i.getDimensionKeyInChartSpec(t,i.columnHeaderLevelCount);rt(o)&&(o=o[0]);const n=null!==(l=i.dataset.collectedValues[o])&&void 0!==l?l:[],r=i.getColKeysPath(t,e),s=null!==(a=null==n?void 0:n[null!=r?r:""])&&void 0!==a?a:[],{axisOption:d,isPercent:c,theme:u,chartType:g}=ek(t,e-1,"bottom",i);if(!1===(null==d?void 0:d.visible))return;const p=r_(DS("padding",i._table._getCellStyle(t,e-1),t,e-1,i._table));return St({domain:"linear"===(null==d?void 0:d.type)?void 0:Array.from(s),range:"linear"===(null==d?void 0:d.type)?s:void 0},d,{orient:"bottom",type:null!==(h=null==d?void 0:d.type)&&void 0!==h?h:"band",__vtableChartTheme:u,__vtablePadding:p})}}}function ek(t,e,i,o){var n,r;const s=o.getRawChartSpec(t,e),l=null!==(n=s.axes)&&void 0!==n?n:[];if(o._table.pivotChartAxes.forEach((t=>{-1===l.findIndex((e=>t.orient===e.orient))&&l.push(t)})),s&&rt(l)){const t=l.find((t=>t.orient===i));if(t){const{seriesIndex:e,seriesId:n}=t;let l,a;return Q(n)&&rt(s.series)?l=(rt(n)?n:[n]).map((t=>{const e=s.series.findIndex((e=>e.id===t));return e>=0&&(a=s.series[e]),e})):Q(e)&&rt(s.series)&&(l=e),{axisOption:t,isPercent:s.percent,isZeroAlign:ik(s,i,o),seriesIndice:l,theme:s.theme,chartType:null!==(r=null==a?void 0:a.type)&&void 0!==r?r:s.type}}}return{axisOption:o._table.pivotChartAxes.find((t=>t.orient===i)),isPercent:!1,isZeroAlign:ik(s,i,o),theme:s.theme,chartType:s.type}}function ik(t,e,i){const o=[];let n;if("left"===e||"right"===e?o.push("left","right"):"top"!==e&&"bottom"!==e||o.push("top","bottom"),n=t&&rt(t.axes)?t.axes:i._table.pivotChartAxes,rt(n)){const t=[];n.forEach((e=>{o.includes(e.orient)&&t.push(e)}));for(let e=0;e<t.length;e++){const i=t[e];if(i.sync&&i.sync.zeroAlign&&i.sync.axisId&&t.find((t=>t.id===i.sync.axisId)))return!0}}return!1}function ok(t,e,i,o,n){var r;if(rt(n)){const r={min:1/0,max:-1/0};for(let s=0;s<n.length;s++){const l=ok(t,e,i,o,n[s]);l&&(r.min=Math.min(r.min,l.min),r.max=Math.max(r.max,l.max))}return isFinite(r.min)&&isFinite(r.max)?r:null}let s=null==e?void 0:e[n];if(rt(s)&&(s=s[0]),!s)return null;const l=t[s],a=St({},null!==(r=null==l?void 0:l[null!=o?o:""])&&void 0!==r?r:{min:0,max:1});return a.positiveMax&&a.positiveMax>a.max&&(a.max=a.positiveMax),a.negativeMin&&a.negativeMin<a.min&&(a.min=a.negativeMin),a.min===a.max&&(a.min>0?a.min=0:a.max=0),a}function nk(t,e,i,o,n,r,s,l,a){const{axisOption:h,isPercent:d,isZeroAlign:c,seriesIndice:u,theme:g,chartType:p}=ek(e,i,t,a);if(!1===(null==h?void 0:h.visible))return;const f=a.getIndicatorKeyInChartSpec(o,n);let v;v="top"===t||"bottom"===t?a.getColKeysPath(r,s):a.getRowKeysPath(r,s);const m=ok(a.dataset.collectedValues,f,c,v,null!=u?u:l);if(!m)return;d&&(m.min=m.min<0?-1:0,m.max=m.max>0?1:0);const b=Tx.getFunction("getAxisDomainRangeAndLabels"),{range:y,ticks:C}=b(m.min,m.max,h,c,"bottom"===t||"top"===t?a._table.getColWidth(r)||a._table.tableNoFrameWidth:a._table.getRowHeight(s)||a._table.tableNoFrameHeight);return m.min=isNaN(y[0])?0:y[0],m.max=isNaN(y[1])?1:y[1],at(null==h?void 0:h.min)&&(m.min=h.min,m.min>0&&(h.zero=!1)),at(null==h?void 0:h.max)&&(m.max=h.max,m.max<0&&(h.zero=!1)),{axisOption:h,isZeroAlign:c,range:m,ticks:C,theme:g,chartType:p}}var rk;function sk(t,e){let i=null==t?void 0:t.inverse;return e&&!("bottom"===(o=null==t?void 0:t.orient)||"top"===o)&&(i=!Q(null==t?void 0:t.inverse)||!(null==t?void 0:t.inverse)),i;var o}!function(t){t.vertical="vertical",t.horizontal="horizontal"}(rk||(rk={}));const lk={};class ak extends Xn{onUpdate(t,e,i){if(this.from.x!==this.to.x){const i=t?this.to.x:this.from.x+Math.floor((this.to.x-this.from.x)*e);this.params.table.scrollLeft=i}if(this.from.y!==this.to.y){const i=t?this.to.y:this.from.y+Math.floor((this.to.y-this.from.y)*e);this.params.table.scrollTop=i}}}class hk{constructor(t){this.table=t,this.timeline=new Un,this.ticker=new jn([this.timeline]),this.tempGraphic=sc({})}scrollTo(t,e){var i,o,n,s;const l={x:this.table.scrollLeft,y:this.table.scrollTop},a=this.table.getCellRect(null!==(i=t.col)&&void 0!==i?i:0,null!==(o=t.row)&&void 0!==o?o:0),h={x:at(t.col)?a.left-this.table.getFrozenColsWidth():this.table.scrollLeft,y:at(t.row)?a.top-this.table.getFrozenRowsHeight():this.table.scrollTop},d=q(e)?e?3e3:0:null!==(n=null==e?void 0:e.duration)&&void 0!==n?n:3e3,c=q(e)?e?"linear":"":null!==(s=null==e?void 0:e.easing)&&void 0!==s?s:"linear";new Kn(r.GenAutoIncrementId(),this.timeline).bind(this.tempGraphic).play(new ak(l,h,d,c,{graphic:this.tempGraphic,table:this.table})),this.ticker.start()}clear(){this.timeline.clear(),this.ticker.stop()}}const{toBoxArray:dk}=Uw,{isTouchEvent:ck}=Vw,uk=/^\$(\d+)\$(\d+)$/;!function(){if("node"===sw.mode)return;const t=document.createElement("style");t.id="vtable-style-styleSheet",t.textContent="\n.vtable .input-container {\n\tposition: absolute;\n\ttop:0px;\n}\n.vtable .table-scrollable {\n\tposition: absolute;\n\toverflow: scroll;\n}\n.vtable .table-scrollable::-webkit-scrollbar-button{\n\tbackground-color: transparent;\n}\n.vtable .table-scrollable::-webkit-scrollbar-track-piece{\n\tbackground-color: transparent;\n}\n.vtable .table-scrollable::-webkit-scrollbar-corner {\n\tbackground-color: transparent;\n}\n.vtable .table-scrollable::-webkit-scrollbar-thumb {\n\tborder-radius : 4px;\n\tbackground-color : rgba(100, 100, 100, .5);\n}\n\n.vtable .table-scroll-end-point {\n\topacity: 0;\n\tposition: relative;\n}\n.vtable {\n\t/* 设置overflow: auto 应该是为了滚动条的某个问题 但设置了auto之后 dom的下拉菜单只能显示在vtable节点中 超出会截断;现在去掉auto 暂时滚动条的问题没有发现 */\n\t/* overflow: auto; */\n\tposition: relative;\n\twidth: 100%;\n\theight: 100%;\n\ttext-align: left;\n -webkit-font-smoothing:auto;\n\n overflow: hidden; // for react-vtable dom custom element\n}\n\n.vtable-gantt {\n\t/* 设置overflow: auto 应该是为了滚动条的某个问题 但设置了auto之后 dom的下拉菜单只能显示在vtable节点中 超出会截断;现在去掉auto 暂时滚动条的问题没有发现 */\n\t/* overflow: auto; */\n\tposition: absolute;\n\twidth: 100%;\n\theight: 100%;\n\ttext-align: left;\n -webkit-font-smoothing:auto;\n\n overflow: hidden; // for react-vtable dom custom element\n}\n.vtable .table-component-container {\n pointer-events: none;\n overflow: hidden;\n position: absolute;\n top: 0px;\n left: 0px;\n}\n.vtable > canvas {\n\tposition: absolute;\n\twidth: 0;\n\theight: 0;\n}\n.vtable .table-focus-control {\n\tposition: relative !important;\n\twidth: 1px;\n\theight: 1px;\n\topacity: 0;\n\tpadding: 0;\n\tmargin: 0;\n\tbox-sizing: border-box;\n\tpointer-events: none;\n\tmax-width: 500px;\n\tmax-height: 500px;\n\tfloat: none !important;\n}\n.vtable input.table-focus-control::-ms-clear {\n\tvisibility: hidden;\n}\n.vtable input.table-focus-control.composition {\n\topacity: 1;\n\tmax-width: none;\n\tmax-height: none;\n}\n",document.head.appendChild(t)}();class gk extends YC{static get EVENT_TYPE(){return Xw}constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};var i,o,n,r,s,l,a,h,d,c;if(super(),this.showFrozenIcon=!0,this.version="1.10.4-alpha.2",this.id=`VTable${Date.now()}`,this.isReleased=!1,this._chartEventMap={},this.throttleInvalidate=function(t,e){let i=null;return function(){for(var o=arguments.length,n=new Array(o),r=0;r<o;r++)n[r]=arguments[r];i||(i=setTimeout((()=>{t.apply(this,n),i=null}),e))}}(this.render.bind(this),200),!t&&"node"!==e.mode&&!e.canvas)throw new Error("vtable's container is undefined");const{frozenColCount:u=0,frozenRowCount:g,defaultRowHeight:p=40,defaultHeaderRowHeight:f,defaultColWidth:v=80,defaultHeaderColWidth:m,widthMode:b="standard",heightMode:y="standard",autoFillWidth:C=!1,autoFillHeight:w=!1,widthAdaptiveMode:x="only-body",heightAdaptiveMode:_="only-body",keyboardOptions:S,eventOptions:A,rowSeriesNumber:B,columnResizeMode:R,rowResizeMode:M="none",dragHeaderMode:T,showFrozenIcon:k,allowFrozenColCount:L,padding:P,hover:E,menu:H,select:F,customRender:z,pixelRatio:I=KM,renderChartAsync:O,renderChartAsyncBatchCount:D,mode:W,modeParams:N,canvasWidth:G,canvasHeight:j,overscrollBehavior:V,limitMinWidth:U,limitMinHeight:$,clearDOM:X=!0}=e;this.container=t,this.options=e,this._widthMode=b,this._heightMode=y,this._widthAdaptiveMode=x,this._heightAdaptiveMode=_,this._autoFillWidth=C,this._autoFillHeight=w,this.customRender=z,this.padding={top:0,right:0,left:0,bottom:0},P&&("number"==typeof P?(this.padding.top=P,this.padding.left=P,this.padding.bottom=P,this.padding.right=P):(P.top&&(this.padding.top=P.top),P.bottom&&(this.padding.bottom=P.bottom),P.left&&(this.padding.left=P.left),P.right&&(this.padding.right=P.right))),Q(j)&&Q(G)&&(this.canvasSizeSeted=!0),this.tableNoFrameWidth=0,this.tableNoFrameHeight=0,this.canvasWidth=G,this.canvasHeight=j,this.columnWidthComputeMode=null!==(i=e.columnWidthComputeMode)&&void 0!==i?i:"normal";const Y=this.internalProps={};if(void 0!==k&&(this.showFrozenIcon=k),"number"==typeof L&&L<=0&&(this.showFrozenIcon=!1),this.options.canvas?(Y.element=this.options.canvas.parentElement,Y.element.style.position="relative",Y.focusControl=new ET(this,Y.element),Y.canvas=this.options.canvas,Y.context=Y.canvas.getContext("2d")):"node"!==sw.mode&&(Y.element=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"vtable";var i,o;const n=document.createElement("div");n.setAttribute("tabindex","0"),n.classList.add(e),n.style.outline="none",n.style.margin=`${t.top}px ${t.right}px ${t.bottom}px ${t.left}px`;const r=(n.offsetWidth||(null===(i=n.parentElement)||void 0===i?void 0:i.offsetWidth)||1)-1,s=(n.offsetHeight||(null===(o=n.parentElement)||void 0===o?void 0:o.offsetHeight)||1)-1;return n.style.width=r&&r-t.left-t.right+"px"||"0px",n.style.height=s&&s-t.top-t.bottom+"px"||"0px",n}(this.padding),Y.focusControl=new ET(this,Y.element),Y.canvas=document.createElement("canvas"),Y.element.appendChild(Y.canvas),Y.context=Y.canvas.getContext("2d"),(null===(o=e.customConfig)||void 0===o?void 0:o.createReactContainer)&&function(t){const{internalProps:e}=t;e.bodyDomContainer=document.createElement("div"),e.bodyDomContainer.id="vtable-body-dom-container",e.bodyDomContainer.classList.add("table-component-container"),e.element.appendChild(e.bodyDomContainer),e.headerDomContainer=document.createElement("div"),e.headerDomContainer.id="vtable-header-dom-container",e.headerDomContainer.classList.add("table-component-container"),e.element.appendChild(e.headerDomContainer),e.frozenBodyDomContainer=document.createElement("div"),e.frozenBodyDomContainer.id="vtable-frozen-body-dom-container",e.frozenBodyDomContainer.classList.add("table-component-container"),e.element.appendChild(e.frozenBodyDomContainer),e.frozenHeaderDomContainer=document.createElement("div"),e.frozenHeaderDomContainer.id="vtable-frozen-header-dom-container",e.frozenHeaderDomContainer.classList.add("table-component-container"),e.element.appendChild(e.frozenHeaderDomContainer),e.rightFrozenBodyDomContainer=document.createElement("div"),e.rightFrozenBodyDomContainer.id="vtable-right-frozen-body-dom-container",e.rightFrozenBodyDomContainer.classList.add("table-component-container"),e.element.appendChild(e.rightFrozenBodyDomContainer),e.rightFrozenHeaderDomContainer=document.createElement("div"),e.rightFrozenHeaderDomContainer.id="vtable-right-frozen-header-dom-container",e.rightFrozenHeaderDomContainer.classList.add("table-component-container"),e.element.appendChild(e.rightFrozenHeaderDomContainer),e.frozenBottomDomContainer=document.createElement("div"),e.frozenBottomDomContainer.id="vtable-frozen-bottom-dom-container",e.frozenBottomDomContainer.classList.add("table-component-container"),e.element.appendChild(e.frozenBottomDomContainer),e.bottomDomContainer=document.createElement("div"),e.bottomDomContainer.id="vtable-bottom-dom-container",e.bottomDomContainer.classList.add("table-component-container"),e.element.appendChild(e.bottomDomContainer),e.rightFrozenBottomDomContainer=document.createElement("div"),e.rightFrozenBottomDomContainer.id="vtable-right-frozen-bottom-dom-container",e.rightFrozenBottomDomContainer.classList.add("table-component-container"),e.element.appendChild(e.rightFrozenBottomDomContainer)}(this)),Y.handler=new Zw,at(this.options.resizeTime)&&(Y.handler.resizeTime=this.options.resizeTime),Y.pixelRatio=I,Y.frozenColCount=u,Y.frozenRowCount=g,Y.defaultRowHeight=p,Y.defaultHeaderRowHeight=null!=f?f:p,Y.defaultColWidth=v,Y.defaultHeaderColWidth=null!=m?m:v,Y.keyboardOptions=S,Y.eventOptions=A,Y.rowSeriesNumber=B,Y.columnResizeMode=R,Y.rowResizeMode=M,Y.dragHeaderMode=null!=T?T:"none",Y.renderChartAsync=O,mB(D),Y.overscrollBehavior=null!=V?V:"auto",Y._rowHeightsMap=new HT(this),Y._rowRangeHeightsMap=new Map,Y._colRangeWidthsMap=new Map,Y._widthResizedColMap=new Set,Y._heightResizedRowMap=new Set,this.colWidthsMap=new Qw,this.colContentWidthsMap=new Qw,this.colWidthsLimit={},Y.calcWidthContext={_:Y,get full(){var t;return"node"===sw.mode?G/(null!=I?I:1):this._.canvas.width/(null!==(t=this._.context.pixelRatio)&&void 0!==t?t:window.devicePixelRatio)}},Y.cellTextOverflows={},Y.focusedTable=!1,Y.theme=Bx.of(null!==(n=e.theme)&&void 0!==n?n:Bx.DEFAULT),Y.theme.isPivot=this.isPivotTable(),ES(Y.theme.functionalIconsStyle),t?(X&&(t.innerHTML=""),t.appendChild(Y.element),this._updateSize()):this._updateSize(),Y.bodyHelper=new oT(this),Y.headerHelper=new PT(this),Y.rowSeriesNumberHelper=new zT(this),Y.autoWrapText=e.autoWrapText,Y.enableLineBreak=e.enableLineBreak,Y.allowFrozenColCount=null!==(r=e.allowFrozenColCount)&&void 0!==r?r:0,Y.limitMaxAutoWidth=null!==(s=e.limitMaxAutoWidth)&&void 0!==s?s:450,Y.limitMinWidth=null!=U?"number"==typeof U?U:U?10:0:10,Y.limitMinHeight=null!=$?"number"==typeof $?$:$?10:0:10,this.scenegraph=new BM(this),this.stateManager=new class{constructor(t){this.fastScrolling=!1,this.checkedState=[],this.headerCheckedState={},this._checkboxCellTypeFields=[],this._headerCheckFuncs={},this.radioState={},this.resetInteractionState=Kw((t=>{this.updateInteractionState(null!=t?t:IC.default)}),100),this.table=t,this.initState(),this.updateVerticalScrollBar=this.updateVerticalScrollBar.bind(this),this.updateHorizontalScrollBar=this.updateHorizontalScrollBar.bind(this)}initState(){this._initState(),this.setHoverState(),this.setSelectState(),this.setFrozenState()}updateOptionSetState(){this._updateOptionSetState(),this.setHoverState(),this.setSelectState(),this.setFrozenState()}_updateOptionSetState(){this.interactionState=IC.default,this.hoverIcon={col:-1,row:-1,icon:null},this.columnResize={col:-1,x:0,resizing:!1},this.rowResize={row:-1,y:0,resizing:!1},this.columnMove={colSource:-1,colTarget:-1,rowSource:-1,rowTarget:-1,x:0,y:0,moving:!1},this.menu={x:-1,y:-1,isShow:!1,itemList:[],bounds:new ze,highlightIndex:-1,dropDownMenuHighlight:[]},this.sort=[{col:-1,row:-1,order:"normal"}],this.frozen={col:-1},this.tablePosition={absoluteX:0,absoluteY:0},this.drill={col:-1,row:-1},this.sparkLine={col:-1,row:-1}}_initState(){this.interactionState=IC.default,this.select={highlightScope:OC.single,ranges:[],cellPos:{col:-1,row:-1},selecting:!1},this.fillHandle={isFilling:!1,startX:void 0,startY:void 0},this.hover={highlightScope:OC.single,cellPos:{col:-1,row:-1}},this.hoverIcon={col:-1,row:-1,icon:null},this.columnResize={col:-1,x:0,resizing:!1},this.rowResize={row:-1,y:0,resizing:!1},this.columnMove={colSource:-1,colTarget:-1,rowSource:-1,rowTarget:-1,x:0,y:0,moving:!1},this.menu={x:-1,y:-1,isShow:!1,itemList:[],bounds:new ze,highlightIndex:-1,dropDownMenuHighlight:[]},this.sort=[{col:-1,row:-1,order:"normal"}],this.frozen={col:-1},this.scroll={horizontalBarPos:0,verticalBarPos:0},this.tablePosition={absoluteX:0,absoluteY:0},this.drill={col:-1,row:-1},this.sparkLine={col:-1,row:-1}}setHoverState(){var t;const{highlightMode:e,disableHover:i,disableHeaderHover:o}=null!==(t=this.table.options.hover)&&void 0!==t?t:{highlightMode:"cell"};i?this.hover.highlightScope=OC.none:"cross"===e?this.hover.highlightScope=OC.cross:"row"===e?this.hover.highlightScope=OC.row:"column"===e?this.hover.highlightScope=OC.column:"cell"===e&&(this.hover.highlightScope=OC.single),this.hover.singleStyle=!i,this.hover.disableHeader=o,(this.hover.highlightScope===OC.none||o)&&(this.hover.cellPosContainHeader={col:-1,row:-1})}setSelectState(){const{headerSelectMode:t,disableSelect:e,disableHeaderSelect:i,highlightMode:o}=Object.assign({},{headerSelectMode:"inline",disableSelect:!1,disableHeaderSelect:!1,highlightMode:"cell"},this.table.options.select);this.select.highlightScope=e?OC.none:"cross"===o?OC.cross:"row"===o?OC.row:"column"===o?OC.column:OC.single,this.select.singleStyle=!e,this.select.disableHeader=i,this.select.headerSelectMode=t}isSelected(t,e){let i=!1;return this.select.ranges.forEach((o=>{Ow(o,t,e)&&(i=!0)})),i}setSortState(t){const e=this,i=(t=!t||Array.isArray(t)?t:[t])&&t.reduce(((t,i)=>{var o,n,r;const s=null===(o=function(t){const i=[];return function t(o){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;o.forEach((o=>{var r;const s=o.startInTotal?null!==(r=o.startInTotal+e.table.internalProps.layoutMap.leftRowSeriesNumberColumnCount)&&void 0!==r?r:0:n;o.columns?t(o.columns,s):i.push(Object.assign(Object.assign({},o),{startIndex:s}))}))}(t),i}(this.table.internalProps.columns))||void 0===o?void 0:o.find((t=>(null==t?void 0:t.field)===(null==i?void 0:i.field)));return this.table.internalProps.transpose?t.push({field:i.field,order:i.order,row:null!==(n=s.startInTotal+this.table.internalProps.layoutMap.leftRowSeriesNumberColumnCount)&&void 0!==n?n:0,col:s.level}):t.push({field:i.field,order:i.order,col:null!==(r=s.startInTotal+this.table.internalProps.layoutMap.leftRowSeriesNumberColumnCount)&&void 0!==r?r:0,row:s.level}),t}),[]);this.sort=i||[]}setFrozenState(){this.frozen.col=this.table.frozenColCount-1}updateInteractionState(t){if(this.interactionState===t)return;t===IC.scrolling&&(this.interactionStateBeforeScroll=this.interactionState);const e=this.interactionState;this.interactionState=t,e===IC.scrolling&&IC.default}updateHoverhighlightScope(t){this.hover.highlightScope!==t&&(this.hover.highlightScope=t)}updateHoverPos(t,e){PM(this,t,e)}updateSelectPos(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=arguments.length>3&&void 0!==arguments[3]&&arguments[3],n=arguments.length>4&&void 0!==arguments[4]&&arguments[4],r=arguments.length>5&&void 0!==arguments[5]&&arguments[5],s=arguments.length>6&&void 0!==arguments[6]&&arguments[6];-1!==e&&-1!==e&&(this.select.selecting=!0),function(t,e,i,o,n,r){let s=arguments.length>6&&void 0!==arguments[6]&&arguments[6],l=arguments.length>7&&void 0!==arguments[7]&&arguments[7];var a,h;const{table:d,interactionState:c}=t,{scenegraph:u}=d,{highlightScope:g,disableHeader:p,cellPos:f}=t.select;if((p&&d.isHeader(e,i)||"none"===g)&&(-1===e||-1===i||s||d._makeVisibleCell(e,i),e=-1,i=-1),-1!==e&&-1!==i&&!s)if(c===IC.grabing&&t.select.ranges.length>0){const o=t.select.ranges[t.select.ranges.length-1];e>o.start.col&&e>o.end.col&&d._makeVisibleCell(e+1,i),i>o.start.row&&i>o.end.row&&d._makeVisibleCell(e,i+1),e<o.start.col&&e<o.end.col&&d._makeVisibleCell(e-1,i),i<o.start.row&&i<o.end.row&&d._makeVisibleCell(e,i-1)}else d._makeVisibleCell(e,i);if(r){t.select.ranges=[],u.deleteAllSelectBorder();let e=0,i=0;const{disableHeaderSelect:o,disableRowSeriesNumberSelect:n}=(null===(a=d.options.keyboardOptions)||void 0===a?void 0:a.selectAllOnCtrlA)||{};o&&(e=d.rowHeaderLevelCount,i=d.columnHeaderLevelCount),(n||o&&d.transpose)&&d.options.rowSeriesNumber&&(e+=1),t.select.ranges.push({start:{col:e,row:i},end:{col:d.colCount-1,row:d.rowCount-1}});const r=t.select.ranges[t.select.ranges.length-1];u.updateCellSelectBorder(r,!1)}else if(-1===f.col||-1===f.row||-1!==e&&-1!==i)if(c!==IC.default||d.eventManager.isDraging||d.stateManager.isResizeCol()){if((c===IC.grabing||d.eventManager.isDraging)&&!d.stateManager.isResizeCol()){let o=!0;-1===f.col&&(f.col=e),-1===f.row&&(f.row=i),f.col=e,f.row=i;const n=t.select.ranges[t.select.ranges.length-1];if(n){if(d.internalProps.layoutMap.isSeriesNumberInBody(n.start.col,n.start.row))o=!1,n.end={col:d.colCount-1,row:i};else if(t.fillHandle.isFilling){if("top"===t.fillHandle.direction)if(i===t.fillHandle.beforeFillMinRow&&i===t.fillHandle.beforeFillMaxRow)n.start.row=n.end.row=i;else if(i<=t.fillHandle.beforeFillMinRow){if(n.start.row<n.end.row){const t=n.start.row;n.start.row=n.end.row,n.end.row=t}n.end.row=i}else i===t.fillHandle.beforeFillMaxRow&&(n.start.row>n.end.row?n.start.row=i:n.end.row=i);else if("bottom"===t.fillHandle.direction){if(i>=t.fillHandle.beforeFillMaxRow){if(n.start.row>n.end.row){const t=n.start.row;n.start.row=n.end.row,n.end.row=t}n.end.row=i}}else if("left"===t.fillHandle.direction)if(e===t.fillHandle.beforeFillMinCol&&e===t.fillHandle.beforeFillMaxCol)n.start.col=n.end.col=e;else if(e<=t.fillHandle.beforeFillMinCol){if(n.start.col<n.end.col){const t=n.start.col;n.start.col=n.end.col,n.end.col=t}n.end.col=e}else e===t.fillHandle.beforeFillMaxCol&&(n.start.col>n.end.col?n.start.col=e:n.end.col=e);else if("right"===t.fillHandle.direction&&e>=t.fillHandle.beforeFillMaxCol){if(n.start.col>n.end.col){const t=n.start.col;n.start.col=n.end.col,n.end.col=t}n.end.col=e}}else{n.end={col:e,row:i};const o=l?{start:{col:e,row:i},end:{col:e,row:i}}:d.getCellRange(e,i);n.start.col<o.end.col?n.end.col=o.end.col:n.start.col>o.start.col&&(n.end.col=o.start.col),n.start.row<o.end.row?n.end.row=o.end.row:n.start.row>o.start.row&&(n.end.row=o.start.row),"body"===t.select.headerSelectMode&&(d.isRowHeader(e,i)?(n.start.col=d.rowHeaderLevelCount+d.leftRowSeriesNumberCount,n.end.col=d.colCount-1):d.isColumnHeader(e,i)?(n.start.row=d.columnHeaderLevelCount,n.end.row=d.rowCount-1):d.internalProps.layoutMap.isSeriesNumberInBody(e,i)?(n.start.col=d.leftRowSeriesNumberCount,n.end.col=d.colCount-1):d.isCornerHeader(e,i)?(n.start.col=d.rowHeaderLevelCount+d.leftRowSeriesNumberCount,n.start.row=d.columnHeaderLevelCount,n.end.col=d.colCount-1,n.end.row=d.rowCount-1):d.isSeriesNumber(e,i)&&(n.start.col=d.leftRowSeriesNumberCount,n.start.row=d.columnHeaderLevelCount,n.end.col=d.colCount-1,n.end.row=d.rowCount-1)),l&&(n.skipBodyMerge=!0)}u.updateCellSelectBorder(n,o)}}}else{const r=t.select.ranges[t.select.ranges.length-1];if(o&&r){if(n||(f.col=e,f.row=i),"cell"!==t.select.headerSelectMode&&d.isColumnHeader(e,i)){const o=Math.min(r.start.col,r.end.col,e),n=Math.max(r.start.col,r.end.col,e),s=Math.min(r.start.row,r.end.row,i),l=d.rowCount-1;"body"===t.select.headerSelectMode?(r.start={col:o,row:d.columnHeaderLevelCount},r.end={col:n,row:d.rowCount-1}):(r.start={col:o,row:s},r.end={col:n,row:l})}else if("cell"!==t.select.headerSelectMode&&d.isRowHeader(e,i)){const o=Math.min(r.start.col,r.end.col,e),n=d.colCount-1,s=Math.min(r.start.row,r.end.row,i),l=Math.max(r.start.row,r.end.row,i);"body"===t.select.headerSelectMode?(r.start={col:d.leftRowSeriesNumberCount+d.rowHeaderLevelCount,row:s},r.end={col:d.colCount-1,row:l}):(r.start={col:o,row:s},r.end={col:n,row:l})}else if("cell"!==t.select.headerSelectMode&&d.isSeriesNumberInBody(e,i)){const o=Math.min(r.start.col,r.end.col,e),n=d.colCount-1,s=Math.min(r.start.row,r.end.row,i),l=Math.max(r.start.row,r.end.row,i);"body"===t.select.headerSelectMode?(r.start={col:d.leftRowSeriesNumberCount,row:s},r.end={col:d.colCount-1,row:l}):(r.start={col:o,row:s},r.end={col:n,row:l})}else r.end={col:e,row:i};u.deleteLastSelectedRangeComponents(),u.updateCellSelectBorder(r)}else{let o=!0;if(-1===f.col||-1===f.row||n||(t.select.ranges=[],u.deleteAllSelectBorder()),"cell"!==t.select.headerSelectMode&&d.isColumnHeader(e,i)){const o=d.getCellRange(e,i);"body"===t.select.headerSelectMode?t.select.ranges.push({start:{col:o.start.col,row:d.columnHeaderLevelCount},end:{col:o.end.col,row:d.rowCount-1},skipBodyMerge:!0}):t.select.ranges.push({start:{col:o.start.col,row:i},end:{col:o.end.col,row:d.rowCount-1},skipBodyMerge:!0})}else if("cell"!==t.select.headerSelectMode&&d.isRowHeader(e,i)){const o=d.getCellRange(e,i);"body"===t.select.headerSelectMode?t.select.ranges.push({start:{col:d.rowHeaderLevelCount+d.leftRowSeriesNumberCount,row:o.start.row},end:{col:d.colCount-1,row:o.end.row},skipBodyMerge:!0}):t.select.ranges.push({start:{col:e,row:o.start.row},end:{col:d.colCount-1,row:o.end.row},skipBodyMerge:!0})}else if(d.internalProps.layoutMap.isSeriesNumberInHeader(e,i))o=!1,"body"===t.select.headerSelectMode?t.select.ranges.push({start:{col:d.leftRowSeriesNumberCount,row:d.columnHeaderLevelCount},end:{col:d.colCount-1,row:d.rowCount-1},skipBodyMerge:!0}):t.select.ranges.push({start:{col:0,row:0},end:{col:d.colCount-1,row:d.rowCount-1},skipBodyMerge:!0});else if(d.internalProps.layoutMap.isSeriesNumberInBody(e,i))o=!1,"body"===t.select.headerSelectMode?t.select.ranges.push({start:{col:d.leftRowSeriesNumberCount,row:i},end:{col:d.colCount-1,row:i},skipBodyMerge:!0}):t.select.ranges.push({start:{col:e,row:i},end:{col:d.colCount-1,row:i},skipBodyMerge:!0});else if(d.internalProps.layoutMap.isCornerHeader(e,i))o=!1,"body"===t.select.headerSelectMode?t.select.ranges.push({start:{col:d.rowHeaderLevelCount+d.leftRowSeriesNumberCount,row:d.columnHeaderLevelCount},end:{col:d.colCount-1,row:d.rowCount-1},skipBodyMerge:!0}):t.select.ranges.push({start:{col:d.leftRowSeriesNumberCount,row:0},end:{col:d.colCount-1,row:d.rowCount-1},skipBodyMerge:!0});else if(e>=0&&i>=0){const o=l?{start:{col:e,row:i},end:{col:e,row:i}}:d.getCellRange(e,i);t.select.ranges.push({start:{col:o.start.col,row:o.start.row},end:{col:o.end.col,row:o.end.row},skipBodyMerge:l||void 0})}f.col=e,f.row=i;const r=null===(h=t.select.ranges)||void 0===h?void 0:h[t.select.ranges.length-1];r&&u.updateCellSelectBorder(r,o)}}else f.col=-1,f.row=-1,t.select.ranges=[],u.deleteAllSelectBorder();u.updateNextFrame()}(this,t,e,i,o,n,r,s)}checkCellRangeInSelect(t,e){return function(t,e,i,o){for(let o=0;o<i.length;o++)if(Ww(i[o],{start:t,end:e}))return!0;return!1}(t,e,this.select.ranges,this.select.highlightScope)}updateHoverIcon(t,e,i,o){var n,r,s,l,a,h,d,c,u;if((null===(n=this.residentHoverIcon)||void 0===n?void 0:n.icon)&&i===(null===(r=this.residentHoverIcon)||void 0===r?void 0:r.icon))return;const g=IM(i);if(g)if("richtext-icon"===g.type){const i=g.icon;if(this.hoverIcon.icon&&this.hoverIcon.icon!==(null===(l=this.residentHoverIcon)||void 0===l?void 0:l.icon)&&(this.table.scenegraph.setIconNormalStyle(this.hoverIcon.icon,this.hoverIcon.col,this.hoverIcon.row),this.hoverIcon.col=-1,this.hoverIcon.col=-1,this.hoverIcon.icon=null,this.table.scenegraph.updateNextFrame()),i.attribute.tooltip){const o={content:i.attribute.tooltip.title,referencePosition:{rect:g.position,placement:i.attribute.tooltip.placement},style:Object.assign({},null===(a=this.table.internalProps.theme)||void 0===a?void 0:a.tooltipStyle,null===(h=i.tooltip)||void 0===h?void 0:h.style,null===(c=null===(d=i.attribute)||void 0===d?void 0:d.tooltip)||void 0===c?void 0:c.style),disappearDelay:i.attribute.tooltip.disappearDelay};this.table.internalProps.tooltipHandler.isBinded(o)||this.table.showTooltip(t,e,o)}}else{const i=g.icon;i!==this.hoverIcon.icon&&(this.hoverIcon.icon&&this.hoverIcon.icon!==(null===(u=this.residentHoverIcon)||void 0===u?void 0:u.icon)&&this.table.scenegraph.setIconNormalStyle(this.hoverIcon.icon,this.hoverIcon.col,this.hoverIcon.row),this.hoverIcon.col=t,this.hoverIcon.row=e,this.hoverIcon.icon=i,this.table.scenegraph.setIconHoverStyle(i,t,e,o),this.table.scenegraph.updateNextFrame())}else this.hoverIcon.icon&&this.hoverIcon.icon!==(null===(s=this.residentHoverIcon)||void 0===s?void 0:s.icon)&&(this.table.scenegraph.setIconNormalStyle(this.hoverIcon.icon,this.hoverIcon.col,this.hoverIcon.row),this.hoverIcon.col=-1,this.hoverIcon.col=-1,this.hoverIcon.icon=null,this.table.scenegraph.updateNextFrame())}isResizeCol(){return this.columnResize.resizing}isResizeRow(){return this.rowResize.resizing}isFillHandle(){return this.fillHandle.isFilling}isSelecting(){return this.select.selecting}endSelectCells(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(this.select.selecting){if(this.select.selecting=!1,0===this.select.ranges.length)return;const e=this.select.ranges[this.select.ranges.length-1];let i=!1;for(let t=0;t<this.select.ranges.length-1;t++){const o=this.select.ranges[t];if(o&&o.start.col===e.start.col&&o.start.row===e.start.row&&o.end.col===e.end.col&&o.end.row===e.end.row){i=!0;break}}i?(this.select.ranges.pop(),JR(this.table.scenegraph),this.table.scenegraph.selectingRangeComponents.clear()):this.table.scenegraph.moveSelectingRangeComponentsToSelectedRangeComponents();const o=this.select.ranges[this.select.ranges.length-1].end.col,n=this.select.ranges[this.select.ranges.length-1].end.row;t&&this.table.fireListeners(Xw.SELECTED_CELL,{ranges:this.select.ranges,col:o,row:n})}else e&&0===this.select.ranges.length&&this.table.fireListeners(Xw.SELECTED_CLEAR,{})}endResizeCol(){setTimeout((()=>{this.columnResize.resizing=!1}),0),this.table.scenegraph.updateChartSizeForResizeColWidth(this.columnResize.col),this.checkFrozen(),this.table.scenegraph.component.hideResizeCol(),this.table.scenegraph.updateNextFrame()}startResizeCol(t,e,i,o){var n;this.columnResize.resizing=!0,this.columnResize.col=t,this.columnResize.x=e,this.columnResize.isRightFrozen=o,this.table.scenegraph.component.showResizeCol(t,i,o);const r=!!(null===(n=this.select.ranges)||void 0===n?void 0:n.length);this.updateSelectPos(-1,-1),this.endSelectCells(!0,r),this.table.scenegraph.updateNextFrame()}updateResizeCol(t,e){!function(t,e,i){t=Math.ceil(t),e=Math.ceil(e);let o=i.columnResize.isRightFrozen?i.columnResize.x-t:t-i.columnResize.x;if(Math.abs(o)<1)return;const n=i.table.getColWidth(i.columnResize.col);let r=n;r+=o;const s=i.table.getMinColWidth(i.columnResize.col),l=i.table.getMaxColWidth(i.columnResize.col);if(r<s||r>l){if(n===s||n===l)return;o=n-s>l-n?l-n:s-n}let a=i.table.getColWidth(i.columnResize.col)+o;if(a<i.table.internalProps.limitMinWidth&&(a=i.table.internalProps.limitMinWidth,o=a-i.table.getColWidth(i.columnResize.col)),"adaptive"===i.table.widthMode&&i.columnResize.col<i.table.colCount-1){const t=i.table.getColWidth(i.columnResize.col+1),e=i.table.getMinColWidth(i.columnResize.col+1),n=i.table.getMaxColWidth(i.columnResize.col+1);let r=t;if(r-=o,r<e||r>n){if(t===e||t===n)return;o=t-e>n-t?n-t:e-t}r-o<i.table.internalProps.limitMinWidth&&(o=r-i.table.internalProps.limitMinWidth)}o=Math.ceil(o),i.columnResize.col<i.table.rowHeaderLevelCount||i.columnResize.col>=i.table.colCount-i.table.rightFrozenColCount?OM(o,i):"indicator"===i.table.internalProps.columnResizeType?function(t,e){const i=e.table.internalProps.layoutMap;let o,n,r;if(i.indicatorsAsCol)o=i.getIndicatorKey(e.columnResize.col,e.table.columnHeaderLevelCount);else{const t=i.getCellHeaderPaths(e.columnResize.col,e.table.columnHeaderLevelCount-1),o=t.colHeaderPaths[t.colHeaderPaths.length-1];n=o.dimensionKey,r=o.value}for(let s=e.table.rowHeaderLevelCount;s<e.table.colCount-e.table.rightFrozenColCount;s++){const l=i.getIndicatorKey(s,e.table.columnHeaderLevelCount);if(i.indicatorsAsCol&&l===o)e.table.scenegraph.updateColWidth(s,t),e.table.internalProps._widthResizedColMap.add(s);else if(!i.indicatorsAsCol){const o=i.getCellHeaderPaths(s,e.table.columnHeaderLevelCount-1),l=null==o?void 0:o.colHeaderPaths[o.colHeaderPaths.length-1];l&&n===l.dimensionKey&&r===l.value&&(e.table.scenegraph.updateColWidth(s,t),e.table.internalProps._widthResizedColMap.add(s))}}}(o,i):"indicatorGroup"===i.table.internalProps.columnResizeType?function(t,e){const i=e.table.internalProps.layoutMap,o=i.getCellHeaderPaths(e.columnResize.col,e.table.columnHeaderLevelCount),n=i.getHeadNodeByRowOrColDimensions(o.colHeaderPaths.slice(0,o.colHeaderPaths.length-1)),r=n.startInTotal+e.table.frozenColCount,s=n.startInTotal+e.table.frozenColCount+n.size-1,l=e.table.getColsWidth(r,s),a=t;for(let t=r;t<=s;t++){if(!(e.table.internalProps.transpose||e.table.isPivotTable()&&!i.indicatorsAsCol)){const o=i.getBody(t,e.table.columnHeaderLevelCount);if(null==o?void 0:o.disableColumnResize)continue}let o=e.table.getColWidth(t)/l*a;o>0&&o<.5?o=.5:o<0&&o>=-.5&&(o=-.5),e.table.scenegraph.updateColWidth(t,o),e.table.internalProps._widthResizedColMap.add(t)}}(o,i):"all"===i.table.internalProps.columnResizeType?function(t,e){const i=e.table.internalProps.layoutMap;for(let o=e.table.frozenColCount;o<e.table.colCount-e.table.rightFrozenColCount;o++){if(!(e.table.internalProps.transpose||e.table.isPivotTable()&&!i.indicatorsAsCol)){const t=i.getBody(o,e.table.columnHeaderLevelCount);if(null==t?void 0:t.disableColumnResize)continue}e.table.scenegraph.updateColWidth(o,t),e.table.internalProps._widthResizedColMap.add(o)}}(o,i):OM(o,i),i.columnResize.x=t,i.table.scenegraph.component.updateResizeCol(i.columnResize.col,e,i.columnResize.isRightFrozen),i.columnResize.col<i.table.frozenColCount&&!i.table.isPivotTable()&&!i.table.transpose?i.table.scenegraph.component.setFrozenColumnShadow(i.table.frozenColCount-1,i.columnResize.isRightFrozen):i.table.options.frozenColCount&&i.table.scenegraph.component.setFrozenColumnShadow(i.table.frozenColCount-1),(i.columnResize.col>=i.table.colCount-i.table.rightFrozenColCount&&!i.table.isPivotTable()&&!i.table.transpose||i.table.options.rightFrozenColCount)&&i.table.scenegraph.component.setRightFrozenColumnShadow(i.table.colCount-i.table.rightFrozenColCount),i.table.scenegraph.updateNextFrame()}(t,e,this)}endResizeRow(){setTimeout((()=>{this.rowResize.resizing=!1}),0),this.table.scenegraph.updateChartSizeForResizeRowHeight(this.rowResize.row),this.table.scenegraph.component.hideResizeRow(),this.table.scenegraph.updateNextFrame()}startResizeRow(t,e,i,o){var n;this.rowResize.resizing=!0,this.rowResize.row=t,this.rowResize.y=i,this.rowResize.isBottomFrozen=o,this.table.scenegraph.component.showResizeRow(t,e,o);const r=!!(null===(n=this.select.ranges)||void 0===n?void 0:n.length);this.updateSelectPos(-1,-1),this.endSelectCells(!0,r),this.table.scenegraph.updateNextFrame()}updateResizeRow(t,e){!function(t,e,i){t=Math.ceil(t),e=Math.ceil(e);let o=i.rowResize.isBottomFrozen?i.rowResize.y-e:e-i.rowResize.y;if(Math.abs(o)<1)return;i.table.getRowHeight(i.rowResize.row);let n=i.table.getRowHeight(i.rowResize.row)+o;if(n<i.table.internalProps.limitMinHeight&&(n=i.table.internalProps.limitMinHeight,o=n-i.table.getRowHeight(i.rowResize.row)),"adaptive"===i.table.heightMode&&i.rowResize.row<i.table.rowCount-1){let t=i.table.getRowHeight(i.rowResize.row+1);t-=o,t-o<i.table.internalProps.limitMinHeight&&(o=t-i.table.internalProps.limitMinHeight)}o=Math.ceil(o),i.rowResize.row<i.table.columnHeaderLevelCount||i.rowResize.row>=i.table.rowCount-i.table.bottomFrozenRowCount?DM(o,i):"indicator"===i.table.internalProps.rowResizeType?function(t,e){var i,o;const n=e.table.internalProps.layoutMap;let r,s,l;if(n.indicatorsAsCol){const t=n.getCellHeaderPaths(e.table.rowHeaderLevelCount-1,e.rowResize.row),o=null===(i=t.rowHeaderPaths)||void 0===i?void 0:i[t.rowHeaderPaths.length-1];s=null==o?void 0:o.dimensionKey,l=null==o?void 0:o.value}else r=n.getIndicatorKey(e.table.rowHeaderLevelCount,e.rowResize.row);for(let i=e.table.columnHeaderLevelCount;i<e.table.rowCount-e.table.bottomFrozenRowCount;i++){const a=n.getIndicatorKey(e.table.rowHeaderLevelCount,i);if(n.indicatorsAsCol||a!==r){if(n.indicatorsAsCol){const r=n.getCellHeaderPaths(e.table.rowHeaderLevelCount-1,i),a=null===(o=null==r?void 0:r.rowHeaderPaths)||void 0===o?void 0:o[r.rowHeaderPaths.length-1];a&&s===a.dimensionKey&&l===a.value&&(e.table.scenegraph.updateRowHeight(i,t),e.table.internalProps._heightResizedRowMap.add(i))}}else e.table.scenegraph.updateRowHeight(i,t),e.table.internalProps._heightResizedRowMap.add(i)}}(o,i):"indicatorGroup"===i.table.internalProps.rowResizeType?function(t,e){const i=e.table.internalProps.layoutMap,o=i.getCellHeaderPaths(e.table.rowHeaderLevelCount,e.rowResize.row),n=i.getHeadNodeByRowOrColDimensions(o.rowHeaderPaths.slice(0,o.rowHeaderPaths.length-1)),r=n.startInTotal+e.table.frozenRowCount,s=n.startInTotal+e.table.frozenRowCount+n.size-1,l=e.table.getRowsHeight(r,s),a=t;for(let t=r;t<=s;t++){let i=e.table.getRowHeight(t)/l*a;i>0&&i<.5?i=.5:i<0&&i>=-.5&&(i=-.51),e.table.scenegraph.updateRowHeight(t,i),e.table.internalProps._heightResizedRowMap.add(t)}}(o,i):"all"===i.table.internalProps.rowResizeType?function(t,e){for(let i=e.table.frozenRowCount;i<e.table.rowCount-e.table.bottomFrozenRowCount;i++)e.table.scenegraph.updateRowHeight(i,t),e.table.internalProps._heightResizedRowMap.add(i)}(o,i):DM(o,i),i.rowResize.y=e,i.table.scenegraph.component.updateResizeRow(i.rowResize.row,t,i.rowResize.isBottomFrozen),i.table.scenegraph.updateNextFrame()}(t,e,this)}startFillSelect(t,e){this.fillHandle.isFilling=!0,this.fillHandle.startX=t,this.fillHandle.startY=e;const i=this.select.ranges[this.select.ranges.length-1];this.fillHandle.beforeFillMinCol=Math.min(i.start.col,i.end.col),this.fillHandle.beforeFillMinRow=Math.min(i.start.row,i.end.row),this.fillHandle.beforeFillMaxCol=Math.max(i.start.col,i.end.col),this.fillHandle.beforeFillMaxRow=Math.max(i.start.row,i.end.row),this.table.fireListeners(Xw.MOUSEDOWN_FILL_HANDLE,{})}endFillSelect(){this.fillHandle.isFilling=!1,this.fillHandle.startX=void 0,this.fillHandle.startY=void 0,this.fillHandle.directionRow=void 0;const t=Math.min(this.select.ranges[0].start.col,this.select.ranges[0].end.col),e=Math.min(this.select.ranges[0].start.row,this.select.ranges[0].end.row),i=Math.max(this.select.ranges[0].start.col,this.select.ranges[0].end.col),o=Math.max(this.select.ranges[0].start.row,this.select.ranges[0].end.row);this.fillHandle.beforeFillMinCol===t&&this.fillHandle.beforeFillMinRow===e&&this.fillHandle.beforeFillMaxCol===i&&this.fillHandle.beforeFillMaxRow===o||this.table.eventManager.isDraging&&this.table.fireListeners(Xw.DRAG_FILL_HANDLE_END,{direction:this.fillHandle.direction}),this.fillHandle.beforeFillMaxCol=void 0,this.fillHandle.beforeFillMaxRow=void 0,this.fillHandle.beforeFillMinCol=void 0,this.fillHandle.beforeFillMinRow=void 0}startMoveCol(t,e,i,o,n){(function(t,e,i,o,n){var r;if(!("canMoveHeaderPosition"in n.table.internalProps.layoutMap))return;n.columnMove.moving=!0,n.columnMove.colSource=t,n.columnMove.rowSource=e,n.columnMove.x=i-n.table.tableX,n.columnMove.y=o-n.table.tableY;const s=n.table.getCellLocation(t,e),l="columnHeader"===s?n.columnMove.x:"rowHeader"===s||n.table.internalProps.layoutMap.isSeriesNumberInBody(t,e)?n.columnMove.y:0;n.table.scenegraph.component.showMoveCol(t,e,l);const a=!!(null===(r=n.select.ranges)||void 0===r?void 0:r.length);n.table.stateManager.updateSelectPos(-1,-1),n.table.stateManager.endSelectCells(!0,a),n.table.scenegraph.updateNextFrame()})(t,e,i,o,this),this.table.fireListeners(Xw.CHANGE_HEADER_POSITION_START,{col:t,row:e,x:i,y:o,event:n})}updateMoveCol(t,e,i,o){!function(t,e,i,o,n){if(!("canMoveHeaderPosition"in n.table.internalProps.layoutMap))return;const r=function(t,e,i){const o=i.getCellRange(t.col,t.row);if(i.isColumnHeader(t.col,t.row)){const n=i.getCellRange(e.col,o.start.row);e.row>=i.columnHeaderLevelCount&&(e.row=i.columnHeaderLevelCount-1),e.col>=t.col?e.col=n.end.col:e.col=n.start.col}else if(i.isRowHeader(t.col,t.row)){const n=i.internalProps.layoutMap,r=i.getCellRange(o.start.col,e.row);if(e.col>=i.rowHeaderLevelCount+n.leftRowSeriesNumberColumnCount&&(e.col=i.rowHeaderLevelCount+n.leftRowSeriesNumberColumnCount-1),"tree"===n.rowHierarchyType){const o=n.getCellHeaderPathsWithTreeNode(t.col,t.row).rowHeaderPaths,r=n.getCellHeaderPathsWithTreeNode(e.col,e.row).rowHeaderPaths;if(o.length<=r.length){const n=r[o.length-1];n&&(e.row>=t.row?e.row=n.startInTotal+n.size-1+i.columnHeaderLevelCount:e.row=n.startInTotal+i.columnHeaderLevelCount)}}else e.row>=t.row?e.row=r.end.row:e.row=r.start.row}return e}({col:n.columnMove.colSource,row:n.columnMove.rowSource},{col:t,row:e},n.table);if(n.table.internalProps.layoutMap.canMoveHeaderPosition({col:n.columnMove.colSource,row:n.columnMove.rowSource},{col:r.col,row:r.row})){let s,l,a,h;n.columnMove.x=i-n.table.tableX,n.columnMove.y=o-n.table.tableY,n.columnMove.colTarget=r.col,n.columnMove.rowTarget=r.row,n.updateCursor("grabbing");const d=n.table.getCellLocation(n.columnMove.colSource,n.columnMove.rowSource);"columnHeader"===d?(l=n.columnMove.x,s=n.table.isLeftFrozenColumn(t)?n.columnMove.colTarget>=n.columnMove.colSource?n.table.getColsWidth(0,n.columnMove.colTarget):n.table.getColsWidth(0,n.columnMove.colTarget-1):n.table.isRightFrozenColumn(t)?n.table.tableNoFrameWidth-n.table.getColsWidth(r.col+1,n.table.colCount-1):(n.columnMove.colTarget>=n.columnMove.colSource?n.table.getColsWidth(0,n.columnMove.colTarget):n.table.getColsWidth(0,n.columnMove.colTarget-1))-n.table.stateManager.scroll.horizontalBarPos):("rowHeader"===d||n.table.internalProps.layoutMap.isSeriesNumberInBody(t,e))&&(h=n.columnMove.y,a=n.table.isFrozenRow(e)?n.columnMove.rowTarget>=n.columnMove.rowSource?n.table.getRowsHeight(0,n.columnMove.rowTarget):n.table.getRowsHeight(0,n.columnMove.rowTarget-1):n.table.isBottomFrozenRow(e)?n.table.tableNoFrameHeight-n.table.getRowsHeight(r.row+1,n.table.rowCount-1):(n.columnMove.rowTarget>=n.columnMove.rowSource?n.table.getRowsHeight(0,n.columnMove.rowTarget):n.table.getRowsHeight(0,n.columnMove.rowTarget-1))-n.table.stateManager.scroll.verticalBarPos),n.table.scenegraph.component.updateMoveCol(l,s,h,a),n.table.scenegraph.updateNextFrame()}else n.updateCursor("not-allowed"),n.columnMove.colTarget=n.columnMove.colSource,n.columnMove.rowTarget=n.columnMove.rowSource}(t,e,i,o,this)}isMoveCol(){return this.columnMove.moving}endMoveCol(){return function(t){var e,i;let o=!1;if("canMoveHeaderPosition"in t.table.internalProps.layoutMap&&t.columnMove.moving&&t.columnMove.colSource>=0&&t.columnMove.rowSource>=0&&t.columnMove.colTarget>=0&&t.columnMove.rowTarget>=0&&!0!==(null===(e=t.table.options.customConfig)||void 0===e?void 0:e.notUpdateInColumnRowMove)){const e=t.table.getCellRange(t.columnMove.colSource,t.columnMove.rowSource),i=t.table.getCellRange(t.columnMove.colTarget,t.columnMove.rowTarget),n=t.table._moveHeaderPosition({col:t.columnMove.colSource,row:t.columnMove.rowSource},{col:t.columnMove.colTarget,row:t.columnMove.rowTarget});if(!n||n.targetIndex===n.sourceIndex)return t.updateCursor(),t.columnMove.moving=!1,delete t.columnMove.colSource,delete t.columnMove.rowSource,delete t.columnMove.colTarget,delete t.columnMove.rowTarget,t.table.scenegraph.component.hideMoveCol(),t.table.scenegraph.updateNextFrame(),!1;{t.table.internalProps.useOneRowHeightFillAll=!1,t.table.internalProps.layoutMap.clearCellRangeMap();const r=t.table.getCellRange(t.columnMove.colSource,t.columnMove.rowSource),s=t.table.getCellRange(t.columnMove.colTarget,t.columnMove.rowTarget),l=Math.min(r.start.col,s.start.col,e.start.col,i.start.col),a=Math.max(r.end.col,s.end.col,e.end.col,i.end.col),h=Math.min(r.start.row,s.start.row,e.start.row,i.start.row);let d=Math.max(r.end.row,s.end.row,e.end.row,i.end.row);"row"===n.moveType&&"tree"===t.table.internalProps.layoutMap.rowHierarchyType&&(d=n.targetIndex>n.sourceIndex?d+n.targetSize-1:d+n.sourceSize-1),!t.table.transpose&&t.table.internalProps.layoutMap.isSeriesNumberInBody(t.columnMove.colSource,t.columnMove.rowSource)&&(t.table.changeRecordOrder(n.sourceIndex,n.targetIndex),t.changeCheckboxAndRadioOrder(n.sourceIndex,n.targetIndex)),"column"===n.moveType?zM(l,a,0,-1,t.table):zM(0,-1,h,d,t.table),t.table.clearCellStyleCache(),t.table.internalProps.layoutMap.isSeriesNumberInBody(t.columnMove.colSource,t.columnMove.rowSource)?t.table.scenegraph.updateHeaderPosition(t.table.scenegraph.proxy.colStart,t.table.scenegraph.proxy.colEnd,t.table.scenegraph.proxy.rowStart,t.table.scenegraph.proxy.rowEnd,n.moveType):"column"===n.moveType?t.table.scenegraph.updateHeaderPosition(l,a,0,-1,n.moveType):t.table.scenegraph.updateHeaderPosition(0,-1,h,d,n.moveType),"adjustFrozenCount"===t.table.internalProps.frozenColDragHeaderMode&&t.table.isListTable()&&(t.table.isLeftFrozenColumn(t.columnMove.colTarget)&&!t.table.isLeftFrozenColumn(t.columnMove.colSource)?t.table.frozenColCount+=r.end.col-r.start.col+1:t.table.isLeftFrozenColumn(t.columnMove.colSource)&&!t.table.isLeftFrozenColumn(t.columnMove.colTarget)&&(t.table.frozenColCount-=r.end.col-r.start.col+1),t.table.isRightFrozenColumn(t.columnMove.colTarget)&&!t.table.isRightFrozenColumn(t.columnMove.colSource)?t.table.rightFrozenColCount+=r.end.col-r.start.col+1:t.table.isRightFrozenColumn(t.columnMove.colSource)&&!t.table.isRightFrozenColumn(t.columnMove.colTarget)&&(t.table.rightFrozenColCount-=r.end.col-r.start.col+1)),o=!0}}return setTimeout((()=>{t.columnMove.moving=!1,delete t.columnMove.colSource,delete t.columnMove.rowSource,delete t.columnMove.colTarget,delete t.columnMove.rowTarget}),0),t.table.scenegraph.component.hideMoveCol(),t.columnResize.col<t.table.frozenColCount&&!t.table.isPivotTable()&&!t.table.transpose?(t.table.scenegraph.component.setFrozenColumnShadow(t.table.frozenColCount-1,t.columnResize.isRightFrozen),t.table.scenegraph.component.setRightFrozenColumnShadow(t.table.colCount-t.table.rightFrozenColCount)):t.columnResize.col>=t.table.colCount-t.table.rightFrozenColCount&&!t.table.isPivotTable()&&!t.table.transpose?t.table.scenegraph.component.setRightFrozenColumnShadow(t.table.colCount-t.table.rightFrozenColCount):t.table.options.frozenColCount?t.table.scenegraph.component.setFrozenColumnShadow(t.table.frozenColCount-1):t.table.options.rightFrozenColCount&&t.table.scenegraph.component.setRightFrozenColumnShadow(t.table.colCount-t.table.rightFrozenColCount),t.table.scenegraph.updateNextFrame(),!0===(null===(i=t.table.options.customConfig)||void 0===i?void 0:i.notUpdateInColumnRowMove)||o}(this)}checkFrozen(){var t,e,i;let o=this.table.isListTable()&&!this.table.internalProps.transpose?this.table.options.frozenColCount:this.table.isPivotChart()?null!==(t=this.table.rowHeaderLevelCount)&&void 0!==t?t:0:Math.max((null!==(e=this.table.rowHeaderLevelCount)&&void 0!==e?e:0)+this.table.internalProps.layoutMap.leftRowSeriesNumberColumnCount,null!==(i=this.table.options.frozenColCount)&&void 0!==i?i:0);if(o){if(o>this.table.colCount&&(o=this.table.colCount),this.table.tableNoFrameWidth-this.table.getColsWidth(0,o-1)<=120)return this.table._setFrozenColCount(0),this.setFrozenCol(-1),!1;if(this.table.frozenColCount!==o)return this.table._setFrozenColCount(o),this.setFrozenCol(o),!1}return!0}setFrozenCol(t){t!==this.frozen.col?(this.frozen.col=t,this.table.scenegraph.updateFrozen(),this.table.scenegraph.updateFrozenIcon(0,this.table.colCount-1)):this.table.scenegraph.updateFrozenIcon(0,this.table.colCount-1)}checkVerticalScrollBarEnd(){var t,e;const i=this.table.getAllRowsHeight(),o=this.scroll.verticalBarPos,n=this.table.tableNoFrameHeight;o+n>=i&&this.table.fireListeners(Xw.SCROLL_VERTICAL_END,{scrollTop:o,scrollLeft:this.scroll.horizontalBarPos,scrollHeight:null===(t=this.table.theme.scrollStyle)||void 0===t?void 0:t.width,scrollWidth:null===(e=this.table.theme.scrollStyle)||void 0===e?void 0:e.width,viewHeight:n,viewWidth:this.table.tableNoFrameWidth})}checkHorizontalScrollBarEnd(){var t,e;const i=this.table.getAllColsWidth(),o=this.scroll.horizontalBarPos,n=this.table.tableNoFrameWidth;o+n>=i&&this.table.fireListeners(Xw.SCROLL_HORIZONTAL_END,{scrollTop:this.scroll.verticalBarPos,scrollLeft:o,scrollHeight:null===(t=this.table.theme.scrollStyle)||void 0===t?void 0:t.width,scrollWidth:null===(e=this.table.theme.scrollStyle)||void 0===e?void 0:e.width,viewHeight:this.table.tableNoFrameHeight,viewWidth:n})}updateVerticalScrollBar(t){var e,i;const o=this.table.getAllRowsHeight(),n=this.scroll.verticalBarPos;this.scroll.verticalBarPos=Math.ceil(t*(o-this.table.scenegraph.height)),Q(this.scroll.verticalBarPos)&&!isNaN(this.scroll.verticalBarPos)||(this.scroll.verticalBarPos=0),this.table.scenegraph.setY(-this.scroll.verticalBarPos,1===t),this.scroll.verticalBarPos-=this.table.scenegraph.proxy.deltaY,this.table.scenegraph.proxy.deltaY=0,this.updateHoverPos(-1,-1),this.table.fireListeners(Xw.SCROLL,{event:void 0,scrollTop:this.scroll.verticalBarPos,scrollLeft:this.scroll.horizontalBarPos,scrollHeight:null===(e=this.table.theme.scrollStyle)||void 0===e?void 0:e.width,scrollWidth:null===(i=this.table.theme.scrollStyle)||void 0===i?void 0:i.width,viewHeight:this.table.tableNoFrameHeight,viewWidth:this.table.tableNoFrameWidth,scrollDirection:"vertical",scrollRatioY:t}),n!==this.scroll.verticalBarPos&&this.checkVerticalScrollBarEnd()}updateHorizontalScrollBar(t){var e,i;const o=this.table.getAllColsWidth(),n=this.scroll.horizontalBarPos;this.scroll.horizontalBarPos=Math.ceil(t*(o-this.table.scenegraph.width)),Q(this.scroll.horizontalBarPos)&&!isNaN(this.scroll.horizontalBarPos)||(this.scroll.horizontalBarPos=0),this.table.scenegraph.setX(-this.scroll.horizontalBarPos,1===t),this.scroll.horizontalBarPos-=this.table.scenegraph.proxy.deltaX,this.table.scenegraph.proxy.deltaX=0,this.updateHoverPos(-1,-1),this.table.fireListeners(Xw.SCROLL,{event:void 0,scrollTop:this.scroll.verticalBarPos,scrollLeft:this.scroll.horizontalBarPos,scrollHeight:null===(e=this.table.theme.scrollStyle)||void 0===e?void 0:e.width,scrollWidth:null===(i=this.table.theme.scrollStyle)||void 0===i?void 0:i.width,viewHeight:this.table.tableNoFrameHeight,viewWidth:this.table.tableNoFrameWidth,scrollDirection:"horizontal",scrollRatioX:t}),n!==this.scroll.horizontalBarPos&&this.checkHorizontalScrollBarEnd()}setScrollTop(t,e){let i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];var o,n,r;const s=this.table.getAllRowsHeight(),l=(null===(o=this.table.options.customConfig)||void 0===o?void 0:o._disableColumnAndRowSizeRound)?1:0;t=Math.max(0,Math.min(t,s-this.table.scenegraph.height-l)),((t=Math.ceil(t))!==this.scroll.verticalBarPos||this.table.isPivotChart())&&this.updateHoverPos(-1,-1);const a=this.scroll.verticalBarPos;this.scroll.verticalBarPos=t,Q(this.scroll.verticalBarPos)&&!isNaN(this.scroll.verticalBarPos)||(this.scroll.verticalBarPos=0),this.table.scenegraph.setY(-t);const h=t/(s-this.table.scenegraph.height);this.table.scenegraph.component.updateVerticalScrollBarPos(h),a!==t&&i&&(this.table.fireListeners(Xw.SCROLL,{event:null==e?void 0:e.nativeEvent,scrollTop:this.scroll.verticalBarPos,scrollLeft:this.scroll.horizontalBarPos,scrollHeight:null===(n=this.table.theme.scrollStyle)||void 0===n?void 0:n.width,scrollWidth:null===(r=this.table.theme.scrollStyle)||void 0===r?void 0:r.width,viewHeight:this.table.tableNoFrameHeight,viewWidth:this.table.tableNoFrameWidth,scrollDirection:"vertical",scrollRatioY:h}),this.checkVerticalScrollBarEnd())}setScrollLeft(t,e){let i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];var o,n,r;this.table.scrollLeft;const s=this.table.getAllColsWidth(),l=(this.table.getFrozenColsWidth(),(null===(o=this.table.options.customConfig)||void 0===o?void 0:o._disableColumnAndRowSizeRound)?1:0);t=Math.max(0,Math.min(t,s-this.table.scenegraph.width-l)),(t=Math.ceil(t))!==this.scroll.horizontalBarPos&&this.updateHoverPos(-1,-1);const a=this.scroll.horizontalBarPos;this.scroll.horizontalBarPos=t,Q(this.scroll.horizontalBarPos)&&!isNaN(this.scroll.horizontalBarPos)||(this.scroll.horizontalBarPos=0),this.table.scenegraph.setX(-t);const h=t/(s-this.table.scenegraph.width);this.table.scenegraph.component.updateHorizontalScrollBarPos(h),a!==t&&i&&(this.table.fireListeners(Xw.SCROLL,{event:null==e?void 0:e.nativeEvent,scrollTop:this.scroll.verticalBarPos,scrollLeft:this.scroll.horizontalBarPos,scrollHeight:null===(n=this.table.theme.scrollStyle)||void 0===n?void 0:n.width,scrollWidth:null===(r=this.table.theme.scrollStyle)||void 0===r?void 0:r.width,viewHeight:this.table.tableNoFrameHeight,viewWidth:this.table.tableNoFrameWidth,scrollDirection:"horizontal",scrollRatioX:h}),this.checkHorizontalScrollBarEnd())}hideVerticalScrollBar(){this.table.scenegraph.component.hideVerticalScrollBar()}showVerticalScrollBar(t){this.table.scenegraph.component.showVerticalScrollBar(),t&&(clearTimeout(this._clearVerticalScrollBar),this._clearVerticalScrollBar=setTimeout((()=>{var t;null===(t=this.table.scenegraph)||void 0===t||t.component.hideVerticalScrollBar()}),1e3))}hideHorizontalScrollBar(){this.table.scenegraph.component.hideHorizontalScrollBar()}showHorizontalScrollBar(t){this.table.scenegraph.component.showHorizontalScrollBar(),t&&(clearTimeout(this._clearHorizontalScrollBar),this._clearHorizontalScrollBar=setTimeout((()=>{var t;null===(t=this.table.scenegraph)||void 0===t||t.component.hideHorizontalScrollBar()}),1e3))}triggerContextMenu(t,e,i,o){this.menu.isShow&&this.menu.x===i&&this.menu.y===o?this.hideMenu():this.showContextMenu(t,e,i,o)}showContextMenu(t,e,i,o){var n;(null===(n=this.table.internalProps.menu)||void 0===n?void 0:n.contextMenuItems)&&("html"===this.table.internalProps.menu.renderMode?this.menu.isShow=!0:(this.menu.isShow=!0,this.menu.x=i,this.menu.y=o,this.table.scenegraph.component.menu.attach(i,o,t,e,WA.contextmenu)),this.table.fireListeners(Xw.SHOW_MENU,{x:i,y:o,col:t,row:e,type:"contextmenu"}))}triggerDropDownMenu(t,e,i,o,n){this.table.fireListeners(Xw.DROPDOWN_ICON_CLICK,{col:t,row:e,event:n}),this.menu.isShow?this.hideMenu():this.showDropDownMenu(t,e,i,o)}showDropDownMenu(t,e,i,o){"html"===this.table.internalProps.menu.renderMode?this.menu.isShow=!0:(this.menu.isShow=!0,this.table.scenegraph.component.menu.attach(i,o,t,e,WA.dropDown),this.menu.bounds=this.table.scenegraph.component.menu.bounds),this.table.fireListeners(Xw.SHOW_MENU,{x:i,y:o,col:t,row:e,type:"dropDown"}),this.residentHoverIcon&&this.table.scenegraph.setIconNormalStyle(this.residentHoverIcon.icon,this.residentHoverIcon.col,this.residentHoverIcon.row);const n=this.table.scenegraph.getCell(t,e);let r;n.forEachChildren((t=>t.attribute.funcType===VC.dropDown&&(r=t,!0))),r&&(this.residentHoverIcon={col:t,row:e,icon:r},this.table.scenegraph.setIconHoverStyle(this.residentHoverIcon.icon,this.residentHoverIcon.col,this.residentHoverIcon.row,n),this.table.scenegraph.residentHoverIcon(t,e))}hideMenu(){this.menu.isShow&&(this.table.fireListeners(Xw.DROPDOWN_MENU_CLEAR,null),this.table.fireListeners(Xw.HIDE_MENU,null),this.menu.isShow=!1,this.table.scenegraph.component.menu.detach(),this.residentHoverIcon&&(this.table.scenegraph.setIconNormalStyle(this.residentHoverIcon.icon,this.residentHoverIcon.col,this.residentHoverIcon.row),this.table.scenegraph.resetResidentHoverIcon(this.residentHoverIcon.col,this.residentHoverIcon.row),this.residentHoverIcon=null))}setDropDownMenuHighlight(t){this.menu.dropDownMenuHighlight=t;for(let e=0;e<t.length;e++){const{col:i,row:o}=t[e],n=this.table.getCellRange(i,o);if(n)for(let t=n.start.col;t<=n.end.col;t++)for(let e=n.start.row;e<=n.end.row;e++)this.table.scenegraph.updateCellContent(t,e)}}dropDownMenuIsHighlight(t,e,i){const o=this.menu.dropDownMenuHighlight;if(Array.isArray(o))for(let n=0;n<o.length;n++){const r=o[n];let{col:s,row:l}=r;const{field:a,menuKey:h}=r;if("number"!=typeof s||"number"!=typeof l)if(this.table.isPivotTable()){const t=this.table.internalProps.layoutMap.getPivotCellAdress(a);if(!t)continue;s=t.col,l=t.row}else{const t=this.table.internalProps.layoutMap.getHeaderCellAddressByField(a);if(!t)continue;s=t.col,l=t.row}if(Q(s)&&Q(l)&&this.table.isCellRangeEqual(t,e,s,l)){const o=this.table._getHeaderLayoutMap(null!=s?s:t,null!=l?l:e).dropDownMenu||this.table.globalDropDownMenu;if(o)for(let t=0;t<o.length;t++){const e=o[t];if(tt(e)&&(e.menuKey||e.text)===(h||"")&&t===i)return!0;if(nt(e)&&e===h&&t===i)return!0}}}return!1}triggerSort(t,e,i,o){if(this.table.isPivotTable()){const i=this.table.getPivotSortState(t,e),n=i?i.toUpperCase():"NORMAL",r="ASC"===n?"DESC":"DESC"===n?"NORMAL":"ASC";return this.table.sort(t,e,r),void this.table.fireListeners(FM.PIVOT_SORT_CLICK,{col:t,row:e,order:n||"normal",dimensionInfo:this.table.internalProps.layoutMap.getPivotDimensionInfo(t,e),cellLocation:this.table.getCellLocation(t,e),event:o})}const n=[...this.sort],r=this.table.internalProps.multipleSort||!n.length?null:this.sort[this.sort.length-1];EM(t,e,this.table,o);const s=this.table.getCellRange(t,e),l=this.sort.find((t=>t.col===s.start.col&&t.row===s.start.row)),a=this.table.internalProps.multipleSort||!r?null:r.col,h=this.table.internalProps.multipleSort||!r?null:r.row,d=n.findIndex((i=>i.col===t&&i.row===e));d>=0&&n.splice(d,1),this.table.scenegraph.updateSortIcon({col:t,row:e,iconMark:i,order:null==l?void 0:l.order,oldSortCol:a,oldSortRow:h,oldIconMark:null==r?void 0:r.icon}),l&&(l.icon=i),this.table.internalProps.multipleSort||n.forEach((t=>{this.table.scenegraph.updateSortIcon({col:null,row:null,iconMark:null,order:"normal",oldSortCol:t.col,oldSortRow:t.row,oldIconMark:null})})),this.table.fireListeners(FM.AFTER_SORT,{order:null==l?void 0:l.order,field:this.table.getHeaderField(t,e),event:o})}updateSortState(t){var e,i,o,n,r,s,l,a;t=Array.isArray(t)?t:[t];for(let a=0;a<t.length;a++){if(t[a].field===(null===(e=this.sort[a])||void 0===e?void 0:e.field)&&t[t.length-1].order===(null===(i=this.sort[a])||void 0===i?void 0:i.order))return;const h=this.table.internalProps.multipleSort?null:(null===(o=this.sort[a])||void 0===o?void 0:o.col)||null,d=this.table.internalProps.multipleSort?null:(null===(n=this.sort[a])||void 0===n?void 0:n.row)||null;"asc"===(null===(r=this.sort[a])||void 0===r?void 0:r.order)||null===(s=this.sort[a])||void 0===s||s.order,this.setSortState(t.slice(0,a+1));const c=this.table.internalProps.layoutMap.getHeaderCellAddressByField(t[a].field);let u;this.sort[a].col=c.col,this.sort[a].row=c.row,ww(this.table.scenegraph.getCell(this.sort[a].col,this.sort[a].row),"children",(t=>"sort"===t.attribute.funcType&&(u=t,!0))),this.table.scenegraph.updateSortIcon({col:this.sort[a].col,row:this.sort[a].row,iconMark:u,order:this.sort[a].order,oldSortCol:h,oldSortRow:d,oldIconMark:null===(l=this.sort[a])||void 0===l?void 0:l.icon})}const h=[];this.table.internalProps.layoutMap.columnTree.tree.children.forEach((e=>{t.some((t=>t.field===e.field))||h.push(e)}));for(let t=0;t<h.length;t++){const e=h[t];this.table.scenegraph.updateSortIcon({col:null,row:null,iconMark:null,order:null,oldSortCol:null!==(a=e.startInTotal+this.table.internalProps.layoutMap.leftRowSeriesNumberColumnCount)&&void 0!==a?a:0,oldSortRow:e.level,oldIconMark:null})}}triggerFreeze(t,e,i){if(!this.table.isPivotTable()&&!this.table.transpose){if(function(t,e,i){i.frozenColCount>0?t!==i.frozenColCount-1?i.setFrozenColCount(t+1):i.setFrozenColCount(0):i.setFrozenColCount(t+1)}(t,0,this.table),this.table.hasListeners(FM.FREEZE_CLICK)){const i=this.table.internalProps.layoutMap.columnObjects.slice(0,t+1);this.table.fireListeners(FM.FREEZE_CLICK,{col:t,row:e,fields:i.reduce(((t,e)=>t.concat(e.field)),[]),colCount:this.table.frozenColCount})}this.frozen.icon=i}}updateCursor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";this.table.getElement().style.cursor=t}updateDrillState(t,e,i,o,n,r){this.drill.dimensionKey=t,this.drill.title=e,this.drill.drillDown=i,this.drill.drillUp=o,this.drill.col=n,this.drill.row=r,function(t,e,i,o,n){const r=n.getCellLocation(t,e);let s=0,l=0,a=!1;"columnHeader"===r?(s=n.getColsWidth(0,n.rowHeaderLevelCount-1)-(0===n.frozenColCount?n.scrollLeft:0),l=n.getRowsHeight(0,e-1)+n.getRowHeight(e)/2,a=!0):"rowHeader"===r&&(l=n.getRowsHeight(0,n.columnHeaderLevelCount-1),s=n.getColsWidth(0,t-1)+n.getColWidth(t)/2,a=!0),n.scenegraph.updateDrill(a,s,l,i,o)}(n,r,i,o,this.table)}updateSparklineHoverPose(t,e,i,o){-1!==this.sparkLine.col&&-1!==this.sparkLine.row&&function(t,e,i){const o=i.scenegraph.getCell(t,e).getChildByName("sparkline"),n=null==o?void 0:o.getChildByName("highlight-line"),r=null==o?void 0:o.getChildByName("highlight-symbol");n&&n.setAttributes({visible:!1,pickable:!1}),r&&r.setAttributes({visible:!1,pickable:!1}),i.scenegraph.updateNextFrame()}(this.sparkLine.col,this.sparkLine.row,this.table);let n=!1;-1!==t&&-1!==e&&(n=function(t,e,i,o,n){var r,s;const l=n.scenegraph.getCell(t,e).getChildByName("sparkline"),a=null==l?void 0:l.getChildByName("sparkline-line"),h=null==l?void 0:l.getChildByName("sparkline-symbol-group");if(!a)return!1;const d=a.bandwidth,c=a.min,u=a.max,g=a.attribute.points;let p;i-=l.globalAABBBounds.x1,l.globalAABBBounds.y1;for(let t=0;t<g.length;t++){const{x:e,y:o,defined:n,rawData:f}=g[t];if(Math.abs(i-e)<d/2&&(p={point:g[t],points:g,pointsBandWidth:d,pointData:f},n)){const t=l.getChildByName("highlight-line");if(t)t.setAttributes({points:[{x:e,y:u},{x:e,y:c}],visible:!0,pickable:!0});else{const t=oc({points:[{x:e,y:u},{x:e,y:c}],lineWidth:null===(r=a.hover)||void 0===r?void 0:r.strokeWidth,stroke:null===(s=a.hover)||void 0===s?void 0:s.stroke});t.name="highlight-line",l.addChild(t)}const i=l.getChildByName("highlight-symbol");if(i)i.setAttributes({x:e,y:o,visible:!0,pickable:!0});else{const t=tc({x:e,y:o,stroke:h.hover.stroke,lineWidth:h.hover.strokeWidth,fill:h.hover.fill,size:2*h.hover.size,symbolType:"circle"});t.name="highlight-symbol",l.addChild(t)}break}}if(n.scenegraph.updateNextFrame(),p){const i={col:t,row:e,field:n.getHeaderField(t,e),value:n.getCellValue(t,e),dataValue:n.getCellOriginValue(t,e),cellHeaderPaths:n.internalProps.layoutMap.getCellHeaderPaths(t,e),title:n.getBodyColumnDefine(t,e).title,cellRange:n.getCellRelativeRect(t,e),sparkline:{pointData:p.pointData},scaleRatio:n.canvas.getBoundingClientRect().width/n.canvas.offsetWidth};n.fireListeners(Xw.MOUSEOVER_CHART_SYMBOL,i)}return!0}(t,e,i,0,this.table)),n?(this.sparkLine.col=t,this.sparkLine.row=e):(this.sparkLine.col=-1,this.sparkLine.row=-1)}setCheckedState(t,e,i,o){return function(t,e,i,o,n){const r=n.table.getRecordShowIndexByCell(t,e);if(r>=0){const t=n.table.dataSource.getIndexKey(r);n.checkedState[t]||(n.checkedState[t]={}),n.checkedState[t][i]=o}}(t,e,i,o,this)}setHeaderCheckedState(t,e){return function(t,e,i){var o;i.headerCheckedState[t]=e,null===(o=i.checkedState)||void 0===o||o.forEach((i=>{i[t]=e}))}(t,e,this)}syncCheckedState(t,e,i,o){return function(t,e,i,o,n){var r,s;if(n.table.isHeader(t,e)){if(Q(n.headerCheckedState[i]))return n.headerCheckedState[i];if("function"==typeof o)return;if(Q(o))n.headerCheckedState[i]=o;else if((null===(r=n.checkedState)||void 0===r?void 0:r.length)>0)return n.updateHeaderCheckedState(i,t,e);return n.headerCheckedState[i]}const l=n.table.getRecordShowIndexByCell(t,e);if(l>=0){const t=n.table.dataSource.getIndexKey(l);if(Q(null===(s=n.checkedState[t])||void 0===s?void 0:s[i]))return n.checkedState[t][i];n.checkedState[t]||(n.checkedState[t]={}),n.checkedState[t][i]=o}return o}(t,e,i,o,this)}initCheckedState(t){return function(t,e){e.checkedState=[],e.headerCheckedState={},e.radioState={};let i=!1;e._checkboxCellTypeFields=[],e._headerCheckFuncs={},e.table.internalProps.layoutMap.headerObjects.forEach(((t,o)=>{if("checkbox"===t.headerType){const o=t.define.checked;null==o||"function"==typeof o?(i=!0,"function"==typeof o&&(e._headerCheckFuncs[t.field]=o)):e.headerCheckedState[t.field]=o,"checkbox"!==t.define.cellType||t.fieldFormat||e._checkboxCellTypeFields.push(t.field)}})),i&&t.forEach(((t,i)=>{e._checkboxCellTypeFields.forEach((o=>{const n=t[o];let r;if(tt(n)?r=n.checked:"boolean"==typeof n&&(r=n),null==r){const t=e._headerCheckFuncs[o];if(t){const s=e.table.getCellAddrByFieldRecord(o,i);r=Hw(t,{col:s.col,row:s.row,table:e.table,context:null,value:n})}}e.checkedState[i]||(e.checkedState[i]={}),e.checkedState[i][o]=r}))}))}(t,this)}updateHeaderCheckedState(t,e,i){return function(t,e,i,o){const n=e.checkedState.every(((n,r)=>{const s=e.table.getTableIndexByRecordIndex(r);return!!(e.table.transpose?e.table.getCustomMerge(s,o):e.table.getCustomMerge(i,s))||!0===(null==n?void 0:n[t])}));return n?(e.headerCheckedState[t]=!0,n):e.checkedState.every(((n,r)=>{const s=e.table.getTableIndexByRecordIndex(r);return!!(e.table.transpose?e.table.getCustomMerge(s,o):e.table.getCustomMerge(i,s))||!1===(null==n?void 0:n[t])}))?(e.headerCheckedState[t]=!1,!1):!!e.checkedState.find((e=>!0===(null==e?void 0:e[t])))&&(e.headerCheckedState[t]="indeterminate","indeterminate")}(t,this,e,i)}initLeftRecordsCheckState(t){return function(t,e){for(let i=e.checkedState.length;i<t.length;i++){const o=t[i];e._checkboxCellTypeFields.forEach((t=>{const n=o[t];let r;tt(n)?r=n.checked:"boolean"==typeof n&&(r=n),e.checkedState[i]||(e.checkedState[i]={}),e.checkedState[i][t]=r}))}}(t,this)}setRadioState(t,e,i,o,n){!function(t,e,i,o,n,r){const s=r.table.getRecordShowIndexByCell(t,e);if(s>=0){const t=r.table.dataSource.getIndexKey(s);"column"===o?at(n)?(r.radioState[i]={},r.radioState[i][t]=n):r.radioState[i]=t:(r.radioState[i]||(r.radioState[i]={}),at(n)?r.radioState[i][t]=n:r.radioState[i][t]=!0)}}(t,e,i,o,n,this)}syncRadioState(t,e,i,o,n,r){return function(t,e,i,o,n,r,s){var l,a,h,d,c;const u=s.table.getRecordShowIndexByCell(t,e);if(u>=0){const t=s.table.dataSource.getIndexKey(u);if("column"===o){if(!Q(s.radioState[i])&&r)return at(n)?(s.radioState[i]={},s.radioState[i][t]=n):s.radioState[i]=t,!0;if(at(s.radioState[i])&&!at(n))return s.radioState[i]===t;if(at(s.radioState[i])&&at(n))return!1;if(tt(s.radioState[i])&&!at(n))return!1;if(tt(s.radioState[i])&&at(n))return s.radioState[i][t]===n}else if("cell"===o){if(!Q(s.radioState[i])&&r)return s.radioState[i]={},at(n)?s.radioState[i][t]=n:s.radioState[i][t]=!0,!0;if(!Q(null===(l=s.radioState[i])||void 0===l?void 0:l[t])&&r)return at(n)?s.radioState[i][t]=n:s.radioState[i][t]=!0,!0;if(q(null===(a=s.radioState[i])||void 0===a?void 0:a[t])&&!at(n))return s.radioState[i][t];if(q(null===(h=s.radioState[i])||void 0===h?void 0:h[t])&&at(n))return!1;if(at(null===(d=s.radioState[i])||void 0===d?void 0:d[t])&&!at(n))return!1;if(at(null===(c=s.radioState[i])||void 0===c?void 0:c[t])&&at(n))return s.radioState[i][t]===n}}return r}(t,e,i,o,n,r,this)}changeCheckboxAndRadioOrder(t,e){this.checkedState.length&&function(t,e,i){const{checkedState:o,table:n}=i;if(n.internalProps.transpose?(t=n.getRecordShowIndexByCell(t,0),e=n.getRecordShowIndexByCell(e,0)):(t=n.getRecordShowIndexByCell(0,t),e=n.getRecordShowIndexByCell(0,e)),t>e){const i=o[t];for(let i=t;i>e;i--)o[i]=o[i-1];o[e]=i}else if(t<e){const i=o[t];for(let i=t;i<e;i++)o[i]=o[i+1];o[e]=i}}(t,e,this),this.radioState.length&&function(t,e,i){const{radioState:o,table:n}=i;if(n.internalProps.transpose?(t=n.getRecordShowIndexByCell(t,0),e=n.getRecordShowIndexByCell(e,0)):(t=n.getRecordShowIndexByCell(0,t),e=n.getRecordShowIndexByCell(0,e)),t>e){const i=o[t];for(let i=t;i>e;i--)o[i]=o[i-1];o[e]=i}else if(t<e){const i=o[t];for(let i=t;i<e;i++)o[i]=o[i+1];o[e]=i}}(t,e,this)}}(this),this.eventManager=new class{constructor(t){this.isDown=!1,this.isDraging=!1,this.globalEventListeners=[],this._enableTableScroll=!0,this.table=t,this.handleTextStickBindId=[],this.inertiaScroll=new VM(t.stateManager),"node"===sw.mode||t.options.disableInteraction||(this.bindOuterEvent(),setTimeout((()=>{this.bindSelfEvent()}),0))}bindOuterEvent(){UM(this),function(t){const e=t.table,i=e.stateManager,o=e.internalProps.handler;function n(t){var i;if(e.hasListeners(Xw.KEYDOWN)){const o={keyCode:null!==(i=t.keyCode)&&void 0!==i?i:t.which,code:t.code,event:t,scaleRatio:e.canvas.getBoundingClientRect().width/e.canvas.offsetWidth};e.fireListeners(Xw.KEYDOWN,o)}}o.on(e.getElement(),"blur",(e=>{t.dealTableHover()})),o.on(e.getElement(),"keydown",(o=>{var r,s,l,a,h,d,c,u,g,p,f,v,m,b,y,C,w,x,_;if("a"===o.key&&(o.ctrlKey||o.metaKey))(null===(r=e.keyboardOptions)||void 0===r?void 0:r.selectAllOnCtrlA)&&(o.preventDefault(),t.deelTableSelectAll());else if(i.select.cellPos.col>=0&&i.select.cellPos.row>=0&&("ArrowUp"===o.key||"ArrowDown"===o.key||"ArrowLeft"===o.key||"ArrowRight"===o.key)){if((null===(l=null===(s=e.options.keyboardOptions)||void 0===s?void 0:s.moveEditCellOnArrowKeys)||void 0===l||!l)&&(null===(a=e.editorManager)||void 0===a?void 0:a.editingEditor))return;let t,n;if(o.preventDefault(),o.stopPropagation(),"ArrowUp"===o.key?o.ctrlKey||o.metaKey?(t=i.select.cellPos.col,n=0):(o.shiftKey,t=i.select.cellPos.col,n=Math.min(e.rowCount-1,Math.max(0,i.select.cellPos.row-1))):"ArrowDown"===o.key?o.ctrlKey||o.metaKey?(t=i.select.cellPos.col,n=e.rowCount-1):(o.shiftKey,t=i.select.cellPos.col,n=Math.min(e.rowCount-1,Math.max(0,i.select.cellPos.row+1))):"ArrowLeft"===o.key?o.ctrlKey||o.metaKey?(t=0,n=i.select.cellPos.row):(o.shiftKey,n=i.select.cellPos.row,t=Math.min(e.colCount-1,Math.max(0,i.select.cellPos.col-1))):"ArrowRight"===o.key&&(o.ctrlKey||o.metaKey?(t=e.colCount-1,n=i.select.cellPos.row):(o.shiftKey,n=i.select.cellPos.row,t=Math.min(e.colCount-1,Math.max(0,i.select.cellPos.col+1)))),kB(e,t,n))return;e.selectCell(t,n,o.shiftKey),null!==(d=null===(h=e.options.keyboardOptions)||void 0===h?void 0:h.moveEditCellOnArrowKeys)&&void 0!==d&&d&&(null===(c=e.editorManager)||void 0===c?void 0:c.editingEditor)&&(e.editorManager.completeEdit(),e.getElement().focus(),e.getEditor(t,n)&&e.editorManager.startEditCell(t,n))}else if("Escape"===o.key)null===(u=e.editorManager)||void 0===u||u.cancelEdit();else if("Enter"===o.key){if(null===(g=e.editorManager)||void 0===g?void 0:g.editingEditor){if(n(o),e.editorManager.completeEdit(),e.getElement().focus(),!0===(null===(p=e.options.keyboardOptions)||void 0===p?void 0:p.moveFocusCellOnEnter)){const t=i.select.cellPos.col,n=Math.min(e.rowCount-1,Math.max(0,i.select.cellPos.row+1));if(kB(e,t,n))return;e.selectCell(t,n,o.shiftKey)}return}if(!0===(null===(f=e.options.keyboardOptions)||void 0===f?void 0:f.moveFocusCellOnEnter)){const t=i.select.cellPos.col,n=Math.min(e.rowCount-1,Math.max(0,i.select.cellPos.row+1));if(kB(e,t,n))return;e.selectCell(t,n,o.shiftKey)}else if((null===(m=null===(v=e.options.keyboardOptions)||void 0===v?void 0:v.editCellOnEnter)||void 0===m||m)&&1===(null!==(y=null===(b=e.stateManager.select.ranges)||void 0===b?void 0:b.length)&&void 0!==y?y:0)){const t=e.stateManager.select.ranges[0].start.col,i=e.stateManager.select.ranges[0].start.row,o=e.stateManager.select.ranges[0].end.col,n=e.stateManager.select.ranges[0].end.row;t===o&&i===n&&e.getEditor(t,i)&&e.editorManager.startEditCell(t,i)}}else if("Tab"===o.key){if((null===(w=null===(C=e.options.keyboardOptions)||void 0===C?void 0:C.moveFocusCellOnTab)||void 0===w||w)&&(o.preventDefault(),i.select.cellPos.col>=0&&i.select.cellPos.row>=0)){let t,o;if(i.select.cellPos.col===e.colCount-1?(o=Math.min(e.rowCount-1,i.select.cellPos.row+1),t=e.rowHeaderLevelCount):i.select.cellPos.row===e.rowCount-1?(o=e.rowCount-1,t=e.rowHeaderLevelCount):(o=i.select.cellPos.row,t=i.select.cellPos.col+1),kB(e,t,o))return;e.selectCell(t,o),(null===(x=e.editorManager)||void 0===x?void 0:x.editingEditor)&&(e.editorManager.completeEdit(),e.getElement().focus(),e.getEditor(t,o)&&e.editorManager.startEditCell(t,o))}}else if(!(o.ctrlKey||o.metaKey||o.shiftKey)){const t=e.options.editCellTrigger;if(("keydown"===t||Array.isArray(t)&&t.includes("keydown"))&&!(null===(_=e.editorManager)||void 0===_?void 0:_.editingEditor)){const t=/^[a-zA-Z0-9+\-*\/%=.,\s]$/;o.key.match(t)&&e.editorManager.startEditCell(i.select.cellPos.col,i.select.cellPos.row,"")}}n(o)})),o.on(e.getElement(),"copy",(t=>{var i,o;if(null===(i=e.keyboardOptions)||void 0===i?void 0:i.copySelected){const i=e.getCopyValue();if(Q(i)){if(t.preventDefault(),null===(o=navigator.clipboard)||void 0===o?void 0:o.write){const t=t=>{const e=["<table>"],i=['<meta name="author" content="Visactor"/>','<style type="text/css">td{white-space:normal}br{mso-data-placement:same-cell}</style>'].join(""),o=t.split("\r\n");return o.forEach((function(t,i){const n=t.split("\t"),r=[];0===i&&e.push("<tbody>"),n.forEach((function(t,e){const i=t?t.toString().replace(/&/g,"&amp;").replace(/'/g,"&#39;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\n/g,"<br>").replace(/(<br(\s*|\/)>(\r\n|\n)?|\r\n|\n)/g,"<br>\r\n").replace(/\x20{2,}/gi,(t=>`<span style="mso-spacerun: yes">${"&nbsp;".repeat(t.length-1)} </span>`)).replace(/\t/gi,"&#9;"):" ";r.push(`<td>${i}</td>`)})),e.push("<tr>",...r,"</tr>"),i===o.length-1&&e.push("</tbody>")})),e.push("</table>"),[i,e.join("")].join("")},e=t(i);navigator.clipboard.write([new ClipboardItem({"text/html":new Blob([e],{type:"text/html"}),"text/plain":new Blob([i],{type:"text/plain"})})])}else Nw?window.clipboardData.setData("Text",i):t.clipboardData.setData("text/plain",i);e.fireListeners(Xw.COPY_DATA,{cellRange:e.stateManager.select.ranges,copyData:i})}}})),o.on(e.getElement(),"paste",(t=>{var i,o,n,r;if((null===(i=e.keyboardOptions)||void 0===i?void 0:i.pasteValueToCell)&&e.changeCellValues){if(null===(o=e.editorManager)||void 0===o?void 0:o.editingEditor)return;if((null===(n=e.stateManager.select.ranges)||void 0===n?void 0:n.length)>0)if(null===(r=navigator.clipboard)||void 0===r?void 0:r.read)navigator.clipboard.read().then((t=>{for(const e of t)e.types.includes("text/html")?l(e):1===e.types.length&&"text/plain"===e.types[0]&&h(e)}));else{const i=e.stateManager.select.ranges,o=Math.min(i[0].start.col,i[0].end.col),n=Math.min(i[0].start.row,i[0].end.row),r=(t.clipboardData||window.Clipboard).getData("text").split("\n"),s=[];r.forEach((function(t,e){const i=t.split("\t"),o=[];s.push(o),i.forEach((function(t,e){e===i.length-1&&(t=t.trim()),o.push(t)}))})),e.changeCellValues(o,n,s)}}})),o.on(e.getElement(),"contextmenu",(t=>{var i;!1!==(null===(i=e.eventOptions)||void 0===i?void 0:i.preventDefaultContextMenu)&&t.preventDefault()})),e.options.canvas||o.on(e.getContainer(),"resize",(t=>{var i;0===t.width&&0===t.height||((e.autoFillWidth||e.autoFillHeight)&&(null===(i=e.editorManager)||void 0===i||i.completeEdit()),Q(e.options.pixelRatio)||e.setPixelRatio(qM()),t.windowSizeNotChange||e.resize())}));const r=/<tr[^>]*>([\s\S]*?)<\/tr>/g,s=/<td[^>]*>([\s\S]*?)<\/td>/g;function l(t){const i=e.stateManager.select.ranges,o=i.length,n=Math.min(i[o-1].start.col,i[o-1].end.col),l=Math.min(i[o-1].start.row,i[o-1].end.row),h=Math.max(i[o-1].start.col,i[o-1].end.col),c=Math.max(i[o-1].start.row,i[o-1].end.row);let u=0,g=0,p=[];t.getType("text/html").then((t=>{t.text().then((t=>{var i,o;if(t&&/(<table)|(<TABLE)/g.test(t)){const a=Array.from(t.matchAll(r));for(const t of a){const e=t[1],o=Array.from(e.matchAll(s)).map((t=>t[1].replace(/(<(?!br)([^>]+)>)/gi,"").replace(/<br(\s*|\/)>[\r\n]?/gim,"\n").replace(/&amp;/g,"&").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&#9;/gi,"\t").replace(/&nbsp;/g," ")));p.push(o),u=Math.max(u,null!==(i=null==o?void 0:o.length)&&void 0!==i?i:0)}g=null!==(o=p.length)&&void 0!==o?o:0,p=d(p,g,u,c-l+1,h-n+1),e.changeCellValues(n,l,p,!0)}else navigator.clipboard.read().then((t=>{for(const e of t)e.types.includes("text/plain")&&e.getType("text/plain").then((t=>{t.text().then(a)}))}))}))}))}function a(t){var i;const o=e.stateManager.select.ranges,n=o.length,r=Math.min(o[n-1].start.col,o[n-1].end.col),s=Math.min(o[n-1].start.row,o[n-1].end.row),l=Math.max(o[n-1].start.col,o[n-1].end.col),a=Math.max(o[n-1].start.row,o[n-1].end.row);let h=0,c=0,u=[];t.split("\n").forEach((function(t,e){var i;const o=t.split("\t"),n=[];u.push(n),o.forEach((function(t,e){e===o.length-1&&(t=t.trim()),n.push(t)})),h=Math.max(h,null!==(i=null==n?void 0:n.length)&&void 0!==i?i:0)})),c=null!==(i=u.length)&&void 0!==i?i:0,u=d(u,c,h,a-s+1,l-r+1),e.changeCellValues(r,s,u,!0)}function h(t){const i=e.stateManager.select.ranges,o=i.length,n=Math.min(i[o-1].start.col,i[o-1].end.col),r=Math.min(i[o-1].start.row,i[o-1].end.row),s=Math.max(i[o-1].start.col,i[o-1].end.col),l=Math.max(i[o-1].start.row,i[o-1].end.row);let a=0,h=0;t.getType("text/plain").then((t=>{t.text().then((t=>{var i;const o=t.replace(/\r(?!\n)/g,"\r\n").split("\r\n");let c=[];o.length>1&&""===o[o.length-1]&&o.pop(),o.forEach((function(t,e){var i;const o=t.split("\t"),n=[];c.push(n),o.forEach((function(t,e){t.includes("\n")&&(t=t.replace(/^"(.*)"$/,"$1").replace(/["]*/g,(t=>new Array(Math.floor(t.length/2)).fill('"').join("")))),n.push(t)})),a=Math.max(a,null!==(i=null==n?void 0:n.length)&&void 0!==i?i:0)})),h=null!==(i=c.length)&&void 0!==i?i:0,c=d(c,h,a,l-r+1,s-n+1),e.changeCellValues(n,r,c,!0)}))}))}function d(t,e,i,o,n){if(n>i||o>e){if(n%i==0&&o%e==0){const r=[];for(let s=0;s<o;s++){const o=[];r.push(o);for(let r=0;r<n;r++){const n=s%e,l=r%i;o.push(t[n][l])}}return r}return t}return t}const c=t=>{e.eventManager.LastBodyPointerXY={x:t.x,y:t.y},e.eventManager.isDown=!0};t.globalEventListeners.push({name:"pointerdown",env:"body",callback:c}),document.body.addEventListener("pointerdown",c);const u=t=>{t.target!==e.canvas&&(t=>{var o,n,r,s,l,a;if(i.menu.isShow&&setTimeout((()=>{e.internalProps.menuHandler.pointInMenuElement(t.clientX,t.clientY)||i.menu.isShow&&i.hideMenu()}),0),i.isResizeCol())XM(e);else if(i.isResizeRow())YM(e);else if(i.isMoveCol())e.stateManager.endMoveCol()&&-1!==(null===(o=e.stateManager.columnMove)||void 0===o?void 0:o.colSource)&&-1!==(null===(n=e.stateManager.columnMove)||void 0===n?void 0:n.rowSource)&&-1!==(null===(r=e.stateManager.columnMove)||void 0===r?void 0:r.colTarget)&&-1!==(null===(s=e.stateManager.columnMove)||void 0===s?void 0:s.rowTarget)&&e.hasListeners(Xw.CHANGE_HEADER_POSITION)&&e.fireListeners(Xw.CHANGE_HEADER_POSITION,{target:{col:e.stateManager.columnMove.colTarget,row:e.stateManager.columnMove.rowTarget},source:{col:e.stateManager.columnMove.colSource,row:e.stateManager.columnMove.rowSource},event:t});else if(i.isSelecting()&&(null===(a=null===(l=e.stateManager.select)||void 0===l?void 0:l.ranges)||void 0===a?void 0:a.length)){const i=e.stateManager.select.ranges[e.stateManager.select.ranges.length-1].end.col,o=e.stateManager.select.ranges[e.stateManager.select.ranges.length-1].end.row;if(e.stateManager.endSelectCells(),e.hasListeners(Xw.DRAG_SELECT_END)){const n={event:t,cells:[],col:i,row:o,scaleRatio:e.canvas.getBoundingClientRect().width/e.canvas.offsetWidth,target:void 0};n.cells=e.getSelectedCellInfos(),e.fireListeners(Xw.DRAG_SELECT_END,n)}}})(t),e.eventManager.LastBodyPointerXY=null,e.eventManager.isDown=!1,e.eventManager.isDraging=!1,e.eventManager.inertiaScroll.endInertia(),"grabing"===i.interactionState&&i.isResizeCol()?XM(e):"grabing"===i.interactionState&&i.isResizeRow()&&YM(e)};t.globalEventListeners.push({name:"pointerup",env:"document",callback:u}),document.addEventListener("pointerup",u);const g=o=>{var n,r,s,l,a;if(e.eventManager.isDown&&e.eventManager.LastBodyPointerXY){const t=null!==(r=null===(n=e.eventManager.LastBodyPointerXY)||void 0===n?void 0:n.x)&&void 0!==r?r:o.x,i=null!==(l=null===(s=e.eventManager.LastBodyPointerXY)||void 0===s?void 0:s.y)&&void 0!==l?l:o.y;(Math.abs(t-o.x)>1||Math.abs(i-o.y)>1)&&(e.eventManager.isDraging=!0)}const{x:h,y:d}=e._getMouseAbstractPoint(o,!1);i.interactionState===IC.grabing&&(i.isResizeCol()?(t.dealColumnResize(h,d),e.hasListeners(Xw.RESIZE_COLUMN)&&e.fireListeners(Xw.RESIZE_COLUMN,{col:e.stateManager.columnResize.col,colWidth:e.getColWidth(e.stateManager.columnResize.col)})):i.isResizeRow()&&(t.dealRowResize(h,d),e.hasListeners(Xw.RESIZE_ROW)&&e.fireListeners(Xw.RESIZE_ROW,{row:e.stateManager.rowResize.row,rowHeight:e.getRowHeight(e.stateManager.rowResize.row)})));const c=e.stateManager.isSelecting();if(t._enableTableScroll&&t.isDraging&&c&&(null===(a=e.stateManager.select.ranges)||void 0===a?void 0:a.length)>0){const t=e.getDrawRange(),i=e.getFrozenRowsHeight(),o=e.getBottomFrozenRowsHeight(),n=e.getFrozenColsWidth(),r=e.getRightFrozenColsWidth(),s=e.stateManager.select.ranges[e.stateManager.select.ranges.length-1].start;if(e.isSeriesNumber(s.col,s.row))return;const l=e.stateManager.select.ranges[e.stateManager.select.ranges.length-1].end,a=(!1===e.isFrozenRow(s.row)||!1===e.isFrozenRow(l.row))&&e.getAllRowsHeight()>e.tableNoFrameHeight,c=(!1===e.isFrozenColumn(s.col)||!1===e.isFrozenColumn(l.col))&&e.getAllColsWidth()>e.tableNoFrameWidth;if((d>t.bottom-o||d<t.top+i)&&a||(h>t.right-r||h<t.left+n)&&c){e.eventManager.scrollXSpeed=0,e.eventManager.scrollYSpeed=0;let s=!1,l=!1,u=!1,g=!1;d>t.bottom-o&&a&&e.scrollTop+e.tableNoFrameHeight<e.getAllRowsHeight()?(s=!0,e.eventManager.scrollYSpeed=-(d-t.bottom+o)/50):d<t.top+i&&a&&e.scrollTop>0&&(l=!0,e.eventManager.scrollYSpeed=-(d-t.top-i)/50),h>t.right-r&&c&&e.scrollLeft+e.tableNoFrameWidth<e.getAllColsWidth()?(u=!0,e.eventManager.scrollXSpeed=-(h-t.right+r)/50):h<t.left+n&&c&&e.scrollLeft>0&&(g=!0,e.eventManager.scrollXSpeed=-(h-t.left-n)/50),e.eventManager.inertiaScroll.startInertia(e.eventManager.scrollXSpeed,e.eventManager.scrollYSpeed,1),e.eventManager.inertiaScroll.setScrollHandle(((a,c)=>{let p,f;NM({deltaX:-a,deltaY:-c},e.stateManager,!1),s?f=e.scrollTop+t.height-o-20:l&&(f=e.scrollTop+i+20),u?p=e.scrollLeft+t.width-r-20:g&&(p=e.scrollLeft+n+20);let v=!1,m=!1;u||g||(h>e.tableNoFrameWidth-e.getRightFrozenColsWidth()&&h<e.tableNoFrameWidth||h>0&&h<e.getFrozenColsWidth()?(p=h,m=!0):p=e.scrollLeft+h),s||l||(d>e.tableNoFrameHeight-e.getBottomFrozenRowsHeight()&&d<e.tableNoFrameHeight||d>0&&d<e.getFrozenRowsHeight()?(f=d,v=!0):f=e.scrollTop+d),e.stateManager.updateInteractionState(IC.grabing);const b=e.getTargetColAtConsiderRightFrozen(p,m),y=e.getTargetRowAtConsiderBottomFrozen(f,v);Q(b)&&Q(y)&&e.stateManager.updateSelectPos(b.col,y.row,!1,!1,!1,!0)}))}else e.eventManager.inertiaScroll.isInertiaScrolling()?e.eventManager.inertiaScroll.endInertia():e.eventManager.scrollYSpeed=0}};t.globalEventListeners.push({name:"pointermove",env:"body",callback:g}),document.body.addEventListener("pointermove",g)}(this),function(t){const e=t.table,i=e.stateManager,o=e.scenegraph;o.component.vScrollBar.addEventListener("pointerover",(t=>{i.showVerticalScrollBar()})),o.component.hScrollBar.addEventListener("pointerover",(t=>{i.showHorizontalScrollBar()})),o.component.vScrollBar.addEventListener("pointerout",(t=>{i.interactionState!==IC.scrolling&&i.hideVerticalScrollBar()})),o.component.hScrollBar.addEventListener("pointerout",(t=>{i.interactionState!==IC.scrolling&&i.hideHorizontalScrollBar()})),o.component.vScrollBar.addEventListener("pointermove",(t=>{o.table.stateManager.updateCursor("default"),t.stopPropagation()})),o.component.vScrollBar.addEventListener("pointerdown",(t=>{t.stopPropagation(),o.table.hasListeners(Xw.MOUSEDOWN_TABLE)&&o.table.fireListeners(Xw.MOUSEDOWN_TABLE,{event:t.nativeEvent})})),o.component.vScrollBar.addEventListener("scrollDown",(t=>{var e;o.table.eventManager.LastBodyPointerXY={x:t.x,y:t.y},o.table.eventManager.isDown=!0,i.interactionState!==IC.scrolling&&i.updateInteractionState(IC.scrolling),o.table.stateManager.hideMenu(),null===(e=o.table.editorManager)||void 0===e||e.completeEdit(),o.table.hasListeners(Xw.MOUSEDOWN_TABLE)&&o.table.fireListeners(Xw.MOUSEDOWN_TABLE,{event:t.nativeEvent})})),o.component.vScrollBar.addEventListener("pointerup",(()=>{i.fastScrolling=!1,o.table.eventManager.isDraging=!1,i.interactionState===IC.scrolling&&i.updateInteractionState(IC.default)})),o.component.vScrollBar.addEventListener("pointerupoutside",(()=>{i.fastScrolling=!1,i.interactionState===IC.scrolling&&i.updateInteractionState(IC.default)})),o.component.vScrollBar.addEventListener("scrollUp",(t=>{o.table.eventManager.isDraging=!1})),o.component.hScrollBar.addEventListener("pointermove",(t=>{o.table.stateManager.updateCursor("default"),t.stopPropagation()})),o.component.hScrollBar.addEventListener("pointerdown",(t=>{t.stopPropagation(),o.table.hasListeners(Xw.MOUSEDOWN_TABLE)&&o.table.fireListeners(Xw.MOUSEDOWN_TABLE,{event:t.nativeEvent})})),o.component.hScrollBar.addEventListener("scrollDown",(t=>{var e;o.table.eventManager.LastBodyPointerXY={x:t.x,y:t.y},o.table.eventManager.isDown=!0,i.interactionState!==IC.scrolling&&i.updateInteractionState(IC.scrolling),o.table.stateManager.hideMenu(),null===(e=o.table.editorManager)||void 0===e||e.completeEdit(),o.table.hasListeners(Xw.MOUSEDOWN_TABLE)&&o.table.fireListeners(Xw.MOUSEDOWN_TABLE,{event:t.nativeEvent})})),o.component.hScrollBar.addEventListener("pointerup",(()=>{i.fastScrolling=!1,o.table.eventManager.isDraging=!1,i.interactionState===IC.scrolling&&i.updateInteractionState(IC.default)})),o.component.hScrollBar.addEventListener("pointerupoutside",(()=>{i.fastScrolling=!1,i.interactionState===IC.scrolling&&i.updateInteractionState(IC.default)})),o.component.hScrollBar.addEventListener("scrollUp",(t=>{o.table.eventManager.isDraging=!1}));const n=pw(i.updateVerticalScrollBar,20),r=pw(i.updateHorizontalScrollBar,20);o.component.vScrollBar.addEventListener("scrollDrag",(t=>{o.table.eventManager.isDown&&(o.table.eventManager.isDraging=!0),i.fastScrolling=!0,i.interactionState!==IC.scrolling&&i.updateInteractionState(IC.scrolling);const e=t.detail.value[0]/(1-t.detail.value[1]+t.detail.value[0]);n(e,t)})),o.component.hScrollBar.addEventListener("scrollDrag",(t=>{o.table.eventManager.isDown&&(o.table.eventManager.isDraging=!0),i.fastScrolling=!0,i.interactionState!==IC.scrolling&&i.updateInteractionState(IC.scrolling);const e=t.detail.value[0]/(1-t.detail.value[1]+t.detail.value[0]);r(e)}))}(this),function(t){const e=t.table,i=e.stateManager,o=e.scenegraph;t.touchMovePoints=[],e.scenegraph.tableGroup.addEventListener("touchstart",(e=>{e.target.isChildOf(o.component.vScrollBar)||e.target.isChildOf(o.component.vScrollBar)||(t.isTouchdown=!0,t.touchMovePoints.push({x:e.page.x,y:e.page.y,timestamp:Date.now()}))}));const n=o=>{var n,r;if(t.touchMove&&o.preventDefault(),t.isTouchdown&&ZM(o))if((null===(r=null===(n=t.downIcon)||void 0===n?void 0:n.attribute)||void 0===r?void 0:r.funcType)===VC.dragReorder)o.preventDefault();else if(t.touchMovePoints.length>4&&t.touchMovePoints.shift(),t.touchMovePoints.push({x:o.changedTouches[0].pageX,y:o.changedTouches[0].pageY,timestamp:Date.now()}),t._enableTableScroll){const n=-t.touchMovePoints[t.touchMovePoints.length-1].x+t.touchMovePoints[t.touchMovePoints.length-2].x,r=-t.touchMovePoints[t.touchMovePoints.length-1].y+t.touchMovePoints[t.touchMovePoints.length-2].y;NM({deltaX:n,deltaY:r},i),o.cancelable&&("none"===e.internalProps.overscrollBehavior||Math.abs(r)>=Math.abs(n)&&0!==r&&GM(r,i)||Math.abs(r)<=Math.abs(n)&&0!==n&&jM(n,i))&&o.preventDefault()}};window.addEventListener("touchmove",n,{passive:!1}),t.globalEventListeners.push({name:"touchmove",env:"window",callback:n});const r=i=>{var o,n,r,s;if(t.touchEnd=!0,t.touchMove=!1,t.isTouchdown&&ZM(i)){if((null===(n=null===(o=t.downIcon)||void 0===o?void 0:o.attribute)||void 0===n?void 0:n.funcType)===VC.dragReorder)i.preventDefault();else if((null===(r=t.touchMovePoints)||void 0===r?void 0:r.length)&&(t.touchMovePoints.length>4&&t.touchMovePoints.shift(),t.touchMovePoints.push({x:i.changedTouches[0].pageX,y:i.changedTouches[0].pageY,timestamp:Date.now()}),t._enableTableScroll)){const i=t.touchMovePoints[0],o=t.touchMovePoints[(null===(s=t.touchMovePoints)||void 0===s?void 0:s.length)-1],n=(o.x-i.x)/(o.timestamp-i.timestamp),r=(o.y-i.y)/(o.timestamp-i.timestamp);t.inertiaScroll.startInertia(n,r,.95),e.eventManager.inertiaScroll.setScrollHandle(((t,i)=>{NM({deltaX:-t,deltaY:-i},e.stateManager)}))}t.isTouchdown=!1,t.touchMovePoints=[]}};window.addEventListener("touchend",r),t.globalEventListeners.push({name:"touchend",env:"window",callback:r});const s=e=>{t.touchEnd=!0,t.touchMove=!1,t.isTouchdown&&(t.isTouchdown=!1,t.touchMovePoints=[])};window.addEventListener("touchcancel",s),t.globalEventListeners.push({name:"touchcancel",env:"window",callback:s})}(this),$M(this)}updateEventBinder(){setTimeout((()=>{var t;this.table.isReleased||(GR(this.table)&&0===(null===(t=this.handleTextStickBindId)||void 0===t?void 0:t.length)?(this.handleTextStickBindId.push(this.table.on(Xw.SCROLL,(t=>{IR(this.table)}))),this.handleTextStickBindId.push(this.table.on(Xw.RESIZE_COLUMN_END,(t=>{IR(this.table)}))),this.handleTextStickBindId.push(this.table.on(Xw.RESIZE_ROW_END,(t=>{IR(this.table)})))):!GR(this.table)&&this.handleTextStickBindId&&(this.handleTextStickBindId.forEach((t=>{this.table.off(t)})),this.handleTextStickBindId=[]),WM(this.table))}),0)}bindSelfEvent(){if(this.table.isReleased)return;const t=this.table.stateManager;var e;this.table.on(Xw.ICON_CLICK,(e=>{var i;const{col:o,row:n,x:r,y:s,funcType:l,icon:a,event:h}=e;if(l===VC.dropDown)t.triggerDropDownMenu(o,n,r,s,h);else if(l===VC.sort)t.triggerSort(o,n,a,h);else if(l===VC.frozen)t.triggerFreeze(o,n,a);else if(l===VC.drillDown)(d=this.table).fireListeners(FM.DRILLMENU_CLICK,d.stateManager.drill);else if(l===VC.collapse||l===VC.expand){const e=!!(null===(i=t.select.ranges)||void 0===i?void 0:i.length);t.updateSelectPos(-1,-1),t.endSelectCells(!0,e),this.table.toggleHierarchyState(o,n)}var d})),this.table.on(Xw.DROPDOWN_MENU_CLICK,(()=>{t.hideMenu()})),this.updateEventBinder(),e=this.table,"browser"===sw.mode&&e.on(Xw.CLICK_CELL,(t=>{const{col:i,row:o}=t;if("image"===t.target.type&&t.target.role&&t.target.role.startsWith("icon"))return;let n;n=e.internalProps.layoutMap.isHeader(i,o)?e.isPivotTable()?e._getHeaderLayoutMap(i,o).headerType:e.getHeaderDefine(i,o).headerType:e.getBodyColumnType(i,o);const r=e.isHeader(i,o)?e.getHeaderDefine(i,o):e.getBodyColumnDefine(i,o),s=e.getCellValue(i,o),l=e.getCellOriginValue(i,o);if("link"===n){if(!1===r.linkJump)return;const t=r.templateLink,n=!1!==r.linkDetect;let a;if(t){const n=e.getCellOriginRecord(i,o),r=Object.assign({__value:s,__dataValue:l},n),h=/\{\s*(\S+?)\s*\}/g;a=t.replace(h,((t,e)=>r[e]))}else if(n){if(!hx.test(s))return;a=s}else a=s;const h=r.linkTarget,d=r.linkWindowFeatures;window.open(a,h,d)}else if("image"===n){const{clickToPreview:t}=r;if(!1===t)return;const e=document.createElement("div");e.style.width="100%",e.style.height="100%",e.style.position="absolute",e.style.top="0",e.style.left="0",e.style.backgroundColor="rgba(30, 30, 30, 0.4)",e.style.display="flex",e.style.justifyContent="center",e.style.alignItems="center",e.style.overflow="hidden",e.style.zIndex="9999",e.addEventListener("click",(t=>{t.target===e&&document.body.removeChild(e)}));const i=new Image;i.src=s,i.style.maxWidth="80%",i.style.maxHeight="80%",e.appendChild(i),document.body.appendChild(e)}else if("video"===n){const{clickToPreview:t}=r;if(!1===t)return;const e=document.createElement("div");e.style.width="100%",e.style.height="100%",e.style.position="absolute",e.style.top="0",e.style.left="0",e.style.backgroundColor="rgba(30, 30, 30, 0.4)",e.style.display="flex",e.style.justifyContent="center",e.style.alignItems="center",e.style.overflow="hidden",e.style.zIndex="9999",e.addEventListener("click",(t=>{t.target===e&&document.body.removeChild(e)}));const i=document.createElement("video");i.src=s,i.style.maxWidth="80%",i.style.maxHeight="80%",i.setAttribute("preload","auto"),i.setAttribute("controls","true"),e.appendChild(i),document.body.appendChild(e)}})),this.table.on(Xw.DBLCLICK_CELL,(t=>{var e;if(t.federatedEvent){const i=Y_(t.federatedEvent),o=this.table.scenegraph.getResizeColAt(i.abstractPos.x,i.abstractPos.y,null===(e=i.eventArgs)||void 0===e?void 0:e.targetCell);if(this.table.eventManager.checkCellFillhandle(i))this.table.fireListeners(Xw.DBLCLICK_FILL_HANDLE,{});else if(this.table._canResizeColumn(o.col,o.row)&&o.col>=0){this.table.scenegraph.updateAutoColWidth(o.col),this.table.internalProps._widthResizedColMap.add(o.col),this.table.scenegraph.updateChartSizeForResizeColWidth(o.col);const t=this.table.stateManager;t.columnResize.col<t.table.frozenColCount&&!t.table.isPivotTable()&&!t.table.transpose&&t.table.scenegraph.component.setFrozenColumnShadow(t.table.frozenColCount-1,t.columnResize.isRightFrozen);const e=[];for(let t=0;t<this.table.colCount;t++)e.push(this.table.getColWidth(t));this.table.fireListeners(Xw.RESIZE_COLUMN_END,{col:o.col,colWidths:e})}}})),this.table.isPivotTable()&&function(t){const e=t.internalProps.layoutMap.rowsDefine,i=t.internalProps.layoutMap.columnsDefine;for(let t=0;t<e.length;t++){const i=e[t];if("string"!=typeof i&&(i.drillDown||i.drillUp))return!0}for(let t=0;t<i.length;t++){const e=i[t];if("string"!=typeof e&&(e.drillDown||e.drillUp))return!0}return!1}(this.table)&&function(t){t.on(Xw.MOUSEENTER_CELL,(e=>{const{col:i,row:o}=e;if(-1===i||-1===o)return;const n=t.internalProps.layoutMap.getHeaderDimension(i,o);(null==n?void 0:n.drillDown)||(null==n?void 0:n.drillUp)?t.stateManager.updateDrillState(n.dimensionKey,n.title,n.drillDown,n.drillUp,i,o):t.stateManager.updateDrillState(void 0,void 0,!1,!1,-1,-1)})),t.on(Xw.MOUSELEAVE_TABLE,(e=>{t.stateManager.updateDrillState(void 0,void 0,!1,!1,-1,-1)}))}(this.table),WM(this.table),function(t){t.isPivotChart()&&t.scenegraph.tableGroup.addEventListener("click",(e=>{var i;if(!t.stateManager.columnMove.moving&&!t.stateManager.columnResize.resizing)if("axis-label"===e.target.name){const i=Y_(e),{col:o,row:n}=i.eventArgs,r=t.internalProps.layoutMap;let s,l;r.indicatorsAsCol?(s=r.getDimensionKeyInChartSpec(r.rowHeaderLevelCount,n),l=r.getCellHeaderPaths(r.rowHeaderLevelCount-2,n).rowHeaderPaths):(s=r.getDimensionKeyInChartSpec(o,r.columnHeaderLevelCount),l=r.getCellHeaderPaths(o,r.columnHeaderLevelCount-1).colHeaderPaths);const a=l.map((t=>({key:t.dimensionKey,value:t.value}))).filter((t=>t.key));if(a.push({key:s,value:e.target.attribute.text}),t._selectedDimensionInChart.length&&function(t,e){if(t.length!==e.length)return!1;for(let i=0;i<t.length;i++)if(t[i].key!==e[i].key||t[i].value!==e[i].value)return!1;return!0}(t._selectedDimensionInChart,a))return;t._selectedDimensionInChart=a,r.updateDataStateToChartInstance(),gM(t.scenegraph),t.scenegraph.updateNextFrame()}else(null===(i=t._selectedDimensionInChart)||void 0===i?void 0:i.length)&&(t._selectedDimensionInChart.length=0,t.internalProps.layoutMap.updateDataStateToChartInstance(),gM(t.scenegraph),t.scenegraph.updateNextFrame())}))}(this.table),function(t){t.isPivotChart()&&(t.on(Xw.MOUSEENTER_CELL,(e=>{t.scenegraph.getCell(e.col,e.row).forEachChildren((i=>{if("axis"===i.name){const i=JM(e.col,e.row,t.internalProps.layoutMap);e.axisPosition=i,t.fireListeners(Xw.MOUSEENTER_AXIS,e)}}))})),t.on(Xw.MOUSELEAVE_CELL,(e=>{t.scenegraph.getCell(e.col,e.row).forEachChildren((i=>{if("axis"===i.name){const i=JM(e.col,e.row,t.internalProps.layoutMap);e.axisPosition=i,t.fireListeners(Xw.MOUSELEAVE_AXIS,e)}}))})))}(this.table)}dealTableHover(t){if(!t)return void this.table.stateManager.updateHoverPos(-1,-1);const{eventArgs:e}=t;e?this.table.stateManager.updateHoverPos(e.col,e.row):this.table.stateManager.updateHoverPos(-1,-1)}dealIconHover(t){const{eventArgs:e}=t;e?this.table.stateManager.updateHoverIcon(e.col,e.row,e.target,e.targetCell):this.table.stateManager.updateHoverIcon(-1,-1,void 0,void 0)}dealMenuHover(t){}dealTableSelect(t,e){var i,o,n,r;if(!t)return this.table.stateManager.updateSelectPos(-1,-1),!1;const{eventArgs:s}=t;if(s){if("checkbox"===s.target.name||"radio"===s.target.name)return!1;const l=this.table.getBodyColumnDefine(s.col,s.row);if(this.table.isHeader(s.col,s.row)&&((null==l?void 0:l.disableHeaderSelect)||(null===(i=this.table.stateManager.select)||void 0===i?void 0:i.disableHeader)))return e||this.table.stateManager.updateSelectPos(-1,-1),!1;if(!this.table.isHeader(s.col,s.row)&&(null==l?void 0:l.disableSelect)){if(!e){const t=!!(null===(o=this.table.stateManager.select.ranges)||void 0===o?void 0:o.length);this.table.stateManager.updateSelectPos(-1,-1),t&&this.table.stateManager.endSelectCells(!0,t)}return!1}return!this.table.isPivotChart()||"axis-label"!==(null===(n=null==t?void 0:t.eventArgs)||void 0===n?void 0:n.target.name)&&"chart"!==(null===(r=null==t?void 0:t.eventArgs)||void 0===r?void 0:r.target.type)?(this.table.stateManager.updateSelectPos(s.col,s.row,s.event.shiftKey,s.event.ctrlKey||s.event.metaKey,!1,e),!0):(this.table.stateManager.updateSelectPos(-1,-1),!1)}return!1}dealFillSelect(t,e){var i,o;const{eventArgs:n}=t;if(n){if((null===(o=null===(i=this.table.stateManager.select)||void 0===i?void 0:i.ranges)||void 0===o?void 0:o.length)&&this.table.stateManager.isFillHandle()){let i,o;const r=this.table.stateManager.select.ranges[this.table.stateManager.select.ranges.length-1];e&&(Q(this.table.stateManager.fillHandle.directionRow)||(Math.abs(this.table.stateManager.fillHandle.startY-t.abstractPos.y)>=Math.abs(this.table.stateManager.fillHandle.startX-t.abstractPos.x)?this.table.stateManager.fillHandle.directionRow=!0:this.table.stateManager.fillHandle.directionRow=!1),Math.abs(this.table.stateManager.fillHandle.startY-t.abstractPos.y)>=Math.abs(this.table.stateManager.fillHandle.startX-t.abstractPos.x)?this.table.stateManager.fillHandle.startY-t.abstractPos.y>0?this.table.stateManager.fillHandle.direction="top":this.table.stateManager.fillHandle.direction="bottom":this.table.stateManager.fillHandle.startX-t.abstractPos.x>0?this.table.stateManager.fillHandle.direction="left":this.table.stateManager.fillHandle.direction="right",this.table.stateManager.fillHandle.directionRow?(i=n.row,o=r.end.col):(i=r.end.row,o=n.col)),this.table.stateManager.updateSelectPos(e?o:r.end.col,e?i:r.end.row,!0,n.event.ctrlKey||n.event.metaKey,!1,e)}else this.table.stateManager.updateSelectPos(n.col,n.row,n.event.shiftKey,n.event.ctrlKey||n.event.metaKey,!1,e);return!0}return!1}deelTableSelectAll(){this.table.stateManager.updateSelectPos(-1,-1,!1,!1,!0),this.table.fireListeners(Xw.SELECTED_CELL,{ranges:this.table.stateManager.select.ranges,col:0,row:0})}dealMenuSelect(t){}checkColumnResize(t,e){const{eventArgs:i}=t;if(this.table.options.enableTreeStickCell&&!i)return!1;const o=this.table.scenegraph.getResizeColAt(t.abstractPos.x,t.abstractPos.y,null==i?void 0:i.targetCell);return!!(this.table._canResizeColumn(o.col,o.row)&&o.col>=0)&&(e&&this.table.stateManager.startResizeCol(o.col,t.abstractPos.x,t.abstractPos.y,o.rightFrozen),!0)}checkRowResize(t,e){const{eventArgs:i}=t;if(i){const o=this.table.scenegraph.getResizeRowAt(t.abstractPos.x,t.abstractPos.y,i.targetCell);if(this.table._canResizeRow(o.col,o.row)&&o.row>=0)return e&&this.table.stateManager.startResizeRow(o.row,t.abstractPos.x,t.abstractPos.y,o.bottomFrozen),!0}return!1}checkCellFillhandle(t,e){var i,o,n,r;if(null===(i=this.table.options.excelOptions)||void 0===i?void 0:i.fillHandle){const{eventArgs:i}=t;if(i&&(null===(n=null===(o=this.table.stateManager.select)||void 0===o?void 0:o.ranges)||void 0===n?void 0:n.length)){const i=Math.max(this.table.stateManager.select.ranges[this.table.stateManager.select.ranges.length-1].start.col,this.table.stateManager.select.ranges[this.table.stateManager.select.ranges.length-1].end.col),o=Math.max(this.table.stateManager.select.ranges[this.table.stateManager.select.ranges.length-1].start.row,this.table.stateManager.select.ranges[this.table.stateManager.select.ranges.length-1].end.row),n=this.table.scenegraph.highPerformanceGetCell(i,o).globalAABBBounds,s=Math.abs(t.abstractPos.x-n.x2),l=Math.abs(t.abstractPos.y-n.y2),a=18;if((null===(r=this.table.stateManager.fillHandle)||void 0===r?void 0:r.isFilling)||s<=a/2&&l<=a/2)return e&&this.table.stateManager.startFillSelect(t.abstractPos.x,t.abstractPos.y),!0}}return!1}dealColumnResize(t,e){this.table.stateManager.updateResizeCol(t,e)}dealRowResize(t,e){this.table.stateManager.updateResizeRow(t,e)}chechColumnMover(t){var e,i,o;const{eventArgs:n}=t;return!!(n&&this.table.isHeader(n.col,n.row)&&(function(t,e,i){for(let o=0;o<i.length;o++)if(Ow(i[o],t,e))return!0;return!1}(n.col,n.row,this.table.stateManager.select.ranges)||(null===(e=this.table.options.select)||void 0===e?void 0:e.disableHeaderSelect)||(null===(i=this.table.options.select)||void 0===i?void 0:i.disableSelect))&&this.table._canDragHeaderPosition(n.col,n.row))&&(this.table.stateManager.startMoveCol(n.col,n.row,t.abstractPos.x,t.abstractPos.y,null===(o=null==n?void 0:n.event)||void 0===o?void 0:o.nativeEvent),!0)}dealColumnMover(t){const{eventArgs:e}=t;Q(e.col)&&Q(e.row)&&this.table.stateManager.updateMoveCol(e.col,e.row,t.abstractPos.x,t.abstractPos.y)}startColumnResize(t){}dealIconClick(t,e){const{eventArgs:i}=e,{target:o,event:n,col:r,row:s}=i||{target:t.target,event:t,col:-1,row:-1},l=o;if(l.role&&l.role.startsWith("icon-"))return this.table.fireListeners(Xw.ICON_CLICK,{name:l.name,x:(l.globalAABBBounds.x1+l.globalAABBBounds.x2)/2,y:l.globalAABBBounds.y2,col:r,row:s,funcType:l.attribute.funcType,icon:l,event:n}),!0;if(o instanceof vc){const t=o.pickIcon(n.global);if(t)return this.table.fireListeners(Xw.ICON_CLICK,{name:t.attribute.id,x:t.globalX+t.globalAABBBounds.width()/2,y:t.globalY+t.AABBBounds.height(),col:r,row:s,funcType:t.attribute.funcType,icon:t,event:n}),!0}return!1}release(){this.gesture.release(),this.globalEventListeners.forEach((t=>{"document"===t.env?document.removeEventListener(t.name,t.callback):"body"===t.env?document.body.removeEventListener(t.name,t.callback):"window"===t.env&&window.removeEventListener(t.name,t.callback)})),this.globalEventListeners=[]}enableScroll(){this._enableTableScroll=!0}disableScroll(){this._enableTableScroll=!1}}(this),this.animationManager=new hk(this),e.legends){Y.legends=[];const t=Tx.getFunction("createLegend");if(Array.isArray(e.legends)){for(let i=0;i<e.legends.length;i++)Y.legends.push(t(e.legends[i],this));this.scenegraph.tableGroup.setAttributes({x:this.tableX,y:this.tableY})}else Y.legends.push(t(e.legends,this)),this.scenegraph.tableGroup.setAttributes({x:this.tableX,y:this.tableY})}if(Y.tooltip=Object.assign({parentElement:this.getElement(),renderMode:"html",isShowOverflowTextTooltip:!1,confine:!0},e.tooltip),"html"===Y.tooltip.renderMode){const t=Tx.getComponent("tooltipHandler");t&&(Y.tooltipHandler=new t(this,Y.tooltip.confine))}if(Y.menu=Object.assign({renderMode:"html"},e.menu),Array.isArray(null===(l=e.menu)||void 0===l?void 0:l.dropDownMenuHighlight)&&this.setDropDownMenuHighlight(null===(a=e.menu)||void 0===a?void 0:a.dropDownMenuHighlight),Array.isArray(null===(h=e.menu)||void 0===h?void 0:h.defaultHeaderMenuItems)&&(this.globalDropDownMenu=e.menu.defaultHeaderMenuItems),"html"===Y.menu.renderMode){const t=Tx.getComponent("menuHandler");Y.menuHandler=new t(this)}this.headerStyleCache=new Map,this.bodyStyleCache=new Map,this.bodyMergeTitleCache=new Map,this.bodyBottomStyleCache=new Map,Y.stick={changedCells:new Map},Y.customMergeCell=e.customMergeCell,this.customCellStylePlugin=new IT(this,null!==(d=e.customCellStyle)&&void 0!==d?d:[],null!==(c=e.customCellStyleArrangement)&&void 0!==c?c:[])}getContainer(){return this.container}getElement(){return this.internalProps.element}get canvas(){return this.internalProps.canvas}setCanvasSize(t,e){this.canvasWidth=t,this.canvasHeight=e,this.options.canvasHeight=e,this.options.canvasWidth=t,this.resize()}resize(){var t;this._updateSize(),null===(t=this.internalProps.legends)||void 0===t||t.forEach((t=>{null==t||t.resize()})),this.internalProps.title&&this.internalProps.title.resize(),this.internalProps.emptyTip&&this.internalProps.emptyTip.resize(),this.scenegraph.resize()}get rowCount(){return this.internalProps.rowCount}set rowCount(t){this.internalProps.rowCount=t}get colCount(){var t;return null!==(t=this.internalProps.colCount)&&void 0!==t?t:0}set colCount(t){this.internalProps.colCount=t}get frozenColCount(){var t,e,i,o,n;return null!==(n=null!==(i=null===(e=null===(t=this.internalProps)||void 0===t?void 0:t.layoutMap)||void 0===e?void 0:e.frozenColCount)&&void 0!==i?i:null===(o=this.internalProps)||void 0===o?void 0:o.frozenColCount)&&void 0!==n?n:0}set frozenColCount(t){t>=this.colCount&&(t=0),this.internalProps.frozenColCount=t,this.options.frozenColCount=t,this.tableNoFrameWidth-this.getColsWidth(0,t-1)<=120&&(this.internalProps.frozenColCount=0),this.stateManager.setFrozenCol(this.internalProps.frozenColCount)}setFrozenColCount(t){t>=this.colCount&&(t=0),this.internalProps.frozenColCount=t,this.options.frozenColCount=t,this.tableNoFrameWidth-this.getColsWidth(0,t-1)<=120&&(this.internalProps.frozenColCount=0),this.stateManager.setFrozenCol(this.internalProps.frozenColCount)}_setFrozenColCount(t){t>=this.colCount&&(t=0),this.internalProps.frozenColCount=t}_resetFrozenColCount(){this.options.frozenColCount&&(this.tableNoFrameWidth-this.getColsWidth(0,this.options.frozenColCount-1)<=120?this._setFrozenColCount(0):this.frozenColCount!==this.options.frozenColCount&&this._setFrozenColCount(this.options.frozenColCount))}get frozenRowCount(){var t,e,i,o,n;return null!==(n=null!==(i=null===(e=null===(t=this.internalProps)||void 0===t?void 0:t.layoutMap)||void 0===e?void 0:e.frozenRowCount)&&void 0!==i?i:null===(o=this.internalProps)||void 0===o?void 0:o.frozenRowCount)&&void 0!==n?n:0}set frozenRowCount(t){this.internalProps.frozenRowCount=t}get rightFrozenColCount(){var t,e,i,o,n;return null!==(n=null!==(i=null===(e=null===(t=this.internalProps)||void 0===t?void 0:t.layoutMap)||void 0===e?void 0:e.rightFrozenColCount)&&void 0!==i?i:null===(o=this.internalProps)||void 0===o?void 0:o.rightFrozenColCount)&&void 0!==n?n:0}set rightFrozenColCount(t){this.scenegraph.dealWidthRightFrozen(t)}get bottomFrozenRowCount(){var t,e,i,o,n;return null!==(n=null!==(i=null===(e=null===(t=this.internalProps)||void 0===t?void 0:t.layoutMap)||void 0===e?void 0:e.bottomFrozenRowCount)&&void 0!==i?i:null===(o=this.internalProps)||void 0===o?void 0:o.bottomFrozenRowCount)&&void 0!==n?n:0}set bottomFrozenRowCount(t){this.scenegraph.dealWidthBottomFrozen(t)}get defaultRowHeight(){return this.internalProps.defaultRowHeight}set defaultRowHeight(t){this.internalProps.defaultRowHeight=t,this.options.defaultRowHeight=t}get defaultHeaderRowHeight(){return this.internalProps.defaultHeaderRowHeight}set defaultHeaderRowHeight(t){this.internalProps.defaultHeaderRowHeight=t,this.options.defaultHeaderRowHeight=t}get defaultColWidth(){return this.internalProps.defaultColWidth}set defaultColWidth(t){this.internalProps.defaultColWidth=t,this.options.defaultColWidth=t}get defaultHeaderColWidth(){return this.internalProps.defaultHeaderColWidth}set defaultHeaderColWidth(t){this.internalProps.defaultHeaderColWidth=t,this.options.defaultHeaderColWidth=t}get colWidthsMap(){return this.internalProps._colWidthsMap}set colWidthsMap(t){this.internalProps._colWidthsMap=t}get colContentWidthsMap(){return this.internalProps._colContentWidthsMap}set colContentWidthsMap(t){this.internalProps._colContentWidthsMap=t}get _colRangeWidthsMap(){return this.internalProps._colRangeWidthsMap}set _colRangeWidthsMap(t){this.internalProps._colRangeWidthsMap=t}get _rowRangeHeightsMap(){return this.internalProps._rowRangeHeightsMap}set _rowRangeHeightsMap(t){this.internalProps._rowRangeHeightsMap=t}get rowHeightsMap(){return this.internalProps._rowHeightsMap}set rowHeightsMap(t){this.internalProps._rowHeightsMap=t}get colWidthsLimit(){return this.internalProps._colWidthsLimit}set colWidthsLimit(t){this.internalProps._colWidthsLimit=t}get keyboardOptions(){var t;return null!==(t=this.internalProps.keyboardOptions)&&void 0!==t?t:null}set keyboardOptions(t){this.internalProps.keyboardOptions=null!=t?t:void 0}get eventOptions(){var t;return null!==(t=this.internalProps.eventOptions)&&void 0!==t?t:null}set eventOptions(t){this.internalProps.eventOptions=null!=t?t:void 0}get widthMode(){return this._widthMode}set widthMode(t){t!==this._widthMode&&(this._widthMode=t,this.options.widthMode=t)}get heightMode(){return this._heightMode}set heightMode(t){t!==this._heightMode&&(this._heightMode=t,this.options.heightMode=t)}get autoFillWidth(){return this._autoFillWidth}set autoFillWidth(t){t!==this._autoFillWidth&&(this._autoFillWidth=t)}get autoFillHeight(){return this._autoFillHeight}set autoFillHeight(t){t!==this._autoFillHeight&&(this._autoFillHeight=t)}get widthAdaptiveMode(){return this._widthAdaptiveMode}set widthAdaptiveMode(t){t!==this._widthAdaptiveMode&&(this._widthAdaptiveMode=t)}get heightAdaptiveMode(){return this._heightAdaptiveMode}set heightAdaptiveMode(t){t!==this._heightAdaptiveMode&&(this._heightAdaptiveMode=t)}_colWidthDefineToPxWidth(t){return"auto"===t?0:N_(this,t)}_getColWidthLimits(t){const e=this.colWidthsLimit[t];if(!e)return null;const i={};return e.min&&(i.min=N_(this,e.min),i.minDef=e.min),e.max&&(i.max=N_(this,e.max),i.maxDef=e.max),i}_adjustColWidth(t,e){const i=this._getColWidthLimits(t);return Math.max(function(t,e){return t?t.min&&t.min>e?t.min:t.max&&t.max<e?t.max:e:e}(i,e),0)}setPixelRatio(t){if(t!==this.internalProps.pixelRatio){this.internalProps.pixelRatio=t;const e=this.options.canvasWidth;this.internalProps.calcWidthContext={_:this.internalProps,get full(){var i;return"node"===sw.mode?e/(null!=t?t:1):this._.canvas.width/(null!==(i=this._.context.pixelRatio)&&void 0!==i?i:window.devicePixelRatio)}},this.scenegraph.setPixelRatio(t)}}_updateSize(){var t,e,i,o,n,r,s,l,a,h,d,c,u,g,p,f,v,m,b,y,C,w,x,_,S,A;const{padding:B}=this;let R=0,M=0;if(this.tableX=0,this.tableY=0,this.options.canvas&&this.options.viewBox)R=this.options.viewBox.x2-this.options.viewBox.x1,M=this.options.viewBox.y2-this.options.viewBox.y1,(null===(t=null==this?void 0:this.scenegraph)||void 0===t?void 0:t.stage)&&(this.options.viewBox?this.scenegraph.stage.setViewBox(this.options.viewBox,!1):this.scenegraph.stage.resize(R,M));else if("browser"===sw.mode){const t=this.getElement();let s=0,l=0;if(this.canvasSizeSeted)s=this.canvasWidth,l=this.canvasHeight;else if(t.parentElement){const e=t.parentElement.style||window.getComputedStyle(t.parentElement);s=t.parentElement.offsetWidth-parseInt(e.paddingLeft||"0px",10)-parseInt(e.paddingRight||"0px",10),l=t.parentElement.offsetHeight-parseInt(e.paddingTop||"0px",10)-parseInt(e.paddingBottom||"0px",20)}const a=null!=s?s:0,h=null!=l?l:0;t.style.width=a&&a-B.left-B.right+"px"||"0px",t.style.height=h&&h-B.top-B.bottom+"px"||"0px";const{canvas:d}=this.internalProps;R=null!==(i=null===(e=d.parentElement)||void 0===e?void 0:e.offsetWidth)&&void 0!==i?i:0,M=null!==(n=null===(o=d.parentElement)||void 0===o?void 0:o.offsetHeight)&&void 0!==n?n:0,(null===(r=null==this?void 0:this.scenegraph)||void 0===r?void 0:r.stage)?this.scenegraph.stage.resize(R,M):(d.style.width="",d.style.height="",d.width=R,d.height=M,d.style.width=`${R}px`,d.style.height=`${M}px`)}else"node"===sw.mode&&(R=this.canvasWidth-1,M=this.canvasHeight-1);const T=Math.floor(R-function(t){var e;return(null==t?void 0:t.hoverOn)||(null==t?void 0:t.verticalVisible)&&"none"===(null==t?void 0:t.verticalVisible)||!(null==t?void 0:t.verticalVisible)&&"none"===(null==t?void 0:t.visible)?0:null!==(e=null==t?void 0:t.width)&&void 0!==e?e:7}(this.getTheme().scrollStyle)),k=Math.floor(M-function(t){var e;return(null==t?void 0:t.hoverOn)||(null==t?void 0:t.horizontalVisible)&&"none"===(null==t?void 0:t.horizontalVisible)||!(null==t?void 0:t.horizontalVisible)&&"none"===(null==t?void 0:t.visible)?0:null!==(e=null==t?void 0:t.width)&&void 0!==e?e:7}(this.getTheme().scrollStyle));if(null===(s=this.internalProps.theme)||void 0===s?void 0:s.frameStyle){const t=dk(null!==(a=null===(l=this.internalProps.theme.frameStyle)||void 0===l?void 0:l.borderLineWidth)&&void 0!==a?a:[null]),e=dk(null!==(d=null===(h=this.internalProps.theme.frameStyle)||void 0===h?void 0:h.shadowBlur)&&void 0!==d?d:[0]);(null===(c=this.theme.frameStyle)||void 0===c?void 0:c.innerBorder)?(this.tableX=0,this.tableY=0,this.tableNoFrameWidth=T-(null!==(u=e[1])&&void 0!==u?u:0),this.tableNoFrameHeight=k-(null!==(g=e[2])&&void 0!==g?g:0)):(this.tableX=(null!==(p=t[3])&&void 0!==p?p:0)+(null!==(f=e[3])&&void 0!==f?f:0),this.tableY=(null!==(v=t[0])&&void 0!==v?v:0)+(null!==(m=e[0])&&void 0!==m?m:0),this.tableNoFrameWidth=T-((null!==(b=t[1])&&void 0!==b?b:0)+(null!==(y=e[1])&&void 0!==y?y:0))-((null!==(C=t[3])&&void 0!==C?C:0)+(null!==(w=e[3])&&void 0!==w?w:0)),this.tableNoFrameHeight=k-((null!==(x=t[0])&&void 0!==x?x:0)+(null!==(_=e[0])&&void 0!==_?_:0))-((null!==(S=t[2])&&void 0!==S?S:0)+(null!==(A=e[2])&&void 0!==A?A:0)))}}updateViewBox(t){var e,i,o,n,r,s,l,a;const h=null!==(n=null!==(i=null===(e=this.options)||void 0===e?void 0:e.viewBox.x2)&&void 0!==i?i:0-(null===(o=this.options)||void 0===o?void 0:o.viewBox.x1))&&void 0!==n?n:0,d=null!==(a=null!==(s=null===(r=this.options)||void 0===r?void 0:r.viewBox.y2)&&void 0!==s?s:0-(null===(l=this.options)||void 0===l?void 0:l.viewBox.y1))&&void 0!==a?a:0,c=t.x2-t.x1,u=t.y2-t.y1;this.options.viewBox=t,h!==c||d!==u?this.resize():this.scenegraph.stage.setViewBox(this.options.viewBox,!0)}setViewBoxTransform(t,e,i,o,n,r){this.internalProps.modifiedViewBoxTransform=!0,this.scenegraph.stage.window.setViewBoxTransform(t,e,i,o,n,r)}get rowHierarchyType(){return"grid"}getColsWidth(t,e){var i;if(t>e)return 0;t=Math.max(t,0),e=Math.min(e,(null!==(i=this.colCount)&&void 0!==i?i:1/0)-1);const o=this._colRangeWidthsMap.get(`$${t}$${e}`);if(null!=o)return o;const n=this._colRangeWidthsMap.get(`$${t}$${e-1}`);if(null!=n){const i=n+this.getColWidth(e);return t>=0&&e>=0&&!Number.isNaN(i)&&this._colRangeWidthsMap.set(`$${t}$${e}`,Math.round(i)),Math.round(i)}let r=0;for(let i=t;i<=e;i++)r+=this.getColWidth(i);return t>=0&&e>=0&&this._colRangeWidthsMap.set(`$${t}$${e}`,Math.round(r)),Math.round(r)}getRowHeight(t){var e;if(Q(this.rowHeightsMap.get(t))){if(null===(e=this.options.customConfig)||void 0===e?void 0:e._disableColumnAndRowSizeRound){const e=this.rowHeightsMap.get(t);let i;return i=t<this.frozenRowCount?this.rowHeightsMap.getSumInRange(0,t):t>=this.rowCount-this.bottomFrozenRowCount?this.rowHeightsMap.getSumInRange(t,this.rowCount-1):this.rowHeightsMap.getSumInRange(this.frozenRowCount,t),i=Number(i.toFixed(2)),Number.isInteger(i)?Math.ceil(e):Math.floor(e)}return this.rowHeightsMap.get(t)}const i=this.getDefaultRowHeight(t);return at(i)?i:this.defaultRowHeight}getDefaultColumnWidth(t){var e,i;return this.isRowHeader(t,0)||this.isCornerHeader(t,0)?Array.isArray(this.defaultHeaderColWidth)?null!==(e=this.defaultHeaderColWidth[t])&&void 0!==e?e:this.defaultColWidth:this.defaultHeaderColWidth:this.isRightFrozenColumn(t,this.columnHeaderLevelCount)&&this.isPivotTable()?Array.isArray(this.defaultHeaderColWidth)?null!==(i=this.defaultHeaderColWidth[this.rowHeaderLevelCount-this.rightFrozenColCount])&&void 0!==i?i:this.defaultColWidth:this.defaultHeaderColWidth:this.defaultColWidth}getDefaultRowHeight(t){var e,i;return this.isColumnHeader(0,t)||this.isCornerHeader(0,t)||this.isSeriesNumberInHeader(0,t)?Array.isArray(this.defaultHeaderRowHeight)?null!==(e=this.defaultHeaderRowHeight[t])&&void 0!==e?e:this.internalProps.defaultRowHeight:this.defaultHeaderRowHeight:this.isBottomFrozenRow(t)?Array.isArray(this.defaultHeaderRowHeight)?null!==(i=this.defaultHeaderRowHeight[this.columnHeaderLevelCount>0?this.columnHeaderLevelCount-this.bottomFrozenRowCount:0])&&void 0!==i?i:this.internalProps.defaultRowHeight:this.defaultHeaderRowHeight:this.internalProps.defaultRowHeight}_setRowHeight(t,e,i){var o;this.rowHeightsMap.put(t,(null===(o=this.options.customConfig)||void 0===o?void 0:o._disableColumnAndRowSizeRound)?e:Math.round(e)),i&&this._clearRowRangeHeightsMap(t)}setRowHeight(t,e){this.scenegraph.setRowHeight(t,e),this.scenegraph.updateChartSizeForResizeRowHeight(t),this.internalProps._heightResizedRowMap.add(t)}getRowsHeight(t,e){var i,o;if(t>e||0===this.rowCount)return 0;t=Math.max(t,0),e=Math.min(e,(null!==(i=this.rowCount)&&void 0!==i?i:1/0)-1);let n=0;if("standard"!==this.heightMode||this.autoFillHeight||!this.internalProps.layoutMap||this.hasAutoImageColumn()||0!==this.internalProps._heightResizedRowMap.size){if(null===(o=this.options.customConfig)||void 0===o?void 0:o._disableColumnAndRowSizeRound){const i=this.rowHeightsMap.getSumInRange(t,e);let o;return o=e<this.frozenRowCount?this.rowHeightsMap.getSumInRange(0,e):e>=this.rowCount-this.bottomFrozenRowCount?this.rowHeightsMap.getSumInRange(e,this.rowCount-1):this.rowHeightsMap.getSumInRange(this.frozenRowCount,e),o=Number(o.toFixed(2)),Number.isInteger(o)?Math.ceil(i):Math.floor(i)}n=this.rowHeightsMap.getSumInRange(t,e)}else{for(let i=t;i<Math.min(e+1,this.columnHeaderLevelCount);i++)n+=this.getRowHeight(i);e>=this.columnHeaderLevelCount&&(n+=this.defaultRowHeight*(Math.min(e,this.rowCount-this.bottomFrozenRowCount-1)-Math.max(this.columnHeaderLevelCount,t)+1));for(let t=this.rowCount-this.bottomFrozenRowCount;t<e+1;t++)n+=this.getRowHeight(t)}return Math.round(n)}getColWidthDefined(t){var e;const{layoutMap:i}=this.internalProps;if("autoWidth"===this.widthMode)return"auto";const{width:o}=null!==(e=null==i?void 0:i.getColumnWidthDefined(t))&&void 0!==e?e:{};return"number"==typeof o&&o<=0?0:o||this.getDefaultColumnWidth(t)}getColWidthDefinedNumber(t){const e=this.getColWidthDefined(t);return this._adjustColWidth(t,this._colWidthDefineToPxWidth(e))}isAutoRowHeight(t){return"autoHeight"===this.heightMode||t>=0&&t<this.columnHeaderLevelCount&&"auto"===this.getDefaultRowHeight(t)}getColWidth(t){var e;const i=null!==(e=this.colWidthsMap.get(t))&&void 0!==e?e:this.getDefaultColumnWidth(t);return"adaptive"===this.widthMode&&"number"==typeof i||this.transpose&&"number"==typeof i?this._colWidthDefineToPxWidth(i):this._adjustColWidth(t,this._colWidthDefineToPxWidth(i))}_setColWidth(t,e,i,o){this.colWidthsMap.put(t,"number"==typeof e?Math.round(e):e),i&&this._clearColRangeWidthsMap(t),o||this.stateManager.checkFrozen()}setColWidth(t,e){this.scenegraph.setColWidth(t,e),this.scenegraph.updateChartSizeForResizeColWidth(t),this.internalProps._widthResizedColMap.add(t)}_clearColRangeWidthsMap(t){if("number"!=typeof t)this._colRangeWidthsMap.clear();else{const e=this._colRangeWidthsMap.keys();for(const i of e){const e=uk.exec(i);if(e){const o=Number(e[1]),n=Number(e[2]);t>=o&&t<=n&&this._colRangeWidthsMap.delete(i)}}}}_clearRowRangeHeightsMap(t){this.rowHeightsMap.clearRange()}_getColContentWidth(t){return Number(this.colContentWidthsMap.get(t))}_setColContentWidth(t,e){this.colContentWidthsMap.put(t,e)}getAllRowsHeight(){return this.internalProps.rowCount<=0?0:this.getRowsHeight(0,this.internalProps.rowCount-1)}getAllColsWidth(){return this.internalProps.colCount<=0?0:this.getColsWidth(0,this.internalProps.colCount-1)}getMaxColWidth(t){var e;const i=this.colWidthsLimit[t];let o=null!==(e=i&&i.max)&&void 0!==e?e:1/0;return"string"==typeof o&&(o=N_(this,o)),o}setMaxColWidth(t,e){(this.colWidthsLimit[t]||(this.colWidthsLimit[t]={})).max=e}getMinColWidth(t){var e;const i=this.colWidthsLimit[t];let o=null!==(e=i&&i.min)&&void 0!==e?e:0;return"string"==typeof o&&(o=N_(this,o)),o}setMinColWidth(t,e){(this.colWidthsLimit[t]||(this.colWidthsLimit[t]={})).min=e}getCellRect(t,e){var i,o;const n=this.isFrozenCell(t,e);let r;const s=this.getColWidth(t);let l;r=n&&n.col&&this.isRightFrozenColumn(t,e)?this.getAllColsWidth()<=this.tableNoFrameWidth?this.getColsWidth(0,t-1)||0:this.tableNoFrameWidth-(null!==(i=this.getColsWidth(t,this.colCount-1))&&void 0!==i?i:0):this.getColsWidth(0,t-1)||0;const a=this.getRowHeight(e);return l=n&&n.row&&this.isBottomFrozenRow(t,e)?this.getAllRowsHeight()<=this.tableNoFrameHeight?this.getRowsHeight(0,e-1):this.tableNoFrameHeight-(null!==(o=this.getRowsHeight(e,this.rowCount-1))&&void 0!==o?o:0):this.getRowsHeight(0,e-1),new tx(Math.round(r),Math.round(l),Math.round(s),Math.round(a))}getMergeCellRect(t,e){const i=this.getCellRange(t,e),o=this.getColsWidth(0,i.start.col-1)||0,n=this.getColsWidth(i.start.col,i.end.col),r=this.getRowsHeight(0,i.start.row-1)||0,s=this.getRowsHeight(i.start.row,i.end.row);return new tx(Math.round(o),Math.round(r),Math.round(n),Math.round(s))}getCellRelativeRect(t,e){const i=this.isFrozenCell(t,e);let o=!0,n=!0;(null==i?void 0:i.col)&&(null==i?void 0:i.row)?(o=!1,n=!1):(null==i?void 0:i.col)?o=!1:(null==i?void 0:i.row)&&(n=!1);const r=this.getCellRect(t,e);return this._toRelativeRect(r,o,n)}getCellRangeRelativeRect(t){if(t.start){const e=this.isFrozenCell(t.start.col,t.start.row);let i=!0,o=!0;return(null==e?void 0:e.col)&&(null==e?void 0:e.row)?(i=!1,o=!1):(null==e?void 0:e.col)?i=!1:(null==e?void 0:e.row)&&(o=!1),this._toRelativeRect(this.getCellsRect(t.start.col,t.start.row,t.end.col,t.end.row),i,o)}const e=this.getCellRange(t.col,t.row),i=this.isFrozenCell(t.col,t.row);let o=!0,n=!0;return(null==i?void 0:i.col)&&(null==i?void 0:i.row)?(o=!1,n=!1):(null==i?void 0:i.col)?o=!1:(null==i?void 0:i.row)&&(n=!1),this._toRelativeRect(this.getCellsRect(e.start.col,e.start.row,e.end.col,e.end.row),o,n)}getVisibleCellRangeRelativeRect(t){let e;return e=t.start?t:this.getCellRange(t.col,t.row),this._getVisiableRect(this.getCellRangeRelativeRect(t),e)}_getVisiableRect(t,e){const i=e.start.col>=this.frozenColCount?Math.max(t.left,this.frozenColCount>=1?this.getColsWidth(0,this.frozenColCount-1):0):t.left,o=Math.min(t.right,this.tableNoFrameWidth),n=t.copy();n.left=i,n.right=o;const r=e.start.row>=this.frozenRowCount?Math.max(t.top,this.frozenRowCount>=1?this.getRowsHeight(0,this.frozenRowCount-1):0):t.top,s=Math.min(t.bottom,this.tableNoFrameHeight);return n.top=r,n.bottom=s,n}getCellsRect(t,e,i,o){var n,r,s,l,a,h;let d=this.getColsWidth(0,t-1)||0,c=this.getColsWidth(t,i);const u=this.scrollLeft;this.isLeftFrozenColumn(t)&&this.isRightFrozenColumn(i)?c=this.tableNoFrameWidth-(null!==(n=this.getColsWidth(t+1,this.colCount-1))&&void 0!==n?n:0)-d:this.isLeftFrozenColumn(t)&&!this.isLeftFrozenColumn(i)?c=Math.max(c-u,this.getColsWidth(t,this.frozenColCount-1)):!this.isRightFrozenColumn(t)&&this.isRightFrozenColumn(i)?(d=Math.min(d-u,this.tableNoFrameWidth-this.getRightFrozenColsWidth()),c=this.tableNoFrameWidth-(null!==(r=this.getColsWidth(t+1,this.colCount-1))&&void 0!==r?r:0)-d):this.isRightFrozenColumn(t)&&(d=this.tableNoFrameWidth-(null!==(s=this.getColsWidth(t,this.colCount-1))&&void 0!==s?s:0));let g=this.getRowsHeight(0,e-1),p=this.getRowsHeight(e,o);const f=this.scrollTop;return this.isTopFrozenRow(e)&&this.isBottomFrozenRow(o)?p=this.tableNoFrameHeight-(null!==(l=this.getRowsHeight(e+1,this.rowCount-1))&&void 0!==l?l:0)-g:this.isTopFrozenRow(e)&&!this.isTopFrozenRow(o)?p=Math.max(p-f,this.getRowsHeight(e,this.frozenRowCount-1)):!this.isBottomFrozenRow(e)&&this.isBottomFrozenRow(o)?(g=Math.min(g-f,this.tableNoFrameHeight-this.getBottomFrozenRowsHeight()),p=this.tableNoFrameHeight-(null!==(a=this.getRowsHeight(e+1,this.rowCount-1))&&void 0!==a?a:0)-g):this.isBottomFrozenRow(e)&&(g=this.tableNoFrameHeight-(null!==(h=this.getRowsHeight(e,this.rowCount-1))&&void 0!==h?h:0)),new tx(Math.round(d),Math.round(g),Math.round(c),Math.round(p))}getCellsRectWidth(t,e,i,o){const n=this.isFrozenCell(t,e),r=this.isFrozenCell(i,o);let s=this.getColsWidth(t,i);if(n&&n.col){const e=this.scrollLeft;r&&r.col||(s-=e,s=Math.max(s,this.getColsWidth(t,this.frozenColCount-1)))}return s}getCellRangeRect(t){if(t.start)return this.getCellsRect(t.start.col,t.start.row,t.end.col,t.end.row);const e=this.getCellRange(t.col,t.row);return this.getCellsRect(e.start.col,e.start.row,e.end.col,e.end.row)}getCellRangeRectWidth(t){if(t.start)return this.getCellsRectWidth(t.start.col,t.start.row,t.end.col,t.end.row);const e=this.getCellRange(t.col,t.row);return this.getCellsRectWidth(e.start.col,e.start.row,e.end.col,e.end.row)}isFrozenCell(t,e){const i=this.isFrozenRow(e),o=this.isFrozenColumn(t);return i||o?{row:i,col:o}:null}getRowAt(t){return NT(t,this)}getColAt(t){return GT(t,this)}getCellAt(t,e){return function(t,e,i){const o=NT(e,i),{row:n,top:r,bottom:s,height:l}=o,a=GT(t,i),{col:h,left:d,right:c,width:u}=a;return{row:n,col:h,rect:{left:d,right:c,top:r,bottom:s,width:u,height:l}}}(t,e,this)}getCellAtRelativePosition(t,e){return function(t,e,i){t-=i.tableX;let o=!1;(e-=i.tableY)>0&&e<i.getFrozenRowsHeight()&&(o=!0);let n=!1;t>0&&t<i.getFrozenColsWidth()&&(n=!0);let r=!1;e>i.tableNoFrameHeight-i.getBottomFrozenRowsHeight()&&e<i.tableNoFrameHeight&&e<=i.getAllRowsHeight()&&(r=!0);let s=!1;t>i.tableNoFrameWidth-i.getRightFrozenColsWidth()&&t<i.tableNoFrameWidth&&t<=i.getAllColsWidth()&&(s=!0);const l=UT(n||s?t:t+i.scrollLeft,s,i),a=$T(o||r?e:e+i.scrollTop,r,i);if(l&&a){const{row:t,top:e,bottom:i,height:o}=a,{col:n,left:r,right:s,width:h}=l;return{row:t,col:n,rect:{left:r,right:s,top:e,bottom:i,width:h,height:o}}}return{col:-1,row:-1}}(t,e,this)}_checkRowCol(t,e){return t>=0&&t<this.colCount&&e>=0&&e<this.rowCount}_makeVisibleCell(t,e){if(this._checkRowCol(t,e)){const i=this.isFrozenCell(t,e);if(i&&i.col&&i.row)return;const o=this.getCellRect(t,e),n=function(t){let e=0,i=0;t.frozenColCount>0&&(e=t.getFrozenColsWidth()),t.rightFrozenColCount>0&&(i=t.getRightFrozenColsWidth());let o=0,n=0;return t.frozenRowCount>0&&(o=t.getFrozenRowsHeight()),t.bottomFrozenRowCount>0&&(n=t.getBottomFrozenRowsHeight()),new tx(t.scrollLeft+e,t.scrollTop+o,t.tableNoFrameWidth-e-i,t.tableNoFrameHeight-o-n)}(this);if(n.contains(o))return;i&&i.col||this.getColsWidth(0,this.frozenColCount-1)+o.width>this.canvas.width||(o.left<n.left?this.scrollLeft-=n.left-o.left:n.right<o.right&&(this.scrollLeft-=n.right-o.right)),i&&i.row||this.getRowsHeight(0,this.frozenRowCount-1)+o.height>this.canvas.height||(o.top<n.top?this.scrollTop-=n.top-o.top:n.bottom<o.bottom&&(this.scrollTop-=n.bottom-o.bottom))}}render(){this.scenegraph.renderSceneGraph()}renderAsync(){return this.scenegraph.updateNextFrame(),new Promise(((t,e)=>{setTimeout((()=>{t()}),0)}))}_toRelativeRect(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];var o,n,r,s;const l=t.copy(),a=this.getVisibleRect();return l.offsetLeft(this.tableX-(e?a.left:0)),l.offsetTop(this.tableY-(i?a.top:0)),l.offsetLeft(null!==(n=null===(o=this.options.viewBox)||void 0===o?void 0:o.x1)&&void 0!==n?n:0),l.offsetTop(null!==(s=null===(r=this.options.viewBox)||void 0===r?void 0:r.y1)&&void 0!==s?s:0),l}getVisibleRect(){const{scrollTop:t,scrollLeft:e}=this,i=this.tableNoFrameWidth,o=this.tableNoFrameHeight;return new tx(e,t,i,o)}get visibleRowCount(){const{frozenRowCount:t}=this,e=this.getVisibleRect(),i=t>0?e.top+this.getRowsHeight(0,t-1):e.top,o=this.getTargetRowAt(i);if(!o)return 0;const n=Math.max(o.top>=i?o.row:o.row+1,t);let r=this.getRowsHeight(0,n-1),s=0;const{rowCount:l}=this;for(let t=n;t<l;t++){const i=r+this.getRowHeight(t);if(e.bottom<i)break;s++,r=i}return s}getBodyVisibleCellRange(){const{scrollTop:t,scrollLeft:e}=this,i=this.getFrozenRowsHeight(),o=this.getFrozenColsWidth(),n=this.getBottomFrozenRowsHeight(),r=this.getRightFrozenColsWidth(),{row:s}=this.getRowAt(t+i+1),{col:l}=this.getColAt(e+o+1),a=this.getAllRowsHeight()>this.tableNoFrameHeight?this.getRowAt(t+this.tableNoFrameHeight-1-n).row:this.rowCount-1,h=this.getAllColsWidth()>this.tableNoFrameWidth?this.getColAt(e+this.tableNoFrameWidth-1-r).col:this.colCount-1;return h<0||a<0?null:{rowStart:s,colStart:l,rowEnd:a,colEnd:h}}getBodyVisibleRowRange(){const{scrollTop:t}=this,e=this.getFrozenRowsHeight(),i=this.getBottomFrozenRowsHeight(),{row:o}=this.getRowAt(t+e+1),n=this.getAllRowsHeight()>this.tableNoFrameHeight?this.getRowAt(t+this.tableNoFrameHeight-1-i).row:this.rowCount-1;return n<0?null:{rowStart:o,rowEnd:n}}getBodyVisibleColRange(){const{scrollLeft:t}=this,e=this.getFrozenColsWidth(),i=this.getRightFrozenColsWidth(),{col:o}=this.getColAt(t+e+1),n=this.getAllColsWidth()>this.tableNoFrameWidth?this.getColAt(t+this.tableNoFrameWidth-1-i).col:this.colCount-1;return n<0?null:{colStart:o,colEnd:n}}get visibleColCount(){const{frozenColCount:t}=this,e=this.getVisibleRect(),i=t>0?e.left+this.getColsWidth(0,t-1):e.left,o=this.getTargetColAt(i);if(!o)return 0;const n=Math.max(o.left>=i?o.col:o.col+1,t);let r=this.getColsWidth(0,n-1),s=0;const{colCount:l}=this;for(let t=n;t<l;t++){const i=r+this.getColWidth(t);if(e.right<i)break;s++,r=i}return s}get scrollTop(){return this.stateManager.scroll.verticalBarPos}set scrollTop(t){this.stateManager.setScrollTop(t)}get scrollLeft(){return this.stateManager.scroll.horizontalBarPos}set scrollLeft(t){this.stateManager.setScrollLeft(t)}getScrollLeft(){return this.scrollLeft}getScrollTop(){return this.scrollTop}setScrollLeft(t){this.scrollLeft=Math.ceil(t)}setScrollTop(t){this.scrollTop=Math.ceil(t)}getCellOverflowText(t,e){return this.scenegraph.getCellOverflowText(t,e)}addReleaseObj(t){if(!t||!t.release||"function"!=typeof t.release)throw new Error("not releaseObj!");(this.internalProps.releaseList=this.internalProps.releaseList||[]).push(t)}dispose(){this.release()}release(){var t,e,i,o,n,r,s,l,a,h,d,c,u,g,p,f;const v=this.internalProps;null===(e=null===(t=v.tooltipHandler)||void 0===t?void 0:t.release)||void 0===e||e.call(t),null===(o=null===(i=v.menuHandler)||void 0===i?void 0:i.release)||void 0===o||o.call(i),aS.clearAll(),null===(n=super.release)||void 0===n||n.call(this),null===(s=null===(r=v.handler)||void 0===r?void 0:r.release)||void 0===s||s.call(r),this.eventManager.release(),null===(a=null===(l=v.focusControl)||void 0===l?void 0:l.release)||void 0===a||a.call(l),null===(h=v.legends)||void 0===h||h.forEach((t=>{null==t||t.release()})),null===(d=v.title)||void 0===d||d.release(),v.title=null,null===(c=v.emptyTip)||void 0===c||c.release(),v.emptyTip=null,v.layoutMap.release(),v.releaseList&&(v.releaseList.forEach((t=>{var e;return null===(e=null==t?void 0:t.release)||void 0===e?void 0:e.call(t)})),v.releaseList=null),this.scenegraph.stage.release(),this.scenegraph.proxy.release(),v.focusControl.release();const{parentElement:m}=v.element;m&&!this.options.canvas&&m.removeChild(v.element),null===(p=null===(g=null===(u=this.editorManager)||void 0===u?void 0:u.editingEditor)||void 0===g?void 0:g.onEnd)||void 0===p||p.call(g),this.isReleased=!0,this.scenegraph=null,this.internalProps=null,null===(f=this.reactCustomLayout)||void 0===f||f.clearCache()}fireListeners(t,e){return super.fireListeners(t,e)}updateOption(t){var e,i,o,n,r,s,l,a,h,d,c,u;this.options=t,this._hasAutoImageColumn=void 0;const{frozenColCount:g=0,defaultRowHeight:p=40,defaultHeaderRowHeight:f,defaultColWidth:v=80,defaultHeaderColWidth:m=80,keyboardOptions:b,eventOptions:y,rowSeriesNumber:C,columnResizeMode:w,rowResizeMode:x="none",dragHeaderMode:_,showFrozenIcon:S,allowFrozenColCount:A,padding:B,hover:R,menu:M,select:T,pixelRatio:k,widthMode:L,heightMode:P,autoFillWidth:E,autoFillHeight:H,widthAdaptiveMode:F,heightAdaptiveMode:z,customRender:I,renderChartAsync:O,renderChartAsyncBatchCount:D,overscrollBehavior:W,limitMinWidth:N,limitMinHeight:G}=t;k&&k!==this.internalProps.pixelRatio&&(this.internalProps.pixelRatio=k),B&&("number"==typeof B?(this.padding.top=B,this.padding.left=B,this.padding.bottom=B,this.padding.right=B):(B.top&&(this.padding.top=B.top),B.bottom&&(this.padding.bottom=B.bottom),B.left&&(this.padding.left=B.left),B.right&&(this.padding.right=B.right))),this.showFrozenIcon="boolean"!=typeof S||S,"number"==typeof A&&A<=0&&(this.showFrozenIcon=!1),this.widthMode=null!=L?L:"standard",this.heightMode=null!=P?P:"standard",this._widthAdaptiveMode=null!=F?F:"only-body",this._heightAdaptiveMode=null!=z?z:"only-body",this.autoFillWidth=null!=E&&E,this.autoFillHeight=null!=H&&H,this.customRender=I;const j=this.internalProps;if("node"===sw.mode||t.canvas||function(t,e){var i,o;t.style.margin=`${e.top}px ${e.right}px ${e.bottom}px ${e.left}px`;const n=(t.offsetWidth||(null===(i=t.parentElement)||void 0===i?void 0:i.offsetWidth)||1)-1,r=(t.offsetHeight||(null===(o=t.parentElement)||void 0===o?void 0:o.offsetHeight)||1)-1;t.style.width=n&&n-e.left-e.right+"px"||"0px",t.style.height=r&&r-e.top-e.bottom+"px"||"0px"}(j.element,this.padding),this.columnWidthComputeMode=null!==(e=t.columnWidthComputeMode)&&void 0!==e?e:"normal",j.frozenColCount=g,j.defaultRowHeight=p,j.defaultHeaderRowHeight=null!=f?f:p,j.defaultColWidth=v,j.defaultHeaderColWidth=null!=m?m:v,j.keyboardOptions=b,j.eventOptions=y,j.rowSeriesNumber=C,j.columnResizeMode=w,j.rowResizeMode=x,j.dragHeaderMode=null!=_?_:"none",j.renderChartAsync=O,mB(D),j.overscrollBehavior=null!=W?W:"auto",j.cellTextOverflows={},j._rowHeightsMap=new HT(this),j._rowRangeHeightsMap=new Map,j._colRangeWidthsMap=new Map,j._widthResizedColMap=new Set,j._heightResizedRowMap=new Set,this.colWidthsMap=new Qw,this.colContentWidthsMap=new Qw,this.colWidthsLimit={},j.stick.changedCells.clear(),j.theme=Bx.of(null!==(i=t.theme)&&void 0!==i?i:Bx.DEFAULT),j.theme.isPivot=this.isPivotTable(),ES(j.theme.functionalIconsStyle),this.scenegraph.updateStageBackground(),j.autoWrapText=t.autoWrapText,j.enableLineBreak=t.enableLineBreak,j.allowFrozenColCount=null!==(o=t.allowFrozenColCount)&&void 0!==o?o:0,j.limitMaxAutoWidth=null!==(n=t.limitMaxAutoWidth)&&void 0!==n?n:450,j.limitMinWidth=null!=N?"number"==typeof N?N:N?10:0:10,j.limitMinHeight=null!=G?"number"==typeof G?G:G?10:0:10,null===(r=j.legends)||void 0===r||r.forEach((t=>{null==t||t.release()})),null===(s=j.title)||void 0===s||s.release(),j.title=null,null===(l=j.emptyTip)||void 0===l||l.release(),j.emptyTip=null,j.layoutMap.release(),this.scenegraph.clearCells(),this.scenegraph.updateComponent(),this.stateManager.updateOptionSetState(),this._updateSize(),this.eventManager.updateEventBinder(),t.legends){j.legends=[];const e=Tx.getFunction("createLegend");if(Array.isArray(t.legends)){for(let i=0;i<t.legends.length;i++)j.legends.push(e(t.legends[i],this));this.scenegraph.tableGroup.setAttributes({x:this.tableX,y:this.tableY})}else j.legends.push(e(t.legends,this)),this.scenegraph.tableGroup.setAttributes({x:this.tableX,y:this.tableY})}if(j.tooltip=Object.assign({parentElement:this.getElement(),renderMode:"html",isShowOverflowTextTooltip:!1,confine:!0},t.tooltip),"html"===j.tooltip.renderMode&&!j.tooltipHandler){const t=Tx.getComponent("tooltipHandler");j.tooltipHandler=new t(this,j.tooltip.confine)}if(j.menu=Object.assign({renderMode:"html"},t.menu),Array.isArray(null===(a=t.menu)||void 0===a?void 0:a.dropDownMenuHighlight)&&this.setDropDownMenuHighlight(null===(h=t.menu)||void 0===h?void 0:h.dropDownMenuHighlight),Array.isArray(null===(d=t.menu)||void 0===d?void 0:d.defaultHeaderMenuItems)&&(this.globalDropDownMenu=t.menu.defaultHeaderMenuItems),"html"===j.menu.renderMode&&!j.menuHandler){const t=Tx.getComponent("menuHandler");j.menuHandler=new t(this)}this.clearCellStyleCache(),this.clearColWidthCache(),this.clearRowHeightCache(),j.customMergeCell=t.customMergeCell,this.customCellStylePlugin.updateCustomCell(null!==(c=t.customCellStyle)&&void 0!==c?c:[],null!==(u=t.customCellStyleArrangement)&&void 0!==u?u:[])}renderWithRecreateCells(){const t={col:this.stateManager.hover.cellPos.col,row:this.stateManager.hover.cellPos.row};this.refreshHeader(),this.internalProps.useOneRowHeightFillAll=!1,this.scenegraph.clearCells(),this.clearCellStyleCache(),this.scenegraph.createSceneGraph(),this.stateManager.updateHoverPos(t.col,t.row),this.render()}getFrozenRowsHeight(){return this.getRowsHeight(0,this.frozenRowCount-1)}getFrozenColsWidth(){return this.getColsWidth(0,this.frozenColCount-1)}getBottomFrozenRowsHeight(){if(this.bottomFrozenRowCount>0){let t=0;for(let e=this.rowCount-this.bottomFrozenRowCount;e<=this.rowCount-1;e++)t+=this.getRowHeight(e);return t}return 0}getRightFrozenColsWidth(){if(this.rightFrozenColCount>0){let t=0;for(let e=this.colCount-this.rightFrozenColCount;e<=this.colCount-1;e++)t+=this.getColWidth(e);return t}return 0}getDrawRange(){const t=Math.min(this.tableNoFrameWidth,this.getAllColsWidth()),e=Math.min(this.tableNoFrameHeight,this.getAllRowsHeight());return new tx(this.tableX,this.tableY,t,e)}_getMouseAbstractPoint(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];var i,o,n,r;let s;if(!t)return{inTable:!1,x:void 0,y:void 0};s=ck(t)?t.changedTouches[0]:t;const l=s.clientX||s.pageX+window.scrollX,a=s.clientY||s.pageY+window.scrollY,h=this.internalProps.canvas.getBoundingClientRect();let d=!0;h.right<=l&&(d=!1),h.bottom<=a&&(d=!1);const c=h.width,u=c/(this.canvas.offsetWidth||c),g=h.height,p=g/(this.canvas.offsetHeight||g),f={x:(l-h.left)/u+(e?this.scrollLeft:0)-(null!==(o=null===(i=this.options.viewBox)||void 0===i?void 0:i.x1)&&void 0!==o?o:0),y:(a-h.top)/p+(e?this.scrollTop:0)-(null!==(r=null===(n=this.options.viewBox)||void 0===n?void 0:n.y1)&&void 0!==r?r:0),inTable:d};return this.internalProps.modifiedViewBoxTransform&&this.scenegraph.stage.window.getViewBoxTransform()&&this.scenegraph.stage.window.getViewBoxTransform().transformPoint(f,f),f}getTheme(){return this.internalProps.theme}getTargetColAt(t){return jT(t,this)}getTargetRowAt(t){const e=VT(t,this);return e&&(e.row=Math.min(e.row,this.rowCount-1)),e}getTargetColAtConsiderRightFrozen(t,e){return UT(t,e,this)}getTargetRowAtConsiderBottomFrozen(t,e){return $T(t,e,this)}clearSelected(){this.stateManager.updateSelectPos(-1,-1)}selectCell(t,e,i,o){let n=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];var r;const s=!!(null===(r=this.stateManager.select.ranges)||void 0===r?void 0:r.length);this.stateManager.updateSelectPos(t,e,i,o,!1,!n),this.stateManager.endSelectCells(!0,s)}selectCells(t){const{scrollLeft:e,scrollTop:i}=this;t.forEach(((t,e)=>{t.start.col===t.end.col&&t.start.row===t.end.row?this.stateManager.updateSelectPos(t.start.col,t.start.row,!1,e>=1,!1,!1,!0):(this.stateManager.updateSelectPos(t.start.col,t.start.row,!1,e>=1,!1,!1,!0),this.stateManager.updateInteractionState(IC.grabing),this.stateManager.updateSelectPos(t.end.col,t.end.row,!1,e>=1,!1,!1,!0)),this.stateManager.endSelectCells(!1,!1),this.stateManager.updateInteractionState(IC.default)})),this.setScrollTop(i),this.setScrollLeft(e)}get recordsCount(){var t;return null===(t=this.records)||void 0===t?void 0:t.length}get allowFrozenColCount(){return this.internalProps.allowFrozenColCount}get rowHeaderLevelCount(){return this.internalProps.layoutMap.rowHeaderLevelCount}get columnHeaderLevelCount(){return this.internalProps.layoutMap.columnHeaderLevelCount}get records(){return this.internalProps.records}get dataSource(){return this.internalProps.dataSource}set dataSource(t){this.scenegraph.clearCells(),W_(this,t),this.refreshRowColCount(),this.scenegraph.createSceneGraph(),this.render()}get autoWrapText(){return this.internalProps.autoWrapText}set autoWrapText(t){this.internalProps.autoWrapText=t,this.options.autoWrapText=t}get enableLineBreak(){return this.internalProps.enableLineBreak}set enableLineBreak(t){this.internalProps.enableLineBreak=t,this.options.enableLineBreak=t}updateAutoWrapText(t){this.internalProps.autoWrapText!==t&&(this.internalProps.autoWrapText=t,this.options.autoWrapText=t,this.scenegraph.clearCells(),this.clearCellStyleCache(),this.scenegraph.createSceneGraph(),this.render())}get theme(){return this.internalProps.theme}set theme(t){this.internalProps.theme=Bx.of(null!=t?t:Bx.DEFAULT),this.internalProps.theme.isPivot=this.isPivotTable(),this.options.theme=t,ES(this.internalProps.theme.functionalIconsStyle)}updateTheme(t){const e={col:this.stateManager.hover.cellPos.col,row:this.stateManager.hover.cellPos.row};this.internalProps.theme=Bx.of(null!=t?t:Bx.DEFAULT),this.internalProps.theme.isPivot=this.isPivotTable(),ES(this.internalProps.theme.functionalIconsStyle),this.options.theme=t,this.scenegraph.updateComponent(),this.scenegraph.updateStageBackground(),this.scenegraph.clearCells(),this.clearCellStyleCache(),this.scenegraph.createSceneGraph(),this.stateManager.updateHoverPos(e.col,e.row),this.render()}getBodyField(t,e){return this.internalProps.layoutMap.getBody(t,e).field}getBodyColumnDefine(t,e){const i=this.internalProps.layoutMap.getBody(t,e);return null==i?void 0:i.define}getBodyColumnType(t,e){var i,o;return DS("cellType",{cellType:null!==(o=null===(i=this.internalProps.layoutMap.getBody(t,e))||void 0===i?void 0:i.cellType)&&void 0!==o?o:"text"},t,e,this)}getCellType(t,e){let i;return this.isSeriesNumberInHeader(t,e)?this.internalProps.layoutMap.getSeriesNumberHeader(t,e).cellType:(i=this.isHeader(t,e)?this.internalProps.layoutMap.getHeader(t,e).headerType:this.internalProps.layoutMap.getBody(t,e).cellType,DS("cellType",{cellType:i},t,e,this))}getHeaderField(t,e){return this.internalProps.layoutMap.getHeaderField(t,e)}getHeaderDefine(t,e){const i=this.internalProps.layoutMap.getHeader(t,e);return null==i?void 0:i.define}getCellLocation(t,e){return this.internalProps.layoutMap.getCellLocation(t,e)}getCellHeaderPaths(t,e){return this.internalProps.layoutMap.getCellHeaderPaths(t,e)}getHeadersDefine(t,e){const i=[];for(;;){const o=this.getHeaderDefine(t,e);if(!o||!o.field&&!o.columns)break;i.push(o),e++}return i}_getHeaderLayoutMap(t,e){return this.internalProps.layoutMap.getHeader(t,e)}_getBodyLayoutMap(t,e){return this.internalProps.layoutMap.getBody(t,e)}getContext(){return this.internalProps.context}getRecordByCell(t,e){if(!this.internalProps.layoutMap.isHeader(t,e))return this.getCellOriginRecord(t,e)}getRecordByRowCol(t,e){return this.getRecordByCell(t,e)}getRecordStartRowByRecordIndex(t){return this.internalProps.layoutMap.getRecordStartRowByRecordIndex(t)}_getHeaderCellBySortState(t){const{layoutMap:e}=this.internalProps,i=e.headerObjects.find((e=>e&&e.field===t.field));if(i)return e.getHeaderCellAdressById(i.id)}getCellRange(t,e){var i;if(this.internalProps.customMergeCell){const i=this.internalProps.customMergeCell(t,e,this);if(i&&i.range&&(Q(i.text)||i.customLayout||i.customRender))return i.range}return null===(i=this.internalProps.layoutMap)||void 0===i?void 0:i.getCellRange(t,e)}hasCustomMerge(){return!!this.internalProps.customMergeCell}getCustomMerge(t,e){if(this.internalProps.customMergeCell){const i=this.internalProps.customMergeCell(t,e,this);if(i&&i.range&&(Q(i.text)||i.customLayout||this.customRender)){if(i.style){const o=this.internalProps.bodyHelper.getStyleClass("text"),n=rw(i.style,this.theme.bodyStyle,{col:t,row:e,table:this,value:i.text,dataValue:this.getCellOriginValue(t,e),cellHeaderPaths:this.getCellHeaderPaths(t,e)},o,this.options.autoWrapText,this.theme);i.style=n}return i}}}isCellRangeEqual(t,e,i,o){return this.internalProps.layoutMap.isCellRangeEqual(t,e,i,o)}_getLayoutCellId(t,e){return this.internalProps.layoutMap.getCellId(t,e)}getHeaderDescription(t,e){var i;const o=this._getHeaderLayoutMap(t,e),n=null==o?void 0:o.define,r=null!==(i=null==n?void 0:n.description)&&void 0!==i?i:null==o?void 0:o.description;return"function"==typeof r?r({col:t,row:e,value:this.getCellValue(t,e),dataValue:this.getCellOriginValue(t,e)}):r}setDropDownMenuHighlight(t){this.stateManager.setDropDownMenuHighlight(t)}_dropDownMenuIsHighlight(t,e,i){return this.stateManager.dropDownMenuIsHighlight(t,e,i)}isSeriesNumberInBody(t,e){return this.internalProps.layoutMap&&this.internalProps.layoutMap.isSeriesNumberInBody(t,e)}isSeriesNumberInHeader(t,e){return this.internalProps.layoutMap&&this.internalProps.layoutMap.isSeriesNumberInHeader(t,e)}isHeader(t,e){return this.internalProps.layoutMap&&this.internalProps.layoutMap.isHeader(t,e)}isColumnHeader(t,e){var i;return null===(i=this.internalProps.layoutMap)||void 0===i?void 0:i.isColumnHeader(t,e)}isRowHeader(t,e){var i;return null===(i=this.internalProps.layoutMap)||void 0===i?void 0:i.isRowHeader(t,e)}isCornerHeader(t,e){var i;return null===(i=this.internalProps.layoutMap)||void 0===i?void 0:i.isCornerHeader(t,e)}isFrozenColumn(t,e){return this.isLeftFrozenColumn(t,e)||this.isRightFrozenColumn(t,e)}isLeftFrozenColumn(t,e){var i;return null===(i=this.internalProps.layoutMap)||void 0===i?void 0:i.isFrozenColumn(t,e)}isRightFrozenColumn(t,e){var i;return null===(i=this.internalProps.layoutMap)||void 0===i?void 0:i.isRightFrozenColumn(t,e)}isFrozenRow(t,e){return this.isTopFrozenRow(t,e)||this.isBottomFrozenRow(t,e)}isTopFrozenRow(t,e){var i;return null===(i=this.internalProps.layoutMap)||void 0===i?void 0:i.isFrozenRow(t,e)}isBottomFrozenRow(t,e){var i;return null===(i=this.internalProps.layoutMap)||void 0===i?void 0:i.isBottomFrozenRow(t,e)}getCellInfo(t,e){if(t>=0&&e>=0){const i=this.isHeader(t,e)?this.getHeaderDefine(t,e):this.getBodyColumnDefine(t,e);return{col:t,row:e,field:this.getHeaderField(t,e),cellHeaderPaths:this.internalProps.layoutMap.getCellHeaderPaths(t,e),title:null==i?void 0:i.title,cellType:this.getCellType(t,e),originData:this.getCellOriginRecord(t,e),cellRange:this.getCellRangeRelativeRect({col:t,row:e}),value:this.getCellValue(t,e),dataValue:this.getCellOriginValue(t,e),cellLocation:this.getCellLocation(t,e),scaleRatio:this.canvas.getBoundingClientRect().width/this.canvas.offsetWidth}}}_hasField(t,e,i){var o;if(null===t)return!1;if(this.internalProps.layoutMap.isHeader(e,i))return!1;const n=this.getRecordShowIndexByCell(e,i);return null===(o=this.internalProps.dataSource)||void 0===o?void 0:o.hasField(n,t)}_getCellStyle(t,e){return function(t,e,i){var o,n,r,s,l,a,h,d,c;const u=i.customCellStylePlugin.getCustomCellStyle(t,e),{layoutMap:g}=i.internalProps;if(g.isHeader(t,e)){let l;if(!i.isPivotTable()||i.isBottomFrozenRow(e)||i.isRightFrozenColumn(t))l=`${t}-${e}`;else{const o=i.getHeaderDefine(t,e),n=i.isCornerHeader(t,e);l=(null==o?void 0:o.dimensionKey)?n?`dim-cor-${o.dimensionKey}`:`dim-${o.dimensionKey}`:(null==o?void 0:o.indicatorKey)?`ind-${o.indicatorKey}`:`${t}-${e}`}let a=i.headerStyleCache.get(l);if(a)return u?OT(a,u):a;const h=g.getHeader(t,e);let d;if(i.isPivotChart()&&function(t,e,i){if(!i._table.isPivotChart())return!1;if(i.indicatorsAsCol){if(i.hasTwoIndicatorAxes&&e===i.columnHeaderLevelCount-1&&t>=i.rowHeaderLevelCount&&t<i.colCount-i.rightFrozenColCount)return!0;if(e===i.rowCount-i.bottomFrozenRowCount&&t>=i.rowHeaderLevelCount&&t<i.colCount-i.rightFrozenColCount)return!0}else if(e===i.rowCount-i.bottomFrozenRowCount&&t>=i.rowHeaderLevelCount&&t<i.colCount-i.rightFrozenColCount)return!0;return!1}(t,e,g)&&g.isAxisCell(t,e)?d=null!==(n=null===(o=g.getBody(t,i.rowHeaderLevelCount).style)||void 0===o?void 0:o.padding)&&void 0!==n?n:i.theme.bodyStyle.padding:i.isPivotChart()&&function(t,e,i){if(!i._table.isPivotChart())return!1;if(i.indicatorsAsCol){if(t===i.rowHeaderLevelCount-1&&e>=i.columnHeaderLevelCount&&e<i.rowCount-i.bottomFrozenRowCount)return!0}else{if(t===i.rowHeaderLevelCount-1&&e>=i.columnHeaderLevelCount&&e<i.rowCount-i.bottomFrozenRowCount)return!0;if(t===i.colCount-i.rightFrozenColCount&&e>=i.columnHeaderLevelCount&&e<i.rowCount-i.bottomFrozenRowCount)return!0}return!1}(t,e,g)&&g.isAxisCell(t,e)&&(d=null!==(s=null===(r=g.getBody(i.columnHeaderLevelCount,e).style)||void 0===r?void 0:r.padding)&&void 0!==s?s:i.theme.bodyStyle.padding),(!h||h.isEmpty)&&(g.isLeftBottomCorner(t,e)||g.isRightBottomCorner(t,e)||g.isCornerHeader(t,e)||g.isRightTopCorner(t,e)))return lk;const c=i.internalProps.headerHelper.getStyleClass((null==h?void 0:h.headerType)||"text");if(g.isBottomFrozenRow(t,e)&&i.theme.bottomFrozenStyle)a=LT(d?{padding:d}:{},i.theme.bottomFrozenStyle,{col:t,row:e,table:i,value:i.getCellValue(t,e),dataValue:i.getCellOriginValue(t,e),cellHeaderPaths:i.getCellHeaderPaths(t,e)},c,i.options.autoWrapText,i.theme);else if(g.isRightFrozenColumn(t,e)&&i.theme.rightFrozenStyle)a=LT(d?{padding:d}:{},i.theme.rightFrozenStyle,{col:t,row:e,table:i,value:i.getCellValue(t,e),dataValue:i.getCellOriginValue(t,e),cellHeaderPaths:i.getCellHeaderPaths(t,e)},c,i.options.autoWrapText,i.theme);else{const o=(null==h?void 0:h.style)||{};d&&(o.padding=d),a=LT(o,g.isColumnHeader(t,e)||g.isBottomFrozenRow(t,e)?i.theme.headerStyle:g.isRowHeader(t,e)||g.isRightFrozenColumn(t,e)?i.theme.rowHeaderStyle:i.theme.cornerHeaderStyle,{col:t,row:e,table:i,value:i.getCellValue(t,e),dataValue:i.getCellOriginValue(t,e),cellHeaderPaths:i.getCellHeaderPaths(t,e)},c,i.options.autoWrapText,i.theme)}return i.headerStyleCache.set(l,a),u?OT(a,u):a}let p,f;(null===(a=null===(l=i.internalProps)||void 0===l?void 0:l.dataConfig)||void 0===a?void 0:a.mappingRules)&&!i.isHeader(t,e)&&(null===(c=null===(d=null===(h=i.internalProps)||void 0===h?void 0:h.dataConfig)||void 0===d?void 0:d.mappingRules)||void 0===c||c.forEach(((o,n)=>{o.bgColor&&i.internalProps.layoutMap.getIndicatorKey(t,e)===o.bgColor.indicatorKey&&(p=o.bgColor.mapping)})));const v=i.getCellType(t,e),m=i.getCellOriginRecord(t,e);let b;if(f=(null==m?void 0:m.vtableMerge)?"merge-title":i.isSeriesNumberInBody(t,e)?`${t}-series-`+v:i.isListTable()&&!i.transpose||i.isPivotTable()&&i.internalProps.layoutMap.indicatorsAsCol?t+v:e+v,b=(null==m?void 0:m.vtableMerge)?i.bodyMergeTitleCache.get(f):g.isBottomFrozenRow(e)?i.bodyBottomStyleCache.get(f):i.bodyStyleCache.get(f),b)return u?OT(b,u):b;const y=g.getBody(t,e),C=i.internalProps.bodyHelper.getStyleClass(i.getCellType(t,e)),w=null==y?void 0:y.style;return b=rw(w,(null==m?void 0:m.vtableMerge)&&i.theme.groupTitleStyle?i.theme.groupTitleStyle:g.isBottomFrozenRow(e)&&i.theme.bottomFrozenStyle?i.theme.bottomFrozenStyle:g.isRightFrozenColumn(t)&&i.theme.rightFrozenStyle?i.theme.rightFrozenStyle:i.theme.bodyStyle,{col:t,row:e,table:i,value:i.getCellValue(t,e),dataValue:i.getCellOriginValue(t,e),cellHeaderPaths:i.getCellHeaderPaths(t,e)},C,i.options.autoWrapText,i.theme),p&&(b=OT(b,{bgColor:p})),Z(w)||(g.isBottomFrozenRow(e)?i.bodyBottomStyleCache.set(f,b):i.bodyStyleCache.set(f,b)),u?OT(b,u):b}(t,e,this)}clearCellStyleCache(){this.headerStyleCache.clear(),this.bodyStyleCache.clear(),this.bodyMergeTitleCache.clear(),this.bodyBottomStyleCache.clear()}clearRowHeightCache(){this.internalProps._rowHeightsMap.clear(),this._clearRowRangeHeightsMap()}clearColWidthCache(){this.internalProps._colWidthsMap.clear(),this._clearColRangeWidthsMap()}_canResizeColumn(t,e){if(!(t>=0&&e>=0))return!1;if(this.isCellRangeEqual(t,e,t+1,e))return!1;if("none"===this.internalProps.columnResizeMode)return!1;if("header"===this.internalProps.columnResizeMode){if(!this.isHeader(t,e))return!1}else if("body"===this.internalProps.columnResizeMode&&this.isHeader(t,e))return!1;const i=this.colWidthsLimit[t];return!(i&&i.min&&i.max)||i.max!==i.min}_canResizeRow(t,e){if(!(t>=0&&e>=0))return!1;if(this.isCellRangeEqual(t,e,t,e+1))return!1;if("none"===this.internalProps.rowResizeMode)return!1;if("header"===this.internalProps.rowResizeMode){if(!this.isHeader(t,e))return!1}else if("body"===this.internalProps.rowResizeMode&&this.isHeader(t,e))return!1;return!0}_canDragHeaderPosition(t,e){var i,o;if(this.isHeader(t,e)&&(this.stateManager.isSelected(t,e)||(null===(i=this.options.select)||void 0===i?void 0:i.disableHeaderSelect)||(null===(o=this.options.select)||void 0===o?void 0:o.disableSelect))){if("disabled"===this.internalProps.frozenColDragHeaderMode&&this.isFrozenColumn(t))return!1;if(this.stateManager.isSelected(t,e)){const i=this.stateManager.select.ranges[0];if(this.isColumnHeader(t,e)){if(i.end.row!==this.rowCount-1)return!1}else{if(!this.isRowHeader(t,e))return!1;if(i.end.col!==this.colCount-1)return!1}}const i=this.getHeaderDefine(t,e);if(!i)return!1;if(void 0===i.dragHeader){if("all"===this.internalProps.dragHeaderMode)return!0;if("column"===this.internalProps.dragHeaderMode){if(this.isColumnHeader(t,e))return!0}else if("row"===this.internalProps.dragHeaderMode&&this.isRowHeader(t,e))return!0;return!1}return i.dragHeader}return!1}getCellIcons(t,e){var i,o,n;let r;if(this.isHeader(t,e))r=this.internalProps.headerHelper.getIcons(t,e);else if(this.internalProps.layoutMap.isSeriesNumber(t,e)){this.options.groupBy&&(null===(i=this.getCellRawRecord(t,e))||void 0===i?void 0:i.vtableMerge)||(null===(n=null===(o=this.internalProps.layoutMap.getSeriesNumberBody(t,e))||void 0===o?void 0:o.define)||void 0===n?void 0:n.dragOrder)&&(r=this.internalProps.rowSeriesNumberHelper.getIcons(t,e));const s=this.getCellValue(t,e),l=this.getCellOriginValue(t,e),a=this.internalProps.context,h=this.internalProps.bodyHelper.getIcons(t,e,s,l,a);(null==r?void 0:r.length)>0?r=r.concat(h):(null==h?void 0:h.length)>0&&(r=h)}else{const i=this.getCellValue(t,e),o=this.getCellOriginValue(t,e),n=this.internalProps.context;r=this.internalProps.bodyHelper.getIcons(t,e,i,o,n)}return r}showDropDownMenu(t,e,i){let o="dropdown-menu";i&&(o=Array.isArray(i.content)?"dropdown-menu":"container"),"html"===this.internalProps.menu.renderMode&&(this.stateManager.menu.isShow=!0,this.internalProps.menuHandler._bindToCell(t,e,o,i))}showTooltip(t,e,i){"html"===this.internalProps.tooltip.renderMode&&this.internalProps.tooltipHandler._bindToCell(t,e,i)}getCellStyle(t,e){const i=this._getCellStyle(t,e),o=G_(i,this,t,e,DS).theme,{autoWrapText:n,lineClamp:r,textOverflow:s}=i;return{textAlign:o.text.textAlign,textBaseline:o.text.textBaseline,bgColor:q(o.group.fill)?DS("bgColor",i,t,e,this):o.group.fill,color:q(o.text.fill)?DS("color",i,t,e,this):o.text.fill,strokeColor:q(o.text.stroke)?DS("strokeColor",i,t,e,this):o.text.stroke,fontFamily:o.text.fontFamily,fontSize:o.text.fontSize,fontWeight:o.text.fontWeight,fontVariant:o.text.fontVariant,fontStyle:o.text.fontStyle,lineHeight:o.text.lineHeight,autoWrapText:null!=n&&n,lineClamp:null!=r?r:"auto",textOverflow:s,borderColor:q(o.group.stroke)?DS("borderColor",i,t,e,this):o.group.stroke,borderLineWidth:o.group.lineWidth,borderLineDash:o.group.lineDash,underline:!!o.text.underline,underlineDash:o.text.underlineDash,underlineOffset:o.text.underlineOffset,lineThrough:!!o.text.lineThrough,padding:o._vtable.padding,underlineWidth:o.text.underline,lineThroughLineWidth:o.text.lineThrough,_strokeArrayWidth:o.group.strokeArrayWidth,_strokeArrayColor:o.group.strokeArrayColor,_linkColor:DS("linkColor",i,t,e,this)}}getAllBodyCells(t,e){const i=this.rowHeaderLevelCount,o=this.columnHeaderLevelCount,n=this.colCount-1,r=this.rowCount-1;return Array(Math.min(null!=e?e:2e3,r-o+1,this.rowCount)).fill(0).map(((e,r)=>Array(Math.min(null!=t?t:2e3,n-i+1,this.colCount)).fill(0).map(((t,e)=>this.getCellInfo(e+i,r+o)))))}getAllCells(t,e){const i=this.colCount-1,o=this.rowCount-1;return Array(Math.min(null!=e?e:2e3,o-0+1,this.rowCount)).fill(0).map(((e,o)=>Array(Math.min(null!=t?t:2e3,i-0+1,this.colCount)).fill(0).map(((t,e)=>this.getCellInfo(e+0,o+0)))))}getAllColumnHeaderCells(){const t=this.rowHeaderLevelCount,e=this.colCount-1,i=this.columnHeaderLevelCount-1;return Array(i-0+1).fill(0).map(((i,o)=>Array(e-t+1).fill(0).map(((e,i)=>this.getCellInfo(i+t,o+0)))))}getAllRowHeaderCells(){const t=this.columnHeaderLevelCount,e=this.rowHeaderLevelCount-1,i=this.rowCount-1;return Array(i-t+1).fill(0).map(((i,o)=>Array(e-0+1).fill(0).map(((e,i)=>this.getCellInfo(i+0,o+t)))))}getCopyValue(){var t,e,i;if((null===(e=null===(t=this.stateManager.select)||void 0===t?void 0:t.ranges)||void 0===e?void 0:e.length)>0){const t=this.stateManager.select.ranges;let e=Math.min(t[0].start.col,t[0].end.col),o=Math.max(t[0].start.col,t[0].end.col),n=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),o=Math.max(o,t.start.col,t.end.col),n=Math.min(n,t.start.row,t.end.row),r=Math.max(r,t.start.row,t.end.row)}));const s=e=>{let i=!1;return t.forEach((t=>{const o=Math.min(t.start.row,t.end.row),n=Math.max(t.start.row,t.end.row);o<=e&&n>=e&&(i=!0)})),i},l=e=>{let i=!1;return t.forEach((t=>{const o=Math.min(t.start.col,t.end.col),n=Math.max(t.start.col,t.end.col);o<=e&&n>=e&&(i=!0)})),i},a=(e,i)=>{let o;return t.forEach((t=>{const n=Math.min(t.start.row,t.end.row),r=Math.max(t.start.row,t.end.row),s=Math.min(t.start.col,t.end.col),l=Math.max(t.start.col,t.end.col);s<=e&&l>=e&&n<=i&&r>=i&&(o=t)})),o},h=(t,e,i)=>{const o=this.getCellRange(t,e);let n=o.start.col,r=o.start.row;if(i){const t=Math.min(i.start.col,i.end.col),e=Math.min(i.start.row,i.end.row);n=Math.max(t,o.start.col),r=Math.max(e,o.start.row)}return n!==t||r!==e?"":this.getCellValue(t,e)};let d="";for(let t=n;t<=r;t++)if(s(t)){for(let i=e;i<=o;i++)if(l(i)){const e=a(i,t);if(e){const n=h(i,t,e);if("undefined"!=typeof Promise&&n instanceof Promise);else{const t=Q(n)?`${n}`:"";/^\[object .*\]$/.exec(t)||(d+=t)}(i<e.end.col||i<o)&&(d+="\t")}else d+="\t"}t<r&&(d+="\r\n")}return(null===(i=this.options)||void 0===i?void 0:i.formatCopyValue)&&(d=this.options.formatCopyValue(d)),d}return""}getSelectedCellInfos(){var t;if(!(null===(t=this.stateManager.select)||void 0===t?void 0:t.ranges))return null;const e=this.stateManager.select.ranges;if(!e.length)return[];let i=Math.min(e[0].start.col,e[0].end.col),o=Math.max(e[0].start.col,e[0].end.col),n=Math.min(e[0].start.row,e[0].end.row),r=Math.max(e[0].start.row,e[0].end.row);e.forEach((t=>{i=Math.min(i,t.start.col,t.end.col),o=Math.max(o,t.start.col,t.end.col),n=Math.min(n,t.start.row,t.end.row),r=Math.max(r,t.start.row,t.end.row)}));const s=t=>{let i=!1;return e.forEach((e=>{const o=Math.min(e.start.row,e.end.row),n=Math.max(e.start.row,e.end.row);o<=t&&n>=t&&(i=!0)})),i},l=t=>{let i=!1;return e.forEach((e=>{const o=Math.min(e.start.col,e.end.col),n=Math.max(e.start.col,e.end.col);o<=t&&n>=t&&(i=!0)})),i},a=(t,i)=>{let o;return e.forEach((e=>{const n=Math.min(e.start.row,e.end.row),r=Math.max(e.start.row,e.end.row),s=Math.min(e.start.col,e.end.col),l=Math.max(e.start.col,e.end.col);s<=t&&l>=t&&n<=i&&r>=i&&(o=e)})),o},h=[];for(let t=n;t<=r;t++)if(s(t)){const e=[];for(let n=i;n<=o;n++)if(l(n)&&a(n,t)){const i=this.getCellInfo(n,t);e.push(i)}h.push(e)}return h}getSelectedCellRanges(){const t=this.stateManager.select.ranges;return t.length?Ct(t):[]}measureText(t,e){return xA.measureText(t,e)}measureTextBounds(t){return SA(t)}getCustomRender(t,e){let i;if("body"!==this.getCellLocation(t,e)){const o=this.getHeaderDefine(t,e);i=null==o?void 0:o.headerCustomRender}else{const o=this.getBodyColumnDefine(t,e);i=(null==o?void 0:o.customRender)||this.customRender}return i}getCustomLayout(t,e){let i;if("body"!==this.getCellLocation(t,e)){const o=this.getHeaderDefine(t,e);i=null==o?void 0:o.headerCustomLayout}else{const o=this.getBodyColumnDefine(t,e);i=null==o?void 0:o.customLayout}return i}hasAutoImageColumn(){return void 0===this._hasAutoImageColumn&&(this._hasAutoImageColumn=function(t){const{columns:e,rows:i,indicators:o}=t.options;if(t.isPivotTable()){if(rt(e)&&e.length>0)for(let t=0;t<e.length;t++){const i=e[t];if(!nt(i)&&("image"===i.headerType||"video"===i.headerType||"function"==typeof i.headerType)&&i.imageAutoSizing)return!0}if(rt(i)&&i.length>0)for(let t=0;t<i.length;t++){const e=i[t];if(!nt(e)&&("image"===e.headerType||"video"===e.headerType||"function"==typeof e.headerType)&&e.imageAutoSizing)return!0}if(rt(o)&&o.length>0)for(let t=0;t<o.length;t++){const e=o[t];if(!nt(e)&&(("image"===e.cellType||"video"===e.cellType||"function"==typeof e.cellType)&&e.imageAutoSizing||("image"===e.headerType||"video"===e.headerType||"function"==typeof e.headerType)&&e.imageAutoSizing))return!0}}else if(rt(e)&&e.length>0)for(let t=0;t<e.length;t++){const i=e[t];if(("image"===i.cellType||"video"===i.cellType||"function"==typeof i.cellType)&&i.imageAutoSizing||("image"===i.headerType||"video"===i.headerType||"function"==typeof i.headerType)&&i.imageAutoSizing)return!0}return!1}(this)),this._hasAutoImageColumn}_getActiveChartInstance(){var t,e,i,o,n,r;const s=this.scenegraph.getCell(null===(e=null===(t=this.stateManager.hover)||void 0===t?void 0:t.cellPos)||void 0===e?void 0:e.col,null===(o=null===(i=this.stateManager.hover)||void 0===i?void 0:i.cellPos)||void 0===o?void 0:o.row);return"chart"===(null===(r=null===(n=null==s?void 0:s.getChildren())||void 0===n?void 0:n[0])||void 0===r?void 0:r.type)?s.getChildren()[0].activeChartInstance:null}cellIsInVisualView(t,e){var i,o,n,r;const s=this.getDrawRange(),l=this.getCellRelativeRect(t,e);if(t<this.frozenColCount&&e<this.frozenRowCount)return!0;let a,h,d,c;if(this.frozenRowCount>=1&&(a=this.getCellRangeRelativeRect({start:{col:0,row:0},end:{col:this.colCount-1,row:this.frozenRowCount-1}})),this.frozenColCount>=1&&(h=this.getCellRangeRelativeRect({start:{col:0,row:0},end:{col:this.frozenColCount-1,row:this.rowCount-1}})),this.bottomFrozenRowCount>=1&&(d=this.getCellRangeRelativeRect({start:{col:0,row:this.rowCount-this.bottomFrozenRowCount},end:{col:this.colCount-1,row:this.rowCount-1}})),this.rightFrozenColCount>=1&&(c=this.getCellRangeRelativeRect({start:{col:this.colCount-this.rightFrozenColCount,row:0},end:{col:this.colCount-1,row:this.rowCount-1}})),l.top>=s.top&&l.bottom<=s.bottom&&l.left>=s.left&&l.right<=s.right){if(this.isFrozenCell(t,e))return!0;if(l.top>=(null!==(i=null==a?void 0:a.bottom)&&void 0!==i?i:l.top)&&l.left>=(null!==(o=null==h?void 0:h.right)&&void 0!==o?o:l.left)&&l.bottom<=(null!==(n=null==d?void 0:d.top)&&void 0!==n?n:l.bottom)&&l.right<=(null!==(r=null==c?void 0:c.left)&&void 0!==r?r:l.right))return!0}return!1}getCustomMergeValue(t,e){if(this.internalProps.customMergeCell){const i=this.getCustomMerge(t,e);if(i){const{text:t}=i;return t}}}exportImg(){return this.scenegraph.stage.toCanvas().toDataURL()}exportCellImg(t,e,i){var o,n,r,s;const l=this.cellIsInVisualView(t,e),{scrollTop:a,scrollLeft:h}=this;l||this.scrollToCell({col:t,row:e});const d=this.getCellRelativeRect(t,e);(null===(n=null===(o=this.stateManager.select)||void 0===o?void 0:o.ranges)||void 0===n?void 0:n.length)>0&&YR(this.scenegraph);const{col:c,row:u}=this.stateManager.hover.cellPos;let g,p;if(this.stateManager.updateHoverPos(-1,-1),this.scenegraph.component.hideVerticalScrollBar(),this.scenegraph.component.hideHorizontalScrollBar(),this.scenegraph.tableGroup.border.setAttribute("visible",!1),null==i?void 0:i.disableBackground){const i=this.scenegraph.getCell(t,e);g=i.attribute.fill,i.setAttribute("fill","transparent")}if(null==i?void 0:i.disableBorder){const i=this.scenegraph.getCell(t,e);p=i.attribute.stroke,i.setAttribute("stroke",!1)}this.scenegraph.renderSceneGraph();let f=0;"bottom-right"===this.theme.cellBorderClipDirection&&(f=1);const v=this.scenegraph.stage.toCanvas(!1,(new Ie).set(d.left+this.tableX+1,d.top+this.tableY+1,d.right+this.tableX-f,d.bottom+this.tableY-f));return l||(this.setScrollTop(a),this.setScrollLeft(h)),this.scenegraph.tableGroup.border.setAttribute("visible",!0),g&&this.scenegraph.getCell(t,e).setAttribute("fill",g),p&&this.scenegraph.getCell(t,e).setAttribute("stroke",p),(null===(s=null===(r=this.stateManager.select)||void 0===r?void 0:r.ranges)||void 0===s?void 0:s.length)>0&&KR(this.scenegraph),this.stateManager.updateHoverPos(c,u),this.scenegraph.updateNextFrame(),v.toDataURL()}exportCellRangeImg(t){var e,i,o,n;const{scrollTop:r,scrollLeft:s}=this,l=Math.min(t.start.col,t.end.col),a=Math.min(t.start.row,t.end.row),h=Math.max(t.start.col,t.end.col),d=Math.max(t.start.row,t.end.row),c=this.cellIsInVisualView(l,a),u=this.cellIsInVisualView(h,d);c&&u||this.scrollToCell({col:l,row:a});const g=this.getCellRangeRelativeRect({start:{col:l,row:a},end:{col:h,row:d}});(null===(i=null===(e=this.stateManager.select)||void 0===e?void 0:e.ranges)||void 0===i?void 0:i.length)>0&&YR(this.scenegraph);const{col:p,row:f}=this.stateManager.hover.cellPos;this.stateManager.updateHoverPos(-1,-1),this.scenegraph.component.hideVerticalScrollBar(),this.scenegraph.component.hideHorizontalScrollBar(),this.scenegraph.renderSceneGraph();const v=this.scenegraph.stage.toCanvas(!1,(new Ie).set(g.left+this.tableX+1,g.top+this.tableY+1,g.right+this.tableX,g.bottom+this.tableY)).toDataURL();return c&&u||(this.setScrollTop(r),this.setScrollLeft(s)),(null===(n=null===(o=this.stateManager.select)||void 0===o?void 0:o.ranges)||void 0===n?void 0:n.length)>0&&KR(this.scenegraph),this.stateManager.updateHoverPos(p,f),v}exportCanvas(){return this.scenegraph.stage.toCanvas()}getImageBuffer(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"image/png";if("node"!==this.options.mode)return;this.render();const e=this.scenegraph.stage;if(e){const i=this.tableX+this.getAllColsWidth(),o=this.tableY+this.getAllRowsHeight();return i>=this.canvasWidth&&o>=this.canvasHeight?(e.render(),e.window.getImageBuffer(t)):this.scenegraph.stage.toCanvas(!1,(new Ie).set(0,0,Math.min(this.canvasWidth,i),Math.min(this.canvasHeight,o))).toBuffer(t)}return null}getBodyIndexByTableIndex(t,e){return{col:t-this.rowHeaderLevelCount,row:e-this.columnHeaderLevelCount}}getTableIndexByBodyIndex(t,e){return{col:t+this.rowHeaderLevelCount,row:e+this.columnHeaderLevelCount}}onVChartEvent(t,e,i){this._chartEventMap[t]||(this._chartEventMap[t]=[]),"function"==typeof e?this._chartEventMap[t].push({callback:e}):this._chartEventMap[t].push({callback:i,query:e})}offVChartEvent(t,e){this._chartEventMap[t]&&(this._chartEventMap[t]=e?this._chartEventMap[t].filter((t=>t.callback!==e)):[])}_bindChartEvent(t){if(t)for(const e in this._chartEventMap)(this._chartEventMap[e]||[]).forEach((i=>{i.query?t.on(e,i.query,i.callback):t.on(e,i.callback)}))}changeRecordOrder(t,e){}hasCustomCellStyle(t){return this.customCellStylePlugin.hasCustomCellStyle(t)}registerCustomCellStyle(t,e){this.customCellStylePlugin.registerCustomCellStyle(t,e)}arrangeCustomCellStyle(t,e){this.customCellStylePlugin.arrangeCustomCellStyle(t,e)}isSeriesNumber(t,e){return this.internalProps.layoutMap.isSeriesNumber(t,e)}isHasSeriesNumber(){var t;return(null===(t=this.internalProps.layoutMap)||void 0===t?void 0:t.leftRowSeriesNumberColumnCount)>0}get leftRowSeriesNumberCount(){var t,e;return null!==(e=null===(t=this.internalProps.layoutMap)||void 0===t?void 0:t.leftRowSeriesNumberColumnCount)&&void 0!==e?e:0}setMinMaxLimitWidth(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];var e,i;const o=this.internalProps;for(let n=0;n<o.layoutMap.columnWidths.length;n++){if(this.internalProps._widthResizedColMap.has(n))continue;const{width:r,minWidth:s,maxWidth:l}=null!==(i=null===(e=o.layoutMap.columnWidths)||void 0===e?void 0:e[n])&&void 0!==i?i:{};t&&r&&("string"==typeof r&&"auto"!==r||"number"==typeof r&&r>0)&&this._setColWidth(n,r),s&&("number"==typeof s&&s>0||"string"==typeof s)&&this.setMinColWidth(n,s),l&&("number"==typeof l&&l>0||"string"==typeof l)&&this.setMaxColWidth(n,l)}}setSortedIndexMap(t,e){var i;null===(i=this.dataSource)||void 0===i||i.setSortedIndexMap(t,e)}checkReactCustomLayout(t){this.reactCustomLayout||(this.reactCustomLayout=new X_(t,this))}get bodyDomContainer(){return this.internalProps.bodyDomContainer}get headerDomContainer(){return this.internalProps.headerDomContainer}get frozenBodyDomContainer(){return this.internalProps.frozenBodyDomContainer}get frozenHeaderDomContainer(){return this.internalProps.frozenHeaderDomContainer}get rightFrozenBodyDomContainer(){return this.internalProps.rightFrozenBodyDomContainer}get rightFrozenHeaderDomContainer(){return this.internalProps.rightFrozenHeaderDomContainer}get frozenBottomDomContainer(){return this.internalProps.frozenBottomDomContainer}get bottomDomContainer(){return this.internalProps.bottomDomContainer}get rightFrozenBottomDomContainer(){return this.internalProps.rightFrozenBottomDomContainer}showMoverLine(t,e){this.scenegraph.component.showMoveCol(t,e,0),this.scenegraph.renderSceneGraph()}hideMoverLine(t,e){this.scenegraph.component.hideMoveCol(),this.scenegraph.renderSceneGraph()}disableScroll(){this.eventManager.disableScroll()}enableScroll(){this.eventManager.enableScroll()}getGroupTitleLevel(t,e){}scrollToRow(t,e){e?this.animationManager.scrollTo({row:t},e):this.scrollToCell({row:t})}scrollToCol(t,e){e?this.animationManager.scrollTo({col:t},e):this.scrollToCell({col:t})}scrollToCell(t,e){if(e)return void this.animationManager.scrollTo(t,e);const i=this.getDrawRange();if(Q(t.col)&&t.col>=this.frozenColCount){const e=this.getFrozenColsWidth(),o=this.getColsWidth(0,t.col-1);this.scrollLeft=Math.min(o-e,this.getAllColsWidth()-i.width)}if(Q(t.row)&&t.row>=this.frozenRowCount){const e=this.getFrozenRowsHeight(),o=this.getRowsHeight(0,t.row-1);this.scrollTop=Math.min(o-e,this.getAllRowsHeight()-i.height)}this.render()}}const pk={},fk={};function vk(t,e,i){const o=t[e];return t[e]=i,o}function mk(t){for(const e in t)delete t[e]}var bk=Object.freeze({__proto__:null,chartModule:function(t,e){return null!=e?vk(pk,t,e):pk[t]},clearAll:function(){mk(sx),mk(lS),mk(pk)},editor:function(t,e){return null!=e?vk(fk,t,e):fk[t]},icon:function(t,e){return null!=e?vk(lS,t,e):lS[t]},theme:function(t,e){return null!=e?vk(sx,t,e):sx[t]}});const yk=(t,e)=>{var i,o;if(!(null==e?void 0:e.fields))return t;if(0===t.length)return t;const n=e.fields,r=t[0],s={},l=[];for(const e in n)if(Object.prototype.hasOwnProperty.call(n,e)){const a=n[e];if(!a.type){let o=r;e in r||(o=null!==(i=t.find((t=>e in t)))&&void 0!==i?i:r),a.type="number"==typeof o[e]?"linear":"ordinal"}let h;if("number"==typeof a.sortIndex&&(h={key:e,type:a.type,index:a.sortIndex,sortIndex:{},sortIndexCount:0,sortReverse:!0===a.sortReverse},l.push(h)),(null===(o=a.domain)||void 0===o?void 0:o.length)>0)if("ordinal"===a.type){a._domainCache={},s[e]=a;const t={};a.domain.forEach(((e,i)=>{t[e]=i,a._domainCache[e]=i})),h&&(h.sortIndex=t,h.sortIndexCount=a.domain.length)}else a.domain.length>=2&&(s[e]=a)}return Object.keys(s).length>0&&(t=t.filter((t=>{for(const e in s){const i=s[e];if("ordinal"===i.type){if(!(t[e]in i._domainCache))return!1}else if(i.domain[0]>t[e]||i.domain[1]<t[e])return!1}return!0}))),l.sort(((t,e)=>t.index-e.index)),t.sort(((t,e)=>function(t,e,i){for(let o=0;o<i.length;o++){const n=i[o];let r=0;if("ordinal"===n.type?(void 0===n.sortIndex[e[n.key]]&&(n.sortIndex[e[n.key]]=n.sortIndexCount++),void 0===n.sortIndex[t[n.key]]&&(n.sortIndex[t[n.key]]=n.sortIndexCount++),r=n.sortIndex[t[n.key]]-n.sortIndex[e[n.key]]):"linear"===n.type&&(r=t[n.key]-e[n.key]),n.sortReverse&&(r=-r),0!==r)return r}return 0}(t,e,l))),t};let Ck=0;function wk(){return Ck>1e8&&(Ck=0),(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"dataset")+"_"+Ck++}class xk{constructor(t){var e;let i;this.options=t,this.isDataSet=!0,this.transformMap={},this.parserMap={},this.dataViewMap={},this.target=new Y,i=(null==t?void 0:t.name)?t.name:wk("dataset"),this.name=i,this._logger=null!==(e=null==t?void 0:t.logger)&&void 0!==e?e:Nt.getInstance()}setLogger(t){this._logger=t}getDataView(t){return this.dataViewMap[t]}setDataView(t,e){var i;this.dataViewMap[t]&&(null===(i=this._logger)||void 0===i||i.error(`Error: dataView ${t} 之前已存在,请重新命名`)),this.dataViewMap[t]=e}removeDataView(t){this.dataViewMap[t]=null,delete this.dataViewMap[t]}registerParser(t,e){var i;this.parserMap[t]&&(null===(i=this._logger)||void 0===i||i.warn(`Warn: transform ${t} 之前已注册,执行覆盖逻辑`)),this.parserMap[t]=e}removeParser(t){this.parserMap[t]=null,delete this.parserMap[t]}getParser(t){return this.parserMap[t]||this.parserMap.default}registerTransform(t,e){var i;this.transformMap[t]&&(null===(i=this._logger)||void 0===i||i.warn(`Warn: transform ${t} 之前已注册,执行覆盖逻辑`)),this.transformMap[t]=e}removeTransform(t){this.transformMap[t]=null,delete this.transformMap[t]}getTransform(t){return this.transformMap[t]}multipleDataViewAddListener(t,e,i){this._callMap||(this._callMap=new Map);let o=this._callMap.get(i);o||(o=()=>{t.some((t=>t.isRunning))||i()}),t.forEach((t=>{t.target.addListener(e,o)})),this._callMap.set(i,o)}allDataViewAddListener(t,e){this.multipleDataViewAddListener(Object.values(this.dataViewMap),t,e)}multipleDataViewRemoveListener(t,e,i){if(this._callMap){const o=this._callMap.get(i);o&&t.forEach((t=>{t.target.removeListener(e,o)})),this._callMap.delete(i)}}multipleDataViewUpdateInParse(t){t.forEach((t=>{var e;return null===(e=this.getDataView(t.name))||void 0===e?void 0:e.markRunning()})),t.forEach((t=>{var e;return null===(e=this.getDataView(t.name))||void 0===e?void 0:e.parseNewData(t.data,t.options)}))}multipleDataViewUpdateInRawData(t){t.forEach((t=>{var e;return null===(e=this.getDataView(t.name))||void 0===e?void 0:e.markRunning()})),t.forEach((t=>{var e;return null===(e=this.getDataView(t.name))||void 0===e?void 0:e.updateRawData(t.data,t.options)}))}destroy(){this.transformMap=null,this.parserMap=null,this.dataViewMap=null,this._callMap=null,this.target.removeAllListeners()}}const _k="_data-view-diff-rank";class Sk{constructor(t,e){var i=this;let o;this.dataSet=t,this.options=e,this.isDataView=!0,this.target=new Y,this.parseOption=null,this.transformsArr=[],this.isRunning=!1,this.rawData={},this.history=!1,this.parserData={},this.latestData={},this._fields=null,this.reRunAllTransform=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{pushHistory:!0,emitMessage:!0};return i.isRunning=!0,i.resetTransformData(),i.transformsArr.forEach((e=>{i.executeTransform(e,{pushHistory:t.pushHistory,emitMessage:!1}),i.isLastTransform(e)&&i.diffLastData()})),i.isRunning=!1,!1!==t.emitMessage&&i.target.emit("change",[]),i},this.markRunning=()=>{this.isRunning=!0,this.target.emit("markRunning",[])},o=(null==e?void 0:e.name)?e.name:wk("dataview"),this.name=o,(null==e?void 0:e.history)&&(this.history=e.history,this.historyData=[]),this.dataSet.setDataView(o,this),this.setFields(null==e?void 0:e.fields)}parse(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];var o;this.isRunning=!0,i&&this.target.emit("beforeParse",[]),e&&(this.parseOption=e);const n=this.cloneParseData(t,e);if(null==e?void 0:e.type){const t=(null!==(o=this.dataSet.getParser(e.type))&&void 0!==o?o:this.dataSet.getParser("bytejson"))(n,e.options,this);this.rawData=n,this.parserData=t,this.history&&this.historyData.push(n,t),this.latestData=t}else this.parserData=n,this.rawData=n,this.history&&this.historyData.push(n),this.latestData=n;return this.isRunning=!1,i&&this.target.emit("afterParse",[]),this}transform(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(this.isRunning=!0,t&&t.type){let i=!0;if("fields"===t.type){this._fields=t.options.fields;const e=this.transformsArr.findIndex((e=>e.type===t.type));e>=0&&(i=!1,this.transformsArr[e].options.fields=this._fields)}if(i&&this.transformsArr.push(t),e){const e=this.isLastTransform(t);this.executeTransform(t),e&&this.diffLastData()}}return this.sortTransform(),this.isRunning=!1,this}isLastTransform(t){return this.transformsArr[this.transformsArr.length-1]===t}sortTransform(){this.transformsArr.length>=2&&this.transformsArr.sort(((t,e)=>{var i,o;return(null!==(i=t.level)&&void 0!==i?i:0)-(null!==(o=e.level)&&void 0!==o?o:0)}))}executeTransform(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{pushHistory:!0,emitMessage:!0};const{pushHistory:i,emitMessage:o}=e,n=this.dataSet.getTransform(t.type)(this.latestData,t.options);this.history&&!1!==i&&this.historyData.push(n),this.latestData=n,!1!==o&&this.target.emit("change",[])}resetTransformData(){this.latestData=this.parserData,this.history&&(this.historyData.length=0,this.historyData.push(this.rawData,this.parserData))}enableDiff(t){this._diffData=!0,this._diffKeys=t,this._diffMap=new Map,this._diffRank=0}disableDiff(){this._diffData=!1,this._diffMap=null,this._diffRank=null}resetDiff(){this._diffMap=new Map,this._diffRank=0}diffLastData(){var t;if(!this._diffData)return;if(!this.latestData.forEach)return;if(!(null===(t=this._diffKeys)||void 0===t?void 0:t.length))return;const e=this._diffRank+1;if(0===this._diffRank)this.latestData.forEach((t=>{t[_k]=e,this._diffMap.set(this._diffKeys.reduce(((e,i)=>e+t[i]),""),t)})),this.latestDataAUD={add:Array.from(this.latestData),del:[],update:[]};else{let t;this.latestDataAUD={add:[],del:[],update:[]},this.latestData.forEach((i=>{i[_k]=e,t=this._diffKeys.reduce(((t,e)=>t+i[e]),""),this._diffMap.get(t)?this.latestDataAUD.update.push(i):this.latestDataAUD.add.push(i),this._diffMap.set(t,i)})),this._diffMap.forEach(((t,i)=>{t[_k]<e&&(this.latestDataAUD.del.push(t),this._diffMap.delete(i))}))}this._diffRank=e}cloneParseData(t,e){let i=!1;return t instanceof Sk||!0!==(null==e?void 0:e.clone)||(i=!0),i?Ct(t):t}parseNewData(t,e){this.parse(t,e||this.parseOption),this.reRunAllTransform()}updateRawData(t,e){const i=this.cloneParseData(t,e);this.rawData=i,this.parserData=i,this.latestData=i,this.reRunAllTransform()}getFields(){var t;return this._fields?this._fields:"dataview"===(null===(t=this.parseOption)||void 0===t?void 0:t.type)&&1===this.rawData.length&&this.rawData[0].getFields?this.rawData[0].getFields():null}setFields(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this._fields=t&&e?St({},this._fields,t):t;const i=this.transformsArr.find((t=>"fields"===t.type));!J(this._fields)&&J(i)?(this.dataSet.registerTransform("fields",yk),this.transform({type:"fields",options:{fields:this._fields}},!1)):i&&(i.options.fields=this._fields)}destroy(){this.dataSet.removeDataView(this.name),this._diffMap=null,this._diffRank=null,this.latestData=null,this.rawData=null,this.parserData=null,this.transformsArr=null,this.target=null}}function Ak(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:["data"];const i=t;let o;if(!Q(i)||"object"!=typeof i)return i;if(function(t){return t instanceof Sk}(i)||function(t){try{return t instanceof Element}catch(e){const i=["children","innerHTML","classList","setAttribute","tagName","getBoundingClientRect"],o=Object.keys(t);return i.every((t=>o.includes(t)))}}(i))return i;const n=rt(i),r=i.length;o=n?new Array(r):"object"==typeof i?{}:q(i)||at(i)||nt(i)?i:lt(i)?new Date(+i):void 0;const s=n?void 0:Object.keys(Object(i));let l=-1;if(o)for(;++l<(s||i).length;){const t=s?s[l]:l,n=i[t];(null==e?void 0:e.includes(t.toString()))?o[t]=n:o[t]=Ak(n,e)}return o}function Bk(t){var e,i;const o=Object.assign({},t);return vt(t.style)||(o.textStyle=Rk(t.style)),vt(t.textStyle)||St(o.textStyle,Rk(t.textStyle)),(null===(e=t.shape)||void 0===e?void 0:e.style)&&Rk(o.shape.style),(null===(i=t.background)||void 0===i?void 0:i.style)&&Rk(o.background.style),o}function Rk(t){return vt(t)||t.angle&&(t.angle=ye(t.angle)),t}function Mk(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return vt(t.style)||(t.style=Rk(t.style)),vt(t.state)||Object.keys(t.state).forEach((e=>{vt(t.state[e])||(t.state[e]=Rk(t.state[e]))})),t}function Tk(t){return vt(t)?null:(Object.keys(t).forEach((e=>{vt(t[e])||(t[e]=Rk(t[e]))})),t)}const kk={left:{textAlign:"center",textBaseline:"bottom"},right:{textAlign:"center",textBaseline:"bottom"},radius:{},angle:{}},Lk="PingFang SC,Microsoft Yahei,system-ui,-apple-system,segoe ui,Roboto,Helvetica,Arial,sans-serif, apple color emoji,segoe ui emoji,segoe ui symbol",Pk=14,Ek=14,Hk=4,Fk={domainLine:{visible:!0,style:{lineWidth:1,stroke:"#D9DDE4",strokeOpacity:1}},grid:{visible:!0,style:{lineWidth:1,stroke:"#EBEDF2",strokeOpacity:1,lineDash:[]}},subGrid:{visible:!1,style:{lineWidth:1,stroke:"#EBEDF2",strokeOpacity:1,lineDash:[4,4]}},tick:{visible:!0,tickSize:Hk,style:{lineWidth:1,stroke:"#D9DDE4",strokeOpacity:1}},subTick:{visible:!1,tickSize:Hk/2,style:{lineWidth:1,stroke:"#D9DDE4",strokeOpacity:1}},label:{visible:!0,space:1,style:{fontSize:Ek,fill:"#89909D",fontWeight:"normal",fillOpacity:1},autoLimit:!0},title:{space:10,style:{fontSize:Ek,fill:"#333333",fontWeight:"normal",fillOpacity:1}}};function zk(t){var e,i,o,n,r,s,l,a,h,d,c,u,g;const p=St({},t);let f,v=null!==(i=null===(e=p.title)||void 0===e?void 0:e.angle)&&void 0!==i?i:0;"left"!==p.orient&&"right"!==p.orient||(null===(o=p.title)||void 0===o?void 0:o.autoRotate)&&J(p.title.angle)&&(v="left"===p.orient?-90:90,f=kk[p.orient]);const m=function(t,e){if(!t||!it(t))return t;const i={};return Object.keys(t).forEach((o=>{const n=t[o];let r=!1;e.forEach((t=>{(nt(t)&&t===o||t instanceof RegExp&&o.match(t))&&(r=!0)})),r||(i[o]=n)})),i}(p.label,["style","formatMethod","state"]);return{orient:p.orient,select:p.select,hover:p.hover,line:(b=p.domainLine,Mk(b),Mk(b.startSymbol),Mk(b.endSymbol),b),label:Object.assign({style:Rk(p.label.style),formatMethod:p.label.formatMethod?(t,e,i)=>p.label.formatMethod(e.rawValue,e):null,state:Tk(p.label.state)},m),tick:{visible:p.tick.visible,length:p.tick.tickSize,inside:p.tick.inside,alignWithLabel:p.tick.alignWithLabel,style:Rk(p.tick.style),state:Tk(p.tick.state),dataFilter:p.tick.dataFilter},subTick:{visible:p.subTick.visible,length:p.subTick.tickSize,inside:p.subTick.inside,count:p.subTick.tickCount,style:Rk(p.subTick.style),state:Tk(p.subTick.state)},grid:{type:"line",visible:p.grid.visible,alternateColor:p.grid.alternateColor,alignWithLabel:p.grid.alignWithLabel,style:Rk(p.grid.style)},subGrid:{type:"line",visible:p.subGrid.visible,alternateColor:p.subGrid.alternateColor,style:Rk(p.subGrid.style)},title:{visible:p.title.visible,position:p.title.position,space:p.title.space,autoRotate:!1,angle:v?ye(v):null,textStyle:St({},f,Rk(p.title.style)),padding:p.title.padding,shape:{visible:null===(n=p.title.shape)||void 0===n?void 0:n.visible,space:null===(r=p.title.shape)||void 0===r?void 0:r.space,style:Rk(null===(s=p.title.shape)||void 0===s?void 0:s.style)},background:{visible:null===(l=p.title.background)||void 0===l?void 0:l.visible,style:Rk(null===(a=p.title.background)||void 0===a?void 0:a.style)},state:{text:Tk(p.title.state),shape:Tk(null===(h=p.title.shape)||void 0===h?void 0:h.state),background:Tk(null===(d=p.title.background)||void 0===d?void 0:d.state)}},panel:{visible:null===(c=p.background)||void 0===c?void 0:c.visible,style:Rk(null===(u=p.background)||void 0===u?void 0:u.style),state:Tk(null===(g=p.background)||void 0===g?void 0:g.state)}};var b}class Ik{constructor(t,e,i,o){this.seqId=0,this.leftRowSeriesNumberColumnCount=0,this.rightRowSeriesNumberColumnCount=0,this.bodyRowSpanCount=1,this._transpose=!1,this._showHeader=!0,this._recordsCount=0,this._hasAggregation=!1,this._hasAggregationOnTopCount=0,this._hasAggregationOnBottomCount=0,this._cellRangeMap=new Map,this._showHeader=i,this._table=t,this._columns=[],this._columnsIncludeHided=[],this._headerCellIds=[],this.hierarchyIndent=null!=o?o:20,this.hierarchyTextStartAlignment=t.options.hierarchyTextStartAlignment,this.columnTree=new DT(e,{seqId:0}),this._headerObjectsIncludeHided=this._addHeaders(0,e,[]),this._headerObjects=this._headerObjectsIncludeHided.filter((t=>!0!==t.define.hide)),this._headerObjectMap=this._headerObjects.reduce(((t,e)=>(t[e.id]=e,t)),{}),this.rowHierarchyType=function(t){if(t._table.options.groupBy)return!0;const{columns:e}=t._table.options;if(rt(e)&&e.length>0)for(let t=0;t<e.length;t++){const i=e[t];if(!nt(i)&&i.tree)return!0}return!1}(this)?"tree":"grid",this._hasAggregation=function(t){const e=t.columnObjects;for(let t=0;t<e.length;t++){const i=e[t];if(null==i?void 0:i.aggregation)return!0}return!1}(this),this._hasAggregationOnBottomCount=function(t){const e=t.columnObjects;let i=0;for(let t=0;t<e.length;t++){const o=e[t];(null==o?void 0:o.aggregation)&&(Array.isArray(null==o?void 0:o.aggregation)?i=Math.max(i,o.aggregation.filter((t=>!t.showOnTop)).length):o.aggregation.showOnTop||(i=Math.max(i,1)))}return i}(this),this._hasAggregationOnTopCount=function(t){const e=t.columnObjects;let i=0;for(let t=0;t<e.length;t++){const o=e[t];(null==o?void 0:o.aggregation)&&(Array.isArray(null==o?void 0:o.aggregation)?i=Math.max(i,o.aggregation.filter((t=>t.showOnTop)).length):o.aggregation.showOnTop&&(i=Math.max(i,1)))}return i}(this),this.handleRowSeriesNumber(t.internalProps.rowSeriesNumber)}handleRowSeriesNumber(t){var e,i;t&&(Array.isArray(t)?this.rowSeriesNumberColumn=t.map((e=>{var i,o;return{id:this.seqId++,title:e.title,define:e,cellType:null!==(i=e.cellType)&&void 0!==i?i:"text",headerType:null!==(o=t.cellType)&&void 0!==o?o:"text",style:e.style,width:e.width,format:e.format,field:e.field,icon:e.icon,headerIcon:e.headerIcon,isChildNode:!1}})):this.rowSeriesNumberColumn=[{id:this.seqId++,title:t.title,define:t,cellType:null!==(e=t.cellType)&&void 0!==e?e:"text",headerType:null!==(i=t.cellType)&&void 0!==i?i:"text",style:t.style,width:t.width,format:t.format,field:"",icon:t.icon,headerIcon:t.headerIcon,isChildNode:!1}],this.leftRowSeriesNumberColumn=this.rowSeriesNumberColumn.filter((t=>!0)),this.rightRowSeriesNumberColumn=this.rowSeriesNumberColumn.filter((t=>!1)),this.leftRowSeriesNumberColumnCount=this.leftRowSeriesNumberColumn.length,this.rightRowSeriesNumberColumnCount=this.rightRowSeriesNumberColumn.length)}get transpose(){return this._transpose}set transpose(t){this._transpose=t}get showHeader(){return this._showHeader}set showHeader(t){this._showHeader=t}isSeriesNumberInHeader(t,e){if(this.leftRowSeriesNumberColumnCount>0&&t>=0&&e>=0&&t<this.leftRowSeriesNumberColumnCount){if(this.transpose)return!1;if(e<this.headerLevelCount)return!0}if(this.rightRowSeriesNumberColumnCount>0&&e>=0&&t>=this.colCount-this.rightRowSeriesNumberColumnCount){if(this.transpose)return!1;if(e<this.headerLevelCount)return!0}return!1}isSeriesNumberInBody(t,e){if(this.leftRowSeriesNumberColumnCount>0&&t>=0&&t<this.leftRowSeriesNumberColumnCount){if(this.transpose)return!0;if(e>=this.headerLevelCount)return!0}if(this.rightRowSeriesNumberColumnCount>0&&t>=this.colCount-this.rightRowSeriesNumberColumnCount){if(this.transpose)return!0;if(e>=this.headerLevelCount)return!0}return!1}isSeriesNumber(t,e){if(Q(t)&&Q(e)){if(this.leftRowSeriesNumberColumnCount>0&&t>=0&&e>=0&&t<this.leftRowSeriesNumberColumnCount)return!0;if(this.rightRowSeriesNumberColumnCount>0&&e>=0&&t>=this.colCount-this.rightRowSeriesNumberColumnCount)return!0}return!1}getSeriesNumberHeader(t,e){if(this.leftRowSeriesNumberColumnCount>0&&t>=0&&t<this.leftRowSeriesNumberColumnCount){if(this.transpose)return;if(e<this.headerLevelCount)return Object.assign({},this.leftRowSeriesNumberColumn[t],{style:this._table.internalProps.rowSeriesNumber.headerStyle})}if(this.rightRowSeriesNumberColumnCount>0&&t>=this.colCount-this.rightRowSeriesNumberColumnCount&&e<this.headerLevelCount){if(this.transpose)return;if(e<this.headerLevelCount)return this.rightRowSeriesNumberColumn[t-(this.colCount-this.rightRowSeriesNumberColumnCount)]}}getSeriesNumberBody(t,e){if(this.leftRowSeriesNumberColumnCount>0&&t>=0&&t<this.leftRowSeriesNumberColumnCount){if(this.transpose)return this.leftRowSeriesNumberColumn[t];if(e>=this.headerLevelCount)return this.leftRowSeriesNumberColumn[t]}if(this.rightRowSeriesNumberColumnCount>0&&t>=this.colCount-this.rightRowSeriesNumberColumnCount){if(this.transpose)return this.rightRowSeriesNumberColumn[t-(this.colCount-this.rightRowSeriesNumberColumnCount)];if(e>=this.headerLevelCount)return this.rightRowSeriesNumberColumn[t-(this.colCount-this.rightRowSeriesNumberColumnCount)]}}isHeader(t,e){return!!(this.transpose&&t>=this.leftRowSeriesNumberColumnCount&&t<this.headerLevelCount+this.leftRowSeriesNumberColumnCount)||!this.transpose&&e>=0&&e<this.headerLevelCount}isAggregation(t,e){if(this.hasAggregation){if(this.hasAggregationOnBottomCount)if(this.transpose){if(t>=this.colCount-this.hasAggregationOnBottomCount)return!0}else if(e>=this.rowCount-this.hasAggregationOnBottomCount)return!0;if(this.hasAggregationOnTopCount)if(this.transpose){if(t>=this.rowHeaderLevelCount&&t<this.rowHeaderLevelCount+this.hasAggregationOnTopCount)return!0}else if(e>=this.columnHeaderLevelCount&&e<this.columnHeaderLevelCount+this.hasAggregationOnTopCount)return!0}return!1}isTopAggregation(t,e){if(this.hasAggregationOnTopCount)if(this.transpose){if(t>=this.rowHeaderLevelCount&&t<this.rowHeaderLevelCount+this.hasAggregationOnTopCount)return!0}else if(e>=this.columnHeaderLevelCount&&e<this.columnHeaderLevelCount+this.hasAggregationOnTopCount)return!0;return!1}isBottomAggregation(t,e){if(this.hasAggregationOnBottomCount)if(this.transpose){if(t>=this.colCount-this.hasAggregationOnBottomCount)return!0}else if(e>=this.rowCount-this.hasAggregationOnBottomCount)return!0;return!1}get hasAggregation(){return this._hasAggregation}get hasAggregationOnTopCount(){return this._hasAggregationOnTopCount}get hasAggregationOnBottomCount(){return this._hasAggregationOnBottomCount}getAggregatorsByCell(t,e){return this.getColumnDefine(t,e).vtable_aggregator}getAggregatorsByCellRange(t,e,i,o){let n=[];if(!this.transpose){for(let o=t;o<=i;o++){const t=this.getColumnDefine(o,e);t.vtable_aggregator&&(n=n.concat(Array.isArray(t.vtable_aggregator)?t.vtable_aggregator:[t.vtable_aggregator]))}return n}for(let i=e;i<=o;i++){const e=this.getColumnDefine(t,i);e.vtable_aggregator&&(n=n.concat(Array.isArray(e.vtable_aggregator)?e.vtable_aggregator:[e.vtable_aggregator]))}return[]}getAggregatorOnTop(t,e){const i=this.getColumnDefine(t,e),o=i.vtable_aggregator,n=i.aggregation;if(Array.isArray(n)){const i=n.reduce(((t,e,i)=>(e.showOnTop&&t.push(i),t)),[]).map((t=>o[t]));return this.transpose?i[t-this.rowHeaderLevelCount]:i[e-this.columnHeaderLevelCount]}return this.transpose&&t-this.rowHeaderLevelCount==0?(null==n?void 0:n.showOnTop)?o:null:this.transpose||e-this.columnHeaderLevelCount!=0?null:(null==n?void 0:n.showOnTop)?o:null}getAggregatorOnBottom(t,e){const i=this.getColumnDefine(t,e),o=i.vtable_aggregator,n=i.aggregation;if(Array.isArray(n)){const i=n.reduce(((t,e,i)=>(e.showOnTop||t.push(i),t)),[]).map((t=>o[t]));return this.transpose?i[t-(this.colCount-this.hasAggregationOnBottomCount)]:i[e-(this.rowCount-this.hasAggregationOnBottomCount)]}return this.transpose&&t-(this.colCount-this.hasAggregationOnBottomCount)==0?(null==n?void 0:n.showOnTop)?null:o:this.transpose||e-(this.rowCount-this.hasAggregationOnBottomCount)!=0||(null==n?void 0:n.showOnTop)?null:o}getAggregatorCellAddress(t,e,i,o){const n=[],r=this.hasAggregationOnTopCount,s=this.hasAggregationOnBottomCount;if(this.transpose){for(let i=e;i<=o;i++)if(this.getColumnDefine(t,i).vtable_aggregator){for(let t=0;t<r;t++)n.push({col:this.headerLevelCount+t,row:i});for(let t=0;t<s;t++)n.push({col:this.rowCount-s+t,row:i})}}else for(let o=t;o<=i;o++)if(this.getColumnDefine(o,e).vtable_aggregator){for(let t=0;t<r;t++)n.push({col:o,row:this.headerLevelCount+t});for(let t=0;t<s;t++)n.push({col:o,row:this.rowCount-s+t})}return n}getCellLocation(t,e){return this.isHeader(t,e)?this.transpose?"rowHeader":"columnHeader":"body"}isRowHeader(t,e){return!!(this.transpose&&t>=this.leftRowSeriesNumberColumnCount&&t<this.headerLevelCount+this.leftRowSeriesNumberColumnCount)}isColumnHeader(t,e){return!this.transpose&&e>=0&&e<=this.headerLevelCount-1&&t>=this.leftRowSeriesNumberColumnCount&&t<this.colCount-this.rightRowSeriesNumberColumnCount}isFrozenColumn(t,e){if(Q(e)){if(t>=0&&t<this.frozenColCount&&e>=this.frozenRowCount&&e<this.rowCount-this.bottomFrozenRowCount)return!0}else if(this.frozenColCount>0&&t>=0&&t<this.frozenColCount)return!0;return!1}isRightFrozenColumn(t,e){if(Q(e)){if(t>=this.colCount-this.rightFrozenColCount&&e>=this.frozenRowCount&&e<this.rowCount-this.bottomFrozenRowCount)return!0}else if(this.rightFrozenColCount>0&&t>=this.colCount-this.rightFrozenColCount)return!0;return!1}isFrozenRow(t,e){if(Q(e)){if(e>=0&&e<this.frozenRowCount&&t>=this.frozenColCount&&t<this.colCount-this.rightFrozenColCount)return!0}else if(e=t,this.frozenRowCount>0&&e>=0&&e<this.frozenRowCount)return!0;return!1}isBottomFrozenRow(t,e){if(Q(e)){if(e>=this.rowCount-this.bottomFrozenRowCount&&t>=this.frozenColCount&&t<this.colCount-this.rightFrozenColCount)return!0}else if(e=t,this.bottomFrozenRowCount>0&&e>=this.rowCount-this.bottomFrozenRowCount)return!0;return!1}isLeftBottomCorner(t,e){return t>=0&&t<this.rowHeaderLevelCount&&e>=this.rowCount-this.bottomFrozenRowCount}isRightTopCorner(t,e){return t>=this.colCount-this.rightFrozenColCount&&e>=0&&e<this.columnHeaderLevelCount}isRightBottomCorner(t,e){return t>=this.colCount-this.rightFrozenColCount&&e>=this.rowCount-this.bottomFrozenRowCount}isCornerHeader(t,e){return!1}getColumnHeaderRange(){var t,e;return this.transpose?{start:{col:0,row:0},end:{col:this._headerCellIds.length-1,row:(null!==(t=this.rowCount)&&void 0!==t?t:0)-1}}:{start:{col:0,row:0},end:{col:(null!==(e=this.colCount)&&void 0!==e?e:0)-1,row:this._headerCellIds.length-1}}}getRowHeaderRange(){var t,e;return this.transpose?{start:{col:0,row:0},end:{col:this._headerCellIds.length-1,row:(null!==(t=this.rowCount)&&void 0!==t?t:0)-1}}:{start:{col:0,row:0},end:{col:(null!==(e=this.colCount)&&void 0!==e?e:0)-1,row:this._headerCellIds.length-1}}}getCornerHeaderRange(){}getBodyRange(){var t,e,i,o;return this.transpose?{start:{col:this.headerLevelCount,row:0},end:{col:(null!==(t=this.colCount)&&void 0!==t?t:0)-1,row:(null!==(e=this.rowCount)&&void 0!==e?e:0)-1}}:{start:{col:0,row:this.headerLevelCount},end:{col:(null!==(i=this.colCount)&&void 0!==i?i:0)-1,row:(null!==(o=this.rowCount)&&void 0!==o?o:0)-1}}}get headerLevelCount(){return this.showHeader?this._headerCellIds.length:0}get columnHeaderLevelCount(){return this.transpose?0:this.headerLevelCount}get rowHeaderLevelCount(){return this.transpose?this.headerLevelCount:0}get frozenColCount(){return this._table.internalProps.frozenColCount?this.colCount>this._table.internalProps.frozenColCount?this._table.internalProps.frozenColCount:this.colCount:0}get frozenRowCount(){return this._table.internalProps.frozenRowCount?this.rowCount>=this._table.internalProps.frozenRowCount?this._table.internalProps.frozenRowCount:this.rowCount:0}get bottomFrozenRowCount(){return this._table.internalProps.bottomFrozenRowCount?this.rowCount-this.headerLevelCount>=this._table.internalProps.bottomFrozenRowCount?this._table.internalProps.bottomFrozenRowCount:this.rowCount-this.headerLevelCount:0}get rightFrozenColCount(){return this._table.internalProps.rightFrozenColCount?this.colCount-this.frozenColCount>=this._table.internalProps.rightFrozenColCount?this._table.internalProps.rightFrozenColCount:Math.max(0,this.colCount-this.frozenColCount):0}get colCount(){return this.transpose?this.headerLevelCount+this.recordsCount+this.leftRowSeriesNumberColumnCount+this.rightRowSeriesNumberColumnCount:this._columns.length+this.leftRowSeriesNumberColumnCount+this.rightRowSeriesNumberColumnCount}get rowCount(){return this.transpose?this._columns.length:this.headerLevelCount+this.recordsCount}get bodyRowCount(){return this.transpose?this._columns.length:this.rowCount-this.bottomFrozenRowCount-this.headerLevelCount}get bodyColCount(){return this.transpose?this.colCount-this.rightFrozenColCount-this.rowHeaderLevelCount:this._columns.length}get recordsCount(){return this._recordsCount}set recordsCount(t){this._recordsCount=t}get headerObjects(){return this._headerObjects}get columnObjects(){return this._columns}get headerObjectsIncludeHided(){return this._headerObjectsIncludeHided}get columnWidths(){if(this.leftRowSeriesNumberColumnCount){const t=this.leftRowSeriesNumberColumn.map((t=>({width:t.width,minWidth:t.minWidth,maxWidth:t.maxWidth})));return t.push(...this._columns.map((t=>({width:t.width,minWidth:t.minWidth,maxWidth:t.maxWidth})))),t}return this._columns.map((t=>({width:t.width,minWidth:t.minWidth,maxWidth:t.maxWidth})))}getColumnWidthDefined(t){var e;if(t>=0){if(t<this.leftRowSeriesNumberColumnCount)return this.leftRowSeriesNumberColumn[t];if(this.transpose){let i,o,n=0;if(t>=this.rowHeaderLevelCount+this.leftRowSeriesNumberColumnCount){let t;return this.columnObjects.forEach(((e,r)=>{"number"==typeof e.width?n=Math.max(e.width,n):"auto"===e.width&&(t=!0),"number"==typeof e.minWidth&&(o=Math.max(e.minWidth,o)),"number"==typeof e.maxWidth&&(i=Math.max(e.maxWidth,i))})),n=n>0?n:t?"auto":void 0,{width:n,minWidth:o,maxWidth:i}}if(this.isRowHeader(t,0)){const i=Array.isArray(this._table.defaultHeaderColWidth)?null!==(e=this._table.defaultHeaderColWidth[t])&&void 0!==e?e:this._table.defaultColWidth:this._table.defaultHeaderColWidth;return"auto"===i?{width:"auto"}:{width:i}}}return this._columns[t-this.leftRowSeriesNumberColumnCount]}}getCellId(t,e){var i,o,n,r;return this.transpose?t>=this.headerLevelCount+this.leftRowSeriesNumberColumnCount?null===(i=this._columns[e])||void 0===i?void 0:i.id:this.isSeriesNumber(t,e)?e+"_series_number":null===(o=this._headerCellIds[t-this.leftRowSeriesNumberColumnCount])||void 0===o?void 0:o[e]:this.isSeriesNumber(t,e)?this.rowSeriesNumberColumn[t].id:this.headerLevelCount<=e?null===(n=this._columns[t-this.leftRowSeriesNumberColumnCount])||void 0===n?void 0:n.id:null===(r=this._headerCellIds[e])||void 0===r?void 0:r[t-this.leftRowSeriesNumberColumnCount]}getHeader(t,e){if(this.isSeriesNumberInHeader(t,e))return this.getSeriesNumberHeader(t,e);const i=this.getCellId(t,e);return this._headerObjectMap[i]}getHeaderField(t,e){var i;const o=this.getCellId(t,e);return(null===(i=this._headerObjectMap[o])||void 0===i?void 0:i.field)||(this.transpose?this._columns[e]&&this._columns[e].field:this._columns[t-this.leftRowSeriesNumberColumnCount]&&this._columns[t-this.leftRowSeriesNumberColumnCount].field)}getHeaderCellAdressById(t){for(let e=0;e<this._headerCellIds.length;e++){const i=this._headerCellIds[e];for(let o=0;o<i.length;o++)if(i[o]===t)return this.transpose?{col:e,row:o}:{col:o+this.leftRowSeriesNumberColumnCount,row:e}}}getHeaderCellAddressByField(t){const e=this.headerObjects.find((e=>e&&e.field===t));return e&&this.getHeaderCellAdressById(e.id)}getBody(t,e){return this.isSeriesNumber(t,e)?this.getSeriesNumberBody(t,e):this.transpose?this._columns[e]:this._columns[t-this.leftRowSeriesNumberColumnCount]}getBodyLayoutRangeById(t){var e,i;if(this.transpose){for(let i=0;i<(null!==(e=this.rowCount)&&void 0!==e?e:0);i++)if(t===this._columns[i].id)return{start:{col:0,row:i},end:{col:0,row:i}}}else for(let e=this.leftRowSeriesNumberColumnCount;e<(null!==(i=this.colCount)&&void 0!==i?i:0);e++)if(t===this._columns[e-this.leftRowSeriesNumberColumnCount].id)return{start:{col:e,row:0},end:{col:e,row:0}};return{start:{col:-1,row:-1},end:{col:-1,row:-1}}}getCellRange(t,e){return function(t,e,i){var o,n,r;if(-1===t||-1===e)return{start:{col:t,row:e},end:{col:t,row:e}};if(i._cellRangeMap.has(`$${t}$${e}`))return i._cellRangeMap.get(`$${t}$${e}`);let s={start:{col:t,row:e},end:{col:t,row:e}};if(i.transpose)s=function(t,e,i){var o,n,r,s;const l={start:{col:t,row:e},end:{col:t,row:e}};if(i.headerLevelCount+i.leftRowSeriesNumberColumnCount<=t||-1===t&&-1===e){if(i.headerLevelCount+i.leftRowSeriesNumberColumnCount<=t&&(null===(n=null===(o=i.columnObjects[e])||void 0===o?void 0:o.define)||void 0===n?void 0:n.mergeCell)){const o=i._table.getCellValue(t,e);for(let n=t-1;n>=i.headerLevelCount+i.leftRowSeriesNumberColumnCount;n--){const t=i._table.getCellValue(n,e);if("boolean"==typeof i.columnObjects[e].define.mergeCell){if(o!==t)break}else if(!i.columnObjects[e].define.mergeCell(o,t))break;l.start.col=n}for(let n=t+1;n<(null!==(r=i.colCount)&&void 0!==r?r:0);n++){const t=i._table.getCellValue(n,e);if("boolean"==typeof i.columnObjects[e].define.mergeCell){if(o!==t)break}else if(!i.columnObjects[e].define.mergeCell(o,t))break;l.end.col=n}}return l}const a=i.getCellId(t,e);for(let o=e-1;o>=0&&a===i.getCellId(t,o);o--)l.start.row=o;for(let o=e+1;o<(null!==(s=i.rowCount)&&void 0!==s?s:0)&&a===i.getCellId(t,o);o++)l.end.row=o;for(let o=t-1;o>=0&&a===i.getCellId(o,e);o--)l.start.col=o;for(let o=t+1;o<i.headerLevelCount+i.leftRowSeriesNumberColumnCount&&a===i.getCellId(o,e);o++)l.end.col=o;return l}(t,e,i);else if(i.headerLevelCount<=e){if(i.headerLevelCount<=e&&(null===(n=null===(o=i.columnObjects[t-i.leftRowSeriesNumberColumnCount])||void 0===o?void 0:o.define)||void 0===n?void 0:n.mergeCell)){const o=i._table.getCellValue(t,e);for(let n=e-1;n>=i.headerLevelCount;n--){const e=i._table.getCellValue(t,n);if("boolean"==typeof i.columnObjects[t-i.leftRowSeriesNumberColumnCount].define.mergeCell){if(o!==e)break}else if(!i.columnObjects[t-i.leftRowSeriesNumberColumnCount].define.mergeCell(o,e))break;s.start.row=n}for(let n=e+1;n<i.rowCount;n++){const e=i._table.getCellValue(t,n);if("boolean"==typeof i.columnObjects[t-i.leftRowSeriesNumberColumnCount].define.mergeCell){if(o!==e)break}else if(!i.columnObjects[t-i.leftRowSeriesNumberColumnCount].define.mergeCell(o,e))break;s.end.row=n}}!function(t,e,i,o){if("tree"!==o.rowHierarchyType)return;const n=o._table.getCellRawRecord(t,e);(null==n?void 0:n.vtableMerge)&&(i.start.col=o.rowHeaderLevelCount,i.end.col=o.colCount-1,i.start.row=i.end.row=e)}(t,e,s,i)}else{const o=i.getCellId(t,e);for(let n=t-1;n>=0&&o===i.getCellId(n,e);n--)s.start.col=n;for(let n=t+1;n<(null!==(r=i.colCount)&&void 0!==r?r:0)&&o===i.getCellId(n,e);n++)s.end.col=n;for(let n=e-1;n>=0&&o===i.getCellId(t,n);n--)s.start.row=n;for(let n=e+1;n<i.headerLevelCount&&o===i.getCellId(t,n);n++)s.end.row=n}return i._cellRangeMap.set(`$${t}$${e}`,s),s}(t,e,this)}isCellRangeEqual(t,e,i,o){const n=this.getCellRange(t,e),r=this.getCellRange(i,o);return n.start.col===r.start.col&&n.end.col===r.end.col&&n.start.row===r.start.row&&n.end.row===r.end.row}getRecordShowIndexByCell(t,e){const i=this.hasAggregationOnTopCount?this.headerLevelCount+1:this.headerLevelCount;return this.transpose?t<i?-1:t-i:e<i?-1:e-i}getRecordStartRowByRecordIndex(t){return(this.hasAggregationOnTopCount?this.headerLevelCount+1:this.headerLevelCount)+t}_addHeaders(t,e,i,o){const n=[],r=this._newRow(t,o);return e.forEach((e=>{var s,l,a,h;const d=this._columns.length,c=this.seqId++,u={id:c,title:null!==(s=e.title)&&void 0!==s?s:e.caption,headerIcon:e.headerIcon,field:e.field,style:e.headerStyle,headerType:null!==(l=e.headerType)&&void 0!==l?l:"text",dropDownMenu:e.dropDownMenu,define:e,columnWidthComputeMode:e.columnWidthComputeMode};n[c]=u;for(let e=t-1;e>=0;e--)this._headerCellIds[e]&&(this._headerCellIds[e][d]=i[e]);if(o?this._headerCellIds[t-1]&&(r[d]=this._headerCellIds[t-1][d]):r[d]=c,e.columns)this._addHeaders(t+1,e.columns,[...i,c],e.hideColumnsSubHeader||o).forEach((t=>n.push(t)));else{const i={id:this.seqId++,field:e.field,fieldFormat:e.fieldFormat,width:e.width,minWidth:e.minWidth,maxWidth:e.maxWidth,icon:e.icon,cellType:null!==(h=null!==(a=e.cellType)&&void 0!==a?a:e.columnType)&&void 0!==h?h:"text",chartModule:"chartModule"in e?e.chartModule:null,chartSpec:"chartSpec"in e?e.chartSpec:null,sparklineSpec:"sparklineSpec"in e?e.sparklineSpec:cx,style:e.style,define:e,columnWidthComputeMode:e.columnWidthComputeMode,disableColumnResize:null==e?void 0:e.disableColumnResize,aggregation:e.aggregation,isChildNode:t>=1};if(this._columnsIncludeHided.push(i),!0!==e.hide){this._columns.push(i);for(let e=t+1;e<this._headerCellIds.length;e++)this._headerCellIds[e][d]=c}}})),n}_newRow(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(this._headerCellIds[t]){const e=this._headerCellIds[t-1];if(e.length>this._headerCellIds[t].length)for(let i=this._headerCellIds[t].length;i<e.length;i++)this._headerCellIds[t][i]=e[i];return this._headerCellIds[t]}if(e)return[];const i=this._headerCellIds[t]=[];if(!this._columns.length)return i;const o=this._headerCellIds[t-1];for(let t=0;t<o.length;t++)i[t]=o[t];return i}getCellHeaderPaths(t,e){if(this.isSeriesNumber(t,e))return;let i=[],o=[];return this.transpose?o=[{field:this._columns[e].field}]:i=[{field:this._columns[t-this.leftRowSeriesNumberColumnCount].field}],{colHeaderPaths:i,rowHeaderPaths:o,cellLocation:this.getCellLocation(t,e)}}getParentCellId(t,e){if(0!==e){if(this.isColumnHeader(t,e))return this.getCellId(t,e-1);if(this.isRowHeader(t,e)){if(this.isSeriesNumberInBody(t-1,e))return;return this.getCellId(t-1,e)}}}canMoveHeaderPosition(t,e){if(this.isSeriesNumberInHeader(e.col,e.row)||this.isSeriesNumberInHeader(t.col,t.row))return!1;if(!this.transpose&&this.isSeriesNumberInBody(e.col,e.row)&&this.isSeriesNumberInBody(t.col,t.row)){const i=this.getRecordShowIndexByCell(0,t.row),o=this.getRecordShowIndexByCell(0,e.row);return this._table.dataSource.isCanExchangeOrder(i,o)}if(this.transpose&&this.isSeriesNumberInBody(e.col,e.row)&&this.isSeriesNumberInBody(t.col,t.row)&&(this.getBody(t.col+this.leftRowSeriesNumberColumnCount,t.row).isChildNode&&this.getBody(e.col+this.leftRowSeriesNumberColumnCount,e.row).isChildNode?(t.col=t.col+this.leftRowSeriesNumberColumnCount+this.rowHeaderLevelCount-1,e.col=e.col+this.leftRowSeriesNumberColumnCount+this.rowHeaderLevelCount-1):(t.col=t.col+this.leftRowSeriesNumberColumnCount,e.col=e.col+this.leftRowSeriesNumberColumnCount)),t.col<0||t.row<0||e.col<0||e.row<0)return!1;if("disabled"===this._table.internalProps.frozenColDragHeaderMode&&this._table.isFrozenColumn(e.col))return!1;const i=this.getCellRange(t.col,t.row);return this.isColumnHeader(t.col,t.row)?this.getParentCellId(t.col,i.start.row)===this.getParentCellId(e.col,i.start.row):!!this.isRowHeader(t.col,t.row)&&this.getParentCellId(i.start.col,t.row)===this.getParentCellId(i.start.col,e.row)}moveHeaderPosition(t,e){if(this.canMoveHeaderPosition(t,e)){let i=this.getCellRange(t.col,t.row);if(this.isColumnHeader(t.col,t.row)){const o=i.end.col-i.start.col+1;let n;const r=this.getCellRange(e.col,i.start.row);if(n=e.col>=t.col?r.end.col-o+1:r.start.col,n===i.start.col)return null;for(let t=0;t<this._headerCellIds.length;t++){const e=this._headerCellIds[t].splice(i.start.col-this.leftRowSeriesNumberColumnCount,o);e.unshift(n-this.leftRowSeriesNumberColumnCount,0),Array.prototype.splice.apply(this._headerCellIds[t],e)}const s=this._columns.splice(i.start.col-this.leftRowSeriesNumberColumnCount,o);return s.unshift(n-this.leftRowSeriesNumberColumnCount,0),Array.prototype.splice.apply(this._columns,s),this.columnTree.movePosition(i.start.row,i.start.col-this.leftRowSeriesNumberColumnCount,n-this.leftRowSeriesNumberColumnCount),this.columnTree.reset(this.columnTree.tree.children,!0),this._cellRangeMap=new Map,{sourceIndex:i.start.col,targetIndex:n,sourceSize:o,targetSize:r.end.col-r.start.col+1,moveType:"column"}}if(this.isRowHeader(t.col,t.row)||this.isSeriesNumberInBody(t.col,t.row)&&this.transpose){this.isSeriesNumberInBody(t.col,t.row)&&(i=this.getCellRange(t.col+this.leftRowSeriesNumberColumnCount,t.row));const o=i.end.row-i.start.row+1;let n;const r=this.getCellRange(i.start.col,e.row);if(n=e.row>=t.row?r.end.row-o+1:r.start.row,n===i.start.row)return null;for(let t=0;t<this._headerCellIds.length;t++){const e=this._headerCellIds[t].splice(i.start.row,o);e.unshift(n,0),Array.prototype.splice.apply(this._headerCellIds[t],e)}const s=this._columns.splice(i.start.row,o);return s.unshift(n,0),Array.prototype.splice.apply(this._columns,s),this.columnTree.movePosition(i.start.col-this.leftRowSeriesNumberColumnCount,i.start.row,n+(e.row>t.row?i.end.row-i.start.row:0)),this.columnTree.reset(this.columnTree.tree.children,!0),this._cellRangeMap=new Map,{sourceIndex:i.start.row,targetIndex:n,sourceSize:o,targetSize:r.end.row-r.start.row+1,moveType:"row"}}if(this.isSeriesNumberInBody(t.col,t.row))return{sourceIndex:t.row,targetIndex:e.row,sourceSize:1,targetSize:1,moveType:"row"}}return null}toggleHierarchyState(t){return{addCellPositions:t.add.map((t=>({col:0,row:this._table.frozenRowCount+t}))),removeCellPositions:t.remove.map((t=>({col:0,row:this._table.frozenRowCount+t})))}}setChartInstance(t,e,i){const o=this.transpose?this._columns[e]:this._columns[t-this.leftRowSeriesNumberColumnCount];"function"!=typeof o.chartSpec&&(o.chartInstance=i)}getChartInstance(t,e){return(this.transpose?this._columns[e]:this._columns[t-this.leftRowSeriesNumberColumnCount]).chartInstance}checkHasChart(){return function(t){let e=!1;for(let i=0;i<t.columnObjects.length;i++)if(t.columnObjects[i].chartSpec){e=!0;break}return e}(this)}getAxisConfigInPivotChart(t,e){}isEmpty(t,e){return!1}isAxisCell(t,e){return!1}getChartAxes(t,e){return[]}isShareChartSpec(t,e){const i=this.getBody(t,e);return"function"!=typeof(null==i?void 0:i.chartSpec)}getChartSpec(t,e){return this.getRawChartSpec(t,e)}getRawChartSpec(t,e){const i=this.getBody(t,e),o=null==i?void 0:i.chartSpec;return"function"==typeof o?o({col:t,row:e,dataValue:this._table.getCellOriginValue(t,e)||"",value:this._table.getCellValue(t,e)||"",rect:this._table.getCellRangeRelativeRect(this._table.getCellRange(t,e)),table:this._table}):o}getChartDataId(t,e){return function(t,e,i){var o;const n=i.getRawChartSpec(t,e);if(null==n?void 0:n.series){const t={};return(null===(o=n.data)||void 0===o?void 0:o.id)&&(t[n.data.id]=void 0),null==n||n.series.forEach((e=>{var i,o,r,s,l,a,h,d,c,u,g;if(!(null===(i=e.data)||void 0===i?void 0:i.fromDataId))if(null===(o=e.data)||void 0===o?void 0:o.transforms)t[null!==(g=null!==(c=null===(d=e.data)||void 0===d?void 0:d.id)&&void 0!==c?c:null===(u=n.data)||void 0===u?void 0:u.id)&&void 0!==g?g:"data"]=void 0;else{const i="horizontal"===e.direction?e.xField:e.yField;t[null!==(a=null!==(s=null===(r=e.data)||void 0===r?void 0:r.id)&&void 0!==s?s:null===(l=n.data)||void 0===l?void 0:l.id)&&void 0!==a?a:"data"]=(null===(h=e.data)||void 0===h?void 0:h.id)?i:void 0}})),t}return n.data.id}(t,e,this)}release(){const t=this._table._getActiveChartInstance();null==t||t.release(),this.columnObjects.forEach((t=>{var e;null===(e=t.chartInstance)||void 0===e||e.release()}))}clearCellRangeMap(){this._cellRangeMap.clear()}updateColumnTitle(t,e,i){const o=this._table.internalProps.layoutMap.getHeader(t,e);o.title=i,o.define.title=i}getColumnByField(t){var e;return null===(e=this.columnObjects)||void 0===e?void 0:e.reduce(((e,i,o)=>(i.field===t&&e.push({col:o,columnDefine:i}),e)),[])}getColumnDefine(t,e){if(t>=0)return t<this.leftRowSeriesNumberColumnCount?this.leftRowSeriesNumberColumn[t].define:this.transpose?this._columns[e].define:this._columns[t-this.leftRowSeriesNumberColumnCount].define}}class Ok{constructor(t){this.table=t,this.bindEvent()}bindEvent(){this.table.internalProps.handler;const t=this.table.options.editCellTrigger;this.table.on(Xw.DBLCLICK_CELL,(e=>{var i;if(!t||"doubleclick"===t||Array.isArray(t)&&t.includes("doubleclick")){const{col:t,row:o}=e,n=Y_(e.federatedEvent),r=this.table.scenegraph.getResizeColAt(n.abstractPos.x,n.abstractPos.y,null===(i=n.eventArgs)||void 0===i?void 0:i.targetCell);if(this.table._canResizeColumn(r.col,r.row)&&r.col>=0)return;this.startEditCell(t,o)}})),this.table.on(Xw.CLICK_CELL,(e=>{if("click"===t||Array.isArray(t)&&t.includes("click")){const{col:t,row:i}=e;this.startEditCell(t,i)}}))}startEditCell(t,e,i){var o,n,r,s,l;if(this.editingEditor)return;const a=this.table.getEditor(t,e);if(a){if(null===(n=null===(o=this.table.internalProps.layoutMap)||void 0===o?void 0:o.isAggregation)||void 0===n?void 0:n.call(o,t,e))return;this.editingEditor||(this.editCell={col:t,row:e}),this.editingEditor=a;const h=Q(i)?i:this.table.getCellOriginValue(t,e),d=this.table.getCellRangeRelativeRect(this.table.getCellRange(t,e)),c={rect:{left:d.left,top:d.top,width:d.width,height:d.height}};a.beginEditing,null===(r=a.beginEditing)||void 0===r||r.call(a,this.table.getElement(),c,h),a.bindSuccessCallback,null===(s=a.bindSuccessCallback)||void 0===s||s.call(a,(()=>{this.completeEdit()})),null===(l=a.onStart)||void 0===l||l.call(a,{value:h,endEdit:()=>{this.completeEdit()},referencePosition:c,container:this.table.getElement(),col:t,row:e})}}completeEdit(t){var e,i;if(!this.editingEditor)return!0;const o=null==t?void 0:t.target,{editingEditor:n}=this;if(o)if(n.targetIsOnEditor){if(n.targetIsOnEditor(o))return!1}else if(!n.isEditorElement||n.isEditorElement(o))return!1;if(this.editingEditor.getValue,this.editingEditor.validateValue){const t=null===(i=(e=this.editingEditor).validateValue)||void 0===i?void 0:i.call(e);return Fw(t)?new Promise(((e,i)=>{t.then((t=>{t?(this.doExit(),e(!0)):e(!1)})).catch((t=>{i(t)}))})):!!t&&(this.doExit(),!0)}return this.doExit(),!0}doExit(){var t,e,i,o,n,r;const s=null===(e=(t=this.editingEditor).getValue)||void 0===e?void 0:e.call(t),l=this.table.getCellRange(this.editCell.col,this.editCell.row),a=[];for(let t=l.start.row;t<=l.end.row;t++){const t=[];for(let e=l.start.col;e<=l.end.col;e++)t.push(s);a.push(t)}this.table.changeCellValues(l.start.col,l.start.row,a),this.editingEditor.exit,null===(o=(i=this.editingEditor).exit)||void 0===o||o.call(i),null===(r=(n=this.editingEditor).onEnd)||void 0===r||r.call(n),this.editingEditor=null}cancelEdit(){var t,e,i,o;this.editingEditor&&(null===(e=(t=this.editingEditor).exit)||void 0===e||e.call(t),null===(o=(i=this.editingEditor).onEnd)||void 0===o||o.call(i),this.editingEditor=null)}}function Dk(t){return nt(t)?{groupByRules:[t]}:rt(t)?{groupByRules:t.map((t=>nt(t)?t:t.key))}:{}}function Wk(t,e,i,o){if("group"===o)return o;if("sort"===o&&!i.options.groupBy)return o;let n="normal";return i.options.groupBy?n="group":!i.isHeader(t,e)&&i.dataSource.lastOrderField&&i.getBodyField(t,e)===i.dataSource.lastOrderField&&(n="sort"),n}function Nk(t){let e=t.sortState;e=!e||Array.isArray(e)?e:[e],e&&(e=e.map((e=>{var i;return e.orderFn=null!==(i=t._getSortFuncFromHeaderOption(void 0,e.field))&&void 0!==i?i:yw,e})),t.dataSource.sort(e))}class Gk extends gk{constructor(t,e){var i,o,n,r;"node"===sw.mode?(e=t,t=null):t instanceof HTMLElement||(e=t,t=t.container?t.container:null),super(t,e),this.showHeader=!0;const s=this.internalProps;if(s.frozenColDragHeaderMode=e.frozenColDragHeaderMode,this.pagination=e.pagination,s.sortState=e.sortState,s.multipleSort=!!e.multipleSort,s.dataConfig=e.groupBy?Dk(e.groupBy):{},s.columns=e.columns?Ak(e.columns,["children"]):e.header?Ak(e.header,["children"]):[],V_(this),s.enableTreeNodeMerge=null!==(o=null!==(i=e.enableTreeNodeMerge)&&void 0!==i?i:Q(e.groupBy))&&void 0!==o&&o,this.internalProps.headerHelper.setTableColumnsEditor(),this.showHeader=null===(n=e.showHeader)||void 0===n||n,this.transpose=null!==(r=e.transpose)&&void 0!==r&&r,"node"!==sw.mode&&(this.editorManager=new Ok(this)),this.refreshHeader(),this.internalProps.useOneRowHeightFillAll=!1,e.dataSource?W_(this,e.dataSource):e.records?this.setRecords(e.records,{sortState:s.sortState}):this.setRecords([]),e.title){const t=Tx.getComponent("title");s.title=new t(e.title,this),this.scenegraph.resize()}if(this.options.emptyTip)if(this.internalProps.emptyTip)this.internalProps.emptyTip.resetVisible();else{const t=Tx.getComponent("emptyTip");this.internalProps.emptyTip=new t(this.options.emptyTip,this),this.internalProps.emptyTip.resetVisible()}if(e.enableTreeStickCell){const t=Tx.getComponent("listTreeStickCellPlugin");this.listTreeStickCellPlugin=new t(this)}setTimeout((()=>{this.fireListeners(Xw.INITIALIZED,null)}),0)}isListTable(){return!0}isPivotTable(){return!1}isPivotChart(){return!1}get sortState(){return this.internalProps.sortState}get records(){var t;return null===(t=this.dataSource)||void 0===t?void 0:t.records}get recordsCount(){return this.dataSource.records.length}updateColumns(t){var e,i,o,n;const r={col:this.stateManager.hover.cellPos.col,row:this.stateManager.hover.cellPos.row};this.internalProps.columns=Ak(t,["children"]),V_(this),this.options.columns=t,this.internalProps.headerHelper.setTableColumnsEditor(),this._hasAutoImageColumn=void 0,this.refreshHeader(),null===(i=(e=this.dataSource).updateColumns)||void 0===i||i.call(e,this.internalProps.columns),this.records&&function(t){for(let e=0;e<t.length;e++)if(t[e].aggregation)return!0;return!1}(t)&&this.dataSource.processRecords(null!==(n=null===(o=this.dataSource.dataSourceObj)||void 0===o?void 0:o.records)&&void 0!==n?n:this.dataSource.dataSourceObj),this.internalProps.useOneRowHeightFillAll=!1,this.scenegraph.clearCells(),this.headerStyleCache=new Map,this.bodyStyleCache=new Map,this.bodyBottomStyleCache=new Map,this.scenegraph.createSceneGraph(),this.stateManager.updateHoverPos(r.col,r.row),this.renderAsync(),this.eventManager.updateEventBinder()}get columns(){return this.internalProps.layoutMap.columnTree.getCopiedTree()}get header(){return this.internalProps.columns}set header(t){this.internalProps.columns=t,V_(this),this.options.header=t,this.refreshHeader(),this.internalProps.useOneRowHeightFillAll=!1,this.renderAsync()}get transpose(){var t;return null!==(t=this.internalProps.transpose)&&void 0!==t&&t}set transpose(t){this.internalProps.transpose!==t&&(this.internalProps.transpose=t,this.internalProps.layoutMap&&(this.internalProps.layoutMap.transpose=t,this.refreshRowColCount(),this._resetFrozenColCount(),this.renderAsync()))}getCellValue(t,e,i){if(-1===t||-1===e)return null;if(!i){const i=this.getCustomMergeValue(t,e);if(i)return i}const o=this;if(o.internalProps.layoutMap.isSeriesNumber(t,e)){if(o.internalProps.layoutMap.isSeriesNumberInHeader(t,e)){const{title:i}=o.internalProps.layoutMap.getSeriesNumberHeader(t,e);return i}if(this.options.groupBy){const{vtableMerge:i}=o.getCellRawRecord(t,e);if(i)return"";const n=this.dataSource.currentIndexedData[e-this.columnHeaderLevelCount];return n[n.length-1]+1}const{format:i}=o.internalProps.layoutMap.getSeriesNumberBody(t,e);return"function"==typeof i?i(t,e,this):e-this.columnHeaderLevelCount+1}if(o.internalProps.layoutMap.isHeader(t,e)){const{title:i}=o.internalProps.layoutMap.getHeader(t,e);return"function"==typeof i?i():i}if(o.internalProps.layoutMap.isAggregation(t,e)){if(o.internalProps.layoutMap.isTopAggregation(t,e)){const i=o.internalProps.layoutMap.getAggregatorOnTop(t,e);return(null==i?void 0:i.formatValue)?i.formatValue(t,e,this):""}if(o.internalProps.layoutMap.isBottomAggregation(t,e)){const i=o.internalProps.layoutMap.getAggregatorOnBottom(t,e);return(null==i?void 0:i.formatValue)?i.formatValue(t,e,this):""}}const{field:n,fieldFormat:r}=o.internalProps.layoutMap.getBody(t,e);return o.getFieldData(r||n,t,e)}getCellOriginValue(t,e){if(-1===t||-1===e)return null;const i=this;if(i.internalProps.layoutMap.isSeriesNumber(t,e)){if(i.internalProps.layoutMap.isSeriesNumberInHeader(t,e)){const{title:o}=i.internalProps.layoutMap.getSeriesNumberHeader(t,e);return o}const{format:o}=i.internalProps.layoutMap.getSeriesNumberBody(t,e);return"function"==typeof o?o(t,e,this):e-this.columnHeaderLevelCount}if(i.internalProps.layoutMap.isHeader(t,e)){const{title:o}=i.internalProps.layoutMap.getHeader(t,e);return"function"==typeof o?o():o}if(i.internalProps.layoutMap.isAggregation(t,e)){if(i.internalProps.layoutMap.isTopAggregation(t,e)){const o=i.internalProps.layoutMap.getAggregatorOnTop(t,e);return null==o?void 0:o.value()}if(i.internalProps.layoutMap.isBottomAggregation(t,e)){const o=i.internalProps.layoutMap.getAggregatorOnBottom(t,e);return null==o?void 0:o.value()}}const{field:o}=i.internalProps.layoutMap.getBody(t,e);return i.getFieldData(o,t,e)}getCellRawValue(t,e){if(-1===t||-1===e)return null;const i=this;if(i.internalProps.layoutMap.isHeader(t,e)){const{title:o}=i.internalProps.layoutMap.getHeader(t,e);return"function"==typeof o?o():o}const{field:o}=i.internalProps.layoutMap.getBody(t,e);return i.getRawFieldData(o,t,e)}getRecordShowIndexByCell(t,e){const{layoutMap:i}=this.internalProps;return i.getRecordShowIndexByCell(t,e)}getRecordIndexByCell(t,e){const{layoutMap:i}=this.internalProps,o=i.getRecordShowIndexByCell(t,e);return this.dataSource.currentPagerIndexedData[o]}getTableIndexByRecordIndex(t){return this.transpose?this.dataSource.getTableIndex(t)+this.rowHeaderLevelCount:this.dataSource.getTableIndex(t)+this.columnHeaderLevelCount}getTableIndexByField(t){const e=this.internalProps.layoutMap.columnObjects.find((e=>e.field===t));if(!e)return-1;const i=this.internalProps.layoutMap.getBodyLayoutRangeById(e.id);return this.transpose?i.start.row:i.start.col}getCellAddrByFieldRecord(t,e){return this.transpose?{col:this.getTableIndexByRecordIndex(e),row:this.getTableIndexByField(t)}:{col:this.getTableIndexByField(t),row:this.getTableIndexByRecordIndex(e)}}getCellOriginRecord(t,e){const i=this.getRecordShowIndexByCell(t,e);if(i>-1)return this.dataSource.get(i)}getCellRawRecord(t,e){const i=this.getRecordShowIndexByCell(t,e);if(i>-1)return this.dataSource.getRaw(i)}_canResizeColumn(t,e){const i=super._canResizeColumn(t,e);if(i&&!this.transpose){const i=this.internalProps.layoutMap.getBody(t,this.columnHeaderLevelCount),o=this.internalProps.layoutMap.isSeriesNumber(t,e);if(null==i?void 0:i.disableColumnResize)return!1;if(o&&!0===this.internalProps.rowSeriesNumber.disableColumnResize)return!1}return i}updateOption(t){var e,i,o,n;const r=this.internalProps;if(super.updateOption(t),r.frozenColDragHeaderMode=t.frozenColDragHeaderMode,this.pagination=t.pagination,r.sortState=t.sortState,r.dataConfig=t.groupBy?Dk(t.groupBy):{},this.showHeader=null===(e=t.showHeader)||void 0===e||e,r.columns=t.columns?Ak(t.columns,["children"]):t.header?Ak(t.header,["children"]):[],V_(this),r.enableTreeNodeMerge=null!==(o=null!==(i=t.enableTreeNodeMerge)&&void 0!==i?i:Q(t.groupBy))&&void 0!==o&&o,this.internalProps.headerHelper.setTableColumnsEditor(),this.transpose=null!==(n=t.transpose)&&void 0!==n&&n,this.refreshHeader(),this.internalProps.useOneRowHeightFillAll=!1,r.releaseList&&(r.releaseList.forEach((t=>{var e;return null===(e=null==t?void 0:t.release)||void 0===e?void 0:e.call(t)})),r.releaseList=null),t.dataSource?W_(this,t.dataSource):t.records?this.setRecords(t.records,{sortState:t.sortState}):(this._resetFrozenColCount(),this.scenegraph.createSceneGraph(),this.render()),t.title){const e=Tx.getComponent("title");r.title=new e(t.title,this),this.scenegraph.resize()}if(this.options.emptyTip)if(this.internalProps.emptyTip)this.internalProps.emptyTip.resetVisible();else{const t=Tx.getComponent("emptyTip");this.internalProps.emptyTip=new t(this.options.emptyTip,this),this.internalProps.emptyTip.resetVisible()}return new Promise((t=>{setTimeout(t,0)}))}updatePagination(t){this.pagination&&("number"==typeof t.currentPage&&t.currentPage>=0&&(this.pagination.currentPage=t.currentPage),t.perPageCount&&(this.pagination.perPageCount=t.perPageCount||this.pagination.perPageCount),this.internalProps.layoutMap.clearCellRangeMap(),this.internalProps.useOneRowHeightFillAll=!1,this.scenegraph.clearCells(),this.dataSource.updatePagination(this.pagination),this.refreshRowColCount(),this.stateManager.initCheckedState(this.records),this.scenegraph.createSceneGraph(),this.renderAsync())}refreshHeader(){var t;const e=this.internalProps,i=this.transpose,o=this.showHeader;(e.layoutMap=new Ik(this,null!==(t=e.columns)&&void 0!==t?t:[],o,this.options.hierarchyIndent)).transpose=i,i||this.setMinMaxLimitWidth(!0),this.refreshRowColCount()}refreshRowColCount(){var t,e,i,o,n,r,s,l,a,h,d,c,u,g,p,f,v,m;const b=this,{layoutMap:y}=b.internalProps;if(!y)return;const C=null!==(e=null===(t=b.internalProps.dataSource)||void 0===t?void 0:t.length)&&void 0!==e?e:0;y.recordsCount=C+(C>0?y.hasAggregationOnTopCount+y.hasAggregationOnBottomCount:0),b.transpose?(b.rowCount=null!==(i=y.rowCount)&&void 0!==i?i:0,b.colCount=null!==(o=y.colCount)&&void 0!==o?o:0,this.internalProps.frozenColCount=Math.max((null!==(n=y.headerLevelCount)&&void 0!==n?n:0)+y.leftRowSeriesNumberColumnCount,null!==(r=this.options.frozenColCount)&&void 0!==r?r:0),this.internalProps.frozenRowCount=null!==(s=this.options.frozenRowCount)&&void 0!==s?s:0,b.bottomFrozenRowCount!==(null!==(l=this.options.bottomFrozenRowCount)&&void 0!==l?l:0)&&(b.bottomFrozenRowCount=null!==(a=this.options.bottomFrozenRowCount)&&void 0!==a?a:0),b.rightFrozenColCount!==(null!==(h=this.options.rightFrozenColCount)&&void 0!==h?h:0)&&(b.rightFrozenColCount=null!==(d=this.options.rightFrozenColCount)&&void 0!==d?d:0)):(b.colCount=null!==(c=y.colCount)&&void 0!==c?c:0,b.rowCount=y.recordsCount*y.bodyRowSpanCount+y.headerLevelCount,this.internalProps.frozenColCount=null!==(u=this.options.frozenColCount)&&void 0!==u?u:0,b.frozenRowCount=Math.max(y.headerLevelCount,null!==(g=this.options.frozenRowCount)&&void 0!==g?g:0),b.bottomFrozenRowCount!==(null!==(p=this.options.bottomFrozenRowCount)&&void 0!==p?p:0)&&(b.bottomFrozenRowCount=null!==(f=this.options.bottomFrozenRowCount)&&void 0!==f?f:0),b.rightFrozenColCount!==(null!==(v=this.options.rightFrozenColCount)&&void 0!==v?v:0)&&(b.rightFrozenColCount=null!==(m=this.options.rightFrozenColCount)&&void 0!==m?m:0)),this.stateManager.setFrozenCol(this.internalProps.frozenColCount)}getFieldData(t,e,i){if(null===t)return null;if(this.internalProps.layoutMap.isHeader(e,i))return null;const o=this.getRecordShowIndexByCell(this.transpose?e-this.internalProps.layoutMap.leftRowSeriesNumberColumnCount:e,i);return this.internalProps.dataSource.getField(o,t,e,i,this)}getRawFieldData(t,e,i){if(null===t)return null;if(this.internalProps.layoutMap.isHeader(e,i))return null;const o=this.getRecordShowIndexByCell(e,i);return this.internalProps.dataSource.getRawField(o,t,e,i,this)}_moveHeaderPosition(t,e){const i=this.getCellRange(t.col,t.row),o=this.getCellRange(e.col,e.row),n=this.internalProps.layoutMap.moveHeaderPosition(t,e);return n?("column"===n.moveType?(this.colWidthsMap.exchangeOrder(i.start.col,i.end.col-i.start.col+1,o.start.col,o.end.col-o.start.col+1,n.targetIndex),this.transpose||(this.colWidthsLimit={},this.setMinMaxLimitWidth())):n.targetIndex>n.sourceIndex?this.rowHeightsMap.exchangeOrder(n.sourceIndex,n.sourceSize,n.targetIndex+n.sourceSize-n.targetSize,n.targetSize,n.targetIndex):this.rowHeightsMap.exchangeOrder(n.sourceIndex,n.sourceSize,n.targetIndex,n.targetSize,n.targetIndex),n):null}changeRecordOrder(t,e){this.transpose?(t=this.getRecordShowIndexByCell(t,0),e=this.getRecordShowIndexByCell(e,0)):(t=this.getRecordShowIndexByCell(0,t),e=this.getRecordShowIndexByCell(0,e)),this.dataSource.reorderRecord(t,e)}getCellAddress(t,e){let i;for(let e=0;e<this.internalProps.records.length;e++){const o=this.internalProps.records[e];if("function"==typeof t)t(o)&&(i=e);else{let n=!0;for(const e in t)if(o[e]!==t[e]){n=!1;break}n&&(i=e)}if(Q(i))break}const o=this.getCellRangeByField(e,i);if(o)return{row:o.start.row,col:o.start.col}}getCellRangeByField(t,e){const{layoutMap:i}=this.internalProps,o=i.columnObjects.find((e=>e.field===t));if(o){const t=i.getBodyLayoutRangeById(o.id);let n;return Q(e)&&(n=i.getRecordStartRowByRecordIndex(e)),this.transpose?{start:{row:t.start.row,col:Q(n)?n+t.start.col:void 0},end:{row:t.end.row,col:Q(n)?n+t.end.col:void 0}}:{start:{col:t.start.col,row:Q(n)?n+t.start.row:void 0},end:{col:t.end.col,row:Q(n)?n+t.end.row:void 0}}}return null}getHierarchyState(t,e){if(!this.options.groupBy&&!this.getBodyColumnDefine(t,e).tree)return WC.none;const i=this.getRecordShowIndexByCell(t,e);return this.dataSource.getHierarchyState(i)}toggleHierarchyState(t,e){this.stateManager.updateHoverIcon(t,e,void 0,void 0);const i=this.getHierarchyState(t,e);if(i===WC.expand)this._refreshHierarchyState(t,e),this.fireListeners(Xw.TREE_HIERARCHY_STATE_CHANGE,{col:t,row:e,hierarchyState:WC.collapse});else if(i===WC.collapse){const i=this.getCellOriginRecord(t,e);Array.isArray(i.children)&&this._refreshHierarchyState(t,e),this.fireListeners(Xw.TREE_HIERARCHY_STATE_CHANGE,{col:t,row:e,hierarchyState:WC.expand,originData:i})}}_refreshHierarchyState(t,e){var i;let o=!1,n=!1;const r=this.internalProps.layoutMap.checkHasChart();r&&(this.autoFillWidth&&(o=this.getAllColsWidth()<=this.tableNoFrameWidth),this.autoFillHeight&&(n=this.getAllRowsHeight()<=this.tableNoFrameHeight));const s=this.getRecordShowIndexByCell(t,e),l=this.dataSource.toggleHierarchyState(s,this.scenegraph.proxy.rowStart-this.columnHeaderLevelCount,Math.max(this.scenegraph.proxy.rowEnd-this.columnHeaderLevelCount,this.scenegraph.proxy.rowStart-this.columnHeaderLevelCount+this.scenegraph.proxy.rowLimit-1)),a=this.internalProps.layoutMap.toggleHierarchyState(l);this.refreshRowColCount();for(let t=this.rowCount-this.bottomFrozenRowCount;t<this.rowCount;t++){const e=RA(t,0,this.colCount-1,this);this._setRowHeight(t,e)}this.clearCellStyleCache(),this.internalProps.layoutMap.clearCellRangeMap(),this.internalProps.useOneRowHeightFillAll=!1;const h=[{col:t,row:e}];if((null===(i=a.removeCellPositions)||void 0===i?void 0:i.length)>0&&a.removeCellPositions[a.removeCellPositions.length-1].row>=this.scenegraph.proxy.rowEnd){for(let t=0;t<=a.removeCellPositions.length-1;t++)a.removeCellPositions[t].row<=this.scenegraph.proxy.rowEnd&&h.push({col:a.removeCellPositions[t].col,row:a.removeCellPositions[t].row});a.removeCellPositions=[],this.scenegraph.proxy.refreshRowCount()}this.scenegraph.updateRow(a.removeCellPositions,a.addCellPositions,h),r&&(this.autoFillWidth&&!o&&(o=this.getAllColsWidth()<=this.tableNoFrameWidth),this.autoFillHeight&&!n&&(n=this.getAllRowsHeight()<=this.tableNoFrameHeight),("adaptive"===this.widthMode||o||"adaptive"===this.heightMode||n)&&this.scenegraph.updateChartSizeForResizeColWidth(-1))}_hasHierarchyTreeHeader(){var t,e;return null===(e=null!==(t=this.options.columns)&&void 0!==t?t:this.options.header)||void 0===e?void 0:e.some(((t,e)=>t.tree))}getMenuInfo(t,e,i){return{field:this.getHeaderField(t,e),value:this.getCellValue(t,e),cellLocation:this.getCellLocation(t,e),event:void 0}}_getSortFuncFromHeaderOption(t,e,i){if(t||(t=this.internalProps.columns),e&&t&&t.length>0)for(let o=0;o<t.length;o++){const n=t[o];if((i&&i===n.fieldKey||!i&&n.field===e)&&n.sort&&"function"==typeof n.sort)return n.sort;if(n.columns){const t=this._getSortFuncFromHeaderOption(n.columns,e,i);if(t)return t}}}updateSortState(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];var i;if(t)this.internalProps.sortState=t;else if(this.internalProps.sortState)if(Array.isArray(this.internalProps.sortState))for(let e=0;e<this.internalProps.sortState.length;e++)(t=null===(i=this.internalProps.sortState)||void 0===i?void 0:i[e])&&(t.order="normal");else this.internalProps.sortState.order="normal",t=this.internalProps.sortState;(t=Array.isArray(t)?t:[t]).some((t=>t.field))&&e&&this.internalProps.layoutMap.headerObjects.some((t=>!1!==t.define.sort))&&(this.dataSource.sort(t.map((t=>{const e=this._getSortFuncFromHeaderOption(this.internalProps.columns,t.field);return this.internalProps.layoutMap.headerObjects.find((e=>e&&e.field===t.field)),{field:t.field,order:t.order,orderFn:e}}))),this.internalProps.layoutMap.clearCellRangeMap(),this.internalProps.useOneRowHeightFillAll=!1,this.scenegraph.sortCell()),t.length&&this.stateManager.updateSortState(t)}updateFilterRules(t){this.scenegraph.clearCells(),this.sortState?(this.dataSource.updateFilterRulesForSorted(t),Nk(this)):this.dataSource.updateFilterRules(t),this.refreshRowColCount(),this.stateManager.initCheckedState(this.records),this.scenegraph.createSceneGraph()}getCheckboxState(t){if(this.stateManager.checkedState.length<this.rowCount-this.columnHeaderLevelCount&&this.stateManager.initLeftRecordsCheckState(this.records),Q(t)){let e=this.stateManager.checkedState;return this.options.groupBy&&(e=function(t){const e=[],i=t.dataSource,o=i.dataConfig.groupByRules.length+1;return i.currentIndexedData.forEach(((n,r)=>{if(rt(n)&&n.length===o){const{vtableOriginIndex:o}=i.getRawRecord(n);e[o]=t.stateManager.checkedState[n]}})),e}(this)),e.map((e=>e[t]))}return this.stateManager.checkedState}getCellCheckboxState(t,e){var i;const o=this.getBodyColumnDefine(t,e),n=null==o?void 0:o.field,r=this.getCellType(t,e);if(Q(n)&&"checkbox"===r){const o=this.dataSource.getIndexKey(this.getRecordShowIndexByCell(t,e));return null===(i=this.stateManager.checkedState[o])||void 0===i?void 0:i[n]}}getRadioState(t){return Q(t)?this.stateManager.radioState[t]:this.stateManager.radioState}getCellRadioState(t,e){return function(t,e,i){var o;const n=i.getBodyColumnDefine(t,e),r=null==n?void 0:n.field,s=i.getCellType(t,e);if(Q(r)&&"checkbox"===s){const n=i.dataSource.getIndexKey(i.getRecordShowIndexByCell(t,e)),s=null===(o=i.stateManager.radioState)||void 0===o?void 0:o[r];if(at(s)){if(s===n)return!0}else if(tt(s)){const t=s[n];if(at(t))return t}}return!1}(t,e,this)}setCellCheckboxState(t,e,i){!function(t,e,i,o){const n=o.scenegraph.getCell(t,e),r=null==n?void 0:n.getChildByName("checkbox");if(!r)return;const{checked:s,indeterminate:l}=r.attribute;l?(i||r._handlePointerUp(),r._handlePointerUp()):s?i||r._handlePointerUp():i&&r._handlePointerUp()}(t,e,i,this)}setCellRadioState(t,e,i){!function(t,e,i,o){const n=o.scenegraph.getCell(t,e);if(n)if(at(i)){const t=n.getChildAt(i);null==t||t._handlePointerUp()}else{const t=n.getChildByName("radio");null==t||t._handlePointerUp()}}(t,e,i,this)}setRecords(t,e){var i,o;let n;null===(i=this.internalProps.dataSource)||void 0===i||i.release(),this.internalProps.releaseList=null===(o=this.internalProps.releaseList)||void 0===o?void 0:o.filter((t=>!t.dataSourceObj)),this.internalProps.dataSource=null,Array.isArray(e)||(null==e?void 0:e.order)?n=e:e?n=e.sortState:null===e&&(n=null),"undefined"!=typeof window&&window.performance.now();const r={col:this.stateManager.hover.cellPos.col,row:this.stateManager.hover.cellPos.row};if(this.scenegraph.clearCells(),void 0!==n&&(this.internalProps.sortState=this.internalProps.multipleSort?Array.isArray(n)?n:[n]:n,this.stateManager.setSortState(this.sortState)),t){if(D_(this,t),this.sortState){const t=Array.isArray(this.sortState)?this.sortState:[this.sortState];t.some((t=>t.order&&t.field&&"normal"!==t.order))&&this.internalProps.layoutMap.headerObjectsIncludeHided.some((t=>!1!==t.define.sort))&&this.dataSource.sort(t.map((t=>{const e=this._getSortFuncFromHeaderOption(void 0,t.field);return this.internalProps.layoutMap.headerObjectsIncludeHided.find((e=>e&&e.field===t.field)),{field:t.field,order:t.order||"asc",orderFn:null!=e?e:yw}})))}this.refreshRowColCount()}else D_(this,t);if(this.stateManager.initCheckedState(t),this.clearCellStyleCache(),this.scenegraph.createSceneGraph(),this.stateManager.updateHoverPos(r.col,r.row),this.internalProps.title&&!this.internalProps.title.isReleased&&(this._updateSize(),this.internalProps.title.resize(),this.scenegraph.resize()),this.options.emptyTip)if(this.internalProps.emptyTip)this.internalProps.emptyTip.resetVisible();else{const t=Tx.getComponent("emptyTip");this.internalProps.emptyTip=new t(this.options.emptyTip,this),this.internalProps.emptyTip.resetVisible()}this.render(),Q(r.col)&&Q(r.row)&&r.col>=0&&r.row>=0&&setTimeout((()=>{var t;null===(t=this.internalProps)||void 0===t||t.tooltipHandler.showTooltip(r.col,r.row)}),0)}setRecordChildren(t,e,i){const o=this.getCellOriginRecord(e,i);o.children=t;const n=this.getRecordShowIndexByCell(e,i);this.dataSource.setRecord(o,n),this._refreshHierarchyState(e,i)}startEditCell(t,e,i){var o;if(Q(t)&&Q(e))this.eventManager.isDraging=!1,this.selectCell(t,e),this.editorManager.startEditCell(t,e,i);else if(null===(o=this.stateManager.select)||void 0===o?void 0:o.cellPos){const{col:t,row:e}=this.stateManager.select.cellPos;Q(t)&&Q(e)&&this.editorManager.startEditCell(t,e,i)}}completeEditCell(){this.editorManager.completeEdit()}getEditor(t,e){var i,o;const n=this.getBodyColumnDefine(t,e);let r=this.isHeader(t,e)?null!==(i=null==n?void 0:n.headerEditor)&&void 0!==i?i:this.options.headerEditor:null!==(o=null==n?void 0:n.editor)&&void 0!==o?o:this.options.editor;return"function"==typeof r&&(r=r({col:t,row:e,dataValue:this.getCellOriginValue(t,e),value:this.getCellValue(t,e)||"",table:this})),"string"==typeof r?function(t){if(fk[t])return fk[t]}(r):r}isHasEditorDefine(t,e){var i,o;const n=this.getBodyColumnDefine(t,e);let r=this.isHeader(t,e)?null!==(i=null==n?void 0:n.headerEditor)&&void 0!==i?i:this.options.headerEditor:null!==(o=null==n?void 0:n.editor)&&void 0!==o?o:this.options.editor;return"function"==typeof r&&(r=r({col:t,row:e,dataValue:this.getCellOriginValue(t,e),value:this.getCellValue(t,e)||"",table:this})),Q(r)}changeCellValue(t,e,i){return function(t,e,i,o,n){if(o&&n.isHasEditorDefine(t,e)||!1===o){const o=n.getRecordShowIndexByCell(t,e),{field:r}=n.internalProps.layoutMap.getBody(t,e),s=n.getCellRawValue(t,e),l=n.getCellOriginValue(t,e);n.isHeader(t,e)?n.internalProps.layoutMap.updateColumnTitle(t,e,i):n.dataSource.changeFieldValue(i,o,r,t,e,n);const a=n.getCellRange(t,e),h=n.internalProps.layoutMap.getAggregatorsByCell(t,e);if(h){if(Array.isArray(h))for(let t=0;t<(null==h?void 0:h.length);t++)h[t].recalculate();else h.recalculate();const t=n.internalProps.layoutMap.getAggregatorCellAddress(a.start.col,a.start.row,a.end.col,a.end.row);for(let e=0;e<t.length;e++){const i=n.getCellRange(t[e].col,t[e].row);for(let t=i.start.col;t<=i.end.col;t++)for(let e=i.start.row;e<=i.end.row;e++)n.scenegraph.updateCellContent(t,e)}}for(let t=a.start.col;t<=a.end.col;t++)for(let e=a.start.row;e<=a.end.row;e++)n.scenegraph.updateCellContent(t,e);if("adaptive"===n.widthMode||n.autoFillWidth&&n.getAllColsWidth()<=n.tableNoFrameWidth)0===n.internalProps._widthResizedColMap.size&&n.scenegraph.recalculateColWidths();else if(!n.internalProps._widthResizedColMap.has(t)){const e=n.getColWidth(t),i=nR(t,0,n.rowCount-1,n,!1);i!==e&&n.scenegraph.updateColWidth(t,i-e)}if("adaptive"===n.heightMode||n.autoFillHeight&&n.getAllRowsHeight()<=n.tableNoFrameHeight)0===n.internalProps._heightResizedRowMap.size&&n.scenegraph.recalculateRowHeights();else if("autoHeight"===n.heightMode&&!n.internalProps._heightResizedRowMap.has(e)){const t=n.getRowHeight(e),i=RA(e,0,n.colCount-1,n);n.scenegraph.updateRowHeight(e,i-t)}n.fireListeners(Xw.CHANGE_CELL_VALUE,{col:t,row:e,rawValue:s,currentValue:l,changedValue:n.getCellOriginValue(t,e)}),n.scenegraph.updateNextFrame()}}(t,e,i,arguments.length>3&&void 0!==arguments[3]&&arguments[3],this)}changeCellValues(t,e,i){return function(t,e,i,o,n){var r,s;let l=t,a=e;const h=[],d=[];let c;for(let o=0;o<i.length&&!(e+o>n.rowCount-1);o++){const r=i[o],s=[],l=[];h.push(s),d.push(l);for(let i=0;i<r.length&&!(t+i>n.colCount-1);i++){c=Wk(t+i,e+o,n,c);const r=n.getCellRawValue(t+i,e+o);s.push(r);const a=n.getCellOriginValue(t+i,e+o);l.push(a)}}for(let c=0;c<i.length&&!(e+c>n.rowCount-1);c++){a=e+c;const u=i[c];let g=t;for(let i=0;i<u.length&&!(t+i>n.colCount-1);i++){g=t+i;let l=!1;if(!1===o)l=!0;else if(n.isHasEditorDefine(t+i,e+c)){const o=n.getEditor(t+i,e+c),a=d[c][i],h=u[i],g=null===(s=null===(r=null==o?void 0:o.validateValue)||void 0===r?void 0:r.call(o,h,a))||void 0===s||s;l=!!Fw(g)||g}if(l){const o=u[i],r=n.getRecordShowIndexByCell(t+i,e+c),{field:s}=n.internalProps.layoutMap.getBody(t+i,e+c),l=h[c][i],a=d[c][i];n.isHeader(t+i,e+c)?n.internalProps.layoutMap.updateColumnTitle(t+i,e+c,o):n.dataSource.changeFieldValue(o,r,s,t+i,e+c,n),n.fireListeners(Xw.CHANGE_CELL_VALUE,{col:t+i,row:e+c,rawValue:l,currentValue:a,changedValue:n.getCellOriginValue(t+i,e+c)})}}l=Math.max(l,g)}const u=n.getCellRange(t,e),g=n.getCellRange(l,a),p=n.internalProps.layoutMap.getAggregatorsByCellRange(u.start.col,u.start.row,g.end.col,g.end.row);if(p){for(let t=0;t<(null==p?void 0:p.length);t++)p[t].recalculate();if("normal"===c){const t=n.internalProps.layoutMap.getAggregatorCellAddress(u.start.col,u.start.row,g.end.col,g.end.row);for(let e=0;e<t.length;e++){const i=n.getCellRange(t[e].col,t[e].row);for(let t=i.start.col;t<=i.end.col;t++)for(let e=i.start.row;e<=i.end.row;e++)n.scenegraph.updateCellContent(t,e)}}}if("group"===c&&n.dataSource.updateRecordsForGroup([],[]),"sort"===c||"group"===c)return n.dataSource.sortedIndexMap.clear(),Nk(n),n.refreshRowColCount(),n.internalProps.layoutMap.clearCellRangeMap(),n.scenegraph.clearCells(),void n.scenegraph.createSceneGraph();for(let t=u.start.col;t<=g.end.col;t++)for(let e=u.start.row;e<=g.end.row;e++)n.scenegraph.updateCellContent(t,e);if("adaptive"===n.widthMode||n.autoFillWidth&&n.getAllColsWidth()<=n.tableNoFrameWidth)0===n.internalProps._widthResizedColMap.size&&n.scenegraph.recalculateColWidths();else for(let e=t;e<=g.end.col;e++)if(!n.internalProps._widthResizedColMap.has(e)){const t=n.getColWidth(e),i=nR(e,0,n.rowCount-1,n,!1);i!==t&&n.scenegraph.updateColWidth(e,i-t)}if("adaptive"===n.heightMode||n.autoFillHeight&&n.getAllRowsHeight()<=n.tableNoFrameHeight)n.scenegraph.recalculateRowHeights();else if("autoHeight"===n.heightMode){const t=[],i=[];for(let o=e;o<=g.end.row;o++)if(n.rowHeightsMap.get(o)){const e=n.getRowHeight(o),r=RA(o,0,n.colCount-1,n);t.push(o),i.push(r-e)}n.scenegraph.updateRowsHeight(t,i)}n.scenegraph.updateNextFrame()}(t,e,i,arguments.length>3&&void 0!==arguments[3]&&arguments[3],this)}addRecord(t,e){!function(t,e,i){var o,n;if(i.options.groupBy)null===(n=(o=i.dataSource).addRecordsForGroup)||void 0===n||n.call(o,[t],e),i.refreshRowColCount(),i.internalProps.layoutMap.clearCellRangeMap(),i.scenegraph.clearCells(),i.scenegraph.createSceneGraph();else if(i.sortState)i.dataSource.addRecordForSorted(t),Nk(i),i.refreshRowColCount(),i.scenegraph.clearCells(),i.scenegraph.createSceneGraph();else{(void 0===e||e>i.dataSource.sourceLength)&&(e=i.dataSource.sourceLength);const o=i.transpose?i.rowHeaderLevelCount:i.columnHeaderLevelCount;i.dataSource.addRecord(t,e);const n=i.rowCount;if(i.refreshRowColCount(),0===i.scenegraph.proxy.totalActualBodyRowCount)return i.scenegraph.clearCells(),void i.scenegraph.createSceneGraph();const r=i.transpose?i.colCount:i.rowCount;if(i.pagination){const{perPageCount:t,currentPage:s}=i.pagination,l=t*(s||0)+t;if(e<l)if(e<l-t)i.scenegraph.clearCells(),i.scenegraph.createSceneGraph();else{const s=e-(l-t)+o;if(n-o===i.pagination.perPageCount){const t=[];for(let e=s;e<r;e++)i.transpose?t.push({col:e,row:0}):t.push({col:0,row:e});i.transpose?i.scenegraph.updateCol([],[],t):i.scenegraph.updateRow([],[],t)}else{const t=[];for(let e=s;e<Math.min(r,s+1);e++)i.transpose?t.push({col:e,row:0}):t.push({col:0,row:e});i.transpose?i.scenegraph.updateCol([],t,[]):i.scenegraph.updateRow([],t,[])}}}else{const t=[];for(let n=e+o;n<e+o+1;n++)i.transpose?t.push({col:n,row:0}):t.push({col:0,row:n});const n=[],r=i.internalProps.layoutMap.hasAggregationOnTopCount,s=i.internalProps.layoutMap.hasAggregationOnBottomCount;for(let t=o;t<o+r;t++)i.transpose?n.push({col:t,row:0}):n.push({col:0,row:t});for(let t=(i.transpose?i.colCount:i.rowCount)-s;t<(i.transpose?i.colCount:i.rowCount);t++)i.transpose?n.push({col:t,row:0}):n.push({col:0,row:t});i.transpose?i.scenegraph.updateCol([],t,[]):i.scenegraph.updateRow([],t,[])}}}(t,e,this)}addRecords(t,e){!function(t,e,i){var o,n;if(i.options.groupBy)null===(n=(o=i.dataSource).addRecordsForGroup)||void 0===n||n.call(o,t,e),i.refreshRowColCount(),i.internalProps.layoutMap.clearCellRangeMap(),i.scenegraph.clearCells(),i.scenegraph.createSceneGraph();else if(i.sortState)i.dataSource.addRecordsForSorted(t),Nk(i),i.refreshRowColCount(),i.scenegraph.clearCells(),i.scenegraph.createSceneGraph();else{void 0===e||e>i.dataSource.sourceLength?e=i.dataSource.sourceLength:e<0&&(e=0);const o=i.transpose?i.rowHeaderLevelCount:i.columnHeaderLevelCount;i.dataSource.addRecords(t,e);const n=i.transpose?i.colCount:i.rowCount;if(i.refreshRowColCount(),0===i.scenegraph.proxy.totalActualBodyRowCount)return i.scenegraph.clearCells(),void i.scenegraph.createSceneGraph();const r=i.transpose?i.colCount:i.rowCount;if(i.pagination){const{perPageCount:s,currentPage:l}=i.pagination,a=s*(l||0)+s;if(e<a)if(e<a-s)i.scenegraph.clearCells(),i.scenegraph.createSceneGraph();else{const l=e-(a-s)+o;if(n-o===i.pagination.perPageCount){const t=[];for(let e=l;e<r;e++)i.transpose?t.push({col:e,row:0}):t.push({col:0,row:e});i.transpose?i.scenegraph.updateCol([],[],t):i.scenegraph.updateRow([],[],t)}else{const e=[];for(let o=l;o<Math.min(r,l+(Array.isArray(t)?t.length:1));o++)i.transpose?e.push({col:o,row:0}):e.push({col:0,row:o});i.transpose?i.scenegraph.updateCol([],e,[]):i.scenegraph.updateRow([],e,[])}}}else{const n=[];for(let r=e+o;r<e+o+(Array.isArray(t)?t.length:1);r++)i.transpose?n.push({col:r,row:0}):n.push({col:0,row:r});const r=i.internalProps.layoutMap.hasAggregationOnTopCount,s=i.internalProps.layoutMap.hasAggregationOnBottomCount,l=[];for(let t=o;t<o+r;t++)i.transpose?l.push({col:t,row:0}):l.push({col:0,row:t});for(let t=(i.transpose?i.colCount:i.rowCount)-s;t<(i.transpose?i.colCount:i.rowCount);t++)i.transpose?l.push({col:t,row:0}):l.push({col:0,row:t});i.transpose?i.scenegraph.updateCol([],n,l):i.scenegraph.updateRow([],n,l)}}}(t,e,this)}deleteRecords(t){!function(t,e){var i,o;if((null==t?void 0:t.length)>0)if(e.options.groupBy)null===(o=(i=e.dataSource).deleteRecordsForGroup)||void 0===o||o.call(i,t),e.refreshRowColCount(),e.internalProps.layoutMap.clearCellRangeMap(),e.scenegraph.clearCells(),e.scenegraph.createSceneGraph();else if(e.sortState)e.dataSource.deleteRecordsForSorted(t),Nk(e),e.refreshRowColCount(),e.scenegraph.clearCells(),e.scenegraph.createSceneGraph();else{const i=e.dataSource.deleteRecords(t);if(0===i.length)return;const o=e.transpose?e.colCount:e.rowCount;e.refreshRowColCount();const n=e.transpose?e.colCount:e.rowCount,r=i.sort(((t,e)=>t-e)),s=r[0];if(e.pagination){const{perPageCount:t,currentPage:i}=e.pagination,r=t*(i||0)+t;if(s<r)if(s<r-t)e.scenegraph.clearCells(),e.scenegraph.createSceneGraph();else{const i=e.transpose?e.rowHeaderLevelCount:e.columnHeaderLevelCount,l=e.internalProps.layoutMap.hasAggregationOnTopCount,a=[],h=[];for(let i=s-(r-t)+(e.transpose?e.rowHeaderLevelCount:e.columnHeaderLevelCount)+l;i<n;i++)e.transpose?a.push({col:i,row:0}):a.push({col:0,row:i});for(let t=i;t<i+l;t++)e.transpose?a.push({col:t,row:0}):a.push({col:0,row:t});if(n<o)for(let t=n;t<o;t++)e.transpose?h.push({col:t,row:0}):h.push({col:0,row:t});e.transpose?e.scenegraph.updateCol(h,[],a):e.scenegraph.updateRow(h,[],a)}}else{const t=[],i=e.transpose?e.rowHeaderLevelCount:e.columnHeaderLevelCount,o=e.internalProps.layoutMap.hasAggregationOnTopCount,n=e.internalProps.layoutMap.hasAggregationOnBottomCount;for(let n=0;n<r.length;n++){const s=r[n]+i+o;e.transpose?t.push({col:s,row:0}):t.push({col:0,row:s})}const s=[];for(let t=i;t<i+o;t++)e.transpose?s.push({col:t,row:0}):s.push({col:0,row:t});for(let t=(e.transpose?e.colCount:e.rowCount)-n;t<(e.transpose?e.colCount:e.rowCount);t++)e.transpose?s.push({col:t,row:0}):s.push({col:0,row:t});e.transpose?e.scenegraph.updateCol(t,[],s):e.scenegraph.updateRow(t,[],s)}}}(t,this)}updateRecords(t,e){!function(t,e,i){var o,n;if((null==e?void 0:e.length)>0)if(i.options.groupBy)null===(n=(o=i.dataSource).updateRecordsForGroup)||void 0===n||n.call(o,t,e),i.refreshRowColCount(),i.internalProps.layoutMap.clearCellRangeMap(),i.scenegraph.clearCells(),i.scenegraph.createSceneGraph();else if(i.sortState)i.dataSource.updateRecordsForSorted(t,e),Nk(i),i.refreshRowColCount(),i.scenegraph.clearCells(),i.scenegraph.createSceneGraph();else{const o=i.dataSource.updateRecords(t,e);if(0===o.length)return;const n=o.sort(((t,e)=>t-e));if(i.pagination){const{perPageCount:t,currentPage:e}=i.pagination,o=i.transpose?i.rowHeaderLevelCount:i.columnHeaderLevelCount,r=i.internalProps.layoutMap.hasAggregationOnTopCount,s=t*(e||0)+t,l=[];for(let e=0;e<n.length;e++){const o=n[e];if(o<s&&o>=s-t){const e=o-(s-t)+(i.transpose?i.rowHeaderLevelCount:i.columnHeaderLevelCount)+r;l.push(e)}}if(l.length>=1){const t=[];for(let e=0;e<l.length;e++){const o=l[e];i.transpose?t.push({col:o,row:0}):t.push({col:0,row:o})}for(let e=o;e<o+r;e++)i.transpose?t.push({col:e,row:0}):t.push({col:0,row:e});i.transpose?i.scenegraph.updateCol([],[],t):i.scenegraph.updateRow([],[],t)}}else{const t=[],e=i.transpose?i.rowHeaderLevelCount:i.columnHeaderLevelCount,o=i.internalProps.layoutMap.hasAggregationOnTopCount,r=i.internalProps.layoutMap.hasAggregationOnBottomCount;for(let r=0;r<n.length;r++){const s=n[r]+e+o;i.transpose?t.push({col:s,row:0}):t.push({col:0,row:s})}for(let n=e;n<e+o;n++)i.transpose?t.push({col:n,row:0}):t.push({col:0,row:n});for(let e=(i.transpose?i.colCount:i.rowCount)-r;e<(i.transpose?i.colCount:i.rowCount);e++)i.transpose?t.push({col:e,row:0}):t.push({col:0,row:e});i.transpose?i.scenegraph.updateCol([],[],t):i.scenegraph.updateRow([],[],t)}}}(t,e,this)}_hasCustomRenderOrLayout(){var t,e,i,o;const{headerObjects:n}=this.internalProps.layoutMap;if(this.options.customRender)return!0;for(let r=0;r<n.length;r++){const s=n[r];if((null===(t=null==s?void 0:s.define)||void 0===t?void 0:t.customLayout)||(null===(e=null==s?void 0:s.define)||void 0===e?void 0:e.headerCustomLayout)||(null===(i=null==s?void 0:s.define)||void 0===i?void 0:i.customRender)||(null===(o=null==s?void 0:s.define)||void 0===o?void 0:o.headerCustomRender))return!0}return!1}getAggregateValuesByField(t){const e=this.internalProps.layoutMap.getColumnByField(t),i=[];for(let t=0;t<e.length;t++){const o=e[t].columnDefine.aggregator;if(delete e[t].columnDefine,o){const n={col:e[t].col,aggregateValue:null};if(n.aggregateValue=[],Array.isArray(o))for(let t=0;t<o.length;t++)n.aggregateValue.push({aggregationType:o[t].type,value:o[t].value()});else n.aggregateValue.push({aggregationType:o.type,value:o.value()});i.push(n)}}return i}isAggregation(t,e){return this.internalProps.layoutMap.isAggregation(t,e)}getGroupTitleLevel(t,e){var i;if(!this.options.groupBy)return;const o=this.dataSource.getIndexKey(this.getRecordShowIndexByCell(t,e)),n=null!==(i=this.dataSource.getGroupLength())&&void 0!==i?i:0;let r=rt(o)?o.length-1:0;return n>0&&r===n&&(r=void 0),r}getBodyRowIndexByRecordIndex(t){return this.dataSource.getTableIndex(t)}}function jk(t){return"bottom"===t||"top"===t}class Vk{constructor(){this._scale=new Xb,this._scales=[this._scale]}valueToPosition(t){return this._scale.scale(t)}getPosition(t){let e=0,i=this._scale;if(1===this._scales.length||1===t.length)e=this.valueToPosition(t[0]);else{const o=Math.min(t.length,this._scales.length);for(let i=0;i<o;i++)e+=this._scales[i].scale(t[i]);i=this._scales[o-1]}return{position:e,bandScale:i}}calcScales(t,e){var i,o;const{bandPadding:n,paddingInner:r,paddingOuter:s}=this,l=rt(n),a=rt(r),h=rt(s);for(let d=0;d<this._scales.length;d++){const c=l?n[d]:n,u=a?r[d]:r,g=h?s[d]:s;this._scales[d].paddingInner(null!==(i=null!=u?u:c)&&void 0!==i?i:t,!0).paddingOuter(null!==(o=null!=g?g:c)&&void 0!==o?o:e)}}dataToPosition(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};var i;if(0===t.length||0===this._scales.length)return 0;const{position:o,bandScale:n}=this.getPosition(t);return o+n.bandwidth()*(null!==(i=e.bandPosition)&&void 0!==i?i:.5)}updateScaleDomain(t){for(let e=0;e<this._scales.length;e++)this._scales[e].domain(t)}updateRange(t){const[e,i]=this._scale.range();t[0]===e&&t[1]===i||this._scale.range(t)}}const Uk=Math.sqrt(50),$k=Math.sqrt(10),Xk=Math.sqrt(2);class Yk{constructor(t){this._extend={},this.type=null!=t?t:"linear",this._scale="log"===t?new by:"symlog"===t?new yy:new py,this._scales=[this._scale]}setExtraAttrFromSpec(t,e,i,o,n,r){this.nice=!1,this.zero=e,this.zero&&(i.min=Math.min(i.min,0),i.max=Math.max(i.max,0)),this.domain=i,this.expand=o,"log"===this.type?this._scale.base(null!=n?n:10):"symlog"===this.type&&this._scale.constant(null!=r?r:10)}transformScaleDomain(){"symlog"===this.type||"log"===this.type||this.setScaleNice()}setScaleNice(){"log"===this.type?this.setLogScaleNice():this.setLinearScaleNice()}setLogScaleNice(){var t,e,i,o,n,r;J(null===(t=this.domain)||void 0===t?void 0:t.min)&&J(null===(e=this.domain)||void 0===e?void 0:e.max)?this.nice&&this._scale.nice():Q(null===(i=this.domain)||void 0===i?void 0:i.min)&&J(null===(o=this.domain)||void 0===o?void 0:o.max)?this.nice&&this._scale.niceMax():J(null===(n=this.domain)||void 0===n?void 0:n.min)&&Q(null===(r=this.domain)||void 0===r?void 0:r.max)&&this.nice&&this._scale.niceMin()}setLinearScaleNice(){var t,e,i,o,n,r,s,l;let a=null!==(e=null!==(t=this.forceTickCount)&&void 0!==t?t:this.tickCount)&&void 0!==e?e:10;"accurateFirst"===this.niceType&&(a=Math.max(10,a)),J(null===(i=this.domain)||void 0===i?void 0:i.min)&&J(null===(o=this.domain)||void 0===o?void 0:o.max)?this.nice&&this._scale.nice(a):Q(null===(n=this.domain)||void 0===n?void 0:n.min)&&J(null===(r=this.domain)||void 0===r?void 0:r.max)?this.nice&&this._scale.niceMax(a):J(null===(s=this.domain)||void 0===s?void 0:s.min)&&Q(null===(l=this.domain)||void 0===l?void 0:l.max)?this.nice&&this._scale.niceMin(a):this.nice&&this._scale.nice(a)}dataToPosition(t){return this.valueToPosition(t[0])}valueToPosition(t){return this._scale.scale(t)}computeLinearDomain(t){const e=[];return t.forEach((t=>{const{min:i,max:o}=t;e[0]=void 0===e[0]?i:Math.min(e[0],i),e[1]=void 0===e[1]?o:Math.max(e[1],o)})),this.expandDomain(e),this.includeZero(e),this.setDomainMinMax(e),e}expandDomain(t){if(!this.expand)return;const e=t[0],i=t[t.length-1];Q(this.expand.min)&&(t[0]=e-(i-e)*this.expand.min),Q(this.expand.max)&&(t[t.length-1]=i+(i-e)*this.expand.max)}niceDomain(t){if(Q(t[0])||Q(t[1])||"linear"!==this.type)return t;if(Math.abs(Et(t)-Pt(t))<=1e-12){let e=t[0];const i=e>=0?1:-1;if(e=Math.abs(e),e<1)t[0]=0,t[1]=1;else{let i=e/5;const o=Math.floor(Math.log(i)/Math.LN10),n=i/Math.pow(10,o);i=(n>=Uk?10:n>=$k?5:n>=Xk?2:1)*Math.pow(10,o),t[0]=0,t[1]=10*i}i<0&&(t.reverse(),t[0]*=-1,t[1]*=-1)}return t}niceMinMax(){var t,e,i,o,n,r,s,l;if(this.nice){let a=null!==(e=null!==(t=this.forceTickCount)&&void 0!==t?t:this.tickCount)&&void 0!==e?e:10;"accurateFirst"===this.niceType&&(a=Math.max(10,a)),J(null===(i=this.domain)||void 0===i?void 0:i.min)&&J(null===(o=this.domain)||void 0===o?void 0:o.max)?this._scale.nice(a):Q(null===(n=this.domain)||void 0===n?void 0:n.min)&&J(null===(r=this.domain)||void 0===r?void 0:r.max)?this._scale.niceMax(a):J(null===(s=this.domain)||void 0===s?void 0:s.min)&&Q(null===(l=this.domain)||void 0===l?void 0:l.max)?this._scale.niceMin(a):this._scale.nice(a)}}includeZero(t){this.zero&&(t[0]=Math.min(t[0],0),t[t.length-1]=Math.max(t[t.length-1],0))}setExtendDomain(t,e){if(void 0===e)return void delete this._extend[t];this._extend[t]=e;const i=this._scale.domain();this.extendDomain(i),this.includeZero(i),this.setDomainMinMax(i),this.niceDomain(i),this._scale.domain(i,this.nice),this.niceMinMax()}extendDomain(t){let e;const i=t.length-1,o=t[0]-t[i]>0,n=o?i:0,r=o?0:i;for(const i in this._extend)e=this._extend[i],e>t[r]&&(t[r]=e),e<t[n]&&(t[n]=e)}setDomainMinMax(t){if(!this.domain)return;const{min:e,max:i}=this.domain;Q(e)&&(t[0]=e),Q(i)&&(t[1]=i)}setZero(t){this.zero!==t&&(this.zero=t,this.updateScaleDomain())}updateScaleDomain(){const t=this.computeDomain([this.domain]);this.updateScaleDomainByModel(t)}computeDomain(t){return this.computeLinearDomain(t)}updateScaleDomainByModel(t){t=null!=t?t:this._scale.domain(),this.extendDomain(t),this.includeZero(t),this.setDomainMinMax(t),this.niceDomain(t),this._scale.domain(t,this.nice),this.niceMinMax()}updateRange(t){const[e,i]=this._scale.range();t[0]===e&&t[1]===i||this._scale.range(t)}}function Kk(t,e){var i;const o=e.option;vt(t)||(null===(i=null==o?void 0:o.label)||void 0===i?void 0:i.flush)&&function(t,e){const{width:i,height:o}=e.getLayoutRect(),n=jk(e.orient),r=!0===e.option.inverse,s=t[0],l=Lt(t);if(n)if(r){const t=i,e=0,o=s.AABBBounds.x2,n=l.AABBBounds.x1;o>t&&s.setAttributes({x:t,textAlign:"right"}),n<e&&l.setAttributes({x:e,textAlign:"left"})}else{const t=0,e=i,o=s.AABBBounds.x1,n=l.AABBBounds.x2;o<t&&s.setAttributes({x:t,textAlign:"left"}),n>e&&l.setAttributes({x:e,textAlign:"right"})}else if(r){const t=s.AABBBounds.y1,e=l.AABBBounds.y2,i=0,n=o;t<i&&s.setAttributes({y:i,textBaseline:"top"}),e>n&&l.setAttributes({y:n,textBaseline:"bottom"})}else{const t=o,e=0,i=s.AABBBounds.y2,n=l.AABBBounds.y1;i>t&&s.setAttributes({y:t,textBaseline:"bottom"}),n<e&&l.setAttributes({y:e,textBaseline:"top"})}}(t,e)}const qk=t=>t;class Zk{constructor(t,e,i,o,n){var r,s,l;if(this.x=0,this.y=0,this.padding=o,this.table=n,this.orient=null!==(r=t.orient)&&void 0!==r?r:"left",this.type=null!==(s=t.type)&&void 0!==s?s:"band",this.option=St({},function(t){var e,i;return(null===(i=null===(e=null==t?void 0:t.colorScheme)||void 0===e?void 0:e.default)||void 0===i?void 0:i.palette)?St({},Fk,{tick:{style:{stroke:t.colorScheme.default.palette.axisDomainColor||"#D9DDE4"}},subTick:{style:{stroke:t.colorScheme.default.palette.axisDomainColor||"#D9DDE4"}},label:{style:{fill:t.colorScheme.default.palette.axisLabelFontColor||"#89909D"}},title:{style:{fill:t.colorScheme.default.palette.secondaryFontColor||"#333333"}}}):Fk}(t.__vtableChartTheme),function(t,e){let i;return"left"===t?i=e.axisStyle.leftAxisStyle:"right"===t?i=e.axisStyle.rightAxisStyle:"top"===t?i=e.axisStyle.topAxisStyle:"bottom"===t&&(i=e.axisStyle.bottomAxisStyle),St({},e.axisStyle.defaultAxisStyle,i)}(this.orient,n.theme),function(t,e,i){if(!i)return{};const o=i.axis;let n,r;return"linear"===e||"log"===e||"symlog"===e?n=i.axisLinear:"band"===e&&(n=i.axisBand),"top"===t||"bottom"===t?r=i.axisX:"left"!==t&&"right"!==t||(r=i.axisY),St({},o,n,r)}(this.orient,this.type,t.__vtableChartTheme),t),"left"===this.orient||"right"===this.orient){const t=0,n=0;this.width=e,this.height=i-o[0]-o[2]-n,this.y=o[0]+t}else if("top"===this.orient||"bottom"===this.orient){const t=0,n=0;this.width=e-o[1]-o[3]-n,this.height=i,this.x=o[3]+t}this.visible=null===(l=t.visible)||void 0===l||l,this.inverse="inverse"in t&&!!t.inverse,"band"===t.type&&(this.data=t.domain),this.initScale(),this.initData(),this.createComponent(),this.initEvent()}initScale(){const t=this.option;"band"===this.type||"point"===this.type?(this.scale=new Vk,this.scale.bandPadding=t.bandPadding,this.scale.paddingInner=t.paddingInner,this.scale.paddingOuter=t.paddingOuter,this.scale.calcScales(.1,.3),this.scale.updateScaleDomain(this.data),this.updateScaleRange()):"linear"!==this.type&&"time"!==this.type&&"log"!==this.type&&"symlog"!==this.type||(this.scale=new Yk(this.type),this.scale.setExtraAttrFromSpec(t.nice,t.zero,t.range,t.expand,t.base,t.constant),this.scale.transformScaleDomain(),this.scale.updateScaleDomain(),this.updateScaleRange())}initData(){var t,e,i;this.table._vDataSet||(this.table._vDataSet=new xk),function(t,e,i){t.getParser(e)||t.registerParser(e,i)}(this.table._vDataSet,"scale",qk),t=this.table._vDataSet,e="ticks",i=Ty,t.getTransform(e)||t.registerTransform(e,i);const o=this.option.label||{},n=this.option.tick||{},r=new Sk(this.table._vDataSet).parse(this.scale._scale,{type:"scale"}).transform({type:"ticks",options:{sampling:!1!==this.option.sampling,tickCount:n.tickCount,forceTickCount:n.forceTickCount,tickStep:n.tickStep,tickMode:n.tickMode,noDecimals:n.noDecimals,axisOrientType:this.orient,coordinateType:"cartesian",labelStyle:o.style,labelFormatter:o.formatMethod,labelGap:o.minGap,labelLastVisible:o.lastVisible,labelFlush:o.flush}},!1);this.tickData=r,this.computeData()}computeData(){this.tickData.reRunAllTransform()}initEvent(){}createComponent(){const t=zk(this.option),e=this.getUpdateAttribute();e.verticalFactor="top"===this.orient||"right"===this.orient?-1:1,this.component=new wb(St({disableTriggerEvent:this.table.options.disableInteraction},t,e)),this.component.setAttributes(this.setLayoutStartPosition({x:this.x,y:this.y})),this.component.originAxis=this}resize(t,e){this.width=t-("top"===this.orient||"bottom"===this.orient?this.padding[1]+this.padding[3]:0),this.height=e-("left"===this.orient||"right"===this.orient?this.padding[2]+this.padding[0]:0),this.updateScaleRange(),this.computeData();const i=zk(this.option),o=this.getUpdateAttribute();o.verticalFactor="top"===this.orient||"right"===this.orient?-1:1,this.component.setAttributes(St({},i,o)),this.component.setAttributes(this.setLayoutStartPosition({x:this.x,y:this.y})),this.overlap()}overlap(){!function(t,e){const i=t.find((t=>"axis-label-container-layer-0"===t.name),!0),o=t.find((t=>"axis-label-container-layer-1"===t.name),!0);Kk(i?i.getChildren():[],e),Kk(o?o.getChildren():[],e)}(this.component,this)}getLayoutRect(){return{width:this.width,height:this.height}}getUpdateAttribute(){this.table.tableNoFrameHeight,this.table.tableNoFrameWidth;const{width:t,height:e}=this.getLayoutRect(),i=jk(this.orient),o="left"===(n=this.orient)||"right"===n;var n;let r={x:0,y:0},s=0;i?(r={x:t,y:0},s=t):o&&(r={x:0,y:e},s=e);const l="top"===this.orient||"bottom"===this.orient?e:t;return{start:{x:0,y:0},end:r,title:{text:this.option.title.text,maxWidth:this._getTitleLimit(i)},items:this.getLabelItems(s),verticalLimitSize:l,verticalMinSize:l}}getLabelItems(t){return[this.tickData.latestData.map((e=>({id:e.value,label:e.value,value:0===t?0:this.scale.dataToPosition([e.value])/t,rawValue:e.value}))).filter((t=>t.value>=0&&t.value<=1))]}updateScaleRange(){var t,e,i,o,n,r,s,l;const a=null!==(e=null===(t=this.option.innerOffset)||void 0===t?void 0:t.right)&&void 0!==e?e:0,h=null!==(o=null===(i=this.option.innerOffset)||void 0===i?void 0:i.left)&&void 0!==o?o:0,d=null!==(r=null===(n=this.option.innerOffset)||void 0===n?void 0:n.top)&&void 0!==r?r:0,c=null!==(l=null===(s=this.option.innerOffset)||void 0===s?void 0:s.bottom)&&void 0!==l?l:0,{width:u,height:g}=this.getLayoutRect(),p=this.option.inverse||!1;let f=[0,0];jk(this.orient)?ht(u)&&(f=p?[u-a,h]:[h,u-a]):ht(g)&&(f=p?[d,g-c]:[g-c,d]),this.scale.updateRange(f)}setLayoutStartPosition(t){let{x:e,y:i}=t;return ht(e)&&(e+=Number("left"===this.orient)*this.getLayoutRect().width),ht(i)&&(i+=Number("top"===this.orient)*this.getLayoutRect().height),{x:e,y:i}}_getTitleLimit(t){var e,i,o;if(this.option.title.visible&&J(null===(e=this.option.title.style)||void 0===e?void 0:e.maxLineWidth)){let e=(null===(i=this.option.title.style)||void 0===i?void 0:i.angle)||0;if((null===(o=this.option.title)||void 0===o?void 0:o.autoRotate)&&J(this.option.title.angle)&&(e="left"===this.option.orient?-90:90),t){const t=this.getLayoutRect().width,i=Math.abs(Math.cos(ye(e)));return i<1e-6?1/0:t/i}const n=this.getLayoutRect().height,r=Math.abs(Math.sin(ye(e)));return r<1e-6?1/0:n/r}return null}getScale(){return this.scale._scale}getDomainSpec(){return this.scale.domain}}function Jk(t,e){var i,o,n,r,s,l,a,h,d,c,u,g,p,f,v,m;const b=St({},Fk,t);let y=0;!1!==b.tick.visible&&(y=null!==(i=b.tick.width)&&void 0!==i?i:4);let C=0;if(b.label.visible){if("band"===b.type)b.domain.forEach((t=>{var i,o,n,r,s,l,a,h,d,c,u,g,p,f,v,m;b.label.formatMethod&&(t=b.label.formatMethod(t));const{width:y,height:w}=e.measureText(t,{fontSize:null!==(n=null===(o=null===(i=b.label)||void 0===i?void 0:i.style)||void 0===o?void 0:o.fontSize)&&void 0!==n?n:Pk,fontWeight:null!==(l=null===(s=null===(r=b.label)||void 0===r?void 0:r.style)||void 0===s?void 0:s.fontWeight)&&void 0!==l?l:"normal",fontFamily:null!==(d=null===(h=null===(a=b.label)||void 0===a?void 0:a.style)||void 0===h?void 0:h.fontFamily)&&void 0!==d?d:Lk}),x=(null===(u=null===(c=b.label)||void 0===c?void 0:c.style)||void 0===u?void 0:u.maxLineWidth)||1/0,_=(null!==(f=null===(p=null===(g=b.label)||void 0===g?void 0:g.style)||void 0===p?void 0:p.angle)&&void 0!==f?f:0)+("vertical"===(null===(m=null===(v=b.label)||void 0===v?void 0:v.style)||void 0===m?void 0:m.direction)?90:0);C=Math.max(C,eL(Math.min(y,x),w,_).width)}));else{let i;if(rt(t.__ticksForVTable))i=t.__ticksForVTable;else{const t=b.range,e=Math.abs(t.min)>1?Math.round(t.min):t.min,o=Math.abs(t.max)>1?Math.round(t.max):t.max;i=[tL(e),tL(o)]}i.forEach((t=>{var i,o,n,r,s,l,a,h,d,c,u,g,p,f,v,m;b.label.formatMethod&&(t=b.label.formatMethod(t));const{width:y,height:w}=e.measureText(t,{fontSize:null!==(n=null===(o=null===(i=b.label)||void 0===i?void 0:i.style)||void 0===o?void 0:o.fontSize)&&void 0!==n?n:Pk,fontWeight:null!==(l=null===(s=null===(r=b.label)||void 0===r?void 0:r.style)||void 0===s?void 0:s.fontWeight)&&void 0!==l?l:"normal",fontFamily:null!==(d=null===(h=null===(a=b.label)||void 0===a?void 0:a.style)||void 0===h?void 0:h.fontFamily)&&void 0!==d?d:Lk}),x=(null===(u=null===(c=b.label)||void 0===c?void 0:c.style)||void 0===u?void 0:u.maxLineWidth)||1/0,_=(null!==(f=null===(p=null===(g=b.label)||void 0===g?void 0:g.style)||void 0===p?void 0:p.angle)&&void 0!==f?f:0)+("vertical"===(null===(m=null===(v=b.label)||void 0===v?void 0:v.style)||void 0===m?void 0:m.direction)?90:0);C=Math.max(C,eL(Math.min(y,x),w,_).width)}))}C+=null!==(o=b.label.space)&&void 0!==o?o:4}let w=0;if(b.title.visible&&nt(b.title.text)){const{width:i,height:o}=e.measureText(b.title.text,{fontSize:null!==(s=null===(r=null===(n=b.title)||void 0===n?void 0:n.style)||void 0===r?void 0:r.fontSize)&&void 0!==s?s:Pk,fontWeight:null!==(h=null===(a=null===(l=b.title)||void 0===l?void 0:l.style)||void 0===a?void 0:a.fontWeight)&&void 0!==h?h:"normal",fontFamily:null!==(u=null===(c=null===(d=b.title)||void 0===d?void 0:d.style)||void 0===c?void 0:c.fontFamily)&&void 0!==u?u:Lk}),y=(null===(p=null===(g=b.label)||void 0===g?void 0:g.style)||void 0===p?void 0:p.maxLineWidth)||1/0,C=eL(Math.min(i,y),o,null===(v=null===(f=b.title)||void 0===f?void 0:f.style)||void 0===v?void 0:v.angle);w="left"!==t.orient&&"right"!==t.orient||!b.title.autoRotate?C.width:C.height,w+=null!==(m=b.title.space)&&void 0!==m?m:4}return y+C+w+1}function Qk(t,e){var i,o,n,r,s,l,a,h,d,c,u,g,p,f,v,m;const b=St({},Fk,t);let y=0;!1!==b.tick.visible&&(y=null!==(i=b.tick.width)&&void 0!==i?i:4);let C=0;if(b.label.visible){if("band"===b.type)b.domain.forEach((t=>{var i,o,n,r,s,l,a,h,d,c,u,g,p,f,v,m;b.label.formatMethod&&(t=b.label.formatMethod(t));const{width:y,height:w}=e.measureText(t,{fontSize:null!==(n=null===(o=null===(i=b.label)||void 0===i?void 0:i.style)||void 0===o?void 0:o.fontSize)&&void 0!==n?n:Pk,fontWeight:null!==(l=null===(s=null===(r=b.label)||void 0===r?void 0:r.style)||void 0===s?void 0:s.fontWeight)&&void 0!==l?l:"normal",fontFamily:null!==(d=null===(h=null===(a=b.label)||void 0===a?void 0:a.style)||void 0===h?void 0:h.fontFamily)&&void 0!==d?d:Lk}),x=(null===(u=null===(c=b.label)||void 0===c?void 0:c.style)||void 0===u?void 0:u.maxLineWidth)||1/0,_=(null!==(f=null===(p=null===(g=b.label)||void 0===g?void 0:g.style)||void 0===p?void 0:p.angle)&&void 0!==f?f:0)+("vertical"===(null===(m=null===(v=b.label)||void 0===v?void 0:v.style)||void 0===m?void 0:m.direction)?90:0);C=Math.max(C,eL(Math.min(y,x),w,_).height)}));else{let i;if(rt(t.__ticksForVTable))i=t.__ticksForVTable;else{const t=b.range,e=Math.abs(t.min)>1?Math.round(t.min):t.min,o=Math.abs(t.max)>1?Math.round(t.max):t.max;i=[tL(e),tL(o)]}i.forEach((t=>{var i,o,n,r,s,l,a,h,d,c,u,g,p,f,v,m;b.label.formatMethod&&(t=b.label.formatMethod(t));const{width:y,height:w}=e.measureText(t,{fontSize:null!==(n=null===(o=null===(i=b.label)||void 0===i?void 0:i.style)||void 0===o?void 0:o.fontSize)&&void 0!==n?n:Pk,fontWeight:null!==(l=null===(s=null===(r=b.label)||void 0===r?void 0:r.style)||void 0===s?void 0:s.fontWeight)&&void 0!==l?l:"normal",fontFamily:null!==(d=null===(h=null===(a=b.label)||void 0===a?void 0:a.style)||void 0===h?void 0:h.fontFamily)&&void 0!==d?d:Lk}),x=(null===(u=null===(c=b.label)||void 0===c?void 0:c.style)||void 0===u?void 0:u.maxLineWidth)||1/0,_=(null!==(f=null===(p=null===(g=b.label)||void 0===g?void 0:g.style)||void 0===p?void 0:p.angle)&&void 0!==f?f:0)+("vertical"===(null===(m=null===(v=b.label)||void 0===v?void 0:v.style)||void 0===m?void 0:m.direction)?90:0);C=Math.max(C,eL(Math.min(y,x),w,_).height)}))}C+=null!==(o=b.label.space)&&void 0!==o?o:4}let w=0;if(b.title.visible&&b.title.text){const{width:i,height:o}=e.measureText(b.title.text,{fontSize:null!==(s=null===(r=null===(n=b.title)||void 0===n?void 0:n.style)||void 0===r?void 0:r.fontSize)&&void 0!==s?s:Pk,fontWeight:null!==(h=null===(a=null===(l=b.title)||void 0===l?void 0:l.style)||void 0===a?void 0:a.fontWeight)&&void 0!==h?h:"normal",fontFamily:null!==(u=null===(c=null===(d=b.title)||void 0===d?void 0:d.style)||void 0===c?void 0:c.fontFamily)&&void 0!==u?u:Lk}),y=(null===(p=null===(g=b.label)||void 0===g?void 0:g.style)||void 0===p?void 0:p.maxLineWidth)||1/0,C=eL(Math.min(i,y),o,null===(v=null===(f=b.title)||void 0===f?void 0:f.style)||void 0===v?void 0:v.angle);w="bottom"!==t.orient&&"top"!==t.orient||!b.title.autoRotate?C.height:C.width,w+=null!==(m=b.title.space)&&void 0!==m?m:4}return y+C+w+1}function tL(t){return"number"!=typeof t&&(t=Number(t)),Number(t.toPrecision(1)).toString()}function eL(t,e){const i=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:0)*Math.PI/180,o=-t/2,n=-e/2,r=t/2,s=-e/2,l=t/2,a=e/2,h=-t/2,d=e/2,c={x:o*Math.cos(i)-n*Math.sin(i),y:o*Math.sin(i)+n*Math.cos(i)},u={x:r*Math.cos(i)-s*Math.sin(i),y:r*Math.sin(i)+s*Math.cos(i)},g={x:l*Math.cos(i)-a*Math.sin(i),y:l*Math.sin(i)+a*Math.cos(i)},p={x:h*Math.cos(i)-d*Math.sin(i),y:h*Math.sin(i)+d*Math.cos(i)},f=Math.min(c.x,u.x,g.x,p.x),v=Math.max(c.x,u.x,g.x,p.x),m=Math.min(c.y,u.y,g.y,p.y);return{width:v-f,height:Math.max(c.y,u.y,g.y,p.y)-m}}class iL{constructor(t,e){this._emptyTipOption={spaceBetweenTextAndIcon:20,text:"no data",textStyle:{fontSize:14,color:"#000"},icon:{image:'<svg t="1716726614852" class="icon" viewBox="0 0 1194 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2621" width="200" height="200"><path d="M1038.694079 367.237067c13.265507 23.342857-16.633865-40.004445-63.05621-40.004446H219.018794c-26.558738 0-46.46393 13.334815-63.05621 40.004446S0.006238 607.277601 0.006238 650.608819V940.647979a82.351494 82.351494 0 0 0 82.961402 83.349526H1111.702885a82.337632 82.337632 0 0 0 82.975264-83.349526V650.608819c0-43.331218-155.970208-283.371753-155.970208-283.371752zM730.066575 667.284269a136.328386 136.328386 0 0 1-132.738243 133.33429 133.417459 133.417459 0 0 1-132.738243-133.33429v-6.681269a40.6698 40.6698 0 0 0-36.497473-26.66963H73.015044l119.458874-220.02445s23.231965-40.004445 53.103614-40.004446h713.481918c26.544876 0 29.871649 10.008042 46.436207 40.004446L1128.33675 633.947231H769.904682c-26.184476 0-39.838107 7.623855-39.838107 33.337038zM338.505391 210.559919l-89.601086-86.69016a22.178487 22.178487 0 0 1 0-33.26773 21.984425 21.984425 0 0 1 33.170699 0l89.601087 86.676299a22.317102 22.317102 0 0 1 0 33.26773 24.950798 24.950798 0 0 1-33.1707 0z m252.197118-40.059891a25.532983 25.532983 0 0 1-6.639685-16.633865l-3.326773-126.694606A28.263709 28.263709 0 0 1 603.995739 0.515788c13.251646-3.326773 23.204242 10.021904 26.544877 23.342858V153.866163a28.249847 28.249847 0 0 1-23.259688 26.66963c-6.611961-3.312911-13.279369-3.312911-16.578419-10.035765z m235.646421 33.337038a22.372548 22.372548 0 0 1 0-33.337038l86.288175-90.030795a22.039871 22.039871 0 0 1 33.170699 0 22.289379 22.289379 0 0 1 0 33.364761l-82.961401 90.003072a25.962691 25.962691 0 0 1-36.483611 0z" fill="#8a8a8a" p-id="2622"></path></svg>',width:100,height:100}},this.isReleased=!1,this.table=e,this._emptyTipOption=Object.assign(this._emptyTipOption,!0===t?{}:t),this._emptyTipComponent=this._createOrUpdateEmptyTipComponent(this._getEmptyTipAttrs())}_createOrUpdateEmptyTipComponent(t){if(this._emptyTipComponent)Rt(t,this._cacheAttrs)||this._emptyTipComponent.setAttributes(t);else{const e=new eC(t);e.name="emptyTip",this.table.scenegraph.stage.defaultLayer.appendChild(e),this._emptyTipComponent=e}return this._emptyTipComponent}resize(){var t;if(!this._emptyTipComponent)return;const e=this.table.transpose||!1===this.table.options.indicatorsAsCol?this.table.getFrozenColsWidth():0,i=!this.table.transpose||this.table.options.indicatorsAsCol?this.table.getFrozenRowsHeight():0,o=(this.table.columnHeaderLevelCount>0&&this.table.isListTable()?this.table.getDrawRange().width:this.table.tableNoFrameWidth)-e-this.table.getTheme().scrollStyle.width,n=(this.table.rowHeaderLevelCount>0&&this.table.isListTable()?this.table.getDrawRange().height:this.table.tableNoFrameHeight)-i-this.table.getTheme().scrollStyle.width;this._emptyTipComponent.setAttributes({spaceBetweenTextAndIcon:this._emptyTipOption.spaceBetweenTextAndIcon,x:this.table.tableX+e,y:this.table.tableY+i,width:o,height:n,text:Object.assign(Object.assign({text:this._emptyTipOption.text},this._emptyTipOption.textStyle),{fill:null===(t=this._emptyTipOption.textStyle)||void 0===t?void 0:t.color}),icon:Object.assign({},this._emptyTipOption.icon)})}release(){this._emptyTipComponent&&this.table.scenegraph.stage.defaultLayer.removeChild(this._emptyTipComponent),this._emptyTipComponent=null,this.isReleased=!0}resetVisible(){(this.table.recordsCount&&0!==this.table.recordsCount||this.table.internalProps.layoutMap.rowCount!==this.table.internalProps.layoutMap.columnHeaderLevelCount)&&this.table.internalProps.layoutMap.colCount!==this.table.internalProps.layoutMap.rowHeaderLevelCount?this.table.scenegraph.stage.defaultLayer.children.includes(this._emptyTipComponent)&&this.table.scenegraph.stage.defaultLayer.removeChild(this._emptyTipComponent):this.table.scenegraph.stage.defaultLayer.children.includes(this._emptyTipComponent)||this.table.scenegraph.stage.defaultLayer.appendChild(this._emptyTipComponent)}_getEmptyTipAttrs(){var t;const e=this.table.transpose||!1===this.table.options.indicatorsAsCol?this.table.getFrozenColsWidth():0,i=!this.table.transpose||this.table.options.indicatorsAsCol?this.table.getFrozenRowsHeight():0,o=(this.table.columnHeaderLevelCount>0&&this.table.isListTable()?this.table.getDrawRange().width:this.table.tableNoFrameWidth)-e-this.table.getTheme().scrollStyle.width,n=(this.table.rowHeaderLevelCount>0&&this.table.isListTable()?this.table.getDrawRange().height:this.table.tableNoFrameHeight)-i-this.table.getTheme().scrollStyle.width;return{spaceBetweenTextAndIcon:this._emptyTipOption.spaceBetweenTextAndIcon,x:this.table.tableX+e,y:this.table.tableY+i,width:o,height:n,text:Object.assign(Object.assign({text:this._emptyTipOption.text},this._emptyTipOption.textStyle),{fill:null===(t=this._emptyTipOption.textStyle)||void 0===t?void 0:t.color}),icon:Object.assign({},this._emptyTipOption.icon)}}}var oL=function(t,e){var i={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(i[o]=t[o]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(o=Object.getOwnPropertySymbols(t);n<o.length;n++)e.indexOf(o[n])<0&&Object.prototype.propertyIsEnumerable.call(t,o[n])&&(i[o[n]]=t[o[n]])}return i};const nL={orient:"bottom",position:"middle",padding:30,title:{visible:!1,padding:0,textStyle:{fontSize:14,fill:"#000000",fontWeight:"normal"},space:12},item:{visible:!0,spaceCol:10,spaceRow:10,padding:2,background:{state:{selectedHover:{fill:"gray",fillOpacity:.7},unSelectedHover:{fill:"gray",fillOpacity:.2}}},shape:{space:4,state:{unSelected:{fillOpacity:.5}}},label:{space:4,style:{fill:"#89909D",fontSize:14},state:{unSelected:{fillOpacity:.5}}}},allowAllCanceled:!0,visible:!0};class rL{constructor(t,e){var i,o,n,r;this.table=e,this.option=Ct(t),this.orient=null!==(i=t.orient)&&void 0!==i?i:"left",this.visible=null===(o=t.visible)||void 0===o||o,this.position=null!==(n=t.position)&&void 0!==n?n:"middle",this.selectedData=null!==(r=t.defaultSelected)&&void 0!==r?r:null,this.createComponent(),this.initEvent()}createComponent(){const t=this.getLegendAttributes({width:this.table.tableNoFrameWidth,height:this.table.tableNoFrameHeight}),e=new Vy(St({},t,{defaultSelected:this.selectedData,disableTriggerEvent:this.table.options.disableInteraction}));e.name="legend",this.legendComponent=e,!1===this.visible&&(e.setAttributes({maxWidth:0,width:0,maxHeight:0,height:0,clip:!0}),e.hideAll()),this.table.scenegraph.stage.defaultLayer.appendChild(e),this.adjustTableSize(t)}resize(){this.legendComponent&&(this.legendComponent.setAttributes({width:this.table.tableNoFrameWidth,height:this.table.tableNoFrameHeight}),this.adjustTableSize(this.legendComponent.attribute))}adjustTableSize(t){var e,i;let o=isFinite(this.legendComponent.AABBBounds.width())?this.legendComponent.AABBBounds.width():0,n=isFinite(this.legendComponent.AABBBounds.height())?this.legendComponent.AABBBounds.height():0;if(o<=0||n<=0)return;const r=this.table.tableNoFrameWidth,s=this.table.tableNoFrameHeight,l=r_(null!==(i=null!==(e=t.padding)&&void 0!==e?e:this.option.padding)&&void 0!==i?i:10);let a=0,h=0;"left"===this.orient?(a=l[3],h=0,o+=l[1]+l[3]):"top"===this.orient?(a=0,h=l[0],n+=l[0]+l[2]):"right"===this.orient?(a=r-o-l[1],h=0,o+=l[1]+l[3]):"bottom"===this.orient&&(a=0,h=s-n-l[2],n+=l[0]+l[2]);const d="bottom"===this.orient||"top"===this.orient?"horizontal":"vertical",c=this.position;let u=0,g=0;"horizontal"===d?u="middle"===c?(r-o)/2:"end"===c?r-o-l[1]:l[3]:g="middle"===c?(s-n)/2:"end"===c?s-n-l[2]:l[0],this.legendComponent.setAttributes({dx:u,dy:g,x:a,y:h}),"left"===this.orient?(this.table.tableNoFrameWidth=this.table.tableNoFrameWidth-Math.ceil(o),this.table.tableX+=Math.ceil(o)):"top"===this.orient?(this.table.tableNoFrameHeight=this.table.tableNoFrameHeight-Math.ceil(n),this.table.tableY+=Math.ceil(n)):"right"===this.orient?this.table.tableNoFrameWidth=this.table.tableNoFrameWidth-Math.ceil(o):"bottom"===this.orient&&(this.table.tableNoFrameHeight=this.table.tableNoFrameHeight-Math.ceil(n))}getLegendAttributes(t){var e,i;const o="bottom"===this.orient||"top"===this.orient?"horizontal":"vertical",n=function(t,e){const i=St({},nL,t),{title:o={},item:n={},pager:r={},background:s={},type:l,id:a,visible:h,orient:d,position:c,data:u,filter:g,regionId:p,regionIndex:f,seriesIndex:v,seriesId:m,padding:b}=i,y=oL(i,["title","item","pager","background","type","id","visible","orient","position","data","filter","regionId","regionIndex","seriesIndex","seriesId","padding"]);return o.visible&&(y.title=Bk(o)),vt(n.focusIconStyle)||Rk(n.focusIconStyle),Mk(n.shape),Mk(n.label),Mk(n.value),Mk(n.background),I_(n.maxWidth)&&(n.maxWidth=Number(n.maxWidth.substring(0,n.maxWidth.length-1))*e.width/100),I_(n.width)&&(n.width=Number(n.width.substring(0,n.width.length-1))*e.width/100),I_(n.height)&&(n.height=Number(n.height.substring(0,n.height.length-1))*e.width/100),y.item=n,vt(r.textStyle)||Rk(r.textStyle),Mk(r.handler),y.pager=r,s.visible&&!vt(s.style)&&(St(y,s.style),Q(s.padding)&&(y.padding=s.padding)),y}(this.option,t),r=r_(null!==(i=null!==(e=n.padding)&&void 0!==e?e:this.option.padding)&&void 0!==i?i:10);return Object.assign({layout:o,items:this.getLegendItems(),maxWidth:t.width-r[1]-r[3],maxHeight:t.height-r[0]-r[2]},n)}getLegendItems(){return this.option.data}initEvent(){this.legendComponent&&(this.legendComponent.addEventListener(Iy.legendItemClick,(t=>{const e=mt(t,"detail.currentSelected");this.table.fireListeners(Xw.LEGEND_ITEM_CLICK,{model:this,value:e,event:t})})),this.legendComponent.addEventListener(Iy.legendItemHover,(t=>{const e=mt(t,"detail");this.table.fireListeners(Xw.LEGEND_ITEM_HOVER,{model:this,value:e,event:t})})),this.legendComponent.addEventListener(Iy.legendItemUnHover,(t=>{const e=mt(t,"detail");this.table.fireListeners(Xw.LEGEND_ITEM_UNHOVER,{model:this,value:e,event:t})})),this.legendComponent.addEventListener("legendItemAttributeUpdate",(t=>{this.table.scenegraph.updateNextFrame()})))}getLegendBounds(){return{width:isFinite(this.legendComponent.AABBBounds.width())?this.legendComponent.AABBBounds.width():0,height:isFinite(this.legendComponent.AABBBounds.height())?this.legendComponent.AABBBounds.height():0}}release(){this.legendComponent&&this.table.scenegraph.stage.defaultLayer.removeChild(this.legendComponent),this.legendComponent=null}}var sL=function(t,e){var i={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(i[o]=t[o]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(o=Object.getOwnPropertySymbols(t);n<o.length;n++)e.indexOf(o[n])<0&&Object.prototype.propertyIsEnumerable.call(t,o[n])&&(i[o[n]]=t[o[n]])}return i};const lL={orient:"right",position:"middle",padding:30,title:{visible:!1,padding:0,textStyle:{fontSize:14,fontWeight:"normal",fill:{type:"palette",key:"titleFontColor"}},space:12},handler:{visible:!0},startText:{style:{fontSize:14,fontWeight:"normal",fill:{type:"palette",key:"labelFontColor"}}},endText:{style:{fontSize:14,fontWeight:"normal",fill:{type:"palette",key:"labelFontColor"}}},handlerText:{style:{fontSize:14,fontWeight:"normal",fill:{type:"palette",key:"labelFontColor"}}}},aL={horizontal:Object.assign(Object.assign({},lL),{rail:{width:200,height:8,style:{fill:"rgba(0,0,0,0.04)"}}}),vertical:Object.assign(Object.assign({},lL),{rail:{width:8,height:200,style:{fill:"rgba(0,0,0,0.04)"}}})},hL={horizontal:Object.assign({sizeBackground:{fill:"#cdcdcd"},track:{style:{fill:"rgba(20,20,20,0.1)"}},rail:{width:200,height:4,style:{fill:"rgba(0,0,0,0.04)"}}},lL),vertical:Object.assign({sizeBackground:{fill:"#cdcdcd"},track:{style:{fill:"rgba(20,20,20,0.1)"}},rail:{width:4,height:200,style:{fill:"rgba(0,0,0,0.04)"}}},lL)};class dL{constructor(t,e){var i,o,n,r;this.table=e,this.option=Ct(t),this.orient=null!==(i=t.orient)&&void 0!==i?i:"left",this.visible=null===(o=t.visible)||void 0===o||o,this.position=null!==(n=t.position)&&void 0!==n?n:"middle",this.selectedData=null!==(r=t.defaultSelected)&&void 0!==r?r:null,this.createComponent(),this.initEvent()}createComponent(){const t=this.getLegendAttributes({width:this.table.tableNoFrameWidth,height:this.table.tableNoFrameHeight});let e;e="color"===this.option.type?new Ky(St({},t,{slidable:!0})):new Zy(St({},t,{slidable:!0})),e.name="legend",this.legendComponent=e,this.table.scenegraph.stage.defaultLayer.appendChild(e),this.adjustTableSize(t)}resize(){this.legendComponent&&(this.legendComponent.setAttributes({width:this.table.tableNoFrameWidth,height:this.table.tableNoFrameHeight}),this.adjustTableSize(this.legendComponent.attribute))}adjustTableSize(t){var e,i;let o=isFinite(this.legendComponent.AABBBounds.width())?this.legendComponent.AABBBounds.width():0,n=isFinite(this.legendComponent.AABBBounds.height())?this.legendComponent.AABBBounds.height():0;if(o<=0||n<=0)return;const r=this.table.tableNoFrameWidth,s=this.table.tableNoFrameHeight,l=r_(null!==(i=null!==(e=t.padding)&&void 0!==e?e:this.option.padding)&&void 0!==i?i:10);let a=0,h=0;"left"===this.orient?(a=l[3],h=0,o+=l[1]+l[3]):"top"===this.orient?(a=0,h=l[0],n+=l[0]+l[2]):"right"===this.orient?(a=r-o-l[1],h=0,o+=l[1]+l[3]):"bottom"===this.orient&&(a=0,h=s-n-l[2],n+=l[0]+l[2]);const d="bottom"===this.orient||"top"===this.orient?"horizontal":"vertical",c=this.position;let u=0,g=0;"horizontal"===d?u="middle"===c?(r-o)/2:"end"===c?r-o-l[1]:l[3]:g="middle"===c?(s-n)/2:"end"===c?s-n-l[2]:l[0],this.legendComponent.setAttributes({dx:u,dy:g,x:a,y:h}),"left"===this.orient?(this.table.tableNoFrameWidth=this.table.tableNoFrameWidth-Math.ceil(o),this.table.tableX+=Math.ceil(o)):"top"===this.orient?(this.table.tableNoFrameHeight=this.table.tableNoFrameHeight-Math.ceil(n),this.table.tableY+=Math.ceil(n)):"right"===this.orient?this.table.tableNoFrameWidth=this.table.tableNoFrameWidth-Math.ceil(o):"bottom"===this.orient&&(this.table.tableNoFrameHeight=this.table.tableNoFrameHeight-Math.ceil(n))}getLegendAttributes(t){const e="bottom"===this.orient||"top"===this.orient?"horizontal":"vertical",i="horizontal"===e?"bottom":this.orient;return Object.assign(Object.assign({},function(t,e){const i=St({},("color"===t.type?aL:hL)["bottom"===t.orient||"top"===t.orient?"horizontal":"vertical"],t),{title:o={},handler:n={},rail:r={},track:s={},startText:l,endText:a,handlerText:h,sizeBackground:d,background:c={},type:u,id:g,visible:p,orient:f,position:v,data:m,defaultSelected:b,field:y,filter:C,regionId:w,regionIndex:x,seriesIndex:_,seriesId:S,padding:A}=i,B=sL(i,["title","handler","rail","track","startText","endText","handlerText","sizeBackground","background","type","id","visible","orient","position","data","defaultSelected","field","filter","regionId","regionIndex","seriesIndex","seriesId","padding"]);return o.visible&&(B.title=Bk(o)),B.showHandler=!1!==n.visible,vt(n.style)||(B.handlerStyle=Rk(n.style)),Q(r.width)&&(B.railWidth=r.width),Q(r.height)&&(B.railHeight=r.height),vt(r.style)||(B.railStyle=Rk(r.style)),vt(s.style)||(B.trackStyle=Rk(s.style)),B.startText=Mk(l),B.endText=Mk(a),B.handlerText=Mk(h),vt(d)||(B.sizeBackground=Rk(d)),c.visible&&!vt(c.style)&&(St(B,c.style),Q(c.padding)&&(B.padding=c.padding)),B}(this.option)),{layout:e,align:i,min:this.option.min,max:this.option.max,value:this.option.value,["color"===this.option.type?"colors":"sizeRange"]:"color"===this.option.type?this.option.colors:this.option.sizeRange})}initEvent(){this.legendComponent&&this.legendComponent.addEventListener("change",(t=>{const e=mt(t,"detail.value");this.table.fireListeners(Xw.LEGEND_CHANGE,{model:this,value:e,event:t}),this.table.scenegraph.updateNextFrame()}))}getLegendBounds(){return{width:isFinite(this.legendComponent.AABBBounds.width())?this.legendComponent.AABBBounds.width():0,height:isFinite(this.legendComponent.AABBBounds.height())?this.legendComponent.AABBBounds.height():0}}release(){this.legendComponent&&this.table.scenegraph.stage.defaultLayer.removeChild(this.legendComponent),this.legendComponent=null}}function cL(t,e){return"color"===t.type||"size"===t.type?new dL(t,e):new rL(t,e)}class uL{constructor(t){this._table=t}release(){this.unbindMenuElement(),this._menuElement&&this._menuElement.release(),this._menuElement=void 0}_getMenuElement(){return this._menuElement||(this._menuElement=this.createMenuElementInternal()),this._menuElement}bindMenuElement(t,e,i){return this._getMenuElement().bindToCell(this._table,t,e,i)}unbindMenuElement(){this._getMenuElement().unbindFromCell()}pointInMenuElement(t,e){return this._getMenuElement().pointInMenuElement(t,e)}}const gL="vtable__menu-element",pL=`${gL}--hidden`,fL=`${gL}--shown`;class vL{constructor(t){var e,i,o;this._handler=new Zw,this._rootElement=nT("div",[gL,pL]),this._rootElement.addEventListener("wheel",(t=>{t.stopPropagation()})),null===(e=this._rootElement)||void 0===e||e.addEventListener("mousedown",(t=>{t.stopPropagation(),t.preventDefault()})),null===(i=this._rootElement)||void 0===i||i.addEventListener("click",(e=>{if(e.stopPropagation(),e.preventDefault(),this._rootElement.classList.contains(pL))return;const{col:i,row:o,dropDownIndex:n,menuKey:r,text:s,hasChildren:l}=e.target;if("number"!=typeof n||l)return void e.stopPropagation();const a=t.isPivotTable()?t.internalProps.layoutMap.getPivotDimensionInfo(i,o):t.getHeaderField(i,o),h=t._dropDownMenuIsHighlight(i,o,n);t.fireListeners(Xw.DROPDOWN_MENU_CLICK,{col:i,row:o,field:a,menuKey:r,text:s,highlight:h,cellLocation:t.getCellLocation(i,o),event:e}),t.fireListeners(Xw.DROPDOWN_MENU_CLEAR,null),t.fireListeners(Xw.HIDE_MENU,null),e.stopPropagation()})),null===(o=this._rootElement)||void 0===o||o.addEventListener("mousemove",(t=>{this._rootElement.classList.contains(pL)||t.stopPropagation()}))}get rootElement(){return this._rootElement}release(){this.unbindFromCell();const t=this._rootElement;(null==t?void 0:t.parentElement)&&t.parentElement.removeChild(t),this._handler.release(),delete this._rootElement}bindToCell(t,e,i,o){const n=this._rootElement;if(this._menuInstanceInfo=o,null==n||n.classList.remove(fL),null==n||n.classList.add(pL),this._canBindToCell(t,e,i)){if(n.innerHTML="",n.appendChild(o.content),this._bindCell(t,e,i,o.position,o.referencePosition))return null==n||n.classList.add(fL),null==n||n.classList.remove(pL),!0}else this.unbindFromCell();return!1}unbindFromCell(){const t=this._rootElement;this._menuInstanceInfo=void 0,(null==t?void 0:t.parentElement)&&(t.classList.remove(fL),t.classList.add(pL))}_canBindToCell(t,e,i){const o=t.getCellRangeRelativeRect({col:e,row:i}),n=t.getElement(),{top:r,bottom:s,left:l,right:a}=o;if(t.isFrozenCell(e,i))return!0;if(s<t.getFrozenRowsHeight()||a<t.getFrozenColsWidth()||l>t.tableNoFrameWidth-t.getRightFrozenColsWidth()||r>t.tableNoFrameHeight-t.getBottomFrozenRowsHeight())return!1;const{offsetHeight:h,offsetWidth:d}=n;return!(h<r||d<l)}_bindCell(t,e,i,o,n){const r=this._rootElement,s=t.getElement(),{width:l,height:a}=t.internalProps.element.getBoundingClientRect();if(r){r.parentElement!==s&&s.appendChild(r),r.style.left="0px";const t=.8*l;r.style.maxWidth=`${t}px`;const e=r.clientWidth,i=r.clientHeight;let h,d;return o&&(h=o.x,d=o.y),n&&(h=n.rect.right-e,d=n.rect.bottom),d+i>a&&(d=a-i,h+=e-2),d<0&&(d/=2),r.style.top=`${d}px`,h<0?h=0:h+e>l&&(h=l-e),r.style.left=`${h}px`,!0}return!1}pointInMenuElement(t,e){const i=this._rootElement,{x:o,y:n,width:r,height:s}=i.getBoundingClientRect();return t>o-5&&t<o+r+5&&e>n-5&&e<n+s+5}}class mL extends uL{createMenuElementInternal(){return new CT(this._table)}}let bL=class extends uL{createMenuElementInternal(){return new vL(this._table)}};const yL={"dropdown-menu":function(t){return new mL(t)},"context-menu":function(t){return new mL(t)},container:t=>new bL(t)};class CL{constructor(t){this._table=t,this._menuInstances={},this._bindTableEvent(t)}release(){const t=this._menuInstances;for(const e in t)t[e].release();delete this._menuInstances,this._attachInfo=null}_bindToCell(t,e,i,o){var n;const r=this._attachInfo,s=this._getMenuInstanceInfo(t,e,i,o);if(!r||s&&r.instance===s.instance||(null===(n=r.instance)||void 0===n||n.unbindMenuElement(),this._attachInfo=null),!s)return;const{instance:l,info:a}=s;if(l&&l.bindMenuElement(t,e,a)){const i=this._table.getCellRange(t,e);this._attachInfo={range:i,instance:l}}}_unbindFromCell(){const t=this._attachInfo;if(!t)return;const{instance:e}=t;null==e||e.unbindMenuElement(),this._attachInfo=null}_isBindToCell(t,e){const i=this._attachInfo;return!!i&&Ow(i.range,t,e)}pointInMenuElement(t,e){if(!this._attachInfo)return!1;const i=this._attachInfo,{instance:o}=i;return o.pointInMenuElement(t,e)}_bindTableEvent(t){t.on(Xw.DROPDOWN_ICON_CLICK,(t=>{this._attachInfo&&this._isBindToCell(t.col,t.row)?this._unbindFromCell():this._bindToCell(t.col,t.row,"dropdown-menu")})),t.on(Xw.DROPDOWN_MENU_CLEAR,(t=>{this._unbindFromCell()})),t.on(Xw.CONTEXTMENU_CELL,(e=>{var i,o,n,r;if("html"===(null===(i=t.internalProps.menu)||void 0===i?void 0:i.renderMode)){const i=t._getMouseAbstractPoint(e.event,!1);let s=null;i.inTable&&"function"==typeof(null===(o=t.internalProps.menu)||void 0===o?void 0:o.contextMenuItems)?s=t.internalProps.menu.contextMenuItems(t.getHeaderField(e.col,e.row),e.row,e.col,t):i.inTable&&Array.isArray(null===(n=t.internalProps.menu)||void 0===n?void 0:n.contextMenuItems)&&(s=null===(r=t.internalProps.menu)||void 0===r?void 0:r.contextMenuItems),this._bindToCell(e.col,e.row,"context-menu",{content:s,position:{x:i.x,y:i.y}})}}))}_getMenuInstanceInfo(t,e,i,o){const n=this._table,r=this._menuInstances,s=function(t,e,i,o,n){var r;const{lineHeight:s,textBaseline:l,textStick:a}=t._getCellStyle(e,i);let h=t.getCellRangeRelativeRect(t.getCellRange(e,i));a&&(h=t.getVisibleCellRangeRelativeRect({col:e,row:i}));let{left:d,right:c,bottom:u,top:g,width:p,height:f}=h;if(t.isHeader(e,i)&&({left:d,right:c,bottom:u,top:g,width:p,height:f}=t.internalProps.headerHelper.getDropDownIconRect(h,s,l||"middle")),null==n?void 0:n.content)return{type:o,position:n.position,referencePosition:null!==(r=n.referencePosition)&&void 0!==r?r:{rect:{left:d,right:c,top:g,bottom:u,width:p,height:f}},content:n.content};if("dropdown-menu"===o){const{dropDownMenu:n=t.globalDropDownMenu,pivotInfo:r}=t._getHeaderLayoutMap(e,i);return{type:o,referencePosition:{rect:{left:d,right:c,top:g,bottom:u,width:p,height:f}},content:n,pivotInfo:r}}return null}(n,t,e,i,o);return s?{instance:r&&r[i]||r&&(r[i]=yL[i](n)),type:i,info:s}:null}}class wL{constructor(t,e){this.isReleased=!1,this.table=e,this._titleOption=St({orient:"top"},t),!1!==t.visible&&(this._titleComponent=this._createOrUpdateTitleComponent(this._getTitleAttrs()))}_createOrUpdateTitleComponent(t){if(this._titleComponent)Rt(t,this._cacheAttrs)||this._titleComponent.setAttributes(t);else{const e=new Jy(t);e.name="title",this.table.scenegraph.stage.defaultLayer.appendChild(e),this._titleComponent=e}return this._adjustTableSize(this._titleComponent.attribute),this._titleComponent}resize(){var t,e,i,o,n;if(!this._titleComponent)return;const r=r_(null!==(t=this._titleOption.padding)&&void 0!==t?t:10),s=null!==(e=this._titleOption.width)&&void 0!==e?e:("adaptive"===this.table.widthMode?this.table.tableNoFrameWidth:Math.min(this.table.tableNoFrameWidth,this.table.getDrawRange().width))-r[1]-r[3],l=null!==(i=this._titleOption.height)&&void 0!==i?i:("adaptive"===this.table.heightMode?this.table.tableNoFrameHeight:Math.min(this.table.tableNoFrameHeight,this.table.getDrawRange().height))-r[0]-r[2];this._titleComponent.setAttributes({x:(null!==(o=this._titleOption.x)&&void 0!==o?o:"right"===this._titleOption.orient)?this.table.tableX+Math.min(this.table.tableNoFrameWidth,this.table.getDrawRange().width):this.table.tableX,y:(null!==(n=this._titleOption.y)&&void 0!==n?n:"bottom"===this._titleOption.orient)?this.table.tableY+this.table.tableNoFrameHeight:this.table.tableY,width:"top"===this._titleOption.orient||"bottom"===this._titleOption.orient?s:this._titleOption.width,height:"left"===this._titleOption.orient||"right"===this._titleOption.orient?l:this._titleOption.height,textStyle:Object.assign({width:s},this._titleOption.textStyle),subtextStyle:Object.assign({width:s},this._titleOption.subtextStyle)}),this._adjustTableSize(this._titleComponent.attribute)}_adjustTableSize(t){var e,i,o,n;const r=isFinite(null===(e=this._titleComponent)||void 0===e?void 0:e.AABBBounds.width())?this._titleComponent.AABBBounds.width():0,s=isFinite(null===(i=this._titleComponent)||void 0===i?void 0:i.AABBBounds.height())?this._titleComponent.AABBBounds.height():0;"left"===this._titleOption.orient?(this.table.tableNoFrameWidth=this.table.tableNoFrameWidth-Math.ceil(r),this.table.tableX+=Math.ceil(r)):"top"===this._titleOption.orient?(this.table.tableNoFrameHeight=this.table.tableNoFrameHeight-Math.ceil(s),this.table.tableY+=Math.ceil(s)):"right"===this._titleOption.orient?this.table.tableNoFrameWidth=this.table.tableNoFrameWidth-Math.ceil(r):"bottom"===this._titleOption.orient&&(this.table.tableNoFrameHeight=this.table.tableNoFrameHeight-Math.ceil(s)),this._cacheAttrs=t,"right"!==this._titleOption.orient&&"bottom"!==this._titleOption.orient||this._titleComponent.setAttributes({x:(null!==(o=this._titleOption.x)&&void 0!==o?o:"right"===this._titleOption.orient)?this.table.tableX+this.table.tableNoFrameWidth:this.table.tableX,y:(null!==(n=this._titleOption.y)&&void 0!==n?n:"bottom"===this._titleOption.orient)?this.table.tableY+this.table.tableNoFrameHeight:this.table.tableY})}release(){this._titleComponent&&this.table.scenegraph.stage.defaultLayer.removeChild(this._titleComponent),this._titleComponent=null,this.isReleased=!0}_getTitleAttrs(){var t,e,i,o,n,r,s,l,a,h,d;const c=this._titleOption.text||this._titleOption.subtext?10:0,u=r_(null!==(t=this._titleOption.padding)&&void 0!==t?t:c),g=null!==(e=this._titleOption.width)&&void 0!==e?e:Math.min(this.table.tableNoFrameWidth,this.table.getDrawRange().width)-u[1]-u[3],p=null!==(i=this._titleOption.height)&&void 0!==i?i:Math.min(this.table.tableNoFrameHeight,this.table.getDrawRange().height)-u[0]-u[2];return{text:null!==(o=this._titleOption.text)&&void 0!==o?o:"",subtext:null!==(n=this._titleOption.subtext)&&void 0!==n?n:"",x:(null!==(r=this._titleOption.x)&&void 0!==r?r:"right"===this._titleOption.orient)?this.table.tableX+Math.min(this.table.tableNoFrameWidth,this.table.getDrawRange().width):this.table.tableX,y:(null!==(s=this._titleOption.y)&&void 0!==s?s:"bottom"===this._titleOption.orient)?this.table.tableY+this.table.tableNoFrameHeight:this.table.tableY,width:"top"===this._titleOption.orient||"bottom"===this._titleOption.orient?g:this._titleOption.width,height:"left"===this._titleOption.orient||"right"===this._titleOption.orient?p:this._titleOption.height,minWidth:this._titleOption.minWidth,maxWidth:this._titleOption.maxWidth,minHeight:this._titleOption.minHeight,maxHeight:this._titleOption.maxHeight,padding:this._titleOption.padding,align:null!==(l=this._titleOption.align)&&void 0!==l?l:"left",verticalAlign:null!==(a=this._titleOption.verticalAlign)&&void 0!==a?a:"top",textStyle:Object.assign({width:g},this._titleOption.textStyle),subtextStyle:Object.assign({width:g},this._titleOption.subtextStyle),dx:null!==(h=this._titleOption.dx)&&void 0!==h?h:0,dy:null!==(d=this._titleOption.dy)&&void 0!==d?d:0}}}class xL{constructor(t){this._table=t}release(){var t,e;this.unbindTooltipElement(),this._tooltipElement&&(null===(e=(t=this._tooltipElement).release)||void 0===e||e.call(t)),this._tooltipElement=void 0}_getTooltipElement(){return this._tooltipElement||(this._tooltipElement=this.createTooltipElementInternal()),this._tooltipElement}bindTooltipElement(t,e,i,o){return this._getTooltipElement().bindToCell(this._table,t,e,i,o)}moveTooltipElement(t,e,i,o){this._getTooltipElement().move(this._table,t,e,i,o)}unbindTooltipElement(){this._getTooltipElement().unbindFromCell()}locateTooltipElement(t,e,i,o,n){this._getTooltipElement()._locate(this._table,t,e,i,o,n)}}!function(){if("node"===sw.mode)return;const t=document.createElement("style");t.id="vtable-tooltip-styleSheet",t.textContent="\n@keyframes vtable__bubble-tooltip-element--shown-animation {\n\t0% {\n\t\topacity: 0;\n\t}\n\t100% {\n\t\topacity: 1;\n\t}\n}\n.vtable__bubble-tooltip-element {\n\tposition: absolute;\n\t\n\t// pointer-events: none;\n\t//user-select: none;\n\tmax-width: 300px;\n\tz-index: 99999;\n\n\tbackground: #FFFFFF;\n border: 1px solid #E6E8ED;\n box-sizing: border-box;\n border-radius: 4px;\n box-shadow: 0px 2px 4px rgb(27 31 35 / 8%);\n color: #141414;\n font-size: 13px;\n}\n.vtable__bubble-tooltip-element--hidden {\n\topacity: 0;\n pointer-events: none;\n\tuser-select: none;\n\t/* transform: translate(-50%, -50%); */\n\ttransition: opacity 75ms linear;\n}\n.vtable__bubble-tooltip-element--shown {\n\topacity: 1;\n\t/* transform: translate(-50%, -50%); */\n\tanimation: vtable__bubble-tooltip-element--shown-animation 150ms ease-out;\n}\n.vtable__bubble-tooltip-element__content {\n\t/* font-size: .75rem; */\n\tpadding: 6px 8px;\n\tmin-height: 1em;\n\tline-height: 1.5;\n\twidth: 100%;\n\tdisplay: block;\n\twhite-space: pre-wrap;\n\tmargin: 0;\n\tbox-sizing: border-box;\n\toverflow: auto;\n\tword-wrap: break-word;\n\tposition: relative;\n\tbackground-color: #FFF;\n\tz-index: 2;\n\tborder-radius: 4px;\n}\n/* WebKit Microsoft Edge(新版): */\n.vtable__bubble-tooltip-element__content::-webkit-scrollbar {\n width: 0;\n height: 0;\n background-color: transparent;\n}\n/* Opera Firefox */\n.vtable__bubble-tooltip-element__content > scrollbar-track {\n width: 0;\n height: 0;\n background-color: transparent;\n}\n/* Internet Explorer 11 和 Microsoft Edge(旧版) */\n.vtable__bubble-tooltip-element__content > scrollbar {\n width: 0;\n height: 0;\n background-color: transparent;\n}\n.vtable__bubble-tooltip-element__triangle {\n\t/* font-size: .75rem; */\n\tposition: absolute;\n\twidth: 10px;\n\theight: 10px;\n\tdisplay: block;\n\ttransform: rotate(45deg);\n transform-origin: 50% 50% 0;\n\tz-index: 1;\n\tbackground-color: #FFF;\n\tborder: 1px solid #E6E8ED;\n}\n",document.head.appendChild(t)}();const _L="vtable__bubble-tooltip-element",SL=`${_L}__content`,AL=`${_L}__triangle`,BL=`${_L}--hidden`,RL=`${_L}--shown`;class ML{constructor(){this._handler=new Zw;const t=this._rootElement=nT("div",[_L,BL]),e=nT("div",[SL]),i=nT("span",[AL]);t.appendChild(i),t.appendChild(e),this._messageElement=t.querySelector(`.${SL}`)||void 0,this._triangleElement=t.querySelector(`.${AL}`)||void 0,t.addEventListener("mousemove",(()=>{this._disappearDelayId&&clearTimeout(this._disappearDelayId)})),t.addEventListener("mouseleave",(()=>{this._disappearDelay=void 0,this.unbindFromCell()})),e.addEventListener("wheel",(t=>{t.stopPropagation()})),e.addEventListener("copy",(t=>{(function(t){const e=window.getSelection();if(e.rangeCount){const i=e.getRangeAt(0);return i.endOffset>i.startOffset&&t.contains(i.commonAncestorContainer)}return!1})(e)&&t.stopPropagation()}))}bindToCell(t,e,i,o,n){var r,s,l,a,h,d,c,u,g,p,f,v,m,b,y,C,w,x,_;this._disappearDelay=null==o?void 0:o.disappearDelay,this._disappearDelayId&&clearTimeout(this._disappearDelayId);const S=this._rootElement,A=this._messageElement,B=this._triangleElement;if(null==S||S.classList.remove(RL),null==S||S.classList.add(BL),this._canBindToCell(t,e,i)){if(A.setAttribute("style",""),B.setAttribute("style",""),(null==o?void 0:o.className)&&S.classList.add(o.className),(null===(r=null==o?void 0:o.style)||void 0===r?void 0:r.bgColor)&&(A.style.backgroundColor=null===(s=null==o?void 0:o.style)||void 0===s?void 0:s.bgColor),(null===(l=null==o?void 0:o.style)||void 0===l?void 0:l.bgColor)&&(B.style.backgroundColor=null===(a=null==o?void 0:o.style)||void 0===a?void 0:a.bgColor),B.style.display=!0===(null===(h=null==o?void 0:o.style)||void 0===h?void 0:h.arrowMark)?"block":"none",(null===(d=null==o?void 0:o.style)||void 0===d?void 0:d.fontSize)&&(A.style.fontSize=(null!==(u=null===(c=null==o?void 0:o.style)||void 0===c?void 0:c.fontSize)&&void 0!==u?u:12)+"px"),(null===(g=null==o?void 0:o.style)||void 0===g?void 0:g.fontFamily)&&(A.style.fontFamily=null===(p=null==o?void 0:o.style)||void 0===p?void 0:p.fontFamily),(null===(f=null==o?void 0:o.style)||void 0===f?void 0:f.color)&&(A.style.color=null===(v=null==o?void 0:o.style)||void 0===v?void 0:v.color),(null===(m=null==o?void 0:o.style)||void 0===m?void 0:m.padding)&&(A.style.padding=`${null===(b=null==o?void 0:o.style)||void 0===b?void 0:b.padding.join("px ")}px`),(null===(y=null==o?void 0:o.style)||void 0===y?void 0:y.maxHeight)&&(A.style.maxHeight=`${null===(C=null==o?void 0:o.style)||void 0===C?void 0:C.maxHeight}px`),(null===(w=null==o?void 0:o.style)||void 0===w?void 0:w.maxWidth)&&(A.style.maxWidth=`${null===(x=null==o?void 0:o.style)||void 0===x?void 0:x.maxWidth}px`),A&&(A.textContent=null==o?void 0:o.content),this._bindToCell(t,e,i,null==o?void 0:o.position,null==o?void 0:o.referencePosition,n,null===(_=null==o?void 0:o.style)||void 0===_?void 0:_.arrowMark))return null==S||S.classList.add(RL),null==S||S.classList.remove(BL),!0}else this.unbindFromCell();return!1}release(){var t,e;this.unbindFromCell();const i=this._rootElement;(null==i?void 0:i.parentElement)&&i.parentElement.removeChild(i),null===(e=null===(t=this._handler)||void 0===t?void 0:t.release)||void 0===e||e.call(t),delete this._rootElement,delete this._messageElement}move(t,e,i,o,n){const r=this._rootElement;this._canBindToCell(t,e,i)?(this._bindToCell(t,e,i,null==o?void 0:o.position,null==o?void 0:o.referencePosition,n),null==r||r.classList.add(RL),null==r||r.classList.remove(BL)):this.unbindFromCell()}unbindFromCell(){var t;if(this._disappearDelay)this._disappearDelayId=setTimeout((()=>{const t=this._rootElement;(null==t?void 0:t.parentElement)&&(t.classList.remove(RL),t.classList.add(BL))}),null!==(t=this._disappearDelay)&&void 0!==t?t:0);else{const t=this._rootElement;(null==t?void 0:t.parentElement)&&(t.classList.remove(RL),t.classList.add(BL))}}_canBindToCell(t,e,i){const o=t.getCellRangeRelativeRect({col:e,row:i}),n=t.getElement(),{bottom:r,left:s,right:l,top:a}=o;if(t.isFrozenCell(e,i))return!0;if(r<t.getFrozenRowsHeight()||l<t.getFrozenColsWidth()||s>t.tableNoFrameWidth-t.getRightFrozenColsWidth()||a>t.tableNoFrameHeight-t.getBottomFrozenRowsHeight())return!1;const{offsetHeight:h,offsetWidth:d}=n;return!(a>h||s>d)}_bindToCell(t,e,i,o,n,r,s){const l=this._rootElement,a=t.getCellRangeRelativeRect({col:e,row:i}),h=t.internalProps.tooltip.parentElement,d=t.internalProps.element.offsetWidth,{width:c}=a;if(l){let a,u;l.parentElement!==h&&h.appendChild(l),l.style.left="0px";const g=Math.min(.8*d,4*c);l.style.maxWidth=`${g}px`;const p=l.clientWidth,f=l.clientHeight;if(!o&&!n)return!1;{const l=this.getComputedPosition(t,e,i,o,n,r,s);u=l.x,a=l.y}l.style.left=`${u}px`,l.style.top=`${a}px`,bw()&&(l.style.fontSize="11px");const{x1:v,x2:m,y1:b,y2:y}=t.stateManager.menu.bounds,C=u,w=C+p,x=a,_=C+f;return!(t.stateManager.menu.isShow&&v<w&&m>C&&y>x&&b<_)}return!1}getComputedPosition(t,e,i,o,n,r,s){var l;const a=this._rootElement,h=t.getCellRangeRelativeRect({col:e,row:i}),{x:d,y:c}=t.internalProps.tooltip.parentElement.getBoundingClientRect(),{width:u,height:g,x:p,y:f}=t.internalProps.element.getBoundingClientRect(),{width:v}=h;let m,b;const y=Math.min(.8*u,4*v);a.style.maxWidth=`${y}px`;const C=a.clientWidth,w=a.clientHeight,x=s?6:0;if(o)b=o.x,m=o.y+x,this._triangleElement.style.left="50%",this._triangleElement.style.marginLeft="-5px",this._triangleElement.style.top="-5px";else if(n){let t=null!==(l=n.placement)&&void 0!==l?l:DC.bottom;const e=n.rect.left+n.rect.width/2,i=n.rect.top+n.rect.height/2,o=n.rect.top,s=n.rect.bottom,a=n.rect.left,h=n.rect.right;let d=0;const c=()=>{d++,d>=4||(this.removeStyleFromTriangle(),t===DC.top?(b=e-C/2,m=o-w-x,this._triangleElement.style.left="50%",this._triangleElement.style.marginLeft="-5px",this._triangleElement.style.bottom="-5px",r&&m<0&&(t=DC.right,c())):t===DC.bottom?(b=e-C/2,m=s+x,this._triangleElement.style.left="50%",this._triangleElement.style.marginLeft="-5px",this._triangleElement.style.top="-5px",r&&m+w>g&&(t=DC.left,c())):t===DC.left?(m=i-w/2,b=a-C-x,this._triangleElement.style.top="50%",this._triangleElement.style.marginTop="-5px",this._triangleElement.style.right="-5px",r&&b<0&&(t=DC.top,c())):t===DC.right&&(m=i-w/2,b=h+x,this._triangleElement.style.top="50%",this._triangleElement.style.marginTop="-5px",this._triangleElement.style.left="-5px",r&&b+C>u&&(t=DC.bottom,c())))};c()}return r&&(b<0?b=0:b+a.offsetWidth>u&&(b=u-a.offsetWidth)),{x:b+p-d,y:m+f-c}}removeStyleFromTriangle(){this._triangleElement.style.left="",this._triangleElement.style.right="",this._triangleElement.style.top="",this._triangleElement.style.bottom="",this._triangleElement.style.marginLeft="",this._triangleElement.style.marginTop=""}_locate(t,e,i,o,n,r){const s=this.getComputedPosition(t,e,i,o,n,r),l=s.x,a=s.y;this._rootElement.style.left=`${l}px`,this._rootElement.style.top=`${a}px`}}class TL extends xL{createTooltipElementInternal(){return new ML}}const kL=function(t){return new TL(t)};class LL{constructor(t,e){this._table=t,this._tooltipInstances={},this._bindTableEvent(t),this.confine=e}release(){var t,e;const i=this._tooltipInstances;for(const o in i)null===(e=null===(t=i[o])||void 0===t?void 0:t.release)||void 0===e||e.call(t);delete this._tooltipInstances,this._attachInfo=null}_bindToCell(t,e,i){var o;const n=this._attachInfo,r=this._getTooltipInstanceInfo(t,e);if(!n||r&&n.instance===r||(null===(o=n.instance)||void 0===o||o.unbindTooltipElement(),this._attachInfo=null),r&&r&&r.bindTooltipElement(t,e,i,this.confine)){const o=this._table.getCellRange(t,e);this._attachInfo={range:o,instance:r,tooltipOptions:i}}}_move(t,e,i){const o=this._attachInfo;if(!o||!Ow(o.range,t,e))return;const{instance:n}=o;null==n||n.moveTooltipElement(t,e,i,this.confine)}moveToPosition(t,e,i,o){const n=this._attachInfo;if(!n||!Ow(n.range,t,e))return;const{instance:r}=n;this._attachInfo.tooltipOptions.position=i,this._attachInfo.tooltipOptions.referencePosition=o,null==r||r.locateTooltipElement(t,e,i,o,this.confine)}_unbindFromCell(){const t=this._attachInfo;if(!t)return;const{instance:e}=t;null==e||e.unbindTooltipElement(),this._attachInfo=null}_isBindCell(t,e){const i=this._attachInfo;return!!i&&Ow(i.range,t,e)}_bindTableEvent(t){t.on(Xw.MOUSEENTER_CELL,(e=>{if(bw())return;const{x1:i,x2:o,y1:n,y2:r}=t.stateManager.menu.bounds;if(t.stateManager.menu.isShow&&"number"==typeof e.x&&"number"==typeof e.y&&e.x>i&&e.x<o&&e.y>n&&e.y<r)return;const{col:s,row:l}=e;this.showTooltip(s,l)})),t.on(Xw.MOUSEMOVE_CELL,(e=>{var i,o;if(!bw()){if(null===(o=null===(i=this._attachInfo)||void 0===i?void 0:i.tooltipOptions)||void 0===o?void 0:o.referencePosition){const i=this._attachInfo.tooltipOptions.referencePosition,{event:o}=e,{left:n,right:r,top:s,bottom:l}=i.rect,a=t._getMouseAbstractPoint(o,!1);a.inTable&&a.x>=n-5&&a.x<=r+5&&a.y>=s-5&&a.y<=l+5||this._unbindFromCell()}this._attachInfo&&t.stateManager.menu.isShow&&this._bindToCell(e.col,e.row)}})),t.on(Xw.MOUSELEAVE_CELL,(t=>{this._unbindFromCell()})),t.on(Xw.SELECTED_CELL,(t=>{this._isBindCell(t.col,t.row)&&this._unbindFromCell()})),t.on(Xw.MOUSELEAVE_TABLE,(t=>{this._unbindFromCell()})),t.on(Xw.SCROLL,(t=>{this._unbindFromCell()}))}showTooltip(t,e){var i,o,n;let r;const s=this._table,l=s.getHeaderDescription(t,e);if(l){const o=s.getCellRangeRelativeRect({col:t,row:e});r={content:l,referencePosition:{placement:DC.bottom,rect:o},disappearDelay:null!==(i=s.internalProps.tooltip.overflowTextTooltipDisappearDelay)&&void 0!==i?i:0,style:s.theme.tooltipStyle}}else if(null===(o=s.internalProps.tooltip)||void 0===o?void 0:o.isShowOverflowTextTooltip){const i=s.getCellOverflowText(t,e),o=s.getCellRangeRelativeRect({col:t,row:e});i&&(r={content:l?`${l}\n ${i}`:i,referencePosition:{placement:DC.bottom,rect:o},disappearDelay:null!==(n=s.internalProps.tooltip.overflowTextTooltipDisappearDelay)&&void 0!==n?n:0,style:s.theme.tooltipStyle})}r?this._bindToCell(t,e,r):this._unbindFromCell()}_getTooltipInstanceInfo(t,e){const i=this._table,o=this._tooltipInstances;return o&&o["bubble-tooltip"]||o&&(o["bubble-tooltip"]=kL(i))}isBinded(t){var e;return JSON.stringify(t)===JSON.stringify(null===(e=this._attachInfo)||void 0===e?void 0:e.tooltipOptions)}}class PL{constructor(t){this.titleRows=[],this.showedTitleRows=[],this.rowNow=-1,this.skipStartRow=-1,this.skipEndRow=-1,this.table=t,this.table.on("scroll",(t=>{"vertical"===t.scrollDirection&&this.updateGroupTitle()})),this.table.on("resize_column",(t=>{this.updateGroupTitle()}))}updateGroupTitle(){0===this.table.scrollTop?(this.titleRows=[],this.showedTitleRows=[]):-1!==this.skipStartRow&&-1!==this.skipEndRow&&this.skipStartRow!==this.table.scenegraph.proxy.bodyTopRow-1?(this.table.scenegraph.proxy.screenTopRow<=this.skipStartRow||this.table.scenegraph.proxy.screenTopRow>=this.skipEndRow)&&(this.skipStartRow=-1,this.skipEndRow=-1,this.updateGroupTitleInfo()):(this.skipStartRow=-1,this.skipEndRow=-1,this.updateGroupTitleInfo()),this.updateScenegraph()}updateGroupTitleInfo(){this.rowNow=this.table.scenegraph.proxy.screenTopRow+this.titleRows.length;const t=this.table.getRecordIndexByCell(0,this.rowNow),e=this.table.getRecordIndexByCell(0,this.rowNow+1);this.getTitleRowsByRecordIndex(t,e)}getTitleRowsByRecordIndex(t,e){rt(t)||(t=[t]),rt(e)||(e=[e]);for(let e=0;e<t.length;e++){const i=t.slice(0,e+1);this.table.dataSource.getRaw(i)}const i=[],o=e.length===t.length+1;let n=t.slice(0,o?t.length:t.length-1);const r=this.table.dataSource.currentIndexedData;for(let e=this.rowNow-this.table.columnHeaderLevelCount;e>=0;e--){const o=r[e];if(rt(o)&&n.length===o.length){let t=!0;for(let e=0;e<o.length;e++)if(o[e]!==n[e]){t=!1;break}t&&(i.push(e+this.table.columnHeaderLevelCount),n=n.slice(0,n.length-1))}else if(o===t[0]){i.push(e+this.table.columnHeaderLevelCount);break}}this.titleRows=i.reverse()}updateScenegraph(){const{table:t}=this,{shadowGroup:e,shadowGroupFrozen:i}=function(t){const e=t.scenegraph.colHeaderGroup,i=t.scenegraph.cornerHeaderGroup;if(!e.border){const i=sc({x:0,y:0,width:0,height:0,cursor:"pointer"});e.add(i),e.border=i,i.attachShadow(i.shadowRoot),i.name="border-rect",i.addEventListener("click",(e=>{const i=t.listTreeStickCellPlugin.titleRows,{shadowTarget:o}=e.pickParams,n=K_(o),{col:r,row:s}=n;FL(s-i.indexOf(s),t)}))}if(!i.border){const e=sc({x:0,y:0,width:0,height:0,cursor:"pointer"});i.add(e),i.border=e,e.attachShadow(e.shadowRoot),e.name="border-rect",e.addEventListener("click",(e=>{const i=t.listTreeStickCellPlugin.titleRows,{shadowTarget:o}=e.pickParams,n=K_(o),{col:r,row:s}=n;FL(s-i.indexOf(s),t)}))}const o=e.border.shadowRoot,n=i.border.shadowRoot;return o.removeAllChild(),n.removeAllChild(),{shadowGroup:o,shadowGroupFrozen:n}}(t);this.showedTitleRows.length=0;let o=0;for(let n=0;n<t.colCount;n++){let r;n<t.frozenColCount?(r=new zS({x:t.getColsWidth(0,n-1),y:t.getFrozenRowsHeight()}),i.add(r)):(r=new zS({x:t.getColsWidth(t.frozenColCount,n-1),y:t.getFrozenRowsHeight()}),e.add(r)),r.col=n;for(let e=0;e<this.titleRows.length;e++){const i=this.titleRows[e];if(EL(i,this.rowNow,t.scenegraph.proxy.screenTopRow,this.titleRows)){0===n&&o++;continue}0===n&&this.showedTitleRows.push(i);const s=t.scenegraph.getCell(n,i);if("cell"===s.role){const t=HL(s);t.setAttributes({y:40*e}),r.add(t)}else{const o=lA(n,i,t,!0,!0);o.setAttributes({y:40*e}),r.add(o)}}}o>0&&-1===this.skipStartRow&&-1===this.skipEndRow&&(this.skipStartRow=t.scenegraph.proxy.screenTopRow-1,this.skipEndRow=t.scenegraph.proxy.screenTopRow+1)}}function EL(t,e,i,o){return t===e&&t!==i+o.length-1||t===i+o.indexOf(t)+1&&t<e}function HL(t){const e=t.clone();if(e.role=t.role,e.col=t.col,e.row=t.row,e.mergeStartCol=t.mergeStartCol,e.mergeStartRow=t.mergeStartRow,e.mergeEndCol=t.mergeEndCol,e.mergeEndRow=t.mergeEndRow,e.contentWidth=t.contentWidth,e.contentHeight=t.contentHeight,"cell"===e.role){const t=sc({x:0,y:0,width:e.attribute.width,height:e.attribute.height});e.add(t)}if("group"===t.type){const i=e;t.forEachChildren((t=>{const e=HL(t);i.add(e)}))}return e}function FL(t,e){const i=e.getDrawRange();if(Q(t)&&t>=e.frozenRowCount){const o=e.getFrozenRowsHeight(),n=e.getRowsHeight(0,t-1);e.scrollTop=Math.min(n-o,e.getAllRowsHeight()-i.height)-1}e.scenegraph.updateNextFrame()}const zL={};function IL(t,e,i,o,n,r,s,l,a,h,d,c,u,g,p,f,v,m){var b,y,C,w,x,_,S,A,B,R,M,T,k,L,P,E,H,F,z,I,O,D,W,N,G;const j=Lw(zL,pk)[d],V=WS("padding",p._getCellStyle(n,r),n,r,p);if(Q(V)&&(a=V),!t){const a=NS(n,r,f,p);m&&(t=p.scenegraph.highPerformanceGetCell(n,r,!0))&&"cell"===t.role&&t.setAttributes({x:i,y:o,width:s,height:l,lineWidth:null!==(y=null===(b=null==f?void 0:f.group)||void 0===b?void 0:b.lineWidth)&&void 0!==y?y:void 0,fill:null!==(w=null===(C=null==f?void 0:f.group)||void 0===C?void 0:C.fill)&&void 0!==w?w:void 0,stroke:null!==(_=null===(x=null==f?void 0:f.group)||void 0===x?void 0:x.stroke)&&void 0!==_?_:void 0,strokeArrayWidth:a,strokeArrayColor:null!==(A=null===(S=null==f?void 0:f.group)||void 0===S?void 0:S.strokeArrayColor)&&void 0!==A?A:void 0,cursor:null!==(R=null===(B=null==f?void 0:f.group)||void 0===B?void 0:B.cursor)&&void 0!==R?R:void 0,lineDash:null!==(T=null===(M=null==f?void 0:f.group)||void 0===M?void 0:M.lineDash)&&void 0!==T?T:void 0,lineCap:"butt",clip:!0,cornerRadius:f.group.cornerRadius}),t&&"cell"===t.role||((t=new zS({x:i,y:o,width:s,height:l,lineWidth:null!==(L=null===(k=null==f?void 0:f.group)||void 0===k?void 0:k.lineWidth)&&void 0!==L?L:void 0,fill:null!==(E=null===(P=null==f?void 0:f.group)||void 0===P?void 0:P.fill)&&void 0!==E?E:void 0,stroke:null!==(F=null===(H=null==f?void 0:f.group)||void 0===H?void 0:H.stroke)&&void 0!==F?F:void 0,strokeArrayWidth:a,strokeArrayColor:null!==(I=null===(z=null==f?void 0:f.group)||void 0===z?void 0:z.strokeArrayColor)&&void 0!==I?I:void 0,cursor:null!==(D=null===(O=null==f?void 0:f.group)||void 0===O?void 0:O.cursor)&&void 0!==D?D:void 0,lineDash:null!==(N=null===(W=null==f?void 0:f.group)||void 0===W?void 0:W.lineDash)&&void 0!==N?N:void 0,lineCap:"butt",clip:!0,cornerRadius:f.group.cornerRadius})).role="cell",t.col=n,t.row=r,null==e||e.addCellGroup(t))}t.AABBBounds.width();const U=new uB(v,{stroke:!1,x:a[3],y:a[0],canvas:null!==(G=p.canvas)&&void 0!==G?G:p.scenegraph.stage.window.getContext().canvas,mode:p.options.mode,modeParams:p.options.modeParams,spec:c,ClassType:j,width:s-a[3]-a[1],height:l-a[2]-a[0],chartInstance:u,dataId:g,data:p.getCellValue(n,r),cellPadding:a,dpr:p.internalProps.pixelRatio,axes:p.isPivotChart()?p.internalProps.layoutMap.getChartAxes(n,r):[],tableChartOption:p.options.chartOption});return t.appendChild(U),p.internalProps.layoutMap.setChartInstance(n,r,U.chartInstance),t}function OL(t,e,i,o,n,r,s,l,a,h,d,c,u,g,p,f,v,m){var b,y,C,w,x,_,S,A,B,R,M,T,k,L,P,E,H,F,z,I,O,D,W,N;if(!t){const s=NS(n,r,p,g);m&&(t=g.scenegraph.highPerformanceGetCell(n,r,!0))&&"cell"===t.role&&t.setAttributes({x:i,y:o,width:l,height:a,lineWidth:null!==(y=null===(b=null==p?void 0:p.group)||void 0===b?void 0:b.lineWidth)&&void 0!==y?y:void 0,fill:null!==(w=null===(C=null==p?void 0:p.group)||void 0===C?void 0:C.fill)&&void 0!==w?w:void 0,stroke:null!==(_=null===(x=null==p?void 0:p.group)||void 0===x?void 0:x.stroke)&&void 0!==_?_:void 0,strokeArrayWidth:s,strokeArrayColor:null!==(A=null===(S=null==p?void 0:p.group)||void 0===S?void 0:S.strokeArrayColor)&&void 0!==A?A:void 0,cursor:null!==(R=null===(B=null==p?void 0:p.group)||void 0===B?void 0:B.cursor)&&void 0!==R?R:void 0,lineDash:null!==(T=null===(M=null==p?void 0:p.group)||void 0===M?void 0:M.lineDash)&&void 0!==T?T:void 0,lineCap:"butt",clip:!0,cornerRadius:p.group.cornerRadius}),t&&"cell"===t.role||((t=new zS({x:i,y:o,width:l,height:a,lineWidth:null!==(L=null===(k=null==p?void 0:p.group)||void 0===k?void 0:k.lineWidth)&&void 0!==L?L:void 0,fill:null!==(E=null===(P=null==p?void 0:p.group)||void 0===P?void 0:P.fill)&&void 0!==E?E:void 0,stroke:null!==(F=null===(H=null==p?void 0:p.group)||void 0===H?void 0:H.stroke)&&void 0!==F?F:void 0,strokeArrayWidth:s,strokeArrayColor:null!==(I=null===(z=null==p?void 0:p.group)||void 0===z?void 0:z.strokeArrayColor)&&void 0!==I?I:void 0,cursor:null!==(D=null===(O=null==p?void 0:p.group)||void 0===O?void 0:O.cursor)&&void 0!==D?D:void 0,lineDash:null!==(N=null===(W=null==p?void 0:p.group)||void 0===W?void 0:W.lineDash)&&void 0!==N?N:void 0,lineCap:"butt",clip:!0,cornerRadius:p.group.cornerRadius})).role="cell",t.col=n,t.row=r,null==e||e.addCellGroup(t))}let G;if(u){let t=n,e=r;v&&(t=v.start.col,e=v.start.row),G=g.getCellIcons(t,e)}let j=0,V=0;if(Array.isArray(G)&&0!==G.length){const{leftIconWidth:e,rightIconWidth:i,absoluteLeftIconWidth:o,absoluteRightIconWidth:n}=KS(G,t,v,g);j=e+i,V=e,t.forEachChildren((t=>{"icon-left"===t.role?t.setAttribute("x",t.attribute.x+h[3]):"icon-right"===t.role?t.setAttribute("x",t.attribute.x+l-i-h[1]):"icon-absolute-right"===t.role&&t.setAttribute("x",t.attribute.x+l-n-h[1])})),t.forEachChildren((t=>{"middle"===c?t.setAttribute("y",(a-t.AABBBounds.height())/2):"bottom"===c?t.setAttribute("y",a-t.AABBBounds.height()-h[2]):t.setAttribute("y",h[0])}))}const U=function(t,e,i,o,n,r,s,l,a){var h,d,c,u;const g=a._getCellStyle(t,e),p=DS("size",g,t,e,a),f=DS("spaceBetweenTextAndIcon",g,t,e,a),v=DS("defaultFill",g,t,e,a),m=DS("defaultStroke",g,t,e,a),b=DS("disableFill",g,t,e,a),y=DS("checkedFill",g,t,e,a),C=DS("checkedStroke",g,t,e,a),w=DS("disableCheckedFill",g,t,e,a),x=DS("disableCheckedStroke",g,t,e,a),_=DS("checkIconImage",g,t,e,a),S=DS("indeterminateIconImage",g,t,e,a),A=a.getCellValue(t,e),B=a.getCellOriginValue(t,e);let R,M,T=null!==(h=A)&&void 0!==h?h:"";tt(A)?(R=A.checked,M=A.disable,T=null!==(d=A.text)&&void 0!==d?d:""):"boolean"==typeof A&&(R=A,T=""),R=a.stateManager.syncCheckedState(t,e,l.field,R);const k=jS(t,e,a),L=a._getCellStyle(t,e),P=null!==(c=L.autoWrapText)&&void 0!==c?c:a.internalProps.autoWrapText,{lineClamp:E}=L,{checked:H,disable:F}=l;if(null==R||"function"==typeof R){const i=Hw(H,{col:t,row:e,table:a,context:null,value:A,dataValue:B});R=a.stateManager.syncCheckedState(t,e,l.field,i)}const z=Hw(F,{col:t,row:e,table:a,context:null,value:A,dataValue:B}),I="auto"===i,O=a.isAutoRowHeight(e),D={text:1===T.length?T[0]:T,maxLineWidth:I?1/0:o-(r[1]+r[3]+k)-p-f,textBaseline:"top",autoWrapText:P,lineClamp:E,wordBreak:"break-word",heightLimit:O?-1:n-Math.floor(r[0]+r[2]),pickable:!1,dx:k,whiteSpace:1!==T.length||P?"normal":"no-wrap"},W={x:0,y:0,text:s.text?Object.assign({},s.text,D):D,icon:{width:Math.floor(p/1.4),height:Math.floor(p/1.4)},box:{width:p,height:p},spaceBetweenTextAndIcon:f,disabled:null!==(u=null!=M?M:z)&&void 0!==u&&u};"indeterminate"===R?(W.checked=void 0,W.indeterminate=!0):(W.checked=R,W.indeterminate=void 0),v&&(W.box.fill=v),m&&(W.box.stroke=m),b&&(W.box.disableFill=b),y&&(W.box.checkedFill=y),C&&(W.box.checkedStroke=C),w&&(W.box.disableCheckedFill=w),x&&(W.box.disableCheckedStroke=x),_&&(W.icon.checkIconImage=_),S&&(W.icon.indeterminateIconImage=S);const N=new Qy(W);return N.name="checkbox",N}(n,r,s-j,l,a,h,p,f,g);return U&&t.appendChild(U),U.render(),l-=h[1]+h[3]+j,a-=h[0]+h[2],"center"===d?U.setAttribute("x",h[3]+V+(l-U.AABBBounds.width())/2):"right"===d?U.setAttribute("x",h[3]+V+l-U.AABBBounds.width()):U.setAttribute("x",h[3]+V),"middle"===c?U.setAttribute("y",h[0]+(a-U.AABBBounds.height())/2):"bottom"===c?U.setAttribute("y",h[0]+a-U.AABBBounds.height()):U.setAttribute("y",h[0]),t}function DL(t,e,i,o,n,r,s,l,a,h,d,c,u,g,p){var f,v,m,b,y,C,w,x,_,S,A,B;if(!t){const s=NS(n,r,g,u);(t=new zS({x:i,y:o,width:l,height:a,lineWidth:null!==(v=null===(f=null==g?void 0:g.group)||void 0===f?void 0:f.lineWidth)&&void 0!==v?v:void 0,fill:null!==(b=null===(m=null==g?void 0:g.group)||void 0===m?void 0:m.fill)&&void 0!==b?b:void 0,stroke:null!==(C=null===(y=null==g?void 0:g.group)||void 0===y?void 0:y.stroke)&&void 0!==C?C:void 0,strokeArrayWidth:s,strokeArrayColor:null!==(x=null===(w=null==g?void 0:g.group)||void 0===w?void 0:w.strokeArrayColor)&&void 0!==x?x:void 0,cursor:null!==(S=null===(_=null==g?void 0:g.group)||void 0===_?void 0:_.cursor)&&void 0!==S?S:void 0,lineDash:null!==(B=null===(A=null==g?void 0:g.group)||void 0===A?void 0:A.lineDash)&&void 0!==B?B:void 0,lineCap:"butt",clip:!0,cornerRadius:g.group.cornerRadius})).role="cell",t.col=n,t.row=r,null==e||e.addCellGroup(t)}const{width:R,height:M}=function(t,e,i,o,n,r,s,l,a,h){var d,c;const u=h._getCellStyle(t,e);let g=DS("size",u,t,e,h),p=DS("innerRadius",u,t,e,h),f=DS("outerRadius",u,t,e,h);const v=DS("spaceBetweenTextAndIcon",u,t,e,h),m=DS("spaceBetweenRadio",u,t,e,h),b=DS("defaultFill",u,t,e,h),y=DS("defaultStroke",u,t,e,h),C=DS("disableFill",u,t,e,h),w=DS("checkedFill",u,t,e,h),x=DS("checkedStroke",u,t,e,h),_=DS("disableCheckedFill",u,t,e,h),S=DS("disableCheckedStroke",u,t,e,h);at(f)?g=2*f:f=Math.round(g/2),(!at(p)||p<0)&&(p=Math.round(f/7*3));const A=h.getCellValue(t,e),B=h.getCellOriginValue(t,e),R=jS(t,e,h),M=h._getCellStyle(t,e),T=null!==(d=M.autoWrapText)&&void 0!==d?d:h.internalProps.autoWrapText,{lineClamp:k}=M,L="auto"===i,P="autoHeight"===h.heightMode,E={maxLineWidth:L?1/0:o-(r[1]+r[3]+R)-g-v,textBaseline:"top",autoWrapText:T,lineClamp:k,wordBreak:"break-word",heightLimit:P?-1:n-Math.floor(r[0]+r[2]),pickable:!1,dx:R},H={x:0,y:0,text:s.text?Object.assign({},s.text,E):E,circle:{innerRadius:p,outerRadius:f},spaceBetweenTextAndIcon:v};b&&(H.circle.fill=b),y&&(H.circle.stroke=y),C&&(H.circle.disableFill=C),w&&(H.circle.checkedFill=w),x&&(H.circle.checkedStroke=x),_&&(H.circle.disableCheckedFill=_),S&&(H.circle.disableCheckedStroke=S);let F=0,z=0;const I=null!==(c=l.radioDirectionInCell)&&void 0!==c?c:"vertical";if(rt(A))A.forEach(((i,o)=>{const n=WL(i,B,o,t,e,l,T,H,h);n&&a.appendChild(n),n.id=`radio-${t}-${e}-${o}`,n.render();const r=n.AABBBounds;"vertical"===I?(n.setAttribute("y",z),z+=r.height()+(o!==A.length-1?m:0),F=Math.max(F,r.width())):"horizontal"===I&&(n.setAttribute("x",F),F+=r.width()+(o!==A.length-1?m:0),z=Math.max(z,r.height()))}));else{const i=WL(A,B,void 0,t,e,l,T,H,h);i&&a.appendChild(i),i.id=`radio-${t}-${e}`,i.render();const o=i.AABBBounds;F=o.width(),z=o.height()}return{width:F,height:z}}(n,r,s,l,a,h,g,p,t,u);return l-=h[1]+h[3],a-=h[0]+h[2],t.forEachChildren((t=>{"center"===d?t.setAttribute("x",h[3]+t.attribute.x+(l-R)/2):"right"===d?t.setAttribute("x",h[3]+t.attribute.x+l-R):t.setAttribute("x",h[3]+t.attribute.x),"middle"===c?t.setAttribute("y",h[0]+t.attribute.y+(a-M)/2):"bottom"===c?t.setAttribute("y",h[0]+t.attribute.y+a-M):t.setAttribute("y",h[0]+t.attribute.y)})),t}function WL(t,e,i,o,n,r,s,l,a){const h=function(t,e,i,o,n,r,s){var l,a;const h=null!==(l=r.radioCheckType)&&void 0!==l?l:"column";let d,c;return tt(t)?d=t.checked:"boolean"==typeof t&&(d=t),d=s.stateManager.syncRadioState(o,n,r.field,h,i,d),null!=d&&"function"!=typeof d||(c=Hw(r.checked,{col:o,row:n,table:s,context:null,value:t,dataValue:e}),d=s.stateManager.syncRadioState(o,n,r.field,h,i,c)),null!==(a=null!=d?d:c)&&void 0!==a&&a}(t,e,i,o,n,r,a),d=function(t,e,i,o,n,r){var s;let l;tt(t)&&(l=t.disable);const a=Hw(n.disable,{col:i,row:o,table:r,context:null,value:t,dataValue:e});return null!==(s=null!=l?l:a)&&void 0!==s&&s}(t,e,o,n,r,a),c=tt(t)?t.text:q(t)?"":null!=t?t:"",u=St({},l,{checked:h,disabled:d,text:{text:1===c.length?c[0]:c,whiteSpace:1!==c.length||s?"normal":"no-wrap"},boundsPadding:0}),g=new tC(u);return g.name="radio",g}const NL=new class extends Xb{constructor(t){super(!1),this.type=Bb.Point,this._padding=0,this.paddingInner(1,t),this.padding=this.paddingOuter,this.paddingInner=void 0,this.paddingOuter=void 0}},GL=new py;function jL(t,e,i,o,n,r,s,l,a,h,d,c){var u,g,p,f,v,m,b,y,C,w,x,_,S,A,B,R,M,T,k,L,P,E,H,F;if(!t){const a=NS(n,r,d,h);c&&(t=h.scenegraph.highPerformanceGetCell(n,r,!0))&&"cell"===t.role&&t.setAttributes({x:i,y:o,width:s,height:l,lineWidth:null!==(g=null===(u=null==d?void 0:d.group)||void 0===u?void 0:u.lineWidth)&&void 0!==g?g:void 0,fill:null!==(f=null===(p=null==d?void 0:d.group)||void 0===p?void 0:p.fill)&&void 0!==f?f:void 0,stroke:null!==(m=null===(v=null==d?void 0:d.group)||void 0===v?void 0:v.stroke)&&void 0!==m?m:void 0,strokeArrayWidth:a,strokeArrayColor:null!==(y=null===(b=null==d?void 0:d.group)||void 0===b?void 0:b.strokeArrayColor)&&void 0!==y?y:void 0,cursor:null!==(w=null===(C=null==d?void 0:d.group)||void 0===C?void 0:C.cursor)&&void 0!==w?w:void 0,lineDash:null!==(_=null===(x=null==d?void 0:d.group)||void 0===x?void 0:x.lineDash)&&void 0!==_?_:void 0,lineCap:"butt",clip:!0,cornerRadius:d.group.cornerRadius}),t&&"cell"===t.role||((t=new zS({x:i,y:o,width:s,height:l,lineWidth:null!==(A=null===(S=null==d?void 0:d.group)||void 0===S?void 0:S.lineWidth)&&void 0!==A?A:void 0,fill:null!==(R=null===(B=null==d?void 0:d.group)||void 0===B?void 0:B.fill)&&void 0!==R?R:void 0,stroke:null!==(T=null===(M=null==d?void 0:d.group)||void 0===M?void 0:M.stroke)&&void 0!==T?T:void 0,strokeArrayWidth:a,strokeArrayColor:null!==(L=null===(k=null==d?void 0:d.group)||void 0===k?void 0:k.strokeArrayColor)&&void 0!==L?L:void 0,cursor:null!==(E=null===(P=null==d?void 0:d.group)||void 0===P?void 0:P.cursor)&&void 0!==E?E:void 0,lineDash:null!==(F=null===(H=null==d?void 0:d.group)||void 0===H?void 0:H.lineDash)&&void 0!==F?F:void 0,lineCap:"butt",clip:!0,cornerRadius:d.group.cornerRadius})).role="cell",t.col=n,t.row=r,null==e||e.addCellGroup(t))}const z=function(t,e,i,o,n,r){let s,l;const a=r.internalProps.layoutMap.getBody(t,e).sparklineSpec,h=r.getCellValue(t,e);if(!Array.isArray(h))return;const d=n[3],c=n[0];i-=n[1]+n[3];const u=o-=n[0]+n[2];if("function"==typeof a){const n={col:t,row:e,dataValue:r.getCellOriginValue(t,e)||"",value:r.getCellValue(t,e)||"",rect:r.getCellRangeRelativeRect(r.getCellRange(t,e)),table:r};s=a(n),l=VL(s,d,c,i,o)}else s=a,l=VL(a,d,c,i,o);const g=[],p=[];let f,v;if("object"==typeof s.xField)NL.domain(s.xField.domain),f=s.xField.field;else if("string"==typeof s.xField){const t=h.map((t=>t[s.xField]));NL.domain(t),f=s.xField}else Array.isArray(h)&&(NL.domain(Array.from({length:h.length},((t,e)=>e))),f=s.xField);if(NL.range([0,i]),"object"==typeof s.yField)GL.domain(s.yField.domain),v=s.yField.field;else if("string"==typeof s.yField){const t=UL(h,s.yField);GL.domain([Math.min(...t),Math.max(...t)]),v=s.yField}else if(Array.isArray(h)){const t=UL(h);GL.domain([Math.min(...t),Math.max(...t)]),v=s.yField}if(GL.range([0,o]),"object"==typeof s.xField&&Array.isArray(s.xField.domain)){const t=h.map((t=>t[s.xField.field])),e=s.xField.domain;for(let i=0;i<e.length;i++){let o=!1;for(let n=0;n<t.length;n++)if(e[i]===t[n]){const t=h[n];if(!Q(t[f])||!Q(t[v]))break;g.push({x:0+NL.scale(t[f]),y:u-GL.scale(t[v]),defined:Q(t[v])}),p.push(t),o=!0;break}o||(g.push({x:0+NL.scale(e[i]),y:0,defined:!1}),p.push({[f]:e[i],[v]:null}))}}else for(let t=0;t<h.length;t++){const e=h[t];g.push({x:0+NL.scale(f?e[f]:t),y:u-GL.scale(v?e[v]:e),defined:Q(v?e[v]:e),rawData:e}),p.push(e)}const m=l.getChildByName("sparkline-line");m&&m.setAttribute("points",g),m.bandwidth=NL.step(),m.min=GL.range()[0],m.max=GL.range()[1];const b=l.getChildByName("sparkline-symbol-group");if(b){const t="isolatedPoint"===s.pointShowRule;if("all"===s.pointShowRule)for(let t=0;t<g.length;t++){const{x:e,y:i,defined:o}=g[t];if(o){const t=tc({x:e,y:i});b.appendChild(t)}}else if(t)for(let t=0;t<g.length;t++){const{x:e,y:i,defined:o}=g[t];if(o&&(!g[t-1]||!g[t-1].defined)&&(!g[t+1]||!g[t+1].defined)){const t=tc({x:e,y:i});b.appendChild(t)}}}return l}(n,r,s,l,a,h);return z&&t.appendChild(z),t}function VL(t,e,i,o,n){var r,s,l,a,h,d,c,u,g,p,f,v,m,b,y,C,w,x,_,S,A,B;let R;R="function"==typeof t?t(null):t;const M=new zS({x:e,y:i,width:o,height:n,stroke:!1,fill:!1});if(M.name="sparkline","line"===R.type){const t=oc({x:0,y:0,curveType:R.smooth?"monotoneX":"linear",stroke:null!==(l=null===(s=null===(r=R.line)||void 0===r?void 0:r.style)||void 0===s?void 0:s.stroke)&&void 0!==l?l:"blue",lineWidth:null!==(d=null===(h=null===(a=R.line)||void 0===a?void 0:a.style)||void 0===h?void 0:h.strokeWidth)&&void 0!==d?d:2});t.name="sparkline-line",M.addChild(t),R.crosshair&&(t.hover=null!==(u=null===(c=R.crosshair)||void 0===c?void 0:c.style)&&void 0!==u?u:{stroke:"#000",interpolate:"linear"});const e=new zS({x:0,y:0,width:o,height:n,stroke:!1,fill:!1});e.name="sparkline-symbol-group",e.setTheme({symbol:{stroke:null!==(f=null===(p=null===(g=R.point)||void 0===g?void 0:g.style)||void 0===p?void 0:p.stroke)&&void 0!==f?f:"#000",lineWidth:null!==(b=null===(m=null===(v=R.point)||void 0===v?void 0:v.style)||void 0===m?void 0:m.strokeWidth)&&void 0!==b?b:1,fill:null!==(w=null===(C=null===(y=R.point)||void 0===y?void 0:y.style)||void 0===C?void 0:C.fill)&&void 0!==w?w:"#000",size:2*(null!==(S=null===(_=null===(x=R.point)||void 0===x?void 0:x.style)||void 0===_?void 0:_.size)&&void 0!==S?S:3),symbolType:"circle"}}),M.addChild(e),e.hover=null!==(B=null===(A=R.point)||void 0===A?void 0:A.hover)&&void 0!==B&&B}return M}function UL(t,e){const i=[];for(let o=0;o<t.length;o++){const n=t[o];Q(e)&&Q(n[e])?i.push(n[e]):!Q(e)&&Q(n)&&i.push(n)}return i}const $L=FS();function XL(t,e,i,o,n,r,s,l,a,h,d,c,u,g,p,f,v){var m,b,y,C,w,x,_,S,A,B,R,M,T,k,L,P,E,H,F,z,I,O,D,W,N,G,j,V,U,$;const X=WS("padding",g._getCellStyle(o,n),o,n,g);(null===(m=g.options.customConfig)||void 0===m?void 0:m.imageMargin)?h=r_(null===(b=g.options.customConfig)||void 0===b?void 0:b.imageMargin):Q(X)&&(h=X),(null===(y=null==p?void 0:p.text)||void 0===y?void 0:y.textAlign)&&(d=null===(C=null==p?void 0:p.text)||void 0===C?void 0:C.textAlign),(null===(w=null==p?void 0:p.text)||void 0===w?void 0:w.textBaseline)&&(c=null===(x=null==p?void 0:p.text)||void 0===x?void 0:x.textBaseline);const Y=NS(o,n,p,g);let K,q;if(v&&(K=g.scenegraph.highPerformanceGetCell(o,n,!0),K&&"cell"===K.role&&K.setAttributes({x:e,y:i,width:r,height:s,lineWidth:null!==(S=null===(_=null==p?void 0:p.group)||void 0===_?void 0:_.lineWidth)&&void 0!==S?S:void 0,fill:null!==(B=null===(A=null==p?void 0:p.group)||void 0===A?void 0:A.fill)&&void 0!==B?B:void 0,stroke:null!==(M=null===(R=null==p?void 0:p.group)||void 0===R?void 0:R.stroke)&&void 0!==M?M:void 0,strokeArrayWidth:Y,strokeArrayColor:null!==(k=null===(T=null==p?void 0:p.group)||void 0===T?void 0:T.strokeArrayColor)&&void 0!==k?k:void 0,cursor:null!==(P=null===(L=null==p?void 0:p.group)||void 0===L?void 0:L.cursor)&&void 0!==P?P:void 0,lineDash:null!==(H=null===(E=null==p?void 0:p.group)||void 0===E?void 0:E.lineDash)&&void 0!==H?H:void 0,lineCap:"butt",clip:!0,cornerRadius:p.group.cornerRadius})),K&&"cell"===K.role||(K=new zS({x:e,y:i,width:r,height:s,lineWidth:null!==(z=null===(F=null==p?void 0:p.group)||void 0===F?void 0:F.lineWidth)&&void 0!==z?z:void 0,fill:null!==(O=null===(I=null==p?void 0:p.group)||void 0===I?void 0:I.fill)&&void 0!==O?O:void 0,stroke:null!==(W=null===(D=null==p?void 0:p.group)||void 0===D?void 0:D.stroke)&&void 0!==W?W:void 0,strokeArrayWidth:Y,strokeArrayColor:null!==(G=null===(N=null==p?void 0:p.group)||void 0===N?void 0:N.strokeArrayColor)&&void 0!==G?G:void 0,cursor:null!==(V=null===(j=null==p?void 0:p.group)||void 0===j?void 0:j.cursor)&&void 0!==V?V:void 0,lineDash:null!==($=null===(U=null==p?void 0:p.group)||void 0===U?void 0:U.lineDash)&&void 0!==$?$:void 0,lineCap:"butt",clip:!0,cornerRadius:p.group.cornerRadius}),K.role="cell",K.col=o,K.row=n,null==t||t.addCellGroup(K)),u){let t=o,e=n;f&&(t=f.start.col,e=f.start.row),q=g.getCellIcons(t,e)}let Z=0,J=0;if(Array.isArray(q)&&0!==q.length){const{leftIconWidth:t,rightIconWidth:e,absoluteLeftIconWidth:i,absoluteRightIconWidth:o}=KS(q,K,f,g);Z=t,J=e,K.forEachChildren((t=>{"icon-left"===t.role?t.setAttribute("x",t.attribute.x+h[3]):"icon-right"===t.role?t.setAttribute("x",t.attribute.x+r-e-h[1]):"icon-absolute-right"===t.role&&t.setAttribute("x",t.attribute.x+r-o-h[1])})),K.forEachChildren((t=>{"middle"===c?t.setAttribute("y",(s-t.AABBBounds.height())/2):"bottom"===c?t.setAttribute("y",s-t.AABBBounds.height()-h[2]):t.setAttribute("y",h[0])})),K._cellLeftIconWidth=Z,K._cellRightIconWidth=J}const tt=g.getCellValue(o,n),et=document.createElement("video");et.addEventListener("loadeddata",(()=>{a&&JS(o,n,et.videoWidth,et.videoHeight,g.scenegraph,h,K);const{width:t,height:e,isMerge:i}=tA(K,g);if(l){const{width:i,height:o}=IS(et.videoWidth,et.videoHeight,t-h[1]-h[3],e-h[0]-h[2]),n=OS(0,0,t,e,i,o,d,c,h);it.setAttributes({width:i,height:o,x:n.x,y:n.y,dx:0})}else it.setAttributes({x:h[3],y:h[0],width:t-h[1]-h[3],height:e-h[2]-h[0],dy:0});i&&eA(K.mergeStartCol,K.mergeEndCol,K.mergeStartRow,K.mergeEndRow,g);const{width:r,height:s}=tA(K,g),u=Math.floor(Math.min(r-h[1]-h[3],s-h[2]-h[0])/2),p=0+(r>it.attribute.width?it.attribute.x-0+it.attribute.width/2:r/2),f=0+(s>it.attribute.height?it.attribute.y-0+it.attribute.height/2:s/2),v=new U_({x:p-u/2,y:f-u/2,width:u,height:u,image:$L.play.svg,cursor:$L.play.cursor});v.name="play-icon",K.appendChild(v),g.scenegraph.updateNextFrame()})),et.onerror=()=>{it.image=$L.damage_pic.svg},et.src=tt,et.setAttribute("preload","auto");const it=cc({x:h[3],y:h[0],width:r-h[1]-h[3],height:s-h[2]-h[0],image:et,cursor:"pointer"});return it.name="image",it.keepAspectRatio=l,it.textAlign=d,it.textBaseline=c,K.appendChild(it),K}function YL(t,e,i,o,n,r,s,l,a,h,d,c,u,g,p,f,v,m,b){var y,C,w,x,_,S,A,B,R,M,T,k,L,P,E,H,F,z,I,O,D,W,N,G,j,V,U,$,X,Y,K,q;const Z=t._getCellStyle(r,s),J=WS("padding",Z,r,s,t);Q(J)&&(d=J),(null===(y=null==v?void 0:v.text)||void 0===y?void 0:y.textAlign)&&(c=null===(C=null==v?void 0:v.text)||void 0===C?void 0:C.textAlign),(null===(w=null==v?void 0:v.text)||void 0===w?void 0:w.textBaseline)&&(u=null===(x=null==v?void 0:v.text)||void 0===x?void 0:x.textBaseline);const tt=t.isAutoRowHeight(s),et="auto"===l,it=null!==(_=Z.autoWrapText)&&void 0!==_?_:t.internalProps.autoWrapText,ot=Z.lineClamp,nt=NS(r,s,v,t);let rt;if(b&&(rt=t.scenegraph.getCell(r,s,!0),rt&&"cell"===rt.role&&rt.setAttributes({x:o,y:n,width:a,height:h,lineWidth:null!==(A=null===(S=null==v?void 0:v.group)||void 0===S?void 0:S.lineWidth)&&void 0!==A?A:void 0,fill:null!==(R=null===(B=null==v?void 0:v.group)||void 0===B?void 0:B.fill)&&void 0!==R?R:void 0,stroke:null!==(T=null===(M=null==v?void 0:v.group)||void 0===M?void 0:M.stroke)&&void 0!==T?T:void 0,strokeArrayWidth:null!=nt?nt:void 0,strokeArrayColor:null!==(L=null===(k=null==v?void 0:v.group)||void 0===k?void 0:k.strokeArrayColor)&&void 0!==L?L:void 0,cursor:null!==(E=null===(P=null==v?void 0:v.group)||void 0===P?void 0:P.cursor)&&void 0!==E?E:void 0,lineDash:null!==(F=null===(H=null==v?void 0:v.group)||void 0===H?void 0:H.lineDash)&&void 0!==F?F:void 0,lineCap:"butt",clip:!0,cornerRadius:v.group.cornerRadius})),rt&&"cell"===rt.role||(rt=new zS({x:o,y:n,width:a,height:h,lineWidth:null!==(I=null===(z=null==v?void 0:v.group)||void 0===z?void 0:z.lineWidth)&&void 0!==I?I:void 0,fill:null!==(D=null===(O=null==v?void 0:v.group)||void 0===O?void 0:O.fill)&&void 0!==D?D:void 0,stroke:null!==(N=null===(W=null==v?void 0:v.group)||void 0===W?void 0:W.stroke)&&void 0!==N?N:void 0,strokeArrayWidth:null!=nt?nt:void 0,strokeArrayColor:null!==(j=null===(G=null==v?void 0:v.group)||void 0===G?void 0:G.strokeArrayColor)&&void 0!==j?j:void 0,cursor:null!==(U=null===(V=null==v?void 0:v.group)||void 0===V?void 0:V.cursor)&&void 0!==U?U:void 0,lineDash:null!==(X=null===($=null==v?void 0:v.group)||void 0===$?void 0:$.lineDash)&&void 0!==X?X:void 0,lineCap:"butt",clip:!0,cornerRadius:v.group.cornerRadius}),rt.role="cell",rt.col=r,rt.row=s,null==i||i.addCellGroup(rt)),p&&rt.appendChild(p),f){const i=e;let o;if(g){let e=r,i=s;m&&(e=m.start.col,i=m.start.row),o=t.getCellIcons(e,i)}if(function(t,e,i,o,n,r,s,l,a,h,d,c,u,g,p){var f,v,m,b,y,C,w,x,_;let S,A=0,B=0,R=0;if(Array.isArray(e)&&0!==e.length){const{inlineFrontIcons:f,inlineEndIcons:v,contentLeftIcons:m,contentRightIcons:M,leftIconWidth:T,rightIconWidth:k,absoluteRightIconWidth:L}=KS(e,t,p,u);let P;if(A=T,B=k,R=L,0===f.length&&0===v.length){let e=0;at(u.theme._contentOffset)&&("left"===d?e=u.theme._contentOffset:"right"===d&&(e=-u.theme._contentOffset));const c=p?jS(p.start.col,p.start.row,u):jS(t.col,t.row,u),{text:f,moreThanMaxCharacters:v}=VS(i,u),w={text:1===f.length?f[0]:f,moreThanMaxCharacters:v,maxLineWidth:n?1/0:a-(o[1]+o[3])-A-B-c,textBaseline:"top",heightLimit:!1===(null===(b=u.options.customConfig)||void 0===b?void 0:b.limitContentHeight)||r&&!(null===(y=u.options.customConfig)||void 0===y?void 0:y.multilinesForXTable)?-1:h-Math.floor(o[0]+o[2]),pickable:!1,autoWrapText:s,lineClamp:l,wordBreak:"break-word",whiteSpace:!1===(null===(C=u.options.customConfig)||void 0===C?void 0:C.limitContentHeight)||1!==f.length||s?"normal":"no-wrap",dx:("left"===d?m.length?0:c:0)+e},x=new Nh(g.text?Object.assign({},g.text,w):w);x.name="text",P=x}else{const e=Object.assign({text:null==i?void 0:i.toString()},(null===(_=null===(x=null===(w=t.parent)||void 0===w?void 0:w.theme)||void 0===x?void 0:x.userTheme)||void 0===_?void 0:_.text)||{});g.text&&Object.assign(e,g.text),e.textBaseline="middle";const l=[...f.map((t=>$S(t))),e,...v.map((t=>$S(t)))];l[0].textAlign=d;const u=new vc({width:n?0:a-(o[1]+o[3])-A-B,height:r&&s?0:Math.ceil(h-(o[0]+o[2])),textConfig:l,verticalDirection:r&&s?"top":c,ellipsis:e.ellipsis});u.name="text",P=u,u.bindIconEvent(),!p||p.start.col===p.end.col&&p.start.row===p.end.row||(u.onBeforeAttributeUpdate=qS)}if(0!==m.length||0!==M.length){const e=new GS({x:0,y:0,fill:!1,stroke:!1,pickable:!1});e.name="content",e.setCellContentOption({autoWidth:n,autoHeight:r,cellWidth:a-(o[1]+o[3])-A-B,cellHeight:h-(o[0]+o[2]),align:d,baseline:c});const i={addedHierarchyOffset:0};m.forEach((o=>{const n=US(o,void 0,t.col,t.row,p,u,i);n.role="icon-content-left",n.name=o.name,e.addLeftOccupyingIcon(n)})),M.forEach((o=>{const n=US(o,void 0,t.col,t.row,p,u,i);n.role="icon-content-right",n.name=o.name,e.addRightOccupyingIcon(n)})),e.addContent(P),t.appendChild(e),e.layout(),S=e.AABBBounds.width(),e.AABBBounds.height()}else t.firstChild?t.insertBefore(P,t.firstChild):t.appendChild(P),S=P.AABBBounds.width(),P.AABBBounds.height()}else if(Q(i)){const{text:e,moreThanMaxCharacters:b}=VS(i,u),y=p?jS(p.start.col,p.start.row,u):jS(t.col,t.row,u);let C=0;at(u.theme._contentOffset)&&("left"===d?C=u.theme._contentOffset:"right"===d&&(C=-u.theme._contentOffset));const w={text:1===e.length?e[0]:e,moreThanMaxCharacters:b,maxLineWidth:n?1/0:a-(o[1]+o[3]+y),textBaseline:"top",autoWrapText:s,lineClamp:l,wordBreak:"break-word",heightLimit:!1===(null===(f=u.options.customConfig)||void 0===f?void 0:f.limitContentHeight)||r&&!(null===(v=u.options.customConfig)||void 0===v?void 0:v.multilinesForXTable)?-1:h-Math.floor(o[0]+o[2]),pickable:!1,dx:("left"===d?y:0)+C,whiteSpace:!1===(null===(m=u.options.customConfig)||void 0===m?void 0:m.limitContentHeight)||1!==e.length||s?"normal":"no-wrap"},x=new Nh(g.text?Object.assign({},g.text,w):w);x.name="text",x.textBaseline=c,t.appendChild(x),S=x.AABBBounds.width(),x.AABBBounds.height()}const M=n?A+S+B:a-(o[1]+o[3]),T=h-(o[0]+o[2]);t.forEachChildren((t=>{"icon-left"===t.role?t.setAttribute("x",t.attribute.x+o[3]):"icon-right"===t.role?t.setAttribute("x",t.attribute.x+M-B+o[3]):"icon-absolute-right"===t.role?t.setAttribute("x",t.attribute.x+M-R+o[3]+o[1]):"content"!==t.name&&"text"!==t.name||("center"===d&&"richtext"!==t.type?t.setAttribute("x",o[3]+A+(M-A-B)/2):"right"===d&&"richtext"!==t.type?t.setAttribute("x",o[3]+M-B):t.setAttribute("x",o[3]+A))})),t.forEachChildren((t=>{"middle"===c?t.setAttribute("y",o[0]+(T-t.AABBBounds.height())/2):"bottom"===c?t.setAttribute("y",o[0]+T-t.AABBBounds.height()):t.setAttribute("y",o[0])})),t.setAttributes({width:M+o[1]+o[3],height:T+o[0]+o[2]})}(rt,o,i,d,et,tt,it,"number"==typeof ot?ot:void 0,rt.attribute.width,rt.attribute.height,c,u,t,v,m),null===(Y=null==v?void 0:v._vtable)||void 0===Y?void 0:Y.marked){const t=Ac({x:rt.attribute.width,y:0,startAngle:Math.PI/2,endAngle:Math.PI,outerRadius:6,fill:"#3073F2",pickable:!1});t.name="mark",rt.appendChild(t)}}return p&&rt.setAttributes({width:Math.max(rt.attribute.width,null!==(K=p.attribute.width)&&void 0!==K?K:0),height:Math.max(rt.attribute.height,null!==(q=p.attribute.height)&&void 0!==q?q:0)}),rt}function KL(t,e,i,o,n,r,s,l,a,h){var d,c,u,g,p,f;t.dependField&&(n=null!==(c=null===(d=a.getCellOriginRecord(r,s))||void 0===d?void 0:d[t.dependField])&&void 0!==c?c:n),t.barType=null!==(u=t.barType)&&void 0!==u?u:"default",t.min=null!==(g=Hw(t.min,{col:r,row:s,table:a,value:o,dataValue:n,cellHeaderPaths:void 0}))&&void 0!==g?g:0,t.max=null!==(p=Hw(t.max,{col:r,row:s,table:a,value:o,dataValue:n,cellHeaderPaths:void 0}))&&void 0!==p?p:t.min+100;let v=0;v=h?a.getRowsHeight(h.start.row,h.end.row):a.getRowHeight(s);let m=i,b=v,y=0;at(a.theme._contentOffset)&&(y=a.theme._contentOffset);const C=new zS({x:-y,y:-y,width:m,height:b});C.name="progress-bar";const{showBar:w,barColor:x,barBgColor:_,barPositiveColor:S,barNegativeColor:A,barAxisColor:B,barRightToLeft:R,showBarMark:M,barMarkPositiveColor:T,barMarkNegativeColor:k,barMarkWidth:L,barMarkPosition:P}=e;let{barHeight:E,barBottom:H,barPadding:F}=e;1===F.length?F=[F[0],F[0],F[0],F[0]]:2===F.length?F=[F[0],F[1],F[0],F[1]]:3===F.length&&(F=[F[0],F[1],F[2],F[1]]),F=F.map(((t,e)=>{if("string"==typeof t&&jw.endsWith(t,"%")){const o=Number(t.substr(0,t.length-1));return 0===e||2===e?v*o/100:i*o/100}return Number(t)}));const z=r_(DS("borderLineWidth",e,r,s,a)),I=Math.max(F[0],Math.ceil(z[0]/2)),O=Math.max(F[1],Math.floor(z[1]/2)),D=Math.max(F[2],Math.floor(z[2]/2)),W=Math.max(F[3],Math.ceil(z[3]/2));m-=O+W,b-=D+I,s===a.rowCount-1&&[0,"0"].includes(H)&&(b-=1);const N=I,G=W,j=m;if("string"==typeof E&&jw.endsWith(E,"%")?(E=Number(E.substr(0,E.length-1)),E=b*E/100):E=Number(E),"string"==typeof H&&jw.endsWith(H,"%")?(H=Number(H.substr(0,H.length-1)),H=b*H/100):H=Number(H),Hw(w,{col:r,row:s,table:a,context:null,value:o,dataValue:n})){let e=`${n}`;jw.endsWith(e,"%")&&(e=e.substr(0,e.length-1));const i=Number(e);if(isNaN(i))return C;if("default"===(null!==(f=t.barType)&&void 0!==f?f:"default")){const e=i<t.min?0:i>t.max?1:(i-t.min)/(t.max-t.min),l=m,h=N+b-E-H;let d=Math.min(l*e,l);const c=R?G+j-d:G;r!==a.colCount-1||1!==e||R||(d-=1);const u=Hw(_,{col:r,row:s,table:a,context:null,value:o,dataValue:n,percentile:e});if(u){const t=sc({x:c,y:h,width:l,height:E,fill:u});C.addChild(t)}const g=sc({x:c,y:h,width:d,height:E,fill:Hw(x,{col:r,row:s,table:a,context:null,value:o,dataValue:n,percentile:e})||"#20a8d8"});C.addChild(g)}else if("negative"===t.barType){const e=t.min<0?-t.min:0,l=t.max>0?t.max:0,h=e/(e+l),d=1-h,c=i>0?i/l:0,u=i<0?-i/e:0,g=m,p=N+b-E-H,f=G,y=Hw(_,{col:r,row:s,table:a,context:null,value:o,dataValue:n,percentile:c});if(y){const t=sc({x:f,y:p,width:g,height:E,fill:y});C.addChild(t)}const w=R?d*g:h*g,x=Math.min(g*h*u,g),F=R?{left:f+w,top:p,width:x,height:E}:{left:f+w-x,top:p,width:x,height:E},z=Hw(A,{col:r,row:s,table:a,context:null,value:o,dataValue:n,percentile:u})||"#20a8d8",I=sc({x:F.left,y:F.top,width:F.width,height:F.height,fill:z});C.addChild(I);let O=Math.min(g*d*c,g);r!==a.colCount-1||1!==c||R||(O-=1);const D=R?{left:f+w-O,top:p,width:O,height:E}:{left:f+w,top:p,width:O,height:E},W=Hw(S,{col:r,row:s,table:a,context:null,value:o,dataValue:n,percentile:c})||"#20a8d8",j=sc({x:D.left,y:D.top,width:D.width,height:D.height,fill:W});C.addChild(j);const V=R?F.left:D.left,U=oc({x:0,y:0,stroke:Hw(B,{col:r,row:s,table:a,context:null,value:o,dataValue:n,percentile:c}),lineWidth:1,lineDash:[2,2],points:[{x:V,y:0},{x:V,y:v}]});if(C.addChild(U),M&&(c||u)){const t=L,e=[];let i;if(c>0)if(i=Hw(T,{col:r,row:s,table:a,context:null,value:o,dataValue:n,percentile:c})||"#20a8d8","right"===P){const t=R?D.left+L/2:D.left+D.width-L/2;e.push({x:t,y:D.top}),e.push({x:t,y:D.top+D.height})}else"bottom"===P&&(e.push({x:D.left,y:D.top+D.height-L/2}),e.push({x:D.left+D.width,y:D.top+D.height-L/2}));else if(u>0)if(i=Hw(k,{col:r,row:s,table:a,context:null,value:o,dataValue:n,percentile:u})||"#20a8d8","right"===P){const t=R?F.left+F.width-L/2:F.left+L/2;e.push({x:t,y:F.top}),e.push({x:t,y:F.top+F.height})}else"bottom"===P&&(e.push({x:F.left,y:F.top+F.height-L/2}),e.push({x:F.left+F.width,y:F.top+F.height-L/2}));const l=oc({x:0,y:0,stroke:i,lineWidth:t,points:e});C.addChild(l)}}else if("negative_no_axis"===t.barType){const e=t.min<0?-t.min:0,l=t.max>0?t.max:0,h=Math.max(e,l),d=0===h?0:Math.abs(i)/h,c=m;let u=Math.min(c*d,c);r!==a.colCount-1||1!==d||R||(u-=1);const g=N+b-E-H,p=R?G+j-u:G,f=Hw(_,{col:r,row:s,table:a,context:null,value:o,dataValue:n,percentile:d});if(f){const t=sc({x:p,y:g,width:c,height:E,fill:f});C.addChild(t)}const v={left:p,top:g,width:u,height:E};let y;y=i>=0?Hw(S,{col:r,row:s,table:a,context:null,value:o,percentile:d,dataValue:n})||"#20a8d8":Hw(A,{col:r,row:s,table:a,context:null,value:o,dataValue:n,percentile:d})||"#20a8d8";const w=sc({x:v.left,y:v.top,width:v.width,height:v.height,fill:y});if(C.addChild(w),M&&i){const t=L,e=[];let l;if(l=i>=0?Hw(T,{col:r,row:s,table:a,context:null,value:o,dataValue:n,percentile:d})||"#20a8d8":Hw(k,{col:r,row:s,table:a,context:null,value:o,dataValue:n,percentile:d})||"#20a8d8","right"===P){const t=R?v.left+L/2:v.left+v.width-L/2;e.push({x:t,y:v.top}),e.push({x:t,y:v.top+v.height})}else"bottom"===P&&(e.push({x:v.left,y:v.top+v.height-L/2}),e.push({x:v.left+v.width,y:v.top+v.height-L/2}));const h=oc({x:0,y:0,stroke:l,lineWidth:t,points:e});C.addChild(h)}}}return C}function qL(t,e,i,o,n,r){var s,l,a,h,d,c,u,g,p;if((null==i?void 0:i.zero)&&(t=Math.min(t,0),e=Math.max(e,0)),null==i?void 0:i.expand){const o=t,n=e;Q(i.expand.min)&&(t=o-(n-o)*i.expand.min),Q(i.expand.max)&&(e=n+(n-o)*i.expand.max)}let f,v;if(at(null==i?void 0:i.min)&&(t=i.min),at(null==i?void 0:i.max)&&(e=i.max),"log"===(null==i?void 0:i.type)?(f=new by,f.base(null!==(s=null==i?void 0:i.base)&&void 0!==s?s:10)):"symlog"===(null==i?void 0:i.type)?(f=new yy,f.constant(null!==(l=null==i?void 0:i.constant)&&void 0!==l?l:10)):f=new py,f.domain([t,e],!!(null==i?void 0:i.nice)),null==i?void 0:i.nice){let t=null!==(c=null!==(h=null===(a=i.tick)||void 0===a?void 0:a.forceTickCount)&&void 0!==h?h:null===(d=i.tick)||void 0===d?void 0:d.tickCount)&&void 0!==c?c:10;Z(t)&&(t=t({axisLength:n,labelStyle:null!==(g=null===(u=null==i?void 0:i.label)||void 0===u?void 0:u.style)&&void 0!==g?g:{fontSize:Ek}})),"accurateFirst"===i.niceType&&(t=Math.max(10,t)),J(i.min)&&J(i.max)?f.nice(t):Q(i.min)&&J(i.max)?f.niceMax(t):J(i.min)&&Q(i.max)&&f.niceMin(t)}return delete f._niceType,r||(v=f.ticks(at(null==i?void 0:i.tickCount)?null==i?void 0:i.tickCount:5,{noDecimals:null===(p=null==i?void 0:i.tick)||void 0===p?void 0:p.noDecimals})),{range:f.domain(),ticks:v}}Tx.registerComponent("axis",Zk),Tx.registerFunction("computeAxisComponentWidth",Jk),Tx.registerFunction("computeAxisComponentHeight",Qk),Tx.registerFunction("getAxisConfigInPivotChart",tk),Tx.registerComponent("emptyTip",iL),Tx.registerFunction("createLegend",cL),Tx.registerComponent("menuHandler",CL),Tx.registerComponent("title",wL),Tx.registerComponent("tooltipHandler",LL),Tx.registerComponent("listTreeStickCellPlugin",PL),Tx.registerFunction("createChartCellGroup",IL),Tx.registerFunction("getAxisDomainRangeAndLabels",qL),Tx.registerFunction("createCheckboxCellGroup",OL),Tx.registerFunction("createImageCellGroup",ZS),Tx.registerFunction("createProgressBarCell",KL),Tx.registerFunction("createRadioCellGroup",DL),Tx.registerFunction("createSparkLineCellGroup",jL),Tx.registerFunction("createTextCellGroup",YL),Tx.registerFunction("createVideoCellGroup",XL);class ZL extends Gk{}class JL extends fs{constructor(t){var e,i,o,n,r,s,l,a,h,d,c,u,g,p;t.direction&&(t.flexDirection=t.direction),!t.justifyContent||"start"!==t.justifyContent&&"end"!==t.justifyContent||(t.justifyContent="flex-"+t.justifyContent),!t.alignItems||"start"!==t.alignItems&&"end"!==t.alignItems||(t.alignItems="flex-"+t.alignItems),!t.alignContent||"start"!==t.alignContent&&"end"!==t.alignContent||(t.alignContent="flex-"+t.alignContent),t.display="flex",t.flexDirection||(t.flexDirection="row"),t.clip=!0,t.fill=null===(e=null==t?void 0:t.background)||void 0===e?void 0:e.fill,t.stroke=null===(i=null==t?void 0:t.background)||void 0===i?void 0:i.stroke,t.lineWidth=null===(o=null==t?void 0:t.background)||void 0===o?void 0:o.lineWidth,t.cornerRadius=null===(n=null==t?void 0:t.background)||void 0===n?void 0:n.cornerRadius;const f=rt(t.boundsPadding),v=[null!==(s=null!==(r=t.marginTop)&&void 0!==r?r:f?t.boundsPadding[0]:t.boundsPadding)&&void 0!==s?s:0,null!==(a=null!==(l=t.marginRight)&&void 0!==l?l:f?t.boundsPadding[1]:t.boundsPadding)&&void 0!==a?a:0,null!==(c=null!==(h=t.marginBottom)&&void 0!==h?h:f?null!==(d=t.boundsPadding[2])&&void 0!==d?d:t.boundsPadding[0]:t.boundsPadding)&&void 0!==c?c:0,null!==(p=null!==(u=t.marginLeft)&&void 0!==u?u:f?null!==(g=t.boundsPadding[3])&&void 0!==g?g:t.boundsPadding[1]:t.boundsPadding)&&void 0!==p?p:0];t.boundsPadding=v,super(t)}}var QL=Object.freeze({__proto__:null,Arc:class extends Sc{constructor(t){var e,i,o,n,r,s,l,a,h,d;const c=rt(t.boundsPadding),u=[null!==(i=null!==(e=t.marginTop)&&void 0!==e?e:c?t.boundsPadding[0]:t.boundsPadding)&&void 0!==i?i:0,null!==(n=null!==(o=t.marginRight)&&void 0!==o?o:c?t.boundsPadding[1]:t.boundsPadding)&&void 0!==n?n:0,null!==(l=null!==(r=t.marginBottom)&&void 0!==r?r:c?null!==(s=t.boundsPadding[2])&&void 0!==s?s:t.boundsPadding[0]:t.boundsPadding)&&void 0!==l?l:0,null!==(d=null!==(a=t.marginLeft)&&void 0!==a?a:c?null!==(h=t.boundsPadding[3])&&void 0!==h?h:t.boundsPadding[1]:t.boundsPadding)&&void 0!==d?d:0];t.boundsPadding=u,super(t)}},CheckBox:Qy,Circle:class extends Ih{constructor(t){var e,i,o,n,r,s,l,a,h,d;const c=rt(t.boundsPadding),u=[null!==(i=null!==(e=t.marginTop)&&void 0!==e?e:c?t.boundsPadding[0]:t.boundsPadding)&&void 0!==i?i:0,null!==(n=null!==(o=t.marginRight)&&void 0!==o?o:c?t.boundsPadding[1]:t.boundsPadding)&&void 0!==n?n:0,null!==(l=null!==(r=t.marginBottom)&&void 0!==r?r:c?null!==(s=t.boundsPadding[2])&&void 0!==s?s:t.boundsPadding[0]:t.boundsPadding)&&void 0!==l?l:0,null!==(d=null!==(a=t.marginLeft)&&void 0!==a?a:c?null!==(h=t.boundsPadding[3])&&void 0!==h?h:t.boundsPadding[1]:t.boundsPadding)&&void 0!==d?d:0];t.boundsPadding=u,super(t)}},Container:JL,Group:class extends fs{constructor(t){var e,i,o,n,r,s,l,a,h,d;const c=rt(t.boundsPadding),u=[null!==(i=null!==(e=t.marginTop)&&void 0!==e?e:c?t.boundsPadding[0]:t.boundsPadding)&&void 0!==i?i:0,null!==(n=null!==(o=t.marginRight)&&void 0!==o?o:c?t.boundsPadding[1]:t.boundsPadding)&&void 0!==n?n:0,null!==(l=null!==(r=t.marginBottom)&&void 0!==r?r:c?null!==(s=t.boundsPadding[2])&&void 0!==s?s:t.boundsPadding[0]:t.boundsPadding)&&void 0!==l?l:0,null!==(d=null!==(a=t.marginLeft)&&void 0!==a?a:c?null!==(h=t.boundsPadding[3])&&void 0!==h?h:t.boundsPadding[1]:t.boundsPadding)&&void 0!==d?d:0];t.boundsPadding=u,super(t)}},GroupElement:class extends JL{constructor(t){t.flexWrap="nowrap",super(t)}},Icon:class extends dc{constructor(t){var e,i,o,n,r,s,l,a,h,d,c,u;let g;nt(t.iconName)&&(g=FS()[t.iconName],g&&(t.width=null!==(e=t.width)&&void 0!==e?e:g.width,t.height=null!==(i=t.height)&&void 0!==i?i:g.height,t.svg=g.svg,t.cursor=g.cursor)),t.svg&&(t.image=t.svg);const p=rt(t.boundsPadding),f=[null!==(n=null!==(o=t.marginTop)&&void 0!==o?o:p?t.boundsPadding[0]:t.boundsPadding)&&void 0!==n?n:0,null!==(s=null!==(r=t.marginRight)&&void 0!==r?r:p?t.boundsPadding[1]:t.boundsPadding)&&void 0!==s?s:0,null!==(h=null!==(l=t.marginBottom)&&void 0!==l?l:p?null!==(a=t.boundsPadding[2])&&void 0!==a?a:t.boundsPadding[0]:t.boundsPadding)&&void 0!==h?h:0,null!==(u=null!==(d=t.marginLeft)&&void 0!==d?d:p?null!==(c=t.boundsPadding[3])&&void 0!==c?c:t.boundsPadding[1]:t.boundsPadding)&&void 0!==u?u:0];t.boundsPadding=f,super(t),this.cache=g}},Image:class extends dc{constructor(t){var e,i,o,n,r,s,l,a,h,d;t.src&&(t.image=t.src),"circle"===t.shape&&(t.cornerRadius=t.width/2);const c=rt(t.boundsPadding),u=[null!==(i=null!==(e=t.marginTop)&&void 0!==e?e:c?t.boundsPadding[0]:t.boundsPadding)&&void 0!==i?i:0,null!==(n=null!==(o=t.marginRight)&&void 0!==o?o:c?t.boundsPadding[1]:t.boundsPadding)&&void 0!==n?n:0,null!==(l=null!==(r=t.marginBottom)&&void 0!==r?r:c?null!==(s=t.boundsPadding[2])&&void 0!==s?s:t.boundsPadding[0]:t.boundsPadding)&&void 0!==l?l:0,null!==(d=null!==(a=t.marginLeft)&&void 0!==a?a:c?null!==(h=t.boundsPadding[3])&&void 0!==h?h:t.boundsPadding[1]:t.boundsPadding)&&void 0!==d?d:0];t.boundsPadding=u,super(t)}},Line:ic,Radio:tC,Rect:class extends rc{constructor(t){var e,i,o,n,r,s,l,a,h,d;const c=rt(t.boundsPadding),u=[null!==(i=null!==(e=t.marginTop)&&void 0!==e?e:c?t.boundsPadding[0]:t.boundsPadding)&&void 0!==i?i:0,null!==(n=null!==(o=t.marginRight)&&void 0!==o?o:c?t.boundsPadding[1]:t.boundsPadding)&&void 0!==n?n:0,null!==(l=null!==(r=t.marginBottom)&&void 0!==r?r:c?null!==(s=t.boundsPadding[2])&&void 0!==s?s:t.boundsPadding[0]:t.boundsPadding)&&void 0!==l?l:0,null!==(d=null!==(a=t.marginLeft)&&void 0!==a?a:c?null!==(h=t.boundsPadding[3])&&void 0!==h?h:t.boundsPadding[1]:t.boundsPadding)&&void 0!==d?d:0];t.boundsPadding=u,super(t)}},Tag:class extends Im{constructor(t){var e,i,o,n,r,s,l,a,h,d;const c=rt(t.boundsPadding),u=[null!==(i=null!==(e=t.marginTop)&&void 0!==e?e:c?t.boundsPadding[0]:t.boundsPadding)&&void 0!==i?i:0,null!==(n=null!==(o=t.marginRight)&&void 0!==o?o:c?t.boundsPadding[1]:t.boundsPadding)&&void 0!==n?n:0,null!==(l=null!==(r=t.marginBottom)&&void 0!==r?r:c?null!==(s=t.boundsPadding[2])&&void 0!==s?s:t.boundsPadding[0]:t.boundsPadding)&&void 0!==l?l:0,null!==(d=null!==(a=t.marginLeft)&&void 0!==a?a:c?null!==(h=t.boundsPadding[3])&&void 0!==h?h:t.boundsPadding[1]:t.boundsPadding)&&void 0!==d?d:0];t.boundsPadding=u,super(t)}getSize(t){this.AABBBounds.width()}},Text:class extends Nh{constructor(t){var e,i,o,n,r,s,l,a,h,d,c;t.textBaseline||(t.textBaseline="top");const u=rt(t.boundsPadding),g=[null!==(i=null!==(e=t.marginTop)&&void 0!==e?e:u?t.boundsPadding[0]:t.boundsPadding)&&void 0!==i?i:0,null!==(n=null!==(o=t.marginRight)&&void 0!==o?o:u?t.boundsPadding[1]:t.boundsPadding)&&void 0!==n?n:0,null!==(l=null!==(r=t.marginBottom)&&void 0!==r?r:u?null!==(s=t.boundsPadding[2])&&void 0!==s?s:t.boundsPadding[0]:t.boundsPadding)&&void 0!==l?l:0,null!==(d=null!==(a=t.marginLeft)&&void 0!==a?a:u?null!==(h=t.boundsPadding[3])&&void 0!==h?h:t.boundsPadding[1]:t.boundsPadding)&&void 0!==d?d:0];t.boundsPadding=g,t.fill=null!==(c=t.fill)&&void 0!==c?c:"#000",super(t)}getSize(t){this.AABBBounds.width()}},percentCalc:function(t){return{percent:t,delta:arguments.length>1&&void 0!==arguments[1]?arguments[1]:0}}});oC();const tP=(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 eP(t,e,i){let o,n,r,s,l,a,h=0,d=!1,c=!1,u=!0;const g=!e&&0!==e&&"function"==typeof requestAnimationFrame;if("function"!=typeof t)throw new TypeError("Expected a function");function p(e){const i=o,r=n;return n=void 0,o=void 0,h=e,s=t.apply(r,i),s}function f(t,e){return g?requestAnimationFrame(t):setTimeout(t,e)}function v(t){const i=t-a;return void 0===a||i>=e||i<0||d&&t-h>=r}function m(){const t=Date.now();if(v(t))return function(t){return l=void 0,u&&o?p(t):(n=void 0,o=void 0,s)}(t);l=f(m,function(t){const i=t-h,o=e&&-(t-a);return d?Math.min(o,r-i):o}(t))}return e=+e||0,tP(i,"object")&&(c=!!i.leading,d="maxWait"in i,d&&(r=Math.max(+i.maxWait||0,e)),u="trailing"in i?!!i.trailing:u),function(...t){const i=Date.now(),r=v(i);if(o=t,n=this,a=i,r){if(void 0===l)return function(t){return h=t,l=f(m,e),c?p(t):s}(a);if(d)return l=f(m,e),p(a)}return void 0===l&&(l=f(m,e)),s}}let iP=1;class oP{resizeTime=100;element;cb;observer;lastSize={width:0,height:0};callBackDebounce;constructor(t,e,i){if(this.element=t,this.cb=e,this.lastSize=this.getSize(),i&&(this.resizeTime=Math.max(i,16)),this.callBackDebounce=eP(this.callBack,this.resizeTime),window?.addEventListener("resize",this.onResize),"ResizeObserver"in window){const t=window.ResizeObserver;this.observer=new t(this.mutationResize),this.observer?.observe(this.element)}else"MutationObserver"in window&&(this.observer=new MutationObserver(this.mutationResize),this.observer.observe(this.element,{attributes:!0,attributeFilter:["style"]}))}mutationResize=()=>{this.onResize()};disConnect(){window.removeEventListener("resize",this.onResize),this.observer&&(this.observer.disconnect(),this.observer=void 0)}callBack=()=>{const t=this.getSize();let e=!1;t.width===this.lastSize.width&&t.height===this.lastSize.height&&(e=!0),this.lastSize=t,this.cb&&this.cb({...this.lastSize,windowSizeNotChange:e})};setSize(t){this.lastSize=t}onResize=()=>{this.callBackDebounce()};checkSize(){const t=this.getSize();return t.width!==this.lastSize.width||t.height!==this.lastSize.height}getSize(){return this.element?{width:Math.floor(this.element.clientWidth),height:Math.floor(this.element.clientHeight)}:{...this.lastSize}}}class nP{resizeTime;listeners={};reseizeListeners={};on(t,e,i,...o){if("node"===rC.mode)return-1;const n=iP++;if(t?.addEventListener)if("resize"!==e||t===window)t?.addEventListener(e,i,...o);else{const e=new oP(t,i,this.resizeTime);this.reseizeListeners[n]=e}const r={target:t,type:e,listener:i,options:o};return this.listeners[n]=r,n}once(t,e,i,...o){if("node"===rC.mode)return-1;const n=this.on(t,e,((...t)=>{this.off(n),i(...t)}),...o);return n}off(t){if("node"===rC.mode)return;if(null==t)return;const e=this.listeners?.[t];e&&(delete this.listeners[t],e.target.removeEventListener&&e.target.removeEventListener(e.type,e.listener,...e.options))}fire(t,e,...i){if("node"!==rC.mode)for(const o in this.listeners){const n=this.listeners[o];n.target===t&&n.type===e&&n.listener.call(n.target,...i)}}hasListener(t,e){if("node"===rC.mode)return!1;let i=!1;for(const o in this.listeners){const n=this.listeners[o];n.target===t&&n.type===e&&(i=!0)}return i}clear(){if("node"!==rC.mode){for(const t in this.listeners){const e=this.listeners[t];e.target.removeEventListener&&e.target.removeEventListener(e.type,e.listener,...e.options)}for(const t in this.reseizeListeners){const e=this.reseizeListeners[t];e?.disConnect()}this.listeners={}}}release(){"node"!==rC.mode&&(this.clear(),this.listeners={})}}let rP=1;function sP(){return mC?rP=1:(rP=Math.ceil(window.devicePixelRatio||1),rP>1&&rP%2!=0&&(rP+=1)),rP}sP();class lP{_gantt;_eventHandler;isDown=!1;isDraging=!1;lastDragPointerXYOnWindow;globalEventListeners=[];poniterState;constructor(t){this._gantt=t,this._eventHandler=new nP,this.bindEvent()}release(){this._eventHandler.release(),this.globalEventListeners.forEach((t=>{"document"===t.env?document.removeEventListener(t.name,t.callback):"body"===t.env?document.body.removeEventListener(t.name,t.callback):"window"===t.env&&window.removeEventListener(t.name,t.callback)})),this.globalEventListeners=[]}bindEvent(){!function(t){const i=t._gantt.scenegraph,n=t._gantt,r=n.stateManager;i.tableGroup.addEventListener("pointerdown",(t=>{if(0!==t.button)return;let i,o,s;t.detailPath.find((t=>"task-bar"===t.name?(i=t,!0):"task-creation-button"===t.name||("task-bar-link-point-left"===t.name?(o=t,!0):"task-bar-link-point-right"===t.name?(s=t,!0):!!t.attribute.vtable_link&&(t.attribute.vtable_link,!0)))),i?"task-bar-hover-shadow-left-icon"===t.target.name?(r.startResizeTaskBar(i,t.nativeEvent.x,t.nativeEvent.y,t.offset.y,"left"),r.updateInteractionState(e.grabing)):"task-bar-hover-shadow-right-icon"===t.target.name?(r.startResizeTaskBar(i,t.nativeEvent.x,t.nativeEvent.y,t.offset.y,"right"),r.updateInteractionState(e.grabing)):n.parsedOptions.taskBarMoveable&&(r.startMoveTaskBar(i,t.nativeEvent.x,t.nativeEvent.y,t.offset.y),r.updateInteractionState(e.grabing)):o?(r.startCreateDependencyLine(o,t.nativeEvent.x,t.nativeEvent.y,t.offset.y,"left"),r.updateInteractionState(e.grabing)):s&&(r.startCreateDependencyLine(s,t.nativeEvent.x,t.nativeEvent.y,t.offset.y,"right"),r.updateInteractionState(e.grabing))})),i.tableGroup.addEventListener("pointermove",(t=>{if(r.interactionState===e.default){const e=t.detailPath.find((t=>"task-bar"===t.name));if(e){if(i._gantt.stateManager.hoverTaskBar.target!==e&&(i._gantt.stateManager.hoverTaskBar.target=e,r.showTaskBarHover(),i._gantt.hasListeners(o.MOUSEENTER_TASK_BAR))){const e=yC(t.offset.y,i._gantt),n=i._gantt.getRecordByIndex(e);i._gantt.fireListeners(o.MOUSEENTER_TASK_BAR,{event:t.nativeEvent,index:e,record:n})}}else{if(i._gantt.stateManager.hoverTaskBar.target&&(r.hideTaskBarHover(t),i._gantt.hasListeners(o.MOUSELEAVE_TASK_BAR))){const e=yC(t.offset.y,i._gantt),n=i._gantt.getRecordByIndex(e);i._gantt.fireListeners(o.MOUSELEAVE_TASK_BAR,{event:t.nativeEvent,index:e,record:n})}if(n.parsedOptions.taskBarCreatable){const e=yC(t.offset.y,n),i=n.getTaskInfoByTaskListIndex(e);if(!i.taskDays&&i.taskRecord){const o=function(t,e){const i=t+e.stateManager.scroll.horizontalBarPos;return Math.floor(i/e.parsedOptions.timelineColWidth)}(t.offset.x,n),r=o*n.parsedOptions.timelineColWidth-n.stateManager.scroll.horizontalBarPos,s=e*n.parsedOptions.rowHeight-n.stateManager.scroll.verticalBarPos;return void n.scenegraph.showTaskCreationButton(r,s,e,i.taskRecord)}}}n.scenegraph.hideTaskCreationButton()}else if(r.interactionState===e.grabing){let e,o,n;t.detailPath.find((t=>"task-bar"===t.name?(e=t,!0):"task-creation-button"===t.name||("task-bar-link-point-left"===t.name?(o=t,!0):"task-bar-link-point-right"===t.name?(n=t,!0):!!t.attribute.vtable_link&&(t.attribute.vtable_link,!0)))),e=e??o?.parent?.attribute.attachedToTaskBarNode??n?.parent?.attribute.attachedToTaskBarNode,i._gantt.stateManager.isCreatingDependencyLine()&&!e?r.hideSecondTaskBarSelectedBorder():i._gantt.stateManager.isCreatingDependencyLine()&&o&&i._gantt.stateManager.selectedTaskBar.target!==e?(r.highlightLinkPointNode(o),r.creatingDenpendencyLink.lastHighLightLinkPoint=o,r.creatingDenpendencyLink.secondTaskBarPosition="left"):i._gantt.stateManager.isCreatingDependencyLine()&&n&&i._gantt.stateManager.selectedTaskBar.target!==e?(r.highlightLinkPointNode(n),r.creatingDenpendencyLink.lastHighLightLinkPoint=n,r.creatingDenpendencyLink.secondTaskBarPosition="right"):i._gantt.stateManager.isCreatingDependencyLine()&&e&&i._gantt.stateManager.selectedTaskBar.target!==e&&(r.unhighlightLinkPointNode(r.creatingDenpendencyLink.lastHighLightLinkPoint),r.creatingDenpendencyLink.secondTaskBarNode&&r.creatingDenpendencyLink.secondTaskBarNode===e||(r.creatingDenpendencyLink.secondTaskBarNode&&r.creatingDenpendencyLink.secondTaskBarNode!==e&&r.hideSecondTaskBarSelectedBorder(),r.creatingDenpendencyLink.secondTaskBarNode=e,r.showSecondTaskBarSelectedBorder()))}})),i.tableGroup.addEventListener("pointerup",(e=>{let s,l=!1,a=!1,h=!1,d=!1,c=!1;const u=e.detailPath.find((t=>"task-bar"===t.name?(l=!0,!0):"task-creation-button"===t.name?(a=!0,!1):"task-bar-link-point-left"===t.name?(d=!0,!1):"task-bar-link-point-right"===t.name?(c=!0,!1):!!t.attribute.vtable_link&&(h=!0,s=t.attribute.vtable_link,!1)));if(l&&i._gantt.parsedOptions.taskBarSelectable&&"down"===t.poniterState){if(r.hideDependencyLinkSelectedLine(),i._gantt.stateManager.selectedTaskBar.target=u,r.showTaskBarSelectedBorder(),n.hasListeners(o.CLICK_TASK_BAR)){const t=yC(e.offset.y,n),i=n.getRecordByIndex(t);n.fireListeners(o.CLICK_TASK_BAR,{event:e.nativeEvent,index:t,record:i})}}else if(a&&"down"===t.poniterState){r.hideDependencyLinkSelectedLine(),r.hideTaskBarSelectedBorder();const t=yC(e.offset.y,n),i=n.getTaskInfoByTaskListIndex(t);if(i.taskRecord){const r=n.parsedOptions.dateFormat??"yyyy-mm-dd";i.taskRecord[n.parsedOptions.startDateField]=i.taskRecord[n.parsedOptions.endDateField]=aC(new Date(n.parsedOptions._minDateTime+Math.floor((e.offset.x+n.stateManager.scroll.horizontalBarPos)/n.parsedOptions.colWidthPerDay)*bC),r),n.scenegraph.hideTaskCreationButton(),n.updateTaskRecord(i.taskRecord,t),n.hasListeners(o.CREATE_TASK_SCHEDULE)&&n.fireListeners(o.CREATE_TASK_SCHEDULE,{event:e.nativeEvent,index:t,startDate:i.taskRecord[n.parsedOptions.startDateField],endDate:i.taskRecord[n.parsedOptions.endDateField],record:i.taskRecord})}}else if(h&&i._gantt.parsedOptions.dependencyLinkSelectable&&"down"===t.poniterState)r.hideDependencyLinkSelectedLine(),r.hideTaskBarSelectedBorder(),i._gantt.stateManager.selectedDenpendencyLink.link=s,r.showDependencyLinkSelectedLine();else if(d&&"draging"===t.poniterState){if(r.isCreatingDependencyLine()){const t=r.endCreateDependencyLine(e.offset.y);n.hasListeners(o.CREATE_DEPENDENCY_LINK)&&n.fireListeners(o.CREATE_DEPENDENCY_LINK,{event:e.nativeEvent,link:t})}}else if(c&&"draging"===t.poniterState){if(r.isCreatingDependencyLine()){const t=r.endCreateDependencyLine(e.offset.y);n.hasListeners(o.CREATE_DEPENDENCY_LINK)&&n.fireListeners(o.CREATE_DEPENDENCY_LINK,{event:e.nativeEvent,link:t})}}else r.hideDependencyLinkSelectedLine(),r.hideTaskBarSelectedBorder()})),i.tableGroup.addEventListener("pointerenter",(t=>{(n.parsedOptions.scrollStyle.horizontalVisible&&"focus"===n.parsedOptions.scrollStyle.horizontalVisible||!n.parsedOptions.scrollStyle.horizontalVisible&&"focus"===n.parsedOptions.scrollStyle.visible)&&i.scrollbarComponent.showHorizontalScrollBar(),(n.parsedOptions.scrollStyle.verticalVisible&&"focus"===n.parsedOptions.scrollStyle.verticalVisible||!n.parsedOptions.scrollStyle.verticalVisible&&"focus"===n.parsedOptions.scrollStyle.visible)&&i.scrollbarComponent.showVerticalScrollBar()})),i.tableGroup.addEventListener("pointerleave",(t=>{(n.parsedOptions.scrollStyle.horizontalVisible&&"focus"===n.parsedOptions.scrollStyle.horizontalVisible||!n.parsedOptions.scrollStyle.horizontalVisible&&"focus"===n.parsedOptions.scrollStyle.visible)&&i.scrollbarComponent.hideHorizontalScrollBar(),(n.parsedOptions.scrollStyle.verticalVisible&&"focus"===n.parsedOptions.scrollStyle.verticalVisible||!n.parsedOptions.scrollStyle.verticalVisible&&"focus"===n.parsedOptions.scrollStyle.visible)&&i.scrollbarComponent.hideVerticalScrollBar()}))}(this),function(t){const i=t._gantt;t._gantt.scenegraph;const o=i.stateManager,n=t._eventHandler;n.on(i.getElement(),"wheel",(e=>{vC(e,o,t._gantt)})),n.on(i.getContainer(),"resize",(t=>{0===t.width&&0===t.height||(Q(i.options.pixelRatio)||i.setPixelRatio(sP()),t.windowSizeNotChange||i._resize())})),i.taskListTableInstance&&i.parsedOptions.verticalSplitLineMoveable&&n.on(i.verticalSplitResizeLine,"mousedown",(t=>{o.updateInteractionState(e.grabing),o.startResizeTableWidth(t)}));i.parsedOptions.verticalSplitLineHighlight&&(i.verticalSplitResizeLine&&n.on(i.verticalSplitResizeLine,"mouseover",(t=>{i.verticalSplitResizeLine.childNodes[1].style.opacity="1"})),i.verticalSplitResizeLine&&n.on(i.verticalSplitResizeLine,"mouseout",(t=>{i.verticalSplitResizeLine.childNodes[1].style.opacity="0"})));const r=t=>{i.eventManager.lastDragPointerXYOnWindow={x:t.x,y:t.y},i.eventManager.poniterState="down"};t.globalEventListeners.push({name:"mousedown",env:"document",callback:r}),bu.addEventListener("mousedown",r);const s=t=>{if("down"===i.eventManager.poniterState){const e=i.eventManager.lastDragPointerXYOnWindow.x??t.x,o=t.x-e,n=i.eventManager.lastDragPointerXYOnWindow.y??t.y,r=t.y-n;(Math.abs(o)>=1||Math.abs(r)>=1)&&(i.eventManager.poniterState="draging")}if(o.interactionState===e.grabing&&"draging"===i.eventManager.poniterState){const e=i.eventManager.lastDragPointerXYOnWindow?.x??t.x;Math.abs(e-t.x)>=1&&(o.isResizingTableWidth()?(o.hideDependencyLinkSelectedLine(),o.hideTaskBarSelectedBorder(),o.dealResizeTableWidth(t)):o.isMoveingTaskBar()?(o.hideDependencyLinkSelectedLine(),o.hideTaskBarSelectedBorder(),o.dealTaskBarMove(t)):o.isResizingTaskBar()?(o.hideDependencyLinkSelectedLine(),o.hideTaskBarSelectedBorder(),o.dealTaskBarResize(t)):o.isCreatingDependencyLine()&&o.dealCreateDependencyLine(t),i.eventManager.lastDragPointerXYOnWindow={x:t.x,y:t.y})}};t.globalEventListeners.push({name:"mousemove",env:"document",callback:s}),bu.addEventListener("mousemove",s);const l=t=>{"grabing"===o.interactionState&&(o.updateInteractionState(e.default),o.isResizingTableWidth()?o.endResizeTableWidth():o.isMoveingTaskBar()?o.endMoveTaskBar(t.x):o.isResizingTaskBar()&&o.endResizeTaskBar(t.x)),i.eventManager.lastDragPointerXYOnWindow=void 0,i.eventManager.poniterState="up"};t.globalEventListeners.push({name:"mouseup",env:"document",callback:l}),bu.addEventListener("mouseup",l)}(this)}}function aP(t){const{scroll:e}=t.stateManager,{verticalBarPos:i}=e;t.taskListTableInstance.stateManager.setScrollTop(i,void 0,!1)}class hP{friction;lastTime;speedX;speedY;runingId;stopped;scrollHandle;constructor(){}setScrollHandle(t){this.scrollHandle=t}startInertia(t,e,i){this.stopped=!1,this.lastTime=Date.now(),this.speedX=t,this.speedY=e,this.friction=i,this.runingId||(this.runingId=requestAnimationFrame(this.inertia.bind(this)))}inertia(){if(this.stopped)return;const t=Date.now(),e=t-this.lastTime;let i=!0;const o=Math.pow(this.friction,e/16),n=o*this.speedX,r=o*this.speedY;let s=0,l=0;Math.abs(n)>.05&&(i=!1,s=(this.speedX+n)/2*e),Math.abs(r)>.05&&(i=!1,l=(this.speedY+r)/2*e),this.scrollHandle?.(s,l),i?this.runingId=null:(this.lastTime=t,this.speedX=n,this.speedY=r,this.runingId=requestAnimationFrame(this.inertia.bind(this)))}endInertia(){cancelAnimationFrame(this.runingId),this.runingId=null,this.stopped=!0}isInertiaScrolling(){return!!this.runingId}}class dP{_gantt;scroll;fastScrolling;interactionState=e.default;moveTaskBar;hoverTaskBar;resizeTaskBar;selectedTaskBar;resizeTableWidth;selectedDenpendencyLink;creatingDenpendencyLink;resetInteractionState=eP((()=>{this.updateInteractionState(e.default)}),100);constructor(t){this._gantt=t,this.scroll={horizontalBarPos:0,verticalBarPos:0},this.moveTaskBar={targetStartX:null,deltaX:0,startOffsetY:null,startX:null,startY:null,moving:!1,target:null,moveTaskBarXSpeed:0,moveTaskBarXInertia:new hP},this.hoverTaskBar={targetStartX:null,startX:null,target:null},this.selectedTaskBar={target:null},this.resizeTaskBar={startOffsetY:null,targetStartX:null,startX:null,startY:null,target:null,resizing:!1,onIconName:""},this.resizeTableWidth={lastX:null,resizing:!1},this.selectedDenpendencyLink={link:null},this.creatingDenpendencyLink={startClickedPoint:null,startX:null,startY:null,startOffsetY:null,targetStartX:null,creating:!1,secondTaskBarNode:null},this.updateVerticalScrollBar=this.updateVerticalScrollBar.bind(this),this.updateHorizontalScrollBar=this.updateHorizontalScrollBar.bind(this),function(t){t.taskListTableInstance&&t.taskListTableInstance?.on("scroll",(e=>{if("vertical"===e.scrollDirection){const{scroll:e}=t.taskListTableInstance.stateManager,{verticalBarPos:i}=e;t.stateManager.setScrollTop(i,!1)}}))}(this._gantt),function(t){t.taskListTableInstance?.on("change_cell_value",(e=>{const{col:i,row:o,rawValue:n,changedValue:r}=e;t._refreshTaskBar(o-t.taskListTableInstance.columnHeaderLevelCount)}))}(this._gantt),function(t){t.taskListTableInstance?.on("change_header_position",(e=>{t.scenegraph.refreshTaskBars();const i=t.stateManager.scroll.horizontalBarPos,o=t.stateManager.scroll.verticalBarPos;t.scenegraph.setX(-i),t.scenegraph.setY(-o)}))}(this._gantt),function(t){t.taskListTableInstance?.on("tree_hierarchy_state_change",(e=>{t._syncPropsFromTable(),t.verticalSplitResizeLine.style.height=t.drawHeight+"px",t.scenegraph.refreshTaskBarsAndGrid();const i=t.stateManager.scroll.horizontalBarPos,o=t.stateManager.scroll.verticalBarPos;t.scenegraph.setX(-i),t.scenegraph.setY(-o)}))}(this._gantt),function(t){t.taskListTableInstance?.on("after_sort",(e=>{t.scenegraph.refreshTaskBars();const i=t.stateManager.scroll.horizontalBarPos,o=t.stateManager.scroll.verticalBarPos;t.scenegraph.setX(-i),t.scenegraph.setY(-o)}))}(this._gantt)}setScrollTop(t,e=!0){const i=this._gantt.getAllRowsHeight();t=Math.max(0,Math.min(t,i-this._gantt.scenegraph.height)),t=Math.ceil(t);const n=this.scroll.verticalBarPos;this.scroll.verticalBarPos=t,Q(this.scroll.verticalBarPos)&&!isNaN(this.scroll.verticalBarPos)||(this.scroll.verticalBarPos=0),this._gantt.scenegraph.setY(-t);const r=t/(i-this._gantt.scenegraph.height);this._gantt.scenegraph.scrollbarComponent.updateVerticalScrollBarPos(r),n!==t&&e&&(aP(this._gantt),this._gantt.fireListeners(o.SCROLL,{scrollTop:this.scroll.verticalBarPos,scrollLeft:this.scroll.horizontalBarPos,scrollDirection:"vertical",scrollRatioY:r}))}get scrollLeft(){return this.scroll.horizontalBarPos}get scrollTop(){return this.scroll.verticalBarPos}setScrollLeft(t,e=!0){const i=this._gantt._getAllColsWidth();t=Math.max(0,Math.min(t,i-this._gantt.scenegraph.width)),t=Math.ceil(t);const n=this.scroll.horizontalBarPos;this.scroll.horizontalBarPos=t,Q(this.scroll.horizontalBarPos)&&!isNaN(this.scroll.horizontalBarPos)||(this.scroll.horizontalBarPos=0),this._gantt.scenegraph.setX(-t);const r=t/(i-this._gantt.scenegraph.width);this._gantt.scenegraph.scrollbarComponent.updateHorizontalScrollBarPos(r),n!==t&&e&&this._gantt.fireListeners(o.SCROLL,{scrollTop:this.scroll.verticalBarPos,scrollLeft:this.scroll.horizontalBarPos,scrollDirection:"horizontal",scrollRatioX:r})}updateInteractionState(t){if(this.interactionState===t)return;const i=this.interactionState;this.interactionState=t,i===e.scrolling&&e.default}updateVerticalScrollBar(t){const e=this._gantt.getAllRowsHeight();this.scroll.verticalBarPos,this.scroll.verticalBarPos=Math.ceil(t*(e-this._gantt.scenegraph.height)),Q(this.scroll.verticalBarPos)&&!isNaN(this.scroll.verticalBarPos)||(this.scroll.verticalBarPos=0),this._gantt.scenegraph.setY(-this.scroll.verticalBarPos,1===t),aP(this._gantt),this._gantt.fireListeners(o.SCROLL,{scrollTop:this.scroll.verticalBarPos,scrollLeft:this.scroll.horizontalBarPos,scrollDirection:"vertical",scrollRatioY:t})}updateHorizontalScrollBar(t){const e=this._gantt._getAllColsWidth();this.scroll.horizontalBarPos,this.scroll.horizontalBarPos=Math.ceil(t*(e-this._gantt.scenegraph.width)),Q(this.scroll.horizontalBarPos)&&!isNaN(this.scroll.horizontalBarPos)||(this.scroll.horizontalBarPos=0),this._gantt.scenegraph.setX(-this.scroll.horizontalBarPos,1===t),this._gantt.fireListeners(o.SCROLL,{scrollTop:this.scroll.verticalBarPos,scrollLeft:this.scroll.horizontalBarPos,scrollDirection:"horizontal",scrollRatioY:t})}startMoveTaskBar(t,e,i,o){"task-bar-hover-shadow"===t.name&&(t=t.parent),this.moveTaskBar.moving=!0,this.moveTaskBar.target=t,this.moveTaskBar.targetStartX=t.attribute.x,this.moveTaskBar.startX=e,this.moveTaskBar.startY=i,this.moveTaskBar.startOffsetY=o}isMoveingTaskBar(){return this.moveTaskBar.moving}endMoveTaskBar(t){this.moveTaskBar.moveTaskBarXInertia.isInertiaScrolling()&&this.moveTaskBar.moveTaskBarXInertia.endInertia();const e=yC(this.moveTaskBar.startOffsetY,this._gantt),i=this.moveTaskBar.deltaX,n=Math.round(i/this._gantt.parsedOptions.colWidthPerDay),r=n*this._gantt.parsedOptions.colWidthPerDay,s=this.moveTaskBar.targetStartX+r,l=this._gantt.stateManager.moveTaskBar.target;if(uP(e,l,s-l.attribute.x,null,this),Math.abs(n)>=1){const t=yC(this.moveTaskBar.startOffsetY,this._gantt),e=this._gantt.getRecordByIndex(t),i=e[this._gantt.parsedOptions.startDateField],r=e[this._gantt.parsedOptions.endDateField];if(this._gantt._updateDateToTaskRecord("move",n,t),this._gantt.hasListeners(o.CHANGE_DATE_RANGE)){const e=this._gantt.getRecordByIndex(t);this._gantt.fireListeners(o.CHANGE_DATE_RANGE,{startDate:e[this._gantt.parsedOptions.startDateField],endDate:e[this._gantt.parsedOptions.endDateField],oldStartDate:i,oldEndDate:r,index:t,record:e})}}this._gantt.scenegraph.updateNextFrame(),this.moveTaskBar.moving=!1,this.moveTaskBar.target=null,this.moveTaskBar.deltaX=0,this.moveTaskBar.moveTaskBarXSpeed=0}dealTaskBarMove(t){const e=this.moveTaskBar.target,i=yC(this.moveTaskBar.startOffsetY,this._gantt),o=this._gantt.eventManager.lastDragPointerXYOnWindow.x,n=t.x-o;this.moveTaskBar.deltaX+=n,uP(i,e,n,null,this),e.attribute.x<=this._gantt.stateManager.scrollLeft&&n<0?(this.moveTaskBar.moveTaskBarXSpeed=-this._gantt.parsedOptions.colWidthPerDay/100,this.moveTaskBar.moveTaskBarXInertia.startInertia(this.moveTaskBar.moveTaskBarXSpeed,0,1),this.moveTaskBar.moveTaskBarXInertia.setScrollHandle(((t,o)=>{this.moveTaskBar.deltaX+=t,uP(i,e,t,null,this),this._gantt.stateManager.setScrollLeft(e.attribute.x),0===this._gantt.stateManager.scrollLeft&&this.moveTaskBar.moveTaskBarXInertia.endInertia()}))):e.attribute.x+e.attribute.width>=this._gantt.stateManager.scrollLeft+this._gantt.tableNoFrameWidth&&n>0?(this.moveTaskBar.moveTaskBarXSpeed=this._gantt.parsedOptions.colWidthPerDay/100,this.moveTaskBar.moveTaskBarXInertia.startInertia(this.moveTaskBar.moveTaskBarXSpeed,0,1),this.moveTaskBar.moveTaskBarXInertia.setScrollHandle(((t,o)=>{this.moveTaskBar.deltaX+=t,uP(i,e,t,null,this),this._gantt.stateManager.setScrollLeft(e.attribute.x+e.attribute.width-this._gantt.tableNoFrameWidth),this._gantt.stateManager.scrollLeft===this._gantt._getAllColsWidth()-this._gantt.tableNoFrameWidth&&this.moveTaskBar.moveTaskBarXInertia.endInertia()}))):this.moveTaskBar.moveTaskBarXInertia.isInertiaScrolling()?this.moveTaskBar.moveTaskBarXInertia.endInertia():this.moveTaskBar.moveTaskBarXSpeed=0,this._gantt.scenegraph.updateNextFrame()}startResizeTaskBar(t,e,i,o,n){this.resizeTaskBar.onIconName=n,this.resizeTaskBar.resizing=!0,this.resizeTaskBar.target=t,this.resizeTaskBar.targetStartX=t.attribute.x,this.resizeTaskBar.startX=e,this.resizeTaskBar.startY=i,this.resizeTaskBar.startOffsetY=o}isResizingTaskBar(){return this.resizeTaskBar.resizing}endResizeTaskBar(t){const e=this._gantt.stateManager.resizeTaskBar.onIconName,i=t-this.resizeTaskBar.startX;if(Math.abs(i)>=1){let t=Math.round(i/this._gantt.parsedOptions.colWidthPerDay);t="left"===e?-t:t;const n=this._gantt.stateManager.resizeTaskBar.target,r=this._gantt.stateManager.resizeTaskBar.target.barRect,s=this._gantt.stateManager.resizeTaskBar.target.progressRect,l=yC(this.resizeTaskBar.startOffsetY,this._gantt),a=this._gantt.getRecordByIndex(l),h=a[this._gantt.parsedOptions.startDateField],d=a[this._gantt.parsedOptions.endDateField],{taskDays:c,progress:u}=this._gantt.getTaskInfoByTaskListIndex(l);t<0&&c+t<=0&&(t=1-c);const g=("left"===e?-t:t)*this._gantt.parsedOptions.colWidthPerDay,p=this.resizeTaskBar.targetStartX+g,f=this._gantt.parsedOptions.colWidthPerDay*(c+t);if("left"===e?(uP(l,n,p-n.attribute.x,f,this),r?.setAttribute("width",n.attribute.width),s?.setAttribute("width",u/100*n.attribute.width),this._gantt._updateDateToTaskRecord("start-move",-t,l)):"right"===e&&(uP(l,n,0,f,this),r?.setAttribute("width",n.attribute.width),s?.setAttribute("width",u/100*n.attribute.width),this._gantt._updateDateToTaskRecord("end-move",t,l)),this.showTaskBarHover(),cP(this._gantt,n,l),this.resizeTaskBar.resizing=!1,this.resizeTaskBar.target=null,Math.abs(t)>=1&&this._gantt.hasListeners(o.CHANGE_DATE_RANGE)){const t=this._gantt.getRecordByIndex(l);this._gantt.fireListeners(o.CHANGE_DATE_RANGE,{startDate:t[this._gantt.parsedOptions.startDateField],endDate:t[this._gantt.parsedOptions.endDateField],oldStartDate:h,oldEndDate:d,index:l,record:t})}this._gantt.scenegraph.updateNextFrame()}}dealTaskBarResize(t){const e=this._gantt.eventManager.lastDragPointerXYOnWindow.x,i=t.x-e,o=this._gantt.stateManager.resizeTaskBar.target,n=o.barRect,r=o.progressRect,s=o.textLabel,l=this._gantt.parsedOptions.progressField,a=yC(this.resizeTaskBar.startOffsetY,this._gantt),h=this._gantt.getRecordByIndex(a)[l];let d="left"===this._gantt.stateManager.resizeTaskBar.onIconName?-i:i,c=o.attribute.width+d;d<0&&c<=this._gantt.parsedOptions.colWidthPerDay&&(d=this._gantt.parsedOptions.colWidthPerDay-o.attribute.width,c+=d),uP(a,o,"left"===this._gantt.stateManager.resizeTaskBar.onIconName?-d:0,c,this),n?.setAttribute("width",o.attribute.width),r?.setAttribute("width",h/100*o.attribute.width),s?.setAttribute("maxLineWidth",c-20),this.showTaskBarHover(),cP(this._gantt,o,a),this._gantt.scenegraph.updateNextFrame()}startCreateDependencyLine(t,e,i,o,n){this.creatingDenpendencyLink.creating=!0,this.creatingDenpendencyLink.startClickedPoint=t,this.creatingDenpendencyLink.startX=e,this.creatingDenpendencyLink.startY=i,this.creatingDenpendencyLink.startOffsetY=o,this.creatingDenpendencyLink.firstTaskBarPosition=n,this.highlightLinkPointNode(t)}isCreatingDependencyLine(){return this.creatingDenpendencyLink.creating}endCreateDependencyLine(t){const e=this._gantt.parsedOptions.taskKeyField,o=yC(this.creatingDenpendencyLink.startOffsetY,this._gantt),n=yC(t,this._gantt),r={linkedFromTaskKey:this._gantt.getRecordByIndex(o)[e],linkedToTaskKey:this._gantt.getRecordByIndex(n)[e],type:"left"===this.creatingDenpendencyLink.firstTaskBarPosition&&"left"===this.creatingDenpendencyLink.secondTaskBarPosition?i.StartToStart:"right"===this.creatingDenpendencyLink.firstTaskBarPosition&&"left"===this.creatingDenpendencyLink.secondTaskBarPosition?i.FinishToStart:"right"===this.creatingDenpendencyLink.firstTaskBarPosition&&"right"===this.creatingDenpendencyLink.secondTaskBarPosition?i.FinishToFinish:i.StartToFinish};return this._gantt.addLink(r),this.hideTaskBarSelectedBorder(),this._gantt.scenegraph.updateNextFrame(),this.creatingDenpendencyLink.creating=!1,r}dealCreateDependencyLine(t){const e=this.creatingDenpendencyLink.startX,i=this.creatingDenpendencyLink.startY,o=t.x-e,n=t.y-i,r=this.creatingDenpendencyLink.startClickedPoint,s=r.attribute.x+r.attribute.width/2,l=r.attribute.y+r.attribute.height/2;this._gantt.scenegraph.taskBar.updateCreatingDependencyLine(s,l,s+o,l+n),this._gantt.scenegraph.updateNextFrame()}startResizeTableWidth(t){this.resizeTableWidth.resizing=!0,this.resizeTableWidth.lastX=t.pageX}isResizingTableWidth(){return this.resizeTableWidth.resizing}endResizeTableWidth(){this.resizeTableWidth.resizing=!1}dealResizeTableWidth(t){if(!this.resizeTableWidth.resizing)return;const e=t.pageX-this.resizeTableWidth.lastX;if(Math.abs(e)>=1){let i=this._gantt.taskTableWidth+e;const o=Math.min(this._gantt.taskListTableInstance.getAllColsWidth()+this._gantt.parsedOptions.outerFrameStyle.borderLineWidth,this._gantt.options.taskListTable.maxTableWidth??1e5),n=Math.max(this._gantt.parsedOptions.outerFrameStyle.borderLineWidth,this._gantt.options.taskListTable.minTableWidth??0);e>0&&i>o&&(i=o),e<0&&i<n&&(i=n),this._gantt.taskTableWidth=i,this._gantt.element.style.left=this._gantt.taskTableWidth?`${this._gantt.taskTableWidth}px`:"0px",this._gantt.verticalSplitResizeLine.style.left=this._gantt.taskTableWidth?this._gantt.taskTableWidth-7+"px":"0px",this._gantt._resize(),this.resizeTableWidth.lastX=t.pageX}}showTaskBarHover(){const t=this._gantt.stateManager.hoverTaskBar.target,e=t.attribute.x,i=t.attribute.y,o=t.attribute.width,n=t.attribute.height;this._gantt.scenegraph.taskBar.showHoverBar(e,i,o,n,t),this._gantt.scenegraph.updateNextFrame()}hideTaskBarHover(t){this._gantt.stateManager.hoverTaskBar.target=null,this._gantt.scenegraph.taskBar.hideHoverBar(),this._gantt.scenegraph.updateNextFrame()}showTaskBarSelectedBorder(){const t=this._gantt.parsedOptions.dependencyLinkCreatable,e=this._gantt.stateManager.selectedTaskBar.target,i=e.attribute.x,o=e.attribute.y,n=e.attribute.width,r=e.attribute.height;this._gantt.scenegraph.taskBar.createSelectedBorder(i,o,n,r,e,t),this._gantt.scenegraph.updateNextFrame()}hideTaskBarSelectedBorder(){this._gantt.stateManager.selectedTaskBar.target=null,this._gantt.scenegraph.taskBar.removeSelectedBorder(),this._gantt.scenegraph.updateNextFrame()}showSecondTaskBarSelectedBorder(){const t=this._gantt.stateManager.creatingDenpendencyLink.secondTaskBarNode,e=t.attribute.x,i=t.attribute.y,o=t.attribute.width,n=t.attribute.height;this._gantt.scenegraph.taskBar.createSelectedBorder(e,i,o,n,t,!0),this._gantt.scenegraph.updateNextFrame()}hideSecondTaskBarSelectedBorder(){this._gantt.stateManager.creatingDenpendencyLink.secondTaskBarNode=null,this._gantt.scenegraph.taskBar.removeSecondSelectedBorder(),this._gantt.scenegraph.updateNextFrame()}showDependencyLinkSelectedLine(){const t=this._gantt.stateManager.selectedDenpendencyLink.link;this._gantt.scenegraph.dependencyLink.createSelectedLinkLine(t);const{taskKeyField:e,dependencyLinks:i}=this._gantt.parsedOptions,{linkedToTaskKey:o,linkedFromTaskKey:n,type:r}=t,s=SC(this._gantt.records,e,o),l=SC(this._gantt.records,e,n),a=this._gantt.getTaskShowIndexByRecordIndex(l.index),h=this._gantt.getTaskShowIndexByRecordIndex(s.index),d=this._gantt.scenegraph.taskBar.getTaskBarNodeByIndex(a);this._gantt.scenegraph.taskBar.createSelectedBorder(d.attribute.x,d.attribute.y,d.attribute.width,d.attribute.height,d,!1);const c=this._gantt.scenegraph.taskBar.getTaskBarNodeByIndex(h);this._gantt.scenegraph.taskBar.createSelectedBorder(c.attribute.x,c.attribute.y,c.attribute.width,c.attribute.height,c,!1),this._gantt.scenegraph.updateNextFrame()}hideDependencyLinkSelectedLine(){this._gantt.stateManager.selectedDenpendencyLink.link=null,this._gantt.scenegraph.dependencyLink.removeSelectedLinkLine(),this._gantt.scenegraph.taskBar.removeSelectedBorder(),this._gantt.scenegraph.updateNextFrame()}highlightLinkPointNode(t){if(t?.children.length>0){const e=t.children[0];e.setAttribute("fill",this._gantt.parsedOptions.dependencyLinkLineCreatingPointStyle.fillColor),e.setAttribute("stroke",this._gantt.parsedOptions.dependencyLinkLineCreatingPointStyle.strokeColor),e.setAttribute("radius",this._gantt.parsedOptions.dependencyLinkLineCreatingPointStyle.radius),e.setAttribute("lineWidth",this._gantt.parsedOptions.dependencyLinkLineCreatingPointStyle.strokeWidth),this._gantt.scenegraph.updateNextFrame()}}unhighlightLinkPointNode(t){if(t?.children.length>0){const e=t.children[0];e.setAttribute("fill",this._gantt.parsedOptions.dependencyLinkLineCreatePointStyle.fillColor),e.setAttribute("stroke",this._gantt.parsedOptions.dependencyLinkLineCreatePointStyle.strokeColor),e.setAttribute("radius",this._gantt.parsedOptions.dependencyLinkLineCreatePointStyle.radius),e.setAttribute("lineWidth",this._gantt.parsedOptions.dependencyLinkLineCreatePointStyle.strokeWidth),this._gantt.scenegraph.updateNextFrame()}}}function cP(t,e,i){const o=t.parsedOptions.taskBarCustomLayout;if(o){let n;if("function"==typeof o){const{startDate:r,endDate:s,taskDays:l,progress:a,taskRecord:h}=t.getTaskInfoByTaskListIndex(i);n=o({width:e.attribute.width,height:e.attribute.height,index:i,startDate:r,endDate:s,taskDays:l,progress:a,taskRecord:h,ganttInstance:t})}else n=o;if(n){const t=n.rootContainer;t.name="task-bar-custom-render";const i=e.children.findIndex((t=>"task-bar-custom-render"===t.name)),o=e.children[i];e.removeChild(o),e.insertInto(t,i)}}}function uP(t,e,i,o,n){const r=n._gantt.getRecordByIndex(t);i&&e.setAttribute("x",e.attribute.x+i),o&&e.setAttribute("width",o);const s=r.vtable_gantt_linkedTo,l=r.vtable_gantt_linkedFrom;for(let i=0;i<s?.length;i++){const o=s[i],r=o.vtable_gantt_linkLineNode,l=o.vtable_gantt_linkArrowNode,{linkedToTaskKey:a,linkedFromTaskKey:h,type:d}=o,{taskKeyField:c,minDate:u}=n._gantt.parsedOptions,g=SC(n._gantt.records,c,h),{startDate:p,endDate:f}=n._gantt.getTaskInfoByTaskListIndex(t),{startDate:v,endDate:m}=n._gantt.getTaskInfoByTaskListIndex(g.index),{linePoints:b,arrowPoints:y}=zC(d,v,m,g.index,p,f,t,u,n._gantt.parsedOptions.rowHeight,n._gantt.parsedOptions.colWidthPerDay,null,e);r.setAttribute("points",b),l.setAttribute("points",y)}for(let i=0;i<l?.length;i++){const o=l[i],r=o.vtable_gantt_linkLineNode,s=o.vtable_gantt_linkArrowNode,{linkedToTaskKey:a,linkedFromTaskKey:h,type:d}=o,{taskKeyField:c,minDate:u}=n._gantt.parsedOptions,g=SC(n._gantt.records,c,a),{startDate:p,endDate:f}=n._gantt.getTaskInfoByTaskListIndex(t),{startDate:v,endDate:m}=n._gantt.getTaskInfoByTaskListIndex(g.index),{linePoints:b,arrowPoints:y}=zC(d,p,f,t,v,m,g.index,u,n._gantt.parsedOptions.rowHeight,n._gantt.parsedOptions.colWidthPerDay,e,null);r.setAttribute("points",b),s.setAttribute("points",y)}}let gP=1,pP=class{listenersData={listeners:{},listenerData:{}};on(t,e){const i=this.listenersData.listeners[t]||(this.listenersData.listeners[t]=[]);i.push(e);const o=gP++;return this.listenersData.listenerData[o]={type:t,listener:e,remove:()=>{delete this.listenersData.listenerData[o];const n=i.indexOf(e);i.splice(n,1),this.listenersData.listeners[t].length||delete this.listenersData.listeners[t]}},o}off(t,e){if(e){const i=t;this.removeEventListener(i,e)}else{const e=t;if(!this.listenersData)return;this.listenersData.listenerData[e]?.remove()}}addEventListener(t,e,i){this.on(t,e)}removeEventListener(t,e){if(this.listenersData)for(const i in this.listenersData.listenerData){const o=this.listenersData.listenerData[i];o.type===t&&o.listener===e&&this.off(i)}}hasListeners(t){return!!this.listenersData&&!!this.listenersData.listeners[t]}fireListeners(t,e){if(!this.listenersData)return[];const i=this.listenersData.listeners[t];return i?i.map((t=>t.call(this,e))).filter((t=>Q(t))):[]}release(){delete this.listenersData}};class fP{records;minDate;maxDate;_gantt;constructor(t){this._gantt=t,this.records=t.records,this.minDate=t.parsedOptions.minDate,this.maxDate=t.parsedOptions.maxDate,this.processRecords()}processRecords(){const t=!this.minDate,e=!this.maxDate;let i=Number.MAX_SAFE_INTEGER,o=Number.MIN_SAFE_INTEGER;if(t||e){for(let n=0;n<this.records.length;n++){const r=this.records[n];if(t){const t=fC(r[this._gantt.parsedOptions.startDateField]);i=Math.min(i,t.getTime())}if(e){const t=fC(r[this._gantt.parsedOptions.endDateField]);o=Math.max(o,t.getTime())}}t&&(this.minDate=fC(i)),e&&(this.maxDate=fC(o)),this._gantt.parsedOptions.minDate=this.minDate,this._gantt.parsedOptions.maxDate=this.maxDate,this._gantt.parsedOptions._minDateTime=this._gantt.parsedOptions.minDate.getTime(),this._gantt.parsedOptions._maxDateTime=this._gantt.parsedOptions.maxDate.getTime()}}}var vP=Object.freeze({__proto__:null,formatDate:aC,getTodayNearDay:function(t,e){const i=(new Date).getTime(),o=new Date(i+864e5*t);if(e){const t=o.getFullYear().toString(),i=(o.getMonth()+1).toString().padStart(2,"0"),n=o.getDate().toString().padStart(2,"0");return e=(e=(e=e.replace("yyyy",t)).replace("mm",i)).replace("dd",n)}return o},getWeekNumber:pC,getWeekday:function(t,e="long"){const i=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],o=new Date(t);return"short"===e?i[o.getDay()].substr(0,3):"long"===e?i[o.getDay()]:'Invalid format specified. Please use "short" or "long".'}}),mP=Object.freeze({__proto__:null,Arc:Sc,Area:xc,Circle:Ih,Group:fs,Image:dc,Line:ic,Path:yc,Rect:rc,RichText:vc,Text:Nh}),bP=Object.freeze({__proto__:null,CustomLayout:QL,register:bk,themes:Rx});t.Gantt=class extends pP{options;container;tableNoFrameWidth;tableNoFrameHeight;tableX;tableY;scenegraph;stateManager;eventManager;taskListTableInstance;canvas;element;verticalSplitResizeLine;horizontalSplitLine;context;timeLineHeaderLevel;itemCount;drawHeight;headerHeight;gridHeight;parsedOptions={};taskTableWidth;taskTableColumns;records;data;constructor(t,i){super(),this.container=t,this.options=i,this.taskTableWidth="number"==typeof i?.taskListTable?.tableWidth?i?.taskListTable?.tableWidth:-1,this.taskTableColumns=i?.taskListTable?.columns??[],this.records=i?.records??[],this._sortScales(),CC(this),this.data=new fP(this),this._generateTimeLineDateMap(),this.timeLineHeaderLevel=this.parsedOptions.sortedTimelineScales.length,this.element=function(t,e="vtable-gantt"){const i=document.createElement("div");i.setAttribute("tabindex","0"),i.classList.add(e),i.style.outline="none",i.style.margin=`${t.top}px ${t.right}px ${t.bottom}px ${t.left}px`;const o=(i.offsetWidth||i.parentElement?.offsetWidth||1)-1,n=(i.offsetHeight||i.parentElement?.offsetHeight||1)-1;return i.style.width=o&&o-t.left-t.right+"px"||"0px",i.style.height=n&&n-t.top-t.bottom+"px"||"0px",i}({top:0,right:0,left:0,bottom:0},"vtable-gantt"),this.element.style.left=this.taskTableWidth?`${this.taskTableWidth}px`:"0px",this.canvas=document.createElement("canvas"),this.element.appendChild(this.canvas),this.context=this.canvas.getContext("2d"),t?(t.appendChild(this.element),this._updateSize()):this._updateSize(),this._generateListTable(),this._syncPropsFromTable(),function(t){if(t.taskListTableInstance){t.verticalSplitResizeLine=document.createElement("div"),t.verticalSplitResizeLine.style.position="absolute",t.verticalSplitResizeLine.style.top=t.tableY+"px",t.verticalSplitResizeLine.style.left=(t.taskTableWidth?t.taskTableWidth-7+t.parsedOptions.verticalSplitLine.lineWidth/2:0)+"px",t.verticalSplitResizeLine.style.width="14px",t.verticalSplitResizeLine.style.height=t.drawHeight+"px",t.verticalSplitResizeLine.style.backgroundColor="rgba(0,0,0,0)",t.verticalSplitResizeLine.style.zIndex="100",t.parsedOptions.verticalSplitLineMoveable&&(t.verticalSplitResizeLine.style.cursor="col-resize"),t.verticalSplitResizeLine.style.userSelect="none",t.verticalSplitResizeLine.style.opacity="1";const e=document.createElement("div");if(e.style.position="absolute",e.style.top="0px",e.style.left=(14-t.parsedOptions.verticalSplitLine.lineWidth)/2+"px",e.style.width=t.parsedOptions.verticalSplitLine.lineWidth+"px",e.style.height="100%",e.style.backgroundColor=t.parsedOptions.verticalSplitLine.lineColor,e.style.zIndex="100",e.style.userSelect="none",e.style.pointerEvents="none",e.style.transition="background-color 0.3s",t.verticalSplitResizeLine.appendChild(e),t.parsedOptions.verticalSplitLineHighlight){const e=document.createElement("div");e.style.position="absolute",e.style.top="0px",e.style.left=(14-t.parsedOptions.verticalSplitLineHighlight.lineWidth??2)/2+"px",e.style.width=(t.parsedOptions.verticalSplitLineHighlight.lineWidth??2)+"px",e.style.height="100%",e.style.backgroundColor=t.parsedOptions.verticalSplitLineHighlight.lineColor,e.style.zIndex="100",e.style.cursor="col-resize",e.style.userSelect="none",e.style.pointerEvents="none",e.style.opacity="0",e.style.transition="background-color 0.3s",t.verticalSplitResizeLine.appendChild(e)}t.container.appendChild(t.verticalSplitResizeLine)}}(this),this.scenegraph=new class{dateStepWidth;rowHeight;_scales;timelineHeader;grid;dependencyLink;taskBar;_gantt;tableGroup;scrollbarComponent;markLine;frameBorder;taskCreationButton;stage;tableGroupWidth;tableGroupHeight;constructor(t){let e,i;this._gantt=t,this.tableGroupWidth=t.tableNoFrameWidth,this.tableGroupHeight=Math.min(t.tableNoFrameHeight,t.drawHeight),"node"===rC.mode||(bu.setEnv("browser"),e=t.canvas.width,i=t.canvas.height),this.stage=Hu({canvas:t.canvas,width:e,height:i,disableDirtyBounds:!1,background:t.parsedOptions.underlayBackgroundColor,enableLayout:!0,autoRender:!1,context:{appName:"vtable"},pluginList:["poptipForText"]}),this.stage.gantt=this._gantt,this.stage.table=this._gantt,this.stage.defaultLayer.setTheme({group:{boundsPadding:0,strokeBoundsBuffer:0,lineJoin:"round"},text:{ignoreBuf:!0}}),this.initSceneGraph()}initSceneGraph(){const t=this;t.tableGroup=new fs({x:t._gantt.tableX,y:t._gantt.tableY,width:this.tableGroupWidth,height:this.tableGroupHeight,clip:!0,pickable:!1}),t.stage.defaultLayer.add(t.tableGroup),t.tableGroup.name="table",t.timelineHeader=new AC(t),t.grid=new nC(t),t.dependencyLink=new FC(t),t.taskBar=new TC(t),t.markLine=new kC(t),t.frameBorder=new LC(t),t.scrollbarComponent=new sC(t._gantt),t.stage.defaultLayer.addChild(t.scrollbarComponent.hScrollBar),t.stage.defaultLayer.addChild(t.scrollbarComponent.vScrollBar)}afterCreateSceneGraph(){this.scrollbarComponent.updateScrollBar(),function(t){const i=t._gantt,o=i.stateManager,n=i.scenegraph;n.scrollbarComponent.vScrollBar.addEventListener("pointerover",(t=>{n.scrollbarComponent.showVerticalScrollBar()})),n.scrollbarComponent.hScrollBar.addEventListener("pointerover",(t=>{n.scrollbarComponent.showHorizontalScrollBar()})),n.scrollbarComponent.vScrollBar.addEventListener("pointerout",(t=>{o.interactionState!==e.scrolling&&n.scrollbarComponent.hideVerticalScrollBar()})),n.scrollbarComponent.hScrollBar.addEventListener("pointerout",(t=>{o.interactionState!==e.scrolling&&n.scrollbarComponent.hideHorizontalScrollBar()})),n.scrollbarComponent.vScrollBar.addEventListener("pointermove",(t=>{t.stopPropagation()})),n.scrollbarComponent.vScrollBar.addEventListener("scrollDown",(t=>{n._gantt.eventManager.isDown=!0})),n.scrollbarComponent.vScrollBar.addEventListener("pointerup",(()=>{n._gantt.eventManager.isDraging=!1,o.interactionState===e.scrolling&&o.updateInteractionState(e.default)})),n.scrollbarComponent.vScrollBar.addEventListener("pointerupoutside",(()=>{o.interactionState===e.scrolling&&o.updateInteractionState(e.default)})),n.scrollbarComponent.vScrollBar.addEventListener("scrollUp",(t=>{n._gantt.eventManager.isDraging=!1})),n.scrollbarComponent.hScrollBar.addEventListener("pointermove",(t=>{t.stopPropagation()})),n.scrollbarComponent.hScrollBar.addEventListener("pointerdown",(t=>{t.stopPropagation()})),n.scrollbarComponent.hScrollBar.addEventListener("scrollDown",(t=>{n._gantt.eventManager.isDown=!0,o.interactionState!==e.scrolling&&o.updateInteractionState(e.scrolling)})),n.scrollbarComponent.hScrollBar.addEventListener("pointerup",(()=>{o.interactionState===e.scrolling&&o.updateInteractionState(e.default)})),n.scrollbarComponent.hScrollBar.addEventListener("pointerupoutside",(()=>{o.interactionState===e.scrolling&&o.updateInteractionState(e.default)})),n.scrollbarComponent.hScrollBar.addEventListener("scrollUp",(t=>{n._gantt.eventManager.isDraging=!1}));const r=lC(o.updateVerticalScrollBar,20),s=lC(o.updateHorizontalScrollBar,20);n.scrollbarComponent.vScrollBar.addEventListener("scrollDrag",(t=>{n._gantt.eventManager.isDown&&(n._gantt.eventManager.isDraging=!0),o.interactionState!==e.scrolling&&o.updateInteractionState(e.scrolling);const i=t.detail.value[0]/(1-t.detail.value[1]+t.detail.value[0]);r(i,t)})),n.scrollbarComponent.hScrollBar.addEventListener("scrollDrag",(t=>{n._gantt.eventManager.isDown&&(n._gantt.eventManager.isDraging=!0),o.fastScrolling=!0,o.interactionState!==e.scrolling&&o.updateInteractionState(e.scrolling);const i=t.detail.value[0]/(1-t.detail.value[1]+t.detail.value[0]);s(i)}))}(this._gantt.eventManager)}refreshAll(){this.tableGroupHeight=Math.min(this._gantt.tableNoFrameHeight,this._gantt.drawHeight),this.tableGroup.setAttribute("height",this.tableGroupHeight),this.timelineHeader.refresh(),this.grid.refresh(),this.taskBar.refresh(),this.markLine.refresh(),this.frameBorder.resize(),this.scrollbarComponent.updateScrollBar(),this.updateNextFrame()}refreshTaskBars(){this.dependencyLink.refresh(),this.taskBar.refresh(),this.updateNextFrame()}refreshTaskBarsAndGrid(){this.tableGroupHeight=Math.min(this._gantt.tableNoFrameHeight,this._gantt.drawHeight),this.tableGroup.setAttribute("height",this.tableGroupHeight),this.grid.refresh(),this.taskBar.refresh(),this.markLine.refresh(),this.frameBorder.resize(),this.scrollbarComponent.updateScrollBar(),this.updateNextFrame()}updateTableSize(){this.tableGroupHeight=Math.min(this._gantt.tableNoFrameHeight,this._gantt.drawHeight),this.tableGroup.setAttributes({x:this._gantt.tableX,y:this._gantt.tableY,width:this._gantt.tableNoFrameWidth,height:this.tableGroupHeight}),this.grid.resize(),this.taskBar.resize(),this.frameBorder.resize()}renderSceneGraph(){this.stage.render()}updateNextFrame(){this.stage.renderNextFrame()}get width(){return this.tableGroup.attribute?.width??0}get height(){return this.tableGroup.attribute?.height??0}get x(){return this.tableGroup.attribute?.x??0}get y(){return this.tableGroup.attribute?.y??0}setX(t,e=!1){this.timelineHeader.setX(t),this.grid.setX(t),this.taskBar.setX(t),this.dependencyLink.setX(t),this.markLine.setX(t),this.updateNextFrame()}setY(t,e=!1){this.grid.setY(t),this.taskBar.setY(t),this.dependencyLink.setY(t),this.updateNextFrame()}setPixelRatio(t){this.stage.disableDirtyBounds(),this.stage.window.setDpr(t),this.stage.render(),this.stage.enableDirtyBounds()}resize(){this.updateTableSize(),this.scrollbarComponent.updateScrollBar(),this.updateNextFrame()}release(){this.stage.release()}getTaskBarNodeByY(t){yC(t,this._gantt)}showTaskCreationButton(t,e,i,o){this.taskCreationButton||(this.taskCreationButton=new HC(this._gantt.scenegraph)),this.taskCreationButton.show(t,e,this._gantt.parsedOptions.colWidthPerDay,this._gantt.parsedOptions.rowHeight),this.updateNextFrame()}hideTaskCreationButton(){this.taskCreationButton&&(this.taskCreationButton.hide(),this.updateNextFrame())}}(this),this.stateManager=new dP(this),this.eventManager=new lP(this),this.scenegraph.afterCreateSceneGraph(),this._scrollToMarkLine()}renderTaskBarsTable(){this.scenegraph.updateNextFrame()}_updateSize(){let t=0,e=0;if("browser"===rC.mode){const i=this.getElement();let o=0,n=0;if(i.parentElement){const t=i.parentElement.style||window.getComputedStyle(i.parentElement);o=i.parentElement.offsetWidth-parseInt(t.paddingLeft||"0px",10)-parseInt(t.paddingRight||"0px",10),n=i.parentElement.offsetHeight-parseInt(t.paddingTop||"0px",10)-parseInt(t.paddingBottom||"0px",20)}const r=(o??1)-1-this.taskTableWidth,s=(n??1)-1;i.style.width=r&&`${r}px`||"0px",i.style.height=s&&`${s}px`||"0px";const{canvas:l}=this;t=l.parentElement?.offsetWidth??1,e=l.parentElement?.offsetHeight??1,this?.scenegraph?.stage?this.scenegraph.stage.resize(t,e):(l.style.width="",l.style.height="",l.width=t,l.height=e,l.style.width=`${t}px`,l.style.height=`${e}px`)}const i=Math.floor(t-(o=this.parsedOptions.scrollStyle,o?.hoverOn||o?.verticalVisible&&"none"===o?.verticalVisible||!o?.verticalVisible&&"none"===o?.visible?0:o?.width??7));var o;const n=Math.floor(e-function(t){return t?.hoverOn||t?.horizontalVisible&&"none"===t?.horizontalVisible||!t?.horizontalVisible&&"none"===t?.visible?0:t?.width??7}(this.parsedOptions.scrollStyle));if(this.tableNoFrameWidth=t,this.tableNoFrameHeight=Math.floor(e),this.parsedOptions.outerFrameStyle){const t=this.parsedOptions.outerFrameStyle?.borderLineWidth;this.tableX=this.taskTableColumns.length>=1||this.options?.rowSeriesNumber?this.parsedOptions.verticalSplitLine.lineWidth??0:t,this.tableY=t,this.tableNoFrameWidth=Math.min(i-t-this.tableX,this._getAllColsWidth()),this.tableNoFrameHeight=n-2*t}}_generateListTable(){if(this.taskTableColumns.length>=1||this.options?.rowSeriesNumber){const t=this._generateListTableOptions();if(this.taskListTableInstance=new ZL(this.container,t),"auto"!==this.options?.taskListTable?.tableWidth&&-1!==this.taskTableWidth||(this.taskTableWidth=this.taskListTableInstance.getAllColsWidth()+this.parsedOptions.outerFrameStyle.borderLineWidth,this.options?.taskListTable?.maxTableWidth&&(this.taskTableWidth=Math.min(this.options?.taskListTable?.maxTableWidth,this.taskTableWidth)),this.options?.taskListTable?.minTableWidth&&(this.taskTableWidth=Math.max(this.options?.taskListTable?.minTableWidth,this.taskTableWidth)),this.element.style.left=this.taskTableWidth?`${this.taskTableWidth}px`:"0px",this.taskListTableInstance.setCanvasSize(this.taskTableWidth,this.tableNoFrameHeight+2*this.parsedOptions.outerFrameStyle.borderLineWidth),this._updateSize()),this.taskListTableInstance.columnHeaderLevelCount>1)if(this.taskListTableInstance.columnHeaderLevelCount===this.parsedOptions.timeLineHeaderRowHeights.length)for(let t=0;t<this.taskListTableInstance.columnHeaderLevelCount;t++)this.taskListTableInstance.setRowHeight(t,this.parsedOptions.timeLineHeaderRowHeights[t]);else{const t=this.getAllHeaderRowsHeight()/this.taskListTableInstance.columnHeaderLevelCount;for(let e=0;e<this.taskListTableInstance.columnHeaderLevelCount;e++)this.taskListTableInstance.setRowHeight(e,t)}}}_generateListTableOptions(){const t={},e=["container","records","rowSeriesNumber","overscrollBehavior","pixelRatio"];for(const i in this.options)e.indexOf(i)>=0&&(t[i]=this.options[i]);for(const e in this.options.taskListTable)t[e]=this.options.taskListTable[e],"columns"===e&&(t[e][t[e].length-1].disableColumnResize=!0);if(this.options.taskListTable?.theme)if(t.theme=this.options.taskListTable?.theme,t.theme.bodyStyle&&!function(t,e){const i=Object.getOwnPropertyDescriptor(t,e);return!(!i||!i.set&&!0!==i.writable)}(t.theme,"bodyStyle")){t.theme=(this.options.taskListTable?.theme).extends((this.options.taskListTable?.theme).getExtendTheme());const e=t.theme.getExtendTheme();t.theme.clearBodyStyleCache(),t.theme.headerStyle?.bgColor||(e.headerStyle?e.headerStyle.bgColor||(e.headerStyle.bgColor=this.parsedOptions.timelineHeaderBackgroundColor):e.headerStyle={bgColor:this.parsedOptions.timelineHeaderBackgroundColor}),e.bodyStyle?e.bodyStyle.frameStyle={borderLineWidth:[this.parsedOptions.horizontalSplitLine?.lineWidth??0,0,0,0],borderColor:this.parsedOptions.horizontalSplitLine?.lineColor}:e.bodyStyle={frameStyle:{borderLineWidth:[this.parsedOptions.horizontalSplitLine?.lineWidth??0,0,0,0],borderColor:this.parsedOptions.horizontalSplitLine?.lineColor}},e.cellInnerBorder=!1,e.frameStyle=Object.assign({},this.parsedOptions.outerFrameStyle,{shadowBlur:0,cornerRadius:[this.parsedOptions.outerFrameStyle?.cornerRadius??0,0,0,this.parsedOptions.outerFrameStyle?.cornerRadius??0],borderLineWidth:[this.parsedOptions.outerFrameStyle?.borderLineWidth??0,0,this.parsedOptions.outerFrameStyle?.borderLineWidth??0,this.parsedOptions.outerFrameStyle?.borderLineWidth??0]}),e.scrollStyle=Object.assign({},this.options.taskListTable?.theme?.scrollStyle,this.parsedOptions.scrollStyle,{verticalVisible:"none"}),e.columnResize=Object.assign({labelColor:"rgba(0,0,0,0)",labelBackgroundFill:"rgba(0,0,0,0)"},e?.columnResize),e.underlayBackgroundColor||(e.underlayBackgroundColor=this.parsedOptions.underlayBackgroundColor)}else t.theme.headerStyle?t.theme.headerStyle.bgColor||(t.theme.headerStyle.bgColor=this.parsedOptions.timelineHeaderBackgroundColor):t.theme.headerStyle={bgColor:this.parsedOptions.timelineHeaderBackgroundColor},t.theme.headerStyle=Object.assign({},Cx.headerStyle,{bgColor:this.parsedOptions.timelineHeaderBackgroundColor},this.options.taskListTable?.theme?.headerStyle),t.theme.bodyStyle=Object.assign({},Cx.bodyStyle,this.options.taskListTable?.theme?.bodyStyle,{frameStyle:{borderLineWidth:[this.parsedOptions.horizontalSplitLine?.lineWidth??0,0,0,0],borderColor:this.parsedOptions.horizontalSplitLine?.lineColor}}),t.theme.cellInnerBorder=!1,t.theme.frameStyle=Object.assign({},this.parsedOptions.outerFrameStyle,{cornerRadius:[this.parsedOptions.outerFrameStyle?.cornerRadius??0,0,0,this.parsedOptions.outerFrameStyle?.cornerRadius??0],borderLineWidth:[this.parsedOptions.outerFrameStyle?.borderLineWidth??0,0,this.parsedOptions.outerFrameStyle?.borderLineWidth??0,this.parsedOptions.outerFrameStyle?.borderLineWidth??0]}),t.theme.scrollStyle=Object.assign({},this.options.taskListTable?.theme?.scrollStyle,this.parsedOptions.scrollStyle,{verticalVisible:"none"}),t.theme.columnResize=Object.assign({labelColor:"rgba(0,0,0,0)",labelBackgroundFill:"rgba(0,0,0,0)"},this.options.taskListTable?.theme?.columnResize),t.theme.underlayBackgroundColor||(t.theme.underlayBackgroundColor=this.parsedOptions.underlayBackgroundColor);else t.theme={scrollStyle:Object.assign({},this.options.taskListTable?.theme?.scrollStyle,this.parsedOptions.scrollStyle,{verticalVisible:"none"}),headerStyle:Object.assign({},Cx.headerStyle,{bgColor:this.parsedOptions.timelineHeaderBackgroundColor},this.options.taskListTable?.theme?.headerStyle),bodyStyle:Object.assign({},Cx.bodyStyle,this.options.taskListTable?.theme?.bodyStyle,{frameStyle:{borderLineWidth:[this.parsedOptions.horizontalSplitLine?.lineWidth??0,0,0,0],borderColor:this.parsedOptions.horizontalSplitLine?.lineColor}}),cellInnerBorder:!1,frameStyle:Object.assign({},this.parsedOptions.outerFrameStyle,{cornerRadius:[this.parsedOptions.outerFrameStyle?.cornerRadius??0,0,0,this.parsedOptions.outerFrameStyle?.cornerRadius??0],borderLineWidth:[this.parsedOptions.outerFrameStyle?.borderLineWidth??0,0,this.parsedOptions.outerFrameStyle?.borderLineWidth??0,this.parsedOptions.outerFrameStyle?.borderLineWidth??0]}),columnResize:Object.assign({labelColor:"rgba(0,0,0,0)",labelBackgroundFill:"rgba(0,0,0,0)"},this.options.taskListTable?.theme?.columnResize),underlayBackgroundColor:this.parsedOptions.underlayBackgroundColor};return t.canvasWidth=this.taskTableWidth,t.canvasHeight=this.canvas.height,t.defaultHeaderRowHeight=this.getAllHeaderRowsHeight(),t.defaultRowHeight=this.parsedOptions.rowHeight,t.clearDOM=!1,t}getElement(){return this.element}getContainer(){return this.element.parentElement}_sortScales(){const{timelineHeader:t}=this.options;if(t){const e=t.scales,i=["year","quarter","month","week","day"],o=e.slice().sort(((t,e)=>{const o=i.indexOf(t.unit),n=i.indexOf(e.unit);return-1===o?1:-1===n?-1:o-n})),n=e.slice().sort(((t,e)=>{const o=i.indexOf(t.unit),n=i.indexOf(e.unit);return-1===o?1:-1===n?-1:n-o}));this.parsedOptions.sortedTimelineScales=o,this.parsedOptions.reverseSortedTimelineScales=n}}_generateTimeLineDateMap(){const t=fC(this.parsedOptions.minDate),e=fC(this.parsedOptions.maxDate);let i=1e6;for(const i of this.parsedOptions.reverseSortedTimelineScales){const o=fC(t);i.timelineDates=wC(o,e,i)}const o=this.parsedOptions.reverseSortedTimelineScales[0],{unit:n,step:r}=o;"day"===n?i=r:"month"===n?i=30:"week"===n?i=7:"quarter"===n?i=90:"year"===n&&(i=365),this.parsedOptions.colWidthPerDay=this.parsedOptions.timelineColWidth/i}getAllRowsHeight(){return this.getAllHeaderRowsHeight()+this.itemCount*this.parsedOptions.rowHeight}getAllHeaderRowsHeight(){return this.parsedOptions.timeLineHeaderRowHeights.reduce(((t,e,i)=>t+e),0)}_getAllColsWidth(){return this.parsedOptions.colWidthPerDay*(Math.ceil(Math.abs(fC(this.parsedOptions.maxDate).getTime()-fC(this.parsedOptions.minDate).getTime())/864e5)+1)}getAllTaskBarsHeight(){return this.itemCount*this.parsedOptions.rowHeight}getTaskShowIndexByRecordIndex(t){return this.taskListTableInstance.getBodyRowIndexByRecordIndex(t)}getRecordByIndex(t){return this.taskListTableInstance?this.taskListTableInstance.getRecordByRowCol(0,t+this.taskListTableInstance.columnHeaderLevelCount):this.records[t]}_refreshTaskBar(t){this.scenegraph.taskBar.updateTaskBarNode(t),this.scenegraph.updateNextFrame()}_updateRecordToListTable(t,e){this.taskListTableInstance.updateRecords([t],[e])}getTaskInfoByTaskListIndex(t){const e=this.getRecordByIndex(t),i=this.parsedOptions.startDateField,o=this.parsedOptions.endDateField,n=this.parsedOptions.progressField,r=fC(e?.[i]).getTime(),s=fC(e?.[o]).getTime();if(s<this.parsedOptions._minDateTime||r>this.parsedOptions._maxDateTime||!e?.[i]||!e?.[o])return{taskDays:0,progress:0,startDate:null,endDate:null,taskRecord:e};const l=fC(Math.min(Math.max(this.parsedOptions._minDateTime,r),this.parsedOptions._maxDateTime)),a=fC(Math.max(Math.min(this.parsedOptions._maxDateTime,s),this.parsedOptions._minDateTime)),h=function(t){return"string"==typeof t&&(t=t.replace("%",""),t=parseFloat(t)),t<=1&&(t*=100),Math.round(t)}(e[n]);return{taskRecord:e,taskDays:Math.ceil(Math.abs(a.getTime()-l.getTime())/864e5)+1,startDate:l,endDate:a,progress:h}}_updateDateToTaskRecord(t,e,i){const o=this.getRecordByIndex(i),n=this.parsedOptions.startDateField,r=this.parsedOptions.endDateField,s=this.parsedOptions.dateFormat??function(t){const e=["yyyy-mm-dd","dd-mm-yyyy","mm/dd/yyyy","yyyy/mm/dd","dd/mm/yyyy","yyyy.mm.dd","dd.mm.yyyy","mm.dd.yyyy"];t=t.replace(/\s+/g,"");for(let i=0;i<e.length;i++){const o=e[i],n=t.split(cC(o)),r=hC(n,o);if(3===n.length&&r)return o}return null}(o[n]),l=fC(o[n]),a=fC(o[r]);if("move"===t){const t=aC(fC(e*bC+l.getTime()),s),i=aC(fC(e*bC+a.getTime()),s);o[n]=t,o[r]=i}else if("start-move"===t){const t=aC(fC(e*bC+l.getTime()),s);o[n]=t}else if("end-move"===t){const t=aC(fC(e*bC+a.getTime()),s);o[r]=t}this._updateRecordToListTable(o,i)}updateTaskRecord(t,e){this._updateRecordToListTable(t,e),this._refreshTaskBar(e)}setPixelRatio(t){this.taskListTableInstance?.setPixelRatio(t),this.parsedOptions.pixelRatio=t,this.scenegraph.setPixelRatio(t)}_resize(){this._updateSize(),this.taskListTableInstance?.setCanvasSize(this.taskTableWidth,this.tableNoFrameHeight+2*this.parsedOptions.outerFrameStyle.borderLineWidth),this._syncPropsFromTable(),this.scenegraph.resize(),_C(this)}_syncPropsFromTable(){this.itemCount=this.taskListTableInstance?this.taskListTableInstance.rowCount-this.taskListTableInstance.columnHeaderLevelCount:this.records.length,this.headerHeight=this.getAllHeaderRowsHeight(),this.drawHeight=Math.min(this.headerHeight+this.parsedOptions.rowHeight*this.itemCount,this.tableNoFrameHeight),this.gridHeight=this.drawHeight-this.headerHeight}getContext(){return this.context}release(){super.release?.(),this.eventManager.release(),this.taskListTableInstance?.release();const{parentElement:t}=this.element;t&&(t.removeChild(this.element),this.verticalSplitResizeLine&&t.removeChild(this.verticalSplitResizeLine),this.horizontalSplitLine&&t.removeChild(this.horizontalSplitLine)),this.scenegraph=null}setRecords(t){this.records=t,this.taskListTableInstance.setRecords(t),this._syncPropsFromTable(),this.verticalSplitResizeLine.style.height=this.drawHeight+"px",this.scenegraph.refreshTaskBarsAndGrid();const e=this.stateManager.scroll.horizontalBarPos,i=this.stateManager.scroll.verticalBarPos;this.scenegraph.setX(-e),this.scenegraph.setY(-i)}updateScales(t){if(this.options.timelineHeader.scales=t,this._sortScales(),CC(this),this._generateTimeLineDateMap(),this.timeLineHeaderLevel=this.parsedOptions.sortedTimelineScales.length,this.scenegraph.refreshAll(),_C(this),this.taskListTableInstance)if(this.taskListTableInstance.columnHeaderLevelCount===this.parsedOptions.timeLineHeaderRowHeights.length)for(let t=0;t<this.taskListTableInstance.columnHeaderLevelCount;t++)this.taskListTableInstance.setRowHeight(t,this.parsedOptions.timeLineHeaderRowHeights[t]);else{const t=this.getAllHeaderRowsHeight()/this.taskListTableInstance.columnHeaderLevelCount;for(let e=0;e<this.taskListTableInstance.columnHeaderLevelCount;e++)this.taskListTableInstance.setRowHeight(e,t)}}_scrollToMarkLine(){if(this.parsedOptions.scrollToMarkLineDate){const t=this.parsedOptions.minDate,e=(this.parsedOptions.scrollToMarkLineDate.getTime()-t.getTime())/864e5*this.parsedOptions.colWidthPerDay-this.tableNoFrameWidth/2;this.stateManager.setScrollLeft(e)}}addLink(t){this.parsedOptions.dependencyLinks.push(t),this.scenegraph.dependencyLink.initLinkLine(this.parsedOptions.dependencyLinks.length-1),this.scenegraph.updateNextFrame()}deleteLink(t){const e=this.parsedOptions.dependencyLinks.findIndex((e=>e.type===t.type&&e.linkedFromTaskKey===t.linkedFromTaskKey&&e.linkedToTaskKey===t.linkedToTaskKey));if(-1!==e){const t=this.parsedOptions.dependencyLinks[e];this.parsedOptions.dependencyLinks.splice(e,1),this.scenegraph.dependencyLink.deleteLink(t),this.scenegraph.updateNextFrame()}}},t.TYPES=n,t.VRender=mP,t.VTable=bP,t.tools=vP,t.version="1.10.4-alpha.2"}));