@ecan-bi/pivot-table 1.0.58 → 1.0.59
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{DrillModal-bffe6815.mjs → DrillModal-eb3342dc.mjs} +3 -3
- package/dist/{DrillModal-bffe6815.mjs.map → DrillModal-eb3342dc.mjs.map} +1 -1
- package/dist/{index-02780d26.mjs → index-41d959ec.mjs} +187 -187
- package/dist/{index-02780d26.mjs.map → index-41d959ec.mjs.map} +1 -1
- package/dist/index.es.js +2 -2
- package/dist/index.umd.js +7 -7
- package/dist/index.umd.js.map +1 -1
- package/dist/style.css +2 -2
- package/package.json +1 -1
package/dist/index.umd.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @ecan-bi/pivot-table@1.0.
|
|
1
|
+
/*! @ecan-bi/pivot-table@1.0.59 */
|
|
2
2
|
(function(Je,v){typeof exports=="object"&&typeof module<"u"?v(exports,require("vue"),require("dayjs"),require("lodash-es"),require("axios"),require("ant-design-vue"),require("ant-design-vue/es/input-number/style"),require("ant-design-vue/es/form/style"),require("echarts"),require("vuedraggable")):typeof define=="function"&&define.amd?define(["exports","vue","dayjs","lodash-es","axios","ant-design-vue","ant-design-vue/es/input-number/style","ant-design-vue/es/form/style","echarts","vuedraggable"],v):(Je=typeof globalThis<"u"?globalThis:Je||self,v(Je["@ecan-bi/pivot-table"]={},Je.Vue,Je.Dayjs,Je.LodashEs,Je.Axios,Je.AntDesignVue,null,null,Je.Echarts,Je.Draggable))})(this,function(Je,v,Lo,Ye,PB,ji,XY,qY,HB,Bb){"use strict";function EB(i){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(i){for(const e in i)if(e!=="default"){const n=Object.getOwnPropertyDescriptor(i,e);Object.defineProperty(t,e,n.get?n:{enumerable:!0,get:()=>i[e]})}}return t.default=i,Object.freeze(t)}const LB=EB(HB),kB=i=>(i.install=t=>{t.component(i.name,i)},i);function Pb(i,t){var e={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&t.indexOf(n)<0&&(e[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function"){var o=0;for(n=Object.getOwnPropertySymbols(i);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(i,n[o])&&(e[n[o]]=i[n[o]])}return e}const FB=()=>{},IB=Object.assign,DB=Array.isArray,pf=i=>typeof i=="function",OB=i=>typeof i=="symbol";let Hb;const mf=()=>Hb||(Hb=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function vf(i){const t=i&&i.__v_raw;return t?vf(t):i}function Eb(i){return!(!i||i.__v_isRef!==!0)}function Mi(i){return Eb(i)?i.value:i}new Set(Object.getOwnPropertyNames(Symbol).filter(i=>i!=="arguments"&&i!=="caller").map(i=>Symbol[i]).filter(OB));const $r=[];function bf(i,...t){if(process.env.NODE_ENV==="production")return;const e=$r.length?$r[$r.length-1].component:null,n=e&&e.appContext.config.warnHandler,o=function(){let r=$r[$r.length-1];if(!r)return[];const s=[];for(;r;){const l=s[0];l&&l.vnode===r?l.recurseCount++:s.push({vnode:r,recurseCount:0});const a=r.component&&r.component.parent;r=a&&a.vnode}return s}();if(n)Cf(n,e,11,[i+t.join(""),e&&e.proxy,o.map(({vnode:r})=>`at <${Nb(e,r.type)}>`).join(`
|
|
3
3
|
`),o]);else{const r=[`[Vue warn]: ${i}`,...t];o.length&&r.push(`
|
|
4
4
|
`,...function(s){const l=[];return s.forEach((a,h)=>{l.push(...h===0?[]:[`
|
|
@@ -123,7 +123,7 @@
|
|
|
123
123
|
`)||[]:[ax(i)];o.length&&o.length>1&&!o[o.length-1];)o.pop();if(!((n=t.options.customConfig)===null||n===void 0)&&n.multilinesForXTable&&!t.internalProps.autoWrapText)for(;o.length&&o.length>1&&!o[0];)o.shift();return{text:o,moreThanMaxCharacters:r}}function Y6(i,t,e,n,o,r,s,l,a,h,d,u,c,g,f){var p,m,b,C,_,w,y,S,A;let R,x=0,T=0,M=0;if(Array.isArray(t)&&t.length!==0){const{inlineFrontIcons:F,inlineEndIcons:H,contentLeftIcons:E,contentRightIcons:k,leftIconWidth:I,rightIconWidth:L,absoluteRightIconWidth:D}=Dc(t,i,f,c);let O;if(x=I,T=L,M=D,F.length===0&&H.length===0){let N=0;ft(c.theme._contentOffset)&&(d==="left"?N=c.theme._contentOffset:d==="right"&&(N=-c.theme._contentOffset));const W=f?lo(f.start.col,f.start.row,c):lo(i.col,i.row,c),{text:$,moreThanMaxCharacters:U}=ph(e,c),Y={text:$.length===1?$[0]:$,moreThanMaxCharacters:U,maxLineWidth:o?1/0:a-(n[1]+n[3])-x-T-W,textBaseline:"top",heightLimit:((C=c.options.customConfig)===null||C===void 0?void 0:C.limitContentHeight)===!1||r&&!(!((_=c.options.customConfig)===null||_===void 0)&&_.multilinesForXTable)?-1:h-Math.floor(n[0]+n[2]),pickable:!1,autoWrapText:s,lineClamp:l,wordBreak:"break-word",whiteSpace:((w=c.options.customConfig)===null||w===void 0?void 0:w.limitContentHeight)===!1||$.length!==1||s?"normal":"no-wrap",dx:(d==="left"?E.length?0:W:0)+N},j=new Hi(g.text?Object.assign({},g.text,Y):Y);j.name="text",O=j}else{const N=Object.assign({text:e==null?void 0:e.toString()},((A=(S=(y=i.parent)===null||y===void 0?void 0:y.theme)===null||S===void 0?void 0:S.userTheme)===null||A===void 0?void 0:A.text)||{});g.text&&Object.assign(N,g.text),N.textBaseline="middle";const W=[...F.map(U=>kc(U)),N,...H.map(U=>kc(U))];W[0].textAlign=d;const $=new oo({width:o?0:a-(n[1]+n[3])-x-T,height:r&&s?0:Math.ceil(h-(n[0]+n[2])),textConfig:W,verticalDirection:r&&s?"top":u,ellipsis:N.ellipsis});$.name="text",O=$,$.bindIconEvent(),!f||f.start.col===f.end.col&&f.start.row===f.end.row||($.onBeforeAttributeUpdate=q6)}if(E.length!==0||k.length!==0){const N=new K6({x:0,y:0,fill:!1,stroke:!1,pickable:!1});N.name="content",N.setCellContentOption({autoWidth:o,autoHeight:r,cellWidth:a-(n[1]+n[3])-x-T,cellHeight:h-(n[0]+n[2]),align:d,baseline:u});const W={addedHierarchyOffset:0};E.forEach($=>{const U=On($,void 0,i.col,i.row,f,c,W);U.role="icon-content-left",U.name=$.name,N.addLeftOccupyingIcon(U)}),k.forEach($=>{const U=On($,void 0,i.col,i.row,f,c,W);U.role="icon-content-right",U.name=$.name,N.addRightOccupyingIcon(U)}),N.addContent(O),i.appendChild(N),N.layout(),R=N.AABBBounds.width(),N.AABBBounds.height()}else i.firstChild?i.insertBefore(O,i.firstChild):i.appendChild(O),R=O.AABBBounds.width(),O.AABBBounds.height()}else if(z(e)){const{text:F,moreThanMaxCharacters:H}=ph(e,c),E=f?lo(f.start.col,f.start.row,c):lo(i.col,i.row,c);let k=0;ft(c.theme._contentOffset)&&(d==="left"?k=c.theme._contentOffset:d==="right"&&(k=-c.theme._contentOffset));const I={text:F.length===1?F[0]:F,moreThanMaxCharacters:H,maxLineWidth:o?1/0:a-(n[1]+n[3]+E),textBaseline:"top",autoWrapText:s,lineClamp:l,wordBreak:"break-word",heightLimit:((p=c.options.customConfig)===null||p===void 0?void 0:p.limitContentHeight)===!1||r&&!(!((m=c.options.customConfig)===null||m===void 0)&&m.multilinesForXTable)?-1:h-Math.floor(n[0]+n[2]),pickable:!1,dx:(d==="left"?E:0)+k,whiteSpace:((b=c.options.customConfig)===null||b===void 0?void 0:b.limitContentHeight)===!1||F.length!==1||s?"normal":"no-wrap"},L=new Hi(g.text?Object.assign({},g.text,I):I);L.name="text",L.textBaseline=u,i.appendChild(L),R=L.AABBBounds.width(),L.AABBBounds.height()}const B=o?x+R+T:a-(n[1]+n[3]),P=h-(n[0]+n[2]);i.forEachChildren(F=>{F.role==="icon-left"?F.setAttribute("x",F.attribute.x+n[3]):F.role==="icon-right"?F.setAttribute("x",F.attribute.x+B-T+n[3]):F.role==="icon-absolute-right"?F.setAttribute("x",F.attribute.x+B-M+n[3]+n[1]):F.name!=="content"&&F.name!=="text"||(d==="center"&&F.type!=="richtext"?F.setAttribute("x",n[3]+x+(B-x-T)/2):d==="right"&&F.type!=="richtext"?F.setAttribute("x",n[3]+B-T):F.setAttribute("x",n[3]+x))}),i.forEachChildren(F=>{F.name!==yo&&(u==="middle"?F.setAttribute("y",n[0]+(P-F.AABBBounds.height())/2):u==="bottom"?F.setAttribute("y",n[0]+P-F.AABBBounds.height()):F.setAttribute("y",n[0]))}),i.setAttributes({width:B+n[1]+n[3],height:P+n[0]+n[2]})}function On(i,t,e,n,o,r,s){var l,a,h,d,u,c;const g={};i.type==="image"?(i.isGif&&(g.gif=i.src),g.image=i.src):(i.type==="svg"||"svg"in i)&&(g.image=i.svg),g.width=i.width,g.height=i.height,g.visibleTime=(l=i.visibleTime)!==null&&l!==void 0?l:"always",g.funcType=i.funcType,g.interactive=i.interactive,g.isGif=i.isGif;let f=0;if(s&&(s==null?void 0:s.addedHierarchyOffset)!==0||!ft(e)||!ft(n)||!r||i.funcType!==ve.collapse&&i.funcType!==ve.expand&&i.positionType!==me.contentLeft&&i.positionType!==me.contentRight||(f=o?lo(o.start.col,o.start.row,r):lo(e,n,r),s&&(s.addedHierarchyOffset=1)),g.marginLeft=((a=i.marginLeft)!==null&&a!==void 0?a:0)+f,g.marginRight=(h=i.marginRight)!==null&&h!==void 0?h:0,i.interactive===!1&&(g.pickable=!1),i.hover&&(g.backgroundWidth=(d=i.hover.width)!==null&&d!==void 0?d:i.width,g.backgroundHeight=(u=i.hover.width)!==null&&u!==void 0?u:i.width,g.backgroundColor=(c=i.hover.bgColor)!==null&&c!==void 0?c:"rgba(22,44,66,0.2)",g.hoverImage=i.hover.image),i.cursor&&(g.cursor=i.cursor),"shape"in i&&i.shape==="circle"&&(g.shape=i.shape),t)return t.setAttributes(g),t.loadImage(g.image),t.tooltip=i.tooltip,t.name=i.name,t;const p=new ps(g);return p.tooltip=i.tooltip,p.name=i.name,p}function kc(i){var t,e,n,o,r,s;const l={};return i.type==="image"?l.image=i.src:(i.type==="svg"||"svg"in i)&&(l.image=i.svg),l.visibleTime=(t=i.visibleTime)!==null&&t!==void 0?t:"always",l.funcType=i.funcType,l.id=i.name,l.width=i.width,l.height=i.height,(i.marginRight||i.marginLeft)&&(l.margin=[0,(e=i.marginRight)!==null&&e!==void 0?e:0,0,(n=i.marginLeft)!==null&&n!==void 0?n:0]),i.hover&&(l.backgroundWidth=(o=i.hover.width)!==null&&o!==void 0?o:i.width,l.backgroundHeight=(r=i.hover.height)!==null&&r!==void 0?r:i.height,l.backgroundShowMode="hover",l.hoverImage=i.hover.image,l.backgroundStroke=!1,l.backgroundFill=(s=i.hover.bgColor)!==null&&s!==void 0?s:"rgba(22,44,66,0.2)"),i.cursor&&(l.cursor=i.cursor),l.tooltip=i.tooltip,l}function Fc(i,t,e,n,o,r,s,l,a){var h,d,u,c;Ae(i.contentWidth)&&(n=t-((h=i.contentWidth)!==null&&h!==void 0?h:i.attribute.width));let g,f=0,p=0,m=0,b=0;i.forEachChildren(S=>{var A,R,x,T;S.role==="icon-left"?(f+=S.AABBBounds.width()+((A=S.attribute.marginLeft)!==null&&A!==void 0?A:0)+((R=S.attribute.marginRight)!==null&&R!==void 0?R:0),p=Math.max(p,S.AABBBounds.height())):S.role==="icon-right"&&(m+=S.AABBBounds.width()+((x=S.attribute.marginLeft)!==null&&x!==void 0?x:0)+((T=S.attribute.marginRight)!==null&&T!==void 0?T:0),b=Math.max(b,S.AABBBounds.height()))});const C=i.getChildByName("text"),_=i.getChildByName("content");let w;C instanceof Hi?(g=C.AABBBounds.height(),C.setAttribute("maxLineWidth",t-f-m-(r[1]+r[3])-((d=C.attribute.dx)!==null&&d!==void 0?d:0)-((u=a.table.theme._contentOffset)!==null&&u!==void 0?u:0)),w=C.AABBBounds.height()):C instanceof oo?(g=C.AABBBounds.height(),C.setAttribute("width",t-f-m-(r[1]+r[3])),w=C.AABBBounds.height()):_&&(g=_.AABBBounds.height(),_.updateWidth(t-f-m-(r[1]+r[3])),w=_.AABBBounds.height());const y=Math.round(Math.max(p,b,g)+r[0]+r[2]);if(i.forEachChildren(S=>{var A;if(S.role!=="icon-left")if(S.role==="icon-right")S.setAttribute("x",S.attribute.x+n);else if(S.role==="icon-absolute-right")S.setAttribute("x",S.attribute.x+n);else if(S.name==="content"||S.name==="text"&&S.type!=="richtext"){const R=(A=S.attribute.textAlign)!==null&&A!==void 0?A:s;R==="center"?S.setAttribute("x",r[3]+f+(t-(r[1]+r[3])-f-m)/2):R==="right"&&S.setAttribute("x",r[3]+t-(r[1]+r[3])-m)}else S.name==="mark"&&S.setAttribute("x",i.attribute.width)}),o){let S=Math.max(p,w,b);if(X6(a,i,Math.round(S+r[0]+r[2]),y))return!0;S=((c=i.contentHeight)!==null&&c!==void 0?c:e)-(r[0]+r[2]),i.forEachChildren(A=>{A.type!=="rect"&&A.type!=="chart"&&A.name!==yo&&(A.name==="mark"?A.setAttribute("y",0):l==="middle"?A.setAttribute("y",r[0]+(S-A.AABBBounds.height())/2):l==="bottom"?A.setAttribute("y",r[0]+S-A.AABBBounds.height()):A.setAttribute("y",r[0]))})}else l!=="middle"&&l!=="bottom"||i.forEachChildren(S=>{S.type!=="rect"&&S.type!=="chart"&&S.name!==yo&&(S.name==="mark"?S.setAttribute("y",0):l==="middle"?S.setAttribute("y",(e-r[2]+r[0]-S.AABBBounds.height())/2):l==="bottom"?S.setAttribute("y",e-S.AABBBounds.height()-r[2]):S.setAttribute("y",r[0]))});return!1}function Ic(i,t,e,n,o,r,s,l){var a;const h=t-Math.floor(o[0]+o[2]),d=i.getChildByName("text");d instanceof Hi&&!n?d.setAttributes({heightLimit:((a=l.options.customConfig)===null||a===void 0?void 0:a.limitContentHeight)===!1?-1:h}):d instanceof oo&&!n?d.setAttributes({height:h}):i.getChildByName("content")&&i.getChildByName("content").updateHeight(h),i.forEachChildren(u=>{u.setAttribute("dy",0),u.type==="rect"||u.type==="chart"||u.name===yo||(u.name==="mark"?u.setAttribute("y",0):s==="middle"?u.setAttribute("y",o[0]+(h-u.AABBBounds.height())/2):s==="bottom"?u.setAttribute("y",o[0]+h-u.AABBBounds.height()):u.setAttribute("y",o[0]))})}function X6(i,t,e,n){const o=i.table,r=ui(o,t.col,t.row);if(r&&r.end.row-r.start.row){n/=r.end.row-r.start.row+1,e/=r.end.row-r.start.row+1;for(let s=r.start.row;s<=r.end.row;s++){const l=o.getRowHeight(s);if(l===n&&e!==l||e>l)return!0}}else{const s=o.getRowHeight(t.row);if(s===n&&e!==s||e>s)return!0}return!1}function Dc(i,t,e,n){const o=[],r=[],s=[],l=[],a=[],h=[],d=[],u=[];let c=0,g=0,f=0,p=0,m=0,b=0;return i.forEach(C=>{switch(C.positionType){case me.left:o.push(C);break;case me.right:r.push(C);break;case me.contentLeft:s.push(C);break;case me.contentRight:l.push(C);break;case me.absoluteRight:u.push(C);break;case me.inlineFront:a.push(C);break;case me.inlineEnd:h.push(C)}}),o.forEach(C=>{var _,w,y;const S=On(C,void 0,t.col,t.row,e,n);S.role="icon-left",S.name=C.name,S.setAttribute("x",c+((_=S.attribute.marginLeft)!==null&&_!==void 0?_:0)),c+=S.AABBBounds.width()+((w=S.attribute.marginLeft)!==null&&w!==void 0?w:0)+((y=S.attribute.marginRight)!==null&&y!==void 0?y:0),g=Math.max(g,S.AABBBounds.height()),t.appendChild(S)}),r.forEach(C=>{var _,w,y;const S=On(C,void 0,t.col,t.row,e,n);S.role="icon-right",S.name=C.name,S.setAttribute("x",f+((_=S.attribute.marginLeft)!==null&&_!==void 0?_:0)),f+=S.AABBBounds.width()+((w=S.attribute.marginLeft)!==null&&w!==void 0?w:0)+((y=S.attribute.marginRight)!==null&&y!==void 0?y:0),p=Math.max(p,S.AABBBounds.height()),t.appendChild(S)}),d.forEach(C=>{var _,w,y;const S=On(C,void 0,t.col,t.row,e,n);S.role="icon-absolute-left",S.name=C.name,S.setAttribute("x",m+((_=S.attribute.marginLeft)!==null&&_!==void 0?_:0)),m+=S.AABBBounds.width()+((w=S.attribute.marginLeft)!==null&&w!==void 0?w:0)+((y=S.attribute.marginRight)!==null&&y!==void 0?y:0),t.appendChild(S)}),u.forEach(C=>{var _,w,y;const S=On(C,void 0,t.col,t.row,e,n);S.role="icon-absolute-right",S.name=C.name,S.setAttribute("x",b+((_=S.attribute.marginLeft)!==null&&_!==void 0?_:0)),b+=S.AABBBounds.width()+((w=S.attribute.marginLeft)!==null&&w!==void 0?w:0)+((y=S.attribute.marginRight)!==null&&y!==void 0?y:0),t.appendChild(S)}),{leftIcons:o,rightIcons:r,contentLeftIcons:s,contentRightIcons:l,inlineFrontIcons:a,inlineEndIcons:h,absoluteLeftIcons:d,absoluteRightIcons:u,leftIconWidth:c,leftIconHeight:g,rightIconWidth:f,rightIconHeight:p,absoluteLeftIconWidth:m,absoluteRightIconWidth:b}}function q6(i,t){if(i.hasOwnProperty("hoverIconId")){const e=this;if(e.skipMergeUpdate)return;const n=Hr(e);if(!n||!n.stage)return;const o=n.stage.table;e.skipAttributeUpdate=!0;const{mergeStartCol:r,mergeEndCol:s,mergeStartRow:l,mergeEndRow:a}=n;if(z(r)&&z(s)&&z(l)&&z(a)&&(r!==s||l!==a)){for(let h=r;h<=s;h++)for(let d=l;d<=a;d++){if(h===n.col&&d===n.row){if(i.hoverIconId!==e.attribute.hoverIconId){const c=e._frameCache.icons.get(i.hoverIconId);e.updateHoverIconState(c)}continue}const u=o.scenegraph.highPerformanceGetCell(h,d);if(u.role==="cell"){const c=u.getChildByName(e.name,!0);if(!c||c.skipAttributeUpdate)continue;i.hoverIconId!==c.attribute.hoverIconId&&(c.setAttribute("hoverIconId",i.hoverIconId),u.addUpdateBoundTag())}}e.skipAttributeUpdate=void 0}}}function Z6(i,t,e,n,o,r,s,l,a,h,d,u,c,g,f,p,m){var b,C,_,w,y,S,A,R,x,T,M,B,P,F,H,E,k,I,L,D,O,N,W,$,U,Y,j,G,X,ht;const gt=g._getCellStyle(n,o),Ct=Lc("padding",gt,n,o,g);!((b=g.options.customConfig)===null||b===void 0)&&b.imageMargin?h=Qt((C=g.options.customConfig)===null||C===void 0?void 0:C.imageMargin):z(Ct)&&(h=Ct),!((_=f==null?void 0:f.text)===null||_===void 0)&&_.textAlign&&(d=(w=f==null?void 0:f.text)===null||w===void 0?void 0:w.textAlign),!((y=f==null?void 0:f.text)===null||y===void 0)&&y.textBaseline&&(u=(S=f==null?void 0:f.text)===null||S===void 0?void 0:S.textBaseline);const Q=ws(n,o,f,g);let et,vt;if(m&&(et=g.scenegraph.highPerformanceGetCell(n,o,!0),et&&et.role==="cell"&&et.setAttributes({x:t,y:e,width:r,height:s,lineWidth:(R=(A=f==null?void 0:f.group)===null||A===void 0?void 0:A.lineWidth)!==null&&R!==void 0?R:void 0,fill:(T=(x=f==null?void 0:f.group)===null||x===void 0?void 0:x.fill)!==null&&T!==void 0?T:void 0,stroke:(B=(M=f==null?void 0:f.group)===null||M===void 0?void 0:M.stroke)!==null&&B!==void 0?B:void 0,strokeArrayWidth:Q??void 0,strokeArrayColor:(F=(P=f==null?void 0:f.group)===null||P===void 0?void 0:P.strokeArrayColor)!==null&&F!==void 0?F:void 0,cursor:(E=(H=f==null?void 0:f.group)===null||H===void 0?void 0:H.cursor)!==null&&E!==void 0?E:void 0,lineDash:(I=(k=f==null?void 0:f.group)===null||k===void 0?void 0:k.lineDash)!==null&&I!==void 0?I:void 0,lineCap:"butt",clip:!0,cornerRadius:f.group.cornerRadius})),et&&et.role==="cell"||(et=new de({x:t,y:e,width:r,height:s,lineWidth:(D=(L=f==null?void 0:f.group)===null||L===void 0?void 0:L.lineWidth)!==null&&D!==void 0?D:void 0,fill:(N=(O=f==null?void 0:f.group)===null||O===void 0?void 0:O.fill)!==null&&N!==void 0?N:void 0,stroke:($=(W=f==null?void 0:f.group)===null||W===void 0?void 0:W.stroke)!==null&&$!==void 0?$:void 0,strokeArrayWidth:Q??void 0,strokeArrayColor:(Y=(U=f==null?void 0:f.group)===null||U===void 0?void 0:U.strokeArrayColor)!==null&&Y!==void 0?Y:void 0,cursor:(G=(j=f==null?void 0:f.group)===null||j===void 0?void 0:j.cursor)!==null&&G!==void 0?G:void 0,lineDash:(ht=(X=f==null?void 0:f.group)===null||X===void 0?void 0:X.lineDash)!==null&&ht!==void 0?ht:void 0,lineCap:"butt",clip:!0,cornerRadius:f.group.cornerRadius}),et.role="cell",et.col=n,et.row=o,i==null||i.addCellGroup(et)),c){let _t=n,ct=o;p&&(_t=p.start.col,ct=p.start.row),vt=g.getCellIcons(_t,ct)}let bt=0,dt=0,ot=0;if(Array.isArray(vt)&&vt.length!==0){const{leftIconWidth:_t,rightIconWidth:ct,absoluteLeftIconWidth:Wt,absoluteRightIconWidth:Yt}=Dc(vt,et,p,g);bt=_t+ct,dt=_t,ot=ct,et.forEachChildren(yt=>{yt.role==="icon-left"?yt.setAttribute("x",yt.attribute.x+h[3]):yt.role==="icon-right"?yt.setAttribute("x",yt.attribute.x+r-ct-h[1]):yt.role==="icon-absolute-right"&&yt.setAttribute("x",yt.attribute.x+r-Yt-h[1])}),et.forEachChildren(yt=>{u==="middle"?yt.setAttribute("y",(s-yt.AABBBounds.height())/2):u==="bottom"?yt.setAttribute("y",s-yt.AABBBounds.height()-h[2]):yt.setAttribute("y",h[0])}),et._cellLeftIconWidth=dt,et._cellRightIconWidth=ot}const ut=g.getCellValue(n,o),st=gu({x:h[3],y:h[0],width:r-h[1]-h[3]-bt,height:s-h[0]-h[2],image:ut,cursor:"pointer"});return st.name="image",st.keepAspectRatio=l,st.textAlign=d,st.textBaseline=u,l||a?st.resources&&st.resources.has(st.attribute.image)&&st.resources.get(st.attribute.image).state==="success"?setTimeout(()=>{uR(a,l,h,d,u,st,et,g)},0):st.successCallback=()=>{uR(a,l,h,d,u,st,et,g),g.scenegraph.updateNextFrame()}:st.resources&&st.resources.has(st.attribute.image)&&st.resources.get(st.attribute.image).state==="success"?mh(et,n,o,0,0,g):st.successCallback=()=>{mh(et,n,o,0,0,g)},st.failCallback=()=>{const _t=vn();st.image=_t.damage_pic.svg},et.appendChild(st),et}function dR(i,t,e,n,o,r,s){let l=!1,a=null,h=null;const{width:d,height:u,isMerge:c}=wl(s,o.table);if(d<e+r[1]+r[3]&&(a=e+r[1]+r[3],l=!0),u<n+r[2]+r[0]&&(h=n+r[2]+r[0],l=!0),l){if(typeof a=="number")if(c)for(let g=s.mergeStartCol;g<=s.mergeEndCol;g++)o.setColWidth(g,a/(s.mergeEndCol-s.mergeStartCol+1));else o.setColWidth(i,a);if(typeof h=="number")if(c)for(let g=s.mergeStartRow;g<=s.mergeEndRow;g++)o.setRowHeight(g,h/(s.mergeEndRow-s.mergeStartRow+1));else o.setRowHeight(t,h);return o.component.updateScrollBar(),!0}return!1}function mh(i,t,e,n,o,r){var s,l,a,h,d,u,c,g,f,p,m,b;const C=i.getChildByName("image");if(!C)return;const _=typeof C.attribute.image!="string"&&C.attribute.image||((s=C.resources)===null||s===void 0?void 0:s.get(C.attribute.image).data);if(!_)return;const w=r._getCellStyle(t,e),y=(l=wt("textAlign",w,t,e,r))!==null&&l!==void 0?l:"left",S=(a=wt("textBaseline",w,t,e,r))!==null&&a!==void 0?a:"middle";let A;A=!((h=r.options.customConfig)===null||h===void 0)&&h.imageMargin?Qt((d=r.options.customConfig)===null||d===void 0?void 0:d.imageMargin):(u=Qt(wt("padding",w,t,e,r)))!==null&&u!==void 0?u:[0,0,0,0];const{width:R,height:x,isMerge:T}=wl(i,r),M=(c=i.mergeStartCol)!==null&&c!==void 0?c:i.col,B=(g=i.mergeStartRow)!==null&&g!==void 0?g:i.row,P=(f=i.mergeEndCol)!==null&&f!==void 0?f:i.col,F=(p=i.mergeEndCol)!==null&&p!==void 0?p:i.row,H=(m=i._cellLeftIconWidth)!==null&&m!==void 0?m:0,E=(b=i._cellRightIconWidth)!==null&&b!==void 0?b:0;if(C.keepAspectRatio){const{width:k,height:I}=Ec(_.width||_.videoWidth,_.height||_.videoHeight,R-(A[1]+A[3]),x-(A[0]+A[2])),L=Bm(0,0,R,x,k,I,y,S,A);for(let D=M;D<=P;D++)for(let O=B;O<=F;O++){const N=r.scenegraph.getCell(D,O).getChildByName("image");N==null||N.setAttributes({x:L.x,y:L.y,width:k,height:I})}}else for(let k=M;k<=P;k++)for(let I=B;I<=F;I++){const L=r.scenegraph.getCell(k,I).getChildByName("image");L==null||L.setAttributes({x:H+A[3],y:A[0],width:R-A[1]-A[3]-E-H,height:x-A[0]-A[2]})}if(i.getChildByName("play-icon")){const{width:L,height:D}=wl(i,r),O=Math.floor(Math.min(L-A[1]-A[3],D-A[2]-A[0])/2),N=0+(L>C.attribute.width?C.attribute.x-0+C.attribute.width/2:L/2),W=0+(D>C.attribute.height?C.attribute.y-0+C.attribute.height/2:D/2);for(let $=M;$<=P;$++)for(let U=B;U<=F;U++)r.scenegraph.getCell($,U).getChildByName("play-icon").setAttributes({x:N-O/2,y:W-O/2,width:O,height:O})}i.forEachChildren(k=>{k.role==="icon-left"||(k.role==="icon-right"||k.role==="icon-absolute-right")&&k.setAttribute("x",k.attribute.x+n)}),i.forEachChildren(k=>{(k.type==="rect"||k.role&&k.role.startsWith("icon"))&&(S==="middle"?k.setAttribute("y",A[0]+(x-A[0]-A[2]-k.AABBBounds.height())/2):S==="bottom"?k.setAttribute("y",A[0]+x-A[0]-A[2]-k.AABBBounds.height()):k.setAttribute("y",A[0]))}),T&&Pm(i.mergeStartCol,i.mergeEndCol,i.mergeStartRow,i.mergeEndRow,r)}function wl(i,t){return i.role==="cell"&&z(i.mergeStartCol)&&z(i.mergeEndCol)&&z(i.mergeStartRow)&&z(i.mergeEndRow)?{width:t.getColsWidth(i.mergeStartCol,i.mergeEndCol),height:t.getRowsHeight(i.mergeStartRow,i.mergeEndRow),isMerge:!0}:{width:i.attribute.width,height:i.attribute.height,isMerge:!1}}function Pm(i,t,e,n,o){for(let r=i;r<=t;r++)for(let s=e;s<=n;s++){const l=o.scenegraph.getCell(r,s);if(l){const a=l.getChildByName("image");a&&a.setAttributes({dx:-o.getColsWidth(l.mergeStartCol,r-1),dy:-o.getRowsHeight(l.mergeStartRow,s-1)});const h=l.getChildByName("play-icon");h&&h.setAttributes({dx:-o.getColsWidth(l.mergeStartCol,r-1),dy:-o.getRowsHeight(l.mergeStartRow,s-1)})}}}function uR(i,t,e,n,o,r,s,l){const a=r.resources.get(r.attribute.image).data,{col:h,row:d}=s;if(i&&!cR(r)&&dR(h,d,a.width,a.height,l.scenegraph,e,s),t||cR(r)){const{width:u,height:c,isMerge:g}=wl(s,l),{width:f,height:p}=Ec(a.width,a.height,u-e[1]-e[3],c-e[0]-e[2]),m=Bm(0,0,u,c,f,p,n,o,e);r.setAttributes({x:m.x,y:m.y,width:f,height:p}),g&&Pm(s.mergeStartCol,s.mergeEndCol,s.mergeStartRow,s.mergeEndRow,l)}}function cR(i){const t=vn();return i.attribute.image===t.damage_pic.svg}function gR(i,t,e){i.then(()=>{e(),t.scenegraph.updateNextFrame()}).catch(n=>{})}function J6(i,t){return!i&&!t||!(!i||!t)&&i.start.col===t.start.col&&i.start.row===t.start.row&&i.end.col===t.end.col&&i.end.row===t.end.row}class Q6{constructor(t,e){var n,o;this.table=t,this._fill=(n=e==null?void 0:e.fill)!==null&&n!==void 0?n:"#000",this._opacity=(o=e==null?void 0:e.opacity)!==null&&o!==void 0?o:.5}setInvertHighlightRange(t){J6(this.range,t)||(this.range=t,t?this.updateCellGroupShadow():this.deleteAllCellGroupShadow(),this.table.scenegraph.updateNextFrame())}deleteAllCellGroupShadow(){this.table.isPivotTable()||(this.updateCellGroupShadowInContainer(this.table.scenegraph.rowHeaderGroup),this.updateCellGroupShadowInContainer(this.table.scenegraph.leftBottomCornerGroup)),this.updateCellGroupShadowInContainer(this.table.scenegraph.bodyGroup),this.updateCellGroupShadowInContainer(this.table.scenegraph.rightFrozenGroup),this.updateCellGroupShadowInContainer(this.table.scenegraph.bottomFrozenGroup),this.updateCellGroupShadowInContainer(this.table.scenegraph.rightBottomCornerGroup)}updateCellGroupShadow(){this.table.isPivotTable()||(this.updateCellGroupShadowInContainer(this.table.scenegraph.rowHeaderGroup,this.range),this.updateCellGroupShadowInContainer(this.table.scenegraph.leftBottomCornerGroup,this.range)),this.updateCellGroupShadowInContainer(this.table.scenegraph.bodyGroup,this.range),this.updateCellGroupShadowInContainer(this.table.scenegraph.rightFrozenGroup,this.range),this.updateCellGroupShadowInContainer(this.table.scenegraph.bottomFrozenGroup),this.range,this.updateCellGroupShadowInContainer(this.table.scenegraph.rightBottomCornerGroup,this.range)}updateCellGroupShadowInContainer(t,e){t.forEachChildrenSkipChild(n=>{n.role==="column"&&n.forEachChildrenSkipChild(o=>{if(o.role!=="cell")return;o.attachShadow(o.shadowRoot);const r=o.shadowRoot;if(e){if(Yi(e,o.col,o.row))r.removeAllChild();else if(!r.firstChild){const s=Fe({x:0,y:0,width:o.attribute.width,height:o.attribute.height,fill:this._fill,opacity:this._opacity});s.name="shadow-rect",r.appendChild(s)}}else r.removeAllChild()})})}}function fR(i,t){var e,n;const o=this;if(o.shadowRoot&&o.shadowRoot.childrenCount&&(z(i.width)||z(i.height))){const r=o.shadowRoot.findChildrenByName("shadow-rect")[0];r&&r.setAttributes({width:(e=i.width)!==null&&e!==void 0?e:r.attribute.width,height:(n=i.height)!==null&&n!==void 0?n:r.attribute.height})}}function Hm(i,t,e,n,o,r,s,l,a,h,d,u,c,g,f,p,m,b){var C,_;let w,y=!1;if(so(t)){if(n.scenegraph.highPerformanceGetCell(o,r).role!=="cell")return w;t=n.getCellValue(o,r),y=!0}if(i==="text"||i==="link"||b){if(i==="link"){const x=t,T=n._getCellStyle(o,r);i==="link"&&("templateLink"in e&&e.templateLink||!("linkDetect"in e)||!e.linkDetect||um.test(x))&&(p?(p.text.fill=wt("linkColor",T,o,r,n),p.group.cursor="pointer"):p={text:{fill:wt("linkColor",T,o,r,n)},group:{cursor:"pointer"}})}let S,A=!0;if(b)S=b.elementsGroup,A=b.renderDefault;else{let x,T;if(n.getCellLocation(o,r)!=="body"?(x=e==null?void 0:e.headerCustomRender,T=e==null?void 0:e.headerCustomLayout):(x=(e==null?void 0:e.customRender)||n.customRender,T=e==null?void 0:e.customLayout),T||x){const M=Er(T,x,o,r,l,a,!1,n.isAutoRowHeight(r),u,m,n);S=M.elementsGroup,A=M.renderDefault}}w=Bt.getFunction("createTextCellGroup")(n,t,h,0,d,o,r,s,l,a,u,c,g,f,S,A,p,m,y);const R=n.internalProps.layoutMap.getAxisConfigInPivotChart(o,r);if(R){const x=new(Bt.getComponent("axis"))(R,w.attribute.width,w.attribute.height,(C=R.__vtablePadding)!==null&&C!==void 0?C:u,n);w.clear(),w.appendChild(x.component),x.overlap()}else n.internalProps.layoutMap.isEmpty(o,r)?(w.setAttributes({fill:!1,stroke:!1}),w.clear()):n.internalProps.layoutMap.isAxisCell(o,r)&&w.clear()}else if(i==="image")w=Bt.getFunction("createImageCellGroup")(h,0,d,o,r,l,a,e.keepAspectRatio,e.imageAutoSizing,u,c,g,f,n,p,m,y);else if(i==="video")w=Bt.getFunction("createVideoCellGroup")(h,0,d,o,r,l,a,e.keepAspectRatio,e.imageAutoSizing,u,c,g,f,n,p,m,y);else if(i==="chart"){const S=n.internalProps.layoutMap.getChartInstance(o,r);w=Bt.getFunction("createChartCellGroup")(null,h,0,d,o,r,l,a,u,t,e.chartModule,n.internalProps.layoutMap.getChartSpec(o,r),S,(_=n.internalProps.layoutMap.getChartDataId(o,r))!==null&&_!==void 0?_:"data",n,p,n.internalProps.layoutMap.isShareChartSpec(o,r),y,n.internalProps.layoutMap.isNoChartDataRenderNothing(o,r))}else if(i==="progressbar"){const S=n._getCellStyle(o,r),A=n.getCellOriginValue(o,r);w=Bt.getFunction("createTextCellGroup")(n,t,h,0,d,o,r,s,l,a,u,c,g,!1,null,!0,p,m,y);const R=Bt.getFunction("createProgressBarCell")(e,S,s,t,A,o,r,u,n,m);w.firstChild?w.insertBefore(R,w.firstChild):w.appendChild(R)}else i==="sparkline"?w=Bt.getFunction("createSparkLineCellGroup")(null,h,0,d,o,r,l,a,u,n,p,y):i==="checkbox"?w=Bt.getFunction("createCheckboxCellGroup")(null,h,0,d,o,r,s,l,a,u,c,g,f,n,p,e,m,y):i==="radio"&&(w=Bt.getFunction("createRadioCellGroup")(null,h,0,d,o,r,s,l,a,u,c,g,n,p,e));return w.onBeforeAttributeUpdate=fR,w}function _o(i,t,e,n,o){var r,s,l,a,h,d,u,c,g,f,p,m,b,C,_,w,y,S,A,R;const x=e.scenegraph.highPerformanceGetCell(i,t,!0),T=e.getCellLocation(i,t);let M,B,P,F,H=e.getCellValue(i,t),E=!1;if(e.internalProps.customMergeCell){const Ct=e.getCustomMerge(i,t);if(Ct){const{range:Q,text:et,style:vt,customLayout:bt,customRender:dt}=Ct;B=Q,M=B.start.col!==B.end.col||B.start.row!==B.end.row,H=et,P=vt,(bt||dt)&&(F=Er(bt,dt,Q.start.col,Q.start.row,e.getColsWidth(Q.start.col,Q.end.col),e.getRowsHeight(Q.start.row,Q.end.row),!1,e.isAutoRowHeight(t),[0,0,0,0],B,e)),E=!0}}let k=i,I=t;B&&(k=B.start.col,I=B.start.row);const L=T!=="body"?e.getHeaderDefine(k,I):e.getBodyColumnDefine(k,I);let D=T!=="body"||(L==null?void 0:L.dragOrder)||!!(L!=null&&L.icon)||!!(L!=null&&L.tree);B||!e.internalProps.enableTreeNodeMerge&&T==="body"&&!(L!=null&&L.mergeCell)||(B=e.getCellRange(i,t),M=B.start.col!==B.end.col||B.start.row!==B.end.row);let O=!1;if(e.internalProps.enableTreeNodeMerge&&M){const Ct=e.getCellRawRecord(B.start.col,B.start.row),{vtableMergeName:Q,vtableMerge:et}=Ct??{};O=et,et&&(D=!0,e.options.groupTitleCustomLayout&&(F=Er(e.options.groupTitleCustomLayout,void 0,B.start.col,B.start.row,e.getColsWidth(B.start.col,B.end.col),e.getRowsHeight(B.start.row,B.end.row),!1,e.isAutoRowHeight(t),[0,0,0,0],B,e))),Q&&(H=Q)}const N=P||e._getCellStyle(B?B.start.col:i,B?B.start.row:t),W=(r=N.autoWrapText)!==null&&r!==void 0?r:e.internalProps.autoWrapText,$=Pr(N,e,M?B.start.col:i,M?B.start.row:t,wt).theme;if($.group.cornerRadius=Rc(i,t,e),!n&&!M&&!(L!=null&&L.customLayout||L!=null&&L.customRender||L!=null&&L.headerCustomLayout||L!=null&&L.headerCustomRender)&&tW(i,t,x,W,D,e)){const Ct=e.getColWidth(i),Q=e.getRowHeight(t);x.setAttributes({width:Ct,height:Q,lineWidth:(l=(s=$==null?void 0:$.group)===null||s===void 0?void 0:s.lineWidth)!==null&&l!==void 0?l:void 0,fill:(h=(a=$==null?void 0:$.group)===null||a===void 0?void 0:a.fill)!==null&&h!==void 0?h:void 0,stroke:(u=(d=$==null?void 0:$.group)===null||d===void 0?void 0:d.stroke)!==null&&u!==void 0?u:void 0,strokeArrayWidth:(g=(c=$==null?void 0:$.group)===null||c===void 0?void 0:c.strokeArrayWidth)!==null&&g!==void 0?g:void 0,strokeArrayColor:(p=(f=$==null?void 0:$.group)===null||f===void 0?void 0:f.strokeArrayColor)!==null&&p!==void 0?p:void 0,cursor:(b=(m=$==null?void 0:$.group)===null||m===void 0?void 0:m.cursor)!==null&&b!==void 0?b:void 0,cornerRadius:(_=(C=$==null?void 0:$.group)===null||C===void 0?void 0:C.cornerRadius)!==null&&_!==void 0?_:0,lineDash:(y=(w=$==null?void 0:$.group)===null||w===void 0?void 0:w.lineDash)!==null&&y!==void 0?y:void 0,y:e.scenegraph.getCellGroupY(t)}),x.forEachChildren(vt=>{vt.setAttributes({dx:0,dy:0})});const et=x.getChildByName("text");if(et){const vt=e.getCellValue(i,t),{text:bt,moreThanMaxCharacters:dt}=ph(vt,e),ot=lo(i,t,e),ut=N.lineClamp,st=(S=Qt(wt("padding",N,i,t,e)))!==null&&S!==void 0?S:[0,0,0,0],_t=$.text.textAlign;let ct=0;ct=_t==="center"?st[3]+(Ct-(st[1]+st[3]))/2:_t==="right"?st[3]+Ct-(st[1]+st[3]):st[3];const Wt={text:bt.length!==1||W?bt:bt[0],moreThanMaxCharacters:dt,maxLineWidth:Ct-(st[1]+st[3]+ot),textBaseline:"top",autoWrapText:W,lineClamp:ut,wordBreak:"break-word",heightLimit:Q-Math.floor(st[0]+st[2]),pickable:!1,dx:_t==="left"?ot:0,x:ct};if(et.setAttributes($.text?Object.assign({},$.text,Wt):Wt),et.attribute.text){const Yt=$.text.textBaseline,yt=Q-(st[0]+st[2]);let mt=0;mt=Yt==="middle"?st[0]+(yt-et.AABBBounds.height())/2:Yt==="bottom"?st[0]+yt-et.AABBBounds.height():st[0],et.setAttributes({y:mt})}}return x}if(!n&&x.role==="empty")return;const U=O||E?"text":e.isHeader(i,t)?(A=e._getHeaderLayoutMap(i,t).headerType)!==null&&A!==void 0?A:"text":(R=e.getBodyColumnType(i,t))!==null&&R!==void 0?R:"text",Y=$._vtable.padding,j=$.text.textAlign,G=$.text.textBaseline;let X,ht,gt;if(B?(ht=e.getColsWidth(B.start.col,B.end.col),gt=e.getRowsHeight(B.start.row,B.end.row)):(ht=e.getColWidth(i),gt=e.getRowHeight(t)),so(H)?(x.removeAllChild(),gR(H,e,eW.bind(null,{type:U,value:H,define:L,table:e,col:i,row:t,cellWidth:ht,cellHeight:gt,oldCellGroup:x,padding:Y,textAlign:j,textBaseline:G,mayHaveIcon:D,addNew:n,range:B,customResult:F,customStyle:P}))):X=pR(U,H,L,e,i,t,ht,gt,x,Y,j,G,D,n,$,B,F),M){const{width:Ct}=X.attribute,{height:Q}=X.attribute;X.contentWidth=Ct,X.contentHeight=Q,o?iW(B,ht,gt,Y,j,G,e,X):mR(B,ht,gt,Y,j,G,e)}return X}function pR(i,t,e,n,o,r,s,l,a,h,d,u,c,g,f,p,m){var b,C;if(so(t)&&(t=n.getCellValue(o,r)),!g&&(a.row!==r||a.col!==o))return null;if(!g&&a.parent&&n.reactCustomLayout){const w=a.getChildByName("custom-container");if(w){const{col:y,row:S}=w;n.reactCustomLayout.removeCustomCell(y,S)}}const _=Hm(i,t,e,n,o,r,n.getColWidth(o),s,l,g?n.scenegraph.getColGroup(o):a.parent,g?0:n.scenegraph.getCellGroupY(r),h,d,u,c,f,p,m);return!g&&a.parent&&(a.parent.insertAfter(_,a),a.parent.removeChild(a),!((b=n.scenegraph)===null||b===void 0)&&b.proxy.cellCache.get(o)&&((C=n.scenegraph)===null||C===void 0||C.proxy.cellCache.set(o,_))),_}function tW(i,t,e,n,o,r){var s;const l=r.getBodyColumnType(i,t),a=r.isAutoRowHeight(t),h=r.getCellValue(i,t);return!(r.isHeader(i,t)||e.role!=="cell"||l!=="text"||n||a||o||((s=e.firstChild)===null||s===void 0?void 0:s.type)!=="text"||so(h))}function eW(i){const{type:t,value:e,define:n,table:o,col:r,row:s,cellWidth:l,cellHeight:a,oldCellGroup:h,padding:d,textAlign:u,textBaseline:c,mayHaveIcon:g,addNew:f,range:p,customResult:m,customStyle:b}=i,C=b||o._getCellStyle(p?p.start.col:r,p?p.start.row:s),_=Pr(C,o,p?p.start.col:r,p?p.start.row:s,wt).theme;_.group.cornerRadius=Rc(r,s,o),pR(t,e,n,o,r,s,l,a,h,d,u,c,g,f,_,p,m)}function mR(i,t,e,n,o,r,s){for(let l=i.start.col;l<=i.end.col;l++)for(let a=i.start.row;a<=i.end.row;a++){const h=s.scenegraph.highPerformanceGetCell(l,a,!0);if(h.role!=="cell")continue;i.start.row!==i.end.row&&h.contentHeight!==e&&Ic(h,e,e,s.isAutoRowHeight(a),n,o,r,s),i.start.col!==i.end.col&&h.contentWidth!==t&&Fc(h,t,e,0,s.isAutoRowHeight(a),n,o,r,s.scenegraph),h.contentWidth=t,h.contentHeight=e;const d=s.getRowHeight(a);vh(h,s.getColWidth(l),d,i,s)}}function iW(i,t,e,n,o,r,s,l){const{col:a,row:h}=l;i.start.row!==i.end.row&&l.contentHeight!==e&&Ic(l,e,e,s.isAutoRowHeight(h),n,o,r,s),i.start.col!==i.end.col&&l.contentWidth!==t&&Fc(l,t,e,0,s.isAutoRowHeight(h),n,o,r,s.scenegraph),l.contentWidth=t,l.contentHeight=e;const d=s.getRowHeight(h);vh(l,s.getColWidth(a),d,i,s)}function vh(i,t,e,n,o){var r,s;const{col:l,row:a}=i,h=-o.getColsWidth(n.start.col,l-1);let d=0;if(!((r=o.options.customConfig)===null||r===void 0)&&r._disableColumnAndRowSizeRound)for(let m=n.start.row;m<=a-1;m++)d-=o.getRowHeight(m);else d=-o.getRowsHeight(n.start.row,a-1);i.forEachChildren(m=>{var b,C,_,w,y,S;typeof m._dx=="number"?(m.skipMergeUpdate=!0,m.setAttributes({dx:((b=m._dx)!==null&&b!==void 0?b:0)+h}),m.skipMergeUpdate=!1):(m.skipMergeUpdate=!0,m._dx=(C=m.attribute.dx)!==null&&C!==void 0?C:0,m.setAttributes({dx:((_=m.attribute.dx)!==null&&_!==void 0?_:0)+h}),m.skipMergeUpdate=!1),typeof m._dy=="number"?(m.skipMergeUpdate=!0,m.setAttributes({dy:((w=m._dy)!==null&&w!==void 0?w:0)+d}),m.skipMergeUpdate=!1):(m._dy=(y=m.attribute.dy)!==null&&y!==void 0?y:0,m.skipMergeUpdate=!0,m.setAttributes({dy:((S=m.attribute.dy)!==null&&S!==void 0?S:0)+d}),m.skipMergeUpdate=!1)});const u=(s=i.attribute.strokeArrayWidth)!==null&&s!==void 0?s:i.attribute.lineWidth,c=lt(u),g=[0,0,0,0];l===n.start.col&&(g[3]=c?u[3]:u),a===n.start.row&&(g[0]=c?u[0]:u),l===n.end.col&&(g[1]=c?u[1]:u),a===n.end.row&&(g[2]=c?u[2]:u);const f=t!==i.attribute.width,p=e!==i.attribute.height;return i.skipMergeUpdate=!0,i.setAttributes({width:t,height:e,strokeArrayWidth:g}),i.skipMergeUpdate=!1,i.mergeStartCol=n.start.col,i.mergeStartRow=n.start.row,i.mergeEndCol=n.end.col,i.mergeEndRow=n.end.row,{widthChange:f,heightChange:p}}function Oc(i,t,e,n){if(n.internalProps.customMergeCell){const o=n.getCustomMerge(i,t);if(o){const{range:r,text:s,style:l,customLayout:a,customRender:h}=o;if(a||h){const d=Er(a,h,r.start.col,r.start.row,n.getColsWidth(r.start.col,r.end.col),n.getRowsHeight(r.start.row,r.end.row),!1,n.isAutoRowHeight(t),[0,0,0,0],r,n).elementsGroup;e.childrenCount>0&&d?e.insertBefore(d,e.firstChild):d&&e.appendChild(d);const u=n.getRowHeight(t),c=n.getColWidth(i),{width:g}=e.attribute,{height:f}=e.attribute;return e.contentWidth=g,e.contentHeight=f,vh(e,c,u,r,n),r}}}}function Lr(i){return!!(i.role==="cell"&&ft(i.mergeStartCol)&&ft(i.mergeStartRow)&&ft(i.mergeEndCol)&&ft(i.mergeEndRow))}const Em=new Rr({}),Lm=new Qa({});function nW(i,t,e,n,o,r,s,l,a,h,d,u,c,g,f){const p=ge(i)?i.text:i,m=om(p).split(`
|
|
124
124
|
`)||[],b=f.getColsWidth(t,n),C=wt("size",o,t,e,f);let _=0;if(r){const w=wt("spaceBetweenTextAndIcon",o,t,e,f),y=b-(g[1]+g[3])-s-C-w;Em.setAttributes({text:{maxLineWidth:y,text:m,fontSize:l,fontStyle:a,fontWeight:h,fontFamily:d,lineHeight:u,wordBreak:"break-word",lineClamp:c},icon:{width:Math.floor(C/1.4),height:Math.floor(C/1.4)},box:{width:C,height:C},spaceBetweenTextAndIcon:w}),Em.render(),_=Em.AABBBounds.height()}else _=Math.max(C,m.length*u);return _}function oW(i,t,e,n,o,r,s,l,a,h,d,u,c,g,f){var p;if(lt(i)){let m=0;const b=f.getBodyColumnDefine(t,e),C=wt("spaceBetweenRadio",o,t,e,f),_=(p=b==null?void 0:b.radioDirectionInCell)!==null&&p!==void 0?p:"vertical";return _==="vertical"?i.forEach((w,y)=>{const S=km(w,t,e,n,o,r,s,l,a,h,d,u,c,g,f);m+=S,y!==i.length-1&&(m+=C)}):_==="horizontal"&&i.forEach(w=>{const y=km(w,t,e,n,o,r,s,l,a,h,d,u,c,g,f);m=Math.max(y,m)}),m}return km(i,t,e,n,o,r,s,l,a,h,d,u,c,g,f)}function km(i,t,e,n,o,r,s,l,a,h,d,u,c,g,f){const p=ge(i)?i.text:i,m=om(p).split(`
|
|
125
125
|
`)||[],b=f.getColsWidth(t,n),C=wt("size",o,t,e,f);let _=wt("outerRadius",o,t,e,f);const w=ft(_)?2*_:C;let y=0;if(r){const S=wt("spaceBetweenTextAndIcon",o,t,e,f),A=b-(g[1]+g[3])-s-w-S;ft(_)||(_=Math.round(C/2)),Lm.setAttributes({text:{maxLineWidth:A,text:m,fontSize:l,fontStyle:a,fontWeight:h,fontFamily:d,lineHeight:u,wordBreak:"break-word",lineClamp:c},circle:{outerRadius:_},spaceBetweenTextAndIcon:S}),Lm.render(),y=Lm.AABBBounds.height()}else y=Math.max(C,m.length*u);return y}let vR="",bh="quick";const rW=new Ut((i,t,e,n)=>{e(zo)?n(zo).to(bR).inSingletonScope():i(zo).to(bR).inSingletonScope()}),sW=new Ut((i,t,e,n)=>{e(zo)?n(zo).to(Xs).inSingletonScope():i(zo).to(Xs).inSingletonScope()}),Fm=new Map;function zc(i,t,e,n="normal"){const o=`${i}-${t}-${e}-${n}`,r=Fm.get(o);if(r)return r;const s=(l={fontSize:i,fontFamily:e,fontWeight:t,fontStyle:n},new yi(Object.assign({defaultFontParams:{fontFamily:Pn.fontFamily,fontSize:Pn.fontSize},getTextBounds:h?void 0:Qd,specialCharSet:`{}()//&-/: .,@%'"~…=——${yi.ALPHABET_CHAR_SET}${yi.ALPHABET_CHAR_SET.toUpperCase()}0123456789${vR}`},a??{}),l));var l,a,h;return Fm.set(o,s),s}class bR extends Xs{measureTextWidth(t,e){const{fontSize:n,fontFamily:o="Arial,sans-serif",fontWeight:r="normal",fontStyle:s="normal"}=e;return zc(n,r,o,s).measure(t,bh).width}measureText(t,e){const{fontSize:n,fontFamily:o="Arial,sans-serif",fontWeight:r="normal",fontStyle:s="normal"}=e;return zc(n,r,o,s).measure(t,bh)}}class lW{measureText(t,e){const{fontSize:n,fontFamily:o="Arial,sans-serif",fontWeight:r="normal",fontStyle:s="normal"}=e;return zc(n,r,o,s).measure(t,bh)}measureTextWidth(t,e){const{fontSize:n,fontFamily:o="Arial,sans-serif",fontWeight:r="normal",fontStyle:s="normal"}=e;return zc(n,r,o,s).measure(t,bh).width}clipText(t,e,n){if(t.length===0)return{str:"",width:0};let o=this.measureTextWidth(t,e);return o<=n?{str:t,width:o}:(o=this.measureTextWidth(t[0],e),o>n?{str:"",width:0}:this._clipText(t,e,n,0,t.length-1))}_clipText(t,e,n,o,r){const s=Math.floor((o+r)/2),l=t.substring(0,s+1),a=this.measureTextWidth(l,e);let h;if(a>n){if(l.length<=1)return{str:"",width:0};const d=t.substring(0,s);return h=this.measureTextWidth(d,e),h<=n?{str:d,width:h}:this._clipText(t,e,n,o,s)}if(a<n){if(s>=t.length-1)return{str:t,width:this.measureTextWidth(t,e)};const d=t.substring(0,s+2);return h=this.measureTextWidth(d,e),h>=n?{str:l,width:a}:this._clipText(t,e,n,s,r)}return{str:l,width:a}}clipTextWithSuffix(t,e,n,o){if(o==="")return this.clipText(t,e,n);if(t.length===0)return{str:"",width:0};const r=this.measureTextWidth(t,e);if(r<=n)return{str:t,width:r};const s=this.measureTextWidth(o,e);if(s>n)return{str:"",width:0};n-=s;const l=this._clipText(t,e,n,0,t.length-1);return l.str+=o,l.width+=s,l}}const CR=new lW;function aW(i){vR=i,Fm.clear()}function hW(){bh="canvas",Gt.load(sW)}const yR=new Hi({ignoreBuf:!0});function _R(i){return yR.initAttributes(Object.assign(Object.assign({},i),{ignoreBuf:!0})),yR.AABBBounds}const wR=new oo({width:0,height:0,textConfig:[]});function zn(i,t,e,n=!0,o){var r,s,l,a,h,d,u,c,g,f,p;typeof window<"u"&&window.performance.now();const m=[],b=[];if(o)for(let y=t;y<=e;y++)m[y]=i.getRowHeight(y);const C=i.internalProps.layoutMap;i.isPivotTable()&&(C.enableUseGetBodyCache(),C.enableUseHeaderPathCache()),i.defaultHeaderRowHeight,i.defaultHeaderColWidth;const _=i.defaultHeaderRowHeight==="auto"||lt(i.defaultHeaderRowHeight)&&i.defaultHeaderRowHeight.some(y=>y==="auto"),w=i.heightMode==="autoHeight"||i.heightMode==="adaptive"&&i.options.autoHeightInAdaptiveMode!==!1;if(w||_){t=t??0,e=e??i.rowCount-1,(t===0&&e===i.rowCount-1||n)&&i._clearRowRangeHeightsMap();for(let y=t;y<i.columnHeaderLevelCount;y++){let S=0,A=i.colCount-1;if((i.isPivotTable()&&!i.isPivotChart()||i.isPivotChart()&&!i.internalProps.layoutMap.indicatorsAsCol)&&cW(i,y)&&!ui(i,i.rowHeaderLevelCount,y)&&(S=0,A=i.rowHeaderLevelCount),w||i.getDefaultRowHeight(y)==="auto"){const R=nn(y,S,A,i);b[y]=Math.round(R),i.heightAdaptiveMode!=="only-body"&&o||i._setRowHeight(y,R)}}for(let y=i.rowCount-i.bottomFrozenRowCount;y<=e;y++)if(w||i.getDefaultRowHeight(y)==="auto"){const S=nn(y,0,i.colCount-1,i);o?b[y]=Math.round(S):i._setRowHeight(y,S)}if(!(e<i.columnHeaderLevelCount||!w))if(i.internalProps.transpose||i.isPivotTable()&&!i.internalProps.layoutMap.indicatorsAsCol||!dW(i))if(i.internalProps.transpose||i.isPivotTable()&&!i.internalProps.layoutMap.indicatorsAsCol)for(let y=Math.max(t,i.columnHeaderLevelCount);y<=e;y++){let S;S=uW(i,y)?nn(y,0,i.rowHeaderLevelCount,i):nn(y,0,i.colCount-1,i),o?b[y]=Math.round(S):i._setRowHeight(y,S)}else for(let y=Math.max(t,i.columnHeaderLevelCount);y<=e;y++){const S=nn(y,0,i.colCount-1,i);o?b[y]=Math.round(S):i._setRowHeight(y,S)}else{gW(nn(i.columnHeaderLevelCount,0,i.colCount-1,i),i.columnHeaderLevelCount,i.rowCount-1-i.bottomFrozenRowCount,i,o?b:void 0);for(let y=i.rowCount-i.bottomFrozenRowCount;y<=e;y++){const S=nn(y,0,i.colCount-1,i);o?b[y]=Math.round(S):i._setRowHeight(y,S)}}}else if((i.heightMode==="adaptive"||i.autoFillHeight)&&i.clearRowHeightCache(),o)for(let y=t;y<=e;y++)b[y]=i.getRowHeight(y);if((t===0&&e===i.rowCount-1||n)&&i._clearRowRangeHeightsMap(),i.heightMode==="adaptive"){i._clearRowRangeHeightsMap();let y=i.tableNoFrameHeight,S=0,A=i.rowCount;if(i.heightAdaptiveMode==="only-body"){const T=i.getRowsHeight(0,i.columnHeaderLevelCount-1),M=i.isPivotChart()?i.getBottomFrozenRowsHeight():0;y=i.tableNoFrameHeight-T-M,S=i.columnHeaderLevelCount,A=i.isPivotChart()?i.rowCount-i.bottomFrozenRowCount:i.rowCount}let R=0;for(let T=S;T<A;T++)R+=o&&(r=b[T])!==null&&r!==void 0?r:i.getRowHeight(T);const x=y/R;for(let T=S;T<A;T++){let M;M=T===A-1?y-(o?b.reduce((B,P,F)=>F>=S&&F<=A-2?B+P:B,0):i.getRowsHeight(S,A-2)):Math.round((o&&(s=b[T])!==null&&s!==void 0?s:i.getRowHeight(T))*x),o?b[T]=M:i._setRowHeight(T,M,!1)}}else if(i.autoFillHeight){i._clearRowRangeHeightsMap();const y=i.tableNoFrameHeight;let S=0,A=0;for(let R=0;R<i.rowCount;R++){const x=o&&(l=b[R])!==null&&l!==void 0?l:i.getRowHeight(R);(R<i.columnHeaderLevelCount||i.isPivotChart()&&R>=i.rowCount-i.bottomFrozenRowCount)&&(A+=x),S+=x}if(i.scenegraph._dealAutoFillHeightOriginRowsHeight=S,S<y&&S-A>0){const R=i.columnHeaderLevelCount,x=i.isPivotChart()?i.rowCount-i.bottomFrozenRowCount:i.rowCount,T=(y-A)/(S-A);for(let M=R;M<x;M++){let B;B=M===x-1?y-A-(o?b.reduce((P,F,H)=>H>=R&&H<=x-2?P+F:P,0):i.getRowsHeight(R,x-2)):Math.round((o&&(a=b[M])!==null&&a!==void 0?a:i.getRowHeight(M))*T),o?b[M]=B:i._setRowHeight(M,B,!1)}}}if(o){for(let y=t;y<=e;y++){const S=(h=b[y])!==null&&h!==void 0?h:i.getRowHeight(y);z(S)&&i._setRowHeight(y,S)}if(i.heightMode==="adaptive"||i.autoFillHeight&&i.getAllRowsHeight()<=i.tableNoFrameHeight){for(let y=0;y<=i.columnHeaderLevelCount-1;y++){const S=i.getRowHeight(y);S!==((d=m[y])!==null&&d!==void 0?d:i.getRowHeight(y))&&i.scenegraph.updateRowHeight(y,S-((u=m[y])!==null&&u!==void 0?u:i.getRowHeight(y)),!0)}for(let y=i.rowCount-i.bottomFrozenRowCount;y<=i.rowCount-1;y++){const S=i.getRowHeight(y);S!==((c=m[y])!==null&&c!==void 0?c:i.getRowHeight(y))&&i.scenegraph.updateRowHeight(y,S-((g=m[y])!==null&&g!==void 0?g:i.getRowHeight(y)),!0)}}for(let y=i.scenegraph.proxy.rowStart;y<=i.scenegraph.proxy.rowEnd;y++){const S=i.getRowHeight(y);S!==((f=m[y])!==null&&f!==void 0?f:i.getRowHeight(y))&&i.scenegraph.updateRowHeight(y,S-((p=m[y])!==null&&p!==void 0?p:i.getRowHeight(y)),!0)}}i.isPivotTable()&&(C.disableUseGetBodyCache(),C.disableUseHeaderPathCache())}function nn(i,t,e,n){var o;let r;if(n.isPivotChart()&&i>=n.columnHeaderLevelCount&&i<n.rowCount-n.bottomFrozenRowCount)if(n.internalProps.layoutMap.indicatorsAsCol){const l=n.internalProps.layoutMap.getOptimunHeightForChart(i);if(l>0)return l}else{const l=n.getDefaultRowHeight(i);if(ft(l))return l}for(let l=t;l<=e;l++){const a=fW(l,i,n);if(a&&(r=z(r)?Math.max(a.height,r):a.height,!a.renderDefault))continue;if(n.isPivotChart()){const d=n.internalProps.layoutMap.getAxisConfigInPivotChart(l,i);if(d){const u=Bt.getFunction("computeAxisComponentHeight")(d,n);if(typeof u=="number"){r=z(r)?Math.max(u,r):u;continue}}}if(n.isPivotChart()&&(n.isLeftFrozenColumn(l)&&n.isBottomFrozenRow(i)||n.isRightFrozenColumn(l)&&n.isBottomFrozenRow(i)))continue;const h=pW(l,i,n.isHeader(l,i)?(o=n._getHeaderLayoutMap(l,i))===null||o===void 0?void 0:o.headerType:n.getBodyColumnType(l,i),n);r=z(r)?Math.max(h,r):h}if(z(r))return r;const s=n.getDefaultRowHeight(i);return ft(s)?s:n.defaultRowHeight}function dW(i){var t,e,n;const{layoutMap:o}=i.internalProps,r=i.columnHeaderLevelCount;if((i.internalProps.autoWrapText||i.internalProps.enableLineBreak||i.isPivotChart())&&(i.options.heightMode==="autoHeight"||i.options.heightMode==="adaptive"))return!1;for(let s=0;s<i.colCount;s++){const l=o.getBody(s,r);if(l.cellType==="radio"||typeof l.style=="function"||typeof l.icon=="function"||!((t=l.define)===null||t===void 0)&&t.customRender||!((e=l.define)===null||e===void 0)&&e.customLayout||typeof((n=l.define)===null||n===void 0?void 0:n.icon)=="function")return!1;const a=i._getCellStyle(s,r);if(typeof a.padding=="function"||typeof a.fontSize=="function"||typeof a.lineHeight=="function"||a.autoWrapText===!0)return!1}return!0}function uW(i,t){var e,n,o;const{layoutMap:r}=i.internalProps;if((i.internalProps.autoWrapText||i.internalProps.enableLineBreak)&&(i.options.heightMode==="autoHeight"||i.options.heightMode==="adaptive"))return!1;const s=r.getBody(i.rowHeaderLevelCount,t);if(typeof s.style=="function"||typeof s.icon=="function"||!((e=s.define)===null||e===void 0)&&e.customRender||!((n=s.define)===null||n===void 0)&&n.customLayout||typeof((o=s.define)===null||o===void 0?void 0:o.icon)=="function")return!1;const l=i._getCellStyle(i.rowHeaderLevelCount,t);return typeof l.padding!="function"&&typeof l.fontSize!="function"&&typeof l.lineHeight!="function"&&l.autoWrapText!==!0}function cW(i,t){var e,n,o;const{layoutMap:r}=i.internalProps;if(i.internalProps.autoWrapText&&(i.options.heightMode==="autoHeight"||i.options.heightMode==="adaptive"))return!1;const s=r.getHeader(i.rowHeaderLevelCount,t);if(typeof s.style=="function"||typeof s.icons=="function"||!((e=s.define)===null||e===void 0)&&e.headerCustomRender||!((n=s.define)===null||n===void 0)&&n.headerCustomLayout||typeof((o=s.define)===null||o===void 0?void 0:o.icon)=="function")return!1;const l=i._getCellStyle(i.rowHeaderLevelCount,t);return typeof l.padding!="function"&&typeof l.fontSize!="function"&&typeof l.lineHeight!="function"&&l.autoWrapText!==!0}function gW(i,t,e,n,o){if(!n.internalProps.useOneRowHeightFillAll){for(let r=t;r<=e;r++)o?o[r]=i:n._setRowHeight(r,i);n.internalProps.useOneRowHeightFillAll=!0}}function fW(i,t,e){var n,o,r,s,l,a,h;const d=e.getCustomRender(i,t);let u=e.getCustomLayout(i,t);if(d||u){let c,g=1,f=0,p=!1,m=!1;(e.isHeader(i,t)||!((n=e.getBodyColumnDefine(i,t))===null||n===void 0)&&n.mergeCell||e.hasCustomMerge())&&(c=e.getCellRange(i,t),g=c.end.row-c.start.row+1);const b={col:(o=c==null?void 0:c.start.col)!==null&&o!==void 0?o:i,row:(r=c==null?void 0:c.start.row)!==null&&r!==void 0?r:t,dataValue:e.getCellOriginValue(i,t),value:e.getCellValue(i,t)||"",rect:mW(i,t,e),table:e,originCol:i,originRow:t};if(u==="react-custom-layout"&&(u=((s=e.reactCustomLayout)===null||s===void 0?void 0:s.getCustomLayoutFunc(i,t))||hh),ue(u)){const C=u(b);C.rootContainer?(C.rootContainer=dh(C.rootContainer),Bc(C.rootContainer,e.getColWidth(i),0),C.rootContainer.setStage(e.scenegraph.stage),f=(l=C.rootContainer.AABBBounds.height())!==null&&l!==void 0?l:0,p=C.renderDefault,m=C.enableCellPadding):(f=0,p=C.renderDefault,m=C.enableCellPadding)}else if(typeof d=="function"){const C=d(b);f=(a=C==null?void 0:C.expectedHeight)!==null&&a!==void 0?a:0,p=C==null?void 0:C.renderDefault}else f=(h=d==null?void 0:d.expectedHeight)!==null&&h!==void 0?h:0,p=d==null?void 0:d.renderDefault;if(m){const C=e._getCellStyle(i,t),_=Qt(wt("padding",C,i,t,e));f+=_[0]+_[2]}return{height:f/g,renderDefault:p}}}function pW(i,t,e,n){var o,r,s;let l=0;const a=n.getCellValue(i,t),h=n._getCellStyle(i,t);let d=0,u=0;const c=[];let g=0;const f=[];let p=0,m=!1;if(n.getCellLocation(i,t)!=="body")m=!0;else{const B=n.getBodyColumnDefine(i,t);m=!!(B!=null&&B.icon)||!!(B!=null&&B.tree)||(B==null?void 0:B.dragOrder)}if(m){const B=n.getCellIcons(i,t);B==null||B.forEach(P=>{var F,H,E,k,I,L,D,O,N,W;P.positionType!==me.absoluteRight&&P.positionType!==me.inlineFront&&P.positionType!==me.inlineEnd?(u+=((F=P.width)!==null&&F!==void 0?F:0)+((H=P.marginLeft)!==null&&H!==void 0?H:0)+((E=P.marginRight)!==null&&E!==void 0?E:0),d=Math.max(d,(k=P.height)!==null&&k!==void 0?k:0)):P.positionType===me.inlineFront?(c.push(P),g=Math.max(g,((I=P.height)!==null&&I!==void 0?I:0)+((L=P.marginLeft)!==null&&L!==void 0?L:0)+((D=P.marginRight)!==null&&D!==void 0?D:0))):P.positionType===me.inlineEnd&&(f.push(P),p=Math.max(p,((O=P.height)!==null&&O!==void 0?O:0)+((N=P.marginLeft)!==null&&N!==void 0?N:0)+((W=P.marginRight)!==null&&W!==void 0?W:0)))})}let b=1,C=i;if(n.isHeader(i,t)||!((o=n.getBodyColumnDefine(i,t))===null||o===void 0)&&o.mergeCell||n.hasCustomMerge()){const B=n.getCellRange(i,t);b=B.end.row-B.start.row+1,i=B.start.col,C=B.end.col}const _=Qt(wt("padding",h,i,t,n)),w=wt("fontSize",h,i,t,n),y=wt("fontStyle",h,i,t,n),S=wt("fontWeight",h,i,t,n),A=(r=wt("lineHeight",h,i,t,n))!==null&&r!==void 0?r:w,R=wt("fontFamily",h,i,t,n),x=wt("autoWrapText",h,i,t,n),T=wt("lineClamp",h,i,t,n);let M;if(e!=="text"&&e!=="link"&&e!=="progressbar"&&e!=="checkbox"&&e!=="radio")l=A;else if(e==="checkbox")l=nW(a,i,t,C,h,x,u,w,y,S,R,A,T,_,n);else if(e==="radio")l=oW(a,i,t,C,h,x,u,w,y,S,R,A,T,_,n);else{M=a;const B=ph(M,n).text,P=n.getColsWidth(i,C);if(c.length||f.length)if(x){const F=Object.assign({text:a==null?void 0:a.toString(),fontFamily:R,fontSize:w,fontStyle:y,fontWeight:S,lineHeight:A});F.textBaseline="middle";const H=[...c.map(E=>kc(E)),F,...f.map(E=>kc(E))];wR.setAttributes({width:P-(_[1]+_[3])-u,height:0,textConfig:H}),l=wR.AABBBounds.height()}else l=0,B.forEach((F,H)=>{var E;!((E=n.options.customConfig)===null||E===void 0)&&E.multilinesForXTable&&H!==0||(H===0&&c.length?l+=Math.max(A,g):H===B.length-1&&f.length?l+=Math.max(A,p):l+=A)});else if(x){const F=lo(i,t,n),H=P-(_[1]+_[3])-u-F;l=_R({maxLineWidth:H,text:B,fontSize:w,fontStyle:y,fontWeight:S,fontFamily:R,lineHeight:A,wordBreak:"break-word",whiteSpace:B.length!==1||x?"normal":"no-wrap",lineClamp:T}).height()||(typeof A=="number"?A:w)}else l=!((s=n.options.customConfig)===null||s===void 0)&&s.multilinesForXTable?A:B.length*A}return(Math.max(l,d)+_[0]+_[2])/b}function mW(i,t,e){return{left:0,top:0,right:e.getColWidth(i),bottom:e.getRowHeight(t),width:e.getColWidth(i),height:0}}function kr(i,t){if(!t||!t.proxy)return{colStart:0,colEnd:0,rowStart:0,rowEnd:0};const{mergeStartCol:e,mergeEndCol:n,mergeStartRow:o,mergeEndRow:r,col:s,row:l}=i,{colStart:a,colEnd:h,rowStart:d,rowEnd:u,bodyLeftCol:c,bodyRightCol:g,bodyTopRow:f,bodyBottomRow:p}=t.proxy;let m=e,b=n,C=o,_=r;return s>=c&&s<=g&&(m=Math.max(i.mergeStartCol,a),b=Math.min(i.mergeEndCol,h)),l>=f&&l<=p&&(C=Math.max(i.mergeStartRow,d),_=Math.min(i.mergeEndRow,u)),{colStart:m,colEnd:b,rowStart:C,rowEnd:_}}function SR(i,t,e,n){n||i.table._setRowHeight(t,i.table.getRowHeight(t)+e,!0);for(let s=0;s<i.table.colCount;s++){const l=i.getCell(s,t);if(l.role==="empty")continue;const a=ui(i.table,s,t);a&&a.start.col!==s||(xR(i,l,s,t,l.attribute.height+e,e,i.table.isHeader(s,t)),i.updateCellContentWhileResize(s,t))}let o=0,r=0;t<i.table.frozenRowCount?(o=t+1,r=i.table.frozenRowCount-1):t>=i.table.rowCount-i.table.bottomFrozenRowCount?(o=t+1,r=i.table.rowCount-1):(o=t+1,r=Math.min(i.proxy.rowEnd,i.table.rowCount-i.table.bottomFrozenRowCount-1));for(let s=0;s<i.table.colCount;s++)for(let l=o;l<=r;l++){const a=i.highPerformanceGetCell(s,l);a.role==="cell"&&a.setAttribute("y",a.attribute.y+e)}}function xR(i,t,e,n,o,r,s){t&&vW(i,t,e,n,o,r)}function vW(i,t,e,n,o,r,s){var l,a,h,d,u;if(t.attribute.height===o&&!t.needUpdateHeight)return;t.needUpdateHeight=!1,t.setAttribute("height",o);const c=(l=i.table.getCellRawRecord(e,n))===null||l===void 0?void 0:l.vtableMerge,g=!!i.table.getCustomMerge(e,n),f=c||g?"text":i.table.isHeader(e,n)?(a=i.table._getHeaderLayoutMap(e,n).headerType)!==null&&a!==void 0?a:"text":(h=i.table.getBodyColumnType(e,n))!==null&&h!==void 0?h:"text";if(f==="progressbar"){const p=i.table.getBodyColumnDefine(e,n),m=i.table._getCellStyle(e,n),b=i.table.getCellValue(e,n),C=i.table.getCellOriginValue(e,n),_=Qt(wt("padding",m,e,n,i.table));let w;p!=null&&p.mergeCell&&(w=i.table.getCellRange(e,n));const y=Bt.getFunction("createProgressBarCell")(p,m,t.attribute.width,b,C,e,n,_,i.table,w),S=t.getChildByName("progress-bar");t.insertBefore(y,S),t.removeChild(S),S.removeAllChild(),S.release(),RR(t,o,r,i.table.isAutoRowHeight(n),!0,i.table)}else if(f==="sparkline"){t.removeAllChild();const p=i.table._getCellStyle(e,n),m=Qt(wt("padding",p,e,n,i.table));Bt.getFunction("createSparkLineCellGroup")(t,t.parent,t.attribute.x,t.attribute.y,e,n,t.attribute.width,t.attribute.height,m,i.table,Pr(p,i.table,e,n,wt).theme,!1)}else if(f==="image"||f==="video")mh(t,e,n,0,r,i.table);else if(((d=t.firstChild)===null||d===void 0?void 0:d.name)==="axis")(u=t.firstChild)===null||u===void 0||u.originAxis.resize(t.attribute.width,t.attribute.height);else{let p=!0;const m=t.getChildByName(yo)||t.getChildByName(Mc);if(m){let b;t.removeChild(m);const C=Oc(e,n,t,i.table);if(C)for(let _=C.start.row;_<=C.end.row;_++){if(_===n)continue;const w=i.getCell(e,_),y=w.getChildByName(yo)||w.getChildByName(Mc);y.removeAllChild(),w.removeChild(y),Oc(e,_,w,i.table)}else{let _,w;const y=i.table.getCellLocation(e,n),{vtableMerge:S}=i.table.getCellRawRecord(e,n)||{};if(S&&i.table.options.groupTitleCustomLayout)w=i.table.options.groupTitleCustomLayout;else if(y!=="body"){const A=i.table.getHeaderDefine(e,n);_=A==null?void 0:A.headerCustomRender,w=A==null?void 0:A.headerCustomLayout}else{const A=i.table.getBodyColumnDefine(e,n);_=(A==null?void 0:A.customRender)||i.table.customRender,w=A==null?void 0:A.customLayout}if((_||w)&&Lr(t))for(let A=t.mergeStartCol;A<=t.mergeEndCol;A++)for(let R=t.mergeStartRow;R<=t.mergeEndRow;R++)R!==n&&i.updateCellContent(A,R);if(w||_){const A=i.table._getCellStyle(e,n),R=Qt(wt("padding",A,e,n,i.table));let x=t.attribute.width,T=t.attribute.height;Lr(t)&&(x=i.table.getColsWidth(t.mergeStartCol,t.mergeEndCol),T=i.table.getRowsHeight(t.mergeStartRow,t.mergeEndRow));const M=Er(w,_,e,n,x,T,!1,i.table.isAutoRowHeight(n),R,Lr(t)?{start:{col:t.mergeStartCol,row:t.mergeStartRow},end:{col:t.mergeEndCol,row:t.mergeEndRow}}:void 0,i.table);b=M.elementsGroup,p=M.renderDefault}t.childrenCount>0&&b?t.insertBefore(b,t.firstChild):b&&t.appendChild(b)}}RR(t,o,r,i.table.isAutoRowHeight(n),p,i.table)}}function RR(i,t,e,n,o,r){if(Lr(i)){t=0;for(let d=i.mergeStartRow;d<=i.mergeEndRow;d++)t+=r.getRowHeight(d);const{colStart:s,colEnd:l,rowStart:a,rowEnd:h}=kr(i,r.scenegraph);for(let d=s;d<=l;d++)for(let u=a;u<=h;u++){const c=r.scenegraph.getCell(d,u);if(c.forEachChildren(m=>{m.setAttributes({dx:0,dy:0})}),o){const m=r._getCellStyle(s,a);Ic(c,t,e,n,Qt(m.padding),m.textAlign,m.textBaseline,r)}const g=r.getRowHeight(u),f=r.getColWidth(d);c.contentHeight=t;const{widthChange:p}=vh(c,f,g,{start:{col:i.mergeStartCol,row:i.mergeStartRow},end:{col:i.mergeEndCol,row:i.mergeEndRow}},r);p&&(c.needUpdateWidth=!0)}}else{const s=r._getCellStyle(i.col,i.row);Ic(i,t,e,n,Qt(s.padding),s.textAlign,s.textBaseline,r)}}function bW(i,t,e,n){n||i.table._setColWidth(t,i.table.getColWidth(t)+e,!0);const o=i.getColGroup(t,!0),r=i.getColGroupInRightTopCorner(t);o&&!r&&Sl(o,e,"col-corner",i),r&&Sl(r,e,"right-top",i);const s=i.getColGroup(t);s&&Sl(s,e,"row-body",i);const l=i.getColGroupInLeftBottomCorner(t);l&&Sl(l,e,"left-bottom",i);const a=i.getColGroupInBottom(t);a&&Sl(a,e,"bottom",i);const h=i.getColGroupInRightBottomCorner(t);h&&Sl(h,e,"right-bottom",i),t<i.frozenColCount?(i.cornerHeaderGroup.forEachChildrenSkipChild((d,u)=>{d.col>t&&d.setAttribute("x",d.attribute.x+e)}),i.rowHeaderGroup.forEachChildrenSkipChild((d,u)=>{d.col>t&&d.setAttribute("x",d.attribute.x+e)})):(i.colHeaderGroup.forEachChildrenSkipChild((d,u)=>{d.col>t&&d.setAttribute("x",d.attribute.x+e)}),i.bodyGroup.forEachChildrenSkipChild((d,u)=>{d.col>t&&d.setAttribute("x",d.attribute.x+e)})),l&&i.leftBottomCornerGroup.forEachChildrenSkipChild((d,u)=>{d.col>t&&d.setAttribute("x",d.attribute.x+e)}),a&&i.bottomFrozenGroup.forEachChildrenSkipChild((d,u)=>{d.col>t&&d.setAttribute("x",d.attribute.x+e)}),h&&i.rightBottomCornerGroup.forEachChildrenSkipChild((d,u)=>{d.col>t&&d.setAttribute("x",d.attribute.x+e)})}function Sl(i,t,e,n){var o,r,s,l,a,h,d;let u=!1;const c=(o=i==null?void 0:i.attribute.width)!==null&&o!==void 0?o:0;if(i==null||i.setAttribute("width",c+t),i==null||i.forEachChildren((g,f)=>{if(CW(n,g,g.col,g.row,c,c+t,t,e!=="row-body"||g.col<n.table.rowHeaderLevelCount,n.table.internalProps.autoWrapText)){const p=ui(n.table,g.col,g.row);if(p&&p.end.row-p.start.row)for(let m=p.start.row;m<=p.end.row;m++)TR(n,m);else TR(n,g.row);u=!0}}),u){let g,f,p,m=0;for(let b=0;b<n.table.colCount;b++){if(e==="col-corner"?(p=0,g=n.getColGroup(b,!0),f=(r=n.colHeaderGroup.attribute.height)!==null&&r!==void 0?r:0):e==="row-body"?(p=n.table.frozenRowCount,g=n.getColGroup(b,!1),f=(s=n.bodyGroup.attribute.height)!==null&&s!==void 0?s:0):e==="bottom"?(p=n.table.rowCount-n.table.bottomFrozenRowCount,g=n.getColGroupInBottom(b),f=(l=n.bottomFrozenGroup.attribute.height)!==null&&l!==void 0?l:0):e==="left-bottom"?(p=n.table.rowCount-n.table.bottomFrozenRowCount,g=n.getColGroupInLeftBottomCorner(b),f=(a=n.leftBottomCornerGroup.attribute.height)!==null&&a!==void 0?a:0):e==="right-top"?(p=0,g=n.getColGroupInRightTopCorner(b),f=(h=n.rightTopCornerGroup.attribute.height)!==null&&h!==void 0?h:0):e==="right-bottom"&&(p=n.table.rowCount-n.table.bottomFrozenRowCount,g=n.getColGroupInRightBottomCorner(b),f=(d=n.rightBottomCornerGroup.attribute.height)!==null&&d!==void 0?d:0),!g)continue;let C=0;g.forEachChildren(_=>{var w;_.setAttribute("y",C),C+=(w=n.table.getRowHeight(_.row))!==null&&w!==void 0?w:0}),m=C}n.updateContainerHeight(p,m-f);for(let b=0;b<n.table.frozenColCount;b++){const C=n.getColGroupInLeftBottomCorner(b);let _=0;C==null||C.forEachChildren(w=>{w.setAttribute("y",_),_+=n.table.getRowHeight(w.row)})}for(let b=n.table.colCount-n.table.rightFrozenColCount;b<n.table.colCount;b++){const C=n.getColGroupInRightBottomCorner(b);let _=0;C==null||C.forEachChildren(w=>{w.setAttribute("y",_),_+=n.table.getRowHeight(w.row)})}for(let b=n.table.frozenColCount;b<n.table.colCount-n.table.rightFrozenColCount;b++){const C=n.getColGroupInBottom(b);let _=0;C==null||C.forEachChildren(w=>{w.setAttribute("y",_),_+=n.table.getRowHeight(w.row)})}}}function CW(i,t,e,n,o,r,s,l,a){var h,d,u,c,g,f,p;if(t.attribute.width===r&&!t.needUpdateWidth)return!1;t.needUpdateWidth=!1,t.setAttribute("width",r);const m=t;if(!m)return!1;const b=i.table.isAutoRowHeight(n),C=(h=i.table.getCellRawRecord(e,n))===null||h===void 0?void 0:h.vtableMerge,_=!!i.table.getCustomMerge(e,n),w=C||_?"text":i.table.isHeader(e,n)?(d=i.table._getHeaderLayoutMap(e,n).headerType)!==null&&d!==void 0?d:"text":(u=i.table.getBodyColumnType(e,n))!==null&&u!==void 0?u:"text";let y=!1;if(w==="progressbar"){const S=i.table.getBodyColumnDefine(e,n),A=i.table._getCellStyle(e,n),R=i.table.getCellValue(e,n),x=i.table.getCellOriginValue(e,n),T=Qt(wt("padding",A,e,n,i.table));let M;S!=null&&S.mergeCell&&(M=i.table.getCellRange(e,n));const B=Bt.getFunction("createProgressBarCell")(S,A,m.attribute.width,R,x,e,n,T,i.table,M),P=m.getChildByName("progress-bar");m.insertBefore(B,P),m.removeChild(P),P.removeAllChild(),P.release();const F=AR(m,r,s,b,!0,i.table);y=y||F}else if(w==="sparkline"){m.removeAllChild();const S=i.table._getCellStyle(e,n),A=Qt(wt("padding",S,e,n,i.table));Bt.getFunction("createSparkLineCellGroup")(m,m.parent,m.attribute.x,m.attribute.y,e,n,m.attribute.width,m.attribute.height,A,i.table,Pr(S,i.table,e,n,wt).theme,!1)}else if(w==="image"||w==="video")mh(m,e,n,s,0,i.table);else if(((c=m.firstChild)===null||c===void 0?void 0:c.name)==="axis"){const S=i.table.internalProps.layoutMap.getAxisConfigInPivotChart(e,n),A=i.table._getCellStyle(e,n),R=Qt(wt("padding",A,e,n,i.table));if(S){const x=new(Bt.getComponent("axis"))(S,m.attribute.width,m.attribute.height,(g=S.__vtablePadding)!==null&&g!==void 0?g:R,i.table);m.clear(),m.appendChild(x.component),x.overlap()}}else if(((f=t.firstChild)===null||f===void 0?void 0:f.name)==="axis")(p=t.firstChild)===null||p===void 0||p.originAxis.resize(t.attribute.width,t.attribute.height);else{let S=!0;const A=t.getChildByName(yo)||t.getChildByName(Mc);if(A){let x;t.removeChild(A);const T=Oc(e,n,t,i.table);if(T)for(let M=T.start.col;M<=T.end.col;M++){if(M===e)continue;const B=i.getCell(M,n),P=B.getChildByName(yo)||B.getChildByName(Mc);P.removeAllChild(),B.removeChild(P),Oc(M,n,B,i.table)}else{let M,B;const P=i.table.getCellLocation(e,n),{vtableMerge:F}=i.table.getCellRawRecord(e,n)||{};if(F&&i.table.options.groupTitleCustomLayout)B=i.table.options.groupTitleCustomLayout;else if(P!=="body"){const H=i.table.getHeaderDefine(e,n);M=H==null?void 0:H.headerCustomRender,B=H==null?void 0:H.headerCustomLayout}else{const H=i.table.getBodyColumnDefine(e,n);M=(H==null?void 0:H.customRender)||i.table.customRender,B=H==null?void 0:H.customLayout}if((M||B)&&Lr(m)){for(let H=m.mergeStartCol;H<=m.mergeEndCol;H++)if(H!==e)for(let E=m.mergeStartRow;E<=m.mergeEndRow;E++)i.updateCellContent(H,E)}if(B||M){const H=i.table._getCellStyle(e,n),E=Qt(wt("padding",H,e,n,i.table));let k=m.attribute.width,I=m.attribute.height;Lr(m)&&(k=i.table.getColsWidth(m.mergeStartCol,m.mergeEndCol),I=i.table.getRowsHeight(m.mergeStartRow,m.mergeEndRow));const L=Er(B,M,e,n,k,I,!1,i.table.isAutoRowHeight(n),E,Lr(m)?{start:{col:m.mergeStartCol,row:m.mergeStartRow},end:{col:m.mergeEndCol,row:m.mergeEndRow}}:void 0,i.table);x=L.elementsGroup,S=L.renderDefault,y=!0}t.childrenCount>0&&x?t.insertBefore(x,t.firstChild):x&&t.appendChild(x)}}const R=AR(m,r,s,b,S,i.table);y=y||R}return a||(a=i.table._getCellStyle(e,n).autoWrapText),!(!b||!a)&&y}function AR(i,t,e,n,o,r){if(Lr(i)){t=0;let d=!1;for(let m=i.mergeStartCol;m<=i.mergeEndCol;m++)t+=r.getColWidth(m);let u=0;for(let m=i.mergeStartRow;m<=i.mergeEndRow;m++)u+=r.getRowHeight(m);const{colStart:c,colEnd:g,rowStart:f,rowEnd:p}=kr(i,r.scenegraph);for(let m=c;m<=g;m++)for(let b=f;b<=p;b++){if(m===i.col&&b!==i.row)continue;const C=r.scenegraph.getCell(m,b);C.forEachChildren(A=>{A.setAttributes({dx:0,dy:0})});let _=!1;if(o){const A=r._getCellStyle(c,f),R=Qt(A.padding),x=A.textAlign,T=A.textBaseline;_=Fc(C,t,u,e,n,R,x,T,r.scenegraph);const M=lo(C.col,C.row,r);if(M){const B=C.getChildByName("text"),P=C.getChildByName("expand")||C.getChildByName("collapse");(P==null?void 0:P.role)!=="icon-left"&&B&&B.setAttribute("dx",M)}}const w=r.getRowHeight(b),y=r.getColWidth(m);C.contentWidth=t;const{heightChange:S}=vh(C,y,w,{start:{col:i.mergeStartCol,row:i.mergeStartRow},end:{col:i.mergeEndCol,row:i.mergeEndRow}},r);S&&(C.needUpdateHeight=!0),d=d||_}return d}const s=r._getCellStyle(i.col,i.row),l=Qt(s.padding),a=s.textAlign,h=s.textBaseline;return Fc(i,t,r.getRowHeight(i.row),e,n,l,a,h,r.scenegraph)}function TR(i,t){const e=Math.round(nn(t,0,i.table.colCount-1,i.table));i.table._setRowHeight(t,e,!0);for(let n=0;n<i.table.colCount;n++){const o=e,r=i.highPerformanceGetCell(n,t);if(r.role==="empty")return;xR(i,r,n,t,o,o-r.attribute.height,i.table.isHeader(n,t))}}var bn;(function(i){i.dropDown="dropDown",i.contextmenu="contextmenu",i.custom="custom"})(bn||(bn={}));const $e={fontSize:12,fontFamily:"Arial,sans-serif",color:"#000",highlightColor:"#2E68CF",hoverBgColor:"#EEE",lineHeight:30,bgColor:"#FFF",cornerRadius:4,borderWidth:.5,borderColor:"#CCC",menuPadding:6,menuItemPadding:9,maxLineWidth:200};let yW=class{constructor(t){this._table=t,this._menuInstance=new de({x:0,y:0,fill:$e.bgColor,stroke:$e.borderColor,cornerRadius:$e.cornerRadius,lineWidth:$e.borderWidth}),this._menuInfo={x:-1,y:-1,col:-1,row:-1,type:bn.dropDown,menuInfo:[],highlightIndex:-1}}bindTableComponent(t){t.appendChild(this._menuInstance),this.bindEvent()}release(){}attach(t,e,n,o,r,s){if(r===bn.dropDown&&this.checkDropDownMenuChange(n,o)){const l=this.getMenuInfo(n,o,r);if(!l)return;const{menuInfo:a,highlightIndex:h}=l;this.updateMenuInfo(n,o,r,a,h),this.updateMenuInstance(a,h)}else if(r===bn.contextmenu&&this.checkContextMenuChange(t,e)){const l=this.getMenuInfo(n,o,r);if(!l)return;const{menuInfo:a,highlightIndex:h}=l;this.updateMenuInfo(n,o,r,a,h),this.updateMenuInstance(a,h)}this.updatePosition(t-this._table.scenegraph.x,e-this._table.scenegraph.y),this.addToScene()}updateMenuInfo(t,e,n,o,r){this._menuInfo.col=t,this._menuInfo.row=e,this._menuInfo.type=n,this._menuInfo.menuInfo=o,this._menuInfo.highlightIndex=r}checkDropDownMenuChange(t,e){const{type:n,col:o,row:r}=this._menuInfo;return n!==bn.dropDown||t!==o||e!==r}checkContextMenuChange(t,e){var n;const{type:o,menuInfo:r}=this._menuInfo;return o!==bn.contextmenu||r!==((n=this._table.internalProps.menu)===null||n===void 0?void 0:n.contextMenuItems)}updateMenuInstance(t,e){this._menuInstance.removeAllChild();let n=$e.menuPadding;const o=$e.menuPadding;let r=0;t.forEach((s,l)=>{var a,h;const d=e===l;let u,c;typeof s=="string"?c=s:typeof s=="object"&&(c=s.text,u=d?s.selectedIcon:s.icon);const g=new de({y:n,x:o,height:$e.lineHeight,fill:$e.bgColor});g.role="menu-item",this._menuInstance.appendChild(g),g.stateProxy=p=>p==="hover"?{fill:$e.hoverBgColor}:{fill:$e.bgColor},g.addEventListener("pointerenter",p=>{g.addState("hover",!0,!1),this._table.scenegraph.updateNextFrame()}),g.addEventListener("pointerleave",p=>{g.removeState("hover",!1),this._table.scenegraph.updateNextFrame()});const f=new Hi({x:$e.menuItemPadding,y:$e.menuItemPadding,fill:d?$e.highlightColor:$e.color,text:c,textBaseline:"top",fontSize:$e.fontSize,fontFamily:$e.fontFamily,pickable:!1,maxLineWidth:$e.maxLineWidth,ellipsis:"…"});if(g.addChild(f),u){f.AABBBounds.height();const p=(a=u.width)!==null&&a!==void 0?a:16,m=(h=u.height)!==null&&h!==void 0?h:16,b=new ps({x:$e.menuItemPadding,y:($e.lineHeight-m)/2,width:p,height:m,image:u.svg,pickable:!1});b.role="menu-icon",g.insertBefore(b,f),f.setAttribute("x",p+$e.menuItemPadding)}r=Math.max(g.AABBBounds.width(),r),n+=$e.lineHeight}),this._menuInstance.setAttributes({width:r+2*$e.menuItemPadding+2*$e.menuPadding,height:n+$e.menuPadding}),this._menuInstance.forEachChildren(s=>{s.setAttribute("width",r+2*$e.menuItemPadding)})}updatePosition(t,e){this._menuInstance.setAttributes({x:this._menuInfo.type===bn.dropDown?t-this._menuInstance.attribute.width:t,y:e}),this._menuInfo.x=bn.dropDown?t-this._menuInstance.attribute.width:t,this._menuInfo.y=e}addToScene(){this._table.scenegraph.updateNextFrame()}detach(){this._menuInstance.setAttributes({x:-1e3,y:-1e3}),this._table.scenegraph.updateNextFrame()}getMenuInfo(t,e,n){var o;if(n===bn.dropDown){const{dropDownMenu:r=this._table.globalDropDownMenu,pivotInfo:s}=this._table._getHeaderLayoutMap(t,e);let l=-1;if(Array.isArray(r)){for(let a=0;a<r.length;a++)if(this._table._dropDownMenuIsHighlight(t,e,a)){l=a;break}}return{menuInfo:r,highlightIndex:l}}if(n===bn.contextmenu){const r=(o=this._table.internalProps.menu)===null||o===void 0?void 0:o.contextMenuItems;let s;if(Array.isArray(r))s=r;else if(typeof r=="function"){const{field:l}=this._table.isHeader(t,e)?this._table.getHeaderDefine(t,e):this._table.getBodyColumnDefine(t,e);s=r(l,e,t)}return{menuInfo:s,highlightIndex:-1}}}bindEvent(){this._menuInstance.addEventListener("click",t=>{const{target:e}=t;if(e&&e.role==="menu-item"){const n=this.getEventInfo(e),o=this._table.getMenuInfo(this._menuInfo.col,this._menuInfo.row,this._menuInfo.type),r=Object.assign(n,o);r.event=t.nativeEvent,this._table.fireListeners(at.DROPDOWN_MENU_CLICK,r)}})}getEventInfo(t){const e=t.parent;let n=0;e.forEachChildren((s,l)=>s===t&&(n=l-1,!0));const o=typeof this._menuInfo.menuInfo[n]=="string"?this._menuInfo.menuInfo[n]:this._menuInfo.menuInfo[n].text,r=typeof this._menuInfo.menuInfo[n]=="string"?o:this._menuInfo.menuInfo[n].menuKey||o;return{col:this._menuInfo.col,row:this._menuInfo.row,dropDownIndex:n,highlight:n===this._menuInfo.highlightIndex,text:o,menuKey:r}}get bounds(){return this._menuInstance.globalAABBBounds}};const Im=vn();class _W{constructor(){const t=Im.drillDown;this.icon=new ps({x:-1e3,y:-1e3,image:t.svg,width:t.width,height:t.height,dx:-t.width/2,dy:-t.height/2,visible:!1,funcType:t.funcType,cursor:t.cursor}),this.icon.role="icon-drill"}appand(t){t.appendChild(this.icon)}update(t,e,n,o,r,s){if(!t||o&&r)return this.icon.setAttributes({x:-1e3,y:-1e3,visible:!1}),void s.updateNextFrame();const l=Im.drillDown,a=Im.drillUp;this.icon.setAttributes({x:e,y:n,image:o?l.svg:a.svg,visible:!0}),this.icon.loadImage(this.icon.attribute.image),s.updateNextFrame()}}class wW{constructor(t){const e=t.theme.dragHeaderSplitLine.lineWidth,n=t.theme.dragHeaderSplitLine.lineColor,o=t.theme.dragHeaderSplitLine.shadowBlockColor;this.columnMoverLabel=Ea({visible:!1,pickable:!1,x:0,y:0,symbolType:"triangle",fill:n}),this.columnMoverLine=fn({visible:!1,pickable:!1,stroke:n,lineWidth:e,x:0,y:0,points:[{x:0,y:0},{x:0,y:0}]}),this.columnMoverBack=Fe({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,n){const o=this.table.getCellLocation(t,e),r=ui(this.table,t,e);r&&(t=r.start.col,e=r.start.row);let s=0,l=0,a=0,h=0,d=0,u=0,c=0,g=0,f=Math.PI;const p=[];return o==="columnHeader"?(s=this.table.getColsWidth(0,t-1)-this.table.stateManager.scroll.horizontalBarPos,l=this.table.getRowsHeight(0,this.table.frozenRowCount-1),h=this.table.tableNoFrameHeight,a=r?this.table.getColsWidth(r.start.col,r.end.col):this.table.getColWidth(t),d=s-n,c=s+a,g=2,p.push({x:0,y:0}),p.push({x:0,y:this.table.tableNoFrameHeight})):(o==="rowHeader"||this.table.internalProps.layoutMap.isSeriesNumberInBody(t,e))&&(l=this.table.getRowsHeight(0,e-1)-this.table.stateManager.scroll.verticalBarPos,s=this.table.getColsWidth(0,this.table.frozenColCount-1),a=this.table.tableNoFrameWidth,h=r?this.table.getRowsHeight(r.start.row,r.end.row):this.table.getRowHeight(e),u=l-n,c=2,g=l+h,f=Math.PI/2,p.push({x:0,y:0}),p.push({x:this.table.tableNoFrameWidth,y:0})),this.columnMoverBack.setAttributes({visible:!0,x:s-d,y:l-u,width:a,height:h,dx:d,dy:u}),this.columnMoverLine.setAttributes({x:c,y:g,visible:!0,points:p}),this.columnMoverLabel.setAttributes({visible:!0,x:c,y:g,angle:f}),{backX:s-d,lineX:c,backY:l-u,lineY:g}}hide(){this.columnMoverLabel.setAttribute("visible",!1),this.columnMoverLine.setAttribute("visible",!1),this.columnMoverBack.setAttribute("visible",!1)}update(t,e,n,o){typeof t=="number"&&typeof e=="number"?(this.columnMoverLabel.setAttribute("x",e),this.columnMoverLine.setAttribute("x",e),this.columnMoverBack.setAttribute("x",t)):typeof n=="number"&&typeof o=="number"&&(this.columnMoverLabel.setAttribute("y",o),this.columnMoverLine.setAttribute("y",o),this.columnMoverBack.setAttribute("y",n))}updateStyle(){const t=this.table.theme.dragHeaderSplitLine.lineWidth,e=this.table.theme.dragHeaderSplitLine.lineColor,n=this.table.theme.dragHeaderSplitLine.shadowBlockColor;this.columnMoverLabel.setAttributes({fill:e}),this.columnMoverLine.setAttributes({stroke:e,lineWidth:t}),this.columnMoverBack.setAttributes({fill:n})}}function Wc(i,t,e){if(e)return Math.min(t.tableNoFrameWidth,t.getAllColsWidth())-t.getColsWidth(i,t.colCount-1);let n=t.getColsWidth(0,i);return i>=t.frozenColCount&&(n-=t.scrollLeft),n}function MR(i,t,e){if(e)return Math.min(t.tableNoFrameWidth,t.getAllRowsHeight())-t.getRowsHeight(i,t.rowCount-1);let n=t.getRowsHeight(0,i);return i>=t.frozenRowCount&&(n-=t.scrollTop),n}class SW{constructor(t){var e,n,o,r,s,l,a,h,d,u,c,g,f,p,m,b,C;this.table=t;const _=this.table.theme;this.createScrollBar();const w=(e=_.columnResize)===null||e===void 0?void 0:e.lineColor,y=(n=_.columnResize)===null||n===void 0?void 0:n.lineWidth,S=(o=_.columnResize)===null||o===void 0?void 0:o.bgColor,A=(r=_.columnResize)===null||r===void 0?void 0:r.width,R=(l=(s=_.columnResize)===null||s===void 0?void 0:s.labelVisible)===null||l===void 0||l,x=(a=_.columnResize)===null||a===void 0?void 0:a.labelColor,T=(h=_.columnResize)===null||h===void 0?void 0:h.labelFontSize,M=(d=_.columnResize)===null||d===void 0?void 0:d.labelFontFamily,B=(u=_.columnResize)===null||u===void 0?void 0:u.labelBackgroundFill,P=(c=_.columnResize)===null||c===void 0?void 0:c.labelBackgroundCornerRadius;this.labelVisible=R,this.columnResizeLine=fn({visible:!1,pickable:!1,stroke:w,lineWidth:y,x:0,y:0,points:[{x:0,y:0},{x:0,y:0}]}),this.columnResizeBgLine=fn({visible:!1,pickable:!1,stroke:S,lineWidth:A,x:0,y:0,points:[{x:0,y:0},{x:0,y:0}]});const F=Jp({visible:!1,pickable:!1,x:0,y:0,fontSize:T,fill:x,fontFamily:M,text:"",textBaseline:"top",dx:16,dy:-T/2}),H=Fe({visible:!1,pickable:!1,fill:B,x:0,y:0,width:5*T*.8,height:T+8,cornerRadius:P,dx:12,dy:-T/2-4});this.columnResizeLabel=Nd({visible:!1,pickable:!1,x:0,y:0}),this.columnResizeLabel.appendChild(H),this.columnResizeLabel.appendChild(F),this.rowResizeLine=fn({visible:!1,pickable:!1,stroke:w,lineWidth:y,x:0,y:0,points:[{x:0,y:0},{x:0,y:0}]}),this.rowResizeBgLine=fn({visible:!1,pickable:!1,stroke:S,lineWidth:A,x:0,y:0,points:[{x:0,y:0},{x:0,y:0}]});const E=Jp({visible:!1,pickable:!1,x:0,y:0,fontSize:T,fill:x,fontFamily:M,text:"",textBaseline:"top",dx:16,dy:-T/2}),k=Fe({visible:!1,pickable:!1,fill:B,x:0,y:0,width:5*T*.8,height:T+8,cornerRadius:P,dx:12,dy:-T/2-4});this.rowResizeLabel=Nd({visible:!1,pickable:!1,x:0,y:0}),this.rowResizeLabel.appendChild(k),this.rowResizeLabel.appendChild(E),this.cellMover=new wW(this.table);const I=(f=(g=_.frozenColumnLine)===null||g===void 0?void 0:g.shadow)===null||f===void 0?void 0:f.width,L=(m=(p=_.frozenColumnLine)===null||p===void 0?void 0:p.shadow)===null||m===void 0?void 0:m.startColor,D=(C=(b=_.frozenColumnLine)===null||b===void 0?void 0:b.shadow)===null||C===void 0?void 0:C.endColor;this.frozenShadowLine=Fe({visible:!0,pickable:!1,x:0,y:0,width:I,height:0,fill:{gradient:"linear",x0:0,y0:0,x1:1,y1:0,stops:[{color:L,offset:0},{color:D,offset:1}]}}),this.rightFrozenShadowLine=Fe({visible:!0,pickable:!1,x:0,y:0,width:I,height:0,fill:{gradient:"linear",x0:0,y0:0,x1:1,y1:0,stops:[{color:D,offset:0},{color:L,offset:1}]}}),this.menu=new yW(this.table),this.drillIcon=new _W}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,n,o,r,s;const l=this.table.theme,a=(t=l.scrollStyle)===null||t===void 0?void 0:t.scrollRailColor,h=(e=l.scrollStyle)===null||e===void 0?void 0:e.scrollSliderColor,d=(n=l.scrollStyle)===null||n===void 0?void 0:n.scrollSliderCornerRadius,u=(o=l.scrollStyle)===null||o===void 0?void 0:o.width,c=(r=l.scrollStyle)===null||r===void 0?void 0:r.horizontalPadding,g=(s=l.scrollStyle)===null||s===void 0?void 0:s.verticalPadding;let f;f=z(d)?{cornerRadius:d,fill:h}:{fill:h},this.hScrollBar=new hs({direction:"horizontal",x:2*-this.table.tableNoFrameWidth,y:2*-this.table.tableNoFrameHeight,width:this.table.tableNoFrameWidth,height:u,padding:c,railStyle:{fill:a},sliderStyle:f,range:[0,.1],visible:!1}),this.hScrollBar.render(),this.hScrollBar.hideAll(),this.vScrollBar=new hs({direction:"vertical",x:2*-this.table.tableNoFrameWidth,y:2*-this.table.tableNoFrameHeight,width:u,height:this.table.tableNoFrameHeight-this.table.getFrozenRowsHeight(),padding:g,railStyle:{fill:a},sliderStyle:f,range:[0,.1],visible:!1}),this.vScrollBar.render(),this.vScrollBar.hideAll()}updateScrollBar(){var t,e,n,o,r,s,l;const a=this.table.stateManager.scroll.horizontalBarPos,h=this.table.stateManager.scroll.verticalBarPos,d=this.table.theme,u=(t=d.scrollStyle)===null||t===void 0?void 0:t.width,c=(e=d.scrollStyle)===null||e===void 0?void 0:e.visible,g=(o=(n=d.scrollStyle)===null||n===void 0?void 0:n.horizontalVisible)!==null&&o!==void 0?o:c,f=(s=(r=d.scrollStyle)===null||r===void 0?void 0:r.verticalVisible)!==null&&s!==void 0?s:c,p=Math.ceil(this.table.scenegraph.tableGroup.attribute.width),m=Math.ceil(this.table.scenegraph.tableGroup.attribute.height),b=this.table.getAllRowsHeight(),C=this.table.getAllColsWidth(),_=this.table.getFrozenRowsHeight(),w=this.table.getFrozenColsWidth(),y=this.table.getBottomFrozenRowsHeight(),S=this.table.getRightFrozenColsWidth(),A=!((l=this.table.options.customConfig)===null||l===void 0)&&l._disableColumnAndRowSizeRound?1:0;if(C>p+A){const R=Math.min(m,b),x=Math.max(.05,(p-w)/(C-w)),T=this.table.theme.scrollStyle.hoverOn;let M=0;M=this.table.theme.scrollStyle.barToSide?this.table.tableNoFrameHeight-(T?u:-this.table.scenegraph.tableGroup.attribute.y)+this.table.tableY:R-(T?u:-this.table.scenegraph.tableGroup.attribute.y),this.hScrollBar.setAttributes({x:w+(T?0:this.table.scenegraph.tableGroup.attribute.x),y:M,width:p-w-S,range:[0,x],visible:g==="always"});const B=this.hScrollBar.AABBBounds&&this.hScrollBar.globalAABBBounds;this.hScrollBar._viewPosition={x:B.x1,y:B.y1},g==="always"&&this.hScrollBar.showAll()}else this.hScrollBar.setAttributes({x:2*-this.table.tableNoFrameWidth,y:2*-this.table.tableNoFrameHeight,width:0,visible:!1});if(b>m+A){const R=Math.min(p,C),x=Math.max(.05,(m-_)/(b-_));let T=0;const M=this.table.theme.scrollStyle.hoverOn;T=this.table.theme.scrollStyle.barToSide?this.table.tableNoFrameWidth-(M?u:-this.table.scenegraph.tableGroup.attribute.x)+this.table.tableX:R-(M?u:-this.table.scenegraph.tableGroup.attribute.x),this.vScrollBar.setAttributes({x:T,y:_+(M?0:this.table.scenegraph.tableGroup.attribute.y),height:m-_-y,range:[0,x],visible:f==="always"});const B=this.vScrollBar.AABBBounds&&this.vScrollBar.globalAABBBounds;this.vScrollBar._viewPosition={x:B.x1,y:B.y1},f==="always"&&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(a),this.table.stateManager.setScrollTop(h)}hideResizeCol(){this.columnResizeLine.setAttribute("visible",!1),this.columnResizeBgLine.setAttribute("visible",!1),this.columnResizeLabel.setAttribute("visible",!1),this.columnResizeLabel.hideAll()}showResizeCol(t,e,n){const o=Wc(t,this.table,n);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,n){const o=Wc(t,this.table,n);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,n){const o=MR(t,this.table,n);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,n){const o=MR(t,this.table,n);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,n){return this.cellMover.show(t,e,n)}updateMoveCol(t,e,n,o){this.cellMover.update(t,e,n,o)}setFrozenColumnShadow(t,e){if(t<0)this.frozenShadowLine.setAttributes({visible:!1});else{const n=Wc(t,this.table,e);this.frozenShadowLine.setAttributes({visible:!0,x:n,height:this.table.getDrawRange().height})}}setRightFrozenColumnShadow(t){if(t>=this.table.colCount)this.rightFrozenShadowLine.setAttributes({visible:!1});else{const e=Wc(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,n=(t=this.table.theme.scrollStyle.verticalVisible)!==null&&t!==void 0?t:e;n!=="focus"&&n!=="scrolling"||(this.vScrollBar.setAttribute("visible",!1),this.vScrollBar.hideAll(),this.table.scenegraph.updateNextFrame())}showVerticalScrollBar(){var t;const e=this.table.theme.scrollStyle.visible,n=(t=this.table.theme.scrollStyle.verticalVisible)!==null&&t!==void 0?t:e;n!=="focus"&&n!=="scrolling"||(this.vScrollBar.setAttribute("visible",!0),this.vScrollBar.showAll(),this.table.scenegraph.updateNextFrame())}hideHorizontalScrollBar(){var t;const e=this.table.theme.scrollStyle.visible,n=(t=this.table.theme.scrollStyle.horizontalVisible)!==null&&t!==void 0?t:e;n!=="focus"&&n!=="scrolling"||(this.hScrollBar.setAttribute("visible",!1),this.hScrollBar.hideAll(),this.table.scenegraph.updateNextFrame())}showHorizontalScrollBar(){var t;const e=this.table.theme.scrollStyle.visible,n=(t=this.table.theme.scrollStyle.horizontalVisible)!==null&&t!==void 0?t:e;n!=="focus"&&n!=="scrolling"||(this.hScrollBar.setAttribute("visible",!0),this.hScrollBar.showAll(),this.table.scenegraph.updateNextFrame())}updateVerticalScrollBarPos(t){const e=this.vScrollBar.attribute.range,n=e[1]-e[0],o=t*(1-n);this.vScrollBar.setAttribute("range",[o,o+n]);const r=this.vScrollBar.AABBBounds&&this.vScrollBar.globalAABBBounds;this.vScrollBar._viewPosition={x:r.x1,y:r.y1}}updateHorizontalScrollBarPos(t){const e=this.hScrollBar.attribute.range,n=e[1]-e[0],o=t*(1-n);this.hScrollBar.setAttribute("range",[o,o+n]);const r=this.hScrollBar.AABBBounds&&this.hScrollBar.globalAABBBounds;this.hScrollBar._viewPosition={x:r.x1,y:r.y1}}updateStyle(){var t,e,n,o,r,s,l,a,h,d,u,c,g,f,p,m,b,C,_,w,y,S,A;const R=this.table.theme,x=(t=R.scrollStyle)===null||t===void 0?void 0:t.scrollRailColor,T=(e=R.scrollStyle)===null||e===void 0?void 0:e.scrollSliderColor,M=(n=R.scrollStyle)===null||n===void 0?void 0:n.scrollSliderCornerRadius,B=(o=R.scrollStyle)===null||o===void 0?void 0:o.width,P=(r=R.scrollStyle)===null||r===void 0?void 0:r.horizontalPadding,F=(s=R.scrollStyle)===null||s===void 0?void 0:s.verticalPadding;let H;H=z(M)?{cornerRadius:M,fill:T}:{fill:T},this.hScrollBar.setAttributes({height:B,padding:P,railStyle:{fill:x},sliderStyle:H}),this.vScrollBar.setAttributes({width:B,padding:F,railStyle:{fill:x},sliderStyle:H});const E=(l=R.columnResize)===null||l===void 0?void 0:l.lineColor,k=(a=R.columnResize)===null||a===void 0?void 0:a.lineWidth,I=(h=R.columnResize)===null||h===void 0?void 0:h.bgColor,L=(d=R.columnResize)===null||d===void 0?void 0:d.width;this.columnResizeLine.setAttributes({stroke:E,lineWidth:k}),this.columnResizeBgLine=fn({stroke:I,lineWidth:L});const D=(u=R.columnResize)===null||u===void 0?void 0:u.labelColor,O=(c=R.columnResize)===null||c===void 0?void 0:c.labelFontSize,N=(g=R.columnResize)===null||g===void 0?void 0:g.labelFontFamily,W=(f=R.columnResize)===null||f===void 0?void 0:f.labelBackgroundFill,$=(p=R.columnResize)===null||p===void 0?void 0:p.labelBackgroundCornerRadius,U=(b=(m=R.columnResize)===null||m===void 0?void 0:m.labelVisible)===null||b===void 0||b;this.labelVisible=U,this.columnResizeLabel.lastChild.setAttributes({fontSize:O,fill:D,fontFamily:N,dy:-O/2}),this.columnResizeLabel.firstChild.setAttributes({fill:W,width:5*O*.8,height:O+8,cornerRadius:$,dy:-O/2-4}),this.rowResizeLabel.lastChild.setAttributes({fontSize:O,fill:D,fontFamily:N,dy:-O/2}),this.rowResizeLabel.firstChild.setAttributes({fill:W,width:5*O*.8,height:O+8,cornerRadius:$,dy:-O/2-4});const Y=(_=(C=R.frozenColumnLine)===null||C===void 0?void 0:C.shadow)===null||_===void 0?void 0:_.width,j=(y=(w=R.frozenColumnLine)===null||w===void 0?void 0:w.shadow)===null||y===void 0?void 0:y.startColor,G=(A=(S=R.frozenColumnLine)===null||S===void 0?void 0:S.shadow)===null||A===void 0?void 0:A.endColor;this.frozenShadowLine.setAttributes({width:Y,fill:{gradient:"linear",x0:0,y0:0,x1:1,y1:0,stops:[{color:j,offset:0},{color:G,offset:1}]}}),this.rightFrozenShadowLine.setAttributes({width:Y,fill:{gradient:"linear",x0:0,y0:0,x1:1,y1:0,stops:[{color:G,offset:0},{color:j,offset:1}]}}),this.cellMover.updateStyle()}}function xl(i,t,e,n,o){var r,s,l,a,h,d;if(!t)return;const u=e==="table",{shadowBlur:c,shadowOffsetX:g,shadowOffsetY:f,shadowColor:p,cornerRadius:m,borderColor:b,borderLineWidth:C,borderLineDash:_}=t;let w=!1;const y={},S={pickable:!1};c&&u&&(S.shadowBlur=c,S.shadowOffsetX=g,S.shadowOffsetY=f,S.shadowColor=p,S.stroke=!0,S.stroke=p,S.lineWidth=1,w=!0),C&&(S.stroke=!0,S.fill=!1,S.stroke=Dm(b??"#E1E4E8",n,C),S.lineWidth=C,_&&(S.lineDash=_),S.lineCap="butt"),Array.isArray(b)&&(S.strokeArrayColor=Qt(b)),Array.isArray(C)&&(S.strokeArrayWidth=Qt(C),S.lineWidth=1),m&&(S.cornerRadius=m,y.cornerRadius=m);const A=S.strokeArrayWidth?S.strokeArrayWidth[0]:(r=S.lineWidth)!==null&&r!==void 0?r:0,R=S.strokeArrayWidth?S.strokeArrayWidth[1]:(s=S.lineWidth)!==null&&s!==void 0?s:0,x=S.strokeArrayWidth?S.strokeArrayWidth[2]:(l=S.lineWidth)!==null&&l!==void 0?l:0,T=S.strokeArrayWidth?S.strokeArrayWidth[3]:(a=S.lineWidth)!==null&&a!==void 0?a:0;if(i.setAttributes(y),!o)if(S.stroke)if(S.x=T/2,S.y=A/2,S.pickable=!1,u){if(m)if(Array.isArray(m)){const P=Qt(m);S.cornerRadius=P,y.cornerRadius=P,P[0]&&(P[0]=P[0]+Math.min(T,A)/2),P[1]&&(P[1]=P[1]+Math.min(A,R)/2),P[2]&&(P[2]=P[2]+Math.min(R,x)/2),P[3]&&(P[3]=P[3]+Math.min(x,T)/2)}else if(lt(C)){const P=[];S.cornerRadius=P,y.cornerRadius=P,P[0]=m+Math.min(T,A)/2,P[1]=m+Math.min(A,R)/2,P[2]=m+Math.min(R,x)/2,P[3]=m+Math.min(x,T)/2}else S.cornerRadius=m+((h=S.lineWidth)!==null&&h!==void 0?h:0)/2,y.cornerRadius=m+((d=S.lineWidth)!==null&&d!==void 0?d:0)/2;let M,B;if(t.innerBorder?(S.x=i.attribute.x+T/2,S.y=i.attribute.y+A/2,S.width=i.attribute.width-T/2-R/2,S.height=i.attribute.height-A/2-x/2):(S.x=i.attribute.x-T/2,S.y=i.attribute.y-A/2,S.width=i.attribute.width+T/2+R/2,S.height=i.attribute.height+A/2+x/2),w){S.fill="white",S.notAdjustPos=!0,B=Nd(S),B.name="table-border-rect",M=Fe({x:T/2,y:A/2,width:i.attribute.width,height:i.attribute.height,fill:"red",cornerRadius:i.attribute.cornerRadius,globalCompositeOperation:"destination-out"}),B.addChild(M);const P=Fe({x:T/2,y:A/2,width:i.attribute.width,height:i.attribute.height,fill:"transparent",pickable:!1,globalCompositeOperation:"source-over"});B.addChild(P)}else B=Fe(S),B.name="table-border-rect";t.innerBorder&&!w?i.parent.insertAfter(B,i):i.parent.insertBefore(B,i),i.border=B}else{S.width=i.attribute.width-T/2-R/2,S.height=i.attribute.height-A/2-x/2;const M=Fe(S);M.name="border-rect",i.addChild(M),i.border=M}else{const M=Fe({fill:!1,stroke:!1,pickable:!1,lineWidth:0});M.name="border-rect",i.addChild(M),i.border=M}}function BR(i,t,e){var n;if(!t)return;const{borderColor:o}=t;(n=i.border)===null||n===void 0||n.setAttribute("stroke",Dm(o,e))}function Dm(i,t,e){let n=!0;return!t&&!lt(e)||lt(i)?t?n=t:t||lt(i)?lt(i)&&(n=!0):n=i:n=(t??e).map(o=>!!o&&i),n}function Nc(i){var t,e,n,o;if(!i.border)return;const r=i.border.attribute.strokeArrayWidth?i.border.attribute.strokeArrayWidth[0]:(t=i.border.attribute.lineWidth)!==null&&t!==void 0?t:0,s=i.border.attribute.strokeArrayWidth?i.border.attribute.strokeArrayWidth[1]:(e=i.border.attribute.lineWidth)!==null&&e!==void 0?e:0,l=i.border.attribute.strokeArrayWidth?i.border.attribute.strokeArrayWidth[2]:(n=i.border.attribute.lineWidth)!==null&&n!==void 0?n:0,a=i.border.attribute.strokeArrayWidth?i.border.attribute.strokeArrayWidth[3]:(o=i.border.attribute.lineWidth)!==null&&o!==void 0?o:0;i.border.setAttributes({width:i.attribute.width-a/2-s/2,height:i.attribute.height-r/2-l/2}),i.border.type==="group"&&i.border.firstChild.setAttributes({width:i.attribute.width,height:i.attribute.height})}function xW(i){if(!i.theme.frameStyle.cornerRadius)return;const t=i.theme.frameStyle.cornerRadius,{cornerHeaderGroup:e,colHeaderGroup:n,rowHeaderGroup:o,bodyGroup:r,rightTopCornerGroup:s,leftBottomCornerGroup:l,rightBottomCornerGroup:a,rightFrozenGroup:h,bottomFrozenGroup:d}=i.scenegraph;e.setAttribute("cornerRadius",0),n.setAttribute("cornerRadius",0),o.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 u=px(t);e.attribute.width>0&&e.attribute.height>0?Ni(e,[u[0],0,0,0]):n.attribute.height>0?Ni(n,[u[0],0,0,0]):o.attribute.width>0?Ni(o,[u[0],0,0,0]):Ni(r,[u[0],0,0,0]),l.attribute.width>0&&l.attribute.height>0?Ni(l,[0,0,0,u[3]]):d.attribute.height>0?Ni(d,[0,0,0,u[3]]):o.attribute.width>0?Ni(o,[0,0,0,u[3]]):Ni(r,[0,0,0,u[3]]),s.attribute.width>0&&s.attribute.height>0?Ni(s,[0,u[1],0,0]):n.attribute.height>0?Ni(n,[0,u[1],0,0]):h.attribute.width>0?Ni(h,[0,u[1],0,0]):Ni(r,[0,u[1],0,0]),a.attribute.width>0&&a.attribute.height>0?Ni(a,[0,0,u[2],0]):h.attribute.width>0?Ni(h,[0,0,u[2],0]):d.attribute.height>0?Ni(d,[0,0,u[2],0]):Ni(r,[0,0,u[2],0])}function Ni(i,t){i.setAttribute("cornerRadius",t),i.border&&i.border.setAttribute("cornerRadius",t)}const PR=Pi();class Rl extends cn{constructor(t,e){if(super(e),this.type="chart",this.numberType=PR,this.isShareChartSpec=t,e.chartInstance)this.chartInstance=e.chartInstance;else{const n=this.chartInstance=new e.ClassType(e.spec,xt({},this.attribute.tableChartOption,{renderCanvas:e.canvas,mode:this.attribute.mode==="node"?"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}));n.renderSync(),n.getStage().enableDirtyBounds(),e.chartInstance=this.chartInstance=n}}activate(t){var e,n,o,r;this.active=!0;const{col:s,row:l}=this.parent,{x1:a,y1:h,x2:d,y2:u}=this.getViewBox(),c=RW(s,l,t).intersect({x1:a-t.scrollLeft,x2:d-t.scrollLeft,y1:h-t.scrollTop,y2:u-t.scrollTop});this.activeChartInstance=new this.attribute.ClassType(this.attribute.spec,xt({},this.attribute.tableChartOption,{renderCanvas:this.attribute.canvas,mode:"desktop-browser",canvasControled:!1,viewBox:{x1:0,x2:d-a,y1:0,y2:u-h},dpr:t.internalProps.pixelRatio,animation:!1,interactive:!0,autoFit:!1,beforeRender:m=>{const b=this.stage,C=m.window.getContext(),_=b.window.getViewBoxTransform(),w=b.window.getViewBox();C.inuse=!0,C.clearMatrix(),C.setTransform(_.a,_.b,_.c,_.d,_.e,_.f,!0),C.translate(w.x1,w.y1),C.setTransformForCurrent(!0),C.beginPath(),C.rect(c.x1,c.y1,c.x2-c.x1,c.y2-c.y1),C.clip(),C.clearMatrix(),t.options.canvas&&!m.needRender&&(m.pauseRender(),t.scenegraph.stage.dirtyBounds.union(this.globalAABBBounds),t.scenegraph.updateNextFrame())},afterRender(m){m.window.getContext().inuse=!1,m.needRender=!1,g.resumeRender()}}));const g=this.activeChartInstance.getStage(),f=this.globalTransMatrix.clone(),p=this.stage.window.getViewBoxTransform();f.multiply(p.a,p.b,p.c,p.d,p.e,p.f),g.window.setViewBoxTransform&&g.window.setViewBoxTransform(f.a,f.b,f.c,f.d,f.e,f.f),this.activeChartInstance.renderSync(),(n=(e=t.internalProps.layoutMap)===null||e===void 0?void 0:e.updateDataStateToActiveChartInstance)===null||n===void 0||n.call(e,this.activeChartInstance),this.activeChartInstance.on("click",m=>{var b;((b=this.attribute.spec.select)===null||b===void 0?void 0:b.enable)===!1?t.scenegraph.updateChartState(null):Rl.temp&&t.scenegraph.updateChartState(m==null?void 0:m.datum)}),this.activeChartInstance.on("brushEnd",m=>{var b;t.scenegraph.updateChartState((b=m==null?void 0:m.value)===null||b===void 0?void 0:b.inBrushData),Rl.temp=0,setTimeout(()=>{Rl.temp=1},0)}),(r=(o=t)._bindChartEvent)===null||r===void 0||r.call(o,this.activeChartInstance)}deactivate(){var t,e;this.active=!1,(t=this.activeChartInstance)===null||t===void 0||t.updateViewBox({x1:-1e3,x2:-800,y1:-1e3,y2:-800},!1,!1),(e=this.activeChartInstance)===null||e===void 0||e.release(),this.activeChartInstance=null}updateData(t){this.attribute.data=t}getViewBox(){var t,e,n,o,r,s,l,a;const h=this.parent,d=this.attribute.cellPadding,u=this.stage.table,{x1:c,y1:g,x2:f,y2:p}=h.globalAABBBounds;return{x1:Math.ceil(c+d[3]+u.scrollLeft+((e=(t=u.options.viewBox)===null||t===void 0?void 0:t.x1)!==null&&e!==void 0?e:0)),x2:Math.ceil(c+h.attribute.width-d[1]+u.scrollLeft+((o=(n=u.options.viewBox)===null||n===void 0?void 0:n.x1)!==null&&o!==void 0?o:0)),y1:Math.ceil(g+d[0]+u.scrollTop+((s=(r=u.options.viewBox)===null||r===void 0?void 0:r.y1)!==null&&s!==void 0?s:0)),y2:Math.ceil(g+h.attribute.height-d[2]+u.scrollTop+((a=(l=u.options.viewBox)===null||l===void 0?void 0:l.y1)!==null&&a!==void 0?a:0))}}}function RW(i,t,e){var n,o,r,s,l,a,h,d;const{layoutMap:u}=e.internalProps,c=new hn,g=e.scenegraph.tableGroup.globalAABBBounds;return c.x1=g.x1,c.x2=g.x2,c.y1=g.y1,c.y2=g.y2,u.isLeftBottomCorner(i,t)||u.isRightTopCorner(i,t)||u.isLeftTopCorner(i,t)||u.isRightBottomCorner(i,t)||(u.isFrozenColumn(i,t)?(c.y1=g.y1+e.getFrozenRowsHeight(),c.y2=g.y2-e.getBottomFrozenRowsHeight()):u.isFrozenRow(i,t)?(c.x1=g.x1+e.getFrozenColsWidth(),c.x2=g.x2-e.getRightFrozenColsWidth()):u.isRightFrozenColumn(i,t)?(c.y1=g.y1+e.getFrozenRowsHeight(),c.y2=g.y2-e.getBottomFrozenRowsHeight()):u.isBottomFrozenRow(i,t)?(c.x1=g.x1+e.getFrozenColsWidth(),c.x2=g.x2-e.getRightFrozenColsWidth()):u.isFrozenColumn(i,t)||u.isRightFrozenColumn(i,t)||(c.x1=g.x1+e.getFrozenColsWidth(),c.x2=g.x2-e.getRightFrozenColsWidth(),c.y1=g.y1+e.getFrozenRowsHeight(),c.y2=g.y2-e.getBottomFrozenRowsHeight())),c.x1=c.x1+((o=(n=e.options.viewBox)===null||n===void 0?void 0:n.x1)!==null&&o!==void 0?o:0),c.x2=c.x2+((s=(r=e.options.viewBox)===null||r===void 0?void 0:r.x1)!==null&&s!==void 0?s:0),c.y1=c.y1+((a=(l=e.options.viewBox)===null||l===void 0?void 0:l.y1)!==null&&a!==void 0?a:0),c.y2=c.y2+((d=(h=e.options.viewBox)===null||h===void 0?void 0:h.y1)!==null&&d!==void 0?d:0),c}Rl.temp=1;const Om=[],zm=[];let Wm=5,Nm=!1;function HR(i){z(i)&&(Wm=i)}function AW(){return Nm}function Vm(i){var t,e,n,o,r,s;const{axes:l,dataId:a,data:h,spec:d,ClassType:u,canvas:c,mode:g,modeParams:f,dpr:p}=i.attribute;let{chartInstance:m}=i;m||(m=new u(d,{renderCanvas:c,mode:g==="node"?"node":"desktop-browser",modeParams:f,canvasControled:!1,viewBox:{x1:0,x2:0,y1:0,y2:0},dpr:p,interactive:!1,animation:!1,autoFit:!1}),m.renderSync(),i.chartInstance=m);const b=i.getViewBox();b.x2<=b.x1&&(b.x2=b.x1+1),b.y2<=b.y1&&(b.y2=b.y1+1),m.updateViewBox({x1:0,x2:b.x2-b.x1,y1:0,y2:b.y2-b.y1},!1,!1);const C=m.getStage(),_=i.globalTransMatrix.clone(),w=i.stage.window.getViewBoxTransform();_.multiply(w.a,w.b,w.c,w.d,w.e,w.f),C.window.setViewBoxTransform&&C.window.setViewBoxTransform(_.a,_.b,_.c,_.d,_.e,_.f);const{table:y}=i.getRootNode();let S=!1;if(y.options.specFormat){const A=y.options.specFormat(i.attribute.spec);if(A.needFormatSpec&&A.spec){const R=A.spec;m.updateSpecSync(R),S=!0}}if(!S)if(l==null||l.forEach((A,R)=>{var x,T,M,B;A.type==="band"?m.updateModelSpec({type:"axes",index:R},{domain:A.domain.slice(0)},!0):m.updateModelSpecSync({type:"axes",index:R},{min:(T=(x=A.range)===null||x===void 0?void 0:x.min)!==null&&T!==void 0?T:0,max:(B=(M=A.range)===null||M===void 0?void 0:M.max)!==null&&B!==void 0?B:0},!0)}),(e=(t=y.internalProps.layoutMap)===null||t===void 0?void 0:t.updateDataStateToActiveChartInstance)===null||e===void 0||e.call(t,m),typeof a=="string")m.updateDataSync(a,h??[]);else{const A=[];for(const R in a){const x=a[R],T=d.series.find(M=>{var B;return((B=M==null?void 0:M.data)===null||B===void 0?void 0:B.id)===R});A.push({id:R,values:x?(n=h==null?void 0:h.filter(M=>M.hasOwnProperty(x)))!==null&&n!==void 0?n:[]:h??[],fields:(o=T==null?void 0:T.data)===null||o===void 0?void 0:o.fields}),m.updateFullDataSync||m.updateDataSync(R,x?(r=h==null?void 0:h.filter(M=>M.hasOwnProperty(x)))!==null&&r!==void 0?r:[]:h??[])}(s=m.updateFullDataSync)===null||s===void 0||s.call(m,A)}TW(m.getStage(),i)}function ER(i){Nm=!0,zm.length>0?requestAnimationFrame(()=>{const t=zm.splice(0,Wm);Om.splice(0,Wm),t.forEach(e=>{Vm(e),e.addUpdateBoundTag()}),i.render(),ER(i)}):Nm=!1}const wo=2e3;function TW(i,t){var e;const{viewWidth:n,viewHeight:o}=i;if(n<wo&&o<wo)return t.cacheCanvas=LR(i),void(t.isShareChartSpec||((e=t.chartInstance)===null||e===void 0||e.release(),t.chartInstance=null,t.setAttribute("chartInstance",null)));const r=Math.ceil(o/wo),s=Math.ceil(n/wo),l=[];for(let a=0;a<r;a++)for(let h=0;h<s;h++){const d=h*wo,u=a*wo,c=d+wo>n?n:d+wo,g=u+wo>o?o:u+wo,f=c-d,p=g-u,m=new hn;m.setValue(d,u,c,g);const b=LR(i,!1,m);l.push({canvas:b,x:d,y:u,width:f,height:p})}t.cacheCanvas=l}function LR(i,t=!0,e){if(i.releaseStatus==="released")return null;const n=i.window.getViewBoxTransform(),o=MW(i,t,e);o.setViewBoxTransform(n.a,n.b,n.c,n.d,0,0),i.renderTo(o);const r=o.getNativeHandler();return r.nativeCanvas?r.nativeCanvas:null}function MW(i,t=!0,e){const n=i.window.getViewBoxTransform(),o=Gt.get(ga),r=e?-e.x1:0,s=e?-e.y1:0,l=e?e.x2:i.viewWidth,a=e?e.y2:i.viewHeight,h=e?e.width():i.viewWidth,d=e?e.height():i.viewHeight;return o.create({viewBox:{x1:r,y1:s,x2:l,y2:a},width:h*n.a,height:d*n.d,dpr:i.window.dpr,canvasControled:!0,offscreen:!0,title:""}),i.renderTo(o),o}var BW=globalThis&&globalThis.__decorate||function(i,t,e,n){var o,r=arguments.length,s=r<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,e):n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(i,t,e,n);else for(var l=i.length-1;l>=0;l--)(o=i[l])&&(s=(r<3?o(s):r>3?o(t,e,s):o(t,e))||s);return r>3&&s&&Object.defineProperty(t,e,s),s};const PW=Symbol.for("ChartRender");let Ch=class extends Qi{constructor(){super(...arguments),this.numberType=PR}drawShape(i,t,e,n,o,r,s,l){var a,h,d,u;const c=Xt(i,r==null?void 0:r.theme).group,{dataId:g,data:f,spec:p}=i.attribute,{width:m=c.width,height:b=c.height}=(i.getViewBox(),i.attribute),{table:C}=i.getRootNode(),{active:_,cacheCanvas:w,activeChartInstance:y}=i;if(!_&&w)lt(w)?w.forEach(S=>{const{x:A,y:R,width:x,height:T,canvas:M}=S;t.drawImage(M,A,R,x,T)}):t.drawImage(w,e,n,m,b);else if(y){if(C.options.specFormat){const T=C.options.specFormat(i.attribute.spec);if(T.needFormatSpec&&T.spec){const M=T.spec;return void y.updateSpecSync(M)}}const S=i.getViewBox();y.updateViewBox({x1:0,x2:S.x2-S.x1,y1:0,y2:S.y2-S.y1},!1,!1);const A=y.getStage();A.needRender=!0;const R=i.globalTransMatrix.clone(),x=i.stage.window.getViewBoxTransform().clone();if(x.multiply(R.a,R.b,R.c,R.d,R.e,R.f),A.window.setViewBoxTransform(x.a,x.b,x.c,x.d,x.e,x.f),typeof g=="string")y.updateDataSync(g,f??[]);else{const T=[];for(const M in g){const B=g[M],P=p.series.find(F=>{var H;return((H=F==null?void 0:F.data)===null||H===void 0?void 0:H.id)===M});T.push({id:M,values:B?(a=f==null?void 0:f.filter(F=>F.hasOwnProperty(B)))!==null&&a!==void 0?a:[]:f??[],fields:(h=P==null?void 0:P.data)===null||h===void 0?void 0:h.fields}),y.updateFullDataSync||y.updateDataSync(M,B?(d=f==null?void 0:f.filter(F=>F.hasOwnProperty(B)))!==null&&d!==void 0?d:[]:f??[])}(u=y.updateFullDataSync)===null||u===void 0||u.call(y,T)}}else C.internalProps.renderChartAsync?(Om.indexOf(`${i.parent.col}+${i.parent.row}`)===-1&&(Om.push(`${i.parent.col}+${i.parent.row}`),zm.push(i)),AW()||ER(C)):Vm(i)}draw(i,t,e,n){this._draw(i,{},!1,e,n)}};Ch=BW([St()],Ch);var Vc=globalThis&&globalThis.__decorate||function(i,t,e,n){var o,r=arguments.length,s=r<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,e):n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(i,t,e,n);else for(var l=i.length-1;l>=0;l--)(o=i[l])&&(s=(r<3?o(s):r>3?o(t,e,s):o(t,e))||s);return r>3&&s&&Object.defineProperty(t,e,s),s};let jc=class{constructor(){this.time=pe.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(i,t,e,n,o,r,s,l,a,h,d,u,c){const{shape:g}=i.attribute;if(g==="circle"){const{width:f=a.width,height:p=a.height}=i.attribute;t.beginPath(),t.arc(e+f/2,n+p/2,Math.min(f,p)/2,0,2*Math.PI),t.closePath(),t.save(),t.clip()}}};jc=Vc([St()],jc);let $c=class{constructor(){this.time=pe.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(i,t,e,n,o,r,s,l,a,h,d,u,c){const{shape:g}=i.attribute;g==="circle"&&t.restore()}};$c=Vc([St()],$c);let Gc=class{constructor(){this.time=pe.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(i,t,e,n,o,r,s,l,a,h,d,u,c){const{isGif:g}=i.attribute;g&&i.playing&&(i.attribute.opacity=0)}};Gc=Vc([St()],Gc);let Uc=class{constructor(){this.time=pe.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(i,t,e,n,o,r,s,l,a,h,d,u,c){const{isGif:g}=i.attribute;g&&i.playing&&(i.attribute.opacity=1,t.globalAlpha=i.attribute.opacity,i.renderFrame(t,e,n))}};Uc=Vc([St()],Uc);function HW(i,t){var e,n,o,r,s,l,a,h,d,u,c;let g,f;if(i.role==="cell"&&z(i.mergeStartCol)&&z(i.mergeStartRow)&&z(i.mergeEndCol)&&z(i.mergeEndRow)){const{colStart:m,colEnd:b,rowStart:C,rowEnd:_}=kr(i,t.scenegraph);for(let w=m;w<=b;w++)for(let y=C;y<=_;y++){const S=kR(t.stateManager,w,y,i);!S||g&&S!=="cellBgColor"||(g=S)}}else i.role==="cell"&&(g=kR(t.stateManager,i.col,i.row,i));if(!g)return;const p=t.internalProps.layoutMap;return p.isCornerHeader(i.col,i.row)?f=((e=t.theme.cornerHeaderStyle)===null||e===void 0?void 0:e.hover)||((n=t.theme.headerStyle)===null||n===void 0?void 0:n.hover):p.isColumnHeader(i.col,i.row)?f=(o=t.theme.headerStyle)===null||o===void 0?void 0:o.hover:p.isRowHeader(i.col,i.row)?f=(r=t.theme.rowHeaderStyle)===null||r===void 0?void 0:r.hover:p.isBottomFrozenRow(i.col,i.row)?f=((s=t.theme.bottomFrozenStyle)===null||s===void 0?void 0:s.hover)||(t.isListTable()?(l=t.theme.bodyStyle)===null||l===void 0?void 0:l.hover:(a=t.theme.headerStyle)===null||a===void 0?void 0:a.hover):p.isRightFrozenColumn(i.col,i.row)?f=((h=t.theme.rightFrozenStyle)===null||h===void 0?void 0:h.hover)||(t.isListTable()?(d=t.theme.bodyStyle)===null||d===void 0?void 0:d.hover:(u=t.theme.rowHeaderStyle)===null||u===void 0?void 0:u.hover):t.isHeader(i.col,i.row)||(f=(c=t.theme.bodyStyle)===null||c===void 0?void 0:c.hover),wt(g,f,i.col,i.row,t)}function kR(i,t,e,n){var o;const{highlightScope:r,disableHeader:s,cellPos:l}=i.hover,a=i.table,h=a.isHeader(t,e);if(h&&s)return;let d;if(r===he.single&&l.col===t&&l.row===e?d="cellBgColor":r===he.column&&l.col===t?d=l.col===t&&l.row===e?"cellBgColor":"inlineColumnBgColor":r===he.row&&l.row===e?d=l.col===t&&l.row===e?"cellBgColor":"inlineRowBgColor":r===he.cross&&(l.col===t&&l.row===e?d="cellBgColor":l.col===t?d="inlineColumnBgColor":l.row===e&&(d="inlineRowBgColor")),d){let u;if(h){const c=a.getHeaderDefine(t,e);u=c==null?void 0:c.disableHeaderHover,n.firstChild&&n.firstChild.name==="axis"&&(!((o=a.options.hover)===null||o===void 0)&&o.disableAxisHover)&&(u=!0)}else{const c=a.getBodyColumnDefine(t,e);u=c==null?void 0:c.disableHover}u&&(d=void 0)}return d}function EW(i,t){var e,n,o,r,s,l,a,h,d,u,c;let g,f;if(i.role==="cell"&&z(i.mergeStartCol)&&z(i.mergeStartRow)&&z(i.mergeEndCol)&&z(i.mergeEndRow)){const{colStart:m,colEnd:b,rowStart:C,rowEnd:_}=kr(i,t.scenegraph);for(let w=m;w<=b;w++)for(let y=C;y<=_;y++){const S=FR(t.stateManager,w,y);!S||g&&S!=="cellBgColor"||(g=S)}}else i.role==="cell"&&(g=FR(t.stateManager,i.col,i.row));if(!g)return;const p=t.internalProps.layoutMap;return p.isCornerHeader(i.col,i.row)?f=((e=t.theme.cornerHeaderStyle)===null||e===void 0?void 0:e.select)||((n=t.theme.headerStyle)===null||n===void 0?void 0:n.select):p.isColumnHeader(i.col,i.row)?f=(o=t.theme.headerStyle)===null||o===void 0?void 0:o.select:p.isRowHeader(i.col,i.row)?f=(r=t.theme.rowHeaderStyle)===null||r===void 0?void 0:r.select:p.isBottomFrozenRow(i.col,i.row)?f=((s=t.theme.bottomFrozenStyle)===null||s===void 0?void 0:s.select)||(t.isListTable()?(l=t.theme.bodyStyle)===null||l===void 0?void 0:l.select:(a=t.theme.headerStyle)===null||a===void 0?void 0:a.select):p.isRightFrozenColumn(i.col,i.row)?f=((h=t.theme.rightFrozenStyle)===null||h===void 0?void 0:h.select)||(t.isListTable()?(d=t.theme.bodyStyle)===null||d===void 0?void 0:d.select:(u=t.theme.rowHeaderStyle)===null||u===void 0?void 0:u.select):t.isHeader(i.col,i.row)||(f=(c=t.theme.bodyStyle)===null||c===void 0?void 0:c.select),wt(g,f,i.col,i.row,t)}function LW(i){return i.start.col!==i.end.col||i.start.row!==i.end.row}function kW(i,t,e){let n;const{highlightScope:o,cellPos:r,ranges:s}=i.select,l=s[0],a=Math.min(l.start.col,l.end.col),h=Math.max(l.start.col,l.end.col),d=Math.min(l.start.row,l.end.row),u=Math.max(l.start.row,l.end.row);return o===he.single&&r.col===t&&r.row===e?n="cellBgColor":o===he.column&&t>=a&&t<=h?n=Yi(s[0],t,e)?"cellBgColor":"inlineColumnBgColor":o===he.row&&e>=d&&e<=u?n=Yi(s[0],t,e)?"cellBgColor":"inlineRowBgColor":o===he.cross&&(Yi(s[0],t,e)?n="cellBgColor":t>=a&&t<=h?n="inlineColumnBgColor":e>=d&&e<=u&&(n="inlineRowBgColor")),n}function FW(i,t,e){let n;const{highlightScope:o,cellPos:r}=i.select;return o===he.single&&r.col===t&&r.row===e?n="cellBgColor":o===he.column&&r.col===t?n=r.col===t&&r.row===e?"cellBgColor":"inlineColumnBgColor":o===he.row&&r.row===e?n=r.col===t&&r.row===e?"cellBgColor":"inlineRowBgColor":o===he.cross&&(r.col===t&&r.row===e?n="cellBgColor":r.col===t?n="inlineColumnBgColor":r.row===e&&(n="inlineRowBgColor")),n}function FR(i,t,e,n){const{highlightInRange:o,disableHeader:r,ranges:s}=i.select;let l;const a=s.length===1&&LW(s==null?void 0:s[0])&&o;if(a?(s==null?void 0:s.length)===1&&s[0].start&&s[0].end:(s==null?void 0:s.length)===1&&s[0].end.col===s[0].start.col&&s[0].end.row===s[0].start.row){const h=i.table,d=h.isHeader(t,e);if(d&&r)return;if(l=a?kW(i,t,e):FW(i,t,e),l){let u;if(d){const c=h.getHeaderDefine(t,e);u=c==null?void 0:c.disableHeaderSelect}else{const c=h.getBodyColumnDefine(t,e);u=c==null?void 0:c.disableSelect}u&&(l=void 0)}}else if(i.table.theme.selectionStyle.selectionFillMode==="replace")for(let h=0;h<s.length;h++){const d=s[h],u=Math.min(d.start.col,d.end.col),c=Math.max(d.start.col,d.end.col),g=Math.min(d.start.row,d.end.row),f=Math.max(d.start.row,d.end.row);if(u<=t&&g<=e&&c>=t&&f>=e){l="cellBgColor";break}}return l}function Kc(i,t,e){const n=i.getBodyColumnDefine(t,e),o=i.isHeader(t,e);return!(!(n!=null&&n.disableSelect)||o)||!(!o||!(n!=null&&n.disableHeaderSelect))}var er=globalThis&&globalThis.__decorate||function(i,t,e,n){var o,r=arguments.length,s=r<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,e):n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(i,t,e,n);else for(var l=i.length-1;l>=0;l--)(o=i[l])&&(s=(r<3?o(s):r>3?o(t,e,s):o(t,e))||s);return r>3&&s&&Object.defineProperty(t,e,s),s};let Yc=class{constructor(){this.time=pe.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(i,t,e,n,o,r,s,l,a,h,d,u,c){const{stroke:g=a.stroke,strokeArrayWidth:f=a.strokeArrayWidth,strokeArrayColor:p=a.strokeArrayColor}=i.attribute;g&&(Array.isArray(f)||Array.isArray(p))&&(c.doStroke=!1)}};Yc=er([St()],Yc);let Xc=class{constructor(){this.time=pe.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(i,t,e,n,o,r,s,l,a,h,d,u){var c,g;const{stroke:f=a.stroke,strokeArrayColor:p=a.strokeArrayColor,strokeArrayWidth:m=a.strokeArrayWidth,lineWidth:b=a.lineWidth,strokeColor:C=a.stroke,cornerRadius:_=a.cornerRadius}=i.attribute;let w,y,{width:S=a.width,height:A=a.height}=i.attribute;if(f&&(Array.isArray(m)||b!==0)&&(Array.isArray(p)||Array.isArray(m))){if(typeof b=="number"&&1&b||Array.isArray(m)&&m.some(R=>1&R)){const R=i.stage.table;if(!R)return;const x=((c=R==null?void 0:R.theme)===null||c===void 0?void 0:c.cellBorderClipDirection)==="bottom-right";if(x){if(e=Math.floor(e)-.5,n=Math.floor(n)-.5,i.role==="cell"){const B=i.col,P=i.row;B===0&&(e+=1),P===0&&(n+=1)}}else e=Math.floor(e)+.5,n=Math.floor(n)+.5;!((g=R.options.customConfig)===null||g===void 0)&&g._disableColumnAndRowSizeRound&&(S=Math.round(S),A=Math.round(A));const{width:T,height:M}=jm(i,Math.ceil(S),Math.ceil(A),x);w=T,y=M}else w=Math.ceil(S),y=Math.ceil(A);_===0||lt(_)&&_.every(R=>R===0)?DR(i,t,e,n,a,f,m||b,p||C,w,y):(t.beginPath(),no(t,e,n,w,y,_,new Array(4).fill(0).map((R,x)=>(T,M,B,P)=>{zR(x,T,M,B,P,i,t,e,n,a,f,m||b,p||C,w,y)})),t.stroke())}}};Xc=er([St()],Xc);function IR(i){if(!Array.isArray(i))return{isSplitDraw:!1,width:i};let t;for(let e=0;e<i.length;e++){const n=i[e];if(n)if(t){if(n!==t)return{isSplitDraw:!0}}else t=n}return{isSplitDraw:!1,width:t}}function DR(i,t,e,n,o,r,s,l,a,h,d,u){var c,g,f,p;const m=IR(s),b=!Array.isArray(s),C=!Array.isArray(r),_=Array.isArray(u),w=Array.isArray(l)||m.isSplitDraw;t.setStrokeStyle(i,i.attribute,e,n,o);const{lineDash:y=o.lineDash}=i.attribute;let S=!1;y.length&&y.some(M=>Array.isArray(M))&&(S=!0),t.beginPath(),t.moveTo(e,n);const A=(C||r[0])&&(b||s[0]),R=(C||r[1])&&(b||s[1]),x=(C||r[2])&&(b||s[2]),T=(C||r[3])&&(b||s[3]);if(A){const M=(b?m.width:s[0])/2,B=(b?m.width:s[0])/2;_&&Array.isArray(u[0])?(t.moveTo(e-M+(a+M+B)*u[0][0],n),t.lineTo(e-M+(a+M+B)*(u[0][1]-u[0][0]),n),t.moveTo(e+a+B,n)):(t.moveTo(e-M,n),t.lineTo(e+a+B,n)),(w||S)&&(l&&l[0]?t.strokeStyle=l[0]:t.strokeStyle="transparent",b||(t.lineWidth=s[0]),t.lineDashOffset=t.currentMatrix.e/t.currentMatrix.a,S&&t.setLineDash((c=y[0])!==null&&c!==void 0?c:[]),t.stroke(),t.beginPath(),t.moveTo(e+a,n))}else t.moveTo(e+a,n);if(R){const M=(b?m.width:s[1])/2,B=(b?m.width:s[1])/2;_&&Array.isArray(u[1])?(t.moveTo(e+a,n-M+h*u[1][0]),t.lineTo(e+a,n-M+(h+M+B)*(u[1][1]-u[1][0])),t.moveTo(e+a,n+h+B)):(t.moveTo(e+a,n-M),t.lineTo(e+a,n+h+B)),(w||S)&&(l&&l[1]?t.strokeStyle=l[1]:t.strokeStyle="transparent",b||(t.lineWidth=s[1]),t.lineDashOffset=t.currentMatrix.f/t.currentMatrix.d,S&&t.setLineDash((g=y[1])!==null&&g!==void 0?g:[]),t.stroke(),t.beginPath(),t.moveTo(e+a,n+h))}else t.moveTo(e+a,n+h);if(x){const M=(b?m.width:s[2])/2,B=(b?m.width:s[2])/2;_&&Array.isArray(u[2])?(t.moveTo(e-M+(a+M+B)*u[2][0],n+h),t.lineTo(e-M+(a+M+B)*(u[2][1]-u[2][0]),n+h),t.moveTo(e-M,n+h)):(t.moveTo(e-M,n+h),t.lineTo(e+a+B,n+h)),(w||S)&&(l&&l[2]?t.strokeStyle=l[2]:t.strokeStyle="transparent",b||(t.lineWidth=s[2]),t.lineDashOffset=t.currentMatrix.e/t.currentMatrix.a,S&&t.setLineDash((f=y[2])!==null&&f!==void 0?f:[]),t.stroke(),t.beginPath(),t.moveTo(e,n+h))}else t.moveTo(e,n+h);if(T){const M=(b?m.width:s[3])/2,B=(b?m.width:s[3])/2;_&&Array.isArray(u[3])?(t.moveTo(e,n-M+(h+M+B)*u[3][0]),t.lineTo(e,n-M+(h+M+B)*(u[3][1]-u[3][0])),t.moveTo(e,n-M)):(t.moveTo(e,n-M),t.lineTo(e,n+h+B)),(w||S)&&(l&&l[3]?t.strokeStyle=l[3]:t.strokeStyle="transparent",b||(t.lineWidth=s[3]),t.lineDashOffset=t.currentMatrix.f/t.currentMatrix.d,S&&t.setLineDash((p=y[3])!==null&&p!==void 0?p:[]),t.stroke(),t.beginPath(),t.moveTo(e,n))}else t.moveTo(e,n);w||S||(!b&&m.width&&(t.lineWidth=m.width),t.stroke()),t.lineDashOffset=0,t.setLineDash([])}let qc=class{constructor(){this.time=pe.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(i,t,e,n,o,r,s,l,a,h,d,u,c){var g;const{lineDash:f=a.lineDash,stroke:p=a.stroke,strokeArrayColor:m=a.strokeArrayColor,strokeArrayWidth:b=a.strokeArrayWidth}=i.attribute;p&&Array.isArray(f)&&f.length&&(!((g=f[0])===null||g===void 0)&&g.length)&&!Array.isArray(m)&&!Array.isArray(b)&&(c.doStroke=!1)}};qc=er([St()],qc);let Zc=class{constructor(){this.time=pe.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(i,t,e,n,o,r,s,l,a,h,d,u){var c,g,f,p,m,b;const{lineDash:C=a.lineDash,stroke:_=a.stroke,strokeArrayColor:w=a.strokeArrayColor,strokeArrayWidth:y=a.strokeArrayWidth,lineWidth:S=a.lineWidth}=i.attribute;if(!_||!(Array.isArray(C)&&C.length&&(!((c=C[0])===null||c===void 0)&&c.length))||Array.isArray(w)||Array.isArray(y))return;const A=i.stage.table;if(!A)return;const R=lt(C[0])?IW(C):[C,C,C,C];let x,T,{width:M=a.width,height:B=a.height}=i.attribute;if(!((g=A.options.customConfig)===null||g===void 0)&&g._disableColumnAndRowSizeRound?(M=Math.round(M),B=Math.round(B)):(M=Math.ceil(M),B=Math.ceil(B)),1&S){const P=A.theme.cellBorderClipDirection==="bottom-right",F=0,H=0;P?(e=Math.floor(e)-.5,n=Math.floor(n)-.5,i.role==="cell"&&(i.col===0&&(e+=1),i.row===0&&(n+=1))):(e=Math.floor(e)+.5,n=Math.floor(n)+.5);const{width:E,height:k}=jm(i,Math.ceil(M+F),Math.ceil(B+H),P);x=E,T=k}else x=Math.ceil(M),T=Math.ceil(B);t.setStrokeStyle(i,i.attribute,e,n,a),t.beginPath(),t.moveTo(e,n),t.lineTo(e+x,n),t.lineDashOffset=t.currentMatrix.e/t.currentMatrix.a,t.setLineDash((f=R[0])!==null&&f!==void 0?f:[]),t.stroke(),t.beginPath(),t.moveTo(e+x,n),t.lineTo(e+x,n+T),t.lineDashOffset=t.currentMatrix.f/t.currentMatrix.d,t.setLineDash((p=R[1])!==null&&p!==void 0?p:[]),t.stroke(),t.beginPath(),t.moveTo(e,n+T),t.lineTo(e+x,n+T),t.lineDashOffset=t.currentMatrix.e/t.currentMatrix.a,t.setLineDash((m=R[2])!==null&&m!==void 0?m:[]),t.stroke(),t.beginPath(),t.moveTo(e,n),t.lineTo(e,n+T),t.lineDashOffset=t.currentMatrix.f/t.currentMatrix.d,t.setLineDash((b=R[3])!==null&&b!==void 0?b:[]),t.stroke(),t.lineDashOffset=0,t.setLineDash([])}};Zc=er([St()],Zc);let Jc=class{constructor(){this.time=pe.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(i,t,e,n,o,r,s,l,a,h,d,u,c){const{lineWidth:g=a.lineWidth,stroke:f=a.stroke,lineDash:p=a.lineDash,strokeArrayWidth:m=a.strokeArrayWidth,strokeArrayColor:b=a.strokeArrayColor,notAdjustPos:C}=i.attribute;C!==!0&&f&&Array.isArray(p)&&!p.length&&!Array.isArray(b)&&!Array.isArray(m)&&1&g&&(c.doStroke=!1)}};Jc=er([St()],Jc);let Qc=class{constructor(){this.time=pe.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(i,t,e,n,o,r,s,l,a,h,d,u){var c,g;const{lineWidth:f=a.lineWidth,stroke:p=a.stroke,lineDash:m=a.lineDash,strokeArrayWidth:b=a.strokeArrayWidth,strokeArrayColor:C=a.strokeArrayColor,notAdjustPos:_,cornerRadius:w=a.cornerRadius}=i.attribute;let{width:y=a.width,height:S=a.height}=i.attribute;if(_!==!0&&p&&Array.isArray(m)&&!m.length&&!Array.isArray(C)&&!Array.isArray(b)&&1&f){const A=i.stage.table;if(!A)return;!((c=A.options.customConfig)===null||c===void 0)&&c._disableColumnAndRowSizeRound&&(y=Math.round(y),S=Math.round(S)),t.beginPath();const R=((g=A==null?void 0:A.theme)===null||g===void 0?void 0:g.cellBorderClipDirection)==="bottom-right",x=0,T=0;R?(e=Math.floor(e)-.5,n=Math.floor(n)-.5,i.role==="cell"&&(i.col===0&&(e+=1),i.row===0&&(n+=1))):(e=Math.floor(e)+.5,n=Math.floor(n)+.5);const{width:M,height:B}=jm(i,Math.ceil(y),Math.ceil(S),R);w?no(t,e,n,M+x,B+T,w):t.rect(e,n,M,B),t.setStrokeStyle(i,i.attribute,e,n,a),t.stroke()}}};Qc=er([St()],Qc);let tg=class{constructor(){this.time=pe.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(i,t,e,n,o,r,s,l,a,h,d,u,c){if(i.role==="cell"){const g=i.stage.table;if(g){const f=EW(i,g);if(f)i.attribute._vtableHightLightFill=f;else if(g.stateManager.interactionState!==$t.scrolling){const p=HW(i,g);p&&(i.attribute._vtableHightLightFill=p)}}}}};tg=er([St()],tg);let eg=class{constructor(){this.time=pe.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(i,t,e,n,o,r,s,l,a,h,d,u){if(i.attribute._vtableHightLightFill&&!d){if(s){const c=i.attribute.fill;i.attribute.fill=i.attribute._vtableHightLightFill,t.setCommonStyle(i,i.attribute,e,n,a),t.fill(),i.attribute.fill=c,i.attribute._vtableHightLightFill=void 0}}}};eg=er([St()],eg);let ig=class{constructor(){this.time=pe.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(i,t,e,n,o,r,s,l,a,h,d,u,c){var g,f,p,m,b,C;const _=i.stage.table;_&&(i.role==="body"?ir(t,-((g=i.attribute.x)!==null&&g!==void 0?g:0)+_.getFrozenColsWidth(),-((f=i.attribute.y)!==null&&f!==void 0?f:0)+_.getFrozenRowsHeight(),i.parent.attribute.width-_.getFrozenColsWidth()-_.getRightFrozenColsWidth(),i.parent.attribute.height-_.getFrozenRowsHeight()-_.getBottomFrozenRowsHeight()):i.role==="row-header"?ir(t,0,-((p=i.attribute.y)!==null&&p!==void 0?p:0)+_.getFrozenRowsHeight(),_.getFrozenColsWidth(),i.parent.attribute.height-_.getFrozenRowsHeight()-_.getBottomFrozenRowsHeight()):i.role==="col-header"?ir(t,-((m=i.attribute.x)!==null&&m!==void 0?m:0)+_.getFrozenColsWidth(),0,i.parent.attribute.width-_.getFrozenColsWidth()-_.getRightFrozenColsWidth(),_.getFrozenRowsHeight()):i.role==="right-frozen"?ir(t,0,-((b=i.attribute.y)!==null&&b!==void 0?b:0)+_.getFrozenRowsHeight(),_.getRightFrozenColsWidth(),i.parent.attribute.height-_.getFrozenRowsHeight()-_.getBottomFrozenRowsHeight()):i.role==="bottom-frozen"?ir(t,-((C=i.attribute.x)!==null&&C!==void 0?C:0)+_.getFrozenColsWidth(),0,i.parent.attribute.width-_.getFrozenColsWidth()-_.getRightFrozenColsWidth(),_.getBottomFrozenRowsHeight()):i.role==="corner-header"?ir(t,0,0,_.getFrozenColsWidth(),_.getFrozenRowsHeight()):i.role==="corner-right-top-header"?ir(t,0,0,_.getRightFrozenColsWidth(),_.getFrozenRowsHeight()):i.role==="corner-right-bottom-header"?ir(t,0,0,_.getRightFrozenColsWidth(),_.getBottomFrozenRowsHeight()):i.role==="corner-left-bottom-header"&&ir(t,0,0,_.getFrozenColsWidth(),_.getBottomFrozenRowsHeight()))}};ig=er([St()],ig);const Al=Math.pow(2,24);function ir(i,t,e,n,o){i.beginPath();const r=i.applyedMatrix;Math.abs(r.f)>Al||Math.abs(r.g)>Al?i.rect(t-Al,e-Al,n+2*Al,o+2*Al):i.rect(t,e,n,o)}function jm(i,t,e,n){const o=i.stage.table;if(!o)return{width:t,height:e};if(i.role==="cell"){let r=i.col,s=i.row;const l=ui(o,r,s);l&&(r=l.end.col,s=l.end.row),r!==o.colCount-1||n?(r===o.frozenColCount-1&&o.scrollLeft&&!n||r===0&&n)&&(t-=1):t-=1,s!==o.rowCount-1||n?(s===o.frozenRowCount-1&&o.scrollTop&&!n||s===0&&n)&&(e-=1):e-=1}else i.role==="corner-frozen"&&(o.scrollLeft&&!n&&(t-=1),o.scrollTop&&!n&&(e-=1));return{width:t,height:e}}function IW(i){return i.length===1?[i[0],i[0],i[0],i[0]]:i.length===2?[i[0],i[1],i[0],i[1]]:i}var OR=globalThis&&globalThis.__decorate||function(i,t,e,n){var o,r=arguments.length,s=r<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,e):n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(i,t,e,n);else for(var l=i.length-1;l>=0;l--)(o=i[l])&&(s=(r<3?o(s):r>3?o(t,e,s):o(t,e))||s);return r>3&&s&&Object.defineProperty(t,e,s),s};let yh=class{constructor(){this.time=pe.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(i,t,e,n,o,r,s,l,a,h,d,u,c){const{stroke:g=a.stroke,strokeArrayWidth:f=a.strokeArrayWidth,strokeArrayColor:p=a.strokeArrayColor}=i.attribute;g&&(Array.isArray(g)||Array.isArray(f)||Array.isArray(p))&&(c.doStroke=!1)}};yh=OR([St()],yh);let _h=class{constructor(){this.time=pe.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(i,t,e,n,o,r,s,l,a,h,d,u){const{width:c=a.width,height:g=a.height,stroke:f=a.stroke,strokeArrayColor:p=a.strokeArrayColor,strokeArrayWidth:m=a.strokeArrayWidth,lineWidth:b=a.lineWidth,strokeColor:C=a.stroke,cornerRadius:_=a.cornerRadius}=i.attribute;f&&(Array.isArray(m)||b!==0)&&(Array.isArray(f)||Array.isArray(p)||Array.isArray(m))&&(i.name!=="border-rect"&&i.name!=="table-border-rect"&&(typeof b=="number"&&1&b||Array.isArray(m)&&m.some(S=>1&S))&&(e=Math.floor(e)+.5,n=Math.floor(n)+.5),_===0||lt(_)&&_.every(S=>S===0)?DR(i,t,e,n,a,f,m||b,p||C,Math.ceil(c+0),Math.ceil(g+0)):(t.beginPath(),no(t,e,n,c,g,_,new Array(4).fill(0).map((S,A)=>(R,x,T,M)=>{zR(A,R,x,T,M,i,t,e,n,a,f,m||b,p||C,Math.ceil(c+0),Math.ceil(g+0))})),t.stroke()))}};_h=OR([St()],_h);function zR(i,t,e,n,o,r,s,l,a,h,d,u,c,g,f){var p,m,b,C;const _=r,w=h,y=IR(u),S=!Array.isArray(u),A=!Array.isArray(d),R=Array.isArray(c)||y.isSplitDraw;s.setStrokeStyle(r,r.attribute,l,a,h);const{lineDash:x=w.lineDash}=_.attribute;let T=!1;x.length&&x.some(H=>Array.isArray(H))&&(T=!0),s.moveTo(l,a);const M=(A||d[0])&&(S||u[0]),B=(A||d[1])&&(S||u[1]),P=(A||d[2])&&(S||u[2]),F=(A||d[3])&&(S||u[3]);M&&i===0?(S?y.width:u[0],S?y.width:u[0],s.moveTo(t,e),s.lineTo(n,o),(R||T)&&(c&&c[0]?s.strokeStyle=c[0]:s.strokeStyle="transparent",S||(s.lineWidth=u[0]),s.lineDashOffset=s.currentMatrix.e/s.currentMatrix.a,T&&s.setLineDash((p=x[0])!==null&&p!==void 0?p:[]),s.stroke(),s.beginPath())):i===0&&s.moveTo(l+g,a),B&&i===1?(S?y.width:u[1],S?y.width:u[1],s.moveTo(t,e),s.lineTo(n,o),(R||T)&&(c&&c[1]?s.strokeStyle=c[1]:s.strokeStyle="transparent",S||(s.lineWidth=u[1]),s.lineDashOffset=s.currentMatrix.f/s.currentMatrix.d,T&&s.setLineDash((m=x[1])!==null&&m!==void 0?m:[]),s.stroke(),s.beginPath(),s.moveTo(l+g,a+f))):i===1&&s.moveTo(l+g,a+f),P&&i===2?(S?y.width:u[2],S?y.width:u[2],s.moveTo(t,e),s.lineTo(n,o),(R||T)&&(c&&c[2]?s.strokeStyle=c[2]:s.strokeStyle="transparent",S||(s.lineWidth=u[2]),s.lineDashOffset=s.currentMatrix.e/s.currentMatrix.a,T&&s.setLineDash((b=x[2])!==null&&b!==void 0?b:[]),s.stroke(),s.beginPath(),s.moveTo(l,a+f))):i===2&&s.moveTo(l,a+f),F&&i===3?(S?y.width:u[3],S?y.width:u[3],s.moveTo(t,e),s.lineTo(n,o),(R||T)&&(c&&c[3]?s.strokeStyle=c[3]:s.strokeStyle="transparent",S||(s.lineWidth=u[3]),s.lineDashOffset=s.currentMatrix.f/s.currentMatrix.d,T&&s.setLineDash((C=x[3])!==null&&C!==void 0?C:[]),s.stroke(),s.beginPath(),s.moveTo(l,a))):i===3&&s.moveTo(l,a),R||T||(!S&&y.width&&(s.lineWidth=y.width),s.stroke()),s.lineDashOffset=0,s.setLineDash([]),s.closePath()}var DW=globalThis&&globalThis.__decorate||function(i,t,e,n){var o,r=arguments.length,s=r<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,e):n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(i,t,e,n);else for(var l=i.length-1;l>=0;l--)(o=i[l])&&(s=(r<3?o(s):r>3?o(t,e,s):o(t,e))||s);return r>3&&s&&Object.defineProperty(t,e,s),s};let wh,ng=class{constructor(){this.order=1,this.interceptors=[new OW]}afterDrawItem(i,t,e,n,o){for(let r=0;r<this.interceptors.length;r++)if(this.interceptors[r].afterDrawItem&&this.interceptors[r].afterDrawItem(i,t,e,n,o))return!0;return!1}beforeDrawItem(i,t,e,n,o){if((!i.in3dMode||e.in3dInterceptor)&&!i.shadowRoot&&!(i.baseGraphic||i.attribute.globalZIndex||i.interactiveGraphic))return!1;for(let r=0;r<this.interceptors.length;r++)if(this.interceptors[r].beforeDrawItem&&this.interceptors[r].beforeDrawItem(i,t,e,n,o))return!0;return!1}};ng=DW([St()],ng);class OW{constructor(){this.order=1}afterDrawItem(t,e,n,o,r){return t.type==="image"&&this.drawItem(t,e,n,o,r),!1}drawItem(t,e,n,o,r){const{image:s,gif:l}=t.attribute;if(l&&t.playing||!s||!t.resources)return!1;const a=t.resources.get(s);if(!a||a.state!=="loading")return!1;if(!wh){const p=vn(),m=p.loading_pic.svg,b=p.loading_pic.width,C=p.loading_pic.height;wh=gu({width:b,height:C,image:m})}const{image:h}=wh.attribute;if(!s||!wh.resources)return!1;const d=wh.resources.get(h);if(d.state!=="success")return!1;const{context:u}=n;u.highPerformanceSave(),t.parent&&u.setTransformFromMatrix(t.parent.globalTransMatrix,!0),t.glyphHost&&t.glyphHost.parent&&u.setTransformFromMatrix(t.glyphHost.parent.globalTransMatrix,!0);const c=t.AABBBounds,{width:g,height:f}=Ec(d.data.width,d.data.height,c.width(),c.height());return u.drawImage(d.data,c.x1+(c.width()-g)/2,c.y1+(c.height()-f)/2,g,f),u.highPerformanceRestore(),!0}}var zW=globalThis&&globalThis.__decorate||function(i,t,e,n){var o,r=arguments.length,s=r<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,e):n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(i,t,e,n);else for(var l=i.length-1;l>=0;l--)(o=i[l])&&(s=(r<3?o(s):r>3?o(t,e,s):o(t,e))||s);return r>3&&s&&Object.defineProperty(t,e,s),s};let og=class{constructor(){this.time=pe.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(i,t,e,n,o,r,s,l,a,h,d,u,c){var g,f;const{text:p,underline:m=a.underline,lineThrough:b=a.lineThrough,direction:C=a.direction,whiteSpace:_=a.whiteSpace,fontSize:w=a.fontSize,verticalMode:y=a.verticalMode,ellipsis:S=a.ellipsis,textAlign:A=a.textAlign,textBaseline:R=a.textBaseline,x=a.x,y:T=a.y}=i.attribute;let M=!1;if(Array.isArray(i)){const H=(g=i.cache)===null||g===void 0?void 0:g.layoutData;S&&H&&H.lines.every(E=>E.str==="")&&(M=!0)}else{const{cache:H}=i;S&&H&&H.clipedText===""&&H.clipedWidth===0&&(M=!0)}if(!M)return;const B=ce(S)?S:"...",P=(f=Vo(i.attribute.lineHeight,w))!==null&&f!==void 0?f:w;let F=0;P!==w&&(R==="top"?F=(P-w)/2:R==="middle"||R==="bottom"&&(F=-(P-w)/2)),r&&(u?u(t,i.attribute,a):l&&(t.setStrokeStyle(i,i.attribute,x-e,T-n,a),t.strokeText(B,x,T+F))),o&&(d?d(t,i.attribute,a):s&&(t.setCommonStyle(i,i.attribute,x-e,T-n,a),t.fillText(B,x,T+F),this.drawUnderLine(m,b,i,x,T+F,0,a,t,B)))}drawUnderLine(i,t,e,n,o,r,s,l,a){if(t+i<=0)return;const{textAlign:h=s.textAlign,textBaseline:d=s.textBaseline,fontSize:u=s.fontSize,fontFamily:c=s.fontFamily,fontWeight:g=s.fontWeight,fontStyle:f=s.fontStyle,fill:p=s.fill,opacity:m=s.opacity,underlineOffset:b=s.underlineOffset,underlineDash:C=s.underlineDash,fillOpacity:_=s.fillOpacity}=e.attribute;if(!i&&!t)return;const w=CR.measureTextWidth(a,{fontSize:u,fontFamily:c,fontWeight:g,fontStyle:f}),y=po(h,w),S=mo(d,u,u),A={lineWidth:0,stroke:p,opacity:m,strokeOpacity:_};if(i){A.lineWidth=i,l.setStrokeStyle(e,A,n,o,s),l.setLineDash(C),l.beginPath();const R=o+S+u+b;l.moveTo(n+y,R,r),l.lineTo(n+y+w,R,r),l.stroke()}if(t){A.lineWidth=t,l.setStrokeStyle(e,A,n,o,s),l.beginPath();const R=o+S+u/2;l.moveTo(n+y,R,r),l.lineTo(n+y+w,R,r),l.stroke()}}};og=zW([St()],og);const WW=new Ut((i,t,e,n)=>{e(il)?n(il).to(yh).inSingletonScope():(i(yh).toSelf().inSingletonScope(),i(ss).toService(yh)),e(nl)?n(nl).to(_h).inSingletonScope():(i(_h).toSelf().inSingletonScope(),i(ss).toService(_h)),i(Ch).toSelf().inSingletonScope(),i(PW).to(Ch),i(Ui).to(Ch),i(jc).toSelf().inSingletonScope(),i(rs).toService(jc),i($c).toSelf().inSingletonScope(),i(rs).toService($c),i(Gc).toSelf().inSingletonScope(),i(rs).toService(Gc),i(Uc).toSelf().inSingletonScope(),i(rs).toService(Uc),i(tg).toSelf().inSingletonScope(),i(to).toService(tg),i(eg).toSelf().inSingletonScope(),i(to).toService(eg),i(Xc).toSelf().inSingletonScope(),i(to).toService(Xc),i(Yc).toSelf().inSingletonScope(),i(to).toService(Yc),i(qc).toSelf().inSingletonScope(),i(to).toService(qc),i(Zc).toSelf().inSingletonScope(),i(to).toService(Zc),i(Jc).toSelf().inSingletonScope(),i(to).toService(Jc),i(Qc).toSelf().inSingletonScope(),i(to).toService(Qc),i(ig).toSelf().inSingletonScope(),i(to).toService(ig),i(ng).toSelf().inSingletonScope(),i(Ba).toService(ng),i(og).toSelf().inSingletonScope(),i(Vd).toService(og)});function Wn(i,t,e,n){var o,r,s,l,a,h,d,u;i.internalProps.columnWidthConfig&&i._parseColumnWidthConfig(i.internalProps.columnWidthConfig),t=t??0,e=e??i.colCount-1,t===0&&e===i.colCount-1&&i._clearColRangeWidthsMap();const c=i.internalProps.layoutMap;i.isPivotTable()&&(c.enableUseGetBodyCache(),c.enableUseHeaderPathCache());const g=[],f=[];if(n)for(let p=0;p<i.colCount;p++)g[p]=i.getColWidth(p);for(let p=t;p<=e;p++){let m;if(i.internalProps.transpose||((r=(o=i.internalProps.layoutMap.columnObjects)===null||o===void 0?void 0:o[p])===null||r===void 0?void 0:r.columnWidthComputeMode)!=="only-header"&&i.columnWidthComputeMode!=="only-header"||!("showHeader"in i.internalProps.layoutMap))m=i.internalProps.transpose||((l=(s=i.internalProps.layoutMap.columnObjects)===null||s===void 0?void 0:s[p])===null||l===void 0?void 0:l.columnWidthComputeMode)!=="only-body"&&i.columnWidthComputeMode!=="only-body"?Fr(p,0,i.rowCount-1,i):Fr(p,i.internalProps.layoutMap.getBodyRange().start.row,i.internalProps.layoutMap.getBodyRange().end.row,i);else{const b=i.internalProps.layoutMap.showHeader;i.internalProps.layoutMap.showHeader=!0,m=Fr(p,0,i.internalProps.layoutMap.headerLevelCount-1,i),i.internalProps.layoutMap.showHeader=b}i._setColContentWidth(p,m),i.getColWidth(p)!==m&&i._clearColRangeWidthsMap(p),n?f[p]=Math.round(i._adjustColWidth(p,m)):i._setColWidth(p,i._adjustColWidth(p,m),!1,!0)}if(i.widthMode==="adaptive"){i._clearColRangeWidthsMap();const p=i.tableNoFrameWidth;let m=0,b=0,C=i.colCount;if(i.widthAdaptiveMode==="only-body"){for(let _=0;_<i.colCount;_++){const w=n&&(a=f[_])!==null&&a!==void 0?a:i.getColWidth(_);(_<i.rowHeaderLevelCount||i.isPivotChart()&&_>=i.colCount-i.rightFrozenColCount)&&(m+=w)}b=i.rowHeaderLevelCount,C=i.isPivotChart()?i.colCount-i.rightFrozenColCount:i.colCount}rg(p-m,b,C,n,f,i)}else if(i.autoFillWidth){i._clearColRangeWidthsMap();const p=i.tableNoFrameWidth;let m=0,b=0;for(let C=0;C<i.colCount;C++){const _=n&&(h=f[C])!==null&&h!==void 0?h:i.getColWidth(C);(C<i.rowHeaderLevelCount||i.isPivotChart()&&C>=i.colCount-i.rightFrozenColCount)&&(m+=_),b+=_}b<p&&b>m&&rg(p-m,i.rowHeaderLevelCount,i.isPivotChart()?i.colCount-i.rightFrozenColCount:i.colCount,n,f,i)}if(n){for(let p=0;p<i.colCount;p++){const m=(u=(d=f[p])!==null&&d!==void 0?d:i.getColWidth(p))!==null&&u!==void 0?u:i.getColWidth(p);m!==g[p]&&i._setColWidth(p,m,!1,!0)}i.stateManager.checkFrozen();for(let p=0;p<i.colCount;p++){const m=i.getColWidth(p);m!==g[p]&&i.scenegraph.updateColWidth(p,m-g[p],!0,!0)}i.scenegraph.updateContainer(!0)}i.isPivotTable()&&(c.disableUseGetBodyCache(),c.disableUseHeaderPathCache())}function Fr(i,t,e,n,o=!1){let r=$W(i,n);return n.internalProps.transpose&&r==="auto"&&(n.columnWidthComputeMode==="only-header"&&i>=n.rowHeaderLevelCount||n.columnWidthComputeMode==="only-body"&&i<n.rowHeaderLevelCount)&&(r=n.getDefaultColumnWidth(i)),o&&!n.internalProps.transpose?WR(r,i,t,e,o,n):typeof r=="number"?r:r!=="auto"&&typeof r=="string"?n._adjustColWidth(i,n._colWidthDefineToPxWidth(r)):WR(r,i,t,e,o,n)}function WR(i,t,e,n,o,r){var s,l,a,h,d;let u=0,c=1,g=1;if(n-e>5e3&&(g=Math.ceil((n-e)/5e3)),r.isPivotChart()&&t>=r.rowHeaderLevelCount&&t<r.colCount-r.rightFrozenColCount){if(r.internalProps.layoutMap.indicatorsAsCol)return r.defaultColWidth;{const m=r.internalProps.layoutMap.getOptimunWidthForChart(t);if(m>0)return m}}for(let m=e;m<=n;m+=c){if(r.isPivotChart()){const A=r.internalProps.layoutMap,R=A.getAxisConfigInPivotChart(t,m);if(R){const x=Bt.getFunction("computeAxisComponentWidth")(R,r);if(typeof x=="number"){u=Math.max(x,u);continue}}else if(A.isLeftBottomCorner(t,m)||A.isRightTopCorner(t,m)||A.isRightBottomCorner(t,m))continue}const b=NW(t,m,r);if(b&&(u=Math.max(b.width,u),!b.renderDefault))continue;const C=i;if(typeof C=="number"&&r.widthMode==="standard"&&!o){u=Math.max(C,u);continue}const _=r.isHeader(t,m)?(s=r._getHeaderLayoutMap(t,m))===null||s===void 0?void 0:s.headerType:r.getBodyColumnType(t,m);if(z(_)&&_!=="text"&&_!=="link"&&_!=="progressbar"&&_!=="checkbox"&&_!=="radio"){u=Math.max(u,r.getColWidthDefinedNumber(t)||0);continue}let w=0;const y=r.internalProps.layoutMap;if(y.isHeader(t,m)){const A=y.getHeader(t,m);if(((l=A==null?void 0:A.define)===null||l===void 0?void 0:l.columnWidthComputeMode)==="only-body")continue;z(A==null?void 0:A.hierarchyLevel)&&(w=((a=A.hierarchyLevel)!==null&&a!==void 0?a:0)*((h=y.rowHierarchyIndent)!==null&&h!==void 0?h:0),y.rowHierarchyTextStartAlignment&&!r.internalProps.headerHelper.getHierarchyIcon(t,m)&&(w+=r.internalProps.headerHelper.getHierarchyIconWidth()))}else if(r.isListTable()){c=g;const A=r.getBodyColumnDefine(t,m);if(A!=null&&A.tree){const R=r.dataSource.getIndexKey(r.getRecordShowIndexByCell(t,m));w=Array.isArray(R)&&r.getHierarchyState(t,m)!==Vt.none?(R.length-1)*((d=y.hierarchyIndent)!==null&&d!==void 0?d:0):0,y.hierarchyTextStartAlignment&&!r.internalProps.bodyHelper.getHierarchyIcon(t,m)&&(w+=r.internalProps.headerHelper.getHierarchyIconWidth())}}const S=VW(t,m,_,r);u=Math.max(S+w,u),c>1&&r.bottomFrozenRowCount>0&&m<r.rowCount-r.bottomFrozenRowCount&&m+c>=r.rowCount-r.bottomFrozenRowCount&&(m=r.rowCount-r.bottomFrozenRowCount-c,c=1,g=1)}const f=r.getMinColWidth(t),p=r.getMaxColWidth(t);return u<f?f:u>p?p:(u<=0&&(u=r.defaultColWidth),u)}function NW(i,t,e){var n,o,r,s,l,a,h;const d=e.getCustomRender(i,t);let u=e.getCustomLayout(i,t);if(d||u){let c,g=1,f=0,p=!1,m=!1;(e.isHeader(i,t)||!((n=e.getBodyColumnDefine(i,t))===null||n===void 0)&&n.mergeCell||e.hasCustomMerge())&&(c=e.getCellRange(i,t),g=c.end.col-c.start.col+1);const b={col:(o=c==null?void 0:c.start.col)!==null&&o!==void 0?o:i,row:(r=c==null?void 0:c.start.row)!==null&&r!==void 0?r:t,dataValue:e.getCellOriginValue(i,t),value:e.getCellValue(i,t)||"",rect:jW(i,t,e),table:e,originCol:i,originRow:t};if(u==="react-custom-layout"&&(u=((s=e.reactCustomLayout)===null||s===void 0?void 0:s.getCustomLayoutFunc(i,t))||hh),ue(u)){const C=u(b);if(C.rootContainer){C.rootContainer=dh(C.rootContainer),Bc(C.rootContainer,0,e.getRowHeight(t));const _=C.rootContainer.attribute.width;C.rootContainer.setStage(e.scenegraph.stage),f=_>0?_:(l=C.rootContainer.AABBBounds.width())!==null&&l!==void 0?l:0,p=C.renderDefault,m=C.enableCellPadding}else f=0,p=C.renderDefault,m=C.enableCellPadding}else if(typeof d=="function"){const C=d(b);f=(a=C==null?void 0:C.expectedWidth)!==null&&a!==void 0?a:0,p=C==null?void 0:C.renderDefault}else f=(h=d==null?void 0:d.expectedWidth)!==null&&h!==void 0?h:0,p=d==null?void 0:d.renderDefault;if(f=Math.ceil(f),m){const C=e._getCellStyle(i,t),_=Qt(wt("padding",C,i,t,e));f+=_[1]+_[3]}return{width:f/g,renderDefault:p}}}function VW(i,t,e,n){var o,r,s;let l=0;const a=n.getCellValue(i,t),h=n._getCellStyle(i,t);let d=0,u=!1;if(n.getCellLocation(i,t)!=="body")u=!0;else{const w=n.getBodyColumnDefine(i,t);u=!!(w!=null&&w.icon)||!!(w!=null&&w.tree)||(w==null?void 0:w.dragOrder)}if(u){const w=n.getCellIcons(i,t);w==null||w.forEach(y=>{var S,A,R;y.positionType!==me.absoluteRight&&(d+=((S=y.width)!==null&&S!==void 0?S:0)+((A=y.marginLeft)!==null&&A!==void 0?A:0)+((R=y.marginRight)!==null&&R!==void 0?R:0))})}let c=1;if(n.isHeader(i,t)||!((o=n.getBodyColumnDefine(i,t))===null||o===void 0)&&o.mergeCell||n.hasCustomMerge()){const w=n.getCellRange(i,t);c=w.end.col-w.start.col+1}const g=Qt(wt("padding",h,i,t,n)),f=g[1]+g[3],p=wt("fontSize",h,i,t,n),m=wt("fontFamily",h,i,t,n),b=wt("fontWeight",h,i,t,n);let C;if(e==="checkbox")C=ge(a)?a.text:a;else if(e==="radio")if(lt(a)){C="";const w=n.getBodyColumnDefine(i,t),y=(r=w==null?void 0:w.radioDirectionInCell)!==null&&r!==void 0?r:"vertical";y==="vertical"?a.forEach(S=>{C+=(ge(S)?S.text:S).toString()+`
|
|
126
|
-
`}):y==="horizontal"&&a.forEach(S=>{C+=(ge(S)?S.text:S).toString()})}else C=ge(a)?a.text:a;else C=a;const _=ph(C,n).text;if(_.length>=1&&(_.length!==1||_[0]!=="")?_.forEach(w=>{const y=n.measureText(w,{fontSize:p,fontFamily:m,fontWeight:b}).width;l=Math.max((y+f+4+d)/c,l)}):l=Math.max((f+4+d)/c,l),n.internalProps.limitMaxAutoWidth!==!1&&(l=Math.min(typeof n.internalProps.limitMaxAutoWidth=="number"?n.internalProps.limitMaxAutoWidth:450,l)),e==="checkbox"){const w=wt("size",h,i,t,n);if(l+=w,C){const y=wt("spaceBetweenTextAndIcon",h,i,t,n);l+=y}}else if(e==="radio"){const w=wt("size",h,i,t,n),y=wt("outerRadius",h,i,t,n),S=ft(y)?2*y:w,A=wt("spaceBetweenTextAndIcon",h,i,t,n);if(lt(a)){const R=n.getBodyColumnDefine(i,t),x=wt("spaceBetweenRadio",h,i,t,n),T=(s=R==null?void 0:R.radioDirectionInCell)!==null&&s!==void 0?s:"vertical";T==="vertical"?(l+=S,l+=A):T==="horizontal"&&(l+=(S+A)*a.length,l+=x*(a.length-1))}else l+=S,C&&(l+=A)}return l}function jW(i,t,e){return{left:0,top:0,right:e.getColWidth(i),bottom:e.getRowHeight(t),width:null,height:null}}function $W(i,t){const e=t.getColWidthDefined(i);return t.internalProps._widthResizedColMap.has(i)?t.getColWidth(i):e}function rg(i,t,e,n,o,r,s){var l,a,h,d;let u=0;const c=[],g=[];let f=0;for(let m=t;m<e;m++){const b=n&&(l=o[m])!==null&&l!==void 0?l:r.getColWidth(m),C=r.getMaxColWidth(m),_=r.getMinColWidth(m);b!==C&&b!==_?(u+=b,c.push(m)):i-=b,!((a=r.options.customConfig)===null||a===void 0)&&a.shrinkSparklineFirst&&r.getBodyColumnType(m,0)==="sparkline"&&(g.push({col:m,width:b}),f+=b-r.defaultColWidth)}const p=i/u;if(!((h=r.options.customConfig)===null||h===void 0)&&h.shrinkSparklineFirst&&p<1&&u-i<f)for(let m=0;m<g.length;m++){const{col:b,width:C}=g[m],_=(u-i)/g.length,w=Math.floor(C-_);n?o[b]=r._adjustColWidth(b,w):s?r.scenegraph.setColWidth(b,r._adjustColWidth(b,w)):r._setColWidth(b,r._adjustColWidth(b,w),!1,!0)}else for(let m=0;m<c.length;m++){const b=c[m];let C;C=m===c.length-1?i-c.reduce((_,w,y)=>{var S;return w!==b?_+(n?(S=o[w])!==null&&S!==void 0?S:r.getColWidth(b):r.getColWidth(w)):_},0):Math.round((n&&(d=o[b])!==null&&d!==void 0?d:r.getColWidth(b))*p),n?o[b]=r._adjustColWidth(b,C):s?r.scenegraph.setColWidth(b,r._adjustColWidth(b,C)):r._setColWidth(b,r._adjustColWidth(b,C),!1,!0)}}const sg=new de({});sg.role="empty";function lg(i,t,e,n,o,r,s,l,a){var h,d;let u,c,g,f=0;i.lastChild&&i.lastChild.row===n-1?f=i.lastChild.attribute.y+i.lastChild.attribute.height:i.colHeight&&(f=i.colHeight);for(let p=n;p<=o;p++){const m=p;let b,C,_,w,y=l.getCellLocation(t,m),S=l.getCellValue(t,m),A=e,R=l.getRowHeight(m),x=!1;if(l.internalProps.customMergeCell){const E=l.getCustomMerge(t,m);if(E){const{range:k,text:I,style:L,customLayout:D,customRender:O}=E;if(b=k,C=b.start.col!==b.end.col||b.start.row!==b.end.row,C){const N=NR(b,r,l,n>b.start.row);A=N.cellWidth,R=N.cellHeight}S=I,_=L,(D||O)&&(w=Er(D,O,k.start.col,k.start.row,l.getColsWidth(k.start.col,k.end.col),l.getRowsHeight(k.start.row,k.end.row),!1,l.isAutoRowHeight(m),[0,0,0,0],b,l)),x=!0}}let T,M=t,B=m;b&&(M=b.start.col,B=b.start.row),!l.isPivotTable()&&(y==="columnHeader"||y==="cornerHeader")&&m>=l.columnHeaderLevelCount&&(y="body"),T=!l.isPivotTable()&&l.isSeriesNumberInBody(t,m)?l.getBodyColumnDefine(M,B):y!=="body"?l.getHeaderDefine(M,B):l.getBodyColumnDefine(M,B);let P=y!=="body"||(T==null?void 0:T.dragOrder)||!!(T!=null&&T.icon)||!!(T!=null&&T.tree);if(!b&&(l.internalProps.enableTreeNodeMerge||y!=="body"||T!=null&&T.mergeCell)&&(b=l.getCellRange(t,m),C=b.start.col!==b.end.col||b.start.row!==b.end.row,C)){const E=NR(b,r,l,n>b.start.row);A=E.cellWidth,R=E.cellHeight}let F=!1;if(l.internalProps.enableTreeNodeMerge&&C){const E=l.getCellRawRecord(b.start.col,b.start.row),{vtableMergeName:k,vtableMerge:I}=E??{};F=I,I&&(P=!0,l.options.groupTitleCustomLayout&&(w=Er(l.options.groupTitleCustomLayout,void 0,b.start.col,b.start.row,l.getColsWidth(b.start.col,b.end.col),l.getRowsHeight(b.start.row,b.end.row),!1,l.isAutoRowHeight(m),[0,0,0,0],b,l))),k&&(S=k)}const H=F||x?"text":(d=l.isHeader(t,m)?(h=l._getHeaderLayoutMap(t,m).headerType)!==null&&h!==void 0?h:"text":l.getBodyColumnType(t,m))!==null&&d!==void 0?d:"text";if(so(S)){UW(t,m,0,f,A,R,i),gR(S,l,GW.bind(null,{type:H,value:S,define:T,table:l,col:t,row:m,colWidth:e,cellWidth:A,cellHeight:R,columnGroup:i,y:f,customStyle:_,mayHaveIcon:P,cellLocation:y,range:b,customResult:w,defaultRowHeight:s})),i.updateColumnRowNumber(m);const E=l.getRowHeight(m);i.updateColumnHeight(E),f+=E}else{const E=_||l._getCellStyle(b?b.start.col:t,b?b.start.row:m),k=Pr(E,l,b?b.start.col:t,b?b.start.row:m,wt).theme;k.group.cornerRadius=Rc(t,m,l),k.group.width=e,k.group.height=Array.isArray(s)?s[m]:s,k._vtable.padding&&(u=k._vtable.padding),k.text.textAlign&&(c=k.text.textAlign),k.text.textBaseline&&(g=k.text.textBaseline),y==="body"||k.group.fill||(k.group.fill="#fff");const I=Hm(H,S,T,l,t,m,e,A,R,i,f,u,c,g,P,k,b,w);if(i.updateColumnRowNumber(m),C){const L=l.getRowHeight(m),{width:D}=(l.getColWidth(t),I.attribute),{height:O}=I.attribute;I.contentWidth=D,I.contentHeight=O,mR(b,D,O,u,c,g,l),i.updateColumnHeight(L),f+=L}else i.updateColumnHeight(R),f+=R}if(a&&m>a)break}return i.setAttribute("width",e),{width:e,height:f}}function GW(i){let t,e,n;const{type:o,value:r,define:s,table:l,col:a,row:h,colWidth:d,cellWidth:u,cellHeight:c,columnGroup:g,y:f,cellLocation:p,mayHaveIcon:m,customStyle:b,range:C,customResult:_,defaultRowHeight:w}=i,y=b||l._getCellStyle(C?C.start.col:a,C?C.start.row:h),S=Pr(y,l,C?C.start.col:a,C?C.start.row:h,wt).theme;S.group.cornerRadius=Rc(a,h,l),S.group.width=d,S.group.height=Array.isArray(w)?w[h]:w,S._vtable.padding&&(t=S._vtable.padding),S.text.textAlign&&(e=S.text.textAlign),S.text.textBaseline&&(n=S.text.textBaseline),p==="body"||S.group.fill||(S.group.fill="#fff"),Hm(o,r,s,l,a,h,d,u,c,g,f,t,e,n,m,S,C,_)}function NR(i,t,e,n){let o=0,r=0;const s=t.get(`${i.start.col},${i.start.row};${i.end.col},${i.end.row}`);if(!s||n){for(let l=i.start.col;l<=i.end.col;l++)o+=e.getColWidth(l);for(let l=i.start.row;l<=i.end.row;l++)r+=e.getRowHeight(l);t.set(`${i.start.col},${i.start.row};${i.end.col},${i.end.row}`,{cellWidth:o,cellHeight:r})}else o=s.cellWidth,r=s.cellHeight;return{cellWidth:o,cellHeight:r}}function UW(i,t,e,n,o,r,s){const l=new de({x:e,y:n,width:o,height:r});l.role="cell",l.col=i,l.row=t,s.addChild(l)}function Si(i,t,e,n,o,r,s,l,a,h){if(n>o||r>s)return;const{layoutMap:d,defaultRowHeight:u,defaultHeaderRowHeight:c,defaultColWidth:g}=a.internalProps;let f=0,p=0;for(let m=n;m<=o;m++){const b=m,C=a.getColWidth(b),_=new de({x:t+f,y:e,width:C,height:0,clip:!1,pickable:!1});_.role="column",_.col=m,i.addChild(_);const{width:w,height:y}=lg(_,b,C,r,s,a.scenegraph.mergeMap,l==="columnHeader"&&ft(c)?c:u,a,h);f+=w,p=Math.max(p,y)}i.setAttribute("width",f),i.setAttribute("height",p)}function KW(i,t,e,n,o,r,s,l,a){var h,d,u,c,g,f,p,m,b,C,_,w;const{table:y}=a,{leftBottomCornerGroup:S,rightTopCornerGroup:A,rightBottomCornerGroup:R}=y.scenegraph;let x,T,M,B;a.setParamsForRow(),a.setParamsForColumn(),(y.widthMode==="adaptive"||y.options.autoWrapText&&(y.heightMode==="adaptive"||y.heightMode==="autoHeight"))&&(M=y.colCount-1),x=Math.min(a.firstScreenColLimit,y.colCount-1),y.heightMode==="adaptive"&&(B=y.rowCount-1),T=Math.min(a.firstScreenRowLimit,y.rowCount-1),y.internalProps._widthResizedColMap.size===0&&Wn(y,0,M??x),y.internalProps._heightResizedRowMap.size===0&&zn(y,0,B??T),x<y.colCount-y.rightFrozenColCount&&Wn(y,y.colCount-y.rightFrozenColCount,y.colCount-1),T<y.rowCount-y.bottomFrozenRowCount&&zn(y,y.rowCount-y.bottomFrozenRowCount,y.rowCount-1),y.scenegraph.colHeaderGroup.setAttribute("x",y.getFrozenColsWidth()),y.scenegraph.rowHeaderGroup.setAttribute("y",y.getFrozenRowsHeight()),y.scenegraph.bottomFrozenGroup.setAttribute("x",y.getFrozenColsWidth()),y.scenegraph.rightFrozenGroup.setAttribute("y",y.getFrozenRowsHeight()),y.scenegraph.bodyGroup.setAttributes({x:y.getFrozenColsWidth(),y:y.getFrozenRowsHeight()}),Si(i,s,l,0,y.frozenColCount-1,0,y.frozenRowCount-1,y.isListTable()?"columnHeader":"cornerHeader",y),x-y.rightFrozenColCount>=y.frozenColCount&&Si(t,s,l,y.frozenColCount,x-y.rightFrozenColCount,0,y.frozenRowCount-1,"columnHeader",y),y.frozenColCount>0&&(y.leftRowSeriesNumberCount>0&&Si(e,s,l,0,y.leftRowSeriesNumberCount-1,y.frozenRowCount,T-y.bottomFrozenRowCount,"rowHeader",y),y.rowHeaderLevelCount>0&&Si(e,s,l,y.leftRowSeriesNumberCount,y.leftRowSeriesNumberCount+y.rowHeaderLevelCount-1,y.frozenRowCount,T-y.bottomFrozenRowCount,"rowHeader",y),y.frozenColCount>y.rowHeaderLevelCount+y.leftRowSeriesNumberCount&&Si(e,s,l,y.rowHeaderLevelCount+y.leftRowSeriesNumberCount,y.frozenColCount-1,y.frozenRowCount,T-y.bottomFrozenRowCount,"body",y)),y.bottomFrozenRowCount>0&&(y.frozenColCount>0&&(y.leftRowSeriesNumberCount>0&&Si(S,s,l,0,y.leftRowSeriesNumberCount-1,y.rowCount-1-y.bottomFrozenRowCount+1,y.rowCount-1,"rowHeader",y),y.rowHeaderLevelCount>0&&Si(S,s,l,y.leftRowSeriesNumberCount,y.leftRowSeriesNumberCount+y.rowHeaderLevelCount-1,y.rowCount-1-y.bottomFrozenRowCount+1,y.rowCount-1,"rowHeader",y),y.frozenColCount>y.rowHeaderLevelCount+y.leftRowSeriesNumberCount&&Si(S,s,l,y.rowHeaderLevelCount+y.leftRowSeriesNumberCount,y.frozenColCount-1,y.rowCount-1-y.bottomFrozenRowCount+1,y.rowCount-1,"body",y)),x-y.rightFrozenColCount>=y.frozenColCount&&Si(o,s,l,y.frozenColCount,x-y.rightFrozenColCount,y.rowCount-1-y.bottomFrozenRowCount+1,y.rowCount-1,y.isPivotChart()?"rowHeader":"body",y)),y.rightFrozenColCount>0&&(Si(A,s,l,y.colCount-1-y.rightFrozenColCount+1,y.colCount-1,0,y.frozenRowCount-1,"columnHeader",y),Si(n,s,l,y.colCount-1-y.rightFrozenColCount+1,y.colCount-1,y.frozenRowCount,T-y.bottomFrozenRowCount,y.isPivotChart()?"rowHeader":"body",y)),y.bottomFrozenRowCount>0&&y.rightFrozenColCount>0&&Si(R,s,l,y.colCount-1-y.rightFrozenColCount+1,y.colCount-1,y.rowCount-1-y.bottomFrozenRowCount+1,y.rowCount-1,"body",y),x-y.rightFrozenColCount>=y.frozenColCount&&Si(r,s,l,y.frozenColCount,x-y.rightFrozenColCount,y.frozenRowCount,T-y.bottomFrozenRowCount,"body",y),r.firstChild||t.firstChild||i.firstChild||e.firstChild?(a.currentRow=(c=(d=(h=r.firstChild)===null||h===void 0?void 0:h.rowNumber)!==null&&d!==void 0?d:(u=e.firstChild)===null||u===void 0?void 0:u.rowNumber)!==null&&c!==void 0?c:a.totalRow,a.rowEnd=a.currentRow,a.rowUpdatePos=a.rowEnd+1,a.referenceRow=a.rowStart+Math.floor((a.rowEnd-a.rowStart)/2),a.currentCol=(w=(C=(m=(f=(g=r.lastChild)===null||g===void 0?void 0:g.col)!==null&&f!==void 0?f:(p=t.lastChild)===null||p===void 0?void 0:p.col)!==null&&m!==void 0?m:(b=e.lastChild)===null||b===void 0?void 0:b.col)!==null&&C!==void 0?C:(_=i.lastChild)===null||_===void 0?void 0:_.col)!==null&&w!==void 0?w: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))}function VR(i){let t=i.firstChild;for(;t.type!=="group";)t=t._next;return t}function jR(i){let t=i.lastChild;for(;t.type!=="group";)t=t._prev;return t}function YW(i){let t=i._prev;for(;t&&t.type!=="group";)t=t._prev;return t}function XW(i){let t=i._next;for(;t&&t.type!=="group";)t=t._next;return t}function $m(i,t,e,n="left"){for(let l=i;l<=t;l++){const a=e.scenegraph.getColGroup(l);a&&Gm(a,e,n);const h=e.scenegraph.getColGroup(l,!0);h&&Gm(h,e,n);const d=e.scenegraph.getColGroupInBottom(l);d&&Gm(d,e,n)}const o=Math.min(e.scenegraph.proxy.colLimit,e.scenegraph.proxy.bodyRightCol-e.scenegraph.proxy.bodyLeftCol+1),r=e.getColsWidth(e.frozenColCount,e.frozenColCount+o),s=e.getColsWidth(e.frozenColCount,e.colCount-1);e.scenegraph.proxy.xLimitLeft=r/2,e.scenegraph.proxy.xLimitRight=s-r/2}function Gm(i,t,e="left"){if(e==="left"){let n;const o=YW(i);n=o?o.attribute.x+t.getColWidth(i._prev.col):t.getColsWidth(t.frozenColCount,i.col-1),i.setAttribute("x",n)}else{let n;const o=XW(i);n=o?o.attribute.x-t.getColWidth(i.col):t.getColsWidth(t.frozenColCount,i.col-1),i.setAttribute("x",n)}}var $R=globalThis&&globalThis.__awaiter||function(i,t,e,n){return new(e||(e=Promise))(function(o,r){function s(h){try{a(n.next(h))}catch(d){r(d)}}function l(h){try{a(n.throw(h))}catch(d){r(d)}}function a(h){var d;h.done?o(h.value):(d=h.value,d instanceof e?d:new e(function(u){u(d)})).then(s,l)}a((n=n.apply(i,t||[])).next())})};function qW(i,t,e,n){return $R(this,void 0,void 0,function*(){if(!t)return;const o=t.col,r=t.left;let s;if(s=e?n.bodyRightCol-n.colEnd:n.screenLeftCol-n.referenceCol,ZW(s,o,r,i,n),e){const l=n.table.scenegraph.getColGroup(n.colEnd);if(l){const a=l.attribute.x+l.attribute.width-(n.table.tableNoFrameWidth-n.table.getFrozenColsWidth()-n.table.getRightFrozenColsWidth())-i;n.deltaX=-a,n.table.scenegraph.setBodyAndColHeaderX(-i+n.deltaX)}}n.table.scenegraph.updateNextFrame()})}function ZW(i,t,e,n,o){i>0?(GR(i,"left",o.screenLeftCol,e,n,o),o.updateDeltaX(n,e,t),o.table.scenegraph.setBodyAndColHeaderX(-n+o.deltaX)):i<0?(GR(-i,"right",o.screenLeftCol,e,n,o),o.updateDeltaX(n,e,t),o.table.scenegraph.setBodyAndColHeaderX(-n+o.deltaX)):(o.updateDeltaX(n,e,t),o.table.scenegraph.setBodyAndColHeaderX(-n+o.deltaX))}function GR(i,t,e,n,o,r){return $R(this,void 0,void 0,function*(){if(t==="left"&&r.colEnd+i>r.bodyRightCol?i=r.bodyRightCol-r.colEnd:t==="right"&&r.colStart-i<r.bodyLeftCol&&(i=r.colStart-r.bodyLeftCol),i!==0)if(i<0&&(t=t==="left"?"right":"left",i=-i),i<r.colEnd-r.colStart){const s=t==="left"?r.colStart:r.colEnd-i+1,l=t==="left"?r.colStart+i-1:r.colEnd,a=t==="left"?r.colEnd+1:r.colStart-i,h=t==="left"?r.colEnd+i:r.colStart-1;Wn(r.table,a,h),QW(s,l,t,r);const d=a,u=h;r.colStart=t==="left"?r.colStart+i:r.colStart-i,r.colEnd=t==="left"?r.colEnd+i:r.colEnd-i,xh(d,u,r),$m(d,u,r.table,t);const c=r.table.scenegraph.getColGroup(e)||r.table.scenegraph.getColGroup(e,!0),g=n-(c.attribute.x+r.table.getFrozenColsWidth()+r.table.scenegraph.proxy.deltaX);r.table.scenegraph.proxy.deltaX+=g,r.currentCol=t==="left"?r.currentCol+i:r.currentCol-i,r.totalCol=Math.max(0,Math.min(r.table.colCount-1,t==="left"?r.totalCol+i:r.totalCol-i)),r.referenceCol=r.colStart+Math.floor((r.colEnd-r.colStart)/2),r.colUpdatePos=a,r.colUpdateDirection=t,r.table.scenegraph.updateNextFrame()}else{const s=t==="left"?r.colStart+i:r.colStart-i,l=t==="left"?r.colEnd+i:r.colEnd-i;Wn(r.table,s,l),tN(r.table.getColsWidth(r.bodyLeftCol,s-1),i,t,r);const a=s,h=l;r.colStart=s,r.colEnd=l,xh(a,h,r),$m(a,h,r.table,l>r.bodyRightCol-(r.colEnd-r.colStart+1)?"right":"left"),r.currentCol=t==="left"?r.currentCol+i:r.currentCol-i,r.totalCol=Math.max(0,Math.min(r.table.colCount-1,t==="left"?r.totalCol+i:r.totalCol-i)),r.referenceCol=r.colStart+Math.floor((r.colEnd-r.colStart)/2),r.colUpdatePos=r.colStart,r.colUpdateDirection=l>r.bodyRightCol-(r.colEnd-r.colStart+1)?"right":"left",r.table.scenegraph.updateNextFrame()}})}function Sh(i,t,e){i.col=t,i.forEachChildren(n=>{n.col=t,n.needUpdate=!0}),i.setAttribute("x",e),i.needUpdate=!0}function ag(i,t){if(!i)return;let e=i.firstChild;for(;e;)e=t.updateCellGroupContent(e)._next;i.needUpdate=!1,i.setAttribute("width",t.table.getColWidth(i.col))}function JW(i,t){if(!i)return;const e=t.screenTopRow,n=Math.max(t.bodyTopRow,e-1*t.screenRowCount),o=Math.min(t.bodyBottomRow,e+2*t.screenRowCount,t.table.rowCount-1);for(let r=n;r<=o;r++){const s=t.highPerformanceGetCell(i.col,r,!0);t.updateCellGroupContent(s)}t.rowUpdatePos=t.rowStart,i.needUpdate=!1,i.setAttribute("width",t.table.getColWidth(i.col))}function QW(i,t,e,n){for(let o=i;o<=t;o++)n.table.scenegraph.bodyGroup.childrenCount>0&&n.table.scenegraph.bodyGroup.firstChild.type==="group"&&Um(n.table.scenegraph.bodyGroup,e,n),n.table.scenegraph.colHeaderGroup.childrenCount>0&&n.table.scenegraph.colHeaderGroup.firstChild.type==="group"&&Um(n.table.scenegraph.colHeaderGroup,e,n),n.table.scenegraph.bottomFrozenGroup.childrenCount>0&&n.table.scenegraph.bottomFrozenGroup.firstChild.type==="group"&&Um(n.table.scenegraph.bottomFrozenGroup,e,n)}function Um(i,t,e){if(t==="left"){const n=VR(i),o=jR(i);Sh(n,o.col+1,o.attribute.x+e.table.getColWidth(o.col)),i.appendChild(n),i.border&&i.appendChild(i.border)}else{const n=jR(i),o=VR(i);Sh(n,o.col-1,o.attribute.x-e.table.getColWidth(o.col-1)),i.insertBefore(n,i.firstChild)}}function xh(i,t,e){for(let n=i;n<=t;n++){const o=e.table.scenegraph.getColGroup(n,!0);o&&ag(o,e);const r=e.table.scenegraph.getColGroupInBottom(n);r&&ag(r,e);const s=e.table.scenegraph.getColGroupInRightTopCorner(n);s&&ag(s,e);const l=e.table.scenegraph.getColGroupInRightBottomCorner(n);l&&ag(l,e);const a=e.table.scenegraph.getColGroup(n);a&&JW(a,e)}e.progress()}function tN(i,t,e,n){n.table.scenegraph.colHeaderGroup.forEachChildren((o,r)=>{o.type==="group"&&Sh(o,e==="left"?o.col+t:o.col-t,r===0?i:o._prev.attribute.x+n.table.getColWidth(o._prev.col))}),n.table.scenegraph.bottomFrozenGroup.forEachChildren((o,r)=>{o.type==="group"&&Sh(o,e==="left"?o.col+t:o.col-t,r===0?i:o._prev.attribute.x+n.table.getColWidth(o._prev.col))}),n.table.scenegraph.bodyGroup.forEachChildren((o,r)=>{o.type==="group"&&Sh(o,e==="left"?o.col+t:o.col-t,r===0?i:o._prev.attribute.x+n.table.getColWidth(o._prev.col))})}function Cn(i,t,e,n,o,r="up",s){var l,a;if(r==="up")for(let c=i;c<=t;c++)for(let g=e;g<=n;g++){const f=o.scenegraph.highPerformanceGetCell(c,g,!0);if(f.role!=="cell"||!f.row)continue;let p;if(f._prev)p=((l=f._prev)===null||l===void 0?void 0:l.attribute.y)+o.getRowHeight(f._prev.row);else if(s){if(p=o.scenegraph.highPerformanceGetCell(c,n+1,!0).attribute.y,z(p))for(let m=g;m<=n;m++)p-=o.getRowHeight(m)}else p=UR(f.row,o);z(p)&&f.setAttribute("y",p)}else for(let c=i;c<=t;c++)for(let g=n;g>=e;g--){const f=o.scenegraph.highPerformanceGetCell(c,g,!0);if(f.role!=="cell"||!f.row)continue;let p;if(f._next)p=((a=f._next)===null||a===void 0?void 0:a.attribute.y)-o.getRowHeight(f.row);else if(s){p=o.scenegraph.highPerformanceGetCell(c,e-1,!0).attribute.y;for(let m=e-1;m<g;m++)p+=o.getRowHeight(m)}else p=UR(f.row,o);z(p)&&f.setAttribute("y",p)}const h=Math.min(o.scenegraph.proxy.rowLimit,o.scenegraph.proxy.bodyBottomRow-o.scenegraph.proxy.bodyTopRow+1),d=o.getRowsHeight(o.frozenRowCount,o.frozenRowCount+h),u=o.getRowsHeight(o.frozenRowCount,o.rowCount-1);o.scenegraph.proxy.yLimitTop=d/2,o.scenegraph.proxy.yLimitBottom=u-d/2}function UR(i,t){let e;return e=i<t.frozenRowCount?t.getRowsHeight(0,i-1):i>=t.rowCount-t.bottomFrozenRowCount?t.getRowsHeight(t.rowCount-t.bottomFrozenRowCount,i-1):t.getRowsHeight(t.frozenRowCount,i-1),e}var KR=globalThis&&globalThis.__awaiter||function(i,t,e,n){return new(e||(e=Promise))(function(o,r){function s(h){try{a(n.next(h))}catch(d){r(d)}}function l(h){try{a(n.throw(h))}catch(d){r(d)}}function a(h){var d;h.done?o(h.value):(d=h.value,d instanceof e?d:new e(function(u){u(d)})).then(s,l)}a((n=n.apply(i,t||[])).next())})};function eN(i,t,e,n){return KR(this,void 0,void 0,function*(){if(!t)return;const o=t.row,r=t.top;let s;if(s=e?n.bodyBottomRow-n.rowEnd:o-n.referenceRow,iN(s,o,r,i,n),e){const l=n.table.scenegraph.highPerformanceGetCell(n.colStart,n.rowEnd,!0);if(l.role==="cell"){const a=l.attribute.y+l.attribute.height-(n.table.tableNoFrameHeight-n.table.getFrozenRowsHeight()-n.table.getBottomFrozenRowsHeight())-i;n.deltaY=-a,n.updateBody(i-n.deltaY)}}})}function iN(i,t,e,n,o){i>0?(YR(i,"up",t,e,n,o),o.updateDeltaY(n,e,t),o.updateBody(n-o.deltaY)):i<0?(YR(-i,"down",t,e,n,o),o.updateDeltaY(n,e,t),o.updateBody(n-o.deltaY)):(o.updateDeltaY(n,e,t),o.updateBody(n-o.deltaY))}function YR(i,t,e,n,o,r){return KR(this,void 0,void 0,function*(){if(t==="up"&&r.rowEnd+i>r.bodyBottomRow?i=r.bodyBottomRow-r.rowEnd:t==="down"&&r.rowStart-i<r.bodyTopRow&&(i=r.rowStart-r.bodyTopRow),i!==0)if(i<0&&(t=t==="up"?"down":"up",i=-i),i<r.rowEnd-r.rowStart){const s=t==="up"?r.rowStart:r.rowEnd-i+1,l=t==="up"?r.rowStart+i-1:r.rowEnd,a=t==="up"?r.rowEnd+1:r.rowStart-i,h=t==="up"?r.rowEnd+i:r.rowStart-1;let d,u;r.table.heightMode==="autoHeight"?(d=a,u=h):(d=Math.max(r.bodyTopRow,e-1*r.screenRowCount),u=Math.min(r.bodyBottomRow,e+2*r.screenRowCount,r.table.rowCount-1)),zn(r.table,d,u,!1),nN(s,l,t,r),r.rowStart=t==="up"?r.rowStart+i:r.rowStart-i,r.rowEnd=t==="up"?r.rowEnd+i:r.rowEnd-i;const c=Rh(d,u,r,!0);r.table.heightMode==="autoHeight"&&(Cn(r.bodyLeftCol,r.bodyRightCol,d,u,r.table,h>r.bodyBottomRow-(r.rowEnd-r.rowStart+1)?"down":"up",!0),Cn(0,r.table.frozenColCount-1,d,u,r.table,h>r.bodyBottomRow-(r.rowEnd-r.rowStart+1)?"down":"up",!0),Cn(r.table.colCount-r.table.rightFrozenColCount,r.table.colCount-1,d,u,r.table,h>r.bodyBottomRow-(r.rowEnd-r.rowStart+1)?"down":"up",!0)),r.currentRow=t==="up"?r.currentRow+i:r.currentRow-i,r.totalRow=Math.max(0,Math.min(r.bodyBottomRow,t==="up"?r.totalRow+i:r.totalRow-i,r.table.rowCount-1)),r.referenceRow=r.rowStart+Math.floor((r.rowEnd-r.rowStart)/2),r.table.heightMode==="autoHeight"&&c?r.rowUpdatePos=Math.min(r.rowUpdatePos,r.rowEnd+1):r.rowUpdatePos=Math.min(r.rowUpdatePos,a),r.rowUpdateDirection=t,r.table.scenegraph.updateNextFrame(),yield r.progress()}else{const s=t==="up"?r.rowStart+i:r.rowStart-i,l=Math.min(r.table.rowCount-1,t==="up"?r.rowEnd+i:r.rowEnd-i),a=r.table.getRowsHeight(r.bodyTopRow,s-1);let h,d;r.table.heightMode==="autoHeight"?(h=s,d=l):(h=Math.max(r.bodyTopRow,e-1*r.screenRowCount),d=Math.min(r.bodyBottomRow,e+2*r.screenRowCount,r.table.rowCount-1)),zn(r.table,h,d,!1),oN(a,i,t,r),r.rowStart=s,r.rowEnd=l;const u=Rh(h,d,r,!0);r.table.heightMode==="autoHeight"&&(Cn(r.bodyLeftCol,r.bodyRightCol,h,d,r.table,l>r.bodyBottomRow-(r.rowEnd-r.rowStart+1)?"down":"up"),Cn(0,r.table.frozenColCount-1,h,d,r.table,l>r.bodyBottomRow-(r.rowEnd-r.rowStart+1)?"down":"up"),Cn(r.table.colCount-r.table.rightFrozenColCount,r.table.colCount-1,h,d,r.table,l>r.bodyBottomRow-(r.rowEnd-r.rowStart+1)?"down":"up")),r.currentRow=t==="up"?r.currentRow+i:r.currentRow-i,r.totalRow=Math.max(0,Math.min(r.bodyBottomRow,t==="up"?r.totalRow+i:r.totalRow-i,r.table.rowCount-1)),r.referenceRow=r.rowStart+Math.floor((r.rowEnd-r.rowStart)/2),r.table.heightMode==="autoHeight"&&u?r.rowUpdatePos=r.rowEnd+1:r.rowUpdatePos=r.rowStart,r.rowUpdateDirection=l>r.bodyBottomRow-(r.rowEnd-r.rowStart+1)?"down":"up",r.table.scenegraph.updateNextFrame(),yield r.progress()}})}function nN(i,t,e,n){for(let o=0;o<n.table.frozenColCount;o++){const r=n.table.scenegraph.getColGroup(o);if(r)for(let s=i;s<=t;s++)Km(r,e,n)}for(let o=n.table.colCount-n.table.rightFrozenColCount;o<n.table.colCount;o++){const r=n.table.scenegraph.getColGroup(o);if(r)for(let s=i;s<=t;s++)Km(r,e,n)}for(let o=n.bodyLeftCol;o<=n.bodyRightCol;o++){const r=n.table.scenegraph.getColGroup(o);if(r)for(let s=i;s<=t;s++)Km(r,e,n)}}function Km(i,t,e){if(i.childrenCount>=1)if(t==="up"){const n=i.firstChild;e.updateCellGroupPosition(n,i.lastChild.row+1,i.lastChild.attribute.y+e.table.getRowHeight(i.lastChild.row)),i.appendChild(n)}else{const n=i.lastChild;e.updateCellGroupPosition(n,i.firstChild.row-1,i.firstChild.attribute.y-e.table.getRowHeight(n.row)),i.insertBefore(n,i.firstChild)}}function oN(i,t,e,n){for(let o=0;o<n.table.frozenColCount;o++){const r=n.table.scenegraph.getColGroup(o);r==null||r.forEachChildren((s,l)=>{n.updateCellGroupPosition(s,e==="up"?s.row+t:s.row-t,l===0?i:s._prev.attribute.y+n.table.getRowHeight(s._prev.row))})}for(let o=n.table.colCount-n.table.rightFrozenColCount;o<n.table.colCount;o++){const r=n.table.scenegraph.getColGroup(o);r==null||r.forEachChildren((s,l)=>{n.updateCellGroupPosition(s,e==="up"?s.row+t:s.row-t,l===0?i:s._prev.attribute.y+n.table.getRowHeight(s._prev.row))})}for(let o=n.bodyLeftCol;o<=n.bodyRightCol;o++){const r=n.table.scenegraph.getColGroup(o);r==null||r.forEachChildren((s,l)=>{n.updateCellGroupPosition(s,e==="up"?s.row+t:s.row-t,l===0?i:s._prev.attribute.y+n.table.getRowHeight(s._prev.row))})}}function Rh(i,t,e,n=!1){for(let l=0;l<e.table.frozenColCount;l++)for(let a=i;a<=t;a++){const h=e.highPerformanceGetCell(l,a,!0);e.updateCellGroupContent(h)}for(let l=e.table.colCount-e.table.rightFrozenColCount;l<e.table.colCount;l++)for(let a=i;a<=t;a++){const h=e.highPerformanceGetCell(l,a);e.updateCellGroupContent(h)}let o=e.bodyLeftCol,r=e.bodyRightCol,s=!0;if(n){const l=e.screenLeftCol;o=Math.max(e.bodyLeftCol,l-1*e.screenColCount),r=Math.min(e.bodyRightCol,l+2*e.screenColCount),o===e.bodyLeftCol&&r===e.bodyRightCol||(s=!1)}for(let l=o;l<=r;l++)for(let a=i;a<=t;a++){const h=e.highPerformanceGetCell(l,a);e.updateCellGroupContent(h)}return e.table.scenegraph.updateNextFrame(),s}var rN=globalThis&&globalThis.__awaiter||function(i,t,e,n){return new(e||(e=Promise))(function(o,r){function s(h){try{a(n.next(h))}catch(d){r(d)}}function l(h){try{a(n.throw(h))}catch(d){r(d)}}function a(h){var d;h.done?o(h.value):(d=h.value,d instanceof e?d:new e(function(u){u(d)})).then(s,l)}a((n=n.apply(i,t||[])).next())})};function sN(i){var t;return rN(this,void 0,void 0,function*(){let e,n;i.table.scenegraph.bodyGroup.forEachChildren((s,l)=>{s.type==="group"&&(s.needUpdate=!0,s==null||s.forEachChildren(a=>{a.needUpdate=!0}))}),i.table.heightMode==="autoHeight"?(e=i.rowStart,n=i.rowEnd):(e=Math.max(i.bodyTopRow,i.screenTopRow-1*i.screenRowCount),n=Math.min(i.bodyBottomRow,i.screenTopRow+2*i.screenRowCount,i.table.rowCount-1));const o=i.table.getAllRowsHeight();zn(i.table,e,n);const r=i.table.getAllRowsHeight();o!==r&&i.table.scenegraph.updateContainerHeight(i.table.frozenRowCount,r-o);for(let s=0;(t=s<i.table.frozenColCount)!==null&&t!==void 0&&t;s++){const l=i.table.scenegraph.getColGroup(s);l==null||l.setAttribute("chartInstance",void 0);for(let a=i.rowStart;a<=i.rowEnd;a++)i.table.scenegraph.updateCellContent(s,a);for(let a=i.table.rowCount-i.table.bottomFrozenRowCount;a<i.table.rowCount;a++)i.table.scenegraph.updateCellContent(s,a)}for(let s=i.colStart;s<=i.colEnd;s++){const l=i.table.scenegraph.getColGroup(s);l==null||l.setAttribute("chartInstance",void 0);for(let a=i.table.rowCount-i.table.bottomFrozenRowCount;a<i.table.rowCount;a++)i.table.scenegraph.updateCellContent(s,a)}for(let s=i.table.colCount-i.table.rightFrozenColCount;s<i.table.colCount;s++){const l=i.table.scenegraph.getColGroup(s);l==null||l.setAttribute("chartInstance",void 0);for(let a=i.rowStart;a<=i.rowEnd;a++)i.table.scenegraph.updateCellContent(s,a);for(let a=i.table.rowCount-i.table.bottomFrozenRowCount;a<i.table.rowCount;a++)i.table.scenegraph.updateCellContent(s,a)}Rh(e,n,i),i.table.heightMode==="autoHeight"&&Cn(i.bodyLeftCol,i.bodyRightCol,e,n,i.table,i.rowEnd>i.bodyBottomRow-(i.rowEnd-i.rowStart+1)?"down":"up"),i.rowUpdatePos=i.rowStart,i.rowUpdateDirection=i.rowEnd>i.bodyBottomRow-(i.rowEnd-i.rowStart+1)?"down":"up",i.table.scenegraph.updateNextFrame(),i.table.heightMode!=="autoHeight"&&(yield i.progress())})}var lN=globalThis&&globalThis.__awaiter||function(i,t,e,n){return new(e||(e=Promise))(function(o,r){function s(h){try{a(n.next(h))}catch(d){r(d)}}function l(h){try{a(n.throw(h))}catch(d){r(d)}}function a(h){var d;h.done?o(h.value):(d=h.value,d instanceof e?d:new e(function(u){u(d)})).then(s,l)}a((n=n.apply(i,t||[])).next())})};function aN(i){return lN(this,void 0,void 0,function*(){i.table.scenegraph.bodyGroup.forEachChildren((n,o)=>{n.type==="group"&&(n.needUpdate=!0,n==null||n.forEachChildren(r=>{r.needUpdate=!0}))});const t=Math.max(i.bodyLeftCol,i.screenLeftCol-1*i.screenColCount),e=Math.min(i.bodyRightCol,i.screenLeftCol+2*i.screenColCount);Wn(i.table,t,e);for(let n=i.colStart;n<=i.colEnd;n++){const o=i.table.scenegraph.getColGroup(n);o==null||o.setAttribute("chartInstance",void 0);for(let r=i.table.rowCount-i.table.bottomFrozenRowCount;r<i.table.rowCount;r++)i.table.scenegraph.updateCellContent(n,r)}for(let n=i.table.colCount-i.table.rightFrozenColCount;n<i.table.colCount;n++){const o=i.table.scenegraph.getColGroup(n);o==null||o.setAttribute("chartInstance",void 0);for(let r=i.rowStart;r<=i.rowEnd;r++)i.table.scenegraph.updateCellContent(n,r);for(let r=i.table.rowCount-i.table.bottomFrozenRowCount;r<i.table.rowCount;r++)i.table.scenegraph.updateCellContent(n,r)}xh(t,e,i),i.colUpdatePos=i.colStart,i.colUpdateDirection=i.colEnd>i.bodyRightCol-(i.colEnd-i.colStart+1)?"right":"left",i.table.scenegraph.updateNextFrame(),yield i.progress()})}function Ah(i){const{changedCells:t}=i.internalProps.stick;t.forEach(f=>{i.scenegraph.getCell(f.col,f.row).forEachChildren(p=>{p.setAttributes({dx:f.dx,dy:f.dy})})}),t.clear();const{scrollTop:e,scrollLeft:n,frozenRowCount:o,frozenColCount:r}=i,s=i.getFrozenRowsHeight(),l=i.getFrozenColsWidth(),{row:a}=i.getRowAt(e+s+1),{col:h}=i.getColAt(n+l+1),d=Math.max(a,i.frozenRowCount),u=Math.max(h,i.frozenColCount),c=i.getAllRowsHeight()>i.tableNoFrameHeight?i.getRowAt(e+i.tableNoFrameHeight-i.getBottomFrozenRowsHeight()-1).row:i.rowCount-i.bottomFrozenRowCount-1,g=i.getAllColsWidth()>i.tableNoFrameWidth?i.getColAt(n+i.tableNoFrameWidth-i.getRightFrozenColsWidth()-1).col:i.colCount-i.rightFrozenColCount-1;if(!(g<0||c<0)){for(let f=0;f<o&&!(g<u);f++)[u,g].forEach(p=>{const m=i._getCellStyle(p,f);m!=null&&m.textStick&&(m==null?void 0:m.textStick)!=="vertical"&&ZR(i.scenegraph.getCell(p,f),l+i.tableX,i.tableNoFrameWidth-i.getRightFrozenColsWidth()+i.tableX,t,m==null?void 0:m.textStickBaseOnAlign,i)});for(let f=0;f<r&&!(c<d);f++)[d,c].forEach(p=>{const m=i._getCellStyle(f,p);m!=null&&m.textStick&&i.internalProps.layoutMap.rowHierarchyType!=="tree"&&(m==null?void 0:m.textStick)!=="horizontal"&&XR(i.scenegraph.getCell(f,p),s+i.tableY,i.tableNoFrameHeight-i.getBottomFrozenRowsHeight()+i.tableY,t,m==null?void 0:m.textStickBaseOnAlign,i)});for(let f=u;f<=g&&!(c<d);f++)[d,c].forEach(p=>{const m=i._getCellStyle(f,p);m!=null&&m.textStick&&(m==null?void 0:m.textStick)!=="horizontal"&&XR(i.scenegraph.getCell(f,p),s+i.tableY,i.tableNoFrameHeight-i.getBottomFrozenRowsHeight()+i.tableY,t,m==null?void 0:m.textStickBaseOnAlign,i)});for(let f=d;f<=c&&!(g<u);f++)[u,g].forEach(p=>{const m=i._getCellStyle(p,f);m!=null&&m.textStick&&(m==null?void 0:m.textStick)!=="vertical"&&ZR(i.scenegraph.getCell(p,f),l+i.tableX,i.tableNoFrameWidth-i.getRightFrozenColsWidth()+i.tableX,t,m==null?void 0:m.textStickBaseOnAlign,i)})}}function XR(i,t,e,n,o,r){if(ft(i.mergeStartCol)&&ft(i.mergeStartRow)&&ft(i.mergeEndCol)&&ft(i.mergeEndRow)){const{colStart:s,colEnd:l,rowStart:a,rowEnd:h}=kr(i,r.scenegraph);for(let d=s;d<=l;d++)for(let u=a;u<=h;u++)qR(r.scenegraph.getCell(d,u),t,e,n,o)}else qR(i,t,e,n,o)}function qR(i,t,e,n,o){var r,s,l,a,h,d,u,c,g,f,p,m,b,C,_,w,y;const S=i.getChildByName("text",!0)||i.getChildByName("image",!0);if(!S)return;if(S.type==="image"){const{image:T}=S.attribute;if(!T||!S.resources||S.resources.get(T).state!=="success")return}const A=(r=S.textBaseline)!==null&&r!==void 0?r:"top";S.AABBBounds.width();const R=S.globalAABBBounds.y1,x=S.globalAABBBounds.y2;if(A==="middle"&&o){const T=i.globalAABBBounds.y1+((l=(s=i.firstChild)===null||s===void 0?void 0:s.attribute.dy)!==null&&l!==void 0?l:0),M=T+((h=(a=i.contentHeight)!==null&&a!==void 0?a:i.attribute.height)!==null&&h!==void 0?h:0);if(T<t||M>e){const B=Math.max(T,t),P=Math.min(M,e),F=S.globalTransMatrix.f-(P+B)/2+S.AABBBounds.height()/2;!n.has(`${i.col}-${i.row}`)&&n.set(`${i.col}-${i.row}`,{col:i.col,row:i.row,dx:(u=(d=i.firstChild)===null||d===void 0?void 0:d.attribute.dx)!==null&&u!==void 0?u:0,dy:(g=(c=i.firstChild)===null||c===void 0?void 0:c.attribute.dy)!==null&&g!==void 0?g:0}),i.forEachChildren(H=>{var E;H.setAttribute("dy",((E=H.attribute.dy)!==null&&E!==void 0?E:0)-F+2)})}}else if(R<t){const T=R-t;!n.has(`${i.col}-${i.row}`)&&n.set(`${i.col}-${i.row}`,{col:i.col,row:i.row,dx:(p=(f=i.firstChild)===null||f===void 0?void 0:f.attribute.dx)!==null&&p!==void 0?p:0,dy:(b=(m=i.firstChild)===null||m===void 0?void 0:m.attribute.dy)!==null&&b!==void 0?b:0}),i.forEachChildren(M=>{var B;M.setAttribute("dy",((B=M.attribute.dy)!==null&&B!==void 0?B:0)-T+2)})}else if(x>e){const T=x-e;!n.has(`${i.col}-${i.row}`)&&n.set(`${i.col}-${i.row}`,{col:i.col,row:i.row,dx:(_=(C=i.firstChild)===null||C===void 0?void 0:C.attribute.dx)!==null&&_!==void 0?_:0,dy:(y=(w=i.firstChild)===null||w===void 0?void 0:w.attribute.dy)!==null&&y!==void 0?y:0}),i.forEachChildren(M=>{var B;M.setAttribute("dy",((B=M.attribute.dy)!==null&&B!==void 0?B:0)-T)})}}function ZR(i,t,e,n,o,r){if(ft(i.mergeStartCol)&&ft(i.mergeStartRow)&&ft(i.mergeEndCol)&&ft(i.mergeEndRow)){const{colStart:s,colEnd:l,rowStart:a,rowEnd:h}=kr(i,r.scenegraph);for(let d=s;d<=l;d++)for(let u=a;u<=h;u++)JR(r.scenegraph.getCell(d,u),t,e,n,o)}else JR(i,t,e,n,o)}function JR(i,t,e,n,o){var r,s,l,a,h,d,u,c,g,f,p,m,b,C,_,w,y,S;const A=i.getChildByName("text",!0)||i.getChildByName("image",!0);if(!A)return;if(A.type==="image"){const{image:M}=A.attribute;if(!M||!A.resources||A.resources.get(M).state!=="success")return}const R=(s=(r=A.attribute.textAlign)!==null&&r!==void 0?r:A.textAlign)!==null&&s!==void 0?s:"left";A.AABBBounds.width();const x=A.globalAABBBounds.x1,T=A.globalAABBBounds.x2;if(R==="center"&&o){const M=i.globalAABBBounds.x1+((a=(l=i.firstChild)===null||l===void 0?void 0:l.attribute.dx)!==null&&a!==void 0?a:0),B=M+((d=(h=i.contentWidth)!==null&&h!==void 0?h:i.attribute.width)!==null&&d!==void 0?d:0);if(M<t||B>e){const P=Math.max(M,t),F=Math.min(B,e),H=A.globalTransMatrix.e-(F+P)/2;!n.has(`${i.col}-${i.row}`)&&n.set(`${i.col}-${i.row}`,{col:i.col,row:i.row,dx:(c=(u=i.firstChild)===null||u===void 0?void 0:u.attribute.dx)!==null&&c!==void 0?c:0,dy:(f=(g=i.firstChild)===null||g===void 0?void 0:g.attribute.dy)!==null&&f!==void 0?f:0}),i.forEachChildren(E=>{var k;E.setAttribute("dx",((k=E.attribute.dx)!==null&&k!==void 0?k:0)-H+2)})}}else if(x<t){const M=x-t;!n.has(`${i.col}-${i.row}`)&&n.set(`${i.col}-${i.row}`,{col:i.col,row:i.row,dx:(m=(p=i.firstChild)===null||p===void 0?void 0:p.attribute.dx)!==null&&m!==void 0?m:0,dy:(C=(b=i.firstChild)===null||b===void 0?void 0:b.attribute.dy)!==null&&C!==void 0?C:0}),i.forEachChildren(B=>{var P;B.setAttribute("dx",((P=B.attribute.dx)!==null&&P!==void 0?P:0)-M+2)})}else if(T>e){const M=T-e;!n.has(`${i.col}-${i.row}`)&&n.set(`${i.col}-${i.row}`,{col:i.col,row:i.row,dx:(w=(_=i.firstChild)===null||_===void 0?void 0:_.attribute.dx)!==null&&w!==void 0?w:0,dy:(S=(y=i.firstChild)===null||y===void 0?void 0:y.attribute.dy)!==null&&S!==void 0?S:0}),i.forEachChildren(B=>{var P;B.setAttribute("dx",((P=B.attribute.dx)!==null&&P!==void 0?P:0)-M)})}}function QR(i){var t,e;const n=i.internalProps.layoutMap.headerObjects,o=i.internalProps.layoutMap.columnObjects;for(let r=0;r<n.length;r++){const s=n[r];if(s&&(!((t=s.style)===null||t===void 0)&&t.textStick))return!0}for(let r=0;r<o.length;r++){const s=o[r];if(s&&(!((e=s.style)===null||e===void 0)&&e.textStick))return!0}return!!(i.theme.headerStyle.textStick||i.theme.rowHeaderStyle.textStick||i.theme.bodyStyle.textStick)}var Nn=globalThis&&globalThis.__awaiter||function(i,t,e,n){return new(e||(e=Promise))(function(o,r){function s(h){try{a(n.next(h))}catch(d){r(d)}}function l(h){try{a(n.throw(h))}catch(d){r(d)}}function a(h){var d;h.done?o(h.value):(d=h.value,d instanceof e?d:new e(function(u){u(d)})).then(s,l)}a((n=n.apply(i,t||[])).next())})};class hN{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))):this.table.heightMode==="autoHeight"?this.rowLimit=Math.max(100,Math.ceil(2*t.tableNoFrameHeight/t.defaultRowHeight)):(this.table.widthMode==="autoWidth"||(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 n=e*t,o=e*(this.bodyRightCol-this.bodyLeftCol+1);this.xLimitLeft=n/2,this.xLimitRight=o-n/2;const r=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(r/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 n=e*t,o=e*(this.bodyBottomRow-this.bodyTopRow+1);this.yLimitTop=n/2,this.yLimitBottom=o-n/2;const r=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(r/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 n=this.table.defaultRowHeight;this.taskRowCount=1*Math.ceil(this.table.tableNoFrameHeight/n);const o=5*this.table.tableNoFrameHeight;this.screenRowCount=Math.ceil(this.table.tableNoFrameHeight/n),this.firstScreenRowLimit=this.bodyTopRow+Math.min(this.rowLimit,Math.ceil(o/n))}createGroupForFirstScreen(t,e,n,o,r,s,l,a){KW(t,e,n,o,r,s,l,a,this)}progress(){return Nn(this,void 0,void 0,function*(){if(!this.isProgressing)return this.isProgressing=!0,new Promise((t,e)=>{setTimeout(()=>Nn(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()),Ah(this.table),this.table.scenegraph.updateNextFrame(),t())}),16)})})}createRow(){return Nn(this,void 0,void 0,function*(){this.taskRowCount&&this.createRowCellGroup(this.taskRowCount)})}createCol(){return Nn(this,void 0,void 0,function*(){this.taskColCount&&this.createColGroup(this.taskRowCount)})}createRowCellGroup(t){const e=Math.min(this.totalRow,this.currentRow+t);if(zn(this.table,this.currentRow+1,e,!1),this.rowEnd=e,this.table.frozenColCount){let o=0;for(let r=0;r<this.table.frozenColCount;r++){const s=this.table.scenegraph.getColGroup(r),{height:l}=(this.table.isListTable(),lg(s,r,s.attribute.width,this.currentRow+1,e,this.table.scenegraph.mergeMap,this.table.internalProps.defaultRowHeight,this.table));o=Math.max(o,l),this.table.scenegraph.rowHeaderGroup.setAttribute("height",o)}}if(this.table.rightFrozenColCount){let o=0;for(let r=this.table.colCount-this.table.rightFrozenColCount;r<this.table.colCount;r++){const s=this.table.scenegraph.getColGroup(r),{height:l}=(this.table.isPivotChart(),lg(s,r,s.attribute.width,this.currentRow+1,e,this.table.scenegraph.mergeMap,this.table.internalProps.defaultRowHeight,this.table));o=Math.max(o,l),this.table.scenegraph.rightFrozenGroup.setAttribute("height",o)}}let n=0;for(let o=this.bodyLeftCol;o<=this.bodyRightCol;o++){const r=this.table.scenegraph.getColGroup(o);if(!r)continue;this.table.rowHeaderLevelCount;const{height:s}=lg(r,o,r.attribute.width,this.currentRow+1,e,this.table.scenegraph.mergeMap,this.table.internalProps.defaultRowHeight,this.table);n=Math.max(n,s)}this.table.scenegraph.bodyGroup.setAttribute("height",n),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);Wn(this.table,this.currentCol+1,e),this.colEnd=e;for(let s=0;s<this.table.rowCount;s++){const l=this.highPerformanceGetCell(this.currentCol,s);l.role==="cell"&&ft(l.mergeStartCol)&&l.mergeStartCol>this.currentCol&&this.table.scenegraph.updateCellContent(l.col,l.row)}if(this.table.frozenRowCount){const s=this.table.scenegraph.colHeaderGroup.lastChild instanceof de?this.table.scenegraph.colHeaderGroup.lastChild:this.table.scenegraph.colHeaderGroup.lastChild._prev,l=s.attribute.x+s.attribute.width,a=s.attribute.y;Si(this.table.scenegraph.colHeaderGroup,l,a,this.currentCol+1,e,0,this.table.frozenRowCount-1,"columnHeader",this.table)}if(this.table.bottomFrozenRowCount){const s=this.table.scenegraph.bottomFrozenGroup.lastChild instanceof de?this.table.scenegraph.bottomFrozenGroup.lastChild:this.table.scenegraph.bottomFrozenGroup.lastChild._prev,l=s.attribute.x+s.attribute.width,a=s.attribute.y;Si(this.table.scenegraph.bottomFrozenGroup,l,a,this.currentCol+1,e,this.table.rowCount-this.table.bottomFrozenRowCount,this.table.rowCount-1,"columnHeader",this.table)}let n=this.table.scenegraph.bodyGroup.lastChild&&(this.table.scenegraph.bodyGroup.lastChild instanceof de?this.table.scenegraph.bodyGroup.lastChild:this.table.scenegraph.bodyGroup.lastChild._prev);n||(n=this.table.scenegraph.colHeaderGroup.lastChild&&(this.table.scenegraph.colHeaderGroup.lastChild instanceof de?this.table.scenegraph.colHeaderGroup.lastChild:this.table.scenegraph.colHeaderGroup.lastChild._prev));const o=n.attribute.x+n.attribute.width,r=n.attribute.y;Si(this.table.scenegraph.bodyGroup,o,r,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,e=!1){return Nn(this,void 0,void 0,function*(){const n=this.table.getRowsHeight(this.bodyTopRow,this.bodyTopRow+(this.rowEnd-this.rowStart+1))/2,o=this.table.getAllRowsHeight()-n,r=this.table.getTargetRowAt(t+this.table.scenegraph.colHeaderGroup.attribute.height);r&&(this.screenTopRow=r.row),t<n&&this.rowStart===this.bodyTopRow||t>o&&this.rowEnd===this.bodyBottomRow?(this.updateDeltaY(t),this.updateBody(t-this.deltaY)):this.table.scenegraph.bodyGroup.firstChild&&this.table.scenegraph.bodyGroup.firstChild.childrenCount!==0||this.table.scenegraph.rowHeaderGroup.firstChild&&this.table.scenegraph.rowHeaderGroup.firstChild.childrenCount!==0?this.dynamicSetY(t,r,e):(this.updateDeltaY(t),this.updateBody(t-this.deltaY))})}setX(t,e=!1){return Nn(this,void 0,void 0,function*(){const n=this.table.getColsWidth(this.bodyLeftCol,this.bodyLeftCol+(this.colEnd-this.colStart+1))/2,o=this.table.getAllColsWidth()-n,r=this.table.getTargetColAt(t+this.table.scenegraph.rowHeaderGroup.attribute.width);r&&(this.screenLeftCol=r.col),t<n&&this.colStart===this.bodyLeftCol||t>o&&this.colEnd===this.bodyRightCol||this.table.scenegraph.bodyGroup.firstChild&&this.table.scenegraph.bodyGroup.firstChild.childrenCount===0?(this.updateDeltaX(t),this.table.scenegraph.setBodyAndColHeaderX(-t+this.deltaX)):this.dynamicSetX(t,r,e)})}dynamicSetY(t,e,n=!1){return Nn(this,void 0,void 0,function*(){eN(t,e,n,this)})}dynamicSetX(t,e,n=!1){return Nn(this,void 0,void 0,function*(){qW(t,e,n,this)})}updateBody(t){this.table.scenegraph.setBodyAndRowHeaderY(-t)}updateRowCellGroupsAsync(){return Nn(this,void 0,void 0,function*(){this.updateCellGroups(this.taskRowCount)})}updateCellGroups(t){const e=Math.min(this.bodyBottomRow,this.rowUpdatePos+t);this.table.heightMode==="autoHeight"&&zn(this.table,this.rowUpdatePos,e,!1),Rh(this.rowUpdatePos,e,this),this.table.heightMode==="autoHeight"&&(Cn(this.bodyLeftCol,this.bodyRightCol,this.rowUpdatePos,e,this.table,this.rowUpdateDirection,!0),Cn(0,this.table.frozenColCount-1,this.rowUpdatePos,e,this.table,this.rowUpdateDirection,!0),Cn(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;this.table.heightMode==="autoHeight"&&zn(this.table,t,e,!1),Rh(t,e,this),this.table.heightMode==="autoHeight"&&(Cn(this.bodyLeftCol,this.bodyRightCol,t,e,this.table,this.rowUpdateDirection),Cn(0,this.table.frozenColCount-1,t,e,this.table,this.rowUpdateDirection),Cn(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;this.table.widthMode==="autoWidth"&&Wn(this.table,t,e,!1),xh(t,e,this),this.table.heightMode==="autoHeight"&&$m(t,e,this.table,this.colUpdateDirection)}updateColCellGroupsAsync(){return Nn(this,void 0,void 0,function*(){this.updateColGroups(this.taskRowCount)})}updateColGroups(t){const e=Math.min(this.bodyRightCol,this.colUpdatePos+t);Wn(this.table,this.colUpdatePos,e),xh(this.colUpdatePos,e,this),this.colUpdatePos=e+1}updateCellGroupPosition(t,e,n){t.row=e,t.mergeStartCol=void 0,t.mergeStartRow=void 0,t.mergeEndCol=void 0,t.mergeEndRow=void 0,t.setAttribute("y",n),t.needUpdate=!0,t.needUpdateForAutoRowHeight=!0}updateCellGroupContent(t){if(!t.needUpdate||t.role!=="cell")return t;const e=this.table.scenegraph.updateCellContent(t.col,t.row);return t.needUpdate=!1,e||t}sortCellVertical(){return Nn(this,void 0,void 0,function*(){yield sN(this)})}sortCellHorizontal(){return Nn(this,void 0,void 0,function*(){yield aN(this)})}highPerformanceGetCell(t,e,n){if(e>=this.table.frozenRowCount&&e<this.table.rowCount-this.table.bottomFrozenRowCount&&(e<this.rowStart||e>this.rowEnd)||t>=this.table.frozenColCount&&t<this.table.colCount-this.table.rightFrozenColCount&&(t<this.colStart||t>this.colEnd))return sg;if(this.cellCache.get(t)){const r=this.cellCache.get(t);if((r._next||r._prev)&&Math.abs(r.row-e)<e){let l=Ym(r,e);return l&&(n||l.role!=="shadow-cell")||(l=this.table.scenegraph.getCell(t,e,n)),l.row&&this.cellCache.set(t,l),l}const s=this.table.scenegraph.getCell(t,e,n);return s.col===t&&s.row&&this.cellCache.set(t,s),s}const o=this.table.scenegraph.getCell(t,e,n);return o.col===t&&o.row&&this.cellCache.set(t,o),o}updateDeltaY(t,e,n){if(this.rowStart===this.bodyTopRow){const o=this.table.scenegraph.highPerformanceGetCell(this.colStart,this.rowStart,!0);if(o.role==="cell"){const r=o.attribute.y;this.deltaY=-r}}else if(this.rowEnd===this.bodyBottomRow){const o=this.table.scenegraph.highPerformanceGetCell(this.colStart,this.rowEnd,!0);if(o.role==="cell"){const r=o.attribute.y+o.attribute.height-(this.table.getAllRowsHeight()-this.table.getFrozenRowsHeight()-this.table.getBottomFrozenRowsHeight());this.deltaY=-r}}else if(z(e)&&z(n)){let o=this.table.scenegraph.highPerformanceGetCell(this.colStart,n,!0);o.role!=="cell"&&(o=this.table.scenegraph.highPerformanceGetCell(0,n,!0));const r=t-this.deltaY,s=e-r,l=o.attribute.y-r+this.table.getFrozenRowsHeight();this.deltaY=s-l}}updateDeltaX(t,e,n){if(this.colStart===this.bodyLeftCol){const o=this.table.scenegraph.getColGroup(this.colStart);if(o){const r=o.attribute.x;this.deltaX=-r}}else if(this.colEnd===this.bodyRightCol){const o=this.table.scenegraph.getColGroup(this.colEnd);if(o){const r=o.attribute.x+o.attribute.width-(this.table.getAllColsWidth()-this.table.getFrozenColsWidth()-this.table.getRightFrozenColsWidth());this.deltaX=-r}}else if(z(e)&&z(n)){const o=this.table.scenegraph.getColGroup(n)||this.table.scenegraph.getColGroup(n,!0),r=t-this.deltaX,s=e-r,l=o.attribute.x-r+this.table.getFrozenColsWidth();this.deltaX=s-l}}release(){this.isRelease=!0}}function Ym(i,t){if(!i)return null;if(i.row===t)return i;const e=i._prev,n=i._next;return i.row>t&&e&&e.row===i.row-1?Ym(e,t):i.row<t&&n&&n.row===i.row+1?Ym(n,t):null}function dN(i,t,e,n,o,r){const s=r.scenegraph;for(let l=i;l<=t;l++){const a=r.getColWidth(l),h=r.scenegraph.getColGroup(l,!0),d=r.scenegraph.getColGroup(l),u=r.scenegraph.getColGroupInBottom(l),c=r.scenegraph.getColGroupInLeftBottomCorner(l),g=r.scenegraph.getColGroupInRightBottomCorner(l);h&&(h.setAttribute("width",a),h.forEachChildren(f=>{f.setAttribute("width",a)})),d&&(d.setAttribute("width",a),d.forEachChildren(f=>{f.setAttribute("width",a)})),u&&(u.setAttribute("width",a),u.forEachChildren(f=>{f.setAttribute("width",a)})),g&&(g.setAttribute("width",a),g.forEachChildren(f=>{f.setAttribute("width",a)})),c&&(c.setAttribute("width",a),c.forEachChildren(f=>{f.setAttribute("width",a)}))}if(s.updateContainer(),o==="column")for(let l=i;l<=t;l++){const a=r.scenegraph.getColGroup(l);a==null||a.setAttribute("chartInstance",void 0);for(let h=0;h<=r.frozenRowCount-1;h++)s.updateCellContent(l,h);for(let h=s.bodyRowStart;h<=s.bodyRowEnd;h++)s.updateCellContent(l,h);for(let h=r.rowCount-r.bottomFrozenRowCount;h<=r.rowCount-1;h++)s.updateCellContent(l,h)}else{for(let l=0;l<=r.frozenColCount-1;l++){const a=r.scenegraph.getColGroup(l);a==null||a.setAttribute("chartInstance",void 0);for(let h=e;h<=n;h++)s.updateCellContent(l,h)}for(let l=s.bodyColStart;l<=s.bodyColEnd;l++){const a=r.scenegraph.getColGroup(l);a==null||a.setAttribute("chartInstance",void 0);for(let h=e;h<=n;h++)s.updateCellContent(l,h)}for(let l=r.colCount-r.rightFrozenColCount;l<=r.colCount-1;l++){const a=r.scenegraph.getColGroup(l);a==null||a.setAttribute("chartInstance",void 0);for(let h=e;h<=n;h++)s.updateCellContent(l,h)}}}function tA(i){i.customSelectedRangeComponents.forEach((t,e)=>{Xm(t,e,i)}),i.selectingRangeComponents.forEach((t,e)=>{Xm(t,e,i)}),i.selectedRangeComponents.forEach((t,e)=>{Xm(t,e,i)})}function Xm(i,t,e){var n,o,r,s,l,a,h,d,u;const c=e.table,[g,f,p,m]=t.split("-"),b=parseInt(g,10),C=parseInt(f,10),_=parseInt(p,10),w=parseInt(m,10);let y,S=b,A=C,R=_,x=w;switch(i.role){case"rowHeader":y=c.getBodyVisibleRowRange(),y&&(A=Math.max(C,y.rowStart-1),x=Math.min(w,y.rowEnd+1));break;case"columnHeader":case"bottomFrozen":y=c.getBodyVisibleCellRange(),y&&(S=Math.max(b,y.colStart-1),R=Math.min(_,y.colEnd+1));break;case"cornerHeader":case"rightTopCorner":case"leftBottomCorner":case"rightBottomCorner":break;case"rightFrozen":y=c.getBodyVisibleCellRange(),y&&(A=Math.max(C,y.rowStart-1),x=Math.min(w,y.rowEnd+1));break;default:y=c.getBodyVisibleCellRange(),y&&(A=Math.max(C,y.rowStart-1),x=Math.min(w,y.rowEnd+1),S=Math.max(b,y.colStart-1),R=Math.min(_,y.colEnd+1))}const T=c.getColsWidth(S,R),M=c.getRowsHeight(A,x),B=e.highPerformanceGetCell(S,A).globalAABBBounds,P=e.highPerformanceGetCell(R,x).globalAABBBounds;i.rect.setAttributes({x:B.x1-e.tableGroup.attribute.x,y:B.y1-e.tableGroup.attribute.y,width:T,height:M,visible:!0}),i.fillhandle&&((n=i.fillhandle)===null||n===void 0||n.setAttributes({x:P.x2-e.tableGroup.attribute.x-3,y:P.y2-e.tableGroup.attribute.y-3,width:6,height:6,visible:!0}));let F=!!c.frozenColCount&&b===c.frozenColCount;!F&&c.frozenColCount&&c.scrollLeft>0&&b>=c.frozenColCount&&c.getColsWidth(0,b-1)-c.scrollLeft<c.getFrozenColsWidth()&&(F=!0);let H=!!c.rightFrozenColCount&&c.rightFrozenColCount>0&&_===c.colCount-c.rightFrozenColCount-1;!H&&c.rightFrozenColCount&&_<c.colCount-c.rightFrozenColCount&&c.getColsWidth(0,_)-c.scrollLeft>c.tableNoFrameWidth-c.getRightFrozenColsWidth()&&(H=!0);let E=!c.frozenRowCount||C===c.frozenRowCount;!E&&c.frozenRowCount&&c.scrollTop>0&&C>=c.frozenRowCount&&c.getRowsHeight(0,C-1)-c.scrollTop<c.getFrozenRowsHeight()&&(E=!0);let k=!!c.bottomFrozenRowCount&&w===c.rowCount-c.bottomFrozenRowCount-1;if(!k&&c.bottomFrozenRowCount&&w<c.rowCount-c.bottomFrozenRowCount&&c.getRowsHeight(0,w)-c.scrollTop>c.tableNoFrameHeight-c.getBottomFrozenRowsHeight()&&(k=!0),F&&i.rect.attribute.stroke[3]||H&&i.rect.attribute.stroke[1]||E&&i.rect.attribute.stroke[0]||k&&i.rect.attribute.stroke[2]){if(F&&i.rect.attribute.stroke[3]&&e.tableGroup.insertAfter(i.rect,i.role==="columnHeader"?e.cornerHeaderGroup:i.role==="bottomFrozen"?e.leftBottomCornerGroup:e.rowHeaderGroup),k&&i.rect.attribute.stroke[2]&&e.tableGroup.insertAfter(i.rect,i.role==="rowHeader"?e.leftBottomCornerGroup:i.role==="rightFrozen"?e.rightBottomCornerGroup:e.bottomFrozenGroup),E&&i.rect.attribute.stroke[0]&&e.tableGroup.insertAfter(i.rect,i.role==="rowHeader"?e.cornerHeaderGroup:i.role==="rightFrozen"?e.rightTopCornerGroup:e.colHeaderGroup),H&&i.rect.attribute.stroke[1]&&e.tableGroup.insertAfter(i.rect,i.role==="columnHeader"?e.rightTopCornerGroup:i.role==="bottomFrozen"?e.rightBottomCornerGroup:e.rightFrozenGroup),i.rect.attribute.x<c.getFrozenColsWidth()&&c.scrollLeft>0&&(i.role==="body"||i.role==="columnHeader"||i.role==="bottomFrozen")){const L=i.rect.attribute.width-(c.getFrozenColsWidth()-i.rect.attribute.x);i.rect.setAttributes({x:i.rect.attribute.x+(c.getFrozenColsWidth()-i.rect.attribute.x),width:L>0?L:0}),(o=i.fillhandle)===null||o===void 0||o.setAttributes({visible:L>0})}if(c.getRightFrozenColsWidth()>0&&e.rightFrozenGroup.attribute.height>0&&i.rect.attribute.x+i.rect.attribute.width>e.rightFrozenGroup.attribute.x&&(i.role==="body"||i.role==="columnHeader"||i.role==="bottomFrozen")){const L=e.rightFrozenGroup.attribute.x-i.rect.attribute.x;i.rect.setAttributes({x:i.rect.attribute.x,width:L>0?L:0}),(r=i.fillhandle)===null||r===void 0||r.setAttributes({visible:L-T>0})}if(i.rect.attribute.y<e.colHeaderGroup.attribute.height&&c.scrollTop>0&&(i.role==="body"||i.role==="rowHeader"||i.role==="rightFrozen")){const L=i.rect.attribute.height-(e.colHeaderGroup.attribute.height-i.rect.attribute.y);i.rect.setAttributes({y:i.rect.attribute.y+(e.colHeaderGroup.attribute.height-i.rect.attribute.y),height:L>0?L:0}),(s=i.fillhandle)===null||s===void 0||s.setAttributes({visible:L>0})}if(e.bottomFrozenGroup.attribute.width>0&&e.bottomFrozenGroup.attribute.height>0&&i.rect.attribute.y+i.rect.attribute.height>e.bottomFrozenGroup.attribute.y&&(i.role==="body"||i.role==="rowHeader"||i.role==="rightFrozen")){const L=e.bottomFrozenGroup.attribute.y-i.rect.attribute.y;i.rect.setAttributes({y:i.rect.attribute.y,height:L>0?L:0}),(l=i.fillhandle)===null||l===void 0||l.setAttributes({visible:L-M>0})}}else e.tableGroup.insertAfter(i.rect,i.role==="body"?e.bodyGroup:i.role==="columnHeader"?e.colHeaderGroup:i.role==="rowHeader"?e.rowHeaderGroup:i.role==="cornerHeader"?e.cornerHeaderGroup:i.role==="rightTopCorner"?e.rightTopCornerGroup:i.role==="rightFrozen"?e.rightFrozenGroup:i.role==="leftBottomCorner"?e.leftBottomCornerGroup:i.role==="bottomFrozen"?e.bottomFrozenGroup:e.rightBottomCornerGroup);let I=0;typeof i.rect.attribute.lineWidth=="number"&&(I=Math.ceil(i.rect.attribute.lineWidth/2)),_===c.colCount-1&&(Array.isArray(i.rect.attribute.lineWidth)&&(I=Math.ceil(((a=i.rect.attribute.lineWidth[1])!==null&&a!==void 0?a:0)/2)),i.rect.setAttributes({width:i.rect.attribute.width-I})),b===0&&(Array.isArray(i.rect.attribute.lineWidth)&&(I=Math.ceil(((h=i.rect.attribute.lineWidth[3])!==null&&h!==void 0?h:0)/2)),i.rect.setAttributes({x:i.rect.attribute.x+I,width:i.rect.attribute.width-I})),w===c.rowCount-1&&(Array.isArray(i.rect.attribute.lineWidth)&&(I=Math.ceil(((d=i.rect.attribute.lineWidth[2])!==null&&d!==void 0?d:0)/2)),i.rect.setAttributes({height:i.rect.attribute.height-I})),C===0&&(Array.isArray(i.rect.attribute.lineWidth)&&(I=Math.ceil(((u=i.rect.attribute.lineWidth[0])!==null&&u!==void 0?u:0)/2)),i.rect.setAttributes({y:i.rect.attribute.y+I,height:i.rect.attribute.height-I}))}function eA(i,t,e=!0){const n=i.table,o=t.start.col,r=t.start.row,s=t.end.col,l=t.end.row,a=t.skipBodyMerge;let h=Math.max(Math.min(s,o),0),d=Math.max(Math.min(l,r),0),u=Math.min(Math.max(s,o),n.colCount-1),c=Math.min(Math.max(l,r),n.rowCount-1);const g=()=>{let A=!1;for(let R=h;R<=u;R++){if(R===h)for(let x=d;x<=c;x++){if(!n.isHeader(R,x)&&a)continue;const T=ui(n,R,x);if(T&&T.start.col<h){h=T.start.col,A=!0;break}}if(!A&&R===u)for(let x=d;x<=c;x++){if(!n.isHeader(R,x)&&a)continue;const T=ui(n,R,x);if(T&&Math.min(T.end.col,n.colCount-1)>u){u=T.end.col,A=!0;break}}if(A)break}if(!A)for(let R=d;R<=c;R++){if(R===d)for(let x=h;x<=u;x++){if(!n.isHeader(x,R)&&a)continue;const T=ui(n,x,R);if(T&&T.start.row<d){d=T.start.row,A=!0;break}}if(!A&&R===c)for(let x=h;x<=u;x++){if(!n.isHeader(x,R)&&a)continue;const T=ui(n,x,R);if(T&&Math.min(T.end.row,n.rowCount-1)>c){c=T.end.row,A=!0;break}}if(A)break}A&&g()};e&&g(),i.selectingRangeComponents.forEach((A,R)=>{var x;A.rect.delete(),(x=A.fillhandle)===null||x===void 0||x.delete()}),i.selectingRangeComponents=new Map;let f=!1,p=!1,m=!1,b=!1,C=!1,_=!1,w=!1,y=!1,S=!1;if(h<=n.frozenColCount-1&&d<=n.frozenRowCount-1&&(_=!0),u>=n.colCount-n.rightFrozenColCount&&d<=n.frozenRowCount-1&&(w=!0),h<=n.frozenColCount-1&&c>=n.rowCount-n.bottomFrozenRowCount&&(S=!0),u>=n.colCount-n.rightFrozenColCount&&c>=n.rowCount-n.bottomFrozenRowCount&&(y=!0),h<=n.frozenColCount-1&&c>=n.frozenRowCount&&d<=n.rowCount-n.bottomFrozenRowCount-1&&(f=!0),u>=n.colCount-n.rightFrozenColCount&&c>=n.frozenRowCount&&d<=n.rowCount-n.bottomFrozenRowCount-1&&(p=!0),d<=n.frozenRowCount-1&&u>=n.frozenColCount&&h<=n.colCount-n.rightFrozenColCount-1&&(m=!0),c>=n.rowCount-n.bottomFrozenRowCount&&u>=n.frozenColCount&&h<=n.colCount-n.rightFrozenColCount-1&&(b=!0),h<=n.colCount-n.rightFrozenColCount-1&&u>=n.frozenColCount&&d<=n.rowCount-n.bottomFrozenRowCount-1&&c>=n.frozenRowCount&&(C=!0),_){const A=Math.min(u,n.frozenColCount-1),R=Math.min(c,n.frozenRowCount-1),x=[!0,!m,!f,!0];i.createCellSelectBorder(h,d,A,R,"cornerHeader",`${h}${d}${u}${c}`,x)}if(w){const A=Math.max(h,n.colCount-n.rightFrozenColCount),R=Math.min(c,n.frozenRowCount-1),x=[!0,!0,!p,!m];i.createCellSelectBorder(A,d,u,R,"rightTopCorner",`${h}${d}${u}${c}`,x)}if(S){const A=Math.min(u,n.frozenColCount-1),R=Math.max(d,n.rowCount-n.bottomFrozenRowCount),x=[!f,!b,!0,!0];i.createCellSelectBorder(h,R,A,c,"leftBottomCorner",`${h}${d}${u}${c}`,x)}if(y){const A=Math.max(h,n.colCount-n.rightFrozenColCount),R=Math.max(d,n.rowCount-n.bottomFrozenRowCount),x=[!p,!0,!0,!b];i.createCellSelectBorder(A,R,u,c,"rightBottomCorner",`${h}${d}${u}${c}`,x)}if(m){const A=Math.max(h,n.frozenColCount),R=Math.min(u,n.colCount-n.rightFrozenColCount-1),x=Math.min(c,n.frozenRowCount-1),T=[!0,!w,!C,!_];i.createCellSelectBorder(A,d,R,x,"columnHeader",`${h}${d}${u}${c}`,T)}if(b){const A=Math.max(h,n.frozenColCount),R=Math.min(u,n.colCount-n.rightFrozenColCount-1),x=Math.max(d,n.rowCount-n.bottomFrozenRowCount),T=[!C,!y,!0,!S];i.createCellSelectBorder(A,x,R,c,"bottomFrozen",`${h}${d}${u}${c}`,T)}if(f){const A=Math.max(d,n.frozenRowCount),R=Math.min(c,n.rowCount-n.bottomFrozenRowCount-1),x=Math.min(u,n.frozenColCount-1),T=[!_,!C,!S,!0];i.createCellSelectBorder(h,A,x,R,"rowHeader",`${h}${d}${u}${c}`,T)}if(p){const A=Math.max(d,n.frozenRowCount),R=Math.min(c,n.rowCount-n.bottomFrozenRowCount-1),x=Math.max(h,n.colCount-n.rightFrozenColCount),T=[!w,!0,!y,!C];i.createCellSelectBorder(x,A,u,R,"rightFrozen",`${h}${d}${u}${c}`,T)}if(C){const A=Math.max(h,n.frozenColCount),R=Math.max(d,n.frozenRowCount),x=Math.min(u,n.colCount-n.rightFrozenColCount-1),T=Math.min(c,n.rowCount-n.bottomFrozenRowCount-1),M=[!m,!p,!b,!f];i.createCellSelectBorder(A,R,x,T,"body",`${h}${d}${u}${c}`,M)}}function iA(i){i.selectingRangeComponents.forEach((t,e)=>{t.rect.setAttribute("opacity",0)}),i.selectedRangeComponents.forEach((t,e)=>{t.rect.setAttribute("opacity",0)})}function nA(i){i.selectingRangeComponents.forEach((t,e)=>{t.rect.setAttribute("opacity",1)}),i.selectedRangeComponents.forEach((t,e)=>{t.rect.setAttribute("opacity",1)})}function uN(i,t,e,n,o,r,s,l){var a,h,d,u,c,g,f,p;let m=!!(!((a=i.table.options.excelOptions)===null||a===void 0)&&a.fillHandle);if(((h=i.table.stateManager.select.ranges)===null||h===void 0?void 0:h.length)>1)m=!1,i.removeFillHandleFromSelectComponents();else if(((d=i.table.stateManager.select.ranges)===null||d===void 0?void 0:d.length)===1){const B=Math.max(i.table.stateManager.select.ranges[0].start.row,i.table.stateManager.select.ranges[0].end.row),P=Math.max(i.table.stateManager.select.ranges[0].start.col,i.table.stateManager.select.ranges[0].end.col);i.table.isHeader(P,B)&&(m=!1)}!Array.isArray(l)||l[1]!==!1&&l[2]!==!1||(m=!1);const b=Math.min(t,n),C=Math.min(e,o),_=Math.max(t,n),w=Math.max(e,o),y=i.highPerformanceGetCell(b,C).globalAABBBounds,S=i.highPerformanceGetCell(_,w).globalAABBBounds,A=i.table.theme,R=(u=A.selectionStyle)===null||u===void 0?void 0:u.cellBorderColor,x=(c=A.selectionStyle)===null||c===void 0?void 0:c.cellBorderLineWidth,T=Fe({pickable:!1,fill:((g=A.selectionStyle)===null||g===void 0?void 0:g.selectionFillMode)!=="replace"&&((p=(f=A.selectionStyle)===null||f===void 0?void 0:f.cellBgColor)!==null&&p!==void 0?p:"rgba(0, 0, 255,0.1)"),lineWidth:x,stroke:l.map(B=>!!B&&R),x:y.x1-i.tableGroup.attribute.x,y:y.y1-i.tableGroup.attribute.y,width:0,height:0,visible:!0});let M;m&&(M=Fe({pickable:!1,fill:R,stroke:R,x:S.x2-3,y:S.y2-3,width:6,height:6,visible:!0})),i.lastSelectId=s,i.selectingRangeComponents.set(`${b}-${C}-${_}-${w}-${s}`,{rect:T,fillhandle:M,role:r}),i.tableGroup.insertAfter(T,r==="body"?i.bodyGroup:r==="columnHeader"?i.colHeaderGroup:r==="rowHeader"?i.rowHeaderGroup:r==="cornerHeader"?i.cornerHeaderGroup:r==="rightTopCorner"?i.rightTopCornerGroup:r==="rightFrozen"?i.rightFrozenGroup:r==="leftBottomCorner"?i.leftBottomCornerGroup:r==="bottomFrozen"?i.bottomFrozenGroup:i.rightBottomCornerGroup),m&&i.tableGroup.insertAfter(M,r==="body"?i.bodyGroup:r==="columnHeader"?i.colHeaderGroup:r==="rowHeader"?i.rowHeaderGroup:r==="cornerHeader"?i.cornerHeaderGroup:r==="rightTopCorner"?i.rightTopCornerGroup:r==="rightFrozen"?i.rightFrozenGroup:r==="leftBottomCorner"?i.leftBottomCornerGroup:r==="bottomFrozen"?i.bottomFrozenGroup:i.rightBottomCornerGroup)}function oA(i){i.selectingRangeComponents.forEach((t,e)=>{var n;i.selectedRangeComponents.get(e)&&(i.selectingRangeComponents.get(e).rect.delete(),(n=i.selectingRangeComponents.get(e).fillhandle)===null||n===void 0||n.delete()),i.selectedRangeComponents.set(e,t)}),i.selectingRangeComponents=new Map,i.updateNextFrame()}function cN(i){i.selectedRangeComponents.forEach((t,e)=>{var n;e.split("-")[4]===i.lastSelectId&&(t.rect.delete(),(n=t.fillhandle)===null||n===void 0||n.delete(),i.selectedRangeComponents.delete(e))})}function rA(i){i.selectedRangeComponents.forEach((t,e)=>{var n;t.rect.delete(),(n=t.fillhandle)===null||n===void 0||n.delete()}),i.selectedRangeComponents=new Map}function sA(i){i.selectingRangeComponents.forEach((t,e)=>{var n;t.rect.delete(),(n=t.fillhandle)===null||n===void 0||n.delete()}),i.selectingRangeComponents=new Map}function gN(i){i.selectedRangeComponents.forEach((t,e)=>{var n;(n=t.fillhandle)===null||n===void 0||n.delete(),t.fillhandle=void 0})}function fN(i,t,e,n){const o=n.scenegraph,r=ih(i.map(g=>g.row)).sort((g,f)=>f-g),s=ih(t.map(g=>g.row)).sort((g,f)=>g-f),l=ih(e.map(g=>g.row)).sort((g,f)=>g-f);let a;if(l.length&&(a=Zm(l[0]-1,l[l.length-1]+1,o)),s.length){const g=Zm(s[0]-1,s[s.length-1]+1,o);a=z(a)?z(g)?Math.min(a,g):a:g}if(r.length){const g=Zm(r[0]-1,r[r.length-1]+1,o);a=z(a)?z(g)?Math.min(a,g):a:g}r.forEach(g=>{pN(g,o)});const h=n.rowHeightsMap;if(r.forEach(g=>{h.delete(g)}),r.length){vN(o);const g=qm(r[r.length-1]-1,r[0]-r.length+1,o);a=z(a)?z(g)?Math.min(a,g):a:g}let d;if(o.table._clearRowRangeHeightsMap(),s.forEach(g=>{const f=mN(g,o);d=d??f,h.insert(g)}),bN(o),s.length){const g=qm(s[0]-1,s[s.length-1]+1,o);a=z(a)?z(g)?Math.min(a,g):a:g}for(let g=0;g<n.colCount;g++)l.forEach(f=>{if(f<n.frozenRowCount){const p=ui(o.table,g,f);if(p)for(let m=p.start.col;m<=p.end.col;m++)for(let b=p.start.row;b<=p.end.row;b++)_o(m,b,o.table,!1);else _o(g,f,o.table,!1)}else if(f>n.rowCount-1||f<o.table.rowCount-o.table.bottomFrozenRowCount&&(f<o.proxy.rowStart||f>o.proxy.rowEnd))aA(f,o);else{const p=ui(o.table,g,f);if(p)for(let m=p.start.col;m<=p.end.col;m++)for(let b=p.start.row;b<=p.end.row;b++)_o(m,b,o.table,!1);else _o(g,f,o.table,!1)}});if(l.length){const g=qm(l[0]-1,l[l.length-1]+1,o);a=z(a)?z(g)?Math.min(a,g):a:g}if(ft(d)){for(let g=0;g<n.colCount;g++)for(let f=d;f<n.rowCount;f++){const p=o.highPerformanceGetCell(g,f,!0);p&&(p.needUpdate=!0)}a=z(a)?z(d)?Math.min(a,d):a:d}if(ft(a)&&(o.proxy.rowUpdatePos=Math.min(o.proxy.rowUpdatePos,a)),s.length){if(!ft(d)){const g=Math.min(...s);o.proxy.rowUpdatePos=Math.min(g,o.proxy.rowUpdatePos)}o.proxy.rowUpdateDirection="up",o.proxy.updateCellGroups(2*o.proxy.screenRowCount),c()}else r.length&&(CN(r[r.length-1],o),o.proxy.updateCellGroups(2*o.proxy.screenRowCount),c());o.proxy.progress();const u=n.getRowsHeight(n.frozenRowCount,n.rowCount-1-n.bottomFrozenRowCount);function c(){if((s==null?void 0:s[(s==null?void 0:s.length)-1])>=n.rowCount-n.bottomFrozenRowCount||(l==null?void 0:l[(l==null?void 0:l.length)-1])>=n.rowCount-n.bottomFrozenRowCount||(r==null?void 0:r[0])>=n.rowCount-n.bottomFrozenRowCount){for(let g=0;g<n.colCount;g++)for(let f=n.rowCount-n.bottomFrozenRowCount;f<n.rowCount;f++){const p=o.highPerformanceGetCell(g,f,!0);p&&(p.needUpdate=!0)}o.proxy.updateBottomFrozenCellGroups()}}o.updateContainerHeight(o.table.frozenRowCount,u-o.bodyGroup.attribute.height)}function pN(i,t){const e=t.proxy;i>=e.rowStart&&i<=e.rowEnd&&(aA(i,t),e.rowEnd--,e.currentRow--),e.bodyBottomRow--;const n=Math.min(e.rowLimit,e.bodyBottomRow-e.bodyTopRow+1);e.totalActualBodyRowCount=n,e.totalRow=Math.min(e.table.rowCount-1,e.rowStart+n-1)}function mN(i,t){const e=t.proxy;e.bodyBottomRow++;const n=Math.min(e.rowLimit,e.bodyBottomRow-e.bodyTopRow+1);if(e.totalActualBodyRowCount=n,e.totalRow=e.rowStart+n-1,!(i<e.rowStart))return i>e.rowEnd?e.rowEnd-e.rowStart+1<e.rowLimit?(e.rowEnd++,e.currentRow++,lA(i,t),i):void 0:(e.rowEnd-e.rowStart+1<e.rowLimit&&(e.rowEnd++,e.currentRow++,lA(i,t)),i)}function vN(i){function t(e,n){e.row=n;const o=ui(i.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)}i.bodyGroup.forEachChildren(e=>{let n=i.bodyRowStart;e==null||e.forEachChildren(o=>{t(o,n),n++})}),i.rowHeaderGroup.forEachChildren(e=>{let n=i.bodyRowStart;e==null||e.forEachChildren(o=>{t(o,n),n++})}),i.rightFrozenGroup.forEachChildren(e=>{let n=i.bodyRowStart;e==null||e.forEachChildren(o=>{t(o,n),n++})}),i.bottomFrozenGroup.forEachChildren(e=>{let n=i.table.rowCount-i.table.bottomFrozenRowCount;e==null||e.forEachChildren(o=>{t(o,n),n++})}),i.leftBottomCornerGroup.forEachChildren(e=>{let n=i.table.rowCount-i.table.bottomFrozenRowCount;e==null||e.forEachChildren(o=>{t(o,n),n++})}),i.rightBottomCornerGroup.forEachChildren(e=>{let n=i.table.rowCount-i.table.bottomFrozenRowCount;e==null||e.forEachChildren(o=>{t(o,n),n++})})}function bN(i){function t(e,n,o){e.row=n,e.setAttribute("y",o);const r=ui(i.table,e.col,e.row);r?(e.mergeStartCol=r.start.col,e.mergeEndCol=r.end.col,e.mergeStartRow=r.start.row,e.mergeEndRow=r.end.row):(e.mergeStartCol=void 0,e.mergeEndCol=void 0,e.mergeStartRow=void 0,e.mergeEndRow=void 0)}i.bodyGroup.forEachChildren(e=>{let n=i.bodyRowStart,o=i.getCellGroupY(n);e==null||e.forEachChildren(r=>{t(r,n,o),n++,o+=r.attribute.height})}),i.rowHeaderGroup.forEachChildren(e=>{let n=i.bodyRowStart,o=i.getCellGroupY(n);e==null||e.forEachChildren(r=>{t(r,n,o),n++,o+=r.attribute.height})}),i.rightFrozenGroup.forEachChildren(e=>{let n=i.bodyRowStart,o=i.getCellGroupY(n);e==null||e.forEachChildren(r=>{t(r,n,o),n++,o+=r.attribute.height})}),i.bottomFrozenGroup.forEachChildren(e=>{let n=i.table.rowCount-i.table.bottomFrozenRowCount,o=0;e==null||e.forEachChildren(r=>{t(r,n,o),n++,o+=r.attribute.height})}),i.leftBottomCornerGroup.forEachChildren(e=>{let n=i.table.rowCount-i.table.bottomFrozenRowCount,o=0;e==null||e.forEachChildren(r=>{t(r,n,o),n++,o+=r.attribute.height})}),i.rightBottomCornerGroup.forEachChildren(e=>{let n=i.table.rowCount-i.table.bottomFrozenRowCount,o=0;e==null||e.forEachChildren(r=>{t(r,n,o),n++,o+=r.attribute.height})})}function lA(i,t){for(let e=0;e<t.table.colCount;e++){const n=new de({x:0,y:0,width:t.table.getColWidth(e),height:t.table.getRowHeight(i)});if(n.role="cell",n.col=e,n.row=i,n.needUpdate=!0,!n)continue;const o=t.getColGroup(e);if(o)if(o.firstChild&&i<o.firstChild.row)o.insertBefore(n,o.firstChild),o.firstChild.row=o.firstChild.row+1;else if(o.lastChild&&i>o.lastChild.row)o.appendChild(n);else{const r=t.highPerformanceGetCell(e,i,!0);r!==n&&(o.insertBefore(n,r),r&&(r.row=r.row+1),r!==o.lastChild&&o.lastChild&&(o.lastChild.row=o.lastChild.row+1))}}}function aA(i,t){for(let e=0;e<t.table.colCount;e++){const n=t.getColGroup(e,!1);if(!n)continue;let o;n.forEachChildren(r=>r.row===i&&(o=r,!0)),o&&(n.updateColumnHeight(-o.attribute.height),n.removeChild(o))}}function qm(i,t,e){let n;for(let o=0;o<e.table.colCount;o++){const r=e.table.getCellRange(o,i);let s;r.start.row<=i+1&&r.end.row>=i+1&&(hg(r,e),s=r.start.row);const l=e.table.getCellRange(o,t);l.start.row<=t+1&&l.end.row>=t+1&&(hg(l,e),s=l.start.row),z(s)&&(n=z(n)?Math.min(n,s):s)}return n}function Zm(i,t,e){let n;for(let o=0;o<e.table.colCount;o++){let r;const s=e.highPerformanceGetCell(o,i);s.mergeStartRow&&s.mergeEndRow&&s.mergeEndRow>i&&(hg({start:{row:s.mergeStartRow,col:e.table.heightMode==="autoHeight"?0:s.mergeStartCol},end:{row:s.mergeEndRow,col:e.table.heightMode==="autoHeight"?e.table.colCount-1:s.mergeEndCol}},e),r=s.mergeStartRow);const l=e.highPerformanceGetCell(o,t);l.mergeStartRow&&l.mergeEndRow&&l.mergeStartRow<t&&(hg({start:{row:l.mergeStartRow,col:e.table.heightMode==="autoHeight"?0:l.mergeStartCol},end:{row:l.mergeEndRow,col:e.table.heightMode==="autoHeight"?e.table.colCount-1:l.mergeEndCol}},e),r=l.mergeStartRow),z(r)&&(n=z(n)?Math.min(n,r):r)}return n}function hg(i,t){const{start:e,end:n}=i;for(let o=e.col;o<=n.col;o++)for(let r=e.row;r<=n.row;r++){const s=t.highPerformanceGetCell(o,r,!0);s&&(s.needUpdate=!0)}}function CN(i,t){if(t.table.isHasSeriesNumber())for(let e=i;e<=t.table.rowCount-1;e++)_o(0,e,t.table,!1)}function yN(i){const{internalProps:t}=i;t.bodyDomContainer=document.createElement("div"),t.bodyDomContainer.id="vtable-body-dom-container",t.bodyDomContainer.classList.add("table-component-container"),t.element.appendChild(t.bodyDomContainer),t.headerDomContainer=document.createElement("div"),t.headerDomContainer.id="vtable-header-dom-container",t.headerDomContainer.classList.add("table-component-container"),t.element.appendChild(t.headerDomContainer),t.frozenBodyDomContainer=document.createElement("div"),t.frozenBodyDomContainer.id="vtable-frozen-body-dom-container",t.frozenBodyDomContainer.classList.add("table-component-container"),t.element.appendChild(t.frozenBodyDomContainer),t.frozenHeaderDomContainer=document.createElement("div"),t.frozenHeaderDomContainer.id="vtable-frozen-header-dom-container",t.frozenHeaderDomContainer.classList.add("table-component-container"),t.element.appendChild(t.frozenHeaderDomContainer),t.rightFrozenBodyDomContainer=document.createElement("div"),t.rightFrozenBodyDomContainer.id="vtable-right-frozen-body-dom-container",t.rightFrozenBodyDomContainer.classList.add("table-component-container"),t.element.appendChild(t.rightFrozenBodyDomContainer),t.rightFrozenHeaderDomContainer=document.createElement("div"),t.rightFrozenHeaderDomContainer.id="vtable-right-frozen-header-dom-container",t.rightFrozenHeaderDomContainer.classList.add("table-component-container"),t.element.appendChild(t.rightFrozenHeaderDomContainer),t.frozenBottomDomContainer=document.createElement("div"),t.frozenBottomDomContainer.id="vtable-frozen-bottom-dom-container",t.frozenBottomDomContainer.classList.add("table-component-container"),t.element.appendChild(t.frozenBottomDomContainer),t.bottomDomContainer=document.createElement("div"),t.bottomDomContainer.id="vtable-bottom-dom-container",t.bottomDomContainer.classList.add("table-component-container"),t.element.appendChild(t.bottomDomContainer),t.rightFrozenBottomDomContainer=document.createElement("div"),t.rightFrozenBottomDomContainer.id="vtable-right-frozen-bottom-dom-container",t.rightFrozenBottomDomContainer.classList.add("table-component-container"),t.element.appendChild(t.rightFrozenBottomDomContainer)}function _N(i){const{headerDomContainer:t,bodyDomContainer:e,frozenBodyDomContainer:n,frozenHeaderDomContainer:o,rightFrozenBodyDomContainer:r,rightFrozenHeaderDomContainer:s,bottomDomContainer:l,frozenBottomDomContainer:a,rightFrozenBottomDomContainer:h}=i.internalProps;if(!(t||e||n||o||r||s||l||a||h))return;const d=i.getAllColsWidth(),u=Math.min(d,i.tableNoFrameWidth),c=i.getFrozenColsWidth(),g=i.getRightFrozenColsWidth(),f=c+g,p=Math.min(d-f,u-f),m=i.getAllRowsHeight(),b=Math.min(m,i.tableNoFrameHeight),C=i.getFrozenRowsHeight(),_=i.getBottomFrozenRowsHeight(),w=C+_,y=Math.min(m-w,b-w);i.frozenColCount>0?(t.style.left=`${i.tableX+c}px`,e.style.left=`${i.tableX+c}px`,l.style.left=`${i.tableX+c}px`):i.frozenColCount===0&&(t.style.left=`${i.tableX}px`,e.style.left=`${i.tableX}px`,l.style.left=`${i.tableX}px`),n.style.left=`${i.tableX}px`,o.style.left=`${i.tableX}px`,t.style.width=`${p}px`,t.style.height=`${C}px`,e.style.top=`${i.tableY}px`,e.style.width=`${p}px`,e.style.height=`${y}px`,e.style.top=`${i.tableY+C}px`,n.style.width=`${c}px`,n.style.height=`${y}px`,n.style.top=`${i.tableY+C}px`,o.style.width=`${c}px`,o.style.height=`${C}px`,o.style.top=`${i.tableY}px`,r.style.width=`${g}px`,r.style.height=`${y}px`,r.style.top=`${i.tableY+C}px`,r.style.left=i.tableX+u-g+"px",s.style.width=`${g}px`,s.style.height=`${C}px`,s.style.top=`${i.tableY}px`,s.style.left=i.tableX+u-g+"px",l.style.width=`${p}px`,l.style.height=`${_}px`,l.style.top=i.tableY+b-_+"px",a.style.width=`${c}px`,a.style.height=`${_}px`,a.style.top=i.tableY+b-_+"px",h.style.width=`${g}px`,h.style.height=`${_}px`,h.style.top=i.tableY+b-_+"px",h.style.left=i.tableX+u-g+"px"}function wN(i){if(!i.table.reactCustomLayout)return;const{table:t,stage:e}=i,n=e.pluginService.findPluginsByName("ReactAttributePlugin")[0],{htmlMap:o}=n;for(const r in o){const s=o[r],{graphic:l,wrapContainer:a}=s;let h;if(i.frozenColCount>t.frozenColCount){const{col:d,row:u}=Hr(l);u>=t.rowCount-t.bottomFrozenRowCount&&d<i.frozenColCount&&d>=t.frozenColCount&&l.attribute.react.container===t.frozenBottomDomContainer?h=t.bottomDomContainer:u>=t.frozenRowCount&&d<i.frozenColCount&&d>=t.frozenColCount&&l.attribute.react.container===t.frozenBodyDomContainer?h=t.bodyDomContainer:u<t.frozenRowCount&&d<i.frozenColCount&&d>=t.frozenColCount&&l.attribute.react.container===t.frozenHeaderDomContainer&&(h=t.headerDomContainer)}else if(i.frozenColCount<t.frozenColCount){const{col:d,row:u}=Hr(l);u>=t.rowCount-t.bottomFrozenRowCount&&d<t.frozenColCount&&d>=i.frozenColCount&&l.attribute.react.container===t.bottomDomContainer?h=t.frozenBottomDomContainer:u>=t.frozenRowCount&&d<t.frozenColCount&&d>=i.frozenColCount&&l.attribute.react.container===t.bodyDomContainer?h=t.frozenBodyDomContainer:u<t.frozenRowCount&&d<t.frozenColCount&&d>=i.frozenColCount&&l.attribute.react.container===t.headerDomContainer&&(h=t.frozenHeaderDomContainer)}h&&(h.appendChild(a),s.nativeContainer=h,s.container=h,l.attribute.react.container=h,n.updateStyleOfWrapContainer(l,e,a,h,l.attribute.react))}}function SN(i){var t,e;if(i.table.frozenColCount>i.table.rowHeaderLevelCount){i.rowHeaderGroup.setAttribute("height",i.bodyGroup.attribute.height),i.rowHeaderGroup.setAttribute("y",i.bodyGroup.attribute.y),i.cornerHeaderGroup.setAttribute("height",i.colHeaderGroup.attribute.height);for(let n=0;n<i.table.frozenColCount-i.table.rowHeaderLevelCount;n++)hA(i),dA(i),gA(i)}else if(i.table.frozenColCount<i.table.rowHeaderLevelCount){i.bodyGroup.setAttribute("height",i.rowHeaderGroup.attribute.height),i.bodyGroup.setAttribute("y",i.rowHeaderGroup.attribute.y),i.colHeaderGroup.setAttribute("height",i.cornerHeaderGroup.attribute.height);for(let n=0;n<i.table.rowHeaderLevelCount-i.table.frozenColCount;n++)uA(i),cA(i),fA(i)}i.bodyGroup.setAttribute("x",i.rowHeaderGroup.attribute.width),i.colHeaderGroup.setAttribute("x",i.cornerHeaderGroup.attribute.width),i.updateContainer(),i.updateBorderSizeAndPosition(),i.isPivot||i.table.transpose?i.table.options.frozenColCount?i.component.setFrozenColumnShadow(i.table.frozenColCount-1):i.table.options.frozenColCount&&i.component.setRightFrozenColumnShadow(i.table.colCount-i.table.rightFrozenColCount):(i.component.setFrozenColumnShadow(i.table.frozenColCount-1),i.component.setRightFrozenColumnShadow(i.table.colCount-i.table.rightFrozenColCount)),i.hasFrozen=!0,i.frozenColCount=i.table.frozenColCount,i.frozenRowCount=(e=(t=i.colHeaderGroup.firstChild)===null||t===void 0?void 0:t.childrenCount)!==null&&e!==void 0?e:0}function xN(i){var t,e,n,o;if(i.frozenColCount>i.table.frozenColCount){i.bodyGroup.setAttribute("height",i.rowHeaderGroup.attribute.height),i.bodyGroup.setAttribute("y",i.rowHeaderGroup.attribute.y),i.colHeaderGroup.setAttribute("height",i.cornerHeaderGroup.attribute.height);for(let r=0;r<i.frozenColCount-i.table.frozenColCount;r++)uA(i),cA(i),fA(i)}else if(i.frozenColCount<i.table.frozenColCount){i.rowHeaderGroup.setAttribute("height",i.bodyGroup.attribute.height),i.rowHeaderGroup.setAttribute("y",i.bodyGroup.attribute.y),i.cornerHeaderGroup.setAttribute("height",i.colHeaderGroup.attribute.height);for(let r=0;r<i.table.frozenColCount-i.frozenColCount;r++)hA(i),dA(i),gA(i)}wN(i),i.recreateAllSelectRangeComponents(),i.frozenColCount=i.table.frozenColCount,i.frozenRowCount=(e=(t=i.colHeaderGroup.firstChild)===null||t===void 0?void 0:t.childrenCount)!==null&&e!==void 0?e:0,i.proxy.colStart=(o=(n=i.bodyGroup.firstChild)===null||n===void 0?void 0:n.col)!==null&&o!==void 0?o:i.table.frozenColCount,i.bodyGroup.setAttribute("x",i.rowHeaderGroup.attribute.width),i.colHeaderGroup.setAttribute("x",i.cornerHeaderGroup.attribute.width),i.updateContainer(),i.updateBorderSizeAndPosition(),i.isPivot||i.table.transpose?i.table.options.frozenColCount?i.component.setFrozenColumnShadow(i.table.frozenColCount-1):i.table.options.rightFrozenColCount&&i.component.setRightFrozenColumnShadow(i.table.colCount-i.table.rightFrozenColCount):(i.component.setFrozenColumnShadow(i.table.frozenColCount-1),i.component.setRightFrozenColumnShadow(i.table.colCount-i.table.rightFrozenColCount)),i.hasFrozen=!0}function hA(i){const t=i.bodyGroup.firstChild instanceof de?i.bodyGroup.firstChild:null;t&&(i.rowHeaderGroup.appendChild(t),i.rowHeaderGroup.setAttribute("width",i.rowHeaderGroup.attribute.width+t.attribute.width),i.bodyGroup.setAttribute("width",i.bodyGroup.attribute.width-t.attribute.width))}function dA(i){const t=i.colHeaderGroup.firstChild instanceof de?i.colHeaderGroup.firstChild:null;t&&(i.cornerHeaderGroup.appendChild(t),i.cornerHeaderGroup.setAttribute("width",i.cornerHeaderGroup.attribute.width+t.attribute.width),i.colHeaderGroup.setAttribute("width",i.colHeaderGroup.attribute.width-t.attribute.width))}function uA(i){var t;const e=i.rowHeaderGroup.lastChild instanceof de?i.rowHeaderGroup.lastChild:(t=i.rowHeaderGroup.lastChild)===null||t===void 0?void 0:t._prev;e&&(nr(i.bodyGroup,e,i.bodyGroup.firstChild),i.bodyGroup.setAttribute("width",i.bodyGroup.attribute.width+e.attribute.width),i.rowHeaderGroup.setAttribute("width",i.rowHeaderGroup.attribute.width-e.attribute.width))}function cA(i){var t;const e=i.cornerHeaderGroup.lastChild instanceof de?i.cornerHeaderGroup.lastChild:(t=i.cornerHeaderGroup.lastChild)===null||t===void 0?void 0:t._prev;e&&(nr(i.colHeaderGroup,e,i.colHeaderGroup.firstChild),i.colHeaderGroup.setAttribute("width",i.colHeaderGroup.attribute.width+e.attribute.width),i.cornerHeaderGroup.setAttribute("width",i.cornerHeaderGroup.attribute.width-e.attribute.width))}function gA(i){const t=i.bottomFrozenGroup.firstChild instanceof de?i.bottomFrozenGroup.firstChild:null;t&&(i.leftBottomCornerGroup.appendChild(t),i.leftBottomCornerGroup.setAttribute("width",i.leftBottomCornerGroup.attribute.width+t.attribute.width),i.bottomFrozenGroup.setAttribute("width",i.bottomFrozenGroup.attribute.width-t.attribute.width),i.table.isPivotChart()&&t.forEachChildren(e=>{e.setAttributes({stroke:!1,fill:!1})}))}function fA(i){var t;const e=i.leftBottomCornerGroup.lastChild instanceof de?i.leftBottomCornerGroup.lastChild:(t=i.leftBottomCornerGroup.lastChild)===null||t===void 0?void 0:t._prev;e&&(nr(i.bottomFrozenGroup,e,i.bottomFrozenGroup.firstChild),i.bottomFrozenGroup.setAttribute("width",i.bottomFrozenGroup.attribute.width+e.attribute.width),i.leftBottomCornerGroup.setAttribute("width",i.leftBottomCornerGroup.attribute.width-e.attribute.width),i.table.isPivotChart()&&e.forEachChildren(n=>{var o,r,s,l;const a=i.table._getCellStyle(n.col,n.row),h=i.table.getCellRange(n.col,n.row),d=Pr(a,i.table,h?h.start.col:n.col,h?h.start.row:n.row,wt).theme;n.setAttributes({fill:(r=(o=d==null?void 0:d.group)===null||o===void 0?void 0:o.fill)!==null&&r!==void 0?r:void 0,stroke:(l=(s=d==null?void 0:d.group)===null||s===void 0?void 0:s.stroke)!==null&&l!==void 0?l:void 0})}))}function RN(i,t){const{table:e,proxy:n,rightTopCornerGroup:o,rightFrozenGroup:r,rightBottomCornerGroup:s,bottomFrozenGroup:l,bodyGroup:a,colHeaderGroup:h}=t,d=t.table.rightFrozenColCount;if(i>d){for(let c=e.colCount-d-1;c>=e.colCount-i;c--)nr(r,t.getColGroup(c),r.firstChild),nr(o,t.getColGroup(c,!0),o.firstChild),nr(s,t.getColGroupInBottom(c),s.firstChild);let u=0;r.forEachChildren(c=>{c.setAttribute("x",u),u+=c.attribute.width}),u=0,o.forEachChildren(c=>{c.setAttribute("x",u),u+=c.attribute.width}),u=0,s.forEachChildren(c=>{c.setAttribute("x",u),u+=c.attribute.width})}else if(i<d){for(let c=e.colCount-d;c<e.colCount-i;c++){const g=t.getColGroup(c);g.setAttribute("x",a.lastChild.attribute.x+e.getColWidth(a.lastChild.col)),a.appendChild(g);const f=t.getColGroupInRightTopCorner(c);f.setAttribute("x",h.lastChild.attribute.x+e.getColWidth(h.lastChild.col)),h.appendChild(f);const p=t.getColGroupInRightBottomCorner(c);p.setAttribute("x",l.lastChild.attribute.x+e.getColWidth(l.lastChild.col)),l.appendChild(p)}let u=0;r.forEachChildren(c=>{c.setAttribute("x",u),u+=c.attribute.width}),u=0,o.forEachChildren(c=>{c.setAttribute("x",u),u+=c.attribute.width}),u=0,s.forEachChildren(c=>{c.setAttribute("x",u),u+=c.attribute.width})}r.setAttribute("width",e.getColsWidth(e.colCount-i,e.colCount-1)),o.setAttribute("width",e.getColsWidth(e.colCount-i,e.colCount-1)),s.setAttribute("width",e.getColsWidth(e.colCount-i,e.colCount-1)),e.internalProps.rightFrozenColCount=i,t.updateContainer(),t.component.updateScrollBar(),t.updateNextFrame()}function AN(i,t){const{table:e,proxy:n,bottomFrozenGroup:o,leftBottomCornerGroup:r,rightBottomCornerGroup:s}=t;o.childrenCount||(n.table.isPivotChart()||(Si(r,0,0,0,e.frozenColCount-1,0,-1,"rowHeader",e),Si(s,0,0,e.colCount-e.rightFrozenColCount,e.colCount-1,0,-1,"body",e)),Si(o,0,0,n.colStart,n.colEnd,0,-1,"body",e));const l=t.table.bottomFrozenRowCount;if(i>l){for(let a=0;a<e.frozenColCount;a++){const h=t.getColGroupInLeftBottomCorner(a);for(let u=e.rowCount-l-1;u>=e.rowCount-i;u--)nr(h,t.getCell(a,u,!0),h.firstChild);let d=0;h.forEachChildren(u=>{u.setAttribute("y",d),d+=e.getRowHeight(u.row)})}for(let a=n.colStart;a<=n.colEnd;a++){const h=t.getColGroupInBottom(a);for(let u=e.rowCount-l-1;u>=e.rowCount-i;u--)nr(h,t.getCell(a,u,!0),h.firstChild);let d=0;h.forEachChildren(u=>{u.setAttribute("y",d),d+=e.getRowHeight(u.row)})}if(e.rightFrozenColCount>0)for(let a=e.colCount-e.rightFrozenColCount;a<e.colCount;a++){const h=t.getColGroupInRightBottomCorner(a);for(let u=e.rowCount-l-1;u>=e.rowCount-i;u--)nr(h,t.getCell(a,u,!0),h.firstChild);let d=0;h.forEachChildren(u=>{u.setAttribute("y",d),d+=e.getRowHeight(u.row)})}}else if(i<l){for(let a=0;a<e.rowHeaderLevelCount;a++){const h=t.getColGroup(a);for(let c=e.rowCount-l;c<e.rowCount-i;c++){const g=t.getCell(a,c,!0);g.setAttribute("y",h.lastChild.attribute.y+e.getRowHeight(h.lastChild.row)),h.appendChild(g)}const d=t.getColGroupInLeftBottomCorner(a);let u=0;d.forEachChildren(c=>{c.setAttribute("y",u),u+=e.getRowHeight(c.row)})}for(let a=n.colStart;a<=n.colEnd;a++){const h=t.getColGroup(a);for(let c=e.rowCount-l;c<e.rowCount-i;c++){const g=t.getCell(a,c,!0);g.setAttribute("y",h.lastChild.attribute.y+e.getRowHeight(h.lastChild.row)),h.appendChild(g)}const d=t.getColGroupInBottom(a);let u=0;d.forEachChildren(c=>{c.setAttribute("y",u),u+=e.getRowHeight(c.row)})}if(e.rightFrozenColCount>0)for(let a=e.colCount-e.rightFrozenColCount;a<e.colCount;a++){const h=t.getColGroup(a);for(let c=e.rowCount-l;c<e.rowCount-i;c++){const g=t.getCell(a,c,!0);g.setAttribute("y",h.lastChild.attribute.y+e.getRowHeight(h.lastChild.row)),h.appendChild(g)}const d=t.getColGroupInRightBottomCorner(a);let u=0;d.forEachChildren(c=>{c.setAttribute("y",u),u+=e.getRowHeight(c.row)})}}o.setAttribute("height",e.getRowsHeight(e.rowCount-i,e.rowCount-1)),r.setAttribute("height",e.getRowsHeight(e.rowCount-i,e.rowCount-1)),s.setAttribute("height",e.getRowsHeight(e.rowCount-i,e.rowCount-1)),e.internalProps.bottomFrozenRowCount=i,t.updateContainer(),t.component.updateScrollBar(),t.updateNextFrame()}function nr(i,t,e){t&&i&&(e?i.insertBefore(t,e):i.appendChild(t))}function TN(i,t){const{table:e}=i,n=e.internalProps.layoutMap,o=t===-1?"all":e.internalProps.columnResizeType;if(o==="column"){const r=i.getColGroup(t);if(r==null||r.forEachChildren(s=>{Tl(s,e.getColWidth(s.col),e.getRowHeight(s.row))}),e.widthMode==="adaptive"&&t<e.colCount-1){const s=i.getColGroup(t+1);s==null||s.forEachChildren(l=>{Tl(l,e.getColWidth(l.col),e.getRowHeight(l.row))})}}else{let r,s,l,a=e.rowHeaderLevelCount,h=e.colCount-1;if(o==="indicator")if(n.indicatorsAsCol)r=n.getIndicatorKey(t,e.columnHeaderLevelCount);else{const d=n.getCellHeaderPaths(t,e.columnHeaderLevelCount-1),u=d.colHeaderPaths[d.colHeaderPaths.length-1];s=u.dimensionKey,l=u.value}else if(o==="indicatorGroup"){const d=e.internalProps.layoutMap,u=d.getCellHeaderPaths(e.stateManager.columnResize.col,e.columnHeaderLevelCount),c=d.getHeadNodeByRowOrColDimensions(u.colHeaderPaths.slice(0,u.colHeaderPaths.length-1));a=c.startInTotal+e.frozenColCount,h=c.startInTotal+e.frozenColCount+c.size-1}for(let d=a;d<=h;d++){const u=i.getColGroup(d);if(u){if(o==="indicator"){const c=n.getIndicatorKey(d,e.columnHeaderLevelCount);if(n.indicatorsAsCol&&c!==r)continue;if(!n.indicatorsAsCol){const g=n.getCellHeaderPaths(d,e.columnHeaderLevelCount-1),f=g==null?void 0:g.colHeaderPaths[g.colHeaderPaths.length-1];if(!f||s!==f.dimensionKey||l!==f.value)continue}}u.forEachChildren(c=>{Tl(c,e.getColWidth(c.col),e.getRowHeight(c.row))})}}}}function MN(i,t){var e;const{table:n}=i,o=n.internalProps.layoutMap,r=n.stateManager,s=t===-1?"all":n.internalProps.rowResizeType;let l,a,h,d=n.columnHeaderLevelCount,u=n.rowCount-1;if(s==="indicator")if(o.indicatorsAsCol){const c=o.getCellHeaderPaths(n.rowHeaderLevelCount-1,t),g=(e=c.rowHeaderPaths)===null||e===void 0?void 0:e[c.rowHeaderPaths.length-1];a=g==null?void 0:g.dimensionKey,h=g==null?void 0:g.value}else l=o.getIndicatorKey(n.rowHeaderLevelCount,t);else if(s==="indicatorGroup"){const c=n.internalProps.layoutMap,g=c.getCellHeaderPaths(n.rowHeaderLevelCount,t),f=c.getHeadNodeByRowOrColDimensions(g.rowHeaderPaths.slice(0,g.rowHeaderPaths.length-1));d=f.startInTotal+n.frozenRowCount,u=f.startInTotal+n.frozenRowCount+f.size-1}for(let c=i.proxy.colStart;c<=i.proxy.colEnd;c++)if(s==="row"){const g=i.highPerformanceGetCell(c,t);if(g.role!=="cell")continue;if(Tl(g,n.getColWidth(g.col),n.getRowHeight(g.row)),n.heightMode==="adaptive"&&t<n.rowCount-1){const f=i.highPerformanceGetCell(c,t+1);Tl(f,n.getColWidth(f.col),n.getRowHeight(f.row))}}else for(let g=d;g<=u;g++){if(s==="indicator"){const p=o.getIndicatorKey(r.table.rowHeaderLevelCount,g);if(!o.indicatorsAsCol&&p!==l)continue;if(o.indicatorsAsCol){const m=o.getCellHeaderPaths(r.table.rowHeaderLevelCount-1,g),b=m==null?void 0:m.rowHeaderPaths[m.rowHeaderPaths.length-1];if(!b||a!==b.dimensionKey||h!==b.value)continue}}const f=i.highPerformanceGetCell(c,g);f.role==="cell"&&Tl(f,n.getColWidth(f.col),n.getRowHeight(f.row))}}function Th(i){var t;for(let e=i.proxy.colStart;e<=i.proxy.colEnd;e++){const n=i.getColGroup(e);(t=n==null?void 0:n.getChildren())===null||t===void 0||t.forEach(o=>{o.children.forEach(r=>{r.type==="chart"&&(r.cacheCanvas=null,r.addUpdateBoundTag())})})}}function BN(i,t,e){e.getCell(i,t).children.forEach(n=>{n.type==="chart"&&(n.cacheCanvas=null,n.addUpdateBoundTag())})}function PN(i){var t;const e=i.table;for(let n=i.proxy.colStart;n<=i.proxy.colEnd;n++){const o=i.getColGroup(n);(t=o==null?void 0:o.getChildren())===null||t===void 0||t.forEach(r=>{const s=r.col,l=r.row;r.children.forEach(a=>{if(a.type==="chart"){a.updateData(e.getCellValue(s,l));const h=a.attribute.spec,d=h.type;if(d!=="gauge"&&d!=="rose"&&d!=="radar"){const u=e.internalProps.layoutMap.getChartAxes(s,l);a.setAttribute("axes",u),h.axes=u}a.setAttribute("spec",h)}})})}dg(i.rowHeaderGroup,i.table),dg(i.colHeaderGroup,i.table),dg(i.rightFrozenGroup,i.table),dg(i.bottomFrozenGroup,i.table)}function HN(i,t){const e=i.table;if(e.isPivotChart()){const n=e._selectedDataItemsInChart.length;if((t===null||(t==null?void 0:t.length)===0||Object.keys(t).length===0)&&n===0)return;const o=[];if(Array.isArray(t))t.forEach(r=>{if(r&&r.key!==0&&Object.keys(r).length>0){const s={};for(const l in r)l.startsWith("VGRAMMAR_")||l.startsWith("__VCHART")||(s[l]=r[l]);o.push(s)}});else if(t&&t.key!==0&&Object.keys(t).length>0){const r={};for(const s in t)s.startsWith("VGRAMMAR_")||s.startsWith("__VCHART")||(r[s]=t[s]);o.push(r)}sa(e._selectedDataItemsInChart,o)||(e._selectedDataItemsInChart=o,e.internalProps.layoutMap.updateDataStateToChartInstance(),Th(i),e.scenegraph.updateNextFrame())}}function dg(i,t){i.forEachChildren(e=>{e.role==="column"&&e.forEachChildren(n=>{var o;if(n.role==="cell"){let r=!1;if(n.forEachChildren(s=>s.name==="axis"&&(r=!0,!0)),r){const s=t.internalProps.layoutMap.getAxisConfigInPivotChart(n.col,n.row),l=t._getCellStyle(n.col,n.row),a=Qt(wt("padding",l,n.col,n.row,t)),h=new(Bt.getComponent("axis"))(s,n.attribute.width,n.attribute.height,(o=s.__vtablePadding)!==null&&o!==void 0?o:a,t);n.clear(),n.appendChild(h.component),h.overlap()}}})})}function Tl(i,t,e){i.forEachChildren(n=>{n.type==="chart"&&(n.cacheCanvas=null,n.setAttributes({width:Math.ceil(t-n.attribute.cellPadding[3]-n.attribute.cellPadding[1]),height:Math.ceil(e-n.attribute.cellPadding[0]-n.attribute.cellPadding[2])}))})}function EN(i){const t=i.table.tableNoFrameWidth,e=i.table.tableNoFrameHeight;i.tableGroup=new de({x:0,y:0,width:t,height:e,clip:!0,pickable:!1}),i.tableGroup.role="table";const n=So(0,0,!i.table.options.enableTreeStickCell);n.role="col-header",i.colHeaderGroup=n;const o=So(0,0,!i.table.options.enableTreeStickCell);o.role="corner-header",i.cornerHeaderGroup=o;const r=So(0,0,!0);r.role="row-header",i.rowHeaderGroup=r;const s=So(t,0,!0);s.role="body",i.bodyGroup=s;const l=So(0,0,!0);l.role="right-frozen",i.rightFrozenGroup=l;const a=So(0,0,!0);a.role="bottom-frozen",i.bottomFrozenGroup=a;const h=So(0,0);h.role="component",i.componentGroup=h;const d=So(0,0,!0);d.role="corner-right-top-header",i.rightTopCornerGroup=d;const u=So(0,0,!0);u.role="corner-right-bottom-header",i.rightBottomCornerGroup=u;const c=So(0,0,!0);c.role="corner-left-bottom-header",i.leftBottomCornerGroup=c,i.tableGroup.addChild(s),i.tableGroup.addChild(r),i.tableGroup.addChild(a),i.tableGroup.addChild(n),i.tableGroup.addChild(l),i.tableGroup.addChild(u),i.tableGroup.addChild(d),i.tableGroup.addChild(c),i.tableGroup.addChild(o),i.tableGroup.addChild(h)}function So(i,t,e){return new de({x:0,y:0,width:i,height:t,clip:e!=null&&e,pickable:!1})}function or(i,t){return i.forEachChildrenSkipChild((e,n)=>{e.setAttribute("x",t),t+=e.attribute.width}),t}function LN(i,t,e){i!==-1&&t!==-1&&(ao(i,t,n=>n.attribute.visibleTime==="mouseenter_cell",n=>{n.setAttribute("opacity",0);const o=n.parent.getChildByName("icon-back");o&&o.setAttribute("visible",!1)},e),e.updateNextFrame())}function kN(i,t,e){i!==-1&&t!==-1&&(ao(i,t,n=>n.attribute.visibleTime==="mouseenter_cell",n=>{n.setAttribute("opacity",1)},e),e.updateNextFrame())}function FN(i,t,e){i!==-1&&t!==-1&&(ao(i,t,n=>n.attribute.visibleTime==="click_cell",n=>{n.setAttribute("opacity",0)},e),e.updateNextFrame())}function IN(i,t,e){i!==-1&&t!==-1&&(ao(i,t,n=>n.attribute.visibleTime==="click_cell",n=>{n.setAttribute("opacity",1)},e),e.updateNextFrame())}function DN(i,t,e,n,o){let r;return o.getCell(i,t).forEachChildren(s=>{s.role&&s.role.startsWith("icon")&&s.containsPoint(e,n,da.GLOBAL)&&(r=s)}),r}function ON(i,t,e,n,o){var r,s;if((i.attribute.backgroundColor||i.attribute.hoverImage)&&ao(t,e,l=>l.name===i.name,l=>{var a,h,d,u,c,g,f,p;if(l.attribute.backgroundColor){let m=l.parent.getChildByName("icon-back");m?m.setAttributes({x:((a=l.attribute.x)!==null&&a!==void 0?a:0)+(l.AABBBounds.width()-l.backgroundWidth)/2,y:((h=l.attribute.y)!==null&&h!==void 0?h:0)+(l.AABBBounds.height()-l.backgroundHeight)/2,dx:(d=l.attribute.dx)!==null&&d!==void 0?d:0,dy:(u=l.attribute.dy)!==null&&u!==void 0?u:0,width:l.backgroundWidth,height:l.backgroundHeight,fill:l.attribute.backgroundColor,cornerRadius:5,visible:!0}):(m=Fe({x:((c=l.attribute.x)!==null&&c!==void 0?c:0)+(l.AABBBounds.width()-l.backgroundWidth)/2,y:((g=l.attribute.y)!==null&&g!==void 0?g:0)+(l.AABBBounds.height()-l.backgroundHeight)/2,dx:(f=l.attribute.dx)!==null&&f!==void 0?f:0,dy:(p=l.attribute.dy)!==null&&p!==void 0?p:0,width:l.backgroundWidth,height:l.backgroundHeight,fill:l.attribute.backgroundColor,cornerRadius:5,pickable:!1,visible:!0}),m.name="icon-back"),l.parent.insertBefore(m,l)}l.attribute.hoverImage&&l.attribute.image!==l.attribute.hoverImage&&(l.image=l.attribute.hoverImage)},o),i.tooltip){const{x1:l,x2:a,y1:h,y2:d}=i.globalAABBBounds,u={content:i.tooltip.title,referencePosition:{rect:{left:l,right:a,top:h,bottom:d,width:i.globalAABBBounds.width(),height:i.globalAABBBounds.height()},placement:i.tooltip.placement},disappearDelay:i.tooltip.disappearDelay,style:Object.assign({},(r=o.table.internalProps.theme)===null||r===void 0?void 0:r.tooltipStyle,(s=i.tooltip)===null||s===void 0?void 0:s.style)};o.table.internalProps.tooltipHandler.isBinded(u)||o.table.showTooltip(t,e,u)}}function zN(i,t,e,n){(i.attribute.backgroundColor||i.attribute.hoverImage)&&ao(t,e,o=>o.name===i.name,o=>{const r=o.parent.getChildByName("icon-back");r&&r.setAttribute("visible",!1),o.attribute.hoverImage&&o.attribute.image!==o.attribute.originImage&&(o.image=o.attribute.originImage)},n)}function pA(i,t,e,n,o){const r=i.name;ao(e,n,s=>s.name===r,s=>{On(t,s),s.name=t.name},o),o.updateNextFrame()}function WN(i,t,e,n){const o=n.getCell(i,t);if(z(o.mergeStartCol)&&z(o.mergeStartRow)&&z(o.mergeEndCol)&&z(o.mergeEndRow))for(let r=o.mergeStartCol;r<=o.mergeEndCol;r++)for(let s=o.mergeStartRow;s<=o.mergeEndRow;s++){let l;n.getCell(r,s).forEachChildren(a=>a.attribute.funcType==="sort"&&(l=a,!0)),l&&(On(e,l),l.name=e.name)}else{let r;am(o,"children",s=>s.attribute.funcType==="sort"&&(r=s,!0)),r&&(On(e,r),r.name=e.name)}}function NN(i,t,e,n,o){const r=o.getCellRange(i,t),s=o.getCellRange(e,n);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}function VN(i){const{col:t,row:e,iconMark:n,order:o,oldSortCol:r,oldSortRow:s,oldIconMark:l,scene:a}=i,h=a.table.internalProps.headerHelper.getSortIcon(o,a.table,t,e);if(n&&pA(n,h,t,e,a),!NN(t,e,r,s,a.table)){const d=a.table.internalProps.headerHelper.getSortIcon("normal",a.table,r,s);l?pA(l,d,r,s,a):WN(r,s,d,a)}}function jN(i){for(let t=0;t<i.table.colCount;t++)for(let e=0;e<i.table.columnHeaderLevelCount;e++)ao(t,e,n=>n.attribute.funcType==="frozen",n=>{const o=i.table.internalProps.headerHelper.getFrozenIcon(t,e);On(o,n),n.name=o.name},i)}function $N(i,t,e){let n;n=e.table.isHeader(i,t)?e.table.internalProps.headerHelper.getHierarchyIcon(i,t):e.table.internalProps.bodyHelper.getHierarchyIcon(i,t),ao(i,t,o=>o.attribute.funcType===ve.collapse||o.attribute.funcType===ve.expand,o=>{On(n,o),o.name=n.name},e)}function Jm(i,t,e){i.forEachChildren(n=>{n.type==="group"?Jm(n,t,e):t(n)&&e(n)})}function ao(i,t,e,n,o){const r=o.getCell(i,t);if(r.role==="cell"&&z(r.mergeStartCol)&&z(r.mergeStartRow)&&z(r.mergeEndCol)&&z(r.mergeEndRow)){const{colStart:s,colEnd:l,rowStart:a,rowEnd:h}=kr(r,o);for(let d=s;d<=l;d++)for(let u=a;u<=h;u++)Jm(o.highPerformanceGetCell(d,u),e,n)}else Jm(r,e,n)}function GN(i,t,e){ao(i,t,n=>n.attribute.funcType===ve.dropDown,n=>{n.oldVisibleTime=n.attribute.visibleTime,n.setAttribute("visibleTime","always"),n.setAttribute("opacity",1)},e)}function UN(i,t,e){ao(i,t,n=>n.attribute.funcType===ve.dropDown,n=>{n.oldVisibleTime&&n.setAttribute("visibleTime",n.oldVisibleTime),n.setAttribute("opacity",n.attribute.visibleTime==="always"?1:0)},e)}function Qm(i,t){const{bgColor:e,borderColor:n,borderLineWidth:o,borderLineDash:r}=t,s={x:0,y:0,width:0,height:0,visible:!1,pickable:!0,fill:e};return s.stroke=Dm(n,void 0),s.lineWidth=o,r&&(s.lineDash=r),s.lineCap="butt",Array.isArray(n)&&(s.strokeArrayColor=Qt(n)),Array.isArray(o)&&(s.strokeArrayWidth=Qt(o),s.lineWidth=1),i.setAttributes(s),i.role="corner-frozen",i}function KN(i,t,e,n){const o=n.scenegraph,r=tv(i.map(c=>c.col)).sort((c,g)=>g-c),s=tv(t.map(c=>c.col)).sort((c,g)=>c-g),l=tv(e.map(c=>c.col)).sort((c,g)=>c-g);r.forEach(c=>{YN(c,o)});const a=n.colWidthsMap;let h;if(r.forEach(c=>{a.delAndReorder(c)}),r.length&&mA(o),o.table._clearColRangeWidthsMap(),s.forEach(c=>{const g=XN(c,o);mA(o),h=h??g,a.addAndReorder(c)}),qN(o),l.forEach(c=>{for(let g=0;g<n.rowCount;g++){const f=ui(o.table,c,g);if(f)for(let p=f.start.col;p<=f.end.col;p++)for(let m=f.start.col;m<=f.end.col;m++)_o(m,g,o.table,!1);else _o(c,g,o.table,!1)}}),ft(h)){for(let c=h;c<n.colCount;c++)for(let g=0;g<n.rowCount;g++){const f=o.highPerformanceGetCell(c,g,!0);f&&(f.needUpdate=!0)}o.proxy.colUpdatePos=h}if(s.length){if(!ft(h)){const c=Math.min(...s);o.proxy.colUpdatePos=c}o.proxy.colUpdateDirection="left",o.proxy.updateColGroups(2*o.proxy.screenColCount),u(),o.proxy.progress()}else r.length&&(o.proxy.updateColGroups(2*o.proxy.screenColCount),u(),o.proxy.progress());const d=n.getColsWidth(n.frozenColCount,n.colCount-1);function u(){if((s==null?void 0:s[(s==null?void 0:s.length)-1])>=n.colCount-n.rightFrozenColCount||(l==null?void 0:l[(l==null?void 0:l.length)-1])>=n.colCount-n.rightFrozenColCount||(r==null?void 0:r[0])>=n.colCount-n.rightFrozenColCount){for(let c=n.colCount-n.rightFrozenColCount;c<n.colCount;c++)for(let g=0;g<n.rowCount;g++){const f=o.highPerformanceGetCell(c,g,!0);f&&(f.needUpdate=!0)}o.proxy.updateRightFrozenCellGroups()}}o.updateContainerWidth(o.table.frozenColCount,d-o.bodyGroup.attribute.width)}function YN(i,t){const e=t.proxy;if(i>=t.table.rowHeaderLevelCount&&!(i>=t.table.colCount-t.table.rightFrozenColCount)){const o=t.getColGroup(i,!1);o&&o.parent===t.bodyGroup&&t.bodyGroup.removeChild(o);const r=t.getColGroupInBottom(i);r&&r.parent===t.bottomFrozenGroup&&t.bottomFrozenGroup.removeChild(r)}i>=e.colStart&&i<=e.colEnd&&(e.colEnd--,e.currentCol--),e.bodyRightCol--;const n=Math.min(e.colLimit,e.bodyRightCol-e.bodyLeftCol+1);e.totalActualBodyColCount=n,e.totalCol=e.colStart+n-1}function XN(i,t){const e=t.proxy;e.bodyRightCol++;const n=Math.min(e.colLimit,e.bodyRightCol-e.bodyLeftCol+1);if(e.totalActualBodyColCount=n,e.totalCol=e.colStart+n-1,!(i<e.colStart))return i>e.colEnd?e.colEnd-e.colStart+1<e.colLimit?(e.colEnd++,e.currentCol++,vA(i,t),i):void 0:(e.colEnd-e.colStart+1<e.colLimit&&(e.colEnd++,e.currentCol++,vA(i,t)),i)}function tv(i){const t=[];for(let e=0;e<i.length;e++)t.indexOf(i[e])===-1&&t.push(i[e]);return t}function mA(i){let t=i.bodyColStart;function e(n){n.col=t;const o=ui(i.table,n.col,n.row);o&&(n.mergeStartCol=o.start.col,n.mergeStartCol=o.start.col,n.mergeEndCol=o.end.col,n.mergeEndCol=o.end.col),n.role}i.bodyGroup.forEachChildren(n=>{n.col=t,n==null||n.forEachChildren(o=>{e(o)}),t++}),t=i.bodyColStart,i.colHeaderGroup.forEachChildren(n=>{n.col=t,n==null||n.forEachChildren(o=>{e(o)}),t++}),t=i.bodyColStart,i.bottomFrozenGroup.forEachChildren(n=>{n.col=t,n==null||n.forEachChildren(o=>{e(o)}),t++})}function qN(i){let t=i.bodyColStart,e=i.getCellGroupX(t);function n(o){o.col=t;const r=ui(i.table,o.col,o.row);r&&(o.mergeStartCol=r.start.col,o.mergeStartCol=r.start.col,o.mergeEndCol=r.end.col,o.mergeEndCol=r.end.col),o.role}i.bodyGroup.forEachChildren(o=>{o.col=t,o==null||o.forEachChildren(r=>{n(r)}),o.setAttribute("x",e),e+=o.attribute.width,t++}),t=i.bodyColStart,e=i.getCellGroupX(t),i.colHeaderGroup.forEachChildren(o=>{o.col=t,o==null||o.forEachChildren(r=>{n(r)}),o.setAttribute("x",e),e+=o.attribute.width,t++}),t=i.bodyColStart,e=i.getCellGroupX(t),i.bottomFrozenGroup.forEachChildren(o=>{o.col=t,o==null||o.forEachChildren(r=>{n(r)}),o.setAttribute("x",e),e+=o.attribute.width,t++}),t=i.table.colCount-i.table.rightFrozenColCount,e=0,i.rightFrozenGroup.forEachChildren(o=>{o.col=t,o==null||o.forEachChildren(r=>{n(r)}),o.setAttribute("x",e),e+=o.attribute.width,t++}),t=i.table.colCount-i.table.rightFrozenColCount,e=0,i.rightTopCornerGroup.forEachChildren(o=>{o.col=t,o==null||o.forEachChildren(r=>{n(r)}),o.setAttribute("x",e),e+=o.attribute.width,t++}),t=i.table.colCount-i.table.rightFrozenColCount,e=0,i.rightBottomCornerGroup.forEachChildren(o=>{o.col=t,o==null||o.forEachChildren(r=>{n(r)}),o.setAttribute("x",e),e+=o.attribute.width,t++})}function vA(i,t){if(t.colHeaderGroup&&t.table.columnHeaderLevelCount>0){const n=new de({x:0,y:0,width:t.table.getColWidth(i),height:0,clip:!1,pickable:!1});n.role="column",n.col=i;const o=t.getColGroup(i,!0);o?t.colHeaderGroup.insertBefore(n,o):t.colHeaderGroup.appendChild(n),e(n,i,0,t.table.columnHeaderLevelCount-1)}if(t.bodyGroup){const n=new de({x:0,y:0,width:t.table.getColWidth(i),height:0,clip:!1,pickable:!1});n.role="column",n.col=i;const o=t.getColGroup(i,!1);o?t.bodyGroup.insertBefore(n,o):t.bodyGroup.appendChild(n),e(n,i,t.bodyRowStart,t.bodyRowEnd)}if(t.bottomFrozenGroup&&t.table.bottomFrozenRowCount>0){const n=new de({x:0,y:0,width:t.table.getColWidth(i),height:0,clip:!1,pickable:!1});n.role="column",n.col=i;const o=t.getColGroupInBottom(i);o?t.bottomFrozenGroup.insertBefore(n,o):t.bottomFrozenGroup.appendChild(n),e(n,i,t.table.rowCount-t.table.bottomFrozenRowCount,t.table.rowCount-1)}function e(n,o,r,s){for(let l=r;l<=s;l++){const a=new de({x:0,y:0,width:t.table.getColWidth(o),height:t.table.getRowHeight(l)});a.role="cell",a.col=o,a.row=l,a.needUpdate=!0,n.appendChild(a)}}}function ZN(i){var t,e,n,o;if(!i.options.animationAppear)return;let r,s,l,a;i.options.animationAppear===!0?(r=500,s=0,l="one-by-one",a="column"):(r=(t=i.options.animationAppear.duration)!==null&&t!==void 0?t:500,s=(e=i.options.animationAppear.delay)!==null&&e!==void 0?e:0,l=(n=i.options.animationAppear.type)!==null&&n!==void 0?n:"one-by-one",a=(o=i.options.animationAppear.direction)!==null&&o!==void 0?o:"row");const{scenegraph:h,frozenColCount:d,frozenRowCount:u}=i,{colStart:c,colEnd:g,rowStart:f,rowEnd:p}=h.proxy;for(let m=0;m<=g;m++)for(let b=0;b<=p;b++){const C=h.highPerformanceGetCell(m,b);C&&C.role==="cell"&&C.forEachChildren(_=>{_.setAttribute("opacity",0),_.animate().wait(l==="one-by-one"?(a==="row"?b:m)*(r-s):s).to({opacity:1},r,"linear")})}}function JN(i,t){const{selectedRangeComponents:e}=t;e.forEach((n,o)=>{n.rect.setAttributes(i)}),t.updateNextFrame()}ix(),Gt.load(WW),Gt.load(rW);class QN{constructor(t){let e,n;this._needUpdateContainer=!1,this.table=t,this.hasFrozen=!1,this.clear=!0,this.mergeMap=new Map,tO(this.table.theme.textPopTipStyle),t.options.canvas&&t.options.viewBox?(Ke.setEnv("browser"),e=t.options.viewBox.x2-t.options.viewBox.x1,n=t.options.viewBox.y2-t.options.viewBox.y1):oe.mode==="node"?(Ke.setEnv("node",t.options.modeParams),e=t.canvasWidth,n=t.canvasHeight):(Ke.setEnv("browser"),e=t.canvas.width,n=t.canvas.height),this.stage=QF(Object.assign({canvas:t.canvas,width:e,height:n,disableDirtyBounds:!1,background:t.theme.underlayBackgroundColor,dpr:t.internalProps.pixelRatio,enableLayout:!0,beforeRender:o=>{this.table.options.beforeRender&&this.table.options.beforeRender(o),this.table.animationManager.ticker.start()},afterRender:o=>{this.table.options.afterRender&&this.table.options.afterRender(o),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(e=(t=this.tableGroup.attribute)===null||t===void 0?void 0:t.width)!==null&&e!==void 0?e:0}get height(){var t,e;return(e=(t=this.tableGroup.attribute)===null||t===void 0?void 0:t.height)!==null&&e!==void 0?e:0}get x(){var t,e;return(e=(t=this.tableGroup.attribute)===null||t===void 0?void 0:t.x)!==null&&e!==void 0?e:0}get y(){var t,e;return(e=(t=this.tableGroup.attribute)===null||t===void 0?void 0:t.y)!==null&&e!==void 0?e:0}get bodyRowStart(){var t;return(t=this.proxy.rowStart)!==null&&t!==void 0?t:0}get bodyRowEnd(){var t;return(t=this.proxy.rowEnd)!==null&&t!==void 0?t:this.table.rowCount-1}get bodyColStart(){var t;return(t=this.proxy.colStart)!==null&&t!==void 0?t:0}get bodyColEnd(){var t;return(t=this.proxy.colEnd)!==null&&t!==void 0?t:this.table.colCount-1}initSceneGraph(){this.isPivot=this.table.isPivotTable(),EN(this)}clearCells(){var t,e;this.table.animationManager.clear(),(this.table.isPivotChart()||this.table._hasCustomRenderOrLayout())&&this.stage.pluginService.findPluginsByName("poptipForText").forEach(n=>{n.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),(t=this.proxy)===null||t===void 0||t.release(),(e=this.table.reactCustomLayout)===null||e===void 0||e.clearCache()}updateStageBackground(){this.stage.background=this.table.theme.underlayBackgroundColor,this.stage.renderNextFrame()}createComponent(){this.component=new SW(this.table),this.component.addToGroup(this.componentGroup),this.selectedRangeComponents=new Map,this.selectingRangeComponents=new Map,this.customSelectedRangeComponents=new Map}updateComponent(){this.component.updateStyle()}createSceneGraph(t=!1){t||(this.table.rowHeightsMap.clear(),this.table.internalProps.layoutMap.clearCellRangeMap()),(this.table.isPivotChart()||this.table._hasCustomRenderOrLayout())&&this.stage.pluginService.autoEnablePlugins.getContributions().forEach(e=>{e.name==="poptipForText"&&this.stage.pluginService.register(e)}),this.clear=!1,this.frozenColCount=this.table.frozenColCount,this.frozenRowCount=this.table.frozenRowCount,this.proxy=new hN(this.table),xl(this.tableGroup,this.table.theme.frameStyle,this.tableGroup.role,void 0,!0),this.table.isPivotChart()&&(Qm(this.rightTopCornerGroup,this.table.theme.cornerRightTopCellStyle||this.table.theme.cornerHeaderStyle||{}),Qm(this.leftBottomCornerGroup,this.table.theme.cornerLeftBottomCellStyle||this.table.theme.cornerHeaderStyle||{}),Qm(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,n){var o,r,s,l,a,h;let d;if(d=this.table.rightFrozenColCount>0&&t>=this.table.colCount-this.table.rightFrozenColCount&&e<this.table.frozenRowCount?(o=this.rightTopCornerGroup.getColGroup(t))===null||o===void 0?void 0:o.getRowGroup(e):this.table.bottomFrozenRowCount>0&&e>=this.table.rowCount-this.table.bottomFrozenRowCount&&t<this.table.frozenColCount?(r=this.leftBottomCornerGroup.getColGroup(t))===null||r===void 0?void 0:r.getRowGroup(e):this.table.rightFrozenColCount>0&&this.table.bottomFrozenRowCount>0&&t>=this.table.colCount-this.table.rightFrozenColCount&&e>=this.table.rowCount-this.table.bottomFrozenRowCount?(s=this.rightBottomCornerGroup.getColGroup(t))===null||s===void 0?void 0:s.getRowGroup(e):this.table.rightFrozenColCount>0&&t>this.table.colCount-1-this.table.rightFrozenColCount?(l=this.rightFrozenGroup.getColGroup(t))===null||l===void 0?void 0:l.getRowGroup(e):this.table.bottomFrozenRowCount>0&&e>this.table.rowCount-1-this.table.bottomFrozenRowCount?(a=this.bottomFrozenGroup.getColGroup(t))===null||a===void 0?void 0:a.getRowGroup(e):(h=this.getColGroup(t,e<this.frozenRowCount))===null||h===void 0?void 0:h.getRowGroup(e),d&&d.role==="shadow-cell"&&!n){const u=this.table.getCellRange(t,e);u.start.col===t&&u.start.row===e||(d=this.getCell(u.start.col,u.start.row))}return d||sg}highPerformanceGetCell(t,e,n){return this.proxy.highPerformanceGetCell(t,e,n)}getColGroup(t,e=!1){let n;return n=t<this.frozenColCount&&e?this.cornerHeaderGroup.getColGroup(t):t<this.frozenColCount?this.rowHeaderGroup.getColGroup(t):e&&this.table.rightFrozenColCount>0&&t>this.table.colCount-1-this.table.rightFrozenColCount?this.rightTopCornerGroup.getColGroup(t):!e&&this.table.rightFrozenColCount>0&&t>this.table.colCount-1-this.table.rightFrozenColCount?this.rightFrozenGroup.getColGroup(t):e?this.colHeaderGroup.getColGroup(t):this.bodyGroup.getColGroup(t),n||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 n=this.getCell(t,e),o=ui(this.table,t,e);let r=n.attribute.width,s=n.attribute.height;return o&&(r/=o.end.col-o.start.col+1,s/=o.end.row-o.start.row+1),{width:r,height:s}}updateNextFrame(){this.updateContainerSync(),this.resetAllSelectComponent(),this.stage.renderNextFrame()}resetAllSelectComponent(){var t,e,n,o;(((e=(t=this.table.stateManager.select)===null||t===void 0?void 0:t.ranges)===null||e===void 0?void 0:e.length)>0||((o=(n=this.table.stateManager.select)===null||n===void 0?void 0:n.customSelectRanges)===null||o===void 0?void 0:o.length)>0)&&tA(this)}hideHoverIcon(t,e){LN(t,e,this)}showHoverIcon(t,e){kN(t,e,this)}hideClickIcon(t,e){FN(t,e,this)}showClickIcon(t,e){IN(t,e,this)}getIcon(t,e,n,o){return DN(t,e,n,o,this)}setIconHoverStyle(t,e,n,o){ON(t,e,n,o,this)}updateSortIcon(t){const{col:e,row:n,iconMark:o,order:r,oldSortCol:s,oldSortRow:l,oldIconMark:a}=t;VN({col:e,row:n,iconMark:o,order:r,oldSortCol:s,oldSortRow:l,oldIconMark:a,scene:this})}updateFrozenIcon(t,e){jN(this)}updateHierarchyIcon(t,e){$N(t,e,this)}setIconNormalStyle(t,e,n){zN(t,e,n,this)}residentHoverIcon(t,e){GN(t,e,this)}resetResidentHoverIcon(t,e){UN(t,e,this)}deactivateChart(t,e){var n,o;if(t===-1||e===-1)return;const r=this.getCell(t,e);(o=(n=r==null?void 0:r.firstChild)===null||n===void 0?void 0:n.deactivate)===null||o===void 0||o.call(n)}activateChart(t,e){var n,o;if(t===-1||e===-1)return;const r=this.getCell(t,e);(o=(n=r==null?void 0:r.firstChild)===null||n===void 0?void 0:n.activate)===null||o===void 0||o.call(n,this.table)}removeInteractionBorder(t,e){const n=this.getCell(t,e);n.setAttribute("highlightStroke",void 0),n.setAttribute("highlightStrokeArrayWidth",void 0),n.setAttribute("highlightStrokeArrayColor",void 0)}createCellSelectBorder(t,e,n,o,r,s,l){uN(this,t,e,n,o,r,s,l)}moveSelectingRangeComponentsToSelectedRangeComponents(){oA(this)}deleteLastSelectedRangeComponents(){cN(this)}deleteAllSelectBorder(){rA(this),sA(this)}updateCellSelectBorder(t,e=!0){eA(this,t,e)}removeFillHandleFromSelectComponents(){gN(this)}recreateAllSelectRangeComponents(){rA(this),this.table.stateManager.select.ranges.forEach(t=>{eA(this,t),oA(this)})}updateColWidth(t,e,n,o){bW(this,t,Math.round(e),o),n||this.updateContainer(!0)}updateChartSizeForResizeColWidth(t){TN(this,t)}updateChartSizeForResizeRowHeight(t){MN(this,t)}updateChartState(t){this.table.isPivotChart()&&HN(this,t)}updateCheckboxCellState(t,e,n){var o,r;if(this.table.transpose)(o=this.bodyGroup.children)===null||o===void 0||o.forEach(s=>{var l;(l=s.getChildAt(e))===null||l===void 0||l.getChildren().forEach(a=>{a.name==="checkbox"&&a.setAttribute("checked",n)})});else{const s=this.getColGroup(t);(r=s==null?void 0:s.children)===null||r===void 0||r.forEach(l=>{l.getChildren().find(a=>{a.name==="checkbox"&&a.setAttribute("checked",n)})})}}updateHeaderCheckboxCellState(t,e,n){var o,r;this.table.transpose?(o=this.rowHeaderGroup.children)===null||o===void 0||o.forEach(s=>{s.getChildAt(e).getChildren().forEach(l=>{l.name==="checkbox"&&(n==="indeterminate"?(l.setAttribute("indeterminate",!0),l.setAttribute("checked",void 0)):(l.setAttribute("indeterminate",void 0),l.setAttribute("checked",n)))})}):(r=this.getColGroup(t,!0).children)===null||r===void 0||r.forEach(s=>{s.getChildren().find(l=>{l.name==="checkbox"&&(n==="indeterminate"?(l.setAttribute("indeterminate",!0),l.setAttribute("checked",void 0)):(l.setAttribute("indeterminate",void 0),l.setAttribute("checked",n)))})})}updateAutoColWidth(t){this.table.internalProps._widthResizedColMap.delete(t);const e=this.table.getColWidth(t),n=Fr(t,0,this.table.rowCount-1,this.table,!0);n!==e&&this.updateColWidth(t,n-e)}recalculateColWidths(){const t=this.table;t.widthMode==="adaptive"||t.autoFillWidth||t.internalProps.transpose?Wn(this.table,0,this.table.colCount-1,!0):(t._clearColRangeWidthsMap(),t.frozenColCount>0&&Wn(this.table,0,t.frozenColCount-1,!0),t.rightFrozenColCount>0&&Wn(this.table,t.rightFrozenColCount,t.colCount-1,!0),Wn(t,this.proxy.colStart,this.proxy.colEnd,!0))}recalculateRowHeights(){const t=this.table;t.internalProps.useOneRowHeightFillAll=!1,t.heightMode==="adaptive"||t.autoFillHeight?zn(this.table,0,this.table.rowCount-1,!0,!0):(t.frozenRowCount>0&&zn(this.table,0,t.frozenRowCount-1,!0,!0),t.bottomFrozenRowCount>0&&zn(this.table,t.bottomFrozenRowCount,t.rowCount-1,!0,!0),zn(t,this.proxy.rowStart,this.proxy.rowEnd,!0,!0))}resize(){this.proxy.resize(),(this.table.widthMode==="adaptive"||this.table.autoFillWidth)&&(this.table.internalProps._widthResizedColMap.size===0?this.recalculateColWidths():this.dealWidthMode()),this.table.heightMode==="adaptive"?this.table.internalProps._heightResizedRowMap.size===0?this.recalculateRowHeights():this.dealHeightMode():this.table.autoFillHeight&&this.dealHeightMode(),this.resetFrozen(),this.updateTableSize(),this.updateBorderSizeAndPosition(),this.component.updateScrollBar(),(this.table.widthMode==="adaptive"||this.table.heightMode==="adaptive"||this.table.autoFillWidth||this.table.autoFillHeight)&&this.updateChartSizeForResizeColWidth(-1),this.proxy.progress(),this.updateNextFrame()}updateTableSize(){var t,e,n,o,r,s,l,a,h,d,u,c,g;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 f=(t=this.tableGroup.border)===null||t===void 0?void 0:t.attribute;let p,m,b,C;f!=null&&f.strokeArrayWidth?(p=f.strokeArrayWidth?f.strokeArrayWidth[0]:(e=f.lineWidth)!==null&&e!==void 0?e:0,m=f.strokeArrayWidth?f.strokeArrayWidth[1]:(n=f.lineWidth)!==null&&n!==void 0?n:0,b=f.strokeArrayWidth?f.strokeArrayWidth[2]:(o=f.lineWidth)!==null&&o!==void 0?o:0,C=f.strokeArrayWidth?f.strokeArrayWidth[3]:(r=f.lineWidth)!==null&&r!==void 0?r:0):(p=(s=f==null?void 0:f.lineWidth)!==null&&s!==void 0?s:0,m=(l=f==null?void 0:f.lineWidth)!==null&&l!==void 0?l:0,b=(a=f==null?void 0:f.lineWidth)!==null&&a!==void 0?a:0,C=(h=f==null?void 0:f.lineWidth)!==null&&h!==void 0?h:0),this.tableGroup.border.type==="rect"?!((d=this.table.theme.frameStyle)===null||d===void 0)&&d.innerBorder?this.tableGroup.border.setAttributes({x:this.table.tableX+C/2,y:this.table.tableY+p/2,width:this.tableGroup.attribute.width-C/2-m/2,height:this.tableGroup.attribute.height-p/2-b/2}):this.tableGroup.border.setAttributes({x:this.table.tableX-C/2,y:this.table.tableY-p/2,width:this.tableGroup.attribute.width+C/2+m/2,height:this.tableGroup.attribute.height+p/2+b/2}):this.tableGroup.border.type==="group"&&(!((u=this.table.theme.frameStyle)===null||u===void 0)&&u.innerBorder?(this.tableGroup.border.setAttributes({x:this.table.tableX+C/2,y:this.table.tableY+p/2,width:this.tableGroup.attribute.width-C/2-m/2,height:this.tableGroup.attribute.height-p/2-b/2}),(c=this.tableGroup.border.firstChild)===null||c===void 0||c.setAttributes({x:0,y:0,width:this.tableGroup.attribute.width-C/2-m/2,height:this.tableGroup.attribute.height-p/2-b/2})):(this.tableGroup.border.setAttributes({x:this.table.tableX-C/2,y:this.table.tableY-p/2,width:this.tableGroup.attribute.width+C/2+m/2,height:this.tableGroup.attribute.height+p/2+b/2}),(g=this.tableGroup.border.firstChild)===null||g===void 0||g.setAttributes({x:C/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,n){e=Math.round(e),SR(this,t,e,n),this.updateContainerHeight(t,e)}updateRowsHeight(t,e,n){for(let o=0;o<t.length;o++){const r=t[o];if(r>=this.proxy.rowStart&&r<=this.proxy.rowEnd){const s=e[o];SR(this,r,Math.round(s),n),this._updateContainerHeight(r,s)}}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 n=this.table.getColWidth(t);n!==e&&(this.updateColWidth(t,e-n),this.table._clearColRangeWidthsMap(t))}setRowHeight(t,e){const n=this.table.getRowHeight(t);n!==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-n),this.table._clearRowRangeHeightsMap(t))}setX(t,e=!1){this.table.scenegraph.proxy.setX(-t,e)}setY(t,e=!1){this.table.scenegraph.proxy.setY(-t,e)}setBodyAndRowHeaderY(t){var e,n;const o=(e=this.bodyGroup.firstChild)===null||e===void 0?void 0:e.firstChild,r=(n=this.bodyGroup.firstChild)===null||n===void 0?void 0:n.lastChild;t===0&&o&&o.row===this.table.frozenRowCount&&o.attribute.y+t<0?t=-o.attribute.y:r&&this.table.tableNoFrameHeight<this.table.getAllRowsHeight()&&r.row===this.table.rowCount-this.table.bottomFrozenRowCount-1&&r.attribute.y+r.attribute.height+t<this.table.tableNoFrameHeight-this.table.getFrozenRowsHeight()-this.table.getBottomFrozenRowsHeight()&&(t=this.table.tableNoFrameHeight-this.table.getFrozenRowsHeight()-this.table.getBottomFrozenRowsHeight()-r.attribute.y-r.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,n=this.bodyGroup.lastChild;t===0&&e&&e.col===this.table.frozenColCount&&e.attribute.x+t<0?t=-e.attribute.x:n&&this.table.tableNoFrameWidth<this.table.getAllColsWidth()&&n.col===this.table.colCount-this.table.rightFrozenColCount-1&&n.attribute.x+n.attribute.width+t<this.table.tableNoFrameWidth-this.table.getFrozenColsWidth()-this.table.getRightFrozenColsWidth()&&(t=this.table.tableNoFrameWidth-this.table.getFrozenColsWidth()-this.table.getRightFrozenColsWidth()-n.attribute.x-n.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(),Ah(this.table),this.table.options.animationAppear&&ZN(this.table),this.updateNextFrame()}dealWidthMode(){const t=this.table;if(t.widthMode==="adaptive"){t._clearColRangeWidthsMap();const s=t.tableNoFrameWidth;let l=0;for(let d=0;d<t.colCount;d++)(d<t.rowHeaderLevelCount||t.isPivotChart()&&d>=t.colCount-t.rightFrozenColCount)&&(l+=t.getColWidth(d));const a=t.rowHeaderLevelCount,h=t.isPivotChart()?t.colCount-t.rightFrozenColCount:t.colCount;rg(s-l,a,h,!1,[],t,!0)}else if(t.autoFillWidth){t._clearColRangeWidthsMap();const s=t.tableNoFrameWidth;let l=0,a=0;for(let h=0;h<t.colCount;h++){const d=t.getColWidth(h);(h<t.rowHeaderLevelCount||t.isPivotChart()&&h>=t.colCount-t.rightFrozenColCount)&&(l+=d),a+=d}if(a<s&&a>l){const h=t.rowHeaderLevelCount,d=t.isPivotChart()?t.colCount-t.rightFrozenColCount:t.colCount;rg(s-l,h,d,!1,[],t,!0)}}let e=0;this.bodyGroup.forEachChildrenSkipChild(s=>{e+=s.attribute.width}),this.bodyGroup.setAttribute("width",e);let n=0;this.colHeaderGroup.forEachChildrenSkipChild(s=>{n+=s.attribute.width}),this.colHeaderGroup.setAttribute("width",n);let o=0;this.rowHeaderGroup.forEachChildrenSkipChild(s=>{o+=s.attribute.width}),this.rowHeaderGroup.setAttribute("width",o);let r=0;this.cornerHeaderGroup.forEachChildrenSkipChild(s=>{r+=s.attribute.width}),this.cornerHeaderGroup.setAttribute("width",r),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(e.heightMode==="adaptive"){e._clearRowRangeHeightsMap();const n=e.getRowsHeight(0,e.columnHeaderLevelCount-1),o=e.isPivotChart()?e.getBottomFrozenRowsHeight():0,r=e.tableNoFrameHeight-n-o,s=e.columnHeaderLevelCount,l=e.isPivotChart()?e.rowCount-e.bottomFrozenRowCount:e.rowCount;let a=0;for(let d=s;d<l;d++)a+=e.getRowHeight(d);const h=r/a;for(let d=s;d<l;d++){let u;u=d===l-1?r-e.getRowsHeight(s,l-2):Math.round(e.getRowHeight(d)*h),this.setRowHeight(d,u)}}else if(e.autoFillHeight){e._clearRowRangeHeightsMap();const n=e.tableNoFrameHeight;let o=0,r=0;for(let s=0;s<e.rowCount;s++){const l=e.getRowHeight(s);(s<e.columnHeaderLevelCount||e.isPivotChart()&&s>=e.rowCount-e.bottomFrozenRowCount)&&(r+=l),o+=l}if(((t=this._dealAutoFillHeightOriginRowsHeight)!==null&&t!==void 0?t:o)<n&&o-r>0){const s=e.columnHeaderLevelCount,l=e.isPivotChart()?e.rowCount-e.bottomFrozenRowCount:e.rowCount,a=(n-r)/(o-r);for(let h=s;h<l;h++){let d;d=h===l-1?n-r-e.getRowsHeight(s,l-2):Math.round(e.getRowHeight(h)*a),this.setRowHeight(h,d)}}}}dealFrozen(){SN(this)}resetFrozen(){xN(this)}updateCellLayoutWidthCertainWidth(t,e,n){const o=t.attribute.width;let r=!1;return t.forEachChildren((s,l)=>{l+=e;const a=ui(this.table,n,l);a?s=this.getCell(a.start.col,a.start.row):s.setAttribute("width",o);const h=this.table._getCellStyle(n,l),d=Qt(wt("padding",h,n,l,this.table)),u=s.getChildByName("text");let c=0,g=0;if(u)c=u.AABBBounds.height()+(d[0]+d[2]),u.setAttribute("maxLineWidth",o-(d[1]+d[3])),g=u.AABBBounds.height()+(d[0]+d[2]);else{const p=s.getChildAt(1);c=p.AABBBounds.height()+(d[0]+d[2]),p._cellWidth=o-(d[1]+d[3]),p.layout(),g=p.AABBBounds.height()+(d[0]+d[2])}const f=this.table.getRowHeight(l);s.attribute.height!==g&&(s.setAttribute("height",g),(f===c||g>f)&&(r=!0))}),r}updateHeaderPosition(t,e,n,o,r){dN(t,e,n,o,r,this.table)}updateContainerAttrWidthAndX(){var t,e,n;const o=or(this.cornerHeaderGroup,0),r=or(this.rowHeaderGroup,0),s=this.colHeaderGroup.hasChildNodes()&&this.colHeaderGroup.firstChild?or(this.colHeaderGroup,this.colHeaderGroup.firstChild.col>0?this.table.getColsWidth((t=this.table.frozenColCount)!==null&&t!==void 0?t:0,this.colHeaderGroup.firstChild.col-1):0):0,l=this.bodyGroup.hasChildNodes()&&this.bodyGroup.firstChild?or(this.bodyGroup,this.bodyGroup.firstChild.col>0?this.table.getColsWidth((e=this.table.frozenColCount)!==null&&e!==void 0?e:0,this.bodyGroup.firstChild.col-1):0):0,a=or(this.rightFrozenGroup.childrenCount>0?this.rightFrozenGroup:this.rightTopCornerGroup,0);this.bottomFrozenGroup.hasChildNodes()&&this.bottomFrozenGroup.firstChild&&or(this.bottomFrozenGroup,this.bottomFrozenGroup.firstChild.col>0?this.table.getColsWidth((n=this.table.frozenColCount)!==null&&n!==void 0?n:0,this.bottomFrozenGroup.firstChild.col-1):0),or(this.leftBottomCornerGroup,0),or(this.rightTopCornerGroup,0),or(this.rightBottomCornerGroup,0),this.cornerHeaderGroup.setDeltaWidth(o-this.cornerHeaderGroup.attribute.width),this.leftBottomCornerGroup.setDeltaWidth(o-this.leftBottomCornerGroup.attribute.width),this.colHeaderGroup.setDeltaWidth(s-this.colHeaderGroup.attribute.width),this.rowHeaderGroup.setDeltaWidth(r-this.rowHeaderGroup.attribute.width),this.bottomFrozenGroup.setDeltaWidth(s-this.bottomFrozenGroup.attribute.width),this.rightFrozenGroup.setDeltaWidth(a-this.rightFrozenGroup.attribute.width),this.rightTopCornerGroup.setDeltaWidth(a-this.rightTopCornerGroup.attribute.width),this.rightBottomCornerGroup.setDeltaWidth(a-this.rightBottomCornerGroup.attribute.width),this.bodyGroup.setDeltaWidth(l-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(t=!1){t?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 n;const o=!((n=this.table.getCellRawRecord(t,e))===null||n===void 0)&&n.vtableMerge?"text":this.table.isHeader(t,e)?this.table._getHeaderLayoutMap(t,e).headerType:this.table.getBodyColumnType(t,e),r=this.getCell(t,e);o!=="image"&&o!=="video"||mh(r,t,e,0,0,this.table)}createFrameBorder(){this.updateTableSize();const t=!this.isPivot&&!this.table.internalProps.transpose;xl(this.bodyGroup,this.table.theme.bodyStyle.frameStyle,this.bodyGroup.role,t?[!0,!0,!0,!1]:void 0),xl(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),xl(this.colHeaderGroup,this.table.theme.headerStyle.frameStyle,this.colHeaderGroup.role,t?[!0,!0,!0,!1]:void 0),xl(this.cornerHeaderGroup,this.isPivot?this.table.theme.cornerHeaderStyle.frameStyle:this.table.theme.headerStyle.frameStyle,this.cornerHeaderGroup.role,t?[!0,!1,!0,!0]:void 0),xl(this.tableGroup,this.table.theme.frameStyle,this.tableGroup.role,void 0)}getResizeColAt(t,e,n,o=Ax/2){let r;if(!n){const s=this.table.getDrawRange();return e>=s.top&&e<=s.bottom&&(r=this.table.getCellAtRelativePosition(t-o,e),r.col===this.table.colCount-1)?r:{col:-1,row:-1}}return n.stage?(t<n.globalAABBBounds.x1+o?r={col:n.col-1,row:n.row,x:n.globalAABBBounds.x1}:n.globalAABBBounds.x2-o<t&&(r={col:n.col,row:n.row,x:n.globalAABBBounds.x2}),r&&this.table.rightFrozenColCount>0&&r.col>=this.table.colCount-this.table.rightFrozenColCount-1&&this.table.tableNoFrameWidth-this.table.getFrozenColsWidth()-this.table.getRightFrozenColsWidth()+this.table.scrollLeft<this.bodyGroup.attribute.width&&(r.col=r.col+1,r.rightFrozen=!0),r||{col:-1,row:-1}):{col:-1,row:-1}}getResizeRowAt(t,e,n,o=I4/2){if(n){let r;if(e<n.globalAABBBounds.y1+o?r={col:n.col,row:n.row-1,y:n.globalAABBBounds.y1}:n.globalAABBBounds.y2-o<e&&(r={col:n.col,row:n.row,y:n.globalAABBBounds.y2}),r&&this.table.bottomFrozenRowCount>0&&r.row>=this.table.rowCount-this.table.bottomFrozenRowCount-1&&this.table.tableNoFrameHeight-this.table.getFrozenRowsHeight()-this.table.getBottomFrozenRowsHeight()+this.table.scrollTop<this.bodyGroup.attribute.height&&(r.row=r.row+1,r.bottomFrozen=!0),r)return r}return{col:-1,row:-1}}updateFrozen(){this.clear||(this.resetFrozen(),this.component.updateScrollBar())}dealWidthRightFrozen(t){this.clear?this.table.internalProps.rightFrozenColCount=t:RN(t,this)}dealWidthBottomFrozen(t){this.clear?this.table.internalProps.bottomFrozenRowCount=t:AN(t,this)}updateBorderSizeAndPosition(){this.bodyGroup.border&&(this.bodyGroup.appendChild(this.bodyGroup.border),Nc(this.bodyGroup),this.rowHeaderGroup.attribute.width,BR(this.bodyGroup,this.table.theme.bodyStyle.frameStyle)),this.colHeaderGroup.border&&(this.colHeaderGroup.appendChild(this.colHeaderGroup.border),Nc(this.colHeaderGroup),this.cornerHeaderGroup.attribute.width,BR(this.colHeaderGroup,this.table.theme.headerStyle.frameStyle)),this.rowHeaderGroup.border&&(this.rowHeaderGroup.appendChild(this.rowHeaderGroup.border),Nc(this.rowHeaderGroup)),this.cornerHeaderGroup.border&&(this.cornerHeaderGroup.appendChild(this.cornerHeaderGroup.border),Nc(this.cornerHeaderGroup)),xW(this.table)}sortCell(){this.isPivot||(this.table.transpose?this.proxy.sortCellHorizontal():this.proxy.sortCellVertical())}getCellOverflowText(t,e){var n,o;const r=this.getCell(t,e).getChildByName("text",!0);if(r&&r.type==="text"){if(r.attribute.moreThanMaxCharacters)return this.table.getCellValue(t,e);const s=lt(r.attribute.text)?r.attribute.text.join(""):r.attribute.text;let l="";if(ce(r.cache.clipedText)?l=r.cache.clipedText:(o=(n=r.cache.layoutData)===null||n===void 0?void 0:n.lines)===null||o===void 0||o.forEach(a=>{l+=a.str}),l!==s)return this.table.getCellValue(t,e)}else if(r&&r.type==="richtext"){const s=r;if(s.attribute.ellipsis&&s._frameCache&&s.attribute.height<s._frameCache.actualHeight)return s.attribute.textConfig.find(l=>l.text),this.table.getCellValue(t,e)}return null}updateDrill(t,e,n,o,r){this.component.drillIcon.update(t,e,n,o,r,this)}updateCellContent(t,e){if(!this.clear)return _o(t,e,this.table)}setPixelRatio(t){this.stage.disableDirtyBounds(),this.stage.window.setDpr(t),this.stage.render(),this.stage.enableDirtyBounds()}updateRow(t,e,n=[],o=!0){this.table.internalProps.layoutMap.clearCellRangeMap(),this.table.internalProps.useOneRowHeightFillAll=!1;const r=ih(e.map(a=>a.row)).sort((a,h)=>a-h),s=ih(n.map(a=>a.row)).sort((a,h)=>a-h),l=this.table.getAllRowsHeight()-[...r,...s].reduce((a,h)=>a+this.table.getRowHeight(h),0)<=this.table.tableNoFrameHeight;if(fN(t,e,n,this.table),o&&this.recalculateColWidths(),this.table.heightMode==="adaptive"||this.table.autoFillHeight&&(this.table.getAllRowsHeight()<=this.table.tableNoFrameHeight||l))this.table.scenegraph.recalculateRowHeights();else if(this.table.heightMode==="autoHeight")for(let a=0;a<s.length;a++){const h=s[a],d=this.table.getRowHeight(h),u=nn(h,0,this.table.colCount-1,this.table);(h>=this.proxy.rowStart&&h<=this.proxy.rowEnd||h>=this.table.rowCount-this.table.bottomFrozenRowCount&&h<=this.table.rowCount-1)&&this.table.scenegraph.updateRowHeight(h,u-d)}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,n=[]){KN(t,e,n,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(){_N(this.table)}setLoadingHierarchyState(t,e){const n=this.getCell(t,e).getChildByName("collapse",!0);if(n){const o=vn()[Wi.loadingIconName];On(o,n,t,e)}}temporarilyUpdateSelectRectStyle(t){JN(t,this)}resetSelectRectStyle(){this.recreateAllSelectRangeComponents()}}function t5(i,t,e){for(let n=0;n<e.length;n++){const o=e[n];if(Yi(o,i,t))return!0}return!1}function e5(i,t,e,n){for(let o=0;o<e.length;o++){const r=e[o];if(p4(r,{start:i,end:t}))return!0}return!1}function Ml(i,t,e){const n=i.highPerformanceGetCell(t,e);if(n.role==="cell"&&z(n.mergeStartCol)&&z(n.mergeStartRow)&&z(n.mergeEndCol)&&z(n.mergeEndRow)){const{colStart:o,colEnd:r,rowStart:s,rowEnd:l}=kr(n,i);for(let a=o;a<=r;a++)for(let h=s;h<=l;h++)i.highPerformanceGetCell(a,h).addUpdateBoundTag()}else n.addUpdateBoundTag()}function bA(i,t,e,n,o){const r=i.table;for(let l=0;l<r.columnHeaderLevelCount;l++)Ml(i,t,l);const s=i.getColGroup(t);return s==null||s.addUpdateBoundTag(),!0}function CA(i,t,e,n,o,r){const s=i.table;for(let a=0;a<s.columnHeaderLevelCount;a++)Ml(i,t,a);const l=i.getColGroup(t);return l==null||l.addUpdateBoundTag(),!0}function yA(i,t,e,n,o){const r=i.table;for(let s=0;s<r.colCount;s++)Ml(i,s,e);return!0}function _A(i,t,e,n,o,r){const s=i.table;for(let l=0;l<s.colCount;l++)Ml(i,l,e);return!0}function i5(i,t,e,n,o){return Ml(i,t,e),!0}function n5(i,t,e,n,o){return Ml(i,t,e),!0}function o5(i,t,e){const{table:n}=i,{scenegraph:o}=n,{highlightScope:r,singleStyle:s,disableHeader:l,cellPos:a,cellPosContainHeader:h}=i.hover,d=a.col,u=a.row;if(r===he.none||l&&(h.col!==t||h.row!==e)){const p=h.col,m=h.row;o.hideHoverIcon(p,m),o.showHoverIcon(t,e),h.col=t,h.row=e}if((l&&n.isHeader(t,e)||r===he.none)&&(t=-1,e=-1),d===t&&u===e)return;o.deactivateChart(d,u),o.activateChart(t,e);let c=!1;const{ranges:g,highlightScope:f}=i.select;if(d!==-1&&u!==-1&&(c=r5(o,d,u,g,s,r),l||o.hideHoverIcon(d,u)),t===-1||e===-1)return a.col=-1,a.row=-1,void(!c||d===t&&u===e||i.table.scenegraph.updateNextFrame());r===he.single?c=!!n5(o,t,e):r===he.row?c=!!_A(o,t,e):r===he.column?c=!!CA(o,t):r===he.cross&&(c=!!_A(o,t,e),c=!!CA(o,t)),r===he.none||l||o.showHoverIcon(t,e),a.col=t,a.row=e,c&&i.table.scenegraph.updateNextFrame()}function r5(i,t,e,n,o,r,s){let l=!1;return r===he.single?l=!!i5(i,t,e):r===he.row?l=!!yA(i,t,e):r===he.column?l=!!bA(i,t):r===he.cross&&(l=!!yA(i,t,e),l=!!bA(i,t)),l}function s5(i,t,e){e.frozenColCount>0?i!==e.frozenColCount-1?e.setFrozenColCount(i+1):e.setFrozenColCount(0):e.setFrozenColCount(i+1)}function l5(i,t,e,n){var o;let r,s=null,l=!1;if(Array.isArray(e.sortState))for(let c=0;c<e.sortState.length&&(r=e.sortState[c],r&&(s=e._getHeaderCellBySortState(r)),s&&(l=wA(i,t,s.col,s.row,e)),!l);c++);else r=e.sortState,r&&(s=e._getHeaderCellBySortState(r)),s&&(l=wA(i,t,s.col,s.row,e));const a=e.getHeaderDefine(i,t);if(r&&l&&(a!=null&&a.sort)?r.order=r.order==="asc"?"desc":r.order==="desc"?"normal":"asc":a!=null&&a.sort?r={field:e.getHeaderField(i,t),order:"asc"}:l&&(a!=null&&a.showSort)||(r={field:e.getHeaderField(i,t),order:"normal"}),r.event=n,e.fireListeners(at.SORT_CLICK,r).includes(!1))return;let h=!1,d=e.internalProps.sortState?Array.isArray(e.internalProps.sortState)&&(h=!0)?e.internalProps.sortState:[e.internalProps.sortState]:[];if(Array.isArray(d)){const c=d.findIndex(g=>g.field===r.field);c>=0?d[c]=r:d.push(r)}d=d.filter(c=>c.order!=="normal"),d=e.internalProps.multipleSort&&(h=!0)?d:d.splice(-1),d=h&&d.length?d:d[0],e.internalProps.sortState=d,e.stateManager.setSortState(d),a!=null&&a.sort&&a5(d,e),e.internalProps.useOneRowHeightFillAll=!1,e.internalProps.layoutMap.clearCellRangeMap(),e.scenegraph.sortCell();const u=!!(!((o=e.stateManager.select.ranges)===null||o===void 0)&&o.length);e.stateManager.updateSelectPos(-1,-1),e.stateManager.endSelectCells(!0,u)}function a5(i,t,e){i=Array.isArray(i)||!i?i:[i],t.dataSource.sort((i||[]).map(n=>{var o,r;const s=t.internalProps.layoutMap.headerObjects.find(l=>l&&l.field===n.field);return{field:n.field,order:n.order||"asc",orderFn:typeof((o=s==null?void 0:s.define)===null||o===void 0?void 0:o.sort)=="function"?(r=s==null?void 0:s.define)===null||r===void 0?void 0:r.sort:sm}}))}function wA(i,t,e,n,o){return o._getLayoutCellId(i,t)===o._getLayoutCellId(e,n)}function h5(i,t,e,n,o,r,s=!1,l=!1,a=!1){var h,d;const{table:u,interactionState:c}=i,{scenegraph:g}=u,{highlightScope:f,disableHeader:p,cellPos:m}=i.select;if((p&&u.isHeader(t,e)||f==="none")&&a===!1&&(t===-1||e===-1||s||u._makeVisibleCell(t,e),t=-1,e=-1),t!==-1&&e!==-1&&!s)if(c===$t.grabing&&i.select.ranges.length>0){const b=i.select.ranges[i.select.ranges.length-1];t>b.start.col&&t>b.end.col&&u._makeVisibleCell(t+1,e),e>b.start.row&&e>b.end.row&&u._makeVisibleCell(t,e+1),t<b.start.col&&t<b.end.col&&u._makeVisibleCell(t-1,e),e<b.start.row&&e<b.end.row&&u._makeVisibleCell(t,e-1)}else u._makeVisibleCell(t,e);if(r){i.select.ranges=[],g.deleteAllSelectBorder();let b=0,C=0;const{disableHeaderSelect:_,disableRowSeriesNumberSelect:w}=((h=u.options.keyboardOptions)===null||h===void 0?void 0:h.selectAllOnCtrlA)||{};_&&(b=u.rowHeaderLevelCount,C=u.columnHeaderLevelCount),(w||_&&u.transpose)&&u.options.rowSeriesNumber&&(b+=1),i.select.ranges.push({start:{col:b,row:C},end:{col:u.colCount-1,row:u.rowCount-1}});const y=i.select.ranges[i.select.ranges.length-1];g.updateCellSelectBorder(y,!1)}else if(m.col===-1||m.row===-1||t!==-1&&e!==-1)if(c!==$t.default||u.eventManager.isDraging||u.stateManager.isResizeCol()){if((c===$t.grabing||u.eventManager.isDraging)&&!u.stateManager.isResizeCol()){let b=!0;m.col===-1&&(m.col=t),m.row===-1&&(m.row=e),m.col=t,m.row=e;const C=i.select.ranges[i.select.ranges.length-1];if(C){if(u.internalProps.layoutMap.isSeriesNumberInBody(C.start.col,C.start.row))b=!1,C.end={col:u.colCount-1,row:e};else if(i.fillHandle.isFilling){if(i.fillHandle.direction==="top")if(e===i.fillHandle.beforeFillMinRow&&e===i.fillHandle.beforeFillMaxRow)C.start.row=C.end.row=e;else if(e<=i.fillHandle.beforeFillMinRow){if(C.start.row<C.end.row){const _=C.start.row;C.start.row=C.end.row,C.end.row=_}C.end.row=e}else e===i.fillHandle.beforeFillMaxRow&&(C.start.row>C.end.row?C.start.row=e:C.end.row=e);else if(i.fillHandle.direction==="bottom"){if(e>=i.fillHandle.beforeFillMaxRow){if(C.start.row>C.end.row){const _=C.start.row;C.start.row=C.end.row,C.end.row=_}C.end.row=e}}else if(i.fillHandle.direction==="left")if(t===i.fillHandle.beforeFillMinCol&&t===i.fillHandle.beforeFillMaxCol)C.start.col=C.end.col=t;else if(t<=i.fillHandle.beforeFillMinCol){if(C.start.col<C.end.col){const _=C.start.col;C.start.col=C.end.col,C.end.col=_}C.end.col=t}else t===i.fillHandle.beforeFillMaxCol&&(C.start.col>C.end.col?C.start.col=t:C.end.col=t);else if(i.fillHandle.direction==="right"&&t>=i.fillHandle.beforeFillMaxCol){if(C.start.col>C.end.col){const _=C.start.col;C.start.col=C.end.col,C.end.col=_}C.end.col=t}}else{C.end={col:t,row:e};const _=l?{start:{col:t,row:e},end:{col:t,row:e}}:u.getCellRange(t,e);C.start.col<_.end.col?C.end.col=_.end.col:C.start.col>_.start.col&&(C.end.col=_.start.col),C.start.row<_.end.row?C.end.row=_.end.row:C.start.row>_.start.row&&(C.end.row=_.start.row),i.select.headerSelectMode==="body"&&(u.isRowHeader(t,e)?(C.start.col=u.rowHeaderLevelCount+u.leftRowSeriesNumberCount,C.end.col=u.colCount-1):u.isColumnHeader(t,e)?(C.start.row=u.columnHeaderLevelCount,C.end.row=u.rowCount-1):u.internalProps.layoutMap.isSeriesNumberInBody(t,e)?(C.start.col=u.leftRowSeriesNumberCount,C.end.col=u.colCount-1):u.isCornerHeader(t,e)?(C.start.col=u.rowHeaderLevelCount+u.leftRowSeriesNumberCount,C.start.row=u.columnHeaderLevelCount,C.end.col=u.colCount-1,C.end.row=u.rowCount-1):u.isSeriesNumber(t,e)&&(C.start.col=u.leftRowSeriesNumberCount,C.start.row=u.columnHeaderLevelCount,C.end.col=u.colCount-1,C.end.row=u.rowCount-1)),l&&(C.skipBodyMerge=!0)}g.updateCellSelectBorder(C,b)}}}else{const b=i.select.ranges[i.select.ranges.length-1];if(n&&b){if(o||(m.col=t,m.row=e),i.select.headerSelectMode!=="cell"&&u.isColumnHeader(t,e)){const C=Math.min(b.start.col,b.end.col,t),_=Math.max(b.start.col,b.end.col,t),w=Math.min(b.start.row,b.end.row,e),y=u.rowCount-1;i.select.headerSelectMode==="body"?(b.start={col:C,row:u.columnHeaderLevelCount},b.end={col:_,row:u.rowCount-1}):(b.start={col:C,row:w},b.end={col:_,row:y})}else if(i.select.headerSelectMode!=="cell"&&u.isRowHeader(t,e)){const C=Math.min(b.start.col,b.end.col,t),_=u.colCount-1,w=Math.min(b.start.row,b.end.row,e),y=Math.max(b.start.row,b.end.row,e);i.select.headerSelectMode==="body"?(b.start={col:u.leftRowSeriesNumberCount+u.rowHeaderLevelCount,row:w},b.end={col:u.colCount-1,row:y}):(b.start={col:C,row:w},b.end={col:_,row:y})}else if(i.select.headerSelectMode!=="cell"&&u.isSeriesNumberInBody(t,e)){const C=Math.min(b.start.col,b.end.col,t),_=u.colCount-1,w=Math.min(b.start.row,b.end.row,e),y=Math.max(b.start.row,b.end.row,e);i.select.headerSelectMode==="body"?(b.start={col:u.leftRowSeriesNumberCount,row:w},b.end={col:u.colCount-1,row:y}):(b.start={col:C,row:w},b.end={col:_,row:y})}else b.end={col:t,row:e};g.deleteLastSelectedRangeComponents(),g.updateCellSelectBorder(b)}else{let C=!0;if(m.col===-1||m.row===-1||o||(i.select.ranges=[],g.deleteAllSelectBorder()),i.select.headerSelectMode!=="cell"&&u.isColumnHeader(t,e)){const w=u.getCellRange(t,e);i.select.headerSelectMode==="body"?i.select.ranges.push({start:{col:w.start.col,row:u.columnHeaderLevelCount},end:{col:w.end.col,row:u.rowCount-1},skipBodyMerge:!0}):i.select.ranges.push({start:{col:w.start.col,row:e},end:{col:w.end.col,row:u.rowCount-1},skipBodyMerge:!0})}else if(i.select.headerSelectMode!=="cell"&&u.isRowHeader(t,e)){const w=u.getCellRange(t,e);i.select.headerSelectMode==="body"?i.select.ranges.push({start:{col:u.rowHeaderLevelCount+u.leftRowSeriesNumberCount,row:w.start.row},end:{col:u.colCount-1,row:w.end.row},skipBodyMerge:!0}):i.select.ranges.push({start:{col:t,row:w.start.row},end:{col:u.colCount-1,row:w.end.row},skipBodyMerge:!0})}else if(u.internalProps.layoutMap.isSeriesNumberInHeader(t,e))C=!1,i.select.headerSelectMode==="body"?i.select.ranges.push({start:{col:u.leftRowSeriesNumberCount,row:u.columnHeaderLevelCount},end:{col:u.colCount-1,row:u.rowCount-1},skipBodyMerge:!0}):i.select.ranges.push({start:{col:0,row:0},end:{col:u.colCount-1,row:u.rowCount-1},skipBodyMerge:!0});else if(u.internalProps.layoutMap.isSeriesNumberInBody(t,e))C=!1,i.select.headerSelectMode==="body"?i.select.ranges.push({start:{col:u.leftRowSeriesNumberCount,row:e},end:{col:u.colCount-1,row:e},skipBodyMerge:!0}):i.select.ranges.push({start:{col:t,row:e},end:{col:u.colCount-1,row:e},skipBodyMerge:!0});else if(u.internalProps.layoutMap.isCornerHeader(t,e))C=!1,i.select.headerSelectMode==="body"?i.select.ranges.push({start:{col:u.rowHeaderLevelCount+u.leftRowSeriesNumberCount,row:u.columnHeaderLevelCount},end:{col:u.colCount-1,row:u.rowCount-1},skipBodyMerge:!0}):i.select.ranges.push({start:{col:u.leftRowSeriesNumberCount,row:0},end:{col:u.colCount-1,row:u.rowCount-1},skipBodyMerge:!0});else if(t>=0&&e>=0){const w=l?{start:{col:t,row:e},end:{col:t,row:e}}:u.getCellRange(t,e);i.select.ranges.push({start:{col:w.start.col,row:w.start.row},end:{col:w.end.col,row:w.end.row},skipBodyMerge:l||void 0})}m.col=t,m.row=e;const _=(d=i.select.ranges)===null||d===void 0?void 0:d[i.select.ranges.length-1];_&&g.updateCellSelectBorder(_,C)}}else m.col=-1,m.row=-1,i.select.ranges=[],g.deleteAllSelectBorder();g.updateNextFrame()}function d5(i){i.moveSelectingRangeComponentsToSelectedRangeComponents()}const rr=nh(at,{PIVOT_SORT_CLICK:"pivot_sort_click",DRILLMENU_CLICK:"drillmenu_click"}),SA=nh(at,{VCHART_EVENT_TYPE:"vchart_event_type"});function u5(i,t,e,n,o){const r=o.getCellLocation(i,t);let s=0,l=0,a=!1;r==="columnHeader"?(s=o.getColsWidth(0,o.rowHeaderLevelCount-1)-(o.frozenColCount===0?o.scrollLeft:0),l=o.getRowsHeight(0,t-1)+o.getRowHeight(t)/2,a=!0):r==="rowHeader"&&(l=o.getRowsHeight(0,o.columnHeaderLevelCount-1),s=o.getColsWidth(0,i-1)+o.getColWidth(i)/2,a=!0),o.scenegraph.updateDrill(a,s,l,e,n)}function c5(i,t,e){const n=e.scenegraph.getCell(i,t).getChildByName("sparkline"),o=n==null?void 0:n.getChildByName("highlight-line"),r=n==null?void 0:n.getChildByName("highlight-symbol");o&&o.setAttributes({visible:!1,pickable:!1}),r&&r.setAttributes({visible:!1,pickable:!1}),e.scenegraph.updateNextFrame()}function g5(i,t,e,n,o){var r,s;const l=o.scenegraph.getCell(i,t).getChildByName("sparkline"),a=l==null?void 0:l.getChildByName("sparkline-line"),h=l==null?void 0:l.getChildByName("sparkline-symbol-group");if(!a)return!1;const d=a.bandwidth,u=a.min,c=a.max,g=a.attribute.points;let f;e-=l.globalAABBBounds.x1,l.globalAABBBounds.y1;for(let p=0;p<g.length;p++){const{x:m,y:b,defined:C,rawData:_}=g[p];if(Math.abs(e-m)<d/2&&(f={point:g[p],points:g,pointsBandWidth:d,pointData:_},C)){const w=l.getChildByName("highlight-line");if(w)w.setAttributes({points:[{x:m,y:c},{x:m,y:u}],visible:!0,pickable:!0});else{const S=fn({points:[{x:m,y:c},{x:m,y:u}],lineWidth:(r=a.hover)===null||r===void 0?void 0:r.strokeWidth,stroke:(s=a.hover)===null||s===void 0?void 0:s.stroke});S.name="highlight-line",l.addChild(S)}const y=l.getChildByName("highlight-symbol");if(y)y.setAttributes({x:m,y:b,visible:!0,pickable:!0});else{const S=Ea({x:m,y:b,stroke:h.hover.stroke,lineWidth:h.hover.strokeWidth,fill:h.hover.fill,size:2*h.hover.size,symbolType:"circle"});S.name="highlight-symbol",l.addChild(S)}break}}if(o.scenegraph.updateNextFrame(),f){const p={col:i,row:t,field:o.getHeaderField(i,t),value:o.getCellValue(i,t),dataValue:o.getCellOriginValue(i,t),cellHeaderPaths:o.internalProps.layoutMap.getCellHeaderPaths(i,t),title:o.getBodyColumnDefine(i,t).title,cellRange:o.getCellRelativeRect(i,t),sparkline:{pointData:f.pointData},scaleRatio:o.canvas.getBoundingClientRect().width/o.canvas.offsetWidth};o.fireListeners(at.MOUSEOVER_CHART_SYMBOL,p)}return!0}function f5(i,t,e){const n=e.getCellRange(i.col,i.row);if(e.isColumnHeader(i.col,i.row)){const o=e.getCellRange(t.col,n.start.row);t.row>=e.columnHeaderLevelCount&&(t.row=e.columnHeaderLevelCount-1),t.col>=i.col?t.col=o.end.col:t.col=o.start.col}else if(e.isRowHeader(i.col,i.row)){const o=e.internalProps.layoutMap,r=e.getCellRange(n.start.col,t.row);if(t.col>=e.rowHeaderLevelCount+o.leftRowSeriesNumberColumnCount&&(t.col=e.rowHeaderLevelCount+o.leftRowSeriesNumberColumnCount-1),o.rowHierarchyType==="tree"){const s=o.getCellHeaderPathsWithTreeNode(i.col,i.row).rowHeaderPaths,l=o.getCellHeaderPathsWithTreeNode(t.col,t.row).rowHeaderPaths;if(s.length<=l.length){const a=l[s.length-1];a&&(t.row>=i.row?t.row=a.startInTotal+a.size-1+e.columnHeaderLevelCount:t.row=a.startInTotal+e.columnHeaderLevelCount)}}else t.row>=i.row?t.row=r.end.row:t.row=r.start.row}return t}function p5(i,t,e,n,o,r){var s;if(!("canMoveHeaderPosition"in o.table.internalProps.layoutMap))return;o.columnMove.moving=!0,o.columnMove.colSource=i,o.columnMove.rowSource=t,o.columnMove.x=e-o.table.tableX,o.columnMove.y=n-o.table.tableY;const l=o.table.getCellLocation(i,t),a=l==="columnHeader"?o.columnMove.x:l==="rowHeader"||o.table.internalProps.layoutMap.isSeriesNumberInBody(i,t)?o.columnMove.y:0,{backX:h,lineX:d,backY:u,lineY:c}=o.table.scenegraph.component.showMoveCol(i,t,a);o.table.fireListeners(at.CHANGE_HEADER_POSITION_START,{col:i,row:t,x:e,y:n,backX:h,lineX:d,backY:u,lineY:c,event:r});const g=!!(!((s=o.select.ranges)===null||s===void 0)&&s.length);o.table.stateManager.updateSelectPos(-1,-1),o.table.stateManager.endSelectCells(!0,g),o.table.scenegraph.updateNextFrame()}function m5(i,t,e,n,o,r){if(!("canMoveHeaderPosition"in o.table.internalProps.layoutMap))return;const s=f5({col:o.columnMove.colSource,row:o.columnMove.rowSource},{col:i,row:t},o.table);if(o.table.internalProps.layoutMap.canMoveHeaderPosition({col:o.columnMove.colSource,row:o.columnMove.rowSource},{col:s.col,row:s.row})){let l,a,h,d;o.columnMove.x=e-o.table.tableX,o.columnMove.y=n-o.table.tableY,o.columnMove.colTarget=s.col,o.columnMove.rowTarget=s.row,o.updateCursor("grabbing");const u=o.table.getCellLocation(o.columnMove.colSource,o.columnMove.rowSource);u==="columnHeader"?(a=o.columnMove.x,l=o.table.isLeftFrozenColumn(i)?o.columnMove.colTarget>=o.columnMove.colSource?o.table.getColsWidth(0,o.columnMove.colTarget):o.table.getColsWidth(0,o.columnMove.colTarget-1):o.table.isRightFrozenColumn(i)?o.table.tableNoFrameWidth-o.table.getColsWidth(s.col+1,o.table.colCount-1):(o.columnMove.colTarget>=o.columnMove.colSource?o.table.getColsWidth(0,o.columnMove.colTarget):o.table.getColsWidth(0,o.columnMove.colTarget-1))-o.table.stateManager.scroll.horizontalBarPos):(u==="rowHeader"||o.table.internalProps.layoutMap.isSeriesNumberInBody(i,t))&&(d=o.columnMove.y,h=o.table.isFrozenRow(t)?o.columnMove.rowTarget>=o.columnMove.rowSource?o.table.getRowsHeight(0,o.columnMove.rowTarget):o.table.getRowsHeight(0,o.columnMove.rowTarget-1):o.table.isBottomFrozenRow(t)?o.table.tableNoFrameHeight-o.table.getRowsHeight(s.row+1,o.table.rowCount-1):(o.columnMove.rowTarget>=o.columnMove.rowSource?o.table.getRowsHeight(0,o.columnMove.rowTarget):o.table.getRowsHeight(0,o.columnMove.rowTarget-1))-o.table.stateManager.scroll.verticalBarPos),o.table.scenegraph.component.updateMoveCol(a,l,d,h),o.table.fireListeners(at.CHANGING_HEADER_POSITION,{col:i,row:t,x:e,y:n,backX:a,lineX:l,backY:d,lineY:h,event:r}),o.table.scenegraph.updateNextFrame()}else o.updateCursor("not-allowed"),o.columnMove.colTarget=o.columnMove.colSource,o.columnMove.rowTarget=o.columnMove.rowSource}function v5(i){var t,e;let n=!1;if("canMoveHeaderPosition"in i.table.internalProps.layoutMap&&i.columnMove.moving&&i.columnMove.colSource>=0&&i.columnMove.rowSource>=0&&i.columnMove.colTarget>=0&&i.columnMove.rowTarget>=0&&((t=i.table.options.customConfig)===null||t===void 0?void 0:t.notUpdateInColumnRowMove)!==!0){const o=i.table.getCellRange(i.columnMove.colSource,i.columnMove.rowSource),r=i.table.getCellRange(i.columnMove.colTarget,i.columnMove.rowTarget),s=i.table._moveHeaderPosition({col:i.columnMove.colSource,row:i.columnMove.rowSource},{col:i.columnMove.colTarget,row:i.columnMove.rowTarget});if(!s||s.targetIndex===s.sourceIndex)return i.updateCursor(),i.columnMove.moving=!1,delete i.columnMove.colSource,delete i.columnMove.rowSource,delete i.columnMove.colTarget,delete i.columnMove.rowTarget,i.table.scenegraph.component.hideMoveCol(),i.table.scenegraph.updateNextFrame(),!1;{i.table.internalProps.useOneRowHeightFillAll=!1,i.table.internalProps.layoutMap.clearCellRangeMap();const l=i.table.getCellRange(i.columnMove.colSource,i.columnMove.rowSource),a=i.table.getCellRange(i.columnMove.colTarget,i.columnMove.rowTarget),h=Math.min(l.start.col,a.start.col,o.start.col,r.start.col),d=Math.max(l.end.col,a.end.col,o.end.col,r.end.col),u=Math.min(l.start.row,a.start.row,o.start.row,r.start.row);let c=Math.max(l.end.row,a.end.row,o.end.row,r.end.row);s.moveType==="row"&&i.table.internalProps.layoutMap.rowHierarchyType==="tree"&&(c=s.targetIndex>s.sourceIndex?c+s.targetSize-1:c+s.sourceSize-1),!i.table.transpose&&i.table.internalProps.layoutMap.isSeriesNumberInBody(i.columnMove.colSource,i.columnMove.rowSource)&&(i.table.changeRecordOrder(s.sourceIndex,s.targetIndex),i.changeCheckboxAndRadioOrder(s.sourceIndex,s.targetIndex)),s.moveType==="column"?xA(h,d,0,-1,i.table):xA(0,-1,u,c,i.table),i.table.clearCellStyleCache(),i.table.internalProps.layoutMap.isSeriesNumberInBody(i.columnMove.colSource,i.columnMove.rowSource)?i.table.scenegraph.updateHeaderPosition(i.table.scenegraph.proxy.colStart,i.table.scenegraph.proxy.colEnd,i.table.scenegraph.proxy.rowStart,i.table.scenegraph.proxy.rowEnd,s.moveType):s.moveType==="column"?i.table.scenegraph.updateHeaderPosition(h,d,0,-1,s.moveType):i.table.scenegraph.updateHeaderPosition(0,-1,u,c,s.moveType),i.table.internalProps.frozenColDragHeaderMode==="adjustFrozenCount"&&i.table.isListTable()&&(i.table.isLeftFrozenColumn(i.columnMove.colTarget)&&!i.table.isLeftFrozenColumn(i.columnMove.colSource)?i.table.frozenColCount+=l.end.col-l.start.col+1:i.table.isLeftFrozenColumn(i.columnMove.colSource)&&!i.table.isLeftFrozenColumn(i.columnMove.colTarget)&&(i.table.frozenColCount-=l.end.col-l.start.col+1),i.table.isRightFrozenColumn(i.columnMove.colTarget)&&!i.table.isRightFrozenColumn(i.columnMove.colSource)?i.table.rightFrozenColCount+=l.end.col-l.start.col+1:i.table.isRightFrozenColumn(i.columnMove.colSource)&&!i.table.isRightFrozenColumn(i.columnMove.colTarget)&&(i.table.rightFrozenColCount-=l.end.col-l.start.col+1)),n=!0}}return i.columnMove.moving=!1,setTimeout(()=>{delete i.columnMove.colSource,delete i.columnMove.rowSource,delete i.columnMove.colTarget,delete i.columnMove.rowTarget},0),i.table.scenegraph.component.hideMoveCol(),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.scenegraph.component.setRightFrozenColumnShadow(i.table.colCount-i.table.rightFrozenColCount)):i.columnResize.col>=i.table.colCount-i.table.rightFrozenColCount&&!i.table.isPivotTable()&&!i.table.transpose?i.table.scenegraph.component.setRightFrozenColumnShadow(i.table.colCount-i.table.rightFrozenColCount):i.table.options.frozenColCount?i.table.scenegraph.component.setFrozenColumnShadow(i.table.frozenColCount-1):i.table.options.rightFrozenColCount&&i.table.scenegraph.component.setRightFrozenColumnShadow(i.table.colCount-i.table.rightFrozenColCount),i.table.scenegraph.updateNextFrame(),((e=i.table.options.customConfig)===null||e===void 0?void 0:e.notUpdateInColumnRowMove)===!0||n}function xA(i,t,e,n,o){for(let r=i;r<=t;r++)o._clearColRangeWidthsMap(r);for(let r=e;r<=n;r++)o._clearRowRangeHeightsMap(r)}function Mh(i){var t;if(!i)return;const e=!((t=i.role)===null||t===void 0)&&t.startsWith("icon")?i:i.type==="richtext"?i._currentHoverIcon:void 0;return e?i.type==="richtext"?{icon:e,position:{left:i.globalAABBBounds.x1+e.globalAABBBounds.x1,right:i.globalAABBBounds.x1+e.globalAABBBounds.x2,top:i.globalAABBBounds.y1+e.globalAABBBounds.y1,bottom:i.globalAABBBounds.y1+e.globalAABBBounds.y2,width:e.globalAABBBounds.x2-e.globalAABBBounds.x1,height:e.globalAABBBounds.y2-e.globalAABBBounds.y1},type:"richtext-icon"}:{icon:e,position:{left:e.globalAABBBounds.x1,right:e.globalAABBBounds.x2,top:e.globalAABBBounds.y1,bottom:e.globalAABBBounds.y2,width:e.globalAABBBounds.x2-e.globalAABBBounds.x1,height:e.globalAABBBounds.y2-e.globalAABBBounds.y1},type:"icon"}:void 0}function b5(i,t,e){i=Math.ceil(i),t=Math.ceil(t);let n=e.columnResize.isRightFrozen?e.columnResize.x-i:i-e.columnResize.x;if(Math.abs(n)<1)return;const o=e.table.getColWidth(e.columnResize.col);let r=o;r+=n;const s=e.table.getMinColWidth(e.columnResize.col),l=e.table.getMaxColWidth(e.columnResize.col);if(r<s||r>l){if(o===s||o===l)return;n=o-s>l-o?l-o:s-o}let a=e.table.getColWidth(e.columnResize.col)+n;if(a<e.table.internalProps.limitMinWidth&&(a=e.table.internalProps.limitMinWidth,n=a-e.table.getColWidth(e.columnResize.col)),e.table.widthMode==="adaptive"&&e.columnResize.col<e.table.colCount-1){const h=e.table.getColWidth(e.columnResize.col+1),d=e.table.getMinColWidth(e.columnResize.col+1),u=e.table.getMaxColWidth(e.columnResize.col+1);let c=h;if(c-=n,c<d||c>u){if(h===d||h===u)return;n=h-d>u-h?u-h:d-h}c-n<e.table.internalProps.limitMinWidth&&(n=c-e.table.internalProps.limitMinWidth)}n=Math.ceil(n),e.columnResize.col<e.table.rowHeaderLevelCount||e.columnResize.col>=e.table.colCount-e.table.rightFrozenColCount?RA(n,e):e.table.internalProps.columnResizeType==="indicator"?y5(n,e):e.table.internalProps.columnResizeType==="indicatorGroup"?_5(n,e):e.table.internalProps.columnResizeType==="all"?C5(n,e):RA(n,e),e.columnResize.x=i,e.table.scenegraph.component.updateResizeCol(e.columnResize.col,t,e.columnResize.isRightFrozen),e.columnResize.col<e.table.frozenColCount&&!e.table.isPivotTable()&&!e.table.transpose?e.table.scenegraph.component.setFrozenColumnShadow(e.table.frozenColCount-1,e.columnResize.isRightFrozen):e.table.options.frozenColCount&&e.table.scenegraph.component.setFrozenColumnShadow(e.table.frozenColCount-1),(e.columnResize.col>=e.table.colCount-e.table.rightFrozenColCount&&!e.table.isPivotTable()&&!e.table.transpose||e.table.options.rightFrozenColCount)&&e.table.scenegraph.component.setRightFrozenColumnShadow(e.table.colCount-e.table.rightFrozenColCount),e.table.scenegraph.updateNextFrame()}function RA(i,t){t.table.widthMode==="adaptive"&&t.columnResize.col<t.table.colCount-1?(t.table.scenegraph.updateColWidth(t.columnResize.col,i),t.table.scenegraph.updateColWidth(t.columnResize.col+1,-i),t.table.internalProps._widthResizedColMap.add(t.columnResize.col),t.table.internalProps._widthResizedColMap.add(t.columnResize.col+1)):(t.table.scenegraph.updateColWidth(t.columnResize.col,i),t.table.internalProps._widthResizedColMap.add(t.columnResize.col))}function C5(i,t){const e=t.table.internalProps.layoutMap;for(let n=t.table.frozenColCount;n<t.table.colCount-t.table.rightFrozenColCount;n++){if(!(t.table.internalProps.transpose||t.table.isPivotTable()&&!e.indicatorsAsCol)){const o=e.getBody(n,t.table.columnHeaderLevelCount);if(o!=null&&o.disableColumnResize)continue}t.table.scenegraph.updateColWidth(n,i),t.table.internalProps._widthResizedColMap.add(n)}}function y5(i,t){const e=t.table.internalProps.layoutMap;let n,o,r;if(e.indicatorsAsCol)n=e.getIndicatorKey(t.columnResize.col,t.table.columnHeaderLevelCount);else{const s=e.getCellHeaderPaths(t.columnResize.col,t.table.columnHeaderLevelCount-1),l=s.colHeaderPaths[s.colHeaderPaths.length-1];o=l.dimensionKey,r=l.value}for(let s=t.table.rowHeaderLevelCount;s<t.table.colCount-t.table.rightFrozenColCount;s++){const l=e.getIndicatorKey(s,t.table.columnHeaderLevelCount);if(e.indicatorsAsCol&&l===n)t.table.scenegraph.updateColWidth(s,i),t.table.internalProps._widthResizedColMap.add(s);else if(!e.indicatorsAsCol){const a=e.getCellHeaderPaths(s,t.table.columnHeaderLevelCount-1),h=a==null?void 0:a.colHeaderPaths[a.colHeaderPaths.length-1];h&&o===h.dimensionKey&&r===h.value&&(t.table.scenegraph.updateColWidth(s,i),t.table.internalProps._widthResizedColMap.add(s))}}}function _5(i,t){const e=t.table.internalProps.layoutMap,n=e.getCellHeaderPaths(t.columnResize.col,t.table.columnHeaderLevelCount),o=e.getHeadNodeByRowOrColDimensions(n.colHeaderPaths.slice(0,n.colHeaderPaths.length-1)),r=o.startInTotal+t.table.frozenColCount,s=o.startInTotal+t.table.frozenColCount+o.size-1,l=t.table.getColsWidth(r,s),a=i;for(let h=r;h<=s;h++){if(!(t.table.internalProps.transpose||t.table.isPivotTable()&&!e.indicatorsAsCol)){const u=e.getBody(h,t.table.columnHeaderLevelCount);if(u!=null&&u.disableColumnResize)continue}let d=t.table.getColWidth(h)/l*a;d>0&&d<.5?d=.5:d<0&&d>=-.5&&(d=-.5),t.table.scenegraph.updateColWidth(h,d),t.table.internalProps._widthResizedColMap.add(h)}}function w5(i,t,e,n,o,r){const s=r.table.getRecordShowIndexByCell(i,t);if(s>=0){const l=r.table.dataSource.getIndexKey(s);n==="column"?ft(o)?(r.radioState[e]={},r.radioState[e][l]=o):r.radioState[e]=l:(r.radioState[e]||(r.radioState[e]={}),ft(o)?r.radioState[e][l]=o:r.radioState[e][l]=!0)}}function S5(i,t,e){var n;const o=e.getBodyColumnDefine(i,t),r=o==null?void 0:o.field,s=e.getCellType(i,t);if(z(r)&&s==="checkbox"){const l=e.dataSource.getIndexKey(e.getRecordShowIndexByCell(i,t)),a=(n=e.stateManager.radioState)===null||n===void 0?void 0:n[r];if(ft(a)){if(a===l)return!0}else if(ge(a)){const h=a[l];if(ft(h))return h}}return!1}function x5(i,t,e,n,o,r,s){var l,a,h,d,u;const c=s.table.getRecordShowIndexByCell(i,t);if(c>=0){const g=s.table.dataSource.getIndexKey(c);if(n==="column"){if(!z(s.radioState[e])&&r)return ft(o)?(s.radioState[e]={},s.radioState[e][g]=o):s.radioState[e]=g,!0;if(ft(s.radioState[e])&&!ft(o))return s.radioState[e]===g;if(ft(s.radioState[e])&&ft(o)||ge(s.radioState[e])&&!ft(o))return!1;if(ge(s.radioState[e])&&ft(o))return s.radioState[e][g]===o}else if(n==="cell"){if(!z(s.radioState[e])&&r)return s.radioState[e]={},ft(o)?s.radioState[e][g]=o:s.radioState[e][g]=!0,!0;if(!z((l=s.radioState[e])===null||l===void 0?void 0:l[g])&&r)return ft(o)?s.radioState[e][g]=o:s.radioState[e][g]=!0,!0;if(bi((a=s.radioState[e])===null||a===void 0?void 0:a[g])&&!ft(o))return s.radioState[e][g];if(bi((h=s.radioState[e])===null||h===void 0?void 0:h[g])&&ft(o)||ft((d=s.radioState[e])===null||d===void 0?void 0:d[g])&&!ft(o))return!1;if(ft((u=s.radioState[e])===null||u===void 0?void 0:u[g])&&ft(o))return s.radioState[e][g]===o}}return r}function R5(i,t,e,n){const o=n.scenegraph.getCell(i,t);if(o)if(ft(e)){const r=o.getChildAt(e);r==null||r._handlePointerUp()}else{const r=o.getChildByName("radio");r==null||r._handlePointerUp()}}function A5(i,t,e){const{radioState:n,table:o}=e;if(o.internalProps.transpose?(i=o.getRecordShowIndexByCell(i,0),t=o.getRecordShowIndexByCell(t,0)):(i=o.getRecordShowIndexByCell(0,i),t=o.getRecordShowIndexByCell(0,t)),i>t){const r=n[i];for(let s=i;s>t;s--)n[s]=n[s-1];n[t]=r}else if(i<t){const r=n[i];for(let s=i;s<t;s++)n[s]=n[s+1];n[t]=r}}function T5(i,t,e,n,o){const r=o.table.getRecordShowIndexByCell(i,t);if(r>=0){const s=o.table.dataSource.getIndexKey(r);o.checkedState[s]||(o.checkedState[s]={}),o.checkedState[s][e]=n}}function M5(i,t,e){var n;e.headerCheckedState[i]=t,(n=e.checkedState)===null||n===void 0||n.forEach(o=>{o[i]=t})}function B5(i,t,e,n,o){var r,s;if(o.table.isHeader(i,t)){if(z(o.headerCheckedState[e]))return o.headerCheckedState[e];if(typeof n=="function")return;if(z(n))o.headerCheckedState[e]=n;else if(((r=o.checkedState)===null||r===void 0?void 0:r.length)>0)return o.updateHeaderCheckedState(e,i,t);return o.headerCheckedState[e]}const l=o.table.getRecordShowIndexByCell(i,t);if(l>=0){const a=o.table.dataSource.getIndexKey(l);if(z((s=o.checkedState[a])===null||s===void 0?void 0:s[e]))return o.checkedState[a][e];o.checkedState[a]||(o.checkedState[a]={}),o.checkedState[a][e]=n}return n}function P5(i,t){t.checkedState=[],t.headerCheckedState={},t.radioState={};let e=!1;t._checkboxCellTypeFields=[],t._headerCheckFuncs={},t.table.internalProps.layoutMap.headerObjects.forEach((n,o)=>{if(n.headerType==="checkbox"){const r=n.define.checked;r==null||typeof r=="function"?(e=!0,typeof r=="function"&&(t._headerCheckFuncs[n.field]=r)):t.headerCheckedState[n.field]=r,n.define.cellType!=="checkbox"||n.fieldFormat||t._checkboxCellTypeFields.push(n.field)}}),e&&i.forEach((n,o)=>{t._checkboxCellTypeFields.forEach(r=>{const s=n[r];let l;if(ge(s)?l=s.checked:typeof s=="boolean"&&(l=s),l==null){const a=t._headerCheckFuncs[r];if(a){const h=t.table.getCellAddrByFieldRecord(r,o);l=ii(a,{col:h.col,row:h.row,table:t.table,context:null,value:s})}}t.checkedState[o]||(t.checkedState[o]={}),t.checkedState[o][r]=l})})}function H5(i,t,e,n){const o=t.checkedState.every((r,s)=>{const l=t.table.getTableIndexByRecordIndex(s);return!!(t.table.transpose?t.table.getCustomMerge(l,n):t.table.getCustomMerge(e,l))||(r==null?void 0:r[i])===!0});return o?(t.headerCheckedState[i]=!0,o):t.checkedState.every((r,s)=>{const l=t.table.getTableIndexByRecordIndex(s);return!!(t.table.transpose?t.table.getCustomMerge(l,n):t.table.getCustomMerge(e,l))||(r==null?void 0:r[i])===!1})?(t.headerCheckedState[i]=!1,!1):!!t.checkedState.find(r=>(r==null?void 0:r[i])===!0)&&(t.headerCheckedState[i]="indeterminate","indeterminate")}function E5(i,t){for(let e=t.checkedState.length;e<i.length;e++){const n=i[e];t._checkboxCellTypeFields.forEach(o=>{const r=n[o];let s;ge(r)?s=r.checked:typeof r=="boolean"&&(s=r),t.checkedState[e]||(t.checkedState[e]={}),t.checkedState[e][o]=s})}}function L5(i,t,e,n){const o=n.scenegraph.getCell(i,t),r=o==null?void 0:o.getChildByName("checkbox");if(!r)return;const{checked:s,indeterminate:l}=r.attribute;l?(e||r._handlePointerUp(),r._handlePointerUp()):s?e||r._handlePointerUp():e&&r._handlePointerUp()}function k5(i,t,e){const{checkedState:n,table:o}=e;if(o.internalProps.transpose?(i=o.getRecordShowIndexByCell(i,0),t=o.getRecordShowIndexByCell(t,0)):(i=o.getRecordShowIndexByCell(0,i),t=o.getRecordShowIndexByCell(0,t)),i>t){const r=n[i];for(let s=i;s>t;s--)n[s]=n[s-1];n[t]=r}else if(i<t){const r=n[i];for(let s=i;s<t;s++)n[s]=n[s+1];n[t]=r}}function F5(i){const t=[],e=i.dataSource,n=e.dataConfig.groupByRules.length+1;return e.currentIndexedData.forEach((o,r)=>{if(lt(o)&&o.length===n){const{vtableOriginIndex:s}=e.getRawRecord(o);t[s]=i.stateManager.checkedState[o]}}),t}function I5(i,t,e){i=Math.ceil(i),t=Math.ceil(t);let n=e.rowResize.isBottomFrozen?e.rowResize.y-t:t-e.rowResize.y;if(Math.abs(n)<1)return;e.table.getRowHeight(e.rowResize.row);let o=e.table.getRowHeight(e.rowResize.row)+n;if(o<e.table.internalProps.limitMinHeight&&(o=e.table.internalProps.limitMinHeight,n=o-e.table.getRowHeight(e.rowResize.row)),e.table.heightMode==="adaptive"&&e.rowResize.row<e.table.rowCount-1){let r=e.table.getRowHeight(e.rowResize.row+1);r-=n,r-n<e.table.internalProps.limitMinHeight&&(n=r-e.table.internalProps.limitMinHeight)}n=Math.ceil(n),e.rowResize.row<e.table.columnHeaderLevelCount||e.rowResize.row>=e.table.rowCount-e.table.bottomFrozenRowCount?AA(n,e):e.table.internalProps.rowResizeType==="indicator"?O5(n,e):e.table.internalProps.rowResizeType==="indicatorGroup"?z5(n,e):e.table.internalProps.rowResizeType==="all"?D5(n,e):AA(n,e),e.rowResize.y=t,e.table.scenegraph.component.updateResizeRow(e.rowResize.row,i,e.rowResize.isBottomFrozen),e.table.scenegraph.updateNextFrame()}function AA(i,t){t.table.heightMode==="adaptive"&&t.rowResize.row<t.table.rowCount-1?(t.table.scenegraph.updateRowHeight(t.rowResize.row,i),t.table.scenegraph.updateRowHeight(t.rowResize.row+1,-i),t.table.internalProps._heightResizedRowMap.add(t.rowResize.row),t.table.internalProps._heightResizedRowMap.add(t.rowResize.row+1)):(t.table.scenegraph.updateRowHeight(t.rowResize.row,i),t.table.internalProps._heightResizedRowMap.add(t.rowResize.row))}function D5(i,t){for(let e=t.table.frozenRowCount;e<t.table.rowCount-t.table.bottomFrozenRowCount;e++)t.table.scenegraph.updateRowHeight(e,i),t.table.internalProps._heightResizedRowMap.add(e)}function O5(i,t){var e,n;const o=t.table.internalProps.layoutMap;let r,s,l;if(o.indicatorsAsCol){const a=o.getCellHeaderPaths(t.table.rowHeaderLevelCount-1,t.rowResize.row),h=(e=a.rowHeaderPaths)===null||e===void 0?void 0:e[a.rowHeaderPaths.length-1];s=h==null?void 0:h.dimensionKey,l=h==null?void 0:h.value}else r=o.getIndicatorKey(t.table.rowHeaderLevelCount,t.rowResize.row);for(let a=t.table.columnHeaderLevelCount;a<t.table.rowCount-t.table.bottomFrozenRowCount;a++){const h=o.getIndicatorKey(t.table.rowHeaderLevelCount,a);if(o.indicatorsAsCol||h!==r){if(o.indicatorsAsCol){const d=o.getCellHeaderPaths(t.table.rowHeaderLevelCount-1,a),u=(n=d==null?void 0:d.rowHeaderPaths)===null||n===void 0?void 0:n[d.rowHeaderPaths.length-1];u&&s===u.dimensionKey&&l===u.value&&(t.table.scenegraph.updateRowHeight(a,i),t.table.internalProps._heightResizedRowMap.add(a))}}else t.table.scenegraph.updateRowHeight(a,i),t.table.internalProps._heightResizedRowMap.add(a)}}function z5(i,t){const e=t.table.internalProps.layoutMap,n=e.getCellHeaderPaths(t.table.rowHeaderLevelCount,t.rowResize.row),o=e.getHeadNodeByRowOrColDimensions(n.rowHeaderPaths.slice(0,n.rowHeaderPaths.length-1)),r=o.startInTotal+t.table.frozenRowCount,s=o.startInTotal+t.table.frozenRowCount+o.size-1,l=t.table.getRowsHeight(r,s),a=i;for(let h=r;h<=s;h++){let d=t.table.getRowHeight(h)/l*a;d>0&&d<.5?d=.5:d<0&&d>=-.5&&(d=-.51),t.table.scenegraph.updateRowHeight(h,d),t.table.internalProps._heightResizedRowMap.add(h)}}function W5(i){const{customSelectedRangeComponents:t}=i.table.scenegraph;t.forEach((e,n)=>{e.rect.delete()}),t.clear(),i.select.customSelectRanges=[]}function N5(i,t){const{customSelectedRangeComponents:e}=t.table.scenegraph;i.forEach(n=>{var o,r,s,l;const{range:a,style:h}=n,d=Fe({fill:(o=h.cellBgColor)!==null&&o!==void 0&&o,stroke:(r=h.cellBorderColor)!==null&&r!==void 0&&r,lineWidth:(s=h.cellBorderLineWidth)!==null&&s!==void 0?s:0,lineDash:(l=h.cellBorderLineDash)!==null&&l!==void 0?l:[],pickable:!1});e.set(`${a.start.col}-${a.start.row}-${a.end.col}-${a.end.row}`,{rect:d,role:"body"})}),t.select.customSelectRanges=i,tA(t.table.scenegraph),t.table.scenegraph.updateNextFrame()}class V5{constructor(t){this.fastScrolling=!1,this.checkedState=[],this.headerCheckedState={},this._checkboxCellTypeFields=[],this._headerCheckFuncs={},this.radioState={},this.resetInteractionState=bx(e=>{this.updateInteractionState(e??$t.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=$t.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 hn,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=$t.default,this.select={highlightScope:he.single,ranges:[],cellPos:{col:-1,row:-1},selecting:!1},this.fillHandle={isFilling:!1,startX:void 0,startY:void 0},this.hover={highlightScope:he.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 hn,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:n,disableHeaderHover:o}=(t=this.table.options.hover)!==null&&t!==void 0?t:{highlightMode:"cell"};n?this.hover.highlightScope=he.none:e==="cross"?this.hover.highlightScope=he.cross:e==="row"?this.hover.highlightScope=he.row:e==="column"?this.hover.highlightScope=he.column:e==="cell"&&(this.hover.highlightScope=he.single),this.hover.singleStyle=!n,this.hover.disableHeader=o,(this.hover.highlightScope===he.none||o)&&(this.hover.cellPosContainHeader={col:-1,row:-1})}setSelectState(){const{headerSelectMode:t,disableSelect:e,disableHeaderSelect:n,highlightMode:o,highlightInRange:r}=Object.assign({},{headerSelectMode:"inline",disableSelect:!1,disableHeaderSelect:!1,highlightMode:"cell",highlightInRange:!1},this.table.options.select);this.select.highlightScope=e?he.none:o==="cross"?he.cross:o==="row"?he.row:o==="column"?he.column:he.single,this.select.singleStyle=!e,this.select.disableHeader=n,this.select.headerSelectMode=t,this.select.highlightInRange=r}isSelected(t,e){let n=!1;return this.select.ranges.forEach(o=>{Yi(o,t,e)&&(n=!0)}),n}setSortState(t){const e=this,n=(t=!t||Array.isArray(t)?t:[t])&&t.reduce((o,r)=>{var s,l,a;const h=(s=function(d){const u=[];return function c(g,f=0){g.forEach(p=>{var m;const b=p.startInTotal?(m=p.startInTotal+e.table.internalProps.layoutMap.leftRowSeriesNumberColumnCount)!==null&&m!==void 0?m:0:f;p.columns?c(p.columns,b):u.push(Object.assign(Object.assign({},p),{startIndex:b}))})}(d),u}(this.table.internalProps.columns))===null||s===void 0?void 0:s.find(d=>(d==null?void 0:d.field)===(r==null?void 0:r.field));return this.table.internalProps.transpose?o.push({field:r.field,order:r.order,row:(l=(h==null?void 0:h.startInTotal)+this.table.internalProps.layoutMap.leftRowSeriesNumberColumnCount)!==null&&l!==void 0?l:0,col:h==null?void 0:h.level}):o.push({field:r.field,order:r.order,col:(a=(h==null?void 0:h.startInTotal)+this.table.internalProps.layoutMap.leftRowSeriesNumberColumnCount)!==null&&a!==void 0?a:0,row:h==null?void 0:h.level}),o},[]);this.sort=n||[]}setFrozenState(){this.frozen.col=this.table.frozenColCount-1}updateInteractionState(t){if(this.interactionState===t)return;t===$t.scrolling&&(this.interactionStateBeforeScroll=this.interactionState);const e=this.interactionState;this.interactionState=t,e===$t.scrolling&&$t.default}updateHoverhighlightScope(t){this.hover.highlightScope!==t&&(this.hover.highlightScope=t)}updateHoverPos(t,e){o5(this,t,e)}updateSelectPos(t,e,n=!1,o=!1,r=!1,s=!1,l=!1,a=!1){e!==-1&&e!==-1&&(this.select.selecting=!0),h5(this,t,e,n,o,r,s,l,a)}checkCellRangeInSelect(t,e){return e5(t,e,this.select.ranges,this.select.highlightScope)}updateHoverIcon(t,e,n,o){var r,s,l,a,h,d,u,c,g;if(!((r=this.residentHoverIcon)===null||r===void 0)&&r.icon&&n===((s=this.residentHoverIcon)===null||s===void 0?void 0:s.icon))return;const f=Mh(n);if(f)if(f.type==="richtext-icon"){const p=f.icon;if(this.hoverIcon.icon&&this.hoverIcon.icon!==((a=this.residentHoverIcon)===null||a===void 0?void 0:a.icon)&&(this.table.scenegraph.setIconNormalStyle(this.hoverIcon.icon,this.hoverIcon.col,this.hoverIcon.row),this.hoverIcon.col=-1,this.hoverIcon.col=-1,this.hoverIcon.icon=null,this.table.scenegraph.updateNextFrame()),p.attribute.tooltip){const m={content:p.attribute.tooltip.title,referencePosition:{rect:f.position,placement:p.attribute.tooltip.placement},style:Object.assign({},(h=this.table.internalProps.theme)===null||h===void 0?void 0:h.tooltipStyle,(d=p.tooltip)===null||d===void 0?void 0:d.style,(c=(u=p.attribute)===null||u===void 0?void 0:u.tooltip)===null||c===void 0?void 0:c.style),disappearDelay:p.attribute.tooltip.disappearDelay};this.table.internalProps.tooltipHandler.isBinded(m)||this.table.showTooltip(t,e,m)}}else{const p=f.icon;p!==this.hoverIcon.icon&&(this.hoverIcon.icon&&this.hoverIcon.icon!==((g=this.residentHoverIcon)===null||g===void 0?void 0:g.icon)&&this.table.scenegraph.setIconNormalStyle(this.hoverIcon.icon,this.hoverIcon.col,this.hoverIcon.row),this.hoverIcon.col=t,this.hoverIcon.row=e,this.hoverIcon.icon=p,this.table.scenegraph.setIconHoverStyle(p,t,e,o),this.table.scenegraph.updateNextFrame())}else this.hoverIcon.icon&&this.hoverIcon.icon!==((l=this.residentHoverIcon)===null||l===void 0?void 0:l.icon)&&(this.table.scenegraph.setIconNormalStyle(this.hoverIcon.icon,this.hoverIcon.col,this.hoverIcon.row),this.hoverIcon.col=-1,this.hoverIcon.col=-1,this.hoverIcon.icon=null,this.table.scenegraph.updateNextFrame())}isResizeCol(){return this.columnResize.resizing}isResizeRow(){return this.rowResize.resizing}isFillHandle(){return this.fillHandle.isFilling}isSelecting(){return this.select.selecting}endSelectCells(t=!0,e=!0){if(this.select.selecting){if(this.select.selecting=!1,this.select.ranges.length===0)return;const n=this.select.ranges[this.select.ranges.length-1];let o=!1;for(let l=0;l<this.select.ranges.length-1;l++){const a=this.select.ranges[l];if(a&&a.start.col===n.start.col&&a.start.row===n.start.row&&a.end.col===n.end.col&&a.end.row===n.end.row){o=!0;break}}o?(this.select.ranges.pop(),sA(this.table.scenegraph),this.table.scenegraph.selectingRangeComponents.clear()):d5(this.table.scenegraph);const r=this.select.ranges[this.select.ranges.length-1].end.col,s=this.select.ranges[this.select.ranges.length-1].end.row;t&&this.table.fireListeners(at.SELECTED_CELL,{ranges:this.select.ranges,col:r,row:s})}else e&&this.select.ranges.length===0&&this.table.fireListeners(at.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,n,o){var r;this.columnResize.resizing=!0,this.columnResize.col=t,this.columnResize.x=e,this.columnResize.isRightFrozen=o,this.table.scenegraph.component.showResizeCol(t,n,o);const s=!!(!((r=this.select.ranges)===null||r===void 0)&&r.length);this.updateSelectPos(-1,-1),this.endSelectCells(!0,s),this.table.scenegraph.updateNextFrame()}updateResizeCol(t,e){b5(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,n,o){var r;this.rowResize.resizing=!0,this.rowResize.row=t,this.rowResize.y=n,this.rowResize.isBottomFrozen=o,this.table.scenegraph.component.showResizeRow(t,e,o);const s=!!(!((r=this.select.ranges)===null||r===void 0)&&r.length);this.updateSelectPos(-1,-1),this.endSelectCells(!0,s),this.table.scenegraph.updateNextFrame()}updateResizeRow(t,e){I5(t,e,this)}startFillSelect(t,e){this.fillHandle.isFilling=!0,this.fillHandle.startX=t,this.fillHandle.startY=e;const n=this.select.ranges[this.select.ranges.length-1];this.fillHandle.beforeFillMinCol=Math.min(n.start.col,n.end.col),this.fillHandle.beforeFillMinRow=Math.min(n.start.row,n.end.row),this.fillHandle.beforeFillMaxCol=Math.max(n.start.col,n.end.col),this.fillHandle.beforeFillMaxRow=Math.max(n.start.row,n.end.row),this.table.fireListeners(at.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),n=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===n&&this.fillHandle.beforeFillMaxRow===o||this.table.eventManager.isDraging&&this.table.fireListeners(at.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,n,o,r){p5(t,e,n,o,this,r)}updateMoveCol(t,e,n,o,r){m5(t,e,n,o,this,r)}isMoveCol(){return this.columnMove.moving}endMoveCol(){return v5(this)}checkFrozen(){var t,e,n;let o=this.table.isListTable()&&!this.table.internalProps.transpose?this.table.options.frozenColCount:this.table.isPivotChart()?(t=this.table.rowHeaderLevelCount)!==null&&t!==void 0?t:0:Math.max(((e=this.table.rowHeaderLevelCount)!==null&&e!==void 0?e:0)+this.table.internalProps.layoutMap.leftRowSeriesNumberColumnCount,(n=this.table.options.frozenColCount)!==null&&n!==void 0?n: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 n=this.table.getAllRowsHeight(),o=this.scroll.verticalBarPos,r=this.table.tableNoFrameHeight;o+r>=n&&this.table.fireListeners(at.SCROLL_VERTICAL_END,{scrollTop:o,scrollLeft:this.scroll.horizontalBarPos,scrollHeight:(t=this.table.theme.scrollStyle)===null||t===void 0?void 0:t.width,scrollWidth:(e=this.table.theme.scrollStyle)===null||e===void 0?void 0:e.width,viewHeight:r,viewWidth:this.table.tableNoFrameWidth})}checkHorizontalScrollBarEnd(){var t,e;const n=this.table.getAllColsWidth(),o=this.scroll.horizontalBarPos,r=this.table.tableNoFrameWidth;o+r>=n&&this.table.fireListeners(at.SCROLL_HORIZONTAL_END,{scrollTop:this.scroll.verticalBarPos,scrollLeft:o,scrollHeight:(t=this.table.theme.scrollStyle)===null||t===void 0?void 0:t.width,scrollWidth:(e=this.table.theme.scrollStyle)===null||e===void 0?void 0:e.width,viewHeight:this.table.tableNoFrameHeight,viewWidth:r})}updateVerticalScrollBar(t){var e,n;const o=this.table.getAllRowsHeight(),r=this.scroll.verticalBarPos;this.scroll.verticalBarPos=Math.ceil(t*(o-this.table.scenegraph.height)),z(this.scroll.verticalBarPos)&&!isNaN(this.scroll.verticalBarPos)||(this.scroll.verticalBarPos=0),this.table.scenegraph.setY(-this.scroll.verticalBarPos,t===1),this.scroll.verticalBarPos-=this.table.scenegraph.proxy.deltaY,this.table.scenegraph.proxy.deltaY=0,this.updateHoverPos(-1,-1),this.table.fireListeners(at.SCROLL,{event:void 0,scrollTop:this.scroll.verticalBarPos,scrollLeft:this.scroll.horizontalBarPos,scrollHeight:(e=this.table.theme.scrollStyle)===null||e===void 0?void 0:e.width,scrollWidth:(n=this.table.theme.scrollStyle)===null||n===void 0?void 0:n.width,viewHeight:this.table.tableNoFrameHeight,viewWidth:this.table.tableNoFrameWidth,scrollDirection:"vertical",scrollRatioY:t}),r!==this.scroll.verticalBarPos&&this.checkVerticalScrollBarEnd()}updateHorizontalScrollBar(t){var e,n;const o=this.table.getAllColsWidth(),r=this.scroll.horizontalBarPos;this.scroll.horizontalBarPos=Math.ceil(t*(o-this.table.scenegraph.width)),z(this.scroll.horizontalBarPos)&&!isNaN(this.scroll.horizontalBarPos)||(this.scroll.horizontalBarPos=0),this.table.scenegraph.setX(-this.scroll.horizontalBarPos,t===1),this.scroll.horizontalBarPos-=this.table.scenegraph.proxy.deltaX,this.table.scenegraph.proxy.deltaX=0,this.updateHoverPos(-1,-1),this.table.fireListeners(at.SCROLL,{event:void 0,scrollTop:this.scroll.verticalBarPos,scrollLeft:this.scroll.horizontalBarPos,scrollHeight:(e=this.table.theme.scrollStyle)===null||e===void 0?void 0:e.width,scrollWidth:(n=this.table.theme.scrollStyle)===null||n===void 0?void 0:n.width,viewHeight:this.table.tableNoFrameHeight,viewWidth:this.table.tableNoFrameWidth,scrollDirection:"horizontal",scrollRatioX:t}),r!==this.scroll.horizontalBarPos&&this.checkHorizontalScrollBarEnd()}setScrollTop(t,e,n=!0){var o,r,s;const l=this.table.getAllRowsHeight(),a=!((o=this.table.options.customConfig)===null||o===void 0)&&o._disableColumnAndRowSizeRound?1:0;t=Math.max(0,Math.min(t,l-this.table.scenegraph.height-a)),((t=Math.ceil(t))!==this.scroll.verticalBarPos||this.table.isPivotChart())&&this.updateHoverPos(-1,-1);const h=this.scroll.verticalBarPos;this.scroll.verticalBarPos=t,z(this.scroll.verticalBarPos)&&!isNaN(this.scroll.verticalBarPos)||(this.scroll.verticalBarPos=0),this.table.scenegraph.setY(-t);const d=t/(l-this.table.scenegraph.height);this.table.scenegraph.component.updateVerticalScrollBarPos(d),h!==t&&n&&(this.table.fireListeners(at.SCROLL,{event:e==null?void 0:e.nativeEvent,scrollTop:this.scroll.verticalBarPos,scrollLeft:this.scroll.horizontalBarPos,scrollHeight:(r=this.table.theme.scrollStyle)===null||r===void 0?void 0:r.width,scrollWidth:(s=this.table.theme.scrollStyle)===null||s===void 0?void 0:s.width,viewHeight:this.table.tableNoFrameHeight,viewWidth:this.table.tableNoFrameWidth,scrollDirection:"vertical",scrollRatioY:d}),this.checkVerticalScrollBarEnd())}setScrollLeft(t,e,n=!0){var o,r,s;this.table.scrollLeft;const l=this.table.getAllColsWidth(),a=(this.table.getFrozenColsWidth(),!((o=this.table.options.customConfig)===null||o===void 0)&&o._disableColumnAndRowSizeRound?1:0);t=Math.max(0,Math.min(t,l-this.table.scenegraph.width-a)),(t=Math.ceil(t))!==this.scroll.horizontalBarPos&&this.updateHoverPos(-1,-1);const h=this.scroll.horizontalBarPos;this.scroll.horizontalBarPos=t,z(this.scroll.horizontalBarPos)&&!isNaN(this.scroll.horizontalBarPos)||(this.scroll.horizontalBarPos=0),this.table.scenegraph.setX(-t);const d=t/(l-this.table.scenegraph.width);this.table.scenegraph.component.updateHorizontalScrollBarPos(d),h!==t&&n&&(this.table.fireListeners(at.SCROLL,{event:e==null?void 0:e.nativeEvent,scrollTop:this.scroll.verticalBarPos,scrollLeft:this.scroll.horizontalBarPos,scrollHeight:(r=this.table.theme.scrollStyle)===null||r===void 0?void 0:r.width,scrollWidth:(s=this.table.theme.scrollStyle)===null||s===void 0?void 0:s.width,viewHeight:this.table.tableNoFrameHeight,viewWidth:this.table.tableNoFrameWidth,scrollDirection:"horizontal",scrollRatioX:d}),this.checkHorizontalScrollBarEnd())}hideVerticalScrollBar(){this.table.scenegraph.component.hideVerticalScrollBar()}showVerticalScrollBar(t){this.table.scenegraph.component.showVerticalScrollBar(),t&&(clearTimeout(this._clearVerticalScrollBar),this._clearVerticalScrollBar=setTimeout(()=>{var e;(e=this.table.scenegraph)===null||e===void 0||e.component.hideVerticalScrollBar()},1e3))}hideHorizontalScrollBar(){this.table.scenegraph.component.hideHorizontalScrollBar()}showHorizontalScrollBar(t){this.table.scenegraph.component.showHorizontalScrollBar(),t&&(clearTimeout(this._clearHorizontalScrollBar),this._clearHorizontalScrollBar=setTimeout(()=>{var e;(e=this.table.scenegraph)===null||e===void 0||e.component.hideHorizontalScrollBar()},1e3))}triggerContextMenu(t,e,n,o){this.menu.isShow&&this.menu.x===n&&this.menu.y===o?this.hideMenu():this.showContextMenu(t,e,n,o)}showContextMenu(t,e,n,o){var r;!((r=this.table.internalProps.menu)===null||r===void 0)&&r.contextMenuItems&&(this.table.internalProps.menu.renderMode==="html"?this.menu.isShow=!0:(this.menu.isShow=!0,this.menu.x=n,this.menu.y=o,this.table.scenegraph.component.menu.attach(n,o,t,e,bn.contextmenu)),this.table.fireListeners(at.SHOW_MENU,{x:n,y:o,col:t,row:e,type:"contextmenu"}))}triggerDropDownMenu(t,e,n,o,r){this.table.fireListeners(at.DROPDOWN_ICON_CLICK,{col:t,row:e,event:r}),this.menu.isShow?this.hideMenu():this.showDropDownMenu(t,e,n,o)}showDropDownMenu(t,e,n,o){this.table.internalProps.menu.renderMode==="html"?this.menu.isShow=!0:(this.menu.isShow=!0,this.table.scenegraph.component.menu.attach(n,o,t,e,bn.dropDown),this.menu.bounds=this.table.scenegraph.component.menu.bounds),this.table.fireListeners(at.SHOW_MENU,{x:n,y:o,col:t,row:e,type:"dropDown"}),this.residentHoverIcon&&this.table.scenegraph.setIconNormalStyle(this.residentHoverIcon.icon,this.residentHoverIcon.col,this.residentHoverIcon.row);const r=this.table.scenegraph.getCell(t,e);let s;r.forEachChildren(l=>l.attribute.funcType===ve.dropDown&&(s=l,!0)),s&&(this.residentHoverIcon={col:t,row:e,icon:s},this.table.scenegraph.setIconHoverStyle(this.residentHoverIcon.icon,this.residentHoverIcon.col,this.residentHoverIcon.row,r),this.table.scenegraph.residentHoverIcon(t,e))}hideMenu(){this.menu.isShow&&(this.table.fireListeners(at.DROPDOWN_MENU_CLEAR,null),this.table.fireListeners(at.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:n,row:o}=t[e],r=this.table.getCellRange(n,o);if(r)for(let s=r.start.col;s<=r.end.col;s++)for(let l=r.start.row;l<=r.end.row;l++)this.table.scenegraph.updateCellContent(s,l)}}dropDownMenuIsHighlight(t,e,n){const o=this.menu.dropDownMenuHighlight;if(Array.isArray(o))for(let r=0;r<o.length;r++){const s=o[r];let{col:l,row:a}=s;const{field:h,menuKey:d}=s;if(typeof l!="number"||typeof a!="number")if(this.table.isPivotTable()){const u=this.table.internalProps.layoutMap.getPivotCellAdress(h);if(!u)continue;l=u.col,a=u.row}else{const u=this.table.internalProps.layoutMap.getHeaderCellAddressByField(h);if(!u)continue;l=u.col,a=u.row}if(z(l)&&z(a)&&this.table.isCellRangeEqual(t,e,l,a)){const u=this.table._getHeaderLayoutMap(l??t,a??e).dropDownMenu||this.table.globalDropDownMenu;if(u)for(let c=0;c<u.length;c++){const g=u[c];if(ge(g)&&(g.menuKey||g.text)===(d||"")&&c===n||ce(g)&&g===d&&c===n)return!0}}}return!1}triggerSort(t,e,n,o){if(this.table.isPivotTable()){const c=this.table.getPivotSortState(t,e),g=c?c.toUpperCase():"NORMAL",f=g==="ASC"?"DESC":g==="DESC"?"NORMAL":"ASC";return this.table.sort(t,e,f),void this.table.fireListeners(rr.PIVOT_SORT_CLICK,{col:t,row:e,order:g||"normal",dimensionInfo:this.table.internalProps.layoutMap.getPivotDimensionInfo(t,e),cellLocation:this.table.getCellLocation(t,e),event:o})}const r=[...this.sort],s=this.table.internalProps.multipleSort||!r.length?null:this.sort[this.sort.length-1];l5(t,e,this.table,o);const l=this.table.getCellRange(t,e),a=this.sort.find(c=>c.col===l.start.col&&c.row===l.start.row),h=this.table.internalProps.multipleSort||!s?null:s.col,d=this.table.internalProps.multipleSort||!s?null:s.row,u=r.findIndex(c=>c.col===t&&c.row===e);u>=0&&r.splice(u,1),this.table.scenegraph.updateSortIcon({col:t,row:e,iconMark:n,order:a==null?void 0:a.order,oldSortCol:h,oldSortRow:d,oldIconMark:s==null?void 0:s.icon}),a&&(a.icon=n),this.table.internalProps.multipleSort||r.forEach(c=>{this.table.scenegraph.updateSortIcon({col:null,row:null,iconMark:null,order:"normal",oldSortCol:c.col,oldSortRow:c.row,oldIconMark:null})}),this.table.fireListeners(rr.AFTER_SORT,{order:a==null?void 0:a.order,field:this.table.getHeaderField(t,e),event:o})}updateSortState(t){var e,n,o,r,s,l,a,h;t=Array.isArray(t)?t:[t];for(let u=0;u<t.length;u++){if(t[u].field===((e=this.sort[u])===null||e===void 0?void 0:e.field)&&t[t.length-1].order===((n=this.sort[u])===null||n===void 0?void 0:n.order))return;const c=this.table.internalProps.multipleSort?null:((o=this.sort[u])===null||o===void 0?void 0:o.col)||null,g=this.table.internalProps.multipleSort?null:((r=this.sort[u])===null||r===void 0?void 0:r.row)||null;((s=this.sort[u])===null||s===void 0?void 0:s.order)==="asc"||(l=this.sort[u])===null||l===void 0||l.order,this.setSortState(t.slice(0,u+1));const f=this.table.internalProps.layoutMap.getHeaderCellAddressByField(t[u].field);this.sort[u].col=f.col,this.sort[u].row=f.row;const p=this.table.scenegraph.getCell(this.sort[u].col,this.sort[u].row);let m;am(p,"children",b=>b.attribute.funcType==="sort"&&(m=b,!0)),this.table.scenegraph.updateSortIcon({col:this.sort[u].col,row:this.sort[u].row,iconMark:m,order:this.sort[u].order,oldSortCol:c,oldSortRow:g,oldIconMark:(a=this.sort[u])===null||a===void 0?void 0:a.icon})}const d=[];this.table.internalProps.layoutMap.columnTree.tree.children.forEach(u=>{t.some(c=>c.field===u.field)||d.push(u)});for(let u=0;u<d.length;u++){const c=d[u];this.table.scenegraph.updateSortIcon({col:null,row:null,iconMark:null,order:null,oldSortCol:(h=c.startInTotal+this.table.internalProps.layoutMap.leftRowSeriesNumberColumnCount)!==null&&h!==void 0?h:0,oldSortRow:c.level,oldIconMark:null})}}triggerFreeze(t,e,n){if(!this.table.isPivotTable()&&!this.table.transpose){if(s5(t,e,this.table),this.table.hasListeners(rr.FREEZE_CLICK)){const o=this.table.internalProps.layoutMap.columnObjects.slice(0,t+1);this.table.fireListeners(rr.FREEZE_CLICK,{col:t,row:e,fields:o.reduce((r,s)=>r.concat(s.field),[]),colCount:this.table.frozenColCount})}this.frozen.icon=n}}updateCursor(t="default"){this.table.getElement().style.cursor=t}updateDrillState(t,e,n,o,r,s){this.drill.dimensionKey=t,this.drill.title=e,this.drill.drillDown=n,this.drill.drillUp=o,this.drill.col=r,this.drill.row=s,u5(r,s,n,o,this.table)}updateSparklineHoverPose(t,e,n,o){this.sparkLine.col!==-1&&this.sparkLine.row!==-1&&c5(this.sparkLine.col,this.sparkLine.row,this.table);let r=!1;t!==-1&&e!==-1&&(r=g5(t,e,n,o,this.table)),r?(this.sparkLine.col=t,this.sparkLine.row=e):(this.sparkLine.col=-1,this.sparkLine.row=-1)}setCheckedState(t,e,n,o){return T5(t,e,n,o,this)}setHeaderCheckedState(t,e){return M5(t,e,this)}syncCheckedState(t,e,n,o){return B5(t,e,n,o,this)}initCheckedState(t){return P5(t,this)}updateHeaderCheckedState(t,e,n){return H5(t,this,e,n)}initLeftRecordsCheckState(t){return E5(t,this)}setRadioState(t,e,n,o,r){w5(t,e,n,o,r,this)}syncRadioState(t,e,n,o,r,s){return x5(t,e,n,o,r,s,this)}changeCheckboxAndRadioOrder(t,e){this.checkedState.length&&k5(t,e,this),this.radioState.length&&A5(t,e,this)}setCustomSelectRanges(t){W5(this),N5(t,this)}}function j5(i){oe.mode==="browser"&&i.on(at.CLICK_CELL,t=>{const{col:e,row:n}=t;if(t.target.type==="image"&&t.target.role&&t.target.role.startsWith("icon"))return;let o;o=i.internalProps.layoutMap.isHeader(e,n)?i.isPivotTable()?i._getHeaderLayoutMap(e,n).headerType:i.getHeaderDefine(e,n).headerType:i.getBodyColumnType(e,n);const r=i.isHeader(e,n)?i.getHeaderDefine(e,n):i.getBodyColumnDefine(e,n),s=i.getCellValue(e,n),l=i.getCellOriginValue(e,n);if(o==="link"){if(r.linkJump===!1)return;const a=r.templateLink,h=r.linkDetect!==!1;let d;if(a){const g=i.getCellOriginRecord(e,n),f=Object.assign({__value:s,__dataValue:l},g),p=/\{\s*(\S+?)\s*\}/g;d=a.replace(p,(m,b)=>f[b])}else if(h){if(!um.test(s))return;d=s}else d=s;const u=r.linkTarget,c=r.linkWindowFeatures;window.open(d,u,c)}else if(o==="image"){const{clickToPreview:a}=r;if(a===!1)return;const h=document.createElement("div");h.style.width="100%",h.style.height="100%",h.style.position="absolute",h.style.top="0",h.style.left="0",h.style.backgroundColor="rgba(30, 30, 30, 0.4)",h.style.display="flex",h.style.justifyContent="center",h.style.alignItems="center",h.style.overflow="hidden",h.style.zIndex="9999",h.addEventListener("click",u=>{u.target===h&&document.body.removeChild(h)});const d=new Image;d.src=s,d.style.maxWidth="80%",d.style.maxHeight="80%",h.appendChild(d),document.body.appendChild(h)}else if(o==="video"){const{clickToPreview:a}=r;if(a===!1)return;const h=document.createElement("div");h.style.width="100%",h.style.height="100%",h.style.position="absolute",h.style.top="0",h.style.left="0",h.style.backgroundColor="rgba(30, 30, 30, 0.4)",h.style.display="flex",h.style.justifyContent="center",h.style.alignItems="center",h.style.overflow="hidden",h.style.zIndex="9999",h.addEventListener("click",u=>{u.target===h&&document.body.removeChild(h)});const d=document.createElement("video");d.src=s,d.style.maxWidth="80%",d.style.maxHeight="80%",d.setAttribute("preload","auto"),d.setAttribute("controls","true"),h.appendChild(d),document.body.appendChild(h)}})}function $5(i){i.on(at.MOUSEENTER_CELL,t=>{const{col:e,row:n}=t;if(e===-1||n===-1)return;const o=i.internalProps.layoutMap.getHeaderDimension(e,n);o!=null&&o.drillDown||o!=null&&o.drillUp?i.stateManager.updateDrillState(o.dimensionKey,o.title,o.drillDown,o.drillUp,e,n):i.stateManager.updateDrillState(void 0,void 0,!1,!1,-1,-1)}),i.on(at.MOUSELEAVE_TABLE,t=>{i.stateManager.updateDrillState(void 0,void 0,!1,!1,-1,-1)})}function G5(i){i.fireListeners(rr.DRILLMENU_CLICK,i.stateManager.drill)}function U5(i){const t=i.internalProps.layoutMap.rowsDefine,e=i.internalProps.layoutMap.columnsDefine;for(let n=0;n<t.length;n++){const o=t[n];if(typeof o!="string"&&(o.drillDown||o.drillUp))return!0}for(let n=0;n<e.length;n++){const o=e[n];if(typeof o!="string"&&(o.drillDown||o.drillUp))return!0}return!1}function TA(i){if(i.eventManager.bindSparklineHoverEvent)return;let t=!1;i.isPivotTable()?t=i.internalProps.layoutMap.indicatorsDefine.some(e=>typeof e!="string"&&e.cellType==="sparkline"):t=i.internalProps.layoutMap.columnObjects.some(e=>e.cellType==="sparkline"||typeof e.cellType=="function"),t&&(i.eventManager.bindSparklineHoverEvent=!0,i.on(at.MOUSEMOVE_CELL,e=>{const{col:n,row:o,x:r,y:s}=e;i.getBodyColumnType(n,o)!=="sparkline"&&i.stateManager.updateSparklineHoverPose(-1,-1,0,0),i.stateManager.updateSparklineHoverPose(n,o,r,s)}),i.on(at.MOUSELEAVE_TABLE,e=>{i.stateManager.updateSparklineHoverPose(-1,-1,0,0)}))}function ug(i,t,e=!0){var n;let{deltaX:o,deltaY:r}=i;i.shiftKey&&i.deltaY&&(o=r,r=0);const[s,l]=K5(o,r,{horizontal:1,vertical:1});(s||l)&&t.interactionState!==$t.scrolling&&t.updateInteractionState($t.scrolling),s&&(t.setScrollLeft(t.scroll.horizontalBarPos+s,i),t.showHorizontalScrollBar(!0)),l&&(t.setScrollTop(t.scroll.verticalBarPos+l,i),t.showVerticalScrollBar(!0)),e&&t.resetInteractionState(t.interactionStateBeforeScroll),!((n=i.nativeEvent)===null||n===void 0)&&n.cancelable&&(t.table.internalProps.overscrollBehavior==="none"||Math.abs(r)>=Math.abs(o)&&r!==0&&MA(r,t)||Math.abs(r)<=Math.abs(o)&&o!==0&&BA(o,t))&&i.nativeEvent.preventDefault()}function K5(i,t,e){var n,o;const r=Math.abs(i/t),s=r<=.5?0:i,l=r>2?0:t;return[Math.ceil(s*((n=e.horizontal)!==null&&n!==void 0?n:0)),Math.ceil(l*((o=e.vertical)!==null&&o!==void 0?o:0))]}function MA(i,t){return t.table.getAllRowsHeight()-t.table.scenegraph.height!=0&&!Y5(i,t)&&!X5(i,t)}function BA(i,t){return t.table.getAllColsWidth()-t.table.scenegraph.width!=0&&!q5(i,t)&&!Z5(i,t)}function Y5(i,t){return t.table.getAllRowsHeight()-t.table.scenegraph.height!==0&&i<=0&&t.scroll.verticalBarPos<1}function X5(i,t){var e;const n=!((e=t.table.options.customConfig)===null||e===void 0)&&e._disableColumnAndRowSizeRound?1:0,o=t.table.getAllRowsHeight()-t.table.scenegraph.height;return o!==0&&i>=0&&Math.abs(t.scroll.verticalBarPos-o)<1+n}function q5(i,t){return t.table.getAllColsWidth()-t.table.scenegraph.width!==0&&i<=0&&t.scroll.horizontalBarPos<1}function Z5(i,t){var e;const n=!((e=t.table.options.customConfig)===null||e===void 0)&&e._disableColumnAndRowSizeRound?1:0,o=t.table.getAllColsWidth()-t.table.scenegraph.width;return o!==0&&i>=0&&Math.abs(t.scroll.horizontalBarPos-o)<1+n}class J5{constructor(t){this.stateManager=t}setScrollHandle(t){this.scrollHandle=t}startInertia(t,e,n){this.lastTime=Date.now(),this.speedX=t,this.speedY=e,this.friction=n,this.runingId||(this.runingId=requestAnimationFrame(this.inertia.bind(this)))}inertia(){var t;const e=Date.now(),n=e-this.lastTime;let o=!0;const r=Math.pow(this.friction,n/16),s=r*this.speedX,l=r*this.speedY;let a=0,h=0;Math.abs(s)>.05&&(o=!1,a=(this.speedX+s)/2*n),Math.abs(l)>.05&&(o=!1,h=(this.speedY+l)/2*n),(t=this.scrollHandle)===null||t===void 0||t.call(this,a,h),o?this.runingId=null:(this.lastTime=e,this.speedX=s,this.speedY=l,this.runingId=requestAnimationFrame(this.inertia.bind(this)))}endInertia(){cancelAnimationFrame(this.runingId),this.runingId=null}isInertiaScrolling(){return!!this.runingId}}function ev(i,t,e){var n,o,r,s;t&&((n=i.stateManager.columnMove)===null||n===void 0?void 0:n.colSource)!==-1&&((o=i.stateManager.columnMove)===null||o===void 0?void 0:o.rowSource)!==-1&&((r=i.stateManager.columnMove)===null||r===void 0?void 0:r.colTarget)!==-1&&((s=i.stateManager.columnMove)===null||s===void 0?void 0:s.rowTarget)!==-1?i.hasListeners(at.CHANGE_HEADER_POSITION)&&i.fireListeners(at.CHANGE_HEADER_POSITION,{target:{col:i.stateManager.columnMove.colTarget,row:i.stateManager.columnMove.rowTarget},source:{col:i.stateManager.columnMove.colSource,row:i.stateManager.columnMove.rowSource},event:e}):t||i.hasListeners(at.CHANGE_HEADER_POSITION_FAIL)&&i.fireListeners(at.CHANGE_HEADER_POSITION_FAIL,{target:{col:i.stateManager.columnMove.colTarget,row:i.stateManager.columnMove.rowTarget},source:{col:i.stateManager.columnMove.colSource,row:i.stateManager.columnMove.rowSource},event:e})}function Q5(i){const t=i.table,e=t.stateManager;t.scenegraph.tableGroup.addEventListener("pointermove",r=>{var s,l,a,h,d,u,c,g,f,p,m,b,C,_,w,y,S,A,R;const x=(l=(s=t.eventManager.LastPointerXY)===null||s===void 0?void 0:s.x)!==null&&l!==void 0?l:r.x,T=(h=(a=t.eventManager.LastPointerXY)===null||a===void 0?void 0:a.y)!==null&&h!==void 0?h:r.y;t.eventManager.LastPointerXY={x:r.x,y:r.y},i.touchSetTimeout&&(clearTimeout(i.touchSetTimeout),i.touchSetTimeout=void 0);const M=Ai(r);if(M.eventArgs&&t.hasListeners(at.MOUSEMOVE_TABLE)&&t.fireListeners(at.MOUSEMOVE_TABLE,{col:M.eventArgs.col,row:M.eventArgs.row,x:M.abstractPos.x,y:M.abstractPos.y,event:r.nativeEvent,target:(d=M==null?void 0:M.eventArgs)===null||d===void 0?void 0:d.target,mergeCellInfo:(u=M.eventArgs)===null||u===void 0?void 0:u.mergeInfo}),e.interactionState===$t.grabing&&!(!((c=t.editorManager)===null||c===void 0)&&c.editingEditor))return void(Math.abs(x-r.x)+Math.abs(T-r.y)>=1&&(e.isResizeCol()||(e.isMoveCol()?i.dealColumnMover(M):e.isFillHandle()?i.dealFillSelect(M,!0):((g=t.options.select)===null||g===void 0?void 0:g.disableDragSelect)||i.dealTableSelect(M,!0))));!(!((f=t.options.select)===null||f===void 0)&&f.disableDragSelect)&&t.eventManager.isDraging&&e.isSelecting()&&!(!((p=t.editorManager)===null||p===void 0)&&p.editingEditor)&&i.dealTableSelect(M,!0);const B=r.path.find(P=>P.role==="cell");if(t.hasListeners(at.MOUSELEAVE_CELL)&&(t.stateManager.hover.cellPos.col===-1||t.stateManager.hover.cellPos.row===-1||(B==null?void 0:B.col)===t.stateManager.hover.cellPos.col&&(B==null?void 0:B.row)===t.stateManager.hover.cellPos.row||t.fireListeners(at.MOUSELEAVE_CELL,{col:t.stateManager.hover.cellPos.col,row:t.stateManager.hover.cellPos.row,cellRange:t.getCellRangeRelativeRect({col:t.stateManager.hover.cellPos.col,row:t.stateManager.hover.cellPos.row}),scaleRatio:t.canvas.getBoundingClientRect().width/t.canvas.offsetWidth,event:r.nativeEvent,target:(m=M==null?void 0:M.eventArgs)===null||m===void 0?void 0:m.target})),t.hasListeners(at.MOUSEENTER_CELL)&&((B==null?void 0:B.role)!=="cell"||!z(B.col)||!z(B.row)||B.col===t.stateManager.hover.cellPos.col&&B.row===t.stateManager.hover.cellPos.row||B.col===((b=t.stateManager.hover.cellPosContainHeader)===null||b===void 0?void 0:b.col)&&B.row===((C=t.stateManager.hover.cellPosContainHeader)===null||C===void 0?void 0:C.row)||t.fireListeners(at.MOUSEENTER_CELL,{col:B.col,row:B.row,cellRange:t.getCellRangeRelativeRect({col:B.col,row:B.row}),scaleRatio:t.canvas.getBoundingClientRect().width/t.canvas.offsetWidth,event:r.nativeEvent,target:(_=M==null?void 0:M.eventArgs)===null||_===void 0?void 0:_.target,mergeCellInfo:(w=M.eventArgs)===null||w===void 0?void 0:w.mergeInfo})),i.dealIconHover(M),i.dealTableHover(M),M.eventArgs&&t.hasListeners(at.MOUSEMOVE_CELL)){let P,F;if(!((y=M.eventArgs)===null||y===void 0)&&y.target){const H=Mh((S=M.eventArgs)===null||S===void 0?void 0:S.target);H&&(P=H.icon,F=H.position)}t.fireListeners(at.MOUSEMOVE_CELL,{col:M.eventArgs.col,row:M.eventArgs.row,x:M.abstractPos.x,y:M.abstractPos.y,event:r.nativeEvent,targetIcon:P?{name:P.name,position:F,funcType:P.attribute.funcType}:void 0,target:(A=M==null?void 0:M.eventArgs)===null||A===void 0?void 0:A.target,mergeCellInfo:(R=M.eventArgs)===null||R===void 0?void 0:R.mergeInfo})}}),t.scenegraph.tableGroup.addEventListener("pointerout",r=>{var s;const l=Ai(r),a=(s=l==null?void 0:l.eventArgs)===null||s===void 0?void 0:s.target;(a==null?void 0:a.role)==="table"&&i.dealTableHover()}),t.scenegraph.tableGroup.addEventListener("pointerover",r=>{var s,l;const a=Ai(r),h=(s=a==null?void 0:a.eventArgs)===null||s===void 0?void 0:s.target;if(h&&t.hasListeners(at.MOUSEOVER_CHART_SYMBOL)&&h.type==="symbol"){const d=r.composedPath().find(u=>u.roll==="cell");if(d){const{col:u,row:c}=d,g={col:u,row:c,field:t.getHeaderField(u,c),value:t.getCellValue(u,c),dataValue:t.getCellOriginValue(u,c),cellHeaderPaths:t.internalProps.layoutMap.getCellHeaderPaths(u,c),title:t.getBodyColumnDefine(u,c).title,cellRange:t.getCellRelativeRect(u,c),event:r.nativeEvent,sparkline:{pointData:void 0},scaleRatio:t.canvas.getBoundingClientRect().width/t.canvas.offsetWidth,target:(l=a==null?void 0:a.eventArgs)===null||l===void 0?void 0:l.target};t.fireListeners(at.MOUSEOVER_CHART_SYMBOL,g)}}}),t.scenegraph.tableGroup.addEventListener("pointerenter",r=>{(t.theme.scrollStyle.horizontalVisible&&t.theme.scrollStyle.horizontalVisible==="focus"||!t.theme.scrollStyle.horizontalVisible&&t.theme.scrollStyle.visible==="focus")&&e.showHorizontalScrollBar(),(t.theme.scrollStyle.verticalVisible&&t.theme.scrollStyle.verticalVisible==="focus"||!t.theme.scrollStyle.verticalVisible&&t.theme.scrollStyle.visible==="focus")&&e.showVerticalScrollBar(),t.hasListeners(at.MOUSEENTER_TABLE)&&t.fireListeners(at.MOUSEENTER_TABLE,{event:r.nativeEvent})}),t.scenegraph.tableGroup.addEventListener("pointerleave",r=>{e.isResizeCol()||e.isMoveCol()||e.isSelecting()||(e.updateInteractionState($t.default),e.updateCursor()),(t.theme.scrollStyle.horizontalVisible&&t.theme.scrollStyle.horizontalVisible==="focus"||!t.theme.scrollStyle.horizontalVisible&&t.theme.scrollStyle.visible==="focus")&&e.hideHorizontalScrollBar(),(t.theme.scrollStyle.verticalVisible&&t.theme.scrollStyle.verticalVisible==="focus"||!t.theme.scrollStyle.verticalVisible&&t.theme.scrollStyle.visible==="focus")&&e.hideVerticalScrollBar(),t.hasListeners(at.MOUSELEAVE_CELL)&&t.stateManager.hover.cellPos.col!==-1&&t.stateManager.hover.cellPos.row!==-1&&t.fireListeners(at.MOUSELEAVE_CELL,{col:t.stateManager.hover.cellPos.col,row:t.stateManager.hover.cellPos.row,cellRange:t.getCellRangeRelativeRect({col:t.stateManager.hover.cellPos.col,row:t.stateManager.hover.cellPos.row}),scaleRatio:t.canvas.getBoundingClientRect().width/t.canvas.offsetWidth,event:r.nativeEvent,target:void 0}),i.dealTableHover();const s=r.target;s&&!s.isDescendantsOf(t.scenegraph.tableGroup)&&t.fireListeners(at.MOUSELEAVE_TABLE,{event:r.nativeEvent})});const n=r=>{var s;const l=r.target;if(!t.getElement().contains(l)){const a=(s=t.editorManager)===null||s===void 0?void 0:s.completeEdit(r);fc(a,h=>{h!==!1&&(e.updateInteractionState($t.default),i.dealTableHover())})}},o=r=>{var s;const l=r.target;if(!t.getElement().contains(l)){const a=(s=t.editorManager)===null||s===void 0?void 0:s.completeEdit(r);fc(a,h=>{var d,u;if(h!==!1&&(!((d=t.options.select)===null||d===void 0)&&d.outsideClickDeselect)){const c=!!(!((u=e.select.ranges)===null||u===void 0)&&u.length);i.dealTableSelect(),e.endSelectCells(!0,c)}})}};i.globalEventListeners.push({name:"pointerup",env:"document",callback:n}),i.globalEventListeners.push({name:"pointerdown",env:"document",callback:o}),Ke.addEventListener("pointerup",n),Ke.addEventListener("pointerdown",o),t.scenegraph.tableGroup.addEventListener("pointerdown",r=>{var s,l,a,h,d;if(t.hasListeners(at.MOUSEDOWN_TABLE)&&t.fireListeners(at.MOUSEDOWN_TABLE,{event:r.nativeEvent}),t.eventManager.isDown=!0,t.eventManager.LastBodyPointerXY={x:r.x,y:r.y},t.eventManager.LastPointerXY={x:r.x,y:r.y},r.button!==0)return;const u=Ai(r);if(i.downIcon=void 0,e.interactionState!==$t.default||(t.isPivotChart()&&((s=u==null?void 0:u.eventArgs)===null||s===void 0?void 0:s.target.type)!=="chart"&&t.scenegraph.updateChartState(null),((l=u.eventArgs)===null||l===void 0?void 0:l.target)!==((a=e.residentHoverIcon)===null||a===void 0?void 0:a.icon)&&e.hideMenu(),((h=u==null?void 0:u.eventArgs)===null||h===void 0?void 0:h.target.type)==="chart"))return;const c=(d=t.editorManager)===null||d===void 0?void 0:d.completeEdit(r.nativeEvent);fc(c,g=>{var f,p,m,b,C,_,w;if(g===!1)return;const y=!((m=(p=(f=u==null?void 0:u.eventArgs)===null||f===void 0?void 0:f.target)===null||p===void 0?void 0:p.role)===null||m===void 0)&&m.startsWith("icon")?u.eventArgs.target:!((b=r.target.role)===null||b===void 0)&&b.startsWith("icon")?r.target:void 0;if(i.downIcon=y,y&&y.attribute.interactive!==!1)y.attribute.funcType===ve.dragReorder&&(e.startMoveCol(u.eventArgs.col,u.eventArgs.row,u.abstractPos.x,u.abstractPos.y,(_=(C=u.eventArgs)===null||C===void 0?void 0:C.event)===null||_===void 0?void 0:_.nativeEvent),e.updateInteractionState($t.grabing));else if(r.pointerType==="touch")i.touchEnd=!1,i.touchSetTimeout=setTimeout(()=>{i.isTouchdown=!1,i.touchMove=!0,(i.touchEnd||!i.checkColumnResize(u,!0)&&!i.checkRowResize(u,!0))&&(i.touchEnd||!i.chechColumnMover(u))?i.dealTableSelect(u)&&!i.touchEnd&&e.updateInteractionState($t.grabing):e.updateInteractionState($t.grabing)},500),i.dealTableHover(u);else{if(!i.checkCellFillhandle(u)&&(i.checkColumnResize(u,!0)||i.checkRowResize(u,!0)))return t.scenegraph.updateChartState(null),void e.updateInteractionState($t.grabing);if(i.chechColumnMover(u)||i.checkCellFillhandle(u,!0)&&i.dealFillSelect(u))return void e.updateInteractionState($t.grabing);i.dealTableSelect(u)&&e.updateInteractionState($t.grabing)}if(t.hasListeners(at.MOUSEDOWN_CELL)){const S=Ai(r);S.eventArgs&&t.fireListeners(at.MOUSEDOWN_CELL,{col:S.eventArgs.col,row:S.eventArgs.row,event:r.nativeEvent,target:(w=S==null?void 0:S.eventArgs)===null||w===void 0?void 0:w.target,mergeCellInfo:S.eventArgs.mergeInfo})}})}),t.scenegraph.tableGroup.addEventListener("pointerup",r=>{var s,l,a,h;if(r.button===0){if(e.interactionState==="grabing"){if(e.updateInteractionState($t.default),e.isResizeCol())cg(t);else if(e.isResizeRow())iv(t);else if(e.isMoveCol()){const d=t.stateManager.endMoveCol();ev(t,d,r.nativeEvent)}else if(e.isSelecting()){t.stateManager.endSelectCells(),t.stateManager.isFillHandle()&&t.stateManager.endFillSelect();const d=Ai(r);if(t.eventManager.isDraging&&d.eventArgs&&t.hasListeners(at.DRAG_SELECT_END)){const u={event:r.nativeEvent,cells:[],col:d.eventArgs.target.col,row:d.eventArgs.target.row,scaleRatio:t.canvas.getBoundingClientRect().width/t.canvas.offsetWidth,target:(s=d==null?void 0:d.eventArgs)===null||s===void 0?void 0:s.target,mergeCellInfo:(l=d.eventArgs)===null||l===void 0?void 0:l.mergeInfo};u.cells=t.getSelectedCellInfos(),t.fireListeners(at.DRAG_SELECT_END,u)}}}else e.interactionState===$t.scrolling&&e.updateInteractionState($t.default);if(t.hasListeners(at.MOUSEUP_CELL)){const d=Ai(r);d.eventArgs&&t.fireListeners(at.MOUSEUP_CELL,{col:d.eventArgs.col,row:d.eventArgs.row,event:r.nativeEvent,target:(a=d==null?void 0:d.eventArgs)===null||a===void 0?void 0:a.target,mergeCellInfo:(h=d.eventArgs)===null||h===void 0?void 0:h.mergeInfo})}}}),t.scenegraph.tableGroup.addEventListener("rightdown",r=>{var s,l,a,h;const d=Ai(r);if(d.eventArgs){e.triggerContextMenu(d.eventArgs.col,d.eventArgs.row,d.abstractPos.x,d.abstractPos.y);const{col:u,row:c}=d.eventArgs;if(t.hasListeners(at.CONTEXTMENU_CELL)){const g=t.getCellInfo(u,c);let f,p;if(!((s=d.eventArgs)===null||s===void 0)&&s.target){const b=Mh((l=d.eventArgs)===null||l===void 0?void 0:l.target);b&&(f=b.icon,p=b.position)}const m=Object.assign(Object.assign({},g),{event:r.nativeEvent,cells:[],targetIcon:f?{name:f.name,position:p,funcType:f.attribute.funcType}:void 0,target:(a=d==null?void 0:d.eventArgs)===null||a===void 0?void 0:a.target,mergeCellInfo:(h=d.eventArgs)===null||h===void 0?void 0:h.mergeInfo});f4(t.stateManager.select.ranges,u,c)?m.cells=t.getSelectedCellInfos():m.cells=[[g]],t.fireListeners(at.CONTEXTMENU_CELL,m)}}}),t.scenegraph.tableGroup.addEventListener("pointertap",r=>{var s,l,a,h,d;if(t.stateManager.columnResize.resizing)return;const u=Ai(r);if(!i.touchMove&&r.button===0&&u.eventArgs&&t.hasListeners(at.CLICK_CELL)){const{col:c,row:g}=u.eventArgs,f=t.getCellInfo(c,g);let p,m;if(!((s=u.eventArgs)===null||s===void 0)&&s.target){const C=Mh((l=u.eventArgs)===null||l===void 0?void 0:l.target);C&&(p=C.icon,m=C.position)}const b=Object.assign(Object.assign({},f),{event:r.nativeEvent,federatedEvent:r,cells:[],targetIcon:p?{name:p.name,position:m,funcType:p.attribute.funcType}:void 0,target:(a=u==null?void 0:u.eventArgs)===null||a===void 0?void 0:a.target,mergeCellInfo:(h=u.eventArgs)===null||h===void 0?void 0:h.mergeInfo});t.fireListeners(at.CLICK_CELL,b)}if(!t.stateManager.columnResize.resizing&&!t.stateManager.columnMove.moving&&(i.dealIconClick(r,u),(u==null?void 0:u.eventArgs)&&i.touchSetTimeout&&r.pointerType==="touch")){const c=Ai(r);if(i.touchSetTimeout){clearTimeout(i.touchSetTimeout);const g=!!(!((d=e.select.ranges)===null||d===void 0)&&d.length);i.dealTableSelect(c),e.endSelectCells(!0,g),i.touchSetTimeout=void 0}}}),t.scenegraph.stage.addEventListener("pointerdown",r=>{var s,l,a,h;const d=Ai(r);!((s=d.eventArgs)===null||s===void 0)&&s.target&&((l=d.eventArgs)===null||l===void 0?void 0:l.target)===((a=e.residentHoverIcon)===null||a===void 0?void 0:a.icon)||e.hideMenu();const u=(h=t.editorManager)===null||h===void 0?void 0:h.completeEdit(r.nativeEvent);fc(u,c=>{var g;if(c===!1)return;const f=!((g=r.target.role)===null||g===void 0)&&g.startsWith("icon")?r.target:void 0;if(i.downIcon=f,!(f||i.checkCellFillhandle(d)||e.columnResize.resizing||!i.checkColumnResize(d,!0))){t.scenegraph.updateChartState(null),e.updateInteractionState($t.grabing);const{eventArgs:p}=d;p!=null&&p.targetCell||t.getCellAt(d.abstractPos.x-Ax/2,d.abstractPos.y)&&t.hasListeners(at.MOUSEDOWN_TABLE)&&t.fireListeners(at.MOUSEDOWN_TABLE,{event:r.nativeEvent})}})}),t.scenegraph.stage.addEventListener("pointerup",r=>{e.interactionState==="grabing"&&(e.updateInteractionState($t.default),e.isResizeCol()&&cg(t))}),t.scenegraph.stage.addEventListener("pointertap",r=>{var s,l,a;const h=r.target;if(t.eventManager.isDraging||!h||!h.isDescendantsOf(t.scenegraph.stage)&&h.stage!==h||h.isDescendantsOf(t.scenegraph.tableGroup))t.eventManager.isDraging&&e.isSelecting()&&e.endSelectCells();else{e.updateInteractionState($t.default),i.dealTableHover();const d=!!(!((s=e.select.ranges)===null||s===void 0)&&s.length);((a=(l=t.options.select)===null||l===void 0?void 0:l.blankAreaClickDeselect)===null||a===void 0||a)&&i.dealTableSelect(),e.endSelectCells(!0,d),e.updateCursor(),t.scenegraph.updateChartState(null)}}),t.scenegraph.stage.addEventListener("pointermove",r=>{const s=Ai(r);e.isResizeCol()||i.checkColumnResize(s)?t.stateManager.select&&i.checkCellFillhandle(s)?e.updateCursor("crosshair"):e.updateCursor("col-resize"):e.isResizeRow()||i.checkRowResize(s)?t.stateManager.select&&i.checkCellFillhandle(s)?e.updateCursor("crosshair"):e.updateCursor("row-resize"):e.isMoveCol()||e.updateCursor()}),t.scenegraph.tableGroup.addEventListener("checkbox_state_change",r=>{var s,l;const a=Ai(r),{col:h,row:d}=a.eventArgs,u=t.getCellInfo(h,d),c=ui(t,h,d);if(c)for(let f=c.start.col;f<=c.end.col;f++)for(let p=c.start.row;p<=c.end.row;p++)t.scenegraph.getCell(f,p).forEachChildren(m=>{m.name==="checkbox"&&m.setAttributes({checked:r.target.attribute.checked,indeterminate:r.target.attribute.indeterminate})});const g=Object.assign(Object.assign({},u),{event:r.nativeEvent,target:(s=a==null?void 0:a.eventArgs)===null||s===void 0?void 0:s.target,mergeCellInfo:(l=a==null?void 0:a.eventArgs)===null||l===void 0?void 0:l.mergeInfo,checked:r.detail.checked});if(t.isHeader(h,d))t.stateManager.setHeaderCheckedState(u.field,r.detail.checked),t.getCellType(h,d)==="checkbox"&&t.scenegraph.updateCheckboxCellState(h,d,r.detail.checked);else if(t.stateManager.setCheckedState(h,d,u.field,r.detail.checked),t.getCellType(h,d)==="checkbox"){const f=t.stateManager.headerCheckedState[u.field],p=t.stateManager.updateHeaderCheckedState(u.field,h,d);f!==p&&t.scenegraph.updateHeaderCheckboxCellState(h,d,p)}t.fireListeners(at.CHECKBOX_STATE_CHANGE,g),t.scenegraph.updateNextFrame()}),t.scenegraph.tableGroup.addEventListener("radio_checked",r=>{var s,l,a;const h=Ai(r),{col:d,row:u,target:c}=h.eventArgs,g=t.getCellInfo(d,u),f=(s=W6.exec(c.id))===null||s===void 0?void 0:s[1],p=ui(t,d,u);if(p)for(let _=p.start.col;_<=p.end.col;_++)for(let w=p.start.row;w<=p.end.row;w++)t.scenegraph.getCell(_,w).forEachChildren(y=>{y.name==="radio"&&y.id===c.id&&y.setAttributes({checked:!0})});const m=t.getBodyColumnDefine(d,u).radioCheckType||"column";if(m==="cell")if(p)for(let _=p.start.col;_<=p.end.col;_++)for(let w=p.start.row;w<=p.end.row;w++)t.scenegraph.getCell(_,w).forEachChildren(y=>{y.name==="radio"&&y.id!==c.id&&y.setAttributes({checked:!1})});else t.scenegraph.getCell(d,u).forEachChildren(_=>{_.name==="radio"&&_.id!==c.id&&_.setAttributes({checked:!1})});else m==="column"&&t.scenegraph.getColGroup(d).forEachChildren(_=>{_.forEachChildren(w=>{w.name==="radio"&&w.id!==c.id&&w.setAttributes({checked:!1})})});const b=f?Number(f):void 0;t.stateManager.setRadioState(d,u,g.field,m,b);const C=Object.assign(Object.assign({},g),{event:r.nativeEvent,target:(l=h==null?void 0:h.eventArgs)===null||l===void 0?void 0:l.target,mergeCellInfo:(a=h==null?void 0:h.eventArgs)===null||a===void 0?void 0:a.mergeInfo,radioIndexInCell:b});t.fireListeners(at.RADIO_STATE_CHANGE,C),t.scenegraph.updateNextFrame()}),t.scenegraph.stage.addEventListener("wheel",r=>{var s;r.path.find(l=>l.role==="table")&&((s=t.editorManager)===null||s===void 0||s.completeEdit(),t.eventManager._enableTableScroll&&ug(r,e))})}function t8(i){const t=i.table;i.gesture=new KI(t.scenegraph.tableGroup,{tap:{interval:300}}),i.gesture.on("doubletap",e=>{e8(e,t)})}function cg(i){i.stateManager.endResizeCol();const t=[];for(let e=0;e<i.colCount;e++)t.push(i.getColWidth(e));i.fireListeners(at.RESIZE_COLUMN_END,{col:i.stateManager.columnResize.col,colWidths:t})}function iv(i){i.stateManager.endResizeRow(),i.fireListeners(at.RESIZE_ROW_END,{row:i.stateManager.rowResize.row,rowHeight:i.getRowHeight(i.stateManager.rowResize.row)})}function e8(i,t){var e,n,o,r,s,l;const a=Ai(i);let h=-1,d=-1;a.eventArgs&&(h=a.eventArgs.col,d=a.eventArgs.row);const u=t.getCellValue(h,d),c=(n=(e=a.eventArgs)===null||e===void 0?void 0:e.targetCell)===null||n===void 0?void 0:n.globalAABBBounds;if(c&&t.internalProps.focusControl.setFocusRect(new gs(c.x1+t.scrollLeft,c.y1+t.scrollTop,c.x2-c.x1,c.y2-c.y1),u),t.hasListeners(at.DBLCLICK_CELL)){const g=t.getCellInfo(h,d);let f,p;if(!((o=a.eventArgs)===null||o===void 0)&&o.target){const b=Mh((r=a.eventArgs)===null||r===void 0?void 0:r.target);b&&(f=b.icon,p=b.position)}const m=Object.assign(Object.assign({},g),{event:i.nativeEvent,federatedEvent:i,cells:[],targetIcon:f?{name:f.name,position:p,funcType:f.attribute.funcType}:void 0,target:(s=a==null?void 0:a.eventArgs)===null||s===void 0?void 0:s.target,mergeCellInfo:(l=a==null?void 0:a.eventArgs)===null||l===void 0?void 0:l.mergeInfo});t.fireListeners(at.DBLCLICK_CELL,m)}}function i8(i){const t=i.table,e=t.stateManager,n=t.scenegraph;n.component.vScrollBar.addEventListener("pointerover",s=>{e.showVerticalScrollBar()}),n.component.hScrollBar.addEventListener("pointerover",s=>{e.showHorizontalScrollBar()}),n.component.vScrollBar.addEventListener("pointerout",s=>{e.interactionState!==$t.scrolling&&e.hideVerticalScrollBar()}),n.component.hScrollBar.addEventListener("pointerout",s=>{e.interactionState!==$t.scrolling&&e.hideHorizontalScrollBar()}),n.component.vScrollBar.addEventListener("pointermove",s=>{n.table.stateManager.updateCursor("default"),s.stopPropagation()}),n.component.vScrollBar.addEventListener("pointerdown",s=>{s.stopPropagation(),n.table.hasListeners(at.MOUSEDOWN_TABLE)&&n.table.fireListeners(at.MOUSEDOWN_TABLE,{event:s.nativeEvent})}),n.component.vScrollBar.addEventListener("scrollDown",s=>{var l;n.table.eventManager.LastBodyPointerXY={x:s.x,y:s.y},n.table.eventManager.isDown=!0,e.interactionState!==$t.scrolling&&e.updateInteractionState($t.scrolling),n.table.stateManager.hideMenu(),(l=n.table.editorManager)===null||l===void 0||l.completeEdit(),n.table.hasListeners(at.MOUSEDOWN_TABLE)&&n.table.fireListeners(at.MOUSEDOWN_TABLE,{event:s.nativeEvent})}),n.component.vScrollBar.addEventListener("pointerup",()=>{e.fastScrolling=!1,n.table.eventManager.isDraging=!1,e.interactionState===$t.scrolling&&e.updateInteractionState($t.default)}),n.component.vScrollBar.addEventListener("pointerupoutside",()=>{e.fastScrolling=!1,e.interactionState===$t.scrolling&&e.updateInteractionState($t.default)}),n.component.vScrollBar.addEventListener("scrollUp",s=>{n.table.eventManager.isDraging=!1}),n.component.hScrollBar.addEventListener("pointermove",s=>{n.table.stateManager.updateCursor("default"),s.stopPropagation()}),n.component.hScrollBar.addEventListener("pointerdown",s=>{s.stopPropagation(),n.table.hasListeners(at.MOUSEDOWN_TABLE)&&n.table.fireListeners(at.MOUSEDOWN_TABLE,{event:s.nativeEvent})}),n.component.hScrollBar.addEventListener("scrollDown",s=>{var l;n.table.eventManager.LastBodyPointerXY={x:s.x,y:s.y},n.table.eventManager.isDown=!0,e.interactionState!==$t.scrolling&&e.updateInteractionState($t.scrolling),n.table.stateManager.hideMenu(),(l=n.table.editorManager)===null||l===void 0||l.completeEdit(),n.table.hasListeners(at.MOUSEDOWN_TABLE)&&n.table.fireListeners(at.MOUSEDOWN_TABLE,{event:s.nativeEvent})}),n.component.hScrollBar.addEventListener("pointerup",()=>{e.fastScrolling=!1,n.table.eventManager.isDraging=!1,e.interactionState===$t.scrolling&&e.updateInteractionState($t.default)}),n.component.hScrollBar.addEventListener("pointerupoutside",()=>{e.fastScrolling=!1,e.interactionState===$t.scrolling&&e.updateInteractionState($t.default)}),n.component.hScrollBar.addEventListener("scrollUp",s=>{n.table.eventManager.isDraging=!1});const o=hx(e.updateVerticalScrollBar,20),r=hx(e.updateHorizontalScrollBar,20);n.component.vScrollBar.addEventListener("scrollDrag",s=>{n.table.eventManager.isDown&&(n.table.eventManager.isDraging=!0),e.fastScrolling=!0,e.interactionState!==$t.scrolling&&e.updateInteractionState($t.scrolling);const l=s.detail.value[0]/(1-s.detail.value[1]+s.detail.value[0]);o(l,s)}),n.component.hScrollBar.addEventListener("scrollDrag",s=>{n.table.eventManager.isDown&&(n.table.eventManager.isDraging=!0),e.fastScrolling=!0,e.interactionState!==$t.scrolling&&e.updateInteractionState($t.scrolling);const l=s.detail.value[0]/(1-s.detail.value[1]+s.detail.value[0]);r(l)})}let Ss=1;function PA(){return dx?Ss=1:(Ss=Math.ceil(window.devicePixelRatio||1),Ss>1&&Ss%2!=0&&(Ss+=1)),Ss}PA();function n8(i){const t=i.table,e=t.stateManager,n=t.internalProps.handler;function o(f){var p;if(t.hasListeners(at.KEYDOWN)){const m={keyCode:(p=f.keyCode)!==null&&p!==void 0?p:f.which,code:f.code,event:f,scaleRatio:t.canvas.getBoundingClientRect().width/t.canvas.offsetWidth};t.fireListeners(at.KEYDOWN,m)}}n.on(t.getElement(),"blur",f=>{i.dealTableHover()}),n.on(t.getElement(),"keydown",f=>{var p,m,b,C,_,w,y,S,A,R,x,T,M,B,P,F,H,E,k;if(f.key==="a"&&(f.ctrlKey||f.metaKey))!((p=t.keyboardOptions)===null||p===void 0)&&p.selectAllOnCtrlA&&(f.preventDefault(),i.deelTableSelectAll());else if(e.select.cellPos.col>=0&&e.select.cellPos.row>=0&&(f.key==="ArrowUp"||f.key==="ArrowDown"||f.key==="ArrowLeft"||f.key==="ArrowRight")){if(((b=(m=t.options.keyboardOptions)===null||m===void 0?void 0:m.moveEditCellOnArrowKeys)===null||b===void 0||!b)&&(!((C=t.editorManager)===null||C===void 0)&&C.editingEditor))return;let I,L;if(f.preventDefault(),f.stopPropagation(),f.key==="ArrowUp"?f.ctrlKey||f.metaKey?(I=e.select.cellPos.col,L=0):(f.shiftKey,I=e.select.cellPos.col,L=Math.min(t.rowCount-1,Math.max(0,e.select.cellPos.row-1))):f.key==="ArrowDown"?f.ctrlKey||f.metaKey?(I=e.select.cellPos.col,L=t.rowCount-1):(f.shiftKey,I=e.select.cellPos.col,L=Math.min(t.rowCount-1,Math.max(0,e.select.cellPos.row+1))):f.key==="ArrowLeft"?f.ctrlKey||f.metaKey?(I=0,L=e.select.cellPos.row):(f.shiftKey,L=e.select.cellPos.row,I=Math.min(t.colCount-1,Math.max(0,e.select.cellPos.col-1))):f.key==="ArrowRight"&&(f.ctrlKey||f.metaKey?(I=t.colCount-1,L=e.select.cellPos.row):(f.shiftKey,L=e.select.cellPos.row,I=Math.min(t.colCount-1,Math.max(0,e.select.cellPos.col+1)))),Kc(t,I,L))return;t.selectCell(I,L,f.shiftKey),(w=(_=t.options.keyboardOptions)===null||_===void 0?void 0:_.moveEditCellOnArrowKeys)!==null&&w!==void 0&&w&&(!((y=t.editorManager)===null||y===void 0)&&y.editingEditor)&&(t.editorManager.completeEdit(),t.getElement().focus(),t.getEditor(I,L)&&t.editorManager.startEditCell(I,L))}else if(f.key==="Escape")(S=t.editorManager)===null||S===void 0||S.cancelEdit(),t.getElement().focus();else if(f.key==="Enter"){if(!((A=t.editorManager)===null||A===void 0)&&A.editingEditor){if(o(f),t.editorManager.completeEdit(),t.getElement().focus(),((R=t.options.keyboardOptions)===null||R===void 0?void 0:R.moveFocusCellOnEnter)===!0){const I=e.select.cellPos.col,L=Math.min(t.rowCount-1,Math.max(0,e.select.cellPos.row+1));if(Kc(t,I,L))return;t.selectCell(I,L,f.shiftKey)}return}if(((x=t.options.keyboardOptions)===null||x===void 0?void 0:x.moveFocusCellOnEnter)===!0){const I=e.select.cellPos.col,L=Math.min(t.rowCount-1,Math.max(0,e.select.cellPos.row+1));if(Kc(t,I,L))return;t.selectCell(I,L,f.shiftKey)}else if(((M=(T=t.options.keyboardOptions)===null||T===void 0?void 0:T.editCellOnEnter)===null||M===void 0||M)&&((P=(B=t.stateManager.select.ranges)===null||B===void 0?void 0:B.length)!==null&&P!==void 0?P:0)===1){const I=t.stateManager.select.ranges[0].start.col,L=t.stateManager.select.ranges[0].start.row,D=t.stateManager.select.ranges[0].end.col,O=t.stateManager.select.ranges[0].end.row;I===D&&L===O&&t.getEditor(I,L)&&t.editorManager.startEditCell(I,L)}}else if(f.key==="Tab"){if(((H=(F=t.options.keyboardOptions)===null||F===void 0?void 0:F.moveFocusCellOnTab)===null||H===void 0||H)&&e.select.cellPos.col>=0&&e.select.cellPos.row>=0){if(e.select.cellPos.col===t.colCount-1&&e.select.cellPos.row===t.rowCount-1)return;let I,L;if(f.preventDefault(),e.select.cellPos.col===t.colCount-1?(L=Math.min(t.rowCount-1,e.select.cellPos.row+1),I=t.rowHeaderLevelCount):(L=e.select.cellPos.row,I=e.select.cellPos.col+1),Kc(t,I,L))return;t.selectCell(I,L),!((E=t.editorManager)===null||E===void 0)&&E.editingEditor&&(t.editorManager.completeEdit(),t.getElement().focus(),t.getEditor(I,L)&&t.editorManager.startEditCell(I,L))}}else if(!(f.ctrlKey||f.metaKey||f.shiftKey)){const I=t.options.editCellTrigger;if((I==="keydown"||Array.isArray(I)&&I.includes("keydown"))&&!(!((k=t.editorManager)===null||k===void 0)&&k.editingEditor)){const L=/^[a-zA-Z0-9+\-*\/%=.,\s]$/;f.key.match(L)&&t.editorManager.startEditCell(e.select.cellPos.col,e.select.cellPos.row,"")}}o(f)}),n.on(t.getElement(),"copy",f=>{var p,m;if(!((p=t.keyboardOptions)===null||p===void 0)&&p.copySelected){const b=t.getCopyValue();if(z(b)){if(f.preventDefault(),(m=navigator.clipboard)===null||m===void 0?void 0:m.write){const C=w=>{const y=["<table>"],S=['<meta name="author" content="Visactor"/>','<style type="text/css">td{white-space:normal}br{mso-data-placement:same-cell}</style>'].join(""),A=w.split(`\r
|
|
126
|
+
`}):y==="horizontal"&&a.forEach(S=>{C+=(ge(S)?S.text:S).toString()})}else C=ge(a)?a.text:a;else C=a;const _=ph(C,n).text;if(_.length>=1&&(_.length!==1||_[0]!=="")?_.forEach(w=>{const y=n.measureText(w,{fontSize:p,fontFamily:m,fontWeight:b}).width;l=Math.max((y+f+4+d)/c,l)}):l=Math.max((f+4+d)/c,l),n.internalProps.limitMaxAutoWidth!==!1&&(l=Math.min(typeof n.internalProps.limitMaxAutoWidth=="number"?n.internalProps.limitMaxAutoWidth:450,l)),e==="checkbox"){const w=wt("size",h,i,t,n);if(l+=w,C){const y=wt("spaceBetweenTextAndIcon",h,i,t,n);l+=y}}else if(e==="radio"){const w=wt("size",h,i,t,n),y=wt("outerRadius",h,i,t,n),S=ft(y)?2*y:w,A=wt("spaceBetweenTextAndIcon",h,i,t,n);if(lt(a)){const R=n.getBodyColumnDefine(i,t),x=wt("spaceBetweenRadio",h,i,t,n),T=(s=R==null?void 0:R.radioDirectionInCell)!==null&&s!==void 0?s:"vertical";T==="vertical"?(l+=S,l+=A):T==="horizontal"&&(l+=(S+A)*a.length,l+=x*(a.length-1))}else l+=S,C&&(l+=A)}return l}function jW(i,t,e){return{left:0,top:0,right:e.getColWidth(i),bottom:e.getRowHeight(t),width:null,height:null}}function $W(i,t){const e=t.getColWidthDefined(i);return t.internalProps._widthResizedColMap.has(i)?t.getColWidth(i):e}function rg(i,t,e,n,o,r,s){var l,a,h,d;let u=0;const c=[],g=[];let f=0;for(let m=t;m<e;m++){const b=n&&(l=o[m])!==null&&l!==void 0?l:r.getColWidth(m),C=r.getMaxColWidth(m),_=r.getMinColWidth(m);b!==C&&b!==_?(u+=b,c.push(m)):i-=b,!((a=r.options.customConfig)===null||a===void 0)&&a.shrinkSparklineFirst&&r.getBodyColumnType(m,0)==="sparkline"&&(g.push({col:m,width:b}),f+=b-r.defaultColWidth)}const p=i/u;if(!((h=r.options.customConfig)===null||h===void 0)&&h.shrinkSparklineFirst&&p<1&&u-i<f)for(let m=0;m<g.length;m++){const{col:b,width:C}=g[m],_=(u-i)/g.length,w=Math.floor(C-_);n?o[b]=r._adjustColWidth(b,w):s?r.scenegraph.setColWidth(b,r._adjustColWidth(b,w)):r._setColWidth(b,r._adjustColWidth(b,w),!1,!0)}else for(let m=0;m<c.length;m++){const b=c[m];let C;C=m===c.length-1?i-c.reduce((_,w,y)=>{var S;return w!==b?_+(n?(S=o[w])!==null&&S!==void 0?S:r.getColWidth(b):r.getColWidth(w)):_},0):Math.round((n&&(d=o[b])!==null&&d!==void 0?d:r.getColWidth(b))*p),n?o[b]=r._adjustColWidth(b,C):s?r.scenegraph.setColWidth(b,r._adjustColWidth(b,C)):r._setColWidth(b,r._adjustColWidth(b,C),!1,!0)}}const sg=new de({});sg.role="empty";function lg(i,t,e,n,o,r,s,l,a){var h,d;let u,c,g,f=0;i.lastChild&&i.lastChild.row===n-1?f=i.lastChild.attribute.y+i.lastChild.attribute.height:i.colHeight&&(f=i.colHeight);for(let p=n;p<=o;p++){const m=p;let b,C,_,w,y=l.getCellLocation(t,m),S=l.getCellValue(t,m),A=e,R=l.getRowHeight(m),x=!1;if(l.internalProps.customMergeCell){const E=l.getCustomMerge(t,m);if(E){const{range:k,text:I,style:L,customLayout:D,customRender:O}=E;if(b=k,C=b.start.col!==b.end.col||b.start.row!==b.end.row,C){const N=NR(b,r,l,n>b.start.row);A=N.cellWidth,R=N.cellHeight}S=I,_=L,(D||O)&&(w=Er(D,O,k.start.col,k.start.row,l.getColsWidth(k.start.col,k.end.col),l.getRowsHeight(k.start.row,k.end.row),!1,l.isAutoRowHeight(m),[0,0,0,0],b,l)),x=!0}}let T,M=t,B=m;b&&(M=b.start.col,B=b.start.row),!l.isPivotTable()&&(y==="columnHeader"||y==="cornerHeader")&&m>=l.columnHeaderLevelCount&&(y="body"),T=!l.isPivotTable()&&l.isSeriesNumberInBody(t,m)?l.getBodyColumnDefine(M,B):y!=="body"?l.getHeaderDefine(M,B):l.getBodyColumnDefine(M,B);let P=y!=="body"||(T==null?void 0:T.dragOrder)||!!(T!=null&&T.icon)||!!(T!=null&&T.tree);if(!b&&(l.internalProps.enableTreeNodeMerge||y!=="body"||T!=null&&T.mergeCell)&&(b=l.getCellRange(t,m),C=b.start.col!==b.end.col||b.start.row!==b.end.row,C)){const E=NR(b,r,l,n>b.start.row);A=E.cellWidth,R=E.cellHeight}let F=!1;if(l.internalProps.enableTreeNodeMerge&&C){const E=l.getCellRawRecord(b.start.col,b.start.row),{vtableMergeName:k,vtableMerge:I}=E??{};F=I,I&&(P=!0,l.options.groupTitleCustomLayout&&(w=Er(l.options.groupTitleCustomLayout,void 0,b.start.col,b.start.row,l.getColsWidth(b.start.col,b.end.col),l.getRowsHeight(b.start.row,b.end.row),!1,l.isAutoRowHeight(m),[0,0,0,0],b,l))),k&&(S=k)}const H=F||x?"text":(d=l.isHeader(t,m)?(h=l._getHeaderLayoutMap(t,m).headerType)!==null&&h!==void 0?h:"text":l.getBodyColumnType(t,m))!==null&&d!==void 0?d:"text";if(so(S)){UW(t,m,0,f,A,R,i),gR(S,l,GW.bind(null,{type:H,value:S,define:T,table:l,col:t,row:m,colWidth:e,cellWidth:A,cellHeight:R,columnGroup:i,y:f,customStyle:_,mayHaveIcon:P,cellLocation:y,range:b,customResult:w,defaultRowHeight:s})),i.updateColumnRowNumber(m);const E=l.getRowHeight(m);i.updateColumnHeight(E),f+=E}else{const E=_||l._getCellStyle(b?b.start.col:t,b?b.start.row:m),k=Pr(E,l,b?b.start.col:t,b?b.start.row:m,wt).theme;k.group.cornerRadius=Rc(t,m,l),k.group.width=e,k.group.height=Array.isArray(s)?s[m]:s,k._vtable.padding&&(u=k._vtable.padding),k.text.textAlign&&(c=k.text.textAlign),k.text.textBaseline&&(g=k.text.textBaseline),y==="body"||k.group.fill||(k.group.fill="#fff");const I=Hm(H,S,T,l,t,m,e,A,R,i,f,u,c,g,P,k,b,w);if(i.updateColumnRowNumber(m),C){const L=l.getRowHeight(m),{width:D}=(l.getColWidth(t),I.attribute),{height:O}=I.attribute;I.contentWidth=D,I.contentHeight=O,mR(b,D,O,u,c,g,l),i.updateColumnHeight(L),f+=L}else i.updateColumnHeight(R),f+=R}if(a&&m>a)break}return i.setAttribute("width",e),{width:e,height:f}}function GW(i){let t,e,n;const{type:o,value:r,define:s,table:l,col:a,row:h,colWidth:d,cellWidth:u,cellHeight:c,columnGroup:g,y:f,cellLocation:p,mayHaveIcon:m,customStyle:b,range:C,customResult:_,defaultRowHeight:w}=i,y=b||l._getCellStyle(C?C.start.col:a,C?C.start.row:h),S=Pr(y,l,C?C.start.col:a,C?C.start.row:h,wt).theme;S.group.cornerRadius=Rc(a,h,l),S.group.width=d,S.group.height=Array.isArray(w)?w[h]:w,S._vtable.padding&&(t=S._vtable.padding),S.text.textAlign&&(e=S.text.textAlign),S.text.textBaseline&&(n=S.text.textBaseline),p==="body"||S.group.fill||(S.group.fill="#fff"),Hm(o,r,s,l,a,h,d,u,c,g,f,t,e,n,m,S,C,_)}function NR(i,t,e,n){let o=0,r=0;const s=t.get(`${i.start.col},${i.start.row};${i.end.col},${i.end.row}`);if(!s||n){for(let l=i.start.col;l<=i.end.col;l++)o+=e.getColWidth(l);for(let l=i.start.row;l<=i.end.row;l++)r+=e.getRowHeight(l);t.set(`${i.start.col},${i.start.row};${i.end.col},${i.end.row}`,{cellWidth:o,cellHeight:r})}else o=s.cellWidth,r=s.cellHeight;return{cellWidth:o,cellHeight:r}}function UW(i,t,e,n,o,r,s){const l=new de({x:e,y:n,width:o,height:r});l.role="cell",l.col=i,l.row=t,s.addChild(l)}function Si(i,t,e,n,o,r,s,l,a,h){if(n>o||r>s)return;const{layoutMap:d,defaultRowHeight:u,defaultHeaderRowHeight:c,defaultColWidth:g}=a.internalProps;let f=0,p=0;for(let m=n;m<=o;m++){const b=m,C=a.getColWidth(b),_=new de({x:t+f,y:e,width:C,height:0,clip:!1,pickable:!1});_.role="column",_.col=m,i.addChild(_);const{width:w,height:y}=lg(_,b,C,r,s,a.scenegraph.mergeMap,l==="columnHeader"&&ft(c)?c:u,a,h);f+=w,p=Math.max(p,y)}i.setAttribute("width",f),i.setAttribute("height",p)}function KW(i,t,e,n,o,r,s,l,a){var h,d,u,c,g,f,p,m,b,C,_,w;const{table:y}=a,{leftBottomCornerGroup:S,rightTopCornerGroup:A,rightBottomCornerGroup:R}=y.scenegraph;let x,T,M,B;a.setParamsForRow(),a.setParamsForColumn(),(y.widthMode==="adaptive"||y.options.autoWrapText&&(y.heightMode==="adaptive"||y.heightMode==="autoHeight"))&&(M=y.colCount-1),x=Math.min(a.firstScreenColLimit,y.colCount-1),y.heightMode==="adaptive"&&(B=y.rowCount-1),T=Math.min(a.firstScreenRowLimit,y.rowCount-1),y.internalProps._widthResizedColMap.size===0&&Wn(y,0,M??x),y.internalProps._heightResizedRowMap.size===0&&zn(y,0,B??T),x<y.colCount-y.rightFrozenColCount&&Wn(y,y.colCount-y.rightFrozenColCount,y.colCount-1),T<y.rowCount-y.bottomFrozenRowCount&&zn(y,y.rowCount-y.bottomFrozenRowCount,y.rowCount-1),y.scenegraph.colHeaderGroup.setAttribute("x",y.getFrozenColsWidth()),y.scenegraph.rowHeaderGroup.setAttribute("y",y.getFrozenRowsHeight()),y.scenegraph.bottomFrozenGroup.setAttribute("x",y.getFrozenColsWidth()),y.scenegraph.rightFrozenGroup.setAttribute("y",y.getFrozenRowsHeight()),y.scenegraph.bodyGroup.setAttributes({x:y.getFrozenColsWidth(),y:y.getFrozenRowsHeight()}),Si(i,s,l,0,y.frozenColCount-1,0,y.frozenRowCount-1,y.isListTable()?"columnHeader":"cornerHeader",y),x-y.rightFrozenColCount>=y.frozenColCount&&Si(t,s,l,y.frozenColCount,x-y.rightFrozenColCount,0,y.frozenRowCount-1,"columnHeader",y),y.frozenColCount>0&&(y.leftRowSeriesNumberCount>0&&Si(e,s,l,0,y.leftRowSeriesNumberCount-1,y.frozenRowCount,T-y.bottomFrozenRowCount,"rowHeader",y),y.rowHeaderLevelCount>0&&Si(e,s,l,y.leftRowSeriesNumberCount,y.leftRowSeriesNumberCount+y.rowHeaderLevelCount-1,y.frozenRowCount,T-y.bottomFrozenRowCount,"rowHeader",y),y.frozenColCount>y.rowHeaderLevelCount+y.leftRowSeriesNumberCount&&Si(e,s,l,y.rowHeaderLevelCount+y.leftRowSeriesNumberCount,y.frozenColCount-1,y.frozenRowCount,T-y.bottomFrozenRowCount,"body",y)),y.bottomFrozenRowCount>0&&(y.frozenColCount>0&&(y.leftRowSeriesNumberCount>0&&Si(S,s,l,0,y.leftRowSeriesNumberCount-1,y.rowCount-1-y.bottomFrozenRowCount+1,y.rowCount-1,"rowHeader",y),y.rowHeaderLevelCount>0&&Si(S,s,l,y.leftRowSeriesNumberCount,y.leftRowSeriesNumberCount+y.rowHeaderLevelCount-1,y.rowCount-1-y.bottomFrozenRowCount+1,y.rowCount-1,"rowHeader",y),y.frozenColCount>y.rowHeaderLevelCount+y.leftRowSeriesNumberCount&&Si(S,s,l,y.rowHeaderLevelCount+y.leftRowSeriesNumberCount,y.frozenColCount-1,y.rowCount-1-y.bottomFrozenRowCount+1,y.rowCount-1,"body",y)),x-y.rightFrozenColCount>=y.frozenColCount&&Si(o,s,l,y.frozenColCount,x-y.rightFrozenColCount,y.rowCount-1-y.bottomFrozenRowCount+1,y.rowCount-1,y.isPivotChart()?"rowHeader":"body",y)),y.rightFrozenColCount>0&&(Si(A,s,l,y.colCount-1-y.rightFrozenColCount+1,y.colCount-1,0,y.frozenRowCount-1,"columnHeader",y),Si(n,s,l,y.colCount-1-y.rightFrozenColCount+1,y.colCount-1,y.frozenRowCount,T-y.bottomFrozenRowCount,y.isPivotChart()?"rowHeader":"body",y)),y.bottomFrozenRowCount>0&&y.rightFrozenColCount>0&&Si(R,s,l,y.colCount-1-y.rightFrozenColCount+1,y.colCount-1,y.rowCount-1-y.bottomFrozenRowCount+1,y.rowCount-1,"body",y),x-y.rightFrozenColCount>=y.frozenColCount&&Si(r,s,l,y.frozenColCount,x-y.rightFrozenColCount,y.frozenRowCount,T-y.bottomFrozenRowCount,"body",y),r.firstChild||t.firstChild||i.firstChild||e.firstChild?(a.currentRow=(c=(d=(h=r.firstChild)===null||h===void 0?void 0:h.rowNumber)!==null&&d!==void 0?d:(u=e.firstChild)===null||u===void 0?void 0:u.rowNumber)!==null&&c!==void 0?c:a.totalRow,a.rowEnd=a.currentRow,a.rowUpdatePos=a.rowEnd+1,a.referenceRow=a.rowStart+Math.floor((a.rowEnd-a.rowStart)/2),a.currentCol=(w=(C=(m=(f=(g=r.lastChild)===null||g===void 0?void 0:g.col)!==null&&f!==void 0?f:(p=t.lastChild)===null||p===void 0?void 0:p.col)!==null&&m!==void 0?m:(b=e.lastChild)===null||b===void 0?void 0:b.col)!==null&&C!==void 0?C:(_=i.lastChild)===null||_===void 0?void 0:_.col)!==null&&w!==void 0?w: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))}function VR(i){let t=i.firstChild;for(;t.type!=="group";)t=t._next;return t}function jR(i){let t=i.lastChild;for(;t.type!=="group";)t=t._prev;return t}function YW(i){let t=i._prev;for(;t&&t.type!=="group";)t=t._prev;return t}function XW(i){let t=i._next;for(;t&&t.type!=="group";)t=t._next;return t}function $m(i,t,e,n="left"){for(let l=i;l<=t;l++){const a=e.scenegraph.getColGroup(l);a&&Gm(a,e,n);const h=e.scenegraph.getColGroup(l,!0);h&&Gm(h,e,n);const d=e.scenegraph.getColGroupInBottom(l);d&&Gm(d,e,n)}const o=Math.min(e.scenegraph.proxy.colLimit,e.scenegraph.proxy.bodyRightCol-e.scenegraph.proxy.bodyLeftCol+1),r=e.getColsWidth(e.frozenColCount,e.frozenColCount+o),s=e.getColsWidth(e.frozenColCount,e.colCount-1);e.scenegraph.proxy.xLimitLeft=r/2,e.scenegraph.proxy.xLimitRight=s-r/2}function Gm(i,t,e="left"){if(e==="left"){let n;const o=YW(i);n=o?o.attribute.x+t.getColWidth(i._prev.col):t.getColsWidth(t.frozenColCount,i.col-1),i.setAttribute("x",n)}else{let n;const o=XW(i);n=o?o.attribute.x-t.getColWidth(i.col):t.getColsWidth(t.frozenColCount,i.col-1),i.setAttribute("x",n)}}var $R=globalThis&&globalThis.__awaiter||function(i,t,e,n){return new(e||(e=Promise))(function(o,r){function s(h){try{a(n.next(h))}catch(d){r(d)}}function l(h){try{a(n.throw(h))}catch(d){r(d)}}function a(h){var d;h.done?o(h.value):(d=h.value,d instanceof e?d:new e(function(u){u(d)})).then(s,l)}a((n=n.apply(i,t||[])).next())})};function qW(i,t,e,n){return $R(this,void 0,void 0,function*(){if(!t)return;const o=t.col,r=t.left;let s;if(s=e?n.bodyRightCol-n.colEnd:n.screenLeftCol-n.referenceCol,ZW(s,o,r,i,n),e){const l=n.table.scenegraph.getColGroup(n.colEnd);if(l){const a=l.attribute.x+l.attribute.width-(n.table.tableNoFrameWidth-n.table.getFrozenColsWidth()-n.table.getRightFrozenColsWidth())-i;n.deltaX=-a,n.table.scenegraph.setBodyAndColHeaderX(-i+n.deltaX)}}n.table.scenegraph.updateNextFrame()})}function ZW(i,t,e,n,o){i>0?(GR(i,"left",o.screenLeftCol,e,n,o),o.updateDeltaX(n,e,t),o.table.scenegraph.setBodyAndColHeaderX(-n+o.deltaX)):i<0?(GR(-i,"right",o.screenLeftCol,e,n,o),o.updateDeltaX(n,e,t),o.table.scenegraph.setBodyAndColHeaderX(-n+o.deltaX)):(o.updateDeltaX(n,e,t),o.table.scenegraph.setBodyAndColHeaderX(-n+o.deltaX))}function GR(i,t,e,n,o,r){return $R(this,void 0,void 0,function*(){if(t==="left"&&r.colEnd+i>r.bodyRightCol?i=r.bodyRightCol-r.colEnd:t==="right"&&r.colStart-i<r.bodyLeftCol&&(i=r.colStart-r.bodyLeftCol),i!==0)if(i<0&&(t=t==="left"?"right":"left",i=-i),i<r.colEnd-r.colStart){const s=t==="left"?r.colStart:r.colEnd-i+1,l=t==="left"?r.colStart+i-1:r.colEnd,a=t==="left"?r.colEnd+1:r.colStart-i,h=t==="left"?r.colEnd+i:r.colStart-1;Wn(r.table,a,h),QW(s,l,t,r);const d=a,u=h;r.colStart=t==="left"?r.colStart+i:r.colStart-i,r.colEnd=t==="left"?r.colEnd+i:r.colEnd-i,xh(d,u,r),$m(d,u,r.table,t);const c=r.table.scenegraph.getColGroup(e)||r.table.scenegraph.getColGroup(e,!0),g=n-(c.attribute.x+r.table.getFrozenColsWidth()+r.table.scenegraph.proxy.deltaX);r.table.scenegraph.proxy.deltaX+=g,r.currentCol=t==="left"?r.currentCol+i:r.currentCol-i,r.totalCol=Math.max(0,Math.min(r.table.colCount-1,t==="left"?r.totalCol+i:r.totalCol-i)),r.referenceCol=r.colStart+Math.floor((r.colEnd-r.colStart)/2),r.colUpdatePos=a,r.colUpdateDirection=t,r.table.scenegraph.updateNextFrame()}else{const s=t==="left"?r.colStart+i:r.colStart-i,l=t==="left"?r.colEnd+i:r.colEnd-i;Wn(r.table,s,l),t5(r.table.getColsWidth(r.bodyLeftCol,s-1),i,t,r);const a=s,h=l;r.colStart=s,r.colEnd=l,xh(a,h,r),$m(a,h,r.table,l>r.bodyRightCol-(r.colEnd-r.colStart+1)?"right":"left"),r.currentCol=t==="left"?r.currentCol+i:r.currentCol-i,r.totalCol=Math.max(0,Math.min(r.table.colCount-1,t==="left"?r.totalCol+i:r.totalCol-i)),r.referenceCol=r.colStart+Math.floor((r.colEnd-r.colStart)/2),r.colUpdatePos=r.colStart,r.colUpdateDirection=l>r.bodyRightCol-(r.colEnd-r.colStart+1)?"right":"left",r.table.scenegraph.updateNextFrame()}})}function Sh(i,t,e){i.col=t,i.forEachChildren(n=>{n.col=t,n.needUpdate=!0}),i.setAttribute("x",e),i.needUpdate=!0}function ag(i,t){if(!i)return;let e=i.firstChild;for(;e;)e=t.updateCellGroupContent(e)._next;i.needUpdate=!1,i.setAttribute("width",t.table.getColWidth(i.col))}function JW(i,t){if(!i)return;const e=t.screenTopRow,n=Math.max(t.bodyTopRow,e-1*t.screenRowCount),o=Math.min(t.bodyBottomRow,e+2*t.screenRowCount,t.table.rowCount-1);for(let r=n;r<=o;r++){const s=t.highPerformanceGetCell(i.col,r,!0);t.updateCellGroupContent(s)}t.rowUpdatePos=t.rowStart,i.needUpdate=!1,i.setAttribute("width",t.table.getColWidth(i.col))}function QW(i,t,e,n){for(let o=i;o<=t;o++)n.table.scenegraph.bodyGroup.childrenCount>0&&n.table.scenegraph.bodyGroup.firstChild.type==="group"&&Um(n.table.scenegraph.bodyGroup,e,n),n.table.scenegraph.colHeaderGroup.childrenCount>0&&n.table.scenegraph.colHeaderGroup.firstChild.type==="group"&&Um(n.table.scenegraph.colHeaderGroup,e,n),n.table.scenegraph.bottomFrozenGroup.childrenCount>0&&n.table.scenegraph.bottomFrozenGroup.firstChild.type==="group"&&Um(n.table.scenegraph.bottomFrozenGroup,e,n)}function Um(i,t,e){if(t==="left"){const n=VR(i),o=jR(i);Sh(n,o.col+1,o.attribute.x+e.table.getColWidth(o.col)),i.appendChild(n),i.border&&i.appendChild(i.border)}else{const n=jR(i),o=VR(i);Sh(n,o.col-1,o.attribute.x-e.table.getColWidth(o.col-1)),i.insertBefore(n,i.firstChild)}}function xh(i,t,e){for(let n=i;n<=t;n++){const o=e.table.scenegraph.getColGroup(n,!0);o&&ag(o,e);const r=e.table.scenegraph.getColGroupInBottom(n);r&&ag(r,e);const s=e.table.scenegraph.getColGroupInRightTopCorner(n);s&&ag(s,e);const l=e.table.scenegraph.getColGroupInRightBottomCorner(n);l&&ag(l,e);const a=e.table.scenegraph.getColGroup(n);a&&JW(a,e)}e.progress()}function t5(i,t,e,n){n.table.scenegraph.colHeaderGroup.forEachChildren((o,r)=>{o.type==="group"&&Sh(o,e==="left"?o.col+t:o.col-t,r===0?i:o._prev.attribute.x+n.table.getColWidth(o._prev.col))}),n.table.scenegraph.bottomFrozenGroup.forEachChildren((o,r)=>{o.type==="group"&&Sh(o,e==="left"?o.col+t:o.col-t,r===0?i:o._prev.attribute.x+n.table.getColWidth(o._prev.col))}),n.table.scenegraph.bodyGroup.forEachChildren((o,r)=>{o.type==="group"&&Sh(o,e==="left"?o.col+t:o.col-t,r===0?i:o._prev.attribute.x+n.table.getColWidth(o._prev.col))})}function Cn(i,t,e,n,o,r="up",s){var l,a;if(r==="up")for(let c=i;c<=t;c++)for(let g=e;g<=n;g++){const f=o.scenegraph.highPerformanceGetCell(c,g,!0);if(f.role!=="cell"||!f.row)continue;let p;if(f._prev)p=((l=f._prev)===null||l===void 0?void 0:l.attribute.y)+o.getRowHeight(f._prev.row);else if(s){if(p=o.scenegraph.highPerformanceGetCell(c,n+1,!0).attribute.y,z(p))for(let m=g;m<=n;m++)p-=o.getRowHeight(m)}else p=UR(f.row,o);z(p)&&f.setAttribute("y",p)}else for(let c=i;c<=t;c++)for(let g=n;g>=e;g--){const f=o.scenegraph.highPerformanceGetCell(c,g,!0);if(f.role!=="cell"||!f.row)continue;let p;if(f._next)p=((a=f._next)===null||a===void 0?void 0:a.attribute.y)-o.getRowHeight(f.row);else if(s){p=o.scenegraph.highPerformanceGetCell(c,e-1,!0).attribute.y;for(let m=e-1;m<g;m++)p+=o.getRowHeight(m)}else p=UR(f.row,o);z(p)&&f.setAttribute("y",p)}const h=Math.min(o.scenegraph.proxy.rowLimit,o.scenegraph.proxy.bodyBottomRow-o.scenegraph.proxy.bodyTopRow+1),d=o.getRowsHeight(o.frozenRowCount,o.frozenRowCount+h),u=o.getRowsHeight(o.frozenRowCount,o.rowCount-1);o.scenegraph.proxy.yLimitTop=d/2,o.scenegraph.proxy.yLimitBottom=u-d/2}function UR(i,t){let e;return e=i<t.frozenRowCount?t.getRowsHeight(0,i-1):i>=t.rowCount-t.bottomFrozenRowCount?t.getRowsHeight(t.rowCount-t.bottomFrozenRowCount,i-1):t.getRowsHeight(t.frozenRowCount,i-1),e}var KR=globalThis&&globalThis.__awaiter||function(i,t,e,n){return new(e||(e=Promise))(function(o,r){function s(h){try{a(n.next(h))}catch(d){r(d)}}function l(h){try{a(n.throw(h))}catch(d){r(d)}}function a(h){var d;h.done?o(h.value):(d=h.value,d instanceof e?d:new e(function(u){u(d)})).then(s,l)}a((n=n.apply(i,t||[])).next())})};function e5(i,t,e,n){return KR(this,void 0,void 0,function*(){if(!t)return;const o=t.row,r=t.top;let s;if(s=e?n.bodyBottomRow-n.rowEnd:o-n.referenceRow,i5(s,o,r,i,n),e){const l=n.table.scenegraph.highPerformanceGetCell(n.colStart,n.rowEnd,!0);if(l.role==="cell"){const a=l.attribute.y+l.attribute.height-(n.table.tableNoFrameHeight-n.table.getFrozenRowsHeight()-n.table.getBottomFrozenRowsHeight())-i;n.deltaY=-a,n.updateBody(i-n.deltaY)}}})}function i5(i,t,e,n,o){i>0?(YR(i,"up",t,e,n,o),o.updateDeltaY(n,e,t),o.updateBody(n-o.deltaY)):i<0?(YR(-i,"down",t,e,n,o),o.updateDeltaY(n,e,t),o.updateBody(n-o.deltaY)):(o.updateDeltaY(n,e,t),o.updateBody(n-o.deltaY))}function YR(i,t,e,n,o,r){return KR(this,void 0,void 0,function*(){if(t==="up"&&r.rowEnd+i>r.bodyBottomRow?i=r.bodyBottomRow-r.rowEnd:t==="down"&&r.rowStart-i<r.bodyTopRow&&(i=r.rowStart-r.bodyTopRow),i!==0)if(i<0&&(t=t==="up"?"down":"up",i=-i),i<r.rowEnd-r.rowStart){const s=t==="up"?r.rowStart:r.rowEnd-i+1,l=t==="up"?r.rowStart+i-1:r.rowEnd,a=t==="up"?r.rowEnd+1:r.rowStart-i,h=t==="up"?r.rowEnd+i:r.rowStart-1;let d,u;r.table.heightMode==="autoHeight"?(d=a,u=h):(d=Math.max(r.bodyTopRow,e-1*r.screenRowCount),u=Math.min(r.bodyBottomRow,e+2*r.screenRowCount,r.table.rowCount-1)),zn(r.table,d,u,!1),n5(s,l,t,r),r.rowStart=t==="up"?r.rowStart+i:r.rowStart-i,r.rowEnd=t==="up"?r.rowEnd+i:r.rowEnd-i;const c=Rh(d,u,r,!0);r.table.heightMode==="autoHeight"&&(Cn(r.bodyLeftCol,r.bodyRightCol,d,u,r.table,h>r.bodyBottomRow-(r.rowEnd-r.rowStart+1)?"down":"up",!0),Cn(0,r.table.frozenColCount-1,d,u,r.table,h>r.bodyBottomRow-(r.rowEnd-r.rowStart+1)?"down":"up",!0),Cn(r.table.colCount-r.table.rightFrozenColCount,r.table.colCount-1,d,u,r.table,h>r.bodyBottomRow-(r.rowEnd-r.rowStart+1)?"down":"up",!0)),r.currentRow=t==="up"?r.currentRow+i:r.currentRow-i,r.totalRow=Math.max(0,Math.min(r.bodyBottomRow,t==="up"?r.totalRow+i:r.totalRow-i,r.table.rowCount-1)),r.referenceRow=r.rowStart+Math.floor((r.rowEnd-r.rowStart)/2),r.table.heightMode==="autoHeight"&&c?r.rowUpdatePos=Math.min(r.rowUpdatePos,r.rowEnd+1):r.rowUpdatePos=Math.min(r.rowUpdatePos,a),r.rowUpdateDirection=t,r.table.scenegraph.updateNextFrame(),yield r.progress()}else{const s=t==="up"?r.rowStart+i:r.rowStart-i,l=Math.min(r.table.rowCount-1,t==="up"?r.rowEnd+i:r.rowEnd-i),a=r.table.getRowsHeight(r.bodyTopRow,s-1);let h,d;r.table.heightMode==="autoHeight"?(h=s,d=l):(h=Math.max(r.bodyTopRow,e-1*r.screenRowCount),d=Math.min(r.bodyBottomRow,e+2*r.screenRowCount,r.table.rowCount-1)),zn(r.table,h,d,!1),o5(a,i,t,r),r.rowStart=s,r.rowEnd=l;const u=Rh(h,d,r,!0);r.table.heightMode==="autoHeight"&&(Cn(r.bodyLeftCol,r.bodyRightCol,h,d,r.table,l>r.bodyBottomRow-(r.rowEnd-r.rowStart+1)?"down":"up"),Cn(0,r.table.frozenColCount-1,h,d,r.table,l>r.bodyBottomRow-(r.rowEnd-r.rowStart+1)?"down":"up"),Cn(r.table.colCount-r.table.rightFrozenColCount,r.table.colCount-1,h,d,r.table,l>r.bodyBottomRow-(r.rowEnd-r.rowStart+1)?"down":"up")),r.currentRow=t==="up"?r.currentRow+i:r.currentRow-i,r.totalRow=Math.max(0,Math.min(r.bodyBottomRow,t==="up"?r.totalRow+i:r.totalRow-i,r.table.rowCount-1)),r.referenceRow=r.rowStart+Math.floor((r.rowEnd-r.rowStart)/2),r.table.heightMode==="autoHeight"&&u?r.rowUpdatePos=r.rowEnd+1:r.rowUpdatePos=r.rowStart,r.rowUpdateDirection=l>r.bodyBottomRow-(r.rowEnd-r.rowStart+1)?"down":"up",r.table.scenegraph.updateNextFrame(),yield r.progress()}})}function n5(i,t,e,n){for(let o=0;o<n.table.frozenColCount;o++){const r=n.table.scenegraph.getColGroup(o);if(r)for(let s=i;s<=t;s++)Km(r,e,n)}for(let o=n.table.colCount-n.table.rightFrozenColCount;o<n.table.colCount;o++){const r=n.table.scenegraph.getColGroup(o);if(r)for(let s=i;s<=t;s++)Km(r,e,n)}for(let o=n.bodyLeftCol;o<=n.bodyRightCol;o++){const r=n.table.scenegraph.getColGroup(o);if(r)for(let s=i;s<=t;s++)Km(r,e,n)}}function Km(i,t,e){if(i.childrenCount>=1)if(t==="up"){const n=i.firstChild;e.updateCellGroupPosition(n,i.lastChild.row+1,i.lastChild.attribute.y+e.table.getRowHeight(i.lastChild.row)),i.appendChild(n)}else{const n=i.lastChild;e.updateCellGroupPosition(n,i.firstChild.row-1,i.firstChild.attribute.y-e.table.getRowHeight(n.row)),i.insertBefore(n,i.firstChild)}}function o5(i,t,e,n){for(let o=0;o<n.table.frozenColCount;o++){const r=n.table.scenegraph.getColGroup(o);r==null||r.forEachChildren((s,l)=>{n.updateCellGroupPosition(s,e==="up"?s.row+t:s.row-t,l===0?i:s._prev.attribute.y+n.table.getRowHeight(s._prev.row))})}for(let o=n.table.colCount-n.table.rightFrozenColCount;o<n.table.colCount;o++){const r=n.table.scenegraph.getColGroup(o);r==null||r.forEachChildren((s,l)=>{n.updateCellGroupPosition(s,e==="up"?s.row+t:s.row-t,l===0?i:s._prev.attribute.y+n.table.getRowHeight(s._prev.row))})}for(let o=n.bodyLeftCol;o<=n.bodyRightCol;o++){const r=n.table.scenegraph.getColGroup(o);r==null||r.forEachChildren((s,l)=>{n.updateCellGroupPosition(s,e==="up"?s.row+t:s.row-t,l===0?i:s._prev.attribute.y+n.table.getRowHeight(s._prev.row))})}}function Rh(i,t,e,n=!1){for(let l=0;l<e.table.frozenColCount;l++)for(let a=i;a<=t;a++){const h=e.highPerformanceGetCell(l,a,!0);e.updateCellGroupContent(h)}for(let l=e.table.colCount-e.table.rightFrozenColCount;l<e.table.colCount;l++)for(let a=i;a<=t;a++){const h=e.highPerformanceGetCell(l,a);e.updateCellGroupContent(h)}let o=e.bodyLeftCol,r=e.bodyRightCol,s=!0;if(n){const l=e.screenLeftCol;o=Math.max(e.bodyLeftCol,l-1*e.screenColCount),r=Math.min(e.bodyRightCol,l+2*e.screenColCount),o===e.bodyLeftCol&&r===e.bodyRightCol||(s=!1)}for(let l=o;l<=r;l++)for(let a=i;a<=t;a++){const h=e.highPerformanceGetCell(l,a);e.updateCellGroupContent(h)}return e.table.scenegraph.updateNextFrame(),s}var r5=globalThis&&globalThis.__awaiter||function(i,t,e,n){return new(e||(e=Promise))(function(o,r){function s(h){try{a(n.next(h))}catch(d){r(d)}}function l(h){try{a(n.throw(h))}catch(d){r(d)}}function a(h){var d;h.done?o(h.value):(d=h.value,d instanceof e?d:new e(function(u){u(d)})).then(s,l)}a((n=n.apply(i,t||[])).next())})};function s5(i){var t;return r5(this,void 0,void 0,function*(){let e,n;i.table.scenegraph.bodyGroup.forEachChildren((s,l)=>{s.type==="group"&&(s.needUpdate=!0,s==null||s.forEachChildren(a=>{a.needUpdate=!0}))}),i.table.heightMode==="autoHeight"?(e=i.rowStart,n=i.rowEnd):(e=Math.max(i.bodyTopRow,i.screenTopRow-1*i.screenRowCount),n=Math.min(i.bodyBottomRow,i.screenTopRow+2*i.screenRowCount,i.table.rowCount-1));const o=i.table.getAllRowsHeight();zn(i.table,e,n);const r=i.table.getAllRowsHeight();o!==r&&i.table.scenegraph.updateContainerHeight(i.table.frozenRowCount,r-o);for(let s=0;(t=s<i.table.frozenColCount)!==null&&t!==void 0&&t;s++){const l=i.table.scenegraph.getColGroup(s);l==null||l.setAttribute("chartInstance",void 0);for(let a=i.rowStart;a<=i.rowEnd;a++)i.table.scenegraph.updateCellContent(s,a);for(let a=i.table.rowCount-i.table.bottomFrozenRowCount;a<i.table.rowCount;a++)i.table.scenegraph.updateCellContent(s,a)}for(let s=i.colStart;s<=i.colEnd;s++){const l=i.table.scenegraph.getColGroup(s);l==null||l.setAttribute("chartInstance",void 0);for(let a=i.table.rowCount-i.table.bottomFrozenRowCount;a<i.table.rowCount;a++)i.table.scenegraph.updateCellContent(s,a)}for(let s=i.table.colCount-i.table.rightFrozenColCount;s<i.table.colCount;s++){const l=i.table.scenegraph.getColGroup(s);l==null||l.setAttribute("chartInstance",void 0);for(let a=i.rowStart;a<=i.rowEnd;a++)i.table.scenegraph.updateCellContent(s,a);for(let a=i.table.rowCount-i.table.bottomFrozenRowCount;a<i.table.rowCount;a++)i.table.scenegraph.updateCellContent(s,a)}Rh(e,n,i),i.table.heightMode==="autoHeight"&&Cn(i.bodyLeftCol,i.bodyRightCol,e,n,i.table,i.rowEnd>i.bodyBottomRow-(i.rowEnd-i.rowStart+1)?"down":"up"),i.rowUpdatePos=i.rowStart,i.rowUpdateDirection=i.rowEnd>i.bodyBottomRow-(i.rowEnd-i.rowStart+1)?"down":"up",i.table.scenegraph.updateNextFrame(),i.table.heightMode!=="autoHeight"&&(yield i.progress())})}var l5=globalThis&&globalThis.__awaiter||function(i,t,e,n){return new(e||(e=Promise))(function(o,r){function s(h){try{a(n.next(h))}catch(d){r(d)}}function l(h){try{a(n.throw(h))}catch(d){r(d)}}function a(h){var d;h.done?o(h.value):(d=h.value,d instanceof e?d:new e(function(u){u(d)})).then(s,l)}a((n=n.apply(i,t||[])).next())})};function a5(i){return l5(this,void 0,void 0,function*(){i.table.scenegraph.bodyGroup.forEachChildren((n,o)=>{n.type==="group"&&(n.needUpdate=!0,n==null||n.forEachChildren(r=>{r.needUpdate=!0}))});const t=Math.max(i.bodyLeftCol,i.screenLeftCol-1*i.screenColCount),e=Math.min(i.bodyRightCol,i.screenLeftCol+2*i.screenColCount);Wn(i.table,t,e);for(let n=i.colStart;n<=i.colEnd;n++){const o=i.table.scenegraph.getColGroup(n);o==null||o.setAttribute("chartInstance",void 0);for(let r=i.table.rowCount-i.table.bottomFrozenRowCount;r<i.table.rowCount;r++)i.table.scenegraph.updateCellContent(n,r)}for(let n=i.table.colCount-i.table.rightFrozenColCount;n<i.table.colCount;n++){const o=i.table.scenegraph.getColGroup(n);o==null||o.setAttribute("chartInstance",void 0);for(let r=i.rowStart;r<=i.rowEnd;r++)i.table.scenegraph.updateCellContent(n,r);for(let r=i.table.rowCount-i.table.bottomFrozenRowCount;r<i.table.rowCount;r++)i.table.scenegraph.updateCellContent(n,r)}xh(t,e,i),i.colUpdatePos=i.colStart,i.colUpdateDirection=i.colEnd>i.bodyRightCol-(i.colEnd-i.colStart+1)?"right":"left",i.table.scenegraph.updateNextFrame(),yield i.progress()})}function Ah(i){const{changedCells:t}=i.internalProps.stick;t.forEach(f=>{i.scenegraph.getCell(f.col,f.row).forEachChildren(p=>{p.setAttributes({dx:f.dx,dy:f.dy})})}),t.clear();const{scrollTop:e,scrollLeft:n,frozenRowCount:o,frozenColCount:r}=i,s=i.getFrozenRowsHeight(),l=i.getFrozenColsWidth(),{row:a}=i.getRowAt(e+s+1),{col:h}=i.getColAt(n+l+1),d=Math.max(a,i.frozenRowCount),u=Math.max(h,i.frozenColCount),c=i.getAllRowsHeight()>i.tableNoFrameHeight?i.getRowAt(e+i.tableNoFrameHeight-i.getBottomFrozenRowsHeight()-1).row:i.rowCount-i.bottomFrozenRowCount-1,g=i.getAllColsWidth()>i.tableNoFrameWidth?i.getColAt(n+i.tableNoFrameWidth-i.getRightFrozenColsWidth()-1).col:i.colCount-i.rightFrozenColCount-1;if(!(g<0||c<0)){for(let f=0;f<o&&!(g<u);f++)[u,g].forEach(p=>{const m=i._getCellStyle(p,f);m!=null&&m.textStick&&(m==null?void 0:m.textStick)!=="vertical"&&ZR(i.scenegraph.getCell(p,f),l+i.tableX,i.tableNoFrameWidth-i.getRightFrozenColsWidth()+i.tableX,t,m==null?void 0:m.textStickBaseOnAlign,i)});for(let f=0;f<r&&!(c<d);f++)[d,c].forEach(p=>{const m=i._getCellStyle(f,p);m!=null&&m.textStick&&i.internalProps.layoutMap.rowHierarchyType!=="tree"&&(m==null?void 0:m.textStick)!=="horizontal"&&XR(i.scenegraph.getCell(f,p),s+i.tableY,i.tableNoFrameHeight-i.getBottomFrozenRowsHeight()+i.tableY,t,m==null?void 0:m.textStickBaseOnAlign,i)});for(let f=u;f<=g&&!(c<d);f++)[d,c].forEach(p=>{const m=i._getCellStyle(f,p);m!=null&&m.textStick&&(m==null?void 0:m.textStick)!=="horizontal"&&XR(i.scenegraph.getCell(f,p),s+i.tableY,i.tableNoFrameHeight-i.getBottomFrozenRowsHeight()+i.tableY,t,m==null?void 0:m.textStickBaseOnAlign,i)});for(let f=d;f<=c&&!(g<u);f++)[u,g].forEach(p=>{const m=i._getCellStyle(p,f);m!=null&&m.textStick&&(m==null?void 0:m.textStick)!=="vertical"&&ZR(i.scenegraph.getCell(p,f),l+i.tableX,i.tableNoFrameWidth-i.getRightFrozenColsWidth()+i.tableX,t,m==null?void 0:m.textStickBaseOnAlign,i)})}}function XR(i,t,e,n,o,r){if(ft(i.mergeStartCol)&&ft(i.mergeStartRow)&&ft(i.mergeEndCol)&&ft(i.mergeEndRow)){const{colStart:s,colEnd:l,rowStart:a,rowEnd:h}=kr(i,r.scenegraph);for(let d=s;d<=l;d++)for(let u=a;u<=h;u++)qR(r.scenegraph.getCell(d,u),t,e,n,o)}else qR(i,t,e,n,o)}function qR(i,t,e,n,o){var r,s,l,a,h,d,u,c,g,f,p,m,b,C,_,w,y;const S=i.getChildByName("text",!0)||i.getChildByName("image",!0);if(!S)return;if(S.type==="image"){const{image:T}=S.attribute;if(!T||!S.resources||S.resources.get(T).state!=="success")return}const A=(r=S.textBaseline)!==null&&r!==void 0?r:"top";S.AABBBounds.width();const R=S.globalAABBBounds.y1,x=S.globalAABBBounds.y2;if(A==="middle"&&o){const T=i.globalAABBBounds.y1+((l=(s=i.firstChild)===null||s===void 0?void 0:s.attribute.dy)!==null&&l!==void 0?l:0),M=T+((h=(a=i.contentHeight)!==null&&a!==void 0?a:i.attribute.height)!==null&&h!==void 0?h:0);if(T<t||M>e){const B=Math.max(T,t),P=Math.min(M,e),F=S.globalTransMatrix.f-(P+B)/2+S.AABBBounds.height()/2;!n.has(`${i.col}-${i.row}`)&&n.set(`${i.col}-${i.row}`,{col:i.col,row:i.row,dx:(u=(d=i.firstChild)===null||d===void 0?void 0:d.attribute.dx)!==null&&u!==void 0?u:0,dy:(g=(c=i.firstChild)===null||c===void 0?void 0:c.attribute.dy)!==null&&g!==void 0?g:0}),i.forEachChildren(H=>{var E;H.setAttribute("dy",((E=H.attribute.dy)!==null&&E!==void 0?E:0)-F+2)})}}else if(R<t){const T=R-t;!n.has(`${i.col}-${i.row}`)&&n.set(`${i.col}-${i.row}`,{col:i.col,row:i.row,dx:(p=(f=i.firstChild)===null||f===void 0?void 0:f.attribute.dx)!==null&&p!==void 0?p:0,dy:(b=(m=i.firstChild)===null||m===void 0?void 0:m.attribute.dy)!==null&&b!==void 0?b:0}),i.forEachChildren(M=>{var B;M.setAttribute("dy",((B=M.attribute.dy)!==null&&B!==void 0?B:0)-T+2)})}else if(x>e){const T=x-e;!n.has(`${i.col}-${i.row}`)&&n.set(`${i.col}-${i.row}`,{col:i.col,row:i.row,dx:(_=(C=i.firstChild)===null||C===void 0?void 0:C.attribute.dx)!==null&&_!==void 0?_:0,dy:(y=(w=i.firstChild)===null||w===void 0?void 0:w.attribute.dy)!==null&&y!==void 0?y:0}),i.forEachChildren(M=>{var B;M.setAttribute("dy",((B=M.attribute.dy)!==null&&B!==void 0?B:0)-T)})}}function ZR(i,t,e,n,o,r){if(ft(i.mergeStartCol)&&ft(i.mergeStartRow)&&ft(i.mergeEndCol)&&ft(i.mergeEndRow)){const{colStart:s,colEnd:l,rowStart:a,rowEnd:h}=kr(i,r.scenegraph);for(let d=s;d<=l;d++)for(let u=a;u<=h;u++)JR(r.scenegraph.getCell(d,u),t,e,n,o)}else JR(i,t,e,n,o)}function JR(i,t,e,n,o){var r,s,l,a,h,d,u,c,g,f,p,m,b,C,_,w,y,S;const A=i.getChildByName("text",!0)||i.getChildByName("image",!0);if(!A)return;if(A.type==="image"){const{image:M}=A.attribute;if(!M||!A.resources||A.resources.get(M).state!=="success")return}const R=(s=(r=A.attribute.textAlign)!==null&&r!==void 0?r:A.textAlign)!==null&&s!==void 0?s:"left";A.AABBBounds.width();const x=A.globalAABBBounds.x1,T=A.globalAABBBounds.x2;if(R==="center"&&o){const M=i.globalAABBBounds.x1+((a=(l=i.firstChild)===null||l===void 0?void 0:l.attribute.dx)!==null&&a!==void 0?a:0),B=M+((d=(h=i.contentWidth)!==null&&h!==void 0?h:i.attribute.width)!==null&&d!==void 0?d:0);if(M<t||B>e){const P=Math.max(M,t),F=Math.min(B,e),H=A.globalTransMatrix.e-(F+P)/2;!n.has(`${i.col}-${i.row}`)&&n.set(`${i.col}-${i.row}`,{col:i.col,row:i.row,dx:(c=(u=i.firstChild)===null||u===void 0?void 0:u.attribute.dx)!==null&&c!==void 0?c:0,dy:(f=(g=i.firstChild)===null||g===void 0?void 0:g.attribute.dy)!==null&&f!==void 0?f:0}),i.forEachChildren(E=>{var k;E.setAttribute("dx",((k=E.attribute.dx)!==null&&k!==void 0?k:0)-H+2)})}}else if(x<t){const M=x-t;!n.has(`${i.col}-${i.row}`)&&n.set(`${i.col}-${i.row}`,{col:i.col,row:i.row,dx:(m=(p=i.firstChild)===null||p===void 0?void 0:p.attribute.dx)!==null&&m!==void 0?m:0,dy:(C=(b=i.firstChild)===null||b===void 0?void 0:b.attribute.dy)!==null&&C!==void 0?C:0}),i.forEachChildren(B=>{var P;B.setAttribute("dx",((P=B.attribute.dx)!==null&&P!==void 0?P:0)-M+2)})}else if(T>e){const M=T-e;!n.has(`${i.col}-${i.row}`)&&n.set(`${i.col}-${i.row}`,{col:i.col,row:i.row,dx:(w=(_=i.firstChild)===null||_===void 0?void 0:_.attribute.dx)!==null&&w!==void 0?w:0,dy:(S=(y=i.firstChild)===null||y===void 0?void 0:y.attribute.dy)!==null&&S!==void 0?S:0}),i.forEachChildren(B=>{var P;B.setAttribute("dx",((P=B.attribute.dx)!==null&&P!==void 0?P:0)-M)})}}function QR(i){var t,e;const n=i.internalProps.layoutMap.headerObjects,o=i.internalProps.layoutMap.columnObjects;for(let r=0;r<n.length;r++){const s=n[r];if(s&&(!((t=s.style)===null||t===void 0)&&t.textStick))return!0}for(let r=0;r<o.length;r++){const s=o[r];if(s&&(!((e=s.style)===null||e===void 0)&&e.textStick))return!0}return!!(i.theme.headerStyle.textStick||i.theme.rowHeaderStyle.textStick||i.theme.bodyStyle.textStick)}var Nn=globalThis&&globalThis.__awaiter||function(i,t,e,n){return new(e||(e=Promise))(function(o,r){function s(h){try{a(n.next(h))}catch(d){r(d)}}function l(h){try{a(n.throw(h))}catch(d){r(d)}}function a(h){var d;h.done?o(h.value):(d=h.value,d instanceof e?d:new e(function(u){u(d)})).then(s,l)}a((n=n.apply(i,t||[])).next())})};class h5{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))):this.table.heightMode==="autoHeight"?this.rowLimit=Math.max(100,Math.ceil(2*t.tableNoFrameHeight/t.defaultRowHeight)):(this.table.widthMode==="autoWidth"||(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 n=e*t,o=e*(this.bodyRightCol-this.bodyLeftCol+1);this.xLimitLeft=n/2,this.xLimitRight=o-n/2;const r=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(r/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 n=e*t,o=e*(this.bodyBottomRow-this.bodyTopRow+1);this.yLimitTop=n/2,this.yLimitBottom=o-n/2;const r=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(r/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 n=this.table.defaultRowHeight;this.taskRowCount=1*Math.ceil(this.table.tableNoFrameHeight/n);const o=5*this.table.tableNoFrameHeight;this.screenRowCount=Math.ceil(this.table.tableNoFrameHeight/n),this.firstScreenRowLimit=this.bodyTopRow+Math.min(this.rowLimit,Math.ceil(o/n))}createGroupForFirstScreen(t,e,n,o,r,s,l,a){KW(t,e,n,o,r,s,l,a,this)}progress(){return Nn(this,void 0,void 0,function*(){if(!this.isProgressing)return this.isProgressing=!0,new Promise((t,e)=>{setTimeout(()=>Nn(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()),Ah(this.table),this.table.scenegraph.updateNextFrame(),t())}),16)})})}createRow(){return Nn(this,void 0,void 0,function*(){this.taskRowCount&&this.createRowCellGroup(this.taskRowCount)})}createCol(){return Nn(this,void 0,void 0,function*(){this.taskColCount&&this.createColGroup(this.taskRowCount)})}createRowCellGroup(t){const e=Math.min(this.totalRow,this.currentRow+t);if(zn(this.table,this.currentRow+1,e,!1),this.rowEnd=e,this.table.frozenColCount){let o=0;for(let r=0;r<this.table.frozenColCount;r++){const s=this.table.scenegraph.getColGroup(r),{height:l}=(this.table.isListTable(),lg(s,r,s.attribute.width,this.currentRow+1,e,this.table.scenegraph.mergeMap,this.table.internalProps.defaultRowHeight,this.table));o=Math.max(o,l),this.table.scenegraph.rowHeaderGroup.setAttribute("height",o)}}if(this.table.rightFrozenColCount){let o=0;for(let r=this.table.colCount-this.table.rightFrozenColCount;r<this.table.colCount;r++){const s=this.table.scenegraph.getColGroup(r),{height:l}=(this.table.isPivotChart(),lg(s,r,s.attribute.width,this.currentRow+1,e,this.table.scenegraph.mergeMap,this.table.internalProps.defaultRowHeight,this.table));o=Math.max(o,l),this.table.scenegraph.rightFrozenGroup.setAttribute("height",o)}}let n=0;for(let o=this.bodyLeftCol;o<=this.bodyRightCol;o++){const r=this.table.scenegraph.getColGroup(o);if(!r)continue;this.table.rowHeaderLevelCount;const{height:s}=lg(r,o,r.attribute.width,this.currentRow+1,e,this.table.scenegraph.mergeMap,this.table.internalProps.defaultRowHeight,this.table);n=Math.max(n,s)}this.table.scenegraph.bodyGroup.setAttribute("height",n),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);Wn(this.table,this.currentCol+1,e),this.colEnd=e;for(let s=0;s<this.table.rowCount;s++){const l=this.highPerformanceGetCell(this.currentCol,s);l.role==="cell"&&ft(l.mergeStartCol)&&l.mergeStartCol>this.currentCol&&this.table.scenegraph.updateCellContent(l.col,l.row)}if(this.table.frozenRowCount){const s=this.table.scenegraph.colHeaderGroup.lastChild instanceof de?this.table.scenegraph.colHeaderGroup.lastChild:this.table.scenegraph.colHeaderGroup.lastChild._prev,l=s.attribute.x+s.attribute.width,a=s.attribute.y;Si(this.table.scenegraph.colHeaderGroup,l,a,this.currentCol+1,e,0,this.table.frozenRowCount-1,"columnHeader",this.table)}if(this.table.bottomFrozenRowCount){const s=this.table.scenegraph.bottomFrozenGroup.lastChild instanceof de?this.table.scenegraph.bottomFrozenGroup.lastChild:this.table.scenegraph.bottomFrozenGroup.lastChild._prev,l=s.attribute.x+s.attribute.width,a=s.attribute.y;Si(this.table.scenegraph.bottomFrozenGroup,l,a,this.currentCol+1,e,this.table.rowCount-this.table.bottomFrozenRowCount,this.table.rowCount-1,"columnHeader",this.table)}let n=this.table.scenegraph.bodyGroup.lastChild&&(this.table.scenegraph.bodyGroup.lastChild instanceof de?this.table.scenegraph.bodyGroup.lastChild:this.table.scenegraph.bodyGroup.lastChild._prev);n||(n=this.table.scenegraph.colHeaderGroup.lastChild&&(this.table.scenegraph.colHeaderGroup.lastChild instanceof de?this.table.scenegraph.colHeaderGroup.lastChild:this.table.scenegraph.colHeaderGroup.lastChild._prev));const o=n.attribute.x+n.attribute.width,r=n.attribute.y;Si(this.table.scenegraph.bodyGroup,o,r,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,e=!1){return Nn(this,void 0,void 0,function*(){const n=this.table.getRowsHeight(this.bodyTopRow,this.bodyTopRow+(this.rowEnd-this.rowStart+1))/2,o=this.table.getAllRowsHeight()-n,r=this.table.getTargetRowAt(t+this.table.scenegraph.colHeaderGroup.attribute.height);r&&(this.screenTopRow=r.row),t<n&&this.rowStart===this.bodyTopRow||t>o&&this.rowEnd===this.bodyBottomRow?(this.updateDeltaY(t),this.updateBody(t-this.deltaY)):this.table.scenegraph.bodyGroup.firstChild&&this.table.scenegraph.bodyGroup.firstChild.childrenCount!==0||this.table.scenegraph.rowHeaderGroup.firstChild&&this.table.scenegraph.rowHeaderGroup.firstChild.childrenCount!==0?this.dynamicSetY(t,r,e):(this.updateDeltaY(t),this.updateBody(t-this.deltaY))})}setX(t,e=!1){return Nn(this,void 0,void 0,function*(){const n=this.table.getColsWidth(this.bodyLeftCol,this.bodyLeftCol+(this.colEnd-this.colStart+1))/2,o=this.table.getAllColsWidth()-n,r=this.table.getTargetColAt(t+this.table.scenegraph.rowHeaderGroup.attribute.width);r&&(this.screenLeftCol=r.col),t<n&&this.colStart===this.bodyLeftCol||t>o&&this.colEnd===this.bodyRightCol||this.table.scenegraph.bodyGroup.firstChild&&this.table.scenegraph.bodyGroup.firstChild.childrenCount===0?(this.updateDeltaX(t),this.table.scenegraph.setBodyAndColHeaderX(-t+this.deltaX)):this.dynamicSetX(t,r,e)})}dynamicSetY(t,e,n=!1){return Nn(this,void 0,void 0,function*(){e5(t,e,n,this)})}dynamicSetX(t,e,n=!1){return Nn(this,void 0,void 0,function*(){qW(t,e,n,this)})}updateBody(t){this.table.scenegraph.setBodyAndRowHeaderY(-t)}updateRowCellGroupsAsync(){return Nn(this,void 0,void 0,function*(){this.updateCellGroups(this.taskRowCount)})}updateCellGroups(t){const e=Math.min(this.bodyBottomRow,this.rowUpdatePos+t);this.table.heightMode==="autoHeight"&&zn(this.table,this.rowUpdatePos,e,!1),Rh(this.rowUpdatePos,e,this),this.table.heightMode==="autoHeight"&&(Cn(this.bodyLeftCol,this.bodyRightCol,this.rowUpdatePos,e,this.table,this.rowUpdateDirection,!0),Cn(0,this.table.frozenColCount-1,this.rowUpdatePos,e,this.table,this.rowUpdateDirection,!0),Cn(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;this.table.heightMode==="autoHeight"&&zn(this.table,t,e,!1),Rh(t,e,this),this.table.heightMode==="autoHeight"&&(Cn(this.bodyLeftCol,this.bodyRightCol,t,e,this.table,this.rowUpdateDirection),Cn(0,this.table.frozenColCount-1,t,e,this.table,this.rowUpdateDirection),Cn(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;this.table.widthMode==="autoWidth"&&Wn(this.table,t,e,!1),xh(t,e,this),this.table.heightMode==="autoHeight"&&$m(t,e,this.table,this.colUpdateDirection)}updateColCellGroupsAsync(){return Nn(this,void 0,void 0,function*(){this.updateColGroups(this.taskRowCount)})}updateColGroups(t){const e=Math.min(this.bodyRightCol,this.colUpdatePos+t);Wn(this.table,this.colUpdatePos,e),xh(this.colUpdatePos,e,this),this.colUpdatePos=e+1}updateCellGroupPosition(t,e,n){t.row=e,t.mergeStartCol=void 0,t.mergeStartRow=void 0,t.mergeEndCol=void 0,t.mergeEndRow=void 0,t.setAttribute("y",n),t.needUpdate=!0,t.needUpdateForAutoRowHeight=!0}updateCellGroupContent(t){if(!t.needUpdate||t.role!=="cell")return t;const e=this.table.scenegraph.updateCellContent(t.col,t.row);return t.needUpdate=!1,e||t}sortCellVertical(){return Nn(this,void 0,void 0,function*(){yield s5(this)})}sortCellHorizontal(){return Nn(this,void 0,void 0,function*(){yield a5(this)})}highPerformanceGetCell(t,e,n){if(e>=this.table.frozenRowCount&&e<this.table.rowCount-this.table.bottomFrozenRowCount&&(e<this.rowStart||e>this.rowEnd)||t>=this.table.frozenColCount&&t<this.table.colCount-this.table.rightFrozenColCount&&(t<this.colStart||t>this.colEnd))return sg;if(this.cellCache.get(t)){const r=this.cellCache.get(t);if((r._next||r._prev)&&Math.abs(r.row-e)<e){let l=Ym(r,e);return l&&(n||l.role!=="shadow-cell")||(l=this.table.scenegraph.getCell(t,e,n)),l.row&&this.cellCache.set(t,l),l}const s=this.table.scenegraph.getCell(t,e,n);return s.col===t&&s.row&&this.cellCache.set(t,s),s}const o=this.table.scenegraph.getCell(t,e,n);return o.col===t&&o.row&&this.cellCache.set(t,o),o}updateDeltaY(t,e,n){if(this.rowStart===this.bodyTopRow){const o=this.table.scenegraph.highPerformanceGetCell(this.colStart,this.rowStart,!0);if(o.role==="cell"){const r=o.attribute.y;this.deltaY=-r}}else if(this.rowEnd===this.bodyBottomRow){const o=this.table.scenegraph.highPerformanceGetCell(this.colStart,this.rowEnd,!0);if(o.role==="cell"){const r=o.attribute.y+o.attribute.height-(this.table.getAllRowsHeight()-this.table.getFrozenRowsHeight()-this.table.getBottomFrozenRowsHeight());this.deltaY=-r}}else if(z(e)&&z(n)){let o=this.table.scenegraph.highPerformanceGetCell(this.colStart,n,!0);o.role!=="cell"&&(o=this.table.scenegraph.highPerformanceGetCell(0,n,!0));const r=t-this.deltaY,s=e-r,l=o.attribute.y-r+this.table.getFrozenRowsHeight();this.deltaY=s-l}}updateDeltaX(t,e,n){if(this.colStart===this.bodyLeftCol){const o=this.table.scenegraph.getColGroup(this.colStart);if(o){const r=o.attribute.x;this.deltaX=-r}}else if(this.colEnd===this.bodyRightCol){const o=this.table.scenegraph.getColGroup(this.colEnd);if(o){const r=o.attribute.x+o.attribute.width-(this.table.getAllColsWidth()-this.table.getFrozenColsWidth()-this.table.getRightFrozenColsWidth());this.deltaX=-r}}else if(z(e)&&z(n)){const o=this.table.scenegraph.getColGroup(n)||this.table.scenegraph.getColGroup(n,!0),r=t-this.deltaX,s=e-r,l=o.attribute.x-r+this.table.getFrozenColsWidth();this.deltaX=s-l}}release(){this.isRelease=!0}}function Ym(i,t){if(!i)return null;if(i.row===t)return i;const e=i._prev,n=i._next;return i.row>t&&e&&e.row===i.row-1?Ym(e,t):i.row<t&&n&&n.row===i.row+1?Ym(n,t):null}function d5(i,t,e,n,o,r){const s=r.scenegraph;for(let l=i;l<=t;l++){const a=r.getColWidth(l),h=r.scenegraph.getColGroup(l,!0),d=r.scenegraph.getColGroup(l),u=r.scenegraph.getColGroupInBottom(l),c=r.scenegraph.getColGroupInLeftBottomCorner(l),g=r.scenegraph.getColGroupInRightBottomCorner(l);h&&(h.setAttribute("width",a),h.forEachChildren(f=>{f.setAttribute("width",a)})),d&&(d.setAttribute("width",a),d.forEachChildren(f=>{f.setAttribute("width",a)})),u&&(u.setAttribute("width",a),u.forEachChildren(f=>{f.setAttribute("width",a)})),g&&(g.setAttribute("width",a),g.forEachChildren(f=>{f.setAttribute("width",a)})),c&&(c.setAttribute("width",a),c.forEachChildren(f=>{f.setAttribute("width",a)}))}if(s.updateContainer(),o==="column")for(let l=i;l<=t;l++){const a=r.scenegraph.getColGroup(l);a==null||a.setAttribute("chartInstance",void 0);for(let h=0;h<=r.frozenRowCount-1;h++)s.updateCellContent(l,h);for(let h=s.bodyRowStart;h<=s.bodyRowEnd;h++)s.updateCellContent(l,h);for(let h=r.rowCount-r.bottomFrozenRowCount;h<=r.rowCount-1;h++)s.updateCellContent(l,h)}else{for(let l=0;l<=r.frozenColCount-1;l++){const a=r.scenegraph.getColGroup(l);a==null||a.setAttribute("chartInstance",void 0);for(let h=e;h<=n;h++)s.updateCellContent(l,h)}for(let l=s.bodyColStart;l<=s.bodyColEnd;l++){const a=r.scenegraph.getColGroup(l);a==null||a.setAttribute("chartInstance",void 0);for(let h=e;h<=n;h++)s.updateCellContent(l,h)}for(let l=r.colCount-r.rightFrozenColCount;l<=r.colCount-1;l++){const a=r.scenegraph.getColGroup(l);a==null||a.setAttribute("chartInstance",void 0);for(let h=e;h<=n;h++)s.updateCellContent(l,h)}}}function tA(i){i.customSelectedRangeComponents.forEach((t,e)=>{Xm(t,e,i)}),i.selectingRangeComponents.forEach((t,e)=>{Xm(t,e,i)}),i.selectedRangeComponents.forEach((t,e)=>{Xm(t,e,i)})}function Xm(i,t,e){var n,o,r,s,l,a,h,d,u;const c=e.table,[g,f,p,m]=t.split("-"),b=parseInt(g,10),C=parseInt(f,10),_=parseInt(p,10),w=parseInt(m,10);let y,S=b,A=C,R=_,x=w;switch(i.role){case"rowHeader":y=c.getBodyVisibleRowRange(),y&&(A=Math.max(C,y.rowStart-1),x=Math.min(w,y.rowEnd+1));break;case"columnHeader":case"bottomFrozen":y=c.getBodyVisibleCellRange(),y&&(S=Math.max(b,y.colStart-1),R=Math.min(_,y.colEnd+1));break;case"cornerHeader":case"rightTopCorner":case"leftBottomCorner":case"rightBottomCorner":break;case"rightFrozen":y=c.getBodyVisibleCellRange(),y&&(A=Math.max(C,y.rowStart-1),x=Math.min(w,y.rowEnd+1));break;default:y=c.getBodyVisibleCellRange(),y&&(A=Math.max(C,y.rowStart-1),x=Math.min(w,y.rowEnd+1),S=Math.max(b,y.colStart-1),R=Math.min(_,y.colEnd+1))}const T=c.getColsWidth(S,R),M=c.getRowsHeight(A,x),B=e.highPerformanceGetCell(S,A).globalAABBBounds,P=e.highPerformanceGetCell(R,x).globalAABBBounds;i.rect.setAttributes({x:B.x1-e.tableGroup.attribute.x,y:B.y1-e.tableGroup.attribute.y,width:T,height:M,visible:!0}),i.fillhandle&&((n=i.fillhandle)===null||n===void 0||n.setAttributes({x:P.x2-e.tableGroup.attribute.x-3,y:P.y2-e.tableGroup.attribute.y-3,width:6,height:6,visible:!0}));let F=!!c.frozenColCount&&b===c.frozenColCount;!F&&c.frozenColCount&&c.scrollLeft>0&&b>=c.frozenColCount&&c.getColsWidth(0,b-1)-c.scrollLeft<c.getFrozenColsWidth()&&(F=!0);let H=!!c.rightFrozenColCount&&c.rightFrozenColCount>0&&_===c.colCount-c.rightFrozenColCount-1;!H&&c.rightFrozenColCount&&_<c.colCount-c.rightFrozenColCount&&c.getColsWidth(0,_)-c.scrollLeft>c.tableNoFrameWidth-c.getRightFrozenColsWidth()&&(H=!0);let E=!c.frozenRowCount||C===c.frozenRowCount;!E&&c.frozenRowCount&&c.scrollTop>0&&C>=c.frozenRowCount&&c.getRowsHeight(0,C-1)-c.scrollTop<c.getFrozenRowsHeight()&&(E=!0);let k=!!c.bottomFrozenRowCount&&w===c.rowCount-c.bottomFrozenRowCount-1;if(!k&&c.bottomFrozenRowCount&&w<c.rowCount-c.bottomFrozenRowCount&&c.getRowsHeight(0,w)-c.scrollTop>c.tableNoFrameHeight-c.getBottomFrozenRowsHeight()&&(k=!0),F&&i.rect.attribute.stroke[3]||H&&i.rect.attribute.stroke[1]||E&&i.rect.attribute.stroke[0]||k&&i.rect.attribute.stroke[2]){if(F&&i.rect.attribute.stroke[3]&&e.tableGroup.insertAfter(i.rect,i.role==="columnHeader"?e.cornerHeaderGroup:i.role==="bottomFrozen"?e.leftBottomCornerGroup:e.rowHeaderGroup),k&&i.rect.attribute.stroke[2]&&e.tableGroup.insertAfter(i.rect,i.role==="rowHeader"?e.leftBottomCornerGroup:i.role==="rightFrozen"?e.rightBottomCornerGroup:e.bottomFrozenGroup),E&&i.rect.attribute.stroke[0]&&e.tableGroup.insertAfter(i.rect,i.role==="rowHeader"?e.cornerHeaderGroup:i.role==="rightFrozen"?e.rightTopCornerGroup:e.colHeaderGroup),H&&i.rect.attribute.stroke[1]&&e.tableGroup.insertAfter(i.rect,i.role==="columnHeader"?e.rightTopCornerGroup:i.role==="bottomFrozen"?e.rightBottomCornerGroup:e.rightFrozenGroup),i.rect.attribute.x<c.getFrozenColsWidth()&&c.scrollLeft>0&&(i.role==="body"||i.role==="columnHeader"||i.role==="bottomFrozen")){const L=i.rect.attribute.width-(c.getFrozenColsWidth()-i.rect.attribute.x);i.rect.setAttributes({x:i.rect.attribute.x+(c.getFrozenColsWidth()-i.rect.attribute.x),width:L>0?L:0}),(o=i.fillhandle)===null||o===void 0||o.setAttributes({visible:L>0})}if(c.getRightFrozenColsWidth()>0&&e.rightFrozenGroup.attribute.height>0&&i.rect.attribute.x+i.rect.attribute.width>e.rightFrozenGroup.attribute.x&&(i.role==="body"||i.role==="columnHeader"||i.role==="bottomFrozen")){const L=e.rightFrozenGroup.attribute.x-i.rect.attribute.x;i.rect.setAttributes({x:i.rect.attribute.x,width:L>0?L:0}),(r=i.fillhandle)===null||r===void 0||r.setAttributes({visible:L-T>0})}if(i.rect.attribute.y<e.colHeaderGroup.attribute.height&&c.scrollTop>0&&(i.role==="body"||i.role==="rowHeader"||i.role==="rightFrozen")){const L=i.rect.attribute.height-(e.colHeaderGroup.attribute.height-i.rect.attribute.y);i.rect.setAttributes({y:i.rect.attribute.y+(e.colHeaderGroup.attribute.height-i.rect.attribute.y),height:L>0?L:0}),(s=i.fillhandle)===null||s===void 0||s.setAttributes({visible:L>0})}if(e.bottomFrozenGroup.attribute.width>0&&e.bottomFrozenGroup.attribute.height>0&&i.rect.attribute.y+i.rect.attribute.height>e.bottomFrozenGroup.attribute.y&&(i.role==="body"||i.role==="rowHeader"||i.role==="rightFrozen")){const L=e.bottomFrozenGroup.attribute.y-i.rect.attribute.y;i.rect.setAttributes({y:i.rect.attribute.y,height:L>0?L:0}),(l=i.fillhandle)===null||l===void 0||l.setAttributes({visible:L-M>0})}}else e.tableGroup.insertAfter(i.rect,i.role==="body"?e.bodyGroup:i.role==="columnHeader"?e.colHeaderGroup:i.role==="rowHeader"?e.rowHeaderGroup:i.role==="cornerHeader"?e.cornerHeaderGroup:i.role==="rightTopCorner"?e.rightTopCornerGroup:i.role==="rightFrozen"?e.rightFrozenGroup:i.role==="leftBottomCorner"?e.leftBottomCornerGroup:i.role==="bottomFrozen"?e.bottomFrozenGroup:e.rightBottomCornerGroup);let I=0;typeof i.rect.attribute.lineWidth=="number"&&(I=Math.ceil(i.rect.attribute.lineWidth/2)),_===c.colCount-1&&(Array.isArray(i.rect.attribute.lineWidth)&&(I=Math.ceil(((a=i.rect.attribute.lineWidth[1])!==null&&a!==void 0?a:0)/2)),i.rect.setAttributes({width:i.rect.attribute.width-I})),b===0&&(Array.isArray(i.rect.attribute.lineWidth)&&(I=Math.ceil(((h=i.rect.attribute.lineWidth[3])!==null&&h!==void 0?h:0)/2)),i.rect.setAttributes({x:i.rect.attribute.x+I,width:i.rect.attribute.width-I})),w===c.rowCount-1&&(Array.isArray(i.rect.attribute.lineWidth)&&(I=Math.ceil(((d=i.rect.attribute.lineWidth[2])!==null&&d!==void 0?d:0)/2)),i.rect.setAttributes({height:i.rect.attribute.height-I})),C===0&&(Array.isArray(i.rect.attribute.lineWidth)&&(I=Math.ceil(((u=i.rect.attribute.lineWidth[0])!==null&&u!==void 0?u:0)/2)),i.rect.setAttributes({y:i.rect.attribute.y+I,height:i.rect.attribute.height-I}))}function eA(i,t,e=!0){const n=i.table,o=t.start.col,r=t.start.row,s=t.end.col,l=t.end.row,a=t.skipBodyMerge;let h=Math.max(Math.min(s,o),0),d=Math.max(Math.min(l,r),0),u=Math.min(Math.max(s,o),n.colCount-1),c=Math.min(Math.max(l,r),n.rowCount-1);const g=()=>{let A=!1;for(let R=h;R<=u;R++){if(R===h)for(let x=d;x<=c;x++){if(!n.isHeader(R,x)&&a)continue;const T=ui(n,R,x);if(T&&T.start.col<h){h=T.start.col,A=!0;break}}if(!A&&R===u)for(let x=d;x<=c;x++){if(!n.isHeader(R,x)&&a)continue;const T=ui(n,R,x);if(T&&Math.min(T.end.col,n.colCount-1)>u){u=T.end.col,A=!0;break}}if(A)break}if(!A)for(let R=d;R<=c;R++){if(R===d)for(let x=h;x<=u;x++){if(!n.isHeader(x,R)&&a)continue;const T=ui(n,x,R);if(T&&T.start.row<d){d=T.start.row,A=!0;break}}if(!A&&R===c)for(let x=h;x<=u;x++){if(!n.isHeader(x,R)&&a)continue;const T=ui(n,x,R);if(T&&Math.min(T.end.row,n.rowCount-1)>c){c=T.end.row,A=!0;break}}if(A)break}A&&g()};e&&g(),i.selectingRangeComponents.forEach((A,R)=>{var x;A.rect.delete(),(x=A.fillhandle)===null||x===void 0||x.delete()}),i.selectingRangeComponents=new Map;let f=!1,p=!1,m=!1,b=!1,C=!1,_=!1,w=!1,y=!1,S=!1;if(h<=n.frozenColCount-1&&d<=n.frozenRowCount-1&&(_=!0),u>=n.colCount-n.rightFrozenColCount&&d<=n.frozenRowCount-1&&(w=!0),h<=n.frozenColCount-1&&c>=n.rowCount-n.bottomFrozenRowCount&&(S=!0),u>=n.colCount-n.rightFrozenColCount&&c>=n.rowCount-n.bottomFrozenRowCount&&(y=!0),h<=n.frozenColCount-1&&c>=n.frozenRowCount&&d<=n.rowCount-n.bottomFrozenRowCount-1&&(f=!0),u>=n.colCount-n.rightFrozenColCount&&c>=n.frozenRowCount&&d<=n.rowCount-n.bottomFrozenRowCount-1&&(p=!0),d<=n.frozenRowCount-1&&u>=n.frozenColCount&&h<=n.colCount-n.rightFrozenColCount-1&&(m=!0),c>=n.rowCount-n.bottomFrozenRowCount&&u>=n.frozenColCount&&h<=n.colCount-n.rightFrozenColCount-1&&(b=!0),h<=n.colCount-n.rightFrozenColCount-1&&u>=n.frozenColCount&&d<=n.rowCount-n.bottomFrozenRowCount-1&&c>=n.frozenRowCount&&(C=!0),_){const A=Math.min(u,n.frozenColCount-1),R=Math.min(c,n.frozenRowCount-1),x=[!0,!m,!f,!0];i.createCellSelectBorder(h,d,A,R,"cornerHeader",`${h}${d}${u}${c}`,x)}if(w){const A=Math.max(h,n.colCount-n.rightFrozenColCount),R=Math.min(c,n.frozenRowCount-1),x=[!0,!0,!p,!m];i.createCellSelectBorder(A,d,u,R,"rightTopCorner",`${h}${d}${u}${c}`,x)}if(S){const A=Math.min(u,n.frozenColCount-1),R=Math.max(d,n.rowCount-n.bottomFrozenRowCount),x=[!f,!b,!0,!0];i.createCellSelectBorder(h,R,A,c,"leftBottomCorner",`${h}${d}${u}${c}`,x)}if(y){const A=Math.max(h,n.colCount-n.rightFrozenColCount),R=Math.max(d,n.rowCount-n.bottomFrozenRowCount),x=[!p,!0,!0,!b];i.createCellSelectBorder(A,R,u,c,"rightBottomCorner",`${h}${d}${u}${c}`,x)}if(m){const A=Math.max(h,n.frozenColCount),R=Math.min(u,n.colCount-n.rightFrozenColCount-1),x=Math.min(c,n.frozenRowCount-1),T=[!0,!w,!C,!_];i.createCellSelectBorder(A,d,R,x,"columnHeader",`${h}${d}${u}${c}`,T)}if(b){const A=Math.max(h,n.frozenColCount),R=Math.min(u,n.colCount-n.rightFrozenColCount-1),x=Math.max(d,n.rowCount-n.bottomFrozenRowCount),T=[!C,!y,!0,!S];i.createCellSelectBorder(A,x,R,c,"bottomFrozen",`${h}${d}${u}${c}`,T)}if(f){const A=Math.max(d,n.frozenRowCount),R=Math.min(c,n.rowCount-n.bottomFrozenRowCount-1),x=Math.min(u,n.frozenColCount-1),T=[!_,!C,!S,!0];i.createCellSelectBorder(h,A,x,R,"rowHeader",`${h}${d}${u}${c}`,T)}if(p){const A=Math.max(d,n.frozenRowCount),R=Math.min(c,n.rowCount-n.bottomFrozenRowCount-1),x=Math.max(h,n.colCount-n.rightFrozenColCount),T=[!w,!0,!y,!C];i.createCellSelectBorder(x,A,u,R,"rightFrozen",`${h}${d}${u}${c}`,T)}if(C){const A=Math.max(h,n.frozenColCount),R=Math.max(d,n.frozenRowCount),x=Math.min(u,n.colCount-n.rightFrozenColCount-1),T=Math.min(c,n.rowCount-n.bottomFrozenRowCount-1),M=[!m,!p,!b,!f];i.createCellSelectBorder(A,R,x,T,"body",`${h}${d}${u}${c}`,M)}}function iA(i){i.selectingRangeComponents.forEach((t,e)=>{t.rect.setAttribute("opacity",0)}),i.selectedRangeComponents.forEach((t,e)=>{t.rect.setAttribute("opacity",0)})}function nA(i){i.selectingRangeComponents.forEach((t,e)=>{t.rect.setAttribute("opacity",1)}),i.selectedRangeComponents.forEach((t,e)=>{t.rect.setAttribute("opacity",1)})}function u5(i,t,e,n,o,r,s,l){var a,h,d,u,c,g,f,p;let m=!!(!((a=i.table.options.excelOptions)===null||a===void 0)&&a.fillHandle);if(((h=i.table.stateManager.select.ranges)===null||h===void 0?void 0:h.length)>1)m=!1,i.removeFillHandleFromSelectComponents();else if(((d=i.table.stateManager.select.ranges)===null||d===void 0?void 0:d.length)===1){const B=Math.max(i.table.stateManager.select.ranges[0].start.row,i.table.stateManager.select.ranges[0].end.row),P=Math.max(i.table.stateManager.select.ranges[0].start.col,i.table.stateManager.select.ranges[0].end.col);i.table.isHeader(P,B)&&(m=!1)}!Array.isArray(l)||l[1]!==!1&&l[2]!==!1||(m=!1);const b=Math.min(t,n),C=Math.min(e,o),_=Math.max(t,n),w=Math.max(e,o),y=i.highPerformanceGetCell(b,C).globalAABBBounds,S=i.highPerformanceGetCell(_,w).globalAABBBounds,A=i.table.theme,R=(u=A.selectionStyle)===null||u===void 0?void 0:u.cellBorderColor,x=(c=A.selectionStyle)===null||c===void 0?void 0:c.cellBorderLineWidth,T=Fe({pickable:!1,fill:((g=A.selectionStyle)===null||g===void 0?void 0:g.selectionFillMode)!=="replace"&&((p=(f=A.selectionStyle)===null||f===void 0?void 0:f.cellBgColor)!==null&&p!==void 0?p:"rgba(0, 0, 255,0.1)"),lineWidth:x,stroke:l.map(B=>!!B&&R),x:y.x1-i.tableGroup.attribute.x,y:y.y1-i.tableGroup.attribute.y,width:0,height:0,visible:!0});let M;m&&(M=Fe({pickable:!1,fill:R,stroke:R,x:S.x2-3,y:S.y2-3,width:6,height:6,visible:!0})),i.lastSelectId=s,i.selectingRangeComponents.set(`${b}-${C}-${_}-${w}-${s}`,{rect:T,fillhandle:M,role:r}),i.tableGroup.insertAfter(T,r==="body"?i.bodyGroup:r==="columnHeader"?i.colHeaderGroup:r==="rowHeader"?i.rowHeaderGroup:r==="cornerHeader"?i.cornerHeaderGroup:r==="rightTopCorner"?i.rightTopCornerGroup:r==="rightFrozen"?i.rightFrozenGroup:r==="leftBottomCorner"?i.leftBottomCornerGroup:r==="bottomFrozen"?i.bottomFrozenGroup:i.rightBottomCornerGroup),m&&i.tableGroup.insertAfter(M,r==="body"?i.bodyGroup:r==="columnHeader"?i.colHeaderGroup:r==="rowHeader"?i.rowHeaderGroup:r==="cornerHeader"?i.cornerHeaderGroup:r==="rightTopCorner"?i.rightTopCornerGroup:r==="rightFrozen"?i.rightFrozenGroup:r==="leftBottomCorner"?i.leftBottomCornerGroup:r==="bottomFrozen"?i.bottomFrozenGroup:i.rightBottomCornerGroup)}function oA(i){i.selectingRangeComponents.forEach((t,e)=>{var n;i.selectedRangeComponents.get(e)&&(i.selectingRangeComponents.get(e).rect.delete(),(n=i.selectingRangeComponents.get(e).fillhandle)===null||n===void 0||n.delete()),i.selectedRangeComponents.set(e,t)}),i.selectingRangeComponents=new Map,i.updateNextFrame()}function c5(i){i.selectedRangeComponents.forEach((t,e)=>{var n;e.split("-")[4]===i.lastSelectId&&(t.rect.delete(),(n=t.fillhandle)===null||n===void 0||n.delete(),i.selectedRangeComponents.delete(e))})}function rA(i){i.selectedRangeComponents.forEach((t,e)=>{var n;t.rect.delete(),(n=t.fillhandle)===null||n===void 0||n.delete()}),i.selectedRangeComponents=new Map}function sA(i){i.selectingRangeComponents.forEach((t,e)=>{var n;t.rect.delete(),(n=t.fillhandle)===null||n===void 0||n.delete()}),i.selectingRangeComponents=new Map}function g5(i){i.selectedRangeComponents.forEach((t,e)=>{var n;(n=t.fillhandle)===null||n===void 0||n.delete(),t.fillhandle=void 0})}function f5(i,t,e,n){const o=n.scenegraph,r=ih(i.map(g=>g.row)).sort((g,f)=>f-g),s=ih(t.map(g=>g.row)).sort((g,f)=>g-f),l=ih(e.map(g=>g.row)).sort((g,f)=>g-f);let a;if(l.length&&(a=Zm(l[0]-1,l[l.length-1]+1,o)),s.length){const g=Zm(s[0]-1,s[s.length-1]+1,o);a=z(a)?z(g)?Math.min(a,g):a:g}if(r.length){const g=Zm(r[0]-1,r[r.length-1]+1,o);a=z(a)?z(g)?Math.min(a,g):a:g}r.forEach(g=>{p5(g,o)});const h=n.rowHeightsMap;if(r.forEach(g=>{h.delete(g)}),r.length){v5(o);const g=qm(r[r.length-1]-1,r[0]-r.length+1,o);a=z(a)?z(g)?Math.min(a,g):a:g}let d;if(o.table._clearRowRangeHeightsMap(),s.forEach(g=>{const f=m5(g,o);d=d??f,h.insert(g)}),b5(o),s.length){const g=qm(s[0]-1,s[s.length-1]+1,o);a=z(a)?z(g)?Math.min(a,g):a:g}for(let g=0;g<n.colCount;g++)l.forEach(f=>{if(f<n.frozenRowCount){const p=ui(o.table,g,f);if(p)for(let m=p.start.col;m<=p.end.col;m++)for(let b=p.start.row;b<=p.end.row;b++)_o(m,b,o.table,!1);else _o(g,f,o.table,!1)}else if(f>n.rowCount-1||f<o.table.rowCount-o.table.bottomFrozenRowCount&&(f<o.proxy.rowStart||f>o.proxy.rowEnd))aA(f,o);else{const p=ui(o.table,g,f);if(p)for(let m=p.start.col;m<=p.end.col;m++)for(let b=p.start.row;b<=p.end.row;b++)_o(m,b,o.table,!1);else _o(g,f,o.table,!1)}});if(l.length){const g=qm(l[0]-1,l[l.length-1]+1,o);a=z(a)?z(g)?Math.min(a,g):a:g}if(ft(d)){for(let g=0;g<n.colCount;g++)for(let f=d;f<n.rowCount;f++){const p=o.highPerformanceGetCell(g,f,!0);p&&(p.needUpdate=!0)}a=z(a)?z(d)?Math.min(a,d):a:d}if(ft(a)&&(o.proxy.rowUpdatePos=Math.min(o.proxy.rowUpdatePos,a)),s.length){if(!ft(d)){const g=Math.min(...s);o.proxy.rowUpdatePos=Math.min(g,o.proxy.rowUpdatePos)}o.proxy.rowUpdateDirection="up",o.proxy.updateCellGroups(2*o.proxy.screenRowCount),c()}else r.length&&(C5(r[r.length-1],o),o.proxy.updateCellGroups(2*o.proxy.screenRowCount),c());o.proxy.progress();const u=n.getRowsHeight(n.frozenRowCount,n.rowCount-1-n.bottomFrozenRowCount);function c(){if((s==null?void 0:s[(s==null?void 0:s.length)-1])>=n.rowCount-n.bottomFrozenRowCount||(l==null?void 0:l[(l==null?void 0:l.length)-1])>=n.rowCount-n.bottomFrozenRowCount||(r==null?void 0:r[0])>=n.rowCount-n.bottomFrozenRowCount){for(let g=0;g<n.colCount;g++)for(let f=n.rowCount-n.bottomFrozenRowCount;f<n.rowCount;f++){const p=o.highPerformanceGetCell(g,f,!0);p&&(p.needUpdate=!0)}o.proxy.updateBottomFrozenCellGroups()}}o.updateContainerHeight(o.table.frozenRowCount,u-o.bodyGroup.attribute.height)}function p5(i,t){const e=t.proxy;i>=e.rowStart&&i<=e.rowEnd&&(aA(i,t),e.rowEnd--,e.currentRow--),e.bodyBottomRow--;const n=Math.min(e.rowLimit,e.bodyBottomRow-e.bodyTopRow+1);e.totalActualBodyRowCount=n,e.totalRow=Math.min(e.table.rowCount-1,e.rowStart+n-1)}function m5(i,t){const e=t.proxy;e.bodyBottomRow++;const n=Math.min(e.rowLimit,e.bodyBottomRow-e.bodyTopRow+1);if(e.totalActualBodyRowCount=n,e.totalRow=e.rowStart+n-1,!(i<e.rowStart))return i>e.rowEnd?e.rowEnd-e.rowStart+1<e.rowLimit?(e.rowEnd++,e.currentRow++,lA(i,t),i):void 0:(e.rowEnd-e.rowStart+1<e.rowLimit&&(e.rowEnd++,e.currentRow++,lA(i,t)),i)}function v5(i){function t(e,n){e.row=n;const o=ui(i.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)}i.bodyGroup.forEachChildren(e=>{let n=i.bodyRowStart;e==null||e.forEachChildren(o=>{t(o,n),n++})}),i.rowHeaderGroup.forEachChildren(e=>{let n=i.bodyRowStart;e==null||e.forEachChildren(o=>{t(o,n),n++})}),i.rightFrozenGroup.forEachChildren(e=>{let n=i.bodyRowStart;e==null||e.forEachChildren(o=>{t(o,n),n++})}),i.bottomFrozenGroup.forEachChildren(e=>{let n=i.table.rowCount-i.table.bottomFrozenRowCount;e==null||e.forEachChildren(o=>{t(o,n),n++})}),i.leftBottomCornerGroup.forEachChildren(e=>{let n=i.table.rowCount-i.table.bottomFrozenRowCount;e==null||e.forEachChildren(o=>{t(o,n),n++})}),i.rightBottomCornerGroup.forEachChildren(e=>{let n=i.table.rowCount-i.table.bottomFrozenRowCount;e==null||e.forEachChildren(o=>{t(o,n),n++})})}function b5(i){function t(e,n,o){e.row=n,e.setAttribute("y",o);const r=ui(i.table,e.col,e.row);r?(e.mergeStartCol=r.start.col,e.mergeEndCol=r.end.col,e.mergeStartRow=r.start.row,e.mergeEndRow=r.end.row):(e.mergeStartCol=void 0,e.mergeEndCol=void 0,e.mergeStartRow=void 0,e.mergeEndRow=void 0)}i.bodyGroup.forEachChildren(e=>{let n=i.bodyRowStart,o=i.getCellGroupY(n);e==null||e.forEachChildren(r=>{t(r,n,o),n++,o+=r.attribute.height})}),i.rowHeaderGroup.forEachChildren(e=>{let n=i.bodyRowStart,o=i.getCellGroupY(n);e==null||e.forEachChildren(r=>{t(r,n,o),n++,o+=r.attribute.height})}),i.rightFrozenGroup.forEachChildren(e=>{let n=i.bodyRowStart,o=i.getCellGroupY(n);e==null||e.forEachChildren(r=>{t(r,n,o),n++,o+=r.attribute.height})}),i.bottomFrozenGroup.forEachChildren(e=>{let n=i.table.rowCount-i.table.bottomFrozenRowCount,o=0;e==null||e.forEachChildren(r=>{t(r,n,o),n++,o+=r.attribute.height})}),i.leftBottomCornerGroup.forEachChildren(e=>{let n=i.table.rowCount-i.table.bottomFrozenRowCount,o=0;e==null||e.forEachChildren(r=>{t(r,n,o),n++,o+=r.attribute.height})}),i.rightBottomCornerGroup.forEachChildren(e=>{let n=i.table.rowCount-i.table.bottomFrozenRowCount,o=0;e==null||e.forEachChildren(r=>{t(r,n,o),n++,o+=r.attribute.height})})}function lA(i,t){for(let e=0;e<t.table.colCount;e++){const n=new de({x:0,y:0,width:t.table.getColWidth(e),height:t.table.getRowHeight(i)});if(n.role="cell",n.col=e,n.row=i,n.needUpdate=!0,!n)continue;const o=t.getColGroup(e);if(o)if(o.firstChild&&i<o.firstChild.row)o.insertBefore(n,o.firstChild),o.firstChild.row=o.firstChild.row+1;else if(o.lastChild&&i>o.lastChild.row)o.appendChild(n);else{const r=t.highPerformanceGetCell(e,i,!0);r!==n&&(o.insertBefore(n,r),r&&(r.row=r.row+1),r!==o.lastChild&&o.lastChild&&(o.lastChild.row=o.lastChild.row+1))}}}function aA(i,t){for(let e=0;e<t.table.colCount;e++){const n=t.getColGroup(e,!1);if(!n)continue;let o;n.forEachChildren(r=>r.row===i&&(o=r,!0)),o&&(n.updateColumnHeight(-o.attribute.height),n.removeChild(o))}}function qm(i,t,e){let n;for(let o=0;o<e.table.colCount;o++){const r=e.table.getCellRange(o,i);let s;r.start.row<=i+1&&r.end.row>=i+1&&(hg(r,e),s=r.start.row);const l=e.table.getCellRange(o,t);l.start.row<=t+1&&l.end.row>=t+1&&(hg(l,e),s=l.start.row),z(s)&&(n=z(n)?Math.min(n,s):s)}return n}function Zm(i,t,e){let n;for(let o=0;o<e.table.colCount;o++){let r;const s=e.highPerformanceGetCell(o,i);s.mergeStartRow&&s.mergeEndRow&&s.mergeEndRow>i&&(hg({start:{row:s.mergeStartRow,col:e.table.heightMode==="autoHeight"?0:s.mergeStartCol},end:{row:s.mergeEndRow,col:e.table.heightMode==="autoHeight"?e.table.colCount-1:s.mergeEndCol}},e),r=s.mergeStartRow);const l=e.highPerformanceGetCell(o,t);l.mergeStartRow&&l.mergeEndRow&&l.mergeStartRow<t&&(hg({start:{row:l.mergeStartRow,col:e.table.heightMode==="autoHeight"?0:l.mergeStartCol},end:{row:l.mergeEndRow,col:e.table.heightMode==="autoHeight"?e.table.colCount-1:l.mergeEndCol}},e),r=l.mergeStartRow),z(r)&&(n=z(n)?Math.min(n,r):r)}return n}function hg(i,t){const{start:e,end:n}=i;for(let o=e.col;o<=n.col;o++)for(let r=e.row;r<=n.row;r++){const s=t.highPerformanceGetCell(o,r,!0);s&&(s.needUpdate=!0)}}function C5(i,t){if(t.table.isHasSeriesNumber())for(let e=i;e<=t.table.rowCount-1;e++)_o(0,e,t.table,!1)}function y5(i){const{internalProps:t}=i;t.bodyDomContainer=document.createElement("div"),t.bodyDomContainer.id="vtable-body-dom-container",t.bodyDomContainer.classList.add("table-component-container"),t.element.appendChild(t.bodyDomContainer),t.headerDomContainer=document.createElement("div"),t.headerDomContainer.id="vtable-header-dom-container",t.headerDomContainer.classList.add("table-component-container"),t.element.appendChild(t.headerDomContainer),t.frozenBodyDomContainer=document.createElement("div"),t.frozenBodyDomContainer.id="vtable-frozen-body-dom-container",t.frozenBodyDomContainer.classList.add("table-component-container"),t.element.appendChild(t.frozenBodyDomContainer),t.frozenHeaderDomContainer=document.createElement("div"),t.frozenHeaderDomContainer.id="vtable-frozen-header-dom-container",t.frozenHeaderDomContainer.classList.add("table-component-container"),t.element.appendChild(t.frozenHeaderDomContainer),t.rightFrozenBodyDomContainer=document.createElement("div"),t.rightFrozenBodyDomContainer.id="vtable-right-frozen-body-dom-container",t.rightFrozenBodyDomContainer.classList.add("table-component-container"),t.element.appendChild(t.rightFrozenBodyDomContainer),t.rightFrozenHeaderDomContainer=document.createElement("div"),t.rightFrozenHeaderDomContainer.id="vtable-right-frozen-header-dom-container",t.rightFrozenHeaderDomContainer.classList.add("table-component-container"),t.element.appendChild(t.rightFrozenHeaderDomContainer),t.frozenBottomDomContainer=document.createElement("div"),t.frozenBottomDomContainer.id="vtable-frozen-bottom-dom-container",t.frozenBottomDomContainer.classList.add("table-component-container"),t.element.appendChild(t.frozenBottomDomContainer),t.bottomDomContainer=document.createElement("div"),t.bottomDomContainer.id="vtable-bottom-dom-container",t.bottomDomContainer.classList.add("table-component-container"),t.element.appendChild(t.bottomDomContainer),t.rightFrozenBottomDomContainer=document.createElement("div"),t.rightFrozenBottomDomContainer.id="vtable-right-frozen-bottom-dom-container",t.rightFrozenBottomDomContainer.classList.add("table-component-container"),t.element.appendChild(t.rightFrozenBottomDomContainer)}function _5(i){const{headerDomContainer:t,bodyDomContainer:e,frozenBodyDomContainer:n,frozenHeaderDomContainer:o,rightFrozenBodyDomContainer:r,rightFrozenHeaderDomContainer:s,bottomDomContainer:l,frozenBottomDomContainer:a,rightFrozenBottomDomContainer:h}=i.internalProps;if(!(t||e||n||o||r||s||l||a||h))return;const d=i.getAllColsWidth(),u=Math.min(d,i.tableNoFrameWidth),c=i.getFrozenColsWidth(),g=i.getRightFrozenColsWidth(),f=c+g,p=Math.min(d-f,u-f),m=i.getAllRowsHeight(),b=Math.min(m,i.tableNoFrameHeight),C=i.getFrozenRowsHeight(),_=i.getBottomFrozenRowsHeight(),w=C+_,y=Math.min(m-w,b-w);i.frozenColCount>0?(t.style.left=`${i.tableX+c}px`,e.style.left=`${i.tableX+c}px`,l.style.left=`${i.tableX+c}px`):i.frozenColCount===0&&(t.style.left=`${i.tableX}px`,e.style.left=`${i.tableX}px`,l.style.left=`${i.tableX}px`),n.style.left=`${i.tableX}px`,o.style.left=`${i.tableX}px`,t.style.width=`${p}px`,t.style.height=`${C}px`,e.style.top=`${i.tableY}px`,e.style.width=`${p}px`,e.style.height=`${y}px`,e.style.top=`${i.tableY+C}px`,n.style.width=`${c}px`,n.style.height=`${y}px`,n.style.top=`${i.tableY+C}px`,o.style.width=`${c}px`,o.style.height=`${C}px`,o.style.top=`${i.tableY}px`,r.style.width=`${g}px`,r.style.height=`${y}px`,r.style.top=`${i.tableY+C}px`,r.style.left=i.tableX+u-g+"px",s.style.width=`${g}px`,s.style.height=`${C}px`,s.style.top=`${i.tableY}px`,s.style.left=i.tableX+u-g+"px",l.style.width=`${p}px`,l.style.height=`${_}px`,l.style.top=i.tableY+b-_+"px",a.style.width=`${c}px`,a.style.height=`${_}px`,a.style.top=i.tableY+b-_+"px",h.style.width=`${g}px`,h.style.height=`${_}px`,h.style.top=i.tableY+b-_+"px",h.style.left=i.tableX+u-g+"px"}function w5(i){if(!i.table.reactCustomLayout)return;const{table:t,stage:e}=i,n=e.pluginService.findPluginsByName("ReactAttributePlugin")[0],{htmlMap:o}=n;for(const r in o){const s=o[r],{graphic:l,wrapContainer:a}=s;let h;if(i.frozenColCount>t.frozenColCount){const{col:d,row:u}=Hr(l);u>=t.rowCount-t.bottomFrozenRowCount&&d<i.frozenColCount&&d>=t.frozenColCount&&l.attribute.react.container===t.frozenBottomDomContainer?h=t.bottomDomContainer:u>=t.frozenRowCount&&d<i.frozenColCount&&d>=t.frozenColCount&&l.attribute.react.container===t.frozenBodyDomContainer?h=t.bodyDomContainer:u<t.frozenRowCount&&d<i.frozenColCount&&d>=t.frozenColCount&&l.attribute.react.container===t.frozenHeaderDomContainer&&(h=t.headerDomContainer)}else if(i.frozenColCount<t.frozenColCount){const{col:d,row:u}=Hr(l);u>=t.rowCount-t.bottomFrozenRowCount&&d<t.frozenColCount&&d>=i.frozenColCount&&l.attribute.react.container===t.bottomDomContainer?h=t.frozenBottomDomContainer:u>=t.frozenRowCount&&d<t.frozenColCount&&d>=i.frozenColCount&&l.attribute.react.container===t.bodyDomContainer?h=t.frozenBodyDomContainer:u<t.frozenRowCount&&d<t.frozenColCount&&d>=i.frozenColCount&&l.attribute.react.container===t.headerDomContainer&&(h=t.frozenHeaderDomContainer)}h&&(h.appendChild(a),s.nativeContainer=h,s.container=h,l.attribute.react.container=h,n.updateStyleOfWrapContainer(l,e,a,h,l.attribute.react))}}function S5(i){var t,e;if(i.table.frozenColCount>i.table.rowHeaderLevelCount){i.rowHeaderGroup.setAttribute("height",i.bodyGroup.attribute.height),i.rowHeaderGroup.setAttribute("y",i.bodyGroup.attribute.y),i.cornerHeaderGroup.setAttribute("height",i.colHeaderGroup.attribute.height);for(let n=0;n<i.table.frozenColCount-i.table.rowHeaderLevelCount;n++)hA(i),dA(i),gA(i)}else if(i.table.frozenColCount<i.table.rowHeaderLevelCount){i.bodyGroup.setAttribute("height",i.rowHeaderGroup.attribute.height),i.bodyGroup.setAttribute("y",i.rowHeaderGroup.attribute.y),i.colHeaderGroup.setAttribute("height",i.cornerHeaderGroup.attribute.height);for(let n=0;n<i.table.rowHeaderLevelCount-i.table.frozenColCount;n++)uA(i),cA(i),fA(i)}i.bodyGroup.setAttribute("x",i.rowHeaderGroup.attribute.width),i.colHeaderGroup.setAttribute("x",i.cornerHeaderGroup.attribute.width),i.updateContainer(),i.updateBorderSizeAndPosition(),i.isPivot||i.table.transpose?i.table.options.frozenColCount?i.component.setFrozenColumnShadow(i.table.frozenColCount-1):i.table.options.frozenColCount&&i.component.setRightFrozenColumnShadow(i.table.colCount-i.table.rightFrozenColCount):(i.component.setFrozenColumnShadow(i.table.frozenColCount-1),i.component.setRightFrozenColumnShadow(i.table.colCount-i.table.rightFrozenColCount)),i.hasFrozen=!0,i.frozenColCount=i.table.frozenColCount,i.frozenRowCount=(e=(t=i.colHeaderGroup.firstChild)===null||t===void 0?void 0:t.childrenCount)!==null&&e!==void 0?e:0}function x5(i){var t,e,n,o;if(i.frozenColCount>i.table.frozenColCount){i.bodyGroup.setAttribute("height",i.rowHeaderGroup.attribute.height),i.bodyGroup.setAttribute("y",i.rowHeaderGroup.attribute.y),i.colHeaderGroup.setAttribute("height",i.cornerHeaderGroup.attribute.height);for(let r=0;r<i.frozenColCount-i.table.frozenColCount;r++)uA(i),cA(i),fA(i)}else if(i.frozenColCount<i.table.frozenColCount){i.rowHeaderGroup.setAttribute("height",i.bodyGroup.attribute.height),i.rowHeaderGroup.setAttribute("y",i.bodyGroup.attribute.y),i.cornerHeaderGroup.setAttribute("height",i.colHeaderGroup.attribute.height);for(let r=0;r<i.table.frozenColCount-i.frozenColCount;r++)hA(i),dA(i),gA(i)}w5(i),i.recreateAllSelectRangeComponents(),i.frozenColCount=i.table.frozenColCount,i.frozenRowCount=(e=(t=i.colHeaderGroup.firstChild)===null||t===void 0?void 0:t.childrenCount)!==null&&e!==void 0?e:0,i.proxy.colStart=(o=(n=i.bodyGroup.firstChild)===null||n===void 0?void 0:n.col)!==null&&o!==void 0?o:i.table.frozenColCount,i.bodyGroup.setAttribute("x",i.rowHeaderGroup.attribute.width),i.colHeaderGroup.setAttribute("x",i.cornerHeaderGroup.attribute.width),i.updateContainer(),i.updateBorderSizeAndPosition(),i.isPivot||i.table.transpose?i.table.options.frozenColCount?i.component.setFrozenColumnShadow(i.table.frozenColCount-1):i.table.options.rightFrozenColCount&&i.component.setRightFrozenColumnShadow(i.table.colCount-i.table.rightFrozenColCount):(i.component.setFrozenColumnShadow(i.table.frozenColCount-1),i.component.setRightFrozenColumnShadow(i.table.colCount-i.table.rightFrozenColCount)),i.hasFrozen=!0}function hA(i){const t=i.bodyGroup.firstChild instanceof de?i.bodyGroup.firstChild:null;t&&(i.rowHeaderGroup.appendChild(t),i.rowHeaderGroup.setAttribute("width",i.rowHeaderGroup.attribute.width+t.attribute.width),i.bodyGroup.setAttribute("width",i.bodyGroup.attribute.width-t.attribute.width))}function dA(i){const t=i.colHeaderGroup.firstChild instanceof de?i.colHeaderGroup.firstChild:null;t&&(i.cornerHeaderGroup.appendChild(t),i.cornerHeaderGroup.setAttribute("width",i.cornerHeaderGroup.attribute.width+t.attribute.width),i.colHeaderGroup.setAttribute("width",i.colHeaderGroup.attribute.width-t.attribute.width))}function uA(i){var t;const e=i.rowHeaderGroup.lastChild instanceof de?i.rowHeaderGroup.lastChild:(t=i.rowHeaderGroup.lastChild)===null||t===void 0?void 0:t._prev;e&&(nr(i.bodyGroup,e,i.bodyGroup.firstChild),i.bodyGroup.setAttribute("width",i.bodyGroup.attribute.width+e.attribute.width),i.rowHeaderGroup.setAttribute("width",i.rowHeaderGroup.attribute.width-e.attribute.width))}function cA(i){var t;const e=i.cornerHeaderGroup.lastChild instanceof de?i.cornerHeaderGroup.lastChild:(t=i.cornerHeaderGroup.lastChild)===null||t===void 0?void 0:t._prev;e&&(nr(i.colHeaderGroup,e,i.colHeaderGroup.firstChild),i.colHeaderGroup.setAttribute("width",i.colHeaderGroup.attribute.width+e.attribute.width),i.cornerHeaderGroup.setAttribute("width",i.cornerHeaderGroup.attribute.width-e.attribute.width))}function gA(i){const t=i.bottomFrozenGroup.firstChild instanceof de?i.bottomFrozenGroup.firstChild:null;t&&(i.leftBottomCornerGroup.appendChild(t),i.leftBottomCornerGroup.setAttribute("width",i.leftBottomCornerGroup.attribute.width+t.attribute.width),i.bottomFrozenGroup.setAttribute("width",i.bottomFrozenGroup.attribute.width-t.attribute.width),i.table.isPivotChart()&&t.forEachChildren(e=>{e.setAttributes({stroke:!1,fill:!1})}))}function fA(i){var t;const e=i.leftBottomCornerGroup.lastChild instanceof de?i.leftBottomCornerGroup.lastChild:(t=i.leftBottomCornerGroup.lastChild)===null||t===void 0?void 0:t._prev;e&&(nr(i.bottomFrozenGroup,e,i.bottomFrozenGroup.firstChild),i.bottomFrozenGroup.setAttribute("width",i.bottomFrozenGroup.attribute.width+e.attribute.width),i.leftBottomCornerGroup.setAttribute("width",i.leftBottomCornerGroup.attribute.width-e.attribute.width),i.table.isPivotChart()&&e.forEachChildren(n=>{var o,r,s,l;const a=i.table._getCellStyle(n.col,n.row),h=i.table.getCellRange(n.col,n.row),d=Pr(a,i.table,h?h.start.col:n.col,h?h.start.row:n.row,wt).theme;n.setAttributes({fill:(r=(o=d==null?void 0:d.group)===null||o===void 0?void 0:o.fill)!==null&&r!==void 0?r:void 0,stroke:(l=(s=d==null?void 0:d.group)===null||s===void 0?void 0:s.stroke)!==null&&l!==void 0?l:void 0})}))}function R5(i,t){const{table:e,proxy:n,rightTopCornerGroup:o,rightFrozenGroup:r,rightBottomCornerGroup:s,bottomFrozenGroup:l,bodyGroup:a,colHeaderGroup:h}=t,d=t.table.rightFrozenColCount;if(i>d){for(let c=e.colCount-d-1;c>=e.colCount-i;c--)nr(r,t.getColGroup(c),r.firstChild),nr(o,t.getColGroup(c,!0),o.firstChild),nr(s,t.getColGroupInBottom(c),s.firstChild);let u=0;r.forEachChildren(c=>{c.setAttribute("x",u),u+=c.attribute.width}),u=0,o.forEachChildren(c=>{c.setAttribute("x",u),u+=c.attribute.width}),u=0,s.forEachChildren(c=>{c.setAttribute("x",u),u+=c.attribute.width})}else if(i<d){for(let c=e.colCount-d;c<e.colCount-i;c++){const g=t.getColGroup(c);g.setAttribute("x",a.lastChild.attribute.x+e.getColWidth(a.lastChild.col)),a.appendChild(g);const f=t.getColGroupInRightTopCorner(c);f.setAttribute("x",h.lastChild.attribute.x+e.getColWidth(h.lastChild.col)),h.appendChild(f);const p=t.getColGroupInRightBottomCorner(c);p.setAttribute("x",l.lastChild.attribute.x+e.getColWidth(l.lastChild.col)),l.appendChild(p)}let u=0;r.forEachChildren(c=>{c.setAttribute("x",u),u+=c.attribute.width}),u=0,o.forEachChildren(c=>{c.setAttribute("x",u),u+=c.attribute.width}),u=0,s.forEachChildren(c=>{c.setAttribute("x",u),u+=c.attribute.width})}r.setAttribute("width",e.getColsWidth(e.colCount-i,e.colCount-1)),o.setAttribute("width",e.getColsWidth(e.colCount-i,e.colCount-1)),s.setAttribute("width",e.getColsWidth(e.colCount-i,e.colCount-1)),e.internalProps.rightFrozenColCount=i,t.updateContainer(),t.component.updateScrollBar(),t.updateNextFrame()}function A5(i,t){const{table:e,proxy:n,bottomFrozenGroup:o,leftBottomCornerGroup:r,rightBottomCornerGroup:s}=t;o.childrenCount||(n.table.isPivotChart()||(Si(r,0,0,0,e.frozenColCount-1,0,-1,"rowHeader",e),Si(s,0,0,e.colCount-e.rightFrozenColCount,e.colCount-1,0,-1,"body",e)),Si(o,0,0,n.colStart,n.colEnd,0,-1,"body",e));const l=t.table.bottomFrozenRowCount;if(i>l){for(let a=0;a<e.frozenColCount;a++){const h=t.getColGroupInLeftBottomCorner(a);for(let u=e.rowCount-l-1;u>=e.rowCount-i;u--)nr(h,t.getCell(a,u,!0),h.firstChild);let d=0;h.forEachChildren(u=>{u.setAttribute("y",d),d+=e.getRowHeight(u.row)})}for(let a=n.colStart;a<=n.colEnd;a++){const h=t.getColGroupInBottom(a);for(let u=e.rowCount-l-1;u>=e.rowCount-i;u--)nr(h,t.getCell(a,u,!0),h.firstChild);let d=0;h.forEachChildren(u=>{u.setAttribute("y",d),d+=e.getRowHeight(u.row)})}if(e.rightFrozenColCount>0)for(let a=e.colCount-e.rightFrozenColCount;a<e.colCount;a++){const h=t.getColGroupInRightBottomCorner(a);for(let u=e.rowCount-l-1;u>=e.rowCount-i;u--)nr(h,t.getCell(a,u,!0),h.firstChild);let d=0;h.forEachChildren(u=>{u.setAttribute("y",d),d+=e.getRowHeight(u.row)})}}else if(i<l){for(let a=0;a<e.rowHeaderLevelCount;a++){const h=t.getColGroup(a);for(let c=e.rowCount-l;c<e.rowCount-i;c++){const g=t.getCell(a,c,!0);g.setAttribute("y",h.lastChild.attribute.y+e.getRowHeight(h.lastChild.row)),h.appendChild(g)}const d=t.getColGroupInLeftBottomCorner(a);let u=0;d.forEachChildren(c=>{c.setAttribute("y",u),u+=e.getRowHeight(c.row)})}for(let a=n.colStart;a<=n.colEnd;a++){const h=t.getColGroup(a);for(let c=e.rowCount-l;c<e.rowCount-i;c++){const g=t.getCell(a,c,!0);g.setAttribute("y",h.lastChild.attribute.y+e.getRowHeight(h.lastChild.row)),h.appendChild(g)}const d=t.getColGroupInBottom(a);let u=0;d.forEachChildren(c=>{c.setAttribute("y",u),u+=e.getRowHeight(c.row)})}if(e.rightFrozenColCount>0)for(let a=e.colCount-e.rightFrozenColCount;a<e.colCount;a++){const h=t.getColGroup(a);for(let c=e.rowCount-l;c<e.rowCount-i;c++){const g=t.getCell(a,c,!0);g.setAttribute("y",h.lastChild.attribute.y+e.getRowHeight(h.lastChild.row)),h.appendChild(g)}const d=t.getColGroupInRightBottomCorner(a);let u=0;d.forEachChildren(c=>{c.setAttribute("y",u),u+=e.getRowHeight(c.row)})}}o.setAttribute("height",e.getRowsHeight(e.rowCount-i,e.rowCount-1)),r.setAttribute("height",e.getRowsHeight(e.rowCount-i,e.rowCount-1)),s.setAttribute("height",e.getRowsHeight(e.rowCount-i,e.rowCount-1)),e.internalProps.bottomFrozenRowCount=i,t.updateContainer(),t.component.updateScrollBar(),t.updateNextFrame()}function nr(i,t,e){t&&i&&(e?i.insertBefore(t,e):i.appendChild(t))}function T5(i,t){const{table:e}=i,n=e.internalProps.layoutMap,o=t===-1?"all":e.internalProps.columnResizeType;if(o==="column"){const r=i.getColGroup(t);if(r==null||r.forEachChildren(s=>{Tl(s,e.getColWidth(s.col),e.getRowHeight(s.row))}),e.widthMode==="adaptive"&&t<e.colCount-1){const s=i.getColGroup(t+1);s==null||s.forEachChildren(l=>{Tl(l,e.getColWidth(l.col),e.getRowHeight(l.row))})}}else{let r,s,l,a=e.rowHeaderLevelCount,h=e.colCount-1;if(o==="indicator")if(n.indicatorsAsCol)r=n.getIndicatorKey(t,e.columnHeaderLevelCount);else{const d=n.getCellHeaderPaths(t,e.columnHeaderLevelCount-1),u=d.colHeaderPaths[d.colHeaderPaths.length-1];s=u.dimensionKey,l=u.value}else if(o==="indicatorGroup"){const d=e.internalProps.layoutMap,u=d.getCellHeaderPaths(e.stateManager.columnResize.col,e.columnHeaderLevelCount),c=d.getHeadNodeByRowOrColDimensions(u.colHeaderPaths.slice(0,u.colHeaderPaths.length-1));a=c.startInTotal+e.frozenColCount,h=c.startInTotal+e.frozenColCount+c.size-1}for(let d=a;d<=h;d++){const u=i.getColGroup(d);if(u){if(o==="indicator"){const c=n.getIndicatorKey(d,e.columnHeaderLevelCount);if(n.indicatorsAsCol&&c!==r)continue;if(!n.indicatorsAsCol){const g=n.getCellHeaderPaths(d,e.columnHeaderLevelCount-1),f=g==null?void 0:g.colHeaderPaths[g.colHeaderPaths.length-1];if(!f||s!==f.dimensionKey||l!==f.value)continue}}u.forEachChildren(c=>{Tl(c,e.getColWidth(c.col),e.getRowHeight(c.row))})}}}}function M5(i,t){var e;const{table:n}=i,o=n.internalProps.layoutMap,r=n.stateManager,s=t===-1?"all":n.internalProps.rowResizeType;let l,a,h,d=n.columnHeaderLevelCount,u=n.rowCount-1;if(s==="indicator")if(o.indicatorsAsCol){const c=o.getCellHeaderPaths(n.rowHeaderLevelCount-1,t),g=(e=c.rowHeaderPaths)===null||e===void 0?void 0:e[c.rowHeaderPaths.length-1];a=g==null?void 0:g.dimensionKey,h=g==null?void 0:g.value}else l=o.getIndicatorKey(n.rowHeaderLevelCount,t);else if(s==="indicatorGroup"){const c=n.internalProps.layoutMap,g=c.getCellHeaderPaths(n.rowHeaderLevelCount,t),f=c.getHeadNodeByRowOrColDimensions(g.rowHeaderPaths.slice(0,g.rowHeaderPaths.length-1));d=f.startInTotal+n.frozenRowCount,u=f.startInTotal+n.frozenRowCount+f.size-1}for(let c=i.proxy.colStart;c<=i.proxy.colEnd;c++)if(s==="row"){const g=i.highPerformanceGetCell(c,t);if(g.role!=="cell")continue;if(Tl(g,n.getColWidth(g.col),n.getRowHeight(g.row)),n.heightMode==="adaptive"&&t<n.rowCount-1){const f=i.highPerformanceGetCell(c,t+1);Tl(f,n.getColWidth(f.col),n.getRowHeight(f.row))}}else for(let g=d;g<=u;g++){if(s==="indicator"){const p=o.getIndicatorKey(r.table.rowHeaderLevelCount,g);if(!o.indicatorsAsCol&&p!==l)continue;if(o.indicatorsAsCol){const m=o.getCellHeaderPaths(r.table.rowHeaderLevelCount-1,g),b=m==null?void 0:m.rowHeaderPaths[m.rowHeaderPaths.length-1];if(!b||a!==b.dimensionKey||h!==b.value)continue}}const f=i.highPerformanceGetCell(c,g);f.role==="cell"&&Tl(f,n.getColWidth(f.col),n.getRowHeight(f.row))}}function Th(i){var t;for(let e=i.proxy.colStart;e<=i.proxy.colEnd;e++){const n=i.getColGroup(e);(t=n==null?void 0:n.getChildren())===null||t===void 0||t.forEach(o=>{o.children.forEach(r=>{r.type==="chart"&&(r.cacheCanvas=null,r.addUpdateBoundTag())})})}}function B5(i,t,e){e.getCell(i,t).children.forEach(n=>{n.type==="chart"&&(n.cacheCanvas=null,n.addUpdateBoundTag())})}function P5(i){var t;const e=i.table;for(let n=i.proxy.colStart;n<=i.proxy.colEnd;n++){const o=i.getColGroup(n);(t=o==null?void 0:o.getChildren())===null||t===void 0||t.forEach(r=>{const s=r.col,l=r.row;r.children.forEach(a=>{if(a.type==="chart"){a.updateData(e.getCellValue(s,l));const h=a.attribute.spec,d=h.type;if(d!=="gauge"&&d!=="rose"&&d!=="radar"){const u=e.internalProps.layoutMap.getChartAxes(s,l);a.setAttribute("axes",u),h.axes=u}a.setAttribute("spec",h)}})})}dg(i.rowHeaderGroup,i.table),dg(i.colHeaderGroup,i.table),dg(i.rightFrozenGroup,i.table),dg(i.bottomFrozenGroup,i.table)}function H5(i,t){const e=i.table;if(e.isPivotChart()){const n=e._selectedDataItemsInChart.length;if((t===null||(t==null?void 0:t.length)===0||Object.keys(t).length===0)&&n===0)return;const o=[];if(Array.isArray(t))t.forEach(r=>{if(r&&r.key!==0&&Object.keys(r).length>0){const s={};for(const l in r)l.startsWith("VGRAMMAR_")||l.startsWith("__VCHART")||(s[l]=r[l]);o.push(s)}});else if(t&&t.key!==0&&Object.keys(t).length>0){const r={};for(const s in t)s.startsWith("VGRAMMAR_")||s.startsWith("__VCHART")||(r[s]=t[s]);o.push(r)}sa(e._selectedDataItemsInChart,o)||(e._selectedDataItemsInChart=o,e.internalProps.layoutMap.updateDataStateToChartInstance(),Th(i),e.scenegraph.updateNextFrame())}}function dg(i,t){i.forEachChildren(e=>{e.role==="column"&&e.forEachChildren(n=>{var o;if(n.role==="cell"){let r=!1;if(n.forEachChildren(s=>s.name==="axis"&&(r=!0,!0)),r){const s=t.internalProps.layoutMap.getAxisConfigInPivotChart(n.col,n.row),l=t._getCellStyle(n.col,n.row),a=Qt(wt("padding",l,n.col,n.row,t)),h=new(Bt.getComponent("axis"))(s,n.attribute.width,n.attribute.height,(o=s.__vtablePadding)!==null&&o!==void 0?o:a,t);n.clear(),n.appendChild(h.component),h.overlap()}}})})}function Tl(i,t,e){i.forEachChildren(n=>{n.type==="chart"&&(n.cacheCanvas=null,n.setAttributes({width:Math.ceil(t-n.attribute.cellPadding[3]-n.attribute.cellPadding[1]),height:Math.ceil(e-n.attribute.cellPadding[0]-n.attribute.cellPadding[2])}))})}function E5(i){const t=i.table.tableNoFrameWidth,e=i.table.tableNoFrameHeight;i.tableGroup=new de({x:0,y:0,width:t,height:e,clip:!0,pickable:!1}),i.tableGroup.role="table";const n=So(0,0,!i.table.options.enableTreeStickCell);n.role="col-header",i.colHeaderGroup=n;const o=So(0,0,!i.table.options.enableTreeStickCell);o.role="corner-header",i.cornerHeaderGroup=o;const r=So(0,0,!0);r.role="row-header",i.rowHeaderGroup=r;const s=So(t,0,!0);s.role="body",i.bodyGroup=s;const l=So(0,0,!0);l.role="right-frozen",i.rightFrozenGroup=l;const a=So(0,0,!0);a.role="bottom-frozen",i.bottomFrozenGroup=a;const h=So(0,0);h.role="component",i.componentGroup=h;const d=So(0,0,!0);d.role="corner-right-top-header",i.rightTopCornerGroup=d;const u=So(0,0,!0);u.role="corner-right-bottom-header",i.rightBottomCornerGroup=u;const c=So(0,0,!0);c.role="corner-left-bottom-header",i.leftBottomCornerGroup=c,i.tableGroup.addChild(s),i.tableGroup.addChild(r),i.tableGroup.addChild(a),i.tableGroup.addChild(n),i.tableGroup.addChild(l),i.tableGroup.addChild(u),i.tableGroup.addChild(d),i.tableGroup.addChild(c),i.tableGroup.addChild(o),i.tableGroup.addChild(h)}function So(i,t,e){return new de({x:0,y:0,width:i,height:t,clip:e!=null&&e,pickable:!1})}function or(i,t){return i.forEachChildrenSkipChild((e,n)=>{e.setAttribute("x",t),t+=e.attribute.width}),t}function L5(i,t,e){i!==-1&&t!==-1&&(ao(i,t,n=>n.attribute.visibleTime==="mouseenter_cell",n=>{n.setAttribute("opacity",0);const o=n.parent.getChildByName("icon-back");o&&o.setAttribute("visible",!1)},e),e.updateNextFrame())}function k5(i,t,e){i!==-1&&t!==-1&&(ao(i,t,n=>n.attribute.visibleTime==="mouseenter_cell",n=>{n.setAttribute("opacity",1)},e),e.updateNextFrame())}function F5(i,t,e){i!==-1&&t!==-1&&(ao(i,t,n=>n.attribute.visibleTime==="click_cell",n=>{n.setAttribute("opacity",0)},e),e.updateNextFrame())}function I5(i,t,e){i!==-1&&t!==-1&&(ao(i,t,n=>n.attribute.visibleTime==="click_cell",n=>{n.setAttribute("opacity",1)},e),e.updateNextFrame())}function D5(i,t,e,n,o){let r;return o.getCell(i,t).forEachChildren(s=>{s.role&&s.role.startsWith("icon")&&s.containsPoint(e,n,da.GLOBAL)&&(r=s)}),r}function O5(i,t,e,n,o){var r,s;if((i.attribute.backgroundColor||i.attribute.hoverImage)&&ao(t,e,l=>l.name===i.name,l=>{var a,h,d,u,c,g,f,p;if(l.attribute.backgroundColor){let m=l.parent.getChildByName("icon-back");m?m.setAttributes({x:((a=l.attribute.x)!==null&&a!==void 0?a:0)+(l.AABBBounds.width()-l.backgroundWidth)/2,y:((h=l.attribute.y)!==null&&h!==void 0?h:0)+(l.AABBBounds.height()-l.backgroundHeight)/2,dx:(d=l.attribute.dx)!==null&&d!==void 0?d:0,dy:(u=l.attribute.dy)!==null&&u!==void 0?u:0,width:l.backgroundWidth,height:l.backgroundHeight,fill:l.attribute.backgroundColor,cornerRadius:5,visible:!0}):(m=Fe({x:((c=l.attribute.x)!==null&&c!==void 0?c:0)+(l.AABBBounds.width()-l.backgroundWidth)/2,y:((g=l.attribute.y)!==null&&g!==void 0?g:0)+(l.AABBBounds.height()-l.backgroundHeight)/2,dx:(f=l.attribute.dx)!==null&&f!==void 0?f:0,dy:(p=l.attribute.dy)!==null&&p!==void 0?p:0,width:l.backgroundWidth,height:l.backgroundHeight,fill:l.attribute.backgroundColor,cornerRadius:5,pickable:!1,visible:!0}),m.name="icon-back"),l.parent.insertBefore(m,l)}l.attribute.hoverImage&&l.attribute.image!==l.attribute.hoverImage&&(l.image=l.attribute.hoverImage)},o),i.tooltip){const{x1:l,x2:a,y1:h,y2:d}=i.globalAABBBounds,u={content:i.tooltip.title,referencePosition:{rect:{left:l,right:a,top:h,bottom:d,width:i.globalAABBBounds.width(),height:i.globalAABBBounds.height()},placement:i.tooltip.placement},disappearDelay:i.tooltip.disappearDelay,style:Object.assign({},(r=o.table.internalProps.theme)===null||r===void 0?void 0:r.tooltipStyle,(s=i.tooltip)===null||s===void 0?void 0:s.style)};o.table.internalProps.tooltipHandler.isBinded(u)||o.table.showTooltip(t,e,u)}}function z5(i,t,e,n){(i.attribute.backgroundColor||i.attribute.hoverImage)&&ao(t,e,o=>o.name===i.name,o=>{const r=o.parent.getChildByName("icon-back");r&&r.setAttribute("visible",!1),o.attribute.hoverImage&&o.attribute.image!==o.attribute.originImage&&(o.image=o.attribute.originImage)},n)}function pA(i,t,e,n,o){const r=i.name;ao(e,n,s=>s.name===r,s=>{On(t,s),s.name=t.name},o),o.updateNextFrame()}function W5(i,t,e,n){const o=n.getCell(i,t);if(z(o.mergeStartCol)&&z(o.mergeStartRow)&&z(o.mergeEndCol)&&z(o.mergeEndRow))for(let r=o.mergeStartCol;r<=o.mergeEndCol;r++)for(let s=o.mergeStartRow;s<=o.mergeEndRow;s++){let l;n.getCell(r,s).forEachChildren(a=>a.attribute.funcType==="sort"&&(l=a,!0)),l&&(On(e,l),l.name=e.name)}else{let r;am(o,"children",s=>s.attribute.funcType==="sort"&&(r=s,!0)),r&&(On(e,r),r.name=e.name)}}function N5(i,t,e,n,o){const r=o.getCellRange(i,t),s=o.getCellRange(e,n);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}function V5(i){const{col:t,row:e,iconMark:n,order:o,oldSortCol:r,oldSortRow:s,oldIconMark:l,scene:a}=i,h=a.table.internalProps.headerHelper.getSortIcon(o,a.table,t,e);if(n&&pA(n,h,t,e,a),!N5(t,e,r,s,a.table)){const d=a.table.internalProps.headerHelper.getSortIcon("normal",a.table,r,s);l?pA(l,d,r,s,a):W5(r,s,d,a)}}function j5(i){for(let t=0;t<i.table.colCount;t++)for(let e=0;e<i.table.columnHeaderLevelCount;e++)ao(t,e,n=>n.attribute.funcType==="frozen",n=>{const o=i.table.internalProps.headerHelper.getFrozenIcon(t,e);On(o,n),n.name=o.name},i)}function $5(i,t,e){let n;n=e.table.isHeader(i,t)?e.table.internalProps.headerHelper.getHierarchyIcon(i,t):e.table.internalProps.bodyHelper.getHierarchyIcon(i,t),ao(i,t,o=>o.attribute.funcType===ve.collapse||o.attribute.funcType===ve.expand,o=>{On(n,o),o.name=n.name},e)}function Jm(i,t,e){i.forEachChildren(n=>{n.type==="group"?Jm(n,t,e):t(n)&&e(n)})}function ao(i,t,e,n,o){const r=o.getCell(i,t);if(r.role==="cell"&&z(r.mergeStartCol)&&z(r.mergeStartRow)&&z(r.mergeEndCol)&&z(r.mergeEndRow)){const{colStart:s,colEnd:l,rowStart:a,rowEnd:h}=kr(r,o);for(let d=s;d<=l;d++)for(let u=a;u<=h;u++)Jm(o.highPerformanceGetCell(d,u),e,n)}else Jm(r,e,n)}function G5(i,t,e){ao(i,t,n=>n.attribute.funcType===ve.dropDown,n=>{n.oldVisibleTime=n.attribute.visibleTime,n.setAttribute("visibleTime","always"),n.setAttribute("opacity",1)},e)}function U5(i,t,e){ao(i,t,n=>n.attribute.funcType===ve.dropDown,n=>{n.oldVisibleTime&&n.setAttribute("visibleTime",n.oldVisibleTime),n.setAttribute("opacity",n.attribute.visibleTime==="always"?1:0)},e)}function Qm(i,t){const{bgColor:e,borderColor:n,borderLineWidth:o,borderLineDash:r}=t,s={x:0,y:0,width:0,height:0,visible:!1,pickable:!0,fill:e};return s.stroke=Dm(n,void 0),s.lineWidth=o,r&&(s.lineDash=r),s.lineCap="butt",Array.isArray(n)&&(s.strokeArrayColor=Qt(n)),Array.isArray(o)&&(s.strokeArrayWidth=Qt(o),s.lineWidth=1),i.setAttributes(s),i.role="corner-frozen",i}function K5(i,t,e,n){const o=n.scenegraph,r=tv(i.map(c=>c.col)).sort((c,g)=>g-c),s=tv(t.map(c=>c.col)).sort((c,g)=>c-g),l=tv(e.map(c=>c.col)).sort((c,g)=>c-g);r.forEach(c=>{Y5(c,o)});const a=n.colWidthsMap;let h;if(r.forEach(c=>{a.delAndReorder(c)}),r.length&&mA(o),o.table._clearColRangeWidthsMap(),s.forEach(c=>{const g=X5(c,o);mA(o),h=h??g,a.addAndReorder(c)}),q5(o),l.forEach(c=>{for(let g=0;g<n.rowCount;g++){const f=ui(o.table,c,g);if(f)for(let p=f.start.col;p<=f.end.col;p++)for(let m=f.start.col;m<=f.end.col;m++)_o(m,g,o.table,!1);else _o(c,g,o.table,!1)}}),ft(h)){for(let c=h;c<n.colCount;c++)for(let g=0;g<n.rowCount;g++){const f=o.highPerformanceGetCell(c,g,!0);f&&(f.needUpdate=!0)}o.proxy.colUpdatePos=h}if(s.length){if(!ft(h)){const c=Math.min(...s);o.proxy.colUpdatePos=c}o.proxy.colUpdateDirection="left",o.proxy.updateColGroups(2*o.proxy.screenColCount),u(),o.proxy.progress()}else r.length&&(o.proxy.updateColGroups(2*o.proxy.screenColCount),u(),o.proxy.progress());const d=n.getColsWidth(n.frozenColCount,n.colCount-1);function u(){if((s==null?void 0:s[(s==null?void 0:s.length)-1])>=n.colCount-n.rightFrozenColCount||(l==null?void 0:l[(l==null?void 0:l.length)-1])>=n.colCount-n.rightFrozenColCount||(r==null?void 0:r[0])>=n.colCount-n.rightFrozenColCount){for(let c=n.colCount-n.rightFrozenColCount;c<n.colCount;c++)for(let g=0;g<n.rowCount;g++){const f=o.highPerformanceGetCell(c,g,!0);f&&(f.needUpdate=!0)}o.proxy.updateRightFrozenCellGroups()}}o.updateContainerWidth(o.table.frozenColCount,d-o.bodyGroup.attribute.width)}function Y5(i,t){const e=t.proxy;if(i>=t.table.rowHeaderLevelCount&&!(i>=t.table.colCount-t.table.rightFrozenColCount)){const o=t.getColGroup(i,!1);o&&o.parent===t.bodyGroup&&t.bodyGroup.removeChild(o);const r=t.getColGroupInBottom(i);r&&r.parent===t.bottomFrozenGroup&&t.bottomFrozenGroup.removeChild(r)}i>=e.colStart&&i<=e.colEnd&&(e.colEnd--,e.currentCol--),e.bodyRightCol--;const n=Math.min(e.colLimit,e.bodyRightCol-e.bodyLeftCol+1);e.totalActualBodyColCount=n,e.totalCol=e.colStart+n-1}function X5(i,t){const e=t.proxy;e.bodyRightCol++;const n=Math.min(e.colLimit,e.bodyRightCol-e.bodyLeftCol+1);if(e.totalActualBodyColCount=n,e.totalCol=e.colStart+n-1,!(i<e.colStart))return i>e.colEnd?e.colEnd-e.colStart+1<e.colLimit?(e.colEnd++,e.currentCol++,vA(i,t),i):void 0:(e.colEnd-e.colStart+1<e.colLimit&&(e.colEnd++,e.currentCol++,vA(i,t)),i)}function tv(i){const t=[];for(let e=0;e<i.length;e++)t.indexOf(i[e])===-1&&t.push(i[e]);return t}function mA(i){let t=i.bodyColStart;function e(n){n.col=t;const o=ui(i.table,n.col,n.row);o&&(n.mergeStartCol=o.start.col,n.mergeStartCol=o.start.col,n.mergeEndCol=o.end.col,n.mergeEndCol=o.end.col),n.role}i.bodyGroup.forEachChildren(n=>{n.col=t,n==null||n.forEachChildren(o=>{e(o)}),t++}),t=i.bodyColStart,i.colHeaderGroup.forEachChildren(n=>{n.col=t,n==null||n.forEachChildren(o=>{e(o)}),t++}),t=i.bodyColStart,i.bottomFrozenGroup.forEachChildren(n=>{n.col=t,n==null||n.forEachChildren(o=>{e(o)}),t++})}function q5(i){let t=i.bodyColStart,e=i.getCellGroupX(t);function n(o){o.col=t;const r=ui(i.table,o.col,o.row);r&&(o.mergeStartCol=r.start.col,o.mergeStartCol=r.start.col,o.mergeEndCol=r.end.col,o.mergeEndCol=r.end.col),o.role}i.bodyGroup.forEachChildren(o=>{o.col=t,o==null||o.forEachChildren(r=>{n(r)}),o.setAttribute("x",e),e+=o.attribute.width,t++}),t=i.bodyColStart,e=i.getCellGroupX(t),i.colHeaderGroup.forEachChildren(o=>{o.col=t,o==null||o.forEachChildren(r=>{n(r)}),o.setAttribute("x",e),e+=o.attribute.width,t++}),t=i.bodyColStart,e=i.getCellGroupX(t),i.bottomFrozenGroup.forEachChildren(o=>{o.col=t,o==null||o.forEachChildren(r=>{n(r)}),o.setAttribute("x",e),e+=o.attribute.width,t++}),t=i.table.colCount-i.table.rightFrozenColCount,e=0,i.rightFrozenGroup.forEachChildren(o=>{o.col=t,o==null||o.forEachChildren(r=>{n(r)}),o.setAttribute("x",e),e+=o.attribute.width,t++}),t=i.table.colCount-i.table.rightFrozenColCount,e=0,i.rightTopCornerGroup.forEachChildren(o=>{o.col=t,o==null||o.forEachChildren(r=>{n(r)}),o.setAttribute("x",e),e+=o.attribute.width,t++}),t=i.table.colCount-i.table.rightFrozenColCount,e=0,i.rightBottomCornerGroup.forEachChildren(o=>{o.col=t,o==null||o.forEachChildren(r=>{n(r)}),o.setAttribute("x",e),e+=o.attribute.width,t++})}function vA(i,t){if(t.colHeaderGroup&&t.table.columnHeaderLevelCount>0){const n=new de({x:0,y:0,width:t.table.getColWidth(i),height:0,clip:!1,pickable:!1});n.role="column",n.col=i;const o=t.getColGroup(i,!0);o?t.colHeaderGroup.insertBefore(n,o):t.colHeaderGroup.appendChild(n),e(n,i,0,t.table.columnHeaderLevelCount-1)}if(t.bodyGroup){const n=new de({x:0,y:0,width:t.table.getColWidth(i),height:0,clip:!1,pickable:!1});n.role="column",n.col=i;const o=t.getColGroup(i,!1);o?t.bodyGroup.insertBefore(n,o):t.bodyGroup.appendChild(n),e(n,i,t.bodyRowStart,t.bodyRowEnd)}if(t.bottomFrozenGroup&&t.table.bottomFrozenRowCount>0){const n=new de({x:0,y:0,width:t.table.getColWidth(i),height:0,clip:!1,pickable:!1});n.role="column",n.col=i;const o=t.getColGroupInBottom(i);o?t.bottomFrozenGroup.insertBefore(n,o):t.bottomFrozenGroup.appendChild(n),e(n,i,t.table.rowCount-t.table.bottomFrozenRowCount,t.table.rowCount-1)}function e(n,o,r,s){for(let l=r;l<=s;l++){const a=new de({x:0,y:0,width:t.table.getColWidth(o),height:t.table.getRowHeight(l)});a.role="cell",a.col=o,a.row=l,a.needUpdate=!0,n.appendChild(a)}}}function Z5(i){var t,e,n,o;if(!i.options.animationAppear)return;let r,s,l,a;i.options.animationAppear===!0?(r=500,s=0,l="one-by-one",a="column"):(r=(t=i.options.animationAppear.duration)!==null&&t!==void 0?t:500,s=(e=i.options.animationAppear.delay)!==null&&e!==void 0?e:0,l=(n=i.options.animationAppear.type)!==null&&n!==void 0?n:"one-by-one",a=(o=i.options.animationAppear.direction)!==null&&o!==void 0?o:"row");const{scenegraph:h,frozenColCount:d,frozenRowCount:u}=i,{colStart:c,colEnd:g,rowStart:f,rowEnd:p}=h.proxy;for(let m=0;m<=g;m++)for(let b=0;b<=p;b++){const C=h.highPerformanceGetCell(m,b);C&&C.role==="cell"&&C.forEachChildren(_=>{_.setAttribute("opacity",0),_.animate().wait(l==="one-by-one"?(a==="row"?b:m)*(r-s):s).to({opacity:1},r,"linear")})}}function J5(i,t){const{selectedRangeComponents:e}=t;e.forEach((n,o)=>{n.rect.setAttributes(i)}),t.updateNextFrame()}ix(),Gt.load(WW),Gt.load(rW);class Q5{constructor(t){let e,n;this._needUpdateContainer=!1,this.table=t,this.hasFrozen=!1,this.clear=!0,this.mergeMap=new Map,tO(this.table.theme.textPopTipStyle),t.options.canvas&&t.options.viewBox?(Ke.setEnv("browser"),e=t.options.viewBox.x2-t.options.viewBox.x1,n=t.options.viewBox.y2-t.options.viewBox.y1):oe.mode==="node"?(Ke.setEnv("node",t.options.modeParams),e=t.canvasWidth,n=t.canvasHeight):(Ke.setEnv("browser"),e=t.canvas.width,n=t.canvas.height),this.stage=QF(Object.assign({canvas:t.canvas,width:e,height:n,disableDirtyBounds:!1,background:t.theme.underlayBackgroundColor,dpr:t.internalProps.pixelRatio,enableLayout:!0,beforeRender:o=>{this.table.options.beforeRender&&this.table.options.beforeRender(o),this.table.animationManager.ticker.start()},afterRender:o=>{this.table.options.afterRender&&this.table.options.afterRender(o),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(e=(t=this.tableGroup.attribute)===null||t===void 0?void 0:t.width)!==null&&e!==void 0?e:0}get height(){var t,e;return(e=(t=this.tableGroup.attribute)===null||t===void 0?void 0:t.height)!==null&&e!==void 0?e:0}get x(){var t,e;return(e=(t=this.tableGroup.attribute)===null||t===void 0?void 0:t.x)!==null&&e!==void 0?e:0}get y(){var t,e;return(e=(t=this.tableGroup.attribute)===null||t===void 0?void 0:t.y)!==null&&e!==void 0?e:0}get bodyRowStart(){var t;return(t=this.proxy.rowStart)!==null&&t!==void 0?t:0}get bodyRowEnd(){var t;return(t=this.proxy.rowEnd)!==null&&t!==void 0?t:this.table.rowCount-1}get bodyColStart(){var t;return(t=this.proxy.colStart)!==null&&t!==void 0?t:0}get bodyColEnd(){var t;return(t=this.proxy.colEnd)!==null&&t!==void 0?t:this.table.colCount-1}initSceneGraph(){this.isPivot=this.table.isPivotTable(),E5(this)}clearCells(){var t,e;this.table.animationManager.clear(),(this.table.isPivotChart()||this.table._hasCustomRenderOrLayout())&&this.stage.pluginService.findPluginsByName("poptipForText").forEach(n=>{n.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),(t=this.proxy)===null||t===void 0||t.release(),(e=this.table.reactCustomLayout)===null||e===void 0||e.clearCache()}updateStageBackground(){this.stage.background=this.table.theme.underlayBackgroundColor,this.stage.renderNextFrame()}createComponent(){this.component=new SW(this.table),this.component.addToGroup(this.componentGroup),this.selectedRangeComponents=new Map,this.selectingRangeComponents=new Map,this.customSelectedRangeComponents=new Map}updateComponent(){this.component.updateStyle()}createSceneGraph(t=!1){t||(this.table.rowHeightsMap.clear(),this.table.internalProps.layoutMap.clearCellRangeMap()),(this.table.isPivotChart()||this.table._hasCustomRenderOrLayout())&&this.stage.pluginService.autoEnablePlugins.getContributions().forEach(e=>{e.name==="poptipForText"&&this.stage.pluginService.register(e)}),this.clear=!1,this.frozenColCount=this.table.frozenColCount,this.frozenRowCount=this.table.frozenRowCount,this.proxy=new h5(this.table),xl(this.tableGroup,this.table.theme.frameStyle,this.tableGroup.role,void 0,!0),this.table.isPivotChart()&&(Qm(this.rightTopCornerGroup,this.table.theme.cornerRightTopCellStyle||this.table.theme.cornerHeaderStyle||{}),Qm(this.leftBottomCornerGroup,this.table.theme.cornerLeftBottomCellStyle||this.table.theme.cornerHeaderStyle||{}),Qm(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,n){var o,r,s,l,a,h;let d;if(d=this.table.rightFrozenColCount>0&&t>=this.table.colCount-this.table.rightFrozenColCount&&e<this.table.frozenRowCount?(o=this.rightTopCornerGroup.getColGroup(t))===null||o===void 0?void 0:o.getRowGroup(e):this.table.bottomFrozenRowCount>0&&e>=this.table.rowCount-this.table.bottomFrozenRowCount&&t<this.table.frozenColCount?(r=this.leftBottomCornerGroup.getColGroup(t))===null||r===void 0?void 0:r.getRowGroup(e):this.table.rightFrozenColCount>0&&this.table.bottomFrozenRowCount>0&&t>=this.table.colCount-this.table.rightFrozenColCount&&e>=this.table.rowCount-this.table.bottomFrozenRowCount?(s=this.rightBottomCornerGroup.getColGroup(t))===null||s===void 0?void 0:s.getRowGroup(e):this.table.rightFrozenColCount>0&&t>this.table.colCount-1-this.table.rightFrozenColCount?(l=this.rightFrozenGroup.getColGroup(t))===null||l===void 0?void 0:l.getRowGroup(e):this.table.bottomFrozenRowCount>0&&e>this.table.rowCount-1-this.table.bottomFrozenRowCount?(a=this.bottomFrozenGroup.getColGroup(t))===null||a===void 0?void 0:a.getRowGroup(e):(h=this.getColGroup(t,e<this.frozenRowCount))===null||h===void 0?void 0:h.getRowGroup(e),d&&d.role==="shadow-cell"&&!n){const u=this.table.getCellRange(t,e);u.start.col===t&&u.start.row===e||(d=this.getCell(u.start.col,u.start.row))}return d||sg}highPerformanceGetCell(t,e,n){return this.proxy.highPerformanceGetCell(t,e,n)}getColGroup(t,e=!1){let n;return n=t<this.frozenColCount&&e?this.cornerHeaderGroup.getColGroup(t):t<this.frozenColCount?this.rowHeaderGroup.getColGroup(t):e&&this.table.rightFrozenColCount>0&&t>this.table.colCount-1-this.table.rightFrozenColCount?this.rightTopCornerGroup.getColGroup(t):!e&&this.table.rightFrozenColCount>0&&t>this.table.colCount-1-this.table.rightFrozenColCount?this.rightFrozenGroup.getColGroup(t):e?this.colHeaderGroup.getColGroup(t):this.bodyGroup.getColGroup(t),n||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 n=this.getCell(t,e),o=ui(this.table,t,e);let r=n.attribute.width,s=n.attribute.height;return o&&(r/=o.end.col-o.start.col+1,s/=o.end.row-o.start.row+1),{width:r,height:s}}updateNextFrame(){this.updateContainerSync(),this.resetAllSelectComponent(),this.stage.renderNextFrame()}resetAllSelectComponent(){var t,e,n,o;(((e=(t=this.table.stateManager.select)===null||t===void 0?void 0:t.ranges)===null||e===void 0?void 0:e.length)>0||((o=(n=this.table.stateManager.select)===null||n===void 0?void 0:n.customSelectRanges)===null||o===void 0?void 0:o.length)>0)&&tA(this)}hideHoverIcon(t,e){L5(t,e,this)}showHoverIcon(t,e){k5(t,e,this)}hideClickIcon(t,e){F5(t,e,this)}showClickIcon(t,e){I5(t,e,this)}getIcon(t,e,n,o){return D5(t,e,n,o,this)}setIconHoverStyle(t,e,n,o){O5(t,e,n,o,this)}updateSortIcon(t){const{col:e,row:n,iconMark:o,order:r,oldSortCol:s,oldSortRow:l,oldIconMark:a}=t;V5({col:e,row:n,iconMark:o,order:r,oldSortCol:s,oldSortRow:l,oldIconMark:a,scene:this})}updateFrozenIcon(t,e){j5(this)}updateHierarchyIcon(t,e){$5(t,e,this)}setIconNormalStyle(t,e,n){z5(t,e,n,this)}residentHoverIcon(t,e){G5(t,e,this)}resetResidentHoverIcon(t,e){U5(t,e,this)}deactivateChart(t,e){var n,o;if(t===-1||e===-1)return;const r=this.getCell(t,e);(o=(n=r==null?void 0:r.firstChild)===null||n===void 0?void 0:n.deactivate)===null||o===void 0||o.call(n)}activateChart(t,e){var n,o;if(t===-1||e===-1)return;const r=this.getCell(t,e);(o=(n=r==null?void 0:r.firstChild)===null||n===void 0?void 0:n.activate)===null||o===void 0||o.call(n,this.table)}removeInteractionBorder(t,e){const n=this.getCell(t,e);n.setAttribute("highlightStroke",void 0),n.setAttribute("highlightStrokeArrayWidth",void 0),n.setAttribute("highlightStrokeArrayColor",void 0)}createCellSelectBorder(t,e,n,o,r,s,l){u5(this,t,e,n,o,r,s,l)}moveSelectingRangeComponentsToSelectedRangeComponents(){oA(this)}deleteLastSelectedRangeComponents(){c5(this)}deleteAllSelectBorder(){rA(this),sA(this)}updateCellSelectBorder(t,e=!0){eA(this,t,e)}removeFillHandleFromSelectComponents(){g5(this)}recreateAllSelectRangeComponents(){rA(this),this.table.stateManager.select.ranges.forEach(t=>{eA(this,t),oA(this)})}updateColWidth(t,e,n,o){bW(this,t,Math.round(e),o),n||this.updateContainer(!0)}updateChartSizeForResizeColWidth(t){T5(this,t)}updateChartSizeForResizeRowHeight(t){M5(this,t)}updateChartState(t){this.table.isPivotChart()&&H5(this,t)}updateCheckboxCellState(t,e,n){var o,r;if(this.table.transpose)(o=this.bodyGroup.children)===null||o===void 0||o.forEach(s=>{var l;(l=s.getChildAt(e))===null||l===void 0||l.getChildren().forEach(a=>{a.name==="checkbox"&&a.setAttribute("checked",n)})});else{const s=this.getColGroup(t);(r=s==null?void 0:s.children)===null||r===void 0||r.forEach(l=>{l.getChildren().find(a=>{a.name==="checkbox"&&a.setAttribute("checked",n)})})}}updateHeaderCheckboxCellState(t,e,n){var o,r;this.table.transpose?(o=this.rowHeaderGroup.children)===null||o===void 0||o.forEach(s=>{s.getChildAt(e).getChildren().forEach(l=>{l.name==="checkbox"&&(n==="indeterminate"?(l.setAttribute("indeterminate",!0),l.setAttribute("checked",void 0)):(l.setAttribute("indeterminate",void 0),l.setAttribute("checked",n)))})}):(r=this.getColGroup(t,!0).children)===null||r===void 0||r.forEach(s=>{s.getChildren().find(l=>{l.name==="checkbox"&&(n==="indeterminate"?(l.setAttribute("indeterminate",!0),l.setAttribute("checked",void 0)):(l.setAttribute("indeterminate",void 0),l.setAttribute("checked",n)))})})}updateAutoColWidth(t){this.table.internalProps._widthResizedColMap.delete(t);const e=this.table.getColWidth(t),n=Fr(t,0,this.table.rowCount-1,this.table,!0);n!==e&&this.updateColWidth(t,n-e)}recalculateColWidths(){const t=this.table;t.widthMode==="adaptive"||t.autoFillWidth||t.internalProps.transpose?Wn(this.table,0,this.table.colCount-1,!0):(t._clearColRangeWidthsMap(),t.frozenColCount>0&&Wn(this.table,0,t.frozenColCount-1,!0),t.rightFrozenColCount>0&&Wn(this.table,t.rightFrozenColCount,t.colCount-1,!0),Wn(t,this.proxy.colStart,this.proxy.colEnd,!0))}recalculateRowHeights(){const t=this.table;t.internalProps.useOneRowHeightFillAll=!1,t.heightMode==="adaptive"||t.autoFillHeight?zn(this.table,0,this.table.rowCount-1,!0,!0):(t.frozenRowCount>0&&zn(this.table,0,t.frozenRowCount-1,!0,!0),t.bottomFrozenRowCount>0&&zn(this.table,t.bottomFrozenRowCount,t.rowCount-1,!0,!0),zn(t,this.proxy.rowStart,this.proxy.rowEnd,!0,!0))}resize(){this.proxy.resize(),(this.table.widthMode==="adaptive"||this.table.autoFillWidth)&&(this.table.internalProps._widthResizedColMap.size===0?this.recalculateColWidths():this.dealWidthMode()),this.table.heightMode==="adaptive"?this.table.internalProps._heightResizedRowMap.size===0?this.recalculateRowHeights():this.dealHeightMode():this.table.autoFillHeight&&this.dealHeightMode(),this.resetFrozen(),this.updateTableSize(),this.updateBorderSizeAndPosition(),this.component.updateScrollBar(),(this.table.widthMode==="adaptive"||this.table.heightMode==="adaptive"||this.table.autoFillWidth||this.table.autoFillHeight)&&this.updateChartSizeForResizeColWidth(-1),this.proxy.progress(),this.updateNextFrame()}updateTableSize(){var t,e,n,o,r,s,l,a,h,d,u,c,g;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 f=(t=this.tableGroup.border)===null||t===void 0?void 0:t.attribute;let p,m,b,C;f!=null&&f.strokeArrayWidth?(p=f.strokeArrayWidth?f.strokeArrayWidth[0]:(e=f.lineWidth)!==null&&e!==void 0?e:0,m=f.strokeArrayWidth?f.strokeArrayWidth[1]:(n=f.lineWidth)!==null&&n!==void 0?n:0,b=f.strokeArrayWidth?f.strokeArrayWidth[2]:(o=f.lineWidth)!==null&&o!==void 0?o:0,C=f.strokeArrayWidth?f.strokeArrayWidth[3]:(r=f.lineWidth)!==null&&r!==void 0?r:0):(p=(s=f==null?void 0:f.lineWidth)!==null&&s!==void 0?s:0,m=(l=f==null?void 0:f.lineWidth)!==null&&l!==void 0?l:0,b=(a=f==null?void 0:f.lineWidth)!==null&&a!==void 0?a:0,C=(h=f==null?void 0:f.lineWidth)!==null&&h!==void 0?h:0),this.tableGroup.border.type==="rect"?!((d=this.table.theme.frameStyle)===null||d===void 0)&&d.innerBorder?this.tableGroup.border.setAttributes({x:this.table.tableX+C/2,y:this.table.tableY+p/2,width:this.tableGroup.attribute.width-C/2-m/2,height:this.tableGroup.attribute.height-p/2-b/2}):this.tableGroup.border.setAttributes({x:this.table.tableX-C/2,y:this.table.tableY-p/2,width:this.tableGroup.attribute.width+C/2+m/2,height:this.tableGroup.attribute.height+p/2+b/2}):this.tableGroup.border.type==="group"&&(!((u=this.table.theme.frameStyle)===null||u===void 0)&&u.innerBorder?(this.tableGroup.border.setAttributes({x:this.table.tableX+C/2,y:this.table.tableY+p/2,width:this.tableGroup.attribute.width-C/2-m/2,height:this.tableGroup.attribute.height-p/2-b/2}),(c=this.tableGroup.border.firstChild)===null||c===void 0||c.setAttributes({x:0,y:0,width:this.tableGroup.attribute.width-C/2-m/2,height:this.tableGroup.attribute.height-p/2-b/2})):(this.tableGroup.border.setAttributes({x:this.table.tableX-C/2,y:this.table.tableY-p/2,width:this.tableGroup.attribute.width+C/2+m/2,height:this.tableGroup.attribute.height+p/2+b/2}),(g=this.tableGroup.border.firstChild)===null||g===void 0||g.setAttributes({x:C/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,n){e=Math.round(e),SR(this,t,e,n),this.updateContainerHeight(t,e)}updateRowsHeight(t,e,n){for(let o=0;o<t.length;o++){const r=t[o];if(r>=this.proxy.rowStart&&r<=this.proxy.rowEnd){const s=e[o];SR(this,r,Math.round(s),n),this._updateContainerHeight(r,s)}}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 n=this.table.getColWidth(t);n!==e&&(this.updateColWidth(t,e-n),this.table._clearColRangeWidthsMap(t))}setRowHeight(t,e){const n=this.table.getRowHeight(t);n!==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-n),this.table._clearRowRangeHeightsMap(t))}setX(t,e=!1){this.table.scenegraph.proxy.setX(-t,e)}setY(t,e=!1){this.table.scenegraph.proxy.setY(-t,e)}setBodyAndRowHeaderY(t){var e,n;const o=(e=this.bodyGroup.firstChild)===null||e===void 0?void 0:e.firstChild,r=(n=this.bodyGroup.firstChild)===null||n===void 0?void 0:n.lastChild;t===0&&o&&o.row===this.table.frozenRowCount&&o.attribute.y+t<0?t=-o.attribute.y:r&&this.table.tableNoFrameHeight<this.table.getAllRowsHeight()&&r.row===this.table.rowCount-this.table.bottomFrozenRowCount-1&&r.attribute.y+r.attribute.height+t<this.table.tableNoFrameHeight-this.table.getFrozenRowsHeight()-this.table.getBottomFrozenRowsHeight()&&(t=this.table.tableNoFrameHeight-this.table.getFrozenRowsHeight()-this.table.getBottomFrozenRowsHeight()-r.attribute.y-r.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,n=this.bodyGroup.lastChild;t===0&&e&&e.col===this.table.frozenColCount&&e.attribute.x+t<0?t=-e.attribute.x:n&&this.table.tableNoFrameWidth<this.table.getAllColsWidth()&&n.col===this.table.colCount-this.table.rightFrozenColCount-1&&n.attribute.x+n.attribute.width+t<this.table.tableNoFrameWidth-this.table.getFrozenColsWidth()-this.table.getRightFrozenColsWidth()&&(t=this.table.tableNoFrameWidth-this.table.getFrozenColsWidth()-this.table.getRightFrozenColsWidth()-n.attribute.x-n.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(),Ah(this.table),this.table.options.animationAppear&&Z5(this.table),this.updateNextFrame()}dealWidthMode(){const t=this.table;if(t.widthMode==="adaptive"){t._clearColRangeWidthsMap();const s=t.tableNoFrameWidth;let l=0;for(let d=0;d<t.colCount;d++)(d<t.rowHeaderLevelCount||t.isPivotChart()&&d>=t.colCount-t.rightFrozenColCount)&&(l+=t.getColWidth(d));const a=t.rowHeaderLevelCount,h=t.isPivotChart()?t.colCount-t.rightFrozenColCount:t.colCount;rg(s-l,a,h,!1,[],t,!0)}else if(t.autoFillWidth){t._clearColRangeWidthsMap();const s=t.tableNoFrameWidth;let l=0,a=0;for(let h=0;h<t.colCount;h++){const d=t.getColWidth(h);(h<t.rowHeaderLevelCount||t.isPivotChart()&&h>=t.colCount-t.rightFrozenColCount)&&(l+=d),a+=d}if(a<s&&a>l){const h=t.rowHeaderLevelCount,d=t.isPivotChart()?t.colCount-t.rightFrozenColCount:t.colCount;rg(s-l,h,d,!1,[],t,!0)}}let e=0;this.bodyGroup.forEachChildrenSkipChild(s=>{e+=s.attribute.width}),this.bodyGroup.setAttribute("width",e);let n=0;this.colHeaderGroup.forEachChildrenSkipChild(s=>{n+=s.attribute.width}),this.colHeaderGroup.setAttribute("width",n);let o=0;this.rowHeaderGroup.forEachChildrenSkipChild(s=>{o+=s.attribute.width}),this.rowHeaderGroup.setAttribute("width",o);let r=0;this.cornerHeaderGroup.forEachChildrenSkipChild(s=>{r+=s.attribute.width}),this.cornerHeaderGroup.setAttribute("width",r),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(e.heightMode==="adaptive"){e._clearRowRangeHeightsMap();const n=e.getRowsHeight(0,e.columnHeaderLevelCount-1),o=e.isPivotChart()?e.getBottomFrozenRowsHeight():0,r=e.tableNoFrameHeight-n-o,s=e.columnHeaderLevelCount,l=e.isPivotChart()?e.rowCount-e.bottomFrozenRowCount:e.rowCount;let a=0;for(let d=s;d<l;d++)a+=e.getRowHeight(d);const h=r/a;for(let d=s;d<l;d++){let u;u=d===l-1?r-e.getRowsHeight(s,l-2):Math.round(e.getRowHeight(d)*h),this.setRowHeight(d,u)}}else if(e.autoFillHeight){e._clearRowRangeHeightsMap();const n=e.tableNoFrameHeight;let o=0,r=0;for(let s=0;s<e.rowCount;s++){const l=e.getRowHeight(s);(s<e.columnHeaderLevelCount||e.isPivotChart()&&s>=e.rowCount-e.bottomFrozenRowCount)&&(r+=l),o+=l}if(((t=this._dealAutoFillHeightOriginRowsHeight)!==null&&t!==void 0?t:o)<n&&o-r>0){const s=e.columnHeaderLevelCount,l=e.isPivotChart()?e.rowCount-e.bottomFrozenRowCount:e.rowCount,a=(n-r)/(o-r);for(let h=s;h<l;h++){let d;d=h===l-1?n-r-e.getRowsHeight(s,l-2):Math.round(e.getRowHeight(h)*a),this.setRowHeight(h,d)}}}}dealFrozen(){S5(this)}resetFrozen(){x5(this)}updateCellLayoutWidthCertainWidth(t,e,n){const o=t.attribute.width;let r=!1;return t.forEachChildren((s,l)=>{l+=e;const a=ui(this.table,n,l);a?s=this.getCell(a.start.col,a.start.row):s.setAttribute("width",o);const h=this.table._getCellStyle(n,l),d=Qt(wt("padding",h,n,l,this.table)),u=s.getChildByName("text");let c=0,g=0;if(u)c=u.AABBBounds.height()+(d[0]+d[2]),u.setAttribute("maxLineWidth",o-(d[1]+d[3])),g=u.AABBBounds.height()+(d[0]+d[2]);else{const p=s.getChildAt(1);c=p.AABBBounds.height()+(d[0]+d[2]),p._cellWidth=o-(d[1]+d[3]),p.layout(),g=p.AABBBounds.height()+(d[0]+d[2])}const f=this.table.getRowHeight(l);s.attribute.height!==g&&(s.setAttribute("height",g),(f===c||g>f)&&(r=!0))}),r}updateHeaderPosition(t,e,n,o,r){d5(t,e,n,o,r,this.table)}updateContainerAttrWidthAndX(){var t,e,n;const o=or(this.cornerHeaderGroup,0),r=or(this.rowHeaderGroup,0),s=this.colHeaderGroup.hasChildNodes()&&this.colHeaderGroup.firstChild?or(this.colHeaderGroup,this.colHeaderGroup.firstChild.col>0?this.table.getColsWidth((t=this.table.frozenColCount)!==null&&t!==void 0?t:0,this.colHeaderGroup.firstChild.col-1):0):0,l=this.bodyGroup.hasChildNodes()&&this.bodyGroup.firstChild?or(this.bodyGroup,this.bodyGroup.firstChild.col>0?this.table.getColsWidth((e=this.table.frozenColCount)!==null&&e!==void 0?e:0,this.bodyGroup.firstChild.col-1):0):0,a=or(this.rightFrozenGroup.childrenCount>0?this.rightFrozenGroup:this.rightTopCornerGroup,0);this.bottomFrozenGroup.hasChildNodes()&&this.bottomFrozenGroup.firstChild&&or(this.bottomFrozenGroup,this.bottomFrozenGroup.firstChild.col>0?this.table.getColsWidth((n=this.table.frozenColCount)!==null&&n!==void 0?n:0,this.bottomFrozenGroup.firstChild.col-1):0),or(this.leftBottomCornerGroup,0),or(this.rightTopCornerGroup,0),or(this.rightBottomCornerGroup,0),this.cornerHeaderGroup.setDeltaWidth(o-this.cornerHeaderGroup.attribute.width),this.leftBottomCornerGroup.setDeltaWidth(o-this.leftBottomCornerGroup.attribute.width),this.colHeaderGroup.setDeltaWidth(s-this.colHeaderGroup.attribute.width),this.rowHeaderGroup.setDeltaWidth(r-this.rowHeaderGroup.attribute.width),this.bottomFrozenGroup.setDeltaWidth(s-this.bottomFrozenGroup.attribute.width),this.rightFrozenGroup.setDeltaWidth(a-this.rightFrozenGroup.attribute.width),this.rightTopCornerGroup.setDeltaWidth(a-this.rightTopCornerGroup.attribute.width),this.rightBottomCornerGroup.setDeltaWidth(a-this.rightBottomCornerGroup.attribute.width),this.bodyGroup.setDeltaWidth(l-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(t=!1){t?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 n;const o=!((n=this.table.getCellRawRecord(t,e))===null||n===void 0)&&n.vtableMerge?"text":this.table.isHeader(t,e)?this.table._getHeaderLayoutMap(t,e).headerType:this.table.getBodyColumnType(t,e),r=this.getCell(t,e);o!=="image"&&o!=="video"||mh(r,t,e,0,0,this.table)}createFrameBorder(){this.updateTableSize();const t=!this.isPivot&&!this.table.internalProps.transpose;xl(this.bodyGroup,this.table.theme.bodyStyle.frameStyle,this.bodyGroup.role,t?[!0,!0,!0,!1]:void 0),xl(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),xl(this.colHeaderGroup,this.table.theme.headerStyle.frameStyle,this.colHeaderGroup.role,t?[!0,!0,!0,!1]:void 0),xl(this.cornerHeaderGroup,this.isPivot?this.table.theme.cornerHeaderStyle.frameStyle:this.table.theme.headerStyle.frameStyle,this.cornerHeaderGroup.role,t?[!0,!1,!0,!0]:void 0),xl(this.tableGroup,this.table.theme.frameStyle,this.tableGroup.role,void 0)}getResizeColAt(t,e,n,o=Ax/2){let r;if(!n){const s=this.table.getDrawRange();return e>=s.top&&e<=s.bottom&&(r=this.table.getCellAtRelativePosition(t-o,e),r.col===this.table.colCount-1)?r:{col:-1,row:-1}}return n.stage?(t<n.globalAABBBounds.x1+o?r={col:n.col-1,row:n.row,x:n.globalAABBBounds.x1}:n.globalAABBBounds.x2-o<t&&(r={col:n.col,row:n.row,x:n.globalAABBBounds.x2}),r&&this.table.rightFrozenColCount>0&&r.col>=this.table.colCount-this.table.rightFrozenColCount-1&&this.table.tableNoFrameWidth-this.table.getFrozenColsWidth()-this.table.getRightFrozenColsWidth()+this.table.scrollLeft<this.bodyGroup.attribute.width&&(r.col=r.col+1,r.rightFrozen=!0),r||{col:-1,row:-1}):{col:-1,row:-1}}getResizeRowAt(t,e,n,o=I4/2){if(n){let r;if(e<n.globalAABBBounds.y1+o?r={col:n.col,row:n.row-1,y:n.globalAABBBounds.y1}:n.globalAABBBounds.y2-o<e&&(r={col:n.col,row:n.row,y:n.globalAABBBounds.y2}),r&&this.table.bottomFrozenRowCount>0&&r.row>=this.table.rowCount-this.table.bottomFrozenRowCount-1&&this.table.tableNoFrameHeight-this.table.getFrozenRowsHeight()-this.table.getBottomFrozenRowsHeight()+this.table.scrollTop<this.bodyGroup.attribute.height&&(r.row=r.row+1,r.bottomFrozen=!0),r)return r}return{col:-1,row:-1}}updateFrozen(){this.clear||(this.resetFrozen(),this.component.updateScrollBar())}dealWidthRightFrozen(t){this.clear?this.table.internalProps.rightFrozenColCount=t:R5(t,this)}dealWidthBottomFrozen(t){this.clear?this.table.internalProps.bottomFrozenRowCount=t:A5(t,this)}updateBorderSizeAndPosition(){this.bodyGroup.border&&(this.bodyGroup.appendChild(this.bodyGroup.border),Nc(this.bodyGroup),this.rowHeaderGroup.attribute.width,BR(this.bodyGroup,this.table.theme.bodyStyle.frameStyle)),this.colHeaderGroup.border&&(this.colHeaderGroup.appendChild(this.colHeaderGroup.border),Nc(this.colHeaderGroup),this.cornerHeaderGroup.attribute.width,BR(this.colHeaderGroup,this.table.theme.headerStyle.frameStyle)),this.rowHeaderGroup.border&&(this.rowHeaderGroup.appendChild(this.rowHeaderGroup.border),Nc(this.rowHeaderGroup)),this.cornerHeaderGroup.border&&(this.cornerHeaderGroup.appendChild(this.cornerHeaderGroup.border),Nc(this.cornerHeaderGroup)),xW(this.table)}sortCell(){this.isPivot||(this.table.transpose?this.proxy.sortCellHorizontal():this.proxy.sortCellVertical())}getCellOverflowText(t,e){var n,o;const r=this.getCell(t,e).getChildByName("text",!0);if(r&&r.type==="text"){if(r.attribute.moreThanMaxCharacters)return this.table.getCellValue(t,e);const s=lt(r.attribute.text)?r.attribute.text.join(""):r.attribute.text;let l="";if(ce(r.cache.clipedText)?l=r.cache.clipedText:(o=(n=r.cache.layoutData)===null||n===void 0?void 0:n.lines)===null||o===void 0||o.forEach(a=>{l+=a.str}),l!==s)return this.table.getCellValue(t,e)}else if(r&&r.type==="richtext"){const s=r;if(s.attribute.ellipsis&&s._frameCache&&s.attribute.height<s._frameCache.actualHeight)return s.attribute.textConfig.find(l=>l.text),this.table.getCellValue(t,e)}return null}updateDrill(t,e,n,o,r){this.component.drillIcon.update(t,e,n,o,r,this)}updateCellContent(t,e){if(!this.clear)return _o(t,e,this.table)}setPixelRatio(t){this.stage.disableDirtyBounds(),this.stage.window.setDpr(t),this.stage.render(),this.stage.enableDirtyBounds()}updateRow(t,e,n=[],o=!0){this.table.internalProps.layoutMap.clearCellRangeMap(),this.table.internalProps.useOneRowHeightFillAll=!1;const r=ih(e.map(a=>a.row)).sort((a,h)=>a-h),s=ih(n.map(a=>a.row)).sort((a,h)=>a-h),l=this.table.getAllRowsHeight()-[...r,...s].reduce((a,h)=>a+this.table.getRowHeight(h),0)<=this.table.tableNoFrameHeight;if(f5(t,e,n,this.table),o&&this.recalculateColWidths(),this.table.heightMode==="adaptive"||this.table.autoFillHeight&&(this.table.getAllRowsHeight()<=this.table.tableNoFrameHeight||l))this.table.scenegraph.recalculateRowHeights();else if(this.table.heightMode==="autoHeight")for(let a=0;a<s.length;a++){const h=s[a],d=this.table.getRowHeight(h),u=nn(h,0,this.table.colCount-1,this.table);(h>=this.proxy.rowStart&&h<=this.proxy.rowEnd||h>=this.table.rowCount-this.table.bottomFrozenRowCount&&h<=this.table.rowCount-1)&&this.table.scenegraph.updateRowHeight(h,u-d)}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,n=[]){K5(t,e,n,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(){_5(this.table)}setLoadingHierarchyState(t,e){const n=this.getCell(t,e).getChildByName("collapse",!0);if(n){const o=vn()[Wi.loadingIconName];On(o,n,t,e)}}temporarilyUpdateSelectRectStyle(t){J5(t,this)}resetSelectRectStyle(){this.recreateAllSelectRangeComponents()}}function tN(i,t,e){for(let n=0;n<e.length;n++){const o=e[n];if(Yi(o,i,t))return!0}return!1}function eN(i,t,e,n){for(let o=0;o<e.length;o++){const r=e[o];if(p4(r,{start:i,end:t}))return!0}return!1}function Ml(i,t,e){const n=i.highPerformanceGetCell(t,e);if(n.role==="cell"&&z(n.mergeStartCol)&&z(n.mergeStartRow)&&z(n.mergeEndCol)&&z(n.mergeEndRow)){const{colStart:o,colEnd:r,rowStart:s,rowEnd:l}=kr(n,i);for(let a=o;a<=r;a++)for(let h=s;h<=l;h++)i.highPerformanceGetCell(a,h).addUpdateBoundTag()}else n.addUpdateBoundTag()}function bA(i,t,e,n,o){const r=i.table;for(let l=0;l<r.columnHeaderLevelCount;l++)Ml(i,t,l);const s=i.getColGroup(t);return s==null||s.addUpdateBoundTag(),!0}function CA(i,t,e,n,o,r){const s=i.table;for(let a=0;a<s.columnHeaderLevelCount;a++)Ml(i,t,a);const l=i.getColGroup(t);return l==null||l.addUpdateBoundTag(),!0}function yA(i,t,e,n,o){const r=i.table;for(let s=0;s<r.colCount;s++)Ml(i,s,e);return!0}function _A(i,t,e,n,o,r){const s=i.table;for(let l=0;l<s.colCount;l++)Ml(i,l,e);return!0}function iN(i,t,e,n,o){return Ml(i,t,e),!0}function nN(i,t,e,n,o){return Ml(i,t,e),!0}function oN(i,t,e){const{table:n}=i,{scenegraph:o}=n,{highlightScope:r,singleStyle:s,disableHeader:l,cellPos:a,cellPosContainHeader:h}=i.hover,d=a.col,u=a.row;if(r===he.none||l&&(h.col!==t||h.row!==e)){const p=h.col,m=h.row;o.hideHoverIcon(p,m),o.showHoverIcon(t,e),h.col=t,h.row=e}if((l&&n.isHeader(t,e)||r===he.none)&&(t=-1,e=-1),d===t&&u===e)return;o.deactivateChart(d,u),o.activateChart(t,e);let c=!1;const{ranges:g,highlightScope:f}=i.select;if(d!==-1&&u!==-1&&(c=rN(o,d,u,g,s,r),l||o.hideHoverIcon(d,u)),t===-1||e===-1)return a.col=-1,a.row=-1,void(!c||d===t&&u===e||i.table.scenegraph.updateNextFrame());r===he.single?c=!!nN(o,t,e):r===he.row?c=!!_A(o,t,e):r===he.column?c=!!CA(o,t):r===he.cross&&(c=!!_A(o,t,e),c=!!CA(o,t)),r===he.none||l||o.showHoverIcon(t,e),a.col=t,a.row=e,c&&i.table.scenegraph.updateNextFrame()}function rN(i,t,e,n,o,r,s){let l=!1;return r===he.single?l=!!iN(i,t,e):r===he.row?l=!!yA(i,t,e):r===he.column?l=!!bA(i,t):r===he.cross&&(l=!!yA(i,t,e),l=!!bA(i,t)),l}function sN(i,t,e){e.frozenColCount>0?i!==e.frozenColCount-1?e.setFrozenColCount(i+1):e.setFrozenColCount(0):e.setFrozenColCount(i+1)}function lN(i,t,e,n){var o;let r,s=null,l=!1;if(Array.isArray(e.sortState))for(let c=0;c<e.sortState.length&&(r=e.sortState[c],r&&(s=e._getHeaderCellBySortState(r)),s&&(l=wA(i,t,s.col,s.row,e)),!l);c++);else r=e.sortState,r&&(s=e._getHeaderCellBySortState(r)),s&&(l=wA(i,t,s.col,s.row,e));const a=e.getHeaderDefine(i,t);if(r&&l&&(a!=null&&a.sort)?r.order=r.order==="asc"?"desc":r.order==="desc"?"normal":"asc":a!=null&&a.sort?r={field:e.getHeaderField(i,t),order:"asc"}:l&&(a!=null&&a.showSort)||(r={field:e.getHeaderField(i,t),order:"normal"}),r.event=n,e.fireListeners(at.SORT_CLICK,r).includes(!1))return;let h=!1,d=e.internalProps.sortState?Array.isArray(e.internalProps.sortState)&&(h=!0)?e.internalProps.sortState:[e.internalProps.sortState]:[];if(Array.isArray(d)){const c=d.findIndex(g=>g.field===r.field);c>=0?d[c]=r:d.push(r)}d=d.filter(c=>c.order!=="normal"),d=e.internalProps.multipleSort&&(h=!0)?d:d.splice(-1),d=h&&d.length?d:d[0],e.internalProps.sortState=d,e.stateManager.setSortState(d),a!=null&&a.sort&&aN(d,e),e.internalProps.useOneRowHeightFillAll=!1,e.internalProps.layoutMap.clearCellRangeMap(),e.scenegraph.sortCell();const u=!!(!((o=e.stateManager.select.ranges)===null||o===void 0)&&o.length);e.stateManager.updateSelectPos(-1,-1),e.stateManager.endSelectCells(!0,u)}function aN(i,t,e){i=Array.isArray(i)||!i?i:[i],t.dataSource.sort((i||[]).map(n=>{var o,r;const s=t.internalProps.layoutMap.headerObjects.find(l=>l&&l.field===n.field);return{field:n.field,order:n.order||"asc",orderFn:typeof((o=s==null?void 0:s.define)===null||o===void 0?void 0:o.sort)=="function"?(r=s==null?void 0:s.define)===null||r===void 0?void 0:r.sort:sm}}))}function wA(i,t,e,n,o){return o._getLayoutCellId(i,t)===o._getLayoutCellId(e,n)}function hN(i,t,e,n,o,r,s=!1,l=!1,a=!1){var h,d;const{table:u,interactionState:c}=i,{scenegraph:g}=u,{highlightScope:f,disableHeader:p,cellPos:m}=i.select;if((p&&u.isHeader(t,e)||f==="none")&&a===!1&&(t===-1||e===-1||s||u._makeVisibleCell(t,e),t=-1,e=-1),t!==-1&&e!==-1&&!s)if(c===$t.grabing&&i.select.ranges.length>0){const b=i.select.ranges[i.select.ranges.length-1];t>b.start.col&&t>b.end.col&&u._makeVisibleCell(t+1,e),e>b.start.row&&e>b.end.row&&u._makeVisibleCell(t,e+1),t<b.start.col&&t<b.end.col&&u._makeVisibleCell(t-1,e),e<b.start.row&&e<b.end.row&&u._makeVisibleCell(t,e-1)}else u._makeVisibleCell(t,e);if(r){i.select.ranges=[],g.deleteAllSelectBorder();let b=0,C=0;const{disableHeaderSelect:_,disableRowSeriesNumberSelect:w}=((h=u.options.keyboardOptions)===null||h===void 0?void 0:h.selectAllOnCtrlA)||{};_&&(b=u.rowHeaderLevelCount,C=u.columnHeaderLevelCount),(w||_&&u.transpose)&&u.options.rowSeriesNumber&&(b+=1),i.select.ranges.push({start:{col:b,row:C},end:{col:u.colCount-1,row:u.rowCount-1}});const y=i.select.ranges[i.select.ranges.length-1];g.updateCellSelectBorder(y,!1)}else if(m.col===-1||m.row===-1||t!==-1&&e!==-1)if(c!==$t.default||u.eventManager.isDraging||u.stateManager.isResizeCol()){if((c===$t.grabing||u.eventManager.isDraging)&&!u.stateManager.isResizeCol()){let b=!0;m.col===-1&&(m.col=t),m.row===-1&&(m.row=e),m.col=t,m.row=e;const C=i.select.ranges[i.select.ranges.length-1];if(C){if(u.internalProps.layoutMap.isSeriesNumberInBody(C.start.col,C.start.row))b=!1,C.end={col:u.colCount-1,row:e};else if(i.fillHandle.isFilling){if(i.fillHandle.direction==="top")if(e===i.fillHandle.beforeFillMinRow&&e===i.fillHandle.beforeFillMaxRow)C.start.row=C.end.row=e;else if(e<=i.fillHandle.beforeFillMinRow){if(C.start.row<C.end.row){const _=C.start.row;C.start.row=C.end.row,C.end.row=_}C.end.row=e}else e===i.fillHandle.beforeFillMaxRow&&(C.start.row>C.end.row?C.start.row=e:C.end.row=e);else if(i.fillHandle.direction==="bottom"){if(e>=i.fillHandle.beforeFillMaxRow){if(C.start.row>C.end.row){const _=C.start.row;C.start.row=C.end.row,C.end.row=_}C.end.row=e}}else if(i.fillHandle.direction==="left")if(t===i.fillHandle.beforeFillMinCol&&t===i.fillHandle.beforeFillMaxCol)C.start.col=C.end.col=t;else if(t<=i.fillHandle.beforeFillMinCol){if(C.start.col<C.end.col){const _=C.start.col;C.start.col=C.end.col,C.end.col=_}C.end.col=t}else t===i.fillHandle.beforeFillMaxCol&&(C.start.col>C.end.col?C.start.col=t:C.end.col=t);else if(i.fillHandle.direction==="right"&&t>=i.fillHandle.beforeFillMaxCol){if(C.start.col>C.end.col){const _=C.start.col;C.start.col=C.end.col,C.end.col=_}C.end.col=t}}else{C.end={col:t,row:e};const _=l?{start:{col:t,row:e},end:{col:t,row:e}}:u.getCellRange(t,e);C.start.col<_.end.col?C.end.col=_.end.col:C.start.col>_.start.col&&(C.end.col=_.start.col),C.start.row<_.end.row?C.end.row=_.end.row:C.start.row>_.start.row&&(C.end.row=_.start.row),i.select.headerSelectMode==="body"&&(u.isRowHeader(t,e)?(C.start.col=u.rowHeaderLevelCount+u.leftRowSeriesNumberCount,C.end.col=u.colCount-1):u.isColumnHeader(t,e)?(C.start.row=u.columnHeaderLevelCount,C.end.row=u.rowCount-1):u.internalProps.layoutMap.isSeriesNumberInBody(t,e)?(C.start.col=u.leftRowSeriesNumberCount,C.end.col=u.colCount-1):u.isCornerHeader(t,e)?(C.start.col=u.rowHeaderLevelCount+u.leftRowSeriesNumberCount,C.start.row=u.columnHeaderLevelCount,C.end.col=u.colCount-1,C.end.row=u.rowCount-1):u.isSeriesNumber(t,e)&&(C.start.col=u.leftRowSeriesNumberCount,C.start.row=u.columnHeaderLevelCount,C.end.col=u.colCount-1,C.end.row=u.rowCount-1)),l&&(C.skipBodyMerge=!0)}g.updateCellSelectBorder(C,b)}}}else{const b=i.select.ranges[i.select.ranges.length-1];if(n&&b){if(o||(m.col=t,m.row=e),i.select.headerSelectMode!=="cell"&&u.isColumnHeader(t,e)){const C=Math.min(b.start.col,b.end.col,t),_=Math.max(b.start.col,b.end.col,t),w=Math.min(b.start.row,b.end.row,e),y=u.rowCount-1;i.select.headerSelectMode==="body"?(b.start={col:C,row:u.columnHeaderLevelCount},b.end={col:_,row:u.rowCount-1}):(b.start={col:C,row:w},b.end={col:_,row:y})}else if(i.select.headerSelectMode!=="cell"&&u.isRowHeader(t,e)){const C=Math.min(b.start.col,b.end.col,t),_=u.colCount-1,w=Math.min(b.start.row,b.end.row,e),y=Math.max(b.start.row,b.end.row,e);i.select.headerSelectMode==="body"?(b.start={col:u.leftRowSeriesNumberCount+u.rowHeaderLevelCount,row:w},b.end={col:u.colCount-1,row:y}):(b.start={col:C,row:w},b.end={col:_,row:y})}else if(i.select.headerSelectMode!=="cell"&&u.isSeriesNumberInBody(t,e)){const C=Math.min(b.start.col,b.end.col,t),_=u.colCount-1,w=Math.min(b.start.row,b.end.row,e),y=Math.max(b.start.row,b.end.row,e);i.select.headerSelectMode==="body"?(b.start={col:u.leftRowSeriesNumberCount,row:w},b.end={col:u.colCount-1,row:y}):(b.start={col:C,row:w},b.end={col:_,row:y})}else b.end={col:t,row:e};g.deleteLastSelectedRangeComponents(),g.updateCellSelectBorder(b)}else{let C=!0;if(m.col===-1||m.row===-1||o||(i.select.ranges=[],g.deleteAllSelectBorder()),i.select.headerSelectMode!=="cell"&&u.isColumnHeader(t,e)){const w=u.getCellRange(t,e);i.select.headerSelectMode==="body"?i.select.ranges.push({start:{col:w.start.col,row:u.columnHeaderLevelCount},end:{col:w.end.col,row:u.rowCount-1},skipBodyMerge:!0}):i.select.ranges.push({start:{col:w.start.col,row:e},end:{col:w.end.col,row:u.rowCount-1},skipBodyMerge:!0})}else if(i.select.headerSelectMode!=="cell"&&u.isRowHeader(t,e)){const w=u.getCellRange(t,e);i.select.headerSelectMode==="body"?i.select.ranges.push({start:{col:u.rowHeaderLevelCount+u.leftRowSeriesNumberCount,row:w.start.row},end:{col:u.colCount-1,row:w.end.row},skipBodyMerge:!0}):i.select.ranges.push({start:{col:t,row:w.start.row},end:{col:u.colCount-1,row:w.end.row},skipBodyMerge:!0})}else if(u.internalProps.layoutMap.isSeriesNumberInHeader(t,e))C=!1,i.select.headerSelectMode==="body"?i.select.ranges.push({start:{col:u.leftRowSeriesNumberCount,row:u.columnHeaderLevelCount},end:{col:u.colCount-1,row:u.rowCount-1},skipBodyMerge:!0}):i.select.ranges.push({start:{col:0,row:0},end:{col:u.colCount-1,row:u.rowCount-1},skipBodyMerge:!0});else if(u.internalProps.layoutMap.isSeriesNumberInBody(t,e))C=!1,i.select.headerSelectMode==="body"?i.select.ranges.push({start:{col:u.leftRowSeriesNumberCount,row:e},end:{col:u.colCount-1,row:e},skipBodyMerge:!0}):i.select.ranges.push({start:{col:t,row:e},end:{col:u.colCount-1,row:e},skipBodyMerge:!0});else if(u.internalProps.layoutMap.isCornerHeader(t,e))C=!1,i.select.headerSelectMode==="body"?i.select.ranges.push({start:{col:u.rowHeaderLevelCount+u.leftRowSeriesNumberCount,row:u.columnHeaderLevelCount},end:{col:u.colCount-1,row:u.rowCount-1},skipBodyMerge:!0}):i.select.ranges.push({start:{col:u.leftRowSeriesNumberCount,row:0},end:{col:u.colCount-1,row:u.rowCount-1},skipBodyMerge:!0});else if(t>=0&&e>=0){const w=l?{start:{col:t,row:e},end:{col:t,row:e}}:u.getCellRange(t,e);i.select.ranges.push({start:{col:w.start.col,row:w.start.row},end:{col:w.end.col,row:w.end.row},skipBodyMerge:l||void 0})}m.col=t,m.row=e;const _=(d=i.select.ranges)===null||d===void 0?void 0:d[i.select.ranges.length-1];_&&g.updateCellSelectBorder(_,C)}}else m.col=-1,m.row=-1,i.select.ranges=[],g.deleteAllSelectBorder();g.updateNextFrame()}function dN(i){i.moveSelectingRangeComponentsToSelectedRangeComponents()}const rr=nh(at,{PIVOT_SORT_CLICK:"pivot_sort_click",DRILLMENU_CLICK:"drillmenu_click"}),SA=nh(at,{VCHART_EVENT_TYPE:"vchart_event_type"});function uN(i,t,e,n,o){const r=o.getCellLocation(i,t);let s=0,l=0,a=!1;r==="columnHeader"?(s=o.getColsWidth(0,o.rowHeaderLevelCount-1)-(o.frozenColCount===0?o.scrollLeft:0),l=o.getRowsHeight(0,t-1)+o.getRowHeight(t)/2,a=!0):r==="rowHeader"&&(l=o.getRowsHeight(0,o.columnHeaderLevelCount-1),s=o.getColsWidth(0,i-1)+o.getColWidth(i)/2,a=!0),o.scenegraph.updateDrill(a,s,l,e,n)}function cN(i,t,e){const n=e.scenegraph.getCell(i,t).getChildByName("sparkline"),o=n==null?void 0:n.getChildByName("highlight-line"),r=n==null?void 0:n.getChildByName("highlight-symbol");o&&o.setAttributes({visible:!1,pickable:!1}),r&&r.setAttributes({visible:!1,pickable:!1}),e.scenegraph.updateNextFrame()}function gN(i,t,e,n,o){var r,s;const l=o.scenegraph.getCell(i,t).getChildByName("sparkline"),a=l==null?void 0:l.getChildByName("sparkline-line"),h=l==null?void 0:l.getChildByName("sparkline-symbol-group");if(!a)return!1;const d=a.bandwidth,u=a.min,c=a.max,g=a.attribute.points;let f;e-=l.globalAABBBounds.x1,l.globalAABBBounds.y1;for(let p=0;p<g.length;p++){const{x:m,y:b,defined:C,rawData:_}=g[p];if(Math.abs(e-m)<d/2&&(f={point:g[p],points:g,pointsBandWidth:d,pointData:_},C)){const w=l.getChildByName("highlight-line");if(w)w.setAttributes({points:[{x:m,y:c},{x:m,y:u}],visible:!0,pickable:!0});else{const S=fn({points:[{x:m,y:c},{x:m,y:u}],lineWidth:(r=a.hover)===null||r===void 0?void 0:r.strokeWidth,stroke:(s=a.hover)===null||s===void 0?void 0:s.stroke});S.name="highlight-line",l.addChild(S)}const y=l.getChildByName("highlight-symbol");if(y)y.setAttributes({x:m,y:b,visible:!0,pickable:!0});else{const S=Ea({x:m,y:b,stroke:h.hover.stroke,lineWidth:h.hover.strokeWidth,fill:h.hover.fill,size:2*h.hover.size,symbolType:"circle"});S.name="highlight-symbol",l.addChild(S)}break}}if(o.scenegraph.updateNextFrame(),f){const p={col:i,row:t,field:o.getHeaderField(i,t),value:o.getCellValue(i,t),dataValue:o.getCellOriginValue(i,t),cellHeaderPaths:o.internalProps.layoutMap.getCellHeaderPaths(i,t),title:o.getBodyColumnDefine(i,t).title,cellRange:o.getCellRelativeRect(i,t),sparkline:{pointData:f.pointData},scaleRatio:o.canvas.getBoundingClientRect().width/o.canvas.offsetWidth};o.fireListeners(at.MOUSEOVER_CHART_SYMBOL,p)}return!0}function fN(i,t,e){const n=e.getCellRange(i.col,i.row);if(e.isColumnHeader(i.col,i.row)){const o=e.getCellRange(t.col,n.start.row);t.row>=e.columnHeaderLevelCount&&(t.row=e.columnHeaderLevelCount-1),t.col>=i.col?t.col=o.end.col:t.col=o.start.col}else if(e.isRowHeader(i.col,i.row)){const o=e.internalProps.layoutMap,r=e.getCellRange(n.start.col,t.row);if(t.col>=e.rowHeaderLevelCount+o.leftRowSeriesNumberColumnCount&&(t.col=e.rowHeaderLevelCount+o.leftRowSeriesNumberColumnCount-1),o.rowHierarchyType==="tree"){const s=o.getCellHeaderPathsWithTreeNode(i.col,i.row).rowHeaderPaths,l=o.getCellHeaderPathsWithTreeNode(t.col,t.row).rowHeaderPaths;if(s.length<=l.length){const a=l[s.length-1];a&&(t.row>=i.row?t.row=a.startInTotal+a.size-1+e.columnHeaderLevelCount:t.row=a.startInTotal+e.columnHeaderLevelCount)}}else t.row>=i.row?t.row=r.end.row:t.row=r.start.row}return t}function pN(i,t,e,n,o,r){var s;if(!("canMoveHeaderPosition"in o.table.internalProps.layoutMap))return;o.columnMove.moving=!0,o.columnMove.colSource=i,o.columnMove.rowSource=t,o.columnMove.x=e-o.table.tableX,o.columnMove.y=n-o.table.tableY;const l=o.table.getCellLocation(i,t),a=l==="columnHeader"?o.columnMove.x:l==="rowHeader"||o.table.internalProps.layoutMap.isSeriesNumberInBody(i,t)?o.columnMove.y:0,{backX:h,lineX:d,backY:u,lineY:c}=o.table.scenegraph.component.showMoveCol(i,t,a);o.table.fireListeners(at.CHANGE_HEADER_POSITION_START,{col:i,row:t,x:e,y:n,backX:h,lineX:d,backY:u,lineY:c,event:r});const g=!!(!((s=o.select.ranges)===null||s===void 0)&&s.length);o.table.stateManager.updateSelectPos(-1,-1),o.table.stateManager.endSelectCells(!0,g),o.table.scenegraph.updateNextFrame()}function mN(i,t,e,n,o,r){if(!("canMoveHeaderPosition"in o.table.internalProps.layoutMap))return;const s=fN({col:o.columnMove.colSource,row:o.columnMove.rowSource},{col:i,row:t},o.table);if(o.table.internalProps.layoutMap.canMoveHeaderPosition({col:o.columnMove.colSource,row:o.columnMove.rowSource},{col:s.col,row:s.row})){let l,a,h,d;o.columnMove.x=e-o.table.tableX,o.columnMove.y=n-o.table.tableY,o.columnMove.colTarget=s.col,o.columnMove.rowTarget=s.row,o.updateCursor("grabbing");const u=o.table.getCellLocation(o.columnMove.colSource,o.columnMove.rowSource);u==="columnHeader"?(a=o.columnMove.x,l=o.table.isLeftFrozenColumn(i)?o.columnMove.colTarget>=o.columnMove.colSource?o.table.getColsWidth(0,o.columnMove.colTarget):o.table.getColsWidth(0,o.columnMove.colTarget-1):o.table.isRightFrozenColumn(i)?o.table.tableNoFrameWidth-o.table.getColsWidth(s.col+1,o.table.colCount-1):(o.columnMove.colTarget>=o.columnMove.colSource?o.table.getColsWidth(0,o.columnMove.colTarget):o.table.getColsWidth(0,o.columnMove.colTarget-1))-o.table.stateManager.scroll.horizontalBarPos):(u==="rowHeader"||o.table.internalProps.layoutMap.isSeriesNumberInBody(i,t))&&(d=o.columnMove.y,h=o.table.isFrozenRow(t)?o.columnMove.rowTarget>=o.columnMove.rowSource?o.table.getRowsHeight(0,o.columnMove.rowTarget):o.table.getRowsHeight(0,o.columnMove.rowTarget-1):o.table.isBottomFrozenRow(t)?o.table.tableNoFrameHeight-o.table.getRowsHeight(s.row+1,o.table.rowCount-1):(o.columnMove.rowTarget>=o.columnMove.rowSource?o.table.getRowsHeight(0,o.columnMove.rowTarget):o.table.getRowsHeight(0,o.columnMove.rowTarget-1))-o.table.stateManager.scroll.verticalBarPos),o.table.scenegraph.component.updateMoveCol(a,l,d,h),o.table.fireListeners(at.CHANGING_HEADER_POSITION,{col:i,row:t,x:e,y:n,backX:a,lineX:l,backY:d,lineY:h,event:r}),o.table.scenegraph.updateNextFrame()}else o.updateCursor("not-allowed"),o.columnMove.colTarget=o.columnMove.colSource,o.columnMove.rowTarget=o.columnMove.rowSource}function vN(i){var t,e;let n=!1;if("canMoveHeaderPosition"in i.table.internalProps.layoutMap&&i.columnMove.moving&&i.columnMove.colSource>=0&&i.columnMove.rowSource>=0&&i.columnMove.colTarget>=0&&i.columnMove.rowTarget>=0&&((t=i.table.options.customConfig)===null||t===void 0?void 0:t.notUpdateInColumnRowMove)!==!0){const o=i.table.getCellRange(i.columnMove.colSource,i.columnMove.rowSource),r=i.table.getCellRange(i.columnMove.colTarget,i.columnMove.rowTarget),s=i.table._moveHeaderPosition({col:i.columnMove.colSource,row:i.columnMove.rowSource},{col:i.columnMove.colTarget,row:i.columnMove.rowTarget});if(!s||s.targetIndex===s.sourceIndex)return i.updateCursor(),i.columnMove.moving=!1,delete i.columnMove.colSource,delete i.columnMove.rowSource,delete i.columnMove.colTarget,delete i.columnMove.rowTarget,i.table.scenegraph.component.hideMoveCol(),i.table.scenegraph.updateNextFrame(),!1;{i.table.internalProps.useOneRowHeightFillAll=!1,i.table.internalProps.layoutMap.clearCellRangeMap();const l=i.table.getCellRange(i.columnMove.colSource,i.columnMove.rowSource),a=i.table.getCellRange(i.columnMove.colTarget,i.columnMove.rowTarget),h=Math.min(l.start.col,a.start.col,o.start.col,r.start.col),d=Math.max(l.end.col,a.end.col,o.end.col,r.end.col),u=Math.min(l.start.row,a.start.row,o.start.row,r.start.row);let c=Math.max(l.end.row,a.end.row,o.end.row,r.end.row);s.moveType==="row"&&i.table.internalProps.layoutMap.rowHierarchyType==="tree"&&(c=s.targetIndex>s.sourceIndex?c+s.targetSize-1:c+s.sourceSize-1),!i.table.transpose&&i.table.internalProps.layoutMap.isSeriesNumberInBody(i.columnMove.colSource,i.columnMove.rowSource)&&(i.table.changeRecordOrder(s.sourceIndex,s.targetIndex),i.changeCheckboxAndRadioOrder(s.sourceIndex,s.targetIndex)),s.moveType==="column"?xA(h,d,0,-1,i.table):xA(0,-1,u,c,i.table),i.table.clearCellStyleCache(),i.table.internalProps.layoutMap.isSeriesNumberInBody(i.columnMove.colSource,i.columnMove.rowSource)?i.table.scenegraph.updateHeaderPosition(i.table.scenegraph.proxy.colStart,i.table.scenegraph.proxy.colEnd,i.table.scenegraph.proxy.rowStart,i.table.scenegraph.proxy.rowEnd,s.moveType):s.moveType==="column"?i.table.scenegraph.updateHeaderPosition(h,d,0,-1,s.moveType):i.table.scenegraph.updateHeaderPosition(0,-1,u,c,s.moveType),i.table.internalProps.frozenColDragHeaderMode==="adjustFrozenCount"&&i.table.isListTable()&&(i.table.isLeftFrozenColumn(i.columnMove.colTarget)&&!i.table.isLeftFrozenColumn(i.columnMove.colSource)?i.table.frozenColCount+=l.end.col-l.start.col+1:i.table.isLeftFrozenColumn(i.columnMove.colSource)&&!i.table.isLeftFrozenColumn(i.columnMove.colTarget)&&(i.table.frozenColCount-=l.end.col-l.start.col+1),i.table.isRightFrozenColumn(i.columnMove.colTarget)&&!i.table.isRightFrozenColumn(i.columnMove.colSource)?i.table.rightFrozenColCount+=l.end.col-l.start.col+1:i.table.isRightFrozenColumn(i.columnMove.colSource)&&!i.table.isRightFrozenColumn(i.columnMove.colTarget)&&(i.table.rightFrozenColCount-=l.end.col-l.start.col+1)),n=!0}}return i.columnMove.moving=!1,setTimeout(()=>{delete i.columnMove.colSource,delete i.columnMove.rowSource,delete i.columnMove.colTarget,delete i.columnMove.rowTarget},0),i.table.scenegraph.component.hideMoveCol(),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.scenegraph.component.setRightFrozenColumnShadow(i.table.colCount-i.table.rightFrozenColCount)):i.columnResize.col>=i.table.colCount-i.table.rightFrozenColCount&&!i.table.isPivotTable()&&!i.table.transpose?i.table.scenegraph.component.setRightFrozenColumnShadow(i.table.colCount-i.table.rightFrozenColCount):i.table.options.frozenColCount?i.table.scenegraph.component.setFrozenColumnShadow(i.table.frozenColCount-1):i.table.options.rightFrozenColCount&&i.table.scenegraph.component.setRightFrozenColumnShadow(i.table.colCount-i.table.rightFrozenColCount),i.table.scenegraph.updateNextFrame(),((e=i.table.options.customConfig)===null||e===void 0?void 0:e.notUpdateInColumnRowMove)===!0||n}function xA(i,t,e,n,o){for(let r=i;r<=t;r++)o._clearColRangeWidthsMap(r);for(let r=e;r<=n;r++)o._clearRowRangeHeightsMap(r)}function Mh(i){var t;if(!i)return;const e=!((t=i.role)===null||t===void 0)&&t.startsWith("icon")?i:i.type==="richtext"?i._currentHoverIcon:void 0;return e?i.type==="richtext"?{icon:e,position:{left:i.globalAABBBounds.x1+e.globalAABBBounds.x1,right:i.globalAABBBounds.x1+e.globalAABBBounds.x2,top:i.globalAABBBounds.y1+e.globalAABBBounds.y1,bottom:i.globalAABBBounds.y1+e.globalAABBBounds.y2,width:e.globalAABBBounds.x2-e.globalAABBBounds.x1,height:e.globalAABBBounds.y2-e.globalAABBBounds.y1},type:"richtext-icon"}:{icon:e,position:{left:e.globalAABBBounds.x1,right:e.globalAABBBounds.x2,top:e.globalAABBBounds.y1,bottom:e.globalAABBBounds.y2,width:e.globalAABBBounds.x2-e.globalAABBBounds.x1,height:e.globalAABBBounds.y2-e.globalAABBBounds.y1},type:"icon"}:void 0}function bN(i,t,e){i=Math.ceil(i),t=Math.ceil(t);let n=e.columnResize.isRightFrozen?e.columnResize.x-i:i-e.columnResize.x;if(Math.abs(n)<1)return;const o=e.table.getColWidth(e.columnResize.col);let r=o;r+=n;const s=e.table.getMinColWidth(e.columnResize.col),l=e.table.getMaxColWidth(e.columnResize.col);if(r<s||r>l){if(o===s||o===l)return;n=o-s>l-o?l-o:s-o}let a=e.table.getColWidth(e.columnResize.col)+n;if(a<e.table.internalProps.limitMinWidth&&(a=e.table.internalProps.limitMinWidth,n=a-e.table.getColWidth(e.columnResize.col)),e.table.widthMode==="adaptive"&&e.columnResize.col<e.table.colCount-1){const h=e.table.getColWidth(e.columnResize.col+1),d=e.table.getMinColWidth(e.columnResize.col+1),u=e.table.getMaxColWidth(e.columnResize.col+1);let c=h;if(c-=n,c<d||c>u){if(h===d||h===u)return;n=h-d>u-h?u-h:d-h}c-n<e.table.internalProps.limitMinWidth&&(n=c-e.table.internalProps.limitMinWidth)}n=Math.ceil(n),e.columnResize.col<e.table.rowHeaderLevelCount||e.columnResize.col>=e.table.colCount-e.table.rightFrozenColCount?RA(n,e):e.table.internalProps.columnResizeType==="indicator"?yN(n,e):e.table.internalProps.columnResizeType==="indicatorGroup"?_N(n,e):e.table.internalProps.columnResizeType==="all"?CN(n,e):RA(n,e),e.columnResize.x=i,e.table.scenegraph.component.updateResizeCol(e.columnResize.col,t,e.columnResize.isRightFrozen),e.columnResize.col<e.table.frozenColCount&&!e.table.isPivotTable()&&!e.table.transpose?e.table.scenegraph.component.setFrozenColumnShadow(e.table.frozenColCount-1,e.columnResize.isRightFrozen):e.table.options.frozenColCount&&e.table.scenegraph.component.setFrozenColumnShadow(e.table.frozenColCount-1),(e.columnResize.col>=e.table.colCount-e.table.rightFrozenColCount&&!e.table.isPivotTable()&&!e.table.transpose||e.table.options.rightFrozenColCount)&&e.table.scenegraph.component.setRightFrozenColumnShadow(e.table.colCount-e.table.rightFrozenColCount),e.table.scenegraph.updateNextFrame()}function RA(i,t){t.table.widthMode==="adaptive"&&t.columnResize.col<t.table.colCount-1?(t.table.scenegraph.updateColWidth(t.columnResize.col,i),t.table.scenegraph.updateColWidth(t.columnResize.col+1,-i),t.table.internalProps._widthResizedColMap.add(t.columnResize.col),t.table.internalProps._widthResizedColMap.add(t.columnResize.col+1)):(t.table.scenegraph.updateColWidth(t.columnResize.col,i),t.table.internalProps._widthResizedColMap.add(t.columnResize.col))}function CN(i,t){const e=t.table.internalProps.layoutMap;for(let n=t.table.frozenColCount;n<t.table.colCount-t.table.rightFrozenColCount;n++){if(!(t.table.internalProps.transpose||t.table.isPivotTable()&&!e.indicatorsAsCol)){const o=e.getBody(n,t.table.columnHeaderLevelCount);if(o!=null&&o.disableColumnResize)continue}t.table.scenegraph.updateColWidth(n,i),t.table.internalProps._widthResizedColMap.add(n)}}function yN(i,t){const e=t.table.internalProps.layoutMap;let n,o,r;if(e.indicatorsAsCol)n=e.getIndicatorKey(t.columnResize.col,t.table.columnHeaderLevelCount);else{const s=e.getCellHeaderPaths(t.columnResize.col,t.table.columnHeaderLevelCount-1),l=s.colHeaderPaths[s.colHeaderPaths.length-1];o=l.dimensionKey,r=l.value}for(let s=t.table.rowHeaderLevelCount;s<t.table.colCount-t.table.rightFrozenColCount;s++){const l=e.getIndicatorKey(s,t.table.columnHeaderLevelCount);if(e.indicatorsAsCol&&l===n)t.table.scenegraph.updateColWidth(s,i),t.table.internalProps._widthResizedColMap.add(s);else if(!e.indicatorsAsCol){const a=e.getCellHeaderPaths(s,t.table.columnHeaderLevelCount-1),h=a==null?void 0:a.colHeaderPaths[a.colHeaderPaths.length-1];h&&o===h.dimensionKey&&r===h.value&&(t.table.scenegraph.updateColWidth(s,i),t.table.internalProps._widthResizedColMap.add(s))}}}function _N(i,t){const e=t.table.internalProps.layoutMap,n=e.getCellHeaderPaths(t.columnResize.col,t.table.columnHeaderLevelCount),o=e.getHeadNodeByRowOrColDimensions(n.colHeaderPaths.slice(0,n.colHeaderPaths.length-1)),r=o.startInTotal+t.table.frozenColCount,s=o.startInTotal+t.table.frozenColCount+o.size-1,l=t.table.getColsWidth(r,s),a=i;for(let h=r;h<=s;h++){if(!(t.table.internalProps.transpose||t.table.isPivotTable()&&!e.indicatorsAsCol)){const u=e.getBody(h,t.table.columnHeaderLevelCount);if(u!=null&&u.disableColumnResize)continue}let d=t.table.getColWidth(h)/l*a;d>0&&d<.5?d=.5:d<0&&d>=-.5&&(d=-.5),t.table.scenegraph.updateColWidth(h,d),t.table.internalProps._widthResizedColMap.add(h)}}function wN(i,t,e,n,o,r){const s=r.table.getRecordShowIndexByCell(i,t);if(s>=0){const l=r.table.dataSource.getIndexKey(s);n==="column"?ft(o)?(r.radioState[e]={},r.radioState[e][l]=o):r.radioState[e]=l:(r.radioState[e]||(r.radioState[e]={}),ft(o)?r.radioState[e][l]=o:r.radioState[e][l]=!0)}}function SN(i,t,e){var n;const o=e.getBodyColumnDefine(i,t),r=o==null?void 0:o.field,s=e.getCellType(i,t);if(z(r)&&s==="checkbox"){const l=e.dataSource.getIndexKey(e.getRecordShowIndexByCell(i,t)),a=(n=e.stateManager.radioState)===null||n===void 0?void 0:n[r];if(ft(a)){if(a===l)return!0}else if(ge(a)){const h=a[l];if(ft(h))return h}}return!1}function xN(i,t,e,n,o,r,s){var l,a,h,d,u;const c=s.table.getRecordShowIndexByCell(i,t);if(c>=0){const g=s.table.dataSource.getIndexKey(c);if(n==="column"){if(!z(s.radioState[e])&&r)return ft(o)?(s.radioState[e]={},s.radioState[e][g]=o):s.radioState[e]=g,!0;if(ft(s.radioState[e])&&!ft(o))return s.radioState[e]===g;if(ft(s.radioState[e])&&ft(o)||ge(s.radioState[e])&&!ft(o))return!1;if(ge(s.radioState[e])&&ft(o))return s.radioState[e][g]===o}else if(n==="cell"){if(!z(s.radioState[e])&&r)return s.radioState[e]={},ft(o)?s.radioState[e][g]=o:s.radioState[e][g]=!0,!0;if(!z((l=s.radioState[e])===null||l===void 0?void 0:l[g])&&r)return ft(o)?s.radioState[e][g]=o:s.radioState[e][g]=!0,!0;if(bi((a=s.radioState[e])===null||a===void 0?void 0:a[g])&&!ft(o))return s.radioState[e][g];if(bi((h=s.radioState[e])===null||h===void 0?void 0:h[g])&&ft(o)||ft((d=s.radioState[e])===null||d===void 0?void 0:d[g])&&!ft(o))return!1;if(ft((u=s.radioState[e])===null||u===void 0?void 0:u[g])&&ft(o))return s.radioState[e][g]===o}}return r}function RN(i,t,e,n){const o=n.scenegraph.getCell(i,t);if(o)if(ft(e)){const r=o.getChildAt(e);r==null||r._handlePointerUp()}else{const r=o.getChildByName("radio");r==null||r._handlePointerUp()}}function AN(i,t,e){const{radioState:n,table:o}=e;if(o.internalProps.transpose?(i=o.getRecordShowIndexByCell(i,0),t=o.getRecordShowIndexByCell(t,0)):(i=o.getRecordShowIndexByCell(0,i),t=o.getRecordShowIndexByCell(0,t)),i>t){const r=n[i];for(let s=i;s>t;s--)n[s]=n[s-1];n[t]=r}else if(i<t){const r=n[i];for(let s=i;s<t;s++)n[s]=n[s+1];n[t]=r}}function TN(i,t,e,n,o){const r=o.table.getRecordShowIndexByCell(i,t);if(r>=0){const s=o.table.dataSource.getIndexKey(r);o.checkedState[s]||(o.checkedState[s]={}),o.checkedState[s][e]=n}}function MN(i,t,e){var n;e.headerCheckedState[i]=t,(n=e.checkedState)===null||n===void 0||n.forEach(o=>{o[i]=t})}function BN(i,t,e,n,o){var r,s;if(o.table.isHeader(i,t)){if(z(o.headerCheckedState[e]))return o.headerCheckedState[e];if(typeof n=="function")return;if(z(n))o.headerCheckedState[e]=n;else if(((r=o.checkedState)===null||r===void 0?void 0:r.length)>0)return o.updateHeaderCheckedState(e,i,t);return o.headerCheckedState[e]}const l=o.table.getRecordShowIndexByCell(i,t);if(l>=0){const a=o.table.dataSource.getIndexKey(l);if(z((s=o.checkedState[a])===null||s===void 0?void 0:s[e]))return o.checkedState[a][e];o.checkedState[a]||(o.checkedState[a]={}),o.checkedState[a][e]=n}return n}function PN(i,t){t.checkedState=[],t.headerCheckedState={},t.radioState={};let e=!1;t._checkboxCellTypeFields=[],t._headerCheckFuncs={},t.table.internalProps.layoutMap.headerObjects.forEach((n,o)=>{if(n.headerType==="checkbox"){const r=n.define.checked;r==null||typeof r=="function"?(e=!0,typeof r=="function"&&(t._headerCheckFuncs[n.field]=r)):t.headerCheckedState[n.field]=r,n.define.cellType!=="checkbox"||n.fieldFormat||t._checkboxCellTypeFields.push(n.field)}}),e&&i.forEach((n,o)=>{t._checkboxCellTypeFields.forEach(r=>{const s=n[r];let l;if(ge(s)?l=s.checked:typeof s=="boolean"&&(l=s),l==null){const a=t._headerCheckFuncs[r];if(a){const h=t.table.getCellAddrByFieldRecord(r,o);l=ii(a,{col:h.col,row:h.row,table:t.table,context:null,value:s})}}t.checkedState[o]||(t.checkedState[o]={}),t.checkedState[o][r]=l})})}function HN(i,t,e,n){const o=t.checkedState.every((r,s)=>{const l=t.table.getTableIndexByRecordIndex(s);return!!(t.table.transpose?t.table.getCustomMerge(l,n):t.table.getCustomMerge(e,l))||(r==null?void 0:r[i])===!0});return o?(t.headerCheckedState[i]=!0,o):t.checkedState.every((r,s)=>{const l=t.table.getTableIndexByRecordIndex(s);return!!(t.table.transpose?t.table.getCustomMerge(l,n):t.table.getCustomMerge(e,l))||(r==null?void 0:r[i])===!1})?(t.headerCheckedState[i]=!1,!1):!!t.checkedState.find(r=>(r==null?void 0:r[i])===!0)&&(t.headerCheckedState[i]="indeterminate","indeterminate")}function EN(i,t){for(let e=t.checkedState.length;e<i.length;e++){const n=i[e];t._checkboxCellTypeFields.forEach(o=>{const r=n[o];let s;ge(r)?s=r.checked:typeof r=="boolean"&&(s=r),t.checkedState[e]||(t.checkedState[e]={}),t.checkedState[e][o]=s})}}function LN(i,t,e,n){const o=n.scenegraph.getCell(i,t),r=o==null?void 0:o.getChildByName("checkbox");if(!r)return;const{checked:s,indeterminate:l}=r.attribute;l?(e||r._handlePointerUp(),r._handlePointerUp()):s?e||r._handlePointerUp():e&&r._handlePointerUp()}function kN(i,t,e){const{checkedState:n,table:o}=e;if(o.internalProps.transpose?(i=o.getRecordShowIndexByCell(i,0),t=o.getRecordShowIndexByCell(t,0)):(i=o.getRecordShowIndexByCell(0,i),t=o.getRecordShowIndexByCell(0,t)),i>t){const r=n[i];for(let s=i;s>t;s--)n[s]=n[s-1];n[t]=r}else if(i<t){const r=n[i];for(let s=i;s<t;s++)n[s]=n[s+1];n[t]=r}}function FN(i){const t=[],e=i.dataSource,n=e.dataConfig.groupByRules.length+1;return e.currentIndexedData.forEach((o,r)=>{if(lt(o)&&o.length===n){const{vtableOriginIndex:s}=e.getRawRecord(o);t[s]=i.stateManager.checkedState[o]}}),t}function IN(i,t,e){i=Math.ceil(i),t=Math.ceil(t);let n=e.rowResize.isBottomFrozen?e.rowResize.y-t:t-e.rowResize.y;if(Math.abs(n)<1)return;e.table.getRowHeight(e.rowResize.row);let o=e.table.getRowHeight(e.rowResize.row)+n;if(o<e.table.internalProps.limitMinHeight&&(o=e.table.internalProps.limitMinHeight,n=o-e.table.getRowHeight(e.rowResize.row)),e.table.heightMode==="adaptive"&&e.rowResize.row<e.table.rowCount-1){let r=e.table.getRowHeight(e.rowResize.row+1);r-=n,r-n<e.table.internalProps.limitMinHeight&&(n=r-e.table.internalProps.limitMinHeight)}n=Math.ceil(n),e.rowResize.row<e.table.columnHeaderLevelCount||e.rowResize.row>=e.table.rowCount-e.table.bottomFrozenRowCount?AA(n,e):e.table.internalProps.rowResizeType==="indicator"?ON(n,e):e.table.internalProps.rowResizeType==="indicatorGroup"?zN(n,e):e.table.internalProps.rowResizeType==="all"?DN(n,e):AA(n,e),e.rowResize.y=t,e.table.scenegraph.component.updateResizeRow(e.rowResize.row,i,e.rowResize.isBottomFrozen),e.table.scenegraph.updateNextFrame()}function AA(i,t){t.table.heightMode==="adaptive"&&t.rowResize.row<t.table.rowCount-1?(t.table.scenegraph.updateRowHeight(t.rowResize.row,i),t.table.scenegraph.updateRowHeight(t.rowResize.row+1,-i),t.table.internalProps._heightResizedRowMap.add(t.rowResize.row),t.table.internalProps._heightResizedRowMap.add(t.rowResize.row+1)):(t.table.scenegraph.updateRowHeight(t.rowResize.row,i),t.table.internalProps._heightResizedRowMap.add(t.rowResize.row))}function DN(i,t){for(let e=t.table.frozenRowCount;e<t.table.rowCount-t.table.bottomFrozenRowCount;e++)t.table.scenegraph.updateRowHeight(e,i),t.table.internalProps._heightResizedRowMap.add(e)}function ON(i,t){var e,n;const o=t.table.internalProps.layoutMap;let r,s,l;if(o.indicatorsAsCol){const a=o.getCellHeaderPaths(t.table.rowHeaderLevelCount-1,t.rowResize.row),h=(e=a.rowHeaderPaths)===null||e===void 0?void 0:e[a.rowHeaderPaths.length-1];s=h==null?void 0:h.dimensionKey,l=h==null?void 0:h.value}else r=o.getIndicatorKey(t.table.rowHeaderLevelCount,t.rowResize.row);for(let a=t.table.columnHeaderLevelCount;a<t.table.rowCount-t.table.bottomFrozenRowCount;a++){const h=o.getIndicatorKey(t.table.rowHeaderLevelCount,a);if(o.indicatorsAsCol||h!==r){if(o.indicatorsAsCol){const d=o.getCellHeaderPaths(t.table.rowHeaderLevelCount-1,a),u=(n=d==null?void 0:d.rowHeaderPaths)===null||n===void 0?void 0:n[d.rowHeaderPaths.length-1];u&&s===u.dimensionKey&&l===u.value&&(t.table.scenegraph.updateRowHeight(a,i),t.table.internalProps._heightResizedRowMap.add(a))}}else t.table.scenegraph.updateRowHeight(a,i),t.table.internalProps._heightResizedRowMap.add(a)}}function zN(i,t){const e=t.table.internalProps.layoutMap,n=e.getCellHeaderPaths(t.table.rowHeaderLevelCount,t.rowResize.row),o=e.getHeadNodeByRowOrColDimensions(n.rowHeaderPaths.slice(0,n.rowHeaderPaths.length-1)),r=o.startInTotal+t.table.frozenRowCount,s=o.startInTotal+t.table.frozenRowCount+o.size-1,l=t.table.getRowsHeight(r,s),a=i;for(let h=r;h<=s;h++){let d=t.table.getRowHeight(h)/l*a;d>0&&d<.5?d=.5:d<0&&d>=-.5&&(d=-.51),t.table.scenegraph.updateRowHeight(h,d),t.table.internalProps._heightResizedRowMap.add(h)}}function WN(i){const{customSelectedRangeComponents:t}=i.table.scenegraph;t.forEach((e,n)=>{e.rect.delete()}),t.clear(),i.select.customSelectRanges=[]}function NN(i,t){const{customSelectedRangeComponents:e}=t.table.scenegraph;i.forEach(n=>{var o,r,s,l;const{range:a,style:h}=n,d=Fe({fill:(o=h.cellBgColor)!==null&&o!==void 0&&o,stroke:(r=h.cellBorderColor)!==null&&r!==void 0&&r,lineWidth:(s=h.cellBorderLineWidth)!==null&&s!==void 0?s:0,lineDash:(l=h.cellBorderLineDash)!==null&&l!==void 0?l:[],pickable:!1});e.set(`${a.start.col}-${a.start.row}-${a.end.col}-${a.end.row}`,{rect:d,role:"body"})}),t.select.customSelectRanges=i,tA(t.table.scenegraph),t.table.scenegraph.updateNextFrame()}class VN{constructor(t){this.fastScrolling=!1,this.checkedState=[],this.headerCheckedState={},this._checkboxCellTypeFields=[],this._headerCheckFuncs={},this.radioState={},this.resetInteractionState=bx(e=>{this.updateInteractionState(e??$t.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=$t.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 hn,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=$t.default,this.select={highlightScope:he.single,ranges:[],cellPos:{col:-1,row:-1},selecting:!1},this.fillHandle={isFilling:!1,startX:void 0,startY:void 0},this.hover={highlightScope:he.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 hn,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:n,disableHeaderHover:o}=(t=this.table.options.hover)!==null&&t!==void 0?t:{highlightMode:"cell"};n?this.hover.highlightScope=he.none:e==="cross"?this.hover.highlightScope=he.cross:e==="row"?this.hover.highlightScope=he.row:e==="column"?this.hover.highlightScope=he.column:e==="cell"&&(this.hover.highlightScope=he.single),this.hover.singleStyle=!n,this.hover.disableHeader=o,(this.hover.highlightScope===he.none||o)&&(this.hover.cellPosContainHeader={col:-1,row:-1})}setSelectState(){const{headerSelectMode:t,disableSelect:e,disableHeaderSelect:n,highlightMode:o,highlightInRange:r}=Object.assign({},{headerSelectMode:"inline",disableSelect:!1,disableHeaderSelect:!1,highlightMode:"cell",highlightInRange:!1},this.table.options.select);this.select.highlightScope=e?he.none:o==="cross"?he.cross:o==="row"?he.row:o==="column"?he.column:he.single,this.select.singleStyle=!e,this.select.disableHeader=n,this.select.headerSelectMode=t,this.select.highlightInRange=r}isSelected(t,e){let n=!1;return this.select.ranges.forEach(o=>{Yi(o,t,e)&&(n=!0)}),n}setSortState(t){const e=this,n=(t=!t||Array.isArray(t)?t:[t])&&t.reduce((o,r)=>{var s,l,a;const h=(s=function(d){const u=[];return function c(g,f=0){g.forEach(p=>{var m;const b=p.startInTotal?(m=p.startInTotal+e.table.internalProps.layoutMap.leftRowSeriesNumberColumnCount)!==null&&m!==void 0?m:0:f;p.columns?c(p.columns,b):u.push(Object.assign(Object.assign({},p),{startIndex:b}))})}(d),u}(this.table.internalProps.columns))===null||s===void 0?void 0:s.find(d=>(d==null?void 0:d.field)===(r==null?void 0:r.field));return this.table.internalProps.transpose?o.push({field:r.field,order:r.order,row:(l=(h==null?void 0:h.startInTotal)+this.table.internalProps.layoutMap.leftRowSeriesNumberColumnCount)!==null&&l!==void 0?l:0,col:h==null?void 0:h.level}):o.push({field:r.field,order:r.order,col:(a=(h==null?void 0:h.startInTotal)+this.table.internalProps.layoutMap.leftRowSeriesNumberColumnCount)!==null&&a!==void 0?a:0,row:h==null?void 0:h.level}),o},[]);this.sort=n||[]}setFrozenState(){this.frozen.col=this.table.frozenColCount-1}updateInteractionState(t){if(this.interactionState===t)return;t===$t.scrolling&&(this.interactionStateBeforeScroll=this.interactionState);const e=this.interactionState;this.interactionState=t,e===$t.scrolling&&$t.default}updateHoverhighlightScope(t){this.hover.highlightScope!==t&&(this.hover.highlightScope=t)}updateHoverPos(t,e){oN(this,t,e)}updateSelectPos(t,e,n=!1,o=!1,r=!1,s=!1,l=!1,a=!1){e!==-1&&e!==-1&&(this.select.selecting=!0),hN(this,t,e,n,o,r,s,l,a)}checkCellRangeInSelect(t,e){return eN(t,e,this.select.ranges,this.select.highlightScope)}updateHoverIcon(t,e,n,o){var r,s,l,a,h,d,u,c,g;if(!((r=this.residentHoverIcon)===null||r===void 0)&&r.icon&&n===((s=this.residentHoverIcon)===null||s===void 0?void 0:s.icon))return;const f=Mh(n);if(f)if(f.type==="richtext-icon"){const p=f.icon;if(this.hoverIcon.icon&&this.hoverIcon.icon!==((a=this.residentHoverIcon)===null||a===void 0?void 0:a.icon)&&(this.table.scenegraph.setIconNormalStyle(this.hoverIcon.icon,this.hoverIcon.col,this.hoverIcon.row),this.hoverIcon.col=-1,this.hoverIcon.col=-1,this.hoverIcon.icon=null,this.table.scenegraph.updateNextFrame()),p.attribute.tooltip){const m={content:p.attribute.tooltip.title,referencePosition:{rect:f.position,placement:p.attribute.tooltip.placement},style:Object.assign({},(h=this.table.internalProps.theme)===null||h===void 0?void 0:h.tooltipStyle,(d=p.tooltip)===null||d===void 0?void 0:d.style,(c=(u=p.attribute)===null||u===void 0?void 0:u.tooltip)===null||c===void 0?void 0:c.style),disappearDelay:p.attribute.tooltip.disappearDelay};this.table.internalProps.tooltipHandler.isBinded(m)||this.table.showTooltip(t,e,m)}}else{const p=f.icon;p!==this.hoverIcon.icon&&(this.hoverIcon.icon&&this.hoverIcon.icon!==((g=this.residentHoverIcon)===null||g===void 0?void 0:g.icon)&&this.table.scenegraph.setIconNormalStyle(this.hoverIcon.icon,this.hoverIcon.col,this.hoverIcon.row),this.hoverIcon.col=t,this.hoverIcon.row=e,this.hoverIcon.icon=p,this.table.scenegraph.setIconHoverStyle(p,t,e,o),this.table.scenegraph.updateNextFrame())}else this.hoverIcon.icon&&this.hoverIcon.icon!==((l=this.residentHoverIcon)===null||l===void 0?void 0:l.icon)&&(this.table.scenegraph.setIconNormalStyle(this.hoverIcon.icon,this.hoverIcon.col,this.hoverIcon.row),this.hoverIcon.col=-1,this.hoverIcon.col=-1,this.hoverIcon.icon=null,this.table.scenegraph.updateNextFrame())}isResizeCol(){return this.columnResize.resizing}isResizeRow(){return this.rowResize.resizing}isFillHandle(){return this.fillHandle.isFilling}isSelecting(){return this.select.selecting}endSelectCells(t=!0,e=!0){if(this.select.selecting){if(this.select.selecting=!1,this.select.ranges.length===0)return;const n=this.select.ranges[this.select.ranges.length-1];let o=!1;for(let l=0;l<this.select.ranges.length-1;l++){const a=this.select.ranges[l];if(a&&a.start.col===n.start.col&&a.start.row===n.start.row&&a.end.col===n.end.col&&a.end.row===n.end.row){o=!0;break}}o?(this.select.ranges.pop(),sA(this.table.scenegraph),this.table.scenegraph.selectingRangeComponents.clear()):dN(this.table.scenegraph);const r=this.select.ranges[this.select.ranges.length-1].end.col,s=this.select.ranges[this.select.ranges.length-1].end.row;t&&this.table.fireListeners(at.SELECTED_CELL,{ranges:this.select.ranges,col:r,row:s})}else e&&this.select.ranges.length===0&&this.table.fireListeners(at.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,n,o){var r;this.columnResize.resizing=!0,this.columnResize.col=t,this.columnResize.x=e,this.columnResize.isRightFrozen=o,this.table.scenegraph.component.showResizeCol(t,n,o);const s=!!(!((r=this.select.ranges)===null||r===void 0)&&r.length);this.updateSelectPos(-1,-1),this.endSelectCells(!0,s),this.table.scenegraph.updateNextFrame()}updateResizeCol(t,e){bN(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,n,o){var r;this.rowResize.resizing=!0,this.rowResize.row=t,this.rowResize.y=n,this.rowResize.isBottomFrozen=o,this.table.scenegraph.component.showResizeRow(t,e,o);const s=!!(!((r=this.select.ranges)===null||r===void 0)&&r.length);this.updateSelectPos(-1,-1),this.endSelectCells(!0,s),this.table.scenegraph.updateNextFrame()}updateResizeRow(t,e){IN(t,e,this)}startFillSelect(t,e){this.fillHandle.isFilling=!0,this.fillHandle.startX=t,this.fillHandle.startY=e;const n=this.select.ranges[this.select.ranges.length-1];this.fillHandle.beforeFillMinCol=Math.min(n.start.col,n.end.col),this.fillHandle.beforeFillMinRow=Math.min(n.start.row,n.end.row),this.fillHandle.beforeFillMaxCol=Math.max(n.start.col,n.end.col),this.fillHandle.beforeFillMaxRow=Math.max(n.start.row,n.end.row),this.table.fireListeners(at.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),n=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===n&&this.fillHandle.beforeFillMaxRow===o||this.table.eventManager.isDraging&&this.table.fireListeners(at.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,n,o,r){pN(t,e,n,o,this,r)}updateMoveCol(t,e,n,o,r){mN(t,e,n,o,this,r)}isMoveCol(){return this.columnMove.moving}endMoveCol(){return vN(this)}checkFrozen(){var t,e,n;let o=this.table.isListTable()&&!this.table.internalProps.transpose?this.table.options.frozenColCount:this.table.isPivotChart()?(t=this.table.rowHeaderLevelCount)!==null&&t!==void 0?t:0:Math.max(((e=this.table.rowHeaderLevelCount)!==null&&e!==void 0?e:0)+this.table.internalProps.layoutMap.leftRowSeriesNumberColumnCount,(n=this.table.options.frozenColCount)!==null&&n!==void 0?n: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 n=this.table.getAllRowsHeight(),o=this.scroll.verticalBarPos,r=this.table.tableNoFrameHeight;o+r>=n&&this.table.fireListeners(at.SCROLL_VERTICAL_END,{scrollTop:o,scrollLeft:this.scroll.horizontalBarPos,scrollHeight:(t=this.table.theme.scrollStyle)===null||t===void 0?void 0:t.width,scrollWidth:(e=this.table.theme.scrollStyle)===null||e===void 0?void 0:e.width,viewHeight:r,viewWidth:this.table.tableNoFrameWidth})}checkHorizontalScrollBarEnd(){var t,e;const n=this.table.getAllColsWidth(),o=this.scroll.horizontalBarPos,r=this.table.tableNoFrameWidth;o+r>=n&&this.table.fireListeners(at.SCROLL_HORIZONTAL_END,{scrollTop:this.scroll.verticalBarPos,scrollLeft:o,scrollHeight:(t=this.table.theme.scrollStyle)===null||t===void 0?void 0:t.width,scrollWidth:(e=this.table.theme.scrollStyle)===null||e===void 0?void 0:e.width,viewHeight:this.table.tableNoFrameHeight,viewWidth:r})}updateVerticalScrollBar(t){var e,n;const o=this.table.getAllRowsHeight(),r=this.scroll.verticalBarPos;this.scroll.verticalBarPos=Math.ceil(t*(o-this.table.scenegraph.height)),z(this.scroll.verticalBarPos)&&!isNaN(this.scroll.verticalBarPos)||(this.scroll.verticalBarPos=0),this.table.scenegraph.setY(-this.scroll.verticalBarPos,t===1),this.scroll.verticalBarPos-=this.table.scenegraph.proxy.deltaY,this.table.scenegraph.proxy.deltaY=0,this.updateHoverPos(-1,-1),this.table.fireListeners(at.SCROLL,{event:void 0,scrollTop:this.scroll.verticalBarPos,scrollLeft:this.scroll.horizontalBarPos,scrollHeight:(e=this.table.theme.scrollStyle)===null||e===void 0?void 0:e.width,scrollWidth:(n=this.table.theme.scrollStyle)===null||n===void 0?void 0:n.width,viewHeight:this.table.tableNoFrameHeight,viewWidth:this.table.tableNoFrameWidth,scrollDirection:"vertical",scrollRatioY:t}),r!==this.scroll.verticalBarPos&&this.checkVerticalScrollBarEnd()}updateHorizontalScrollBar(t){var e,n;const o=this.table.getAllColsWidth(),r=this.scroll.horizontalBarPos;this.scroll.horizontalBarPos=Math.ceil(t*(o-this.table.scenegraph.width)),z(this.scroll.horizontalBarPos)&&!isNaN(this.scroll.horizontalBarPos)||(this.scroll.horizontalBarPos=0),this.table.scenegraph.setX(-this.scroll.horizontalBarPos,t===1),this.scroll.horizontalBarPos-=this.table.scenegraph.proxy.deltaX,this.table.scenegraph.proxy.deltaX=0,this.updateHoverPos(-1,-1),this.table.fireListeners(at.SCROLL,{event:void 0,scrollTop:this.scroll.verticalBarPos,scrollLeft:this.scroll.horizontalBarPos,scrollHeight:(e=this.table.theme.scrollStyle)===null||e===void 0?void 0:e.width,scrollWidth:(n=this.table.theme.scrollStyle)===null||n===void 0?void 0:n.width,viewHeight:this.table.tableNoFrameHeight,viewWidth:this.table.tableNoFrameWidth,scrollDirection:"horizontal",scrollRatioX:t}),r!==this.scroll.horizontalBarPos&&this.checkHorizontalScrollBarEnd()}setScrollTop(t,e,n=!0){var o,r,s;const l=this.table.getAllRowsHeight(),a=!((o=this.table.options.customConfig)===null||o===void 0)&&o._disableColumnAndRowSizeRound?1:0;t=Math.max(0,Math.min(t,l-this.table.scenegraph.height-a)),((t=Math.ceil(t))!==this.scroll.verticalBarPos||this.table.isPivotChart())&&this.updateHoverPos(-1,-1);const h=this.scroll.verticalBarPos;this.scroll.verticalBarPos=t,z(this.scroll.verticalBarPos)&&!isNaN(this.scroll.verticalBarPos)||(this.scroll.verticalBarPos=0),this.table.scenegraph.setY(-t);const d=t/(l-this.table.scenegraph.height);this.table.scenegraph.component.updateVerticalScrollBarPos(d),h!==t&&n&&(this.table.fireListeners(at.SCROLL,{event:e==null?void 0:e.nativeEvent,scrollTop:this.scroll.verticalBarPos,scrollLeft:this.scroll.horizontalBarPos,scrollHeight:(r=this.table.theme.scrollStyle)===null||r===void 0?void 0:r.width,scrollWidth:(s=this.table.theme.scrollStyle)===null||s===void 0?void 0:s.width,viewHeight:this.table.tableNoFrameHeight,viewWidth:this.table.tableNoFrameWidth,scrollDirection:"vertical",scrollRatioY:d}),this.checkVerticalScrollBarEnd())}setScrollLeft(t,e,n=!0){var o,r,s;this.table.scrollLeft;const l=this.table.getAllColsWidth(),a=(this.table.getFrozenColsWidth(),!((o=this.table.options.customConfig)===null||o===void 0)&&o._disableColumnAndRowSizeRound?1:0);t=Math.max(0,Math.min(t,l-this.table.scenegraph.width-a)),(t=Math.ceil(t))!==this.scroll.horizontalBarPos&&this.updateHoverPos(-1,-1);const h=this.scroll.horizontalBarPos;this.scroll.horizontalBarPos=t,z(this.scroll.horizontalBarPos)&&!isNaN(this.scroll.horizontalBarPos)||(this.scroll.horizontalBarPos=0),this.table.scenegraph.setX(-t);const d=t/(l-this.table.scenegraph.width);this.table.scenegraph.component.updateHorizontalScrollBarPos(d),h!==t&&n&&(this.table.fireListeners(at.SCROLL,{event:e==null?void 0:e.nativeEvent,scrollTop:this.scroll.verticalBarPos,scrollLeft:this.scroll.horizontalBarPos,scrollHeight:(r=this.table.theme.scrollStyle)===null||r===void 0?void 0:r.width,scrollWidth:(s=this.table.theme.scrollStyle)===null||s===void 0?void 0:s.width,viewHeight:this.table.tableNoFrameHeight,viewWidth:this.table.tableNoFrameWidth,scrollDirection:"horizontal",scrollRatioX:d}),this.checkHorizontalScrollBarEnd())}hideVerticalScrollBar(){this.table.scenegraph.component.hideVerticalScrollBar()}showVerticalScrollBar(t){this.table.scenegraph.component.showVerticalScrollBar(),t&&(clearTimeout(this._clearVerticalScrollBar),this._clearVerticalScrollBar=setTimeout(()=>{var e;(e=this.table.scenegraph)===null||e===void 0||e.component.hideVerticalScrollBar()},1e3))}hideHorizontalScrollBar(){this.table.scenegraph.component.hideHorizontalScrollBar()}showHorizontalScrollBar(t){this.table.scenegraph.component.showHorizontalScrollBar(),t&&(clearTimeout(this._clearHorizontalScrollBar),this._clearHorizontalScrollBar=setTimeout(()=>{var e;(e=this.table.scenegraph)===null||e===void 0||e.component.hideHorizontalScrollBar()},1e3))}triggerContextMenu(t,e,n,o){this.menu.isShow&&this.menu.x===n&&this.menu.y===o?this.hideMenu():this.showContextMenu(t,e,n,o)}showContextMenu(t,e,n,o){var r;!((r=this.table.internalProps.menu)===null||r===void 0)&&r.contextMenuItems&&(this.table.internalProps.menu.renderMode==="html"?this.menu.isShow=!0:(this.menu.isShow=!0,this.menu.x=n,this.menu.y=o,this.table.scenegraph.component.menu.attach(n,o,t,e,bn.contextmenu)),this.table.fireListeners(at.SHOW_MENU,{x:n,y:o,col:t,row:e,type:"contextmenu"}))}triggerDropDownMenu(t,e,n,o,r){this.table.fireListeners(at.DROPDOWN_ICON_CLICK,{col:t,row:e,event:r}),this.menu.isShow?this.hideMenu():this.showDropDownMenu(t,e,n,o)}showDropDownMenu(t,e,n,o){this.table.internalProps.menu.renderMode==="html"?this.menu.isShow=!0:(this.menu.isShow=!0,this.table.scenegraph.component.menu.attach(n,o,t,e,bn.dropDown),this.menu.bounds=this.table.scenegraph.component.menu.bounds),this.table.fireListeners(at.SHOW_MENU,{x:n,y:o,col:t,row:e,type:"dropDown"}),this.residentHoverIcon&&this.table.scenegraph.setIconNormalStyle(this.residentHoverIcon.icon,this.residentHoverIcon.col,this.residentHoverIcon.row);const r=this.table.scenegraph.getCell(t,e);let s;r.forEachChildren(l=>l.attribute.funcType===ve.dropDown&&(s=l,!0)),s&&(this.residentHoverIcon={col:t,row:e,icon:s},this.table.scenegraph.setIconHoverStyle(this.residentHoverIcon.icon,this.residentHoverIcon.col,this.residentHoverIcon.row,r),this.table.scenegraph.residentHoverIcon(t,e))}hideMenu(){this.menu.isShow&&(this.table.fireListeners(at.DROPDOWN_MENU_CLEAR,null),this.table.fireListeners(at.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:n,row:o}=t[e],r=this.table.getCellRange(n,o);if(r)for(let s=r.start.col;s<=r.end.col;s++)for(let l=r.start.row;l<=r.end.row;l++)this.table.scenegraph.updateCellContent(s,l)}}dropDownMenuIsHighlight(t,e,n){const o=this.menu.dropDownMenuHighlight;if(Array.isArray(o))for(let r=0;r<o.length;r++){const s=o[r];let{col:l,row:a}=s;const{field:h,menuKey:d}=s;if(typeof l!="number"||typeof a!="number")if(this.table.isPivotTable()){const u=this.table.internalProps.layoutMap.getPivotCellAdress(h);if(!u)continue;l=u.col,a=u.row}else{const u=this.table.internalProps.layoutMap.getHeaderCellAddressByField(h);if(!u)continue;l=u.col,a=u.row}if(z(l)&&z(a)&&this.table.isCellRangeEqual(t,e,l,a)){const u=this.table._getHeaderLayoutMap(l??t,a??e).dropDownMenu||this.table.globalDropDownMenu;if(u)for(let c=0;c<u.length;c++){const g=u[c];if(ge(g)&&(g.menuKey||g.text)===(d||"")&&c===n||ce(g)&&g===d&&c===n)return!0}}}return!1}triggerSort(t,e,n,o){if(this.table.isPivotTable()){const c=this.table.getPivotSortState(t,e),g=c?c.toUpperCase():"NORMAL",f=g==="ASC"?"DESC":g==="DESC"?"NORMAL":"ASC";return this.table.sort(t,e,f),void this.table.fireListeners(rr.PIVOT_SORT_CLICK,{col:t,row:e,order:g||"normal",dimensionInfo:this.table.internalProps.layoutMap.getPivotDimensionInfo(t,e),cellLocation:this.table.getCellLocation(t,e),event:o})}const r=[...this.sort],s=this.table.internalProps.multipleSort||!r.length?null:this.sort[this.sort.length-1];lN(t,e,this.table,o);const l=this.table.getCellRange(t,e),a=this.sort.find(c=>c.col===l.start.col&&c.row===l.start.row),h=this.table.internalProps.multipleSort||!s?null:s.col,d=this.table.internalProps.multipleSort||!s?null:s.row,u=r.findIndex(c=>c.col===t&&c.row===e);u>=0&&r.splice(u,1),this.table.scenegraph.updateSortIcon({col:t,row:e,iconMark:n,order:a==null?void 0:a.order,oldSortCol:h,oldSortRow:d,oldIconMark:s==null?void 0:s.icon}),a&&(a.icon=n),this.table.internalProps.multipleSort||r.forEach(c=>{this.table.scenegraph.updateSortIcon({col:null,row:null,iconMark:null,order:"normal",oldSortCol:c.col,oldSortRow:c.row,oldIconMark:null})}),this.table.fireListeners(rr.AFTER_SORT,{order:a==null?void 0:a.order,field:this.table.getHeaderField(t,e),event:o})}updateSortState(t){var e,n,o,r,s,l,a,h;t=Array.isArray(t)?t:[t];for(let u=0;u<t.length;u++){if(t[u].field===((e=this.sort[u])===null||e===void 0?void 0:e.field)&&t[t.length-1].order===((n=this.sort[u])===null||n===void 0?void 0:n.order))return;const c=this.table.internalProps.multipleSort?null:((o=this.sort[u])===null||o===void 0?void 0:o.col)||null,g=this.table.internalProps.multipleSort?null:((r=this.sort[u])===null||r===void 0?void 0:r.row)||null;((s=this.sort[u])===null||s===void 0?void 0:s.order)==="asc"||(l=this.sort[u])===null||l===void 0||l.order,this.setSortState(t.slice(0,u+1));const f=this.table.internalProps.layoutMap.getHeaderCellAddressByField(t[u].field);this.sort[u].col=f.col,this.sort[u].row=f.row;const p=this.table.scenegraph.getCell(this.sort[u].col,this.sort[u].row);let m;am(p,"children",b=>b.attribute.funcType==="sort"&&(m=b,!0)),this.table.scenegraph.updateSortIcon({col:this.sort[u].col,row:this.sort[u].row,iconMark:m,order:this.sort[u].order,oldSortCol:c,oldSortRow:g,oldIconMark:(a=this.sort[u])===null||a===void 0?void 0:a.icon})}const d=[];this.table.internalProps.layoutMap.columnTree.tree.children.forEach(u=>{t.some(c=>c.field===u.field)||d.push(u)});for(let u=0;u<d.length;u++){const c=d[u];this.table.scenegraph.updateSortIcon({col:null,row:null,iconMark:null,order:null,oldSortCol:(h=c.startInTotal+this.table.internalProps.layoutMap.leftRowSeriesNumberColumnCount)!==null&&h!==void 0?h:0,oldSortRow:c.level,oldIconMark:null})}}triggerFreeze(t,e,n){if(!this.table.isPivotTable()&&!this.table.transpose){if(sN(t,e,this.table),this.table.hasListeners(rr.FREEZE_CLICK)){const o=this.table.internalProps.layoutMap.columnObjects.slice(0,t+1);this.table.fireListeners(rr.FREEZE_CLICK,{col:t,row:e,fields:o.reduce((r,s)=>r.concat(s.field),[]),colCount:this.table.frozenColCount})}this.frozen.icon=n}}updateCursor(t="default"){this.table.getElement().style.cursor=t}updateDrillState(t,e,n,o,r,s){this.drill.dimensionKey=t,this.drill.title=e,this.drill.drillDown=n,this.drill.drillUp=o,this.drill.col=r,this.drill.row=s,uN(r,s,n,o,this.table)}updateSparklineHoverPose(t,e,n,o){this.sparkLine.col!==-1&&this.sparkLine.row!==-1&&cN(this.sparkLine.col,this.sparkLine.row,this.table);let r=!1;t!==-1&&e!==-1&&(r=gN(t,e,n,o,this.table)),r?(this.sparkLine.col=t,this.sparkLine.row=e):(this.sparkLine.col=-1,this.sparkLine.row=-1)}setCheckedState(t,e,n,o){return TN(t,e,n,o,this)}setHeaderCheckedState(t,e){return MN(t,e,this)}syncCheckedState(t,e,n,o){return BN(t,e,n,o,this)}initCheckedState(t){return PN(t,this)}updateHeaderCheckedState(t,e,n){return HN(t,this,e,n)}initLeftRecordsCheckState(t){return EN(t,this)}setRadioState(t,e,n,o,r){wN(t,e,n,o,r,this)}syncRadioState(t,e,n,o,r,s){return xN(t,e,n,o,r,s,this)}changeCheckboxAndRadioOrder(t,e){this.checkedState.length&&kN(t,e,this),this.radioState.length&&AN(t,e,this)}setCustomSelectRanges(t){WN(this),NN(t,this)}}function jN(i){oe.mode==="browser"&&i.on(at.CLICK_CELL,t=>{const{col:e,row:n}=t;if(t.target.type==="image"&&t.target.role&&t.target.role.startsWith("icon"))return;let o;o=i.internalProps.layoutMap.isHeader(e,n)?i.isPivotTable()?i._getHeaderLayoutMap(e,n).headerType:i.getHeaderDefine(e,n).headerType:i.getBodyColumnType(e,n);const r=i.isHeader(e,n)?i.getHeaderDefine(e,n):i.getBodyColumnDefine(e,n),s=i.getCellValue(e,n),l=i.getCellOriginValue(e,n);if(o==="link"){if(r.linkJump===!1)return;const a=r.templateLink,h=r.linkDetect!==!1;let d;if(a){const g=i.getCellOriginRecord(e,n),f=Object.assign({__value:s,__dataValue:l},g),p=/\{\s*(\S+?)\s*\}/g;d=a.replace(p,(m,b)=>f[b])}else if(h){if(!um.test(s))return;d=s}else d=s;const u=r.linkTarget,c=r.linkWindowFeatures;window.open(d,u,c)}else if(o==="image"){const{clickToPreview:a}=r;if(a===!1)return;const h=document.createElement("div");h.style.width="100%",h.style.height="100%",h.style.position="absolute",h.style.top="0",h.style.left="0",h.style.backgroundColor="rgba(30, 30, 30, 0.4)",h.style.display="flex",h.style.justifyContent="center",h.style.alignItems="center",h.style.overflow="hidden",h.style.zIndex="9999",h.addEventListener("click",u=>{u.target===h&&document.body.removeChild(h)});const d=new Image;d.src=s,d.style.maxWidth="80%",d.style.maxHeight="80%",h.appendChild(d),document.body.appendChild(h)}else if(o==="video"){const{clickToPreview:a}=r;if(a===!1)return;const h=document.createElement("div");h.style.width="100%",h.style.height="100%",h.style.position="absolute",h.style.top="0",h.style.left="0",h.style.backgroundColor="rgba(30, 30, 30, 0.4)",h.style.display="flex",h.style.justifyContent="center",h.style.alignItems="center",h.style.overflow="hidden",h.style.zIndex="9999",h.addEventListener("click",u=>{u.target===h&&document.body.removeChild(h)});const d=document.createElement("video");d.src=s,d.style.maxWidth="80%",d.style.maxHeight="80%",d.setAttribute("preload","auto"),d.setAttribute("controls","true"),h.appendChild(d),document.body.appendChild(h)}})}function $N(i){i.on(at.MOUSEENTER_CELL,t=>{const{col:e,row:n}=t;if(e===-1||n===-1)return;const o=i.internalProps.layoutMap.getHeaderDimension(e,n);o!=null&&o.drillDown||o!=null&&o.drillUp?i.stateManager.updateDrillState(o.dimensionKey,o.title,o.drillDown,o.drillUp,e,n):i.stateManager.updateDrillState(void 0,void 0,!1,!1,-1,-1)}),i.on(at.MOUSELEAVE_TABLE,t=>{i.stateManager.updateDrillState(void 0,void 0,!1,!1,-1,-1)})}function GN(i){i.fireListeners(rr.DRILLMENU_CLICK,i.stateManager.drill)}function UN(i){const t=i.internalProps.layoutMap.rowsDefine,e=i.internalProps.layoutMap.columnsDefine;for(let n=0;n<t.length;n++){const o=t[n];if(typeof o!="string"&&(o.drillDown||o.drillUp))return!0}for(let n=0;n<e.length;n++){const o=e[n];if(typeof o!="string"&&(o.drillDown||o.drillUp))return!0}return!1}function TA(i){if(i.eventManager.bindSparklineHoverEvent)return;let t=!1;i.isPivotTable()?t=i.internalProps.layoutMap.indicatorsDefine.some(e=>typeof e!="string"&&e.cellType==="sparkline"):t=i.internalProps.layoutMap.columnObjects.some(e=>e.cellType==="sparkline"||typeof e.cellType=="function"),t&&(i.eventManager.bindSparklineHoverEvent=!0,i.on(at.MOUSEMOVE_CELL,e=>{const{col:n,row:o,x:r,y:s}=e;i.getBodyColumnType(n,o)!=="sparkline"&&i.stateManager.updateSparklineHoverPose(-1,-1,0,0),i.stateManager.updateSparklineHoverPose(n,o,r,s)}),i.on(at.MOUSELEAVE_TABLE,e=>{i.stateManager.updateSparklineHoverPose(-1,-1,0,0)}))}function ug(i,t,e=!0){var n;let{deltaX:o,deltaY:r}=i;i.shiftKey&&i.deltaY&&(o=r,r=0);const[s,l]=KN(o,r,{horizontal:1,vertical:1});(s||l)&&t.interactionState!==$t.scrolling&&t.updateInteractionState($t.scrolling),s&&(t.setScrollLeft(t.scroll.horizontalBarPos+s,i),t.showHorizontalScrollBar(!0)),l&&(t.setScrollTop(t.scroll.verticalBarPos+l,i),t.showVerticalScrollBar(!0)),e&&t.resetInteractionState(t.interactionStateBeforeScroll),!((n=i.nativeEvent)===null||n===void 0)&&n.cancelable&&(t.table.internalProps.overscrollBehavior==="none"||Math.abs(r)>=Math.abs(o)&&r!==0&&MA(r,t)||Math.abs(r)<=Math.abs(o)&&o!==0&&BA(o,t))&&i.nativeEvent.preventDefault()}function KN(i,t,e){var n,o;const r=Math.abs(i/t),s=r<=.5?0:i,l=r>2?0:t;return[Math.ceil(s*((n=e.horizontal)!==null&&n!==void 0?n:0)),Math.ceil(l*((o=e.vertical)!==null&&o!==void 0?o:0))]}function MA(i,t){return t.table.getAllRowsHeight()-t.table.scenegraph.height!=0&&!YN(i,t)&&!XN(i,t)}function BA(i,t){return t.table.getAllColsWidth()-t.table.scenegraph.width!=0&&!qN(i,t)&&!ZN(i,t)}function YN(i,t){return t.table.getAllRowsHeight()-t.table.scenegraph.height!==0&&i<=0&&t.scroll.verticalBarPos<1}function XN(i,t){var e;const n=!((e=t.table.options.customConfig)===null||e===void 0)&&e._disableColumnAndRowSizeRound?1:0,o=t.table.getAllRowsHeight()-t.table.scenegraph.height;return o!==0&&i>=0&&Math.abs(t.scroll.verticalBarPos-o)<1+n}function qN(i,t){return t.table.getAllColsWidth()-t.table.scenegraph.width!==0&&i<=0&&t.scroll.horizontalBarPos<1}function ZN(i,t){var e;const n=!((e=t.table.options.customConfig)===null||e===void 0)&&e._disableColumnAndRowSizeRound?1:0,o=t.table.getAllColsWidth()-t.table.scenegraph.width;return o!==0&&i>=0&&Math.abs(t.scroll.horizontalBarPos-o)<1+n}class JN{constructor(t){this.stateManager=t}setScrollHandle(t){this.scrollHandle=t}startInertia(t,e,n){this.lastTime=Date.now(),this.speedX=t,this.speedY=e,this.friction=n,this.runingId||(this.runingId=requestAnimationFrame(this.inertia.bind(this)))}inertia(){var t;const e=Date.now(),n=e-this.lastTime;let o=!0;const r=Math.pow(this.friction,n/16),s=r*this.speedX,l=r*this.speedY;let a=0,h=0;Math.abs(s)>.05&&(o=!1,a=(this.speedX+s)/2*n),Math.abs(l)>.05&&(o=!1,h=(this.speedY+l)/2*n),(t=this.scrollHandle)===null||t===void 0||t.call(this,a,h),o?this.runingId=null:(this.lastTime=e,this.speedX=s,this.speedY=l,this.runingId=requestAnimationFrame(this.inertia.bind(this)))}endInertia(){cancelAnimationFrame(this.runingId),this.runingId=null}isInertiaScrolling(){return!!this.runingId}}function ev(i,t,e){var n,o,r,s;t&&((n=i.stateManager.columnMove)===null||n===void 0?void 0:n.colSource)!==-1&&((o=i.stateManager.columnMove)===null||o===void 0?void 0:o.rowSource)!==-1&&((r=i.stateManager.columnMove)===null||r===void 0?void 0:r.colTarget)!==-1&&((s=i.stateManager.columnMove)===null||s===void 0?void 0:s.rowTarget)!==-1?i.hasListeners(at.CHANGE_HEADER_POSITION)&&i.fireListeners(at.CHANGE_HEADER_POSITION,{target:{col:i.stateManager.columnMove.colTarget,row:i.stateManager.columnMove.rowTarget},source:{col:i.stateManager.columnMove.colSource,row:i.stateManager.columnMove.rowSource},event:e}):t||i.hasListeners(at.CHANGE_HEADER_POSITION_FAIL)&&i.fireListeners(at.CHANGE_HEADER_POSITION_FAIL,{target:{col:i.stateManager.columnMove.colTarget,row:i.stateManager.columnMove.rowTarget},source:{col:i.stateManager.columnMove.colSource,row:i.stateManager.columnMove.rowSource},event:e})}function QN(i){const t=i.table,e=t.stateManager;t.scenegraph.tableGroup.addEventListener("pointermove",r=>{var s,l,a,h,d,u,c,g,f,p,m,b,C,_,w,y,S,A,R;const x=(l=(s=t.eventManager.LastPointerXY)===null||s===void 0?void 0:s.x)!==null&&l!==void 0?l:r.x,T=(h=(a=t.eventManager.LastPointerXY)===null||a===void 0?void 0:a.y)!==null&&h!==void 0?h:r.y;t.eventManager.LastPointerXY={x:r.x,y:r.y},i.touchSetTimeout&&(clearTimeout(i.touchSetTimeout),i.touchSetTimeout=void 0);const M=Ai(r);if(M.eventArgs&&t.hasListeners(at.MOUSEMOVE_TABLE)&&t.fireListeners(at.MOUSEMOVE_TABLE,{col:M.eventArgs.col,row:M.eventArgs.row,x:M.abstractPos.x,y:M.abstractPos.y,event:r.nativeEvent,target:(d=M==null?void 0:M.eventArgs)===null||d===void 0?void 0:d.target,mergeCellInfo:(u=M.eventArgs)===null||u===void 0?void 0:u.mergeInfo}),e.interactionState===$t.grabing&&!(!((c=t.editorManager)===null||c===void 0)&&c.editingEditor))return void(Math.abs(x-r.x)+Math.abs(T-r.y)>=1&&(e.isResizeCol()||(e.isMoveCol()?i.dealColumnMover(M):e.isFillHandle()?i.dealFillSelect(M,!0):((g=t.options.select)===null||g===void 0?void 0:g.disableDragSelect)||i.dealTableSelect(M,!0))));!(!((f=t.options.select)===null||f===void 0)&&f.disableDragSelect)&&t.eventManager.isDraging&&e.isSelecting()&&!(!((p=t.editorManager)===null||p===void 0)&&p.editingEditor)&&i.dealTableSelect(M,!0);const B=r.path.find(P=>P.role==="cell");if(t.hasListeners(at.MOUSELEAVE_CELL)&&(t.stateManager.hover.cellPos.col===-1||t.stateManager.hover.cellPos.row===-1||(B==null?void 0:B.col)===t.stateManager.hover.cellPos.col&&(B==null?void 0:B.row)===t.stateManager.hover.cellPos.row||t.fireListeners(at.MOUSELEAVE_CELL,{col:t.stateManager.hover.cellPos.col,row:t.stateManager.hover.cellPos.row,cellRange:t.getCellRangeRelativeRect({col:t.stateManager.hover.cellPos.col,row:t.stateManager.hover.cellPos.row}),scaleRatio:t.canvas.getBoundingClientRect().width/t.canvas.offsetWidth,event:r.nativeEvent,target:(m=M==null?void 0:M.eventArgs)===null||m===void 0?void 0:m.target})),t.hasListeners(at.MOUSEENTER_CELL)&&((B==null?void 0:B.role)!=="cell"||!z(B.col)||!z(B.row)||B.col===t.stateManager.hover.cellPos.col&&B.row===t.stateManager.hover.cellPos.row||B.col===((b=t.stateManager.hover.cellPosContainHeader)===null||b===void 0?void 0:b.col)&&B.row===((C=t.stateManager.hover.cellPosContainHeader)===null||C===void 0?void 0:C.row)||t.fireListeners(at.MOUSEENTER_CELL,{col:B.col,row:B.row,cellRange:t.getCellRangeRelativeRect({col:B.col,row:B.row}),scaleRatio:t.canvas.getBoundingClientRect().width/t.canvas.offsetWidth,event:r.nativeEvent,target:(_=M==null?void 0:M.eventArgs)===null||_===void 0?void 0:_.target,mergeCellInfo:(w=M.eventArgs)===null||w===void 0?void 0:w.mergeInfo})),i.dealIconHover(M),i.dealTableHover(M),M.eventArgs&&t.hasListeners(at.MOUSEMOVE_CELL)){let P,F;if(!((y=M.eventArgs)===null||y===void 0)&&y.target){const H=Mh((S=M.eventArgs)===null||S===void 0?void 0:S.target);H&&(P=H.icon,F=H.position)}t.fireListeners(at.MOUSEMOVE_CELL,{col:M.eventArgs.col,row:M.eventArgs.row,x:M.abstractPos.x,y:M.abstractPos.y,event:r.nativeEvent,targetIcon:P?{name:P.name,position:F,funcType:P.attribute.funcType}:void 0,target:(A=M==null?void 0:M.eventArgs)===null||A===void 0?void 0:A.target,mergeCellInfo:(R=M.eventArgs)===null||R===void 0?void 0:R.mergeInfo})}}),t.scenegraph.tableGroup.addEventListener("pointerout",r=>{var s;const l=Ai(r),a=(s=l==null?void 0:l.eventArgs)===null||s===void 0?void 0:s.target;(a==null?void 0:a.role)==="table"&&i.dealTableHover()}),t.scenegraph.tableGroup.addEventListener("pointerover",r=>{var s,l;const a=Ai(r),h=(s=a==null?void 0:a.eventArgs)===null||s===void 0?void 0:s.target;if(h&&t.hasListeners(at.MOUSEOVER_CHART_SYMBOL)&&h.type==="symbol"){const d=r.composedPath().find(u=>u.roll==="cell");if(d){const{col:u,row:c}=d,g={col:u,row:c,field:t.getHeaderField(u,c),value:t.getCellValue(u,c),dataValue:t.getCellOriginValue(u,c),cellHeaderPaths:t.internalProps.layoutMap.getCellHeaderPaths(u,c),title:t.getBodyColumnDefine(u,c).title,cellRange:t.getCellRelativeRect(u,c),event:r.nativeEvent,sparkline:{pointData:void 0},scaleRatio:t.canvas.getBoundingClientRect().width/t.canvas.offsetWidth,target:(l=a==null?void 0:a.eventArgs)===null||l===void 0?void 0:l.target};t.fireListeners(at.MOUSEOVER_CHART_SYMBOL,g)}}}),t.scenegraph.tableGroup.addEventListener("pointerenter",r=>{(t.theme.scrollStyle.horizontalVisible&&t.theme.scrollStyle.horizontalVisible==="focus"||!t.theme.scrollStyle.horizontalVisible&&t.theme.scrollStyle.visible==="focus")&&e.showHorizontalScrollBar(),(t.theme.scrollStyle.verticalVisible&&t.theme.scrollStyle.verticalVisible==="focus"||!t.theme.scrollStyle.verticalVisible&&t.theme.scrollStyle.visible==="focus")&&e.showVerticalScrollBar(),t.hasListeners(at.MOUSEENTER_TABLE)&&t.fireListeners(at.MOUSEENTER_TABLE,{event:r.nativeEvent})}),t.scenegraph.tableGroup.addEventListener("pointerleave",r=>{e.isResizeCol()||e.isMoveCol()||e.isSelecting()||(e.updateInteractionState($t.default),e.updateCursor()),(t.theme.scrollStyle.horizontalVisible&&t.theme.scrollStyle.horizontalVisible==="focus"||!t.theme.scrollStyle.horizontalVisible&&t.theme.scrollStyle.visible==="focus")&&e.hideHorizontalScrollBar(),(t.theme.scrollStyle.verticalVisible&&t.theme.scrollStyle.verticalVisible==="focus"||!t.theme.scrollStyle.verticalVisible&&t.theme.scrollStyle.visible==="focus")&&e.hideVerticalScrollBar(),t.hasListeners(at.MOUSELEAVE_CELL)&&t.stateManager.hover.cellPos.col!==-1&&t.stateManager.hover.cellPos.row!==-1&&t.fireListeners(at.MOUSELEAVE_CELL,{col:t.stateManager.hover.cellPos.col,row:t.stateManager.hover.cellPos.row,cellRange:t.getCellRangeRelativeRect({col:t.stateManager.hover.cellPos.col,row:t.stateManager.hover.cellPos.row}),scaleRatio:t.canvas.getBoundingClientRect().width/t.canvas.offsetWidth,event:r.nativeEvent,target:void 0}),i.dealTableHover();const s=r.target;s&&!s.isDescendantsOf(t.scenegraph.tableGroup)&&t.fireListeners(at.MOUSELEAVE_TABLE,{event:r.nativeEvent})});const n=r=>{var s;const l=r.target;if(!t.getElement().contains(l)){const a=(s=t.editorManager)===null||s===void 0?void 0:s.completeEdit(r);fc(a,h=>{h!==!1&&(e.updateInteractionState($t.default),i.dealTableHover())})}},o=r=>{var s;const l=r.target;if(!t.getElement().contains(l)){const a=(s=t.editorManager)===null||s===void 0?void 0:s.completeEdit(r);fc(a,h=>{var d,u;if(h!==!1&&(!((d=t.options.select)===null||d===void 0)&&d.outsideClickDeselect)){const c=!!(!((u=e.select.ranges)===null||u===void 0)&&u.length);i.dealTableSelect(),e.endSelectCells(!0,c)}})}};i.globalEventListeners.push({name:"pointerup",env:"document",callback:n}),i.globalEventListeners.push({name:"pointerdown",env:"document",callback:o}),Ke.addEventListener("pointerup",n),Ke.addEventListener("pointerdown",o),t.scenegraph.tableGroup.addEventListener("pointerdown",r=>{var s,l,a,h,d;if(t.hasListeners(at.MOUSEDOWN_TABLE)&&t.fireListeners(at.MOUSEDOWN_TABLE,{event:r.nativeEvent}),t.eventManager.isDown=!0,t.eventManager.LastBodyPointerXY={x:r.x,y:r.y},t.eventManager.LastPointerXY={x:r.x,y:r.y},r.button!==0)return;const u=Ai(r);if(i.downIcon=void 0,e.interactionState!==$t.default||(t.isPivotChart()&&((s=u==null?void 0:u.eventArgs)===null||s===void 0?void 0:s.target.type)!=="chart"&&t.scenegraph.updateChartState(null),((l=u.eventArgs)===null||l===void 0?void 0:l.target)!==((a=e.residentHoverIcon)===null||a===void 0?void 0:a.icon)&&e.hideMenu(),((h=u==null?void 0:u.eventArgs)===null||h===void 0?void 0:h.target.type)==="chart"))return;const c=(d=t.editorManager)===null||d===void 0?void 0:d.completeEdit(r.nativeEvent);fc(c,g=>{var f,p,m,b,C,_,w;if(g===!1)return;const y=!((m=(p=(f=u==null?void 0:u.eventArgs)===null||f===void 0?void 0:f.target)===null||p===void 0?void 0:p.role)===null||m===void 0)&&m.startsWith("icon")?u.eventArgs.target:!((b=r.target.role)===null||b===void 0)&&b.startsWith("icon")?r.target:void 0;if(i.downIcon=y,y&&y.attribute.interactive!==!1)y.attribute.funcType===ve.dragReorder&&(e.startMoveCol(u.eventArgs.col,u.eventArgs.row,u.abstractPos.x,u.abstractPos.y,(_=(C=u.eventArgs)===null||C===void 0?void 0:C.event)===null||_===void 0?void 0:_.nativeEvent),e.updateInteractionState($t.grabing));else if(r.pointerType==="touch")i.touchEnd=!1,i.touchSetTimeout=setTimeout(()=>{i.isTouchdown=!1,i.touchMove=!0,(i.touchEnd||!i.checkColumnResize(u,!0)&&!i.checkRowResize(u,!0))&&(i.touchEnd||!i.chechColumnMover(u))?i.dealTableSelect(u)&&!i.touchEnd&&e.updateInteractionState($t.grabing):e.updateInteractionState($t.grabing)},500),i.dealTableHover(u);else{if(!i.checkCellFillhandle(u)&&(i.checkColumnResize(u,!0)||i.checkRowResize(u,!0)))return t.scenegraph.updateChartState(null),void e.updateInteractionState($t.grabing);if(i.chechColumnMover(u)||i.checkCellFillhandle(u,!0)&&i.dealFillSelect(u))return void e.updateInteractionState($t.grabing);i.dealTableSelect(u)&&e.updateInteractionState($t.grabing)}if(t.hasListeners(at.MOUSEDOWN_CELL)){const S=Ai(r);S.eventArgs&&t.fireListeners(at.MOUSEDOWN_CELL,{col:S.eventArgs.col,row:S.eventArgs.row,event:r.nativeEvent,target:(w=S==null?void 0:S.eventArgs)===null||w===void 0?void 0:w.target,mergeCellInfo:S.eventArgs.mergeInfo})}})}),t.scenegraph.tableGroup.addEventListener("pointerup",r=>{var s,l,a,h;if(r.button===0){if(e.interactionState==="grabing"){if(e.updateInteractionState($t.default),e.isResizeCol())cg(t);else if(e.isResizeRow())iv(t);else if(e.isMoveCol()){const d=t.stateManager.endMoveCol();ev(t,d,r.nativeEvent)}else if(e.isSelecting()){t.stateManager.endSelectCells(),t.stateManager.isFillHandle()&&t.stateManager.endFillSelect();const d=Ai(r);if(t.eventManager.isDraging&&d.eventArgs&&t.hasListeners(at.DRAG_SELECT_END)){const u={event:r.nativeEvent,cells:[],col:d.eventArgs.target.col,row:d.eventArgs.target.row,scaleRatio:t.canvas.getBoundingClientRect().width/t.canvas.offsetWidth,target:(s=d==null?void 0:d.eventArgs)===null||s===void 0?void 0:s.target,mergeCellInfo:(l=d.eventArgs)===null||l===void 0?void 0:l.mergeInfo};u.cells=t.getSelectedCellInfos(),t.fireListeners(at.DRAG_SELECT_END,u)}}}else e.interactionState===$t.scrolling&&e.updateInteractionState($t.default);if(t.hasListeners(at.MOUSEUP_CELL)){const d=Ai(r);d.eventArgs&&t.fireListeners(at.MOUSEUP_CELL,{col:d.eventArgs.col,row:d.eventArgs.row,event:r.nativeEvent,target:(a=d==null?void 0:d.eventArgs)===null||a===void 0?void 0:a.target,mergeCellInfo:(h=d.eventArgs)===null||h===void 0?void 0:h.mergeInfo})}}}),t.scenegraph.tableGroup.addEventListener("rightdown",r=>{var s,l,a,h;const d=Ai(r);if(d.eventArgs){e.triggerContextMenu(d.eventArgs.col,d.eventArgs.row,d.abstractPos.x,d.abstractPos.y);const{col:u,row:c}=d.eventArgs;if(t.hasListeners(at.CONTEXTMENU_CELL)){const g=t.getCellInfo(u,c);let f,p;if(!((s=d.eventArgs)===null||s===void 0)&&s.target){const b=Mh((l=d.eventArgs)===null||l===void 0?void 0:l.target);b&&(f=b.icon,p=b.position)}const m=Object.assign(Object.assign({},g),{event:r.nativeEvent,cells:[],targetIcon:f?{name:f.name,position:p,funcType:f.attribute.funcType}:void 0,target:(a=d==null?void 0:d.eventArgs)===null||a===void 0?void 0:a.target,mergeCellInfo:(h=d.eventArgs)===null||h===void 0?void 0:h.mergeInfo});f4(t.stateManager.select.ranges,u,c)?m.cells=t.getSelectedCellInfos():m.cells=[[g]],t.fireListeners(at.CONTEXTMENU_CELL,m)}}}),t.scenegraph.tableGroup.addEventListener("pointertap",r=>{var s,l,a,h,d;if(t.stateManager.columnResize.resizing)return;const u=Ai(r);if(!i.touchMove&&r.button===0&&u.eventArgs&&t.hasListeners(at.CLICK_CELL)){const{col:c,row:g}=u.eventArgs,f=t.getCellInfo(c,g);let p,m;if(!((s=u.eventArgs)===null||s===void 0)&&s.target){const C=Mh((l=u.eventArgs)===null||l===void 0?void 0:l.target);C&&(p=C.icon,m=C.position)}const b=Object.assign(Object.assign({},f),{event:r.nativeEvent,federatedEvent:r,cells:[],targetIcon:p?{name:p.name,position:m,funcType:p.attribute.funcType}:void 0,target:(a=u==null?void 0:u.eventArgs)===null||a===void 0?void 0:a.target,mergeCellInfo:(h=u.eventArgs)===null||h===void 0?void 0:h.mergeInfo});t.fireListeners(at.CLICK_CELL,b)}if(!t.stateManager.columnResize.resizing&&!t.stateManager.columnMove.moving&&(i.dealIconClick(r,u),(u==null?void 0:u.eventArgs)&&i.touchSetTimeout&&r.pointerType==="touch")){const c=Ai(r);if(i.touchSetTimeout){clearTimeout(i.touchSetTimeout);const g=!!(!((d=e.select.ranges)===null||d===void 0)&&d.length);i.dealTableSelect(c),e.endSelectCells(!0,g),i.touchSetTimeout=void 0}}}),t.scenegraph.stage.addEventListener("pointerdown",r=>{var s,l,a,h;const d=Ai(r);!((s=d.eventArgs)===null||s===void 0)&&s.target&&((l=d.eventArgs)===null||l===void 0?void 0:l.target)===((a=e.residentHoverIcon)===null||a===void 0?void 0:a.icon)||e.hideMenu();const u=(h=t.editorManager)===null||h===void 0?void 0:h.completeEdit(r.nativeEvent);fc(u,c=>{var g;if(c===!1)return;const f=!((g=r.target.role)===null||g===void 0)&&g.startsWith("icon")?r.target:void 0;if(i.downIcon=f,!(f||i.checkCellFillhandle(d)||e.columnResize.resizing||!i.checkColumnResize(d,!0))){t.scenegraph.updateChartState(null),e.updateInteractionState($t.grabing);const{eventArgs:p}=d;p!=null&&p.targetCell||t.getCellAt(d.abstractPos.x-Ax/2,d.abstractPos.y)&&t.hasListeners(at.MOUSEDOWN_TABLE)&&t.fireListeners(at.MOUSEDOWN_TABLE,{event:r.nativeEvent})}})}),t.scenegraph.stage.addEventListener("pointerup",r=>{e.interactionState==="grabing"&&(e.updateInteractionState($t.default),e.isResizeCol()&&cg(t))}),t.scenegraph.stage.addEventListener("pointertap",r=>{var s,l,a;const h=r.target;if(t.eventManager.isDraging||!h||!h.isDescendantsOf(t.scenegraph.stage)&&h.stage!==h||h.isDescendantsOf(t.scenegraph.tableGroup))t.eventManager.isDraging&&e.isSelecting()&&e.endSelectCells();else{e.updateInteractionState($t.default),i.dealTableHover();const d=!!(!((s=e.select.ranges)===null||s===void 0)&&s.length);((a=(l=t.options.select)===null||l===void 0?void 0:l.blankAreaClickDeselect)===null||a===void 0||a)&&i.dealTableSelect(),e.endSelectCells(!0,d),e.updateCursor(),t.scenegraph.updateChartState(null)}}),t.scenegraph.stage.addEventListener("pointermove",r=>{const s=Ai(r);e.isResizeCol()||i.checkColumnResize(s)?t.stateManager.select&&i.checkCellFillhandle(s)?e.updateCursor("crosshair"):e.updateCursor("col-resize"):e.isResizeRow()||i.checkRowResize(s)?t.stateManager.select&&i.checkCellFillhandle(s)?e.updateCursor("crosshair"):e.updateCursor("row-resize"):e.isMoveCol()||e.updateCursor()}),t.scenegraph.tableGroup.addEventListener("checkbox_state_change",r=>{var s,l;const a=Ai(r),{col:h,row:d}=a.eventArgs,u=t.getCellInfo(h,d),c=ui(t,h,d);if(c)for(let f=c.start.col;f<=c.end.col;f++)for(let p=c.start.row;p<=c.end.row;p++)t.scenegraph.getCell(f,p).forEachChildren(m=>{m.name==="checkbox"&&m.setAttributes({checked:r.target.attribute.checked,indeterminate:r.target.attribute.indeterminate})});const g=Object.assign(Object.assign({},u),{event:r.nativeEvent,target:(s=a==null?void 0:a.eventArgs)===null||s===void 0?void 0:s.target,mergeCellInfo:(l=a==null?void 0:a.eventArgs)===null||l===void 0?void 0:l.mergeInfo,checked:r.detail.checked});if(t.isHeader(h,d))t.stateManager.setHeaderCheckedState(u.field,r.detail.checked),t.getCellType(h,d)==="checkbox"&&t.scenegraph.updateCheckboxCellState(h,d,r.detail.checked);else if(t.stateManager.setCheckedState(h,d,u.field,r.detail.checked),t.getCellType(h,d)==="checkbox"){const f=t.stateManager.headerCheckedState[u.field],p=t.stateManager.updateHeaderCheckedState(u.field,h,d);f!==p&&t.scenegraph.updateHeaderCheckboxCellState(h,d,p)}t.fireListeners(at.CHECKBOX_STATE_CHANGE,g),t.scenegraph.updateNextFrame()}),t.scenegraph.tableGroup.addEventListener("radio_checked",r=>{var s,l,a;const h=Ai(r),{col:d,row:u,target:c}=h.eventArgs,g=t.getCellInfo(d,u),f=(s=W6.exec(c.id))===null||s===void 0?void 0:s[1],p=ui(t,d,u);if(p)for(let _=p.start.col;_<=p.end.col;_++)for(let w=p.start.row;w<=p.end.row;w++)t.scenegraph.getCell(_,w).forEachChildren(y=>{y.name==="radio"&&y.id===c.id&&y.setAttributes({checked:!0})});const m=t.getBodyColumnDefine(d,u).radioCheckType||"column";if(m==="cell")if(p)for(let _=p.start.col;_<=p.end.col;_++)for(let w=p.start.row;w<=p.end.row;w++)t.scenegraph.getCell(_,w).forEachChildren(y=>{y.name==="radio"&&y.id!==c.id&&y.setAttributes({checked:!1})});else t.scenegraph.getCell(d,u).forEachChildren(_=>{_.name==="radio"&&_.id!==c.id&&_.setAttributes({checked:!1})});else m==="column"&&t.scenegraph.getColGroup(d).forEachChildren(_=>{_.forEachChildren(w=>{w.name==="radio"&&w.id!==c.id&&w.setAttributes({checked:!1})})});const b=f?Number(f):void 0;t.stateManager.setRadioState(d,u,g.field,m,b);const C=Object.assign(Object.assign({},g),{event:r.nativeEvent,target:(l=h==null?void 0:h.eventArgs)===null||l===void 0?void 0:l.target,mergeCellInfo:(a=h==null?void 0:h.eventArgs)===null||a===void 0?void 0:a.mergeInfo,radioIndexInCell:b});t.fireListeners(at.RADIO_STATE_CHANGE,C),t.scenegraph.updateNextFrame()}),t.scenegraph.stage.addEventListener("wheel",r=>{var s;r.path.find(l=>l.role==="table")&&((s=t.editorManager)===null||s===void 0||s.completeEdit(),t.eventManager._enableTableScroll&&ug(r,e))})}function t8(i){const t=i.table;i.gesture=new KI(t.scenegraph.tableGroup,{tap:{interval:300}}),i.gesture.on("doubletap",e=>{e8(e,t)})}function cg(i){i.stateManager.endResizeCol();const t=[];for(let e=0;e<i.colCount;e++)t.push(i.getColWidth(e));i.fireListeners(at.RESIZE_COLUMN_END,{col:i.stateManager.columnResize.col,colWidths:t})}function iv(i){i.stateManager.endResizeRow(),i.fireListeners(at.RESIZE_ROW_END,{row:i.stateManager.rowResize.row,rowHeight:i.getRowHeight(i.stateManager.rowResize.row)})}function e8(i,t){var e,n,o,r,s,l;const a=Ai(i);let h=-1,d=-1;a.eventArgs&&(h=a.eventArgs.col,d=a.eventArgs.row);const u=t.getCellValue(h,d),c=(n=(e=a.eventArgs)===null||e===void 0?void 0:e.targetCell)===null||n===void 0?void 0:n.globalAABBBounds;if(c&&t.internalProps.focusControl.setFocusRect(new gs(c.x1+t.scrollLeft,c.y1+t.scrollTop,c.x2-c.x1,c.y2-c.y1),u),t.hasListeners(at.DBLCLICK_CELL)){const g=t.getCellInfo(h,d);let f,p;if(!((o=a.eventArgs)===null||o===void 0)&&o.target){const b=Mh((r=a.eventArgs)===null||r===void 0?void 0:r.target);b&&(f=b.icon,p=b.position)}const m=Object.assign(Object.assign({},g),{event:i.nativeEvent,federatedEvent:i,cells:[],targetIcon:f?{name:f.name,position:p,funcType:f.attribute.funcType}:void 0,target:(s=a==null?void 0:a.eventArgs)===null||s===void 0?void 0:s.target,mergeCellInfo:(l=a==null?void 0:a.eventArgs)===null||l===void 0?void 0:l.mergeInfo});t.fireListeners(at.DBLCLICK_CELL,m)}}function i8(i){const t=i.table,e=t.stateManager,n=t.scenegraph;n.component.vScrollBar.addEventListener("pointerover",s=>{e.showVerticalScrollBar()}),n.component.hScrollBar.addEventListener("pointerover",s=>{e.showHorizontalScrollBar()}),n.component.vScrollBar.addEventListener("pointerout",s=>{e.interactionState!==$t.scrolling&&e.hideVerticalScrollBar()}),n.component.hScrollBar.addEventListener("pointerout",s=>{e.interactionState!==$t.scrolling&&e.hideHorizontalScrollBar()}),n.component.vScrollBar.addEventListener("pointermove",s=>{n.table.stateManager.updateCursor("default"),s.stopPropagation()}),n.component.vScrollBar.addEventListener("pointerdown",s=>{s.stopPropagation(),n.table.hasListeners(at.MOUSEDOWN_TABLE)&&n.table.fireListeners(at.MOUSEDOWN_TABLE,{event:s.nativeEvent})}),n.component.vScrollBar.addEventListener("scrollDown",s=>{var l;n.table.eventManager.LastBodyPointerXY={x:s.x,y:s.y},n.table.eventManager.isDown=!0,e.interactionState!==$t.scrolling&&e.updateInteractionState($t.scrolling),n.table.stateManager.hideMenu(),(l=n.table.editorManager)===null||l===void 0||l.completeEdit(),n.table.hasListeners(at.MOUSEDOWN_TABLE)&&n.table.fireListeners(at.MOUSEDOWN_TABLE,{event:s.nativeEvent})}),n.component.vScrollBar.addEventListener("pointerup",()=>{e.fastScrolling=!1,n.table.eventManager.isDraging=!1,e.interactionState===$t.scrolling&&e.updateInteractionState($t.default)}),n.component.vScrollBar.addEventListener("pointerupoutside",()=>{e.fastScrolling=!1,e.interactionState===$t.scrolling&&e.updateInteractionState($t.default)}),n.component.vScrollBar.addEventListener("scrollUp",s=>{n.table.eventManager.isDraging=!1}),n.component.hScrollBar.addEventListener("pointermove",s=>{n.table.stateManager.updateCursor("default"),s.stopPropagation()}),n.component.hScrollBar.addEventListener("pointerdown",s=>{s.stopPropagation(),n.table.hasListeners(at.MOUSEDOWN_TABLE)&&n.table.fireListeners(at.MOUSEDOWN_TABLE,{event:s.nativeEvent})}),n.component.hScrollBar.addEventListener("scrollDown",s=>{var l;n.table.eventManager.LastBodyPointerXY={x:s.x,y:s.y},n.table.eventManager.isDown=!0,e.interactionState!==$t.scrolling&&e.updateInteractionState($t.scrolling),n.table.stateManager.hideMenu(),(l=n.table.editorManager)===null||l===void 0||l.completeEdit(),n.table.hasListeners(at.MOUSEDOWN_TABLE)&&n.table.fireListeners(at.MOUSEDOWN_TABLE,{event:s.nativeEvent})}),n.component.hScrollBar.addEventListener("pointerup",()=>{e.fastScrolling=!1,n.table.eventManager.isDraging=!1,e.interactionState===$t.scrolling&&e.updateInteractionState($t.default)}),n.component.hScrollBar.addEventListener("pointerupoutside",()=>{e.fastScrolling=!1,e.interactionState===$t.scrolling&&e.updateInteractionState($t.default)}),n.component.hScrollBar.addEventListener("scrollUp",s=>{n.table.eventManager.isDraging=!1});const o=hx(e.updateVerticalScrollBar,20),r=hx(e.updateHorizontalScrollBar,20);n.component.vScrollBar.addEventListener("scrollDrag",s=>{n.table.eventManager.isDown&&(n.table.eventManager.isDraging=!0),e.fastScrolling=!0,e.interactionState!==$t.scrolling&&e.updateInteractionState($t.scrolling);const l=s.detail.value[0]/(1-s.detail.value[1]+s.detail.value[0]);o(l,s)}),n.component.hScrollBar.addEventListener("scrollDrag",s=>{n.table.eventManager.isDown&&(n.table.eventManager.isDraging=!0),e.fastScrolling=!0,e.interactionState!==$t.scrolling&&e.updateInteractionState($t.scrolling);const l=s.detail.value[0]/(1-s.detail.value[1]+s.detail.value[0]);r(l)})}let Ss=1;function PA(){return dx?Ss=1:(Ss=Math.ceil(window.devicePixelRatio||1),Ss>1&&Ss%2!=0&&(Ss+=1)),Ss}PA();function n8(i){const t=i.table,e=t.stateManager,n=t.internalProps.handler;function o(f){var p;if(t.hasListeners(at.KEYDOWN)){const m={keyCode:(p=f.keyCode)!==null&&p!==void 0?p:f.which,code:f.code,event:f,scaleRatio:t.canvas.getBoundingClientRect().width/t.canvas.offsetWidth};t.fireListeners(at.KEYDOWN,m)}}n.on(t.getElement(),"blur",f=>{i.dealTableHover()}),n.on(t.getElement(),"keydown",f=>{var p,m,b,C,_,w,y,S,A,R,x,T,M,B,P,F,H,E,k;if(f.key==="a"&&(f.ctrlKey||f.metaKey))!((p=t.keyboardOptions)===null||p===void 0)&&p.selectAllOnCtrlA&&(f.preventDefault(),i.deelTableSelectAll());else if(e.select.cellPos.col>=0&&e.select.cellPos.row>=0&&(f.key==="ArrowUp"||f.key==="ArrowDown"||f.key==="ArrowLeft"||f.key==="ArrowRight")){if(((b=(m=t.options.keyboardOptions)===null||m===void 0?void 0:m.moveEditCellOnArrowKeys)===null||b===void 0||!b)&&(!((C=t.editorManager)===null||C===void 0)&&C.editingEditor))return;let I,L;if(f.preventDefault(),f.stopPropagation(),f.key==="ArrowUp"?f.ctrlKey||f.metaKey?(I=e.select.cellPos.col,L=0):(f.shiftKey,I=e.select.cellPos.col,L=Math.min(t.rowCount-1,Math.max(0,e.select.cellPos.row-1))):f.key==="ArrowDown"?f.ctrlKey||f.metaKey?(I=e.select.cellPos.col,L=t.rowCount-1):(f.shiftKey,I=e.select.cellPos.col,L=Math.min(t.rowCount-1,Math.max(0,e.select.cellPos.row+1))):f.key==="ArrowLeft"?f.ctrlKey||f.metaKey?(I=0,L=e.select.cellPos.row):(f.shiftKey,L=e.select.cellPos.row,I=Math.min(t.colCount-1,Math.max(0,e.select.cellPos.col-1))):f.key==="ArrowRight"&&(f.ctrlKey||f.metaKey?(I=t.colCount-1,L=e.select.cellPos.row):(f.shiftKey,L=e.select.cellPos.row,I=Math.min(t.colCount-1,Math.max(0,e.select.cellPos.col+1)))),Kc(t,I,L))return;t.selectCell(I,L,f.shiftKey),(w=(_=t.options.keyboardOptions)===null||_===void 0?void 0:_.moveEditCellOnArrowKeys)!==null&&w!==void 0&&w&&(!((y=t.editorManager)===null||y===void 0)&&y.editingEditor)&&(t.editorManager.completeEdit(),t.getElement().focus(),t.getEditor(I,L)&&t.editorManager.startEditCell(I,L))}else if(f.key==="Escape")(S=t.editorManager)===null||S===void 0||S.cancelEdit(),t.getElement().focus();else if(f.key==="Enter"){if(!((A=t.editorManager)===null||A===void 0)&&A.editingEditor){if(o(f),t.editorManager.completeEdit(),t.getElement().focus(),((R=t.options.keyboardOptions)===null||R===void 0?void 0:R.moveFocusCellOnEnter)===!0){const I=e.select.cellPos.col,L=Math.min(t.rowCount-1,Math.max(0,e.select.cellPos.row+1));if(Kc(t,I,L))return;t.selectCell(I,L,f.shiftKey)}return}if(((x=t.options.keyboardOptions)===null||x===void 0?void 0:x.moveFocusCellOnEnter)===!0){const I=e.select.cellPos.col,L=Math.min(t.rowCount-1,Math.max(0,e.select.cellPos.row+1));if(Kc(t,I,L))return;t.selectCell(I,L,f.shiftKey)}else if(((M=(T=t.options.keyboardOptions)===null||T===void 0?void 0:T.editCellOnEnter)===null||M===void 0||M)&&((P=(B=t.stateManager.select.ranges)===null||B===void 0?void 0:B.length)!==null&&P!==void 0?P:0)===1){const I=t.stateManager.select.ranges[0].start.col,L=t.stateManager.select.ranges[0].start.row,D=t.stateManager.select.ranges[0].end.col,O=t.stateManager.select.ranges[0].end.row;I===D&&L===O&&t.getEditor(I,L)&&t.editorManager.startEditCell(I,L)}}else if(f.key==="Tab"){if(((H=(F=t.options.keyboardOptions)===null||F===void 0?void 0:F.moveFocusCellOnTab)===null||H===void 0||H)&&e.select.cellPos.col>=0&&e.select.cellPos.row>=0){if(e.select.cellPos.col===t.colCount-1&&e.select.cellPos.row===t.rowCount-1)return;let I,L;if(f.preventDefault(),e.select.cellPos.col===t.colCount-1?(L=Math.min(t.rowCount-1,e.select.cellPos.row+1),I=t.rowHeaderLevelCount):(L=e.select.cellPos.row,I=e.select.cellPos.col+1),Kc(t,I,L))return;t.selectCell(I,L),!((E=t.editorManager)===null||E===void 0)&&E.editingEditor&&(t.editorManager.completeEdit(),t.getElement().focus(),t.getEditor(I,L)&&t.editorManager.startEditCell(I,L))}}else if(!(f.ctrlKey||f.metaKey||f.shiftKey)){const I=t.options.editCellTrigger;if((I==="keydown"||Array.isArray(I)&&I.includes("keydown"))&&!(!((k=t.editorManager)===null||k===void 0)&&k.editingEditor)){const L=/^[a-zA-Z0-9+\-*\/%=.,\s]$/;f.key.match(L)&&t.editorManager.startEditCell(e.select.cellPos.col,e.select.cellPos.row,"")}}o(f)}),n.on(t.getElement(),"copy",f=>{var p,m;if(!((p=t.keyboardOptions)===null||p===void 0)&&p.copySelected){const b=t.getCopyValue();if(z(b)){if(f.preventDefault(),(m=navigator.clipboard)===null||m===void 0?void 0:m.write){const C=w=>{const y=["<table>"],S=['<meta name="author" content="Visactor"/>','<style type="text/css">td{white-space:normal}br{mso-data-placement:same-cell}</style>'].join(""),A=w.split(`\r
|
|
127
127
|
`);return A.forEach(function(R,x){const T=R.split(" "),M=[];x===0&&y.push("<tbody>"),T.forEach(function(B,P){const F=B?B.toString().replace(/&/g,"&").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">").replace(/\n/g,"<br>").replace(/(<br(\s*|\/)>(\r\n|\n)?|\r\n|\n)/g,`<br>\r
|
|
128
128
|
`).replace(/\x20{2,}/gi,H=>`<span style="mso-spacerun: yes">${" ".repeat(H.length-1)} </span>`).replace(/\t/gi,"	"):" ";M.push(`<td>${F}</td>`)}),y.push("<tr>",...M,"</tr>"),x===A.length-1&&y.push("</tbody>")}),y.push("</table>"),[S,y.join("")].join("")},_=C(b);navigator.clipboard.write([new ClipboardItem({"text/html":new Blob([_],{type:"text/html"}),"text/plain":new Blob([b],{type:"text/plain"})})])}else m4.IE?window.clipboardData.setData("Text",b):f.clipboardData.setData("text/plain",b);t.fireListeners(at.COPY_DATA,{cellRange:t.stateManager.select.ranges,copyData:b})}}}),n.on(t.getElement(),"paste",f=>{var p,m,b,C;if(!((p=t.keyboardOptions)===null||p===void 0)&&p.pasteValueToCell&&t.changeCellValues){if(!((m=t.editorManager)===null||m===void 0)&&m.editingEditor)return;if(((b=t.stateManager.select.ranges)===null||b===void 0?void 0:b.length)>0)if(!((C=navigator.clipboard)===null||C===void 0)&&C.read)navigator.clipboard.read().then(_=>{for(const w of _)w.types.includes("text/html")?l(w):w.types.length===1&&w.types[0]==="text/plain"&&h(w)});else{const _=t.stateManager.select.ranges,w=Math.min(_[0].start.col,_[0].end.col),y=Math.min(_[0].start.row,_[0].end.row),S=(f.clipboardData||window.Clipboard).getData("text").split(`
|
|
129
129
|
`),A=[];S.forEach(function(R,x){const T=R.split(" "),M=[];A.push(M),T.forEach(function(B,P){P===T.length-1&&(B=B.trim()),M.push(B)})}),t.changeCellValues(w,y,A)}}}),n.on(t.getElement(),"contextmenu",f=>{var p;((p=t.eventOptions)===null||p===void 0?void 0:p.preventDefaultContextMenu)!==!1&&f.preventDefault()}),t.options.canvas||n.on(t.getContainer(),"resize",f=>{var p;f.width===0&&f.height===0||((t.autoFillWidth||t.autoFillHeight)&&((p=t.editorManager)===null||p===void 0||p.completeEdit()),z(t.options.pixelRatio)||t.setPixelRatio(PA()),f.windowSizeNotChange||t.resize())});const r=/<tr[^>]*>([\s\S]*?)<\/tr>/g,s=/<td[^>]*>([\s\S]*?)<\/td>/g;function l(f){const p=t.stateManager.select.ranges,m=p.length,b=Math.min(p[m-1].start.col,p[m-1].end.col),C=Math.min(p[m-1].start.row,p[m-1].end.row),_=Math.max(p[m-1].start.col,p[m-1].end.col),w=Math.max(p[m-1].start.row,p[m-1].end.row);let y=0,S=0,A=[];f.getType("text/html").then(R=>{R.text().then(x=>{var T,M;if(x&&/(<table)|(<TABLE)/g.test(x)){const B=Array.from(x.matchAll(r));for(const P of B){const F=P[1],H=Array.from(F.matchAll(s)).map(E=>E[1].replace(/(<(?!br)([^>]+)>)/gi,"").replace(/<br(\s*|\/)>[\r\n]?/gim,`
|
|
@@ -131,7 +131,7 @@
|
|
|
131
131
|
`).forEach(function(x,T){var M;const B=x.split(" "),P=[];R.push(P),B.forEach(function(F,H){H===B.length-1&&(F=F.trim()),P.push(F)}),S=Math.max(S,(M=P==null?void 0:P.length)!==null&&M!==void 0?M:0)}),A=(p=R.length)!==null&&p!==void 0?p:0,R=d(R,A,S,y-_+1,w-C+1),t.changeCellValues(C,_,R,!0)}function h(f){const p=t.stateManager.select.ranges,m=p.length,b=Math.min(p[m-1].start.col,p[m-1].end.col),C=Math.min(p[m-1].start.row,p[m-1].end.row),_=Math.max(p[m-1].start.col,p[m-1].end.col),w=Math.max(p[m-1].start.row,p[m-1].end.row);let y=0,S=0;f.getType("text/plain").then(A=>{A.text().then(R=>{var x;const T=R.replace(/\r(?!\n)/g,`\r
|
|
132
132
|
`).split(`\r
|
|
133
133
|
`);let M=[];T.length>1&&T[T.length-1]===""&&T.pop(),T.forEach(function(B,P){var F;const H=B.split(" "),E=[];M.push(E),H.forEach(function(k,I){k.includes(`
|
|
134
|
-
`)&&(k=k.replace(/^"(.*)"$/,"$1").replace(/["]*/g,L=>new Array(Math.floor(L.length/2)).fill('"').join(""))),E.push(k)}),y=Math.max(y,(F=E==null?void 0:E.length)!==null&&F!==void 0?F:0)}),S=(x=M.length)!==null&&x!==void 0?x:0,M=d(M,S,y,w-C+1,_-b+1),t.changeCellValues(b,C,M,!0)})})}function d(f,p,m,b,C){if(C>m||b>p){if(C%m==0&&b%p==0){const _=[];for(let w=0;w<b;w++){const y=[];_.push(y);for(let S=0;S<C;S++){const A=w%p,R=S%m;y.push(f[A][R])}}return _}return f}return f}const u=f=>{t.eventManager.LastBodyPointerXY={x:f.x,y:f.y},t.eventManager.isDown=!0};i.globalEventListeners.push({name:"pointerdown",env:"body",callback:u}),document.body.addEventListener("pointerdown",u);const c=f=>{if(f.target!==t.canvas&&(p=>{var m,b;if(e.menu.isShow&&setTimeout(()=>{t.internalProps.menuHandler.pointInMenuElement(p.clientX,p.clientY)||e.menu.isShow&&e.hideMenu()},0),e.isResizeCol())cg(t);else if(e.isResizeRow())iv(t);else if(e.isMoveCol()){const C=t.stateManager.endMoveCol();ev(t,C,p)}else if(e.isSelecting()&&(!((b=(m=t.stateManager.select)===null||m===void 0?void 0:m.ranges)===null||b===void 0)&&b.length)){const C=t.stateManager.select.ranges[t.stateManager.select.ranges.length-1].end.col,_=t.stateManager.select.ranges[t.stateManager.select.ranges.length-1].end.row;if(t.stateManager.endSelectCells(),t.hasListeners(at.DRAG_SELECT_END)){const w={event:p,cells:[],col:C,row:_,scaleRatio:t.canvas.getBoundingClientRect().width/t.canvas.offsetWidth,target:void 0};w.cells=t.getSelectedCellInfos(),t.fireListeners(at.DRAG_SELECT_END,w)}}})(f),t.eventManager.LastBodyPointerXY=null,t.eventManager.isDown=!1,t.eventManager.isDraging=!1,t.eventManager.inertiaScroll.endInertia(),e.interactionState==="grabing"&&e.isResizeCol())cg(t);else if(e.interactionState==="grabing"&&e.isResizeRow())iv(t);else if(e.isMoveCol()){const p=t.stateManager.endMoveCol();ev(t,p,f)}};i.globalEventListeners.push({name:"pointerup",env:"document",callback:c}),document.addEventListener("pointerup",c);const g=f=>{var p,m,b,C,_;if(t.eventManager.isDown&&t.eventManager.LastBodyPointerXY){const A=(m=(p=t.eventManager.LastBodyPointerXY)===null||p===void 0?void 0:p.x)!==null&&m!==void 0?m:f.x,R=(C=(b=t.eventManager.LastBodyPointerXY)===null||b===void 0?void 0:b.y)!==null&&C!==void 0?C:f.y;(Math.abs(A-f.x)>1||Math.abs(R-f.y)>1)&&(t.eventManager.isDraging=!0)}const{x:w,y}=t._getMouseAbstractPoint(f,!1);e.interactionState===$t.grabing&&(e.isResizeCol()?(i.dealColumnResize(w,y),t.hasListeners(at.RESIZE_COLUMN)&&t.fireListeners(at.RESIZE_COLUMN,{col:t.stateManager.columnResize.col,colWidth:t.getColWidth(t.stateManager.columnResize.col)})):e.isResizeRow()&&(i.dealRowResize(w,y),t.hasListeners(at.RESIZE_ROW)&&t.fireListeners(at.RESIZE_ROW,{row:t.stateManager.rowResize.row,rowHeight:t.getRowHeight(t.stateManager.rowResize.row)})));const S=t.stateManager.isSelecting();if(i._enableTableScroll&&i.isDraging&&S&&((_=t.stateManager.select.ranges)===null||_===void 0?void 0:_.length)>0){const A=t.getDrawRange(),R=t.getFrozenRowsHeight(),x=t.getBottomFrozenRowsHeight(),T=t.getFrozenColsWidth(),M=t.getRightFrozenColsWidth(),B=t.stateManager.select.ranges[t.stateManager.select.ranges.length-1].start;if(t.isSeriesNumber(B.col,B.row))return;const P=t.stateManager.select.ranges[t.stateManager.select.ranges.length-1].end,F=(t.isFrozenRow(B.row)===!1||t.isFrozenRow(P.row)===!1)&&t.getAllRowsHeight()>t.tableNoFrameHeight,H=(t.isFrozenColumn(B.col)===!1||t.isFrozenColumn(P.col)===!1)&&t.getAllColsWidth()>t.tableNoFrameWidth;if((y>A.bottom-x||y<A.top+R)&&F||(w>A.right-M||w<A.left+T)&&H){t.eventManager.scrollXSpeed=0,t.eventManager.scrollYSpeed=0;let E=!1,k=!1,I=!1,L=!1;y>A.bottom-x&&F&&t.scrollTop+t.tableNoFrameHeight<t.getAllRowsHeight()?(E=!0,t.eventManager.scrollYSpeed=-(y-A.bottom+x)/50):y<A.top+R&&F&&t.scrollTop>0&&(k=!0,t.eventManager.scrollYSpeed=-(y-A.top-R)/50),w>A.right-M&&H&&t.scrollLeft+t.tableNoFrameWidth<t.getAllColsWidth()?(I=!0,t.eventManager.scrollXSpeed=-(w-A.right+M)/50):w<A.left+T&&H&&t.scrollLeft>0&&(L=!0,t.eventManager.scrollXSpeed=-(w-A.left-T)/50),t.eventManager.inertiaScroll.startInertia(t.eventManager.scrollXSpeed,t.eventManager.scrollYSpeed,1),t.eventManager.inertiaScroll.setScrollHandle((D,O)=>{let N,W;ug({deltaX:-D,deltaY:-O},t.stateManager,!1),E?W=t.scrollTop+A.height-x-20:k&&(W=t.scrollTop+R+20),I?N=t.scrollLeft+A.width-M-20:L&&(N=t.scrollLeft+T+20);let $=!1,U=!1;I||L||(w>t.tableNoFrameWidth-t.getRightFrozenColsWidth()&&w<t.tableNoFrameWidth||w>0&&w<t.getFrozenColsWidth()?(N=w,U=!0):N=t.scrollLeft+w),E||k||(y>t.tableNoFrameHeight-t.getBottomFrozenRowsHeight()&&y<t.tableNoFrameHeight||y>0&&y<t.getFrozenRowsHeight()?(W=y,$=!0):W=t.scrollTop+y),t.stateManager.updateInteractionState($t.grabing);const Y=t.getTargetColAtConsiderRightFrozen(N,U),j=t.getTargetRowAtConsiderBottomFrozen(W,$);z(Y)&&z(j)&&t.stateManager.updateSelectPos(Y.col,j.row,!1,!1,!1,!0)})}else t.eventManager.inertiaScroll.isInertiaScrolling()?t.eventManager.inertiaScroll.endInertia():t.eventManager.scrollYSpeed=0}};i.globalEventListeners.push({name:"pointermove",env:"body",callback:g}),document.body.addEventListener("pointermove",g)}function o8(i){const t=i.table,e=t.stateManager,n=t.scenegraph;i.touchMovePoints=[],t.scenegraph.tableGroup.addEventListener("touchstart",l=>{l.target.isChildOf(n.component.vScrollBar)||l.target.isChildOf(n.component.vScrollBar)||(i.isTouchdown=!0,i.touchMovePoints.push({x:l.page.x,y:l.page.y,timestamp:Date.now()}))});const o=l=>{var a,h;if(i.touchMove&&l.preventDefault(),i.isTouchdown&&HA(l)){if(((h=(a=i.downIcon)===null||a===void 0?void 0:a.attribute)===null||h===void 0?void 0:h.funcType)===ve.dragReorder)l.preventDefault();else if(i.touchMovePoints.length>4&&i.touchMovePoints.shift(),i.touchMovePoints.push({x:l.changedTouches[0].pageX,y:l.changedTouches[0].pageY,timestamp:Date.now()}),i._enableTableScroll){const d=-i.touchMovePoints[i.touchMovePoints.length-1].x+i.touchMovePoints[i.touchMovePoints.length-2].x,u=-i.touchMovePoints[i.touchMovePoints.length-1].y+i.touchMovePoints[i.touchMovePoints.length-2].y;ug({deltaX:d,deltaY:u},e),l.cancelable&&(t.internalProps.overscrollBehavior==="none"||Math.abs(u)>=Math.abs(d)&&u!==0&&MA(u,e)||Math.abs(u)<=Math.abs(d)&&d!==0&&BA(d,e))&&l.preventDefault()}}};window.addEventListener("touchmove",o,{passive:!1}),i.globalEventListeners.push({name:"touchmove",env:"window",callback:o});const r=l=>{var a,h,d,u;if(i.touchEnd=!0,i.touchMove=!1,i.isTouchdown&&HA(l)){if(((h=(a=i.downIcon)===null||a===void 0?void 0:a.attribute)===null||h===void 0?void 0:h.funcType)===ve.dragReorder)l.preventDefault();else if(!((d=i.touchMovePoints)===null||d===void 0)&&d.length&&(i.touchMovePoints.length>4&&i.touchMovePoints.shift(),i.touchMovePoints.push({x:l.changedTouches[0].pageX,y:l.changedTouches[0].pageY,timestamp:Date.now()}),i._enableTableScroll)){const c=i.touchMovePoints[0],g=i.touchMovePoints[((u=i.touchMovePoints)===null||u===void 0?void 0:u.length)-1],f=(g.x-c.x)/(g.timestamp-c.timestamp),p=(g.y-c.y)/(g.timestamp-c.timestamp);i.inertiaScroll.startInertia(f,p,.95),t.eventManager.inertiaScroll.setScrollHandle((m,b)=>{ug({deltaX:-m,deltaY:-b},t.stateManager)})}i.isTouchdown=!1,i.touchMovePoints=[]}};window.addEventListener("touchend",r),i.globalEventListeners.push({name:"touchend",env:"window",callback:r});const s=l=>{i.touchEnd=!0,i.touchMove=!1,i.isTouchdown&&(i.isTouchdown=!1,i.touchMovePoints=[])};window.addEventListener("touchcancel",s),i.globalEventListeners.push({name:"touchcancel",env:"window",callback:s})}function HA(i){return!!i.changedTouches}function r8(i){i.isPivotChart()&&i.scenegraph.tableGroup.addEventListener("click",t=>{var e;if(!i.stateManager.columnMove.moving&&!i.stateManager.columnResize.resizing)if(t.target.name==="axis-label"){const n=Ai(t),{col:o,row:r}=n.eventArgs,s=i.internalProps.layoutMap;let l,a;s.indicatorsAsCol?(l=s.getDimensionKeyInChartSpec(s.rowHeaderLevelCount,r),a=s.getCellHeaderPaths(s.rowHeaderLevelCount-2,r).rowHeaderPaths):(l=s.getDimensionKeyInChartSpec(o,s.columnHeaderLevelCount),a=s.getCellHeaderPaths(o,s.columnHeaderLevelCount-1).colHeaderPaths);const h=a.map(d=>({key:d.dimensionKey,value:d.value})).filter(d=>d.key);if(h.push({key:l,value:t.target.attribute.text}),i._selectedDimensionInChart.length&&s8(i._selectedDimensionInChart,h))return;i._selectedDimensionInChart=h,s.updateDataStateToChartInstance(),Th(i.scenegraph),i.scenegraph.updateNextFrame()}else!((e=i._selectedDimensionInChart)===null||e===void 0)&&e.length&&(i._selectedDimensionInChart.length=0,i.internalProps.layoutMap.updateDataStateToChartInstance(),Th(i.scenegraph),i.scenegraph.updateNextFrame())})}function s8(i,t){if(i.length!==t.length)return!1;for(let e=0;e<i.length;e++)if(i[e].key!==t[e].key||i[e].value!==t[e].value)return!1;return!0}function l8(i){i.isPivotChart()&&(i.on(at.MOUSEENTER_CELL,t=>{i.scenegraph.getCell(t.col,t.row).forEachChildren(e=>{if(e.name==="axis"){const n=EA(t.col,t.row,i.internalProps.layoutMap);t.axisPosition=n,i.fireListeners(at.MOUSEENTER_AXIS,t)}})}),i.on(at.MOUSELEAVE_CELL,t=>{i.scenegraph.getCell(t.col,t.row).forEachChildren(e=>{if(e.name==="axis"){const n=EA(t.col,t.row,i.internalProps.layoutMap);t.axisPosition=n,i.fireListeners(at.MOUSELEAVE_AXIS,t)}})}))}function EA(i,t,e){if(e.indicatorsAsCol){if(e.hasTwoIndicatorAxes&&t===e.columnHeaderLevelCount-1&&i>=e.rowHeaderLevelCount&&i<e.colCount-e.rightFrozenColCount)return"top";if(t===e.rowCount-e.bottomFrozenRowCount&&i>=e.rowHeaderLevelCount&&i<e.colCount-e.rightFrozenColCount)return"bottom";if(i===e.rowHeaderLevelCount-1&&t>=e.rowHeaderLevelCount&&t<e.rowCount-e.bottomFrozenRowCount)return"left"}else{if(i===e.rowHeaderLevelCount-1&&t>=e.columnHeaderLevelCount&&t<e.rowCount-e.bottomFrozenRowCount)return"left";if(i===e.colCount-e.rightFrozenColCount&&t>=e.columnHeaderLevelCount&&t<e.rowCount-e.bottomFrozenRowCount)return"right";if(t===e.rowCount-e.bottomFrozenRowCount&&i>=e.rowHeaderLevelCount&&i<e.colCount-e.rightFrozenColCount)return"bottom"}return"bottom"}class a8{constructor(t){this.isDown=!1,this.isDraging=!1,this.globalEventListeners=[],this._enableTableScroll=!0,this.table=t,this.handleTextStickBindId=[],this.inertiaScroll=new J5(t.stateManager),oe.mode==="node"||t.options.disableInteraction||(this.bindOuterEvent(),setTimeout(()=>{this.bindSelfEvent()},0))}bindOuterEvent(){Q5(this),n8(this),i8(this),o8(this),t8(this)}updateEventBinder(){setTimeout(()=>{var t;this.table.isReleased||(QR(this.table)&&((t=this.handleTextStickBindId)===null||t===void 0?void 0:t.length)===0?(this.handleTextStickBindId.push(this.table.on(at.SCROLL,e=>{Ah(this.table)})),this.handleTextStickBindId.push(this.table.on(at.RESIZE_COLUMN_END,e=>{Ah(this.table)})),this.handleTextStickBindId.push(this.table.on(at.RESIZE_ROW_END,e=>{Ah(this.table)}))):!QR(this.table)&&this.handleTextStickBindId&&(this.handleTextStickBindId.forEach(e=>{this.table.off(e)}),this.handleTextStickBindId=[]),TA(this.table))},0)}bindSelfEvent(){if(this.table.isReleased)return;const t=this.table.stateManager;this.table.on(at.ICON_CLICK,e=>{var n;const{col:o,row:r,x:s,y:l,funcType:a,icon:h,event:d}=e;if(a===ve.dropDown)t.triggerDropDownMenu(o,r,s,l,d);else if(a===ve.sort)t.triggerSort(o,r,h,d);else if(a===ve.frozen)t.triggerFreeze(o,r,h);else if(a===ve.drillDown)G5(this.table);else if(a===ve.collapse||a===ve.expand){const u=!!(!((n=t.select.ranges)===null||n===void 0)&&n.length);t.updateSelectPos(-1,-1),t.endSelectCells(!0,u),this.table.toggleHierarchyState(o,r)}}),this.table.on(at.DROPDOWN_MENU_CLICK,()=>{t.hideMenu()}),this.updateEventBinder(),j5(this.table),this.table.on(at.DBLCLICK_CELL,e=>{var n;if(e.federatedEvent){const o=Ai(e.federatedEvent),r=this.table.scenegraph.getResizeColAt(o.abstractPos.x,o.abstractPos.y,(n=o.eventArgs)===null||n===void 0?void 0:n.targetCell);if(this.table.eventManager.checkCellFillhandle(o))this.table.fireListeners(at.DBLCLICK_FILL_HANDLE,{});else if(this.table._canResizeColumn(r.col,r.row)&&r.col>=0){this.table.scenegraph.updateAutoColWidth(r.col),this.table.internalProps._widthResizedColMap.add(r.col),this.table.scenegraph.updateChartSizeForResizeColWidth(r.col);const s=this.table.stateManager;s.columnResize.col<s.table.frozenColCount&&!s.table.isPivotTable()&&!s.table.transpose&&s.table.scenegraph.component.setFrozenColumnShadow(s.table.frozenColCount-1,s.columnResize.isRightFrozen);const l=[];for(let a=0;a<this.table.colCount;a++)l.push(this.table.getColWidth(a));this.table.fireListeners(at.RESIZE_COLUMN_END,{col:r.col,colWidths:l})}}}),this.table.isPivotTable()&&U5(this.table)&&$5(this.table),TA(this.table),r8(this.table),l8(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 n,o,r,s;if(!t)return this.table.stateManager.updateSelectPos(-1,-1),!1;const{eventArgs:l}=t;if(l){if(l.target.name==="checkbox"||l.target.name==="radio")return!1;const a=this.table.getBodyColumnDefine(l.col,l.row);if(this.table.isHeader(l.col,l.row)&&(a!=null&&a.disableHeaderSelect||!((n=this.table.stateManager.select)===null||n===void 0)&&n.disableHeader))return e||this.table.stateManager.updateSelectPos(-1,-1),!1;if(!this.table.isHeader(l.col,l.row)&&(a!=null&&a.disableSelect)){if(!e){const h=!!(!((o=this.table.stateManager.select.ranges)===null||o===void 0)&&o.length);this.table.stateManager.updateSelectPos(-1,-1),h&&this.table.stateManager.endSelectCells(!0,h)}return!1}return!this.table.isPivotChart()||((r=t==null?void 0:t.eventArgs)===null||r===void 0?void 0:r.target.name)!=="axis-label"&&((s=t==null?void 0:t.eventArgs)===null||s===void 0?void 0:s.target.type)!=="chart"?(this.table.stateManager.updateSelectPos(l.col,l.row,l.event.shiftKey,l.event.ctrlKey||l.event.metaKey,!1,e),!0):(this.table.stateManager.updateSelectPos(-1,-1),!1)}return!1}dealFillSelect(t,e){var n,o;const{eventArgs:r}=t;if(r){if(!((o=(n=this.table.stateManager.select)===null||n===void 0?void 0:n.ranges)===null||o===void 0)&&o.length&&this.table.stateManager.isFillHandle()){let s,l;const a=this.table.stateManager.select.ranges[this.table.stateManager.select.ranges.length-1];e&&(z(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?(s=r.row,l=a.end.col):(s=a.end.row,l=r.col)),this.table.stateManager.updateSelectPos(e?l:a.end.col,e?s:a.end.row,!0,r.event.ctrlKey||r.event.metaKey,!1,e)}else this.table.stateManager.updateSelectPos(r.col,r.row,r.event.shiftKey,r.event.ctrlKey||r.event.metaKey,!1,e);return!0}return!1}deelTableSelectAll(){this.table.stateManager.updateSelectPos(-1,-1,!1,!1,!0),this.table.fireListeners(at.SELECTED_CELL,{ranges:this.table.stateManager.select.ranges,col:0,row:0})}dealMenuSelect(t){}checkColumnResize(t,e){const{eventArgs:n}=t;if(this.table.options.enableTreeStickCell&&!n)return!1;const o=this.table.scenegraph.getResizeColAt(t.abstractPos.x,t.abstractPos.y,n==null?void 0:n.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:n}=t;if(n){const o=this.table.scenegraph.getResizeRowAt(t.abstractPos.x,t.abstractPos.y,n.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 n,o,r,s;if(!((n=this.table.options.excelOptions)===null||n===void 0)&&n.fillHandle){const{eventArgs:l}=t;if(l&&(!((r=(o=this.table.stateManager.select)===null||o===void 0?void 0:o.ranges)===null||r===void 0)&&r.length)){const a=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),h=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),d=this.table.scenegraph.highPerformanceGetCell(a,h).globalAABBBounds,u=Math.abs(t.abstractPos.x-d.x2),c=Math.abs(t.abstractPos.y-d.y2),g=18;if(!((s=this.table.stateManager.fillHandle)===null||s===void 0)&&s.isFilling||u<=g/2&&c<=g/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,n,o;const{eventArgs:r}=t;return!!(r&&this.table.isHeader(r.col,r.row)&&(t5(r.col,r.row,this.table.stateManager.select.ranges)||!((e=this.table.options.select)===null||e===void 0)&&e.disableHeaderSelect||!((n=this.table.options.select)===null||n===void 0)&&n.disableSelect)&&this.table._canDragHeaderPosition(r.col,r.row))&&(this.table.stateManager.startMoveCol(r.col,r.row,t.abstractPos.x,t.abstractPos.y,(o=r==null?void 0:r.event)===null||o===void 0?void 0:o.nativeEvent),!0)}dealColumnMover(t){var e;const{eventArgs:n}=t;z(n.col)&&z(n.row)&&this.table.stateManager.updateMoveCol(n.col,n.row,t.abstractPos.x,t.abstractPos.y,(e=n==null?void 0:n.event)===null||e===void 0?void 0:e.nativeEvent)}startColumnResize(t){}dealIconClick(t,e){const{eventArgs:n}=e,{target:o,event:r,col:s,row:l}=n||{target:t.target,event:t,col:-1,row:-1},a=o;if(a.role&&a.role.startsWith("icon-"))return this.table.fireListeners(at.ICON_CLICK,{name:a.name,x:(a.globalAABBBounds.x1+a.globalAABBBounds.x2)/2,y:a.globalAABBBounds.y2,col:s,row:l,funcType:a.attribute.funcType,icon:a,event:r}),!0;if(o instanceof oo){const h=o.pickIcon(r.global);if(h)return this.table.fireListeners(at.ICON_CLICK,{name:h.attribute.id,x:h.globalX+h.globalAABBBounds.width()/2,y:h.globalY+h.AABBBounds.height(),col:s,row:l,funcType:h.attribute.funcType,icon:h,event:r}),!0}return!1}release(){this.gesture.release(),this.globalEventListeners.forEach(t=>{t.env==="document"?document.removeEventListener(t.name,t.callback):t.env==="body"?document.body.removeEventListener(t.name,t.callback):t.env==="window"&&window.removeEventListener(t.name,t.callback)}),this.globalEventListeners=[]}enableScroll(){this._enableTableScroll=!0}disableScroll(){this._enableTableScroll=!1}}let LA;const h8=i=>{const t=i.value;return Number(t)>80?"#20a8d8":Number(t)>50?"#4dbd74":Number(t)>20?"#ffc107":"#f86c6b"};class gg extends Ar{static get DEFAULT(){return LA||(LA=new gg)}constructor(t={},e={}){var n,o,r,s,l,a,h,d,u,c,g,f,p,m,b;super(t,e),this._showBar=(n=t.showBar)===null||n===void 0||n,this._barColor=(o=t.barColor)!==null&&o!==void 0?o:h8,this._barPositiveColor=(r=t.barPositiveColor)!==null&&r!==void 0?r:"#4dbd74",this._barNegativeColor=(s=t.barNegativeColor)!==null&&s!==void 0?s:"#f86c6b",this._barAxisColor=(l=t.barAxisColor)!==null&&l!==void 0?l:"black",this._barBgColor=t.barBgColor,this._barHeight=(a=t.barHeight)!==null&&a!==void 0?a:3,this._barHeight=(h=t.barHeight)!==null&&h!==void 0?h:3,this._barBottom=(d=t.barBottom)!==null&&d!==void 0?d:0,this._barPadding=(u=t.barPadding)!==null&&u!==void 0?u:[0,0,0,0],this._showBarMark=(c=t.showBarMark)!==null&&c!==void 0&&c,this._barMarkPositiveColor=(g=t.barMarkPositiveColor)!==null&&g!==void 0?g:"#4dbd74",this._barMarkNegativeColor=(f=t.barMarkNegativeColor)!==null&&f!==void 0?f:"#f86c6b",this._barMarkWidth=(p=t.barMarkWidth)!==null&&p!==void 0?p:2,this._barMarkPosition=(m=t.barMarkPosition)!==null&&m!==void 0?m:"right",this._barRightToLeft=(b=t.barRightToLeft)!==null&&b!==void 0&&b}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 gg(this,null)}}const d8=["type","content","font","color","width","height","marginRight","marginLeft","src","svg","name","path","positionType","tooltip","hover","cursor","shape","interactive","isGif"];class u8{constructor(t){this._table=t;const e=vn();this.expandIcon=e[Wi.expandIconName],this.collapseIcon=e[Wi.collapseIconName]}getIcons(t,e,n,o,r){const s=[],l=this.getHierarchyIcon(t,e);l&&s.push(l);const{icon:a}=this._table.getBodyColumnDefine(t,e);if(a){let h;typeof a=="function"?h=a({col:t,row:e,value:n,dataValue:o,table:this._table}):h=a;const d=vn(),u=c=>{let g;g=typeof c=="string"?d[c]:c,g&&s.push(g)};Array.isArray(h)?h.forEach((c,g)=>{u(c)}):u(h)}return r&&s.forEach((h,d)=>{(h.content||h.src)&&(s[d]=this.getCellIconFromRecordValue(h,t,e))}),s}getStyleClass(t){switch(t){case"text":case"link":return eh;case"image":case"video":return Uz;case"chart":case"sparkline":return Ar;case"progressbar":return gg;case"checkbox":return tm;case"radio":return cs}return eh}getCellIconFromRecordValue(t,e,n){if(Array.isArray(t))return t.map(s=>this.getCellIconFromRecordValue(s,e,n));if(!vx.isObject(t)||typeof t=="function")return this._table.getFieldData(t,e,n);const o={},r=t;return d8.forEach(s=>{var l,a;if(r[s]!==void 0){const h=this._table.getFieldData(r[s],e,n);z(h)?o[s]=h:!((a=(l=this._table)._hasField)===null||a===void 0)&&a.call(l,r[s],e,n)||(o[s]=r[s])}}),o}getHierarchyIcon(t,e){const n=this._table.getHierarchyState(t,e);return n===Vt.expand?this.expandIcon:n===Vt.collapse?this.collapseIcon:void 0}getHierarchyIconWidth(){var t,e;return this.expandIcon.width+((t=this.expandIcon.marginLeft)!==null&&t!==void 0?t:0)+((e=this.expandIcon.marginRight)!==null&&e!==void 0?e:0)}}function xo(i,t){const e=document.createElement(i);return t&&e.classList.add(...t),e}function c8(){if(oe.mode==="node")return;const i=document.createElement("style");i.id="vtable-menu-styleSheet",i.textContent=`
|
|
134
|
+
`)&&(k=k.replace(/^"(.*)"$/,"$1").replace(/["]*/g,L=>new Array(Math.floor(L.length/2)).fill('"').join(""))),E.push(k)}),y=Math.max(y,(F=E==null?void 0:E.length)!==null&&F!==void 0?F:0)}),S=(x=M.length)!==null&&x!==void 0?x:0,M=d(M,S,y,w-C+1,_-b+1),t.changeCellValues(b,C,M,!0)})})}function d(f,p,m,b,C){if(C>m||b>p){if(C%m==0&&b%p==0){const _=[];for(let w=0;w<b;w++){const y=[];_.push(y);for(let S=0;S<C;S++){const A=w%p,R=S%m;y.push(f[A][R])}}return _}return f}return f}const u=f=>{t.eventManager.LastBodyPointerXY={x:f.x,y:f.y},t.eventManager.isDown=!0};i.globalEventListeners.push({name:"pointerdown",env:"body",callback:u}),document.body.addEventListener("pointerdown",u);const c=f=>{if(f.target!==t.canvas&&(p=>{var m,b;if(e.menu.isShow&&setTimeout(()=>{t.internalProps.menuHandler.pointInMenuElement(p.clientX,p.clientY)||e.menu.isShow&&e.hideMenu()},0),e.isResizeCol())cg(t);else if(e.isResizeRow())iv(t);else if(e.isMoveCol()){const C=t.stateManager.endMoveCol();ev(t,C,p)}else if(e.isSelecting()&&(!((b=(m=t.stateManager.select)===null||m===void 0?void 0:m.ranges)===null||b===void 0)&&b.length)){const C=t.stateManager.select.ranges[t.stateManager.select.ranges.length-1].end.col,_=t.stateManager.select.ranges[t.stateManager.select.ranges.length-1].end.row;if(t.stateManager.endSelectCells(),t.hasListeners(at.DRAG_SELECT_END)){const w={event:p,cells:[],col:C,row:_,scaleRatio:t.canvas.getBoundingClientRect().width/t.canvas.offsetWidth,target:void 0};w.cells=t.getSelectedCellInfos(),t.fireListeners(at.DRAG_SELECT_END,w)}}})(f),t.eventManager.LastBodyPointerXY=null,t.eventManager.isDown=!1,t.eventManager.isDraging=!1,t.eventManager.inertiaScroll.endInertia(),e.interactionState==="grabing"&&e.isResizeCol())cg(t);else if(e.interactionState==="grabing"&&e.isResizeRow())iv(t);else if(e.isMoveCol()){const p=t.stateManager.endMoveCol();ev(t,p,f)}};i.globalEventListeners.push({name:"pointerup",env:"document",callback:c}),document.addEventListener("pointerup",c);const g=f=>{var p,m,b,C,_;if(t.eventManager.isDown&&t.eventManager.LastBodyPointerXY){const A=(m=(p=t.eventManager.LastBodyPointerXY)===null||p===void 0?void 0:p.x)!==null&&m!==void 0?m:f.x,R=(C=(b=t.eventManager.LastBodyPointerXY)===null||b===void 0?void 0:b.y)!==null&&C!==void 0?C:f.y;(Math.abs(A-f.x)>1||Math.abs(R-f.y)>1)&&(t.eventManager.isDraging=!0)}const{x:w,y}=t._getMouseAbstractPoint(f,!1);e.interactionState===$t.grabing&&(e.isResizeCol()?(i.dealColumnResize(w,y),t.hasListeners(at.RESIZE_COLUMN)&&t.fireListeners(at.RESIZE_COLUMN,{col:t.stateManager.columnResize.col,colWidth:t.getColWidth(t.stateManager.columnResize.col)})):e.isResizeRow()&&(i.dealRowResize(w,y),t.hasListeners(at.RESIZE_ROW)&&t.fireListeners(at.RESIZE_ROW,{row:t.stateManager.rowResize.row,rowHeight:t.getRowHeight(t.stateManager.rowResize.row)})));const S=t.stateManager.isSelecting();if(i._enableTableScroll&&i.isDraging&&S&&((_=t.stateManager.select.ranges)===null||_===void 0?void 0:_.length)>0){const A=t.getDrawRange(),R=t.getFrozenRowsHeight(),x=t.getBottomFrozenRowsHeight(),T=t.getFrozenColsWidth(),M=t.getRightFrozenColsWidth(),B=t.stateManager.select.ranges[t.stateManager.select.ranges.length-1].start;if(t.isSeriesNumber(B.col,B.row))return;const P=t.stateManager.select.ranges[t.stateManager.select.ranges.length-1].end,F=(t.isFrozenRow(B.row)===!1||t.isFrozenRow(P.row)===!1)&&t.getAllRowsHeight()>t.tableNoFrameHeight,H=(t.isFrozenColumn(B.col)===!1||t.isFrozenColumn(P.col)===!1)&&t.getAllColsWidth()>t.tableNoFrameWidth;if((y>A.bottom-x||y<A.top+R)&&F||(w>A.right-M||w<A.left+T)&&H){t.eventManager.scrollXSpeed=0,t.eventManager.scrollYSpeed=0;let E=!1,k=!1,I=!1,L=!1;y>A.bottom-x&&F&&t.scrollTop+t.tableNoFrameHeight<t.getAllRowsHeight()?(E=!0,t.eventManager.scrollYSpeed=-(y-A.bottom+x)/50):y<A.top+R&&F&&t.scrollTop>0&&(k=!0,t.eventManager.scrollYSpeed=-(y-A.top-R)/50),w>A.right-M&&H&&t.scrollLeft+t.tableNoFrameWidth<t.getAllColsWidth()?(I=!0,t.eventManager.scrollXSpeed=-(w-A.right+M)/50):w<A.left+T&&H&&t.scrollLeft>0&&(L=!0,t.eventManager.scrollXSpeed=-(w-A.left-T)/50),t.eventManager.inertiaScroll.startInertia(t.eventManager.scrollXSpeed,t.eventManager.scrollYSpeed,1),t.eventManager.inertiaScroll.setScrollHandle((D,O)=>{let N,W;ug({deltaX:-D,deltaY:-O},t.stateManager,!1),E?W=t.scrollTop+A.height-x-20:k&&(W=t.scrollTop+R+20),I?N=t.scrollLeft+A.width-M-20:L&&(N=t.scrollLeft+T+20);let $=!1,U=!1;I||L||(w>t.tableNoFrameWidth-t.getRightFrozenColsWidth()&&w<t.tableNoFrameWidth||w>0&&w<t.getFrozenColsWidth()?(N=w,U=!0):N=t.scrollLeft+w),E||k||(y>t.tableNoFrameHeight-t.getBottomFrozenRowsHeight()&&y<t.tableNoFrameHeight||y>0&&y<t.getFrozenRowsHeight()?(W=y,$=!0):W=t.scrollTop+y),t.stateManager.updateInteractionState($t.grabing);const Y=t.getTargetColAtConsiderRightFrozen(N,U),j=t.getTargetRowAtConsiderBottomFrozen(W,$);z(Y)&&z(j)&&t.stateManager.updateSelectPos(Y.col,j.row,!1,!1,!1,!0)})}else t.eventManager.inertiaScroll.isInertiaScrolling()?t.eventManager.inertiaScroll.endInertia():t.eventManager.scrollYSpeed=0}};i.globalEventListeners.push({name:"pointermove",env:"body",callback:g}),document.body.addEventListener("pointermove",g)}function o8(i){const t=i.table,e=t.stateManager,n=t.scenegraph;i.touchMovePoints=[],t.scenegraph.tableGroup.addEventListener("touchstart",l=>{l.target.isChildOf(n.component.vScrollBar)||l.target.isChildOf(n.component.vScrollBar)||(i.isTouchdown=!0,i.touchMovePoints.push({x:l.page.x,y:l.page.y,timestamp:Date.now()}))});const o=l=>{var a,h;if(i.touchMove&&l.preventDefault(),i.isTouchdown&&HA(l)){if(((h=(a=i.downIcon)===null||a===void 0?void 0:a.attribute)===null||h===void 0?void 0:h.funcType)===ve.dragReorder)l.preventDefault();else if(i.touchMovePoints.length>4&&i.touchMovePoints.shift(),i.touchMovePoints.push({x:l.changedTouches[0].pageX,y:l.changedTouches[0].pageY,timestamp:Date.now()}),i._enableTableScroll){const d=-i.touchMovePoints[i.touchMovePoints.length-1].x+i.touchMovePoints[i.touchMovePoints.length-2].x,u=-i.touchMovePoints[i.touchMovePoints.length-1].y+i.touchMovePoints[i.touchMovePoints.length-2].y;ug({deltaX:d,deltaY:u},e),l.cancelable&&(t.internalProps.overscrollBehavior==="none"||Math.abs(u)>=Math.abs(d)&&u!==0&&MA(u,e)||Math.abs(u)<=Math.abs(d)&&d!==0&&BA(d,e))&&l.preventDefault()}}};window.addEventListener("touchmove",o,{passive:!1}),i.globalEventListeners.push({name:"touchmove",env:"window",callback:o});const r=l=>{var a,h,d,u;if(i.touchEnd=!0,i.touchMove=!1,i.isTouchdown&&HA(l)){if(((h=(a=i.downIcon)===null||a===void 0?void 0:a.attribute)===null||h===void 0?void 0:h.funcType)===ve.dragReorder)l.preventDefault();else if(!((d=i.touchMovePoints)===null||d===void 0)&&d.length&&(i.touchMovePoints.length>4&&i.touchMovePoints.shift(),i.touchMovePoints.push({x:l.changedTouches[0].pageX,y:l.changedTouches[0].pageY,timestamp:Date.now()}),i._enableTableScroll)){const c=i.touchMovePoints[0],g=i.touchMovePoints[((u=i.touchMovePoints)===null||u===void 0?void 0:u.length)-1],f=(g.x-c.x)/(g.timestamp-c.timestamp),p=(g.y-c.y)/(g.timestamp-c.timestamp);i.inertiaScroll.startInertia(f,p,.95),t.eventManager.inertiaScroll.setScrollHandle((m,b)=>{ug({deltaX:-m,deltaY:-b},t.stateManager)})}i.isTouchdown=!1,i.touchMovePoints=[]}};window.addEventListener("touchend",r),i.globalEventListeners.push({name:"touchend",env:"window",callback:r});const s=l=>{i.touchEnd=!0,i.touchMove=!1,i.isTouchdown&&(i.isTouchdown=!1,i.touchMovePoints=[])};window.addEventListener("touchcancel",s),i.globalEventListeners.push({name:"touchcancel",env:"window",callback:s})}function HA(i){return!!i.changedTouches}function r8(i){i.isPivotChart()&&i.scenegraph.tableGroup.addEventListener("click",t=>{var e;if(!i.stateManager.columnMove.moving&&!i.stateManager.columnResize.resizing)if(t.target.name==="axis-label"){const n=Ai(t),{col:o,row:r}=n.eventArgs,s=i.internalProps.layoutMap;let l,a;s.indicatorsAsCol?(l=s.getDimensionKeyInChartSpec(s.rowHeaderLevelCount,r),a=s.getCellHeaderPaths(s.rowHeaderLevelCount-2,r).rowHeaderPaths):(l=s.getDimensionKeyInChartSpec(o,s.columnHeaderLevelCount),a=s.getCellHeaderPaths(o,s.columnHeaderLevelCount-1).colHeaderPaths);const h=a.map(d=>({key:d.dimensionKey,value:d.value})).filter(d=>d.key);if(h.push({key:l,value:t.target.attribute.text}),i._selectedDimensionInChart.length&&s8(i._selectedDimensionInChart,h))return;i._selectedDimensionInChart=h,s.updateDataStateToChartInstance(),Th(i.scenegraph),i.scenegraph.updateNextFrame()}else!((e=i._selectedDimensionInChart)===null||e===void 0)&&e.length&&(i._selectedDimensionInChart.length=0,i.internalProps.layoutMap.updateDataStateToChartInstance(),Th(i.scenegraph),i.scenegraph.updateNextFrame())})}function s8(i,t){if(i.length!==t.length)return!1;for(let e=0;e<i.length;e++)if(i[e].key!==t[e].key||i[e].value!==t[e].value)return!1;return!0}function l8(i){i.isPivotChart()&&(i.on(at.MOUSEENTER_CELL,t=>{i.scenegraph.getCell(t.col,t.row).forEachChildren(e=>{if(e.name==="axis"){const n=EA(t.col,t.row,i.internalProps.layoutMap);t.axisPosition=n,i.fireListeners(at.MOUSEENTER_AXIS,t)}})}),i.on(at.MOUSELEAVE_CELL,t=>{i.scenegraph.getCell(t.col,t.row).forEachChildren(e=>{if(e.name==="axis"){const n=EA(t.col,t.row,i.internalProps.layoutMap);t.axisPosition=n,i.fireListeners(at.MOUSELEAVE_AXIS,t)}})}))}function EA(i,t,e){if(e.indicatorsAsCol){if(e.hasTwoIndicatorAxes&&t===e.columnHeaderLevelCount-1&&i>=e.rowHeaderLevelCount&&i<e.colCount-e.rightFrozenColCount)return"top";if(t===e.rowCount-e.bottomFrozenRowCount&&i>=e.rowHeaderLevelCount&&i<e.colCount-e.rightFrozenColCount)return"bottom";if(i===e.rowHeaderLevelCount-1&&t>=e.rowHeaderLevelCount&&t<e.rowCount-e.bottomFrozenRowCount)return"left"}else{if(i===e.rowHeaderLevelCount-1&&t>=e.columnHeaderLevelCount&&t<e.rowCount-e.bottomFrozenRowCount)return"left";if(i===e.colCount-e.rightFrozenColCount&&t>=e.columnHeaderLevelCount&&t<e.rowCount-e.bottomFrozenRowCount)return"right";if(t===e.rowCount-e.bottomFrozenRowCount&&i>=e.rowHeaderLevelCount&&i<e.colCount-e.rightFrozenColCount)return"bottom"}return"bottom"}class a8{constructor(t){this.isDown=!1,this.isDraging=!1,this.globalEventListeners=[],this._enableTableScroll=!0,this.table=t,this.handleTextStickBindId=[],this.inertiaScroll=new JN(t.stateManager),oe.mode==="node"||t.options.disableInteraction||(this.bindOuterEvent(),setTimeout(()=>{this.bindSelfEvent()},0))}bindOuterEvent(){QN(this),n8(this),i8(this),o8(this),t8(this)}updateEventBinder(){setTimeout(()=>{var t;this.table.isReleased||(QR(this.table)&&((t=this.handleTextStickBindId)===null||t===void 0?void 0:t.length)===0?(this.handleTextStickBindId.push(this.table.on(at.SCROLL,e=>{Ah(this.table)})),this.handleTextStickBindId.push(this.table.on(at.RESIZE_COLUMN_END,e=>{Ah(this.table)})),this.handleTextStickBindId.push(this.table.on(at.RESIZE_ROW_END,e=>{Ah(this.table)}))):!QR(this.table)&&this.handleTextStickBindId&&(this.handleTextStickBindId.forEach(e=>{this.table.off(e)}),this.handleTextStickBindId=[]),TA(this.table))},0)}bindSelfEvent(){if(this.table.isReleased)return;const t=this.table.stateManager;this.table.on(at.ICON_CLICK,e=>{var n;const{col:o,row:r,x:s,y:l,funcType:a,icon:h,event:d}=e;if(a===ve.dropDown)t.triggerDropDownMenu(o,r,s,l,d);else if(a===ve.sort)t.triggerSort(o,r,h,d);else if(a===ve.frozen)t.triggerFreeze(o,r,h);else if(a===ve.drillDown)GN(this.table);else if(a===ve.collapse||a===ve.expand){const u=!!(!((n=t.select.ranges)===null||n===void 0)&&n.length);t.updateSelectPos(-1,-1),t.endSelectCells(!0,u),this.table.toggleHierarchyState(o,r)}}),this.table.on(at.DROPDOWN_MENU_CLICK,()=>{t.hideMenu()}),this.updateEventBinder(),jN(this.table),this.table.on(at.DBLCLICK_CELL,e=>{var n;if(e.federatedEvent){const o=Ai(e.federatedEvent),r=this.table.scenegraph.getResizeColAt(o.abstractPos.x,o.abstractPos.y,(n=o.eventArgs)===null||n===void 0?void 0:n.targetCell);if(this.table.eventManager.checkCellFillhandle(o))this.table.fireListeners(at.DBLCLICK_FILL_HANDLE,{});else if(this.table._canResizeColumn(r.col,r.row)&&r.col>=0){this.table.scenegraph.updateAutoColWidth(r.col),this.table.internalProps._widthResizedColMap.add(r.col),this.table.scenegraph.updateChartSizeForResizeColWidth(r.col);const s=this.table.stateManager;s.columnResize.col<s.table.frozenColCount&&!s.table.isPivotTable()&&!s.table.transpose&&s.table.scenegraph.component.setFrozenColumnShadow(s.table.frozenColCount-1,s.columnResize.isRightFrozen);const l=[];for(let a=0;a<this.table.colCount;a++)l.push(this.table.getColWidth(a));this.table.fireListeners(at.RESIZE_COLUMN_END,{col:r.col,colWidths:l})}}}),this.table.isPivotTable()&&UN(this.table)&&$N(this.table),TA(this.table),r8(this.table),l8(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 n,o,r,s;if(!t)return this.table.stateManager.updateSelectPos(-1,-1),!1;const{eventArgs:l}=t;if(l){if(l.target.name==="checkbox"||l.target.name==="radio")return!1;const a=this.table.getBodyColumnDefine(l.col,l.row);if(this.table.isHeader(l.col,l.row)&&(a!=null&&a.disableHeaderSelect||!((n=this.table.stateManager.select)===null||n===void 0)&&n.disableHeader))return e||this.table.stateManager.updateSelectPos(-1,-1),!1;if(!this.table.isHeader(l.col,l.row)&&(a!=null&&a.disableSelect)){if(!e){const h=!!(!((o=this.table.stateManager.select.ranges)===null||o===void 0)&&o.length);this.table.stateManager.updateSelectPos(-1,-1),h&&this.table.stateManager.endSelectCells(!0,h)}return!1}return!this.table.isPivotChart()||((r=t==null?void 0:t.eventArgs)===null||r===void 0?void 0:r.target.name)!=="axis-label"&&((s=t==null?void 0:t.eventArgs)===null||s===void 0?void 0:s.target.type)!=="chart"?(this.table.stateManager.updateSelectPos(l.col,l.row,l.event.shiftKey,l.event.ctrlKey||l.event.metaKey,!1,e),!0):(this.table.stateManager.updateSelectPos(-1,-1),!1)}return!1}dealFillSelect(t,e){var n,o;const{eventArgs:r}=t;if(r){if(!((o=(n=this.table.stateManager.select)===null||n===void 0?void 0:n.ranges)===null||o===void 0)&&o.length&&this.table.stateManager.isFillHandle()){let s,l;const a=this.table.stateManager.select.ranges[this.table.stateManager.select.ranges.length-1];e&&(z(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?(s=r.row,l=a.end.col):(s=a.end.row,l=r.col)),this.table.stateManager.updateSelectPos(e?l:a.end.col,e?s:a.end.row,!0,r.event.ctrlKey||r.event.metaKey,!1,e)}else this.table.stateManager.updateSelectPos(r.col,r.row,r.event.shiftKey,r.event.ctrlKey||r.event.metaKey,!1,e);return!0}return!1}deelTableSelectAll(){this.table.stateManager.updateSelectPos(-1,-1,!1,!1,!0),this.table.fireListeners(at.SELECTED_CELL,{ranges:this.table.stateManager.select.ranges,col:0,row:0})}dealMenuSelect(t){}checkColumnResize(t,e){const{eventArgs:n}=t;if(this.table.options.enableTreeStickCell&&!n)return!1;const o=this.table.scenegraph.getResizeColAt(t.abstractPos.x,t.abstractPos.y,n==null?void 0:n.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:n}=t;if(n){const o=this.table.scenegraph.getResizeRowAt(t.abstractPos.x,t.abstractPos.y,n.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 n,o,r,s;if(!((n=this.table.options.excelOptions)===null||n===void 0)&&n.fillHandle){const{eventArgs:l}=t;if(l&&(!((r=(o=this.table.stateManager.select)===null||o===void 0?void 0:o.ranges)===null||r===void 0)&&r.length)){const a=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),h=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),d=this.table.scenegraph.highPerformanceGetCell(a,h).globalAABBBounds,u=Math.abs(t.abstractPos.x-d.x2),c=Math.abs(t.abstractPos.y-d.y2),g=18;if(!((s=this.table.stateManager.fillHandle)===null||s===void 0)&&s.isFilling||u<=g/2&&c<=g/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,n,o;const{eventArgs:r}=t;return!!(r&&this.table.isHeader(r.col,r.row)&&(tN(r.col,r.row,this.table.stateManager.select.ranges)||!((e=this.table.options.select)===null||e===void 0)&&e.disableHeaderSelect||!((n=this.table.options.select)===null||n===void 0)&&n.disableSelect)&&this.table._canDragHeaderPosition(r.col,r.row))&&(this.table.stateManager.startMoveCol(r.col,r.row,t.abstractPos.x,t.abstractPos.y,(o=r==null?void 0:r.event)===null||o===void 0?void 0:o.nativeEvent),!0)}dealColumnMover(t){var e;const{eventArgs:n}=t;z(n.col)&&z(n.row)&&this.table.stateManager.updateMoveCol(n.col,n.row,t.abstractPos.x,t.abstractPos.y,(e=n==null?void 0:n.event)===null||e===void 0?void 0:e.nativeEvent)}startColumnResize(t){}dealIconClick(t,e){const{eventArgs:n}=e,{target:o,event:r,col:s,row:l}=n||{target:t.target,event:t,col:-1,row:-1},a=o;if(a.role&&a.role.startsWith("icon-"))return this.table.fireListeners(at.ICON_CLICK,{name:a.name,x:(a.globalAABBBounds.x1+a.globalAABBBounds.x2)/2,y:a.globalAABBBounds.y2,col:s,row:l,funcType:a.attribute.funcType,icon:a,event:r}),!0;if(o instanceof oo){const h=o.pickIcon(r.global);if(h)return this.table.fireListeners(at.ICON_CLICK,{name:h.attribute.id,x:h.globalX+h.globalAABBBounds.width()/2,y:h.globalY+h.AABBBounds.height(),col:s,row:l,funcType:h.attribute.funcType,icon:h,event:r}),!0}return!1}release(){this.gesture.release(),this.globalEventListeners.forEach(t=>{t.env==="document"?document.removeEventListener(t.name,t.callback):t.env==="body"?document.body.removeEventListener(t.name,t.callback):t.env==="window"&&window.removeEventListener(t.name,t.callback)}),this.globalEventListeners=[]}enableScroll(){this._enableTableScroll=!0}disableScroll(){this._enableTableScroll=!1}}let LA;const h8=i=>{const t=i.value;return Number(t)>80?"#20a8d8":Number(t)>50?"#4dbd74":Number(t)>20?"#ffc107":"#f86c6b"};class gg extends Ar{static get DEFAULT(){return LA||(LA=new gg)}constructor(t={},e={}){var n,o,r,s,l,a,h,d,u,c,g,f,p,m,b;super(t,e),this._showBar=(n=t.showBar)===null||n===void 0||n,this._barColor=(o=t.barColor)!==null&&o!==void 0?o:h8,this._barPositiveColor=(r=t.barPositiveColor)!==null&&r!==void 0?r:"#4dbd74",this._barNegativeColor=(s=t.barNegativeColor)!==null&&s!==void 0?s:"#f86c6b",this._barAxisColor=(l=t.barAxisColor)!==null&&l!==void 0?l:"black",this._barBgColor=t.barBgColor,this._barHeight=(a=t.barHeight)!==null&&a!==void 0?a:3,this._barHeight=(h=t.barHeight)!==null&&h!==void 0?h:3,this._barBottom=(d=t.barBottom)!==null&&d!==void 0?d:0,this._barPadding=(u=t.barPadding)!==null&&u!==void 0?u:[0,0,0,0],this._showBarMark=(c=t.showBarMark)!==null&&c!==void 0&&c,this._barMarkPositiveColor=(g=t.barMarkPositiveColor)!==null&&g!==void 0?g:"#4dbd74",this._barMarkNegativeColor=(f=t.barMarkNegativeColor)!==null&&f!==void 0?f:"#f86c6b",this._barMarkWidth=(p=t.barMarkWidth)!==null&&p!==void 0?p:2,this._barMarkPosition=(m=t.barMarkPosition)!==null&&m!==void 0?m:"right",this._barRightToLeft=(b=t.barRightToLeft)!==null&&b!==void 0&&b}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 gg(this,null)}}const d8=["type","content","font","color","width","height","marginRight","marginLeft","src","svg","name","path","positionType","tooltip","hover","cursor","shape","interactive","isGif"];class u8{constructor(t){this._table=t;const e=vn();this.expandIcon=e[Wi.expandIconName],this.collapseIcon=e[Wi.collapseIconName]}getIcons(t,e,n,o,r){const s=[],l=this.getHierarchyIcon(t,e);l&&s.push(l);const{icon:a}=this._table.getBodyColumnDefine(t,e);if(a){let h;typeof a=="function"?h=a({col:t,row:e,value:n,dataValue:o,table:this._table}):h=a;const d=vn(),u=c=>{let g;g=typeof c=="string"?d[c]:c,g&&s.push(g)};Array.isArray(h)?h.forEach((c,g)=>{u(c)}):u(h)}return r&&s.forEach((h,d)=>{(h.content||h.src)&&(s[d]=this.getCellIconFromRecordValue(h,t,e))}),s}getStyleClass(t){switch(t){case"text":case"link":return eh;case"image":case"video":return Uz;case"chart":case"sparkline":return Ar;case"progressbar":return gg;case"checkbox":return tm;case"radio":return cs}return eh}getCellIconFromRecordValue(t,e,n){if(Array.isArray(t))return t.map(s=>this.getCellIconFromRecordValue(s,e,n));if(!vx.isObject(t)||typeof t=="function")return this._table.getFieldData(t,e,n);const o={},r=t;return d8.forEach(s=>{var l,a;if(r[s]!==void 0){const h=this._table.getFieldData(r[s],e,n);z(h)?o[s]=h:!((a=(l=this._table)._hasField)===null||a===void 0)&&a.call(l,r[s],e,n)||(o[s]=r[s])}}),o}getHierarchyIcon(t,e){const n=this._table.getHierarchyState(t,e);return n===Vt.expand?this.expandIcon:n===Vt.collapse?this.collapseIcon:void 0}getHierarchyIconWidth(){var t,e;return this.expandIcon.width+((t=this.expandIcon.marginLeft)!==null&&t!==void 0?t:0)+((e=this.expandIcon.marginRight)!==null&&e!==void 0?e:0)}}function xo(i,t){const e=document.createElement(i);return t&&e.classList.add(...t),e}function c8(){if(oe.mode==="node")return;const i=document.createElement("style");i.id="vtable-menu-styleSheet",i.textContent=`
|
|
135
135
|
@keyframes vtable__menu-element--shown-animation {
|
|
136
136
|
0% {
|
|
137
137
|
opacity: 0;
|
|
@@ -220,8 +220,8 @@
|
|
|
220
220
|
.vtable__menu-element__item-text {
|
|
221
221
|
margin-right: 15px;
|
|
222
222
|
}
|
|
223
|
-
`,document.head.appendChild(i)}c8();const yn="vtable__menu-element",g8=`${yn}__item`,nv=`${yn}__content`,on=`${yn}--hidden`,sr=`${yn}--shown`,f8=`${yn}--normal`,p8=`${yn}--select`,m8=`${yn}__icon`,v8=`${yn}__split`,b8=`${yn}__title`,C8=`${yn}__arrow`,Bh=`${yn}__no-event`,kA=`${yn}__item-text`;function FA(){return xo("div",[yn,on])}function Ph(i,t,e,n,o,r){const s=i.getCellRange(n,o);for(let l=0;l<t.length;l++){const a=t[l];let{col:h,row:d}=a;const{field:u,menuKey:c}=a;if(typeof h!="number"||typeof d!="number")if(i.isPivotTable()){const g=i.internalProps.layoutMap.getPivotCellAdress(u);if(!g)continue;h=g.col,d=g.row}else{const g=i.internalProps.layoutMap.getHeaderCellAddressByField(u);if(!g)continue;h=g.col,d=g.row}if(z(h)&&z(d)&&Yi(s,h,d)&&e===c)return!0}return!1}class y8{constructor(t){var e,n,o,r,s,l,a,h,d,u;this._handler=new mc,this._rootElement=FA(),this._secondElement=FA(),this._secondElement.sub=!0,this._showChildrenIndex=-1,this._rootElement.addEventListener("wheel",c=>{c.stopPropagation()}),(e=this._rootElement)===null||e===void 0||e.addEventListener("mousedown",c=>{c.stopPropagation(),c.preventDefault()}),(n=this._rootElement)===null||n===void 0||n.addEventListener("touchend",c=>{if(c.stopPropagation(),c.preventDefault(),this._rootElement.classList.contains(on))return;const{col:g,row:f,dropDownIndex:p,menuKey:m,text:b,hasChildren:C}=c.target;if(typeof p!="number"||C)return void c.stopPropagation();const _=t.isPivotTable()?t.internalProps.layoutMap.getPivotDimensionInfo(g,f):t.getHeaderField(g,f),w=t._dropDownMenuIsHighlight(g,f,p);t.fireListeners(at.DROPDOWN_MENU_CLICK,{col:g,row:f,field:_,menuKey:m,text:b,highlight:w,cellLocation:t.getCellLocation(g,f),event:c}),t.fireListeners(at.DROPDOWN_MENU_CLEAR,null),t.fireListeners(at.HIDE_MENU,null),c.stopPropagation()}),(o=this._rootElement)===null||o===void 0||o.addEventListener("click",c=>{if(c.stopPropagation(),c.preventDefault(),this._rootElement.classList.contains(on))return;const{col:g,row:f,dropDownIndex:p,menuKey:m,text:b,hasChildren:C}=c.target;if(typeof p!="number"||C)return void c.stopPropagation();const _=t.isPivotTable()?t.internalProps.layoutMap.getPivotDimensionInfo(g,f):t.getHeaderField(g,f),w=t._dropDownMenuIsHighlight(g,f,p);t.fireListeners(at.DROPDOWN_MENU_CLICK,{col:g,row:f,field:_,menuKey:m,text:b,highlight:w,cellLocation:t.getCellLocation(g,f),event:c}),t.fireListeners(at.DROPDOWN_MENU_CLEAR,null),t.fireListeners(at.HIDE_MENU,null),c.stopPropagation()}),(r=this._rootElement)===null||r===void 0||r.addEventListener("mousemove",c=>{var g,f;if(this._rootElement.classList.contains(on))return;c.stopPropagation();const{hasChildren:p,dropDownIndex:m,col:b,row:C,sub:_}=c.target;if(p){this._showChildrenIndex=m;const w=this._secondElement;w==null||w.classList.remove(on),w==null||w.classList.add(sr),w.innerHTML="";const y=(g=this._menuInstanceInfo.content[m])===null||g===void 0?void 0:g.children;for(let A=0;A<y.length;A++){const R=y[A],x=IA(R,!!t.stateManager.menu.dropDownMenuHighlight&&Ph(t,t.stateManager.menu.dropDownMenuHighlight,typeof R=="object"?(R==null?void 0:R.menuKey)||(R==null?void 0:R.text):R,b,C));x.col=b,x.row=C,x.dropDownIndex=A,typeof R=="string"?(x.text=R,x.menuKey=R):typeof R=="object"&&(x.text=R.text,x.menuKey=R.menuKey||R.text),x.sub=!0,x.sub=!0,w.appendChild(x)}const S=c.target.getBoundingClientRect();this._bindSecondElement(t,b,C,S.right,S.top)}else if(p&&this._showChildrenIndex===m){const w=this._secondElement;w==null||w.classList.remove(on),w==null||w.classList.add(sr)}else!_&&(!((f=this._secondElement)===null||f===void 0)&&f.classList.contains(sr))&&setTimeout(()=>{if(this._mouseEnterSecondElement!==!0){this._showChildrenIndex=-1;const w=this._secondElement;w==null||w.classList.remove(sr),w==null||w.classList.add(on)}},300)}),(s=this._secondElement)===null||s===void 0||s.addEventListener("wheel",c=>{c.stopPropagation()}),(l=this._secondElement)===null||l===void 0||l.addEventListener("mousemove",c=>{this._rootElement.classList.contains(on)||c.stopPropagation()}),(a=this._secondElement)===null||a===void 0||a.addEventListener("mouseenter",c=>{this._mouseEnterSecondElement=!0}),(h=this._secondElement)===null||h===void 0||h.addEventListener("mouseleave",c=>{this._mouseEnterSecondElement=!1}),(d=this._secondElement)===null||d===void 0||d.addEventListener("mousedown",c=>{c.stopPropagation(),c.preventDefault()}),(u=this._secondElement)===null||u===void 0||u.addEventListener("click",c=>{if(c.stopPropagation(),c.preventDefault(),this._secondElement.classList.contains(on))return;const{col:g,row:f,dropDownIndex:p,menuKey:m,text:b,hasChildren:C}=c.target;if(typeof p!="number"||C)return void c.stopPropagation();const _=t.isPivotTable()?t.internalProps.layoutMap.getPivotDimensionInfo(g,f):t.getHeaderField(g,f);let w=!1;this._menuInstanceInfo.content.forEach((y,S)=>{if(typeof y=="object"&&y.children&&y.children.length)for(let A=0;A<y.children.length;A++){const R=y.children[A];if(Ph(t,t.stateManager.menu.dropDownMenuHighlight,typeof R=="object"?R==null?void 0:R.menuKey:R,g,f)&&m===(typeof R=="object"?R==null?void 0:R.menuKey:R))return void(w=!0)}}),t.fireListeners(at.DROPDOWN_MENU_CLICK,{col:g,row:f,field:_,cellHeaderPaths:t.isPivotTable()?t.getCellHeaderPaths(g,f):void 0,menuKey:m,text:b,highlight:w,cellLocation:t.getCellLocation(g,f),event:c}),t.fireListeners(at.DROPDOWN_MENU_CLEAR,null),t.fireListeners(at.HIDE_MENU,null),c.stopPropagation()})}get rootElement(){return this._rootElement}release(){this.unbindFromCell();const t=this._rootElement;t!=null&&t.parentElement&&t.parentElement.removeChild(t),this._handler.release(),delete this._rootElement}bindToCell(t,e,n,o){var r,s;const l=this._rootElement,a=this._secondElement;if(this._menuInstanceInfo=o,l==null||l.classList.remove(sr),l==null||l.classList.add(on),a==null||a.classList.remove(sr),a==null||a.classList.add(on),this._canBindToCell(t,e,n)){if(l.innerHTML="",Array.isArray(o.content)){const h=o.content;for(let d=0;(r=d<(h==null?void 0:h.length))!==null&&r!==void 0&&r;d++){const u=h[d];let c=!!t.stateManager.menu.dropDownMenuHighlight&&Ph(t,t.stateManager.menu.dropDownMenuHighlight,typeof u=="object"?(u==null?void 0:u.menuKey)||(u==null?void 0:u.text):u,e,n);if(t.stateManager.menu.dropDownMenuHighlight&&typeof u=="object"&&Array.isArray(u.children)&&u.children.length)for(let f=0;f<u.children.length;f++){const p=u.children[f];if(Ph(t,t.stateManager.menu.dropDownMenuHighlight,typeof p=="object"?(p==null?void 0:p.menuKey)||(p==null?void 0:p.text):p,e,n)){c=!0;break}}const g=IA(u,c);g.col=e,g.row=n,g.dropDownIndex=d,typeof u=="string"?(g.text=u,g.menuKey=u):typeof u=="object"&&(g.text=u.text,g.menuKey=u.menuKey||u.text,!((s=u.children)===null||s===void 0)&&s.length&&(g.hasChildren=!0)),l.appendChild(g)}}if(this._bindToCell(t,e,n,o.position,o.referencePosition))return l==null||l.classList.add(sr),l==null||l.classList.remove(on),!0}else this.unbindFromCell();return!1}unbindFromCell(){const t=this._rootElement,e=this._secondElement;this._menuInstanceInfo=void 0,t!=null&&t.parentElement&&(t.classList.remove(sr),t.classList.add(on)),e!=null&&e.parentElement&&(e.classList.remove(sr),e.classList.add(on))}_canBindToCell(t,e,n){const o=t.getCellRangeRelativeRect({col:e,row:n}),r=t.getElement(),{top:s,bottom:l,left:a,right:h}=o;if(t.isFrozenCell(e,n))return!0;if(l<t.getFrozenRowsHeight()||h<t.getFrozenColsWidth()||a>t.tableNoFrameWidth-t.getRightFrozenColsWidth()||s>t.tableNoFrameHeight-t.getBottomFrozenRowsHeight())return!1;const{offsetHeight:d,offsetWidth:u}=r;return!(d<s)&&!(u<a)}_bindToCell(t,e,n,o,r){const s=this._rootElement,l=t.getElement(),{width:a,height:h}=t.internalProps.element.getBoundingClientRect();if(s){s.parentElement!==l&&l.appendChild(s),s.style.left="0px";const d=.8*a;s.style.maxWidth=`${d}px`;const u=s.offsetWidth,c=s.offsetHeight;let g,f;o?(g=o.x,f=o.y):r&&(g=r.rect.right-u,f=r.rect.bottom);const p=l.getBoundingClientRect(),m=p.width/l.offsetWidth,b=p.height/l.offsetHeight;return f*b+c>h&&(f=(h-c)/b),f<0&&(f/=2),s.style.top=`${f}px`,g<0?g=0:g*m+u>a&&(g=(a-u)/m),s.style.left=`${g}px`,!0}return!1}_bindSecondElement(t,e,n,o,r){const s=this._secondElement,l=this._rootElement,a=t.getElement(),{width:h,left:d,top:u}=t.internalProps.element.getBoundingClientRect(),{x:c,y:g,width:f}=l.getBoundingClientRect();if(s){s.parentElement!==a&&a.appendChild(s),s.style.left="0px";const p=.8*h;s.style.maxWidth=`${p}px`;const m=s.clientWidth,b=r-4-u,C=o-d;s.style.top=`${b}px`;let _=C;return _+m>h?_=_-m-f:_+=4,s.style.left=`${_}px`,!0}return!1}pointInMenuElement(t,e){const n=this._rootElement,{x:o,y:r,width:s,height:l}=n.getBoundingClientRect();if(t>o-5&&t<o+s+5&&e>r-5&&e<r+l+5)return!0;if(this._secondElement){const{x:a,y:h,width:d,height:u}=n.getBoundingClientRect();if(t>a-5&&t<a+d+5&&e>h-5&&e<h+u+5)return!0}return!1}}function IA(i,t){var e,n,o;const r=xo("div",[g8,t?p8:f8]);if(typeof i=="string"){const s=xo("span",[nv,Bh,kA]);s.innerHTML=i,r.appendChild(s)}else if(typeof i=="object"){const s=(e=i.type)!==null&&e!==void 0?e:"item";if(s==="split")return r==null||r.classList.add(v8),r;if(!((n=i==null?void 0:i.icon)===null||n===void 0)&&n.svg)if(um.test(i.icon.svg)){const a=new Image;i.icon.width?a.style.width=i.icon.width.toString()+"px":a.style.width="16px",i.icon.height?a.style.height=i.icon.height.toString()+"px":a.style.height="16px",a.src=i.icon.svg,r.appendChild(a)}else{const a=xo("span",[m8,Bh]);a.innerHTML=t&&i.selectedIcon&&i.selectedIcon.svg?i.selectedIcon.svg:i.icon.svg,i.icon.width&&a.children[0].setAttribute("width",i.icon.width.toString()),i.icon.height&&a.children[0].setAttribute("height",i.icon.height.toString()),r.appendChild(a)}const l=xo("span",[nv,Bh,kA]);if(l.innerHTML=i.text,r.appendChild(l),s==="title")r==null||r.classList.add(Bh,b8);else if(!((o=i==null?void 0:i.children)===null||o===void 0)&&o.length){const a=xo("span",[nv,Bh,C8]);a.innerHTML=t?'<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(a)}}return r}let DA;const _8={CHANGE_STYLE:"change_style"};class xs extends th{static get EVENT_TYPE(){return _8}static get DEFAULT(){return DA||(DA=new xs)}constructor(t={},e={}){var n,o,r,s,l,a,h,d,u,c,g,f,p,m,b,C,_,w,y,S,A,R,x,T,M,B,P,F,H,E,k,I;super(),this._defaultPadding=[10,16,10,16],this._color=(n=t.color)!==null&&n!==void 0?n:e==null?void 0:e.color,this._strokeColor=(o=t==null?void 0:t.strokeColor)!==null&&o!==void 0?o:e==null?void 0:e.strokeColor,this._fontSize=(r=t.fontSize)!==null&&r!==void 0?r:e==null?void 0:e.fontSize,this._fontFamily=(s=t.fontFamily)!==null&&s!==void 0?s:e==null?void 0:e.fontFamily,this._fontWeight=(l=t.fontWeight)!==null&&l!==void 0?l:e==null?void 0:e.fontWeight,this._fontVariant=(a=t.fontVariant)!==null&&a!==void 0?a:e==null?void 0:e.fontVariant,this._fontStyle=(h=t.fontStyle)!==null&&h!==void 0?h:e==null?void 0:e.fontStyle,this._textOverflow=((d=t.textOverflow)!==null&&d!==void 0?d:e==null?void 0:e.textOverflow)||"ellipsis",this._textStick=(c=(u=t.textStick)!==null&&u!==void 0?u:e==null?void 0:e.textStick)!==null&&c!==void 0&&c,this._textStickBaseOnAlign=(f=(g=t.textStickBaseOnAlign)!==null&&g!==void 0?g:e==null?void 0:e.textStickBaseOnAlign)!==null&&f!==void 0&&f,this._marked=(m=(p=t.marked)!==null&&p!==void 0?p:e==null?void 0:e.marked)!==null&&m!==void 0&&m,this._textAlign=((b=t.textAlign)!==null&&b!==void 0?b:e==null?void 0:e.textAlign)||"left",this._textBaseline=((C=t.textBaseline)!==null&&C!==void 0?C:e==null?void 0:e.textBaseline)||"middle",this._bgColor=(_=t.bgColor)!==null&&_!==void 0?_:e==null?void 0:e.bgColor,this._padding=(y=(w=t.padding)!==null&&w!==void 0?w:e==null?void 0:e.padding)!==null&&y!==void 0?y:this._defaultPadding,this._borderColor=(S=t.borderColor)!==null&&S!==void 0?S:e==null?void 0:e.borderColor,this._lineHeight=(A=t.lineHeight)!==null&&A!==void 0?A:e==null?void 0:e.lineHeight,this._underline=(R=t.underline)!==null&&R!==void 0?R:e==null?void 0:e.underline,this._underlineColor=(x=t.underlineColor)!==null&&x!==void 0?x:e==null?void 0:e.underlineColor,this._underlineDash=(T=t.underlineDash)!==null&&T!==void 0?T:e==null?void 0:e.underlineDash,this._underlineOffset=(M=t.underlineOffset)!==null&&M!==void 0?M:e==null?void 0:e.underlineOffset,this._lineThrough=(B=t.lineThrough)!==null&&B!==void 0?B:e==null?void 0:e.lineThrough,this._lineThroughColor=(P=t.lineThroughColor)!==null&&P!==void 0?P:e==null?void 0:e.lineThroughColor,this._lineThroughDash=(F=t.lineThroughDash)!==null&&F!==void 0?F:e==null?void 0:e.lineThroughDash,this._linkColor=(H=t.linkColor)!==null&&H!==void 0?H:e==null?void 0:e.linkColor,this._cursor=(E=t.cursor)!==null&&E!==void 0?E:e==null?void 0:e.cursor,this._borderLineWidth=(k=t.borderLineWidth)!==null&&k!==void 0?k:e==null?void 0:e.borderLineWidth,this._borderLineDash=(I=t.borderLineDash)!==null&&I!==void 0?I:e==null?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(t=this._padding)!==null&&t!==void 0?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 xs(this)}}let OA;class fg extends xs{static get DEFAULT(){return OA||(OA=new fg)}constructor(t={},e={}){var n;super(t,e),this.textAlign=((n=t.textAlign)!==null&&n!==void 0?n:e==null?void 0:e.textAlign)||"center"}clone(){return new fg(this)}}let zA;class pg extends xs{static get DEFAULT(){return zA||(zA=new pg)}constructor(t={},e=null){var n,o;super(t,e),this._autoWrapText=(n=t==null?void 0:t.autoWrapText)!==null&&n!==void 0?n:e==null?void 0:e.autoWrapText,this._lineClamp=(o=t==null?void 0:t.lineClamp)!==null&&o!==void 0?o:e==null?void 0:e.lineClamp}clone(){return new pg(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 WA;class Rs extends xs{static get DEFAULT(){return WA||(WA=new Rs)}constructor(t={},e={},n={}){var o,r,s,l,a,h,d,u,c,g,f,p,m,b,C,_,w,y,S,A,R,x;super(t,e),this._size=((r=(o=t==null?void 0:t.size)!==null&&o!==void 0?o:e==null?void 0:e.size)!==null&&r!==void 0?r:n==null?void 0:n.size)||14,this._spaceBetweenTextAndIcon=((l=(s=t==null?void 0:t.spaceBetweenTextAndIcon)!==null&&s!==void 0?s:e==null?void 0:e.spaceBetweenTextAndIcon)!==null&&l!==void 0?l:n==null?void 0:n.spaceBetweenTextAndIcon)||8,this._defaultFill=(h=(a=t==null?void 0:t.checkboxStyle)===null||a===void 0?void 0:a.defaultFill)!==null&&h!==void 0?h:n==null?void 0:n.defaultFill,this._defaultStroke=(u=(d=t==null?void 0:t.checkboxStyle)===null||d===void 0?void 0:d.defaultStroke)!==null&&u!==void 0?u:n==null?void 0:n.defaultStroke,this._disableFill=(g=(c=t==null?void 0:t.checkboxStyle)===null||c===void 0?void 0:c.disableFill)!==null&&g!==void 0?g:n==null?void 0:n.disableFill,this._checkedFill=(p=(f=t==null?void 0:t.checkboxStyle)===null||f===void 0?void 0:f.checkedFill)!==null&&p!==void 0?p:n==null?void 0:n.checkedFill,this._checkedStroke=(b=(m=t==null?void 0:t.checkboxStyle)===null||m===void 0?void 0:m.checkedStroke)!==null&&b!==void 0?b:n==null?void 0:n.checkedStroke,this._disableCheckedFill=(_=(C=t==null?void 0:t.checkboxStyle)===null||C===void 0?void 0:C.disableCheckedFill)!==null&&_!==void 0?_:n==null?void 0:n.disableCheckedFill,this._disableCheckedStroke=(y=(w=t==null?void 0:t.checkboxStyle)===null||w===void 0?void 0:w.disableCheckedStroke)!==null&&y!==void 0?y:n==null?void 0:n.disableCheckedStroke,this._checkIconImage=(A=(S=t==null?void 0:t.checkboxStyle)===null||S===void 0?void 0:S.checkIconImage)!==null&&A!==void 0?A:n==null?void 0:n.checkIconImage,this._indeterminateIconImage=(x=(R=t==null?void 0:t.checkboxStyle)===null||R===void 0?void 0:R.indeterminateIconImage)!==null&&x!==void 0?x:n==null?void 0:n.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 Rs(t,this)}clone(){return new Rs(this)}}function mg(i,t,e,n,o,r){var s;return i||t?i instanceof xs?i:typeof i=="function"?mg(i(e),t,e,n,o,r):(i||(i={}),o&&!z(i.autoWrapText)&&(i.autoWrapText=!0),n===Rs?new Rs(i??{},t??{},(s=r.checkboxStyle)!==null&&s!==void 0?s:{}):new n(i??{},t??{})):n.DEFAULT}class w8{constructor(t){this._table=t;const e=vn();this.freezeIcon=e[Wi.freezeIconName],this.frozenIcon=e[Wi.frozenIconName],this.frozenCurrentIcon=e[Wi.frozenCurrentIconName],this.normalIcon=e[Wi.normalIconName],this.upIcon=e[Wi.upwardIconName],this.downIcon=e[Wi.downwardIconName],this.dropDownAbsoluteIcon=e[Wi.dropdownIconName],this.expandIcon=e[Wi.expandIconName],this.collapseIcon=e[Wi.collapseIconName]}getIcons(t,e){const n=[];if(this._table.isPivotTable()){const{showSort:l,sort:a}=this._table.internalProps.layoutMap.getHeader(t,e);if(l){let h=this._table.getPivotSortState(t,e);h&&(h=h.toUpperCase());const d=h==="ASC"?this.upIcon:h==="DESC"?this.downIcon:this.normalIcon;d&&n.push(d)}else if(a){const h=this.getSortIconForPivotTable(this._table.getPivotSortState(t,e),this._table,t,e);h&&n.push(h)}}else{const l=this._table.sortState;let a;a=void 0;const h=this._table.getCellRange(t,e);if(l)if(Array.isArray(l))for(let u=0;u<l.length;u++){const c=l[u],g=this._table._getHeaderCellBySortState(c);if(g&&Yi(h,g.col,g.row)){({order:a}=c);break}}else{const u=this._table._getHeaderCellBySortState(l);u&&Yi(h,u.col,u.row)&&({order:a}=l)}const d=this.getSortIcon(a,this._table,t,e);d&&n.push(d)}if(this._table.showFrozenIcon&&t<this._table.allowFrozenColCount){const l=this.getFrozenIcon(t,e);l&&n.push(l)}if(this.checkDropDownIcon(this._table,t,e)){const l=this.dropDownAbsoluteIcon;n.push(l)}const o=this.getDropDownStateIcons(this._table,t,e);o.length&&n.push(...o);const{headerIcon:r}=this._table._getHeaderLayoutMap(t,e),s=this.getHierarchyIcon(t,e);if(s&&n.push(s),r){let l;typeof r=="function"?l=r({col:t,row:e,value:this._table.getCellValue(t,e),dataValue:this._table.getCellOriginValue(t,e),table:this._table}):l=r;const a=vn(),h=d=>{let u;u=typeof d=="string"?a[d]:d,u&&n.push(u)};Array.isArray(l)?l.forEach((d,u)=>{h(d)}):h(l)}return n}getFrozenIcon(t,e){if(this._table.isPivotTable()||this._table.transpose||this._table.rightFrozenColCount&&t>=this._table.colCount-this._table.rightFrozenColCount)return null;const n=this._table.getHeaderDefine(t,e);if(n.columns&&n.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,n,o){const r=t==="asc"?this.upIcon:t==="desc"?this.downIcon:this.normalIcon,s=e.getHeaderDefine(n,o);return!s||s.showSort===!1||!z(s.showSort)&&!s.sort||s.columns&&s.columns.length>0?null:r}getSortIconForPivotTable(t,e,n,o){const r=e.getHeaderDefine(n,o);return!r||r.showSort===!1||!z(r.showSort)&&!r.sort||r.columns&&r.columns.length>0?null:(t==null?void 0:t.toUpperCase())==="ASC"?this.upIcon:(t==null?void 0:t.toUpperCase())==="DESC"?this.downIcon:this.normalIcon}getDropDownStateIcons(t,e,n){var o,r,s;const l=t.getHeaderDefine(e,n),a=t._getHeaderLayoutMap(e,n),{dropDownMenu:h}=a,d=[];if(Array.isArray(h)&&h.length||Array.isArray(t.globalDropDownMenu)&&t.globalDropDownMenu.length&&!(!((o=l==null?void 0:l.columns)===null||o===void 0)&&o.length)){const u=h||t.globalDropDownMenu;let c=-1,g=-1;for(let f=0;f<u.length;f++){const p=u[f];if(typeof p=="object"&&p.children&&p.children.length)for(let m=0;m<p.children.length;m++){const b=p.children[m];if(!((r=t.stateManager.menu)===null||r===void 0)&&r.dropDownMenuHighlight&&Ph(t,(s=t.stateManager.menu)===null||s===void 0?void 0:s.dropDownMenuHighlight,typeof b=="object"?b==null?void 0:b.menuKey:b,e,n)){c=f,g=m;break}}if(t._dropDownMenuIsHighlight(e,n,f)){c=f;break}}if(c!==-1){let f;f=g!==-1?(h||t.globalDropDownMenu)[c].children[g]:(h||t.globalDropDownMenu)[c],f.stateIcon&&(f.stateIcon.svg?d.push({type:"svg",name:f.stateIcon.src||f.stateIcon.svg,width:f.stateIcon.width||22,height:f.stateIcon.height||22,svg:f.stateIcon.svg,positionType:me.right,marginRight:0,funcType:ve.dropDownState,interactive:!1}):f.stateIcon.src&&d.push({type:"image",name:f.stateIcon.src||f.stateIcon.svg,width:f.stateIcon.width||22,height:f.stateIcon.height||22,src:f.stateIcon.src,positionType:me.right,marginRight:0,funcType:ve.dropDownState,interactive:!1}))}}return d}getDropDownIconRect(t,e,n){var o,r,s,l,a,h,d,u;const c=(l=(r=(o=this.downIcon.hover)===null||o===void 0?void 0:o.width)!==null&&r!==void 0?r:(s=this.downIcon)===null||s===void 0?void 0:s.width)!==null&&l!==void 0?l:0,g=(u=(h=(a=this.downIcon.hover)===null||a===void 0?void 0:a.height)!==null&&h!==void 0?h:(d=this.downIcon)===null||d===void 0?void 0:d.height)!==null&&u!==void 0?u:0,f=t.right-2-c,p=t.right-2;let m;return m=n==="middle"?t.top+t.height/2-c/2:n==="top"?t.top+e/2:n==="bottom"?t.bottom-2*e:t.top,{left:f,right:p,top:m,bottom:g+m,width:c,height:g}}getHierarchyIcon(t,e){const{hierarchyState:n}=this._table._getHeaderLayoutMap(t,e);if(n){if(n===Vt.expand)return this.expandIcon;if(n===Vt.collapse)return this.collapseIcon}}getHierarchyIconWidth(){var t,e;return this.expandIcon.width+((t=this.expandIcon.marginLeft)!==null&&t!==void 0?t:0)+((e=this.expandIcon.marginRight)!==null&&e!==void 0?e:0)}checkDropDownIcon(t,e,n){var o;if(t.isPivotTable()){const r=t._getHeaderLayoutMap(e,n);if(Array.isArray(r.dropDownMenu)&&r.dropDownMenu.length)return!0}else{const r=t.getHeaderDefine(e,n);if(Array.isArray(r.dropDownMenu)&&r.dropDownMenu.length||(!Array.isArray(r.dropDownMenu)||r.dropDownMenu.length!==0)&&Array.isArray(t.globalDropDownMenu)&&t.globalDropDownMenu.length&&!(!((o=r==null?void 0:r.columns)===null||o===void 0)&&o.length))return!0}return!1}getStyleClass(t){switch(t){case"text":case"link":return pg;case"image":case"video":return fg;case"checkbox":return Rs}}setTableColumnsEditor(){const t=(e,n)=>{e==null||e.forEach((o,r)=>{o.editor&&(n[r].editor=o.editor),o.columns&&t(o.columns,n[r].columns)})};t(this._table.options.columns,this._table.internalProps.columns)}}class NA extends EventTarget{constructor(t,e){if(super(),this._table=t,oe.mode==="node")return;const n=document.createElement("div");n.style.opacity="0",n.dataset.vtable="vtable",n.style.pointerEvents="none",n.classList.add("input-container");const o=this._input=document.createElement("input");n.appendChild(o),o.classList.add("table-focus-control"),o.dataset.vtable="vtable",o.readOnly=!0,e.appendChild(n),this._container=n}focus(){this._input.focus({preventScroll:!0})}setFocusRect(t,e){const n=this._input;n.value=e,n.select();const o=t.top-this._table.scrollTop,r=t.left-this._table.scrollLeft;n.style.top=`${o.toFixed()}px`,n.style.left=`${r.toFixed()}px`,n.style.width=`${t.width.toFixed()}px`,n.style.height=`${t.height.toFixed()}px`}get input(){return this._input}release(){var t;(t=this._container.parentElement)===null||t===void 0||t.removeChild(this._container)}}class VA{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(!z(e))return;const n=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-n)}remove(t){if(this.data.has(t)){const e=this.data.get(t);this.data.delete(t);const n=this._keys.indexOf(t);n!==-1&&this._keys.splice(n,1),this.totalSum-=e;const o=this.table.getRowHeight(t);this.updateDifference(t,o-e)}}put(t,e){if(z(e))if(this.data.has(t)){const n=this.data.get(t);if(n===e)return;this.data.set(t,e);const o=e-n;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((e,n)=>e<n?-1:e>n?1:0),this._sorted=!0)}updateDifference(t,e){var n;const o=(n=this.difference.get(t))!==null&&n!==void 0?n: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[n,o]of this.cumulativeSum)n>=t&&this.cumulativeSum.set(n,o+e)}calculatePrefixSum(t){if(t<0)return 0;if(this.cumulativeSum.has(t)){let e=this.cumulativeSum.get(t);for(const[n,o]of this.difference)n<=t&&(e+=o);return e}return this.dealDiffenence(),this.getCumulativeSum(t)}getCumulativeSum(t){var e;let n=0;for(let o=t;o>=0;o--){if(this.cumulativeSum.has(o)){n+=this.cumulativeSum.get(o);break}n+=(e=this.data.get(o))!==null&&e!==void 0?e:this.table.getRowHeight(o)}return this.cumulativeSum.set(t,n),n}update(){this.isUpdate||(this.isUpdate=!0,setTimeout(()=>{this.dealDiffenence(),this.isUpdate=!1},0))}dealDiffenence(){for(const[t]of this.cumulativeSum)for(const[e,n]of this.difference)if(t>=e){const o=this.cumulativeSum.get(t);this.cumulativeSum.set(t,o+n)}this.difference.clear()}insert(t,e){for(let o=t;o<=this.getLastIndex();o++)this.cumulativeSum.delete(o);const n=this.getLastIndex()+1;this.adjustOrder(t,t+1,n-t),z(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 n=t;n<=this.getLastIndex();n++)this.cumulativeSum.delete(n);const e=this.getLastIndex();this.adjustOrder(t+1,t,e-t),this.delLast()}adjustOrder(t,e,n){this.clearRange(),this._sort();const{_keys:o}=this;if(t>e){const s=[];for(let l=vg(o,t+n-1);l>=0;l--){const a=o[l];if(a>=t)s.push(this.get(a));else if(e<=a&&a<t)this.put(a+n,this.get(a));else if(a<e)break}for(let l=0;l<n;l++)this.put(e+l,s[n-1-l])}const{length:r}=o;if(t<e){const s=[];for(let l=vg(o,t);l<r;l++){const a=o[l];if(a>=t&&a<t+n)s.push(this.get(a));else if(t+n<=a&&a<=e)this.put(a-n,this.get(a));else if(a>e)break}for(let l=0;l<n;l++)this.put(e+l,s[l])}}exchangeOrder(t,e,n,o,r){const{_keys:s}=this;if(this._sorted||(s.sort((l,a)=>l<a?-1:l>a?1:0),this._sorted=!0),t>n){const l=[],a=[];for(let h=vg(s,n);h<t+e;h++){const d=s[h];d>=t&&d<t+e?a.push(this.get(d)):l.push(this.get(d))}for(let h=0;h<e;h++)this.put(r+h,a[h]);for(let h=0;h<l.length;h++)this.put(r+e+h,l[h])}else{const l=[],a=[];for(let h=vg(s,t);h<n+o;h++){const d=s[h];d>=t&&d<t+e?a.push(this.get(d)):l.push(this.get(d))}for(let h=0;h<e;h++)this.put(r+h,a[h]);for(let h=0;h<l.length;h++)this.put(t+h,l[h])}}}function vg(i,t){let e=0,n=i.length-1;for(;e<=n;){const o=Math.floor((e+n)/2);if(i[o]===t)return o;i[o]>t?n=o-1:e=o+1}return n<0?0:n}class S8{constructor(t){this._table=t;const e=vn();this.dragReorderIconName=e[Wi.dragReorderIconName]}getIcons(t,e){return[this.dragReorderIconName]}}class x8{constructor(t,e,n){this.table=t,this.customCellStyle=e,this.customCellStyleArrangement=n}getCustomCellStyle(t,e){const n=this.getCustomCellStyleId(t,e);if(n){const o=this.getCustomCellStyleOption(n);return o==null?void 0:o.style}}getCustomCellStyleId(t,e){let n;const o=this.table.getCellRange(t,e);for(let r=o.start.col;r<=o.end.col;r++)for(let s=o.start.row;s<=o.end.row;s++)this.customCellStyleArrangement.forEach(l=>{l.cellPosition.range?l.cellPosition.range.start.col<=r&&l.cellPosition.range.end.col>=r&&l.cellPosition.range.start.row<=s&&l.cellPosition.range.end.row>=s&&(n=l.customStyleId):l.cellPosition.col===r&&l.cellPosition.row===s&&(n=l.customStyleId)});return n}getCustomCellStyleOption(t){return this.customCellStyle.find(e=>e.id===t)}registerCustomCellStyle(t,e){const n=this.customCellStyle.findIndex(o=>o.id===t);n===-1?this.customCellStyle.push({id:t,style:e}):this.customCellStyle[n]={id:t,style:e},this.customCellStyleArrangement.forEach(o=>{const r=o.cellPosition;if(o.customStyleId===t)if(r.range)for(let s=r.range.start.col;s<=r.range.end.col;s++)for(let l=r.range.start.row;l<=r.range.end.row;l++)this.table.scenegraph.updateCellContent(s,l);else this.table.scenegraph.updateCellContent(r.col,r.row)}),this.table.scenegraph.updateNextFrame()}arrangeCustomCellStyle(t,e){const n=this.customCellStyleArrangement.findIndex(o=>o.cellPosition.range&&t.range?o.cellPosition.range.start.col===t.range.start.col&&o.cellPosition.range.start.row===t.range.start.row&&o.cellPosition.range.end.col===t.range.end.col&&o.cellPosition.range.end.row===t.range.end.row:o.cellPosition.col===t.col&&o.cellPosition.row===t.row);if(n!==-1||e){if(n===-1&&e)this.customCellStyleArrangement.push({cellPosition:{col:t.col,row:t.row,range:t.range},customStyleId:e});else{if(this.customCellStyleArrangement[n].customStyleId===e)return;e?this.customCellStyleArrangement[n].customStyleId=e:this.customCellStyleArrangement.splice(n,1)}if(t.range)for(let o=t.range.start.col;o<=t.range.end.col;o++)for(let r=t.range.start.row;r<=t.range.end.row;r++){const s=this.table.getCellRange(o,r);for(let l=s.start.col;l<=s.end.col;l++)for(let a=s.start.row;a<=s.end.row;a++)this.table.scenegraph.updateCellContent(l,a)}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(n=>{this.registerCustomCellStyle(n.id,n.style)}),e.forEach(n=>{this.arrangeCustomCellStyle(n.cellPosition,n.customStyleId)})}hasCustomCellStyle(t){return this.customCellStyle.some(e=>e.id===t)}}function Hh(i,t){i=i.clone();for(const e in t){const n=t[e];n&&(i[`_${e}`]=n)}return i}class Pe{constructor(t,e,n="grid",o=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 Mr,this.dimensionKeysIncludeVirtual=new Mr,this.cache=new Map,this.sizeIncludeParent=o!=null,this.rowExpandLevel=o,this.hierarchyType=n,this.sharedVar=e,this.reset(t)}reset(t,e=!1){this.cache.clear(),this.dimensionKeys=new Mr,this.dimensionKeysIncludeVirtual=new Mr,this.tree.children=t,this.setTreeNode(this.tree,0,this.tree)}setTreeNode(t,e,n){var o,r;t.startIndex=e,t.startInTotal=((o=n.startInTotal)!==null&&o!==void 0?o:0)+t.startIndex,((r=t.dimensionKey)!==null&&r!==void 0?r:t.indicatorKey)&&(t.virtual||this.dimensionKeys.contain(t.indicatorKey?Xi:t.dimensionKey)||this.dimensionKeys.put(t.level,t.indicatorKey?Xi:t.dimensionKey),this.dimensionKeysIncludeVirtual.contain(t.indicatorKey?Xi:t.dimensionKey)||this.dimensionKeysIncludeVirtual.put(t.level,t.indicatorKey?Xi:t.dimensionKey),t.id||(t.id=++this.sharedVar.seqId));let s=t.dimensionKey&&this.sizeIncludeParent?1:0;const l=t.children||t.columns;return this.hierarchyType==="grid"?(l==null?void 0:l.length)>=1?l.forEach(a=>{var h;a.level=((h=t.level)!==null&&h!==void 0?h:0)+1,this.totalLevel=Math.max(this.totalLevel,a.level+1),s+=this.setTreeNode(a,s,t)}):s=1:t.hierarchyState===Vt.expand&&(l==null?void 0:l.length)>=1?l.forEach(a=>{var h;a.level=((h=t.level)!==null&&h!==void 0?h:0)+1,this.totalLevel=Math.max(this.totalLevel,a.level+1),s+=this.setTreeNode(a,s,t)}):t.hierarchyState===Vt.collapse&&(l==null?void 0:l.length)>=1?l.forEach(a=>{var h;a.level=((h=t.level)!==null&&h!==void 0?h:0)+1,this.totalLevel=Math.max(this.totalLevel,a.level+1),this.setTreeNode(a,s,t)}):!t.hierarchyState&&t.level+1<this.rowExpandLevel&&((l==null?void 0:l.length)>=1||l===!0)?(t.hierarchyState=Vt.expand,(l==null?void 0:l.length)>=1&&l.forEach(a=>{var h;a.level=((h=t.level)!==null&&h!==void 0?h:0)+1,this.totalLevel=Math.max(this.totalLevel,a.level+1),s+=this.setTreeNode(a,s,t)})):(l==null?void 0:l.length)>=1||l===!0?(t.hierarchyState=Vt.collapse,(l==null?void 0:l.length)>=1&&l.forEach(a=>{var h;a.level=((h=t.level)!==null&&h!==void 0?h:0)+1,this.totalLevel=Math.max(this.totalLevel,a.level+1),this.setTreeNode(a,s,t)})):(t.hierarchyState=Vt.none,s=1),t.size=s,s}getTreePath(t,e=30){const n=[];return this.searchPath(t,this.tree,n,e),n.shift(),n}getTreePathByCellIds(t){const e=[];let n=this.tree.children;for(let o=0;o<t.length;o++){const r=t[o],s=this.findNodeById(n,r);if(!s)break;e.push(s),n=s.children}return e}findNodeById(t,e){return t.find(n=>n.id===e)}searchPath(t,e,n,o){if(!e||t<e.startIndex||t>=e.startIndex+e.size||(n.push(e),!e.children||e.children.length===0||e.level>=o))return;const r=t-e.startIndex;if(this.cache.has(e.level+1)){const a=this.cache.get(e.level+1);if(r>=a.startIndex&&r<a.startIndex+a.size)return void this.searchPath(r,a,n,o)}let s=0,l=e.children.length-1;for(;s<=l;){const a=Math.floor((s+l)/2),h=e.children[a];if(r>=h.startIndex&&r<h.startIndex+h.size){this.cache.set(h.level,h);const d=[];this.cache.forEach((u,c)=>{c>h.level&&d.push(c)}),d.forEach(u=>{this.cache.delete(u)}),this.searchPath(r,h,n,o);break}r<h.startIndex?l=a-1:s=a+1}}movePosition(t,e,n){let o,r,s;const l=(d,u)=>{if(r!==void 0&&s!==void 0)return;d.level===t&&(d.startInTotal===e&&(r=u),d.startInTotal<=n&&n<=d.startInTotal+d.size-1&&(s=u));const c=d.children||d.columns;if(c&&d.level<t){o=d;for(let g=0;g<c.length;g++)(e>=c[g].startInTotal&&e<=c[g].startInTotal+c[g].size||n>=c[g].startInTotal&&n<=c[g].startInTotal+c[g].size)&&l(c[g],g)}};l(this.tree,0);const a=o.children||o.columns,h=a.splice(r,1);h.unshift(s,0),Array.prototype.splice.apply(a,h)}getCopiedTree(){const t=Ee(this.tree.children);return jA(t),t}}function ov(i,t){t==null||t.forEach(e=>{var n,o;const r={dimensionKey:e.dimensionKey,indicatorKey:e.indicatorKey,value:e.value,hierarchyState:e.hierarchyState,children:void 0,virtual:(n=e.virtual)!==null&&n!==void 0&&n,levelSpan:(o=e.levelSpan)!==null&&o!==void 0?o:1};i.push(r),e.children&&(r.children=[],ov(r.children,e.children))})}function bg(i,t){let e=0;return i==null||i.forEach(n=>{t?e++:n.children&&n.children.length!==0||e++,n.children&&(e+=bg(n.children,t))}),e}function R8(i,t,e,n,o,r){var s,l,a,h,d,u,c,g,f,p,m,b,C,_,w,y,S,A,R,x,T,M,B,P;const F=i.id,H=(l=(s=r.rowsDefine)===null||s===void 0?void 0:s.find(I=>typeof I!="string"&&I.dimensionKey===i.dimensionKey))!==null&&l!==void 0?l:(a=r.columnsDefine)===null||a===void 0?void 0:a.find(I=>typeof I!="string"&&I.dimensionKey===i.dimensionKey),E=(h=r.indicatorsDefine)===null||h===void 0?void 0:h.find(I=>typeof I!="string"&&(i.indicatorKey?I.indicatorKey===i.indicatorKey:I.title===i.value&&!i.dimensionKey)),k={id:F,title:(d=i.value)!==null&&d!==void 0?d:E==null?void 0:E.title,field:i.dimensionKey,style:typeof((u=E??H)===null||u===void 0?void 0:u.headerStyle)=="function"?(c=E??H)===null||c===void 0?void 0:c.headerStyle:Object.assign({},(g=E??H)===null||g===void 0?void 0:g.headerStyle),headerType:(p=(f=E==null?void 0:E.headerType)!==null&&f!==void 0?f:H==null?void 0:H.headerType)!==null&&p!==void 0?p:"text",headerIcon:(m=E==null?void 0:E.headerIcon)!==null&&m!==void 0?m:H==null?void 0:H.headerIcon,define:Object.assign({},i,E??Object.assign({},H,{sort:void 0})),fieldFormat:(b=E==null?void 0:E.headerFormat)!==null&&b!==void 0?b:H==null?void 0:H.headerFormat,dropDownMenu:(C=E==null?void 0:E.dropDownMenu)!==null&&C!==void 0?C:H==null?void 0:H.dropDownMenu,pivotInfo:{value:i.value,dimensionKey:i.dimensionKey,isPivotCorner:!1},width:H==null?void 0:H.width,minWidth:H==null?void 0:H.minWidth,maxWidth:H==null?void 0:H.maxWidth,showSort:(_=E==null?void 0:E.showSort)!==null&&_!==void 0?_:H==null?void 0:H.showSort,sort:E==null?void 0:E.sort,description:H==null?void 0:H.description};E?(E.customRender&&(i.customRender=E.customRender),z((w=r._indicators)===null||w===void 0?void 0:w.find(I=>I.indicatorKey===E.indicatorKey))||(y=r._indicators)===null||y===void 0||y.push({id:++r.sharedVar.seqId,indicatorKey:E.indicatorKey,field:E.indicatorKey,fieldFormat:E==null?void 0:E.format,cellType:(A=(S=E==null?void 0:E.cellType)!==null&&S!==void 0?S:E==null?void 0:E.columnType)!==null&&A!==void 0?A:"text",chartModule:"chartModule"in E?E.chartModule:null,chartSpec:"chartSpec"in E?E.chartSpec:null,noDataRenderNothing:"noDataRenderNothing"in E&&E.noDataRenderNothing,sparklineSpec:"sparklineSpec"in E?E.sparklineSpec:null,style:E==null?void 0:E.style,icon:E==null?void 0:E.icon,define:Object.assign({},i,E,{dragHeader:H==null?void 0:H.dragHeader}),width:E==null?void 0:E.width,minWidth:E==null?void 0:E.minWidth,maxWidth:E==null?void 0:E.maxWidth,disableColumnResize:E==null?void 0:E.disableColumnResize})):i.indicatorKey&&(z((R=r._indicators)===null||R===void 0?void 0:R.find(I=>I.indicatorKey===i.indicatorKey))||(x=r._indicators)===null||x===void 0||x.push({id:++r.sharedVar.seqId,indicatorKey:i.indicatorKey,field:i.indicatorKey,cellType:"text",define:Object.assign({},i)})),e[F]=k,r._headerObjects[F]=k;for(let I=o-1;I>=0;I--)t[I][r.colIndex]=n[I];if(t[o][r.colIndex]=F,i.levelSpan>1)for(let I=1;I<i.levelSpan;I++){if(!t[o+I]){t[o+I]=[];for(let L=0;L<r.colIndex;L++)t[o+I][L]=t[o][L]}t[o+I][r.colIndex]=F}if(((T=i.children)===null||T===void 0?void 0:T.length)>=1)r._addHeaders(t,o+((M=i.levelSpan)!==null&&M!==void 0?M:1),(B=i.children)!==null&&B!==void 0?B:[],[...n,...Array((P=i.levelSpan)!==null&&P!==void 0?P:1).fill(F)],e);else{for(let I=o+1;I<t.length;I++)t[I][r.colIndex]=F;r.colIndex++}}function A8(i,t,e,n,o,r,s,l,a){var h,d,u,c,g,f,p,m,b,C,_,w,y,S,A,R,x,T,M,B,P,F,H,E,k,I,L,D;const O=i.id,N=l.find(U=>typeof U!="string"&&U.dimensionKey===i.dimensionKey),W=(h=a.indicatorsDefine)===null||h===void 0?void 0:h.find(U=>typeof U!="string"&&(i.indicatorKey?U.indicatorKey===i.indicatorKey:U.title===i.value)),$={id:O,title:(d=i.value)!==null&&d!==void 0?d:W.title,field:i.dimensionKey,style:i.level+1===r||typeof((u=W??N)===null||u===void 0?void 0:u.headerStyle)=="function"?(c=W??N)===null||c===void 0?void 0:c.headerStyle:Object.assign({},(g=W??N)===null||g===void 0?void 0:g.headerStyle,{textAlign:"left"}),headerType:(p=(f=W==null?void 0:W.headerType)!==null&&f!==void 0?f:N==null?void 0:N.headerType)!==null&&p!==void 0?p:"text",headerIcon:(m=W==null?void 0:W.headerIcon)!==null&&m!==void 0?m:N==null?void 0:N.headerIcon,define:Object.assign(i,{linkJump:(b=W??N)===null||b===void 0?void 0:b.linkJump,linkDetect:(C=W??N)===null||C===void 0?void 0:C.linkDetect,templateLink:(_=W??N)===null||_===void 0?void 0:_.templateLink,keepAspectRatio:(y=(w=W??N)===null||w===void 0?void 0:w.keepAspectRatio)!==null&&y!==void 0&&y,imageAutoSizing:(S=W??N)===null||S===void 0?void 0:S.imageAutoSizing,headerCustomRender:(A=W??N)===null||A===void 0?void 0:A.headerCustomRender,headerCustomLayout:(R=W??N)===null||R===void 0?void 0:R.headerCustomLayout,dragHeader:N==null?void 0:N.dragHeader,disableHeaderHover:!!(!((x=W??N)===null||x===void 0)&&x.disableHeaderHover),disableHeaderSelect:!!(!((T=W??N)===null||T===void 0)&&T.disableHeaderSelect)}),fieldFormat:(M=W==null?void 0:W.headerFormat)!==null&&M!==void 0?M:N==null?void 0:N.headerFormat,dropDownMenu:(B=W==null?void 0:W.dropDownMenu)!==null&&B!==void 0?B:N==null?void 0:N.dropDownMenu,pivotInfo:{value:i.value,dimensionKey:i.dimensionKey,isPivotCorner:!1},hierarchyLevel:i.level,dimensionTotalLevel:r,hierarchyState:i.hierarchyState,width:N==null?void 0:N.width,minWidth:N==null?void 0:N.minWidth,maxWidth:N==null?void 0:N.maxWidth,parentCellId:n[n.length-1]};W?(W.customRender&&(i.customRender=W.customRender),z((P=a._indicators)===null||P===void 0?void 0:P.find(U=>U.indicatorKey===W.indicatorKey))||(F=a._indicators)===null||F===void 0||F.push({id:++a.sharedVar.seqId,indicatorKey:W.indicatorKey,field:W.indicatorKey,fieldFormat:W==null?void 0:W.format,cellType:(E=(H=W==null?void 0:W.cellType)!==null&&H!==void 0?H:W==null?void 0:W.columnType)!==null&&E!==void 0?E:"text",chartModule:"chartModule"in W?W.chartModule:null,chartSpec:"chartSpec"in W?W.chartSpec:null,noDataRenderNothing:"noDataRenderNothing"in W&&W.noDataRenderNothing,sparklineSpec:"sparklineSpec"in W?W.sparklineSpec:null,style:W==null?void 0:W.style,icon:W==null?void 0:W.icon,define:Object.assign({},i,W,{dragHeader:N==null?void 0:N.dragHeader}),width:W==null?void 0:W.width,minWidth:W==null?void 0:W.minWidth,maxWidth:W==null?void 0:W.maxWidth,disableColumnResize:W==null?void 0:W.disableColumnResize})):i.indicatorKey&&(z((k=a._indicators)===null||k===void 0?void 0:k.find(U=>U.indicatorKey===i.indicatorKey))||(I=a._indicators)===null||I===void 0||I.push({id:++a.sharedVar.seqId,indicatorKey:i.indicatorKey,field:i.indicatorKey,cellType:"text",define:Object.assign({},i)})),e[O]=$,a._headerObjects[O]=$,t[o][a.colIndex]=O;for(let U=o-1;U>=0;U--)t[U][a.colIndex]=n[U];if(i.hierarchyState===Vt.expand&&((L=i.children)===null||L===void 0?void 0:L.length)>=1)s&&a.colIndex++,a._addHeadersForTreeMode(t,o,(D=i.children)!==null&&D!==void 0?D:[],[...n,O],r,s&&i.hierarchyState===Vt.expand,l,e);else{s&&a.colIndex++;for(let U=o+1;U<t.length;U++)t[U][a.colIndex]=O}}function jA(i){for(let t=0;t<i.length;t++){const e=i[t];delete e.level,delete e.startIndex,delete e.id,delete e.levelSpan,delete e.size,delete e.startInTotal;const n=e.children||e.columns;n&&jA(n)}}function T8(i){const t=i.columnObjects;for(let e=0;e<t.length;e++){const n=t[e];if(n!=null&&n.aggregation)return!0}return!1}function M8(i){const t=i.columnObjects;let e=0;for(let n=0;n<t.length;n++){const o=t[n];o!=null&&o.aggregation&&(Array.isArray(o==null?void 0:o.aggregation)?e=Math.max(e,o.aggregation.filter(r=>r.showOnTop).length):o.aggregation.showOnTop&&(e=Math.max(e,1)))}return e}function B8(i){const t=i.columnObjects;let e=0;for(let n=0;n<t.length;n++){const o=t[n];o!=null&&o.aggregation&&(Array.isArray(o==null?void 0:o.aggregation)?e=Math.max(e,o.aggregation.filter(r=>!r.showOnTop).length):o.aggregation.showOnTop||(e=Math.max(e,1)))}return e}function P8(i){if(i._table.options.groupBy)return!0;const{columns:t}=i._table.options;if(lt(t)&&t.length>0)for(let e=0;e<t.length;e++){const n=t[e];if(!ce(n)&&n.tree)return!0}return!1}function H8(i){const{columns:t,rows:e,indicators:n}=i.options;if(i.isPivotTable()){if(lt(t)&&t.length>0)for(let o=0;o<t.length;o++){const r=t[o];if(!ce(r)&&(r.headerType==="image"||r.headerType==="video"||typeof r.headerType=="function")&&r.imageAutoSizing)return!0}if(lt(e)&&e.length>0)for(let o=0;o<e.length;o++){const r=e[o];if(!ce(r)&&(r.headerType==="image"||r.headerType==="video"||typeof r.headerType=="function")&&r.imageAutoSizing)return!0}if(lt(n)&&n.length>0)for(let o=0;o<n.length;o++){const r=n[o];if(!ce(r)&&((r.cellType==="image"||r.cellType==="video"||typeof r.cellType=="function")&&r.imageAutoSizing||(r.headerType==="image"||r.headerType==="video"||typeof r.headerType=="function")&&r.imageAutoSizing))return!0}}else if(lt(t)&&t.length>0)for(let o=0;o<t.length;o++){const r=t[o];if((r.cellType==="image"||r.cellType==="video"||typeof r.cellType=="function")&&r.imageAutoSizing||(r.headerType==="image"||r.headerType==="video"||typeof r.headerType=="function")&&r.imageAutoSizing)return!0}return!1}function $A(i,t){var e,n,o,r,s,l,a,h,d,u,c,g,f,p;let m,b;t.columnTree&&(i.options.indicatorsAsCol!==!1&&i.options.supplementIndicatorNodes!==!1&&(i.internalProps.columnTree=Vi(i.internalProps.columnTree,t.indicators)),m=new Pe((e=i.internalProps.columnTree)!==null&&e!==void 0?e:[],i.layoutNodeId)),t.rowTree&&(i.options.indicatorsAsCol===!1&&i.options.supplementIndicatorNodes!==!1&&(i.internalProps.rowTree=Vi(i.internalProps.rowTree,t.indicators)),b=new Pe((n=i.internalProps.rowTree)!==null&&n!==void 0?n:[],i.layoutNodeId,i.options.rowHierarchyType,i.options.rowHierarchyType==="tree"?(o=i.options.rowExpandLevel)!==null&&o!==void 0?o:1:void 0));const C=!((r=b==null?void 0:b.dimensionKeys)===null||r===void 0)&&r.count?b.dimensionKeys.valueArr():(l=(s=t.rows)===null||s===void 0?void 0:s.reduce((y,S)=>(typeof S=="string"?y.push(S):y.push(S.dimensionKey),y),[]))!==null&&l!==void 0?l:[],_=!((a=m==null?void 0:m.dimensionKeys)===null||a===void 0)&&a.count?m.dimensionKeys.valueArr():(d=(h=t.columns)===null||h===void 0?void 0:h.reduce((y,S)=>(typeof S=="string"?y.push(S):y.push(S.dimensionKey),y),[]))!==null&&d!==void 0?d:[],w=(c=(u=t.indicators)===null||u===void 0?void 0:u.reduce((y,S)=>{var A;return typeof S=="string"?y.push(S):(y.push(S.indicatorKey),(S.chartSpec||S.sparklineSpec)&&(!((A=i.internalProps.dataConfig)===null||A===void 0)&&A.aggregationRules?i.internalProps.dataConfig.aggregationRules.find(R=>R.indicatorKey===S.indicatorKey)||i.internalProps.dataConfig.aggregationRules.push({field:S.indicatorKey,indicatorKey:S.indicatorKey,aggregationType:zt.NONE}):i.internalProps.dataConfig?i.internalProps.dataConfig.aggregationRules=[{field:S.indicatorKey,indicatorKey:S.indicatorKey,aggregationType:zt.NONE}]:i.internalProps.dataConfig={aggregationRules:[{field:S.indicatorKey,indicatorKey:S.indicatorKey,aggregationType:zt.NONE}]})),y},[]))!==null&&c!==void 0?c:[];return t.rowHierarchyType==="tree"&&((f=(g=t.extensionRows)===null||g===void 0?void 0:g.length)!==null&&f!==void 0?f:0)>=1&&((p=t.extensionRows)===null||p===void 0||p.forEach(y=>{const S=[];y.rows.forEach(A=>{typeof A=="string"?S.push(A):S.push(A.dimensionKey)}),C.push(...S)})),{rowKeys:C,columnKeys:_,indicatorKeys:w,columnDimensionTree:m,rowDimensionTree:b}}function Vi(i,t){const e=(n,o)=>{n.forEach(r=>{var s;r.indicatorKey||o||!((s=r.children)===null||s===void 0)&&s.length&&r.children?r.children&&Array.isArray(r.children)&&e(r.children,o||!!r.indicatorKey):r.children=t==null?void 0:t.map(l=>{var a;return typeof l=="string"?{indicatorKey:l,value:l}:{indicatorKey:l.indicatorKey,value:(a=l.title)!==null&&a!==void 0?a:l.indicatorKey}})})};return i!=null&&i.length?e(i,!1):i=t==null?void 0:t.map(n=>{var o;return typeof n=="string"?{indicatorKey:n,value:n}:{indicatorKey:n.indicatorKey,value:(o=n.title)!==null&&o!==void 0?o:n.indicatorKey}}),i}function GA(i,t){const e=H6(t,i);if(e)return e;let n=sv(i,t);return n||(n={top:-1,row:-1,bottom:-1,height:-1}),n}function UA(i,t){const e=E6(t,i);if(e)return e;let n=rv(i,t);return n||(n={left:-1,col:-1,right:-1,width:1}),n}function E8(i,t,e){const n=GA(t,e),{row:o,top:r,bottom:s,height:l}=n,a=UA(i,e),{col:h,left:d,right:u,width:c}=a;return{row:o,col:h,rect:{left:d,right:u,top:r,bottom:s,width:c,height:l}}}function rv(i,t){if(i===0)return{left:0,col:0,right:0,width:0};const e=k8(i,t),n=t.getColsWidth(0,e);return i>=n?((o,r)=>{let s=r-t.getColWidth(o);const{colCount:l}=t.internalProps;for(let a=o;a<l;a++){const h=t.getColWidth(a),d=s+h;if(Math.round(s)<=Math.round(i)&&Math.round(i)<Math.round(d))return{left:s,col:a,right:d,width:h};s=d}return null})(e,n):((o,r)=>{let s=r;for(let l=o;l>=0;l--){const a=t.getColWidth(l),h=s-a;if(Math.round(h)<=Math.round(i)&&Math.round(i)<Math.round(s))return{left:h,col:l,right:s,width:a};s=h}return null})(e,n)}function sv(i,t){if(i===0)return{top:0,row:0,bottom:0,height:0};const e=L8(i,t),n=t.getRowsHeight(0,e);return i>=n?((o,r)=>{let s=r-t.getRowHeight(o);const{rowCount:l}=t.internalProps;for(let a=o;a<l;a++){const h=t.getRowHeight(a),d=s+h;if(Math.round(s)<=Math.round(i)&&Math.round(i)<Math.round(d))return{top:s,row:a,bottom:d,height:h};s=d}return null})(e,n):((o,r)=>{let s=r;for(let l=o;l>=0;l--){const a=t.getRowHeight(l),h=s-a;if(Math.round(h)<=Math.round(i)&&Math.round(i)<Math.round(s))return{top:h,row:l,bottom:s,height:a};s=h}return null})(e,n)}function KA(i,t,e){if(i===0)return{left:0,col:0,right:0,width:0};if(t&&i>e.tableNoFrameWidth-e.getRightFrozenColsWidth()&&i<e.tableNoFrameWidth&&i<=e.getAllColsWidth()){for(let n=0;n<e.rightFrozenColCount;n++)if(i>e.tableNoFrameWidth-e.getColsWidth(e.colCount-n-1,e.colCount-1))return{col:e.colCount-n-1,left:void 0,right:void 0,width:void 0}}return rv(i,e)}function YA(i,t,e){if(i===0)return{top:0,row:0,bottom:0,height:0};if(i-=e.tableY,t&&i>e.tableNoFrameHeight-e.getBottomFrozenRowsHeight()&&i<e.tableNoFrameHeight){for(let n=0;n<e.rightFrozenColCount;n++)if(i>e.tableNoFrameHeight-e.getRowsHeight(e.rowCount-n-1,e.rowCount-1))return{row:e.rowCount-n-1,top:void 0,bottom:void 0,height:void 0}}return sv(i,e)}function L8(i,t){let e=t.internalProps.defaultRowHeight;return t._rowRangeHeightsMap.get("$0$"+(t.rowCount-1))&&(e=t._rowRangeHeightsMap.get("$0$"+(t.rowCount-1))/t.rowCount),Math.min(Math.ceil(i/e),t.rowCount-1)}function k8(i,t){if(t._colRangeWidthsMap.get("$0$"+(t.colCount-1))){let e=0,n=t.colCount-1;for(;n-e>1;){const o=Math.floor((e+n)/2);if(i<t._colRangeWidthsMap.get(`$0$${o}`))n=o;else{if(!(i>t._colRangeWidthsMap.get(`$0$${o}`)))return o;e=o}}return n}return Math.min(Math.ceil(i/t.internalProps.defaultColWidth),t.colCount-1)}function F8(i,t,e){i-=e.tableX;let n=!1;(t-=e.tableY)>0&&t<e.getFrozenRowsHeight()&&(n=!0);let o=!1;i>0&&i<e.getFrozenColsWidth()&&(o=!0);let r=!1;t>e.tableNoFrameHeight-e.getBottomFrozenRowsHeight()&&t<e.tableNoFrameHeight&&t<=e.getAllRowsHeight()&&(r=!0);let s=!1;i>e.tableNoFrameWidth-e.getRightFrozenColsWidth()&&i<e.tableNoFrameWidth&&i<=e.getAllColsWidth()&&(s=!0);const l=KA(o||s?i:i+e.scrollLeft,s,e),a=YA(n||r?t:t+e.scrollTop,r,e);if(l&&a){const{row:h,top:d,bottom:u,height:c}=a,{col:g,left:f,right:p,width:m}=l;return{row:h,col:g,rect:{left:f,right:p,top:d,bottom:u,width:m,height:c}}}return{col:-1,row:-1}}function XA(i){return i.length===2&&Ae(i[0])&&Ae(i[1])&&i[1]>=i[0]}function qA(i){const t=i[1]-i[0],e=i[1]*i[0]<0;let n=i[0]<=0?0-i[0]:0,o=i[1]>0?i[1]-0:0;return t===0?i[0]<0?(n=1,o=0):i[0]>0&&(n=0,o=1):(n/=t,o/=t),{total:t,negative:n,positive:o,includeZero:e,domain:i,extendable_min:!0,extendable_max:!0}}function ZA(i,t){const{positive:e,negative:n,extendable_min:o,extendable_max:r,domain:s}=i,{positive:l,negative:a,extendable_min:h,extendable_max:d,domain:u}=t;if(l>0){if(!h)return!1;let c=n/e;r&&(c=n/Math.max(e,l),s[1]=-s[0]/c),u[0]=-u[1]*c}else if(a>0){if(!d)return!1;let c=e/n;o&&(c=e/Math.max(n,n),s[0]=-s[1]/c),u[1]=-u[0]*c}return!0}function JA(i,t){const{extendable_min:e,extendable_max:n,domain:o}=i,{positive:r,negative:s,domain:l}=t;return(r!==0||s!==0)&&!(r>0&&!n)&&!(s>0&&!e)&&(o[0]=l[0],o[1]=l[1],!0)}function QA(i,t){const{positive:e,negative:n,extendable_max:o,domain:r}=i,{positive:s,negative:l,extendable_min:a,domain:h}=t;if(o&&a){const d=Math.max(n,l)/Math.max(e,s);r[1]=-r[0]/d,h[0]=-h[1]*d}else if(a){const d=n/e;h[0]=-h[1]*d}else{if(!o)return!1;{const d=l/s;r[1]=-r[0]/d}}return!0}function tT(i,t){const{extendable_min:e,domain:n}=i,{extendable_max:o,domain:r}=t;return!(!e||!o)&&(n[0]=-n[1],r[1]=-r[0],!0)}function Bl(i,t){const e=[i.min,i.max],n=[t.min,t.max];if(!XA(e)||!XA(n))return;const o=qA(e),r=qA(n),{positive:s,negative:l,extendable_min:a,extendable_max:h,includeZero:d}=o,{positive:u,negative:c,extendable_min:g,extendable_max:f,includeZero:p}=r;if(s===0&&l===0){if(!JA(o,r))return}else if(u===0&&c===0){if(!JA(r,o))return}else if(d||p)if(d&&!p){if(!ZA(o,r))return}else if(p&&!d){if(!ZA(r,o))return}else{if(l===c)return;if(l>c){if(!QA(o,r))return}else if(!QA(r,o))return}else{if(l===0&&u===0){if(!tT(o,r))return}else if(c===0&&s===0&&!tT(r,o))return;if(l===0&&c===0)if(e[0]===0&&n[0]>0){if(!g)return;n[0]=0}else{if(!(n[0]===0&&e[0]>0)||!a)return;e[0]=0}if(s===0&&u===0)if(e[1]===0&&n[1]>0){if(!f)return;n[1]=0}else{if(!(n[1]===0&&e[1]>0)||!h)return;e[1]=0}}return{range1:e,range2:n}}function I8(i,t,e){var n,o,r,s,l,a,h;if(e._table.isPivotChart())if(e.indicatorsAsCol){if(e.hasTwoIndicatorAxes&&t===e.columnHeaderLevelCount-1&&i>=e.rowHeaderLevelCount&&i<e.colCount-e.rightFrozenColCount){const d=Ir("top",i,t+1,i,e.columnHeaderLevelCount-1,i,t,1,e);if(!d)return;const u=e._table._getCellStyle(i,t+1),c=Qt(wt("padding",u,i,t+1,e._table)),{range:g,ticks:f,axisOption:p,isZeroAlign:m,theme:b}=d;if(m){const C=Ir("bottom",i,t+1,i,e.columnHeaderLevelCount-1,i,t,0,e);if(C){const{range:_}=C,w=Bl(g,_);w&&(g.min=w.range1[0],g.max=w.range1[1])}}return ft(p==null?void 0:p.min)&&(g.min=p.min,g.min>0&&(p.zero=!1)),ft(p==null?void 0:p.max)&&(g.max=p.max,g.max<0&&(p.zero=!1)),xt({range:g},p,{orient:"top",type:(p==null?void 0:p.type)||"linear",label:{flush:!0},__ticksForVTable:f,__vtableChartTheme:b,__vtablePadding:c})}if(t===e.rowCount-e.bottomFrozenRowCount&&i>=e.rowHeaderLevelCount&&i<e.colCount-e.rightFrozenColCount){const d=e.getIndicatorKeyInChartSpec(i,t).slice(0,2);let u=null;d==null||d.forEach(w=>{const y=e.getIndicatorInfo(w);y&&(u=y)});const c=Ir("bottom",i,t-1,i,t,i,t,0,e);if(!c)return;const g=e._table._getCellStyle(i,t-1),f=Qt(wt("padding",g,i,t-1,e._table)),{range:p,ticks:m,axisOption:b,isZeroAlign:C,theme:_}=c;if(C){const w=Ir("top",i,t-1,i,t,i,t,1,e);if(w){const{range:y}=w,S=Bl(p,y);S&&(p.min=S.range1[0],p.max=S.range1[1])}}return ft(b==null?void 0:b.min)&&(p.min=b.min,p.min>0&&(b.zero=!1)),ft(b==null?void 0:b.max)&&(p.max=b.max,p.max<0&&(b.zero=!1)),xt({title:{visible:!0,text:u==null?void 0:u.title},range:p},b,{orient:"bottom",type:(b==null?void 0:b.type)||"linear",label:{flush:!0},__ticksForVTable:m,__vtableChartTheme:_,__vtablePadding:f})}if(i===e.rowHeaderLevelCount-1&&t>=e.columnHeaderLevelCount&&t<e.rowCount-e.bottomFrozenRowCount){let d=e.getDimensionKeyInChartSpec(e.rowHeaderLevelCount,t);lt(d)&&(d=d[0]);const u=(n=e.dataset.collectedValues[d])!==null&&n!==void 0?n:[],c=e.getRowKeysPath(i,t),g=(o=u[c??""])!==null&&o!==void 0?o:[],{axisOption:f,theme:p,chartType:m}=Pl(i+1,t,"left",e);if((f==null?void 0:f.visible)===!1)return;const b=e._table._getCellStyle(i+1,t),C=Qt(wt("padding",b,i+1,t,e._table)),_=e.getRawChartSpec(i+1,t);return xt({domain:(f==null?void 0:f.type)==="linear"?void 0:Array.from(g),range:(f==null?void 0:f.type)==="linear"?g:void 0,title:{autoRotate:!0}},f,{orient:"left",type:(r=f==null?void 0:f.type)!==null&&r!==void 0?r:"band",__vtableChartTheme:p,inverse:z8(f,((s=_==null?void 0:_.direction)!==null&&s!==void 0?s:m==="scatter"?"vertical":"horizontal")==="horizontal"),__vtablePadding:C})}}else{if(i===e.rowHeaderLevelCount-1&&t>=e.columnHeaderLevelCount&&t<e.rowCount-e.bottomFrozenRowCount){const d=e.getIndicatorKeyInChartSpec(i,t).slice(0,2);let u=null;d==null||d.forEach(w=>{const y=e.getIndicatorInfo(w);y&&(u=y)});const c=Ir("left",i+1,t,i,t,i,t,0,e);if(!c)return;const g=e._table._getCellStyle(i+1,t),f=Qt(wt("padding",g,i+1,t,e._table)),{range:p,ticks:m,axisOption:b,isZeroAlign:C,theme:_}=c;if(C){const w=Ir("right",i+1,t,i,t,i,t,1,e);if(w){const{range:y}=w,S=Bl(p,y);S&&(p.min=S.range1[0],p.max=S.range1[1])}}return ft(b==null?void 0:b.min)&&(p.min=b.min,p.min>0&&(b.zero=!1)),ft(b==null?void 0:b.max)&&(p.max=b.max,p.max<0&&(b.zero=!1)),xt({title:{visible:!0,text:u==null?void 0:u.title,autoRotate:!0},range:p},b,{orient:"left",type:(b==null?void 0:b.type)||"linear",label:{flush:!0},__ticksForVTable:m,__vtableChartTheme:_,__vtablePadding:f})}if(i===e.colCount-e.rightFrozenColCount&&t>=e.columnHeaderLevelCount&&t<e.rowCount-e.bottomFrozenRowCount){const d=Ir("right",i-1,t,e.rowHeaderLevelCount-1,t,i,t,1,e);if(!d)return;const u=e._table._getCellStyle(i-1,t),c=Qt(wt("padding",u,i-1,t,e._table)),{range:g,ticks:f,axisOption:p,isZeroAlign:m,theme:b}=d;if(m){const C=Ir("left",i-1,t,e.rowHeaderLevelCount-1,t,i,t,0,e);if(C){const{range:_}=C,w=Bl(g,_);w&&(g.min=w.range1[0],g.max=w.range1[1])}}return ft(p==null?void 0:p.min)&&(g.min=p.min,g.min>0&&(p.zero=!1)),ft(p==null?void 0:p.max)&&(g.max=p.max,g.max<0&&(p.zero=!1)),xt({range:g,title:{autoRotate:!0}},p,{orient:"right",type:(p==null?void 0:p.type)||"linear",label:{flush:!0},__ticksForVTable:f,__vtableChartTheme:b,__vtablePadding:c})}if(t===e.rowCount-e.bottomFrozenRowCount&&i>=e.rowHeaderLevelCount&&i<e.colCount-e.rightFrozenColCount){let d=e.getDimensionKeyInChartSpec(i,e.columnHeaderLevelCount);lt(d)&&(d=d[0]);const u=(l=e.dataset.collectedValues[d])!==null&&l!==void 0?l:[],c=e.getColKeysPath(i,t),g=(a=u==null?void 0:u[c??""])!==null&&a!==void 0?a:[],{axisOption:f,isPercent:p,theme:m,chartType:b}=Pl(i,t-1,"bottom",e);if((f==null?void 0:f.visible)===!1)return;const C=e._table._getCellStyle(i,t-1),_=Qt(wt("padding",C,i,t-1,e._table));return xt({domain:(f==null?void 0:f.type)==="linear"?void 0:Array.from(g),range:(f==null?void 0:f.type)==="linear"?g:void 0},f,{orient:"bottom",type:(h=f==null?void 0:f.type)!==null&&h!==void 0?h:"band",__vtableChartTheme:m,__vtablePadding:_})}}}function Pl(i,t,e,n){var o,r;const s=n.getRawChartSpec(i,t),l=(o=s.axes)!==null&&o!==void 0?o:[];if(n._table.pivotChartAxes.forEach(a=>{l.findIndex(h=>a.orient===h.orient)===-1&&l.push(a)}),s&<(l)){const a=l.find(h=>h.orient===e);if(a){const{seriesIndex:h,seriesId:d}=a;let u,c;return z(d)&<(s.series)?u=(lt(d)?d:[d]).map(g=>{const f=s.series.findIndex(p=>p.id===g);return f>=0&&(c=s.series[f]),f}):z(h)&<(s.series)&&(u=h),{axisOption:a,isPercent:s.percent,isZeroAlign:eT(s,e,n),seriesIndice:u,theme:s.theme,chartType:(r=c==null?void 0:c.type)!==null&&r!==void 0?r:s.type}}}return{axisOption:n._table.pivotChartAxes.find(a=>a.orient===e),isPercent:!1,isZeroAlign:eT(s,e,n),theme:s.theme,chartType:s.type}}function eT(i,t,e){const n=[];let o;if(t==="left"||t==="right"?n.push("left","right"):t!=="top"&&t!=="bottom"||n.push("top","bottom"),o=i&<(i.axes)?i.axes:e._table.pivotChartAxes,lt(o)){const r=[];o.forEach(s=>{n.includes(s.orient)&&r.push(s)});for(let s=0;s<r.length;s++){const l=r[s];if(l.sync&&l.sync.zeroAlign&&l.sync.axisId&&r.find(a=>a.id===l.sync.axisId))return!0}}return!1}function lv(i,t,e,n,o){var r;if(lt(o)){const h={min:1/0,max:-1/0};for(let d=0;d<o.length;d++){const u=lv(i,t,e,n,o[d]);u&&(h.min=Math.min(h.min,u.min),h.max=Math.max(h.max,u.max))}return isFinite(h.min)&&isFinite(h.max)?h:null}let s=t==null?void 0:t[o];if(lt(s)&&(s=s[0]),!s)return null;const l=i[s],a=xt({},(r=l==null?void 0:l[n??""])!==null&&r!==void 0?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 Ir(i,t,e,n,o,r,s,l,a){const{axisOption:h,isPercent:d,isZeroAlign:u,seriesIndice:c,theme:g,chartType:f}=Pl(t,e,i,a);if((h==null?void 0:h.visible)===!1)return;const p=a.getIndicatorKeyInChartSpec(n,o).slice(0,2);let m;m=i==="top"||i==="bottom"?a.getColKeysPath(r,s):a.getRowKeysPath(r,s);const b=lv(a.dataset.collectedValues,p,u,m,c??l);if(!b)return;d&&(b.min=b.min<0?-1:0,b.max=b.max>0?1:0);const C=Bt.getFunction("getAxisDomainRangeAndLabels"),{range:_,ticks:w}=C(b.min,b.max,h,u,i==="bottom"||i==="top"?a._table.getColWidth(r)||a._table.tableNoFrameWidth:a._table.getRowHeight(s)||a._table.tableNoFrameHeight);return b.min=isNaN(_[0])?0:_[0],b.max=isNaN(_[1])?1:_[1],ft(h==null?void 0:h.min)&&(b.min=h.min,b.min>0&&(h.zero=!1)),ft(h==null?void 0:h.max)&&(b.max=h.max,b.max<0&&(h.zero=!1)),{axisOption:h,isZeroAlign:u,range:b,ticks:w,theme:g,chartType:f}}function D8(i,t,e){if(!e._table.isPivotChart())return!1;if(e.indicatorsAsCol){if(e.hasTwoIndicatorAxes&&t===e.columnHeaderLevelCount-1&&i>=e.rowHeaderLevelCount&&i<e.colCount-e.rightFrozenColCount||t===e.rowCount-e.bottomFrozenRowCount&&i>=e.rowHeaderLevelCount&&i<e.colCount-e.rightFrozenColCount)return!0}else if(t===e.rowCount-e.bottomFrozenRowCount&&i>=e.rowHeaderLevelCount&&i<e.colCount-e.rightFrozenColCount)return!0;return!1}function O8(i,t,e){if(!e._table.isPivotChart())return!1;if(e.indicatorsAsCol){if(i===e.rowHeaderLevelCount-1&&t>=e.columnHeaderLevelCount&&t<e.rowCount-e.bottomFrozenRowCount)return!0}else if(i===e.rowHeaderLevelCount-1&&t>=e.columnHeaderLevelCount&&t<e.rowCount-e.bottomFrozenRowCount||i===e.colCount-e.rightFrozenColCount&&t>=e.columnHeaderLevelCount&&t<e.rowCount-e.bottomFrozenRowCount)return!0;return!1}var iT;function z8(i,t){let e=i==null?void 0:i.inverse;return t&&!W8(i==null?void 0:i.orient)&&(e=!z(i==null?void 0:i.inverse)||!(i!=null&&i.inverse)),e}function W8(i){return i==="bottom"||i==="top"}(function(i){i.vertical="vertical",i.horizontal="horizontal"})(iT||(iT={}));function As(i,t,e,n){if(!lt(i.axes)||i.axes.length===0)return e&&n||!e&&!n;for(let o=0;o<i.axes.length;o++){const r=i.axes[o];if(!e&&n&&r.orient==="bottom"&&r.type==="linear"||e&&n&&r.orient==="bottom"&&r.type!=="linear"||!e&&!n&&r.orient==="left"&&r.type!=="linear"||e&&!n&&r.orient==="left"&&r.type==="linear")return!0}if(lt(t)&&t.length>0)for(let o=0;o<t.length;o++){const r=t[o];if(!e&&n&&r.orient==="bottom"&&r.type==="linear"||e&&n&&r.orient==="bottom"&&r.type!=="linear"||!e&&!n&&r.orient==="left"&&r.type!=="linear"||e&&!n&&r.orient==="left"&&r.type==="linear")return!0}return e&&n||!e&&!n}const N8={};function V8(i,t,e){var n,o,r,s,l,a,h,d,u;const c=e.customCellStylePlugin.getCustomCellStyle(i,t),{layoutMap:g}=e.internalProps;if(g.isHeader(i,t)){let S;if(!e.isPivotTable()||e.isBottomFrozenRow(t)||e.isRightFrozenColumn(i))S=`${i}-${t}`;else{const M=e.getHeaderDefine(i,t),B=e.isCornerHeader(i,t);S=M!=null&&M.dimensionKey?B?`dim-cor-${M.dimensionKey}`:`dim-${M.dimensionKey}`:M!=null&&M.indicatorKey?`ind-${M.indicatorKey}`:`${i}-${t}`}let A=e.headerStyleCache.get(S);if(A)return c?Hh(A,c):A;const R=g.getHeader(i,t);let x;if(e.isPivotChart()&&D8(i,t,g)&&g.isAxisCell(i,t)?x=(o=(n=g.getBody(i,e.rowHeaderLevelCount).style)===null||n===void 0?void 0:n.padding)!==null&&o!==void 0?o:e.theme.bodyStyle.padding:e.isPivotChart()&&O8(i,t,g)&&g.isAxisCell(i,t)&&(x=(s=(r=g.getBody(e.columnHeaderLevelCount,t).style)===null||r===void 0?void 0:r.padding)!==null&&s!==void 0?s:e.theme.bodyStyle.padding),(!R||R.isEmpty)&&(g.isLeftBottomCorner(i,t)||g.isRightBottomCorner(i,t)||g.isCornerHeader(i,t)||g.isRightTopCorner(i,t)))return N8;const T=e.internalProps.headerHelper.getStyleClass((R==null?void 0:R.headerType)||"text");if(g.isBottomFrozenRow(i,t)&&e.theme.bottomFrozenStyle)A=mg(x?{padding:x}:{},e.theme.bottomFrozenStyle,{col:i,row:t,table:e,value:e.getCellValue(i,t),dataValue:e.getCellOriginValue(i,t),cellHeaderPaths:e.getCellHeaderPaths(i,t)},T,e.options.autoWrapText,e.theme);else if(g.isRightFrozenColumn(i,t)&&e.theme.rightFrozenStyle)A=mg(x?{padding:x}:{},e.theme.rightFrozenStyle,{col:i,row:t,table:e,value:e.getCellValue(i,t),dataValue:e.getCellOriginValue(i,t),cellHeaderPaths:e.getCellHeaderPaths(i,t)},T,e.options.autoWrapText,e.theme);else{const M=(R==null?void 0:R.style)||{};x&&(M.padding=x),A=mg(M,g.isColumnHeader(i,t)||g.isBottomFrozenRow(i,t)?e.theme.headerStyle:g.isRowHeader(i,t)||g.isRightFrozenColumn(i,t)?e.theme.rowHeaderStyle:e.theme.cornerHeaderStyle,{col:i,row:t,table:e,value:e.getCellValue(i,t),dataValue:e.getCellOriginValue(i,t),cellHeaderPaths:e.getCellHeaderPaths(i,t)},T,e.options.autoWrapText,e.theme)}return e.headerStyleCache.set(S,A),c?Hh(A,c):A}let f,p;!((a=(l=e.internalProps)===null||l===void 0?void 0:l.dataConfig)===null||a===void 0)&&a.mappingRules&&!e.isHeader(i,t)&&((u=(d=(h=e.internalProps)===null||h===void 0?void 0:h.dataConfig)===null||d===void 0?void 0:d.mappingRules)===null||u===void 0||u.forEach((S,A)=>{S.bgColor&&e.internalProps.layoutMap.getIndicatorKey(i,t)===S.bgColor.indicatorKey&&(f=S.bgColor.mapping)}));const m=e.getCellType(i,t),b=e.getCellOriginRecord(i,t);let C;if(p=b!=null&&b.vtableMerge?"merge-title":e.isSeriesNumberInBody(i,t)?`${i}-series-`+m:e.isListTable()&&!e.transpose||e.isPivotTable()&&e.internalProps.layoutMap.indicatorsAsCol?i+m:t+m,C=b!=null&&b.vtableMerge?e.bodyMergeTitleCache.get(p):g.isBottomFrozenRow(t)?e.bodyBottomStyleCache.get(p):e.bodyStyleCache.get(p),C)return c?Hh(C,c):C;const _=g.getBody(i,t),w=e.internalProps.bodyHelper.getStyleClass(e.getCellType(i,t)),y=_==null?void 0:_.style;return C=em(y,b!=null&&b.vtableMerge&&e.theme.groupTitleStyle?e.theme.groupTitleStyle:g.isBottomFrozenRow(t)&&e.theme.bottomFrozenStyle?e.theme.bottomFrozenStyle:g.isRightFrozenColumn(i)&&e.theme.rightFrozenStyle?e.theme.rightFrozenStyle:e.theme.bodyStyle,{col:i,row:t,table:e,value:e.getCellValue(i,t),dataValue:e.getCellOriginValue(i,t),cellHeaderPaths:e.getCellHeaderPaths(i,t)},w,e.options.autoWrapText,e.theme),f&&(C=Hh(C,{bgColor:f})),ue(y)||(g.isBottomFrozenRow(t)?e.bodyBottomStyleCache.set(p,C):e.bodyStyleCache.set(p,C)),c?Hh(C,c):C}class j8 extends Dy{onUpdate(t,e,n){if(this.from.x!==this.to.x){const o=t?this.to.x:this.from.x+Math.floor((this.to.x-this.from.x)*e);this.params.table.scrollLeft=o}if(this.from.y!==this.to.y){const o=t?this.to.y:this.from.y+Math.floor((this.to.y-this.from.y)*e);this.params.table.scrollTop=o}}}class $8{constructor(t){this.table=t,this.timeline=new bp,this.ticker=new Fy,this.ticker.addTimeline(this.timeline),this.ticker.setFPS(60),this.tempGraphic=Fe({})}scrollTo(t,e){var n,o,r,s;const l={x:this.table.scrollLeft,y:this.table.scrollTop},a=this.table.getCellRect((n=t.col)!==null&&n!==void 0?n:0,(o=t.row)!==null&&o!==void 0?o:0),h={x:ft(t.col)?a.left-this.table.getFrozenColsWidth():this.table.scrollLeft,y:ft(t.row)?a.top-this.table.getFrozenRowsHeight():this.table.scrollTop},d=bi(e)?e?3e3:0:(r=e==null?void 0:e.duration)!==null&&r!==void 0?r:3e3,u=bi(e)?e?"linear":"":(s=e==null?void 0:e.easing)!==null&&s!==void 0?s:"linear";new Wo(oi.GenAutoIncrementId(),this.timeline).bind(this.tempGraphic).play(new j8(l,h,d,u,{graphic:this.tempGraphic,table:this.table})),this.ticker.start()}clear(){this.timeline.clear(),this.ticker.stop()}}const{toBoxArray:nT}=b4,{isTouchEvent:G8}=v4,U8=/^\$(\d+)\$(\d+)$/;Yz();class Cg extends th{static get EVENT_TYPE(){return at}constructor(t,e={}){var n,o,r,s,l,a,h,d,u,c;if(super(),this.showFrozenIcon=!0,this.version="1.11.1",this.id=`VTable${Date.now()}`,this.isReleased=!1,this._chartEventMap={},this.throttleInvalidate=n4(this.render.bind(this),200),!t&&e.mode!=="node"&&!e.canvas)throw new Error("vtable's container is undefined");const{frozenColCount:g=0,frozenRowCount:f,defaultRowHeight:p=40,defaultHeaderRowHeight:m,defaultColWidth:b=80,defaultHeaderColWidth:C,widthMode:_="standard",heightMode:w="standard",autoFillWidth:y=!1,autoFillHeight:S=!1,widthAdaptiveMode:A="only-body",heightAdaptiveMode:R="only-body",keyboardOptions:x,eventOptions:T,rowSeriesNumber:M,columnResizeMode:B,rowResizeMode:P="none",dragHeaderMode:F,showFrozenIcon:H,allowFrozenColCount:E,padding:k,hover:I,menu:L,select:D,customRender:O,pixelRatio:N=Ss,renderChartAsync:W,renderChartAsyncBatchCount:$,mode:U,modeParams:Y,canvasWidth:j,canvasHeight:G,overscrollBehavior:X,limitMinWidth:ht,limitMinHeight:gt,clearDOM:Ct=!0}=e;this.container=t,this.options=e,this._widthMode=_,this._heightMode=w,this._widthAdaptiveMode=A,this._heightAdaptiveMode=R,this._autoFillWidth=y,this._autoFillHeight=S,this.customRender=O,this.padding={top:0,right:0,left:0,bottom:0},k&&(typeof k=="number"?(this.padding.top=k,this.padding.left=k,this.padding.bottom=k,this.padding.right=k):(k.top&&(this.padding.top=k.top),k.bottom&&(this.padding.bottom=k.bottom),k.left&&(this.padding.left=k.left),k.right&&(this.padding.right=k.right))),z(G)&&z(j)&&(this.canvasSizeSeted=!0),this.tableNoFrameWidth=0,this.tableNoFrameHeight=0,this.canvasWidth=j,this.canvasHeight=G,this.columnWidthComputeMode=(n=e.columnWidthComputeMode)!==null&&n!==void 0?n:"normal";const Q=this.internalProps={};if(H!==void 0&&(this.showFrozenIcon=H),typeof E=="number"&&E<=0&&(this.showFrozenIcon=!1),this.options.canvas?(Q.element=this.options.canvas.parentElement,Q.element.style.position="relative",Q.focusControl=new NA(this,Q.element),Q.canvas=this.options.canvas,Q.context=Q.canvas.getContext("2d")):oe.mode!=="node"&&(Q.element=M6(this.padding),Q.focusControl=new NA(this,Q.element),Q.canvas=document.createElement("canvas"),Q.element.appendChild(Q.canvas),Q.context=Q.canvas.getContext("2d"),!((o=e.customConfig)===null||o===void 0)&&o.createReactContainer&&yN(this)),Q.handler=new mc,ft(this.options.resizeTime)&&(Q.handler.resizeTime=this.options.resizeTime),Q.pixelRatio=N,Q.frozenColCount=g,Q.frozenRowCount=f,Q.defaultRowHeight=p,Q.defaultHeaderRowHeight=m??p,Q.defaultColWidth=b,Q.defaultHeaderColWidth=C??b,Q.keyboardOptions=x,Q.eventOptions=T,Q.rowSeriesNumber=M,Q.columnResizeMode=B,Q.rowResizeMode=P,Q.dragHeaderMode=F??"none",Q.renderChartAsync=W,HR($),Q.overscrollBehavior=X??"auto",Q._rowHeightsMap=new VA(this),Q._rowRangeHeightsMap=new Map,Q._colRangeWidthsMap=new Map,Q._widthResizedColMap=new Set,Q._heightResizedRowMap=new Set,this.colWidthsMap=new Mr,this.colContentWidthsMap=new Mr,this.colWidthsLimit={},Q.calcWidthContext={_:Q,get full(){var et;return oe.mode==="node"?j/(N??1):this._.canvas.width/((et=this._.context.pixelRatio)!==null&&et!==void 0?et:window.devicePixelRatio)}},Q.cellTextOverflows={},Q.focusedTable=!1,Q.theme=Jo.of((r=e.theme)!==null&&r!==void 0?r:Jo.DEFAULT),Q.theme.isPivot=this.isPivotTable(),Hc(Q.theme.functionalIconsStyle),t?(Ct&&(t.innerHTML=""),t.appendChild(Q.element),this._updateSize()):this._updateSize(),Q.bodyHelper=new u8(this),Q.headerHelper=new w8(this),Q.rowSeriesNumberHelper=new S8(this),Q.autoWrapText=e.autoWrapText,Q.enableLineBreak=e.enableLineBreak,Q.allowFrozenColCount=(s=e.allowFrozenColCount)!==null&&s!==void 0?s:0,Q.limitMaxAutoWidth=(l=e.limitMaxAutoWidth)!==null&&l!==void 0?l:450,Q.limitMinWidth=ht!=null?typeof ht=="number"?ht:ht?10:0:10,Q.limitMinHeight=gt!=null?typeof gt=="number"?gt:gt?10:0:10,this.scenegraph=new QN(this),this.stateManager=new V5(this),this.eventManager=new a8(this),this.animationManager=new $8(this),e.legends){Q.legends=[];const et=Bt.getFunction("createLegend");if(Array.isArray(e.legends)){for(let vt=0;vt<e.legends.length;vt++)Q.legends.push(et(e.legends[vt],this));this.scenegraph.tableGroup.setAttributes({x:this.tableX,y:this.tableY})}else Q.legends.push(et(e.legends,this)),this.scenegraph.tableGroup.setAttributes({x:this.tableX,y:this.tableY})}if(Q.tooltip=Object.assign({parentElement:this.getElement(),renderMode:"html",isShowOverflowTextTooltip:!1,confine:!0},e.tooltip),Q.tooltip.renderMode==="html"){const et=Bt.getComponent("tooltipHandler");et&&(Q.tooltipHandler=new et(this,Q.tooltip.confine))}if(Q.menu=Object.assign({renderMode:"html"},e.menu),Array.isArray((a=e.menu)===null||a===void 0?void 0:a.dropDownMenuHighlight)&&this.setDropDownMenuHighlight((h=e.menu)===null||h===void 0?void 0:h.dropDownMenuHighlight),Array.isArray((d=e.menu)===null||d===void 0?void 0:d.defaultHeaderMenuItems)&&(this.globalDropDownMenu=e.menu.defaultHeaderMenuItems),Q.menu.renderMode==="html"){const et=Bt.getComponent("menuHandler");Q.menuHandler=new et(this)}this.headerStyleCache=new Map,this.bodyStyleCache=new Map,this.bodyMergeTitleCache=new Map,this.bodyBottomStyleCache=new Map,Q.stick={changedCells:new Map},Q.customMergeCell=e.customMergeCell,this.customCellStylePlugin=new x8(this,(u=e.customCellStyle)!==null&&u!==void 0?u:[],(c=e.customCellStyleArrangement)!==null&&c!==void 0?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(),(t=this.internalProps.legends)===null||t===void 0||t.forEach(e=>{e==null||e.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(t=this.internalProps.colCount)!==null&&t!==void 0?t:0}set colCount(t){this.internalProps.colCount=t}get frozenColCount(){var t,e,n,o,r;return(r=(n=(e=(t=this.internalProps)===null||t===void 0?void 0:t.layoutMap)===null||e===void 0?void 0:e.frozenColCount)!==null&&n!==void 0?n:(o=this.internalProps)===null||o===void 0?void 0:o.frozenColCount)!==null&&r!==void 0?r: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,n,o,r;return(r=(n=(e=(t=this.internalProps)===null||t===void 0?void 0:t.layoutMap)===null||e===void 0?void 0:e.frozenRowCount)!==null&&n!==void 0?n:(o=this.internalProps)===null||o===void 0?void 0:o.frozenRowCount)!==null&&r!==void 0?r:0}set frozenRowCount(t){this.internalProps.frozenRowCount=t}get rightFrozenColCount(){var t,e,n,o,r;return(r=(n=(e=(t=this.internalProps)===null||t===void 0?void 0:t.layoutMap)===null||e===void 0?void 0:e.rightFrozenColCount)!==null&&n!==void 0?n:(o=this.internalProps)===null||o===void 0?void 0:o.rightFrozenColCount)!==null&&r!==void 0?r:0}set rightFrozenColCount(t){this.scenegraph.dealWidthRightFrozen(t)}get bottomFrozenRowCount(){var t,e,n,o,r;return(r=(n=(e=(t=this.internalProps)===null||t===void 0?void 0:t.layoutMap)===null||e===void 0?void 0:e.bottomFrozenRowCount)!==null&&n!==void 0?n:(o=this.internalProps)===null||o===void 0?void 0:o.bottomFrozenRowCount)!==null&&r!==void 0?r: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(t=this.internalProps.keyboardOptions)!==null&&t!==void 0?t:null}set keyboardOptions(t){this.internalProps.keyboardOptions=t??void 0}get eventOptions(){var t;return(t=this.internalProps.eventOptions)!==null&&t!==void 0?t:null}set eventOptions(t){this.internalProps.eventOptions=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 t==="auto"?0:ah(this,t)}_getColWidthLimits(t){const e=this.colWidthsLimit[t];if(!e)return null;const n={};return e.min&&(n.min=ah(this,e.min),n.minDef=e.min),e.max&&(n.max=ah(this,e.max),n.maxDef=e.max),n}_adjustColWidth(t,e){const n=this._getColWidthLimits(t);return Math.max(L6(n,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 n;return oe.mode==="node"?e/(t??1):this._.canvas.width/((n=this._.context.pixelRatio)!==null&&n!==void 0?n:window.devicePixelRatio)}},this.scenegraph.setPixelRatio(t)}}_updateSize(){var t,e,n,o,r,s,l,a,h,d,u,c,g,f,p,m,b,C,_,w,y,S,A,R,x,T;const{padding:M}=this;let B=0,P=0;if(this.tableX=0,this.tableY=0,this.options.canvas&&this.options.viewBox)B=this.options.viewBox.x2-this.options.viewBox.x1,P=this.options.viewBox.y2-this.options.viewBox.y1,!((t=this==null?void 0:this.scenegraph)===null||t===void 0)&&t.stage&&(this.options.viewBox?this.scenegraph.stage.setViewBox(this.options.viewBox,!1):this.scenegraph.stage.resize(B,P));else if(oe.mode==="browser"){const E=this.getElement();let k=0,I=0;if(this.canvasSizeSeted)k=this.canvasWidth,I=this.canvasHeight;else if(E.parentElement){const N=E.parentElement.style||window.getComputedStyle(E.parentElement);k=E.parentElement.offsetWidth-parseInt(N.paddingLeft||"0px",10)-parseInt(N.paddingRight||"0px",10),I=E.parentElement.offsetHeight-parseInt(N.paddingTop||"0px",10)-parseInt(N.paddingBottom||"0px",20)}const L=k??0,D=I??0;E.style.width=L&&L-M.left-M.right+"px"||"0px",E.style.height=D&&D-M.top-M.bottom+"px"||"0px";const{canvas:O}=this.internalProps;B=(n=(e=O.parentElement)===null||e===void 0?void 0:e.offsetWidth)!==null&&n!==void 0?n:0,P=(r=(o=O.parentElement)===null||o===void 0?void 0:o.offsetHeight)!==null&&r!==void 0?r:0,!((s=this==null?void 0:this.scenegraph)===null||s===void 0)&&s.stage?this.scenegraph.stage.resize(B,P):(O.style.width="",O.style.height="",O.width=B,O.height=P,O.style.width=`${B}px`,O.style.height=`${P}px`)}else oe.mode==="node"&&(B=this.canvasWidth-1,P=this.canvasHeight-1);const F=Math.floor(B-qz(this.getTheme().scrollStyle)),H=Math.floor(P-Xz(this.getTheme().scrollStyle));if(!((l=this.internalProps.theme)===null||l===void 0)&&l.frameStyle){const E=nT((h=(a=this.internalProps.theme.frameStyle)===null||a===void 0?void 0:a.borderLineWidth)!==null&&h!==void 0?h:[null]),k=nT((u=(d=this.internalProps.theme.frameStyle)===null||d===void 0?void 0:d.shadowBlur)!==null&&u!==void 0?u:[0]);!((c=this.theme.frameStyle)===null||c===void 0)&&c.innerBorder?(this.tableX=0,this.tableY=0,this.tableNoFrameWidth=F-((g=k[1])!==null&&g!==void 0?g:0),this.tableNoFrameHeight=H-((f=k[2])!==null&&f!==void 0?f:0)):(this.tableX=((p=E[3])!==null&&p!==void 0?p:0)+((m=k[3])!==null&&m!==void 0?m:0),this.tableY=((b=E[0])!==null&&b!==void 0?b:0)+((C=k[0])!==null&&C!==void 0?C:0),this.tableNoFrameWidth=F-(((_=E[1])!==null&&_!==void 0?_:0)+((w=k[1])!==null&&w!==void 0?w:0))-(((y=E[3])!==null&&y!==void 0?y:0)+((S=k[3])!==null&&S!==void 0?S:0)),this.tableNoFrameHeight=H-(((A=E[0])!==null&&A!==void 0?A:0)+((R=k[0])!==null&&R!==void 0?R:0))-(((x=E[2])!==null&&x!==void 0?x:0)+((T=k[2])!==null&&T!==void 0?T:0)))}}updateViewBox(t){var e,n,o,r,s,l,a,h;const d=(r=(n=(e=this.options)===null||e===void 0?void 0:e.viewBox.x2)!==null&&n!==void 0?n:0-((o=this.options)===null||o===void 0?void 0:o.viewBox.x1))!==null&&r!==void 0?r:0,u=(h=(l=(s=this.options)===null||s===void 0?void 0:s.viewBox.y2)!==null&&l!==void 0?l:0-((a=this.options)===null||a===void 0?void 0:a.viewBox.y1))!==null&&h!==void 0?h:0,c=t.x2-t.x1,g=t.y2-t.y1;this.options.viewBox=t,d!==c||u!==g?this.resize():this.scenegraph.stage.setViewBox(this.options.viewBox,!0)}setViewBoxTransform(t,e,n,o,r,s){this.internalProps.modifiedViewBoxTransform=!0,this.scenegraph.stage.window.setViewBoxTransform(t,e,n,o,r,s)}get rowHierarchyType(){return"grid"}getColsWidth(t,e){var n;if(t>e)return 0;t=Math.max(t,0),e=Math.min(e,((n=this.colCount)!==null&&n!==void 0?n:1/0)-1);const o=this._colRangeWidthsMap.get(`$${t}$${e}`);if(o!=null)return o;const r=this._colRangeWidthsMap.get(`$${t}$${e-1}`);if(r!=null){const l=r+this.getColWidth(e);return t>=0&&e>=0&&!Number.isNaN(l)&&this._colRangeWidthsMap.set(`$${t}$${e}`,Math.round(l)),Math.round(l)}let s=0;for(let l=t;l<=e;l++)s+=this.getColWidth(l);return t>=0&&e>=0&&this._colRangeWidthsMap.set(`$${t}$${e}`,Math.round(s)),Math.round(s)}getRowHeight(t){var e;if(z(this.rowHeightsMap.get(t))){if(!((e=this.options.customConfig)===null||e===void 0)&&e._disableColumnAndRowSizeRound){const o=this.rowHeightsMap.get(t);let r;return r=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),r=Number(r.toFixed(2)),Number.isInteger(r)?Math.ceil(o):Math.floor(o)}return this.rowHeightsMap.get(t)}const n=this.getDefaultRowHeight(t);return ft(n)?n:this.defaultRowHeight}getDefaultColumnWidth(t){var e,n;return this.isRowHeader(t,0)||this.isCornerHeader(t,0)?Array.isArray(this.defaultHeaderColWidth)?(e=this.defaultHeaderColWidth[t])!==null&&e!==void 0?e:this.defaultColWidth:this.defaultHeaderColWidth:this.isRightFrozenColumn(t,this.columnHeaderLevelCount)&&this.isPivotTable()?Array.isArray(this.defaultHeaderColWidth)?(n=this.defaultHeaderColWidth[this.rowHeaderLevelCount-this.rightFrozenColCount])!==null&&n!==void 0?n:this.defaultColWidth:this.defaultHeaderColWidth:this.defaultColWidth}getDefaultRowHeight(t){var e,n;return this.isColumnHeader(0,t)||this.isCornerHeader(0,t)||this.isSeriesNumberInHeader(0,t)?Array.isArray(this.defaultHeaderRowHeight)?(e=this.defaultHeaderRowHeight[t])!==null&&e!==void 0?e:this.internalProps.defaultRowHeight:this.defaultHeaderRowHeight:this.isBottomFrozenRow(t)?Array.isArray(this.defaultHeaderRowHeight)?(n=this.defaultHeaderRowHeight[this.columnHeaderLevelCount>0?this.columnHeaderLevelCount-this.bottomFrozenRowCount:0])!==null&&n!==void 0?n:this.internalProps.defaultRowHeight:this.defaultHeaderRowHeight:this.internalProps.defaultRowHeight}_setRowHeight(t,e,n){var o;this.rowHeightsMap.put(t,!((o=this.options.customConfig)===null||o===void 0)&&o._disableColumnAndRowSizeRound?e:Math.round(e)),n&&this._clearRowRangeHeightsMap(t)}setRowHeight(t,e){this.scenegraph.setRowHeight(t,e),this.scenegraph.updateChartSizeForResizeRowHeight(t),this.internalProps._heightResizedRowMap.add(t)}getRowsHeight(t,e){var n,o;if(t>e||this.rowCount===0)return 0;t=Math.max(t,0),e=Math.min(e,((n=this.rowCount)!==null&&n!==void 0?n:1/0)-1);let r=0;if(this.heightMode!=="standard"||this.autoFillHeight||!this.internalProps.layoutMap||this.hasAutoImageColumn()||this.internalProps._heightResizedRowMap.size!==0){if(!((o=this.options.customConfig)===null||o===void 0)&&o._disableColumnAndRowSizeRound){const s=this.rowHeightsMap.getSumInRange(t,e);let l;return l=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),l=Number(l.toFixed(2)),Number.isInteger(l)?Math.ceil(s):Math.floor(s)}r=this.rowHeightsMap.getSumInRange(t,e)}else{for(let s=t;s<Math.min(e+1,this.columnHeaderLevelCount);s++)r+=this.getRowHeight(s);e>=this.columnHeaderLevelCount&&(r+=this.defaultRowHeight*(Math.min(e,this.rowCount-this.bottomFrozenRowCount-1)-Math.max(this.columnHeaderLevelCount,t)+1));for(let s=this.rowCount-this.bottomFrozenRowCount;s<e+1;s++)r+=this.getRowHeight(s)}return Math.round(r)}getColWidthDefined(t){var e;const{layoutMap:n}=this.internalProps;if(this.widthMode==="autoWidth")return"auto";const{width:o}=(e=n==null?void 0:n.getColumnWidthDefined(t))!==null&&e!==void 0?e:{};return typeof o=="number"&&o<=0?0:o||this.getDefaultColumnWidth(t)}getColWidthDefinedNumber(t){const e=this.getColWidthDefined(t);return this._adjustColWidth(t,this._colWidthDefineToPxWidth(e))}isAutoRowHeight(t){return this.heightMode==="autoHeight"||t>=0&&t<this.columnHeaderLevelCount&&this.getDefaultRowHeight(t)==="auto"}getColWidth(t){var e;const n=(e=this.colWidthsMap.get(t))!==null&&e!==void 0?e:this.getDefaultColumnWidth(t);return this.widthMode==="adaptive"&&typeof n=="number"||this.transpose&&typeof n=="number"?this._colWidthDefineToPxWidth(n):this._adjustColWidth(t,this._colWidthDefineToPxWidth(n))}_setColWidth(t,e,n,o){this.colWidthsMap.put(t,typeof e=="number"?Math.round(e):e),n&&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(typeof t!="number")this._colRangeWidthsMap.clear();else{const e=this._colRangeWidthsMap.keys();for(const n of e){const o=U8.exec(n);if(o){const r=Number(o[1]),s=Number(o[2]);t>=r&&t<=s&&this._colRangeWidthsMap.delete(n)}}}}_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 n=this.colWidthsLimit[t];let o=(e=n&&n.max)!==null&&e!==void 0?e:1/0;return typeof o=="string"&&(o=ah(this,o)),o}setMaxColWidth(t,e){(this.colWidthsLimit[t]||(this.colWidthsLimit[t]={})).max=e}getMinColWidth(t){var e;const n=this.colWidthsLimit[t];let o=(e=n&&n.min)!==null&&e!==void 0?e:0;return typeof o=="string"&&(o=ah(this,o)),o}setMinColWidth(t,e){(this.colWidthsLimit[t]||(this.colWidthsLimit[t]={})).min=e}getCellRect(t,e){var n,o;const r=this.isFrozenCell(t,e);let s;const l=this.getColWidth(t);let a;s=r&&r.col&&this.isRightFrozenColumn(t,e)?this.getAllColsWidth()<=this.tableNoFrameWidth?this.getColsWidth(0,t-1)||0:this.tableNoFrameWidth-((n=this.getColsWidth(t,this.colCount-1))!==null&&n!==void 0?n:0):this.getColsWidth(0,t-1)||0;const h=this.getRowHeight(e);return a=r&&r.row&&this.isBottomFrozenRow(t,e)?this.getAllRowsHeight()<=this.tableNoFrameHeight?this.getRowsHeight(0,e-1):this.tableNoFrameHeight-((o=this.getRowsHeight(e,this.rowCount-1))!==null&&o!==void 0?o:0):this.getRowsHeight(0,e-1),new gs(Math.round(s),Math.round(a),Math.round(l),Math.round(h))}getMergeCellRect(t,e){const n=this.getCellRange(t,e),o=this.getColsWidth(0,n.start.col-1)||0,r=this.getColsWidth(n.start.col,n.end.col),s=this.getRowsHeight(0,n.start.row-1)||0,l=this.getRowsHeight(n.start.row,n.end.row);return new gs(Math.round(o),Math.round(s),Math.round(r),Math.round(l))}getCellRelativeRect(t,e){const n=this.isFrozenCell(t,e);let o=!0,r=!0;n!=null&&n.col&&(n!=null&&n.row)?(o=!1,r=!1):n!=null&&n.col?o=!1:n!=null&&n.row&&(r=!1);const s=this.getCellRect(t,e);return this._toRelativeRect(s,o,r)}getCellRangeRelativeRect(t){if(t.start){const s=this.isFrozenCell(t.start.col,t.start.row);let l=!0,a=!0;return s!=null&&s.col&&(s!=null&&s.row)?(l=!1,a=!1):s!=null&&s.col?l=!1:s!=null&&s.row&&(a=!1),this._toRelativeRect(this.getCellsRect(t.start.col,t.start.row,t.end.col,t.end.row),l,a)}const e=this.getCellRange(t.col,t.row),n=this.isFrozenCell(t.col,t.row);let o=!0,r=!0;return n!=null&&n.col&&(n!=null&&n.row)?(o=!1,r=!1):n!=null&&n.col?o=!1:n!=null&&n.row&&(r=!1),this._toRelativeRect(this.getCellsRect(e.start.col,e.start.row,e.end.col,e.end.row),o,r)}getVisibleCellRangeRelativeRect(t){let e;return e=t.start?t:this.getCellRange(t.col,t.row),this._getVisiableRect(this.getCellRangeRelativeRect(t),e)}_getVisiableRect(t,e){const n=e.start.col>=this.frozenColCount?Math.max(t.left,this.frozenColCount>=1?this.getColsWidth(0,this.frozenColCount-1):0):t.left,o=Math.min(t.right,this.tableNoFrameWidth),r=t.copy();r.left=n,r.right=o;const s=e.start.row>=this.frozenRowCount?Math.max(t.top,this.frozenRowCount>=1?this.getRowsHeight(0,this.frozenRowCount-1):0):t.top,l=Math.min(t.bottom,this.tableNoFrameHeight);return r.top=s,r.bottom=l,r}getCellsRect(t,e,n,o){var r,s,l,a,h,d;let u=this.getColsWidth(0,t-1)||0,c=this.getColsWidth(t,n);const g=this.scrollLeft;this.isLeftFrozenColumn(t)&&this.isRightFrozenColumn(n)?c=this.tableNoFrameWidth-((r=this.getColsWidth(t+1,this.colCount-1))!==null&&r!==void 0?r:0)-u:this.isLeftFrozenColumn(t)&&!this.isLeftFrozenColumn(n)?c=Math.max(c-g,this.getColsWidth(t,this.frozenColCount-1)):!this.isRightFrozenColumn(t)&&this.isRightFrozenColumn(n)?(u=Math.min(u-g,this.tableNoFrameWidth-this.getRightFrozenColsWidth()),c=this.tableNoFrameWidth-((s=this.getColsWidth(t+1,this.colCount-1))!==null&&s!==void 0?s:0)-u):this.isRightFrozenColumn(t)&&(u=this.tableNoFrameWidth-((l=this.getColsWidth(t,this.colCount-1))!==null&&l!==void 0?l:0));let f=this.getRowsHeight(0,e-1),p=this.getRowsHeight(e,o);const m=this.scrollTop;return this.isTopFrozenRow(e)&&this.isBottomFrozenRow(o)?p=this.tableNoFrameHeight-((a=this.getRowsHeight(e+1,this.rowCount-1))!==null&&a!==void 0?a:0)-f:this.isTopFrozenRow(e)&&!this.isTopFrozenRow(o)?p=Math.max(p-m,this.getRowsHeight(e,this.frozenRowCount-1)):!this.isBottomFrozenRow(e)&&this.isBottomFrozenRow(o)?(f=Math.min(f-m,this.tableNoFrameHeight-this.getBottomFrozenRowsHeight()),p=this.tableNoFrameHeight-((h=this.getRowsHeight(e+1,this.rowCount-1))!==null&&h!==void 0?h:0)-f):this.isBottomFrozenRow(e)&&(f=this.tableNoFrameHeight-((d=this.getRowsHeight(e,this.rowCount-1))!==null&&d!==void 0?d:0)),new gs(Math.round(u),Math.round(f),Math.round(c),Math.round(p))}getCellsRectWidth(t,e,n,o){const r=this.isFrozenCell(t,e),s=this.isFrozenCell(n,o);let l=this.getColsWidth(t,n);if(r&&r.col){const a=this.scrollLeft;s&&s.col||(l-=a,l=Math.max(l,this.getColsWidth(t,this.frozenColCount-1)))}return l}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 n=this.isFrozenRow(e),o=this.isFrozenColumn(t);return n||o?{row:n,col:o}:null}getRowAt(t){return GA(t,this)}getColAt(t){return UA(t,this)}getCellAt(t,e){return E8(t,e,this)}getCellAtRelativePosition(t,e){return F8(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 n=this.isFrozenCell(t,e);if(n&&n.col&&n.row)return;const o=this.getCellRect(t,e),r=k6(this);if(r.contains(o))return;n&&n.col||this.getColsWidth(0,this.frozenColCount-1)+o.width>this.canvas.width||(o.left<r.left?this.scrollLeft-=r.left-o.left:r.right<o.right&&(this.scrollLeft-=r.right-o.right)),n&&n.row||this.getRowsHeight(0,this.frozenRowCount-1)+o.height>this.canvas.height||(o.top<r.top?this.scrollTop-=r.top-o.top:r.bottom<o.bottom&&(this.scrollTop-=r.bottom-o.bottom))}}render(){this.scenegraph.renderSceneGraph()}renderAsync(){return this.scenegraph.updateNextFrame(),new Promise((t,e)=>{setTimeout(()=>{t()},0)})}_toRelativeRect(t,e=!0,n=!0){var o,r,s,l;const a=t.copy(),h=this.getVisibleRect();return a.offsetLeft(this.tableX-(e?h.left:0)),a.offsetTop(this.tableY-(n?h.top:0)),a.offsetLeft((r=(o=this.options.viewBox)===null||o===void 0?void 0:o.x1)!==null&&r!==void 0?r:0),a.offsetTop((l=(s=this.options.viewBox)===null||s===void 0?void 0:s.y1)!==null&&l!==void 0?l:0),a}getVisibleRect(){const{scrollTop:t,scrollLeft:e}=this,n=this.tableNoFrameWidth,o=this.tableNoFrameHeight;return new gs(e,t,n,o)}get visibleRowCount(){const{frozenRowCount:t}=this,e=this.getVisibleRect(),n=t>0?e.top+this.getRowsHeight(0,t-1):e.top,o=this.getTargetRowAt(n);if(!o)return 0;const r=Math.max(o.top>=n?o.row:o.row+1,t);let s=this.getRowsHeight(0,r-1),l=0;const{rowCount:a}=this;for(let h=r;h<a;h++){const d=s+this.getRowHeight(h);if(e.bottom<d)break;l++,s=d}return l}getBodyVisibleCellRange(){const{scrollTop:t,scrollLeft:e}=this,n=this.getFrozenRowsHeight(),o=this.getFrozenColsWidth(),r=this.getBottomFrozenRowsHeight(),s=this.getRightFrozenColsWidth(),{row:l}=this.getRowAt(t+n+1),{col:a}=this.getColAt(e+o+1),h=this.getAllRowsHeight()>this.tableNoFrameHeight?this.getRowAt(t+this.tableNoFrameHeight-1-r).row:this.rowCount-1,d=this.getAllColsWidth()>this.tableNoFrameWidth?this.getColAt(e+this.tableNoFrameWidth-1-s).col:this.colCount-1;return d<0||h<0?null:{rowStart:l,colStart:a,rowEnd:h,colEnd:d}}getBodyVisibleRowRange(){const{scrollTop:t}=this,e=this.getFrozenRowsHeight(),n=this.getBottomFrozenRowsHeight(),{row:o}=this.getRowAt(t+e+1),r=this.getAllRowsHeight()>this.tableNoFrameHeight?this.getRowAt(t+this.tableNoFrameHeight-1-n).row:this.rowCount-1;return r<0?null:{rowStart:o,rowEnd:r}}getBodyVisibleColRange(){const{scrollLeft:t}=this,e=this.getFrozenColsWidth(),n=this.getRightFrozenColsWidth(),{col:o}=this.getColAt(t+e+1),r=this.getAllColsWidth()>this.tableNoFrameWidth?this.getColAt(t+this.tableNoFrameWidth-1-n).col:this.colCount-1;return r<0?null:{colStart:o,colEnd:r}}get visibleColCount(){const{frozenColCount:t}=this,e=this.getVisibleRect(),n=t>0?e.left+this.getColsWidth(0,t-1):e.left,o=this.getTargetColAt(n);if(!o)return 0;const r=Math.max(o.left>=n?o.col:o.col+1,t);let s=this.getColsWidth(0,r-1),l=0;const{colCount:a}=this;for(let h=r;h<a;h++){const d=s+this.getColWidth(h);if(e.right<d)break;l++,s=d}return l}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||typeof t.release!="function")throw new Error("not releaseObj!");(this.internalProps.releaseList=this.internalProps.releaseList||[]).push(t)}dispose(){this.release()}release(){var t,e,n,o,r,s,l,a,h,d,u,c,g,f,p,m;const b=this.internalProps;if(this.isReleased)return;(e=(t=b.tooltipHandler)===null||t===void 0?void 0:t.release)===null||e===void 0||e.call(t),(o=(n=b.menuHandler)===null||n===void 0?void 0:n.release)===null||o===void 0||o.call(n),eR.clearAll(),(r=super.release)===null||r===void 0||r.call(this),(l=(s=b.handler)===null||s===void 0?void 0:s.release)===null||l===void 0||l.call(s),this.eventManager.release(),(h=(a=b.focusControl)===null||a===void 0?void 0:a.release)===null||h===void 0||h.call(a),(d=b.legends)===null||d===void 0||d.forEach(_=>{_==null||_.release()}),(u=b.title)===null||u===void 0||u.release(),b.title=null,(c=b.emptyTip)===null||c===void 0||c.release(),b.emptyTip=null,b.layoutMap.release(),b.releaseList&&(b.releaseList.forEach(_=>{var w;return(w=_==null?void 0:_.release)===null||w===void 0?void 0:w.call(_)}),b.releaseList=null),this.scenegraph.stage.release(),this.scenegraph.proxy.release(),b.focusControl.release();const{parentElement:C}=b.element;C&&!this.options.canvas&&C.removeChild(b.element),(p=(f=(g=this.editorManager)===null||g===void 0?void 0:g.editingEditor)===null||f===void 0?void 0:f.onEnd)===null||p===void 0||p.call(f),this.isReleased=!0,this.scenegraph=null,this.internalProps=null,(m=this.reactCustomLayout)===null||m===void 0||m.clearCache()}fireListeners(t,e){return super.fireListeners(t,e)}updateOption(t){var e,n,o,r,s,l,a,h,d,u,c,g;this.options=t,this._hasAutoImageColumn=void 0;const{frozenColCount:f=0,defaultRowHeight:p=40,defaultHeaderRowHeight:m,defaultColWidth:b=80,defaultHeaderColWidth:C=80,keyboardOptions:_,eventOptions:w,rowSeriesNumber:y,columnResizeMode:S,rowResizeMode:A="none",dragHeaderMode:R,showFrozenIcon:x,allowFrozenColCount:T,padding:M,hover:B,menu:P,select:F,pixelRatio:H,widthMode:E,heightMode:k,autoFillWidth:I,autoFillHeight:L,widthAdaptiveMode:D,heightAdaptiveMode:O,customRender:N,renderChartAsync:W,renderChartAsyncBatchCount:$,overscrollBehavior:U,limitMinWidth:Y,limitMinHeight:j}=t;H&&H!==this.internalProps.pixelRatio&&(this.internalProps.pixelRatio=H),M&&(typeof M=="number"?(this.padding.top=M,this.padding.left=M,this.padding.bottom=M,this.padding.right=M):(M.top&&(this.padding.top=M.top),M.bottom&&(this.padding.bottom=M.bottom),M.left&&(this.padding.left=M.left),M.right&&(this.padding.right=M.right))),this.showFrozenIcon=typeof x!="boolean"||x,typeof T=="number"&&T<=0&&(this.showFrozenIcon=!1),this.widthMode=E??"standard",this.heightMode=k??"standard",this._widthAdaptiveMode=D??"only-body",this._heightAdaptiveMode=O??"only-body",this.autoFillWidth=I!=null&&I,this.autoFillHeight=L!=null&&L,this.customRender=N;const G=this.internalProps;if(oe.mode==="node"||t.canvas||B6(G.element,this.padding),this.columnWidthComputeMode=(e=t.columnWidthComputeMode)!==null&&e!==void 0?e:"normal",G.frozenColCount=f,G.defaultRowHeight=p,G.defaultHeaderRowHeight=m??p,G.defaultColWidth=b,G.defaultHeaderColWidth=C??b,G.keyboardOptions=_,G.eventOptions=w,G.rowSeriesNumber=y,G.columnResizeMode=S,G.rowResizeMode=A,G.dragHeaderMode=R??"none",G.renderChartAsync=W,HR($),G.overscrollBehavior=U??"auto",G.cellTextOverflows={},G._rowHeightsMap=new VA(this),G._rowRangeHeightsMap=new Map,G._colRangeWidthsMap=new Map,G._widthResizedColMap=new Set,G._heightResizedRowMap=new Set,this.colWidthsMap=new Mr,this.colContentWidthsMap=new Mr,this.colWidthsLimit={},G.stick.changedCells.clear(),G.theme=Jo.of((n=t.theme)!==null&&n!==void 0?n:Jo.DEFAULT),G.theme.isPivot=this.isPivotTable(),Hc(G.theme.functionalIconsStyle),this.scenegraph.updateStageBackground(),G.autoWrapText=t.autoWrapText,G.enableLineBreak=t.enableLineBreak,G.allowFrozenColCount=(o=t.allowFrozenColCount)!==null&&o!==void 0?o:0,G.limitMaxAutoWidth=(r=t.limitMaxAutoWidth)!==null&&r!==void 0?r:450,G.limitMinWidth=Y!=null?typeof Y=="number"?Y:Y?10:0:10,G.limitMinHeight=j!=null?typeof j=="number"?j:j?10:0:10,(s=G.legends)===null||s===void 0||s.forEach(X=>{X==null||X.release()}),(l=G.title)===null||l===void 0||l.release(),G.title=null,(a=G.emptyTip)===null||a===void 0||a.release(),G.emptyTip=null,G.layoutMap.release(),this.scenegraph.clearCells(),this.scenegraph.updateComponent(),this.stateManager.updateOptionSetState(),this._updateSize(),this.eventManager.updateEventBinder(),t.legends){G.legends=[];const X=Bt.getFunction("createLegend");if(Array.isArray(t.legends)){for(let ht=0;ht<t.legends.length;ht++)G.legends.push(X(t.legends[ht],this));this.scenegraph.tableGroup.setAttributes({x:this.tableX,y:this.tableY})}else G.legends.push(X(t.legends,this)),this.scenegraph.tableGroup.setAttributes({x:this.tableX,y:this.tableY})}if(G.tooltip=Object.assign({parentElement:this.getElement(),renderMode:"html",isShowOverflowTextTooltip:!1,confine:!0},t.tooltip),G.tooltip.renderMode==="html"&&!G.tooltipHandler){const X=Bt.getComponent("tooltipHandler");G.tooltipHandler=new X(this,G.tooltip.confine)}if(G.menu=Object.assign({renderMode:"html"},t.menu),Array.isArray((h=t.menu)===null||h===void 0?void 0:h.dropDownMenuHighlight)&&this.setDropDownMenuHighlight((d=t.menu)===null||d===void 0?void 0:d.dropDownMenuHighlight),Array.isArray((u=t.menu)===null||u===void 0?void 0:u.defaultHeaderMenuItems)&&(this.globalDropDownMenu=t.menu.defaultHeaderMenuItems),G.menu.renderMode==="html"&&!G.menuHandler){const X=Bt.getComponent("menuHandler");G.menuHandler=new X(this)}this.clearCellStyleCache(),this.clearColWidthCache(),this.clearRowHeightCache(),G.customMergeCell=t.customMergeCell,this.customCellStylePlugin.updateCustomCell((c=t.customCellStyle)!==null&&c!==void 0?c:[],(g=t.customCellStyleArrangement)!==null&&g!==void 0?g:[])}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 gs(this.tableX,this.tableY,t,e)}_getMouseAbstractPoint(t,e=!0){var n,o,r,s;let l;if(!t)return{inTable:!1,x:void 0,y:void 0};l=G8(t)?t.changedTouches[0]:t;const a=l.clientX||l.pageX+window.scrollX,h=l.clientY||l.pageY+window.scrollY,d=this.internalProps.canvas.getBoundingClientRect();let u=!0;d.right<=a&&(u=!1),d.bottom<=h&&(u=!1);const c=d.width,g=c/(this.canvas.offsetWidth||c),f=d.height,p=f/(this.canvas.offsetHeight||f),m={x:(a-d.left)/g+(e?this.scrollLeft:0)-((o=(n=this.options.viewBox)===null||n===void 0?void 0:n.x1)!==null&&o!==void 0?o:0),y:(h-d.top)/p+(e?this.scrollTop:0)-((s=(r=this.options.viewBox)===null||r===void 0?void 0:r.y1)!==null&&s!==void 0?s:0),inTable:u};return this.internalProps.modifiedViewBoxTransform&&this.scenegraph.stage.window.getViewBoxTransform()&&this.scenegraph.stage.window.getViewBoxTransform().transformPoint(m,m),m}getTheme(){return this.internalProps.theme}getTargetColAt(t){return rv(t,this)}getTargetRowAt(t){const e=sv(t,this);return e&&(e.row=Math.min(e.row,this.rowCount-1)),e}getTargetColAtConsiderRightFrozen(t,e){return KA(t,e,this)}getTargetRowAtConsiderBottomFrozen(t,e){return YA(t,e,this)}clearSelected(){this.stateManager.updateSelectPos(-1,-1)}selectCell(t,e,n,o,r=!0,s=!1,l=!1){var a;const h=!!(!((a=this.stateManager.select.ranges)===null||a===void 0)&&a.length);this.stateManager.updateSelectPos(t,e,n,o,!1,!r,s,l),this.stateManager.endSelectCells(!0,h)}selectCells(t){const{scrollLeft:e,scrollTop:n}=this;t.forEach((o,r)=>{o.start.col===o.end.col&&o.start.row===o.end.row?this.stateManager.updateSelectPos(o.start.col,o.start.row,!1,r>=1,!1,!1,!0):(this.stateManager.updateSelectPos(o.start.col,o.start.row,!1,r>=1,!1,!1,!0),this.stateManager.updateInteractionState($t.grabing),this.stateManager.updateSelectPos(o.end.col,o.end.row,!1,r>=1,!1,!1,!0)),this.stateManager.endSelectCells(!1,!1),this.stateManager.updateInteractionState($t.default)}),this.setScrollTop(n),this.setScrollLeft(e)}get recordsCount(){var t;return(t=this.records)===null||t===void 0?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(),wm(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=Jo.of(t??Jo.DEFAULT),this.internalProps.theme.isPivot=this.isPivotTable(),this.options.theme=t,Hc(this.internalProps.theme.functionalIconsStyle)}updateTheme(t){const e={col:this.stateManager.hover.cellPos.col,row:this.stateManager.hover.cellPos.row};this.internalProps.theme=Jo.of(t??Jo.DEFAULT),this.internalProps.theme.isPivot=this.isPivotTable(),Hc(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 n=this.internalProps.layoutMap.getBody(t,e);return n==null?void 0:n.define}getBodyColumnType(t,e){var n,o;const r=(o=(n=this.internalProps.layoutMap.getBody(t,e))===null||n===void 0?void 0:n.cellType)!==null&&o!==void 0?o:"text";return wt("cellType",{cellType:r},t,e,this)}getCellType(t,e){let n;return this.isSeriesNumberInHeader(t,e)?this.internalProps.layoutMap.getSeriesNumberHeader(t,e).cellType:(n=this.isHeader(t,e)?this.internalProps.layoutMap.getHeader(t,e).headerType:this.internalProps.layoutMap.getBody(t,e).cellType,wt("cellType",{cellType:n},t,e,this))}getHeaderField(t,e){return this.internalProps.layoutMap.getHeaderField(t,e)}getHeaderDefine(t,e){const n=this.internalProps.layoutMap.getHeader(t,e);return n==null?void 0:n.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 n=[];for(;;){const o=this.getHeaderDefine(t,e);if(!o||!o.field&&!o.columns)break;n.push(o),e++}return n}_getHeaderLayoutMap(t,e){return this.internalProps.layoutMap.getHeader(t,e)}_getBodyLayoutMap(t,e){return this.internalProps.layoutMap.getBody(t,e)}getContext(){return this.internalProps.context}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,n=e.headerObjects.find(o=>o&&o.field===t.field);if(n)return e.getHeaderCellAdressById(n.id)}getCellRange(t,e){var n;if(this.internalProps.customMergeCell){const o=this.internalProps.customMergeCell(t,e,this);if(o&&o.range&&(z(o.text)||o.customLayout||o.customRender))return o.range}return(n=this.internalProps.layoutMap)===null||n===void 0?void 0:n.getCellRange(t,e)}hasCustomMerge(){return!!this.internalProps.customMergeCell}getCustomMerge(t,e){if(this.internalProps.customMergeCell){const n=this.internalProps.customMergeCell(t,e,this);if(n&&n.range&&(z(n.text)||n.customLayout||this.customRender)){if(n.style){const o=this.internalProps.bodyHelper.getStyleClass("text"),r=n.style,s=em(r,this.theme.bodyStyle,{col:t,row:e,table:this,value:n.text,dataValue:this.getCellOriginValue(t,e),cellHeaderPaths:this.getCellHeaderPaths(t,e)},o,this.options.autoWrapText,this.theme);n.style=s}return n}}}isCellRangeEqual(t,e,n,o){return this.internalProps.layoutMap.isCellRangeEqual(t,e,n,o)}_getLayoutCellId(t,e){return this.internalProps.layoutMap.getCellId(t,e)}getHeaderDescription(t,e){var n;const o=this._getHeaderLayoutMap(t,e),r=o==null?void 0:o.define,s=(n=r==null?void 0:r.description)!==null&&n!==void 0?n:o==null?void 0:o.description;return typeof s=="function"?s({col:t,row:e,value:this.getCellValue(t,e),dataValue:this.getCellOriginValue(t,e)}):s}setDropDownMenuHighlight(t){this.stateManager.setDropDownMenuHighlight(t)}_dropDownMenuIsHighlight(t,e,n){return this.stateManager.dropDownMenuIsHighlight(t,e,n)}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 n;return(n=this.internalProps.layoutMap)===null||n===void 0?void 0:n.isColumnHeader(t,e)}isRowHeader(t,e){var n;return(n=this.internalProps.layoutMap)===null||n===void 0?void 0:n.isRowHeader(t,e)}isCornerHeader(t,e){var n;return(n=this.internalProps.layoutMap)===null||n===void 0?void 0:n.isCornerHeader(t,e)}isFrozenColumn(t,e){return this.isLeftFrozenColumn(t,e)||this.isRightFrozenColumn(t,e)}isLeftFrozenColumn(t,e){var n;return(n=this.internalProps.layoutMap)===null||n===void 0?void 0:n.isFrozenColumn(t,e)}isRightFrozenColumn(t,e){var n;return(n=this.internalProps.layoutMap)===null||n===void 0?void 0:n.isRightFrozenColumn(t,e)}isFrozenRow(t,e){return this.isTopFrozenRow(t,e)||this.isBottomFrozenRow(t,e)}isTopFrozenRow(t,e){var n;return(n=this.internalProps.layoutMap)===null||n===void 0?void 0:n.isFrozenRow(t,e)}isBottomFrozenRow(t,e){var n;return(n=this.internalProps.layoutMap)===null||n===void 0?void 0:n.isBottomFrozenRow(t,e)}getCellInfo(t,e){if(t>=0&&e>=0){const n=this.isHeader(t,e)?this.getHeaderDefine(t,e):this.getBodyColumnDefine(t,e);return{col:t,row:e,field:this.getHeaderField(t,e),cellHeaderPaths:this.internalProps.layoutMap.getCellHeaderPaths(t,e),title:n==null?void 0:n.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,n){var o;if(t===null||this.internalProps.layoutMap.isHeader(e,n))return!1;const r=this.getRecordShowIndexByCell(e,n);return(o=this.internalProps.dataSource)===null||o===void 0?void 0:o.hasField(r,t)}_getCellStyle(t,e){return V8(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)||this.isCellRangeEqual(t,e,t+1,e)||this.internalProps.columnResizeMode==="none")return!1;if(this.internalProps.columnResizeMode==="header"){if(!this.isHeader(t,e))return!1}else if(this.internalProps.columnResizeMode==="body"&&this.isHeader(t,e))return!1;const n=this.colWidthsLimit[t];return!(n&&n.min&&n.max)||n.max!==n.min}_canResizeRow(t,e){if(!(t>=0&&e>=0)||this.isCellRangeEqual(t,e,t,e+1)||this.internalProps.rowResizeMode==="none")return!1;if(this.internalProps.rowResizeMode==="header"){if(!this.isHeader(t,e))return!1}else if(this.internalProps.rowResizeMode==="body"&&this.isHeader(t,e))return!1;return!0}_canDragHeaderPosition(t,e){var n,o;if(this.isHeader(t,e)&&(this.stateManager.isSelected(t,e)||!((n=this.options.select)===null||n===void 0)&&n.disableHeaderSelect||!((o=this.options.select)===null||o===void 0)&&o.disableSelect)){if(this.internalProps.frozenColDragHeaderMode==="disabled"&&this.isFrozenColumn(t))return!1;if(this.stateManager.isSelected(t,e)){const s=this.stateManager.select.ranges[0];if(this.isColumnHeader(t,e)){if(s.end.row!==this.rowCount-1)return!1}else if(!this.isRowHeader(t,e)||s.end.col!==this.colCount-1)return!1}const r=this.getHeaderDefine(t,e);if(!r)return!1;if(r.dragHeader===void 0){if(this.internalProps.dragHeaderMode==="all")return!0;if(this.internalProps.dragHeaderMode==="column"){if(this.isColumnHeader(t,e))return!0}else if(this.internalProps.dragHeaderMode==="row"&&this.isRowHeader(t,e))return!0;return!1}return r.dragHeader}return!1}getCellIcons(t,e){var n,o,r;let s;if(this.isHeader(t,e))s=this.internalProps.headerHelper.getIcons(t,e);else if(this.internalProps.layoutMap.isSeriesNumber(t,e)){(!this.options.groupBy||!(!((n=this.getCellRawRecord(t,e))===null||n===void 0)&&n.vtableMerge))&&!((r=(o=this.internalProps.layoutMap.getSeriesNumberBody(t,e))===null||o===void 0?void 0:o.define)===null||r===void 0)&&r.dragOrder&&(s=this.internalProps.rowSeriesNumberHelper.getIcons(t,e));const l=this.getCellValue(t,e),a=this.getCellOriginValue(t,e),h=this.internalProps.context,d=this.internalProps.bodyHelper.getIcons(t,e,l,a,h);(s==null?void 0:s.length)>0?s=s.concat(d):(d==null?void 0:d.length)>0&&(s=d)}else{const l=this.getCellValue(t,e),a=this.getCellOriginValue(t,e),h=this.internalProps.context;s=this.internalProps.bodyHelper.getIcons(t,e,l,a,h)}return s}showDropDownMenu(t,e,n){let o="dropdown-menu";n&&(o=Array.isArray(n.content)?"dropdown-menu":"container"),this.internalProps.menu.renderMode==="html"&&(this.stateManager.menu.isShow=!0,this.internalProps.menuHandler._bindToCell(t,e,o,n))}showTooltip(t,e,n){this.internalProps.tooltip.renderMode==="html"&&this.internalProps.tooltipHandler._bindToCell(t,e,n)}getCellStyle(t,e){const n=this._getCellStyle(t,e),o=Pr(n,this,t,e,wt).theme,{autoWrapText:r,lineClamp:s,textOverflow:l}=n;return{textAlign:o.text.textAlign,textBaseline:o.text.textBaseline,bgColor:bi(o.group.fill)?wt("bgColor",n,t,e,this):o.group.fill,color:bi(o.text.fill)?wt("color",n,t,e,this):o.text.fill,strokeColor:bi(o.text.stroke)?wt("strokeColor",n,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:r!=null&&r,lineClamp:s??"auto",textOverflow:l,borderColor:bi(o.group.stroke)?wt("borderColor",n,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:wt("linkColor",n,t,e,this)}}getAllBodyCells(t,e){const n=this.rowHeaderLevelCount,o=this.columnHeaderLevelCount,r=this.colCount-1,s=this.rowCount-1;return Array(Math.min(e??2e3,s-o+1,this.rowCount)).fill(0).map((l,a)=>Array(Math.min(t??2e3,r-n+1,this.colCount)).fill(0).map((h,d)=>this.getCellInfo(d+n,a+o)))}getAllCells(t,e){const r=this.colCount-1,s=this.rowCount-1;return Array(Math.min(e??2e3,s-0+1,this.rowCount)).fill(0).map((l,a)=>Array(Math.min(t??2e3,r-0+1,this.colCount)).fill(0).map((h,d)=>this.getCellInfo(d+0,a+0)))}getAllColumnHeaderCells(){const t=this.rowHeaderLevelCount,e=0,n=this.colCount-1,o=this.columnHeaderLevelCount-1;return Array(o-e+1).fill(0).map((r,s)=>Array(n-t+1).fill(0).map((l,a)=>this.getCellInfo(a+t,s+e)))}getAllRowHeaderCells(){const e=this.columnHeaderLevelCount,n=this.rowHeaderLevelCount-1,o=this.rowCount-1;return Array(o-e+1).fill(0).map((r,s)=>Array(n-0+1).fill(0).map((l,a)=>this.getCellInfo(a+0,s+e)))}getCopyValue(){var t,e,n;if(((e=(t=this.stateManager.select)===null||t===void 0?void 0:t.ranges)===null||e===void 0?void 0:e.length)>0){const o=this.stateManager.select.ranges;let r=Math.min(o[0].start.col,o[0].end.col),s=Math.max(o[0].start.col,o[0].end.col),l=Math.min(o[0].start.row,o[0].end.row),a=Math.max(o[0].start.row,o[0].end.row);o.forEach(f=>{r=Math.min(r,f.start.col,f.end.col),s=Math.max(s,f.start.col,f.end.col),l=Math.min(l,f.start.row,f.end.row),a=Math.max(a,f.start.row,f.end.row)});const h=f=>{let p=!1;return o.forEach(m=>{const b=Math.min(m.start.row,m.end.row),C=Math.max(m.start.row,m.end.row);b<=f&&C>=f&&(p=!0)}),p},d=f=>{let p=!1;return o.forEach(m=>{const b=Math.min(m.start.col,m.end.col),C=Math.max(m.start.col,m.end.col);b<=f&&C>=f&&(p=!0)}),p},u=(f,p)=>{let m;return o.forEach(b=>{const C=Math.min(b.start.row,b.end.row),_=Math.max(b.start.row,b.end.row),w=Math.min(b.start.col,b.end.col),y=Math.max(b.start.col,b.end.col);w<=f&&y>=f&&C<=p&&_>=p&&(m=b)}),m},c=(f,p,m)=>{const b=this.getCellRange(f,p);let C=b.start.col,_=b.start.row;if(m){const w=Math.min(m.start.col,m.end.col),y=Math.min(m.start.row,m.end.row);C=Math.max(w,b.start.col),_=Math.max(y,b.start.row)}return C!==f||_!==p?"":this.getCellValue(f,p)};let g="";for(let f=l;f<=a;f++)if(h(f)){for(let p=r;p<=s;p++)if(d(p)){const m=u(p,f);if(m){const b=c(p,f,m);if(!(typeof Promise<"u"&&b instanceof Promise)){const C=z(b)?`${b}`:"";/^\[object .*\]$/.exec(C)||(g+=C)}(p<m.end.col||p<s)&&(g+=" ")}else g+=" "}f<a&&(g+=`\r
|
|
224
|
-
`)}return!((n=this.options)===null||n===void 0)&&n.formatCopyValue&&(g=this.options.formatCopyValue(g)),g}return""}getSelectedCellInfos(){var t;if(!(!((t=this.stateManager.select)===null||t===void 0)&&t.ranges))return null;const e=this.stateManager.select.ranges;if(!e.length)return[];let n=Math.min(e[0].start.col,e[0].end.col),o=Math.max(e[0].start.col,e[0].end.col),r=Math.min(e[0].start.row,e[0].end.row),s=Math.max(e[0].start.row,e[0].end.row);e.forEach(u=>{n=Math.min(n,u.start.col,u.end.col),o=Math.max(o,u.start.col,u.end.col),r=Math.min(r,u.start.row,u.end.row),s=Math.max(s,u.start.row,u.end.row)});const l=u=>{let c=!1;return e.forEach(g=>{const f=Math.min(g.start.row,g.end.row),p=Math.max(g.start.row,g.end.row);f<=u&&p>=u&&(c=!0)}),c},a=u=>{let c=!1;return e.forEach(g=>{const f=Math.min(g.start.col,g.end.col),p=Math.max(g.start.col,g.end.col);f<=u&&p>=u&&(c=!0)}),c},h=(u,c)=>{let g;return e.forEach(f=>{const p=Math.min(f.start.row,f.end.row),m=Math.max(f.start.row,f.end.row),b=Math.min(f.start.col,f.end.col),C=Math.max(f.start.col,f.end.col);b<=u&&C>=u&&p<=c&&m>=c&&(g=f)}),g},d=[];for(let u=r;u<=s;u++)if(l(u)){const c=[];for(let g=n;g<=o;g++)if(a(g)&&h(g,u)){const f=this.getCellInfo(g,u);c.push(f)}d.push(c)}return d}getSelectedCellRanges(){const t=this.stateManager.select.ranges;return t.length?Ee(t):[]}measureText(t,e){return CR.measureText(t,e)}measureTextBounds(t){return _R(t)}getCustomRender(t,e){let n;if(this.getCellLocation(t,e)!=="body"){const o=this.getHeaderDefine(t,e);n=o==null?void 0:o.headerCustomRender}else{const o=this.getBodyColumnDefine(t,e);n=(o==null?void 0:o.customRender)||this.customRender}return n}getCustomLayout(t,e){let n;if(this.getCellLocation(t,e)!=="body"){const o=this.getHeaderDefine(t,e);n=o==null?void 0:o.headerCustomLayout}else{const o=this.getBodyColumnDefine(t,e);n=o==null?void 0:o.customLayout}return n}hasAutoImageColumn(){return this._hasAutoImageColumn===void 0&&(this._hasAutoImageColumn=H8(this)),this._hasAutoImageColumn}_getActiveChartInstance(){var t,e,n,o,r,s;const l=this.scenegraph.getCell((e=(t=this.stateManager.hover)===null||t===void 0?void 0:t.cellPos)===null||e===void 0?void 0:e.col,(o=(n=this.stateManager.hover)===null||n===void 0?void 0:n.cellPos)===null||o===void 0?void 0:o.row);return((s=(r=l==null?void 0:l.getChildren())===null||r===void 0?void 0:r[0])===null||s===void 0?void 0:s.type)==="chart"?l.getChildren()[0].activeChartInstance:null}cellIsInVisualView(t,e){var n,o,r,s;const l=this.getDrawRange(),a=this.getCellRelativeRect(t,e);if(t<this.frozenColCount&&e<this.frozenRowCount)return!0;let h,d,u,c;return this.frozenRowCount>=1&&(h=this.getCellRangeRelativeRect({start:{col:0,row:0},end:{col:this.colCount-1,row:this.frozenRowCount-1}})),this.frozenColCount>=1&&(d=this.getCellRangeRelativeRect({start:{col:0,row:0},end:{col:this.frozenColCount-1,row:this.rowCount-1}})),this.bottomFrozenRowCount>=1&&(u=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}})),!!(a.top>=l.top&&a.bottom<=l.bottom&&a.left>=l.left&&a.right<=l.right&&(this.isFrozenCell(t,e)||a.top>=((n=h==null?void 0:h.bottom)!==null&&n!==void 0?n:a.top)&&a.left>=((o=d==null?void 0:d.right)!==null&&o!==void 0?o:a.left)&&a.bottom<=((r=u==null?void 0:u.top)!==null&&r!==void 0?r:a.bottom)&&a.right<=((s=c==null?void 0:c.left)!==null&&s!==void 0?s:a.right)))}getCustomMergeValue(t,e){if(this.internalProps.customMergeCell){const n=this.getCustomMerge(t,e);if(n){const{text:o}=n;return o}}}exportImg(){return this.scenegraph.stage.toCanvas().toDataURL()}exportCellImg(t,e,n){var o,r,s,l;const a=this.cellIsInVisualView(t,e),{scrollTop:h,scrollLeft:d}=this;a||this.scrollToCell({col:t,row:e});const u=this.getCellRelativeRect(t,e);((r=(o=this.stateManager.select)===null||o===void 0?void 0:o.ranges)===null||r===void 0?void 0:r.length)>0&&iA(this.scenegraph);const{col:c,row:g}=this.stateManager.hover.cellPos;let f,p;if(this.stateManager.updateHoverPos(-1,-1),this.scenegraph.component.hideVerticalScrollBar(),this.scenegraph.component.hideHorizontalScrollBar(),this.scenegraph.tableGroup.border.setAttribute("visible",!1),n==null?void 0:n.disableBackground){const C=this.scenegraph.getCell(t,e);f=C.attribute.fill,C.setAttribute("fill","transparent")}if(n!=null&&n.disableBorder){const C=this.scenegraph.getCell(t,e);p=C.attribute.stroke,C.setAttribute("stroke",!1)}this.scenegraph.renderSceneGraph();let m=0;this.theme.cellBorderClipDirection==="bottom-right"&&(m=1);const b=this.scenegraph.stage.toCanvas(!1,new ke().set(u.left+this.tableX+1,u.top+this.tableY+1,u.right+this.tableX-m,u.bottom+this.tableY-m));return a||(this.setScrollTop(h),this.setScrollLeft(d)),this.scenegraph.tableGroup.border.setAttribute("visible",!0),f&&this.scenegraph.getCell(t,e).setAttribute("fill",f),p&&this.scenegraph.getCell(t,e).setAttribute("stroke",p),((l=(s=this.stateManager.select)===null||s===void 0?void 0:s.ranges)===null||l===void 0?void 0:l.length)>0&&nA(this.scenegraph),this.stateManager.updateHoverPos(c,g),this.scenegraph.updateNextFrame(),b.toDataURL()}exportCellRangeImg(t){var e,n,o,r;const{scrollTop:s,scrollLeft:l}=this,a=Math.min(t.start.col,t.end.col),h=Math.min(t.start.row,t.end.row),d=Math.max(t.start.col,t.end.col),u=Math.max(t.start.row,t.end.row),c=this.cellIsInVisualView(a,h),g=this.cellIsInVisualView(d,u);c&&g||this.scrollToCell({col:a,row:h});const f=this.getCellRangeRelativeRect({start:{col:a,row:h},end:{col:d,row:u}});((n=(e=this.stateManager.select)===null||e===void 0?void 0:e.ranges)===null||n===void 0?void 0:n.length)>0&&iA(this.scenegraph);const{col:p,row:m}=this.stateManager.hover.cellPos;this.stateManager.updateHoverPos(-1,-1),this.scenegraph.component.hideVerticalScrollBar(),this.scenegraph.component.hideHorizontalScrollBar(),this.scenegraph.renderSceneGraph();const b=this.scenegraph.stage.toCanvas(!1,new ke().set(f.left+this.tableX+1,f.top+this.tableY+1,f.right+this.tableX,f.bottom+this.tableY)).toDataURL();return c&&g||(this.setScrollTop(s),this.setScrollLeft(l)),((r=(o=this.stateManager.select)===null||o===void 0?void 0:o.ranges)===null||r===void 0?void 0:r.length)>0&&nA(this.scenegraph),this.stateManager.updateHoverPos(p,m),b}exportCanvas(){return this.scenegraph.stage.toCanvas()}getImageBuffer(t="image/png"){if(this.options.mode!=="node")return;this.render();const e=this.scenegraph.stage;if(e){const n=this.tableX+this.getAllColsWidth(),o=this.tableY+this.getAllRowsHeight();return n>=this.canvasWidth&&o>=this.canvasHeight?(e.render(),e.window.getImageBuffer(t)):this.scenegraph.stage.toCanvas(!1,new ke().set(0,0,Math.min(this.canvasWidth,n),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,n){this._chartEventMap[t]||(this._chartEventMap[t]=[]),typeof e=="function"?this._chartEventMap[t].push({callback:e}):this._chartEventMap[t].push({callback:n,query:e})}offVChartEvent(t,e){this._chartEventMap[t]&&(this._chartEventMap[t]=e?this._chartEventMap[t].filter(n=>n.callback!==e):[])}_bindChartEvent(t){if(t)for(const e in this._chartEventMap)(this._chartEventMap[e]||[]).forEach(n=>{n.query?t.on(e,n.query,n.callback):t.on(e,n.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((t=this.internalProps.layoutMap)===null||t===void 0?void 0:t.leftRowSeriesNumberColumnCount)>0}get leftRowSeriesNumberCount(){var t,e;return(e=(t=this.internalProps.layoutMap)===null||t===void 0?void 0:t.leftRowSeriesNumberColumnCount)!==null&&e!==void 0?e:0}setMinMaxLimitWidth(t=!1){var e,n;const o=this.internalProps;for(let r=0;r<o.layoutMap.columnWidths.length;r++){if(this.internalProps._widthResizedColMap.has(r))continue;const{width:s,minWidth:l,maxWidth:a}=(n=(e=o.layoutMap.columnWidths)===null||e===void 0?void 0:e[r])!==null&&n!==void 0?n:{};t&&s&&(typeof s=="string"&&s!=="auto"||typeof s=="number"&&s>0)&&this._setColWidth(r,s),l&&(typeof l=="number"&&l>0||typeof l=="string")&&this.setMinColWidth(r,l),a&&(typeof a=="number"&&a>0||typeof a=="string")&&this.setMaxColWidth(r,a)}}setSortedIndexMap(t,e){var n;(n=this.dataSource)===null||n===void 0||n.setSortedIndexMap(t,e)}checkReactCustomLayout(t){this.reactCustomLayout||(this.reactCustomLayout=new I6(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 n=this.getDrawRange();if(z(t.col)&&t.col>=this.frozenColCount){const o=this.getFrozenColsWidth(),r=this.getColsWidth(0,t.col-1);this.scrollLeft=Math.min(r-o,this.getAllColsWidth()-n.width)}if(z(t.row)&&t.row>=this.frozenRowCount){const o=this.getFrozenRowsHeight(),r=this.getRowsHeight(0,t.row-1);this.scrollTop=Math.min(r-o,this.getAllRowsHeight()-n.height)}this.render()}}const K8=Object.freeze(Object.defineProperty({__proto__:null,BaseTable:Cg},Symbol.toStringTag,{value:"Module"})),yg={},_g={};function oT(i){if(_g[i])return _g[i]}function wg(i,t,e){const n=i[t];return i[t]=e,n}function Y8(i,t){return t!=null?wg(vc,i,t):vc[i]}function X8(i,t){return t!=null?wg(Pc,i,t):Pc[i]}function q8(i,t){return t!=null?wg(yg,i,t):yg[i]}function Z8(i,t){return t!=null?wg(_g,i,t):_g[i]}function av(i){for(const t in i)delete i[t]}function rT(){av(vc),av(Pc),av(yg)}const J8=Object.freeze(Object.defineProperty({__proto__:null,chartModule:q8,clearAll:rT,editor:Z8,icon:X8,theme:Y8},Symbol.toStringTag,{value:"Module"}));function Q8(i,t,e){const n=(i+="").split(".");let o=n[0];const r=n.length>1?e+n[1]:"";return o=tV(o,t),o+r}function tV(i,t){return i.replace(/\d+/,function(e){return e.replace(/(\d)(?=(\d{3})+$)/g,function(n){return`${n}${t}`})})}function eV(i){return i=Object.assign({},{digitsAfterDecimal:2,scaler:1,thousandsSep:",",decimalSep:".",prefix:"",suffix:""},i),function(t){if(isNaN(t)||!isFinite(t))return"";const e=Q8((i.scaler*t).toFixed(i.digitsAfterDecimal),i.thousandsSep,i.decimalSep);return`${i.prefix}${e}${i.suffix}`}}function iV(i,t,e,n,o){e==null&&(e=!1),n==null&&(n=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]),o==null&&(o=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]);const r=e?"UTC":"",s=function(l){return`0${l}`.substring(0,2)};return function(l){const a=new Date(Date.parse(l[i]));return t.replace(/%(.)/g,function(h,d){switch(d){case"y":return a[`get${r}FullYear`]();case"m":return s(a[`get${r}Month`]()+1);case"n":return n[a[`get${r}Month`]()];case"d":return s(a[`get${r}Date`]());case"w":return o[a[`get${r}Day`]()];case"x":return a[`get${r}Day`]();case"H":return s(a[`get${r}Hours`]());case"M":return s(a[`get${r}Minutes`]());case"S":return s(a[`get${r}Seconds`]());default:return`%${d}`}})}}const nV=Object.freeze(Object.defineProperty({__proto__:null,dateFormat:iV,numberFormat:eV},Symbol.toStringTag,{value:"Module"})),oV=(i,t)=>{var e,n;if(!(t!=null&&t.fields)||i.length===0)return i;const o=t.fields,r=i[0],s={},l=[];for(const a in o)if(Object.prototype.hasOwnProperty.call(o,a)){const h=o[a];if(!h.type){let u=r;a in r||(u=(e=i.find(c=>a in c))!==null&&e!==void 0?e:r),h.type=typeof u[a]=="number"?"linear":"ordinal"}let d;if(typeof h.sortIndex=="number"&&(d={key:a,type:h.type,index:h.sortIndex,sortIndex:{},sortIndexCount:0,sortReverse:h.sortReverse===!0},l.push(d)),((n=h.domain)===null||n===void 0?void 0:n.length)>0)if(h.type==="ordinal"){h._domainCache={},s[a]=h;const u={};h.domain.forEach((c,g)=>{u[c]=g,h._domainCache[c]=g}),d&&(d.sortIndex=u,d.sortIndexCount=h.domain.length)}else h.domain.length>=2&&(s[a]=h)}return Object.keys(s).length>0&&(i=i.filter(a=>{for(const h in s){const d=s[h];if(d.type==="ordinal"){if(!(a[h]in d._domainCache))return!1}else if(d.domain[0]>a[h]||d.domain[1]<a[h])return!1}return!0})),l.sort((a,h)=>a.index-h.index),i.sort((a,h)=>rV(a,h,l)),i};function rV(i,t,e){for(let n=0;n<e.length;n++){const o=e[n];let r=0;if(o.type==="ordinal"?(o.sortIndex[t[o.key]]===void 0&&(o.sortIndex[t[o.key]]=o.sortIndexCount++),o.sortIndex[i[o.key]]===void 0&&(o.sortIndex[i[o.key]]=o.sortIndexCount++),r=o.sortIndex[i[o.key]]-o.sortIndex[t[o.key]]):o.type==="linear"&&(r=i[o.key]-t[o.key]),o.sortReverse&&(r=-r),r!==0)return r}return 0}let hv=0;const sV=1e8;function sT(i="dataset"){return hv>sV&&(hv=0),i+"_"+hv++}class lV{constructor(t){var e;let n;this.options=t,this.isDataSet=!0,this.transformMap={},this.parserMap={},this.dataViewMap={},this.target=new qr,n=t!=null&&t.name?t.name:sT("dataset"),this.name=n,this._logger=(e=t==null?void 0:t.logger)!==null&&e!==void 0?e:Te.getInstance()}setLogger(t){this._logger=t}getDataView(t){return this.dataViewMap[t]}setDataView(t,e){var n;this.dataViewMap[t]&&((n=this._logger)===null||n===void 0||n.error(`Error: dataView ${t} 之前已存在,请重新命名`)),this.dataViewMap[t]=e}removeDataView(t){this.dataViewMap[t]=null,delete this.dataViewMap[t]}registerParser(t,e){var n;this.parserMap[t]&&((n=this._logger)===null||n===void 0||n.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 n;this.transformMap[t]&&((n=this._logger)===null||n===void 0||n.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,n){this._callMap||(this._callMap=new Map);let o=this._callMap.get(n);o||(o=()=>{t.some(r=>r.isRunning)||n()}),t.forEach(r=>{r.target.addListener(e,o)}),this._callMap.set(n,o)}allDataViewAddListener(t,e){this.multipleDataViewAddListener(Object.values(this.dataViewMap),t,e)}multipleDataViewRemoveListener(t,e,n){if(this._callMap){const o=this._callMap.get(n);o&&t.forEach(r=>{r.target.removeListener(e,o)}),this._callMap.delete(n)}}multipleDataViewUpdateInParse(t){t.forEach(e=>{var n;return(n=this.getDataView(e.name))===null||n===void 0?void 0:n.markRunning()}),t.forEach(e=>{var n;return(n=this.getDataView(e.name))===null||n===void 0?void 0:n.parseNewData(e.data,e.options)})}multipleDataViewUpdateInRawData(t){t.forEach(e=>{var n;return(n=this.getDataView(e.name))===null||n===void 0?void 0:n.markRunning()}),t.forEach(e=>{var n;return(n=this.getDataView(e.name))===null||n===void 0?void 0:n.updateRawData(e.data,e.options)})}destroy(){this.transformMap=null,this.parserMap=null,this.dataViewMap=null,this._callMap=null,this.target.removeAllListeners()}}const dv="_data-view-diff-rank";class Sg{constructor(t,e){let n;this.dataSet=t,this.options=e,this.isDataView=!0,this.target=new qr,this.parseOption=null,this.transformsArr=[],this.isRunning=!1,this.rawData={},this.history=!1,this.parserData={},this.latestData={},this._fields=null,this.reRunAllTransform=(o={pushHistory:!0,emitMessage:!0})=>(this.isRunning=!0,this.resetTransformData(),this.transformsArr.forEach(r=>{this.executeTransform(r,{pushHistory:o.pushHistory,emitMessage:!1}),this.isLastTransform(r)&&this.diffLastData()}),this.isRunning=!1,o.emitMessage!==!1&&this.target.emit("change",[]),this),this.markRunning=()=>{this.isRunning=!0,this.target.emit("markRunning",[])},n=e!=null&&e.name?e.name:sT("dataview"),this.name=n,e!=null&&e.history&&(this.history=e.history,this.historyData=[]),this.dataSet.setDataView(n,this),this.setFields(e==null?void 0:e.fields)}parse(t,e,n=!1){var o;this.isRunning=!0,n&&this.target.emit("beforeParse",[]),e&&(this.parseOption=e);const r=this.cloneParseData(t,e);if(e!=null&&e.type){const s=((o=this.dataSet.getParser(e.type))!==null&&o!==void 0?o:this.dataSet.getParser("bytejson"))(r,e.options,this);this.rawData=r,this.parserData=s,this.history&&this.historyData.push(r,s),this.latestData=s}else this.parserData=r,this.rawData=r,this.history&&this.historyData.push(r),this.latestData=r;return this.isRunning=!1,n&&this.target.emit("afterParse",[]),this}transform(t,e=!0){if(this.isRunning=!0,t&&t.type){let n=!0;if(t.type==="fields"){this._fields=t.options.fields;const o=this.transformsArr.findIndex(r=>r.type===t.type);o>=0&&(n=!1,this.transformsArr[o].options.fields=this._fields)}if(n&&this.transformsArr.push(t),e){const o=this.isLastTransform(t);this.executeTransform(t),o&&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 n,o;return((n=t.level)!==null&&n!==void 0?n:0)-((o=e.level)!==null&&o!==void 0?o:0)})}executeTransform(t,e={pushHistory:!0,emitMessage:!0}){const{pushHistory:n,emitMessage:o}=e,r=this.dataSet.getTransform(t.type)(this.latestData,t.options);this.history&&n!==!1&&this.historyData.push(r),this.latestData=r,o!==!1&&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||!this.latestData.forEach||!(!((t=this._diffKeys)===null||t===void 0)&&t.length))return;const e=this._diffRank+1;if(this._diffRank===0)this.latestData.forEach(n=>{n[dv]=e,this._diffMap.set(this._diffKeys.reduce((o,r)=>o+n[r],""),n)}),this.latestDataAUD={add:Array.from(this.latestData),del:[],update:[]};else{let n;this.latestDataAUD={add:[],del:[],update:[]},this.latestData.forEach(o=>{o[dv]=e,n=this._diffKeys.reduce((r,s)=>r+o[s],""),this._diffMap.get(n)?this.latestDataAUD.update.push(o):this.latestDataAUD.add.push(o),this._diffMap.set(n,o)}),this._diffMap.forEach((o,r)=>{o[dv]<e&&(this.latestDataAUD.del.push(o),this._diffMap.delete(r))})}this._diffRank=e}cloneParseData(t,e){let n=!1;return t instanceof Sg||(e==null?void 0:e.clone)!==!0||(n=!0),n?Ee(t):t}parseNewData(t,e){this.parse(t,e||this.parseOption),this.reRunAllTransform()}updateRawData(t,e){const n=this.cloneParseData(t,e);this.rawData=n,this.parserData=n,this.latestData=n,this.reRunAllTransform()}getFields(){var t;return this._fields?this._fields:((t=this.parseOption)===null||t===void 0?void 0:t.type)==="dataview"&&this.rawData.length===1&&this.rawData[0].getFields?this.rawData[0].getFields():null}setFields(t,e=!1){this._fields=t&&e?xt({},this._fields,t):t;const n=this.transformsArr.find(o=>o.type==="fields");!Mt(this._fields)&&Mt(n)?(this.dataSet.registerTransform("fields",oV),this.transform({type:"fields",options:{fields:this._fields}},!1)):n&&(n.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 aV(i){return i instanceof Sg}function ho(i,t=["data"]){const e=i;let n;if(!z(e)||typeof e!="object"||aV(e)||GP(e))return e;const o=lt(e),r=e.length;n=o?new Array(r):typeof e=="object"?{}:bi(e)||ft(e)||ce(e)?e:WC(e)?new Date(+e):void 0;const s=o?void 0:Object.keys(Object(e));let l=-1;if(n)for(;++l<(s||e).length;){const a=s?s[l]:l,h=e[a];t!=null&&t.includes(a.toString())?n[a]=h:n[a]=ho(h,t)}return n}function lT(i){var t,e;const n=Object.assign({},i);return qt(i.style)||(n.textStyle=ni(i.style)),qt(i.textStyle)||xt(n.textStyle,ni(i.textStyle)),!((t=i.shape)===null||t===void 0)&&t.style&&ni(n.shape.style),!((e=i.background)===null||e===void 0)&&e.style&&ni(n.background.style),n}function ni(i){return qt(i)||i.angle&&(i.angle=Mn(i.angle)),i}function uo(i={}){return qt(i.style)||(i.style=ni(i.style)),qt(i.state)||Object.keys(i.state).forEach(t=>{qt(i.state[t])||(i.state[t]=ni(i.state[t]))}),i}function Ts(i){return qt(i)?null:(Object.keys(i).forEach(t=>{qt(i[t])||(i[t]=ni(i[t]))}),i)}function hV(i){return uo(i),uo(i.startSymbol),uo(i.endSymbol),i}const dV={left:{textAlign:"center",textBaseline:"bottom"},right:{textAlign:"center",textBaseline:"bottom"},radius:{},angle:{}},Ms="PingFang SC,Microsoft Yahei,system-ui,-apple-system,segoe ui,Roboto,Helvetica,Arial,sans-serif, apple color emoji,segoe ui emoji,segoe ui symbol",Ro=14,Eh={FONT_FAMILY:Ms,LABEL_FONT_SIZE:14,MAP_LABEL_FONT_SIZE:10,TITLE_FONT_SIZE:18,AXIS_TICK_SIZE:4},xg={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:Eh.AXIS_TICK_SIZE,style:{lineWidth:1,stroke:"#D9DDE4",strokeOpacity:1}},subTick:{visible:!1,tickSize:Eh.AXIS_TICK_SIZE/2,style:{lineWidth:1,stroke:"#D9DDE4",strokeOpacity:1}},label:{visible:!0,space:1,style:{fontSize:Eh.LABEL_FONT_SIZE,fill:"#89909D",fontWeight:"normal",fillOpacity:1},autoLimit:!0},title:{space:10,style:{fontSize:Eh.LABEL_FONT_SIZE,fill:"#333333",fontWeight:"normal",fillOpacity:1}}};function uV(i){var t,e;return!((e=(t=i==null?void 0:i.colorScheme)===null||t===void 0?void 0:t.default)===null||e===void 0)&&e.palette?xt({},xg,{tick:{style:{stroke:i.colorScheme.default.palette.axisDomainColor||"#D9DDE4"}},subTick:{style:{stroke:i.colorScheme.default.palette.axisDomainColor||"#D9DDE4"}},label:{style:{fill:i.colorScheme.default.palette.axisLabelFontColor||"#89909D"}},title:{style:{fill:i.colorScheme.default.palette.secondaryFontColor||"#333333"}}}):xg}function aT(i){var t,e,n,o,r,s,l,a,h,d,u,c,g;const f=xt({},i);let p,m=(e=(t=f.title)===null||t===void 0?void 0:t.angle)!==null&&e!==void 0?e:0;f.orient!=="left"&&f.orient!=="right"||!((n=f.title)===null||n===void 0)&&n.autoRotate&&Mt(f.title.angle)&&(m=f.orient==="left"?-90:90,p=dV[f.orient]);const b=bP(f.label,["style","formatMethod","state"]);return{orient:f.orient,select:f.select,hover:f.hover,line:hV(f.domainLine),label:Object.assign({style:ni(f.label.style),formatMethod:f.label.formatMethod?(C,_,w)=>f.label.formatMethod(_.rawValue,_):null,state:Ts(f.label.state)},b),tick:{visible:f.tick.visible,length:f.tick.tickSize,inside:f.tick.inside,alignWithLabel:f.tick.alignWithLabel,style:ni(f.tick.style),state:Ts(f.tick.state),dataFilter:f.tick.dataFilter},subTick:{visible:f.subTick.visible,length:f.subTick.tickSize,inside:f.subTick.inside,count:f.subTick.tickCount,style:ni(f.subTick.style),state:Ts(f.subTick.state)},grid:{type:"line",visible:f.grid.visible,alternateColor:f.grid.alternateColor,alignWithLabel:f.grid.alignWithLabel,style:ni(f.grid.style)},subGrid:{type:"line",visible:f.subGrid.visible,alternateColor:f.subGrid.alternateColor,style:ni(f.subGrid.style)},title:{visible:f.title.visible,position:f.title.position,space:f.title.space,autoRotate:!1,angle:m?Mn(m):null,textStyle:xt({},p,ni(f.title.style)),padding:f.title.padding,shape:{visible:(o=f.title.shape)===null||o===void 0?void 0:o.visible,space:(r=f.title.shape)===null||r===void 0?void 0:r.space,style:ni((s=f.title.shape)===null||s===void 0?void 0:s.style)},background:{visible:(l=f.title.background)===null||l===void 0?void 0:l.visible,style:ni((a=f.title.background)===null||a===void 0?void 0:a.style)},state:{text:Ts(f.title.state),shape:Ts((h=f.title.shape)===null||h===void 0?void 0:h.state),background:Ts((d=f.title.background)===null||d===void 0?void 0:d.state)}},panel:{visible:(u=f.background)===null||u===void 0?void 0:u.visible,style:ni((c=f.background)===null||c===void 0?void 0:c.style),state:Ts((g=f.background)===null||g===void 0?void 0:g.state)}}}const hT="NO_AXISID_FRO_VTABLE";function cV(i,t,e){var n,o;const r=e.getCellHeaderPaths(i,t);let s;if(e.indicatorsAsCol){const a=(n=r.colHeaderPaths.find(h=>h.indicatorKey))===null||n===void 0?void 0:n.indicatorKey;s=e.columnObjects.find(h=>h.indicatorKey===a)}else{const a=(o=r.rowHeaderPaths.find(h=>h.indicatorKey))===null||o===void 0?void 0:o.indicatorKey;s=e.columnObjects.find(h=>h.indicatorKey===a)}const l=s==null?void 0:s.chartSpec;return typeof l=="function"?l({col:i,row:t,dataValue:e._table.getCellOriginValue(i,t)||"",value:e._table.getCellValue(i,t)||"",rect:e._table.getCellRangeRelativeRect(e._table.getCellRange(i,t)),table:e._table}):l}function gV(i,t,e){var n,o;const r=e.getCellHeaderPaths(i,t);let s;if(e.indicatorsAsCol){const l=(n=r.colHeaderPaths.find(a=>a.indicatorKey))===null||n===void 0?void 0:n.indicatorKey;s=e.columnObjects.find(a=>a.indicatorKey===l)}else{const l=(o=r.rowHeaderPaths.find(a=>a.indicatorKey))===null||o===void 0?void 0:o.indicatorKey;s=e.columnObjects.find(a=>a.indicatorKey===l)}return typeof(s==null?void 0:s.chartSpec)!="function"}function fV(i,t,e){var n,o;const r=e.getCellHeaderPaths(i,t);let s;if(e.indicatorsAsCol){const l=(n=r.colHeaderPaths.find(a=>a.indicatorKey))===null||n===void 0?void 0:n.indicatorKey;s=e.columnObjects.find(a=>a.indicatorKey===l)}else{const l=(o=r.rowHeaderPaths.find(a=>a.indicatorKey))===null||o===void 0?void 0:o.indicatorKey;s=e.columnObjects.find(a=>a.indicatorKey===l)}return s==null?void 0:s.noDataRenderNothing}function Lh(i){let t=!1;for(let e=0;e<i.length;e++){const n=i[e];if(n.chartSpec&&n.chartSpec.type!=="wordCloud"&&n.chartSpec.type!=="radar"&&n.chartSpec.type!=="gauge"&&n.chartSpec.type!=="pie"&&n.chartSpec.type!=="funnel"&&n.chartSpec.type!=="rose"){t=!0;break}}return t}function pV(i,t,e){let n=!0;const o=e.getRawChartSpec(i,t);return o&&o.type!=="pie"&&o.type!=="radar"&&o.type!=="gauge"&&o.type!=="wordCloud"&&o.type!=="funnel"&&o.type!=="rose"||(n=!1),n}function Hl(i,t,e,n){let o=!1;if(n.indicatorsAsCol&&e==="row"||!n.indicatorsAsCol&&e==="col")for(let r=0;r<n.indicatorsDefine.length;r++){const s=n.indicatorsDefine[r];if(s.chartSpec&&s.chartSpec.type!=="pie"&&s.chartSpec.type!=="wordCloud"&&s.chartSpec.type!=="radar"&&s.chartSpec.type!=="gauge"&&s.chartSpec.type!=="funnel"&&s.chartSpec.type!=="rose"){o=!0;break}}else{const r=n.getRawChartSpec(i,t);r?r.type!=="pie"&&r.type!=="radar"&&r.type!=="gauge"&&r.type!=="wordCloud"&&r.type!=="funnel"&&r.type!=="rose"&&(o=!0):o=!1}return o}function mV(i,t,e){let n=e.getRawChartSpec(i,t);return n?(e._table.isPivotChart()&&(n=ho(n),n.sortDataByAxis=!0,lt(n.series)&&n.series.forEach(o=>{o.sortDataByAxis=!0}),n.type!=="gauge"&&n.type!=="rose"&&n.type!=="radar"&&(n.axes=e.getChartAxes(i,t)),n.padding=0,n.dataZoom=[]),n):null}function vV(i,t,e){var n,o,r;const s=[];if(e.indicatorsAsCol){const l=e.getIndicatorKeyInChartSpec(i,t).slice(0,2),a=e.getColKeysPath(i,t);l.forEach((m,b)=>{const{range:C,isZeroAlign:_,axisOption:w}=Rg(i,t,b,b===0?"bottom":"top",l,a,e);if(_){const y=Rg(i,t,l.length-1-b,b===0?"top":"bottom",l,a,e);if(y){const{range:S}=y,A=Bl(C,S);A&&(C.min=A.range1[0],C.max=A.range1[1])}}ft(w==null?void 0:w.min)&&(C.min=w.min),ft(w==null?void 0:w.max)&&(C.max=w.max),s.push(xt({range:C,label:{style:{fontSize:Ro}}},w,{type:(w==null?void 0:w.type)||"linear",orient:b===0?"bottom":"top",label:{visible:!1,flush:!0},title:{visible:!1},domainLine:{visible:!1},seriesIndex:w!=null&&w.seriesId?void 0:b,sync:{axisId:hT}}))});let h=e.getDimensionKeyInChartSpec(e.rowHeaderLevelCount,t);lt(h)&&(h=h[0]);const d=e.dataset.cacheCollectedValues[h]||e.dataset.collectedValues[h]||[],u=e.getRowKeysPath(i,t),c=d[u??""],{axisOption:g,isPercent:f,chartType:p}=Pl(i,t,"left",e);s.push(xt({domain:(g==null?void 0:g.type)!=="linear"||Array.isArray(c)?Array.from(c??[]):void 0,range:(g==null?void 0:g.type)!=="linear"||Array.isArray(c)?void 0:c,label:{style:{fontSize:Ro}}},g,{type:(n=g==null?void 0:g.type)!==null&&n!==void 0?n:"band",orient:"left",label:{visible:!1},domainLine:{visible:!1},tick:{visible:!1},subTick:{visible:!1},title:{visible:!1}}))}else{const l=e.getIndicatorKeyInChartSpec(i,t).slice(0,2),a=e.getRowKeysPath(i,t);l.forEach((m,b)=>{const{range:C,isZeroAlign:_,axisOption:w}=Rg(i,t,b,b===0?"left":"right",l,a,e);if(_){const y=Rg(i,t,l.length-1-b,b===0?"right":"left",l,a,e);if(y){const{range:S}=y,A=Bl(C,S);A&&(C.min=A.range1[0],C.max=A.range1[1])}}ft(w==null?void 0:w.min)&&(C.min=w.min),ft(w==null?void 0:w.max)&&(C.max=w.max),s.push(xt({range:C,label:{style:{fontSize:Ro}}},w,{type:(w==null?void 0:w.type)||"linear",orient:b===0?"left":"right",label:{visible:!1,flush:!0},title:{visible:!1},domainLine:{visible:!1},seriesIndex:w!=null&&w.seriesId?void 0:b,sync:{axisId:hT}}))});let h=e.getDimensionKeyInChartSpec(i,e.columnHeaderLevelCount);lt(h)&&(h=h[0]);const d=e.dataset.cacheCollectedValues[h]||e.dataset.collectedValues[h]||[],u=e.getColKeysPath(i,t),c=(o=d==null?void 0:d[u??""])!==null&&o!==void 0?o:[],{axisOption:g,isPercent:f,chartType:p}=Pl(i,t,"bottom",e);s.push(xt({domain:(g==null?void 0:g.type)!=="linear"||Array.isArray(c)?Array.from(c??[]):void 0,range:(g==null?void 0:g.type)!=="linear"||Array.isArray(c)?void 0:c,label:{style:{fontSize:Ro}}},g,{type:(r=g==null?void 0:g.type)!==null&&r!==void 0?r:"band",orient:"bottom",visible:!0,label:{visible:!1},domainLine:{visible:!1},tick:{visible:!1},subTick:{visible:!1},title:{visible:!1}}))}return s}function dT(i,t,e){var n;const o=e.getRawChartSpec(i,t);if(o!=null&&o.series){const r={};return!((n=o.data)===null||n===void 0)&&n.id&&(r[o.data.id]=void 0),o==null||o.series.forEach(s=>{var l,a,h,d,u,c,g,f,p,m,b;if(!(!((l=s.data)===null||l===void 0)&&l.fromDataId))if(!((a=s.data)===null||a===void 0)&&a.transforms)r[(b=(p=(f=s.data)===null||f===void 0?void 0:f.id)!==null&&p!==void 0?p:(m=o.data)===null||m===void 0?void 0:m.id)!==null&&b!==void 0?b:"data"]=void 0;else{const C=s.direction==="horizontal"?s.xField:s.yField;r[(c=(d=(h=s.data)===null||h===void 0?void 0:h.id)!==null&&d!==void 0?d:(u=o.data)===null||u===void 0?void 0:u.id)!==null&&c!==void 0?c:"data"]=!((g=s.data)===null||g===void 0)&&g.id?C:void 0}}),r}return o.data.id}function Rg(i,t,e,n,o,r,s){const{axisOption:l,isPercent:a,isZeroAlign:h,seriesIndice:d}=Pl(i,t,n,s),u=lv(s.dataset.collectedValues,o,h,r,d??e);if(a&&(u.min=u.min<0?-1:0,u.max=u.max>0?1:0),(l!=null&&l.zero||u.min===u.max)&&(u.min=Math.min(u.min,0),u.max=Math.max(u.max,0)),l==null?void 0:l.nice){const c=Bt.getFunction("getAxisDomainRangeAndLabels"),{range:g}=c(u.min,u.max,l,h,n==="bottom"||n==="top"?s._table.getColWidth(i)||s._table.tableNoFrameWidth:s._table.getRowHeight(t)||s._table.tableNoFrameHeight);u.min=g[0],u.max=g[1]}return ft(l==null?void 0:l.min)&&(u.min=l.min),ft(l==null?void 0:l.max)&&(u.max=l.max),{range:u,isZeroAlign:h,axisOption:l}}function uT(i){let t=!1;for(let e=0;e<i.columnObjects.length;e++)if(i.columnObjects[e].chartSpec){t=!0;break}return t}function bV(i,t,e){var n,o,r;if(i===-1||t===-1)return{start:{col:i,row:t},end:{col:i,row:t}};if(e._cellRangeMap.has(`$${i}$${t}`))return e._cellRangeMap.get(`$${i}$${t}`);let s={start:{col:i,row:t},end:{col:i,row:t}};if(e.transpose)s=yV(i,t,e);else if(e.headerLevelCount<=t){if(e.headerLevelCount<=t&&(!((o=(n=e.columnObjects[i-e.leftRowSeriesNumberColumnCount])===null||n===void 0?void 0:n.define)===null||o===void 0)&&o.mergeCell)){const l=e._table.getCellValue(i,t);for(let a=t-1;a>=e.headerLevelCount;a--){const h=e._table.getCellValue(i,a);if(typeof e.columnObjects[i-e.leftRowSeriesNumberColumnCount].define.mergeCell=="boolean"){if(l!==h)break}else if(!e.columnObjects[i-e.leftRowSeriesNumberColumnCount].define.mergeCell(l,h))break;s.start.row=a}for(let a=t+1;a<e.rowCount;a++){const h=e._table.getCellValue(i,a);if(typeof e.columnObjects[i-e.leftRowSeriesNumberColumnCount].define.mergeCell=="boolean"){if(l!==h)break}else if(!e.columnObjects[i-e.leftRowSeriesNumberColumnCount].define.mergeCell(l,h))break;s.end.row=a}}CV(i,t,s,e)}else{const l=e.getCellId(i,t);for(let a=i-1;a>=0&&l===e.getCellId(a,t);a--)s.start.col=a;for(let a=i+1;a<((r=e.colCount)!==null&&r!==void 0?r:0)&&l===e.getCellId(a,t);a++)s.end.col=a;for(let a=t-1;a>=0&&l===e.getCellId(i,a);a--)s.start.row=a;for(let a=t+1;a<e.headerLevelCount&&l===e.getCellId(i,a);a++)s.end.row=a}return e._cellRangeMap.set(`$${i}$${t}`,s),s}function CV(i,t,e,n){if(n.rowHierarchyType!=="tree")return;const o=n._table.getCellRawRecord(i,t);o!=null&&o.vtableMerge&&(e.start.col=n.rowHeaderLevelCount,e.end.col=n.colCount-1,e.start.row=e.end.row=t)}function yV(i,t,e){var n,o,r,s;const l={start:{col:i,row:t},end:{col:i,row:t}};if(e.headerLevelCount+e.leftRowSeriesNumberColumnCount<=i||i===-1&&t===-1){if(e.headerLevelCount+e.leftRowSeriesNumberColumnCount<=i&&(!((o=(n=e.columnObjects[t])===null||n===void 0?void 0:n.define)===null||o===void 0)&&o.mergeCell)){const h=e._table.getCellValue(i,t);for(let d=i-1;d>=e.headerLevelCount+e.leftRowSeriesNumberColumnCount;d--){const u=e._table.getCellValue(d,t);if(typeof e.columnObjects[t].define.mergeCell=="boolean"){if(h!==u)break}else if(!e.columnObjects[t].define.mergeCell(h,u))break;l.start.col=d}for(let d=i+1;d<((r=e.colCount)!==null&&r!==void 0?r:0);d++){const u=e._table.getCellValue(d,t);if(typeof e.columnObjects[t].define.mergeCell=="boolean"){if(h!==u)break}else if(!e.columnObjects[t].define.mergeCell(h,u))break;l.end.col=d}}return l}const a=e.getCellId(i,t);for(let h=t-1;h>=0&&a===e.getCellId(i,h);h--)l.start.row=h;for(let h=t+1;h<((s=e.rowCount)!==null&&s!==void 0?s:0)&&a===e.getCellId(i,h);h++)l.end.row=h;for(let h=i-1;h>=0&&a===e.getCellId(h,t);h--)l.start.col=h;for(let h=i+1;h<e.headerLevelCount+e.leftRowSeriesNumberColumnCount&&a===e.getCellId(h,t);h++)l.end.col=h;return l}class _V{constructor(t,e,n,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=n,this._table=t,this._columns=[],this._columnsIncludeHided=[],this._headerCellIds=[],this.hierarchyIndent=o??20,this.hierarchyTextStartAlignment=t.options.hierarchyTextStartAlignment,this.columnTree=new Pe(e,{seqId:0}),this._headerObjectsIncludeHided=this._addHeaders(0,e,[]),this._headerObjects=this._headerObjectsIncludeHided.filter(r=>r.define.hide!==!0),this._headerObjectMap=this._headerObjects.reduce((r,s)=>(r[s.id]=s,r),{}),this.rowHierarchyType=P8(this)?"tree":"grid",this._hasAggregation=T8(this),this._hasAggregationOnBottomCount=B8(this),this._hasAggregationOnTopCount=M8(this),this.handleRowSeriesNumber(t.internalProps.rowSeriesNumber)}handleRowSeriesNumber(t){var e,n;t&&(Array.isArray(t)?this.rowSeriesNumberColumn=t.map(o=>{var r,s;return{id:this.seqId++,title:o.title,define:o,cellType:(r=o.cellType)!==null&&r!==void 0?r:"text",headerType:(s=t.cellType)!==null&&s!==void 0?s:"text",style:o.style,width:o.width,format:o.format,field:o.field,icon:o.icon,headerIcon:o.headerIcon,isChildNode:!1}}):this.rowSeriesNumberColumn=[{id:this.seqId++,title:t.title,define:t,cellType:(e=t.cellType)!==null&&e!==void 0?e:"text",headerType:(n=t.cellType)!==null&&n!==void 0?n:"text",style:t.style,width:t.width,format:t.format,field:"",icon:t.icon,headerIcon:t.headerIcon,isChildNode:!1}],this.leftRowSeriesNumberColumn=this.rowSeriesNumberColumn.filter(o=>!0),this.rightRowSeriesNumberColumn=this.rowSeriesNumberColumn.filter(o=>!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){return!!(this.leftRowSeriesNumberColumnCount>0&&t>=0&&t<this.leftRowSeriesNumberColumnCount&&(this.transpose||e>=this.headerLevelCount)||this.rightRowSeriesNumberColumnCount>0&&t>=this.colCount-this.rightRowSeriesNumberColumnCount&&(this.transpose||e>=this.headerLevelCount))}isSeriesNumber(t,e){return!!(z(t)&&z(e)&&(this.leftRowSeriesNumberColumnCount>0&&t>=0&&e>=0&&t<this.leftRowSeriesNumberColumnCount||this.rightRowSeriesNumberColumnCount>0&&e>=0&&t>=this.colCount-this.rightRowSeriesNumberColumnCount))}getSeriesNumberHeader(t,e){if(this.leftRowSeriesNumberColumnCount>0&&t>=0&&t<this.leftRowSeriesNumberColumnCount){if(this.transpose)return;if(e<this.headerLevelCount)return Object.assign({},this.leftRowSeriesNumberColumn[t],{style:this._table.internalProps.rowSeriesNumber.headerStyle})}if(this.rightRowSeriesNumberColumnCount>0&&t>=this.colCount-this.rightRowSeriesNumberColumnCount&&e<this.headerLevelCount){if(this.transpose)return;if(e<this.headerLevelCount)return this.rightRowSeriesNumberColumn[t-(this.colCount-this.rightRowSeriesNumberColumnCount)]}}getSeriesNumberBody(t,e){if(this.leftRowSeriesNumberColumnCount>0&&t>=0&&t<this.leftRowSeriesNumberColumnCount){if(this.transpose)return this.leftRowSeriesNumberColumn[t];if(e>=this.headerLevelCount)return this.leftRowSeriesNumberColumn[t]}if(this.rightRowSeriesNumberColumnCount>0&&t>=this.colCount-this.rightRowSeriesNumberColumnCount){if(this.transpose)return this.rightRowSeriesNumberColumn[t-(this.colCount-this.rightRowSeriesNumberColumnCount)];if(e>=this.headerLevelCount)return this.rightRowSeriesNumberColumn[t-(this.colCount-this.rightRowSeriesNumberColumnCount)]}}isHeader(t,e){return!!(this.transpose&&t>=this.leftRowSeriesNumberColumnCount&&t<this.headerLevelCount+this.leftRowSeriesNumberColumnCount)||!this.transpose&&e>=0&&e<this.headerLevelCount}isAggregation(t,e){if(this.hasAggregation){if(this.hasAggregationOnBottomCount){if(this.transpose){if(t>=this.colCount-this.hasAggregationOnBottomCount)return!0}else if(e>=this.rowCount-this.hasAggregationOnBottomCount)return!0}if(this.hasAggregationOnTopCount){if(this.transpose){if(t>=this.rowHeaderLevelCount&&t<this.rowHeaderLevelCount+this.hasAggregationOnTopCount)return!0}else if(e>=this.columnHeaderLevelCount&&e<this.columnHeaderLevelCount+this.hasAggregationOnTopCount)return!0}}return!1}isTopAggregation(t,e){if(this.hasAggregationOnTopCount){if(this.transpose){if(t>=this.rowHeaderLevelCount&&t<this.rowHeaderLevelCount+this.hasAggregationOnTopCount)return!0}else if(e>=this.columnHeaderLevelCount&&e<this.columnHeaderLevelCount+this.hasAggregationOnTopCount)return!0}return!1}isBottomAggregation(t,e){if(this.hasAggregationOnBottomCount){if(this.transpose){if(t>=this.colCount-this.hasAggregationOnBottomCount)return!0}else if(e>=this.rowCount-this.hasAggregationOnBottomCount)return!0}return!1}get hasAggregation(){return this._hasAggregation}get hasAggregationOnTopCount(){return this._hasAggregationOnTopCount}get hasAggregationOnBottomCount(){return this._hasAggregationOnBottomCount}getAggregatorsByCell(t,e){return this.getColumnDefine(t,e).vtable_aggregator}getAggregatorsByCellRange(t,e,n,o){let r=[];if(!this.transpose){for(let s=t;s<=n;s++){const l=this.getColumnDefine(s,e);l.vtable_aggregator&&(r=r.concat(Array.isArray(l.vtable_aggregator)?l.vtable_aggregator:[l.vtable_aggregator]))}return r}for(let s=e;s<=o;s++){const l=this.getColumnDefine(t,s);l.vtable_aggregator&&(r=r.concat(Array.isArray(l.vtable_aggregator)?l.vtable_aggregator:[l.vtable_aggregator]))}return[]}getAggregatorOnTop(t,e){const n=this.getColumnDefine(t,e),o=n.vtable_aggregator,r=n.aggregation;if(Array.isArray(r)){const s=r.reduce((l,a,h)=>(a.showOnTop&&l.push(h),l),[]).map(l=>o[l]);return this.transpose?s[t-this.rowHeaderLevelCount]:s[e-this.columnHeaderLevelCount]}return this.transpose&&t-this.rowHeaderLevelCount==0?r!=null&&r.showOnTop?o:null:this.transpose||e-this.columnHeaderLevelCount!=0?null:r!=null&&r.showOnTop?o:null}getAggregatorOnBottom(t,e){const n=this.getColumnDefine(t,e),o=n.vtable_aggregator,r=n.aggregation;if(Array.isArray(r)){const s=r.reduce((l,a,h)=>(a.showOnTop||l.push(h),l),[]).map(l=>o[l]);return this.transpose?s[t-(this.colCount-this.hasAggregationOnBottomCount)]:s[e-(this.rowCount-this.hasAggregationOnBottomCount)]}return this.transpose&&t-(this.colCount-this.hasAggregationOnBottomCount)==0?r!=null&&r.showOnTop?null:o:this.transpose||e-(this.rowCount-this.hasAggregationOnBottomCount)!=0||r!=null&&r.showOnTop?null:o}getAggregatorCellAddress(t,e,n,o){const r=[],s=this.hasAggregationOnTopCount,l=this.hasAggregationOnBottomCount;if(this.transpose){for(let a=e;a<=o;a++)if(this.getColumnDefine(t,a).vtable_aggregator){for(let h=0;h<s;h++)r.push({col:this.headerLevelCount+h,row:a});for(let h=0;h<l;h++)r.push({col:this.rowCount-l+h,row:a})}}else for(let a=t;a<=n;a++)if(this.getColumnDefine(a,e).vtable_aggregator){for(let h=0;h<s;h++)r.push({col:a,row:this.headerLevelCount+h});for(let h=0;h<l;h++)r.push({col:a,row:this.rowCount-l+h})}return r}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(z(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(z(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(z(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(z(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}isLeftTopCorner(t,e){return t>=0&&t<this.frozenColCount&&e>=0&&e<this.frozenRowCount}isLeftBottomCorner(t,e){return t>=0&&t<this.frozenColCount&&e>=this.rowCount-this.bottomFrozenRowCount}isRightTopCorner(t,e){return t>=this.colCount-this.rightFrozenColCount&&e>=0&&e<this.frozenRowCount}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:((t=this.rowCount)!==null&&t!==void 0?t:0)-1}}:{start:{col:0,row:0},end:{col:((e=this.colCount)!==null&&e!==void 0?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:((t=this.rowCount)!==null&&t!==void 0?t:0)-1}}:{start:{col:0,row:0},end:{col:((e=this.colCount)!==null&&e!==void 0?e:0)-1,row:this._headerCellIds.length-1}}}getCornerHeaderRange(){}getBodyRange(){var t,e,n,o;return this.transpose?{start:{col:this.headerLevelCount,row:0},end:{col:((t=this.colCount)!==null&&t!==void 0?t:0)-1,row:((e=this.rowCount)!==null&&e!==void 0?e:0)-1}}:{start:{col:0,row:this.headerLevelCount},end:{col:((n=this.colCount)!==null&&n!==void 0?n:0)-1,row:((o=this.rowCount)!==null&&o!==void 0?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(e=>({width:e.width,minWidth:e.minWidth,maxWidth:e.maxWidth}));return t.push(...this._columns.map(e=>({width:e.width,minWidth:e.minWidth,maxWidth:e.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 n,o,r=0;if(t>=this.rowHeaderLevelCount+this.leftRowSeriesNumberColumnCount){let s;return this.columnObjects.forEach((l,a)=>{typeof l.width=="number"?r=Math.max(l.width,r):l.width==="auto"&&(s=!0),typeof l.minWidth=="number"&&(o=Math.max(l.minWidth,o)),typeof l.maxWidth=="number"&&(n=Math.max(l.maxWidth,n))}),r=r>0?r:s?"auto":void 0,{width:r,minWidth:o,maxWidth:n}}if(this.isRowHeader(t,0)){const s=Array.isArray(this._table.defaultHeaderColWidth)?(e=this._table.defaultHeaderColWidth[t])!==null&&e!==void 0?e:this._table.defaultColWidth:this._table.defaultHeaderColWidth;return s==="auto"?{width:"auto"}:{width:s}}}return this._columns[t-this.leftRowSeriesNumberColumnCount]}}getCellId(t,e){var n,o,r,s;return this.transpose?t>=this.headerLevelCount+this.leftRowSeriesNumberColumnCount?(n=this._columns[e])===null||n===void 0?void 0:n.id:this.isSeriesNumber(t,e)?e+"_series_number":(o=this._headerCellIds[t-this.leftRowSeriesNumberColumnCount])===null||o===void 0?void 0:o[e]:this.isSeriesNumber(t,e)?this.rowSeriesNumberColumn[t].id:this.headerLevelCount<=e?(r=this._columns[t-this.leftRowSeriesNumberColumnCount])===null||r===void 0?void 0:r.id:(s=this._headerCellIds[e])===null||s===void 0?void 0:s[t-this.leftRowSeriesNumberColumnCount]}getHeader(t,e){if(this.isSeriesNumberInHeader(t,e))return this.getSeriesNumberHeader(t,e);const n=this.getCellId(t,e);return this._headerObjectMap[n]}getHeaderField(t,e){var n;const o=this.getCellId(t,e);return((n=this._headerObjectMap[o])===null||n===void 0?void 0:n.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 n=this._headerCellIds[e];for(let o=0;o<n.length;o++)if(n[o]===t)return this.transpose?{col:e,row:o}:{col:o+this.leftRowSeriesNumberColumnCount,row:e}}}getHeaderCellAddressByField(t){const e=this.headerObjects.find(n=>n&&n.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,n;if(this.transpose){for(let o=0;o<((e=this.rowCount)!==null&&e!==void 0?e:0);o++)if(t===this._columns[o].id)return{start:{col:0,row:o},end:{col:0,row:o}}}else for(let o=this.leftRowSeriesNumberColumnCount;o<((n=this.colCount)!==null&&n!==void 0?n:0);o++)if(t===this._columns[o-this.leftRowSeriesNumberColumnCount].id)return{start:{col:o,row:0},end:{col:o,row:0}};return{start:{col:-1,row:-1},end:{col:-1,row:-1}}}getCellRange(t,e){return bV(t,e,this)}isCellRangeEqual(t,e,n,o){const r=this.getCellRange(t,e),s=this.getCellRange(n,o);return r.start.col===s.start.col&&r.end.col===s.end.col&&r.start.row===s.start.row&&r.end.row===s.end.row}getRecordShowIndexByCell(t,e){const n=this.hasAggregationOnTopCount?this.headerLevelCount+1:this.headerLevelCount;return this.transpose?t<n?-1:t-n:e<n?-1:e-n}getRecordStartRowByRecordIndex(t){return(this.hasAggregationOnTopCount?this.headerLevelCount+1:this.headerLevelCount)+t}_addHeaders(t,e,n,o){const r=[],s=this._newRow(t,o);return e.forEach(l=>{var a,h,d,u;const c=this._columns.length,g=this.seqId++,f={id:g,title:(a=l.title)!==null&&a!==void 0?a:l.caption,headerIcon:l.headerIcon,field:l.field,style:l.headerStyle,headerType:(h=l.headerType)!==null&&h!==void 0?h:"text",dropDownMenu:l.dropDownMenu,define:l,columnWidthComputeMode:l.columnWidthComputeMode};r[g]=f;for(let p=t-1;p>=0;p--)this._headerCellIds[p]&&(this._headerCellIds[p][c]=n[p]);if(o?this._headerCellIds[t-1]&&(s[c]=this._headerCellIds[t-1][c]):s[c]=g,l.columns)this._addHeaders(t+1,l.columns,[...n,g],l.hideColumnsSubHeader||o).forEach(p=>r.push(p));else{const p={id:this.seqId++,field:l.field,fieldFormat:l.fieldFormat,width:l.width,minWidth:l.minWidth,maxWidth:l.maxWidth,icon:l.icon,cellType:(u=(d=l.cellType)!==null&&d!==void 0?d:l.columnType)!==null&&u!==void 0?u:"text",chartModule:"chartModule"in l?l.chartModule:null,chartSpec:"chartSpec"in l?l.chartSpec:null,sparklineSpec:"sparklineSpec"in l?l.sparklineSpec:z4,style:l.style,define:l,columnWidthComputeMode:l.columnWidthComputeMode,disableColumnResize:l==null?void 0:l.disableColumnResize,aggregation:l.aggregation,isChildNode:t>=1};if(this._columnsIncludeHided.push(p),l.hide!==!0){this._columns.push(p);for(let m=t+1;m<this._headerCellIds.length;m++)this._headerCellIds[m][c]=g}}}),r}_newRow(t,e=!1){if(this._headerCellIds[t]){const r=this._headerCellIds[t-1];if(r.length>this._headerCellIds[t].length)for(let s=this._headerCellIds[t].length;s<r.length;s++)this._headerCellIds[t][s]=r[s];return this._headerCellIds[t]}if(e)return[];const n=this._headerCellIds[t]=[];if(!this._columns.length)return n;const o=this._headerCellIds[t-1];for(let r=0;r<o.length;r++)n[r]=o[r];return n}getCellHeaderPaths(t,e){if(this.isSeriesNumber(t,e))return;let n=[],o=[];return this.transpose?o=[{field:this._columns[e].field}]:n=[{field:this._columns[t-this.leftRowSeriesNumberColumnCount].field}],{colHeaderPaths:n,rowHeaderPaths:o,cellLocation:this.getCellLocation(t,e)}}getParentCellId(t,e){if(e!==0){if(this.isColumnHeader(t,e))return this.getCellId(t,e-1);if(this.isRowHeader(t,e))return this.isSeriesNumberInBody(t-1,e)?void 0: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 o=this.getRecordShowIndexByCell(0,t.row),r=this.getRecordShowIndexByCell(0,e.row);return this._table.dataSource.isCanExchangeOrder(o,r)}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||this._table.internalProps.frozenColDragHeaderMode==="disabled"&&this._table.isFrozenColumn(e.col))return!1;const n=this.getCellRange(t.col,t.row);return this.isColumnHeader(t.col,t.row)?this.getParentCellId(t.col,n.start.row)===this.getParentCellId(e.col,n.start.row):this.isRowHeader(t.col,t.row)?this.getParentCellId(n.start.col,t.row)===this.getParentCellId(n.start.col,e.row):!1}moveHeaderPosition(t,e){if(this.canMoveHeaderPosition(t,e)){let n=this.getCellRange(t.col,t.row);if(this.isColumnHeader(t.col,t.row)){const o=n.end.col-n.start.col+1;let r;const s=this.getCellRange(e.col,n.start.row);if(r=e.col>=t.col?s.end.col-o+1:s.start.col,r===n.start.col)return null;for(let a=0;a<this._headerCellIds.length;a++){const h=this._headerCellIds[a].splice(n.start.col-this.leftRowSeriesNumberColumnCount,o);h.unshift(r-this.leftRowSeriesNumberColumnCount,0),Array.prototype.splice.apply(this._headerCellIds[a],h)}const l=this._columns.splice(n.start.col-this.leftRowSeriesNumberColumnCount,o);return l.unshift(r-this.leftRowSeriesNumberColumnCount,0),Array.prototype.splice.apply(this._columns,l),this.columnTree.movePosition(n.start.row,n.start.col-this.leftRowSeriesNumberColumnCount,r-this.leftRowSeriesNumberColumnCount),this.columnTree.reset(this.columnTree.tree.children,!0),this._cellRangeMap=new Map,{sourceIndex:n.start.col,targetIndex:r,sourceSize:o,targetSize:s.end.col-s.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)&&(n=this.getCellRange(t.col+this.leftRowSeriesNumberColumnCount,t.row));const o=n.end.row-n.start.row+1;let r;const s=this.getCellRange(n.start.col,e.row);if(r=e.row>=t.row?s.end.row-o+1:s.start.row,r===n.start.row)return null;for(let a=0;a<this._headerCellIds.length;a++){const h=this._headerCellIds[a].splice(n.start.row,o);h.unshift(r,0),Array.prototype.splice.apply(this._headerCellIds[a],h)}const l=this._columns.splice(n.start.row,o);return l.unshift(r,0),Array.prototype.splice.apply(this._columns,l),this.columnTree.movePosition(n.start.col-this.leftRowSeriesNumberColumnCount,n.start.row,r+(e.row>t.row?n.end.row-n.start.row:0)),this.columnTree.reset(this.columnTree.tree.children,!0),this._cellRangeMap=new Map,{sourceIndex:n.start.row,targetIndex:r,sourceSize:o,targetSize:s.end.row-s.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(e=>({col:0,row:this._table.columnHeaderLevelCount+e})),removeCellPositions:t.remove.map(e=>({col:0,row:this._table.columnHeaderLevelCount+e}))}}setChartInstance(t,e,n){const o=this.transpose?this._columns[e]:this._columns[t-this.leftRowSeriesNumberColumnCount];typeof o.chartSpec!="function"&&(o.chartInstance=n)}getChartInstance(t,e){return(this.transpose?this._columns[e]:this._columns[t-this.leftRowSeriesNumberColumnCount]).chartInstance}checkHasChart(){return uT(this)}getAxisConfigInPivotChart(t,e){}isEmpty(t,e){return!1}isAxisCell(t,e){return!1}getChartAxes(t,e){return[]}isShareChartSpec(t,e){const n=this.getBody(t,e);return typeof(n==null?void 0:n.chartSpec)!="function"}isNoChartDataRenderNothing(t,e){const n=this.getBody(t,e);return(n==null?void 0:n.define).noDataRenderNothing}getChartSpec(t,e){return this.getRawChartSpec(t,e)}getRawChartSpec(t,e){const n=this.getBody(t,e),o=n==null?void 0:n.chartSpec;return typeof o=="function"?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 dT(t,e,this)}release(){const t=this._table._getActiveChartInstance();t==null||t.release(),this.columnObjects.forEach(e=>{var n;(n=e.chartInstance)===null||n===void 0||n.release()})}clearCellRangeMap(){this._cellRangeMap.clear()}updateColumnTitle(t,e,n){const o=this._table.internalProps.layoutMap.getHeader(t,e);o.title=n,o.define.title=n}getColumnByField(t){var e;return(e=this.columnObjects)===null||e===void 0?void 0:e.reduce((n,o,r)=>(o.field===t&&n.push({col:r,columnDefine:o}),n),[])}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 cT{constructor(t){this.isValidatingValue=!1,this.table=t,this.bindEvent()}bindEvent(){this.table.internalProps.handler;const t=this.table.options.editCellTrigger;this.table.on(at.DBLCLICK_CELL,e=>{var n;if(!t||t==="doubleclick"||Array.isArray(t)&&t.includes("doubleclick")){const{col:o,row:r}=e,s=Ai(e.federatedEvent),l=this.table.scenegraph.getResizeColAt(s.abstractPos.x,s.abstractPos.y,(n=s.eventArgs)===null||n===void 0?void 0:n.targetCell);if(this.table._canResizeColumn(l.col,l.row)&&l.col>=0)return;this.startEditCell(o,r)}}),this.table.on(at.CLICK_CELL,e=>{if(t==="click"||Array.isArray(t)&&t.includes("click")){const{col:n,row:o}=e;this.startEditCell(n,o)}})}startEditCell(t,e,n){var o,r,s,l,a;if(this.editingEditor)return;const h=this.table.getEditor(t,e);if(h){if(!((r=(o=this.table.internalProps.layoutMap)===null||o===void 0?void 0:o.isAggregation)===null||r===void 0)&&r.call(o,t,e))return;this.editingEditor||(this.editCell={col:t,row:e}),this.editingEditor=h;const d=z(n)?n:this.table.getCellOriginValue(t,e),u=this.table.getCellRangeRelativeRect(this.table.getCellRange(t,e)),c={rect:{left:u.left,top:u.top,width:u.width,height:u.height}};h.beginEditing,(s=h.beginEditing)===null||s===void 0||s.call(h,this.table.getElement(),c,d),h.bindSuccessCallback,(l=h.bindSuccessCallback)===null||l===void 0||l.call(h,()=>{this.completeEdit()}),(a=h.onStart)===null||a===void 0||a.call(h,{value:d,endEdit:()=>{this.completeEdit()},referencePosition:c,container:this.table.getElement(),col:t,row:e})}}completeEdit(t){var e,n;if(!this.editingEditor)return!0;if(this.isValidatingValue)return!1;const o=t==null?void 0:t.target,{editingEditor:r}=this;if(o){if(r.targetIsOnEditor){if(r.targetIsOnEditor(o))return!1}else if(!r.isEditorElement||r.isEditorElement(o))return!1}if(this.editingEditor.getValue,this.editingEditor.validateValue){this.isValidatingValue=!0;const s=(n=(e=this.editingEditor).validateValue)===null||n===void 0?void 0:n.call(e);return so(s)?new Promise((l,a)=>{s.then(h=>{h?(this.doExit(),l(!0)):(this.isValidatingValue=!1,l(!1))}).catch(h=>{this.isValidatingValue=!1,a(h)})}):!!s&&(this.doExit(),!0)}return this.doExit(),!0}doExit(){var t,e,n,o,r,s;const l=(e=(t=this.editingEditor).getValue)===null||e===void 0?void 0:e.call(t),a=this.table.getCellRange(this.editCell.col,this.editCell.row),h=[];for(let d=a.start.row;d<=a.end.row;d++){const u=[];for(let c=a.start.col;c<=a.end.col;c++)u.push(l);h.push(u)}this.table.changeCellValues(a.start.col,a.start.row,h),this.editingEditor.exit,(o=(n=this.editingEditor).exit)===null||o===void 0||o.call(n),(s=(r=this.editingEditor).onEnd)===null||s===void 0||s.call(r),this.editingEditor=null,this.isValidatingValue=!1}cancelEdit(){var t,e,n,o;this.editingEditor&&((e=(t=this.editingEditor).exit)===null||e===void 0||e.call(t),(o=(n=this.editingEditor).onEnd)===null||o===void 0||o.call(n),this.editingEditor=null)}}function gT(i){return ce(i)?{groupByRules:[i]}:lt(i)?{groupByRules:i.map(t=>ce(t)?t:t.key)}:{}}function wV(i,t,e,n,o){if(n&&o.isHasEditorDefine(i,t)||n===!1){const r=o.getRecordShowIndexByCell(i,t),{field:s}=o.internalProps.layoutMap.getBody(i,t),l=o.getCellRawValue(i,t),a=o.getCellOriginValue(i,t);o.isHeader(i,t)?o.internalProps.layoutMap.updateColumnTitle(i,t,e):o.dataSource.changeFieldValue(e,r,s,i,t,o);const h=o.getCellRange(i,t),d=o.internalProps.layoutMap.getAggregatorsByCell(i,t);if(d){if(Array.isArray(d))for(let c=0;c<(d==null?void 0:d.length);c++)d[c].recalculate();else d.recalculate();const u=o.internalProps.layoutMap.getAggregatorCellAddress(h.start.col,h.start.row,h.end.col,h.end.row);for(let c=0;c<u.length;c++){const g=o.getCellRange(u[c].col,u[c].row);for(let f=g.start.col;f<=g.end.col;f++)for(let p=g.start.row;p<=g.end.row;p++)o.scenegraph.updateCellContent(f,p)}}for(let u=h.start.col;u<=h.end.col;u++)for(let c=h.start.row;c<=h.end.row;c++)o.scenegraph.updateCellContent(u,c);if(o.widthMode==="adaptive"||o.autoFillWidth&&o.getAllColsWidth()<=o.tableNoFrameWidth)o.internalProps._widthResizedColMap.size===0&&o.scenegraph.recalculateColWidths();else if(!o.internalProps._widthResizedColMap.has(i)){const u=o.getColWidth(i),c=Fr(i,0,o.rowCount-1,o,!1);c!==u&&o.scenegraph.updateColWidth(i,c-u)}if(o.heightMode==="adaptive"||o.autoFillHeight&&o.getAllRowsHeight()<=o.tableNoFrameHeight)o.internalProps._heightResizedRowMap.size===0&&o.scenegraph.recalculateRowHeights();else if(o.heightMode==="autoHeight"&&!o.internalProps._heightResizedRowMap.has(t)){const u=o.getRowHeight(t),c=nn(t,0,o.colCount-1,o);o.scenegraph.updateRowHeight(t,c-u)}o.fireListeners(at.CHANGE_CELL_VALUE,{col:i,row:t,rawValue:l,currentValue:a,changedValue:o.getCellOriginValue(i,t)}),o.scenegraph.updateNextFrame()}}function SV(i,t,e,n,o){var r,s;let l=i,a=t;const h=[],d=[];let u;for(let p=0;p<e.length&&!(t+p>o.rowCount-1);p++){const m=e[p],b=[],C=[];h.push(b),d.push(C);for(let _=0;_<m.length&&!(i+_>o.colCount-1);_++){u=xV(i+_,t+p,o,u);const w=o.getCellRawValue(i+_,t+p);b.push(w);const y=o.getCellOriginValue(i+_,t+p);C.push(y)}}for(let p=0;p<e.length&&!(t+p>o.rowCount-1);p++){a=t+p;const m=e[p];let b=i;for(let C=0;C<m.length&&!(i+C>o.colCount-1);C++){b=i+C;let _=!1;if(n===!1)_=!0;else if(o.isHasEditorDefine(i+C,t+p)){const w=o.getEditor(i+C,t+p),y=d[p][C],S=m[C],A=(s=(r=w==null?void 0:w.validateValue)===null||r===void 0?void 0:r.call(w,S,y))===null||s===void 0||s;_=!!so(A)||A}if(_){const w=m[C],y=o.getRecordShowIndexByCell(i+C,t+p),{field:S}=o.internalProps.layoutMap.getBody(i+C,t+p),A=h[p][C],R=d[p][C];o.isHeader(i+C,t+p)?o.internalProps.layoutMap.updateColumnTitle(i+C,t+p,w):o.dataSource.changeFieldValue(w,y,S,i+C,t+p,o),o.fireListeners(at.CHANGE_CELL_VALUE,{col:i+C,row:t+p,rawValue:A,currentValue:R,changedValue:o.getCellOriginValue(i+C,t+p)})}}l=Math.max(l,b)}const c=o.getCellRange(i,t),g=o.getCellRange(l,a),f=o.internalProps.layoutMap.getAggregatorsByCellRange(c.start.col,c.start.row,g.end.col,g.end.row);if(f){for(let p=0;p<(f==null?void 0:f.length);p++)f[p].recalculate();if(u==="normal"){const p=o.internalProps.layoutMap.getAggregatorCellAddress(c.start.col,c.start.row,g.end.col,g.end.row);for(let m=0;m<p.length;m++){const b=o.getCellRange(p[m].col,p[m].row);for(let C=b.start.col;C<=b.end.col;C++)for(let _=b.start.row;_<=b.end.row;_++)o.scenegraph.updateCellContent(C,_)}}}if(u==="group"&&o.dataSource.updateRecordsForGroup([],[]),u==="sort"||u==="group")return o.dataSource.sortedIndexMap.clear(),El(o),o.refreshRowColCount(),o.internalProps.layoutMap.clearCellRangeMap(),o.scenegraph.clearCells(),void o.scenegraph.createSceneGraph();for(let p=c.start.col;p<=g.end.col;p++)for(let m=c.start.row;m<=g.end.row;m++)o.scenegraph.updateCellContent(p,m);if(o.widthMode==="adaptive"||o.autoFillWidth&&o.getAllColsWidth()<=o.tableNoFrameWidth)o.internalProps._widthResizedColMap.size===0&&o.scenegraph.recalculateColWidths();else for(let p=i;p<=g.end.col;p++)if(!o.internalProps._widthResizedColMap.has(p)){const m=o.getColWidth(p),b=Fr(p,0,o.rowCount-1,o,!1);b!==m&&o.scenegraph.updateColWidth(p,b-m)}if(o.heightMode==="adaptive"||o.autoFillHeight&&o.getAllRowsHeight()<=o.tableNoFrameHeight)o.scenegraph.recalculateRowHeights();else if(o.heightMode==="autoHeight"){const p=[],m=[];for(let b=t;b<=g.end.row;b++)if(o.rowHeightsMap.get(b)){const C=o.getRowHeight(b),_=nn(b,0,o.colCount-1,o);p.push(b),m.push(_-C)}o.scenegraph.updateRowsHeight(p,m)}o.scenegraph.updateNextFrame()}function xV(i,t,e,n){if(n==="group"||n==="sort"&&!e.options.groupBy)return n;let o="normal";return e.options.groupBy?o="group":!e.isHeader(i,t)&&e.dataSource.lastOrderField&&e.getBodyField(i,t)===e.dataSource.lastOrderField&&(o="sort"),o}function El(i){let t=i.sortState;t=!t||Array.isArray(t)?t:[t],t&&(t=t.map(e=>{var n;return e.orderFn=(n=i._getSortFuncFromHeaderOption(void 0,e.field))!==null&&n!==void 0?n:sm,e}),i.dataSource.sort(t))}function RV(i,t,e){var n,o;if(e.options.groupBy)(o=(n=e.dataSource).addRecordsForGroup)===null||o===void 0||o.call(n,[i],t),e.refreshRowColCount(),e.internalProps.layoutMap.clearCellRangeMap(),e.scenegraph.clearCells(),e.scenegraph.createSceneGraph();else if(e.sortState)e.dataSource.addRecordForSorted(i),El(e),e.refreshRowColCount(),e.scenegraph.clearCells(),e.scenegraph.createSceneGraph();else{(t===void 0||t>e.dataSource.sourceLength)&&(t=e.dataSource.sourceLength);const r=e.transpose?e.rowHeaderLevelCount:e.columnHeaderLevelCount;e.dataSource.addRecord(i,t);const s=e.rowCount;if(e.refreshRowColCount(),e.scenegraph.proxy.totalActualBodyRowCount===0)return e.scenegraph.clearCells(),void e.scenegraph.createSceneGraph();const l=e.transpose?e.colCount:e.rowCount;if(e.pagination){const{perPageCount:a,currentPage:h}=e.pagination,d=a*(h||0)+a;if(t<d)if(t<d-a)e.scenegraph.clearCells(),e.scenegraph.createSceneGraph();else{const u=t-(d-a)+r;if(s-r===e.pagination.perPageCount){const c=[];for(let g=u;g<l;g++)e.transpose?c.push({col:g,row:0}):c.push({col:0,row:g});e.transpose?e.scenegraph.updateCol([],[],c):e.scenegraph.updateRow([],[],c)}else{const c=[];for(let g=u;g<Math.min(l,u+1);g++)e.transpose?c.push({col:g,row:0}):c.push({col:0,row:g});e.transpose?e.scenegraph.updateCol([],c,[]):e.scenegraph.updateRow([],c,[])}}}else{const a=[];for(let c=t+r;c<t+r+1;c++)e.transpose?a.push({col:c,row:0}):a.push({col:0,row:c});const h=[],d=e.internalProps.layoutMap.hasAggregationOnTopCount,u=e.internalProps.layoutMap.hasAggregationOnBottomCount;for(let c=r;c<r+d;c++)e.transpose?h.push({col:c,row:0}):h.push({col:0,row:c});for(let c=(e.transpose?e.colCount:e.rowCount)-u;c<(e.transpose?e.colCount:e.rowCount);c++)e.transpose?h.push({col:c,row:0}):h.push({col:0,row:c});e.transpose?e.scenegraph.updateCol([],a,[]):e.scenegraph.updateRow([],a,[])}}}function AV(i,t,e){var n,o;if(e.options.groupBy)(o=(n=e.dataSource).addRecordsForGroup)===null||o===void 0||o.call(n,i,t),e.refreshRowColCount(),e.internalProps.layoutMap.clearCellRangeMap(),e.scenegraph.clearCells(),e.scenegraph.createSceneGraph();else if(e.sortState)e.dataSource.addRecordsForSorted(i),El(e),e.refreshRowColCount(),e.scenegraph.clearCells(),e.scenegraph.createSceneGraph();else{t===void 0||t>e.dataSource.sourceLength?t=e.dataSource.sourceLength:t<0&&(t=0);const r=e.transpose?e.rowHeaderLevelCount:e.columnHeaderLevelCount;e.dataSource.addRecords(i,t);const s=e.transpose?e.colCount:e.rowCount;if(e.refreshRowColCount(),e.scenegraph.proxy.totalActualBodyRowCount===0)return e.scenegraph.clearCells(),void e.scenegraph.createSceneGraph();const l=e.transpose?e.colCount:e.rowCount;if(e.pagination){const{perPageCount:a,currentPage:h}=e.pagination,d=a*(h||0)+a;if(t<d)if(t<d-a)e.scenegraph.clearCells(),e.scenegraph.createSceneGraph();else{const u=t-(d-a)+r;if(s-r===e.pagination.perPageCount){const c=[];for(let g=u;g<l;g++)e.transpose?c.push({col:g,row:0}):c.push({col:0,row:g});e.transpose?e.scenegraph.updateCol([],[],c):e.scenegraph.updateRow([],[],c)}else{const c=[];for(let g=u;g<Math.min(l,u+(Array.isArray(i)?i.length:1));g++)e.transpose?c.push({col:g,row:0}):c.push({col:0,row:g});e.transpose?e.scenegraph.updateCol([],c,[]):e.scenegraph.updateRow([],c,[])}}}else{const a=[];for(let c=t+r;c<t+r+(Array.isArray(i)?i.length:1);c++)e.transpose?a.push({col:c,row:0}):a.push({col:0,row:c});const h=e.internalProps.layoutMap.hasAggregationOnTopCount,d=e.internalProps.layoutMap.hasAggregationOnBottomCount,u=[];for(let c=r;c<r+h;c++)e.transpose?u.push({col:c,row:0}):u.push({col:0,row:c});for(let c=(e.transpose?e.colCount:e.rowCount)-d;c<(e.transpose?e.colCount:e.rowCount);c++)e.transpose?u.push({col:c,row:0}):u.push({col:0,row:c});e.transpose?e.scenegraph.updateCol([],a,u):e.scenegraph.updateRow([],a,u)}}}function TV(i,t){var e,n;if((i==null?void 0:i.length)>0)if(t.options.groupBy)(n=(e=t.dataSource).deleteRecordsForGroup)===null||n===void 0||n.call(e,i),t.refreshRowColCount(),t.internalProps.layoutMap.clearCellRangeMap(),t.scenegraph.clearCells(),t.scenegraph.createSceneGraph();else if(t.sortState)t.dataSource.deleteRecordsForSorted(i),El(t),t.refreshRowColCount(),t.scenegraph.clearCells(),t.scenegraph.createSceneGraph();else{const o=t.dataSource.deleteRecords(i);if(o.length===0)return;const r=t.transpose?t.colCount:t.rowCount;t.refreshRowColCount();const s=t.transpose?t.colCount:t.rowCount,l=o.sort((h,d)=>h-d),a=l[0];if(t.pagination){const{perPageCount:h,currentPage:d}=t.pagination,u=h*(d||0)+h;if(a<u)if(a<u-h)t.scenegraph.clearCells(),t.scenegraph.createSceneGraph();else{const c=t.transpose?t.rowHeaderLevelCount:t.columnHeaderLevelCount,g=t.internalProps.layoutMap.hasAggregationOnTopCount,f=[],p=[];for(let m=a-(u-h)+(t.transpose?t.rowHeaderLevelCount:t.columnHeaderLevelCount)+g;m<s;m++)t.transpose?f.push({col:m,row:0}):f.push({col:0,row:m});for(let m=c;m<c+g;m++)t.transpose?f.push({col:m,row:0}):f.push({col:0,row:m});if(s<r)for(let m=s;m<r;m++)t.transpose?p.push({col:m,row:0}):p.push({col:0,row:m});t.transpose?t.scenegraph.updateCol(p,[],f):t.scenegraph.updateRow(p,[],f)}}else{const h=[],d=t.transpose?t.rowHeaderLevelCount:t.columnHeaderLevelCount,u=t.internalProps.layoutMap.hasAggregationOnTopCount,c=t.internalProps.layoutMap.hasAggregationOnBottomCount;for(let f=0;f<l.length;f++){const p=l[f]+d+u;t.transpose?h.push({col:p,row:0}):h.push({col:0,row:p})}const g=[];for(let f=d;f<d+u;f++)t.transpose?g.push({col:f,row:0}):g.push({col:0,row:f});for(let f=(t.transpose?t.colCount:t.rowCount)-c;f<(t.transpose?t.colCount:t.rowCount);f++)t.transpose?g.push({col:f,row:0}):g.push({col:0,row:f});t.transpose?t.scenegraph.updateCol(h,[],g):t.scenegraph.updateRow(h,[],g)}}}function MV(i,t,e){var n,o;if((t==null?void 0:t.length)>0)if(e.options.groupBy)(o=(n=e.dataSource).updateRecordsForGroup)===null||o===void 0||o.call(n,i,t),e.refreshRowColCount(),e.internalProps.layoutMap.clearCellRangeMap(),e.scenegraph.clearCells(),e.scenegraph.createSceneGraph();else if(e.sortState)e.dataSource.updateRecordsForSorted(i,t),El(e),e.refreshRowColCount(),e.scenegraph.clearCells(),e.scenegraph.createSceneGraph();else{const r=e.dataSource.updateRecords(i,t);if(r.length===0)return;const s=r.map(l=>e.getBodyRowIndexByRecordIndex(l)).sort((l,a)=>l-a);if(e.pagination){const{perPageCount:l,currentPage:a}=e.pagination,h=e.transpose?e.rowHeaderLevelCount:e.columnHeaderLevelCount,d=e.internalProps.layoutMap.hasAggregationOnTopCount,u=l*(a||0)+l,c=[];for(let g=0;g<s.length;g++){const f=s[g];if(f<u&&f>=u-l){const p=f-(u-l)+(e.transpose?e.rowHeaderLevelCount:e.columnHeaderLevelCount)+d;c.push(p)}}if(c.length>=1){const g=[];for(let f=0;f<c.length;f++){const p=c[f];e.transpose?g.push({col:p,row:0}):g.push({col:0,row:p})}for(let f=h;f<h+d;f++)e.transpose?g.push({col:f,row:0}):g.push({col:0,row:f});e.transpose?e.scenegraph.updateCol([],[],g):e.scenegraph.updateRow([],[],g)}}else{const l=[],a=e.transpose?e.rowHeaderLevelCount:e.columnHeaderLevelCount,h=e.internalProps.layoutMap.hasAggregationOnTopCount,d=e.internalProps.layoutMap.hasAggregationOnBottomCount;for(let u=0;u<s.length;u++){const c=s[u]+a+h;e.transpose?l.push({col:c,row:0}):l.push({col:0,row:c})}for(let u=a;u<a+h;u++)e.transpose?l.push({col:u,row:0}):l.push({col:0,row:u});for(let u=(e.transpose?e.colCount:e.rowCount)-d;u<(e.transpose?e.colCount:e.rowCount);u++)e.transpose?l.push({col:u,row:0}):l.push({col:0,row:u});e.transpose?e.scenegraph.updateCol([],[],l):e.scenegraph.updateRow([],[],l)}}}class fT extends Cg{constructor(t,e){var n,o,r,s;oe.mode==="node"?(e=t,t=null):t instanceof HTMLElement||(e=t,t=t.container?t.container:null),super(t,e),this.showHeader=!0;const l=this.internalProps;if(l.frozenColDragHeaderMode=e.frozenColDragHeaderMode,this.pagination=e.pagination,l.sortState=e.sortState,l.multipleSort=!!e.multipleSort,l.dataConfig=e.groupBy?gT(e.groupBy):{},l.columns=e.columns?ho(e.columns,["children"]):e.header?ho(e.header,["children"]):[],Tc(this),l.enableTreeNodeMerge=(o=(n=e.enableTreeNodeMerge)!==null&&n!==void 0?n:z(e.groupBy))!==null&&o!==void 0&&o,this.internalProps.headerHelper.setTableColumnsEditor(),this.showHeader=(r=e.showHeader)===null||r===void 0||r,this.transpose=(s=e.transpose)!==null&&s!==void 0&&s,oe.mode!=="node"&&(this.editorManager=new cT(this)),this.refreshHeader(),this.internalProps.useOneRowHeightFillAll=!1,e.dataSource?wm(this,e.dataSource):e.records?this.setRecords(e.records,{sortState:l.sortState}):this.setRecords([]),e.title){const a=Bt.getComponent("title");l.title=new a(e.title,this),this.scenegraph.resize()}if(this.options.emptyTip)if(this.internalProps.emptyTip)this.internalProps.emptyTip.resetVisible();else{const a=Bt.getComponent("emptyTip");this.internalProps.emptyTip=new a(this.options.emptyTip,this),this.internalProps.emptyTip.resetVisible()}if(e.enableTreeStickCell){const a=Bt.getComponent("listTreeStickCellPlugin");this.listTreeStickCellPlugin=new a(this)}setTimeout(()=>{this.fireListeners(at.INITIALIZED,null)},0)}isListTable(){return!0}isPivotTable(){return!1}isPivotChart(){return!1}get sortState(){return this.internalProps.sortState}get records(){var t;return(t=this.dataSource)===null||t===void 0?void 0:t.records}get recordsCount(){return this.dataSource.records.length}updateColumns(t){var e,n,o,r;const s={col:this.stateManager.hover.cellPos.col,row:this.stateManager.hover.cellPos.row};this.internalProps.columns=ho(t,["children"]),Tc(this),this.options.columns=t,this.internalProps.headerHelper.setTableColumnsEditor(),this._hasAutoImageColumn=void 0,this.refreshHeader(),(n=(e=this.dataSource).updateColumns)===null||n===void 0||n.call(e,this.internalProps.columns),this.records&&F6(t)&&this.dataSource.processRecords((r=(o=this.dataSource.dataSourceObj)===null||o===void 0?void 0:o.records)!==null&&r!==void 0?r: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(s.col,s.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,Tc(this),this.options.header=t,this.refreshHeader(),this.internalProps.useOneRowHeightFillAll=!1,this.renderAsync()}get transpose(){var t;return(t=this.internalProps.transpose)!==null&&t!==void 0&&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,n){if(t===-1||e===-1)return null;if(!n){const l=this.getCustomMergeValue(t,e);if(l)return l}const o=this;if(o.internalProps.layoutMap.isSeriesNumber(t,e)){if(o.internalProps.layoutMap.isSeriesNumberInHeader(t,e)){const{title:a}=o.internalProps.layoutMap.getSeriesNumberHeader(t,e);return a}if(this.options.groupBy){const{vtableMerge:a}=o.getCellRawRecord(t,e);if(a)return"";const h=this.dataSource.currentIndexedData[e-this.columnHeaderLevelCount];return h[h.length-1]+1}const{format:l}=o.internalProps.layoutMap.getSeriesNumberBody(t,e);return typeof l=="function"?l(t,e,this):e-this.columnHeaderLevelCount+1}if(o.internalProps.layoutMap.isHeader(t,e)){const{title:l}=o.internalProps.layoutMap.getHeader(t,e);return typeof l=="function"?l():l}if(o.internalProps.layoutMap.isAggregation(t,e)){if(o.internalProps.layoutMap.isTopAggregation(t,e)){const l=o.internalProps.layoutMap.getAggregatorOnTop(t,e);return l!=null&&l.formatValue?l.formatValue(t,e,this):""}if(o.internalProps.layoutMap.isBottomAggregation(t,e)){const l=o.internalProps.layoutMap.getAggregatorOnBottom(t,e);return l!=null&&l.formatValue?l.formatValue(t,e,this):""}}const{field:r,fieldFormat:s}=o.internalProps.layoutMap.getBody(t,e);return o.getFieldData(s||r,t,e)}getCellOriginValue(t,e){if(t===-1||e===-1)return null;const n=this;if(n.internalProps.layoutMap.isSeriesNumber(t,e)){if(n.internalProps.layoutMap.isSeriesNumberInHeader(t,e)){const{title:s}=n.internalProps.layoutMap.getSeriesNumberHeader(t,e);return s}const{format:r}=n.internalProps.layoutMap.getSeriesNumberBody(t,e);return typeof r=="function"?r(t,e,this):e-this.columnHeaderLevelCount}if(n.internalProps.layoutMap.isHeader(t,e)){const{title:r}=n.internalProps.layoutMap.getHeader(t,e);return typeof r=="function"?r():r}if(n.internalProps.layoutMap.isAggregation(t,e)){if(n.internalProps.layoutMap.isTopAggregation(t,e)){const r=n.internalProps.layoutMap.getAggregatorOnTop(t,e);return r==null?void 0:r.value()}if(n.internalProps.layoutMap.isBottomAggregation(t,e)){const r=n.internalProps.layoutMap.getAggregatorOnBottom(t,e);return r==null?void 0:r.value()}}const{field:o}=n.internalProps.layoutMap.getBody(t,e);return n.getFieldData(o,t,e)}getCellRawValue(t,e){if(t===-1||e===-1)return null;const n=this;if(n.internalProps.layoutMap.isHeader(t,e)){const{title:r}=n.internalProps.layoutMap.getHeader(t,e);return typeof r=="function"?r():r}const{field:o}=n.internalProps.layoutMap.getBody(t,e);return n.getRawFieldData(o,t,e)}getRecordShowIndexByCell(t,e){const{layoutMap:n}=this.internalProps;return n.getRecordShowIndexByCell(t,e)}getRecordIndexByCell(t,e){const{layoutMap:n}=this.internalProps,o=n.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(o=>o.field===t);if(!e)return-1;const n=this.internalProps.layoutMap.getBodyLayoutRangeById(e.id);return this.transpose?n.start.row:n.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 n=this,o=n.getRecordShowIndexByCell(t,e);if(o>-1)return n.dataSource.get(o)}getCellRawRecord(t,e){const n=this,o=n.getRecordShowIndexByCell(t,e);if(o>-1)return n.dataSource.getRaw(o)}_canResizeColumn(t,e){const n=super._canResizeColumn(t,e);if(n&&!this.transpose){const o=this.internalProps.layoutMap.getBody(t,this.columnHeaderLevelCount),r=this.internalProps.layoutMap.isSeriesNumber(t,e);if(o!=null&&o.disableColumnResize||r&&this.internalProps.rowSeriesNumber.disableColumnResize===!0)return!1}return n}updateOption(t){var e,n,o,r;const s=this.internalProps;if(super.updateOption(t),s.frozenColDragHeaderMode=t.frozenColDragHeaderMode,this.pagination=t.pagination,s.sortState=t.sortState,s.dataConfig=t.groupBy?gT(t.groupBy):{},this.showHeader=(e=t.showHeader)===null||e===void 0||e,s.columns=t.columns?ho(t.columns,["children"]):t.header?ho(t.header,["children"]):[],Tc(this),s.enableTreeNodeMerge=(o=(n=t.enableTreeNodeMerge)!==null&&n!==void 0?n:z(t.groupBy))!==null&&o!==void 0&&o,this.internalProps.headerHelper.setTableColumnsEditor(),this.transpose=(r=t.transpose)!==null&&r!==void 0&&r,this.refreshHeader(),this.internalProps.useOneRowHeightFillAll=!1,s.releaseList&&(s.releaseList.forEach(l=>{var a;return(a=l==null?void 0:l.release)===null||a===void 0?void 0:a.call(l)}),s.releaseList=null),t.dataSource?wm(this,t.dataSource):t.records?this.setRecords(t.records,{sortState:t.sortState}):(this._resetFrozenColCount(),this.scenegraph.createSceneGraph(),this.render()),t.title){const l=Bt.getComponent("title");s.title=new l(t.title,this),this.scenegraph.resize()}if(this.options.emptyTip)if(this.internalProps.emptyTip)this.internalProps.emptyTip.resetVisible();else{const l=Bt.getComponent("emptyTip");this.internalProps.emptyTip=new l(this.options.emptyTip,this),this.internalProps.emptyTip.resetVisible()}return new Promise(l=>{setTimeout(l,0)})}updatePagination(t){this.pagination&&(typeof t.currentPage=="number"&&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,n=this.transpose,o=this.showHeader;(e.layoutMap=new _V(this,(t=e.columns)!==null&&t!==void 0?t:[],o,this.options.hierarchyIndent)).transpose=n,n||this.setMinMaxLimitWidth(!0),this.refreshRowColCount()}refreshRowColCount(){var t,e,n,o,r,s,l,a,h,d,u,c,g,f,p,m,b,C;const _=this,{layoutMap:w}=_.internalProps;if(!w)return;const y=(e=(t=_.internalProps.dataSource)===null||t===void 0?void 0:t.length)!==null&&e!==void 0?e:0;w.recordsCount=y+(y>0?w.hasAggregationOnTopCount+w.hasAggregationOnBottomCount:0),_.transpose?(_.rowCount=(n=w.rowCount)!==null&&n!==void 0?n:0,_.colCount=(o=w.colCount)!==null&&o!==void 0?o:0,this.internalProps.frozenColCount=Math.max(((r=w.headerLevelCount)!==null&&r!==void 0?r:0)+w.leftRowSeriesNumberColumnCount,(s=this.options.frozenColCount)!==null&&s!==void 0?s:0),this.internalProps.frozenRowCount=(l=this.options.frozenRowCount)!==null&&l!==void 0?l:0,_.bottomFrozenRowCount!==((a=this.options.bottomFrozenRowCount)!==null&&a!==void 0?a:0)&&(_.bottomFrozenRowCount=(h=this.options.bottomFrozenRowCount)!==null&&h!==void 0?h:0),_.rightFrozenColCount!==((d=this.options.rightFrozenColCount)!==null&&d!==void 0?d:0)&&(_.rightFrozenColCount=(u=this.options.rightFrozenColCount)!==null&&u!==void 0?u:0)):(_.colCount=(c=w.colCount)!==null&&c!==void 0?c:0,_.rowCount=w.recordsCount*w.bodyRowSpanCount+w.headerLevelCount,this.internalProps.frozenColCount=(g=this.options.frozenColCount)!==null&&g!==void 0?g:0,_.frozenRowCount=Math.max(w.headerLevelCount,(f=this.options.frozenRowCount)!==null&&f!==void 0?f:0),_.bottomFrozenRowCount!==((p=this.options.bottomFrozenRowCount)!==null&&p!==void 0?p:0)&&(_.bottomFrozenRowCount=(m=this.options.bottomFrozenRowCount)!==null&&m!==void 0?m:0),_.rightFrozenColCount!==((b=this.options.rightFrozenColCount)!==null&&b!==void 0?b:0)&&(_.rightFrozenColCount=(C=this.options.rightFrozenColCount)!==null&&C!==void 0?C:0)),this.stateManager.setFrozenCol(this.internalProps.frozenColCount)}getFieldData(t,e,n){if(t===null||this.internalProps.layoutMap.isHeader(e,n))return null;const o=this.getRecordShowIndexByCell(this.transpose?e-this.internalProps.layoutMap.leftRowSeriesNumberColumnCount:e,n);return this.internalProps.dataSource.getField(o,t,e,n,this)}getRawFieldData(t,e,n){if(t===null||this.internalProps.layoutMap.isHeader(e,n))return null;const o=this.getRecordShowIndexByCell(e,n);return this.internalProps.dataSource.getRawField(o,t,e,n,this)}_moveHeaderPosition(t,e){const n=this.getCellRange(t.col,t.row),o=this.getCellRange(e.col,e.row),r=this.internalProps.layoutMap.moveHeaderPosition(t,e);return r?(r.moveType==="column"?(this.colWidthsMap.exchangeOrder(n.start.col,n.end.col-n.start.col+1,o.start.col,o.end.col-o.start.col+1,r.targetIndex),this.transpose||(this.colWidthsLimit={},this.setMinMaxLimitWidth())):r.targetIndex>r.sourceIndex?this.rowHeightsMap.exchangeOrder(r.sourceIndex,r.sourceSize,r.targetIndex+r.sourceSize-r.targetSize,r.targetSize,r.targetIndex):this.rowHeightsMap.exchangeOrder(r.sourceIndex,r.sourceSize,r.targetIndex,r.targetSize,r.targetIndex),r):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 n;for(let r=0;r<this.internalProps.records.length;r++){const s=this.internalProps.records[r];if(typeof t=="function")t(s)&&(n=r);else{let l=!0;for(const a in t)if(s[a]!==t[a]){l=!1;break}l&&(n=r)}if(z(n))break}const o=this.getCellRangeByField(e,n);if(o)return{row:o.start.row,col:o.start.col}}getCellRangeByField(t,e){const{layoutMap:n}=this.internalProps,o=n.columnObjects.find(r=>r.field===t);if(o){const r=n.getBodyLayoutRangeById(o.id);let s;return z(e)&&(s=n.getRecordStartRowByRecordIndex(e)),this.transpose?{start:{row:r.start.row,col:z(s)?s+r.start.col:void 0},end:{row:r.end.row,col:z(s)?s+r.end.col:void 0}}:{start:{col:r.start.col,row:z(s)?s+r.start.row:void 0},end:{col:r.end.col,row:z(s)?s+r.end.row:void 0}}}return null}getHierarchyState(t,e){if(!this.options.groupBy&&!this.getBodyColumnDefine(t,e).tree)return Vt.none;const n=this.getRecordShowIndexByCell(t,e);return this.dataSource.getHierarchyState(n)}toggleHierarchyState(t,e,n=!0){this.stateManager.updateHoverIcon(t,e,void 0,void 0);const o=this.getHierarchyState(t,e);if(o===Vt.expand)this._refreshHierarchyState(t,e,n),this.fireListeners(at.TREE_HIERARCHY_STATE_CHANGE,{col:t,row:e,hierarchyState:Vt.collapse});else if(o===Vt.collapse){const r=this.getCellOriginRecord(t,e);Array.isArray(r.children)&&this._refreshHierarchyState(t,e,n),this.fireListeners(at.TREE_HIERARCHY_STATE_CHANGE,{col:t,row:e,hierarchyState:Vt.expand,originData:r})}}setLoadingHierarchyState(t,e){this.scenegraph.setLoadingHierarchyState(t,e)}_refreshHierarchyState(t,e,n=!0){var o;let r=!1,s=!1;const l=this.internalProps.layoutMap.checkHasChart();l&&(this.autoFillWidth&&(r=this.getAllColsWidth()<=this.tableNoFrameWidth),this.autoFillHeight&&(s=this.getAllRowsHeight()<=this.tableNoFrameHeight));const a=this.getRecordShowIndexByCell(t,e),h=this.dataSource.toggleHierarchyState(a,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)),d=this.internalProps.layoutMap.toggleHierarchyState(h);this.refreshRowColCount();for(let c=this.rowCount-this.bottomFrozenRowCount;c<this.rowCount;c++){const g=nn(c,0,this.colCount-1,this);this._setRowHeight(c,g)}this.clearCellStyleCache(),this.internalProps.layoutMap.clearCellRangeMap(),this.internalProps.useOneRowHeightFillAll=!1;const u=[{col:t,row:e}];if(((o=d.removeCellPositions)===null||o===void 0?void 0:o.length)>0&&d.removeCellPositions[d.removeCellPositions.length-1].row>=this.scenegraph.proxy.rowEnd){for(let c=0;c<=d.removeCellPositions.length-1;c++)d.removeCellPositions[c].row<=this.scenegraph.proxy.rowEnd&&u.push({col:d.removeCellPositions[c].col,row:d.removeCellPositions[c].row});d.removeCellPositions=[],this.scenegraph.proxy.refreshRowCount()}this.scenegraph.updateRow(d.removeCellPositions,d.addCellPositions,u,n),l&&(this.autoFillWidth&&!r&&(r=this.getAllColsWidth()<=this.tableNoFrameWidth),this.autoFillHeight&&!s&&(s=this.getAllRowsHeight()<=this.tableNoFrameHeight),(this.widthMode==="adaptive"||r||this.heightMode==="adaptive"||s)&&this.scenegraph.updateChartSizeForResizeColWidth(-1))}_hasHierarchyTreeHeader(){var t,e;return(e=(t=this.options.columns)!==null&&t!==void 0?t:this.options.header)===null||e===void 0?void 0:e.some((n,o)=>n.tree)}getMenuInfo(t,e,n){return{field:this.getHeaderField(t,e),value:this.getCellValue(t,e),cellLocation:this.getCellLocation(t,e),event:void 0}}_getSortFuncFromHeaderOption(t,e,n){if(t||(t=this.internalProps.columns),e&&t&&t.length>0)for(let o=0;o<t.length;o++){const r=t[o];if((n&&n===r.fieldKey||!n&&r.field===e)&&r.sort&&typeof r.sort=="function")return r.sort;if(r.columns){const s=this._getSortFuncFromHeaderOption(r.columns,e,n);if(s)return s}}}updateSortState(t,e=!0){var n;if(t)this.internalProps.sortState=t;else if(this.internalProps.sortState)if(Array.isArray(this.internalProps.sortState))for(let o=0;o<this.internalProps.sortState.length;o++)(t=(n=this.internalProps.sortState)===null||n===void 0?void 0:n[o])&&(t.order="normal");else this.internalProps.sortState.order="normal",t=this.internalProps.sortState;(t=Array.isArray(t)?t:[t]).some(o=>o.field)&&e&&this.internalProps.layoutMap.headerObjects.some(o=>o.define.sort!==!1)&&(this.dataSource.sort(t.map(o=>{const r=this._getSortFuncFromHeaderOption(this.internalProps.columns,o.field);return this.internalProps.layoutMap.headerObjects.find(s=>s&&s.field===o.field),{field:o.field,order:o.order,orderFn:r}})),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),El(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),z(t)){let e=this.stateManager.checkedState;return this.options.groupBy&&(e=F5(this)),e.map(n=>n[t])}return this.stateManager.checkedState}getCellCheckboxState(t,e){var n;const o=this.getBodyColumnDefine(t,e),r=o==null?void 0:o.field,s=this.getCellType(t,e);if(z(r)&&s==="checkbox"){const l=this.dataSource.getIndexKey(this.getRecordShowIndexByCell(t,e));return(n=this.stateManager.checkedState[l])===null||n===void 0?void 0:n[r]}}getRadioState(t){return z(t)?this.stateManager.radioState[t]:this.stateManager.radioState}getCellRadioState(t,e){return S5(t,e,this)}setCellCheckboxState(t,e,n){L5(t,e,n,this)}setCellRadioState(t,e,n){R5(t,e,n,this)}setRecords(t,e){var n,o;let r;(n=this.internalProps.dataSource)===null||n===void 0||n.release(),this.internalProps.releaseList=(o=this.internalProps.releaseList)===null||o===void 0?void 0:o.filter(l=>!l.dataSourceObj),this.internalProps.dataSource=null,Array.isArray(e)||e!=null&&e.order?r=e:e?r=e.sortState:e===null&&(r=null),typeof window<"u"&&window.performance.now();const s={col:this.stateManager.hover.cellPos.col,row:this.stateManager.hover.cellPos.row};if(this.scenegraph.clearCells(),r!==void 0&&(r===null||!Array.isArray(r)&&z(r.field)||Array.isArray(r))&&(this.internalProps.sortState=this.internalProps.multipleSort?Array.isArray(r)?r:[r]:r,this.stateManager.setSortState(this.sortState)),t){if(Jx(this,t),this.sortState){const l=Array.isArray(this.sortState)?this.sortState:[this.sortState];l.some(a=>a.order&&a.field&&a.order!=="normal")&&this.internalProps.layoutMap.headerObjectsIncludeHided.some(a=>a.define.sort!==!1)&&this.dataSource.sort(l.map(a=>{const h=this._getSortFuncFromHeaderOption(void 0,a.field);return this.internalProps.layoutMap.headerObjectsIncludeHided.find(d=>d&&d.field===a.field),{field:a.field,order:a.order||"asc",orderFn:h??sm}}))}this.refreshRowColCount()}else Jx(this,t);if(this.stateManager.initCheckedState(t),this.clearCellStyleCache(),this.scenegraph.createSceneGraph(),this.stateManager.updateHoverPos(s.col,s.row),this.internalProps.title&&!this.internalProps.title.isReleased&&(this._updateSize(),this.internalProps.title.resize(),this.scenegraph.resize()),this.options.emptyTip)if(this.internalProps.emptyTip)this.internalProps.emptyTip.resetVisible();else{const l=Bt.getComponent("emptyTip");this.internalProps.emptyTip=new l(this.options.emptyTip,this),this.internalProps.emptyTip.resetVisible()}this.render(),z(s.col)&&z(s.row)&&s.col>=0&&s.row>=0&&setTimeout(()=>{var l;(l=this.internalProps)===null||l===void 0||l.tooltipHandler.showTooltip(s.col,s.row)},0)}setRecordChildren(t,e,n,o=!0){const r=this.getCellOriginRecord(e,n);r.children=t;const s=this.getRecordShowIndexByCell(e,n);this.dataSource.setRecord(r,s),this._refreshHierarchyState(e,n,o)}startEditCell(t,e,n){var o;if(z(t)&&z(e))this.eventManager.isDraging=!1,this.selectCell(t,e),this.editorManager.startEditCell(t,e,n);else if(!((o=this.stateManager.select)===null||o===void 0)&&o.cellPos){const{col:r,row:s}=this.stateManager.select.cellPos;z(r)&&z(s)&&this.editorManager.startEditCell(r,s,n)}}completeEditCell(){this.editorManager.completeEdit()}getEditor(t,e){var n,o;const r=this.getBodyColumnDefine(t,e);let s=this.isHeader(t,e)?(n=r==null?void 0:r.headerEditor)!==null&&n!==void 0?n:this.options.headerEditor:(o=r==null?void 0:r.editor)!==null&&o!==void 0?o:this.options.editor;return typeof s=="function"&&(s=s({col:t,row:e,dataValue:this.getCellOriginValue(t,e),value:this.getCellValue(t,e)||"",table:this})),typeof s=="string"?oT(s):s}isHasEditorDefine(t,e){var n,o;const r=this.getBodyColumnDefine(t,e);let s=this.isHeader(t,e)?(n=r==null?void 0:r.headerEditor)!==null&&n!==void 0?n:this.options.headerEditor:(o=r==null?void 0:r.editor)!==null&&o!==void 0?o:this.options.editor;return typeof s=="function"&&(s=s({col:t,row:e,dataValue:this.getCellOriginValue(t,e),value:this.getCellValue(t,e)||"",table:this})),z(s)}changeCellValue(t,e,n,o=!1){return wV(t,e,n,o,this)}changeCellValues(t,e,n,o=!1){return SV(t,e,n,o,this)}addRecord(t,e){RV(t,e,this)}addRecords(t,e){AV(t,e,this)}deleteRecords(t){TV(t,this)}updateRecords(t,e){MV(t,e,this)}_hasCustomRenderOrLayout(){var t,e,n,o;const{headerObjects:r}=this.internalProps.layoutMap;if(this.options.customRender)return!0;for(let s=0;s<r.length;s++){const l=r[s];if(!((t=l==null?void 0:l.define)===null||t===void 0)&&t.customLayout||!((e=l==null?void 0:l.define)===null||e===void 0)&&e.headerCustomLayout||!((n=l==null?void 0:l.define)===null||n===void 0)&&n.customRender||!((o=l==null?void 0:l.define)===null||o===void 0)&&o.headerCustomRender)return!0}return!1}getAggregateValuesByField(t){const e=this.internalProps.layoutMap.getColumnByField(t),n=[];for(let o=0;o<e.length;o++){const r=e[o].columnDefine.aggregator;if(delete e[o].columnDefine,r){const s={col:e[o].col,aggregateValue:null};if(s.aggregateValue=[],Array.isArray(r))for(let l=0;l<r.length;l++)s.aggregateValue.push({aggregationType:r[l].type,value:r[l].value()});else s.aggregateValue.push({aggregationType:r.type,value:r.value()});n.push(s)}}return n}isAggregation(t,e){return this.internalProps.layoutMap.isAggregation(t,e)}getGroupTitleLevel(t,e){var n;if(!this.options.groupBy)return;const o=this.dataSource.getIndexKey(this.getRecordShowIndexByCell(t,e)),r=(n=this.dataSource.getGroupLength())!==null&&n!==void 0?n:0;let s=lt(o)?o.length-1:0;return r>0&&s===r&&(s=void 0),s}getBodyRowIndexByRecordIndex(t){return Array.isArray(t)&&t.length===1&&(t=t[0]),this.dataSource.getTableIndex(t)}}function uv(i){return i==="bottom"||i==="top"}function BV(i){return i==="left"||i==="right"}class PV{constructor(){this._scale=new qu,this._scales=[this._scale]}valueToPosition(t){return this._scale.scale(t)}getPosition(t){let e=0,n=this._scale;if(this._scales.length===1||t.length===1)e=this.valueToPosition(t[0]);else{const o=Math.min(t.length,this._scales.length);for(let r=0;r<o;r++)e+=this._scales[r].scale(t[r]);n=this._scales[o-1]}return{position:e,bandScale:n}}calcScales(t,e){var n,o;const{bandPadding:r,paddingInner:s,paddingOuter:l}=this,a=lt(r),h=lt(s),d=lt(l);for(let u=0;u<this._scales.length;u++){const c=a?r[u]:r,g=h?s[u]:s,f=d?l[u]:l;this._scales[u].paddingInner((n=g??c)!==null&&n!==void 0?n:t,!0).paddingOuter((o=f??c)!==null&&o!==void 0?o:e)}}dataToPosition(t,e={}){var n;if(t.length===0||this._scales.length===0)return 0;const{position:o,bandScale:r}=this.getPosition(t);return o+r.bandwidth()*((n=e.bandPosition)!==null&&n!==void 0?n:.5)}updateScaleDomain(t){for(let e=0;e<this._scales.length;e++)this._scales[e].domain(t)}updateRange(t){const[e,n]=this._scale.range();t[0]===e&&t[1]===n||this._scale.range(t)}}function HV(i,t,e){i.getTransform(t)||i.registerTransform(t,e)}function EV(i,t,e){i.getParser(t)||i.registerParser(t,e)}const LV=Math.sqrt(50),kV=Math.sqrt(10),FV=Math.sqrt(2);class IV{constructor(t){this._extend={},this.type=t??"linear",this._scale=t==="log"?new Ya:t==="symlog"?new Xa:new ds,this._scales=[this._scale]}setExtraAttrFromSpec(t,e,n,o,r,s){this.nice=!1,this.zero=e,this.zero&&(n.min=Math.min(n.min,0),n.max=Math.max(n.max,0)),this.domain=n,this.expand=o,this.type==="log"?this._scale.base(r??10):this.type==="symlog"&&this._scale.constant(s??10)}transformScaleDomain(){this.type==="symlog"||this.type==="log"||this.setScaleNice()}setScaleNice(){this.type==="log"?this.setLogScaleNice():this.setLinearScaleNice()}setLogScaleNice(){var t,e,n,o,r,s;Mt((t=this.domain)===null||t===void 0?void 0:t.min)&&Mt((e=this.domain)===null||e===void 0?void 0:e.max)?this.nice&&this._scale.nice():z((n=this.domain)===null||n===void 0?void 0:n.min)&&Mt((o=this.domain)===null||o===void 0?void 0:o.max)?this.nice&&this._scale.niceMax():Mt((r=this.domain)===null||r===void 0?void 0:r.min)&&z((s=this.domain)===null||s===void 0?void 0:s.max)&&this.nice&&this._scale.niceMin()}setLinearScaleNice(){var t,e,n,o,r,s,l,a;let h=(e=(t=this.forceTickCount)!==null&&t!==void 0?t:this.tickCount)!==null&&e!==void 0?e:10;this.niceType==="accurateFirst"&&(h=Math.max(10,h)),Mt((n=this.domain)===null||n===void 0?void 0:n.min)&&Mt((o=this.domain)===null||o===void 0?void 0:o.max)?this.nice&&this._scale.nice(h):z((r=this.domain)===null||r===void 0?void 0:r.min)&&Mt((s=this.domain)===null||s===void 0?void 0:s.max)?this.nice&&this._scale.niceMax(h):Mt((l=this.domain)===null||l===void 0?void 0:l.min)&&z((a=this.domain)===null||a===void 0?void 0:a.max)?this.nice&&this._scale.niceMin(h):this.nice&&this._scale.nice(h)}dataToPosition(t){return this.valueToPosition(t[0])}valueToPosition(t){return this._scale.scale(t)}computeLinearDomain(t){const e=[];return t.forEach(n=>{const{min:o,max:r}=n;e[0]=e[0]===void 0?o:Math.min(e[0],o),e[1]=e[1]===void 0?r:Math.max(e[1],r)}),this.expandDomain(e),this.includeZero(e),this.setDomainMinMax(e),e}expandDomain(t){if(!this.expand)return;const e=t[0],n=t[t.length-1];z(this.expand.min)&&(t[0]=e-(n-e)*this.expand.min),z(this.expand.max)&&(t[t.length-1]=n+(n-e)*this.expand.max)}niceDomain(t){if(z(t[0])||z(t[1])||this.type!=="linear")return t;if(Math.abs(cd(t)-Wf(t))<=1e-12){let e=t[0];const n=e>=0?1:-1;if(e=Math.abs(e),e<1)t[0]=0,t[1]=1;else{let o=e/5;const r=Math.floor(Math.log(o)/Math.LN10),s=o/Math.pow(10,r);o=(s>=LV?10:s>=kV?5:s>=FV?2:1)*Math.pow(10,r),t[0]=0,t[1]=10*o}n<0&&(t.reverse(),t[0]*=-1,t[1]*=-1)}return t}niceMinMax(){var t,e,n,o,r,s,l,a;if(this.nice){let h=(e=(t=this.forceTickCount)!==null&&t!==void 0?t:this.tickCount)!==null&&e!==void 0?e:10;this.niceType==="accurateFirst"&&(h=Math.max(10,h)),Mt((n=this.domain)===null||n===void 0?void 0:n.min)&&Mt((o=this.domain)===null||o===void 0?void 0:o.max)?this._scale.nice(h):z((r=this.domain)===null||r===void 0?void 0:r.min)&&Mt((s=this.domain)===null||s===void 0?void 0:s.max)?this._scale.niceMax(h):Mt((l=this.domain)===null||l===void 0?void 0:l.min)&&z((a=this.domain)===null||a===void 0?void 0:a.max)?this._scale.niceMin(h):this._scale.nice(h)}}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(e===void 0)return void delete this._extend[t];this._extend[t]=e;const n=this._scale.domain();this.extendDomain(n),this.includeZero(n),this.setDomainMinMax(n),this.niceDomain(n),this._scale.domain(n,this.nice),this.niceMinMax()}extendDomain(t){let e;const n=t.length-1,o=t[0]-t[n]>0,r=o?n:0,s=o?0:n;for(const l in this._extend)e=this._extend[l],e>t[s]&&(t[s]=e),e<t[r]&&(t[r]=e)}setDomainMinMax(t){if(!this.domain)return;const{min:e,max:n}=this.domain;z(e)&&(t[0]=e),z(n)&&(t[1]=n)}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=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,n]=this._scale.range();t[0]===e&&t[1]===n||this._scale.range(t)}}function DV(i,t){const e=i.find(o=>o.name==="axis-label-container-layer-0",!0),n=i.find(o=>o.name==="axis-label-container-layer-1",!0);pT(e?e.getChildren():[],t),pT(n?n.getChildren():[],t)}function OV(i,t){const{width:e,height:n}=t.getLayoutRect(),o=uv(t.orient),r=t.option.inverse===!0,s=i[0],l=Zr(i);if(o)if(r){const a=e,h=0,d=s.AABBBounds.x2,u=l.AABBBounds.x1;d>a&&s.setAttributes({x:a,textAlign:"right"}),u<h&&l.setAttributes({x:h,textAlign:"left"})}else{const h=e,d=s.AABBBounds.x1,u=l.AABBBounds.x2;d<0&&s.setAttributes({x:0,textAlign:"left"}),u>h&&l.setAttributes({x:h,textAlign:"right"})}else if(r){const a=s.AABBBounds.y1,h=l.AABBBounds.y2,d=0,u=n;a<d&&s.setAttributes({y:d,textBaseline:"top"}),h>u&&l.setAttributes({y:u,textBaseline:"bottom"})}else{const a=n,h=0,d=s.AABBBounds.y2,u=l.AABBBounds.y1;d>a&&s.setAttributes({y:a,textBaseline:"bottom"}),u<h&&l.setAttributes({y:h,textBaseline:"top"})}}function pT(i,t){var e;const n=t.option;qt(i)||!((e=n==null?void 0:n.label)===null||e===void 0)&&e.flush&&OV(i,t)}const zV=i=>i;class WV{constructor(t,e,n,o,r){var s,l,a;this.x=0,this.y=0,this.padding=o,this.table=r,this.orient=(s=t.orient)!==null&&s!==void 0?s:"left",this.type=(l=t.type)!==null&&l!==void 0?l:"band",this.option=xt({},uV(t.__vtableChartTheme),NV(this.orient,r.theme),VV(this.orient,this.type,t.__vtableChartTheme),t),this.orient==="left"||this.orient==="right"?(this.width=e,this.height=n-o[0]-o[2]-0,this.y=o[0]+0):(this.orient==="top"||this.orient==="bottom")&&(this.width=e-o[1]-o[3]-0,this.height=n,this.x=o[3]+0),this.visible=(a=t.visible)===null||a===void 0||a,this.inverse="inverse"in t&&!!t.inverse,t.type==="band"&&(this.data=t.domain),this.initScale(),this.initData(),this.createComponent(),this.initEvent()}initScale(){const t=this.option;this.type==="band"||this.type==="point"?(this.scale=new PV,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()):this.type!=="linear"&&this.type!=="time"&&this.type!=="log"&&this.type!=="symlog"||(this.scale=new IV(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(){this.table._vDataSet||(this.table._vDataSet=new lV),EV(this.table._vDataSet,"scale",zV),HV(this.table._vDataSet,"ticks",lz);const t=this.option.label||{},e=this.option.tick||{},n=new Sg(this.table._vDataSet).parse(this.scale._scale,{type:"scale"}).transform({type:"ticks",options:{sampling:this.option.sampling!==!1,tickCount:e.tickCount,forceTickCount:e.forceTickCount,tickStep:e.tickStep,tickMode:e.tickMode,noDecimals:e.noDecimals,axisOrientType:this.orient,coordinateType:"cartesian",labelStyle:t.style,labelFormatter:t.formatMethod,labelGap:t.minGap,labelLastVisible:t.lastVisible,labelFlush:t.flush}},!1);this.tickData=n,this.computeData()}computeData(){this.tickData.reRunAllTransform()}initEvent(){}createComponent(){const t=aT(this.option),e=this.getUpdateAttribute();e.verticalFactor=this.orient==="top"||this.orient==="right"?-1:1,this.component=new Ka(xt({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-(this.orient==="top"||this.orient==="bottom"?this.padding[1]+this.padding[3]:0),this.height=e-(this.orient==="left"||this.orient==="right"?this.padding[2]+this.padding[0]:0),this.updateScaleRange(),this.computeData();const n=aT(this.option),o=this.getUpdateAttribute();o.verticalFactor=this.orient==="top"||this.orient==="right"?-1:1,this.component.setAttributes(xt({},n,o)),this.component.setAttributes(this.setLayoutStartPosition({x:this.x,y:this.y})),this.overlap()}overlap(){DV(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(),n=uv(this.orient),o=BV(this.orient);let r={x:0,y:0},s=0;n?(r={x:t,y:0},s=t):o&&(r={x:0,y:e},s=e);const l=this.orient==="top"||this.orient==="bottom"?e:t;return{start:{x:0,y:0},end:r,title:{text:this.option.title.text,maxWidth:this._getTitleLimit(n)},items:this.getLabelItems(s),verticalLimitSize:l,verticalMinSize:l}}getLabelItems(t){return[this.tickData.latestData.map(e=>({id:e.value,label:e.value,value:t===0?0:this.scale.dataToPosition([e.value])/t,rawValue:e.value})).filter(e=>e.value>=0&&e.value<=1)]}updateScaleRange(){var t,e,n,o,r,s,l,a;const h=(e=(t=this.option.innerOffset)===null||t===void 0?void 0:t.right)!==null&&e!==void 0?e:0,d=(o=(n=this.option.innerOffset)===null||n===void 0?void 0:n.left)!==null&&o!==void 0?o:0,u=(s=(r=this.option.innerOffset)===null||r===void 0?void 0:r.top)!==null&&s!==void 0?s:0,c=(a=(l=this.option.innerOffset)===null||l===void 0?void 0:l.bottom)!==null&&a!==void 0?a:0,{width:g,height:f}=this.getLayoutRect(),p=this.option.inverse||!1;let m=[0,0];uv(this.orient)?Ae(g)&&(m=p?[g-h,d]:[d,g-h]):Ae(f)&&(m=p?[u,f-c]:[f-c,u]),this.scale.updateRange(m)}setLayoutStartPosition(t){let{x:e,y:n}=t;return Ae(e)&&(e+=+(this.orient==="left")*this.getLayoutRect().width),Ae(n)&&(n+=+(this.orient==="top")*this.getLayoutRect().height),{x:e,y:n}}_getTitleLimit(t){var e,n,o;if(this.option.title.visible&&Mt((e=this.option.title.style)===null||e===void 0?void 0:e.maxLineWidth)){let r=((n=this.option.title.style)===null||n===void 0?void 0:n.angle)||0;if(!((o=this.option.title)===null||o===void 0)&&o.autoRotate&&Mt(this.option.title.angle)&&(r=this.option.orient==="left"?-90:90),t){const a=this.getLayoutRect().width,h=Math.abs(Math.cos(Mn(r)));return h<1e-6?1/0:a/h}const s=this.getLayoutRect().height,l=Math.abs(Math.sin(Mn(r)));return l<1e-6?1/0:s/l}return null}getScale(){return this.scale._scale}getDomainSpec(){return this.scale.domain}}function NV(i,t){let e;return i==="left"?e=t.axisStyle.leftAxisStyle:i==="right"?e=t.axisStyle.rightAxisStyle:i==="top"?e=t.axisStyle.topAxisStyle:i==="bottom"&&(e=t.axisStyle.bottomAxisStyle),xt({},t.axisStyle.defaultAxisStyle,e)}function VV(i,t,e){if(!e)return{};const n=e.axis;let o,r;return t==="linear"||t==="log"||t==="symlog"?o=e.axisLinear:t==="band"&&(o=e.axisBand),i==="top"||i==="bottom"?r=e.axisX:i!=="left"&&i!=="right"||(r=e.axisY),xt({},n,o,r)}function jV(i,t){var e,n,o,r,s,l,a,h,d,u,c,g,f,p,m,b;const C=xt({},xg,i);let _=0;C.tick.visible!==!1&&(_=(e=C.tick.width)!==null&&e!==void 0?e:4);let w=0;if(C.label.visible){if(C.type==="band")C.domain.forEach(S=>{var A,R,x,T,M,B,P,F,H,E,k,I,L,D,O,N;C.label.formatMethod&&(S=C.label.formatMethod(S));const{width:W,height:$}=t.measureText(S,{fontSize:(x=(R=(A=C.label)===null||A===void 0?void 0:A.style)===null||R===void 0?void 0:R.fontSize)!==null&&x!==void 0?x:Ro,fontWeight:(B=(M=(T=C.label)===null||T===void 0?void 0:T.style)===null||M===void 0?void 0:M.fontWeight)!==null&&B!==void 0?B:"normal",fontFamily:(H=(F=(P=C.label)===null||P===void 0?void 0:P.style)===null||F===void 0?void 0:F.fontFamily)!==null&&H!==void 0?H:Ms}),U=((k=(E=C.label)===null||E===void 0?void 0:E.style)===null||k===void 0?void 0:k.maxLineWidth)||1/0,Y=((D=(L=(I=C.label)===null||I===void 0?void 0:I.style)===null||L===void 0?void 0:L.angle)!==null&&D!==void 0?D:0)+(((N=(O=C.label)===null||O===void 0?void 0:O.style)===null||N===void 0?void 0:N.direction)==="vertical"?90:0);w=Math.max(w,Ll(Math.min(W,U),$,Y).width)});else{let S;if(lt(i.__ticksForVTable))S=i.__ticksForVTable;else{const A=C.range,R=Math.abs(A.min)>1?Math.round(A.min):A.min,x=Math.abs(A.max)>1?Math.round(A.max):A.max;S=[Ag(R),Ag(x)]}S.forEach(A=>{var R,x,T,M,B,P,F,H,E,k,I,L,D,O,N,W;C.label.formatMethod&&(A=C.label.formatMethod(A));const{width:$,height:U}=t.measureText(A,{fontSize:(T=(x=(R=C.label)===null||R===void 0?void 0:R.style)===null||x===void 0?void 0:x.fontSize)!==null&&T!==void 0?T:Ro,fontWeight:(P=(B=(M=C.label)===null||M===void 0?void 0:M.style)===null||B===void 0?void 0:B.fontWeight)!==null&&P!==void 0?P:"normal",fontFamily:(E=(H=(F=C.label)===null||F===void 0?void 0:F.style)===null||H===void 0?void 0:H.fontFamily)!==null&&E!==void 0?E:Ms}),Y=((I=(k=C.label)===null||k===void 0?void 0:k.style)===null||I===void 0?void 0:I.maxLineWidth)||1/0,j=((O=(D=(L=C.label)===null||L===void 0?void 0:L.style)===null||D===void 0?void 0:D.angle)!==null&&O!==void 0?O:0)+(((W=(N=C.label)===null||N===void 0?void 0:N.style)===null||W===void 0?void 0:W.direction)==="vertical"?90:0);w=Math.max(w,Ll(Math.min($,Y),U,j).width)})}w+=(n=C.label.space)!==null&&n!==void 0?n:4}let y=0;if(C.title.visible&&ce(C.title.text)){const{width:S,height:A}=t.measureText(C.title.text,{fontSize:(s=(r=(o=C.title)===null||o===void 0?void 0:o.style)===null||r===void 0?void 0:r.fontSize)!==null&&s!==void 0?s:Ro,fontWeight:(h=(a=(l=C.title)===null||l===void 0?void 0:l.style)===null||a===void 0?void 0:a.fontWeight)!==null&&h!==void 0?h:"normal",fontFamily:(c=(u=(d=C.title)===null||d===void 0?void 0:d.style)===null||u===void 0?void 0:u.fontFamily)!==null&&c!==void 0?c:Ms}),R=((f=(g=C.label)===null||g===void 0?void 0:g.style)===null||f===void 0?void 0:f.maxLineWidth)||1/0,x=Ll(Math.min(S,R),A,(m=(p=C.title)===null||p===void 0?void 0:p.style)===null||m===void 0?void 0:m.angle);y=i.orient!=="left"&&i.orient!=="right"||!C.title.autoRotate?x.width:x.height,y+=(b=C.title.space)!==null&&b!==void 0?b:4}return _+w+y+1}function $V(i,t){var e,n,o,r,s,l,a,h,d,u,c,g,f,p,m,b;const C=xt({},xg,i);let _=0;C.tick.visible!==!1&&(_=(e=C.tick.width)!==null&&e!==void 0?e:4);let w=0;if(C.label.visible){if(C.type==="band")C.domain.forEach(S=>{var A,R,x,T,M,B,P,F,H,E,k,I,L,D,O,N;C.label.formatMethod&&(S=C.label.formatMethod(S));const{width:W,height:$}=t.measureText(S,{fontSize:(x=(R=(A=C.label)===null||A===void 0?void 0:A.style)===null||R===void 0?void 0:R.fontSize)!==null&&x!==void 0?x:Ro,fontWeight:(B=(M=(T=C.label)===null||T===void 0?void 0:T.style)===null||M===void 0?void 0:M.fontWeight)!==null&&B!==void 0?B:"normal",fontFamily:(H=(F=(P=C.label)===null||P===void 0?void 0:P.style)===null||F===void 0?void 0:F.fontFamily)!==null&&H!==void 0?H:Ms}),U=((k=(E=C.label)===null||E===void 0?void 0:E.style)===null||k===void 0?void 0:k.maxLineWidth)||1/0,Y=((D=(L=(I=C.label)===null||I===void 0?void 0:I.style)===null||L===void 0?void 0:L.angle)!==null&&D!==void 0?D:0)+(((N=(O=C.label)===null||O===void 0?void 0:O.style)===null||N===void 0?void 0:N.direction)==="vertical"?90:0);w=Math.max(w,Ll(Math.min(W,U),$,Y).height)});else{let S;if(lt(i.__ticksForVTable))S=i.__ticksForVTable;else{const A=C.range,R=Math.abs(A.min)>1?Math.round(A.min):A.min,x=Math.abs(A.max)>1?Math.round(A.max):A.max;S=[Ag(R),Ag(x)]}S.forEach(A=>{var R,x,T,M,B,P,F,H,E,k,I,L,D,O,N,W;C.label.formatMethod&&(A=C.label.formatMethod(A));const{width:$,height:U}=t.measureText(A,{fontSize:(T=(x=(R=C.label)===null||R===void 0?void 0:R.style)===null||x===void 0?void 0:x.fontSize)!==null&&T!==void 0?T:Ro,fontWeight:(P=(B=(M=C.label)===null||M===void 0?void 0:M.style)===null||B===void 0?void 0:B.fontWeight)!==null&&P!==void 0?P:"normal",fontFamily:(E=(H=(F=C.label)===null||F===void 0?void 0:F.style)===null||H===void 0?void 0:H.fontFamily)!==null&&E!==void 0?E:Ms}),Y=((I=(k=C.label)===null||k===void 0?void 0:k.style)===null||I===void 0?void 0:I.maxLineWidth)||1/0,j=((O=(D=(L=C.label)===null||L===void 0?void 0:L.style)===null||D===void 0?void 0:D.angle)!==null&&O!==void 0?O:0)+(((W=(N=C.label)===null||N===void 0?void 0:N.style)===null||W===void 0?void 0:W.direction)==="vertical"?90:0);w=Math.max(w,Ll(Math.min($,Y),U,j).height)})}w+=(n=C.label.space)!==null&&n!==void 0?n:4}let y=0;if(C.title.visible&&C.title.text){const{width:S,height:A}=t.measureText(C.title.text,{fontSize:(s=(r=(o=C.title)===null||o===void 0?void 0:o.style)===null||r===void 0?void 0:r.fontSize)!==null&&s!==void 0?s:Ro,fontWeight:(h=(a=(l=C.title)===null||l===void 0?void 0:l.style)===null||a===void 0?void 0:a.fontWeight)!==null&&h!==void 0?h:"normal",fontFamily:(c=(u=(d=C.title)===null||d===void 0?void 0:d.style)===null||u===void 0?void 0:u.fontFamily)!==null&&c!==void 0?c:Ms}),R=((f=(g=C.label)===null||g===void 0?void 0:g.style)===null||f===void 0?void 0:f.maxLineWidth)||1/0,x=Ll(Math.min(S,R),A,(m=(p=C.title)===null||p===void 0?void 0:p.style)===null||m===void 0?void 0:m.angle);y=i.orient!=="bottom"&&i.orient!=="top"||!C.title.autoRotate?x.height:x.width,y+=(b=C.title.space)!==null&&b!==void 0?b:4}return _+w+y+1}function Ag(i){return typeof i!="number"&&(i=Number(i)),Number(i.toPrecision(1)).toString()}function Ll(i,t,e=0){const n=e*Math.PI/180,o=-i/2,r=-t/2,s=i/2,l=-t/2,a=i/2,h=t/2,d=-i/2,u=t/2,c={x:o*Math.cos(n)-r*Math.sin(n),y:o*Math.sin(n)+r*Math.cos(n)},g={x:s*Math.cos(n)-l*Math.sin(n),y:s*Math.sin(n)+l*Math.cos(n)},f={x:a*Math.cos(n)-h*Math.sin(n),y:a*Math.sin(n)+h*Math.cos(n)},p={x:d*Math.cos(n)-u*Math.sin(n),y:d*Math.sin(n)+u*Math.cos(n)},m=Math.min(c.x,g.x,f.x,p.x),b=Math.max(c.x,g.x,f.x,p.x),C=Math.min(c.y,g.y,f.y,p.y);return{width:b-m,height:Math.max(c.y,g.y,f.y,p.y)-C}}const GV='<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>';class UV{constructor(t,e){this._emptyTipOption={spaceBetweenTextAndIcon:20,text:"no data",textStyle:{fontSize:14,color:"#000"},icon:{image:GV,width:100,height:100}},this.isReleased=!1,this.table=e,this._emptyTipOption=Object.assign(this._emptyTipOption,t===!0?{}:t),this._emptyTipComponent=this._createOrUpdateEmptyTipComponent(this._getEmptyTipAttrs())}_createOrUpdateEmptyTipComponent(t){if(this._emptyTipComponent)sa(t,this._cacheAttrs)||this._emptyTipComponent.setAttributes(t);else{const e=new XS(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||this.table.options.indicatorsAsCol===!1?this.table.getFrozenColsWidth():0,n=!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,r=(this.table.rowHeaderLevelCount>0&&this.table.isListTable()?this.table.getDrawRange().height:this.table.tableNoFrameHeight)-n-this.table.getTheme().scrollStyle.width;this._emptyTipComponent.setAttributes({spaceBetweenTextAndIcon:this._emptyTipOption.spaceBetweenTextAndIcon,x:this.table.tableX+e,y:this.table.tableY+n,width:o,height:r,text:Object.assign(Object.assign({text:this._emptyTipOption.text},this._emptyTipOption.textStyle),{fill:(t=this._emptyTipOption.textStyle)===null||t===void 0?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&&this.table.recordsCount!==0||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||this.table.options.indicatorsAsCol===!1?this.table.getFrozenColsWidth():0,n=!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,r=(this.table.rowHeaderLevelCount>0&&this.table.isListTable()?this.table.getDrawRange().height:this.table.tableNoFrameHeight)-n-this.table.getTheme().scrollStyle.width;return{spaceBetweenTextAndIcon:this._emptyTipOption.spaceBetweenTextAndIcon,x:this.table.tableX+e,y:this.table.tableY+n,width:o,height:r,text:Object.assign(Object.assign({text:this._emptyTipOption.text},this._emptyTipOption.textStyle),{fill:(t=this._emptyTipOption.textStyle)===null||t===void 0?void 0:t.color}),icon:Object.assign({},this._emptyTipOption.icon)}}}var KV=globalThis&&globalThis.__rest||function(i,t){var e={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&t.indexOf(n)<0&&(e[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function"){var o=0;for(n=Object.getOwnPropertySymbols(i);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(i,n[o])&&(e[n[o]]=i[n[o]])}return e};const YV={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};function XV(i,t){const e=xt({},YV,i),{title:n={},item:o={},pager:r={},background:s={},type:l,id:a,visible:h,orient:d,position:u,data:c,filter:g,regionId:f,regionIndex:p,seriesIndex:m,seriesId:b,padding:C}=e,_=KV(e,["title","item","pager","background","type","id","visible","orient","position","data","filter","regionId","regionIndex","seriesIndex","seriesId","padding"]);return n.visible&&(_.title=lT(n)),qt(o.focusIconStyle)||ni(o.focusIconStyle),uo(o.shape),uo(o.label),uo(o.value),uo(o.background),_m(o.maxWidth)&&(o.maxWidth=Number(o.maxWidth.substring(0,o.maxWidth.length-1))*t.width/100),_m(o.width)&&(o.width=Number(o.width.substring(0,o.width.length-1))*t.width/100),_m(o.height)&&(o.height=Number(o.height.substring(0,o.height.length-1))*t.width/100),_.item=o,qt(r.textStyle)||ni(r.textStyle),uo(r.handler),_.pager=r,s.visible&&!qt(s.style)&&(xt(_,s.style),z(s.padding)&&(_.padding=s.padding)),_}class qV{constructor(t,e){var n,o,r,s;this.table=e,this.option=Ee(t),this.orient=(n=t.orient)!==null&&n!==void 0?n:"left",this.visible=(o=t.visible)===null||o===void 0||o,this.position=(r=t.position)!==null&&r!==void 0?r:"middle",this.selectedData=(s=t.defaultSelected)!==null&&s!==void 0?s:null,this.createComponent(),this.initEvent()}createComponent(){const t=this.getLegendAttributes({width:this.table.tableNoFrameWidth,height:this.table.tableNoFrameHeight}),e=new oc(xt({},t,{defaultSelected:this.selectedData,disableTriggerEvent:this.table.options.disableInteraction}));e.name="legend",this.legendComponent=e,this.visible===!1&&(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({maxWidth:this.table.tableNoFrameWidth,maxHeight:this.table.tableNoFrameHeight}),this.adjustTableSize(this.legendComponent.attribute))}adjustTableSize(t){var e,n;let o=isFinite(this.legendComponent.AABBBounds.width())?this.legendComponent.AABBBounds.width():0,r=isFinite(this.legendComponent.AABBBounds.height())?this.legendComponent.AABBBounds.height():0;if(o<=0||r<=0)return;const s=this.table.tableNoFrameWidth,l=this.table.tableNoFrameHeight,a=Qt((n=(e=t.padding)!==null&&e!==void 0?e:this.option.padding)!==null&&n!==void 0?n:10);let h=0,d=0;this.orient==="left"?(h=a[3],d=0,o+=a[1]+a[3]):this.orient==="top"?(h=0,d=a[0],r+=a[0]+a[2]):this.orient==="right"?(h=s-o-a[1],d=0,o+=a[1]+a[3]):this.orient==="bottom"&&(h=0,d=l-r-a[2],r+=a[0]+a[2]);const u=this.orient==="bottom"||this.orient==="top"?"horizontal":"vertical",c=this.position;let g=0,f=0;u==="horizontal"?g=c==="middle"?(s-o)/2:c==="end"?s-o-a[1]:a[3]:f=c==="middle"?(l-r)/2:c==="end"?l-r-a[2]:a[0],this.legendComponent.setAttributes({dx:g,dy:f,x:h,y:d}),this.orient==="left"?(this.table.tableNoFrameWidth=this.table.tableNoFrameWidth-Math.ceil(o),this.table.tableX+=Math.ceil(o)):this.orient==="top"?(this.table.tableNoFrameHeight=this.table.tableNoFrameHeight-Math.ceil(r),this.table.tableY+=Math.ceil(r)):this.orient==="right"?this.table.tableNoFrameWidth=this.table.tableNoFrameWidth-Math.ceil(o):this.orient==="bottom"&&(this.table.tableNoFrameHeight=this.table.tableNoFrameHeight-Math.ceil(r))}getLegendAttributes(t){var e,n;const o=this.orient==="bottom"||this.orient==="top"?"horizontal":"vertical",r=XV(this.option,t),s=Qt((n=(e=r.padding)!==null&&e!==void 0?e:this.option.padding)!==null&&n!==void 0?n:10);return Object.assign({layout:o,items:this.getLegendItems(),maxWidth:t.width-s[1]-s[3],maxHeight:t.height-s[0]-s[2]},r)}getLegendItems(){return this.option.data}initEvent(){this.legendComponent&&(this.legendComponent.addEventListener(Dn.legendItemClick,t=>{const e=Ci(t,"detail.currentSelected");this.table.fireListeners(at.LEGEND_ITEM_CLICK,{model:this,value:e,event:t})}),this.legendComponent.addEventListener(Dn.legendItemHover,t=>{const e=Ci(t,"detail");this.table.fireListeners(at.LEGEND_ITEM_HOVER,{model:this,value:e,event:t})}),this.legendComponent.addEventListener(Dn.legendItemUnHover,t=>{const e=Ci(t,"detail");this.table.fireListeners(at.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 ZV=globalThis&&globalThis.__rest||function(i,t){var e={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&t.indexOf(n)<0&&(e[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function"){var o=0;for(n=Object.getOwnPropertySymbols(i);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(i,n[o])&&(e[n[o]]=i[n[o]])}return e};const Tg={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"}}}},JV={horizontal:Object.assign(Object.assign({},Tg),{rail:{width:200,height:8,style:{fill:"rgba(0,0,0,0.04)"}}}),vertical:Object.assign(Object.assign({},Tg),{rail:{width:8,height:200,style:{fill:"rgba(0,0,0,0.04)"}}})},QV={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)"}}},Tg),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)"}}},Tg)};function t9(i,t){const e=xt({},(i.type==="color"?JV:QV)[i.orient==="bottom"||i.orient==="top"?"horizontal":"vertical"],i),{title:n={},handler:o={},rail:r={},track:s={},startText:l,endText:a,handlerText:h,sizeBackground:d,background:u={},type:c,id:g,visible:f,orient:p,position:m,data:b,defaultSelected:C,field:_,filter:w,regionId:y,regionIndex:S,seriesIndex:A,seriesId:R,padding:x}=e,T=ZV(e,["title","handler","rail","track","startText","endText","handlerText","sizeBackground","background","type","id","visible","orient","position","data","defaultSelected","field","filter","regionId","regionIndex","seriesIndex","seriesId","padding"]);return n.visible&&(T.title=lT(n)),T.showHandler=o.visible!==!1,qt(o.style)||(T.handlerStyle=ni(o.style)),z(r.width)&&(T.railWidth=r.width),z(r.height)&&(T.railHeight=r.height),qt(r.style)||(T.railStyle=ni(r.style)),qt(s.style)||(T.trackStyle=ni(s.style)),T.startText=uo(l),T.endText=uo(a),T.handlerText=uo(h),qt(d)||(T.sizeBackground=ni(d)),u.visible&&!qt(u.style)&&(xt(T,u.style),z(u.padding)&&(T.padding=u.padding)),T}class e9{constructor(t,e){var n,o,r,s;this.table=e,this.option=Ee(t),this.orient=(n=t.orient)!==null&&n!==void 0?n:"left",this.visible=(o=t.visible)===null||o===void 0||o,this.position=(r=t.position)!==null&&r!==void 0?r:"middle",this.selectedData=(s=t.defaultSelected)!==null&&s!==void 0?s:null,this.createComponent(),this.initEvent()}createComponent(){const t=this.getLegendAttributes({width:this.table.tableNoFrameWidth,height:this.table.tableNoFrameHeight});let e;e=this.option.type==="color"?new sc(xt({},t,{slidable:!0})):new lc(xt({},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,n;let o=isFinite(this.legendComponent.AABBBounds.width())?this.legendComponent.AABBBounds.width():0,r=isFinite(this.legendComponent.AABBBounds.height())?this.legendComponent.AABBBounds.height():0;if(o<=0||r<=0)return;const s=this.table.tableNoFrameWidth,l=this.table.tableNoFrameHeight,a=Qt((n=(e=t.padding)!==null&&e!==void 0?e:this.option.padding)!==null&&n!==void 0?n:10);let h=0,d=0;this.orient==="left"?(h=a[3],d=0,o+=a[1]+a[3]):this.orient==="top"?(h=0,d=a[0],r+=a[0]+a[2]):this.orient==="right"?(h=s-o-a[1],d=0,o+=a[1]+a[3]):this.orient==="bottom"&&(h=0,d=l-r-a[2],r+=a[0]+a[2]);const u=this.orient==="bottom"||this.orient==="top"?"horizontal":"vertical",c=this.position;let g=0,f=0;u==="horizontal"?g=c==="middle"?(s-o)/2:c==="end"?s-o-a[1]:a[3]:f=c==="middle"?(l-r)/2:c==="end"?l-r-a[2]:a[0],this.legendComponent.setAttributes({dx:g,dy:f,x:h,y:d}),this.orient==="left"?(this.table.tableNoFrameWidth=this.table.tableNoFrameWidth-Math.ceil(o),this.table.tableX+=Math.ceil(o)):this.orient==="top"?(this.table.tableNoFrameHeight=this.table.tableNoFrameHeight-Math.ceil(r),this.table.tableY+=Math.ceil(r)):this.orient==="right"?this.table.tableNoFrameWidth=this.table.tableNoFrameWidth-Math.ceil(o):this.orient==="bottom"&&(this.table.tableNoFrameHeight=this.table.tableNoFrameHeight-Math.ceil(r))}getLegendAttributes(t){const e=this.orient==="bottom"||this.orient==="top"?"horizontal":"vertical",n=e==="horizontal"?"bottom":this.orient;return Object.assign(Object.assign({},t9(this.option)),{layout:e,align:n,min:this.option.min,max:this.option.max,value:this.option.value,[this.option.type==="color"?"colors":"sizeRange"]:this.option.type==="color"?this.option.colors:this.option.sizeRange})}initEvent(){this.legendComponent&&this.legendComponent.addEventListener("change",t=>{const e=Ci(t,"detail.value");this.table.fireListeners(at.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 i9(i,t){return i.type==="color"||i.type==="size"?new e9(i,t):new qV(i,t)}class mT{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,n){return this._getMenuElement().bindToCell(this._table,t,e,n)}unbindMenuElement(){this._getMenuElement().unbindFromCell()}pointInMenuElement(t,e){return this._getMenuElement().pointInMenuElement(t,e)}}const cv="vtable__menu-element",kl=`${cv}--hidden`,gv=`${cv}--shown`;function n9(){return xo("div",[cv,kl])}class o9{constructor(t){var e,n,o;this._handler=new mc,this._rootElement=n9(),this._rootElement.addEventListener("wheel",r=>{r.stopPropagation()}),(e=this._rootElement)===null||e===void 0||e.addEventListener("mousedown",r=>{r.stopPropagation(),r.preventDefault()}),(n=this._rootElement)===null||n===void 0||n.addEventListener("click",r=>{if(r.stopPropagation(),r.preventDefault(),this._rootElement.classList.contains(kl))return;const{col:s,row:l,dropDownIndex:a,menuKey:h,text:d,hasChildren:u}=r.target;if(typeof a!="number"||u)return void r.stopPropagation();const c=t.isPivotTable()?t.internalProps.layoutMap.getPivotDimensionInfo(s,l):t.getHeaderField(s,l),g=t._dropDownMenuIsHighlight(s,l,a);t.fireListeners(at.DROPDOWN_MENU_CLICK,{col:s,row:l,field:c,menuKey:h,text:d,highlight:g,cellLocation:t.getCellLocation(s,l),event:r}),t.fireListeners(at.DROPDOWN_MENU_CLEAR,null),t.fireListeners(at.HIDE_MENU,null),r.stopPropagation()}),(o=this._rootElement)===null||o===void 0||o.addEventListener("mousemove",r=>{this._rootElement.classList.contains(kl)||r.stopPropagation()})}get rootElement(){return this._rootElement}release(){this.unbindFromCell();const t=this._rootElement;t!=null&&t.parentElement&&t.parentElement.removeChild(t),this._handler.release(),delete this._rootElement}bindToCell(t,e,n,o){const r=this._rootElement;if(this._menuInstanceInfo=o,r==null||r.classList.remove(gv),r==null||r.classList.add(kl),this._canBindToCell(t,e,n)){if(r.innerHTML="",r.appendChild(o.content),this._bindCell(t,e,n,o.position,o.referencePosition))return r==null||r.classList.add(gv),r==null||r.classList.remove(kl),!0}else this.unbindFromCell();return!1}unbindFromCell(){const t=this._rootElement;this._menuInstanceInfo=void 0,t!=null&&t.parentElement&&(t.classList.remove(gv),t.classList.add(kl))}_canBindToCell(t,e,n){const o=t.getCellRangeRelativeRect({col:e,row:n}),r=t.getElement(),{top:s,bottom:l,left:a,right:h}=o;if(t.isFrozenCell(e,n))return!0;if(l<t.getFrozenRowsHeight()||h<t.getFrozenColsWidth()||a>t.tableNoFrameWidth-t.getRightFrozenColsWidth()||s>t.tableNoFrameHeight-t.getBottomFrozenRowsHeight())return!1;const{offsetHeight:d,offsetWidth:u}=r;return!(d<s)&&!(u<a)}_bindCell(t,e,n,o,r){const s=this._rootElement,l=t.getElement(),{width:a,height:h}=t.internalProps.element.getBoundingClientRect();if(s){s.parentElement!==l&&l.appendChild(s),s.style.left="0px";const d=.8*a;s.style.maxWidth=`${d}px`;const u=s.clientWidth,c=s.clientHeight;let g,f;return o&&(g=o.x,f=o.y),r&&(g=r.rect.right-u,f=r.rect.bottom),f+c>h&&(f=h-c,g+=u-2),f<0&&(f/=2),s.style.top=`${f}px`,g<0?g=0:g+u>a&&(g=a-u),s.style.left=`${g}px`,!0}return!1}pointInMenuElement(t,e){const n=this._rootElement,{x:o,y:r,width:s,height:l}=n.getBoundingClientRect();return t>o-5&&t<o+s+5&&e>r-5&&e<r+l+5}}class vT extends mT{createMenuElementInternal(){return new y8(this._table)}}let r9=class extends mT{createMenuElementInternal(){return new o9(this._table)}};const s9={"dropdown-menu":function(i){return new vT(i)},"context-menu":function(i){return new vT(i)},container:i=>new r9(i)};function l9(i,t,e,n,o){var r;const{lineHeight:s,textBaseline:l,textStick:a}=i._getCellStyle(t,e);let h=i.getCellRangeRelativeRect(i.getCellRange(t,e));a&&(h=i.getVisibleCellRangeRelativeRect({col:t,row:e}));let{left:d,right:u,bottom:c,top:g,width:f,height:p}=h;if(i.isHeader(t,e)&&({left:d,right:u,bottom:c,top:g,width:f,height:p}=i.internalProps.headerHelper.getDropDownIconRect(h,s,l||"middle")),o==null?void 0:o.content)return{type:n,position:o.position,referencePosition:(r=o.referencePosition)!==null&&r!==void 0?r:{rect:{left:d,right:u,top:g,bottom:c,width:f,height:p}},content:o.content};if(n==="dropdown-menu"){const{dropDownMenu:m=i.globalDropDownMenu,pivotInfo:b}=i._getHeaderLayoutMap(t,e);return{type:n,referencePosition:{rect:{left:d,right:u,top:g,bottom:c,width:f,height:p}},content:m,pivotInfo:b}}return null}class a9{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,n,o){var r;const s=this._attachInfo,l=this._getMenuInstanceInfo(t,e,n,o);if(!s||l&&s.instance===l.instance||((r=s.instance)===null||r===void 0||r.unbindMenuElement(),this._attachInfo=null),!l)return;const{instance:a,info:h}=l;if(a&&a.bindMenuElement(t,e,h)){const d=this._table.getCellRange(t,e);this._attachInfo={range:d,instance:a}}}_unbindFromCell(){const t=this._attachInfo;if(!t)return;const{instance:e}=t;e==null||e.unbindMenuElement(),this._attachInfo=null}_isBindToCell(t,e){const n=this._attachInfo;return!!n&&Yi(n.range,t,e)}pointInMenuElement(t,e){if(!this._attachInfo)return!1;const n=this._attachInfo,{instance:o}=n;return o.pointInMenuElement(t,e)}_bindTableEvent(t){t.on(at.DROPDOWN_ICON_CLICK,e=>{this._attachInfo&&this._isBindToCell(e.col,e.row)?this._unbindFromCell():this._bindToCell(e.col,e.row,"dropdown-menu")}),t.on(at.DROPDOWN_MENU_CLEAR,e=>{this._unbindFromCell()}),t.on(at.CONTEXTMENU_CELL,e=>{var n,o,r,s;if(((n=t.internalProps.menu)===null||n===void 0?void 0:n.renderMode)==="html"){const l=t._getMouseAbstractPoint(e.event,!1);let a=null;l.inTable&&typeof((o=t.internalProps.menu)===null||o===void 0?void 0:o.contextMenuItems)=="function"?a=t.internalProps.menu.contextMenuItems(t.getHeaderField(e.col,e.row),e.row,e.col,t):l.inTable&&Array.isArray((r=t.internalProps.menu)===null||r===void 0?void 0:r.contextMenuItems)&&(a=(s=t.internalProps.menu)===null||s===void 0?void 0:s.contextMenuItems),this._bindToCell(e.col,e.row,"context-menu",{content:a,position:{x:l.x,y:l.y}})}})}_getMenuInstanceInfo(t,e,n,o){const r=this._table,s=this._menuInstances,l=l9(r,t,e,n,o);return l?{instance:s&&s[n]||s&&(s[n]=s9[n](r)),type:n,info:l}:null}}class h9{constructor(t,e){this.isReleased=!1,this.table=e,this._titleOption=xt({orient:"top"},t),t.visible!==!1&&(this._titleComponent=this._createOrUpdateTitleComponent(this._getTitleAttrs()))}_createOrUpdateTitleComponent(t){if(this._titleComponent)sa(t,this._cacheAttrs)||this._titleComponent.setAttributes(t);else{const e=new YS(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,n,o,r;if(!this._titleComponent)return;const s=Qt((t=this._titleOption.padding)!==null&&t!==void 0?t:10),l=(e=this._titleOption.width)!==null&&e!==void 0?e:(this.table.widthMode==="adaptive"?this.table.tableNoFrameWidth:Math.min(this.table.tableNoFrameWidth,this.table.getDrawRange().width))-s[1]-s[3],a=(n=this._titleOption.height)!==null&&n!==void 0?n:(this.table.heightMode==="adaptive"?this.table.tableNoFrameHeight:Math.min(this.table.tableNoFrameHeight,this.table.getDrawRange().height))-s[0]-s[2];this._titleComponent.setAttributes({x:((o=this._titleOption.x)!==null&&o!==void 0?o:this._titleOption.orient==="right")?this.table.tableX+Math.min(this.table.tableNoFrameWidth,this.table.getDrawRange().width):this.table.tableX,y:((r=this._titleOption.y)!==null&&r!==void 0?r:this._titleOption.orient==="bottom")?this.table.tableY+this.table.tableNoFrameHeight:this.table.tableY,width:this._titleOption.orient==="top"||this._titleOption.orient==="bottom"?l:this._titleOption.width,height:this._titleOption.orient==="left"||this._titleOption.orient==="right"?a:this._titleOption.height,textStyle:Object.assign({width:l},this._titleOption.textStyle),subtextStyle:Object.assign({width:l},this._titleOption.subtextStyle)}),this._adjustTableSize(this._titleComponent.attribute)}_adjustTableSize(t){var e,n,o,r;const s=isFinite((e=this._titleComponent)===null||e===void 0?void 0:e.AABBBounds.width())?this._titleComponent.AABBBounds.width():0,l=isFinite((n=this._titleComponent)===null||n===void 0?void 0:n.AABBBounds.height())?this._titleComponent.AABBBounds.height():0;this._titleOption.orient==="left"?(this.table.tableNoFrameWidth=this.table.tableNoFrameWidth-Math.ceil(s),this.table.tableX+=Math.ceil(s)):this._titleOption.orient==="top"?(this.table.tableNoFrameHeight=this.table.tableNoFrameHeight-Math.ceil(l),this.table.tableY+=Math.ceil(l)):this._titleOption.orient==="right"?this.table.tableNoFrameWidth=this.table.tableNoFrameWidth-Math.ceil(s):this._titleOption.orient==="bottom"&&(this.table.tableNoFrameHeight=this.table.tableNoFrameHeight-Math.ceil(l)),this._cacheAttrs=t,this._titleOption.orient!=="right"&&this._titleOption.orient!=="bottom"||this._titleComponent.setAttributes({x:((o=this._titleOption.x)!==null&&o!==void 0?o:this._titleOption.orient==="right")?this.table.tableX+this.table.tableNoFrameWidth:this.table.tableX,y:((r=this._titleOption.y)!==null&&r!==void 0?r:this._titleOption.orient==="bottom")?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,n,o,r,s,l,a,h,d,u;const c=this._titleOption.text||this._titleOption.subtext?10:0,g=Qt((t=this._titleOption.padding)!==null&&t!==void 0?t:c),f=(e=this._titleOption.width)!==null&&e!==void 0?e:Math.min(this.table.tableNoFrameWidth,this.table.getDrawRange().width)-g[1]-g[3],p=(n=this._titleOption.height)!==null&&n!==void 0?n:Math.min(this.table.tableNoFrameHeight,this.table.getDrawRange().height)-g[0]-g[2];return{text:(o=this._titleOption.text)!==null&&o!==void 0?o:"",subtext:(r=this._titleOption.subtext)!==null&&r!==void 0?r:"",x:((s=this._titleOption.x)!==null&&s!==void 0?s:this._titleOption.orient==="right")?this.table.tableX+Math.min(this.table.tableNoFrameWidth,this.table.getDrawRange().width):this.table.tableX,y:((l=this._titleOption.y)!==null&&l!==void 0?l:this._titleOption.orient==="bottom")?this.table.tableY+this.table.tableNoFrameHeight:this.table.tableY,width:this._titleOption.orient==="top"||this._titleOption.orient==="bottom"?f:this._titleOption.width,height:this._titleOption.orient==="left"||this._titleOption.orient==="right"?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:(a=this._titleOption.align)!==null&&a!==void 0?a:"left",verticalAlign:(h=this._titleOption.verticalAlign)!==null&&h!==void 0?h:"top",textStyle:Object.assign({width:f},this._titleOption.textStyle),subtextStyle:Object.assign({width:f},this._titleOption.subtextStyle),dx:(d=this._titleOption.dx)!==null&&d!==void 0?d:0,dy:(u=this._titleOption.dy)!==null&&u!==void 0?u:0}}getComponentGraphic(){return this._titleComponent}}class d9{constructor(t){this._table=t}release(){var t,e;this.unbindTooltipElement(),this._tooltipElement&&((e=(t=this._tooltipElement).release)===null||e===void 0||e.call(t)),this._tooltipElement=void 0}_getTooltipElement(){return this._tooltipElement||(this._tooltipElement=this.createTooltipElementInternal()),this._tooltipElement}bindTooltipElement(t,e,n,o){return this._getTooltipElement().bindToCell(this._table,t,e,n,o)}moveTooltipElement(t,e,n,o){this._getTooltipElement().move(this._table,t,e,n,o)}unbindTooltipElement(){this._getTooltipElement().unbindFromCell()}locateTooltipElement(t,e,n,o,r){this._getTooltipElement()._locate(this._table,t,e,n,o,r)}}function u9(){if(oe.mode==="node")return;const i=document.createElement("style");i.id="vtable-tooltip-styleSheet",i.textContent=`
|
|
223
|
+
`,document.head.appendChild(i)}c8();const yn="vtable__menu-element",g8=`${yn}__item`,nv=`${yn}__content`,on=`${yn}--hidden`,sr=`${yn}--shown`,f8=`${yn}--normal`,p8=`${yn}--select`,m8=`${yn}__icon`,v8=`${yn}__split`,b8=`${yn}__title`,C8=`${yn}__arrow`,Bh=`${yn}__no-event`,kA=`${yn}__item-text`;function FA(){return xo("div",[yn,on])}function Ph(i,t,e,n,o,r){const s=i.getCellRange(n,o);for(let l=0;l<t.length;l++){const a=t[l];let{col:h,row:d}=a;const{field:u,menuKey:c}=a;if(typeof h!="number"||typeof d!="number")if(i.isPivotTable()){const g=i.internalProps.layoutMap.getPivotCellAdress(u);if(!g)continue;h=g.col,d=g.row}else{const g=i.internalProps.layoutMap.getHeaderCellAddressByField(u);if(!g)continue;h=g.col,d=g.row}if(z(h)&&z(d)&&Yi(s,h,d)&&e===c)return!0}return!1}class y8{constructor(t){var e,n,o,r,s,l,a,h,d,u;this._handler=new mc,this._rootElement=FA(),this._secondElement=FA(),this._secondElement.sub=!0,this._showChildrenIndex=-1,this._rootElement.addEventListener("wheel",c=>{c.stopPropagation()}),(e=this._rootElement)===null||e===void 0||e.addEventListener("mousedown",c=>{c.stopPropagation(),c.preventDefault()}),(n=this._rootElement)===null||n===void 0||n.addEventListener("touchend",c=>{if(c.stopPropagation(),c.preventDefault(),this._rootElement.classList.contains(on))return;const{col:g,row:f,dropDownIndex:p,menuKey:m,text:b,hasChildren:C}=c.target;if(typeof p!="number"||C)return void c.stopPropagation();const _=t.isPivotTable()?t.internalProps.layoutMap.getPivotDimensionInfo(g,f):t.getHeaderField(g,f),w=t._dropDownMenuIsHighlight(g,f,p);t.fireListeners(at.DROPDOWN_MENU_CLICK,{col:g,row:f,field:_,menuKey:m,text:b,highlight:w,cellLocation:t.getCellLocation(g,f),event:c}),t.fireListeners(at.DROPDOWN_MENU_CLEAR,null),t.fireListeners(at.HIDE_MENU,null),c.stopPropagation()}),(o=this._rootElement)===null||o===void 0||o.addEventListener("click",c=>{if(c.stopPropagation(),c.preventDefault(),this._rootElement.classList.contains(on))return;const{col:g,row:f,dropDownIndex:p,menuKey:m,text:b,hasChildren:C}=c.target;if(typeof p!="number"||C)return void c.stopPropagation();const _=t.isPivotTable()?t.internalProps.layoutMap.getPivotDimensionInfo(g,f):t.getHeaderField(g,f),w=t._dropDownMenuIsHighlight(g,f,p);t.fireListeners(at.DROPDOWN_MENU_CLICK,{col:g,row:f,field:_,menuKey:m,text:b,highlight:w,cellLocation:t.getCellLocation(g,f),event:c}),t.fireListeners(at.DROPDOWN_MENU_CLEAR,null),t.fireListeners(at.HIDE_MENU,null),c.stopPropagation()}),(r=this._rootElement)===null||r===void 0||r.addEventListener("mousemove",c=>{var g,f;if(this._rootElement.classList.contains(on))return;c.stopPropagation();const{hasChildren:p,dropDownIndex:m,col:b,row:C,sub:_}=c.target;if(p){this._showChildrenIndex=m;const w=this._secondElement;w==null||w.classList.remove(on),w==null||w.classList.add(sr),w.innerHTML="";const y=(g=this._menuInstanceInfo.content[m])===null||g===void 0?void 0:g.children;for(let A=0;A<y.length;A++){const R=y[A],x=IA(R,!!t.stateManager.menu.dropDownMenuHighlight&&Ph(t,t.stateManager.menu.dropDownMenuHighlight,typeof R=="object"?(R==null?void 0:R.menuKey)||(R==null?void 0:R.text):R,b,C));x.col=b,x.row=C,x.dropDownIndex=A,typeof R=="string"?(x.text=R,x.menuKey=R):typeof R=="object"&&(x.text=R.text,x.menuKey=R.menuKey||R.text),x.sub=!0,x.sub=!0,w.appendChild(x)}const S=c.target.getBoundingClientRect();this._bindSecondElement(t,b,C,S.right,S.top)}else if(p&&this._showChildrenIndex===m){const w=this._secondElement;w==null||w.classList.remove(on),w==null||w.classList.add(sr)}else!_&&(!((f=this._secondElement)===null||f===void 0)&&f.classList.contains(sr))&&setTimeout(()=>{if(this._mouseEnterSecondElement!==!0){this._showChildrenIndex=-1;const w=this._secondElement;w==null||w.classList.remove(sr),w==null||w.classList.add(on)}},300)}),(s=this._secondElement)===null||s===void 0||s.addEventListener("wheel",c=>{c.stopPropagation()}),(l=this._secondElement)===null||l===void 0||l.addEventListener("mousemove",c=>{this._rootElement.classList.contains(on)||c.stopPropagation()}),(a=this._secondElement)===null||a===void 0||a.addEventListener("mouseenter",c=>{this._mouseEnterSecondElement=!0}),(h=this._secondElement)===null||h===void 0||h.addEventListener("mouseleave",c=>{this._mouseEnterSecondElement=!1}),(d=this._secondElement)===null||d===void 0||d.addEventListener("mousedown",c=>{c.stopPropagation(),c.preventDefault()}),(u=this._secondElement)===null||u===void 0||u.addEventListener("click",c=>{if(c.stopPropagation(),c.preventDefault(),this._secondElement.classList.contains(on))return;const{col:g,row:f,dropDownIndex:p,menuKey:m,text:b,hasChildren:C}=c.target;if(typeof p!="number"||C)return void c.stopPropagation();const _=t.isPivotTable()?t.internalProps.layoutMap.getPivotDimensionInfo(g,f):t.getHeaderField(g,f);let w=!1;this._menuInstanceInfo.content.forEach((y,S)=>{if(typeof y=="object"&&y.children&&y.children.length)for(let A=0;A<y.children.length;A++){const R=y.children[A];if(Ph(t,t.stateManager.menu.dropDownMenuHighlight,typeof R=="object"?R==null?void 0:R.menuKey:R,g,f)&&m===(typeof R=="object"?R==null?void 0:R.menuKey:R))return void(w=!0)}}),t.fireListeners(at.DROPDOWN_MENU_CLICK,{col:g,row:f,field:_,cellHeaderPaths:t.isPivotTable()?t.getCellHeaderPaths(g,f):void 0,menuKey:m,text:b,highlight:w,cellLocation:t.getCellLocation(g,f),event:c}),t.fireListeners(at.DROPDOWN_MENU_CLEAR,null),t.fireListeners(at.HIDE_MENU,null),c.stopPropagation()})}get rootElement(){return this._rootElement}release(){this.unbindFromCell();const t=this._rootElement;t!=null&&t.parentElement&&t.parentElement.removeChild(t),this._handler.release(),delete this._rootElement}bindToCell(t,e,n,o){var r,s;const l=this._rootElement,a=this._secondElement;if(this._menuInstanceInfo=o,l==null||l.classList.remove(sr),l==null||l.classList.add(on),a==null||a.classList.remove(sr),a==null||a.classList.add(on),this._canBindToCell(t,e,n)){if(l.innerHTML="",Array.isArray(o.content)){const h=o.content;for(let d=0;(r=d<(h==null?void 0:h.length))!==null&&r!==void 0&&r;d++){const u=h[d];let c=!!t.stateManager.menu.dropDownMenuHighlight&&Ph(t,t.stateManager.menu.dropDownMenuHighlight,typeof u=="object"?(u==null?void 0:u.menuKey)||(u==null?void 0:u.text):u,e,n);if(t.stateManager.menu.dropDownMenuHighlight&&typeof u=="object"&&Array.isArray(u.children)&&u.children.length)for(let f=0;f<u.children.length;f++){const p=u.children[f];if(Ph(t,t.stateManager.menu.dropDownMenuHighlight,typeof p=="object"?(p==null?void 0:p.menuKey)||(p==null?void 0:p.text):p,e,n)){c=!0;break}}const g=IA(u,c);g.col=e,g.row=n,g.dropDownIndex=d,typeof u=="string"?(g.text=u,g.menuKey=u):typeof u=="object"&&(g.text=u.text,g.menuKey=u.menuKey||u.text,!((s=u.children)===null||s===void 0)&&s.length&&(g.hasChildren=!0)),l.appendChild(g)}}if(this._bindToCell(t,e,n,o.position,o.referencePosition))return l==null||l.classList.add(sr),l==null||l.classList.remove(on),!0}else this.unbindFromCell();return!1}unbindFromCell(){const t=this._rootElement,e=this._secondElement;this._menuInstanceInfo=void 0,t!=null&&t.parentElement&&(t.classList.remove(sr),t.classList.add(on)),e!=null&&e.parentElement&&(e.classList.remove(sr),e.classList.add(on))}_canBindToCell(t,e,n){const o=t.getCellRangeRelativeRect({col:e,row:n}),r=t.getElement(),{top:s,bottom:l,left:a,right:h}=o;if(t.isFrozenCell(e,n))return!0;if(l<t.getFrozenRowsHeight()||h<t.getFrozenColsWidth()||a>t.tableNoFrameWidth-t.getRightFrozenColsWidth()||s>t.tableNoFrameHeight-t.getBottomFrozenRowsHeight())return!1;const{offsetHeight:d,offsetWidth:u}=r;return!(d<s)&&!(u<a)}_bindToCell(t,e,n,o,r){const s=this._rootElement,l=t.getElement(),{width:a,height:h}=t.internalProps.element.getBoundingClientRect();if(s){s.parentElement!==l&&l.appendChild(s),s.style.left="0px";const d=.8*a;s.style.maxWidth=`${d}px`;const u=s.offsetWidth,c=s.offsetHeight;let g,f;o?(g=o.x,f=o.y):r&&(g=r.rect.right-u,f=r.rect.bottom);const p=l.getBoundingClientRect(),m=p.width/l.offsetWidth,b=p.height/l.offsetHeight;return f*b+c>h&&(f=(h-c)/b),f<0&&(f/=2),s.style.top=`${f}px`,g<0?g=0:g*m+u>a&&(g=(a-u)/m),s.style.left=`${g}px`,!0}return!1}_bindSecondElement(t,e,n,o,r){const s=this._secondElement,l=this._rootElement,a=t.getElement(),{width:h,left:d,top:u}=t.internalProps.element.getBoundingClientRect(),{x:c,y:g,width:f}=l.getBoundingClientRect();if(s){s.parentElement!==a&&a.appendChild(s),s.style.left="0px";const p=.8*h;s.style.maxWidth=`${p}px`;const m=s.clientWidth,b=r-4-u,C=o-d;s.style.top=`${b}px`;let _=C;return _+m>h?_=_-m-f:_+=4,s.style.left=`${_}px`,!0}return!1}pointInMenuElement(t,e){const n=this._rootElement,{x:o,y:r,width:s,height:l}=n.getBoundingClientRect();if(t>o-5&&t<o+s+5&&e>r-5&&e<r+l+5)return!0;if(this._secondElement){const{x:a,y:h,width:d,height:u}=n.getBoundingClientRect();if(t>a-5&&t<a+d+5&&e>h-5&&e<h+u+5)return!0}return!1}}function IA(i,t){var e,n,o;const r=xo("div",[g8,t?p8:f8]);if(typeof i=="string"){const s=xo("span",[nv,Bh,kA]);s.innerHTML=i,r.appendChild(s)}else if(typeof i=="object"){const s=(e=i.type)!==null&&e!==void 0?e:"item";if(s==="split")return r==null||r.classList.add(v8),r;if(!((n=i==null?void 0:i.icon)===null||n===void 0)&&n.svg)if(um.test(i.icon.svg)){const a=new Image;i.icon.width?a.style.width=i.icon.width.toString()+"px":a.style.width="16px",i.icon.height?a.style.height=i.icon.height.toString()+"px":a.style.height="16px",a.src=i.icon.svg,r.appendChild(a)}else{const a=xo("span",[m8,Bh]);a.innerHTML=t&&i.selectedIcon&&i.selectedIcon.svg?i.selectedIcon.svg:i.icon.svg,i.icon.width&&a.children[0].setAttribute("width",i.icon.width.toString()),i.icon.height&&a.children[0].setAttribute("height",i.icon.height.toString()),r.appendChild(a)}const l=xo("span",[nv,Bh,kA]);if(l.innerHTML=i.text,r.appendChild(l),s==="title")r==null||r.classList.add(Bh,b8);else if(!((o=i==null?void 0:i.children)===null||o===void 0)&&o.length){const a=xo("span",[nv,Bh,C8]);a.innerHTML=t?'<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(a)}}return r}let DA;const _8={CHANGE_STYLE:"change_style"};class xs extends th{static get EVENT_TYPE(){return _8}static get DEFAULT(){return DA||(DA=new xs)}constructor(t={},e={}){var n,o,r,s,l,a,h,d,u,c,g,f,p,m,b,C,_,w,y,S,A,R,x,T,M,B,P,F,H,E,k,I;super(),this._defaultPadding=[10,16,10,16],this._color=(n=t.color)!==null&&n!==void 0?n:e==null?void 0:e.color,this._strokeColor=(o=t==null?void 0:t.strokeColor)!==null&&o!==void 0?o:e==null?void 0:e.strokeColor,this._fontSize=(r=t.fontSize)!==null&&r!==void 0?r:e==null?void 0:e.fontSize,this._fontFamily=(s=t.fontFamily)!==null&&s!==void 0?s:e==null?void 0:e.fontFamily,this._fontWeight=(l=t.fontWeight)!==null&&l!==void 0?l:e==null?void 0:e.fontWeight,this._fontVariant=(a=t.fontVariant)!==null&&a!==void 0?a:e==null?void 0:e.fontVariant,this._fontStyle=(h=t.fontStyle)!==null&&h!==void 0?h:e==null?void 0:e.fontStyle,this._textOverflow=((d=t.textOverflow)!==null&&d!==void 0?d:e==null?void 0:e.textOverflow)||"ellipsis",this._textStick=(c=(u=t.textStick)!==null&&u!==void 0?u:e==null?void 0:e.textStick)!==null&&c!==void 0&&c,this._textStickBaseOnAlign=(f=(g=t.textStickBaseOnAlign)!==null&&g!==void 0?g:e==null?void 0:e.textStickBaseOnAlign)!==null&&f!==void 0&&f,this._marked=(m=(p=t.marked)!==null&&p!==void 0?p:e==null?void 0:e.marked)!==null&&m!==void 0&&m,this._textAlign=((b=t.textAlign)!==null&&b!==void 0?b:e==null?void 0:e.textAlign)||"left",this._textBaseline=((C=t.textBaseline)!==null&&C!==void 0?C:e==null?void 0:e.textBaseline)||"middle",this._bgColor=(_=t.bgColor)!==null&&_!==void 0?_:e==null?void 0:e.bgColor,this._padding=(y=(w=t.padding)!==null&&w!==void 0?w:e==null?void 0:e.padding)!==null&&y!==void 0?y:this._defaultPadding,this._borderColor=(S=t.borderColor)!==null&&S!==void 0?S:e==null?void 0:e.borderColor,this._lineHeight=(A=t.lineHeight)!==null&&A!==void 0?A:e==null?void 0:e.lineHeight,this._underline=(R=t.underline)!==null&&R!==void 0?R:e==null?void 0:e.underline,this._underlineColor=(x=t.underlineColor)!==null&&x!==void 0?x:e==null?void 0:e.underlineColor,this._underlineDash=(T=t.underlineDash)!==null&&T!==void 0?T:e==null?void 0:e.underlineDash,this._underlineOffset=(M=t.underlineOffset)!==null&&M!==void 0?M:e==null?void 0:e.underlineOffset,this._lineThrough=(B=t.lineThrough)!==null&&B!==void 0?B:e==null?void 0:e.lineThrough,this._lineThroughColor=(P=t.lineThroughColor)!==null&&P!==void 0?P:e==null?void 0:e.lineThroughColor,this._lineThroughDash=(F=t.lineThroughDash)!==null&&F!==void 0?F:e==null?void 0:e.lineThroughDash,this._linkColor=(H=t.linkColor)!==null&&H!==void 0?H:e==null?void 0:e.linkColor,this._cursor=(E=t.cursor)!==null&&E!==void 0?E:e==null?void 0:e.cursor,this._borderLineWidth=(k=t.borderLineWidth)!==null&&k!==void 0?k:e==null?void 0:e.borderLineWidth,this._borderLineDash=(I=t.borderLineDash)!==null&&I!==void 0?I:e==null?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(t=this._padding)!==null&&t!==void 0?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 xs(this)}}let OA;class fg extends xs{static get DEFAULT(){return OA||(OA=new fg)}constructor(t={},e={}){var n;super(t,e),this.textAlign=((n=t.textAlign)!==null&&n!==void 0?n:e==null?void 0:e.textAlign)||"center"}clone(){return new fg(this)}}let zA;class pg extends xs{static get DEFAULT(){return zA||(zA=new pg)}constructor(t={},e=null){var n,o;super(t,e),this._autoWrapText=(n=t==null?void 0:t.autoWrapText)!==null&&n!==void 0?n:e==null?void 0:e.autoWrapText,this._lineClamp=(o=t==null?void 0:t.lineClamp)!==null&&o!==void 0?o:e==null?void 0:e.lineClamp}clone(){return new pg(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 WA;class Rs extends xs{static get DEFAULT(){return WA||(WA=new Rs)}constructor(t={},e={},n={}){var o,r,s,l,a,h,d,u,c,g,f,p,m,b,C,_,w,y,S,A,R,x;super(t,e),this._size=((r=(o=t==null?void 0:t.size)!==null&&o!==void 0?o:e==null?void 0:e.size)!==null&&r!==void 0?r:n==null?void 0:n.size)||14,this._spaceBetweenTextAndIcon=((l=(s=t==null?void 0:t.spaceBetweenTextAndIcon)!==null&&s!==void 0?s:e==null?void 0:e.spaceBetweenTextAndIcon)!==null&&l!==void 0?l:n==null?void 0:n.spaceBetweenTextAndIcon)||8,this._defaultFill=(h=(a=t==null?void 0:t.checkboxStyle)===null||a===void 0?void 0:a.defaultFill)!==null&&h!==void 0?h:n==null?void 0:n.defaultFill,this._defaultStroke=(u=(d=t==null?void 0:t.checkboxStyle)===null||d===void 0?void 0:d.defaultStroke)!==null&&u!==void 0?u:n==null?void 0:n.defaultStroke,this._disableFill=(g=(c=t==null?void 0:t.checkboxStyle)===null||c===void 0?void 0:c.disableFill)!==null&&g!==void 0?g:n==null?void 0:n.disableFill,this._checkedFill=(p=(f=t==null?void 0:t.checkboxStyle)===null||f===void 0?void 0:f.checkedFill)!==null&&p!==void 0?p:n==null?void 0:n.checkedFill,this._checkedStroke=(b=(m=t==null?void 0:t.checkboxStyle)===null||m===void 0?void 0:m.checkedStroke)!==null&&b!==void 0?b:n==null?void 0:n.checkedStroke,this._disableCheckedFill=(_=(C=t==null?void 0:t.checkboxStyle)===null||C===void 0?void 0:C.disableCheckedFill)!==null&&_!==void 0?_:n==null?void 0:n.disableCheckedFill,this._disableCheckedStroke=(y=(w=t==null?void 0:t.checkboxStyle)===null||w===void 0?void 0:w.disableCheckedStroke)!==null&&y!==void 0?y:n==null?void 0:n.disableCheckedStroke,this._checkIconImage=(A=(S=t==null?void 0:t.checkboxStyle)===null||S===void 0?void 0:S.checkIconImage)!==null&&A!==void 0?A:n==null?void 0:n.checkIconImage,this._indeterminateIconImage=(x=(R=t==null?void 0:t.checkboxStyle)===null||R===void 0?void 0:R.indeterminateIconImage)!==null&&x!==void 0?x:n==null?void 0:n.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 Rs(t,this)}clone(){return new Rs(this)}}function mg(i,t,e,n,o,r){var s;return i||t?i instanceof xs?i:typeof i=="function"?mg(i(e),t,e,n,o,r):(i||(i={}),o&&!z(i.autoWrapText)&&(i.autoWrapText=!0),n===Rs?new Rs(i??{},t??{},(s=r.checkboxStyle)!==null&&s!==void 0?s:{}):new n(i??{},t??{})):n.DEFAULT}class w8{constructor(t){this._table=t;const e=vn();this.freezeIcon=e[Wi.freezeIconName],this.frozenIcon=e[Wi.frozenIconName],this.frozenCurrentIcon=e[Wi.frozenCurrentIconName],this.normalIcon=e[Wi.normalIconName],this.upIcon=e[Wi.upwardIconName],this.downIcon=e[Wi.downwardIconName],this.dropDownAbsoluteIcon=e[Wi.dropdownIconName],this.expandIcon=e[Wi.expandIconName],this.collapseIcon=e[Wi.collapseIconName]}getIcons(t,e){const n=[];if(this._table.isPivotTable()){const{showSort:l,sort:a}=this._table.internalProps.layoutMap.getHeader(t,e);if(l){let h=this._table.getPivotSortState(t,e);h&&(h=h.toUpperCase());const d=h==="ASC"?this.upIcon:h==="DESC"?this.downIcon:this.normalIcon;d&&n.push(d)}else if(a){const h=this.getSortIconForPivotTable(this._table.getPivotSortState(t,e),this._table,t,e);h&&n.push(h)}}else{const l=this._table.sortState;let a;a=void 0;const h=this._table.getCellRange(t,e);if(l)if(Array.isArray(l))for(let u=0;u<l.length;u++){const c=l[u],g=this._table._getHeaderCellBySortState(c);if(g&&Yi(h,g.col,g.row)){({order:a}=c);break}}else{const u=this._table._getHeaderCellBySortState(l);u&&Yi(h,u.col,u.row)&&({order:a}=l)}const d=this.getSortIcon(a,this._table,t,e);d&&n.push(d)}if(this._table.showFrozenIcon&&t<this._table.allowFrozenColCount){const l=this.getFrozenIcon(t,e);l&&n.push(l)}if(this.checkDropDownIcon(this._table,t,e)){const l=this.dropDownAbsoluteIcon;n.push(l)}const o=this.getDropDownStateIcons(this._table,t,e);o.length&&n.push(...o);const{headerIcon:r}=this._table._getHeaderLayoutMap(t,e),s=this.getHierarchyIcon(t,e);if(s&&n.push(s),r){let l;typeof r=="function"?l=r({col:t,row:e,value:this._table.getCellValue(t,e),dataValue:this._table.getCellOriginValue(t,e),table:this._table}):l=r;const a=vn(),h=d=>{let u;u=typeof d=="string"?a[d]:d,u&&n.push(u)};Array.isArray(l)?l.forEach((d,u)=>{h(d)}):h(l)}return n}getFrozenIcon(t,e){if(this._table.isPivotTable()||this._table.transpose||this._table.rightFrozenColCount&&t>=this._table.colCount-this._table.rightFrozenColCount)return null;const n=this._table.getHeaderDefine(t,e);if(n.columns&&n.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,n,o){const r=t==="asc"?this.upIcon:t==="desc"?this.downIcon:this.normalIcon,s=e.getHeaderDefine(n,o);return!s||s.showSort===!1||!z(s.showSort)&&!s.sort||s.columns&&s.columns.length>0?null:r}getSortIconForPivotTable(t,e,n,o){const r=e.getHeaderDefine(n,o);return!r||r.showSort===!1||!z(r.showSort)&&!r.sort||r.columns&&r.columns.length>0?null:(t==null?void 0:t.toUpperCase())==="ASC"?this.upIcon:(t==null?void 0:t.toUpperCase())==="DESC"?this.downIcon:this.normalIcon}getDropDownStateIcons(t,e,n){var o,r,s;const l=t.getHeaderDefine(e,n),a=t._getHeaderLayoutMap(e,n),{dropDownMenu:h}=a,d=[];if(Array.isArray(h)&&h.length||Array.isArray(t.globalDropDownMenu)&&t.globalDropDownMenu.length&&!(!((o=l==null?void 0:l.columns)===null||o===void 0)&&o.length)){const u=h||t.globalDropDownMenu;let c=-1,g=-1;for(let f=0;f<u.length;f++){const p=u[f];if(typeof p=="object"&&p.children&&p.children.length)for(let m=0;m<p.children.length;m++){const b=p.children[m];if(!((r=t.stateManager.menu)===null||r===void 0)&&r.dropDownMenuHighlight&&Ph(t,(s=t.stateManager.menu)===null||s===void 0?void 0:s.dropDownMenuHighlight,typeof b=="object"?b==null?void 0:b.menuKey:b,e,n)){c=f,g=m;break}}if(t._dropDownMenuIsHighlight(e,n,f)){c=f;break}}if(c!==-1){let f;f=g!==-1?(h||t.globalDropDownMenu)[c].children[g]:(h||t.globalDropDownMenu)[c],f.stateIcon&&(f.stateIcon.svg?d.push({type:"svg",name:f.stateIcon.src||f.stateIcon.svg,width:f.stateIcon.width||22,height:f.stateIcon.height||22,svg:f.stateIcon.svg,positionType:me.right,marginRight:0,funcType:ve.dropDownState,interactive:!1}):f.stateIcon.src&&d.push({type:"image",name:f.stateIcon.src||f.stateIcon.svg,width:f.stateIcon.width||22,height:f.stateIcon.height||22,src:f.stateIcon.src,positionType:me.right,marginRight:0,funcType:ve.dropDownState,interactive:!1}))}}return d}getDropDownIconRect(t,e,n){var o,r,s,l,a,h,d,u;const c=(l=(r=(o=this.downIcon.hover)===null||o===void 0?void 0:o.width)!==null&&r!==void 0?r:(s=this.downIcon)===null||s===void 0?void 0:s.width)!==null&&l!==void 0?l:0,g=(u=(h=(a=this.downIcon.hover)===null||a===void 0?void 0:a.height)!==null&&h!==void 0?h:(d=this.downIcon)===null||d===void 0?void 0:d.height)!==null&&u!==void 0?u:0,f=t.right-2-c,p=t.right-2;let m;return m=n==="middle"?t.top+t.height/2-c/2:n==="top"?t.top+e/2:n==="bottom"?t.bottom-2*e:t.top,{left:f,right:p,top:m,bottom:g+m,width:c,height:g}}getHierarchyIcon(t,e){const{hierarchyState:n}=this._table._getHeaderLayoutMap(t,e);if(n){if(n===Vt.expand)return this.expandIcon;if(n===Vt.collapse)return this.collapseIcon}}getHierarchyIconWidth(){var t,e;return this.expandIcon.width+((t=this.expandIcon.marginLeft)!==null&&t!==void 0?t:0)+((e=this.expandIcon.marginRight)!==null&&e!==void 0?e:0)}checkDropDownIcon(t,e,n){var o;if(t.isPivotTable()){const r=t._getHeaderLayoutMap(e,n);if(Array.isArray(r.dropDownMenu)&&r.dropDownMenu.length)return!0}else{const r=t.getHeaderDefine(e,n);if(Array.isArray(r.dropDownMenu)&&r.dropDownMenu.length||(!Array.isArray(r.dropDownMenu)||r.dropDownMenu.length!==0)&&Array.isArray(t.globalDropDownMenu)&&t.globalDropDownMenu.length&&!(!((o=r==null?void 0:r.columns)===null||o===void 0)&&o.length))return!0}return!1}getStyleClass(t){switch(t){case"text":case"link":return pg;case"image":case"video":return fg;case"checkbox":return Rs}}setTableColumnsEditor(){const t=(e,n)=>{e==null||e.forEach((o,r)=>{o.editor&&(n[r].editor=o.editor),o.columns&&t(o.columns,n[r].columns)})};t(this._table.options.columns,this._table.internalProps.columns)}}class NA extends EventTarget{constructor(t,e){if(super(),this._table=t,oe.mode==="node")return;const n=document.createElement("div");n.style.opacity="0",n.dataset.vtable="vtable",n.style.pointerEvents="none",n.classList.add("input-container");const o=this._input=document.createElement("input");n.appendChild(o),o.classList.add("table-focus-control"),o.dataset.vtable="vtable",o.readOnly=!0,e.appendChild(n),this._container=n}focus(){this._input.focus({preventScroll:!0})}setFocusRect(t,e){const n=this._input;n.value=e,n.select();const o=t.top-this._table.scrollTop,r=t.left-this._table.scrollLeft;n.style.top=`${o.toFixed()}px`,n.style.left=`${r.toFixed()}px`,n.style.width=`${t.width.toFixed()}px`,n.style.height=`${t.height.toFixed()}px`}get input(){return this._input}release(){var t;(t=this._container.parentElement)===null||t===void 0||t.removeChild(this._container)}}class VA{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(!z(e))return;const n=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-n)}remove(t){if(this.data.has(t)){const e=this.data.get(t);this.data.delete(t);const n=this._keys.indexOf(t);n!==-1&&this._keys.splice(n,1),this.totalSum-=e;const o=this.table.getRowHeight(t);this.updateDifference(t,o-e)}}put(t,e){if(z(e))if(this.data.has(t)){const n=this.data.get(t);if(n===e)return;this.data.set(t,e);const o=e-n;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((e,n)=>e<n?-1:e>n?1:0),this._sorted=!0)}updateDifference(t,e){var n;const o=(n=this.difference.get(t))!==null&&n!==void 0?n: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[n,o]of this.cumulativeSum)n>=t&&this.cumulativeSum.set(n,o+e)}calculatePrefixSum(t){if(t<0)return 0;if(this.cumulativeSum.has(t)){let e=this.cumulativeSum.get(t);for(const[n,o]of this.difference)n<=t&&(e+=o);return e}return this.dealDiffenence(),this.getCumulativeSum(t)}getCumulativeSum(t){var e;let n=0;for(let o=t;o>=0;o--){if(this.cumulativeSum.has(o)){n+=this.cumulativeSum.get(o);break}n+=(e=this.data.get(o))!==null&&e!==void 0?e:this.table.getRowHeight(o)}return this.cumulativeSum.set(t,n),n}update(){this.isUpdate||(this.isUpdate=!0,setTimeout(()=>{this.dealDiffenence(),this.isUpdate=!1},0))}dealDiffenence(){for(const[t]of this.cumulativeSum)for(const[e,n]of this.difference)if(t>=e){const o=this.cumulativeSum.get(t);this.cumulativeSum.set(t,o+n)}this.difference.clear()}insert(t,e){for(let o=t;o<=this.getLastIndex();o++)this.cumulativeSum.delete(o);const n=this.getLastIndex()+1;this.adjustOrder(t,t+1,n-t),z(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 n=t;n<=this.getLastIndex();n++)this.cumulativeSum.delete(n);const e=this.getLastIndex();this.adjustOrder(t+1,t,e-t),this.delLast()}adjustOrder(t,e,n){this.clearRange(),this._sort();const{_keys:o}=this;if(t>e){const s=[];for(let l=vg(o,t+n-1);l>=0;l--){const a=o[l];if(a>=t)s.push(this.get(a));else if(e<=a&&a<t)this.put(a+n,this.get(a));else if(a<e)break}for(let l=0;l<n;l++)this.put(e+l,s[n-1-l])}const{length:r}=o;if(t<e){const s=[];for(let l=vg(o,t);l<r;l++){const a=o[l];if(a>=t&&a<t+n)s.push(this.get(a));else if(t+n<=a&&a<=e)this.put(a-n,this.get(a));else if(a>e)break}for(let l=0;l<n;l++)this.put(e+l,s[l])}}exchangeOrder(t,e,n,o,r){const{_keys:s}=this;if(this._sorted||(s.sort((l,a)=>l<a?-1:l>a?1:0),this._sorted=!0),t>n){const l=[],a=[];for(let h=vg(s,n);h<t+e;h++){const d=s[h];d>=t&&d<t+e?a.push(this.get(d)):l.push(this.get(d))}for(let h=0;h<e;h++)this.put(r+h,a[h]);for(let h=0;h<l.length;h++)this.put(r+e+h,l[h])}else{const l=[],a=[];for(let h=vg(s,t);h<n+o;h++){const d=s[h];d>=t&&d<t+e?a.push(this.get(d)):l.push(this.get(d))}for(let h=0;h<e;h++)this.put(r+h,a[h]);for(let h=0;h<l.length;h++)this.put(t+h,l[h])}}}function vg(i,t){let e=0,n=i.length-1;for(;e<=n;){const o=Math.floor((e+n)/2);if(i[o]===t)return o;i[o]>t?n=o-1:e=o+1}return n<0?0:n}class S8{constructor(t){this._table=t;const e=vn();this.dragReorderIconName=e[Wi.dragReorderIconName]}getIcons(t,e){return[this.dragReorderIconName]}}class x8{constructor(t,e,n){this.table=t,this.customCellStyle=e,this.customCellStyleArrangement=n}getCustomCellStyle(t,e){const n=this.getCustomCellStyleId(t,e);if(n){const o=this.getCustomCellStyleOption(n);return o==null?void 0:o.style}}getCustomCellStyleId(t,e){let n;const o=this.table.getCellRange(t,e);for(let r=o.start.col;r<=o.end.col;r++)for(let s=o.start.row;s<=o.end.row;s++)this.customCellStyleArrangement.forEach(l=>{l.cellPosition.range?l.cellPosition.range.start.col<=r&&l.cellPosition.range.end.col>=r&&l.cellPosition.range.start.row<=s&&l.cellPosition.range.end.row>=s&&(n=l.customStyleId):l.cellPosition.col===r&&l.cellPosition.row===s&&(n=l.customStyleId)});return n}getCustomCellStyleOption(t){return this.customCellStyle.find(e=>e.id===t)}registerCustomCellStyle(t,e){const n=this.customCellStyle.findIndex(o=>o.id===t);n===-1?this.customCellStyle.push({id:t,style:e}):this.customCellStyle[n]={id:t,style:e},this.customCellStyleArrangement.forEach(o=>{const r=o.cellPosition;if(o.customStyleId===t)if(r.range)for(let s=r.range.start.col;s<=r.range.end.col;s++)for(let l=r.range.start.row;l<=r.range.end.row;l++)this.table.scenegraph.updateCellContent(s,l);else this.table.scenegraph.updateCellContent(r.col,r.row)}),this.table.scenegraph.updateNextFrame()}arrangeCustomCellStyle(t,e){const n=this.customCellStyleArrangement.findIndex(o=>o.cellPosition.range&&t.range?o.cellPosition.range.start.col===t.range.start.col&&o.cellPosition.range.start.row===t.range.start.row&&o.cellPosition.range.end.col===t.range.end.col&&o.cellPosition.range.end.row===t.range.end.row:o.cellPosition.col===t.col&&o.cellPosition.row===t.row);if(n!==-1||e){if(n===-1&&e)this.customCellStyleArrangement.push({cellPosition:{col:t.col,row:t.row,range:t.range},customStyleId:e});else{if(this.customCellStyleArrangement[n].customStyleId===e)return;e?this.customCellStyleArrangement[n].customStyleId=e:this.customCellStyleArrangement.splice(n,1)}if(t.range)for(let o=t.range.start.col;o<=t.range.end.col;o++)for(let r=t.range.start.row;r<=t.range.end.row;r++){const s=this.table.getCellRange(o,r);for(let l=s.start.col;l<=s.end.col;l++)for(let a=s.start.row;a<=s.end.row;a++)this.table.scenegraph.updateCellContent(l,a)}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(n=>{this.registerCustomCellStyle(n.id,n.style)}),e.forEach(n=>{this.arrangeCustomCellStyle(n.cellPosition,n.customStyleId)})}hasCustomCellStyle(t){return this.customCellStyle.some(e=>e.id===t)}}function Hh(i,t){i=i.clone();for(const e in t){const n=t[e];n&&(i[`_${e}`]=n)}return i}class Pe{constructor(t,e,n="grid",o=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 Mr,this.dimensionKeysIncludeVirtual=new Mr,this.cache=new Map,this.sizeIncludeParent=o!=null,this.rowExpandLevel=o,this.hierarchyType=n,this.sharedVar=e,this.reset(t)}reset(t,e=!1){this.cache.clear(),this.dimensionKeys=new Mr,this.dimensionKeysIncludeVirtual=new Mr,this.tree.children=t,this.setTreeNode(this.tree,0,this.tree)}setTreeNode(t,e,n){var o,r;t.startIndex=e,t.startInTotal=((o=n.startInTotal)!==null&&o!==void 0?o:0)+t.startIndex,((r=t.dimensionKey)!==null&&r!==void 0?r:t.indicatorKey)&&(t.virtual||this.dimensionKeys.contain(t.indicatorKey?Xi:t.dimensionKey)||this.dimensionKeys.put(t.level,t.indicatorKey?Xi:t.dimensionKey),this.dimensionKeysIncludeVirtual.contain(t.indicatorKey?Xi:t.dimensionKey)||this.dimensionKeysIncludeVirtual.put(t.level,t.indicatorKey?Xi:t.dimensionKey),t.id||(t.id=++this.sharedVar.seqId));let s=t.dimensionKey&&this.sizeIncludeParent?1:0;const l=t.children||t.columns;return this.hierarchyType==="grid"?(l==null?void 0:l.length)>=1?l.forEach(a=>{var h;a.level=((h=t.level)!==null&&h!==void 0?h:0)+1,this.totalLevel=Math.max(this.totalLevel,a.level+1),s+=this.setTreeNode(a,s,t)}):s=1:t.hierarchyState===Vt.expand&&(l==null?void 0:l.length)>=1?l.forEach(a=>{var h;a.level=((h=t.level)!==null&&h!==void 0?h:0)+1,this.totalLevel=Math.max(this.totalLevel,a.level+1),s+=this.setTreeNode(a,s,t)}):t.hierarchyState===Vt.collapse&&(l==null?void 0:l.length)>=1?l.forEach(a=>{var h;a.level=((h=t.level)!==null&&h!==void 0?h:0)+1,this.totalLevel=Math.max(this.totalLevel,a.level+1),this.setTreeNode(a,s,t)}):!t.hierarchyState&&t.level+1<this.rowExpandLevel&&((l==null?void 0:l.length)>=1||l===!0)?(t.hierarchyState=Vt.expand,(l==null?void 0:l.length)>=1&&l.forEach(a=>{var h;a.level=((h=t.level)!==null&&h!==void 0?h:0)+1,this.totalLevel=Math.max(this.totalLevel,a.level+1),s+=this.setTreeNode(a,s,t)})):(l==null?void 0:l.length)>=1||l===!0?(t.hierarchyState=Vt.collapse,(l==null?void 0:l.length)>=1&&l.forEach(a=>{var h;a.level=((h=t.level)!==null&&h!==void 0?h:0)+1,this.totalLevel=Math.max(this.totalLevel,a.level+1),this.setTreeNode(a,s,t)})):(t.hierarchyState=Vt.none,s=1),t.size=s,s}getTreePath(t,e=30){const n=[];return this.searchPath(t,this.tree,n,e),n.shift(),n}getTreePathByCellIds(t){const e=[];let n=this.tree.children;for(let o=0;o<t.length;o++){const r=t[o],s=this.findNodeById(n,r);if(!s)break;e.push(s),n=s.children}return e}findNodeById(t,e){return t.find(n=>n.id===e)}searchPath(t,e,n,o){if(!e||t<e.startIndex||t>=e.startIndex+e.size||(n.push(e),!e.children||e.children.length===0||e.level>=o))return;const r=t-e.startIndex;if(this.cache.has(e.level+1)){const a=this.cache.get(e.level+1);if(r>=a.startIndex&&r<a.startIndex+a.size)return void this.searchPath(r,a,n,o)}let s=0,l=e.children.length-1;for(;s<=l;){const a=Math.floor((s+l)/2),h=e.children[a];if(r>=h.startIndex&&r<h.startIndex+h.size){this.cache.set(h.level,h);const d=[];this.cache.forEach((u,c)=>{c>h.level&&d.push(c)}),d.forEach(u=>{this.cache.delete(u)}),this.searchPath(r,h,n,o);break}r<h.startIndex?l=a-1:s=a+1}}movePosition(t,e,n){let o,r,s;const l=(d,u)=>{if(r!==void 0&&s!==void 0)return;d.level===t&&(d.startInTotal===e&&(r=u),d.startInTotal<=n&&n<=d.startInTotal+d.size-1&&(s=u));const c=d.children||d.columns;if(c&&d.level<t){o=d;for(let g=0;g<c.length;g++)(e>=c[g].startInTotal&&e<=c[g].startInTotal+c[g].size||n>=c[g].startInTotal&&n<=c[g].startInTotal+c[g].size)&&l(c[g],g)}};l(this.tree,0);const a=o.children||o.columns,h=a.splice(r,1);h.unshift(s,0),Array.prototype.splice.apply(a,h)}getCopiedTree(){const t=Ee(this.tree.children);return jA(t),t}}function ov(i,t){t==null||t.forEach(e=>{var n,o;const r={dimensionKey:e.dimensionKey,indicatorKey:e.indicatorKey,value:e.value,hierarchyState:e.hierarchyState,children:void 0,virtual:(n=e.virtual)!==null&&n!==void 0&&n,levelSpan:(o=e.levelSpan)!==null&&o!==void 0?o:1};i.push(r),e.children&&(r.children=[],ov(r.children,e.children))})}function bg(i,t){let e=0;return i==null||i.forEach(n=>{t?e++:n.children&&n.children.length!==0||e++,n.children&&(e+=bg(n.children,t))}),e}function R8(i,t,e,n,o,r){var s,l,a,h,d,u,c,g,f,p,m,b,C,_,w,y,S,A,R,x,T,M,B,P;const F=i.id,H=(l=(s=r.rowsDefine)===null||s===void 0?void 0:s.find(I=>typeof I!="string"&&I.dimensionKey===i.dimensionKey))!==null&&l!==void 0?l:(a=r.columnsDefine)===null||a===void 0?void 0:a.find(I=>typeof I!="string"&&I.dimensionKey===i.dimensionKey),E=(h=r.indicatorsDefine)===null||h===void 0?void 0:h.find(I=>typeof I!="string"&&(i.indicatorKey?I.indicatorKey===i.indicatorKey:I.title===i.value&&!i.dimensionKey)),k={id:F,title:(d=i.value)!==null&&d!==void 0?d:E==null?void 0:E.title,field:i.dimensionKey,style:typeof((u=E??H)===null||u===void 0?void 0:u.headerStyle)=="function"?(c=E??H)===null||c===void 0?void 0:c.headerStyle:Object.assign({},(g=E??H)===null||g===void 0?void 0:g.headerStyle),headerType:(p=(f=E==null?void 0:E.headerType)!==null&&f!==void 0?f:H==null?void 0:H.headerType)!==null&&p!==void 0?p:"text",headerIcon:(m=E==null?void 0:E.headerIcon)!==null&&m!==void 0?m:H==null?void 0:H.headerIcon,define:Object.assign({},i,E??Object.assign({},H,{sort:void 0})),fieldFormat:(b=E==null?void 0:E.headerFormat)!==null&&b!==void 0?b:H==null?void 0:H.headerFormat,dropDownMenu:(C=E==null?void 0:E.dropDownMenu)!==null&&C!==void 0?C:H==null?void 0:H.dropDownMenu,pivotInfo:{value:i.value,dimensionKey:i.dimensionKey,isPivotCorner:!1},width:H==null?void 0:H.width,minWidth:H==null?void 0:H.minWidth,maxWidth:H==null?void 0:H.maxWidth,showSort:(_=E==null?void 0:E.showSort)!==null&&_!==void 0?_:H==null?void 0:H.showSort,sort:E==null?void 0:E.sort,description:H==null?void 0:H.description};E?(E.customRender&&(i.customRender=E.customRender),z((w=r._indicators)===null||w===void 0?void 0:w.find(I=>I.indicatorKey===E.indicatorKey))||(y=r._indicators)===null||y===void 0||y.push({id:++r.sharedVar.seqId,indicatorKey:E.indicatorKey,field:E.indicatorKey,fieldFormat:E==null?void 0:E.format,cellType:(A=(S=E==null?void 0:E.cellType)!==null&&S!==void 0?S:E==null?void 0:E.columnType)!==null&&A!==void 0?A:"text",chartModule:"chartModule"in E?E.chartModule:null,chartSpec:"chartSpec"in E?E.chartSpec:null,noDataRenderNothing:"noDataRenderNothing"in E&&E.noDataRenderNothing,sparklineSpec:"sparklineSpec"in E?E.sparklineSpec:null,style:E==null?void 0:E.style,icon:E==null?void 0:E.icon,define:Object.assign({},i,E,{dragHeader:H==null?void 0:H.dragHeader}),width:E==null?void 0:E.width,minWidth:E==null?void 0:E.minWidth,maxWidth:E==null?void 0:E.maxWidth,disableColumnResize:E==null?void 0:E.disableColumnResize})):i.indicatorKey&&(z((R=r._indicators)===null||R===void 0?void 0:R.find(I=>I.indicatorKey===i.indicatorKey))||(x=r._indicators)===null||x===void 0||x.push({id:++r.sharedVar.seqId,indicatorKey:i.indicatorKey,field:i.indicatorKey,cellType:"text",define:Object.assign({},i)})),e[F]=k,r._headerObjects[F]=k;for(let I=o-1;I>=0;I--)t[I][r.colIndex]=n[I];if(t[o][r.colIndex]=F,i.levelSpan>1)for(let I=1;I<i.levelSpan;I++){if(!t[o+I]){t[o+I]=[];for(let L=0;L<r.colIndex;L++)t[o+I][L]=t[o][L]}t[o+I][r.colIndex]=F}if(((T=i.children)===null||T===void 0?void 0:T.length)>=1)r._addHeaders(t,o+((M=i.levelSpan)!==null&&M!==void 0?M:1),(B=i.children)!==null&&B!==void 0?B:[],[...n,...Array((P=i.levelSpan)!==null&&P!==void 0?P:1).fill(F)],e);else{for(let I=o+1;I<t.length;I++)t[I][r.colIndex]=F;r.colIndex++}}function A8(i,t,e,n,o,r,s,l,a){var h,d,u,c,g,f,p,m,b,C,_,w,y,S,A,R,x,T,M,B,P,F,H,E,k,I,L,D;const O=i.id,N=l.find(U=>typeof U!="string"&&U.dimensionKey===i.dimensionKey),W=(h=a.indicatorsDefine)===null||h===void 0?void 0:h.find(U=>typeof U!="string"&&(i.indicatorKey?U.indicatorKey===i.indicatorKey:U.title===i.value)),$={id:O,title:(d=i.value)!==null&&d!==void 0?d:W.title,field:i.dimensionKey,style:i.level+1===r||typeof((u=W??N)===null||u===void 0?void 0:u.headerStyle)=="function"?(c=W??N)===null||c===void 0?void 0:c.headerStyle:Object.assign({},(g=W??N)===null||g===void 0?void 0:g.headerStyle,{textAlign:"left"}),headerType:(p=(f=W==null?void 0:W.headerType)!==null&&f!==void 0?f:N==null?void 0:N.headerType)!==null&&p!==void 0?p:"text",headerIcon:(m=W==null?void 0:W.headerIcon)!==null&&m!==void 0?m:N==null?void 0:N.headerIcon,define:Object.assign(i,{linkJump:(b=W??N)===null||b===void 0?void 0:b.linkJump,linkDetect:(C=W??N)===null||C===void 0?void 0:C.linkDetect,templateLink:(_=W??N)===null||_===void 0?void 0:_.templateLink,keepAspectRatio:(y=(w=W??N)===null||w===void 0?void 0:w.keepAspectRatio)!==null&&y!==void 0&&y,imageAutoSizing:(S=W??N)===null||S===void 0?void 0:S.imageAutoSizing,headerCustomRender:(A=W??N)===null||A===void 0?void 0:A.headerCustomRender,headerCustomLayout:(R=W??N)===null||R===void 0?void 0:R.headerCustomLayout,dragHeader:N==null?void 0:N.dragHeader,disableHeaderHover:!!(!((x=W??N)===null||x===void 0)&&x.disableHeaderHover),disableHeaderSelect:!!(!((T=W??N)===null||T===void 0)&&T.disableHeaderSelect)}),fieldFormat:(M=W==null?void 0:W.headerFormat)!==null&&M!==void 0?M:N==null?void 0:N.headerFormat,dropDownMenu:(B=W==null?void 0:W.dropDownMenu)!==null&&B!==void 0?B:N==null?void 0:N.dropDownMenu,pivotInfo:{value:i.value,dimensionKey:i.dimensionKey,isPivotCorner:!1},hierarchyLevel:i.level,dimensionTotalLevel:r,hierarchyState:i.hierarchyState,width:N==null?void 0:N.width,minWidth:N==null?void 0:N.minWidth,maxWidth:N==null?void 0:N.maxWidth,parentCellId:n[n.length-1]};W?(W.customRender&&(i.customRender=W.customRender),z((P=a._indicators)===null||P===void 0?void 0:P.find(U=>U.indicatorKey===W.indicatorKey))||(F=a._indicators)===null||F===void 0||F.push({id:++a.sharedVar.seqId,indicatorKey:W.indicatorKey,field:W.indicatorKey,fieldFormat:W==null?void 0:W.format,cellType:(E=(H=W==null?void 0:W.cellType)!==null&&H!==void 0?H:W==null?void 0:W.columnType)!==null&&E!==void 0?E:"text",chartModule:"chartModule"in W?W.chartModule:null,chartSpec:"chartSpec"in W?W.chartSpec:null,noDataRenderNothing:"noDataRenderNothing"in W&&W.noDataRenderNothing,sparklineSpec:"sparklineSpec"in W?W.sparklineSpec:null,style:W==null?void 0:W.style,icon:W==null?void 0:W.icon,define:Object.assign({},i,W,{dragHeader:N==null?void 0:N.dragHeader}),width:W==null?void 0:W.width,minWidth:W==null?void 0:W.minWidth,maxWidth:W==null?void 0:W.maxWidth,disableColumnResize:W==null?void 0:W.disableColumnResize})):i.indicatorKey&&(z((k=a._indicators)===null||k===void 0?void 0:k.find(U=>U.indicatorKey===i.indicatorKey))||(I=a._indicators)===null||I===void 0||I.push({id:++a.sharedVar.seqId,indicatorKey:i.indicatorKey,field:i.indicatorKey,cellType:"text",define:Object.assign({},i)})),e[O]=$,a._headerObjects[O]=$,t[o][a.colIndex]=O;for(let U=o-1;U>=0;U--)t[U][a.colIndex]=n[U];if(i.hierarchyState===Vt.expand&&((L=i.children)===null||L===void 0?void 0:L.length)>=1)s&&a.colIndex++,a._addHeadersForTreeMode(t,o,(D=i.children)!==null&&D!==void 0?D:[],[...n,O],r,s&&i.hierarchyState===Vt.expand,l,e);else{s&&a.colIndex++;for(let U=o+1;U<t.length;U++)t[U][a.colIndex]=O}}function jA(i){for(let t=0;t<i.length;t++){const e=i[t];delete e.level,delete e.startIndex,delete e.id,delete e.levelSpan,delete e.size,delete e.startInTotal;const n=e.children||e.columns;n&&jA(n)}}function T8(i){const t=i.columnObjects;for(let e=0;e<t.length;e++){const n=t[e];if(n!=null&&n.aggregation)return!0}return!1}function M8(i){const t=i.columnObjects;let e=0;for(let n=0;n<t.length;n++){const o=t[n];o!=null&&o.aggregation&&(Array.isArray(o==null?void 0:o.aggregation)?e=Math.max(e,o.aggregation.filter(r=>r.showOnTop).length):o.aggregation.showOnTop&&(e=Math.max(e,1)))}return e}function B8(i){const t=i.columnObjects;let e=0;for(let n=0;n<t.length;n++){const o=t[n];o!=null&&o.aggregation&&(Array.isArray(o==null?void 0:o.aggregation)?e=Math.max(e,o.aggregation.filter(r=>!r.showOnTop).length):o.aggregation.showOnTop||(e=Math.max(e,1)))}return e}function P8(i){if(i._table.options.groupBy)return!0;const{columns:t}=i._table.options;if(lt(t)&&t.length>0)for(let e=0;e<t.length;e++){const n=t[e];if(!ce(n)&&n.tree)return!0}return!1}function H8(i){const{columns:t,rows:e,indicators:n}=i.options;if(i.isPivotTable()){if(lt(t)&&t.length>0)for(let o=0;o<t.length;o++){const r=t[o];if(!ce(r)&&(r.headerType==="image"||r.headerType==="video"||typeof r.headerType=="function")&&r.imageAutoSizing)return!0}if(lt(e)&&e.length>0)for(let o=0;o<e.length;o++){const r=e[o];if(!ce(r)&&(r.headerType==="image"||r.headerType==="video"||typeof r.headerType=="function")&&r.imageAutoSizing)return!0}if(lt(n)&&n.length>0)for(let o=0;o<n.length;o++){const r=n[o];if(!ce(r)&&((r.cellType==="image"||r.cellType==="video"||typeof r.cellType=="function")&&r.imageAutoSizing||(r.headerType==="image"||r.headerType==="video"||typeof r.headerType=="function")&&r.imageAutoSizing))return!0}}else if(lt(t)&&t.length>0)for(let o=0;o<t.length;o++){const r=t[o];if((r.cellType==="image"||r.cellType==="video"||typeof r.cellType=="function")&&r.imageAutoSizing||(r.headerType==="image"||r.headerType==="video"||typeof r.headerType=="function")&&r.imageAutoSizing)return!0}return!1}function $A(i,t){var e,n,o,r,s,l,a,h,d,u,c,g,f,p;let m,b;t.columnTree&&(i.options.indicatorsAsCol!==!1&&i.options.supplementIndicatorNodes!==!1&&(i.internalProps.columnTree=Vi(i.internalProps.columnTree,t.indicators)),m=new Pe((e=i.internalProps.columnTree)!==null&&e!==void 0?e:[],i.layoutNodeId)),t.rowTree&&(i.options.indicatorsAsCol===!1&&i.options.supplementIndicatorNodes!==!1&&(i.internalProps.rowTree=Vi(i.internalProps.rowTree,t.indicators)),b=new Pe((n=i.internalProps.rowTree)!==null&&n!==void 0?n:[],i.layoutNodeId,i.options.rowHierarchyType,i.options.rowHierarchyType==="tree"?(o=i.options.rowExpandLevel)!==null&&o!==void 0?o:1:void 0));const C=!((r=b==null?void 0:b.dimensionKeys)===null||r===void 0)&&r.count?b.dimensionKeys.valueArr():(l=(s=t.rows)===null||s===void 0?void 0:s.reduce((y,S)=>(typeof S=="string"?y.push(S):y.push(S.dimensionKey),y),[]))!==null&&l!==void 0?l:[],_=!((a=m==null?void 0:m.dimensionKeys)===null||a===void 0)&&a.count?m.dimensionKeys.valueArr():(d=(h=t.columns)===null||h===void 0?void 0:h.reduce((y,S)=>(typeof S=="string"?y.push(S):y.push(S.dimensionKey),y),[]))!==null&&d!==void 0?d:[],w=(c=(u=t.indicators)===null||u===void 0?void 0:u.reduce((y,S)=>{var A;return typeof S=="string"?y.push(S):(y.push(S.indicatorKey),(S.chartSpec||S.sparklineSpec)&&(!((A=i.internalProps.dataConfig)===null||A===void 0)&&A.aggregationRules?i.internalProps.dataConfig.aggregationRules.find(R=>R.indicatorKey===S.indicatorKey)||i.internalProps.dataConfig.aggregationRules.push({field:S.indicatorKey,indicatorKey:S.indicatorKey,aggregationType:zt.NONE}):i.internalProps.dataConfig?i.internalProps.dataConfig.aggregationRules=[{field:S.indicatorKey,indicatorKey:S.indicatorKey,aggregationType:zt.NONE}]:i.internalProps.dataConfig={aggregationRules:[{field:S.indicatorKey,indicatorKey:S.indicatorKey,aggregationType:zt.NONE}]})),y},[]))!==null&&c!==void 0?c:[];return t.rowHierarchyType==="tree"&&((f=(g=t.extensionRows)===null||g===void 0?void 0:g.length)!==null&&f!==void 0?f:0)>=1&&((p=t.extensionRows)===null||p===void 0||p.forEach(y=>{const S=[];y.rows.forEach(A=>{typeof A=="string"?S.push(A):S.push(A.dimensionKey)}),C.push(...S)})),{rowKeys:C,columnKeys:_,indicatorKeys:w,columnDimensionTree:m,rowDimensionTree:b}}function Vi(i,t){const e=(n,o)=>{n.forEach(r=>{var s;r.indicatorKey||o||!((s=r.children)===null||s===void 0)&&s.length&&r.children?r.children&&Array.isArray(r.children)&&e(r.children,o||!!r.indicatorKey):r.children=t==null?void 0:t.map(l=>{var a;return typeof l=="string"?{indicatorKey:l,value:l}:{indicatorKey:l.indicatorKey,value:(a=l.title)!==null&&a!==void 0?a:l.indicatorKey}})})};return i!=null&&i.length?e(i,!1):i=t==null?void 0:t.map(n=>{var o;return typeof n=="string"?{indicatorKey:n,value:n}:{indicatorKey:n.indicatorKey,value:(o=n.title)!==null&&o!==void 0?o:n.indicatorKey}}),i}function GA(i,t){const e=H6(t,i);if(e)return e;let n=sv(i,t);return n||(n={top:-1,row:-1,bottom:-1,height:-1}),n}function UA(i,t){const e=E6(t,i);if(e)return e;let n=rv(i,t);return n||(n={left:-1,col:-1,right:-1,width:1}),n}function E8(i,t,e){const n=GA(t,e),{row:o,top:r,bottom:s,height:l}=n,a=UA(i,e),{col:h,left:d,right:u,width:c}=a;return{row:o,col:h,rect:{left:d,right:u,top:r,bottom:s,width:c,height:l}}}function rv(i,t){if(i===0)return{left:0,col:0,right:0,width:0};const e=k8(i,t),n=t.getColsWidth(0,e);return i>=n?((o,r)=>{let s=r-t.getColWidth(o);const{colCount:l}=t.internalProps;for(let a=o;a<l;a++){const h=t.getColWidth(a),d=s+h;if(Math.round(s)<=Math.round(i)&&Math.round(i)<Math.round(d))return{left:s,col:a,right:d,width:h};s=d}return null})(e,n):((o,r)=>{let s=r;for(let l=o;l>=0;l--){const a=t.getColWidth(l),h=s-a;if(Math.round(h)<=Math.round(i)&&Math.round(i)<Math.round(s))return{left:h,col:l,right:s,width:a};s=h}return null})(e,n)}function sv(i,t){if(i===0)return{top:0,row:0,bottom:0,height:0};const e=L8(i,t),n=t.getRowsHeight(0,e);return i>=n?((o,r)=>{let s=r-t.getRowHeight(o);const{rowCount:l}=t.internalProps;for(let a=o;a<l;a++){const h=t.getRowHeight(a),d=s+h;if(Math.round(s)<=Math.round(i)&&Math.round(i)<Math.round(d))return{top:s,row:a,bottom:d,height:h};s=d}return null})(e,n):((o,r)=>{let s=r;for(let l=o;l>=0;l--){const a=t.getRowHeight(l),h=s-a;if(Math.round(h)<=Math.round(i)&&Math.round(i)<Math.round(s))return{top:h,row:l,bottom:s,height:a};s=h}return null})(e,n)}function KA(i,t,e){if(i===0)return{left:0,col:0,right:0,width:0};if(t&&i>e.tableNoFrameWidth-e.getRightFrozenColsWidth()&&i<e.tableNoFrameWidth&&i<=e.getAllColsWidth()){for(let n=0;n<e.rightFrozenColCount;n++)if(i>e.tableNoFrameWidth-e.getColsWidth(e.colCount-n-1,e.colCount-1))return{col:e.colCount-n-1,left:void 0,right:void 0,width:void 0}}return rv(i,e)}function YA(i,t,e){if(i===0)return{top:0,row:0,bottom:0,height:0};if(i-=e.tableY,t&&i>e.tableNoFrameHeight-e.getBottomFrozenRowsHeight()&&i<e.tableNoFrameHeight){for(let n=0;n<e.rightFrozenColCount;n++)if(i>e.tableNoFrameHeight-e.getRowsHeight(e.rowCount-n-1,e.rowCount-1))return{row:e.rowCount-n-1,top:void 0,bottom:void 0,height:void 0}}return sv(i,e)}function L8(i,t){let e=t.internalProps.defaultRowHeight;return t._rowRangeHeightsMap.get("$0$"+(t.rowCount-1))&&(e=t._rowRangeHeightsMap.get("$0$"+(t.rowCount-1))/t.rowCount),Math.min(Math.ceil(i/e),t.rowCount-1)}function k8(i,t){if(t._colRangeWidthsMap.get("$0$"+(t.colCount-1))){let e=0,n=t.colCount-1;for(;n-e>1;){const o=Math.floor((e+n)/2);if(i<t._colRangeWidthsMap.get(`$0$${o}`))n=o;else{if(!(i>t._colRangeWidthsMap.get(`$0$${o}`)))return o;e=o}}return n}return Math.min(Math.ceil(i/t.internalProps.defaultColWidth),t.colCount-1)}function F8(i,t,e){i-=e.tableX;let n=!1;(t-=e.tableY)>0&&t<e.getFrozenRowsHeight()&&(n=!0);let o=!1;i>0&&i<e.getFrozenColsWidth()&&(o=!0);let r=!1;t>e.tableNoFrameHeight-e.getBottomFrozenRowsHeight()&&t<e.tableNoFrameHeight&&t<=e.getAllRowsHeight()&&(r=!0);let s=!1;i>e.tableNoFrameWidth-e.getRightFrozenColsWidth()&&i<e.tableNoFrameWidth&&i<=e.getAllColsWidth()&&(s=!0);const l=KA(o||s?i:i+e.scrollLeft,s,e),a=YA(n||r?t:t+e.scrollTop,r,e);if(l&&a){const{row:h,top:d,bottom:u,height:c}=a,{col:g,left:f,right:p,width:m}=l;return{row:h,col:g,rect:{left:f,right:p,top:d,bottom:u,width:m,height:c}}}return{col:-1,row:-1}}function XA(i){return i.length===2&&Ae(i[0])&&Ae(i[1])&&i[1]>=i[0]}function qA(i){const t=i[1]-i[0],e=i[1]*i[0]<0;let n=i[0]<=0?0-i[0]:0,o=i[1]>0?i[1]-0:0;return t===0?i[0]<0?(n=1,o=0):i[0]>0&&(n=0,o=1):(n/=t,o/=t),{total:t,negative:n,positive:o,includeZero:e,domain:i,extendable_min:!0,extendable_max:!0}}function ZA(i,t){const{positive:e,negative:n,extendable_min:o,extendable_max:r,domain:s}=i,{positive:l,negative:a,extendable_min:h,extendable_max:d,domain:u}=t;if(l>0){if(!h)return!1;let c=n/e;r&&(c=n/Math.max(e,l),s[1]=-s[0]/c),u[0]=-u[1]*c}else if(a>0){if(!d)return!1;let c=e/n;o&&(c=e/Math.max(n,n),s[0]=-s[1]/c),u[1]=-u[0]*c}return!0}function JA(i,t){const{extendable_min:e,extendable_max:n,domain:o}=i,{positive:r,negative:s,domain:l}=t;return(r!==0||s!==0)&&!(r>0&&!n)&&!(s>0&&!e)&&(o[0]=l[0],o[1]=l[1],!0)}function QA(i,t){const{positive:e,negative:n,extendable_max:o,domain:r}=i,{positive:s,negative:l,extendable_min:a,domain:h}=t;if(o&&a){const d=Math.max(n,l)/Math.max(e,s);r[1]=-r[0]/d,h[0]=-h[1]*d}else if(a){const d=n/e;h[0]=-h[1]*d}else{if(!o)return!1;{const d=l/s;r[1]=-r[0]/d}}return!0}function tT(i,t){const{extendable_min:e,domain:n}=i,{extendable_max:o,domain:r}=t;return!(!e||!o)&&(n[0]=-n[1],r[1]=-r[0],!0)}function Bl(i,t){const e=[i.min,i.max],n=[t.min,t.max];if(!XA(e)||!XA(n))return;const o=qA(e),r=qA(n),{positive:s,negative:l,extendable_min:a,extendable_max:h,includeZero:d}=o,{positive:u,negative:c,extendable_min:g,extendable_max:f,includeZero:p}=r;if(s===0&&l===0){if(!JA(o,r))return}else if(u===0&&c===0){if(!JA(r,o))return}else if(d||p)if(d&&!p){if(!ZA(o,r))return}else if(p&&!d){if(!ZA(r,o))return}else{if(l===c)return;if(l>c){if(!QA(o,r))return}else if(!QA(r,o))return}else{if(l===0&&u===0){if(!tT(o,r))return}else if(c===0&&s===0&&!tT(r,o))return;if(l===0&&c===0)if(e[0]===0&&n[0]>0){if(!g)return;n[0]=0}else{if(!(n[0]===0&&e[0]>0)||!a)return;e[0]=0}if(s===0&&u===0)if(e[1]===0&&n[1]>0){if(!f)return;n[1]=0}else{if(!(n[1]===0&&e[1]>0)||!h)return;e[1]=0}}return{range1:e,range2:n}}function I8(i,t,e){var n,o,r,s,l,a,h;if(e._table.isPivotChart())if(e.indicatorsAsCol){if(e.hasTwoIndicatorAxes&&t===e.columnHeaderLevelCount-1&&i>=e.rowHeaderLevelCount&&i<e.colCount-e.rightFrozenColCount){const d=Ir("top",i,t+1,i,e.columnHeaderLevelCount-1,i,t,1,e);if(!d)return;const u=e._table._getCellStyle(i,t+1),c=Qt(wt("padding",u,i,t+1,e._table)),{range:g,ticks:f,axisOption:p,isZeroAlign:m,theme:b}=d;if(m){const C=Ir("bottom",i,t+1,i,e.columnHeaderLevelCount-1,i,t,0,e);if(C){const{range:_}=C,w=Bl(g,_);w&&(g.min=w.range1[0],g.max=w.range1[1])}}return ft(p==null?void 0:p.min)&&(g.min=p.min,g.min>0&&(p.zero=!1)),ft(p==null?void 0:p.max)&&(g.max=p.max,g.max<0&&(p.zero=!1)),xt({range:g},p,{orient:"top",type:(p==null?void 0:p.type)||"linear",label:{flush:!0},__ticksForVTable:f,__vtableChartTheme:b,__vtablePadding:c})}if(t===e.rowCount-e.bottomFrozenRowCount&&i>=e.rowHeaderLevelCount&&i<e.colCount-e.rightFrozenColCount){const d=e.getIndicatorKeyInChartSpec(i,t).slice(0,2);let u=null;d==null||d.forEach(w=>{const y=e.getIndicatorInfo(w);y&&(u=y)});const c=Ir("bottom",i,t-1,i,t,i,t,0,e);if(!c)return;const g=e._table._getCellStyle(i,t-1),f=Qt(wt("padding",g,i,t-1,e._table)),{range:p,ticks:m,axisOption:b,isZeroAlign:C,theme:_}=c;if(C){const w=Ir("top",i,t-1,i,t,i,t,1,e);if(w){const{range:y}=w,S=Bl(p,y);S&&(p.min=S.range1[0],p.max=S.range1[1])}}return ft(b==null?void 0:b.min)&&(p.min=b.min,p.min>0&&(b.zero=!1)),ft(b==null?void 0:b.max)&&(p.max=b.max,p.max<0&&(b.zero=!1)),xt({title:{visible:!0,text:u==null?void 0:u.title},range:p},b,{orient:"bottom",type:(b==null?void 0:b.type)||"linear",label:{flush:!0},__ticksForVTable:m,__vtableChartTheme:_,__vtablePadding:f})}if(i===e.rowHeaderLevelCount-1&&t>=e.columnHeaderLevelCount&&t<e.rowCount-e.bottomFrozenRowCount){let d=e.getDimensionKeyInChartSpec(e.rowHeaderLevelCount,t);lt(d)&&(d=d[0]);const u=(n=e.dataset.collectedValues[d])!==null&&n!==void 0?n:[],c=e.getRowKeysPath(i,t),g=(o=u[c??""])!==null&&o!==void 0?o:[],{axisOption:f,theme:p,chartType:m}=Pl(i+1,t,"left",e);if((f==null?void 0:f.visible)===!1)return;const b=e._table._getCellStyle(i+1,t),C=Qt(wt("padding",b,i+1,t,e._table)),_=e.getRawChartSpec(i+1,t);return xt({domain:(f==null?void 0:f.type)==="linear"?void 0:Array.from(g),range:(f==null?void 0:f.type)==="linear"?g:void 0,title:{autoRotate:!0}},f,{orient:"left",type:(r=f==null?void 0:f.type)!==null&&r!==void 0?r:"band",__vtableChartTheme:p,inverse:z8(f,((s=_==null?void 0:_.direction)!==null&&s!==void 0?s:m==="scatter"?"vertical":"horizontal")==="horizontal"),__vtablePadding:C})}}else{if(i===e.rowHeaderLevelCount-1&&t>=e.columnHeaderLevelCount&&t<e.rowCount-e.bottomFrozenRowCount){const d=e.getIndicatorKeyInChartSpec(i,t).slice(0,2);let u=null;d==null||d.forEach(w=>{const y=e.getIndicatorInfo(w);y&&(u=y)});const c=Ir("left",i+1,t,i,t,i,t,0,e);if(!c)return;const g=e._table._getCellStyle(i+1,t),f=Qt(wt("padding",g,i+1,t,e._table)),{range:p,ticks:m,axisOption:b,isZeroAlign:C,theme:_}=c;if(C){const w=Ir("right",i+1,t,i,t,i,t,1,e);if(w){const{range:y}=w,S=Bl(p,y);S&&(p.min=S.range1[0],p.max=S.range1[1])}}return ft(b==null?void 0:b.min)&&(p.min=b.min,p.min>0&&(b.zero=!1)),ft(b==null?void 0:b.max)&&(p.max=b.max,p.max<0&&(b.zero=!1)),xt({title:{visible:!0,text:u==null?void 0:u.title,autoRotate:!0},range:p},b,{orient:"left",type:(b==null?void 0:b.type)||"linear",label:{flush:!0},__ticksForVTable:m,__vtableChartTheme:_,__vtablePadding:f})}if(i===e.colCount-e.rightFrozenColCount&&t>=e.columnHeaderLevelCount&&t<e.rowCount-e.bottomFrozenRowCount){const d=Ir("right",i-1,t,e.rowHeaderLevelCount-1,t,i,t,1,e);if(!d)return;const u=e._table._getCellStyle(i-1,t),c=Qt(wt("padding",u,i-1,t,e._table)),{range:g,ticks:f,axisOption:p,isZeroAlign:m,theme:b}=d;if(m){const C=Ir("left",i-1,t,e.rowHeaderLevelCount-1,t,i,t,0,e);if(C){const{range:_}=C,w=Bl(g,_);w&&(g.min=w.range1[0],g.max=w.range1[1])}}return ft(p==null?void 0:p.min)&&(g.min=p.min,g.min>0&&(p.zero=!1)),ft(p==null?void 0:p.max)&&(g.max=p.max,g.max<0&&(p.zero=!1)),xt({range:g,title:{autoRotate:!0}},p,{orient:"right",type:(p==null?void 0:p.type)||"linear",label:{flush:!0},__ticksForVTable:f,__vtableChartTheme:b,__vtablePadding:c})}if(t===e.rowCount-e.bottomFrozenRowCount&&i>=e.rowHeaderLevelCount&&i<e.colCount-e.rightFrozenColCount){let d=e.getDimensionKeyInChartSpec(i,e.columnHeaderLevelCount);lt(d)&&(d=d[0]);const u=(l=e.dataset.collectedValues[d])!==null&&l!==void 0?l:[],c=e.getColKeysPath(i,t),g=(a=u==null?void 0:u[c??""])!==null&&a!==void 0?a:[],{axisOption:f,isPercent:p,theme:m,chartType:b}=Pl(i,t-1,"bottom",e);if((f==null?void 0:f.visible)===!1)return;const C=e._table._getCellStyle(i,t-1),_=Qt(wt("padding",C,i,t-1,e._table));return xt({domain:(f==null?void 0:f.type)==="linear"?void 0:Array.from(g),range:(f==null?void 0:f.type)==="linear"?g:void 0},f,{orient:"bottom",type:(h=f==null?void 0:f.type)!==null&&h!==void 0?h:"band",__vtableChartTheme:m,__vtablePadding:_})}}}function Pl(i,t,e,n){var o,r;const s=n.getRawChartSpec(i,t),l=(o=s.axes)!==null&&o!==void 0?o:[];if(n._table.pivotChartAxes.forEach(a=>{l.findIndex(h=>a.orient===h.orient)===-1&&l.push(a)}),s&<(l)){const a=l.find(h=>h.orient===e);if(a){const{seriesIndex:h,seriesId:d}=a;let u,c;return z(d)&<(s.series)?u=(lt(d)?d:[d]).map(g=>{const f=s.series.findIndex(p=>p.id===g);return f>=0&&(c=s.series[f]),f}):z(h)&<(s.series)&&(u=h),{axisOption:a,isPercent:s.percent,isZeroAlign:eT(s,e,n),seriesIndice:u,theme:s.theme,chartType:(r=c==null?void 0:c.type)!==null&&r!==void 0?r:s.type}}}return{axisOption:n._table.pivotChartAxes.find(a=>a.orient===e),isPercent:!1,isZeroAlign:eT(s,e,n),theme:s.theme,chartType:s.type}}function eT(i,t,e){const n=[];let o;if(t==="left"||t==="right"?n.push("left","right"):t!=="top"&&t!=="bottom"||n.push("top","bottom"),o=i&<(i.axes)?i.axes:e._table.pivotChartAxes,lt(o)){const r=[];o.forEach(s=>{n.includes(s.orient)&&r.push(s)});for(let s=0;s<r.length;s++){const l=r[s];if(l.sync&&l.sync.zeroAlign&&l.sync.axisId&&r.find(a=>a.id===l.sync.axisId))return!0}}return!1}function lv(i,t,e,n,o){var r;if(lt(o)){const h={min:1/0,max:-1/0};for(let d=0;d<o.length;d++){const u=lv(i,t,e,n,o[d]);u&&(h.min=Math.min(h.min,u.min),h.max=Math.max(h.max,u.max))}return isFinite(h.min)&&isFinite(h.max)?h:null}let s=t==null?void 0:t[o];if(lt(s)&&(s=s[0]),!s)return null;const l=i[s],a=xt({},(r=l==null?void 0:l[n??""])!==null&&r!==void 0?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 Ir(i,t,e,n,o,r,s,l,a){const{axisOption:h,isPercent:d,isZeroAlign:u,seriesIndice:c,theme:g,chartType:f}=Pl(t,e,i,a);if((h==null?void 0:h.visible)===!1)return;const p=a.getIndicatorKeyInChartSpec(n,o).slice(0,2);let m;m=i==="top"||i==="bottom"?a.getColKeysPath(r,s):a.getRowKeysPath(r,s);const b=lv(a.dataset.collectedValues,p,u,m,c??l);if(!b)return;d&&(b.min=b.min<0?-1:0,b.max=b.max>0?1:0);const C=Bt.getFunction("getAxisDomainRangeAndLabels"),{range:_,ticks:w}=C(b.min,b.max,h,u,i==="bottom"||i==="top"?a._table.getColWidth(r)||a._table.tableNoFrameWidth:a._table.getRowHeight(s)||a._table.tableNoFrameHeight);return b.min=isNaN(_[0])?0:_[0],b.max=isNaN(_[1])?1:_[1],ft(h==null?void 0:h.min)&&(b.min=h.min,b.min>0&&(h.zero=!1)),ft(h==null?void 0:h.max)&&(b.max=h.max,b.max<0&&(h.zero=!1)),{axisOption:h,isZeroAlign:u,range:b,ticks:w,theme:g,chartType:f}}function D8(i,t,e){if(!e._table.isPivotChart())return!1;if(e.indicatorsAsCol){if(e.hasTwoIndicatorAxes&&t===e.columnHeaderLevelCount-1&&i>=e.rowHeaderLevelCount&&i<e.colCount-e.rightFrozenColCount||t===e.rowCount-e.bottomFrozenRowCount&&i>=e.rowHeaderLevelCount&&i<e.colCount-e.rightFrozenColCount)return!0}else if(t===e.rowCount-e.bottomFrozenRowCount&&i>=e.rowHeaderLevelCount&&i<e.colCount-e.rightFrozenColCount)return!0;return!1}function O8(i,t,e){if(!e._table.isPivotChart())return!1;if(e.indicatorsAsCol){if(i===e.rowHeaderLevelCount-1&&t>=e.columnHeaderLevelCount&&t<e.rowCount-e.bottomFrozenRowCount)return!0}else if(i===e.rowHeaderLevelCount-1&&t>=e.columnHeaderLevelCount&&t<e.rowCount-e.bottomFrozenRowCount||i===e.colCount-e.rightFrozenColCount&&t>=e.columnHeaderLevelCount&&t<e.rowCount-e.bottomFrozenRowCount)return!0;return!1}var iT;function z8(i,t){let e=i==null?void 0:i.inverse;return t&&!W8(i==null?void 0:i.orient)&&(e=!z(i==null?void 0:i.inverse)||!(i!=null&&i.inverse)),e}function W8(i){return i==="bottom"||i==="top"}(function(i){i.vertical="vertical",i.horizontal="horizontal"})(iT||(iT={}));function As(i,t,e,n){if(!lt(i.axes)||i.axes.length===0)return e&&n||!e&&!n;for(let o=0;o<i.axes.length;o++){const r=i.axes[o];if(!e&&n&&r.orient==="bottom"&&r.type==="linear"||e&&n&&r.orient==="bottom"&&r.type!=="linear"||!e&&!n&&r.orient==="left"&&r.type!=="linear"||e&&!n&&r.orient==="left"&&r.type==="linear")return!0}if(lt(t)&&t.length>0)for(let o=0;o<t.length;o++){const r=t[o];if(!e&&n&&r.orient==="bottom"&&r.type==="linear"||e&&n&&r.orient==="bottom"&&r.type!=="linear"||!e&&!n&&r.orient==="left"&&r.type!=="linear"||e&&!n&&r.orient==="left"&&r.type==="linear")return!0}return e&&n||!e&&!n}const N8={};function V8(i,t,e){var n,o,r,s,l,a,h,d,u;const c=e.customCellStylePlugin.getCustomCellStyle(i,t),{layoutMap:g}=e.internalProps;if(g.isHeader(i,t)){let S;if(!e.isPivotTable()||e.isBottomFrozenRow(t)||e.isRightFrozenColumn(i))S=`${i}-${t}`;else{const M=e.getHeaderDefine(i,t),B=e.isCornerHeader(i,t);S=M!=null&&M.dimensionKey?B?`dim-cor-${M.dimensionKey}`:`dim-${M.dimensionKey}`:M!=null&&M.indicatorKey?`ind-${M.indicatorKey}`:`${i}-${t}`}let A=e.headerStyleCache.get(S);if(A)return c?Hh(A,c):A;const R=g.getHeader(i,t);let x;if(e.isPivotChart()&&D8(i,t,g)&&g.isAxisCell(i,t)?x=(o=(n=g.getBody(i,e.rowHeaderLevelCount).style)===null||n===void 0?void 0:n.padding)!==null&&o!==void 0?o:e.theme.bodyStyle.padding:e.isPivotChart()&&O8(i,t,g)&&g.isAxisCell(i,t)&&(x=(s=(r=g.getBody(e.columnHeaderLevelCount,t).style)===null||r===void 0?void 0:r.padding)!==null&&s!==void 0?s:e.theme.bodyStyle.padding),(!R||R.isEmpty)&&(g.isLeftBottomCorner(i,t)||g.isRightBottomCorner(i,t)||g.isCornerHeader(i,t)||g.isRightTopCorner(i,t)))return N8;const T=e.internalProps.headerHelper.getStyleClass((R==null?void 0:R.headerType)||"text");if(g.isBottomFrozenRow(i,t)&&e.theme.bottomFrozenStyle)A=mg(x?{padding:x}:{},e.theme.bottomFrozenStyle,{col:i,row:t,table:e,value:e.getCellValue(i,t),dataValue:e.getCellOriginValue(i,t),cellHeaderPaths:e.getCellHeaderPaths(i,t)},T,e.options.autoWrapText,e.theme);else if(g.isRightFrozenColumn(i,t)&&e.theme.rightFrozenStyle)A=mg(x?{padding:x}:{},e.theme.rightFrozenStyle,{col:i,row:t,table:e,value:e.getCellValue(i,t),dataValue:e.getCellOriginValue(i,t),cellHeaderPaths:e.getCellHeaderPaths(i,t)},T,e.options.autoWrapText,e.theme);else{const M=(R==null?void 0:R.style)||{};x&&(M.padding=x),A=mg(M,g.isColumnHeader(i,t)||g.isBottomFrozenRow(i,t)?e.theme.headerStyle:g.isRowHeader(i,t)||g.isRightFrozenColumn(i,t)?e.theme.rowHeaderStyle:e.theme.cornerHeaderStyle,{col:i,row:t,table:e,value:e.getCellValue(i,t),dataValue:e.getCellOriginValue(i,t),cellHeaderPaths:e.getCellHeaderPaths(i,t)},T,e.options.autoWrapText,e.theme)}return e.headerStyleCache.set(S,A),c?Hh(A,c):A}let f,p;!((a=(l=e.internalProps)===null||l===void 0?void 0:l.dataConfig)===null||a===void 0)&&a.mappingRules&&!e.isHeader(i,t)&&((u=(d=(h=e.internalProps)===null||h===void 0?void 0:h.dataConfig)===null||d===void 0?void 0:d.mappingRules)===null||u===void 0||u.forEach((S,A)=>{S.bgColor&&e.internalProps.layoutMap.getIndicatorKey(i,t)===S.bgColor.indicatorKey&&(f=S.bgColor.mapping)}));const m=e.getCellType(i,t),b=e.getCellOriginRecord(i,t);let C;if(p=b!=null&&b.vtableMerge?"merge-title":e.isSeriesNumberInBody(i,t)?`${i}-series-`+m:e.isListTable()&&!e.transpose||e.isPivotTable()&&e.internalProps.layoutMap.indicatorsAsCol?i+m:t+m,C=b!=null&&b.vtableMerge?e.bodyMergeTitleCache.get(p):g.isBottomFrozenRow(t)?e.bodyBottomStyleCache.get(p):e.bodyStyleCache.get(p),C)return c?Hh(C,c):C;const _=g.getBody(i,t),w=e.internalProps.bodyHelper.getStyleClass(e.getCellType(i,t)),y=_==null?void 0:_.style;return C=em(y,b!=null&&b.vtableMerge&&e.theme.groupTitleStyle?e.theme.groupTitleStyle:g.isBottomFrozenRow(t)&&e.theme.bottomFrozenStyle?e.theme.bottomFrozenStyle:g.isRightFrozenColumn(i)&&e.theme.rightFrozenStyle?e.theme.rightFrozenStyle:e.theme.bodyStyle,{col:i,row:t,table:e,value:e.getCellValue(i,t),dataValue:e.getCellOriginValue(i,t),cellHeaderPaths:e.getCellHeaderPaths(i,t)},w,e.options.autoWrapText,e.theme),f&&(C=Hh(C,{bgColor:f})),ue(y)||(g.isBottomFrozenRow(t)?e.bodyBottomStyleCache.set(p,C):e.bodyStyleCache.set(p,C)),c?Hh(C,c):C}class j8 extends Dy{onUpdate(t,e,n){if(this.from.x!==this.to.x){const o=t?this.to.x:this.from.x+Math.floor((this.to.x-this.from.x)*e);this.params.table.scrollLeft=o}if(this.from.y!==this.to.y){const o=t?this.to.y:this.from.y+Math.floor((this.to.y-this.from.y)*e);this.params.table.scrollTop=o}}}class $8{constructor(t){this.table=t,this.timeline=new bp,this.ticker=new Fy,this.ticker.addTimeline(this.timeline),this.ticker.setFPS(60),this.tempGraphic=Fe({})}scrollTo(t,e){var n,o,r,s;const l={x:this.table.scrollLeft,y:this.table.scrollTop},a=this.table.getCellRect((n=t.col)!==null&&n!==void 0?n:0,(o=t.row)!==null&&o!==void 0?o:0),h={x:ft(t.col)?a.left-this.table.getFrozenColsWidth():this.table.scrollLeft,y:ft(t.row)?a.top-this.table.getFrozenRowsHeight():this.table.scrollTop},d=bi(e)?e?3e3:0:(r=e==null?void 0:e.duration)!==null&&r!==void 0?r:3e3,u=bi(e)?e?"linear":"":(s=e==null?void 0:e.easing)!==null&&s!==void 0?s:"linear";new Wo(oi.GenAutoIncrementId(),this.timeline).bind(this.tempGraphic).play(new j8(l,h,d,u,{graphic:this.tempGraphic,table:this.table})),this.ticker.start()}clear(){this.timeline.clear(),this.ticker.stop()}}const{toBoxArray:nT}=b4,{isTouchEvent:G8}=v4,U8=/^\$(\d+)\$(\d+)$/;Yz();class Cg extends th{static get EVENT_TYPE(){return at}constructor(t,e={}){var n,o,r,s,l,a,h,d,u,c;if(super(),this.showFrozenIcon=!0,this.version="1.11.1",this.id=`VTable${Date.now()}`,this.isReleased=!1,this._chartEventMap={},this.throttleInvalidate=n4(this.render.bind(this),200),!t&&e.mode!=="node"&&!e.canvas)throw new Error("vtable's container is undefined");const{frozenColCount:g=0,frozenRowCount:f,defaultRowHeight:p=40,defaultHeaderRowHeight:m,defaultColWidth:b=80,defaultHeaderColWidth:C,widthMode:_="standard",heightMode:w="standard",autoFillWidth:y=!1,autoFillHeight:S=!1,widthAdaptiveMode:A="only-body",heightAdaptiveMode:R="only-body",keyboardOptions:x,eventOptions:T,rowSeriesNumber:M,columnResizeMode:B,rowResizeMode:P="none",dragHeaderMode:F,showFrozenIcon:H,allowFrozenColCount:E,padding:k,hover:I,menu:L,select:D,customRender:O,pixelRatio:N=Ss,renderChartAsync:W,renderChartAsyncBatchCount:$,mode:U,modeParams:Y,canvasWidth:j,canvasHeight:G,overscrollBehavior:X,limitMinWidth:ht,limitMinHeight:gt,clearDOM:Ct=!0}=e;this.container=t,this.options=e,this._widthMode=_,this._heightMode=w,this._widthAdaptiveMode=A,this._heightAdaptiveMode=R,this._autoFillWidth=y,this._autoFillHeight=S,this.customRender=O,this.padding={top:0,right:0,left:0,bottom:0},k&&(typeof k=="number"?(this.padding.top=k,this.padding.left=k,this.padding.bottom=k,this.padding.right=k):(k.top&&(this.padding.top=k.top),k.bottom&&(this.padding.bottom=k.bottom),k.left&&(this.padding.left=k.left),k.right&&(this.padding.right=k.right))),z(G)&&z(j)&&(this.canvasSizeSeted=!0),this.tableNoFrameWidth=0,this.tableNoFrameHeight=0,this.canvasWidth=j,this.canvasHeight=G,this.columnWidthComputeMode=(n=e.columnWidthComputeMode)!==null&&n!==void 0?n:"normal";const Q=this.internalProps={};if(H!==void 0&&(this.showFrozenIcon=H),typeof E=="number"&&E<=0&&(this.showFrozenIcon=!1),this.options.canvas?(Q.element=this.options.canvas.parentElement,Q.element.style.position="relative",Q.focusControl=new NA(this,Q.element),Q.canvas=this.options.canvas,Q.context=Q.canvas.getContext("2d")):oe.mode!=="node"&&(Q.element=M6(this.padding),Q.focusControl=new NA(this,Q.element),Q.canvas=document.createElement("canvas"),Q.element.appendChild(Q.canvas),Q.context=Q.canvas.getContext("2d"),!((o=e.customConfig)===null||o===void 0)&&o.createReactContainer&&y5(this)),Q.handler=new mc,ft(this.options.resizeTime)&&(Q.handler.resizeTime=this.options.resizeTime),Q.pixelRatio=N,Q.frozenColCount=g,Q.frozenRowCount=f,Q.defaultRowHeight=p,Q.defaultHeaderRowHeight=m??p,Q.defaultColWidth=b,Q.defaultHeaderColWidth=C??b,Q.keyboardOptions=x,Q.eventOptions=T,Q.rowSeriesNumber=M,Q.columnResizeMode=B,Q.rowResizeMode=P,Q.dragHeaderMode=F??"none",Q.renderChartAsync=W,HR($),Q.overscrollBehavior=X??"auto",Q._rowHeightsMap=new VA(this),Q._rowRangeHeightsMap=new Map,Q._colRangeWidthsMap=new Map,Q._widthResizedColMap=new Set,Q._heightResizedRowMap=new Set,this.colWidthsMap=new Mr,this.colContentWidthsMap=new Mr,this.colWidthsLimit={},Q.calcWidthContext={_:Q,get full(){var et;return oe.mode==="node"?j/(N??1):this._.canvas.width/((et=this._.context.pixelRatio)!==null&&et!==void 0?et:window.devicePixelRatio)}},Q.cellTextOverflows={},Q.focusedTable=!1,Q.theme=Jo.of((r=e.theme)!==null&&r!==void 0?r:Jo.DEFAULT),Q.theme.isPivot=this.isPivotTable(),Hc(Q.theme.functionalIconsStyle),t?(Ct&&(t.innerHTML=""),t.appendChild(Q.element),this._updateSize()):this._updateSize(),Q.bodyHelper=new u8(this),Q.headerHelper=new w8(this),Q.rowSeriesNumberHelper=new S8(this),Q.autoWrapText=e.autoWrapText,Q.enableLineBreak=e.enableLineBreak,Q.allowFrozenColCount=(s=e.allowFrozenColCount)!==null&&s!==void 0?s:0,Q.limitMaxAutoWidth=(l=e.limitMaxAutoWidth)!==null&&l!==void 0?l:450,Q.limitMinWidth=ht!=null?typeof ht=="number"?ht:ht?10:0:10,Q.limitMinHeight=gt!=null?typeof gt=="number"?gt:gt?10:0:10,this.scenegraph=new Q5(this),this.stateManager=new VN(this),this.eventManager=new a8(this),this.animationManager=new $8(this),e.legends){Q.legends=[];const et=Bt.getFunction("createLegend");if(Array.isArray(e.legends)){for(let vt=0;vt<e.legends.length;vt++)Q.legends.push(et(e.legends[vt],this));this.scenegraph.tableGroup.setAttributes({x:this.tableX,y:this.tableY})}else Q.legends.push(et(e.legends,this)),this.scenegraph.tableGroup.setAttributes({x:this.tableX,y:this.tableY})}if(Q.tooltip=Object.assign({parentElement:this.getElement(),renderMode:"html",isShowOverflowTextTooltip:!1,confine:!0},e.tooltip),Q.tooltip.renderMode==="html"){const et=Bt.getComponent("tooltipHandler");et&&(Q.tooltipHandler=new et(this,Q.tooltip.confine))}if(Q.menu=Object.assign({renderMode:"html"},e.menu),Array.isArray((a=e.menu)===null||a===void 0?void 0:a.dropDownMenuHighlight)&&this.setDropDownMenuHighlight((h=e.menu)===null||h===void 0?void 0:h.dropDownMenuHighlight),Array.isArray((d=e.menu)===null||d===void 0?void 0:d.defaultHeaderMenuItems)&&(this.globalDropDownMenu=e.menu.defaultHeaderMenuItems),Q.menu.renderMode==="html"){const et=Bt.getComponent("menuHandler");Q.menuHandler=new et(this)}this.headerStyleCache=new Map,this.bodyStyleCache=new Map,this.bodyMergeTitleCache=new Map,this.bodyBottomStyleCache=new Map,Q.stick={changedCells:new Map},Q.customMergeCell=e.customMergeCell,this.customCellStylePlugin=new x8(this,(u=e.customCellStyle)!==null&&u!==void 0?u:[],(c=e.customCellStyleArrangement)!==null&&c!==void 0?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(),(t=this.internalProps.legends)===null||t===void 0||t.forEach(e=>{e==null||e.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(t=this.internalProps.colCount)!==null&&t!==void 0?t:0}set colCount(t){this.internalProps.colCount=t}get frozenColCount(){var t,e,n,o,r;return(r=(n=(e=(t=this.internalProps)===null||t===void 0?void 0:t.layoutMap)===null||e===void 0?void 0:e.frozenColCount)!==null&&n!==void 0?n:(o=this.internalProps)===null||o===void 0?void 0:o.frozenColCount)!==null&&r!==void 0?r: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,n,o,r;return(r=(n=(e=(t=this.internalProps)===null||t===void 0?void 0:t.layoutMap)===null||e===void 0?void 0:e.frozenRowCount)!==null&&n!==void 0?n:(o=this.internalProps)===null||o===void 0?void 0:o.frozenRowCount)!==null&&r!==void 0?r:0}set frozenRowCount(t){this.internalProps.frozenRowCount=t}get rightFrozenColCount(){var t,e,n,o,r;return(r=(n=(e=(t=this.internalProps)===null||t===void 0?void 0:t.layoutMap)===null||e===void 0?void 0:e.rightFrozenColCount)!==null&&n!==void 0?n:(o=this.internalProps)===null||o===void 0?void 0:o.rightFrozenColCount)!==null&&r!==void 0?r:0}set rightFrozenColCount(t){this.scenegraph.dealWidthRightFrozen(t)}get bottomFrozenRowCount(){var t,e,n,o,r;return(r=(n=(e=(t=this.internalProps)===null||t===void 0?void 0:t.layoutMap)===null||e===void 0?void 0:e.bottomFrozenRowCount)!==null&&n!==void 0?n:(o=this.internalProps)===null||o===void 0?void 0:o.bottomFrozenRowCount)!==null&&r!==void 0?r: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(t=this.internalProps.keyboardOptions)!==null&&t!==void 0?t:null}set keyboardOptions(t){this.internalProps.keyboardOptions=t??void 0}get eventOptions(){var t;return(t=this.internalProps.eventOptions)!==null&&t!==void 0?t:null}set eventOptions(t){this.internalProps.eventOptions=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 t==="auto"?0:ah(this,t)}_getColWidthLimits(t){const e=this.colWidthsLimit[t];if(!e)return null;const n={};return e.min&&(n.min=ah(this,e.min),n.minDef=e.min),e.max&&(n.max=ah(this,e.max),n.maxDef=e.max),n}_adjustColWidth(t,e){const n=this._getColWidthLimits(t);return Math.max(L6(n,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 n;return oe.mode==="node"?e/(t??1):this._.canvas.width/((n=this._.context.pixelRatio)!==null&&n!==void 0?n:window.devicePixelRatio)}},this.scenegraph.setPixelRatio(t)}}_updateSize(){var t,e,n,o,r,s,l,a,h,d,u,c,g,f,p,m,b,C,_,w,y,S,A,R,x,T;const{padding:M}=this;let B=0,P=0;if(this.tableX=0,this.tableY=0,this.options.canvas&&this.options.viewBox)B=this.options.viewBox.x2-this.options.viewBox.x1,P=this.options.viewBox.y2-this.options.viewBox.y1,!((t=this==null?void 0:this.scenegraph)===null||t===void 0)&&t.stage&&(this.options.viewBox?this.scenegraph.stage.setViewBox(this.options.viewBox,!1):this.scenegraph.stage.resize(B,P));else if(oe.mode==="browser"){const E=this.getElement();let k=0,I=0;if(this.canvasSizeSeted)k=this.canvasWidth,I=this.canvasHeight;else if(E.parentElement){const N=E.parentElement.style||window.getComputedStyle(E.parentElement);k=E.parentElement.offsetWidth-parseInt(N.paddingLeft||"0px",10)-parseInt(N.paddingRight||"0px",10),I=E.parentElement.offsetHeight-parseInt(N.paddingTop||"0px",10)-parseInt(N.paddingBottom||"0px",20)}const L=k??0,D=I??0;E.style.width=L&&L-M.left-M.right+"px"||"0px",E.style.height=D&&D-M.top-M.bottom+"px"||"0px";const{canvas:O}=this.internalProps;B=(n=(e=O.parentElement)===null||e===void 0?void 0:e.offsetWidth)!==null&&n!==void 0?n:0,P=(r=(o=O.parentElement)===null||o===void 0?void 0:o.offsetHeight)!==null&&r!==void 0?r:0,!((s=this==null?void 0:this.scenegraph)===null||s===void 0)&&s.stage?this.scenegraph.stage.resize(B,P):(O.style.width="",O.style.height="",O.width=B,O.height=P,O.style.width=`${B}px`,O.style.height=`${P}px`)}else oe.mode==="node"&&(B=this.canvasWidth-1,P=this.canvasHeight-1);const F=Math.floor(B-qz(this.getTheme().scrollStyle)),H=Math.floor(P-Xz(this.getTheme().scrollStyle));if(!((l=this.internalProps.theme)===null||l===void 0)&&l.frameStyle){const E=nT((h=(a=this.internalProps.theme.frameStyle)===null||a===void 0?void 0:a.borderLineWidth)!==null&&h!==void 0?h:[null]),k=nT((u=(d=this.internalProps.theme.frameStyle)===null||d===void 0?void 0:d.shadowBlur)!==null&&u!==void 0?u:[0]);!((c=this.theme.frameStyle)===null||c===void 0)&&c.innerBorder?(this.tableX=0,this.tableY=0,this.tableNoFrameWidth=F-((g=k[1])!==null&&g!==void 0?g:0),this.tableNoFrameHeight=H-((f=k[2])!==null&&f!==void 0?f:0)):(this.tableX=((p=E[3])!==null&&p!==void 0?p:0)+((m=k[3])!==null&&m!==void 0?m:0),this.tableY=((b=E[0])!==null&&b!==void 0?b:0)+((C=k[0])!==null&&C!==void 0?C:0),this.tableNoFrameWidth=F-(((_=E[1])!==null&&_!==void 0?_:0)+((w=k[1])!==null&&w!==void 0?w:0))-(((y=E[3])!==null&&y!==void 0?y:0)+((S=k[3])!==null&&S!==void 0?S:0)),this.tableNoFrameHeight=H-(((A=E[0])!==null&&A!==void 0?A:0)+((R=k[0])!==null&&R!==void 0?R:0))-(((x=E[2])!==null&&x!==void 0?x:0)+((T=k[2])!==null&&T!==void 0?T:0)))}}updateViewBox(t){var e,n,o,r,s,l,a,h;const d=(r=(n=(e=this.options)===null||e===void 0?void 0:e.viewBox.x2)!==null&&n!==void 0?n:0-((o=this.options)===null||o===void 0?void 0:o.viewBox.x1))!==null&&r!==void 0?r:0,u=(h=(l=(s=this.options)===null||s===void 0?void 0:s.viewBox.y2)!==null&&l!==void 0?l:0-((a=this.options)===null||a===void 0?void 0:a.viewBox.y1))!==null&&h!==void 0?h:0,c=t.x2-t.x1,g=t.y2-t.y1;this.options.viewBox=t,d!==c||u!==g?this.resize():this.scenegraph.stage.setViewBox(this.options.viewBox,!0)}setViewBoxTransform(t,e,n,o,r,s){this.internalProps.modifiedViewBoxTransform=!0,this.scenegraph.stage.window.setViewBoxTransform(t,e,n,o,r,s)}get rowHierarchyType(){return"grid"}getColsWidth(t,e){var n;if(t>e)return 0;t=Math.max(t,0),e=Math.min(e,((n=this.colCount)!==null&&n!==void 0?n:1/0)-1);const o=this._colRangeWidthsMap.get(`$${t}$${e}`);if(o!=null)return o;const r=this._colRangeWidthsMap.get(`$${t}$${e-1}`);if(r!=null){const l=r+this.getColWidth(e);return t>=0&&e>=0&&!Number.isNaN(l)&&this._colRangeWidthsMap.set(`$${t}$${e}`,Math.round(l)),Math.round(l)}let s=0;for(let l=t;l<=e;l++)s+=this.getColWidth(l);return t>=0&&e>=0&&this._colRangeWidthsMap.set(`$${t}$${e}`,Math.round(s)),Math.round(s)}getRowHeight(t){var e;if(z(this.rowHeightsMap.get(t))){if(!((e=this.options.customConfig)===null||e===void 0)&&e._disableColumnAndRowSizeRound){const o=this.rowHeightsMap.get(t);let r;return r=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),r=Number(r.toFixed(2)),Number.isInteger(r)?Math.ceil(o):Math.floor(o)}return this.rowHeightsMap.get(t)}const n=this.getDefaultRowHeight(t);return ft(n)?n:this.defaultRowHeight}getDefaultColumnWidth(t){var e,n;return this.isRowHeader(t,0)||this.isCornerHeader(t,0)?Array.isArray(this.defaultHeaderColWidth)?(e=this.defaultHeaderColWidth[t])!==null&&e!==void 0?e:this.defaultColWidth:this.defaultHeaderColWidth:this.isRightFrozenColumn(t,this.columnHeaderLevelCount)&&this.isPivotTable()?Array.isArray(this.defaultHeaderColWidth)?(n=this.defaultHeaderColWidth[this.rowHeaderLevelCount-this.rightFrozenColCount])!==null&&n!==void 0?n:this.defaultColWidth:this.defaultHeaderColWidth:this.defaultColWidth}getDefaultRowHeight(t){var e,n;return this.isColumnHeader(0,t)||this.isCornerHeader(0,t)||this.isSeriesNumberInHeader(0,t)?Array.isArray(this.defaultHeaderRowHeight)?(e=this.defaultHeaderRowHeight[t])!==null&&e!==void 0?e:this.internalProps.defaultRowHeight:this.defaultHeaderRowHeight:this.isBottomFrozenRow(t)?Array.isArray(this.defaultHeaderRowHeight)?(n=this.defaultHeaderRowHeight[this.columnHeaderLevelCount>0?this.columnHeaderLevelCount-this.bottomFrozenRowCount:0])!==null&&n!==void 0?n:this.internalProps.defaultRowHeight:this.defaultHeaderRowHeight:this.internalProps.defaultRowHeight}_setRowHeight(t,e,n){var o;this.rowHeightsMap.put(t,!((o=this.options.customConfig)===null||o===void 0)&&o._disableColumnAndRowSizeRound?e:Math.round(e)),n&&this._clearRowRangeHeightsMap(t)}setRowHeight(t,e){this.scenegraph.setRowHeight(t,e),this.scenegraph.updateChartSizeForResizeRowHeight(t),this.internalProps._heightResizedRowMap.add(t)}getRowsHeight(t,e){var n,o;if(t>e||this.rowCount===0)return 0;t=Math.max(t,0),e=Math.min(e,((n=this.rowCount)!==null&&n!==void 0?n:1/0)-1);let r=0;if(this.heightMode!=="standard"||this.autoFillHeight||!this.internalProps.layoutMap||this.hasAutoImageColumn()||this.internalProps._heightResizedRowMap.size!==0){if(!((o=this.options.customConfig)===null||o===void 0)&&o._disableColumnAndRowSizeRound){const s=this.rowHeightsMap.getSumInRange(t,e);let l;return l=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),l=Number(l.toFixed(2)),Number.isInteger(l)?Math.ceil(s):Math.floor(s)}r=this.rowHeightsMap.getSumInRange(t,e)}else{for(let s=t;s<Math.min(e+1,this.columnHeaderLevelCount);s++)r+=this.getRowHeight(s);e>=this.columnHeaderLevelCount&&(r+=this.defaultRowHeight*(Math.min(e,this.rowCount-this.bottomFrozenRowCount-1)-Math.max(this.columnHeaderLevelCount,t)+1));for(let s=this.rowCount-this.bottomFrozenRowCount;s<e+1;s++)r+=this.getRowHeight(s)}return Math.round(r)}getColWidthDefined(t){var e;const{layoutMap:n}=this.internalProps;if(this.widthMode==="autoWidth")return"auto";const{width:o}=(e=n==null?void 0:n.getColumnWidthDefined(t))!==null&&e!==void 0?e:{};return typeof o=="number"&&o<=0?0:o||this.getDefaultColumnWidth(t)}getColWidthDefinedNumber(t){const e=this.getColWidthDefined(t);return this._adjustColWidth(t,this._colWidthDefineToPxWidth(e))}isAutoRowHeight(t){return this.heightMode==="autoHeight"||t>=0&&t<this.columnHeaderLevelCount&&this.getDefaultRowHeight(t)==="auto"}getColWidth(t){var e;const n=(e=this.colWidthsMap.get(t))!==null&&e!==void 0?e:this.getDefaultColumnWidth(t);return this.widthMode==="adaptive"&&typeof n=="number"||this.transpose&&typeof n=="number"?this._colWidthDefineToPxWidth(n):this._adjustColWidth(t,this._colWidthDefineToPxWidth(n))}_setColWidth(t,e,n,o){this.colWidthsMap.put(t,typeof e=="number"?Math.round(e):e),n&&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(typeof t!="number")this._colRangeWidthsMap.clear();else{const e=this._colRangeWidthsMap.keys();for(const n of e){const o=U8.exec(n);if(o){const r=Number(o[1]),s=Number(o[2]);t>=r&&t<=s&&this._colRangeWidthsMap.delete(n)}}}}_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 n=this.colWidthsLimit[t];let o=(e=n&&n.max)!==null&&e!==void 0?e:1/0;return typeof o=="string"&&(o=ah(this,o)),o}setMaxColWidth(t,e){(this.colWidthsLimit[t]||(this.colWidthsLimit[t]={})).max=e}getMinColWidth(t){var e;const n=this.colWidthsLimit[t];let o=(e=n&&n.min)!==null&&e!==void 0?e:0;return typeof o=="string"&&(o=ah(this,o)),o}setMinColWidth(t,e){(this.colWidthsLimit[t]||(this.colWidthsLimit[t]={})).min=e}getCellRect(t,e){var n,o;const r=this.isFrozenCell(t,e);let s;const l=this.getColWidth(t);let a;s=r&&r.col&&this.isRightFrozenColumn(t,e)?this.getAllColsWidth()<=this.tableNoFrameWidth?this.getColsWidth(0,t-1)||0:this.tableNoFrameWidth-((n=this.getColsWidth(t,this.colCount-1))!==null&&n!==void 0?n:0):this.getColsWidth(0,t-1)||0;const h=this.getRowHeight(e);return a=r&&r.row&&this.isBottomFrozenRow(t,e)?this.getAllRowsHeight()<=this.tableNoFrameHeight?this.getRowsHeight(0,e-1):this.tableNoFrameHeight-((o=this.getRowsHeight(e,this.rowCount-1))!==null&&o!==void 0?o:0):this.getRowsHeight(0,e-1),new gs(Math.round(s),Math.round(a),Math.round(l),Math.round(h))}getMergeCellRect(t,e){const n=this.getCellRange(t,e),o=this.getColsWidth(0,n.start.col-1)||0,r=this.getColsWidth(n.start.col,n.end.col),s=this.getRowsHeight(0,n.start.row-1)||0,l=this.getRowsHeight(n.start.row,n.end.row);return new gs(Math.round(o),Math.round(s),Math.round(r),Math.round(l))}getCellRelativeRect(t,e){const n=this.isFrozenCell(t,e);let o=!0,r=!0;n!=null&&n.col&&(n!=null&&n.row)?(o=!1,r=!1):n!=null&&n.col?o=!1:n!=null&&n.row&&(r=!1);const s=this.getCellRect(t,e);return this._toRelativeRect(s,o,r)}getCellRangeRelativeRect(t){if(t.start){const s=this.isFrozenCell(t.start.col,t.start.row);let l=!0,a=!0;return s!=null&&s.col&&(s!=null&&s.row)?(l=!1,a=!1):s!=null&&s.col?l=!1:s!=null&&s.row&&(a=!1),this._toRelativeRect(this.getCellsRect(t.start.col,t.start.row,t.end.col,t.end.row),l,a)}const e=this.getCellRange(t.col,t.row),n=this.isFrozenCell(t.col,t.row);let o=!0,r=!0;return n!=null&&n.col&&(n!=null&&n.row)?(o=!1,r=!1):n!=null&&n.col?o=!1:n!=null&&n.row&&(r=!1),this._toRelativeRect(this.getCellsRect(e.start.col,e.start.row,e.end.col,e.end.row),o,r)}getVisibleCellRangeRelativeRect(t){let e;return e=t.start?t:this.getCellRange(t.col,t.row),this._getVisiableRect(this.getCellRangeRelativeRect(t),e)}_getVisiableRect(t,e){const n=e.start.col>=this.frozenColCount?Math.max(t.left,this.frozenColCount>=1?this.getColsWidth(0,this.frozenColCount-1):0):t.left,o=Math.min(t.right,this.tableNoFrameWidth),r=t.copy();r.left=n,r.right=o;const s=e.start.row>=this.frozenRowCount?Math.max(t.top,this.frozenRowCount>=1?this.getRowsHeight(0,this.frozenRowCount-1):0):t.top,l=Math.min(t.bottom,this.tableNoFrameHeight);return r.top=s,r.bottom=l,r}getCellsRect(t,e,n,o){var r,s,l,a,h,d;let u=this.getColsWidth(0,t-1)||0,c=this.getColsWidth(t,n);const g=this.scrollLeft;this.isLeftFrozenColumn(t)&&this.isRightFrozenColumn(n)?c=this.tableNoFrameWidth-((r=this.getColsWidth(t+1,this.colCount-1))!==null&&r!==void 0?r:0)-u:this.isLeftFrozenColumn(t)&&!this.isLeftFrozenColumn(n)?c=Math.max(c-g,this.getColsWidth(t,this.frozenColCount-1)):!this.isRightFrozenColumn(t)&&this.isRightFrozenColumn(n)?(u=Math.min(u-g,this.tableNoFrameWidth-this.getRightFrozenColsWidth()),c=this.tableNoFrameWidth-((s=this.getColsWidth(t+1,this.colCount-1))!==null&&s!==void 0?s:0)-u):this.isRightFrozenColumn(t)&&(u=this.tableNoFrameWidth-((l=this.getColsWidth(t,this.colCount-1))!==null&&l!==void 0?l:0));let f=this.getRowsHeight(0,e-1),p=this.getRowsHeight(e,o);const m=this.scrollTop;return this.isTopFrozenRow(e)&&this.isBottomFrozenRow(o)?p=this.tableNoFrameHeight-((a=this.getRowsHeight(e+1,this.rowCount-1))!==null&&a!==void 0?a:0)-f:this.isTopFrozenRow(e)&&!this.isTopFrozenRow(o)?p=Math.max(p-m,this.getRowsHeight(e,this.frozenRowCount-1)):!this.isBottomFrozenRow(e)&&this.isBottomFrozenRow(o)?(f=Math.min(f-m,this.tableNoFrameHeight-this.getBottomFrozenRowsHeight()),p=this.tableNoFrameHeight-((h=this.getRowsHeight(e+1,this.rowCount-1))!==null&&h!==void 0?h:0)-f):this.isBottomFrozenRow(e)&&(f=this.tableNoFrameHeight-((d=this.getRowsHeight(e,this.rowCount-1))!==null&&d!==void 0?d:0)),new gs(Math.round(u),Math.round(f),Math.round(c),Math.round(p))}getCellsRectWidth(t,e,n,o){const r=this.isFrozenCell(t,e),s=this.isFrozenCell(n,o);let l=this.getColsWidth(t,n);if(r&&r.col){const a=this.scrollLeft;s&&s.col||(l-=a,l=Math.max(l,this.getColsWidth(t,this.frozenColCount-1)))}return l}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 n=this.isFrozenRow(e),o=this.isFrozenColumn(t);return n||o?{row:n,col:o}:null}getRowAt(t){return GA(t,this)}getColAt(t){return UA(t,this)}getCellAt(t,e){return E8(t,e,this)}getCellAtRelativePosition(t,e){return F8(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 n=this.isFrozenCell(t,e);if(n&&n.col&&n.row)return;const o=this.getCellRect(t,e),r=k6(this);if(r.contains(o))return;n&&n.col||this.getColsWidth(0,this.frozenColCount-1)+o.width>this.canvas.width||(o.left<r.left?this.scrollLeft-=r.left-o.left:r.right<o.right&&(this.scrollLeft-=r.right-o.right)),n&&n.row||this.getRowsHeight(0,this.frozenRowCount-1)+o.height>this.canvas.height||(o.top<r.top?this.scrollTop-=r.top-o.top:r.bottom<o.bottom&&(this.scrollTop-=r.bottom-o.bottom))}}render(){this.scenegraph.renderSceneGraph()}renderAsync(){return this.scenegraph.updateNextFrame(),new Promise((t,e)=>{setTimeout(()=>{t()},0)})}_toRelativeRect(t,e=!0,n=!0){var o,r,s,l;const a=t.copy(),h=this.getVisibleRect();return a.offsetLeft(this.tableX-(e?h.left:0)),a.offsetTop(this.tableY-(n?h.top:0)),a.offsetLeft((r=(o=this.options.viewBox)===null||o===void 0?void 0:o.x1)!==null&&r!==void 0?r:0),a.offsetTop((l=(s=this.options.viewBox)===null||s===void 0?void 0:s.y1)!==null&&l!==void 0?l:0),a}getVisibleRect(){const{scrollTop:t,scrollLeft:e}=this,n=this.tableNoFrameWidth,o=this.tableNoFrameHeight;return new gs(e,t,n,o)}get visibleRowCount(){const{frozenRowCount:t}=this,e=this.getVisibleRect(),n=t>0?e.top+this.getRowsHeight(0,t-1):e.top,o=this.getTargetRowAt(n);if(!o)return 0;const r=Math.max(o.top>=n?o.row:o.row+1,t);let s=this.getRowsHeight(0,r-1),l=0;const{rowCount:a}=this;for(let h=r;h<a;h++){const d=s+this.getRowHeight(h);if(e.bottom<d)break;l++,s=d}return l}getBodyVisibleCellRange(){const{scrollTop:t,scrollLeft:e}=this,n=this.getFrozenRowsHeight(),o=this.getFrozenColsWidth(),r=this.getBottomFrozenRowsHeight(),s=this.getRightFrozenColsWidth(),{row:l}=this.getRowAt(t+n+1),{col:a}=this.getColAt(e+o+1),h=this.getAllRowsHeight()>this.tableNoFrameHeight?this.getRowAt(t+this.tableNoFrameHeight-1-r).row:this.rowCount-1,d=this.getAllColsWidth()>this.tableNoFrameWidth?this.getColAt(e+this.tableNoFrameWidth-1-s).col:this.colCount-1;return d<0||h<0?null:{rowStart:l,colStart:a,rowEnd:h,colEnd:d}}getBodyVisibleRowRange(){const{scrollTop:t}=this,e=this.getFrozenRowsHeight(),n=this.getBottomFrozenRowsHeight(),{row:o}=this.getRowAt(t+e+1),r=this.getAllRowsHeight()>this.tableNoFrameHeight?this.getRowAt(t+this.tableNoFrameHeight-1-n).row:this.rowCount-1;return r<0?null:{rowStart:o,rowEnd:r}}getBodyVisibleColRange(){const{scrollLeft:t}=this,e=this.getFrozenColsWidth(),n=this.getRightFrozenColsWidth(),{col:o}=this.getColAt(t+e+1),r=this.getAllColsWidth()>this.tableNoFrameWidth?this.getColAt(t+this.tableNoFrameWidth-1-n).col:this.colCount-1;return r<0?null:{colStart:o,colEnd:r}}get visibleColCount(){const{frozenColCount:t}=this,e=this.getVisibleRect(),n=t>0?e.left+this.getColsWidth(0,t-1):e.left,o=this.getTargetColAt(n);if(!o)return 0;const r=Math.max(o.left>=n?o.col:o.col+1,t);let s=this.getColsWidth(0,r-1),l=0;const{colCount:a}=this;for(let h=r;h<a;h++){const d=s+this.getColWidth(h);if(e.right<d)break;l++,s=d}return l}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||typeof t.release!="function")throw new Error("not releaseObj!");(this.internalProps.releaseList=this.internalProps.releaseList||[]).push(t)}dispose(){this.release()}release(){var t,e,n,o,r,s,l,a,h,d,u,c,g,f,p,m;const b=this.internalProps;if(this.isReleased)return;(e=(t=b.tooltipHandler)===null||t===void 0?void 0:t.release)===null||e===void 0||e.call(t),(o=(n=b.menuHandler)===null||n===void 0?void 0:n.release)===null||o===void 0||o.call(n),eR.clearAll(),(r=super.release)===null||r===void 0||r.call(this),(l=(s=b.handler)===null||s===void 0?void 0:s.release)===null||l===void 0||l.call(s),this.eventManager.release(),(h=(a=b.focusControl)===null||a===void 0?void 0:a.release)===null||h===void 0||h.call(a),(d=b.legends)===null||d===void 0||d.forEach(_=>{_==null||_.release()}),(u=b.title)===null||u===void 0||u.release(),b.title=null,(c=b.emptyTip)===null||c===void 0||c.release(),b.emptyTip=null,b.layoutMap.release(),b.releaseList&&(b.releaseList.forEach(_=>{var w;return(w=_==null?void 0:_.release)===null||w===void 0?void 0:w.call(_)}),b.releaseList=null),this.scenegraph.stage.release(),this.scenegraph.proxy.release(),b.focusControl.release();const{parentElement:C}=b.element;C&&!this.options.canvas&&C.removeChild(b.element),(p=(f=(g=this.editorManager)===null||g===void 0?void 0:g.editingEditor)===null||f===void 0?void 0:f.onEnd)===null||p===void 0||p.call(f),this.isReleased=!0,this.scenegraph=null,this.internalProps=null,(m=this.reactCustomLayout)===null||m===void 0||m.clearCache()}fireListeners(t,e){return super.fireListeners(t,e)}updateOption(t){var e,n,o,r,s,l,a,h,d,u,c,g;this.options=t,this._hasAutoImageColumn=void 0;const{frozenColCount:f=0,defaultRowHeight:p=40,defaultHeaderRowHeight:m,defaultColWidth:b=80,defaultHeaderColWidth:C=80,keyboardOptions:_,eventOptions:w,rowSeriesNumber:y,columnResizeMode:S,rowResizeMode:A="none",dragHeaderMode:R,showFrozenIcon:x,allowFrozenColCount:T,padding:M,hover:B,menu:P,select:F,pixelRatio:H,widthMode:E,heightMode:k,autoFillWidth:I,autoFillHeight:L,widthAdaptiveMode:D,heightAdaptiveMode:O,customRender:N,renderChartAsync:W,renderChartAsyncBatchCount:$,overscrollBehavior:U,limitMinWidth:Y,limitMinHeight:j}=t;H&&H!==this.internalProps.pixelRatio&&(this.internalProps.pixelRatio=H),M&&(typeof M=="number"?(this.padding.top=M,this.padding.left=M,this.padding.bottom=M,this.padding.right=M):(M.top&&(this.padding.top=M.top),M.bottom&&(this.padding.bottom=M.bottom),M.left&&(this.padding.left=M.left),M.right&&(this.padding.right=M.right))),this.showFrozenIcon=typeof x!="boolean"||x,typeof T=="number"&&T<=0&&(this.showFrozenIcon=!1),this.widthMode=E??"standard",this.heightMode=k??"standard",this._widthAdaptiveMode=D??"only-body",this._heightAdaptiveMode=O??"only-body",this.autoFillWidth=I!=null&&I,this.autoFillHeight=L!=null&&L,this.customRender=N;const G=this.internalProps;if(oe.mode==="node"||t.canvas||B6(G.element,this.padding),this.columnWidthComputeMode=(e=t.columnWidthComputeMode)!==null&&e!==void 0?e:"normal",G.frozenColCount=f,G.defaultRowHeight=p,G.defaultHeaderRowHeight=m??p,G.defaultColWidth=b,G.defaultHeaderColWidth=C??b,G.keyboardOptions=_,G.eventOptions=w,G.rowSeriesNumber=y,G.columnResizeMode=S,G.rowResizeMode=A,G.dragHeaderMode=R??"none",G.renderChartAsync=W,HR($),G.overscrollBehavior=U??"auto",G.cellTextOverflows={},G._rowHeightsMap=new VA(this),G._rowRangeHeightsMap=new Map,G._colRangeWidthsMap=new Map,G._widthResizedColMap=new Set,G._heightResizedRowMap=new Set,this.colWidthsMap=new Mr,this.colContentWidthsMap=new Mr,this.colWidthsLimit={},G.stick.changedCells.clear(),G.theme=Jo.of((n=t.theme)!==null&&n!==void 0?n:Jo.DEFAULT),G.theme.isPivot=this.isPivotTable(),Hc(G.theme.functionalIconsStyle),this.scenegraph.updateStageBackground(),G.autoWrapText=t.autoWrapText,G.enableLineBreak=t.enableLineBreak,G.allowFrozenColCount=(o=t.allowFrozenColCount)!==null&&o!==void 0?o:0,G.limitMaxAutoWidth=(r=t.limitMaxAutoWidth)!==null&&r!==void 0?r:450,G.limitMinWidth=Y!=null?typeof Y=="number"?Y:Y?10:0:10,G.limitMinHeight=j!=null?typeof j=="number"?j:j?10:0:10,(s=G.legends)===null||s===void 0||s.forEach(X=>{X==null||X.release()}),(l=G.title)===null||l===void 0||l.release(),G.title=null,(a=G.emptyTip)===null||a===void 0||a.release(),G.emptyTip=null,G.layoutMap.release(),this.scenegraph.clearCells(),this.scenegraph.updateComponent(),this.stateManager.updateOptionSetState(),this._updateSize(),this.eventManager.updateEventBinder(),t.legends){G.legends=[];const X=Bt.getFunction("createLegend");if(Array.isArray(t.legends)){for(let ht=0;ht<t.legends.length;ht++)G.legends.push(X(t.legends[ht],this));this.scenegraph.tableGroup.setAttributes({x:this.tableX,y:this.tableY})}else G.legends.push(X(t.legends,this)),this.scenegraph.tableGroup.setAttributes({x:this.tableX,y:this.tableY})}if(G.tooltip=Object.assign({parentElement:this.getElement(),renderMode:"html",isShowOverflowTextTooltip:!1,confine:!0},t.tooltip),G.tooltip.renderMode==="html"&&!G.tooltipHandler){const X=Bt.getComponent("tooltipHandler");G.tooltipHandler=new X(this,G.tooltip.confine)}if(G.menu=Object.assign({renderMode:"html"},t.menu),Array.isArray((h=t.menu)===null||h===void 0?void 0:h.dropDownMenuHighlight)&&this.setDropDownMenuHighlight((d=t.menu)===null||d===void 0?void 0:d.dropDownMenuHighlight),Array.isArray((u=t.menu)===null||u===void 0?void 0:u.defaultHeaderMenuItems)&&(this.globalDropDownMenu=t.menu.defaultHeaderMenuItems),G.menu.renderMode==="html"&&!G.menuHandler){const X=Bt.getComponent("menuHandler");G.menuHandler=new X(this)}this.clearCellStyleCache(),this.clearColWidthCache(),this.clearRowHeightCache(),G.customMergeCell=t.customMergeCell,this.customCellStylePlugin.updateCustomCell((c=t.customCellStyle)!==null&&c!==void 0?c:[],(g=t.customCellStyleArrangement)!==null&&g!==void 0?g:[])}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 gs(this.tableX,this.tableY,t,e)}_getMouseAbstractPoint(t,e=!0){var n,o,r,s;let l;if(!t)return{inTable:!1,x:void 0,y:void 0};l=G8(t)?t.changedTouches[0]:t;const a=l.clientX||l.pageX+window.scrollX,h=l.clientY||l.pageY+window.scrollY,d=this.internalProps.canvas.getBoundingClientRect();let u=!0;d.right<=a&&(u=!1),d.bottom<=h&&(u=!1);const c=d.width,g=c/(this.canvas.offsetWidth||c),f=d.height,p=f/(this.canvas.offsetHeight||f),m={x:(a-d.left)/g+(e?this.scrollLeft:0)-((o=(n=this.options.viewBox)===null||n===void 0?void 0:n.x1)!==null&&o!==void 0?o:0),y:(h-d.top)/p+(e?this.scrollTop:0)-((s=(r=this.options.viewBox)===null||r===void 0?void 0:r.y1)!==null&&s!==void 0?s:0),inTable:u};return this.internalProps.modifiedViewBoxTransform&&this.scenegraph.stage.window.getViewBoxTransform()&&this.scenegraph.stage.window.getViewBoxTransform().transformPoint(m,m),m}getTheme(){return this.internalProps.theme}getTargetColAt(t){return rv(t,this)}getTargetRowAt(t){const e=sv(t,this);return e&&(e.row=Math.min(e.row,this.rowCount-1)),e}getTargetColAtConsiderRightFrozen(t,e){return KA(t,e,this)}getTargetRowAtConsiderBottomFrozen(t,e){return YA(t,e,this)}clearSelected(){this.stateManager.updateSelectPos(-1,-1)}selectCell(t,e,n,o,r=!0,s=!1,l=!1){var a;const h=!!(!((a=this.stateManager.select.ranges)===null||a===void 0)&&a.length);this.stateManager.updateSelectPos(t,e,n,o,!1,!r,s,l),this.stateManager.endSelectCells(!0,h)}selectCells(t){const{scrollLeft:e,scrollTop:n}=this;t.forEach((o,r)=>{o.start.col===o.end.col&&o.start.row===o.end.row?this.stateManager.updateSelectPos(o.start.col,o.start.row,!1,r>=1,!1,!1,!0):(this.stateManager.updateSelectPos(o.start.col,o.start.row,!1,r>=1,!1,!1,!0),this.stateManager.updateInteractionState($t.grabing),this.stateManager.updateSelectPos(o.end.col,o.end.row,!1,r>=1,!1,!1,!0)),this.stateManager.endSelectCells(!1,!1),this.stateManager.updateInteractionState($t.default)}),this.setScrollTop(n),this.setScrollLeft(e)}get recordsCount(){var t;return(t=this.records)===null||t===void 0?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(),wm(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=Jo.of(t??Jo.DEFAULT),this.internalProps.theme.isPivot=this.isPivotTable(),this.options.theme=t,Hc(this.internalProps.theme.functionalIconsStyle)}updateTheme(t){const e={col:this.stateManager.hover.cellPos.col,row:this.stateManager.hover.cellPos.row};this.internalProps.theme=Jo.of(t??Jo.DEFAULT),this.internalProps.theme.isPivot=this.isPivotTable(),Hc(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 n=this.internalProps.layoutMap.getBody(t,e);return n==null?void 0:n.define}getBodyColumnType(t,e){var n,o;const r=(o=(n=this.internalProps.layoutMap.getBody(t,e))===null||n===void 0?void 0:n.cellType)!==null&&o!==void 0?o:"text";return wt("cellType",{cellType:r},t,e,this)}getCellType(t,e){let n;return this.isSeriesNumberInHeader(t,e)?this.internalProps.layoutMap.getSeriesNumberHeader(t,e).cellType:(n=this.isHeader(t,e)?this.internalProps.layoutMap.getHeader(t,e).headerType:this.internalProps.layoutMap.getBody(t,e).cellType,wt("cellType",{cellType:n},t,e,this))}getHeaderField(t,e){return this.internalProps.layoutMap.getHeaderField(t,e)}getHeaderDefine(t,e){const n=this.internalProps.layoutMap.getHeader(t,e);return n==null?void 0:n.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 n=[];for(;;){const o=this.getHeaderDefine(t,e);if(!o||!o.field&&!o.columns)break;n.push(o),e++}return n}_getHeaderLayoutMap(t,e){return this.internalProps.layoutMap.getHeader(t,e)}_getBodyLayoutMap(t,e){return this.internalProps.layoutMap.getBody(t,e)}getContext(){return this.internalProps.context}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,n=e.headerObjects.find(o=>o&&o.field===t.field);if(n)return e.getHeaderCellAdressById(n.id)}getCellRange(t,e){var n;if(this.internalProps.customMergeCell){const o=this.internalProps.customMergeCell(t,e,this);if(o&&o.range&&(z(o.text)||o.customLayout||o.customRender))return o.range}return(n=this.internalProps.layoutMap)===null||n===void 0?void 0:n.getCellRange(t,e)}hasCustomMerge(){return!!this.internalProps.customMergeCell}getCustomMerge(t,e){if(this.internalProps.customMergeCell){const n=this.internalProps.customMergeCell(t,e,this);if(n&&n.range&&(z(n.text)||n.customLayout||this.customRender)){if(n.style){const o=this.internalProps.bodyHelper.getStyleClass("text"),r=n.style,s=em(r,this.theme.bodyStyle,{col:t,row:e,table:this,value:n.text,dataValue:this.getCellOriginValue(t,e),cellHeaderPaths:this.getCellHeaderPaths(t,e)},o,this.options.autoWrapText,this.theme);n.style=s}return n}}}isCellRangeEqual(t,e,n,o){return this.internalProps.layoutMap.isCellRangeEqual(t,e,n,o)}_getLayoutCellId(t,e){return this.internalProps.layoutMap.getCellId(t,e)}getHeaderDescription(t,e){var n;const o=this._getHeaderLayoutMap(t,e),r=o==null?void 0:o.define,s=(n=r==null?void 0:r.description)!==null&&n!==void 0?n:o==null?void 0:o.description;return typeof s=="function"?s({col:t,row:e,value:this.getCellValue(t,e),dataValue:this.getCellOriginValue(t,e)}):s}setDropDownMenuHighlight(t){this.stateManager.setDropDownMenuHighlight(t)}_dropDownMenuIsHighlight(t,e,n){return this.stateManager.dropDownMenuIsHighlight(t,e,n)}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 n;return(n=this.internalProps.layoutMap)===null||n===void 0?void 0:n.isColumnHeader(t,e)}isRowHeader(t,e){var n;return(n=this.internalProps.layoutMap)===null||n===void 0?void 0:n.isRowHeader(t,e)}isCornerHeader(t,e){var n;return(n=this.internalProps.layoutMap)===null||n===void 0?void 0:n.isCornerHeader(t,e)}isFrozenColumn(t,e){return this.isLeftFrozenColumn(t,e)||this.isRightFrozenColumn(t,e)}isLeftFrozenColumn(t,e){var n;return(n=this.internalProps.layoutMap)===null||n===void 0?void 0:n.isFrozenColumn(t,e)}isRightFrozenColumn(t,e){var n;return(n=this.internalProps.layoutMap)===null||n===void 0?void 0:n.isRightFrozenColumn(t,e)}isFrozenRow(t,e){return this.isTopFrozenRow(t,e)||this.isBottomFrozenRow(t,e)}isTopFrozenRow(t,e){var n;return(n=this.internalProps.layoutMap)===null||n===void 0?void 0:n.isFrozenRow(t,e)}isBottomFrozenRow(t,e){var n;return(n=this.internalProps.layoutMap)===null||n===void 0?void 0:n.isBottomFrozenRow(t,e)}getCellInfo(t,e){if(t>=0&&e>=0){const n=this.isHeader(t,e)?this.getHeaderDefine(t,e):this.getBodyColumnDefine(t,e);return{col:t,row:e,field:this.getHeaderField(t,e),cellHeaderPaths:this.internalProps.layoutMap.getCellHeaderPaths(t,e),title:n==null?void 0:n.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,n){var o;if(t===null||this.internalProps.layoutMap.isHeader(e,n))return!1;const r=this.getRecordShowIndexByCell(e,n);return(o=this.internalProps.dataSource)===null||o===void 0?void 0:o.hasField(r,t)}_getCellStyle(t,e){return V8(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)||this.isCellRangeEqual(t,e,t+1,e)||this.internalProps.columnResizeMode==="none")return!1;if(this.internalProps.columnResizeMode==="header"){if(!this.isHeader(t,e))return!1}else if(this.internalProps.columnResizeMode==="body"&&this.isHeader(t,e))return!1;const n=this.colWidthsLimit[t];return!(n&&n.min&&n.max)||n.max!==n.min}_canResizeRow(t,e){if(!(t>=0&&e>=0)||this.isCellRangeEqual(t,e,t,e+1)||this.internalProps.rowResizeMode==="none")return!1;if(this.internalProps.rowResizeMode==="header"){if(!this.isHeader(t,e))return!1}else if(this.internalProps.rowResizeMode==="body"&&this.isHeader(t,e))return!1;return!0}_canDragHeaderPosition(t,e){var n,o;if(this.isHeader(t,e)&&(this.stateManager.isSelected(t,e)||!((n=this.options.select)===null||n===void 0)&&n.disableHeaderSelect||!((o=this.options.select)===null||o===void 0)&&o.disableSelect)){if(this.internalProps.frozenColDragHeaderMode==="disabled"&&this.isFrozenColumn(t))return!1;if(this.stateManager.isSelected(t,e)){const s=this.stateManager.select.ranges[0];if(this.isColumnHeader(t,e)){if(s.end.row!==this.rowCount-1)return!1}else if(!this.isRowHeader(t,e)||s.end.col!==this.colCount-1)return!1}const r=this.getHeaderDefine(t,e);if(!r)return!1;if(r.dragHeader===void 0){if(this.internalProps.dragHeaderMode==="all")return!0;if(this.internalProps.dragHeaderMode==="column"){if(this.isColumnHeader(t,e))return!0}else if(this.internalProps.dragHeaderMode==="row"&&this.isRowHeader(t,e))return!0;return!1}return r.dragHeader}return!1}getCellIcons(t,e){var n,o,r;let s;if(this.isHeader(t,e))s=this.internalProps.headerHelper.getIcons(t,e);else if(this.internalProps.layoutMap.isSeriesNumber(t,e)){(!this.options.groupBy||!(!((n=this.getCellRawRecord(t,e))===null||n===void 0)&&n.vtableMerge))&&!((r=(o=this.internalProps.layoutMap.getSeriesNumberBody(t,e))===null||o===void 0?void 0:o.define)===null||r===void 0)&&r.dragOrder&&(s=this.internalProps.rowSeriesNumberHelper.getIcons(t,e));const l=this.getCellValue(t,e),a=this.getCellOriginValue(t,e),h=this.internalProps.context,d=this.internalProps.bodyHelper.getIcons(t,e,l,a,h);(s==null?void 0:s.length)>0?s=s.concat(d):(d==null?void 0:d.length)>0&&(s=d)}else{const l=this.getCellValue(t,e),a=this.getCellOriginValue(t,e),h=this.internalProps.context;s=this.internalProps.bodyHelper.getIcons(t,e,l,a,h)}return s}showDropDownMenu(t,e,n){let o="dropdown-menu";n&&(o=Array.isArray(n.content)?"dropdown-menu":"container"),this.internalProps.menu.renderMode==="html"&&(this.stateManager.menu.isShow=!0,this.internalProps.menuHandler._bindToCell(t,e,o,n))}showTooltip(t,e,n){this.internalProps.tooltip.renderMode==="html"&&this.internalProps.tooltipHandler._bindToCell(t,e,n)}getCellStyle(t,e){const n=this._getCellStyle(t,e),o=Pr(n,this,t,e,wt).theme,{autoWrapText:r,lineClamp:s,textOverflow:l}=n;return{textAlign:o.text.textAlign,textBaseline:o.text.textBaseline,bgColor:bi(o.group.fill)?wt("bgColor",n,t,e,this):o.group.fill,color:bi(o.text.fill)?wt("color",n,t,e,this):o.text.fill,strokeColor:bi(o.text.stroke)?wt("strokeColor",n,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:r!=null&&r,lineClamp:s??"auto",textOverflow:l,borderColor:bi(o.group.stroke)?wt("borderColor",n,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:wt("linkColor",n,t,e,this)}}getAllBodyCells(t,e){const n=this.rowHeaderLevelCount,o=this.columnHeaderLevelCount,r=this.colCount-1,s=this.rowCount-1;return Array(Math.min(e??2e3,s-o+1,this.rowCount)).fill(0).map((l,a)=>Array(Math.min(t??2e3,r-n+1,this.colCount)).fill(0).map((h,d)=>this.getCellInfo(d+n,a+o)))}getAllCells(t,e){const r=this.colCount-1,s=this.rowCount-1;return Array(Math.min(e??2e3,s-0+1,this.rowCount)).fill(0).map((l,a)=>Array(Math.min(t??2e3,r-0+1,this.colCount)).fill(0).map((h,d)=>this.getCellInfo(d+0,a+0)))}getAllColumnHeaderCells(){const t=this.rowHeaderLevelCount,e=0,n=this.colCount-1,o=this.columnHeaderLevelCount-1;return Array(o-e+1).fill(0).map((r,s)=>Array(n-t+1).fill(0).map((l,a)=>this.getCellInfo(a+t,s+e)))}getAllRowHeaderCells(){const e=this.columnHeaderLevelCount,n=this.rowHeaderLevelCount-1,o=this.rowCount-1;return Array(o-e+1).fill(0).map((r,s)=>Array(n-0+1).fill(0).map((l,a)=>this.getCellInfo(a+0,s+e)))}getCopyValue(){var t,e,n;if(((e=(t=this.stateManager.select)===null||t===void 0?void 0:t.ranges)===null||e===void 0?void 0:e.length)>0){const o=this.stateManager.select.ranges;let r=Math.min(o[0].start.col,o[0].end.col),s=Math.max(o[0].start.col,o[0].end.col),l=Math.min(o[0].start.row,o[0].end.row),a=Math.max(o[0].start.row,o[0].end.row);o.forEach(f=>{r=Math.min(r,f.start.col,f.end.col),s=Math.max(s,f.start.col,f.end.col),l=Math.min(l,f.start.row,f.end.row),a=Math.max(a,f.start.row,f.end.row)});const h=f=>{let p=!1;return o.forEach(m=>{const b=Math.min(m.start.row,m.end.row),C=Math.max(m.start.row,m.end.row);b<=f&&C>=f&&(p=!0)}),p},d=f=>{let p=!1;return o.forEach(m=>{const b=Math.min(m.start.col,m.end.col),C=Math.max(m.start.col,m.end.col);b<=f&&C>=f&&(p=!0)}),p},u=(f,p)=>{let m;return o.forEach(b=>{const C=Math.min(b.start.row,b.end.row),_=Math.max(b.start.row,b.end.row),w=Math.min(b.start.col,b.end.col),y=Math.max(b.start.col,b.end.col);w<=f&&y>=f&&C<=p&&_>=p&&(m=b)}),m},c=(f,p,m)=>{const b=this.getCellRange(f,p);let C=b.start.col,_=b.start.row;if(m){const w=Math.min(m.start.col,m.end.col),y=Math.min(m.start.row,m.end.row);C=Math.max(w,b.start.col),_=Math.max(y,b.start.row)}return C!==f||_!==p?"":this.getCellValue(f,p)};let g="";for(let f=l;f<=a;f++)if(h(f)){for(let p=r;p<=s;p++)if(d(p)){const m=u(p,f);if(m){const b=c(p,f,m);if(!(typeof Promise<"u"&&b instanceof Promise)){const C=z(b)?`${b}`:"";/^\[object .*\]$/.exec(C)||(g+=C)}(p<m.end.col||p<s)&&(g+=" ")}else g+=" "}f<a&&(g+=`\r
|
|
224
|
+
`)}return!((n=this.options)===null||n===void 0)&&n.formatCopyValue&&(g=this.options.formatCopyValue(g)),g}return""}getSelectedCellInfos(){var t;if(!(!((t=this.stateManager.select)===null||t===void 0)&&t.ranges))return null;const e=this.stateManager.select.ranges;if(!e.length)return[];let n=Math.min(e[0].start.col,e[0].end.col),o=Math.max(e[0].start.col,e[0].end.col),r=Math.min(e[0].start.row,e[0].end.row),s=Math.max(e[0].start.row,e[0].end.row);e.forEach(u=>{n=Math.min(n,u.start.col,u.end.col),o=Math.max(o,u.start.col,u.end.col),r=Math.min(r,u.start.row,u.end.row),s=Math.max(s,u.start.row,u.end.row)});const l=u=>{let c=!1;return e.forEach(g=>{const f=Math.min(g.start.row,g.end.row),p=Math.max(g.start.row,g.end.row);f<=u&&p>=u&&(c=!0)}),c},a=u=>{let c=!1;return e.forEach(g=>{const f=Math.min(g.start.col,g.end.col),p=Math.max(g.start.col,g.end.col);f<=u&&p>=u&&(c=!0)}),c},h=(u,c)=>{let g;return e.forEach(f=>{const p=Math.min(f.start.row,f.end.row),m=Math.max(f.start.row,f.end.row),b=Math.min(f.start.col,f.end.col),C=Math.max(f.start.col,f.end.col);b<=u&&C>=u&&p<=c&&m>=c&&(g=f)}),g},d=[];for(let u=r;u<=s;u++)if(l(u)){const c=[];for(let g=n;g<=o;g++)if(a(g)&&h(g,u)){const f=this.getCellInfo(g,u);c.push(f)}d.push(c)}return d}getSelectedCellRanges(){const t=this.stateManager.select.ranges;return t.length?Ee(t):[]}measureText(t,e){return CR.measureText(t,e)}measureTextBounds(t){return _R(t)}getCustomRender(t,e){let n;if(this.getCellLocation(t,e)!=="body"){const o=this.getHeaderDefine(t,e);n=o==null?void 0:o.headerCustomRender}else{const o=this.getBodyColumnDefine(t,e);n=(o==null?void 0:o.customRender)||this.customRender}return n}getCustomLayout(t,e){let n;if(this.getCellLocation(t,e)!=="body"){const o=this.getHeaderDefine(t,e);n=o==null?void 0:o.headerCustomLayout}else{const o=this.getBodyColumnDefine(t,e);n=o==null?void 0:o.customLayout}return n}hasAutoImageColumn(){return this._hasAutoImageColumn===void 0&&(this._hasAutoImageColumn=H8(this)),this._hasAutoImageColumn}_getActiveChartInstance(){var t,e,n,o,r,s;const l=this.scenegraph.getCell((e=(t=this.stateManager.hover)===null||t===void 0?void 0:t.cellPos)===null||e===void 0?void 0:e.col,(o=(n=this.stateManager.hover)===null||n===void 0?void 0:n.cellPos)===null||o===void 0?void 0:o.row);return((s=(r=l==null?void 0:l.getChildren())===null||r===void 0?void 0:r[0])===null||s===void 0?void 0:s.type)==="chart"?l.getChildren()[0].activeChartInstance:null}cellIsInVisualView(t,e){var n,o,r,s;const l=this.getDrawRange(),a=this.getCellRelativeRect(t,e);if(t<this.frozenColCount&&e<this.frozenRowCount)return!0;let h,d,u,c;return this.frozenRowCount>=1&&(h=this.getCellRangeRelativeRect({start:{col:0,row:0},end:{col:this.colCount-1,row:this.frozenRowCount-1}})),this.frozenColCount>=1&&(d=this.getCellRangeRelativeRect({start:{col:0,row:0},end:{col:this.frozenColCount-1,row:this.rowCount-1}})),this.bottomFrozenRowCount>=1&&(u=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}})),!!(a.top>=l.top&&a.bottom<=l.bottom&&a.left>=l.left&&a.right<=l.right&&(this.isFrozenCell(t,e)||a.top>=((n=h==null?void 0:h.bottom)!==null&&n!==void 0?n:a.top)&&a.left>=((o=d==null?void 0:d.right)!==null&&o!==void 0?o:a.left)&&a.bottom<=((r=u==null?void 0:u.top)!==null&&r!==void 0?r:a.bottom)&&a.right<=((s=c==null?void 0:c.left)!==null&&s!==void 0?s:a.right)))}getCustomMergeValue(t,e){if(this.internalProps.customMergeCell){const n=this.getCustomMerge(t,e);if(n){const{text:o}=n;return o}}}exportImg(){return this.scenegraph.stage.toCanvas().toDataURL()}exportCellImg(t,e,n){var o,r,s,l;const a=this.cellIsInVisualView(t,e),{scrollTop:h,scrollLeft:d}=this;a||this.scrollToCell({col:t,row:e});const u=this.getCellRelativeRect(t,e);((r=(o=this.stateManager.select)===null||o===void 0?void 0:o.ranges)===null||r===void 0?void 0:r.length)>0&&iA(this.scenegraph);const{col:c,row:g}=this.stateManager.hover.cellPos;let f,p;if(this.stateManager.updateHoverPos(-1,-1),this.scenegraph.component.hideVerticalScrollBar(),this.scenegraph.component.hideHorizontalScrollBar(),this.scenegraph.tableGroup.border.setAttribute("visible",!1),n==null?void 0:n.disableBackground){const C=this.scenegraph.getCell(t,e);f=C.attribute.fill,C.setAttribute("fill","transparent")}if(n!=null&&n.disableBorder){const C=this.scenegraph.getCell(t,e);p=C.attribute.stroke,C.setAttribute("stroke",!1)}this.scenegraph.renderSceneGraph();let m=0;this.theme.cellBorderClipDirection==="bottom-right"&&(m=1);const b=this.scenegraph.stage.toCanvas(!1,new ke().set(u.left+this.tableX+1,u.top+this.tableY+1,u.right+this.tableX-m,u.bottom+this.tableY-m));return a||(this.setScrollTop(h),this.setScrollLeft(d)),this.scenegraph.tableGroup.border.setAttribute("visible",!0),f&&this.scenegraph.getCell(t,e).setAttribute("fill",f),p&&this.scenegraph.getCell(t,e).setAttribute("stroke",p),((l=(s=this.stateManager.select)===null||s===void 0?void 0:s.ranges)===null||l===void 0?void 0:l.length)>0&&nA(this.scenegraph),this.stateManager.updateHoverPos(c,g),this.scenegraph.updateNextFrame(),b.toDataURL()}exportCellRangeImg(t){var e,n,o,r;const{scrollTop:s,scrollLeft:l}=this,a=Math.min(t.start.col,t.end.col),h=Math.min(t.start.row,t.end.row),d=Math.max(t.start.col,t.end.col),u=Math.max(t.start.row,t.end.row),c=this.cellIsInVisualView(a,h),g=this.cellIsInVisualView(d,u);c&&g||this.scrollToCell({col:a,row:h});const f=this.getCellRangeRelativeRect({start:{col:a,row:h},end:{col:d,row:u}});((n=(e=this.stateManager.select)===null||e===void 0?void 0:e.ranges)===null||n===void 0?void 0:n.length)>0&&iA(this.scenegraph);const{col:p,row:m}=this.stateManager.hover.cellPos;this.stateManager.updateHoverPos(-1,-1),this.scenegraph.component.hideVerticalScrollBar(),this.scenegraph.component.hideHorizontalScrollBar(),this.scenegraph.renderSceneGraph();const b=this.scenegraph.stage.toCanvas(!1,new ke().set(f.left+this.tableX+1,f.top+this.tableY+1,f.right+this.tableX,f.bottom+this.tableY)).toDataURL();return c&&g||(this.setScrollTop(s),this.setScrollLeft(l)),((r=(o=this.stateManager.select)===null||o===void 0?void 0:o.ranges)===null||r===void 0?void 0:r.length)>0&&nA(this.scenegraph),this.stateManager.updateHoverPos(p,m),b}exportCanvas(){return this.scenegraph.stage.toCanvas()}getImageBuffer(t="image/png"){if(this.options.mode!=="node")return;this.render();const e=this.scenegraph.stage;if(e){const n=this.tableX+this.getAllColsWidth(),o=this.tableY+this.getAllRowsHeight();return n>=this.canvasWidth&&o>=this.canvasHeight?(e.render(),e.window.getImageBuffer(t)):this.scenegraph.stage.toCanvas(!1,new ke().set(0,0,Math.min(this.canvasWidth,n),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,n){this._chartEventMap[t]||(this._chartEventMap[t]=[]),typeof e=="function"?this._chartEventMap[t].push({callback:e}):this._chartEventMap[t].push({callback:n,query:e})}offVChartEvent(t,e){this._chartEventMap[t]&&(this._chartEventMap[t]=e?this._chartEventMap[t].filter(n=>n.callback!==e):[])}_bindChartEvent(t){if(t)for(const e in this._chartEventMap)(this._chartEventMap[e]||[]).forEach(n=>{n.query?t.on(e,n.query,n.callback):t.on(e,n.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((t=this.internalProps.layoutMap)===null||t===void 0?void 0:t.leftRowSeriesNumberColumnCount)>0}get leftRowSeriesNumberCount(){var t,e;return(e=(t=this.internalProps.layoutMap)===null||t===void 0?void 0:t.leftRowSeriesNumberColumnCount)!==null&&e!==void 0?e:0}setMinMaxLimitWidth(t=!1){var e,n;const o=this.internalProps;for(let r=0;r<o.layoutMap.columnWidths.length;r++){if(this.internalProps._widthResizedColMap.has(r))continue;const{width:s,minWidth:l,maxWidth:a}=(n=(e=o.layoutMap.columnWidths)===null||e===void 0?void 0:e[r])!==null&&n!==void 0?n:{};t&&s&&(typeof s=="string"&&s!=="auto"||typeof s=="number"&&s>0)&&this._setColWidth(r,s),l&&(typeof l=="number"&&l>0||typeof l=="string")&&this.setMinColWidth(r,l),a&&(typeof a=="number"&&a>0||typeof a=="string")&&this.setMaxColWidth(r,a)}}setSortedIndexMap(t,e){var n;(n=this.dataSource)===null||n===void 0||n.setSortedIndexMap(t,e)}checkReactCustomLayout(t){this.reactCustomLayout||(this.reactCustomLayout=new I6(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 n=this.getDrawRange();if(z(t.col)&&t.col>=this.frozenColCount){const o=this.getFrozenColsWidth(),r=this.getColsWidth(0,t.col-1);this.scrollLeft=Math.min(r-o,this.getAllColsWidth()-n.width)}if(z(t.row)&&t.row>=this.frozenRowCount){const o=this.getFrozenRowsHeight(),r=this.getRowsHeight(0,t.row-1);this.scrollTop=Math.min(r-o,this.getAllRowsHeight()-n.height)}this.render()}}const K8=Object.freeze(Object.defineProperty({__proto__:null,BaseTable:Cg},Symbol.toStringTag,{value:"Module"})),yg={},_g={};function oT(i){if(_g[i])return _g[i]}function wg(i,t,e){const n=i[t];return i[t]=e,n}function Y8(i,t){return t!=null?wg(vc,i,t):vc[i]}function X8(i,t){return t!=null?wg(Pc,i,t):Pc[i]}function q8(i,t){return t!=null?wg(yg,i,t):yg[i]}function Z8(i,t){return t!=null?wg(_g,i,t):_g[i]}function av(i){for(const t in i)delete i[t]}function rT(){av(vc),av(Pc),av(yg)}const J8=Object.freeze(Object.defineProperty({__proto__:null,chartModule:q8,clearAll:rT,editor:Z8,icon:X8,theme:Y8},Symbol.toStringTag,{value:"Module"}));function Q8(i,t,e){const n=(i+="").split(".");let o=n[0];const r=n.length>1?e+n[1]:"";return o=tV(o,t),o+r}function tV(i,t){return i.replace(/\d+/,function(e){return e.replace(/(\d)(?=(\d{3})+$)/g,function(n){return`${n}${t}`})})}function eV(i){return i=Object.assign({},{digitsAfterDecimal:2,scaler:1,thousandsSep:",",decimalSep:".",prefix:"",suffix:""},i),function(t){if(isNaN(t)||!isFinite(t))return"";const e=Q8((i.scaler*t).toFixed(i.digitsAfterDecimal),i.thousandsSep,i.decimalSep);return`${i.prefix}${e}${i.suffix}`}}function iV(i,t,e,n,o){e==null&&(e=!1),n==null&&(n=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]),o==null&&(o=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]);const r=e?"UTC":"",s=function(l){return`0${l}`.substring(0,2)};return function(l){const a=new Date(Date.parse(l[i]));return t.replace(/%(.)/g,function(h,d){switch(d){case"y":return a[`get${r}FullYear`]();case"m":return s(a[`get${r}Month`]()+1);case"n":return n[a[`get${r}Month`]()];case"d":return s(a[`get${r}Date`]());case"w":return o[a[`get${r}Day`]()];case"x":return a[`get${r}Day`]();case"H":return s(a[`get${r}Hours`]());case"M":return s(a[`get${r}Minutes`]());case"S":return s(a[`get${r}Seconds`]());default:return`%${d}`}})}}const nV=Object.freeze(Object.defineProperty({__proto__:null,dateFormat:iV,numberFormat:eV},Symbol.toStringTag,{value:"Module"})),oV=(i,t)=>{var e,n;if(!(t!=null&&t.fields)||i.length===0)return i;const o=t.fields,r=i[0],s={},l=[];for(const a in o)if(Object.prototype.hasOwnProperty.call(o,a)){const h=o[a];if(!h.type){let u=r;a in r||(u=(e=i.find(c=>a in c))!==null&&e!==void 0?e:r),h.type=typeof u[a]=="number"?"linear":"ordinal"}let d;if(typeof h.sortIndex=="number"&&(d={key:a,type:h.type,index:h.sortIndex,sortIndex:{},sortIndexCount:0,sortReverse:h.sortReverse===!0},l.push(d)),((n=h.domain)===null||n===void 0?void 0:n.length)>0)if(h.type==="ordinal"){h._domainCache={},s[a]=h;const u={};h.domain.forEach((c,g)=>{u[c]=g,h._domainCache[c]=g}),d&&(d.sortIndex=u,d.sortIndexCount=h.domain.length)}else h.domain.length>=2&&(s[a]=h)}return Object.keys(s).length>0&&(i=i.filter(a=>{for(const h in s){const d=s[h];if(d.type==="ordinal"){if(!(a[h]in d._domainCache))return!1}else if(d.domain[0]>a[h]||d.domain[1]<a[h])return!1}return!0})),l.sort((a,h)=>a.index-h.index),i.sort((a,h)=>rV(a,h,l)),i};function rV(i,t,e){for(let n=0;n<e.length;n++){const o=e[n];let r=0;if(o.type==="ordinal"?(o.sortIndex[t[o.key]]===void 0&&(o.sortIndex[t[o.key]]=o.sortIndexCount++),o.sortIndex[i[o.key]]===void 0&&(o.sortIndex[i[o.key]]=o.sortIndexCount++),r=o.sortIndex[i[o.key]]-o.sortIndex[t[o.key]]):o.type==="linear"&&(r=i[o.key]-t[o.key]),o.sortReverse&&(r=-r),r!==0)return r}return 0}let hv=0;const sV=1e8;function sT(i="dataset"){return hv>sV&&(hv=0),i+"_"+hv++}class lV{constructor(t){var e;let n;this.options=t,this.isDataSet=!0,this.transformMap={},this.parserMap={},this.dataViewMap={},this.target=new qr,n=t!=null&&t.name?t.name:sT("dataset"),this.name=n,this._logger=(e=t==null?void 0:t.logger)!==null&&e!==void 0?e:Te.getInstance()}setLogger(t){this._logger=t}getDataView(t){return this.dataViewMap[t]}setDataView(t,e){var n;this.dataViewMap[t]&&((n=this._logger)===null||n===void 0||n.error(`Error: dataView ${t} 之前已存在,请重新命名`)),this.dataViewMap[t]=e}removeDataView(t){this.dataViewMap[t]=null,delete this.dataViewMap[t]}registerParser(t,e){var n;this.parserMap[t]&&((n=this._logger)===null||n===void 0||n.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 n;this.transformMap[t]&&((n=this._logger)===null||n===void 0||n.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,n){this._callMap||(this._callMap=new Map);let o=this._callMap.get(n);o||(o=()=>{t.some(r=>r.isRunning)||n()}),t.forEach(r=>{r.target.addListener(e,o)}),this._callMap.set(n,o)}allDataViewAddListener(t,e){this.multipleDataViewAddListener(Object.values(this.dataViewMap),t,e)}multipleDataViewRemoveListener(t,e,n){if(this._callMap){const o=this._callMap.get(n);o&&t.forEach(r=>{r.target.removeListener(e,o)}),this._callMap.delete(n)}}multipleDataViewUpdateInParse(t){t.forEach(e=>{var n;return(n=this.getDataView(e.name))===null||n===void 0?void 0:n.markRunning()}),t.forEach(e=>{var n;return(n=this.getDataView(e.name))===null||n===void 0?void 0:n.parseNewData(e.data,e.options)})}multipleDataViewUpdateInRawData(t){t.forEach(e=>{var n;return(n=this.getDataView(e.name))===null||n===void 0?void 0:n.markRunning()}),t.forEach(e=>{var n;return(n=this.getDataView(e.name))===null||n===void 0?void 0:n.updateRawData(e.data,e.options)})}destroy(){this.transformMap=null,this.parserMap=null,this.dataViewMap=null,this._callMap=null,this.target.removeAllListeners()}}const dv="_data-view-diff-rank";class Sg{constructor(t,e){let n;this.dataSet=t,this.options=e,this.isDataView=!0,this.target=new qr,this.parseOption=null,this.transformsArr=[],this.isRunning=!1,this.rawData={},this.history=!1,this.parserData={},this.latestData={},this._fields=null,this.reRunAllTransform=(o={pushHistory:!0,emitMessage:!0})=>(this.isRunning=!0,this.resetTransformData(),this.transformsArr.forEach(r=>{this.executeTransform(r,{pushHistory:o.pushHistory,emitMessage:!1}),this.isLastTransform(r)&&this.diffLastData()}),this.isRunning=!1,o.emitMessage!==!1&&this.target.emit("change",[]),this),this.markRunning=()=>{this.isRunning=!0,this.target.emit("markRunning",[])},n=e!=null&&e.name?e.name:sT("dataview"),this.name=n,e!=null&&e.history&&(this.history=e.history,this.historyData=[]),this.dataSet.setDataView(n,this),this.setFields(e==null?void 0:e.fields)}parse(t,e,n=!1){var o;this.isRunning=!0,n&&this.target.emit("beforeParse",[]),e&&(this.parseOption=e);const r=this.cloneParseData(t,e);if(e!=null&&e.type){const s=((o=this.dataSet.getParser(e.type))!==null&&o!==void 0?o:this.dataSet.getParser("bytejson"))(r,e.options,this);this.rawData=r,this.parserData=s,this.history&&this.historyData.push(r,s),this.latestData=s}else this.parserData=r,this.rawData=r,this.history&&this.historyData.push(r),this.latestData=r;return this.isRunning=!1,n&&this.target.emit("afterParse",[]),this}transform(t,e=!0){if(this.isRunning=!0,t&&t.type){let n=!0;if(t.type==="fields"){this._fields=t.options.fields;const o=this.transformsArr.findIndex(r=>r.type===t.type);o>=0&&(n=!1,this.transformsArr[o].options.fields=this._fields)}if(n&&this.transformsArr.push(t),e){const o=this.isLastTransform(t);this.executeTransform(t),o&&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 n,o;return((n=t.level)!==null&&n!==void 0?n:0)-((o=e.level)!==null&&o!==void 0?o:0)})}executeTransform(t,e={pushHistory:!0,emitMessage:!0}){const{pushHistory:n,emitMessage:o}=e,r=this.dataSet.getTransform(t.type)(this.latestData,t.options);this.history&&n!==!1&&this.historyData.push(r),this.latestData=r,o!==!1&&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||!this.latestData.forEach||!(!((t=this._diffKeys)===null||t===void 0)&&t.length))return;const e=this._diffRank+1;if(this._diffRank===0)this.latestData.forEach(n=>{n[dv]=e,this._diffMap.set(this._diffKeys.reduce((o,r)=>o+n[r],""),n)}),this.latestDataAUD={add:Array.from(this.latestData),del:[],update:[]};else{let n;this.latestDataAUD={add:[],del:[],update:[]},this.latestData.forEach(o=>{o[dv]=e,n=this._diffKeys.reduce((r,s)=>r+o[s],""),this._diffMap.get(n)?this.latestDataAUD.update.push(o):this.latestDataAUD.add.push(o),this._diffMap.set(n,o)}),this._diffMap.forEach((o,r)=>{o[dv]<e&&(this.latestDataAUD.del.push(o),this._diffMap.delete(r))})}this._diffRank=e}cloneParseData(t,e){let n=!1;return t instanceof Sg||(e==null?void 0:e.clone)!==!0||(n=!0),n?Ee(t):t}parseNewData(t,e){this.parse(t,e||this.parseOption),this.reRunAllTransform()}updateRawData(t,e){const n=this.cloneParseData(t,e);this.rawData=n,this.parserData=n,this.latestData=n,this.reRunAllTransform()}getFields(){var t;return this._fields?this._fields:((t=this.parseOption)===null||t===void 0?void 0:t.type)==="dataview"&&this.rawData.length===1&&this.rawData[0].getFields?this.rawData[0].getFields():null}setFields(t,e=!1){this._fields=t&&e?xt({},this._fields,t):t;const n=this.transformsArr.find(o=>o.type==="fields");!Mt(this._fields)&&Mt(n)?(this.dataSet.registerTransform("fields",oV),this.transform({type:"fields",options:{fields:this._fields}},!1)):n&&(n.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 aV(i){return i instanceof Sg}function ho(i,t=["data"]){const e=i;let n;if(!z(e)||typeof e!="object"||aV(e)||GP(e))return e;const o=lt(e),r=e.length;n=o?new Array(r):typeof e=="object"?{}:bi(e)||ft(e)||ce(e)?e:WC(e)?new Date(+e):void 0;const s=o?void 0:Object.keys(Object(e));let l=-1;if(n)for(;++l<(s||e).length;){const a=s?s[l]:l,h=e[a];t!=null&&t.includes(a.toString())?n[a]=h:n[a]=ho(h,t)}return n}function lT(i){var t,e;const n=Object.assign({},i);return qt(i.style)||(n.textStyle=ni(i.style)),qt(i.textStyle)||xt(n.textStyle,ni(i.textStyle)),!((t=i.shape)===null||t===void 0)&&t.style&&ni(n.shape.style),!((e=i.background)===null||e===void 0)&&e.style&&ni(n.background.style),n}function ni(i){return qt(i)||i.angle&&(i.angle=Mn(i.angle)),i}function uo(i={}){return qt(i.style)||(i.style=ni(i.style)),qt(i.state)||Object.keys(i.state).forEach(t=>{qt(i.state[t])||(i.state[t]=ni(i.state[t]))}),i}function Ts(i){return qt(i)?null:(Object.keys(i).forEach(t=>{qt(i[t])||(i[t]=ni(i[t]))}),i)}function hV(i){return uo(i),uo(i.startSymbol),uo(i.endSymbol),i}const dV={left:{textAlign:"center",textBaseline:"bottom"},right:{textAlign:"center",textBaseline:"bottom"},radius:{},angle:{}},Ms="PingFang SC,Microsoft Yahei,system-ui,-apple-system,segoe ui,Roboto,Helvetica,Arial,sans-serif, apple color emoji,segoe ui emoji,segoe ui symbol",Ro=14,Eh={FONT_FAMILY:Ms,LABEL_FONT_SIZE:14,MAP_LABEL_FONT_SIZE:10,TITLE_FONT_SIZE:18,AXIS_TICK_SIZE:4},xg={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:Eh.AXIS_TICK_SIZE,style:{lineWidth:1,stroke:"#D9DDE4",strokeOpacity:1}},subTick:{visible:!1,tickSize:Eh.AXIS_TICK_SIZE/2,style:{lineWidth:1,stroke:"#D9DDE4",strokeOpacity:1}},label:{visible:!0,space:1,style:{fontSize:Eh.LABEL_FONT_SIZE,fill:"#89909D",fontWeight:"normal",fillOpacity:1},autoLimit:!0},title:{space:10,style:{fontSize:Eh.LABEL_FONT_SIZE,fill:"#333333",fontWeight:"normal",fillOpacity:1}}};function uV(i){var t,e;return!((e=(t=i==null?void 0:i.colorScheme)===null||t===void 0?void 0:t.default)===null||e===void 0)&&e.palette?xt({},xg,{tick:{style:{stroke:i.colorScheme.default.palette.axisDomainColor||"#D9DDE4"}},subTick:{style:{stroke:i.colorScheme.default.palette.axisDomainColor||"#D9DDE4"}},label:{style:{fill:i.colorScheme.default.palette.axisLabelFontColor||"#89909D"}},title:{style:{fill:i.colorScheme.default.palette.secondaryFontColor||"#333333"}}}):xg}function aT(i){var t,e,n,o,r,s,l,a,h,d,u,c,g;const f=xt({},i);let p,m=(e=(t=f.title)===null||t===void 0?void 0:t.angle)!==null&&e!==void 0?e:0;f.orient!=="left"&&f.orient!=="right"||!((n=f.title)===null||n===void 0)&&n.autoRotate&&Mt(f.title.angle)&&(m=f.orient==="left"?-90:90,p=dV[f.orient]);const b=bP(f.label,["style","formatMethod","state"]);return{orient:f.orient,select:f.select,hover:f.hover,line:hV(f.domainLine),label:Object.assign({style:ni(f.label.style),formatMethod:f.label.formatMethod?(C,_,w)=>f.label.formatMethod(_.rawValue,_):null,state:Ts(f.label.state)},b),tick:{visible:f.tick.visible,length:f.tick.tickSize,inside:f.tick.inside,alignWithLabel:f.tick.alignWithLabel,style:ni(f.tick.style),state:Ts(f.tick.state),dataFilter:f.tick.dataFilter},subTick:{visible:f.subTick.visible,length:f.subTick.tickSize,inside:f.subTick.inside,count:f.subTick.tickCount,style:ni(f.subTick.style),state:Ts(f.subTick.state)},grid:{type:"line",visible:f.grid.visible,alternateColor:f.grid.alternateColor,alignWithLabel:f.grid.alignWithLabel,style:ni(f.grid.style)},subGrid:{type:"line",visible:f.subGrid.visible,alternateColor:f.subGrid.alternateColor,style:ni(f.subGrid.style)},title:{visible:f.title.visible,position:f.title.position,space:f.title.space,autoRotate:!1,angle:m?Mn(m):null,textStyle:xt({},p,ni(f.title.style)),padding:f.title.padding,shape:{visible:(o=f.title.shape)===null||o===void 0?void 0:o.visible,space:(r=f.title.shape)===null||r===void 0?void 0:r.space,style:ni((s=f.title.shape)===null||s===void 0?void 0:s.style)},background:{visible:(l=f.title.background)===null||l===void 0?void 0:l.visible,style:ni((a=f.title.background)===null||a===void 0?void 0:a.style)},state:{text:Ts(f.title.state),shape:Ts((h=f.title.shape)===null||h===void 0?void 0:h.state),background:Ts((d=f.title.background)===null||d===void 0?void 0:d.state)}},panel:{visible:(u=f.background)===null||u===void 0?void 0:u.visible,style:ni((c=f.background)===null||c===void 0?void 0:c.style),state:Ts((g=f.background)===null||g===void 0?void 0:g.state)}}}const hT="NO_AXISID_FRO_VTABLE";function cV(i,t,e){var n,o;const r=e.getCellHeaderPaths(i,t);let s;if(e.indicatorsAsCol){const a=(n=r.colHeaderPaths.find(h=>h.indicatorKey))===null||n===void 0?void 0:n.indicatorKey;s=e.columnObjects.find(h=>h.indicatorKey===a)}else{const a=(o=r.rowHeaderPaths.find(h=>h.indicatorKey))===null||o===void 0?void 0:o.indicatorKey;s=e.columnObjects.find(h=>h.indicatorKey===a)}const l=s==null?void 0:s.chartSpec;return typeof l=="function"?l({col:i,row:t,dataValue:e._table.getCellOriginValue(i,t)||"",value:e._table.getCellValue(i,t)||"",rect:e._table.getCellRangeRelativeRect(e._table.getCellRange(i,t)),table:e._table}):l}function gV(i,t,e){var n,o;const r=e.getCellHeaderPaths(i,t);let s;if(e.indicatorsAsCol){const l=(n=r.colHeaderPaths.find(a=>a.indicatorKey))===null||n===void 0?void 0:n.indicatorKey;s=e.columnObjects.find(a=>a.indicatorKey===l)}else{const l=(o=r.rowHeaderPaths.find(a=>a.indicatorKey))===null||o===void 0?void 0:o.indicatorKey;s=e.columnObjects.find(a=>a.indicatorKey===l)}return typeof(s==null?void 0:s.chartSpec)!="function"}function fV(i,t,e){var n,o;const r=e.getCellHeaderPaths(i,t);let s;if(e.indicatorsAsCol){const l=(n=r.colHeaderPaths.find(a=>a.indicatorKey))===null||n===void 0?void 0:n.indicatorKey;s=e.columnObjects.find(a=>a.indicatorKey===l)}else{const l=(o=r.rowHeaderPaths.find(a=>a.indicatorKey))===null||o===void 0?void 0:o.indicatorKey;s=e.columnObjects.find(a=>a.indicatorKey===l)}return s==null?void 0:s.noDataRenderNothing}function Lh(i){let t=!1;for(let e=0;e<i.length;e++){const n=i[e];if(n.chartSpec&&n.chartSpec.type!=="wordCloud"&&n.chartSpec.type!=="radar"&&n.chartSpec.type!=="gauge"&&n.chartSpec.type!=="pie"&&n.chartSpec.type!=="funnel"&&n.chartSpec.type!=="rose"){t=!0;break}}return t}function pV(i,t,e){let n=!0;const o=e.getRawChartSpec(i,t);return o&&o.type!=="pie"&&o.type!=="radar"&&o.type!=="gauge"&&o.type!=="wordCloud"&&o.type!=="funnel"&&o.type!=="rose"||(n=!1),n}function Hl(i,t,e,n){let o=!1;if(n.indicatorsAsCol&&e==="row"||!n.indicatorsAsCol&&e==="col")for(let r=0;r<n.indicatorsDefine.length;r++){const s=n.indicatorsDefine[r];if(s.chartSpec&&s.chartSpec.type!=="pie"&&s.chartSpec.type!=="wordCloud"&&s.chartSpec.type!=="radar"&&s.chartSpec.type!=="gauge"&&s.chartSpec.type!=="funnel"&&s.chartSpec.type!=="rose"){o=!0;break}}else{const r=n.getRawChartSpec(i,t);r?r.type!=="pie"&&r.type!=="radar"&&r.type!=="gauge"&&r.type!=="wordCloud"&&r.type!=="funnel"&&r.type!=="rose"&&(o=!0):o=!1}return o}function mV(i,t,e){let n=e.getRawChartSpec(i,t);return n?(e._table.isPivotChart()&&(n=ho(n),n.sortDataByAxis=!0,lt(n.series)&&n.series.forEach(o=>{o.sortDataByAxis=!0}),n.type!=="gauge"&&n.type!=="rose"&&n.type!=="radar"&&(n.axes=e.getChartAxes(i,t)),n.padding=0,n.dataZoom=[]),n):null}function vV(i,t,e){var n,o,r;const s=[];if(e.indicatorsAsCol){const l=e.getIndicatorKeyInChartSpec(i,t).slice(0,2),a=e.getColKeysPath(i,t);l.forEach((m,b)=>{const{range:C,isZeroAlign:_,axisOption:w}=Rg(i,t,b,b===0?"bottom":"top",l,a,e);if(_){const y=Rg(i,t,l.length-1-b,b===0?"top":"bottom",l,a,e);if(y){const{range:S}=y,A=Bl(C,S);A&&(C.min=A.range1[0],C.max=A.range1[1])}}ft(w==null?void 0:w.min)&&(C.min=w.min),ft(w==null?void 0:w.max)&&(C.max=w.max),s.push(xt({range:C,label:{style:{fontSize:Ro}}},w,{type:(w==null?void 0:w.type)||"linear",orient:b===0?"bottom":"top",label:{visible:!1,flush:!0},title:{visible:!1},domainLine:{visible:!1},seriesIndex:w!=null&&w.seriesId?void 0:b,sync:{axisId:hT}}))});let h=e.getDimensionKeyInChartSpec(e.rowHeaderLevelCount,t);lt(h)&&(h=h[0]);const d=e.dataset.cacheCollectedValues[h]||e.dataset.collectedValues[h]||[],u=e.getRowKeysPath(i,t),c=d[u??""],{axisOption:g,isPercent:f,chartType:p}=Pl(i,t,"left",e);s.push(xt({domain:(g==null?void 0:g.type)!=="linear"||Array.isArray(c)?Array.from(c??[]):void 0,range:(g==null?void 0:g.type)!=="linear"||Array.isArray(c)?void 0:c,label:{style:{fontSize:Ro}}},g,{type:(n=g==null?void 0:g.type)!==null&&n!==void 0?n:"band",orient:"left",label:{visible:!1},domainLine:{visible:!1},tick:{visible:!1},subTick:{visible:!1},title:{visible:!1}}))}else{const l=e.getIndicatorKeyInChartSpec(i,t).slice(0,2),a=e.getRowKeysPath(i,t);l.forEach((m,b)=>{const{range:C,isZeroAlign:_,axisOption:w}=Rg(i,t,b,b===0?"left":"right",l,a,e);if(_){const y=Rg(i,t,l.length-1-b,b===0?"right":"left",l,a,e);if(y){const{range:S}=y,A=Bl(C,S);A&&(C.min=A.range1[0],C.max=A.range1[1])}}ft(w==null?void 0:w.min)&&(C.min=w.min),ft(w==null?void 0:w.max)&&(C.max=w.max),s.push(xt({range:C,label:{style:{fontSize:Ro}}},w,{type:(w==null?void 0:w.type)||"linear",orient:b===0?"left":"right",label:{visible:!1,flush:!0},title:{visible:!1},domainLine:{visible:!1},seriesIndex:w!=null&&w.seriesId?void 0:b,sync:{axisId:hT}}))});let h=e.getDimensionKeyInChartSpec(i,e.columnHeaderLevelCount);lt(h)&&(h=h[0]);const d=e.dataset.cacheCollectedValues[h]||e.dataset.collectedValues[h]||[],u=e.getColKeysPath(i,t),c=(o=d==null?void 0:d[u??""])!==null&&o!==void 0?o:[],{axisOption:g,isPercent:f,chartType:p}=Pl(i,t,"bottom",e);s.push(xt({domain:(g==null?void 0:g.type)!=="linear"||Array.isArray(c)?Array.from(c??[]):void 0,range:(g==null?void 0:g.type)!=="linear"||Array.isArray(c)?void 0:c,label:{style:{fontSize:Ro}}},g,{type:(r=g==null?void 0:g.type)!==null&&r!==void 0?r:"band",orient:"bottom",visible:!0,label:{visible:!1},domainLine:{visible:!1},tick:{visible:!1},subTick:{visible:!1},title:{visible:!1}}))}return s}function dT(i,t,e){var n;const o=e.getRawChartSpec(i,t);if(o!=null&&o.series){const r={};return!((n=o.data)===null||n===void 0)&&n.id&&(r[o.data.id]=void 0),o==null||o.series.forEach(s=>{var l,a,h,d,u,c,g,f,p,m,b;if(!(!((l=s.data)===null||l===void 0)&&l.fromDataId))if(!((a=s.data)===null||a===void 0)&&a.transforms)r[(b=(p=(f=s.data)===null||f===void 0?void 0:f.id)!==null&&p!==void 0?p:(m=o.data)===null||m===void 0?void 0:m.id)!==null&&b!==void 0?b:"data"]=void 0;else{const C=s.direction==="horizontal"?s.xField:s.yField;r[(c=(d=(h=s.data)===null||h===void 0?void 0:h.id)!==null&&d!==void 0?d:(u=o.data)===null||u===void 0?void 0:u.id)!==null&&c!==void 0?c:"data"]=!((g=s.data)===null||g===void 0)&&g.id?C:void 0}}),r}return o.data.id}function Rg(i,t,e,n,o,r,s){const{axisOption:l,isPercent:a,isZeroAlign:h,seriesIndice:d}=Pl(i,t,n,s),u=lv(s.dataset.collectedValues,o,h,r,d??e);if(a&&(u.min=u.min<0?-1:0,u.max=u.max>0?1:0),(l!=null&&l.zero||u.min===u.max)&&(u.min=Math.min(u.min,0),u.max=Math.max(u.max,0)),l==null?void 0:l.nice){const c=Bt.getFunction("getAxisDomainRangeAndLabels"),{range:g}=c(u.min,u.max,l,h,n==="bottom"||n==="top"?s._table.getColWidth(i)||s._table.tableNoFrameWidth:s._table.getRowHeight(t)||s._table.tableNoFrameHeight);u.min=g[0],u.max=g[1]}return ft(l==null?void 0:l.min)&&(u.min=l.min),ft(l==null?void 0:l.max)&&(u.max=l.max),{range:u,isZeroAlign:h,axisOption:l}}function uT(i){let t=!1;for(let e=0;e<i.columnObjects.length;e++)if(i.columnObjects[e].chartSpec){t=!0;break}return t}function bV(i,t,e){var n,o,r;if(i===-1||t===-1)return{start:{col:i,row:t},end:{col:i,row:t}};if(e._cellRangeMap.has(`$${i}$${t}`))return e._cellRangeMap.get(`$${i}$${t}`);let s={start:{col:i,row:t},end:{col:i,row:t}};if(e.transpose)s=yV(i,t,e);else if(e.headerLevelCount<=t){if(e.headerLevelCount<=t&&(!((o=(n=e.columnObjects[i-e.leftRowSeriesNumberColumnCount])===null||n===void 0?void 0:n.define)===null||o===void 0)&&o.mergeCell)){const l=e._table.getCellValue(i,t);for(let a=t-1;a>=e.headerLevelCount;a--){const h=e._table.getCellValue(i,a);if(typeof e.columnObjects[i-e.leftRowSeriesNumberColumnCount].define.mergeCell=="boolean"){if(l!==h)break}else if(!e.columnObjects[i-e.leftRowSeriesNumberColumnCount].define.mergeCell(l,h))break;s.start.row=a}for(let a=t+1;a<e.rowCount;a++){const h=e._table.getCellValue(i,a);if(typeof e.columnObjects[i-e.leftRowSeriesNumberColumnCount].define.mergeCell=="boolean"){if(l!==h)break}else if(!e.columnObjects[i-e.leftRowSeriesNumberColumnCount].define.mergeCell(l,h))break;s.end.row=a}}CV(i,t,s,e)}else{const l=e.getCellId(i,t);for(let a=i-1;a>=0&&l===e.getCellId(a,t);a--)s.start.col=a;for(let a=i+1;a<((r=e.colCount)!==null&&r!==void 0?r:0)&&l===e.getCellId(a,t);a++)s.end.col=a;for(let a=t-1;a>=0&&l===e.getCellId(i,a);a--)s.start.row=a;for(let a=t+1;a<e.headerLevelCount&&l===e.getCellId(i,a);a++)s.end.row=a}return e._cellRangeMap.set(`$${i}$${t}`,s),s}function CV(i,t,e,n){if(n.rowHierarchyType!=="tree")return;const o=n._table.getCellRawRecord(i,t);o!=null&&o.vtableMerge&&(e.start.col=n.rowHeaderLevelCount,e.end.col=n.colCount-1,e.start.row=e.end.row=t)}function yV(i,t,e){var n,o,r,s;const l={start:{col:i,row:t},end:{col:i,row:t}};if(e.headerLevelCount+e.leftRowSeriesNumberColumnCount<=i||i===-1&&t===-1){if(e.headerLevelCount+e.leftRowSeriesNumberColumnCount<=i&&(!((o=(n=e.columnObjects[t])===null||n===void 0?void 0:n.define)===null||o===void 0)&&o.mergeCell)){const h=e._table.getCellValue(i,t);for(let d=i-1;d>=e.headerLevelCount+e.leftRowSeriesNumberColumnCount;d--){const u=e._table.getCellValue(d,t);if(typeof e.columnObjects[t].define.mergeCell=="boolean"){if(h!==u)break}else if(!e.columnObjects[t].define.mergeCell(h,u))break;l.start.col=d}for(let d=i+1;d<((r=e.colCount)!==null&&r!==void 0?r:0);d++){const u=e._table.getCellValue(d,t);if(typeof e.columnObjects[t].define.mergeCell=="boolean"){if(h!==u)break}else if(!e.columnObjects[t].define.mergeCell(h,u))break;l.end.col=d}}return l}const a=e.getCellId(i,t);for(let h=t-1;h>=0&&a===e.getCellId(i,h);h--)l.start.row=h;for(let h=t+1;h<((s=e.rowCount)!==null&&s!==void 0?s:0)&&a===e.getCellId(i,h);h++)l.end.row=h;for(let h=i-1;h>=0&&a===e.getCellId(h,t);h--)l.start.col=h;for(let h=i+1;h<e.headerLevelCount+e.leftRowSeriesNumberColumnCount&&a===e.getCellId(h,t);h++)l.end.col=h;return l}class _V{constructor(t,e,n,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=n,this._table=t,this._columns=[],this._columnsIncludeHided=[],this._headerCellIds=[],this.hierarchyIndent=o??20,this.hierarchyTextStartAlignment=t.options.hierarchyTextStartAlignment,this.columnTree=new Pe(e,{seqId:0}),this._headerObjectsIncludeHided=this._addHeaders(0,e,[]),this._headerObjects=this._headerObjectsIncludeHided.filter(r=>r.define.hide!==!0),this._headerObjectMap=this._headerObjects.reduce((r,s)=>(r[s.id]=s,r),{}),this.rowHierarchyType=P8(this)?"tree":"grid",this._hasAggregation=T8(this),this._hasAggregationOnBottomCount=B8(this),this._hasAggregationOnTopCount=M8(this),this.handleRowSeriesNumber(t.internalProps.rowSeriesNumber)}handleRowSeriesNumber(t){var e,n;t&&(Array.isArray(t)?this.rowSeriesNumberColumn=t.map(o=>{var r,s;return{id:this.seqId++,title:o.title,define:o,cellType:(r=o.cellType)!==null&&r!==void 0?r:"text",headerType:(s=t.cellType)!==null&&s!==void 0?s:"text",style:o.style,width:o.width,format:o.format,field:o.field,icon:o.icon,headerIcon:o.headerIcon,isChildNode:!1}}):this.rowSeriesNumberColumn=[{id:this.seqId++,title:t.title,define:t,cellType:(e=t.cellType)!==null&&e!==void 0?e:"text",headerType:(n=t.cellType)!==null&&n!==void 0?n:"text",style:t.style,width:t.width,format:t.format,field:"",icon:t.icon,headerIcon:t.headerIcon,isChildNode:!1}],this.leftRowSeriesNumberColumn=this.rowSeriesNumberColumn.filter(o=>!0),this.rightRowSeriesNumberColumn=this.rowSeriesNumberColumn.filter(o=>!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){return!!(this.leftRowSeriesNumberColumnCount>0&&t>=0&&t<this.leftRowSeriesNumberColumnCount&&(this.transpose||e>=this.headerLevelCount)||this.rightRowSeriesNumberColumnCount>0&&t>=this.colCount-this.rightRowSeriesNumberColumnCount&&(this.transpose||e>=this.headerLevelCount))}isSeriesNumber(t,e){return!!(z(t)&&z(e)&&(this.leftRowSeriesNumberColumnCount>0&&t>=0&&e>=0&&t<this.leftRowSeriesNumberColumnCount||this.rightRowSeriesNumberColumnCount>0&&e>=0&&t>=this.colCount-this.rightRowSeriesNumberColumnCount))}getSeriesNumberHeader(t,e){if(this.leftRowSeriesNumberColumnCount>0&&t>=0&&t<this.leftRowSeriesNumberColumnCount){if(this.transpose)return;if(e<this.headerLevelCount)return Object.assign({},this.leftRowSeriesNumberColumn[t],{style:this._table.internalProps.rowSeriesNumber.headerStyle})}if(this.rightRowSeriesNumberColumnCount>0&&t>=this.colCount-this.rightRowSeriesNumberColumnCount&&e<this.headerLevelCount){if(this.transpose)return;if(e<this.headerLevelCount)return this.rightRowSeriesNumberColumn[t-(this.colCount-this.rightRowSeriesNumberColumnCount)]}}getSeriesNumberBody(t,e){if(this.leftRowSeriesNumberColumnCount>0&&t>=0&&t<this.leftRowSeriesNumberColumnCount){if(this.transpose)return this.leftRowSeriesNumberColumn[t];if(e>=this.headerLevelCount)return this.leftRowSeriesNumberColumn[t]}if(this.rightRowSeriesNumberColumnCount>0&&t>=this.colCount-this.rightRowSeriesNumberColumnCount){if(this.transpose)return this.rightRowSeriesNumberColumn[t-(this.colCount-this.rightRowSeriesNumberColumnCount)];if(e>=this.headerLevelCount)return this.rightRowSeriesNumberColumn[t-(this.colCount-this.rightRowSeriesNumberColumnCount)]}}isHeader(t,e){return!!(this.transpose&&t>=this.leftRowSeriesNumberColumnCount&&t<this.headerLevelCount+this.leftRowSeriesNumberColumnCount)||!this.transpose&&e>=0&&e<this.headerLevelCount}isAggregation(t,e){if(this.hasAggregation){if(this.hasAggregationOnBottomCount){if(this.transpose){if(t>=this.colCount-this.hasAggregationOnBottomCount)return!0}else if(e>=this.rowCount-this.hasAggregationOnBottomCount)return!0}if(this.hasAggregationOnTopCount){if(this.transpose){if(t>=this.rowHeaderLevelCount&&t<this.rowHeaderLevelCount+this.hasAggregationOnTopCount)return!0}else if(e>=this.columnHeaderLevelCount&&e<this.columnHeaderLevelCount+this.hasAggregationOnTopCount)return!0}}return!1}isTopAggregation(t,e){if(this.hasAggregationOnTopCount){if(this.transpose){if(t>=this.rowHeaderLevelCount&&t<this.rowHeaderLevelCount+this.hasAggregationOnTopCount)return!0}else if(e>=this.columnHeaderLevelCount&&e<this.columnHeaderLevelCount+this.hasAggregationOnTopCount)return!0}return!1}isBottomAggregation(t,e){if(this.hasAggregationOnBottomCount){if(this.transpose){if(t>=this.colCount-this.hasAggregationOnBottomCount)return!0}else if(e>=this.rowCount-this.hasAggregationOnBottomCount)return!0}return!1}get hasAggregation(){return this._hasAggregation}get hasAggregationOnTopCount(){return this._hasAggregationOnTopCount}get hasAggregationOnBottomCount(){return this._hasAggregationOnBottomCount}getAggregatorsByCell(t,e){return this.getColumnDefine(t,e).vtable_aggregator}getAggregatorsByCellRange(t,e,n,o){let r=[];if(!this.transpose){for(let s=t;s<=n;s++){const l=this.getColumnDefine(s,e);l.vtable_aggregator&&(r=r.concat(Array.isArray(l.vtable_aggregator)?l.vtable_aggregator:[l.vtable_aggregator]))}return r}for(let s=e;s<=o;s++){const l=this.getColumnDefine(t,s);l.vtable_aggregator&&(r=r.concat(Array.isArray(l.vtable_aggregator)?l.vtable_aggregator:[l.vtable_aggregator]))}return[]}getAggregatorOnTop(t,e){const n=this.getColumnDefine(t,e),o=n.vtable_aggregator,r=n.aggregation;if(Array.isArray(r)){const s=r.reduce((l,a,h)=>(a.showOnTop&&l.push(h),l),[]).map(l=>o[l]);return this.transpose?s[t-this.rowHeaderLevelCount]:s[e-this.columnHeaderLevelCount]}return this.transpose&&t-this.rowHeaderLevelCount==0?r!=null&&r.showOnTop?o:null:this.transpose||e-this.columnHeaderLevelCount!=0?null:r!=null&&r.showOnTop?o:null}getAggregatorOnBottom(t,e){const n=this.getColumnDefine(t,e),o=n.vtable_aggregator,r=n.aggregation;if(Array.isArray(r)){const s=r.reduce((l,a,h)=>(a.showOnTop||l.push(h),l),[]).map(l=>o[l]);return this.transpose?s[t-(this.colCount-this.hasAggregationOnBottomCount)]:s[e-(this.rowCount-this.hasAggregationOnBottomCount)]}return this.transpose&&t-(this.colCount-this.hasAggregationOnBottomCount)==0?r!=null&&r.showOnTop?null:o:this.transpose||e-(this.rowCount-this.hasAggregationOnBottomCount)!=0||r!=null&&r.showOnTop?null:o}getAggregatorCellAddress(t,e,n,o){const r=[],s=this.hasAggregationOnTopCount,l=this.hasAggregationOnBottomCount;if(this.transpose){for(let a=e;a<=o;a++)if(this.getColumnDefine(t,a).vtable_aggregator){for(let h=0;h<s;h++)r.push({col:this.headerLevelCount+h,row:a});for(let h=0;h<l;h++)r.push({col:this.rowCount-l+h,row:a})}}else for(let a=t;a<=n;a++)if(this.getColumnDefine(a,e).vtable_aggregator){for(let h=0;h<s;h++)r.push({col:a,row:this.headerLevelCount+h});for(let h=0;h<l;h++)r.push({col:a,row:this.rowCount-l+h})}return r}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(z(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(z(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(z(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(z(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}isLeftTopCorner(t,e){return t>=0&&t<this.frozenColCount&&e>=0&&e<this.frozenRowCount}isLeftBottomCorner(t,e){return t>=0&&t<this.frozenColCount&&e>=this.rowCount-this.bottomFrozenRowCount}isRightTopCorner(t,e){return t>=this.colCount-this.rightFrozenColCount&&e>=0&&e<this.frozenRowCount}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:((t=this.rowCount)!==null&&t!==void 0?t:0)-1}}:{start:{col:0,row:0},end:{col:((e=this.colCount)!==null&&e!==void 0?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:((t=this.rowCount)!==null&&t!==void 0?t:0)-1}}:{start:{col:0,row:0},end:{col:((e=this.colCount)!==null&&e!==void 0?e:0)-1,row:this._headerCellIds.length-1}}}getCornerHeaderRange(){}getBodyRange(){var t,e,n,o;return this.transpose?{start:{col:this.headerLevelCount,row:0},end:{col:((t=this.colCount)!==null&&t!==void 0?t:0)-1,row:((e=this.rowCount)!==null&&e!==void 0?e:0)-1}}:{start:{col:0,row:this.headerLevelCount},end:{col:((n=this.colCount)!==null&&n!==void 0?n:0)-1,row:((o=this.rowCount)!==null&&o!==void 0?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(e=>({width:e.width,minWidth:e.minWidth,maxWidth:e.maxWidth}));return t.push(...this._columns.map(e=>({width:e.width,minWidth:e.minWidth,maxWidth:e.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 n,o,r=0;if(t>=this.rowHeaderLevelCount+this.leftRowSeriesNumberColumnCount){let s;return this.columnObjects.forEach((l,a)=>{typeof l.width=="number"?r=Math.max(l.width,r):l.width==="auto"&&(s=!0),typeof l.minWidth=="number"&&(o=Math.max(l.minWidth,o)),typeof l.maxWidth=="number"&&(n=Math.max(l.maxWidth,n))}),r=r>0?r:s?"auto":void 0,{width:r,minWidth:o,maxWidth:n}}if(this.isRowHeader(t,0)){const s=Array.isArray(this._table.defaultHeaderColWidth)?(e=this._table.defaultHeaderColWidth[t])!==null&&e!==void 0?e:this._table.defaultColWidth:this._table.defaultHeaderColWidth;return s==="auto"?{width:"auto"}:{width:s}}}return this._columns[t-this.leftRowSeriesNumberColumnCount]}}getCellId(t,e){var n,o,r,s;return this.transpose?t>=this.headerLevelCount+this.leftRowSeriesNumberColumnCount?(n=this._columns[e])===null||n===void 0?void 0:n.id:this.isSeriesNumber(t,e)?e+"_series_number":(o=this._headerCellIds[t-this.leftRowSeriesNumberColumnCount])===null||o===void 0?void 0:o[e]:this.isSeriesNumber(t,e)?this.rowSeriesNumberColumn[t].id:this.headerLevelCount<=e?(r=this._columns[t-this.leftRowSeriesNumberColumnCount])===null||r===void 0?void 0:r.id:(s=this._headerCellIds[e])===null||s===void 0?void 0:s[t-this.leftRowSeriesNumberColumnCount]}getHeader(t,e){if(this.isSeriesNumberInHeader(t,e))return this.getSeriesNumberHeader(t,e);const n=this.getCellId(t,e);return this._headerObjectMap[n]}getHeaderField(t,e){var n;const o=this.getCellId(t,e);return((n=this._headerObjectMap[o])===null||n===void 0?void 0:n.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 n=this._headerCellIds[e];for(let o=0;o<n.length;o++)if(n[o]===t)return this.transpose?{col:e,row:o}:{col:o+this.leftRowSeriesNumberColumnCount,row:e}}}getHeaderCellAddressByField(t){const e=this.headerObjects.find(n=>n&&n.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,n;if(this.transpose){for(let o=0;o<((e=this.rowCount)!==null&&e!==void 0?e:0);o++)if(t===this._columns[o].id)return{start:{col:0,row:o},end:{col:0,row:o}}}else for(let o=this.leftRowSeriesNumberColumnCount;o<((n=this.colCount)!==null&&n!==void 0?n:0);o++)if(t===this._columns[o-this.leftRowSeriesNumberColumnCount].id)return{start:{col:o,row:0},end:{col:o,row:0}};return{start:{col:-1,row:-1},end:{col:-1,row:-1}}}getCellRange(t,e){return bV(t,e,this)}isCellRangeEqual(t,e,n,o){const r=this.getCellRange(t,e),s=this.getCellRange(n,o);return r.start.col===s.start.col&&r.end.col===s.end.col&&r.start.row===s.start.row&&r.end.row===s.end.row}getRecordShowIndexByCell(t,e){const n=this.hasAggregationOnTopCount?this.headerLevelCount+1:this.headerLevelCount;return this.transpose?t<n?-1:t-n:e<n?-1:e-n}getRecordStartRowByRecordIndex(t){return(this.hasAggregationOnTopCount?this.headerLevelCount+1:this.headerLevelCount)+t}_addHeaders(t,e,n,o){const r=[],s=this._newRow(t,o);return e.forEach(l=>{var a,h,d,u;const c=this._columns.length,g=this.seqId++,f={id:g,title:(a=l.title)!==null&&a!==void 0?a:l.caption,headerIcon:l.headerIcon,field:l.field,style:l.headerStyle,headerType:(h=l.headerType)!==null&&h!==void 0?h:"text",dropDownMenu:l.dropDownMenu,define:l,columnWidthComputeMode:l.columnWidthComputeMode};r[g]=f;for(let p=t-1;p>=0;p--)this._headerCellIds[p]&&(this._headerCellIds[p][c]=n[p]);if(o?this._headerCellIds[t-1]&&(s[c]=this._headerCellIds[t-1][c]):s[c]=g,l.columns)this._addHeaders(t+1,l.columns,[...n,g],l.hideColumnsSubHeader||o).forEach(p=>r.push(p));else{const p={id:this.seqId++,field:l.field,fieldFormat:l.fieldFormat,width:l.width,minWidth:l.minWidth,maxWidth:l.maxWidth,icon:l.icon,cellType:(u=(d=l.cellType)!==null&&d!==void 0?d:l.columnType)!==null&&u!==void 0?u:"text",chartModule:"chartModule"in l?l.chartModule:null,chartSpec:"chartSpec"in l?l.chartSpec:null,sparklineSpec:"sparklineSpec"in l?l.sparklineSpec:z4,style:l.style,define:l,columnWidthComputeMode:l.columnWidthComputeMode,disableColumnResize:l==null?void 0:l.disableColumnResize,aggregation:l.aggregation,isChildNode:t>=1};if(this._columnsIncludeHided.push(p),l.hide!==!0){this._columns.push(p);for(let m=t+1;m<this._headerCellIds.length;m++)this._headerCellIds[m][c]=g}}}),r}_newRow(t,e=!1){if(this._headerCellIds[t]){const r=this._headerCellIds[t-1];if(r.length>this._headerCellIds[t].length)for(let s=this._headerCellIds[t].length;s<r.length;s++)this._headerCellIds[t][s]=r[s];return this._headerCellIds[t]}if(e)return[];const n=this._headerCellIds[t]=[];if(!this._columns.length)return n;const o=this._headerCellIds[t-1];for(let r=0;r<o.length;r++)n[r]=o[r];return n}getCellHeaderPaths(t,e){if(this.isSeriesNumber(t,e))return;let n=[],o=[];return this.transpose?o=[{field:this._columns[e].field}]:n=[{field:this._columns[t-this.leftRowSeriesNumberColumnCount].field}],{colHeaderPaths:n,rowHeaderPaths:o,cellLocation:this.getCellLocation(t,e)}}getParentCellId(t,e){if(e!==0){if(this.isColumnHeader(t,e))return this.getCellId(t,e-1);if(this.isRowHeader(t,e))return this.isSeriesNumberInBody(t-1,e)?void 0: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 o=this.getRecordShowIndexByCell(0,t.row),r=this.getRecordShowIndexByCell(0,e.row);return this._table.dataSource.isCanExchangeOrder(o,r)}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||this._table.internalProps.frozenColDragHeaderMode==="disabled"&&this._table.isFrozenColumn(e.col))return!1;const n=this.getCellRange(t.col,t.row);return this.isColumnHeader(t.col,t.row)?this.getParentCellId(t.col,n.start.row)===this.getParentCellId(e.col,n.start.row):this.isRowHeader(t.col,t.row)?this.getParentCellId(n.start.col,t.row)===this.getParentCellId(n.start.col,e.row):!1}moveHeaderPosition(t,e){if(this.canMoveHeaderPosition(t,e)){let n=this.getCellRange(t.col,t.row);if(this.isColumnHeader(t.col,t.row)){const o=n.end.col-n.start.col+1;let r;const s=this.getCellRange(e.col,n.start.row);if(r=e.col>=t.col?s.end.col-o+1:s.start.col,r===n.start.col)return null;for(let a=0;a<this._headerCellIds.length;a++){const h=this._headerCellIds[a].splice(n.start.col-this.leftRowSeriesNumberColumnCount,o);h.unshift(r-this.leftRowSeriesNumberColumnCount,0),Array.prototype.splice.apply(this._headerCellIds[a],h)}const l=this._columns.splice(n.start.col-this.leftRowSeriesNumberColumnCount,o);return l.unshift(r-this.leftRowSeriesNumberColumnCount,0),Array.prototype.splice.apply(this._columns,l),this.columnTree.movePosition(n.start.row,n.start.col-this.leftRowSeriesNumberColumnCount,r-this.leftRowSeriesNumberColumnCount),this.columnTree.reset(this.columnTree.tree.children,!0),this._cellRangeMap=new Map,{sourceIndex:n.start.col,targetIndex:r,sourceSize:o,targetSize:s.end.col-s.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)&&(n=this.getCellRange(t.col+this.leftRowSeriesNumberColumnCount,t.row));const o=n.end.row-n.start.row+1;let r;const s=this.getCellRange(n.start.col,e.row);if(r=e.row>=t.row?s.end.row-o+1:s.start.row,r===n.start.row)return null;for(let a=0;a<this._headerCellIds.length;a++){const h=this._headerCellIds[a].splice(n.start.row,o);h.unshift(r,0),Array.prototype.splice.apply(this._headerCellIds[a],h)}const l=this._columns.splice(n.start.row,o);return l.unshift(r,0),Array.prototype.splice.apply(this._columns,l),this.columnTree.movePosition(n.start.col-this.leftRowSeriesNumberColumnCount,n.start.row,r+(e.row>t.row?n.end.row-n.start.row:0)),this.columnTree.reset(this.columnTree.tree.children,!0),this._cellRangeMap=new Map,{sourceIndex:n.start.row,targetIndex:r,sourceSize:o,targetSize:s.end.row-s.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(e=>({col:0,row:this._table.columnHeaderLevelCount+e})),removeCellPositions:t.remove.map(e=>({col:0,row:this._table.columnHeaderLevelCount+e}))}}setChartInstance(t,e,n){const o=this.transpose?this._columns[e]:this._columns[t-this.leftRowSeriesNumberColumnCount];typeof o.chartSpec!="function"&&(o.chartInstance=n)}getChartInstance(t,e){return(this.transpose?this._columns[e]:this._columns[t-this.leftRowSeriesNumberColumnCount]).chartInstance}checkHasChart(){return uT(this)}getAxisConfigInPivotChart(t,e){}isEmpty(t,e){return!1}isAxisCell(t,e){return!1}getChartAxes(t,e){return[]}isShareChartSpec(t,e){const n=this.getBody(t,e);return typeof(n==null?void 0:n.chartSpec)!="function"}isNoChartDataRenderNothing(t,e){const n=this.getBody(t,e);return(n==null?void 0:n.define).noDataRenderNothing}getChartSpec(t,e){return this.getRawChartSpec(t,e)}getRawChartSpec(t,e){const n=this.getBody(t,e),o=n==null?void 0:n.chartSpec;return typeof o=="function"?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 dT(t,e,this)}release(){const t=this._table._getActiveChartInstance();t==null||t.release(),this.columnObjects.forEach(e=>{var n;(n=e.chartInstance)===null||n===void 0||n.release()})}clearCellRangeMap(){this._cellRangeMap.clear()}updateColumnTitle(t,e,n){const o=this._table.internalProps.layoutMap.getHeader(t,e);o.title=n,o.define.title=n}getColumnByField(t){var e;return(e=this.columnObjects)===null||e===void 0?void 0:e.reduce((n,o,r)=>(o.field===t&&n.push({col:r,columnDefine:o}),n),[])}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 cT{constructor(t){this.isValidatingValue=!1,this.table=t,this.bindEvent()}bindEvent(){this.table.internalProps.handler;const t=this.table.options.editCellTrigger;this.table.on(at.DBLCLICK_CELL,e=>{var n;if(!t||t==="doubleclick"||Array.isArray(t)&&t.includes("doubleclick")){const{col:o,row:r}=e,s=Ai(e.federatedEvent),l=this.table.scenegraph.getResizeColAt(s.abstractPos.x,s.abstractPos.y,(n=s.eventArgs)===null||n===void 0?void 0:n.targetCell);if(this.table._canResizeColumn(l.col,l.row)&&l.col>=0)return;this.startEditCell(o,r)}}),this.table.on(at.CLICK_CELL,e=>{if(t==="click"||Array.isArray(t)&&t.includes("click")){const{col:n,row:o}=e;this.startEditCell(n,o)}})}startEditCell(t,e,n){var o,r,s,l,a;if(this.editingEditor)return;const h=this.table.getEditor(t,e);if(h){if(!((r=(o=this.table.internalProps.layoutMap)===null||o===void 0?void 0:o.isAggregation)===null||r===void 0)&&r.call(o,t,e))return;this.editingEditor||(this.editCell={col:t,row:e}),this.editingEditor=h;const d=z(n)?n:this.table.getCellOriginValue(t,e),u=this.table.getCellRangeRelativeRect(this.table.getCellRange(t,e)),c={rect:{left:u.left,top:u.top,width:u.width,height:u.height}};h.beginEditing,(s=h.beginEditing)===null||s===void 0||s.call(h,this.table.getElement(),c,d),h.bindSuccessCallback,(l=h.bindSuccessCallback)===null||l===void 0||l.call(h,()=>{this.completeEdit()}),(a=h.onStart)===null||a===void 0||a.call(h,{value:d,endEdit:()=>{this.completeEdit()},referencePosition:c,container:this.table.getElement(),col:t,row:e})}}completeEdit(t){var e,n;if(!this.editingEditor)return!0;if(this.isValidatingValue)return!1;const o=t==null?void 0:t.target,{editingEditor:r}=this;if(o){if(r.targetIsOnEditor){if(r.targetIsOnEditor(o))return!1}else if(!r.isEditorElement||r.isEditorElement(o))return!1}if(this.editingEditor.getValue,this.editingEditor.validateValue){this.isValidatingValue=!0;const s=(n=(e=this.editingEditor).validateValue)===null||n===void 0?void 0:n.call(e);return so(s)?new Promise((l,a)=>{s.then(h=>{h?(this.doExit(),l(!0)):(this.isValidatingValue=!1,l(!1))}).catch(h=>{this.isValidatingValue=!1,a(h)})}):!!s&&(this.doExit(),!0)}return this.doExit(),!0}doExit(){var t,e,n,o,r,s;const l=(e=(t=this.editingEditor).getValue)===null||e===void 0?void 0:e.call(t),a=this.table.getCellRange(this.editCell.col,this.editCell.row),h=[];for(let d=a.start.row;d<=a.end.row;d++){const u=[];for(let c=a.start.col;c<=a.end.col;c++)u.push(l);h.push(u)}this.table.changeCellValues(a.start.col,a.start.row,h),this.editingEditor.exit,(o=(n=this.editingEditor).exit)===null||o===void 0||o.call(n),(s=(r=this.editingEditor).onEnd)===null||s===void 0||s.call(r),this.editingEditor=null,this.isValidatingValue=!1}cancelEdit(){var t,e,n,o;this.editingEditor&&((e=(t=this.editingEditor).exit)===null||e===void 0||e.call(t),(o=(n=this.editingEditor).onEnd)===null||o===void 0||o.call(n),this.editingEditor=null)}}function gT(i){return ce(i)?{groupByRules:[i]}:lt(i)?{groupByRules:i.map(t=>ce(t)?t:t.key)}:{}}function wV(i,t,e,n,o){if(n&&o.isHasEditorDefine(i,t)||n===!1){const r=o.getRecordShowIndexByCell(i,t),{field:s}=o.internalProps.layoutMap.getBody(i,t),l=o.getCellRawValue(i,t),a=o.getCellOriginValue(i,t);o.isHeader(i,t)?o.internalProps.layoutMap.updateColumnTitle(i,t,e):o.dataSource.changeFieldValue(e,r,s,i,t,o);const h=o.getCellRange(i,t),d=o.internalProps.layoutMap.getAggregatorsByCell(i,t);if(d){if(Array.isArray(d))for(let c=0;c<(d==null?void 0:d.length);c++)d[c].recalculate();else d.recalculate();const u=o.internalProps.layoutMap.getAggregatorCellAddress(h.start.col,h.start.row,h.end.col,h.end.row);for(let c=0;c<u.length;c++){const g=o.getCellRange(u[c].col,u[c].row);for(let f=g.start.col;f<=g.end.col;f++)for(let p=g.start.row;p<=g.end.row;p++)o.scenegraph.updateCellContent(f,p)}}for(let u=h.start.col;u<=h.end.col;u++)for(let c=h.start.row;c<=h.end.row;c++)o.scenegraph.updateCellContent(u,c);if(o.widthMode==="adaptive"||o.autoFillWidth&&o.getAllColsWidth()<=o.tableNoFrameWidth)o.internalProps._widthResizedColMap.size===0&&o.scenegraph.recalculateColWidths();else if(!o.internalProps._widthResizedColMap.has(i)){const u=o.getColWidth(i),c=Fr(i,0,o.rowCount-1,o,!1);c!==u&&o.scenegraph.updateColWidth(i,c-u)}if(o.heightMode==="adaptive"||o.autoFillHeight&&o.getAllRowsHeight()<=o.tableNoFrameHeight)o.internalProps._heightResizedRowMap.size===0&&o.scenegraph.recalculateRowHeights();else if(o.heightMode==="autoHeight"&&!o.internalProps._heightResizedRowMap.has(t)){const u=o.getRowHeight(t),c=nn(t,0,o.colCount-1,o);o.scenegraph.updateRowHeight(t,c-u)}o.fireListeners(at.CHANGE_CELL_VALUE,{col:i,row:t,rawValue:l,currentValue:a,changedValue:o.getCellOriginValue(i,t)}),o.scenegraph.updateNextFrame()}}function SV(i,t,e,n,o){var r,s;let l=i,a=t;const h=[],d=[];let u;for(let p=0;p<e.length&&!(t+p>o.rowCount-1);p++){const m=e[p],b=[],C=[];h.push(b),d.push(C);for(let _=0;_<m.length&&!(i+_>o.colCount-1);_++){u=xV(i+_,t+p,o,u);const w=o.getCellRawValue(i+_,t+p);b.push(w);const y=o.getCellOriginValue(i+_,t+p);C.push(y)}}for(let p=0;p<e.length&&!(t+p>o.rowCount-1);p++){a=t+p;const m=e[p];let b=i;for(let C=0;C<m.length&&!(i+C>o.colCount-1);C++){b=i+C;let _=!1;if(n===!1)_=!0;else if(o.isHasEditorDefine(i+C,t+p)){const w=o.getEditor(i+C,t+p),y=d[p][C],S=m[C],A=(s=(r=w==null?void 0:w.validateValue)===null||r===void 0?void 0:r.call(w,S,y))===null||s===void 0||s;_=!!so(A)||A}if(_){const w=m[C],y=o.getRecordShowIndexByCell(i+C,t+p),{field:S}=o.internalProps.layoutMap.getBody(i+C,t+p),A=h[p][C],R=d[p][C];o.isHeader(i+C,t+p)?o.internalProps.layoutMap.updateColumnTitle(i+C,t+p,w):o.dataSource.changeFieldValue(w,y,S,i+C,t+p,o),o.fireListeners(at.CHANGE_CELL_VALUE,{col:i+C,row:t+p,rawValue:A,currentValue:R,changedValue:o.getCellOriginValue(i+C,t+p)})}}l=Math.max(l,b)}const c=o.getCellRange(i,t),g=o.getCellRange(l,a),f=o.internalProps.layoutMap.getAggregatorsByCellRange(c.start.col,c.start.row,g.end.col,g.end.row);if(f){for(let p=0;p<(f==null?void 0:f.length);p++)f[p].recalculate();if(u==="normal"){const p=o.internalProps.layoutMap.getAggregatorCellAddress(c.start.col,c.start.row,g.end.col,g.end.row);for(let m=0;m<p.length;m++){const b=o.getCellRange(p[m].col,p[m].row);for(let C=b.start.col;C<=b.end.col;C++)for(let _=b.start.row;_<=b.end.row;_++)o.scenegraph.updateCellContent(C,_)}}}if(u==="group"&&o.dataSource.updateRecordsForGroup([],[]),u==="sort"||u==="group")return o.dataSource.sortedIndexMap.clear(),El(o),o.refreshRowColCount(),o.internalProps.layoutMap.clearCellRangeMap(),o.scenegraph.clearCells(),void o.scenegraph.createSceneGraph();for(let p=c.start.col;p<=g.end.col;p++)for(let m=c.start.row;m<=g.end.row;m++)o.scenegraph.updateCellContent(p,m);if(o.widthMode==="adaptive"||o.autoFillWidth&&o.getAllColsWidth()<=o.tableNoFrameWidth)o.internalProps._widthResizedColMap.size===0&&o.scenegraph.recalculateColWidths();else for(let p=i;p<=g.end.col;p++)if(!o.internalProps._widthResizedColMap.has(p)){const m=o.getColWidth(p),b=Fr(p,0,o.rowCount-1,o,!1);b!==m&&o.scenegraph.updateColWidth(p,b-m)}if(o.heightMode==="adaptive"||o.autoFillHeight&&o.getAllRowsHeight()<=o.tableNoFrameHeight)o.scenegraph.recalculateRowHeights();else if(o.heightMode==="autoHeight"){const p=[],m=[];for(let b=t;b<=g.end.row;b++)if(o.rowHeightsMap.get(b)){const C=o.getRowHeight(b),_=nn(b,0,o.colCount-1,o);p.push(b),m.push(_-C)}o.scenegraph.updateRowsHeight(p,m)}o.scenegraph.updateNextFrame()}function xV(i,t,e,n){if(n==="group"||n==="sort"&&!e.options.groupBy)return n;let o="normal";return e.options.groupBy?o="group":!e.isHeader(i,t)&&e.dataSource.lastOrderField&&e.getBodyField(i,t)===e.dataSource.lastOrderField&&(o="sort"),o}function El(i){let t=i.sortState;t=!t||Array.isArray(t)?t:[t],t&&(t=t.map(e=>{var n;return e.orderFn=(n=i._getSortFuncFromHeaderOption(void 0,e.field))!==null&&n!==void 0?n:sm,e}),i.dataSource.sort(t))}function RV(i,t,e){var n,o;if(e.options.groupBy)(o=(n=e.dataSource).addRecordsForGroup)===null||o===void 0||o.call(n,[i],t),e.refreshRowColCount(),e.internalProps.layoutMap.clearCellRangeMap(),e.scenegraph.clearCells(),e.scenegraph.createSceneGraph();else if(e.sortState)e.dataSource.addRecordForSorted(i),El(e),e.refreshRowColCount(),e.scenegraph.clearCells(),e.scenegraph.createSceneGraph();else{(t===void 0||t>e.dataSource.sourceLength)&&(t=e.dataSource.sourceLength);const r=e.transpose?e.rowHeaderLevelCount:e.columnHeaderLevelCount;e.dataSource.addRecord(i,t);const s=e.rowCount;if(e.refreshRowColCount(),e.scenegraph.proxy.totalActualBodyRowCount===0)return e.scenegraph.clearCells(),void e.scenegraph.createSceneGraph();const l=e.transpose?e.colCount:e.rowCount;if(e.pagination){const{perPageCount:a,currentPage:h}=e.pagination,d=a*(h||0)+a;if(t<d)if(t<d-a)e.scenegraph.clearCells(),e.scenegraph.createSceneGraph();else{const u=t-(d-a)+r;if(s-r===e.pagination.perPageCount){const c=[];for(let g=u;g<l;g++)e.transpose?c.push({col:g,row:0}):c.push({col:0,row:g});e.transpose?e.scenegraph.updateCol([],[],c):e.scenegraph.updateRow([],[],c)}else{const c=[];for(let g=u;g<Math.min(l,u+1);g++)e.transpose?c.push({col:g,row:0}):c.push({col:0,row:g});e.transpose?e.scenegraph.updateCol([],c,[]):e.scenegraph.updateRow([],c,[])}}}else{const a=[];for(let c=t+r;c<t+r+1;c++)e.transpose?a.push({col:c,row:0}):a.push({col:0,row:c});const h=[],d=e.internalProps.layoutMap.hasAggregationOnTopCount,u=e.internalProps.layoutMap.hasAggregationOnBottomCount;for(let c=r;c<r+d;c++)e.transpose?h.push({col:c,row:0}):h.push({col:0,row:c});for(let c=(e.transpose?e.colCount:e.rowCount)-u;c<(e.transpose?e.colCount:e.rowCount);c++)e.transpose?h.push({col:c,row:0}):h.push({col:0,row:c});e.transpose?e.scenegraph.updateCol([],a,[]):e.scenegraph.updateRow([],a,[])}}}function AV(i,t,e){var n,o;if(e.options.groupBy)(o=(n=e.dataSource).addRecordsForGroup)===null||o===void 0||o.call(n,i,t),e.refreshRowColCount(),e.internalProps.layoutMap.clearCellRangeMap(),e.scenegraph.clearCells(),e.scenegraph.createSceneGraph();else if(e.sortState)e.dataSource.addRecordsForSorted(i),El(e),e.refreshRowColCount(),e.scenegraph.clearCells(),e.scenegraph.createSceneGraph();else{t===void 0||t>e.dataSource.sourceLength?t=e.dataSource.sourceLength:t<0&&(t=0);const r=e.transpose?e.rowHeaderLevelCount:e.columnHeaderLevelCount;e.dataSource.addRecords(i,t);const s=e.transpose?e.colCount:e.rowCount;if(e.refreshRowColCount(),e.scenegraph.proxy.totalActualBodyRowCount===0)return e.scenegraph.clearCells(),void e.scenegraph.createSceneGraph();const l=e.transpose?e.colCount:e.rowCount;if(e.pagination){const{perPageCount:a,currentPage:h}=e.pagination,d=a*(h||0)+a;if(t<d)if(t<d-a)e.scenegraph.clearCells(),e.scenegraph.createSceneGraph();else{const u=t-(d-a)+r;if(s-r===e.pagination.perPageCount){const c=[];for(let g=u;g<l;g++)e.transpose?c.push({col:g,row:0}):c.push({col:0,row:g});e.transpose?e.scenegraph.updateCol([],[],c):e.scenegraph.updateRow([],[],c)}else{const c=[];for(let g=u;g<Math.min(l,u+(Array.isArray(i)?i.length:1));g++)e.transpose?c.push({col:g,row:0}):c.push({col:0,row:g});e.transpose?e.scenegraph.updateCol([],c,[]):e.scenegraph.updateRow([],c,[])}}}else{const a=[];for(let c=t+r;c<t+r+(Array.isArray(i)?i.length:1);c++)e.transpose?a.push({col:c,row:0}):a.push({col:0,row:c});const h=e.internalProps.layoutMap.hasAggregationOnTopCount,d=e.internalProps.layoutMap.hasAggregationOnBottomCount,u=[];for(let c=r;c<r+h;c++)e.transpose?u.push({col:c,row:0}):u.push({col:0,row:c});for(let c=(e.transpose?e.colCount:e.rowCount)-d;c<(e.transpose?e.colCount:e.rowCount);c++)e.transpose?u.push({col:c,row:0}):u.push({col:0,row:c});e.transpose?e.scenegraph.updateCol([],a,u):e.scenegraph.updateRow([],a,u)}}}function TV(i,t){var e,n;if((i==null?void 0:i.length)>0)if(t.options.groupBy)(n=(e=t.dataSource).deleteRecordsForGroup)===null||n===void 0||n.call(e,i),t.refreshRowColCount(),t.internalProps.layoutMap.clearCellRangeMap(),t.scenegraph.clearCells(),t.scenegraph.createSceneGraph();else if(t.sortState)t.dataSource.deleteRecordsForSorted(i),El(t),t.refreshRowColCount(),t.scenegraph.clearCells(),t.scenegraph.createSceneGraph();else{const o=t.dataSource.deleteRecords(i);if(o.length===0)return;const r=t.transpose?t.colCount:t.rowCount;t.refreshRowColCount();const s=t.transpose?t.colCount:t.rowCount,l=o.sort((h,d)=>h-d),a=l[0];if(t.pagination){const{perPageCount:h,currentPage:d}=t.pagination,u=h*(d||0)+h;if(a<u)if(a<u-h)t.scenegraph.clearCells(),t.scenegraph.createSceneGraph();else{const c=t.transpose?t.rowHeaderLevelCount:t.columnHeaderLevelCount,g=t.internalProps.layoutMap.hasAggregationOnTopCount,f=[],p=[];for(let m=a-(u-h)+(t.transpose?t.rowHeaderLevelCount:t.columnHeaderLevelCount)+g;m<s;m++)t.transpose?f.push({col:m,row:0}):f.push({col:0,row:m});for(let m=c;m<c+g;m++)t.transpose?f.push({col:m,row:0}):f.push({col:0,row:m});if(s<r)for(let m=s;m<r;m++)t.transpose?p.push({col:m,row:0}):p.push({col:0,row:m});t.transpose?t.scenegraph.updateCol(p,[],f):t.scenegraph.updateRow(p,[],f)}}else{const h=[],d=t.transpose?t.rowHeaderLevelCount:t.columnHeaderLevelCount,u=t.internalProps.layoutMap.hasAggregationOnTopCount,c=t.internalProps.layoutMap.hasAggregationOnBottomCount;for(let f=0;f<l.length;f++){const p=l[f]+d+u;t.transpose?h.push({col:p,row:0}):h.push({col:0,row:p})}const g=[];for(let f=d;f<d+u;f++)t.transpose?g.push({col:f,row:0}):g.push({col:0,row:f});for(let f=(t.transpose?t.colCount:t.rowCount)-c;f<(t.transpose?t.colCount:t.rowCount);f++)t.transpose?g.push({col:f,row:0}):g.push({col:0,row:f});t.transpose?t.scenegraph.updateCol(h,[],g):t.scenegraph.updateRow(h,[],g)}}}function MV(i,t,e){var n,o;if((t==null?void 0:t.length)>0)if(e.options.groupBy)(o=(n=e.dataSource).updateRecordsForGroup)===null||o===void 0||o.call(n,i,t),e.refreshRowColCount(),e.internalProps.layoutMap.clearCellRangeMap(),e.scenegraph.clearCells(),e.scenegraph.createSceneGraph();else if(e.sortState)e.dataSource.updateRecordsForSorted(i,t),El(e),e.refreshRowColCount(),e.scenegraph.clearCells(),e.scenegraph.createSceneGraph();else{const r=e.dataSource.updateRecords(i,t);if(r.length===0)return;const s=r.map(l=>e.getBodyRowIndexByRecordIndex(l)).sort((l,a)=>l-a);if(e.pagination){const{perPageCount:l,currentPage:a}=e.pagination,h=e.transpose?e.rowHeaderLevelCount:e.columnHeaderLevelCount,d=e.internalProps.layoutMap.hasAggregationOnTopCount,u=l*(a||0)+l,c=[];for(let g=0;g<s.length;g++){const f=s[g];if(f<u&&f>=u-l){const p=f-(u-l)+(e.transpose?e.rowHeaderLevelCount:e.columnHeaderLevelCount)+d;c.push(p)}}if(c.length>=1){const g=[];for(let f=0;f<c.length;f++){const p=c[f];e.transpose?g.push({col:p,row:0}):g.push({col:0,row:p})}for(let f=h;f<h+d;f++)e.transpose?g.push({col:f,row:0}):g.push({col:0,row:f});e.transpose?e.scenegraph.updateCol([],[],g):e.scenegraph.updateRow([],[],g)}}else{const l=[],a=e.transpose?e.rowHeaderLevelCount:e.columnHeaderLevelCount,h=e.internalProps.layoutMap.hasAggregationOnTopCount,d=e.internalProps.layoutMap.hasAggregationOnBottomCount;for(let u=0;u<s.length;u++){const c=s[u]+a+h;e.transpose?l.push({col:c,row:0}):l.push({col:0,row:c})}for(let u=a;u<a+h;u++)e.transpose?l.push({col:u,row:0}):l.push({col:0,row:u});for(let u=(e.transpose?e.colCount:e.rowCount)-d;u<(e.transpose?e.colCount:e.rowCount);u++)e.transpose?l.push({col:u,row:0}):l.push({col:0,row:u});e.transpose?e.scenegraph.updateCol([],[],l):e.scenegraph.updateRow([],[],l)}}}class fT extends Cg{constructor(t,e){var n,o,r,s;oe.mode==="node"?(e=t,t=null):t instanceof HTMLElement||(e=t,t=t.container?t.container:null),super(t,e),this.showHeader=!0;const l=this.internalProps;if(l.frozenColDragHeaderMode=e.frozenColDragHeaderMode,this.pagination=e.pagination,l.sortState=e.sortState,l.multipleSort=!!e.multipleSort,l.dataConfig=e.groupBy?gT(e.groupBy):{},l.columns=e.columns?ho(e.columns,["children"]):e.header?ho(e.header,["children"]):[],Tc(this),l.enableTreeNodeMerge=(o=(n=e.enableTreeNodeMerge)!==null&&n!==void 0?n:z(e.groupBy))!==null&&o!==void 0&&o,this.internalProps.headerHelper.setTableColumnsEditor(),this.showHeader=(r=e.showHeader)===null||r===void 0||r,this.transpose=(s=e.transpose)!==null&&s!==void 0&&s,oe.mode!=="node"&&(this.editorManager=new cT(this)),this.refreshHeader(),this.internalProps.useOneRowHeightFillAll=!1,e.dataSource?wm(this,e.dataSource):e.records?this.setRecords(e.records,{sortState:l.sortState}):this.setRecords([]),e.title){const a=Bt.getComponent("title");l.title=new a(e.title,this),this.scenegraph.resize()}if(this.options.emptyTip)if(this.internalProps.emptyTip)this.internalProps.emptyTip.resetVisible();else{const a=Bt.getComponent("emptyTip");this.internalProps.emptyTip=new a(this.options.emptyTip,this),this.internalProps.emptyTip.resetVisible()}if(e.enableTreeStickCell){const a=Bt.getComponent("listTreeStickCellPlugin");this.listTreeStickCellPlugin=new a(this)}setTimeout(()=>{this.fireListeners(at.INITIALIZED,null)},0)}isListTable(){return!0}isPivotTable(){return!1}isPivotChart(){return!1}get sortState(){return this.internalProps.sortState}get records(){var t;return(t=this.dataSource)===null||t===void 0?void 0:t.records}get recordsCount(){return this.dataSource.records.length}updateColumns(t){var e,n,o,r;const s={col:this.stateManager.hover.cellPos.col,row:this.stateManager.hover.cellPos.row};this.internalProps.columns=ho(t,["children"]),Tc(this),this.options.columns=t,this.internalProps.headerHelper.setTableColumnsEditor(),this._hasAutoImageColumn=void 0,this.refreshHeader(),(n=(e=this.dataSource).updateColumns)===null||n===void 0||n.call(e,this.internalProps.columns),this.records&&F6(t)&&this.dataSource.processRecords((r=(o=this.dataSource.dataSourceObj)===null||o===void 0?void 0:o.records)!==null&&r!==void 0?r: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(s.col,s.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,Tc(this),this.options.header=t,this.refreshHeader(),this.internalProps.useOneRowHeightFillAll=!1,this.renderAsync()}get transpose(){var t;return(t=this.internalProps.transpose)!==null&&t!==void 0&&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,n){if(t===-1||e===-1)return null;if(!n){const l=this.getCustomMergeValue(t,e);if(l)return l}const o=this;if(o.internalProps.layoutMap.isSeriesNumber(t,e)){if(o.internalProps.layoutMap.isSeriesNumberInHeader(t,e)){const{title:a}=o.internalProps.layoutMap.getSeriesNumberHeader(t,e);return a}if(this.options.groupBy){const{vtableMerge:a}=o.getCellRawRecord(t,e);if(a)return"";const h=this.dataSource.currentIndexedData[e-this.columnHeaderLevelCount];return h[h.length-1]+1}const{format:l}=o.internalProps.layoutMap.getSeriesNumberBody(t,e);return typeof l=="function"?l(t,e,this):e-this.columnHeaderLevelCount+1}if(o.internalProps.layoutMap.isHeader(t,e)){const{title:l}=o.internalProps.layoutMap.getHeader(t,e);return typeof l=="function"?l():l}if(o.internalProps.layoutMap.isAggregation(t,e)){if(o.internalProps.layoutMap.isTopAggregation(t,e)){const l=o.internalProps.layoutMap.getAggregatorOnTop(t,e);return l!=null&&l.formatValue?l.formatValue(t,e,this):""}if(o.internalProps.layoutMap.isBottomAggregation(t,e)){const l=o.internalProps.layoutMap.getAggregatorOnBottom(t,e);return l!=null&&l.formatValue?l.formatValue(t,e,this):""}}const{field:r,fieldFormat:s}=o.internalProps.layoutMap.getBody(t,e);return o.getFieldData(s||r,t,e)}getCellOriginValue(t,e){if(t===-1||e===-1)return null;const n=this;if(n.internalProps.layoutMap.isSeriesNumber(t,e)){if(n.internalProps.layoutMap.isSeriesNumberInHeader(t,e)){const{title:s}=n.internalProps.layoutMap.getSeriesNumberHeader(t,e);return s}const{format:r}=n.internalProps.layoutMap.getSeriesNumberBody(t,e);return typeof r=="function"?r(t,e,this):e-this.columnHeaderLevelCount}if(n.internalProps.layoutMap.isHeader(t,e)){const{title:r}=n.internalProps.layoutMap.getHeader(t,e);return typeof r=="function"?r():r}if(n.internalProps.layoutMap.isAggregation(t,e)){if(n.internalProps.layoutMap.isTopAggregation(t,e)){const r=n.internalProps.layoutMap.getAggregatorOnTop(t,e);return r==null?void 0:r.value()}if(n.internalProps.layoutMap.isBottomAggregation(t,e)){const r=n.internalProps.layoutMap.getAggregatorOnBottom(t,e);return r==null?void 0:r.value()}}const{field:o}=n.internalProps.layoutMap.getBody(t,e);return n.getFieldData(o,t,e)}getCellRawValue(t,e){if(t===-1||e===-1)return null;const n=this;if(n.internalProps.layoutMap.isHeader(t,e)){const{title:r}=n.internalProps.layoutMap.getHeader(t,e);return typeof r=="function"?r():r}const{field:o}=n.internalProps.layoutMap.getBody(t,e);return n.getRawFieldData(o,t,e)}getRecordShowIndexByCell(t,e){const{layoutMap:n}=this.internalProps;return n.getRecordShowIndexByCell(t,e)}getRecordIndexByCell(t,e){const{layoutMap:n}=this.internalProps,o=n.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(o=>o.field===t);if(!e)return-1;const n=this.internalProps.layoutMap.getBodyLayoutRangeById(e.id);return this.transpose?n.start.row:n.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 n=this,o=n.getRecordShowIndexByCell(t,e);if(o>-1)return n.dataSource.get(o)}getCellRawRecord(t,e){const n=this,o=n.getRecordShowIndexByCell(t,e);if(o>-1)return n.dataSource.getRaw(o)}_canResizeColumn(t,e){const n=super._canResizeColumn(t,e);if(n&&!this.transpose){const o=this.internalProps.layoutMap.getBody(t,this.columnHeaderLevelCount),r=this.internalProps.layoutMap.isSeriesNumber(t,e);if(o!=null&&o.disableColumnResize||r&&this.internalProps.rowSeriesNumber.disableColumnResize===!0)return!1}return n}updateOption(t){var e,n,o,r;const s=this.internalProps;if(super.updateOption(t),s.frozenColDragHeaderMode=t.frozenColDragHeaderMode,this.pagination=t.pagination,s.sortState=t.sortState,s.dataConfig=t.groupBy?gT(t.groupBy):{},this.showHeader=(e=t.showHeader)===null||e===void 0||e,s.columns=t.columns?ho(t.columns,["children"]):t.header?ho(t.header,["children"]):[],Tc(this),s.enableTreeNodeMerge=(o=(n=t.enableTreeNodeMerge)!==null&&n!==void 0?n:z(t.groupBy))!==null&&o!==void 0&&o,this.internalProps.headerHelper.setTableColumnsEditor(),this.transpose=(r=t.transpose)!==null&&r!==void 0&&r,this.refreshHeader(),this.internalProps.useOneRowHeightFillAll=!1,s.releaseList&&(s.releaseList.forEach(l=>{var a;return(a=l==null?void 0:l.release)===null||a===void 0?void 0:a.call(l)}),s.releaseList=null),t.dataSource?wm(this,t.dataSource):t.records?this.setRecords(t.records,{sortState:t.sortState}):(this._resetFrozenColCount(),this.scenegraph.createSceneGraph(),this.render()),t.title){const l=Bt.getComponent("title");s.title=new l(t.title,this),this.scenegraph.resize()}if(this.options.emptyTip)if(this.internalProps.emptyTip)this.internalProps.emptyTip.resetVisible();else{const l=Bt.getComponent("emptyTip");this.internalProps.emptyTip=new l(this.options.emptyTip,this),this.internalProps.emptyTip.resetVisible()}return new Promise(l=>{setTimeout(l,0)})}updatePagination(t){this.pagination&&(typeof t.currentPage=="number"&&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,n=this.transpose,o=this.showHeader;(e.layoutMap=new _V(this,(t=e.columns)!==null&&t!==void 0?t:[],o,this.options.hierarchyIndent)).transpose=n,n||this.setMinMaxLimitWidth(!0),this.refreshRowColCount()}refreshRowColCount(){var t,e,n,o,r,s,l,a,h,d,u,c,g,f,p,m,b,C;const _=this,{layoutMap:w}=_.internalProps;if(!w)return;const y=(e=(t=_.internalProps.dataSource)===null||t===void 0?void 0:t.length)!==null&&e!==void 0?e:0;w.recordsCount=y+(y>0?w.hasAggregationOnTopCount+w.hasAggregationOnBottomCount:0),_.transpose?(_.rowCount=(n=w.rowCount)!==null&&n!==void 0?n:0,_.colCount=(o=w.colCount)!==null&&o!==void 0?o:0,this.internalProps.frozenColCount=Math.max(((r=w.headerLevelCount)!==null&&r!==void 0?r:0)+w.leftRowSeriesNumberColumnCount,(s=this.options.frozenColCount)!==null&&s!==void 0?s:0),this.internalProps.frozenRowCount=(l=this.options.frozenRowCount)!==null&&l!==void 0?l:0,_.bottomFrozenRowCount!==((a=this.options.bottomFrozenRowCount)!==null&&a!==void 0?a:0)&&(_.bottomFrozenRowCount=(h=this.options.bottomFrozenRowCount)!==null&&h!==void 0?h:0),_.rightFrozenColCount!==((d=this.options.rightFrozenColCount)!==null&&d!==void 0?d:0)&&(_.rightFrozenColCount=(u=this.options.rightFrozenColCount)!==null&&u!==void 0?u:0)):(_.colCount=(c=w.colCount)!==null&&c!==void 0?c:0,_.rowCount=w.recordsCount*w.bodyRowSpanCount+w.headerLevelCount,this.internalProps.frozenColCount=(g=this.options.frozenColCount)!==null&&g!==void 0?g:0,_.frozenRowCount=Math.max(w.headerLevelCount,(f=this.options.frozenRowCount)!==null&&f!==void 0?f:0),_.bottomFrozenRowCount!==((p=this.options.bottomFrozenRowCount)!==null&&p!==void 0?p:0)&&(_.bottomFrozenRowCount=(m=this.options.bottomFrozenRowCount)!==null&&m!==void 0?m:0),_.rightFrozenColCount!==((b=this.options.rightFrozenColCount)!==null&&b!==void 0?b:0)&&(_.rightFrozenColCount=(C=this.options.rightFrozenColCount)!==null&&C!==void 0?C:0)),this.stateManager.setFrozenCol(this.internalProps.frozenColCount)}getFieldData(t,e,n){if(t===null||this.internalProps.layoutMap.isHeader(e,n))return null;const o=this.getRecordShowIndexByCell(this.transpose?e-this.internalProps.layoutMap.leftRowSeriesNumberColumnCount:e,n);return this.internalProps.dataSource.getField(o,t,e,n,this)}getRawFieldData(t,e,n){if(t===null||this.internalProps.layoutMap.isHeader(e,n))return null;const o=this.getRecordShowIndexByCell(e,n);return this.internalProps.dataSource.getRawField(o,t,e,n,this)}_moveHeaderPosition(t,e){const n=this.getCellRange(t.col,t.row),o=this.getCellRange(e.col,e.row),r=this.internalProps.layoutMap.moveHeaderPosition(t,e);return r?(r.moveType==="column"?(this.colWidthsMap.exchangeOrder(n.start.col,n.end.col-n.start.col+1,o.start.col,o.end.col-o.start.col+1,r.targetIndex),this.transpose||(this.colWidthsLimit={},this.setMinMaxLimitWidth())):r.targetIndex>r.sourceIndex?this.rowHeightsMap.exchangeOrder(r.sourceIndex,r.sourceSize,r.targetIndex+r.sourceSize-r.targetSize,r.targetSize,r.targetIndex):this.rowHeightsMap.exchangeOrder(r.sourceIndex,r.sourceSize,r.targetIndex,r.targetSize,r.targetIndex),r):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 n;for(let r=0;r<this.internalProps.records.length;r++){const s=this.internalProps.records[r];if(typeof t=="function")t(s)&&(n=r);else{let l=!0;for(const a in t)if(s[a]!==t[a]){l=!1;break}l&&(n=r)}if(z(n))break}const o=this.getCellRangeByField(e,n);if(o)return{row:o.start.row,col:o.start.col}}getCellRangeByField(t,e){const{layoutMap:n}=this.internalProps,o=n.columnObjects.find(r=>r.field===t);if(o){const r=n.getBodyLayoutRangeById(o.id);let s;return z(e)&&(s=n.getRecordStartRowByRecordIndex(e)),this.transpose?{start:{row:r.start.row,col:z(s)?s+r.start.col:void 0},end:{row:r.end.row,col:z(s)?s+r.end.col:void 0}}:{start:{col:r.start.col,row:z(s)?s+r.start.row:void 0},end:{col:r.end.col,row:z(s)?s+r.end.row:void 0}}}return null}getHierarchyState(t,e){if(!this.options.groupBy&&!this.getBodyColumnDefine(t,e).tree)return Vt.none;const n=this.getRecordShowIndexByCell(t,e);return this.dataSource.getHierarchyState(n)}toggleHierarchyState(t,e,n=!0){this.stateManager.updateHoverIcon(t,e,void 0,void 0);const o=this.getHierarchyState(t,e);if(o===Vt.expand)this._refreshHierarchyState(t,e,n),this.fireListeners(at.TREE_HIERARCHY_STATE_CHANGE,{col:t,row:e,hierarchyState:Vt.collapse});else if(o===Vt.collapse){const r=this.getCellOriginRecord(t,e);Array.isArray(r.children)&&this._refreshHierarchyState(t,e,n),this.fireListeners(at.TREE_HIERARCHY_STATE_CHANGE,{col:t,row:e,hierarchyState:Vt.expand,originData:r})}}setLoadingHierarchyState(t,e){this.scenegraph.setLoadingHierarchyState(t,e)}_refreshHierarchyState(t,e,n=!0){var o;let r=!1,s=!1;const l=this.internalProps.layoutMap.checkHasChart();l&&(this.autoFillWidth&&(r=this.getAllColsWidth()<=this.tableNoFrameWidth),this.autoFillHeight&&(s=this.getAllRowsHeight()<=this.tableNoFrameHeight));const a=this.getRecordShowIndexByCell(t,e),h=this.dataSource.toggleHierarchyState(a,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)),d=this.internalProps.layoutMap.toggleHierarchyState(h);this.refreshRowColCount();for(let c=this.rowCount-this.bottomFrozenRowCount;c<this.rowCount;c++){const g=nn(c,0,this.colCount-1,this);this._setRowHeight(c,g)}this.clearCellStyleCache(),this.internalProps.layoutMap.clearCellRangeMap(),this.internalProps.useOneRowHeightFillAll=!1;const u=[{col:t,row:e}];if(((o=d.removeCellPositions)===null||o===void 0?void 0:o.length)>0&&d.removeCellPositions[d.removeCellPositions.length-1].row>=this.scenegraph.proxy.rowEnd){for(let c=0;c<=d.removeCellPositions.length-1;c++)d.removeCellPositions[c].row<=this.scenegraph.proxy.rowEnd&&u.push({col:d.removeCellPositions[c].col,row:d.removeCellPositions[c].row});d.removeCellPositions=[],this.scenegraph.proxy.refreshRowCount()}this.scenegraph.updateRow(d.removeCellPositions,d.addCellPositions,u,n),l&&(this.autoFillWidth&&!r&&(r=this.getAllColsWidth()<=this.tableNoFrameWidth),this.autoFillHeight&&!s&&(s=this.getAllRowsHeight()<=this.tableNoFrameHeight),(this.widthMode==="adaptive"||r||this.heightMode==="adaptive"||s)&&this.scenegraph.updateChartSizeForResizeColWidth(-1))}_hasHierarchyTreeHeader(){var t,e;return(e=(t=this.options.columns)!==null&&t!==void 0?t:this.options.header)===null||e===void 0?void 0:e.some((n,o)=>n.tree)}getMenuInfo(t,e,n){return{field:this.getHeaderField(t,e),value:this.getCellValue(t,e),cellLocation:this.getCellLocation(t,e),event:void 0}}_getSortFuncFromHeaderOption(t,e,n){if(t||(t=this.internalProps.columns),e&&t&&t.length>0)for(let o=0;o<t.length;o++){const r=t[o];if((n&&n===r.fieldKey||!n&&r.field===e)&&r.sort&&typeof r.sort=="function")return r.sort;if(r.columns){const s=this._getSortFuncFromHeaderOption(r.columns,e,n);if(s)return s}}}updateSortState(t,e=!0){var n;if(t)this.internalProps.sortState=t;else if(this.internalProps.sortState)if(Array.isArray(this.internalProps.sortState))for(let o=0;o<this.internalProps.sortState.length;o++)(t=(n=this.internalProps.sortState)===null||n===void 0?void 0:n[o])&&(t.order="normal");else this.internalProps.sortState.order="normal",t=this.internalProps.sortState;(t=Array.isArray(t)?t:[t]).some(o=>o.field)&&e&&this.internalProps.layoutMap.headerObjects.some(o=>o.define.sort!==!1)&&(this.dataSource.sort(t.map(o=>{const r=this._getSortFuncFromHeaderOption(this.internalProps.columns,o.field);return this.internalProps.layoutMap.headerObjects.find(s=>s&&s.field===o.field),{field:o.field,order:o.order,orderFn:r}})),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),El(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),z(t)){let e=this.stateManager.checkedState;return this.options.groupBy&&(e=FN(this)),e.map(n=>n[t])}return this.stateManager.checkedState}getCellCheckboxState(t,e){var n;const o=this.getBodyColumnDefine(t,e),r=o==null?void 0:o.field,s=this.getCellType(t,e);if(z(r)&&s==="checkbox"){const l=this.dataSource.getIndexKey(this.getRecordShowIndexByCell(t,e));return(n=this.stateManager.checkedState[l])===null||n===void 0?void 0:n[r]}}getRadioState(t){return z(t)?this.stateManager.radioState[t]:this.stateManager.radioState}getCellRadioState(t,e){return SN(t,e,this)}setCellCheckboxState(t,e,n){LN(t,e,n,this)}setCellRadioState(t,e,n){RN(t,e,n,this)}setRecords(t,e){var n,o;let r;(n=this.internalProps.dataSource)===null||n===void 0||n.release(),this.internalProps.releaseList=(o=this.internalProps.releaseList)===null||o===void 0?void 0:o.filter(l=>!l.dataSourceObj),this.internalProps.dataSource=null,Array.isArray(e)||e!=null&&e.order?r=e:e?r=e.sortState:e===null&&(r=null),typeof window<"u"&&window.performance.now();const s={col:this.stateManager.hover.cellPos.col,row:this.stateManager.hover.cellPos.row};if(this.scenegraph.clearCells(),r!==void 0&&(r===null||!Array.isArray(r)&&z(r.field)||Array.isArray(r))&&(this.internalProps.sortState=this.internalProps.multipleSort?Array.isArray(r)?r:[r]:r,this.stateManager.setSortState(this.sortState)),t){if(Jx(this,t),this.sortState){const l=Array.isArray(this.sortState)?this.sortState:[this.sortState];l.some(a=>a.order&&a.field&&a.order!=="normal")&&this.internalProps.layoutMap.headerObjectsIncludeHided.some(a=>a.define.sort!==!1)&&this.dataSource.sort(l.map(a=>{const h=this._getSortFuncFromHeaderOption(void 0,a.field);return this.internalProps.layoutMap.headerObjectsIncludeHided.find(d=>d&&d.field===a.field),{field:a.field,order:a.order||"asc",orderFn:h??sm}}))}this.refreshRowColCount()}else Jx(this,t);if(this.stateManager.initCheckedState(t),this.clearCellStyleCache(),this.scenegraph.createSceneGraph(),this.stateManager.updateHoverPos(s.col,s.row),this.internalProps.title&&!this.internalProps.title.isReleased&&(this._updateSize(),this.internalProps.title.resize(),this.scenegraph.resize()),this.options.emptyTip)if(this.internalProps.emptyTip)this.internalProps.emptyTip.resetVisible();else{const l=Bt.getComponent("emptyTip");this.internalProps.emptyTip=new l(this.options.emptyTip,this),this.internalProps.emptyTip.resetVisible()}this.render(),z(s.col)&&z(s.row)&&s.col>=0&&s.row>=0&&setTimeout(()=>{var l;(l=this.internalProps)===null||l===void 0||l.tooltipHandler.showTooltip(s.col,s.row)},0)}setRecordChildren(t,e,n,o=!0){const r=this.getCellOriginRecord(e,n);r.children=t;const s=this.getRecordShowIndexByCell(e,n);this.dataSource.setRecord(r,s),this._refreshHierarchyState(e,n,o)}startEditCell(t,e,n){var o;if(z(t)&&z(e))this.eventManager.isDraging=!1,this.selectCell(t,e),this.editorManager.startEditCell(t,e,n);else if(!((o=this.stateManager.select)===null||o===void 0)&&o.cellPos){const{col:r,row:s}=this.stateManager.select.cellPos;z(r)&&z(s)&&this.editorManager.startEditCell(r,s,n)}}completeEditCell(){this.editorManager.completeEdit()}getEditor(t,e){var n,o;const r=this.getBodyColumnDefine(t,e);let s=this.isHeader(t,e)?(n=r==null?void 0:r.headerEditor)!==null&&n!==void 0?n:this.options.headerEditor:(o=r==null?void 0:r.editor)!==null&&o!==void 0?o:this.options.editor;return typeof s=="function"&&(s=s({col:t,row:e,dataValue:this.getCellOriginValue(t,e),value:this.getCellValue(t,e)||"",table:this})),typeof s=="string"?oT(s):s}isHasEditorDefine(t,e){var n,o;const r=this.getBodyColumnDefine(t,e);let s=this.isHeader(t,e)?(n=r==null?void 0:r.headerEditor)!==null&&n!==void 0?n:this.options.headerEditor:(o=r==null?void 0:r.editor)!==null&&o!==void 0?o:this.options.editor;return typeof s=="function"&&(s=s({col:t,row:e,dataValue:this.getCellOriginValue(t,e),value:this.getCellValue(t,e)||"",table:this})),z(s)}changeCellValue(t,e,n,o=!1){return wV(t,e,n,o,this)}changeCellValues(t,e,n,o=!1){return SV(t,e,n,o,this)}addRecord(t,e){RV(t,e,this)}addRecords(t,e){AV(t,e,this)}deleteRecords(t){TV(t,this)}updateRecords(t,e){MV(t,e,this)}_hasCustomRenderOrLayout(){var t,e,n,o;const{headerObjects:r}=this.internalProps.layoutMap;if(this.options.customRender)return!0;for(let s=0;s<r.length;s++){const l=r[s];if(!((t=l==null?void 0:l.define)===null||t===void 0)&&t.customLayout||!((e=l==null?void 0:l.define)===null||e===void 0)&&e.headerCustomLayout||!((n=l==null?void 0:l.define)===null||n===void 0)&&n.customRender||!((o=l==null?void 0:l.define)===null||o===void 0)&&o.headerCustomRender)return!0}return!1}getAggregateValuesByField(t){const e=this.internalProps.layoutMap.getColumnByField(t),n=[];for(let o=0;o<e.length;o++){const r=e[o].columnDefine.aggregator;if(delete e[o].columnDefine,r){const s={col:e[o].col,aggregateValue:null};if(s.aggregateValue=[],Array.isArray(r))for(let l=0;l<r.length;l++)s.aggregateValue.push({aggregationType:r[l].type,value:r[l].value()});else s.aggregateValue.push({aggregationType:r.type,value:r.value()});n.push(s)}}return n}isAggregation(t,e){return this.internalProps.layoutMap.isAggregation(t,e)}getGroupTitleLevel(t,e){var n;if(!this.options.groupBy)return;const o=this.dataSource.getIndexKey(this.getRecordShowIndexByCell(t,e)),r=(n=this.dataSource.getGroupLength())!==null&&n!==void 0?n:0;let s=lt(o)?o.length-1:0;return r>0&&s===r&&(s=void 0),s}getBodyRowIndexByRecordIndex(t){return Array.isArray(t)&&t.length===1&&(t=t[0]),this.dataSource.getTableIndex(t)}}function uv(i){return i==="bottom"||i==="top"}function BV(i){return i==="left"||i==="right"}class PV{constructor(){this._scale=new qu,this._scales=[this._scale]}valueToPosition(t){return this._scale.scale(t)}getPosition(t){let e=0,n=this._scale;if(this._scales.length===1||t.length===1)e=this.valueToPosition(t[0]);else{const o=Math.min(t.length,this._scales.length);for(let r=0;r<o;r++)e+=this._scales[r].scale(t[r]);n=this._scales[o-1]}return{position:e,bandScale:n}}calcScales(t,e){var n,o;const{bandPadding:r,paddingInner:s,paddingOuter:l}=this,a=lt(r),h=lt(s),d=lt(l);for(let u=0;u<this._scales.length;u++){const c=a?r[u]:r,g=h?s[u]:s,f=d?l[u]:l;this._scales[u].paddingInner((n=g??c)!==null&&n!==void 0?n:t,!0).paddingOuter((o=f??c)!==null&&o!==void 0?o:e)}}dataToPosition(t,e={}){var n;if(t.length===0||this._scales.length===0)return 0;const{position:o,bandScale:r}=this.getPosition(t);return o+r.bandwidth()*((n=e.bandPosition)!==null&&n!==void 0?n:.5)}updateScaleDomain(t){for(let e=0;e<this._scales.length;e++)this._scales[e].domain(t)}updateRange(t){const[e,n]=this._scale.range();t[0]===e&&t[1]===n||this._scale.range(t)}}function HV(i,t,e){i.getTransform(t)||i.registerTransform(t,e)}function EV(i,t,e){i.getParser(t)||i.registerParser(t,e)}const LV=Math.sqrt(50),kV=Math.sqrt(10),FV=Math.sqrt(2);class IV{constructor(t){this._extend={},this.type=t??"linear",this._scale=t==="log"?new Ya:t==="symlog"?new Xa:new ds,this._scales=[this._scale]}setExtraAttrFromSpec(t,e,n,o,r,s){this.nice=!1,this.zero=e,this.zero&&(n.min=Math.min(n.min,0),n.max=Math.max(n.max,0)),this.domain=n,this.expand=o,this.type==="log"?this._scale.base(r??10):this.type==="symlog"&&this._scale.constant(s??10)}transformScaleDomain(){this.type==="symlog"||this.type==="log"||this.setScaleNice()}setScaleNice(){this.type==="log"?this.setLogScaleNice():this.setLinearScaleNice()}setLogScaleNice(){var t,e,n,o,r,s;Mt((t=this.domain)===null||t===void 0?void 0:t.min)&&Mt((e=this.domain)===null||e===void 0?void 0:e.max)?this.nice&&this._scale.nice():z((n=this.domain)===null||n===void 0?void 0:n.min)&&Mt((o=this.domain)===null||o===void 0?void 0:o.max)?this.nice&&this._scale.niceMax():Mt((r=this.domain)===null||r===void 0?void 0:r.min)&&z((s=this.domain)===null||s===void 0?void 0:s.max)&&this.nice&&this._scale.niceMin()}setLinearScaleNice(){var t,e,n,o,r,s,l,a;let h=(e=(t=this.forceTickCount)!==null&&t!==void 0?t:this.tickCount)!==null&&e!==void 0?e:10;this.niceType==="accurateFirst"&&(h=Math.max(10,h)),Mt((n=this.domain)===null||n===void 0?void 0:n.min)&&Mt((o=this.domain)===null||o===void 0?void 0:o.max)?this.nice&&this._scale.nice(h):z((r=this.domain)===null||r===void 0?void 0:r.min)&&Mt((s=this.domain)===null||s===void 0?void 0:s.max)?this.nice&&this._scale.niceMax(h):Mt((l=this.domain)===null||l===void 0?void 0:l.min)&&z((a=this.domain)===null||a===void 0?void 0:a.max)?this.nice&&this._scale.niceMin(h):this.nice&&this._scale.nice(h)}dataToPosition(t){return this.valueToPosition(t[0])}valueToPosition(t){return this._scale.scale(t)}computeLinearDomain(t){const e=[];return t.forEach(n=>{const{min:o,max:r}=n;e[0]=e[0]===void 0?o:Math.min(e[0],o),e[1]=e[1]===void 0?r:Math.max(e[1],r)}),this.expandDomain(e),this.includeZero(e),this.setDomainMinMax(e),e}expandDomain(t){if(!this.expand)return;const e=t[0],n=t[t.length-1];z(this.expand.min)&&(t[0]=e-(n-e)*this.expand.min),z(this.expand.max)&&(t[t.length-1]=n+(n-e)*this.expand.max)}niceDomain(t){if(z(t[0])||z(t[1])||this.type!=="linear")return t;if(Math.abs(cd(t)-Wf(t))<=1e-12){let e=t[0];const n=e>=0?1:-1;if(e=Math.abs(e),e<1)t[0]=0,t[1]=1;else{let o=e/5;const r=Math.floor(Math.log(o)/Math.LN10),s=o/Math.pow(10,r);o=(s>=LV?10:s>=kV?5:s>=FV?2:1)*Math.pow(10,r),t[0]=0,t[1]=10*o}n<0&&(t.reverse(),t[0]*=-1,t[1]*=-1)}return t}niceMinMax(){var t,e,n,o,r,s,l,a;if(this.nice){let h=(e=(t=this.forceTickCount)!==null&&t!==void 0?t:this.tickCount)!==null&&e!==void 0?e:10;this.niceType==="accurateFirst"&&(h=Math.max(10,h)),Mt((n=this.domain)===null||n===void 0?void 0:n.min)&&Mt((o=this.domain)===null||o===void 0?void 0:o.max)?this._scale.nice(h):z((r=this.domain)===null||r===void 0?void 0:r.min)&&Mt((s=this.domain)===null||s===void 0?void 0:s.max)?this._scale.niceMax(h):Mt((l=this.domain)===null||l===void 0?void 0:l.min)&&z((a=this.domain)===null||a===void 0?void 0:a.max)?this._scale.niceMin(h):this._scale.nice(h)}}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(e===void 0)return void delete this._extend[t];this._extend[t]=e;const n=this._scale.domain();this.extendDomain(n),this.includeZero(n),this.setDomainMinMax(n),this.niceDomain(n),this._scale.domain(n,this.nice),this.niceMinMax()}extendDomain(t){let e;const n=t.length-1,o=t[0]-t[n]>0,r=o?n:0,s=o?0:n;for(const l in this._extend)e=this._extend[l],e>t[s]&&(t[s]=e),e<t[r]&&(t[r]=e)}setDomainMinMax(t){if(!this.domain)return;const{min:e,max:n}=this.domain;z(e)&&(t[0]=e),z(n)&&(t[1]=n)}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=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,n]=this._scale.range();t[0]===e&&t[1]===n||this._scale.range(t)}}function DV(i,t){const e=i.find(o=>o.name==="axis-label-container-layer-0",!0),n=i.find(o=>o.name==="axis-label-container-layer-1",!0);pT(e?e.getChildren():[],t),pT(n?n.getChildren():[],t)}function OV(i,t){const{width:e,height:n}=t.getLayoutRect(),o=uv(t.orient),r=t.option.inverse===!0,s=i[0],l=Zr(i);if(o)if(r){const a=e,h=0,d=s.AABBBounds.x2,u=l.AABBBounds.x1;d>a&&s.setAttributes({x:a,textAlign:"right"}),u<h&&l.setAttributes({x:h,textAlign:"left"})}else{const h=e,d=s.AABBBounds.x1,u=l.AABBBounds.x2;d<0&&s.setAttributes({x:0,textAlign:"left"}),u>h&&l.setAttributes({x:h,textAlign:"right"})}else if(r){const a=s.AABBBounds.y1,h=l.AABBBounds.y2,d=0,u=n;a<d&&s.setAttributes({y:d,textBaseline:"top"}),h>u&&l.setAttributes({y:u,textBaseline:"bottom"})}else{const a=n,h=0,d=s.AABBBounds.y2,u=l.AABBBounds.y1;d>a&&s.setAttributes({y:a,textBaseline:"bottom"}),u<h&&l.setAttributes({y:h,textBaseline:"top"})}}function pT(i,t){var e;const n=t.option;qt(i)||!((e=n==null?void 0:n.label)===null||e===void 0)&&e.flush&&OV(i,t)}const zV=i=>i;class WV{constructor(t,e,n,o,r){var s,l,a;this.x=0,this.y=0,this.padding=o,this.table=r,this.orient=(s=t.orient)!==null&&s!==void 0?s:"left",this.type=(l=t.type)!==null&&l!==void 0?l:"band",this.option=xt({},uV(t.__vtableChartTheme),NV(this.orient,r.theme),VV(this.orient,this.type,t.__vtableChartTheme),t),this.orient==="left"||this.orient==="right"?(this.width=e,this.height=n-o[0]-o[2]-0,this.y=o[0]+0):(this.orient==="top"||this.orient==="bottom")&&(this.width=e-o[1]-o[3]-0,this.height=n,this.x=o[3]+0),this.visible=(a=t.visible)===null||a===void 0||a,this.inverse="inverse"in t&&!!t.inverse,t.type==="band"&&(this.data=t.domain),this.initScale(),this.initData(),this.createComponent(),this.initEvent()}initScale(){const t=this.option;this.type==="band"||this.type==="point"?(this.scale=new PV,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()):this.type!=="linear"&&this.type!=="time"&&this.type!=="log"&&this.type!=="symlog"||(this.scale=new IV(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(){this.table._vDataSet||(this.table._vDataSet=new lV),EV(this.table._vDataSet,"scale",zV),HV(this.table._vDataSet,"ticks",lz);const t=this.option.label||{},e=this.option.tick||{},n=new Sg(this.table._vDataSet).parse(this.scale._scale,{type:"scale"}).transform({type:"ticks",options:{sampling:this.option.sampling!==!1,tickCount:e.tickCount,forceTickCount:e.forceTickCount,tickStep:e.tickStep,tickMode:e.tickMode,noDecimals:e.noDecimals,axisOrientType:this.orient,coordinateType:"cartesian",labelStyle:t.style,labelFormatter:t.formatMethod,labelGap:t.minGap,labelLastVisible:t.lastVisible,labelFlush:t.flush}},!1);this.tickData=n,this.computeData()}computeData(){this.tickData.reRunAllTransform()}initEvent(){}createComponent(){const t=aT(this.option),e=this.getUpdateAttribute();e.verticalFactor=this.orient==="top"||this.orient==="right"?-1:1,this.component=new Ka(xt({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-(this.orient==="top"||this.orient==="bottom"?this.padding[1]+this.padding[3]:0),this.height=e-(this.orient==="left"||this.orient==="right"?this.padding[2]+this.padding[0]:0),this.updateScaleRange(),this.computeData();const n=aT(this.option),o=this.getUpdateAttribute();o.verticalFactor=this.orient==="top"||this.orient==="right"?-1:1,this.component.setAttributes(xt({},n,o)),this.component.setAttributes(this.setLayoutStartPosition({x:this.x,y:this.y})),this.overlap()}overlap(){DV(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(),n=uv(this.orient),o=BV(this.orient);let r={x:0,y:0},s=0;n?(r={x:t,y:0},s=t):o&&(r={x:0,y:e},s=e);const l=this.orient==="top"||this.orient==="bottom"?e:t;return{start:{x:0,y:0},end:r,title:{text:this.option.title.text,maxWidth:this._getTitleLimit(n)},items:this.getLabelItems(s),verticalLimitSize:l,verticalMinSize:l}}getLabelItems(t){return[this.tickData.latestData.map(e=>({id:e.value,label:e.value,value:t===0?0:this.scale.dataToPosition([e.value])/t,rawValue:e.value})).filter(e=>e.value>=0&&e.value<=1)]}updateScaleRange(){var t,e,n,o,r,s,l,a;const h=(e=(t=this.option.innerOffset)===null||t===void 0?void 0:t.right)!==null&&e!==void 0?e:0,d=(o=(n=this.option.innerOffset)===null||n===void 0?void 0:n.left)!==null&&o!==void 0?o:0,u=(s=(r=this.option.innerOffset)===null||r===void 0?void 0:r.top)!==null&&s!==void 0?s:0,c=(a=(l=this.option.innerOffset)===null||l===void 0?void 0:l.bottom)!==null&&a!==void 0?a:0,{width:g,height:f}=this.getLayoutRect(),p=this.option.inverse||!1;let m=[0,0];uv(this.orient)?Ae(g)&&(m=p?[g-h,d]:[d,g-h]):Ae(f)&&(m=p?[u,f-c]:[f-c,u]),this.scale.updateRange(m)}setLayoutStartPosition(t){let{x:e,y:n}=t;return Ae(e)&&(e+=+(this.orient==="left")*this.getLayoutRect().width),Ae(n)&&(n+=+(this.orient==="top")*this.getLayoutRect().height),{x:e,y:n}}_getTitleLimit(t){var e,n,o;if(this.option.title.visible&&Mt((e=this.option.title.style)===null||e===void 0?void 0:e.maxLineWidth)){let r=((n=this.option.title.style)===null||n===void 0?void 0:n.angle)||0;if(!((o=this.option.title)===null||o===void 0)&&o.autoRotate&&Mt(this.option.title.angle)&&(r=this.option.orient==="left"?-90:90),t){const a=this.getLayoutRect().width,h=Math.abs(Math.cos(Mn(r)));return h<1e-6?1/0:a/h}const s=this.getLayoutRect().height,l=Math.abs(Math.sin(Mn(r)));return l<1e-6?1/0:s/l}return null}getScale(){return this.scale._scale}getDomainSpec(){return this.scale.domain}}function NV(i,t){let e;return i==="left"?e=t.axisStyle.leftAxisStyle:i==="right"?e=t.axisStyle.rightAxisStyle:i==="top"?e=t.axisStyle.topAxisStyle:i==="bottom"&&(e=t.axisStyle.bottomAxisStyle),xt({},t.axisStyle.defaultAxisStyle,e)}function VV(i,t,e){if(!e)return{};const n=e.axis;let o,r;return t==="linear"||t==="log"||t==="symlog"?o=e.axisLinear:t==="band"&&(o=e.axisBand),i==="top"||i==="bottom"?r=e.axisX:i!=="left"&&i!=="right"||(r=e.axisY),xt({},n,o,r)}function jV(i,t){var e,n,o,r,s,l,a,h,d,u,c,g,f,p,m,b;const C=xt({},xg,i);let _=0;C.tick.visible!==!1&&(_=(e=C.tick.width)!==null&&e!==void 0?e:4);let w=0;if(C.label.visible){if(C.type==="band")C.domain.forEach(S=>{var A,R,x,T,M,B,P,F,H,E,k,I,L,D,O,N;C.label.formatMethod&&(S=C.label.formatMethod(S));const{width:W,height:$}=t.measureText(S,{fontSize:(x=(R=(A=C.label)===null||A===void 0?void 0:A.style)===null||R===void 0?void 0:R.fontSize)!==null&&x!==void 0?x:Ro,fontWeight:(B=(M=(T=C.label)===null||T===void 0?void 0:T.style)===null||M===void 0?void 0:M.fontWeight)!==null&&B!==void 0?B:"normal",fontFamily:(H=(F=(P=C.label)===null||P===void 0?void 0:P.style)===null||F===void 0?void 0:F.fontFamily)!==null&&H!==void 0?H:Ms}),U=((k=(E=C.label)===null||E===void 0?void 0:E.style)===null||k===void 0?void 0:k.maxLineWidth)||1/0,Y=((D=(L=(I=C.label)===null||I===void 0?void 0:I.style)===null||L===void 0?void 0:L.angle)!==null&&D!==void 0?D:0)+(((N=(O=C.label)===null||O===void 0?void 0:O.style)===null||N===void 0?void 0:N.direction)==="vertical"?90:0);w=Math.max(w,Ll(Math.min(W,U),$,Y).width)});else{let S;if(lt(i.__ticksForVTable))S=i.__ticksForVTable;else{const A=C.range,R=Math.abs(A.min)>1?Math.round(A.min):A.min,x=Math.abs(A.max)>1?Math.round(A.max):A.max;S=[Ag(R),Ag(x)]}S.forEach(A=>{var R,x,T,M,B,P,F,H,E,k,I,L,D,O,N,W;C.label.formatMethod&&(A=C.label.formatMethod(A));const{width:$,height:U}=t.measureText(A,{fontSize:(T=(x=(R=C.label)===null||R===void 0?void 0:R.style)===null||x===void 0?void 0:x.fontSize)!==null&&T!==void 0?T:Ro,fontWeight:(P=(B=(M=C.label)===null||M===void 0?void 0:M.style)===null||B===void 0?void 0:B.fontWeight)!==null&&P!==void 0?P:"normal",fontFamily:(E=(H=(F=C.label)===null||F===void 0?void 0:F.style)===null||H===void 0?void 0:H.fontFamily)!==null&&E!==void 0?E:Ms}),Y=((I=(k=C.label)===null||k===void 0?void 0:k.style)===null||I===void 0?void 0:I.maxLineWidth)||1/0,j=((O=(D=(L=C.label)===null||L===void 0?void 0:L.style)===null||D===void 0?void 0:D.angle)!==null&&O!==void 0?O:0)+(((W=(N=C.label)===null||N===void 0?void 0:N.style)===null||W===void 0?void 0:W.direction)==="vertical"?90:0);w=Math.max(w,Ll(Math.min($,Y),U,j).width)})}w+=(n=C.label.space)!==null&&n!==void 0?n:4}let y=0;if(C.title.visible&&ce(C.title.text)){const{width:S,height:A}=t.measureText(C.title.text,{fontSize:(s=(r=(o=C.title)===null||o===void 0?void 0:o.style)===null||r===void 0?void 0:r.fontSize)!==null&&s!==void 0?s:Ro,fontWeight:(h=(a=(l=C.title)===null||l===void 0?void 0:l.style)===null||a===void 0?void 0:a.fontWeight)!==null&&h!==void 0?h:"normal",fontFamily:(c=(u=(d=C.title)===null||d===void 0?void 0:d.style)===null||u===void 0?void 0:u.fontFamily)!==null&&c!==void 0?c:Ms}),R=((f=(g=C.label)===null||g===void 0?void 0:g.style)===null||f===void 0?void 0:f.maxLineWidth)||1/0,x=Ll(Math.min(S,R),A,(m=(p=C.title)===null||p===void 0?void 0:p.style)===null||m===void 0?void 0:m.angle);y=i.orient!=="left"&&i.orient!=="right"||!C.title.autoRotate?x.width:x.height,y+=(b=C.title.space)!==null&&b!==void 0?b:4}return _+w+y+1}function $V(i,t){var e,n,o,r,s,l,a,h,d,u,c,g,f,p,m,b;const C=xt({},xg,i);let _=0;C.tick.visible!==!1&&(_=(e=C.tick.width)!==null&&e!==void 0?e:4);let w=0;if(C.label.visible){if(C.type==="band")C.domain.forEach(S=>{var A,R,x,T,M,B,P,F,H,E,k,I,L,D,O,N;C.label.formatMethod&&(S=C.label.formatMethod(S));const{width:W,height:$}=t.measureText(S,{fontSize:(x=(R=(A=C.label)===null||A===void 0?void 0:A.style)===null||R===void 0?void 0:R.fontSize)!==null&&x!==void 0?x:Ro,fontWeight:(B=(M=(T=C.label)===null||T===void 0?void 0:T.style)===null||M===void 0?void 0:M.fontWeight)!==null&&B!==void 0?B:"normal",fontFamily:(H=(F=(P=C.label)===null||P===void 0?void 0:P.style)===null||F===void 0?void 0:F.fontFamily)!==null&&H!==void 0?H:Ms}),U=((k=(E=C.label)===null||E===void 0?void 0:E.style)===null||k===void 0?void 0:k.maxLineWidth)||1/0,Y=((D=(L=(I=C.label)===null||I===void 0?void 0:I.style)===null||L===void 0?void 0:L.angle)!==null&&D!==void 0?D:0)+(((N=(O=C.label)===null||O===void 0?void 0:O.style)===null||N===void 0?void 0:N.direction)==="vertical"?90:0);w=Math.max(w,Ll(Math.min(W,U),$,Y).height)});else{let S;if(lt(i.__ticksForVTable))S=i.__ticksForVTable;else{const A=C.range,R=Math.abs(A.min)>1?Math.round(A.min):A.min,x=Math.abs(A.max)>1?Math.round(A.max):A.max;S=[Ag(R),Ag(x)]}S.forEach(A=>{var R,x,T,M,B,P,F,H,E,k,I,L,D,O,N,W;C.label.formatMethod&&(A=C.label.formatMethod(A));const{width:$,height:U}=t.measureText(A,{fontSize:(T=(x=(R=C.label)===null||R===void 0?void 0:R.style)===null||x===void 0?void 0:x.fontSize)!==null&&T!==void 0?T:Ro,fontWeight:(P=(B=(M=C.label)===null||M===void 0?void 0:M.style)===null||B===void 0?void 0:B.fontWeight)!==null&&P!==void 0?P:"normal",fontFamily:(E=(H=(F=C.label)===null||F===void 0?void 0:F.style)===null||H===void 0?void 0:H.fontFamily)!==null&&E!==void 0?E:Ms}),Y=((I=(k=C.label)===null||k===void 0?void 0:k.style)===null||I===void 0?void 0:I.maxLineWidth)||1/0,j=((O=(D=(L=C.label)===null||L===void 0?void 0:L.style)===null||D===void 0?void 0:D.angle)!==null&&O!==void 0?O:0)+(((W=(N=C.label)===null||N===void 0?void 0:N.style)===null||W===void 0?void 0:W.direction)==="vertical"?90:0);w=Math.max(w,Ll(Math.min($,Y),U,j).height)})}w+=(n=C.label.space)!==null&&n!==void 0?n:4}let y=0;if(C.title.visible&&C.title.text){const{width:S,height:A}=t.measureText(C.title.text,{fontSize:(s=(r=(o=C.title)===null||o===void 0?void 0:o.style)===null||r===void 0?void 0:r.fontSize)!==null&&s!==void 0?s:Ro,fontWeight:(h=(a=(l=C.title)===null||l===void 0?void 0:l.style)===null||a===void 0?void 0:a.fontWeight)!==null&&h!==void 0?h:"normal",fontFamily:(c=(u=(d=C.title)===null||d===void 0?void 0:d.style)===null||u===void 0?void 0:u.fontFamily)!==null&&c!==void 0?c:Ms}),R=((f=(g=C.label)===null||g===void 0?void 0:g.style)===null||f===void 0?void 0:f.maxLineWidth)||1/0,x=Ll(Math.min(S,R),A,(m=(p=C.title)===null||p===void 0?void 0:p.style)===null||m===void 0?void 0:m.angle);y=i.orient!=="bottom"&&i.orient!=="top"||!C.title.autoRotate?x.height:x.width,y+=(b=C.title.space)!==null&&b!==void 0?b:4}return _+w+y+1}function Ag(i){return typeof i!="number"&&(i=Number(i)),Number(i.toPrecision(1)).toString()}function Ll(i,t,e=0){const n=e*Math.PI/180,o=-i/2,r=-t/2,s=i/2,l=-t/2,a=i/2,h=t/2,d=-i/2,u=t/2,c={x:o*Math.cos(n)-r*Math.sin(n),y:o*Math.sin(n)+r*Math.cos(n)},g={x:s*Math.cos(n)-l*Math.sin(n),y:s*Math.sin(n)+l*Math.cos(n)},f={x:a*Math.cos(n)-h*Math.sin(n),y:a*Math.sin(n)+h*Math.cos(n)},p={x:d*Math.cos(n)-u*Math.sin(n),y:d*Math.sin(n)+u*Math.cos(n)},m=Math.min(c.x,g.x,f.x,p.x),b=Math.max(c.x,g.x,f.x,p.x),C=Math.min(c.y,g.y,f.y,p.y);return{width:b-m,height:Math.max(c.y,g.y,f.y,p.y)-C}}const GV='<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>';class UV{constructor(t,e){this._emptyTipOption={spaceBetweenTextAndIcon:20,text:"no data",textStyle:{fontSize:14,color:"#000"},icon:{image:GV,width:100,height:100}},this.isReleased=!1,this.table=e,this._emptyTipOption=Object.assign(this._emptyTipOption,t===!0?{}:t),this._emptyTipComponent=this._createOrUpdateEmptyTipComponent(this._getEmptyTipAttrs())}_createOrUpdateEmptyTipComponent(t){if(this._emptyTipComponent)sa(t,this._cacheAttrs)||this._emptyTipComponent.setAttributes(t);else{const e=new XS(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||this.table.options.indicatorsAsCol===!1?this.table.getFrozenColsWidth():0,n=!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,r=(this.table.rowHeaderLevelCount>0&&this.table.isListTable()?this.table.getDrawRange().height:this.table.tableNoFrameHeight)-n-this.table.getTheme().scrollStyle.width;this._emptyTipComponent.setAttributes({spaceBetweenTextAndIcon:this._emptyTipOption.spaceBetweenTextAndIcon,x:this.table.tableX+e,y:this.table.tableY+n,width:o,height:r,text:Object.assign(Object.assign({text:this._emptyTipOption.text},this._emptyTipOption.textStyle),{fill:(t=this._emptyTipOption.textStyle)===null||t===void 0?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&&this.table.recordsCount!==0||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||this.table.options.indicatorsAsCol===!1?this.table.getFrozenColsWidth():0,n=!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,r=(this.table.rowHeaderLevelCount>0&&this.table.isListTable()?this.table.getDrawRange().height:this.table.tableNoFrameHeight)-n-this.table.getTheme().scrollStyle.width;return{spaceBetweenTextAndIcon:this._emptyTipOption.spaceBetweenTextAndIcon,x:this.table.tableX+e,y:this.table.tableY+n,width:o,height:r,text:Object.assign(Object.assign({text:this._emptyTipOption.text},this._emptyTipOption.textStyle),{fill:(t=this._emptyTipOption.textStyle)===null||t===void 0?void 0:t.color}),icon:Object.assign({},this._emptyTipOption.icon)}}}var KV=globalThis&&globalThis.__rest||function(i,t){var e={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&t.indexOf(n)<0&&(e[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function"){var o=0;for(n=Object.getOwnPropertySymbols(i);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(i,n[o])&&(e[n[o]]=i[n[o]])}return e};const YV={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};function XV(i,t){const e=xt({},YV,i),{title:n={},item:o={},pager:r={},background:s={},type:l,id:a,visible:h,orient:d,position:u,data:c,filter:g,regionId:f,regionIndex:p,seriesIndex:m,seriesId:b,padding:C}=e,_=KV(e,["title","item","pager","background","type","id","visible","orient","position","data","filter","regionId","regionIndex","seriesIndex","seriesId","padding"]);return n.visible&&(_.title=lT(n)),qt(o.focusIconStyle)||ni(o.focusIconStyle),uo(o.shape),uo(o.label),uo(o.value),uo(o.background),_m(o.maxWidth)&&(o.maxWidth=Number(o.maxWidth.substring(0,o.maxWidth.length-1))*t.width/100),_m(o.width)&&(o.width=Number(o.width.substring(0,o.width.length-1))*t.width/100),_m(o.height)&&(o.height=Number(o.height.substring(0,o.height.length-1))*t.width/100),_.item=o,qt(r.textStyle)||ni(r.textStyle),uo(r.handler),_.pager=r,s.visible&&!qt(s.style)&&(xt(_,s.style),z(s.padding)&&(_.padding=s.padding)),_}class qV{constructor(t,e){var n,o,r,s;this.table=e,this.option=Ee(t),this.orient=(n=t.orient)!==null&&n!==void 0?n:"left",this.visible=(o=t.visible)===null||o===void 0||o,this.position=(r=t.position)!==null&&r!==void 0?r:"middle",this.selectedData=(s=t.defaultSelected)!==null&&s!==void 0?s:null,this.createComponent(),this.initEvent()}createComponent(){const t=this.getLegendAttributes({width:this.table.tableNoFrameWidth,height:this.table.tableNoFrameHeight}),e=new oc(xt({},t,{defaultSelected:this.selectedData,disableTriggerEvent:this.table.options.disableInteraction}));e.name="legend",this.legendComponent=e,this.visible===!1&&(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({maxWidth:this.table.tableNoFrameWidth,maxHeight:this.table.tableNoFrameHeight}),this.adjustTableSize(this.legendComponent.attribute))}adjustTableSize(t){var e,n;let o=isFinite(this.legendComponent.AABBBounds.width())?this.legendComponent.AABBBounds.width():0,r=isFinite(this.legendComponent.AABBBounds.height())?this.legendComponent.AABBBounds.height():0;if(o<=0||r<=0)return;const s=this.table.tableNoFrameWidth,l=this.table.tableNoFrameHeight,a=Qt((n=(e=t.padding)!==null&&e!==void 0?e:this.option.padding)!==null&&n!==void 0?n:10);let h=0,d=0;this.orient==="left"?(h=a[3],d=0,o+=a[1]+a[3]):this.orient==="top"?(h=0,d=a[0],r+=a[0]+a[2]):this.orient==="right"?(h=s-o-a[1],d=0,o+=a[1]+a[3]):this.orient==="bottom"&&(h=0,d=l-r-a[2],r+=a[0]+a[2]);const u=this.orient==="bottom"||this.orient==="top"?"horizontal":"vertical",c=this.position;let g=0,f=0;u==="horizontal"?g=c==="middle"?(s-o)/2:c==="end"?s-o-a[1]:a[3]:f=c==="middle"?(l-r)/2:c==="end"?l-r-a[2]:a[0],this.legendComponent.setAttributes({dx:g,dy:f,x:h,y:d}),this.orient==="left"?(this.table.tableNoFrameWidth=this.table.tableNoFrameWidth-Math.ceil(o),this.table.tableX+=Math.ceil(o)):this.orient==="top"?(this.table.tableNoFrameHeight=this.table.tableNoFrameHeight-Math.ceil(r),this.table.tableY+=Math.ceil(r)):this.orient==="right"?this.table.tableNoFrameWidth=this.table.tableNoFrameWidth-Math.ceil(o):this.orient==="bottom"&&(this.table.tableNoFrameHeight=this.table.tableNoFrameHeight-Math.ceil(r))}getLegendAttributes(t){var e,n;const o=this.orient==="bottom"||this.orient==="top"?"horizontal":"vertical",r=XV(this.option,t),s=Qt((n=(e=r.padding)!==null&&e!==void 0?e:this.option.padding)!==null&&n!==void 0?n:10);return Object.assign({layout:o,items:this.getLegendItems(),maxWidth:t.width-s[1]-s[3],maxHeight:t.height-s[0]-s[2]},r)}getLegendItems(){return this.option.data}initEvent(){this.legendComponent&&(this.legendComponent.addEventListener(Dn.legendItemClick,t=>{const e=Ci(t,"detail.currentSelected");this.table.fireListeners(at.LEGEND_ITEM_CLICK,{model:this,value:e,event:t})}),this.legendComponent.addEventListener(Dn.legendItemHover,t=>{const e=Ci(t,"detail");this.table.fireListeners(at.LEGEND_ITEM_HOVER,{model:this,value:e,event:t})}),this.legendComponent.addEventListener(Dn.legendItemUnHover,t=>{const e=Ci(t,"detail");this.table.fireListeners(at.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 ZV=globalThis&&globalThis.__rest||function(i,t){var e={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&t.indexOf(n)<0&&(e[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function"){var o=0;for(n=Object.getOwnPropertySymbols(i);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(i,n[o])&&(e[n[o]]=i[n[o]])}return e};const Tg={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"}}}},JV={horizontal:Object.assign(Object.assign({},Tg),{rail:{width:200,height:8,style:{fill:"rgba(0,0,0,0.04)"}}}),vertical:Object.assign(Object.assign({},Tg),{rail:{width:8,height:200,style:{fill:"rgba(0,0,0,0.04)"}}})},QV={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)"}}},Tg),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)"}}},Tg)};function t9(i,t){const e=xt({},(i.type==="color"?JV:QV)[i.orient==="bottom"||i.orient==="top"?"horizontal":"vertical"],i),{title:n={},handler:o={},rail:r={},track:s={},startText:l,endText:a,handlerText:h,sizeBackground:d,background:u={},type:c,id:g,visible:f,orient:p,position:m,data:b,defaultSelected:C,field:_,filter:w,regionId:y,regionIndex:S,seriesIndex:A,seriesId:R,padding:x}=e,T=ZV(e,["title","handler","rail","track","startText","endText","handlerText","sizeBackground","background","type","id","visible","orient","position","data","defaultSelected","field","filter","regionId","regionIndex","seriesIndex","seriesId","padding"]);return n.visible&&(T.title=lT(n)),T.showHandler=o.visible!==!1,qt(o.style)||(T.handlerStyle=ni(o.style)),z(r.width)&&(T.railWidth=r.width),z(r.height)&&(T.railHeight=r.height),qt(r.style)||(T.railStyle=ni(r.style)),qt(s.style)||(T.trackStyle=ni(s.style)),T.startText=uo(l),T.endText=uo(a),T.handlerText=uo(h),qt(d)||(T.sizeBackground=ni(d)),u.visible&&!qt(u.style)&&(xt(T,u.style),z(u.padding)&&(T.padding=u.padding)),T}class e9{constructor(t,e){var n,o,r,s;this.table=e,this.option=Ee(t),this.orient=(n=t.orient)!==null&&n!==void 0?n:"left",this.visible=(o=t.visible)===null||o===void 0||o,this.position=(r=t.position)!==null&&r!==void 0?r:"middle",this.selectedData=(s=t.defaultSelected)!==null&&s!==void 0?s:null,this.createComponent(),this.initEvent()}createComponent(){const t=this.getLegendAttributes({width:this.table.tableNoFrameWidth,height:this.table.tableNoFrameHeight});let e;e=this.option.type==="color"?new sc(xt({},t,{slidable:!0})):new lc(xt({},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,n;let o=isFinite(this.legendComponent.AABBBounds.width())?this.legendComponent.AABBBounds.width():0,r=isFinite(this.legendComponent.AABBBounds.height())?this.legendComponent.AABBBounds.height():0;if(o<=0||r<=0)return;const s=this.table.tableNoFrameWidth,l=this.table.tableNoFrameHeight,a=Qt((n=(e=t.padding)!==null&&e!==void 0?e:this.option.padding)!==null&&n!==void 0?n:10);let h=0,d=0;this.orient==="left"?(h=a[3],d=0,o+=a[1]+a[3]):this.orient==="top"?(h=0,d=a[0],r+=a[0]+a[2]):this.orient==="right"?(h=s-o-a[1],d=0,o+=a[1]+a[3]):this.orient==="bottom"&&(h=0,d=l-r-a[2],r+=a[0]+a[2]);const u=this.orient==="bottom"||this.orient==="top"?"horizontal":"vertical",c=this.position;let g=0,f=0;u==="horizontal"?g=c==="middle"?(s-o)/2:c==="end"?s-o-a[1]:a[3]:f=c==="middle"?(l-r)/2:c==="end"?l-r-a[2]:a[0],this.legendComponent.setAttributes({dx:g,dy:f,x:h,y:d}),this.orient==="left"?(this.table.tableNoFrameWidth=this.table.tableNoFrameWidth-Math.ceil(o),this.table.tableX+=Math.ceil(o)):this.orient==="top"?(this.table.tableNoFrameHeight=this.table.tableNoFrameHeight-Math.ceil(r),this.table.tableY+=Math.ceil(r)):this.orient==="right"?this.table.tableNoFrameWidth=this.table.tableNoFrameWidth-Math.ceil(o):this.orient==="bottom"&&(this.table.tableNoFrameHeight=this.table.tableNoFrameHeight-Math.ceil(r))}getLegendAttributes(t){const e=this.orient==="bottom"||this.orient==="top"?"horizontal":"vertical",n=e==="horizontal"?"bottom":this.orient;return Object.assign(Object.assign({},t9(this.option)),{layout:e,align:n,min:this.option.min,max:this.option.max,value:this.option.value,[this.option.type==="color"?"colors":"sizeRange"]:this.option.type==="color"?this.option.colors:this.option.sizeRange})}initEvent(){this.legendComponent&&this.legendComponent.addEventListener("change",t=>{const e=Ci(t,"detail.value");this.table.fireListeners(at.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 i9(i,t){return i.type==="color"||i.type==="size"?new e9(i,t):new qV(i,t)}class mT{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,n){return this._getMenuElement().bindToCell(this._table,t,e,n)}unbindMenuElement(){this._getMenuElement().unbindFromCell()}pointInMenuElement(t,e){return this._getMenuElement().pointInMenuElement(t,e)}}const cv="vtable__menu-element",kl=`${cv}--hidden`,gv=`${cv}--shown`;function n9(){return xo("div",[cv,kl])}class o9{constructor(t){var e,n,o;this._handler=new mc,this._rootElement=n9(),this._rootElement.addEventListener("wheel",r=>{r.stopPropagation()}),(e=this._rootElement)===null||e===void 0||e.addEventListener("mousedown",r=>{r.stopPropagation(),r.preventDefault()}),(n=this._rootElement)===null||n===void 0||n.addEventListener("click",r=>{if(r.stopPropagation(),r.preventDefault(),this._rootElement.classList.contains(kl))return;const{col:s,row:l,dropDownIndex:a,menuKey:h,text:d,hasChildren:u}=r.target;if(typeof a!="number"||u)return void r.stopPropagation();const c=t.isPivotTable()?t.internalProps.layoutMap.getPivotDimensionInfo(s,l):t.getHeaderField(s,l),g=t._dropDownMenuIsHighlight(s,l,a);t.fireListeners(at.DROPDOWN_MENU_CLICK,{col:s,row:l,field:c,menuKey:h,text:d,highlight:g,cellLocation:t.getCellLocation(s,l),event:r}),t.fireListeners(at.DROPDOWN_MENU_CLEAR,null),t.fireListeners(at.HIDE_MENU,null),r.stopPropagation()}),(o=this._rootElement)===null||o===void 0||o.addEventListener("mousemove",r=>{this._rootElement.classList.contains(kl)||r.stopPropagation()})}get rootElement(){return this._rootElement}release(){this.unbindFromCell();const t=this._rootElement;t!=null&&t.parentElement&&t.parentElement.removeChild(t),this._handler.release(),delete this._rootElement}bindToCell(t,e,n,o){const r=this._rootElement;if(this._menuInstanceInfo=o,r==null||r.classList.remove(gv),r==null||r.classList.add(kl),this._canBindToCell(t,e,n)){if(r.innerHTML="",r.appendChild(o.content),this._bindCell(t,e,n,o.position,o.referencePosition))return r==null||r.classList.add(gv),r==null||r.classList.remove(kl),!0}else this.unbindFromCell();return!1}unbindFromCell(){const t=this._rootElement;this._menuInstanceInfo=void 0,t!=null&&t.parentElement&&(t.classList.remove(gv),t.classList.add(kl))}_canBindToCell(t,e,n){const o=t.getCellRangeRelativeRect({col:e,row:n}),r=t.getElement(),{top:s,bottom:l,left:a,right:h}=o;if(t.isFrozenCell(e,n))return!0;if(l<t.getFrozenRowsHeight()||h<t.getFrozenColsWidth()||a>t.tableNoFrameWidth-t.getRightFrozenColsWidth()||s>t.tableNoFrameHeight-t.getBottomFrozenRowsHeight())return!1;const{offsetHeight:d,offsetWidth:u}=r;return!(d<s)&&!(u<a)}_bindCell(t,e,n,o,r){const s=this._rootElement,l=t.getElement(),{width:a,height:h}=t.internalProps.element.getBoundingClientRect();if(s){s.parentElement!==l&&l.appendChild(s),s.style.left="0px";const d=.8*a;s.style.maxWidth=`${d}px`;const u=s.clientWidth,c=s.clientHeight;let g,f;return o&&(g=o.x,f=o.y),r&&(g=r.rect.right-u,f=r.rect.bottom),f+c>h&&(f=h-c,g+=u-2),f<0&&(f/=2),s.style.top=`${f}px`,g<0?g=0:g+u>a&&(g=a-u),s.style.left=`${g}px`,!0}return!1}pointInMenuElement(t,e){const n=this._rootElement,{x:o,y:r,width:s,height:l}=n.getBoundingClientRect();return t>o-5&&t<o+s+5&&e>r-5&&e<r+l+5}}class vT extends mT{createMenuElementInternal(){return new y8(this._table)}}let r9=class extends mT{createMenuElementInternal(){return new o9(this._table)}};const s9={"dropdown-menu":function(i){return new vT(i)},"context-menu":function(i){return new vT(i)},container:i=>new r9(i)};function l9(i,t,e,n,o){var r;const{lineHeight:s,textBaseline:l,textStick:a}=i._getCellStyle(t,e);let h=i.getCellRangeRelativeRect(i.getCellRange(t,e));a&&(h=i.getVisibleCellRangeRelativeRect({col:t,row:e}));let{left:d,right:u,bottom:c,top:g,width:f,height:p}=h;if(i.isHeader(t,e)&&({left:d,right:u,bottom:c,top:g,width:f,height:p}=i.internalProps.headerHelper.getDropDownIconRect(h,s,l||"middle")),o==null?void 0:o.content)return{type:n,position:o.position,referencePosition:(r=o.referencePosition)!==null&&r!==void 0?r:{rect:{left:d,right:u,top:g,bottom:c,width:f,height:p}},content:o.content};if(n==="dropdown-menu"){const{dropDownMenu:m=i.globalDropDownMenu,pivotInfo:b}=i._getHeaderLayoutMap(t,e);return{type:n,referencePosition:{rect:{left:d,right:u,top:g,bottom:c,width:f,height:p}},content:m,pivotInfo:b}}return null}class a9{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,n,o){var r;const s=this._attachInfo,l=this._getMenuInstanceInfo(t,e,n,o);if(!s||l&&s.instance===l.instance||((r=s.instance)===null||r===void 0||r.unbindMenuElement(),this._attachInfo=null),!l)return;const{instance:a,info:h}=l;if(a&&a.bindMenuElement(t,e,h)){const d=this._table.getCellRange(t,e);this._attachInfo={range:d,instance:a}}}_unbindFromCell(){const t=this._attachInfo;if(!t)return;const{instance:e}=t;e==null||e.unbindMenuElement(),this._attachInfo=null}_isBindToCell(t,e){const n=this._attachInfo;return!!n&&Yi(n.range,t,e)}pointInMenuElement(t,e){if(!this._attachInfo)return!1;const n=this._attachInfo,{instance:o}=n;return o.pointInMenuElement(t,e)}_bindTableEvent(t){t.on(at.DROPDOWN_ICON_CLICK,e=>{this._attachInfo&&this._isBindToCell(e.col,e.row)?this._unbindFromCell():this._bindToCell(e.col,e.row,"dropdown-menu")}),t.on(at.DROPDOWN_MENU_CLEAR,e=>{this._unbindFromCell()}),t.on(at.CONTEXTMENU_CELL,e=>{var n,o,r,s;if(((n=t.internalProps.menu)===null||n===void 0?void 0:n.renderMode)==="html"){const l=t._getMouseAbstractPoint(e.event,!1);let a=null;l.inTable&&typeof((o=t.internalProps.menu)===null||o===void 0?void 0:o.contextMenuItems)=="function"?a=t.internalProps.menu.contextMenuItems(t.getHeaderField(e.col,e.row),e.row,e.col,t):l.inTable&&Array.isArray((r=t.internalProps.menu)===null||r===void 0?void 0:r.contextMenuItems)&&(a=(s=t.internalProps.menu)===null||s===void 0?void 0:s.contextMenuItems),this._bindToCell(e.col,e.row,"context-menu",{content:a,position:{x:l.x,y:l.y}})}})}_getMenuInstanceInfo(t,e,n,o){const r=this._table,s=this._menuInstances,l=l9(r,t,e,n,o);return l?{instance:s&&s[n]||s&&(s[n]=s9[n](r)),type:n,info:l}:null}}class h9{constructor(t,e){this.isReleased=!1,this.table=e,this._titleOption=xt({orient:"top"},t),t.visible!==!1&&(this._titleComponent=this._createOrUpdateTitleComponent(this._getTitleAttrs()))}_createOrUpdateTitleComponent(t){if(this._titleComponent)sa(t,this._cacheAttrs)||this._titleComponent.setAttributes(t);else{const e=new YS(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,n,o,r;if(!this._titleComponent)return;const s=Qt((t=this._titleOption.padding)!==null&&t!==void 0?t:10),l=(e=this._titleOption.width)!==null&&e!==void 0?e:(this.table.widthMode==="adaptive"?this.table.tableNoFrameWidth:Math.min(this.table.tableNoFrameWidth,this.table.getDrawRange().width))-s[1]-s[3],a=(n=this._titleOption.height)!==null&&n!==void 0?n:(this.table.heightMode==="adaptive"?this.table.tableNoFrameHeight:Math.min(this.table.tableNoFrameHeight,this.table.getDrawRange().height))-s[0]-s[2];this._titleComponent.setAttributes({x:((o=this._titleOption.x)!==null&&o!==void 0?o:this._titleOption.orient==="right")?this.table.tableX+Math.min(this.table.tableNoFrameWidth,this.table.getDrawRange().width):this.table.tableX,y:((r=this._titleOption.y)!==null&&r!==void 0?r:this._titleOption.orient==="bottom")?this.table.tableY+this.table.tableNoFrameHeight:this.table.tableY,width:this._titleOption.orient==="top"||this._titleOption.orient==="bottom"?l:this._titleOption.width,height:this._titleOption.orient==="left"||this._titleOption.orient==="right"?a:this._titleOption.height,textStyle:Object.assign({width:l},this._titleOption.textStyle),subtextStyle:Object.assign({width:l},this._titleOption.subtextStyle)}),this._adjustTableSize(this._titleComponent.attribute)}_adjustTableSize(t){var e,n,o,r;const s=isFinite((e=this._titleComponent)===null||e===void 0?void 0:e.AABBBounds.width())?this._titleComponent.AABBBounds.width():0,l=isFinite((n=this._titleComponent)===null||n===void 0?void 0:n.AABBBounds.height())?this._titleComponent.AABBBounds.height():0;this._titleOption.orient==="left"?(this.table.tableNoFrameWidth=this.table.tableNoFrameWidth-Math.ceil(s),this.table.tableX+=Math.ceil(s)):this._titleOption.orient==="top"?(this.table.tableNoFrameHeight=this.table.tableNoFrameHeight-Math.ceil(l),this.table.tableY+=Math.ceil(l)):this._titleOption.orient==="right"?this.table.tableNoFrameWidth=this.table.tableNoFrameWidth-Math.ceil(s):this._titleOption.orient==="bottom"&&(this.table.tableNoFrameHeight=this.table.tableNoFrameHeight-Math.ceil(l)),this._cacheAttrs=t,this._titleOption.orient!=="right"&&this._titleOption.orient!=="bottom"||this._titleComponent.setAttributes({x:((o=this._titleOption.x)!==null&&o!==void 0?o:this._titleOption.orient==="right")?this.table.tableX+this.table.tableNoFrameWidth:this.table.tableX,y:((r=this._titleOption.y)!==null&&r!==void 0?r:this._titleOption.orient==="bottom")?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,n,o,r,s,l,a,h,d,u;const c=this._titleOption.text||this._titleOption.subtext?10:0,g=Qt((t=this._titleOption.padding)!==null&&t!==void 0?t:c),f=(e=this._titleOption.width)!==null&&e!==void 0?e:Math.min(this.table.tableNoFrameWidth,this.table.getDrawRange().width)-g[1]-g[3],p=(n=this._titleOption.height)!==null&&n!==void 0?n:Math.min(this.table.tableNoFrameHeight,this.table.getDrawRange().height)-g[0]-g[2];return{text:(o=this._titleOption.text)!==null&&o!==void 0?o:"",subtext:(r=this._titleOption.subtext)!==null&&r!==void 0?r:"",x:((s=this._titleOption.x)!==null&&s!==void 0?s:this._titleOption.orient==="right")?this.table.tableX+Math.min(this.table.tableNoFrameWidth,this.table.getDrawRange().width):this.table.tableX,y:((l=this._titleOption.y)!==null&&l!==void 0?l:this._titleOption.orient==="bottom")?this.table.tableY+this.table.tableNoFrameHeight:this.table.tableY,width:this._titleOption.orient==="top"||this._titleOption.orient==="bottom"?f:this._titleOption.width,height:this._titleOption.orient==="left"||this._titleOption.orient==="right"?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:(a=this._titleOption.align)!==null&&a!==void 0?a:"left",verticalAlign:(h=this._titleOption.verticalAlign)!==null&&h!==void 0?h:"top",textStyle:Object.assign({width:f},this._titleOption.textStyle),subtextStyle:Object.assign({width:f},this._titleOption.subtextStyle),dx:(d=this._titleOption.dx)!==null&&d!==void 0?d:0,dy:(u=this._titleOption.dy)!==null&&u!==void 0?u:0}}getComponentGraphic(){return this._titleComponent}}class d9{constructor(t){this._table=t}release(){var t,e;this.unbindTooltipElement(),this._tooltipElement&&((e=(t=this._tooltipElement).release)===null||e===void 0||e.call(t)),this._tooltipElement=void 0}_getTooltipElement(){return this._tooltipElement||(this._tooltipElement=this.createTooltipElementInternal()),this._tooltipElement}bindTooltipElement(t,e,n,o){return this._getTooltipElement().bindToCell(this._table,t,e,n,o)}moveTooltipElement(t,e,n,o){this._getTooltipElement().move(this._table,t,e,n,o)}unbindTooltipElement(){this._getTooltipElement().unbindFromCell()}locateTooltipElement(t,e,n,o,r){this._getTooltipElement()._locate(this._table,t,e,n,o,r)}}function u9(){if(oe.mode==="node")return;const i=document.createElement("style");i.id="vtable-tooltip-styleSheet",i.textContent=`
|
|
225
225
|
@keyframes vtable__bubble-tooltip-element--shown-animation {
|
|
226
226
|
0% {
|
|
227
227
|
opacity: 0;
|
|
@@ -306,7 +306,7 @@
|
|
|
306
306
|
border: 1px solid #E6E8ED;
|
|
307
307
|
}
|
|
308
308
|
`,document.head.appendChild(i)}u9();const kh="vtable__bubble-tooltip-element",bT=`${kh}__content`,CT=`${kh}__triangle`,Fl=`${kh}--hidden`,Fh=`${kh}--shown`;class c9{constructor(){this._handler=new mc;const t=this._rootElement=xo("div",[kh,Fl]),e=xo("div",[bT]),n=xo("span",[CT]);t.appendChild(n),t.appendChild(e),this._messageElement=t.querySelector(`.${bT}`)||void 0,this._triangleElement=t.querySelector(`.${CT}`)||void 0,t.addEventListener("mousemove",()=>{this._disappearDelayId&&clearTimeout(this._disappearDelayId)}),t.addEventListener("mouseleave",()=>{this._disappearDelay=void 0,this.unbindFromCell()}),e.addEventListener("wheel",o=>{o.stopPropagation()}),e.addEventListener("copy",o=>{r4(e)&&o.stopPropagation()})}bindToCell(t,e,n,o,r){var s,l,a,h,d,u,c,g,f,p,m,b,C,_,w,y,S,A,R;this._disappearDelay=o==null?void 0:o.disappearDelay,this._disappearDelayId&&clearTimeout(this._disappearDelayId);const x=this._rootElement,T=this._messageElement,M=this._triangleElement;if(x==null||x.classList.remove(Fh),x==null||x.classList.add(Fl),this._canBindToCell(t,e,n)){if(T.setAttribute("style",""),M.setAttribute("style",""),o!=null&&o.className&&x.classList.add(o.className),!((s=o==null?void 0:o.style)===null||s===void 0)&&s.bgColor&&(T.style.backgroundColor=(l=o==null?void 0:o.style)===null||l===void 0?void 0:l.bgColor),!((a=o==null?void 0:o.style)===null||a===void 0)&&a.bgColor&&(M.style.backgroundColor=(h=o==null?void 0:o.style)===null||h===void 0?void 0:h.bgColor),M.style.display=((d=o==null?void 0:o.style)===null||d===void 0?void 0:d.arrowMark)===!0?"block":"none",!((u=o==null?void 0:o.style)===null||u===void 0)&&u.fontSize&&(T.style.fontSize=((g=(c=o==null?void 0:o.style)===null||c===void 0?void 0:c.fontSize)!==null&&g!==void 0?g:12)+"px"),!((f=o==null?void 0:o.style)===null||f===void 0)&&f.fontFamily&&(T.style.fontFamily=(p=o==null?void 0:o.style)===null||p===void 0?void 0:p.fontFamily),!((m=o==null?void 0:o.style)===null||m===void 0)&&m.color&&(T.style.color=(b=o==null?void 0:o.style)===null||b===void 0?void 0:b.color),!((C=o==null?void 0:o.style)===null||C===void 0)&&C.padding&&(T.style.padding=`${(_=o==null?void 0:o.style)===null||_===void 0?void 0:_.padding.join("px ")}px`),!((w=o==null?void 0:o.style)===null||w===void 0)&&w.maxHeight&&(T.style.maxHeight=`${(y=o==null?void 0:o.style)===null||y===void 0?void 0:y.maxHeight}px`),!((S=o==null?void 0:o.style)===null||S===void 0)&&S.maxWidth&&(T.style.maxWidth=`${(A=o==null?void 0:o.style)===null||A===void 0?void 0:A.maxWidth}px`),T&&(T.textContent=o==null?void 0:o.content),this._bindToCell(t,e,n,o==null?void 0:o.position,o==null?void 0:o.referencePosition,r,(R=o==null?void 0:o.style)===null||R===void 0?void 0:R.arrowMark))return x==null||x.classList.add(Fh),x==null||x.classList.remove(Fl),!0}else this.unbindFromCell();return!1}release(){var t,e;this.unbindFromCell();const n=this._rootElement;n!=null&&n.parentElement&&n.parentElement.removeChild(n),(e=(t=this._handler)===null||t===void 0?void 0:t.release)===null||e===void 0||e.call(t),delete this._rootElement,delete this._messageElement}move(t,e,n,o,r){const s=this._rootElement;this._canBindToCell(t,e,n)?(this._bindToCell(t,e,n,o==null?void 0:o.position,o==null?void 0:o.referencePosition,r),s==null||s.classList.add(Fh),s==null||s.classList.remove(Fl)):this.unbindFromCell()}unbindFromCell(){var t;if(this._disappearDelay)this._disappearDelayId=setTimeout(()=>{const e=this._rootElement;e!=null&&e.parentElement&&(e.classList.remove(Fh),e.classList.add(Fl))},(t=this._disappearDelay)!==null&&t!==void 0?t:0);else{const e=this._rootElement;e!=null&&e.parentElement&&(e.classList.remove(Fh),e.classList.add(Fl))}}_canBindToCell(t,e,n){const o=t.getCellRangeRelativeRect({col:e,row:n}),r=t.getElement(),{bottom:s,left:l,right:a,top:h}=o;if(t.isFrozenCell(e,n))return!0;if(s<t.getFrozenRowsHeight()||a<t.getFrozenColsWidth()||l>t.tableNoFrameWidth-t.getRightFrozenColsWidth()||h>t.tableNoFrameHeight-t.getBottomFrozenRowsHeight())return!1;const{offsetHeight:d,offsetWidth:u}=r;return!(h>d)&&!(l>u)}_bindToCell(t,e,n,o,r,s,l){const a=this._rootElement,h=t.getCellRangeRelativeRect({col:e,row:n}),d=t.internalProps.tooltip.parentElement,u=t.internalProps.element.offsetWidth,{width:c}=h;if(a){let g,f;a.parentElement!==d&&d.appendChild(a),a.style.left="0px";const p=Math.min(.8*u,4*c);a.style.maxWidth=`${p}px`;const m=a.clientWidth,b=a.clientHeight;if(!o&&!r)return!1;{const T=this.getComputedPosition(t,e,n,o,r,s,l);f=T.x,g=T.y}a.style.left=`${f}px`,a.style.top=`${g}px`,rm()&&(a.style.fontSize="11px");const{x1:C,x2:_,y1:w,y2:y}=t.stateManager.menu.bounds,S=f,A=S+m,R=g,x=S+b;return!(t.stateManager.menu.isShow&&C<A&&_>S&&y>R&&w<x)}return!1}getComputedPosition(t,e,n,o,r,s,l){var a;const h=this._rootElement,d=t.getCellRangeRelativeRect({col:e,row:n}),{x:u,y:c}=t.internalProps.tooltip.parentElement.getBoundingClientRect(),{width:g,height:f,x:p,y:m}=t.internalProps.element.getBoundingClientRect(),{width:b}=d;let C,_;const w=Math.min(.8*g,4*b);h.style.maxWidth=`${w}px`;const y=h.clientWidth,S=h.clientHeight,A=l?6:0;if(o)_=o.x,C=o.y+A,this._triangleElement.style.left="50%",this._triangleElement.style.marginLeft="-5px",this._triangleElement.style.top="-5px";else if(r){let R=(a=r.placement)!==null&&a!==void 0?a:tn.bottom;const x=r.rect.left+r.rect.width/2,T=r.rect.top+r.rect.height/2,M=r.rect.top,B=r.rect.bottom,P=r.rect.left,F=r.rect.right;let H=0;const E=()=>{H++,H>=4||(this.removeStyleFromTriangle(),R===tn.top?(_=x-y/2,C=M-S-A,this._triangleElement.style.left="50%",this._triangleElement.style.marginLeft="-5px",this._triangleElement.style.bottom="-5px",s&&C<0&&(R=tn.right,E())):R===tn.bottom?(_=x-y/2,C=B+A,this._triangleElement.style.left="50%",this._triangleElement.style.marginLeft="-5px",this._triangleElement.style.top="-5px",s&&C+S>f&&(R=tn.left,E())):R===tn.left?(C=T-S/2,_=P-y-A,this._triangleElement.style.top="50%",this._triangleElement.style.marginTop="-5px",this._triangleElement.style.right="-5px",s&&_<0&&(R=tn.top,E())):R===tn.right&&(C=T-S/2,_=F+A,this._triangleElement.style.top="50%",this._triangleElement.style.marginTop="-5px",this._triangleElement.style.left="-5px",s&&_+y>g&&(R=tn.bottom,E())))};E()}return s&&(_<0?_=0:_+h.offsetWidth>g&&(_=g-h.offsetWidth)),{x:_+p-u,y:C+m-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,n,o,r,s){const l=this.getComputedPosition(t,e,n,o,r,s),a=l.x,h=l.y;this._rootElement.style.left=`${a}px`,this._rootElement.style.top=`${h}px`}}class g9 extends d9{createTooltipElementInternal(){return new c9}}const f9={"bubble-tooltip":function(i){return new g9(i)}};class p9{constructor(t,e){this._table=t,this._tooltipInstances={},this._bindTableEvent(t),this.confine=e}release(){var t,e;const n=this._tooltipInstances;for(const o in n)(e=(t=n[o])===null||t===void 0?void 0:t.release)===null||e===void 0||e.call(t);delete this._tooltipInstances,this._attachInfo=null}_bindToCell(t,e,n){var o;const r=this._attachInfo,s=this._getTooltipInstanceInfo(t,e);if(!r||s&&r.instance===s||((o=r.instance)===null||o===void 0||o.unbindTooltipElement(),this._attachInfo=null),!!s&&s&&s.bindTooltipElement(t,e,n,this.confine)){const l=this._table.getCellRange(t,e);this._attachInfo={range:l,instance:s,tooltipOptions:n}}}_move(t,e,n){const o=this._attachInfo;if(!o||!Yi(o.range,t,e))return;const{instance:r}=o;r==null||r.moveTooltipElement(t,e,n,this.confine)}moveToPosition(t,e,n,o){const r=this._attachInfo;if(!r||!Yi(r.range,t,e))return;const{instance:s}=r;this._attachInfo.tooltipOptions.position=n,this._attachInfo.tooltipOptions.referencePosition=o,s==null||s.locateTooltipElement(t,e,n,o,this.confine)}_unbindFromCell(){const t=this._attachInfo;if(!t)return;const{instance:e}=t;e==null||e.unbindTooltipElement(),this._attachInfo=null}_isBindCell(t,e){const n=this._attachInfo;return!!n&&Yi(n.range,t,e)}_bindTableEvent(t){t.on(at.MOUSEENTER_CELL,e=>{if(rm())return;const{x1:n,x2:o,y1:r,y2:s}=t.stateManager.menu.bounds;if(t.stateManager.menu.isShow&&typeof e.x=="number"&&typeof e.y=="number"&&e.x>n&&e.x<o&&e.y>r&&e.y<s)return;const{col:l,row:a}=e;this.showTooltip(l,a)}),t.on(at.MOUSEMOVE_CELL,e=>{var n,o;if(!rm()){if(!((o=(n=this._attachInfo)===null||n===void 0?void 0:n.tooltipOptions)===null||o===void 0)&&o.referencePosition){const r=this._attachInfo.tooltipOptions.referencePosition,{event:s}=e,{left:l,right:a,top:h,bottom:d}=r.rect,u=t._getMouseAbstractPoint(s,!1);u.inTable&&u.x>=l-5&&u.x<=a+5&&u.y>=h-5&&u.y<=d+5||this._unbindFromCell()}this._attachInfo&&t.stateManager.menu.isShow&&this._bindToCell(e.col,e.row)}}),t.on(at.MOUSELEAVE_CELL,e=>{this._unbindFromCell()}),t.on(at.SELECTED_CELL,e=>{this._isBindCell(e.col,e.row)&&this._unbindFromCell()}),t.on(at.MOUSELEAVE_TABLE,e=>{this._unbindFromCell()}),t.on(at.SCROLL,e=>{this._unbindFromCell()})}showTooltip(t,e){var n,o,r;let s;const l=this._table,a=l.getHeaderDescription(t,e);if(a){const h=l.getCellRangeRelativeRect({col:t,row:e});s={content:a,referencePosition:{placement:tn.bottom,rect:h},disappearDelay:(n=l.internalProps.tooltip.overflowTextTooltipDisappearDelay)!==null&&n!==void 0?n:0,style:l.theme.tooltipStyle}}else if(ue((o=l.internalProps.tooltip)===null||o===void 0?void 0:o.isShowOverflowTextTooltip)?l.internalProps.tooltip.isShowOverflowTextTooltip(t,e,l):l.internalProps.tooltip.isShowOverflowTextTooltip){const h=l.getCellOverflowText(t,e),d=l.getCellRangeRelativeRect({col:t,row:e});h&&(s={content:a?`${a}
|
|
309
|
-
${h}`:h,referencePosition:{placement:tn.bottom,rect:d},disappearDelay:(r=l.internalProps.tooltip.overflowTextTooltipDisappearDelay)!==null&&r!==void 0?r:0,style:l.theme.tooltipStyle})}s?this._bindToCell(t,e,s):this._unbindFromCell()}_getTooltipInstanceInfo(t,e){const n=this._table,o=this._tooltipInstances;return o&&o["bubble-tooltip"]||o&&(o["bubble-tooltip"]=f9["bubble-tooltip"](n))}isBinded(t){var e;return JSON.stringify(t)===JSON.stringify((e=this._attachInfo)===null||e===void 0?void 0:e.tooltipOptions)}}const Mg=()=>{Bt.registerComponent("axis",WV),Bt.registerFunction("computeAxisComponentWidth",jV),Bt.registerFunction("computeAxisComponentHeight",$V),Bt.registerFunction("getAxisConfigInPivotChart",I8)},Bg=()=>{Bt.registerComponent("emptyTip",UV)},Pg=()=>{Bt.registerFunction("createLegend",i9)},Hg=()=>{Bt.registerComponent("menuHandler",a9)},Eg=()=>{Bt.registerComponent("title",h9)},Lg=()=>{Bt.registerComponent("tooltipHandler",p9)};class m9{constructor(t){this.titleRows=[],this.showedTitleRows=[],this.rowNow=-1,this.skipStartRow=-1,this.skipEndRow=-1,this.table=t,this.table.on("scroll",e=>{e.scrollDirection==="vertical"&&this.updateGroupTitle()}),this.table.on("resize_column",e=>{this.updateGroupTitle()})}updateGroupTitle(){this.table.scrollTop===0?(this.titleRows=[],this.showedTitleRows=[]):this.skipStartRow!==-1&&this.skipEndRow!==-1&&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){lt(t)||(t=[t]),lt(e)||(e=[e]);for(let l=0;l<t.length;l++){const a=t.slice(0,l+1);this.table.dataSource.getRaw(a)}const n=[],o=e.length===t.length+1;let r=t.slice(0,o?t.length:t.length-1);const s=this.table.dataSource.currentIndexedData;for(let l=this.rowNow-this.table.columnHeaderLevelCount;l>=0;l--){const a=s[l];if(lt(a)&&r.length===a.length){let h=!0;for(let d=0;d<a.length;d++)if(a[d]!==r[d]){h=!1;break}h&&(n.push(l+this.table.columnHeaderLevelCount),r=r.slice(0,r.length-1))}else if(a===t[0]){n.push(l+this.table.columnHeaderLevelCount);break}}this.titleRows=n.reverse()}updateScenegraph(){const{table:t}=this,{shadowGroup:e,shadowGroupFrozen:n}=b9(t);this.showedTitleRows.length=0;let o=0;for(let r=0;r<t.colCount;r++){let s;r<t.frozenColCount?(s=new de({x:t.getColsWidth(0,r-1),y:t.getFrozenRowsHeight()}),n.add(s)):(s=new de({x:t.getColsWidth(t.frozenColCount,r-1),y:t.getFrozenRowsHeight()}),e.add(s)),s.col=r;for(let l=0;l<this.titleRows.length;l++){const a=this.titleRows[l];if(v9(a,this.rowNow,t.scenegraph.proxy.screenTopRow,this.titleRows)){r===0&&o++;continue}r===0&&this.showedTitleRows.push(a);const h=t.scenegraph.getCell(r,a);if(h.role==="cell"){const d=yT(h);d.setAttributes({y:40*l}),s.add(d)}else{const d=_o(r,a,t,!0,!0);d.setAttributes({y:40*l}),s.add(d)}}}o>0&&this.skipStartRow===-1&&this.skipEndRow===-1&&(this.skipStartRow=t.scenegraph.proxy.screenTopRow-1,this.skipEndRow=t.scenegraph.proxy.screenTopRow+1)}}function v9(i,t,e,n){return i===t&&i!==e+n.length-1?!0:i===e+n.indexOf(i)+1&&i<t}function yT(i){const t=i.clone();if(t.role=i.role,t.col=i.col,t.row=i.row,t.mergeStartCol=i.mergeStartCol,t.mergeStartRow=i.mergeStartRow,t.mergeEndCol=i.mergeEndCol,t.mergeEndRow=i.mergeEndRow,t.contentWidth=i.contentWidth,t.contentHeight=i.contentHeight,t.role==="cell"){const e=Fe({x:0,y:0,width:t.attribute.width,height:t.attribute.height});t.add(e)}if(i.type==="group"){const e=t;i.forEachChildren(n=>{const o=yT(n);e.add(o)})}return t}function b9(i){const t=i.scenegraph.colHeaderGroup,e=i.scenegraph.cornerHeaderGroup;if(!t.border){const r=Fe({x:0,y:0,width:0,height:0,cursor:"pointer"});t.add(r),t.border=r,r.attachShadow(r.shadowRoot),r.name="border-rect",r.addEventListener("click",s=>{const l=i.listTreeStickCellPlugin.titleRows,{shadowTarget:a}=s.pickParams,h=Hr(a),{col:d,row:u}=h;_T(u-l.indexOf(u),i)})}if(!e.border){const r=Fe({x:0,y:0,width:0,height:0,cursor:"pointer"});e.add(r),e.border=r,r.attachShadow(r.shadowRoot),r.name="border-rect",r.addEventListener("click",s=>{const l=i.listTreeStickCellPlugin.titleRows,{shadowTarget:a}=s.pickParams,h=Hr(a),{col:d,row:u}=h;_T(u-l.indexOf(u),i)})}const n=t.border.shadowRoot,o=e.border.shadowRoot;return n.removeAllChild(),o.removeAllChild(),{shadowGroup:n,shadowGroupFrozen:o}}function _T(i,t){const e=t.getDrawRange();if(z(i)&&i>=t.frozenRowCount){const n=t.getFrozenRowsHeight(),o=t.getRowsHeight(0,i-1);t.scrollTop=Math.min(o-n,t.getAllRowsHeight()-e.height)-1}t.scenegraph.updateNextFrame()}const C9=()=>{Bt.registerComponent("listTreeStickCellPlugin",m9)},y9={};function _9(){return nh(y9,yg)}function w9(i,t,e,n,o,r,s,l,a,h,d,u,c,g,f,p,m,b,C){var _,w,y,S,A,R,x,T,M,B,P,F,H,E,k,I,L,D,O,N,W,$,U,Y,j;const G=_9()[d],X=f._getCellStyle(o,r),ht=Lc("padding",X,o,r,f);if(z(ht)&&(a=ht),!i){const gt=ws(o,r,p,f);b&&(i=f.scenegraph.highPerformanceGetCell(o,r,!0))&&i.role==="cell"&&i.setAttributes({x:e,y:n,width:s,height:l,lineWidth:(w=(_=p==null?void 0:p.group)===null||_===void 0?void 0:_.lineWidth)!==null&&w!==void 0?w:void 0,fill:(S=(y=p==null?void 0:p.group)===null||y===void 0?void 0:y.fill)!==null&&S!==void 0?S:void 0,stroke:(R=(A=p==null?void 0:p.group)===null||A===void 0?void 0:A.stroke)!==null&&R!==void 0?R:void 0,strokeArrayWidth:gt,strokeArrayColor:(T=(x=p==null?void 0:p.group)===null||x===void 0?void 0:x.strokeArrayColor)!==null&&T!==void 0?T:void 0,cursor:(B=(M=p==null?void 0:p.group)===null||M===void 0?void 0:M.cursor)!==null&&B!==void 0?B:void 0,lineDash:(F=(P=p==null?void 0:p.group)===null||P===void 0?void 0:P.lineDash)!==null&&F!==void 0?F:void 0,lineCap:"butt",clip:!0,cornerRadius:p.group.cornerRadius}),i&&i.role==="cell"||((i=new de({x:e,y:n,width:s,height:l,lineWidth:(E=(H=p==null?void 0:p.group)===null||H===void 0?void 0:H.lineWidth)!==null&&E!==void 0?E:void 0,fill:(I=(k=p==null?void 0:p.group)===null||k===void 0?void 0:k.fill)!==null&&I!==void 0?I:void 0,stroke:(D=(L=p==null?void 0:p.group)===null||L===void 0?void 0:L.stroke)!==null&&D!==void 0?D:void 0,strokeArrayWidth:gt,strokeArrayColor:(N=(O=p==null?void 0:p.group)===null||O===void 0?void 0:O.strokeArrayColor)!==null&&N!==void 0?N:void 0,cursor:($=(W=p==null?void 0:p.group)===null||W===void 0?void 0:W.cursor)!==null&&$!==void 0?$:void 0,lineDash:(Y=(U=p==null?void 0:p.group)===null||U===void 0?void 0:U.lineDash)!==null&&Y!==void 0?Y:void 0,lineCap:"butt",clip:!0,cornerRadius:p.group.cornerRadius})).role="cell",i.col=o,i.row=r,t==null||t.addCellGroup(i))}if(i.AABBBounds.width(),C&&Array.isArray(f.getCellValue(o,r))||!C){const gt=new Rl(m,{stroke:!1,x:a[3],y:a[0],canvas:(j=f.canvas)!==null&&j!==void 0?j:f.scenegraph.stage.window.getContext().canvas,mode:f.options.mode,modeParams:f.options.modeParams,spec:u,ClassType:G,width:s-a[3]-a[1],height:l-a[2]-a[0],chartInstance:c,dataId:g,data:f.getCellValue(o,r)||[],cellPadding:a,dpr:f.internalProps.pixelRatio,axes:f.isPivotChart()?f.internalProps.layoutMap.getChartAxes(o,r):[],tableChartOption:f.options.chartOption});i.appendChild(gt),f.internalProps.layoutMap.setChartInstance(o,r,gt.chartInstance)}return i}function S9(i,t,e,n,o,r,s,l,a,h,d,u,c,g,f,p,m,b){var C,_,w,y,S,A,R,x,T,M,B,P,F,H,E,k,I,L,D,O,N,W,$,U;if(!i){const ht=ws(o,r,f,g);b&&(i=g.scenegraph.highPerformanceGetCell(o,r,!0))&&i.role==="cell"&&i.setAttributes({x:e,y:n,width:l,height:a,lineWidth:(_=(C=f==null?void 0:f.group)===null||C===void 0?void 0:C.lineWidth)!==null&&_!==void 0?_:void 0,fill:(y=(w=f==null?void 0:f.group)===null||w===void 0?void 0:w.fill)!==null&&y!==void 0?y:void 0,stroke:(A=(S=f==null?void 0:f.group)===null||S===void 0?void 0:S.stroke)!==null&&A!==void 0?A:void 0,strokeArrayWidth:ht,strokeArrayColor:(x=(R=f==null?void 0:f.group)===null||R===void 0?void 0:R.strokeArrayColor)!==null&&x!==void 0?x:void 0,cursor:(M=(T=f==null?void 0:f.group)===null||T===void 0?void 0:T.cursor)!==null&&M!==void 0?M:void 0,lineDash:(P=(B=f==null?void 0:f.group)===null||B===void 0?void 0:B.lineDash)!==null&&P!==void 0?P:void 0,lineCap:"butt",clip:!0,cornerRadius:f.group.cornerRadius}),i&&i.role==="cell"||((i=new de({x:e,y:n,width:l,height:a,lineWidth:(H=(F=f==null?void 0:f.group)===null||F===void 0?void 0:F.lineWidth)!==null&&H!==void 0?H:void 0,fill:(k=(E=f==null?void 0:f.group)===null||E===void 0?void 0:E.fill)!==null&&k!==void 0?k:void 0,stroke:(L=(I=f==null?void 0:f.group)===null||I===void 0?void 0:I.stroke)!==null&&L!==void 0?L:void 0,strokeArrayWidth:ht,strokeArrayColor:(O=(D=f==null?void 0:f.group)===null||D===void 0?void 0:D.strokeArrayColor)!==null&&O!==void 0?O:void 0,cursor:(W=(N=f==null?void 0:f.group)===null||N===void 0?void 0:N.cursor)!==null&&W!==void 0?W:void 0,lineDash:(U=($=f==null?void 0:f.group)===null||$===void 0?void 0:$.lineDash)!==null&&U!==void 0?U:void 0,lineCap:"butt",clip:!0,cornerRadius:f.group.cornerRadius})).role="cell",i.col=o,i.row=r,t==null||t.addCellGroup(i))}let Y;if(c){let ht=o,gt=r;m&&(ht=m.start.col,gt=m.start.row),Y=g.getCellIcons(ht,gt)}let j=0,G=0;if(Array.isArray(Y)&&Y.length!==0){const{leftIconWidth:ht,rightIconWidth:gt,absoluteLeftIconWidth:Ct,absoluteRightIconWidth:Q}=Dc(Y,i,m,g);j=ht+gt,G=ht,i.forEachChildren(et=>{et.role==="icon-left"?et.setAttribute("x",et.attribute.x+h[3]):et.role==="icon-right"?et.setAttribute("x",et.attribute.x+l-gt-h[1]):et.role==="icon-absolute-right"&&et.setAttribute("x",et.attribute.x+l-Q-h[1])}),i.forEachChildren(et=>{u==="middle"?et.setAttribute("y",(a-et.AABBBounds.height())/2):u==="bottom"?et.setAttribute("y",a-et.AABBBounds.height()-h[2]):et.setAttribute("y",h[0])})}const X=x9(o,r,s-j,l,a,h,f,p,g);return X&&i.appendChild(X),X.render(),l-=h[1]+h[3]+j,a-=h[0]+h[2],d==="center"?X.setAttribute("x",h[3]+G+(l-X.AABBBounds.width())/2):d==="right"?X.setAttribute("x",h[3]+G+l-X.AABBBounds.width()):X.setAttribute("x",h[3]+G),u==="middle"?X.setAttribute("y",h[0]+(a-X.AABBBounds.height())/2):u==="bottom"?X.setAttribute("y",h[0]+a-X.AABBBounds.height()):X.setAttribute("y",h[0]),i}function x9(i,t,e,n,o,r,s,l,a){var h,d,u,c;const g=a._getCellStyle(i,t),f=wt("size",g,i,t,a),p=wt("spaceBetweenTextAndIcon",g,i,t,a),m=wt("defaultFill",g,i,t,a),b=wt("defaultStroke",g,i,t,a),C=wt("disableFill",g,i,t,a),_=wt("checkedFill",g,i,t,a),w=wt("checkedStroke",g,i,t,a),y=wt("disableCheckedFill",g,i,t,a),S=wt("disableCheckedStroke",g,i,t,a),A=wt("checkIconImage",g,i,t,a),R=wt("indeterminateIconImage",g,i,t,a),x=a.getCellValue(i,t),T=a.getCellOriginValue(i,t);let M,B,P=(h=x)!==null&&h!==void 0?h:"";ge(x)?(M=x.checked,B=x.disable,P=(d=x.text)!==null&&d!==void 0?d:""):typeof x=="boolean"&&(M=x,P=""),M=a.stateManager.syncCheckedState(i,t,l.field,M);const F=lo(i,t,a),H=a._getCellStyle(i,t),E=(u=H.autoWrapText)!==null&&u!==void 0?u:a.internalProps.autoWrapText,{lineClamp:k}=H,{checked:I,disable:L}=l;if(M==null||typeof M=="function"){const Y=ii(I,{col:i,row:t,table:a,context:null,value:x,dataValue:T});M=a.stateManager.syncCheckedState(i,t,l.field,Y)}const D=ii(L,{col:i,row:t,table:a,context:null,value:x,dataValue:T}),O=e==="auto",N=a.isAutoRowHeight(t),W={text:P.length===1?P[0]:P,maxLineWidth:O?1/0:n-(r[1]+r[3]+F)-f-p,textBaseline:"top",autoWrapText:E,lineClamp:k,wordBreak:"break-word",heightLimit:N?-1:o-Math.floor(r[0]+r[2]),pickable:!1,dx:F,whiteSpace:P.length!==1||E?"normal":"no-wrap"},$={x:0,y:0,text:s.text?Object.assign({},s.text,W):W,icon:{width:Math.floor(f/1.4),height:Math.floor(f/1.4)},box:{width:f,height:f},spaceBetweenTextAndIcon:p,disabled:(c=B??D)!==null&&c!==void 0&&c};M==="indeterminate"?($.checked=void 0,$.indeterminate=!0):($.checked=M,$.indeterminate=void 0),m&&($.box.fill=m),b&&($.box.stroke=b),C&&($.box.disableFill=C),_&&($.box.checkedFill=_),w&&($.box.checkedStroke=w),y&&($.box.disableCheckedFill=y),S&&($.box.disableCheckedStroke=S),A&&($.icon.checkIconImage=A),R&&($.icon.indeterminateIconImage=R);const U=new Rr($);return U.name="checkbox",U}function R9(i,t,e,n,o,r,s,l,a,h,d,u,c,g,f){var p,m,b,C,_,w,y,S,A,R,x,T;if(!i){const P=ws(o,r,g,c);(i=new de({x:e,y:n,width:l,height:a,lineWidth:(m=(p=g==null?void 0:g.group)===null||p===void 0?void 0:p.lineWidth)!==null&&m!==void 0?m:void 0,fill:(C=(b=g==null?void 0:g.group)===null||b===void 0?void 0:b.fill)!==null&&C!==void 0?C:void 0,stroke:(w=(_=g==null?void 0:g.group)===null||_===void 0?void 0:_.stroke)!==null&&w!==void 0?w:void 0,strokeArrayWidth:P,strokeArrayColor:(S=(y=g==null?void 0:g.group)===null||y===void 0?void 0:y.strokeArrayColor)!==null&&S!==void 0?S:void 0,cursor:(R=(A=g==null?void 0:g.group)===null||A===void 0?void 0:A.cursor)!==null&&R!==void 0?R:void 0,lineDash:(T=(x=g==null?void 0:g.group)===null||x===void 0?void 0:x.lineDash)!==null&&T!==void 0?T:void 0,lineCap:"butt",clip:!0,cornerRadius:g.group.cornerRadius})).role="cell",i.col=o,i.row=r,t==null||t.addCellGroup(i)}const{width:M,height:B}=A9(o,r,s,l,a,h,g,f,i,c);return l-=h[1]+h[3],a-=h[0]+h[2],i.forEachChildren(P=>{d==="center"?P.setAttribute("x",h[3]+P.attribute.x+(l-M)/2):d==="right"?P.setAttribute("x",h[3]+P.attribute.x+l-M):P.setAttribute("x",h[3]+P.attribute.x),u==="middle"?P.setAttribute("y",h[0]+P.attribute.y+(a-B)/2):u==="bottom"?P.setAttribute("y",h[0]+P.attribute.y+a-B):P.setAttribute("y",h[0]+P.attribute.y)}),i}function A9(i,t,e,n,o,r,s,l,a,h){var d,u;const c=h._getCellStyle(i,t);let g=wt("size",c,i,t,h),f=wt("innerRadius",c,i,t,h),p=wt("outerRadius",c,i,t,h);const m=wt("spaceBetweenTextAndIcon",c,i,t,h),b=wt("spaceBetweenRadio",c,i,t,h),C=wt("defaultFill",c,i,t,h),_=wt("defaultStroke",c,i,t,h),w=wt("disableFill",c,i,t,h),y=wt("checkedFill",c,i,t,h),S=wt("checkedStroke",c,i,t,h),A=wt("disableCheckedFill",c,i,t,h),R=wt("disableCheckedStroke",c,i,t,h);ft(p)?g=2*p:p=Math.round(g/2),(!ft(f)||f<0)&&(f=Math.round(p/7*3));const x=h.getCellValue(i,t),T=h.getCellOriginValue(i,t),M=lo(i,t,h),B=h._getCellStyle(i,t),P=(d=B.autoWrapText)!==null&&d!==void 0?d:h.internalProps.autoWrapText,{lineClamp:F}=B,H=e==="auto",E=h.heightMode==="autoHeight",k={maxLineWidth:H?1/0:n-(r[1]+r[3]+M)-g-m,textBaseline:"top",autoWrapText:P,lineClamp:F,wordBreak:"break-word",heightLimit:E?-1:o-Math.floor(r[0]+r[2]),pickable:!1,dx:M},I={x:0,y:0,text:s.text?Object.assign({},s.text,k):k,circle:{innerRadius:f,outerRadius:p},spaceBetweenTextAndIcon:m};C&&(I.circle.fill=C),_&&(I.circle.stroke=_),w&&(I.circle.disableFill=w),y&&(I.circle.checkedFill=y),S&&(I.circle.checkedStroke=S),A&&(I.circle.disableCheckedFill=A),R&&(I.circle.disableCheckedStroke=R);let L=0,D=0;const O=(u=l.radioDirectionInCell)!==null&&u!==void 0?u:"vertical";if(lt(x))x.forEach((N,W)=>{const $=wT(N,T,W,i,t,l,P,I,h);$&&a.appendChild($),$.id=`radio-${i}-${t}-${W}`,$.render();const U=$.AABBBounds;O==="vertical"?($.setAttribute("y",D),D+=U.height()+(W!==x.length-1?b:0),L=Math.max(L,U.width())):O==="horizontal"&&($.setAttribute("x",L),L+=U.width()+(W!==x.length-1?b:0),D=Math.max(D,U.height()))});else{const N=wT(x,T,void 0,i,t,l,P,I,h);N&&a.appendChild(N),N.id=`radio-${i}-${t}`,N.render();const W=N.AABBBounds;L=W.width(),D=W.height()}return{width:L,height:D}}function wT(i,t,e,n,o,r,s,l,a){const h=T9(i,t,e,n,o,r,a),d=M9(i,t,n,o,r,a),u=ge(i)?i.text:bi(i)?"":i??"",c=xt({},l,{checked:h,disabled:d,text:{text:u.length===1?u[0]:u,whiteSpace:u.length!==1||s?"normal":"no-wrap"},boundsPadding:0}),g=new Qa(c);return g.name="radio",g}function T9(i,t,e,n,o,r,s){var l,a;const h=(l=r.radioCheckType)!==null&&l!==void 0?l:"column";let d,u;return ge(i)?d=i.checked:typeof i=="boolean"&&(d=i),d=s.stateManager.syncRadioState(n,o,r.field,h,e,d),d!=null&&typeof d!="function"||(u=ii(r.checked,{col:n,row:o,table:s,context:null,value:i,dataValue:t}),d=s.stateManager.syncRadioState(n,o,r.field,h,e,u)),(a=d??u)!==null&&a!==void 0&&a}function M9(i,t,e,n,o,r){var s;let l;ge(i)&&(l=i.disable);const a=ii(o.disable,{col:e,row:n,table:r,context:null,value:i,dataValue:t});return(s=l??a)!==null&&s!==void 0&&s}const Dr=new tz,Or=new ds;function B9(i,t,e,n,o,r,s,l,a,h,d,u){var c,g,f,p,m,b,C,_,w,y,S,A,R,x,T,M,B,P,F,H,E,k,I,L;if(!i){const O=ws(o,r,d,h);u&&(i=h.scenegraph.highPerformanceGetCell(o,r,!0))&&i.role==="cell"&&i.setAttributes({x:e,y:n,width:s,height:l,lineWidth:(g=(c=d==null?void 0:d.group)===null||c===void 0?void 0:c.lineWidth)!==null&&g!==void 0?g:void 0,fill:(p=(f=d==null?void 0:d.group)===null||f===void 0?void 0:f.fill)!==null&&p!==void 0?p:void 0,stroke:(b=(m=d==null?void 0:d.group)===null||m===void 0?void 0:m.stroke)!==null&&b!==void 0?b:void 0,strokeArrayWidth:O,strokeArrayColor:(_=(C=d==null?void 0:d.group)===null||C===void 0?void 0:C.strokeArrayColor)!==null&&_!==void 0?_:void 0,cursor:(y=(w=d==null?void 0:d.group)===null||w===void 0?void 0:w.cursor)!==null&&y!==void 0?y:void 0,lineDash:(A=(S=d==null?void 0:d.group)===null||S===void 0?void 0:S.lineDash)!==null&&A!==void 0?A:void 0,lineCap:"butt",clip:!0,cornerRadius:d.group.cornerRadius}),i&&i.role==="cell"||((i=new de({x:e,y:n,width:s,height:l,lineWidth:(x=(R=d==null?void 0:d.group)===null||R===void 0?void 0:R.lineWidth)!==null&&x!==void 0?x:void 0,fill:(M=(T=d==null?void 0:d.group)===null||T===void 0?void 0:T.fill)!==null&&M!==void 0?M:void 0,stroke:(P=(B=d==null?void 0:d.group)===null||B===void 0?void 0:B.stroke)!==null&&P!==void 0?P:void 0,strokeArrayWidth:O,strokeArrayColor:(H=(F=d==null?void 0:d.group)===null||F===void 0?void 0:F.strokeArrayColor)!==null&&H!==void 0?H:void 0,cursor:(k=(E=d==null?void 0:d.group)===null||E===void 0?void 0:E.cursor)!==null&&k!==void 0?k:void 0,lineDash:(L=(I=d==null?void 0:d.group)===null||I===void 0?void 0:I.lineDash)!==null&&L!==void 0?L:void 0,lineCap:"butt",clip:!0,cornerRadius:d.group.cornerRadius})).role="cell",i.col=o,i.row=r,t==null||t.addCellGroup(i))}const D=P9(o,r,s,l,a,h);return D&&i.appendChild(D),i}function P9(i,t,e,n,o,r){let s,l;const a=r.internalProps.layoutMap.getBody(i,t).sparklineSpec,h=r.getCellValue(i,t);if(!Array.isArray(h))return;const d=o[3],u=o[0];e-=o[1]+o[3];const c=n-=o[0]+o[2];if(typeof a=="function"){const _={col:i,row:t,dataValue:r.getCellOriginValue(i,t)||"",value:r.getCellValue(i,t)||"",rect:r.getCellRangeRelativeRect(r.getCellRange(i,t)),table:r};s=a(_),l=ST(s,d,u,e,n)}else s=a,l=ST(a,d,u,e,n);const g=[],f=[];let p,m;if(typeof s.xField=="object")Dr.domain(s.xField.domain),p=s.xField.field;else if(typeof s.xField=="string"){const _=h.map(w=>w[s.xField]);Dr.domain(_),p=s.xField}else Array.isArray(h)&&(Dr.domain(Array.from({length:h.length},(_,w)=>w)),p=s.xField);if(Dr.range([0,e]),typeof s.yField=="object")Or.domain(s.yField.domain),m=s.yField.field;else if(typeof s.yField=="string"){const _=xT(h,s.yField);Or.domain([Math.min(..._),Math.max(..._)]),m=s.yField}else if(Array.isArray(h)){const _=xT(h);Or.domain([Math.min(..._),Math.max(..._)]),m=s.yField}if(Or.range([0,n]),typeof s.xField=="object"&&Array.isArray(s.xField.domain)){const _=h.map(y=>y[s.xField.field]),w=s.xField.domain;for(let y=0;y<w.length;y++){let S=!1;for(let A=0;A<_.length;A++)if(w[y]===_[A]){const R=h[A];if(!z(R[p])||!z(R[m]))break;g.push({x:0+Dr.scale(R[p]),y:c-Or.scale(R[m]),defined:z(R[m])}),f.push(R),S=!0;break}S||(g.push({x:0+Dr.scale(w[y]),y:0,defined:!1}),f.push({[p]:w[y],[m]:null}))}}else for(let _=0;_<h.length;_++){const w=h[_];g.push({x:0+Dr.scale(p?w[p]:_),y:c-Or.scale(m?w[m]:w),defined:z(m?w[m]:w),rawData:w}),f.push(w)}const b=l.getChildByName("sparkline-line");b&&b.setAttribute("points",g),b.bandwidth=Dr.step(),b.min=Or.range()[0],b.max=Or.range()[1];const C=l.getChildByName("sparkline-symbol-group");if(C){const _=s.pointShowRule==="isolatedPoint";if(s.pointShowRule==="all")for(let w=0;w<g.length;w++){const{x:y,y:S,defined:A}=g[w];if(A){const R=Ea({x:y,y:S});C.appendChild(R)}}else if(_)for(let w=0;w<g.length;w++){const{x:y,y:S,defined:A}=g[w];if(A&&(!g[w-1]||!g[w-1].defined)&&(!g[w+1]||!g[w+1].defined)){const R=Ea({x:y,y:S});C.appendChild(R)}}}return l}function ST(i,t,e,n,o){var r,s,l,a,h,d,u,c,g,f,p,m,b,C,_,w,y,S,A,R,x,T;let M;M=typeof i=="function"?i(null):i;const B=new de({x:t,y:e,width:n,height:o,stroke:!1,fill:!1});if(B.name="sparkline",M.type==="line"){const P=fn({x:0,y:0,curveType:M.smooth?"monotoneX":"linear",stroke:(l=(s=(r=M.line)===null||r===void 0?void 0:r.style)===null||s===void 0?void 0:s.stroke)!==null&&l!==void 0?l:"blue",lineWidth:(d=(h=(a=M.line)===null||a===void 0?void 0:a.style)===null||h===void 0?void 0:h.strokeWidth)!==null&&d!==void 0?d:2});P.name="sparkline-line",B.addChild(P),M.crosshair&&(P.hover=(c=(u=M.crosshair)===null||u===void 0?void 0:u.style)!==null&&c!==void 0?c:{stroke:"#000",interpolate:"linear"});const F=new de({x:0,y:0,width:n,height:o,stroke:!1,fill:!1});F.name="sparkline-symbol-group",F.setTheme({symbol:{stroke:(p=(f=(g=M.point)===null||g===void 0?void 0:g.style)===null||f===void 0?void 0:f.stroke)!==null&&p!==void 0?p:"#000",lineWidth:(C=(b=(m=M.point)===null||m===void 0?void 0:m.style)===null||b===void 0?void 0:b.strokeWidth)!==null&&C!==void 0?C:1,fill:(y=(w=(_=M.point)===null||_===void 0?void 0:_.style)===null||w===void 0?void 0:w.fill)!==null&&y!==void 0?y:"#000",size:2*((R=(A=(S=M.point)===null||S===void 0?void 0:S.style)===null||A===void 0?void 0:A.size)!==null&&R!==void 0?R:3),symbolType:"circle"}}),B.addChild(F),F.hover=(T=(x=M.point)===null||x===void 0?void 0:x.hover)!==null&&T!==void 0&&T}return B}function xT(i,t){const e=[];for(let n=0;n<i.length;n++){const o=i[n];z(t)&&z(o[t])?e.push(o[t]):!z(t)&&z(o)&&e.push(o)}return e}const fv=vn();function H9(i,t,e,n,o,r,s,l,a,h,d,u,c,g,f,p,m){var b,C,_,w,y,S,A,R,x,T,M,B,P,F,H,E,k,I,L,D,O,N,W,$,U,Y,j,G,X,ht;const gt=g._getCellStyle(n,o),Ct=Lc("padding",gt,n,o,g);!((b=g.options.customConfig)===null||b===void 0)&&b.imageMargin?h=Qt((C=g.options.customConfig)===null||C===void 0?void 0:C.imageMargin):z(Ct)&&(h=Ct),!((_=f==null?void 0:f.text)===null||_===void 0)&&_.textAlign&&(d=(w=f==null?void 0:f.text)===null||w===void 0?void 0:w.textAlign),!((y=f==null?void 0:f.text)===null||y===void 0)&&y.textBaseline&&(u=(S=f==null?void 0:f.text)===null||S===void 0?void 0:S.textBaseline);const Q=ws(n,o,f,g);let et,vt;if(m&&(et=g.scenegraph.highPerformanceGetCell(n,o,!0),et&&et.role==="cell"&&et.setAttributes({x:t,y:e,width:r,height:s,lineWidth:(R=(A=f==null?void 0:f.group)===null||A===void 0?void 0:A.lineWidth)!==null&&R!==void 0?R:void 0,fill:(T=(x=f==null?void 0:f.group)===null||x===void 0?void 0:x.fill)!==null&&T!==void 0?T:void 0,stroke:(B=(M=f==null?void 0:f.group)===null||M===void 0?void 0:M.stroke)!==null&&B!==void 0?B:void 0,strokeArrayWidth:Q,strokeArrayColor:(F=(P=f==null?void 0:f.group)===null||P===void 0?void 0:P.strokeArrayColor)!==null&&F!==void 0?F:void 0,cursor:(E=(H=f==null?void 0:f.group)===null||H===void 0?void 0:H.cursor)!==null&&E!==void 0?E:void 0,lineDash:(I=(k=f==null?void 0:f.group)===null||k===void 0?void 0:k.lineDash)!==null&&I!==void 0?I:void 0,lineCap:"butt",clip:!0,cornerRadius:f.group.cornerRadius})),et&&et.role==="cell"||(et=new de({x:t,y:e,width:r,height:s,lineWidth:(D=(L=f==null?void 0:f.group)===null||L===void 0?void 0:L.lineWidth)!==null&&D!==void 0?D:void 0,fill:(N=(O=f==null?void 0:f.group)===null||O===void 0?void 0:O.fill)!==null&&N!==void 0?N:void 0,stroke:($=(W=f==null?void 0:f.group)===null||W===void 0?void 0:W.stroke)!==null&&$!==void 0?$:void 0,strokeArrayWidth:Q,strokeArrayColor:(Y=(U=f==null?void 0:f.group)===null||U===void 0?void 0:U.strokeArrayColor)!==null&&Y!==void 0?Y:void 0,cursor:(G=(j=f==null?void 0:f.group)===null||j===void 0?void 0:j.cursor)!==null&&G!==void 0?G:void 0,lineDash:(ht=(X=f==null?void 0:f.group)===null||X===void 0?void 0:X.lineDash)!==null&&ht!==void 0?ht:void 0,lineCap:"butt",clip:!0,cornerRadius:f.group.cornerRadius}),et.role="cell",et.col=n,et.row=o,i==null||i.addCellGroup(et)),c){let _t=n,ct=o;p&&(_t=p.start.col,ct=p.start.row),vt=g.getCellIcons(_t,ct)}let bt=0,dt=0;if(Array.isArray(vt)&&vt.length!==0){const{leftIconWidth:_t,rightIconWidth:ct,absoluteLeftIconWidth:Wt,absoluteRightIconWidth:Yt}=Dc(vt,et,p,g);bt=_t,dt=ct,et.forEachChildren(yt=>{yt.role==="icon-left"?yt.setAttribute("x",yt.attribute.x+h[3]):yt.role==="icon-right"?yt.setAttribute("x",yt.attribute.x+r-ct-h[1]):yt.role==="icon-absolute-right"&&yt.setAttribute("x",yt.attribute.x+r-Yt-h[1])}),et.forEachChildren(yt=>{u==="middle"?yt.setAttribute("y",(s-yt.AABBBounds.height())/2):u==="bottom"?yt.setAttribute("y",s-yt.AABBBounds.height()-h[2]):yt.setAttribute("y",h[0])}),et._cellLeftIconWidth=bt,et._cellRightIconWidth=dt}const ot=g.getCellValue(n,o),ut=document.createElement("video");ut.addEventListener("loadeddata",()=>{a&&dR(n,o,ut.videoWidth,ut.videoHeight,g.scenegraph,h,et);const{width:_t,height:ct,isMerge:Wt}=wl(et,g);if(l){const{width:_e,height:Oe}=Ec(ut.videoWidth,ut.videoHeight,_t-h[1]-h[3],ct-h[0]-h[2]),He=Bm(0,0,_t,ct,_e,Oe,d,u,h);st.setAttributes({width:_e,height:Oe,x:He.x,y:He.y,dx:0})}else st.setAttributes({x:h[3],y:h[0],width:_t-h[1]-h[3],height:ct-h[2]-h[0],dy:0});Wt&&Pm(et.mergeStartCol,et.mergeEndCol,et.mergeStartRow,et.mergeEndRow,g);const{width:Yt,height:yt}=wl(et,g),mt=Math.floor(Math.min(Yt-h[1]-h[3],yt-h[2]-h[0])/2),ie=0+(Yt>st.attribute.width?st.attribute.x-0+st.attribute.width/2:Yt/2),le=0+(yt>st.attribute.height?st.attribute.y-0+st.attribute.height/2:yt/2),Zt=new ps({x:ie-mt/2,y:le-mt/2,width:mt,height:mt,image:fv.play.svg,cursor:fv.play.cursor});Zt.name="play-icon",et.appendChild(Zt),g.scenegraph.updateNextFrame()}),ut.onerror=()=>{st.image=fv.damage_pic.svg},ut.src=ot,ut.setAttribute("preload","auto");const st=gu({x:h[3],y:h[0],width:r-h[1]-h[3],height:s-h[2]-h[0],image:ut,cursor:"pointer"});return st.name="image",st.keepAspectRatio=l,st.textAlign=d,st.textBaseline=u,et.appendChild(st),et}function E9(i,t,e,n,o,r,s,l,a,h,d,u,c,g,f,p,m,b,C){var _,w,y,S,A,R,x,T,M,B,P,F,H,E,k,I,L,D,O,N,W,$,U,Y,j,G,X,ht,gt,Ct,Q,et;const vt=i._getCellStyle(r,s),bt=Lc("padding",vt,r,s,i);z(bt)&&(d=bt),!((_=m==null?void 0:m.text)===null||_===void 0)&&_.textAlign&&(u=(w=m==null?void 0:m.text)===null||w===void 0?void 0:w.textAlign),!((y=m==null?void 0:m.text)===null||y===void 0)&&y.textBaseline&&(c=(S=m==null?void 0:m.text)===null||S===void 0?void 0:S.textBaseline);const dt=i.isAutoRowHeight(s),ot=l==="auto",ut=(A=vt.autoWrapText)!==null&&A!==void 0?A:i.internalProps.autoWrapText,st=vt.lineClamp,_t=ws(r,s,m,i);let ct;if(C&&(ct=i.scenegraph.getCell(r,s,!0),ct&&ct.role==="cell"&&ct.setAttributes({x:n,y:o,width:a,height:h,lineWidth:(x=(R=m==null?void 0:m.group)===null||R===void 0?void 0:R.lineWidth)!==null&&x!==void 0?x:void 0,fill:(M=(T=m==null?void 0:m.group)===null||T===void 0?void 0:T.fill)!==null&&M!==void 0?M:void 0,stroke:(P=(B=m==null?void 0:m.group)===null||B===void 0?void 0:B.stroke)!==null&&P!==void 0?P:void 0,strokeArrayWidth:_t??void 0,strokeArrayColor:(H=(F=m==null?void 0:m.group)===null||F===void 0?void 0:F.strokeArrayColor)!==null&&H!==void 0?H:void 0,cursor:(k=(E=m==null?void 0:m.group)===null||E===void 0?void 0:E.cursor)!==null&&k!==void 0?k:void 0,lineDash:(L=(I=m==null?void 0:m.group)===null||I===void 0?void 0:I.lineDash)!==null&&L!==void 0?L:void 0,lineCap:"butt",clip:!0,cornerRadius:m.group.cornerRadius})),ct&&ct.role==="cell"||(ct=new de({x:n,y:o,width:a,height:h,lineWidth:(O=(D=m==null?void 0:m.group)===null||D===void 0?void 0:D.lineWidth)!==null&&O!==void 0?O:void 0,fill:(W=(N=m==null?void 0:m.group)===null||N===void 0?void 0:N.fill)!==null&&W!==void 0?W:void 0,stroke:(U=($=m==null?void 0:m.group)===null||$===void 0?void 0:$.stroke)!==null&&U!==void 0?U:void 0,strokeArrayWidth:_t??void 0,strokeArrayColor:(j=(Y=m==null?void 0:m.group)===null||Y===void 0?void 0:Y.strokeArrayColor)!==null&&j!==void 0?j:void 0,cursor:(X=(G=m==null?void 0:m.group)===null||G===void 0?void 0:G.cursor)!==null&&X!==void 0?X:void 0,lineDash:(gt=(ht=m==null?void 0:m.group)===null||ht===void 0?void 0:ht.lineDash)!==null&>!==void 0?gt:void 0,lineCap:"butt",clip:!0,cornerRadius:m.group.cornerRadius}),ct.role="cell",ct.col=r,ct.row=s,e==null||e.addCellGroup(ct)),f&&ct.appendChild(f),p){const Wt=t;let Yt;if(g){let yt=r,mt=s;b&&(yt=b.start.col,mt=b.start.row),Yt=i.getCellIcons(yt,mt)}if(Y6(ct,Yt,Wt,d,ot,dt,ut,typeof st=="number"?st:void 0,ct.attribute.width,ct.attribute.height,u,c,i,m,b),(Ct=m==null?void 0:m._vtable)===null||Ct===void 0?void 0:Ct.marked){const yt=n0({x:ct.attribute.width,y:0,startAngle:Math.PI/2,endAngle:Math.PI,outerRadius:6,fill:"#3073F2",pickable:!1});yt.name="mark",ct.appendChild(yt)}}return f&&ct.setAttributes({width:Math.max(ct.attribute.width,(Q=f.attribute.width)!==null&&Q!==void 0?Q:0),height:Math.max(ct.attribute.height,(et=f.attribute.height)!==null&&et!==void 0?et:0)}),ct}function L9(i,t,e,n,o,r,s,l,a,h){var d,u,c,g,f,p;i.dependField&&(o=(u=(d=a.getCellOriginRecord(r,s))===null||d===void 0?void 0:d[i.dependField])!==null&&u!==void 0?u:o),i.barType=(c=i.barType)!==null&&c!==void 0?c:"default",i.min=(g=ii(i.min,{col:r,row:s,table:a,value:n,dataValue:o,cellHeaderPaths:void 0}))!==null&&g!==void 0?g:0,i.max=(f=ii(i.max,{col:r,row:s,table:a,value:n,dataValue:o,cellHeaderPaths:void 0}))!==null&&f!==void 0?f:i.min+100;let m=0;m=h?a.getRowsHeight(h.start.row,h.end.row):a.getRowHeight(s);let b=e,C=m,_=0;ft(a.theme._contentOffset)&&(_=a.theme._contentOffset);const w=new de({x:-_,y:-_,width:b,height:C});w.name="progress-bar";const{showBar:y,barColor:S,barBgColor:A,barPositiveColor:R,barNegativeColor:x,barAxisColor:T,barRightToLeft:M,showBarMark:B,barMarkPositiveColor:P,barMarkNegativeColor:F,barMarkWidth:H,barMarkPosition:E}=t;let{barHeight:k,barBottom:I,barPadding:L}=t;L.length===1?L=[L[0],L[0],L[0],L[0]]:L.length===2?L=[L[0],L[1],L[0],L[1]]:L.length===3&&(L=[L[0],L[1],L[2],L[1]]),L=L.map((G,X)=>{if(typeof G=="string"&&pc.endsWith(G,"%")){const ht=Number(G.substr(0,G.length-1));return X===0||X===2?m*ht/100:e*ht/100}return Number(G)});const D=Qt(wt("borderLineWidth",t,r,s,a)),O=Math.max(L[0],Math.ceil(D[0]/2)),N=Math.max(L[1],Math.floor(D[1]/2)),W=Math.max(L[2],Math.floor(D[2]/2)),$=Math.max(L[3],Math.ceil(D[3]/2));b-=N+$,C-=W+O,s===a.rowCount-1&&[0,"0"].includes(I)&&(C-=1);const U=O,Y=$,j=b;if(typeof k=="string"&&pc.endsWith(k,"%")?(k=Number(k.substr(0,k.length-1)),k=C*k/100):k=Number(k),typeof I=="string"&&pc.endsWith(I,"%")?(I=Number(I.substr(0,I.length-1)),I=C*I/100):I=Number(I),ii(y,{col:r,row:s,table:a,context:null,value:n,dataValue:o})){let G=`${o}`;pc.endsWith(G,"%")&&(G=G.substr(0,G.length-1));const X=Number(G);if(isNaN(X))return w;if(((p=i.barType)!==null&&p!==void 0?p:"default")==="default"){const ht=X<i.min?0:X>i.max?1:(X-i.min)/(i.max-i.min),gt=b,Ct=U+C-k-I;let Q=Math.min(gt*ht,gt);const et=M?Y+j-Q:Y;r!==a.colCount-1||ht!==1||M||(Q-=1);const vt=ii(A,{col:r,row:s,table:a,context:null,value:n,dataValue:o,percentile:ht});if(vt){const ot=Fe({x:et,y:Ct,width:gt,height:k,fill:vt});w.addChild(ot)}const bt=ii(S,{col:r,row:s,table:a,context:null,value:n,dataValue:o,percentile:ht})||"#20a8d8",dt=Fe({x:et,y:Ct,width:Q,height:k,fill:bt});w.addChild(dt)}else if(i.barType==="negative"){const ht=i.min<0?-i.min:0,gt=i.max>0?i.max:0,Ct=ht/(ht+gt),Q=1-Ct,et=X>0?X/gt:0,vt=X<0?-X/ht:0,bt=b,dt=U+C-k-I,ot=Y,ut=ii(A,{col:r,row:s,table:a,context:null,value:n,dataValue:o,percentile:et});if(ut){const He=Fe({x:ot,y:dt,width:bt,height:k,fill:ut});w.addChild(He)}const st=M?Q*bt:Ct*bt,_t=Math.min(bt*Ct*vt,bt),ct=M?{left:ot+st,top:dt,width:_t,height:k}:{left:ot+st-_t,top:dt,width:_t,height:k},Wt=ii(x,{col:r,row:s,table:a,context:null,value:n,dataValue:o,percentile:vt})||"#20a8d8",Yt=Fe({x:ct.left,y:ct.top,width:ct.width,height:ct.height,fill:Wt});w.addChild(Yt);let yt=Math.min(bt*Q*et,bt);r!==a.colCount-1||et!==1||M||(yt-=1);const mt=M?{left:ot+st-yt,top:dt,width:yt,height:k}:{left:ot+st,top:dt,width:yt,height:k},ie=ii(R,{col:r,row:s,table:a,context:null,value:n,dataValue:o,percentile:et})||"#20a8d8",le=Fe({x:mt.left,y:mt.top,width:mt.width,height:mt.height,fill:ie});w.addChild(le);const Zt=M?ct.left:mt.left,_e=ii(T,{col:r,row:s,table:a,context:null,value:n,dataValue:o,percentile:et}),Oe=fn({x:0,y:0,stroke:_e,lineWidth:1,lineDash:[2,2],points:[{x:Zt,y:0},{x:Zt,y:m}]});if(w.addChild(Oe),B&&(et||vt)){const He=H,Ht=[];let Et;if(et>0)if(Et=ii(P,{col:r,row:s,table:a,context:null,value:n,dataValue:o,percentile:et})||"#20a8d8",E==="right"){const Tt=M?mt.left+H/2:mt.left+mt.width-H/2;Ht.push({x:Tt,y:mt.top}),Ht.push({x:Tt,y:mt.top+mt.height})}else E==="bottom"&&(Ht.push({x:mt.left,y:mt.top+mt.height-H/2}),Ht.push({x:mt.left+mt.width,y:mt.top+mt.height-H/2}));else if(vt>0)if(Et=ii(F,{col:r,row:s,table:a,context:null,value:n,dataValue:o,percentile:vt})||"#20a8d8",E==="right"){const Tt=M?ct.left+ct.width-H/2:ct.left+H/2;Ht.push({x:Tt,y:ct.top}),Ht.push({x:Tt,y:ct.top+ct.height})}else E==="bottom"&&(Ht.push({x:ct.left,y:ct.top+ct.height-H/2}),Ht.push({x:ct.left+ct.width,y:ct.top+ct.height-H/2}));const Rt=fn({x:0,y:0,stroke:Et,lineWidth:He,points:Ht});w.addChild(Rt)}}else if(i.barType==="negative_no_axis"){const ht=i.min<0?-i.min:0,gt=i.max>0?i.max:0,Ct=Math.max(ht,gt),Q=Ct===0?0:Math.abs(X)/Ct,et=b;let vt=Math.min(et*Q,et);r!==a.colCount-1||Q!==1||M||(vt-=1);const bt=U+C-k-I,dt=M?Y+j-vt:Y,ot=ii(A,{col:r,row:s,table:a,context:null,value:n,dataValue:o,percentile:Q});if(ot){const ct=Fe({x:dt,y:bt,width:et,height:k,fill:ot});w.addChild(ct)}const ut={left:dt,top:bt,width:vt,height:k};let st;st=X>=0?ii(R,{col:r,row:s,table:a,context:null,value:n,percentile:Q,dataValue:o})||"#20a8d8":ii(x,{col:r,row:s,table:a,context:null,value:n,dataValue:o,percentile:Q})||"#20a8d8";const _t=Fe({x:ut.left,y:ut.top,width:ut.width,height:ut.height,fill:st});if(w.addChild(_t),B&&X){const ct=H,Wt=[];let Yt;if(Yt=X>=0?ii(P,{col:r,row:s,table:a,context:null,value:n,dataValue:o,percentile:Q})||"#20a8d8":ii(F,{col:r,row:s,table:a,context:null,value:n,dataValue:o,percentile:Q})||"#20a8d8",E==="right"){const mt=M?ut.left+H/2:ut.left+ut.width-H/2;Wt.push({x:mt,y:ut.top}),Wt.push({x:mt,y:ut.top+ut.height})}else E==="bottom"&&(Wt.push({x:ut.left,y:ut.top+ut.height-H/2}),Wt.push({x:ut.left+ut.width,y:ut.top+ut.height-H/2}));const yt=fn({x:0,y:0,stroke:Yt,lineWidth:ct,points:Wt});w.addChild(yt)}}}return w}function k9(i,t,e,n,o,r){var s,l,a,h,d,u,c,g,f;if(e!=null&&e.zero&&(i=Math.min(i,0),t=Math.max(t,0)),e==null?void 0:e.expand){const b=i,C=t;z(e.expand.min)&&(i=b-(C-b)*e.expand.min),z(e.expand.max)&&(t=C+(C-b)*e.expand.max)}let p,m;if(ft(e==null?void 0:e.min)&&(i=e.min),ft(e==null?void 0:e.max)&&(t=e.max),(e==null?void 0:e.type)==="log"?(p=new Ya,p.base((s=e==null?void 0:e.base)!==null&&s!==void 0?s:10)):(e==null?void 0:e.type)==="symlog"?(p=new Xa,p.constant((l=e==null?void 0:e.constant)!==null&&l!==void 0?l:10)):p=new ds,p.domain([i,t],!!(e!=null&&e.nice)),e==null?void 0:e.nice){let b=(u=(h=(a=e.tick)===null||a===void 0?void 0:a.forceTickCount)!==null&&h!==void 0?h:(d=e.tick)===null||d===void 0?void 0:d.tickCount)!==null&&u!==void 0?u:10;ue(b)&&(b=b({axisLength:o,labelStyle:(g=(c=e==null?void 0:e.label)===null||c===void 0?void 0:c.style)!==null&&g!==void 0?g:{fontSize:Eh.LABEL_FONT_SIZE}})),e.niceType==="accurateFirst"&&(b=Math.max(10,b)),Mt(e.min)&&Mt(e.max)?p.nice(b):z(e.min)&&Mt(e.max)?p.niceMax(b):Mt(e.min)&&z(e.max)&&p.niceMin(b)}return delete p._niceType,r||(m=p.ticks(ft(e==null?void 0:e.tickCount)?e==null?void 0:e.tickCount:5,{noDecimals:(f=e==null?void 0:e.tick)===null||f===void 0?void 0:f.noDecimals})),{range:p.domain(),ticks:m}}const kg=()=>{Bt.registerFunction("createChartCellGroup",w9),Bt.registerFunction("getAxisDomainRangeAndLabels",k9)},Fg=()=>{Bt.registerFunction("createCheckboxCellGroup",S9)},Ig=()=>{Bt.registerFunction("createImageCellGroup",Z6)},Dg=()=>{Bt.registerFunction("createProgressBarCell",L9)},Og=()=>{Bt.registerFunction("createRadioCellGroup",R9)},zg=()=>{Bt.registerFunction("createSparkLineCellGroup",B9)},Il=()=>{Bt.registerFunction("createTextCellGroup",E9)},Wg=()=>{Bt.registerFunction("createVideoCellGroup",H9)};Mg(),Bg(),Pg(),Hg(),Eg(),Lg(),C9(),kg(),Fg(),Ig(),Dg(),Og(),zg(),Il(),Wg();class F9 extends fT{}Il();class I9 extends fT{}function D9(i,t,e,n,o,r){const s=r.columnHeaderLevelCount,l=[],a=[];for(let c=0;c<e.length;c++)n.includes(e[c])||a.push(o[c]);for(let c=0;c<n.length;c++)if(!e.includes(n[c])){const g={col:i,row:s+c};l.push(g)}let h=r.getParentCellId(i,t),d=r.getRowHeaderCellAddressByCellId(h);const u=[];for(d&&u.push(d);h;)h=r.getParentCellId(d.col,d.row),h&&(d=r.getRowHeaderCellAddressByCellId(h),u.push(d));return{addCellPositions:l,removeCellPositions:a,updateCellPositions:u}}const RT={startInTotal:0,level:0};class lr{constructor(t,e,n,o){var r,s,l,a,h,d,u,c,g,f,p,m,b,C,_,w,y;this.colIndex=0,this._showHeader=!0,this.columnHeaderObjs=[],this.rowHeaderObjs=[],this._cornerHeaderCellFullPathIds=[],this._columnHeaderCellFullPathIds=[],this._rowHeaderCellFullPathIds=[],this._rowHeaderCellFullPathIds_FULL=[],this._cornerHeaderCellIds=[],this._columnHeaderCellIds=[],this._rowHeaderCellIds=[],this._rowHeaderCellIds_FULL=[],this._columnWidths=[],this.columnPaths=[],this._headerObjects=[],this._headerObjectMap={},this._indicators=[],this.indicatorsAsCol=!0,this.hideIndicatorName=!1,this._showRowHeader=!0,this._showColumnHeader=!0,this._indicatorShowType="column",this.rowHierarchyTextStartAlignment=!1,this.rowDimensionKeys=[],this.colDimensionKeys=[],this.indicatorKeys=[],this.indicatorDimensionKey=Xi,this._rowHeaderExtensionTree={},this._extensionRowDimensionKeys=[],this.fullRowDimensionKeys=[],this.leftRowSeriesNumberColumnCount=0,this.rightRowSeriesNumberColumnCount=0,this._useGetBodyCache=!1,this._getBodyCache=new Map,this._useHeaderPathCache=!1,this._colHeaderPathCache=new Map,this._rowHeaderPathCache=new Map,this.sharedVar=t.layoutNodeId,this._table=t,t.options.rowHierarchyType==="tree"&&(this.extensionRows=t.options.extensionRows),this.dataset=e,this._largeCellRangeCache=[],this._CellHeaderPathMap=new Map,this.rowTree=t.internalProps.rowTree,this.columnTree=t.internalProps.columnTree,this.rowsDefine=(r=t.internalProps.rows)!==null&&r!==void 0?r:[],this.columnsDefine=(s=t.internalProps.columns)!==null&&s!==void 0?s:[],this.indicatorsDefine=(l=t.internalProps.indicators)!==null&&l!==void 0?l:[],this.indicatorTitle=t.options.indicatorTitle,this.indicatorsAsCol=(a=t.options.indicatorsAsCol)===null||a===void 0||a,this.hideIndicatorName=(h=t.options.hideIndicatorName)!==null&&h!==void 0&&h,this.showRowHeader=(d=t.options.showRowHeader)===null||d===void 0||d,this.showColumnHeader=(u=t.options.showColumnHeader)===null||u===void 0||u,this.rowHeaderTitle=t.options.rowHeaderTitle,this.columnHeaderTitle=t.options.columnHeaderTitle,this.rowHierarchyType=(c=t.options.rowHierarchyType)!==null&&c!==void 0?c:"grid",this.rowExpandLevel=(g=t.options.rowExpandLevel)!==null&&g!==void 0?g:1,this.rowHierarchyIndent=(f=t.options.rowHierarchyIndent)!==null&&f!==void 0?f:20,this.rowHierarchyTextStartAlignment=t.options.rowHierarchyTextStartAlignment,this.cornerSetting=Object.assign({titleOnDimension:"column",forceShowHeader:!1},t.options.corner),e&&(this.rowTree=e.rowHeaderTree,this.columnTree=e.colHeaderTree),(p=this.indicatorsDefine)===null||p===void 0||p.forEach(x=>{typeof x=="string"?this.indicatorKeys.push(x):this.indicatorKeys.push(x.indicatorKey)}),this.columnDimensionTree=n,this.rowDimensionTree=o,this.colDimensionKeys=this.columnDimensionTree.dimensionKeysIncludeVirtual.valueArr(),this.rowDimensionKeys=this.rowDimensionTree.dimensionKeysIncludeVirtual.valueArr(),this.fullRowDimensionKeys=this.fullRowDimensionKeys.concat(this.rowDimensionKeys),this.resetRowHeaderLevelCount(),this._table.isPivotChart()&&(this.hasTwoIndicatorAxes=this.indicatorsDefine.some(x=>{var T,M;if(x.chartSpec&&x.chartSpec.series&&x.chartSpec.series.length>1){const B=(M=(T=x.chartSpec.axes)!==null&&T!==void 0?T:this._table.pivotChartAxes)!==null&&M!==void 0?M:[];if(!B.length||B.every(P=>P.orient!==(this.indicatorsAsCol?"top":"right")||P.visible!==!1))return!0}return!1})),this.resetColumnHeaderLevelCount(),this._generateColHeaderIds(),this.colIndex=0,this._generateRowHeaderIds(),this._rowHeaderCellFullPathIds_FULL=im(this._rowHeaderCellFullPathIds_FULL),t.options.rowHierarchyType==="tree"&&((m=this.extensionRows)===null||m===void 0?void 0:m.length)>=1&&(this.generateExtensionRowTree(),this.extensionRows.forEach(x=>{const T=[];x.rows.forEach(M=>{typeof M=="string"?T.push(M):T.push(M.dimensionKey)}),this._extensionRowDimensionKeys.push(T),this.fullRowDimensionKeys=this.fullRowDimensionKeys.concat(T)})),this.sharedVar.seqId=Math.max(this.sharedVar.seqId,this._headerObjects.length);let S,A=this.columnDimensionTree.dimensionKeysIncludeVirtual.valueArr();!this.dataset||this._table.isPivotChart()||((C=(b=this.dataset.records)===null||b===void 0?void 0:b.length)!==null&&C!==void 0?C:0)!==0||this.dataset.customColTree||(A=this.columnsDefine.map(x=>typeof x=="string"?x:x.dimensionKey),this.indicatorsAsCol&&A.push(this.indicatorDimensionKey)),A=this.columnHeaderTitle?[""].concat(A):A;let R=[];if(this.rowHierarchyType==="tree"&&((_=this.extensionRows)===null||_===void 0?void 0:_.length)>=1){const x=[];x.push(this.rowDimensionKeys[0]),this._extensionRowDimensionKeys.forEach(T=>{x.push(T[0])}),R=this.extensionRows.reduce((T,M)=>T.concat(M.rows),[]),S=this.rowHeaderTitle?[""].concat(x):x}else S=this.rowDimensionTree.dimensionKeysIncludeVirtual.valueArr(),!this.dataset||this._table.isPivotChart()||((y=(w=this.dataset.records)===null||w===void 0?void 0:w.length)!==null&&y!==void 0?y:0)!==0||this.dataset.customRowTree||(S=this.rowsDefine.map(x=>typeof x=="string"?x:x.dimensionKey),this.indicatorsAsCol||S.push(this.indicatorDimensionKey)),S=this.rowHeaderTitle?[""].concat(S):S;this.cornerHeaderObjs=this._addCornerHeaders(A,S,this.columnsDefine.concat(...this.rowsDefine,...R)),this.colIndex=0,this._headerObjectMap=this._headerObjects.reduce((x,T)=>(x[T.id]=T,x),{}),this.indicatorsAsCol&&!this.hideIndicatorName?this._indicatorShowType="column":this.indicatorsAsCol||this.hideIndicatorName?this._indicatorShowType="none":this._indicatorShowType="row",this.generateCellIdsConsiderHideHeader(),this.setPagination(t.options.pagination),this._table.isPivotChart()&&(this._chartItemSpanSize=0,this._chartItemBandSize=0,this._indicators.find(x=>{var T,M,B,P,F,H,E,k;!((T=x==null?void 0:x.style)===null||T===void 0)&&T.padding&&(this._chartPadding=x.style.padding),!((M=x.chartSpec)===null||M===void 0)&&M.barWidth&&typeof x.chartSpec.barWidth=="number"&&(this._chartItemSpanSize=(B=x.chartSpec)===null||B===void 0?void 0:B.barWidth);const I=(F=(P=x.chartSpec)===null||P===void 0?void 0:P.axes)===null||F===void 0?void 0:F.find(L=>L.type==="band");return I!=null&&I.bandSize&&(this._chartItemBandSize=I==null?void 0:I.bandSize,this._chartPaddingInner=(H=lt(I.paddingInner)?I.paddingInner[0]:I.paddingInner)!==null&&H!==void 0?H:0,this._chartPaddingOuter=(E=lt(I.paddingOuter)?I.paddingOuter[0]:I.paddingOuter)!==null&&E!==void 0?E:0),this._chartItemSpanSize>0||((k=x.chartSpec.series)===null||k===void 0||k.find(L=>(L.barWidth&&typeof L.barWidth=="number"&&(this._chartItemSpanSize=L.barWidth),this._chartItemSpanSize>0)),!1)})),this.handleRowSeriesNumber(t.internalProps.rowSeriesNumber),this.setColumnWidths()}handleRowSeriesNumber(t){var e,n;t&&(Array.isArray(t)?this.rowSeriesNumberColumn=t.map(o=>{var r,s;return{id:"",title:o.title,define:o,cellType:(r=o.cellType)!==null&&r!==void 0?r:"text",headerType:(s=o.cellType)!==null&&s!==void 0?s:"text",width:o.width,style:o.style,format:o.format,field:o.field,icon:o.icon}}):this.rowSeriesNumberColumn=[{id:"",title:t.title,define:t,cellType:(e=t.cellType)!==null&&e!==void 0?e:"text",headerType:(n=t.cellType)!==null&&n!==void 0?n:"text",style:t.style,width:t.width,format:t.format,field:"",icon:t.icon,isChildNode:!1}],this.leftRowSeriesNumberColumn=this.rowSeriesNumberColumn.filter(o=>!0),this.rightRowSeriesNumberColumn=this.rowSeriesNumberColumn.filter(o=>!1),this.leftRowSeriesNumberColumnCount=this.leftRowSeriesNumberColumn.length,this.rightRowSeriesNumberColumnCount=this.rightRowSeriesNumberColumn.length)}_generateColHeaderIds(){var t,e,n,o,r,s,l,a;if(((t=this.columnDimensionTree.tree.children)===null||t===void 0?void 0:t.length)>=1){let h=0;if(this.dataset&&!this._table.isPivotChart()&&((n=(e=this.dataset.records)===null||e===void 0?void 0:e.length)!==null&&n!==void 0?n:0)===0&&!this.dataset.customColTree&&!this.dataset.customRowTree&&this.indicatorsAsCol&&this.columnDimensionTree.totalLevel<this.columnHeaderLevelCount){h=this.columnHeaderLevelCount-this.columnDimensionTree.totalLevel;for(let d=0;d<h;d++)this._columnHeaderCellFullPathIds.unshift([])}this._addHeaders(this._columnHeaderCellFullPathIds,h,this.columnDimensionTree.tree.children,[],this.columnHeaderObjs)}if(this.columnHeaderTitle){this.sharedVar.seqId=Math.max(this.sharedVar.seqId,this._headerObjects.length);const h=++this.sharedVar.seqId,d=Array(this.colCount-this.rowHeaderLevelCount-this.rightFrozenColCount).fill(h);this._columnHeaderCellFullPathIds.unshift(d);const u={id:h,title:typeof this.columnHeaderTitle.title=="string"?this.columnHeaderTitle.title:this.columnsDefine.reduce((c,g)=>typeof g=="string"?c:c+(c?`/${g.title}`:`${g.title}`),""),field:void 0,headerType:(r=(o=this.columnHeaderTitle)===null||o===void 0?void 0:o.headerType)!==null&&r!==void 0?r:"text",style:(s=this.columnHeaderTitle)===null||s===void 0?void 0:s.headerStyle,define:{id:h,disableHeaderHover:!!(!((l=this.columnHeaderTitle)===null||l===void 0)&&l.disableHeaderHover),disableHeaderSelect:!!(!((a=this.columnHeaderTitle)===null||a===void 0)&&a.disableHeaderSelect)}};this.columnHeaderObjs.push(u),this._headerObjects[h]=u}}_generateRowHeaderIds(){var t,e,n,o,r,s,l,a,h,d;if(((t=this.rowDimensionTree.tree.children)===null||t===void 0?void 0:t.length)>=1)if(this.rowHierarchyType==="tree")this._addHeadersForTreeMode(this._rowHeaderCellFullPathIds_FULL,0,this.rowDimensionTree.tree.children,[],this.rowDimensionTree.totalLevel,!0,this.rowsDefine,this.rowHeaderObjs);else{let u=0;if(this.dataset&&!this._table.isPivotChart()&&((n=(e=this.dataset.records)===null||e===void 0?void 0:e.length)!==null&&n!==void 0?n:0)===0&&!this.dataset.customColTree&&!this.dataset.customRowTree&&!this.indicatorsAsCol&&this.rowDimensionTree.totalLevel<this.rowHeaderLevelCount){u=this.rowHeaderLevelCount-this.rowDimensionTree.totalLevel;for(let c=0;c<u;c++)this._rowHeaderCellFullPathIds_FULL.unshift([])}this._addHeaders(this._rowHeaderCellFullPathIds_FULL,u,this.rowDimensionTree.tree.children,[],this.rowHeaderObjs)}if(this.rowHeaderTitle){this.sharedVar.seqId=Math.max(this.sharedVar.seqId,this._headerObjects.length);const u=++this.sharedVar.seqId,c=Array((r=(o=this._rowHeaderCellFullPathIds_FULL[0])===null||o===void 0?void 0:o.length)!==null&&r!==void 0?r:this.rowDimensionTree.tree.size).fill(u);this._rowHeaderCellFullPathIds_FULL.unshift(c);const g={id:u,title:typeof this.rowHeaderTitle.title=="string"?this.rowHeaderTitle.title:this.rowsDefine.reduce((f,p)=>typeof p=="string"?f:f+(f?`/${p.title}`:`${p.title}`),""),field:void 0,headerType:(l=(s=this.rowHeaderTitle)===null||s===void 0?void 0:s.headerType)!==null&&l!==void 0?l:"text",style:(a=this.rowHeaderTitle)===null||a===void 0?void 0:a.headerStyle,define:{id:u,disableHeaderHover:!!(!((h=this.rowHeaderTitle)===null||h===void 0)&&h.disableHeaderHover),disableHeaderSelect:!!(!((d=this.rowHeaderTitle)===null||d===void 0)&&d.disableHeaderSelect)}};this.rowHeaderObjs.push(g),this._headerObjects[u]=g}}_addHeaders(t,e,n,o,r){const s=this;t[e]||function(l){const a=t[l]=[];if(s.colIndex===0)return a;const h=t[l-1];for(let d=0;d<(h==null?void 0:h.length);d++)a[d]=h[d]}(e);for(let l=0;l<n.length;l++){const a=n[l];R8(a,t,r,o,e,this)}}_addHeadersForTreeMode(t,e,n,o,r,s,l,a){const h=this;t[e]||function(d){const u=t[d]=[];if(h.colIndex===0)return u;const c=t[d-1];for(let g=0;g<(c==null?void 0:c.length);g++)u[g]=c[g]}(e);for(let d=0;d<n.length;d++){const u=n[d];A8(u,t,a,o,e,r,s,l,this)}}_addCornerHeaders(t,e,n){var o,r;const s=[];if(this.cornerSetting.titleOnDimension==="all")if(this.indicatorsAsCol){let l=-1;t&&t.forEach((a,h)=>{var d,u;a===this.indicatorDimensionKey&&(l=h);const c=++this.sharedVar.seqId,g=n.find(p=>typeof p!="string"&&p.dimensionKey===a),f={id:c,title:a===this.indicatorDimensionKey?this.indicatorTitle:g?g.title:a==="axis"?"":a,field:a,style:this.cornerSetting.headerStyle,headerType:(d=this.cornerSetting.headerType)!==null&&d!==void 0?d:"text",showSort:g==null?void 0:g.showSortInCorner,sort:g==null?void 0:g.sort,define:{showSort:g==null?void 0:g.showSortInCorner,sort:g==null?void 0:g.sort,dimensionKey:a,id:c,value:a,headerEditor:this.cornerSetting.headerEditor,disableHeaderHover:!!this.cornerSetting.disableHeaderHover,disableHeaderSelect:!!this.cornerSetting.disableHeaderSelect},dropDownMenu:g==null?void 0:g.cornerDropDownMenu,headerIcon:g==null?void 0:g.cornerHeaderIcon,pivotInfo:{value:(u=g==null?void 0:g.title)!==null&&u!==void 0?u:"",dimensionKey:a,isPivotCorner:!0},description:g==null?void 0:g.cornerDescription};s[c]=f,this._headerObjects[c]=f,this._cornerHeaderCellFullPathIds[h]||(this._cornerHeaderCellFullPathIds[h]=[]);for(let p=0;p<this.rowHeaderLevelCount;p++)this._cornerHeaderCellFullPathIds[h][p]=c}),e&&e.forEach((a,h)=>{var d,u;const c=++this.sharedVar.seqId,g=n.find(p=>typeof p!="string"&&p.dimensionKey===a),f={id:c,title:a===this.indicatorDimensionKey?this.indicatorTitle:g?g.title:a==="axis"?"":a,field:a,style:this.cornerSetting.headerStyle,headerType:(d=this.cornerSetting.headerType)!==null&&d!==void 0?d:"text",showSort:g==null?void 0:g.showSortInCorner,sort:g==null?void 0:g.sort,define:{showSort:g==null?void 0:g.showSortInCorner,sort:g==null?void 0:g.sort,dimensionKey:a,id:c,value:a,headerEditor:this.cornerSetting.headerEditor,disableHeaderHover:!!this.cornerSetting.disableHeaderHover,disableHeaderSelect:!!this.cornerSetting.disableHeaderSelect},dropDownMenu:g==null?void 0:g.cornerDropDownMenu,headerIcon:g==null?void 0:g.cornerHeaderIcon,pivotInfo:{value:(u=g==null?void 0:g.title)!==null&&u!==void 0?u:"",dimensionKey:a,isPivotCorner:!0},description:g==null?void 0:g.cornerDescription};s[c]=f,this._headerObjects[c]=f,this._cornerHeaderCellFullPathIds[l]||(this._cornerHeaderCellFullPathIds[l]=[]),this._cornerHeaderCellFullPathIds[l][h]=c})}else{let l=-1;e&&e.forEach((a,h)=>{var d,u;a===this.indicatorDimensionKey&&(l=h);const c=++this.sharedVar.seqId,g=n.find(p=>typeof p!="string"&&p.dimensionKey===a),f={id:c,title:a===this.indicatorDimensionKey?this.indicatorTitle:g?g.title:a==="axis"?"":a,field:a,style:this.cornerSetting.headerStyle,headerType:(d=this.cornerSetting.headerType)!==null&&d!==void 0?d:"text",showSort:g==null?void 0:g.showSortInCorner,sort:g==null?void 0:g.sort,define:{showSort:g==null?void 0:g.showSortInCorner,sort:g==null?void 0:g.sort,dimensionKey:a,id:c,value:a,headerEditor:this.cornerSetting.headerEditor,disableHeaderHover:!!this.cornerSetting.disableHeaderHover,disableHeaderSelect:!!this.cornerSetting.disableHeaderSelect},dropDownMenu:g==null?void 0:g.cornerDropDownMenu,headerIcon:g==null?void 0:g.cornerHeaderIcon,pivotInfo:{value:(u=g==null?void 0:g.title)!==null&&u!==void 0?u:"",dimensionKey:a,isPivotCorner:!0},description:g==null?void 0:g.cornerDescription};s[c]=f,this._headerObjects[c]=f;for(let p=0;p<this.columnHeaderLevelCount;p++)this._cornerHeaderCellFullPathIds[p]||(this._cornerHeaderCellFullPathIds[p]=[]),this._cornerHeaderCellFullPathIds[p][h]=c}),t&&t.forEach((a,h)=>{var d,u;const c=++this.sharedVar.seqId,g=n.find(p=>typeof p!="string"&&p.dimensionKey===a),f={id:c,title:a===this.indicatorDimensionKey?this.indicatorTitle:g?g.title:a==="axis"?"":a,field:a,style:this.cornerSetting.headerStyle,headerType:(d=this.cornerSetting.headerType)!==null&&d!==void 0?d:"text",showSort:g==null?void 0:g.showSortInCorner,sort:g==null?void 0:g.sort,define:{showSort:g==null?void 0:g.showSortInCorner,sort:g==null?void 0:g.sort,dimensionKey:a,id:c,value:a,headerEditor:this.cornerSetting.headerEditor,disableHeaderHover:!!this.cornerSetting.disableHeaderHover,disableHeaderSelect:!!this.cornerSetting.disableHeaderSelect},dropDownMenu:g==null?void 0:g.cornerDropDownMenu,headerIcon:g==null?void 0:g.cornerHeaderIcon,pivotInfo:{value:(u=g==null?void 0:g.title)!==null&&u!==void 0?u:"",dimensionKey:a,isPivotCorner:!0},description:g==null?void 0:g.cornerDescription};s[c]=f,this._headerObjects[c]=f,this._cornerHeaderCellFullPathIds[h][l]=c})}else if(this.cornerSetting.titleOnDimension==="row"||this.cornerSetting.titleOnDimension==="column"){const l=((o=this.cornerSetting)===null||o===void 0?void 0:o.titleOnDimension)==="row"?e:t;l&&l.forEach((a,h)=>{var d,u;const c=++this.sharedVar.seqId,g=n.find(p=>typeof p!="string"&&p.dimensionKey===a),f={id:c,title:a===this.indicatorDimensionKey?this.indicatorTitle:g?g.title:a==="axis"?"":a,field:a,style:this.cornerSetting.headerStyle,headerType:(d=this.cornerSetting.headerType)!==null&&d!==void 0?d:"text",showSort:g==null?void 0:g.showSortInCorner,sort:g==null?void 0:g.sort,define:{showSort:g==null?void 0:g.showSortInCorner,sort:g==null?void 0:g.sort,dimensionKey:a,id:c,value:a,headerCustomRender:this.cornerSetting.customRender,headerCustomLayout:this.cornerSetting.customLayout,headerEditor:this.cornerSetting.headerEditor,disableHeaderHover:!!this.cornerSetting.disableHeaderHover,disableHeaderSelect:!!this.cornerSetting.disableHeaderSelect},dropDownMenu:g==null?void 0:g.cornerDropDownMenu,headerIcon:g==null?void 0:g.cornerHeaderIcon,pivotInfo:{value:(u=g==null?void 0:g.title)!==null&&u!==void 0?u:"",dimensionKey:a,isPivotCorner:!0},description:g==null?void 0:g.cornerDescription};if(s[c]=f,this._headerObjects[c]=f,this.cornerSetting.titleOnDimension==="column"){this._cornerHeaderCellFullPathIds[h]||(this._cornerHeaderCellFullPathIds[h]=[]);for(let p=0;p<this.rowHeaderLevelCount;p++)this._cornerHeaderCellFullPathIds[h][p]=c}else if(this.cornerSetting.titleOnDimension==="row")for(let p=0;p<this.columnHeaderLevelCount;p++)this._cornerHeaderCellFullPathIds[p]||(this._cornerHeaderCellFullPathIds[p]=[]),this._cornerHeaderCellFullPathIds[p][h]=c})}else{const l=++this.sharedVar.seqId,a={id:l,title:"",field:"维度名称",style:this.cornerSetting.headerStyle,headerType:(r=this.cornerSetting.headerType)!==null&&r!==void 0?r:"text",define:{dimensionKey:"维度名称",id:l,headerCustomRender:this.cornerSetting.customRender,headerCustomLayout:this.cornerSetting.customLayout,disableHeaderHover:!!this.cornerSetting.disableHeaderHover,disableHeaderSelect:!!this.cornerSetting.disableHeaderSelect}};s[l]=a,this._headerObjects[l]=a;for(let h=0;h<this.columnHeaderLevelCount;h++)for(let d=0;d<this.rowHeaderLevelCount;d++)this._cornerHeaderCellFullPathIds[h]||(this._cornerHeaderCellFullPathIds[h]=[]),this._cornerHeaderCellFullPathIds[h][d]=l}return s}generateExtensionRowTree(){this.extensionRows.forEach((t,e)=>{const n=this._rowHeaderCellFullPathIds_FULL;this._rowHeaderCellFullPathIds_FULL=[],n.forEach((o,r)=>{const s=o[o.length-1];let l,a;if(this.colIndex=0,typeof t.rowTree=="function"){const d=this.findFullCellIds(o);l=t.rowTree(d.map(u=>({dimensionKey:this._headerObjects[u].field,value:this._headerObjects[u].title})))}else l=Ee(t.rowTree);this._rowHeaderExtensionTree[s]?(this._rowHeaderExtensionTree[s].reset(this._rowHeaderExtensionTree[s].tree.children,!0),a=this._rowHeaderExtensionTree[s]):(a=new Pe(l??[],this.sharedVar,this.rowHierarchyType,void 0),this._rowHeaderExtensionTree[s]=a);const h=[];this._addHeadersForTreeMode(h,0,a.tree.children,[],a.totalLevel,!0,t.rows,this.rowHeaderObjs);for(let d=0;d<h[0].length;d++)this._rowHeaderCellFullPathIds_FULL.push(o.concat(h[0][d]))})})}setColumnWidths(){var t,e,n;const o=new Array(this.colCount).fill(void 0);if(this.leftRowSeriesNumberColumnCount&&(o[0]=this.leftRowSeriesNumberColumn[0]),this.showHeader&&this.showRowHeader)if(this.rowHeaderTitle&&(o[0+this.leftRowSeriesNumberColumnCount]={}),this.rowHierarchyType==="tree"){const r=this.rowDimensionKeys[0];if(r){const s=(t=this.rowsDefine)===null||t===void 0?void 0:t.find(l=>typeof l!="string"&&l.dimensionKey===r);s&&(o[0+(this.rowHeaderTitle?1:0)+this.leftRowSeriesNumberColumnCount]={width:s.width,minWidth:s.minWidth,maxWidth:s.maxWidth})}(e=this._extensionRowDimensionKeys)===null||e===void 0||e.forEach((s,l)=>{var a;const h=s[0];if(h){const d=(a=this.extensionRows[l].rows)===null||a===void 0?void 0:a.find(u=>typeof u!="string"&&u.dimensionKey===h);d&&(o[l+1+(this.rowHeaderTitle?1:0)+this.leftRowSeriesNumberColumnCount]={width:d.width,minWidth:d.minWidth,maxWidth:d.maxWidth})}})}else(this.rowDimensionTree.totalLevel>0?this.rowDimensionTree.dimensionKeysIncludeVirtual.valueArr():this.rowsDefine.map(r=>typeof r=="string"?r:r.dimensionKey)).forEach((r,s)=>{var l;const a=(l=this.rowsDefine)===null||l===void 0?void 0:l.find(h=>typeof h!="string"&&h.dimensionKey===r);a&&(o[s+(this.rowHeaderTitle?1:0)+this.leftRowSeriesNumberColumnCount]={width:a.width,minWidth:a.minWidth,maxWidth:a.maxWidth})});if(this.indicatorsAsCol)for(let r=this.rowHeaderLevelCount+this.leftRowSeriesNumberColumnCount;r<this.colCount;r++){const s=this.getBody(r,this.columnHeaderLevelCount);o[r]={width:s==null?void 0:s.width,minWidth:s==null?void 0:s.minWidth,maxWidth:s==null?void 0:s.maxWidth}}else{let r,s,l,a=0;(n=this._indicators)===null||n===void 0||n.forEach((h,d)=>{var u,c;typeof h.width=="number"?a=Math.max(h.width,a):h.width==="auto"&&(l=!0),typeof h.minWidth=="number"&&(s=Math.max(h.minWidth,(u=s)!==null&&u!==void 0?u:0)),typeof h.maxWidth=="number"&&(r=Math.min(h.maxWidth,(c=r)!==null&&c!==void 0?c:Number.MAX_VALUE))}),a=a>0?a:l?"auto":void 0,o.fill({width:a,minWidth:s,maxWidth:r},this.rowHeaderLevelCount+this.leftRowSeriesNumberColumnCount,this.colCount-this.rightFrozenColCount)}this._columnWidths=o}get columnWidths(){return this._columnWidths}getColumnWidthDefined(t){return this._columnWidths[t]}get showHeader(){return this._showHeader}set showHeader(t){this._showHeader=t}get showColumnHeader(){return this._showColumnHeader}set showColumnHeader(t){this._showColumnHeader=t}get showRowHeader(){return this._showRowHeader}set showRowHeader(t){this._showRowHeader=t}get columnHeaderTitle(){return this._columnHeaderTitle}set columnHeaderTitle(t){this._columnHeaderTitle=t}get rowHeaderTitle(){return this._rowHeaderTitle}set rowHeaderTitle(t){this._rowHeaderTitle=t}getHeaderFieldKey(t,e){}getCellLocation(t,e){return this.isCornerHeader(t,e)?"cornerHeader":this.isColumnHeader(t,e)?"columnHeader":this.isRowHeader(t,e)?"rowHeader":"body"}isHeader(t,e){return t>=this.leftRowSeriesNumberColumnCount&&t<this.rowHeaderLevelCount+this.leftRowSeriesNumberColumnCount||e>=0&&e<this.columnHeaderLevelCount||t>=this.colCount-this.rightHeaderColCount||e>=this.rowCount-this.bottomHeaderRowCount}isCornerHeader(t,e){return t>=0&&t<this.rowHeaderLevelCount+this.leftRowSeriesNumberColumnCount&&e>=0&&e<this.columnHeaderLevelCount}isColumnHeader(t,e){return t>=this.rowHeaderLevelCount+this.leftRowSeriesNumberColumnCount&&e>=0&&e<this.columnHeaderLevelCount}isRowHeader(t,e){return t>=this.leftRowSeriesNumberColumnCount&&t<this.rowHeaderLevelCount+this.leftRowSeriesNumberColumnCount&&e>=this.columnHeaderLevelCount}isFrozen(t,e){return this.isFrozenColumn(t)||this.isRightFrozenColumn(t)||this.isBottomFrozenRow(e)||this.isFrozenRow(e)||this.isSeriesNumberInBody(t,e)||this.isSeriesNumberInHeader(t,e)}isFrozenColumn(t,e){if(z(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(z(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(z(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(z(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}isLeftTopCorner(t,e){return t>=0&&t<this.frozenColCount&&e>=0&&e<this.frozenRowCount}isLeftBottomCorner(t,e){return t>=0&&t<this.frozenColCount&&e>=this.rowCount-this.bottomFrozenRowCount}isRightTopCorner(t,e){return t>=this.colCount-this.rightFrozenColCount&&e>=0&&e<this.frozenRowCount}isRightBottomCorner(t,e){return t>=this.colCount-this.rightFrozenColCount&&e>=this.rowCount-this.bottomFrozenRowCount}getColumnHeaderRange(){return{start:{col:this.rowHeaderLevelCount,row:0},end:{col:this.colCount-1,row:this.columnHeaderLevelCount-1}}}getRowHeaderRange(){return{start:{col:0,row:this.columnHeaderLevelCount},end:{col:this.rowHeaderLevelCount-1,row:this.rowCount-1}}}getCornerHeaderRange(){return{start:{col:0,row:0},end:{col:this.rowHeaderLevelCount-1,row:this.columnHeaderLevelCount-1}}}getBodyRange(){return{start:{col:this.rowHeaderLevelCount,row:this.columnHeaderLevelCount},end:{col:this.colCount-1,row:this.rowCount-1}}}resetCellIds(){}get 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 headerLevelCount(){return this.columnHeaderLevelCount}resetColumnHeaderLevelCount(){var t,e,n,o,r,s,l,a,h,d,u;if(this.showHeader&&this.showColumnHeader){if(this._table.isPivotChart()&&this.indicatorsAsCol&&!(!((e=(t=this.dataset)===null||t===void 0?void 0:t.colKeys)===null||e===void 0)&&e.length)&&((o=(n=this.columnDimensionTree)===null||n===void 0?void 0:n.tree)===null||o===void 0?void 0:o.level)===0&&!this.hasTwoIndicatorAxes)return void(this.columnHeaderLevelCount=0);let c=this.indicatorsAsCol&&this.hideIndicatorName&&this.colDimensionKeys[this.colDimensionKeys.length-1]===this.indicatorDimensionKey?this.columnDimensionTree.totalLevel-1:this.columnDimensionTree.totalLevel;return c===0&&this.dataset&&!(!((r=this.dataset.customColTree)===null||r===void 0)&&r.length)?this.cornerSetting.titleOnDimension==="row"&&this.cornerSetting.forceShowHeader?c=1:this._table.isPivotChart()||((l=(s=this.dataset.records)===null||s===void 0?void 0:s.length)!==null&&l!==void 0?l:0)!==0||this.cornerSetting.titleOnDimension!=="column"&&this.cornerSetting.titleOnDimension!=="all"||(c=(a=this.columnsDefine.length)!==null&&a!==void 0?a:0):!this.dataset||this._table.isPivotChart()||((d=(h=this.dataset.records)===null||h===void 0?void 0:h.length)!==null&&d!==void 0?d:0)!==0||this.dataset.customColTree||this.cornerSetting.titleOnDimension!=="column"&&this.cornerSetting.titleOnDimension!=="all"||(c=(u=this.columnsDefine.length)!==null&&u!==void 0?u:0,!this.hideIndicatorName&&this.indicatorsAsCol&&c++),this.columnHeaderTitle&&(c+=1),this._table.isPivotChart()&&this.indicatorsAsCol&&!this.hasTwoIndicatorAxes&&Lh(this.indicatorsDefine)&&(c-=1),void(this.columnHeaderLevelCount=c)}this.columnHeaderLevelCount=this.indicatorsAsCol?this.hideIndicatorName?0:1:0}resetRowHeaderLevelCount(){var t,e,n,o,r,s,l,a;if(this.showHeader&&this.showRowHeader){if(this.rowHierarchyType==="tree"){const u=(e=(t=this.extensionRows)===null||t===void 0?void 0:t.length)!==null&&e!==void 0?e:0;return this.rowHeaderTitle?void(this.rowHeaderLevelCount=2+u):void(this.rowHeaderLevelCount=1+u)}const h=this.rowDimensionTree.totalLevel;let d=h;return d===0&&this.dataset&&!(!((n=this.dataset.customRowTree)===null||n===void 0)&&n.length)?this.cornerSetting.titleOnDimension==="column"&&this.cornerSetting.forceShowHeader?d=1:this._table.isPivotChart()||((r=(o=this.dataset.records)===null||o===void 0?void 0:o.length)!==null&&r!==void 0?r:0)!==0||this.cornerSetting.titleOnDimension!=="row"&&this.cornerSetting.titleOnDimension!=="all"||(d=(s=this.rowsDefine.length)!==null&&s!==void 0?s:0):!this.dataset||this._table.isPivotChart()||((a=(l=this.dataset.records)===null||l===void 0?void 0:l.length)!==null&&a!==void 0?a:0)!==0||this.dataset.customRowTree||this.cornerSetting.titleOnDimension!=="row"&&this.cornerSetting.titleOnDimension!=="all"||(d=this.rowsDefine.length,this.hideIndicatorName||this.indicatorsAsCol||d++),!this.indicatorsAsCol&&this.hideIndicatorName&&this.rowDimensionKeys[this.rowDimensionKeys.length-1]===this.indicatorDimensionKey&&(d=h-1),this.rowHeaderTitle&&(d+=1),void(this.rowHeaderLevelCount=d)}this.rowHeaderLevelCount=this.indicatorsAsCol||this.hideIndicatorName?0:1}get columnHeaderLevelCount(){return this._columnHeaderLevelCount}set columnHeaderLevelCount(t){this._columnHeaderLevelCount=t}get rowHeaderLevelCount(){return this._rowHeaderLevelCount}set rowHeaderLevelCount(t){this._rowHeaderLevelCount=t}get colCount(){var t;return(this.columnDimensionTree.totalLevel>0||this._table.isPivotChart()||((t=this.dataset.records)===null||t===void 0?void 0:t.length)>0||this.dataset.records&&!Array.isArray(this.dataset.records)?this.columnDimensionTree.tree.size:0)+this.rowHeaderLevelCount+this.rightHeaderColCount+this.leftRowSeriesNumberColumnCount}get rowCount(){var t,e,n,o;return((this._table.records||this.dataset.records)&&(!Array.isArray(this._table.records)||this._table.records.length>0)&&((t=this._indicators)===null||t===void 0?void 0:t.length)>0&&!(!((e=this._rowHeaderCellIds)===null||e===void 0)&&e.length)?1:(o=(n=this._rowHeaderCellIds)===null||n===void 0?void 0:n.length)!==null&&o!==void 0?o:0)+this.columnHeaderLevelCount+this.bottomHeaderRowCount}get bodyRowSpanCount(){return this.rowDimensionTree.tree.size}get bottomFrozenRowCount(){if(!this._table.isPivotChart())return this._table.internalProps.bottomFrozenRowCount?this.rowCount-this.headerLevelCount>=this._table.internalProps.bottomFrozenRowCount?this._table.internalProps.bottomFrozenRowCount:this.rowCount-this.headerLevelCount:0;if(this.indicatorKeys.length>=1&&Lh(this.indicatorsDefine)){const t=this._table.pivotChartAxes.find(e=>e.orient==="bottom");return(t==null?void 0:t.visible)===!1?0:(this.indicatorsAsCol,1)}return 0}get rightFrozenColCount(){if(!this._table.isPivotChart())return this._table.internalProps.rightFrozenColCount?this.colCount-this.rowHeaderLevelCount>=this._table.internalProps.rightFrozenColCount?this._table.internalProps.rightFrozenColCount:this.colCount-this.rowHeaderLevelCount:0;const t=this._table.pivotChartAxes.find(e=>e.orient==="right");return(t==null?void 0:t.visible)===!1||this.indicatorsAsCol?0:this.hasTwoIndicatorAxes?1:0}get bodyRowCount(){return this.rowCount-this.bottomFrozenRowCount-this.headerLevelCount}get bodyColCount(){return this.colCount-this.rightFrozenColCount-this.rowHeaderLevelCount}get headerObjects(){return this._headerObjects}get columnObjects(){return this._indicators}getCellId(t,e){var n,o,r,s,l;if(e>=0&&t>=0){if(this.isSeriesNumber(t,e))return"";if(this.isCornerHeader(t,e))return(n=this._cornerHeaderCellIds[e])===null||n===void 0?void 0:n[t-this.leftRowSeriesNumberColumnCount];if(this.isColumnHeader(t,e))return(o=this._columnHeaderCellIds[e])===null||o===void 0?void 0:o[t-this.rowHeaderLevelCount-this.leftRowSeriesNumberColumnCount];if(this.isRowHeader(t,e))return(r=this._rowHeaderCellIds[e-this.columnHeaderLevelCount])===null||r===void 0?void 0:r[t-this.leftRowSeriesNumberColumnCount];if(this.isRightFrozenColumn(t,e))return(s=this._rowHeaderCellIds[e-this.columnHeaderLevelCount])===null||s===void 0?void 0:s[this.rowHeaderLevelCount-1];if(this.isBottomFrozenRow(t,e))return(l=this._columnHeaderCellIds[this.columnHeaderLevelCount-1])===null||l===void 0?void 0:l[t-this.rowHeaderLevelCount-this.leftRowSeriesNumberColumnCount]}}getHeader(t,e){var n;if(this.isSeriesNumberInHeader(t,e))return this.getSeriesNumberHeader(t,e);const o=this.getCellId(t,e);return(n=this._headerObjectMap[o])!==null&&n!==void 0?n:{id:void 0,field:"",headerType:"text",define:void 0}}getHeaderField(t,e){var n,o;const r=this.getCellId(t,e);return((n=this._headerObjectMap[r])===null||n===void 0?void 0:n.field)||((o=this.getBody(t,e))===null||o===void 0?void 0:o.field)}getHeaderCellAdressById(t){for(let e=0;e<this._columnHeaderCellIds.length;e++){const n=this._columnHeaderCellIds[e];for(let o=0;o<n.length;o++)if(n[o]===t)return{col:o+this._table.frozenColCount,row:e}}for(let e=0;e<this._rowHeaderCellIds.length;e++){const n=this._rowHeaderCellIds[e];for(let o=0;o<n.length;o++)if(n[o]===t)return{col:o,row:e+this._table.frozenRowCount}}for(let e=0;e<this._cornerHeaderCellIds.length;e++){const n=this._cornerHeaderCellIds[e];for(let o=0;o<n.length;o++)if(n[o]===t)return{col:o,row:e}}}getHeaderCellAddressByField(t){const e=this.headerObjects.find(n=>n&&n.field===t);return e&&this.getHeaderCellAdressById(e.id)}getBody(t,e){var n,o,r,s,l,a,h,d,u,c;const g=this.getBodyWidthCache(t,e);if(g)return g;if(this.isSeriesNumber(t,e)){const b=this.getSeriesNumberBody(t,e);return this.setBodyWidthCache(t,e,b),b}const f=this.getCellHeaderPaths(t,e);if(this.indicatorsAsCol){const b=(o=(n=f.colHeaderPaths)===null||n===void 0?void 0:n.find(_=>_.indicatorKey))===null||o===void 0?void 0:o.indicatorKey,C=z(b)&&(l=(s=(r=this._indicators)===null||r===void 0?void 0:r.find(_=>_.indicatorKey===b))!==null&&s!==void 0?s:this._indicators[0])!==null&&l!==void 0?l:{id:"",field:void 0,indicatorKey:void 0,cellType:"text",define:void 0};return this.setBodyWidthCache(t,e,C),C}const p=(h=(a=f.rowHeaderPaths)===null||a===void 0?void 0:a.find(b=>b.indicatorKey))===null||h===void 0?void 0:h.indicatorKey,m=z(p)&&(c=(u=(d=this._indicators)===null||d===void 0?void 0:d.find(b=>b.indicatorKey===p))!==null&&u!==void 0?u:this._indicators[0])!==null&&c!==void 0?c:{id:"",field:void 0,indicatorKey:void 0,cellType:"text",define:void 0};return this.setBodyWidthCache(t,e,m),m}getCellRange(t,e){var n,o;const r={start:{col:t,row:e},end:{col:t,row:e}};if(!this.isHeader(t,e)||t===-1||e===-1||this.isRightFrozenColumn(t,e)||this.isBottomFrozenRow(t,e))return r;if(this._table.isPivotChart()){if(this.isLeftBottomCorner(t,e))return{start:{col:0,row:this.rowCount-this.bottomFrozenRowCount},end:{col:this.frozenColCount-1,row:this.rowCount-1}};if(this.isRightTopCorner(t,e))return{start:{col:this.colCount-this.rightFrozenColCount,row:0},end:{col:this.colCount-1,row:this.frozenRowCount-1}};if(this.isRightBottomCorner(t,e))return{start:{col:this.colCount-this.rightFrozenColCount,row:this.rowCount-this.bottomFrozenRowCount},end:{col:this.colCount-1,row:this.rowCount-1}}}for(let s=0;s<this._largeCellRangeCache.length;s++){const l=this._largeCellRangeCache[s];if(t>=l.start.col&&t<=l.end.col&&e>=l.start.row&&e<=l.end.row)return l}if(this.isHeader(t,e)&&t!==-1&&e!==-1){const s=this.getCellId(t,e);for(let l=t-1;l>=0&&s===this.getCellId(l,e);l--)r.start.col=l;for(let l=t+1;l<((n=this.colCount)!==null&&n!==void 0?n:0)&&s===this.getCellId(l,e);l++)r.end.col=l;for(let l=e-1;l>=0&&s===this.getCellId(t,l);l--)r.start.row=l;for(let l=e+1;l<((o=this.rowCount)!==null&&o!==void 0?o:0)&&!(s!==this.getCellId(t,l)||this.isSeriesNumberInHeader(t,e)&&l>=this.columnHeaderLevelCount);l++)r.end.row=l}return(r.end.col-r.start.col>100||r.end.row-r.start.row>100)&&this._largeCellRangeCache.push(r),r}isCellRangeEqual(t,e,n,o){const r=this.getCellRange(t,e),s=this.getCellRange(n,o);return r.start.col===s.start.col&&r.end.col===s.end.col&&r.start.row===s.start.row&&r.end.row===s.end.row}getBodyIndexByRow(t){return t<this.columnHeaderLevelCount||t>=this.rowCount-this.bottomHeaderRowCount?-1:t-this.columnHeaderLevelCount}get bottomHeaderRowCount(){return this._table.isPivotChart()?this.bottomFrozenRowCount:0}get rightHeaderColCount(){return this._table.isPivotChart()?this.rightFrozenColCount:0}getBodyIndexByCol(t){return t<this.rowHeaderLevelCount+this.leftRowSeriesNumberColumnCount||t>=this.colCount-this.rightHeaderColCount?-1:t-this.rowHeaderLevelCount-this.leftRowSeriesNumberColumnCount}getRecordStartRowByRecordIndex(t){return this.columnHeaderLevelCount+t}getRecordShowIndexByCell(t,e){}getCellHeaderPathsWithTreeNode(t,e){for(let l=0;l<this._largeCellRangeCache.length;l++){const a=this._largeCellRangeCache[l];if(t>=a.start.col&&t<=a.end.col&&e>=a.start.row&&e<=a.end.row)break}let n=this.getColHeaderPathCache(t,e),o=this.getRowHeaderPathCache(t,e);const r=this.getBodyIndexByCol(t),s=this.getBodyIndexByRow(e)+this.currentPageStartIndex;if(!n&&e>=0&&r>=0&&(n=this.columnDimensionTree.getTreePath(r,this.showHeader&&this.showColumnHeader?e-(this.columnHeaderTitle?1:0):this.columnDimensionTree.totalLevel),this.setColHeaderPathCache(t,e,n)),!o&&t>=0&&s>=0){if(o=[],this.rowHierarchyType==="tree"){const l=this._rowHeaderCellFullPathIds[s];let a=this.rowDimensionTree,h=0;for(;a;){const d=[];let u=l[h];for(d.push(u);;){const g=this._headerObjectMap[u];if(!(g!=null&&g.parentCellId))break;d.unshift(g.parentCellId),u=g.parentCellId}const c=a.getTreePathByCellIds(d);o.push(...c),a=this._rowHeaderExtensionTree[l[h]],h++}}else o=this.rowDimensionTree.getTreePath(s,this.showHeader&&this.showRowHeader?t-(this.rowHeaderTitle?1:0)-this.leftRowSeriesNumberColumnCount:this.rowDimensionTree.totalLevel);this.setRowHeaderPathCache(t,e,o)}return{colHeaderPaths:n,rowHeaderPaths:o,cellLocation:this.getCellLocation(t,e)}}getCellHeaderPaths(t,e){var n,o;const r=this.getCellHeaderPathsWithTreeNode(t,e),s={colHeaderPaths:[],rowHeaderPaths:[],cellLocation:r.cellLocation};return(n=r.colHeaderPaths)===null||n===void 0||n.forEach(l=>{var a,h,d;const u={};u.dimensionKey=l.dimensionKey,u.indicatorKey=l.indicatorKey,u.value=(d=(a=l.value)!==null&&a!==void 0?a:(h=this.getIndicatorInfoByIndicatorKey(l.indicatorKey))===null||h===void 0?void 0:h.title)!==null&&d!==void 0?d:"",u.virtual=l.virtual,s.colHeaderPaths.push(u)}),(o=r.rowHeaderPaths)===null||o===void 0||o.forEach(l=>{var a,h,d;if(l.dimensionKey!=="axis"){const u={};u.dimensionKey=l.dimensionKey,u.indicatorKey=l.indicatorKey,u.value=(d=(a=l.value)!==null&&a!==void 0?a:(h=this.getIndicatorInfoByIndicatorKey(l.indicatorKey))===null||h===void 0?void 0:h.title)!==null&&d!==void 0?d:"",u.virtual=l.virtual,s.rowHeaderPaths.push(u)}}),s}getIndicatorInfoByIndicatorKey(t){var e;return(e=this.indicatorsDefine)===null||e===void 0?void 0:e.find(n=>typeof n!="string"&&!!t&&n.indicatorKey===t)}findFullCellIds(t){const e=[];for(let n=0;n<t.length;n++){let o=t[n];for(e.push(o);;){const r=this._headerObjectMap[o];if(!(r!=null&&r.parentCellId))break;e.unshift(r.parentCellId),o=r.parentCellId}}return e}getHeaderDimension(t,e){var n,o,r;if(this.isHeader(t,e)){const s=this.getHeader(t,e);return(o=(n=this.rowsDefine)===null||n===void 0?void 0:n.find(l=>typeof l!="string"&&l.dimensionKey===s.field))!==null&&o!==void 0?o:(r=this.columnsDefine)===null||r===void 0?void 0:r.find(l=>typeof l!="string"&&l.dimensionKey===s.field)}}isColumnIndicatorHeader(t,e){return this._indicatorShowType==="column"&&e===this.columnHeaderLevelCount-1&&t>=this.rowHeaderLevelCount}isRowIndicatorHeader(t,e){return this._indicatorShowType==="row"&&t===this.rowHeaderLevelCount-1&&e>=this.columnHeaderLevelCount}isIndicatorHeader(t,e){return this.isColumnIndicatorHeader(t,e)||this.isRowIndicatorHeader(t,e)}toggleHierarchyState(t,e){var n,o,r,s,l,a;this.colIndex=0;const h=this._rowHeaderCellFullPathIds_FULL.slice(0),d=h.map((g,f)=>({col:t,row:f+this.columnHeaderLevelCount})),u=this.getHeader(t,e);if(u.define.hierarchyState=u.define.hierarchyState===Vt.collapse?Vt.expand:Vt.collapse,this.rowDimensionTree.reset(this.rowDimensionTree.tree.children,!0),this._rowHeaderCellFullPathIds_FULL=[],this.rowDimensionKeys=this.rowDimensionTree.dimensionKeysIncludeVirtual.valueArr(),this.fullRowDimensionKeys=[],this.fullRowDimensionKeys=this.fullRowDimensionKeys.concat(this.rowDimensionKeys),this._addHeadersForTreeMode(this._rowHeaderCellFullPathIds_FULL,0,this.rowDimensionTree.tree.children,[],this.rowDimensionTree.totalLevel,!0,this.rowsDefine,this.rowHeaderObjs),this.rowHeaderTitle){const g=++this.sharedVar.seqId,f=Array(this.rowCount-this.columnHeaderLevelCount).fill(g);this._rowHeaderCellFullPathIds_FULL.unshift(f);const p={id:g,title:typeof this.rowHeaderTitle.title=="string"?this.rowHeaderTitle.title:this.rowsDefine.reduce((m,b)=>typeof b=="string"?m:m+(m?`/${b.title}`:`${b.title}`),""),field:void 0,headerType:(o=(n=this.rowHeaderTitle)===null||n===void 0?void 0:n.headerType)!==null&&o!==void 0?o:"text",style:(r=this.rowHeaderTitle)===null||r===void 0?void 0:r.headerStyle,define:{field:"",headerType:"text",cellType:"text",disableHeaderHover:!!(!((s=this.rowHeaderTitle)===null||s===void 0)&&s.disableHeaderHover),disableHeaderSelect:!!(!((l=this.rowHeaderTitle)===null||l===void 0)&&l.disableHeaderSelect)}};this.rowHeaderObjs.push(p),this._headerObjects[g]=p}this._rowHeaderCellFullPathIds_FULL=im(this._rowHeaderCellFullPathIds_FULL),this.rowHierarchyType==="tree"&&((a=this.extensionRows)===null||a===void 0?void 0:a.length)>=1&&this.generateExtensionRowTree(),this.colIndex=0,this._headerObjectMap=this._headerObjects.reduce((g,f)=>(g[f.id]=f,g),{}),this._CellHeaderPathMap=new Map,this._largeCellRangeCache.length=0;const c=D9(t,e,h.map(g=>g[t-this.leftRowSeriesNumberColumnCount]),this._rowHeaderCellFullPathIds_FULL.map(g=>g[t-this.leftRowSeriesNumberColumnCount]),d,this);return this.generateCellIdsConsiderHideHeader(),this.setPagination(this.pagination),c}isHeaderForColWidth(t,e){return this.isHeader(t,e)}getHeaderForColWidth(t,e){return this.getHeader(t,e)}getPivotCellAdress(t){var e;if(!Array.isArray(t))return;let n,o,r=this.rowTree,s=this.columnTree;for(let h=0;h<t.length;h++){const d=t[h];if((d.isPivotCorner||!z(d.value))&&h===t.length-1){if(((e=this==null?void 0:this.cornerSetting)===null||e===void 0?void 0:e.titleOnDimension)==="row"){let g=0;return this.rowHierarchyType==="grid"&&(g=this.rowDimensionKeys.indexOf(d.dimensionKey)),g===-1?void 0:{col:(this.rowHeaderTitle?g+1:g)+this.leftRowSeriesNumberColumnCount,row:0}}const c=this.colDimensionKeys.indexOf(d.dimensionKey);return c===-1?void 0:{col:0+this.leftRowSeriesNumberColumnCount,row:this.columnHeaderTitle?c+1:c}}let u=!1;for(let c=0;c<s.length;c++){const g=s[c];if((z(d.dimensionKey)&&g.dimensionKey===d.dimensionKey||z(d.indicatorKey)&&g.indicatorKey===d.indicatorKey)&&g.value===d.value){s=g.children,o=g,u=!0;break}}if(!u)for(let c=0;c<r.length;c++){const g=r[c];if((z(d.dimensionKey)&&g.dimensionKey===d.dimensionKey||z(d.indicatorKey)&&g.indicatorKey===d.indicatorKey)&&g.value===d.value){r=g.children,n=g;break}}}let l=0,a=0;if(n){a=this.columnHeaderLevelCount;const{startInTotal:h,level:d}=n;return a+=h,l=this.rowHierarchyType==="grid"?(this.rowHeaderTitle?d+1:d)+this.leftRowSeriesNumberColumnCount:0+this.leftRowSeriesNumberColumnCount,{col:l,row:a}}if(o){l=this.rowHeaderLevelCount+this.leftRowSeriesNumberColumnCount;const{startInTotal:h,level:d}=o;return l+=h,a=this.columnHeaderTitle?d+1:d,{col:l,row:a}}}getPivotDimensionInfo(t,e){var n;const{colHeaderPaths:o,rowHeaderPaths:r}=this.getCellHeaderPaths(t,e),s=[];return o.length?o.forEach((l,a)=>{s.push({dimensionKey:l.dimensionKey,value:l.value,isPivotCorner:!1,indicatorKey:l.indicatorKey})}):r.length?r.forEach((l,a)=>{s.push({dimensionKey:l.dimensionKey,value:l.value,isPivotCorner:!1,indicatorKey:l.indicatorKey})}):this.isCornerHeader(t,e)&&(((n=this==null?void 0:this.cornerSetting)===null||n===void 0?void 0:n.titleOnDimension)==="row"?s.push({dimensionKey:this.rowDimensionKeys[(this.rowHeaderTitle?t-1:t)-this.leftRowSeriesNumberColumnCount],isPivotCorner:!0}):s.push({dimensionKey:this.colDimensionKeys[this.columnHeaderTitle?e-1:e],isPivotCorner:!0})),s}getIndicatorKey(t,e){var n;return(n=this.getBody(t,e))===null||n===void 0?void 0:n.indicatorKey}getParentCellId(t,e){if(e!==0)return this.isColumnHeader(t,e)?this.getCellId(t,e-1):this.isRowHeader(t,e)?this.getCellId(t-1,e):void 0}getRowHeaderCellAddressByCellId(t){let e,n;if(this._rowHeaderCellIds.find((o,r)=>!!o.find((s,l)=>s===t&&(e=l,!0))&&(n=r,!0)),z(e)&&z(n))return{col:e,row:n+this.columnHeaderLevelCount}}canMoveHeaderPosition(t,e){if(this.isSeriesNumberInHeader(e.col,e.row)||this.isSeriesNumberInHeader(t.col,t.row)||this.isCornerHeader(e.col,e.row)||t.col<0||t.row<0||e.col<0||e.row<0)return!1;this.isSeriesNumberInBody(e.col,e.row)&&this.isSeriesNumberInBody(t.col,t.row)&&(t.col=t.col+this.leftRowSeriesNumberColumnCount+this.rowHeaderLevelCount-1,e.col=e.col+this.leftRowSeriesNumberColumnCount+this.rowHeaderLevelCount-1);const n=this.getCellRange(t.col,t.row);if(this.isColumnHeader(t.col,t.row))return this.getParentCellId(t.col,n.start.row)===this.getParentCellId(e.col,n.start.row);if(this.isRowHeader(t.col,t.row)){if(this.rowHierarchyType!=="tree")return this.getParentCellId(n.start.col,t.row)===this.getParentCellId(n.start.col,e.row);{const o=Ee(this.getCellHeaderPathsWithTreeNode(t.col,t.row).rowHeaderPaths),r=Ee(this.getCellHeaderPathsWithTreeNode(e.col,e.row).rowHeaderPaths);if(o.pop(),r.pop(),o.length<=r.length){if(o.length===r.length)return!o.find((s,l)=>s.dimensionKey!==r[l].dimensionKey||s.value!==r[l].value);if(o.length>0){for(let s=0;s<o.length;s++)if(o[s].startInTotal!==r[s].startInTotal)return!1}return!0}}}return!1}moveHeaderPosition(t,e){if(this.canMoveHeaderPosition(t,e)&&!this.isCellRangeEqual(t.col,t.row,e.col,e.row)){const n=this.getCellRange(t.col,t.row);if(this.isColumnHeader(t.col,t.row)){const o=n.end.col-n.start.col+1;let r;const s=this.getCellRange(e.col,n.start.row);if(r=e.col>=t.col?s.end.col-o+1:s.start.col,r===n.start.col)return null;for(let a=0;a<this._columnHeaderCellFullPathIds.length;a++){const h=this._columnHeaderCellFullPathIds[a].splice(n.start.col-this.rowHeaderLevelCount-this.leftRowSeriesNumberColumnCount,o);h.unshift(r-this.rowHeaderLevelCount-this.leftRowSeriesNumberColumnCount,0),Array.prototype.splice.apply(this._columnHeaderCellFullPathIds[a],h)}const l=this._columnWidths.splice(n.start.col-this.leftRowSeriesNumberColumnCount,o);return l.unshift(r-this.leftRowSeriesNumberColumnCount,0),Array.prototype.splice.apply(this._columnWidths,l),this.columnDimensionTree.movePosition(this.getCellHeaderPathsWithTreeNode(t.col,t.row).colHeaderPaths.length-1,n.start.col-this.rowHeaderLevelCount-this.leftRowSeriesNumberColumnCount,s.start.col-this.rowHeaderLevelCount-this.leftRowSeriesNumberColumnCount),this.columnDimensionTree.reset(this.columnDimensionTree.tree.children,!0),this._CellHeaderPathMap=new Map,this._largeCellRangeCache.length=0,{sourceIndex:n.start.col,targetIndex:r,sourceSize:o,targetSize:s.end.col-s.start.col+1,moveType:"column"}}if(this.isRowHeader(t.col,t.row)){let o;const r=this.getCellHeaderPathsWithTreeNode(t.col,t.row).rowHeaderPaths,s=this.getCellHeaderPathsWithTreeNode(e.col,e.row).rowHeaderPaths,l=r[r.length-1],a=s[r.length-1],h=l.size;if(o=e.row>=t.row?a.startInTotal+a.size-h:a.startInTotal,o===n.start.row-this.columnHeaderLevelCount)return null;const d=this._rowHeaderCellIds.splice(n.start.row-this.columnHeaderLevelCount,h);d.unshift(o-this.currentPageStartIndex,0),Array.prototype.splice.apply(this._rowHeaderCellIds,d);const u=this._rowHeaderCellFullPathIds.splice(n.start.row-this.columnHeaderLevelCount,h);u.unshift(o-this.currentPageStartIndex,0),Array.prototype.splice.apply(this._rowHeaderCellFullPathIds,u);const c=this._rowHeaderCellIds_FULL.splice(n.start.row-this.columnHeaderLevelCount+this.currentPageStartIndex,h);c.unshift(o,0),Array.prototype.splice.apply(this._rowHeaderCellIds_FULL,c);const g=this._rowHeaderCellFullPathIds_FULL.splice(n.start.row-this.columnHeaderLevelCount+this.currentPageStartIndex,h);return g.unshift(o,0),Array.prototype.splice.apply(this._rowHeaderCellFullPathIds_FULL,g),this.rowDimensionTree.movePosition(r.length-1,n.start.row-this.columnHeaderLevelCount,o+(e.row>t.row?l.size-1:0)),this.rowDimensionTree.reset(this.rowDimensionTree.tree.children,!0),this._CellHeaderPathMap=new Map,this._largeCellRangeCache.length=0,{sourceIndex:n.start.row,targetIndex:o+this.columnHeaderLevelCount,sourceSize:h,targetSize:a.size,moveType:"row"}}}return null}getCellAdressByHeaderPath(t){var e,n,o,r,s,l;let a,h,d=!1,u=!1;if(Array.isArray(t)){if(t.length>this.rowDimensionKeys.length+this.colDimensionKeys.length)return;a=t.filter(y=>this.colDimensionKeys.indexOf(y.dimensionKey)>=0||this.colDimensionKeys.indexOf(this.indicatorDimensionKey)>=0&&y.indicatorKey),h=t.filter(y=>this.rowDimensionKeys.indexOf(y.dimensionKey)>=0||this.rowDimensionKeys.indexOf(this.indicatorDimensionKey)>=0&&y.indicatorKey)}else a=t.colHeaderPaths,h=t.rowHeaderPaths,(t==null?void 0:t.cellLocation)==="body"&&this._table.isPivotTable()&&(u=!0);if(!Array.isArray(a)&&!Array.isArray(h))return;if(a==null||a.sort((y,S)=>{var A,R;return this.colDimensionKeys.indexOf((A=y.dimensionKey)!==null&&A!==void 0?A:this.indicatorDimensionKey)-this.colDimensionKeys.indexOf((R=S.dimensionKey)!==null&&R!==void 0?R:this.indicatorDimensionKey)}),h==null||h.sort((y,S)=>{var A,R;return this.fullRowDimensionKeys.indexOf((A=y.dimensionKey)!==null&&A!==void 0?A:this.indicatorDimensionKey)-this.fullRowDimensionKeys.indexOf((R=S.dimensionKey)!==null&&R!==void 0?R:this.indicatorDimensionKey)}),a==null||a.forEach(y=>{y.isPivotCorner&&(d=!0)}),h==null||h.forEach(y=>{y.isPivotCorner&&(d=!0)}),d){if(this.cornerSetting.titleOnDimension==="all"&&this.indicatorsAsCol&&a.length===0){for(let y=0;y<this.rowDimensionKeys.length;y++)if(((e=h[0])===null||e===void 0?void 0:e.dimensionKey)===this.rowDimensionKeys[y])return{col:y+this.leftRowSeriesNumberColumnCount,row:this.columnHeaderLevelCount-1}}else if(this.cornerSetting.titleOnDimension!=="all"||this.indicatorsAsCol||h.length!==0){if(this.cornerSetting.titleOnDimension==="row"||this.cornerSetting.titleOnDimension==="all"&&!this.indicatorsAsCol){for(let y=0;y<this.rowDimensionKeys.length;y++)if(((o=h[0])===null||o===void 0?void 0:o.dimensionKey)===this.rowDimensionKeys[y])return{col:y+this.leftRowSeriesNumberColumnCount,row:0}}else for(let y=0;y<this.colDimensionKeys.length;y++)if(((r=a[0])===null||r===void 0?void 0:r.dimensionKey)===this.colDimensionKeys[y])return{col:0,row:y}}else for(let y=0;y<this.colDimensionKeys.length;y++)if(((n=a[0])===null||n===void 0?void 0:n.dimensionKey)===this.colDimensionKeys[y])return{col:this.rowHeaderLevelCount-1,row:y}}let c,g,f,p,m=!1;(a==null?void 0:a.length)>=1&&(h==null?void 0:h.length)>=1&&(m=!0);let b,C,_=this.rowTree,w=this.columnTree;if(a)for(let y=0;y<a.length;y++){const S=a[y];for(let A=0;A<w.length;A++){const R=w[A];if(!z(S.indicatorKey)&&R.dimensionKey===S.dimensionKey&&R.value===S.value||z(S.indicatorKey)&&R.indicatorKey===S.indicatorKey){w=R.children,m&&!w?C=R:m||(C=R);break}}}if((h==null?void 0:h.length)>=1)if(this.rowHierarchyType==="tree"){const y=h[h.length-1],S=this.headerObjects.filter(R=>((R==null?void 0:R.field)===y.dimensionKey||(R==null?void 0:R.field)===y.indicatorKey)&&(R==null?void 0:R.title)===y.value).map(R=>R.id),A=this._rowHeaderCellIds.filter(R=>S.indexOf(R[R.length-1])>=0).find(R=>{const x=this.findFullCellIds(R);return x.length===h.length&&x.every(T=>{const M=this._headerObjectMap[T];return h.find(B=>B.dimensionKey===M.field&&B.value===M.title)})});g=this._rowHeaderCellIds.indexOf(A)+this.columnHeaderLevelCount}else for(let y=0;y<h.length;y++){const S=h[y];for(let A=0;A<_.length;A++){const R=_[A];if(!z(S.indicatorKey)&&R.dimensionKey===S.dimensionKey&&R.value===S.value||z(S.indicatorKey)&&R.indicatorKey===S.indicatorKey&&(!z(S.value)||R.value===S.value)){_=R.children,(!m||_&&!_.some(x=>x.dimensionKey==="axis"))&&m||(b=R);break}}}if(u||!m||(b||z(g))&&C){if(b||u){g=this.columnHeaderLevelCount;const{startInTotal:y,level:S}=(s=b)!==null&&s!==void 0?s:RT;g+=y??0,f=this.rowHierarchyType==="grid"?(this.rowHeaderTitle?S+1:S)+this.leftRowSeriesNumberColumnCount:0}if(C||u){c=this.rowHeaderLevelCount+this.leftRowSeriesNumberColumnCount;const{startInTotal:y,level:S}=(l=C)!==null&&l!==void 0?l:RT;c+=y??0,p=this.columnHeaderTitle?S+1:S}return z(c)||z(g)?{col:c??f,row:g??p}:void 0}}setChartInstance(t,e,n){var o,r,s,l;const a=this.getCellHeaderPaths(t,e);let h;if(this.indicatorsAsCol){const d=(o=a.colHeaderPaths.find(u=>u.indicatorKey))===null||o===void 0?void 0:o.indicatorKey;h=(r=this._indicators)===null||r===void 0?void 0:r.find(u=>u.indicatorKey===d)}else{const d=(s=a.rowHeaderPaths.find(u=>u.indicatorKey))===null||s===void 0?void 0:s.indicatorKey;h=(l=this._indicators)===null||l===void 0?void 0:l.find(u=>u.indicatorKey===d)}typeof(h==null?void 0:h.chartSpec)!="function"&&h&&(h.chartInstance=n)}getChartInstance(t,e){var n,o,r,s;const l=this.getCellHeaderPaths(t,e);let a;if(this.indicatorsAsCol){const h=(n=l.colHeaderPaths.find(d=>d.indicatorKey))===null||n===void 0?void 0:n.indicatorKey;a=(o=this._indicators)===null||o===void 0?void 0:o.find(d=>d.indicatorKey===h)}else{const h=(r=l.rowHeaderPaths.find(d=>d.indicatorKey))===null||r===void 0?void 0:r.indicatorKey;a=(s=this._indicators)===null||s===void 0?void 0:s.find(d=>d.indicatorKey===h)}return a==null?void 0:a.chartInstance}checkHasChart(){return uT(this)}getDimension(t,e){var n,o;return e==="column"?(n=this.columnsDefine)===null||n===void 0?void 0:n.find(r=>typeof r!="string"&&r.dimensionKey===t):e==="row"?(o=this.rowsDefine)===null||o===void 0?void 0:o.find(r=>typeof r!="string"&&r.dimensionKey===t):void 0}getAxisConfigInPivotChart(t,e){if((this.isFrozenColumn(t,e)||this.isRightFrozenColumn(t,e))&&Hl(t,e,"row",this)||(this.isFrozenRow(t,e)||this.isBottomFrozenRow(t,e))&&Hl(t,e,"col",this))return Bt.getFunction("getAxisConfigInPivotChart")(t,e,this)}isEmpty(t,e){return!!this._table.isPivotChart()&&(!!this.isLeftBottomCorner(t,e)||!!this.isRightBottomCorner(t,e)||!!this.isRightTopCorner(t,e))}isAxisCell(t,e){return this._table.isPivotChart()?!!(this.indicatorKeys.length>=1&&Lh(this.indicatorsDefine)&&(this.isBottomFrozenRow(t,e)&&Hl(t,e,"col",this)||this.isRightFrozenColumn(t,e)&&Hl(t,e,"row",this)||this.isRowHeader(t,e)&&t===this.rowHeaderLevelCount-1&&Hl(t,e,"row",this)||this.hasTwoIndicatorAxes&&this.indicatorsAsCol&&e===this.columnHeaderLevelCount-1&&Hl(t,e,"col",this))):!1}getChartAxes(t,e){if(pV(t,e,this)||this.isAxisCell(t,e))return vV(t,e,this)}getRawChartSpec(t,e){return cV(t,e,this)}getChartSpec(t,e){return mV(t,e,this)}isShareChartSpec(t,e){return gV(t,e,this)}getChartDataId(t,e){return dT(t,e,this)}isNoChartDataRenderNothing(t,e){return fV(t,e,this)}setPagination(t){var e,n,o,r,s,l,a;if(this.clearCellRangeMap(),this._table.internalProps.useOneRowHeightFillAll=!1,this.pagination=t,this.rowHierarchyType==="grid"&&z((e=this.pagination)===null||e===void 0?void 0:e.perPageCount)&&z((n=this.pagination)===null||n===void 0?void 0:n.currentPage)){this.indicatorsAsCol===!1&&(this.pagination.perPageCount=Math.ceil(this.pagination.perPageCount/this.indicatorKeys.length)*this.indicatorKeys.length);const{perPageCount:h,currentPage:d}=this.pagination;this.currentPageStartIndex=h*(d||0),this.currentPageEndIndex=this.currentPageStartIndex+h,this._rowHeaderCellIds=(o=this._rowHeaderCellIds_FULL)===null||o===void 0?void 0:o.slice(this.currentPageStartIndex,this.currentPageEndIndex),this._rowHeaderCellFullPathIds=(r=this._rowHeaderCellFullPathIds_FULL)===null||r===void 0?void 0:r.slice(this.currentPageStartIndex,this.currentPageEndIndex)}else this.currentPageStartIndex=0,this.currentPageEndIndex=this._rowHeaderCellIds_FULL.length,this._rowHeaderCellIds=(s=this._rowHeaderCellIds_FULL)===null||s===void 0?void 0:s.slice(this.currentPageStartIndex,this.currentPageEndIndex),this._rowHeaderCellFullPathIds=(l=this._rowHeaderCellFullPathIds_FULL)===null||l===void 0?void 0:l.slice(this.currentPageStartIndex,this.currentPageEndIndex);this.pagination&&(this.pagination.totalCount=(a=this._rowHeaderCellIds_FULL)===null||a===void 0?void 0:a.length)}release(){var t;const e=this._table._getActiveChartInstance();e==null||e.release(),(t=this._indicators)===null||t===void 0||t.forEach(n=>{var o;(o=n.chartInstance)===null||o===void 0||o.release()})}getHeadNode(t,e){var n,o,r;let s;const l=this.getCellHeaderPaths(t,e);return l.rowHeaderPaths&&((o=(n=l.rowHeaderPaths)===null||n===void 0?void 0:n.length)!==null&&o!==void 0?o:0)>0?s=(r=l.rowHeaderPaths)===null||r===void 0?void 0:r.slice(0,l.rowHeaderPaths.length):l.colHeaderPaths&&l.colHeaderPaths.length>0&&(s=l.colHeaderPaths.slice(0,l.colHeaderPaths.length)),this.getHeadNodeByRowOrColDimensions(s,t,e)}getHeadNodeByRowOrColDimensions(t,e,n){var o;if(!Array.isArray(t))return;let r,s,l=this.rowTree,a=this.columnTree;if(z(n)&&z(e)&&this.rowHierarchyType==="tree"&&this.extensionRows&&e>=1+this.leftRowSeriesNumberColumnCount){const h=this.getCellId(e-1,n);l=this._rowHeaderExtensionTree[h].tree.children}for(let h=0;h<t.length;h++){const d=t[h];if((d.isPivotCorner||!z(d.value))&&h===t.length-1)return;let u=!1;for(let c=0;c<a.length;c++){const g=a[c];if(z(d.dimensionKey)&&g.dimensionKey===d.dimensionKey&&g.value===d.value||z(d.indicatorKey)&&g.indicatorKey===d.indicatorKey&&(g.value===d.value||!z(d.value)||!z(g.value))){a=g.children,s=g,u=!0;break}}if(!u)for(let c=0;(o=c<(l==null?void 0:l.length))!==null&&o!==void 0&&o;c++){const g=l[c];if(z(d.dimensionKey)&&g.dimensionKey===d.dimensionKey&&g.value===d.value||z(d.indicatorKey)&&g.indicatorKey===d.indicatorKey&&(g.value===d.value||!z(d.value)||!z(g.value))){l=g.children,r=g;break}}}return r||s||void 0}clearCellRangeMap(){this._largeCellRangeCache.length=0,this._CellHeaderPathMap=new Map}getDimensionKeyInChartSpec(t,e){var n,o,r,s,l,a;let h;if(this.indicatorsAsCol===!1)for(let d=0;d<this.indicatorsDefine.length;d++){const u=this.indicatorsDefine[d].chartSpec;if(u&&(h=(n=u.xField)!==null&&n!==void 0?n:(r=(o=u==null?void 0:u.series)===null||o===void 0?void 0:o[0])===null||r===void 0?void 0:r.xField,h))return h}else for(let d=0;d<this.indicatorsDefine.length;d++){const u=this.indicatorsDefine[d].chartSpec;if(u&&(h=(s=u.yField)!==null&&s!==void 0?s:(a=(l=u==null?void 0:u.series)===null||l===void 0?void 0:l[0])===null||a===void 0?void 0:a.yField,h))return h}return null}_generateChartState(){return{vtable_selected:{filter:t=>{var e;return this._table._selectedDataItemsInChart.length>=1?!!this._table._selectedDataItemsInChart.find(n=>{for(const o in n)if(typeof n[o]!="object"&&n[o]!==t[o])return!1;return!0}):!((e=this._table._selectedDimensionInChart)===null||e===void 0)&&e.length?!!this._table._selectedDimensionInChart.every(n=>typeof n.value=="object"||t[n.key]===n.value):!1}},vtable_selected_reverse:{filter:t=>{var e;return this._table._selectedDataItemsInChart.length>=1?!this._table._selectedDataItemsInChart.find(n=>{for(const o in n)if(typeof n[o]!="object"&&n[o]!==t[o])return!1;return!0}):!((e=this._table._selectedDimensionInChart)===null||e===void 0)&&e.length?!this._table._selectedDimensionInChart.every(n=>typeof n.value=="object"||t[n.key]===n.value):!1}}}}updateDataStateToChartInstance(t){var e;if(((e=t==null?void 0:t.getSpec().select)===null||e===void 0?void 0:e.enable)!==!1){t||(t=this._table._getActiveChartInstance());const n=this._generateChartState();this._indicators.forEach(o=>{var r;const s=o.chartInstance;((r=o.chartSpec.select)===null||r===void 0?void 0:r.enable)!==!1&&s.updateState(n)}),t==null||t.updateState(n)}}updateDataStateToActiveChartInstance(t){var e;if(((e=t==null?void 0:t.getSpec().select)===null||e===void 0?void 0:e.enable)!==!1){t||(t=this._table._getActiveChartInstance());const n=this._generateChartState();t==null||t.updateState(n)}}getIndicatorKeyInChartSpec(t,e){const n=this.getRawChartSpec(t,e),o=[];if(n){if(n.series||n.xField||n.yField)return this.indicatorsAsCol===!1?n.series?n.series.forEach(r=>{const s=r.yField;o.push(s)}):o.push(n.yField):n.series?n.series.forEach(r=>{const s=r.xField;o.push(s)}):o.push(n.xField),o;if(n.valueField&&o.push(n.valueField),o.length>=1)return o}return null}getOptimunHeightForChart(t){var e,n,o,r,s;const l=this.getCellHeaderPaths(this.rowHeaderLevelCount,t).rowHeaderPaths;let a,h;for(const u in this.dataset.collectValuesBy)if(this.dataset.collectValuesBy[u].type==="yField"&&!this.dataset.collectValuesBy[u].range){a=(e=this.dataset.collectedValues[u])===null||e===void 0?void 0:e[l.map(c=>c.value).join(this.dataset.stringJoinChar)];break}if(this._chartItemBandSize)h=AT((n=a==null?void 0:a.length)!==null&&n!==void 0?n:0,this._chartItemBandSize,this._chartPaddingInner,this._chartPaddingOuter);else{const u=this._chartItemSpanSize||25;h=((o=a==null?void 0:a.length)!==null&&o!==void 0?o:0)*(u+u/3)}const d=Qt((s=(r=this._chartPadding)!==null&&r!==void 0?r:this._table.theme.bodyStyle.padding)!==null&&s!==void 0?s:0);return h+d[0]+d[2]}getOptimunWidthForChart(t){var e,n,o,r,s;const l=this.getCellHeaderPaths(t,this.columnHeaderLevelCount).colHeaderPaths;let a,h;for(const u in this.dataset.collectValuesBy)if(this.dataset.collectValuesBy[u].type==="xField"&&!this.dataset.collectValuesBy[u].range){a=(e=this.dataset.collectedValues[u])===null||e===void 0?void 0:e[l.map(c=>c.value).join(this.dataset.stringJoinChar)];break}if(this._chartItemBandSize)h=AT((n=a==null?void 0:a.length)!==null&&n!==void 0?n:0,this._chartItemBandSize,this._chartPaddingInner,this._chartPaddingOuter);else{const u=this._chartItemSpanSize||25;h=((o=a==null?void 0:a.length)!==null&&o!==void 0?o:0)*(u+u/3)}const d=Qt((s=(r=this._chartPadding)!==null&&r!==void 0?r:this._table.theme.bodyStyle.padding)!==null&&s!==void 0?s:0);return h+d[1]+d[3]}get leftAxesCount(){if(!this._table.isPivotChart())return 0;const t=this._table.pivotChartAxes.find(e=>e.orient==="left");return(t==null?void 0:t.visible)===!1?0:(this.indicatorsAsCol,1)}get topAxesCount(){if(!this._table.isPivotChart())return 0;const t=this._table.pivotChartAxes.find(e=>e.orient==="top");return(t==null?void 0:t.visible)===!1?0:this.indicatorsAsCol&&this.hasTwoIndicatorAxes?1:0}get rightAxesCount(){return this.rightFrozenColCount}get bottomAxesCount(){return this.bottomFrozenRowCount}getColKeysPath(t,e){const n=this.getCellHeaderPaths(t,e),o=[];return n.colHeaderPaths.length&&n.colHeaderPaths.forEach(r=>{r.dimensionKey&&o.push(r.value)}),o==null?void 0:o.join(this.dataset.stringJoinChar)}getRowKeysPath(t,e){const n=this.getCellHeaderPaths(t,e),o=[];return n.rowHeaderPaths.length&&n.rowHeaderPaths.forEach(r=>{r.dimensionKey&&o.push(r.value)}),o==null?void 0:o.join(this.dataset.stringJoinChar)}getIndicatorInfo(t,e=""){var n;return(n=this.indicatorsDefine)===null||n===void 0?void 0:n.find(o=>typeof o!="string"&&(t?o.indicatorKey===t:!!e&&o.title===e))}getLayoutColumnTree(){const t=[],e=this.columnDimensionTree.tree.children;return ov(t,e),t}getLayoutRowTree(){const t=[],e=this.rowDimensionTree.tree.children;return ov(t,e),t}getLayoutColumnTreeCount(){const t=this.columnDimensionTree.tree.children;return bg(t,this.rowHierarchyType==="tree")}getLayoutRowTreeCount(){var t;const e=this.rowDimensionTree.tree.children;let n=bg(e,this.rowHierarchyType==="tree");return(t=this.extensionRows)===null||t===void 0||t.forEach(o=>{if(typeof o.rowTree!="function"){const r=bg(o.rowTree,!0);n*=r}}),n}resetHeaderTree(){var t,e,n;this.colIndex=0,this._rowHeaderCellFullPathIds_FULL=[],this._columnHeaderCellFullPathIds=[],this._columnHeaderCellIds=[];const o=this.dataset;this.rowTree=o.rowHeaderTree,this.columnTree=o.colHeaderTree;const r=this.rowDimensionTree.tree.children;(t=this.rowTree)===null||t===void 0||t.forEach((s,l)=>{const a=r.find(h=>h.dimensionKey===s.dimensionKey&&h.value===s.value);a&&this._table._syncHierarchyState(a,s)}),this.columnDimensionTree=new Pe((e=this.columnTree)!==null&&e!==void 0?e:[],this.sharedVar),this.rowDimensionTree=new Pe((n=this.rowTree)!==null&&n!==void 0?n:[],this.sharedVar,this.rowHierarchyType,this.rowHierarchyType==="tree"?this.rowExpandLevel:void 0),this.resetColumnHeaderLevelCount(),this._generateColHeaderIds(),this.colIndex=0,this._generateRowHeaderIds(),this._rowHeaderCellFullPathIds_FULL=im(this._rowHeaderCellFullPathIds_FULL),this._headerObjectMap=this._headerObjects.reduce((s,l)=>(s[l.id]=l,s),{}),this._CellHeaderPathMap=new Map,this._largeCellRangeCache.length=0,this.generateCellIdsConsiderHideHeader(),this.setPagination(this.pagination)}isSeriesNumberInHeader(t,e){return this.leftRowSeriesNumberColumnCount>0&&t>=0&&e>=0&&t<this.leftRowSeriesNumberColumnCount&&e<this.headerLevelCount||this.rightRowSeriesNumberColumnCount>0&&e>=0&&t>=this.colCount-this.rightRowSeriesNumberColumnCount&&e<this.headerLevelCount}isSeriesNumberInBody(t,e){return this.leftRowSeriesNumberColumnCount>0&&t>=0&&t<this.leftRowSeriesNumberColumnCount&&e>=this.headerLevelCount||this.rightRowSeriesNumberColumnCount>0&&t>=this.colCount-this.rightRowSeriesNumberColumnCount&&e>=this.headerLevelCount}isSeriesNumber(t,e){return!!(z(t)&&z(e)&&(this.leftRowSeriesNumberColumnCount>0&&t>=0&&e>=0&&t<this.leftRowSeriesNumberColumnCount||this.rightRowSeriesNumberColumnCount>0&&e>=0&&t>=this.colCount-this.rightRowSeriesNumberColumnCount))}getSeriesNumberHeader(t,e){return this.leftRowSeriesNumberColumnCount>0&&t>=0&&t<this.leftRowSeriesNumberColumnCount&&e<this.headerLevelCount?Object.assign({},this.leftRowSeriesNumberColumn[t],{style:this._table.internalProps.rowSeriesNumber.headerStyle}):this.rightRowSeriesNumberColumnCount>0&&t>=this.colCount-this.rightRowSeriesNumberColumnCount&&e<this.headerLevelCount&&e<this.headerLevelCount?this.rightRowSeriesNumberColumn[t-(this.colCount-this.rightRowSeriesNumberColumnCount)]:void 0}getSeriesNumberBody(t,e){return this.leftRowSeriesNumberColumnCount>0&&t>=0&&t<this.leftRowSeriesNumberColumnCount&&e>=this.headerLevelCount?this.leftRowSeriesNumberColumn[t]:this.rightRowSeriesNumberColumnCount>0&&t>=this.colCount-this.rightRowSeriesNumberColumnCount&&e>=this.headerLevelCount?this.rightRowSeriesNumberColumn[t-(this.colCount-this.rightRowSeriesNumberColumnCount)]:void 0}changeTreeNodeTitle(t,e,n){this.getHeadNode(t,e).value=n;const o=this.getCellId(t,e);this._headerObjectMap[o].title=n}changeCornerTitle(t,e,n){if(this.isCornerHeader(t,e)){const o=this.getCellId(t,e);this._headerObjectMap[o].title=n}}generateCellIdsConsiderHideHeader(){if(this._columnHeaderCellIds=this._columnHeaderCellFullPathIds.slice(),!this.showColumnHeader)if(this.indicatorsAsCol&&!this.hideIndicatorName){const t=this.colDimensionKeys.indexOf(Xi),e=this._columnHeaderCellIds.splice(t,1);this._columnHeaderCellIds.splice(0,this._columnHeaderCellIds.length),this._columnHeaderCellIds.push(e[0])}else this._columnHeaderCellIds.splice(0,this._columnHeaderCellIds.length);if(this._rowHeaderCellIds_FULL=this._rowHeaderCellFullPathIds_FULL.slice(),!this.showRowHeader)if(this.indicatorsAsCol||this.hideIndicatorName)this._rowHeaderCellIds_FULL.forEach((t,e)=>{const n=t.slice();n.splice(0,n.length),this._rowHeaderCellIds_FULL[e]=n});else{const t=this.rowDimensionKeys.indexOf(Xi);this._rowHeaderCellIds_FULL.forEach((e,n)=>{const o=e.slice(),r=o.splice(t,1);o.splice(0,o.length),o.push(r[0]),this._rowHeaderCellIds_FULL[n]=o})}if(this._rowHeaderCellIds=this._rowHeaderCellIds_FULL.slice(),this._cornerHeaderCellIds=this._cornerHeaderCellFullPathIds.slice(),this.rowHeaderLevelCount===0||this.columnHeaderLevelCount===0)this._cornerHeaderCellIds=[];else if(this.cornerSetting.titleOnDimension!=="row"||this.showRowHeader){if(this.cornerSetting.titleOnDimension==="column"&&!this.showColumnHeader)if(this.indicatorsAsCol&&!this.hideIndicatorName){const t=this.colDimensionKeys.indexOf(Xi),e=this._cornerHeaderCellIds.splice(t,1);this._cornerHeaderCellIds.splice(0,this._cornerHeaderCellIds.length),this._cornerHeaderCellIds.push(e[0])}else this._cornerHeaderCellIds.splice(0,this._cornerHeaderCellIds.length)}else if(this.indicatorsAsCol||this.hideIndicatorName)this._cornerHeaderCellIds.forEach((t,e)=>{const n=t.slice();n.splice(0,n.length),this._cornerHeaderCellIds[e]=n});else{const t=this.rowDimensionKeys.indexOf(Xi);this._cornerHeaderCellIds.forEach((e,n)=>{const o=e.slice(),r=o.splice(t,1);o.splice(0,o.length),o.push(r[0]),this._cornerHeaderCellIds[n]=o})}}enableUseGetBodyCache(){this._useGetBodyCache=!0,this._getBodyCache.clear()}disableUseGetBodyCache(){this._useGetBodyCache=!1,this._getBodyCache.clear()}enableUseHeaderPathCache(){this._useHeaderPathCache=!0,this._colHeaderPathCache.clear(),this._rowHeaderPathCache.clear()}disableUseHeaderPathCache(){this._useHeaderPathCache=!1,this._colHeaderPathCache.clear(),this._rowHeaderPathCache.clear()}getBodyWidthCache(t,e){if(this._useGetBodyCache&&!this.isHeader(t,e)&&!this.isSeriesNumber(t,e))return this.indicatorsAsCol&&this._getBodyCache.has(t)?this._getBodyCache.get(t):!this.indicatorsAsCol&&this._getBodyCache.has(e)?this._getBodyCache.get(e):void 0}setBodyWidthCache(t,e,n){!this._useGetBodyCache||this.isHeader(t,e)||this.isSeriesNumber(t,e)||(this.indicatorsAsCol?this._getBodyCache.set(t,n):this._getBodyCache.set(e,n))}getColHeaderPathCache(t,e){if(this._useHeaderPathCache&&!this.isHeader(t,e)&&!this.isSeriesNumber(t,e)&&this._colHeaderPathCache.has(t))return this._colHeaderPathCache.get(t)}setColHeaderPathCache(t,e,n){!this._useHeaderPathCache||this.isHeader(t,e)||this.isSeriesNumber(t,e)||this._colHeaderPathCache.set(t,n)}getRowHeaderPathCache(t,e){if(this._useHeaderPathCache&&!this.isHeader(t,e)&&!this.isSeriesNumber(t,e)&&this._rowHeaderPathCache.has(e))return this._rowHeaderPathCache.get(e)}setRowHeaderPathCache(t,e,n){!this._useHeaderPathCache||this.isHeader(t,e)||this.isSeriesNumber(t,e)||this._rowHeaderPathCache.set(e,n)}}function AT(i,t,e,n){e===1&&(e=0);const o=O9(i,e,n),r=t/(1-e);return Math.ceil(o*r)}function O9(i,t,e){let n;return n=i===1?i+2*e:i-t+2*e,i?n>0?n:1:0}class pv{constructor(t,e){this.tree={},this.beforeChangedTree={},this.colFlatKeys={},this.rowFlatKeys={},this.stringJoinChar=String.fromCharCode(0),this.rowsIsTotal=[],this.colsIsTotal=[],this.dataConfig=t,e&&(this.records=e,typeof window<"u"&&window.performance.now(),this.setRecords(e),typeof window<"u"&&window.performance.now())}changeDataConfig(t){this.dataConfig=t}setRecords(t){this.processRecords()}processRecords(){for(let t=0,e=this.records.length;t<e;t++){const n=this.records[t];this.processRecord(n)}}processRecord(t){var e;const n=[],o=[];for(let r=0,s=this.dataConfig.rows.length;r<s;r++){const l=this.dataConfig.rows[r];t[l]!==void 0&&l!==this.dataConfig.indicatorDimensionKey&&o.push(t[l])}for(let r=0,s=this.dataConfig.columns.length;r<s;r++){const l=this.dataConfig.columns[r];t[l]!==void 0&&l!==this.dataConfig.indicatorDimensionKey&&n.push(t[l])}(e=this.dataConfig.indicators)===null||e===void 0||e.forEach(r=>{const s=t[r];s!==void 0&&(this.dataConfig.indicatorsAsCol?n.push(r):o.push(r));const l=o.join(this.stringJoinChar),a=n.join(this.stringJoinChar);o.length!==0&&(this.rowFlatKeys[l]||(this.rowFlatKeys[l]=1)),n.length!==0&&(this.colFlatKeys[a]||(this.colFlatKeys[a]=1)),n.length===0&&o.length===0||(this.tree[l]||(this.tree[l]={}),s!==void 0&&(this.tree[l][a]={value:s,record:t},this.dataConfig.indicatorsAsCol?n.pop():o.pop()))})}getTreeNode(t=[],e=[],n,o=!0){var r,s,l,a;let h,d;if(typeof t=="string")h=t;else{let u=!1;t.map((c,g)=>{c===n&&(t.splice(g,1),u=!0)}),u&&t.push(n),h=t.join(this.stringJoinChar)}if(typeof e=="string")d=e;else{let u=!1;e.map((c,g)=>{c===n&&(e.splice(g,1),u=!0)}),u&&e.push(n),d=e.join(this.stringJoinChar)}return o?(l=(s=(r=this.tree)===null||r===void 0?void 0:r[h])===null||s===void 0?void 0:s[d])!==null&&l!==void 0?l:void 0:z((a=this.beforeChangedTree[h])===null||a===void 0?void 0:a[d])?{value:this.beforeChangedTree[h][d].value,record:this.beforeChangedTree[h][d].record}:void 0}changeTreeNodeValue(t=[],e=[],n,o){var r,s,l,a,h,d,u;let c,g;if(typeof t=="string")c=t;else{let m=!1;t.map((b,C)=>{b===n&&(t.splice(C,1),m=!0)}),m&&t.push(n),c=t.join(this.stringJoinChar)}if(typeof e=="string")g=e;else{let m=!1;e.map((b,C)=>{b===n&&(e.splice(C,1),m=!0)}),m&&e.push(n),g=e.join(this.stringJoinChar)}const f=(s=(r=this.tree[c])===null||r===void 0?void 0:r[g])===null||s===void 0?void 0:s.value,p=Object.assign({},(a=(l=this.tree[c])===null||l===void 0?void 0:l[g])===null||a===void 0?void 0:a.record);!((d=(h=this.tree[c])===null||h===void 0?void 0:h[g])===null||d===void 0)&&d.record?(this.tree[c][g].record[n]=o,this.tree[c][g].value=o):(this.tree[c]||(this.tree[c]={}),this.tree[c][g]={record:this._buildRecord(t,e,n,o),value:o}),!((u=this.beforeChangedTree[c])===null||u===void 0)&&u[g]||(this.beforeChangedTree[c]={},this.beforeChangedTree[c][g]={record:void 0,value:void 0},this.beforeChangedTree[c][g].record=p,this.beforeChangedTree[c][g].value=f)}_buildRecord(t=[],e=[],n,o){const r={},s=this.dataConfig.rows,l=this.dataConfig.columns;return s.forEach((a,h)=>{a!==this.dataConfig.indicatorDimensionKey&&(r[a]=t[h])}),l.forEach((a,h)=>{a!==this.dataConfig.indicatorDimensionKey&&(r[a]=e[h])}),r[n]=o,this.records.push(r),r}addRecords(t){for(let e=0,n=t.length;e<n;e++){const o=t[e];this.processRecord(o)}this.records.push(t)}changeRecordFieldValue(t,e,n){let o=!1;for(let r=0;r<this.dataConfig.indicators.length;r++)this.dataConfig.indicators[r]===t&&(o=!0);if(!o){for(let r=0,s=this.records.length;r<s;r++){const l=this.records[r];l[t]===e&&(l[t]=n)}this.rowFlatKeys={},this.colFlatKeys={},this.tree={},this.processRecords()}}}function TT(i,t){let e="";for(let n=0;n<i.length;n++)e+=i[n],n!==i.length-1&&(e+=t);return e}class Ih{constructor(t,e,n,o,r,s,l,a,h,d,u,c,g){var f,p,m,b,C,_,w,y,S,A,R,x,T,M,B,P,F,H,E,k,I,L,D,O,N,W,$,U,Y,j,G,X,ht,gt,Ct,Q,et,vt;this.tree={},this.changedTree={},this.colFlatKeys={},this.rowFlatKeys={},this.colKeys=[],this.rowKeys=[],this.colKeys_normal=[],this.rowKeys_normal=[],this.rowOrder="key_a_to_z",this.colOrder="key_a_to_z",this.sorted=!1,this.indicatorStatistics=[],this.aggregators={},this.stringJoinChar=String.fromCharCode(0),this.rowsIsTotal=[],this.colsIsTotal=[],this.collectedValues={},this.cacheCollectedValues={},this.totalRecordsTree={},this.registerAggregators(),this.dataConfig=t,this.filterRules=(f=this.dataConfig)===null||f===void 0?void 0:f.filterRules,this.rowHierarchyType=a??"grid",this.sortRules=(p=this.dataConfig)===null||p===void 0?void 0:p.sortRules,this.aggregationRules=(m=this.dataConfig)===null||m===void 0?void 0:m.aggregationRules,this.derivedFieldRules=(b=this.dataConfig)===null||b===void 0?void 0:b.derivedFieldRules,this.mappingRules=(C=this.dataConfig)===null||C===void 0?void 0:C.mappingRules,this.calculatedFieldRules=(_=this.dataConfig)===null||_===void 0?void 0:_.calculatedFieldRules,this.calculatedFiledKeys=(y=(w=this.calculatedFieldRules)===null||w===void 0?void 0:w.map(bt=>bt.key))!==null&&y!==void 0?y:[],this.calculatedFieldDependIndicatorKeys=(A=(S=this.calculatedFieldRules)===null||S===void 0?void 0:S.reduce((bt,dt)=>{for(let ot=0;ot<dt.dependIndicatorKeys.length;ot++)bt.indexOf(dt.dependIndicatorKeys[ot])===-1&&bt.push(dt.dependIndicatorKeys[ot]);return bt},[]))!==null&&A!==void 0?A:[],this.totals=(R=this.dataConfig)===null||R===void 0?void 0:R.totals,this.rows=e,this.columns=n,this.indicatorKeys=o,this.indicatorKeysIncludeCalculatedFieldDependIndicatorKeys=[...o];for(let bt=0;bt<this.calculatedFieldDependIndicatorKeys.length;bt++)this.indicatorKeysIncludeCalculatedFieldDependIndicatorKeys.indexOf(this.calculatedFieldDependIndicatorKeys[bt])===-1&&this.indicatorKeysIncludeCalculatedFieldDependIndicatorKeys.push(this.calculatedFieldDependIndicatorKeys[bt]);if(this.indicatorsAsCol=s,this.indicators=r,this.customColTree=h,this.customRowTree=d,this.hasExtensionRowTree=c,this.parseCustomTreeToMatchRecords=g,this.parseCustomTreeToMatchRecords&&(this.customColTreeDimensionPaths=this.customTreeToDimensionPathArr(this.customColTree,"col"),this.hasExtensionRowTree||(this.customRowTreeDimensionPaths=this.customTreeToDimensionPathArr(this.customRowTree,"row"))),this.colGrandTotalLabel=(M=(T=(x=this.totals)===null||x===void 0?void 0:x.column)===null||T===void 0?void 0:T.grandTotalLabel)!==null&&M!==void 0?M:"总计",this.colSubTotalLabel=(F=(P=(B=this.totals)===null||B===void 0?void 0:B.column)===null||P===void 0?void 0:P.subTotalLabel)!==null&&F!==void 0?F:"小计",this.rowGrandTotalLabel=(k=(E=(H=this.totals)===null||H===void 0?void 0:H.row)===null||E===void 0?void 0:E.grandTotalLabel)!==null&&k!==void 0?k:"总计",this.rowSubTotalLabel=(D=(L=(I=this.totals)===null||I===void 0?void 0:I.row)===null||L===void 0?void 0:L.subTotalLabel)!==null&&D!==void 0?D:"小计",this.collectValuesBy=(O=this.dataConfig)===null||O===void 0?void 0:O.collectValuesBy,this.needSplitPositiveAndNegative=u!=null&&u,this.rowsIsTotal=new Array((W=(N=this.rows)===null||N===void 0?void 0:N.length)!==null&&W!==void 0?W:0).fill(!1),this.colsIsTotal=new Array((U=($=this.columns)===null||$===void 0?void 0:$.length)!==null&&U!==void 0?U:0).fill(!1),((Y=this.totals)===null||Y===void 0?void 0:Y.row)&&this.totals.row.showSubTotals!==!1&&this.totals.row.subTotalsDimensions)for(let bt=0,dt=(ht=(X=(G=(j=this.totals)===null||j===void 0?void 0:j.row)===null||G===void 0?void 0:G.subTotalsDimensions)===null||X===void 0?void 0:X.length)!==null&&ht!==void 0?ht:0;bt<dt;bt++){const ot=this.totals.row.subTotalsDimensions[bt],ut=this.rows.indexOf(ot);this.rowsIsTotal[ut]=!0}if(!((gt=this.totals)===null||gt===void 0)&>.column&&this.totals.column.showSubTotals!==!1&&this.totals.column.subTotalsDimensions)for(let bt=0,dt=(vt=(et=(Q=(Ct=this.totals)===null||Ct===void 0?void 0:Ct.column)===null||Q===void 0?void 0:Q.subTotalsDimensions)===null||et===void 0?void 0:et.length)!==null&&vt!==void 0?vt:0;bt<dt;bt++){const ot=this.totals.column.subTotalsDimensions[bt],ut=this.columns.indexOf(ot);this.colsIsTotal[ut]=!0}this.setRecords(l)}setRecords(t){var e,n,o,r,s,l,a,h,d,u,c,g,f,p,m,b,C,_,w;this.records=t,this.collectedValues={},this.cacheCollectedValues={},this.totalRecordsTree={},this.tree={},this.colFlatKeys={},this.rowFlatKeys={},this.colKeys=[],this.rowKeys=[],this.rowsHasValue=[],this.columnsHasValue=[],t&&(this.records=t,typeof window<"u"&&window.performance.now(),this.processRecords(),this.processCollectedValuesWithSumBy(),this.generateCollectedValuesSortRule(),this.processCollectedValuesWithSortBy(),typeof window<"u"&&window.performance.now(),typeof window<"u"&&window.performance.now(),this.totalStatistics(),typeof window<"u"&&window.performance.now(),this.rowKeys_normal=this.rowKeys.slice(),this.colKeys_normal=this.colKeys.slice(),typeof window<"u"&&window.performance.now(),this.sortKeys(),typeof window<"u"&&window.performance.now(),typeof window<"u"&&window.performance.now(),this.customRowTree?this.rowHeaderTree=this.customRowTree:this.rowHierarchyType==="tree"?this.rowHeaderTree=this.ArrToTree1(this.rowKeys,this.rows.filter((y,S)=>this.rowsHasValue[S]),this.indicatorsAsCol?void 0:this.indicators,((n=(e=this.totals)===null||e===void 0?void 0:e.row)===null||n===void 0?void 0:n.showGrandTotals)||!this.indicatorsAsCol&&this.columns.length===0||this.indicatorsAsCol&&this.rows.length===0,this.rowGrandTotalLabel):this.rowHeaderTree=this.ArrToTree(this.rowKeys,this.rows.filter((y,S)=>this.rowsHasValue[S]),this.indicatorsAsCol?void 0:this.indicators,this.rowsIsTotal,((r=(o=this.totals)===null||o===void 0?void 0:o.row)===null||r===void 0?void 0:r.showGrandTotals)||this.indicatorsAsCol&&this.rows.length===0,this.rowGrandTotalLabel,this.rowSubTotalLabel,(a=(l=(s=this.totals)===null||s===void 0?void 0:s.row)===null||l===void 0?void 0:l.showGrandTotalsOnTop)!==null&&a!==void 0&&a,(u=(d=(h=this.totals)===null||h===void 0?void 0:h.row)===null||d===void 0?void 0:d.showSubTotalsOnTop)!==null&&u!==void 0&&u),this.customColTree?this.colHeaderTree=this.customColTree:this.colHeaderTree=this.ArrToTree(this.colKeys,this.columns.filter((y,S)=>this.columnsHasValue[S]),this.indicatorsAsCol?this.indicators:void 0,this.colsIsTotal,((g=(c=this.totals)===null||c===void 0?void 0:c.column)===null||g===void 0?void 0:g.showGrandTotals)||!this.indicatorsAsCol&&this.columns.length===0,this.colGrandTotalLabel,this.colSubTotalLabel,(m=(p=(f=this.totals)===null||f===void 0?void 0:f.column)===null||p===void 0?void 0:p.showGrandTotalsOnLeft)!==null&&m!==void 0&&m,(_=(C=(b=this.totals)===null||b===void 0?void 0:b.column)===null||C===void 0?void 0:C.showSubTotalsOnLeft)!==null&&_!==void 0&&_),typeof window<"u"&&window.performance.now(),!((w=this.dataConfig)===null||w===void 0)&&w.isPivotChart&&this.cacheDeminsionCollectedValues())}registerAggregator(t,e){this.aggregators[t]=e}registerAggregators(){this.registerAggregator(zt.RECORD,Px),this.registerAggregator(zt.SUM,Ex),this.registerAggregator(zt.COUNT,Lx),this.registerAggregator(zt.MAX,Fx),this.registerAggregator(zt.MIN,Ix),this.registerAggregator(zt.AVG,kx),this.registerAggregator(zt.NONE,Hx),this.registerAggregator(zt.RECALCULATE,K4)}processCollectedValuesWithSumBy(){var t,e,n,o,r,s;for(const l in this.collectedValues)if(!((e=(t=this.collectValuesBy)===null||t===void 0?void 0:t[l])===null||e===void 0)&&e.sumBy)for(const a in this.collectedValues[l]){let h;((n=this.collectValuesBy[l])===null||n===void 0?void 0:n.extendRange)==="sum"?(h=Object.values(this.collectedValues[l][a]).reduce((g,f)=>g+f.value(),0),h+=Math.round(h/20)):(h=Object.values(this.collectedValues[l][a]).reduce((g,f)=>f.value()>g?f.value():g,Number.MIN_SAFE_INTEGER),((o=this.collectValuesBy[l])===null||o===void 0?void 0:o.extendRange)==="max"?h+=Math.round(h/20):typeof((r=this.collectValuesBy[l])===null||r===void 0?void 0:r.extendRange)=="number"&&(h=Math.max(h,(s=this.collectValuesBy[l])===null||s===void 0?void 0:s.extendRange)));const d=Object.values(this.collectedValues[l][a]).reduce((g,f)=>f.value()<g?f.value():g,Number.MAX_SAFE_INTEGER);let u,c;this.needSplitPositiveAndNegative&&(u=Object.values(this.collectedValues[l][a]).reduce((g,f)=>f.positiveValue()>g?f.positiveValue():g,Number.MIN_SAFE_INTEGER),c=Object.values(this.collectedValues[l][a]).reduce((g,f)=>f.negativeValue()<g?f.negativeValue():g,Number.MAX_SAFE_INTEGER)),this.collectedValues[l][a]={},this.collectedValues[l][a].max=h,this.collectedValues[l][a].min=d,this.needSplitPositiveAndNegative&&(this.collectedValues[l][a].positiveMax=u,this.collectedValues[l][a].negativeMin=c)}}processCollectedValuesWithSortBy(){var t,e;const n=this;for(const o in this.collectedValues)if(!((e=(t=this.collectValuesBy)===null||t===void 0?void 0:t[o])===null||e===void 0)&&e.sortBy)for(const r in this.collectedValues[o])this.collectedValues[o][r]=this.collectedValues[o][r].sort((s,l)=>{var a,h,d,u;return((h=(a=n.collectValuesBy[o].sortBy)===null||a===void 0?void 0:a.indexOf(s))!==null&&h!==void 0?h:-1)-((u=(d=n.collectValuesBy[o].sortBy)===null||d===void 0?void 0:d.indexOf(l))!==null&&u!==void 0?u:-1)})}generateCollectedValuesSortRule(){for(const t in this.collectedValues)if(this.collectValuesBy&&this.collectValuesBy[t]&&!this.collectValuesBy[t].sortBy){let e=[];for(const n in this.collectedValues[t])Array.isArray(this.collectedValues[t][n])&&(e.push(...this.collectedValues[t][n]),e=Array.from(new Set(e)));e.length>0&&(this.collectValuesBy[t].sortBy=e)}}processRecords(){var t,e;let n=!1;if(((e=(t=this.filterRules)===null||t===void 0?void 0:t.length)!==null&&e!==void 0?e:0)>=1&&(n=!0),Array.isArray(this.records)){this.filteredRecords||(this.filteredRecords=[]);for(let o=0,r=this.records.length;o<r;o++){const s=this.records[o];n&&!this.filterRecord(s)||(this.filteredRecords.push(s),this.processRecord(s))}}else{this.filteredRecords||(this.filteredRecords={});for(const o in this.records)for(let r=0,s=this.records[o].length;r<s;r++){const l=this.records[o][r];n&&!this.filterRecord(l)||(this.filteredRecords[o]||(this.filteredRecords[o]=[]),this.filteredRecords[o].push(l),this.processRecord(l,o))}}this.rowFlatKeys={},this.colFlatKeys={}}filterRecord(t){var e,n;let o=!0;if(this.filterRules)for(let r=0;r<this.filterRules.length;r++){const s=this.filterRules[r];if(s.filterKey){const l=t[s.filterKey];if(((e=s.filteredValues)===null||e===void 0?void 0:e.indexOf(l))===-1){o=!1;break}}else if(!(!((n=s.filterFunc)===null||n===void 0)&&n.call(s,t))){o=!1;break}}return o}processRecord(t,e){var n,o,r,s,l,a,h,d,u,c,g,f,p,m,b,C,_,w,y,S,A,R,x,T,M,B,P,F,H,E,k,I,L,D,O,N,W,$,U,Y,j,G,X,ht,gt,Ct,Q,et,vt,bt,dt,ot,ut,st,_t,ct,Wt,Yt,yt,mt,ie,le,Zt,_e,Oe;(n=this.derivedFieldRules)===null||n===void 0||n.forEach((Rt,Tt)=>{Rt.fieldName&&Rt.derivedFunc&&(t[Rt.fieldName]=Rt.derivedFunc(t))});for(const Rt in this.collectValuesBy)if(z(t[Rt])){this.collectedValues[Rt]||(this.collectedValues[Rt]={});const Tt=this.collectValuesBy[Rt].by.map(Nt=>t[Nt]).join(this.stringJoinChar);if(this.collectedValues[Rt][Tt]||(this.collectValuesBy[Rt].sumBy?this.collectedValues[Rt][Tt]={}:this.collectValuesBy[Rt].range?this.collectedValues[Rt][Tt]={min:Number.MAX_SAFE_INTEGER,max:Number.MIN_SAFE_INTEGER}:this.collectedValues[Rt][Tt]=[]),this.collectValuesBy[Rt].sumBy){const Nt=this.collectValuesBy[Rt].sumBy.map(te=>t[te]).join(this.stringJoinChar);this.collectedValues[Rt][Tt][Nt]||(this.collectedValues[Rt][Tt][Nt]=new this.aggregators[zt.SUM]({key:Rt,dimension:Rt,isRecord:void 0,needSplitPositiveAndNegative:this.needSplitPositiveAndNegative})),this.collectedValues[Rt][Tt][Nt].push(t)}else if(this.collectValuesBy[Rt].range){const Nt=this.collectedValues[Rt][Tt],te=Math.max(t[Rt],Nt.max),ae=Math.min(t[Rt],Nt.min);isNaN(te)||(Nt.max=te,Nt.min=ae)}else{const Nt=this.collectedValues[Rt][Tt];Nt.indexOf(t[Rt])===-1&&Nt.push(t[Rt])}}let He=!1;const Ht=[],Et=[];if(!this.parseCustomTreeToMatchRecords||!((o=this.dataConfig)===null||o===void 0)&&o.isPivotChart||!(!((r=this.customRowTree)===null||r===void 0)&&r.length)||e||this.hasExtensionRowTree){const Rt=[];Et.push({rowKey:Rt,indicatorKey:e});for(let Tt=0,Nt=this.rows.length;Tt<Nt;Tt++){const te=this.rows[Tt];if(te in t)this.rowsHasValue[Tt]=!0,Rt.push(t[te]);else if(te!==Xi){if(!((a=(l=(s=this.dataConfig)===null||s===void 0?void 0:s.totals)===null||l===void 0?void 0:l.row)===null||a===void 0)&&a.showGrandTotals&&Tt===0&&!this.rows.find(ae=>ae in t)){Rt.push(this.rowGrandTotalLabel),He=!0;break}if(!((u=(d=(h=this.dataConfig)===null||h===void 0?void 0:h.totals)===null||d===void 0?void 0:d.row)===null||u===void 0)&&u.subTotalsDimensions&&((f=(g=(c=this.dataConfig)===null||c===void 0?void 0:c.totals)===null||g===void 0?void 0:g.row)===null||f===void 0?void 0:f.subTotalsDimensions.indexOf(this.rows[Tt-1]))>=0){this.rowHierarchyType==="grid"&&Rt.push(this.rowSubTotalLabel),He=!0;break}}}}else{const Rt=this.getFieldMatchRowDimensionPaths(t);if(Rt.length>0)for(let Tt=0,Nt=Rt.length;Tt<Nt;Tt++){const te=Rt[Tt],ae=[];let Jt;for(let J=0,be=te.length;J<be;J++)z(te[J].indicatorKey)?Jt=te[J].indicatorKey:ae.push(te[J].value);Et.push({rowKey:ae,indicatorKey:Jt})}}if(!this.parseCustomTreeToMatchRecords||!((p=this.dataConfig)===null||p===void 0)&&p.isPivotChart||!(!((m=this.customColTree)===null||m===void 0)&&m.length)||e||this.hasExtensionRowTree){const Rt=[];Ht.push({colKey:Rt,indicatorKey:e});for(let Tt=0,Nt=this.columns.length;Tt<Nt;Tt++){const te=this.columns[Tt];if(te in t)this.columnsHasValue[Tt]=!0,Rt.push(t[te]);else if(te!==Xi){if(!((_=(C=(b=this.dataConfig)===null||b===void 0?void 0:b.totals)===null||C===void 0?void 0:C.column)===null||_===void 0)&&_.showGrandTotals&&Tt===0&&!this.columns.find(ae=>ae in t)){Rt.push(this.colGrandTotalLabel),He=!0;break}if(!((S=(y=(w=this.dataConfig)===null||w===void 0?void 0:w.totals)===null||y===void 0?void 0:y.column)===null||S===void 0)&&S.subTotalsDimensions&&((x=(R=(A=this.dataConfig)===null||A===void 0?void 0:A.totals)===null||R===void 0?void 0:R.column)===null||x===void 0?void 0:x.subTotalsDimensions.indexOf(this.columns[Tt-1]))>=0){Rt.push(this.colSubTotalLabel),He=!0;break}}}}else{const Rt=this.getFieldMatchColDimensionPaths(t);if(Rt.length>0)for(let Tt=0,Nt=Rt.length;Tt<Nt;Tt++){const te=Rt[Tt],ae=[];let Jt;for(let J=0,be=te.length;J<be;J++)z(te[J].indicatorKey)?Jt=te[J].indicatorKey:ae.push(te[J].value);Ht.push({colKey:ae,indicatorKey:Jt})}}for(let Rt=0;Rt<Et.length;Rt++){const Tt=Et[Rt].rowKey;let Nt;this.indicatorsAsCol||(Nt=Et[Rt].indicatorKey);for(let te=0;te<Ht.length;te++){const ae=Ht[te].colKey;this.indicatorsAsCol&&(Nt=Ht[te].indicatorKey);const Jt=Tt.join(this.stringJoinChar),J=ae.join(this.stringJoinChar);if(He){this.totalRecordsTree[Jt]||(this.totalRecordsTree[Jt]={}),this.totalRecordsTree[Jt][J]||(this.totalRecordsTree[Jt][J]=[]);const Lt=this.indicatorKeysIncludeCalculatedFieldDependIndicatorKeys;for(let Ot=0;Ot<Lt.length;Ot++)if(this.calculatedFiledKeys.indexOf(Lt[Ot])>=0){const Se=(T=this.calculatedFieldRules)===null||T===void 0?void 0:T.find(qe=>qe.key===Lt[Ot]);!((B=(M=this.totalRecordsTree[Jt])===null||M===void 0?void 0:M[J])===null||B===void 0)&&B[Ot]||(this.totalRecordsTree[Jt][J][Ot]=new this.aggregators[zt.RECALCULATE]({key:Lt[Ot],dimension:Lt[Ot],isRecord:!0,formatFun:(F=(P=this.indicators)===null||P===void 0?void 0:P.find(qe=>typeof qe!="string"&&qe.indicatorKey===Lt[Ot]))===null||F===void 0?void 0:F.format,calculateFun:Se==null?void 0:Se.calculateFun,dependAggregators:this.totalRecordsTree[Jt][J],dependIndicatorKeys:Se==null?void 0:Se.dependIndicatorKeys})),Lt[Ot]in t&&((E=(H=this.totalRecordsTree[Jt])===null||H===void 0?void 0:H[J])===null||E===void 0||E[Ot].push(t))}else{const Se=this.getAggregatorRule(Lt[Ot]);!((I=(k=this.totalRecordsTree[Jt])===null||k===void 0?void 0:k[J])===null||I===void 0)&&I[Ot]||(this.totalRecordsTree[Jt][J][Ot]=new this.aggregators[(L=Se==null?void 0:Se.aggregationType)!==null&&L!==void 0?L:zt.SUM]({key:Lt[Ot],dimension:(D=Se==null?void 0:Se.field)!==null&&D!==void 0?D:Lt[Ot],formatFun:(O=Se==null?void 0:Se.formatFun)!==null&&O!==void 0?O:(W=(N=this.indicators)===null||N===void 0?void 0:N.find(qe=>typeof qe!="string"&&qe.indicatorKey===Lt[Ot]))===null||W===void 0?void 0:W.format})),Lt[Ot]in t&&((U=($=this.totalRecordsTree[Jt])===null||$===void 0?void 0:$[J])===null||U===void 0||U[Ot].push(t))}return}Tt.length!==0&&(this.rowFlatKeys[Jt]||(this.rowKeys.push(Tt),this.rowFlatKeys[Jt]=1)),ae.length!==0&&(this.colFlatKeys[J]||(this.colKeys.push(ae),this.colFlatKeys[J]=1)),this.tree[Jt]||(this.tree[Jt]={}),!((Y=this.tree[Jt])===null||Y===void 0)&&Y[J]||(this.tree[Jt][J]=[]);const be=this.indicatorKeysIncludeCalculatedFieldDependIndicatorKeys;for(let Lt=0;Lt<be.length;Lt++)if(this.calculatedFiledKeys.indexOf(be[Lt])>=0){const Ot=(j=this.calculatedFieldRules)===null||j===void 0?void 0:j.find(Se=>Se.key===be[Lt]);!((X=(G=this.tree[Jt])===null||G===void 0?void 0:G[J])===null||X===void 0)&&X[Lt]||(this.tree[Jt][J][Lt]=new this.aggregators[zt.RECALCULATE]({key:be[Lt],dimension:be[Lt],isRecord:!0,formatFun:(gt=(ht=this.indicators)===null||ht===void 0?void 0:ht.find(Se=>typeof Se!="string"&&Se.indicatorKey===be[Lt]))===null||gt===void 0?void 0:gt.format,calculateFun:Ot==null?void 0:Ot.calculateFun,dependAggregators:this.tree[Jt][J],dependIndicatorKeys:Ot==null?void 0:Ot.dependIndicatorKeys})),(Q=(Ct=this.tree[Jt])===null||Ct===void 0?void 0:Ct[J])===null||Q===void 0||Q[Lt].push(t)}else{const Ot=this.getAggregatorRule(be[Lt]);let Se=!1;Nt?e===Nt?be[Lt]===Nt&&(Se=!0):be[Lt]===Nt&&be[Lt]in t&&(Se=!0):Ot!=null&&Ot.field?typeof(Ot==null?void 0:Ot.field)=="string"?(Ot==null?void 0:Ot.field)in t&&(Se=!0):Ot!=null&&Ot.field.find(qe=>qe in t)&&(Se=!0):be[Lt]in t&&(Se=!0),!(!((vt=(et=this.tree[Jt])===null||et===void 0?void 0:et[J])===null||vt===void 0)&&vt[Lt])&&Se&&(this.tree[Jt][J][Lt]=new this.aggregators[(bt=Ot==null?void 0:Ot.aggregationType)!==null&&bt!==void 0?bt:zt.SUM]({key:be[Lt],dimension:(dt=Ot==null?void 0:Ot.field)!==null&&dt!==void 0?dt:be[Lt],formatFun:(ot=Ot==null?void 0:Ot.formatFun)!==null&&ot!==void 0?ot:(st=(ut=this.indicators)===null||ut===void 0?void 0:ut.find(qe=>typeof qe!="string"&&qe.indicatorKey===be[Lt]))===null||st===void 0?void 0:st.format})),Se&&((ct=(_t=this.tree[Jt])===null||_t===void 0?void 0:_t[J])===null||ct===void 0||ct[Lt].push(t))}if(this.mappingRules)for(let Lt=0;Lt<this.indicatorKeys.length;Lt++){if(!this.indicatorStatistics[Lt]){const Ot=this.getAggregatorRule(this.indicatorKeys[Lt]);this.indicatorStatistics[Lt]={max:new this.aggregators[zt.MAX]({key:this.indicatorKeys[Lt],dimension:this.indicatorKeys[Lt]}),min:new this.aggregators[zt.MIN]({key:this.indicatorKeys[Lt],dimension:this.indicatorKeys[Lt]}),total:new this.aggregators[(Wt=Ot==null?void 0:Ot.aggregationType)!==null&&Wt!==void 0?Wt:zt.SUM]({key:this.indicatorKeys[Lt],dimension:(Yt=Ot==null?void 0:Ot.field)!==null&&Yt!==void 0?Yt:this.indicatorKeys[Lt],formatFun:(yt=Ot==null?void 0:Ot.formatFun)!==null&&yt!==void 0?yt:(ie=(mt=this.indicators)===null||mt===void 0?void 0:mt.find(Se=>typeof Se!="string"&&Se.indicatorKey===this.indicatorKeys[Lt]))===null||ie===void 0?void 0:ie.format})}}this.indicatorStatistics[Lt].max.push((Zt=(le=this.tree[Jt])===null||le===void 0?void 0:le[J])===null||Zt===void 0?void 0:Zt[Lt].value()),this.indicatorStatistics[Lt].min.push((Oe=(_e=this.tree[Jt])===null||_e===void 0?void 0:_e[J])===null||Oe===void 0?void 0:Oe[Lt].value()),this.indicatorStatistics[Lt].total.push(t)}}}}updateSortRules(t){var e,n,o,r,s,l,a,h,d,u,c,g,f,p,m,b,C,_;this.sorted=!1,this.sortRules=t,this.sortKeys(),this.customRowTree||(this.rowHierarchyType==="tree"?this.rowHeaderTree=this.ArrToTree1(this.rowKeys,this.rows.filter((w,y)=>this.rowsHasValue[y]),this.indicatorsAsCol?void 0:this.indicators,((n=(e=this.totals)===null||e===void 0?void 0:e.row)===null||n===void 0?void 0:n.showGrandTotals)||!this.indicatorsAsCol&&this.columns.length===0||this.indicatorsAsCol&&this.rows.length===0,this.rowGrandTotalLabel):this.rowHeaderTree=this.ArrToTree(this.rowKeys,this.rows.filter((w,y)=>this.rowsHasValue[y]),this.indicatorsAsCol?void 0:this.indicators,this.rowsIsTotal,((r=(o=this.totals)===null||o===void 0?void 0:o.row)===null||r===void 0?void 0:r.showGrandTotals)||this.indicatorsAsCol&&this.rows.length===0,this.rowGrandTotalLabel,this.rowSubTotalLabel,(a=(l=(s=this.totals)===null||s===void 0?void 0:s.row)===null||l===void 0?void 0:l.showGrandTotalsOnTop)!==null&&a!==void 0&&a,(u=(d=(h=this.totals)===null||h===void 0?void 0:h.row)===null||d===void 0?void 0:d.showSubTotalsOnTop)!==null&&u!==void 0&&u)),this.customColTree||(this.colHeaderTree=this.ArrToTree(this.colKeys,this.columns.filter((w,y)=>this.columnsHasValue[y]),this.indicatorsAsCol?this.indicators:void 0,this.colsIsTotal,((g=(c=this.totals)===null||c===void 0?void 0:c.column)===null||g===void 0?void 0:g.showGrandTotals)||!this.indicatorsAsCol&&this.columns.length===0,this.colGrandTotalLabel,this.colSubTotalLabel,(m=(p=(f=this.totals)===null||f===void 0?void 0:f.column)===null||p===void 0?void 0:p.showGrandTotalsOnLeft)!==null&&m!==void 0&&m,(_=(C=(b=this.totals)===null||b===void 0?void 0:b.column)===null||C===void 0?void 0:C.showSubTotalsOnLeft)!==null&&_!==void 0&&_))}updateFilterRules(t,e=!1){var n,o;if(this.filterRules=t,this.filteredRecords=void 0,e)this.tree={};else for(const r in this.tree)for(const s in this.tree[r])for(let l=0;l<this.tree[r][s].length;l++)(n=this.tree[r][s][l])===null||n===void 0||n.reset();this.collectedValues={},this.processRecords(),this.processCollectedValuesWithSumBy(),this.processCollectedValuesWithSortBy(),this.totalStatistics(),!((o=this.dataConfig)===null||o===void 0)&&o.isPivotChart&&this.cacheDeminsionCollectedValues()}getAggregatorRule(t){var e;return(e=this.aggregationRules)===null||e===void 0?void 0:e.find((n,o)=>t===n.indicatorKey)}getAggregator(t=[],e=[],n,o=!0,r){var s,l,a,h;const d=this.indicatorKeys.indexOf(n);let u,c;typeof t=="string"?u=t:(r&&r.position!=="row"||t.map((f,p)=>{f!==n||z(r==null?void 0:r.index)&&p!==r.index||t.splice(p,1)}),u=TT(t,this.stringJoinChar)),typeof e=="string"?c=e:(r&&r.position!=="col"||e.map((f,p)=>{f!==n||z(r==null?void 0:r.index)&&p!==r.index||e.splice(p,1)}),c=TT(e,this.stringJoinChar));const g=(l=(s=this.tree[u])===null||s===void 0?void 0:s[c])===null||l===void 0?void 0:l[d];if(o&&z((h=(a=this.changedTree[u])===null||a===void 0?void 0:a[c])===null||h===void 0?void 0:h[d])){const f=this.changedTree[u][c][d];return g?{value:()=>f,formatValue:g.formatValue,formatFun:g.formatFun,records:g.records,className:"",recalculate(){},push(){},deleteRecord(){},updateRecord(){},clearCacheValue(){},reset(){}}:{value:()=>f,className:"",push(){},deleteRecord(){},updateRecord(){},recalculate(){},formatValue:()=>f,clearCacheValue(){},reset(){}}}return g||{className:"",push(){},deleteRecord(){},updateRecord(){},recalculate(){},value:()=>null,clearCacheValue(){},reset(){}}}sortKeys(){if(this.colKeys=this.colKeys_normal.slice(),this.rowKeys=this.rowKeys_normal.slice(),!this.sorted){this.sorted=!0,this.rowKeys.sort(this.arrSort(this.rows,!0));const t=this.arrSort(this.columns,!1);this.colKeys.sort(t)}}arrSort(t,e){let n;const o=this,r=function(s){const l=[];for(let a=0,h=t.length;a<h;a++)if(n=t[a],o.sortRules)for(let d=0,u=o.sortRules.length;d<u;d++)o.sortRules[d].sortField===n&&l.push({field:n,fieldIndex:a,sortRule:o.sortRules[d],func:o.getSort(o.sortRules[d],e)});return l}.call(this);return function(s,l){var a,h,d,u;let c,g;for(let f=0;f<r.length;f++){if(g=r[f],(a=g.sortRule)===null||a===void 0?void 0:a.sortByIndicator){let p=s,m=l;g.fieldIndex<t.length-1&&(p=s.slice(0,g.fieldIndex+1),o.rowHierarchyType==="grid"&&e?p.push(o.rowSubTotalLabel):e||p.push(o.colSubTotalLabel),m=l.slice(0,g.fieldIndex+1),o.rowHierarchyType==="grid"&&e?m.push(o.rowSubTotalLabel):e||m.push(o.colSubTotalLabel)),c=g.func(p,m,(h=g.sortRule)===null||h===void 0?void 0:h.sortType)}else c=(d=g.func)===null||d===void 0?void 0:d.call(g,s[g.fieldIndex],l[g.fieldIndex],(u=g.sortRule)===null||u===void 0?void 0:u.sortType);if(c!==0)return c}return 0}}getSort(t,e){const n=this;return t.sortByIndicator?(o,r,s)=>{const l=function(a,h){return n.rowHierarchyType==="grid"&&a.length<n.rows.length&&a[a.length-1]!==n.rowSubTotalLabel&&a[a.length-1]!==n.rowGrandTotalLabel&&a.push(n.rowSubTotalLabel),h.length<n.columns.length&&h[h.length-1]!==n.colSubTotalLabel&&h[h.length-1]!==n.colGrandTotalLabel&&h.push(n.colSubTotalLabel),n.getAggregator(a,h,t.sortByIndicator).value()};return e?bc(l(o,t.query),l(r,t.query),s):bc(l(t.query,o),l(t.query,r),s)}:t.sortBy?X4(t.sortBy):t.sortFunc?t.sortFunc:t.sortType?Y4:bc}totalStatistics(){var t,e,n,o,r,s,l,a,h,d,u,c,g,f;const p=this,m=(b,C)=>{var _,w,y,S,A,R,x,T,M,B,P,F,H,E,k,I,L,D,O,N,W,$,U,Y,j,G,X,ht,gt,Ct,Q,et,vt,bt,dt,ot,ut,st,_t,ct,Wt,Yt,yt,mt,ie,le,Zt,_e,Oe,He;if(!((w=(_=this.totalRecordsTree)===null||_===void 0?void 0:_[b])===null||w===void 0)&&w[C])return this.tree[b]||(this.tree[b]={}),void(this.tree[b][C]=(S=(y=this.totalRecordsTree)===null||y===void 0?void 0:y[b])===null||S===void 0?void 0:S[C]);const Ht=C.split(this.stringJoinChar);if(!((R=(A=p.totals)===null||A===void 0?void 0:A.column)===null||R===void 0)&&R.subTotalsDimensions&&((M=(T=(x=p.totals)===null||x===void 0?void 0:x.column)===null||T===void 0?void 0:T.subTotalsDimensions)===null||M===void 0?void 0:M.length)>0&&p.totals.column.showSubTotals!==!1)for(let Et=0,Rt=(F=(P=(B=p.totals)===null||B===void 0?void 0:B.column)===null||P===void 0?void 0:P.subTotalsDimensions)===null||F===void 0?void 0:F.length;Et<Rt;Et++){const Tt=p.totals.column.subTotalsDimensions[Et],Nt=p.columns.indexOf(Tt);if(Nt>=0){const te=Ht.slice(0,Nt+1);te.push(p.colSubTotalLabel);const ae=te.join(this.stringJoinChar);if(!((E=(H=this.totalRecordsTree)===null||H===void 0?void 0:H[b])===null||E===void 0)&&E[ae])return void(this.tree[b][ae]=(I=(k=this.totalRecordsTree)===null||k===void 0?void 0:k[b])===null||I===void 0?void 0:I[ae]);this.tree[b][ae]||(this.tree[b][ae]=[]);const Jt=this.indicatorKeysIncludeCalculatedFieldDependIndicatorKeys;for(let J=0;J<Jt.length;J++)if(this.calculatedFiledKeys.indexOf(Jt[J])>=0){const be=(L=this.calculatedFieldRules)===null||L===void 0?void 0:L.find(Lt=>Lt.key===Jt[J]);!((O=(D=this.tree[b])===null||D===void 0?void 0:D[ae])===null||O===void 0)&&O[J]||(this.tree[b][ae][J]=new this.aggregators[zt.RECALCULATE]({key:Jt[J],dimension:Jt[J],isRecord:!0,formatFun:(W=(N=this.indicators)===null||N===void 0?void 0:N.find(Lt=>typeof Lt!="string"&&Lt.indicatorKey===Jt[J]))===null||W===void 0?void 0:W.format,calculateFun:be==null?void 0:be.calculateFun,dependAggregators:this.tree[b][ae],dependIndicatorKeys:be==null?void 0:be.dependIndicatorKeys})),ae!==C&&this.tree[b][ae][J].push((U=($=p.tree[b])===null||$===void 0?void 0:$[C])===null||U===void 0?void 0:U[J])}else{if(!this.tree[b][ae][J]){const be=this.getAggregatorRule(Jt[J]);this.tree[b][ae][J]=new this.aggregators[(Y=be==null?void 0:be.aggregationType)!==null&&Y!==void 0?Y:zt.SUM]({key:Jt[J],dimension:(j=be==null?void 0:be.field)!==null&&j!==void 0?j:Jt[J],formatFun:(G=be==null?void 0:be.formatFun)!==null&&G!==void 0?G:(ht=(X=this.indicators)===null||X===void 0?void 0:X.find(Lt=>typeof Lt!="string"&&Lt.indicatorKey===Jt[J]))===null||ht===void 0?void 0:ht.format})}ae!==C&&this.tree[b][ae][J].push((Ct=(gt=p.tree[b])===null||gt===void 0?void 0:gt[C])===null||Ct===void 0?void 0:Ct[J])}}}if(!((et=(Q=p.totals)===null||Q===void 0?void 0:Q.column)===null||et===void 0)&&et.showGrandTotals||this.rows.length===0){const Et=p.colGrandTotalLabel;if(!((bt=(vt=this.totalRecordsTree)===null||vt===void 0?void 0:vt[b])===null||bt===void 0)&&bt[Et])return void(this.tree[b][Et]=(ot=(dt=this.totalRecordsTree)===null||dt===void 0?void 0:dt[b])===null||ot===void 0?void 0:ot[Et]);this.tree[b][Et]||(this.tree[b][Et]=[]);const Rt=this.indicatorKeysIncludeCalculatedFieldDependIndicatorKeys;for(let Tt=0;Tt<Rt.length;Tt++)if(this.calculatedFiledKeys.indexOf(Rt[Tt])>=0){const Nt=(ut=this.calculatedFieldRules)===null||ut===void 0?void 0:ut.find(te=>te.key===Rt[Tt]);!((_t=(st=this.tree[b])===null||st===void 0?void 0:st[Et])===null||_t===void 0)&&_t[Tt]||(this.tree[b][Et][Tt]=new this.aggregators[zt.RECALCULATE]({key:Rt[Tt],dimension:Rt[Tt],isRecord:!0,formatFun:(Wt=(ct=this.indicators)===null||ct===void 0?void 0:ct.find(te=>typeof te!="string"&&te.indicatorKey===Rt[Tt]))===null||Wt===void 0?void 0:Wt.format,calculateFun:Nt==null?void 0:Nt.calculateFun,dependAggregators:this.tree[b][Et],dependIndicatorKeys:Nt==null?void 0:Nt.dependIndicatorKeys})),Et!==C&&this.tree[b][Et][Tt].push((yt=(Yt=p.tree[b])===null||Yt===void 0?void 0:Yt[C])===null||yt===void 0?void 0:yt[Tt])}else{if(!this.tree[b][Et][Tt]){const Nt=this.getAggregatorRule(Rt[Tt]);this.tree[b][Et][Tt]=new this.aggregators[(mt=Nt==null?void 0:Nt.aggregationType)!==null&&mt!==void 0?mt:zt.SUM]({key:Rt[Tt],dimension:(ie=Nt==null?void 0:Nt.field)!==null&&ie!==void 0?ie:Rt[Tt],formatFun:(le=Nt==null?void 0:Nt.formatFun)!==null&&le!==void 0?le:(_e=(Zt=this.indicators)===null||Zt===void 0?void 0:Zt.find(te=>typeof te!="string"&&te.indicatorKey===Rt[Tt]))===null||_e===void 0?void 0:_e.format})}Et!==C&&this.tree[b][Et][Tt].push((He=(Oe=p.tree[b])===null||Oe===void 0?void 0:Oe[C])===null||He===void 0?void 0:He[Tt])}}};if(!((e=(t=p==null?void 0:p.totals)===null||t===void 0?void 0:t.column)===null||e===void 0)&&e.subTotalsDimensions&&((r=(o=(n=p==null?void 0:p.totals)===null||n===void 0?void 0:n.column)===null||o===void 0?void 0:o.subTotalsDimensions)===null||r===void 0?void 0:r.length)>=1||!((l=(s=p==null?void 0:p.totals)===null||s===void 0?void 0:s.row)===null||l===void 0)&&l.subTotalsDimensions&&((d=(h=(a=p==null?void 0:p.totals)===null||a===void 0?void 0:a.row)===null||h===void 0?void 0:h.subTotalsDimensions)===null||d===void 0?void 0:d.length)>=1||!((c=(u=p==null?void 0:p.totals)===null||u===void 0?void 0:u.column)===null||c===void 0)&&c.showGrandTotals||!((f=(g=p==null?void 0:p.totals)===null||g===void 0?void 0:g.row)===null||f===void 0)&&f.showGrandTotals){const b=[];Object.keys(p.tree).forEach(C=>{const _=C.split(this.stringJoinChar);Object.keys(p.tree[C]).forEach(w=>{var y,S,A,R,x,T,M,B,P,F,H,E,k,I,L,D,O,N,W,$,U,Y,j,G,X,ht,gt,Ct,Q,et;if(!((S=(y=p.totals)===null||y===void 0?void 0:y.row)===null||S===void 0)&&S.subTotalsDimensions&&((x=(R=(A=p.totals)===null||A===void 0?void 0:A.row)===null||R===void 0?void 0:R.subTotalsDimensions)===null||x===void 0?void 0:x.length)>0&&p.totals.row.showSubTotals!==!1)for(let vt=0,bt=(B=(M=(T=p.totals)===null||T===void 0?void 0:T.row)===null||M===void 0?void 0:M.subTotalsDimensions)===null||B===void 0?void 0:B.length;vt<bt;vt++){const dt=p.totals.row.subTotalsDimensions[vt],ot=p.rows.indexOf(dt);if(ot>=0&&ot<p.rows.length-1){const ut=_.slice(0,ot+1);this.rowHierarchyType==="grid"&&ut.push(p.rowSubTotalLabel);const st=ut.join(this.stringJoinChar);this.tree[st]||(this.tree[st]={},b.push(st)),this.tree[st][w]||(this.tree[st][w]=[]);const _t=this.indicatorKeysIncludeCalculatedFieldDependIndicatorKeys;for(let ct=0;ct<_t.length;ct++){if(!this.tree[st][w][ct])if(this.calculatedFiledKeys.indexOf(_t[ct])>=0){const Wt=(P=this.calculatedFieldRules)===null||P===void 0?void 0:P.find(Yt=>Yt.key===_t[ct]);this.tree[st][w][ct]=new this.aggregators[zt.RECALCULATE]({key:_t[ct],dimension:_t[ct],isRecord:!0,formatFun:(H=(F=this.indicators)===null||F===void 0?void 0:F.find(Yt=>typeof Yt!="string"&&Yt.indicatorKey===_t[ct]))===null||H===void 0?void 0:H.format,calculateFun:Wt==null?void 0:Wt.calculateFun,dependAggregators:this.tree[st][w],dependIndicatorKeys:Wt==null?void 0:Wt.dependIndicatorKeys})}else{const Wt=this.getAggregatorRule(_t[ct]);this.tree[st][w][ct]=new this.aggregators[(E=Wt==null?void 0:Wt.aggregationType)!==null&&E!==void 0?E:zt.SUM]({key:_t[ct],dimension:(k=Wt==null?void 0:Wt.field)!==null&&k!==void 0?k:_t[ct],formatFun:(I=Wt==null?void 0:Wt.formatFun)!==null&&I!==void 0?I:(D=(L=this.indicators)===null||L===void 0?void 0:L.find(Yt=>typeof Yt!="string"&&Yt.indicatorKey===_t[ct]))===null||D===void 0?void 0:D.format})}st!==C&&this.tree[st][w][ct].push((N=(O=p.tree[C])===null||O===void 0?void 0:O[w])===null||N===void 0?void 0:N[ct])}}}if(!(($=(W=p.totals)===null||W===void 0?void 0:W.row)===null||$===void 0)&&$.showGrandTotals||this.columns.length===0){const vt=p.rowGrandTotalLabel;this.tree[vt]||(this.tree[vt]={},b.push(vt)),this.tree[vt][w]||(this.tree[vt][w]=[]);const bt=this.indicatorKeysIncludeCalculatedFieldDependIndicatorKeys;for(let dt=0;dt<bt.length;dt++){if(!this.tree[vt][w][dt])if(this.calculatedFiledKeys.indexOf(bt[dt])>=0){const ot=(U=this.calculatedFieldRules)===null||U===void 0?void 0:U.find(ut=>ut.key===bt[dt]);this.tree[vt][w][dt]=new this.aggregators[zt.RECALCULATE]({key:bt[dt],dimension:bt[dt],isRecord:!0,formatFun:(j=(Y=this.indicators)===null||Y===void 0?void 0:Y.find(ut=>typeof ut!="string"&&ut.indicatorKey===bt[dt]))===null||j===void 0?void 0:j.format,calculateFun:ot==null?void 0:ot.calculateFun,dependAggregators:this.tree[vt][w],dependIndicatorKeys:ot==null?void 0:ot.dependIndicatorKeys})}else{const ot=this.getAggregatorRule(bt[dt]);this.tree[vt][w][dt]=new this.aggregators[(G=ot==null?void 0:ot.aggregationType)!==null&&G!==void 0?G:zt.SUM]({key:bt[dt],dimension:(X=ot==null?void 0:ot.field)!==null&&X!==void 0?X:bt[dt],formatFun:(ht=ot==null?void 0:ot.formatFun)!==null&&ht!==void 0?ht:(Ct=(gt=this.indicators)===null||gt===void 0?void 0:gt.find(ut=>typeof ut!="string"&&ut.indicatorKey===bt[dt]))===null||Ct===void 0?void 0:Ct.format})}vt!==C&&this.tree[vt][w][dt].push((et=(Q=p.tree[C])===null||Q===void 0?void 0:Q[w])===null||et===void 0?void 0:et[dt])}}m(C,w)})}),b.forEach(C=>{Object.keys(p.tree[C]).forEach(_=>{m(C,_)})})}for(const b in p.totalRecordsTree)for(const C in p.totalRecordsTree[b])m(b,C)}ArrToTree1(t,e,n,o,r){const s=[],l=this.stringJoinChar,a=new Map;function h(d){const u=[];let c;d.forEach((g,f)=>{var p;u.push(g);const m=u.join(l);let b=a.get(m);b||(b={value:g,dimensionKey:e[f],children:f===d.length-1&&((p=n==null?void 0:n.length)!==null&&p!==void 0?p:0)>=1?n==null?void 0:n.map(C=>typeof C=="string"?{indicatorKey:C,value:C}:{indicatorKey:C.indicatorKey,value:C.title}):[]},a.set(m,b),c?c.children.push(b):s.push(b)),c=b})}return t.forEach(d=>h(d)),o&&h([r]),s}ArrToTree(t,e,n,o,r,s,l,a,h){var d;let u=[];const c=this.stringJoinChar,g=new Map;if(t!=null&&t.length?t.forEach(f=>function(p){const m=[];let b;p.forEach((C,_)=>{var w,y,S,A;m.push(C);const R=m.join(c);let x=g.get(R);if(!x){if(x={value:C,dimensionKey:e[_],children:_===p.length-1&&((w=n==null?void 0:n.length)!==null&&w!==void 0?w:0)>=1?n==null?void 0:n.map(T=>typeof T=="string"?{indicatorKey:T,value:T}:{indicatorKey:T.indicatorKey,value:T.title}):[]},o[_]){let T=(y=x.children)!==null&&y!==void 0?y:[];const M={value:l,dimensionKey:e[_+1],levelSpan:o.length-_-1,children:((S=n==null?void 0:n.length)!==null&&S!==void 0?S:0)>=1?n==null?void 0:n.map(B=>typeof B=="string"?{indicatorKey:B,value:B}:{indicatorKey:B.indicatorKey,value:B.title}):[]};T.push(M),T=(A=M.children)!==null&&A!==void 0?A:[]}g.set(R,x),b?o[_-1]&&!h?b.children.splice(b.children.length-1,0,x):b.children.push(x):u.push(x)}b=x})}(f)):n&&(u=n==null?void 0:n.map(f=>{var p;return typeof f=="string"?{indicatorKey:f,value:f}:{indicatorKey:f.indicatorKey,value:(p=f.title)!==null&&p!==void 0?p:f.indicatorKey}})),r&&(t==null?void 0:t.length)){const f={value:s,dimensionKey:e[0],levelSpan:o.length,children:(d=n==null?void 0:n.map(p=>typeof p=="string"?{indicatorKey:p,value:p}:{indicatorKey:p.indicatorKey,value:p.title}))!==null&&d!==void 0?d:[]};a?u.unshift(f):u.push(f)}return u}cacheDeminsionCollectedValues(){for(const t in this.collectValuesBy)this.collectValuesBy[t].type!=="xField"&&this.collectValuesBy[t].type!=="yField"||(this.dataConfig.dimensionSortArray?this.cacheCollectedValues[t]=z9(this.collectedValues[t],this.dataConfig.dimensionSortArray):this.cacheCollectedValues[t]=this.collectedValues[t])}changeTreeNodeValue(t=[],e=[],n,o){var r,s,l;const a=this.indicatorKeys.indexOf(n);let h,d;h=typeof t=="string"?t:t.join(this.stringJoinChar),d=typeof e=="string"?e:e.join(this.stringJoinChar),!((r=this.changedTree[h])===null||r===void 0)&&r[d]?this.changedTree[h][d][a]=o:this.changedTree[h]?(this.changedTree[h][d]=[],this.changedTree[h][d][a]=o):(this.changedTree[h]={},this.changedTree[h][d]=[],this.changedTree[h][d][a]=o);const u=(l=(s=this.tree[h])===null||s===void 0?void 0:s[d])===null||l===void 0?void 0:l[a];(u==null?void 0:u.records.length)===1&&(u.records[0][this.indicatorKeys[a]]=o)}changeRecordFieldValue(t,e,n){let o=!1;for(let r=0;r<this.indicatorKeys.length;r++)this.indicatorKeys[r]===t&&(o=!0);if(!o){if(Array.isArray(this.records))for(let r=0,s=this.records.length;r<s;r++){const l=this.records[r];l[t]===e&&(l[t]=n)}else for(const r in this.records)for(let s=0,l=this.records[r].length;s<l;s++){const a=this.records[r][s];a[t]===e&&(a[t]=n)}this.rowFlatKeys={},this.colFlatKeys={},this.tree={},this.processRecords()}}_rowTreeHasChanged(){this.hasExtensionRowTree||(this.customRowTreeDimensionPaths=this.customTreeToDimensionPathArr(this.customRowTree,"row"))}changeDataConfig(t){this.rows=t.rows,this.columns=t.columns}addRecords(t){for(let e=0,n=t.length;e<n;e++){const o=t[e];this.processRecord(o)}Array.isArray(this.records)&&this.records.push(t)}customTreeToDimensionPathArr(t,e){const n=[],o=this;function r(s,l){var a,h,d;s.virtual||(!((a=l[l.length-1])===null||a===void 0)&&a.childKeys&&s.dimensionKey&&l[l.length-1].childKeys.indexOf(s.dimensionKey)===-1&&s.dimensionKey!==l[l.length-1].dimensionKey&&l[l.length-1].childKeys.push(s.dimensionKey),l.push({dimensionKey:z(s.indicatorKey)?void 0:s.dimensionKey,value:s.value,indicatorKey:s.indicatorKey,virtual:s.virtual})),((h=s.children)===null||h===void 0?void 0:h.length)>0?(o.rowHierarchyType==="tree"&&e==="row"&&(l[l.length-1].childKeys=[],n.push([...l])),(d=s.children)===null||d===void 0||d.forEach(u=>r(u,[...l]))):n.push(l)}return t==null||t.forEach(s=>r(s,[])),n}getFieldMatchColDimensionPaths(t){var e,n;const o=[];for(let r=0;(n=r<((e=this.customColTreeDimensionPaths)===null||e===void 0?void 0:e.length))!==null&&n!==void 0&&n;r++){const s=this.customColTreeDimensionPaths[r];let l=!0;for(let a=0;a<s.length;a++){const h=s[a];if(h.dimensionKey&&t[h.dimensionKey]!==h.value||h.indicatorKey&&t[h.indicatorKey]===void 0){l=!1;break}}l&&o.push(s)}return o}getFieldMatchRowDimensionPaths(t){var e,n;const o=[];for(let r=0;(n=r<((e=this.customRowTreeDimensionPaths)===null||e===void 0?void 0:e.length))!==null&&n!==void 0&&n;r++){const s=this.customRowTreeDimensionPaths[r];let l=!0;for(let a=0;a<s.length;a++){const h=s[a];if(h.dimensionKey&&t[h.dimensionKey]!==h.value||h.indicatorKey&&t[h.indicatorKey]===void 0){l=!1;break}if(h.childKeys&&a===s.length-1&&h.childKeys.length>0&&h.childKeys.find(d=>z(t[d]))){l=!1;break}}l&&(this.indicatorsAsCol||this.rowHierarchyType!=="tree"||s.find(a=>a.indicatorKey)||(l=!1)),l&&o.push(s)}return o}}function z9(i,t){return i.sort((e,n)=>{const o=t.indexOf(e),r=t.indexOf(n);return o<r?-1:o>r?1:0})}let MT=class extends Cg{constructor(t,e){var n,o,r,s,l,a,h,d,u,c,g,f,p,m,b,C;if(oe.mode==="node"?(e=t,t=null):t instanceof HTMLElement||(e=t,t=t.container?t.container:null),super(t,e),this.layoutNodeId={seqId:0},e){e.layout&&Object.assign(e,e.layout),this.internalProps.columns=Ee(e.columns),this.internalProps.rows=Ee(e.rows),this.internalProps.indicators=ho(e.indicators),(n=e.indicators)===null||n===void 0||n.forEach((w,y)=>{typeof w=="object"&&(w!=null&&w.editor)&&(this.internalProps.indicators[y].editor=w.editor)}),this.internalProps.columnTree=!e.indicatorsAsCol||!((o=e.columns)===null||o===void 0)&&o.length||e.columnTree?Ee(e.columnTree):[],this.internalProps.rowTree=e.indicatorsAsCol||!((r=e.rows)===null||r===void 0)&&r.length||e.rowTree?Ee(e.rowTree):[],this.internalProps.records=e.records,this.pagination=e.pagination,this.internalProps.columnResizeType=(s=e.columnResizeType)!==null&&s!==void 0?s:"column",this.internalProps.rowResizeType=(l=e.rowResizeType)!==null&&l!==void 0?l:"row",this.internalProps.dataConfig=Ee(e.dataConfig),this.internalProps.columnWidthConfig=e.columnWidthConfig;const _=this.internalProps.records;if(this.internalProps.recordsIsTwoDimensionalArray=!1,((a=_==null?void 0:_[0])===null||a===void 0?void 0:a.constructor)===Array&&(this.internalProps.recordsIsTwoDimensionalArray=!0),((h=e.customConfig)===null||h===void 0?void 0:h.enableDataAnalysis)===!1){const w=new Pe((d=this.internalProps.columnTree)!==null&&d!==void 0?d:[],this.layoutNodeId),y=new Pe((u=this.internalProps.rowTree)!==null&&u!==void 0?u:[],this.layoutNodeId,this.options.rowHierarchyType,this.options.rowHierarchyType==="tree"?(c=this.options.rowExpandLevel)!==null&&c!==void 0?c:1:void 0);this.internalProps.layoutMap=new lr(this,null,w,y),this.internalProps.recordsIsTwoDimensionalArray===!1&&(this.flatDataToObjects=new pv({rows:this.internalProps.layoutMap.fullRowDimensionKeys,columns:this.internalProps.layoutMap.colDimensionKeys,indicators:this.internalProps.layoutMap.indicatorKeys,indicatorsAsCol:this.internalProps.layoutMap.indicatorsAsCol,indicatorDimensionKey:this.internalProps.layoutMap.indicatorDimensionKey},_))}else{const w=$A(this,e),{rowKeys:y,columnKeys:S,indicatorKeys:A}=w;let{columnDimensionTree:R,rowDimensionTree:x}=w;this.dataset=new Ih(this.internalProps.dataConfig,y,S,A,this.internalProps.indicators,(g=e.indicatorsAsCol)===null||g===void 0||g,e.records,e.rowHierarchyType,this.internalProps.columnTree,this.internalProps.rowTree,!1,!!e.extensionRows,!!e.parseCustomTreeToMatchRecords),e.columnTree||(e.indicatorsAsCol!==!1&&(this.dataset.colHeaderTree=Vi(this.dataset.colHeaderTree,e.indicators)),R=new Pe((f=this.dataset.colHeaderTree)!==null&&f!==void 0?f:[],this.layoutNodeId)),e.rowTree||(e.indicatorsAsCol===!1&&(this.dataset.rowHeaderTree=Vi(this.dataset.rowHeaderTree,e.indicators)),x=new Pe((p=this.dataset.rowHeaderTree)!==null&&p!==void 0?p:[],this.layoutNodeId,this.options.rowHierarchyType,this.options.rowHierarchyType==="tree"?(m=this.options.rowExpandLevel)!==null&&m!==void 0?m:1:void 0)),this.internalProps.layoutMap=new lr(this,this.dataset,R,x)}if(this._changePivotSortStateBySortRules(),((C=(b=e.pivotSortState)===null||b===void 0?void 0:b.length)!==null&&C!==void 0?C:0)>0&&(this.pivotSortState=[],this.pivotSortState=e.pivotSortState),oe.mode!=="node"&&(this.editorManager=new cT(this)),this.refreshHeader(),this.internalProps.useOneRowHeightFillAll=!1,this.stateManager.initCheckedState(_),this.scenegraph.createSceneGraph(),e.title){const w=Bt.getComponent("title");this.internalProps.title=new w(e.title,this),this.scenegraph.resize()}if(this.options.emptyTip)if(this.internalProps.emptyTip)this.internalProps.emptyTip.resetVisible();else{const w=Bt.getComponent("emptyTip");this.internalProps.emptyTip=new w(this.options.emptyTip,this),this.internalProps.emptyTip.resetVisible()}setTimeout(()=>{this.fireListeners(at.INITIALIZED,null)},0)}}static get EVENT_TYPE(){return rr}isListTable(){return!1}isPivotTable(){return!0}isPivotChart(){return!1}get recordsCount(){var t;return(t=this.records)===null||t===void 0?void 0:t.length}_canResizeColumn(t,e){const n=super._canResizeColumn(t,e);if(n){if(this.internalProps.layoutMap.isSeriesNumber(t,e)&&this.internalProps.rowSeriesNumber.disableColumnResize===!0)return!1;if(!this.internalProps.layoutMap.indicatorsAsCol){const o=this.internalProps.layoutMap.getBody(t,this.columnHeaderLevelCount);if(o!=null&&o.disableColumnResize)return!1}}return n}updateOption(t){var e,n,o,r,s,l,a,h,d,u,c,g,f,p,m,b,C,_;const w=this.internalProps;if(super.updateOption(t),this.layoutNodeId={seqId:0},this.internalProps.columns=Ee(t.columns),this.internalProps.rows=Ee(t.rows),this.internalProps.indicators=!((e=t.indicators)===null||e===void 0)&&e.length?ho(t.indicators):[],(n=t.indicators)===null||n===void 0||n.forEach((S,A)=>{typeof S=="object"&&(S!=null&&S.editor)&&(this.internalProps.indicators[A].editor=S.editor)}),this.internalProps.columnTree=!t.indicatorsAsCol||!((o=t.columns)===null||o===void 0)&&o.length||t.columnTree?Ee(t.columnTree):[],this.internalProps.rowTree=t.indicatorsAsCol||!((r=t.rows)===null||r===void 0)&&r.length||t.rowTree?Ee(t.rowTree):[],t.records&&(this.internalProps.records=t.records),this.stateManager.initCheckedState(this.internalProps.records),this.stateManager.updateDrillState(void 0,void 0,!1,!1,-1,-1),this.pagination=t.pagination,w.columnResizeType=(s=t.columnResizeType)!==null&&s!==void 0?s:"column",w.rowResizeType=(l=t.rowResizeType)!==null&&l!==void 0?l:"row",w.dataConfig=Ee(t.dataConfig),this.internalProps.columnWidthConfig=t.columnWidthConfig,(t==null?void 0:t.rowHierarchyType)==="tree"&&this.internalProps.layoutMap.rowHierarchyType==="tree"&&this.internalProps.layoutMap.rowExpandLevel===(t==null?void 0:t.rowExpandLevel)){const S=this.internalProps.layoutMap.rowDimensionTree.tree.children;(a=this.internalProps.rowTree)===null||a===void 0||a.forEach((A,R)=>{const x=S.find(T=>T.dimensionKey===A.dimensionKey&&T.value===A.value);x&&this._syncHierarchyState(x,A)})}const y=this.internalProps.records;if(this.internalProps.recordsIsTwoDimensionalArray=!1,((h=y==null?void 0:y[0])===null||h===void 0?void 0:h.constructor)===Array&&(this.internalProps.recordsIsTwoDimensionalArray=!0),((d=t.customConfig)===null||d===void 0?void 0:d.enableDataAnalysis)===!1){let S,A;t.columnTree&&(S=new Pe((u=this.internalProps.columnTree)!==null&&u!==void 0?u:[],this.layoutNodeId)),t.rowTree&&(A=new Pe((c=this.internalProps.rowTree)!==null&&c!==void 0?c:[],this.layoutNodeId,this.options.rowHierarchyType,this.options.rowHierarchyType==="tree"?(g=this.options.rowExpandLevel)!==null&&g!==void 0?g:1:void 0)),w.layoutMap=new lr(this,null,S,A),this.internalProps.recordsIsTwoDimensionalArray===!1&&(this.flatDataToObjects=new pv({rows:w.layoutMap.fullRowDimensionKeys,columns:w.layoutMap.colDimensionKeys,indicators:w.layoutMap.indicatorKeys,indicatorsAsCol:w.layoutMap.indicatorsAsCol,indicatorDimensionKey:w.layoutMap.indicatorDimensionKey},y))}else{const S=$A(this,t),{rowKeys:A,columnKeys:R,indicatorKeys:x}=S;let{columnDimensionTree:T,rowDimensionTree:M}=S;this.dataset=new Ih(w.dataConfig,A,R,x,this.internalProps.indicators,(f=t.indicatorsAsCol)===null||f===void 0||f,y,t.rowHierarchyType,this.internalProps.columnTree,this.internalProps.rowTree,!1,!!t.extensionRows,!!t.parseCustomTreeToMatchRecords),t.columnTree||(t.indicatorsAsCol!==!1&&(this.dataset.colHeaderTree=Vi(this.dataset.colHeaderTree,t.indicators)),T=new Pe((p=this.dataset.colHeaderTree)!==null&&p!==void 0?p:[],this.layoutNodeId)),t.rowTree||(t.indicatorsAsCol===!1&&(this.dataset.rowHeaderTree=Vi(this.dataset.rowHeaderTree,t.indicators)),M=new Pe((m=this.dataset.rowHeaderTree)!==null&&m!==void 0?m:[],this.layoutNodeId,this.options.rowHierarchyType,this.options.rowHierarchyType==="tree"?(b=this.options.rowExpandLevel)!==null&&b!==void 0?b:1:void 0)),w.layoutMap=new lr(this,this.dataset,T,M)}if(this._changePivotSortStateBySortRules(),((_=(C=t.pivotSortState)===null||C===void 0?void 0:C.length)!==null&&_!==void 0?_:0)>0&&(this.pivotSortState=[],this.pivotSortState=t.pivotSortState),this.refreshHeader(),this.internalProps.useOneRowHeightFillAll=!1,w.releaseList&&(w.releaseList.forEach(S=>{var A;return(A=S==null?void 0:S.release)===null||A===void 0?void 0:A.call(S)}),w.releaseList=null),this.scenegraph.clearCells(),this.scenegraph.createSceneGraph(),t.title){const S=Bt.getComponent("title");this.internalProps.title=new S(t.title,this),this.scenegraph.resize()}if(this.options.emptyTip)if(this.internalProps.emptyTip)this.internalProps.emptyTip.resetVisible();else{const S=Bt.getComponent("emptyTip");this.internalProps.emptyTip=new S(this.options.emptyTip,this),this.internalProps.emptyTip.resetVisible()}return new Promise(S=>{setTimeout(S,0)})}updatePagination(t){t?(this.pagination||(this.pagination={currentPage:0,perPageCount:0}),typeof t.currentPage=="number"&&t.currentPage>=0&&(this.pagination.currentPage=t.currentPage),t.perPageCount&&(this.pagination.perPageCount=t.perPageCount||this.pagination.perPageCount),this.scenegraph.clearCells(),this.internalProps.layoutMap.setPagination(this.pagination),this.refreshRowColCount(),this.scenegraph.createSceneGraph(),this.render()):this.pagination&&(this.pagination=void 0,this.scenegraph.clearCells(),this.internalProps.layoutMap.setPagination(void 0),this.refreshRowColCount(),this.scenegraph.createSceneGraph(),this.render())}refreshHeader(){this.setMinMaxLimitWidth(!0),this.refreshRowColCount()}refreshRowColCount(){var t,e,n,o,r,s,l,a,h;const d=this,{layoutMap:u}=d.internalProps;u&&(d.colCount=(t=u.colCount)!==null&&t!==void 0?t:0,d.rowCount=(e=u.rowCount)!==null&&e!==void 0?e:0,this.internalProps.frozenColCount=Math.max(((n=u.rowHeaderLevelCount)!==null&&n!==void 0?n:0)+u.leftRowSeriesNumberColumnCount,(o=this.options.frozenColCount)!==null&&o!==void 0?o:0),d.frozenRowCount=Math.max(u.headerLevelCount,(r=this.options.frozenRowCount)!==null&&r!==void 0?r:0),d.bottomFrozenRowCount!==((s=this.options.bottomFrozenRowCount)!==null&&s!==void 0?s:0)&&(d.bottomFrozenRowCount=(l=this.options.bottomFrozenRowCount)!==null&&l!==void 0?l:0),d.rightFrozenColCount!==((a=this.options.rightFrozenColCount)!==null&&a!==void 0?a:0)&&(d.rightFrozenColCount=(h=this.options.rightFrozenColCount)!==null&&h!==void 0?h:0),this.stateManager.setFrozenCol(this.internalProps.frozenColCount))}_getSortFuncFromHeaderOption(t,e,n){}get rowHierarchyType(){return this.internalProps.layoutMap.rowHierarchyType}_syncHierarchyState(t,e){var n,o;t.value===e.value&&t.dimensionKey===e.dimensionKey&&(e.hierarchyState=(n=e.hierarchyState)!==null&&n!==void 0?n:e!=null&&e.children?t.hierarchyState:void 0,(o=e==null?void 0:e.children)===null||o===void 0||o.forEach((r,s)=>{var l;if(!((l=t==null?void 0:t.children)===null||l===void 0)&&l[s]&&r){const a=t.children.find(h=>h.dimensionKey===r.dimensionKey&&h.value===r.value);a&&this._syncHierarchyState(a,r)}}))}getRecordShowIndexByCell(t,e){}getTableIndexByRecordIndex(t){}getTableIndexByField(t){}getCellAddrByFieldRecord(t,e){}getBodyIndexByRow(t){const{layoutMap:e}=this.internalProps;return e.getBodyIndexByRow(t)}getBodyIndexByCol(t){const{layoutMap:e}=this.internalProps;return e.getBodyIndexByCol(t)}getFieldData(t,e,n){var o,r,s;if(!this.internalProps.layoutMap.isHeader(e,n)){if(this.internalProps.recordsIsTwoDimensionalArray){const l=this.getBodyIndexByRow(n),a=this.getBodyIndexByCol(e);return(o=this.records[l])===null||o===void 0?void 0:o[a]}if(this.dataset){const l=this.internalProps.layoutMap.getCellHeaderPaths(e,n);if(l){let a;const h=(r=l.colHeaderPaths)===null||r===void 0?void 0:r.filter(c=>!c.virtual).map((c,g)=>{var f;return c.indicatorKey&&(a={position:"col",index:g}),(f=c.indicatorKey)!==null&&f!==void 0?f:c.value}),d=(s=l.rowHeaderPaths)===null||s===void 0?void 0:s.filter(c=>!c.virtual).map((c,g)=>{var f;return c.indicatorKey&&(a={position:"row",index:g}),(f=c.indicatorKey)!==null&&f!==void 0?f:c.value}),u=this.dataset.getAggregator(d,h,this.internalProps.layoutMap.getIndicatorKey(e,n),!0,a);if(u.records&&u.records.length>=1)return u.records[0][t]}}else if(this.flatDataToObjects){const l=this.internalProps.layoutMap.getCellHeaderPaths(e,n),a=l.colHeaderPaths.map(u=>{var c;return(c=u.indicatorKey)!==null&&c!==void 0?c:u.value}),h=l.rowHeaderPaths.map(u=>{var c;return(c=u.indicatorKey)!==null&&c!==void 0?c:u.value}),d=this.flatDataToObjects.getTreeNode(h,a,this.internalProps.layoutMap.getBody(e,n).indicatorKey,!1);if(d!=null&&d.record)return d==null?void 0:d.record[t]}}}getCellValue(t,e,n){var o,r,s,l,a,h,d;if(!n){const u=this.getCustomMergeValue(t,e);if(u)return u}if(this.internalProps.layoutMap.isSeriesNumber(t,e)){if(this.internalProps.layoutMap.isSeriesNumberInHeader(t,e)){const{title:c}=this.internalProps.layoutMap.getSeriesNumberHeader(t,e);return c}const{format:u}=this.internalProps.layoutMap.getSeriesNumberBody(t,e);return typeof u=="function"?u(t,e,this):e-this.columnHeaderLevelCount+1}if(this.internalProps.layoutMap.isHeader(t,e)){const{title:u,fieldFormat:c}=this.internalProps.layoutMap.getHeader(t,e);return typeof c=="function"?c(u,t,e,this):u}if(this.internalProps.recordsIsTwoDimensionalArray){const{fieldFormat:u}=this.internalProps.layoutMap.getBody(t,e),c=this.getBodyIndexByRow(e),g=this.getBodyIndexByCol(t),f=(o=this.records[c])===null||o===void 0?void 0:o[g];return typeof u=="function"?u(f,t,e,this):f}if(this.dataset){const u=this.internalProps.layoutMap.getCellHeaderPaths(t,e);let c;const g=(s=(r=u.colHeaderPaths)===null||r===void 0?void 0:r.filter(b=>!b.virtual))===null||s===void 0?void 0:s.map((b,C)=>{var _;return b.indicatorKey&&(c={position:"col",index:C}),(_=b.indicatorKey)!==null&&_!==void 0?_:b.value}),f=(a=(l=u.rowHeaderPaths)===null||l===void 0?void 0:l.filter(b=>!b.virtual))===null||a===void 0?void 0:a.map((b,C)=>{var _;return b.indicatorKey&&(c={position:"row",index:C}),(_=b.indicatorKey)!==null&&_!==void 0?_:b.value}),p=this.dataset.getAggregator(f,g,this.internalProps.layoutMap.getIndicatorKey(t,e),!0,c),{fieldFormat:m}=this.internalProps.layoutMap.getBody(t,e);return p.formatValue?p.formatValue(t,e,this):typeof m=="function"?m(p==null?void 0:p.value(),t,e,this):(h=p==null?void 0:p.value())!==null&&h!==void 0?h:""}if(this.flatDataToObjects){const u=this.internalProps.layoutMap.getCellHeaderPaths(t,e),c=u.colHeaderPaths.map(m=>{var b;return(b=m.indicatorKey)!==null&&b!==void 0?b:m.value}),g=u.rowHeaderPaths.map(m=>{var b;return(b=m.indicatorKey)!==null&&b!==void 0?b:m.value}),f=this.flatDataToObjects.getTreeNode(g,c,this.internalProps.layoutMap.getBody(t,e).indicatorKey),{fieldFormat:p}=this.internalProps.layoutMap.getBody(t,e);return typeof p=="function"?p(f==null?void 0:f.value,t,e,this):(d=f==null?void 0:f.value)!==null&&d!==void 0?d:""}}getCellOriginValue(t,e){var n,o,r;const s=this;if(s.internalProps.layoutMap.isHeader(t,e)){const{title:l}=s.internalProps.layoutMap.getHeader(t,e);return typeof l=="function"?l():l}if(this.internalProps.recordsIsTwoDimensionalArray){const l=this.getBodyIndexByRow(e),a=this.getBodyIndexByCol(t);return(n=this.records[l])===null||n===void 0?void 0:n[a]}if(this.dataset){let l;const a=this.internalProps.layoutMap.getCellHeaderPaths(t,e),h=(o=a.colHeaderPaths)===null||o===void 0?void 0:o.filter(c=>!c.virtual).map((c,g)=>{var f;return c.indicatorKey&&(l={position:"col",index:g}),(f=c.indicatorKey)!==null&&f!==void 0?f:c.value}),d=(r=a.rowHeaderPaths)===null||r===void 0?void 0:r.filter(c=>!c.virtual).map((c,g)=>{var f;return c.indicatorKey&&(l={position:"row",index:g}),(f=c.indicatorKey)!==null&&f!==void 0?f:c.value}),u=this.dataset.getAggregator(d,h,this.internalProps.layoutMap.getIndicatorKey(t,e),!0,l);return u.value?u.value():void 0}if(this.flatDataToObjects){const l=this.internalProps.layoutMap.getCellHeaderPaths(t,e),a=l.colHeaderPaths.map(u=>{var c;return(c=u.indicatorKey)!==null&&c!==void 0?c:u.value}),h=l.rowHeaderPaths.map(u=>{var c;return(c=u.indicatorKey)!==null&&c!==void 0?c:u.value}),d=this.flatDataToObjects.getTreeNode(h,a,this.internalProps.layoutMap.getBody(t,e).indicatorKey);return d==null?void 0:d.value}}getCellRawValue(t,e){var n,o,r;const s=this;if(s.internalProps.layoutMap.isHeader(t,e)){const{title:l}=s.internalProps.layoutMap.getHeader(t,e);return typeof l=="function"?l():l}if(this.internalProps.recordsIsTwoDimensionalArray){const l=this.getBodyIndexByRow(e),a=this.getBodyIndexByCol(t);return(n=this.records[l])===null||n===void 0?void 0:n[a]}if(this.dataset){let l;const a=this.internalProps.layoutMap.getCellHeaderPaths(t,e),h=(o=a.colHeaderPaths)===null||o===void 0?void 0:o.filter(c=>!c.virtual).map((c,g)=>{var f;return c.indicatorKey&&(l={position:"col",index:g}),(f=c.indicatorKey)!==null&&f!==void 0?f:c.value}),d=(r=a.rowHeaderPaths)===null||r===void 0?void 0:r.filter(c=>!c.virtual).map((c,g)=>{var f;return c.indicatorKey&&(l={position:"row",index:g}),(f=c.indicatorKey)!==null&&f!==void 0?f:c.value}),u=this.dataset.getAggregator(d,h,this.internalProps.layoutMap.getIndicatorKey(t,e),!1,l);return u.value?u.value():void 0}if(this.flatDataToObjects){const l=this.internalProps.layoutMap.getCellHeaderPaths(t,e),a=l.colHeaderPaths.map(u=>{var c;return(c=u.indicatorKey)!==null&&c!==void 0?c:u.value}),h=l.rowHeaderPaths.map(u=>{var c;return(c=u.indicatorKey)!==null&&c!==void 0?c:u.value}),d=this.flatDataToObjects.getTreeNode(h,a,this.internalProps.layoutMap.getBody(t,e).indicatorKey,!1);return d==null?void 0:d.value}}getCellOriginRecord(t,e){var n,o,r;if(!this.internalProps.layoutMap.isHeader(t,e)){if(this.internalProps.recordsIsTwoDimensionalArray){const s=this.getBodyIndexByRow(e),l=this.getBodyIndexByCol(t);return(n=this.records[s])===null||n===void 0?void 0:n[l]}if(this.dataset){let s;const l=this.internalProps.layoutMap.getCellHeaderPaths(t,e),a=(o=l.colHeaderPaths)===null||o===void 0?void 0:o.filter(d=>!d.virtual).map((d,u)=>{var c;return d.indicatorKey&&(s={position:"col",index:u}),(c=d.indicatorKey)!==null&&c!==void 0?c:d.value}),h=(r=l.rowHeaderPaths)===null||r===void 0?void 0:r.filter(d=>!d.virtual).map((d,u)=>{var c;return d.indicatorKey&&(s={position:"row",index:u}),(c=d.indicatorKey)!==null&&c!==void 0?c:d.value});return this.dataset.getAggregator(h,a,this.internalProps.layoutMap.getIndicatorKey(t,e),!0,s).records}if(this.flatDataToObjects){const s=this.internalProps.layoutMap.getCellHeaderPaths(t,e),l=s.colHeaderPaths.map(d=>{var u;return(u=d.indicatorKey)!==null&&u!==void 0?u:d.value}),a=s.rowHeaderPaths.map(d=>{var u;return(u=d.indicatorKey)!==null&&u!==void 0?u:d.value}),h=this.flatDataToObjects.getTreeNode(a,l,this.internalProps.layoutMap.getBody(t,e).indicatorKey);return h==null?void 0:h.record}}}getCellRawRecord(t,e){var n,o,r;if(!this.internalProps.layoutMap.isHeader(t,e)){if(this.internalProps.recordsIsTwoDimensionalArray){const s=this.getBodyIndexByRow(e),l=this.getBodyIndexByCol(t);return(n=this.records[s])===null||n===void 0?void 0:n[l]}if(this.dataset){let s;const l=this.internalProps.layoutMap.getCellHeaderPaths(t,e),a=(o=l.colHeaderPaths)===null||o===void 0?void 0:o.filter(d=>!d.virtual).map((d,u)=>{var c;return d.indicatorKey&&(s={position:"col",index:u}),(c=d.indicatorKey)!==null&&c!==void 0?c:d.value}),h=(r=l.rowHeaderPaths)===null||r===void 0?void 0:r.filter(d=>!d.virtual).map((d,u)=>{var c;return d.indicatorKey&&(s={position:"row",index:u}),(c=d.indicatorKey)!==null&&c!==void 0?c:d.value});return this.dataset.getAggregator(h,a,this.internalProps.layoutMap.getIndicatorKey(t,e),!1,s).records}if(this.flatDataToObjects){const s=this.internalProps.layoutMap.getCellHeaderPaths(t,e),l=s.colHeaderPaths.map(d=>{var u;return(u=d.indicatorKey)!==null&&u!==void 0?u:d.value}),a=s.rowHeaderPaths.map(d=>{var u;return(u=d.indicatorKey)!==null&&u!==void 0?u:d.value}),h=this.flatDataToObjects.getTreeNode(a,l,this.internalProps.layoutMap.getBody(t,e).indicatorKey,!1);return h==null?void 0:h.record}}}updateSortRules(t,e,n){this.internalProps.dataConfig?this.internalProps.dataConfig.sortRules=t:this.internalProps.dataConfig={sortRules:t},this.dataset.updateSortRules(t),this._changePivotSortStateBySortRules();const{layoutMap:o}=this.internalProps;o.resetHeaderTree(),this.scenegraph.clearCells(),ft(e)&&ft(n)?(this.isRowHeader(e,n)?(this.setMinMaxLimitWidth(!0),this.internalProps._widthResizedColMap.clear()):this.isCornerHeader(e,n)?o.cornerSetting.titleOnDimension==="column"?(this.setMinMaxLimitWidth(!0),this.internalProps._widthResizedColMap.clear()):o.cornerSetting.titleOnDimension==="row"&&this.internalProps._heightResizedRowMap.clear():this.isColumnHeader(e,n)&&this.internalProps._heightResizedRowMap.clear(),this.refreshRowColCount()):this.refreshHeader(),this.internalProps.useOneRowHeightFillAll=!1,this.scenegraph.createSceneGraph(!0),this.render()}_changePivotSortStateBySortRules(){var t,e,n,o;this.pivotSortState=[];const r=(e=(t=this.internalProps.dataConfig)===null||t===void 0?void 0:t.sortRules)!==null&&e!==void 0?e:[];for(let s=0;s<r.length;s++){const l=r[s],a=[];if(l.sortByIndicator&&l.sortField===(this.dataset.indicatorsAsCol?this.dataset.rows[this.dataset.rows.length-1]:this.dataset.columns[this.dataset.columns.length-1])){for(let d=0;d<l.query.length;d++)a.push({dimensionKey:this.dataset.indicatorsAsCol?this.dataset.columns[d]:this.dataset.rows[d],value:l.query[d]});a.push({indicatorKey:l.sortByIndicator,value:(o=(n=this.internalProps.layoutMap.getIndicatorInfo(l.sortByIndicator))===null||n===void 0?void 0:n.title)!==null&&o!==void 0?o:l.sortByIndicator})}else a.push({dimensionKey:l.sortField,isPivotCorner:!0,value:l.sortField});const h=l.sortType?l.sortType.toUpperCase():"ASC";this.pivotSortState.push({dimensions:a,order:gi[h]})}}_parseColumnWidthConfig(t){for(let e=0;e<(t==null?void 0:t.length);e++){const n=t[e],o=n.dimensions,r=n.width,s=this.getCellAddressByHeaderPaths(o);s&&!this.internalProps._widthResizedColMap.has(s.col)&&(this._setColWidth(s.col,r),this.internalProps._widthResizedColMap.add(s.col))}}updatePivotSortState(t){this.pivotSortState=t}sort(t,e,n){var o;let r;if(this.isCornerHeader(t,e)){const a=this.getHeaderDefine(t,e);r=[];const h={isPivotCorner:!0,dimensionKey:a.value,value:a.value};r.push(h)}else r=this.isColumnHeader(t,e)?this.getCellHeaderPaths(t,e).colHeaderPaths:this.getCellHeaderPaths(t,e).rowHeaderPaths;const s=r[r.length-1].indicatorKey,l=this.getHeaderDefine(t,e);if(l.sort){if(this.dataset.sortRules){const a={};for(let h=this.dataset.sortRules.length-1;h>=0;h--){const d=this.dataset.sortRules[h];l.dimensionKey&&d.sortField===l.dimensionKey?(a[d.sortField]=d,this.dataset.sortRules.splice(h,1)):s&&d.sortField===(this.dataset.indicatorsAsCol?this.dataset.rows[this.dataset.rows.length-1]:this.dataset.columns[this.dataset.columns.length-1])&&this.dataset.sortRules.splice(h,1)}s?this.dataset.sortRules.push({sortField:this.dataset.indicatorsAsCol?this.dataset.rows[this.dataset.rows.length-1]:this.dataset.columns[this.dataset.columns.length-1],sortType:gi[n],sortByIndicator:s,query:r.reduce((h,d)=>(d.dimensionKey&&h.push(d.value),h),[])}):this.dataset.sortRules.push(Object.assign((o=a[l.dimensionKey])!==null&&o!==void 0?o:{},{sortField:l.dimensionKey,sortType:gi[n]}))}else this.dataset.sortRules=s?[{sortField:this.dataset.indicatorsAsCol?this.dataset.rows[this.dataset.rows.length-1]:this.dataset.columns[this.dataset.columns.length-1],sortType:gi[n],sortByIndicator:s,query:r.reduce((a,h)=>(h.dimensionKey&&a.push(h.value),a),[])}]:[{sortField:l.dimensionKey,sortType:gi[n]}];this.updateSortRules(this.dataset.sortRules,t,e)}}getPivotSortState(t,e){if(!this.pivotSortState)return;const n=this.getCellRange(t,e);for(let o=0;o<this.pivotSortState.length;o++){const r=this.pivotSortState[o],s=r.dimensions,l=this.getCellAddressByHeaderPaths(s),a=r.order;if(l&&Yi(n,l.col,l.row))return a}}_moveHeaderPosition(t,e){const n=this.getCellRange(t.col,t.row),o=this.getCellRange(e.col,e.row),r=this.internalProps.layoutMap.moveHeaderPosition(t,e);if(r){if(r.moveType==="column"){if(this.internalProps.recordsIsTwoDimensionalArray)for(let s=0;s<this.internalProps.records.length;s++){const l=this.internalProps.records[s].splice(r.sourceIndex-this.rowHeaderLevelCount,r.sourceSize);l.unshift(r.targetIndex-this.rowHeaderLevelCount,0),Array.prototype.splice.apply(this.internalProps.records[s],l)}this.colWidthsMap.exchangeOrder(n.start.col,n.end.col-n.start.col+1,o.start.col,o.end.col-o.start.col+1,r.targetIndex),this.setMinMaxLimitWidth()}else if(r.moveType==="row"){if(this.internalProps.recordsIsTwoDimensionalArray){const s=this.internalProps.records.splice(r.sourceIndex-this.columnHeaderLevelCount,r.sourceSize);s.unshift(r.targetIndex-this.columnHeaderLevelCount,0),Array.prototype.splice.apply(this.internalProps.records,s)}r.targetIndex>r.sourceIndex?this.rowHeightsMap.exchangeOrder(r.sourceIndex,r.sourceSize,r.targetIndex+r.sourceSize-r.targetSize,r.targetSize,r.targetIndex):this.rowHeightsMap.exchangeOrder(r.sourceIndex,r.sourceSize,r.targetIndex,r.targetSize,r.targetIndex)}return r}return null}toggleHierarchyState(t,e,n=!0){const o=this.getHierarchyState(t,e);if(o===Vt.expand)this._refreshHierarchyState(t,e,n),this.fireListeners(rr.TREE_HIERARCHY_STATE_CHANGE,{col:t,row:e,hierarchyState:Vt.collapse});else if(o===Vt.collapse){const r=this.internalProps.layoutMap.getHeadNode(t,e);Array.isArray(r.children)&&this._refreshHierarchyState(t,e,n),this.fireListeners(rr.TREE_HIERARCHY_STATE_CHANGE,{col:t,row:e,hierarchyState:Vt.expand,originData:r})}}_refreshHierarchyState(t,e,n=!0,o){let r=!1,s=!1;this.stateManager.updateHoverIcon(t,e,void 0,void 0);const l=this.internalProps.layoutMap.checkHasChart();l&&(this.autoFillWidth&&(r=this.getAllColsWidth()<=this.tableNoFrameWidth),this.autoFillHeight&&(s=this.getAllRowsHeight()<=this.tableNoFrameHeight));const a=this.internalProps.layoutMap.toggleHierarchyState(t,e);o&&o(),this.refreshRowColCount(),this.clearCellStyleCache(),this.scenegraph.updateHierarchyIcon(t,e),this.scenegraph.updateRow(a.removeCellPositions,a.addCellPositions,a.updateCellPositions,n),l&&(this.autoFillWidth&&!r&&(r=this.getAllColsWidth()<=this.tableNoFrameWidth),this.autoFillHeight&&!s&&(s=this.getAllRowsHeight()<=this.tableNoFrameHeight),(this.widthMode==="adaptive"||r||this.heightMode==="adaptive"||s)&&this.scenegraph.updateChartSizeForResizeColWidth(-1))}getHeaderCellAddressByPath(t){return this.internalProps.layoutMap.getPivotCellAdress(t)}getCellAddressByHeaderPaths(t){return this.internalProps.layoutMap.getCellAdressByHeaderPath(t)}getHeaderPathByXY(t){let e;return e=t?this.getCellAt(t.x+this.getFrozenColsWidth()+this.scrollLeft+1,t.y+this.getFrozenRowsHeight()+this.scrollTop+1):this.getCellAt(this.getFrozenColsWidth()+this.scrollLeft+1,this.getFrozenRowsHeight()+this.scrollTop+1),this.internalProps.layoutMap.getCellHeaderPaths(e.col,e.row)}getHierarchyState(t,e){var n;return(n=this._getHeaderLayoutMap(t,e))===null||n===void 0?void 0:n.hierarchyState}getLayoutColumnTree(){return this.internalProps.layoutMap.getLayoutColumnTree()}getLayoutColumnTreeCount(){return this.internalProps.layoutMap.getLayoutColumnTreeCount()}getLayoutRowTree(){return this.internalProps.layoutMap.getLayoutRowTree()}getLayoutRowTreeCount(){return this.internalProps.layoutMap.getLayoutRowTreeCount()}getCellHeaderTreeNodes(t,e){return this.internalProps.layoutMap.getCellHeaderPathsWithTreeNode(t,e)}_hasHierarchyTreeHeader(){return this.internalProps.layoutMap.rowHierarchyType==="tree"}getMenuInfo(t,e,n){const o=this.internalProps.layoutMap.getPivotDimensionInfo(t,e);return{dimensionKey:o[o.length-1].dimensionKey,value:this.getCellValue(t,e),cellLocation:this.getCellLocation(t,e),isPivotCorner:this.isCornerHeader(t,e),event:void 0}}setRecords(t){var e,n,o,r,s;const l={col:this.stateManager.hover.cellPos.col,row:this.stateManager.hover.cellPos.row};this.options.records=this.internalProps.records=t,this.internalProps.recordsIsTwoDimensionalArray=!1,((e=t==null?void 0:t[0])===null||e===void 0?void 0:e.constructor)===Array&&(this.internalProps.recordsIsTwoDimensionalArray=!0);const a=this.options,h=this.internalProps;if(((n=this.options.customConfig)===null||n===void 0?void 0:n.enableDataAnalysis)===!1)this.internalProps.recordsIsTwoDimensionalArray===!1&&(this.flatDataToObjects=new pv({rows:h.layoutMap.fullRowDimensionKeys,columns:h.layoutMap.colDimensionKeys,indicators:h.layoutMap.indicatorKeys,indicatorsAsCol:h.layoutMap.indicatorsAsCol,indicatorDimensionKey:h.layoutMap.indicatorDimensionKey},t));else{let d,u;this.dataset.setRecords(t),d=a.columnTree?h.layoutMap.columnDimensionTree:new Pe((o=this.dataset.colHeaderTree)!==null&&o!==void 0?o:[],this.layoutNodeId),u=a.rowTree?h.layoutMap.rowDimensionTree:new Pe((r=this.dataset.rowHeaderTree)!==null&&r!==void 0?r:[],this.layoutNodeId,this.options.rowHierarchyType,this.options.rowHierarchyType==="tree"?(s=this.options.rowExpandLevel)!==null&&s!==void 0?s:1:void 0),h.layoutMap=new lr(this,this.dataset,d,u),this.pivotSortState=[],a.pivotSortState&&(this.pivotSortState=a.pivotSortState)}if(this.refreshHeader(),this.internalProps.useOneRowHeightFillAll=!1,this.scenegraph.clearCells(),this.clearCellStyleCache(),this.scenegraph.createSceneGraph(),this.stateManager.updateHoverPos(l.col,l.row),this.internalProps.title&&!this.internalProps.title.isReleased&&(this._updateSize(),this.internalProps.title.resize(),this.scenegraph.resize()),this.eventManager.updateEventBinder(),this.options.emptyTip)if(this.internalProps.emptyTip)this.internalProps.emptyTip.resetVisible();else{const d=Bt.getComponent("emptyTip");this.internalProps.emptyTip=new d(this.options.emptyTip,this),this.internalProps.emptyTip.resetVisible()}}startEditCell(t,e,n){var o;if(z(t)&&z(e))this.eventManager.isDraging=!1,this.selectCell(t,e),this.editorManager.startEditCell(t,e,n);else if(!((o=this.stateManager.select)===null||o===void 0)&&o.cellPos){const{col:r,row:s}=this.stateManager.select.cellPos;z(r)&&z(s)&&this.editorManager.startEditCell(r,s,n)}}completeEditCell(){this.editorManager.completeEdit()}getEditor(t,e){var n,o,r;let s;if(this.isCornerHeader(t,e)){const l=this.getHeaderDefine(t,e);s=(n=l==null?void 0:l.headerEditor)!==null&&n!==void 0?n:this.options.headerEditor}else if(this.isHeader(t,e)){const l=this.getHeaderDefine(t,e);s=(o=l==null?void 0:l.headerEditor)!==null&&o!==void 0?o:this.options.headerEditor}else{const l=this.getBodyColumnDefine(t,e);s=(r=l==null?void 0:l.editor)!==null&&r!==void 0?r:this.options.editor}return typeof s=="function"&&(s=s({col:t,row:e,dataValue:this.getCellOriginValue(t,e),value:this.getCellValue(t,e)||"",table:this})),typeof s=="string"?oT(s):s}isHasEditorDefine(t,e){var n;const o=this.getBodyColumnDefine(t,e);let r=(n=o==null?void 0:o.editor)!==null&&n!==void 0?n:this.options.editor;return typeof r=="function"&&(r=r({col:t,row:e,dataValue:this.getCellOriginValue(t,e),value:this.getCellValue(t,e)||"",table:this})),z(r)}changeCellValue(t,e,n,o=!1){if(o&&this.isHasEditorDefine(t,e)||o===!1){let r=n;const s=this.getCellOriginValue(t,e),l=this.getCellRawValue(t,e);typeof l=="number"&&lm(n)&&(r=parseFloat(n)),this._changeCellValueToDataSet(t,e,s,r);const a=this.getCellRange(t,e);for(let h=a.start.col;h<=a.end.col;h++)for(let d=a.start.row;d<=a.end.row;d++)this.scenegraph.updateCellContent(h,d);if(this.widthMode==="adaptive"||this.autoFillWidth&&this.getAllColsWidth()<=this.tableNoFrameWidth)this.internalProps._widthResizedColMap.size===0&&this.scenegraph.recalculateColWidths();else if(!this.internalProps._widthResizedColMap.has(t)){const h=this.getColWidth(t),d=Fr(t,0,this.rowCount-1,this,!1);d!==h&&this.scenegraph.updateColWidth(t,d-h)}if(this.heightMode==="adaptive"||this.autoFillHeight&&this.getAllRowsHeight()<=this.tableNoFrameHeight)this.internalProps._heightResizedRowMap.size===0&&this.scenegraph.recalculateRowHeights();else if(this.heightMode==="autoHeight"&&!this.internalProps._heightResizedRowMap.has(e)){const h=this.getRowHeight(e),d=nn(e,0,this.colCount-1,this);this.scenegraph.updateRowHeight(e,d-h)}this.fireListeners(at.CHANGE_CELL_VALUE,{col:t,row:e,rawValue:l,currentValue:s,changedValue:r}),this.scenegraph.updateNextFrame()}}changeCellValues(t,e,n,o=!1){let r=t,s=e;const l=[],a=[];for(let u=0;u<n.length&&!(e+u>this.rowCount-1);u++){const c=n[u],g=[],f=[];l.push(g),a.push(f);for(let p=0;p<c.length&&!(t+p>this.colCount-1);p++){const m=this.getCellRawValue(t+p,e+u);g.push(m);const b=this.getCellOriginValue(t+p,e+u);f.push(b)}}for(let u=0;u<n.length&&!(e+u>this.rowCount-1);u++){s=e+u;const c=n[u];let g=t;for(let f=0;f<c.length&&!(t+f>this.colCount-1);f++)if(g=t+f,o&&this.isHasEditorDefine(t+f,e+u)||o===!1){const p=c[f];let m=p;const b=a[u][f],C=l[u][f];typeof C=="number"&&lm(p)&&(m=parseFloat(p)),this._changeCellValueToDataSet(t+f,e+u,b,m),this.fireListeners(at.CHANGE_CELL_VALUE,{col:t+f,row:e+u,rawValue:C,currentValue:b,changedValue:this.getCellOriginValue(t+f,e+u)})}r=Math.max(r,g)}const h=this.getCellRange(t,e),d=this.getCellRange(r,s);for(let u=h.start.col;u<=d.end.col;u++)for(let c=h.start.row;c<=d.end.row;c++)this.scenegraph.updateCellContent(u,c);if(this.widthMode==="adaptive"||this.autoFillWidth&&this.getAllColsWidth()<=this.tableNoFrameWidth)this.internalProps._widthResizedColMap.size===0&&this.scenegraph.recalculateColWidths();else for(let u=t;u<=d.end.col;u++)if(!this.internalProps._widthResizedColMap.has(u)){const c=this.getColWidth(u),g=Fr(u,0,this.rowCount-1,this,!1);g!==c&&this.scenegraph.updateColWidth(u,g-c)}if(this.heightMode==="adaptive"||this.autoFillHeight&&this.getAllRowsHeight()<=this.tableNoFrameHeight)this.scenegraph.recalculateRowHeights();else if(this.heightMode==="autoHeight"){const u=[],c=[];for(let g=e;g<=d.end.row;g++)if(this.rowHeightsMap.get(g)){const f=this.getRowHeight(g),p=nn(g,0,this.colCount-1,this);u.push(g),c.push(p-f)}this.scenegraph.updateRowsHeight(u,c)}this.scenegraph.updateNextFrame()}_changeCellValueToDataSet(t,e,n,o){var r,s,l,a,h,d,u,c;if(this.internalProps.recordsIsTwoDimensionalArray){const g=this.getBodyIndexByRow(e),f=this.getBodyIndexByCol(t);this.records[g][f]=o}else if(this.dataset){const g=this.internalProps.layoutMap.getCellHeaderPaths(t,e);if(this.isCornerHeader(t,e))this.internalProps.layoutMap.changeCornerTitle(t,e,o);else if(this.isHeader(t,e))this.internalProps.layoutMap.changeTreeNodeTitle(t,e,o),!this.isCornerHeader(t,e)&&this.dataset.changeRecordFieldValue(!((r=g.colHeaderPaths)===null||r===void 0)&&r.length?(s=g.colHeaderPaths[g.colHeaderPaths.length-1].indicatorKey)!==null&&s!==void 0?s:g.colHeaderPaths[g.colHeaderPaths.length-1].dimensionKey:(l=g.rowHeaderPaths[g.rowHeaderPaths.length-1].indicatorKey)!==null&&l!==void 0?l:g.rowHeaderPaths[g.rowHeaderPaths.length-1].dimensionKey,n,o);else{const f=(a=g.colHeaderPaths)===null||a===void 0?void 0:a.filter(m=>!m.virtual).map(m=>{var b;return(b=m.indicatorKey)!==null&&b!==void 0?b:m.value}),p=(h=g.rowHeaderPaths)===null||h===void 0?void 0:h.filter(m=>!m.virtual).map(m=>{var b;return(b=m.indicatorKey)!==null&&b!==void 0?b:m.value});this.dataset.changeTreeNodeValue(this.internalProps.layoutMap.indicatorsAsCol?p:p.slice(0,-1),this.internalProps.layoutMap.indicatorsAsCol?f.slice(0,-1):f,this.internalProps.layoutMap.getIndicatorKey(t,e),o)}}else if(this.flatDataToObjects){const g=this.internalProps.layoutMap.getCellHeaderPaths(t,e);if(this.isHeader(t,e))this.internalProps.layoutMap.changeTreeNodeTitle(t,e,o),!this.isCornerHeader(t,e)&&this.flatDataToObjects.changeRecordFieldValue(!((d=g.colHeaderPaths)===null||d===void 0)&&d.length?(u=g.colHeaderPaths[g.colHeaderPaths.length-1].indicatorKey)!==null&&u!==void 0?u:g.colHeaderPaths[g.colHeaderPaths.length-1].dimensionKey:(c=g.rowHeaderPaths[g.rowHeaderPaths.length-1].indicatorKey)!==null&&c!==void 0?c:g.rowHeaderPaths[g.rowHeaderPaths.length-1].dimensionKey,n,o);else{const f=g.colHeaderPaths.map(m=>{var b;return(b=m.indicatorKey)!==null&&b!==void 0?b:m.value}),p=g.rowHeaderPaths.map(m=>{var b;return(b=m.indicatorKey)!==null&&b!==void 0?b:m.value});this.flatDataToObjects.changeTreeNodeValue(p,f,this.internalProps.layoutMap.getBody(t,e).indicatorKey,o)}}}_hasCustomRenderOrLayout(){if(this.options.customRender)return!0;const{columnsDefine:t,rowsDefine:e,indicatorsDefine:n}=this.internalProps.layoutMap;for(let o=0;o<t.length;o++){const r=t[o];if(typeof r!="string"&&(r.headerCustomLayout||r.headerCustomRender))return!0}for(let o=0;o<e.length;o++){const r=e[o];if(typeof r!="string"&&(r.headerCustomLayout||r.headerCustomRender))return!0}for(let o=0;o<n.length;o++){const r=n[o];if(typeof r!="string"&&(r.customLayout||r.headerCustomLayout||r.customRender||r.headerCustomRender))return!0}return!1}changeRecordOrder(t,e){}setTreeNodeChildren(t,e,n,o){this.flatDataToObjects?(this.internalProps.layoutMap.getHeadNode(n,o).children=t,this._refreshHierarchyState(n,o,!0,()=>{this.flatDataToObjects.changeDataConfig({rows:this.internalProps.layoutMap.fullRowDimensionKeys,columns:this.internalProps.layoutMap.colDimensionKeys,indicators:this.internalProps.layoutMap.indicatorKeys,indicatorsAsCol:this.internalProps.layoutMap.indicatorsAsCol,indicatorDimensionKey:this.internalProps.layoutMap.indicatorDimensionKey}),this.flatDataToObjects.addRecords(e)})):(this.internalProps.layoutMap.getHeadNode(n,o).children=t,this._refreshHierarchyState(n,o,!0,()=>{this.dataset._rowTreeHasChanged(),this.dataset.changeDataConfig({rows:this.internalProps.layoutMap.fullRowDimensionKeys,columns:this.internalProps.layoutMap.colDimensionKeys}),this.dataset.addRecords(e)}))}updateFilterRules(t){this.internalProps.dataConfig.filterRules=t,this.dataset.updateFilterRules(t),this.renderWithRecreateCells()}getFilteredRecords(){var t;return(t=this.dataset)===null||t===void 0?void 0:t.filterRules}};Mg(),Bg(),Pg(),Hg(),Eg(),Lg(),kg(),Fg(),Ig(),Dg(),Og(),zg(),Il(),Wg();class BT extends MT{}Il();class W9 extends MT{}Mg(),Bg(),Pg(),Hg(),Eg(),Lg(),kg(),Fg(),Ig(),Dg(),Og(),zg(),Il(),Wg();let N9=class extends Cg{constructor(t,e){var n,o,r,s,l,a,h,d,u,c,g,f,p,m,b,C,_,w;let y,S;oe.mode==="node"?(e=t,t=null):t instanceof HTMLElement||(e=t,t=t.container?t.container:null),super(t,e),this.layoutNodeId={seqId:0},this._selectedDataItemsInChart=[],this._selectedDimensionInChart=[],this._chartEventMap={},e.layout&&Object.assign(e,e.layout),this.internalProps.columns=Ee(e.columns),this.internalProps.rows=Ee(e.rows),this.internalProps.indicators=ho(e.indicators),this.internalProps.columnTree=!e.indicatorsAsCol||!((n=e.columns)===null||n===void 0)&&n.length||e.columnTree?Ee(e.columnTree):[],this.internalProps.rowTree=e.indicatorsAsCol||!((o=e.rows)===null||o===void 0)&&o.length||e.rowTree?Ee(e.rowTree):[],this.internalProps.records=e.records,this.setCustomStateNameToSpec(),this.internalProps.columnResizeType=(r=e.columnResizeType)!==null&&r!==void 0?r:"column",this.internalProps.rowResizeType=(s=e.rowResizeType)!==null&&s!==void 0?s:"row",this.internalProps.dataConfig={isPivotChart:!0},this._axes=lt(e.axes)?e.axes:[],e.columnTree&&(e.indicatorsAsCol!==!1&&(this.internalProps.columnTree=Vi(this.internalProps.columnTree,e.indicators)),y=new Pe((l=this.internalProps.columnTree)!==null&&l!==void 0?l:[],this.layoutNodeId)),e.rowTree&&(e.indicatorsAsCol===!1&&(this.internalProps.rowTree=Vi(this.internalProps.rowTree,e.indicators)),S=new Pe((a=this.internalProps.rowTree)!==null&&a!==void 0?a:[],this.layoutNodeId));const A=!((h=S==null?void 0:S.dimensionKeys)===null||h===void 0)&&h.count?S.dimensionKeys.valueArr():(u=(d=e.rows)===null||d===void 0?void 0:d.reduce((T,M)=>(typeof M=="string"?T.push(M):T.push(M.dimensionKey),T),[]))!==null&&u!==void 0?u:[],R=!((c=y==null?void 0:y.dimensionKeys)===null||c===void 0)&&c.count?y.dimensionKeys.valueArr():(f=(g=e.columns)===null||g===void 0?void 0:g.reduce((T,M)=>(typeof M=="string"?T.push(M):T.push(M.dimensionKey),T),[]))!==null&&f!==void 0?f:[],x=(m=(p=e.indicators)===null||p===void 0?void 0:p.reduce((T,M)=>(typeof M=="string"?T.push(M):T.push(M.indicatorKey),T),[]))!==null&&m!==void 0?m:[];if(this.internalProps.dataConfig.collectValuesBy=this._generateCollectValuesConfig(R,A),this.internalProps.dataConfig.aggregationRules=this._generateAggregationRules(),this.internalProps.dataConfig.dimensionSortArray=this._getDimensionSortArray(),this.dataset=new Ih(this.internalProps.dataConfig,A,R,x,this.internalProps.indicators,(b=e.indicatorsAsCol)===null||b===void 0||b,e.records,void 0,this.internalProps.columnTree,this.internalProps.rowTree,!0),this.options.indicatorsAsCol&&Lh(this.internalProps.indicators)){const T=M=>{M.forEach(B=>{var P;!((P=B.children)===null||P===void 0)&&P.length?T(B.children):B.children=[{dimensionKey:"axis",value:""}]})};!((C=this.dataset.rowHeaderTree)===null||C===void 0)&&C.length?T(this.dataset.rowHeaderTree):this.dataset.rowHeaderTree=[{dimensionKey:"axis",value:""}]}if(e.columnTree||e.indicatorsAsCol!==!1&&(this.dataset.colHeaderTree=Vi(this.dataset.colHeaderTree,e.indicators)),e.rowTree||e.indicatorsAsCol===!1&&(this.dataset.rowHeaderTree=Vi(this.dataset.rowHeaderTree,e.indicators)),y=new Pe((_=this.dataset.colHeaderTree)!==null&&_!==void 0?_:[],this.layoutNodeId),S=new Pe((w=this.dataset.rowHeaderTree)!==null&&w!==void 0?w:[],this.layoutNodeId),this.internalProps.layoutMap=new lr(this,this.dataset,y,S),this.refreshHeader(),this.internalProps.useOneRowHeightFillAll=!1,this.scenegraph.createSceneGraph(),e.title){const T=Bt.getComponent("title");this.internalProps.title=new T(e.title,this),this.scenegraph.resize()}if(this.options.emptyTip)if(this.internalProps.emptyTip)this.internalProps.emptyTip.resetVisible();else{const T=Bt.getComponent("emptyTip");this.internalProps.emptyTip=new T(this.options.emptyTip,this),this.internalProps.emptyTip.resetVisible()}setTimeout(()=>{this.fireListeners(at.INITIALIZED,null)},0)}static get EVENT_TYPE(){return SA}get pivotChartAxes(){return this._axes}get recordsCount(){var t;return(t=this.records)===null||t===void 0?void 0:t.length}isListTable(){return!1}isPivotTable(){return!0}isPivotChart(){return!0}_canResizeColumn(t,e){const n=super._canResizeColumn(t,e);if(n&&!this.internalProps.layoutMap.indicatorsAsCol){const o=this.internalProps.layoutMap.getBody(t,this.columnHeaderLevelCount);if(o!=null&&o.disableColumnResize)return!1}return n}updateOption(t){var e,n,o,r,s,l,a,h,d,u,c,g,f,p,m,b,C,_,w,y;const S=this.internalProps;let A,R;super.updateOption(t),this.layoutNodeId={seqId:0},this.internalProps.columns=Ee(t.columns),this.internalProps.rows=Ee(t.rows),this.internalProps.indicators=!((e=t.indicators)===null||e===void 0)&&e.length?ho(t.indicators):[],this.internalProps.columnTree=!t.indicatorsAsCol||!((n=t.columns)===null||n===void 0)&&n.length||t.columnTree?Ee(t.columnTree):[],this.internalProps.rowTree=t.indicatorsAsCol||!((o=t.rows)===null||o===void 0)&&o.length||t.rowTree?Ee(t.rowTree):[],t.records&&(this.internalProps.records=t.records),this.setCustomStateNameToSpec(),this._selectedDataItemsInChart=[],S.columnResizeType=(r=t.columnResizeType)!==null&&r!==void 0?r:"column",S.rowResizeType=(s=t.rowResizeType)!==null&&s!==void 0?s:"row",S.dataConfig={isPivotChart:!0},this._axes=lt(t.axes)?t.axes:[],t.columnTree&&(t.indicatorsAsCol!==!1&&(this.internalProps.columnTree=Vi(this.internalProps.columnTree,t.indicators)),A=new Pe((l=this.internalProps.columnTree)!==null&&l!==void 0?l:[],this.layoutNodeId)),t.rowTree&&(t.indicatorsAsCol===!1&&(this.internalProps.rowTree=Vi(this.internalProps.rowTree,t.indicators)),R=new Pe((a=this.internalProps.rowTree)!==null&&a!==void 0?a:[],this.layoutNodeId));const x=!((h=R==null?void 0:R.dimensionKeys)===null||h===void 0)&&h.count?R.dimensionKeys.valueArr():(u=(d=t.rows)===null||d===void 0?void 0:d.reduce((B,P)=>(typeof P=="string"?B.push(P):B.push(P.dimensionKey),B),[]))!==null&&u!==void 0?u:[],T=!((c=A==null?void 0:A.dimensionKeys)===null||c===void 0)&&c.count?A.dimensionKeys.valueArr():(f=(g=t.columns)===null||g===void 0?void 0:g.reduce((B,P)=>(typeof P=="string"?B.push(P):B.push(P.dimensionKey),B),[]))!==null&&f!==void 0?f:[],M=(m=(p=t.indicators)===null||p===void 0?void 0:p.reduce((B,P)=>(typeof P=="string"?B.push(P):B.push(P.indicatorKey),B),[]))!==null&&m!==void 0?m:[];if(this.internalProps.dataConfig.collectValuesBy=this._generateCollectValuesConfig(T,x),this.internalProps.dataConfig.aggregationRules=this._generateAggregationRules(),this.internalProps.dataConfig.dimensionSortArray=this._getDimensionSortArray(),this.dataset=new Ih(this.internalProps.dataConfig,x,T,M,this.internalProps.indicators,(b=t.indicatorsAsCol)===null||b===void 0||b,(C=t.records)!==null&&C!==void 0?C:this.internalProps.records,void 0,this.internalProps.columnTree,this.internalProps.rowTree,!0),this.options.indicatorsAsCol&&Lh(this.internalProps.indicators)){const B=P=>{P.forEach(F=>{var H;!((H=F.children)===null||H===void 0)&&H.length?B(F.children):F.children=[{dimensionKey:"axis",value:""}]})};!((_=this.dataset.rowHeaderTree)===null||_===void 0)&&_.length?B(this.dataset.rowHeaderTree):this.dataset.rowHeaderTree=[{dimensionKey:"axis",value:""}]}if(t.columnTree||t.indicatorsAsCol!==!1&&(this.dataset.colHeaderTree=Vi(this.dataset.colHeaderTree,t.indicators)),t.rowTree||t.indicatorsAsCol===!1&&(this.dataset.rowHeaderTree=Vi(this.dataset.rowHeaderTree,t.indicators)),A=new Pe((w=this.dataset.colHeaderTree)!==null&&w!==void 0?w:[],this.layoutNodeId),R=new Pe((y=this.dataset.rowHeaderTree)!==null&&y!==void 0?y:[],this.layoutNodeId),S.layoutMap=new lr(this,this.dataset,A,R),this.refreshHeader(),this.internalProps.useOneRowHeightFillAll=!1,S.releaseList&&(S.releaseList.forEach(B=>{var P;return(P=B==null?void 0:B.release)===null||P===void 0?void 0:P.call(B)}),S.releaseList=null),this.scenegraph.clearCells(),this.scenegraph.createSceneGraph(),t.title){const B=Bt.getComponent("title");this.internalProps.title=new B(t.title,this),this.scenegraph.resize()}if(this.options.emptyTip)if(this.internalProps.emptyTip)this.internalProps.emptyTip.resetVisible();else{const B=Bt.getComponent("emptyTip");this.internalProps.emptyTip=new B(this.options.emptyTip,this),this.internalProps.emptyTip.resetVisible()}return new Promise(B=>{setTimeout(B,0)})}updatePagination(){}refreshHeader(){this.setMinMaxLimitWidth(!0),this.refreshRowColCount()}refreshRowColCount(){var t,e,n,o,r,s,l,a;const h=this,{layoutMap:d}=h.internalProps;d&&(h.colCount=(t=d.colCount)!==null&&t!==void 0?t:0,h.rowCount=(e=d.rowCount)!==null&&e!==void 0?e:0,h.internalProps.frozenColCount=(n=d.rowHeaderLevelCount)!==null&&n!==void 0?n:0,h.frozenRowCount=Math.max(d.headerLevelCount,(o=this.options.frozenRowCount)!==null&&o!==void 0?o:0),h.bottomFrozenRowCount!==((r=d==null?void 0:d.bottomFrozenRowCount)!==null&&r!==void 0?r:0)&&(h.bottomFrozenRowCount=(s=d==null?void 0:d.bottomFrozenRowCount)!==null&&s!==void 0?s:0),h.rightFrozenColCount!==((l=d==null?void 0:d.rightFrozenColCount)!==null&&l!==void 0?l:0)&&(h.rightFrozenColCount=(a=d==null?void 0:d.rightFrozenColCount)!==null&&a!==void 0?a:0),this.stateManager.setFrozenCol(this.internalProps.frozenColCount))}_getSortFuncFromHeaderOption(t,e,n){}syncHierarchyState(t,e){var n,o;t.value===e.value&&t.dimensionKey===e.dimensionKey&&(e.hierarchyState=(n=e.hierarchyState)!==null&&n!==void 0?n:e!=null&&e.children?t.hierarchyState:void 0,(o=e==null?void 0:e.children)===null||o===void 0||o.forEach((r,s)=>{var l;!((l=t==null?void 0:t.children)===null||l===void 0)&&l[s]&&r&&this.syncHierarchyState(t.children[s],r)}))}getRecordShowIndexByCell(t,e){}getTableIndexByRecordIndex(t){}getTableIndexByField(t){}getCellAddrByFieldRecord(t,e){}getBodyIndexByRow(t){const{layoutMap:e}=this.internalProps;return e.getBodyIndexByRow(t)}getBodyIndexByCol(t){const{layoutMap:e}=this.internalProps;return e.getBodyIndexByCol(t)}getCellValue(t,e,n){var o,r,s;if(!n){const u=this.getCustomMergeValue(t,e);if(u)return u}if(this.internalProps.layoutMap.isHeader(t,e)){if(this.internalProps.layoutMap.isBottomFrozenRow(t,e)||this.internalProps.layoutMap.isRightFrozenColumn(t,e)){const g=this.internalProps.layoutMap.getIndicatorKeyInChartSpec(t,e);let f;return g==null||g.forEach(p=>{const m=this.internalProps.layoutMap.getIndicatorInfo(p);m&&(f=m)}),(r=(o=f==null?void 0:f.title)!==null&&o!==void 0?o:f==null?void 0:f.indicatorKey)!==null&&r!==void 0?r:""}const{title:u,fieldFormat:c}=this.internalProps.layoutMap.getHeader(t,e);return typeof c=="function"?c(u,t,e,this):u}if(this.dataset){let u;const c=this.internalProps.layoutMap.getCellHeaderPaths(t,e),g=c.colHeaderPaths.map((m,b)=>{var C;return m.indicatorKey&&(u={position:"col",index:b}),(C=m.indicatorKey)!==null&&C!==void 0?C:m.value}),f=c.rowHeaderPaths.map((m,b)=>{var C;return m.indicatorKey&&(u={position:"row",index:b}),(C=m.indicatorKey)!==null&&C!==void 0?C:m.value}),p=this.dataset.getAggregator(f,g,this.internalProps.layoutMap.getIndicatorKey(t,e),!0,u);return p.value?p.value():void 0}const{fieldFormat:l}=this.internalProps.layoutMap.getBody(t,e),a=this.getBodyIndexByRow(e),h=this.getBodyIndexByCol(t),d=(s=this.records[a])===null||s===void 0?void 0:s[h];return typeof l=="function"?l(d,t,e,this):d}getCellOriginValue(t,e){var n,o,r;const s=this;if(s.internalProps.layoutMap.isHeader(t,e)){if(this.internalProps.layoutMap.isBottomFrozenRow(t,e)||this.internalProps.layoutMap.isRightFrozenColumn(t,e)){const d=this.internalProps.layoutMap.getIndicatorKeyInChartSpec(t,e);let u;return d==null||d.forEach(c=>{const g=this.internalProps.layoutMap.getIndicatorInfo(c);g&&(u=g)}),(o=(n=u==null?void 0:u.title)!==null&&n!==void 0?n:u==null?void 0:u.indicatorKey)!==null&&o!==void 0?o:""}const{title:h}=s.internalProps.layoutMap.getHeader(t,e);return typeof h=="function"?h():h}if(this.dataset){let h;const d=this.internalProps.layoutMap.getCellHeaderPaths(t,e),u=d.colHeaderPaths.map((f,p)=>{var m;return f.indicatorKey&&(h={position:"col",index:p}),(m=f.indicatorKey)!==null&&m!==void 0?m:f.value}),c=d.rowHeaderPaths.map((f,p)=>{var m;return f.indicatorKey&&(h={position:"row",index:p}),(m=f.indicatorKey)!==null&&m!==void 0?m:f.value}),g=this.dataset.getAggregator(c,u,this.internalProps.layoutMap.getIndicatorKey(t,e),!0,h);return g.value?g.value():void 0}const l=this.getBodyIndexByRow(e),a=this.getBodyIndexByCol(t);return(r=this.records[l])===null||r===void 0?void 0:r[a]}getCellRawValue(t,e){return this.getCellOriginValue(t,e)}getCellOriginRecord(t,e){if(!this.internalProps.layoutMap.isHeader(t,e)&&this.dataset){let n;const o=this.internalProps.layoutMap.getCellHeaderPaths(t,e),r=o.colHeaderPaths.map((l,a)=>{var h;return l.indicatorKey&&(n={position:"col",index:a}),(h=l.indicatorKey)!==null&&h!==void 0?h:l.value}),s=o.rowHeaderPaths.map((l,a)=>{var h;return l.indicatorKey&&(n={position:"row",index:a}),(h=l.indicatorKey)!==null&&h!==void 0?h:l.value});return this.dataset.getAggregator(s,r,this.internalProps.layoutMap.getIndicatorKey(t,e),!0,n).records}}getCellRawRecord(t,e){return this.getCellOriginRecord(t,e)}getPivotSortState(t,e){if(!this.pivotSortState)return;const n=this.getCellRange(t,e);for(let o=0;o<this.pivotSortState.length;o++){const{col:r,row:s,order:l}=this.pivotSortState[o];if(Yi(n,r,s))return l}}_moveHeaderPosition(t,e){var n,o,r,s;const l=this.internalProps.layoutMap.moveHeaderPosition(t,e);if(l){if(l.moveType==="column"){if(((o=(n=this.options.records)===null||n===void 0?void 0:n[0])===null||o===void 0?void 0:o.constructor)===Array)for(let a=0;a<this.internalProps.records.length;a++){const h=this.internalProps.records[a].splice(l.sourceIndex-this.rowHeaderLevelCount,l.sourceSize);h.unshift(l.targetIndex-this.rowHeaderLevelCount,0),Array.prototype.splice.apply(this.internalProps.records[a],h)}this.colWidthsMap.adjustOrder(l.sourceIndex,l.targetIndex,l.sourceSize),this.setMinMaxLimitWidth()}else if(l.moveType==="row"){if(((s=(r=this.options.records)===null||r===void 0?void 0:r[0])===null||s===void 0?void 0:s.constructor)===Array){const a=this.internalProps.records.splice(l.sourceIndex-this.columnHeaderLevelCount,l.sourceSize);a.unshift(l.targetIndex-this.columnHeaderLevelCount,0),Array.prototype.splice.apply(this.internalProps.records,a)}this.rowHeightsMap.adjustOrder(l.sourceIndex,l.targetIndex,l.sourceSize)}return l}return null}toggleHierarchyState(t,e,n=!0){}getHeaderCellAddressByPath(t){return this.internalProps.layoutMap.getPivotCellAdress(t)}getCellAddressByHeaderPaths(t){return this.internalProps.layoutMap.getCellAdressByHeaderPath(t)}getHeaderPathByXY(t){let e;return e=t?this.getCellAt(t.x+this.getFrozenColsWidth()+this.scrollLeft+1,t.y+this.getFrozenRowsHeight()+this.scrollTop+1):this.getCellAt(this.getFrozenColsWidth()+this.scrollLeft+1,this.getFrozenRowsHeight()+this.scrollTop+1),this.internalProps.layoutMap.getCellHeaderPaths(e.col,e.row)}getHierarchyState(t,e){var n;return(n=this._getHeaderLayoutMap(t,e))===null||n===void 0?void 0:n.hierarchyState}_hasHierarchyTreeHeader(){return this.internalProps.layoutMap.rowHierarchyType==="tree"}getMenuInfo(t,e,n){const o=this.internalProps.layoutMap.getPivotDimensionInfo(t,e);return{dimensionKey:o[o.length-1].dimensionKey,value:this.getCellValue(t,e),cellLocation:this.getCellLocation(t,e),isPivotCorner:this.isCornerHeader(t,e),event:void 0}}_generateCollectValuesConfig(t,e){var n,o,r,s,l,a,h,d,u,c,g,f,p,m,b,C,_;t=t.filter(S=>S!==Xi),e=e.filter(S=>S!==Xi);const w=this.internalProps.indicators,y={};for(let S=0,A=w==null?void 0:w.length;S<A;S++)if(typeof w[S]!="string"&&w[S].chartSpec){if(((n=w[S].chartSpec)===null||n===void 0?void 0:n.type)==="pie"||((o=w[S].chartSpec)===null||o===void 0?void 0:o.type)==="rose"||((r=w[S].chartSpec)===null||r===void 0?void 0:r.type)==="radar"||((s=w[S].chartSpec)===null||s===void 0?void 0:s.type)==="gauge"||((l=w[S].chartSpec)===null||l===void 0?void 0:l.type)==="wordCloud")continue;const R=w[S],x=R.chartSpec;if(this.options.indicatorsAsCol===!1)if((x==null?void 0:x.stack)!==!1&&((x==null?void 0:x.type)==="bar"||(x==null?void 0:x.type)==="area")&&(x.stack=!0),y[R.indicatorKey]={by:e,range:!0,sumBy:(x==null?void 0:x.stack)&&t.concat(x==null?void 0:x.xField)},x.series)x.series.forEach(T=>{var M,B,P,F,H,E,k,I,L,D,O,N,W,$;const U=typeof T.xField=="string"?T.xField:T.xField[0];y[U]={by:t,type:T.direction!=="horizontal"?"xField":void 0,range:As(T,this._axes,T.direction==="horizontal",!0),sortBy:T.direction!=="horizontal"?(F=(P=(B=(M=T==null?void 0:T.data)===null||M===void 0?void 0:M.fields)===null||B===void 0?void 0:B[U])===null||P===void 0?void 0:P.domain)!==null&&F!==void 0?F:(k=(E=(H=x==null?void 0:x.data)===null||H===void 0?void 0:H.fields)===null||E===void 0?void 0:E[U])===null||k===void 0?void 0:k.domain:void 0};const Y=T.yField;T.stack!==!1&&(T.type==="bar"||T.type==="area")&&(T.stack=!0),y[Y]={by:e,range:As(T,this._axes,T.direction==="horizontal",!1),sumBy:T.stack&&t.concat(T==null?void 0:T.xField),sortBy:T.direction==="horizontal"?(O=(D=(L=(I=T==null?void 0:T.data)===null||I===void 0?void 0:I.fields)===null||L===void 0?void 0:L[Y])===null||D===void 0?void 0:D.domain)!==null&&O!==void 0?O:($=(W=(N=x==null?void 0:x.data)===null||N===void 0?void 0:N.fields)===null||W===void 0?void 0:W[Y])===null||$===void 0?void 0:$.domain:void 0,extendRange:Ac(x.markLine)}});else{const T=typeof x.xField=="string"?x.xField:x.xField[0];y[T]={by:t,type:x.direction!=="horizontal"?"xField":void 0,range:As(x,this._axes,x.direction==="horizontal",!0),sortBy:x.direction!=="horizontal"?(d=(h=(a=x==null?void 0:x.data)===null||a===void 0?void 0:a.fields)===null||h===void 0?void 0:h[T])===null||d===void 0?void 0:d.domain:void 0},(x==null?void 0:x.stack)!==!1&&((x==null?void 0:x.type)==="bar"||(x==null?void 0:x.type)==="area")&&(x.stack=!0);const M=x.yField;y[M]={by:e,range:x.direction!=="horizontal",sumBy:x.stack&&t.concat(x==null?void 0:x.xField),sortBy:x.direction==="horizontal"?(g=(c=(u=x==null?void 0:x.data)===null||u===void 0?void 0:u.fields)===null||c===void 0?void 0:c[M])===null||g===void 0?void 0:g.domain:void 0,extendRange:Ac(x.markLine)}}else{const T=w[S];if((x==null?void 0:x.stack)!==!1&&((x==null?void 0:x.type)==="bar"||(x==null?void 0:x.type)==="area")&&(x.stack=!0),y[T.indicatorKey]={by:t,range:!0,sumBy:(x==null?void 0:x.stack)&&e.concat(x==null?void 0:x.yField)},x.series)x.series.forEach(M=>{var B,P,F,H,E,k,I,L,D,O,N,W,$,U;const Y=typeof M.yField=="string"?M.yField:M.yField[0];y[Y]={by:e,type:M.direction==="horizontal"?"yField":void 0,range:As(M,this._axes,M.direction==="horizontal",!1),sortBy:M.direction==="horizontal"?(H=(F=(P=(B=M==null?void 0:M.data)===null||B===void 0?void 0:B.fields)===null||P===void 0?void 0:P[Y])===null||F===void 0?void 0:F.domain)!==null&&H!==void 0?H:(I=(k=(E=x==null?void 0:x.data)===null||E===void 0?void 0:E.fields)===null||k===void 0?void 0:k[Y])===null||I===void 0?void 0:I.domain:void 0};const j=M.xField;M.stack!==!1&&(M.type==="bar"||M.type==="area")&&(M.stack=!0),y[j]={by:t,range:As(M,this._axes,M.direction==="horizontal",!0),sumBy:M.stack&&e.concat(M==null?void 0:M.yField),sortBy:M.direction!=="horizontal"?(N=(O=(D=(L=M==null?void 0:M.data)===null||L===void 0?void 0:L.fields)===null||D===void 0?void 0:D[j])===null||O===void 0?void 0:O.domain)!==null&&N!==void 0?N:(U=($=(W=x==null?void 0:x.data)===null||W===void 0?void 0:W.fields)===null||$===void 0?void 0:$[j])===null||U===void 0?void 0:U.domain:void 0,extendRange:Ac(x.markLine)}});else{const M=typeof x.yField=="string"?x.yField:x.yField[0];y[M]={by:e,type:x.direction==="horizontal"?"yField":void 0,range:As(x,this._axes,x.direction==="horizontal",!1),sortBy:x.direction==="horizontal"?(m=(p=(f=x==null?void 0:x.data)===null||f===void 0?void 0:f.fields)===null||p===void 0?void 0:p[M])===null||m===void 0?void 0:m.domain:void 0},(x==null?void 0:x.stack)!==!1&&((x==null?void 0:x.type)==="bar"||(x==null?void 0:x.type)==="area")&&(x.stack=!0);const B=x.xField;y[B]={by:t,range:As(x,this._axes,x.direction==="horizontal",!0),sumBy:x.stack&&e.concat(x==null?void 0:x.yField),sortBy:x.direction!=="horizontal"?(_=(C=(b=x==null?void 0:x.data)===null||b===void 0?void 0:b.fields)===null||C===void 0?void 0:C[B])===null||_===void 0?void 0:_.domain:void 0,extendRange:Ac(x.markLine)}}}}return y}_generateAggregationRules(){var t;const e=[];return(t=this.internalProps.indicators)===null||t===void 0||t.forEach(n=>{var o,r;if(typeof n=="string")e.push({indicatorKey:n,field:n,aggregationType:zt.RECORD});else if(!((o=n.chartSpec)===null||o===void 0)&&o.series){const s=[];(r=n.chartSpec)===null||r===void 0||r.series.forEach(l=>{const a=this.options.indicatorsAsCol===!1?l.yField:l.xField;s.indexOf(a)===-1&&s.push(a)}),e.push({indicatorKey:n.indicatorKey,field:s,aggregationType:zt.RECORD})}else{const s=this.options.indicatorsAsCol===!1?n.chartSpec.yField:n.chartSpec.xField;e.push({indicatorKey:n.indicatorKey,field:s??n.indicatorKey,aggregationType:zt.RECORD})}}),e}setCustomStateNameToSpec(){var t;const e=n=>{var o,r,s,l,a,h,d,u,c,g;!((r=(o=n.bar)===null||o===void 0?void 0:o.state)===null||r===void 0)&&r.selected&&(n.bar.state.vtable_selected=n.bar.state.selected,n.bar.state.vtable_selected_reverse=n.bar.state.selected_reverse,delete n.bar.state.selected,delete n.bar.state.selected_reverse),!((l=(s=n.point)===null||s===void 0?void 0:s.state)===null||l===void 0)&&l.selected&&(n.point.state.vtable_selected=n.point.state.selected,n.point.state.vtable_selected_reverse=n.point.state.selected_reverse,delete n.point.state.selected,delete n.point.state.selected_reverse),!((h=(a=n.line)===null||a===void 0?void 0:a.state)===null||h===void 0)&&h.selected&&(n.line.state.vtable_selected=n.line.state.selected,n.line.state.vtable_selected_reverse=n.line.state.selected_reverse,delete n.line.state.selected,delete n.line.state.selected_reverse),!((u=(d=n.area)===null||d===void 0?void 0:d.state)===null||u===void 0)&&u.selected&&(n.area.state.vtable_selected=n.area.state.selected,n.area.state.vtable_selected_reverse=n.area.state.selected_reverse,delete n.area.state.selected,delete n.area.state.selected_reverse),!((g=(c=n.pie)===null||c===void 0?void 0:c.state)===null||g===void 0)&&g.selected&&(n.pie.state.vtable_selected=n.pie.state.selected,n.pie.state.vtable_selected_reverse=n.pie.state.selected_reverse,delete n.pie.state.selected,delete n.pie.state.selected_reverse)};(t=this.internalProps.indicators)===null||t===void 0||t.forEach(n=>{if(n.chartSpec){const o=n.chartSpec;o.series?o.series.forEach(r=>{e(r)}):e(o)}})}updateFilterRules(t){this.internalProps.dataConfig.filterRules=t,this.dataset.updateFilterRules(t),Th(this.scenegraph),PN(this.scenegraph),this.render()}clearChartCacheImage(t,e){ft(t)&&ft(e)?BN(t,e,this.scenegraph):Th(this.scenegraph)}getLegendSelected(){var t;const e=[];return(t=this.internalProps.legends)===null||t===void 0||t.forEach(n=>{const o=n.legendComponent._getSelectedLegends().map(r=>r.label);e.push(...o)}),e}setLegendSelected(t){var e;(e=this.internalProps.legends)===null||e===void 0||e.forEach(n=>{n.legendComponent.setSelected(t)})}getChartDatumPosition(t,e){const{chartInstance:n,bounds:o}=this.getChartInstance(e);if(n){const r=n.convertDatumToPosition(t);return r?{x:Math.round(r.x+o.x1),y:Math.round(r.y+o.y1)}:null}return null}getCellAddressByRecord(t){const e=[],n=[],o={},r=[];this.dataset.dataConfig.aggregationRules.forEach(s=>{if(typeof s.field=="string")o[s.field]=s.indicatorKey,r.push(s.field);else for(let l=0;l<s.field.length;l++)o[s.field[l]]=s.indicatorKey,r.push(s.field[l])});for(const s in t)this.dataset.rows.indexOf(s)>=0&&e.push({dimensionKey:s,value:t[s]}),this.dataset.columns.indexOf(s)>=0&&n.push({dimensionKey:s,value:t[s]}),r.indexOf(s)>=0&&(this.dataset.indicatorsAsCol?n.push({indicatorKey:o[s]}):e.push({indicatorKey:o[s]}));return this.getCellAddressByHeaderPaths({rowHeaderPaths:e,colHeaderPaths:n,cellLocation:"body"})}getChartInstance(t){var e,n,o,r,s;const l=this.getCellAddressByHeaderPaths(t);if(l){const a=this.getCellRelativeRect(l.col,l.row),h=this.scenegraph.getCell(l.col,l.row);let d;const u=(e=h==null?void 0:h.getChildren())===null||e===void 0?void 0:e[0];if(u.attribute.chartInstance){d=u.attribute.chartInstance;const{dataId:c,data:g,axes:f,spec:p}=u.attribute,m=u.getViewBox();if(f==null||f.forEach((b,C)=>{var _,w,y,S;b.type==="linear"?d.updateModelSpecSync({type:"axes",index:C},{min:(w=(_=b.range)===null||_===void 0?void 0:_.min)!==null&&w!==void 0?w:0,max:(S=(y=b.range)===null||y===void 0?void 0:y.max)!==null&&S!==void 0?S:0},!0):b.type==="band"&&d.updateModelSpec({type:"axes",index:C},{domain:b.domain.slice(0)},!0)}),d.updateViewBox({x1:m.x1-u.getRootNode().table.scrollLeft,x2:m.x2-u.getRootNode().table.scrollLeft,y1:m.y1-u.getRootNode().table.scrollTop,y2:m.y2-u.getRootNode().table.scrollTop},!1,!1),typeof c=="string")d.updateDataSync(c,g??[]);else{const b=[];for(const C in c){const _=c[C],w=p.series.find(y=>{var S;return((S=y==null?void 0:y.data)===null||S===void 0?void 0:S.id)===C});b.push({id:C,values:_?(n=g==null?void 0:g.filter(y=>y.hasOwnProperty(_)))!==null&&n!==void 0?n:[]:g??[],fields:(o=w==null?void 0:w.data)===null||o===void 0?void 0:o.fields}),d.updateFullDataSync||d.updateDataSync(C,_?(r=g==null?void 0:g.filter(y=>y.hasOwnProperty(_)))!==null&&r!==void 0?r:[]:g??[])}(s=d.updateFullDataSync)===null||s===void 0||s.call(d,b)}this.renderAsync()}return{chartInstance:d,bounds:a.bounds}}return{}}_getDimensionSortArray(){var t,e;if(!((e=(t=this.options)===null||t===void 0?void 0:t.axes)===null||e===void 0)&&e.length){const n=this.options.indicatorsAsCol?"left":"bottom",o=this.options.axes.find(r=>r.orient===n);if(o&<(o.domain))return o.domain}}setRecords(t){var e,n;const o={col:this.stateManager.hover.cellPos.col,row:this.stateManager.hover.cellPos.row};this.options.records=this.internalProps.records=t;const r=this.options,s=this.internalProps;let l,a;this.dataset.setRecords(t),l=r.columnTree?s.layoutMap.columnDimensionTree:new Pe((e=this.dataset.colHeaderTree)!==null&&e!==void 0?e:[],this.layoutNodeId),a=r.rowTree?s.layoutMap.rowDimensionTree:new Pe((n=this.dataset.rowHeaderTree)!==null&&n!==void 0?n:[],this.layoutNodeId),s.layoutMap=new lr(this,this.dataset,l,a),this.refreshHeader(),this.internalProps.useOneRowHeightFillAll=!1,this.scenegraph.clearCells(),this.clearCellStyleCache(),this.scenegraph.createSceneGraph(),this.stateManager.updateHoverPos(o.col,o.row),this.internalProps.title&&!this.internalProps.title.isReleased&&(this._updateSize(),this.internalProps.title.resize(),this.scenegraph.resize()),this.eventManager.updateEventBinder()}_hasCustomRenderOrLayout(){if(this.options.customRender)return!0;const{columnsDefine:t,rowsDefine:e,indicatorsDefine:n}=this.internalProps.layoutMap;for(let o=0;o<t.length;o++){const r=t[o];if(typeof r!="string"&&(r.headerCustomLayout||r.headerCustomRender))return!0}for(let o=0;o<e.length;o++){const r=e[o];if(typeof r!="string"&&(r.headerCustomLayout||r.headerCustomRender))return!0}for(let o=0;o<n.length;o++){const r=n[o];if(typeof r!="string"&&(r.customLayout||r.headerCustomLayout||r.customRender||r.headerCustomRender))return!0}return!1}changeRecordOrder(t,e){}getLayoutColumnTree(){return this.internalProps.layoutMap.getLayoutColumnTree()}getLayoutColumnTreeCount(){return this.internalProps.layoutMap.getLayoutColumnTreeCount()}getLayoutRowTree(){return this.internalProps.layoutMap.getLayoutRowTree()}getLayoutRowTreeCount(){return this.internalProps.layoutMap.getLayoutRowTreeCount()}getCellHeaderTreeNodes(t,e){return this.internalProps.layoutMap.getCellHeaderPathsWithTreeNode(t,e)}};class V9 extends qp{constructor(t){var e,n,o,r,s,l,a,h,d,u;const c=lt(t.boundsPadding),g=[(n=(e=t.marginTop)!==null&&e!==void 0?e:c?t.boundsPadding[0]:t.boundsPadding)!==null&&n!==void 0?n:0,(r=(o=t.marginRight)!==null&&o!==void 0?o:c?t.boundsPadding[1]:t.boundsPadding)!==null&&r!==void 0?r:0,(a=(s=t.marginBottom)!==null&&s!==void 0?s:c?(l=t.boundsPadding[2])!==null&&l!==void 0?l:t.boundsPadding[0]:t.boundsPadding)!==null&&a!==void 0?a:0,(u=(h=t.marginLeft)!==null&&h!==void 0?h:c?(d=t.boundsPadding[3])!==null&&d!==void 0?d:t.boundsPadding[1]:t.boundsPadding)!==null&&u!==void 0?u:0];t.boundsPadding=g,super(t)}}class PT extends cn{constructor(t){var e,n,o,r,s,l,a,h,d,u,c,g,f,p;t.direction&&(t.flexDirection=t.direction),!t.justifyContent||t.justifyContent!=="start"&&t.justifyContent!=="end"||(t.justifyContent="flex-"+t.justifyContent),!t.alignItems||t.alignItems!=="start"&&t.alignItems!=="end"||(t.alignItems="flex-"+t.alignItems),!t.alignContent||t.alignContent!=="start"&&t.alignContent!=="end"||(t.alignContent="flex-"+t.alignContent),t.display="flex",t.flexDirection||(t.flexDirection="row"),t.clip=!0,t.fill=(e=t==null?void 0:t.background)===null||e===void 0?void 0:e.fill,t.stroke=(n=t==null?void 0:t.background)===null||n===void 0?void 0:n.stroke,t.lineWidth=(o=t==null?void 0:t.background)===null||o===void 0?void 0:o.lineWidth,t.cornerRadius=(r=t==null?void 0:t.background)===null||r===void 0?void 0:r.cornerRadius;const m=lt(t.boundsPadding),b=[(l=(s=t.marginTop)!==null&&s!==void 0?s:m?t.boundsPadding[0]:t.boundsPadding)!==null&&l!==void 0?l:0,(h=(a=t.marginRight)!==null&&a!==void 0?a:m?t.boundsPadding[1]:t.boundsPadding)!==null&&h!==void 0?h:0,(c=(d=t.marginBottom)!==null&&d!==void 0?d:m?(u=t.boundsPadding[2])!==null&&u!==void 0?u:t.boundsPadding[0]:t.boundsPadding)!==null&&c!==void 0?c:0,(p=(g=t.marginLeft)!==null&&g!==void 0?g:m?(f=t.boundsPadding[3])!==null&&f!==void 0?f:t.boundsPadding[1]:t.boundsPadding)!==null&&p!==void 0?p:0];t.boundsPadding=b,super(t)}}class j9 extends PT{constructor(t){t.flexWrap="nowrap",super(t)}}let $9=class extends Uo{constructor(t){var e,n,o,r,s,l,a,h,d,u,c,g;let f;ce(t.iconName)&&(f=vn()[t.iconName],f&&(t.width=(e=t.width)!==null&&e!==void 0?e:f.width,t.height=(n=t.height)!==null&&n!==void 0?n:f.height,t.svg=f.svg,t.cursor=f.cursor)),t.svg&&(t.image=t.svg);const p=lt(t.boundsPadding),m=[(r=(o=t.marginTop)!==null&&o!==void 0?o:p?t.boundsPadding[0]:t.boundsPadding)!==null&&r!==void 0?r:0,(l=(s=t.marginRight)!==null&&s!==void 0?s:p?t.boundsPadding[1]:t.boundsPadding)!==null&&l!==void 0?l:0,(d=(a=t.marginBottom)!==null&&a!==void 0?a:p?(h=t.boundsPadding[2])!==null&&h!==void 0?h:t.boundsPadding[0]:t.boundsPadding)!==null&&d!==void 0?d:0,(g=(u=t.marginLeft)!==null&&u!==void 0?u:p?(c=t.boundsPadding[3])!==null&&c!==void 0?c:t.boundsPadding[1]:t.boundsPadding)!==null&&g!==void 0?g:0];t.boundsPadding=m,super(t),this.cache=f}},G9=class extends Uo{constructor(t){var e,n,o,r,s,l,a,h,d,u;t.src&&(t.image=t.src),t.shape==="circle"&&(t.cornerRadius=t.width/2);const c=lt(t.boundsPadding),g=[(n=(e=t.marginTop)!==null&&e!==void 0?e:c?t.boundsPadding[0]:t.boundsPadding)!==null&&n!==void 0?n:0,(r=(o=t.marginRight)!==null&&o!==void 0?o:c?t.boundsPadding[1]:t.boundsPadding)!==null&&r!==void 0?r:0,(a=(s=t.marginBottom)!==null&&s!==void 0?s:c?(l=t.boundsPadding[2])!==null&&l!==void 0?l:t.boundsPadding[0]:t.boundsPadding)!==null&&a!==void 0?a:0,(u=(h=t.marginLeft)!==null&&h!==void 0?h:c?(d=t.boundsPadding[3])!==null&&d!==void 0?d:t.boundsPadding[1]:t.boundsPadding)!==null&&u!==void 0?u:0];t.boundsPadding=g,super(t)}};class U9 extends cu{constructor(t){var e,n,o,r,s,l,a,h,d,u;const c=lt(t.boundsPadding),g=[(n=(e=t.marginTop)!==null&&e!==void 0?e:c?t.boundsPadding[0]:t.boundsPadding)!==null&&n!==void 0?n:0,(r=(o=t.marginRight)!==null&&o!==void 0?o:c?t.boundsPadding[1]:t.boundsPadding)!==null&&r!==void 0?r:0,(a=(s=t.marginBottom)!==null&&s!==void 0?s:c?(l=t.boundsPadding[2])!==null&&l!==void 0?l:t.boundsPadding[0]:t.boundsPadding)!==null&&a!==void 0?a:0,(u=(h=t.marginLeft)!==null&&h!==void 0?h:c?(d=t.boundsPadding[3])!==null&&d!==void 0?d:t.boundsPadding[1]:t.boundsPadding)!==null&&u!==void 0?u:0];t.boundsPadding=g,super(t)}}class K9 extends Hi{constructor(t){var e,n,o,r,s,l,a,h,d,u,c;t.textBaseline||(t.textBaseline="top");const g=lt(t.boundsPadding),f=[(n=(e=t.marginTop)!==null&&e!==void 0?e:g?t.boundsPadding[0]:t.boundsPadding)!==null&&n!==void 0?n:0,(r=(o=t.marginRight)!==null&&o!==void 0?o:g?t.boundsPadding[1]:t.boundsPadding)!==null&&r!==void 0?r:0,(a=(s=t.marginBottom)!==null&&s!==void 0?s:g?(l=t.boundsPadding[2])!==null&&l!==void 0?l:t.boundsPadding[0]:t.boundsPadding)!==null&&a!==void 0?a:0,(u=(h=t.marginLeft)!==null&&h!==void 0?h:g?(d=t.boundsPadding[3])!==null&&d!==void 0?d:t.boundsPadding[1]:t.boundsPadding)!==null&&u!==void 0?u:0];t.boundsPadding=f,t.fill=(c=t.fill)!==null&&c!==void 0?c:"#000",super(t)}getSize(t){this.AABBBounds.width()}}function Y9(i,t=0){return{percent:i,delta:t}}class X9 extends fu{constructor(t){var e,n,o,r,s,l,a,h,d,u;const c=lt(t.boundsPadding),g=[(n=(e=t.marginTop)!==null&&e!==void 0?e:c?t.boundsPadding[0]:t.boundsPadding)!==null&&n!==void 0?n:0,(r=(o=t.marginRight)!==null&&o!==void 0?o:c?t.boundsPadding[1]:t.boundsPadding)!==null&&r!==void 0?r:0,(a=(s=t.marginBottom)!==null&&s!==void 0?s:c?(l=t.boundsPadding[2])!==null&&l!==void 0?l:t.boundsPadding[0]:t.boundsPadding)!==null&&a!==void 0?a:0,(u=(h=t.marginLeft)!==null&&h!==void 0?h:c?(d=t.boundsPadding[3])!==null&&d!==void 0?d:t.boundsPadding[1]:t.boundsPadding)!==null&&u!==void 0?u:0];t.boundsPadding=g,super(t)}}class q9 extends Va{constructor(t){var e,n,o,r,s,l,a,h,d,u;const c=lt(t.boundsPadding),g=[(n=(e=t.marginTop)!==null&&e!==void 0?e:c?t.boundsPadding[0]:t.boundsPadding)!==null&&n!==void 0?n:0,(r=(o=t.marginRight)!==null&&o!==void 0?o:c?t.boundsPadding[1]:t.boundsPadding)!==null&&r!==void 0?r:0,(a=(s=t.marginBottom)!==null&&s!==void 0?s:c?(l=t.boundsPadding[2])!==null&&l!==void 0?l:t.boundsPadding[0]:t.boundsPadding)!==null&&a!==void 0?a:0,(u=(h=t.marginLeft)!==null&&h!==void 0?h:c?(d=t.boundsPadding[3])!==null&&d!==void 0?d:t.boundsPadding[1]:t.boundsPadding)!==null&&u!==void 0?u:0];t.boundsPadding=g,super(t)}getSize(t){this.AABBBounds.width()}}class Z9 extends cn{constructor(t){var e,n,o,r,s,l,a,h,d,u;const c=lt(t.boundsPadding),g=[(n=(e=t.marginTop)!==null&&e!==void 0?e:c?t.boundsPadding[0]:t.boundsPadding)!==null&&n!==void 0?n:0,(r=(o=t.marginRight)!==null&&o!==void 0?o:c?t.boundsPadding[1]:t.boundsPadding)!==null&&r!==void 0?r:0,(a=(s=t.marginBottom)!==null&&s!==void 0?s:c?(l=t.boundsPadding[2])!==null&&l!==void 0?l:t.boundsPadding[0]:t.boundsPadding)!==null&&a!==void 0?a:0,(u=(h=t.marginLeft)!==null&&h!==void 0?h:c?(d=t.boundsPadding[3])!==null&&d!==void 0?d:t.boundsPadding[1]:t.boundsPadding)!==null&&u!==void 0?u:0];t.boundsPadding=g,super(t)}}const J9=Object.freeze(Object.defineProperty({__proto__:null,Arc:X9,CheckBox:Rr,Circle:V9,Container:PT,Group:Z9,GroupElement:j9,Icon:$9,Image:G9,Line:i0,Radio:Qa,Rect:U9,Tag:q9,Text:K9,percentCalc:Y9},Symbol.toStringTag,{value:"Module"}));function Q9(i){var t,e,n,o,r,s,l,a,h,d,u;const c={seqId:0},g={isPivotChart:!0};let f,p,m,b;i.columnTree&&(i.indicatorsAsCol!==!1&&(m=Vi(i.columnTree,i.indicators)),f=new Pe((t=i.columnTree)!==null&&t!==void 0?t:[],c)),i.rowTree&&(i.indicatorsAsCol===!1&&(b=Vi(i.rowTree,i.indicators)),p=new Pe((e=i.rowTree)!==null&&e!==void 0?e:[],c));const C=!((n=p.dimensionKeys)===null||n===void 0)&&n.count?p.dimensionKeys.valueArr():(r=(o=i.rows)===null||o===void 0?void 0:o.reduce((y,S)=>(typeof S=="string"?y.push(S):y.push(S.dimensionKey),y),[]))!==null&&r!==void 0?r:[],_=!((s=f.dimensionKeys)===null||s===void 0)&&s.count?f.dimensionKeys.valueArr():(a=(l=i.columns)===null||l===void 0?void 0:l.reduce((y,S)=>(typeof S=="string"?y.push(S):y.push(S.dimensionKey),y),[]))!==null&&a!==void 0?a:[],w=(d=(h=i.indicators)===null||h===void 0?void 0:h.reduce((y,S)=>(typeof S=="string"?y.push(S):y.push(S.indicatorKey),y),[]))!==null&&d!==void 0?d:[];return g.collectValuesBy=t7(i,_,C),g.aggregationRules=e7(i),{dataset:new Ih(g,C,_,w,i.indicators,(u=i.indicatorsAsCol)===null||u===void 0||u,i.records,void 0,m||i.columnTree,b||i.rowTree,!0),columnDimensionTree:f,rowDimensionTree:p,layoutNodeId:c}}function t7(i,t,e){var n,o,r,s,l,a,h,d,u,c,g,f,p,m,b,C,_,w,y,S,A,R,x;const T={};for(let M=0,B=(n=i.indicators)===null||n===void 0?void 0:n.length;M<B;M++)if(typeof i.indicators[M]!="string"&&i.indicators[M].chartSpec)if(i.indicatorsAsCol===!1){const P=i.indicators[M];if(T[P.indicatorKey]={by:e,range:!0,sumBy:((o=P.chartSpec)===null||o===void 0?void 0:o.stack)!==!1&&t.concat((r=P.chartSpec)===null||r===void 0?void 0:r.xField)},P.chartSpec.series)P.chartSpec.series.forEach(F=>{var H,E,k,I,L,D,O,N,W,$,U,Y,j,G,X,ht;const gt=typeof F.xField=="string"?F.xField:F.xField[0];T[gt]={by:t,type:F.direction!=="horizontal"?"xField":void 0,range:F.direction==="horizontal",sortBy:F.direction!=="horizontal"?(I=(k=(E=(H=F==null?void 0:F.data)===null||H===void 0?void 0:H.fields)===null||E===void 0?void 0:E[gt])===null||k===void 0?void 0:k.domain)!==null&&I!==void 0?I:(N=(O=(D=(L=P.chartSpec)===null||L===void 0?void 0:L.data)===null||D===void 0?void 0:D.fields)===null||O===void 0?void 0:O[gt])===null||N===void 0?void 0:N.domain:void 0};const Ct=F.yField;T[Ct]={by:e,range:F.direction!=="horizontal",sumBy:F.stack!==!1&&t.concat(F==null?void 0:F.xField),sortBy:F.direction==="horizontal"?(Y=(U=($=(W=F==null?void 0:F.data)===null||W===void 0?void 0:W.fields)===null||$===void 0?void 0:$[Ct])===null||U===void 0?void 0:U.domain)!==null&&Y!==void 0?Y:(ht=(X=(G=(j=P.chartSpec)===null||j===void 0?void 0:j.data)===null||G===void 0?void 0:G.fields)===null||X===void 0?void 0:X[Ct])===null||ht===void 0?void 0:ht.domain:void 0}});else{const F=typeof P.chartSpec.xField=="string"?P.chartSpec.xField:P.chartSpec.xField[0];T[F]={by:t,type:P.chartSpec.direction!=="horizontal"?"xField":void 0,range:P.chartSpec.direction==="horizontal",sortBy:P.chartSpec.direction!=="horizontal"?(h=(a=(l=(s=P.chartSpec)===null||s===void 0?void 0:s.data)===null||l===void 0?void 0:l.fields)===null||a===void 0?void 0:a[F])===null||h===void 0?void 0:h.domain:void 0};const H=P.chartSpec.yField;T[H]={by:e,range:i.indicators[M].chartSpec.direction!=="horizontal",sumBy:P.chartSpec.stack!==!1&&t.concat((d=P.chartSpec)===null||d===void 0?void 0:d.xField),sortBy:P.chartSpec.direction==="horizontal"?(f=(g=(c=(u=P.chartSpec)===null||u===void 0?void 0:u.data)===null||c===void 0?void 0:c.fields)===null||g===void 0?void 0:g[H])===null||f===void 0?void 0:f.domain:void 0}}}else{const P=i.indicators[M];if(T[P.indicatorKey]={by:t,range:!0,sumBy:((p=P.chartSpec)===null||p===void 0?void 0:p.stack)!==!1&&e.concat((m=P.chartSpec)===null||m===void 0?void 0:m.yField)},P.chartSpec.series)P.chartSpec.series.forEach(F=>{var H,E,k,I,L,D,O,N,W,$,U,Y,j,G,X,ht;const gt=typeof F.yField=="string"?F.yField:F.yField[0];T[gt]={by:e,type:F.direction==="horizontal"?"yField":void 0,range:F.direction!=="horizontal",sortBy:F.direction==="horizontal"?(I=(k=(E=(H=F==null?void 0:F.data)===null||H===void 0?void 0:H.fields)===null||E===void 0?void 0:E[gt])===null||k===void 0?void 0:k.domain)!==null&&I!==void 0?I:(N=(O=(D=(L=P.chartSpec)===null||L===void 0?void 0:L.data)===null||D===void 0?void 0:D.fields)===null||O===void 0?void 0:O[gt])===null||N===void 0?void 0:N.domain:void 0};const Ct=F.xField;T[Ct]={by:t,range:F.direction==="horizontal",sumBy:F.stack!==!1&&e.concat(F==null?void 0:F.yField),sortBy:F.direction!=="horizontal"?(Y=(U=($=(W=F==null?void 0:F.data)===null||W===void 0?void 0:W.fields)===null||$===void 0?void 0:$[Ct])===null||U===void 0?void 0:U.domain)!==null&&Y!==void 0?Y:(ht=(X=(G=(j=P.chartSpec)===null||j===void 0?void 0:j.data)===null||G===void 0?void 0:G.fields)===null||X===void 0?void 0:X[Ct])===null||ht===void 0?void 0:ht.domain:void 0}});else{const F=typeof P.chartSpec.yField=="string"?P.chartSpec.yField:P.chartSpec.yField[0];T[F]={by:e,type:P.chartSpec.direction==="horizontal"?"yField":void 0,range:P.chartSpec.direction!=="horizontal",sortBy:P.chartSpec.direction==="horizontal"?(w=(_=(C=(b=P.chartSpec)===null||b===void 0?void 0:b.data)===null||C===void 0?void 0:C.fields)===null||_===void 0?void 0:_[F])===null||w===void 0?void 0:w.domain:void 0};const H=P.chartSpec.xField;T[H]={by:t,range:i.indicators[M].chartSpec.direction==="horizontal",sumBy:P.chartSpec.stack!==!1&&e.concat((y=P.chartSpec)===null||y===void 0?void 0:y.yField),sortBy:P.chartSpec.direction!=="horizontal"?(x=(R=(A=(S=P.chartSpec)===null||S===void 0?void 0:S.data)===null||A===void 0?void 0:A.fields)===null||R===void 0?void 0:R[H])===null||x===void 0?void 0:x.domain:void 0}}}return T}function e7(i){var t;const e=[];return(t=i.indicators)===null||t===void 0||t.forEach(n=>{var o,r;if(typeof n=="string")e.push({indicatorKey:n,field:n,aggregationType:zt.RECORD});else if(!((o=n.chartSpec)===null||o===void 0)&&o.series){const s=[];(r=n.chartSpec)===null||r===void 0||r.series.forEach(l=>{const a=i.indicatorsAsCol===!1?l.yField:l.xField;s.indexOf(a)===-1&&s.push(a)}),e.push({indicatorKey:n.indicatorKey,field:s,aggregationType:zt.RECORD})}else{const s=i.indicatorsAsCol===!1?n.chartSpec.yField:n.chartSpec.xField;e.push({indicatorKey:n.indicatorKey,field:s??n.indicatorKey,aggregationType:zt.RECORD})}}),e}function i7(i,t,e){var n,o;const r=Q9(i);let s=r.columnDimensionTree,l=r.rowDimensionTree,a=!1,h=!1;i.columnTree&&i.indicatorsAsCol&&!s.dimensionKeys.contain(Xi)&&(a=!0),i.rowTree&&(i.indicatorsAsCol||l.dimensionKeys.contain(Xi)||(h=!0));const{dataset:d,layoutNodeId:u}=r,c={options:i,layoutNodeId:u,internalProps:i,isPivotChart:()=>!0,pivotChartAxes:[],_selectedDataItemsInChart:[],_getActiveChartInstance:()=>({updateState:()=>{}})};i.columnTree&&!a||(s=new Pe((n=d.colHeaderTree)!==null&&n!==void 0?n:[],u)),i.rowTree&&!h||(l=new Pe((o=d.rowHeaderTree)!==null&&o!==void 0?o:[],u));const g=new lr(c,d,s,l);for(let f=0;f<g.colCount;f++)for(let p=0;p<g.rowCount;p++){if(g.isHeader(f,p))continue;const m=g.getCellHeaderPaths(f,p),b=m.colHeaderPaths.map(y=>{var S;return(S=y.indicatorKey)!==null&&S!==void 0?S:y.value}),C=m.rowHeaderPaths.map(y=>{var S;return(S=y.indicatorKey)!==null&&S!==void 0?S:y.value}),_=d.getAggregator(g.indicatorsAsCol?C:C.slice(0,-1),g.indicatorsAsCol?b.slice(0,-1):b,g.getIndicatorKey(f,p)),w=n7(_.value?_.value():void 0,t,f,p,g,e);if(w)return w}}function n7(i,t,e,n,o,r){if(lt(i)){for(let s=0;s<i.length;s++)if(r?r(i[s],t):o7(i[s],t))return o.getCellHeaderPaths(e,n)}}function o7(i,t){return JSON.stringify(i)===JSON.stringify(t)}function r7(i){return new Va(i?i.attribute:{})}function s7(i){return new Rr(i?i.attribute:{})}function l7(i){return new Qa(i?i.attribute:{})}class a7{constructor(t,e){var n,o,r,s,l,a;this.willUpdateRow=!1,this.willUpdateCol=!1,this.table=t,this.rowCount=(n=e==null?void 0:e.rowCount)!==null&&n!==void 0?n:void 0,this.colCount=(o=e==null?void 0:e.colCount)!==null&&o!==void 0?o:void 0,this.animationDuration=(r=e==null?void 0:e.animationDuration)!==null&&r!==void 0?r:500,this.animationDelay=(s=e==null?void 0:e.animationDelay)!==null&&s!==void 0?s:1e3,this.animationEasing=(l=e==null?void 0:e.animationEasing)!==null&&l!==void 0?l:"linear",this.replaceScrollAction=(a=e==null?void 0:e.replaceScrollAction)!==null&&a!==void 0&&a,this.reset(),this.init()}init(){this.replaceScrollAction&&(this.table.disableScroll(),this.table.scenegraph.stage.addEventListener("wheel",this.onScrollEnd.bind(this)))}reset(){this.playing=!1,this.row=this.table.frozenRowCount,this.col=this.table.frozenColCount}onScrollEnd(t){this.rowCount?(t.deltaY>0?(this.row+=this.rowCount,this.row=Math.min(this.row,this.table.rowCount-this.table.frozenRowCount)):t.deltaY<0&&(this.row-=this.rowCount,this.row=Math.max(this.row,this.table.frozenRowCount)),this.table.scrollToRow(this.row,{duration:this.animationDuration,easing:this.animationEasing})):this.colCount&&(t.deltaX>0?(this.col+=this.colCount,this.col=Math.min(this.col,this.table.colCount-this.table.frozenColCount)):t.deltaX<0&&(this.col-=this.colCount,this.col=Math.max(this.col,this.table.frozenColCount)),this.table.scrollToCol(this.col,{duration:this.animationDuration,easing:this.animationEasing}))}play(){this.playing=!0,this.rowCount&&!this.willUpdateRow?this.updateRow():this.colCount&&!this.willUpdateCol&&this.updateCol()}pause(){this.playing=!1}updateRow(){if(!this.playing)return;let t=!0;this.table.scenegraph.proxy.screenTopRow!==this.row?(this.row=this.table.frozenRowCount,t=!1):this.row+=this.rowCount,this.table.scrollToRow(this.row,t?{duration:this.animationDuration,easing:this.animationEasing}:void 0),this.willUpdateRow=!0,setTimeout(()=>{this.willUpdateRow=!1,this.updateRow()},this.animationDuration+this.animationDelay)}updateCol(){if(!this.playing)return;let t=!0;this.table.scenegraph.proxy.screenLeftCol!==this.col?(this.col=this.table.frozenColCount,t=!1):this.col+=this.colCount,this.table.scrollToCol(this.col,t?{duration:this.animationDuration,easing:this.animationEasing}:void 0),this.willUpdateCol=!0,setTimeout(()=>{this.willUpdateCol=!1,this.updateCol()},this.animationDuration+this.animationDelay)}}class h7{constructor(t,e){this.table=t,this.options=e,this.registerStyle(),this.bindEvent()}registerStyle(){var t,e,n,o,r,s,l,a;this.table.registerCustomCellStyle("col-highlight",{bgColor:(e=(t=this.options)===null||t===void 0?void 0:t.colHighlightBGColor)!==null&&e!==void 0?e:"#82b2f5",color:(o=(n=this.options)===null||n===void 0?void 0:n.colHighlightColor)!==null&&o!==void 0?o:"#FFF"}),this.table.registerCustomCellStyle("row-highlight",{bgColor:(s=(r=this.options)===null||r===void 0?void 0:r.rowHighlightBGColor)!==null&&s!==void 0?s:"#82b2f5",color:(a=(l=this.options)===null||l===void 0?void 0:l.rowHighlightColor)!==null&&a!==void 0?a:"#FFF"})}bindEvent(){this.table.on("selected_cell",t=>{this.updateHighlight()}),this.table.on("selected_clear",()=>{this.clearHighlight()}),this.table.on("mousemove_table",()=>{this.table.stateManager.select.selecting&&this.updateHighlight()})}clearHighlight(){this.colHeaderRange&&this.table.arrangeCustomCellStyle({range:this.colHeaderRange},void 0),this.rowHeaderRange&&this.table.arrangeCustomCellStyle({range:this.rowHeaderRange},void 0),this.colHeaderRange=void 0,this.rowHeaderRange=void 0}updateHighlight(){var t,e,n,o;if(((t=this.options)===null||t===void 0?void 0:t.colHighlight)===!1&&((e=this.options)===null||e===void 0?void 0:e.rowHighlight)===!1)return;const r=this.table.getSelectedCellRanges();if(r.length===0)return void this.clearHighlight();const s=r[0],l=[s.start.row,s.end.row];l.sort((u,c)=>u-c);const a=[s.start.col,s.end.col];let h,d;a.sort((u,c)=>u-c),this.table.isPivotTable()?(h={start:{col:a[0],row:0},end:{col:a[1],row:this.table.columnHeaderLevelCount-1}},d={start:{col:0,row:l[0]},end:{col:this.table.rowHeaderLevelCount-1,row:l[1]}}):this.table.internalProps.transpose?d={start:{col:0,row:l[0]},end:{col:this.table.rowHeaderLevelCount-1,row:l[1]}}:(h={start:{col:a[0],row:0},end:{col:a[1],row:this.table.columnHeaderLevelCount-1}},this.table.internalProps.rowSeriesNumber&&(d={start:{col:0,row:l[0]},end:{col:0,row:l[1]}})),((n=this.options)===null||n===void 0?void 0:n.colHighlight)===!1||HT(this.colHeaderRange,h)||(this.colHeaderRange&&this.table.arrangeCustomCellStyle({range:this.colHeaderRange},void 0),h&&this.table.arrangeCustomCellStyle({range:h},"col-highlight"),this.colHeaderRange=h),((o=this.options)===null||o===void 0?void 0:o.rowHighlight)===!1||HT(this.rowHeaderRange,d)||(this.rowHeaderRange&&this.table.arrangeCustomCellStyle({range:this.rowHeaderRange},void 0),d&&this.table.arrangeCustomCellStyle({range:d},"row-highlight"),this.rowHeaderRange=d)}}function HT(i,t){return i===void 0&&t===void 0||i!==void 0&&t!==void 0&&i.start.col===t.start.col&&i.start.row===t.start.row&&i.end.col===t.end.col&&i.end.row===t.end.row}ix();const d7="1.11.1";function u7(){return vn()}function c7(){rT()}const g7=Object.freeze(Object.defineProperty({__proto__:null,CarouselAnimationPlugin:a7,CustomLayout:J9,DataStatistics:nV,EventTarget:th,HeaderHighlightPlugin:h7,InvertHighlightPlugin:Q6,ListTable:F9,ListTableSimple:I9,PIVOT_CHART_EVENT_TYPE:SA,PIVOT_TABLE_EVENT_TYPE:rr,PivotChart:N9,PivotTable:BT,PivotTableSimple:W9,TABLE_EVENT_TYPE:at,TYPES:jz,VArc:HI,VArea:EI,VCheckBox:s7,VCircle:LI,VGlyph:FI,VGroup:kI,VImage:II,VLine:DI,VPath:OI,VPolygon:zI,VRadio:l7,VRect:WI,VSymbol:NI,VTag:r7,VText:VI,clearGlobal:c7,core:K8,data:Q4,getDataCellPath:i7,getIcons:u7,getTargetCell:Hr,graphicUtil:B1,jsx:$I,onBeforeAttributeUpdateForInvertHighlight:fR,register:J8,registerAxis:Mg,registerChartCell:kg,registerCheckboxCell:Fg,registerEmptyTip:Bg,registerImageCell:Ig,registerLegend:Pg,registerMenu:Hg,registerProgressBarCell:Dg,registerRadioCell:Og,registerSparkLineCell:zg,registerTextCell:Il,registerTitle:Eg,registerTooltip:Lg,registerVideoCell:Wg,renderChart:Vm,restoreMeasureText:hW,setCustomAlphabetCharSet:aW,themes:j4,updateCell:_o,version:d7},Symbol.toStringTag,{value:"Module"})),zr=PB.create({baseURL:"/",validateStatus(i){return i===200},timeout:1e3*15});zr.interceptors.request.use(i=>i,i=>Promise.reject(i)),zr.interceptors.response.use(i=>{var t,e;return+((t=i==null?void 0:i.data)==null?void 0:t.code)==500&&ji.message.error({content:((e=i==null?void 0:i.data)==null?void 0:e.message)||"服务器异常",key:"SERVER_ERROR"}),i},i=>{if(i.message.includes("timeout"))ji.message.error({content:"网络连接超时,请重试!",key:"TIMEOUT"});else{const{status:t}=i.response;t===401?ji.message.error({content:"当前用户信息不正确",key:"REQUEST_ERROR"}):t>=500?ji.message.error({content:"服务器异常",key:"REQUEST_ERROR"}):ji.message.error({content:"请求异常",key:"REQUEST_ERROR"})}return Promise.reject(i)});var ET={},f7={get exports(){return ET},set exports(i){ET=i}};(function(i,t){(function(e,n){i.exports=n(Lo)})(sP,function(e){function n(s){return s&&typeof s=="object"&&"default"in s?s:{default:s}}var o=n(e),r={name:"zh-cn",weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"周日_周一_周二_周三_周四_周五_周六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),ordinal:function(s,l){return l==="W"?s+"周":s+"日"},weekStart:1,yearStart:4,formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日Ah点mm分",LLLL:"YYYY年M月D日ddddAh点mm分",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},relativeTime:{future:"%s内",past:"%s前",s:"几秒",m:"1 分钟",mm:"%d 分钟",h:"1 小时",hh:"%d 小时",d:"1 天",dd:"%d 天",M:"1 个月",MM:"%d 个月",y:"1 年",yy:"%d 年"},meridiem:function(s,l){var a=100*s+l;return a<600?"凌晨":a<900?"早上":a<1100?"上午":a<1300?"中午":a<1800?"下午":"晚上"}};return o.default.locale(r,null,!0),r})})(f7);const xX="",RX="",Ti=(i,t)=>{const e=i.__vccOpts||i;for(const[n,o]of t)e[n]=o;return e};Lo.locale("zh-cn");const p7=v.defineComponent({name:"PivotFilter",props:{data:{type:Object,default:()=>{}},customDimensions:{type:Array,default:()=>[]},dimensions:{type:Array,default:()=>[]},indicators:{type:Array,default:()=>[]}},setup(i,{emit:t,expose:e}){const n=v.ref(!1),o=v.ref(!1),r=v.ref(!1),s=v.ref([]),l=v.ref(""),a=v.ref(),h=v.ref(""),d=v.ref([]),u=v.ref(),c=v.ref("range"),g=v.ref(),f=v.ref({}),p=v.ref(),m=v.ref({}),b=v.inject("getContainer",()=>{}),C=v.inject("scaleValue",{}),_=v.inject("theme","light"),w=v.inject("pageId",""),y=v.inject("context",""),S=v.inject("indicatorUrl",""),A=v.inject("indicatorToken",""),R=v.inject("graphicConfig",{}),x=v.inject("theDateInfo",{}),T=[{label:"小于",value:"LESS"},{label:"小于等于",value:"LESS_EQUAL"},{label:"大于",value:"GREATER"},{label:"大于等于",value:"GREATER_EQUAL"},{label:"等于",value:"EQUAL"},{label:"不等于",value:"NOT_EQUAL"}],M=[{label:"单个日期",value:"date"},{label:"日期范围",value:"range"}],B=j=>{r.value=!1,s.value=j.target.checked?v.unref(d).map(G=>G.value):[]};v.watch(s,j=>{o.value=j.length===v.unref(d).length,r.value=!!j.length&&j.length<v.unref(d).length});const P=async j=>{const{queryColumnList:G=[],edvDataSetId:X="",source:ht,dataSourceId:gt}=v.unref(R);let Ct=G.find(st=>st.name===j||st.label===j);Ct||(Ct=i.customDimensions.find(st=>st.name===j||st.label===j));const Q={},{search:et}=(window==null?void 0:window.location)||{},bt=et.slice(1,et.length).split("&");for(const st of bt)if(st){const _t=st.split("=");_t[0]&&(Q[_t[0]]=_t[1])}const dt=await zr.post(`${v.unref(S)}/diagram/groupvalue`,{source:ht,groupColumn:j,hrpIndexTypeGuid:Ct==null?void 0:Ct.typeGuid,pageId:v.unref(w),pageFlag:!0,edvDataSetId:X,dataSourceId:gt,extParam:Q},{headers:{Authentication:v.unref(A),operateContext:v.unref(y)}}),{success:ot,data:ut=[]}=dt.data;ot&&(d.value=ut.map(st=>({value:st})))},F=v.ref("");async function H(){const{filterData:j,type:G,key:X}=i.data,gt=i.dimensions.concat(i.indicators).find(Ct=>Ct.label===X);gt&&(F.value=gt.genericType),v.unref(F)==="DATE"?u.value="date":u.value="select",G==="dimension"?v.unref(u)==="select"?(await P(X),Array.isArray(j)?s.value=j:s.value=(j==null?void 0:j.value)||[]):v.unref(u)==="date"&&(j==null?void 0:j.length)===2&&(a.value=[Lo(j[0].value),Lo(j[1].value)]):(l.value=(j==null?void 0:j.rule)||"",a.value=(j==null?void 0:j.value)||""),n.value=!0}const E=v.computed(()=>v.unref(x).dateFormat||"YYYY-MM-DD");function k(){var ht;const{key:j,type:G}=i.data;let X={};G==="dimension"?v.unref(u)==="select"?X={rule:"IN",value:v.unref(s)}:v.unref(u)==="date"&&(v.unref(c)==="date"?X={rule:"EQUAL",value:((ht=v.unref(a))==null?void 0:ht.format(v.unref(E)))||""}:v.unref(c)==="range"&&v.unref(a)&&(X=[{rule:"GREATER_EQUAL",value:v.unref(a)[0].format(v.unref(E))},{rule:"LESS_EQUAL",value:v.unref(a)[1].format(v.unref(E))}])):X={rule:v.unref(l),value:v.unref(a)},t("change",{checkKeys:X,key:j,type:G}),n.value=!1}function I(){l.value="",a.value=null}const L=v.computed(()=>v.unref(_)==="darkBlue"?"#b2c3dd":""),D=()=>document.getElementsByClassName("filter-modal")[0]||document.body,O=j=>{var G,X,ht;if(j){const gt=(G=v.unref(g))==null?void 0:G.getBoundingClientRect();if(gt){const Ct=gt.left/(((X=v.unref(C))==null?void 0:X.widthScale)||1)+"px",Q=(gt.top+gt.height)/(((ht=v.unref(C))==null?void 0:ht.heightScale)||1)+"px";setTimeout(()=>{var bt,dt;const et=document.querySelectorAll(".ant-select-dropdown"),vt=Array.from(et).filter(ot=>window.getComputedStyle(ot).display!=="none");if(vt!=null&&vt.length){const ot=document.getElementsByClassName("filter-modal")[0];vt[0].classList.add("filter-select-dropdown"),(bt=ot==null?void 0:ot.style)==null||bt.setProperty("--drop-down-left",Ct),(dt=ot==null?void 0:ot.style)==null||dt.setProperty("--drop-down-top",Q),f.value={visibility:"visible"}}},200)}}else f.value={}},N=j=>{var G,X,ht;if(j){const gt=(G=v.unref(p))==null?void 0:G.getBoundingClientRect();if(gt){const Ct=gt.left/(((X=v.unref(C))==null?void 0:X.widthScale)||1)+"px",Q=(gt.top+gt.height)/(((ht=v.unref(C))==null?void 0:ht.heightScale)||1)+"px";setTimeout(()=>{var bt,dt;const et=document.querySelectorAll(".ecan-range-picker-dropdown"),vt=Array.from(et).filter(ot=>window.getComputedStyle(ot).display!=="none");if(vt!=null&&vt.length){const ot=document.getElementsByClassName("filter-modal")[0];vt[0].classList.add("filter-range-picker-dropdown"),(bt=ot==null?void 0:ot.style)==null||bt.setProperty("--range-picker-dropdown-left",Ct),(dt=ot==null?void 0:ot.style)==null||dt.setProperty("--range-picker-dropdown-top",Q),m.value={visibility:"visible"}}},200)}}else m.value={}},W=v.computed(()=>{let j="270px";return v.unref(u)==="date"&&(j=""),{padding:"10px",height:j,maxHeight:"280px"}}),$=()=>{a.value=null};v.watch(n,j=>{window.modalShow&&window.modalShow(j)});const U=v.computed(()=>{let j="date";return v.unref(E).endsWith("MM")?j="month":v.unref(E).endsWith("YYYY")&&(j="year"),j}),Y=j=>{const{startTime:G,endTime:X,rangeFormat:ht}=v.unref(x);if(G&&X){let gt="day";return ht.endsWith("MM")?gt="month":ht.endsWith("YYYY")&&(gt="year"),j&>&&(j<Lo(G).startOf(gt)||j>Lo(X).endOf(gt))}else return!1};return e({showModal:H}),{visible:n,checkAllDimensions:o,dimIndeterminate:r,dimensionCheckKeys:s,ruleValue:l,ruleOptions:T,filterValue:a,searchDimName:h,fontColor:L,valueList:d,filterType:u,dateSelectType:c,bodyStyle:W,dateType:U,dateSelectOptions:M,formatStr:E,theme:_,handleOk:k,onCheckAllDimChange:B,handleClear:I,dropdownStyle:f,popupStyle:m,selectRef:g,rangePickerRef:p,getPopupContainer:D,onChangeSelectType:$,disabledDate:Y,getContainer:b,dropdownVisibleChange:O,openChange:N}}}),m7={class:"wrap-header"},v7={class:"wrap-body"},b7={style:{padding:"20px",display:"none"}},C7={ref:"selectRef",style:{display:"inline-block"}},y7={style:{padding:"10px 20px"}},_7={key:0,class:"ecan-date-picker"},w7={key:1,class:"ecan-range-picker",style:{display:"inline-block"},ref:"rangePickerRef"},S7={key:1},x7={style:{padding:"20px"}},R7={ref:"selectRef",style:{display:"inline-block"}},A7={style:{padding:"10px 20px"}};function T7(i,t,e,n,o,r){var p;const s=v.resolveComponent("a-checkbox"),l=v.resolveComponent("a-input"),a=v.resolveComponent("a-checkbox-group"),h=v.resolveComponent("a-select-option"),d=v.resolveComponent("a-select"),u=v.resolveComponent("a-date-picker"),c=v.resolveComponent("a-range-picker"),g=v.resolveComponent("a-button"),f=v.resolveComponent("a-modal");return v.openBlock(),v.createBlock(f,{wrapClassName:i.theme+" filter-modal",visible:i.visible,"onUpdate:visible":t[9]||(t[9]=m=>i.visible=m),title:((p=i.data)==null?void 0:p.fieldName)+"-筛选","ok-text":"确认","cancel-text":"取消",bodyStyle:i.bodyStyle,getContainer:i.getContainer,onOk:i.handleOk},{footer:v.withCtx(()=>[v.createVNode(g,{onClick:t[8]||(t[8]=m=>i.visible=!1)},{default:v.withCtx(()=>t[10]||(t[10]=[v.createTextVNode("取消")])),_:1}),i.data.type==="indicators"?(v.openBlock(),v.createBlock(g,{key:0,onClick:i.handleClear},{default:v.withCtx(()=>t[11]||(t[11]=[v.createTextVNode("清除筛选")])),_:1},8,["onClick"])):v.createCommentVNode("",!0),v.createVNode(g,{type:"primary",onClick:i.handleOk},{default:v.withCtx(()=>t[12]||(t[12]=[v.createTextVNode("确定")])),_:1},8,["onClick"])]),default:v.withCtx(()=>[i.data.type==="dimension"?(v.openBlock(),v.createElementBlock("div",{key:0,class:v.normalizeClass(["dimension-wrap",i.filterType==="select"?"border":""])},[i.filterType==="select"?(v.openBlock(),v.createElementBlock(v.Fragment,{key:0},[v.createElementVNode("div",m7,[v.createVNode(s,{checked:i.checkAllDimensions,"onUpdate:checked":t[0]||(t[0]=m=>i.checkAllDimensions=m),indeterminate:i.dimIndeterminate,disabled:!!i.searchDimName,onChange:i.onCheckAllDimChange},{default:v.withCtx(()=>[v.createElementVNode("span",{style:v.normalizeStyle({color:i.fontColor})},"全选",4)]),_:1},8,["checked","indeterminate","disabled","onChange"]),v.createVNode(l,{value:i.searchDimName,"onUpdate:value":t[1]||(t[1]=m=>i.searchDimName=m),placeholder:"请输入关键字搜索",style:{width:"200px","margin-left":"15px"}},null,8,["value"])]),v.createElementVNode("div",v7,[v.createVNode(a,{value:i.dimensionCheckKeys,"onUpdate:value":t[2]||(t[2]=m=>i.dimensionCheckKeys=m),style:{width:"100%"}},{default:v.withCtx(()=>[(v.openBlock(!0),v.createElementBlock(v.Fragment,null,v.renderList(i.valueList||[],(m,b)=>v.withDirectives((v.openBlock(),v.createElementBlock("div",{class:"body-item",key:b},[v.createVNode(s,{value:m.value},{default:v.withCtx(()=>[v.createElementVNode("span",{style:v.normalizeStyle({color:i.fontColor})},v.toDisplayString(m.value),5)]),_:2},1032,["value"])])),[[v.vShow,!i.searchDimName||m.value.includes(i.searchDimName)]])),128))]),_:1},8,["value"])])],64)):i.filterType==="date"?(v.openBlock(),v.createElementBlock(v.Fragment,{key:1},[v.createElementVNode("div",b7,[v.createElementVNode("span",{class:"filter-label",style:v.normalizeStyle({color:i.fontColor})},"筛选类型:",4),v.createElementVNode("div",C7,[v.createVNode(d,{value:i.dateSelectType,"onUpdate:value":t[3]||(t[3]=m=>i.dateSelectType=m),style:{width:"200px"},placeholder:"请选择",dropdownClassName:"pivot-table-select-dropdown",getPopupContainer:i.getPopupContainer,dropdownStyle:i.dropdownStyle,onDropdownVisibleChange:i.dropdownVisibleChange,onChange:i.onChangeSelectType},{default:v.withCtx(()=>[(v.openBlock(!0),v.createElementBlock(v.Fragment,null,v.renderList(i.dateSelectOptions,m=>(v.openBlock(),v.createBlock(h,{key:m.value,value:m.value},{default:v.withCtx(()=>[v.createTextVNode(v.toDisplayString(m.label),1)]),_:2},1032,["value"]))),128))]),_:1},8,["value","getPopupContainer","dropdownStyle","onDropdownVisibleChange","onChange"])],512)]),v.createElementVNode("div",y7,[v.createElementVNode("span",{class:"filter-label",style:v.normalizeStyle({color:i.fontColor})},"筛选值:",4),i.dateSelectType==="date"?(v.openBlock(),v.createElementBlock("span",_7,[v.createVNode(u,{dropdownClassName:"ecan-date-picker-dropdown",value:i.filterValue,"onUpdate:value":t[4]||(t[4]=m=>i.filterValue=m),picker:i.dateType,format:i.formatStr,getPopupContainer:i.getPopupContainer},null,8,["value","picker","format","getPopupContainer"])])):i.dateSelectType==="range"?(v.openBlock(),v.createElementBlock("div",w7,[v.createVNode(c,{dropdownClassName:"ecan-range-picker-dropdown",value:i.filterValue,"onUpdate:value":t[5]||(t[5]=m=>i.filterValue=m),picker:i.dateType,format:i.formatStr,"disabled-date":i.disabledDate,getPopupContainer:i.getPopupContainer,popupStyle:i.popupStyle,onOpenChange:i.openChange},null,8,["value","picker","format","disabled-date","getPopupContainer","popupStyle","onOpenChange"])],512)):v.createCommentVNode("",!0)])],64)):v.createCommentVNode("",!0)],2)):i.data.type==="indicators"?(v.openBlock(),v.createElementBlock("div",S7,[v.createElementVNode("div",x7,[v.createElementVNode("span",{class:"filter-label",style:v.normalizeStyle({color:i.fontColor})},"筛选规则:",4),v.createElementVNode("div",R7,[v.createVNode(d,{value:i.ruleValue,"onUpdate:value":t[6]||(t[6]=m=>i.ruleValue=m),style:{width:"200px"},placeholder:"请选择",dropdownClassName:"pivot-table-select-dropdown",getPopupContainer:i.getPopupContainer,dropdownStyle:i.dropdownStyle,onDropdownVisibleChange:i.dropdownVisibleChange},{default:v.withCtx(()=>[(v.openBlock(!0),v.createElementBlock(v.Fragment,null,v.renderList(i.ruleOptions,m=>(v.openBlock(),v.createBlock(h,{key:m.value,value:m.value},{default:v.withCtx(()=>[v.createTextVNode(v.toDisplayString(m.label),1)]),_:2},1032,["value"]))),128))]),_:1},8,["value","getPopupContainer","dropdownStyle","onDropdownVisibleChange"])],512)]),v.createElementVNode("div",A7,[v.createElementVNode("span",{class:"filter-label",style:v.normalizeStyle({color:i.fontColor})},"筛选值:",4),v.createVNode(l,{value:i.filterValue,"onUpdate:value":t[7]||(t[7]=m=>i.filterValue=m),placeholder:"请输入",style:{width:"200px"}},null,8,["value"])])])):v.createCommentVNode("",!0)]),_:1},8,["wrapClassName","visible","title","bodyStyle","getContainer","onOk"])}const LT=Ti(p7,[["render",T7],["__scopeId","data-v-09adb33c"]]),AX="",M7=v.defineComponent({name:"PivotProperty",props:{},setup(i,{emit:t,expose:e}){const n=v.ref(!1),o=v.ref({unit:"",format:"",floatLength:""}),r=v.ref(),s=v.ref({}),l=v.inject("theme","light"),a=v.inject("scaleValue",{}),h=v.inject("getContainer",()=>{}),d=[{label:"整数",value:"integer"},{label:"小数",value:"float"},{label:"百分比",value:"percent"}];function u(p){o.value=p,n.value=!0}function c(){t("change",v.unref(o)),n.value=!1}const g=()=>document.getElementsByClassName("property-modal")[0]||document.body,f=p=>{var m,b,C;if(p){const _=(m=v.unref(r))==null?void 0:m.getBoundingClientRect();if(_){const w=_.left/(((b=v.unref(a))==null?void 0:b.widthScale)||1)+"px",y=(_.top+_.height)/(((C=v.unref(a))==null?void 0:C.heightScale)||1)+"px";setTimeout(()=>{var R,x;const S=document.querySelectorAll(".ant-select-dropdown"),A=Array.from(S).filter(T=>window.getComputedStyle(T).display!=="none");if(A!=null&&A.length){const T=document.getElementsByClassName("property-modal")[0];A[0].classList.add("property-select-dropdown"),(R=T==null?void 0:T.style)==null||R.setProperty("--drop-down-left",w),(x=T==null?void 0:T.style)==null||x.setProperty("--drop-down-top",y),s.value={visibility:"visible"}}},200)}}else s.value={}};return v.watch(n,p=>{window.modalShow&&window.modalShow(p)}),e({showModal:u}),{theme:l,visible:n,formData:o,handleOk:c,getPopupContainer:g,formatOptions:d,getContainer:h,selectRef:r,dropdownStyle:s,dropdownVisibleChange:f}}}),B7={ref:"selectRef"};function P7(i,t,e,n,o,r){const s=v.resolveComponent("a-input"),l=v.resolveComponent("a-form-item"),a=v.resolveComponent("a-radio-button"),h=v.resolveComponent("a-radio-group"),d=v.resolveComponent("a-select"),u=v.resolveComponent("a-form"),c=v.resolveComponent("a-modal");return v.openBlock(),v.createBlock(c,{wrapClassName:i.theme+" property-modal",visible:i.visible,"onUpdate:visible":t[4]||(t[4]=g=>i.visible=g),"ok-text":"确认","cancel-text":"取消",title:i.formData.fieldName+"-度量属性",destroyOnClose:!1,getContainer:i.getContainer,onOk:i.handleOk},{default:v.withCtx(()=>[v.createVNode(u,null,{default:v.withCtx(()=>[v.createVNode(l,{label:"度量单位"},{default:v.withCtx(()=>[v.createVNode(s,{value:i.formData.unit,"onUpdate:value":t[0]||(t[0]=g=>i.formData.unit=g)},null,8,["value"])]),_:1}),i.formData.unit?(v.openBlock(),v.createBlock(l,{key:0,label:"度量单位位置"},{default:v.withCtx(()=>[v.createVNode(h,{value:i.formData.position,"onUpdate:value":t[1]||(t[1]=g=>i.formData.position=g),"button-style":"solid"},{default:v.withCtx(()=>[v.createVNode(a,{value:"left"},{default:v.withCtx(()=>t[5]||(t[5]=[v.createTextVNode("数据左侧")])),_:1}),v.createVNode(a,{value:"right"},{default:v.withCtx(()=>t[6]||(t[6]=[v.createTextVNode("数据右侧")])),_:1})]),_:1},8,["value"])]),_:1})):v.createCommentVNode("",!0),v.createVNode(l,{label:"格式化"},{default:v.withCtx(()=>[v.createElementVNode("div",B7,[v.createVNode(d,{value:i.formData.format,"onUpdate:value":t[2]||(t[2]=g=>i.formData.format=g),options:i.formatOptions,getPopupContainer:i.getPopupContainer,dropdownStyle:i.dropdownStyle,onDropdownVisibleChange:i.dropdownVisibleChange},null,8,["value","options","getPopupContainer","dropdownStyle","onDropdownVisibleChange"])],512)]),_:1}),["float","percent"].includes(i.formData.format)?(v.openBlock(),v.createBlock(l,{key:1,label:"小数位数"},{default:v.withCtx(()=>[v.createVNode(s,{type:"number",value:i.formData.floatLength,"onUpdate:value":t[3]||(t[3]=g=>i.formData.floatLength=g),min:0},null,8,["value"])]),_:1})):v.createCommentVNode("",!0)]),_:1})]),_:1},8,["wrapClassName","visible","title","getContainer","onOk"])}const H7=Ti(M7,[["render",P7]]);function Vn(i,t){E7(i)&&(i="100%");var e=L7(i);return i=t===360?i:Math.min(t,Math.max(0,parseFloat(i))),e&&(i=parseInt(String(i*t),10)/100),Math.abs(i-t)<1e-6?1:(t===360?i=(i<0?i%t+t:i%t)/parseFloat(String(t)):i=i%t/parseFloat(String(t)),i)}function E7(i){return typeof i=="string"&&i.indexOf(".")!==-1&&parseFloat(i)===1}function L7(i){return typeof i=="string"&&i.indexOf("%")!==-1}function k7(i){return i=parseFloat(i),(isNaN(i)||i<0||i>1)&&(i=1),i}function Ng(i){return i<=1?"".concat(Number(i)*100,"%"):i}function mv(i){return i.length===1?"0"+i:String(i)}function F7(i,t,e){return{r:Vn(i,255)*255,g:Vn(t,255)*255,b:Vn(e,255)*255}}function vv(i,t,e){return e<0&&(e+=1),e>1&&(e-=1),e<1/6?i+(t-i)*(6*e):e<1/2?t:e<2/3?i+(t-i)*(2/3-e)*6:i}function I7(i,t,e){var n,o,r;if(i=Vn(i,360),t=Vn(t,100),e=Vn(e,100),t===0)o=e,r=e,n=e;else{var s=e<.5?e*(1+t):e+t-e*t,l=2*e-s;n=vv(l,s,i+1/3),o=vv(l,s,i),r=vv(l,s,i-1/3)}return{r:n*255,g:o*255,b:r*255}}function D7(i,t,e){i=Vn(i,255),t=Vn(t,255),e=Vn(e,255);var n=Math.max(i,t,e),o=Math.min(i,t,e),r=0,s=n,l=n-o,a=n===0?0:l/n;if(n===o)r=0;else{switch(n){case i:r=(t-e)/l+(t<e?6:0);break;case t:r=(e-i)/l+2;break;case e:r=(i-t)/l+4;break}r/=6}return{h:r,s:a,v:s}}function O7(i,t,e){i=Vn(i,360)*6,t=Vn(t,100),e=Vn(e,100);var n=Math.floor(i),o=i-n,r=e*(1-t),s=e*(1-o*t),l=e*(1-(1-o)*t),a=n%6,h=[e,s,r,r,l,e][a],d=[l,e,e,s,r,r][a],u=[r,r,l,e,e,s][a];return{r:h*255,g:d*255,b:u*255}}function z7(i,t,e,n){var o=[mv(Math.round(i).toString(16)),mv(Math.round(t).toString(16)),mv(Math.round(e).toString(16))];return n&&o[0].startsWith(o[0].charAt(1))&&o[1].startsWith(o[1].charAt(1))&&o[2].startsWith(o[2].charAt(1))?o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0):o.join("")}function kT(i){return _n(i)/255}function _n(i){return parseInt(i,16)}var FT={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function Dh(i){var t={r:0,g:0,b:0},e=1,n=null,o=null,r=null,s=!1,l=!1;return typeof i=="string"&&(i=V7(i)),typeof i=="object"&&(ar(i.r)&&ar(i.g)&&ar(i.b)?(t=F7(i.r,i.g,i.b),s=!0,l=String(i.r).substr(-1)==="%"?"prgb":"rgb"):ar(i.h)&&ar(i.s)&&ar(i.v)?(n=Ng(i.s),o=Ng(i.v),t=O7(i.h,n,o),s=!0,l="hsv"):ar(i.h)&&ar(i.s)&&ar(i.l)&&(n=Ng(i.s),r=Ng(i.l),t=I7(i.h,n,r),s=!0,l="hsl"),Object.prototype.hasOwnProperty.call(i,"a")&&(e=i.a)),e=k7(e),{ok:s,format:i.format||l,r:Math.min(255,Math.max(t.r,0)),g:Math.min(255,Math.max(t.g,0)),b:Math.min(255,Math.max(t.b,0)),a:e}}var W7="[-\\+]?\\d+%?",N7="[-\\+]?\\d*\\.\\d+%?",Wr="(?:".concat(N7,")|(?:").concat(W7,")"),bv="[\\s|\\(]+(".concat(Wr,")[,|\\s]+(").concat(Wr,")[,|\\s]+(").concat(Wr,")\\s*\\)?"),Cv="[\\s|\\(]+(".concat(Wr,")[,|\\s]+(").concat(Wr,")[,|\\s]+(").concat(Wr,")[,|\\s]+(").concat(Wr,")\\s*\\)?"),co={CSS_UNIT:new RegExp(Wr),rgb:new RegExp("rgb"+bv),rgba:new RegExp("rgba"+Cv),hsl:new RegExp("hsl"+bv),hsla:new RegExp("hsla"+Cv),hsv:new RegExp("hsv"+bv),hsva:new RegExp("hsva"+Cv),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/};function V7(i){if(i=i.trim().toLowerCase(),i.length===0)return!1;var t=!1;if(FT[i])i=FT[i],t=!0;else if(i==="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var e=co.rgb.exec(i);return e?{r:e[1],g:e[2],b:e[3]}:(e=co.rgba.exec(i),e?{r:e[1],g:e[2],b:e[3],a:e[4]}:(e=co.hsl.exec(i),e?{h:e[1],s:e[2],l:e[3]}:(e=co.hsla.exec(i),e?{h:e[1],s:e[2],l:e[3],a:e[4]}:(e=co.hsv.exec(i),e?{h:e[1],s:e[2],v:e[3]}:(e=co.hsva.exec(i),e?{h:e[1],s:e[2],v:e[3],a:e[4]}:(e=co.hex8.exec(i),e?{r:_n(e[1]),g:_n(e[2]),b:_n(e[3]),a:kT(e[4]),format:t?"name":"hex8"}:(e=co.hex6.exec(i),e?{r:_n(e[1]),g:_n(e[2]),b:_n(e[3]),format:t?"name":"hex"}:(e=co.hex4.exec(i),e?{r:_n(e[1]+e[1]),g:_n(e[2]+e[2]),b:_n(e[3]+e[3]),a:kT(e[4]+e[4]),format:t?"name":"hex8"}:(e=co.hex3.exec(i),e?{r:_n(e[1]+e[1]),g:_n(e[2]+e[2]),b:_n(e[3]+e[3]),format:t?"name":"hex"}:!1)))))))))}function ar(i){return!!co.CSS_UNIT.exec(String(i))}var Vg=2,IT=.16,j7=.05,$7=.05,G7=.15,DT=5,OT=4,U7=[{index:7,opacity:.15},{index:6,opacity:.25},{index:5,opacity:.3},{index:5,opacity:.45},{index:5,opacity:.65},{index:5,opacity:.85},{index:4,opacity:.9},{index:3,opacity:.95},{index:2,opacity:.97},{index:1,opacity:.98}];function zT(i){var t=i.r,e=i.g,n=i.b,o=D7(t,e,n);return{h:o.h*360,s:o.s,v:o.v}}function jg(i){var t=i.r,e=i.g,n=i.b;return"#".concat(z7(t,e,n,!1))}function K7(i,t,e){var n=e/100,o={r:(t.r-i.r)*n+i.r,g:(t.g-i.g)*n+i.g,b:(t.b-i.b)*n+i.b};return o}function WT(i,t,e){var n;return Math.round(i.h)>=60&&Math.round(i.h)<=240?n=e?Math.round(i.h)-Vg*t:Math.round(i.h)+Vg*t:n=e?Math.round(i.h)+Vg*t:Math.round(i.h)-Vg*t,n<0?n+=360:n>=360&&(n-=360),n}function NT(i,t,e){if(i.h===0&&i.s===0)return i.s;var n;return e?n=i.s-IT*t:t===OT?n=i.s+IT:n=i.s+j7*t,n>1&&(n=1),e&&t===DT&&n>.1&&(n=.1),n<.06&&(n=.06),Number(n.toFixed(2))}function VT(i,t,e){var n;return e?n=i.v+$7*t:n=i.v-G7*t,n>1&&(n=1),Number(n.toFixed(2))}function yv(i){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},e=[],n=Dh(i),o=DT;o>0;o-=1){var r=zT(n),s=jg(Dh({h:WT(r,o,!0),s:NT(r,o,!0),v:VT(r,o,!0)}));e.push(s)}e.push(jg(n));for(var l=1;l<=OT;l+=1){var a=zT(n),h=jg(Dh({h:WT(a,l),s:NT(a,l),v:VT(a,l)}));e.push(h)}return t.theme==="dark"?U7.map(function(d){var u=d.index,c=d.opacity,g=jg(K7(Dh(t.backgroundColor||"#141414"),Dh(e[u]),c*100));return g}):e}var _v={red:"#F5222D",volcano:"#FA541C",orange:"#FA8C16",gold:"#FAAD14",yellow:"#FADB14",lime:"#A0D911",green:"#52C41A",cyan:"#13C2C2",blue:"#1890FF",geekblue:"#2F54EB",purple:"#722ED1",magenta:"#EB2F96",grey:"#666666"},wv={},Sv={};Object.keys(_v).forEach(function(i){wv[i]=yv(_v[i]),wv[i].primary=wv[i][5],Sv[i]=yv(_v[i],{theme:"dark",backgroundColor:"#141414"}),Sv[i].primary=Sv[i][5]});var jT=[],Oh=[],Y7="insert-css: You need to provide a CSS string. Usage: insertCss(cssString[, options]).";function X7(){var i=document.createElement("style");return i.setAttribute("type","text/css"),i}function q7(i,t){if(t=t||{},i===void 0)throw new Error(Y7);var e=t.prepend===!0?"prepend":"append",n=t.container!==void 0?t.container:document.querySelector("head"),o=jT.indexOf(n);o===-1&&(o=jT.push(n)-1,Oh[o]={});var r;return Oh[o]!==void 0&&Oh[o][e]!==void 0?r=Oh[o][e]:(r=Oh[o][e]=X7(),e==="prepend"?n.insertBefore(r,n.childNodes[0]):n.appendChild(r)),i.charCodeAt(0)===65279&&(i=i.substr(1,i.length)),r.styleSheet?r.styleSheet.cssText+=i:r.textContent+=i,r}function $T(i){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?Object(arguments[t]):{},n=Object.keys(e);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(e).filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable}))),n.forEach(function(o){Z7(i,o,e[o])})}return i}function Z7(i,t,e){return t in i?Object.defineProperty(i,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):i[t]=e,i}function J7(i,t){process.env.NODE_ENV!=="production"&&!i&&console!==void 0&&console.error("Warning: ".concat(t))}function Q7(i,t){J7(i,"[@ant-design/icons-vue] ".concat(t))}function GT(i){return typeof i=="object"&&typeof i.name=="string"&&typeof i.theme=="string"&&(typeof i.icon=="object"||typeof i.icon=="function")}function xv(i,t,e){return e?v.h(i.tag,$T({key:t},e,i.attrs),(i.children||[]).map(function(n,o){return xv(n,"".concat(t,"-").concat(i.tag,"-").concat(o))})):v.h(i.tag,$T({key:t},i.attrs),(i.children||[]).map(function(n,o){return xv(n,"".concat(t,"-").concat(i.tag,"-").concat(o))}))}function UT(i){return yv(i)[0]}function KT(i){return i?Array.isArray(i)?i:[i]:[]}var tj=`
|
|
309
|
+
${h}`:h,referencePosition:{placement:tn.bottom,rect:d},disappearDelay:(r=l.internalProps.tooltip.overflowTextTooltipDisappearDelay)!==null&&r!==void 0?r:0,style:l.theme.tooltipStyle})}s?this._bindToCell(t,e,s):this._unbindFromCell()}_getTooltipInstanceInfo(t,e){const n=this._table,o=this._tooltipInstances;return o&&o["bubble-tooltip"]||o&&(o["bubble-tooltip"]=f9["bubble-tooltip"](n))}isBinded(t){var e;return JSON.stringify(t)===JSON.stringify((e=this._attachInfo)===null||e===void 0?void 0:e.tooltipOptions)}}const Mg=()=>{Bt.registerComponent("axis",WV),Bt.registerFunction("computeAxisComponentWidth",jV),Bt.registerFunction("computeAxisComponentHeight",$V),Bt.registerFunction("getAxisConfigInPivotChart",I8)},Bg=()=>{Bt.registerComponent("emptyTip",UV)},Pg=()=>{Bt.registerFunction("createLegend",i9)},Hg=()=>{Bt.registerComponent("menuHandler",a9)},Eg=()=>{Bt.registerComponent("title",h9)},Lg=()=>{Bt.registerComponent("tooltipHandler",p9)};class m9{constructor(t){this.titleRows=[],this.showedTitleRows=[],this.rowNow=-1,this.skipStartRow=-1,this.skipEndRow=-1,this.table=t,this.table.on("scroll",e=>{e.scrollDirection==="vertical"&&this.updateGroupTitle()}),this.table.on("resize_column",e=>{this.updateGroupTitle()})}updateGroupTitle(){this.table.scrollTop===0?(this.titleRows=[],this.showedTitleRows=[]):this.skipStartRow!==-1&&this.skipEndRow!==-1&&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){lt(t)||(t=[t]),lt(e)||(e=[e]);for(let l=0;l<t.length;l++){const a=t.slice(0,l+1);this.table.dataSource.getRaw(a)}const n=[],o=e.length===t.length+1;let r=t.slice(0,o?t.length:t.length-1);const s=this.table.dataSource.currentIndexedData;for(let l=this.rowNow-this.table.columnHeaderLevelCount;l>=0;l--){const a=s[l];if(lt(a)&&r.length===a.length){let h=!0;for(let d=0;d<a.length;d++)if(a[d]!==r[d]){h=!1;break}h&&(n.push(l+this.table.columnHeaderLevelCount),r=r.slice(0,r.length-1))}else if(a===t[0]){n.push(l+this.table.columnHeaderLevelCount);break}}this.titleRows=n.reverse()}updateScenegraph(){const{table:t}=this,{shadowGroup:e,shadowGroupFrozen:n}=b9(t);this.showedTitleRows.length=0;let o=0;for(let r=0;r<t.colCount;r++){let s;r<t.frozenColCount?(s=new de({x:t.getColsWidth(0,r-1),y:t.getFrozenRowsHeight()}),n.add(s)):(s=new de({x:t.getColsWidth(t.frozenColCount,r-1),y:t.getFrozenRowsHeight()}),e.add(s)),s.col=r;for(let l=0;l<this.titleRows.length;l++){const a=this.titleRows[l];if(v9(a,this.rowNow,t.scenegraph.proxy.screenTopRow,this.titleRows)){r===0&&o++;continue}r===0&&this.showedTitleRows.push(a);const h=t.scenegraph.getCell(r,a);if(h.role==="cell"){const d=yT(h);d.setAttributes({y:40*l}),s.add(d)}else{const d=_o(r,a,t,!0,!0);d.setAttributes({y:40*l}),s.add(d)}}}o>0&&this.skipStartRow===-1&&this.skipEndRow===-1&&(this.skipStartRow=t.scenegraph.proxy.screenTopRow-1,this.skipEndRow=t.scenegraph.proxy.screenTopRow+1)}}function v9(i,t,e,n){return i===t&&i!==e+n.length-1?!0:i===e+n.indexOf(i)+1&&i<t}function yT(i){const t=i.clone();if(t.role=i.role,t.col=i.col,t.row=i.row,t.mergeStartCol=i.mergeStartCol,t.mergeStartRow=i.mergeStartRow,t.mergeEndCol=i.mergeEndCol,t.mergeEndRow=i.mergeEndRow,t.contentWidth=i.contentWidth,t.contentHeight=i.contentHeight,t.role==="cell"){const e=Fe({x:0,y:0,width:t.attribute.width,height:t.attribute.height});t.add(e)}if(i.type==="group"){const e=t;i.forEachChildren(n=>{const o=yT(n);e.add(o)})}return t}function b9(i){const t=i.scenegraph.colHeaderGroup,e=i.scenegraph.cornerHeaderGroup;if(!t.border){const r=Fe({x:0,y:0,width:0,height:0,cursor:"pointer"});t.add(r),t.border=r,r.attachShadow(r.shadowRoot),r.name="border-rect",r.addEventListener("click",s=>{const l=i.listTreeStickCellPlugin.titleRows,{shadowTarget:a}=s.pickParams,h=Hr(a),{col:d,row:u}=h;_T(u-l.indexOf(u),i)})}if(!e.border){const r=Fe({x:0,y:0,width:0,height:0,cursor:"pointer"});e.add(r),e.border=r,r.attachShadow(r.shadowRoot),r.name="border-rect",r.addEventListener("click",s=>{const l=i.listTreeStickCellPlugin.titleRows,{shadowTarget:a}=s.pickParams,h=Hr(a),{col:d,row:u}=h;_T(u-l.indexOf(u),i)})}const n=t.border.shadowRoot,o=e.border.shadowRoot;return n.removeAllChild(),o.removeAllChild(),{shadowGroup:n,shadowGroupFrozen:o}}function _T(i,t){const e=t.getDrawRange();if(z(i)&&i>=t.frozenRowCount){const n=t.getFrozenRowsHeight(),o=t.getRowsHeight(0,i-1);t.scrollTop=Math.min(o-n,t.getAllRowsHeight()-e.height)-1}t.scenegraph.updateNextFrame()}const C9=()=>{Bt.registerComponent("listTreeStickCellPlugin",m9)},y9={};function _9(){return nh(y9,yg)}function w9(i,t,e,n,o,r,s,l,a,h,d,u,c,g,f,p,m,b,C){var _,w,y,S,A,R,x,T,M,B,P,F,H,E,k,I,L,D,O,N,W,$,U,Y,j;const G=_9()[d],X=f._getCellStyle(o,r),ht=Lc("padding",X,o,r,f);if(z(ht)&&(a=ht),!i){const gt=ws(o,r,p,f);b&&(i=f.scenegraph.highPerformanceGetCell(o,r,!0))&&i.role==="cell"&&i.setAttributes({x:e,y:n,width:s,height:l,lineWidth:(w=(_=p==null?void 0:p.group)===null||_===void 0?void 0:_.lineWidth)!==null&&w!==void 0?w:void 0,fill:(S=(y=p==null?void 0:p.group)===null||y===void 0?void 0:y.fill)!==null&&S!==void 0?S:void 0,stroke:(R=(A=p==null?void 0:p.group)===null||A===void 0?void 0:A.stroke)!==null&&R!==void 0?R:void 0,strokeArrayWidth:gt,strokeArrayColor:(T=(x=p==null?void 0:p.group)===null||x===void 0?void 0:x.strokeArrayColor)!==null&&T!==void 0?T:void 0,cursor:(B=(M=p==null?void 0:p.group)===null||M===void 0?void 0:M.cursor)!==null&&B!==void 0?B:void 0,lineDash:(F=(P=p==null?void 0:p.group)===null||P===void 0?void 0:P.lineDash)!==null&&F!==void 0?F:void 0,lineCap:"butt",clip:!0,cornerRadius:p.group.cornerRadius}),i&&i.role==="cell"||((i=new de({x:e,y:n,width:s,height:l,lineWidth:(E=(H=p==null?void 0:p.group)===null||H===void 0?void 0:H.lineWidth)!==null&&E!==void 0?E:void 0,fill:(I=(k=p==null?void 0:p.group)===null||k===void 0?void 0:k.fill)!==null&&I!==void 0?I:void 0,stroke:(D=(L=p==null?void 0:p.group)===null||L===void 0?void 0:L.stroke)!==null&&D!==void 0?D:void 0,strokeArrayWidth:gt,strokeArrayColor:(N=(O=p==null?void 0:p.group)===null||O===void 0?void 0:O.strokeArrayColor)!==null&&N!==void 0?N:void 0,cursor:($=(W=p==null?void 0:p.group)===null||W===void 0?void 0:W.cursor)!==null&&$!==void 0?$:void 0,lineDash:(Y=(U=p==null?void 0:p.group)===null||U===void 0?void 0:U.lineDash)!==null&&Y!==void 0?Y:void 0,lineCap:"butt",clip:!0,cornerRadius:p.group.cornerRadius})).role="cell",i.col=o,i.row=r,t==null||t.addCellGroup(i))}if(i.AABBBounds.width(),C&&Array.isArray(f.getCellValue(o,r))||!C){const gt=new Rl(m,{stroke:!1,x:a[3],y:a[0],canvas:(j=f.canvas)!==null&&j!==void 0?j:f.scenegraph.stage.window.getContext().canvas,mode:f.options.mode,modeParams:f.options.modeParams,spec:u,ClassType:G,width:s-a[3]-a[1],height:l-a[2]-a[0],chartInstance:c,dataId:g,data:f.getCellValue(o,r)||[],cellPadding:a,dpr:f.internalProps.pixelRatio,axes:f.isPivotChart()?f.internalProps.layoutMap.getChartAxes(o,r):[],tableChartOption:f.options.chartOption});i.appendChild(gt),f.internalProps.layoutMap.setChartInstance(o,r,gt.chartInstance)}return i}function S9(i,t,e,n,o,r,s,l,a,h,d,u,c,g,f,p,m,b){var C,_,w,y,S,A,R,x,T,M,B,P,F,H,E,k,I,L,D,O,N,W,$,U;if(!i){const ht=ws(o,r,f,g);b&&(i=g.scenegraph.highPerformanceGetCell(o,r,!0))&&i.role==="cell"&&i.setAttributes({x:e,y:n,width:l,height:a,lineWidth:(_=(C=f==null?void 0:f.group)===null||C===void 0?void 0:C.lineWidth)!==null&&_!==void 0?_:void 0,fill:(y=(w=f==null?void 0:f.group)===null||w===void 0?void 0:w.fill)!==null&&y!==void 0?y:void 0,stroke:(A=(S=f==null?void 0:f.group)===null||S===void 0?void 0:S.stroke)!==null&&A!==void 0?A:void 0,strokeArrayWidth:ht,strokeArrayColor:(x=(R=f==null?void 0:f.group)===null||R===void 0?void 0:R.strokeArrayColor)!==null&&x!==void 0?x:void 0,cursor:(M=(T=f==null?void 0:f.group)===null||T===void 0?void 0:T.cursor)!==null&&M!==void 0?M:void 0,lineDash:(P=(B=f==null?void 0:f.group)===null||B===void 0?void 0:B.lineDash)!==null&&P!==void 0?P:void 0,lineCap:"butt",clip:!0,cornerRadius:f.group.cornerRadius}),i&&i.role==="cell"||((i=new de({x:e,y:n,width:l,height:a,lineWidth:(H=(F=f==null?void 0:f.group)===null||F===void 0?void 0:F.lineWidth)!==null&&H!==void 0?H:void 0,fill:(k=(E=f==null?void 0:f.group)===null||E===void 0?void 0:E.fill)!==null&&k!==void 0?k:void 0,stroke:(L=(I=f==null?void 0:f.group)===null||I===void 0?void 0:I.stroke)!==null&&L!==void 0?L:void 0,strokeArrayWidth:ht,strokeArrayColor:(O=(D=f==null?void 0:f.group)===null||D===void 0?void 0:D.strokeArrayColor)!==null&&O!==void 0?O:void 0,cursor:(W=(N=f==null?void 0:f.group)===null||N===void 0?void 0:N.cursor)!==null&&W!==void 0?W:void 0,lineDash:(U=($=f==null?void 0:f.group)===null||$===void 0?void 0:$.lineDash)!==null&&U!==void 0?U:void 0,lineCap:"butt",clip:!0,cornerRadius:f.group.cornerRadius})).role="cell",i.col=o,i.row=r,t==null||t.addCellGroup(i))}let Y;if(c){let ht=o,gt=r;m&&(ht=m.start.col,gt=m.start.row),Y=g.getCellIcons(ht,gt)}let j=0,G=0;if(Array.isArray(Y)&&Y.length!==0){const{leftIconWidth:ht,rightIconWidth:gt,absoluteLeftIconWidth:Ct,absoluteRightIconWidth:Q}=Dc(Y,i,m,g);j=ht+gt,G=ht,i.forEachChildren(et=>{et.role==="icon-left"?et.setAttribute("x",et.attribute.x+h[3]):et.role==="icon-right"?et.setAttribute("x",et.attribute.x+l-gt-h[1]):et.role==="icon-absolute-right"&&et.setAttribute("x",et.attribute.x+l-Q-h[1])}),i.forEachChildren(et=>{u==="middle"?et.setAttribute("y",(a-et.AABBBounds.height())/2):u==="bottom"?et.setAttribute("y",a-et.AABBBounds.height()-h[2]):et.setAttribute("y",h[0])})}const X=x9(o,r,s-j,l,a,h,f,p,g);return X&&i.appendChild(X),X.render(),l-=h[1]+h[3]+j,a-=h[0]+h[2],d==="center"?X.setAttribute("x",h[3]+G+(l-X.AABBBounds.width())/2):d==="right"?X.setAttribute("x",h[3]+G+l-X.AABBBounds.width()):X.setAttribute("x",h[3]+G),u==="middle"?X.setAttribute("y",h[0]+(a-X.AABBBounds.height())/2):u==="bottom"?X.setAttribute("y",h[0]+a-X.AABBBounds.height()):X.setAttribute("y",h[0]),i}function x9(i,t,e,n,o,r,s,l,a){var h,d,u,c;const g=a._getCellStyle(i,t),f=wt("size",g,i,t,a),p=wt("spaceBetweenTextAndIcon",g,i,t,a),m=wt("defaultFill",g,i,t,a),b=wt("defaultStroke",g,i,t,a),C=wt("disableFill",g,i,t,a),_=wt("checkedFill",g,i,t,a),w=wt("checkedStroke",g,i,t,a),y=wt("disableCheckedFill",g,i,t,a),S=wt("disableCheckedStroke",g,i,t,a),A=wt("checkIconImage",g,i,t,a),R=wt("indeterminateIconImage",g,i,t,a),x=a.getCellValue(i,t),T=a.getCellOriginValue(i,t);let M,B,P=(h=x)!==null&&h!==void 0?h:"";ge(x)?(M=x.checked,B=x.disable,P=(d=x.text)!==null&&d!==void 0?d:""):typeof x=="boolean"&&(M=x,P=""),M=a.stateManager.syncCheckedState(i,t,l.field,M);const F=lo(i,t,a),H=a._getCellStyle(i,t),E=(u=H.autoWrapText)!==null&&u!==void 0?u:a.internalProps.autoWrapText,{lineClamp:k}=H,{checked:I,disable:L}=l;if(M==null||typeof M=="function"){const Y=ii(I,{col:i,row:t,table:a,context:null,value:x,dataValue:T});M=a.stateManager.syncCheckedState(i,t,l.field,Y)}const D=ii(L,{col:i,row:t,table:a,context:null,value:x,dataValue:T}),O=e==="auto",N=a.isAutoRowHeight(t),W={text:P.length===1?P[0]:P,maxLineWidth:O?1/0:n-(r[1]+r[3]+F)-f-p,textBaseline:"top",autoWrapText:E,lineClamp:k,wordBreak:"break-word",heightLimit:N?-1:o-Math.floor(r[0]+r[2]),pickable:!1,dx:F,whiteSpace:P.length!==1||E?"normal":"no-wrap"},$={x:0,y:0,text:s.text?Object.assign({},s.text,W):W,icon:{width:Math.floor(f/1.4),height:Math.floor(f/1.4)},box:{width:f,height:f},spaceBetweenTextAndIcon:p,disabled:(c=B??D)!==null&&c!==void 0&&c};M==="indeterminate"?($.checked=void 0,$.indeterminate=!0):($.checked=M,$.indeterminate=void 0),m&&($.box.fill=m),b&&($.box.stroke=b),C&&($.box.disableFill=C),_&&($.box.checkedFill=_),w&&($.box.checkedStroke=w),y&&($.box.disableCheckedFill=y),S&&($.box.disableCheckedStroke=S),A&&($.icon.checkIconImage=A),R&&($.icon.indeterminateIconImage=R);const U=new Rr($);return U.name="checkbox",U}function R9(i,t,e,n,o,r,s,l,a,h,d,u,c,g,f){var p,m,b,C,_,w,y,S,A,R,x,T;if(!i){const P=ws(o,r,g,c);(i=new de({x:e,y:n,width:l,height:a,lineWidth:(m=(p=g==null?void 0:g.group)===null||p===void 0?void 0:p.lineWidth)!==null&&m!==void 0?m:void 0,fill:(C=(b=g==null?void 0:g.group)===null||b===void 0?void 0:b.fill)!==null&&C!==void 0?C:void 0,stroke:(w=(_=g==null?void 0:g.group)===null||_===void 0?void 0:_.stroke)!==null&&w!==void 0?w:void 0,strokeArrayWidth:P,strokeArrayColor:(S=(y=g==null?void 0:g.group)===null||y===void 0?void 0:y.strokeArrayColor)!==null&&S!==void 0?S:void 0,cursor:(R=(A=g==null?void 0:g.group)===null||A===void 0?void 0:A.cursor)!==null&&R!==void 0?R:void 0,lineDash:(T=(x=g==null?void 0:g.group)===null||x===void 0?void 0:x.lineDash)!==null&&T!==void 0?T:void 0,lineCap:"butt",clip:!0,cornerRadius:g.group.cornerRadius})).role="cell",i.col=o,i.row=r,t==null||t.addCellGroup(i)}const{width:M,height:B}=A9(o,r,s,l,a,h,g,f,i,c);return l-=h[1]+h[3],a-=h[0]+h[2],i.forEachChildren(P=>{d==="center"?P.setAttribute("x",h[3]+P.attribute.x+(l-M)/2):d==="right"?P.setAttribute("x",h[3]+P.attribute.x+l-M):P.setAttribute("x",h[3]+P.attribute.x),u==="middle"?P.setAttribute("y",h[0]+P.attribute.y+(a-B)/2):u==="bottom"?P.setAttribute("y",h[0]+P.attribute.y+a-B):P.setAttribute("y",h[0]+P.attribute.y)}),i}function A9(i,t,e,n,o,r,s,l,a,h){var d,u;const c=h._getCellStyle(i,t);let g=wt("size",c,i,t,h),f=wt("innerRadius",c,i,t,h),p=wt("outerRadius",c,i,t,h);const m=wt("spaceBetweenTextAndIcon",c,i,t,h),b=wt("spaceBetweenRadio",c,i,t,h),C=wt("defaultFill",c,i,t,h),_=wt("defaultStroke",c,i,t,h),w=wt("disableFill",c,i,t,h),y=wt("checkedFill",c,i,t,h),S=wt("checkedStroke",c,i,t,h),A=wt("disableCheckedFill",c,i,t,h),R=wt("disableCheckedStroke",c,i,t,h);ft(p)?g=2*p:p=Math.round(g/2),(!ft(f)||f<0)&&(f=Math.round(p/7*3));const x=h.getCellValue(i,t),T=h.getCellOriginValue(i,t),M=lo(i,t,h),B=h._getCellStyle(i,t),P=(d=B.autoWrapText)!==null&&d!==void 0?d:h.internalProps.autoWrapText,{lineClamp:F}=B,H=e==="auto",E=h.heightMode==="autoHeight",k={maxLineWidth:H?1/0:n-(r[1]+r[3]+M)-g-m,textBaseline:"top",autoWrapText:P,lineClamp:F,wordBreak:"break-word",heightLimit:E?-1:o-Math.floor(r[0]+r[2]),pickable:!1,dx:M},I={x:0,y:0,text:s.text?Object.assign({},s.text,k):k,circle:{innerRadius:f,outerRadius:p},spaceBetweenTextAndIcon:m};C&&(I.circle.fill=C),_&&(I.circle.stroke=_),w&&(I.circle.disableFill=w),y&&(I.circle.checkedFill=y),S&&(I.circle.checkedStroke=S),A&&(I.circle.disableCheckedFill=A),R&&(I.circle.disableCheckedStroke=R);let L=0,D=0;const O=(u=l.radioDirectionInCell)!==null&&u!==void 0?u:"vertical";if(lt(x))x.forEach((N,W)=>{const $=wT(N,T,W,i,t,l,P,I,h);$&&a.appendChild($),$.id=`radio-${i}-${t}-${W}`,$.render();const U=$.AABBBounds;O==="vertical"?($.setAttribute("y",D),D+=U.height()+(W!==x.length-1?b:0),L=Math.max(L,U.width())):O==="horizontal"&&($.setAttribute("x",L),L+=U.width()+(W!==x.length-1?b:0),D=Math.max(D,U.height()))});else{const N=wT(x,T,void 0,i,t,l,P,I,h);N&&a.appendChild(N),N.id=`radio-${i}-${t}`,N.render();const W=N.AABBBounds;L=W.width(),D=W.height()}return{width:L,height:D}}function wT(i,t,e,n,o,r,s,l,a){const h=T9(i,t,e,n,o,r,a),d=M9(i,t,n,o,r,a),u=ge(i)?i.text:bi(i)?"":i??"",c=xt({},l,{checked:h,disabled:d,text:{text:u.length===1?u[0]:u,whiteSpace:u.length!==1||s?"normal":"no-wrap"},boundsPadding:0}),g=new Qa(c);return g.name="radio",g}function T9(i,t,e,n,o,r,s){var l,a;const h=(l=r.radioCheckType)!==null&&l!==void 0?l:"column";let d,u;return ge(i)?d=i.checked:typeof i=="boolean"&&(d=i),d=s.stateManager.syncRadioState(n,o,r.field,h,e,d),d!=null&&typeof d!="function"||(u=ii(r.checked,{col:n,row:o,table:s,context:null,value:i,dataValue:t}),d=s.stateManager.syncRadioState(n,o,r.field,h,e,u)),(a=d??u)!==null&&a!==void 0&&a}function M9(i,t,e,n,o,r){var s;let l;ge(i)&&(l=i.disable);const a=ii(o.disable,{col:e,row:n,table:r,context:null,value:i,dataValue:t});return(s=l??a)!==null&&s!==void 0&&s}const Dr=new tz,Or=new ds;function B9(i,t,e,n,o,r,s,l,a,h,d,u){var c,g,f,p,m,b,C,_,w,y,S,A,R,x,T,M,B,P,F,H,E,k,I,L;if(!i){const O=ws(o,r,d,h);u&&(i=h.scenegraph.highPerformanceGetCell(o,r,!0))&&i.role==="cell"&&i.setAttributes({x:e,y:n,width:s,height:l,lineWidth:(g=(c=d==null?void 0:d.group)===null||c===void 0?void 0:c.lineWidth)!==null&&g!==void 0?g:void 0,fill:(p=(f=d==null?void 0:d.group)===null||f===void 0?void 0:f.fill)!==null&&p!==void 0?p:void 0,stroke:(b=(m=d==null?void 0:d.group)===null||m===void 0?void 0:m.stroke)!==null&&b!==void 0?b:void 0,strokeArrayWidth:O,strokeArrayColor:(_=(C=d==null?void 0:d.group)===null||C===void 0?void 0:C.strokeArrayColor)!==null&&_!==void 0?_:void 0,cursor:(y=(w=d==null?void 0:d.group)===null||w===void 0?void 0:w.cursor)!==null&&y!==void 0?y:void 0,lineDash:(A=(S=d==null?void 0:d.group)===null||S===void 0?void 0:S.lineDash)!==null&&A!==void 0?A:void 0,lineCap:"butt",clip:!0,cornerRadius:d.group.cornerRadius}),i&&i.role==="cell"||((i=new de({x:e,y:n,width:s,height:l,lineWidth:(x=(R=d==null?void 0:d.group)===null||R===void 0?void 0:R.lineWidth)!==null&&x!==void 0?x:void 0,fill:(M=(T=d==null?void 0:d.group)===null||T===void 0?void 0:T.fill)!==null&&M!==void 0?M:void 0,stroke:(P=(B=d==null?void 0:d.group)===null||B===void 0?void 0:B.stroke)!==null&&P!==void 0?P:void 0,strokeArrayWidth:O,strokeArrayColor:(H=(F=d==null?void 0:d.group)===null||F===void 0?void 0:F.strokeArrayColor)!==null&&H!==void 0?H:void 0,cursor:(k=(E=d==null?void 0:d.group)===null||E===void 0?void 0:E.cursor)!==null&&k!==void 0?k:void 0,lineDash:(L=(I=d==null?void 0:d.group)===null||I===void 0?void 0:I.lineDash)!==null&&L!==void 0?L:void 0,lineCap:"butt",clip:!0,cornerRadius:d.group.cornerRadius})).role="cell",i.col=o,i.row=r,t==null||t.addCellGroup(i))}const D=P9(o,r,s,l,a,h);return D&&i.appendChild(D),i}function P9(i,t,e,n,o,r){let s,l;const a=r.internalProps.layoutMap.getBody(i,t).sparklineSpec,h=r.getCellValue(i,t);if(!Array.isArray(h))return;const d=o[3],u=o[0];e-=o[1]+o[3];const c=n-=o[0]+o[2];if(typeof a=="function"){const _={col:i,row:t,dataValue:r.getCellOriginValue(i,t)||"",value:r.getCellValue(i,t)||"",rect:r.getCellRangeRelativeRect(r.getCellRange(i,t)),table:r};s=a(_),l=ST(s,d,u,e,n)}else s=a,l=ST(a,d,u,e,n);const g=[],f=[];let p,m;if(typeof s.xField=="object")Dr.domain(s.xField.domain),p=s.xField.field;else if(typeof s.xField=="string"){const _=h.map(w=>w[s.xField]);Dr.domain(_),p=s.xField}else Array.isArray(h)&&(Dr.domain(Array.from({length:h.length},(_,w)=>w)),p=s.xField);if(Dr.range([0,e]),typeof s.yField=="object")Or.domain(s.yField.domain),m=s.yField.field;else if(typeof s.yField=="string"){const _=xT(h,s.yField);Or.domain([Math.min(..._),Math.max(..._)]),m=s.yField}else if(Array.isArray(h)){const _=xT(h);Or.domain([Math.min(..._),Math.max(..._)]),m=s.yField}if(Or.range([0,n]),typeof s.xField=="object"&&Array.isArray(s.xField.domain)){const _=h.map(y=>y[s.xField.field]),w=s.xField.domain;for(let y=0;y<w.length;y++){let S=!1;for(let A=0;A<_.length;A++)if(w[y]===_[A]){const R=h[A];if(!z(R[p])||!z(R[m]))break;g.push({x:0+Dr.scale(R[p]),y:c-Or.scale(R[m]),defined:z(R[m])}),f.push(R),S=!0;break}S||(g.push({x:0+Dr.scale(w[y]),y:0,defined:!1}),f.push({[p]:w[y],[m]:null}))}}else for(let _=0;_<h.length;_++){const w=h[_];g.push({x:0+Dr.scale(p?w[p]:_),y:c-Or.scale(m?w[m]:w),defined:z(m?w[m]:w),rawData:w}),f.push(w)}const b=l.getChildByName("sparkline-line");b&&b.setAttribute("points",g),b.bandwidth=Dr.step(),b.min=Or.range()[0],b.max=Or.range()[1];const C=l.getChildByName("sparkline-symbol-group");if(C){const _=s.pointShowRule==="isolatedPoint";if(s.pointShowRule==="all")for(let w=0;w<g.length;w++){const{x:y,y:S,defined:A}=g[w];if(A){const R=Ea({x:y,y:S});C.appendChild(R)}}else if(_)for(let w=0;w<g.length;w++){const{x:y,y:S,defined:A}=g[w];if(A&&(!g[w-1]||!g[w-1].defined)&&(!g[w+1]||!g[w+1].defined)){const R=Ea({x:y,y:S});C.appendChild(R)}}}return l}function ST(i,t,e,n,o){var r,s,l,a,h,d,u,c,g,f,p,m,b,C,_,w,y,S,A,R,x,T;let M;M=typeof i=="function"?i(null):i;const B=new de({x:t,y:e,width:n,height:o,stroke:!1,fill:!1});if(B.name="sparkline",M.type==="line"){const P=fn({x:0,y:0,curveType:M.smooth?"monotoneX":"linear",stroke:(l=(s=(r=M.line)===null||r===void 0?void 0:r.style)===null||s===void 0?void 0:s.stroke)!==null&&l!==void 0?l:"blue",lineWidth:(d=(h=(a=M.line)===null||a===void 0?void 0:a.style)===null||h===void 0?void 0:h.strokeWidth)!==null&&d!==void 0?d:2});P.name="sparkline-line",B.addChild(P),M.crosshair&&(P.hover=(c=(u=M.crosshair)===null||u===void 0?void 0:u.style)!==null&&c!==void 0?c:{stroke:"#000",interpolate:"linear"});const F=new de({x:0,y:0,width:n,height:o,stroke:!1,fill:!1});F.name="sparkline-symbol-group",F.setTheme({symbol:{stroke:(p=(f=(g=M.point)===null||g===void 0?void 0:g.style)===null||f===void 0?void 0:f.stroke)!==null&&p!==void 0?p:"#000",lineWidth:(C=(b=(m=M.point)===null||m===void 0?void 0:m.style)===null||b===void 0?void 0:b.strokeWidth)!==null&&C!==void 0?C:1,fill:(y=(w=(_=M.point)===null||_===void 0?void 0:_.style)===null||w===void 0?void 0:w.fill)!==null&&y!==void 0?y:"#000",size:2*((R=(A=(S=M.point)===null||S===void 0?void 0:S.style)===null||A===void 0?void 0:A.size)!==null&&R!==void 0?R:3),symbolType:"circle"}}),B.addChild(F),F.hover=(T=(x=M.point)===null||x===void 0?void 0:x.hover)!==null&&T!==void 0&&T}return B}function xT(i,t){const e=[];for(let n=0;n<i.length;n++){const o=i[n];z(t)&&z(o[t])?e.push(o[t]):!z(t)&&z(o)&&e.push(o)}return e}const fv=vn();function H9(i,t,e,n,o,r,s,l,a,h,d,u,c,g,f,p,m){var b,C,_,w,y,S,A,R,x,T,M,B,P,F,H,E,k,I,L,D,O,N,W,$,U,Y,j,G,X,ht;const gt=g._getCellStyle(n,o),Ct=Lc("padding",gt,n,o,g);!((b=g.options.customConfig)===null||b===void 0)&&b.imageMargin?h=Qt((C=g.options.customConfig)===null||C===void 0?void 0:C.imageMargin):z(Ct)&&(h=Ct),!((_=f==null?void 0:f.text)===null||_===void 0)&&_.textAlign&&(d=(w=f==null?void 0:f.text)===null||w===void 0?void 0:w.textAlign),!((y=f==null?void 0:f.text)===null||y===void 0)&&y.textBaseline&&(u=(S=f==null?void 0:f.text)===null||S===void 0?void 0:S.textBaseline);const Q=ws(n,o,f,g);let et,vt;if(m&&(et=g.scenegraph.highPerformanceGetCell(n,o,!0),et&&et.role==="cell"&&et.setAttributes({x:t,y:e,width:r,height:s,lineWidth:(R=(A=f==null?void 0:f.group)===null||A===void 0?void 0:A.lineWidth)!==null&&R!==void 0?R:void 0,fill:(T=(x=f==null?void 0:f.group)===null||x===void 0?void 0:x.fill)!==null&&T!==void 0?T:void 0,stroke:(B=(M=f==null?void 0:f.group)===null||M===void 0?void 0:M.stroke)!==null&&B!==void 0?B:void 0,strokeArrayWidth:Q,strokeArrayColor:(F=(P=f==null?void 0:f.group)===null||P===void 0?void 0:P.strokeArrayColor)!==null&&F!==void 0?F:void 0,cursor:(E=(H=f==null?void 0:f.group)===null||H===void 0?void 0:H.cursor)!==null&&E!==void 0?E:void 0,lineDash:(I=(k=f==null?void 0:f.group)===null||k===void 0?void 0:k.lineDash)!==null&&I!==void 0?I:void 0,lineCap:"butt",clip:!0,cornerRadius:f.group.cornerRadius})),et&&et.role==="cell"||(et=new de({x:t,y:e,width:r,height:s,lineWidth:(D=(L=f==null?void 0:f.group)===null||L===void 0?void 0:L.lineWidth)!==null&&D!==void 0?D:void 0,fill:(N=(O=f==null?void 0:f.group)===null||O===void 0?void 0:O.fill)!==null&&N!==void 0?N:void 0,stroke:($=(W=f==null?void 0:f.group)===null||W===void 0?void 0:W.stroke)!==null&&$!==void 0?$:void 0,strokeArrayWidth:Q,strokeArrayColor:(Y=(U=f==null?void 0:f.group)===null||U===void 0?void 0:U.strokeArrayColor)!==null&&Y!==void 0?Y:void 0,cursor:(G=(j=f==null?void 0:f.group)===null||j===void 0?void 0:j.cursor)!==null&&G!==void 0?G:void 0,lineDash:(ht=(X=f==null?void 0:f.group)===null||X===void 0?void 0:X.lineDash)!==null&&ht!==void 0?ht:void 0,lineCap:"butt",clip:!0,cornerRadius:f.group.cornerRadius}),et.role="cell",et.col=n,et.row=o,i==null||i.addCellGroup(et)),c){let _t=n,ct=o;p&&(_t=p.start.col,ct=p.start.row),vt=g.getCellIcons(_t,ct)}let bt=0,dt=0;if(Array.isArray(vt)&&vt.length!==0){const{leftIconWidth:_t,rightIconWidth:ct,absoluteLeftIconWidth:Wt,absoluteRightIconWidth:Yt}=Dc(vt,et,p,g);bt=_t,dt=ct,et.forEachChildren(yt=>{yt.role==="icon-left"?yt.setAttribute("x",yt.attribute.x+h[3]):yt.role==="icon-right"?yt.setAttribute("x",yt.attribute.x+r-ct-h[1]):yt.role==="icon-absolute-right"&&yt.setAttribute("x",yt.attribute.x+r-Yt-h[1])}),et.forEachChildren(yt=>{u==="middle"?yt.setAttribute("y",(s-yt.AABBBounds.height())/2):u==="bottom"?yt.setAttribute("y",s-yt.AABBBounds.height()-h[2]):yt.setAttribute("y",h[0])}),et._cellLeftIconWidth=bt,et._cellRightIconWidth=dt}const ot=g.getCellValue(n,o),ut=document.createElement("video");ut.addEventListener("loadeddata",()=>{a&&dR(n,o,ut.videoWidth,ut.videoHeight,g.scenegraph,h,et);const{width:_t,height:ct,isMerge:Wt}=wl(et,g);if(l){const{width:_e,height:Oe}=Ec(ut.videoWidth,ut.videoHeight,_t-h[1]-h[3],ct-h[0]-h[2]),He=Bm(0,0,_t,ct,_e,Oe,d,u,h);st.setAttributes({width:_e,height:Oe,x:He.x,y:He.y,dx:0})}else st.setAttributes({x:h[3],y:h[0],width:_t-h[1]-h[3],height:ct-h[2]-h[0],dy:0});Wt&&Pm(et.mergeStartCol,et.mergeEndCol,et.mergeStartRow,et.mergeEndRow,g);const{width:Yt,height:yt}=wl(et,g),mt=Math.floor(Math.min(Yt-h[1]-h[3],yt-h[2]-h[0])/2),ie=0+(Yt>st.attribute.width?st.attribute.x-0+st.attribute.width/2:Yt/2),le=0+(yt>st.attribute.height?st.attribute.y-0+st.attribute.height/2:yt/2),Zt=new ps({x:ie-mt/2,y:le-mt/2,width:mt,height:mt,image:fv.play.svg,cursor:fv.play.cursor});Zt.name="play-icon",et.appendChild(Zt),g.scenegraph.updateNextFrame()}),ut.onerror=()=>{st.image=fv.damage_pic.svg},ut.src=ot,ut.setAttribute("preload","auto");const st=gu({x:h[3],y:h[0],width:r-h[1]-h[3],height:s-h[2]-h[0],image:ut,cursor:"pointer"});return st.name="image",st.keepAspectRatio=l,st.textAlign=d,st.textBaseline=u,et.appendChild(st),et}function E9(i,t,e,n,o,r,s,l,a,h,d,u,c,g,f,p,m,b,C){var _,w,y,S,A,R,x,T,M,B,P,F,H,E,k,I,L,D,O,N,W,$,U,Y,j,G,X,ht,gt,Ct,Q,et;const vt=i._getCellStyle(r,s),bt=Lc("padding",vt,r,s,i);z(bt)&&(d=bt),!((_=m==null?void 0:m.text)===null||_===void 0)&&_.textAlign&&(u=(w=m==null?void 0:m.text)===null||w===void 0?void 0:w.textAlign),!((y=m==null?void 0:m.text)===null||y===void 0)&&y.textBaseline&&(c=(S=m==null?void 0:m.text)===null||S===void 0?void 0:S.textBaseline);const dt=i.isAutoRowHeight(s),ot=l==="auto",ut=(A=vt.autoWrapText)!==null&&A!==void 0?A:i.internalProps.autoWrapText,st=vt.lineClamp,_t=ws(r,s,m,i);let ct;if(C&&(ct=i.scenegraph.getCell(r,s,!0),ct&&ct.role==="cell"&&ct.setAttributes({x:n,y:o,width:a,height:h,lineWidth:(x=(R=m==null?void 0:m.group)===null||R===void 0?void 0:R.lineWidth)!==null&&x!==void 0?x:void 0,fill:(M=(T=m==null?void 0:m.group)===null||T===void 0?void 0:T.fill)!==null&&M!==void 0?M:void 0,stroke:(P=(B=m==null?void 0:m.group)===null||B===void 0?void 0:B.stroke)!==null&&P!==void 0?P:void 0,strokeArrayWidth:_t??void 0,strokeArrayColor:(H=(F=m==null?void 0:m.group)===null||F===void 0?void 0:F.strokeArrayColor)!==null&&H!==void 0?H:void 0,cursor:(k=(E=m==null?void 0:m.group)===null||E===void 0?void 0:E.cursor)!==null&&k!==void 0?k:void 0,lineDash:(L=(I=m==null?void 0:m.group)===null||I===void 0?void 0:I.lineDash)!==null&&L!==void 0?L:void 0,lineCap:"butt",clip:!0,cornerRadius:m.group.cornerRadius})),ct&&ct.role==="cell"||(ct=new de({x:n,y:o,width:a,height:h,lineWidth:(O=(D=m==null?void 0:m.group)===null||D===void 0?void 0:D.lineWidth)!==null&&O!==void 0?O:void 0,fill:(W=(N=m==null?void 0:m.group)===null||N===void 0?void 0:N.fill)!==null&&W!==void 0?W:void 0,stroke:(U=($=m==null?void 0:m.group)===null||$===void 0?void 0:$.stroke)!==null&&U!==void 0?U:void 0,strokeArrayWidth:_t??void 0,strokeArrayColor:(j=(Y=m==null?void 0:m.group)===null||Y===void 0?void 0:Y.strokeArrayColor)!==null&&j!==void 0?j:void 0,cursor:(X=(G=m==null?void 0:m.group)===null||G===void 0?void 0:G.cursor)!==null&&X!==void 0?X:void 0,lineDash:(gt=(ht=m==null?void 0:m.group)===null||ht===void 0?void 0:ht.lineDash)!==null&>!==void 0?gt:void 0,lineCap:"butt",clip:!0,cornerRadius:m.group.cornerRadius}),ct.role="cell",ct.col=r,ct.row=s,e==null||e.addCellGroup(ct)),f&&ct.appendChild(f),p){const Wt=t;let Yt;if(g){let yt=r,mt=s;b&&(yt=b.start.col,mt=b.start.row),Yt=i.getCellIcons(yt,mt)}if(Y6(ct,Yt,Wt,d,ot,dt,ut,typeof st=="number"?st:void 0,ct.attribute.width,ct.attribute.height,u,c,i,m,b),(Ct=m==null?void 0:m._vtable)===null||Ct===void 0?void 0:Ct.marked){const yt=n0({x:ct.attribute.width,y:0,startAngle:Math.PI/2,endAngle:Math.PI,outerRadius:6,fill:"#3073F2",pickable:!1});yt.name="mark",ct.appendChild(yt)}}return f&&ct.setAttributes({width:Math.max(ct.attribute.width,(Q=f.attribute.width)!==null&&Q!==void 0?Q:0),height:Math.max(ct.attribute.height,(et=f.attribute.height)!==null&&et!==void 0?et:0)}),ct}function L9(i,t,e,n,o,r,s,l,a,h){var d,u,c,g,f,p;i.dependField&&(o=(u=(d=a.getCellOriginRecord(r,s))===null||d===void 0?void 0:d[i.dependField])!==null&&u!==void 0?u:o),i.barType=(c=i.barType)!==null&&c!==void 0?c:"default",i.min=(g=ii(i.min,{col:r,row:s,table:a,value:n,dataValue:o,cellHeaderPaths:void 0}))!==null&&g!==void 0?g:0,i.max=(f=ii(i.max,{col:r,row:s,table:a,value:n,dataValue:o,cellHeaderPaths:void 0}))!==null&&f!==void 0?f:i.min+100;let m=0;m=h?a.getRowsHeight(h.start.row,h.end.row):a.getRowHeight(s);let b=e,C=m,_=0;ft(a.theme._contentOffset)&&(_=a.theme._contentOffset);const w=new de({x:-_,y:-_,width:b,height:C});w.name="progress-bar";const{showBar:y,barColor:S,barBgColor:A,barPositiveColor:R,barNegativeColor:x,barAxisColor:T,barRightToLeft:M,showBarMark:B,barMarkPositiveColor:P,barMarkNegativeColor:F,barMarkWidth:H,barMarkPosition:E}=t;let{barHeight:k,barBottom:I,barPadding:L}=t;L.length===1?L=[L[0],L[0],L[0],L[0]]:L.length===2?L=[L[0],L[1],L[0],L[1]]:L.length===3&&(L=[L[0],L[1],L[2],L[1]]),L=L.map((G,X)=>{if(typeof G=="string"&&pc.endsWith(G,"%")){const ht=Number(G.substr(0,G.length-1));return X===0||X===2?m*ht/100:e*ht/100}return Number(G)});const D=Qt(wt("borderLineWidth",t,r,s,a)),O=Math.max(L[0],Math.ceil(D[0]/2)),N=Math.max(L[1],Math.floor(D[1]/2)),W=Math.max(L[2],Math.floor(D[2]/2)),$=Math.max(L[3],Math.ceil(D[3]/2));b-=N+$,C-=W+O,s===a.rowCount-1&&[0,"0"].includes(I)&&(C-=1);const U=O,Y=$,j=b;if(typeof k=="string"&&pc.endsWith(k,"%")?(k=Number(k.substr(0,k.length-1)),k=C*k/100):k=Number(k),typeof I=="string"&&pc.endsWith(I,"%")?(I=Number(I.substr(0,I.length-1)),I=C*I/100):I=Number(I),ii(y,{col:r,row:s,table:a,context:null,value:n,dataValue:o})){let G=`${o}`;pc.endsWith(G,"%")&&(G=G.substr(0,G.length-1));const X=Number(G);if(isNaN(X))return w;if(((p=i.barType)!==null&&p!==void 0?p:"default")==="default"){const ht=X<i.min?0:X>i.max?1:(X-i.min)/(i.max-i.min),gt=b,Ct=U+C-k-I;let Q=Math.min(gt*ht,gt);const et=M?Y+j-Q:Y;r!==a.colCount-1||ht!==1||M||(Q-=1);const vt=ii(A,{col:r,row:s,table:a,context:null,value:n,dataValue:o,percentile:ht});if(vt){const ot=Fe({x:et,y:Ct,width:gt,height:k,fill:vt});w.addChild(ot)}const bt=ii(S,{col:r,row:s,table:a,context:null,value:n,dataValue:o,percentile:ht})||"#20a8d8",dt=Fe({x:et,y:Ct,width:Q,height:k,fill:bt});w.addChild(dt)}else if(i.barType==="negative"){const ht=i.min<0?-i.min:0,gt=i.max>0?i.max:0,Ct=ht/(ht+gt),Q=1-Ct,et=X>0?X/gt:0,vt=X<0?-X/ht:0,bt=b,dt=U+C-k-I,ot=Y,ut=ii(A,{col:r,row:s,table:a,context:null,value:n,dataValue:o,percentile:et});if(ut){const He=Fe({x:ot,y:dt,width:bt,height:k,fill:ut});w.addChild(He)}const st=M?Q*bt:Ct*bt,_t=Math.min(bt*Ct*vt,bt),ct=M?{left:ot+st,top:dt,width:_t,height:k}:{left:ot+st-_t,top:dt,width:_t,height:k},Wt=ii(x,{col:r,row:s,table:a,context:null,value:n,dataValue:o,percentile:vt})||"#20a8d8",Yt=Fe({x:ct.left,y:ct.top,width:ct.width,height:ct.height,fill:Wt});w.addChild(Yt);let yt=Math.min(bt*Q*et,bt);r!==a.colCount-1||et!==1||M||(yt-=1);const mt=M?{left:ot+st-yt,top:dt,width:yt,height:k}:{left:ot+st,top:dt,width:yt,height:k},ie=ii(R,{col:r,row:s,table:a,context:null,value:n,dataValue:o,percentile:et})||"#20a8d8",le=Fe({x:mt.left,y:mt.top,width:mt.width,height:mt.height,fill:ie});w.addChild(le);const Zt=M?ct.left:mt.left,_e=ii(T,{col:r,row:s,table:a,context:null,value:n,dataValue:o,percentile:et}),Oe=fn({x:0,y:0,stroke:_e,lineWidth:1,lineDash:[2,2],points:[{x:Zt,y:0},{x:Zt,y:m}]});if(w.addChild(Oe),B&&(et||vt)){const He=H,Ht=[];let Et;if(et>0)if(Et=ii(P,{col:r,row:s,table:a,context:null,value:n,dataValue:o,percentile:et})||"#20a8d8",E==="right"){const Tt=M?mt.left+H/2:mt.left+mt.width-H/2;Ht.push({x:Tt,y:mt.top}),Ht.push({x:Tt,y:mt.top+mt.height})}else E==="bottom"&&(Ht.push({x:mt.left,y:mt.top+mt.height-H/2}),Ht.push({x:mt.left+mt.width,y:mt.top+mt.height-H/2}));else if(vt>0)if(Et=ii(F,{col:r,row:s,table:a,context:null,value:n,dataValue:o,percentile:vt})||"#20a8d8",E==="right"){const Tt=M?ct.left+ct.width-H/2:ct.left+H/2;Ht.push({x:Tt,y:ct.top}),Ht.push({x:Tt,y:ct.top+ct.height})}else E==="bottom"&&(Ht.push({x:ct.left,y:ct.top+ct.height-H/2}),Ht.push({x:ct.left+ct.width,y:ct.top+ct.height-H/2}));const Rt=fn({x:0,y:0,stroke:Et,lineWidth:He,points:Ht});w.addChild(Rt)}}else if(i.barType==="negative_no_axis"){const ht=i.min<0?-i.min:0,gt=i.max>0?i.max:0,Ct=Math.max(ht,gt),Q=Ct===0?0:Math.abs(X)/Ct,et=b;let vt=Math.min(et*Q,et);r!==a.colCount-1||Q!==1||M||(vt-=1);const bt=U+C-k-I,dt=M?Y+j-vt:Y,ot=ii(A,{col:r,row:s,table:a,context:null,value:n,dataValue:o,percentile:Q});if(ot){const ct=Fe({x:dt,y:bt,width:et,height:k,fill:ot});w.addChild(ct)}const ut={left:dt,top:bt,width:vt,height:k};let st;st=X>=0?ii(R,{col:r,row:s,table:a,context:null,value:n,percentile:Q,dataValue:o})||"#20a8d8":ii(x,{col:r,row:s,table:a,context:null,value:n,dataValue:o,percentile:Q})||"#20a8d8";const _t=Fe({x:ut.left,y:ut.top,width:ut.width,height:ut.height,fill:st});if(w.addChild(_t),B&&X){const ct=H,Wt=[];let Yt;if(Yt=X>=0?ii(P,{col:r,row:s,table:a,context:null,value:n,dataValue:o,percentile:Q})||"#20a8d8":ii(F,{col:r,row:s,table:a,context:null,value:n,dataValue:o,percentile:Q})||"#20a8d8",E==="right"){const mt=M?ut.left+H/2:ut.left+ut.width-H/2;Wt.push({x:mt,y:ut.top}),Wt.push({x:mt,y:ut.top+ut.height})}else E==="bottom"&&(Wt.push({x:ut.left,y:ut.top+ut.height-H/2}),Wt.push({x:ut.left+ut.width,y:ut.top+ut.height-H/2}));const yt=fn({x:0,y:0,stroke:Yt,lineWidth:ct,points:Wt});w.addChild(yt)}}}return w}function k9(i,t,e,n,o,r){var s,l,a,h,d,u,c,g,f;if(e!=null&&e.zero&&(i=Math.min(i,0),t=Math.max(t,0)),e==null?void 0:e.expand){const b=i,C=t;z(e.expand.min)&&(i=b-(C-b)*e.expand.min),z(e.expand.max)&&(t=C+(C-b)*e.expand.max)}let p,m;if(ft(e==null?void 0:e.min)&&(i=e.min),ft(e==null?void 0:e.max)&&(t=e.max),(e==null?void 0:e.type)==="log"?(p=new Ya,p.base((s=e==null?void 0:e.base)!==null&&s!==void 0?s:10)):(e==null?void 0:e.type)==="symlog"?(p=new Xa,p.constant((l=e==null?void 0:e.constant)!==null&&l!==void 0?l:10)):p=new ds,p.domain([i,t],!!(e!=null&&e.nice)),e==null?void 0:e.nice){let b=(u=(h=(a=e.tick)===null||a===void 0?void 0:a.forceTickCount)!==null&&h!==void 0?h:(d=e.tick)===null||d===void 0?void 0:d.tickCount)!==null&&u!==void 0?u:10;ue(b)&&(b=b({axisLength:o,labelStyle:(g=(c=e==null?void 0:e.label)===null||c===void 0?void 0:c.style)!==null&&g!==void 0?g:{fontSize:Eh.LABEL_FONT_SIZE}})),e.niceType==="accurateFirst"&&(b=Math.max(10,b)),Mt(e.min)&&Mt(e.max)?p.nice(b):z(e.min)&&Mt(e.max)?p.niceMax(b):Mt(e.min)&&z(e.max)&&p.niceMin(b)}return delete p._niceType,r||(m=p.ticks(ft(e==null?void 0:e.tickCount)?e==null?void 0:e.tickCount:5,{noDecimals:(f=e==null?void 0:e.tick)===null||f===void 0?void 0:f.noDecimals})),{range:p.domain(),ticks:m}}const kg=()=>{Bt.registerFunction("createChartCellGroup",w9),Bt.registerFunction("getAxisDomainRangeAndLabels",k9)},Fg=()=>{Bt.registerFunction("createCheckboxCellGroup",S9)},Ig=()=>{Bt.registerFunction("createImageCellGroup",Z6)},Dg=()=>{Bt.registerFunction("createProgressBarCell",L9)},Og=()=>{Bt.registerFunction("createRadioCellGroup",R9)},zg=()=>{Bt.registerFunction("createSparkLineCellGroup",B9)},Il=()=>{Bt.registerFunction("createTextCellGroup",E9)},Wg=()=>{Bt.registerFunction("createVideoCellGroup",H9)};Mg(),Bg(),Pg(),Hg(),Eg(),Lg(),C9(),kg(),Fg(),Ig(),Dg(),Og(),zg(),Il(),Wg();class F9 extends fT{}Il();class I9 extends fT{}function D9(i,t,e,n,o,r){const s=r.columnHeaderLevelCount,l=[],a=[];for(let c=0;c<e.length;c++)n.includes(e[c])||a.push(o[c]);for(let c=0;c<n.length;c++)if(!e.includes(n[c])){const g={col:i,row:s+c};l.push(g)}let h=r.getParentCellId(i,t),d=r.getRowHeaderCellAddressByCellId(h);const u=[];for(d&&u.push(d);h;)h=r.getParentCellId(d.col,d.row),h&&(d=r.getRowHeaderCellAddressByCellId(h),u.push(d));return{addCellPositions:l,removeCellPositions:a,updateCellPositions:u}}const RT={startInTotal:0,level:0};class lr{constructor(t,e,n,o){var r,s,l,a,h,d,u,c,g,f,p,m,b,C,_,w,y;this.colIndex=0,this._showHeader=!0,this.columnHeaderObjs=[],this.rowHeaderObjs=[],this._cornerHeaderCellFullPathIds=[],this._columnHeaderCellFullPathIds=[],this._rowHeaderCellFullPathIds=[],this._rowHeaderCellFullPathIds_FULL=[],this._cornerHeaderCellIds=[],this._columnHeaderCellIds=[],this._rowHeaderCellIds=[],this._rowHeaderCellIds_FULL=[],this._columnWidths=[],this.columnPaths=[],this._headerObjects=[],this._headerObjectMap={},this._indicators=[],this.indicatorsAsCol=!0,this.hideIndicatorName=!1,this._showRowHeader=!0,this._showColumnHeader=!0,this._indicatorShowType="column",this.rowHierarchyTextStartAlignment=!1,this.rowDimensionKeys=[],this.colDimensionKeys=[],this.indicatorKeys=[],this.indicatorDimensionKey=Xi,this._rowHeaderExtensionTree={},this._extensionRowDimensionKeys=[],this.fullRowDimensionKeys=[],this.leftRowSeriesNumberColumnCount=0,this.rightRowSeriesNumberColumnCount=0,this._useGetBodyCache=!1,this._getBodyCache=new Map,this._useHeaderPathCache=!1,this._colHeaderPathCache=new Map,this._rowHeaderPathCache=new Map,this.sharedVar=t.layoutNodeId,this._table=t,t.options.rowHierarchyType==="tree"&&(this.extensionRows=t.options.extensionRows),this.dataset=e,this._largeCellRangeCache=[],this._CellHeaderPathMap=new Map,this.rowTree=t.internalProps.rowTree,this.columnTree=t.internalProps.columnTree,this.rowsDefine=(r=t.internalProps.rows)!==null&&r!==void 0?r:[],this.columnsDefine=(s=t.internalProps.columns)!==null&&s!==void 0?s:[],this.indicatorsDefine=(l=t.internalProps.indicators)!==null&&l!==void 0?l:[],this.indicatorTitle=t.options.indicatorTitle,this.indicatorsAsCol=(a=t.options.indicatorsAsCol)===null||a===void 0||a,this.hideIndicatorName=(h=t.options.hideIndicatorName)!==null&&h!==void 0&&h,this.showRowHeader=(d=t.options.showRowHeader)===null||d===void 0||d,this.showColumnHeader=(u=t.options.showColumnHeader)===null||u===void 0||u,this.rowHeaderTitle=t.options.rowHeaderTitle,this.columnHeaderTitle=t.options.columnHeaderTitle,this.rowHierarchyType=(c=t.options.rowHierarchyType)!==null&&c!==void 0?c:"grid",this.rowExpandLevel=(g=t.options.rowExpandLevel)!==null&&g!==void 0?g:1,this.rowHierarchyIndent=(f=t.options.rowHierarchyIndent)!==null&&f!==void 0?f:20,this.rowHierarchyTextStartAlignment=t.options.rowHierarchyTextStartAlignment,this.cornerSetting=Object.assign({titleOnDimension:"column",forceShowHeader:!1},t.options.corner),e&&(this.rowTree=e.rowHeaderTree,this.columnTree=e.colHeaderTree),(p=this.indicatorsDefine)===null||p===void 0||p.forEach(x=>{typeof x=="string"?this.indicatorKeys.push(x):this.indicatorKeys.push(x.indicatorKey)}),this.columnDimensionTree=n,this.rowDimensionTree=o,this.colDimensionKeys=this.columnDimensionTree.dimensionKeysIncludeVirtual.valueArr(),this.rowDimensionKeys=this.rowDimensionTree.dimensionKeysIncludeVirtual.valueArr(),this.fullRowDimensionKeys=this.fullRowDimensionKeys.concat(this.rowDimensionKeys),this.resetRowHeaderLevelCount(),this._table.isPivotChart()&&(this.hasTwoIndicatorAxes=this.indicatorsDefine.some(x=>{var T,M;if(x.chartSpec&&x.chartSpec.series&&x.chartSpec.series.length>1){const B=(M=(T=x.chartSpec.axes)!==null&&T!==void 0?T:this._table.pivotChartAxes)!==null&&M!==void 0?M:[];if(!B.length||B.every(P=>P.orient!==(this.indicatorsAsCol?"top":"right")||P.visible!==!1))return!0}return!1})),this.resetColumnHeaderLevelCount(),this._generateColHeaderIds(),this.colIndex=0,this._generateRowHeaderIds(),this._rowHeaderCellFullPathIds_FULL=im(this._rowHeaderCellFullPathIds_FULL),t.options.rowHierarchyType==="tree"&&((m=this.extensionRows)===null||m===void 0?void 0:m.length)>=1&&(this.generateExtensionRowTree(),this.extensionRows.forEach(x=>{const T=[];x.rows.forEach(M=>{typeof M=="string"?T.push(M):T.push(M.dimensionKey)}),this._extensionRowDimensionKeys.push(T),this.fullRowDimensionKeys=this.fullRowDimensionKeys.concat(T)})),this.sharedVar.seqId=Math.max(this.sharedVar.seqId,this._headerObjects.length);let S,A=this.columnDimensionTree.dimensionKeysIncludeVirtual.valueArr();!this.dataset||this._table.isPivotChart()||((C=(b=this.dataset.records)===null||b===void 0?void 0:b.length)!==null&&C!==void 0?C:0)!==0||this.dataset.customColTree||(A=this.columnsDefine.map(x=>typeof x=="string"?x:x.dimensionKey),this.indicatorsAsCol&&A.push(this.indicatorDimensionKey)),A=this.columnHeaderTitle?[""].concat(A):A;let R=[];if(this.rowHierarchyType==="tree"&&((_=this.extensionRows)===null||_===void 0?void 0:_.length)>=1){const x=[];x.push(this.rowDimensionKeys[0]),this._extensionRowDimensionKeys.forEach(T=>{x.push(T[0])}),R=this.extensionRows.reduce((T,M)=>T.concat(M.rows),[]),S=this.rowHeaderTitle?[""].concat(x):x}else S=this.rowDimensionTree.dimensionKeysIncludeVirtual.valueArr(),!this.dataset||this._table.isPivotChart()||((y=(w=this.dataset.records)===null||w===void 0?void 0:w.length)!==null&&y!==void 0?y:0)!==0||this.dataset.customRowTree||(S=this.rowsDefine.map(x=>typeof x=="string"?x:x.dimensionKey),this.indicatorsAsCol||S.push(this.indicatorDimensionKey)),S=this.rowHeaderTitle?[""].concat(S):S;this.cornerHeaderObjs=this._addCornerHeaders(A,S,this.columnsDefine.concat(...this.rowsDefine,...R)),this.colIndex=0,this._headerObjectMap=this._headerObjects.reduce((x,T)=>(x[T.id]=T,x),{}),this.indicatorsAsCol&&!this.hideIndicatorName?this._indicatorShowType="column":this.indicatorsAsCol||this.hideIndicatorName?this._indicatorShowType="none":this._indicatorShowType="row",this.generateCellIdsConsiderHideHeader(),this.setPagination(t.options.pagination),this._table.isPivotChart()&&(this._chartItemSpanSize=0,this._chartItemBandSize=0,this._indicators.find(x=>{var T,M,B,P,F,H,E,k;!((T=x==null?void 0:x.style)===null||T===void 0)&&T.padding&&(this._chartPadding=x.style.padding),!((M=x.chartSpec)===null||M===void 0)&&M.barWidth&&typeof x.chartSpec.barWidth=="number"&&(this._chartItemSpanSize=(B=x.chartSpec)===null||B===void 0?void 0:B.barWidth);const I=(F=(P=x.chartSpec)===null||P===void 0?void 0:P.axes)===null||F===void 0?void 0:F.find(L=>L.type==="band");return I!=null&&I.bandSize&&(this._chartItemBandSize=I==null?void 0:I.bandSize,this._chartPaddingInner=(H=lt(I.paddingInner)?I.paddingInner[0]:I.paddingInner)!==null&&H!==void 0?H:0,this._chartPaddingOuter=(E=lt(I.paddingOuter)?I.paddingOuter[0]:I.paddingOuter)!==null&&E!==void 0?E:0),this._chartItemSpanSize>0||((k=x.chartSpec.series)===null||k===void 0||k.find(L=>(L.barWidth&&typeof L.barWidth=="number"&&(this._chartItemSpanSize=L.barWidth),this._chartItemSpanSize>0)),!1)})),this.handleRowSeriesNumber(t.internalProps.rowSeriesNumber),this.setColumnWidths()}handleRowSeriesNumber(t){var e,n;t&&(Array.isArray(t)?this.rowSeriesNumberColumn=t.map(o=>{var r,s;return{id:"",title:o.title,define:o,cellType:(r=o.cellType)!==null&&r!==void 0?r:"text",headerType:(s=o.cellType)!==null&&s!==void 0?s:"text",width:o.width,style:o.style,format:o.format,field:o.field,icon:o.icon}}):this.rowSeriesNumberColumn=[{id:"",title:t.title,define:t,cellType:(e=t.cellType)!==null&&e!==void 0?e:"text",headerType:(n=t.cellType)!==null&&n!==void 0?n:"text",style:t.style,width:t.width,format:t.format,field:"",icon:t.icon,isChildNode:!1}],this.leftRowSeriesNumberColumn=this.rowSeriesNumberColumn.filter(o=>!0),this.rightRowSeriesNumberColumn=this.rowSeriesNumberColumn.filter(o=>!1),this.leftRowSeriesNumberColumnCount=this.leftRowSeriesNumberColumn.length,this.rightRowSeriesNumberColumnCount=this.rightRowSeriesNumberColumn.length)}_generateColHeaderIds(){var t,e,n,o,r,s,l,a;if(((t=this.columnDimensionTree.tree.children)===null||t===void 0?void 0:t.length)>=1){let h=0;if(this.dataset&&!this._table.isPivotChart()&&((n=(e=this.dataset.records)===null||e===void 0?void 0:e.length)!==null&&n!==void 0?n:0)===0&&!this.dataset.customColTree&&!this.dataset.customRowTree&&this.indicatorsAsCol&&this.columnDimensionTree.totalLevel<this.columnHeaderLevelCount){h=this.columnHeaderLevelCount-this.columnDimensionTree.totalLevel;for(let d=0;d<h;d++)this._columnHeaderCellFullPathIds.unshift([])}this._addHeaders(this._columnHeaderCellFullPathIds,h,this.columnDimensionTree.tree.children,[],this.columnHeaderObjs)}if(this.columnHeaderTitle){this.sharedVar.seqId=Math.max(this.sharedVar.seqId,this._headerObjects.length);const h=++this.sharedVar.seqId,d=Array(this.colCount-this.rowHeaderLevelCount-this.rightFrozenColCount).fill(h);this._columnHeaderCellFullPathIds.unshift(d);const u={id:h,title:typeof this.columnHeaderTitle.title=="string"?this.columnHeaderTitle.title:this.columnsDefine.reduce((c,g)=>typeof g=="string"?c:c+(c?`/${g.title}`:`${g.title}`),""),field:void 0,headerType:(r=(o=this.columnHeaderTitle)===null||o===void 0?void 0:o.headerType)!==null&&r!==void 0?r:"text",style:(s=this.columnHeaderTitle)===null||s===void 0?void 0:s.headerStyle,define:{id:h,disableHeaderHover:!!(!((l=this.columnHeaderTitle)===null||l===void 0)&&l.disableHeaderHover),disableHeaderSelect:!!(!((a=this.columnHeaderTitle)===null||a===void 0)&&a.disableHeaderSelect)}};this.columnHeaderObjs.push(u),this._headerObjects[h]=u}}_generateRowHeaderIds(){var t,e,n,o,r,s,l,a,h,d;if(((t=this.rowDimensionTree.tree.children)===null||t===void 0?void 0:t.length)>=1)if(this.rowHierarchyType==="tree")this._addHeadersForTreeMode(this._rowHeaderCellFullPathIds_FULL,0,this.rowDimensionTree.tree.children,[],this.rowDimensionTree.totalLevel,!0,this.rowsDefine,this.rowHeaderObjs);else{let u=0;if(this.dataset&&!this._table.isPivotChart()&&((n=(e=this.dataset.records)===null||e===void 0?void 0:e.length)!==null&&n!==void 0?n:0)===0&&!this.dataset.customColTree&&!this.dataset.customRowTree&&!this.indicatorsAsCol&&this.rowDimensionTree.totalLevel<this.rowHeaderLevelCount){u=this.rowHeaderLevelCount-this.rowDimensionTree.totalLevel;for(let c=0;c<u;c++)this._rowHeaderCellFullPathIds_FULL.unshift([])}this._addHeaders(this._rowHeaderCellFullPathIds_FULL,u,this.rowDimensionTree.tree.children,[],this.rowHeaderObjs)}if(this.rowHeaderTitle){this.sharedVar.seqId=Math.max(this.sharedVar.seqId,this._headerObjects.length);const u=++this.sharedVar.seqId,c=Array((r=(o=this._rowHeaderCellFullPathIds_FULL[0])===null||o===void 0?void 0:o.length)!==null&&r!==void 0?r:this.rowDimensionTree.tree.size).fill(u);this._rowHeaderCellFullPathIds_FULL.unshift(c);const g={id:u,title:typeof this.rowHeaderTitle.title=="string"?this.rowHeaderTitle.title:this.rowsDefine.reduce((f,p)=>typeof p=="string"?f:f+(f?`/${p.title}`:`${p.title}`),""),field:void 0,headerType:(l=(s=this.rowHeaderTitle)===null||s===void 0?void 0:s.headerType)!==null&&l!==void 0?l:"text",style:(a=this.rowHeaderTitle)===null||a===void 0?void 0:a.headerStyle,define:{id:u,disableHeaderHover:!!(!((h=this.rowHeaderTitle)===null||h===void 0)&&h.disableHeaderHover),disableHeaderSelect:!!(!((d=this.rowHeaderTitle)===null||d===void 0)&&d.disableHeaderSelect)}};this.rowHeaderObjs.push(g),this._headerObjects[u]=g}}_addHeaders(t,e,n,o,r){const s=this;t[e]||function(l){const a=t[l]=[];if(s.colIndex===0)return a;const h=t[l-1];for(let d=0;d<(h==null?void 0:h.length);d++)a[d]=h[d]}(e);for(let l=0;l<n.length;l++){const a=n[l];R8(a,t,r,o,e,this)}}_addHeadersForTreeMode(t,e,n,o,r,s,l,a){const h=this;t[e]||function(d){const u=t[d]=[];if(h.colIndex===0)return u;const c=t[d-1];for(let g=0;g<(c==null?void 0:c.length);g++)u[g]=c[g]}(e);for(let d=0;d<n.length;d++){const u=n[d];A8(u,t,a,o,e,r,s,l,this)}}_addCornerHeaders(t,e,n){var o,r;const s=[];if(this.cornerSetting.titleOnDimension==="all")if(this.indicatorsAsCol){let l=-1;t&&t.forEach((a,h)=>{var d,u;a===this.indicatorDimensionKey&&(l=h);const c=++this.sharedVar.seqId,g=n.find(p=>typeof p!="string"&&p.dimensionKey===a),f={id:c,title:a===this.indicatorDimensionKey?this.indicatorTitle:g?g.title:a==="axis"?"":a,field:a,style:this.cornerSetting.headerStyle,headerType:(d=this.cornerSetting.headerType)!==null&&d!==void 0?d:"text",showSort:g==null?void 0:g.showSortInCorner,sort:g==null?void 0:g.sort,define:{showSort:g==null?void 0:g.showSortInCorner,sort:g==null?void 0:g.sort,dimensionKey:a,id:c,value:a,headerEditor:this.cornerSetting.headerEditor,disableHeaderHover:!!this.cornerSetting.disableHeaderHover,disableHeaderSelect:!!this.cornerSetting.disableHeaderSelect},dropDownMenu:g==null?void 0:g.cornerDropDownMenu,headerIcon:g==null?void 0:g.cornerHeaderIcon,pivotInfo:{value:(u=g==null?void 0:g.title)!==null&&u!==void 0?u:"",dimensionKey:a,isPivotCorner:!0},description:g==null?void 0:g.cornerDescription};s[c]=f,this._headerObjects[c]=f,this._cornerHeaderCellFullPathIds[h]||(this._cornerHeaderCellFullPathIds[h]=[]);for(let p=0;p<this.rowHeaderLevelCount;p++)this._cornerHeaderCellFullPathIds[h][p]=c}),e&&e.forEach((a,h)=>{var d,u;const c=++this.sharedVar.seqId,g=n.find(p=>typeof p!="string"&&p.dimensionKey===a),f={id:c,title:a===this.indicatorDimensionKey?this.indicatorTitle:g?g.title:a==="axis"?"":a,field:a,style:this.cornerSetting.headerStyle,headerType:(d=this.cornerSetting.headerType)!==null&&d!==void 0?d:"text",showSort:g==null?void 0:g.showSortInCorner,sort:g==null?void 0:g.sort,define:{showSort:g==null?void 0:g.showSortInCorner,sort:g==null?void 0:g.sort,dimensionKey:a,id:c,value:a,headerEditor:this.cornerSetting.headerEditor,disableHeaderHover:!!this.cornerSetting.disableHeaderHover,disableHeaderSelect:!!this.cornerSetting.disableHeaderSelect},dropDownMenu:g==null?void 0:g.cornerDropDownMenu,headerIcon:g==null?void 0:g.cornerHeaderIcon,pivotInfo:{value:(u=g==null?void 0:g.title)!==null&&u!==void 0?u:"",dimensionKey:a,isPivotCorner:!0},description:g==null?void 0:g.cornerDescription};s[c]=f,this._headerObjects[c]=f,this._cornerHeaderCellFullPathIds[l]||(this._cornerHeaderCellFullPathIds[l]=[]),this._cornerHeaderCellFullPathIds[l][h]=c})}else{let l=-1;e&&e.forEach((a,h)=>{var d,u;a===this.indicatorDimensionKey&&(l=h);const c=++this.sharedVar.seqId,g=n.find(p=>typeof p!="string"&&p.dimensionKey===a),f={id:c,title:a===this.indicatorDimensionKey?this.indicatorTitle:g?g.title:a==="axis"?"":a,field:a,style:this.cornerSetting.headerStyle,headerType:(d=this.cornerSetting.headerType)!==null&&d!==void 0?d:"text",showSort:g==null?void 0:g.showSortInCorner,sort:g==null?void 0:g.sort,define:{showSort:g==null?void 0:g.showSortInCorner,sort:g==null?void 0:g.sort,dimensionKey:a,id:c,value:a,headerEditor:this.cornerSetting.headerEditor,disableHeaderHover:!!this.cornerSetting.disableHeaderHover,disableHeaderSelect:!!this.cornerSetting.disableHeaderSelect},dropDownMenu:g==null?void 0:g.cornerDropDownMenu,headerIcon:g==null?void 0:g.cornerHeaderIcon,pivotInfo:{value:(u=g==null?void 0:g.title)!==null&&u!==void 0?u:"",dimensionKey:a,isPivotCorner:!0},description:g==null?void 0:g.cornerDescription};s[c]=f,this._headerObjects[c]=f;for(let p=0;p<this.columnHeaderLevelCount;p++)this._cornerHeaderCellFullPathIds[p]||(this._cornerHeaderCellFullPathIds[p]=[]),this._cornerHeaderCellFullPathIds[p][h]=c}),t&&t.forEach((a,h)=>{var d,u;const c=++this.sharedVar.seqId,g=n.find(p=>typeof p!="string"&&p.dimensionKey===a),f={id:c,title:a===this.indicatorDimensionKey?this.indicatorTitle:g?g.title:a==="axis"?"":a,field:a,style:this.cornerSetting.headerStyle,headerType:(d=this.cornerSetting.headerType)!==null&&d!==void 0?d:"text",showSort:g==null?void 0:g.showSortInCorner,sort:g==null?void 0:g.sort,define:{showSort:g==null?void 0:g.showSortInCorner,sort:g==null?void 0:g.sort,dimensionKey:a,id:c,value:a,headerEditor:this.cornerSetting.headerEditor,disableHeaderHover:!!this.cornerSetting.disableHeaderHover,disableHeaderSelect:!!this.cornerSetting.disableHeaderSelect},dropDownMenu:g==null?void 0:g.cornerDropDownMenu,headerIcon:g==null?void 0:g.cornerHeaderIcon,pivotInfo:{value:(u=g==null?void 0:g.title)!==null&&u!==void 0?u:"",dimensionKey:a,isPivotCorner:!0},description:g==null?void 0:g.cornerDescription};s[c]=f,this._headerObjects[c]=f,this._cornerHeaderCellFullPathIds[h][l]=c})}else if(this.cornerSetting.titleOnDimension==="row"||this.cornerSetting.titleOnDimension==="column"){const l=((o=this.cornerSetting)===null||o===void 0?void 0:o.titleOnDimension)==="row"?e:t;l&&l.forEach((a,h)=>{var d,u;const c=++this.sharedVar.seqId,g=n.find(p=>typeof p!="string"&&p.dimensionKey===a),f={id:c,title:a===this.indicatorDimensionKey?this.indicatorTitle:g?g.title:a==="axis"?"":a,field:a,style:this.cornerSetting.headerStyle,headerType:(d=this.cornerSetting.headerType)!==null&&d!==void 0?d:"text",showSort:g==null?void 0:g.showSortInCorner,sort:g==null?void 0:g.sort,define:{showSort:g==null?void 0:g.showSortInCorner,sort:g==null?void 0:g.sort,dimensionKey:a,id:c,value:a,headerCustomRender:this.cornerSetting.customRender,headerCustomLayout:this.cornerSetting.customLayout,headerEditor:this.cornerSetting.headerEditor,disableHeaderHover:!!this.cornerSetting.disableHeaderHover,disableHeaderSelect:!!this.cornerSetting.disableHeaderSelect},dropDownMenu:g==null?void 0:g.cornerDropDownMenu,headerIcon:g==null?void 0:g.cornerHeaderIcon,pivotInfo:{value:(u=g==null?void 0:g.title)!==null&&u!==void 0?u:"",dimensionKey:a,isPivotCorner:!0},description:g==null?void 0:g.cornerDescription};if(s[c]=f,this._headerObjects[c]=f,this.cornerSetting.titleOnDimension==="column"){this._cornerHeaderCellFullPathIds[h]||(this._cornerHeaderCellFullPathIds[h]=[]);for(let p=0;p<this.rowHeaderLevelCount;p++)this._cornerHeaderCellFullPathIds[h][p]=c}else if(this.cornerSetting.titleOnDimension==="row")for(let p=0;p<this.columnHeaderLevelCount;p++)this._cornerHeaderCellFullPathIds[p]||(this._cornerHeaderCellFullPathIds[p]=[]),this._cornerHeaderCellFullPathIds[p][h]=c})}else{const l=++this.sharedVar.seqId,a={id:l,title:"",field:"维度名称",style:this.cornerSetting.headerStyle,headerType:(r=this.cornerSetting.headerType)!==null&&r!==void 0?r:"text",define:{dimensionKey:"维度名称",id:l,headerCustomRender:this.cornerSetting.customRender,headerCustomLayout:this.cornerSetting.customLayout,disableHeaderHover:!!this.cornerSetting.disableHeaderHover,disableHeaderSelect:!!this.cornerSetting.disableHeaderSelect}};s[l]=a,this._headerObjects[l]=a;for(let h=0;h<this.columnHeaderLevelCount;h++)for(let d=0;d<this.rowHeaderLevelCount;d++)this._cornerHeaderCellFullPathIds[h]||(this._cornerHeaderCellFullPathIds[h]=[]),this._cornerHeaderCellFullPathIds[h][d]=l}return s}generateExtensionRowTree(){this.extensionRows.forEach((t,e)=>{const n=this._rowHeaderCellFullPathIds_FULL;this._rowHeaderCellFullPathIds_FULL=[],n.forEach((o,r)=>{const s=o[o.length-1];let l,a;if(this.colIndex=0,typeof t.rowTree=="function"){const d=this.findFullCellIds(o);l=t.rowTree(d.map(u=>({dimensionKey:this._headerObjects[u].field,value:this._headerObjects[u].title})))}else l=Ee(t.rowTree);this._rowHeaderExtensionTree[s]?(this._rowHeaderExtensionTree[s].reset(this._rowHeaderExtensionTree[s].tree.children,!0),a=this._rowHeaderExtensionTree[s]):(a=new Pe(l??[],this.sharedVar,this.rowHierarchyType,void 0),this._rowHeaderExtensionTree[s]=a);const h=[];this._addHeadersForTreeMode(h,0,a.tree.children,[],a.totalLevel,!0,t.rows,this.rowHeaderObjs);for(let d=0;d<h[0].length;d++)this._rowHeaderCellFullPathIds_FULL.push(o.concat(h[0][d]))})})}setColumnWidths(){var t,e,n;const o=new Array(this.colCount).fill(void 0);if(this.leftRowSeriesNumberColumnCount&&(o[0]=this.leftRowSeriesNumberColumn[0]),this.showHeader&&this.showRowHeader)if(this.rowHeaderTitle&&(o[0+this.leftRowSeriesNumberColumnCount]={}),this.rowHierarchyType==="tree"){const r=this.rowDimensionKeys[0];if(r){const s=(t=this.rowsDefine)===null||t===void 0?void 0:t.find(l=>typeof l!="string"&&l.dimensionKey===r);s&&(o[0+(this.rowHeaderTitle?1:0)+this.leftRowSeriesNumberColumnCount]={width:s.width,minWidth:s.minWidth,maxWidth:s.maxWidth})}(e=this._extensionRowDimensionKeys)===null||e===void 0||e.forEach((s,l)=>{var a;const h=s[0];if(h){const d=(a=this.extensionRows[l].rows)===null||a===void 0?void 0:a.find(u=>typeof u!="string"&&u.dimensionKey===h);d&&(o[l+1+(this.rowHeaderTitle?1:0)+this.leftRowSeriesNumberColumnCount]={width:d.width,minWidth:d.minWidth,maxWidth:d.maxWidth})}})}else(this.rowDimensionTree.totalLevel>0?this.rowDimensionTree.dimensionKeysIncludeVirtual.valueArr():this.rowsDefine.map(r=>typeof r=="string"?r:r.dimensionKey)).forEach((r,s)=>{var l;const a=(l=this.rowsDefine)===null||l===void 0?void 0:l.find(h=>typeof h!="string"&&h.dimensionKey===r);a&&(o[s+(this.rowHeaderTitle?1:0)+this.leftRowSeriesNumberColumnCount]={width:a.width,minWidth:a.minWidth,maxWidth:a.maxWidth})});if(this.indicatorsAsCol)for(let r=this.rowHeaderLevelCount+this.leftRowSeriesNumberColumnCount;r<this.colCount;r++){const s=this.getBody(r,this.columnHeaderLevelCount);o[r]={width:s==null?void 0:s.width,minWidth:s==null?void 0:s.minWidth,maxWidth:s==null?void 0:s.maxWidth}}else{let r,s,l,a=0;(n=this._indicators)===null||n===void 0||n.forEach((h,d)=>{var u,c;typeof h.width=="number"?a=Math.max(h.width,a):h.width==="auto"&&(l=!0),typeof h.minWidth=="number"&&(s=Math.max(h.minWidth,(u=s)!==null&&u!==void 0?u:0)),typeof h.maxWidth=="number"&&(r=Math.min(h.maxWidth,(c=r)!==null&&c!==void 0?c:Number.MAX_VALUE))}),a=a>0?a:l?"auto":void 0,o.fill({width:a,minWidth:s,maxWidth:r},this.rowHeaderLevelCount+this.leftRowSeriesNumberColumnCount,this.colCount-this.rightFrozenColCount)}this._columnWidths=o}get columnWidths(){return this._columnWidths}getColumnWidthDefined(t){return this._columnWidths[t]}get showHeader(){return this._showHeader}set showHeader(t){this._showHeader=t}get showColumnHeader(){return this._showColumnHeader}set showColumnHeader(t){this._showColumnHeader=t}get showRowHeader(){return this._showRowHeader}set showRowHeader(t){this._showRowHeader=t}get columnHeaderTitle(){return this._columnHeaderTitle}set columnHeaderTitle(t){this._columnHeaderTitle=t}get rowHeaderTitle(){return this._rowHeaderTitle}set rowHeaderTitle(t){this._rowHeaderTitle=t}getHeaderFieldKey(t,e){}getCellLocation(t,e){return this.isCornerHeader(t,e)?"cornerHeader":this.isColumnHeader(t,e)?"columnHeader":this.isRowHeader(t,e)?"rowHeader":"body"}isHeader(t,e){return t>=this.leftRowSeriesNumberColumnCount&&t<this.rowHeaderLevelCount+this.leftRowSeriesNumberColumnCount||e>=0&&e<this.columnHeaderLevelCount||t>=this.colCount-this.rightHeaderColCount||e>=this.rowCount-this.bottomHeaderRowCount}isCornerHeader(t,e){return t>=0&&t<this.rowHeaderLevelCount+this.leftRowSeriesNumberColumnCount&&e>=0&&e<this.columnHeaderLevelCount}isColumnHeader(t,e){return t>=this.rowHeaderLevelCount+this.leftRowSeriesNumberColumnCount&&e>=0&&e<this.columnHeaderLevelCount}isRowHeader(t,e){return t>=this.leftRowSeriesNumberColumnCount&&t<this.rowHeaderLevelCount+this.leftRowSeriesNumberColumnCount&&e>=this.columnHeaderLevelCount}isFrozen(t,e){return this.isFrozenColumn(t)||this.isRightFrozenColumn(t)||this.isBottomFrozenRow(e)||this.isFrozenRow(e)||this.isSeriesNumberInBody(t,e)||this.isSeriesNumberInHeader(t,e)}isFrozenColumn(t,e){if(z(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(z(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(z(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(z(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}isLeftTopCorner(t,e){return t>=0&&t<this.frozenColCount&&e>=0&&e<this.frozenRowCount}isLeftBottomCorner(t,e){return t>=0&&t<this.frozenColCount&&e>=this.rowCount-this.bottomFrozenRowCount}isRightTopCorner(t,e){return t>=this.colCount-this.rightFrozenColCount&&e>=0&&e<this.frozenRowCount}isRightBottomCorner(t,e){return t>=this.colCount-this.rightFrozenColCount&&e>=this.rowCount-this.bottomFrozenRowCount}getColumnHeaderRange(){return{start:{col:this.rowHeaderLevelCount,row:0},end:{col:this.colCount-1,row:this.columnHeaderLevelCount-1}}}getRowHeaderRange(){return{start:{col:0,row:this.columnHeaderLevelCount},end:{col:this.rowHeaderLevelCount-1,row:this.rowCount-1}}}getCornerHeaderRange(){return{start:{col:0,row:0},end:{col:this.rowHeaderLevelCount-1,row:this.columnHeaderLevelCount-1}}}getBodyRange(){return{start:{col:this.rowHeaderLevelCount,row:this.columnHeaderLevelCount},end:{col:this.colCount-1,row:this.rowCount-1}}}resetCellIds(){}get 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 headerLevelCount(){return this.columnHeaderLevelCount}resetColumnHeaderLevelCount(){var t,e,n,o,r,s,l,a,h,d,u;if(this.showHeader&&this.showColumnHeader){if(this._table.isPivotChart()&&this.indicatorsAsCol&&!(!((e=(t=this.dataset)===null||t===void 0?void 0:t.colKeys)===null||e===void 0)&&e.length)&&((o=(n=this.columnDimensionTree)===null||n===void 0?void 0:n.tree)===null||o===void 0?void 0:o.level)===0&&!this.hasTwoIndicatorAxes)return void(this.columnHeaderLevelCount=0);let c=this.indicatorsAsCol&&this.hideIndicatorName&&this.colDimensionKeys[this.colDimensionKeys.length-1]===this.indicatorDimensionKey?this.columnDimensionTree.totalLevel-1:this.columnDimensionTree.totalLevel;return c===0&&this.dataset&&!(!((r=this.dataset.customColTree)===null||r===void 0)&&r.length)?this.cornerSetting.titleOnDimension==="row"&&this.cornerSetting.forceShowHeader?c=1:this._table.isPivotChart()||((l=(s=this.dataset.records)===null||s===void 0?void 0:s.length)!==null&&l!==void 0?l:0)!==0||this.cornerSetting.titleOnDimension!=="column"&&this.cornerSetting.titleOnDimension!=="all"||(c=(a=this.columnsDefine.length)!==null&&a!==void 0?a:0):!this.dataset||this._table.isPivotChart()||((d=(h=this.dataset.records)===null||h===void 0?void 0:h.length)!==null&&d!==void 0?d:0)!==0||this.dataset.customColTree||this.cornerSetting.titleOnDimension!=="column"&&this.cornerSetting.titleOnDimension!=="all"||(c=(u=this.columnsDefine.length)!==null&&u!==void 0?u:0,!this.hideIndicatorName&&this.indicatorsAsCol&&c++),this.columnHeaderTitle&&(c+=1),this._table.isPivotChart()&&this.indicatorsAsCol&&!this.hasTwoIndicatorAxes&&Lh(this.indicatorsDefine)&&(c-=1),void(this.columnHeaderLevelCount=c)}this.columnHeaderLevelCount=this.indicatorsAsCol?this.hideIndicatorName?0:1:0}resetRowHeaderLevelCount(){var t,e,n,o,r,s,l,a;if(this.showHeader&&this.showRowHeader){if(this.rowHierarchyType==="tree"){const u=(e=(t=this.extensionRows)===null||t===void 0?void 0:t.length)!==null&&e!==void 0?e:0;return this.rowHeaderTitle?void(this.rowHeaderLevelCount=2+u):void(this.rowHeaderLevelCount=1+u)}const h=this.rowDimensionTree.totalLevel;let d=h;return d===0&&this.dataset&&!(!((n=this.dataset.customRowTree)===null||n===void 0)&&n.length)?this.cornerSetting.titleOnDimension==="column"&&this.cornerSetting.forceShowHeader?d=1:this._table.isPivotChart()||((r=(o=this.dataset.records)===null||o===void 0?void 0:o.length)!==null&&r!==void 0?r:0)!==0||this.cornerSetting.titleOnDimension!=="row"&&this.cornerSetting.titleOnDimension!=="all"||(d=(s=this.rowsDefine.length)!==null&&s!==void 0?s:0):!this.dataset||this._table.isPivotChart()||((a=(l=this.dataset.records)===null||l===void 0?void 0:l.length)!==null&&a!==void 0?a:0)!==0||this.dataset.customRowTree||this.cornerSetting.titleOnDimension!=="row"&&this.cornerSetting.titleOnDimension!=="all"||(d=this.rowsDefine.length,this.hideIndicatorName||this.indicatorsAsCol||d++),!this.indicatorsAsCol&&this.hideIndicatorName&&this.rowDimensionKeys[this.rowDimensionKeys.length-1]===this.indicatorDimensionKey&&(d=h-1),this.rowHeaderTitle&&(d+=1),void(this.rowHeaderLevelCount=d)}this.rowHeaderLevelCount=this.indicatorsAsCol||this.hideIndicatorName?0:1}get columnHeaderLevelCount(){return this._columnHeaderLevelCount}set columnHeaderLevelCount(t){this._columnHeaderLevelCount=t}get rowHeaderLevelCount(){return this._rowHeaderLevelCount}set rowHeaderLevelCount(t){this._rowHeaderLevelCount=t}get colCount(){var t;return(this.columnDimensionTree.totalLevel>0||this._table.isPivotChart()||((t=this.dataset.records)===null||t===void 0?void 0:t.length)>0||this.dataset.records&&!Array.isArray(this.dataset.records)?this.columnDimensionTree.tree.size:0)+this.rowHeaderLevelCount+this.rightHeaderColCount+this.leftRowSeriesNumberColumnCount}get rowCount(){var t,e,n,o;return((this._table.records||this.dataset.records)&&(!Array.isArray(this._table.records)||this._table.records.length>0)&&((t=this._indicators)===null||t===void 0?void 0:t.length)>0&&!(!((e=this._rowHeaderCellIds)===null||e===void 0)&&e.length)?1:(o=(n=this._rowHeaderCellIds)===null||n===void 0?void 0:n.length)!==null&&o!==void 0?o:0)+this.columnHeaderLevelCount+this.bottomHeaderRowCount}get bodyRowSpanCount(){return this.rowDimensionTree.tree.size}get bottomFrozenRowCount(){if(!this._table.isPivotChart())return this._table.internalProps.bottomFrozenRowCount?this.rowCount-this.headerLevelCount>=this._table.internalProps.bottomFrozenRowCount?this._table.internalProps.bottomFrozenRowCount:this.rowCount-this.headerLevelCount:0;if(this.indicatorKeys.length>=1&&Lh(this.indicatorsDefine)){const t=this._table.pivotChartAxes.find(e=>e.orient==="bottom");return(t==null?void 0:t.visible)===!1?0:(this.indicatorsAsCol,1)}return 0}get rightFrozenColCount(){if(!this._table.isPivotChart())return this._table.internalProps.rightFrozenColCount?this.colCount-this.rowHeaderLevelCount>=this._table.internalProps.rightFrozenColCount?this._table.internalProps.rightFrozenColCount:this.colCount-this.rowHeaderLevelCount:0;const t=this._table.pivotChartAxes.find(e=>e.orient==="right");return(t==null?void 0:t.visible)===!1||this.indicatorsAsCol?0:this.hasTwoIndicatorAxes?1:0}get bodyRowCount(){return this.rowCount-this.bottomFrozenRowCount-this.headerLevelCount}get bodyColCount(){return this.colCount-this.rightFrozenColCount-this.rowHeaderLevelCount}get headerObjects(){return this._headerObjects}get columnObjects(){return this._indicators}getCellId(t,e){var n,o,r,s,l;if(e>=0&&t>=0){if(this.isSeriesNumber(t,e))return"";if(this.isCornerHeader(t,e))return(n=this._cornerHeaderCellIds[e])===null||n===void 0?void 0:n[t-this.leftRowSeriesNumberColumnCount];if(this.isColumnHeader(t,e))return(o=this._columnHeaderCellIds[e])===null||o===void 0?void 0:o[t-this.rowHeaderLevelCount-this.leftRowSeriesNumberColumnCount];if(this.isRowHeader(t,e))return(r=this._rowHeaderCellIds[e-this.columnHeaderLevelCount])===null||r===void 0?void 0:r[t-this.leftRowSeriesNumberColumnCount];if(this.isRightFrozenColumn(t,e))return(s=this._rowHeaderCellIds[e-this.columnHeaderLevelCount])===null||s===void 0?void 0:s[this.rowHeaderLevelCount-1];if(this.isBottomFrozenRow(t,e))return(l=this._columnHeaderCellIds[this.columnHeaderLevelCount-1])===null||l===void 0?void 0:l[t-this.rowHeaderLevelCount-this.leftRowSeriesNumberColumnCount]}}getHeader(t,e){var n;if(this.isSeriesNumberInHeader(t,e))return this.getSeriesNumberHeader(t,e);const o=this.getCellId(t,e);return(n=this._headerObjectMap[o])!==null&&n!==void 0?n:{id:void 0,field:"",headerType:"text",define:void 0}}getHeaderField(t,e){var n,o;const r=this.getCellId(t,e);return((n=this._headerObjectMap[r])===null||n===void 0?void 0:n.field)||((o=this.getBody(t,e))===null||o===void 0?void 0:o.field)}getHeaderCellAdressById(t){for(let e=0;e<this._columnHeaderCellIds.length;e++){const n=this._columnHeaderCellIds[e];for(let o=0;o<n.length;o++)if(n[o]===t)return{col:o+this._table.frozenColCount,row:e}}for(let e=0;e<this._rowHeaderCellIds.length;e++){const n=this._rowHeaderCellIds[e];for(let o=0;o<n.length;o++)if(n[o]===t)return{col:o,row:e+this._table.frozenRowCount}}for(let e=0;e<this._cornerHeaderCellIds.length;e++){const n=this._cornerHeaderCellIds[e];for(let o=0;o<n.length;o++)if(n[o]===t)return{col:o,row:e}}}getHeaderCellAddressByField(t){const e=this.headerObjects.find(n=>n&&n.field===t);return e&&this.getHeaderCellAdressById(e.id)}getBody(t,e){var n,o,r,s,l,a,h,d,u,c;const g=this.getBodyWidthCache(t,e);if(g)return g;if(this.isSeriesNumber(t,e)){const b=this.getSeriesNumberBody(t,e);return this.setBodyWidthCache(t,e,b),b}const f=this.getCellHeaderPaths(t,e);if(this.indicatorsAsCol){const b=(o=(n=f.colHeaderPaths)===null||n===void 0?void 0:n.find(_=>_.indicatorKey))===null||o===void 0?void 0:o.indicatorKey,C=z(b)&&(l=(s=(r=this._indicators)===null||r===void 0?void 0:r.find(_=>_.indicatorKey===b))!==null&&s!==void 0?s:this._indicators[0])!==null&&l!==void 0?l:{id:"",field:void 0,indicatorKey:void 0,cellType:"text",define:void 0};return this.setBodyWidthCache(t,e,C),C}const p=(h=(a=f.rowHeaderPaths)===null||a===void 0?void 0:a.find(b=>b.indicatorKey))===null||h===void 0?void 0:h.indicatorKey,m=z(p)&&(c=(u=(d=this._indicators)===null||d===void 0?void 0:d.find(b=>b.indicatorKey===p))!==null&&u!==void 0?u:this._indicators[0])!==null&&c!==void 0?c:{id:"",field:void 0,indicatorKey:void 0,cellType:"text",define:void 0};return this.setBodyWidthCache(t,e,m),m}getCellRange(t,e){var n,o;const r={start:{col:t,row:e},end:{col:t,row:e}};if(!this.isHeader(t,e)||t===-1||e===-1||this.isRightFrozenColumn(t,e)||this.isBottomFrozenRow(t,e))return r;if(this._table.isPivotChart()){if(this.isLeftBottomCorner(t,e))return{start:{col:0,row:this.rowCount-this.bottomFrozenRowCount},end:{col:this.frozenColCount-1,row:this.rowCount-1}};if(this.isRightTopCorner(t,e))return{start:{col:this.colCount-this.rightFrozenColCount,row:0},end:{col:this.colCount-1,row:this.frozenRowCount-1}};if(this.isRightBottomCorner(t,e))return{start:{col:this.colCount-this.rightFrozenColCount,row:this.rowCount-this.bottomFrozenRowCount},end:{col:this.colCount-1,row:this.rowCount-1}}}for(let s=0;s<this._largeCellRangeCache.length;s++){const l=this._largeCellRangeCache[s];if(t>=l.start.col&&t<=l.end.col&&e>=l.start.row&&e<=l.end.row)return l}if(this.isHeader(t,e)&&t!==-1&&e!==-1){const s=this.getCellId(t,e);for(let l=t-1;l>=0&&s===this.getCellId(l,e);l--)r.start.col=l;for(let l=t+1;l<((n=this.colCount)!==null&&n!==void 0?n:0)&&s===this.getCellId(l,e);l++)r.end.col=l;for(let l=e-1;l>=0&&s===this.getCellId(t,l);l--)r.start.row=l;for(let l=e+1;l<((o=this.rowCount)!==null&&o!==void 0?o:0)&&!(s!==this.getCellId(t,l)||this.isSeriesNumberInHeader(t,e)&&l>=this.columnHeaderLevelCount);l++)r.end.row=l}return(r.end.col-r.start.col>100||r.end.row-r.start.row>100)&&this._largeCellRangeCache.push(r),r}isCellRangeEqual(t,e,n,o){const r=this.getCellRange(t,e),s=this.getCellRange(n,o);return r.start.col===s.start.col&&r.end.col===s.end.col&&r.start.row===s.start.row&&r.end.row===s.end.row}getBodyIndexByRow(t){return t<this.columnHeaderLevelCount||t>=this.rowCount-this.bottomHeaderRowCount?-1:t-this.columnHeaderLevelCount}get bottomHeaderRowCount(){return this._table.isPivotChart()?this.bottomFrozenRowCount:0}get rightHeaderColCount(){return this._table.isPivotChart()?this.rightFrozenColCount:0}getBodyIndexByCol(t){return t<this.rowHeaderLevelCount+this.leftRowSeriesNumberColumnCount||t>=this.colCount-this.rightHeaderColCount?-1:t-this.rowHeaderLevelCount-this.leftRowSeriesNumberColumnCount}getRecordStartRowByRecordIndex(t){return this.columnHeaderLevelCount+t}getRecordShowIndexByCell(t,e){}getCellHeaderPathsWithTreeNode(t,e){for(let l=0;l<this._largeCellRangeCache.length;l++){const a=this._largeCellRangeCache[l];if(t>=a.start.col&&t<=a.end.col&&e>=a.start.row&&e<=a.end.row)break}let n=this.getColHeaderPathCache(t,e),o=this.getRowHeaderPathCache(t,e);const r=this.getBodyIndexByCol(t),s=this.getBodyIndexByRow(e)+this.currentPageStartIndex;if(!n&&e>=0&&r>=0&&(n=this.columnDimensionTree.getTreePath(r,this.showHeader&&this.showColumnHeader?e-(this.columnHeaderTitle?1:0):this.columnDimensionTree.totalLevel),this.setColHeaderPathCache(t,e,n)),!o&&t>=0&&s>=0){if(o=[],this.rowHierarchyType==="tree"){const l=this._rowHeaderCellFullPathIds[s];let a=this.rowDimensionTree,h=0;for(;a;){const d=[];let u=l[h];for(d.push(u);;){const g=this._headerObjectMap[u];if(!(g!=null&&g.parentCellId))break;d.unshift(g.parentCellId),u=g.parentCellId}const c=a.getTreePathByCellIds(d);o.push(...c),a=this._rowHeaderExtensionTree[l[h]],h++}}else o=this.rowDimensionTree.getTreePath(s,this.showHeader&&this.showRowHeader?t-(this.rowHeaderTitle?1:0)-this.leftRowSeriesNumberColumnCount:this.rowDimensionTree.totalLevel);this.setRowHeaderPathCache(t,e,o)}return{colHeaderPaths:n,rowHeaderPaths:o,cellLocation:this.getCellLocation(t,e)}}getCellHeaderPaths(t,e){var n,o;const r=this.getCellHeaderPathsWithTreeNode(t,e),s={colHeaderPaths:[],rowHeaderPaths:[],cellLocation:r.cellLocation};return(n=r.colHeaderPaths)===null||n===void 0||n.forEach(l=>{var a,h,d;const u={};u.dimensionKey=l.dimensionKey,u.indicatorKey=l.indicatorKey,u.value=(d=(a=l.value)!==null&&a!==void 0?a:(h=this.getIndicatorInfoByIndicatorKey(l.indicatorKey))===null||h===void 0?void 0:h.title)!==null&&d!==void 0?d:"",u.virtual=l.virtual,s.colHeaderPaths.push(u)}),(o=r.rowHeaderPaths)===null||o===void 0||o.forEach(l=>{var a,h,d;if(l.dimensionKey!=="axis"){const u={};u.dimensionKey=l.dimensionKey,u.indicatorKey=l.indicatorKey,u.value=(d=(a=l.value)!==null&&a!==void 0?a:(h=this.getIndicatorInfoByIndicatorKey(l.indicatorKey))===null||h===void 0?void 0:h.title)!==null&&d!==void 0?d:"",u.virtual=l.virtual,s.rowHeaderPaths.push(u)}}),s}getIndicatorInfoByIndicatorKey(t){var e;return(e=this.indicatorsDefine)===null||e===void 0?void 0:e.find(n=>typeof n!="string"&&!!t&&n.indicatorKey===t)}findFullCellIds(t){const e=[];for(let n=0;n<t.length;n++){let o=t[n];for(e.push(o);;){const r=this._headerObjectMap[o];if(!(r!=null&&r.parentCellId))break;e.unshift(r.parentCellId),o=r.parentCellId}}return e}getHeaderDimension(t,e){var n,o,r;if(this.isHeader(t,e)){const s=this.getHeader(t,e);return(o=(n=this.rowsDefine)===null||n===void 0?void 0:n.find(l=>typeof l!="string"&&l.dimensionKey===s.field))!==null&&o!==void 0?o:(r=this.columnsDefine)===null||r===void 0?void 0:r.find(l=>typeof l!="string"&&l.dimensionKey===s.field)}}isColumnIndicatorHeader(t,e){return this._indicatorShowType==="column"&&e===this.columnHeaderLevelCount-1&&t>=this.rowHeaderLevelCount}isRowIndicatorHeader(t,e){return this._indicatorShowType==="row"&&t===this.rowHeaderLevelCount-1&&e>=this.columnHeaderLevelCount}isIndicatorHeader(t,e){return this.isColumnIndicatorHeader(t,e)||this.isRowIndicatorHeader(t,e)}toggleHierarchyState(t,e){var n,o,r,s,l,a;this.colIndex=0;const h=this._rowHeaderCellFullPathIds_FULL.slice(0),d=h.map((g,f)=>({col:t,row:f+this.columnHeaderLevelCount})),u=this.getHeader(t,e);if(u.define.hierarchyState=u.define.hierarchyState===Vt.collapse?Vt.expand:Vt.collapse,this.rowDimensionTree.reset(this.rowDimensionTree.tree.children,!0),this._rowHeaderCellFullPathIds_FULL=[],this.rowDimensionKeys=this.rowDimensionTree.dimensionKeysIncludeVirtual.valueArr(),this.fullRowDimensionKeys=[],this.fullRowDimensionKeys=this.fullRowDimensionKeys.concat(this.rowDimensionKeys),this._addHeadersForTreeMode(this._rowHeaderCellFullPathIds_FULL,0,this.rowDimensionTree.tree.children,[],this.rowDimensionTree.totalLevel,!0,this.rowsDefine,this.rowHeaderObjs),this.rowHeaderTitle){const g=++this.sharedVar.seqId,f=Array(this.rowCount-this.columnHeaderLevelCount).fill(g);this._rowHeaderCellFullPathIds_FULL.unshift(f);const p={id:g,title:typeof this.rowHeaderTitle.title=="string"?this.rowHeaderTitle.title:this.rowsDefine.reduce((m,b)=>typeof b=="string"?m:m+(m?`/${b.title}`:`${b.title}`),""),field:void 0,headerType:(o=(n=this.rowHeaderTitle)===null||n===void 0?void 0:n.headerType)!==null&&o!==void 0?o:"text",style:(r=this.rowHeaderTitle)===null||r===void 0?void 0:r.headerStyle,define:{field:"",headerType:"text",cellType:"text",disableHeaderHover:!!(!((s=this.rowHeaderTitle)===null||s===void 0)&&s.disableHeaderHover),disableHeaderSelect:!!(!((l=this.rowHeaderTitle)===null||l===void 0)&&l.disableHeaderSelect)}};this.rowHeaderObjs.push(p),this._headerObjects[g]=p}this._rowHeaderCellFullPathIds_FULL=im(this._rowHeaderCellFullPathIds_FULL),this.rowHierarchyType==="tree"&&((a=this.extensionRows)===null||a===void 0?void 0:a.length)>=1&&this.generateExtensionRowTree(),this.colIndex=0,this._headerObjectMap=this._headerObjects.reduce((g,f)=>(g[f.id]=f,g),{}),this._CellHeaderPathMap=new Map,this._largeCellRangeCache.length=0;const c=D9(t,e,h.map(g=>g[t-this.leftRowSeriesNumberColumnCount]),this._rowHeaderCellFullPathIds_FULL.map(g=>g[t-this.leftRowSeriesNumberColumnCount]),d,this);return this.generateCellIdsConsiderHideHeader(),this.setPagination(this.pagination),c}isHeaderForColWidth(t,e){return this.isHeader(t,e)}getHeaderForColWidth(t,e){return this.getHeader(t,e)}getPivotCellAdress(t){var e;if(!Array.isArray(t))return;let n,o,r=this.rowTree,s=this.columnTree;for(let h=0;h<t.length;h++){const d=t[h];if((d.isPivotCorner||!z(d.value))&&h===t.length-1){if(((e=this==null?void 0:this.cornerSetting)===null||e===void 0?void 0:e.titleOnDimension)==="row"){let g=0;return this.rowHierarchyType==="grid"&&(g=this.rowDimensionKeys.indexOf(d.dimensionKey)),g===-1?void 0:{col:(this.rowHeaderTitle?g+1:g)+this.leftRowSeriesNumberColumnCount,row:0}}const c=this.colDimensionKeys.indexOf(d.dimensionKey);return c===-1?void 0:{col:0+this.leftRowSeriesNumberColumnCount,row:this.columnHeaderTitle?c+1:c}}let u=!1;for(let c=0;c<s.length;c++){const g=s[c];if((z(d.dimensionKey)&&g.dimensionKey===d.dimensionKey||z(d.indicatorKey)&&g.indicatorKey===d.indicatorKey)&&g.value===d.value){s=g.children,o=g,u=!0;break}}if(!u)for(let c=0;c<r.length;c++){const g=r[c];if((z(d.dimensionKey)&&g.dimensionKey===d.dimensionKey||z(d.indicatorKey)&&g.indicatorKey===d.indicatorKey)&&g.value===d.value){r=g.children,n=g;break}}}let l=0,a=0;if(n){a=this.columnHeaderLevelCount;const{startInTotal:h,level:d}=n;return a+=h,l=this.rowHierarchyType==="grid"?(this.rowHeaderTitle?d+1:d)+this.leftRowSeriesNumberColumnCount:0+this.leftRowSeriesNumberColumnCount,{col:l,row:a}}if(o){l=this.rowHeaderLevelCount+this.leftRowSeriesNumberColumnCount;const{startInTotal:h,level:d}=o;return l+=h,a=this.columnHeaderTitle?d+1:d,{col:l,row:a}}}getPivotDimensionInfo(t,e){var n;const{colHeaderPaths:o,rowHeaderPaths:r}=this.getCellHeaderPaths(t,e),s=[];return o.length?o.forEach((l,a)=>{s.push({dimensionKey:l.dimensionKey,value:l.value,isPivotCorner:!1,indicatorKey:l.indicatorKey})}):r.length?r.forEach((l,a)=>{s.push({dimensionKey:l.dimensionKey,value:l.value,isPivotCorner:!1,indicatorKey:l.indicatorKey})}):this.isCornerHeader(t,e)&&(((n=this==null?void 0:this.cornerSetting)===null||n===void 0?void 0:n.titleOnDimension)==="row"?s.push({dimensionKey:this.rowDimensionKeys[(this.rowHeaderTitle?t-1:t)-this.leftRowSeriesNumberColumnCount],isPivotCorner:!0}):s.push({dimensionKey:this.colDimensionKeys[this.columnHeaderTitle?e-1:e],isPivotCorner:!0})),s}getIndicatorKey(t,e){var n;return(n=this.getBody(t,e))===null||n===void 0?void 0:n.indicatorKey}getParentCellId(t,e){if(e!==0)return this.isColumnHeader(t,e)?this.getCellId(t,e-1):this.isRowHeader(t,e)?this.getCellId(t-1,e):void 0}getRowHeaderCellAddressByCellId(t){let e,n;if(this._rowHeaderCellIds.find((o,r)=>!!o.find((s,l)=>s===t&&(e=l,!0))&&(n=r,!0)),z(e)&&z(n))return{col:e,row:n+this.columnHeaderLevelCount}}canMoveHeaderPosition(t,e){if(this.isSeriesNumberInHeader(e.col,e.row)||this.isSeriesNumberInHeader(t.col,t.row)||this.isCornerHeader(e.col,e.row)||t.col<0||t.row<0||e.col<0||e.row<0)return!1;this.isSeriesNumberInBody(e.col,e.row)&&this.isSeriesNumberInBody(t.col,t.row)&&(t.col=t.col+this.leftRowSeriesNumberColumnCount+this.rowHeaderLevelCount-1,e.col=e.col+this.leftRowSeriesNumberColumnCount+this.rowHeaderLevelCount-1);const n=this.getCellRange(t.col,t.row);if(this.isColumnHeader(t.col,t.row))return this.getParentCellId(t.col,n.start.row)===this.getParentCellId(e.col,n.start.row);if(this.isRowHeader(t.col,t.row)){if(this.rowHierarchyType!=="tree")return this.getParentCellId(n.start.col,t.row)===this.getParentCellId(n.start.col,e.row);{const o=Ee(this.getCellHeaderPathsWithTreeNode(t.col,t.row).rowHeaderPaths),r=Ee(this.getCellHeaderPathsWithTreeNode(e.col,e.row).rowHeaderPaths);if(o.pop(),r.pop(),o.length<=r.length){if(o.length===r.length)return!o.find((s,l)=>s.dimensionKey!==r[l].dimensionKey||s.value!==r[l].value);if(o.length>0){for(let s=0;s<o.length;s++)if(o[s].startInTotal!==r[s].startInTotal)return!1}return!0}}}return!1}moveHeaderPosition(t,e){if(this.canMoveHeaderPosition(t,e)&&!this.isCellRangeEqual(t.col,t.row,e.col,e.row)){const n=this.getCellRange(t.col,t.row);if(this.isColumnHeader(t.col,t.row)){const o=n.end.col-n.start.col+1;let r;const s=this.getCellRange(e.col,n.start.row);if(r=e.col>=t.col?s.end.col-o+1:s.start.col,r===n.start.col)return null;for(let a=0;a<this._columnHeaderCellFullPathIds.length;a++){const h=this._columnHeaderCellFullPathIds[a].splice(n.start.col-this.rowHeaderLevelCount-this.leftRowSeriesNumberColumnCount,o);h.unshift(r-this.rowHeaderLevelCount-this.leftRowSeriesNumberColumnCount,0),Array.prototype.splice.apply(this._columnHeaderCellFullPathIds[a],h)}const l=this._columnWidths.splice(n.start.col-this.leftRowSeriesNumberColumnCount,o);return l.unshift(r-this.leftRowSeriesNumberColumnCount,0),Array.prototype.splice.apply(this._columnWidths,l),this.columnDimensionTree.movePosition(this.getCellHeaderPathsWithTreeNode(t.col,t.row).colHeaderPaths.length-1,n.start.col-this.rowHeaderLevelCount-this.leftRowSeriesNumberColumnCount,s.start.col-this.rowHeaderLevelCount-this.leftRowSeriesNumberColumnCount),this.columnDimensionTree.reset(this.columnDimensionTree.tree.children,!0),this._CellHeaderPathMap=new Map,this._largeCellRangeCache.length=0,{sourceIndex:n.start.col,targetIndex:r,sourceSize:o,targetSize:s.end.col-s.start.col+1,moveType:"column"}}if(this.isRowHeader(t.col,t.row)){let o;const r=this.getCellHeaderPathsWithTreeNode(t.col,t.row).rowHeaderPaths,s=this.getCellHeaderPathsWithTreeNode(e.col,e.row).rowHeaderPaths,l=r[r.length-1],a=s[r.length-1],h=l.size;if(o=e.row>=t.row?a.startInTotal+a.size-h:a.startInTotal,o===n.start.row-this.columnHeaderLevelCount)return null;const d=this._rowHeaderCellIds.splice(n.start.row-this.columnHeaderLevelCount,h);d.unshift(o-this.currentPageStartIndex,0),Array.prototype.splice.apply(this._rowHeaderCellIds,d);const u=this._rowHeaderCellFullPathIds.splice(n.start.row-this.columnHeaderLevelCount,h);u.unshift(o-this.currentPageStartIndex,0),Array.prototype.splice.apply(this._rowHeaderCellFullPathIds,u);const c=this._rowHeaderCellIds_FULL.splice(n.start.row-this.columnHeaderLevelCount+this.currentPageStartIndex,h);c.unshift(o,0),Array.prototype.splice.apply(this._rowHeaderCellIds_FULL,c);const g=this._rowHeaderCellFullPathIds_FULL.splice(n.start.row-this.columnHeaderLevelCount+this.currentPageStartIndex,h);return g.unshift(o,0),Array.prototype.splice.apply(this._rowHeaderCellFullPathIds_FULL,g),this.rowDimensionTree.movePosition(r.length-1,n.start.row-this.columnHeaderLevelCount,o+(e.row>t.row?l.size-1:0)),this.rowDimensionTree.reset(this.rowDimensionTree.tree.children,!0),this._CellHeaderPathMap=new Map,this._largeCellRangeCache.length=0,{sourceIndex:n.start.row,targetIndex:o+this.columnHeaderLevelCount,sourceSize:h,targetSize:a.size,moveType:"row"}}}return null}getCellAdressByHeaderPath(t){var e,n,o,r,s,l;let a,h,d=!1,u=!1;if(Array.isArray(t)){if(t.length>this.rowDimensionKeys.length+this.colDimensionKeys.length)return;a=t.filter(y=>this.colDimensionKeys.indexOf(y.dimensionKey)>=0||this.colDimensionKeys.indexOf(this.indicatorDimensionKey)>=0&&y.indicatorKey),h=t.filter(y=>this.rowDimensionKeys.indexOf(y.dimensionKey)>=0||this.rowDimensionKeys.indexOf(this.indicatorDimensionKey)>=0&&y.indicatorKey)}else a=t.colHeaderPaths,h=t.rowHeaderPaths,(t==null?void 0:t.cellLocation)==="body"&&this._table.isPivotTable()&&(u=!0);if(!Array.isArray(a)&&!Array.isArray(h))return;if(a==null||a.sort((y,S)=>{var A,R;return this.colDimensionKeys.indexOf((A=y.dimensionKey)!==null&&A!==void 0?A:this.indicatorDimensionKey)-this.colDimensionKeys.indexOf((R=S.dimensionKey)!==null&&R!==void 0?R:this.indicatorDimensionKey)}),h==null||h.sort((y,S)=>{var A,R;return this.fullRowDimensionKeys.indexOf((A=y.dimensionKey)!==null&&A!==void 0?A:this.indicatorDimensionKey)-this.fullRowDimensionKeys.indexOf((R=S.dimensionKey)!==null&&R!==void 0?R:this.indicatorDimensionKey)}),a==null||a.forEach(y=>{y.isPivotCorner&&(d=!0)}),h==null||h.forEach(y=>{y.isPivotCorner&&(d=!0)}),d){if(this.cornerSetting.titleOnDimension==="all"&&this.indicatorsAsCol&&a.length===0){for(let y=0;y<this.rowDimensionKeys.length;y++)if(((e=h[0])===null||e===void 0?void 0:e.dimensionKey)===this.rowDimensionKeys[y])return{col:y+this.leftRowSeriesNumberColumnCount,row:this.columnHeaderLevelCount-1}}else if(this.cornerSetting.titleOnDimension!=="all"||this.indicatorsAsCol||h.length!==0){if(this.cornerSetting.titleOnDimension==="row"||this.cornerSetting.titleOnDimension==="all"&&!this.indicatorsAsCol){for(let y=0;y<this.rowDimensionKeys.length;y++)if(((o=h[0])===null||o===void 0?void 0:o.dimensionKey)===this.rowDimensionKeys[y])return{col:y+this.leftRowSeriesNumberColumnCount,row:0}}else for(let y=0;y<this.colDimensionKeys.length;y++)if(((r=a[0])===null||r===void 0?void 0:r.dimensionKey)===this.colDimensionKeys[y])return{col:0,row:y}}else for(let y=0;y<this.colDimensionKeys.length;y++)if(((n=a[0])===null||n===void 0?void 0:n.dimensionKey)===this.colDimensionKeys[y])return{col:this.rowHeaderLevelCount-1,row:y}}let c,g,f,p,m=!1;(a==null?void 0:a.length)>=1&&(h==null?void 0:h.length)>=1&&(m=!0);let b,C,_=this.rowTree,w=this.columnTree;if(a)for(let y=0;y<a.length;y++){const S=a[y];for(let A=0;A<w.length;A++){const R=w[A];if(!z(S.indicatorKey)&&R.dimensionKey===S.dimensionKey&&R.value===S.value||z(S.indicatorKey)&&R.indicatorKey===S.indicatorKey){w=R.children,m&&!w?C=R:m||(C=R);break}}}if((h==null?void 0:h.length)>=1)if(this.rowHierarchyType==="tree"){const y=h[h.length-1],S=this.headerObjects.filter(R=>((R==null?void 0:R.field)===y.dimensionKey||(R==null?void 0:R.field)===y.indicatorKey)&&(R==null?void 0:R.title)===y.value).map(R=>R.id),A=this._rowHeaderCellIds.filter(R=>S.indexOf(R[R.length-1])>=0).find(R=>{const x=this.findFullCellIds(R);return x.length===h.length&&x.every(T=>{const M=this._headerObjectMap[T];return h.find(B=>B.dimensionKey===M.field&&B.value===M.title)})});g=this._rowHeaderCellIds.indexOf(A)+this.columnHeaderLevelCount}else for(let y=0;y<h.length;y++){const S=h[y];for(let A=0;A<_.length;A++){const R=_[A];if(!z(S.indicatorKey)&&R.dimensionKey===S.dimensionKey&&R.value===S.value||z(S.indicatorKey)&&R.indicatorKey===S.indicatorKey&&(!z(S.value)||R.value===S.value)){_=R.children,(!m||_&&!_.some(x=>x.dimensionKey==="axis"))&&m||(b=R);break}}}if(u||!m||(b||z(g))&&C){if(b||u){g=this.columnHeaderLevelCount;const{startInTotal:y,level:S}=(s=b)!==null&&s!==void 0?s:RT;g+=y??0,f=this.rowHierarchyType==="grid"?(this.rowHeaderTitle?S+1:S)+this.leftRowSeriesNumberColumnCount:0}if(C||u){c=this.rowHeaderLevelCount+this.leftRowSeriesNumberColumnCount;const{startInTotal:y,level:S}=(l=C)!==null&&l!==void 0?l:RT;c+=y??0,p=this.columnHeaderTitle?S+1:S}return z(c)||z(g)?{col:c??f,row:g??p}:void 0}}setChartInstance(t,e,n){var o,r,s,l;const a=this.getCellHeaderPaths(t,e);let h;if(this.indicatorsAsCol){const d=(o=a.colHeaderPaths.find(u=>u.indicatorKey))===null||o===void 0?void 0:o.indicatorKey;h=(r=this._indicators)===null||r===void 0?void 0:r.find(u=>u.indicatorKey===d)}else{const d=(s=a.rowHeaderPaths.find(u=>u.indicatorKey))===null||s===void 0?void 0:s.indicatorKey;h=(l=this._indicators)===null||l===void 0?void 0:l.find(u=>u.indicatorKey===d)}typeof(h==null?void 0:h.chartSpec)!="function"&&h&&(h.chartInstance=n)}getChartInstance(t,e){var n,o,r,s;const l=this.getCellHeaderPaths(t,e);let a;if(this.indicatorsAsCol){const h=(n=l.colHeaderPaths.find(d=>d.indicatorKey))===null||n===void 0?void 0:n.indicatorKey;a=(o=this._indicators)===null||o===void 0?void 0:o.find(d=>d.indicatorKey===h)}else{const h=(r=l.rowHeaderPaths.find(d=>d.indicatorKey))===null||r===void 0?void 0:r.indicatorKey;a=(s=this._indicators)===null||s===void 0?void 0:s.find(d=>d.indicatorKey===h)}return a==null?void 0:a.chartInstance}checkHasChart(){return uT(this)}getDimension(t,e){var n,o;return e==="column"?(n=this.columnsDefine)===null||n===void 0?void 0:n.find(r=>typeof r!="string"&&r.dimensionKey===t):e==="row"?(o=this.rowsDefine)===null||o===void 0?void 0:o.find(r=>typeof r!="string"&&r.dimensionKey===t):void 0}getAxisConfigInPivotChart(t,e){if((this.isFrozenColumn(t,e)||this.isRightFrozenColumn(t,e))&&Hl(t,e,"row",this)||(this.isFrozenRow(t,e)||this.isBottomFrozenRow(t,e))&&Hl(t,e,"col",this))return Bt.getFunction("getAxisConfigInPivotChart")(t,e,this)}isEmpty(t,e){return!!this._table.isPivotChart()&&(!!this.isLeftBottomCorner(t,e)||!!this.isRightBottomCorner(t,e)||!!this.isRightTopCorner(t,e))}isAxisCell(t,e){return this._table.isPivotChart()?!!(this.indicatorKeys.length>=1&&Lh(this.indicatorsDefine)&&(this.isBottomFrozenRow(t,e)&&Hl(t,e,"col",this)||this.isRightFrozenColumn(t,e)&&Hl(t,e,"row",this)||this.isRowHeader(t,e)&&t===this.rowHeaderLevelCount-1&&Hl(t,e,"row",this)||this.hasTwoIndicatorAxes&&this.indicatorsAsCol&&e===this.columnHeaderLevelCount-1&&Hl(t,e,"col",this))):!1}getChartAxes(t,e){if(pV(t,e,this)||this.isAxisCell(t,e))return vV(t,e,this)}getRawChartSpec(t,e){return cV(t,e,this)}getChartSpec(t,e){return mV(t,e,this)}isShareChartSpec(t,e){return gV(t,e,this)}getChartDataId(t,e){return dT(t,e,this)}isNoChartDataRenderNothing(t,e){return fV(t,e,this)}setPagination(t){var e,n,o,r,s,l,a;if(this.clearCellRangeMap(),this._table.internalProps.useOneRowHeightFillAll=!1,this.pagination=t,this.rowHierarchyType==="grid"&&z((e=this.pagination)===null||e===void 0?void 0:e.perPageCount)&&z((n=this.pagination)===null||n===void 0?void 0:n.currentPage)){this.indicatorsAsCol===!1&&(this.pagination.perPageCount=Math.ceil(this.pagination.perPageCount/this.indicatorKeys.length)*this.indicatorKeys.length);const{perPageCount:h,currentPage:d}=this.pagination;this.currentPageStartIndex=h*(d||0),this.currentPageEndIndex=this.currentPageStartIndex+h,this._rowHeaderCellIds=(o=this._rowHeaderCellIds_FULL)===null||o===void 0?void 0:o.slice(this.currentPageStartIndex,this.currentPageEndIndex),this._rowHeaderCellFullPathIds=(r=this._rowHeaderCellFullPathIds_FULL)===null||r===void 0?void 0:r.slice(this.currentPageStartIndex,this.currentPageEndIndex)}else this.currentPageStartIndex=0,this.currentPageEndIndex=this._rowHeaderCellIds_FULL.length,this._rowHeaderCellIds=(s=this._rowHeaderCellIds_FULL)===null||s===void 0?void 0:s.slice(this.currentPageStartIndex,this.currentPageEndIndex),this._rowHeaderCellFullPathIds=(l=this._rowHeaderCellFullPathIds_FULL)===null||l===void 0?void 0:l.slice(this.currentPageStartIndex,this.currentPageEndIndex);this.pagination&&(this.pagination.totalCount=(a=this._rowHeaderCellIds_FULL)===null||a===void 0?void 0:a.length)}release(){var t;const e=this._table._getActiveChartInstance();e==null||e.release(),(t=this._indicators)===null||t===void 0||t.forEach(n=>{var o;(o=n.chartInstance)===null||o===void 0||o.release()})}getHeadNode(t,e){var n,o,r;let s;const l=this.getCellHeaderPaths(t,e);return l.rowHeaderPaths&&((o=(n=l.rowHeaderPaths)===null||n===void 0?void 0:n.length)!==null&&o!==void 0?o:0)>0?s=(r=l.rowHeaderPaths)===null||r===void 0?void 0:r.slice(0,l.rowHeaderPaths.length):l.colHeaderPaths&&l.colHeaderPaths.length>0&&(s=l.colHeaderPaths.slice(0,l.colHeaderPaths.length)),this.getHeadNodeByRowOrColDimensions(s,t,e)}getHeadNodeByRowOrColDimensions(t,e,n){var o;if(!Array.isArray(t))return;let r,s,l=this.rowTree,a=this.columnTree;if(z(n)&&z(e)&&this.rowHierarchyType==="tree"&&this.extensionRows&&e>=1+this.leftRowSeriesNumberColumnCount){const h=this.getCellId(e-1,n);l=this._rowHeaderExtensionTree[h].tree.children}for(let h=0;h<t.length;h++){const d=t[h];if((d.isPivotCorner||!z(d.value))&&h===t.length-1)return;let u=!1;for(let c=0;c<a.length;c++){const g=a[c];if(z(d.dimensionKey)&&g.dimensionKey===d.dimensionKey&&g.value===d.value||z(d.indicatorKey)&&g.indicatorKey===d.indicatorKey&&(g.value===d.value||!z(d.value)||!z(g.value))){a=g.children,s=g,u=!0;break}}if(!u)for(let c=0;(o=c<(l==null?void 0:l.length))!==null&&o!==void 0&&o;c++){const g=l[c];if(z(d.dimensionKey)&&g.dimensionKey===d.dimensionKey&&g.value===d.value||z(d.indicatorKey)&&g.indicatorKey===d.indicatorKey&&(g.value===d.value||!z(d.value)||!z(g.value))){l=g.children,r=g;break}}}return r||s||void 0}clearCellRangeMap(){this._largeCellRangeCache.length=0,this._CellHeaderPathMap=new Map}getDimensionKeyInChartSpec(t,e){var n,o,r,s,l,a;let h;if(this.indicatorsAsCol===!1)for(let d=0;d<this.indicatorsDefine.length;d++){const u=this.indicatorsDefine[d].chartSpec;if(u&&(h=(n=u.xField)!==null&&n!==void 0?n:(r=(o=u==null?void 0:u.series)===null||o===void 0?void 0:o[0])===null||r===void 0?void 0:r.xField,h))return h}else for(let d=0;d<this.indicatorsDefine.length;d++){const u=this.indicatorsDefine[d].chartSpec;if(u&&(h=(s=u.yField)!==null&&s!==void 0?s:(a=(l=u==null?void 0:u.series)===null||l===void 0?void 0:l[0])===null||a===void 0?void 0:a.yField,h))return h}return null}_generateChartState(){return{vtable_selected:{filter:t=>{var e;return this._table._selectedDataItemsInChart.length>=1?!!this._table._selectedDataItemsInChart.find(n=>{for(const o in n)if(typeof n[o]!="object"&&n[o]!==t[o])return!1;return!0}):!((e=this._table._selectedDimensionInChart)===null||e===void 0)&&e.length?!!this._table._selectedDimensionInChart.every(n=>typeof n.value=="object"||t[n.key]===n.value):!1}},vtable_selected_reverse:{filter:t=>{var e;return this._table._selectedDataItemsInChart.length>=1?!this._table._selectedDataItemsInChart.find(n=>{for(const o in n)if(typeof n[o]!="object"&&n[o]!==t[o])return!1;return!0}):!((e=this._table._selectedDimensionInChart)===null||e===void 0)&&e.length?!this._table._selectedDimensionInChart.every(n=>typeof n.value=="object"||t[n.key]===n.value):!1}}}}updateDataStateToChartInstance(t){var e;if(((e=t==null?void 0:t.getSpec().select)===null||e===void 0?void 0:e.enable)!==!1){t||(t=this._table._getActiveChartInstance());const n=this._generateChartState();this._indicators.forEach(o=>{var r;const s=o.chartInstance;((r=o.chartSpec.select)===null||r===void 0?void 0:r.enable)!==!1&&s.updateState(n)}),t==null||t.updateState(n)}}updateDataStateToActiveChartInstance(t){var e;if(((e=t==null?void 0:t.getSpec().select)===null||e===void 0?void 0:e.enable)!==!1){t||(t=this._table._getActiveChartInstance());const n=this._generateChartState();t==null||t.updateState(n)}}getIndicatorKeyInChartSpec(t,e){const n=this.getRawChartSpec(t,e),o=[];if(n){if(n.series||n.xField||n.yField)return this.indicatorsAsCol===!1?n.series?n.series.forEach(r=>{const s=r.yField;o.push(s)}):o.push(n.yField):n.series?n.series.forEach(r=>{const s=r.xField;o.push(s)}):o.push(n.xField),o;if(n.valueField&&o.push(n.valueField),o.length>=1)return o}return null}getOptimunHeightForChart(t){var e,n,o,r,s;const l=this.getCellHeaderPaths(this.rowHeaderLevelCount,t).rowHeaderPaths;let a,h;for(const u in this.dataset.collectValuesBy)if(this.dataset.collectValuesBy[u].type==="yField"&&!this.dataset.collectValuesBy[u].range){a=(e=this.dataset.collectedValues[u])===null||e===void 0?void 0:e[l.map(c=>c.value).join(this.dataset.stringJoinChar)];break}if(this._chartItemBandSize)h=AT((n=a==null?void 0:a.length)!==null&&n!==void 0?n:0,this._chartItemBandSize,this._chartPaddingInner,this._chartPaddingOuter);else{const u=this._chartItemSpanSize||25;h=((o=a==null?void 0:a.length)!==null&&o!==void 0?o:0)*(u+u/3)}const d=Qt((s=(r=this._chartPadding)!==null&&r!==void 0?r:this._table.theme.bodyStyle.padding)!==null&&s!==void 0?s:0);return h+d[0]+d[2]}getOptimunWidthForChart(t){var e,n,o,r,s;const l=this.getCellHeaderPaths(t,this.columnHeaderLevelCount).colHeaderPaths;let a,h;for(const u in this.dataset.collectValuesBy)if(this.dataset.collectValuesBy[u].type==="xField"&&!this.dataset.collectValuesBy[u].range){a=(e=this.dataset.collectedValues[u])===null||e===void 0?void 0:e[l.map(c=>c.value).join(this.dataset.stringJoinChar)];break}if(this._chartItemBandSize)h=AT((n=a==null?void 0:a.length)!==null&&n!==void 0?n:0,this._chartItemBandSize,this._chartPaddingInner,this._chartPaddingOuter);else{const u=this._chartItemSpanSize||25;h=((o=a==null?void 0:a.length)!==null&&o!==void 0?o:0)*(u+u/3)}const d=Qt((s=(r=this._chartPadding)!==null&&r!==void 0?r:this._table.theme.bodyStyle.padding)!==null&&s!==void 0?s:0);return h+d[1]+d[3]}get leftAxesCount(){if(!this._table.isPivotChart())return 0;const t=this._table.pivotChartAxes.find(e=>e.orient==="left");return(t==null?void 0:t.visible)===!1?0:(this.indicatorsAsCol,1)}get topAxesCount(){if(!this._table.isPivotChart())return 0;const t=this._table.pivotChartAxes.find(e=>e.orient==="top");return(t==null?void 0:t.visible)===!1?0:this.indicatorsAsCol&&this.hasTwoIndicatorAxes?1:0}get rightAxesCount(){return this.rightFrozenColCount}get bottomAxesCount(){return this.bottomFrozenRowCount}getColKeysPath(t,e){const n=this.getCellHeaderPaths(t,e),o=[];return n.colHeaderPaths.length&&n.colHeaderPaths.forEach(r=>{r.dimensionKey&&o.push(r.value)}),o==null?void 0:o.join(this.dataset.stringJoinChar)}getRowKeysPath(t,e){const n=this.getCellHeaderPaths(t,e),o=[];return n.rowHeaderPaths.length&&n.rowHeaderPaths.forEach(r=>{r.dimensionKey&&o.push(r.value)}),o==null?void 0:o.join(this.dataset.stringJoinChar)}getIndicatorInfo(t,e=""){var n;return(n=this.indicatorsDefine)===null||n===void 0?void 0:n.find(o=>typeof o!="string"&&(t?o.indicatorKey===t:!!e&&o.title===e))}getLayoutColumnTree(){const t=[],e=this.columnDimensionTree.tree.children;return ov(t,e),t}getLayoutRowTree(){const t=[],e=this.rowDimensionTree.tree.children;return ov(t,e),t}getLayoutColumnTreeCount(){const t=this.columnDimensionTree.tree.children;return bg(t,this.rowHierarchyType==="tree")}getLayoutRowTreeCount(){var t;const e=this.rowDimensionTree.tree.children;let n=bg(e,this.rowHierarchyType==="tree");return(t=this.extensionRows)===null||t===void 0||t.forEach(o=>{if(typeof o.rowTree!="function"){const r=bg(o.rowTree,!0);n*=r}}),n}resetHeaderTree(){var t,e,n;this.colIndex=0,this._rowHeaderCellFullPathIds_FULL=[],this._columnHeaderCellFullPathIds=[],this._columnHeaderCellIds=[];const o=this.dataset;this.rowTree=o.rowHeaderTree,this.columnTree=o.colHeaderTree;const r=this.rowDimensionTree.tree.children;(t=this.rowTree)===null||t===void 0||t.forEach((s,l)=>{const a=r.find(h=>h.dimensionKey===s.dimensionKey&&h.value===s.value);a&&this._table._syncHierarchyState(a,s)}),this.columnDimensionTree=new Pe((e=this.columnTree)!==null&&e!==void 0?e:[],this.sharedVar),this.rowDimensionTree=new Pe((n=this.rowTree)!==null&&n!==void 0?n:[],this.sharedVar,this.rowHierarchyType,this.rowHierarchyType==="tree"?this.rowExpandLevel:void 0),this.resetColumnHeaderLevelCount(),this._generateColHeaderIds(),this.colIndex=0,this._generateRowHeaderIds(),this._rowHeaderCellFullPathIds_FULL=im(this._rowHeaderCellFullPathIds_FULL),this._headerObjectMap=this._headerObjects.reduce((s,l)=>(s[l.id]=l,s),{}),this._CellHeaderPathMap=new Map,this._largeCellRangeCache.length=0,this.generateCellIdsConsiderHideHeader(),this.setPagination(this.pagination)}isSeriesNumberInHeader(t,e){return this.leftRowSeriesNumberColumnCount>0&&t>=0&&e>=0&&t<this.leftRowSeriesNumberColumnCount&&e<this.headerLevelCount||this.rightRowSeriesNumberColumnCount>0&&e>=0&&t>=this.colCount-this.rightRowSeriesNumberColumnCount&&e<this.headerLevelCount}isSeriesNumberInBody(t,e){return this.leftRowSeriesNumberColumnCount>0&&t>=0&&t<this.leftRowSeriesNumberColumnCount&&e>=this.headerLevelCount||this.rightRowSeriesNumberColumnCount>0&&t>=this.colCount-this.rightRowSeriesNumberColumnCount&&e>=this.headerLevelCount}isSeriesNumber(t,e){return!!(z(t)&&z(e)&&(this.leftRowSeriesNumberColumnCount>0&&t>=0&&e>=0&&t<this.leftRowSeriesNumberColumnCount||this.rightRowSeriesNumberColumnCount>0&&e>=0&&t>=this.colCount-this.rightRowSeriesNumberColumnCount))}getSeriesNumberHeader(t,e){return this.leftRowSeriesNumberColumnCount>0&&t>=0&&t<this.leftRowSeriesNumberColumnCount&&e<this.headerLevelCount?Object.assign({},this.leftRowSeriesNumberColumn[t],{style:this._table.internalProps.rowSeriesNumber.headerStyle}):this.rightRowSeriesNumberColumnCount>0&&t>=this.colCount-this.rightRowSeriesNumberColumnCount&&e<this.headerLevelCount&&e<this.headerLevelCount?this.rightRowSeriesNumberColumn[t-(this.colCount-this.rightRowSeriesNumberColumnCount)]:void 0}getSeriesNumberBody(t,e){return this.leftRowSeriesNumberColumnCount>0&&t>=0&&t<this.leftRowSeriesNumberColumnCount&&e>=this.headerLevelCount?this.leftRowSeriesNumberColumn[t]:this.rightRowSeriesNumberColumnCount>0&&t>=this.colCount-this.rightRowSeriesNumberColumnCount&&e>=this.headerLevelCount?this.rightRowSeriesNumberColumn[t-(this.colCount-this.rightRowSeriesNumberColumnCount)]:void 0}changeTreeNodeTitle(t,e,n){this.getHeadNode(t,e).value=n;const o=this.getCellId(t,e);this._headerObjectMap[o].title=n}changeCornerTitle(t,e,n){if(this.isCornerHeader(t,e)){const o=this.getCellId(t,e);this._headerObjectMap[o].title=n}}generateCellIdsConsiderHideHeader(){if(this._columnHeaderCellIds=this._columnHeaderCellFullPathIds.slice(),!this.showColumnHeader)if(this.indicatorsAsCol&&!this.hideIndicatorName){const t=this.colDimensionKeys.indexOf(Xi),e=this._columnHeaderCellIds.splice(t,1);this._columnHeaderCellIds.splice(0,this._columnHeaderCellIds.length),this._columnHeaderCellIds.push(e[0])}else this._columnHeaderCellIds.splice(0,this._columnHeaderCellIds.length);if(this._rowHeaderCellIds_FULL=this._rowHeaderCellFullPathIds_FULL.slice(),!this.showRowHeader)if(this.indicatorsAsCol||this.hideIndicatorName)this._rowHeaderCellIds_FULL.forEach((t,e)=>{const n=t.slice();n.splice(0,n.length),this._rowHeaderCellIds_FULL[e]=n});else{const t=this.rowDimensionKeys.indexOf(Xi);this._rowHeaderCellIds_FULL.forEach((e,n)=>{const o=e.slice(),r=o.splice(t,1);o.splice(0,o.length),o.push(r[0]),this._rowHeaderCellIds_FULL[n]=o})}if(this._rowHeaderCellIds=this._rowHeaderCellIds_FULL.slice(),this._cornerHeaderCellIds=this._cornerHeaderCellFullPathIds.slice(),this.rowHeaderLevelCount===0||this.columnHeaderLevelCount===0)this._cornerHeaderCellIds=[];else if(this.cornerSetting.titleOnDimension!=="row"||this.showRowHeader){if(this.cornerSetting.titleOnDimension==="column"&&!this.showColumnHeader)if(this.indicatorsAsCol&&!this.hideIndicatorName){const t=this.colDimensionKeys.indexOf(Xi),e=this._cornerHeaderCellIds.splice(t,1);this._cornerHeaderCellIds.splice(0,this._cornerHeaderCellIds.length),this._cornerHeaderCellIds.push(e[0])}else this._cornerHeaderCellIds.splice(0,this._cornerHeaderCellIds.length)}else if(this.indicatorsAsCol||this.hideIndicatorName)this._cornerHeaderCellIds.forEach((t,e)=>{const n=t.slice();n.splice(0,n.length),this._cornerHeaderCellIds[e]=n});else{const t=this.rowDimensionKeys.indexOf(Xi);this._cornerHeaderCellIds.forEach((e,n)=>{const o=e.slice(),r=o.splice(t,1);o.splice(0,o.length),o.push(r[0]),this._cornerHeaderCellIds[n]=o})}}enableUseGetBodyCache(){this._useGetBodyCache=!0,this._getBodyCache.clear()}disableUseGetBodyCache(){this._useGetBodyCache=!1,this._getBodyCache.clear()}enableUseHeaderPathCache(){this._useHeaderPathCache=!0,this._colHeaderPathCache.clear(),this._rowHeaderPathCache.clear()}disableUseHeaderPathCache(){this._useHeaderPathCache=!1,this._colHeaderPathCache.clear(),this._rowHeaderPathCache.clear()}getBodyWidthCache(t,e){if(this._useGetBodyCache&&!this.isHeader(t,e)&&!this.isSeriesNumber(t,e))return this.indicatorsAsCol&&this._getBodyCache.has(t)?this._getBodyCache.get(t):!this.indicatorsAsCol&&this._getBodyCache.has(e)?this._getBodyCache.get(e):void 0}setBodyWidthCache(t,e,n){!this._useGetBodyCache||this.isHeader(t,e)||this.isSeriesNumber(t,e)||(this.indicatorsAsCol?this._getBodyCache.set(t,n):this._getBodyCache.set(e,n))}getColHeaderPathCache(t,e){if(this._useHeaderPathCache&&!this.isHeader(t,e)&&!this.isSeriesNumber(t,e)&&this._colHeaderPathCache.has(t))return this._colHeaderPathCache.get(t)}setColHeaderPathCache(t,e,n){!this._useHeaderPathCache||this.isHeader(t,e)||this.isSeriesNumber(t,e)||this._colHeaderPathCache.set(t,n)}getRowHeaderPathCache(t,e){if(this._useHeaderPathCache&&!this.isHeader(t,e)&&!this.isSeriesNumber(t,e)&&this._rowHeaderPathCache.has(e))return this._rowHeaderPathCache.get(e)}setRowHeaderPathCache(t,e,n){!this._useHeaderPathCache||this.isHeader(t,e)||this.isSeriesNumber(t,e)||this._rowHeaderPathCache.set(e,n)}}function AT(i,t,e,n){e===1&&(e=0);const o=O9(i,e,n),r=t/(1-e);return Math.ceil(o*r)}function O9(i,t,e){let n;return n=i===1?i+2*e:i-t+2*e,i?n>0?n:1:0}class pv{constructor(t,e){this.tree={},this.beforeChangedTree={},this.colFlatKeys={},this.rowFlatKeys={},this.stringJoinChar=String.fromCharCode(0),this.rowsIsTotal=[],this.colsIsTotal=[],this.dataConfig=t,e&&(this.records=e,typeof window<"u"&&window.performance.now(),this.setRecords(e),typeof window<"u"&&window.performance.now())}changeDataConfig(t){this.dataConfig=t}setRecords(t){this.processRecords()}processRecords(){for(let t=0,e=this.records.length;t<e;t++){const n=this.records[t];this.processRecord(n)}}processRecord(t){var e;const n=[],o=[];for(let r=0,s=this.dataConfig.rows.length;r<s;r++){const l=this.dataConfig.rows[r];t[l]!==void 0&&l!==this.dataConfig.indicatorDimensionKey&&o.push(t[l])}for(let r=0,s=this.dataConfig.columns.length;r<s;r++){const l=this.dataConfig.columns[r];t[l]!==void 0&&l!==this.dataConfig.indicatorDimensionKey&&n.push(t[l])}(e=this.dataConfig.indicators)===null||e===void 0||e.forEach(r=>{const s=t[r];s!==void 0&&(this.dataConfig.indicatorsAsCol?n.push(r):o.push(r));const l=o.join(this.stringJoinChar),a=n.join(this.stringJoinChar);o.length!==0&&(this.rowFlatKeys[l]||(this.rowFlatKeys[l]=1)),n.length!==0&&(this.colFlatKeys[a]||(this.colFlatKeys[a]=1)),n.length===0&&o.length===0||(this.tree[l]||(this.tree[l]={}),s!==void 0&&(this.tree[l][a]={value:s,record:t},this.dataConfig.indicatorsAsCol?n.pop():o.pop()))})}getTreeNode(t=[],e=[],n,o=!0){var r,s,l,a;let h,d;if(typeof t=="string")h=t;else{let u=!1;t.map((c,g)=>{c===n&&(t.splice(g,1),u=!0)}),u&&t.push(n),h=t.join(this.stringJoinChar)}if(typeof e=="string")d=e;else{let u=!1;e.map((c,g)=>{c===n&&(e.splice(g,1),u=!0)}),u&&e.push(n),d=e.join(this.stringJoinChar)}return o?(l=(s=(r=this.tree)===null||r===void 0?void 0:r[h])===null||s===void 0?void 0:s[d])!==null&&l!==void 0?l:void 0:z((a=this.beforeChangedTree[h])===null||a===void 0?void 0:a[d])?{value:this.beforeChangedTree[h][d].value,record:this.beforeChangedTree[h][d].record}:void 0}changeTreeNodeValue(t=[],e=[],n,o){var r,s,l,a,h,d,u;let c,g;if(typeof t=="string")c=t;else{let m=!1;t.map((b,C)=>{b===n&&(t.splice(C,1),m=!0)}),m&&t.push(n),c=t.join(this.stringJoinChar)}if(typeof e=="string")g=e;else{let m=!1;e.map((b,C)=>{b===n&&(e.splice(C,1),m=!0)}),m&&e.push(n),g=e.join(this.stringJoinChar)}const f=(s=(r=this.tree[c])===null||r===void 0?void 0:r[g])===null||s===void 0?void 0:s.value,p=Object.assign({},(a=(l=this.tree[c])===null||l===void 0?void 0:l[g])===null||a===void 0?void 0:a.record);!((d=(h=this.tree[c])===null||h===void 0?void 0:h[g])===null||d===void 0)&&d.record?(this.tree[c][g].record[n]=o,this.tree[c][g].value=o):(this.tree[c]||(this.tree[c]={}),this.tree[c][g]={record:this._buildRecord(t,e,n,o),value:o}),!((u=this.beforeChangedTree[c])===null||u===void 0)&&u[g]||(this.beforeChangedTree[c]={},this.beforeChangedTree[c][g]={record:void 0,value:void 0},this.beforeChangedTree[c][g].record=p,this.beforeChangedTree[c][g].value=f)}_buildRecord(t=[],e=[],n,o){const r={},s=this.dataConfig.rows,l=this.dataConfig.columns;return s.forEach((a,h)=>{a!==this.dataConfig.indicatorDimensionKey&&(r[a]=t[h])}),l.forEach((a,h)=>{a!==this.dataConfig.indicatorDimensionKey&&(r[a]=e[h])}),r[n]=o,this.records.push(r),r}addRecords(t){for(let e=0,n=t.length;e<n;e++){const o=t[e];this.processRecord(o)}this.records.push(t)}changeRecordFieldValue(t,e,n){let o=!1;for(let r=0;r<this.dataConfig.indicators.length;r++)this.dataConfig.indicators[r]===t&&(o=!0);if(!o){for(let r=0,s=this.records.length;r<s;r++){const l=this.records[r];l[t]===e&&(l[t]=n)}this.rowFlatKeys={},this.colFlatKeys={},this.tree={},this.processRecords()}}}function TT(i,t){let e="";for(let n=0;n<i.length;n++)e+=i[n],n!==i.length-1&&(e+=t);return e}class Ih{constructor(t,e,n,o,r,s,l,a,h,d,u,c,g){var f,p,m,b,C,_,w,y,S,A,R,x,T,M,B,P,F,H,E,k,I,L,D,O,N,W,$,U,Y,j,G,X,ht,gt,Ct,Q,et,vt;this.tree={},this.changedTree={},this.colFlatKeys={},this.rowFlatKeys={},this.colKeys=[],this.rowKeys=[],this.colKeys_normal=[],this.rowKeys_normal=[],this.rowOrder="key_a_to_z",this.colOrder="key_a_to_z",this.sorted=!1,this.indicatorStatistics=[],this.aggregators={},this.stringJoinChar=String.fromCharCode(0),this.rowsIsTotal=[],this.colsIsTotal=[],this.collectedValues={},this.cacheCollectedValues={},this.totalRecordsTree={},this.registerAggregators(),this.dataConfig=t,this.filterRules=(f=this.dataConfig)===null||f===void 0?void 0:f.filterRules,this.rowHierarchyType=a??"grid",this.sortRules=(p=this.dataConfig)===null||p===void 0?void 0:p.sortRules,this.aggregationRules=(m=this.dataConfig)===null||m===void 0?void 0:m.aggregationRules,this.derivedFieldRules=(b=this.dataConfig)===null||b===void 0?void 0:b.derivedFieldRules,this.mappingRules=(C=this.dataConfig)===null||C===void 0?void 0:C.mappingRules,this.calculatedFieldRules=(_=this.dataConfig)===null||_===void 0?void 0:_.calculatedFieldRules,this.calculatedFiledKeys=(y=(w=this.calculatedFieldRules)===null||w===void 0?void 0:w.map(bt=>bt.key))!==null&&y!==void 0?y:[],this.calculatedFieldDependIndicatorKeys=(A=(S=this.calculatedFieldRules)===null||S===void 0?void 0:S.reduce((bt,dt)=>{for(let ot=0;ot<dt.dependIndicatorKeys.length;ot++)bt.indexOf(dt.dependIndicatorKeys[ot])===-1&&bt.push(dt.dependIndicatorKeys[ot]);return bt},[]))!==null&&A!==void 0?A:[],this.totals=(R=this.dataConfig)===null||R===void 0?void 0:R.totals,this.rows=e,this.columns=n,this.indicatorKeys=o,this.indicatorKeysIncludeCalculatedFieldDependIndicatorKeys=[...o];for(let bt=0;bt<this.calculatedFieldDependIndicatorKeys.length;bt++)this.indicatorKeysIncludeCalculatedFieldDependIndicatorKeys.indexOf(this.calculatedFieldDependIndicatorKeys[bt])===-1&&this.indicatorKeysIncludeCalculatedFieldDependIndicatorKeys.push(this.calculatedFieldDependIndicatorKeys[bt]);if(this.indicatorsAsCol=s,this.indicators=r,this.customColTree=h,this.customRowTree=d,this.hasExtensionRowTree=c,this.parseCustomTreeToMatchRecords=g,this.parseCustomTreeToMatchRecords&&(this.customColTreeDimensionPaths=this.customTreeToDimensionPathArr(this.customColTree,"col"),this.hasExtensionRowTree||(this.customRowTreeDimensionPaths=this.customTreeToDimensionPathArr(this.customRowTree,"row"))),this.colGrandTotalLabel=(M=(T=(x=this.totals)===null||x===void 0?void 0:x.column)===null||T===void 0?void 0:T.grandTotalLabel)!==null&&M!==void 0?M:"总计",this.colSubTotalLabel=(F=(P=(B=this.totals)===null||B===void 0?void 0:B.column)===null||P===void 0?void 0:P.subTotalLabel)!==null&&F!==void 0?F:"小计",this.rowGrandTotalLabel=(k=(E=(H=this.totals)===null||H===void 0?void 0:H.row)===null||E===void 0?void 0:E.grandTotalLabel)!==null&&k!==void 0?k:"总计",this.rowSubTotalLabel=(D=(L=(I=this.totals)===null||I===void 0?void 0:I.row)===null||L===void 0?void 0:L.subTotalLabel)!==null&&D!==void 0?D:"小计",this.collectValuesBy=(O=this.dataConfig)===null||O===void 0?void 0:O.collectValuesBy,this.needSplitPositiveAndNegative=u!=null&&u,this.rowsIsTotal=new Array((W=(N=this.rows)===null||N===void 0?void 0:N.length)!==null&&W!==void 0?W:0).fill(!1),this.colsIsTotal=new Array((U=($=this.columns)===null||$===void 0?void 0:$.length)!==null&&U!==void 0?U:0).fill(!1),((Y=this.totals)===null||Y===void 0?void 0:Y.row)&&this.totals.row.showSubTotals!==!1&&this.totals.row.subTotalsDimensions)for(let bt=0,dt=(ht=(X=(G=(j=this.totals)===null||j===void 0?void 0:j.row)===null||G===void 0?void 0:G.subTotalsDimensions)===null||X===void 0?void 0:X.length)!==null&&ht!==void 0?ht:0;bt<dt;bt++){const ot=this.totals.row.subTotalsDimensions[bt],ut=this.rows.indexOf(ot);this.rowsIsTotal[ut]=!0}if(!((gt=this.totals)===null||gt===void 0)&>.column&&this.totals.column.showSubTotals!==!1&&this.totals.column.subTotalsDimensions)for(let bt=0,dt=(vt=(et=(Q=(Ct=this.totals)===null||Ct===void 0?void 0:Ct.column)===null||Q===void 0?void 0:Q.subTotalsDimensions)===null||et===void 0?void 0:et.length)!==null&&vt!==void 0?vt:0;bt<dt;bt++){const ot=this.totals.column.subTotalsDimensions[bt],ut=this.columns.indexOf(ot);this.colsIsTotal[ut]=!0}this.setRecords(l)}setRecords(t){var e,n,o,r,s,l,a,h,d,u,c,g,f,p,m,b,C,_,w;this.records=t,this.collectedValues={},this.cacheCollectedValues={},this.totalRecordsTree={},this.tree={},this.colFlatKeys={},this.rowFlatKeys={},this.colKeys=[],this.rowKeys=[],this.rowsHasValue=[],this.columnsHasValue=[],t&&(this.records=t,typeof window<"u"&&window.performance.now(),this.processRecords(),this.processCollectedValuesWithSumBy(),this.generateCollectedValuesSortRule(),this.processCollectedValuesWithSortBy(),typeof window<"u"&&window.performance.now(),typeof window<"u"&&window.performance.now(),this.totalStatistics(),typeof window<"u"&&window.performance.now(),this.rowKeys_normal=this.rowKeys.slice(),this.colKeys_normal=this.colKeys.slice(),typeof window<"u"&&window.performance.now(),this.sortKeys(),typeof window<"u"&&window.performance.now(),typeof window<"u"&&window.performance.now(),this.customRowTree?this.rowHeaderTree=this.customRowTree:this.rowHierarchyType==="tree"?this.rowHeaderTree=this.ArrToTree1(this.rowKeys,this.rows.filter((y,S)=>this.rowsHasValue[S]),this.indicatorsAsCol?void 0:this.indicators,((n=(e=this.totals)===null||e===void 0?void 0:e.row)===null||n===void 0?void 0:n.showGrandTotals)||!this.indicatorsAsCol&&this.columns.length===0||this.indicatorsAsCol&&this.rows.length===0,this.rowGrandTotalLabel):this.rowHeaderTree=this.ArrToTree(this.rowKeys,this.rows.filter((y,S)=>this.rowsHasValue[S]),this.indicatorsAsCol?void 0:this.indicators,this.rowsIsTotal,((r=(o=this.totals)===null||o===void 0?void 0:o.row)===null||r===void 0?void 0:r.showGrandTotals)||this.indicatorsAsCol&&this.rows.length===0,this.rowGrandTotalLabel,this.rowSubTotalLabel,(a=(l=(s=this.totals)===null||s===void 0?void 0:s.row)===null||l===void 0?void 0:l.showGrandTotalsOnTop)!==null&&a!==void 0&&a,(u=(d=(h=this.totals)===null||h===void 0?void 0:h.row)===null||d===void 0?void 0:d.showSubTotalsOnTop)!==null&&u!==void 0&&u),this.customColTree?this.colHeaderTree=this.customColTree:this.colHeaderTree=this.ArrToTree(this.colKeys,this.columns.filter((y,S)=>this.columnsHasValue[S]),this.indicatorsAsCol?this.indicators:void 0,this.colsIsTotal,((g=(c=this.totals)===null||c===void 0?void 0:c.column)===null||g===void 0?void 0:g.showGrandTotals)||!this.indicatorsAsCol&&this.columns.length===0,this.colGrandTotalLabel,this.colSubTotalLabel,(m=(p=(f=this.totals)===null||f===void 0?void 0:f.column)===null||p===void 0?void 0:p.showGrandTotalsOnLeft)!==null&&m!==void 0&&m,(_=(C=(b=this.totals)===null||b===void 0?void 0:b.column)===null||C===void 0?void 0:C.showSubTotalsOnLeft)!==null&&_!==void 0&&_),typeof window<"u"&&window.performance.now(),!((w=this.dataConfig)===null||w===void 0)&&w.isPivotChart&&this.cacheDeminsionCollectedValues())}registerAggregator(t,e){this.aggregators[t]=e}registerAggregators(){this.registerAggregator(zt.RECORD,Px),this.registerAggregator(zt.SUM,Ex),this.registerAggregator(zt.COUNT,Lx),this.registerAggregator(zt.MAX,Fx),this.registerAggregator(zt.MIN,Ix),this.registerAggregator(zt.AVG,kx),this.registerAggregator(zt.NONE,Hx),this.registerAggregator(zt.RECALCULATE,K4)}processCollectedValuesWithSumBy(){var t,e,n,o,r,s;for(const l in this.collectedValues)if(!((e=(t=this.collectValuesBy)===null||t===void 0?void 0:t[l])===null||e===void 0)&&e.sumBy)for(const a in this.collectedValues[l]){let h;((n=this.collectValuesBy[l])===null||n===void 0?void 0:n.extendRange)==="sum"?(h=Object.values(this.collectedValues[l][a]).reduce((g,f)=>g+f.value(),0),h+=Math.round(h/20)):(h=Object.values(this.collectedValues[l][a]).reduce((g,f)=>f.value()>g?f.value():g,Number.MIN_SAFE_INTEGER),((o=this.collectValuesBy[l])===null||o===void 0?void 0:o.extendRange)==="max"?h+=Math.round(h/20):typeof((r=this.collectValuesBy[l])===null||r===void 0?void 0:r.extendRange)=="number"&&(h=Math.max(h,(s=this.collectValuesBy[l])===null||s===void 0?void 0:s.extendRange)));const d=Object.values(this.collectedValues[l][a]).reduce((g,f)=>f.value()<g?f.value():g,Number.MAX_SAFE_INTEGER);let u,c;this.needSplitPositiveAndNegative&&(u=Object.values(this.collectedValues[l][a]).reduce((g,f)=>f.positiveValue()>g?f.positiveValue():g,Number.MIN_SAFE_INTEGER),c=Object.values(this.collectedValues[l][a]).reduce((g,f)=>f.negativeValue()<g?f.negativeValue():g,Number.MAX_SAFE_INTEGER)),this.collectedValues[l][a]={},this.collectedValues[l][a].max=h,this.collectedValues[l][a].min=d,this.needSplitPositiveAndNegative&&(this.collectedValues[l][a].positiveMax=u,this.collectedValues[l][a].negativeMin=c)}}processCollectedValuesWithSortBy(){var t,e;const n=this;for(const o in this.collectedValues)if(!((e=(t=this.collectValuesBy)===null||t===void 0?void 0:t[o])===null||e===void 0)&&e.sortBy)for(const r in this.collectedValues[o])this.collectedValues[o][r]=this.collectedValues[o][r].sort((s,l)=>{var a,h,d,u;return((h=(a=n.collectValuesBy[o].sortBy)===null||a===void 0?void 0:a.indexOf(s))!==null&&h!==void 0?h:-1)-((u=(d=n.collectValuesBy[o].sortBy)===null||d===void 0?void 0:d.indexOf(l))!==null&&u!==void 0?u:-1)})}generateCollectedValuesSortRule(){for(const t in this.collectedValues)if(this.collectValuesBy&&this.collectValuesBy[t]&&!this.collectValuesBy[t].sortBy){let e=[];for(const n in this.collectedValues[t])Array.isArray(this.collectedValues[t][n])&&(e.push(...this.collectedValues[t][n]),e=Array.from(new Set(e)));e.length>0&&(this.collectValuesBy[t].sortBy=e)}}processRecords(){var t,e;let n=!1;if(((e=(t=this.filterRules)===null||t===void 0?void 0:t.length)!==null&&e!==void 0?e:0)>=1&&(n=!0),Array.isArray(this.records)){this.filteredRecords||(this.filteredRecords=[]);for(let o=0,r=this.records.length;o<r;o++){const s=this.records[o];n&&!this.filterRecord(s)||(this.filteredRecords.push(s),this.processRecord(s))}}else{this.filteredRecords||(this.filteredRecords={});for(const o in this.records)for(let r=0,s=this.records[o].length;r<s;r++){const l=this.records[o][r];n&&!this.filterRecord(l)||(this.filteredRecords[o]||(this.filteredRecords[o]=[]),this.filteredRecords[o].push(l),this.processRecord(l,o))}}this.rowFlatKeys={},this.colFlatKeys={}}filterRecord(t){var e,n;let o=!0;if(this.filterRules)for(let r=0;r<this.filterRules.length;r++){const s=this.filterRules[r];if(s.filterKey){const l=t[s.filterKey];if(((e=s.filteredValues)===null||e===void 0?void 0:e.indexOf(l))===-1){o=!1;break}}else if(!(!((n=s.filterFunc)===null||n===void 0)&&n.call(s,t))){o=!1;break}}return o}processRecord(t,e){var n,o,r,s,l,a,h,d,u,c,g,f,p,m,b,C,_,w,y,S,A,R,x,T,M,B,P,F,H,E,k,I,L,D,O,N,W,$,U,Y,j,G,X,ht,gt,Ct,Q,et,vt,bt,dt,ot,ut,st,_t,ct,Wt,Yt,yt,mt,ie,le,Zt,_e,Oe;(n=this.derivedFieldRules)===null||n===void 0||n.forEach((Rt,Tt)=>{Rt.fieldName&&Rt.derivedFunc&&(t[Rt.fieldName]=Rt.derivedFunc(t))});for(const Rt in this.collectValuesBy)if(z(t[Rt])){this.collectedValues[Rt]||(this.collectedValues[Rt]={});const Tt=this.collectValuesBy[Rt].by.map(Nt=>t[Nt]).join(this.stringJoinChar);if(this.collectedValues[Rt][Tt]||(this.collectValuesBy[Rt].sumBy?this.collectedValues[Rt][Tt]={}:this.collectValuesBy[Rt].range?this.collectedValues[Rt][Tt]={min:Number.MAX_SAFE_INTEGER,max:Number.MIN_SAFE_INTEGER}:this.collectedValues[Rt][Tt]=[]),this.collectValuesBy[Rt].sumBy){const Nt=this.collectValuesBy[Rt].sumBy.map(te=>t[te]).join(this.stringJoinChar);this.collectedValues[Rt][Tt][Nt]||(this.collectedValues[Rt][Tt][Nt]=new this.aggregators[zt.SUM]({key:Rt,dimension:Rt,isRecord:void 0,needSplitPositiveAndNegative:this.needSplitPositiveAndNegative})),this.collectedValues[Rt][Tt][Nt].push(t)}else if(this.collectValuesBy[Rt].range){const Nt=this.collectedValues[Rt][Tt],te=Math.max(t[Rt],Nt.max),ae=Math.min(t[Rt],Nt.min);isNaN(te)||(Nt.max=te,Nt.min=ae)}else{const Nt=this.collectedValues[Rt][Tt];Nt.indexOf(t[Rt])===-1&&Nt.push(t[Rt])}}let He=!1;const Ht=[],Et=[];if(!this.parseCustomTreeToMatchRecords||!((o=this.dataConfig)===null||o===void 0)&&o.isPivotChart||!(!((r=this.customRowTree)===null||r===void 0)&&r.length)||e||this.hasExtensionRowTree){const Rt=[];Et.push({rowKey:Rt,indicatorKey:e});for(let Tt=0,Nt=this.rows.length;Tt<Nt;Tt++){const te=this.rows[Tt];if(te in t)this.rowsHasValue[Tt]=!0,Rt.push(t[te]);else if(te!==Xi){if(!((a=(l=(s=this.dataConfig)===null||s===void 0?void 0:s.totals)===null||l===void 0?void 0:l.row)===null||a===void 0)&&a.showGrandTotals&&Tt===0&&!this.rows.find(ae=>ae in t)){Rt.push(this.rowGrandTotalLabel),He=!0;break}if(!((u=(d=(h=this.dataConfig)===null||h===void 0?void 0:h.totals)===null||d===void 0?void 0:d.row)===null||u===void 0)&&u.subTotalsDimensions&&((f=(g=(c=this.dataConfig)===null||c===void 0?void 0:c.totals)===null||g===void 0?void 0:g.row)===null||f===void 0?void 0:f.subTotalsDimensions.indexOf(this.rows[Tt-1]))>=0){this.rowHierarchyType==="grid"&&Rt.push(this.rowSubTotalLabel),He=!0;break}}}}else{const Rt=this.getFieldMatchRowDimensionPaths(t);if(Rt.length>0)for(let Tt=0,Nt=Rt.length;Tt<Nt;Tt++){const te=Rt[Tt],ae=[];let Jt;for(let J=0,be=te.length;J<be;J++)z(te[J].indicatorKey)?Jt=te[J].indicatorKey:ae.push(te[J].value);Et.push({rowKey:ae,indicatorKey:Jt})}}if(!this.parseCustomTreeToMatchRecords||!((p=this.dataConfig)===null||p===void 0)&&p.isPivotChart||!(!((m=this.customColTree)===null||m===void 0)&&m.length)||e||this.hasExtensionRowTree){const Rt=[];Ht.push({colKey:Rt,indicatorKey:e});for(let Tt=0,Nt=this.columns.length;Tt<Nt;Tt++){const te=this.columns[Tt];if(te in t)this.columnsHasValue[Tt]=!0,Rt.push(t[te]);else if(te!==Xi){if(!((_=(C=(b=this.dataConfig)===null||b===void 0?void 0:b.totals)===null||C===void 0?void 0:C.column)===null||_===void 0)&&_.showGrandTotals&&Tt===0&&!this.columns.find(ae=>ae in t)){Rt.push(this.colGrandTotalLabel),He=!0;break}if(!((S=(y=(w=this.dataConfig)===null||w===void 0?void 0:w.totals)===null||y===void 0?void 0:y.column)===null||S===void 0)&&S.subTotalsDimensions&&((x=(R=(A=this.dataConfig)===null||A===void 0?void 0:A.totals)===null||R===void 0?void 0:R.column)===null||x===void 0?void 0:x.subTotalsDimensions.indexOf(this.columns[Tt-1]))>=0){Rt.push(this.colSubTotalLabel),He=!0;break}}}}else{const Rt=this.getFieldMatchColDimensionPaths(t);if(Rt.length>0)for(let Tt=0,Nt=Rt.length;Tt<Nt;Tt++){const te=Rt[Tt],ae=[];let Jt;for(let J=0,be=te.length;J<be;J++)z(te[J].indicatorKey)?Jt=te[J].indicatorKey:ae.push(te[J].value);Ht.push({colKey:ae,indicatorKey:Jt})}}for(let Rt=0;Rt<Et.length;Rt++){const Tt=Et[Rt].rowKey;let Nt;this.indicatorsAsCol||(Nt=Et[Rt].indicatorKey);for(let te=0;te<Ht.length;te++){const ae=Ht[te].colKey;this.indicatorsAsCol&&(Nt=Ht[te].indicatorKey);const Jt=Tt.join(this.stringJoinChar),J=ae.join(this.stringJoinChar);if(He){this.totalRecordsTree[Jt]||(this.totalRecordsTree[Jt]={}),this.totalRecordsTree[Jt][J]||(this.totalRecordsTree[Jt][J]=[]);const Lt=this.indicatorKeysIncludeCalculatedFieldDependIndicatorKeys;for(let Ot=0;Ot<Lt.length;Ot++)if(this.calculatedFiledKeys.indexOf(Lt[Ot])>=0){const Se=(T=this.calculatedFieldRules)===null||T===void 0?void 0:T.find(qe=>qe.key===Lt[Ot]);!((B=(M=this.totalRecordsTree[Jt])===null||M===void 0?void 0:M[J])===null||B===void 0)&&B[Ot]||(this.totalRecordsTree[Jt][J][Ot]=new this.aggregators[zt.RECALCULATE]({key:Lt[Ot],dimension:Lt[Ot],isRecord:!0,formatFun:(F=(P=this.indicators)===null||P===void 0?void 0:P.find(qe=>typeof qe!="string"&&qe.indicatorKey===Lt[Ot]))===null||F===void 0?void 0:F.format,calculateFun:Se==null?void 0:Se.calculateFun,dependAggregators:this.totalRecordsTree[Jt][J],dependIndicatorKeys:Se==null?void 0:Se.dependIndicatorKeys})),Lt[Ot]in t&&((E=(H=this.totalRecordsTree[Jt])===null||H===void 0?void 0:H[J])===null||E===void 0||E[Ot].push(t))}else{const Se=this.getAggregatorRule(Lt[Ot]);!((I=(k=this.totalRecordsTree[Jt])===null||k===void 0?void 0:k[J])===null||I===void 0)&&I[Ot]||(this.totalRecordsTree[Jt][J][Ot]=new this.aggregators[(L=Se==null?void 0:Se.aggregationType)!==null&&L!==void 0?L:zt.SUM]({key:Lt[Ot],dimension:(D=Se==null?void 0:Se.field)!==null&&D!==void 0?D:Lt[Ot],formatFun:(O=Se==null?void 0:Se.formatFun)!==null&&O!==void 0?O:(W=(N=this.indicators)===null||N===void 0?void 0:N.find(qe=>typeof qe!="string"&&qe.indicatorKey===Lt[Ot]))===null||W===void 0?void 0:W.format})),Lt[Ot]in t&&((U=($=this.totalRecordsTree[Jt])===null||$===void 0?void 0:$[J])===null||U===void 0||U[Ot].push(t))}return}Tt.length!==0&&(this.rowFlatKeys[Jt]||(this.rowKeys.push(Tt),this.rowFlatKeys[Jt]=1)),ae.length!==0&&(this.colFlatKeys[J]||(this.colKeys.push(ae),this.colFlatKeys[J]=1)),this.tree[Jt]||(this.tree[Jt]={}),!((Y=this.tree[Jt])===null||Y===void 0)&&Y[J]||(this.tree[Jt][J]=[]);const be=this.indicatorKeysIncludeCalculatedFieldDependIndicatorKeys;for(let Lt=0;Lt<be.length;Lt++)if(this.calculatedFiledKeys.indexOf(be[Lt])>=0){const Ot=(j=this.calculatedFieldRules)===null||j===void 0?void 0:j.find(Se=>Se.key===be[Lt]);!((X=(G=this.tree[Jt])===null||G===void 0?void 0:G[J])===null||X===void 0)&&X[Lt]||(this.tree[Jt][J][Lt]=new this.aggregators[zt.RECALCULATE]({key:be[Lt],dimension:be[Lt],isRecord:!0,formatFun:(gt=(ht=this.indicators)===null||ht===void 0?void 0:ht.find(Se=>typeof Se!="string"&&Se.indicatorKey===be[Lt]))===null||gt===void 0?void 0:gt.format,calculateFun:Ot==null?void 0:Ot.calculateFun,dependAggregators:this.tree[Jt][J],dependIndicatorKeys:Ot==null?void 0:Ot.dependIndicatorKeys})),(Q=(Ct=this.tree[Jt])===null||Ct===void 0?void 0:Ct[J])===null||Q===void 0||Q[Lt].push(t)}else{const Ot=this.getAggregatorRule(be[Lt]);let Se=!1;Nt?e===Nt?be[Lt]===Nt&&(Se=!0):be[Lt]===Nt&&be[Lt]in t&&(Se=!0):Ot!=null&&Ot.field?typeof(Ot==null?void 0:Ot.field)=="string"?(Ot==null?void 0:Ot.field)in t&&(Se=!0):Ot!=null&&Ot.field.find(qe=>qe in t)&&(Se=!0):be[Lt]in t&&(Se=!0),!(!((vt=(et=this.tree[Jt])===null||et===void 0?void 0:et[J])===null||vt===void 0)&&vt[Lt])&&Se&&(this.tree[Jt][J][Lt]=new this.aggregators[(bt=Ot==null?void 0:Ot.aggregationType)!==null&&bt!==void 0?bt:zt.SUM]({key:be[Lt],dimension:(dt=Ot==null?void 0:Ot.field)!==null&&dt!==void 0?dt:be[Lt],formatFun:(ot=Ot==null?void 0:Ot.formatFun)!==null&&ot!==void 0?ot:(st=(ut=this.indicators)===null||ut===void 0?void 0:ut.find(qe=>typeof qe!="string"&&qe.indicatorKey===be[Lt]))===null||st===void 0?void 0:st.format})),Se&&((ct=(_t=this.tree[Jt])===null||_t===void 0?void 0:_t[J])===null||ct===void 0||ct[Lt].push(t))}if(this.mappingRules)for(let Lt=0;Lt<this.indicatorKeys.length;Lt++){if(!this.indicatorStatistics[Lt]){const Ot=this.getAggregatorRule(this.indicatorKeys[Lt]);this.indicatorStatistics[Lt]={max:new this.aggregators[zt.MAX]({key:this.indicatorKeys[Lt],dimension:this.indicatorKeys[Lt]}),min:new this.aggregators[zt.MIN]({key:this.indicatorKeys[Lt],dimension:this.indicatorKeys[Lt]}),total:new this.aggregators[(Wt=Ot==null?void 0:Ot.aggregationType)!==null&&Wt!==void 0?Wt:zt.SUM]({key:this.indicatorKeys[Lt],dimension:(Yt=Ot==null?void 0:Ot.field)!==null&&Yt!==void 0?Yt:this.indicatorKeys[Lt],formatFun:(yt=Ot==null?void 0:Ot.formatFun)!==null&&yt!==void 0?yt:(ie=(mt=this.indicators)===null||mt===void 0?void 0:mt.find(Se=>typeof Se!="string"&&Se.indicatorKey===this.indicatorKeys[Lt]))===null||ie===void 0?void 0:ie.format})}}this.indicatorStatistics[Lt].max.push((Zt=(le=this.tree[Jt])===null||le===void 0?void 0:le[J])===null||Zt===void 0?void 0:Zt[Lt].value()),this.indicatorStatistics[Lt].min.push((Oe=(_e=this.tree[Jt])===null||_e===void 0?void 0:_e[J])===null||Oe===void 0?void 0:Oe[Lt].value()),this.indicatorStatistics[Lt].total.push(t)}}}}updateSortRules(t){var e,n,o,r,s,l,a,h,d,u,c,g,f,p,m,b,C,_;this.sorted=!1,this.sortRules=t,this.sortKeys(),this.customRowTree||(this.rowHierarchyType==="tree"?this.rowHeaderTree=this.ArrToTree1(this.rowKeys,this.rows.filter((w,y)=>this.rowsHasValue[y]),this.indicatorsAsCol?void 0:this.indicators,((n=(e=this.totals)===null||e===void 0?void 0:e.row)===null||n===void 0?void 0:n.showGrandTotals)||!this.indicatorsAsCol&&this.columns.length===0||this.indicatorsAsCol&&this.rows.length===0,this.rowGrandTotalLabel):this.rowHeaderTree=this.ArrToTree(this.rowKeys,this.rows.filter((w,y)=>this.rowsHasValue[y]),this.indicatorsAsCol?void 0:this.indicators,this.rowsIsTotal,((r=(o=this.totals)===null||o===void 0?void 0:o.row)===null||r===void 0?void 0:r.showGrandTotals)||this.indicatorsAsCol&&this.rows.length===0,this.rowGrandTotalLabel,this.rowSubTotalLabel,(a=(l=(s=this.totals)===null||s===void 0?void 0:s.row)===null||l===void 0?void 0:l.showGrandTotalsOnTop)!==null&&a!==void 0&&a,(u=(d=(h=this.totals)===null||h===void 0?void 0:h.row)===null||d===void 0?void 0:d.showSubTotalsOnTop)!==null&&u!==void 0&&u)),this.customColTree||(this.colHeaderTree=this.ArrToTree(this.colKeys,this.columns.filter((w,y)=>this.columnsHasValue[y]),this.indicatorsAsCol?this.indicators:void 0,this.colsIsTotal,((g=(c=this.totals)===null||c===void 0?void 0:c.column)===null||g===void 0?void 0:g.showGrandTotals)||!this.indicatorsAsCol&&this.columns.length===0,this.colGrandTotalLabel,this.colSubTotalLabel,(m=(p=(f=this.totals)===null||f===void 0?void 0:f.column)===null||p===void 0?void 0:p.showGrandTotalsOnLeft)!==null&&m!==void 0&&m,(_=(C=(b=this.totals)===null||b===void 0?void 0:b.column)===null||C===void 0?void 0:C.showSubTotalsOnLeft)!==null&&_!==void 0&&_))}updateFilterRules(t,e=!1){var n,o;if(this.filterRules=t,this.filteredRecords=void 0,e)this.tree={};else for(const r in this.tree)for(const s in this.tree[r])for(let l=0;l<this.tree[r][s].length;l++)(n=this.tree[r][s][l])===null||n===void 0||n.reset();this.collectedValues={},this.processRecords(),this.processCollectedValuesWithSumBy(),this.processCollectedValuesWithSortBy(),this.totalStatistics(),!((o=this.dataConfig)===null||o===void 0)&&o.isPivotChart&&this.cacheDeminsionCollectedValues()}getAggregatorRule(t){var e;return(e=this.aggregationRules)===null||e===void 0?void 0:e.find((n,o)=>t===n.indicatorKey)}getAggregator(t=[],e=[],n,o=!0,r){var s,l,a,h;const d=this.indicatorKeys.indexOf(n);let u,c;typeof t=="string"?u=t:(r&&r.position!=="row"||t.map((f,p)=>{f!==n||z(r==null?void 0:r.index)&&p!==r.index||t.splice(p,1)}),u=TT(t,this.stringJoinChar)),typeof e=="string"?c=e:(r&&r.position!=="col"||e.map((f,p)=>{f!==n||z(r==null?void 0:r.index)&&p!==r.index||e.splice(p,1)}),c=TT(e,this.stringJoinChar));const g=(l=(s=this.tree[u])===null||s===void 0?void 0:s[c])===null||l===void 0?void 0:l[d];if(o&&z((h=(a=this.changedTree[u])===null||a===void 0?void 0:a[c])===null||h===void 0?void 0:h[d])){const f=this.changedTree[u][c][d];return g?{value:()=>f,formatValue:g.formatValue,formatFun:g.formatFun,records:g.records,className:"",recalculate(){},push(){},deleteRecord(){},updateRecord(){},clearCacheValue(){},reset(){}}:{value:()=>f,className:"",push(){},deleteRecord(){},updateRecord(){},recalculate(){},formatValue:()=>f,clearCacheValue(){},reset(){}}}return g||{className:"",push(){},deleteRecord(){},updateRecord(){},recalculate(){},value:()=>null,clearCacheValue(){},reset(){}}}sortKeys(){if(this.colKeys=this.colKeys_normal.slice(),this.rowKeys=this.rowKeys_normal.slice(),!this.sorted){this.sorted=!0,this.rowKeys.sort(this.arrSort(this.rows,!0));const t=this.arrSort(this.columns,!1);this.colKeys.sort(t)}}arrSort(t,e){let n;const o=this,r=function(s){const l=[];for(let a=0,h=t.length;a<h;a++)if(n=t[a],o.sortRules)for(let d=0,u=o.sortRules.length;d<u;d++)o.sortRules[d].sortField===n&&l.push({field:n,fieldIndex:a,sortRule:o.sortRules[d],func:o.getSort(o.sortRules[d],e)});return l}.call(this);return function(s,l){var a,h,d,u;let c,g;for(let f=0;f<r.length;f++){if(g=r[f],(a=g.sortRule)===null||a===void 0?void 0:a.sortByIndicator){let p=s,m=l;g.fieldIndex<t.length-1&&(p=s.slice(0,g.fieldIndex+1),o.rowHierarchyType==="grid"&&e?p.push(o.rowSubTotalLabel):e||p.push(o.colSubTotalLabel),m=l.slice(0,g.fieldIndex+1),o.rowHierarchyType==="grid"&&e?m.push(o.rowSubTotalLabel):e||m.push(o.colSubTotalLabel)),c=g.func(p,m,(h=g.sortRule)===null||h===void 0?void 0:h.sortType)}else c=(d=g.func)===null||d===void 0?void 0:d.call(g,s[g.fieldIndex],l[g.fieldIndex],(u=g.sortRule)===null||u===void 0?void 0:u.sortType);if(c!==0)return c}return 0}}getSort(t,e){const n=this;return t.sortByIndicator?(o,r,s)=>{const l=function(a,h){return n.rowHierarchyType==="grid"&&a.length<n.rows.length&&a[a.length-1]!==n.rowSubTotalLabel&&a[a.length-1]!==n.rowGrandTotalLabel&&a.push(n.rowSubTotalLabel),h.length<n.columns.length&&h[h.length-1]!==n.colSubTotalLabel&&h[h.length-1]!==n.colGrandTotalLabel&&h.push(n.colSubTotalLabel),n.getAggregator(a,h,t.sortByIndicator).value()};return e?bc(l(o,t.query),l(r,t.query),s):bc(l(t.query,o),l(t.query,r),s)}:t.sortBy?X4(t.sortBy):t.sortFunc?t.sortFunc:t.sortType?Y4:bc}totalStatistics(){var t,e,n,o,r,s,l,a,h,d,u,c,g,f;const p=this,m=(b,C)=>{var _,w,y,S,A,R,x,T,M,B,P,F,H,E,k,I,L,D,O,N,W,$,U,Y,j,G,X,ht,gt,Ct,Q,et,vt,bt,dt,ot,ut,st,_t,ct,Wt,Yt,yt,mt,ie,le,Zt,_e,Oe,He;if(!((w=(_=this.totalRecordsTree)===null||_===void 0?void 0:_[b])===null||w===void 0)&&w[C])return this.tree[b]||(this.tree[b]={}),void(this.tree[b][C]=(S=(y=this.totalRecordsTree)===null||y===void 0?void 0:y[b])===null||S===void 0?void 0:S[C]);const Ht=C.split(this.stringJoinChar);if(!((R=(A=p.totals)===null||A===void 0?void 0:A.column)===null||R===void 0)&&R.subTotalsDimensions&&((M=(T=(x=p.totals)===null||x===void 0?void 0:x.column)===null||T===void 0?void 0:T.subTotalsDimensions)===null||M===void 0?void 0:M.length)>0&&p.totals.column.showSubTotals!==!1)for(let Et=0,Rt=(F=(P=(B=p.totals)===null||B===void 0?void 0:B.column)===null||P===void 0?void 0:P.subTotalsDimensions)===null||F===void 0?void 0:F.length;Et<Rt;Et++){const Tt=p.totals.column.subTotalsDimensions[Et],Nt=p.columns.indexOf(Tt);if(Nt>=0){const te=Ht.slice(0,Nt+1);te.push(p.colSubTotalLabel);const ae=te.join(this.stringJoinChar);if(!((E=(H=this.totalRecordsTree)===null||H===void 0?void 0:H[b])===null||E===void 0)&&E[ae])return void(this.tree[b][ae]=(I=(k=this.totalRecordsTree)===null||k===void 0?void 0:k[b])===null||I===void 0?void 0:I[ae]);this.tree[b][ae]||(this.tree[b][ae]=[]);const Jt=this.indicatorKeysIncludeCalculatedFieldDependIndicatorKeys;for(let J=0;J<Jt.length;J++)if(this.calculatedFiledKeys.indexOf(Jt[J])>=0){const be=(L=this.calculatedFieldRules)===null||L===void 0?void 0:L.find(Lt=>Lt.key===Jt[J]);!((O=(D=this.tree[b])===null||D===void 0?void 0:D[ae])===null||O===void 0)&&O[J]||(this.tree[b][ae][J]=new this.aggregators[zt.RECALCULATE]({key:Jt[J],dimension:Jt[J],isRecord:!0,formatFun:(W=(N=this.indicators)===null||N===void 0?void 0:N.find(Lt=>typeof Lt!="string"&&Lt.indicatorKey===Jt[J]))===null||W===void 0?void 0:W.format,calculateFun:be==null?void 0:be.calculateFun,dependAggregators:this.tree[b][ae],dependIndicatorKeys:be==null?void 0:be.dependIndicatorKeys})),ae!==C&&this.tree[b][ae][J].push((U=($=p.tree[b])===null||$===void 0?void 0:$[C])===null||U===void 0?void 0:U[J])}else{if(!this.tree[b][ae][J]){const be=this.getAggregatorRule(Jt[J]);this.tree[b][ae][J]=new this.aggregators[(Y=be==null?void 0:be.aggregationType)!==null&&Y!==void 0?Y:zt.SUM]({key:Jt[J],dimension:(j=be==null?void 0:be.field)!==null&&j!==void 0?j:Jt[J],formatFun:(G=be==null?void 0:be.formatFun)!==null&&G!==void 0?G:(ht=(X=this.indicators)===null||X===void 0?void 0:X.find(Lt=>typeof Lt!="string"&&Lt.indicatorKey===Jt[J]))===null||ht===void 0?void 0:ht.format})}ae!==C&&this.tree[b][ae][J].push((Ct=(gt=p.tree[b])===null||gt===void 0?void 0:gt[C])===null||Ct===void 0?void 0:Ct[J])}}}if(!((et=(Q=p.totals)===null||Q===void 0?void 0:Q.column)===null||et===void 0)&&et.showGrandTotals||this.rows.length===0){const Et=p.colGrandTotalLabel;if(!((bt=(vt=this.totalRecordsTree)===null||vt===void 0?void 0:vt[b])===null||bt===void 0)&&bt[Et])return void(this.tree[b][Et]=(ot=(dt=this.totalRecordsTree)===null||dt===void 0?void 0:dt[b])===null||ot===void 0?void 0:ot[Et]);this.tree[b][Et]||(this.tree[b][Et]=[]);const Rt=this.indicatorKeysIncludeCalculatedFieldDependIndicatorKeys;for(let Tt=0;Tt<Rt.length;Tt++)if(this.calculatedFiledKeys.indexOf(Rt[Tt])>=0){const Nt=(ut=this.calculatedFieldRules)===null||ut===void 0?void 0:ut.find(te=>te.key===Rt[Tt]);!((_t=(st=this.tree[b])===null||st===void 0?void 0:st[Et])===null||_t===void 0)&&_t[Tt]||(this.tree[b][Et][Tt]=new this.aggregators[zt.RECALCULATE]({key:Rt[Tt],dimension:Rt[Tt],isRecord:!0,formatFun:(Wt=(ct=this.indicators)===null||ct===void 0?void 0:ct.find(te=>typeof te!="string"&&te.indicatorKey===Rt[Tt]))===null||Wt===void 0?void 0:Wt.format,calculateFun:Nt==null?void 0:Nt.calculateFun,dependAggregators:this.tree[b][Et],dependIndicatorKeys:Nt==null?void 0:Nt.dependIndicatorKeys})),Et!==C&&this.tree[b][Et][Tt].push((yt=(Yt=p.tree[b])===null||Yt===void 0?void 0:Yt[C])===null||yt===void 0?void 0:yt[Tt])}else{if(!this.tree[b][Et][Tt]){const Nt=this.getAggregatorRule(Rt[Tt]);this.tree[b][Et][Tt]=new this.aggregators[(mt=Nt==null?void 0:Nt.aggregationType)!==null&&mt!==void 0?mt:zt.SUM]({key:Rt[Tt],dimension:(ie=Nt==null?void 0:Nt.field)!==null&&ie!==void 0?ie:Rt[Tt],formatFun:(le=Nt==null?void 0:Nt.formatFun)!==null&&le!==void 0?le:(_e=(Zt=this.indicators)===null||Zt===void 0?void 0:Zt.find(te=>typeof te!="string"&&te.indicatorKey===Rt[Tt]))===null||_e===void 0?void 0:_e.format})}Et!==C&&this.tree[b][Et][Tt].push((He=(Oe=p.tree[b])===null||Oe===void 0?void 0:Oe[C])===null||He===void 0?void 0:He[Tt])}}};if(!((e=(t=p==null?void 0:p.totals)===null||t===void 0?void 0:t.column)===null||e===void 0)&&e.subTotalsDimensions&&((r=(o=(n=p==null?void 0:p.totals)===null||n===void 0?void 0:n.column)===null||o===void 0?void 0:o.subTotalsDimensions)===null||r===void 0?void 0:r.length)>=1||!((l=(s=p==null?void 0:p.totals)===null||s===void 0?void 0:s.row)===null||l===void 0)&&l.subTotalsDimensions&&((d=(h=(a=p==null?void 0:p.totals)===null||a===void 0?void 0:a.row)===null||h===void 0?void 0:h.subTotalsDimensions)===null||d===void 0?void 0:d.length)>=1||!((c=(u=p==null?void 0:p.totals)===null||u===void 0?void 0:u.column)===null||c===void 0)&&c.showGrandTotals||!((f=(g=p==null?void 0:p.totals)===null||g===void 0?void 0:g.row)===null||f===void 0)&&f.showGrandTotals){const b=[];Object.keys(p.tree).forEach(C=>{const _=C.split(this.stringJoinChar);Object.keys(p.tree[C]).forEach(w=>{var y,S,A,R,x,T,M,B,P,F,H,E,k,I,L,D,O,N,W,$,U,Y,j,G,X,ht,gt,Ct,Q,et;if(!((S=(y=p.totals)===null||y===void 0?void 0:y.row)===null||S===void 0)&&S.subTotalsDimensions&&((x=(R=(A=p.totals)===null||A===void 0?void 0:A.row)===null||R===void 0?void 0:R.subTotalsDimensions)===null||x===void 0?void 0:x.length)>0&&p.totals.row.showSubTotals!==!1)for(let vt=0,bt=(B=(M=(T=p.totals)===null||T===void 0?void 0:T.row)===null||M===void 0?void 0:M.subTotalsDimensions)===null||B===void 0?void 0:B.length;vt<bt;vt++){const dt=p.totals.row.subTotalsDimensions[vt],ot=p.rows.indexOf(dt);if(ot>=0&&ot<p.rows.length-1){const ut=_.slice(0,ot+1);this.rowHierarchyType==="grid"&&ut.push(p.rowSubTotalLabel);const st=ut.join(this.stringJoinChar);this.tree[st]||(this.tree[st]={},b.push(st)),this.tree[st][w]||(this.tree[st][w]=[]);const _t=this.indicatorKeysIncludeCalculatedFieldDependIndicatorKeys;for(let ct=0;ct<_t.length;ct++){if(!this.tree[st][w][ct])if(this.calculatedFiledKeys.indexOf(_t[ct])>=0){const Wt=(P=this.calculatedFieldRules)===null||P===void 0?void 0:P.find(Yt=>Yt.key===_t[ct]);this.tree[st][w][ct]=new this.aggregators[zt.RECALCULATE]({key:_t[ct],dimension:_t[ct],isRecord:!0,formatFun:(H=(F=this.indicators)===null||F===void 0?void 0:F.find(Yt=>typeof Yt!="string"&&Yt.indicatorKey===_t[ct]))===null||H===void 0?void 0:H.format,calculateFun:Wt==null?void 0:Wt.calculateFun,dependAggregators:this.tree[st][w],dependIndicatorKeys:Wt==null?void 0:Wt.dependIndicatorKeys})}else{const Wt=this.getAggregatorRule(_t[ct]);this.tree[st][w][ct]=new this.aggregators[(E=Wt==null?void 0:Wt.aggregationType)!==null&&E!==void 0?E:zt.SUM]({key:_t[ct],dimension:(k=Wt==null?void 0:Wt.field)!==null&&k!==void 0?k:_t[ct],formatFun:(I=Wt==null?void 0:Wt.formatFun)!==null&&I!==void 0?I:(D=(L=this.indicators)===null||L===void 0?void 0:L.find(Yt=>typeof Yt!="string"&&Yt.indicatorKey===_t[ct]))===null||D===void 0?void 0:D.format})}st!==C&&this.tree[st][w][ct].push((N=(O=p.tree[C])===null||O===void 0?void 0:O[w])===null||N===void 0?void 0:N[ct])}}}if(!(($=(W=p.totals)===null||W===void 0?void 0:W.row)===null||$===void 0)&&$.showGrandTotals||this.columns.length===0){const vt=p.rowGrandTotalLabel;this.tree[vt]||(this.tree[vt]={},b.push(vt)),this.tree[vt][w]||(this.tree[vt][w]=[]);const bt=this.indicatorKeysIncludeCalculatedFieldDependIndicatorKeys;for(let dt=0;dt<bt.length;dt++){if(!this.tree[vt][w][dt])if(this.calculatedFiledKeys.indexOf(bt[dt])>=0){const ot=(U=this.calculatedFieldRules)===null||U===void 0?void 0:U.find(ut=>ut.key===bt[dt]);this.tree[vt][w][dt]=new this.aggregators[zt.RECALCULATE]({key:bt[dt],dimension:bt[dt],isRecord:!0,formatFun:(j=(Y=this.indicators)===null||Y===void 0?void 0:Y.find(ut=>typeof ut!="string"&&ut.indicatorKey===bt[dt]))===null||j===void 0?void 0:j.format,calculateFun:ot==null?void 0:ot.calculateFun,dependAggregators:this.tree[vt][w],dependIndicatorKeys:ot==null?void 0:ot.dependIndicatorKeys})}else{const ot=this.getAggregatorRule(bt[dt]);this.tree[vt][w][dt]=new this.aggregators[(G=ot==null?void 0:ot.aggregationType)!==null&&G!==void 0?G:zt.SUM]({key:bt[dt],dimension:(X=ot==null?void 0:ot.field)!==null&&X!==void 0?X:bt[dt],formatFun:(ht=ot==null?void 0:ot.formatFun)!==null&&ht!==void 0?ht:(Ct=(gt=this.indicators)===null||gt===void 0?void 0:gt.find(ut=>typeof ut!="string"&&ut.indicatorKey===bt[dt]))===null||Ct===void 0?void 0:Ct.format})}vt!==C&&this.tree[vt][w][dt].push((et=(Q=p.tree[C])===null||Q===void 0?void 0:Q[w])===null||et===void 0?void 0:et[dt])}}m(C,w)})}),b.forEach(C=>{Object.keys(p.tree[C]).forEach(_=>{m(C,_)})})}for(const b in p.totalRecordsTree)for(const C in p.totalRecordsTree[b])m(b,C)}ArrToTree1(t,e,n,o,r){const s=[],l=this.stringJoinChar,a=new Map;function h(d){const u=[];let c;d.forEach((g,f)=>{var p;u.push(g);const m=u.join(l);let b=a.get(m);b||(b={value:g,dimensionKey:e[f],children:f===d.length-1&&((p=n==null?void 0:n.length)!==null&&p!==void 0?p:0)>=1?n==null?void 0:n.map(C=>typeof C=="string"?{indicatorKey:C,value:C}:{indicatorKey:C.indicatorKey,value:C.title}):[]},a.set(m,b),c?c.children.push(b):s.push(b)),c=b})}return t.forEach(d=>h(d)),o&&h([r]),s}ArrToTree(t,e,n,o,r,s,l,a,h){var d;let u=[];const c=this.stringJoinChar,g=new Map;if(t!=null&&t.length?t.forEach(f=>function(p){const m=[];let b;p.forEach((C,_)=>{var w,y,S,A;m.push(C);const R=m.join(c);let x=g.get(R);if(!x){if(x={value:C,dimensionKey:e[_],children:_===p.length-1&&((w=n==null?void 0:n.length)!==null&&w!==void 0?w:0)>=1?n==null?void 0:n.map(T=>typeof T=="string"?{indicatorKey:T,value:T}:{indicatorKey:T.indicatorKey,value:T.title}):[]},o[_]){let T=(y=x.children)!==null&&y!==void 0?y:[];const M={value:l,dimensionKey:e[_+1],levelSpan:o.length-_-1,children:((S=n==null?void 0:n.length)!==null&&S!==void 0?S:0)>=1?n==null?void 0:n.map(B=>typeof B=="string"?{indicatorKey:B,value:B}:{indicatorKey:B.indicatorKey,value:B.title}):[]};T.push(M),T=(A=M.children)!==null&&A!==void 0?A:[]}g.set(R,x),b?o[_-1]&&!h?b.children.splice(b.children.length-1,0,x):b.children.push(x):u.push(x)}b=x})}(f)):n&&(u=n==null?void 0:n.map(f=>{var p;return typeof f=="string"?{indicatorKey:f,value:f}:{indicatorKey:f.indicatorKey,value:(p=f.title)!==null&&p!==void 0?p:f.indicatorKey}})),r&&(t==null?void 0:t.length)){const f={value:s,dimensionKey:e[0],levelSpan:o.length,children:(d=n==null?void 0:n.map(p=>typeof p=="string"?{indicatorKey:p,value:p}:{indicatorKey:p.indicatorKey,value:p.title}))!==null&&d!==void 0?d:[]};a?u.unshift(f):u.push(f)}return u}cacheDeminsionCollectedValues(){for(const t in this.collectValuesBy)this.collectValuesBy[t].type!=="xField"&&this.collectValuesBy[t].type!=="yField"||(this.dataConfig.dimensionSortArray?this.cacheCollectedValues[t]=z9(this.collectedValues[t],this.dataConfig.dimensionSortArray):this.cacheCollectedValues[t]=this.collectedValues[t])}changeTreeNodeValue(t=[],e=[],n,o){var r,s,l;const a=this.indicatorKeys.indexOf(n);let h,d;h=typeof t=="string"?t:t.join(this.stringJoinChar),d=typeof e=="string"?e:e.join(this.stringJoinChar),!((r=this.changedTree[h])===null||r===void 0)&&r[d]?this.changedTree[h][d][a]=o:this.changedTree[h]?(this.changedTree[h][d]=[],this.changedTree[h][d][a]=o):(this.changedTree[h]={},this.changedTree[h][d]=[],this.changedTree[h][d][a]=o);const u=(l=(s=this.tree[h])===null||s===void 0?void 0:s[d])===null||l===void 0?void 0:l[a];(u==null?void 0:u.records.length)===1&&(u.records[0][this.indicatorKeys[a]]=o)}changeRecordFieldValue(t,e,n){let o=!1;for(let r=0;r<this.indicatorKeys.length;r++)this.indicatorKeys[r]===t&&(o=!0);if(!o){if(Array.isArray(this.records))for(let r=0,s=this.records.length;r<s;r++){const l=this.records[r];l[t]===e&&(l[t]=n)}else for(const r in this.records)for(let s=0,l=this.records[r].length;s<l;s++){const a=this.records[r][s];a[t]===e&&(a[t]=n)}this.rowFlatKeys={},this.colFlatKeys={},this.tree={},this.processRecords()}}_rowTreeHasChanged(){this.hasExtensionRowTree||(this.customRowTreeDimensionPaths=this.customTreeToDimensionPathArr(this.customRowTree,"row"))}changeDataConfig(t){this.rows=t.rows,this.columns=t.columns}addRecords(t){for(let e=0,n=t.length;e<n;e++){const o=t[e];this.processRecord(o)}Array.isArray(this.records)&&this.records.push(t)}customTreeToDimensionPathArr(t,e){const n=[],o=this;function r(s,l){var a,h,d;s.virtual||(!((a=l[l.length-1])===null||a===void 0)&&a.childKeys&&s.dimensionKey&&l[l.length-1].childKeys.indexOf(s.dimensionKey)===-1&&s.dimensionKey!==l[l.length-1].dimensionKey&&l[l.length-1].childKeys.push(s.dimensionKey),l.push({dimensionKey:z(s.indicatorKey)?void 0:s.dimensionKey,value:s.value,indicatorKey:s.indicatorKey,virtual:s.virtual})),((h=s.children)===null||h===void 0?void 0:h.length)>0?(o.rowHierarchyType==="tree"&&e==="row"&&(l[l.length-1].childKeys=[],n.push([...l])),(d=s.children)===null||d===void 0||d.forEach(u=>r(u,[...l]))):n.push(l)}return t==null||t.forEach(s=>r(s,[])),n}getFieldMatchColDimensionPaths(t){var e,n;const o=[];for(let r=0;(n=r<((e=this.customColTreeDimensionPaths)===null||e===void 0?void 0:e.length))!==null&&n!==void 0&&n;r++){const s=this.customColTreeDimensionPaths[r];let l=!0;for(let a=0;a<s.length;a++){const h=s[a];if(h.dimensionKey&&t[h.dimensionKey]!==h.value||h.indicatorKey&&t[h.indicatorKey]===void 0){l=!1;break}}l&&o.push(s)}return o}getFieldMatchRowDimensionPaths(t){var e,n;const o=[];for(let r=0;(n=r<((e=this.customRowTreeDimensionPaths)===null||e===void 0?void 0:e.length))!==null&&n!==void 0&&n;r++){const s=this.customRowTreeDimensionPaths[r];let l=!0;for(let a=0;a<s.length;a++){const h=s[a];if(h.dimensionKey&&t[h.dimensionKey]!==h.value||h.indicatorKey&&t[h.indicatorKey]===void 0){l=!1;break}if(h.childKeys&&a===s.length-1&&h.childKeys.length>0&&h.childKeys.find(d=>z(t[d]))){l=!1;break}}l&&(this.indicatorsAsCol||this.rowHierarchyType!=="tree"||s.find(a=>a.indicatorKey)||(l=!1)),l&&o.push(s)}return o}}function z9(i,t){return i.sort((e,n)=>{const o=t.indexOf(e),r=t.indexOf(n);return o<r?-1:o>r?1:0})}let MT=class extends Cg{constructor(t,e){var n,o,r,s,l,a,h,d,u,c,g,f,p,m,b,C;if(oe.mode==="node"?(e=t,t=null):t instanceof HTMLElement||(e=t,t=t.container?t.container:null),super(t,e),this.layoutNodeId={seqId:0},e){e.layout&&Object.assign(e,e.layout),this.internalProps.columns=Ee(e.columns),this.internalProps.rows=Ee(e.rows),this.internalProps.indicators=ho(e.indicators),(n=e.indicators)===null||n===void 0||n.forEach((w,y)=>{typeof w=="object"&&(w!=null&&w.editor)&&(this.internalProps.indicators[y].editor=w.editor)}),this.internalProps.columnTree=!e.indicatorsAsCol||!((o=e.columns)===null||o===void 0)&&o.length||e.columnTree?Ee(e.columnTree):[],this.internalProps.rowTree=e.indicatorsAsCol||!((r=e.rows)===null||r===void 0)&&r.length||e.rowTree?Ee(e.rowTree):[],this.internalProps.records=e.records,this.pagination=e.pagination,this.internalProps.columnResizeType=(s=e.columnResizeType)!==null&&s!==void 0?s:"column",this.internalProps.rowResizeType=(l=e.rowResizeType)!==null&&l!==void 0?l:"row",this.internalProps.dataConfig=Ee(e.dataConfig),this.internalProps.columnWidthConfig=e.columnWidthConfig;const _=this.internalProps.records;if(this.internalProps.recordsIsTwoDimensionalArray=!1,((a=_==null?void 0:_[0])===null||a===void 0?void 0:a.constructor)===Array&&(this.internalProps.recordsIsTwoDimensionalArray=!0),((h=e.customConfig)===null||h===void 0?void 0:h.enableDataAnalysis)===!1){const w=new Pe((d=this.internalProps.columnTree)!==null&&d!==void 0?d:[],this.layoutNodeId),y=new Pe((u=this.internalProps.rowTree)!==null&&u!==void 0?u:[],this.layoutNodeId,this.options.rowHierarchyType,this.options.rowHierarchyType==="tree"?(c=this.options.rowExpandLevel)!==null&&c!==void 0?c:1:void 0);this.internalProps.layoutMap=new lr(this,null,w,y),this.internalProps.recordsIsTwoDimensionalArray===!1&&(this.flatDataToObjects=new pv({rows:this.internalProps.layoutMap.fullRowDimensionKeys,columns:this.internalProps.layoutMap.colDimensionKeys,indicators:this.internalProps.layoutMap.indicatorKeys,indicatorsAsCol:this.internalProps.layoutMap.indicatorsAsCol,indicatorDimensionKey:this.internalProps.layoutMap.indicatorDimensionKey},_))}else{const w=$A(this,e),{rowKeys:y,columnKeys:S,indicatorKeys:A}=w;let{columnDimensionTree:R,rowDimensionTree:x}=w;this.dataset=new Ih(this.internalProps.dataConfig,y,S,A,this.internalProps.indicators,(g=e.indicatorsAsCol)===null||g===void 0||g,e.records,e.rowHierarchyType,this.internalProps.columnTree,this.internalProps.rowTree,!1,!!e.extensionRows,!!e.parseCustomTreeToMatchRecords),e.columnTree||(e.indicatorsAsCol!==!1&&(this.dataset.colHeaderTree=Vi(this.dataset.colHeaderTree,e.indicators)),R=new Pe((f=this.dataset.colHeaderTree)!==null&&f!==void 0?f:[],this.layoutNodeId)),e.rowTree||(e.indicatorsAsCol===!1&&(this.dataset.rowHeaderTree=Vi(this.dataset.rowHeaderTree,e.indicators)),x=new Pe((p=this.dataset.rowHeaderTree)!==null&&p!==void 0?p:[],this.layoutNodeId,this.options.rowHierarchyType,this.options.rowHierarchyType==="tree"?(m=this.options.rowExpandLevel)!==null&&m!==void 0?m:1:void 0)),this.internalProps.layoutMap=new lr(this,this.dataset,R,x)}if(this._changePivotSortStateBySortRules(),((C=(b=e.pivotSortState)===null||b===void 0?void 0:b.length)!==null&&C!==void 0?C:0)>0&&(this.pivotSortState=[],this.pivotSortState=e.pivotSortState),oe.mode!=="node"&&(this.editorManager=new cT(this)),this.refreshHeader(),this.internalProps.useOneRowHeightFillAll=!1,this.stateManager.initCheckedState(_),this.scenegraph.createSceneGraph(),e.title){const w=Bt.getComponent("title");this.internalProps.title=new w(e.title,this),this.scenegraph.resize()}if(this.options.emptyTip)if(this.internalProps.emptyTip)this.internalProps.emptyTip.resetVisible();else{const w=Bt.getComponent("emptyTip");this.internalProps.emptyTip=new w(this.options.emptyTip,this),this.internalProps.emptyTip.resetVisible()}setTimeout(()=>{this.fireListeners(at.INITIALIZED,null)},0)}}static get EVENT_TYPE(){return rr}isListTable(){return!1}isPivotTable(){return!0}isPivotChart(){return!1}get recordsCount(){var t;return(t=this.records)===null||t===void 0?void 0:t.length}_canResizeColumn(t,e){const n=super._canResizeColumn(t,e);if(n){if(this.internalProps.layoutMap.isSeriesNumber(t,e)&&this.internalProps.rowSeriesNumber.disableColumnResize===!0)return!1;if(!this.internalProps.layoutMap.indicatorsAsCol){const o=this.internalProps.layoutMap.getBody(t,this.columnHeaderLevelCount);if(o!=null&&o.disableColumnResize)return!1}}return n}updateOption(t){var e,n,o,r,s,l,a,h,d,u,c,g,f,p,m,b,C,_;const w=this.internalProps;if(super.updateOption(t),this.layoutNodeId={seqId:0},this.internalProps.columns=Ee(t.columns),this.internalProps.rows=Ee(t.rows),this.internalProps.indicators=!((e=t.indicators)===null||e===void 0)&&e.length?ho(t.indicators):[],(n=t.indicators)===null||n===void 0||n.forEach((S,A)=>{typeof S=="object"&&(S!=null&&S.editor)&&(this.internalProps.indicators[A].editor=S.editor)}),this.internalProps.columnTree=!t.indicatorsAsCol||!((o=t.columns)===null||o===void 0)&&o.length||t.columnTree?Ee(t.columnTree):[],this.internalProps.rowTree=t.indicatorsAsCol||!((r=t.rows)===null||r===void 0)&&r.length||t.rowTree?Ee(t.rowTree):[],t.records&&(this.internalProps.records=t.records),this.stateManager.initCheckedState(this.internalProps.records),this.stateManager.updateDrillState(void 0,void 0,!1,!1,-1,-1),this.pagination=t.pagination,w.columnResizeType=(s=t.columnResizeType)!==null&&s!==void 0?s:"column",w.rowResizeType=(l=t.rowResizeType)!==null&&l!==void 0?l:"row",w.dataConfig=Ee(t.dataConfig),this.internalProps.columnWidthConfig=t.columnWidthConfig,(t==null?void 0:t.rowHierarchyType)==="tree"&&this.internalProps.layoutMap.rowHierarchyType==="tree"&&this.internalProps.layoutMap.rowExpandLevel===(t==null?void 0:t.rowExpandLevel)){const S=this.internalProps.layoutMap.rowDimensionTree.tree.children;(a=this.internalProps.rowTree)===null||a===void 0||a.forEach((A,R)=>{const x=S.find(T=>T.dimensionKey===A.dimensionKey&&T.value===A.value);x&&this._syncHierarchyState(x,A)})}const y=this.internalProps.records;if(this.internalProps.recordsIsTwoDimensionalArray=!1,((h=y==null?void 0:y[0])===null||h===void 0?void 0:h.constructor)===Array&&(this.internalProps.recordsIsTwoDimensionalArray=!0),((d=t.customConfig)===null||d===void 0?void 0:d.enableDataAnalysis)===!1){let S,A;t.columnTree&&(S=new Pe((u=this.internalProps.columnTree)!==null&&u!==void 0?u:[],this.layoutNodeId)),t.rowTree&&(A=new Pe((c=this.internalProps.rowTree)!==null&&c!==void 0?c:[],this.layoutNodeId,this.options.rowHierarchyType,this.options.rowHierarchyType==="tree"?(g=this.options.rowExpandLevel)!==null&&g!==void 0?g:1:void 0)),w.layoutMap=new lr(this,null,S,A),this.internalProps.recordsIsTwoDimensionalArray===!1&&(this.flatDataToObjects=new pv({rows:w.layoutMap.fullRowDimensionKeys,columns:w.layoutMap.colDimensionKeys,indicators:w.layoutMap.indicatorKeys,indicatorsAsCol:w.layoutMap.indicatorsAsCol,indicatorDimensionKey:w.layoutMap.indicatorDimensionKey},y))}else{const S=$A(this,t),{rowKeys:A,columnKeys:R,indicatorKeys:x}=S;let{columnDimensionTree:T,rowDimensionTree:M}=S;this.dataset=new Ih(w.dataConfig,A,R,x,this.internalProps.indicators,(f=t.indicatorsAsCol)===null||f===void 0||f,y,t.rowHierarchyType,this.internalProps.columnTree,this.internalProps.rowTree,!1,!!t.extensionRows,!!t.parseCustomTreeToMatchRecords),t.columnTree||(t.indicatorsAsCol!==!1&&(this.dataset.colHeaderTree=Vi(this.dataset.colHeaderTree,t.indicators)),T=new Pe((p=this.dataset.colHeaderTree)!==null&&p!==void 0?p:[],this.layoutNodeId)),t.rowTree||(t.indicatorsAsCol===!1&&(this.dataset.rowHeaderTree=Vi(this.dataset.rowHeaderTree,t.indicators)),M=new Pe((m=this.dataset.rowHeaderTree)!==null&&m!==void 0?m:[],this.layoutNodeId,this.options.rowHierarchyType,this.options.rowHierarchyType==="tree"?(b=this.options.rowExpandLevel)!==null&&b!==void 0?b:1:void 0)),w.layoutMap=new lr(this,this.dataset,T,M)}if(this._changePivotSortStateBySortRules(),((_=(C=t.pivotSortState)===null||C===void 0?void 0:C.length)!==null&&_!==void 0?_:0)>0&&(this.pivotSortState=[],this.pivotSortState=t.pivotSortState),this.refreshHeader(),this.internalProps.useOneRowHeightFillAll=!1,w.releaseList&&(w.releaseList.forEach(S=>{var A;return(A=S==null?void 0:S.release)===null||A===void 0?void 0:A.call(S)}),w.releaseList=null),this.scenegraph.clearCells(),this.scenegraph.createSceneGraph(),t.title){const S=Bt.getComponent("title");this.internalProps.title=new S(t.title,this),this.scenegraph.resize()}if(this.options.emptyTip)if(this.internalProps.emptyTip)this.internalProps.emptyTip.resetVisible();else{const S=Bt.getComponent("emptyTip");this.internalProps.emptyTip=new S(this.options.emptyTip,this),this.internalProps.emptyTip.resetVisible()}return new Promise(S=>{setTimeout(S,0)})}updatePagination(t){t?(this.pagination||(this.pagination={currentPage:0,perPageCount:0}),typeof t.currentPage=="number"&&t.currentPage>=0&&(this.pagination.currentPage=t.currentPage),t.perPageCount&&(this.pagination.perPageCount=t.perPageCount||this.pagination.perPageCount),this.scenegraph.clearCells(),this.internalProps.layoutMap.setPagination(this.pagination),this.refreshRowColCount(),this.scenegraph.createSceneGraph(),this.render()):this.pagination&&(this.pagination=void 0,this.scenegraph.clearCells(),this.internalProps.layoutMap.setPagination(void 0),this.refreshRowColCount(),this.scenegraph.createSceneGraph(),this.render())}refreshHeader(){this.setMinMaxLimitWidth(!0),this.refreshRowColCount()}refreshRowColCount(){var t,e,n,o,r,s,l,a,h;const d=this,{layoutMap:u}=d.internalProps;u&&(d.colCount=(t=u.colCount)!==null&&t!==void 0?t:0,d.rowCount=(e=u.rowCount)!==null&&e!==void 0?e:0,this.internalProps.frozenColCount=Math.max(((n=u.rowHeaderLevelCount)!==null&&n!==void 0?n:0)+u.leftRowSeriesNumberColumnCount,(o=this.options.frozenColCount)!==null&&o!==void 0?o:0),d.frozenRowCount=Math.max(u.headerLevelCount,(r=this.options.frozenRowCount)!==null&&r!==void 0?r:0),d.bottomFrozenRowCount!==((s=this.options.bottomFrozenRowCount)!==null&&s!==void 0?s:0)&&(d.bottomFrozenRowCount=(l=this.options.bottomFrozenRowCount)!==null&&l!==void 0?l:0),d.rightFrozenColCount!==((a=this.options.rightFrozenColCount)!==null&&a!==void 0?a:0)&&(d.rightFrozenColCount=(h=this.options.rightFrozenColCount)!==null&&h!==void 0?h:0),this.stateManager.setFrozenCol(this.internalProps.frozenColCount))}_getSortFuncFromHeaderOption(t,e,n){}get rowHierarchyType(){return this.internalProps.layoutMap.rowHierarchyType}_syncHierarchyState(t,e){var n,o;t.value===e.value&&t.dimensionKey===e.dimensionKey&&(e.hierarchyState=(n=e.hierarchyState)!==null&&n!==void 0?n:e!=null&&e.children?t.hierarchyState:void 0,(o=e==null?void 0:e.children)===null||o===void 0||o.forEach((r,s)=>{var l;if(!((l=t==null?void 0:t.children)===null||l===void 0)&&l[s]&&r){const a=t.children.find(h=>h.dimensionKey===r.dimensionKey&&h.value===r.value);a&&this._syncHierarchyState(a,r)}}))}getRecordShowIndexByCell(t,e){}getTableIndexByRecordIndex(t){}getTableIndexByField(t){}getCellAddrByFieldRecord(t,e){}getBodyIndexByRow(t){const{layoutMap:e}=this.internalProps;return e.getBodyIndexByRow(t)}getBodyIndexByCol(t){const{layoutMap:e}=this.internalProps;return e.getBodyIndexByCol(t)}getFieldData(t,e,n){var o,r,s;if(!this.internalProps.layoutMap.isHeader(e,n)){if(this.internalProps.recordsIsTwoDimensionalArray){const l=this.getBodyIndexByRow(n),a=this.getBodyIndexByCol(e);return(o=this.records[l])===null||o===void 0?void 0:o[a]}if(this.dataset){const l=this.internalProps.layoutMap.getCellHeaderPaths(e,n);if(l){let a;const h=(r=l.colHeaderPaths)===null||r===void 0?void 0:r.filter(c=>!c.virtual).map((c,g)=>{var f;return c.indicatorKey&&(a={position:"col",index:g}),(f=c.indicatorKey)!==null&&f!==void 0?f:c.value}),d=(s=l.rowHeaderPaths)===null||s===void 0?void 0:s.filter(c=>!c.virtual).map((c,g)=>{var f;return c.indicatorKey&&(a={position:"row",index:g}),(f=c.indicatorKey)!==null&&f!==void 0?f:c.value}),u=this.dataset.getAggregator(d,h,this.internalProps.layoutMap.getIndicatorKey(e,n),!0,a);if(u.records&&u.records.length>=1)return u.records[0][t]}}else if(this.flatDataToObjects){const l=this.internalProps.layoutMap.getCellHeaderPaths(e,n),a=l.colHeaderPaths.map(u=>{var c;return(c=u.indicatorKey)!==null&&c!==void 0?c:u.value}),h=l.rowHeaderPaths.map(u=>{var c;return(c=u.indicatorKey)!==null&&c!==void 0?c:u.value}),d=this.flatDataToObjects.getTreeNode(h,a,this.internalProps.layoutMap.getBody(e,n).indicatorKey,!1);if(d!=null&&d.record)return d==null?void 0:d.record[t]}}}getCellValue(t,e,n){var o,r,s,l,a,h,d;if(!n){const u=this.getCustomMergeValue(t,e);if(u)return u}if(this.internalProps.layoutMap.isSeriesNumber(t,e)){if(this.internalProps.layoutMap.isSeriesNumberInHeader(t,e)){const{title:c}=this.internalProps.layoutMap.getSeriesNumberHeader(t,e);return c}const{format:u}=this.internalProps.layoutMap.getSeriesNumberBody(t,e);return typeof u=="function"?u(t,e,this):e-this.columnHeaderLevelCount+1}if(this.internalProps.layoutMap.isHeader(t,e)){const{title:u,fieldFormat:c}=this.internalProps.layoutMap.getHeader(t,e);return typeof c=="function"?c(u,t,e,this):u}if(this.internalProps.recordsIsTwoDimensionalArray){const{fieldFormat:u}=this.internalProps.layoutMap.getBody(t,e),c=this.getBodyIndexByRow(e),g=this.getBodyIndexByCol(t),f=(o=this.records[c])===null||o===void 0?void 0:o[g];return typeof u=="function"?u(f,t,e,this):f}if(this.dataset){const u=this.internalProps.layoutMap.getCellHeaderPaths(t,e);let c;const g=(s=(r=u.colHeaderPaths)===null||r===void 0?void 0:r.filter(b=>!b.virtual))===null||s===void 0?void 0:s.map((b,C)=>{var _;return b.indicatorKey&&(c={position:"col",index:C}),(_=b.indicatorKey)!==null&&_!==void 0?_:b.value}),f=(a=(l=u.rowHeaderPaths)===null||l===void 0?void 0:l.filter(b=>!b.virtual))===null||a===void 0?void 0:a.map((b,C)=>{var _;return b.indicatorKey&&(c={position:"row",index:C}),(_=b.indicatorKey)!==null&&_!==void 0?_:b.value}),p=this.dataset.getAggregator(f,g,this.internalProps.layoutMap.getIndicatorKey(t,e),!0,c),{fieldFormat:m}=this.internalProps.layoutMap.getBody(t,e);return p.formatValue?p.formatValue(t,e,this):typeof m=="function"?m(p==null?void 0:p.value(),t,e,this):(h=p==null?void 0:p.value())!==null&&h!==void 0?h:""}if(this.flatDataToObjects){const u=this.internalProps.layoutMap.getCellHeaderPaths(t,e),c=u.colHeaderPaths.map(m=>{var b;return(b=m.indicatorKey)!==null&&b!==void 0?b:m.value}),g=u.rowHeaderPaths.map(m=>{var b;return(b=m.indicatorKey)!==null&&b!==void 0?b:m.value}),f=this.flatDataToObjects.getTreeNode(g,c,this.internalProps.layoutMap.getBody(t,e).indicatorKey),{fieldFormat:p}=this.internalProps.layoutMap.getBody(t,e);return typeof p=="function"?p(f==null?void 0:f.value,t,e,this):(d=f==null?void 0:f.value)!==null&&d!==void 0?d:""}}getCellOriginValue(t,e){var n,o,r;const s=this;if(s.internalProps.layoutMap.isHeader(t,e)){const{title:l}=s.internalProps.layoutMap.getHeader(t,e);return typeof l=="function"?l():l}if(this.internalProps.recordsIsTwoDimensionalArray){const l=this.getBodyIndexByRow(e),a=this.getBodyIndexByCol(t);return(n=this.records[l])===null||n===void 0?void 0:n[a]}if(this.dataset){let l;const a=this.internalProps.layoutMap.getCellHeaderPaths(t,e),h=(o=a.colHeaderPaths)===null||o===void 0?void 0:o.filter(c=>!c.virtual).map((c,g)=>{var f;return c.indicatorKey&&(l={position:"col",index:g}),(f=c.indicatorKey)!==null&&f!==void 0?f:c.value}),d=(r=a.rowHeaderPaths)===null||r===void 0?void 0:r.filter(c=>!c.virtual).map((c,g)=>{var f;return c.indicatorKey&&(l={position:"row",index:g}),(f=c.indicatorKey)!==null&&f!==void 0?f:c.value}),u=this.dataset.getAggregator(d,h,this.internalProps.layoutMap.getIndicatorKey(t,e),!0,l);return u.value?u.value():void 0}if(this.flatDataToObjects){const l=this.internalProps.layoutMap.getCellHeaderPaths(t,e),a=l.colHeaderPaths.map(u=>{var c;return(c=u.indicatorKey)!==null&&c!==void 0?c:u.value}),h=l.rowHeaderPaths.map(u=>{var c;return(c=u.indicatorKey)!==null&&c!==void 0?c:u.value}),d=this.flatDataToObjects.getTreeNode(h,a,this.internalProps.layoutMap.getBody(t,e).indicatorKey);return d==null?void 0:d.value}}getCellRawValue(t,e){var n,o,r;const s=this;if(s.internalProps.layoutMap.isHeader(t,e)){const{title:l}=s.internalProps.layoutMap.getHeader(t,e);return typeof l=="function"?l():l}if(this.internalProps.recordsIsTwoDimensionalArray){const l=this.getBodyIndexByRow(e),a=this.getBodyIndexByCol(t);return(n=this.records[l])===null||n===void 0?void 0:n[a]}if(this.dataset){let l;const a=this.internalProps.layoutMap.getCellHeaderPaths(t,e),h=(o=a.colHeaderPaths)===null||o===void 0?void 0:o.filter(c=>!c.virtual).map((c,g)=>{var f;return c.indicatorKey&&(l={position:"col",index:g}),(f=c.indicatorKey)!==null&&f!==void 0?f:c.value}),d=(r=a.rowHeaderPaths)===null||r===void 0?void 0:r.filter(c=>!c.virtual).map((c,g)=>{var f;return c.indicatorKey&&(l={position:"row",index:g}),(f=c.indicatorKey)!==null&&f!==void 0?f:c.value}),u=this.dataset.getAggregator(d,h,this.internalProps.layoutMap.getIndicatorKey(t,e),!1,l);return u.value?u.value():void 0}if(this.flatDataToObjects){const l=this.internalProps.layoutMap.getCellHeaderPaths(t,e),a=l.colHeaderPaths.map(u=>{var c;return(c=u.indicatorKey)!==null&&c!==void 0?c:u.value}),h=l.rowHeaderPaths.map(u=>{var c;return(c=u.indicatorKey)!==null&&c!==void 0?c:u.value}),d=this.flatDataToObjects.getTreeNode(h,a,this.internalProps.layoutMap.getBody(t,e).indicatorKey,!1);return d==null?void 0:d.value}}getCellOriginRecord(t,e){var n,o,r;if(!this.internalProps.layoutMap.isHeader(t,e)){if(this.internalProps.recordsIsTwoDimensionalArray){const s=this.getBodyIndexByRow(e),l=this.getBodyIndexByCol(t);return(n=this.records[s])===null||n===void 0?void 0:n[l]}if(this.dataset){let s;const l=this.internalProps.layoutMap.getCellHeaderPaths(t,e),a=(o=l.colHeaderPaths)===null||o===void 0?void 0:o.filter(d=>!d.virtual).map((d,u)=>{var c;return d.indicatorKey&&(s={position:"col",index:u}),(c=d.indicatorKey)!==null&&c!==void 0?c:d.value}),h=(r=l.rowHeaderPaths)===null||r===void 0?void 0:r.filter(d=>!d.virtual).map((d,u)=>{var c;return d.indicatorKey&&(s={position:"row",index:u}),(c=d.indicatorKey)!==null&&c!==void 0?c:d.value});return this.dataset.getAggregator(h,a,this.internalProps.layoutMap.getIndicatorKey(t,e),!0,s).records}if(this.flatDataToObjects){const s=this.internalProps.layoutMap.getCellHeaderPaths(t,e),l=s.colHeaderPaths.map(d=>{var u;return(u=d.indicatorKey)!==null&&u!==void 0?u:d.value}),a=s.rowHeaderPaths.map(d=>{var u;return(u=d.indicatorKey)!==null&&u!==void 0?u:d.value}),h=this.flatDataToObjects.getTreeNode(a,l,this.internalProps.layoutMap.getBody(t,e).indicatorKey);return h==null?void 0:h.record}}}getCellRawRecord(t,e){var n,o,r;if(!this.internalProps.layoutMap.isHeader(t,e)){if(this.internalProps.recordsIsTwoDimensionalArray){const s=this.getBodyIndexByRow(e),l=this.getBodyIndexByCol(t);return(n=this.records[s])===null||n===void 0?void 0:n[l]}if(this.dataset){let s;const l=this.internalProps.layoutMap.getCellHeaderPaths(t,e),a=(o=l.colHeaderPaths)===null||o===void 0?void 0:o.filter(d=>!d.virtual).map((d,u)=>{var c;return d.indicatorKey&&(s={position:"col",index:u}),(c=d.indicatorKey)!==null&&c!==void 0?c:d.value}),h=(r=l.rowHeaderPaths)===null||r===void 0?void 0:r.filter(d=>!d.virtual).map((d,u)=>{var c;return d.indicatorKey&&(s={position:"row",index:u}),(c=d.indicatorKey)!==null&&c!==void 0?c:d.value});return this.dataset.getAggregator(h,a,this.internalProps.layoutMap.getIndicatorKey(t,e),!1,s).records}if(this.flatDataToObjects){const s=this.internalProps.layoutMap.getCellHeaderPaths(t,e),l=s.colHeaderPaths.map(d=>{var u;return(u=d.indicatorKey)!==null&&u!==void 0?u:d.value}),a=s.rowHeaderPaths.map(d=>{var u;return(u=d.indicatorKey)!==null&&u!==void 0?u:d.value}),h=this.flatDataToObjects.getTreeNode(a,l,this.internalProps.layoutMap.getBody(t,e).indicatorKey,!1);return h==null?void 0:h.record}}}updateSortRules(t,e,n){this.internalProps.dataConfig?this.internalProps.dataConfig.sortRules=t:this.internalProps.dataConfig={sortRules:t},this.dataset.updateSortRules(t),this._changePivotSortStateBySortRules();const{layoutMap:o}=this.internalProps;o.resetHeaderTree(),this.scenegraph.clearCells(),ft(e)&&ft(n)?(this.isRowHeader(e,n)?(this.setMinMaxLimitWidth(!0),this.internalProps._widthResizedColMap.clear()):this.isCornerHeader(e,n)?o.cornerSetting.titleOnDimension==="column"?(this.setMinMaxLimitWidth(!0),this.internalProps._widthResizedColMap.clear()):o.cornerSetting.titleOnDimension==="row"&&this.internalProps._heightResizedRowMap.clear():this.isColumnHeader(e,n)&&this.internalProps._heightResizedRowMap.clear(),this.refreshRowColCount()):this.refreshHeader(),this.internalProps.useOneRowHeightFillAll=!1,this.scenegraph.createSceneGraph(!0),this.render()}_changePivotSortStateBySortRules(){var t,e,n,o;this.pivotSortState=[];const r=(e=(t=this.internalProps.dataConfig)===null||t===void 0?void 0:t.sortRules)!==null&&e!==void 0?e:[];for(let s=0;s<r.length;s++){const l=r[s],a=[];if(l.sortByIndicator&&l.sortField===(this.dataset.indicatorsAsCol?this.dataset.rows[this.dataset.rows.length-1]:this.dataset.columns[this.dataset.columns.length-1])){for(let d=0;d<l.query.length;d++)a.push({dimensionKey:this.dataset.indicatorsAsCol?this.dataset.columns[d]:this.dataset.rows[d],value:l.query[d]});a.push({indicatorKey:l.sortByIndicator,value:(o=(n=this.internalProps.layoutMap.getIndicatorInfo(l.sortByIndicator))===null||n===void 0?void 0:n.title)!==null&&o!==void 0?o:l.sortByIndicator})}else a.push({dimensionKey:l.sortField,isPivotCorner:!0,value:l.sortField});const h=l.sortType?l.sortType.toUpperCase():"ASC";this.pivotSortState.push({dimensions:a,order:gi[h]})}}_parseColumnWidthConfig(t){for(let e=0;e<(t==null?void 0:t.length);e++){const n=t[e],o=n.dimensions,r=n.width,s=this.getCellAddressByHeaderPaths(o);s&&!this.internalProps._widthResizedColMap.has(s.col)&&(this._setColWidth(s.col,r),this.internalProps._widthResizedColMap.add(s.col))}}updatePivotSortState(t){this.pivotSortState=t}sort(t,e,n){var o;let r;if(this.isCornerHeader(t,e)){const a=this.getHeaderDefine(t,e);r=[];const h={isPivotCorner:!0,dimensionKey:a.value,value:a.value};r.push(h)}else r=this.isColumnHeader(t,e)?this.getCellHeaderPaths(t,e).colHeaderPaths:this.getCellHeaderPaths(t,e).rowHeaderPaths;const s=r[r.length-1].indicatorKey,l=this.getHeaderDefine(t,e);if(l.sort){if(this.dataset.sortRules){const a={};for(let h=this.dataset.sortRules.length-1;h>=0;h--){const d=this.dataset.sortRules[h];l.dimensionKey&&d.sortField===l.dimensionKey?(a[d.sortField]=d,this.dataset.sortRules.splice(h,1)):s&&d.sortField===(this.dataset.indicatorsAsCol?this.dataset.rows[this.dataset.rows.length-1]:this.dataset.columns[this.dataset.columns.length-1])&&this.dataset.sortRules.splice(h,1)}s?this.dataset.sortRules.push({sortField:this.dataset.indicatorsAsCol?this.dataset.rows[this.dataset.rows.length-1]:this.dataset.columns[this.dataset.columns.length-1],sortType:gi[n],sortByIndicator:s,query:r.reduce((h,d)=>(d.dimensionKey&&h.push(d.value),h),[])}):this.dataset.sortRules.push(Object.assign((o=a[l.dimensionKey])!==null&&o!==void 0?o:{},{sortField:l.dimensionKey,sortType:gi[n]}))}else this.dataset.sortRules=s?[{sortField:this.dataset.indicatorsAsCol?this.dataset.rows[this.dataset.rows.length-1]:this.dataset.columns[this.dataset.columns.length-1],sortType:gi[n],sortByIndicator:s,query:r.reduce((a,h)=>(h.dimensionKey&&a.push(h.value),a),[])}]:[{sortField:l.dimensionKey,sortType:gi[n]}];this.updateSortRules(this.dataset.sortRules,t,e)}}getPivotSortState(t,e){if(!this.pivotSortState)return;const n=this.getCellRange(t,e);for(let o=0;o<this.pivotSortState.length;o++){const r=this.pivotSortState[o],s=r.dimensions,l=this.getCellAddressByHeaderPaths(s),a=r.order;if(l&&Yi(n,l.col,l.row))return a}}_moveHeaderPosition(t,e){const n=this.getCellRange(t.col,t.row),o=this.getCellRange(e.col,e.row),r=this.internalProps.layoutMap.moveHeaderPosition(t,e);if(r){if(r.moveType==="column"){if(this.internalProps.recordsIsTwoDimensionalArray)for(let s=0;s<this.internalProps.records.length;s++){const l=this.internalProps.records[s].splice(r.sourceIndex-this.rowHeaderLevelCount,r.sourceSize);l.unshift(r.targetIndex-this.rowHeaderLevelCount,0),Array.prototype.splice.apply(this.internalProps.records[s],l)}this.colWidthsMap.exchangeOrder(n.start.col,n.end.col-n.start.col+1,o.start.col,o.end.col-o.start.col+1,r.targetIndex),this.setMinMaxLimitWidth()}else if(r.moveType==="row"){if(this.internalProps.recordsIsTwoDimensionalArray){const s=this.internalProps.records.splice(r.sourceIndex-this.columnHeaderLevelCount,r.sourceSize);s.unshift(r.targetIndex-this.columnHeaderLevelCount,0),Array.prototype.splice.apply(this.internalProps.records,s)}r.targetIndex>r.sourceIndex?this.rowHeightsMap.exchangeOrder(r.sourceIndex,r.sourceSize,r.targetIndex+r.sourceSize-r.targetSize,r.targetSize,r.targetIndex):this.rowHeightsMap.exchangeOrder(r.sourceIndex,r.sourceSize,r.targetIndex,r.targetSize,r.targetIndex)}return r}return null}toggleHierarchyState(t,e,n=!0){const o=this.getHierarchyState(t,e);if(o===Vt.expand)this._refreshHierarchyState(t,e,n),this.fireListeners(rr.TREE_HIERARCHY_STATE_CHANGE,{col:t,row:e,hierarchyState:Vt.collapse});else if(o===Vt.collapse){const r=this.internalProps.layoutMap.getHeadNode(t,e);Array.isArray(r.children)&&this._refreshHierarchyState(t,e,n),this.fireListeners(rr.TREE_HIERARCHY_STATE_CHANGE,{col:t,row:e,hierarchyState:Vt.expand,originData:r})}}_refreshHierarchyState(t,e,n=!0,o){let r=!1,s=!1;this.stateManager.updateHoverIcon(t,e,void 0,void 0);const l=this.internalProps.layoutMap.checkHasChart();l&&(this.autoFillWidth&&(r=this.getAllColsWidth()<=this.tableNoFrameWidth),this.autoFillHeight&&(s=this.getAllRowsHeight()<=this.tableNoFrameHeight));const a=this.internalProps.layoutMap.toggleHierarchyState(t,e);o&&o(),this.refreshRowColCount(),this.clearCellStyleCache(),this.scenegraph.updateHierarchyIcon(t,e),this.scenegraph.updateRow(a.removeCellPositions,a.addCellPositions,a.updateCellPositions,n),l&&(this.autoFillWidth&&!r&&(r=this.getAllColsWidth()<=this.tableNoFrameWidth),this.autoFillHeight&&!s&&(s=this.getAllRowsHeight()<=this.tableNoFrameHeight),(this.widthMode==="adaptive"||r||this.heightMode==="adaptive"||s)&&this.scenegraph.updateChartSizeForResizeColWidth(-1))}getHeaderCellAddressByPath(t){return this.internalProps.layoutMap.getPivotCellAdress(t)}getCellAddressByHeaderPaths(t){return this.internalProps.layoutMap.getCellAdressByHeaderPath(t)}getHeaderPathByXY(t){let e;return e=t?this.getCellAt(t.x+this.getFrozenColsWidth()+this.scrollLeft+1,t.y+this.getFrozenRowsHeight()+this.scrollTop+1):this.getCellAt(this.getFrozenColsWidth()+this.scrollLeft+1,this.getFrozenRowsHeight()+this.scrollTop+1),this.internalProps.layoutMap.getCellHeaderPaths(e.col,e.row)}getHierarchyState(t,e){var n;return(n=this._getHeaderLayoutMap(t,e))===null||n===void 0?void 0:n.hierarchyState}getLayoutColumnTree(){return this.internalProps.layoutMap.getLayoutColumnTree()}getLayoutColumnTreeCount(){return this.internalProps.layoutMap.getLayoutColumnTreeCount()}getLayoutRowTree(){return this.internalProps.layoutMap.getLayoutRowTree()}getLayoutRowTreeCount(){return this.internalProps.layoutMap.getLayoutRowTreeCount()}getCellHeaderTreeNodes(t,e){return this.internalProps.layoutMap.getCellHeaderPathsWithTreeNode(t,e)}_hasHierarchyTreeHeader(){return this.internalProps.layoutMap.rowHierarchyType==="tree"}getMenuInfo(t,e,n){const o=this.internalProps.layoutMap.getPivotDimensionInfo(t,e);return{dimensionKey:o[o.length-1].dimensionKey,value:this.getCellValue(t,e),cellLocation:this.getCellLocation(t,e),isPivotCorner:this.isCornerHeader(t,e),event:void 0}}setRecords(t){var e,n,o,r,s;const l={col:this.stateManager.hover.cellPos.col,row:this.stateManager.hover.cellPos.row};this.options.records=this.internalProps.records=t,this.internalProps.recordsIsTwoDimensionalArray=!1,((e=t==null?void 0:t[0])===null||e===void 0?void 0:e.constructor)===Array&&(this.internalProps.recordsIsTwoDimensionalArray=!0);const a=this.options,h=this.internalProps;if(((n=this.options.customConfig)===null||n===void 0?void 0:n.enableDataAnalysis)===!1)this.internalProps.recordsIsTwoDimensionalArray===!1&&(this.flatDataToObjects=new pv({rows:h.layoutMap.fullRowDimensionKeys,columns:h.layoutMap.colDimensionKeys,indicators:h.layoutMap.indicatorKeys,indicatorsAsCol:h.layoutMap.indicatorsAsCol,indicatorDimensionKey:h.layoutMap.indicatorDimensionKey},t));else{let d,u;this.dataset.setRecords(t),d=a.columnTree?h.layoutMap.columnDimensionTree:new Pe((o=this.dataset.colHeaderTree)!==null&&o!==void 0?o:[],this.layoutNodeId),u=a.rowTree?h.layoutMap.rowDimensionTree:new Pe((r=this.dataset.rowHeaderTree)!==null&&r!==void 0?r:[],this.layoutNodeId,this.options.rowHierarchyType,this.options.rowHierarchyType==="tree"?(s=this.options.rowExpandLevel)!==null&&s!==void 0?s:1:void 0),h.layoutMap=new lr(this,this.dataset,d,u),this.pivotSortState=[],a.pivotSortState&&(this.pivotSortState=a.pivotSortState)}if(this.refreshHeader(),this.internalProps.useOneRowHeightFillAll=!1,this.scenegraph.clearCells(),this.clearCellStyleCache(),this.scenegraph.createSceneGraph(),this.stateManager.updateHoverPos(l.col,l.row),this.internalProps.title&&!this.internalProps.title.isReleased&&(this._updateSize(),this.internalProps.title.resize(),this.scenegraph.resize()),this.eventManager.updateEventBinder(),this.options.emptyTip)if(this.internalProps.emptyTip)this.internalProps.emptyTip.resetVisible();else{const d=Bt.getComponent("emptyTip");this.internalProps.emptyTip=new d(this.options.emptyTip,this),this.internalProps.emptyTip.resetVisible()}}startEditCell(t,e,n){var o;if(z(t)&&z(e))this.eventManager.isDraging=!1,this.selectCell(t,e),this.editorManager.startEditCell(t,e,n);else if(!((o=this.stateManager.select)===null||o===void 0)&&o.cellPos){const{col:r,row:s}=this.stateManager.select.cellPos;z(r)&&z(s)&&this.editorManager.startEditCell(r,s,n)}}completeEditCell(){this.editorManager.completeEdit()}getEditor(t,e){var n,o,r;let s;if(this.isCornerHeader(t,e)){const l=this.getHeaderDefine(t,e);s=(n=l==null?void 0:l.headerEditor)!==null&&n!==void 0?n:this.options.headerEditor}else if(this.isHeader(t,e)){const l=this.getHeaderDefine(t,e);s=(o=l==null?void 0:l.headerEditor)!==null&&o!==void 0?o:this.options.headerEditor}else{const l=this.getBodyColumnDefine(t,e);s=(r=l==null?void 0:l.editor)!==null&&r!==void 0?r:this.options.editor}return typeof s=="function"&&(s=s({col:t,row:e,dataValue:this.getCellOriginValue(t,e),value:this.getCellValue(t,e)||"",table:this})),typeof s=="string"?oT(s):s}isHasEditorDefine(t,e){var n;const o=this.getBodyColumnDefine(t,e);let r=(n=o==null?void 0:o.editor)!==null&&n!==void 0?n:this.options.editor;return typeof r=="function"&&(r=r({col:t,row:e,dataValue:this.getCellOriginValue(t,e),value:this.getCellValue(t,e)||"",table:this})),z(r)}changeCellValue(t,e,n,o=!1){if(o&&this.isHasEditorDefine(t,e)||o===!1){let r=n;const s=this.getCellOriginValue(t,e),l=this.getCellRawValue(t,e);typeof l=="number"&&lm(n)&&(r=parseFloat(n)),this._changeCellValueToDataSet(t,e,s,r);const a=this.getCellRange(t,e);for(let h=a.start.col;h<=a.end.col;h++)for(let d=a.start.row;d<=a.end.row;d++)this.scenegraph.updateCellContent(h,d);if(this.widthMode==="adaptive"||this.autoFillWidth&&this.getAllColsWidth()<=this.tableNoFrameWidth)this.internalProps._widthResizedColMap.size===0&&this.scenegraph.recalculateColWidths();else if(!this.internalProps._widthResizedColMap.has(t)){const h=this.getColWidth(t),d=Fr(t,0,this.rowCount-1,this,!1);d!==h&&this.scenegraph.updateColWidth(t,d-h)}if(this.heightMode==="adaptive"||this.autoFillHeight&&this.getAllRowsHeight()<=this.tableNoFrameHeight)this.internalProps._heightResizedRowMap.size===0&&this.scenegraph.recalculateRowHeights();else if(this.heightMode==="autoHeight"&&!this.internalProps._heightResizedRowMap.has(e)){const h=this.getRowHeight(e),d=nn(e,0,this.colCount-1,this);this.scenegraph.updateRowHeight(e,d-h)}this.fireListeners(at.CHANGE_CELL_VALUE,{col:t,row:e,rawValue:l,currentValue:s,changedValue:r}),this.scenegraph.updateNextFrame()}}changeCellValues(t,e,n,o=!1){let r=t,s=e;const l=[],a=[];for(let u=0;u<n.length&&!(e+u>this.rowCount-1);u++){const c=n[u],g=[],f=[];l.push(g),a.push(f);for(let p=0;p<c.length&&!(t+p>this.colCount-1);p++){const m=this.getCellRawValue(t+p,e+u);g.push(m);const b=this.getCellOriginValue(t+p,e+u);f.push(b)}}for(let u=0;u<n.length&&!(e+u>this.rowCount-1);u++){s=e+u;const c=n[u];let g=t;for(let f=0;f<c.length&&!(t+f>this.colCount-1);f++)if(g=t+f,o&&this.isHasEditorDefine(t+f,e+u)||o===!1){const p=c[f];let m=p;const b=a[u][f],C=l[u][f];typeof C=="number"&&lm(p)&&(m=parseFloat(p)),this._changeCellValueToDataSet(t+f,e+u,b,m),this.fireListeners(at.CHANGE_CELL_VALUE,{col:t+f,row:e+u,rawValue:C,currentValue:b,changedValue:this.getCellOriginValue(t+f,e+u)})}r=Math.max(r,g)}const h=this.getCellRange(t,e),d=this.getCellRange(r,s);for(let u=h.start.col;u<=d.end.col;u++)for(let c=h.start.row;c<=d.end.row;c++)this.scenegraph.updateCellContent(u,c);if(this.widthMode==="adaptive"||this.autoFillWidth&&this.getAllColsWidth()<=this.tableNoFrameWidth)this.internalProps._widthResizedColMap.size===0&&this.scenegraph.recalculateColWidths();else for(let u=t;u<=d.end.col;u++)if(!this.internalProps._widthResizedColMap.has(u)){const c=this.getColWidth(u),g=Fr(u,0,this.rowCount-1,this,!1);g!==c&&this.scenegraph.updateColWidth(u,g-c)}if(this.heightMode==="adaptive"||this.autoFillHeight&&this.getAllRowsHeight()<=this.tableNoFrameHeight)this.scenegraph.recalculateRowHeights();else if(this.heightMode==="autoHeight"){const u=[],c=[];for(let g=e;g<=d.end.row;g++)if(this.rowHeightsMap.get(g)){const f=this.getRowHeight(g),p=nn(g,0,this.colCount-1,this);u.push(g),c.push(p-f)}this.scenegraph.updateRowsHeight(u,c)}this.scenegraph.updateNextFrame()}_changeCellValueToDataSet(t,e,n,o){var r,s,l,a,h,d,u,c;if(this.internalProps.recordsIsTwoDimensionalArray){const g=this.getBodyIndexByRow(e),f=this.getBodyIndexByCol(t);this.records[g][f]=o}else if(this.dataset){const g=this.internalProps.layoutMap.getCellHeaderPaths(t,e);if(this.isCornerHeader(t,e))this.internalProps.layoutMap.changeCornerTitle(t,e,o);else if(this.isHeader(t,e))this.internalProps.layoutMap.changeTreeNodeTitle(t,e,o),!this.isCornerHeader(t,e)&&this.dataset.changeRecordFieldValue(!((r=g.colHeaderPaths)===null||r===void 0)&&r.length?(s=g.colHeaderPaths[g.colHeaderPaths.length-1].indicatorKey)!==null&&s!==void 0?s:g.colHeaderPaths[g.colHeaderPaths.length-1].dimensionKey:(l=g.rowHeaderPaths[g.rowHeaderPaths.length-1].indicatorKey)!==null&&l!==void 0?l:g.rowHeaderPaths[g.rowHeaderPaths.length-1].dimensionKey,n,o);else{const f=(a=g.colHeaderPaths)===null||a===void 0?void 0:a.filter(m=>!m.virtual).map(m=>{var b;return(b=m.indicatorKey)!==null&&b!==void 0?b:m.value}),p=(h=g.rowHeaderPaths)===null||h===void 0?void 0:h.filter(m=>!m.virtual).map(m=>{var b;return(b=m.indicatorKey)!==null&&b!==void 0?b:m.value});this.dataset.changeTreeNodeValue(this.internalProps.layoutMap.indicatorsAsCol?p:p.slice(0,-1),this.internalProps.layoutMap.indicatorsAsCol?f.slice(0,-1):f,this.internalProps.layoutMap.getIndicatorKey(t,e),o)}}else if(this.flatDataToObjects){const g=this.internalProps.layoutMap.getCellHeaderPaths(t,e);if(this.isHeader(t,e))this.internalProps.layoutMap.changeTreeNodeTitle(t,e,o),!this.isCornerHeader(t,e)&&this.flatDataToObjects.changeRecordFieldValue(!((d=g.colHeaderPaths)===null||d===void 0)&&d.length?(u=g.colHeaderPaths[g.colHeaderPaths.length-1].indicatorKey)!==null&&u!==void 0?u:g.colHeaderPaths[g.colHeaderPaths.length-1].dimensionKey:(c=g.rowHeaderPaths[g.rowHeaderPaths.length-1].indicatorKey)!==null&&c!==void 0?c:g.rowHeaderPaths[g.rowHeaderPaths.length-1].dimensionKey,n,o);else{const f=g.colHeaderPaths.map(m=>{var b;return(b=m.indicatorKey)!==null&&b!==void 0?b:m.value}),p=g.rowHeaderPaths.map(m=>{var b;return(b=m.indicatorKey)!==null&&b!==void 0?b:m.value});this.flatDataToObjects.changeTreeNodeValue(p,f,this.internalProps.layoutMap.getBody(t,e).indicatorKey,o)}}}_hasCustomRenderOrLayout(){if(this.options.customRender)return!0;const{columnsDefine:t,rowsDefine:e,indicatorsDefine:n}=this.internalProps.layoutMap;for(let o=0;o<t.length;o++){const r=t[o];if(typeof r!="string"&&(r.headerCustomLayout||r.headerCustomRender))return!0}for(let o=0;o<e.length;o++){const r=e[o];if(typeof r!="string"&&(r.headerCustomLayout||r.headerCustomRender))return!0}for(let o=0;o<n.length;o++){const r=n[o];if(typeof r!="string"&&(r.customLayout||r.headerCustomLayout||r.customRender||r.headerCustomRender))return!0}return!1}changeRecordOrder(t,e){}setTreeNodeChildren(t,e,n,o){this.flatDataToObjects?(this.internalProps.layoutMap.getHeadNode(n,o).children=t,this._refreshHierarchyState(n,o,!0,()=>{this.flatDataToObjects.changeDataConfig({rows:this.internalProps.layoutMap.fullRowDimensionKeys,columns:this.internalProps.layoutMap.colDimensionKeys,indicators:this.internalProps.layoutMap.indicatorKeys,indicatorsAsCol:this.internalProps.layoutMap.indicatorsAsCol,indicatorDimensionKey:this.internalProps.layoutMap.indicatorDimensionKey}),this.flatDataToObjects.addRecords(e)})):(this.internalProps.layoutMap.getHeadNode(n,o).children=t,this._refreshHierarchyState(n,o,!0,()=>{this.dataset._rowTreeHasChanged(),this.dataset.changeDataConfig({rows:this.internalProps.layoutMap.fullRowDimensionKeys,columns:this.internalProps.layoutMap.colDimensionKeys}),this.dataset.addRecords(e)}))}updateFilterRules(t){this.internalProps.dataConfig.filterRules=t,this.dataset.updateFilterRules(t),this.renderWithRecreateCells()}getFilteredRecords(){var t;return(t=this.dataset)===null||t===void 0?void 0:t.filterRules}};Mg(),Bg(),Pg(),Hg(),Eg(),Lg(),kg(),Fg(),Ig(),Dg(),Og(),zg(),Il(),Wg();class BT extends MT{}Il();class W9 extends MT{}Mg(),Bg(),Pg(),Hg(),Eg(),Lg(),kg(),Fg(),Ig(),Dg(),Og(),zg(),Il(),Wg();let N9=class extends Cg{constructor(t,e){var n,o,r,s,l,a,h,d,u,c,g,f,p,m,b,C,_,w;let y,S;oe.mode==="node"?(e=t,t=null):t instanceof HTMLElement||(e=t,t=t.container?t.container:null),super(t,e),this.layoutNodeId={seqId:0},this._selectedDataItemsInChart=[],this._selectedDimensionInChart=[],this._chartEventMap={},e.layout&&Object.assign(e,e.layout),this.internalProps.columns=Ee(e.columns),this.internalProps.rows=Ee(e.rows),this.internalProps.indicators=ho(e.indicators),this.internalProps.columnTree=!e.indicatorsAsCol||!((n=e.columns)===null||n===void 0)&&n.length||e.columnTree?Ee(e.columnTree):[],this.internalProps.rowTree=e.indicatorsAsCol||!((o=e.rows)===null||o===void 0)&&o.length||e.rowTree?Ee(e.rowTree):[],this.internalProps.records=e.records,this.setCustomStateNameToSpec(),this.internalProps.columnResizeType=(r=e.columnResizeType)!==null&&r!==void 0?r:"column",this.internalProps.rowResizeType=(s=e.rowResizeType)!==null&&s!==void 0?s:"row",this.internalProps.dataConfig={isPivotChart:!0},this._axes=lt(e.axes)?e.axes:[],e.columnTree&&(e.indicatorsAsCol!==!1&&(this.internalProps.columnTree=Vi(this.internalProps.columnTree,e.indicators)),y=new Pe((l=this.internalProps.columnTree)!==null&&l!==void 0?l:[],this.layoutNodeId)),e.rowTree&&(e.indicatorsAsCol===!1&&(this.internalProps.rowTree=Vi(this.internalProps.rowTree,e.indicators)),S=new Pe((a=this.internalProps.rowTree)!==null&&a!==void 0?a:[],this.layoutNodeId));const A=!((h=S==null?void 0:S.dimensionKeys)===null||h===void 0)&&h.count?S.dimensionKeys.valueArr():(u=(d=e.rows)===null||d===void 0?void 0:d.reduce((T,M)=>(typeof M=="string"?T.push(M):T.push(M.dimensionKey),T),[]))!==null&&u!==void 0?u:[],R=!((c=y==null?void 0:y.dimensionKeys)===null||c===void 0)&&c.count?y.dimensionKeys.valueArr():(f=(g=e.columns)===null||g===void 0?void 0:g.reduce((T,M)=>(typeof M=="string"?T.push(M):T.push(M.dimensionKey),T),[]))!==null&&f!==void 0?f:[],x=(m=(p=e.indicators)===null||p===void 0?void 0:p.reduce((T,M)=>(typeof M=="string"?T.push(M):T.push(M.indicatorKey),T),[]))!==null&&m!==void 0?m:[];if(this.internalProps.dataConfig.collectValuesBy=this._generateCollectValuesConfig(R,A),this.internalProps.dataConfig.aggregationRules=this._generateAggregationRules(),this.internalProps.dataConfig.dimensionSortArray=this._getDimensionSortArray(),this.dataset=new Ih(this.internalProps.dataConfig,A,R,x,this.internalProps.indicators,(b=e.indicatorsAsCol)===null||b===void 0||b,e.records,void 0,this.internalProps.columnTree,this.internalProps.rowTree,!0),this.options.indicatorsAsCol&&Lh(this.internalProps.indicators)){const T=M=>{M.forEach(B=>{var P;!((P=B.children)===null||P===void 0)&&P.length?T(B.children):B.children=[{dimensionKey:"axis",value:""}]})};!((C=this.dataset.rowHeaderTree)===null||C===void 0)&&C.length?T(this.dataset.rowHeaderTree):this.dataset.rowHeaderTree=[{dimensionKey:"axis",value:""}]}if(e.columnTree||e.indicatorsAsCol!==!1&&(this.dataset.colHeaderTree=Vi(this.dataset.colHeaderTree,e.indicators)),e.rowTree||e.indicatorsAsCol===!1&&(this.dataset.rowHeaderTree=Vi(this.dataset.rowHeaderTree,e.indicators)),y=new Pe((_=this.dataset.colHeaderTree)!==null&&_!==void 0?_:[],this.layoutNodeId),S=new Pe((w=this.dataset.rowHeaderTree)!==null&&w!==void 0?w:[],this.layoutNodeId),this.internalProps.layoutMap=new lr(this,this.dataset,y,S),this.refreshHeader(),this.internalProps.useOneRowHeightFillAll=!1,this.scenegraph.createSceneGraph(),e.title){const T=Bt.getComponent("title");this.internalProps.title=new T(e.title,this),this.scenegraph.resize()}if(this.options.emptyTip)if(this.internalProps.emptyTip)this.internalProps.emptyTip.resetVisible();else{const T=Bt.getComponent("emptyTip");this.internalProps.emptyTip=new T(this.options.emptyTip,this),this.internalProps.emptyTip.resetVisible()}setTimeout(()=>{this.fireListeners(at.INITIALIZED,null)},0)}static get EVENT_TYPE(){return SA}get pivotChartAxes(){return this._axes}get recordsCount(){var t;return(t=this.records)===null||t===void 0?void 0:t.length}isListTable(){return!1}isPivotTable(){return!0}isPivotChart(){return!0}_canResizeColumn(t,e){const n=super._canResizeColumn(t,e);if(n&&!this.internalProps.layoutMap.indicatorsAsCol){const o=this.internalProps.layoutMap.getBody(t,this.columnHeaderLevelCount);if(o!=null&&o.disableColumnResize)return!1}return n}updateOption(t){var e,n,o,r,s,l,a,h,d,u,c,g,f,p,m,b,C,_,w,y;const S=this.internalProps;let A,R;super.updateOption(t),this.layoutNodeId={seqId:0},this.internalProps.columns=Ee(t.columns),this.internalProps.rows=Ee(t.rows),this.internalProps.indicators=!((e=t.indicators)===null||e===void 0)&&e.length?ho(t.indicators):[],this.internalProps.columnTree=!t.indicatorsAsCol||!((n=t.columns)===null||n===void 0)&&n.length||t.columnTree?Ee(t.columnTree):[],this.internalProps.rowTree=t.indicatorsAsCol||!((o=t.rows)===null||o===void 0)&&o.length||t.rowTree?Ee(t.rowTree):[],t.records&&(this.internalProps.records=t.records),this.setCustomStateNameToSpec(),this._selectedDataItemsInChart=[],S.columnResizeType=(r=t.columnResizeType)!==null&&r!==void 0?r:"column",S.rowResizeType=(s=t.rowResizeType)!==null&&s!==void 0?s:"row",S.dataConfig={isPivotChart:!0},this._axes=lt(t.axes)?t.axes:[],t.columnTree&&(t.indicatorsAsCol!==!1&&(this.internalProps.columnTree=Vi(this.internalProps.columnTree,t.indicators)),A=new Pe((l=this.internalProps.columnTree)!==null&&l!==void 0?l:[],this.layoutNodeId)),t.rowTree&&(t.indicatorsAsCol===!1&&(this.internalProps.rowTree=Vi(this.internalProps.rowTree,t.indicators)),R=new Pe((a=this.internalProps.rowTree)!==null&&a!==void 0?a:[],this.layoutNodeId));const x=!((h=R==null?void 0:R.dimensionKeys)===null||h===void 0)&&h.count?R.dimensionKeys.valueArr():(u=(d=t.rows)===null||d===void 0?void 0:d.reduce((B,P)=>(typeof P=="string"?B.push(P):B.push(P.dimensionKey),B),[]))!==null&&u!==void 0?u:[],T=!((c=A==null?void 0:A.dimensionKeys)===null||c===void 0)&&c.count?A.dimensionKeys.valueArr():(f=(g=t.columns)===null||g===void 0?void 0:g.reduce((B,P)=>(typeof P=="string"?B.push(P):B.push(P.dimensionKey),B),[]))!==null&&f!==void 0?f:[],M=(m=(p=t.indicators)===null||p===void 0?void 0:p.reduce((B,P)=>(typeof P=="string"?B.push(P):B.push(P.indicatorKey),B),[]))!==null&&m!==void 0?m:[];if(this.internalProps.dataConfig.collectValuesBy=this._generateCollectValuesConfig(T,x),this.internalProps.dataConfig.aggregationRules=this._generateAggregationRules(),this.internalProps.dataConfig.dimensionSortArray=this._getDimensionSortArray(),this.dataset=new Ih(this.internalProps.dataConfig,x,T,M,this.internalProps.indicators,(b=t.indicatorsAsCol)===null||b===void 0||b,(C=t.records)!==null&&C!==void 0?C:this.internalProps.records,void 0,this.internalProps.columnTree,this.internalProps.rowTree,!0),this.options.indicatorsAsCol&&Lh(this.internalProps.indicators)){const B=P=>{P.forEach(F=>{var H;!((H=F.children)===null||H===void 0)&&H.length?B(F.children):F.children=[{dimensionKey:"axis",value:""}]})};!((_=this.dataset.rowHeaderTree)===null||_===void 0)&&_.length?B(this.dataset.rowHeaderTree):this.dataset.rowHeaderTree=[{dimensionKey:"axis",value:""}]}if(t.columnTree||t.indicatorsAsCol!==!1&&(this.dataset.colHeaderTree=Vi(this.dataset.colHeaderTree,t.indicators)),t.rowTree||t.indicatorsAsCol===!1&&(this.dataset.rowHeaderTree=Vi(this.dataset.rowHeaderTree,t.indicators)),A=new Pe((w=this.dataset.colHeaderTree)!==null&&w!==void 0?w:[],this.layoutNodeId),R=new Pe((y=this.dataset.rowHeaderTree)!==null&&y!==void 0?y:[],this.layoutNodeId),S.layoutMap=new lr(this,this.dataset,A,R),this.refreshHeader(),this.internalProps.useOneRowHeightFillAll=!1,S.releaseList&&(S.releaseList.forEach(B=>{var P;return(P=B==null?void 0:B.release)===null||P===void 0?void 0:P.call(B)}),S.releaseList=null),this.scenegraph.clearCells(),this.scenegraph.createSceneGraph(),t.title){const B=Bt.getComponent("title");this.internalProps.title=new B(t.title,this),this.scenegraph.resize()}if(this.options.emptyTip)if(this.internalProps.emptyTip)this.internalProps.emptyTip.resetVisible();else{const B=Bt.getComponent("emptyTip");this.internalProps.emptyTip=new B(this.options.emptyTip,this),this.internalProps.emptyTip.resetVisible()}return new Promise(B=>{setTimeout(B,0)})}updatePagination(){}refreshHeader(){this.setMinMaxLimitWidth(!0),this.refreshRowColCount()}refreshRowColCount(){var t,e,n,o,r,s,l,a;const h=this,{layoutMap:d}=h.internalProps;d&&(h.colCount=(t=d.colCount)!==null&&t!==void 0?t:0,h.rowCount=(e=d.rowCount)!==null&&e!==void 0?e:0,h.internalProps.frozenColCount=(n=d.rowHeaderLevelCount)!==null&&n!==void 0?n:0,h.frozenRowCount=Math.max(d.headerLevelCount,(o=this.options.frozenRowCount)!==null&&o!==void 0?o:0),h.bottomFrozenRowCount!==((r=d==null?void 0:d.bottomFrozenRowCount)!==null&&r!==void 0?r:0)&&(h.bottomFrozenRowCount=(s=d==null?void 0:d.bottomFrozenRowCount)!==null&&s!==void 0?s:0),h.rightFrozenColCount!==((l=d==null?void 0:d.rightFrozenColCount)!==null&&l!==void 0?l:0)&&(h.rightFrozenColCount=(a=d==null?void 0:d.rightFrozenColCount)!==null&&a!==void 0?a:0),this.stateManager.setFrozenCol(this.internalProps.frozenColCount))}_getSortFuncFromHeaderOption(t,e,n){}syncHierarchyState(t,e){var n,o;t.value===e.value&&t.dimensionKey===e.dimensionKey&&(e.hierarchyState=(n=e.hierarchyState)!==null&&n!==void 0?n:e!=null&&e.children?t.hierarchyState:void 0,(o=e==null?void 0:e.children)===null||o===void 0||o.forEach((r,s)=>{var l;!((l=t==null?void 0:t.children)===null||l===void 0)&&l[s]&&r&&this.syncHierarchyState(t.children[s],r)}))}getRecordShowIndexByCell(t,e){}getTableIndexByRecordIndex(t){}getTableIndexByField(t){}getCellAddrByFieldRecord(t,e){}getBodyIndexByRow(t){const{layoutMap:e}=this.internalProps;return e.getBodyIndexByRow(t)}getBodyIndexByCol(t){const{layoutMap:e}=this.internalProps;return e.getBodyIndexByCol(t)}getCellValue(t,e,n){var o,r,s;if(!n){const u=this.getCustomMergeValue(t,e);if(u)return u}if(this.internalProps.layoutMap.isHeader(t,e)){if(this.internalProps.layoutMap.isBottomFrozenRow(t,e)||this.internalProps.layoutMap.isRightFrozenColumn(t,e)){const g=this.internalProps.layoutMap.getIndicatorKeyInChartSpec(t,e);let f;return g==null||g.forEach(p=>{const m=this.internalProps.layoutMap.getIndicatorInfo(p);m&&(f=m)}),(r=(o=f==null?void 0:f.title)!==null&&o!==void 0?o:f==null?void 0:f.indicatorKey)!==null&&r!==void 0?r:""}const{title:u,fieldFormat:c}=this.internalProps.layoutMap.getHeader(t,e);return typeof c=="function"?c(u,t,e,this):u}if(this.dataset){let u;const c=this.internalProps.layoutMap.getCellHeaderPaths(t,e),g=c.colHeaderPaths.map((m,b)=>{var C;return m.indicatorKey&&(u={position:"col",index:b}),(C=m.indicatorKey)!==null&&C!==void 0?C:m.value}),f=c.rowHeaderPaths.map((m,b)=>{var C;return m.indicatorKey&&(u={position:"row",index:b}),(C=m.indicatorKey)!==null&&C!==void 0?C:m.value}),p=this.dataset.getAggregator(f,g,this.internalProps.layoutMap.getIndicatorKey(t,e),!0,u);return p.value?p.value():void 0}const{fieldFormat:l}=this.internalProps.layoutMap.getBody(t,e),a=this.getBodyIndexByRow(e),h=this.getBodyIndexByCol(t),d=(s=this.records[a])===null||s===void 0?void 0:s[h];return typeof l=="function"?l(d,t,e,this):d}getCellOriginValue(t,e){var n,o,r;const s=this;if(s.internalProps.layoutMap.isHeader(t,e)){if(this.internalProps.layoutMap.isBottomFrozenRow(t,e)||this.internalProps.layoutMap.isRightFrozenColumn(t,e)){const d=this.internalProps.layoutMap.getIndicatorKeyInChartSpec(t,e);let u;return d==null||d.forEach(c=>{const g=this.internalProps.layoutMap.getIndicatorInfo(c);g&&(u=g)}),(o=(n=u==null?void 0:u.title)!==null&&n!==void 0?n:u==null?void 0:u.indicatorKey)!==null&&o!==void 0?o:""}const{title:h}=s.internalProps.layoutMap.getHeader(t,e);return typeof h=="function"?h():h}if(this.dataset){let h;const d=this.internalProps.layoutMap.getCellHeaderPaths(t,e),u=d.colHeaderPaths.map((f,p)=>{var m;return f.indicatorKey&&(h={position:"col",index:p}),(m=f.indicatorKey)!==null&&m!==void 0?m:f.value}),c=d.rowHeaderPaths.map((f,p)=>{var m;return f.indicatorKey&&(h={position:"row",index:p}),(m=f.indicatorKey)!==null&&m!==void 0?m:f.value}),g=this.dataset.getAggregator(c,u,this.internalProps.layoutMap.getIndicatorKey(t,e),!0,h);return g.value?g.value():void 0}const l=this.getBodyIndexByRow(e),a=this.getBodyIndexByCol(t);return(r=this.records[l])===null||r===void 0?void 0:r[a]}getCellRawValue(t,e){return this.getCellOriginValue(t,e)}getCellOriginRecord(t,e){if(!this.internalProps.layoutMap.isHeader(t,e)&&this.dataset){let n;const o=this.internalProps.layoutMap.getCellHeaderPaths(t,e),r=o.colHeaderPaths.map((l,a)=>{var h;return l.indicatorKey&&(n={position:"col",index:a}),(h=l.indicatorKey)!==null&&h!==void 0?h:l.value}),s=o.rowHeaderPaths.map((l,a)=>{var h;return l.indicatorKey&&(n={position:"row",index:a}),(h=l.indicatorKey)!==null&&h!==void 0?h:l.value});return this.dataset.getAggregator(s,r,this.internalProps.layoutMap.getIndicatorKey(t,e),!0,n).records}}getCellRawRecord(t,e){return this.getCellOriginRecord(t,e)}getPivotSortState(t,e){if(!this.pivotSortState)return;const n=this.getCellRange(t,e);for(let o=0;o<this.pivotSortState.length;o++){const{col:r,row:s,order:l}=this.pivotSortState[o];if(Yi(n,r,s))return l}}_moveHeaderPosition(t,e){var n,o,r,s;const l=this.internalProps.layoutMap.moveHeaderPosition(t,e);if(l){if(l.moveType==="column"){if(((o=(n=this.options.records)===null||n===void 0?void 0:n[0])===null||o===void 0?void 0:o.constructor)===Array)for(let a=0;a<this.internalProps.records.length;a++){const h=this.internalProps.records[a].splice(l.sourceIndex-this.rowHeaderLevelCount,l.sourceSize);h.unshift(l.targetIndex-this.rowHeaderLevelCount,0),Array.prototype.splice.apply(this.internalProps.records[a],h)}this.colWidthsMap.adjustOrder(l.sourceIndex,l.targetIndex,l.sourceSize),this.setMinMaxLimitWidth()}else if(l.moveType==="row"){if(((s=(r=this.options.records)===null||r===void 0?void 0:r[0])===null||s===void 0?void 0:s.constructor)===Array){const a=this.internalProps.records.splice(l.sourceIndex-this.columnHeaderLevelCount,l.sourceSize);a.unshift(l.targetIndex-this.columnHeaderLevelCount,0),Array.prototype.splice.apply(this.internalProps.records,a)}this.rowHeightsMap.adjustOrder(l.sourceIndex,l.targetIndex,l.sourceSize)}return l}return null}toggleHierarchyState(t,e,n=!0){}getHeaderCellAddressByPath(t){return this.internalProps.layoutMap.getPivotCellAdress(t)}getCellAddressByHeaderPaths(t){return this.internalProps.layoutMap.getCellAdressByHeaderPath(t)}getHeaderPathByXY(t){let e;return e=t?this.getCellAt(t.x+this.getFrozenColsWidth()+this.scrollLeft+1,t.y+this.getFrozenRowsHeight()+this.scrollTop+1):this.getCellAt(this.getFrozenColsWidth()+this.scrollLeft+1,this.getFrozenRowsHeight()+this.scrollTop+1),this.internalProps.layoutMap.getCellHeaderPaths(e.col,e.row)}getHierarchyState(t,e){var n;return(n=this._getHeaderLayoutMap(t,e))===null||n===void 0?void 0:n.hierarchyState}_hasHierarchyTreeHeader(){return this.internalProps.layoutMap.rowHierarchyType==="tree"}getMenuInfo(t,e,n){const o=this.internalProps.layoutMap.getPivotDimensionInfo(t,e);return{dimensionKey:o[o.length-1].dimensionKey,value:this.getCellValue(t,e),cellLocation:this.getCellLocation(t,e),isPivotCorner:this.isCornerHeader(t,e),event:void 0}}_generateCollectValuesConfig(t,e){var n,o,r,s,l,a,h,d,u,c,g,f,p,m,b,C,_;t=t.filter(S=>S!==Xi),e=e.filter(S=>S!==Xi);const w=this.internalProps.indicators,y={};for(let S=0,A=w==null?void 0:w.length;S<A;S++)if(typeof w[S]!="string"&&w[S].chartSpec){if(((n=w[S].chartSpec)===null||n===void 0?void 0:n.type)==="pie"||((o=w[S].chartSpec)===null||o===void 0?void 0:o.type)==="rose"||((r=w[S].chartSpec)===null||r===void 0?void 0:r.type)==="radar"||((s=w[S].chartSpec)===null||s===void 0?void 0:s.type)==="gauge"||((l=w[S].chartSpec)===null||l===void 0?void 0:l.type)==="wordCloud")continue;const R=w[S],x=R.chartSpec;if(this.options.indicatorsAsCol===!1)if((x==null?void 0:x.stack)!==!1&&((x==null?void 0:x.type)==="bar"||(x==null?void 0:x.type)==="area")&&(x.stack=!0),y[R.indicatorKey]={by:e,range:!0,sumBy:(x==null?void 0:x.stack)&&t.concat(x==null?void 0:x.xField)},x.series)x.series.forEach(T=>{var M,B,P,F,H,E,k,I,L,D,O,N,W,$;const U=typeof T.xField=="string"?T.xField:T.xField[0];y[U]={by:t,type:T.direction!=="horizontal"?"xField":void 0,range:As(T,this._axes,T.direction==="horizontal",!0),sortBy:T.direction!=="horizontal"?(F=(P=(B=(M=T==null?void 0:T.data)===null||M===void 0?void 0:M.fields)===null||B===void 0?void 0:B[U])===null||P===void 0?void 0:P.domain)!==null&&F!==void 0?F:(k=(E=(H=x==null?void 0:x.data)===null||H===void 0?void 0:H.fields)===null||E===void 0?void 0:E[U])===null||k===void 0?void 0:k.domain:void 0};const Y=T.yField;T.stack!==!1&&(T.type==="bar"||T.type==="area")&&(T.stack=!0),y[Y]={by:e,range:As(T,this._axes,T.direction==="horizontal",!1),sumBy:T.stack&&t.concat(T==null?void 0:T.xField),sortBy:T.direction==="horizontal"?(O=(D=(L=(I=T==null?void 0:T.data)===null||I===void 0?void 0:I.fields)===null||L===void 0?void 0:L[Y])===null||D===void 0?void 0:D.domain)!==null&&O!==void 0?O:($=(W=(N=x==null?void 0:x.data)===null||N===void 0?void 0:N.fields)===null||W===void 0?void 0:W[Y])===null||$===void 0?void 0:$.domain:void 0,extendRange:Ac(x.markLine)}});else{const T=typeof x.xField=="string"?x.xField:x.xField[0];y[T]={by:t,type:x.direction!=="horizontal"?"xField":void 0,range:As(x,this._axes,x.direction==="horizontal",!0),sortBy:x.direction!=="horizontal"?(d=(h=(a=x==null?void 0:x.data)===null||a===void 0?void 0:a.fields)===null||h===void 0?void 0:h[T])===null||d===void 0?void 0:d.domain:void 0},(x==null?void 0:x.stack)!==!1&&((x==null?void 0:x.type)==="bar"||(x==null?void 0:x.type)==="area")&&(x.stack=!0);const M=x.yField;y[M]={by:e,range:x.direction!=="horizontal",sumBy:x.stack&&t.concat(x==null?void 0:x.xField),sortBy:x.direction==="horizontal"?(g=(c=(u=x==null?void 0:x.data)===null||u===void 0?void 0:u.fields)===null||c===void 0?void 0:c[M])===null||g===void 0?void 0:g.domain:void 0,extendRange:Ac(x.markLine)}}else{const T=w[S];if((x==null?void 0:x.stack)!==!1&&((x==null?void 0:x.type)==="bar"||(x==null?void 0:x.type)==="area")&&(x.stack=!0),y[T.indicatorKey]={by:t,range:!0,sumBy:(x==null?void 0:x.stack)&&e.concat(x==null?void 0:x.yField)},x.series)x.series.forEach(M=>{var B,P,F,H,E,k,I,L,D,O,N,W,$,U;const Y=typeof M.yField=="string"?M.yField:M.yField[0];y[Y]={by:e,type:M.direction==="horizontal"?"yField":void 0,range:As(M,this._axes,M.direction==="horizontal",!1),sortBy:M.direction==="horizontal"?(H=(F=(P=(B=M==null?void 0:M.data)===null||B===void 0?void 0:B.fields)===null||P===void 0?void 0:P[Y])===null||F===void 0?void 0:F.domain)!==null&&H!==void 0?H:(I=(k=(E=x==null?void 0:x.data)===null||E===void 0?void 0:E.fields)===null||k===void 0?void 0:k[Y])===null||I===void 0?void 0:I.domain:void 0};const j=M.xField;M.stack!==!1&&(M.type==="bar"||M.type==="area")&&(M.stack=!0),y[j]={by:t,range:As(M,this._axes,M.direction==="horizontal",!0),sumBy:M.stack&&e.concat(M==null?void 0:M.yField),sortBy:M.direction!=="horizontal"?(N=(O=(D=(L=M==null?void 0:M.data)===null||L===void 0?void 0:L.fields)===null||D===void 0?void 0:D[j])===null||O===void 0?void 0:O.domain)!==null&&N!==void 0?N:(U=($=(W=x==null?void 0:x.data)===null||W===void 0?void 0:W.fields)===null||$===void 0?void 0:$[j])===null||U===void 0?void 0:U.domain:void 0,extendRange:Ac(x.markLine)}});else{const M=typeof x.yField=="string"?x.yField:x.yField[0];y[M]={by:e,type:x.direction==="horizontal"?"yField":void 0,range:As(x,this._axes,x.direction==="horizontal",!1),sortBy:x.direction==="horizontal"?(m=(p=(f=x==null?void 0:x.data)===null||f===void 0?void 0:f.fields)===null||p===void 0?void 0:p[M])===null||m===void 0?void 0:m.domain:void 0},(x==null?void 0:x.stack)!==!1&&((x==null?void 0:x.type)==="bar"||(x==null?void 0:x.type)==="area")&&(x.stack=!0);const B=x.xField;y[B]={by:t,range:As(x,this._axes,x.direction==="horizontal",!0),sumBy:x.stack&&e.concat(x==null?void 0:x.yField),sortBy:x.direction!=="horizontal"?(_=(C=(b=x==null?void 0:x.data)===null||b===void 0?void 0:b.fields)===null||C===void 0?void 0:C[B])===null||_===void 0?void 0:_.domain:void 0,extendRange:Ac(x.markLine)}}}}return y}_generateAggregationRules(){var t;const e=[];return(t=this.internalProps.indicators)===null||t===void 0||t.forEach(n=>{var o,r;if(typeof n=="string")e.push({indicatorKey:n,field:n,aggregationType:zt.RECORD});else if(!((o=n.chartSpec)===null||o===void 0)&&o.series){const s=[];(r=n.chartSpec)===null||r===void 0||r.series.forEach(l=>{const a=this.options.indicatorsAsCol===!1?l.yField:l.xField;s.indexOf(a)===-1&&s.push(a)}),e.push({indicatorKey:n.indicatorKey,field:s,aggregationType:zt.RECORD})}else{const s=this.options.indicatorsAsCol===!1?n.chartSpec.yField:n.chartSpec.xField;e.push({indicatorKey:n.indicatorKey,field:s??n.indicatorKey,aggregationType:zt.RECORD})}}),e}setCustomStateNameToSpec(){var t;const e=n=>{var o,r,s,l,a,h,d,u,c,g;!((r=(o=n.bar)===null||o===void 0?void 0:o.state)===null||r===void 0)&&r.selected&&(n.bar.state.vtable_selected=n.bar.state.selected,n.bar.state.vtable_selected_reverse=n.bar.state.selected_reverse,delete n.bar.state.selected,delete n.bar.state.selected_reverse),!((l=(s=n.point)===null||s===void 0?void 0:s.state)===null||l===void 0)&&l.selected&&(n.point.state.vtable_selected=n.point.state.selected,n.point.state.vtable_selected_reverse=n.point.state.selected_reverse,delete n.point.state.selected,delete n.point.state.selected_reverse),!((h=(a=n.line)===null||a===void 0?void 0:a.state)===null||h===void 0)&&h.selected&&(n.line.state.vtable_selected=n.line.state.selected,n.line.state.vtable_selected_reverse=n.line.state.selected_reverse,delete n.line.state.selected,delete n.line.state.selected_reverse),!((u=(d=n.area)===null||d===void 0?void 0:d.state)===null||u===void 0)&&u.selected&&(n.area.state.vtable_selected=n.area.state.selected,n.area.state.vtable_selected_reverse=n.area.state.selected_reverse,delete n.area.state.selected,delete n.area.state.selected_reverse),!((g=(c=n.pie)===null||c===void 0?void 0:c.state)===null||g===void 0)&&g.selected&&(n.pie.state.vtable_selected=n.pie.state.selected,n.pie.state.vtable_selected_reverse=n.pie.state.selected_reverse,delete n.pie.state.selected,delete n.pie.state.selected_reverse)};(t=this.internalProps.indicators)===null||t===void 0||t.forEach(n=>{if(n.chartSpec){const o=n.chartSpec;o.series?o.series.forEach(r=>{e(r)}):e(o)}})}updateFilterRules(t){this.internalProps.dataConfig.filterRules=t,this.dataset.updateFilterRules(t),Th(this.scenegraph),P5(this.scenegraph),this.render()}clearChartCacheImage(t,e){ft(t)&&ft(e)?B5(t,e,this.scenegraph):Th(this.scenegraph)}getLegendSelected(){var t;const e=[];return(t=this.internalProps.legends)===null||t===void 0||t.forEach(n=>{const o=n.legendComponent._getSelectedLegends().map(r=>r.label);e.push(...o)}),e}setLegendSelected(t){var e;(e=this.internalProps.legends)===null||e===void 0||e.forEach(n=>{n.legendComponent.setSelected(t)})}getChartDatumPosition(t,e){const{chartInstance:n,bounds:o}=this.getChartInstance(e);if(n){const r=n.convertDatumToPosition(t);return r?{x:Math.round(r.x+o.x1),y:Math.round(r.y+o.y1)}:null}return null}getCellAddressByRecord(t){const e=[],n=[],o={},r=[];this.dataset.dataConfig.aggregationRules.forEach(s=>{if(typeof s.field=="string")o[s.field]=s.indicatorKey,r.push(s.field);else for(let l=0;l<s.field.length;l++)o[s.field[l]]=s.indicatorKey,r.push(s.field[l])});for(const s in t)this.dataset.rows.indexOf(s)>=0&&e.push({dimensionKey:s,value:t[s]}),this.dataset.columns.indexOf(s)>=0&&n.push({dimensionKey:s,value:t[s]}),r.indexOf(s)>=0&&(this.dataset.indicatorsAsCol?n.push({indicatorKey:o[s]}):e.push({indicatorKey:o[s]}));return this.getCellAddressByHeaderPaths({rowHeaderPaths:e,colHeaderPaths:n,cellLocation:"body"})}getChartInstance(t){var e,n,o,r,s;const l=this.getCellAddressByHeaderPaths(t);if(l){const a=this.getCellRelativeRect(l.col,l.row),h=this.scenegraph.getCell(l.col,l.row);let d;const u=(e=h==null?void 0:h.getChildren())===null||e===void 0?void 0:e[0];if(u.attribute.chartInstance){d=u.attribute.chartInstance;const{dataId:c,data:g,axes:f,spec:p}=u.attribute,m=u.getViewBox();if(f==null||f.forEach((b,C)=>{var _,w,y,S;b.type==="linear"?d.updateModelSpecSync({type:"axes",index:C},{min:(w=(_=b.range)===null||_===void 0?void 0:_.min)!==null&&w!==void 0?w:0,max:(S=(y=b.range)===null||y===void 0?void 0:y.max)!==null&&S!==void 0?S:0},!0):b.type==="band"&&d.updateModelSpec({type:"axes",index:C},{domain:b.domain.slice(0)},!0)}),d.updateViewBox({x1:m.x1-u.getRootNode().table.scrollLeft,x2:m.x2-u.getRootNode().table.scrollLeft,y1:m.y1-u.getRootNode().table.scrollTop,y2:m.y2-u.getRootNode().table.scrollTop},!1,!1),typeof c=="string")d.updateDataSync(c,g??[]);else{const b=[];for(const C in c){const _=c[C],w=p.series.find(y=>{var S;return((S=y==null?void 0:y.data)===null||S===void 0?void 0:S.id)===C});b.push({id:C,values:_?(n=g==null?void 0:g.filter(y=>y.hasOwnProperty(_)))!==null&&n!==void 0?n:[]:g??[],fields:(o=w==null?void 0:w.data)===null||o===void 0?void 0:o.fields}),d.updateFullDataSync||d.updateDataSync(C,_?(r=g==null?void 0:g.filter(y=>y.hasOwnProperty(_)))!==null&&r!==void 0?r:[]:g??[])}(s=d.updateFullDataSync)===null||s===void 0||s.call(d,b)}this.renderAsync()}return{chartInstance:d,bounds:a.bounds}}return{}}_getDimensionSortArray(){var t,e;if(!((e=(t=this.options)===null||t===void 0?void 0:t.axes)===null||e===void 0)&&e.length){const n=this.options.indicatorsAsCol?"left":"bottom",o=this.options.axes.find(r=>r.orient===n);if(o&<(o.domain))return o.domain}}setRecords(t){var e,n;const o={col:this.stateManager.hover.cellPos.col,row:this.stateManager.hover.cellPos.row};this.options.records=this.internalProps.records=t;const r=this.options,s=this.internalProps;let l,a;this.dataset.setRecords(t),l=r.columnTree?s.layoutMap.columnDimensionTree:new Pe((e=this.dataset.colHeaderTree)!==null&&e!==void 0?e:[],this.layoutNodeId),a=r.rowTree?s.layoutMap.rowDimensionTree:new Pe((n=this.dataset.rowHeaderTree)!==null&&n!==void 0?n:[],this.layoutNodeId),s.layoutMap=new lr(this,this.dataset,l,a),this.refreshHeader(),this.internalProps.useOneRowHeightFillAll=!1,this.scenegraph.clearCells(),this.clearCellStyleCache(),this.scenegraph.createSceneGraph(),this.stateManager.updateHoverPos(o.col,o.row),this.internalProps.title&&!this.internalProps.title.isReleased&&(this._updateSize(),this.internalProps.title.resize(),this.scenegraph.resize()),this.eventManager.updateEventBinder()}_hasCustomRenderOrLayout(){if(this.options.customRender)return!0;const{columnsDefine:t,rowsDefine:e,indicatorsDefine:n}=this.internalProps.layoutMap;for(let o=0;o<t.length;o++){const r=t[o];if(typeof r!="string"&&(r.headerCustomLayout||r.headerCustomRender))return!0}for(let o=0;o<e.length;o++){const r=e[o];if(typeof r!="string"&&(r.headerCustomLayout||r.headerCustomRender))return!0}for(let o=0;o<n.length;o++){const r=n[o];if(typeof r!="string"&&(r.customLayout||r.headerCustomLayout||r.customRender||r.headerCustomRender))return!0}return!1}changeRecordOrder(t,e){}getLayoutColumnTree(){return this.internalProps.layoutMap.getLayoutColumnTree()}getLayoutColumnTreeCount(){return this.internalProps.layoutMap.getLayoutColumnTreeCount()}getLayoutRowTree(){return this.internalProps.layoutMap.getLayoutRowTree()}getLayoutRowTreeCount(){return this.internalProps.layoutMap.getLayoutRowTreeCount()}getCellHeaderTreeNodes(t,e){return this.internalProps.layoutMap.getCellHeaderPathsWithTreeNode(t,e)}};class V9 extends qp{constructor(t){var e,n,o,r,s,l,a,h,d,u;const c=lt(t.boundsPadding),g=[(n=(e=t.marginTop)!==null&&e!==void 0?e:c?t.boundsPadding[0]:t.boundsPadding)!==null&&n!==void 0?n:0,(r=(o=t.marginRight)!==null&&o!==void 0?o:c?t.boundsPadding[1]:t.boundsPadding)!==null&&r!==void 0?r:0,(a=(s=t.marginBottom)!==null&&s!==void 0?s:c?(l=t.boundsPadding[2])!==null&&l!==void 0?l:t.boundsPadding[0]:t.boundsPadding)!==null&&a!==void 0?a:0,(u=(h=t.marginLeft)!==null&&h!==void 0?h:c?(d=t.boundsPadding[3])!==null&&d!==void 0?d:t.boundsPadding[1]:t.boundsPadding)!==null&&u!==void 0?u:0];t.boundsPadding=g,super(t)}}class PT extends cn{constructor(t){var e,n,o,r,s,l,a,h,d,u,c,g,f,p;t.direction&&(t.flexDirection=t.direction),!t.justifyContent||t.justifyContent!=="start"&&t.justifyContent!=="end"||(t.justifyContent="flex-"+t.justifyContent),!t.alignItems||t.alignItems!=="start"&&t.alignItems!=="end"||(t.alignItems="flex-"+t.alignItems),!t.alignContent||t.alignContent!=="start"&&t.alignContent!=="end"||(t.alignContent="flex-"+t.alignContent),t.display="flex",t.flexDirection||(t.flexDirection="row"),t.clip=!0,t.fill=(e=t==null?void 0:t.background)===null||e===void 0?void 0:e.fill,t.stroke=(n=t==null?void 0:t.background)===null||n===void 0?void 0:n.stroke,t.lineWidth=(o=t==null?void 0:t.background)===null||o===void 0?void 0:o.lineWidth,t.cornerRadius=(r=t==null?void 0:t.background)===null||r===void 0?void 0:r.cornerRadius;const m=lt(t.boundsPadding),b=[(l=(s=t.marginTop)!==null&&s!==void 0?s:m?t.boundsPadding[0]:t.boundsPadding)!==null&&l!==void 0?l:0,(h=(a=t.marginRight)!==null&&a!==void 0?a:m?t.boundsPadding[1]:t.boundsPadding)!==null&&h!==void 0?h:0,(c=(d=t.marginBottom)!==null&&d!==void 0?d:m?(u=t.boundsPadding[2])!==null&&u!==void 0?u:t.boundsPadding[0]:t.boundsPadding)!==null&&c!==void 0?c:0,(p=(g=t.marginLeft)!==null&&g!==void 0?g:m?(f=t.boundsPadding[3])!==null&&f!==void 0?f:t.boundsPadding[1]:t.boundsPadding)!==null&&p!==void 0?p:0];t.boundsPadding=b,super(t)}}class j9 extends PT{constructor(t){t.flexWrap="nowrap",super(t)}}let $9=class extends Uo{constructor(t){var e,n,o,r,s,l,a,h,d,u,c,g;let f;ce(t.iconName)&&(f=vn()[t.iconName],f&&(t.width=(e=t.width)!==null&&e!==void 0?e:f.width,t.height=(n=t.height)!==null&&n!==void 0?n:f.height,t.svg=f.svg,t.cursor=f.cursor)),t.svg&&(t.image=t.svg);const p=lt(t.boundsPadding),m=[(r=(o=t.marginTop)!==null&&o!==void 0?o:p?t.boundsPadding[0]:t.boundsPadding)!==null&&r!==void 0?r:0,(l=(s=t.marginRight)!==null&&s!==void 0?s:p?t.boundsPadding[1]:t.boundsPadding)!==null&&l!==void 0?l:0,(d=(a=t.marginBottom)!==null&&a!==void 0?a:p?(h=t.boundsPadding[2])!==null&&h!==void 0?h:t.boundsPadding[0]:t.boundsPadding)!==null&&d!==void 0?d:0,(g=(u=t.marginLeft)!==null&&u!==void 0?u:p?(c=t.boundsPadding[3])!==null&&c!==void 0?c:t.boundsPadding[1]:t.boundsPadding)!==null&&g!==void 0?g:0];t.boundsPadding=m,super(t),this.cache=f}},G9=class extends Uo{constructor(t){var e,n,o,r,s,l,a,h,d,u;t.src&&(t.image=t.src),t.shape==="circle"&&(t.cornerRadius=t.width/2);const c=lt(t.boundsPadding),g=[(n=(e=t.marginTop)!==null&&e!==void 0?e:c?t.boundsPadding[0]:t.boundsPadding)!==null&&n!==void 0?n:0,(r=(o=t.marginRight)!==null&&o!==void 0?o:c?t.boundsPadding[1]:t.boundsPadding)!==null&&r!==void 0?r:0,(a=(s=t.marginBottom)!==null&&s!==void 0?s:c?(l=t.boundsPadding[2])!==null&&l!==void 0?l:t.boundsPadding[0]:t.boundsPadding)!==null&&a!==void 0?a:0,(u=(h=t.marginLeft)!==null&&h!==void 0?h:c?(d=t.boundsPadding[3])!==null&&d!==void 0?d:t.boundsPadding[1]:t.boundsPadding)!==null&&u!==void 0?u:0];t.boundsPadding=g,super(t)}};class U9 extends cu{constructor(t){var e,n,o,r,s,l,a,h,d,u;const c=lt(t.boundsPadding),g=[(n=(e=t.marginTop)!==null&&e!==void 0?e:c?t.boundsPadding[0]:t.boundsPadding)!==null&&n!==void 0?n:0,(r=(o=t.marginRight)!==null&&o!==void 0?o:c?t.boundsPadding[1]:t.boundsPadding)!==null&&r!==void 0?r:0,(a=(s=t.marginBottom)!==null&&s!==void 0?s:c?(l=t.boundsPadding[2])!==null&&l!==void 0?l:t.boundsPadding[0]:t.boundsPadding)!==null&&a!==void 0?a:0,(u=(h=t.marginLeft)!==null&&h!==void 0?h:c?(d=t.boundsPadding[3])!==null&&d!==void 0?d:t.boundsPadding[1]:t.boundsPadding)!==null&&u!==void 0?u:0];t.boundsPadding=g,super(t)}}class K9 extends Hi{constructor(t){var e,n,o,r,s,l,a,h,d,u,c;t.textBaseline||(t.textBaseline="top");const g=lt(t.boundsPadding),f=[(n=(e=t.marginTop)!==null&&e!==void 0?e:g?t.boundsPadding[0]:t.boundsPadding)!==null&&n!==void 0?n:0,(r=(o=t.marginRight)!==null&&o!==void 0?o:g?t.boundsPadding[1]:t.boundsPadding)!==null&&r!==void 0?r:0,(a=(s=t.marginBottom)!==null&&s!==void 0?s:g?(l=t.boundsPadding[2])!==null&&l!==void 0?l:t.boundsPadding[0]:t.boundsPadding)!==null&&a!==void 0?a:0,(u=(h=t.marginLeft)!==null&&h!==void 0?h:g?(d=t.boundsPadding[3])!==null&&d!==void 0?d:t.boundsPadding[1]:t.boundsPadding)!==null&&u!==void 0?u:0];t.boundsPadding=f,t.fill=(c=t.fill)!==null&&c!==void 0?c:"#000",super(t)}getSize(t){this.AABBBounds.width()}}function Y9(i,t=0){return{percent:i,delta:t}}class X9 extends fu{constructor(t){var e,n,o,r,s,l,a,h,d,u;const c=lt(t.boundsPadding),g=[(n=(e=t.marginTop)!==null&&e!==void 0?e:c?t.boundsPadding[0]:t.boundsPadding)!==null&&n!==void 0?n:0,(r=(o=t.marginRight)!==null&&o!==void 0?o:c?t.boundsPadding[1]:t.boundsPadding)!==null&&r!==void 0?r:0,(a=(s=t.marginBottom)!==null&&s!==void 0?s:c?(l=t.boundsPadding[2])!==null&&l!==void 0?l:t.boundsPadding[0]:t.boundsPadding)!==null&&a!==void 0?a:0,(u=(h=t.marginLeft)!==null&&h!==void 0?h:c?(d=t.boundsPadding[3])!==null&&d!==void 0?d:t.boundsPadding[1]:t.boundsPadding)!==null&&u!==void 0?u:0];t.boundsPadding=g,super(t)}}class q9 extends Va{constructor(t){var e,n,o,r,s,l,a,h,d,u;const c=lt(t.boundsPadding),g=[(n=(e=t.marginTop)!==null&&e!==void 0?e:c?t.boundsPadding[0]:t.boundsPadding)!==null&&n!==void 0?n:0,(r=(o=t.marginRight)!==null&&o!==void 0?o:c?t.boundsPadding[1]:t.boundsPadding)!==null&&r!==void 0?r:0,(a=(s=t.marginBottom)!==null&&s!==void 0?s:c?(l=t.boundsPadding[2])!==null&&l!==void 0?l:t.boundsPadding[0]:t.boundsPadding)!==null&&a!==void 0?a:0,(u=(h=t.marginLeft)!==null&&h!==void 0?h:c?(d=t.boundsPadding[3])!==null&&d!==void 0?d:t.boundsPadding[1]:t.boundsPadding)!==null&&u!==void 0?u:0];t.boundsPadding=g,super(t)}getSize(t){this.AABBBounds.width()}}class Z9 extends cn{constructor(t){var e,n,o,r,s,l,a,h,d,u;const c=lt(t.boundsPadding),g=[(n=(e=t.marginTop)!==null&&e!==void 0?e:c?t.boundsPadding[0]:t.boundsPadding)!==null&&n!==void 0?n:0,(r=(o=t.marginRight)!==null&&o!==void 0?o:c?t.boundsPadding[1]:t.boundsPadding)!==null&&r!==void 0?r:0,(a=(s=t.marginBottom)!==null&&s!==void 0?s:c?(l=t.boundsPadding[2])!==null&&l!==void 0?l:t.boundsPadding[0]:t.boundsPadding)!==null&&a!==void 0?a:0,(u=(h=t.marginLeft)!==null&&h!==void 0?h:c?(d=t.boundsPadding[3])!==null&&d!==void 0?d:t.boundsPadding[1]:t.boundsPadding)!==null&&u!==void 0?u:0];t.boundsPadding=g,super(t)}}const J9=Object.freeze(Object.defineProperty({__proto__:null,Arc:X9,CheckBox:Rr,Circle:V9,Container:PT,Group:Z9,GroupElement:j9,Icon:$9,Image:G9,Line:i0,Radio:Qa,Rect:U9,Tag:q9,Text:K9,percentCalc:Y9},Symbol.toStringTag,{value:"Module"}));function Q9(i){var t,e,n,o,r,s,l,a,h,d,u;const c={seqId:0},g={isPivotChart:!0};let f,p,m,b;i.columnTree&&(i.indicatorsAsCol!==!1&&(m=Vi(i.columnTree,i.indicators)),f=new Pe((t=i.columnTree)!==null&&t!==void 0?t:[],c)),i.rowTree&&(i.indicatorsAsCol===!1&&(b=Vi(i.rowTree,i.indicators)),p=new Pe((e=i.rowTree)!==null&&e!==void 0?e:[],c));const C=!((n=p.dimensionKeys)===null||n===void 0)&&n.count?p.dimensionKeys.valueArr():(r=(o=i.rows)===null||o===void 0?void 0:o.reduce((y,S)=>(typeof S=="string"?y.push(S):y.push(S.dimensionKey),y),[]))!==null&&r!==void 0?r:[],_=!((s=f.dimensionKeys)===null||s===void 0)&&s.count?f.dimensionKeys.valueArr():(a=(l=i.columns)===null||l===void 0?void 0:l.reduce((y,S)=>(typeof S=="string"?y.push(S):y.push(S.dimensionKey),y),[]))!==null&&a!==void 0?a:[],w=(d=(h=i.indicators)===null||h===void 0?void 0:h.reduce((y,S)=>(typeof S=="string"?y.push(S):y.push(S.indicatorKey),y),[]))!==null&&d!==void 0?d:[];return g.collectValuesBy=t7(i,_,C),g.aggregationRules=e7(i),{dataset:new Ih(g,C,_,w,i.indicators,(u=i.indicatorsAsCol)===null||u===void 0||u,i.records,void 0,m||i.columnTree,b||i.rowTree,!0),columnDimensionTree:f,rowDimensionTree:p,layoutNodeId:c}}function t7(i,t,e){var n,o,r,s,l,a,h,d,u,c,g,f,p,m,b,C,_,w,y,S,A,R,x;const T={};for(let M=0,B=(n=i.indicators)===null||n===void 0?void 0:n.length;M<B;M++)if(typeof i.indicators[M]!="string"&&i.indicators[M].chartSpec)if(i.indicatorsAsCol===!1){const P=i.indicators[M];if(T[P.indicatorKey]={by:e,range:!0,sumBy:((o=P.chartSpec)===null||o===void 0?void 0:o.stack)!==!1&&t.concat((r=P.chartSpec)===null||r===void 0?void 0:r.xField)},P.chartSpec.series)P.chartSpec.series.forEach(F=>{var H,E,k,I,L,D,O,N,W,$,U,Y,j,G,X,ht;const gt=typeof F.xField=="string"?F.xField:F.xField[0];T[gt]={by:t,type:F.direction!=="horizontal"?"xField":void 0,range:F.direction==="horizontal",sortBy:F.direction!=="horizontal"?(I=(k=(E=(H=F==null?void 0:F.data)===null||H===void 0?void 0:H.fields)===null||E===void 0?void 0:E[gt])===null||k===void 0?void 0:k.domain)!==null&&I!==void 0?I:(N=(O=(D=(L=P.chartSpec)===null||L===void 0?void 0:L.data)===null||D===void 0?void 0:D.fields)===null||O===void 0?void 0:O[gt])===null||N===void 0?void 0:N.domain:void 0};const Ct=F.yField;T[Ct]={by:e,range:F.direction!=="horizontal",sumBy:F.stack!==!1&&t.concat(F==null?void 0:F.xField),sortBy:F.direction==="horizontal"?(Y=(U=($=(W=F==null?void 0:F.data)===null||W===void 0?void 0:W.fields)===null||$===void 0?void 0:$[Ct])===null||U===void 0?void 0:U.domain)!==null&&Y!==void 0?Y:(ht=(X=(G=(j=P.chartSpec)===null||j===void 0?void 0:j.data)===null||G===void 0?void 0:G.fields)===null||X===void 0?void 0:X[Ct])===null||ht===void 0?void 0:ht.domain:void 0}});else{const F=typeof P.chartSpec.xField=="string"?P.chartSpec.xField:P.chartSpec.xField[0];T[F]={by:t,type:P.chartSpec.direction!=="horizontal"?"xField":void 0,range:P.chartSpec.direction==="horizontal",sortBy:P.chartSpec.direction!=="horizontal"?(h=(a=(l=(s=P.chartSpec)===null||s===void 0?void 0:s.data)===null||l===void 0?void 0:l.fields)===null||a===void 0?void 0:a[F])===null||h===void 0?void 0:h.domain:void 0};const H=P.chartSpec.yField;T[H]={by:e,range:i.indicators[M].chartSpec.direction!=="horizontal",sumBy:P.chartSpec.stack!==!1&&t.concat((d=P.chartSpec)===null||d===void 0?void 0:d.xField),sortBy:P.chartSpec.direction==="horizontal"?(f=(g=(c=(u=P.chartSpec)===null||u===void 0?void 0:u.data)===null||c===void 0?void 0:c.fields)===null||g===void 0?void 0:g[H])===null||f===void 0?void 0:f.domain:void 0}}}else{const P=i.indicators[M];if(T[P.indicatorKey]={by:t,range:!0,sumBy:((p=P.chartSpec)===null||p===void 0?void 0:p.stack)!==!1&&e.concat((m=P.chartSpec)===null||m===void 0?void 0:m.yField)},P.chartSpec.series)P.chartSpec.series.forEach(F=>{var H,E,k,I,L,D,O,N,W,$,U,Y,j,G,X,ht;const gt=typeof F.yField=="string"?F.yField:F.yField[0];T[gt]={by:e,type:F.direction==="horizontal"?"yField":void 0,range:F.direction!=="horizontal",sortBy:F.direction==="horizontal"?(I=(k=(E=(H=F==null?void 0:F.data)===null||H===void 0?void 0:H.fields)===null||E===void 0?void 0:E[gt])===null||k===void 0?void 0:k.domain)!==null&&I!==void 0?I:(N=(O=(D=(L=P.chartSpec)===null||L===void 0?void 0:L.data)===null||D===void 0?void 0:D.fields)===null||O===void 0?void 0:O[gt])===null||N===void 0?void 0:N.domain:void 0};const Ct=F.xField;T[Ct]={by:t,range:F.direction==="horizontal",sumBy:F.stack!==!1&&e.concat(F==null?void 0:F.yField),sortBy:F.direction!=="horizontal"?(Y=(U=($=(W=F==null?void 0:F.data)===null||W===void 0?void 0:W.fields)===null||$===void 0?void 0:$[Ct])===null||U===void 0?void 0:U.domain)!==null&&Y!==void 0?Y:(ht=(X=(G=(j=P.chartSpec)===null||j===void 0?void 0:j.data)===null||G===void 0?void 0:G.fields)===null||X===void 0?void 0:X[Ct])===null||ht===void 0?void 0:ht.domain:void 0}});else{const F=typeof P.chartSpec.yField=="string"?P.chartSpec.yField:P.chartSpec.yField[0];T[F]={by:e,type:P.chartSpec.direction==="horizontal"?"yField":void 0,range:P.chartSpec.direction!=="horizontal",sortBy:P.chartSpec.direction==="horizontal"?(w=(_=(C=(b=P.chartSpec)===null||b===void 0?void 0:b.data)===null||C===void 0?void 0:C.fields)===null||_===void 0?void 0:_[F])===null||w===void 0?void 0:w.domain:void 0};const H=P.chartSpec.xField;T[H]={by:t,range:i.indicators[M].chartSpec.direction==="horizontal",sumBy:P.chartSpec.stack!==!1&&e.concat((y=P.chartSpec)===null||y===void 0?void 0:y.yField),sortBy:P.chartSpec.direction!=="horizontal"?(x=(R=(A=(S=P.chartSpec)===null||S===void 0?void 0:S.data)===null||A===void 0?void 0:A.fields)===null||R===void 0?void 0:R[H])===null||x===void 0?void 0:x.domain:void 0}}}return T}function e7(i){var t;const e=[];return(t=i.indicators)===null||t===void 0||t.forEach(n=>{var o,r;if(typeof n=="string")e.push({indicatorKey:n,field:n,aggregationType:zt.RECORD});else if(!((o=n.chartSpec)===null||o===void 0)&&o.series){const s=[];(r=n.chartSpec)===null||r===void 0||r.series.forEach(l=>{const a=i.indicatorsAsCol===!1?l.yField:l.xField;s.indexOf(a)===-1&&s.push(a)}),e.push({indicatorKey:n.indicatorKey,field:s,aggregationType:zt.RECORD})}else{const s=i.indicatorsAsCol===!1?n.chartSpec.yField:n.chartSpec.xField;e.push({indicatorKey:n.indicatorKey,field:s??n.indicatorKey,aggregationType:zt.RECORD})}}),e}function i7(i,t,e){var n,o;const r=Q9(i);let s=r.columnDimensionTree,l=r.rowDimensionTree,a=!1,h=!1;i.columnTree&&i.indicatorsAsCol&&!s.dimensionKeys.contain(Xi)&&(a=!0),i.rowTree&&(i.indicatorsAsCol||l.dimensionKeys.contain(Xi)||(h=!0));const{dataset:d,layoutNodeId:u}=r,c={options:i,layoutNodeId:u,internalProps:i,isPivotChart:()=>!0,pivotChartAxes:[],_selectedDataItemsInChart:[],_getActiveChartInstance:()=>({updateState:()=>{}})};i.columnTree&&!a||(s=new Pe((n=d.colHeaderTree)!==null&&n!==void 0?n:[],u)),i.rowTree&&!h||(l=new Pe((o=d.rowHeaderTree)!==null&&o!==void 0?o:[],u));const g=new lr(c,d,s,l);for(let f=0;f<g.colCount;f++)for(let p=0;p<g.rowCount;p++){if(g.isHeader(f,p))continue;const m=g.getCellHeaderPaths(f,p),b=m.colHeaderPaths.map(y=>{var S;return(S=y.indicatorKey)!==null&&S!==void 0?S:y.value}),C=m.rowHeaderPaths.map(y=>{var S;return(S=y.indicatorKey)!==null&&S!==void 0?S:y.value}),_=d.getAggregator(g.indicatorsAsCol?C:C.slice(0,-1),g.indicatorsAsCol?b.slice(0,-1):b,g.getIndicatorKey(f,p)),w=n7(_.value?_.value():void 0,t,f,p,g,e);if(w)return w}}function n7(i,t,e,n,o,r){if(lt(i)){for(let s=0;s<i.length;s++)if(r?r(i[s],t):o7(i[s],t))return o.getCellHeaderPaths(e,n)}}function o7(i,t){return JSON.stringify(i)===JSON.stringify(t)}function r7(i){return new Va(i?i.attribute:{})}function s7(i){return new Rr(i?i.attribute:{})}function l7(i){return new Qa(i?i.attribute:{})}class a7{constructor(t,e){var n,o,r,s,l,a;this.willUpdateRow=!1,this.willUpdateCol=!1,this.table=t,this.rowCount=(n=e==null?void 0:e.rowCount)!==null&&n!==void 0?n:void 0,this.colCount=(o=e==null?void 0:e.colCount)!==null&&o!==void 0?o:void 0,this.animationDuration=(r=e==null?void 0:e.animationDuration)!==null&&r!==void 0?r:500,this.animationDelay=(s=e==null?void 0:e.animationDelay)!==null&&s!==void 0?s:1e3,this.animationEasing=(l=e==null?void 0:e.animationEasing)!==null&&l!==void 0?l:"linear",this.replaceScrollAction=(a=e==null?void 0:e.replaceScrollAction)!==null&&a!==void 0&&a,this.reset(),this.init()}init(){this.replaceScrollAction&&(this.table.disableScroll(),this.table.scenegraph.stage.addEventListener("wheel",this.onScrollEnd.bind(this)))}reset(){this.playing=!1,this.row=this.table.frozenRowCount,this.col=this.table.frozenColCount}onScrollEnd(t){this.rowCount?(t.deltaY>0?(this.row+=this.rowCount,this.row=Math.min(this.row,this.table.rowCount-this.table.frozenRowCount)):t.deltaY<0&&(this.row-=this.rowCount,this.row=Math.max(this.row,this.table.frozenRowCount)),this.table.scrollToRow(this.row,{duration:this.animationDuration,easing:this.animationEasing})):this.colCount&&(t.deltaX>0?(this.col+=this.colCount,this.col=Math.min(this.col,this.table.colCount-this.table.frozenColCount)):t.deltaX<0&&(this.col-=this.colCount,this.col=Math.max(this.col,this.table.frozenColCount)),this.table.scrollToCol(this.col,{duration:this.animationDuration,easing:this.animationEasing}))}play(){this.playing=!0,this.rowCount&&!this.willUpdateRow?this.updateRow():this.colCount&&!this.willUpdateCol&&this.updateCol()}pause(){this.playing=!1}updateRow(){if(!this.playing)return;let t=!0;this.table.scenegraph.proxy.screenTopRow!==this.row?(this.row=this.table.frozenRowCount,t=!1):this.row+=this.rowCount,this.table.scrollToRow(this.row,t?{duration:this.animationDuration,easing:this.animationEasing}:void 0),this.willUpdateRow=!0,setTimeout(()=>{this.willUpdateRow=!1,this.updateRow()},this.animationDuration+this.animationDelay)}updateCol(){if(!this.playing)return;let t=!0;this.table.scenegraph.proxy.screenLeftCol!==this.col?(this.col=this.table.frozenColCount,t=!1):this.col+=this.colCount,this.table.scrollToCol(this.col,t?{duration:this.animationDuration,easing:this.animationEasing}:void 0),this.willUpdateCol=!0,setTimeout(()=>{this.willUpdateCol=!1,this.updateCol()},this.animationDuration+this.animationDelay)}}class h7{constructor(t,e){this.table=t,this.options=e,this.registerStyle(),this.bindEvent()}registerStyle(){var t,e,n,o,r,s,l,a;this.table.registerCustomCellStyle("col-highlight",{bgColor:(e=(t=this.options)===null||t===void 0?void 0:t.colHighlightBGColor)!==null&&e!==void 0?e:"#82b2f5",color:(o=(n=this.options)===null||n===void 0?void 0:n.colHighlightColor)!==null&&o!==void 0?o:"#FFF"}),this.table.registerCustomCellStyle("row-highlight",{bgColor:(s=(r=this.options)===null||r===void 0?void 0:r.rowHighlightBGColor)!==null&&s!==void 0?s:"#82b2f5",color:(a=(l=this.options)===null||l===void 0?void 0:l.rowHighlightColor)!==null&&a!==void 0?a:"#FFF"})}bindEvent(){this.table.on("selected_cell",t=>{this.updateHighlight()}),this.table.on("selected_clear",()=>{this.clearHighlight()}),this.table.on("mousemove_table",()=>{this.table.stateManager.select.selecting&&this.updateHighlight()})}clearHighlight(){this.colHeaderRange&&this.table.arrangeCustomCellStyle({range:this.colHeaderRange},void 0),this.rowHeaderRange&&this.table.arrangeCustomCellStyle({range:this.rowHeaderRange},void 0),this.colHeaderRange=void 0,this.rowHeaderRange=void 0}updateHighlight(){var t,e,n,o;if(((t=this.options)===null||t===void 0?void 0:t.colHighlight)===!1&&((e=this.options)===null||e===void 0?void 0:e.rowHighlight)===!1)return;const r=this.table.getSelectedCellRanges();if(r.length===0)return void this.clearHighlight();const s=r[0],l=[s.start.row,s.end.row];l.sort((u,c)=>u-c);const a=[s.start.col,s.end.col];let h,d;a.sort((u,c)=>u-c),this.table.isPivotTable()?(h={start:{col:a[0],row:0},end:{col:a[1],row:this.table.columnHeaderLevelCount-1}},d={start:{col:0,row:l[0]},end:{col:this.table.rowHeaderLevelCount-1,row:l[1]}}):this.table.internalProps.transpose?d={start:{col:0,row:l[0]},end:{col:this.table.rowHeaderLevelCount-1,row:l[1]}}:(h={start:{col:a[0],row:0},end:{col:a[1],row:this.table.columnHeaderLevelCount-1}},this.table.internalProps.rowSeriesNumber&&(d={start:{col:0,row:l[0]},end:{col:0,row:l[1]}})),((n=this.options)===null||n===void 0?void 0:n.colHighlight)===!1||HT(this.colHeaderRange,h)||(this.colHeaderRange&&this.table.arrangeCustomCellStyle({range:this.colHeaderRange},void 0),h&&this.table.arrangeCustomCellStyle({range:h},"col-highlight"),this.colHeaderRange=h),((o=this.options)===null||o===void 0?void 0:o.rowHighlight)===!1||HT(this.rowHeaderRange,d)||(this.rowHeaderRange&&this.table.arrangeCustomCellStyle({range:this.rowHeaderRange},void 0),d&&this.table.arrangeCustomCellStyle({range:d},"row-highlight"),this.rowHeaderRange=d)}}function HT(i,t){return i===void 0&&t===void 0||i!==void 0&&t!==void 0&&i.start.col===t.start.col&&i.start.row===t.start.row&&i.end.col===t.end.col&&i.end.row===t.end.row}ix();const d7="1.11.1";function u7(){return vn()}function c7(){rT()}const g7=Object.freeze(Object.defineProperty({__proto__:null,CarouselAnimationPlugin:a7,CustomLayout:J9,DataStatistics:nV,EventTarget:th,HeaderHighlightPlugin:h7,InvertHighlightPlugin:Q6,ListTable:F9,ListTableSimple:I9,PIVOT_CHART_EVENT_TYPE:SA,PIVOT_TABLE_EVENT_TYPE:rr,PivotChart:N9,PivotTable:BT,PivotTableSimple:W9,TABLE_EVENT_TYPE:at,TYPES:jz,VArc:HI,VArea:EI,VCheckBox:s7,VCircle:LI,VGlyph:FI,VGroup:kI,VImage:II,VLine:DI,VPath:OI,VPolygon:zI,VRadio:l7,VRect:WI,VSymbol:NI,VTag:r7,VText:VI,clearGlobal:c7,core:K8,data:Q4,getDataCellPath:i7,getIcons:u7,getTargetCell:Hr,graphicUtil:B1,jsx:$I,onBeforeAttributeUpdateForInvertHighlight:fR,register:J8,registerAxis:Mg,registerChartCell:kg,registerCheckboxCell:Fg,registerEmptyTip:Bg,registerImageCell:Ig,registerLegend:Pg,registerMenu:Hg,registerProgressBarCell:Dg,registerRadioCell:Og,registerSparkLineCell:zg,registerTextCell:Il,registerTitle:Eg,registerTooltip:Lg,registerVideoCell:Wg,renderChart:Vm,restoreMeasureText:hW,setCustomAlphabetCharSet:aW,themes:j4,updateCell:_o,version:d7},Symbol.toStringTag,{value:"Module"})),zr=PB.create({baseURL:"/",validateStatus(i){return i===200},timeout:1e3*15});zr.interceptors.request.use(i=>i,i=>Promise.reject(i)),zr.interceptors.response.use(i=>{var t,e;return+((t=i==null?void 0:i.data)==null?void 0:t.code)==500&&ji.message.error({content:((e=i==null?void 0:i.data)==null?void 0:e.message)||"服务器异常",key:"SERVER_ERROR"}),i},i=>{if(i.message.includes("timeout"))ji.message.error({content:"网络连接超时,请重试!",key:"TIMEOUT"});else{const{status:t}=i.response;t===401?ji.message.error({content:"当前用户信息不正确",key:"REQUEST_ERROR"}):t>=500?ji.message.error({content:"服务器异常",key:"REQUEST_ERROR"}):ji.message.error({content:"请求异常",key:"REQUEST_ERROR"})}return Promise.reject(i)});var ET={},f7={get exports(){return ET},set exports(i){ET=i}};(function(i,t){(function(e,n){i.exports=n(Lo)})(sP,function(e){function n(s){return s&&typeof s=="object"&&"default"in s?s:{default:s}}var o=n(e),r={name:"zh-cn",weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"周日_周一_周二_周三_周四_周五_周六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),ordinal:function(s,l){return l==="W"?s+"周":s+"日"},weekStart:1,yearStart:4,formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日Ah点mm分",LLLL:"YYYY年M月D日ddddAh点mm分",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},relativeTime:{future:"%s内",past:"%s前",s:"几秒",m:"1 分钟",mm:"%d 分钟",h:"1 小时",hh:"%d 小时",d:"1 天",dd:"%d 天",M:"1 个月",MM:"%d 个月",y:"1 年",yy:"%d 年"},meridiem:function(s,l){var a=100*s+l;return a<600?"凌晨":a<900?"早上":a<1100?"上午":a<1300?"中午":a<1800?"下午":"晚上"}};return o.default.locale(r,null,!0),r})})(f7);const xX="",RX="",Ti=(i,t)=>{const e=i.__vccOpts||i;for(const[n,o]of t)e[n]=o;return e};Lo.locale("zh-cn");const p7=v.defineComponent({name:"PivotFilter",props:{data:{type:Object,default:()=>{}},customDimensions:{type:Array,default:()=>[]},dimensions:{type:Array,default:()=>[]},indicators:{type:Array,default:()=>[]}},setup(i,{emit:t,expose:e}){const n=v.ref(!1),o=v.ref(!1),r=v.ref(!1),s=v.ref([]),l=v.ref(""),a=v.ref(),h=v.ref(""),d=v.ref([]),u=v.ref(),c=v.ref("range"),g=v.ref(),f=v.ref({}),p=v.ref(),m=v.ref({}),b=v.inject("getContainer",()=>{}),C=v.inject("scaleValue",{}),_=v.inject("theme","light"),w=v.inject("pageId",""),y=v.inject("context",""),S=v.inject("indicatorUrl",""),A=v.inject("indicatorToken",""),R=v.inject("graphicConfig",{}),x=v.inject("theDateInfo",{}),T=[{label:"小于",value:"LESS"},{label:"小于等于",value:"LESS_EQUAL"},{label:"大于",value:"GREATER"},{label:"大于等于",value:"GREATER_EQUAL"},{label:"等于",value:"EQUAL"},{label:"不等于",value:"NOT_EQUAL"}],M=[{label:"单个日期",value:"date"},{label:"日期范围",value:"range"}],B=j=>{r.value=!1,s.value=j.target.checked?v.unref(d).map(G=>G.value):[]};v.watch(s,j=>{o.value=j.length===v.unref(d).length,r.value=!!j.length&&j.length<v.unref(d).length});const P=async j=>{const{queryColumnList:G=[],edvDataSetId:X="",source:ht,dataSourceId:gt}=v.unref(R);let Ct=G.find(st=>st.name===j||st.label===j);Ct||(Ct=i.customDimensions.find(st=>st.name===j||st.label===j));const Q={},{search:et}=(window==null?void 0:window.location)||{},bt=et.slice(1,et.length).split("&");for(const st of bt)if(st){const _t=st.split("=");_t[0]&&(Q[_t[0]]=_t[1])}const dt=await zr.post(`${v.unref(S)}/diagram/groupvalue`,{source:ht,groupColumn:j,hrpIndexTypeGuid:Ct==null?void 0:Ct.typeGuid,pageId:v.unref(w),pageFlag:!0,edvDataSetId:X,dataSourceId:gt,extParam:Q},{headers:{Authentication:v.unref(A),operateContext:v.unref(y)}}),{success:ot,data:ut=[]}=dt.data;ot&&(d.value=ut.map(st=>({value:st})))},F=v.ref("");async function H(){const{filterData:j,type:G,key:X}=i.data,gt=i.dimensions.concat(i.indicators).find(Ct=>Ct.label===X);gt&&(F.value=gt.genericType),v.unref(F)==="DATE"?u.value="date":u.value="select",G==="dimension"?v.unref(u)==="select"?(await P(X),Array.isArray(j)?s.value=j:s.value=(j==null?void 0:j.value)||[]):v.unref(u)==="date"&&(j==null?void 0:j.length)===2&&(a.value=[Lo(j[0].value),Lo(j[1].value)]):(l.value=(j==null?void 0:j.rule)||"",a.value=(j==null?void 0:j.value)||""),n.value=!0}const E=v.computed(()=>v.unref(x).dateFormat||"YYYY-MM-DD");function k(){var ht;const{key:j,type:G}=i.data;let X={};G==="dimension"?v.unref(u)==="select"?X={rule:"IN",value:v.unref(s)}:v.unref(u)==="date"&&(v.unref(c)==="date"?X={rule:"EQUAL",value:((ht=v.unref(a))==null?void 0:ht.format(v.unref(E)))||""}:v.unref(c)==="range"&&v.unref(a)&&(X=[{rule:"GREATER_EQUAL",value:v.unref(a)[0].format(v.unref(E))},{rule:"LESS_EQUAL",value:v.unref(a)[1].format(v.unref(E))}])):X={rule:v.unref(l),value:v.unref(a)},t("change",{checkKeys:X,key:j,type:G}),n.value=!1}function I(){l.value="",a.value=null}const L=v.computed(()=>v.unref(_)==="darkBlue"?"#b2c3dd":""),D=()=>document.getElementsByClassName("filter-modal")[0]||document.body,O=j=>{var G,X,ht;if(j){const gt=(G=v.unref(g))==null?void 0:G.getBoundingClientRect();if(gt){const Ct=gt.left/(((X=v.unref(C))==null?void 0:X.widthScale)||1)+"px",Q=(gt.top+gt.height)/(((ht=v.unref(C))==null?void 0:ht.heightScale)||1)+"px";setTimeout(()=>{var bt,dt;const et=document.querySelectorAll(".ant-select-dropdown"),vt=Array.from(et).filter(ot=>window.getComputedStyle(ot).display!=="none");if(vt!=null&&vt.length){const ot=document.getElementsByClassName("filter-modal")[0];vt[0].classList.add("filter-select-dropdown"),(bt=ot==null?void 0:ot.style)==null||bt.setProperty("--drop-down-left",Ct),(dt=ot==null?void 0:ot.style)==null||dt.setProperty("--drop-down-top",Q),f.value={visibility:"visible"}}},200)}}else f.value={}},N=j=>{var G,X,ht;if(j){const gt=(G=v.unref(p))==null?void 0:G.getBoundingClientRect();if(gt){const Ct=gt.left/(((X=v.unref(C))==null?void 0:X.widthScale)||1)+"px",Q=(gt.top+gt.height)/(((ht=v.unref(C))==null?void 0:ht.heightScale)||1)+"px";setTimeout(()=>{var bt,dt;const et=document.querySelectorAll(".pivot-table-range-date-dropdown"),vt=Array.from(et).filter(ot=>window.getComputedStyle(ot).display!=="none");if(vt!=null&&vt.length){const ot=document.getElementsByClassName("filter-modal")[0];vt[0].classList.add("filter-range-picker-dropdown"),(bt=ot==null?void 0:ot.style)==null||bt.setProperty("--range-picker-dropdown-left",Ct),(dt=ot==null?void 0:ot.style)==null||dt.setProperty("--range-picker-dropdown-top",Q),m.value={visibility:"visible"}}},200)}}else m.value={}},W=v.computed(()=>{let j="270px";return v.unref(u)==="date"&&(j=""),{padding:"10px",height:j,maxHeight:"280px"}}),$=()=>{a.value=null};v.watch(n,j=>{window.modalShow&&window.modalShow(j)});const U=v.computed(()=>{let j="date";return v.unref(E).endsWith("MM")?j="month":v.unref(E).endsWith("YYYY")&&(j="year"),j}),Y=j=>{const{startTime:G,endTime:X,rangeFormat:ht}=v.unref(x);if(G&&X){let gt="day";return ht.endsWith("MM")?gt="month":ht.endsWith("YYYY")&&(gt="year"),j&>&&(j<Lo(G).startOf(gt)||j>Lo(X).endOf(gt))}else return!1};return e({showModal:H}),{visible:n,checkAllDimensions:o,dimIndeterminate:r,dimensionCheckKeys:s,ruleValue:l,ruleOptions:T,filterValue:a,searchDimName:h,fontColor:L,valueList:d,filterType:u,dateSelectType:c,bodyStyle:W,dateType:U,dateSelectOptions:M,formatStr:E,theme:_,handleOk:k,onCheckAllDimChange:B,handleClear:I,dropdownStyle:f,popupStyle:m,selectRef:g,rangePickerRef:p,getPopupContainer:D,onChangeSelectType:$,disabledDate:Y,getContainer:b,dropdownVisibleChange:O,openChange:N}}}),m7={class:"wrap-header"},v7={class:"wrap-body"},b7={style:{padding:"20px",display:"none"}},C7={ref:"selectRef",style:{display:"inline-block"}},y7={style:{padding:"10px 20px"}},_7={key:0,class:"ecan-date-picker"},w7={key:1,class:"ecan-range-picker",style:{display:"inline-block"},ref:"rangePickerRef"},S7={key:1},x7={style:{padding:"20px"}},R7={ref:"selectRef",style:{display:"inline-block"}},A7={style:{padding:"10px 20px"}};function T7(i,t,e,n,o,r){var p;const s=v.resolveComponent("a-checkbox"),l=v.resolveComponent("a-input"),a=v.resolveComponent("a-checkbox-group"),h=v.resolveComponent("a-select-option"),d=v.resolveComponent("a-select"),u=v.resolveComponent("a-date-picker"),c=v.resolveComponent("a-range-picker"),g=v.resolveComponent("a-button"),f=v.resolveComponent("a-modal");return v.openBlock(),v.createBlock(f,{wrapClassName:i.theme+" filter-modal",visible:i.visible,"onUpdate:visible":t[9]||(t[9]=m=>i.visible=m),title:((p=i.data)==null?void 0:p.fieldName)+"-筛选","ok-text":"确认","cancel-text":"取消",bodyStyle:i.bodyStyle,getContainer:i.getContainer,onOk:i.handleOk},{footer:v.withCtx(()=>[v.createVNode(g,{onClick:t[8]||(t[8]=m=>i.visible=!1)},{default:v.withCtx(()=>t[10]||(t[10]=[v.createTextVNode("取消")])),_:1}),i.data.type==="indicators"?(v.openBlock(),v.createBlock(g,{key:0,onClick:i.handleClear},{default:v.withCtx(()=>t[11]||(t[11]=[v.createTextVNode("清除筛选")])),_:1},8,["onClick"])):v.createCommentVNode("",!0),v.createVNode(g,{type:"primary",onClick:i.handleOk},{default:v.withCtx(()=>t[12]||(t[12]=[v.createTextVNode("确定")])),_:1},8,["onClick"])]),default:v.withCtx(()=>[i.data.type==="dimension"?(v.openBlock(),v.createElementBlock("div",{key:0,class:v.normalizeClass(["dimension-wrap",i.filterType==="select"?"border":""])},[i.filterType==="select"?(v.openBlock(),v.createElementBlock(v.Fragment,{key:0},[v.createElementVNode("div",m7,[v.createVNode(s,{checked:i.checkAllDimensions,"onUpdate:checked":t[0]||(t[0]=m=>i.checkAllDimensions=m),indeterminate:i.dimIndeterminate,disabled:!!i.searchDimName,onChange:i.onCheckAllDimChange},{default:v.withCtx(()=>[v.createElementVNode("span",{style:v.normalizeStyle({color:i.fontColor})},"全选",4)]),_:1},8,["checked","indeterminate","disabled","onChange"]),v.createVNode(l,{value:i.searchDimName,"onUpdate:value":t[1]||(t[1]=m=>i.searchDimName=m),placeholder:"请输入关键字搜索",style:{width:"200px","margin-left":"15px"}},null,8,["value"])]),v.createElementVNode("div",v7,[v.createVNode(a,{value:i.dimensionCheckKeys,"onUpdate:value":t[2]||(t[2]=m=>i.dimensionCheckKeys=m),style:{width:"100%"}},{default:v.withCtx(()=>[(v.openBlock(!0),v.createElementBlock(v.Fragment,null,v.renderList(i.valueList||[],(m,b)=>v.withDirectives((v.openBlock(),v.createElementBlock("div",{class:"body-item",key:b},[v.createVNode(s,{value:m.value},{default:v.withCtx(()=>[v.createElementVNode("span",{style:v.normalizeStyle({color:i.fontColor})},v.toDisplayString(m.value),5)]),_:2},1032,["value"])])),[[v.vShow,!i.searchDimName||m.value.includes(i.searchDimName)]])),128))]),_:1},8,["value"])])],64)):i.filterType==="date"?(v.openBlock(),v.createElementBlock(v.Fragment,{key:1},[v.createElementVNode("div",b7,[v.createElementVNode("span",{class:"filter-label",style:v.normalizeStyle({color:i.fontColor})},"筛选类型:",4),v.createElementVNode("div",C7,[v.createVNode(d,{value:i.dateSelectType,"onUpdate:value":t[3]||(t[3]=m=>i.dateSelectType=m),style:{width:"200px"},placeholder:"请选择",dropdownClassName:"pivot-table-select-dropdown",getPopupContainer:i.getPopupContainer,dropdownStyle:i.dropdownStyle,onDropdownVisibleChange:i.dropdownVisibleChange,onChange:i.onChangeSelectType},{default:v.withCtx(()=>[(v.openBlock(!0),v.createElementBlock(v.Fragment,null,v.renderList(i.dateSelectOptions,m=>(v.openBlock(),v.createBlock(h,{key:m.value,value:m.value},{default:v.withCtx(()=>[v.createTextVNode(v.toDisplayString(m.label),1)]),_:2},1032,["value"]))),128))]),_:1},8,["value","getPopupContainer","dropdownStyle","onDropdownVisibleChange","onChange"])],512)]),v.createElementVNode("div",y7,[v.createElementVNode("span",{class:"filter-label",style:v.normalizeStyle({color:i.fontColor})},"筛选值:",4),i.dateSelectType==="date"?(v.openBlock(),v.createElementBlock("span",_7,[v.createVNode(u,{dropdownClassName:"ecan-date-picker-dropdown",value:i.filterValue,"onUpdate:value":t[4]||(t[4]=m=>i.filterValue=m),picker:i.dateType,format:i.formatStr,getPopupContainer:i.getPopupContainer},null,8,["value","picker","format","getPopupContainer"])])):i.dateSelectType==="range"?(v.openBlock(),v.createElementBlock("div",w7,[v.createVNode(c,{dropdownClassName:"ecan-range-picker-dropdown pivot-table-range-date-dropdown",value:i.filterValue,"onUpdate:value":t[5]||(t[5]=m=>i.filterValue=m),picker:i.dateType,format:i.formatStr,"disabled-date":i.disabledDate,getPopupContainer:i.getPopupContainer,popupStyle:i.popupStyle,onOpenChange:i.openChange},null,8,["value","picker","format","disabled-date","getPopupContainer","popupStyle","onOpenChange"])],512)):v.createCommentVNode("",!0)])],64)):v.createCommentVNode("",!0)],2)):i.data.type==="indicators"?(v.openBlock(),v.createElementBlock("div",S7,[v.createElementVNode("div",x7,[v.createElementVNode("span",{class:"filter-label",style:v.normalizeStyle({color:i.fontColor})},"筛选规则:",4),v.createElementVNode("div",R7,[v.createVNode(d,{value:i.ruleValue,"onUpdate:value":t[6]||(t[6]=m=>i.ruleValue=m),style:{width:"200px"},placeholder:"请选择",dropdownClassName:"pivot-table-select-dropdown",getPopupContainer:i.getPopupContainer,dropdownStyle:i.dropdownStyle,onDropdownVisibleChange:i.dropdownVisibleChange},{default:v.withCtx(()=>[(v.openBlock(!0),v.createElementBlock(v.Fragment,null,v.renderList(i.ruleOptions,m=>(v.openBlock(),v.createBlock(h,{key:m.value,value:m.value},{default:v.withCtx(()=>[v.createTextVNode(v.toDisplayString(m.label),1)]),_:2},1032,["value"]))),128))]),_:1},8,["value","getPopupContainer","dropdownStyle","onDropdownVisibleChange"])],512)]),v.createElementVNode("div",A7,[v.createElementVNode("span",{class:"filter-label",style:v.normalizeStyle({color:i.fontColor})},"筛选值:",4),v.createVNode(l,{value:i.filterValue,"onUpdate:value":t[7]||(t[7]=m=>i.filterValue=m),placeholder:"请输入",style:{width:"200px"}},null,8,["value"])])])):v.createCommentVNode("",!0)]),_:1},8,["wrapClassName","visible","title","bodyStyle","getContainer","onOk"])}const LT=Ti(p7,[["render",T7],["__scopeId","data-v-947f155b"]]),AX="",M7=v.defineComponent({name:"PivotProperty",props:{},setup(i,{emit:t,expose:e}){const n=v.ref(!1),o=v.ref({unit:"",format:"",floatLength:""}),r=v.ref(),s=v.ref({}),l=v.inject("theme","light"),a=v.inject("scaleValue",{}),h=v.inject("getContainer",()=>{}),d=[{label:"整数",value:"integer"},{label:"小数",value:"float"},{label:"百分比",value:"percent"}];function u(p){o.value=p,n.value=!0}function c(){t("change",v.unref(o)),n.value=!1}const g=()=>document.getElementsByClassName("property-modal")[0]||document.body,f=p=>{var m,b,C;if(p){const _=(m=v.unref(r))==null?void 0:m.getBoundingClientRect();if(_){const w=_.left/(((b=v.unref(a))==null?void 0:b.widthScale)||1)+"px",y=(_.top+_.height)/(((C=v.unref(a))==null?void 0:C.heightScale)||1)+"px";setTimeout(()=>{var R,x;const S=document.querySelectorAll(".ant-select-dropdown"),A=Array.from(S).filter(T=>window.getComputedStyle(T).display!=="none");if(A!=null&&A.length){const T=document.getElementsByClassName("property-modal")[0];A[0].classList.add("property-select-dropdown"),(R=T==null?void 0:T.style)==null||R.setProperty("--drop-down-left",w),(x=T==null?void 0:T.style)==null||x.setProperty("--drop-down-top",y),s.value={visibility:"visible"}}},200)}}else s.value={}};return v.watch(n,p=>{window.modalShow&&window.modalShow(p)}),e({showModal:u}),{theme:l,visible:n,formData:o,handleOk:c,getPopupContainer:g,formatOptions:d,getContainer:h,selectRef:r,dropdownStyle:s,dropdownVisibleChange:f}}}),B7={ref:"selectRef"};function P7(i,t,e,n,o,r){const s=v.resolveComponent("a-input"),l=v.resolveComponent("a-form-item"),a=v.resolveComponent("a-radio-button"),h=v.resolveComponent("a-radio-group"),d=v.resolveComponent("a-select"),u=v.resolveComponent("a-form"),c=v.resolveComponent("a-modal");return v.openBlock(),v.createBlock(c,{wrapClassName:i.theme+" property-modal",visible:i.visible,"onUpdate:visible":t[4]||(t[4]=g=>i.visible=g),"ok-text":"确认","cancel-text":"取消",title:i.formData.fieldName+"-度量属性",destroyOnClose:!1,getContainer:i.getContainer,onOk:i.handleOk},{default:v.withCtx(()=>[v.createVNode(u,null,{default:v.withCtx(()=>[v.createVNode(l,{label:"度量单位"},{default:v.withCtx(()=>[v.createVNode(s,{value:i.formData.unit,"onUpdate:value":t[0]||(t[0]=g=>i.formData.unit=g)},null,8,["value"])]),_:1}),i.formData.unit?(v.openBlock(),v.createBlock(l,{key:0,label:"度量单位位置"},{default:v.withCtx(()=>[v.createVNode(h,{value:i.formData.position,"onUpdate:value":t[1]||(t[1]=g=>i.formData.position=g),"button-style":"solid"},{default:v.withCtx(()=>[v.createVNode(a,{value:"left"},{default:v.withCtx(()=>t[5]||(t[5]=[v.createTextVNode("数据左侧")])),_:1}),v.createVNode(a,{value:"right"},{default:v.withCtx(()=>t[6]||(t[6]=[v.createTextVNode("数据右侧")])),_:1})]),_:1},8,["value"])]),_:1})):v.createCommentVNode("",!0),v.createVNode(l,{label:"格式化"},{default:v.withCtx(()=>[v.createElementVNode("div",B7,[v.createVNode(d,{value:i.formData.format,"onUpdate:value":t[2]||(t[2]=g=>i.formData.format=g),options:i.formatOptions,getPopupContainer:i.getPopupContainer,dropdownStyle:i.dropdownStyle,onDropdownVisibleChange:i.dropdownVisibleChange},null,8,["value","options","getPopupContainer","dropdownStyle","onDropdownVisibleChange"])],512)]),_:1}),["float","percent"].includes(i.formData.format)?(v.openBlock(),v.createBlock(l,{key:1,label:"小数位数"},{default:v.withCtx(()=>[v.createVNode(s,{type:"number",value:i.formData.floatLength,"onUpdate:value":t[3]||(t[3]=g=>i.formData.floatLength=g),min:0},null,8,["value"])]),_:1})):v.createCommentVNode("",!0)]),_:1})]),_:1},8,["wrapClassName","visible","title","getContainer","onOk"])}const H7=Ti(M7,[["render",P7]]);function Vn(i,t){E7(i)&&(i="100%");var e=L7(i);return i=t===360?i:Math.min(t,Math.max(0,parseFloat(i))),e&&(i=parseInt(String(i*t),10)/100),Math.abs(i-t)<1e-6?1:(t===360?i=(i<0?i%t+t:i%t)/parseFloat(String(t)):i=i%t/parseFloat(String(t)),i)}function E7(i){return typeof i=="string"&&i.indexOf(".")!==-1&&parseFloat(i)===1}function L7(i){return typeof i=="string"&&i.indexOf("%")!==-1}function k7(i){return i=parseFloat(i),(isNaN(i)||i<0||i>1)&&(i=1),i}function Ng(i){return i<=1?"".concat(Number(i)*100,"%"):i}function mv(i){return i.length===1?"0"+i:String(i)}function F7(i,t,e){return{r:Vn(i,255)*255,g:Vn(t,255)*255,b:Vn(e,255)*255}}function vv(i,t,e){return e<0&&(e+=1),e>1&&(e-=1),e<1/6?i+(t-i)*(6*e):e<1/2?t:e<2/3?i+(t-i)*(2/3-e)*6:i}function I7(i,t,e){var n,o,r;if(i=Vn(i,360),t=Vn(t,100),e=Vn(e,100),t===0)o=e,r=e,n=e;else{var s=e<.5?e*(1+t):e+t-e*t,l=2*e-s;n=vv(l,s,i+1/3),o=vv(l,s,i),r=vv(l,s,i-1/3)}return{r:n*255,g:o*255,b:r*255}}function D7(i,t,e){i=Vn(i,255),t=Vn(t,255),e=Vn(e,255);var n=Math.max(i,t,e),o=Math.min(i,t,e),r=0,s=n,l=n-o,a=n===0?0:l/n;if(n===o)r=0;else{switch(n){case i:r=(t-e)/l+(t<e?6:0);break;case t:r=(e-i)/l+2;break;case e:r=(i-t)/l+4;break}r/=6}return{h:r,s:a,v:s}}function O7(i,t,e){i=Vn(i,360)*6,t=Vn(t,100),e=Vn(e,100);var n=Math.floor(i),o=i-n,r=e*(1-t),s=e*(1-o*t),l=e*(1-(1-o)*t),a=n%6,h=[e,s,r,r,l,e][a],d=[l,e,e,s,r,r][a],u=[r,r,l,e,e,s][a];return{r:h*255,g:d*255,b:u*255}}function z7(i,t,e,n){var o=[mv(Math.round(i).toString(16)),mv(Math.round(t).toString(16)),mv(Math.round(e).toString(16))];return n&&o[0].startsWith(o[0].charAt(1))&&o[1].startsWith(o[1].charAt(1))&&o[2].startsWith(o[2].charAt(1))?o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0):o.join("")}function kT(i){return _n(i)/255}function _n(i){return parseInt(i,16)}var FT={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function Dh(i){var t={r:0,g:0,b:0},e=1,n=null,o=null,r=null,s=!1,l=!1;return typeof i=="string"&&(i=V7(i)),typeof i=="object"&&(ar(i.r)&&ar(i.g)&&ar(i.b)?(t=F7(i.r,i.g,i.b),s=!0,l=String(i.r).substr(-1)==="%"?"prgb":"rgb"):ar(i.h)&&ar(i.s)&&ar(i.v)?(n=Ng(i.s),o=Ng(i.v),t=O7(i.h,n,o),s=!0,l="hsv"):ar(i.h)&&ar(i.s)&&ar(i.l)&&(n=Ng(i.s),r=Ng(i.l),t=I7(i.h,n,r),s=!0,l="hsl"),Object.prototype.hasOwnProperty.call(i,"a")&&(e=i.a)),e=k7(e),{ok:s,format:i.format||l,r:Math.min(255,Math.max(t.r,0)),g:Math.min(255,Math.max(t.g,0)),b:Math.min(255,Math.max(t.b,0)),a:e}}var W7="[-\\+]?\\d+%?",N7="[-\\+]?\\d*\\.\\d+%?",Wr="(?:".concat(N7,")|(?:").concat(W7,")"),bv="[\\s|\\(]+(".concat(Wr,")[,|\\s]+(").concat(Wr,")[,|\\s]+(").concat(Wr,")\\s*\\)?"),Cv="[\\s|\\(]+(".concat(Wr,")[,|\\s]+(").concat(Wr,")[,|\\s]+(").concat(Wr,")[,|\\s]+(").concat(Wr,")\\s*\\)?"),co={CSS_UNIT:new RegExp(Wr),rgb:new RegExp("rgb"+bv),rgba:new RegExp("rgba"+Cv),hsl:new RegExp("hsl"+bv),hsla:new RegExp("hsla"+Cv),hsv:new RegExp("hsv"+bv),hsva:new RegExp("hsva"+Cv),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/};function V7(i){if(i=i.trim().toLowerCase(),i.length===0)return!1;var t=!1;if(FT[i])i=FT[i],t=!0;else if(i==="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var e=co.rgb.exec(i);return e?{r:e[1],g:e[2],b:e[3]}:(e=co.rgba.exec(i),e?{r:e[1],g:e[2],b:e[3],a:e[4]}:(e=co.hsl.exec(i),e?{h:e[1],s:e[2],l:e[3]}:(e=co.hsla.exec(i),e?{h:e[1],s:e[2],l:e[3],a:e[4]}:(e=co.hsv.exec(i),e?{h:e[1],s:e[2],v:e[3]}:(e=co.hsva.exec(i),e?{h:e[1],s:e[2],v:e[3],a:e[4]}:(e=co.hex8.exec(i),e?{r:_n(e[1]),g:_n(e[2]),b:_n(e[3]),a:kT(e[4]),format:t?"name":"hex8"}:(e=co.hex6.exec(i),e?{r:_n(e[1]),g:_n(e[2]),b:_n(e[3]),format:t?"name":"hex"}:(e=co.hex4.exec(i),e?{r:_n(e[1]+e[1]),g:_n(e[2]+e[2]),b:_n(e[3]+e[3]),a:kT(e[4]+e[4]),format:t?"name":"hex8"}:(e=co.hex3.exec(i),e?{r:_n(e[1]+e[1]),g:_n(e[2]+e[2]),b:_n(e[3]+e[3]),format:t?"name":"hex"}:!1)))))))))}function ar(i){return!!co.CSS_UNIT.exec(String(i))}var Vg=2,IT=.16,j7=.05,$7=.05,G7=.15,DT=5,OT=4,U7=[{index:7,opacity:.15},{index:6,opacity:.25},{index:5,opacity:.3},{index:5,opacity:.45},{index:5,opacity:.65},{index:5,opacity:.85},{index:4,opacity:.9},{index:3,opacity:.95},{index:2,opacity:.97},{index:1,opacity:.98}];function zT(i){var t=i.r,e=i.g,n=i.b,o=D7(t,e,n);return{h:o.h*360,s:o.s,v:o.v}}function jg(i){var t=i.r,e=i.g,n=i.b;return"#".concat(z7(t,e,n,!1))}function K7(i,t,e){var n=e/100,o={r:(t.r-i.r)*n+i.r,g:(t.g-i.g)*n+i.g,b:(t.b-i.b)*n+i.b};return o}function WT(i,t,e){var n;return Math.round(i.h)>=60&&Math.round(i.h)<=240?n=e?Math.round(i.h)-Vg*t:Math.round(i.h)+Vg*t:n=e?Math.round(i.h)+Vg*t:Math.round(i.h)-Vg*t,n<0?n+=360:n>=360&&(n-=360),n}function NT(i,t,e){if(i.h===0&&i.s===0)return i.s;var n;return e?n=i.s-IT*t:t===OT?n=i.s+IT:n=i.s+j7*t,n>1&&(n=1),e&&t===DT&&n>.1&&(n=.1),n<.06&&(n=.06),Number(n.toFixed(2))}function VT(i,t,e){var n;return e?n=i.v+$7*t:n=i.v-G7*t,n>1&&(n=1),Number(n.toFixed(2))}function yv(i){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},e=[],n=Dh(i),o=DT;o>0;o-=1){var r=zT(n),s=jg(Dh({h:WT(r,o,!0),s:NT(r,o,!0),v:VT(r,o,!0)}));e.push(s)}e.push(jg(n));for(var l=1;l<=OT;l+=1){var a=zT(n),h=jg(Dh({h:WT(a,l),s:NT(a,l),v:VT(a,l)}));e.push(h)}return t.theme==="dark"?U7.map(function(d){var u=d.index,c=d.opacity,g=jg(K7(Dh(t.backgroundColor||"#141414"),Dh(e[u]),c*100));return g}):e}var _v={red:"#F5222D",volcano:"#FA541C",orange:"#FA8C16",gold:"#FAAD14",yellow:"#FADB14",lime:"#A0D911",green:"#52C41A",cyan:"#13C2C2",blue:"#1890FF",geekblue:"#2F54EB",purple:"#722ED1",magenta:"#EB2F96",grey:"#666666"},wv={},Sv={};Object.keys(_v).forEach(function(i){wv[i]=yv(_v[i]),wv[i].primary=wv[i][5],Sv[i]=yv(_v[i],{theme:"dark",backgroundColor:"#141414"}),Sv[i].primary=Sv[i][5]});var jT=[],Oh=[],Y7="insert-css: You need to provide a CSS string. Usage: insertCss(cssString[, options]).";function X7(){var i=document.createElement("style");return i.setAttribute("type","text/css"),i}function q7(i,t){if(t=t||{},i===void 0)throw new Error(Y7);var e=t.prepend===!0?"prepend":"append",n=t.container!==void 0?t.container:document.querySelector("head"),o=jT.indexOf(n);o===-1&&(o=jT.push(n)-1,Oh[o]={});var r;return Oh[o]!==void 0&&Oh[o][e]!==void 0?r=Oh[o][e]:(r=Oh[o][e]=X7(),e==="prepend"?n.insertBefore(r,n.childNodes[0]):n.appendChild(r)),i.charCodeAt(0)===65279&&(i=i.substr(1,i.length)),r.styleSheet?r.styleSheet.cssText+=i:r.textContent+=i,r}function $T(i){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?Object(arguments[t]):{},n=Object.keys(e);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(e).filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable}))),n.forEach(function(o){Z7(i,o,e[o])})}return i}function Z7(i,t,e){return t in i?Object.defineProperty(i,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):i[t]=e,i}function J7(i,t){process.env.NODE_ENV!=="production"&&!i&&console!==void 0&&console.error("Warning: ".concat(t))}function Q7(i,t){J7(i,"[@ant-design/icons-vue] ".concat(t))}function GT(i){return typeof i=="object"&&typeof i.name=="string"&&typeof i.theme=="string"&&(typeof i.icon=="object"||typeof i.icon=="function")}function xv(i,t,e){return e?v.h(i.tag,$T({key:t},e,i.attrs),(i.children||[]).map(function(n,o){return xv(n,"".concat(t,"-").concat(i.tag,"-").concat(o))})):v.h(i.tag,$T({key:t},i.attrs),(i.children||[]).map(function(n,o){return xv(n,"".concat(t,"-").concat(i.tag,"-").concat(o))}))}function UT(i){return yv(i)[0]}function KT(i){return i?Array.isArray(i)?i:[i]:[]}var tj=`
|
|
310
310
|
.anticon {
|
|
311
311
|
display: inline-block;
|
|
312
312
|
color: inherit;
|
|
@@ -370,5 +370,5 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
370
370
|
}else{
|
|
371
371
|
return false
|
|
372
372
|
}
|
|
373
|
-
}`;return Function(`"use strict";return (${q})`)().call(this,K)}function DY(V){R.value=!0;const{value:K,key:q}=V;v.unref(x)[q]=K,gY(),ln({type:"6",data:{key:q,value:K}})}function Xl(){return n==null?void 0:n.getDrawRange()}const gf=v.ref([]),xB=v.ref(""),RB=v.ref(),OY=(V,K)=>{var Ie,ci,Po,Ho,xn;const q=K.dataViewColumns[V.oldIndex]||{},{scope:rt}=q;let Z=!1,tt=!1;["IDX","BUILT_IN_IDX"].includes(rt)?Z=!0:["DIM","BUILT_IN_DIM"].includes(rt)&&(tt=!0);const it=Xl(),{rows:pt,columns:Pt,indicators:Kt,records:It}=J,{top:kt,left:Ft}=it;if(v.unref(_e)){let pi=i.height;i.isIframeMode&&(pi=document.body.clientHeight+"px");let Ne=v.unref(Oe).width;Ne.includes("calc")&&(Ne=v.unref(yt)-v.unref(E)+"px"),k.value.main={width:Ne,height:pi,top:kt+v.unref(Lt)+"px",left:Ft+v.unref(be)+v.unref(Lt)+v.unref(j)+"px"},k.value.rows={width:parseFloat(Ne)/2-Ot*2+"px",height:parseFloat(pi)-Ot*2+"px",top:0,left:0},k.value.columns={width:parseFloat(Ne)/2-Ot*2+"px",height:parseFloat(pi)/3-Ot*2+"px",top:0,left:parseFloat(Ne)/2+"px"},k.value.indicators={width:parseFloat(Ne)/2-Ot*2+"px",height:parseFloat(pi)*2/3-Ot*2+"px",top:parseFloat(pi)/3+"px",left:parseFloat(Ne)/2+"px"}}else{let pi=50;(Ie=v.unref(Tt))!=null&&Ie.length?pi=v.unref($).clientHeight:tt&&(U.value=!0,v.unref(ie).height=pi+"px");let Ne=0,ur=1;const jt=n.getRowHeight(0),se={columnHeaderTitle:!0};if(Pt!=null&&Pt.length?ur+=Pt.length:se.columns=[{dimensionKey:Es(6),title:"",width:"100px",type:"columns"}],pt!=null&&pt.length?pt.forEach((Ze,Ge)=>{Ne+=n.getColWidth(Ge)}):(Ne=100,se.rows=[{dimensionKey:Es(6),title:"",width:"100px",type:"rows"}]),Kt!=null&&Kt.length||(se.indicators=[{indicatorKey:Es(6),title:"",width:"20%",format:()=>""}]),(ci=Object.keys(se))!=null&&ci.length){const{rows:Ze=[],columns:Ge=[]}=se;let ze=[];It!=null&&It.length?ze=Ye.cloneDeep(It):(Ho=(Po=v.unref(O))==null?void 0:Po.records)!=null&&Ho.length&&(ze=Ye.cloneDeep((xn=v.unref(O))==null?void 0:xn.records));let Fi=Pt.map(Rn=>Rn.dimensionKey);if(!(Fi!=null&&Fi.length)&&(Ge!=null&&Ge.length)&&(Fi=[Ge[0].dimensionKey]),ze!=null&&ze.length)for(const Rn of ze){for(const Zh of Ze)Rn[Zh.dimensionKey]="";let qh=!1;for(const Zh in Rn)if(Fi.includes(Zh)){qh=!0;break}tt?qh||(ur=2,Rn[Fi[0]]=""):Z&&(qh||(ur=1))}n.updateOption({...J,...se,records:ze})}v.nextTick(()=>{var Fi;const Ze=Xl(),Ge=Ze.width,ze=Ze.height;k.value.main={width:Ge+"px",height:ze+pi+"px",top:kt+v.unref(Lt)+"px",left:Ft+v.unref(be)+v.unref(Lt)+v.unref(j)+"px"},k.value.rows={width:Ne-Ot*2+"px",height:ze-Ot*2+"px",top:pi+"px",left:0},k.value.columns={width:Ge-Ne-Ot*2+"px",height:ur*jt-Ot*2+"px",top:pi+"px",left:Ne+"px"},k.value.indicators={width:Ge-Ne-Ot*2+"px",height:ze-ur*jt-Ot*2+"px",top:ur*jt+((Fi=v.unref(Tt))!=null&&Fi.length?pi:0)+"px",left:Ne+"px"},k.value.filters={width:Ge-Ot*2+"px",height:pi-Ot*2+"px",top:0,left:0}})}I.value=q,Z?gf.value=[0,1]:tt&&(gf.value=[2])},zY=()=>{var V;(V=v.unref(O).records)!=null&&V.length?n.updateOption({...J,records:v.unref(O).records}):n.updateOption(J),U.value=!1,v.unref(ie).height="",gf.value=[]},WY=()=>{var V;(V=v.unref(RB))==null||V.handleSearch(v.unref(xB))},AB=v.computed(()=>({defaultSortRule:r.value,dimensionData:s.value,currentClickCell:l.value,dimFilterData:a.value,indFilterData:h.value,filterData:d.value,indFilterConfig:c.value,topNumData:x.value,sortData:T.value,colSortData:M.value,indSortData:B.value,aggregateMap:P.value,subMenuLeft:F.value,subMenuTop:H.value,dragAreaStyle:k.value,showTreeData:L.value,largeVisible:D.value,temporaryData:O.value,splitSymbol:ot,sourceListStyle:ut.value,dimensionFieldList:Ht.value,indicatorFieldList:Et.value,computedIndKeys:Nt.value,computedIndMap:te.value,computedIndFieldMap:ae.value,option:J,loadingRect:Se.value,calculateList:qe.value,filterList:Kn.value,topNumMap:Vr.value,sortMap:Sn.value,customDimensions:ks.value,customIndicators:Ul.value,customRowKeys:Kl.value,customColKeys:Yl.value,cacheResData:Y.value,toolBoxStyle:jr.value,scrollTop:N.value,scrollLeft:W.value}));let fb=null;v.watch(AB,V=>{i.isIframeMode&&window.cacheTableData&&window.cacheTableData(V)},{deep:!0});function ln({type:V,data:K}){e("tableChange",{type:V,data:K}),!(!i.isAllowSaveConfig||["5"].includes(V))&&(fb&&clearTimeout(fb),fb=setTimeout(()=>{ab("save",{keyName:i.relateKeyName||i.keyName,data:v.unref(AB)})},500))}const pb=V=>{r.value=V.defaultSortRule,s.value=V.dimensionData,l.value=V.currentClickCell,a.value=V.dimFilterData,h.value=V.indFilterData,d.value=V.filterData,c.value=V.indFilterConfig,x.value=V.topNumData,T.value=V.sortData,M.value=V.colSortData,B.value=V.indSortData,P.value=V.aggregateMap,F.value=V.subMenuLeft,H.value=V.subMenuTop,k.value=V.dragAreaStyle,L.value=V.showTreeData,D.value=V.largeVisible,O.value=V.temporaryData,ot=V.splitSymbol,ut.value=V.sourceListStyle,Ht.value=V.dimensionFieldList,Et.value=V.indicatorFieldList,Nt.value=V.computedIndKeys,te.value=V.computedIndMap,ae.value=V.computedIndFieldMap,Se.value=V.loadingRect,qe.value=V.calculateList,Kn.value=V.filterList,Vr.value=V.topNumMap,Sn.value=V.sortMap,ks.value=V.customDimensions,Ul.value=V.customIndicators,Kl.value=V.customRowKeys,Yl.value=V.customColKeys,Y.value=V.cacheResData,jr.value=V.toolBoxStyle,N.value=V.scrollTop,W.value=V.scrollLeft,Object.assign(J,V.option),J.theme=Jt};async function NY(V){var K,q,rt;if(R.value=!0,V)pb(V);else if(i.isAllowSaveConfig){const Z=await ab("get",{keyName:i.relateKeyName||i.keyName}),tt=((q=(K=Z==null?void 0:Z.data)==null?void 0:K.data)==null?void 0:q.searchMap)||{};tt!=null&&tt.data&&!Array.isArray(tt.data)&&((rt=Object.keys(tt.data))!=null&&rt.length)&&pb(tt.data)}dr()}function VY(){return{dimensions:v.unref(Ht),indicators:v.unref(Et)}}const jY=V=>{const{scope:K,name:q,label:rt}=V;let Z=[];["IDX","BUILT_IN_IDX"].includes(K)?Z=v.unref(Et):["DIM","BUILT_IN_DIM"].includes(K)&&(Z=v.unref(Ht));const tt=Z.findIndex(it=>it.name===q);if(tt!==-1){delete v.unref(a)[Z[tt].label];const it=v.unref(Kn).findIndex(pt=>pt.key===rt);it!==-1&&v.unref(Kn).splice(it,1),Z[tt].show?Z[tt].isInnerFilter=!1:Z.splice(tt,1)}R.value=!0,Xh(),ln({type:"10",data:{dimensions:v.unref(Ht),indicators:v.unref(Et)}})},$Y=V=>{const{scope:K,label:q,showTitle:rt}=V,Z=Y2(K);Z==="indicator"||Z==="dimension"&&_B({dimensionKey:q,value:rt})};t({option:J,refreshData:NY,reRenderTable:pb,click:wB,getDrawRange:Xl,getSaveData:VY}),v.watch(()=>[i.graphicConfig,i.dimensionList,i.indicatorList],()=>{TB()},{immediate:!0,deep:!0});function TB(){const{queryColumnList:V=[],indicators:K=[]}=i.graphicConfig,q=Ye.cloneDeep(V),rt=Ye.cloneDeep(K);for(const Z of q){const tt=i.dimensionList.find(it=>it.key===Z.name);Z.positionType=(tt==null?void 0:tt.position)||"rows",Z.width=tt==null?void 0:tt.width,Z.showTitle=Z.title||Z.label}for(const Z of rt){const tt=i.indicatorList.find(it=>it.key===Z.name);Z.width=tt==null?void 0:tt.width,Z.showTitle=Z.label}Ht.value=q,Et.value=rt}const GY=()=>{o.value=!1,L.value=!L.value},UY=()=>{o.value=!1,D.value=!D.value,window.enScale&&window.enScale(v.unref(D))},KY=V=>{const K=v.unref(Ht).find(tt=>tt.label===V),q=v.unref(Et).find(tt=>tt.label===V),rt=K||q,Z=v.unref(a)[V];return Z?rt.genericType==="DATE"?Array.isArray(Z)?`${Z[0].value}~${Z[1].value}`:Z.value:Z.value&&Array.isArray(Z.value)?Z.value.join("、"):"":""},YY=V=>V.parentNode;return v.onMounted(()=>{Zt()}),{showDefaultTableArea:_e,maskList:gf,styleData:mt,subMenuLeft:F,subMenuTop:H,pivotWrapRef:S,pivotTableRef:_,pivotFilterRef:u,pivotPropertyRef:g,conditionalPropertyRef:f,chartModalRef:C,pivotTopRef:m,pivotConfigRef:b,drillModalRef:y,pivotAggregateRef:p,filterData:d,loadingRect:Se,loading:R,isTableInit:o,toolBoxStyle:jr,indSourceRef:RB,searchText:xB,dragAreaStyle:k,offsetWidth:be,showTreeData:L,dataIconStyle:He,largeVisible:D,sourceListStyle:ut,defaultTableStyle:Oe,innerFilterStyle:ie,innerFilterFieldList:Tt,innerFilterRef:$,showFilterWrap:U,customDimensions:ks,indicatorFieldList:Et,dimensionFieldList:Ht,pivotWrapStyle:A,fontSize:ht,click:wB,onFilterChange:FY,pivotDetailRef:w,handleFormat:SB,handleCondition:IY,handleAggregate:mY,handleGetTop:DY,handleConfig:PY,handleClearFilter:HY,handleGetConfig:EY,onDragStart:OY,onDragEnd:zY,onSearch:WY,handleAddField:LY,toggleShowData:GY,handleEnScale:UY,adjustHSL:PC,handleDelFilterTag:jY,handleInnerFilter:$Y,getFilterValue:KY,getPopupContainer:YY}}}),XK={key:0,class:"design-template"},qK=["id"],ZK=["onClick"],JK=["title"],QK=["id"],tY={class:"box-tooltip"},eY={class:"box-tooltip"};function iY(i,t,e,n,o,r){var M,B;const s=v.resolveComponent("a-input-search"),l=v.resolveComponent("ind-source-list"),a=v.resolveComponent("filter-outlined"),h=v.resolveComponent("delete-outlined"),d=v.resolveComponent("a-tooltip"),u=v.resolveComponent("a-spin"),c=v.resolveComponent("database-outlined"),g=v.resolveComponent("shrink-outlined"),f=v.resolveComponent("arrows-alt-outlined"),p=v.resolveComponent("setting-outlined"),m=v.resolveComponent("clear-outlined"),b=v.resolveComponent("drag-area"),C=v.resolveComponent("pivot-filter"),_=v.resolveComponent("pivot-property"),w=v.resolveComponent("conditional-property"),y=v.resolveComponent("chart-modal"),S=v.resolveComponent("pivot-aggregate"),A=v.resolveComponent("pivot-top"),R=v.resolveComponent("pivot-detail"),x=v.resolveComponent("pivot-config"),T=v.resolveComponent("drill-modal");return i.pageMode==="design"?(v.openBlock(),v.createElementBlock("div",XK," 透视表格 ")):(v.openBlock(),v.createBlock(v.Teleport,{key:1,to:i.enlargeContainer,disabled:!i.largeVisible},[v.createElementVNode("div",{class:v.normalizeClass(["pivot-wrap",[i.largeVisible?"large":"",i.theme]]),style:v.normalizeStyle(i.pivotWrapStyle),id:`pivotWrap_${i.id}`,ref:"pivotWrapRef"},[i.fullMode?v.withDirectives((v.openBlock(),v.createElementBlock("div",{key:0,class:"data-source-list",style:v.normalizeStyle(i.sourceListStyle)},[v.createVNode(s,{value:i.searchText,"onUpdate:value":t[0]||(t[0]=P=>i.searchText=P),placeholder:"请输入关键字",onSearch:i.onSearch},null,8,["value","onSearch"]),v.createVNode(l,{ref:"indSourceRef",hasChildren:!0,isSub:!1,onOnDragStart:i.onDragStart,onOnDragEnd:i.onDragEnd,config:i.graphicConfig},null,8,["onOnDragStart","onOnDragEnd","config"])],4)),[[v.vShow,i.showTreeData]]):v.createCommentVNode("",!0),v.createElementVNode("div",{style:v.normalizeStyle({width:i.offsetWidth?`calc(100% - ${i.offsetWidth}px)`:"100%"})},[i.isTableInit&&(!i.showDefaultTableArea&&((M=i.innerFilterFieldList)!=null&&M.length)||i.showFilterWrap)?(v.openBlock(),v.createElementBlock("div",{key:0,class:"inner-filter-wrap",style:v.normalizeStyle(i.innerFilterStyle),ref:"innerFilterRef"},[(v.openBlock(!0),v.createElementBlock(v.Fragment,null,v.renderList(i.innerFilterFieldList,P=>(v.openBlock(),v.createElementBlock("div",{key:P.name,class:"filter-tag",style:v.normalizeStyle({backgroundColor:i.adjustHSL(i.styleData.headerBgColor,-4)}),onClick:F=>i.handleInnerFilter(P)},[v.createElementVNode("div",{class:"tag-text",style:v.normalizeStyle({color:i.styleData.headerColor})},v.toDisplayString(P.showTitle),5),i.getFilterValue(P.label)?(v.openBlock(),v.createElementBlock("div",{key:0,class:"filter-value",style:v.normalizeStyle({color:i.adjustHSL(i.styleData.headerColor,8)}),title:i.getFilterValue(P.label)},v.toDisplayString(i.getFilterValue(P.label)),13,JK)):v.createCommentVNode("",!0),v.createElementVNode("span",{class:v.normalizeClass(i.fullMode?"hover-icon-wrap":"")},[v.createVNode(a,{class:"filter-icon",style:v.normalizeStyle({fontSize:i.fontSize+"px",color:i.styleData.headerColor})},null,8,["style"]),v.createVNode(d,{placement:"bottom"},{title:v.withCtx(()=>t[5]||(t[5]=[v.createElementVNode("span",null,"删除",-1)])),default:v.withCtx(()=>[v.createVNode(h,{class:"delete-icon",style:v.normalizeStyle({fontSize:i.fontSize+"px",color:i.styleData.headerColor}),onClick:v.withModifiers(F=>i.handleDelFilterTag(P),["stop"])},null,8,["style","onClick"])]),_:2},1024)],2)],12,ZK))),128))],4)):v.createCommentVNode("",!0),i.isTableInit&&i.showDefaultTableArea?(v.openBlock(),v.createElementBlock("div",{key:1,class:"empty-table",style:v.normalizeStyle(i.defaultTableStyle)}," 拖拽左侧数据源到此处 ",4)):v.createCommentVNode("",!0),v.withDirectives(v.createElementVNode("div",{class:"table-instance",style:{width:"100%"},id:i.pageMode!=="design"?`pivotTableContainer_${i.id}`:"",ref:"pivotTableRef"},null,8,QK),[[v.vShow,!i.showDefaultTableArea]])],4),i.loading?(v.openBlock(),v.createElementBlock("div",{key:1,class:"pivot-loading",style:v.normalizeStyle(i.loadingRect)},[v.createVNode(u,{size:"large",style:v.normalizeStyle({scale:i.scaleValue.widthScale})},null,8,["style"])],4)):v.createCommentVNode("",!0),i.pageMode!=="design"&&!i.graphicConfig.preview&&i.isTableInit&&!i.maskList.length&&!i.showDefaultTableArea?(v.openBlock(),v.createElementBlock("div",{key:2,class:"tool-box",style:v.normalizeStyle(i.toolBoxStyle)},[i.fullMode?(v.openBlock(),v.createBlock(d,{key:0,getPopupContainer:i.getPopupContainer},{title:v.withCtx(()=>[v.createElementVNode("span",tY,v.toDisplayString(i.showTreeData?"隐藏数据源":"显示数据源"),1)]),default:v.withCtx(()=>[v.createElementVNode("div",{class:v.normalizeClass(["box-item pivot-data",i.theme]),onClick:t[1]||(t[1]=(...P)=>i.toggleShowData&&i.toggleShowData(...P))},[v.createVNode(c,{style:v.normalizeStyle(i.dataIconStyle)},null,8,["style"])],2)]),_:1},8,["getPopupContainer"])):v.createCommentVNode("",!0),v.createVNode(d,{getPopupContainer:i.getPopupContainer},{title:v.withCtx(()=>[v.createElementVNode("span",eY,v.toDisplayString(i.largeVisible?"缩小":"放大"),1)]),default:v.withCtx(()=>[i.showFullScreen?(v.openBlock(),v.createElementBlock("div",{key:0,class:v.normalizeClass(["box-item pivot-large",i.theme]),onClick:t[2]||(t[2]=(...P)=>i.handleEnScale&&i.handleEnScale(...P))},[i.largeVisible?(v.openBlock(),v.createBlock(g,{key:0,style:v.normalizeStyle({fontSize:i.fontSize+"px",color:"#416EFF"})},null,8,["style"])):(v.openBlock(),v.createBlock(f,{key:1,style:v.normalizeStyle({fontSize:i.fontSize+"px"})},null,8,["style"]))],2)):v.createCommentVNode("",!0)]),_:1},8,["getPopupContainer"]),v.createVNode(d,{getPopupContainer:i.getPopupContainer},{title:v.withCtx(()=>t[6]||(t[6]=[v.createElementVNode("span",{class:"box-tooltip"},"设置",-1)])),default:v.withCtx(()=>[v.createElementVNode("div",{class:v.normalizeClass(["box-item pivot-config",i.theme]),onClick:t[3]||(t[3]=(...P)=>i.handleConfig&&i.handleConfig(...P))},[v.createVNode(p,{style:v.normalizeStyle({fontSize:i.fontSize+"px"})},null,8,["style"])],2)]),_:1},8,["getPopupContainer"]),v.createVNode(d,{getPopupContainer:i.getPopupContainer},{title:v.withCtx(()=>t[7]||(t[7]=[v.createElementVNode("span",{class:"box-tooltip"},"清空状态",-1)])),default:v.withCtx(()=>[i.showClear?(v.openBlock(),v.createElementBlock("div",{key:0,class:v.normalizeClass(["box-item pivot-config",i.theme]),onClick:t[4]||(t[4]=(...P)=>i.handleClearFilter&&i.handleClearFilter(...P))},[v.createVNode(m,{style:v.normalizeStyle({fontSize:i.fontSize+"px"})},null,8,["style"])],2)):v.createCommentVNode("",!0)]),_:1},8,["getPopupContainer"])],4)):v.createCommentVNode("",!0),(B=i.maskList)!=null&&B.length?(v.openBlock(),v.createBlock(b,{key:3,style:v.normalizeStyle(i.dragAreaStyle),maskList:i.maskList,onAdd:i.handleAddField},null,8,["style","maskList","onAdd"])):v.createCommentVNode("",!0)],14,qK),v.createVNode(C,{ref:"pivotFilterRef",data:i.filterData,customDimensions:i.customDimensions,dimensions:i.dimensionFieldList,indicators:i.indicatorFieldList,onChange:i.onFilterChange},null,8,["data","customDimensions","dimensions","indicators","onChange"]),v.createVNode(_,{ref:"pivotPropertyRef",onChange:i.handleFormat},null,8,["onChange"]),v.createVNode(w,{ref:"conditionalPropertyRef",onChange:i.handleCondition},null,8,["onChange"]),v.createVNode(y,{ref:"chartModalRef"},null,512),v.createVNode(S,{ref:"pivotAggregateRef",onConfirm:i.handleAggregate},null,8,["onConfirm"]),v.createVNode(A,{ref:"pivotTopRef",onConfirm:i.handleGetTop},null,8,["onConfirm"]),v.createVNode(R,{ref:"pivotDetailRef"},null,512),v.createVNode(x,{ref:"pivotConfigRef",fullMode:i.fullMode,onConfirm:i.handleGetConfig},null,8,["fullMode","onConfirm"]),v.createVNode(T,{ref:"drillModalRef",scaleValue:i.scaleValue,isIframeMode:i.isIframeMode},null,8,["scaleValue","isIframeMode"])],8,["to","disabled"]))}const lb=kB(Ti(YK,[["render",iY],["__scopeId","data-v-6c4da1ce"]])),dB=Object.freeze(Object.defineProperty({__proto__:null,EcanPivotTable:lb},Symbol.toStringTag,{value:"Module"})),nY={install:(i,t)=>{const{request:e}=t;i.provide("$request",e),Object.keys(dB).forEach(n=>{const o=dB[n];o.install&&i.use(o)})}},VX="",jX="",oY=v.defineComponent({name:"DrillModal",props:{scaleValue:{type:Object,default:()=>({widthScale:1,heightScale:1})},isIframeMode:{type:Boolean,default:!1}},components:{BorderOutlined:Bj,SwitcherOutlined:V$,CloseOutlined:Gj,EcanPivotTable:lb},setup(i,{expose:t}){const e={IN:"属于",NOT_IN:"不属于",LIKE:"包含",NOT_LIKE:"不包含","LIKE%":"开头是","%LIKE":"结尾是",EQUAL:"等于",LESS:"小于",LESS_EQUAL:"小于等于",GREATER:"大于",GREATER_EQUAL:"大于等于",NOT_EQUAL:"不等于"},n=.37,o=.6,r=.97,s=.9,l=`dmodal_${Es(6)}`,a=()=>document.querySelector("#ProviderConfig > #container")||document.body,h=v.inject("theme","light"),d=v.ref({}),u=v.ref([]),c=v.inject("indicatorUrl",""),g=v.ref([]),f=v.ref(!1),p=v.ref({}),m=v.reactive({keyName:"",visible:!1,columns:[],title:""}),b=v.ref([]),C=v.ref(),_=v.computed(()=>{let B=`drill-modal ${l}`;return f.value&&(B+=" full"),v.unref(h)&&(B+=` ${v.unref(h)}`),B}),w=B=>{const P=document.querySelector(`.${l} .ant-modal-header`);if(P)if(B)P.addEventListener("mousedown",S);else{const F=P.parentElement;F&&(F.style.left="",F.style.top=""),P.removeEventListener("mousedown",S)}},y=B=>{const P=document.querySelector(`.${l} .ant-modal-header`);P&&(B?P.addEventListener("dblclick",A):P.removeEventListener("dblclick",A))},S=B=>{X2(B,`.${l} .ant-modal-header`)},A=()=>{f.value=!f.value,v.nextTick(()=>{f.value?(v.unref(p).width=parseFloat(v.unref(d).width)*r+"px",v.unref(p).height=(i.isIframeMode?parseFloat(v.unref(d).height):window.screen.height)*s+"px",w(!1)):(v.unref(p).width=parseFloat(v.unref(d).width)*n+"px",v.unref(p).height=(i.isIframeMode?parseFloat(v.unref(d).height):window.screen.height)*o+"px",w(!0))})},R=()=>{f.value=!1,y(!1),w(!1)},x=({drillDimension:B,drillFieldData:P,usedDimensionFields:F,tableProps:H,splitSymbol:E})=>{const k=Ye.cloneDeep(H),{graphicConfig:I,allDimensions:L,pageConfig:D}=k,O=Es(6),N=[];b.value=[...F,B.label],L.value=L,D.value=D;const W=I.indicators.filter($=>$.show).map($=>$.label);W!=null&&W.length&&(m.title=`下钻:${W.join("、")}`);for(const $ of P){const U=L.find(G=>[G.title,G.label].includes($.dimensionKey)),Y=$.value.split(E);let j=$.value;Y!=null&&Y.length&&(j=Y[Y.length-1]),N.push({conditionKey:U.label,conditionLabel:U.title||U.label,conditionName:U.name,conditionValueType:U.genericType,indexCode:U.indexCode,typeGuid:U.typeGuid,indexCodeNum:U.indexCodeNum,rule:"EQUAL",dataType:"",customValue:j})}I.queryColumnList=[B],N!=null&&N.length&&(I.controlList||(I.controlList=[]),I.controlList.push(...N),I.controlList=[{join:"&&",conditions:I.controlList}]),p.value={...k,id:O,keyName:`透视表_${O}`,position:"relative",top:0,left:0,width:parseFloat(v.unref(D).width)*n+"px",height:(i.isIframeMode?parseFloat(v.unref(D).height):window.screen.height)*o+"px",graphicConfig:I},m.visible=!0,v.nextTick(()=>{v.unref(C).refreshData(),y(!0),w(!0)})},T=({type:B,data:P})=>{if(B==="11"&&P){const{indicatorList:F=[],queryColumns:H=[]}=P,k=F.concat(H).filter(D=>D.conditions||D.filter),I=M(k,"conditions",!0),L=M(P.sqlConditions,"sqlConditions",!1);g.value=I.concat(L).map(D=>{const O=v.unref(u).find(W=>W.label===D.label);let N=D.fieldValue;if(N&&typeof N=="string"){const W=N.split(",");(W==null?void 0:W.length)>3&&(N=W.slice(0,3).join(",")+"等")}else N||(N='""');return`${(O==null?void 0:O.title)||D.label} ${e[D.rule]} ${N}`})||[]}};function M(B,P,F){const H=[];for(const E of B)E[P]?H.push(...M(E[P],P,F)):E.filter?H.push({...E.filter,label:E.label}):(!F||E.dataType!=="component"&&!(E.fieldValue.startsWith("${")&&E.fieldValue.endsWith("}")))&&H.push(E);return H}return v.watch(m.visible,B=>{window.modalShow&&window.modalShow(B)}),t({showModal:x}),{theme:h,wrapClassName:_,conditionInfo:g,drillInfo:m,pivotTableConfig:p,indicatorUrl:c,isIndFullScreen:f,usedDimensionFields:b,pivotTableRef:C,toggleFullScreen:A,onDetailCancel:R,onPivotTableChange:T,getContainer:a}}}),rY=["title"];function sY(i,t,e,n,o,r){const s=v.resolveComponent("close-outlined"),l=v.resolveComponent("switcher-outlined"),a=v.resolveComponent("border-outlined"),h=v.resolveComponent("ecan-pivot-table"),d=v.resolveComponent("a-modal");return v.openBlock(),v.createBlock(d,{"wrap-class-name":i.wrapClassName,visible:i.drillInfo.visible,"onUpdate:visible":t[1]||(t[1]=u=>i.drillInfo.visible=u),width:"60%",footer:null,maskClosable:!1,destroyOnClose:!0,getContainer:i.getContainer,onCancel:i.onDetailCancel},{title:v.withCtx(()=>[v.createElementVNode("div",{class:"modal-title",title:i.conditionInfo.join("、")},v.toDisplayString(i.drillInfo.title)+" "+v.toDisplayString(i.conditionInfo.join("、")),9,rY)]),closeIcon:v.withCtx(()=>[v.createVNode(s,{class:v.normalizeClass(["modal-icon",i.theme])},null,8,["class"])]),default:v.withCtx(()=>[v.createElementVNode("div",{class:"zoom-btn",onClick:t[0]||(t[0]=(...u)=>i.toggleFullScreen&&i.toggleFullScreen(...u))},[i.isIndFullScreen?(v.openBlock(),v.createBlock(l,{key:0,class:v.normalizeClass(["modal-icon",i.theme])},null,8,["class"])):(v.openBlock(),v.createBlock(a,{key:1,class:v.normalizeClass(["modal-icon",i.theme])},null,8,["class"]))]),i.drillInfo.visible?(v.openBlock(),v.createElementBlock("div",{key:0,style:v.normalizeStyle({position:"relative",width:i.pivotTableConfig.width,height:i.pivotTableConfig.height})},[v.createVNode(h,v.mergeProps({ref:"pivotTableRef"},i.pivotTableConfig,{theme:i.theme,fullMode:!1,allowDrill:!0,showFullScreen:!1,showClear:!1,isAllowSaveConfig:!1,indicatorUrl:i.indicatorUrl,relateKeyName:i.drillInfo.keyName,usedDimensionFields:i.usedDimensionFields,scaleValue:i.scaleValue,onTableChange:i.onPivotTableChange}),null,16,["theme","indicatorUrl","relateKeyName","usedDimensionFields","scaleValue","onTableChange"])],4)):v.createCommentVNode("",!0)]),_:1},8,["wrap-class-name","visible","getContainer","onCancel"])}const lY=Object.freeze(Object.defineProperty({__proto__:null,default:Ti(oY,[["render",sY],["__scopeId","data-v-412e66d4"]])},Symbol.toStringTag,{value:"Module"}));Je.EcanPivotTable=lb,Je.default=nY,Object.defineProperties(Je,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
373
|
+
}`;return Function(`"use strict";return (${q})`)().call(this,K)}function DY(V){R.value=!0;const{value:K,key:q}=V;v.unref(x)[q]=K,gY(),ln({type:"6",data:{key:q,value:K}})}function Xl(){return n==null?void 0:n.getDrawRange()}const gf=v.ref([]),xB=v.ref(""),RB=v.ref(),OY=(V,K)=>{var Ie,ci,Po,Ho,xn;const q=K.dataViewColumns[V.oldIndex]||{},{scope:rt}=q;let Z=!1,tt=!1;["IDX","BUILT_IN_IDX"].includes(rt)?Z=!0:["DIM","BUILT_IN_DIM"].includes(rt)&&(tt=!0);const it=Xl(),{rows:pt,columns:Pt,indicators:Kt,records:It}=J,{top:kt,left:Ft}=it;if(v.unref(_e)){let pi=i.height;i.isIframeMode&&(pi=document.body.clientHeight+"px");let Ne=v.unref(Oe).width;Ne.includes("calc")&&(Ne=v.unref(yt)-v.unref(E)+"px"),k.value.main={width:Ne,height:pi,top:kt+v.unref(Lt)+"px",left:Ft+v.unref(be)+v.unref(Lt)+v.unref(j)+"px"},k.value.rows={width:parseFloat(Ne)/2-Ot*2+"px",height:parseFloat(pi)-Ot*2+"px",top:0,left:0},k.value.columns={width:parseFloat(Ne)/2-Ot*2+"px",height:parseFloat(pi)/3-Ot*2+"px",top:0,left:parseFloat(Ne)/2+"px"},k.value.indicators={width:parseFloat(Ne)/2-Ot*2+"px",height:parseFloat(pi)*2/3-Ot*2+"px",top:parseFloat(pi)/3+"px",left:parseFloat(Ne)/2+"px"}}else{let pi=50;(Ie=v.unref(Tt))!=null&&Ie.length?pi=v.unref($).clientHeight:tt&&(U.value=!0,v.unref(ie).height=pi+"px");let Ne=0,ur=1;const jt=n.getRowHeight(0),se={columnHeaderTitle:!0};if(Pt!=null&&Pt.length?ur+=Pt.length:se.columns=[{dimensionKey:Es(6),title:"",width:"100px",type:"columns"}],pt!=null&&pt.length?pt.forEach((Ze,Ge)=>{Ne+=n.getColWidth(Ge)}):(Ne=100,se.rows=[{dimensionKey:Es(6),title:"",width:"100px",type:"rows"}]),Kt!=null&&Kt.length||(se.indicators=[{indicatorKey:Es(6),title:"",width:"20%",format:()=>""}]),(ci=Object.keys(se))!=null&&ci.length){const{rows:Ze=[],columns:Ge=[]}=se;let ze=[];It!=null&&It.length?ze=Ye.cloneDeep(It):(Ho=(Po=v.unref(O))==null?void 0:Po.records)!=null&&Ho.length&&(ze=Ye.cloneDeep((xn=v.unref(O))==null?void 0:xn.records));let Fi=Pt.map(Rn=>Rn.dimensionKey);if(!(Fi!=null&&Fi.length)&&(Ge!=null&&Ge.length)&&(Fi=[Ge[0].dimensionKey]),ze!=null&&ze.length)for(const Rn of ze){for(const Zh of Ze)Rn[Zh.dimensionKey]="";let qh=!1;for(const Zh in Rn)if(Fi.includes(Zh)){qh=!0;break}tt?qh||(ur=2,Rn[Fi[0]]=""):Z&&(qh||(ur=1))}n.updateOption({...J,...se,records:ze})}v.nextTick(()=>{var Fi;const Ze=Xl(),Ge=Ze.width,ze=Ze.height;k.value.main={width:Ge+"px",height:ze+pi+"px",top:kt+v.unref(Lt)+"px",left:Ft+v.unref(be)+v.unref(Lt)+v.unref(j)+"px"},k.value.rows={width:Ne-Ot*2+"px",height:ze-Ot*2+"px",top:pi+"px",left:0},k.value.columns={width:Ge-Ne-Ot*2+"px",height:ur*jt-Ot*2+"px",top:pi+"px",left:Ne+"px"},k.value.indicators={width:Ge-Ne-Ot*2+"px",height:ze-ur*jt-Ot*2+"px",top:ur*jt+((Fi=v.unref(Tt))!=null&&Fi.length?pi:0)+"px",left:Ne+"px"},k.value.filters={width:Ge-Ot*2+"px",height:pi-Ot*2+"px",top:0,left:0}})}I.value=q,Z?gf.value=[0,1]:tt&&(gf.value=[2])},zY=()=>{var V;(V=v.unref(O).records)!=null&&V.length?n.updateOption({...J,records:v.unref(O).records}):n.updateOption(J),U.value=!1,v.unref(ie).height="",gf.value=[]},WY=()=>{var V;(V=v.unref(RB))==null||V.handleSearch(v.unref(xB))},AB=v.computed(()=>({defaultSortRule:r.value,dimensionData:s.value,currentClickCell:l.value,dimFilterData:a.value,indFilterData:h.value,filterData:d.value,indFilterConfig:c.value,topNumData:x.value,sortData:T.value,colSortData:M.value,indSortData:B.value,aggregateMap:P.value,subMenuLeft:F.value,subMenuTop:H.value,dragAreaStyle:k.value,showTreeData:L.value,largeVisible:D.value,temporaryData:O.value,splitSymbol:ot,sourceListStyle:ut.value,dimensionFieldList:Ht.value,indicatorFieldList:Et.value,computedIndKeys:Nt.value,computedIndMap:te.value,computedIndFieldMap:ae.value,option:J,loadingRect:Se.value,calculateList:qe.value,filterList:Kn.value,topNumMap:Vr.value,sortMap:Sn.value,customDimensions:ks.value,customIndicators:Ul.value,customRowKeys:Kl.value,customColKeys:Yl.value,cacheResData:Y.value,toolBoxStyle:jr.value,scrollTop:N.value,scrollLeft:W.value}));let fb=null;v.watch(AB,V=>{i.isIframeMode&&window.cacheTableData&&window.cacheTableData(V)},{deep:!0});function ln({type:V,data:K}){e("tableChange",{type:V,data:K}),!(!i.isAllowSaveConfig||["5"].includes(V))&&(fb&&clearTimeout(fb),fb=setTimeout(()=>{ab("save",{keyName:i.relateKeyName||i.keyName,data:v.unref(AB)})},500))}const pb=V=>{r.value=V.defaultSortRule,s.value=V.dimensionData,l.value=V.currentClickCell,a.value=V.dimFilterData,h.value=V.indFilterData,d.value=V.filterData,c.value=V.indFilterConfig,x.value=V.topNumData,T.value=V.sortData,M.value=V.colSortData,B.value=V.indSortData,P.value=V.aggregateMap,F.value=V.subMenuLeft,H.value=V.subMenuTop,k.value=V.dragAreaStyle,L.value=V.showTreeData,D.value=V.largeVisible,O.value=V.temporaryData,ot=V.splitSymbol,ut.value=V.sourceListStyle,Ht.value=V.dimensionFieldList,Et.value=V.indicatorFieldList,Nt.value=V.computedIndKeys,te.value=V.computedIndMap,ae.value=V.computedIndFieldMap,Se.value=V.loadingRect,qe.value=V.calculateList,Kn.value=V.filterList,Vr.value=V.topNumMap,Sn.value=V.sortMap,ks.value=V.customDimensions,Ul.value=V.customIndicators,Kl.value=V.customRowKeys,Yl.value=V.customColKeys,Y.value=V.cacheResData,jr.value=V.toolBoxStyle,N.value=V.scrollTop,W.value=V.scrollLeft,Object.assign(J,V.option),J.theme=Jt};async function NY(V){var K,q,rt;if(R.value=!0,V)pb(V);else if(i.isAllowSaveConfig){const Z=await ab("get",{keyName:i.relateKeyName||i.keyName}),tt=((q=(K=Z==null?void 0:Z.data)==null?void 0:K.data)==null?void 0:q.searchMap)||{};tt!=null&&tt.data&&!Array.isArray(tt.data)&&((rt=Object.keys(tt.data))!=null&&rt.length)&&pb(tt.data)}dr()}function VY(){return{dimensions:v.unref(Ht),indicators:v.unref(Et)}}const jY=V=>{const{scope:K,name:q,label:rt}=V;let Z=[];["IDX","BUILT_IN_IDX"].includes(K)?Z=v.unref(Et):["DIM","BUILT_IN_DIM"].includes(K)&&(Z=v.unref(Ht));const tt=Z.findIndex(it=>it.name===q);if(tt!==-1){delete v.unref(a)[Z[tt].label];const it=v.unref(Kn).findIndex(pt=>pt.key===rt);it!==-1&&v.unref(Kn).splice(it,1),Z[tt].show?Z[tt].isInnerFilter=!1:Z.splice(tt,1)}R.value=!0,Xh(),ln({type:"10",data:{dimensions:v.unref(Ht),indicators:v.unref(Et)}})},$Y=V=>{const{scope:K,label:q,showTitle:rt}=V,Z=Y2(K);Z==="indicator"||Z==="dimension"&&_B({dimensionKey:q,value:rt})};t({option:J,refreshData:NY,reRenderTable:pb,click:wB,getDrawRange:Xl,getSaveData:VY}),v.watch(()=>[i.graphicConfig,i.dimensionList,i.indicatorList],()=>{TB()},{immediate:!0,deep:!0});function TB(){const{queryColumnList:V=[],indicators:K=[]}=i.graphicConfig,q=Ye.cloneDeep(V),rt=Ye.cloneDeep(K);for(const Z of q){const tt=i.dimensionList.find(it=>it.key===Z.name);Z.positionType=(tt==null?void 0:tt.position)||"rows",Z.width=tt==null?void 0:tt.width,Z.showTitle=Z.title||Z.label}for(const Z of rt){const tt=i.indicatorList.find(it=>it.key===Z.name);Z.width=tt==null?void 0:tt.width,Z.showTitle=Z.label}Ht.value=q,Et.value=rt}const GY=()=>{o.value=!1,L.value=!L.value},UY=()=>{o.value=!1,D.value=!D.value,window.enScale&&window.enScale(v.unref(D))},KY=V=>{const K=v.unref(Ht).find(tt=>tt.label===V),q=v.unref(Et).find(tt=>tt.label===V),rt=K||q,Z=v.unref(a)[V];return Z?rt.genericType==="DATE"?Array.isArray(Z)?`${Z[0].value}~${Z[1].value}`:Z.value:Z.value&&Array.isArray(Z.value)?Z.value.join("、"):"":""},YY=V=>V.parentNode;return v.onMounted(()=>{Zt()}),{showDefaultTableArea:_e,maskList:gf,styleData:mt,subMenuLeft:F,subMenuTop:H,pivotWrapRef:S,pivotTableRef:_,pivotFilterRef:u,pivotPropertyRef:g,conditionalPropertyRef:f,chartModalRef:C,pivotTopRef:m,pivotConfigRef:b,drillModalRef:y,pivotAggregateRef:p,filterData:d,loadingRect:Se,loading:R,isTableInit:o,toolBoxStyle:jr,indSourceRef:RB,searchText:xB,dragAreaStyle:k,offsetWidth:be,showTreeData:L,dataIconStyle:He,largeVisible:D,sourceListStyle:ut,defaultTableStyle:Oe,innerFilterStyle:ie,innerFilterFieldList:Tt,innerFilterRef:$,showFilterWrap:U,customDimensions:ks,indicatorFieldList:Et,dimensionFieldList:Ht,pivotWrapStyle:A,fontSize:ht,click:wB,onFilterChange:FY,pivotDetailRef:w,handleFormat:SB,handleCondition:IY,handleAggregate:mY,handleGetTop:DY,handleConfig:PY,handleClearFilter:HY,handleGetConfig:EY,onDragStart:OY,onDragEnd:zY,onSearch:WY,handleAddField:LY,toggleShowData:GY,handleEnScale:UY,adjustHSL:PC,handleDelFilterTag:jY,handleInnerFilter:$Y,getFilterValue:KY,getPopupContainer:YY}}}),XK={key:0,class:"design-template"},qK=["id"],ZK=["onClick"],JK=["title"],QK=["id"],tY={class:"box-tooltip"},eY={class:"box-tooltip"};function iY(i,t,e,n,o,r){var M,B;const s=v.resolveComponent("a-input-search"),l=v.resolveComponent("ind-source-list"),a=v.resolveComponent("filter-outlined"),h=v.resolveComponent("delete-outlined"),d=v.resolveComponent("a-tooltip"),u=v.resolveComponent("a-spin"),c=v.resolveComponent("database-outlined"),g=v.resolveComponent("shrink-outlined"),f=v.resolveComponent("arrows-alt-outlined"),p=v.resolveComponent("setting-outlined"),m=v.resolveComponent("clear-outlined"),b=v.resolveComponent("drag-area"),C=v.resolveComponent("pivot-filter"),_=v.resolveComponent("pivot-property"),w=v.resolveComponent("conditional-property"),y=v.resolveComponent("chart-modal"),S=v.resolveComponent("pivot-aggregate"),A=v.resolveComponent("pivot-top"),R=v.resolveComponent("pivot-detail"),x=v.resolveComponent("pivot-config"),T=v.resolveComponent("drill-modal");return i.pageMode==="design"?(v.openBlock(),v.createElementBlock("div",XK," 透视表格 ")):(v.openBlock(),v.createBlock(v.Teleport,{key:1,to:i.enlargeContainer,disabled:!i.largeVisible},[v.createElementVNode("div",{class:v.normalizeClass(["pivot-wrap",[i.largeVisible?"large":"",i.theme]]),style:v.normalizeStyle(i.pivotWrapStyle),id:`pivotWrap_${i.id}`,ref:"pivotWrapRef"},[i.fullMode?v.withDirectives((v.openBlock(),v.createElementBlock("div",{key:0,class:"data-source-list",style:v.normalizeStyle(i.sourceListStyle)},[v.createVNode(s,{value:i.searchText,"onUpdate:value":t[0]||(t[0]=P=>i.searchText=P),placeholder:"请输入关键字",onSearch:i.onSearch},null,8,["value","onSearch"]),v.createVNode(l,{ref:"indSourceRef",hasChildren:!0,isSub:!1,onOnDragStart:i.onDragStart,onOnDragEnd:i.onDragEnd,config:i.graphicConfig},null,8,["onOnDragStart","onOnDragEnd","config"])],4)),[[v.vShow,i.showTreeData]]):v.createCommentVNode("",!0),v.createElementVNode("div",{style:v.normalizeStyle({width:i.offsetWidth?`calc(100% - ${i.offsetWidth}px)`:"100%"})},[i.isTableInit&&(!i.showDefaultTableArea&&((M=i.innerFilterFieldList)!=null&&M.length)||i.showFilterWrap)?(v.openBlock(),v.createElementBlock("div",{key:0,class:"inner-filter-wrap",style:v.normalizeStyle(i.innerFilterStyle),ref:"innerFilterRef"},[(v.openBlock(!0),v.createElementBlock(v.Fragment,null,v.renderList(i.innerFilterFieldList,P=>(v.openBlock(),v.createElementBlock("div",{key:P.name,class:"filter-tag",style:v.normalizeStyle({backgroundColor:i.adjustHSL(i.styleData.headerBgColor,-4)}),onClick:F=>i.handleInnerFilter(P)},[v.createElementVNode("div",{class:"tag-text",style:v.normalizeStyle({color:i.styleData.headerColor})},v.toDisplayString(P.showTitle),5),i.getFilterValue(P.label)?(v.openBlock(),v.createElementBlock("div",{key:0,class:"filter-value",style:v.normalizeStyle({color:i.adjustHSL(i.styleData.headerColor,8)}),title:i.getFilterValue(P.label)},v.toDisplayString(i.getFilterValue(P.label)),13,JK)):v.createCommentVNode("",!0),v.createElementVNode("span",{class:v.normalizeClass(i.fullMode?"hover-icon-wrap":"")},[v.createVNode(a,{class:"filter-icon",style:v.normalizeStyle({fontSize:i.fontSize+"px",color:i.styleData.headerColor})},null,8,["style"]),v.createVNode(d,{placement:"bottom"},{title:v.withCtx(()=>t[5]||(t[5]=[v.createElementVNode("span",null,"删除",-1)])),default:v.withCtx(()=>[v.createVNode(h,{class:"delete-icon",style:v.normalizeStyle({fontSize:i.fontSize+"px",color:i.styleData.headerColor}),onClick:v.withModifiers(F=>i.handleDelFilterTag(P),["stop"])},null,8,["style","onClick"])]),_:2},1024)],2)],12,ZK))),128))],4)):v.createCommentVNode("",!0),i.isTableInit&&i.showDefaultTableArea?(v.openBlock(),v.createElementBlock("div",{key:1,class:"empty-table",style:v.normalizeStyle(i.defaultTableStyle)}," 拖拽左侧数据源到此处 ",4)):v.createCommentVNode("",!0),v.withDirectives(v.createElementVNode("div",{class:"table-instance",style:{width:"100%"},id:i.pageMode!=="design"?`pivotTableContainer_${i.id}`:"",ref:"pivotTableRef"},null,8,QK),[[v.vShow,!i.showDefaultTableArea]])],4),i.loading?(v.openBlock(),v.createElementBlock("div",{key:1,class:"pivot-loading",style:v.normalizeStyle(i.loadingRect)},[v.createVNode(u,{size:"large",style:v.normalizeStyle({scale:i.scaleValue.widthScale})},null,8,["style"])],4)):v.createCommentVNode("",!0),i.pageMode!=="design"&&!i.graphicConfig.preview&&i.isTableInit&&!i.maskList.length&&!i.showDefaultTableArea?(v.openBlock(),v.createElementBlock("div",{key:2,class:"tool-box",style:v.normalizeStyle(i.toolBoxStyle)},[i.fullMode?(v.openBlock(),v.createBlock(d,{key:0,getPopupContainer:i.getPopupContainer},{title:v.withCtx(()=>[v.createElementVNode("span",tY,v.toDisplayString(i.showTreeData?"隐藏数据源":"显示数据源"),1)]),default:v.withCtx(()=>[v.createElementVNode("div",{class:v.normalizeClass(["box-item pivot-data",i.theme]),onClick:t[1]||(t[1]=(...P)=>i.toggleShowData&&i.toggleShowData(...P))},[v.createVNode(c,{style:v.normalizeStyle(i.dataIconStyle)},null,8,["style"])],2)]),_:1},8,["getPopupContainer"])):v.createCommentVNode("",!0),v.createVNode(d,{getPopupContainer:i.getPopupContainer},{title:v.withCtx(()=>[v.createElementVNode("span",eY,v.toDisplayString(i.largeVisible?"缩小":"放大"),1)]),default:v.withCtx(()=>[i.showFullScreen?(v.openBlock(),v.createElementBlock("div",{key:0,class:v.normalizeClass(["box-item pivot-large",i.theme]),onClick:t[2]||(t[2]=(...P)=>i.handleEnScale&&i.handleEnScale(...P))},[i.largeVisible?(v.openBlock(),v.createBlock(g,{key:0,style:v.normalizeStyle({fontSize:i.fontSize+"px",color:"#416EFF"})},null,8,["style"])):(v.openBlock(),v.createBlock(f,{key:1,style:v.normalizeStyle({fontSize:i.fontSize+"px"})},null,8,["style"]))],2)):v.createCommentVNode("",!0)]),_:1},8,["getPopupContainer"]),v.createVNode(d,{getPopupContainer:i.getPopupContainer},{title:v.withCtx(()=>t[6]||(t[6]=[v.createElementVNode("span",{class:"box-tooltip"},"设置",-1)])),default:v.withCtx(()=>[v.createElementVNode("div",{class:v.normalizeClass(["box-item pivot-config",i.theme]),onClick:t[3]||(t[3]=(...P)=>i.handleConfig&&i.handleConfig(...P))},[v.createVNode(p,{style:v.normalizeStyle({fontSize:i.fontSize+"px"})},null,8,["style"])],2)]),_:1},8,["getPopupContainer"]),v.createVNode(d,{getPopupContainer:i.getPopupContainer},{title:v.withCtx(()=>t[7]||(t[7]=[v.createElementVNode("span",{class:"box-tooltip"},"清空状态",-1)])),default:v.withCtx(()=>[i.showClear?(v.openBlock(),v.createElementBlock("div",{key:0,class:v.normalizeClass(["box-item pivot-config",i.theme]),onClick:t[4]||(t[4]=(...P)=>i.handleClearFilter&&i.handleClearFilter(...P))},[v.createVNode(m,{style:v.normalizeStyle({fontSize:i.fontSize+"px"})},null,8,["style"])],2)):v.createCommentVNode("",!0)]),_:1},8,["getPopupContainer"])],4)):v.createCommentVNode("",!0),(B=i.maskList)!=null&&B.length?(v.openBlock(),v.createBlock(b,{key:3,style:v.normalizeStyle(i.dragAreaStyle),maskList:i.maskList,onAdd:i.handleAddField},null,8,["style","maskList","onAdd"])):v.createCommentVNode("",!0)],14,qK),v.createVNode(C,{ref:"pivotFilterRef",data:i.filterData,customDimensions:i.customDimensions,dimensions:i.dimensionFieldList,indicators:i.indicatorFieldList,onChange:i.onFilterChange},null,8,["data","customDimensions","dimensions","indicators","onChange"]),v.createVNode(_,{ref:"pivotPropertyRef",onChange:i.handleFormat},null,8,["onChange"]),v.createVNode(w,{ref:"conditionalPropertyRef",onChange:i.handleCondition},null,8,["onChange"]),v.createVNode(y,{ref:"chartModalRef"},null,512),v.createVNode(S,{ref:"pivotAggregateRef",onConfirm:i.handleAggregate},null,8,["onConfirm"]),v.createVNode(A,{ref:"pivotTopRef",onConfirm:i.handleGetTop},null,8,["onConfirm"]),v.createVNode(R,{ref:"pivotDetailRef"},null,512),v.createVNode(x,{ref:"pivotConfigRef",fullMode:i.fullMode,onConfirm:i.handleGetConfig},null,8,["fullMode","onConfirm"]),v.createVNode(T,{ref:"drillModalRef",scaleValue:i.scaleValue,isIframeMode:i.isIframeMode},null,8,["scaleValue","isIframeMode"])],8,["to","disabled"]))}const lb=kB(Ti(YK,[["render",iY],["__scopeId","data-v-8f058dc6"]])),dB=Object.freeze(Object.defineProperty({__proto__:null,EcanPivotTable:lb},Symbol.toStringTag,{value:"Module"})),nY={install:(i,t)=>{const{request:e}=t;i.provide("$request",e),Object.keys(dB).forEach(n=>{const o=dB[n];o.install&&i.use(o)})}},VX="",jX="",oY=v.defineComponent({name:"DrillModal",props:{scaleValue:{type:Object,default:()=>({widthScale:1,heightScale:1})},isIframeMode:{type:Boolean,default:!1}},components:{BorderOutlined:Bj,SwitcherOutlined:V$,CloseOutlined:Gj,EcanPivotTable:lb},setup(i,{expose:t}){const e={IN:"属于",NOT_IN:"不属于",LIKE:"包含",NOT_LIKE:"不包含","LIKE%":"开头是","%LIKE":"结尾是",EQUAL:"等于",LESS:"小于",LESS_EQUAL:"小于等于",GREATER:"大于",GREATER_EQUAL:"大于等于",NOT_EQUAL:"不等于"},n=.37,o=.6,r=.97,s=.9,l=`dmodal_${Es(6)}`,a=()=>document.querySelector("#ProviderConfig > #container")||document.body,h=v.inject("theme","light"),d=v.ref({}),u=v.ref([]),c=v.inject("indicatorUrl",""),g=v.ref([]),f=v.ref(!1),p=v.ref({}),m=v.reactive({keyName:"",visible:!1,columns:[],title:""}),b=v.ref([]),C=v.ref(),_=v.computed(()=>{let B=`drill-modal ${l}`;return f.value&&(B+=" full"),v.unref(h)&&(B+=` ${v.unref(h)}`),B}),w=B=>{const P=document.querySelector(`.${l} .ant-modal-header`);if(P)if(B)P.addEventListener("mousedown",S);else{const F=P.parentElement;F&&(F.style.left="",F.style.top=""),P.removeEventListener("mousedown",S)}},y=B=>{const P=document.querySelector(`.${l} .ant-modal-header`);P&&(B?P.addEventListener("dblclick",A):P.removeEventListener("dblclick",A))},S=B=>{X2(B,`.${l} .ant-modal-header`)},A=()=>{f.value=!f.value,v.nextTick(()=>{f.value?(v.unref(p).width=parseFloat(v.unref(d).width)*r+"px",v.unref(p).height=(i.isIframeMode?parseFloat(v.unref(d).height):window.screen.height)*s+"px",w(!1)):(v.unref(p).width=parseFloat(v.unref(d).width)*n+"px",v.unref(p).height=(i.isIframeMode?parseFloat(v.unref(d).height):window.screen.height)*o+"px",w(!0))})},R=()=>{f.value=!1,y(!1),w(!1)},x=({drillDimension:B,drillFieldData:P,usedDimensionFields:F,tableProps:H,splitSymbol:E})=>{const k=Ye.cloneDeep(H),{graphicConfig:I,allDimensions:L,pageConfig:D}=k,O=Es(6),N=[];b.value=[...F,B.label],L.value=L,D.value=D;const W=I.indicators.filter($=>$.show).map($=>$.label);W!=null&&W.length&&(m.title=`下钻:${W.join("、")}`);for(const $ of P){const U=L.find(G=>[G.title,G.label].includes($.dimensionKey)),Y=$.value.split(E);let j=$.value;Y!=null&&Y.length&&(j=Y[Y.length-1]),N.push({conditionKey:U.label,conditionLabel:U.title||U.label,conditionName:U.name,conditionValueType:U.genericType,indexCode:U.indexCode,typeGuid:U.typeGuid,indexCodeNum:U.indexCodeNum,rule:"EQUAL",dataType:"",customValue:j})}I.queryColumnList=[B],N!=null&&N.length&&(I.controlList||(I.controlList=[]),I.controlList.push(...N),I.controlList=[{join:"&&",conditions:I.controlList}]),p.value={...k,id:O,keyName:`透视表_${O}`,position:"relative",top:0,left:0,width:parseFloat(v.unref(D).width)*n+"px",height:(i.isIframeMode?parseFloat(v.unref(D).height):window.screen.height)*o+"px",graphicConfig:I},m.visible=!0,v.nextTick(()=>{v.unref(C).refreshData(),y(!0),w(!0)})},T=({type:B,data:P})=>{if(B==="11"&&P){const{indicatorList:F=[],queryColumns:H=[]}=P,k=F.concat(H).filter(D=>D.conditions||D.filter),I=M(k,"conditions",!0),L=M(P.sqlConditions,"sqlConditions",!1);g.value=I.concat(L).map(D=>{const O=v.unref(u).find(W=>W.label===D.label);let N=D.fieldValue;if(N&&typeof N=="string"){const W=N.split(",");(W==null?void 0:W.length)>3&&(N=W.slice(0,3).join(",")+"等")}else N||(N='""');return`${(O==null?void 0:O.title)||D.label} ${e[D.rule]} ${N}`})||[]}};function M(B,P,F){const H=[];for(const E of B)E[P]?H.push(...M(E[P],P,F)):E.filter?H.push({...E.filter,label:E.label}):(!F||E.dataType!=="component"&&!(E.fieldValue.startsWith("${")&&E.fieldValue.endsWith("}")))&&H.push(E);return H}return v.watch(m.visible,B=>{window.modalShow&&window.modalShow(B)}),t({showModal:x}),{theme:h,wrapClassName:_,conditionInfo:g,drillInfo:m,pivotTableConfig:p,indicatorUrl:c,isIndFullScreen:f,usedDimensionFields:b,pivotTableRef:C,toggleFullScreen:A,onDetailCancel:R,onPivotTableChange:T,getContainer:a}}}),rY=["title"];function sY(i,t,e,n,o,r){const s=v.resolveComponent("close-outlined"),l=v.resolveComponent("switcher-outlined"),a=v.resolveComponent("border-outlined"),h=v.resolveComponent("ecan-pivot-table"),d=v.resolveComponent("a-modal");return v.openBlock(),v.createBlock(d,{"wrap-class-name":i.wrapClassName,visible:i.drillInfo.visible,"onUpdate:visible":t[1]||(t[1]=u=>i.drillInfo.visible=u),width:"60%",footer:null,maskClosable:!1,destroyOnClose:!0,getContainer:i.getContainer,onCancel:i.onDetailCancel},{title:v.withCtx(()=>[v.createElementVNode("div",{class:"modal-title",title:i.conditionInfo.join("、")},v.toDisplayString(i.drillInfo.title)+" "+v.toDisplayString(i.conditionInfo.join("、")),9,rY)]),closeIcon:v.withCtx(()=>[v.createVNode(s,{class:v.normalizeClass(["modal-icon",i.theme])},null,8,["class"])]),default:v.withCtx(()=>[v.createElementVNode("div",{class:"zoom-btn",onClick:t[0]||(t[0]=(...u)=>i.toggleFullScreen&&i.toggleFullScreen(...u))},[i.isIndFullScreen?(v.openBlock(),v.createBlock(l,{key:0,class:v.normalizeClass(["modal-icon",i.theme])},null,8,["class"])):(v.openBlock(),v.createBlock(a,{key:1,class:v.normalizeClass(["modal-icon",i.theme])},null,8,["class"]))]),i.drillInfo.visible?(v.openBlock(),v.createElementBlock("div",{key:0,style:v.normalizeStyle({position:"relative",width:i.pivotTableConfig.width,height:i.pivotTableConfig.height})},[v.createVNode(h,v.mergeProps({ref:"pivotTableRef"},i.pivotTableConfig,{theme:i.theme,fullMode:!1,allowDrill:!0,showFullScreen:!1,showClear:!1,isAllowSaveConfig:!1,indicatorUrl:i.indicatorUrl,relateKeyName:i.drillInfo.keyName,usedDimensionFields:i.usedDimensionFields,scaleValue:i.scaleValue,onTableChange:i.onPivotTableChange}),null,16,["theme","indicatorUrl","relateKeyName","usedDimensionFields","scaleValue","onTableChange"])],4)):v.createCommentVNode("",!0)]),_:1},8,["wrap-class-name","visible","getContainer","onCancel"])}const lY=Object.freeze(Object.defineProperty({__proto__:null,default:Ti(oY,[["render",sY],["__scopeId","data-v-412e66d4"]])},Symbol.toStringTag,{value:"Module"}));Je.EcanPivotTable=lb,Je.default=nY,Object.defineProperties(Je,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
374
374
|
//# sourceMappingURL=index.umd.js.map
|