dash-ant-design 0.1.2 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (89) hide show
  1. package/dash_antd_components/async-audio-player.js +1 -1
  2. package/dash_antd_components/async-chart.js +1 -1
  3. package/dash_antd_components/async-data-entry.js +1 -1
  4. package/dash_antd_components/async-display.js +1 -1
  5. package/dash_antd_components/async-dnd.js +1 -1
  6. package/dash_antd_components/async-feedback.js +1 -1
  7. package/dash_antd_components/async-form-controls.js +1 -0
  8. package/dash_antd_components/async-form-upload.js +1 -1
  9. package/dash_antd_components/async-highlight.js +1 -1
  10. package/dash_antd_components/async-icon-outlined.js +1 -1
  11. package/dash_antd_components/async-infographic.js +1 -1
  12. package/dash_antd_components/async-locale-ar.js +1 -1
  13. package/dash_antd_components/async-locale-az.js +1 -1
  14. package/dash_antd_components/async-locale-bg.js +1 -1
  15. package/dash_antd_components/async-locale-bn.js +1 -1
  16. package/dash_antd_components/async-locale-by.js +1 -1
  17. package/dash_antd_components/async-locale-ca.js +1 -1
  18. package/dash_antd_components/async-locale-cs.js +1 -1
  19. package/dash_antd_components/async-locale-da.js +1 -1
  20. package/dash_antd_components/async-locale-de.js +1 -1
  21. package/dash_antd_components/async-locale-el.js +1 -1
  22. package/dash_antd_components/async-locale-en.js +1 -1
  23. package/dash_antd_components/async-locale-es.js +1 -1
  24. package/dash_antd_components/async-locale-et.js +1 -1
  25. package/dash_antd_components/async-locale-eu.js +1 -1
  26. package/dash_antd_components/async-locale-fa.js +1 -1
  27. package/dash_antd_components/async-locale-fi.js +1 -1
  28. package/dash_antd_components/async-locale-fr.js +1 -1
  29. package/dash_antd_components/async-locale-ga.js +1 -1
  30. package/dash_antd_components/async-locale-gl.js +1 -1
  31. package/dash_antd_components/async-locale-he.js +1 -1
  32. package/dash_antd_components/async-locale-hi.js +1 -1
  33. package/dash_antd_components/async-locale-hr.js +1 -1
  34. package/dash_antd_components/async-locale-hu.js +1 -1
  35. package/dash_antd_components/async-locale-hy.js +1 -1
  36. package/dash_antd_components/async-locale-id.js +1 -1
  37. package/dash_antd_components/async-locale-is.js +1 -1
  38. package/dash_antd_components/async-locale-it.js +1 -1
  39. package/dash_antd_components/async-locale-ja.js +1 -1
  40. package/dash_antd_components/async-locale-ka.js +1 -1
  41. package/dash_antd_components/async-locale-kk.js +1 -1
  42. package/dash_antd_components/async-locale-km.js +1 -1
  43. package/dash_antd_components/async-locale-kmr.js +1 -1
  44. package/dash_antd_components/async-locale-kn.js +1 -1
  45. package/dash_antd_components/async-locale-ko.js +1 -1
  46. package/dash_antd_components/async-locale-ku.js +1 -1
  47. package/dash_antd_components/async-locale-lt.js +1 -1
  48. package/dash_antd_components/async-locale-lv.js +1 -1
  49. package/dash_antd_components/async-locale-mk.js +1 -1
  50. package/dash_antd_components/async-locale-ml.js +1 -1
  51. package/dash_antd_components/async-locale-mn.js +1 -1
  52. package/dash_antd_components/async-locale-mr.js +1 -1
  53. package/dash_antd_components/async-locale-ms.js +1 -1
  54. package/dash_antd_components/async-locale-my.js +1 -1
  55. package/dash_antd_components/async-locale-nb.js +1 -1
  56. package/dash_antd_components/async-locale-ne.js +1 -1
  57. package/dash_antd_components/async-locale-nl.js +1 -1
  58. package/dash_antd_components/async-locale-pl.js +1 -1
  59. package/dash_antd_components/async-locale-pt.js +1 -1
  60. package/dash_antd_components/async-locale-ro.js +1 -1
  61. package/dash_antd_components/async-locale-ru.js +1 -1
  62. package/dash_antd_components/async-locale-si.js +1 -1
  63. package/dash_antd_components/async-locale-sk.js +1 -1
  64. package/dash_antd_components/async-locale-sl.js +1 -1
  65. package/dash_antd_components/async-locale-sq.js +1 -1
  66. package/dash_antd_components/async-locale-sr.js +1 -1
  67. package/dash_antd_components/async-locale-sv.js +1 -1
  68. package/dash_antd_components/async-locale-ta.js +1 -1
  69. package/dash_antd_components/async-locale-th.js +1 -1
  70. package/dash_antd_components/async-locale-tk.js +1 -1
  71. package/dash_antd_components/async-locale-tr.js +1 -1
  72. package/dash_antd_components/async-locale-uk.js +1 -1
  73. package/dash_antd_components/async-locale-ur.js +1 -1
  74. package/dash_antd_components/async-locale-uz.js +1 -1
  75. package/dash_antd_components/async-locale-vi.js +1 -1
  76. package/dash_antd_components/async-locale-zh.js +1 -1
  77. package/dash_antd_components/async-markdown.js +1 -1
  78. package/dash_antd_components/async-media-shared.js +1 -1
  79. package/dash_antd_components/async-media.js +1 -1
  80. package/dash_antd_components/async-navigation.js +1 -1
  81. package/dash_antd_components/async-picker.js +1 -1
  82. package/dash_antd_components/async-select.js +1 -1
  83. package/dash_antd_components/async-sheet.js +1 -1
  84. package/dash_antd_components/async-table.js +1 -1
  85. package/dash_antd_components/async-tree.js +1 -1
  86. package/dash_antd_components/async-video-player.js +1 -1
  87. package/dash_antd_components/async-viz-shared.js +1 -1
  88. package/dash_antd_components/dash_antd_components.js +1 -1
  89. package/package.json +2 -2
@@ -1 +1 @@
1
- (self.webpackChunkdash_antd_components=self.webpackChunkdash_antd_components||[]).push([["async-sheet"],{"./node_modules/.pnpm/@ant-design+icons@6.3.4_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@ant-design/icons/es/icons/MoreOutlined.js"(e,t,i){"use strict";i.d(t,{A:()=>l});var s=i("react");const o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M456 231a56 56 0 10112 0 56 56 0 10-112 0zm0 280a56 56 0 10112 0 56 56 0 10-112 0zm0 280a56 56 0 10112 0 56 56 0 10-112 0z"}}]},name:"more",theme:"outlined"};var n=i("./node_modules/.pnpm/@ant-design+icons@6.3.4_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@ant-design/icons/es/components/AntdIconLight.js");function r(){return r=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(e[s]=i[s])}return e},r.apply(this,arguments)}const l=s.forwardRef((e,t)=>s.createElement(n.A,r({},e,{ref:t,icon:o})))},"./node_modules/.pnpm/@ant-design+icons@6.3.4_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@ant-design/icons/es/icons/ReloadOutlined.js"(e,t,i){"use strict";i.d(t,{A:()=>l});var s=i("react");const o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M909.1 209.3l-56.4 44.1C775.8 155.1 656.2 92 521.9 92 290 92 102.3 279.5 102 511.5 101.7 743.7 289.8 932 521.9 932c181.3 0 335.8-115 394.6-276.1 1.5-4.2-.7-8.9-4.9-10.3l-56.7-19.5a8 8 0 00-10.1 4.8c-1.8 5-3.8 10-5.9 14.9-17.3 41-42.1 77.8-73.7 109.4A344.77 344.77 0 01655.9 829c-42.3 17.9-87.4 27-133.8 27-46.5 0-91.5-9.1-133.8-27A341.5 341.5 0 01279 755.2a342.16 342.16 0 01-73.7-109.4c-17.9-42.4-27-87.4-27-133.9s9.1-91.5 27-133.9c17.3-41 42.1-77.8 73.7-109.4 31.6-31.6 68.4-56.4 109.3-73.8 42.3-17.9 87.4-27 133.8-27 46.5 0 91.5 9.1 133.8 27a341.5 341.5 0 01109.3 73.8c9.9 9.9 19.2 20.4 27.8 31.4l-60.2 47a8 8 0 003 14.1l175.6 43c5 1.2 9.9-2.6 9.9-7.7l.8-180.9c-.1-6.6-7.8-10.3-13-6.2z"}}]},name:"reload",theme:"outlined"};var n=i("./node_modules/.pnpm/@ant-design+icons@6.3.4_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@ant-design/icons/es/components/AntdIconLight.js");function r(){return r=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(e[s]=i[s])}return e},r.apply(this,arguments)}const l=s.forwardRef((e,t)=>s.createElement(n.A,r({},e,{ref:t,icon:o})))},"./node_modules/.pnpm/@ant-design+icons@6.3.4_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@ant-design/icons/es/icons/SwapOutlined.js"(e,t,i){"use strict";i.d(t,{A:()=>l});var s=i("react");const o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M847.9 592H152c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h605.2L612.9 851c-4.1 5.2-.4 13 6.3 13h72.5c4.9 0 9.5-2.2 12.6-6.1l168.8-214.1c16.5-21 1.6-51.8-25.2-51.8zM872 356H266.8l144.3-183c4.1-5.2.4-13-6.3-13h-72.5c-4.9 0-9.5 2.2-12.6 6.1L150.9 380.2c-16.5 21-1.6 51.8 25.1 51.8h696c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8z"}}]},name:"swap",theme:"outlined"};var n=i("./node_modules/.pnpm/@ant-design+icons@6.3.4_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@ant-design/icons/es/components/AntdIconLight.js");function r(){return r=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(e[s]=i[s])}return e},r.apply(this,arguments)}const l=s.forwardRef((e,t)=>s.createElement(n.A,r({},e,{ref:t,icon:o})))},"./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/common/constant/basic.js"(e,t,i){"use strict";i.d(t,{Gp:()=>o});var s=i("./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/common/i18n/index.js");var o;!function(e){e.Line="line",e.Bar="bar",e.Bullet="bullet"}(o||(o={}));i.d(t,["Do",0,"colScrollGroup","E2",0,"colResizeAreaGroup","FS",0,"colFrozenTrailingGroup","G8",0,"rowIndexFrozenTrailingGroup","H",0,"mergedCellsGroup","Oe",0,"backGroundGroup","Pu",0,"frozenSplitLine","VC",0,"rowScrollGroup","YC",0,"rowHeaderFrozenGroup","YD",0,"horizontal-resize-area-","YJ",0,"cornerScrollGroup","Yq",0,()=>(0,s.Ru)("指标"),"Z0",0,"panelGroup","Zv",0,"rowIndexFrozenGroup","gN",0,"colFrozenGroup","j6",0,"rowIndexResizeAreaGroup","k5",0,"rowResizeAreaGroup","n7",0,"gridGroup","nO",0,"cornerResizeAreaGroup","qK",0,"emptyPlaceholderGroup","vO",0,"panelScrollGroup","wH",0,"rowIndexScrollGroup","x1",0,"rowHeaderFrozenTrailingGroup","xB",0,"foreGroundGroup","zw",0,()=>(0,s.Ru)("序号")])},"./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/common/constant/classnames.js"(e,t,i){"use strict";i.d(t,["u",0,"antv-s2"])},"./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/common/constant/field.js"(e,t,i){"use strict";i.d(t,["B7",0,"$$extra_column$$","GJ",0,"$$extra$$","IW",0,"$$empty_extra_placeholder$$","L4",0,"$$empty_field_value$$","SA",0,"$$undefined$$","YZ",0,"$$multi$$","Zb",0,"$$null$$","_O",0,"$$origin$$","jI",0,"$$total$$","nj",0,"$$value$$","r2",0,"$$series_number$$"])},"./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/common/constant/interaction.js"(e,t,i){"use strict";var s,o,n;i.d(t,{B4:()=>l,Dh:()=>h,Ri:()=>r,Wd:()=>u,eb:()=>c,fR:()=>d,oB:()=>s,vZ:()=>n,xT:()=>o}),function(e){e.CORNER_CELL_CLICK="cornerCellClick",e.DATA_CELL_CLICK="dataCellClick",e.ROW_CELL_CLICK="rowCellClick",e.COL_CELL_CLICK="colCellClick",e.MERGED_CELLS_CLICK="mergedCellsClick",e.ROW_COLUMN_CLICK="rowColumnClick",e.HEADER_CELL_LINK_CLICK="headerCellLinkClick",e.PREVIEW_CLICK="previewClick",e.HOVER="hover",e.DATA_CELL_BRUSH_SELECTION="dataCellBrushSelection",e.ROW_CELL_BRUSH_SELECTION="rowCellBrushSelection",e.COL_CELL_BRUSH_SELECTION="colCellBrushSelection",e.COL_ROW_RESIZE="rowColResize",e.DATA_CELL_MULTI_SELECTION="dataCellMultiSelection",e.ROW_CELL_MULTI_SELECTION="rowCellMultiSelection",e.COL_CELL_MULTI_SELECTION="colCellMultiSelection",e.RANGE_SELECTION="rangeSelection",e.SELECTED_CELL_MOVE="selectedCellMove",e.GLOBAL_RESET="globalReset"}(s||(s={})),function(e){e.ALL_SELECTED="allSelected",e.SELECTED="selected",e.ROW_CELL_BRUSH_SELECTED="rowCellBrushSelected",e.COL_CELL_BRUSH_SELECTED="colCellBrushSelected",e.DATA_CELL_BRUSH_SELECTED="dataCellBrushSelected",e.UNSELECTED="unselected",e.HOVER="hover",e.HOVER_FOCUS="hoverFocus",e.HIGHLIGHT="highlight",e.SEARCH_RESULT="searchResult",e.PREPARE_SELECT="prepareSelect"}(o||(o={})),function(e){e.DATA_CELL="dataCell",e.ROW_CELL="rowCell",e.COL_CELL="colCell",e.SERIES_NUMBER_CELL="seriesNumberCell",e.CORNER_CELL="cornerCell",e.MERGED_CELL="mergedCell"}(n||(n={}));var r,l,a,d;!function(e){e.CLICK="click",e.UN_DRAGGED="unDragged",e.DRAGGED="dragged"}(r||(r={})),function(e){e.SHIFT="Shift",e.COPY="c",e.ESC="Escape",e.META="Meta",e.CONTROL="Control",e.ARROW_UP="ArrowUp",e.ARROW_DOWN="ArrowDown",e.ARROW_LEFT="ArrowLeft",e.ARROW_RIGHT="ArrowRight"}(l||(l={})),function(e){e.ASC="ASC",e.DESC="DESC"}(a||(a={})),function(e){e.HOVER="hover",e.CLICK="click",e.DATA_CELL_BRUSH_SELECTION="dataCellBrushSelection",e.ROW_CELL_BRUSH_SELECTION="rowCellBrushSelection",e.COL_CELL_BRUSH_SELECTION="colCellBrushSelection",e.MULTI_SELECTION="multiSelection",e.RESIZE="resize"}(d||(d={}));var c,h,u;!function(e){e.CONTENT="content",e.CANVAS="canvas"}(c||(c={})),function(e){e.SCROLL_UP="scrollUp",e.SCROLL_DOWN="scrollDown",e.SCROLL_LEFT="scrollLeft",e.SCROLL_RIGHT="scrollRight"}(h||(h={})),function(e){e[e.SCROLL_UP=-1]="SCROLL_UP",e[e.SCROLL_DOWN=1]="SCROLL_DOWN"}(u||(u={}));i.d(t,["Ep",0,{textShape:["textOpacity"],textShapes:["textOpacity"],linkFieldShape:["opacity"],interactiveBgShape:["backgroundColor","backgroundOpacity"],interactiveBorderShape:["borderColor","borderOpacity","borderWidth"]},"hu",0,{x:{value:0,scroll:!1},y:{value:0,scroll:!1}},"lE",0,{textOpacity:"fillOpacity",backgroundOpacity:"fillOpacity",backgroundColor:"fill",borderOpacity:"strokeOpacity",borderColor:"stroke",borderWidth:"lineWidth",opacity:"opacity"},"sK",0,"interactionStateInfo"])},"./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/common/constant/query.js"(e,t,i){"use strict";var s;i.d(t,{B:()=>s}),function(e){e.All="all",e.DetailOnly="detailOnly"}(s||(s={}))},"./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/common/debug/index.js"(e,t,i){"use strict";i.d(t,{U:()=>s});class s{constructor(){this.debug=!1,this.debugCallback=(e,t)=>{if(this.debug){const i=performance.now();t();const s=performance.now();console.log(e,s-i+" ms")}else t()},this.logger=(e,...t)=>{this.debug&&console.log(e,...t)}}static getInstance(){return s.instance||(s.instance=new s),s.instance}setDebug(e){this.debug=e}}i.d(t,["jk",0,"Header Layout","uK",0,"Transform Data","v7",0,"Data Cell Render"])},"./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/common/i18n/index.js"(e,t,i){"use strict";i.d(t,{Ru:()=>l});var s=i("./node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/lodash.js");const o="zh_CN";let n=o,r={zh_CN:{小计:"小计",总计:"总计",总和:"(总和)",项:"项",已选择:"已选择",序号:"序号",度量:"度量",数值:"数值",共计:"共计",条:"条",趋势:"趋势",隐藏:"隐藏",组内升序:"组内升序",升序:"升序",降序:"降序",组内降序:"组内降序",不排序:"不排序",暂无数据:"暂无数据",",":","},en_US:{小计:"Total",总计:"Total",总和:"(SUM)",项:"items",已选择:"selected",序号:"Index",度量:"Measure",数值:"Measure",共计:"Total",条:"",隐藏:"Hide",组内升序:"Group ASC",组内降序:"Group DESC",升序:"ASC",降序:"DESC",不排序:"No order",暂无数据:"No Data",",":", "},ru_RU:{小计:"Промежуточный итог",总计:"Общий итог",总和:"(СУММА)",项:"элемент(-а/-ов)",已选择:"выбрано",序号:"Индекс",度量:"Мера",数值:"Численная величина",共计:"Общее количество",条:"",隐藏:"Скрыть",趋势:"Курс",组内升序:"Группировать по возрастанию",组内降序:"Группировать по убыванию",升序:"По возрастанию",降序:"По убыванию",不排序:"Не отсортировано",",":", "}};const l=(e,t=e)=>(0,s.get)(r,[n,e],t)},"./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/common/icons/factory.js"(e,t,i){"use strict";i.d(t,{s:()=>R,p:()=>O});var s={};i.r(s),i.d(s,{ArrowDown:()=>n,ArrowUp:()=>r,CellDown:()=>l,CellUp:()=>a,DrillDownIcon:()=>S,Empty:()=>E,ExpandColIcon:()=>m,EyeOutlined:()=>b,GlobalAsc:()=>d,GlobalDesc:()=>c,GroupAsc:()=>h,GroupDesc:()=>u,GroupNone:()=>p,InfoCircle:()=>g,Minus:()=>v,Play:()=>L,Plus:()=>f,SortDown:()=>y,SortDownSelected:()=>C,SortUp:()=>x,SortUpSelected:()=>w,Trend:()=>_});var o=i("./node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/lodash.js");const n='\n<svg width="10px" height="10px" viewBox="0 0 10 10" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n<g id="页面-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" font-family="Roboto, PingFangSC, Microsoft YaHei, Arial, sans-serif" font-size="12" font-weight="bold">\n <text id="↓" fill="none">\n <tspan x="-0.225097656" y="8.5">↓</tspan>\n </text>\n</g>\n</svg>',r='<svg width="10px" height="10px" viewBox="0 0 10 10" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n<g id="页面-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" font-family="Roboto, PingFangSC, Microsoft YaHei, Arial, sans-serif" font-size="12" font-weight="bold">\n <text id="↑" fill="none">\n <tspan x="-0.225097656" y="8.5">↑</tspan>\n </text>\n</g>\n</svg>\n',l='<?xml version="1.0" encoding="UTF-8"?>\n<svg width="7px" height="9px" viewBox="0 0 7 9" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n \x3c!-- Generator: Sketch 58 (84663) - https://sketch.com --\x3e\n <title>down</title>\n <desc>Created with Sketch.</desc>\n <g id="一期开发" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <polygon id="down" fill="none" transform="translate(3.500000, 4.500000) scale(1, -1) translate(-3.500000, -4.500000) " points="3.5 0 7 9 0 9"></polygon>\n </g>\n</svg>',a='<?xml version="1.0" encoding="UTF-8"?>\n<svg width="7px" height="9px" viewBox="0 0 7 9" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n \x3c!-- Generator: Sketch 58 (84663) - https://sketch.com --\x3e\n <title>up</title>\n <desc>Created with Sketch.</desc>\n <g id="一期开发" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <polygon id="up" fill="none" points="3.5 0 7 9 0 9"></polygon>\n </g>\n</svg> ',d='<svg t="1557124621626" class="icon" style="" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="17452" xmlns:xlink="http://www.w3.org/1999/xlink" width="14" height="14">\n<defs>\n <style type="text/css"></style>\n</defs>\n<path d="M182.272 167.04a8 8 0 0 0-12.544 0L57.728 309.056A8 8 0 0 0 64 321.984h76.032v530.048c0 4.352 3.584 7.936 7.936 7.936h56.064a8 8 0 0 0 7.936-7.936V321.92H288a8 8 0 0 0 6.272-12.992l-112-141.888z m209.728 626.944h176c4.416 0 8 3.584 8 8v56a8 8 0 0 1-8 8h-176A8 8 0 0 1 384 857.984v-56c0-4.416 3.584-8 8-8z m0-424h368c4.416 0 8 3.648 8 8v56a8 8 0 0 1-8 8h-368A8 8 0 0 1 384 433.984v-56c0-4.352 3.584-8 8-8z m528-139.968h-528A8 8 0 0 1 384 222.016v-56c0-4.416 3.584-8 8-8h528c4.416 0 8 3.584 8 8v56a8 8 0 0 1-8 8z m-256 424h-272A8 8 0 0 1 384 646.016v-56c0-4.416 3.584-8 8-8h272c4.416 0 8 3.584 8 8v56a8 8 0 0 1-8 8z" p-id="17453"></path>\n</svg>',c='<svg t="1557124685600" class="icon" style="" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="17561" xmlns:xlink="http://www.w3.org/1999/xlink" width="14" height="14">\n <defs>\n <style type="text/css"></style>\n </defs>\n <path d="M182.272 856.96a8 8 0 0 1-12.544 0l-112-141.952A8 8 0 0 1 64 702.08h76.032V172.032c0-4.416 3.584-8 7.936-8h56.064c4.352 0 7.936 3.584 7.936 8v529.984H288c6.72 0 10.496 7.808 6.272 12.992l-112 141.888z m209.728-626.944h176A8 8 0 0 0 576 222.016v-56a8 8 0 0 0-8-8h-176A8 8 0 0 0 384 166.016v56c0 4.416 3.584 8 8 8z m0 424h368a8 8 0 0 0 8-8v-56a8 8 0 0 0-8-8h-368A8 8 0 0 0 384 590.016v56c0 4.416 3.584 8 8 8z m528 139.968h-528a8 8 0 0 0-8 8v56c0 4.416 3.584 8 8 8h528a8 8 0 0 0 8-8v-56a8 8 0 0 0-8-8z m-256-424h-272A8 8 0 0 0 384 377.984v56c0 4.416 3.584 8 8 8h272a8 8 0 0 0 8-8v-56a8 8 0 0 0-8-8z" p-id="17562"></path>\n</svg>',h='<svg t="1557124695786" class="icon" style="" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="17670" xmlns:xlink="http://www.w3.org/1999/xlink" width="14" height="14">\n <defs>\n <style type="text/css"></style>\n </defs>\n <path d="M182.272 167.04a8 8 0 0 0-12.544 0L57.728 309.056A8 8 0 0 0 64 321.984h76.032v530.048c0 4.352 3.584 7.936 7.936 7.936h56.064a8 8 0 0 0 7.936-7.936V321.92H288a8 8 0 0 0 6.272-12.992l-112-141.888z m209.728 62.976h304A8 8 0 0 0 704 222.016v-56a8 8 0 0 0-8-8h-304A8 8 0 0 0 384 166.016v56c0 4.416 3.584 8 8 8z m0 424h304a8 8 0 0 0 8-8v-56a8 8 0 0 0-8-8h-304A8 8 0 0 0 384 590.016v56c0 4.416 3.584 8 8 8z m528 139.968h-528a8 8 0 0 0-8 8v56c0 4.416 3.584 8 8 8h528a8 8 0 0 0 8-8v-56a8 8 0 0 0-8-8z m0-424h-528A8 8 0 0 0 384 377.984v56c0 4.416 3.584 8 8 8h528a8 8 0 0 0 8-8v-56a8 8 0 0 0-8-8z" p-id="17671"></path>\n</svg>',u='<svg t="1557124710652" class="icon" style="" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="17779" xmlns:xlink="http://www.w3.org/1999/xlink" width="14" height="14">\n <defs>\n <style type="text/css"></style>\n </defs>\n <path d="M182.272 856.96a8 8 0 0 1-12.544 0l-112-141.952A8 8 0 0 1 64 702.08h76.032V172.032c0-4.416 3.584-8 7.936-8h56.064c4.352 0 7.936 3.584 7.936 8v529.984H288c6.72 0 10.496 7.808 6.272 12.992l-112 141.888z m209.728-626.944h304A8 8 0 0 0 704 222.016v-56a8 8 0 0 0-8-8h-304A8 8 0 0 0 384 166.016v56c0 4.416 3.584 8 8 8z m0 424h304a8 8 0 0 0 8-8v-56a8 8 0 0 0-8-8h-304A8 8 0 0 0 384 590.016v56c0 4.416 3.584 8 8 8z m528 139.968h-528a8 8 0 0 0-8 8v56c0 4.416 3.584 8 8 8h528a8 8 0 0 0 8-8v-56a8 8 0 0 0-8-8z m0-424h-528A8 8 0 0 0 384 377.984v56c0 4.416 3.584 8 8 8h528a8 8 0 0 0 8-8v-56a8 8 0 0 0-8-8z" p-id="17780"></path>\n</svg>',p='<svg width="16px" height="16px" viewBox="0 0 16 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n<g id="设计输出" stroke="none" stroke-width="1" fill-opacity="0.25" fill-rule="evenodd">\n <g id="设计输出-移动端指标详情页-阅读端" transform="translate(-3275.000000, -724.000000)" fill-rule="nonzero">\n <g id="编组-39" transform="translate(3064.500000, 667.000000)">\n <g id="编组-36" transform="translate(80.500000, 44.000000)">\n <g id="不排序" transform="translate(130.000000, 13.000000)">\n <path d="M12.0009375,12.40625 C12.0696875,12.40625 12.1259375,12.4625 12.1259375,12.53125 L12.1259375,12.53125 L12.1259375,13.40625 C12.1259375,13.475 12.0696875,13.53125 12.0009375,13.53125 L12.0009375,13.53125 L6.25093747,13.53125 C6.18218747,13.53125 6.12593747,13.475 6.12593747,13.40625 L6.12593747,13.40625 L6.12593747,12.53125 C6.12593747,12.4625 6.18218747,12.40625 6.25093747,12.40625 L6.25093747,12.40625 Z M2.93949997,2.5801875 L2.97437497,2.6109375 L4.72437497,4.828125 C4.78062497,4.89776786 4.74503823,4.99725765 4.66779698,5.02426203 L4.62593747,5.03125 L3.438,5.03089062 L3.43843747,10.9691406 L4.62593747,10.9691406 C4.73062497,10.9691406 4.78999997,11.0910156 4.72437497,11.1722656 L2.97437497,13.3894531 C2.92437497,13.4535156 2.82749997,13.4535156 2.77749997,13.3894531 L1.02749997,11.1722656 C0.961874969,11.0894531 1.02124997,10.9691406 1.12593747,10.9691406 L2.31343747,10.9691406 L2.313,5.03089062 L1.12593747,5.03125 C1.03620533,5.03125 0.979764,4.94285714 1.00679571,4.8654519 L1.02749997,4.828125 L2.77749997,2.6109375 C2.81749997,2.5596875 2.88749997,2.5494375 2.93949997,2.5801875 Z M10.5009375,9.09375 C10.5696875,9.09375 10.6259375,9.15 10.6259375,9.21875 L10.6259375,9.21875 L10.6259375,10.09375 C10.6259375,10.1625 10.5696875,10.21875 10.5009375,10.21875 L10.5009375,10.21875 L6.25093747,10.21875 C6.18218747,10.21875 6.12593747,10.1625 6.12593747,10.09375 L6.12593747,10.09375 L6.12593747,9.21875 C6.12593747,9.15 6.18218747,9.09375 6.25093747,9.09375 L6.25093747,9.09375 Z M14.5009375,5.78125 C14.5696875,5.78125 14.6259375,5.8375 14.6259375,5.90625 L14.6259375,5.90625 L14.6259375,6.78125 C14.6259375,6.85 14.5696875,6.90625 14.5009375,6.90625 L14.5009375,6.90625 L6.25093747,6.90625 C6.18218747,6.90625 6.12593747,6.85 6.12593747,6.78125 L6.12593747,6.78125 L6.12593747,5.90625 C6.12593747,5.8375 6.18218747,5.78125 6.25093747,5.78125 L6.25093747,5.78125 Z M9.00093747,2.46875 C9.06968747,2.46875 9.12593747,2.525 9.12593747,2.59375 L9.12593747,2.59375 L9.12593747,3.46875 C9.12593747,3.5375 9.06968747,3.59375 9.00093747,3.59375 L9.00093747,3.59375 L6.25093747,3.59375 C6.18218747,3.59375 6.12593747,3.5375 6.12593747,3.46875 L6.12593747,3.46875 L6.12593747,2.59375 C6.12593747,2.525 6.18218747,2.46875 6.25093747,2.46875 L6.25093747,2.46875 Z" id="形状结合"></path>\n </g>\n </g>\n </g>\n </g>q\n</g>\n</svg>',g='<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1590389330617" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="19656" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css"></style></defs><path d="M512 64c-247.4 0-448 200.6-448 448s200.6 448 448 448 448-200.6 448-448-200.6-448-448-448z m0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z" fill="" p-id="19657"></path><path d="M464 336c0 26.5 21.5 48 48 48s48-21.5 48-48-21.5-48-48-48-48 21.5-48 48zM536 448h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8v-272c0-4.4-3.6-8-8-8z" fill="" p-id="19658"></path></svg>',m='<?xml version="1.0" encoding="UTF-8"?>\n<svg width="23px" height="12px" viewBox="0 0 23 12" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>编组 8备份 3</title>\n <g id="----隐藏列标注!" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g id="隐藏列标注" transform="translate(-275.000000, -824.000000)">\n <rect fill="#FFFFFF" x="0" y="0" width="1333" height="1167"></rect>\n <g id="编组-8备份-3" transform="translate(275.000000, 824.000000)">\n <rect id="矩形" stroke-opacity="0.25" stroke="#000000" fill="#F7F7F7" x="0.5" y="0.5" width="11" height="11"></rect>\n <rect id="矩形备份-9" stroke-opacity="0.25" stroke="#000000" fill="#F7F7F7" x="11.5" y="0.5" width="11" height="11"></rect>\n <g id="7.Icon/arrow/15.down/fill" transform="translate(6.000000, 6.000000) rotate(90.000000) translate(-6.000000, -6.000000) " fill="#000000" fill-rule="nonzero" opacity="0.65">\n <path d="M7.25020811,6.37218077 L4.91348936,8.20968077 C4.82677061,8.27764952 4.69903624,8.21671202 4.69903624,8.10655577 L4.69903624,4.43272764 C4.69903624,4.32257139 4.82677061,4.26046202 4.91348936,4.32960264 L7.25020811,6.16593077 C7.31700499,6.21866514 7.31700499,6.31944639 7.25020811,6.37218077 Z" id="fill" transform="translate(5.999671, 6.269385) rotate(90.000000) translate(-5.999671, -6.269385) "></path>\n </g>\n <g id="7.Icon/arrow/15.down/fill" transform="translate(17.000000, 6.000000) rotate(270.000000) translate(-17.000000, -6.000000) translate(11.000000, 0.000000)" fill="#000000" fill-rule="nonzero" opacity="0.65">\n <path d="M7.25020811,6.37218077 L4.91348936,8.20968077 C4.82677061,8.27764952 4.69903624,8.21671202 4.69903624,8.10655577 L4.69903624,4.43272764 C4.69903624,4.32257139 4.82677061,4.26046202 4.91348936,4.32960264 L7.25020811,6.16593077 C7.31700499,6.21866514 7.31700499,6.31944639 7.25020811,6.37218077 Z" id="fill" transform="translate(5.999671, 6.269385) rotate(90.000000) translate(-5.999671, -6.269385) "></path>\n </g>\n </g>\n <line x1="286.5" y1="813" x2="286.5" y2="864.5" id="路径-2备份-3" stroke="#000000" opacity="0.25"></line>\n </g>\n </g>\n</svg>',v='<svg t="1557140120188" class="icon" style="" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="16909" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200">\n\t<defs>\n\t\t<style type="text/css">\n\t\t</style>\n\t</defs>\n\t<path d="M328 544h368c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8z"\n\tp-id="16910">\n\t</path>\n\t<path d="M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32z m-40 728H184V184h656v656z"\n\tp-id="16911">\n\t</path>\n</svg>',f='<svg t="1557140186692" class="icon" style="" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="17025" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200">\n\t<defs>\n\t\t<style type="text/css">\n\t\t</style>\n\t</defs>\n\t<path d="M328 544h152v152c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V544h152c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H544V328c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v152H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8z"\n\tp-id="17026">\n\t</path>\n\t<path d="M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32z m-40 728H184V184h656v656z"\n\tp-id="17027">\n\t</path>\n</svg>',C='<svg t="1565940955886" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="17472" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200">\n <defs>\n <style type="text/css"></style>\n </defs>\n <path\n d="M948 392.992l-403.008 488.99200001Q532 896 512.992 896t-32-14.016L76 392.992q-18.016-20.992-7.008-46.016T108 321.98400001L916 321.98400001q28 0 39.008 24.99199999T948 392.992z"\n p-id="17473" data-spm-anchor-id="a313x.7781069.0.i2" class="selected"></path>\n</svg>\n',y='<svg t="1565940955886" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="17472" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200">\n <defs>\n <style type="text/css"></style>\n </defs>\n <path\n fill-opacity="0.45"\n d="M948 392.992l-403.008 488.99200001Q532 896 512.992 896t-32-14.016L76 392.992q-18.016-20.992-7.008-46.016T108 321.98400001L916 321.98400001q28 0 39.008 24.99199999T948 392.992z"\n p-id="17473" data-spm-anchor-id="a313x.7781069.0.i2" class="selected"></path>\n</svg>\n',w='<svg t="1565940979768" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="17620" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200">\n<defs>\n<style type="text/css"></style>\n</defs>\n<path\nd="M76 631.008l403.008-488.99200001Q492 128 511.008 128t32 14.016L948 631.008q18.016 20.992 7.008 46.016T916 702.01599999L108 702.01599999q-28 0-39.008-24.99199999T76 631.008z"\np-id="17621"></path>\n</svg>\n',x='<svg t="1565940979768" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="17620" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200">\n <defs>\n <style type="text/css"></style>\n </defs>\n <path\n fill-opacity="0.45"\n d="M76 631.008l403.008-488.99200001Q492 128 511.008 128t32 14.016L948 631.008q18.016 20.992 7.008 46.016T916 702.01599999L108 702.01599999q-28 0-39.008-24.99199999T76 631.008z"\n p-id="17621"></path>\n</svg>\n',_='<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1596433821690" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="20229" width="16" height="16" xmlns:xlink="http://www.w3.org/1999/xlink"><defs><style type="text/css"></style></defs><path d="M888 792H200V168c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v688c0 4.4 3.6 8 8 8h752c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM305.8 637.7c3.1 3.1 8.1 3.1 11.3 0l138.3-137.6L583 628.5c3.1 3.1 8.2 3.1 11.3 0l275.4-275.3c3.1-3.1 3.1-8.2 0-11.3l-39.6-39.6c-3.1-3.1-8.2-3.1-11.3 0l-230 229.9L461.4 404c-3.1-3.1-8.2-3.1-11.3 0L266.3 586.7c-3.1 3.1-3.1 8.2 0 11.3l39.5 39.7z" p-id="20230"></path></svg>',S='<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1608030723688" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="21482" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16"><defs><style type="text/css"></style></defs><path d="M547.648 696a32 32 0 0 1 31.488 26.24l0.512 5.76v151.68l145.216-144.512a32 32 0 0 1 40.832-3.648l4.416 3.712a32 32 0 0 1 3.584 40.832l-3.712 4.48-203.072 202.24a32 32 0 0 1-40.768 3.648l-4.416-3.712-202.24-202.24a32 32 0 0 1 40.832-48.96l4.416 3.712 150.912 150.912v-158.144a32 32 0 0 1 32-32z m194.56-529.28l4.928 3.072 233.792 180.224a32 32 0 0 1 1.728 49.28l-4.864 3.52-409.792 245.568a32 32 0 0 1-27.328 2.624l-5.184-2.432-422.4-245.568a32 32 0 0 1-7.552-49.28l4.544-4.032 242.816-180.288a32 32 0 0 1 42.432 47.552l-4.288 3.84-203.84 151.296 364.16 211.648 353.28-211.712-196.608-151.552a32 32 0 0 1-8.896-40l3.136-4.864a32 32 0 0 1 40-8.96zM547.712 28.672a32 32 0 0 1 31.488 26.24l0.512 5.76v396.992a32 32 0 0 1-63.488 5.76l-0.512-5.76V60.736a32 32 0 0 1 32-32z" p-id="21483" fill="currentColor"></path></svg>\n',b='<svg viewBox="64 64 896 896" focusable="false" data-icon="eye" width="1em" height="1em" fill="currentColor" aria-hidden="true"><path d="M942.2 486.2C847.4 286.5 704.1 186 512 186c-192.2 0-335.4 100.5-430.2 300.3a60.3 60.3 0 000 51.5C176.6 737.5 319.9 838 512 838c192.2 0 335.4-100.5 430.2-300.3 7.7-16.2 7.7-35 0-51.5zM512 766c-161.3 0-279.4-81.8-362.7-254C232.6 339.8 350.7 258 512 258c161.3 0 279.4 81.8 362.7 254C791.5 684.2 673.4 766 512 766zm-4-430c-97.2 0-176 78.8-176 176s78.8 176 176 176 176-78.8 176-176-78.8-176-176-176zm0 288c-61.9 0-112-50.1-112-112s50.1-112 112-112 112 50.1 112 112-50.1 112-112 112z"></path></svg>',E='<svg width="64" height="41" viewBox="0 0 64 41" xmlns="http://www.w3.org/2000/svg"><g transform="translate(0 1)" fill="none" fill-rule="evenodd"><ellipse fill="#f5f5f5" cx="32" cy="33" rx="32" ry="7"></ellipse><g fill-rule="nonzero" stroke="#d9d9d9"><path d="M55 12.76L44.854 1.258C44.367.474 43.656 0 42.907 0H21.093c-.749 0-1.46.474-1.947 1.257L9 12.761V22h46v-9.24z"></path><path d="M41.613 15.931c0-1.605.994-2.93 2.227-2.931H55v18.137C55 33.26 53.68 35 52.05 35h-40.1C10.32 35 9 33.259 9 31.137V13h11.16c1.233 0 2.227 1.323 2.227 2.928v.022c0 1.605 1.005 2.901 2.237 2.901h14.752c1.232 0 2.237-1.308 2.237-2.913v-.007z" fill="#fafafa"></path></g></g></svg>',L='<svg class="icon" viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="200" height="200"><path d="M0 0h1024v1024H0z" fill="#000000" opacity=".01" p-id="5072"></path><path d="M520 128C736.496 128 912 303.504 912 520S736.496 912 520 912C303.6 911.76 128.24 736.4 128 520 128 303.504 303.504 128 520 128z m0 60.288c-183.12 0.192-331.52 148.592-331.712 331.712 0 183.2 148.496 331.712 331.712 331.712 183.2 0 331.712-148.512 331.712-331.712S703.2 188.288 520 188.288z m-84.528 176.576l233.776 155.264-233.76 155.024V364.864z" fill="#A8ADBB" p-id="5073"></path></svg>',T={},O=(e,t)=>{T[(0,o.lowerCase)(e)]=t},R=e=>T[(0,o.lowerCase)(e)];(0,o.keys)(s).forEach(e=>{const t=(0,o.get)(s,e);O(e,t)})},"./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/common/icons/gui-icon.js"(e,t,i){"use strict";i.d(t,{r:()=>p});var s=i("./node_modules/.pnpm/@antv+g@6.3.3/node_modules/@antv/g/dist/index.esm.js"),o=i("./node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/lodash.js"),n=i("./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/engine/CustomImage.js"),r=i("./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/utils/g-utils.js"),l=i("./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/common/debug/index.js"),a=i("./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/common/icons/factory.js");const d="<svg",c="data:image/svg+xml",h={},u={};class p extends s.YJ{constructor(e){super({name:e.name}),this.iconPathShapes=[],this.usePathMode=!1,this.isOnlineLink=e=>/^(?:https?:)?(?:\/\/)/.test(e),this.cfg=e,this.render()}getCfg(){return this.cfg}tryRenderAsPath(e,t){const i=(0,a.s)(e);if(!i)return!1;if(i.includes(c)||this.isOnlineLink(i))return!1;const o=e;let n=u[o];if(!n){const e=function(e){if(/transform|translate|scale|rotate|<g|<rect|<circle|<ellipse|<line|<polyline|<polygon|<text|<tspan/i.test(e))return null;const t=e.match(/viewBox=["']([^"']+)["']/);if(!t)return null;const i=t[1].split(/\s+/).map(Number);if(i.length<4)return null;const s={width:i[2],height:i[3]},o=e.replace(/[\r\n]+/g," ");let n=[];const r=o.match(/\bd="[^"]+"/g);if(r&&(n=r.map(e=>e.slice(3,-1))),0===n.length){const e=o.match(/\bd='[^']+'/g);e&&(n=e.map(e=>e.slice(3,-1)))}return 0===n.length?null:{viewBox:s,paths:n}}(i);e&&(n=e,u[o]=e)}if(!n)return!1;const{x:r=0,y:l=0,width:d,height:h,cursor:p}=this.cfg,g="number"==typeof d?d:0,m="number"==typeof h?h:0,v=g/n.viewBox.width,f=m/n.viewBox.height;this.iconPathShapes.forEach(e=>{this.removeChild(e),e.destroy()}),this.iconPathShapes=[];const C=new s.rw({style:{x:"number"==typeof r?r:0,y:"number"==typeof l?l:0,width:g,height:m,fill:"transparent",cursor:p||"default"}});this.appendChild(C),this.iconPathShapes.push(C);for(const e of n.paths){const i=new s.wA({style:{d:e,fill:t||"#000",transformOrigin:"0 0",transform:`translate(${r}, ${l}) scale(${v}, ${f})`,cursor:p||"default",pointerEvents:"none"}});this.appendChild(i),this.iconPathShapes.push(i)}return!0}getImage(e,t,i){return new Promise((s,o)=>{let n=(0,a.s)(e);if(!n)return;const r=new Image;if(r.onload=()=>{h[t]=r,s(r)},r.onerror=o,n&&(n.includes(c)||this.isOnlineLink(n)))r.src=n,r.crossOrigin="anonymous";else{i&&(n=n.replace(/fill=[\'\"]\#?\w+[\'\"]/g,""),n=n.replace(/fill>/g,">")),n=n.replace(d,`${d} fill="${i}"`);const e=new Blob([n],{type:"image/svg+xml"}),t=URL.createObjectURL(e),s=r.onload;r.onload=e=>{URL.revokeObjectURL(t),null==s||s.call(r,e)};const o=r.onerror;r.onerror=e=>{URL.revokeObjectURL(t),"function"==typeof o&&o.call(r,e)},r.src=t}})}render(){const{name:e,fill:t,iconStrategy:i}=this.cfg;if("path"===i&&this.tryRenderAsPath(e,t))return void(this.usePathMode=!0);this.usePathMode=!1;const s=(0,o.clone)(this.cfg),r=new n.$(p.type,{style:(0,o.omit)(s,["fill","iconStrategy"])});this.iconImageShape=r,this.setImageAttrs({name:e,fill:t})}reRender(e){this.name=e.name,this.cfg=e;const{name:t,fill:i,iconStrategy:s}=this.cfg;if(this.usePathMode&&(this.iconPathShapes.forEach(e=>{this.removeChild(e),e.destroy()}),this.iconPathShapes=[]),"path"===s&&this.tryRenderAsPath(t,i))return void(this.usePathMode=!0);this.usePathMode=!1;const l=(0,o.clone)(this.cfg);this.iconImageShape?(this.iconImageShape.imgType=p.type,(0,r.w)(this.iconImageShape,(0,o.omit)(l,["fill","iconStrategy"]))):this.iconImageShape=new n.$(p.type,{style:(0,o.omit)(l,["fill","iconStrategy"])}),this.setImageAttrs({name:t,fill:i})}updatePosition(e){if(this.usePathMode){const{width:t,height:i}=this.cfg,s=u[this.cfg.name];if(s){const o=("number"==typeof t?t:0)/s.viewBox.width,n=("number"==typeof i?i:0)/s.viewBox.height;this.iconPathShapes.forEach(t=>{t.style.transform=`translate(${e.x}, ${e.y}) scale(${o}, ${n})`})}}else this.iconImageShape&&(0,r.w)(this.iconImageShape,e)}setImageAttrs(e){if(this.usePathMode){const t=e.fill||this.cfg.fill||"#000";return void this.iconPathShapes.slice(1).forEach(e=>{e.style.fill=t})}let{name:t,fill:i}=e;const{iconImageShape:s}=this;if(!s)return;t=t||this.cfg.name,i=i||this.cfg.fill;const o=`${t}-${i}`,n=h[o];n?(s.attr("src",n),this.appendChild(s)):this.getImage(t,o,i).then(e=>{this.destroyed?l.U.getInstance().logger(`GuiIcon ${t} destroyed.`):(s.attr("src",e),this.appendChild(s))}).catch(e=>{e instanceof TypeError?console.warn(`GuiIcon ${t} destroyed:`,e):console.error(`GuiIcon ${t} load failed:`,e)})}toggleVisibility(e){const t=e?"visible":"hidden";this.setAttribute("visibility",t),this.usePathMode?this.iconPathShapes.forEach(e=>{e.style.visibility=t}):this.iconImageShape&&this.iconImageShape.setAttribute("visibility",t)}}p.type="__GUI_ICON__"},"./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/common/interface/basic.js"(e,t,i){"use strict";var s,o,n;i.d(t,{F4:()=>n,Ok:()=>o,cV:()=>s}),function(e){e.TOP="TOP",e.BOTTOM="BOTTOM",e.LEFT="LEFT",e.RIGHT="RIGHT"}(s||(s={})),function(e){e.BORDER_BOX="borderBox",e.PADDING_BOX="paddingBox",e.CONTENT_BOX="contentBox"}(o||(o={})),function(e){e.SUM="SUM",e.MIN="MIN",e.MAX="MAX",e.AVG="AVG",e.COUNT="COUNT"}(n||(n={}))},"./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/common/interface/export.js"(e,t,i){"use strict";var s;i.d(t,{q:()=>s}),function(e){e.PLAIN="text/plain",e.HTML="text/html"}(s||(s={}))},"./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/common/interface/node.js"(e,t,i){"use strict";var s;i.d(t,{Q:()=>s}),function(e){e.Row="row",e.Col="col",e.Series="series"}(s||(s={}))},"./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/engine/CustomImage.js"(e,t,i){"use strict";i.d(t,{$:()=>o});var s=i("./node_modules/.pnpm/@antv+g@6.3.3/node_modules/@antv/g/dist/index.esm.js");class o extends s._V{constructor(e,t){super(t),this.imgType=e}}},"./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/utils/cell/cell.js"(e,t,i){"use strict";var s=i("./node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/lodash.js"),o=i("./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/common/interface/basic.js"),n=i("./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/utils/cell/header-cell.js");i.d(t,["Bh",0,(e,t,i,s)=>{const o=(i-e)/2;switch(s){case"top":return t+o;case"middle":return t-e/2;default:return t-o-e}},"Cb",0,e=>{const{bbox:t,textWidth:i,textAlign:s,groupedIcons:o,iconStyle:r,isCustomRenderer:l=!1}=e,{x:a,width:d}=t,c=(0,n.kZ)(o.left,r),h=(0,n.kZ)(o.right,r);let u,p,g;switch(s){case"left":p=a,u=a+c,g=u+i+(h&&r.margin.left);break;case"right":u=a+d-h-(l?i:0),p=u-(l?0:i)-c,g=a+d-h+(h&&r.margin.left);break;default:p=a+d/2-(c+i+h)/2,u=p+c+(l?0:i/2),g=p+c+i+(h&&r.margin.left)}return{textX:u,leftIconX:p,rightIconX:g}},"f9",0,(e,t,i,s)=>{if(s===o.Ok.BORDER_BOX)return e;let{x:n,y:r,width:l,height:a}=e;const{padding:d,horizontalBorderWidth:c=0,verticalBorderWidth:h=0}=i;return t.forEach(e=>{const t=[o.cV.BOTTOM,o.cV.TOP].includes(e)?c:h;switch(e){case o.cV.TOP:r+=t,a-=t;break;case o.cV.BOTTOM:a-=t;break;case o.cV.LEFT:n+=t,l-=t;break;default:l-=t}}),s===o.Ok.CONTENT_BOX&&(n+=null==d?void 0:d.left,r+=null==d?void 0:d.top,l-=(null==d?void 0:d.left)+(null==d?void 0:d.right),a-=(null==d?void 0:d.top)+(null==d?void 0:d.bottom)),{x:n,y:r,width:l,height:a}},"l2",0,(e,t)=>{const{y:i,height:s}=e;switch(t){case"top":return i;case"middle":return i+s/2;default:return i+s}},"qi",0,(e,t,i)=>{const{x:n,y:r,width:l,height:a}=t||{},{horizontalBorderWidth:d=0,horizontalBorderColorOpacity:c,horizontalBorderColor:h,verticalBorderWidth:u=0,verticalBorderColor:p,verticalBorderColorOpacity:g,borderDash:m}=i||{},v=(0,s.isEmpty)(m)?"":m,f=[o.cV.TOP,o.cV.BOTTOM].includes(e)?{lineWidth:d,stroke:h,strokeOpacity:c,lineDash:v}:{lineWidth:u,stroke:p,strokeOpacity:g,lineDash:v};let C=0,y=0,w=0,x=0;if(e===o.cV.TOP||e===o.cV.BOTTOM){let t=r;t=e===o.cV.TOP?r+d/2:r+a-d/2,y=t,x=t,C=n,w=n+l}if(e===o.cV.LEFT||e===o.cV.RIGHT){let t=n;t=e===o.cV.LEFT?n+u/2:n+l-u/2,C=t,w=t,y=r,x=r+a}return{position:{x1:C,x2:w,y1:y,y2:x},style:f}}])},"./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/utils/cell/header-cell.js"(e,t,i){"use strict";var s=i("./node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/lodash.js"),o=i("./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/common/constant/field.js");const n=(e=[],t="right")=>e.map(e=>"string"==typeof e?{name:e,position:t}:e);i.d(t,["AS",0,(e=[],t,i)=>{const o=((e=[])=>e.map(e=>Object.assign(Object.assign({},e),{icons:n(e.icons)})))(e),r=(0,s.find)(o,e=>((e,t,i)=>{if(!e)return!1;const{icons:o,displayCondition:n,belongsCell:r}=e;return!(0,s.isEmpty)(o)&&r===i&&o.some(e=>{var i,s,o;return null===(o=null!==(s=null===(i=e.displayCondition)||void 0===i?void 0:i.call(e,t,e.name))&&void 0!==s?s:null==n?void 0:n(t,e.name))||void 0===o||o})})(e,t,i));if(!r)return;const l=r.icons.filter(e=>{var i,s,o,n;return null===(n=null!==(s=null===(i=e.displayCondition)||void 0===i?void 0:i.call(e,t,e.name))&&void 0!==s?s:null===(o=r.displayCondition)||void 0===o?void 0:o.call(r,t,e.name))||void 0===n||n});return Object.assign(Object.assign({},r),{icons:l})},"ar",0,(e,t)=>{const{value:i,field:n}=e;return(0,s.isEqual)(n,o.GJ)?{formattedValue:t||i,value:i}:{formattedValue:i,value:i}},"kZ",0,(e=[],t)=>{if((0,s.isEmpty)(e))return 0;const{margin:i,size:o}=t;return e.reduce((e,{position:t})=>e+o+("left"===t?i.right:i.left),0)},"y0",0,(e=[],t)=>{const i=(0,s.merge)({left:[],right:[]},(0,s.groupBy)(e,"position"));return t&&("left"===t.position?i.left.push(t):i.right.unshift(t)),i}])},"./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/utils/condition/condition.js"(e,t,i){"use strict";var s=i("./node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/lodash.js"),o=i("./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/utils/formatter.js");i.d(t,["NV",0,(e=[],t)=>(0,s.findLast)((0,s.compact)(e),e=>e.field instanceof RegExp?e.field.test(t):e.field===t),"dq",0,e=>{var t;return null!==(t=null==e?void 0:e.position)&&void 0!==t?t:"right"},"o1",0,(e=0,t=0)=>{if(e=(0,o.F)(e),t=(0,o.F)(t),e===t)return()=>({zeroScale:0,scale:0});const i=e>=0,n=t>=0&&e<=0,r=n?0:i?e:t,l=t-e;return t=>{const o=i?0:1;return{zeroScale:n?(0,s.clamp)(Math.abs(0-e)/l,0,1):o,scale:(0,s.clamp)((t-r)/l,-1,1)}}}])},"./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/utils/dataset/pivot-data-set.js"(e,t,i){"use strict";i.d(t,{$0:()=>S,AB:()=>m,Ir:()=>g,K0:()=>c,LR:()=>l,Ll:()=>v,Rl:()=>f,XN:()=>u,_K:()=>p,bh:()=>C,eE:()=>w,i9:()=>y,j0:()=>a,t$:()=>_,uQ:()=>d});var s=i("./node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/lodash.js"),o=i("./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/common/constant/field.js"),n=i("./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/common/constant/query.js"),r=i("./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/utils/layout/generate-id.js");function l(e=[]){return e.filter(e=>e!==o.GJ)}function a(e){return e===o.YZ}function d(e={},t=[],i=o.jI){return t.reduce((t,s)=>(t.push(s in e?(0,r.mN)(e[s]):i),t),[])}function c(e,t){const i=t.filter(t=>t in e);return(0,s.isEmpty)(i)&&i.push(o.IW),i}function h(e={},t=[],i){const s=[];function n(e,t,i){return t.reduce((t,s)=>(t.push(s in e?(0,r.mN)(e[s]):s===o.GJ&&i?i:o.jI),t),[])}return i?i.forEach(i=>{s.push(n(e,t,i))}):s.push(n(e,t)),s}function u(e,t=[],i){var s;const o=t.slice(0,t.indexOf(e)+1);return null===(s=i.map(e=>o.map(t=>e.getValueByField(t)).join("[&]")))||void 0===s?void 0:s.filter(Boolean)}function p(e,t){return e.concat(t).filter(e=>e!==o.GJ).join("[&]")}function g(e){const{rowDimensionValues:t,colDimensionValues:i,isFirstCreate:s,onFirstCreate:n,rowFields:l,colFields:d,rowPivotMeta:c,colPivotMeta:h,prefix:u=""}=e,p=(e,t,i,l)=>{let d=i;const c=[];for(let i=0;i<t.length;i++){const h=t[i];if(s&&d&&!(null==d?void 0:d.has(h))){const s=t.slice(0,i+1).map(e=>(0,r.mN)(e)),a=s.join("[&]");let c;c=h===o.jI?0:d.has(o.jI)?d.size:d.size+1,d.set(h,{id:a,dimensions:s,value:h,level:c,children:new Map}),null==n||n({dimension:null==e?void 0:e[i],dimensionPath:a,careRepeated:l})}const u=null==d?void 0:d.get(h);if(c.push(a(h)?h:null==u?void 0:u.level),u){const t=null==e?void 0:e[i+1];s&&u.childField!==t&&(u.childField=t),d=null==u?void 0:u.children}}return c};return[u,...p(l,t,c,!1),...p(d,i,h,!0)]}function m(e=[]){return e.filter(s.isString)}function v(e){const{rows:t=[],columns:i=[],values:o,valueInCols:n,data:r=[],indexesData:l={},sortedDimensionValues:a,rowPivotMeta:d,colPivotMeta:u,getExistValuesByDataItem:m}=e,v=[],f=new Set((0,s.intersection)(t,i)),C=({dimension:e,dimensionPath:t,careRepeated:i=!0})=>{i&&f.has(e)||(a[e]||(a[e]=[])).push(t)},y=p(t,i);return r.forEach(e=>{if(!e||(0,s.isEmpty)(e))return;const r=m?m(e,o):c(e,o),a=h(e,t,n?null:r),p=h(e,i,n?r:null);for(const o of a)for(const n of p){const r=g({rowDimensionValues:o,colDimensionValues:n,rowPivotMeta:d,colPivotMeta:u,rowFields:t,colFields:i,isFirstCreate:!0,onFirstCreate:C,prefix:y});v.push(r),(0,s.set)(l,r,e)}}),{paths:v,indexesData:l,rowPivotMeta:d,colPivotMeta:u,sortedDimensionValues:a}}function f(e,t){if(!e||!t)return;const i=t.split("[&]"),o=(0,s.last)(i);let n=e;(0,s.forEach)(i,(e,t)=>{const i=n.get(e);return i?(e===o?(i.children=new Map,i.childField=void 0):n=i.children,!0):0===t&&"root"===e})}function C(e,t,i){return{field:o.GJ,name:t||i,formatter:t=>(t=>{const i=(0,s.find)(e,({field:e})=>e===t);return(0,s.get)(i,"name",t)})(t)}}function y(e,t){return{isRowGrandTotal:e.isGrandTotals,isRowSubTotal:e.isSubTotals,isColGrandTotal:t.isGrandTotals,isColSubTotal:t.isSubTotals}}function w(e){const{pivotMeta:t,dimensionValues:i,fieldIdx:r,queryType:l,fields:d,sortedDimensionValues:c}=e;let h=[{children:t}];function u(e,t){var i;const r=(0,s.flatMap)(e,e=>{const t=[];for(const i of e.children.values())i.value===o.IW||l!==n.B.All&&i.value===o.jI||t.push(i);return t});if(e.length>1){const e=null!==(i=c[t])&&void 0!==i?i:[],s=new Map(e.map((e,t)=>[e,t]));return r.sort((e,t)=>{var i,o;return(null!==(i=s.get(e.id))&&void 0!==i?i:0)-(null!==(o=s.get(t.id))&&void 0!==o?o:0)}),r}return r}for(let e=0;e<=r;e++){const t=i[e],s=d[e];h=a(t)?u(h,s):h.map(e=>e.children.get(t)).filter(Boolean)}return h}function x(e){const{dimensionValues:t,pivotMeta:i,fields:o,sortedDimensionValues:r,queryType:l=n.B.All}=e;if(!function(e){let t=null;for(let i=0;i<e.length;i++)if(a(e[i]))t=i;else if(!(0,s.isNull)(t)&&t<i)return!0;return!1}(t))return[t];return w({pivotMeta:i,dimensionValues:t,fieldIdx:t.length-1,queryType:l,fields:o,sortedDimensionValues:r}).map(e=>e.dimensions)}function _(e){const{rowFields:t,rowDimensionValues:i,rowPivotMeta:s,colFields:o,colDimensionValues:n,colPivotMeta:r,queryType:l,sortedDimensionValues:a}=e;return{rowQueries:x({dimensionValues:i,pivotMeta:s,fields:t,sortedDimensionValues:a,queryType:l}),colQueries:x({dimensionValues:n,pivotMeta:r,fields:o,sortedDimensionValues:a,queryType:l})}}function S(e,t){return e?(0,s.isArray)(e)?(0,s.flatMap)(e,e=>{if(!(0,s.isArray)(e))return(0,s.compact)([e]);return(0,s.compact)(e.slice(t===n.B.DetailOnly?1:0))}):(0,s.compact)([e]):[]}},"./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/utils/export/copy/core.js"(e,t,i){"use strict";i.d(t,{mc:()=>A,Wg:()=>B,w6:()=>I});var s=i("./node_modules/.pnpm/tslib@2.8.1/node_modules/tslib/tslib.es6.mjs"),o=i("./node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/lodash.js"),n=i("./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/common/constant/interaction.js"),r=i("./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/common/interface/export.js"),l=i("./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/utils/export/method.js"),a=i("./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/utils/export/utils.js"),d=i("./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/common/constant/field.js"),c=i("./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/common/interface/node.js"),h=i("./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/utils/dataset/pivot-data-set.js"),u=i("./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/utils/ssr.js");const p=(e,t="\t")=>({type:r.q.PLAIN,content:(0,o.map)(e,e=>e.join(t)).join("\r\n")}),g=e=>{const t=(i="tr",e.map(e=>`<${i}>${function(e,t){return e.map(e=>`<${t}>${(0,o.escape)(e)}</${t}>`).join("")}(e,"td")}</${i}>`).join(""));var i;return{type:r.q.HTML,content:`<meta charset="utf-8"><table><tbody>${t}</tbody></table>`}},m={[r.q.PLAIN]:p,[r.q.HTML]:g},v=({rowMatrix:e,colMatrix:t,dataMatrix:i,cornerMatrix:s})=>{var n,r,l,a,d,c;const h=null!==(r=null===(n=null==e?void 0:e[0])||void 0===n?void 0:n.length)&&void 0!==r?r:0,u=null!==(l=null==t?void 0:t.length)&&void 0!==l?l:0,p=null!==(d=null===(a=i[0])||void 0===a?void 0:a.length)&&void 0!==d?d:0,g=null!==(c=i.length)&&void 0!==c?c:0,m=h+p,v=u||(h>0?1:0),f=v+g;let C=Array.from(Array(f),()=>new Array(m));return C=(0,o.map)(C,(n,r)=>(0,o.map)(n,(o,n)=>{var l,a;return n>=0&&n<h&&r>=0&&r<v?null!==(a=null===(l=null==s?void 0:s[r])||void 0===l?void 0:l[n])&&void 0!==a?a:"":n>=h&&n<=m&&r>=0&&r<u?t[r][n-h]:n>=0&&n<h&&r>=v&&r<f?null==e?void 0:e[r-v][n]:n>=h&&n<=m&&r>=v&&r<f?i[r-v][n-h]:void 0})),C};function f(e){var t;return null!==(t=(0,o.max)((0,o.map)(e,e=>e.length)))&&void 0!==t?t:0}function C({spreadsheet:{options:{interaction:e}},config:{formatOptions:t=!1,separator:i="\t",selectedCells:s=[],customTransformer:o,async:n=!1},isExport:l}){var a,d;const{copy:c}=e,{formatData:h,formatHeader:u}=l?(e=>{var t,i;return"object"==typeof e?{formatHeader:null!==(t=e.formatHeader)&&void 0!==t&&t,formatData:null!==(i=e.formatData)&&void 0!==i&&i}:{formatHeader:null!=e&&e,formatData:null!=e&&e}})(t):{formatData:null!==(a=null==c?void 0:c.withFormat)&&void 0!==a&&a,formatHeader:null!==(d=null==c?void 0:c.withFormat)&&void 0!==d&&d},p=function(e){if(!e)return m;const t=e(m);return{[r.q.PLAIN]:t[r.q.PLAIN]||m[r.q.PLAIN],[r.q.HTML]:t[r.q.HTML]||m[r.q.HTML]}}(l?o:null==c?void 0:c.customTransformer);return{separator:i,selectedCells:s,transformers:p,formatData:h,formatHeader:u,async:n}}const y=e=>{const t=[],i=e=>{var s,o,n;if("root"===e.id)return;const r=null===(n=null===(o=null===(s=e.spreadsheet)||void 0===s?void 0:s.dataSet)||void 0===o?void 0:o.getFieldFormatter)||void 0===n?void 0:n.call(o,e.field),l=e.isTotalRoot||!r?e.value:r(e.value);return t.unshift(l),(null==e?void 0:e.parent)?i(e.parent):void 0};return i(e),t},w=(e,t)=>{const{rowIndex:i,colIndex:s}=e,{facet:o}=t;return[o.getRowNodeByIndex(i),o.getColNodeByIndex(s)]},x={timeout:3e3};class _{initIdleCallbackCount(e){this.idleCallbackCount=e>=5e3?5e3:e}constructor(e){this.matrixHtmlTransformer=e=>this.config.transformers[r.q.HTML](e);const{spreadsheet:t,isExport:i=!1,config:s}=e;this.spreadsheet=t,this.config=C({config:s,spreadsheet:t,isExport:i})}getHeaderNodeMatrix(e){const{formatHeader:t}=this.config;return(0,l.iT)((0,l.eF)(e.id),e.spreadsheet,t)}matrixPlainTextTransformer(e,t){const i=(0,o.map)(e,e=>(0,o.map)(e,l.E0));return this.config.transformers[r.q.PLAIN](i,t)}matrixTransformer(e,t="\t"){return[this.matrixPlainTextTransformer(e,t),this.matrixHtmlTransformer(e)]}getFormatter(e){const{field:t,rowIndex:i,colIndex:s}=e;if(this.config.formatData){const e=this.spreadsheet.facet.getCellMeta(i,s);return i=>{const s=this.spreadsheet.dataSet.getFieldFormatter(t);return null==s?void 0:s(i,null==e?void 0:e.data,e)}}return e=>e}isEnableASync(){return!(0,u.fU)()&&this.config.async&&!!window.requestIdleCallback}}class S extends _{constructor(e){super(e),this.leafRowNodes=[],this.leafColNodes=[],this.compatibleHideMeasureColumn=()=>{var e,t,i,s;return(null===(i=null===(t=null===(e=this.spreadsheet.options)||void 0===e?void 0:e.style)||void 0===t?void 0:t.colCell)||void 0===i?void 0:i.hideValue)&&this.spreadsheet.isValueInCols()?{[d.GJ]:null===(s=this.spreadsheet.dataCfg.fields.values)||void 0===s?void 0:s[0]}:{}},this.getDataMatrixByHeaderNode=()=>{const e=this.compatibleHideMeasureColumn();return(0,o.map)(this.leafRowNodes,t=>this.leafColNodes.map(i=>this.getDataCellValue({rowNode:t,colNode:i,config:{measureQuery:e}})))},this.getDataMatrixByHeaderNodeRIC=()=>{const e=[];let t=0;const i=this.compatibleHideMeasureColumn();return new Promise((s,o)=>{try{const o=n=>{const r=this.leafRowNodes.length;for(this.initIdleCallbackCount(r);(n.timeRemaining()>0||n.didTimeout)&&t<=r-1&&this.idleCallbackCount>0;)for(let s=t;s<r&&this.idleCallbackCount>0;s++){const o=[],n=this.leafRowNodes[s];for(let e=0;e<this.leafColNodes.length;e++){const t=this.getDataCellValue({rowNode:n,colNode:this.leafColNodes[e],config:{measureQuery:i}});o.push(t)}t++,e.push(o),this.idleCallbackCount--}t===r?s(e):(this.initIdleCallbackCount(r),requestIdleCallback(o,x))};requestIdleCallback(o,x)}catch(e){o(e)}})},this.getDataCellValue=({rowNode:e,colNode:t,config:i})=>{var s;const{measureQuery:n}=i,r=Object.assign(Object.assign(Object.assign({},e.query),t.query),n),a=this.spreadsheet.dataSet.getCellData({query:r,rowNode:e,isTotals:e.isTotals||e.isTotalMeasure||t.isTotals||t.isTotalMeasure,totalStatus:(0,h.i9)(e,t)}),c=this.spreadsheet.isValueInCols()?t:e;let u=null!==(s=(0,l.Nk)(this.spreadsheet.isPivotMode,c))&&void 0!==s?s:"";const{values:p}=this.spreadsheet.dataCfg.fields;u=(null==p?void 0:p.includes(u))?u:null==p?void 0:p[0];const g=this.getFormatter({field:null!=u?u:t.field,rowIndex:e.rowIndex,colIndex:t.colIndex}),m=null==a?void 0:a[d.nj],v=(0,o.isPlainObject)(null==m?void 0:m.values)?"":m;return g(null!=v?v:"")},this.getCustomRowCornerMatrix=e=>{const t=f(null!=e?e:[]),i=this.spreadsheet.facet.getCornerNodes(),s=(0,o.sortBy)(i,e=>e.cornerType===c.Q.Col?0:1);return this.spreadsheet.isHierarchyTreeType()?(0,o.map)(s,e=>{const i=new Array(t).fill("");return i[t-1]=e.value,i}):Object.values((0,o.groupBy)(s,"y")).map(e=>[...new Array(t-e.length).fill(""),...e.map(e=>e.value)])},this.getFieldName=e=>this.config.formatHeader?this.spreadsheet.dataSet.getFieldName(e):this.spreadsheet.dataSet.getField(e),this.getCornerMatrix=e=>{if(this.spreadsheet.isCustomRowFields())return this.getCustomRowCornerMatrix(e);const{colsHierarchy:t}=this.spreadsheet.facet.getLayoutResult(),{fields:i}=this.spreadsheet.dataCfg,{columns:s=[],rows:n=[]}=i,r=this.spreadsheet.isCustomColumnFields()?t.getNodes().slice(0,t.sampleNodesForAllLevels.length).map(e=>e.field):[...s,""],l=this.spreadsheet.isHierarchyTreeType()?f(null!=e?e:[]):n.length,a=(0,o.slice)(n,0,l);return(0,o.map)(r,(e,t)=>(0,o.map)(a,(i,s)=>t===r.length-1?this.getFieldName(i):s===l-1?this.getFieldName(e):""))},this.getDataMatrixByDataCell=e=>{const{copy:t}=this.spreadsheet.options.interaction,i=this.compatibleHideMeasureColumn(),s=(0,o.map)(e,e=>(0,o.map)(e,e=>{const[t,s]=w(e,this.spreadsheet);return this.getDataCellValue({rowNode:t,colNode:s,config:{measureQuery:i}})}));if(!(null==t?void 0:t.withHeader))return this.matrixTransformer(s,this.config.separator);const n=this.getRowMatrix(),r=this.getColMatrix();return this.matrixTransformer(v({rowMatrix:n,colMatrix:r,dataMatrix:s}),this.config.separator)},this.getAsyncAllPivotCopyData=()=>(0,s.sH)(this,void 0,void 0,function*(){const e=this.getRowMatrix(),t=this.getColMatrix(),i=this.getCornerMatrix(e);let s=[];s=this.isEnableASync()?yield this.getDataMatrixByHeaderNodeRIC():yield Promise.resolve(this.getDataMatrixByHeaderNode());return this.matrixTransformer(v({rowMatrix:e,colMatrix:t,dataMatrix:s,cornerMatrix:i}),this.config.separator)}),this.getPivotAllCopyData=()=>{const e=this.getRowMatrix(),t=this.getColMatrix(),i=this.getCornerMatrix(e),s=this.getDataMatrixByHeaderNode();return this.matrixTransformer(v({rowMatrix:e,colMatrix:t,dataMatrix:s,cornerMatrix:i}),this.config.separator)},this.leafRowNodes=this.getLeafRowNodes(),this.leafColNodes=this.getLeafColNodes()}getHeaderNodeMatrix(e){return this.config.formatHeader?y(e):super.getHeaderNodeMatrix(e)}getLeafRowNodes(){const e=this.spreadsheet.facet.getRowLeafNodes(),t=(0,l.R5)(this.config.selectedCells),i=this.spreadsheet.isHierarchyTreeType();return(0,o.isEmpty)(t)?e:this.getSelectedNode(t,e,i)}getLeafColNodes(){const e=this.spreadsheet.facet.getColLeafNodes(),t=(0,l.F)(this.config.selectedCells);return(0,o.isEmpty)(t)?e:this.getSelectedNode(t,e)}getSelectedNode(e,t,i=!1){if(i){const i=new Set(e.map(e=>e.id));return t.filter(e=>i.has(e.id))}return e.reduce((e,i)=>{const s=i.id,o=t.filter(e=>e.id===s||e.id.startsWith(s+"[&]"));return e.push(...o),e},[])}getColMatrix(){return(0,o.zip)(...(0,o.map)(this.leafColNodes,e=>this.getHeaderNodeMatrix(e)))}getRowMatrix(){return function(e){const t=f(e);return(0,o.map)(e,e=>{const i=t-e.length;return i?[...e,...new Array(i).fill("")]:e})}((0,o.map)(this.leafRowNodes,e=>this.getHeaderNodeMatrix(e)))}getPivotCopyData(){const{copy:e}=this.spreadsheet.options.interaction,t=this.getDataMatrixByHeaderNode();if(!(null==e?void 0:e.withHeader))return this.matrixTransformer(t,this.config.separator);const i=this.getRowMatrix(),s=this.getColMatrix();return this.matrixTransformer(v({rowMatrix:i,colMatrix:s,dataMatrix:t}),this.config.separator)}}function b(e){var t,i,s,r;const a=(0,l.Z8)(e),d=null!==(t=(0,o.max)(Array.from(a)))&&void 0!==t?t:0,c=function(e,t){return(0,o.filter)(e,e=>{const i=e.getMeta(),s=i.level===t,n=i.isTotals&&(0,o.isEmpty)(i.children);return s||n})}(e,d),h=e[0].cellType===n.vZ.COL_CELL,{spreadsheet:u}=e[0].getMeta(),m=function(e,t,i,s){return(0,o.map)(e,e=>{var n;const r=e.getMeta();if(s){const e=y(r),s=null!==(n=(0,o.min)(Array.from(i)))&&void 0!==n?n:0;return e.slice(s,t+1)}const{id:a,value:d,isTotals:c,level:h,spreadsheet:u}=r;let p=a;return c&&h!==t&&(p=a+"[&]"+(0,o.repeat)(d,t-h)),(0,l.iT)((0,l.eF)(p,i.size),u,!1)})}(c,d,a,null!==(r=null===(s=null===(i=u.options.interaction)||void 0===i?void 0:i.copy)||void 0===s?void 0:s.withFormat)&&void 0!==r&&r),v=h?(0,o.zip)(...m):m;return[p(v),g(v)]}class E extends _{constructor(e){super(e),this.getValueFromMeta=e=>{var t;const[,i]=w(e,this.spreadsheet),s=(0,l.Nk)(this.spreadsheet.isPivotMode,i),o=this.isSeriesNumberField(s)?e.rowIndex+1:null===(t=this.displayData[e.rowIndex])||void 0===t?void 0:t[s];return this.getFormatter({field:s,rowIndex:e.rowIndex,colIndex:e.colIndex})(o)},this.displayData=this.getSelectedDisplayData(),this.columnNodes=this.getSelectedColNodes()}getHeaderNodeMatrix(e){return super.getHeaderNodeMatrix(e)}getSelectedColNodes(){const e=(0,l.F)(this.config.selectedCells),t=this.spreadsheet.facet.getColLeafNodes();return 0===e.length?t:(0,o.map)(e,e=>t[e.colIndex])}getSelectedDisplayData(){const e=(0,l.R5)(this.config.selectedCells),t=this.spreadsheet.dataSet.getDisplayDataSet();return 0===e.length?t:(0,o.map)(e,e=>t[e.rowIndex])}getDataMatrix(){const{seriesNumber:e}=this.spreadsheet.options;return this.displayData.map((t,i)=>this.columnNodes.map((s,o)=>{const n=null==s?void 0:s.field;if(d.r2===n&&(null==e?void 0:e.enable)){const e=i+1;return this.getFormatter({field:n,rowIndex:i,colIndex:o})(e)}return this.getFormatter({field:n,rowIndex:i,colIndex:o})(null==t?void 0:t[n])}))}getDataMatrixRIC(){const{seriesNumber:e}=this.spreadsheet.options,t=[];let i=0;return new Promise((s,o)=>{try{const o=n=>{const r=this.displayData.length;for(this.initIdleCallbackCount(r);(n.timeRemaining()>0||n.didTimeout)&&i<=r-1&&this.idleCallbackCount>0;)for(let s=i;s<r&&this.idleCallbackCount>0;s++){const o=this.displayData[s],n=[];for(let t=0;t<this.columnNodes.length;t++){const r=this.columnNodes[t].field;if(d.r2===r&&(null==e?void 0:e.enable)){const e=s+1,i=this.getFormatter({field:r,rowIndex:s,colIndex:t});n.push(i(e));continue}const l=this.getFormatter({field:r,rowIndex:i,colIndex:t})(o[r]);n.push(l)}i++,t.push(n),this.idleCallbackCount--}i===r?s(t):(this.initIdleCallbackCount(r),requestIdleCallback(o,x))};requestIdleCallback(o,x)}catch(e){o(e)}})}isSeriesNumberField(e){const{seriesNumber:t}=this.spreadsheet.options;return d.r2===e&&(null==t?void 0:t.enable)}getColMatrix(){return(0,o.zip)(...this.columnNodes.map(e=>this.getHeaderNodeMatrix(e)))}getDataMatrixByDataCell(e){const{copy:t}=this.spreadsheet.options.interaction,i=(0,o.map)(e,e=>(0,o.map)(e,e=>this.getValueFromMeta(e)));if(!(null==t?void 0:t.withHeader))return this.matrixTransformer(i,this.config.separator);const s=this.getColMatrix();return this.matrixTransformer(v({colMatrix:s,dataMatrix:i}),this.config.separator)}processSelectedTable(e=!1){const t=this.getDataMatrix();if(!e)return this.matrixTransformer(t,this.config.separator);const i=this.getColMatrix();return this.matrixTransformer(v({colMatrix:i,dataMatrix:t}),this.config.separator)}asyncProcessSelectedTable(){return(0,s.sH)(this,arguments,void 0,function*(e=!1){const t=this.isEnableASync()?yield this.getDataMatrixRIC():yield Promise.resolve(this.getDataMatrix());if(!e)return this.matrixTransformer(t,this.config.separator);const i=this.getColMatrix();return this.matrixTransformer(v({colMatrix:i,dataMatrix:t}),this.config.separator)})}}const L=(e,t)=>e.isPivotMode()?function(e,t){return new S({spreadsheet:e,config:{selectedCells:t}}).getPivotCopyData()}(e,t):((e,t)=>new E({spreadsheet:e,config:{selectedCells:t}}).processSelectedTable())(e,t);function T(e){return!(0,o.isEmpty)(e)&&(0,o.every)(e,e=>e.cellType===n.vZ.ROW_CELL||e.cellType===n.vZ.COL_CELL)}function O(e,t,i,s){return s.isPivotMode()?(({spreadsheet:e,selectedCells:t,headerSelectedCells:i})=>new S({spreadsheet:e,config:{selectedCells:i,formatOptions:!0}}).getDataMatrixByDataCell(t))({spreadsheet:s,selectedCells:e,headerSelectedCells:(0,o.concat)(t,i)}):(({spreadsheet:e,selectedCells:t,headerSelectedCells:i})=>new E({spreadsheet:e,config:{selectedCells:i,formatOptions:!0}}).getDataMatrixByDataCell(t))({spreadsheet:s,selectedCells:e,headerSelectedCells:t})}function R(e,t){let i;const s=(0,l.F)(t),a=(0,l.R5)(t);if(e.interaction.getCurrentStateName()===n.xT.ALL_SELECTED)i=L(e,[]);else if(s.length)i=L(e,s);else if(a.length)i=L(e,a);else{if(!t.length)return[{type:r.q.PLAIN,content:""},{type:r.q.HTML,content:""}];const s=(e=>{if(!(null==e?void 0:e.length))return[];const[t,i]=[{row:1/0,col:1/0},{row:0,col:0}];e.forEach(e=>{const{rowIndex:s,colIndex:o}=e;t.col=Math.min(o,t.col),t.row=Math.min(s,t.row),i.col=Math.max(o,i.col),i.row=Math.max(s,i.row)});const[s,o]=[i.row-t.row+1,i.col-t.col+1],n=new Array(s).fill("").map(()=>new Array(o).fill(""));return e.forEach(e=>{const{rowIndex:i,colIndex:s}=e,[o,r]=[i-t.row,s-t.col];n[o][r]=e}),n})(t),l=s[0].map(e=>{var t;return Object.assign(Object.assign({},e),{id:(null==e?void 0:e.colId)||(0,o.last)(null===(t=null==e?void 0:e.id)||void 0===t?void 0:t.split("-"))||"",type:n.vZ.COL_CELL})}),a=s.map(e=>{var t,i,s;return Object.assign(Object.assign({},e[0]),{id:(null===(t=e[0])||void 0===t?void 0:t.rowId)||(0,o.first)(null===(s=null===(i=e[0])||void 0===i?void 0:i.id)||void 0===s?void 0:s.split("-"))||"",type:n.vZ.ROW_CELL})});i=O(s,l,a,e)}return i}const I=e=>{var t;const i=e.interaction,s=i.getState().cells||[],o=null!==(t=i.getInteractedCells())&&void 0!==t?t:[],n=T(o)?b(o):R(e,s);return n&&(0,a.lW)(n),n},N=e=>{const{sheetInstance:t}=e,i=t.enableAsyncExport();if(i instanceof Error)throw console.warn(i),i;return t.isPivotMode()?(e=>{const{sheetInstance:t,split:i,formatOptions:s,customTransformer:o,async:n}=e;return new S({spreadsheet:t,isExport:!0,config:{separator:i,formatOptions:s,customTransformer:o,async:null==n||n}}).getAsyncAllPivotCopyData()})(e):(e=>{const{sheetInstance:t,split:i,formatOptions:s,customTransformer:o,async:n}=e;return new E({spreadsheet:t,config:{selectedCells:[],separator:i,formatOptions:s,customTransformer:o,async:null==n||n},isExport:!0}).asyncProcessSelectedTable(!0)})(e)},B=e=>(0,s.sH)(void 0,void 0,void 0,function*(){return(yield N(e))[0].content}),A=e=>(0,s.sH)(void 0,void 0,void 0,function*(){return yield N(e)})},"./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/utils/export/method.js"(e,t,i){"use strict";i.d(t,{DV:()=>a,Z8:()=>d});var s=i("./node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/lodash.js"),o=i("./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/common/constant/field.js"),n=i("./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/common/constant/interaction.js"),r=i("./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/utils/layout/generate-id.js"),l=i("./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/utils/text.js");function a(e,t){return!(!e||!t)&&String(e).toLowerCase()===String(t).toLowerCase()}function d(e){const t=new Set;return(0,s.forEach)(e,e=>{const i=e.getMeta().level;t.has(i)||t.add(i)}),t}i.d(t,["E0",0,e=>{if("string"!=typeof e)return e;if(/[",\r\n\t]/.test(e)){return`"${e.replace(/"/g,'""').replace(/\r\n/g,"\n").replace(/\n/g,"\r\n")}"`}return e},"F",0,e=>e.filter(({type:e})=>e===n.vZ.COL_CELL),"Nk",0,(e,t)=>e()?null==t?void 0:t.value:null==t?void 0:t.field,"R5",0,e=>e.filter(({type:e})=>e===n.vZ.ROW_CELL),"eF",0,(e,t)=>{const i=e.split("[&]");return t?i.slice(i.length-t):(i.shift(),i)},"iT",0,(e,t,i=!0)=>(0,s.map)(e,e=>e===o.r2?t.getSeriesNumberText():i?t.dataSet.getFieldName(e):(0,s.flow)(r.bC,l.F)(e))])},"./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/utils/export/utils.js"(e,t,i){"use strict";var s=i("./node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/lodash.js"),o=i("./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/common/interface/export.js"),n=i("./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/utils/ssr.js");const r=e=>new Promise((t,i)=>{let n;n=Array.isArray(e)?(0,s.get)(e.filter(e=>e.type===o.q.PLAIN),"[0].content",""):e.content||"";const r=document.createElement("textarea");r.value=n,document.body.appendChild(r),r.focus({preventScroll:!0}),r.select();const l=document.execCommand("copy");document.body.removeChild(r),l?t():i()});i.d(t,["RG",0,(e,t)=>{try{const i=document.createElement("a");i.download=`${t}.csv`;const s=new Blob([`\ufeff${e}`],{type:"text/csv;charset=utf-8"});i.href=URL.createObjectURL(s),i.click(),URL.revokeObjectURL(i.href)}catch(e){console.error(e)}},"lW",0,(e,t=!0)=>{let i;return i="string"==typeof e?{content:e,type:o.q.PLAIN}:e,(0,n.fU)()?Promise.resolve():(0,n.w9)()&&navigator.clipboard&&window.ClipboardItem&&t?(e=>navigator.clipboard.write([new ClipboardItem((0,s.concat)(e).reduce((e,t)=>{const{type:i,content:s}=t,o=s.replace(/\x00/g,"");return Object.assign(Object.assign({},e),{[i]:new Blob([o],{type:i})})},{}))]).catch(()=>r(e)))(i):r(i)}])},"./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/utils/formatter.js"(e,t,i){"use strict";var s=i("./node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/lodash.js");"KMBTP".split("");i.d(t,["F",0,e=>Number.parseFloat(((0,s.toNumber)(e)||0).toPrecision(16))])},"./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/utils/g-mini-charts.js"(e,t,i){"use strict";var s=i("./node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/lodash.js"),o=i("./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/common/constant/basic.js"),n=i("./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/common/constant/interaction.js"),r=i("./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/common/interface/basic.js"),l=i("./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/utils/condition/condition.js"),a=i("./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/utils/formatter.js"),d=i("./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/utils/g-renders.js"),c=i("./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/utils/g-utils.js");const h=(e,t)=>{var i;const{data:r,encode:l,type:a}=e,{x:d,y:c,height:h,width:u}=t.getMeta(),p=t.getStyle(n.vZ.DATA_CELL),{cell:g,miniChart:m}=p,v=[],f=(0,s.map)(r,e=>(v.push(null==e?void 0:e[l.y]),{x:e[l.x],y:e[l.y]})),C=(0,s.max)(v)||0,y=(0,s.min)(v)||0;let w=C-y;const{left:x=0,right:_=0,top:S=0,bottom:b=0}=g.padding,E=d+x,L=d+u-_,T=c+S,O=c+h-b,R=O-T,I=null===(i=null==m?void 0:m.bar)||void 0===i?void 0:i.intervalPadding;let N;N=a===o.Gp.Bar?(L-E-(v.length-1)*I)/v.length+I:v.length>1?(L-E)/(v.length-1):0;const B=[];return{points:(0,s.map)(f,(e,t)=>{const i=E+t*N;let n;if(n=0!==w?O-((null==e?void 0:e.y)-y)/w*R:y>0?T:O,a===o.Gp.Bar){let t,i;y<0&&C>0&&0!==w?(t=O-(0-y)/w*R,i=Math.abs(n-t),(null==e?void 0:e.y)<0&&(n=t)):(w=(0,s.max)([Math.abs(C),Math.abs(y)]),i=0===w&&0===y&&0===C?0:0===w?R:Math.abs((null==e?void 0:e.y)-0)/w*R,n=y<0?T:O-i);B.push([N-I,i])}return[i,n]}),box:B}},u=(e,t)=>{if((0,s.isEmpty)(null==e?void 0:e.data)||(0,s.isEmpty)(t))return;const i=(e=>{const{data:t,encode:i}=e,s=t.filter(e=>{const t=null==e?void 0:e[i.y];return"number"==typeof t&&!Number.isNaN(t)});return Object.assign(Object.assign({},e),{data:s})})(e);if((0,s.isEmpty)(i.data))return;const o=t.getStyle(n.vZ.DATA_CELL),{miniChart:r}=o,{point:l,linkLine:a}=null==r?void 0:r.line,{points:c}=h(i,t);c.length>1&&(0,d.Xj)(t,{points:c,stroke:null==a?void 0:a.fill,lineWidth:null==a?void 0:a.size,opacity:null==a?void 0:a.opacity});for(let e=0;e<c.length;e++)(0,d.DH)(t,{cx:c[e][0],cy:c[e][1],r:l.size,fill:l.fill,fillOpacity:null==l?void 0:l.opacity})},p=(e,t,i)=>{const s=Number(t)-Number(e);return Number.isNaN(s)||Number(e)<0?i.bad:s<=.1?i.good:s>.1&&s<=.2?i.satisfactory:i.bad},g=(e,t)=>{const i=t.getStyle(n.vZ.DATA_CELL),{x:o,y:r,height:l,width:a}=t.getMeta();if((0,s.isEmpty)(e))return void t.renderTextShape(Object.assign(Object.assign({},i.text),{x:o+a-i.cell.padding.right,y:r+l/2,text:""}));const c=i.miniChart.bullet,{progressBar:h,comparativeMeasure:u,rangeColors:g,backgroundColor:m}=c,{measure:v,target:f}=e,C=Math.max(Number(v),0),y=Math.max(Number(f),0),w=((e,t={min:0,max:0})=>{var i,s;const o=Number(e);if(Number.isNaN(o))return e;const n=null!==(i=null==t?void 0:t.min)&&void 0!==i?i:t,r=null!==(s=null==t?void 0:t.max)&&void 0!==s?s:t;return new Intl.NumberFormat("en-US",{minimumFractionDigits:n,maximumFractionDigits:r,useGrouping:!1,style:"percent"}).format(o)})(v,2),x=i.cell.padding,_=a-x.left-x.right,S=((null==h?void 0:h.widthPercent)>1?(null==h?void 0:h.widthPercent)/100:null==h?void 0:h.widthPercent)*_,b=_-S,E=o+a-x.right-S,L=r+l/2-h.height/2;(0,d.P2)(t,{x:E,y:L,width:S,height:h.height,fill:m});const T=Math.max(Math.min(S*C,S),0);(0,d.P2)(t,{x:E,y:L+(h.height-h.innerHeight)/2,width:T,height:h.innerHeight,fill:p(C,y,g)});const O=E+S*y;(0,d.ni)(t,{x1:O,y1:r+(l-u.height)/2,x2:O,y2:r+(l-u.height)/2+u.height,stroke:null==u?void 0:u.fill,lineWidth:u.width,opacity:null==u?void 0:u.opacity});const R=b-x.right;t.renderTextShape(Object.assign(Object.assign({},i.text),{x:E-x.right,y:r+l/2,text:w,wordWrapWidth:R}))};i.d(t,["Cj",0,(e,t)=>{switch(null==t?void 0:t.type){case o.Gp.Line:u(t,e);break;case o.Gp.Bar:((e,t)=>{if((0,s.isEmpty)(null==e?void 0:e.data)||(0,s.isEmpty)(t))return;const i=t.getStyle(n.vZ.DATA_CELL),{miniChart:o}=i,{bar:r}=o,{points:l,box:a}=h(e,t);for(let e=0;e<l.length;e++)(0,d.P2)(t,{x:l[e][0],y:l[e][1],width:a[e][0],height:a[e][1],fill:r.fill,fillOpacity:r.opacity})})(t,e);break;default:g(t,e)}},"U4",0,e=>{var t,i,o,n,h,u,p,g;if((0,s.isEmpty)(e))return;const{x:m,y:v,height:f,width:C}=e.getBBoxByType(r.Ok.PADDING_BOX),y=e.findFieldCondition(null===(t=e.cellConditions)||void 0===t?void 0:t.interval);if(null==y?void 0:y.mapping){const t=e.mappingValue(y);if(!t)return;const r=e.getValueRange(),w=t.isCompare?t:r,x=(0,a.F)(null!==(i=w.minValue)&&void 0!==i?i:r.minValue),_=(0,a.F)(null!==(o=w.maxValue)&&void 0!==o?o:r.maxValue),S=(0,s.isNil)(null==t?void 0:t.fieldValue)?(0,a.F)(e.getMeta().fieldValue):(0,a.F)(null==t?void 0:t.fieldValue);if(S<x||S>_)return;const b=e.getStyle(),E=null===(h=null===(n=null==b?void 0:b.miniChart)||void 0===n?void 0:n.interval)||void 0===h?void 0:h.height,L=null===(p=null===(u=null==b?void 0:b.miniChart)||void 0===u?void 0:u.interval)||void 0===p?void 0:p.fill,T=(0,l.o1)(x,_),{zeroScale:O,scale:R}=T(S),I={x:m+C*O,y:v+f/2-E/2,width:C*R,height:E,fill:null!==(g=t.fill)&&void 0!==g?g:L},N=e.getConditionIntervalShape();return N?((0,c.w)(N,I),N):(0,d.P2)(e,I)}}])},"./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/utils/g-renders.js"(e,t,i){"use strict";i.d(t,{wC:()=>v,xX:()=>f,DH:()=>c,sH:()=>g,ni:()=>u,nP:()=>a,Xj:()=>d,P2:()=>l,S5:()=>h,ms:()=>m,O3:()=>p});var s=i("./node_modules/.pnpm/@antv+g@6.3.3/node_modules/@antv/g/dist/index.esm.js"),o=i("./node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/lodash.js"),n=i("./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/common/icons/gui-icon.js");class r extends s.EY{constructor(e,t){super(e),this.appendInfo=t}}function l(e,t){return null==e?void 0:e.appendChild(new s.rw({style:t}))}function a(e,t){return null==e?void 0:e.appendChild(new s.tS({style:t}))}function d(e,t){return null==e?void 0:e.appendChild(new s.Ro({style:t}))}function c(e,t){return null==e?void 0:e.appendChild(new s.jl({style:t}))}function h(e){const{group:t,textShape:i,style:s,appendInfo:o}=e;return i&&t&&t.contains(i)&&t.removeChild(i),null==t?void 0:t.appendChild(new r({style:Object.assign({fontVariant:"normal",fontStyle:"normal",lineWidth:1},s)},o||{}))}function u(e,t){return null==e?void 0:e.appendChild(new s.N1({style:Object.assign({zIndex:100},t)}))}function p(e,t,i){if((0,o.isEmpty)(e))return;((0,o.isArray)(e)?e:[e]).forEach(e=>{var s;null===(s=null==e?void 0:e.style)||void 0===s||s.setProperty(t,i)})}function g(e,t){const i=new n.r(t);return null==e||e.appendChild(i),i}function m(e){const{group:t,iconCfg:i,isCollapsed:s,onClick:n}=e,r=g(t,Object.assign(Object.assign({},i),{name:s?"Plus":"Minus",cursor:"pointer"}));return(0,o.isFunction)(n)&&r.addEventListener("click",n),r}function v(e,t){for(const i in t)e.style[i]=t[i]}function f(e,t){const i=this,n=(0,o.get)(i,e);n?v(n,t):(0,o.set)(i,e,new s.rw({style:t}))}},"./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/utils/g-utils.js"(e,t,i){"use strict";i.d(t,{w:()=>n,x:()=>r});var s=i("./node_modules/.pnpm/@antv+g@6.3.3/node_modules/@antv/g/dist/index.esm.js"),o=i("./node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/lodash.js");function n(e,t){e.setAttributes(t,{skipDispatchAttrModifiedEvent:!0})}function r(e,t){const i=this,r=(0,o.get)(i,e);r?n(r,t):(0,o.set)(i,e,new s.rw({style:t}))}},"./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/utils/layout/generate-id.js"(e,t,i){"use strict";var s=i("./node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/lodash.js"),o=i("./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/common/constant/field.js");const n=e=>(0,s.isUndefined)(e)?o.SA:(0,s.isNull)(e)?o.Zb:String(e),r=e=>e===o.Zb?null:e!==o.SA?e:void 0;i.d(t,["$C",0,(...e)=>e.map(n).join("[&]"),"bC",0,r,"mN",0,n])},"./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/utils/ssr.js"(e,t,i){"use strict";function s(){return"undefined"==typeof window}function o(){return"undefined"!=typeof document}function n(){return"undefined"!=typeof navigator}i.d(t,{Wt:()=>o,fU:()=>s,w9:()=>n})},"./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/utils/text.js"(e,t,i){"use strict";var s=i("./node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/lodash.js"),o=i("./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/common/constant/field.js"),n=i("./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/common/constant/interaction.js"),r=i("./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/common/interface/basic.js"),l=i("./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/utils/g-renders.js"),a=i("./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/utils/cell/cell.js"),d=i("./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/utils/condition/condition.js"),c=i("./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/utils/g-mini-charts.js"),h=i("./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/utils/layout/generate-id.js");const u=(e,t,i,s="left")=>{const{right:o=0,left:n=0}=t,r=i||0;return"left"===s?e+o/2+r:"right"===s?e-o/2-r:e+n/2+r},p=({rowIndex:e,colIndex:t,meta:i,data:s,textStyle:o,textCondition:n,cell:r})=>{var l;const a=null===(l=null==n?void 0:n.mapping)||void 0===l?void 0:l.call(n,s,{rowIndex:e,colIndex:t,meta:i},r);return Object.assign(Object.assign({},o),a)};i.d(t,["F",0,e=>e===o.L4?"-":e,"Kg",0,(e,t)=>{const i=(0,h.bC)(e),n=null!=t?t:"-",r=(0,s.isNumber)(i)&&Number.isNaN(i),l=""===i||i===o.L4;return(0,s.isNil)(i)||r||l?n:(0,h.bC)(i)},"Lv",0,(e,t)=>(0,s.isFunction)(null==t?void 0:t.cell)?null==t?void 0:t.cell(e):null==t?void 0:t.cell,"V",0,(e,t,i=!0)=>{var o,h,g,m,v,f,C,y,w,x;const{x:_,y:S,height:b,width:E}=e.getBBoxByType(r.Ok.CONTENT_BOX),L=e.getMeta(),T=t||L.fieldValue,{values:O}=T,{options:R}=L.spreadsheet,I=null===(h=null===(o=null==R?void 0:R.conditions)||void 0===o?void 0:o.text)||void 0===h?void 0:h[0],N=null===(m=null===(g=null==R?void 0:R.conditions)||void 0===g?void 0:g.icon)||void 0===m?void 0:m[0];if(!(0,s.isArray)(O))return void(0,c.Cj)(e,O);const B=null===(C=null===(f=null===(v=R.style)||void 0===v?void 0:v.dataCell)||void 0===f?void 0:f.valuesCfg)||void 0===C?void 0:C.widthPercent;let A=0;if(null==T?void 0:T.label){const t=e.getStyle(n.vZ.DATA_CELL);A=b/(O.length+1),e.renderTextShape(Object.assign(Object.assign({},t.bolderText),{x:_,y:S+A/2,text:T.label,maxLines:1,wordWrapWidth:E,wordWrap:!0,textOverflow:"ellipsis"}),{shallowRender:!0})}const{cellStyle:M,textStyle:D}=(e=>{var t,i;const{isTotals:s}=e.getMeta(),o=null===(i=(t=e).isMeasureField)||void 0===i?void 0:i.call(t),r=e.getStyle(e.cellType||n.vZ.DATA_CELL);let l;return l=o?null==r?void 0:r.measureText:s?null==r?void 0:r.bolderText:null==r?void 0:r.text,{cellStyle:r,textStyle:l}})(e),H=null==M?void 0:M.icon,k=N&&N.mapping&&{name:"",size:null==H?void 0:H.size,margin:null==H?void 0:H.margin,position:(0,d.dq)(N)};let z;const F=((e,t,i)=>{const{x:o,y:n,width:r,height:l}=e,a=l/(0,s.size)(t),d=[];let c,h,p,g=0;const m=(0,s.map)(i,e=>e>1?e/100:e);for(let e=0;e<(0,s.size)(t);e++){h=n+a*e;const i=[];c=o,g=0;for(let n=0;n<(0,s.size)(t[e]);n++)p=(0,s.isEmpty)(m)?r/(0,s.size)(t[0]):r*m[n],c=u(o,{left:0,right:0},g,"left"),g+=p,i.push({x:c,y:h,width:p,height:a});d.push(i)}return d})({x:_,y:S+A,height:b-A,width:E},O,B);for(let t=0;t<O.length;t++){const o=(0,s.clone)(O[t]);for(let s=0;s<o.length;s++){z=o[s];const n=i?p({rowIndex:t,colIndex:s,meta:L,data:z,textStyle:D,textCondition:I,cell:e}):D,r=F[t][s].width-(null==H?void 0:H.size)-("left"===(null==k?void 0:k.position)?null===(y=null==H?void 0:H.margin)||void 0===y?void 0:y.right:null===(w=null==H?void 0:H.margin)||void 0===w?void 0:w.left),d={left:[],right:[]};k&&d[k.position].push(k),e.renderTextShape(Object.assign(Object.assign({},n),{x:0,y:0,maxLines:1,text:z,wordWrapWidth:r}),{shallowRender:!0});const c=e.getActualTextWidth(),{textX:h,leftIconX:u,rightIconX:g}=(0,a.Cb)({bbox:F[t][s],textAlign:n.textAlign,textWidth:c,iconStyle:H,groupedIcons:d}),m=(0,a.l2)(F[t][s],n.textBaseline);if(e.updateTextPosition({x:h,y:m}),N&&i){const i=null===(x=null==N?void 0:N.mapping)||void 0===x?void 0:x.call(N,z,{rowIndex:t,colIndex:s,meta:null==e?void 0:e.getMeta()},e),o="left"===(null==k?void 0:k.position)?u:g,r=(0,a.Bh)(H.size,m,n.fontSize,n.textBaseline);if(i){const t=(0,l.sH)(e,{x:o,y:r,name:i.icon,width:null==H?void 0:H.size,height:null==H?void 0:H.size,fill:i.fill});e.addConditionIconShape(t)}}}}},"jv",0,(e,t=1)=>(null==e?void 0:e.width)*t])},"./node_modules/.pnpm/@preact+signals-core@1.14.4/node_modules/@preact/signals-core/dist/signals-core.module.js"(e,t,i){"use strict";i.d(t,{EW:()=>S,O8:()=>a,QZ:()=>O,vA:()=>n,vP:()=>C});var s=Symbol.for("preact-signals");function o(){if(c>1)c--;else{var e,t=!1;for(!function(){var e=g;for(g=void 0;void 0!==e;){var t=e.S;if(t.v===e.v)for(var i=t.t;void 0!==i;i=i.x)i.i===e.i&&(i.i=t.i);e=e.o}}();void 0!==d;){var i=d;for(d=void 0,h++;void 0!==i;){var s=i.u;if(i.u=void 0,i.f&=-3,!(8&i.f)&&y(i))try{i.c()}catch(i){t||(e=i,t=!0)}i=s}}if(h=0,c--,t)throw e}}function n(e){if(c>0)return e();p=++u,c++;try{return e()}finally{o()}}var r,l=void 0;function a(e){var t=l,i=r;l=void 0,r=void 0;try{return e()}finally{l=t,r=i}}var d=void 0,c=0,h=0,u=0,p=0,g=void 0,m=0;function v(e){if(void 0!==l){var t=e.n;if(void 0===t||t.t!==l)return t={i:0,S:e,p:l.s,n:void 0,t:l,e:void 0,x:void 0,r:t},void 0!==l.s&&(l.s.n=t),l.s=t,e.n=t,32&l.f&&e.S(t),t;if(-1===t.i)return t.i=0,void 0!==t.n&&(t.n.p=t.p,void 0!==t.p&&(t.p.n=t.n),t.p=l.s,t.n=void 0,l.s.n=t,l.s=t),t}}function f(e,t){this.v=e,this.i=0,this.n=void 0,this.t=void 0,this.l=0,this.W=null==t?void 0:t.watched,this.Z=null==t?void 0:t.unwatched,this.name=null==t?void 0:t.name}function C(e,t){return new f(e,t)}function y(e){for(var t=e.s;void 0!==t;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function w(e){for(var t=e.s;void 0!==t;t=t.n){var i=t.S.n;if(void 0!==i&&(t.r=i),t.S.n=t,t.i=-1,void 0===t.n){e.s=t;break}}}function x(e){for(var t=e.s,i=void 0;void 0!==t;){var s=t.p;-1===t.i?(t.S.U(t),void 0!==s&&(s.n=t.n),void 0!==t.n&&(t.n.p=s)):i=t,t.S.n=t.r,void 0!==t.r&&(t.r=void 0),t=s}e.s=i}function _(e,t){f.call(this,void 0,t),this.x=e,this.s=void 0,this.g=m-1,this.f=4}function S(e,t){return new _(e,t)}function b(e){var t=e.m;if(e.m=void 0,"function"==typeof t){c++;var i=l;l=void 0;try{t()}catch(t){throw e.f&=-2,e.f|=8,E(e),t}finally{l=i,o()}}}function E(e){for(var t=e.s;void 0!==t;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,b(e)}function L(e){if(l!==this)throw new Error("Out-of-order effect");x(this),l=e,this.f&=-2,8&this.f&&E(this),o()}function T(e,t){this.x=e,this.m=void 0,this.s=void 0,this.u=void 0,this.f=32,this.name=null==t?void 0:t.name,r&&r.push(this)}function O(e,t){var i=new T(e,t);try{i.c()}catch(e){throw i.d(),e}var s=i.d.bind(i);return s[Symbol.dispose]=s,s}f.prototype.brand=s,f.prototype.h=function(){return!0},f.prototype.S=function(e){var t=this,i=this.t;i!==e&&void 0===e.e&&(e.x=i,this.t=e,void 0!==i?i.e=e:a(function(){var e;null==(e=t.W)||e.call(t)}))},f.prototype.U=function(e){var t=this;if(void 0!==this.t){var i=e.e,s=e.x;void 0!==i&&(i.x=s,e.e=void 0),void 0!==s&&(s.e=i,e.x=void 0),e===this.t&&(this.t=s,void 0===s&&a(function(){var e;null==(e=t.Z)||e.call(t)}))}},f.prototype.subscribe=function(e){var t=this;return O(function(){var i=t.value;a(function(){return e(i)})},{name:"sub"})},f.prototype.valueOf=function(){return this.value},f.prototype.toString=function(){return this.value+""},f.prototype.toJSON=function(){return this.value},f.prototype.peek=function(){var e=this;return a(function(){return e.value})},Object.defineProperty(f.prototype,"value",{get:function(){var e=v(this);return void 0!==e&&(e.i=this.i),this.v},set:function(e){if(e!==this.v){if(h>100)throw new Error("Cycle detected");!function(e){0!==c&&0===h&&e.l!==p&&(e.l=p,g={S:e,v:e.v,i:e.i,o:g})}(this),this.v=e,this.i++,m++,c++;try{for(var t=this.t;void 0!==t;t=t.x)t.t.N()}finally{o()}}}}),(_.prototype=new f).h=function(){if(this.f&=-3,1&this.f)return!1;if(32==(36&this.f))return!0;if(this.f&=-5,this.g===m)return!0;if(this.g=m,this.f|=1,this.i>0&&!y(this))return this.f&=-2,!0;var e=l;try{w(this),l=this;var t=this.x();(16&this.f||this.v!==t||0===this.i)&&(this.v=t,this.f&=-17,this.i++)}catch(e){this.v=e,this.f|=16,this.i++}return l=e,x(this),this.f&=-2,!0},_.prototype.S=function(e){if(void 0===this.t){this.f|=36;for(var t=this.s;void 0!==t;t=t.n)t.S.S(t)}f.prototype.S.call(this,e)},_.prototype.U=function(e){if(void 0!==this.t&&(f.prototype.U.call(this,e),void 0===this.t)){this.f&=-33;for(var t=this.s;void 0!==t;t=t.n)t.S.U(t)}},_.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var e=this.t;void 0!==e;e=e.x)e.t.N()}},Object.defineProperty(_.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var e=v(this);if(this.h(),void 0!==e&&(e.i=this.i),16&this.f)throw this.v;return this.v}}),T.prototype.c=function(){var e=this.S();try{if(8&this.f)return;if(void 0===this.x)return;var t=this.x();"function"==typeof t&&(this.m=t)}finally{e()}},T.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,b(this),w(this),c++;var e=l;return l=this,L.bind(this,e)},T.prototype.N=function(){2&this.f||(this.f|=2,this.u=d,d=this)},T.prototype.d=function(){this.f|=8,1&this.f||E(this)},T.prototype.dispose=function(){this.d()}},"./node_modules/.pnpm/@rc-component+checkbox@2.0.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@rc-component/checkbox/es/index.js"(e,t,i){"use strict";var s=i("./node_modules/.pnpm/@rc-component+util@1.14.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@rc-component/util/es/hooks/useControlledState.js"),o=i("./node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs"),n=i("react");function r(){return r=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(e[s]=i[s])}return e},r.apply(this,arguments)}i.d(t,["A",0,(0,n.forwardRef)((e,t)=>{const{prefixCls:i="rc-checkbox",className:l,style:a,checked:d,disabled:c,defaultChecked:h=!1,type:u="checkbox",title:p,onChange:g,...m}=e,v=(0,n.useRef)(null),f=(0,n.useRef)(null),[C,y]=(0,s.A)(h,d);(0,n.useImperativeHandle)(t,()=>({focus:e=>{v.current?.focus(e)},blur:()=>{v.current?.blur()},input:v.current,nativeElement:f.current}));const w=(0,o.$)(i,l,{[`${i}-checked`]:C,[`${i}-disabled`]:c});return n.createElement("span",{className:w,title:p,style:a,ref:f},n.createElement("input",r({},m,{className:`${i}-input`,ref:v,onChange:t=>{c||("checked"in e||y(t.target.checked),g?.({target:{...e,type:u,checked:t.target.checked},stopPropagation(){t.stopPropagation()},preventDefault(){t.preventDefault()},nativeEvent:t.nativeEvent}))},disabled:c,checked:!!C,type:u})))})])},"./node_modules/.pnpm/@rc-component+dropdown@1.0.3_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@rc-component/dropdown/es/index.js"(e,t,i){"use strict";i.d(t,{A:()=>v});var s=i("./node_modules/.pnpm/@rc-component+trigger@3.10.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@rc-component/trigger/es/index.js"),o=i("./node_modules/.pnpm/@rc-component+util@1.14.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@rc-component/util/es/index.js"),n=i("./node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs"),r=i("react"),l=i.n(r);const{ESC:a,TAB:d}=o.DD;const c=(0,r.forwardRef)((e,t)=>{const{overlay:i,arrow:s,prefixCls:n}=e,a=(0,r.useMemo)(()=>{let e;return e="function"==typeof i?i():i,e},[i]),d=(0,o.K4)(t,(0,o.A9)(a));return l().createElement(l().Fragment,null,s&&l().createElement("div",{className:`${n}-arrow`}),l().cloneElement(a,{ref:(0,o.f3)(a)?d:void 0}))}),h={adjustX:1,adjustY:1},u=[0,0],p={topLeft:{points:["bl","tl"],overflow:h,offset:[0,-4],targetOffset:u},top:{points:["bc","tc"],overflow:h,offset:[0,-4],targetOffset:u},topRight:{points:["br","tr"],overflow:h,offset:[0,-4],targetOffset:u},bottomLeft:{points:["tl","bl"],overflow:h,offset:[0,4],targetOffset:u},bottom:{points:["tc","bc"],overflow:h,offset:[0,4],targetOffset:u},bottomRight:{points:["tr","br"],overflow:h,offset:[0,4],targetOffset:u}};function g(){return g=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(e[s]=i[s])}return e},g.apply(this,arguments)}const m=l().forwardRef((e,t)=>{const{arrow:i=!1,prefixCls:h="rc-dropdown",transitionName:u,animation:m,align:v,placement:f="bottomLeft",placements:C=p,getPopupContainer:y,showAction:w,hideAction:x,overlayClassName:_,overlayStyle:S,visible:b,trigger:E=["hover"],autoFocus:L,overlay:T,children:O,onVisibleChange:R,disabled:I,...N}=e,[B,A]=l().useState(),M="visible"in e?b:B,D=m?`${h}-${m}`:u,H=l().useRef(null),k=l().useRef(null),z=l().useRef(null);l().useImperativeHandle(t,()=>H.current);const F=e=>{A(e),R?.(e)};!function({visible:e,triggerRef:t,onVisibleChange:i,autoFocus:s,overlayRef:n}){const l=r.useRef(!1),c=()=>{e&&(t.current?.focus?.(),i?.(!1))},h=()=>!!n.current?.focus&&(n.current.focus(),l.current=!0,!0),u=e=>{switch(e.keyCode){case a:c();break;case d:{let t=!1;l.current||(t=h()),t?e.preventDefault():c();break}}};r.useEffect(()=>e?(window.addEventListener("keydown",u),s&&(0,o.er)(h,3),()=>{window.removeEventListener("keydown",u),l.current=!1}):()=>{l.current=!1},[e])}({visible:M,triggerRef:z,onVisibleChange:F,autoFocus:L,overlayRef:k});const P=()=>l().createElement(c,{ref:k,overlay:T,prefixCls:h,arrow:i}),j=O,W=(0,n.$)(j.props?.className,M&&(()=>{const{openClassName:t}=e;return void 0!==t?t:`${h}-open`})()),G={className:W,ref:(0,o.K4)(z,(0,o.A9)(j))},V=(0,o.f3)(j)?l().cloneElement(j,G):l().createElement("span",{className:W,ref:z},l().cloneElement(j,{className:W}));let $=x;return $||-1===E.indexOf("contextMenu")||($=["click"]),l().createElement(s.Ay,g({builtinPlacements:C},N,{prefixCls:h,ref:H,popupClassName:(0,n.$)(_,{[`${h}-show-arrow`]:i}),popupStyle:S,action:E,showAction:w,hideAction:$,popupPlacement:f,popupAlign:v,popupMotion:{motionName:D},popupVisible:M,stretch:(()=>{const{minOverlayWidthMatchTrigger:t,alignPoint:i}=e;return"minOverlayWidthMatchTrigger"in e?t:!i})()?"minWidth":"",popup:"function"==typeof T?P:P(),onOpenChange:F,onPopupClick:t=>{const{onOverlayClick:i}=e;A(!1),i&&i(t)},getPopupContainer:y}),V)}),v=m},"./node_modules/.pnpm/antd@6.6.8_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/_util/PurePanel.js"(e,t,i){"use strict";i.d(t,{U:()=>l});var s=i("react"),o=i("./node_modules/.pnpm/@rc-component+util@1.14.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@rc-component/util/es/index.js"),n=i("./node_modules/.pnpm/antd@6.6.8_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/config-provider/index.js"),r=i("./node_modules/.pnpm/antd@6.6.8_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/config-provider/context.js");function l(e){return t=>s.createElement(n.Ay,{theme:{token:{motion:!1,zIndexPopupBase:0}}},s.createElement(e,{...t}))}i.d(t,["A",0,(e,t,i,n,a)=>l(l=>{const{prefixCls:d,style:c}=l,h=s.useRef(null),[u,p]=s.useState(0),[g,m]=s.useState(0),[v,f]=(0,o.PW)(!1,l.open),{getPrefixCls:C}=s.useContext(r.QO),y=C(n||"select",d);s.useEffect(()=>{if(f(!0),"undefined"!=typeof ResizeObserver){const e=new ResizeObserver(e=>{const t=e[0].target;p(t.offsetHeight+8),m(t.offsetWidth)}),t=setInterval(()=>{const i=a?`.${a(y)}`:`.${y}-dropdown`,s=h.current?.querySelector(i);s&&(clearInterval(t),e.observe(s))},10);return()=>{clearInterval(t),e.disconnect()}}},[y]);let w={...l,style:{...c,margin:0},open:v,getPopupContainer:()=>h.current};i&&(w=i(w)),t&&(w={...w,[t]:{overflow:{adjustX:!1,adjustY:!1}}});return s.createElement("div",{ref:h,style:{paddingBottom:u,position:"relative",minWidth:g}},s.createElement(e,{...w}))})])},"./node_modules/.pnpm/antd@6.6.8_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/_util/getRenderPropValue.js"(e,t,i){"use strict";var s=i("./node_modules/.pnpm/@rc-component+util@1.14.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@rc-component/util/es/index.js"),o=i("./node_modules/.pnpm/antd@6.6.8_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/_util/is.js");i.d(t,["b",0,e=>(0,s.AZ)(e)?(0,o.Tn)(e)?e():e:null])},"./node_modules/.pnpm/antd@6.6.8_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/checkbox/index.js"(e,t,i){"use strict";i.d(t,{A:()=>S});var s=i("react"),o=i.n(s),n=i("./node_modules/.pnpm/@rc-component+checkbox@2.0.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@rc-component/checkbox/es/index.js"),r=i("./node_modules/.pnpm/@rc-component+util@1.14.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@rc-component/util/es/index.js"),l=i("./node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs"),a=i("./node_modules/.pnpm/antd@6.6.8_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/_util/hooks/useMergeSemantic/index.js"),d=i("./node_modules/.pnpm/antd@6.6.8_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/_util/wave/index.js"),c=i("./node_modules/.pnpm/antd@6.6.8_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/_util/wave/interface.js"),h=i("./node_modules/.pnpm/antd@6.6.8_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/config-provider/context.js"),u=i("./node_modules/.pnpm/antd@6.6.8_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/config-provider/DisabledContext.js"),p=i("./node_modules/.pnpm/antd@6.6.8_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/config-provider/hooks/useCSSVarCls.js"),g=i("./node_modules/.pnpm/antd@6.6.8_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/form/context.js");const m=o().createContext(null);var v=i("./node_modules/.pnpm/antd@6.6.8_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/checkbox/style/index.js"),f=i("./node_modules/.pnpm/antd@6.6.8_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/checkbox/useBubbleLock.js");const C=(e,t)=>{const{prefixCls:i,children:o,indeterminate:C=!1,onMouseEnter:y,onMouseLeave:w,skipGroup:x=!1,disabled:_,rootClassName:S,className:b,style:E,classNames:L,styles:T,name:O,value:R,checked:I,defaultChecked:N,onChange:B,...A}=e,{getPrefixCls:M,direction:D,className:H,style:k,classNames:z,styles:F}=(0,h.TP)("checkbox"),P=s.useContext(m),{isFormItemInput:j}=s.useContext(g.$W),W=s.useContext(u.A),G=_??P?.disabled??W;const[V,$]=(0,r.PW)(N,I);let U=V;const Y=(0,r._q)(e=>{$(e.target.checked),B?.(e),!x&&P?.toggleOption&&P.toggleOption({label:o,value:R})});P&&!x&&(U=P.value.includes(R));const X=s.useRef(null),Z=(0,r.xK)(t,X);s.useEffect(()=>{if(!x&&P)return P.registerValue(R),()=>{P.cancelValue(R)}},[R,x]),s.useEffect(()=>{X.current?.input&&(X.current.input.indeterminate=C)},[C]);const q=M("checkbox",i),K=(0,p.A)(q),[J,Q]=(0,v.Ay)(q,K),ee={...A},te={...e,indeterminate:C,disabled:G,checked:U},ie=(0,a.XT)(k),se=(0,a.XT)(E),[oe,ne]=(0,a.AV)([z,L],[F,ie,T,se],{props:te}),re=(0,l.$)(`${q}-wrapper`,{[`${q}-rtl`]:"rtl"===D,[`${q}-wrapper-checked`]:U,[`${q}-wrapper-disabled`]:G,[`${q}-wrapper-in-form-item`]:j},H,b,oe.root,S,Q,K,J),le=(0,l.$)(oe.icon,{[`${q}-indeterminate`]:C},c.D,J),[ae,de]=(0,f.A)(ee.onClick);return s.createElement(d.A,{component:"Checkbox",disabled:G},s.createElement("label",{className:re,style:ne.root,onMouseEnter:y,onMouseLeave:w,onClick:ae},s.createElement(n.A,{...ee,name:!x&&P?P.name:O,checked:U,onClick:de,onChange:Y,prefixCls:q,className:le,style:ne.icon,disabled:G,ref:Z,value:R}),(0,r.AZ)(o)&&s.createElement("span",{className:(0,l.$)(`${q}-label`,oe.label),style:ne.label},o)))};const y=s.forwardRef(C);var w=i("./node_modules/.pnpm/@babel+runtime@7.29.7/node_modules/@babel/runtime/helpers/esm/toConsumableArray.js"),x=i("./node_modules/.pnpm/antd@6.6.8_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/_util/is.js");const _=y;_.Group=s.forwardRef((e,t)=>{const{defaultValue:i,children:o,options:n=[],prefixCls:a,className:d,rootClassName:c,style:u,onChange:g,role:f="group",...C}=e,{getPrefixCls:_,direction:S}=s.useContext(h.QO),[b,E]=(0,r.PW)(i||[],C.value),L=b||[],[T,O]=s.useState([]),R=s.useMemo(()=>n.map(e=>(0,x.Kg)(e)||(0,x.Et)(e)?{label:e,value:e}:e).filter(e=>(0,r.R)(e)&&(0,r.R)(e.value)),[n]),I=e=>{O(t=>t.filter(t=>t!==e))},N=e=>{O(t=>[].concat((0,w.A)(t),[e]))},B=e=>{const t=L.indexOf(e.value),i=(0,w.A)(L);-1===t?i.push(e.value):i.splice(t,1),E(i),g?.(i.filter(e=>T.includes(e)).sort((e,t)=>R.findIndex(t=>t.value===e)-R.findIndex(e=>e.value===t)))},A=_("checkbox",a),M=`${A}-group`,D=(0,p.A)(A),[H,k]=(0,v.Ay)(A,D),z=(0,r.cJ)(C,["value","disabled"]),F=R.length>0?R.map(e=>s.createElement(y,{prefixCls:A,key:e.value.toString(),disabled:"disabled"in e?e.disabled:C.disabled,value:e.value,checked:L.includes(e.value),onChange:e.onChange,className:(0,l.$)(`${M}-item`,e.className),style:e.style,title:e.title,id:e.id,required:e.required},e.label)):o,P=s.useMemo(()=>({toggleOption:B,value:L,disabled:C.disabled,name:C.name,registerValue:N,cancelValue:I}),[B,L,C.disabled,C.name,N,I]),j=(0,l.$)(M,{[`${M}-rtl`]:"rtl"===S},d,c,k,D,H);return s.createElement("div",{className:j,style:u,role:f,...z,ref:t},s.createElement(m.Provider,{value:P},F))}),_.__ANT_CHECKBOX=!0;const S=_},"./node_modules/.pnpm/antd@6.6.8_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/checkbox/style/index.js"(e,t,i){"use strict";i.d(t,{gd:()=>a});var s=i("./node_modules/.pnpm/@ant-design+cssinjs@2.1.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@ant-design/cssinjs/es/index.js"),o=i("./node_modules/.pnpm/antd@6.6.8_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/style/index.js"),n=i("./node_modules/.pnpm/antd@6.6.8_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/style/motion/util.js"),r=i("./node_modules/.pnpm/@ant-design+cssinjs-utils@2.1.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@ant-design/cssinjs-utils/es/index.js"),l=i("./node_modules/.pnpm/antd@6.6.8_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/theme/util/genStyleUtils.js");function a(e,t){return(e=>{const{checkboxCls:t,checkboxSize:i,lineWidth:r}=e,l=`${t}-wrapper`,a="@media (hover: hover) and (pointer: fine)";return[{[`${t}-group`]:{...(0,o.dF)(e),display:"inline-flex",flexWrap:"wrap",columnGap:e.marginXS,[`> ${e.antCls}-row`]:{flex:1}},[l]:{...(0,o.dF)(e),display:"inline-flex",alignItems:"baseline",cursor:"pointer","&:after":{display:"inline-block",width:0,overflow:"hidden",content:"'\\a0'"},[`& + ${l}`]:{marginInlineStart:0}},[t]:{...(0,o.dF)(e),position:"relative",whiteSpace:"nowrap",lineHeight:1,cursor:"pointer",alignSelf:"center",boxSizing:"border-box",display:"block",width:i,height:i,direction:"ltr",backgroundColor:e.colorBgContainer,border:`${(0,s.zA)(r)} ${e.lineType} ${e.colorBorder}`,borderRadius:e.borderRadiusSM,borderCollapse:"separate",transition:`all ${e.motionDurationSlow}`,flex:"none",...(0,n.V)(),"&:after":{boxSizing:"border-box",position:"absolute",top:`calc(${i} / 2 - ${r})`,insetInlineStart:`calc(${i} / 4 - ${r})`,display:"table",width:e.calc(i).div(14).mul(5).equal(),height:e.calc(i).div(14).mul(8).equal(),border:`${(0,s.zA)(e.lineWidthBold)} solid ${e.colorWhite}`,borderTop:0,borderInlineStart:0,transform:"rotate(45deg) scale(0) translate(-50%,-50%)",opacity:0,content:'""',transition:`all ${e.motionDurationFast} ${e.motionEaseInBack}, opacity ${e.motionDurationFast}`,...(0,n.X)()},[`${t}-input`]:{position:"absolute",inset:`calc(-1 * (${r}))`,zIndex:1,cursor:"pointer",opacity:0,margin:0},[`&:has(${t}-input:focus-visible)`]:(0,o.jk)(e),"& + span":{paddingInlineStart:e.paddingXS,paddingInlineEnd:e.paddingXS}}},{[a]:{[`\n ${l}:not(${l}-disabled),\n ${t}:not(${t}-disabled)\n `]:{[`&:hover ${t}`]:{borderColor:e.colorPrimary}},[`${l}:not(${l}-disabled)`]:{[`&:hover ${t}-checked:not(${t}-disabled)`]:{backgroundColor:e.colorPrimaryHover,borderColor:"transparent"}}}},{[`${t}-checked`]:{backgroundColor:e.colorPrimary,borderColor:e.colorPrimary,"&:after":{opacity:1,transform:"rotate(45deg) scale(1) translate(-50%,-50%)",transition:`all ${e.motionDurationMid} ${e.motionEaseOutBack} ${e.motionDurationFast}`,...(0,n.X)()},[a]:{[`&:not(${t}-disabled):hover`]:{backgroundColor:e.colorPrimaryHover,borderColor:"transparent"}}}},{[t]:{"&-indeterminate":{backgroundColor:e.colorBgContainer,borderColor:e.colorBorder,"&:after":{top:"50%",insetInlineStart:"50%",width:e.calc(e.fontSizeLG).div(2).equal(),height:e.calc(e.fontSizeLG).div(2).equal(),backgroundColor:e.colorPrimary,border:0,transform:"translate(-50%, -50%) scale(1)",opacity:1,content:'""'},[a]:{[`&:not(${t}-disabled):hover`]:{backgroundColor:e.colorBgContainer,borderColor:e.colorPrimary}}}}},{[`${l}-disabled`]:{cursor:"not-allowed"},[`${t}-disabled`]:{[`&, ${t}-input`]:{cursor:"not-allowed",pointerEvents:"none"},background:e.colorBgContainerDisabled,borderColor:e.colorBorder,"&:after":{borderColor:e.colorTextDisabled},"& + span":{color:e.colorTextDisabled},[`&${t}-indeterminate::after`]:{background:e.colorTextDisabled}}}]})((0,r.oX)(t,{checkboxCls:`.${e}`,checkboxSize:t.controlInteractiveSize}))}const d=(0,l.OF)("Checkbox",(e,{prefixCls:t})=>[a(t,e)]);i.d(t,["Ay",0,d])},"./node_modules/.pnpm/antd@6.6.8_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/checkbox/useBubbleLock.js"(e,t,i){"use strict";i.d(t,{A:()=>r});var s=i("react"),o=i.n(s),n=i("./node_modules/.pnpm/@rc-component+util@1.14.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@rc-component/util/es/index.js");function r(e){const t=o().useRef(null),i=()=>{n.er.cancel(t.current),t.current=null};return[()=>{i(),t.current=(0,n.er)(()=>{t.current=null})},s=>{t.current&&(s.stopPropagation(),i()),e?.(s)}]}},"./node_modules/.pnpm/antd@6.6.8_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/dropdown/dropdown.js"(e,t,i){"use strict";i.d(t,{A:()=>H});var s=i("react"),o=i("./node_modules/.pnpm/@ant-design+icons@6.3.4_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@ant-design/icons/es/icons/LeftOutlined.js"),n=i("./node_modules/.pnpm/@ant-design+icons@6.3.4_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@ant-design/icons/es/icons/RightOutlined.js"),r=i("./node_modules/.pnpm/@rc-component+dropdown@1.0.3_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@rc-component/dropdown/es/index.js"),l=i("./node_modules/.pnpm/@rc-component+util@1.14.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@rc-component/util/es/index.js"),a=i("./node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs"),d=i("./node_modules/.pnpm/antd@6.6.8_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/_util/hooks/useZIndex.js"),c=i("./node_modules/.pnpm/antd@6.6.8_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/_util/hooks/useMergeSemantic/index.js"),h=i("./node_modules/.pnpm/antd@6.6.8_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/_util/is.js"),u=i("./node_modules/.pnpm/antd@6.6.8_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/_util/placements.js"),p=i("./node_modules/.pnpm/antd@6.6.8_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/_util/PurePanel.js"),g=i("./node_modules/.pnpm/antd@6.6.8_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/_util/reactNode.js"),m=i("./node_modules/.pnpm/antd@6.6.8_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/_util/warning.js"),v=i("./node_modules/.pnpm/antd@6.6.8_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/_util/zindexContext.js"),f=i("./node_modules/.pnpm/antd@6.6.8_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/config-provider/context.js"),C=i("./node_modules/.pnpm/antd@6.6.8_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/config-provider/hooks/useCSSVarCls.js"),y=i("./node_modules/.pnpm/antd@6.6.8_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/menu/index.js"),w=i("./node_modules/.pnpm/antd@6.6.8_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/menu/OverrideContext.js"),x=i("./node_modules/.pnpm/antd@6.6.8_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/theme/useToken.js"),_=i("./node_modules/.pnpm/@ant-design+cssinjs@2.1.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@ant-design/cssinjs/es/index.js"),S=i("./node_modules/.pnpm/antd@6.6.8_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/style/index.js"),b=i("./node_modules/.pnpm/antd@6.6.8_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/style/motion/slide.js"),E=i("./node_modules/.pnpm/antd@6.6.8_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/style/motion/move.js"),L=i("./node_modules/.pnpm/antd@6.6.8_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/style/motion/zoom.js"),T=i("./node_modules/.pnpm/antd@6.6.8_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/style/placementArrow.js"),O=i("./node_modules/.pnpm/antd@6.6.8_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/style/roundedArrow.js"),R=i("./node_modules/.pnpm/antd@6.6.8_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/theme/util/genStyleUtils.js"),I=i("./node_modules/.pnpm/@ant-design+cssinjs-utils@2.1.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@ant-design/cssinjs-utils/es/index.js");const N=e=>{const{componentCls:t,menuCls:i,colorError:s,colorTextLightSolid:o}=e,n=`${i}-item`;return{[`${t}, ${t}-menu-submenu`]:{[`${i} ${n}`]:{[`&${n}-danger:not(${n}-disabled)`]:{color:s,"&:hover":{color:o,backgroundColor:s}}}}}},B=e=>{const{componentCls:t,menuCls:i,zIndexPopup:s,dropdownArrowDistance:o,sizePopupArrow:n,antCls:r,iconCls:l,motionDurationMid:a,paddingBlock:d,fontSize:c,dropdownEdgeChildPadding:h,colorTextDisabled:u,fontSizeIcon:p,controlPaddingHorizontal:g,colorBgElevated:m,controlHeightLG:v}=e;return[{[t]:{position:"absolute",top:-9999,left:{_skip_check_:!0,value:-9999},zIndex:s,display:"block","&::before":{position:"absolute",insetBlock:e.calc(n).div(2).sub(o).equal(),zIndex:-9999,opacity:1e-4,content:'""'},"&-menu-vertical":{maxHeight:`calc(100vh - ${(0,_.zA)(e.calc(v).mul(2.5).equal())})`,overflowY:"auto"},[`&-trigger${r}-btn`]:{[`& > ${l}-down, & > ${r}-btn-icon > ${l}-down`]:{fontSize:p}},"&-hidden, &-menu-hidden, &-menu-submenu-hidden":{display:"none"},[`&${r}-slide-down-enter${r}-slide-down-enter-active${t}-placement-bottomLeft,\n &${r}-slide-down-appear${r}-slide-down-appear-active${t}-placement-bottomLeft,\n &${r}-slide-down-enter${r}-slide-down-enter-active${t}-placement-bottom,\n &${r}-slide-down-appear${r}-slide-down-appear-active${t}-placement-bottom,\n &${r}-slide-down-enter${r}-slide-down-enter-active${t}-placement-bottomRight,\n &${r}-slide-down-appear${r}-slide-down-appear-active${t}-placement-bottomRight`]:{animationName:b.ox},[`&${r}-slide-up-enter${r}-slide-up-enter-active${t}-placement-topLeft,\n &${r}-slide-up-appear${r}-slide-up-appear-active${t}-placement-topLeft,\n &${r}-slide-up-enter${r}-slide-up-enter-active${t}-placement-top,\n &${r}-slide-up-appear${r}-slide-up-appear-active${t}-placement-top,\n &${r}-slide-up-enter${r}-slide-up-enter-active${t}-placement-topRight,\n &${r}-slide-up-appear${r}-slide-up-appear-active${t}-placement-topRight`]:{animationName:b.nP},[`&${r}-slide-down-leave${r}-slide-down-leave-active${t}-placement-bottomLeft,\n &${r}-slide-down-leave${r}-slide-down-leave-active${t}-placement-bottom,\n &${r}-slide-down-leave${r}-slide-down-leave-active${t}-placement-bottomRight`]:{animationName:b.vR},[`&${r}-slide-up-leave${r}-slide-up-leave-active${t}-placement-topLeft,\n &${r}-slide-up-leave${r}-slide-up-leave-active${t}-placement-top,\n &${r}-slide-up-leave${r}-slide-up-leave-active${t}-placement-topRight`]:{animationName:b.YU},[`&${r}-slide-right-enter${r}-slide-right-enter-active${t}-placement-right,\n &${r}-slide-right-appear${r}-slide-right-appear-active${t}-placement-right,\n &${r}-slide-right-enter${r}-slide-right-enter-active${t}-placement-rightTop,\n &${r}-slide-right-appear${r}-slide-right-appear-active${t}-placement-rightTop,\n &${r}-slide-right-enter${r}-slide-right-enter-active${t}-placement-rightBottom,\n &${r}-slide-right-appear${r}-slide-right-appear-active${t}-placement-rightBottom`]:{animationName:b.gx},[`&${r}-slide-left-enter${r}-slide-left-enter-active${t}-placement-left,\n &${r}-slide-left-appear${r}-slide-left-appear-active${t}-placement-left,\n &${r}-slide-left-enter${r}-slide-left-enter-active${t}-placement-leftTop,\n &${r}-slide-left-appear${r}-slide-left-appear-active${t}-placement-leftTop,\n &${r}-slide-left-enter${r}-slide-left-enter-active${t}-placement-leftBottom,\n &${r}-slide-left-appear${r}-slide-left-appear-active${t}-placement-leftBottom`]:{animationName:b.L2},[`&${r}-slide-right-leave${r}-slide-right-leave-active${t}-placement-right,\n &${r}-slide-right-leave${r}-slide-right-leave-active${t}-placement-rightTop,\n &${r}-slide-right-leave${r}-slide-right-leave-active${t}-placement-rightBottom`]:{animationName:b.J6},[`&${r}-slide-left-leave${r}-slide-left-leave-active${t}-placement-left,\n &${r}-slide-left-leave${r}-slide-left-leave-active${t}-placement-leftTop,\n &${r}-slide-left-leave${r}-slide-left-leave-active${t}-placement-leftBottom`]:{animationName:b.EZ}}},(0,T.A)(e,m),{[`${t} ${i}`]:{position:"relative",margin:0},[`${i}-submenu-popup`]:{position:"absolute",zIndex:s,background:"transparent",boxShadow:"none",transformOrigin:"0 0","ul, li":{listStyle:"none",margin:0}},[`${t}, ${t}-menu-submenu`]:{...(0,S.dF)(e),[i]:{padding:h,listStyleType:"none",backgroundColor:m,backgroundClip:"padding-box",borderRadius:e.borderRadiusLG,outline:"none",boxShadow:e.boxShadowSecondary,...(0,S.K8)(e),"&:empty":{padding:0,boxShadow:"none"},[`${i}-item-group-title`]:{padding:`${(0,_.zA)(d)} ${(0,_.zA)(g)}`,color:e.colorTextDescription,transition:`all ${a}`},[`${i}-item`]:{position:"relative",display:"flex",alignItems:"center"},[`${i}-item-icon`]:{minWidth:c,marginInlineEnd:e.marginXS,fontSize:e.fontSizeSM},[`${i}-title-content`]:{flex:"auto","&-with-extra":{display:"inline-flex",alignItems:"center",width:"100%"},[`> a, > ${i}-item-label > a`]:{color:"inherit",transition:`all ${a}`,"&:hover":{color:"inherit"},"&::after":{position:"absolute",inset:0,content:'""'}},[`${i}-item-extra`]:{paddingInlineStart:e.padding,marginInlineStart:"auto",fontSize:e.fontSizeSM,color:e.colorTextDescription}},[`${i}-item, ${i}-submenu-title`]:{display:"flex",margin:0,padding:`${(0,_.zA)(d)} ${(0,_.zA)(g)}`,color:e.colorText,fontWeight:400,fontSize:c,lineHeight:e.lineHeight,cursor:"pointer",transition:`all ${a}`,borderRadius:e.borderRadiusSM,"&:hover, &-active":{backgroundColor:e.controlItemBgHover},...(0,S.K8)(e),"&-selected":{color:e.colorPrimary,backgroundColor:e.controlItemBgActive,"&:hover, &-active":{backgroundColor:e.controlItemBgActiveHover}},"&-disabled":{color:u,cursor:"not-allowed","&:hover":{color:u,backgroundColor:m,cursor:"not-allowed"},a:{pointerEvents:"none"}},"&-divider":{height:1,margin:`${(0,_.zA)(e.marginXXS)} 0`,overflow:"hidden",lineHeight:0,backgroundColor:e.colorSplit},[`${t}-menu-submenu-expand-icon`]:{position:"absolute",insetInlineEnd:e.paddingXS,[`${t}-menu-submenu-arrow-icon`]:{marginInlineEnd:"0 !important",color:e.colorIcon,fontSize:p,fontStyle:"normal"}}},[`${i}-item-group-list`]:{margin:`0 ${(0,_.zA)(e.marginXS)}`,padding:0,listStyle:"none"},[`${i}-submenu-title`]:{paddingInlineEnd:e.calc(g).add(e.fontSizeSM).equal()},[`${i}-submenu-vertical`]:{position:"relative"},[`${i}-submenu${i}-submenu-disabled ${t}-menu-submenu-title`]:{[`&, ${t}-menu-submenu-arrow-icon`]:{color:u,backgroundColor:m,cursor:"not-allowed"}},[`${i}-submenu-selected ${t}-menu-submenu-title`]:{color:e.colorPrimary}}}},[(0,b._j)(e,"slide-up"),(0,b._j)(e,"slide-down"),(0,b._j)(e,"slide-left"),(0,b._j)(e,"slide-right"),(0,E.Mh)(e,"move-up"),(0,E.Mh)(e,"move-down"),(0,L.aB)(e,"zoom-big")]]},A=(0,R.OF)("Dropdown",e=>{const{marginXXS:t,sizePopupArrow:i,paddingXXS:s,componentCls:o}=e,n=(0,I.oX)(e,{menuCls:`${o}-menu`,dropdownArrowDistance:e.calc(i).div(2).add(t).equal(),dropdownEdgeChildPadding:s});return[B(n),N(n)]},e=>({zIndexPopup:e.zIndexPopupBase+50,paddingBlock:(e.controlHeight-e.fontSize*e.lineHeight)/2,...(0,T.K)({contentRadius:e.borderRadiusLG,limitVerticalRadius:!0}),...(0,O.n)(e)}),{resetStyle:!1}),M=s.forwardRef((e,t)=>{const{menu:i,arrow:p,prefixCls:_,children:S,trigger:b,disabled:E,dropdownRender:L,popupRender:T,getPopupContainer:O,overlayClassName:R,rootClassName:I,overlayStyle:N,open:B,onOpenChange:M,mouseEnterDelay:D=.15,mouseLeaveDelay:H=.1,autoAdjustOverflow:k=!0,placement:z="",transitionName:F,classNames:P,styles:j,destroyPopupOnHide:W,destroyOnHidden:G}=e,{getPrefixCls:V,direction:$,getPopupContainer:U,className:Y,style:X,classNames:Z,styles:q}=(0,f.TP)("dropdown"),K={...e,mouseEnterDelay:D,mouseLeaveDelay:H,autoAdjustOverflow:k},J=(0,c.XT)(X),Q=(0,c.XT)(N),[ee,te]=(0,c.AV)([Z,P],[q,J,j,Q],{props:K}),ie={...te.root},se=T||L;(0,m.rJ)("Dropdown");const oe=s.useMemo(()=>{const e=V();return void 0!==F?F:z.startsWith("top")?`${e}-slide-down`:z.startsWith("left")?`${e}-slide-right`:z.startsWith("right")?`${e}-slide-left`:`${e}-slide-up`},[V,z,F]),ne=s.useMemo(()=>z?z.includes("Center")?z.slice(0,z.indexOf("Center")):z:"rtl"===$?"bottomRight":"bottomLeft",[z,$]),re=V("dropdown",_),le=(0,C.A)(re),[ae,de]=A(re,le),[,ce]=(0,x.Ay)(),he=s.Children.only((0,h.sO)(S)?s.createElement("span",null,S):S),ue=(0,l.xK)(t,(0,l.A9)(he)),pe=(0,g.Ob)(he,{className:(0,a.$)(`${re}-trigger`,{[`${re}-rtl`]:"rtl"===$},he.props.className),disabled:he.props.disabled??E,ref:ue}),ge=E?[]:b,me=!!ge?.includes("contextMenu"),[ve,fe]=(0,l.PW)(!1,B),Ce=(0,l._q)(e=>{M?.(e,{source:"trigger"}),fe(e)}),ye=(0,a.$)(R,I,ae,de,le,Y,ee.root,{[`${re}-rtl`]:"rtl"===$}),we=(0,u.A)({arrowPointAtCenter:(0,h.Qd)(p)&&p.pointAtCenter,autoAdjustOverflow:k,offset:ce.marginXXS,arrowWidth:p?ce.sizePopupArrow:0,borderRadius:ce.borderRadius}),xe=(0,l._q)(()=>{i?.selectable&&i?.multiple||(M?.(!1,{source:"menu"}),fe(!1))}),[_e,Se]=(0,d.YK)("Dropdown",ie.zIndex);let be=s.createElement(r.A,{alignPoint:me,...(0,l.cJ)(e,["rootClassName","onOpenChange"]),mouseEnterDelay:D,mouseLeaveDelay:H,visible:ve,builtinPlacements:we,arrow:!!p,overlayClassName:ye,prefixCls:re,getPopupContainer:O||U,transitionName:oe,trigger:ge,overlay:()=>{const e=(0,l.cJ)(ee,["root"]),t=(0,l.cJ)(te,["root"]);let r;return i?.items&&(r=s.createElement(y.A,{...i,classNames:{...e,subMenu:{...e}},styles:{...t,subMenu:{...t}}})),se&&(r=se(r)),(0,h.Kg)(r)?r=s.createElement("span",null,r):s.isValidElement(r)||(r=s.createElement(s.Fragment,null,r)),s.createElement(w.A,{prefixCls:`${re}-menu`,rootClassName:(0,a.$)(de,le),expandIcon:s.createElement("span",{className:`${re}-menu-submenu-arrow`},s.createElement("rtl"===$?o.A:n.A,{className:`${re}-menu-submenu-arrow-icon`})),mode:"vertical",selectable:!1,onClick:xe,validator:({})=>{}},r)},placement:ne,onVisibleChange:Ce,overlayStyle:{...ie,zIndex:_e},autoDestroy:G??W},pe);return _e&&(be=s.createElement(v.A.Provider,{value:Se},be)),be}),D=(0,p.A)(M,"align",void 0,"dropdown",e=>e);M._InternalPanelDoNotUseOrYouWillBeFired=e=>s.createElement(D,{...e},s.createElement("span",null));const H=M},"./node_modules/.pnpm/antd@6.6.8_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/dropdown/index.js"(e,t,i){"use strict";i.d(t,{A:()=>p});var s=i("./node_modules/.pnpm/antd@6.6.8_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/dropdown/dropdown.js"),o=i("react"),n=i("./node_modules/.pnpm/@ant-design+icons@6.3.4_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@ant-design/icons/es/icons/EllipsisOutlined.js"),r=i("./node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs"),l=i("./node_modules/.pnpm/antd@6.6.8_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/button/index.js"),a=i("./node_modules/.pnpm/antd@6.6.8_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/config-provider/context.js"),d=i("./node_modules/.pnpm/antd@6.6.8_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/space/index.js"),c=i("./node_modules/.pnpm/antd@6.6.8_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/space/Compact.js");const h=e=>{const{getPopupContainer:t,getPrefixCls:i,direction:h}=o.useContext(a.QO),{prefixCls:u,type:p="default",danger:g,disabled:m,loading:v,onClick:f,htmlType:C,children:y,className:w,menu:x,arrow:_,autoFocus:S,trigger:b,align:E,open:L,onOpenChange:T,placement:O,getPopupContainer:R,href:I,icon:N=o.createElement(n.A,null),title:B,buttonsRender:A=e=>e,mouseEnterDelay:M,mouseLeaveDelay:D,overlayClassName:H,overlayStyle:k,destroyOnHidden:z,destroyPopupOnHide:F,dropdownRender:P,popupRender:j,...W}=e,G=i("dropdown",u),V=`${G}-button`,$={menu:x,arrow:_,autoFocus:S,align:E,disabled:m,trigger:m?[]:b,onOpenChange:T,getPopupContainer:R||t,mouseEnterDelay:M,mouseLeaveDelay:D,classNames:{root:H},styles:{root:k},destroyOnHidden:z,popupRender:j||P},{compactSize:U,compactItemClassnames:Y}=(0,c.RQ)(G,h),X=(0,r.$)(V,Y,w);"destroyPopupOnHide"in e&&($.destroyPopupOnHide=F),"open"in e&&($.open=L),$.placement="placement"in e?O:"rtl"===h?"bottomLeft":"bottomRight";const Z=o.createElement(l.A,{type:p,danger:g,disabled:m,loading:v,onClick:f,htmlType:C,href:I,title:B},y),q=o.createElement(l.A,{type:p,danger:g,icon:N}),[K,J]=A([Z,q]);return o.createElement(d.A.Compact,{className:X,size:U,block:!0,...W},K,o.createElement(s.A,{...$},J))};h.__ANT_BUTTON=!0;const u=s.A;u.Button=h;const p=u},"./node_modules/.pnpm/antd@6.6.8_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/popover/PurePanel.js"(e,t,i){"use strict";var s=i("react"),o=i("./node_modules/.pnpm/@rc-component+tooltip@1.5.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@rc-component/tooltip/es/index.js"),n=i("./node_modules/.pnpm/@rc-component+util@1.14.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@rc-component/util/es/index.js"),r=i("./node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs"),l=i("./node_modules/.pnpm/antd@6.6.8_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/_util/getRenderPropValue.js"),a=i("./node_modules/.pnpm/antd@6.6.8_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/_util/hooks/useMergeSemantic/index.js"),d=i("./node_modules/.pnpm/antd@6.6.8_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/config-provider/context.js"),c=i("./node_modules/.pnpm/antd@6.6.8_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/popover/style/index.js");const h=e=>{const{title:t,content:i,prefixCls:o,classNames:l,styles:a}=e;return(0,n.AZ)(t)||(0,n.AZ)(i)?s.createElement(s.Fragment,null,(0,n.AZ)(t)&&s.createElement("div",{className:(0,r.$)(`${o}-title`,l?.title),style:a?.title},t),(0,n.AZ)(i)&&s.createElement("div",{className:(0,r.$)(`${o}-content`,l?.content),style:a?.content},i)):null},u=e=>{const{hashId:t,prefixCls:i,className:n,style:d,placement:c="top",title:u,content:p,children:g,classNames:m,styles:v}=e,f=(0,l.b)(u),C=(0,l.b)(p),y={...e,placement:c},[w,x]=(0,a.AV)([m],[v],{props:y}),_=(0,r.$)(t,i,`${i}-pure`,`${i}-placement-${c}`,n);return s.createElement("div",{className:_,style:d},s.createElement("div",{className:`${i}-arrow`}),s.createElement(o.z,{...e,className:t,prefixCls:i,classNames:w,styles:x},g||s.createElement(h,{prefixCls:i,title:f,content:C,classNames:w,styles:x})))};i.d(t,["Ay",0,e=>{const{prefixCls:t,className:i,...o}=e,{getPrefixCls:n}=s.useContext(d.QO),l=n("popover",t),[a,h]=(0,c.A)(l);return s.createElement(u,{...o,prefixCls:l,hashId:a,className:(0,r.$)(i,h)})},"hJ",0,h,"xn",0,u])},"./node_modules/.pnpm/antd@6.6.8_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/popover/index.js"(e,t,i){"use strict";var s=i("react"),o=i("./node_modules/.pnpm/@rc-component+util@1.14.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@rc-component/util/es/index.js"),n=i("./node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs"),r=i("./node_modules/.pnpm/antd@6.6.8_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/_util/getRenderPropValue.js"),l=i("./node_modules/.pnpm/antd@6.6.8_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/_util/hooks/useMergeSemantic/index.js"),a=i("./node_modules/.pnpm/antd@6.6.8_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/_util/motion.js"),d=i("./node_modules/.pnpm/antd@6.6.8_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/config-provider/context.js"),c=i("./node_modules/.pnpm/antd@6.6.8_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/tooltip/index.js"),h=i("./node_modules/.pnpm/antd@6.6.8_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/tooltip/hook/useMergedArrow.js"),u=i("./node_modules/.pnpm/antd@6.6.8_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/popover/PurePanel.js"),p=i("./node_modules/.pnpm/antd@6.6.8_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/popover/style/index.js");const g=s.forwardRef((e,t)=>{const{prefixCls:i,title:g,content:m,overlayClassName:v,placement:f="top",trigger:C,children:y,mouseEnterDelay:w,mouseLeaveDelay:x,onOpenChange:_,overlayStyle:S={},styles:b,classNames:E,motion:L,arrow:T,...O}=e,{getPrefixCls:R,className:I,style:N,classNames:B,styles:A,arrow:M,trigger:D,mouseEnterDelay:H,mouseLeaveDelay:k}=(0,d.TP)("popover"),z=w??H??.1,F=x??k??.1,P=R("popover",i),[j,W]=(0,p.A)(P),G=R(),V=(0,h.A)(T,M),$=C||D||"hover";const U={...e,placement:f,trigger:$,mouseEnterDelay:z,mouseLeaveDelay:F,overlayStyle:S,styles:b,classNames:E},Y=(0,l.XT)(N),X=(0,l.XT)(S),[Z,q]=(0,l.AV)([B,E],[A,Y,b,X],{props:U}),K=(0,n.$)(v,j,W,I,Z.root),[J,Q]=(0,o.PW)(e.defaultOpen??!1,e.open),ee=(0,r.b)(g),te=(0,r.b)(m);return s.createElement(c.A,{unique:!1,arrow:V,placement:f,trigger:$,mouseEnterDelay:z,mouseLeaveDelay:F,...O,prefixCls:P,classNames:{root:K,container:Z.container,arrow:Z.arrow},styles:{root:q.root,container:q.container,arrow:q.arrow},ref:t,open:J,onOpenChange:e=>{Q(e),_?.(e)},overlay:(0,o.AZ)(ee)||(0,o.AZ)(te)?s.createElement(u.hJ,{prefixCls:P,title:ee,content:te,classNames:Z,styles:q}):null,motion:{motionName:(0,a.b)(G,"zoom-big","string"==typeof L?.motionName?L?.motionName:void 0)},"data-popover-inject":!0},y)});g._InternalPanelDoNotUseOrYouWillBeFired=u.Ay;i.d(t,["A",0,g])},"./node_modules/.pnpm/antd@6.6.8_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/popover/style/index.js"(e,t,i){"use strict";var s=i("./node_modules/.pnpm/antd@6.6.8_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/style/index.js"),o=i("./node_modules/.pnpm/antd@6.6.8_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/style/motion/zoom.js"),n=i("./node_modules/.pnpm/antd@6.6.8_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/style/placementArrow.js"),r=i("./node_modules/.pnpm/antd@6.6.8_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/style/roundedArrow.js"),l=i("./node_modules/.pnpm/antd@6.6.8_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/theme/interface/presetColors.js"),a=i("./node_modules/.pnpm/@ant-design+cssinjs-utils@2.1.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@ant-design/cssinjs-utils/es/index.js"),d=i("./node_modules/.pnpm/antd@6.6.8_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/theme/util/genStyleUtils.js");const c=e=>{const{componentCls:t,popoverColor:i,titleMinWidth:o,fontWeightStrong:r,innerPadding:l,dropShadowPopover:a,colorTextHeading:c,borderRadiusLG:h,zIndexPopup:u,titleMarginBottom:p,colorBgElevated:g,popoverBg:m,titleBorderBottom:v,innerContentPadding:f,titlePadding:C,antCls:y}=e,[w,x]=(0,d.PN)(y,"tooltip");return[{[t]:{...(0,s.dF)(e),position:"absolute",top:0,left:{_skip_check_:!0,value:0},zIndex:u,fontWeight:400,whiteSpace:"normal",textAlign:"start",cursor:"auto",userSelect:"text",filter:a,[w("valid-offset-x")]:x("arrow-offset-x","var(--arrow-x)"),transformOrigin:[x("valid-offset-x","50%"),"var(--arrow-y, 50%)"].join(" "),[w("arrow-background-color")]:g,width:"max-content",maxWidth:"100vw","&-rtl":{direction:"rtl"},"&-hidden":{display:"none"},[`${t}-content`]:{position:"relative"},[`${t}-container`]:{backgroundColor:m,backgroundClip:"padding-box",borderRadius:h,padding:l},[`${t}-title`]:{minWidth:o,marginBottom:p,color:c,fontWeight:r,borderBottom:v,padding:C},[`${t}-content`]:{color:i,padding:f}}},(0,n.A)(e,x("arrow-background-color"),{arrowShadow:!1}),{[`${t}-pure`]:{position:"relative",maxWidth:"none",margin:e.sizePopupArrow,display:"inline-block"}}]},h=e=>{const{componentCls:t,antCls:i}=e,[s]=(0,d.PN)(i,"tooltip");return{[t]:l.s.map(i=>{const o=e[`${i}6`];return{[`&${t}-${i}`]:{[s("arrow-background-color")]:o,[`${t}-container`]:{backgroundColor:o},[`${t}-arrow`]:{background:"transparent"}}}})}},u=(0,d.OF)("Popover",e=>{const{colorBgElevated:t,colorText:i}=e,s=(0,a.oX)(e,{popoverBg:t,popoverColor:i});return[c(s),h(s),(0,o.aB)(s,"zoom-big")]},e=>{const{lineWidth:t,controlHeight:i,fontHeight:s,padding:o,wireframe:l,zIndexPopupBase:a,borderRadiusLG:d,marginXS:c,lineType:h,colorSplit:u,paddingSM:p}=e,g=i-s,m=g/2,v=g/2-t,f=o;return{titleMinWidth:177,zIndexPopup:a+30,...(0,r.n)(e),...(0,n.K)({contentRadius:d,limitVerticalRadius:!0}),innerPadding:l?0:12,titleMarginBottom:l?0:c,titlePadding:l?`${m}px ${f}px ${v}px`:0,titleBorderBottom:l?`${t}px ${h} ${u}`:"none",innerContentPadding:l?`${p}px ${f}px`:0}},{resetStyle:!1,deprecatedTokens:[["width","titleMinWidth"],["minWidth","titleMinWidth"]]});i.d(t,["A",0,u])},"./node_modules/.pnpm/antd@6.6.8_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/spin/index.js"(e,t,i){"use strict";i.d(t,{A:()=>R});var s=i("react"),o=i("./node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs"),n=i("./node_modules/.pnpm/throttle-debounce@5.0.2/node_modules/throttle-debounce/esm/index.js"),r=i("./node_modules/.pnpm/antd@6.6.8_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/_util/hooks/useMergeSemantic/index.js"),l=i("./node_modules/.pnpm/antd@6.6.8_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/config-provider/context.js"),a=i("./node_modules/.pnpm/antd@6.6.8_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/config-provider/hooks/useSize.js"),d=i("./node_modules/.pnpm/antd@6.6.8_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/_util/reactNode.js"),c=i("./node_modules/.pnpm/@rc-component+util@1.14.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@rc-component/util/es/index.js");const h=80*Math.PI,u=e=>{const{dotClassName:t,style:i,hasCircleCls:n}=e;return s.createElement("circle",{className:(0,o.$)(`${t}-circle`,{[`${t}-circle-bg`]:n}),r:40,cx:50,cy:50,strokeWidth:20,style:i})},p=({percent:e,prefixCls:t})=>{const i=`${t}-dot`,n=`${i}-holder`,r=`${n}-hidden`,[l,a]=s.useState(!1);(0,c.Nf)(()=>{0!==e&&a(!0)},[e]);const d=Math.max(Math.min(e,100),0);if(!l)return null;const p={strokeDashoffset:""+h/4,strokeDasharray:`${h*d/100} ${h*(100-d)/100}`};return s.createElement("span",{className:(0,o.$)(n,`${i}-progress`,{[r]:d<=0})},s.createElement("svg",{viewBox:"0 0 100 100",role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":d},s.createElement(u,{dotClassName:i,hasCircleCls:!0}),s.createElement(u,{dotClassName:i,style:p})))};function g(e){const{prefixCls:t,percent:i=0,className:n,style:r}=e,l=`${t}-dot`,a=`${l}-holder`;return s.createElement(s.Fragment,null,s.createElement("span",{className:(0,o.$)(a,n,i>0&&`${a}-hidden`),style:r},s.createElement("span",{className:(0,o.$)(l,`${t}-dot-spin`)},[1,2,3,4].map(e=>s.createElement("i",{className:`${t}-dot-item`,key:e})))),s.createElement(p,{prefixCls:t,percent:i}))}function m(e){const{prefixCls:t,indicator:i,percent:n,className:r,style:l}=e,a=`${t}-dot`;return i&&s.isValidElement(i)?(0,d.Ob)(i,e=>({className:(0,o.$)(e.className,a,r),style:{...e.style,...l},percent:n})):s.createElement(g,{prefixCls:t,percent:n,className:r,style:l})}var v=i("./node_modules/.pnpm/@ant-design+cssinjs@2.1.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@ant-design/cssinjs/es/index.js"),f=i("./node_modules/.pnpm/antd@6.6.8_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/style/index.js"),C=i("./node_modules/.pnpm/antd@6.6.8_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/theme/util/genStyleUtils.js"),y=i("./node_modules/.pnpm/@ant-design+cssinjs-utils@2.1.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@ant-design/cssinjs-utils/es/index.js");const w=new v.Mo("antSpinMove",{to:{opacity:1}}),x=new v.Mo("antRotate",{to:{transform:"rotate(405deg)"}}),_=e=>{const{componentCls:t}=e,i=`${t}-section`;return{[t]:{...(0,f.dF)(e),position:"relative","&-rtl":{direction:"rtl"},[`&${i}, > ${i}`]:{display:"flex",alignItems:"center",flexDirection:"column",gap:e.paddingSM,color:e.colorPrimary},[`&${i}`]:{display:"inline-flex"},[`> ${i}`]:{position:"absolute",top:"50%",left:{_skip_check_:!0,value:"50%"},transform:"translate(-50%, -50%)",zIndex:1},[`${t}-description`]:{fontSize:e.fontSize,lineHeight:1},[`${t}-container`]:{position:"relative",transition:`opacity ${e.motionDurationSlow}`,"&::after":{position:"absolute",top:0,insetInlineEnd:0,bottom:0,insetInlineStart:0,zIndex:10,width:"100%",height:"100%",background:e.colorBgContainer,opacity:0,transition:`all ${e.motionDurationSlow}`,content:'""',pointerEvents:"none"}},"&-spinning":{[`${t}-description`]:{textShadow:`0 0px 5px ${e.colorBgContainer}`},[`${t}-container`]:{clear:"both",opacity:.5,userSelect:"none",pointerEvents:"none","&::after":{opacity:.4,pointerEvents:"auto"}}},"&-fullscreen":{position:"fixed",inset:0,backgroundColor:e.colorBgMask,zIndex:e.zIndexPopupBase,opacity:0,pointerEvents:"none",transition:`all ${e.motionDurationMid}`,[`&${t}-spinning`]:{opacity:1,pointerEvents:"auto"},[`> ${i}`]:{color:e.colorWhite,[`${t}-description`]:{color:e.colorTextLightSolid}}}}}},S=e=>{const{componentCls:t,antCls:i,motionDurationSlow:s}=e,[o,n]=(0,C.PN)(i,"spin");return{[t]:{[o("dot-holder-size")]:e.dotSize,[o("dot-item-size")]:`calc((${n("dot-holder-size")} - ${e.marginXXS} / 2) / 2)`,[`${t}-dot`]:{"&-holder":{width:"1em",height:"1em",fontSize:n("dot-holder-size"),display:"inline-block",transition:["transform","opacity"].map(e=>`${e} ${s} ease`).join(", "),transformOrigin:"50% 50%",lineHeight:1,"&-hidden":{transform:"scale(0.3)",opacity:0}},position:"relative",display:"inline-block",fontSize:n("dot-holder-size"),width:"1em",height:"1em","&-spin":{transform:"rotate(45deg)",animationName:x,animationDuration:"1.2s",animationIterationCount:"infinite",animationTimingFunction:"linear"},"&-item":{position:"absolute",display:"block",width:n("dot-item-size"),height:n("dot-item-size"),background:"currentColor",borderRadius:"100%",transform:"scale(0.75)",transformOrigin:"50% 50%",opacity:.3,animationName:w,animationDuration:"1s",animationIterationCount:"infinite",animationTimingFunction:"linear",animationDirection:"alternate","&:nth-child(1)":{top:0,insetInlineStart:0,animationDelay:"0s"},"&:nth-child(2)":{top:0,insetInlineEnd:0,animationDelay:"0.4s"},"&:nth-child(3)":{insetInlineEnd:0,bottom:0,animationDelay:"0.8s"},"&:nth-child(4)":{bottom:0,insetInlineStart:0,animationDelay:"1.2s"}},"&-progress":{position:"absolute",left:"50%",top:0,transform:"translateX(-50%)"},"&-circle":{strokeLinecap:"round",transition:["stroke-dashoffset","stroke-dasharray","stroke","stroke-width","opacity"].map(e=>`${e} ${s} ease`).join(","),fillOpacity:0,stroke:"currentcolor"},"&-circle-bg":{stroke:e.colorFillSecondary}}}}},b=e=>{const{componentCls:t}=e,[i]=(0,C.PN)(e.antCls,"spin");return{[t]:{"&-sm":{[i("dot-holder-size")]:e.dotSizeSM},"&-lg":{[i("dot-holder-size")]:e.dotSizeLG}}}},E=(0,C.OF)("Spin",e=>{const t=(0,y.oX)(e,{spinDotDefault:e.colorTextDescription});return[_(t),S(t),b(t)]},e=>{const{controlHeightLG:t,controlHeight:i}=e;return{contentHeight:400,dotSize:t/2,dotSizeSM:.35*t,dotSizeLG:i}}),L=[[30,.05],[70,.03],[96,.01]];let T;const O=s.forwardRef((e,t)=>{const{prefixCls:i,spinning:d=!0,delay:c=0,className:h,rootClassName:u,size:p,tip:g,description:v,wrapperClassName:f,style:C,children:y,fullscreen:w=!1,indicator:x,percent:_,classNames:S,styles:b,...O}=e,{getPrefixCls:R,direction:I,indicator:N,className:B,style:A,classNames:M,styles:D}=(0,l.TP)("spin"),H=R("spin",i),[k,z]=E(H),[F,P]=s.useState(()=>d&&!function(e,t){return!!e&&!!t&&!Number.isNaN(Number(t))}(d,c)),j=function(e,t){const[i,o]=s.useState(0),n=s.useRef(null),r="auto"===t;return s.useEffect(()=>(r&&e&&(o(0),n.current=setInterval(()=>{o(e=>{const t=100-e;for(let i=0;i<L.length;i+=1){const[s,o]=L[i];if(e<=s)return e+t*o}return e})},200)),()=>{n.current&&(clearInterval(n.current),n.current=null)}),[r,e]),r?i:t}(F,_);s.useEffect(()=>{if(d){const e=(0,n.s)(c,()=>{P(!0)});return e(),()=>{e?.cancel?.()}}P(!1)},[c,d]);const W=(0,a.A)(e=>p??e),G=v??g,V={...e,size:W,spinning:F,tip:G,description:G,fullscreen:w,children:y,percent:j},$=(0,r.XT)(A),[U,Y]=(0,r.AV)([M,S],[D,$,b],{props:V});const X=x??N??T,Z=void 0!==y,q=Z||w,K=s.createElement(s.Fragment,null,s.createElement(m,{className:(0,o.$)(U.indicator),style:Y.indicator,prefixCls:H,indicator:X,percent:j}),G&&s.createElement("div",{className:(0,o.$)(`${H}-description`,U.tip,U.description),style:{...Y.tip,...Y.description}},G)),J=s.useRef(null);return s.useImperativeHandle(t,()=>({nativeElement:J.current})),s.createElement("div",{ref:J,className:(0,o.$)(H,{[`${H}-sm`]:"small"===W,[`${H}-lg`]:"large"===W,[`${H}-spinning`]:F,[`${H}-rtl`]:"rtl"===I,[`${H}-fullscreen`]:w},u,U.root,w&&U.mask,q?f:[`${H}-section`,U.section],B,h,k,z),style:{...Y.root,...q?{}:Y.section,...w?Y.mask:{},...C},"aria-live":"polite","aria-busy":F,...O},F&&(q?s.createElement("div",{className:(0,o.$)(`${H}-section`,U.section),style:Y.section},K):K),Z&&s.createElement("div",{className:(0,o.$)(`${H}-container`,U.container),style:Y.container},y))});O.setDefaultIndicator=e=>{T=e};const R=O},"./node_modules/.pnpm/antd@6.6.8_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/style/motion/move.js"(e,t,i){"use strict";var s=i("./node_modules/.pnpm/@ant-design+cssinjs@2.1.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@ant-design/cssinjs/es/index.js"),o=i("./node_modules/.pnpm/antd@6.6.8_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/style/motion/motion.js");const n=new s.Mo("antMoveDownIn",{"0%":{transform:"translate3d(0, 100%, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),r=new s.Mo("antMoveDownOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(0, 100%, 0)",transformOrigin:"0 0",opacity:0}}),l=new s.Mo("antMoveLeftIn",{"0%":{transform:"translate3d(-100%, 0, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),a=new s.Mo("antMoveLeftOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(-100%, 0, 0)",transformOrigin:"0 0",opacity:0}}),d=new s.Mo("antMoveRightIn",{"0%":{transform:"translate3d(100%, 0, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),c=new s.Mo("antMoveRightOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(100%, 0, 0)",transformOrigin:"0 0",opacity:0}}),h={"move-up":{inKeyframes:new s.Mo("antMoveUpIn",{"0%":{transform:"translate3d(0, -100%, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),outKeyframes:new s.Mo("antMoveUpOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(0, -100%, 0)",transformOrigin:"0 0",opacity:0}})},"move-down":{inKeyframes:n,outKeyframes:r},"move-left":{inKeyframes:l,outKeyframes:a},"move-right":{inKeyframes:d,outKeyframes:c}};i.d(t,["Mh",0,(e,t)=>{const{antCls:i}=e,s=`${i}-${t}`,{inKeyframes:n,outKeyframes:r}=h[t];return[(0,o.b)(s,n,r,e.motionDurationMid),{[`\n ${s}-enter,\n ${s}-appear\n `]:{opacity:0,animationTimingFunction:e.motionEaseOutCirc},[`${s}-leave`]:{animationTimingFunction:e.motionEaseInOutCirc}}]}])},"./node_modules/.pnpm/css-loader@6.11.0_webpack@5.108.4/node_modules/css-loader/dist/cjs.js!./node_modules/.pnpm/@antv+s2-react-components@2.1.2_@ant-design+icons@6.3.4_react-dom@18.3.1_react@18.3.1___3e381e9efa4b10f7e6ec22fb55733008/node_modules/@antv/s2-react-components/dist/s2-react-components.min.css"(e,t,i){"use strict";var s=i("./node_modules/.pnpm/css-loader@6.11.0_webpack@5.108.4/node_modules/css-loader/dist/runtime/noSourceMaps.js"),o=i.n(s),n=i("./node_modules/.pnpm/css-loader@6.11.0_webpack@5.108.4/node_modules/css-loader/dist/runtime/api.js"),r=i.n(n)()(o());r.push([e.id,'.antv-s2-icon{color:inherit}.antv-s2-radio-group{color:#3572f9;cursor:pointer;display:flex;justify-content:space-between;align-items:flex-start}.antv-s2-radio-group.antv-s2-radio-group-icon-only .ant-radio-group .ant-radio-button-wrapper{border:none;background:transparent;box-shadow:none}.antv-s2-radio-group.antv-s2-radio-group-icon-only .ant-radio-group .ant-radio-button-wrapper:before{display:none}.antv-s2-radio-group.antv-s2-radio-group-icon-only .ant-radio-group .ant-radio-button-wrapper-checked{background:transparent;border:none;box-shadow:none;outline:none}.antv-s2-radio-group.antv-s2-radio-group-icon-only .ant-radio-group .ant-radio-button-wrapper-checked:focus-visible,.antv-s2-radio-group.antv-s2-radio-group-icon-only .ant-radio-group .ant-radio-button-wrapper-checked:focus-within{border:none;outline:none}.antv-s2-radio-group+.antv-s2-radio-group{margin-top:6px}.antv-s2-radio-group-label{flex:1 0;flex-wrap:nowrap;display:inline-flex;color:#00000073;font-size:14px;margin-right:12px}.antv-s2-radio-group-content{display:flex;flex-direction:column;align-items:flex-start}.antv-s2-reset-btn{color:#3572f9;cursor:pointer;padding-left:8px}.antv-s2-reset-btn-text{margin-left:4px}.antv-s2-reset-group{width:340px}.antv-s2-advanced-sort{display:inline-block}.antv-s2-advanced-sort-btn.ant-btn{display:flex;align-items:center}.antv-s2-advanced-sort-btn.ant-btn .antv-s2-icon{padding-top:2px}.antv-s2-advanced-sort-modal{min-width:640px}.antv-s2-advanced-sort-modal .ant-modal-content,.antv-s2-advanced-sort-modal .ant-modal-header{background-color:var(--antv-s2-container-background, #fff)}.antv-s2-advanced-sort-modal .antv-s2-advanced-sort-sider-layout.ant-layout-sider{border-right:1px solid var(--antv-s2-border, #f0f0f0);background:var(--antv-s2-container-background, #fff)}.antv-s2-advanced-sort-modal .antv-s2-advanced-sort-sider-layout .antv-s2-advanced-sort-title{font-size:12px;padding:8px 16px 8px 0;border-bottom:1px solid var(--antv-s2-border, #f0f0f0)}.antv-s2-advanced-sort-modal .antv-s2-advanced-sort-sider-layout .antv-s2-advanced-sort-dimension-item{height:32px;padding:8px 6px 8px 0;cursor:pointer;align-items:center;color:var(--antv-s2-font-65, rgba(0, 0, 0, .65));font-size:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.antv-s2-advanced-sort-modal .antv-s2-advanced-sort-content-layout{background:var(--antv-s2-container-background, #fff)}.antv-s2-advanced-sort-modal .antv-s2-advanced-sort-content-layout .antv-s2-advanced-sort-title{font-size:12px;padding:8px 16px;border-bottom:1px solid var(--antv-s2-border, #f0f0f0)}.antv-s2-advanced-sort-modal .antv-s2-advanced-sort-content-layout .antv-s2-advanced-sort-custom-form.ant-form{padding:8px 0 0 16px}.antv-s2-advanced-sort-modal .antv-s2-advanced-sort-content-layout .antv-s2-advanced-sort-custom-form.ant-form .ant-form-item-label>label,.antv-s2-advanced-sort-modal .antv-s2-advanced-sort-content-layout .antv-s2-advanced-sort-custom-form.ant-form .ant-select,.antv-s2-advanced-sort-modal .antv-s2-advanced-sort-content-layout .antv-s2-advanced-sort-custom-form.ant-form .ant-select-item,.antv-s2-advanced-sort-modal .antv-s2-advanced-sort-content-layout .antv-s2-advanced-sort-custom-form.ant-form .ant-form label{font-size:12px}.antv-s2-advanced-sort-modal .antv-s2-advanced-sort-content-layout .antv-s2-advanced-sort-custom-form.ant-form .ant-radio-group{margin-left:16px;font-size:12px}.antv-s2-advanced-sort-modal .antv-s2-advanced-sort-content-layout .antv-s2-advanced-sort-custom-form.ant-form .ant-form-item{margin-bottom:4px}.antv-s2-advanced-sort-modal .antv-s2-advanced-sort-content-layout .antv-s2-advanced-sort-custom-form.ant-form .ant-form-item .ant-cascader-picker,.antv-s2-advanced-sort-modal .antv-s2-advanced-sort-content-layout .antv-s2-advanced-sort-custom-form.ant-form .ant-form-item .ant-select{width:120px}.antv-s2-advanced-sort-modal .antv-s2-advanced-sort-content-layout .antv-s2-advanced-sort-custom-form.ant-form .ant-form-item-control-input-content{display:flex;align-items:center}.antv-s2-advanced-sort-modal .antv-s2-advanced-sort-content-layout .antv-s2-advanced-sort-rule-end{margin-left:16px;font-size:12px}.antv-s2-advanced-sort-modal .antv-s2-advanced-sort-content-layout .antv-s2-advanced-sort-rule-end label{font-size:12px;margin:0}.antv-s2-advanced-sort-modal .antv-s2-advanced-sort-content-layout .antv-s2-advanced-sort-rule-end-delete{cursor:pointer;right:0;position:absolute}.antv-s2-advanced-sort-modal .antv-s2-advanced-sort-content-layout .antv-s2-advanced-sort-field-prefix{position:relative;padding:0 6px;color:var(--antv-s2-font-65, rgba(0, 0, 0, .65));font-weight:400;font-size:12px;text-align:center;background-color:var(--antv-s2-block-background, #fafafa);border:1px solid var(--antv-s2-border, #f0f0f0);border-radius:4px 0 0 4px;height:24px;display:inline-block;line-height:21px;margin-left:8px}.antv-s2-advanced-sort-modal .antv-s2-advanced-sort-content-layout .antv-s2-advanced-sort-field-prefix+.ant-select .ant-select-selector{border-radius:0 4px 4px 0}.antv-s2-advanced-sort-modal .ant-cascader-menus{height:100px}.antv-s2-advanced-sort-modal .ant-cascader-menus ul{height:104px}.antv-s2-advanced-sort-modal .ant-cascader-menu-item,.antv-s2-advanced-sort-modal .ant-cascader-picker-label{font-size:12px}.antv-s2-advanced-sort-custom-modal .antv-s2-advanced-sort-card-content .ant-card-body{padding:0;font-size:12px}.antv-s2-advanced-sort-custom-modal .antv-s2-advanced-sort-card-content .ant-card-body .antv-s2-advanced-sort-split-value{height:32px;color:var(--antv-s2-font-65, #333);line-height:32px;padding:0 10px 0 7px}.antv-s2-advanced-sort-custom-modal .antv-s2-advanced-sort-card-content .ant-card-body .antv-s2-advanced-sort-split-value .antv-s2-advanced-sort-split-icon{float:right;cursor:pointer;width:30px}.antv-s2-advanced-sort-custom-modal .antv-s2-advanced-sort-card-content .ant-card-body .antv-s2-advanced-sort-split-value .antv-s2-advanced-sort-split-icon svg{fill:var(--antv-s2-font-65)}.antv-s2-advanced-sort-custom-modal .antv-s2-advanced-sort-card-content .ant-card-body .antv-s2-advanced-sort-split-value:nth-child(odd){background:var(--antv-s2-block-background, #f7f9fb)}.antv-s2-drill-down{width:260px;min-height:20px;position:relative;color:var(--antv-s2-font-70, rgba(0, 0, 0, .9))}.antv-s2-drill-down-header{display:flex;height:32px;font-size:14px;padding:0 16px;margin-top:16px;align-items:center;justify-content:space-between}.antv-s2-drill-down-header button{position:absolute;right:0;top:0;font-size:12px;color:#1890ff;line-height:20px}.antv-s2-drill-down-search{height:24px;width:228px!important;margin:0 16px;border:1px solid rgba(0,0,0,.15);border-radius:2px}.antv-s2-drill-down-search input,.antv-s2-drill-down-search span{font-size:12px}.antv-s2-drill-down-search,.antv-s2-drill-down-search .ant-input::placeholder{background-color:var(--antv-s2-block-background, #fff)}.antv-s2-drill-down-menu{max-height:314px;overflow:hidden auto}.antv-s2-drill-down-menu.ant-menu{background:var(--antv-s2-tooltip-background, #fff)}.antv-s2-drill-down-menu.ant-menu:not(.ant-menu-horizontal) .ant-menu-item-selected{background-color:var(--antv-s2-block-background, #e6f7ff)}.antv-s2-drill-down-menu-item{height:32px!important;line-height:32px!important;font-size:12px;opacity:.65}.antv-s2-drill-down-menu-item span:last-child{line-height:32px}.antv-s2-drill-down-menu-item svg{margin-right:8px}.antv-s2-drill-down-empty{padding:12px;font-size:12px}.antv-s2-switcher-item{height:24px;border-radius:3px;display:flex}.antv-s2-switcher-item-text{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.antv-s2-switcher-item.normal-item{padding:0 12px;background-color:var(--antv-s2-block-background, #d9eeff);align-items:center;border:1px solid var(--antv-s2-border, #d9eeff)}.antv-s2-switcher-item.checkable-item{padding:0 4px;background-color:var(--antv-s2-block-background, #d3f4e5);align-items:baseline;border:1px solid var(--antv-s2-border, #d3f4e5);border-bottom-width:0}.antv-s2-switcher-item.checkable-item:last-child{border-bottom-width:1px}.antv-s2-switcher-item.checkable-item.item-collapse{transition:border-radius 0s .2s;border-radius:3px!important}.antv-s2-switcher-item.checkable-item.unchecked{color:var(--antv-s2-font-25, rgba(0, 0, 0, .25))}.antv-s2-switcher-item.checkable-item:not(:last-child){border-radius:3px 3px 0 0}.antv-s2-switcher-item.checkable-item .ant-checkbox{margin-right:4px}.antv-s2-switcher-normal-list,.antv-s2-switcher-checkable-list{border-radius:3px}.antv-s2-switcher-normal-list+.antv-s2-switcher-normal-list,.antv-s2-switcher-normal-list+.antv-s2-switcher-checkable-list,.antv-s2-switcher-checkable-list+.antv-s2-switcher-normal-list,.antv-s2-switcher-checkable-list+.antv-s2-switcher-checkable-list{margin-top:4px}.antv-s2-switcher-normal-list.dragging,.antv-s2-switcher-checkable-list.dragging{box-shadow:0 0 2px 1px #0000001a}.antv-s2-switcher-normal-list.disable-dragging,.antv-s2-switcher-checkable-list.disable-dragging{cursor:not-allowed}.antv-s2-switcher-normal-list .child-items,.antv-s2-switcher-checkable-list .child-items{transition:max-height .2s,opacity .4s;overflow:hidden;max-height:1000px}.antv-s2-switcher-normal-list .child-items .checkable-item,.antv-s2-switcher-checkable-list .child-items .checkable-item{padding:0 12px;background-color:var(--antv-s2-block-background, #effbf6);margin-top:0;border-radius:0}.antv-s2-switcher-normal-list .child-items .checkable-item:not(:last-child),.antv-s2-switcher-checkable-list .child-items .checkable-item:not(:last-child){border-top-width:0;border-bottom-width:0}.antv-s2-switcher-normal-list .child-items .checkable-item:last-child,.antv-s2-switcher-checkable-list .child-items .checkable-item:last-child{border-top-width:0;border-radius:0 0 3px 3px}.antv-s2-switcher-normal-list .child-items.item-hidden,.antv-s2-switcher-checkable-list .child-items.item-hidden{max-height:0;opacity:0}.antv-s2-switcher-tooltip .ant-tooltip-inner{max-width:180px}.antv-s2-switcher-dimension{background-color:transparent;display:flex;flex-direction:column}.antv-s2-switcher-dimension.long-dimension{grid-row:span 2}.antv-s2-switcher-dimension-header{display:flex;align-items:center;margin-bottom:8px;justify-content:space-between}.antv-s2-switcher-dimension-header .title{display:inline-flex;align-items:center}.antv-s2-switcher-dimension-header .title span{margin-left:8px}.antv-s2-switcher-dimension-header .expand-option{font-size:12px}.antv-s2-switcher-dimension-header .expand-option .description{margin-left:4px}.antv-s2-switcher-dimension-items{flex:1;min-height:120px;padding:8px;border:1px solid rgba(0,0,0,.15);border-radius:4px;overflow-y:auto;background:var(--antv-s2-block-background)}.antv-s2-switcher-dimension-items-highlight{border:1px solid #6b9cff;box-shadow:0 0 2px 1px #2e5bd933}.antv-s2-switcher-dimension-items::-webkit-scrollbar-thumb{border-radius:5px;background-color:#00000026}.antv-s2-switcher-dimension-items::-webkit-scrollbar-thumb:hover{background-color:#00000040}.antv-s2-switcher-dimension-items::-webkit-scrollbar{width:6px}.antv-s2-switcher-content-header,.antv-s2-switcher-content-main{margin-bottom:16px}.antv-s2-switcher-content-header{font-size:14px;font-weight:700}.antv-s2-switcher-content-main{display:grid;grid-gap:16px;grid-auto-flow:column;font-size:12px}.antv-s2-switcher-content-three-dimensions{grid-template-rows:repeat(2,160px);grid-template-columns:repeat(2,minmax(180px,1fr))}.antv-s2-switcher-content-one-dimension{grid-template-rows:160px;grid-template-columns:1fr}.antv-s2-switcher-content-footer{display:flex;align-items:center;justify-content:space-between;gap:0 10px}.antv-s2-switcher-content-footer-reset-button.ant-btn{font-size:14px;padding:0}.antv-s2-switcher-content-footer-actions .action-button+.action-button{margin-left:8px}.antv-s2-switcher-content .ant-checkbox-inner{height:14px;width:14px}.antv-s2-switcher-content .ant-checkbox-inner:after{width:4.8px;height:8px}.antv-s2-switcher-switcher-overlay .ant-popover-inner,.antv-s2-switcher-switcher-overlay .ant-popover-arrow-content:before{background:var(--antv-s2-container-background, #fff)}.antv-s2-switcher-entry-button.ant-btn{display:inline-flex;align-items:center}.antv-s2-frozen-panel{width:400px}.antv-s2-frozen-panel-container{display:flex;align-items:center;justify-content:space-between}.antv-s2-frozen-panel-container:not(:last-of-type){margin-bottom:6px}.antv-s2-frozen-panel-container-group{color:#0000006e}.antv-s2-frozen-panel-container-group:not(:last-of-type){margin-right:12px}.antv-s2-frozen-panel-container .ant-checkbox-wrapper{margin-right:50px;color:#535455}.antv-s2-frozen-panel-container .ant-input-number.antv-s2-frozen-input-number{width:50px;margin:0 4px;border-radius:4px}.antv-s2-color-box{display:inline-flex;box-sizing:border-box;width:20px;height:20px;border:1px solid rgba(0,0,0,.06);border-radius:2px;cursor:pointer;transition:all .3s}.antv-s2-color-box:hover{transform:scale(1.1)}.antv-s2-color-picker-panel{width:218px}.antv-s2-color-picker-panel-header{display:flex;align-items:center;margin-bottom:8px}.antv-s2-color-picker-panel-header-title{display:inline-flex;margin-right:8px;color:#000000d9;font-weight:500;font-size:12px;line-height:20px}.antv-s2-color-picker-panel-section{margin-bottom:8px}.antv-s2-color-picker-panel-section-title{margin-bottom:8px;color:#000000a6;font-size:12px;line-height:20px}.antv-s2-color-picker-panel-section-color-list{display:flex}.antv-s2-color-picker-panel-section-color-list .antv-s2-color-box:not(:last-child){margin-right:6px}.antv-s2-color-picker-panel-collapse-collapse-title{color:#000000a6;font-size:12px;line-height:20px}.antv-s2-color-picker-panel-collapse .ant-collapse-content-box{padding:0!important}.antv-s2-color-picker-panel-collapse .ant-collapse-content-box .antv-s2-color-picker-panel-sketch-picker{box-shadow:none!important;border-radius:0!important;padding:0!important;background:transparent!important}.antv-s2-theme-panel-custom-color{display:flex;align-items:center;padding-top:10px}.antv-s2-theme-panel-custom-color:before{position:relative;display:block;flex:1;content:""}.antv-s2-theme-panel-custom-color>div{display:flex;flex:2;align-items:center}.antv-s2-theme-panel-custom-color-title{margin-right:20px;color:#00000073;font-size:12px}\n',""]);i.d(t,["A",0,r])},"./node_modules/.pnpm/css-loader@6.11.0_webpack@5.108.4/node_modules/css-loader/dist/cjs.js!./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/ui/tooltip/index.css"(e,t,i){"use strict";var s=i("./node_modules/.pnpm/css-loader@6.11.0_webpack@5.108.4/node_modules/css-loader/dist/runtime/noSourceMaps.js"),o=i.n(s),n=i("./node_modules/.pnpm/css-loader@6.11.0_webpack@5.108.4/node_modules/css-loader/dist/runtime/api.js"),r=i.n(n)()(o());r.push([e.id,".antv-s2-tooltip-container {\n position: fixed;\n user-select: text;\n min-width: 200px;\n max-width: 640px;\n max-height: 100vh;\n overflow: auto;\n z-index: 1024;\n display: inline-block;\n background: var(--antv-s2-tooltip-background, rgba(255, 255, 255, 0.95));\n border-radius: 4px;\n box-shadow: 0 1px 4px 0 rgba(0, 0, 0, 0.2);\n font-size: 12px;\n font-family: Roboto, 'PingFang SC', 'Chinese Quote', 'Segoe UI',\n 'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial,\n sans-serif;\n}\n\n.antv-s2-tooltip-container-hide {\n opacity: 0;\n visibility: hidden;\n pointer-events: none;\n}\n\n.antv-s2-tooltip-container-hide * {\n transition: none;\n}\n\n.antv-s2-tooltip-container-show {\n opacity: 1;\n visibility: visible;\n pointer-events: all;\n}\n",""]);i.d(t,["A",0,r])},"./node_modules/.pnpm/css-loader@6.11.0_webpack@5.108.4/node_modules/css-loader/dist/cjs.js!./src/components/fragments/SheetSwitcher.css"(e,t,i){"use strict";var s=i("./node_modules/.pnpm/css-loader@6.11.0_webpack@5.108.4/node_modules/css-loader/dist/runtime/noSourceMaps.js"),o=i.n(s),n=i("./node_modules/.pnpm/css-loader@6.11.0_webpack@5.108.4/node_modules/css-loader/dist/runtime/api.js"),r=i.n(n)()(o());r.push([e.id,".dac-s2-switcher-overlay .ant-popover-inner {\n color: var(--antv-s2-font-70);\n background: var(--antv-s2-container-background);\n}\n\n.dac-s2-switcher-overlay .antv-s2-switcher-content-main {\n max-width: calc(100vw - 48px);\n}\n\n.dac-s2-switcher-overlay .antv-s2-switcher-dimension-items {\n color: var(--antv-s2-font-70);\n border-color: var(--antv-s2-border);\n overflow-x: hidden;\n overscroll-behavior: contain;\n}\n\n.dac-s2-switcher-overlay .antv-s2-switcher-item.normal-item,\n.dac-s2-switcher-overlay .antv-s2-switcher-item.checkable-item {\n color: var(--antv-s2-font-70);\n border-color: var(--antv-s2-border);\n}\n\n.dac-s2-switcher-overlay .antv-s2-switcher-item.unchecked {\n color: var(--antv-s2-font-25);\n}\n\nbody > .antv-s2-switcher-normal-list.dragging,\nbody > .antv-s2-switcher-checkable-list.dragging {\n box-sizing: border-box;\n z-index: 1100;\n}\n",""]);i.d(t,["A",0,r])},"./node_modules/.pnpm/@antv+s2-react-components@2.1.2_@ant-design+icons@6.3.4_react-dom@18.3.1_react@18.3.1___3e381e9efa4b10f7e6ec22fb55733008/node_modules/@antv/s2-react-components/dist/s2-react-components.min.css"(e,t,i){"use strict";var s=i("./node_modules/.pnpm/style-loader@3.3.4_webpack@5.108.4/node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"),o=i.n(s),n=i("./node_modules/.pnpm/style-loader@3.3.4_webpack@5.108.4/node_modules/style-loader/dist/runtime/styleDomAPI.js"),r=i.n(n),l=i("./node_modules/.pnpm/style-loader@3.3.4_webpack@5.108.4/node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js"),a=i.n(l),d=i("./node_modules/.pnpm/style-loader@3.3.4_webpack@5.108.4/node_modules/style-loader/dist/runtime/insertStyleElement.js"),c=i.n(d),h=i("./node_modules/.pnpm/style-loader@3.3.4_webpack@5.108.4/node_modules/style-loader/dist/runtime/styleTagTransform.js"),u=i.n(h),p=i("./node_modules/.pnpm/css-loader@6.11.0_webpack@5.108.4/node_modules/css-loader/dist/cjs.js!./node_modules/.pnpm/@antv+s2-react-components@2.1.2_@ant-design+icons@6.3.4_react-dom@18.3.1_react@18.3.1___3e381e9efa4b10f7e6ec22fb55733008/node_modules/@antv/s2-react-components/dist/s2-react-components.min.css"),g={};g.styleTagTransform=u(),g.setAttributes=a(),g.insert=function(e){const t=document.querySelector("head"),i=window._lastElementInsertedByStyleLoader;i?i.nextSibling?t.insertBefore(e,i.nextSibling):t.appendChild(e):t.insertBefore(e,t.firstChild),window._lastElementInsertedByStyleLoader=e},g.domAPI=r(),g.insertStyleElement=c();o()(p.A,g)},"./src/components/fragments/async/extensions/Sheet.tsx"(e,t,i){"use strict";i.r(t),i.d(t,{default:()=>qr});var s,o,n=i("react"),r=i.n(n),l=i("./node_modules/.pnpm/@antv+g@6.3.3/node_modules/@antv/g/dist/index.esm.js"),a=i("./node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/lodash.js"),d=i("./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/common/constant/interaction.js");!function(e){e.Row="frozenRow",e.Col="frozenCol",e.TrailingRow="frozenTrailingRow",e.TrailingCol="frozenTrailingCol"}(s||(s={})),function(e){e.Row="frozenRowGroup",e.Col="frozenColGroup",e.TrailingCol="frozenTrailingColGroup",e.TrailingRow="frozenTrailingRowGroup",e.TopLeft="frozenTopLeftGroup",e.TopRight="frozenTopRightGroup",e.BottomLeft="frozenBottomLeftGroup",e.BottomRight="frozenBottomRightGroup",e.Scroll="scrollGroup"}(o||(o={}));const c={[s.Row]:o.Row,[s.Col]:o.Col,[s.TrailingRow]:o.TrailingRow,[s.TrailingCol]:o.TrailingCol};var h=i("./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/common/constant/basic.js");var u,p,g,m;!function(e){e.Horizontal="col",e.Vertical="row"}(u||(u={})),function(e){e.Field="field",e.Cell="cell",e.Tree="tree",e.Series="series"}(p||(p={})),function(e){e.ALL="all",e.CURRENT="current",e.SELECTED="selected"}(g||(g={})),function(e){e.ROW_CELL_HOVER="row-cell:hover",e.ROW_CELL_CLICK="row-cell:click",e.ROW_CELL_DOUBLE_CLICK="row-cell:double-click",e.ROW_CELL_CONTEXT_MENU="row-cell:context-menu",e.ROW_CELL_MOUSE_DOWN="row-cell:mouse-down",e.ROW_CELL_MOUSE_UP="row-cell:mouse-up",e.ROW_CELL_MOUSE_MOVE="row-cell:mouse-move",e.ROW_CELL_SCROLL="row-cell:scroll",e.ROW_CELL_BRUSH_SELECTION="row-cell:brush-selection",e.ROW_CELL_COLLAPSED="row-cell:collapsed",e.ROW_CELL_ALL_COLLAPSED="row-cell:all-collapsed",e.ROW_CELL_RENDER="row-cell:render",e.ROW_CELL_SELECTED="row-cell:selected",e.ROW_CELL_COLLAPSED__PRIVATE="row-cell:collapsed__private",e.ROW_CELL_ALL_COLLAPSED__PRIVATE="row-cell:all-collapsed__private",e.DATA_CELL_HOVER_TRIGGERED_PRIVATE="data-cell:hover-trigger__private",e.DATA_CELL_CLICK_TRIGGERED_PRIVATE="data-cell:click-trigger__private",e.COL_CELL_HOVER="col-cell:hover",e.COL_CELL_CLICK="col-cell:click",e.COL_CELL_DOUBLE_CLICK="col-cell:double-click",e.COL_CELL_CONTEXT_MENU="col-cell:context-menu",e.COL_CELL_MOUSE_DOWN="col-cell:mouse-down",e.COL_CELL_MOUSE_UP="col-cell:mouse-up",e.COL_CELL_MOUSE_MOVE="col-cell:mouse-move",e.COL_CELL_BRUSH_SELECTION="col-cell:brush-selection",e.COL_CELL_EXPANDED="col-cell:expanded",e.COL_CELL_EXPAND_ICON_HOVER="col-cell:expand-icon-hover",e.COL_CELL_HIDDEN="col-cell:hidden",e.COL_CELL_RENDER="col-cell:render",e.COL_CELL_SELECTED="col-cell:selected",e.DATA_CELL_HOVER="data-cell:hover",e.DATA_CELL_CLICK="data-cell:click",e.DATA_CELL_DOUBLE_CLICK="data-cell:double-click",e.DATA_CELL_CONTEXT_MENU="data-cell:context-menu",e.DATA_CELL_MOUSE_UP="data-cell:mouse-up",e.DATA_CELL_MOUSE_DOWN="data-cell:mouse-down",e.DATA_CELL_MOUSE_MOVE="data-cell:mouse-move",e.DATA_CELL_BRUSH_SELECTION="data-cell:brush-selection",e.DATA_CELL_SELECT_MOVE="data-cell:select-move",e.DATA_CELL_RENDER="data-cell:render",e.DATA_CELL_SELECTED="data-cell:selected",e.CORNER_CELL_HOVER="corner-cell:hover",e.CORNER_CELL_CLICK="corner-cell:click",e.CORNER_CELL_DOUBLE_CLICK="corner-cell:double-click",e.CORNER_CELL_CONTEXT_MENU="corner-cell:context-menu",e.CORNER_CELL_MOUSE_DOWN="corner-cell:mouse-down",e.CORNER_CELL_MOUSE_UP="corner-cell:mouse-up",e.CORNER_CELL_MOUSE_MOVE="corner-cell:mouse-move",e.CORNER_CELL_RENDER="corner-cell:render",e.CORNER_CELL_SELECTED="corner-cell:selected",e.MERGED_CELLS_HOVER="merged-cells:hover",e.MERGED_CELLS_CLICK="merged-cells:click",e.MERGED_CELLS_DOUBLE_CLICK="merged-cells:double-click",e.MERGED_CELLS_CONTEXT_MENU="merged-cells:context-menu",e.MERGED_CELLS_MOUSE_DOWN="merged-cells:mouse-down",e.MERGED_CELLS_MOUSE_UP="merged-cells:mouse-up",e.MERGED_CELLS_MOUSE_MOVE="merged-cells:mouse-move",e.MERGED_CELLS_RENDER="merged-cells:render",e.SERIES_NUMBER_CELL_RENDER="series-number-cell:render",e.RANGE_SORT="sort:range-sort",e.RANGE_SORTED="sort:range-sorted",e.RANGE_FILTER="filter:range-filter",e.RANGE_FILTERED="filter:range-filtered",e.LAYOUT_AFTER_HEADER_LAYOUT="layout:after-header-layout",e.LAYOUT_CELL_RENDER="layout:cell-render",e.LAYOUT_PAGINATION="layout:pagination",e.LAYOUT_AFTER_REAL_DATA_CELL_RENDER="layout:after-real-data-cell-render",e.LAYOUT_AFTER_RENDER="layout:after-render",e.LAYOUT_BEFORE_RENDER="layout:before-render",e.LAYOUT_DESTROY="layout:destroy",e.LAYOUT_RESIZE="layout:resize",e.LAYOUT_RESIZE_SERIES_WIDTH="layout:resize-series-width",e.LAYOUT_RESIZE_ROW_WIDTH="layout:resize-row-width",e.LAYOUT_RESIZE_ROW_HEIGHT="layout:resize-row-height",e.LAYOUT_RESIZE_COL_WIDTH="layout:resize-column-width",e.LAYOUT_RESIZE_COL_HEIGHT="layout:resize-column-height",e.LAYOUT_RESIZE_TREE_WIDTH="layout:resize-tree-width",e.LAYOUT_RESIZE_MOUSE_DOWN="layout:resize:mouse-down",e.LAYOUT_RESIZE_MOUSE_MOVE="layout:resize:mouse-move",e.LAYOUT_RESIZE_MOUSE_UP="layout:resize-mouse-up",e.GLOBAL_KEYBOARD_DOWN="global:keyboard-down",e.GLOBAL_KEYBOARD_UP="global:keyboard-up",e.GLOBAL_COPIED="global:copied",e.GLOBAL_MOUSE_UP="global:mouse-up",e.GLOBAL_MOUSE_MOVE="global:mouse-move",e.GLOBAL_ACTION_ICON_CLICK="global:action-icon-click",e.GLOBAL_ACTION_ICON_HOVER="global:action-icon-hover",e.GLOBAL_ACTION_ICON_HOVER_OFF="global:action-icon-hover-off",e.GLOBAL_CONTEXT_MENU="global:context-menu",e.GLOBAL_CLICK="global:click",e.GLOBAL_PREVIEW_CLICK="global:preview-click",e.GLOBAL_DOUBLE_CLICK="global:double-click",e.GLOBAL_SELECTED="global:selected",e.GLOBAL_HOVER="global:hover",e.GLOBAL_RESET="global:reset",e.GLOBAL_LINK_FIELD_JUMP="global:link-field-jump",e.GLOBAL_SCROLL="global:scroll"}(m||(m={}));var v=i("./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/common/interface/basic.js");class f extends l.rw{constructor(e,t){super(e),this.appendInfo=t}}function C(e,t=2){return(0,a.floor)(e,t)}function y(e){return(0,a.isNumber)(e)?C(e,0):e}var w=i("./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/utils/g-renders.js");const x=(e,t)=>t>0&&e<t,_=(e,t,i)=>t>0&&e>=i-t,S=(e,t,i)=>i>0&&e<t+i,b=(e,t,i)=>i>0&&e>=t+1-i,E=(e,t,i)=>{if(e){const[s,o]=e.getPosition();e.translate(t-s,i-o)}},L=(e=[])=>{const t=(e=>{const t=[],i=e=>{e.forEach(e=>{"string"!=typeof e&&e.children?i(e.children):t.push(e)})};return i(e),t})(e);return t.map(e=>"string"==typeof e?e:e.field)};class T extends l.YJ{constructor(e){super(),this.cfg=e,this.render()}layout(){this.addCornerBottomBorder(),this.addCornerRightBorder(),this.addSplitLineShadow()}render(){this.removeChildren(),this.layout()}static getHorizontalBorderWidth(e){var t;const{horizontalBorderWidth:i}=null===(t=e.theme)||void 0===t?void 0:t.splitLine;return i}static getVerticalBorderWidth(e){var t;const{splitLine:i,cornerCell:s,colCell:o,dataCell:n}=e.theme;return e.isPivotMode()?null==i?void 0:i.verticalBorderWidth:Math.max(n.cell.verticalBorderWidth,(null===(t=e.options.seriesNumber)||void 0===t?void 0:t.enable)?s.cell.verticalBorderWidth:o.cell.verticalBorderWidth)}onBorderScroll(e){if(e!==this.cfg.scrollX){this.cfg.scrollX=e;const{position:t}=this.cfg;E(this,t.x-e,0),this.render()}}onChangeShadowVisibility(e,t){const{colCount:i,trailingColCount:s}=this.cfg.spreadsheet.facet.getFrozenOptions(),o=0===i&&e>0,n=0===s&&C(e)<C(t);this.cfg.showViewportLeftShadow===o&&this.cfg.showViewportRightShadow===n||(this.cfg.showViewportLeftShadow=o,this.cfg.showViewportRightShadow=n,this.render())}getCornerRightBorderSizeForPivotMode(){var e;const{cornerHeight:t,viewportHeight:i,position:s,spreadsheet:o}=this.cfg,{horizontalBorderWidth:n}=null===(e=o.theme)||void 0===e?void 0:e.splitLine;return{y:s.y,height:t+n+i}}addCornerRightHeadBorder(){var e,t;const{cornerWidth:i,cornerHeight:s,position:o,spreadsheet:n}=this.cfg,{verticalBorderColor:r,verticalBorderColorOpacity:l}=null===(e=n.theme)||void 0===e?void 0:e.splitLine,a=T.getVerticalBorderWidth(n),d=T.getHorizontalBorderWidth(n),c=o.x+i+a/2,{verticalBorderColor:h,verticalBorderColorOpacity:u,backgroundColor:p,backgroundColorOpacity:g}=(null===(t=n.options.seriesNumber)||void 0===t?void 0:t.enable)||n.isPivotMode()?n.theme.cornerCell.cell:n.theme.colCell.cell;[{stroke:p,strokeOpacity:g},{stroke:r||h,strokeOpacity:l||u}].forEach(({stroke:e,strokeOpacity:t})=>{(0,w.ni)(this,{x1:c,y1:o.y,x2:c,y2:o.y+s+d,lineWidth:a,stroke:e,strokeOpacity:t})})}addCornerRightBorder(){var e;const{cornerWidth:t,cornerHeight:i,viewportHeight:s,position:o,spreadsheet:n}=this.cfg,{verticalBorderColor:r,verticalBorderColorOpacity:l}=null===(e=n.theme)||void 0===e?void 0:e.splitLine,a=T.getVerticalBorderWidth(n),d=T.getHorizontalBorderWidth(n),c=o.x+t+a/2;this.addCornerRightHeadBorder();const{verticalBorderColor:h,verticalBorderColorOpacity:u,backgroundColor:p,backgroundColorOpacity:g}=n.theme.dataCell.cell;[{stroke:p,strokeOpacity:g},{stroke:r||h,strokeOpacity:l||u}].forEach(({stroke:e,strokeOpacity:t})=>{(0,w.ni)(this,{x1:c,y1:o.y+i+d,x2:c,y2:o.y+i+d+s,lineWidth:a,stroke:e,strokeOpacity:t})})}addCornerBottomBorder(){var e,t;const i=this.cfg,{cornerWidth:s,cornerHeight:o,viewportWidth:n,position:r,scrollX:l=0,spreadsheet:a}=i,{horizontalBorderColor:d,horizontalBorderWidth:c,horizontalBorderColorOpacity:h}=null===(e=a.theme)||void 0===e?void 0:e.splitLine,{horizontalBorderColor:u,horizontalBorderColorOpacity:p}=(null===(t=a.options.seriesNumber)||void 0===t?void 0:t.enable)||a.isPivotMode()?a.theme.cornerCell.cell:a.theme.colCell.cell,g=r.x,m=g+s+T.getVerticalBorderWidth(a)+n+(a.isFrozenRowHeader()?0:l),v=r.y+o+c/2;this.cornerBottomBorder=(0,w.ni)(this,{x1:g,y1:v,x2:m,y2:v,stroke:d||u,lineWidth:c,opacity:h||p})}addSplitLineShadow(){var e;const t=this.cfg,{spreadsheet:i}=t,s=null===(e=i.theme)||void 0===e?void 0:e.splitLine;i.isPivotMode()&&(null==s?void 0:s.showShadow)&&i.isFrozenRowHeader()&&(this.addSplitLineLeftShadow(),this.addSplitLineRightShadow())}addSplitLineLeftShadow(){var e;if(!this.cfg.showViewportLeftShadow)return;const{cornerWidth:t,cornerHeight:i,viewportHeight:s,position:o,spreadsheet:n}=this.cfg,{shadowColors:r,shadowWidth:a,horizontalBorderWidth:d}=null===(e=n.theme)||void 0===e?void 0:e.splitLine,c=o.x+t+T.getVerticalBorderWidth(n);this.appendChild(new l.rw({style:{x:c,y:o.y,width:a,height:i+d+s,fill:`l (0) 0:${null==r?void 0:r.left} 1:${null==r?void 0:r.right}`}}))}addSplitLineRightShadow(){var e;if(!this.cfg.showViewportRightShadow)return;const{cornerWidth:t,viewportWidth:i,position:s,spreadsheet:o}=this.cfg,{shadowColors:n,shadowWidth:r}=null===(e=o.theme)||void 0===e?void 0:e.splitLine,a=s.x+t+T.getVerticalBorderWidth(o)+i-r,{y:d,height:c}=this.getCornerRightBorderSizeForPivotMode();this.appendChild(new l.rw({style:{x:a,y:d,width:r,height:c,fill:`l (0) 0:${null==n?void 0:n.right} 1:${null==n?void 0:n.left}`}}))}}var O,R=i("./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/utils/cell/cell.js");!function(e){e[e.Start=0]="Start",e[e.Center=1]="Center",e[e.End=2]="End"}(O||(O={}));const I=e=>["left","top"].includes(e)?O.Start:["center","middle"].includes(e)?O.Center:O.End,N=(e,t,i,s)=>{const{isCustomRenderer:o=!1}=s||{},{align:n,size:r,padding:l}=i,{textSize:a,iconStartSize:d=0,iconEndSize:c=0}=r;let{betweenTextAndEndIcon:h=0}=l;h=c?h:0;const u=a+d+c,p=t.start-l.start,g=p+(t.size+l.start+l.end),m=t.start+t.size,v=e.start+e.size;function f(e){switch(n){case O.Start:return{iconStart:e.start,textStart:e.start+d,iconEnd:e.start+d+a+h};case O.Center:const t=e.start+e.size/2-u/2;return{iconStart:t,textStart:t+d+(o?0:a/2),iconEnd:t+d+a+h};default:const i=e.start+e.size;return{iconStart:i-c-a-d,textStart:i-c-(o?a:0),iconEnd:i-c+h}}}if(p>=e.start&&g<=v)return f(t);if(p<e.start&&g<=v){const i={start:e.start+(n!==O.End?l.start:0),size:t.size-(e.start-t.start)-(n!==O.End?l.start:0)};return i.size<u&&(i.size=u,i.start=m-u),f(i)}if(p>=e.start&&g>v){const e={start:t.start,size:t.size-(m-v)-(n!==O.Start?l.end:0)};return e.size<u&&(e.size=u,e.start=t.start),f(e)}const C={start:e.start+l.start,size:e.size-l.start-l.end};if(C.size<u){const e=t.start+t.size/2-u/2;e>C.start||(e+u>C.start+C.size?C.start=e:C.start-=u-C.size),C.size=u}return f(C)};var B=i("./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/utils/g-utils.js"),A=i("./node_modules/.pnpm/tslib@2.8.1/node_modules/tslib/tslib.es6.mjs");const M=e=>e.includes("[&]")?"id":"field",D=(e,t=[])=>{const i=e.facet.getInitColIndexLeafNodes();return(0,a.compact)(t.map(e=>{const t=M(e);return i.find(i=>i[t]===e)}))},H=(e,...t)=>(0,A.sH)(void 0,[e,...t],void 0,function*(e,t=[],i=!1){const s=(...t)=>(0,A.sH)(void 0,[...t],void 0,function*(t=[],i=[]){e.setOptions({interaction:{hiddenColumnFields:t}}),e.interaction.reset(),e.store.set("hiddenColumnsDetail",i),yield e.render({reloadData:!1,rebuildHiddenColumnsDetail:!1})});if((0,a.isEmpty)(t)&&i)return void(yield s());const o=e.store.get("hiddenColumnsDetail",[]),{hiddenColumnFields:n=[]}=e.options.interaction;if((0,a.isEqual)(t,n)&&!i)return;const r=(0,a.uniq)([...t,...n]),l=D(e,r).every((e,t,i)=>{const s=i[t+1];return!s||1===Math.abs(e.colIndex-s.colIndex)}),d=((e,t=[])=>{if((0,a.isEmpty)(t))return{prev:null,next:null};const i=e.facet.getInitColIndexLeafNodes(),s=D(e,t).map(e=>i.findIndex(t=>t.id===e.id)),o=Math.max(...s),n=Math.min(...s),r=i.find((e,t)=>t===o+1);return{prev:i.find((e,t)=>t===n-1)||null,next:r||null}})(e,l?r:t),c={hideColumnNodes:D(e,t),displaySiblingNode:d},h=((e,t)=>t.findIndex(t=>e.hideColumnNodes.some(e=>{var i;return null===(i=t.hideColumnNodes)||void 0===i?void 0:i.find(t=>t.id===e.id)})))(c,o);let u=[];u=-1!==h?o.map((e,t)=>t===h?c:e):[...o,c],e.emit(m.COL_CELL_HIDDEN,c,u),yield s(r,u)}),k=(e,...t)=>(0,A.sH)(void 0,[e,...t],void 0,function*(e,t=[],i=!1){(0,a.isEmpty)(t)&&i&&(yield H(e,t,!0));const s=(e=>{const{columns:t=[]}=e.dataCfg.fields;return e.isTableMode()&&!e.isCustomColumnFields()?t:e.facet.getInitColIndexLeafNodes().map(({id:e})=>e)})(e),o=((e,t)=>{if((0,a.isEmpty)(t))return[];let i=Number.NEGATIVE_INFINITY;return e.reduce((e,s,o)=>{if(!t.includes(s))return e;if(o===i+1){const t=(0,a.last)(e);null==t||t.push(s)}else e.push([s]);return i=o,e},[])})(L(s),t);yield Promise.all(o.map(t=>(0,A.sH)(void 0,void 0,void 0,function*(){yield H(e,t,i)})))}),z=(e,t,i)=>((e,t)=>{const i=((e,t)=>t?null==e?void 0:e[t]:(null==e?void 0:e.next)||(null==e?void 0:e.prev))(e,t);return null==i?void 0:i.id})(e,i)===t,F=(e,t,i)=>{var s;const o=[],n=(null===(s=e.options.interaction)||void 0===s?void 0:s.hiddenColumnFields)||[],r=D(e,n),l=new Map(r.map(e=>[e.id,e])),d=e.facet.getInitColIndexLeafNodes(),c="prev"===i?1:-1;for(let e=d.findIndex(e=>e.id===t)+c;e<d.length;e+=c){const t=d[e];if(!t)break;if(!l.has(null==t?void 0:t.id))break;o.push(t)}return(0,a.sortBy)(o,"colIndex")},P=e=>{const{type:t,theme:i,width:s,height:o}=e,n=(0,A.Tt)(e,["type","theme","width","height"]);return{style:{fill:i.background,fillOpacity:i.backgroundOpacity,cursor:`${t}-resize`,width:t===u.Horizontal?i.size:void 0,height:t===u.Vertical?i.size:void 0},appendInfo:Object.assign(Object.assign({},n),{isResizeArea:!0,type:t,width:s,height:o,size:i.size})}},j=(e,t)=>{var i;if(!(null===(i=e.facet)||void 0===i?void 0:i.foregroundGroup))return;return e.facet.foregroundGroup.getElementById(t)||e.facet.foregroundGroup.appendChild(new l.YJ({id:t,style:{zIndex:5}}))},W=(e,t,i)=>{const{scrollX:s=0,scrollY:o=0}=null!=i?i:{};return!(e.x-s>t.x+t.width||e.x+e.width-s<t.x)&&!(e.y-o>t.y+t.height||e.y+e.height-o<t.y)},G="valueRanges",V={},$="#000000",U="#FFFFFF";var Y;!function(e){e.VIDEO="VIDEO",e.IMAGE="IMAGE"}(Y||(Y={}));const X="videoRect",Z=new Error("Failed to load image and fallback");function q(e){const{src:t,fallback:i,timeout:s=1e4,mediaCache:o,crossOrigin:n="Anonymous",referrerPolicy:r,cacheKeyPrefix:l}=e,a=l?`${l}:${t}`:t;return new Promise((e,d)=>{if(null==o?void 0:o.has(a)){const t=o.get(a);if(t instanceof HTMLImageElement)return void e(t);if(null===t)return void d(Z)}const c=t=>{null==o||o.set(a,t),e(t)},h=e=>{null==o||o.set(a,null),d(e)},u=()=>{i?q({src:i,timeout:s,mediaCache:o}).then(c).catch(h):h(Z)},p=()=>{n?q({src:t,timeout:s,mediaCache:o,crossOrigin:null,referrerPolicy:"no-referrer",cacheKeyPrefix:l}).then(c).catch(u):u()},g=new Image;n&&(g.crossOrigin=n),r&&(g.referrerPolicy=r),g.src=t;const m=setTimeout(p,s);g.onload=()=>{clearTimeout(m),c(g)},g.onerror=()=>{clearTimeout(m),p()},g.onabort=()=>{clearTimeout(m),p()}})}function K(e,t,i,s){if(e<=0||t<=0)return{width:0,height:0};if(i<=0||s<=0)return{width:e,height:t};const o=Math.min(e/i,t/s);return{width:Math.floor(i*o),height:Math.floor(s*o)}}function J(e){return(0,A.sH)(this,arguments,void 0,function*(e,t=""){try{e&&(t=(yield e(t))||t)}catch(e){console.warn("fail to prepareText",e)}return t})}var Q=i("./node_modules/.pnpm/flru@1.0.2/node_modules/flru/dist/flru.mjs");class ee{static getCacheKey(e,t){return`${e}:${t}`}getLoading(e){var t;const{x:i,y:s,height:o,width:n}=this.getCellInfo(e),r=.25*Math.min(o,n),a=i+n/2,d=s+o/2,c=new l.wA({style:{d:`M${a} ${d-r}\n A${r} ${r} 0 0 1 ${a+r} ${d}`,stroke:null===(t=e.getIconStyle())||void 0===t?void 0:t.fill,transformOrigin:`${a} ${d}`}});return e.appendChild(c),setTimeout(()=>{c.animate([{transform:"rotate(0)"},{transform:"rotate(360deg)"}],{duration:1e3,iterations:1/0})}),c}process(e,t){return(0,A.sH)(this,void 0,void 0,function*(){const i=this.getLoading(t),s=yield this.prepare(e,t),o=this.generateConfig(e,t,s);t.removeChild(i),i.destroy(),this.render(t,o)})}destroy(){}getCellInfo(e){var t;const i=e.getFieldValue(),s=null!==(t=null==i?void 0:i.toString())&&void 0!==t?t:"";return Object.assign({text:s},e.getBBoxByType(v.Ok.CONTENT_BOX))}prepareText(e,t){const{text:i}=this.getCellInfo(t);return J(e.prepareText,i)}}ee.mediaCache=(0,Q.A)(200);class te extends ee{prepare(e,t){return(0,A.sH)(this,void 0,void 0,function*(){return q({src:yield this.prepareText(e,t),fallback:e.fallback,timeout:e.timeout,mediaCache:ee.mediaCache,cacheKeyPrefix:"image"})})}generateConfig(e,t,i){const{y:s,height:o,width:n}=t.getBBoxByType(v.Ok.CONTENT_BOX),{width:r,height:l}=K(n,o,i.naturalWidth,i.naturalHeight),{x:a}=t.getContentPosition({contentWidth:r});return{style:Object.assign({x:a,y:s,src:i,width:r,height:l},e.config)}}render(e,t){e.appendChild(new l._V(t))}destroy(){}}var ie=i("./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/common/icons/gui-icon.js");const se={loop:!0,autoplay:!1,preload:"auto",crossOrigin:!0,controls:!1,muted:!0};class oe extends ee{constructor(){super(...arguments),this.fallback=""}prepare(e,t){return(0,A.sH)(this,void 0,void 0,function*(){const i=yield this.prepareText(e,t);return new Promise(s=>{const{height:o,width:n}=this.getCellInfo(t),{timeout:r=1e4,fallback:l=""}=e;this.fallback=l;const a=ee.getCacheKey("video",i);if(ee.mediaCache.has(a)){const e=ee.mediaCache.get(a);if(e instanceof HTMLVideoElement||e instanceof HTMLImageElement)return void s(e);if(null===e)return void s(l)}const d=document.createElement("video"),c=()=>(0,A.sH)(this,void 0,void 0,function*(){if(l){const e=yield q({src:l,fallback:"",timeout:5e3,mediaCache:ee.mediaCache}).catch(()=>null);if(e)return ee.mediaCache.set(a,e),void s(e)}ee.mediaCache.set(a,null),s(l)}),h=setTimeout(c,r),u=Object.assign(Object.assign({height:o,width:n,src:i},se),e.videoConfig);Object.assign(d,u),d.onloadeddata=()=>{clearTimeout(h),u.autoplay||(d.pause(),d.currentTime=.001),ee.mediaCache.set(a,d),s(d)};const p=()=>{clearTimeout(h),c()};["error","abort","stalled"].forEach(e=>{d.addEventListener(e,p)})})})}generateConfig(e,t,i){const{y:s,height:o}=t.getBBoxByType(v.Ok.CONTENT_BOX),n=Math.max(t.getMaxTextWidth(),0);let r=n,l=o,a="transparent";if(i instanceof HTMLVideoElement||i instanceof HTMLImageElement){const{width:e,height:t}=(d=i)instanceof HTMLVideoElement?{width:d.videoWidth,height:d.videoHeight}:{width:d.naturalWidth,height:d.naturalHeight},{width:s,height:c}=K(n,o,e,t);r=s,l=c,a={image:i,repetition:"no-repeat",transform:`scale(${s/e}, ${c/t})`}}else a="transparent";var d;const{x:c}=t.getContentPosition({contentWidth:r});return{style:Object.assign({x:c,y:s+(o-l)/2,width:r,height:l,fill:a},e.config),isFallback:i instanceof HTMLImageElement}}render(e,t){if(t.isFallback)return void e.appendChild(new l._V((0,a.merge)({},t,{style:{src:this.fallback}})));const i=new l.rw(Object.assign(Object.assign({},t),{name:X})),{x:s,y:o,width:n,height:r}=t.style,d=.25*Math.min(n,r);i.appendChild(new ie.r({name:"Play",width:d,height:d,x:s+n/2-d/2,y:o+r/2-d/2,pointerEvents:"none",cursor:"pointer"})),e.appendChild(i)}}class ne{static getInstance(e){if(!ne.instances.has(e)){let t;switch(e){case Y.IMAGE:t=new te;break;case Y.VIDEO:t=new oe;break;default:t=null}t&&ne.instances.set(e,t)}return ne.instances.get(e)}static render(e,t){return ne.getInstance(e.type).process(e,t)}}ne.instances=new Map;var re=i("./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/utils/cell/header-cell.js"),le=i("./node_modules/.pnpm/tinycolor2@1.6.0/node_modules/tinycolor2/esm/tinycolor.js");const ae=[95,85,75,30,15,0,15,30,45,60,80],de=e=>(0,le.A)(e).getLuminance()<=.5,ce=[{fontColorIndex:0,bgColorIndex:3},{fontColorIndex:13,bgColorIndex:8},{fontColorIndex:14,bgColorIndex:1}],he=(e={})=>{const t=Array.from(Array(15)).fill(U),{basicColorRelations:i=[],brandColor:s}=e,o=(e=>{const t=[];for(let i=0;i<11;i++){const s=ae[i];t.push((0,a.toUpper)(0===s?e:le.A.mix(e,i<5?"#FFFFFF":"#000000",s).toHexString()))}return t})(s);return i.forEach(e=>{t[e.basicColorIndex]=o[e.standardColorIndex]}),ce.forEach(({fontColorIndex:e,bgColorIndex:i})=>{t[e]=de(t[i])?U:$}),Object.assign(Object.assign({},e),{basicColors:t})};var ue=i("./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/utils/condition/condition.js");var pe;!function(e){e.PC="pc",e.MOBILE="mobile"}(pe||(pe={}));var ge=i("./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/utils/ssr.js");function me(e){return e===pe.MOBILE||!((0,ge.fU)()||!(0,ge.w9)())&&/(?:iPhone|iPad|SymbianOS|Windows Phone|iPod|iOS|Android|Mobile|Phone|Tablet)/i.test(navigator.userAgent)}function ve(){return!(0,ge.fU)()&&/windows/i.test(navigator.userAgent)}var fe=i("./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/utils/text.js");class Ce extends l.YJ{get actualText(){return this.getMultiLineActualTexts().join("")}constructor(e,t,...i){super({}),this.textShapes=[],this.conditionIconShapes=[],this.stateShapes=new Map,this.borders=new Map,this.meta=e,this.spreadsheet=t,this.theme=t.theme,this.conditions=this.spreadsheet.options.conditions,this.groupedIcons={left:[],right:[]},this.handleRestOptions(...i),this.shouldInit()&&this.initCell()}handleRestOptions(...e){}getResizedTextMaxLines(){}getMeta(){return this.meta}setMeta(e){this.meta=e}getIconStyle(){var e;return null===(e=this.theme[this.cellType])||void 0===e?void 0:e.icon}isShallowRender(){return!1}getCellTextWordWrapStyle(e){var t,i;const{wordWrap:s,maxLines:o,textOverflow:n}=(null===(i=null===(t=this.spreadsheet.options)||void 0===t?void 0:t.style)||void 0===i?void 0:i[e||this.cellType])||{};return{wordWrap:s,maxLines:o,textOverflow:n}}getActualText(){return this.getMultiLineActualTexts().join("")}getActualTextWidth(){var e;return(null===(e=this.textShape)||void 0===e?void 0:e.getComputedTextLength())||0}getActualTextHeight(){return this.getMultiLineActualTextHeight()}getMultiLineActualTexts(){var e,t,i;return null===(e=this.textShape)||void 0===e||e.getGeometryBounds(),(null===(i=null===(t=this.textShape)||void 0===t?void 0:t.parsedStyle.metrics)||void 0===i?void 0:i.lines)||[]}getMultiLineActualTextWidth(){return(0,a.sumBy)(this.getTextLineBoundingRects(),"width")||0}getMultiLineActualTextHeight(){return(0,a.sumBy)(this.getTextLineBoundingRects(),"height")||0}getOriginalText(){return this.originalText}isTextOverflowing(){var e;return null===(e=this.textShape)||void 0===e?void 0:e.isOverflowing()}isMultiLineText(){const{parsedStyle:e}=this.getTextShape();return(null==e?void 0:e.maxLines)>1&&this.getTextLineBoundingRects().length>1}getTextLineBoundingRects(){var e;return(null===(e=this.textShape)||void 0===e?void 0:e.getLineBoundingRects())||[]}getTextLineHeight(){var e,t,i;return(null===(i=null===(t=null===(e=this.textShape)||void 0===e?void 0:e.parsedStyle)||void 0===t?void 0:t.metrics)||void 0===i?void 0:i.lineHeight)||16}getEmptyPlaceholder(){const{options:{placeholder:e}}=this.spreadsheet;return(0,fe.Lv)(this,e)}getFieldValue(){return this.getFormattedFieldValue().formattedValue}shouldInit(){const{width:e,height:t}=this.meta;return e>0&&t>0}getStyle(e){return(0,a.get)(this.theme,e||this.cellType)}getLinkFieldShape(){return this.linkFieldShape}getBackgroundShape(){return this.backgroundShape}getStateShapes(){return this.stateShapes}getResizeAreaStyle(){return this.getStyle("resizeArea")}shouldDrawResizeAreaByType(e,t){const{resize:i}=this.spreadsheet.options.interaction;return(0,a.isBoolean)(i)?i:(0,a.isFunction)(null==i?void 0:i.visible)?null==i?void 0:i.visible(t):null==i?void 0:i[e]}getBBoxByType(e=v.Ok.BORDER_BOX){const t={x:this.meta.x,y:this.meta.y,height:this.meta.height,width:this.meta.width},i=this.getStyle()||this.theme.dataCell;return(0,R.f9)(t,this.getBorderPositions(),null==i?void 0:i.cell,e)}drawBorders(){this.getBorderPositions().forEach(e=>{var t;const{position:i,style:s}=(0,R.qi)(e,this.getBBoxByType(),null===(t=this.getStyle())||void 0===t?void 0:t.cell),o=Object.assign(Object.assign({},i),s);this.borders.has(e)?(0,B.w)(this.borders.get(e),o):this.borders.set(e,(0,w.ni)(this,o))})}drawInteractiveBorderShape(){const e=Object.assign(Object.assign({},this.getBBoxByType(v.Ok.PADDING_BOX)),{visibility:"hidden",pointerEvents:"none"}),t=this.stateShapes.get("interactiveBorderShape");t?(0,B.w)(t,e):this.stateShapes.set("interactiveBorderShape",(0,w.P2)(this,e))}drawInteractiveBgShape(){const e=Object.assign(Object.assign({},this.getBBoxByType()),{visibility:"hidden",pointerEvents:"none"}),t=this.stateShapes.get("interactiveBgShape");t?(0,B.w)(t,e):this.stateShapes.set("interactiveBgShape",(0,w.P2)(this,e))}drawBackgroundShape(){const{backgroundColor:e,backgroundColorOpacity:t}=this.getBackgroundColor(),i=Object.assign(Object.assign({},this.getBBoxByType()),{fill:e,fillOpacity:t});this.backgroundShape?(0,B.w)(this.backgroundShape,i):this.backgroundShape=(0,w.P2)(this,i)}renderTextShape(e,t){const i=(0,fe.Kg)(e.text,this.getEmptyPlaceholder()),s=(null==t?void 0:t.shallowRender)||this.isShallowRender();return this.textShape&&!s?(0,B.w)(this.textShape,Object.assign(Object.assign({},e),{text:`${i}`})):this.textShape=(0,w.S5)({group:this,textShape:s?void 0:this.textShape,style:Object.assign(Object.assign({},e),{text:`${i}`})}),this.addTextShape(this.textShape),s||(this.originalText=i),this.textShape}updateTextPosition(e){var t,i,s,o;const n=this.getTextPosition();null===(t=this.textShape)||void 0===t||t.attr("x",null!==(i=null==e?void 0:e.x)&&void 0!==i?i:null==n?void 0:n.x),null===(s=this.textShape)||void 0===s||s.attr("y",null!==(o=null==e?void 0:e.y)&&void 0!==o?o:null==n?void 0:n.y)}drawTextOrCustomRenderer(){const e=this.getRenderer();e?ne.render(e,this).then(()=>{this.afterDrawText()}):(this.drawTextShape(),this.afterDrawText())}drawTextShape(){const e=Math.max(this.getMaxTextWidth(),0)+1,t=this.getTextStyle(),i=this.getResizedTextMaxLines()||(null==t?void 0:t.maxLines),s=this.getFieldValue();this.renderTextShape(Object.assign(Object.assign({},t),{x:0,y:0,text:s,wordWrapWidth:e,maxLines:i})),this.isShallowRender()||(this.updateTextPosition(),this.drawLinkField(this.meta))}drawLinkFieldShape(e,t){if(!e)return;const{device:i}=this.spreadsheet.options;if(!me(i)){const e=this.getTextStyle(),i=this.getTextPosition(),s=this.getActualTextWidth();let o=i.x;"center"===e.textAlign?o-=s/2:"right"===e.textAlign&&(o-=s);const{bottom:n}=this.textShape.getBBox(),r={x1:o,y1:n+1,x2:o+s,y2:n+1,stroke:t,lineWidth:1};this.linkFieldShape?(0,B.w)(this.linkFieldShape,r):this.linkFieldShape=(0,w.ni)(this,r)}this.textShape.style.fill=t,this.textShape.style.cursor="pointer",this.textShape.appendInfo={isLinkFieldText:!0,meta:this.meta}}getLinkFieldStyle(){return this.getTextStyle().linkTextFill}drawLinkField(e){const{linkFields:t=[]}=this.spreadsheet.options.interaction,i=this.getLinkFieldStyle(),s=((e,t)=>(0,a.isFunction)(e)?e(t):e.some(e=>e===t.field||e===t.id||e===t.valueField))(t,e);this.drawLinkFieldShape(s,i)}updateByState(e,t){this.spreadsheet.interaction.setInteractedCells(t);const i=(0,a.get)(this.theme,`${this.cellType}.cell.interactionState.${e}`);(0,a.each)(i,(e,t)=>{(0,a.keys)((0,a.pickBy)(d.Ep,e=>(0,a.includes)(e,t))).forEach(i=>{const s=this.stateShapes.has(i),o=s?this.stateShapes.get(i):this[i],n=(0,a.isArray)(o)?o:[o];if(s&&n.forEach(e=>{e.setAttribute("visibility","visible")}),"interactiveBorderShape"===i&&"borderWidth"===t&&(0,a.isNumber)(e)){const t=this.getInteractiveBorderShapeStyle(e);(0,a.each)(t,(e,t)=>{(0,w.O3)(n,t,e)})}(0,w.O3)(n,d.lE[t],e)})})}getInteractiveBorderShapeStyle(e){const{x:t,y:i,height:s,width:o}=this.getBBoxByType(v.Ok.PADDING_BOX),n=e/2;return{x:t+n,y:i+n,width:o-e,height:s-e}}hideInteractionShape(){this.stateShapes.forEach(e=>{(0,w.O3)(e,d.lE.backgroundOpacity,0),(0,w.O3)(e,d.lE.backgroundColor,"transparent"),(0,w.O3)(e,d.lE.borderOpacity,0),(0,w.O3)(e,d.lE.borderWidth,1),(0,w.O3)(e,d.lE.borderColor,"transparent")})}clearUnselectedState(){(0,w.O3)(this.backgroundShape,d.lE.backgroundOpacity,1),(0,w.O3)(this.textShapes,d.lE.textOpacity,1),(0,w.O3)(this.linkFieldShape,d.lE.opacity,1)}getTextShape(){return this.textShape}getTextShapes(){return this.textShapes||[this.textShape]}addTextShape(e){e&&this.textShapes.push(e)}getConditionIconShape(){return this.conditionIconShape}getConditionIconShapes(){return this.conditionIconShapes||[this.conditionIconShape]}addConditionIconShape(e){e&&this.conditionIconShapes.push(e)}resetTextAndConditionIconShapes(){this.textShapes=[],this.conditionIconShapes=[]}get cellConditions(){return this.conditions}drawConditionIconShapes(){var e;const t=this.getIconConditionResult();if(t){const i=this.getIconPosition(),{size:s}=this.getStyle().icon,o=Object.assign(Object.assign({},i),{name:null==t?void 0:t.name,width:s,height:s,fill:null==t?void 0:t.fill,iconStrategy:null===(e=this.spreadsheet.options.csp)||void 0===e?void 0:e.iconStrategy});this.conditionIconShape?this.conditionIconShape.reRender(o):this.conditionIconShape=(0,w.sH)(this,o),this.addConditionIconShape(this.conditionIconShape)}}getTextConditionMappingResult(){var e;const t=this.findFieldCondition(null===(e=this.conditions)||void 0===e?void 0:e.text);return(null==t?void 0:t.mapping)?this.mappingValue(t):null}getContainConditionMappingResultTextStyle(e){const t=this.getDefaultTextFill(e.fill),i=this.getTextConditionMappingResult();return Object.assign(Object.assign(Object.assign({},e),i),{fill:(null==i?void 0:i.fill)||t})}getDefaultTextFill(e){const{backgroundColor:t,intelligentReverseTextColor:i}=this.getBackgroundColor();return!de(t)||e!==$&&((e,t)=>le.A.isReadable(e,t,{level:"AA",size:"small"}))(t,e)||!i||(e=U),e||""}getBackgroundConditionFill(){var e;const t=this.findFieldCondition(null===(e=this.conditions)||void 0===e?void 0:e.background);if(null==t?void 0:t.mapping){const e=this.mappingValue(t);if(e)return{backgroundColor:e.fill,backgroundColorOpacity:1,intelligentReverseTextColor:e.intelligentReverseTextColor||!1}}return{intelligentReverseTextColor:!1}}getIconConditionResult(){var e;const t=this.findFieldCondition(null===(e=this.conditions)||void 0===e?void 0:e.icon);if(null==t?void 0:t.mapping){const e=this.mappingValue(t);if(e&&e.icon)return{name:e.icon,position:(0,ue.dq)(t),fill:e.fill,isConditionIcon:!0}}}getActionAndConditionIconWidth(e){const{left:t,right:i}=this.groupedIcons,s=this.getStyle().icon;return e?(0,re.kZ)(this.groupedIcons[e],s):(0,re.kZ)(t,s)+(0,re.kZ)(i,s)}getCrossBackgroundColor(e){const{crossBackgroundColor:t,backgroundColorOpacity:i}=this.getStyle().cell;return t&&e%2==0?{backgroundColorOpacity:i,backgroundColor:t}:{backgroundColorOpacity:i,backgroundColor:this.getStyle().cell.backgroundColor}}getMaxLinesByCustomHeight(e){var t;const{targetCell:i=this,displayHeight:s=this.meta.height,isCustomHeight:o=!1}=e,n=i||this,r=null===(t=this.spreadsheet.options.style)||void 0===t?void 0:t[n.cellType];if(!((null==r?void 0:r.maxLines)>1&&(null==r?void 0:r.wordWrap))||!o)return;const{cell:l}=null==n?void 0:n.getStyle(),a=l.padding.top+l.padding.bottom,d=null==n?void 0:n.getTextLineHeight();return Math.max(1,Math.round((s-a)/d))}getRenderer(){var e,t;return null===(t=null===(e=this.spreadsheet.dataCfg.meta)||void 0===e?void 0:e.find(e=>e.field===this.getMetaField()))||void 0===t?void 0:t.renderer}getConditionIntervalShape(){return this.conditionIntervalShape}}var ye=i("./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/common/constant/field.js");const we=(e,t)=>{const i=t.getMeta().id;return e.some(e=>(0,a.isEqual)(e.id,i))},xe=(e,t)=>`${e}-${t}`,_e=e=>e.type===d.vZ.DATA_CELL,Se=(e,t,i)=>{var s;const{rowHeader:o,colHeader:n,currentRow:r,currentCol:l}=i.interaction.getSelectedCellHighlight(),c=t.cellType===d.vZ.ROW_CELL,h=i.isTableMode()&&(null===(s=i.options.seriesNumber)||void 0===s?void 0:s.enable)&&o&&c;(r||h)&&((e,t)=>{(0,a.forEach)(e,e=>{_e(e)&&e.rowIndex===t.getMeta().rowIndex&&t.updateByState(d.xT.SELECTED)})})(e,t),l&&((e,t)=>{(0,a.forEach)(e,e=>{_e(e)&&e.colIndex===t.getMeta().colIndex&&t.updateByState(d.xT.SELECTED)})})(e,t),(o||n)&&((e,t)=>{(0,a.forEach)(e,e=>{_e(e)&&e.rowIndex===t.getMeta().rowIndex&&e.colIndex===t.getMeta().colIndex&&t.updateByState(d.xT.SELECTED)})})(e,t)};var be=i("./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/common/constant/query.js");const Ee=(e=[])=>e.filter(e=>e!==ye.jI&&e!==ye.IW);var Le,Te,Oe=i("./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/utils/dataset/pivot-data-set.js"),Re=9e15,Ie=1e9,Ne="0123456789abcdef",Be="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",Ae="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",Me={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-Re,maxE:Re,crypto:!1},De=!0,He="[DecimalError] ",ke=He+"Invalid argument: ",ze=He+"Precision limit exceeded",Fe=He+"crypto unavailable",Pe="[object Decimal]",je=Math.floor,We=Math.pow,Ge=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,Ve=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,$e=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,Ue=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Ye=1e7,Xe=Be.length-1,Ze=Ae.length-1,qe={toStringTag:Pe};function Ke(e){var t,i,s,o=e.length-1,n="",r=e[0];if(o>0){for(n+=r,t=1;t<o;t++)(i=7-(s=e[t]+"").length)&&(n+=at(i)),n+=s;(i=7-(s=(r=e[t])+"").length)&&(n+=at(i))}else if(0===r)return"0";for(;r%10==0;)r/=10;return n+r}function Je(e,t,i){if(e!==~~e||e<t||e>i)throw Error(ke+e)}function Qe(e,t,i,s){var o,n,r,l;for(n=e[0];n>=10;n/=10)--t;return--t<0?(t+=7,o=0):(o=Math.ceil((t+1)/7),t%=7),n=We(10,7-t),l=e[o]%n|0,null==s?t<3?(0==t?l=l/100|0:1==t&&(l=l/10|0),r=i<4&&99999==l||i>3&&49999==l||5e4==l||0==l):r=(i<4&&l+1==n||i>3&&l+1==n/2)&&(e[o+1]/n/100|0)==We(10,t-2)-1||(l==n/2||0==l)&&!(e[o+1]/n/100|0):t<4?(0==t?l=l/1e3|0:1==t?l=l/100|0:2==t&&(l=l/10|0),r=(s||i<4)&&9999==l||!s&&i>3&&4999==l):r=((s||i<4)&&l+1==n||!s&&i>3&&l+1==n/2)&&(e[o+1]/n/1e3|0)==We(10,t-3)-1,r}function et(e,t,i){for(var s,o,n=[0],r=0,l=e.length;r<l;){for(o=n.length;o--;)n[o]*=t;for(n[0]+=Ne.indexOf(e.charAt(r++)),s=0;s<n.length;s++)n[s]>i-1&&(void 0===n[s+1]&&(n[s+1]=0),n[s+1]+=n[s]/i|0,n[s]%=i)}return n.reverse()}qe.absoluteValue=qe.abs=function(){var e=new this.constructor(this);return e.s<0&&(e.s=1),it(e)},qe.ceil=function(){return it(new this.constructor(this),this.e+1,2)},qe.clampedTo=qe.clamp=function(e,t){var i=this,s=i.constructor;if(e=new s(e),t=new s(t),!e.s||!t.s)return new s(NaN);if(e.gt(t))throw Error(ke+t);return i.cmp(e)<0?e:i.cmp(t)>0?t:new s(i)},qe.comparedTo=qe.cmp=function(e){var t,i,s,o,n=this,r=n.d,l=(e=new n.constructor(e)).d,a=n.s,d=e.s;if(!r||!l)return a&&d?a!==d?a:r===l?0:!r^a<0?1:-1:NaN;if(!r[0]||!l[0])return r[0]?a:l[0]?-d:0;if(a!==d)return a;if(n.e!==e.e)return n.e>e.e^a<0?1:-1;for(t=0,i=(s=r.length)<(o=l.length)?s:o;t<i;++t)if(r[t]!==l[t])return r[t]>l[t]^a<0?1:-1;return s===o?0:s>o^a<0?1:-1},qe.cosine=qe.cos=function(){var e,t,i=this,s=i.constructor;return i.d?i.d[0]?(t=s.rounding,s.precision=(e=s.precision)+Math.max(i.e,i.sd())+7,s.rounding=1,i=function(e,t){var i,s,o;if(t.isZero())return t;s=t.d.length,s<32?o=(1/Ct(4,i=Math.ceil(s/3))).toString():(i=16,o="2.3283064365386962890625e-10");e.precision+=i,t=ft(e,1,t.times(o),new e(1));for(var n=i;n--;){var r=t.times(t);t=r.times(r).minus(r).times(8).plus(1)}return e.precision-=i,t}(s,yt(s,i)),s.precision=e,s.rounding=t,it(2==Te||3==Te?i.neg():i,e,t,!0)):new s(1):new s(NaN)},qe.cubeRoot=qe.cbrt=function(){var e,t,i,s,o,n,r,l,a,d,c=this,h=c.constructor;if(!c.isFinite()||c.isZero())return new h(c);for(De=!1,(n=c.s*We(c.s*c,1/3))&&Math.abs(n)!=1/0?s=new h(n.toString()):(i=Ke(c.d),(n=((e=c.e)-i.length+1)%3)&&(i+=1==n||-2==n?"0":"00"),n=We(i,1/3),e=je((e+1)/3)-(e%3==(e<0?-1:2)),(s=new h(i=n==1/0?"5e"+e:(i=n.toExponential()).slice(0,i.indexOf("e")+1)+e)).s=c.s),r=(e=h.precision)+3;;)if(d=(a=(l=s).times(l).times(l)).plus(c),s=tt(d.plus(c).times(l),d.plus(a),r+2,1),Ke(l.d).slice(0,r)===(i=Ke(s.d)).slice(0,r)){if("9999"!=(i=i.slice(r-3,r+1))&&(o||"4999"!=i)){+i&&(+i.slice(1)||"5"!=i.charAt(0))||(it(s,e+1,1),t=!s.times(s).times(s).eq(c));break}if(!o&&(it(l,e+1,0),l.times(l).times(l).eq(c))){s=l;break}r+=4,o=1}return De=!0,it(s,e,h.rounding,t)},qe.decimalPlaces=qe.dp=function(){var e,t=this.d,i=NaN;if(t){if(i=7*((e=t.length-1)-je(this.e/7)),e=t[e])for(;e%10==0;e/=10)i--;i<0&&(i=0)}return i},qe.dividedBy=qe.div=function(e){return tt(this,new this.constructor(e))},qe.dividedToIntegerBy=qe.divToInt=function(e){var t=this.constructor;return it(tt(this,new t(e),0,1,1),t.precision,t.rounding)},qe.equals=qe.eq=function(e){return 0===this.cmp(e)},qe.floor=function(){return it(new this.constructor(this),this.e+1,3)},qe.greaterThan=qe.gt=function(e){return this.cmp(e)>0},qe.greaterThanOrEqualTo=qe.gte=function(e){var t=this.cmp(e);return 1==t||0===t},qe.hyperbolicCosine=qe.cosh=function(){var e,t,i,s,o,n=this,r=n.constructor,l=new r(1);if(!n.isFinite())return new r(n.s?1/0:NaN);if(n.isZero())return l;s=r.rounding,r.precision=(i=r.precision)+Math.max(n.e,n.sd())+4,r.rounding=1,(o=n.d.length)<32?t=(1/Ct(4,e=Math.ceil(o/3))).toString():(e=16,t="2.3283064365386962890625e-10"),n=ft(r,1,n.times(t),new r(1),!0);for(var a,d=e,c=new r(8);d--;)a=n.times(n),n=l.minus(a.times(c.minus(a.times(c))));return it(n,r.precision=i,r.rounding=s,!0)},qe.hyperbolicSine=qe.sinh=function(){var e,t,i,s,o=this,n=o.constructor;if(!o.isFinite()||o.isZero())return new n(o);if(i=n.rounding,n.precision=(t=n.precision)+Math.max(o.e,o.sd())+4,n.rounding=1,(s=o.d.length)<3)o=ft(n,2,o,o,!0);else{e=1.4*Math.sqrt(s),o=ft(n,2,o=o.times(1/Ct(5,e=e>16?16:0|e)),o,!0);for(var r,l=new n(5),a=new n(16),d=new n(20);e--;)r=o.times(o),o=o.times(l.plus(r.times(a.times(r).plus(d))))}return n.precision=t,n.rounding=i,it(o,t,i,!0)},qe.hyperbolicTangent=qe.tanh=function(){var e,t,i=this,s=i.constructor;return i.isFinite()?i.isZero()?new s(i):(t=s.rounding,s.precision=(e=s.precision)+7,s.rounding=1,tt(i.sinh(),i.cosh(),s.precision=e,s.rounding=t)):new s(i.s)},qe.inverseCosine=qe.acos=function(){var e=this,t=e.constructor,i=e.abs().cmp(1),s=t.precision,o=t.rounding;return-1!==i?0===i?e.isNeg()?rt(t,s,o):new t(0):new t(NaN):e.isZero()?rt(t,s+4,o).times(.5):(t.precision=s+6,t.rounding=1,e=new t(1).minus(e).div(e.plus(1)).sqrt().atan(),t.precision=s,t.rounding=o,e.times(2))},qe.inverseHyperbolicCosine=qe.acosh=function(){var e,t,i=this,s=i.constructor;return i.lte(1)?new s(i.eq(1)?0:NaN):i.isFinite()?(t=s.rounding,s.precision=(e=s.precision)+Math.max(Math.abs(i.e),i.sd())+4,s.rounding=1,De=!1,i=i.times(i).minus(1).sqrt().plus(i),De=!0,s.precision=e,s.rounding=t,i.ln()):new s(i)},qe.inverseHyperbolicSine=qe.asinh=function(){var e,t,i=this,s=i.constructor;return!i.isFinite()||i.isZero()?new s(i):(t=s.rounding,s.precision=(e=s.precision)+2*Math.max(Math.abs(i.e),i.sd())+6,s.rounding=1,De=!1,i=i.times(i).plus(1).sqrt().plus(i),De=!0,s.precision=e,s.rounding=t,i.ln())},qe.inverseHyperbolicTangent=qe.atanh=function(){var e,t,i,s,o=this,n=o.constructor;return o.isFinite()?o.e>=0?new n(o.abs().eq(1)?o.s/0:o.isZero()?o:NaN):(e=n.precision,t=n.rounding,s=o.sd(),Math.max(s,e)<2*-o.e-1?it(new n(o),e,t,!0):(n.precision=i=s-o.e,o=tt(o.plus(1),new n(1).minus(o),i+e,1),n.precision=e+4,n.rounding=1,o=o.ln(),n.precision=e,n.rounding=t,o.times(.5))):new n(NaN)},qe.inverseSine=qe.asin=function(){var e,t,i,s,o=this,n=o.constructor;return o.isZero()?new n(o):(t=o.abs().cmp(1),i=n.precision,s=n.rounding,-1!==t?0===t?((e=rt(n,i+4,s).times(.5)).s=o.s,e):new n(NaN):(n.precision=i+6,n.rounding=1,o=o.div(new n(1).minus(o.times(o)).sqrt().plus(1)).atan(),n.precision=i,n.rounding=s,o.times(2)))},qe.inverseTangent=qe.atan=function(){var e,t,i,s,o,n,r,l,a,d=this,c=d.constructor,h=c.precision,u=c.rounding;if(d.isFinite()){if(d.isZero())return new c(d);if(d.abs().eq(1)&&h+4<=Ze)return(r=rt(c,h+4,u).times(.25)).s=d.s,r}else{if(!d.s)return new c(NaN);if(h+4<=Ze)return(r=rt(c,h+4,u).times(.5)).s=d.s,r}for(c.precision=l=h+10,c.rounding=1,e=i=Math.min(28,l/7+2|0);e;--e)d=d.div(d.times(d).plus(1).sqrt().plus(1));for(De=!1,t=Math.ceil(l/7),s=1,a=d.times(d),r=new c(d),o=d;-1!==e;)if(o=o.times(a),n=r.minus(o.div(s+=2)),o=o.times(a),void 0!==(r=n.plus(o.div(s+=2))).d[t])for(e=t;r.d[e]===n.d[e]&&e--;);return i&&(r=r.times(2<<i-1)),De=!0,it(r,c.precision=h,c.rounding=u,!0)},qe.isFinite=function(){return!!this.d},qe.isInteger=qe.isInt=function(){return!!this.d&&je(this.e/7)>this.d.length-2},qe.isNaN=function(){return!this.s},qe.isNegative=qe.isNeg=function(){return this.s<0},qe.isPositive=qe.isPos=function(){return this.s>0},qe.isZero=function(){return!!this.d&&0===this.d[0]},qe.lessThan=qe.lt=function(e){return this.cmp(e)<0},qe.lessThanOrEqualTo=qe.lte=function(e){return this.cmp(e)<1},qe.logarithm=qe.log=function(e){var t,i,s,o,n,r,l,a,d=this,c=d.constructor,h=c.precision,u=c.rounding;if(null==e)e=new c(10),t=!0;else{if(i=(e=new c(e)).d,e.s<0||!i||!i[0]||e.eq(1))return new c(NaN);t=e.eq(10)}if(i=d.d,d.s<0||!i||!i[0]||d.eq(1))return new c(i&&!i[0]?-1/0:1!=d.s?NaN:i?0:1/0);if(t)if(i.length>1)n=!0;else{for(o=i[0];o%10==0;)o/=10;n=1!==o}if(De=!1,r=pt(d,l=h+5),s=t?nt(c,l+10):pt(e,l),Qe((a=tt(r,s,l,1)).d,o=h,u))do{if(r=pt(d,l+=10),s=t?nt(c,l+10):pt(e,l),a=tt(r,s,l,1),!n){+Ke(a.d).slice(o+1,o+15)+1==1e14&&(a=it(a,h+1,0));break}}while(Qe(a.d,o+=10,u));return De=!0,it(a,h,u)},qe.minus=qe.sub=function(e){var t,i,s,o,n,r,l,a,d,c,h,u,p=this,g=p.constructor;if(e=new g(e),!p.d||!e.d)return p.s&&e.s?p.d?e.s=-e.s:e=new g(e.d||p.s!==e.s?p:NaN):e=new g(NaN),e;if(p.s!=e.s)return e.s=-e.s,p.plus(e);if(u=e.d,l=g.precision,a=g.rounding,!(d=p.d)[0]||!u[0]){if(u[0])e.s=-e.s;else{if(!d[0])return new g(3===a?-0:0);e=new g(p)}return De?it(e,l,a):e}if(i=je(e.e/7),c=je(p.e/7),d=d.slice(),n=c-i){for((h=n<0)?(t=d,n=-n,r=u.length):(t=u,i=c,r=d.length),n>(s=Math.max(Math.ceil(l/7),r)+2)&&(n=s,t.length=1),t.reverse(),s=n;s--;)t.push(0);t.reverse()}else{for((h=(s=d.length)<(r=u.length))&&(r=s),s=0;s<r;s++)if(d[s]!=u[s]){h=d[s]<u[s];break}n=0}for(h&&(t=d,d=u,u=t,e.s=-e.s),s=u.length-(r=d.length);s>0;--s)d[r++]=0;for(s=u.length;s>n;){if(d[--s]<u[s]){for(o=s;o&&0===d[--o];)d[o]=Ye-1;--d[o],d[s]+=Ye}d[s]-=u[s]}for(;0===d[--r];)d.pop();for(;0===d[0];d.shift())--i;return d[0]?(e.d=d,e.e=ot(d,i),De?it(e,l,a):e):new g(3===a?-0:0)},qe.modulo=qe.mod=function(e){var t,i=this,s=i.constructor;return e=new s(e),!i.d||!e.s||e.d&&!e.d[0]?new s(NaN):!e.d||i.d&&!i.d[0]?it(new s(i),s.precision,s.rounding):(De=!1,9==s.modulo?(t=tt(i,e.abs(),0,3,1)).s*=e.s:t=tt(i,e,0,s.modulo,1),t=t.times(e),De=!0,i.minus(t))},qe.naturalExponential=qe.exp=function(){return ut(this)},qe.naturalLogarithm=qe.ln=function(){return pt(this)},qe.negated=qe.neg=function(){var e=new this.constructor(this);return e.s=-e.s,it(e)},qe.plus=qe.add=function(e){var t,i,s,o,n,r,l,a,d,c,h=this,u=h.constructor;if(e=new u(e),!h.d||!e.d)return h.s&&e.s?h.d||(e=new u(e.d||h.s===e.s?h:NaN)):e=new u(NaN),e;if(h.s!=e.s)return e.s=-e.s,h.minus(e);if(c=e.d,l=u.precision,a=u.rounding,!(d=h.d)[0]||!c[0])return c[0]||(e=new u(h)),De?it(e,l,a):e;if(n=je(h.e/7),s=je(e.e/7),d=d.slice(),o=n-s){for(o<0?(i=d,o=-o,r=c.length):(i=c,s=n,r=d.length),o>(r=(n=Math.ceil(l/7))>r?n+1:r+1)&&(o=r,i.length=1),i.reverse();o--;)i.push(0);i.reverse()}for((r=d.length)-(o=c.length)<0&&(o=r,i=c,c=d,d=i),t=0;o;)t=(d[--o]=d[o]+c[o]+t)/Ye|0,d[o]%=Ye;for(t&&(d.unshift(t),++s),r=d.length;0==d[--r];)d.pop();return e.d=d,e.e=ot(d,s),De?it(e,l,a):e},qe.precision=qe.sd=function(e){var t,i=this;if(void 0!==e&&e!==!!e&&1!==e&&0!==e)throw Error(ke+e);return i.d?(t=lt(i.d),e&&i.e+1>t&&(t=i.e+1)):t=NaN,t},qe.round=function(){var e=this,t=e.constructor;return it(new t(e),e.e+1,t.rounding)},qe.sine=qe.sin=function(){var e,t,i=this,s=i.constructor;return i.isFinite()?i.isZero()?new s(i):(t=s.rounding,s.precision=(e=s.precision)+Math.max(i.e,i.sd())+7,s.rounding=1,i=function(e,t){var i,s=t.d.length;if(s<3)return t.isZero()?t:ft(e,2,t,t);i=1.4*Math.sqrt(s),t=t.times(1/Ct(5,i=i>16?16:0|i)),t=ft(e,2,t,t);for(var o,n=new e(5),r=new e(16),l=new e(20);i--;)o=t.times(t),t=t.times(n.plus(o.times(r.times(o).minus(l))));return t}(s,yt(s,i)),s.precision=e,s.rounding=t,it(Te>2?i.neg():i,e,t,!0)):new s(NaN)},qe.squareRoot=qe.sqrt=function(){var e,t,i,s,o,n,r=this,l=r.d,a=r.e,d=r.s,c=r.constructor;if(1!==d||!l||!l[0])return new c(!d||d<0&&(!l||l[0])?NaN:l?r:1/0);for(De=!1,0==(d=Math.sqrt(+r))||d==1/0?(((t=Ke(l)).length+a)%2==0&&(t+="0"),d=Math.sqrt(t),a=je((a+1)/2)-(a<0||a%2),s=new c(t=d==1/0?"5e"+a:(t=d.toExponential()).slice(0,t.indexOf("e")+1)+a)):s=new c(d.toString()),i=(a=c.precision)+3;;)if(s=(n=s).plus(tt(r,n,i+2,1)).times(.5),Ke(n.d).slice(0,i)===(t=Ke(s.d)).slice(0,i)){if("9999"!=(t=t.slice(i-3,i+1))&&(o||"4999"!=t)){+t&&(+t.slice(1)||"5"!=t.charAt(0))||(it(s,a+1,1),e=!s.times(s).eq(r));break}if(!o&&(it(n,a+1,0),n.times(n).eq(r))){s=n;break}i+=4,o=1}return De=!0,it(s,a,c.rounding,e)},qe.tangent=qe.tan=function(){var e,t,i=this,s=i.constructor;return i.isFinite()?i.isZero()?new s(i):(t=s.rounding,s.precision=(e=s.precision)+10,s.rounding=1,(i=i.sin()).s=1,i=tt(i,new s(1).minus(i.times(i)).sqrt(),e+10,0),s.precision=e,s.rounding=t,it(2==Te||4==Te?i.neg():i,e,t,!0)):new s(NaN)},qe.times=qe.mul=function(e){var t,i,s,o,n,r,l,a,d,c=this,h=c.constructor,u=c.d,p=(e=new h(e)).d;if(e.s*=c.s,!(u&&u[0]&&p&&p[0]))return new h(!e.s||u&&!u[0]&&!p||p&&!p[0]&&!u?NaN:u&&p?0*e.s:e.s/0);for(i=je(c.e/7)+je(e.e/7),(a=u.length)<(d=p.length)&&(n=u,u=p,p=n,r=a,a=d,d=r),n=[],s=r=a+d;s--;)n.push(0);for(s=d;--s>=0;){for(t=0,o=a+s;o>s;)l=n[o]+p[s]*u[o-s-1]+t,n[o--]=l%Ye|0,t=l/Ye|0;n[o]=(n[o]+t)%Ye|0}for(;!n[--r];)n.pop();return t?++i:n.shift(),e.d=n,e.e=ot(n,i),De?it(e,h.precision,h.rounding):e},qe.toBinary=function(e,t){return wt(this,2,e,t)},qe.toDecimalPlaces=qe.toDP=function(e,t){var i=this,s=i.constructor;return i=new s(i),void 0===e?i:(Je(e,0,Ie),void 0===t?t=s.rounding:Je(t,0,8),it(i,e+i.e+1,t))},qe.toExponential=function(e,t){var i,s=this,o=s.constructor;return void 0===e?i=st(s,!0):(Je(e,0,Ie),void 0===t?t=o.rounding:Je(t,0,8),i=st(s=it(new o(s),e+1,t),!0,e+1)),s.isNeg()&&!s.isZero()?"-"+i:i},qe.toFixed=function(e,t){var i,s,o=this,n=o.constructor;return void 0===e?i=st(o):(Je(e,0,Ie),void 0===t?t=n.rounding:Je(t,0,8),i=st(s=it(new n(o),e+o.e+1,t),!1,e+s.e+1)),o.isNeg()&&!o.isZero()?"-"+i:i},qe.toFraction=function(e){var t,i,s,o,n,r,l,a,d,c,h,u,p=this,g=p.d,m=p.constructor;if(!g)return new m(p);if(d=i=new m(1),s=a=new m(0),n=(t=new m(s)).e=lt(g)-p.e-1,t.d[0]=We(10,(r=n%7)<0?7+r:r),null==e)e=n>0?t:d;else{if(!(l=new m(e)).isInt()||l.lt(d))throw Error(ke+l);e=l.gt(t)?n>0?t:d:l}for(De=!1,l=new m(Ke(g)),c=m.precision,m.precision=n=7*g.length*2;h=tt(l,t,0,1,1),1!=(o=i.plus(h.times(s))).cmp(e);)i=s,s=o,d=a.plus(h.times(o=d)),a=o,t=l.minus(h.times(o=t)),l=o;return o=tt(e.minus(i),s,0,1,1),a=a.plus(o.times(d)),i=i.plus(o.times(s)),a.s=d.s=p.s,u=tt(d,s,n,1).minus(p).abs().cmp(tt(a,i,n,1).minus(p).abs())<1?[d,s]:[a,i],m.precision=c,De=!0,u},qe.toHexadecimal=qe.toHex=function(e,t){return wt(this,16,e,t)},qe.toNearest=function(e,t){var i=this,s=i.constructor;if(i=new s(i),null==e){if(!i.d)return i;e=new s(1),t=s.rounding}else{if(e=new s(e),void 0===t?t=s.rounding:Je(t,0,8),!i.d)return e.s?i:e;if(!e.d)return e.s&&(e.s=i.s),e}return e.d[0]?(De=!1,i=tt(i,e,0,t,1).times(e),De=!0,it(i)):(e.s=i.s,i=e),i},qe.toNumber=function(){return+this},qe.toOctal=function(e,t){return wt(this,8,e,t)},qe.toPower=qe.pow=function(e){var t,i,s,o,n,r,l=this,a=l.constructor,d=+(e=new a(e));if(!(l.d&&e.d&&l.d[0]&&e.d[0]))return new a(We(+l,d));if((l=new a(l)).eq(1))return l;if(s=a.precision,n=a.rounding,e.eq(1))return it(l,s,n);if((t=je(e.e/7))>=e.d.length-1&&(i=d<0?-d:d)<=9007199254740991)return o=dt(a,l,i,s),e.s<0?new a(1).div(o):it(o,s,n);if((r=l.s)<0){if(t<e.d.length-1)return new a(NaN);if(1&e.d[t]||(r=1),0==l.e&&1==l.d[0]&&1==l.d.length)return l.s=r,l}return(t=0!=(i=We(+l,d))&&isFinite(i)?new a(i+"").e:je(d*(Math.log("0."+Ke(l.d))/Math.LN10+l.e+1)))>a.maxE+1||t<a.minE-1?new a(t>0?r/0:0):(De=!1,a.rounding=l.s=1,i=Math.min(12,(t+"").length),(o=ut(e.times(pt(l,s+i)),s)).d&&Qe((o=it(o,s+5,1)).d,s,n)&&+Ke((o=it(ut(e.times(pt(l,(t=s+10)+i)),t),t+5,1)).d).slice(s+1,s+15)+1==1e14&&(o=it(o,s+1,0)),o.s=r,De=!0,a.rounding=n,it(o,s,n))},qe.toPrecision=function(e,t){var i,s=this,o=s.constructor;return void 0===e?i=st(s,s.e<=o.toExpNeg||s.e>=o.toExpPos):(Je(e,1,Ie),void 0===t?t=o.rounding:Je(t,0,8),i=st(s=it(new o(s),e,t),e<=s.e||s.e<=o.toExpNeg,e)),s.isNeg()&&!s.isZero()?"-"+i:i},qe.toSignificantDigits=qe.toSD=function(e,t){var i=this.constructor;return void 0===e?(e=i.precision,t=i.rounding):(Je(e,1,Ie),void 0===t?t=i.rounding:Je(t,0,8)),it(new i(this),e,t)},qe.toString=function(){var e=this,t=e.constructor,i=st(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()&&!e.isZero()?"-"+i:i},qe.truncated=qe.trunc=function(){return it(new this.constructor(this),this.e+1,1)},qe.valueOf=qe.toJSON=function(){var e=this,t=e.constructor,i=st(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()?"-"+i:i};var tt=function(){function e(e,t,i){var s,o=0,n=e.length;for(e=e.slice();n--;)e[n]=(s=e[n]*t+o)%i|0,o=s/i|0;return o&&e.unshift(o),e}function t(e,t,i,s){var o,n;if(i!=s)n=i>s?1:-1;else for(o=n=0;o<i;o++)if(e[o]!=t[o]){n=e[o]>t[o]?1:-1;break}return n}function i(e,t,i,s){for(var o=0;i--;)e[i]-=o,e[i]=(o=e[i]<t[i]?1:0)*s+e[i]-t[i];for(;!e[0]&&e.length>1;)e.shift()}return function(s,o,n,r,l,a){var d,c,h,u,p,g,m,v,f,C,y,w,x,_,S,b,E,L,T,O,R=s.constructor,I=s.s==o.s?1:-1,N=s.d,B=o.d;if(!(N&&N[0]&&B&&B[0]))return new R(s.s&&o.s&&(N?!B||N[0]!=B[0]:B)?N&&0==N[0]||!B?0*I:I/0:NaN);for(a?(p=1,c=s.e-o.e):(a=Ye,c=je(s.e/(p=7))-je(o.e/p)),T=B.length,E=N.length,C=(f=new R(I)).d=[],h=0;B[h]==(N[h]||0);h++);if(B[h]>(N[h]||0)&&c--,null==n?(_=n=R.precision,r=R.rounding):_=l?n+(s.e-o.e)+1:n,_<0)C.push(1),g=!0;else{if(_=_/p+2|0,h=0,1==T){for(u=0,B=B[0],_++;(h<E||u)&&_--;h++)C[h]=(S=u*a+(N[h]||0))/B|0,u=S%B|0;g=u||h<E}else{for((u=a/(B[0]+1)|0)>1&&(B=e(B,u,a),N=e(N,u,a),T=B.length,E=N.length),b=T,w=(y=N.slice(0,T)).length;w<T;)y[w++]=0;(O=B.slice()).unshift(0),L=B[0],B[1]>=a/2&&++L;do{u=0,(d=t(B,y,T,w))<0?(x=y[0],T!=w&&(x=x*a+(y[1]||0)),(u=x/L|0)>1?(u>=a&&(u=a-1),1==(d=t(m=e(B,u,a),y,v=m.length,w=y.length))&&(u--,i(m,T<v?O:B,v,a))):(0==u&&(d=u=1),m=B.slice()),(v=m.length)<w&&m.unshift(0),i(y,m,w,a),-1==d&&(d=t(B,y,T,w=y.length))<1&&(u++,i(y,T<w?O:B,w,a)),w=y.length):0===d&&(u++,y=[0]),C[h++]=u,d&&y[0]?y[w++]=N[b]||0:(y=[N[b]],w=1)}while((b++<E||void 0!==y[0])&&_--);g=void 0!==y[0]}C[0]||C.shift()}if(1==p)f.e=c,Le=g;else{for(h=1,u=C[0];u>=10;u/=10)h++;f.e=h+c*p-1,it(f,l?n+f.e+1:n,r,g)}return f}}();function it(e,t,i,s){var o,n,r,l,a,d,c,h,u,p=e.constructor;e:if(null!=t){if(!(h=e.d))return e;for(o=1,l=h[0];l>=10;l/=10)o++;if((n=t-o)<0)n+=7,a=(c=h[u=0])/We(10,o-(r=t)-1)%10|0;else if((u=Math.ceil((n+1)/7))>=(l=h.length)){if(!s)break e;for(;l++<=u;)h.push(0);c=a=0,o=1,r=(n%=7)-7+1}else{for(c=l=h[u],o=1;l>=10;l/=10)o++;a=(r=(n%=7)-7+o)<0?0:c/We(10,o-r-1)%10|0}if(s=s||t<0||void 0!==h[u+1]||(r<0?c:c%We(10,o-r-1)),d=i<4?(a||s)&&(0==i||i==(e.s<0?3:2)):a>5||5==a&&(4==i||s||6==i&&(n>0?r>0?c/We(10,o-r):0:h[u-1])%10&1||i==(e.s<0?8:7)),t<1||!h[0])return h.length=0,d?(h[0]=We(10,(7-(t-=e.e+1)%7)%7),e.e=-t||0):h[0]=e.e=0,e;if(0==n?(h.length=u,l=1,u--):(h.length=u+1,l=We(10,7-n),h[u]=r>0?(c/We(10,o-r)%We(10,r)|0)*l:0),d)for(;;){if(0==u){for(n=1,r=h[0];r>=10;r/=10)n++;for(r=h[0]+=l,l=1;r>=10;r/=10)l++;n!=l&&(e.e++,h[0]==Ye&&(h[0]=1));break}if(h[u]+=l,h[u]!=Ye)break;h[u--]=0,l=1}for(n=h.length;0===h[--n];)h.pop()}return De&&(e.e>p.maxE?(e.d=null,e.e=NaN):e.e<p.minE&&(e.e=0,e.d=[0])),e}function st(e,t,i){if(!e.isFinite())return gt(e);var s,o=e.e,n=Ke(e.d),r=n.length;return t?(i&&(s=i-r)>0?n=n.charAt(0)+"."+n.slice(1)+at(s):r>1&&(n=n.charAt(0)+"."+n.slice(1)),n=n+(e.e<0?"e":"e+")+e.e):o<0?(n="0."+at(-o-1)+n,i&&(s=i-r)>0&&(n+=at(s))):o>=r?(n+=at(o+1-r),i&&(s=i-o-1)>0&&(n=n+"."+at(s))):((s=o+1)<r&&(n=n.slice(0,s)+"."+n.slice(s)),i&&(s=i-r)>0&&(o+1===r&&(n+="."),n+=at(s))),n}function ot(e,t){var i=e[0];for(t*=7;i>=10;i/=10)t++;return t}function nt(e,t,i){if(t>Xe)throw De=!0,i&&(e.precision=i),Error(ze);return it(new e(Be),t,1,!0)}function rt(e,t,i){if(t>Ze)throw Error(ze);return it(new e(Ae),t,i,!0)}function lt(e){var t=e.length-1,i=7*t+1;if(t=e[t]){for(;t%10==0;t/=10)i--;for(t=e[0];t>=10;t/=10)i++}return i}function at(e){for(var t="";e--;)t+="0";return t}function dt(e,t,i,s){var o,n=new e(1),r=Math.ceil(s/7+4);for(De=!1;;){if(i%2&&xt((n=n.times(t)).d,r)&&(o=!0),0===(i=je(i/2))){i=n.d.length-1,o&&0===n.d[i]&&++n.d[i];break}xt((t=t.times(t)).d,r)}return De=!0,n}function ct(e){return 1&e.d[e.d.length-1]}function ht(e,t,i){for(var s,o,n=new e(t[0]),r=0;++r<t.length;){if(!(o=new e(t[r])).s){n=o;break}((s=n.cmp(o))===i||0===s&&n.s===i)&&(n=o)}return n}function ut(e,t){var i,s,o,n,r,l,a,d=0,c=0,h=0,u=e.constructor,p=u.rounding,g=u.precision;if(!e.d||!e.d[0]||e.e>17)return new u(e.d?e.d[0]?e.s<0?0:1/0:1:e.s?e.s<0?0:e:NaN);for(null==t?(De=!1,a=g):a=t,l=new u(.03125);e.e>-2;)e=e.times(l),h+=5;for(a+=s=Math.log(We(2,h))/Math.LN10*2+5|0,i=n=r=new u(1),u.precision=a;;){if(n=it(n.times(e),a,1),i=i.times(++c),Ke((l=r.plus(tt(n,i,a,1))).d).slice(0,a)===Ke(r.d).slice(0,a)){for(o=h;o--;)r=it(r.times(r),a,1);if(null!=t)return u.precision=g,r;if(!(d<3&&Qe(r.d,a-s,p,d)))return it(r,u.precision=g,p,De=!0);u.precision=a+=10,i=n=l=new u(1),c=0,d++}r=l}}function pt(e,t){var i,s,o,n,r,l,a,d,c,h,u,p=1,g=e,m=g.d,v=g.constructor,f=v.rounding,C=v.precision;if(g.s<0||!m||!m[0]||!g.e&&1==m[0]&&1==m.length)return new v(m&&!m[0]?-1/0:1!=g.s?NaN:m?0:g);if(null==t?(De=!1,c=C):c=t,v.precision=c+=10,s=(i=Ke(m)).charAt(0),!(Math.abs(n=g.e)<15e14))return d=nt(v,c+2,C).times(n+""),g=pt(new v(s+"."+i.slice(1)),c-10).plus(d),v.precision=C,null==t?it(g,C,f,De=!0):g;for(;s<7&&1!=s||1==s&&i.charAt(1)>3;)s=(i=Ke((g=g.times(e)).d)).charAt(0),p++;for(n=g.e,s>1?(g=new v("0."+i),n++):g=new v(s+"."+i.slice(1)),h=g,a=r=g=tt(g.minus(1),g.plus(1),c,1),u=it(g.times(g),c,1),o=3;;){if(r=it(r.times(u),c,1),Ke((d=a.plus(tt(r,new v(o),c,1))).d).slice(0,c)===Ke(a.d).slice(0,c)){if(a=a.times(2),0!==n&&(a=a.plus(nt(v,c+2,C).times(n+""))),a=tt(a,new v(p),c,1),null!=t)return v.precision=C,a;if(!Qe(a.d,c-10,f,l))return it(a,v.precision=C,f,De=!0);v.precision=c+=10,d=r=g=tt(h.minus(1),h.plus(1),c,1),u=it(g.times(g),c,1),o=l=1}a=d,o+=2}}function gt(e){return String(e.s*e.s/0)}function mt(e,t){var i,s,o;for((i=t.indexOf("."))>-1&&(t=t.replace(".","")),(s=t.search(/e/i))>0?(i<0&&(i=s),i+=+t.slice(s+1),t=t.substring(0,s)):i<0&&(i=t.length),s=0;48===t.charCodeAt(s);s++);for(o=t.length;48===t.charCodeAt(o-1);--o);if(t=t.slice(s,o)){if(o-=s,e.e=i=i-s-1,e.d=[],s=(i+1)%7,i<0&&(s+=7),s<o){for(s&&e.d.push(+t.slice(0,s)),o-=7;s<o;)e.d.push(+t.slice(s,s+=7));s=7-(t=t.slice(s)).length}else s-=o;for(;s--;)t+="0";e.d.push(+t),De&&(e.e>e.constructor.maxE?(e.d=null,e.e=NaN):e.e<e.constructor.minE&&(e.e=0,e.d=[0]))}else e.e=0,e.d=[0];return e}function vt(e,t){var i,s,o,n,r,l,a,d,c;if(t.indexOf("_")>-1){if(t=t.replace(/(\d)_(?=\d)/g,"$1"),Ue.test(t))return mt(e,t)}else if("Infinity"===t||"NaN"===t)return+t||(e.s=NaN),e.e=NaN,e.d=null,e;if(Ve.test(t))i=16,t=t.toLowerCase();else if(Ge.test(t))i=2;else{if(!$e.test(t))throw Error(ke+t);i=8}for((n=t.search(/p/i))>0?(a=+t.slice(n+1),t=t.substring(2,n)):t=t.slice(2),n=t.indexOf("."),s=e.constructor,(r=n>=0)&&(n=(l=(t=t.replace(".","")).length)-n,o=dt(s,new s(i),n,2*n)),n=c=(d=et(t,i,Ye)).length-1;0===d[n];--n)d.pop();return n<0?new s(0*e.s):(e.e=ot(d,c),e.d=d,De=!1,r&&(e=tt(e,o,4*l)),a&&(e=e.times(Math.abs(a)<54?We(2,a):ai.pow(2,a))),De=!0,e)}function ft(e,t,i,s,o){var n,r,l,a,d=e.precision,c=Math.ceil(d/7);for(De=!1,a=i.times(i),l=new e(s);;){if(r=tt(l.times(a),new e(t++*t++),d,1),l=o?s.plus(r):s.minus(r),s=tt(r.times(a),new e(t++*t++),d,1),void 0!==(r=l.plus(s)).d[c]){for(n=c;r.d[n]===l.d[n]&&n--;);if(-1==n)break}n=l,l=s,s=r,r=n}return De=!0,r.d.length=c+1,r}function Ct(e,t){for(var i=e;--t;)i*=e;return i}function yt(e,t){var i,s=t.s<0,o=rt(e,e.precision,1),n=o.times(.5);if((t=t.abs()).lte(n))return Te=s?4:1,t;if((i=t.divToInt(o)).isZero())Te=s?3:2;else{if((t=t.minus(i.times(o))).lte(n))return Te=ct(i)?s?2:3:s?4:1,t;Te=ct(i)?s?1:4:s?3:2}return t.minus(o).abs()}function wt(e,t,i,s){var o,n,r,l,a,d,c,h,u,p=e.constructor,g=void 0!==i;if(g?(Je(i,1,Ie),void 0===s?s=p.rounding:Je(s,0,8)):(i=p.precision,s=p.rounding),e.isFinite()){for(g?(o=2,16==t?i=4*i-3:8==t&&(i=3*i-2)):o=t,(r=(c=st(e)).indexOf("."))>=0&&(c=c.replace(".",""),(u=new p(1)).e=c.length-r,u.d=et(st(u),10,o),u.e=u.d.length),n=a=(h=et(c,10,o)).length;0==h[--a];)h.pop();if(h[0]){if(r<0?n--:((e=new p(e)).d=h,e.e=n,h=(e=tt(e,u,i,s,0,o)).d,n=e.e,d=Le),r=h[i],l=o/2,d=d||void 0!==h[i+1],d=s<4?(void 0!==r||d)&&(0===s||s===(e.s<0?3:2)):r>l||r===l&&(4===s||d||6===s&&1&h[i-1]||s===(e.s<0?8:7)),h.length=i,d)for(;++h[--i]>o-1;)h[i]=0,i||(++n,h.unshift(1));for(a=h.length;!h[a-1];--a);for(r=0,c="";r<a;r++)c+=Ne.charAt(h[r]);if(g){if(a>1)if(16==t||8==t){for(r=16==t?4:3,--a;a%r;a++)c+="0";for(a=(h=et(c,o,t)).length;!h[a-1];--a);for(r=1,c="1.";r<a;r++)c+=Ne.charAt(h[r])}else c=c.charAt(0)+"."+c.slice(1);c=c+(n<0?"p":"p+")+n}else if(n<0){for(;++n;)c="0"+c;c="0."+c}else if(++n>a)for(n-=a;n--;)c+="0";else n<a&&(c=c.slice(0,n)+"."+c.slice(n))}else c=g?"0p+0":"0";c=(16==t?"0x":2==t?"0b":8==t?"0o":"")+c}else c=gt(e);return e.s<0?"-"+c:c}function xt(e,t){if(e.length>t)return e.length=t,!0}function _t(e){return new this(e).abs()}function St(e){return new this(e).acos()}function bt(e){return new this(e).acosh()}function Et(e,t){return new this(e).plus(t)}function Lt(e){return new this(e).asin()}function Tt(e){return new this(e).asinh()}function Ot(e){return new this(e).atan()}function Rt(e){return new this(e).atanh()}function It(e,t){e=new this(e),t=new this(t);var i,s=this.precision,o=this.rounding,n=s+4;return e.s&&t.s?e.d||t.d?!t.d||e.isZero()?(i=t.s<0?rt(this,s,o):new this(0)).s=e.s:!e.d||t.isZero()?(i=rt(this,n,1).times(.5)).s=e.s:t.s<0?(this.precision=n,this.rounding=1,i=this.atan(tt(e,t,n,1)),t=rt(this,n,1),this.precision=s,this.rounding=o,i=e.s<0?i.minus(t):i.plus(t)):i=this.atan(tt(e,t,n,1)):(i=rt(this,n,1).times(t.s>0?.25:.75)).s=e.s:i=new this(NaN),i}function Nt(e){return new this(e).cbrt()}function Bt(e){return it(e=new this(e),e.e+1,2)}function At(e,t,i){return new this(e).clamp(t,i)}function Mt(e){if(!e||"object"!=typeof e)throw Error(He+"Object expected");var t,i,s,o=!0===e.defaults,n=["precision",1,Ie,"rounding",0,8,"toExpNeg",-Re,0,"toExpPos",0,Re,"maxE",0,Re,"minE",-Re,0,"modulo",0,9];for(t=0;t<n.length;t+=3)if(i=n[t],o&&(this[i]=Me[i]),void 0!==(s=e[i])){if(!(je(s)===s&&s>=n[t+1]&&s<=n[t+2]))throw Error(ke+i+": "+s);this[i]=s}if(i="crypto",o&&(this[i]=Me[i]),void 0!==(s=e[i])){if(!0!==s&&!1!==s&&0!==s&&1!==s)throw Error(ke+i+": "+s);if(s){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw Error(Fe);this[i]=!0}else this[i]=!1}return this}function Dt(e){return new this(e).cos()}function Ht(e){return new this(e).cosh()}function kt(e,t){return new this(e).div(t)}function zt(e){return new this(e).exp()}function Ft(e){return it(e=new this(e),e.e+1,3)}function Pt(){var e,t,i=new this(0);for(De=!1,e=0;e<arguments.length;)if((t=new this(arguments[e++])).d)i.d&&(i=i.plus(t.times(t)));else{if(t.s)return De=!0,new this(1/0);i=t}return De=!0,i.sqrt()}function jt(e){return e instanceof ai||e&&e.toStringTag===Pe||!1}function Wt(e){return new this(e).ln()}function Gt(e,t){return new this(e).log(t)}function Vt(e){return new this(e).log(2)}function $t(e){return new this(e).log(10)}function Ut(){return ht(this,arguments,-1)}function Yt(){return ht(this,arguments,1)}function Xt(e,t){return new this(e).mod(t)}function Zt(e,t){return new this(e).mul(t)}function qt(e,t){return new this(e).pow(t)}function Kt(e){var t,i,s,o,n=0,r=new this(1),l=[];if(void 0===e?e=this.precision:Je(e,1,Ie),s=Math.ceil(e/7),this.crypto)if(crypto.getRandomValues)for(t=crypto.getRandomValues(new Uint32Array(s));n<s;)(o=t[n])>=429e7?t[n]=crypto.getRandomValues(new Uint32Array(1))[0]:l[n++]=o%1e7;else{if(!crypto.randomBytes)throw Error(Fe);for(t=crypto.randomBytes(s*=4);n<s;)(o=t[n]+(t[n+1]<<8)+(t[n+2]<<16)+((127&t[n+3])<<24))>=214e7?crypto.randomBytes(4).copy(t,n):(l.push(o%1e7),n+=4);n=s/4}else for(;n<s;)l[n++]=1e7*Math.random()|0;for(e%=7,(s=l[--n])&&e&&(o=We(10,7-e),l[n]=(s/o|0)*o);0===l[n];n--)l.pop();if(n<0)i=0,l=[0];else{for(i=-1;0===l[0];i-=7)l.shift();for(s=1,o=l[0];o>=10;o/=10)s++;s<7&&(i-=7-s)}return r.e=i,r.d=l,r}function Jt(e){return it(e=new this(e),e.e+1,this.rounding)}function Qt(e){return(e=new this(e)).d?e.d[0]?e.s:0*e.s:e.s||NaN}function ei(e){return new this(e).sin()}function ti(e){return new this(e).sinh()}function ii(e){return new this(e).sqrt()}function si(e,t){return new this(e).sub(t)}function oi(){var e=0,t=arguments,i=new this(t[e]);for(De=!1;i.s&&++e<t.length;)i=i.plus(t[e]);return De=!0,it(i,this.precision,this.rounding)}function ni(e){return new this(e).tan()}function ri(e){return new this(e).tanh()}function li(e){return it(e=new this(e),e.e+1,1)}qe[Symbol.for("nodejs.util.inspect.custom")]=qe.toString,qe[Symbol.toStringTag]="Decimal";var ai=qe.constructor=function e(t){var i,s,o;function n(e){var t,i,s,o=this;if(!(o instanceof n))return new n(e);if(o.constructor=n,jt(e))return o.s=e.s,void(De?!e.d||e.e>n.maxE?(o.e=NaN,o.d=null):e.e<n.minE?(o.e=0,o.d=[0]):(o.e=e.e,o.d=e.d.slice()):(o.e=e.e,o.d=e.d?e.d.slice():e.d));if("number"===(s=typeof e)){if(0===e)return o.s=1/e<0?-1:1,o.e=0,void(o.d=[0]);if(e<0?(e=-e,o.s=-1):o.s=1,e===~~e&&e<1e7){for(t=0,i=e;i>=10;i/=10)t++;return void(De?t>n.maxE?(o.e=NaN,o.d=null):t<n.minE?(o.e=0,o.d=[0]):(o.e=t,o.d=[e]):(o.e=t,o.d=[e]))}return 0*e!=0?(e||(o.s=NaN),o.e=NaN,void(o.d=null)):mt(o,e.toString())}if("string"===s)return 45===(i=e.charCodeAt(0))?(e=e.slice(1),o.s=-1):(43===i&&(e=e.slice(1)),o.s=1),Ue.test(e)?mt(o,e):vt(o,e);if("bigint"===s)return e<0?(e=-e,o.s=-1):o.s=1,mt(o,e.toString());throw Error(ke+e)}if(n.prototype=qe,n.ROUND_UP=0,n.ROUND_DOWN=1,n.ROUND_CEIL=2,n.ROUND_FLOOR=3,n.ROUND_HALF_UP=4,n.ROUND_HALF_DOWN=5,n.ROUND_HALF_EVEN=6,n.ROUND_HALF_CEIL=7,n.ROUND_HALF_FLOOR=8,n.EUCLID=9,n.config=n.set=Mt,n.clone=e,n.isDecimal=jt,n.abs=_t,n.acos=St,n.acosh=bt,n.add=Et,n.asin=Lt,n.asinh=Tt,n.atan=Ot,n.atanh=Rt,n.atan2=It,n.cbrt=Nt,n.ceil=Bt,n.clamp=At,n.cos=Dt,n.cosh=Ht,n.div=kt,n.exp=zt,n.floor=Ft,n.hypot=Pt,n.ln=Wt,n.log=Gt,n.log10=$t,n.log2=Vt,n.max=Ut,n.min=Yt,n.mod=Xt,n.mul=Zt,n.pow=qt,n.random=Kt,n.round=Jt,n.sign=Qt,n.sin=ei,n.sinh=ti,n.sqrt=ii,n.sub=si,n.sum=oi,n.tan=ni,n.tanh=ri,n.trunc=li,void 0===t&&(t={}),t&&!0!==t.defaults)for(o=["precision","rounding","toExpNeg","toExpPos","maxE","minE","modulo","crypto"],i=0;i<o.length;)t.hasOwnProperty(s=o[i++])||(t[s]=this[s]);return n.config(t),n}(Me);Be=new ai(Be),Ae=new ai(Ae);const di=ai;class ci{constructor(e,t){this.raw=e,this.extraField=t}static getCellData(e,t){return new ci(e,t)}static getCellDataList(e,t){return t.map(t=>ci.getCellData(e,t))}static getFieldValue(e,t=""){return e instanceof ci?t?e.getValueByField(t):e[ye._O]:null==e?void 0:e[t]}get[ye._O](){return this.raw}get[ye.GJ](){return this.extraField}get[ye.nj](){return this.raw[this.extraField]}getValueByField(e){return e===ye.nj||e===ye.GJ?this[e]:this.raw[e]}}const hi=e=>"number"==typeof e?Number.isNaN(e):!e||("string"!=typeof e||Number.isNaN(Number(e))),ui=e=>!hi(e),pi=(e,t,i=!1)=>(null==e?void 0:e.length)?e.reduce((e,s)=>{const o=ci.getFieldValue(s,t),n=hi(o);if(i&&n)return e;return e.push(new di(n?0:o)),e},[]):[],gi=(e,t)=>{const i=pi(e,t);return i.length?di.sum(...i).toNumber():0},mi=(e,t,i)=>{const s=pi(t,i,!0);if(null==s?void 0:s.length)return di[e](...s).toNumber()},vi={[v.F4.SUM]:gi,[v.F4.MIN]:(e,t)=>mi("min",e,t),[v.F4.MAX]:(e,t)=>mi("max",e,t),[v.F4.AVG]:(e,t)=>{const i=pi(e,t);return(null==i?void 0:i.length)?di.sum(...i).dividedBy(i.length).toNumber():0},[v.F4.COUNT]:e=>(null==e?void 0:e.length)||0},fi=e=>"ASC"===(0,a.toUpper)(e),Ci=e=>"DESC"===(0,a.toUpper)(e),yi=(e,t,i,s="last")=>{const o=fi(t)?1:-1,n=fi(t),r="first"===s||"auto"===s&&n?-1:1;return null==e?void 0:e.sort((e,t)=>{let s=e,n=t;if(i){s=e.getValueByField(i),n=t.getValueByField(i);const l=(0,a.isNil)(s)||"-"===s||""===s,d=(0,a.isNil)(n)||"-"===n||""===n;if(l&&d)return 0;if(l)return r;if(d)return-r;if(ui(s)&&ui(n))return(Number(s)-Number(n))*o}return(0,a.isNil)(s)||(0,a.isNil)(n)?s?-r:r:s.toString().localeCompare(n.toString(),"zh")*o})},wi=(e,t,i)=>{return i?(s=t,o=(0,a.uniq)(e),null===(n=null==s?void 0:s.filter(e=>!(null==o?void 0:o.includes(e))))||void 0===n?void 0:n.concat(o)):[...new Set([...e,...t])];var s,o,n},xi=e=>{const{sortByValues:t=[],originValues:i=[]}=e,s=i.filter(e=>t.find(t=>(0,a.last)((0,a.split)(e,"[&]"))===t)).map(e=>{const t=e.split("[&]");if(t.length>1){return[t.slice(0,t.length-1).join("[&]"),t[t.length-1]]}return t}),o=Array.from(new Set(s.map(e=>e[0])));s.sort((e,i)=>{const s=e.slice(0,e.length-1),n=i.slice(0,i.length-1);if(s.join()!==n.join()){return o.indexOf(s[0])-o.indexOf(n[0])}return t.indexOf(e[e.length-1])-t.indexOf(i[i.length-1])});const n=s.map(e=>e.join("[&]"));return r=n,i.sort((e,t)=>{l&&(e=l(e),t=l(t));const i=r.indexOf(e),s=r.indexOf(t);return-1===i&&-1===s?0:-1===i?1:-1===s?-1:i-s});var r,l},_i=e=>{const{sortParam:t,originValues:i=[],measureValues:s,dataSet:o}=e,{sortFunc:n,sortMethod:r,sortBy:l}=t;let d=i;const c={originValues:i,measureValues:s,sortParam:t,dataSet:o};return n?d=(e=>{const{originValues:t=[],measureValues:i,sortParam:s,dataSet:o}=e,{sortFunc:n,sortFieldId:r,sortMethod:l}=s,d=null==n?void 0:n(Object.assign({data:i},s));return(null==d?void 0:d.length)?(o.fields.rows.indexOf(r)>0||o.fields.columns.indexOf(r)>0)&&!(0,a.includes)(d[0],"[&]")?xi({sortByValues:d,originValues:t}):wi(d,t,fi(l)):t})(c):l?d=xi({sortByValues:l,originValues:i}):(fi(r)||Ci(r))&&(d=(e=>{const{sortParam:t,measureValues:i,originValues:s,dataSet:o}=e,{sortByMeasure:n,query:r,sortFieldId:l,sortMethod:a,nullsPlacement:d="last"}=t,{rows:c=[],columns:h=[]}=o.fields,u=null==c?void 0:c.includes(l);let p;if(n){const e=yi(i,a,n===ye.jI?null==r?void 0:r[ye.GJ]:n,d),t=u?c:L(h);p=(0,Oe.XN)(l,t,e)}else p=yi(i,a,void 0,d);return wi(p,s,fi(a))})(c)),d},Si=e=>{const{dataSet:t,sortParam:i,originValues:s}=e,{fields:o}=t,{sortByMeasure:n,query:r,sortFieldId:l}=i;if(n!==ye.jI){return t.getCellMultiData({query:r,queryType:be.B.DetailOnly})}const d=t.getCellMultiData({query:r,queryType:be.B.All}),c=L(o.columns),h=(0,a.includes)(o.rows,l),u=(0,Oe.LR)(h?o.rows:c),p=(0,Oe.LR)(h?c:o.rows),g=u[u.indexOf(l)+1],m=(0,a.keys)(r),v=p.filter(e=>!m.includes(e)),f=d.filter(e=>{const t=new Set((0,a.keys)(e[ye._O]));if(!t.has(l))return!1;if(t.has(g))return!1;return v.every(e=>!t.has(e))});return(0,a.isEmpty)(f)?(0,a.compact)((0,a.map)(s,e=>{const i=((e,t,i)=>{var s;const o={};if((0,a.includes)(e,"[&]")){const n=(0,a.split)(e,"[&]"),r=(null===(s=null==t?void 0:t.rows)||void 0===s?void 0:s.includes(i))?t.rows:L(t.columns);for(let e=0;e<=(0,a.indexOf)(r,i);e++)o[r[e]]=n[e]}else o[i]=e;return o})(e,o,l);return t.getTotalValue(Object.assign(Object.assign({},r),i))})):f},bi=(e,t)=>{if(null==e?void 0:e.sortMethod){if(fi(null==e?void 0:e.sortMethod))return"groupAsc";if(Ci(null==e?void 0:e.sortMethod))return"groupDesc"}if(t)return"SortDown"},Ei=e=>{const{pivotMeta:t,dimensions:i,sortedDimensionValues:s,sortFieldId:o}=e,n={children:t};let r=[n];for(const e of i){if(e===o){r.forEach(e=>{const t=[...e.children.values()],i=(0,a.sortBy)(t,e=>(0,a.indexOf)(s,e.id)).map(e=>[e.value,e]);e.children=new Map(i)});break}r=(0,a.flatMap)(r,e=>[...e.children.values()])}return n.children};class Li extends Ce{constructor(){super(...arguments),this.hasMobileTouchListeners=!1}getHeaderConfig(){return this.headerConfig||{}}isShallowRender(){return super.isShallowRender()||this.headerConfig.shallowRender}shouldInit(){return super.shouldInit()&&!this.isShallowRender()}handleRestOptions(...[e]){this.headerConfig=Object.assign({},e);const{value:t,query:i}=this.meta,s=this.spreadsheet.dataCfg.sortParams||[],o=this.isSortCell(),n=(0,a.find)([...s].reverse(),e=>o&&(null==e?void 0:e.sortByMeasure)===t&&(0,a.isEqual)((0,a.get)(e,"query"),i)),r=bi(n,o);this.headerConfig.sortParam=Object.assign(Object.assign(Object.assign({},this.headerConfig.sortParam),n||{query:i}),{type:r})}initCell(){this.resetTextAndConditionIconShapes(),this.actionIcons=[],this.hasDefaultHiddenIcon=!1,this.generateIconConfig()}generateIconConfig(){var e,t;this.conditionIconMappingResult=this.getIconConditionResult();const{sortParam:i}=this.getHeaderConfig();this.actionIconConfig=this.showSortIcon()?{icons:[{name:(null==i?void 0:i.type)||"none",position:"right"}],belongsCell:this.cellType,isSortIcon:!0}:(0,re.AS)(this.spreadsheet.options.headerActionIcons,this.meta,this.cellType),this.groupedIcons=(0,re.y0)(null!==(t=null===(e=this.actionIconConfig)||void 0===e?void 0:e.icons)&&void 0!==t?t:[],this.conditionIconMappingResult)}getFormattedFieldValue(){const{isTotalRoot:e,isGrandTotals:t,value:i}=this.meta,s=this.spreadsheet.dataSet.getFieldFormatter(this.meta.field);let o=!0;o=!this.spreadsheet.isTableMode()&&(this.spreadsheet.isHierarchyTreeType()?!(t&&e):!e);return{formattedValue:o&&s?s(i,void 0,this.meta):i,value:i}}shouldShowDefaultHeaderActionIcon(){return this.spreadsheet.options.showDefaultHeaderActionIcon}showSortIcon(){const{dataCfg:e}=this.spreadsheet,t=(0,a.isEmpty)(e.fields.values);if(this.shouldShowDefaultHeaderActionIcon()&&!t){const{sortParam:e}=this.getHeaderConfig(),t=this.meta.query;return this.isShallowRender()?t:t&&(0,a.isEqual)(null==e?void 0:e.query,t)&&(null==e?void 0:e.type)&&"none"!==(null==e?void 0:e.type)}return!1}getActionIconStyle(e){const{icon:t}=this.getStyle(),i=this.getTextConditionMappingResult(),s=(null==i?void 0:i.fill)||this.getTextStyle().fill;return{width:null==t?void 0:t.size,height:null==t?void 0:t.size,fill:null===e.fill?void 0:(null==e?void 0:e.fill)||(null==t?void 0:t.fill)||s,cursor:"pointer"}}hasDefaultHideActionIcon(){return this.hasDefaultHiddenIcon}addActionIcon(e){var t;const{x:i,y:s,name:o,defaultHide:n,onClick:r,onHover:l,isSortIcon:a}=e,d=new ie.r(Object.assign(Object.assign({},this.getActionIconStyle(e)),{name:o,x:i,y:s,iconStrategy:null===(t=this.spreadsheet.options.csp)||void 0===t?void 0:t.iconStrategy}));d.toggleVisibility(!n),d.addEventListener("mouseover",e=>{this.spreadsheet.emit(m.GLOBAL_ACTION_ICON_HOVER,e),null==l||l({hovering:!0,name:o,meta:this.meta,event:e})}),d.addEventListener("mouseleave",e=>{this.spreadsheet.emit(m.GLOBAL_ACTION_ICON_HOVER_OFF,e),null==l||l({hovering:!1,name:o,meta:this.meta,event:e})}),d.addEventListener("click",e=>{this.spreadsheet.emit(m.GLOBAL_ACTION_ICON_CLICK,e),a?this.spreadsheet.handleGroupSort(e,this.meta):null==r||r({name:o,meta:this.meta,event:e})}),this.actionIcons.push(d),this.appendChild(d)}drawActionAndConditionIcons({updatePositionOnly:e=!1}={}){if((0,a.isEmpty)(this.groupedIcons.left)&&(0,a.isEmpty)(this.groupedIcons.right))return;if(!this.leftIconPosition||!this.rightIconPosition)return;let t=0;(0,a.forEach)(this.groupedIcons,(i,s)=>{const{size:o,margin:n}=this.getStyle().icon,r=n.right,l="left"===s?this.leftIconPosition:this.rightIconPosition;(0,a.forEach)(i,(i,s)=>{var n,a,d,c,h;const u=l.x+(o+r)*s,p=l.y;if(i.isConditionIcon){const t={x:u,y:p,name:i.name,width:o,height:o,fill:i.fill,iconStrategy:null===(n=this.spreadsheet.options.csp)||void 0===n?void 0:n.iconStrategy};if(this.conditionIconShape){if(e)return void this.conditionIconShape.updatePosition({x:u,y:p});this.conditionIconShape.reRender(t)}else this.conditionIconShape=(0,w.sH)(this,t);return void this.addConditionIconShape(this.conditionIconShape)}if(e)return void(null===(a=this.actionIcons[t++])||void 0===a||a.updatePosition({x:u,y:p}));const{onClick:g,onHover:m,defaultHide:v,isSortIcon:f}=this.actionIconConfig,C=null!==(d=i.defaultHide)&&void 0!==d?d:v,y="function"==typeof C?C(this.meta,i.name):C;y&&(this.hasDefaultHiddenIcon=!0),this.addActionIcon({name:i.name,fill:i.fill,x:u,y:p,defaultHide:y,onClick:null!==(c=i.onClick)&&void 0!==c?c:g,onHover:null!==(h=i.onHover)&&void 0!==h?h:m,isSortIcon:f})})})}isSortCell(){var e,t,i;const s=null===(t=null===(e=this.spreadsheet)||void 0===e?void 0:e.isValueInCols)||void 0===t?void 0:t.call(e),o=this.meta.level===(null===(i=this.meta.hierarchy)||void 0===i?void 0:i.maxLevel);return s?o&&this.cellType===d.vZ.COL_CELL:o&&this.cellType===d.vZ.ROW_CELL}handleByStateName(e,t){we(e,this)&&this.updateByState(t)}handleSearchResult(e){if(!we(e,this))return;(0,a.find)(e,e=>null==e?void 0:e.isTarget).id===this.getMeta().id?this.updateByState(d.xT.HIGHLIGHT):this.updateByState(d.xT.SEARCH_RESULT)}handleHover(e){var t;we(e,this)&&(this.updateByState(d.xT.HOVER),this.hasDefaultHideActionIcon()&&this.toggleActionIcon(null===(t=null==e?void 0:e[0])||void 0===t?void 0:t.id))}handleSelect(e,t=[]){we(e,this)&&this.updateByState(d.xT.SELECTED);const i=(0,a.map)(t,"id");(0,a.includes)(i,this.meta.id)&&this.updateByState(d.xT.SELECTED)}getTextStyle(){const e=this.getCellTextWordWrapStyle(),{text:t,bolderText:i,measureText:s}=this.getStyle();let o;return o=this.isMeasureField()?s||t:this.isBolderText()?i:t,this.getContainConditionMappingResultTextStyle(Object.assign(Object.assign({},e),o))}getBackgroundColor(){var e;const{backgroundColor:t,backgroundColorOpacity:i}=(null===(e=this.getStyle())||void 0===e?void 0:e.cell)||{};return(0,a.merge)({backgroundColor:t,backgroundColorOpacity:i},this.getBackgroundConditionFill())}toggleActionIcon(e){if(this.getMeta().id===e){const e=[];(0,a.forEach)(this.actionIcons,t=>{"visible"!==t.parsedStyle.visibility&&(t.toggleVisibility(!0),e.push(t))}),this.spreadsheet.store.set("visibleActionIcons",e)}}getIconPosition(){return this.leftIconPosition||this.rightIconPosition}getInteractedCells(){var e;return null===(e=this.spreadsheet.interaction)||void 0===e?void 0:e.getCells([d.vZ.CORNER_CELL,d.vZ.COL_CELL,d.vZ.ROW_CELL,d.vZ.SERIES_NUMBER_CELL])}update(){const{interaction:e}=this.spreadsheet,t=null==e?void 0:e.getState();if((null==t?void 0:t.stateName)===d.xT.ALL_SELECTED)return void this.updateByState(d.xT.SELECTED);const i=this.getInteractedCells();if((0,a.first)(i))switch(null==t?void 0:t.stateName){case d.xT.SELECTED:case d.xT.ROW_CELL_BRUSH_SELECTED:case d.xT.COL_CELL_BRUSH_SELECTED:this.handleSelect(i,null==t?void 0:t.nodes);break;case d.xT.HOVER_FOCUS:case d.xT.HOVER:this.handleHover(i);break;case d.xT.SEARCH_RESULT:this.handleSearchResult(i);break;default:this.handleByStateName(i,null==t?void 0:t.stateName)}}updateByState(e){super.updateByState(e,this)}hideInteractionShape(){super.hideInteractionShape()}isMeasureField(){return[ye.GJ,ye.B7].includes(this.meta.field)}mappingValue(e){var t;const i=this.getMeta().value;return null===(t=e.mapping)||void 0===t?void 0:t.call(e,i,this.meta,this)}findFieldCondition(e=[]){return(0,ue.NV)(e,this.meta.field)}getTreeIcon(){return this.treeIcon}getActionIcons(){return this.actionIcons||[]}getMetaField(){return this.meta.field}addMobileTouchListener(e){if(this.hasMobileTouchListeners)return;this.hasMobileTouchListeners=!0;let t=null;const i=e=>{var i,s;const o=e.nativeEvent,n=(null===(i=o.touches)||void 0===i?void 0:i[0])||(null===(s=o.changedTouches)||void 0===s?void 0:s[0]);n&&(t={x:n.clientX,y:n.clientY})},s=i=>{var s;const o=null===(s=i.nativeEvent.changedTouches)||void 0===s?void 0:s[0];if(!o||!t)return;const n=Math.abs(o.clientX-t.x),r=Math.abs(o.clientY-t.y);n<10&&r<10&&e(),t=null},o=()=>{t=null};this.mobileTouchHandlers={onTouchStart:i,onTouchEnd:s,onTouchCancel:o},this.addEventListener("touchstart",i),this.addEventListener("touchend",s),this.addEventListener("touchcancel",o)}destroy(){this.mobileTouchHandlers&&(this.removeEventListener("touchstart",this.mobileTouchHandlers.onTouchStart),this.removeEventListener("touchend",this.mobileTouchHandlers.onTouchEnd),this.removeEventListener("touchcancel",this.mobileTouchHandlers.onTouchCancel),this.mobileTouchHandlers=void 0),this.meta.belongsCell=null,super.destroy()}reInitCell(e,t){this.setMeta(e),this.handleRestOptions(t,void 0),this.initCell()}setHeaderConfig(e){this.handleRestOptions(e,void 0),this.updateTextPosition(),this.drawActionAndConditionIcons({updatePositionOnly:!0})}}class Ti extends Li{get cellType(){return d.vZ.COL_CELL}getBorderPositions(){return[v.cV.TOP,v.cV.RIGHT]}initCell(){super.initCell(),this.drawBackgroundShape(),this.drawInteractiveBgShape(),this.drawInteractiveBorderShape(),this.drawTextOrCustomRenderer()}afterDrawText(){this.drawActionAndConditionIcons(),this.drawBorders(),this.drawResizeArea(),this.addExpandColumnIconShapes(),this.update()}getFormattedFieldValue(){var e;const{extra:t,value:i,field:s}=this.meta,{fields:o}=this.spreadsheet.dataSet;return(null==t?void 0:t.isCustomNode)&&(null===(e=null==o?void 0:o.values)||void 0===e?void 0:e.includes(s))?{formattedValue:i,value:i}:super.getFormattedFieldValue()}getMaxTextWidth(){const{width:e}=this.getBBoxByType(v.Ok.CONTENT_BOX);return e-this.getActionAndConditionIconWidth()}isBolderText(){const{isLeaf:e,isTotals:t}=this.meta;return!(!t&&e)}handleViewport(){if(this.meta.isFrozen)return{start:0,size:Number.POSITIVE_INFINITY};const{viewportWidth:e,cornerWidth:t=0,scrollX:i=0}=this.getHeaderConfig(),o=this.spreadsheet.facet.frozenGroupAreas,n=o[s.Col].width,r=o[s.TrailingCol].width;return this.spreadsheet.isFrozenRowHeader()?{start:i+n,size:e-n-r}:{start:n+Math.max(0,i-t),size:e-n-r+Math.min(i,t)}}getContentPosition({contentWidth:e=this.getActualTextWidth()}={}){var t,i,s;const{isLeaf:o}=this.meta,n=this.getTextStyle(),r=this.getBBoxByType(v.Ok.CONTENT_BOX),l=this.getIconStyle(),a=(0,R.l2)(r,n.textBaseline),d=(0,R.Bh)(l.size,a,n.fontSize,n.textBaseline);if(o){const{textX:t,leftIconX:i,rightIconX:s}=(0,R.Cb)({bbox:r,textWidth:e,textAlign:n.textAlign,groupedIcons:this.groupedIcons,iconStyle:l,isCustomRenderer:!!this.getRenderer()});return this.leftIconPosition={x:i,y:d},this.rightIconPosition={x:s,y:d},{x:t,y:a}}const c=this.handleViewport(),{cell:h,icon:u}=this.getStyle(),{textAlign:p,textBaseline:g}=this.getTextStyle(),{textStart:m,iconStart:f,iconEnd:C}=N(c,{start:r.x,size:r.width},{align:I(p),size:{textSize:e,iconStartSize:this.getActionAndConditionIconWidth("left"),iconEndSize:this.getActionAndConditionIconWidth("right")},padding:{start:null===(t=null==h?void 0:h.padding)||void 0===t?void 0:t.left,end:null===(i=null==h?void 0:h.padding)||void 0===i?void 0:i.right,betweenTextAndEndIcon:null===(s=null==u?void 0:u.margin)||void 0===s?void 0:s.left}},{isCustomRenderer:!!this.getRenderer()}),y=(0,R.l2)(r,g);return this.leftIconPosition={x:f,y:d},this.rightIconPosition={x:C,y:d},{x:m,y}}getTextPosition(){return this.getContentPosition()}getColResizeArea(){return j(this.spreadsheet,h.E2)}getHorizontalResizeAreaName(){return`${h.YD}${this.meta.field}`}isCrossColumnLeafNode(){var e;const{colsHierarchy:t}=this.spreadsheet.facet.getLayoutResult(),{level:i,isLeaf:s}=this.meta;return(null===(e=null==t?void 0:t.sampleNodeForLastLevel)||void 0===e?void 0:e.level)!==i&&s}drawHorizontalResizeArea(){var e,t;if(0===(null===(t=null===(e=this.spreadsheet.options.style)||void 0===e?void 0:e.colCell)||void 0===t?void 0:t.height)||!this.shouldDrawResizeAreaByType("colCellVertical",this))return;const{y:i,height:s}=this.meta,{position:o}=this.getHeaderConfig(),n=this.getResizeAreaStyle(),r=this.getColResizeArea();if(!r||this.isCrossColumnLeafNode())return;const l=this.getHorizontalResizeAreaName();if(null==r?void 0:r.find(e=>e.name===l))return;const a=o.y+i,d=this.getResizeAreaWidth(),c=P({theme:n,type:u.Vertical,effect:p.Field,offsetX:0,offsetY:a,width:d,height:s,meta:this.meta,cell:this}),h=Object.assign(Object.assign({},c.style),{x:0,y:a+s-n.size,width:d});this.horizontalResizeArea?(this.horizontalResizeArea.name=l,this.horizontalResizeArea.appendInfo=c.appendInfo,(0,B.w)(this.horizontalResizeArea,h)):this.horizontalResizeArea=r.appendChild(new f({name:l,style:h},c.appendInfo))}getResizeAreaWidth(){const{cornerWidth:e=0,viewportWidth:t}=this.getHeaderConfig();return T.getVerticalBorderWidth(this.spreadsheet)+e+t}shouldAddVerticalResizeArea(){if(this.getMeta().isFrozen)return!0;const{x:e,y:t,width:i,height:o}=this.meta,{scrollX:n=0,scrollY:r,cornerWidth:l=0,height:a,width:d}=this.getHeaderConfig(),c=this.getResizeAreaStyle(),h={x:e+i-c.size,y:t,width:c.size,height:o},u=this.spreadsheet.facet.frozenGroupAreas,p=u[s.Col].width,g=u[s.TrailingCol].width;let m;return m=this.spreadsheet.isFrozenRowHeader()?{x:p,y:0,width:d-p-g,height:a}:{x:p-l,y:0,width:d-p-g+l,height:a},W(h,m,{scrollX:n,scrollY:r})}getVerticalResizeAreaOffset(){const{x:e,y:t}=this.meta,{scrollX:i=0,position:o,cornerWidth:n=0,viewportWidth:r}=this.getHeaderConfig(),l=this.spreadsheet.isFrozenRowHeader(),a=this.spreadsheet.facet.frozenGroupAreas,d=a[s.Col],c=a[s.TrailingCol];let h=null==o?void 0:o.x;return this.getMeta().isFrozenHead?h+=e-d.x-(l?0:Math.min(i,n)):this.getMeta().isFrozenTrailing?h+=e-c.x+r-c.width:h+=e-i,{x:h,y:(null==o?void 0:o.y)+t}}drawVerticalResizeArea(){if(!this.meta.isLeaf||this.meta.hideColCellHorizontalResize||!this.shouldDrawResizeAreaByType("colCellHorizontal",this))return;const{width:e,height:t}=this.meta,i=this.getResizeAreaStyle(),s=this.getColResizeArea();if(!s)return;if(!this.shouldAddVerticalResizeArea())return void(this.verticalResizeArea&&(this.verticalResizeArea.style.visibility="hidden"));const{x:o,y:n}=this.getVerticalResizeAreaOffset(),r=P({theme:i,type:u.Horizontal,effect:p.Cell,offsetX:o,offsetY:n,width:e,height:t,meta:this.meta,cell:this}),l=Object.assign(Object.assign({},r.style),{x:o+e-i.size,y:n,height:t,visibility:"visible"});this.verticalResizeArea?(this.verticalResizeArea.appendInfo=r.appendInfo,(0,B.w)(this.verticalResizeArea,l)):this.verticalResizeArea=s.appendChild(new f({style:l},r.appendInfo))}drawResizeArea(){this.drawHorizontalResizeArea(),this.drawVerticalResizeArea()}hasHiddenColumnCell(){const{interaction:e}=this.spreadsheet.options,t=this.spreadsheet.store.get("hiddenColumnsDetail",[]);return!(0,a.isEmpty)(t)&&!(0,a.isEmpty)(null==e?void 0:e.hiddenColumnFields)&&!!t.find(e=>z(null==e?void 0:e.displaySiblingNode,this.meta.id,this.isLastColumn()?"prev":"next"))}getExpandIconTheme(){return this.getStyle().icon}addExpandColumnSplitLine(){const{x:e,y:t,width:i,height:s}=this.getBBoxByType(),{horizontalBorderColor:o,horizontalBorderColorOpacity:n}=this.theme.splitLine,r=this.isLastColumn()?e+i:e;(0,w.ni)(this,{x1:r,y1:t,x2:r,y2:t+s,stroke:o,lineWidth:1,strokeOpacity:n})}addExpandColumnIconShapes(){this.hasHiddenColumnCell()&&(this.addExpandColumnSplitLine(),this.addExpandColumnIcons())}addExpandColumnIcons(){const e=this.isLastColumn();this.addExpandColumnIcon(e),this.isAllDisplaySiblingNodeHidden()&&e&&this.addExpandColumnIcon(!1)}addExpandColumnIcon(e){var t;const i=this.getExpandColumnIconConfig(e),s=(0,w.sH)(this,Object.assign(Object.assign({},i),{name:"ExpandColIcon",cursor:"pointer",iconStrategy:null===(t=this.spreadsheet.options.csp)||void 0===t?void 0:t.iconStrategy}));s.addEventListener("click",()=>{this.spreadsheet.emit(m.COL_CELL_EXPANDED,this.meta,e?"prev":"next")}),s.addEventListener("mouseenter",t=>{this.spreadsheet.emit(m.COL_CELL_EXPAND_ICON_HOVER,{event:t,meta:this.meta,hiddenColumns:F(this.spreadsheet,this.meta.id,e?"prev":"next")})})}getExpandColumnIconConfig(e){const{size:t=0}=this.getExpandIconTheme(),{x:i,y:s,width:o,height:n}=this.getBBoxByType(),r=i-t;return{x:e?r+o:r,y:s+n/2-t/2,width:2*t,height:t}}isLastColumn(){return((e,t)=>{const i=e.facet.getColLeafNodes(),s=e.facet.getInitColIndexLeafNodes(),o=M(t);return(0,a.get)((0,a.last)(i),o)===t&&(0,a.get)((0,a.last)(s),o)!==t})(this.spreadsheet,this.meta.id)}isAllDisplaySiblingNodeHidden(){const{id:e}=this.meta,t=this.spreadsheet.store.get("hiddenColumnsDetail",[]),i=t.find(({displaySiblingNode:t})=>{var i;return(null===(i=null==t?void 0:t.next)||void 0===i?void 0:i.id)===e});return t.find(({displaySiblingNode:t})=>{var i;return(null===(i=null==t?void 0:t.prev)||void 0===i?void 0:i.id)===e})&&i}getResizedTextMaxLines(){var e,t,i,s,o;const{colCell:n}=this.spreadsheet.options.style;return null!==(s=null!==(t=null===(e=null==n?void 0:n.maxLinesByField)||void 0===e?void 0:e[this.meta.id])&&void 0!==t?t:null===(i=null==n?void 0:n.maxLinesByField)||void 0===i?void 0:i[this.meta.field])&&void 0!==s?s:this.getMaxLinesByCustomHeight({isCustomHeight:null===(o=this.meta.extra)||void 0===o?void 0:o.isCustomHeight})}shouldShowDefaultHeaderActionIcon(){return this.spreadsheet.options.showDefaultHeaderActionIcon&&this.spreadsheet.isValueInCols()}setHeaderConfig(e){super.setHeaderConfig(e),this.drawResizeArea()}}var Oi=i("./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/utils/g-mini-charts.js");class Ri extends Ce{get cellType(){return d.vZ.DATA_CELL}isShallowRender(){return super.isShallowRender()||this.meta.shallowRender||!1}isMultiData(){const e=this.getFieldValue();return(0,a.isObject)(e)}getBorderPositions(){return[v.cV.BOTTOM,v.cV.RIGHT]}getValueRange(){return this.spreadsheet.dataSet.getValueRangeByField(this.meta.valueField)}handleByStateName(e,t){we(e,this)&&this.updateByState(t)}handleSearchResult(e){if(!we(e,this))return;(0,a.find)(e,e=>null==e?void 0:e.isTarget).id===this.getMeta().id?this.updateByState(d.xT.HIGHLIGHT):this.updateByState(d.xT.SEARCH_RESULT)}handleSelect(e){var t,i;switch(null===(t=null==e?void 0:e[0])||void 0===t?void 0:t.type){case d.vZ.COL_CELL:this.changeRowColSelectState("colIndex");break;case d.vZ.ROW_CELL:this.changeRowColSelectState("rowIndex");break;case d.vZ.DATA_CELL:(e=>{const{currentRow:t,currentCol:i,rowHeader:s,colHeader:o}=e.interaction.getSelectedCellHighlight();return t||i||s||o})(this.spreadsheet)?Se(e,this,this.spreadsheet):we(e,this)?this.updateByState(d.xT.SELECTED):(null===(i=this.spreadsheet.options.interaction)||void 0===i?void 0:i.selectedCellsSpotlight)&&this.updateByState(d.xT.UNSELECTED)}}isDisableHover(e){return e.type!==d.vZ.DATA_CELL}handleHover(e){const t=(0,a.first)(e);if(this.isDisableHover(t))return void this.hideInteractionShape();const{currentRow:i,currentCol:s}=this.spreadsheet.interaction.getHoverHighlight();if(i||s){s&&this.meta.colIndex===(null==t?void 0:t.colIndex)||i&&this.meta.rowIndex===(null==t?void 0:t.rowIndex)?this.updateByState(d.xT.HOVER):this.hideInteractionShape()}const{id:o,rowIndex:n,colIndex:r}=this.getMeta();(0,a.isEqual)(t.id,o)&&(0,a.isEqual)(t.rowIndex,n)&&(0,a.isEqual)(t.colIndex,r)&&this.updateByState(d.xT.HOVER_FOCUS)}update(){const e=this.spreadsheet.interaction.getCurrentStateName();if(e===d.xT.ALL_SELECTED)return void this.updateByState(d.xT.SELECTED);const t=this.spreadsheet.interaction.getCells();if(!(0,a.isEmpty)(t)&&e)switch(e){case d.xT.SELECTED:case d.xT.DATA_CELL_BRUSH_SELECTED:this.handleSelect(t);break;case d.xT.HOVER_FOCUS:case d.xT.HOVER:this.handleHover(t);break;case d.xT.SEARCH_RESULT:this.handleSearchResult(t);break;default:this.handleByStateName(t,e)}}setMeta(e){super.setMeta(e),this.isShallowRender()||this.initCell()}drawTextShape(){super.drawTextShape(),this.isShallowRender()||this.drawLinkField(this.meta)}initCell(){this.resetTextAndConditionIconShapes(),this.generateIconConfig(),this.shouldHideData=!!this.shouldHideRowSubtotalData(),this.conditionFill=this.getBackgroundConditionFill(),this.drawBackgroundShape(),this.drawInteractiveBgShape(),this.shouldHideData||this.drawConditionIntervalShape(),this.shouldHideData?this.afterDrawText():this.drawTextOrCustomRenderer()}afterDrawText(){this.shouldHideData||this.drawConditionIconShapes(),this.drawBorders(),this.drawInteractiveBorderShape(),this.update()}generateIconConfig(){var e;const t=this.findFieldCondition(null===(e=this.conditions)||void 0===e?void 0:e.icon),i=t&&t.mapping&&{name:"",position:(0,ue.dq)(t)};this.groupedIcons=(0,re.y0)([],i)}getTextStyle(){const e=this.getCellTextWordWrapStyle(),{isTotals:t}=this.meta,{dataCell:i}=this.theme,s=t?null==i?void 0:i.bolderText:null==i?void 0:i.text;return this.getContainConditionMappingResultTextStyle(Object.assign(Object.assign({},e),s))}drawConditionIntervalShape(){this.conditionIntervalShape=(0,Oi.U4)(this)}shouldHideRowSubtotalData(){var e,t;if(!this.spreadsheet.isHierarchyTreeType())return!1;const{rowId:i,rowIndex:s}=this.meta,o=this.spreadsheet.store.get("drillDownIdPathMap");if(null==o?void 0:o.has(i))return!1;const{row:n={}}=null!==(e=this.spreadsheet.options.totals)&&void 0!==e?e:{},r=null===(t=this.spreadsheet.facet)||void 0===t?void 0:t.getRowLeafNodeByIndex(s);return!n.showSubTotals&&(!(null==r?void 0:r.isGrandTotals)&&(null==r?void 0:r.isTotals))}getFormattedFieldValue(){var e;if(this.shouldHideData)return{value:null,formattedValue:"-"};const{rowId:t,valueField:i,fieldValue:s,data:o,id:n}=this.meta,r=null===(e=this.spreadsheet.dataSet.displayFormattedValueMap)||void 0===e?void 0:e.get(n),l=this.spreadsheet.dataSet.getFieldMeta(t),a=this.spreadsheet.dataSet.getFieldFormatter(l?t:i);return{value:s,formattedValue:null!=r?r:a(s,o,this.meta)}}getMaxTextWidth(){const{width:e}=this.getBBoxByType(v.Ok.CONTENT_BOX);return e-this.getActionAndConditionIconWidth()}getContentPosition({contentWidth:e=this.getActualTextWidth()}={}){const t=this.getBBoxByType(v.Ok.CONTENT_BOX),i=this.getTextStyle(),s=this.getIconStyle(),{textX:o,leftIconX:n,rightIconX:r}=(0,R.Cb)({bbox:t,iconStyle:s,textWidth:e,textAlign:i.textAlign,groupedIcons:this.groupedIcons,isCustomRenderer:!!this.getRenderer()}),l=(0,R.l2)(t,i.textBaseline),d=(0,R.Bh)(s.size,l,i.fontSize,i.textBaseline);return this.iconPosition={x:(0,a.isEmpty)(this.groupedIcons.left)?r:n,y:d},{x:o,y:l}}getTextPosition(){return this.getContentPosition()}getIconPosition(){return this.iconPosition}getBackgroundColor(){const e=this.getCrossBackgroundColor(this.meta.rowIndex),t=e.backgroundColor,i=e.backgroundColorOpacity;return this.shouldHideData?{backgroundColor:t,backgroundColorOpacity:i,intelligentReverseTextColor:!1}:(0,a.merge)({backgroundColor:t,backgroundColorOpacity:i},this.conditionFill)}changeRowColSelectState(e){var t,i,s;const{interaction:o}=this.spreadsheet,n=(0,a.get)(this.meta,e),{nodes:r=[],cells:l=[]}=o.getState();let c=!1;if(this.spreadsheet.isTableMode()&&r.length){c=((null===(i=null===(t=r[0])||void 0===t?void 0:t.hierarchy)||void 0===i?void 0:i.getLeaves())||[]).some((e,t)=>!!r.some(t=>t===e)&&t===n)}else c=[...r,...l].some(t=>(0,a.get)(t,e)===n);c?this.updateByState(d.xT.SELECTED):(null===(s=this.spreadsheet.options.interaction)||void 0===s?void 0:s.selectedCellsSpotlight)?this.updateByState(d.xT.UNSELECTED):this.hideInteractionShape()}drawBorders(){this.meta.isFrozenCorner&&Ce.prototype.drawBorders.call(this)}findFieldCondition(e=[]){return(0,ue.NV)(e,this.meta.valueField)}mappingValue(e){var t;const i=this.meta.fieldValue,s=this.spreadsheet.isTableMode()?this.spreadsheet.dataSet.getCellData({query:{rowIndex:this.meta.rowIndex}}):ci.getFieldValue(this.meta.data);return null===(t=e.mapping)||void 0===t?void 0:t.call(e,i,s,this)}updateByState(e){if(super.updateByState(e,this),e===d.xT.UNSELECTED){const t=(0,a.get)(this.theme,`${this.cellType}.cell.interactionState.${e}`);t&&this.toggleConditionIntervalShapeOpacity(t.opacity)}}clearUnselectedState(){super.clearUnselectedState(),this.toggleConditionIntervalShapeOpacity(1)}toggleConditionIntervalShapeOpacity(e){(0,w.O3)(this.conditionIntervalShape,d.lE.backgroundOpacity,e),(0,w.O3)(this.conditionIconShapes,d.lE.opacity,e)}getResizedTextMaxLines(){var e,t,i,s;const{rowCell:o}=this.spreadsheet.options.style;return null!==(s=null!==(t=null===(e=null==o?void 0:o.maxLinesByField)||void 0===e?void 0:e[this.meta.id])&&void 0!==t?t:null===(i=null==o?void 0:o.maxLinesByField)||void 0===i?void 0:i[this.meta.rowId])&&void 0!==s?s:this.getMaxLinesByCustomHeight({isCustomHeight:!0})}getMetaField(){return this.meta.valueField}}const Ii=he({brandColor:"#3471F9",semanticColors:{red:"#FF4D4F",green:"#29A294",yellow:"#FAAD14"},others:{highlight:"#87B5FF",results:"#F0F7FF"},basicColorRelations:[{basicColorIndex:1,standardColorIndex:0},{basicColorIndex:2,standardColorIndex:1},{basicColorIndex:3,standardColorIndex:5},{basicColorIndex:4,standardColorIndex:6},{basicColorIndex:5,standardColorIndex:6},{basicColorIndex:6,standardColorIndex:6},{basicColorIndex:7,standardColorIndex:5},{basicColorIndex:9,standardColorIndex:1},{basicColorIndex:10,standardColorIndex:4},{basicColorIndex:11,standardColorIndex:4},{basicColorIndex:12,standardColorIndex:5}]}),Ni=he({brandColor:"#326EF4",semanticColors:{red:"#FF4D4F",green:"#29A294",yellow:"#FAAD14"},others:{highlight:"#87B5FF",results:"#F0F7FF"},basicColorRelations:[{basicColorIndex:1,standardColorIndex:0},{basicColorIndex:2,standardColorIndex:1},{basicColorIndex:3,standardColorIndex:1},{basicColorIndex:4,standardColorIndex:2},{basicColorIndex:5,standardColorIndex:7},{basicColorIndex:6,standardColorIndex:5},{basicColorIndex:7,standardColorIndex:5},{basicColorIndex:9,standardColorIndex:1},{basicColorIndex:10,standardColorIndex:2},{basicColorIndex:11,standardColorIndex:5},{basicColorIndex:12,standardColorIndex:5}]}),Bi=he({brandColor:"#9DA7B6",semanticColors:{red:"#FF4D4F",green:"#29A294",yellow:"#FAAD14"},others:{highlight:"#87B5FF",results:"#F0F7FF"},basicColorRelations:[{basicColorIndex:1,standardColorIndex:0},{basicColorIndex:2,standardColorIndex:1},{basicColorIndex:3,standardColorIndex:1},{basicColorIndex:4,standardColorIndex:2},{basicColorIndex:5,standardColorIndex:7},{basicColorIndex:6,standardColorIndex:8},{basicColorIndex:7,standardColorIndex:5},{basicColorIndex:9,standardColorIndex:1},{basicColorIndex:10,standardColorIndex:2},{basicColorIndex:11,standardColorIndex:3},{basicColorIndex:12,standardColorIndex:3}]});var Ai=i("./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/common/constant/classnames.js");const Mi={default:Ni,colorful:Ii,gray:Bi,dark:{brandColor:"#255dff",semanticColors:{red:"#FF4D4F",green:"#29A294",yellow:"#FAAD14"},basicColors:["#ffffff","#151a27","#213f94","#133aad","#213f94","#255dff","#4b91ff","#4b91ff","#191919","#1e2436","#0647b1","#7899ff","#7899ff","#f0f0f0","#dcdcdc"],basicColorRelations:[]}},Di="Roboto, PingFangSC, Microsoft YaHei, Arial, sans-serif",Hi=`${Ai.u}-dark-theme`,ki=e=>Mi[e]||Mi.default;class zi extends Ri{getLinkFieldStyle(){return this.theme.rowCell.text.linkTextFill}getTextStyle(){if(this.meta.valueField===ye.r2){const e=this.getCellTextWordWrapStyle(d.vZ.SERIES_NUMBER_CELL),t=this.theme.rowCell.seriesText;return Object.assign(Object.assign({},e),t)}return super.getTextStyle()}shouldDrawResizeArea(){const e=`${this.meta.rowIndex}`,t=j(this.spreadsheet,h.k5);return!(null==t?void 0:t.getElementById(e))}drawResizeArea(){if(!this.shouldDrawResizeArea())return;const e=j(this.spreadsheet,h.k5);if(!e)return;const{rowIndex:t}=this.getMeta(),i=this.spreadsheet.facet.getCellRange(),{rowCount:o,trailingRowCount:n}=this.spreadsheet.facet.getFrozenOptions(),r=S(t,i.start,o),l=b(t,i.end,n),a=r||l,{y:d,height:c}=this.getBBoxByType(),{x:g,y:m,viewportWidth:v,viewportHeight:C}=this.spreadsheet.facet.panelBBox,{scrollY:y}=this.spreadsheet.facet.getScrollOffset(),w=this.spreadsheet.facet.getPaginationScrollY(),x=this.spreadsheet.facet.frozenGroupAreas,_=x[s.Row],E=x[s.TrailingRow],L=this.getResizeAreaStyle(),T=g+v;if(!W({x:0,y:d+c-L.size,width:T,height:L.size},{x:0,y:a?0:_.height,width:T,height:a?Number.POSITIVE_INFINITY:C-_.height-E.height},{scrollX:0,scrollY:a?0:w+y}))return;let O=m;O+=r?d-_.y:l?C-E.height+d-E.y:d-w-y;const R=P({theme:L,type:u.Vertical,effect:p.Cell,offsetX:0,offsetY:O,width:T,height:c,meta:this.meta,cell:this});e.appendChild(new f({style:Object.assign(Object.assign({},R.style),{x:0,y:O+c-L.size,width:T})},R.appendInfo))}isDisableHover(e){return(null==e?void 0:e.type)===d.vZ.COL_CELL}getResizedTextMaxLines(){var e,t,i,s,o;const{facet:n,options:r}=this.spreadsheet,{rowCell:l}=r.style,{id:a,rowId:d,rowIndex:c}=this.meta;return null!==(s=null!==(t=null===(e=null==l?void 0:l.maxLinesByField)||void 0===e?void 0:e[a])&&void 0!==t?t:null===(i=null==l?void 0:l.maxLinesByField)||void 0===i?void 0:i[d])&&void 0!==s?s:this.getMaxLinesByCustomHeight({isCustomHeight:null===(o=null==n?void 0:n.customRowHeightStatusMap)||void 0===o?void 0:o[c]})}}class Fi extends zi{get cellType(){return d.vZ.DATA_CELL}}class Pi{constructor(e){this.displayFormattedValueMap=new Map,this.getField=e=>((0,a.isString)(e)?e:null==e?void 0:e.field)||e,this.getFieldMeta=(0,a.memoize)((e,t)=>{const i=this.getField(e);return(0,a.find)(this.meta||t,({field:e})=>e instanceof RegExp?e.test(i):(0,a.isArray)(e)?e.includes(i):e===i)}),this.getCustomFieldDescription=e=>{var t,i;if(!e)return;const s=null===(t=e.getMeta)||void 0===t?void 0:t.call(e);if(!(null==s?void 0:s.isTotals)){if(e.cellType===d.vZ.DATA_CELL){const e=(0,a.find)(null==s?void 0:s.spreadsheet.dataCfg.meta,{field:(null==s?void 0:s.field)||(null==s?void 0:s.value)||(null==s?void 0:s.valueField)});return this.getFieldDescription(null==e?void 0:e.field)}return(null===(i=null==s?void 0:s.extra)||void 0===i?void 0:i.description)||this.getFieldDescription(null==s?void 0:s.field)}},this.spreadsheet=e}getFieldName(e,t){var i,s,o,n;if(e===ye.r2)return null===(i=this.spreadsheet)||void 0===i?void 0:i.getSeriesNumberText();const r=this.getField(e);let l;(null===(s=this.spreadsheet)||void 0===s?void 0:s.isCustomHeaderFields())&&(l=null===(n=null===(o=this.spreadsheet)||void 0===o?void 0:o.facet)||void 0===n?void 0:n.getHeaderNodes().find(e=>{var t;return e.field===r&&(null===(t=null==e?void 0:e.extra)||void 0===t?void 0:t.isCustomNode)}));const d=(null==l?void 0:l.value)||((0,a.isString)(e)?e:null==e?void 0:e.title)||e;return(0,a.get)(this.getFieldMeta(r,this.meta),"name",(0,fe.F)(null!=t?t:d))}getCustomRowFieldName(e){var t;if(!e)return;const i=null===(t=e.getMeta)||void 0===t?void 0:t.call(e);if(e.cellType===d.vZ.DATA_CELL){const e=this.spreadsheet.facet.getRowNodeByIndex(null==i?void 0:i.rowIndex);return(null==e?void 0:e.value)||this.getFieldName(null==e?void 0:e.field)}return(null==i?void 0:i.value)||this.getFieldName(null==i?void 0:i.field)}getFieldFormatter(e){const t=this.getField(e),i=(0,a.get)(this.getFieldMeta(t,this.meta),"formatter",a.identity);return(e,t,s)=>{var o,n;const r=(0,fe.Lv)(s,null===(n=null===(o=this.spreadsheet)||void 0===o?void 0:o.options)||void 0===n?void 0:n.placeholder);return(0,fe.Kg)(null==i?void 0:i(e,t,s),r)}}getFieldDescription(e){const t=this.getField(e);return(0,a.get)(this.getFieldMeta(t,this.meta),"description")}setDataCfg(e){var t,i,s;null===(s=null===(i=null===(t=this.getFieldMeta)||void 0===t?void 0:t.cache)||void 0===i?void 0:i.clear)||void 0===s||s.call(i);const{fields:o,meta:n,data:r,sortParams:l,filterParams:a}=this.processDataCfg(e);this.fields=o,this.meta=n,this.originData=r,this.sortParams=l,this.filterParams=a,this.displayData=this.originData,this.indexesData={}}processMeta(e=[],t){var i,s;return[...e,(0,Oe.bh)(e,null===(s=null===(i=this.spreadsheet)||void 0===i?void 0:i.options)||void 0===s?void 0:s.cornerExtraFieldText,t)]}getDisplayDataSet(){return this.displayData||[]}isEmpty(){return(0,a.isEmpty)(this.getDisplayDataSet())}getEmptyViewIndexes(){return[]}getValueRangeByField(e){const t=(i=e,this.spreadsheet.store.get(G,V)[i]);var i;if(t)return t;const s=(0,a.compact)((0,a.map)(this.originData,t=>{const i=t[e];return(0,a.isNil)(i)?null:Number.parseFloat(i)})),o={maxValue:(0,a.max)(s),minValue:(0,a.min)(s)};return((e,t)=>{const i=e.store.get(G,V);e.store.set(G,Object.assign(Object.assign({},i),t))})(this.spreadsheet,{[e]:o}),o}moreThanOneValue(){var e,t;return(null===(t=null===(e=this.fields)||void 0===e?void 0:e.values)||void 0===t?void 0:t.length)>1}}class ji extends Pi{constructor(){super(...arguments),this.handleDimensionValueFilter=()=>{(0,a.each)(this.filterParams,({filterKey:e,filteredValues:t,customFilter:i})=>{const s=new Set(t),o=t=>!s.has(t[e]),n=(0,a.filter)(this.displayData,e=>i?i(e)&&o(e):o(e));this.displayData=this.getDisplayData(n)})},this.handleDimensionValuesSort=()=>{(0,a.each)(this.sortParams,e=>{var t;const{sortFieldId:i,sortBy:s,sortFunc:o,sortMethod:n,query:r}=e;if(!i)return;let l=this.displayData;const d=[];if(r){const e=[];l.forEach(t=>{const i=Object.keys(r);let s=!0;for(let e=0;e<i.length;e++){const o=i[e];if(t[o]!==r[o]){s=!1,d.push(t);break}}s&&e.push(t)}),l=e}let c=l;if(o)c=o(Object.assign(Object.assign({},e),{data:l}));else if(s&&!(0,a.isFunction)(s)){const e=[...s].reverse();c=l.sort((t,s)=>{const o=e.indexOf(t[i]);return e.indexOf(s[i])-o})}else if(fi(n)||Ci(n)){const e=n.toLocaleLowerCase(),o=(0,fe.Lv)(this.spreadsheet,null===(t=this.spreadsheet.options)||void 0===t?void 0:t.placeholder),r=((0,a.isFunction)(s)?s:null)||(e=>e[i]===o?Number.MIN_VALUE:e[i]);c=[...l].sort((t,i)=>this.compareSortValues(r(t),r(i),e))}d.length&&(c=[...c,...d]),this.displayData=this.getDisplayData(c)})}}compareSortValues(e,t,i){const s=fi(i)?1:-1;return(0,a.isNil)(e)&&(0,a.isNil)(t)?0:(0,a.isNil)(e)?1:(0,a.isNil)(t)?-1:ui(e)&&ui(t)?(Number(e)-Number(t))*s:e.toString().localeCompare(t.toString(),"zh")*s}processDataCfg(e){return e}setDataCfg(e){super.setDataCfg(e),this.handleDimensionValueFilter(),this.handleDimensionValuesSort()}getStartFrozenRows(e){const{rowCount:t}=this.spreadsheet.options.frozen||{};return t?e.slice(0,t):[]}getEndFrozenRows(e){const{trailingRowCount:t}=this.spreadsheet.options.frozen||{};return t?e.slice(-t):[]}getDisplayData(e){const t=this.getStartFrozenRows(e),i=this.getEndFrozenRows(e),s=e.slice(t.length||0,-i.length||void 0);return[...t,...s,...i]}getDimensionValues(){return[]}getCellData({query:e={}}={}){if(0===this.displayData.length&&0===e.rowIndex)return;const t=this.displayData[e.rowIndex];return(0,a.hasIn)(e,"field")&&(0,a.isObject)(t)?t[e.field]:t}getCellMultiData({query:e={}}={}){if(!e)return this.displayData;const t=this.displayData[e.rowIndex]?[this.displayData[e.rowIndex]]:this.displayData;return(0,a.hasIn)(e,"field")?t.map(t=>t[e.field]):t}getRowData(e){return this.getCellData({query:{rowIndex:e.rowIndex}})}}class Wi extends Ti{handleRestOptions(...[e]){this.headerConfig=Object.assign({},e);const{field:t}=this.meta,i=(0,a.find)(this.spreadsheet.dataCfg.sortParams,e=>(null==e?void 0:e.sortFieldId)===t),s=bi(i,!0);this.headerConfig.sortParam=Object.assign(Object.assign(Object.assign({},this.headerConfig.sortParam),i||{}),{type:s})}getFormattedFieldValue(){return(0,re.ar)(this.meta,this.spreadsheet.dataSet.getFieldName(this.meta.field))}isSortCell(){return!0}showSortIcon(){const{extra:e}=this.meta,{options:t}=this.spreadsheet,{showDefaultHeaderActionIcon:i}=t;return(null==e?void 0:e.isCustomNode)?i&&this.meta.isLeaf:i}getTextStyle(){var e;const t=this.getCellTextWordWrapStyle(),i=null===(e=this.getStyle())||void 0===e?void 0:e.bolderText;return Object.assign(Object.assign({},t),i)}getHorizontalResizeAreaName(){return`${h.YD}${this.meta.id}`}drawBackgroundShape(){const{backgroundColor:e,backgroundColorOpacity:t}=this.getStyle().cell||{};this.backgroundShape=(0,w.P2)(this,Object.assign(Object.assign({},this.getBBoxByType()),{fill:e,fillOpacity:t}))}drawTextOrCustomRenderer(){this.drawTextShape(),this.afterDrawText()}}var Gi=i("./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/common/i18n/index.js");var Vi;!function(e){e.Adaptive="adaptive",e.ColAdaptive="colAdaptive",e.Compact="compact"}(Vi||(Vi={}));const $i={wordWrap:!0,maxLines:1,textOverflow:"ellipsis"},Ui={layoutWidthType:Vi.Adaptive,seriesNumberCell:$i,cornerCell:$i,rowCell:Object.assign(Object.assign({},$i),{showTreeLeafNodeAlignDot:!1}),colCell:Object.assign(Object.assign({},$i),{height:30}),dataCell:Object.assign(Object.assign({},$i),{width:96,height:30})},Yi={rowCount:0,colCount:0,trailingRowCount:0,trailingColCount:0},Xi={width:600,height:480,debug:!1,hierarchyType:"grid",device:pe.PC,conditions:{},totals:{},tooltip:{enable:!1,autoAdjustBoundary:"body",operation:{hiddenColumns:!1,sort:!1,menu:{items:[]}}},interaction:{copy:{enable:!0,withFormat:!0,withHeader:!1},linkFields:[],hiddenColumnFields:[],selectedCellsSpotlight:!1,hoverHighlight:!0,hoverFocus:{duration:800},scrollSpeedRatio:{horizontal:1,vertical:1},autoResetSheetStyle:!0,brushSelection:{dataCell:!0,rowCell:!0,colCell:!0},multiSelection:!0,rangeSelection:!0,scrollbarPosition:d.eb.CONTENT,resize:{rowCellVertical:!0,cornerCellHorizontal:!0,colCellHorizontal:!0,colCellVertical:!0,rowResizeType:g.CURRENT,colResizeType:g.CURRENT,minCellWidth:40,minCellHeight:20},eventListenerOptions:!1,selectedCellHighlight:!1,overscrollBehavior:"auto"},seriesNumber:{enable:!1},customSVGIcons:[],showDefaultHeaderActionIcon:!1,headerActionIcons:[],style:Ui,frozen:Object.assign({rowHeader:!0},Yi),hd:!0,cornerText:"",cornerExtraFieldText:"",placeholder:{cell:"-",empty:{icon:"Empty"}}};var Zi=i("./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/common/debug/index.js");const qi=(e,t,i)=>{var s,o;const n=(0,a.get)(i,"cell.padding"),r=null!==(o=null===(s=null==i?void 0:i.cell)||void 0===s?void 0:s.horizontalBorderWidth)&&void 0!==o?o:1,l=((e,t,i)=>{var s,o,n,r;const l=(null===(o=null===(s=i.icon)||void 0===s?void 0:s.margin)||void 0===o?void 0:o.left)||0,d=(null===(r=null===(n=i.icon)||void 0===n?void 0:n.margin)||void 0===r?void 0:r.right)||0,c=e.store.get("hiddenColumnsDetail",[]);let h=!1,u=!1;c.forEach(e=>{var i,s,o,n;(null===(s=null===(i=null==e?void 0:e.displaySiblingNode)||void 0===i?void 0:i.prev)||void 0===s?void 0:s.field)===t&&(h=!0),(null===(n=null===(o=null==e?void 0:e.displaySiblingNode)||void 0===o?void 0:o.next)||void 0===n?void 0:n.field)===t&&(u=!0)});const p=(0,a.get)(i,"icon.size");return{left:u?p+d:0,right:h?p+l:0}})(e,t.field,i),c=((e,t,i,s)=>{var o,n;const r=null==s?void 0:s.size,l=null==s?void 0:s.margin;let a=0;return a=e.options.showDefaultHeaderActionIcon?1:null!==(n=null===(o=(0,re.AS)(e.options.headerActionIcons,t,i))||void 0===o?void 0:o.icons.length)&&void 0!==n?n:0,a*(r+l.left)+(a>0?l.right:0)})(e,t,d.vZ.COL_CELL,null==i?void 0:i.icon);return n.left+n.right+c+l.left+l.right+r},Ki=(e,t,i)=>{if(i<=0)return{start:0,end:0};let s=(0,a.findIndex)(e,(i,s)=>t>=i&&t<e[s+1],0);s=Math.max(s,0);let o=i===t?s:(0,a.findIndex)(e,(t,s)=>i>t&&i<=e[s+1],s);return o=Math.min(-1===o?1/0:o,e.length-2),{start:s,end:o}},Ji=(e,t)=>{const{width:i,originalWidth:s}=t,o=Math.min(s-i,e);return o<0?0:o},Qi=(e,t,i)=>{const s=Math.min(t-i,e);return s<0?0:s},es=(e=[],t)=>{if((0,a.isEmpty)(e))return[];const i=[];return e.forEach(e=>{if(e instanceof t&&i.push(e),e instanceof l.YJ){e.children.forEach(e=>{e instanceof t&&i.push(e)})}}),i};class ts{constructor(e,t=!1){this.x=0,this.y=0,this.minX=0,this.minY=0,this.maxX=0,this.maxY=0,this.width=0,this.height=0,this.originalWidth=0,this.originalHeight=0,this.viewportHeight=0,this.viewportWidth=0,this.facet=e,this.spreadsheet=e.spreadsheet,this.layoutResult=e.getLayoutResult(),t&&this.calculateBBox()}}class is extends ts{calculateBBox(){const e=this.getWidth(),t=this.getHeight();this.width=e,this.height=t,this.maxX=e,this.maxY=t}calculateOriginalHeight(){var e;const{colsHierarchy:t}=this.layoutResult,{colCell:i}=this.spreadsheet.options.style;this.originalHeight=t.sampleNodeForLastLevel?C(t.height):null!==(e=this.facet.getCellCustomSize(null,null==i?void 0:i.height))&&void 0!==e?e:0}calculateOriginWidth(){const{rowsHierarchy:e}=this.layoutResult;this.originalWidth=C(e.width+this.facet.getSeriesNumberWidth())}getHeight(){return this.calculateOriginalHeight(),this.originalHeight}getWidth(){return this.calculateOriginWidth(),this.spreadsheet.isFrozenRowHeader()?this.adjustWidth():this.originalWidth}adjustWidth(){const{colsHierarchy:e}=this.layoutResult,{width:t,frozen:i}=this.spreadsheet.options,s=null==i?void 0:i.rowHeader,o=t*((0,a.isBoolean)(s)?.5:(0,a.clamp)(s,0,1)),n=null==e?void 0:e.width,r=t-this.originalWidth;if(this.originalWidth<=o||n<=r)return this.originalWidth;let l=0;return l=n<=t-o?this.originalWidth-(n-r):o,C(l)}}class ss extends l.YJ{constructor(e){const{name:t,s2:i}=e;super({name:t,style:(0,A.Tt)(e,["name","s2"])}),this.gridInfo={cols:[],rows:[]},this.updateGrid=(e,t=h.n7)=>{var i,s,o,n;this.gridGroup&&this.getElementById(t)||(this.gridGroup=this.appendChild(new l.YJ({id:t,style:{zIndex:2}})));const r=null!==(i=(0,a.last)(e.cols))&&void 0!==i?i:0,d=null!==(s=(0,a.last)(e.rows))&&void 0!==s?s:0,{theme:c}=this.s2,u=c.dataCell.cell,p=null!==(o=null==u?void 0:u.verticalBorderWidth)&&void 0!==o?o:1,g=p/2,m={stroke:u.verticalBorderColor,strokeOpacity:u.verticalBorderColorOpacity,lineWidth:p},v=null!==(n=null==u?void 0:u.horizontalBorderWidth)&&void 0!==n?n:1,f=v/2,C={stroke:u.horizontalBorderColor,strokeOpacity:u.horizontalBorderColorOpacity,lineWidth:v},y=this.gridGroup.children;let x=0;e.cols.forEach(e=>{const t=Object.assign({x1:e-g,x2:e-g,y1:0,y2:d},m);x<y.length?(0,w.wC)(y[x],t):(0,w.ni)(this.gridGroup,t),x++}),e.rows.forEach(e=>{const t=Object.assign({x1:0,x2:r,y1:-f,y2:-f,transform:`translate(0, ${e})`},C);x<y.length?(0,w.wC)(y[x],t):(0,w.ni)(this.gridGroup,t),x++});const _=x,S=y.length;if(_<S)for(let e=S-1;e>=_;e--)y[e].destroy();this.gridInfo=e},this.s2=i}}class os extends ss{}const ns=(e,t,i)=>i.slice(e,t+1).map(e=>e.x+e.width),rs=(e,t,i)=>{const s=[];for(let o=e;o<t+1;o++)s.push(i.getCellOffsetY(o+1));return s};var ls=i("./node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/array.js"),as=i("./node_modules/.pnpm/d3-timer@3.0.1/node_modules/d3-timer/src/timer.js");class ds extends Li{get cellType(){return d.vZ.ROW_CELL}getBorderPositions(){return[v.cV.BOTTOM,v.cV.LEFT]}initCell(){super.initCell(),this.drawBackgroundShape(),this.drawInteractiveBgShape(),this.drawInteractiveBorderShape(),this.drawTextOrCustomRenderer()}afterDrawText(){this.drawActionAndConditionIcons(),this.drawTreeIcon(),this.drawTreeLeafNodeAlignDot(),this.drawBorders(),this.drawResizeAreaInLeaf(),this.update()}getBackgroundColor(){const{backgroundColor:e,backgroundColorOpacity:t}=this.getCrossBackgroundColor(this.meta.rowIndex);return(0,a.merge)({backgroundColor:e,backgroundColorOpacity:t},this.getBackgroundConditionFill())}getBBoxByType(e=v.Ok.BORDER_BOX){var t,i,s,o;const n=super.getBBoxByType(e);if(!this.spreadsheet.isHierarchyGridTreeType()||!this.meta.isCollapsed)return n;const{hierarchy:r}=this.meta,l=(null==r?void 0:r.sampleNodesForAllLevels)||[];let a=0;for(let e=this.meta.level;e<=(null!==(t=null==r?void 0:r.maxLevel)&&void 0!==t?t:0);e++){const t=l[e];a+=null!==(i=null==t?void 0:t.width)&&void 0!==i?i:0}if(e===v.Ok.CONTENT_BOX){const{padding:e}=this.getStyle().cell;a-=(null!==(s=null==e?void 0:e.left)&&void 0!==s?s:0)+(null!==(o=null==e?void 0:e.right)&&void 0!==o?o:0)}return Object.assign(Object.assign({},n),{width:a||n.width})}showTreeIcon(){return!(!this.spreadsheet.isHierarchyTreeType()&&!this.spreadsheet.isHierarchyGridTreeType())&&(!!this.meta.isCollapsed||!this.meta.isLeaf)}showTreeLeafNodeAlignDot(){var e,t;return(null===(t=null===(e=this.spreadsheet.options.style)||void 0===e?void 0:e.rowCell)||void 0===t?void 0:t.showTreeLeafNodeAlignDot)&&this.spreadsheet.isHierarchyTreeType()&&!this.spreadsheet.isHierarchyGridTreeType()}getParentTreeIconCfg(){var e,t;if(!this.showTreeLeafNodeAlignDot()||!this.spreadsheet.isHierarchyTreeType()||!this.meta.isLeaf)return;const i=null===(t=null===(e=this.meta.parent)||void 0===e?void 0:e.belongsCell)||void 0===t?void 0:t.getTreeIcon();return null==i?void 0:i.style}onTreeIconClick(){const{isCollapsed:e,hierarchy:t}=this.meta,{device:i}=this.spreadsheet.options;if(!me(i)){if(!e){const{scrollY:e}=this.spreadsheet.facet.getScrollOffset(),i=this.spreadsheet.facet.panelBBox.viewportHeight||0,s=(e=>{let t=0;const i=e.children;return null==i||i.forEach(e=>{t+=e.height||0}),t})(this.meta),o=t.height-s;if(e>0&&e+i>o){const e=o-i;this.spreadsheet.facet.setScrollOffset({scrollY:e>0?e:0})}}this.emitCollapseEvent()}}emitCollapseEvent(){this.spreadsheet.emit(m.ROW_CELL_COLLAPSED__PRIVATE,{isCollapsed:!this.meta.isCollapsed,node:this.meta})}drawTreeIcon(){var e;if(!this.showTreeIcon())return;const{isCollapsed:t}=this.meta,{x:i}=this.getBBoxByType(v.Ok.CONTENT_BOX),{fill:s}=this.getTextStyle(),{size:o}=this.getStyle().icon,n=i+this.getContentIndent(),r=this.getIconPosition().y;this.treeIcon=(0,w.ms)({group:this,iconCfg:{x:n,y:r,width:o,height:o,fill:s,iconStrategy:null===(e=this.spreadsheet.options.csp)||void 0===e?void 0:e.iconStrategy},isCollapsed:t,onClick:()=>{this.onTreeIconClick()}});const{device:l}=this.spreadsheet.options;me(l)&&this.addMobileTouchListener(()=>{this.emitCollapseEvent()})}drawTreeLeafNodeAlignDot(){const e=this.getParentTreeIconCfg();if(!e)return;const{size:t,margin:i}=this.getStyle().icon,s=e.x+t+i.right,o=this.getTextPosition().y,{fill:n,fontSize:r}=this.getTextStyle(),l=t/5;this.treeLeafNodeAlignDot=(0,w.DH)(this,{cx:s+t/2,cy:o+(r-l)/2,r:l,fill:n,fillOpacity:.3})}isBolderText(){const{isLeaf:e,isTotals:t,level:i}=this.meta;return!e&&0===i||t}getResizesArea(){return j(this.spreadsheet,h.k5)}drawResizeAreaInLeaf(){if(!this.meta.isLeaf||this.meta.hideRowCellVerticalResize||!this.shouldDrawResizeAreaByType("rowCellVertical",this))return;const{x:e,y:t,width:i,height:o}=this.getBBoxByType(),n=this.getResizeAreaStyle(),r=this.getResizesArea();if(!r)return;const{position:l,width:a,viewportHeight:d,scrollX:c=0,scrollY:h=0}=this.getHeaderConfig(),g=this.meta.isFrozen,m=this.spreadsheet.facet.frozenGroupAreas,v=m[s.Row];if(!W({x:e,y:t+o-n.size,width:i,height:n.size},{x:0,y:g?0:v.height,width:a,height:g?Number.POSITIVE_INFINITY:d-v.height-m[s.TrailingRow].height},{scrollX:c,scrollY:g?0:h}))return;const{offsetX:C,offsetY:y}=this.getHorizontalResizeAreaOffset(),w=this.spreadsheet.isFrozenRowHeader()?a-l.x-(e-c):i,x=P({theme:n,type:u.Vertical,effect:p.Cell,offsetX:C,offsetY:y,width:i,height:o,meta:this.meta,cell:this});r.appendChild(new f({style:Object.assign(Object.assign({},x.style),{x:C,y:y+o-n.size,width:w})},x.appendInfo))}getHorizontalResizeAreaOffset(){const{position:e,viewportHeight:t,scrollX:i=0,scrollY:o=0}=this.getHeaderConfig(),{x:n,y:r}=this.getBBoxByType(),l=this.spreadsheet.facet.frozenGroupAreas,a=l[s.TrailingRow];let d=e.y;return d+=this.meta.isFrozenHead?r-l[s.Row].y:this.meta.isFrozenTrailing?t-a.height+r-a.y:r-o,{offsetX:e.x+n-i,offsetY:d}}getContentIndent(){if(!this.spreadsheet.isHierarchyTreeType()||this.spreadsheet.isHierarchyGridTreeType())return 0;const{icon:e,cell:t}=this.getStyle(),i=e.size+e.margin.right;let s=this.meta.parent,o=0;for(;s;)0!==s.height&&(o+=i),s=s.parent;return this.showTreeLeafNodeAlignDot()&&(o+=this.isTreeLevel()?0:t.padding.right+e.margin.right),o}getTextIndent(){const{size:e,margin:t}=this.getStyle().icon;return this.getContentIndent()+(this.showTreeIcon()||this.isTreeLevel()&&this.showTreeLeafNodeAlignDot()?e+t.right:0)}isTreeLevel(){return(0,a.find)((0,a.get)(this.meta,"parent.children"),e=>!e.isLeaf)}getMaxTextWidth(){const{width:e}=this.getBBoxByType(v.Ok.CONTENT_BOX);return e-this.getTextIndent()-this.getActionAndConditionIconWidth()}getTextArea(){const e=this.getBBoxByType(v.Ok.CONTENT_BOX),t=this.getTextIndent();return Object.assign(Object.assign({},e),{x:e.x+t,width:e.width-t})}handleViewport(){if(this.meta.isFrozen)return{start:0,size:Number.POSITIVE_INFINITY};const{scrollY:e,viewportHeight:t}=this.getHeaderConfig(),i=this.spreadsheet.facet.frozenGroupAreas,o=i[s.Row].height;return{start:e+o,size:t-o-i[s.TrailingRow].height}}getContentPosition({contentWidth:e=this.getActualTextWidth()}={}){const t=this.getTextArea(),i=this.getTextStyle(),{cell:s,icon:o}=this.getStyle(),n=this.handleViewport(),r=this.getActualTextHeight(),{textStart:l}=N(n,{start:t.y,size:t.height},{align:I(i.textBaseline),size:{textSize:r},padding:{start:s.padding.top,end:s.padding.bottom}}),{textX:a,leftIconX:d,rightIconX:c}=(0,R.Cb)({bbox:t,textWidth:e,textAlign:i.textAlign,groupedIcons:this.groupedIcons,iconStyle:o,isCustomRenderer:!!this.getRenderer()}),h=(0,R.Bh)(null==o?void 0:o.size,l,r,i.textBaseline);return this.leftIconPosition={x:d,y:h},this.rightIconPosition={x:c,y:h},{x:a,y:l}}getTextPosition(){return this.getContentPosition()}getResizedTextMaxLines(){var e,t,i,s,o;const{rowCell:n}=this.spreadsheet.options.style;return null!==(s=null!==(t=null===(e=null==n?void 0:n.maxLinesByField)||void 0===e?void 0:e[this.meta.id])&&void 0!==t?t:null===(i=null==n?void 0:n.maxLinesByField)||void 0===i?void 0:i[this.meta.field])&&void 0!==s?s:this.getMaxLinesByCustomHeight({isCustomHeight:null===(o=this.meta.extra)||void 0===o?void 0:o.isCustomHeight})}shouldShowDefaultHeaderActionIcon(){return this.spreadsheet.options.showDefaultHeaderActionIcon&&!this.spreadsheet.isValueInCols()}setHeaderConfig(e){super.setHeaderConfig(e)}}const cs=(e,t)=>(0,a.find)(t,t=>(0,a.isEqual)(t[0],e[1])),hs=e=>{let t=[];e.forEach(e=>{const i=e.getMeta(),{x:s,y:o,width:n,height:r}=i;t=t.concat(((e,t,i,s)=>{const o=[e,t],n=[e+i,t],r=[e+i,t+s],l=[e,t+s];return[[o,n],[n,r],[r,l],[l,o]]})(s,o,n,r))}),t=(e=>{const t=[];return(0,a.forEach)(e,i=>{const s=[i[1],i[0]];JSON.stringify(e).includes(JSON.stringify(s))||t.push(i)}),t})(t);let i=[];const s=t[0];let o=s,n=[];for(;!(0,a.isEqual)(s,n);)i=i.concat(o),n=cs(o,t),o=n;return i};class us extends Ri{get cellType(){return d.vZ.MERGED_CELL}constructor(e,t,i){super(i,e,t)}handleRestOptions(...[e]){this.cells=e}update(){}initCell(){this.resetTextAndConditionIconShapes(),this.drawBackgroundShape(),this.drawTextOrCustomRenderer()}afterDrawText(){this.drawBorders()}drawBackgroundShape(){const e=hs(this.cells);this.backgroundShape=(0,w.nP)(this,{points:e,fill:this.theme.dataCell.cell.backgroundColor})}drawTextShape(){if(!(0,a.isEmpty)(this.meta))return this.isMultiData()?(0,fe.V)(this):void super.drawTextShape()}drawBorders(){const{right:e,bottom:t,bottomRightCornerCell:i}=(e=>{const t=[],i=[],s=[];return e.forEach(s=>{const[o,n]=s.position||[];(0,a.find)(e,e=>{var t,i;return(null===(t=e.position)||void 0===t?void 0:t[0])===o+1&&(null===(i=e.position)||void 0===i?void 0:i[1])===n})||i.push(s),(0,a.find)(e,e=>{var t,i;return(null===(t=e.position)||void 0===t?void 0:t[1])===n+1&&(null===(i=e.position)||void 0===i?void 0:i[0])===o})||t.push(s)}),t.forEach(i=>{const[o,n]=i.position||[],r=(0,a.find)(e,e=>{var t,i;return(null===(t=e.position)||void 0===t?void 0:t[0])===o-1&&(null===(i=e.position)||void 0===i?void 0:i[1])===n});r&&!(0,a.includes)(t,r)&&s.push(r)}),{bottom:i,right:t,bottomRightCornerCell:s}})(this.cells);e.forEach(e=>{var t;const{position:i,style:s}=(0,R.qi)(v.cV.RIGHT,e.getBBoxByType(),null===(t=e.getStyle())||void 0===t?void 0:t.cell);(0,w.ni)(this,Object.assign(Object.assign({},i),s))}),t.forEach(e=>{var t;const{position:i,style:s}=(0,R.qi)(v.cV.BOTTOM,e.getBBoxByType(),null===(t=e.getStyle())||void 0===t?void 0:t.cell);(0,w.ni)(this,Object.assign(Object.assign({},i),s))}),i.forEach(e=>{var t;const{x:i,y:s,width:o,height:n}=e.getBBoxByType(),{horizontalBorderWidth:r=0,verticalBorderWidth:l=0,verticalBorderColor:a}=null===(t=e.getStyle())||void 0===t?void 0:t.cell,d=i+o-l/2;(0,w.ni)(this,{x1:d,x2:d,y1:s+n-r,y2:s+n,lineWidth:l,stroke:a,strokeOpacity:l})})}}var ps,gs=i("./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/common/interface/node.js");class ms extends Li{get cellType(){return d.vZ.CORNER_CELL}isBolderText(){const{cornerType:e}=this.meta;return e===gs.Q.Col}getBorderPositions(){return[v.cV.TOP,v.cV.LEFT]}initCell(){super.initCell(),this.resetTextAndConditionIconShapes(),this.drawBackgroundShape(),this.drawInteractiveBgShape(),this.drawInteractiveBorderShape(),this.drawTextShape(),this.drawTreeIcon(),this.drawActionAndConditionIcons(),this.drawBorders(),this.drawResizeArea(),this.update()}afterDrawText(){}onTreeIconClick(e){const{device:t}=this.spreadsheet.options;me(t)||this.emitCollapseEvent(e)}emitCollapseEvent(e){this.spreadsheet.facet.resetScrollY(),this.spreadsheet.emit(m.ROW_CELL_ALL_COLLAPSED__PRIVATE,e)}drawTreeIcon(){var e,t;if(!this.showTreeIcon())return;const{collapseFields:i={}}=null===(e=this.spreadsheet.options.style)||void 0===e?void 0:e.rowCell,{size:s=0}=this.getStyle().icon,{fill:o}=this.getTextStyle(),n=this.getBBoxByType(v.Ok.CONTENT_BOX),r=this.spreadsheet.facet.getRowNodes(0),l=(0,a.values)(i).filter(Boolean).length===r.length||r.every(e=>e.isCollapsed);this.treeIcon=(0,w.ms)({group:this,iconCfg:{x:n.x,y:this.getIconPosition().y,width:s,height:s,fill:o,iconStrategy:null===(t=this.spreadsheet.options.csp)||void 0===t?void 0:t.iconStrategy},isCollapsed:l,onClick:()=>{this.onTreeIconClick(l)}});const{device:d}=this.spreadsheet.options;me(d)&&this.addMobileTouchListener(()=>{this.emitCollapseEvent(l)})}isLastRowCornerCell(){const{cornerType:e,field:t}=this.meta,{rows:i}=this.spreadsheet.dataSet.fields;return e===gs.Q.Row&&(this.spreadsheet.isHierarchyTreeType()||(0,a.last)(i)===t)}getResizeAreaEffect(){const{cornerType:e}=this.meta;return e===gs.Q.Series?p.Series:this.isLastRowCornerCell()&&this.spreadsheet.isHierarchyTreeType()?p.Tree:p.Field}drawResizeArea(){if(!this.shouldDrawResizeAreaByType("cornerCellHorizontal",this))return;const e=this.getResizeAreaStyle(),t=j(this.spreadsheet,h.nO);if(!t)return;const{position:i,scrollX:s=0,scrollY:o=0,width:n,height:r}=this.getHeaderConfig(),{x:l,y:a,width:d,height:c}=this.getBBoxByType(),{cornerType:p}=this.meta;if(p===gs.Q.Col||!W({x:l+d-e.size,y:a,width:e.size,height:c},{x:0,y:0,width:n,height:r},{scrollX:s,scrollY:o}))return;const g=i.x+l-s,m=i.y+(this.isLastRowCornerCell()?0:a),v=P({theme:e,type:u.Horizontal,effect:this.getResizeAreaEffect(),offsetX:g,offsetY:m,width:d,height:c,meta:this.meta,cell:this});t.appendChild(new f({style:Object.assign(Object.assign({},v.style),{x:g+d-e.size,y:m,height:this.isLastRowCornerCell()?r:c})},v.appendInfo))}showTreeIcon(){return this.spreadsheet.isHierarchyTreeType()&&this.meta.cornerType===gs.Q.Row}getTreeIconWidth(){const{size:e,margin:t}=this.getStyle().icon;return this.spreadsheet.isHierarchyTreeType()?e+t.right:0}getMaxTextWidth(){const{width:e}=this.getBBoxByType(v.Ok.CONTENT_BOX);return e-this.getTreeIconWidth()-this.getActionAndConditionIconWidth()}getContentPosition({contentWidth:e=this.getActualTextWidth()}={}){const t=this.getBBoxByType(v.Ok.CONTENT_BOX),{x:i,y:s,height:o,width:n}=t,r=this.getTextStyle(),{textX:l,leftIconX:a,rightIconX:d}=(0,R.Cb)({bbox:{x:i+this.getTreeIconWidth(),y:s,width:n-this.getTreeIconWidth(),height:o},textAlign:r.textAlign,textWidth:e,groupedIcons:this.groupedIcons,iconStyle:this.getIconStyle()}),c=(0,R.l2)(t,r.textBaseline),{size:h=0}=this.getStyle().icon,u=(0,R.Bh)(h,c,r.fontSize,r.textBaseline);return this.leftIconPosition={x:a,y:u},this.rightIconPosition={x:d,y:u},{x:l,y:c}}getTextPosition(){return this.getContentPosition()}getFormattedFieldValue(){return(0,re.ar)(this.meta,this.spreadsheet.dataSet.getFieldName(this.meta.field))}getResizedTextMaxLines(){var e,t,i,s,o;const{colCell:n}=this.spreadsheet.options.style;return null!==(s=null!==(t=null===(e=null==n?void 0:n.maxLinesByField)||void 0===e?void 0:e[this.meta.id])&&void 0!==t?t:null===(i=null==n?void 0:n.maxLinesByField)||void 0===i?void 0:i[this.meta.field])&&void 0!==s?s:this.getMaxLinesByCustomHeight({isCustomHeight:null===(o=this.meta.extra)||void 0===o?void 0:o.isCustomHeight})}}class vs{constructor(){this.pool=[]}acquire(){return this.pool.pop()}release(e){this.pool.push(e)}}class fs extends vs{release(e){e.getRenderer()?e.destroy():this.pool.push(e)}}!function(e){e.MOUSE_DOWN="mousedown",e.MOUSE_MOVE="mousemove",e.MOUSE_UP="mouseup",e.MOUSE_OUT="mouseout",e.MOUSE_LEAVE="mouseleave",e.TOUCH_START="touchstart",e.TOUCH_END="touchend",e.KEY_DOWN="keydown",e.KEY_UP="keyup",e.CLICK="click",e.HOVER="hover",e.CONTEXT_MENU="contextmenu",e.POINTER_DOWN="pointerdown",e.POINTER_MOVE="pointermove",e.POINTER_OUT="pointerout",e.POINTER_LEAVE="pointerleave",e.POINTER_UP="pointerup",e.POINTER_CANCEL="pointercancel",e.POINTER_ENTER="pointerenter",e.POINTER_OVER="pointerover",e.RIGHT_DOWN="rightdown",e.RIGHT_UP="rightup",e.SCROLL="scroll"}(ps||(ps={}));const Cs=(e,t,i=[])=>{var s;const{cellsMeta:o,cells:n,invisibleCellInfo:r}=((e,t)=>{const i=[],s=[];let o;return(0,a.forEach)(e,e=>{const n=(0,a.find)(t,t=>{var i;const s=null===(i=null==t?void 0:t.getMeta)||void 0===i?void 0:i.call(t);if((null==s?void 0:s.colIndex)===(null==e?void 0:e.colIndex)&&(null==s?void 0:s.rowIndex)===(null==e?void 0:e.rowIndex))return t});n?(i.push(n),o=(null==e?void 0:e.showText)?null==n?void 0:n.getMeta():o):s.push(e)}),{cells:i,invisibleCellInfo:s,cellsMeta:o}})(i,e);let l=o,d=n;if((null==r?void 0:r.length)>0&&r.length<i.length){const{cells:e,cellsMeta:i}=((e,t)=>{const i=[];let s;return(0,a.forEach)(e,e=>{var o,n;const r=null===(o=null==t?void 0:t.facet)||void 0===o?void 0:o.getCellMeta(e.rowIndex,e.colIndex),l=null===(n=null==t?void 0:t.facet)||void 0===n?void 0:n.createDataCell(r);l&&(i.push(l),s=(null==e?void 0:e.showText)?r:s)}),{cells:i,cellsMeta:s}})(r,t);l=l||i,d=n.concat(e)}return(0,a.isEmpty)(n)||l||(l=null===(s=d[0])||void 0===s?void 0:s.getMeta()),{cells:d,viewMeta:l}},ys=(e,t,i)=>{var s;return(null===(s=e.options)||void 0===s?void 0:s.mergedCell)?e.options.mergedCell(e,t,i):new us(e,t,i)},ws=(e,t,i)=>{var s;const o=t||(e=>{const{interaction:t}=e,i=t.getActiveCells(),s=[];return(0,a.forEach)(i,(e,t)=>{const i=e.getMeta();s.push(Object.assign(Object.assign({},0===t?{showText:!0}:{}),{colIndex:null==i?void 0:i.colIndex,rowIndex:null==i?void 0:i.rowIndex}))}),s})(e);if((null==o?void 0:o.length)<=1)return void console.error("[mergeCell]: The merged cells must be more than one!");const n=e.facet.getDataCells(),{cells:r,viewMeta:l}=Cs(n,e,o);if(!(0,a.isEmpty)(r)){const t=(null===(s=e.options)||void 0===s?void 0:s.mergedCellsInfo)||[];t.push(o),e.setOptions({mergedCellsInfo:t});e.facet.panelScrollGroup.addMergeCell(ys(e,r,i?void 0:l))}},xs=(e,t)=>{var i,s,o;if(!t||t.cellType!==d.vZ.MERGED_CELL)return void console.error(`[unmergeCell]: The ${t} is not a MergedCell`);const n=((e,t)=>{const i=(0,a.map)(e.cells,e=>({colIndex:e.getMeta().colIndex,rowIndex:e.getMeta().rowIndex}));return(0,a.filter)(t,e=>{const t=e.map(e=>e.showText?{colIndex:e.colIndex,rowIndex:e.rowIndex}:e);return!(0,a.isEqual)(t,i)})})(t,(null===(i=e.options)||void 0===i?void 0:i.mergedCellsInfo)||[]);(null==n?void 0:n.length)!==(null===(o=null===(s=e.options)||void 0===s?void 0:s.mergedCellsInfo)||void 0===o?void 0:o.length)&&(e.setOptions({mergedCellsInfo:n}),t.remove())},_s=(e,t)=>(0,a.differenceWith)(e,t,(e,t)=>(0,a.isEqual)(e.viewMeta.id,t.viewMeta.id)),Ss=(e,t)=>{var i;const s=null===(i=e.options)||void 0===i?void 0:i.mergedCellsInfo;if((0,a.isEmpty)(s))return;const o=e.facet.getDataCells();if((0,a.isEmpty)(o))return;const n=[];s.forEach(t=>{const i=Cs(o,e,t);i.cells.length>0&&n.push(i)});const r=t.children,l=(e=>(0,a.map)(e,e=>({cells:e.cells,viewMeta:e.getMeta()})))(r),d=_s(l,n),c=_s(n,l);(0,a.forEach)(d,e=>{const t=(0,a.find)(r,t=>(0,a.isEqual)(t.getMeta().id,e.viewMeta.id));null==t||t.remove()}),(0,a.forEach)(c,({cells:i,viewMeta:s})=>{t.appendChild(ys(e,i,s))})};class bs extends ss{constructor(e){super(e),this.initMergedCellsGroup()}getMergedCellsGroup(){return this.mergedCellsGroup}initMergedCellsGroup(){this.mergedCellsGroup&&this.getElementById(h.H)||(this.mergedCellsGroup=this.appendChild(new l.YJ({id:h.H,style:{zIndex:3}})))}updateMergedCells(){this.initMergedCellsGroup(),Ss(this.s2,this.mergedCellsGroup)}addMergeCell(e){var t;null===(t=this.mergedCellsGroup)||void 0===t||t.appendChild(e),this.s2.emit(m.MERGED_CELLS_RENDER,e),this.s2.emit(m.LAYOUT_CELL_RENDER,e)}update(e){this.updateGrid(e),this.updateMergedCells()}}var Es;!function(e){e.ScrollChange="scroll-change",e.ScrollEnd="scroll-end"}(Es||(Es={}));class Ls extends l.YJ{constructor(e){super(),this.eventHandlers=[],this.scrollFrameId=null,this.getCoordinatesName=()=>({from:this.isHorizontal?"x1":"y1",to:this.isHorizontal?"x2":"y2"}),this.getCoordinatesWithBBoxExtraPadding=()=>{const{lineCap:e="butt",size:t=0}=this.theme;if("butt"===e)return{start:this.thumbOffset,end:this.thumbOffset+this.thumbLen};return{start:this.thumbOffset+(this.isHorizontal?0:t/2),end:this.thumbOffset+this.thumbLen-(this.isHorizontal?t:t/2)}},this.current=()=>this.thumbOffset/this.trackLen/(1-this.thumbLen/this.trackLen),this.updateThumbLen=e=>{if(this.thumbLen===e)return;this.thumbLen=e;const t=this.getCoordinatesName();this.thumbShape.attr(t.to,this.thumbOffset+e),this.emitScrollChange(this.thumbOffset/(this.trackLen-this.thumbLen)*this.scrollTargetMaxOffset,!1)},this.updateThumbOffset=(e,t=!0)=>{const i=this.validateRange(e);if(this.thumbOffset===i&&0!==i)return;this.thumbOffset=i;const{from:s,to:o}=this.getCoordinatesName(),{start:n,end:r}=this.getCoordinatesWithBBoxExtraPadding();this.thumbShape.attr({[s]:n,[o]:r}),t&&this.emitScrollChange(i/(this.trackLen-this.thumbLen)*this.scrollTargetMaxOffset,!1)},this.onlyUpdateThumbOffset=e=>{this.updateThumbOffset(e,!1)},this.emitScrollChange=(e,t=!0)=>{cancelAnimationFrame(this.scrollFrameId),this.scrollFrameId=requestAnimationFrame(()=>{this.dispatchEvent(new l.up(Es.ScrollChange,{offset:e,updateThumbOffset:t}))})},this.bindEventListener=(e,t,i)=>(null==e||e.addEventListener(t,i,!1),{remove:()=>{null==e||e.removeEventListener(t,i,!1)}}),this.addEvent=(e,t,i)=>{e.addEventListener(t,i),this.eventHandlers.push({target:e,type:t,handler:i})},this.initScrollBar=()=>{this.scrollBarGroup=this.createScrollBarGroup(),this.scrollBarGroup.setPosition(this.position.x,this.position.y),this.bindEvents()},this.createScrollBarGroup=()=>{const e=this.appendChild(new l.YJ({className:this.isHorizontal?"horizontalBar":"verticalBar"}));return this.trackShape=this.createTrackShape(e),this.thumbShape=this.createThumbShape(e),e},this.createTrackShape=e=>{const{lineCap:t="round",trackColor:i,size:s=0}=this.theme,o={lineWidth:s,stroke:i,lineCap:t};return e.appendChild(new l.N1(this.isHorizontal?{style:Object.assign(Object.assign({},o),{x1:0,y1:s/2,x2:this.trackLen,y2:s/2})}:{style:Object.assign(Object.assign({},o),{x1:s/2,y1:0,x2:s/2,y2:this.trackLen})}))},this.createThumbShape=e=>{const{size:t=0,lineCap:i="round",thumbColor:s}=this.theme,o={lineWidth:t,stroke:s,lineCap:i,cursor:"default"},{start:n,end:r}=this.getCoordinatesWithBBoxExtraPadding();return e.appendChild(new l.N1(this.isHorizontal?{style:Object.assign(Object.assign({},o),{x1:n,y1:t/2,x2:r,y2:t/2})}:{style:Object.assign(Object.assign({},o),{x1:t/2,y1:n,x2:t/2,y2:r})}))},this.bindEvents=()=>{this.addEventListener(ps.POINTER_DOWN,this.onStartEvent),this.addEventListener(ps.POINTER_UP,this.onPointerUp),this.trackShape.addEventListener("click",this.onTrackClick),this.thumbShape.addEventListener(ps.POINTER_OVER,this.onTrackPointerOver),this.thumbShape.addEventListener(ps.POINTER_OUT,this.onTrackPointerOut)},this.onStartEvent=e=>{e.preventDefault();const{clientX:t,clientY:i}=e;this.startPos=this.isHorizontal?t:i,this.bindLaterEvent()},this.bindLaterEvent=()=>{const e=this.ownerDocument.defaultView,t=document.body,i=[this.bindEventListener(t,ps.POINTER_MOVE,this.onPointerMove),this.bindEventListener(t,ps.POINTER_UP,this.onPointerUp),this.bindEventListener(t,ps.POINTER_LEAVE,this.onPointerUp)];this.addEvent(e,ps.POINTER_UP,this.onPointerUp),this.clearEvents=()=>{i.forEach(e=>{null==e||e.remove()}),(0,a.each)(this.eventHandlers,e=>{var t;null===(t=e.target)||void 0===t||t.removeEventListener(e.type,e.handler)}),this.eventHandlers.length=0}},this.onTrackClick=e=>{const t=this.validateRange(this.isHorizontal?e.x-this.position.x-this.thumbLen/2:e.y-this.position.y-this.thumbLen/2);this.updateThumbOffset(t)},this.onPointerMove=e=>{e.preventDefault();const t=this.isHorizontal?e.clientX:e.clientY,i=t-this.startPos;this.startPos=t,this.updateThumbOffset(this.thumbOffset+i)},this.onPointerUp=e=>{var t;this.dispatchEvent(new l.up(Es.ScrollEnd,{})),e.preventDefault(),null===(t=this.clearEvents)||void 0===t||t.call(this)},this.onTrackPointerOver=()=>{const{thumbHoverColor:e,hoverSize:t}=this.theme;this.thumbShape.attr("stroke",e),this.thumbShape.attr("lineWidth",t)},this.onTrackPointerOut=()=>{const{thumbColor:e,size:t}=this.theme;this.thumbShape.attr("stroke",e),this.thumbShape.attr("lineWidth",t)},this.validateRange=e=>{let t=e;return e+this.thumbLen>this.trackLen?t=this.trackLen-this.thumbLen:e+this.thumbLen<this.thumbLen&&(t=0),t};const{isHorizontal:t=!1,trackLen:i,thumbLen:s,position:o,thumbOffset:n=0,theme:r,scrollTargetMaxOffset:d}=e;this.isHorizontal=t,this.thumbOffset=n,this.trackLen=i,this.thumbLen=s,this.position=o,this.theme=r,this.scrollTargetMaxOffset=d,this.initScrollBar()}}const Ts=(e,t,i)=>{const[s,o,n,r]=i;return e>=s&&e<=o&&t>=n&&t<=r},Os=e=>{const[t,i,s,o]=e,n=[];for(let e=t;e<=i;e+=1)for(let t=s;t<=o;t+=1)n.push([e,t]);return n},Rs=(e,t)=>{const i=[],s=[];return Object.keys(t||{}).forEach(o=>{const{add:n,remove:r}=((e,t)=>{const i=[],s=[];if((0,a.isEmpty)(e))return(0,a.isEmpty)(t)?{add:i,remove:s}:{add:Os(t),remove:s};if((0,a.isEmpty)(t))return{add:i,remove:Os(e)};const[o,n,r,l]=e,[d,c,h,u]=t;for(let e=o;e<=n;e++)for(let i=r;i<=l;i++)Ts(e,i,t)||s.push([e,i]);for(let t=d;t<=c;t+=1)for(let s=h;s<=u;s+=1)Ts(t,s,e)||i.push([t,s]);return{add:i,remove:s}})((null==e?void 0:e[o])||[],t[o]);i.push(...n),s.push(...r)}),{add:i,remove:s}};class Is extends ts{calculateBBox(){this.calculateOriginWidth(),this.calculateOriginalHeight();const{cornerBBox:e}=this.facet,t=C(e.maxX),i=C(e.maxY);this.x=t+T.getVerticalBorderWidth(this.spreadsheet),this.y=i+T.getHorizontalBorderWidth(this.spreadsheet),this.minX=this.x,this.minY=this.y,this.width=this.getPanelWidth(),this.height=this.getPanelHeight(),this.viewportHeight=Math.abs(C(Math.min(this.height,this.originalHeight))),this.viewportWidth=Math.abs(C(Math.min(this.width,this.originalWidth))),this.maxX=this.x+this.viewportWidth,this.maxY=this.y+this.viewportHeight}calculateOriginalHeight(){this.originalHeight=this.facet.getRealHeight()}calculateOriginWidth(){this.originalWidth=this.facet.getRealWidth()}getPanelWidth(){const{width:e}=this.spreadsheet.options;return Math.max(0,e-this.x)}getPanelHeight(){const{height:e}=this.spreadsheet.options;return Math.max(0,e-this.y)}}class Ns{constructor(e){this.x=0,this.y=0,this.width=0,this.height=0,this.colIndex=-1,this.level=0,this.isLeaf=!1,this.children=[],this.padding=0,this.extra={},(0,a.assign)(this,e)}static getFieldPath(e,t){if(e&&!e.isTotals||e&&t){let t=e.parent;const i=[e.field];for(;t&&"root"!==t.id;)i.push(t.field),t=t.parent;return i.reverse()}return[]}static getAllLeaveNodes(e){const t=[];if(e.isLeaf)return[e];const i=[...e.children||[]];let s=i.shift();for(;s;)s.isLeaf?t.push(s):i.unshift(...s.children),s=i.shift();return t}static getAllChildrenNodes(e,t=e=>[e]){const i=[];if(e.isLeaf)return i.push(...t(e)),i;const s=[...e.children||[]];let o=s.shift();for(;o;)i.push(...t(o)),s.unshift(...o.children),o=s.shift();return i}static getBranchNodes(e){if(e&&!e.isTotals){let t=e.parent;const i=[e];for(;t&&"root"!==t.id;)i.push(t),t=t.parent;return i.reverse()}return[]}static blankNode(){return new Ns({id:"",field:"",value:""})}static rootNode(){return new Ns({id:"root",field:"",value:""})}getHeadLeafChild(){let e=this;for(;!(0,a.isEmpty)(null==e?void 0:e.children);)e=(0,a.head)(null==e?void 0:e.children);return e}getTotalHeightForTreeHierarchy(){return 0===this.height||(0,a.isEmpty)(this.children)?this.height:this.children.reduce((e,t)=>e+t.getTotalHeightForTreeHierarchy(),this.height)}isSeriesNumberNode(){return this.field===ye.r2}clone(){return new Ns(Object.assign({},this))}get isFrozen(){return this.isFrozenHead||this.isFrozenTrailing}}class Bs extends l.YJ{constructor(e){super(),this.isHeaderCellInViewport=({cellPosition:e,cellSize:t,viewportPosition:i,viewportSize:s})=>e+t>=i&&i+s>=e,this.headerConfig=e,this.initGroups()}getHeaderConfig(){return this.headerConfig||{}}render(e){this.clearResizeAreaGroup(e),this.clear(),this.layout(),this.offset(),this.clip()}onScrollXY(e,t,i){this.headerConfig.scrollX===e&&this.headerConfig.scrollY===t||(this.headerConfig.scrollX=e,this.headerConfig.scrollY=t,this.render(i))}onRowScrollX(e,t){this.headerConfig.scrollX!==e&&(this.headerConfig.scrollX=e,this.render(t))}clearResizeAreaGroup(e){if(!e)return;const t=this.parentNode,i=null==t?void 0:t.getElementById(e);null==i||i.destroyChildren()}clear(){var e,t,i;null===(e=this.scrollGroup)||void 0===e||e.destroyChildren(),null===(t=this.frozenGroup)||void 0===t||t.destroyChildren(),null===(i=this.frozenTrailingGroup)||void 0===i||i.destroyChildren()}getNodes(){const{nodes:e}=this.getHeaderConfig();return e||[]}createOrUpdate(e,t){B.x.call(this,e,t)}}class As extends Bs{initGroups(){this.scrollGroup=this.appendChild(new l.YJ({name:h.YJ,style:{zIndex:3}}))}getCellInstance(e){const t=this.getHeaderConfig(),{spreadsheet:i}=t,{cornerCell:s}=i.options;return(null==s?void 0:s(e,i,t))||new ms(e,i,t)}static getCornerHeader(e){const{panelBBox:t,cornerBBox:i,seriesNumberWidth:s,layoutResult:o,spreadsheet:n}=e,{width:r,height:l}=t,{originalWidth:a,originalHeight:d,width:c,height:h}=i,u=this.getCornerNodes({position:{x:i.x,y:i.y},width:a,height:d,layoutResult:o,seriesNumberWidth:s,spreadsheet:n});return new As({nodes:u,position:{x:i.x,y:i.y},width:c,height:h,originalHeight:d,originalWidth:a,viewportWidth:r,viewportHeight:l,seriesNumberWidth:s,spreadsheet:n})}static getTreeCornerText(e){const{rows:t=[]}=e.dataSet.fields,{cornerText:i}=e.options;if(i)return i;const s=e.store.get("drillDownFieldInLevel",[]).map(e=>e.drillField),o=t.filter(e=>!(0,a.includes)(s,e)).map(t=>e.dataSet.getFieldName(t)).join("/");return o||(0,h.Yq)()}static getCornerNodes(e){var t,i,s,o,n;const{position:r,width:l,layoutResult:a,seriesNumberWidth:d,spreadsheet:c}=e,{rowsHierarchy:h,colsHierarchy:u}=a,{rows:p=[],columns:g=[]}=(null===(t=null==c?void 0:c.dataSet)||void 0===t?void 0:t.fields)||{},{colCell:m}=c.options.style,v=[],f=null==u?void 0:u.sampleNodeForLastLevel;if(d){const e=new Ns({id:"",field:"",value:c.getSeriesNumberText()});e.x=null==r?void 0:r.x,e.y=null!==(i=null==f?void 0:f.y)&&void 0!==i?i:0,e.width=d,e.height=null!==(s=null==f?void 0:f.height)&&void 0!==s?s:null==m?void 0:m.height,e.isPivotMode=!0,e.spreadsheet=c,e.cornerType=gs.Q.Series,v.push(e)}if(c.isHierarchyTreeType()){const e=this.getTreeCornerText(c),t=new Ns({id:e,field:"",value:e});t.x=r.x+d,t.y=null!==(o=null==f?void 0:f.y)&&void 0!==o?o:0,t.width=l-d,t.height=null!==(n=null==f?void 0:f.height)&&void 0!==n?n:null==m?void 0:m.height,t.seriesNumberWidth=d,t.isPivotMode=!0,t.spreadsheet=c,t.cornerType=gs.Q.Row,v.push(t)}else{const e=h.sampleNodesForAllLevels||[],t=c.isCustomRowFields();e.forEach(e=>{var i,s,o;const n=t?e.field:p[e.level],r=c.dataSet.getFieldName(n),l=new Ns({id:n,field:n,value:r});l.x=e.x+d,l.y=null!==(i=null==f?void 0:f.y)&&void 0!==i?i:0,l.width=e.width,l.height=null!==(s=null==f?void 0:f.height)&&void 0!==s?s:null===(o=c.facet)||void 0===o?void 0:o.getCellCustomSize(null,null==m?void 0:m.height),l.isPivotMode=!0,l.cornerType=gs.Q.Row,l.spreadsheet=c,v.push(l)})}const C=u.sampleNodesForAllLevels||[],y=c.isCustomColumnFields();return C.forEach(e=>{if(e.level<u.maxLevel){const t=y?e.field:g[e.level],i=c.dataSet.getFieldName(t),s=new Ns({id:t,field:t,value:i});s.x=r.x,s.y=e.y,s.width=l,s.height=e.height,s.isPivotMode=!0,s.cornerType=gs.Q.Col,s.spreadsheet=c,v.push(s)}}),v}onCorScroll(e,t){this.headerConfig.scrollX!==e&&(this.headerConfig.scrollX=e,this.render(t))}layout(){var e,t;const{nodes:i,spreadsheet:s}=this.getHeaderConfig(),o=null===(e=s.options)||void 0===e?void 0:e.cornerHeader;if(o)return void o(this,s,this.headerConfig);const n=(null===(t=s.facet)||void 0===t?void 0:t.getColNodes())||[];i.forEach(e=>{var t;const i=null==n?void 0:n.find(t=>(null==e?void 0:e.y)===(null==t?void 0:t.y)&&(null==e?void 0:e.height)===(null==t?void 0:t.height));e.extra.isCustomHeight=null===(t=null==i?void 0:i.extra)||void 0===t?void 0:t.isCustomHeight;const o=this.getCellInstance(e);this.scrollGroup.appendChild(o),s.emit(m.CORNER_CELL_RENDER,o),s.emit(m.LAYOUT_CELL_RENDER,o)})}offset(){const{position:e,scrollX:t=0}=this.getHeaderConfig();E(this.scrollGroup,e.x-t,e.y)}clip(){const{width:e,height:t,position:i}=this.getHeaderConfig();this.createOrUpdate("scrollGroup.style.clipPath",{x:i.x,y:i.y,width:e,height:t})}}class Ms extends vs{constructor(){super(...arguments),this.cellIdPool=new Set}acquire(){const e=super.acquire();return e&&this.cellIdPool.delete(e.getMeta().id),e}release(e){if(e.getRenderer())return void e.destroy();const t=e.getMeta().id;this.cellIdPool.has(t)||(super.release(e),this.cellIdPool.add(t))}}const Ds=(e,t,i)=>{const s=i.isHierarchyTreeType();return e.getNodes(0).map((e,o)=>{const n=`${o+1}`,r=new Ns({id:n,field:"",rowIndex:o,value:n});return r.x=e.x,r.y=e.y,r.width=t,r.height=s?e.getTotalHeightForTreeHierarchy():e.height,r.isLeaf=!0,r.relatedNode=e,r.spreadsheet=i,r})},Hs=e=>e.reduce((e,t)=>{let i=t.parent;for(;i&&"root"!==i.id;)e.find(e=>e.id===i.id)||e.push(i),i=i.parent;return e},[]),ks=(e,{y:t=0,height:i=0})=>{e.y<t&&(e.height-=t-e.y,e.y=t),e.y+e.height>t+i&&(e.height-=e.y+e.height-t-i)},zs=(e,{y:t=0,height:i=0})=>{e.y+e.height>t+i&&(e.height-=e.y+e.height-t-i),e.y<t&&(e.height-=t-e.y,e.y=t)},Fs=(e,t=0,i=0)=>e.spreadsheet.isFrozenRowHeader()?0:i<=t?i:t,Ps=(e,t)=>{const i=e.frozenGroupAreas[s.TrailingCol],o=i.x+i.width;return t>o?0:o-t},js=(e,t,i)=>{const o=e.frozenGroupAreas[s.TrailingRow],n=o.y+o.height-i;return t>n?i:i+n-t},Ws=(e,t)=>{const i=e.spreadsheet.isFrozenRowHeader(),o=e.frozenGroupAreas,n=o[s.Col].width,r=o[s.TrailingCol].width;let l;l=i?t.x+n:n?T.getVerticalBorderWidth(e.spreadsheet)+n:0;const a=e.panelBBox.viewportWidth;return{x:l,width:(i?a:t.x+a)-n-r}};class Gs extends Bs{constructor(){super(...arguments),this.rowCellPool=new Ms}initGroups(){this.scrollGroup=this.appendChild(new l.YJ({name:h.VC,style:{zIndex:3}})),this.frozenGroup=this.appendChild(new l.YJ({name:h.YC,style:{zIndex:4}})),this.frozenTrailingGroup=this.appendChild(new l.YJ({name:h.x1,style:{zIndex:4}}));const{spreadsheet:e}=this.getHeaderConfig();this.extraFrozenNodes=(e=>{const t=[],{start:i,end:o}=e.getCellRange(),{rowCount:n,trailingRowCount:r}=e.getFrozenOptions();if(n){const o=e.getRowLeafNodesByRange(i,i+n-1);o.forEach(e=>{const i=e.clone();i.isFrozenHead=!0,t.push(i)}),Hs(o).forEach(i=>{const o=i.clone();o.isFrozenHead=!0,ks(o,e.frozenGroupAreas[s.Row]),t.push(o)})}if(r){const i=e.getRowLeafNodesByRange(o-r+1,o);i.forEach(e=>{const i=e.clone();i.isFrozenTrailing=!0,t.push(i)}),Hs(i).forEach(i=>{const o=i.clone();o.isFrozenTrailing=!0,zs(o,e.frozenGroupAreas[s.TrailingRow]),t.push(o)})}return t})(e.facet)}getCellInstance(e){var t;if(this.rowCellPool.pool.length>0&&(null===(t=this.headerConfig.spreadsheet.options.future)||void 0===t?void 0:t.experimentalReuseCell)){const t=this.rowCellPool.acquire();return t.reInitCell(e,this.headerConfig),t}const i=this.getHeaderConfig(),{spreadsheet:s}=i,{rowCell:o}=s.options;return(null==o?void 0:o(e,s,i))||new ds(e,s,i)}isCellInRect(e){const{width:t,viewportHeight:i,position:o,scrollY:n=0,scrollX:r=0,spreadsheet:l}=this.getHeaderConfig(),a=l.facet.frozenGroupAreas;return i+n-a[s.TrailingRow].height>e.y&&n+a[s.Row].height<e.y+e.height&&t+r-o.x>e.x&&r-o.x<e.x+e.width}getCellGroup(e){return e.isFrozenHead?this.frozenGroup:e.isFrozenTrailing?this.frozenTrailingGroup:this.scrollGroup}layout(){const{nodes:e}=this.getHeaderConfig(),t=e=>{var t;const i=this.getCellGroup(e);let s;(null===(t=e.belongsCell)||void 0===t?void 0:t.parentNode)===i&&e.belongsCell.getMeta()===e?(s=e.belongsCell,s.setHeaderConfig(this.headerConfig),s.updateTextPosition()):(s=this.getCellInstance(e),e.belongsCell=s,s.parentElement!==i&&(null==i||i.appendChild(s))),this.emitRenderEvent(s)};(0,a.each)(e,e=>{this.isCellInRect(e)&&0!==e.height&&t(e)}),(0,a.each)(this.extraFrozenNodes,e=>{0!==e.height&&t(e)})}emitRenderEvent(e){const{spreadsheet:t}=this.getHeaderConfig();t.emit(m.ROW_CELL_RENDER,e),t.emit(m.LAYOUT_CELL_RENDER,e)}offset(){const{scrollX:e=0,scrollY:t=0,position:i,spreadsheet:s,viewportHeight:o}=this.getHeaderConfig(),n=i.x-e,r=s.facet.getPaginationScrollY(),l=js(s.facet,o,r);E(this.scrollGroup,n,i.y-t),E(this.frozenGroup,n,i.y-r),E(this.frozenTrailingGroup,n,i.y-l)}clip(){const{width:e,viewportHeight:t,position:i,spreadsheet:o}=this.getHeaderConfig(),n=o.facet.frozenGroupAreas,r=n[s.Row].height,l=n[s.TrailingRow].height;this.createOrUpdate("scrollGroup.style.clipPath",{x:o.facet.cornerBBox.x,y:i.y+r,width:e,height:t-r-l}),this.createOrUpdate("frozenGroup.style.clipPath",{x:o.facet.cornerBBox.x,y:i.y,width:e,height:r}),this.createOrUpdate("frozenTrailingGroup.style.clipPath",{x:o.facet.cornerBBox.x,y:i.y+t-l,width:e,height:l})}clear(){var e;(null===(e=this.headerConfig.spreadsheet.options.future)||void 0===e?void 0:e.experimentalReuseCell)?this.scrollGroup.childNodes.forEach(e=>{this.isCellInRect(e.getMeta())||(e.getMeta().belongsCell=null,this.rowCellPool.release(e))}):super.clear()}}class Vs extends vs{constructor(){super(...arguments),this.cellIdPool=new Set}acquire(){const e=super.acquire();return e&&this.cellIdPool.delete(e.getMeta().id),e}release(e){if(e.getRenderer())return void e.destroy();const t=e.getMeta().id;this.cellIdPool.has(t)||(super.release(e),this.cellIdPool.add(t))}}class $s extends Bs{constructor(){super(...arguments),this.colCellPool=new Vs}initGroups(){this.scrollGroup=this.appendChild(new l.YJ({name:h.Do,style:{zIndex:3}})),this.frozenGroup=this.appendChild(new l.YJ({name:h.gN,style:{zIndex:4}})),this.frozenTrailingGroup=this.appendChild(new l.YJ({name:h.FS,style:{zIndex:4}})),this.extraFrozenNodes=(e=>{const t=[],{colCount:i,trailingColCount:o}=e.getFrozenOptions();if(i){const{x:o,width:n}=e.frozenGroupAreas[s.Col],r=e.getColLeafNodesByRange(0,i-1);r.forEach(e=>{const i=e.clone();i.isFrozenHead=!0,t.push(i)}),Hs(r).forEach(e=>{const i=e.clone();i.isFrozenHead=!0,i.x<o&&(i.width-=o-i.x,i.x=o),i.x+i.width>o+n&&(i.width-=i.x+i.width-o-n),t.push(i)})}if(o){const{x:i,width:n}=e.frozenGroupAreas[s.TrailingCol],r=e.getColLeafNodes().length,l=e.getColLeafNodesByRange(r-o,r-1);l.forEach(e=>{const i=e.clone();i.isFrozenTrailing=!0,t.push(i)}),Hs(l).forEach(e=>{const s=e.clone();s.isFrozenTrailing=!0,s.x+s.width>i+n&&(s.width-=s.x+s.width-i-n),s.x<i&&(s.width-=i-s.x,s.x=i),t.push(s)})}return t})(this.headerConfig.spreadsheet.facet)}getCellGroup(e){return e.isFrozenHead?this.frozenGroup:e.isFrozenTrailing?this.frozenTrailingGroup:this.scrollGroup}getCellInstance(e){var t;if(this.colCellPool.pool.length>0&&(null===(t=this.headerConfig.spreadsheet.options.future)||void 0===t?void 0:t.experimentalReuseCell)){const t=this.colCellPool.acquire();return t.reInitCell(e,this.getHeaderConfig()),t}const i=this.getHeaderConfig(),{spreadsheet:s}=this.getHeaderConfig(),{colCell:o}=s.options;return(null==o?void 0:o(e,s,i))||new Ti(e,s,i)}appendNode(e){var t;const{spreadsheet:i}=this.getHeaderConfig(),s=this.getCellGroup(e);let o;(null===(t=e.belongsCell)||void 0===t?void 0:t.parentNode)===s&&e.belongsCell.getMeta()===e?(o=e.belongsCell,o.setHeaderConfig(this.headerConfig)):(o=this.getCellInstance(e),e.belongsCell=o,o.parentElement!==s&&(null==s||s.appendChild(o))),i.emit(m.COL_CELL_RENDER,o),i.emit(m.LAYOUT_CELL_RENDER,o)}layout(){const{nodes:e}=this.getHeaderConfig();(0,a.each)(e,e=>{this.isColCellInRect(e)&&this.appendNode(e)}),(0,a.each)(this.extraFrozenNodes,e=>{this.appendNode(e)})}onColScroll(e,t){this.headerConfig.scrollX!==e&&(this.headerConfig.scrollX=e,this.render(t))}clip(){const{height:e,spreadsheet:t,position:i,viewportWidth:o,cornerWidth:n=0,scrollX:r=0}=this.getHeaderConfig(),l=t.facet,a=l.frozenGroupAreas,d=a[s.Col].width,c=a[s.TrailingCol].width,{x:h,width:u}=Ws(l,i);this.createOrUpdate("scrollGroup.style.clipPath",{x:h,y:i.y,width:u,height:e}),this.createOrUpdate("frozenGroup.style.clipPath",{x:i.x-Fs(l,n,r),y:i.y,width:d,height:e}),this.createOrUpdate("frozenTrailingGroup.style.clipPath",{x:i.x+o-c,y:i.y,width:c,height:e})}isColCellInRect(e){const{spreadsheet:t,cornerWidth:i=0,viewportWidth:o,scrollX:n=0,position:r}=this.getHeaderConfig(),l=t.facet.frozenGroupAreas;let a;const d=l[s.Col].width,c=l[s.TrailingCol].width;return a=t.isFrozenRowHeader()?d:d?d-i:-r.x,o-c>=e.x-n&&a<=e.x+e.width-n}offset(){const{viewportWidth:e,scrollX:t=0,position:i,spreadsheet:s,cornerWidth:o}=this.getHeaderConfig();E(this.scrollGroup,i.x-t,i.y);const n=s.facet,r=Fs(n,o,t),l=Ps(n,e);E(this.frozenGroup,i.x-r,i.y),E(this.frozenTrailingGroup,i.x-l,i.y)}clear(){var e;(null===(e=this.headerConfig.spreadsheet.options.future)||void 0===e?void 0:e.experimentalReuseCell)?this.scrollGroup.childNodes.forEach(e=>{this.isColCellInRect(e.getMeta())||(e.getMeta().belongsCell=null,this.colCellPool.release(e))}):super.clear()}clearResizeAreaGroup(e){var t;(null===(t=this.headerConfig.spreadsheet.options.future)||void 0===t?void 0:t.experimentalReuseCell)||super.clearResizeAreaGroup(e)}}class Us extends ds{get cellType(){return d.vZ.ROW_CELL}getBorderPositions(){return[v.cV.LEFT,v.cV.BOTTOM]}initCell(){this.drawBackgroundShape(),this.drawInteractiveBgShape(),this.drawInteractiveBorderShape(),this.drawBorders(),this.drawTextShape(),this.update()}getBackgroundColor(){const{backgroundColor:e,backgroundColorOpacity:t}=this.getCrossBackgroundColor(this.meta.rowIndex);return{backgroundColor:e,backgroundColorOpacity:t,intelligentReverseTextColor:!1}}getTextStyle(){var e;const t=this.getCellTextWordWrapStyle(d.vZ.SERIES_NUMBER_CELL),i=null===(e=this.getStyle())||void 0===e?void 0:e.seriesText;return Object.assign(Object.assign({},t),i)}getFormattedFieldValue(){var e;const{value:t,field:i}=this.meta,s=this.spreadsheet.dataSet.getFieldFormatter(i);return{value:t,formattedValue:null!==(e=null==s?void 0:s(t,void 0,this.meta))&&void 0!==e?e:t}}getMaxTextWidth(){const{width:e}=this.getBBoxByType(v.Ok.CONTENT_BOX);return e}isBolderText(){return!1}findFieldCondition(){}mappingValue(){}getIconPosition(){return{x:0,y:0}}}class Ys extends Gs{static getSeriesNumberHeader(e){var t,i;const{panelBBox:s,seriesNumberWidth:o,rowsHierarchy:n,spreadsheet:r,cornerWidth:l}=e,{height:a,viewportHeight:d}=s,c=null!==(i=null===(t=r.options)||void 0===t?void 0:t.layoutSeriesNumberNodes)&&void 0!==i?i:Ds;return new Ys({width:l,height:a,viewportWidth:l,viewportHeight:d,position:{x:0,y:s.y},nodes:c(n,o,r),spreadsheet:r})}initGroups(){this.scrollGroup=this.appendChild(new l.YJ({name:h.wH,style:{zIndex:3}})),this.frozenGroup=this.appendChild(new l.YJ({name:h.Zv,style:{zIndex:4}})),this.frozenTrailingGroup=this.appendChild(new l.YJ({name:h.G8,style:{zIndex:4}}));const{spreadsheet:e,nodes:t}=this.getHeaderConfig();this.extraFrozenNodes=((e,t)=>{const i=[],{start:o,end:n}=e.getCellRange(),{rowCount:r,trailingRowCount:l}=e.getFrozenOptions(),d=(e,t)=>{var i;const s=e.rowIndex;if((0,a.isNumber)(s)&&s>=t[0]&&s<=t[1])return!0;const o=null!==(i=e.children)&&void 0!==i?i:[];for(let e=0;e<o.length;e++)if(d(o[e],t))return!0;return!1};if(r){const n=[o,o+r-1];t.forEach(t=>{if(t.relatedNode&&!d(t.relatedNode,n))return;const o=t.clone();o.isFrozenHead=!0,ks(o,e.frozenGroupAreas[s.Row]),i.push(o)})}if(l){const o=[n-l+1,n];t.forEach(t=>{if(t.relatedNode&&!d(t.relatedNode,o))return;const n=t.clone();n.isFrozenTrailing=!0,zs(n,e.frozenGroupAreas[s.TrailingRow]),i.push(n)})}return i})(e.facet,t)}getCellInstance(e){const t=this.getHeaderConfig(),{spreadsheet:i}=t,{seriesNumberCell:s}=i.options;return(null==s?void 0:s(e,i,t))||new Us(e,i,t)}emitRenderEvent(e){const{spreadsheet:t}=this.getHeaderConfig();t.emit(m.SERIES_NUMBER_CELL_RENDER,e),t.emit(m.LAYOUT_CELL_RENDER,e)}}var Xs=i("./node_modules/.pnpm/@antv+event-emitter@0.1.3/node_modules/@antv/event-emitter/esm/index.js"),Zs=i("./node_modules/.pnpm/d3-ease@3.0.1/node_modules/d3-ease/src/cubic.js");const qs=()=>{var e;return null!==(e=null===performance||void 0===performance?void 0:performance.now())&&void 0!==e?e:Date.now()},Ks=e=>{var t;const i=e.nativeEvent;return(null===(t=null==i?void 0:i.touches)||void 0===t?void 0:t.length)>=2};class Js extends Xs.A{constructor(e,t){super(),this.bindPointerDown=e=>{Ks(e)||(window.cancelAnimationFrame(this.raf),this.panning=!0,this.preX=e.x,this.preY=e.y,this.speedX=0,this.speedY=0,this.lastMoveMS=qs())},this.bindPointerMove=e=>{var t,i,s,o;if(Ks(e))return this.panning=!1,void window.cancelAnimationFrame(this.raf);if(this.panning){const n=e.nativeEvent,r=qs(),l=r-this.lastMoveMS,a=this.preX-e.x,d=this.preY-e.y;if(null==n?void 0:n.cancelable){(null===(i=null===(t=this.shouldPreventDefault)||void 0===t?void 0:t.call(this,a,d,e.x,e.y))||void 0===i||i)&&(null===(o=(s=n).preventDefault)||void 0===o||o.call(s))}this.speedX=a/l,this.speedY=d/l,this.preX=e.x,this.preY=e.y,this.lastMoveMS=r,this.emit("wheel",Object.assign(Object.assign({},e.clone()),{x:e.x,y:e.y,deltaX:a,deltaY:d,nativeEvent:n}))}},this.bindPointerUp=e=>{this.panning=!1;const t=qs();if(!this.speedX||!this.speedY||t-this.lastMoveMS>=100)return;const i=()=>{const s=qs();this.raf=window.requestAnimationFrame(()=>{const o=qs(),n=(o-t)/800;if(n<1){const t=(0,Zs.EY)(1-n),r=o-s;this.emit("wheel",Object.assign(Object.assign({},e.clone()),{x:e.x,y:e.y,deltaX:this.speedX*t*r,deltaY:this.speedY*t*r})),i()}})};i()},this.canvas=e,this.panning=!1,this.shouldPreventDefault=t,this.init()}init(){this.canvas.addEventListener(ps.POINTER_DOWN,this.bindPointerDown),this.canvas.addEventListener(ps.POINTER_MOVE,this.bindPointerMove),this.canvas.addEventListener(ps.POINTER_UP,this.bindPointerUp)}destroy(){this.canvas.removeEventListener(ps.POINTER_DOWN,this.bindPointerDown),this.canvas.removeEventListener(ps.POINTER_MOVE,this.bindPointerMove),this.canvas.removeEventListener(ps.POINTER_UP,this.bindPointerUp)}}class Qs{get scrollBarTheme(){return this.spreadsheet.theme.scrollBar}get scrollBarSize(){var e;return null===(e=this.scrollBarTheme)||void 0===e?void 0:e.size}constructor(e){this.scrollFrameId=null,this.getLayoutResult=()=>Object.assign(Object.assign({},this.layoutResult),{cornerNodes:this.getCornerNodes(),seriesNumberNodes:this.getSeriesNumberNodes()}),this.hideScrollBar=()=>{var e,t,i;null===(e=this.hRowScrollBar)||void 0===e||e.setAttribute("visibility","hidden"),null===(t=this.hScrollBar)||void 0===t||t.setAttribute("visibility","hidden"),null===(i=this.vScrollBar)||void 0===i||i.setAttribute("visibility","hidden")},this.delayHideScrollBar=(0,a.debounce)(this.hideScrollBar,1e3),this.delayHideScrollbarOnMobile=()=>{me()&&this.delayHideScrollBar()},this.showVerticalScrollBar=()=>{var e;null===(e=this.vScrollBar)||void 0===e||e.setAttribute("visibility","visible")},this.showHorizontalScrollBar=()=>{var e,t;null===(e=this.hRowScrollBar)||void 0===e||e.setAttribute("visibility","visible"),null===(t=this.hScrollBar)||void 0===t||t.setAttribute("visibility","visible")},this.onContainerWheelForMobileCompatibility=()=>{const e=this.spreadsheet.getCanvasElement();let t,i;e.addEventListener("touchstart",e=>{t=e.touches[0].clientY,this.scrollDirection=void 0}),e.addEventListener("touchend",e=>{i=e.changedTouches[0].clientY,i<t?this.scrollDirection=d.Dh.SCROLL_UP:i>t&&(this.scrollDirection=d.Dh.SCROLL_DOWN)})},this.onContainerWheel=()=>{me()?this.onContainerWheelForMobile():this.onContainerWheelForPc()},this.getMobileWheelDeltaY=e=>this.scrollDirection===d.Dh.SCROLL_UP?Math.max(0,e):this.scrollDirection===d.Dh.SCROLL_DOWN?Math.min(0,e):e,this.onContainerWheelForPc=()=>{const e=this.spreadsheet.getCanvasElement();null==e||e.addEventListener("wheel",this.onWheel)},this.onContainerWheelForMobile=()=>{this.mobileWheel=new Js(this.spreadsheet.container,(e,t,i,s)=>{const{interaction:o}=this.spreadsheet.options;if("auto"!==(null==o?void 0:o.overscrollBehavior))return!0;return this.isScrollOverTheViewport({deltaX:e,deltaY:t,offsetX:i,offsetY:s})}),this.mobileWheel.on("wheel",e=>{this.spreadsheet.hideTooltip();const t=e.originalEvent,{deltaX:i,deltaY:s,x:o,y:n,nativeEvent:r}=e,l=this.getMobileWheelDeltaY(s);this.onWheel(Object.assign(Object.assign({},t),{deltaX:i,deltaY:l,offsetX:o,offsetY:n,__nativeEvent__:r}))}),this.onContainerWheelForMobileCompatibility()},this.bindEvents=()=>{this.onContainerWheel(),this.emitPaginationEvent()},this.setScrollOffset=e=>{Object.keys(e||{}).forEach(t=>{const i=(0,a.get)(e,t);(0,a.isUndefined)(i)||this.spreadsheet.store.set(t,C(i))})},this.getScrollOffset=()=>{const{store:e}=this.spreadsheet;return{scrollX:e.get("scrollX",0),scrollY:e.get("scrollY",0),rowHeaderScrollX:e.get("rowHeaderScrollX",0)}},this.resetScrollX=()=>{this.setScrollOffset({scrollX:0})},this.resetRowScrollX=()=>{this.setScrollOffset({rowHeaderScrollX:0})},this.resetScrollY=()=>{this.setScrollOffset({scrollY:0})},this.resetScrollOffset=()=>{this.setScrollOffset({scrollX:0,scrollY:0,rowHeaderScrollX:0})},this.emitPaginationEvent=()=>{const{pagination:e}=this.spreadsheet.options;if(e){const{current:t=1,pageSize:i}=e,s=this.viewCellHeights.getTotalLength(),o=C((s-1)/i)+1;this.spreadsheet.emit(m.LAYOUT_PAGINATION,{pageSize:i,pageCount:o,total:s,current:t})}},this.unbindEvents=()=>{var e;const t=this.spreadsheet.getCanvasElement();null==t||t.removeEventListener("wheel",this.onWheel),null===(e=this.mobileWheel)||void 0===e||e.destroy()},this.calculateCellWidthHeight=()=>{const{colLeafNodes:e}=this.layoutResult,t=(0,a.reduce)(e,(e,t)=>{const i=(0,a.last)(e)||0;return e.push(i+t.width),e},[0]);this.viewCellWidths=t,this.viewCellHeights=this.getViewCellHeights()},this.getRealScrollX=(e,t=0)=>this.spreadsheet.isFrozenRowHeader()?t:e,this.getRealWidth=()=>(0,a.last)(this.viewCellWidths)||0,this.getRealHeight=()=>{const{pagination:e}=this.spreadsheet.options,t=this.viewCellHeights;if(e){const{start:e,end:i}=this.getCellRange();return t.getCellOffsetY(i+1)-t.getCellOffsetY(e)}return t.getTotalHeight()},this.scrollWithAnimation=(e={},t=200,i)=>{var s,o,n,r;const{scrollX:l,scrollY:a,rowHeaderScrollX:d}=this.getAdjustedScrollOffset({scrollX:(null===(s=e.offsetX)||void 0===s?void 0:s.value)||0,scrollY:(null===(o=e.offsetY)||void 0===o?void 0:o.value)||0,rowHeaderScrollX:(null===(n=e.rowHeaderOffsetX)||void 0===n?void 0:n.value)||0});null===(r=this.timer)||void 0===r||r.stop();const c=this.getScrollOffset(),h=[null!=l?l:c.scrollX,null!=a?a:c.scrollY,null!=d?d:c.rowHeaderScrollX],u=(0,ls.A)(Object.values(c),h);this.timer=(0,as.O1)(s=>{try{const o=Math.min(s/t,1),[n,r,l]=u(o);this.setScrollOffset({rowHeaderScrollX:l,scrollX:n,scrollY:r}),this.startScroll(null==e?void 0:e.skipScrollEvent),s>t&&(this.timer.stop(),null==i||i())}catch(e){console.error(e),this.timer.stop()}})},this.scrollImmediately=(e={})=>{var t,i,s;const{scrollX:o,scrollY:n,rowHeaderScrollX:r}=this.getAdjustedScrollOffset({scrollX:(null===(t=e.offsetX)||void 0===t?void 0:t.value)||0,scrollY:(null===(i=e.offsetY)||void 0===i?void 0:i.value)||0,rowHeaderScrollX:(null===(s=e.rowHeaderOffsetX)||void 0===s?void 0:s.value)||0});this.setScrollOffset({scrollX:o,scrollY:n,rowHeaderScrollX:r}),this.startScroll(null==e?void 0:e.skipScrollEvent)},this.startScroll=(e=!1)=>{var t,i,s;const{rowHeaderScrollX:o,scrollX:n,scrollY:r}=this.getScrollOffset();null===(t=this.hRowScrollBar)||void 0===t||t.onlyUpdateThumbOffset(this.getScrollBarOffset(o,this.hRowScrollBar)),null===(i=this.hScrollBar)||void 0===i||i.onlyUpdateThumbOffset(this.getScrollBarOffset(n,this.hScrollBar)),null===(s=this.vScrollBar)||void 0===s||s.onlyUpdateThumbOffset(this.getScrollBarOffset(r,this.vScrollBar)),this.dynamicRenderCell(e)},this.getRendererHeight=()=>{const{start:e,end:t}=this.getCellRange();return this.viewCellHeights.getCellOffsetY(t+1)-this.viewCellHeights.getCellOffsetY(e)},this.getAdjustedScrollOffset=({scrollX:e,scrollY:t,rowHeaderScrollX:i})=>({scrollX:Qi(e,this.layoutResult.colsHierarchy.width,this.panelBBox.width),scrollY:Qi(t,this.getRendererHeight(),this.panelBBox.height),rowHeaderScrollX:Ji(i,this.cornerBBox)}),this.getScrollBarOffset=(e,t)=>{const{trackLen:i,thumbLen:s,scrollTargetMaxOffset:o}=t;return e*(i-s)/o},this.isScrollOverThePanelArea=({offsetX:e,offsetY:t})=>e>this.panelBBox.minX&&e<this.panelBBox.maxX&&t>this.panelBBox.minY&&t<this.panelBBox.maxY,this.isScrollOverTheCornerArea=({offsetX:e,offsetY:t})=>e>this.cornerBBox.minX&&e<this.cornerBBox.maxX&&t>this.cornerBBox.minY&&t<this.cornerBBox.maxY+this.panelBBox.height,this.updateHorizontalRowScrollOffset=({offset:e,offsetX:t,offsetY:i})=>{var s;this.isScrollOverTheCornerArea({offsetX:t,offsetY:i})&&(null===(s=this.hRowScrollBar)||void 0===s||s.emitScrollChange(e))},this.updateHorizontalScrollOffset=({offset:e,offsetX:t,offsetY:i})=>{var s;this.hRowScrollBar&&!this.isScrollOverThePanelArea({offsetX:t,offsetY:i})||null===(s=this.hScrollBar)||void 0===s||s.emitScrollChange(e)},this.isScrollToLeft=({deltaX:e,offsetX:t,offsetY:i})=>{if(!this.hScrollBar&&!this.hRowScrollBar)return!0;const s=!this.hRowScrollBar||this.isScrollOverThePanelArea({offsetY:i,offsetX:t})||this.hRowScrollBar.thumbOffset<=0;return e<=0&&(!this.hScrollBar||this.hScrollBar.thumbOffset<=0)&&s},this.isScrollToRight=({deltaX:e,offsetX:t,offsetY:i})=>{var s,o,n,r,l,a;if(!this.hScrollBar&&!this.hRowScrollBar)return!0;const d=this.spreadsheet.isFrozenRowHeader()?null===(s=this.panelBBox)||void 0===s?void 0:s.width:null===(o=this.panelBBox)||void 0===o?void 0:o.maxX,c=!this.hRowScrollBar||this.isScrollOverThePanelArea({offsetY:i,offsetX:t})||(null===(n=this.hRowScrollBar)||void 0===n?void 0:n.thumbOffset)+(null===(r=this.hRowScrollBar)||void 0===r?void 0:r.thumbLen)>=this.cornerBBox.width,h=this.hRowScrollBar&&this.isScrollOverTheCornerArea({offsetX:t,offsetY:i})||(null===(l=this.hScrollBar)||void 0===l?void 0:l.thumbOffset)+(null===(a=this.hScrollBar)||void 0===a?void 0:a.thumbLen)>=d;return e>=0&&h&&c},this.isScrollToTop=e=>{var t;return!this.vScrollBar||e<=0&&(null===(t=this.vScrollBar)||void 0===t?void 0:t.thumbOffset)<=0},this.isScrollToBottom=e=>{var t,i,s;return!this.vScrollBar||e>=0&&(null===(t=this.vScrollBar)||void 0===t?void 0:t.thumbOffset)+(null===(i=this.vScrollBar)||void 0===i?void 0:i.thumbLen)>=(null===(s=this.panelBBox)||void 0===s?void 0:s.height)},this.isVerticalScrollOverTheViewport=e=>!this.isScrollToTop(e)&&!this.isScrollToBottom(e),this.isHorizontalScrollOverTheViewport=e=>!this.isScrollToLeft(e)&&!this.isScrollToRight(e),this.isScrollOverTheViewport=e=>{const{deltaY:t,deltaX:i,offsetY:s}=e;return!(s<=this.cornerBBox.maxY)&&(0!==t?this.isVerticalScrollOverTheViewport(t):0!==i&&this.isHorizontalScrollOverTheViewport(e))},this.cancelScrollFrame=()=>(!me()||!this.scrollFrameId)&&(cancelAnimationFrame(this.scrollFrameId),!0),this.clearScrollFrameIdOnMobile=()=>{me()&&(this.scrollFrameId=null)},this.stopScrollChainingIfNeeded=e=>{const{interaction:t}=this.spreadsheet.options;"auto"!==(null==t?void 0:t.overscrollBehavior)&&(this.cancelScrollFrame(),this.stopScrollChaining(e))},this.stopScrollChaining=e=>{var t,i;const s=(null==e?void 0:e.__nativeEvent__)||(null==e?void 0:e.nativeEvent);(null==s?void 0:s.cancelable)&&(null===(t=null==s?void 0:s.preventDefault)||void 0===t||t.call(s)),(null==e?void 0:e.cancelable)&&(null===(i=null==e?void 0:e.preventDefault)||void 0===i||i.call(e))},this.onWheel=e=>{const{interaction:t}=this.spreadsheet.options;let{deltaX:i,deltaY:s,offsetX:o,offsetY:n}=e;const{scrollX:r,rowHeaderScrollX:l}=this.getScrollOffset(),{shiftKey:a}=e;a&&ve()&&(o=o-i+s,i=s,n-=s,s=0);const[c,h]=((e,t,i)=>{const s=Math.abs(e/t);return[(s<=.5?0:e)*i.horizontal,(s>2?0:t)*i.vertical]})(i,s,null==t?void 0:t.scrollSpeedRatio);if(this.spreadsheet.hideTooltip(),this.spreadsheet.interaction.clearHoverTimer(),this.isScrollOverTheViewport({deltaX:c,deltaY:h,offsetX:o,offsetY:n})){if(this.stopScrollChaining(e),this.spreadsheet.interaction.addIntercepts([d.fR.HOVER]),this.cancelScrollFrame()){if(0!==c&&void 0!==this.scrollDirection&&this.scrollDirection!==(c>0?d.Dh.SCROLL_LEFT:d.Dh.SCROLL_RIGHT))return this.scrollDirection=c>0?d.Dh.SCROLL_LEFT:d.Dh.SCROLL_RIGHT,this.updateHorizontalRowScrollOffset({offsetX:o,offsetY:n,offset:l}),void this.updateHorizontalScrollOffset({offsetX:o,offsetY:n,offset:r});this.scrollDirection=i>0?d.Dh.SCROLL_LEFT:d.Dh.SCROLL_RIGHT,this.scrollFrameId=requestAnimationFrame(()=>{var e;const{scrollX:t,scrollY:i,rowHeaderScrollX:s}=this.getScrollOffset();0!==c&&(this.showHorizontalScrollBar(),this.updateHorizontalRowScrollOffset({offsetX:o,offsetY:n,offset:c+s}),this.updateHorizontalScrollOffset({offsetX:o,offsetY:n,offset:c+t})),0!==h&&(this.showVerticalScrollBar(),null===(e=this.vScrollBar)||void 0===e||e.emitScrollChange(h+i)),this.delayHideScrollbarOnMobile(),this.clearScrollFrameIdOnMobile()})}}else this.stopScrollChainingIfNeeded(e)},this.realDataCellRender=(e,t)=>{const i=this.calculateXYIndexes(e,t);Zi.U.getInstance().logger("realDataCellRender:",this.preCellIndexes,i);const{add:s,remove:o}=Rs(this.preCellIndexes,i);Zi.U.getInstance().debugCallback(Zi.v7,()=>{var e;if(null===(e=this.spreadsheet.options.future)||void 0===e?void 0:e.experimentalReuseCell){const e=this.getDataCells(),t=Math.max(o.length,s.length);for(let i=0;i<t;i++){if(i<o.length){const[t,s]=o[i],n=(0,a.find)(e,e=>e.name===`${s}-${t}`);n&&this.dataCellPool.release(n)}if(i<s.length){const[e,t]=s[i],o=this.getCellMeta(t,e),n=this.createDataCell(o);n&&this.addDataCell(n)}}Zi.U.getInstance().logger(`Render Cell Panel: ${null==e?void 0:e.length}, Add: ${null==s?void 0:s.length}, Remove: ${null==o?void 0:o.length}`)}else{(0,a.each)(s,([e,t])=>{const i=this.getCellMeta(t,e),s=this.createDataCell(i);s&&this.addDataCell(s)});const e=this.getDataCells();(0,a.each)(o,([t,i])=>{const s=(0,a.find)(e,e=>e.name===`${i}-${t}`);null==s||s.destroy()}),Zi.U.getInstance().logger(`Render Cell Panel: ${null==e?void 0:e.length}, Add: ${null==s?void 0:s.length}, Remove: ${null==o?void 0:o.length}`)}}),this.preCellIndexes=i,this.spreadsheet.emit(m.LAYOUT_AFTER_REAL_DATA_CELL_RENDER,{add:s,remove:o,spreadsheet:this.spreadsheet})},this.getGridInfo=()=>{const[e,t,i,s]=this.preCellIndexes.center;return{cols:ns(e,t,this.layoutResult.colLeafNodes),rows:rs(i,s,this.viewCellHeights)}},this.onAfterScroll=(0,a.debounce)(()=>{const{interaction:e,container:t}=this.spreadsheet;if(!e.isSelectedState()&&(e.removeIntercepts([d.fR.HOVER]),e.getHoverAfterScroll())){const i=e.eventController.canvasMousemoveEvent;if(i){const{x:e,y:s}=i,o=t.document.elementFromPointSync(e,s);o&&t.emit(ps.POINTER_MOVE,Object.assign(Object.assign({},i),{shape:o,target:o,timestamp:performance.now()}))}}},300),this.getCellChildrenNodes=e=>{var t;const i=null===(t=null==e?void 0:e.getMeta)||void 0===t?void 0:t.call(e),s=(null==e?void 0:e.cellType)===d.vZ.ROW_CELL;return this.spreadsheet.isHierarchyTreeType()&&s?Ns.getAllLeaveNodes(i).filter(e=>e.rowIndex===i.rowIndex):Ns.getAllChildrenNodes(i)},this.spreadsheet=e,this.init()}shouldRender(){return!((0,a.isEmpty)((e=this.spreadsheet.dataCfg.fields).rows)&&(0,a.isEmpty)(e.columns)&&(0,a.isEmpty)(e.values));var e}initTextWrapTemp(){var e;const t=[{},this.spreadsheet,{shallowRender:!0}];this.textWrapTempRowCell=this.getRowCellInstance(...t),this.textWrapTempColCell=this.getColCellInstance(...t),this.textWrapTempCornerCell=null===(e=this.getCornerCellInstance)||void 0===e?void 0:e.call(this,...t),this.textWrapNodeHeightCache=(0,Q.A)(500),this.customRowHeightStatusMap={}}initGroups(){this.initBackgroundGroup(),this.initPanelGroups(),this.initForegroundGroup()}initForegroundGroup(){this.foregroundGroup=this.spreadsheet.container.appendChild(new l.YJ({name:h.xB,style:{zIndex:3}}))}initBackgroundGroup(){this.backgroundGroup=this.spreadsheet.container.appendChild(new l.YJ({name:h.Oe,style:{zIndex:0}}))}initPanelGroups(){this.panelGroup=this.spreadsheet.container.appendChild(new l.YJ({name:h.Z0,style:{zIndex:1}})),this.panelScrollGroup=new bs({name:h.vO,zIndex:1,s2:this.spreadsheet}),this.panelGroup.appendChild(this.panelScrollGroup)}getCellCustomSize(e,t){return(0,a.isFunction)(t)?t(e):t}getRowCellDraggedWidth(e){var t,i,s;const{rowCell:o}=this.spreadsheet.options.style;return null!==(i=null===(t=null==o?void 0:o.widthByField)||void 0===t?void 0:t[null==e?void 0:e.id])&&void 0!==i?i:null===(s=null==o?void 0:o.widthByField)||void 0===s?void 0:s[null==e?void 0:e.field]}getRowCellDraggedHeight(e){var t,i,s;const{rowCell:o}=this.spreadsheet.options.style;return null!==(i=null===(t=null==o?void 0:o.heightByField)||void 0===t?void 0:t[null==e?void 0:e.id])&&void 0!==i?i:null===(s=null==o?void 0:o.heightByField)||void 0===s?void 0:s[null==e?void 0:e.field]}isCustomRowCellHeight(e){var t;const{dataCell:i}=this.spreadsheet.options.style,s=null===(t=Ui.dataCell)||void 0===t?void 0:t.height;return(0,a.isNumber)(this.getCustomRowCellHeight(e))||(null==i?void 0:i.height)!==s}getCustomRowCellHeight(e){var t;const{rowCell:i}=this.spreadsheet.options.style;return null!==(t=this.getRowCellDraggedHeight(e))&&void 0!==t?t:this.getCellCustomSize(e,null==i?void 0:i.height)}getRowCellHeight(e){var t;const{dataCell:i}=this.spreadsheet.options.style;return null!==(t=this.getCustomRowCellHeight(e))&&void 0!==t?t:null==i?void 0:i.height}getColCellDraggedWidth(e){var t,i,s,o,n,r;const{colCell:l}=this.spreadsheet.options.style;return null!==(o=null!==(i=null===(t=null==l?void 0:l.widthByField)||void 0===t?void 0:t[null==e?void 0:e.id])&&void 0!==i?i:null===(s=null==l?void 0:l.widthByField)||void 0===s?void 0:s[null==e?void 0:e.field])&&void 0!==o?o:null===(n=null==l?void 0:l.widthByField)||void 0===n?void 0:n[null===(r=null==e?void 0:e.query)||void 0===r?void 0:r[ye.GJ]]}getColCellDraggedHeight(e){var t,i,s,o,n,r;const{colCell:l}=this.spreadsheet.options.style;return null!==(o=null!==(i=null===(t=null==l?void 0:l.heightByField)||void 0===t?void 0:t[null==e?void 0:e.id])&&void 0!==i?i:null===(s=null==l?void 0:l.heightByField)||void 0===s?void 0:s[null==e?void 0:e.field])&&void 0!==o?o:null===(n=null==l?void 0:l.heightByField)||void 0===n?void 0:n[null===(r=null==e?void 0:e.query)||void 0===r?void 0:r[ye.GJ]]}getColNodeHeight(e){var t,i,s;const{colNode:o,colsHierarchy:n,useCache:r=!0,cornerNodes:l=[]}=e;if(!o)return 0;const{colCell:d,cornerCell:c}=this.spreadsheet.options.style,h=null!==(t=this.getColCellDraggedHeight(o))&&void 0!==t?t:this.getCellCustomSize(o,null==d?void 0:d.height);if((0,a.isNumber)(h)&&h!==(null===(i=Ui.colCell)||void 0===i?void 0:i.height))return o.extra.isCustomHeight=!0,h;const u=(null==d?void 0:d.maxLines)>1&&(null==d?void 0:d.wordWrap)||this.spreadsheet.theme.colCell.text.fontSize>12||this.spreadsheet.theme.colCell.bolderText.fontSize>12,p=(null==c?void 0:c.maxLines)>1&&(null==c?void 0:c.wordWrap)||this.spreadsheet.theme.cornerCell.text.fontSize>12||this.spreadsheet.theme.cornerCell.bolderText.fontSize>12,g=this.getDefaultColNodeHeight(o,n);let m=g,v=g;if(u&&(m=this.getNodeAdaptiveHeight({meta:o,cell:this.textWrapTempColCell,defaultHeight:g,useCache:r})),p){const e=l.filter(e=>o.isLeaf?e.cornerType===gs.Q.Row:e.field===o.field);(0,a.isEmpty)(e)||(v=null!==(s=(0,a.max)(e.map(e=>this.getNodeAdaptiveHeight({meta:e,cell:this.textWrapTempCornerCell,defaultHeight:g,useCache:!1}))))&&void 0!==s?s:g)}return y(Math.max(v,m,g))}getDefaultColNodeHeight(e,t){var i,s,o,n;if(!e)return 0;const{colCell:r}=this.spreadsheet.options.style,l=(null===(s=null===(i=null==t?void 0:t.sampleNodesForAllLevels)||void 0===i?void 0:i.find(t=>t.level===e.level))||void 0===s?void 0:s.height)||0,a=null!==(n=null!==(o=this.getColCellDraggedHeight(e))&&void 0!==o?o:this.getCellCustomSize(e,null==r?void 0:r.height))&&void 0!==n?n:0;return y(Math.max(a,l))}getNodeAdaptiveHeight(e){var t,i;const{meta:s,cell:o,defaultHeight:n=0,useCache:r=!0}=e;if(!s||!o)return n;o.setMeta(Object.assign(Object.assign({},s),{shallowRender:!0}));const l=String(o.getFieldValue());if(!l)return n;const c=Math.ceil(o.getMaxTextWidth());if(c<=0&&o.cellType===d.vZ.COL_CELL)return n;const h=`${l}[&]${c}`,u=this.textWrapNodeHeightCache.get(h);if(r&&(0,a.isNumber)(u))return u||n;null===(i=(t=o).generateIconConfig)||void 0===i||i.call(t),o.drawTextShape();const{padding:p}=o.getStyle().cell,g=o.getActualTextHeight(),m=g+p.top+p.bottom,v=g>1.5*o.getTextLineHeight()||g>=n?Math.max(m,n):n;return this.textWrapNodeHeightCache.set(h,v),v}calculateColParentNodeWidthAndX(e){var t;let i=null,s=0;const o=e.slice(0);for(;s<o.length;){const e=o[s++],n=null==e?void 0:e.parent;if(i!==n&&n){o.push(n);const e=null===(t=n.children)||void 0===t?void 0:t.find(e=>e.width),s=(null==e?void 0:e.x)||0,r=(0,a.sumBy)(n.children,"width");n.x=s,n.width=r,i=n}}}updateColsHierarchySampleMaxHeightNodes(e,t){var i;const s=(0,a.isEmpty)(e.sampleNodesForAllLevels),o=(s?e.allNodesWithoutRoot:e.sampleNodesForAllLevels).map(t=>(0,a.maxBy)(e.getNodes(t.level).filter(e=>!e.isTotals||s),t=>this.getColNodeHeight({colNode:t,colsHierarchy:e})));s&&(e.sampleNodeForLastLevel=null!==(i=o[0])&&void 0!==i?i:null,e.maxLevel=0),e.sampleNodesForAllLevels=(0,a.compact)(o);const n=t?As.getCornerNodes({position:{x:0,y:0},width:t.width,height:e.height,layoutResult:{rowsHierarchy:t,colsHierarchy:e},seriesNumberWidth:this.getSeriesNumberWidth(),spreadsheet:this.spreadsheet}):[];e.sampleNodesForAllLevels.forEach(t=>{var i;if(t.height=this.getColNodeHeight({colNode:t,colsHierarchy:e,cornerNodes:n}),0===t.level)t.y=0;else{const s=null!==(i=e.sampleNodesForAllLevels[t.level-1])&&void 0!==i?i:{y:0,height:0};t.y=s.y+s.height}e.height+=t.height}),e.rootNode.height=e.height}render(){this.shouldRender()&&(this.adjustScrollOffset(),this.renderHeaders(),this.renderScrollBars(),this.renderBackground(),this.dynamicRenderCell(!0))}adjustScrollOffset(){const e=this.getAdjustedScrollOffset(this.getScrollOffset());this.setScrollOffset(e)}getSeriesNumberWidth(){var e,t;const{seriesNumber:i}=this.spreadsheet.options;return y((null==i?void 0:i.enable)&&null!==(t=null===(e=this.spreadsheet.theme.rowCell)||void 0===e?void 0:e.seriesNumberWidth)&&void 0!==t?t:0)}getCanvasSize(){const{width:e=0,height:t=0}=this.spreadsheet.options;return{width:e,height:t}}updateScrollOffset(e){var t,i,s;(null===(t=e.rowHeaderOffsetX)||void 0===t?void 0:t.animate)||(null===(i=e.offsetX)||void 0===i?void 0:i.animate)||(null===(s=e.offsetY)||void 0===s?void 0:s.animate)?this.scrollWithAnimation(e):this.scrollImmediately(e)}getPaginationScrollY(){const{pagination:e}=this.spreadsheet.options;if(e){const{current:t=1,pageSize:i}=e,s=this.viewCellHeights,o=Math.max((t-1)*i,0);return s.getCellOffsetY(o)}return 0}destroy(){this.unbindEvents(),this.clearAllGroup(),this.preCellIndexes=null,this.customRowHeightStatusMap={},this.textWrapNodeHeightCache.clear(!1),cancelAnimationFrame(this.scrollFrameId)}calculateCornerBBox(){this.cornerBBox=new is(this,!0)}calculatePanelBBox(){this.panelBBox=new Is(this,!0)}getCellRange(){const{pagination:e}=this.spreadsheet.options;return((e,t)=>{const i=e;let s=0,o=i.getTotalLength()-1;if(t){const{current:e=1,pageSize:n}=t;s=Math.max((e-1)*n,0),o=Math.min(e*n-1,i.getTotalLength()-1)}return{start:s,end:o}})(this.viewCellHeights,e)}clearAllGroup(){this.panelGroup.remove(),this.foregroundGroup.remove(),this.backgroundGroup.remove()}renderRowScrollBar(e){if(this.spreadsheet.isFrozenRowHeader()&&this.cornerBBox.width<this.cornerBBox.originalWidth){const t=this.cornerBBox.originalWidth-this.cornerBBox.width,{maxY:i}=this.getScrollbarPosition(),{splitLine:s,scrollBar:o}=this.spreadsheet.theme,n=Math.max(this.cornerBBox.width*this.cornerBBox.width/this.cornerBBox.originalWidth,null==o?void 0:o.thumbHorizontalMinSize);this.hRowScrollBar=new Ls({isHorizontal:!0,trackLen:this.cornerBBox.width,thumbLen:n-(null==s?void 0:s.verticalBorderWidth),position:{x:this.cornerBBox.minX+this.scrollBarSize/2,y:i},thumbOffset:e*(this.cornerBBox.width-n)/t,theme:this.scrollBarTheme,scrollTargetMaxOffset:t}),this.hRowScrollBar.addEventListener(Es.ScrollChange,({offset:e})=>{var i,s;const o=C(this.getValidScrollBarOffset(e,t));this.setScrollOffset({rowHeaderScrollX:o}),null===(i=this.rowHeader)||void 0===i||i.onRowScrollX(o,h.k5),null===(s=this.seriesNumberHeader)||void 0===s||s.onRowScrollX(o,h.j6),this.cornerHeader.onRowScrollX(o,h.nO);const n=this.getScrollBarOffset(o,this.hRowScrollBar),{scrollX:r,scrollY:l}=this.getScrollOffset(),a={scrollX:r,scrollY:l,rowHeaderScrollX:n};this.hRowScrollBar.updateThumbOffset(n,!1),this.spreadsheet.emit(m.ROW_CELL_SCROLL,a),this.spreadsheet.emit(m.GLOBAL_SCROLL,a)}),this.foregroundGroup.appendChild(this.hRowScrollBar)}}getValidScrollBarOffset(e,t){return(0,a.clamp)(e,0,t)}renderHScrollBar(e,t,i){if(C(e)<C(t)){const s=this.scrollBarSize/2,{maxY:o}=this.getScrollbarPosition(),n=!this.spreadsheet.isFrozenRowHeader(),r=e+(n?Math.min(this.cornerBBox.width,this.getCanvasSize().width):0),l={x:this.panelBBox.minX+(n?-this.cornerBBox.width+s:s),y:o},a=t+(n?this.cornerBBox.width:0),{scrollBar:d}=this.spreadsheet.theme,c=a-r,h=Math.max(r/a*r,null==d?void 0:d.thumbHorizontalMinSize);this.hScrollBar=new Ls({isHorizontal:!0,trackLen:r,thumbLen:h,position:l,thumbOffset:i*(r-h)/c,theme:this.scrollBarTheme,scrollTargetMaxOffset:c}),this.hScrollBar.addEventListener(Es.ScrollChange,({offset:e,updateThumbOffset:t})=>{const i=this.getValidScrollBarOffset(e,c);t&&this.hScrollBar.updateThumbOffset(this.getScrollBarOffset(i,this.hScrollBar),!1),this.setScrollOffset({scrollX:i}),this.dynamicRenderCell()}),this.foregroundGroup.appendChild(this.hScrollBar)}}getScrollbarPosition(){const{maxX:e,maxY:t}=this.panelBBox,{width:i,height:s}=this.getCanvasSize(),o=this.spreadsheet.options.interaction.scrollbarPosition===d.eb.CONTENT;return{maxX:(o?e:i)-this.scrollBarSize,maxY:(o?t:s)-this.scrollBarSize}}renderVScrollBar(e,t,i){if(e<t){const{scrollBar:s}=this.spreadsheet.theme,o=Math.max(e/t*e,null==s?void 0:s.thumbVerticalMinSize),n=t-e,{maxX:r}=this.getScrollbarPosition();this.vScrollBar=new Ls({isHorizontal:!1,trackLen:e,thumbLen:o,thumbOffset:i*(e-o)/n,position:{x:r,y:this.panelBBox.minY},theme:this.scrollBarTheme,scrollTargetMaxOffset:n}),this.vScrollBar.addEventListener(Es.ScrollChange,({offset:e,updateThumbOffset:t})=>{const i=this.getValidScrollBarOffset(e,n);t&&this.vScrollBar.updateThumbOffset(this.getScrollBarOffset(i,this.vScrollBar),!1),this.setScrollOffset({scrollY:i}),this.dynamicRenderCell()}),this.foregroundGroup.appendChild(this.vScrollBar)}}translateRelatedGroups(e,t,i){var s,o,n,r,l,a;E(this.panelScrollGroup,this.panelBBox.x-e,this.panelBBox.y-t),null===(s=this.rowHeader)||void 0===s||s.onScrollXY(this.getRealScrollX(e,i),t,h.k5),null===(o=this.seriesNumberHeader)||void 0===o||o.onScrollXY(this.getRealScrollX(e,i),t,h.j6),null===(n=this.cornerHeader)||void 0===n||n.onCorScroll(this.getRealScrollX(e,i),h.nO),null===(r=this.centerFrame)||void 0===r||r.onChangeShadowVisibility(e,this.getRealWidth()-this.panelBBox.width),null===(l=this.centerFrame)||void 0===l||l.onBorderScroll(this.getCenterFrameScrollX(e)),null===(a=this.columnHeader)||void 0===a||a.onColScroll(e,h.E2)}getCenterFrameScrollX(e){return this.getRealScrollX(e)}createDataCell(e){var t,i,s;if(!e)return;let o;if(this.dataCellPool.pool.length>0&&(null===(t=this.spreadsheet.options.future)||void 0===t?void 0:t.experimentalReuseCell)?(o=this.dataCellPool.acquire(),o.setMeta(e)):o=null===(s=(i=this.spreadsheet.options).dataCell)||void 0===s?void 0:s.call(i,e,this.spreadsheet),!o)return;const{rowIndex:n,colIndex:r}=e;return o.position=[n,r],o.name=`${n}-${r}`,o}init(){this.initCellPool(),this.initTextWrapTemp(),this.initGroups(),Zi.U.getInstance().debugCallback(Zi.jk,()=>{this.layoutResult=this.doLayout(),this.saveInitColumnLeafNodes(this.layoutResult.colLeafNodes),this.spreadsheet.emit(m.LAYOUT_AFTER_HEADER_LAYOUT,this.layoutResult)}),this.calculateCellWidthHeight(),this.calculateRowOffsets(),this.calculateCornerBBox(),this.calculatePanelBBox(),this.bindEvents()}renderBackground(){const{width:e,height:t}=this.getCanvasSize(),{color:i,opacity:s}=this.spreadsheet.theme.background;this.backgroundGroup.appendChild(new l.rw({style:{fill:i,opacity:s,x:0,y:0,width:e,height:t}}))}renderScrollBars(){const{scrollX:e,scrollY:t,rowHeaderScrollX:i}=this.getScrollOffset(),{width:s,height:o}=this.panelBBox,n=this.layoutResult.colsHierarchy.width,r=this.getRealHeight();this.renderRowScrollBar(i),this.renderHScrollBar(s,n,e),this.renderVScrollBar(o,r,t)}renderHeaders(){const e=this.getSeriesNumberWidth();this.rowHeader=this.getRowHeader(),this.columnHeader=this.getColHeader(),e>0&&!this.seriesNumberHeader&&(this.seriesNumberHeader=this.getSeriesNumberHeader()),this.cornerHeader=this.getCornerHeader(),this.centerFrame=this.getCenterFrame(),this.seriesNumberHeader&&this.foregroundGroup.appendChild(this.seriesNumberHeader),this.rowHeader&&this.foregroundGroup.appendChild(this.rowHeader),this.foregroundGroup.appendChild(this.columnHeader),this.foregroundGroup.appendChild(this.cornerHeader),this.foregroundGroup.appendChild(this.centerFrame)}getRowHeaderCfg(){const{y:e,viewportHeight:t,viewportWidth:i,height:s}=this.panelBBox,o=this.getSeriesNumberWidth();return{width:this.cornerBBox.width,height:s,viewportWidth:i,viewportHeight:t,position:{x:o,y:e},nodes:this.layoutResult.rowNodes,spreadsheet:this.spreadsheet}}getRowHeader(){return this.rowHeader?this.rowHeader:new Gs(this.getRowHeaderCfg())}getColHeader(){if(!this.columnHeader){const{x:e,width:t,viewportHeight:i,viewportWidth:s}=this.panelBBox;return new $s({width:t,cornerWidth:this.cornerBBox.width,height:this.cornerBBox.height,viewportWidth:s,viewportHeight:i,position:{x:e,y:0},nodes:this.layoutResult.colNodes,sortParam:this.spreadsheet.store.get("sortParam"),spreadsheet:this.spreadsheet})}return this.columnHeader}getCornerHeader(){return this.cornerHeader||As.getCornerHeader({panelBBox:this.panelBBox,cornerBBox:this.cornerBBox,seriesNumberWidth:this.getSeriesNumberWidth(),layoutResult:this.layoutResult,spreadsheet:this.spreadsheet})}getSeriesNumberHeader(){return this.seriesNumberHeader||Ys.getSeriesNumberHeader({spreadsheet:this.spreadsheet,panelBBox:this.panelBBox,cornerWidth:this.cornerBBox.width,seriesNumberWidth:this.getSeriesNumberWidth(),rowsHierarchy:this.layoutResult.rowsHierarchy})}getCenterFrame(){var e;if(!this.centerFrame){const{viewportWidth:t,viewportHeight:i}=this.panelBBox,s=null===(e=this.spreadsheet.options)||void 0===e?void 0:e.frame,o={position:{x:this.cornerBBox.x,y:this.cornerBBox.y},cornerWidth:this.cornerBBox.width,cornerHeight:this.cornerBBox.height,viewportWidth:t,viewportHeight:i,showViewportLeftShadow:!1,showViewportRightShadow:!1,spreadsheet:this.spreadsheet};return s?s(o):new T(o)}return this.centerFrame}updatePanelScrollGroup(){this.gridInfo=this.getGridInfo(),this.panelScrollGroup.update(this.gridInfo)}dynamicRenderCell(e){const{scrollX:t,scrollY:i,rowHeaderScrollX:s}=this.getScrollOffset(),o=i+this.getPaginationScrollY();this.spreadsheet.hideTooltip(),this.spreadsheet.interaction.clearHoverTimer(),this.realDataCellRender(t,o),this.updatePanelScrollGroup(),this.translateRelatedGroups(t,o,s),this.clip(t,o),e||this.emitScrollEvent({scrollX:t,scrollY:o,rowHeaderScrollX:s}),this.onAfterScroll()}emitScrollEvent(e){this.spreadsheet.emit(m.GLOBAL_SCROLL,e)}saveInitColumnLeafNodes(e=[]){const{store:t,options:i}=this.spreadsheet,{hiddenColumnFields:s=[]}=i.interaction,o=e.length+s.length,n=this.getInitColLeafNodes();o!==(null==n?void 0:n.length)&&t.set("initColLeafNodes",e)}getHiddenColumnsInfo(e){const t=this.spreadsheet.store.get("hiddenColumnsDetail",[]);if(!(0,a.isEmpty)(t))return t.find(t=>{var i;return null===(i=null==t?void 0:t.hideColumnNodes)||void 0===i?void 0:i.some(t=>t.id===e.id)})}updateCustomFieldsSampleNodes(e){var t;if(!this.spreadsheet.isCustomColumnFields())return;const i=(null===(t=e.sampleNodeForLastLevel)||void 0===t?void 0:t.id.split("[&]"))||[],s=e.getNodes().filter(t=>{var s;return(null===(s=e.sampleNodeForLastLevel)||void 0===s?void 0:s.id.includes(t.id))&&i.includes(t.field)});e.sampleNodesForAllLevels=s,e.height=(0,a.sumBy)(s,"height")}adjustCustomRowLeafNodesWidth(e){this.spreadsheet.isCustomRowFields()&&this.adjustLeafNodesSize("width")(e)}adjustCustomColLeafNodesHeight(e){this.spreadsheet.isCustomColumnFields()&&this.adjustLeafNodesSize("height")(e)}adjustLeafNodesSize(e){return({leafNodes:t,hierarchy:i})=>{const{sampleNodeForLastLevel:s,sampleNodesForAllLevels:o}=i;t.forEach(t=>{if(t.level>(null==s?void 0:s.level))return;const i=(0,a.sumBy)(o,i=>i.level<t.level?0:i[e]);t[e]=i})}}getHeaderNodes(e){const t=(0,a.concat)(this.getCornerNodes(),this.getSeriesNumberNodes(),this.getRowNodes(),this.getColNodes());return e?t.filter(t=>e.includes(t.id)):t}getCornerNodes(){var e;return(null===(e=this.cornerHeader)||void 0===e?void 0:e.getNodes())||[]}getSeriesNumberNodes(){var e;return(null===(e=this.seriesNumberHeader)||void 0===e?void 0:e.getNodes())||[]}getColNodes(e){const{colNodes:t=[]}=this.layoutResult;return(0,a.isNil)(e)?t:t.filter(t=>t.level===e)}getTopLevelColNodes(){return this.getColNodes(0)}getColNodeById(e){return this.getColNodes().find(t=>t.id===e)}getColNodeByIndex(e){return this.getColNodes().find(t=>t.colIndex===e)}getColLeafNodesByRange(e,t){return this.getColLeafNodes().filter(i=>i.colIndex>=e&&i.colIndex<=t)}getColLeafNodeByIndex(e){return this.getColLeafNodes().find(t=>t.colIndex===e)}getColNodesByField(e){return this.getColNodes().filter(t=>t.field===e)}getColLeafNodes(){var e;return(null===(e=this.layoutResult)||void 0===e?void 0:e.colLeafNodes)||[]}getColTotalsNodes(e){return this.getColNodes(e).filter(e=>e.isTotals)}getColSubTotalsNodes(e){return this.getColTotalsNodes(e).filter(e=>e.isSubTotals)}getColGrandTotalsNodes(e){return this.getColTotalsNodes(e).filter(e=>e.isGrandTotals)}getRowNodes(e){const{rowNodes:t=[]}=this.layoutResult;return(0,a.isNil)(e)?t:t.filter(t=>t.level===e)}getRowNodeById(e){return this.getRowNodes().find(t=>t.id===e)}getRowNodeByIndex(e){return this.getRowNodes().find(t=>t.rowIndex===e)}getRowLeafNodeByIndex(e){return this.getRowLeafNodes().find(t=>t.rowIndex===e)}getRowLeafNodesByRange(e,t){return this.getRowLeafNodes().filter(i=>i.rowIndex>=e&&i.rowIndex<=t)}getRowNodesByField(e){return this.getRowNodes().filter(t=>t.field===e)}getRowLeafNodes(){var e;return(null===(e=this.layoutResult)||void 0===e?void 0:e.rowLeafNodes)||[]}getRowTotalsNodes(e){return this.getRowNodes(e).filter(e=>e.isTotals)}getRowSubTotalsNodes(e){return this.getRowTotalsNodes(e).filter(e=>e.isSubTotals)}getRowGrandTotalsNodes(e){return this.getRowTotalsNodes(e).filter(e=>e.isGrandTotals)}getDataCells(){var e;return es(null===(e=this.panelGroup)||void 0===e?void 0:e.children,Ri)}getRowCells(){var e;const t=(null===(e=this.getRowHeader())||void 0===e?void 0:e.children)||[];return es(t,ds).filter(e=>e.cellType===d.vZ.ROW_CELL)}getRowLeafCells(){return this.getRowCells().filter(e=>e.getMeta().isLeaf)}getColCells(){var e;const t=(null===(e=this.getColHeader())||void 0===e?void 0:e.children)||[];return es(t,Ti).filter(e=>e.cellType===d.vZ.COL_CELL)}getColLeafCells(){return this.getColCells().filter(e=>e.getMeta().isLeaf)}getMergedCells(){return(0,a.filter)(this.panelScrollGroup.getMergedCellsGroup().children,e=>e instanceof us)}getCornerCells(){var e;const t=(null===(e=this.getCornerHeader())||void 0===e?void 0:e.children)||[];return es(t,ms).filter(e=>e.cellType===d.vZ.CORNER_CELL)}filterCells(e,t){return(0,a.isEmpty)(t)?e:(0,a.isArray)(t)?e.filter(e=>(0,a.includes)(t,e.getMeta().id)):e.filter(e=>{const i=t[e.cellType];return!!i&&i.includes(e.getMeta().id)})}getHeaderCells(e){const t=(0,a.concat)(this.getCornerCells(),this.getSeriesNumberCells(),this.getRowCells(),this.getColCells());return this.filterCells(t,e)}getCellById(e){return this.getCells().find(t=>t.getMeta().id===e)}getCellsByField(e){return this.getCells().filter(t=>t.getMeta().field===e)}getCells(e){const t=(0,a.concat)(this.getHeaderCells(),this.getDataCells());return e?t.filter(t=>e.includes(t.getMeta().id)):t}getInitColIndexLeafNodes(){return this.layoutResult.colsHierarchy.getIndexNodes()||[]}getInitColLeafNodes(){return this.spreadsheet.store.get("initColLeafNodes",[])}clearInitColLeafNodes(){this.spreadsheet.store.set("initColLeafNodes",void 0)}measureTextWidth(e,t){return Math.ceil(this.spreadsheet.measureTextWidth(e,t))+1}initCellPool(){this.dataCellPool=new fs}}class eo extends Qs{constructor(){super(...arguments),this.frozenGroupAreas={[s.Col]:{width:0,x:0,range:[]},[s.TrailingCol]:{width:0,x:0,range:[]},[s.Row]:{height:0,y:0,range:[]},[s.TrailingRow]:{height:0,y:0,range:[]}},this.panelScrollGroupIndexes=[0,0,0,0],this.addDataCell=e=>{const t=this.getColLeafNodes().length,i=this.getCellRange(),s=((e,t,i,s)=>{const{colCount:n=0,rowCount:r=0,trailingColCount:l=0,trailingRowCount:a=0}=t,{colIndex:d,rowIndex:c}=e;return S(c,s.start,r)?o.Row:b(c,s.end,a)?o.TrailingRow:x(d,n)?o.Col:_(d,l,i)?o.TrailingCol:o.Scroll})(e.getMeta(),this.getFrozenOptions(),t,i);var n;s===o.Scroll?e.parentElement!==this.panelScrollGroup&&this.panelScrollGroup.appendChild(e):e.parentElement!==this.frozenGroups[s]&&this.frozenGroups[s].appendChild(e),n=()=>{this.spreadsheet.emit(m.DATA_CELL_RENDER,e),this.spreadsheet.emit(m.LAYOUT_CELL_RENDER,e)},Promise.resolve().then(()=>{n()})},this.addFrozenCell=(e,t,i)=>{const s=this.getCellMeta(t,e);if(s){s.isFrozenCorner=!0;const e=this.createDataCell(s);i.appendChild(e)}},this.translateFrozenGroups=()=>{const{scrollY:e,scrollX:t}=this.getScrollOffset(),i=this.getPaginationScrollY(),{x:s,y:n,viewportWidth:r,viewportHeight:l}=this.panelBBox,a=Fs(this,this.cornerBBox.width,t),d=Ps(this,r),c=js(this,l,i);E(this.frozenGroups[o.TopLeft],s-a,n-i),E(this.frozenGroups[o.TopRight],s-d,n-i),E(this.frozenGroups[o.BottomLeft],s-a,n-c),E(this.frozenGroups[o.BottomRight],s-d,n-c),E(this.frozenGroups[o.Row],s-t,n-i),E(this.frozenGroups[o.TrailingRow],s-t,n-c),E(this.frozenGroups[o.Col],s-a,n-e-i),E(this.frozenGroups[o.TrailingCol],s-d,n-e-i)},this.renderFrozenGroupSplitLine=(e,t)=>{var i;const s=Math.floor(t-this.getPaginationScrollY());null===(i=this.foregroundGroup.getElementById(h.Pu))||void 0===i||i.remove();const{splitLine:o}=this.spreadsheet.theme,n=this.foregroundGroup.appendChild(new l.YJ({id:h.Pu,style:{zIndex:4}})),r={lineWidth:1,stroke:null==o?void 0:o.verticalBorderColor,opacity:null==o?void 0:o.verticalBorderColorOpacity},a={lineWidth:1,stroke:null==o?void 0:o.horizontalBorderColor,opacity:null==o?void 0:o.horizontalBorderColorOpacity};this.renderFrozenColSplitLine(n,o,r,e),this.renderFrozenTrailingColSplitLine(n,o,r,e),this.renderFrozenRowSplitLine(n,o,a,s),this.renderFrozenTrailingRowSplitLine(n,o,a,s)},this.renderFrozenPanelCornerGroup=()=>{const e=this.getCellRange(),t=((e,t,i)=>{const{colCount:s=0,rowCount:n=0,trailingColCount:r=0,trailingRowCount:l=0}=e,a={[o.TopLeft]:[],[o.TopRight]:[],[o.BottomLeft]:[],[o.BottomRight]:[]};for(let e=0;e<s;e++){for(let t=i.start;t<i.start+n;t++)a[o.TopLeft].push({x:e,y:t});if(l>0)for(let t=0;t<l;t++)a[o.BottomLeft].push({x:e,y:i.end-t})}for(let e=0;e<r;e++){const s=t-1-e;for(let e=i.start;e<i.start+n;e++)a[o.TopRight].push({x:s,y:e});if(l>0)for(let e=0;e<l;e++)a[o.BottomRight].push({x:s,y:i.end-e})}return a})(this.getFrozenOptions(),this.getColLeafNodes().length,e);Object.keys(t||{}).forEach(e=>{const i=this.frozenGroups[e];i&&t[e].forEach(e=>{this.addFrozenCell(e.x,e.y,i)})})},this.getTotalHeightForRange=(e,t)=>{if(e<0||t<0)return 0;if(this.rowOffsets)return this.rowOffsets[t+1]-this.rowOffsets[e];let i=0;for(let s=e;s<t+1;s++){i+=this.getDefaultCellHeight()}return i},this.getShadowFill=e=>{var t,i;const{splitLine:s}=this.spreadsheet.theme;return`l (${e}) 0:${null===(t=null==s?void 0:s.shadowColors)||void 0===t?void 0:t.left} 1:${null===(i=null==s?void 0:s.shadowColors)||void 0===i?void 0:i.right}`}}initPanelGroups(){super.initPanelGroups(),this.frozenGroups=[o.Row,o.Col,o.TrailingRow,o.TrailingCol,o.TopLeft,o.TopRight,o.BottomLeft,o.BottomRight].reduce((e,t)=>{const i=new os({name:t,zIndex:4,s2:this.spreadsheet});return this.panelGroup.appendChild(i),e[t]=i,e},{})}getFrozenOptions(){if(!this.validFrozenOptions){const e=this.getColLeafNodes().length,t=this.getCellRange();this.validFrozenOptions=((e={},t,i=0)=>{const s=Object.assign(Object.assign({},Yi),e);s.colCount>=t&&(s.colCount=t);const o=t-s.colCount;s.trailingColCount>o&&(s.trailingColCount=o),s.rowCount>=i&&(s.rowCount=i);const n=i-s.rowCount;return s.trailingRowCount>n&&(s.trailingRowCount=n),s})(this.spreadsheet.options.frozen,e,t.end-t.start+1)}return this.validFrozenOptions}calculateFrozenGroupInfo(){const{colCount:e,rowCount:t,trailingColCount:i,trailingRowCount:o}=this.getFrozenOptions(),n=this.viewCellHeights,r=this.getCellRange(),l=this.getColLeafNodes();e>0&&(this.frozenGroupAreas[s.Col].width=l[e-1].x+l[e-1].width,this.frozenGroupAreas[s.Col].x=0,this.frozenGroupAreas[s.Col].range=[0,e-1]),t>0&&(this.frozenGroupAreas[s.Row].height=n.getCellOffsetY(r.start+t)-n.getCellOffsetY(r.start),this.frozenGroupAreas[s.Row].y=n.getCellOffsetY(r.start),this.frozenGroupAreas[s.Row].range=[r.start,r.start+t-1]),i>0&&(this.frozenGroupAreas[s.TrailingCol].width=l[l.length-1].x-l[l.length-i].x+l[l.length-1].width,this.frozenGroupAreas[s.TrailingCol].x=l[l.length-i].x,this.frozenGroupAreas[s.TrailingCol].range=[l.length-i,l.length-1]),o>0&&(this.frozenGroupAreas[s.TrailingRow].height=n.getCellOffsetY(r.end+1)-n.getCellOffsetY(r.end+1-o),this.frozenGroupAreas[s.TrailingRow].y=n.getCellOffsetY(r.end+1-o),this.frozenGroupAreas[s.TrailingRow].range=[r.end-o+1,r.end])}getFinalViewport(){const{viewportHeight:e,viewportWidth:t}=this.panelBBox,{colCount:i,rowCount:o,trailingColCount:n,trailingRowCount:r}=this.getFrozenOptions(),l={width:t,height:e,x:0,y:0};return(i>0||n>0)&&(l.width-=this.frozenGroupAreas[s.Col].width+this.frozenGroupAreas[s.TrailingCol].width,l.x+=this.frozenGroupAreas[s.Col].width),(o>0||r>0)&&(l.height<this.frozenGroupAreas[s.Row].height+this.frozenGroupAreas[s.TrailingRow].height?(l.height=0,l.y=0):(l.height-=this.frozenGroupAreas[s.Row].height+this.frozenGroupAreas[s.TrailingRow].height,l.y+=this.frozenGroupAreas[s.Row].height)),l}calculateXYIndexes(e,t){var i,s;const o=this.getFinalViewport(),n=this.spreadsheet.isTableMode()&&(null===(s=null===(i=this.spreadsheet.dataSet)||void 0===i?void 0:i.isEmpty)||void 0===s?void 0:s.call(i))?this.spreadsheet.dataSet.getEmptyViewIndexes():(e=>{const{scrollX:t,scrollY:i,widths:s,heights:o,viewport:n,rowRemainWidth:r}=e;let l=(0,a.findIndex)(s,(e,i)=>{const o=t-((0,a.isNil)(r)?0:r)+n.x;return o>=e&&o<s[i+1]},0);l=Math.max(l,0);let d=(0,a.findIndex)(s,(e,i)=>{const o=n.width+t+n.x;return o>=e&&o<s[i+1]},l);d=Math.min(-1===d?1/0:d,s.length-2);const{start:c,end:h}=o.getIndexRange(i+n.y,n.height+i+n.y);return[l,d,c,h]})({scrollX:e,scrollY:t,widths:this.viewCellWidths,heights:this.viewCellHeights,viewport:o,rowRemainWidth:this.getRealScrollX(this.cornerBBox.width)});this.panelScrollGroupIndexes=n;const r=this.getColLeafNodes().length,l=this.getCellRange();return((e,t,i,s)=>{const{colCount:o=0,rowCount:n=0,trailingColCount:r=0,trailingRowCount:l=0}=t,a=[...e];x(a[0],o)&&(a[0]=o),_(a[1],r,i)&&(a[1]=i-r-1),S(a[2],s.start,n)&&(a[2]=s.start+n),b(a[3],s.end,l)&&(a[3]=s.end-l);const d=[...a];d[2]=s.start,d[3]=s.start+n-1;const c=[...a];c[0]=0,c[1]=o-1;const h=[...a];h[2]=s.end+1-l,h[3]=s.end;const u=[...a];return u[0]=i-r,u[1]=i-1,{center:a,frozenRow:d,frozenCol:c,frozenTrailingCol:u,frozenTrailingRow:h}})(n,this.getFrozenOptions(),r,l)}updateFrozenGroupGrid(){[s.Col,s.Row,s.TrailingCol,s.TrailingRow].forEach(e=>{if(!this.frozenGroupAreas[e].range)return;let t=[],i=[];if(e.toLowerCase().includes("row")){const[o,n]=this.frozenGroupAreas[e].range||[];if(t=this.gridInfo.cols,i=rs(o,n,this.viewCellHeights),e===s.TrailingRow){i=((e,t,i,s)=>{const o=rs(e,t,s),n=s.getCellOffsetY(e);return o.map(e=>e-n+i)})(o,n,this.frozenGroupAreas[s.TrailingRow].y,this.viewCellHeights)}}else{const[s,o]=this.frozenGroupAreas[e].range||[],n=this.getColLeafNodes();t=ns(s,o,n),i=this.gridInfo.rows}const o=c[e];this.frozenGroups[o].updateGrid({cols:t,rows:i},o)})}updatePanelScrollGroup(){super.updatePanelScrollGroup(),this.updateFrozenGroupGrid()}translateRelatedGroups(e,t,i){super.translateRelatedGroups(e,t,i),this.translateFrozenGroups(),this.renderRowResizeArea(),this.renderFrozenGroupSplitLine(e,t)}renderRowResizeArea(){}getFrozenColSplitLineSize(){const{viewportHeight:e,y:t}=this.panelBBox;return{y:0,height:e+t}}renderFrozenColSplitLine(e,t,i,o){const{colCount:n}=this.getFrozenOptions(),{x:r}=this.panelBBox;if(n>0){const n=this.cornerBBox.width,a=Fs(this,n,o),d=r+this.frozenGroupAreas[s.Col].width-a,{y:c,height:h}=this.getFrozenColSplitLineSize();(0,w.ni)(e,Object.assign(Object.assign({},i),{x1:d,x2:d,y1:c,y2:c+h})),(null==t?void 0:t.showShadow)&&o>0&&(this.spreadsheet.isFrozenRowHeader()||a>=n)&&e.appendChild(new l.rw({style:{x:d,y:c,width:null==t?void 0:t.shadowWidth,height:h,fill:this.getShadowFill(0)}}))}}renderFrozenTrailingColSplitLine(e,t,i,o){const{trailingColCount:n}=this.getFrozenOptions(),{viewportWidth:r,x:d}=this.panelBBox;if(n>0){const n=r-this.frozenGroupAreas[s.TrailingCol].width+d,{y:c,height:h}=this.getFrozenColSplitLineSize(),u=Math.max(0,(0,a.last)(this.viewCellWidths)-r);(0,w.ni)(e,Object.assign(Object.assign({},i),{x1:n,x2:n,y1:c,y2:c+h})),(null==t?void 0:t.showShadow)&&C(o)<C(u)&&e.appendChild(new l.rw({style:{x:n-t.shadowWidth,y:c,width:t.shadowWidth,height:h,fill:this.getShadowFill(180)}}))}}getFrozenRowSplitLineSize(){const{viewportWidth:e,x:t}=this.panelBBox;return{x:0,width:t+e}}renderFrozenRowSplitLine(e,t,i,o){const{rowCount:n}=this.getFrozenOptions(),{y:r}=this.panelBBox;if(n>0){const n=r+this.frozenGroupAreas[s.Row].height,{x:a,width:d}=this.getFrozenRowSplitLineSize();(0,w.ni)(e,Object.assign(Object.assign({},i),{x1:a,x2:a+d,y1:n,y2:n})),(null==t?void 0:t.showShadow)&&o>0&&e.appendChild(new l.rw({style:{x:a,y:n,width:d,height:null==t?void 0:t.shadowWidth,fill:this.getShadowFill(90)}}))}}renderFrozenTrailingRowSplitLine(e,t,i,o){const{trailingRowCount:n}=this.getFrozenOptions(),{viewportHeight:r}=this.panelBBox;if(n>0){const n=this.panelBBox.maxY-this.frozenGroupAreas[s.TrailingRow].height,{x:a,width:d}=this.getFrozenRowSplitLineSize(),c=this.getCellRange(),h=Math.max(0,this.viewCellHeights.getCellOffsetY(c.end+1)-this.viewCellHeights.getCellOffsetY(c.start)-r);(0,w.ni)(e,Object.assign(Object.assign({},i),{x1:a,x2:a+d,y1:n,y2:n})),(null==t?void 0:t.showShadow)&&o<C(h)&&e.appendChild(new l.rw({style:{x:a,y:n-t.shadowWidth,width:d,height:t.shadowWidth,fill:this.getShadowFill(270)}}))}}render(){this.shouldRender()&&(this.calculateFrozenGroupInfo(),this.renderFrozenPanelCornerGroup(),super.render())}getCenterFrameScrollX(e){return this.getFrozenOptions().colCount>0?Fs(this,this.cornerBBox.width,e):super.getCenterFrameScrollX(e)}getDefaultCellHeight(){var e;return null!==(e=this.getRowCellHeight(null))&&void 0!==e?e:0}createOrUpdate(e,t){w.xX.call(this,e,t)}clip(){const{colCount:e,rowCount:t,trailingColCount:i,trailingRowCount:n}=this.getFrozenOptions(),{scrollX:r}=this.getScrollOffset(),{x:l,width:a}=Ws(this,this.panelBBox),d=this.frozenGroupAreas[s.Col].width,c=this.frozenGroupAreas[s.TrailingCol].width,h=this.frozenGroupAreas[s.Row].height,u=this.frozenGroupAreas[s.TrailingRow].height,p=this.panelBBox.y+h,g=this.panelBBox.viewportHeight-h-u;this.createOrUpdate("panelScrollGroup.style.clipPath",{x:l,y:p,width:a,height:g}),e>0?this.createOrUpdate(`frozenGroups.${o.Col}.style.clipPath`,{x:this.panelBBox.x-Fs(this,this.cornerBBox.width,r),y:p,width:d,height:g}):this.frozenGroups[o.Col].style.clipPath=null,i>0?this.createOrUpdate(`frozenGroups.${o.TrailingCol}.style.clipPath`,{x:this.panelBBox.x+this.panelBBox.viewportWidth-c,y:p,width:c,height:g}):this.frozenGroups[o.TrailingCol].style.clipPath=null,t>0?this.createOrUpdate(`frozenGroups.${o.Row}.style.clipPath`,{x:l,y:this.panelBBox.y,width:a,height:h}):this.frozenGroups[o.Row].style.clipPath=null,n>0?this.createOrUpdate(`frozenGroups.${o.TrailingRow}.style.clipPath`,{x:l,y:this.panelBBox.y+this.panelBBox.viewportHeight-u,width:a,height:u}):this.frozenGroups[o.TrailingRow].style.clipPath=null}}class to extends Wi{getStyle(e){var t;return e?(0,a.get)(this.theme,e):null===(t=this.theme)||void 0===t?void 0:t.cornerCell}showSortIcon(){return!1}}class io extends $s{getCellInstance(e){const t=this.getHeaderConfig(),{spreadsheet:i}=t,{seriesNumberCell:s,colCell:o}=i.options,n=[e,i,t];return e.field===ye.r2?(null==s?void 0:s(...n))||new to(...n):(null==o?void 0:o(...n))||new Wi(...n)}}class so{constructor(e){const{label:t,isSubTotals:i,isGrandTotals:s,isTotalRoot:o=!1}=e;this.label=t,this.isSubTotals=i,this.isGrandTotals=s,this.isTotalRoot=o}static isTotalClassInstance(e){return e instanceof so}}const oo=e=>{var t;const{isFirstField:i,currentField:s,fieldValues:o,spreadsheet:n,lastField:r}=e,l=n.getTotalsConfig(i?s:r);let d,c;i?(null==l?void 0:l.showGrandTotals)&&(d=l.reverseGrandTotalsLayout?"unshift":"push",c=new so({label:l.grandTotalsLabel,isSubTotals:!1,isGrandTotals:!0,isTotalRoot:!0})):(null==l?void 0:l.showSubTotals)&&((0,a.size)(o)>1||!1!==(0,a.get)(l,"showSubTotals.always"))&&s!==ye.GJ&&(d=l.reverseSubTotalsLayout?"unshift":"push",c=new so({label:l.subTotalsLabel,isSubTotals:!0,isGrandTotals:!1,isTotalRoot:!0})),d&&(null===(t=o[d])||void 0===t||t.call(o,c))},no=(e,t,i,s)=>e.options.layoutArrange?e.options.layoutArrange(e,i,s,t):t,ro=(e,t,i,s)=>{var o,n,r,l;if((null===(o=null==e?void 0:e.facet)||void 0===o?void 0:o.getHiddenColumnsInfo(i))&&(null===(l=null===(r=null===(n=null==e?void 0:e.dataSet)||void 0===n?void 0:n.fields)||void 0===r?void 0:r.columns)||void 0===l?void 0:l.find(e=>e===(null==i?void 0:i.field))))return!1;let d=!0;const c=(e,i=-1,o=-1)=>{-1===i?(t.children.push(e),s.pushNode(e)):(t.children.splice(i,0,e),s.pushNode(e,o))};if(e.options.layoutHierarchy){const o=e.options.layoutHierarchy(e,i);if(o){const e=!!(0,a.isBoolean)(null==o?void 0:o.delete)&&(null==o?void 0:o.delete);d=!e;const{push:n,unshift:r}=o;let l=t.children.length,h=s.getNodes().length;(0,a.isEmpty)(r)||((0,a.each)(r,e=>{c(e)}),l=t.children.length,h=s.getNodes().length),(0,a.isEmpty)(n)||(0,a.each)(n,e=>{c(e)}),e||c(i,l,h)}else c(i)}else c(i);return d},lo=(e,t,i)=>{var s,o;(null===(s=e.options)||void 0===s?void 0:s.layoutCoordinate)&&((null==t?void 0:t.isLeaf)||(null==i?void 0:i.isLeaf))&&(null===(o=e.options)||void 0===o||o.layoutCoordinate(e,t,i))};class ao{constructor(e){this.label=e}static isTotalMeasureInstance(e){return e instanceof ao}}var co=i("./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/utils/layout/generate-id.js");const ho=e=>{var t,i,s,o;const{spreadsheet:n,level:r,fields:l}=e,{options:d,dataSet:c}=n,h=c.moreThanOneValue(),u=null===(i=null===(t=n.dataCfg.fields)||void 0===t?void 0:t.valueInCols)||void 0===i||i,p=(null===(o=null===(s=null==d?void 0:d.style)||void 0===s?void 0:s.colCell)||void 0===o?void 0:o.hideValue)&&u&&!h&&(0,a.includes)(l,ye.GJ);return r===l.length-(p?2:1)},uo=e=>{var t,i;const{currentField:s,fields:o,fieldValues:n,hierarchy:r,parentNode:l,level:a,query:d,addMeasureInTotalQuery:c,addTotalMeasureInTotal:h,spreadsheet:u,handler:p}=e,g=u.isTableMode();for(const[e,m]of n.entries()){const n=(0,co.bC)(m),v=so.isTotalClassInstance(n),f=ao.isTotalMeasureInstance(n);let C,y,w=!1,x=!1,_=!1,S=!1,b=s;v?(x=n.isGrandTotals,_=n.isSubTotals,S=n.isTotalRoot,C=(0,Gi.Ru)(n.label),y=S?Object.assign({},d):Object.assign(Object.assign({},d),{[s]:C}),c&&(y[ye.GJ]=null===(t=null==u?void 0:u.dataSet)||void 0===t?void 0:t.fields.values[0]),w=ho({spreadsheet:u,level:a,fields:o})):f?(C=(0,Gi.Ru)(n.label),y=Object.assign(Object.assign({},d),{[ye.GJ]:C}),b=ye.GJ,x=l.isGrandTotals,_=l.isSubTotals,w=ho({spreadsheet:u,level:a,fields:o})):g?(C=n,b=o[e],y=Object.assign(Object.assign({},d),{[b]:C}),w=!0):(C=n,y=C===ye.L4?Object.assign({},d):Object.assign(Object.assign({},d),{[s]:C}),w=ho({spreadsheet:u,level:a,fields:o}));const E=(0,co.$C)(l.id,g?b:C);if(!E)return;const L=!1,T=new Ns({id:E,value:C,level:a,field:b,parent:l,isTotals:v||f,isGrandTotals:x,isSubTotals:_,isTotalMeasure:f,isCollapsed:L,isTotalRoot:S,hierarchy:r,query:y,spreadsheet:u,isLeaf:w||L}),O=ro(u,l,T,r),R=null===(i=null==u?void 0:u.facet)||void 0===i?void 0:i.getHiddenColumnsInfo(T);!(a>r.maxLevel)||x||l.isGrandTotals||l.isSubTotals||T.isSubTotals||R||(r.sampleNodesForAllLevels.push(T),r.maxLevel=a,r.sampleNodeForLastLevel=T);w||L||!O?(T.isLeaf=!0,r.pushIndexNode(T),T.rowIndex=r.getIndexNodes().length-1):null==p||p({addTotalMeasureInTotal:h,addMeasureInTotalQuery:c,parentNode:T,currentField:o[a+1],fields:o,hierarchy:r,spreadsheet:u})}};function po(e,t){const i={};let s=e;for(;s&&s.field;)s.isTotalRoot&&!t||s.value===ye.L4||(i[s.field]=s.value),s=s.parent;return i}const go=e=>{const{addTotalMeasureInTotal:t,parentNode:i,currentField:s,fields:o,hierarchy:n,spreadsheet:r}=e,l=o.indexOf(s),d=r.dataSet,{values:c=[]}=d.fields,h=[];let u={};const p=r.getTotalsConfig(s),g=i.isGrandTotals?p.grandTotalsGroupDimensions||[]:p.subTotalsGroupDimensions||[],m=d.isEmpty()?[]:g;if(null==m?void 0:m.includes(s)){u=po(i);const e=d.getDimensionValues(s,u);h.push(...(e||[]).map(e=>new so({label:e,isSubTotals:i.isSubTotals,isGrandTotals:i.isGrandTotals,isTotalRoot:!1}))),(0,a.isEmpty)(h)&&s&&h.push(ye.L4)}else{if(!t||s!==ye.GJ)return ho({spreadsheet:r,level:l,fields:o})?(i.isLeaf=!0,n.pushIndexNode(i),void(i.rowIndex=n.getIndexNodes().length-1)):void go(Object.assign(Object.assign({},e),{currentField:o[l+1]}));u=po(i),h.push(...c.map(e=>new ao(e)))}const v=Ee(h);uo(Object.assign(Object.assign({},e),{fieldValues:v,level:l,parentNode:i,query:u,handler:mo}))};function mo(e){e.parentNode.isTotals?go(e):(e=>{const{parentNode:t,currentField:i,fields:s,spreadsheet:o}=e,n=o.dataSet,{values:r=[]}=n.fields,l=s.indexOf(i),d=[];let c={};c=po(t,!0);const h=n.getDimensionValues(i,c),u=no(o,h,t,i);d.push(...u||[]),(0,a.isEmpty)(d)&&i&&(i===ye.GJ?d.push(...r):d.push(ye.L4)),oo({currentField:i,lastField:s[l-1],isFirstField:0===l,fieldValues:d,spreadsheet:o});const p=Ee(d);uo(Object.assign(Object.assign({},e),{fieldValues:p,level:l,parentNode:t,query:c,handler:mo}))})(e)}const vo=e=>{var t,i,s,o,n;const{spreadsheet:r,nodeId:l,currentField:d,level:c,isTotals:h,isTotalMeasure:u,isLeaf:p}=e;if(p)return!1;const{collapseFields:g,collapseAll:m,expandDepth:v}=null!==(i=null===(t=r.options.style)||void 0===t?void 0:t.rowCell)&&void 0!==i?i:{},f=null!==(s=null==g?void 0:g[l])&&void 0!==s?s:null==g?void 0:g[d],C=(0,a.isNumber)(v)?c>=v:null;return!h&&!u&&(null!==(n=null!==(o=null!=f?f:C)&&void 0!==o?o:m)&&void 0!==n&&n)},fo=e=>{var t;const{fieldValue:i,currentField:s,query:o,parentNode:n,spreadsheet:r,level:l,fields:a,addMeasureInTotalQuery:d}=e,c=so.isTotalClassInstance(i),h=ao.isTotalMeasureInstance(i);let u,p,g=!1,m=!1,v=!1,f=!1;return c?(m=i.isGrandTotals,v=i.isSubTotals,f=i.isTotalRoot,u=(0,Gi.Ru)(i.label),p=f?Object.assign({},o):Object.assign(Object.assign({},o),{[s]:u}),d&&(p[ye.GJ]=null===(t=null==r?void 0:r.dataSet)||void 0===t?void 0:t.fields.values[0]),g=ho({spreadsheet:r,level:l,fields:a})):h?(u=(0,Gi.Ru)(i.label),p=Object.assign(Object.assign({},o),{[ye.GJ]:u}),m=n.isGrandTotals,v=n.isSubTotals,g=ho({spreadsheet:r,level:l,fields:a})):(u=i,p=u===ye.L4?Object.assign({},o):Object.assign(Object.assign({},o),{[s]:u}),g=ho({spreadsheet:r,level:l,fields:a})),{value:u,nodeQuery:p,isLeaf:g,isGrandTotals:m,isSubTotals:v,isTotalRoot:f,isTotals:c,isTotalMeasure:h}},Co=e=>{var t;const{currentField:i,fields:s,fieldValues:o,hierarchy:n,parentNode:r,level:l,query:a,addMeasureInTotalQuery:d,addTotalMeasureInTotal:c,spreadsheet:h,handler:u}=e;for(const e of o){const o=(0,co.bC)(e),p=i,g=fo({fieldValue:o,currentField:i,query:a,parentNode:r,spreadsheet:h,level:l,fields:s,addMeasureInTotalQuery:d}),m=(0,co.$C)(r.id,g.value);if(m){const e=vo({spreadsheet:h,nodeId:m,currentField:i,level:l,isTotals:g.isTotals,isTotalMeasure:g.isTotalMeasure,isLeaf:g.isLeaf}),o=new Ns({id:m,value:g.value,level:l,field:p,parent:r,isTotals:g.isTotals||g.isTotalMeasure,isGrandTotals:g.isGrandTotals,isSubTotals:g.isSubTotals,isTotalMeasure:g.isTotalMeasure,isCollapsed:e,isTotalRoot:g.isTotalRoot,hierarchy:n,query:g.nodeQuery,spreadsheet:h,isLeaf:g.isLeaf||e}),a=ro(h,r,o,n),v=null===(t=null==h?void 0:h.facet)||void 0===t?void 0:t.getHiddenColumnsInfo(o);!(l>n.maxLevel)||g.isGrandTotals||r.isGrandTotals||r.isSubTotals||o.isSubTotals||v||(n.sampleNodesForAllLevels.push(o),n.maxLevel=l,n.sampleNodeForLastLevel=o);g.isLeaf||e||!a?(o.isLeaf=!0,n.pushIndexNode(o),o.rowIndex=n.getIndexNodes().length-1):null==u||u({addTotalMeasureInTotal:c,addMeasureInTotalQuery:d,parentNode:o,currentField:s[l+1],fields:s,hierarchy:n,spreadsheet:h})}}},yo=e=>{const{addTotalMeasureInTotal:t,parentNode:i,currentField:s,fields:o,hierarchy:n,spreadsheet:r}=e,l=o.indexOf(s),d=r.dataSet,{values:c=[]}=d.fields,h=[];let u={};const p=r.getTotalsConfig(s),g=i.isGrandTotals?p.grandTotalsGroupDimensions||[]:p.subTotalsGroupDimensions||[],m=d.isEmpty()?[]:g;if(null==m?void 0:m.includes(s)){u=po(i);const e=d.getDimensionValues(s,u);h.push(...(e||[]).map(e=>new so({label:e,isSubTotals:i.isSubTotals,isGrandTotals:i.isGrandTotals,isTotalRoot:!1}))),(0,a.isEmpty)(h)&&s&&h.push(ye.L4)}else{if(!t||s!==ye.GJ)return ho({spreadsheet:r,level:l,fields:o})?(i.isLeaf=!0,n.pushIndexNode(i),void(i.rowIndex=n.getIndexNodes().length-1)):void yo(Object.assign(Object.assign({},e),{currentField:o[l+1]}));u=po(i),h.push(...c.map(e=>new ao(e)))}const v=Ee(h);Co(Object.assign(Object.assign({},e),{fieldValues:v,level:l,parentNode:i,query:u,handler:wo}))};function wo(e){e.parentNode.isTotals?yo(e):(e=>{const{parentNode:t,currentField:i,fields:s,spreadsheet:o}=e,n=o.dataSet,{values:r=[]}=n.fields,l=s.indexOf(i),d=[];let c={};c=po(t,!0);const h=n.getDimensionValues(i,c),u=no(o,h,t,i);d.push(...u||[]),(0,a.isEmpty)(d)&&i&&(i===ye.GJ?d.push(...r):d.push(ye.L4)),oo({currentField:i,lastField:s[l-1],isFirstField:0===l,fieldValues:d,spreadsheet:o});const p=Ee(d);Co(Object.assign(Object.assign({},e),{fieldValues:p,level:l,parentNode:t,query:c,handler:wo}))})(e)}const xo=e=>{var t;const{tree:i=[],level:s,parentNode:o,hierarchy:n,spreadsheet:r,isRowHeader:l}=e,{collapseFields:d,collapseAll:c,expandDepth:h}=null===(t=r.options.style)||void 0===t?void 0:t.rowCell,u=r.store.get("hiddenColumnsDetail")||[];i.forEach(e=>{var t,i;const{field:p,title:g,collapsed:m,children:v}=e,f=(0,A.Tt)(e,["field","title","collapsed","children"]),C=u.some(({hideColumnNodes:e})=>e.find(e=>e.field===p)),y={[ye.GJ]:p},w=(0,co.$C)(o.id,p),x=null!=m&&m,_=null!==(t=null==d?void 0:d[w])&&void 0!==t?t:null==d?void 0:d[p],S=(0,a.isNumber)(h)?s>h:null,b=null!==(i=null!=_?_:S)&&void 0!==i?i:c||x,E=r.isHierarchyTreeType()&&l&&b,L=(0,a.isEmpty)(v),T=new Ns({id:w,field:p,value:g,level:s,parent:o,isTotals:!1,isCollapsed:E,hierarchy:n,query:y,spreadsheet:r,isLeaf:L,extra:Object.assign(Object.assign({},f),{isCustomNode:!0})});if((L||C||E)&&n.pushIndexNode(T),C)return;s>n.maxLevel&&!T.isSeriesNumberNode()&&(n.maxLevel=s,n.sampleNodesForAllLevels.push(T),n.sampleNodeForLastLevel=T,n.maxLevel=s);const O=ro(r,o,T,n);(0,a.isEmpty)(v)||E||!O||xo({spreadsheet:r,parentNode:T,level:s+1,hierarchy:n,tree:v||[],isRowHeader:l})})},_o=e=>{var t,i,s,o,n,r,l;const{spreadsheet:d,parentNode:c,currentField:h,level:u,hierarchy:p,pivotMeta:g}=e,{query:m,id:v}=c,f=(null===(s=null===(i=null===(t=d.dataCfg)||void 0===t?void 0:t.fields)||void 0===i?void 0:i.rows)||void 0===s?void 0:s.length)<=u,C=Ee(Array.from(g.keys()));let y=no(d,C,c,h);const w=d.store.get("drillItemsNum");f&&w>0&&(y=y.slice(0,w)),0===u&&((e,t,i)=>{const s=e.getTotalsConfig(t);(null==s?void 0:s.showGrandTotals)&&i[s.reverseGrandTotalsLayout?"unshift":"push"](new so({label:s.grandTotalsLabel,isGrandTotals:!0,isSubTotals:!1,isTotalRoot:!1}))})(d,h,y);for(const e of y){const t=e instanceof so,i=t?null:g.get(e);let s,f=m,C=!1,y=!1;if(t){C=e.isGrandTotals,y=e.isSubTotals,s=(0,Gi.Ru)(e.label),f=m}else s=e,f=Object.assign(Object.assign({},m),{[h]:s});const w=(0,co.$C)(v,s),{collapseFields:x,collapseAll:_,expandDepth:S}=null===(o=d.options.style)||void 0===o?void 0:o.rowCell,b=null!==(n=null==x?void 0:x[w])&&void 0!==n?n:null==x?void 0:x[h],E=(0,a.isNumber)(S)?u>S:null,L=null!==(r=null!=b?b:E)&&void 0!==r?r:_,T=new Ns({id:w,value:s,level:u,parent:c,field:h,isTotals:t,isGrandTotals:C,isSubTotals:y,isCollapsed:L,hierarchy:p,query:f,spreadsheet:d});u>p.maxLevel&&(p.maxLevel=u);const O=[...(null===(l=null==i?void 0:i.children)||void 0===l?void 0:l.keys())||[]].filter(e=>e!==ye.jI),R=(0,a.isEmpty)(O);(R||t)&&(T.isLeaf=!0),R||(T.isTotals=!0);const I=ro(d,c,T,p);R||L||t||!I||_o({level:u+1,currentField:i.childField,pivotMeta:i.children,parentNode:T,hierarchy:p,spreadsheet:d})}};class So{constructor(){this.width=0,this.height=0,this.maxLevel=-1,this.sampleNodesForAllLevels=[],this.sampleNodeForLastLevel=null,this.allNodesWithoutRoot=[],this.indexNode=[],this.isPlaceholder=!1,this.rootNode=Ns.rootNode()}getLeaves(){return this.allNodesWithoutRoot.filter(e=>e.isLeaf)}getNodes(e){return void 0!==e?this.allNodesWithoutRoot.filter(t=>t.level===e):this.allNodesWithoutRoot}getNodesLessThanLevel(e){return this.allNodesWithoutRoot.filter(t=>t.level<=e)}pushNode(e,t=-1){-1===t?this.allNodesWithoutRoot.push(e):this.allNodesWithoutRoot.splice(t,0,e)}pushIndexNode(e){this.indexNode.push(e)}getIndexNodes(){return this.indexNode}}const bo=e=>{const{rootNode:t,hierarchy:i,fields:s,spreadsheet:o,isRowHeader:n}=e,r=(0,a.filter)(s,e=>e!==ye.GJ);xo({spreadsheet:o,tree:r,level:0,parentNode:t,hierarchy:i,isRowHeader:n})},Eo=e=>{const{isValueInCols:t,moreThanOneValue:i,rootNode:s,hierarchy:o,fields:n,isRowHeader:r,isCustomTreeFields:l,spreadsheet:a}=e;let d,c;r?(d=!t&&i,c=!t&&!i):(d=t&&i,c=t&&!i),l?bo(e):mo({spreadsheet:a,addTotalMeasureInTotal:d,addMeasureInTotalQuery:c,parentNode:s,currentField:n[0],fields:n,hierarchy:o})},Lo=e=>{const{spreadsheet:t}=e;t.isHierarchyGridTreeType()?(e=>{const{isValueInCols:t,moreThanOneValue:i,rootNode:s,hierarchy:o,fields:n,isCustomTreeFields:r,spreadsheet:l}=e,a=!t&&i,d=!t&&!i;r?bo(e):wo({spreadsheet:l,addTotalMeasureInTotal:a,addMeasureInTotalQuery:d,parentNode:s,currentField:n[0],fields:n,hierarchy:o})})(e):t.isHierarchyTreeType()?(e=>{const{spreadsheet:t,rootNode:i,hierarchy:s,isCustomTreeFields:o}=e,{rows:n}=t.dataSet.fields;t.isHierarchyTreeType()&&!o?_o({level:0,currentField:null==n?void 0:n[0],pivotMeta:t.dataSet.rowPivotMeta,parentNode:i,hierarchy:s,spreadsheet:t}):bo(e)})(e):Eo(e)},To=e=>{var t;const{isCustomTreeFields:i,spreadsheet:s}=e,{enable:o}=null!==(t=s.options.seriesNumber)&&void 0!==t?t:{};if(i){const t={field:ye.r2,title:s.getSeriesNumberText()},i=o?[t,...e.fields]:e.fields.filter(e=>(null==e?void 0:e.field)!==ye.r2);return void bo(Object.assign(Object.assign({},e),{fields:i}))}(e=>{var t;const{spreadsheet:i,rootNode:s,fields:o,hierarchy:n}=e,{columns:r=[]}=i.dataSet.fields,{enable:l}=null!==(t=i.options.seriesNumber)&&void 0!==t?t:{},a=i.getSeriesNumberText(),d=r.map(e=>e===ye.r2?a:i.dataSet.getFieldName(e));l&&!o.includes(ye.r2)&&(o.unshift(ye.r2),d.unshift(a)),uo({spreadsheet:i,currentField:o[0],fields:o,fieldValues:d,hierarchy:n,parentNode:s,level:0,query:{},addMeasureInTotalQuery:!1,addTotalMeasureInTotal:!1,handler:mo})})(e)},Oo=e=>{const{isRowHeader:t,spreadsheet:i}=e,{rows:s=[],columns:o=[]}=i.dataSet.fields,n=i.isValueInCols(),r=i.dataSet.moreThanOneValue(),l=new So,a=t?s:o,d=i.isCustomHeaderFields(t?"rows":"columns"),c={isValueInCols:n,moreThanOneValue:r,rootNode:l.rootNode,hierarchy:l,spreadsheet:i,fields:a,isRowHeader:t,isCustomTreeFields:d};t?Lo(c):(e=>{const{spreadsheet:t}=e;t.isPivotMode()?Eo(e):To(e)})(c);return{hierarchy:l,leafNodes:t&&i.isHierarchyTreeType()?l.getNodes():l.getLeaves()}};class Ro extends eo{constructor(e){super(e),this.onSortHandler=e=>(0,A.sH)(this,void 0,void 0,function*(){const t=this.spreadsheet;let i=e;Array.isArray(e)||(i=[e]);const s=t.dataCfg.sortParams||[];i=i.map(e=>{var t,i;const o=Object.assign(Object.assign({},e),{sortFieldId:null!==(t=e.sortKey)&&void 0!==t?t:e.sortFieldId}),n=null!==(i=s.find(e=>e.sortFieldId===o.sortFieldId))&&void 0!==i?i:{};return Object.assign(Object.assign({},n),o)});const o=s.filter(e=>!i.find(t=>t.sortFieldId===e.sortFieldId));(0,a.set)(t.dataCfg,"sortParams",[...o,...i]),t.setDataCfg(t.dataCfg),yield t.render(!0),t.emit(m.RANGE_SORTED,t.dataSet.getDisplayDataSet())}),this.onFilterHandler=e=>(0,A.sH)(this,void 0,void 0,function*(){const t=this.spreadsheet,i=!e.filteredValues||0===e.filteredValues.length,s=t.dataCfg.filterParams||[],o=s.findIndex(t=>t.filterKey===e.filterKey);-1!==o?i?s.splice(o,1):s[o]=e:s.push(e),(0,a.set)(t.dataCfg,"filterParams",s),yield t.render(!0),t.emit(m.RANGE_FILTERED,t.dataSet.getDisplayDataSet())}),this.spreadsheet.on(m.RANGE_SORT,this.onSortHandler),this.spreadsheet.on(m.RANGE_FILTER,this.onFilterHandler)}getCornerCellInstance(){return null}getRowCellInstance(e){const{dataCell:t}=this.spreadsheet.options;return(null==t?void 0:t(e,this.spreadsheet))||new zi(e,this.spreadsheet)}getColCellInstance(...e){const{colCell:t}=this.spreadsheet.options;return(null==t?void 0:t(...e))||new Wi(...e)}initGroups(){super.initGroups(),this.initEmptyPlaceholderGroup()}shouldRender(){var e;const{fields:t}=this.spreadsheet.dataSet,i=null===(e=null==t?void 0:t.columns)||void 0===e?void 0:e.every(e=>e===ye.r2);return super.shouldRender()&&!i}render(){this.shouldRender()&&(super.render(),this.renderEmptyPlaceholder())}clearAllGroup(){super.clearAllGroup(),this.emptyPlaceholderGroup.remove()}initEmptyPlaceholderGroup(){this.emptyPlaceholderGroup=this.spreadsheet.container.appendChild(new l.YJ({name:h.qK,style:{zIndex:4}}))}renderEmptyPlaceholder(){var e,t,i;if(!(null===(e=this.spreadsheet.dataSet)||void 0===e?void 0:e.isEmpty()))return;const{empty:s}=this.spreadsheet.options.placeholder,{background:o}=this.spreadsheet.theme,{icon:n,description:r}=this.spreadsheet.theme.empty,{horizontalBorderWidth:a,horizontalBorderColor:d,horizontalBorderColorOpacity:c}=this.spreadsheet.theme.dataCell.cell,{maxY:h,viewportWidth:u,height:p}=this.panelBBox,g=u/2-n.width/2,m=p/2+h-n.height/2+n.margin.top,v=null!==(t=null==s?void 0:s.description)&&void 0!==t?t:(0,Gi.Ru)("暂无数据"),f=u/2-this.measureTextWidth(v,r)/2,C=m+n.height+n.margin.bottom,y=new l.rw({style:{x:0,y:h,width:u,height:p,stroke:d,strokeWidth:a,strokeOpacity:c,fill:null==o?void 0:o.color,fillOpacity:null!==(i=null==o?void 0:o.opacity)&&void 0!==i?i:1}});this.emptyPlaceholderGroup.appendChild(y),(0,w.sH)(this.emptyPlaceholderGroup,Object.assign(Object.assign({},n),{name:null==s?void 0:s.icon,x:g,y:m,width:n.width,height:n.height})),(0,w.S5)({group:this.emptyPlaceholderGroup,style:Object.assign(Object.assign({},r),{text:v,x:f,y:C})}),this.emptyPlaceholderGroup.toFront()}getDataCellAdaptiveHeight(e){const t={id:String(null==e?void 0:e.rowIndex)},i=this.getRowCellHeight(t);if(this.isCustomRowCellHeight(t))return this.customRowHeightStatusMap[null==e?void 0:e.rowIndex]=!0,i||0;const s=this.getCellHeightByRowIndex(null==e?void 0:e.rowIndex);return this.getNodeAdaptiveHeight({meta:e,cell:this.textWrapTempRowCell,defaultHeight:s})}getCellHeightByRowIndex(e){var t;return this.rowOffsets?null!==(t=this.getRowCellHeight({id:String(e)}))&&void 0!==t?t:0:this.getDefaultCellHeight()}presetRowCellHeightIfNeeded(e){var t;const{style:i}=this.spreadsheet.options,s=this.getColLeafNodes();if(((0,a.isEmpty)(s)||(null===(t=null==i?void 0:i.dataCell)||void 0===t?void 0:t.maxLines)<=1)&&this.spreadsheet.theme.dataCell.text.fontSize<=12&&this.spreadsheet.theme.dataCell.bolderText.fontSize<=12)return;const o=(0,a.max)(s.map(t=>{const i=this.getCellMeta(e,t.colIndex);return this.getDataCellAdaptiveHeight(i)}))||this.getDefaultCellHeight();(0,a.set)(this.spreadsheet.options,`style.rowCell.heightByField.${e}`,o)}calculateRowOffsets(){var e,t,i;const{style:s}=this.spreadsheet.options,o=null===(e=null==s?void 0:s.rowCell)||void 0===e?void 0:e.heightByField,n=(null===(t=null==s?void 0:s.dataCell)||void 0===t?void 0:t.maxLines)>1&&(null===(i=null==s?void 0:s.dataCell)||void 0===i?void 0:i.wordWrap)||this.spreadsheet.theme.dataCell.text.fontSize>12||this.spreadsheet.theme.dataCell.bolderText.fontSize>12;if((0,a.keys)(o).length||n){const e=this.spreadsheet.dataSet.getDisplayDataSet();this.textWrapNodeHeightCache.clear(!1),this.customRowHeightStatusMap={},this.rowOffsets=[0],this.lastRowOffset=0,e.forEach((e,t)=>{this.presetRowCellHeightIfNeeded(t);const i=this.getCellHeightByRowIndex(t),s=this.lastRowOffset+i;this.rowOffsets.push(s),this.lastRowOffset=s})}}destroy(){super.destroy(),this.spreadsheet.off(m.RANGE_SORT,this.onSortHandler),this.spreadsheet.off(m.RANGE_FILTER,this.onFilterHandler)}calculateCornerBBox(){const{colsHierarchy:e}=this.getLayoutResult(),t=C(e.height);this.cornerBBox=new is(this),this.cornerBBox.height=t,this.cornerBBox.maxY=t}doLayout(){const e=new So,{colLeafNodes:t,colsHierarchy:i}=this.buildColHeaderHierarchy();return this.calculateColNodesCoordinate(t,i),{colNodes:i.getNodes(),colLeafNodes:t,colsHierarchy:i,rowNodes:[],rowsHierarchy:e,rowLeafNodes:[],cornerNodes:[]}}buildColHeaderHierarchy(){const e=Oo({isRowHeader:!1,spreadsheet:this.spreadsheet});return{colLeafNodes:e.leafNodes,colsHierarchy:e.hierarchy}}getCellMeta(e=0,t=0){var i,s,o;const{options:n,dataSet:r}=this.spreadsheet,l=this.getColLeafNodes()[t];if(!l)return null;let a;const d=l.x,c=this.viewCellHeights.getCellOffsetY(e),h=this.getCellHeightByRowIndex(e);a=(null===(i=n.seriesNumber)||void 0===i?void 0:i.enable)&&l.field===ye.r2?e+1:r.getCellData({query:{field:l.field,rowIndex:e}});const u=l.field,p=a,g={rowIndex:e},m={colIndex:t},v={spreadsheet:this.spreadsheet,x:d,y:c,width:l.width,height:h,data:{[l.field]:a},rowIndex:e,colIndex:t,isTotals:!1,colId:l.id,rowId:String(e),valueField:u,fieldValue:p,id:xe(String(e),l.id),rowQuery:g,colQuery:m,query:Object.assign(Object.assign({},g),m)};return null!==(o=null===(s=n.layoutCellMeta)||void 0===s?void 0:s.call(n,v))&&void 0!==o?o:v}getAdaptiveColWidth(e){var t;const{dataCell:i}=this.spreadsheet.options.style,{seriesNumber:s}=this.spreadsheet.options;if(this.spreadsheet.getLayoutWidthType()!==Vi.Compact){const t=this.getSeriesNumberWidth(),o=e.length-((null==s?void 0:s.enable)?1:0),n=this.getCanvasSize().width-t-T.getVerticalBorderWidth(this.spreadsheet);return Math.max(null==i?void 0:i.width,C(n/Math.max(1,o)))}return y(null!==(t=null==i?void 0:i.width)&&void 0!==t?t:0)}calculateColLeafNodesWidth(e,t){let i=Ns.blankNode(),s=0;const o=this.getAdaptiveColWidth(e),n=t.getLeaves(),r=this.spreadsheet.getLayoutWidthType()!==Vi.Compact;let l=-1,d=0;if(r){const{colCell:e}=this.spreadsheet.options.style;for(let t=n.length-1;t>=0;t--){const i=n[t];if(i.field!==ye.r2){const s=(0,a.isNumber)(this.getColCellDraggedWidth(i)),o=(0,a.isNumber)(this.getCellCustomSize(i,null==e?void 0:e.width));if(!s&&!o){l=t;break}}}if(l>=0){const{seriesNumber:e}=this.spreadsheet.options,t=this.getSeriesNumberWidth(),i=n.length-((null==e?void 0:e.enable)?1:0),s=this.getCanvasSize().width-t-T.getVerticalBorderWidth(this.spreadsheet);d=Math.max(0,y(s)-y(o)*Math.max(1,i))}}n.forEach((e,n)=>{e.colIndex=s,s+=1,e.x=i.x+i.width,e.width=this.getColLeafNodesWidth(e,o),n===l&&(e.width+=d),lo(this.spreadsheet,null,e),t.width+=e.width,i=e})}calculateColNodesHeight(e){e.getNodes().forEach(t=>{var i,s;t.y=0===t.level?0:(null===(i=null==t?void 0:t.parent)||void 0===i?void 0:i.y)+(null===(s=null==t?void 0:t.parent)||void 0===s?void 0:s.height)||0,t.height=this.getColNodeHeight({colNode:t,colsHierarchy:e,useCache:!1})})}calculateColNodesCoordinate(e,t){this.calculateColLeafNodesWidth(e,t),this.calculateColParentNodeWidthAndX(e),this.updateColsHierarchySampleMaxHeightNodes(t),this.calculateColNodesHeight(t),this.updateCustomFieldsSampleNodes(t),this.adjustCustomColLeafNodesHeight({leafNodes:e,hierarchy:t})}getCompactColNodeWidth(e){const{theme:t,dataSet:i}=this.spreadsheet,{bolderText:s}=t.colCell,{text:o,cell:n}=t.dataCell,r=i.getDisplayDataSet(),l=i.getFieldFormatter(e.field),d=(0,a.maxBy)(null==r?void 0:r.slice(0,50).map(t=>{var i;return`${null!==(i=null==l?void 0:l(t[e.field]))&&void 0!==i?i:t[e.field]}`}),e=>this.measureTextWidth(e,o));Zi.U.getInstance().logger("Max Label In Col:",e.field,d);const c=this.measureTextWidth(d,o)+n.padding.left+n.padding.right,h=this.measureTextWidth(e.value,s)+qi(this.spreadsheet,e,t.colCell),{compactExtraWidth:u=0,compactMinWidth:p}=this.spreadsheet.options.style||{},g=y(Math.max(h,c)+u);return(0,a.isNumber)(p)?Math.max(g,p):g}getColLeafNodesWidth(e,t){const{colCell:i}=this.spreadsheet.options.style,s=this.spreadsheet.getLayoutWidthType(),o=this.getColCellDraggedWidth(e);if((0,a.isNumber)(o))return y(o);const n=this.getCellCustomSize(e,null==i?void 0:i.width);return(0,a.isNumber)(n)?y(n):e.field===ye.r2?this.getSeriesNumberWidth():s===Vi.Compact?this.getCompactColNodeWidth(e):y(t)}getViewCellHeights(){const e=this.getDefaultCellHeight();return{getTotalHeight:()=>this.rowOffsets?(0,a.last)(this.rowOffsets)||0:e*this.spreadsheet.dataSet.getDisplayDataSet().length,getCellOffsetY:t=>t<=0?0:this.rowOffsets?this.rowOffsets[t]:t*e,getTotalLength:()=>this.spreadsheet.dataSet.getDisplayDataSet().length,getIndexRange:(t,i)=>{if(this.rowOffsets)return Ki(this.rowOffsets,t,i);const s=C(t/e,0),o=i%e===0?i/e-1:C(i/e,0);return{start:Math.max(0,s),end:Math.max(0,o)}}}}renderRowResizeArea(){const{resize:e}=this.spreadsheet.options.interaction;if(!((0,a.isBoolean)(e)?e:null==e?void 0:e.rowCellVertical))return;const t=this.foregroundGroup.getElementById(h.k5);t&&t.removeChildren();es(this.panelGroup.children,zi).forEach(e=>{e.drawResizeArea()})}getRowHeader(){return null}getColHeader(){if(!this.columnHeader){const{x:e,width:t,viewportHeight:i,viewportWidth:s}=this.panelBBox;return new io({width:t,height:this.cornerBBox.height,viewportWidth:s,viewportHeight:i,cornerWidth:this.cornerBBox.width,position:{x:e,y:0},nodes:this.getColNodes(),sortParam:this.spreadsheet.store.get("sortParam"),spreadsheet:this.spreadsheet})}return this.columnHeader}getSeriesNumberHeader(){return null}getScrollbarPosition(){const{height:e}=this.getCanvasSize(),t=super.getScrollbarPosition(),i=this.spreadsheet.dataSet.isEmpty()?e-this.scrollBarSize:t.maxY;return Object.assign(Object.assign({},t),{maxY:i})}getSeriesNumberCells(){return this.getDataCells().filter(e=>e.getMeta().valueField===ye.r2)}getContentWidth(){const{colsHierarchy:e}=this.layoutResult;return y(e.width)}getContentHeight(){const{getTotalHeight:e}=this.getViewCellHeights(),{colsHierarchy:t}=this.layoutResult;return y(e()+t.height+T.getHorizontalBorderWidth(this.spreadsheet))}}var Io=i("./node_modules/.pnpm/@antv+g-canvas@2.2.2/node_modules/@antv/g-canvas/dist/index.esm.js");const No=`${Ai.u}-tooltip`,Bo=`${No}-container`,Ao=`${Bo}-show`,Mo=`${Bo}-hide`,Do=15,Ho=10;var ko=i("./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/common/icons/factory.js");class zo{constructor(){this.store=new Map}set(e,t){return this.store.set(e,t)}get(e,t){var i;return null!==(i=this.store.get(e))&&void 0!==i?i:t}clear(){this.store.clear()}size(){return this.store.size}}const Fo={data:[],fields:{rows:[],columns:[],values:[],valueInCols:!0},meta:[],sortParams:[],filterParams:[]},Po=(...e)=>{const t=[...e,(e,t)=>{if((0,a.isArray)(e)&&(0,a.isArray)(t))return t}];return(0,a.mergeWith)({},...t)},jo=(...e)=>{var t;const i=Po(Fo,...e);i.fields=(e=>{const t=["rows","columns","values"].reduce((t,i)=>{const s=e[i],o=(0,a.uniq)(s);return(0,a.isEqual)(o,s)||console.warn(`fields.${i}:[${s}] should be unique`),t[i]=o,t},{});return Object.assign(Object.assign({},e),t)})(i.fields);const s=null===(t=i.fields.rows)||void 0===t?void 0:t.some(e=>!(0,a.isString)(e)),o=(0,a.isEmpty)(i.fields.values);return(s||o)&&(i.fields.valueInCols=!1),i},Wo=(e,t,i)=>{let s;const o=e.split("[&]");if(i)s=[e];else{s=[(0,co.$C)(o[0],o[1])];for(let e=2;e<o.length;e+=1)s.push((0,co.$C)(s[e-2],o[e]))}return(0,a.filter)(t,e=>{var t;return s.includes(null===(t=e.getMeta())||void 0===t?void 0:t.id)})};const Go=e=>[d.B4.META,d.B4.CONTROL].includes(e.key),Vo=e=>e.ctrlKey||e.metaKey,$o=e=>{const t=e.getMeta(),{id:i,colIndex:s,rowIndex:o,rowQuery:n}=t||{};return{id:i,colIndex:s,rowIndex:o,rowQuery:n,type:e instanceof Fi?d.vZ.ROW_CELL:e.cellType}};function Uo(e,t){const i=Math.min(e.rowIndex,t.rowIndex),s=Math.max(e.rowIndex,t.rowIndex);return{start:{rowIndex:i,colIndex:Math.min(e.colIndex,t.colIndex)},end:{rowIndex:s,colIndex:Math.max(e.colIndex,t.colIndex)}}}const Yo=(e,t)=>{const{facet:i}=e.spreadsheet,{colHeader:s,rowHeader:o}=e.getSelectedCellHighlight();s&&e.updateCells(i.getColCells()),o&&e.updateCells(i.getRowCells()),t()},Xo=e=>(0,a.mapValues)((0,a.groupBy)(e,"type"),e=>(0,a.map)(e,"id")),Zo=e=>{var t;const i=e.store.get("visibleActionIcons"),s=e.interaction.getInteractedCells(),o=e.interaction.getState().cells;if((0,a.isEmpty)(s)&&(0,a.isEmpty)(o)&&(0,a.isEmpty)(i))return!1;if((0,a.forEach)(i,e=>{e.toggleVisibility(!1)}),e.store.set("visibleActionIcons",[]),(0,a.forEach)(s,e=>{e.hideInteractionShape()}),e.interaction.resetState(),null===(t=e.options.interaction)||void 0===t?void 0:t.selectedCellsSpotlight){const t=e.interaction.getUnSelectedDataCells()||[];(0,a.forEach)(t,e=>{e.clearUnselectedState()})}return!0},qo=e=>e&&"appendInfo"in e?e.appendInfo:{};const Ko=e=>Object.assign(Object.assign({},null==e?void 0:e.colQuery),null==e?void 0:e.rowQuery),Jo=(e,t)=>{if(!e)return;const{style:i,className:s=[],visible:o,dark:n=!1}=t;if(i&&Object.assign(e.style,i),s.length){const t=s.filter(Boolean);e.classList.add(...t)}e.classList.toggle(Ao,o),e.classList.toggle(Mo,!o),e.classList.toggle(Hi,n)},Qo=(e,{data:t,field:i,valueField:s,useCompleteDataForFormatter:o=!0,targetCell:n})=>{var r,l;const d=null===(r=null==e?void 0:e.dataSet)||void 0===r?void 0:r.getFieldName(i),c=e.isCustomRowFields()&&(null==e?void 0:e.dataSet.getCustomRowFieldName(n))||d,h=null===(l=null==e?void 0:e.dataSet)||void 0===l?void 0:l.getFieldFormatter(i),u=ci.getFieldValue(t,i),p=(0,a.isObject)(u)?null:u;return{name:c,value:h(s||p,o?t:void 0)}},en=(e,t,i)=>{const s=(0,a.filter)((0,a.concat)([],t),e=>e!==ye.GJ&&ci.getFieldValue(i,e));return(0,a.map)(s,t=>Qo(e,{data:i,field:t,useCompleteDataForFormatter:!1}))},tn=(e,t,i=!0)=>{const s=[];return(0,a.forEach)(t,(t,o)=>{(0,a.forEach)(e,e=>{i||-1===e.colIndex?i&&-1!==e.rowIndex&&s.push([e.rowIndex,o]):s.push([o,e.colIndex])})}),s},sn=(e,t,i)=>{const{facet:s}=e,o=e=>{if(!e)return!1;const i=null==t?void 0:t.getMeta(),o=null==i?void 0:i.isTotals,n=(null==t?void 0:t.cellType)===d.vZ.COL_CELL;if(!n&&!((null==t?void 0:t.cellType)===d.vZ.ROW_CELL))return!1;const r=s.getColNodeByIndex(e.colIndex),l=s.getRowNodeByIndex(e.rowIndex);return!o&&(null==e?void 0:e.isTotals)||o&&(n?null==l?void 0:l.isTotals:null==r?void 0:r.isTotals)};if(i){const t=(e=>{var t;const i=e.facet.getRowLeafNodes(),s=e.facet.getColLeafNodes(),{nodes:o=[],cells:n=[]}=e.interaction.getState(),r=null===(t=null==n?void 0:n[0])||void 0===t?void 0:t.type,l=e.isHierarchyTreeType()?o:o.filter(e=>null==e?void 0:e.isLeaf);return r===d.vZ.COL_CELL?tn(l,i,!1):r===d.vZ.ROW_CELL?tn(l,s):[]})(e);return(0,a.compact)((0,a.map)(t,([e,t])=>{const i=s.getCellMeta(e,t);if(!o(i))return(null==i?void 0:i.data)||Ko(i)}))}return e.interaction.getCells().filter(e=>{const t=s.getCellMeta(e.rowIndex,e.colIndex);return!o(t)}).map(e=>{const t=s.getCellMeta(e.rowIndex,e.colIndex);return(null==t?void 0:t.data)||Ko(t)})},on=e=>{const{spreadsheet:t,targetCell:i,options:s={}}=e,o=[],n={};if(t.isTableMode()&&(null==s?void 0:s.onlyShowCellText)){const e=null==i?void 0:i.getMeta();return[{selectedData:(null==e?void 0:e.field)?t.dataSet.getCellMultiData({query:{field:e.field}}):[t.dataSet.getRowData(e)],name:"",value:""}]}const r=sn(t,i,s.onlyShowCellText);return(0,a.forEach)(r,e=>{var t;const i=null==e?void 0:e[ye.GJ];n[i]?null===(t=n[i])||void 0===t||t.push(e):n[i]=[e]}),(0,a.mapKeys)(n,(e,r)=>{var l,d;const c=t.isCustomHeaderFields()?null==t?void 0:t.dataSet.getCustomRowFieldName(i):((e,t,i)=>{var s;if(i)return(0,Gi.Ru)("总计");const o=null===(s=null==e?void 0:e.dataSet)||void 0===s?void 0:s.getFieldName(t);return o&&"undefined"!==o?o:""})(t,r,null==s?void 0:s.isTotals);let h="",u="";if((0,a.every)(e,e=>hi((0,a.get)(e,ye.nj)))){const{placeholder:e}=t.options,i=(0,fe.Lv)(n,e);h=i,u=i}else{const i=null===(l=null==t?void 0:t.dataSet)||void 0===l?void 0:l.getFieldFormatter(r),s=gi(e,ye.nj);u=s,h=null!==(d=null==i?void 0:i(s,e))&&void 0!==d?d:parseFloat(s.toPrecision(16))}o.push({selectedData:e,name:c||"",value:h,originValue:u})}),t.isCustomHeaderFields()?(e=>{const t=(0,a.groupBy)(e,"name");return Object.keys(t||{}).map(e=>{const i=t[e],s=(0,a.flatMap)(i,e=>e.selectedData),o=i.filter(e=>(0,a.isNumber)(e.value));return{name:e,selectedData:s,value:(0,a.isEmpty)(o)?null:(0,a.sumBy)(o,"value")}})})(o):o},nn=e=>{var t;const{spreadsheet:i,cellInfos:s=[],options:o={},targetCell:n}=e;let r=null,l=[],d=null,c=null;const h=i.dataSet.getCustomFieldDescription(n),u=s[0]||{};if(null==o?void 0:o.hideSummary)if(o.onlyShowCellText){const e=ci.getFieldValue(u,"value"),s=ci.getFieldValue(u,"valueField"),n=null===(t=null==i?void 0:i.dataSet)||void 0===t?void 0:t.getFieldFormatter(s),l=null==n?void 0:n(e),d=o.enableFormat?i.dataSet.getFieldName(e)||l:i.dataSet.getFieldName(s);r=(0,a.isString)(d)?d:""}else d=((e,t,i)=>{var s,o,n,r;const{isTotals:l}=i||{};let d=[],c=[];if(t){const i=null===(o=null===(s=null==e?void 0:e.dataSet)||void 0===s?void 0:s.fields)||void 0===o?void 0:o.columns,l=null===(r=null===(n=null==e?void 0:e.dataSet)||void 0===n?void 0:n.fields)||void 0===r?void 0:r.rows;d=en(e,L(i||[]),t),c=en(e,l,t)}return(0,a.isEmpty)(d)&&(0,a.isEmpty)(c)&&l&&(d=[{value:(0,Gi.Ru)("总计")}]),{cols:d,rows:c}})(i,u,o),c=((e,t,i,s)=>{if(!t)return[];const{isTotals:o}=i,n=t[ye.GJ],r=[];return r.push(Qo(e,o?{data:t,field:n,targetCell:s,valueField:t[ye.nj]}:{data:t,field:n,targetCell:s})),r})(i,u,o,n);else l=on({spreadsheet:i,options:o,targetCell:n});const{interpretation:p,infos:g,tips:m}=u||{};return{name:r,summaries:l,interpretation:p,infos:g,tips:m,headInfo:d,details:c,description:h}},rn=e=>{if(!e.interaction.isSelectedState())return[];const{valueInCols:t}=e.dataCfg.fields;return e.interaction.getCells().reduce((i,s)=>{const o=e.facet.getCellMeta(null==s?void 0:s.rowIndex,null==s?void 0:s.colIndex),n=Ko(o);if((0,a.isEmpty)(o)||(0,a.isEmpty)(n))return[];const r=Object.assign(Object.assign({},n),{colIndex:t?null==o?void 0:o.colIndex:null,rowIndex:t?null:null==o?void 0:o.rowIndex});return i.find(e=>(0,a.isEqual)(r,e))||i.push(r),i},[])},ln=(e,t)=>{var i;if(!t||!e)return null;const{options:s,interaction:o}=e,n=null===(i=e.getCellType)||void 0===i?void 0:i.call(e,null==t?void 0:t.target),r=(0,a.last)(o.getInteractedCells());return((e={},t)=>{const i=t=>Po(e,t),{colCell:s,rowCell:o,dataCell:n,cornerCell:r}=e;return t===d.vZ.COL_CELL?i(s):t===d.vZ.ROW_CELL?i(o):t===d.vZ.DATA_CELL?i(n):t===d.vZ.CORNER_CELL?i(r):Object.assign({},e)})(s.tooltip,n||(null==r?void 0:r.cellType))};class an{constructor(e){this.isLinkFieldText=e=>{const t=this.getCellAppendInfo(e);return null==t?void 0:t.isLinkFieldText},this.spreadsheet=e,this.bindEvents()}getCellAppendInfo(e){return qo(e)}getTooltipOperator(e,t=[]){const i=this.spreadsheet.getCell(e.target),{operation:s}=ln(this.spreadsheet,e);return((e,t)=>{var i;const{defaultMenus:s=[],cell:o}=t,n=(e=[])=>e.filter(e=>{var t;return(0,a.isFunction)(e.visible)?e.visible(o):null===(t=e.visible)||void 0===t||t}).map(e=>(e.children&&(e.children=n(e.children)),e)),r=n(null===(i=null==e?void 0:e.menu)||void 0===i?void 0:i.items);return{menu:Object.assign(Object.assign({},null==e?void 0:e.menu),{items:(0,a.compact)([...s,...r])})}})(s,{defaultMenus:t,cell:i})}reset(){}}class dn extends an{bindEvents(){this.bindDataCellClick()}bindDataCellClick(){this.spreadsheet.on(m.DATA_CELL_CLICK,e=>{var t,i;e.stopPropagation();const{interaction:s}=this.spreadsheet;if(s.clearHoverTimer(),s.hasIntercepts([d.fR.CLICK]))return;if(this.isLinkFieldText(e.target))return void this.emitLinkFieldClickEvent(e);const o=this.spreadsheet.getCell(e.target),n=o.getMeta();n&&(s.addIntercepts([d.fR.HOVER]),s.isSelectedCell(o)?(1===e.detail||1===(null===(t=e.nativeEvent)||void 0===t?void 0:t.detail)||1===(null===(i=e.originalEvent)||void 0===i?void 0:i.detail)||me())&&(s.reset(),s.emitSelectEvent({event:e,targetCell:o,interactionName:d.oB.DATA_CELL_CLICK})):(s.changeState({cells:[$o(o)],stateName:d.xT.SELECTED,onUpdateCells:Yo}),s.emitSelectEvent({event:e,targetCell:o,interactionName:d.oB.DATA_CELL_CLICK,cells:[o]}),this.showTooltip(e,n),s.updateDataCellRelevantHeaderCells(d.xT.SELECTED,n),this.spreadsheet.emit(m.DATA_CELL_CLICK_TRIGGERED_PRIVATE,o)))})}showTooltip(e,t){const{data:i,isTotals:s=!1,fieldValue:o,valueField:n}=t,r=this.spreadsheet.isTableMode(),l=[(r?Object.assign(Object.assign({},i),{value:o,valueField:n}):i)||Object.assign(Object.assign({},t.rowQuery),t.colQuery)],a=this.getTooltipOperator(e);this.spreadsheet.showTooltipWithInfo(e,l,{isTotals:s,operator:a,hideSummary:!0,onlyShowCellText:r})}emitLinkFieldClickEvent(e){const{meta:t}=this.getCellAppendInfo(e.target),{valueField:i,data:s}=t;this.spreadsheet.emit(m.GLOBAL_LINK_FIELD_JUMP,{meta:t,field:i,record:Object.assign({rowIndex:null==t?void 0:t.rowIndex},s)})}}class cn extends an{constructor(){super(...arguments),this.isMultiSelection=!1,this.handleRowColClick=e=>{if(e.stopPropagation(),this.isLinkFieldText(e.target))return;const{interaction:t,options:i}=this.spreadsheet,s=this.spreadsheet.getCell(e.target);if(s instanceof Us)return;const{multiSelection:o}=i.interaction,n=!(!o||!this.isMultiSelection);t.changeCell({event:e,cell:s,isMultiSelection:n,interactionName:n?s.cellType===d.vZ.ROW_CELL?d.oB.ROW_CELL_MULTI_SELECTION:d.oB.COL_CELL_MULTI_SELECTION:s.cellType===d.vZ.ROW_CELL?d.oB.ROW_CELL_CLICK:d.oB.COL_CELL_CLICK,scrollIntoView:!1})&&this.showTooltip(e)},this.getHideColumnField=e=>{var t;return(null===(t=e.extra)||void 0===t?void 0:t.isCustomNode)?e.id:this.spreadsheet.isTableMode()?e.field:e.id}}bindEvents(){this.bindKeyboardDown(),this.bindKeyboardUp(),this.bindColCellClick(),this.bindRowCellClick(),this.bindTableColExpand(),this.bindMouseMove()}reset(){this.isMultiSelection=!1,this.spreadsheet.interaction.removeIntercepts([d.fR.CLICK])}bindKeyboardDown(){this.spreadsheet.on(m.GLOBAL_KEYBOARD_DOWN,e=>{Go(e)&&(this.isMultiSelection=!0)})}bindKeyboardUp(){this.spreadsheet.on(m.GLOBAL_KEYBOARD_UP,e=>{Go(e)&&this.reset()})}bindMouseMove(){this.spreadsheet.on(m.GLOBAL_MOUSE_MOVE,e=>{this.isMultiSelection&&!Vo(e)&&this.reset()})}bindRowCellClick(){this.spreadsheet.on(m.ROW_CELL_CLICK,e=>{this.handleRowColClick(e)})}bindColCellClick(){this.spreadsheet.on(m.COL_CELL_CLICK,e=>{this.handleRowColClick(e)})}showTooltip(e){const{operation:t,enable:i}=ln(this.spreadsheet,e);if(!i)return;const{interaction:s}=this.spreadsheet,o=s.isSelectedState()?(n=s.getActiveCells(),(0,a.map)(n,e=>{const t=e.getMeta();return(0,a.assign)({},t.query||{},(0,a.pick)(t,["colIndex","rowIndex"]))})):[];var n;const r=this.getHeaderTooltipOperator(e,t);this.spreadsheet.showTooltipWithInfo(e,o,{onlyShowCellText:!0,operator:r})}getHeaderTooltipOperator(e,t){const i=this.spreadsheet.getCell(e.target),s=i.getMeta(),o=i.cellType===d.vZ.COL_CELL,n=1===this.spreadsheet.facet.getColLeafNodes().length,r={key:"hiddenColumns",label:(0,Gi.Ru)("隐藏"),icon:"EyeOutlined"},l=o&&!n&&s.isLeaf&&t.hiddenColumns,a=Object.assign(Object.assign({},r),{onClick:()=>{this.hideSelectedColumns()}});return this.getTooltipOperator(e,l?[a]:[])}bindTableColExpand(){this.spreadsheet.on(m.COL_CELL_EXPANDED,(e,t)=>{this.handleExpandIconClick(e,t)})}hideSelectedColumns(){return(0,A.sH)(this,void 0,void 0,function*(){const{interaction:e}=this.spreadsheet,t=e.getActiveCells().map(e=>e.getMeta()).map(this.getHideColumnField);yield k(this.spreadsheet,t,!0)})}handleExpandIconClick(e,t){return(0,A.sH)(this,void 0,void 0,function*(){const i=this.spreadsheet.store.get("hiddenColumnsDetail",[]),{hideColumnNodes:s=[]}=(0,a.findLast)(i,({displaySiblingNode:i})=>z(i,e.id,t))||{},{hiddenColumnFields:o}=this.spreadsheet.options.interaction,n=s.map(this.getHideColumnField),r=(0,a.difference)(o,n),l=i.filter(({displaySiblingNode:i})=>!z(i,e.id,t));this.spreadsheet.setOptions({interaction:{hiddenColumnFields:r}}),this.spreadsheet.store.set("hiddenColumnsDetail",l),this.spreadsheet.interaction.reset(),yield this.spreadsheet.render({reloadData:!1,rebuildHiddenColumnsDetail:!1})})}}class hn extends an{constructor(){super(...arguments),this.getCellData=e=>{var t,i;const s=e.getHeadLeafChild(),o=this.spreadsheet.dataSet.getCellMultiData({query:null==s?void 0:s.query})[0],n=ci.getFieldValue(o);return Object.assign(Object.assign({},n),{rowIndex:null!==(t=e.rowIndex)&&void 0!==t?t:null==s?void 0:s.rowIndex,colIndex:null!==(i=e.colIndex)&&void 0!==i?i:null==s?void 0:s.colIndex})}}bindEvents(){this.bindRowCellClick(),this.bindColCellClick()}onHeaderCellClick(e){if(this.spreadsheet.interaction.hasIntercepts([d.fR.CLICK]))return;if(!this.isLinkFieldText(e.target))return;const{meta:t}=this.getCellAppendInfo(e.target),i=t.field,s=this.getCellData(t);this.spreadsheet.emit(m.GLOBAL_LINK_FIELD_JUMP,{field:i,meta:t,record:s})}bindRowCellClick(){this.spreadsheet.on(m.ROW_CELL_CLICK,e=>{this.onHeaderCellClick(e)})}bindColCellClick(){this.spreadsheet.on(m.COL_CELL_CLICK,e=>{this.onHeaderCellClick(e)})}}class un extends an{bindEvents(){this.bindDataCellClick()}bindDataCellClick(){this.spreadsheet.on(m.MERGED_CELLS_CLICK,e=>{e.stopPropagation();const{interaction:t}=this.spreadsheet;t.hasIntercepts([d.fR.CLICK])||t.addIntercepts([d.fR.HOVER])})}}const pn=(e,t)=>{const i=window.matchMedia("(orientation: portrait)").matches,s=i?"90vw":"90vh",o=i?"60vw":"60vh";Object.assign(e.style,Object.assign({maxWidth:s,maxHeight:s,minHeight:o,minWidth:o,objectFit:"contain"},t))},gn=e=>(0,A.sH)(void 0,void 0,void 0,function*(){const t=e.getRenderer(),{type:i,prepareText:s}=t,o=yield J(s,e.getFieldValue().toString());if(!1===t.clickToPreview||![Y.IMAGE,Y.VIDEO].includes(t.type))return;const n=e.getStyle("preview"),r=(e=>{const t=document.createElement("div");return Object.assign(t.style,Object.assign({width:"100vw",height:"100vh",position:"fixed",top:"0",left:"0",backgroundColor:"rgba(30, 30, 30, 0.5)",display:"flex",justifyContent:"center",alignItems:"center",overflow:"hidden",zIndex:"9999",cursor:"pointer",touchAction:"none",backdropFilter:"blur(2px)",pointerEvents:"auto"},e)),t.className=`${Ai.u}-preview-overlay`,t})(null==n?void 0:n.overlay),l=i===Y.IMAGE?yield(e=>(0,A.sH)(void 0,void 0,void 0,function*(){const{src:t,mediaContainerStyle:i,config:s}=e,o=yield q({src:t,fallback:null==s?void 0:s.fallback,timeout:null==s?void 0:s.timeout});return pn(o,i),o.alt="preview",o}))({src:o,mediaContainerStyle:null==n?void 0:n.mediaContainer,config:t}):((e,t)=>{const i=document.createElement("video");return i.src=e,i.controls=!0,i.preload="auto",i.playsInline=!0,i.setAttribute("webkit-playsinline","true"),i.setAttribute("playsinline","true"),pn(i,t),i})(o,null==n?void 0:n.mediaContainer),a=e=>{e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation(),e.target===r&&(document.body.removeChild(r),l.remove(),document.body.style.overflow="auto")};setTimeout(()=>{["click","touchstart","touchend"].forEach(e=>{r.addEventListener(e,a,{passive:!1})})},500),document.body.style.overflow="hidden",r.appendChild(l),document.body.appendChild(r)});class mn extends an{bindEvents(){[m.DATA_CELL_CLICK,m.ROW_CELL_CLICK,m.COL_CELL_CLICK].forEach(e=>{this.spreadsheet.on(e,e=>this.bindMediaCellClick(e))})}bindMediaCellClick(e){var t,i,s,o;const n=this.spreadsheet.getCell(e.target),r=null===(i=null===(t=null==n?void 0:n.getRenderer)||void 0===t?void 0:t.call(n))||void 0===i?void 0:i.type;r===Y.IMAGE&&"image"!==(0,a.get)(e.target,"nodeName")||r===Y.VIDEO&&(0,a.get)(e.target,"name")!==X||(null===(o=null===(s=null==n?void 0:n.getRenderer)||void 0===s?void 0:s.call(n))||void 0===o?void 0:o.type)&&(this.spreadsheet.isPivotMode()||n.cellType!==d.vZ.COL_CELL)&&(this.spreadsheet.emit(m.GLOBAL_PREVIEW_CLICK,e),gn(n))}}class vn extends an{bindEvents(){this.bindCornerCellClick()}bindCornerCellClick(){this.spreadsheet.on(m.CORNER_CELL_CLICK,e=>{const t=this.spreadsheet.getCell(e.target);if(!t)return;const i=t.getMeta();switch(null==i?void 0:i.cornerType){case gs.Q.Row:this.onRowCornerClick(null==i?void 0:i.field,e);break;case gs.Q.Col:this.onColCornerClick(null==i?void 0:i.field,e);break;case gs.Q.Series:this.onSeriesCornerClick(null==i?void 0:i.field,e)}})}onRowCornerClick(e,t){const i=this.getSelectedRowNodes(e);this.selectCells(i,t)}onColCornerClick(e,t){const i=this.getSelectedColNodes(e);this.selectCells(i,t)}onSeriesCornerClick(e,t){const i=this.spreadsheet.facet.getSeriesNumberNodes();this.selectCells(i,t)}getSelectedRowNodes(e){const{facet:t}=this.spreadsheet;if(this.spreadsheet.isHierarchyTreeType())return t.getRowNodes();if(!this.spreadsheet.isCustomRowFields())return t.getRowNodesByField(e);const i=t.getRowNodesByField(e)[0];return t.getRowNodes(null==i?void 0:i.level)}getSelectedColNodes(e){const{facet:t}=this.spreadsheet;if(!this.spreadsheet.isCustomColumnFields())return t.getColNodesByField(e);const i=t.getColNodesByField(e)[0];return t.getColNodes(null==i?void 0:i.level)}getCellMetas(e,t){return e.map(e=>({id:e.id,colIndex:-1,rowIndex:-1,type:t}))}emitSelectEvent(e,t){this.spreadsheet.interaction.emitSelectEvent({event:e,targetCell:t,interactionName:d.oB.CORNER_CELL_CLICK})}selectCells(e,t){var i;const{interaction:s}=this.spreadsheet,o=null===(i=e[0])||void 0===i?void 0:i.belongsCell,n=this.getCellMetas(e,null==o?void 0:o.cellType),r=this.spreadsheet.getCell(t.target);if(o&&s.isSelectedCell(o))return s.reset(),void this.emitSelectEvent(t,r);(0,a.isEmpty)(e)||(0,a.isEmpty)(n)||(s.addIntercepts([d.fR.HOVER]),s.changeState({cells:n,stateName:d.xT.SELECTED}),s.highlightNodes(e,d.xT.SELECTED),null==r||r.updateByState(d.xT.SELECTED),this.showTooltip(t),this.emitSelectEvent(t,r))}showTooltip(e){const t=this.spreadsheet.interaction.getActiveCells(),i=this.getTooltipOperator(e);this.spreadsheet.showTooltipWithInfo(e,[],{operator:i,data:{summaries:[{selectedData:t,name:"",value:null}]}})}}class fn extends an{bindEvents(){this.bindDataCellHover(),this.bindHeaderCellHover()}changeStateToHoverFocus(e,t){var i;if(!e)return;const s=e.getMeta(),{interaction:o}=this.spreadsheet,{interaction:n}=this.spreadsheet.options,{hoverFocus:r}=n;o.clearHoverTimer();const l=()=>{if(o.hasIntercepts([d.fR.HOVER]))return;o.changeState({cells:[$o(e)],stateName:d.xT.HOVER_FOCUS});const i=this.spreadsheet.isTableMode(),r={isTotals:s.isTotals,hideSummary:!0,onlyShowCellText:i};(null==n?void 0:n.hoverHighlight)&&o.updateDataCellRelevantHeaderCells(d.xT.HOVER,s),this.spreadsheet.emit(m.DATA_CELL_HOVER_TRIGGERED_PRIVATE,e);const l=this.getCellData(s,i);this.spreadsheet.showTooltipWithInfo(t,l,r)},c=(0,a.isBoolean)(r)?800:null!==(i=null==r?void 0:r.duration)&&void 0!==i?i:800;if(0===c)l();else{const e=window.setTimeout(()=>l(),c);o.setHoverTimer(e)}}handleHeaderHover(e){var t;const i=this.spreadsheet.getCell(e.target);if((0,a.isEmpty)(i))return;const{interaction:s,facet:o}=this.spreadsheet;s.clearHoverTimer(),s.isActiveCell(i)||(s.changeState({cells:[$o(i)],stateName:d.xT.HOVER}),i.update(),this.showEllipsisTooltip(e,i),null===(t=o.centerFrame)||void 0===t||t.toFront())}showEllipsisTooltip(e,t){if(!t||!t.isTextOverflowing())return void this.spreadsheet.hideTooltip();const i=t.getMeta(),s={isTotals:i.isTotals,hideSummary:!0,onlyShowCellText:!0,enableFormat:!0},o=this.getCellData(i,s.onlyShowCellText);this.spreadsheet.showTooltipWithInfo(e,o,s)}getCellData(e={},t){const{data:i,query:s,value:o,field:n,fieldValue:r,valueField:l,rowQuery:a,colQuery:d}=e,c=i;return t?[Object.assign(Object.assign({},s),{value:o||r,valueField:n||l})]:[c||Object.assign(Object.assign({},a),d)]}bindDataCellHover(){this.spreadsheet.on(m.DATA_CELL_HOVER,e=>{const t=this.spreadsheet.getCell(e.target);if((0,a.isEmpty)(t))return;const{interaction:i,options:s}=this.spreadsheet;if(i.isActiveCell(t))return;const{interaction:o}=s,n=null==t?void 0:t.getMeta();i.changeState({cells:[$o(t)],stateName:d.xT.HOVER}),(null==o?void 0:o.hoverHighlight)&&i.updateDataCellRelevantHeaderCells(d.xT.HOVER,n),(null==o?void 0:o.hoverFocus)&&this.changeStateToHoverFocus(t,e),this.spreadsheet.emit(m.DATA_CELL_HOVER_TRIGGERED_PRIVATE,t)})}bindHeaderCellHover(){[m.ROW_CELL_HOVER,m.COL_CELL_HOVER,m.CORNER_CELL_HOVER].forEach(e=>{this.spreadsheet.on(e,e=>{this.handleHeaderHover(e)})})}}class Cn extends an{constructor(){super(...arguments),this.displayedCells=[],this.brushRangeCells=[],this.brushSelectionStage=d.Ri.UN_DRAGGED,this.brushSelectionMinimumMoveDistance=5,this.scrollAnimationComplete=!0,this.mouseMoveDistanceFromCanvas=0,this.setMoveDistanceFromCanvas=(e,t,i)=>{let s=0;if(t&&(s=e.x),i){const i=e.y;s=t?Math.max(i,s):i}this.mouseMoveDistanceFromCanvas=Math.abs(s)},this.formatBrushPointForScroll=(e,t=!1)=>{var i,s,o,n;const{x:r,y:l}=e,{facet:a}=this.spreadsheet,{minX:d,maxX:c}=t?a.cornerBBox:a.panelBBox,{minY:h,maxY:u}=a.panelBBox;let p=(null===(i=this.endBrushPoint)||void 0===i?void 0:i.x)+r,g=(null===(s=this.endBrushPoint)||void 0===s?void 0:s.y)+l,m=t?!!a.hRowScrollBar:!!a.hScrollBar,v=!!a.vScrollBar;const f=null===(n=null===(o=a.vScrollBar)||void 0===o?void 0:o.getBBox())||void 0===n?void 0:n.width;return p>c?p=c-f-2:p<d?p=d+2:m=!1,g>u?g=u-2:g<=h?g=h+2:v=!1,{x:{value:p,needScroll:m},y:{value:g,needScroll:v}}},this.autoScrollIntervalId=null,this.rectanglesIntersect=(e,t)=>e.maxX>t.minX&&e.minX<t.maxX&&e.minY<t.maxY&&e.maxY>t.minY,this.autoScrollConfig=(0,a.cloneDeep)(d.hu),this.validateYIndex=e=>{var t,i;const{facet:s}=this.spreadsheet,o=s.frozenGroupAreas;let n=0;const r=null===(t=null==o?void 0:o.frozenRow)||void 0===t?void 0:t.range;if((null==r?void 0:r[1])&&(n=r[1]+1),e<n)return null;let l=s.getCellRange().end;const a=null===(i=null==o?void 0:o.frozenTrailingRow)||void 0===i?void 0:i.range;return(null==a?void 0:a[0])&&(l=a[0]-1),e>l?null:e},this.validateXIndex=e=>{const{facet:t}=this.spreadsheet,i=t.frozenGroupAreas;let o=0;const n=i[s.Col].range;if((null==n?void 0:n[1])&&(o=n[1]+1),e<o)return null;let r=t.getColLeafNodes().length-1;const l=i[s.TrailingCol].range;return(null==l?void 0:l[0])&&(r=l[0]-1),e>r?null:e},this.adjustNextColIndexWithFrozen=(e,t)=>{const{facet:i}=this.spreadsheet,s=i.getColLeafNodes().length,{colCount:o,trailingColCount:n}=i.getFrozenOptions(),r=i.panelScrollGroupIndexes;return o>0&&t===d.Dh.SCROLL_UP&&x(e,o)?r[0]:n>0&&t===d.Dh.SCROLL_DOWN&&_(e,n,s)?r[1]:e},this.adjustNextRowIndexWithFrozen=(e,t)=>{const{facet:i}=this.spreadsheet,s=i.getCellRange(),{rowCount:o,trailingRowCount:n}=i.getFrozenOptions(),r=i.panelScrollGroupIndexes;return o>0&&t===d.Dh.SCROLL_UP&&S(e,s.start,o)?r[2]:n>0&&t===d.Dh.SCROLL_DOWN&&b(e,s.end,n)?r[3]:e},this.getWillScrollRowIndexDiff=e=>e===d.Dh.SCROLL_DOWN?d.Wd.SCROLL_DOWN:d.Wd.SCROLL_UP,this.getDefaultWillScrollToRowIndex=e=>{const t=this.adjustNextRowIndexWithFrozen(this.endBrushPoint.rowIndex,e)+this.getWillScrollRowIndexDiff(e);return this.validateYIndex(t)},this.getWillScrollToRowIndex=e=>this.getDefaultWillScrollToRowIndex(e),this.getNextScrollDelta=e=>{const{scrollX:t=0,scrollY:i=0}=this.spreadsheet.facet.getScrollOffset();let o=0,n=0;if(e.y.scroll){const t=e.y.value>0?d.Dh.SCROLL_DOWN:d.Dh.SCROLL_UP,o=this.getWillScrollToRowIndex(t);if((0,a.isNil)(o))n=0;else{const e=((e,t,i)=>{const{facet:o}=i,{getCellOffsetY:n}=o.viewCellHeights,{viewportHeight:r}=o.panelBBox,l=n(e+1);if((0,a.isNil)(l))return 0;const c=null==o?void 0:o.frozenGroupAreas,h=c[s.Row].height,u=c[s.TrailingRow].height;return t===d.Dh.SCROLL_UP?n(e)-h:l-(r-u)})(o,t,this.spreadsheet)-i;n=(0,a.isNil)(e)||Number.isNaN(e)?0:e}}if(e.x.scroll){const i=e.x.value>0?d.Dh.SCROLL_DOWN:d.Dh.SCROLL_UP,n=this.adjustNextColIndexWithFrozen(this.endBrushPoint.colIndex,i),r=this.validateXIndex(n+(e.x.value>0?1:-1));o=(0,a.isNil)(r)?0:((e,t,i)=>{const{facet:o}=i,{viewportWidth:n}=o.panelBBox,r=null==o?void 0:o.frozenGroupAreas,l=r[s.Col].width,a=r[s.TrailingCol].width,c=o.getColLeafNodes()[e];return t===d.Dh.SCROLL_UP?c.x-l:c.x+c.width-(n-a)})(r,i,this.spreadsheet)-t}return{x:o,y:n}},this.onScrollAnimationComplete=()=>{this.scrollAnimationComplete=!0,this.brushSelectionStage!==d.Ri.UN_DRAGGED&&this.renderPrepareSelected(this.endBrushPoint)},this.autoScroll=(e=!1)=>{if(this.brushSelectionStage===d.Ri.UN_DRAGGED||!this.scrollAnimationComplete)return;const t=this.autoScrollConfig,i=this.spreadsheet.facet.getScrollOffset(),s=e?"rowHeaderOffsetX":"offsetX",o={rowHeaderOffsetX:{value:i.rowHeaderScrollX,animate:!0},offsetX:{value:i.scrollX,animate:!0},offsetY:{value:i.scrollY,animate:!0}},{x:n,y:r}=this.getNextScrollDelta(t);if(0===r&&0===n)return void this.clearAutoScroll();if(t.y.scroll&&(o.offsetY.value+=r),t.x.scroll){const e=o[s];e.value+=n,e.value<0&&(e.value=0)}this.scrollAnimationComplete=!1;const l=Math.max(16,300-this.mouseMoveDistanceFromCanvas*(t.x.scroll?1:3));this.spreadsheet.facet.scrollWithAnimation(o,l,this.onScrollAnimationComplete)},this.handleScroll=(0,a.throttle)((e,t,i=!1)=>{if(this.brushSelectionStage===d.Ri.UN_DRAGGED)return;const{x:{value:s,needScroll:o},y:{value:n,needScroll:r}}=this.formatBrushPointForScroll({x:e,y:t},i),l=this.autoScrollConfig;r&&(l.y.value=t,l.y.scroll=!0),o&&(l.x.value=e,l.x.scroll=!0),this.setMoveDistanceFromCanvas({x:e,y:t},o,r),this.renderPrepareSelected({x:s,y:n}),(r||o)&&(this.clearAutoScroll(),this.autoScroll(i),this.autoScrollIntervalId=setInterval(()=>{this.autoScroll(i)},16))},30),this.clearAutoScroll=()=>{this.autoScrollIntervalId&&(clearInterval(this.autoScrollIntervalId),this.autoScrollIntervalId=null,this.resetScrollDelta())},this.onUpdateCells=(e,t)=>t(),this.showPrepareSelectedCells=()=>{this.brushRangeCells=this.getBrushRangeCells(),this.spreadsheet.interaction.changeState({cells:(0,a.map)(this.brushRangeCells,e=>$o(e)),stateName:d.xT.PREPARE_SELECT,force:!0,onUpdateCells:this.onUpdateCells})},this.renderPrepareSelected=e=>{const{x:t,y:i}=e,s=this.spreadsheet.container.document.elementsFromPointSync(t,i).map(e=>this.spreadsheet.getCell(e)).find(Boolean);if(!s||!(s instanceof Ri||s instanceof ds||s instanceof Ti))return;const{rowIndex:o,colIndex:n}=s.getMeta();this.endBrushPoint={x:t,y:i,rowIndex:o,colIndex:n};const{interaction:r}=this.spreadsheet;r.addIntercepts([d.fR.HOVER]),r.clearStyleIndependent(),this.isValidBrushSelection()&&(this.showPrepareSelectedCells(),this.updatePrepareSelectMask())}}bindEvents(){this.bindMouseDown(),this.bindMouseMove(),this.bindMouseUp()}getPrepareSelectMaskTheme(){var e;return null===(e=this.spreadsheet.theme)||void 0===e?void 0:e.prepareSelectMask}initPrepareSelectMaskShape(){var e;const{foregroundGroup:t}=this.spreadsheet.facet;if(!t)return;null===(e=this.prepareSelectMaskShape)||void 0===e||e.remove();const i=this.getPrepareSelectMaskTheme();this.prepareSelectMaskShape=t.appendChild(new l.rw({style:{width:0,height:0,x:0,y:0,fill:null==i?void 0:i.backgroundColor,fillOpacity:null==i?void 0:i.backgroundOpacity,zIndex:5,visibility:"hidden",pointerEvents:"none"}}))}setBrushSelectionStage(e){this.brushSelectionStage=e}isPointInCanvas(e){const{height:t,width:i}=this.spreadsheet.facet.getCanvasSize(),{minX:s,minY:o}=this.spreadsheet.facet.panelBBox;return(null==e?void 0:e.x)>s&&(null==e?void 0:e.x)<i&&(null==e?void 0:e.y)>o&&(null==e?void 0:e.y)<t}resetDrag(){this.hidePrepareSelectMaskShape(),this.setBrushSelectionStage(d.Ri.UN_DRAGGED)}isValidBrushSelection(){const{start:e,end:t}=this.getBrushRange();return t.x-e.x>this.brushSelectionMinimumMoveDistance||t.y-e.y>this.brushSelectionMinimumMoveDistance}setDisplayedCells(){this.displayedCells=this.spreadsheet.facet.getDataCells()}updatePrepareSelectMask(){const e=this.getBrushRange(),{x:t,y:i}=this.getPrepareSelectMaskPosition(e);this.prepareSelectMaskShape.attr({x:t,y:i,width:e.width,height:e.height}),this.prepareSelectMaskShape.setAttribute("visibility","visible")}hidePrepareSelectMaskShape(){var e;null===(e=this.prepareSelectMaskShape)||void 0===e||e.setAttribute("visibility","hidden")}resetScrollDelta(){this.autoScrollConfig=(0,a.cloneDeep)(d.hu)}getBrushPoint(e){const{scrollY:t,scrollX:i}=this.spreadsheet.facet.getScrollOffset(),s={x:null==e?void 0:e.x,y:null==e?void 0:e.y},o=this.spreadsheet.getCell(e.target),{colIndex:n,rowIndex:r}=o.getMeta();return Object.assign(Object.assign({},s),{rowIndex:r,colIndex:n,scrollY:t,scrollX:i})}getBrushRange(){var e,t,i,s,o,n,r,l;const{scrollX:a=0,scrollY:d=0}=this.spreadsheet.facet.getScrollOffset(),c=Math.min(this.startBrushPoint.rowIndex,null===(e=this.endBrushPoint)||void 0===e?void 0:e.rowIndex),h=Math.max(this.startBrushPoint.rowIndex,null===(t=this.endBrushPoint)||void 0===t?void 0:t.rowIndex),u=Math.min(this.startBrushPoint.colIndex,null===(i=this.endBrushPoint)||void 0===i?void 0:i.colIndex),p=Math.max(this.startBrushPoint.colIndex,null===(s=this.endBrushPoint)||void 0===s?void 0:s.colIndex),g=this.startBrushPoint.x+this.startBrushPoint.scrollX-a,m=this.startBrushPoint.y+this.startBrushPoint.scrollY-d,v=Math.min(g,null===(o=this.endBrushPoint)||void 0===o?void 0:o.x),f=Math.max(g,null===(n=this.endBrushPoint)||void 0===n?void 0:n.x),C=Math.min(m,null===(r=this.endBrushPoint)||void 0===r?void 0:r.y),y=Math.max(m,null===(l=this.endBrushPoint)||void 0===l?void 0:l.y);return{start:{rowIndex:c,colIndex:u,x:v,y:C},end:{rowIndex:h,colIndex:p,x:f,y},width:f-v,height:y-C}}getBrushRangeCells(){return this.setDisplayedCells(),this.displayedCells.filter(e=>{const t=e.getMeta();return this.isInBrushRange(t)})}mouseDown(e){var t;null===(t=null==e?void 0:e.preventDefault)||void 0===t||t.call(e),this.spreadsheet.interaction.hasIntercepts([d.fR.CLICK])||(this.setBrushSelectionStage(d.Ri.CLICK),this.initPrepareSelectMaskShape(),this.setDisplayedCells(),this.startBrushPoint=this.getBrushPoint(e))}addBrushIntercepts(){this.spreadsheet.interaction.addIntercepts([d.fR.DATA_CELL_BRUSH_SELECTION])}bindMouseUp(e=!1){this.spreadsheet.on(m.GLOBAL_MOUSE_UP,t=>{if(this.brushSelectionStage===d.Ri.DRAGGED){if(e&&this.clearAutoScroll(),this.isValidBrushSelection()){this.addBrushIntercepts(),this.updateSelectedCells(t);const e=rn(this.spreadsheet);this.spreadsheet.showTooltipWithInfo(t,e)}this.spreadsheet.interaction.getCurrentStateName()===d.xT.PREPARE_SELECT&&this.spreadsheet.interaction.reset(),this.resetDrag()}else this.resetDrag()}),this.spreadsheet.on(m.GLOBAL_CONTEXT_MENU,()=>{this.brushSelectionStage!==d.Ri.UN_DRAGGED&&(this.spreadsheet.interaction.removeIntercepts([d.fR.HOVER]),this.resetDrag())})}autoBrushScroll(e,t=!1){var i,s;if(this.clearAutoScroll(),!this.isPointInCanvas(e)){const o=(null==e?void 0:e.x)-(null===(i=this.endBrushPoint)||void 0===i?void 0:i.x),n=(null==e?void 0:e.y)-(null===(s=this.endBrushPoint)||void 0===s?void 0:s.y);return this.handleScroll(o,n,t),!0}return!1}emitBrushSelectionEvent(e,t,i){this.spreadsheet.emit(e,t,i),this.spreadsheet.emit(m.GLOBAL_SELECTED,t,i),(0,a.isEmpty)(t)&&this.spreadsheet.interaction.removeIntercepts([d.fR.HOVER])}getVisibleBrushRangeCells(e){return this.brushRangeCells.find(t=>{const i=t.getMeta();return(null==i?void 0:i.id)===e})}isInBrushRange(e){return!1}bindMouseDown(){}bindMouseMove(){}updateSelectedCells(e){}getPrepareSelectMaskPosition(e){return{x:e.start.x,y:e.start.y}}}class yn extends Cn{constructor(){super(...arguments),this.displayedCells=[],this.brushRangeCells=[],this.onUpdateCells=e=>e.updateCells(this.spreadsheet.facet.getColCells())}bindEvents(){this.bindMouseDown(),this.bindMouseMove(),this.bindMouseUp()}bindMouseDown(){this.spreadsheet.on(m.COL_CELL_MOUSE_DOWN,e=>{this.spreadsheet.interaction.getBrushSelection().colCell&&super.mouseDown(e)})}isPointInCanvas(e){const{width:t}=this.spreadsheet.facet.getCanvasSize(),{width:i,minY:s,maxY:o}=this.spreadsheet.facet.cornerBBox;return e.x>=i&&e.x<=t&&e.y>=s&&e.y<=o}bindMouseMove(){this.spreadsheet.on(m.COL_CELL_MOUSE_MOVE,e=>{var t;if(this.brushSelectionStage===d.Ri.UN_DRAGGED)return;this.setBrushSelectionStage(d.Ri.DRAGGED);const i=null===(t=this.spreadsheet.interaction.eventController)||void 0===t?void 0:t.getViewportPoint(e);this.isPointInCanvas(i)&&this.renderPrepareSelected(i)})}setDisplayedCells(){this.displayedCells=this.spreadsheet.facet.getColCells()}isInBrushRange(e){const{start:t,end:i}=this.getBrushRange(),{scrollX:s=0}=this.spreadsheet.facet.getScrollOffset(),o=this.spreadsheet.facet.cornerBBox,{x:n=0,y:r=0,width:l=0,height:a=0}=e;return this.rectanglesIntersect({minX:t.x-o.width+s,minY:t.y,maxX:i.x-o.width+s,maxY:i.y},{minX:n,maxX:n+l,minY:r,maxY:r+a})}updateSelectedCells(e){const{interaction:t,facet:i}=this.spreadsheet;t.changeState({cells:(0,a.map)(this.brushRangeCells,$o),onUpdateCells:e=>{e.updateCells(i.getColCells())},stateName:d.xT.COL_CELL_BRUSH_SELECTED}),this.emitBrushSelectionEvent(m.COL_CELL_BRUSH_SELECTION,this.brushRangeCells,{event:e,targetCell:this.brushRangeCells[0],interactionName:d.oB.COL_CELL_BRUSH_SELECTION})}addBrushIntercepts(){this.spreadsheet.interaction.addIntercepts([d.fR.COL_CELL_BRUSH_SELECTION])}}class wn extends Cn{constructor(){super(...arguments),this.displayedCells=[],this.brushRangeCells=[],this.getSelectedCellMetas=e=>{const{facet:t}=this.spreadsheet,i=[],s=t.getRowLeafNodes(),o=t.getColLeafNodes(),n=(0,a.range)(e.start.rowIndex,e.end.rowIndex+1),r=(0,a.range)(e.start.colIndex,e.end.colIndex+1);return n.forEach(e=>{r.forEach(t=>{const n=String(o[t].id),r=(0,a.isEmpty)(s)?String(e):String(s[e].id);i.push({colIndex:t,rowIndex:e,id:xe(r,n),type:d.vZ.DATA_CELL,rowId:r,colId:n,spreadsheet:this.spreadsheet})})}),i}}bindMouseDown(){this.spreadsheet.on(m.DATA_CELL_MOUSE_DOWN,e=>{this.spreadsheet.interaction.getBrushSelection().dataCell&&(super.mouseDown(e),this.resetScrollDelta())})}bindMouseMove(){this.spreadsheet.on(m.GLOBAL_MOUSE_MOVE,e=>{if(this.brushSelectionStage===d.Ri.UN_DRAGGED)return;this.setBrushSelectionStage(d.Ri.DRAGGED);const t=this.spreadsheet.interaction.eventController.getViewportPoint(e);this.autoBrushScroll(t)||this.renderPrepareSelected(t)})}isInBrushRange(e){const{start:t,end:i}=this.getBrushRange(),{rowIndex:s,colIndex:o}=e;return s>=t.rowIndex&&s<=i.rowIndex&&o>=t.colIndex&&o<=i.colIndex}updateSelectedCells(e){const t=this.getBrushRange(),i=this.getSelectedCellMetas(t);this.spreadsheet.interaction.changeState({cells:i,stateName:d.xT.DATA_CELL_BRUSH_SELECTED,onUpdateCells:Yo});const s=this.getScrollBrushRangeCells(i);this.emitBrushSelectionEvent(m.DATA_CELL_BRUSH_SELECTION,s,{event:e,targetCell:s[0],interactionName:d.oB.DATA_CELL_BRUSH_SELECTION})}getScrollBrushRangeCells(e){return e.map(e=>{const t=this.getVisibleBrushRangeCells(e.id);if(t)return t;const i=this.spreadsheet.facet.getCellMeta(e.rowIndex,e.colIndex);return this.spreadsheet.facet.createDataCell(i)})}bindMouseUp(){super.bindMouseUp(!0)}getPrepareSelectMaskPosition(e){const{minX:t,minY:i}=this.spreadsheet.facet.panelBBox;return{x:Math.max(e.start.x,t),y:Math.max(e.start.y,i)}}}class xn extends Cn{constructor(){super(...arguments),this.displayedCells=[],this.brushRangeCells=[],this.isInBrushRange=e=>{const{start:t,end:i}=this.getBrushRange(),{scrollY:s,rowHeaderScrollX:o}=this.spreadsheet.facet.getScrollOffset(),{cornerBBox:n}=this.spreadsheet.facet,{x:r=0,y:l=0,width:a=0,height:d=0}=e;return this.rectanglesIntersect({minX:t.x+o,minY:t.y-n.height+s,maxX:i.x+o,maxY:i.y-n.height+s},{minX:r,maxX:r+a,minY:l,maxY:l+d})},this.onUpdateCells=e=>e.updateCells(this.spreadsheet.facet.getRowCells()),this.getSelectedRowNodes=()=>this.spreadsheet.facet.getRowNodes().filter(this.isInBrushRange),this.getVisibleRowLeafCellByScrollDirection=e=>{const t=this.spreadsheet.facet.getRowCells();return e===d.Dh.SCROLL_DOWN?(0,a.last)(t):t.find(e=>e.getMeta().isLeaf)},this.getWillScrollToRowIndex=e=>{var t,i;if(!(0,a.isNil)(this.endBrushPoint.rowIndex))return this.getDefaultWillScrollToRowIndex(e);const s=this.getVisibleRowLeafCellByScrollDirection(e),o=(null!==(i=null===(t=null==s?void 0:s.getMeta())||void 0===t?void 0:t.rowIndex)&&void 0!==i?i:0)+this.getWillScrollRowIndexDiff(e);return this.validateYIndex(o)}}bindMouseDown(){this.spreadsheet.on(m.ROW_CELL_MOUSE_DOWN,e=>{this.spreadsheet.interaction.getBrushSelection().rowCell&&super.mouseDown(e)})}isPointInCanvas(e){const{height:t}=this.spreadsheet.facet.getCanvasSize(),{minX:i,height:s,maxX:o}=this.spreadsheet.facet.cornerBBox;return e.x>=i&&e.x<=o&&e.y>=s&&e.y<=t}bindMouseMove(){this.spreadsheet.on(m.GLOBAL_MOUSE_MOVE,e=>{if(this.brushSelectionStage===d.Ri.UN_DRAGGED)return;this.setBrushSelectionStage(d.Ri.DRAGGED);const t=this.spreadsheet.interaction.eventController.getViewportPoint(e);this.autoBrushScroll(t,!0)||this.renderPrepareSelected(t)})}setDisplayedCells(){this.displayedCells=this.spreadsheet.facet.getRowCells()}updateSelectedCells(e){const t=this.getSelectedRowNodes(),i=this.getScrollBrushRangeCells(t),s=(0,a.map)(i,$o);this.spreadsheet.interaction.changeState({cells:s,stateName:d.xT.ROW_CELL_BRUSH_SELECTED,onUpdateCells:this.onUpdateCells}),this.emitBrushSelectionEvent(m.ROW_CELL_BRUSH_SELECTION,i,{event:e,targetCell:i[0],interactionName:d.oB.ROW_CELL_BRUSH_SELECTION})}addBrushIntercepts(){this.spreadsheet.interaction.addIntercepts([d.fR.ROW_CELL_BRUSH_SELECTION])}getScrollBrushRangeCells(e){return e.map(e=>{const t=this.getVisibleBrushRangeCells(e.id);return t||this.spreadsheet.facet.rowHeader.getCellInstance(e)})}getPrepareSelectMaskPosition(e){const{minY:t}=this.spreadsheet.facet.panelBBox;return{x:e.start.x,y:Math.max(e.start.y,t)}}}class _n extends an{constructor(){super(...arguments),this.isMultiSelection=!1}bindEvents(){this.bindKeyboardDown(),this.bindDataCellClick(),this.bindKeyboardUp(),this.bindMouseMove()}reset(){this.isMultiSelection=!1,this.spreadsheet.interaction.removeIntercepts([d.fR.CLICK])}bindKeyboardDown(){this.spreadsheet.on(m.GLOBAL_KEYBOARD_DOWN,e=>{Go(e)&&(this.isMultiSelection=!0,this.spreadsheet.interaction.addIntercepts([d.fR.CLICK]))})}bindKeyboardUp(){this.spreadsheet.on(m.GLOBAL_KEYBOARD_UP,e=>{Go(e)&&this.reset()})}bindMouseMove(){this.spreadsheet.on(m.GLOBAL_MOUSE_MOVE,e=>{this.isMultiSelection&&!Vo(e)&&this.reset()})}getSelectedCells(e){const t=e.getMeta().id,{interaction:i}=this.spreadsheet;let s=i.getCells([d.vZ.DATA_CELL]),o=[];return i.getCurrentStateName()!==d.xT.SELECTED&&(s=[]),o=s.find(e=>e.id===t)?s.filter(e=>e.id!==t):[...s,$o(e)],o}bindDataCellClick(){this.spreadsheet.on(m.DATA_CELL_CLICK,e=>{e.stopPropagation();const t=this.spreadsheet.getCell(e.target),i=t.getMeta(),{interaction:s}=this.spreadsheet;if(this.isMultiSelection&&i){const i=this.getSelectedCells(t);if((0,a.isEmpty)(i))return s.clearState(),this.spreadsheet.hideTooltip(),void s.emitSelectEvent({event:e,targetCell:t,interactionName:d.oB.DATA_CELL_MULTI_SELECTION});s.addIntercepts([d.fR.CLICK,d.fR.HOVER]),this.spreadsheet.hideTooltip(),s.changeState({cells:i,stateName:d.xT.SELECTED,onUpdateCells:Yo}),s.emitSelectEvent({event:e,targetCell:t,interactionName:d.oB.DATA_CELL_MULTI_SELECTION}),this.spreadsheet.showTooltipWithInfo(e,rn(this.spreadsheet))}})}}var Sn=i("./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/engine/CustomImage.js"),bn=i("./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/utils/export/copy/core.js"),En=i("./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/utils/export/method.js");class Ln{constructor(e){this.canvasEventHandlers=[],this.s2EventHandlers=[],this.domEventListeners=[],this.isCanvasEffect=!1,this.onScroll=(0,a.throttle)(()=>{this.spreadsheet.hideTooltip()},16),this.isGuiIconShape=e=>e instanceof Sn.$&&e.imgType===ie.r.type,this.isConditionIconShape=(e,t)=>t.getConditionIconShapes().some(t=>{var i;return(null==t?void 0:t.name)===(null===(i=null==e?void 0:e.attributes)||void 0===i?void 0:i.name)}),this.onCanvasMousedown=e=>{if(this.target=e.target,this.spreadsheet.interaction.clearHoverTimer(),this.isResizeArea(e)){this.spreadsheet.emit(m.LAYOUT_RESIZE_MOUSE_DOWN,e);const t=e=>{if(!this.spreadsheet.getCanvasElement())return!1;this.spreadsheet.getCanvasElement()!==e.target&&this.spreadsheet.emit(m.LAYOUT_RESIZE_MOUSE_MOVE,e)};return window.addEventListener(ps.POINTER_MOVE,t),void window.addEventListener(ps.POINTER_UP,()=>{window.removeEventListener(ps.POINTER_MOVE,t)},{once:!0})}switch(this.spreadsheet.getCellType(e.target)){case d.vZ.DATA_CELL:this.spreadsheet.emit(m.DATA_CELL_MOUSE_DOWN,e);break;case d.vZ.ROW_CELL:this.spreadsheet.emit(m.ROW_CELL_MOUSE_DOWN,e);break;case d.vZ.COL_CELL:this.spreadsheet.emit(m.COL_CELL_MOUSE_DOWN,e);break;case d.vZ.CORNER_CELL:this.spreadsheet.emit(m.CORNER_CELL_MOUSE_DOWN,e);break;case d.vZ.MERGED_CELL:this.spreadsheet.emit(m.MERGED_CELLS_MOUSE_DOWN,e)}},this.onCanvasMousemove=e=>{if(this.canvasMousemoveEvent=e,this.isResizeArea(e))return this.activeResizeArea(e),void this.spreadsheet.emit(m.LAYOUT_RESIZE_MOUSE_MOVE,e.nativeEvent);this.resetResizeArea();const t=this.spreadsheet.getCell(e.target);if(t){const i=t.cellType;switch(i){case d.vZ.DATA_CELL:this.spreadsheet.emit(m.DATA_CELL_MOUSE_MOVE,e);break;case d.vZ.ROW_CELL:this.spreadsheet.emit(m.ROW_CELL_MOUSE_MOVE,e);break;case d.vZ.COL_CELL:this.spreadsheet.emit(m.COL_CELL_MOUSE_MOVE,e);break;case d.vZ.CORNER_CELL:this.spreadsheet.emit(m.CORNER_CELL_MOUSE_MOVE,e);break;case d.vZ.MERGED_CELL:this.spreadsheet.emit(m.MERGED_CELLS_MOUSE_MOVE,e)}if(!this.hasBrushSelectionIntercepts())switch(this.spreadsheet.emit(m.GLOBAL_HOVER,e),i){case d.vZ.DATA_CELL:this.spreadsheet.emit(m.DATA_CELL_HOVER,e);break;case d.vZ.ROW_CELL:this.spreadsheet.emit(m.ROW_CELL_HOVER,e);break;case d.vZ.COL_CELL:this.spreadsheet.emit(m.COL_CELL_HOVER,e);break;case d.vZ.CORNER_CELL:this.spreadsheet.emit(m.CORNER_CELL_HOVER,e);break;case d.vZ.MERGED_CELL:this.spreadsheet.emit(m.MERGED_CELLS_HOVER,e)}}},this.onCanvasMouseup=e=>{if(this.isResizeArea(e))return void this.spreadsheet.emit(m.LAYOUT_RESIZE_MOUSE_UP,e);const t=this.spreadsheet.getCell(e.target);if(t){switch(t.cellType){case d.vZ.DATA_CELL:this.spreadsheet.emit(m.DATA_CELL_MOUSE_UP,e);break;case d.vZ.ROW_CELL:this.spreadsheet.emit(m.ROW_CELL_MOUSE_UP,e);break;case d.vZ.COL_CELL:this.spreadsheet.emit(m.COL_CELL_MOUSE_UP,e);break;case d.vZ.CORNER_CELL:this.spreadsheet.emit(m.CORNER_CELL_MOUSE_UP,e);break;case d.vZ.MERGED_CELL:this.spreadsheet.emit(m.MERGED_CELLS_MOUSE_UP,e)}me()&&this.onCanvasSingleClick(e)}},this.onCanvasClick=e=>{const t=this.spreadsheet;if(1===e.detail&&!me())return void this.onCanvasSingleClick(e);if(2!==e.detail)return;if(this.isResizeArea(e))return void t.emit(m.LAYOUT_RESIZE_MOUSE_UP,e);t.emit(m.GLOBAL_DOUBLE_CLICK,e);const i=t.getCell(e.target);if(i){if(this.target===e.target)switch(i.cellType){case d.vZ.DATA_CELL:t.emit(m.DATA_CELL_DOUBLE_CLICK,e);break;case d.vZ.ROW_CELL:t.emit(m.ROW_CELL_DOUBLE_CLICK,e);break;case d.vZ.COL_CELL:t.emit(m.COL_CELL_DOUBLE_CLICK,e);break;case d.vZ.CORNER_CELL:t.emit(m.CORNER_CELL_DOUBLE_CLICK,e);break;case d.vZ.MERGED_CELL:t.emit(m.MERGED_CELLS_DOUBLE_CLICK,e)}}},this.onCanvasMouseout=e=>{if(!this.isAutoResetSheetStyle(e)||this.isMouseOnTheCanvasContainer(e))return;const{interaction:t}=this.spreadsheet;t.isSelectedState()||t.intercepts.size>0||t.reset()},this.onCanvasContextMenu=e=>{const t=this.spreadsheet;if(this.isResizeArea(e))return void t.emit(m.LAYOUT_RESIZE_MOUSE_UP,e);t.emit(m.GLOBAL_CONTEXT_MENU,e);switch(this.spreadsheet.getCellType(e.target)){case d.vZ.DATA_CELL:this.spreadsheet.emit(m.DATA_CELL_CONTEXT_MENU,e);break;case d.vZ.ROW_CELL:this.spreadsheet.emit(m.ROW_CELL_CONTEXT_MENU,e);break;case d.vZ.COL_CELL:this.spreadsheet.emit(m.COL_CELL_CONTEXT_MENU,e);break;case d.vZ.CORNER_CELL:this.spreadsheet.emit(m.CORNER_CELL_CONTEXT_MENU,e);break;case d.vZ.MERGED_CELL:this.spreadsheet.emit(m.MERGED_CELLS_CONTEXT_MENU,e)}},this.spreadsheet=e,this.bindEvents()}get canvasContainer(){return this.spreadsheet.container}isAutoResetSheetStyle(e){var t;const{interaction:i}=this.spreadsheet.options;return(0,a.isFunction)(null==i?void 0:i.autoResetSheetStyle)?null===(t=null==i?void 0:i.autoResetSheetStyle)||void 0===t?void 0:t.call(i,e,this.spreadsheet):null==i?void 0:i.autoResetSheetStyle}bindEvents(){this.clearAllEvents(),this.addCanvasEvent(ps.MOUSE_DOWN,this.onCanvasMousedown),this.addCanvasEvent(ps.TOUCH_START,e=>{this.target=e.target});const e=me()?ps.TOUCH_END:ps.POINTER_UP;this.addCanvasEvent(ps.POINTER_MOVE,this.onCanvasMousemove),this.addCanvasEvent(ps.MOUSE_OUT,this.onCanvasMouseout),this.addCanvasEvent(e,this.onCanvasMouseup),this.addCanvasEvent(ps.CLICK,this.onCanvasClick),this.addCanvasEvent(ps.RIGHT_DOWN,this.onCanvasContextMenu),this.addS2Event(m.GLOBAL_ACTION_ICON_CLICK,()=>{this.spreadsheet.interaction.addIntercepts([d.fR.HOVER]),this.spreadsheet.interaction.clearState()}),(0,ge.fU)()||(this.addDomEventListener(window,ps.CLICK,e=>{this.resetSheetStyle(e),this.isCanvasEffect=this.isMouseOnTheCanvasContainer(e)}),this.addDomEventListener(window,ps.KEY_DOWN,e=>{this.onKeyboardCopy(e),this.onKeyboardEsc(e),this.spreadsheet.emit(m.GLOBAL_KEYBOARD_DOWN,e)}),this.addDomEventListener(window,ps.KEY_UP,e=>{this.spreadsheet.emit(m.GLOBAL_KEYBOARD_UP,e)}),this.addDomEventListener(window,ps.POINTER_UP,e=>{this.spreadsheet.emit(m.GLOBAL_MOUSE_UP,e)}),this.addDomEventListener(window,ps.POINTER_MOVE,e=>{this.spreadsheet.emit(m.GLOBAL_MOUSE_MOVE,e)}),this.addDomEventListener(window,ps.SCROLL,this.onScroll))}onKeyboardCopy(e){const{copy:t}=this.spreadsheet.options.interaction;if(this.isCanvasEffect&&(null==t?void 0:t.enable)&&(0,En.DV)(e.key,d.B4.COPY)&&(e.metaKey||e.ctrlKey)){const e=(0,bn.w6)(this.spreadsheet);(0,a.isNil)(e)||this.spreadsheet.emit(m.GLOBAL_COPIED,e)}}onKeyboardEsc(e){this.isCanvasEffect&&(0,En.DV)(e.key,d.B4.ESC)&&this.resetSheetStyle(e)}resetSheetStyle(e){var t,i;if(!this.isAutoResetSheetStyle(e)||!this.spreadsheet)return;const{interaction:s}=this.spreadsheet;(null===(t=null==s?void 0:s.hasIntercepts)||void 0===t?void 0:t.call(s,[d.fR.DATA_CELL_BRUSH_SELECTION,d.fR.COL_CELL_BRUSH_SELECTION,d.fR.ROW_CELL_BRUSH_SELECTION]))?null===(i=null==s?void 0:s.removeIntercepts)||void 0===i||i.call(s,[d.fR.DATA_CELL_BRUSH_SELECTION,d.fR.ROW_CELL_BRUSH_SELECTION,d.fR.COL_CELL_BRUSH_SELECTION]):this.isMouseOnTheTooltip(e)||this.isMouseOnTheCanvasContainer(e)||(s.reset(),this.spreadsheet.emit(m.GLOBAL_RESET,e),this.spreadsheet.emit(m.GLOBAL_SELECTED,s.getActiveCells(),{event:e,targetCell:null,interactionName:d.oB.GLOBAL_RESET}))}isMouseEvent(e){return(0,a.hasIn)(e,"clientX")&&(0,a.hasIn)(e,"clientY")}isMatchElement(e){const t=this.spreadsheet.getCanvasElement(),{target:i}=e;return i===t||i instanceof l.q9||i instanceof l.Hl}isMatchPoint(e){const t=this.spreadsheet.getCanvasElement(),{width:i,height:s}=this.getContainerRect(),{x:o,y:n}=t.getBoundingClientRect()||{},{clientX:r,clientY:l}=e;return r<=o+i&&r>=o&&l<=n+s&&l>=n}isMouseOnTheCanvasContainer(e){if(this.isMouseEvent(e)){return!!this.spreadsheet.getCanvasElement()&&(this.spreadsheet.getCanvasConfig().supportsCSSTransform?this.isMatchElement(e):this.isMatchElement(e)&&this.isMatchPoint(e))}return!1}getContainerRect(){var e;const{facet:t,options:i}=this.spreadsheet,s=(null==t?void 0:t.hRowScrollBar)||(null==t?void 0:t.hScrollBar),{maxX:o,maxY:n}=(null==t?void 0:t.panelBBox)||{},{width:r=0,height:l=0}=i,a=(null===(e=null==s?void 0:s.theme)||void 0===e?void 0:e.size)||0;return{width:Math.min(r,o),height:Math.min(l,n+a)}}isMouseOnTheTooltip(e){var t,i,s,o;const{tooltip:n}=this.spreadsheet;if(!(null==n?void 0:n.visible))return!1;const{x:r,y:l,width:a,height:d}=(null===(s=null===(i=null===(t=this.spreadsheet.tooltip)||void 0===t?void 0:t.container)||void 0===i?void 0:i.getBoundingClientRect)||void 0===s?void 0:s.call(i))||{};return e.target instanceof Node?((e,t)=>{let i=!1,s=t;for(;s&&s!==document.body;){if(e===s){i=!0;break}s=s.parentElement}return i})(null===(o=this.spreadsheet.tooltip)||void 0===o?void 0:o.container,e.target):!!this.isMouseEvent(e)&&(e.clientX>=r&&e.clientX<=r+a&&e.clientY>=l&&e.clientY<=l+d)}isResizeArea(e){const t=qo(e.target);return null==t?void 0:t.isResizeArea}activeResizeArea(e){var t,i,s;const o=(0,a.get)(e.target,"attrs.appendInfo");if(null==o?void 0:o.isResizeMask)return;this.resetResizeArea();const n=e.target;this.spreadsheet.store.set("activeResizeArea",n),n.attr(d.lE.backgroundOpacity,null===(s=null===(i=null===(t=this.spreadsheet.theme.resizeArea)||void 0===t?void 0:t.interactionState)||void 0===i?void 0:i.hover)||void 0===s?void 0:s.backgroundOpacity)}resetResizeArea(){var e;const t=this.spreadsheet.store.get("activeResizeArea");(0,a.isEmpty)(t)||t.attr(d.lE.backgroundOpacity,null===(e=this.spreadsheet.theme.resizeArea)||void 0===e?void 0:e.backgroundOpacity),this.spreadsheet.store.set("activeResizeArea",t)}hasBrushSelectionIntercepts(){return this.spreadsheet.interaction.hasIntercepts([d.fR.HOVER,d.fR.DATA_CELL_BRUSH_SELECTION,d.fR.ROW_CELL_BRUSH_SELECTION,d.fR.COL_CELL_BRUSH_SELECTION])}onCanvasSingleClick(e){const t=this.spreadsheet.getCell(e.target);if(this.target===e.target&&t){if(this.isGuiIconShape(e.target)&&!this.isConditionIconShape(e.target,t))return;switch(this.spreadsheet.emit(m.GLOBAL_CLICK,e),t.cellType){case d.vZ.DATA_CELL:this.spreadsheet.emit(m.DATA_CELL_CLICK,e);break;case d.vZ.ROW_CELL:this.spreadsheet.emit(m.ROW_CELL_CLICK,e);break;case d.vZ.COL_CELL:this.spreadsheet.emit(m.COL_CELL_CLICK,e);break;case d.vZ.CORNER_CELL:this.spreadsheet.emit(m.CORNER_CELL_CLICK,e);break;case d.vZ.MERGED_CELL:this.spreadsheet.emit(m.MERGED_CELLS_CLICK,e)}}}clear(){this.unbindEvents()}unbindEvents(){this.clearAllEvents()}addCanvasEvent(e,t){var i;null===(i=this.canvasContainer)||void 0===i||i.on(e,t),this.canvasEventHandlers.push({type:e,handler:t})}addS2Event(e,t){this.spreadsheet.on(e,t),this.s2EventHandlers.push({type:e,handler:t})}addDomEventListener(e,t,i){if(e.addEventListener){const{eventListenerOptions:s}=this.spreadsheet.options.interaction;e.addEventListener(t,i,s),this.domEventListeners.push({target:e,type:t,handler:i,options:s})}else console.error(`Please make sure ${e} has addEventListener function`)}clearAllEvents(){(0,a.each)(this.canvasEventHandlers,({type:e,handler:t})=>{var i;null===(i=this.canvasContainer)||void 0===i||i.removeEventListener(e,t)}),(0,a.each)(this.s2EventHandlers,({type:e,handler:t})=>{this.spreadsheet.off(e,t)}),(0,a.each)(this.domEventListeners,e=>{e.target.removeEventListener(e.type,e.handler,e.options)}),this.canvasEventHandlers=[],this.s2EventHandlers=[],this.domEventListeners=[]}getViewportPoint(e){return!this.spreadsheet.getCanvasConfig().supportsCSSTransform||(0,a.isNil)(e.offsetX)||(0,a.isNil)(e.offsetY)?this.spreadsheet.container.client2Viewport({x:e.clientX,y:e.clientY}):{x:e.offsetX,y:e.offsetY}}}class Tn extends an{constructor(){super(...arguments),this.isRangeSelection=!1,this.handleColClick=e=>{e.stopPropagation();const{interaction:t,facet:i}=this.spreadsheet,s=this.spreadsheet.getCell(e.target),o=null==s?void 0:s.getMeta();if(!(0,a.isNil)(null==o?void 0:o.x)){t.addIntercepts([d.fR.HOVER]);let n=[$o(s)];const r=this.spreadsheet.store.get("lastClickedCell");if(this.isRangeSelection&&r&&r.cellType===s.cellType&&r.getMeta().level===o.level){const{rowsHierarchy:l,colsHierarchy:a}=i.getLayoutResult(),[c,h]=[l.maxLevel,a.maxLevel],{start:u,end:p}=Uo(r.getMeta(),o);s instanceof Ri?n=this.handleSeriesNumberRowSelected(u.rowIndex,p.rowIndex,s):(null==s?void 0:s.cellType)===d.vZ.ROW_CELL&&o.level===c?n=this.handleRowSelected(u.rowIndex,p.rowIndex,s):(null==s?void 0:s.cellType)===d.vZ.COL_CELL&&o.level===h&&(n=this.handleColSelected(u.colIndex,p.colIndex,s)),t.changeState({cells:n,stateName:d.xT.SELECTED});const g=Xo(n);t.updateCells(i.getHeaderCells(g)),t.emitSelectEvent({event:e,targetCell:s,interactionName:d.oB.RANGE_SELECTION})}else(0,a.isEmpty)(t.getCells())&&t.reset(),this.spreadsheet.store.set("lastClickedCell",s)}}}bindEvents(){this.bindKeyboardDown(),this.bindDataCellClick(),this.bindColCellClick(),this.bindKeyboardUp(),this.bindMouseMove()}reset(){this.isRangeSelection=!1,this.spreadsheet.interaction.removeIntercepts([d.fR.CLICK])}bindKeyboardDown(){this.spreadsheet.on(m.GLOBAL_KEYBOARD_DOWN,e=>{e.key===d.B4.SHIFT&&(this.isRangeSelection=!0,this.spreadsheet.interaction.addIntercepts([d.fR.CLICK]))})}bindKeyboardUp(){this.spreadsheet.on(m.GLOBAL_KEYBOARD_UP,e=>{e.key===d.B4.SHIFT&&this.reset()})}bindMouseMove(){this.spreadsheet.on(m.GLOBAL_MOUSE_MOVE,e=>{this.isRangeSelection&&!e.shiftKey&&this.reset()})}bindColCellClick(){this.spreadsheet.on(m.COL_CELL_CLICK,e=>{this.handleColClick(e)})}bindDataCellClick(){this.spreadsheet.on(m.DATA_CELL_CLICK,e=>{e.stopPropagation();const t=this.spreadsheet.getCell(e.target),i=t.getMeta(),{interaction:s}=this.spreadsheet;if(!i)return;const o=this.spreadsheet.store.get("lastClickedCell");if(!(this.isRangeSelection&&(null==o?void 0:o.cellType)===t.cellType))return void this.spreadsheet.store.set("lastClickedCell",t);const{start:n,end:r}=Uo(o.getMeta(),t.getMeta()),l=(0,a.range)(n.colIndex,r.colIndex+1).flatMap(e=>{const i=this.spreadsheet.facet.getColLeafNodes()[e].id;return(0,a.range)(n.rowIndex,r.rowIndex+1).map(s=>({id:`${this.spreadsheet.facet.getSeriesNumberWidth()||this.spreadsheet.isTableMode()?String(s):this.spreadsheet.facet.getRowLeafNodes()[s].id}-${i}`,colIndex:e,rowIndex:s,type:t.cellType}))});s.addIntercepts([d.fR.CLICK,d.fR.HOVER]),s.changeState({cells:l,stateName:d.xT.SELECTED}),this.spreadsheet.showTooltipWithInfo(e,rn(this.spreadsheet)),s.emitSelectEvent({targetCell:t,event:e,interactionName:d.oB.RANGE_SELECTION})})}handleSeriesNumberRowSelected(e,t,i){const s=this.spreadsheet.facet.getColLeafNodes()[0].id;return(0,a.range)(e,t+1).map(e=>({id:`${String(e)}-${s}`,colIndex:0,rowIndex:e,type:i.cellType}))}handleRowSelected(e,t,i){return this.spreadsheet.facet.getRowNodes().filter(({rowIndex:i})=>(0,a.inRange)(i,e,t+1)).map(e=>({id:e.id,colIndex:e.colIndex,rowIndex:e.rowIndex,type:i.cellType}))}handleColSelected(e,t,i){return this.spreadsheet.facet.getColLeafNodes().filter(({colIndex:i})=>(0,a.inRange)(i,e,t+1)).map(e=>({id:e.id,colIndex:e.colIndex,rowIndex:e.rowIndex,type:i.cellType}))}}class On extends an{constructor(){super(...arguments),this.resizeStartPosition={}}bindEvents(){this.bindMouseDown(),this.bindMouseMove(),this.bindMouseUp()}initResizeGroup(){if(this.resizeReferenceGroup)return;this.resizeReferenceGroup=this.spreadsheet.facet.foregroundGroup.appendChild(new l.YJ);const{width:e,height:t}=this.spreadsheet.options,{guideLineColor:i,guideLineDash:s,size:o}=this.getResizeAreaTheme(),n={d:"",lineDash:s,stroke:i,lineWidth:o};this.resizeReferenceGroup.appendChild(new l.wA({id:"RESIZE_START_GUIDE_LINE",style:n})),this.resizeReferenceGroup.appendChild(new l.wA({id:"RESIZE_END_GUIDE_LINE",style:n})),this.resizeReferenceGroup.appendChild(new f({id:"RESIZE_MASK",style:{x:0,y:0,width:e,height:t,fill:"transparent"}},{isResizeArea:!0,isResizeMask:!0}))}getResizeAreaTheme(){return this.spreadsheet.theme.resizeArea}setResizeTarget(e){this.resizeTarget=e}getGuideLineWidthAndHeight(){const{width:e,height:t}=this.spreadsheet.options,{maxY:i,maxX:s}=this.spreadsheet.facet.panelBBox;return{width:Math.min(s,e),height:Math.min(i,t)}}getResizeShapes(){var e;return(null===(e=this.resizeReferenceGroup)||void 0===e?void 0:e.children)||[]}setResizeMaskCursor(e){const[,,t]=this.getResizeShapes();null==t||t.attr("cursor",e)}updateResizeGuideLinePosition(e,t){const i=this.getResizeShapes();if((0,a.isEmpty)(i))return;const[s,o]=i,{type:n,offsetX:r,offsetY:l,width:d,height:c,size:h}=t,{width:p,height:g}=this.getGuideLineWidthAndHeight();this.cursorType=`${n}-resize`,this.setResizeMaskCursor(this.cursorType);const m=h/2;if(n===u.Horizontal)return s.attr("d",[["M",r+m,l],["L",r+m,g]]),o.attr("d",[["M",r+d-m,l],["L",r+d-m,g]]),this.resizeStartPosition.offsetX=e.offsetX,void(this.resizeStartPosition.clientX=e.clientX);s.attr("d",[["M",r,l+m],["L",p,l+m]]),o.attr("d",[["M",r,l+c-m],["L",p,l+c-m]]),this.resizeStartPosition.offsetY=e.offsetY,this.resizeStartPosition.clientY=e.clientY}bindMouseDown(){this.spreadsheet.on(m.LAYOUT_RESIZE_MOUSE_DOWN,e=>{var t;null===(t=null==e?void 0:e.preventDefault)||void 0===t||t.call(e);const i=e.target,s=this.getCellAppendInfo(e.target);this.spreadsheet.store.set("resized",!1),(null==s?void 0:s.isResizeArea)&&(this.spreadsheet.hideTooltip(),this.spreadsheet.interaction.addIntercepts([d.fR.RESIZE]),this.setResizeTarget(i),this.showResizeGroup(),this.updateResizeGuideLinePosition(e,s))})}bindMouseMove(){this.spreadsheet.on(m.LAYOUT_RESIZE_MOUSE_MOVE,(0,a.throttle)(this.resizeMouseMove.bind(this),33))}getResizeGuideLinePosition(){var e;const[t,i]=(null===(e=this.resizeReferenceGroup)||void 0===e?void 0:e.children)||[],s=(null==t?void 0:t.attr("d"))||[],o=(null==i?void 0:i.attr("d"))||[],[,n=0,r=0]=s[0]||[],[,l=0,a=0]=o[0]||[];return{start:{x:+n,y:+r},end:{x:+l,y:+a}}}getDisAllowResizeInfo(){var e;const t=this.getResizeInfo(),{resize:i}=this.spreadsheet.options.interaction,{width:s,height:o,resizedWidth:n=0,resizedHeight:r=0}=t,l=null===(e=null==i?void 0:i.disable)||void 0===e?void 0:e.call(i,t);return{displayWidth:l?s:n,displayHeight:l?o:r,isDisabled:l}}getResizeCellField(e){var t,i,s,o,n;const r=e.type===u.Vertical,l=r?!this.isEffectRowOf(g.ALL):!this.isEffectColOf(g.ALL);return this.spreadsheet.isTableMode()?r?(null===(t=null==e?void 0:e.meta)||void 0===t?void 0:t.rowId)||String(null===(i=null==e?void 0:e.meta)||void 0===i?void 0:i.rowIndex):null===(s=null==e?void 0:e.meta)||void 0===s?void 0:s.field:l?null===(o=null==e?void 0:e.meta)||void 0===o?void 0:o.id:null===(n=null==e?void 0:e.meta)||void 0===n?void 0:n.field}isEffectRowOf(e){var t,i;return(null===(i=null===(t=this.spreadsheet.options.interaction)||void 0===t?void 0:t.resize)||void 0===i?void 0:i.rowResizeType)===e}isEffectColOf(e){var t,i;return(null===(i=null===(t=this.spreadsheet.options.interaction)||void 0===t?void 0:t.resize)||void 0===i?void 0:i.colResizeType)===e}getCellStyleByField(e){const{interaction:t}=this.spreadsheet,i=this.getResizeInfo(),s=i.type===u.Vertical?t.getActiveRowCells():t.getActiveColCells(),o=t.isSelectedState()&&s.length>1;return(this.isEffectRowOf(g.SELECTED)||this.isEffectColOf(g.SELECTED))&&o?s.reduce((t,s)=>(Ns.getAllLeaveNodes(s.getMeta()).forEach(s=>{const o=Object.assign(Object.assign({},i),{meta:s});t[this.getResizeCellField(o)]=e}),t),{}):{[this.getResizeCellField(i)]:e}}getResizeWidthDetail(){const e=this.getResizeInfo(),{displayWidth:t}=this.getDisAllowResizeInfo();switch(e.effect){case p.Field:return{eventType:m.LAYOUT_RESIZE_ROW_WIDTH,style:{rowCell:{widthByField:{[e.meta.field]:t}}}};case p.Tree:return{eventType:m.LAYOUT_RESIZE_TREE_WIDTH,style:{rowCell:{treeWidth:t}}};case p.Cell:return{eventType:m.LAYOUT_RESIZE_COL_WIDTH,style:{colCell:{width:this.isEffectColOf(g.ALL)?t:void 0,widthByField:this.getCellStyleByField(t)}}};case p.Series:return{eventType:m.LAYOUT_RESIZE_SERIES_WIDTH,seriesNumberWidth:t};default:return null}}getResizeHeightDetail(){const{style:e}=this.spreadsheet.options,t=this.getResizeInfo(),{displayHeight:i}=this.getDisAllowResizeInfo();switch(t.effect){case p.Field:return{eventType:m.LAYOUT_RESIZE_COL_HEIGHT,style:{colCell:this.getResizedCellStyleByField(this.getColCellHeightByField(t,i),null==e?void 0:e.colCell,i)}};case p.Cell:return{eventType:m.LAYOUT_RESIZE_ROW_HEIGHT,style:{rowCell:Object.assign(Object.assign({},this.getResizedCellStyleByField(this.getCellStyleByField(i),null==e?void 0:e.rowCell,i)),{height:this.isEffectRowOf(g.ALL)?i:void 0})}};default:return null}}getResizedCellStyleByField(e,t,i){if(!((null==t?void 0:t.maxLines)>1&&(null==t?void 0:t.wordWrap)))return{heightByField:e};const{cell:s}=this.getResizeInfo(),o=s.getMaxLinesByCustomHeight({targetCell:s,displayHeight:i,isCustomHeight:!0});return{heightByField:e,maxLinesByField:Object.keys(e||{}).reduce((e,t)=>(e[t]=o,e),{})}}getColCellHeightByField(e,t){return this.spreadsheet.isCustomColumnFields()||this.spreadsheet.isTableMode()?this.spreadsheet.facet.getColNodes().filter(t=>{var i,s;return t.level===(null===(i=e.meta)||void 0===i?void 0:i.level)&&t.height===(null===(s=e.meta)||void 0===s?void 0:s.height)}).reduce((e,i)=>(e[i.field]=t,e),{}):{[e.meta.field]:t}}getResizeDetail(){return this.getResizeInfo().type===u.Horizontal?this.getResizeWidthDetail():this.getResizeHeightDetail()}showResizeGroup(){var e;this.initResizeGroup(),null===(e=this.resizeReferenceGroup)||void 0===e||e.setAttribute("visibility","visible")}hideResizeGroup(){var e;null===(e=this.resizeReferenceGroup)||void 0===e||e.setAttribute("visibility","hidden")}bindMouseUp(){this.spreadsheet.on(m.GLOBAL_MOUSE_UP,()=>{var e;this.cursorType="default",this.setResizeMaskCursor(this.cursorType),this.resizeReferenceGroup&&!(0,a.isEmpty)(null===(e=this.resizeReferenceGroup)||void 0===e?void 0:e.children)&&(this.hideResizeGroup(),this.renderResizedResult())})}resizeMouseMove(e){var t,i;if("visible"!==(null===(t=this.resizeReferenceGroup)||void 0===t?void 0:t.parsedStyle.visibility))return;const s=this.getResizeInfo(),o=(null===(i=this.resizeReferenceGroup)||void 0===i?void 0:i.children)||[];if((0,a.isEmpty)(o))return;const[,n]=o,[r,l]=(0,a.clone)(n.attr("d"));s.type===u.Horizontal?this.updateHorizontalResizingEndGuideLinePosition(e.offsetX,s,{start:r,end:l}):this.updateVerticalResizingEndGuideLinePosition(e.offsetY,s,{start:r,end:l}),this.updateResizeGuideLineTheme(n),n.attr("d",[r,l])}updateResizeGuideLineTheme(e){const{guideLineColor:t,guideLineDisableColor:i}=this.getResizeAreaTheme(),{isDisabled:s}=this.getDisAllowResizeInfo();e.attr("stroke",s?i:t),this.setResizeMaskCursor(s?"no-drop":this.cursorType)}updateHorizontalResizingEndGuideLinePosition(e,t,i){var s,o;const{minCellWidth:n=40}=(null===(s=this.spreadsheet.options.interaction)||void 0===s?void 0:s.resize)||{};let r=e-this.resizeStartPosition.offsetX;t.width+r<n&&(r=-(t.width-n));const l=t.offsetX+t.width+r,a=t.size/2;i.start[1]=l-a,i.end[1]=l-a,null===(o=this.resizeTarget)||void 0===o||o.attr({x:l-t.size})}updateVerticalResizingEndGuideLinePosition(e,t,i){var s,o;const{minCellHeight:n=20}=(null===(s=this.spreadsheet.options.interaction)||void 0===s?void 0:s.resize)||{};let r=e-this.resizeStartPosition.offsetY;t.height+r<n&&(r=-(t.height-n));const l=t.offsetY+t.height+r,a=t.size/2;i.start[2]=l-a,i.end[2]=l-a,null===(o=this.resizeTarget)||void 0===o||o.attr({y:l-t.size})}renderResizedResult(){return(0,A.sH)(this,void 0,void 0,function*(){const e=this.getResizeInfo(),{style:t,seriesNumberWidth:i,eventType:s}=this.getResizeDetail()||{},o={info:e,style:t};this.spreadsheet.emit(m.LAYOUT_RESIZE,o),this.spreadsheet.emit(s,o),t&&this.spreadsheet.setOptions({style:t}),i&&this.spreadsheet.setTheme({rowCell:{seriesNumberWidth:i}}),this.spreadsheet.store.set("resized",!0),yield this.render()})}getResizeInfo(){const e=this.getCellAppendInfo(this.resizeTarget),{start:t,end:i}=this.getResizeGuideLinePosition(),s=y(i.x-t.x+(e.type===u.Horizontal?e.size:0)),o=y(i.y-t.y+(e.type===u.Vertical?e.size:0));return Object.assign(Object.assign({},e),{resizedWidth:s,resizedHeight:o})}render(){return(0,A.sH)(this,void 0,void 0,function*(){this.resizeStartPosition={},this.resizeTarget=null,this.resizeReferenceGroup=null,yield this.spreadsheet.render(!1)})}}const Rn=[d.B4.ARROW_LEFT,d.B4.ARROW_RIGHT,d.B4.ARROW_UP,d.B4.ARROW_DOWN];class In extends an{constructor(e){super(e)}isCanvasEffect(){return this.spreadsheet.interaction.eventController.isCanvasEffect}bindEvents(){this.spreadsheet.on(m.GLOBAL_KEYBOARD_DOWN,e=>{if(!this.isCanvasEffect())return;const t=e.shiftKey,i=e.metaKey;let s=!1,o=!1,n=!1;Rn.includes(e.key)&&(i&&t?(s=!1,o=!0,n=!1):i?(s=!0,o=!0,n=!0):t?(s=!1,o=!1,n=!1):(s=!0,o=!1,n=!0),this.handleMove({event:e,changeStartCell:s,isJumpMode:o,isSingleSelection:n}))}),this.spreadsheet.on(m.DATA_CELL_CLICK,e=>{const t=this.spreadsheet.getCell(e.target),i=null==t?void 0:t.getMeta();i&&(this.startCell=this.getCellMetaByViewMeta(i),this.endCell=this.startCell)})}getCellMetaByViewMeta(e){return{rowIndex:e.rowIndex,colIndex:e.colIndex,id:e.id,type:d.vZ.DATA_CELL}}handleMove({event:e,changeStartCell:t,isJumpMode:i,isSingleSelection:s}){const{spreadsheet:o,startCell:n,endCell:r}=this,l=this.getMoveInfo(e.key,t?n:r,i);if(!l)return;const[a,c]=[l.row,l.col];this.scrollToActiveCell(o,a,c);const h=this.generateCellMeta(o,a,c),u=s?[h]:this.getRangeCells(o,n,h);t&&(this.startCell=h),this.endCell=h,o.interaction.changeState({stateName:d.xT.SELECTED,cells:u}),o.interaction.emitSelectEvent({event:e,interactionName:d.oB.SELECTED_CELL_MOVE}),this.spreadsheet.emit(m.DATA_CELL_SELECT_MOVE,u)}generateCellMeta(e,t,i){const{isTableMode:s,facet:o}=e,n=o.getRowLeafNodes(),r=o.getColLeafNodes(),l=s()?String(t):n[t].id;return{rowIndex:t,colIndex:i,id:xe(l,r[i].id),type:d.vZ.DATA_CELL}}getRangeCells(e,t,i){const{start:{rowIndex:s,colIndex:o},end:{rowIndex:n,colIndex:r}}=Uo(t,i),l=[];for(let t=s;t<=n;t++)for(let i=o;i<=r;i++)l.push(this.generateCellMeta(e,t,i));return l}getMoveInfo(e,t,i){const{spreadsheet:s}=this,{rowCount:o,trailingRowCount:n,colCount:r,trailingColCount:l}=s.facet.getFrozenOptions(),{start:a,end:c}=s.facet.getCellRange(),h=s.facet.getColLeafNodes(),[u,p]=[0+r,h.length-l-1],[g,m]=[a+o,c-n];if(t)switch(e){case d.B4.ARROW_RIGHT:if(t.colIndex+1>p)return;return{row:t.rowIndex,col:i?p:t.colIndex+1};case d.B4.ARROW_LEFT:if(t.colIndex-1<u)return;return{row:t.rowIndex,col:i?u:t.colIndex-1};case d.B4.ARROW_UP:if(t.rowIndex-1<g)return;return{row:i?g:t.rowIndex-1,col:t.colIndex};case d.B4.ARROW_DOWN:if(t.rowIndex+1>m)return;return{row:i?m:t.rowIndex+1,col:t.colIndex}}}calculateOffset(e,t,i){const o=e.facet,{rowCount:n}=o.getFrozenOptions(),r=o.getColLeafNodes(),{viewportHeight:l,viewportWidth:a}=o.panelBBox,d=o.frozenGroupAreas,c=d[s.Col].width,h=d[s.TrailingCol].width,u=d[s.TrailingRow].height,p=o.panelScrollGroupIndexes,g=r.find(e=>e.colIndex===i);let m=null,v=null;if(i<=p[0]?m=(null==g?void 0:g.x)-c:i>=p[1]&&(m=(null==g?void 0:g.x)+(null==g?void 0:g.width)-a+h),t<=p[2])v=o.viewCellHeights.getCellOffsetY(t-n);else if(t>=p[3]){v=o.viewCellHeights.getCellOffsetY(t+1)-l+u}return{offsetX:m,offsetY:v}}scrollToActiveCell(e,t,i){const{offsetX:s,offsetY:o}=this.calculateOffset(e,t,i),{facet:n}=e,{scrollX:r,scrollY:l}=e.facet.getScrollOffset();n.scrollWithAnimation({offsetX:{value:null!=s?s:r},offsetY:{value:null!=o?o:l}})}}class Nn{constructor(e){this.interactions=new Map,this.intercepts=new Set,this.hoverTimer=null,this.drawRafId=null,this.defaultState={cells:[],force:!1},this.onTriggerInteractionsResetEffect=()=>{this.interactions.forEach(e=>{e.reset()})},this.shouldForbidHeaderCellSelected=e=>(0,a.unionBy)(e,"type").length>1,this.highlightNodes=(e=[],t=d.xT.HOVER)=>{e.forEach(e=>{var i;null===(i=null==e?void 0:e.belongsCell)||void 0===i||i.updateByState(t,e.belongsCell)})},this.mergeCells=(e,t)=>{ws(this.spreadsheet,e,t)},this.unmergeCell=e=>{xs(this.spreadsheet,e)},this.spreadsheet=e,this.registerEventController(),this.registerInteractions(),(0,ge.fU)()||window.addEventListener("visibilitychange",this.onTriggerInteractionsResetEffect)}destroy(){this.interactions.clear(),this.intercepts.clear(),this.eventController.clear(),this.clearHoverTimer(),this.resetState(),(0,ge.fU)()||window.removeEventListener("visibilitychange",this.onTriggerInteractionsResetEffect)}reset(){this.clearState(),this.clearHoverTimer(),this.intercepts.clear(),this.spreadsheet.hideTooltip()}setState(e){((e,t)=>{e.interaction.isEqualStateName(null==t?void 0:t.stateName)||(Zo(e),e.hideTooltip(),e.store.set(d.sK,t))})(this.spreadsheet,e)}getState(){return this.spreadsheet.store.get(d.sK)||this.defaultState}setInteractedCells(e){const t=this.getInteractedCells().concat([e]),i=this.getState();i.interactedCells=t,this.setState(i)}getInteractedCells(){const e=this.getState();return(null==e?void 0:e.interactedCells)||[]}resetState(){this.spreadsheet.store.set(d.sK,this.defaultState)}getCurrentStateName(){return this.getState().stateName}isEqualStateName(e){return this.getCurrentStateName()===e}isStateOf(e){const t=this.getState();return(null==t?void 0:t.stateName)===e}isSelectedState(){return this.isBrushSelectedState()||[d.xT.SELECTED,d.xT.ALL_SELECTED].some(e=>this.isStateOf(e))}isBrushSelectedState(){return[d.xT.ROW_CELL_BRUSH_SELECTED,d.xT.COL_CELL_BRUSH_SELECTED,d.xT.DATA_CELL_BRUSH_SELECTED].some(e=>this.isStateOf(e))}isAllSelectedState(){return this.isStateOf(d.xT.ALL_SELECTED)}isHoverFocusState(){return this.isStateOf(d.xT.HOVER_FOCUS)}isHoverState(){return this.isStateOf(d.xT.HOVER)}isActiveCell(e){return!!this.getCells().find(t=>e.getMeta().id===t.id&&e.cellType===t.type)}isSelectedCell(e){return this.isSelectedState()&&this.isActiveCell(e)}getCells(e){const t=this.getState(),i=(null==t?void 0:t.cells)||[];return(0,a.isNil)(e)?i:i.filter(t=>e.includes(t.type))}getActiveCells(){var e;const t=this.getCells().map(e=>e.id),i=null===(e=this.spreadsheet.facet)||void 0===e?void 0:e.getCells();return(0,a.map)(t,e=>(0,a.find)(i,t=>{var i;return(null===(i=null==t?void 0:t.getMeta())||void 0===i?void 0:i.id)===e})).filter(Boolean)}getActiveDataCells(){return this.getActiveCells().filter(e=>e.cellType===d.vZ.DATA_CELL)}getActiveRowCells(){return this.getActiveCells().filter(e=>e.cellType===d.vZ.ROW_CELL)}getActiveColCells(){return this.getActiveCells().filter(e=>e.cellType===d.vZ.COL_CELL)}clearStyleIndependent(){(this.isSelectedState()||this.isHoverState()||this.isAllSelectedState())&&this.spreadsheet.facet.getDataCells().forEach(e=>{e.hideInteractionShape()})}getUnSelectedDataCells(){return this.spreadsheet.facet.getDataCells().filter(e=>!this.isActiveCell(e))}scrollToCellByMeta(e,t={animate:!0}){if(!e)return;const{skipScrollEvent:i,animate:s}=t,{facet:o}=this.spreadsheet;(o.hRowScrollBar||o.hScrollBar||o.vScrollBar)&&this.scrollTo({skipScrollEvent:i,rowHeaderOffsetX:{value:e.x,animate:s},offsetX:{value:e.x-(0,a.get)(o,"frozenGroupAreas.frozenCol.width",0),animate:s},offsetY:{value:e.y-(0,a.get)(o,"frozenGroupAreas.frozenRow.height",0),animate:s}})}scrollTo(e){const{facet:t}=this.spreadsheet,{scrollX:i,scrollY:s,rowHeaderScrollX:o}=t.getScrollOffset();t.updateScrollOffset(Po({skipScrollEvent:!1,offsetX:{value:i,animate:!1},offsetY:{value:s,animate:!1},rowHeaderOffsetX:{value:o,animate:!1}},e))}scrollToNode(e,t){this.scrollToCellByMeta(e,t)}scrollToCell(e,t){this.scrollToCellByMeta(e.getMeta(),t)}scrollToCellById(e,t){if(!e)return;const i=[...this.spreadsheet.facet.getHeaderNodes(),...this.spreadsheet.facet.getDataCells().map(e=>e.getMeta())].find(t=>t.id===e);i&&this.scrollToCellByMeta(i,t)}scrollToTop(e){this.scrollTo({skipScrollEvent:null==e?void 0:e.skipScrollEvent,offsetY:{value:0,animate:null==e?void 0:e.animate}})}scrollToRight(e){this.scrollTo({skipScrollEvent:null==e?void 0:e.skipScrollEvent,offsetX:{value:this.spreadsheet.facet.panelBBox.maxX,animate:null==e?void 0:e.animate}})}scrollToBottom(e){this.scrollTo({skipScrollEvent:null==e?void 0:e.skipScrollEvent,offsetY:{value:this.spreadsheet.facet.panelBBox.maxY,animate:null==e?void 0:e.animate}})}scrollToLeft(e){this.scrollTo({skipScrollEvent:null==e?void 0:e.skipScrollEvent,offsetX:{value:0,animate:null==e?void 0:e.animate}})}selectAll(){const e=this.spreadsheet.facet.getCells().map($o);this.changeState({cells:e,stateName:d.xT.ALL_SELECTED}),this.addIntercepts([d.fR.HOVER]),this.updateCells(this.spreadsheet.facet.getCells())}highlightCell(e,t){this.changeCell(Object.assign(Object.assign({},t),{cell:e,stateName:d.xT.HOVER}))}selectCell(e,t){this.changeCell(Object.assign(Object.assign({},t),{cell:e,stateName:d.xT.SELECTED}))}changeCell(e={}){var t,i;const{event:s,cell:o,stateName:n=d.xT.SELECTED,interactionName:r,scrollIntoView:l=!0,animate:c=!0,skipScrollEvent:h=!0}=e;if((0,a.isEmpty)(o))return;const u=null===(t=null==o?void 0:o.getMeta)||void 0===t?void 0:t.call(o);if(!u||(0,a.isNil)(null==u?void 0:u.x))return;this.addIntercepts([d.fR.HOVER]);const p=this.spreadsheet.isHierarchyTreeType(),g=(null==o?void 0:o.cellType)===d.vZ.COL_CELL,m=this.getState(),v=this.isSelectedCell(o),f=(null==e?void 0:e.isMultiSelection)&&this.isSelectedState();let C=v?[]:this.spreadsheet.facet.getCellChildrenNodes(o),y=v?[]:[$o(o)];if(f&&(y=(0,a.concat)((null==m?void 0:m.cells)||[],y),C=(0,a.concat)((null==m?void 0:m.nodes)||[],C),v&&(y=y.filter(({id:e})=>e!==u.id),C=C.filter(e=>!(null==e?void 0:e.id.includes(u.id))))),(0,a.isEmpty)(y))return this.reset(),void this.emitSelectEvent({event:s,targetCell:o,interactionName:r});if(this.shouldForbidHeaderCellSelected(y))return;const w=(0,a.isEmpty)(C)?[o.getMeta()]:C;this.changeState({cells:y,nodes:w,stateName:n});const x=Xo(y);return this.updateCells(this.spreadsheet.facet.getHeaderCells(x)),p&&!g||this.highlightNodes(C,n),l&&this.scrollToCell(o,{skipScrollEvent:h,animate:c}),null===(i=this.spreadsheet.facet.centerFrame)||void 0===i||i.toFront(),this.emitSelectEvent({event:s,targetCell:o,interactionName:r}),!0}hideColumns(){return(0,A.sH)(this,arguments,void 0,function*(e=[],t=!0){yield k(this.spreadsheet,e,t)})}getBrushSelectionInfo(e){var t,i,s;return(0,a.isBoolean)(e)?{dataCellBrushSelection:e,rowCellBrushSelection:e,colCellBrushSelection:e}:{dataCellBrushSelection:null!==(t=null==e?void 0:e.dataCell)&&void 0!==t&&t,rowCellBrushSelection:null!==(i=null==e?void 0:e.rowCell)&&void 0!==i&&i,colCellBrushSelection:null!==(s=null==e?void 0:e.colCell)&&void 0!==s&&s}}getDefaultInteractions(){const{resize:e,brushSelection:t,multiSelection:i,rangeSelection:s,selectedCellMove:o}=this.spreadsheet.options.interaction,{dataCellBrushSelection:n,rowCellBrushSelection:r,colCellBrushSelection:l}=this.getBrushSelectionInfo(t);return[{key:d.oB.CORNER_CELL_CLICK,interaction:vn},{key:d.oB.DATA_CELL_CLICK,interaction:dn},{key:d.oB.ROW_COLUMN_CLICK,interaction:cn},{key:d.oB.HEADER_CELL_LINK_CLICK,interaction:hn},{key:d.oB.MERGED_CELLS_CLICK,interaction:un},{key:d.oB.PREVIEW_CLICK,interaction:mn},{key:d.oB.HOVER,interaction:fn,enable:!me()},{key:d.oB.DATA_CELL_BRUSH_SELECTION,interaction:wn,enable:!me()&&n},{key:d.oB.ROW_CELL_BRUSH_SELECTION,interaction:xn,enable:!me()&&r},{key:d.oB.COL_CELL_BRUSH_SELECTION,interaction:yn,enable:!me()&&l},{key:d.oB.COL_ROW_RESIZE,interaction:On,enable:!me()&&e},{key:d.oB.DATA_CELL_MULTI_SELECTION,interaction:_n,enable:!me()&&i},{key:d.oB.RANGE_SELECTION,interaction:Tn,enable:!me()&&s},{key:d.oB.SELECTED_CELL_MOVE,interaction:In,enable:!me()&&o}]}registerInteractions(){const{customInteractions:e}=this.spreadsheet.options.interaction;this.interactions.clear();this.getDefaultInteractions().forEach(({key:e,interaction:t,enable:i})=>{!1!==i&&this.interactions.set(e,new t(this.spreadsheet))}),(0,a.isEmpty)(e)||(0,a.forEach)(e,e=>{const t=e.interaction;t&&this.interactions.set(e.key,new t(this.spreadsheet))})}registerEventController(){this.eventController=new Ln(this.spreadsheet)}draw(){null!==this.drawRafId&&cancelAnimationFrame(this.drawRafId),this.drawRafId=requestAnimationFrame(()=>{this.spreadsheet.container.render(),this.drawRafId=null})}clearState(){Zo(this.spreadsheet)&&this.draw()}changeState(e){const{interaction:t}=this.spreadsheet,{cells:i=[],force:s,stateName:o,onUpdateCells:n}=e;if((0,a.isEmpty)(i)&&o===d.xT.SELECTED)return void(s&&t.changeState({cells:[],stateName:d.xT.UNSELECTED}));this.getCurrentStateName()===d.xT.ALL_SELECTED&&this.clearStyleIndependent(),this.clearState(),this.setState(e);const r=()=>{this.updateAllDataCells()};n?n(this,r):r(),this.draw()}updateAllDataCells(){this.updateCells(this.spreadsheet.facet.getDataCells())}updateCells(e=[]){e.forEach(e=>{e.update()})}addIntercepts(e=[]){e.forEach(e=>{this.intercepts.add(e)})}hasIntercepts(e=[]){return e.some(e=>this.intercepts.has(e))}removeIntercepts(e=[]){e.forEach(e=>{this.intercepts.delete(e)})}clearHoverTimer(){clearTimeout(this.hoverTimer)}setHoverTimer(e){this.hoverTimer=e}getHoverTimer(){return this.hoverTimer}getSelectedCellHighlight(){var e;const{selectedCellHighlight:t}=this.spreadsheet.options.interaction;if((0,a.isBoolean)(t))return{rowHeader:t,colHeader:t,currentRow:t,currentCol:t};const{rowHeader:i=!1,colHeader:s=!1,currentRow:o=!1,currentCol:n=!1}=null!==(e=t)&&void 0!==e?e:{};return{rowHeader:i,colHeader:s,currentRow:o,currentCol:n}}getHoverAfterScroll(){return this.spreadsheet.options.interaction.hoverAfterScroll}getHoverHighlight(){const{hoverHighlight:e}=this.spreadsheet.options.interaction;if((0,a.isBoolean)(e))return{rowHeader:e,colHeader:e,currentRow:e,currentCol:e};const{rowHeader:t=!1,colHeader:i=!1,currentRow:s=!1,currentCol:o=!1}=null!=e?e:{};return{rowHeader:t,colHeader:i,currentRow:s,currentCol:o}}getBrushSelection(){const{brushSelection:e}=this.spreadsheet.options.interaction;if((0,a.isBoolean)(e))return{dataCell:e,rowCell:e,colCell:e};const{dataCell:t=!1,rowCell:i=!1,colCell:s=!1}=null!=e?e:{};return{dataCell:t,rowCell:i,colCell:s}}updateDataCellRelevantHeaderCells(e,t){this.updateDataCellRelevantColCells(e,t),this.updateDataCellRelevantRowCells(e,t)}updateDataCellRelevantRowCells(e,t){const{rowId:i}=t,{facet:s,interaction:o}=this.spreadsheet,n=e===d.xT.HOVER,{rowHeader:r}=n?o.getHoverHighlight():o.getSelectedCellHighlight();if(r&&i){const o=n?Wo(i,s.getRowCells(),this.spreadsheet.isHierarchyTreeType()):function(e,t){var i;const{facet:s,options:o}=t;if(t.isTableMode()){if(!(null===(i=o.seriesNumber)||void 0===i?void 0:i.enable))return[];const t=s.getColLeafNodes()[0].id,n=xe(String(e.rowIndex),t),r=[],l=s.getCellById(n);return l&&l instanceof Fi&&r.push(l),r}return Wo(e.rowId,s.getRowCells(),t.isHierarchyTreeType())}(t,this.spreadsheet),r=[...s.getSeriesNumberCells().filter(e=>o.find(t=>t.getMeta().y===e.getMeta().y)),...o];(0,a.forEach)(r,t=>{t.updateByState(e)})}}updateDataCellRelevantColCells(e,t){const{colId:i}=t,{facet:s,interaction:o}=this.spreadsheet,{colHeader:n}=e===d.xT.HOVER?o.getHoverHighlight():o.getSelectedCellHighlight();n&&i&&((e,t,i)=>{if(e){const s=Wo(e,t);(0,a.forEach)(s,e=>{e.updateByState(i)})}})(i,s.getColCells(),e)}emitSelectEvent(e){const{interaction:t}=this.spreadsheet,{cells:i}=e,s=(0,A.Tt)(e,["cells"]),o=i||t.getActiveCells(),n=(null==s?void 0:s.targetCell)||o[0],r=Object.assign(Object.assign({},s),{targetCell:n}),l=null==n?void 0:n.cellType,a={[d.vZ.CORNER_CELL]:m.CORNER_CELL_SELECTED,[d.vZ.ROW_CELL]:m.ROW_CELL_SELECTED,[d.vZ.COL_CELL]:m.COL_CELL_SELECTED,[d.vZ.DATA_CELL]:m.DATA_CELL_SELECTED}[l];a&&(this.spreadsheet.emit(a,o,r),this.spreadsheet.emit(m.GLOBAL_SELECTED,o,r))}}const Bn=12,An=(e,t)=>{var i,s;const{basicColors:o,others:n}=e,r=null==t?void 0:t.isTableMode(),l=ve()?"bold":700;return{text:{fontFamily:Di,fontSize:Bn,fontWeight:l,fill:o[0],opacity:1,textAlign:r?"center":"left",textBaseline:"middle"},bolderText:{fontFamily:Di,fontSize:Bn,fontWeight:l,fill:o[0],opacity:1,textAlign:r?"center":"right",textBaseline:"middle"},measureText:{fontFamily:Di,fontSize:Bn,fontWeight:l,fill:o[0],opacity:1,textAlign:"left",textBaseline:"middle"},cell:{backgroundColor:o[3],backgroundColorOpacity:1,horizontalBorderColor:o[10],horizontalBorderColorOpacity:1,verticalBorderColor:o[10],verticalBorderColorOpacity:1,horizontalBorderWidth:1,verticalBorderWidth:1,borderDash:[],padding:{top:8,right:8,bottom:8,left:8},interactionState:{hover:{backgroundColor:o[4],backgroundOpacity:.6},selected:{backgroundColor:o[4],backgroundOpacity:.6},unselected:{backgroundOpacity:.3,textOpacity:.3,opacity:.3},prepareSelect:{borderColor:o[14],borderOpacity:1,borderWidth:1},searchResult:{backgroundColor:null!==(i=null==n?void 0:n.results)&&void 0!==i?i:o[2],backgroundOpacity:1},highlight:{backgroundColor:null!==(s=null==n?void 0:n.highlight)&&void 0!==s?s:o[6],backgroundOpacity:1}}},icon:{fill:o[0],size:10,margin:{right:4,left:4}}}},Mn=(e,t)=>{var i,s;const{basicColors:o,others:n}=e,r=null==t?void 0:t.isTableMode(),l=ve()?"bold":700;return{seriesText:{fontFamily:Di,fontSize:Bn,fontWeight:"normal",fill:o[14],linkTextFill:o[6],opacity:1,textBaseline:"middle",textAlign:"center"},measureText:{fontFamily:Di,fontSize:Bn,fontWeight:"normal",fill:o[14],linkTextFill:o[6],opacity:1,textAlign:r?"center":"left",textBaseline:"middle"},bolderText:{fontFamily:Di,fontSize:Bn,fontWeight:l,fill:o[14],linkTextFill:o[6],opacity:1,textAlign:r?"center":"left",textBaseline:"middle"},text:{fontFamily:Di,fontSize:Bn,fontWeight:"normal",fill:o[14],linkTextFill:o[6],opacity:1,textBaseline:"middle",textAlign:r?"center":"left"},cell:{backgroundColor:o[1],backgroundColorOpacity:1,horizontalBorderColor:o[9],horizontalBorderColorOpacity:1,verticalBorderColor:o[9],verticalBorderColorOpacity:1,horizontalBorderWidth:1,verticalBorderWidth:1,borderDash:[],padding:{top:8,right:8,bottom:8,left:8},interactionState:{hover:{backgroundColor:o[2],backgroundOpacity:.6},selected:{backgroundColor:o[2],backgroundOpacity:.6},unselected:{backgroundOpacity:.3,textOpacity:.3,opacity:.3},prepareSelect:{borderColor:o[14],borderOpacity:1,borderWidth:1},searchResult:{backgroundColor:null!==(i=null==n?void 0:n.results)&&void 0!==i?i:o[2],backgroundOpacity:1},highlight:{backgroundColor:null!==(s=null==n?void 0:n.highlight)&&void 0!==s?s:o[6],backgroundOpacity:1}}},icon:{fill:o[14],size:10,margin:{right:4,left:4}},seriesNumberWidth:80}},Dn=e=>{var t,i;const{basicColors:s,others:o}=e,n=ve()?"bold":700;return{measureText:{fontFamily:Di,fontSize:Bn,fontWeight:"normal",fill:s[0],opacity:1,textAlign:"right",textBaseline:"middle",linkTextFill:s[6]},bolderText:{fontFamily:Di,fontSize:Bn,fontWeight:n,fill:s[0],opacity:1,textAlign:"center",textBaseline:"middle",linkTextFill:s[6]},text:{fontFamily:Di,fontSize:Bn,fontWeight:"normal",fill:s[0],opacity:1,textAlign:"center",textBaseline:"middle",linkTextFill:s[6]},cell:{backgroundColor:s[3],backgroundColorOpacity:1,horizontalBorderColor:s[10],horizontalBorderColorOpacity:1,verticalBorderColor:s[10],verticalBorderColorOpacity:1,horizontalBorderWidth:1,verticalBorderWidth:1,borderDash:[],padding:{top:8,right:8,bottom:8,left:8},interactionState:{hover:{backgroundColor:s[4],backgroundOpacity:.6},selected:{backgroundColor:s[4],backgroundOpacity:.6},unselected:{backgroundOpacity:.3,textOpacity:.3,opacity:.3},prepareSelect:{borderColor:s[14],borderOpacity:1,borderWidth:1},searchResult:{backgroundColor:null!==(t=null==o?void 0:o.results)&&void 0!==t?t:s[2],backgroundOpacity:1},highlight:{backgroundColor:null!==(i=null==o?void 0:o.highlight)&&void 0!==i?i:s[6],backgroundOpacity:1}}},icon:{fill:s[0],size:10,margin:{top:6,right:4,bottom:6,left:4}}}},Hn=e=>{var t,i;const{basicColors:s,others:o,semanticColors:n}=e,r=ve()?"bold":700;return{bolderText:{fontFamily:Di,fontSize:Bn,fontWeight:r,fill:s[13],opacity:1,textAlign:"right",textBaseline:"middle",linkTextFill:s[6]},text:{fontFamily:Di,fontSize:Bn,fontWeight:"normal",fill:s[13],opacity:1,textAlign:"right",textBaseline:"middle",linkTextFill:s[6]},cell:{crossBackgroundColor:s[1],backgroundColor:s[8],backgroundColorOpacity:1,horizontalBorderColor:s[9],horizontalBorderColorOpacity:1,verticalBorderColor:s[9],verticalBorderColorOpacity:1,horizontalBorderWidth:1,verticalBorderWidth:1,padding:{top:8,right:8,bottom:8,left:8},interactionState:{hover:{backgroundColor:s[2],backgroundOpacity:.6},hoverFocus:{backgroundColor:s[2],backgroundOpacity:.6,borderColor:s[14],borderWidth:1,borderOpacity:1},selected:{backgroundColor:s[2],backgroundOpacity:.6},unselected:{backgroundOpacity:.3,textOpacity:.3,opacity:.3},searchResult:{backgroundColor:null!==(t=null==o?void 0:o.results)&&void 0!==t?t:s[2],backgroundOpacity:1},highlight:{backgroundColor:null!==(i=null==o?void 0:o.highlight)&&void 0!==i?i:s[6],backgroundOpacity:1},prepareSelect:{borderColor:s[14],borderOpacity:1,borderWidth:1}}},miniChart:{line:{point:{size:2.2,fill:s[6],opacity:1},linkLine:{size:1.5,fill:s[6],opacity:.6}},bar:{intervalPadding:4,fill:s[6],opacity:1},bullet:{progressBar:{widthPercent:.6,height:10,innerHeight:6},comparativeMeasure:{width:1,height:12,fill:s[13],opacity:.25},rangeColors:{good:null==n?void 0:n.green,satisfactory:n.yellow,bad:n.red},backgroundColor:"#E9E9E9"},interval:{height:12,fill:s[7]}},icon:{fill:s[13],size:10,margin:{right:4,left:4}}}};class kn{constructor(e){this.viewport=(0,ge.fU)()?void 0:window,this.init=()=>{(0,ge.fU)()||(this.initDevicePixelRatioListener(),this.initDeviceZoomListener())},this.destroy=()=>{(0,ge.fU)()||(this.removeDevicePixelRatioListener(),this.removeDeviceZoomListener())},this.removeDevicePixelRatioListener=()=>{var e;(null===(e=this.devicePixelRatioMedia)||void 0===e?void 0:e.removeEventListener)?this.devicePixelRatioMedia.removeEventListener("change",this.renderByDevicePixelRatioChanged):this.devicePixelRatioMedia.removeListener(this.renderByDevicePixelRatioChanged)},this.initDeviceZoomListener=()=>{var e,t;me()||null===(t=null===(e=this.viewport)||void 0===e?void 0:e.visualViewport)||void 0===t||t.addEventListener("resize",this.renderByZoomScaleWithoutResizeEffect)},this.removeDeviceZoomListener=()=>{var e,t;me()||null===(t=null===(e=this.viewport)||void 0===e?void 0:e.visualViewport)||void 0===t||t.removeEventListener("resize",this.renderByZoomScaleWithoutResizeEffect)},this.renderByZoomScaleWithoutResizeEffect=e=>(0,A.sH)(this,void 0,void 0,function*(){this.isDevicePixelRatioChange=!1,yield this.renderByZoomScale(e)}),this.renderByDevicePixelRatioChanged=()=>(0,A.sH)(this,void 0,void 0,function*(){this.isDevicePixelRatioChange=!0,yield this.renderByDevicePixelRatio()}),this.renderByDevicePixelRatio=(...e)=>(0,A.sH)(this,[...e],void 0,function*(e=window.devicePixelRatio){var t;if(this.spreadsheet.destroyed)return;const{container:i,options:{width:s,height:o}}=this.spreadsheet,n=this.spreadsheet.getCanvasElement(),r=Math.ceil(e);(null!==(t=i.getConfig().devicePixelRatio)&&void 0!==t?t:1)!==r&&n&&(i.getConfig().devicePixelRatio=r,i.resize(s,o),yield this.spreadsheet.render(!1))}),this.renderByZoomScale=(0,a.debounce)(e=>(0,A.sH)(this,void 0,void 0,function*(){if(this.spreadsheet.destroyed)return;const t=e.target,i=Math.ceil(null==t?void 0:t.scale);if(i>=1&&(this.zoomOffsetLeft||0)!==((null==t?void 0:t.offsetLeft)||0)&&!this.isDevicePixelRatioChange){const e=Math.max(i,window.devicePixelRatio);yield this.renderByDevicePixelRatio(e),this.zoomOffsetLeft=t.offsetLeft}}),350),this.spreadsheet=e,this.isDevicePixelRatioChange=!1,this.zoomOffsetLeft=0}initDevicePixelRatioListener(){var e;this.devicePixelRatioMedia=window.matchMedia(`(resolution: ${window.devicePixelRatio}dppx)`),(null===(e=this.devicePixelRatioMedia)||void 0===e?void 0:e.addEventListener)?this.devicePixelRatioMedia.addEventListener("change",this.renderByDevicePixelRatioChanged):this.devicePixelRatioMedia.addListener(this.renderByDevicePixelRatioChanged)}}var zn;!function(e){e.UN_STICKY="UN_STICKY",e.STICKY="STICKY",e.STICKY_EDGE="STICKY_EDGE"}(zn||(zn={}));class Fn{constructor(e){this.stickyS2=null,this.wrapperElement=null,this.stickyContainer=null,this.stickyState=zn.UN_STICKY,this.disposers=[],this.scrollContainer=window,this.isSyncing=!1,this.syncStyle=()=>{if(!this.wrapperElement)return;const e=this.getTableBox();if(!e)return;const{headerHeight:t,tableBottom:i,tableHeight:s,tableLeft:o,tableWidth:n,tableTop:r}=e,l=this.getOffsetTop(),a=this.isWindowScroll()?l:this.scrollContainer.getBoundingClientRect().top+l,{style:d}=this.wrapperElement;return a<r||a>r+s?(this.stickyState=zn.UN_STICKY,void(d.display="none")):(d.display="",d.height=`${t}px`,r<a&&a<i-t?(this.stickyState=zn.STICKY,void(this.isWindowScroll()?(d.position="fixed",d.top=`${a}px`,d.left=`${o}px`,d.width=`${n}px`,d.right=""):(d.position="absolute",d.top=a-r+"px",d.left="0",d.right="0",d.width=""))):void(i-t<=a&&a<=i&&(this.stickyState=zn.STICKY_EDGE,d.position="absolute",d.top=s-t+"px",d.left="0",d.right="0",d.width="")))},this.spreadsheet=e,this.options=this.resolveOptions(),this.scrollContainer=this.resolveScrollContainer(),this.init()}getStickyState(){return this.stickyState}resolveOptions(){var e;const t=null===(e=this.spreadsheet.options.interaction)||void 0===e?void 0:e.stickyHeader;return!t||(0,a.isBoolean)(t)?{}:t}init(){this.createDOM(),this.createStickyS2(),this.bindScrollListener(),this.bindSyncListeners(),this.bindInteractionBridge(),this.renderStickyS2()}createDOM(){const e=this.spreadsheet.getCanvasElement();if(!e)return;const t=e.parentElement;"static"===window.getComputedStyle(t).position&&(t.style.position="relative"),this.wrapperElement=document.createElement("div"),this.wrapperElement.className="s2-sticky-header-wrapper",Object.assign(this.wrapperElement.style,{position:"absolute",top:"0",left:"0",right:"0",zIndex:"10",overflow:"hidden",display:"none"}),this.stickyContainer=document.createElement("div"),this.wrapperElement.appendChild(this.stickyContainer),t.insertBefore(this.wrapperElement,e)}minimizeDataCfg(e){var t;const i=null===(t=null==e?void 0:e.fields)||void 0===t?void 0:t.columns;if(!i)return e;const s={};return e.data.forEach(e=>{const t=i.map(t=>{const i=(0,a.isString)(t)?t:t.field;return String(e[i])}).join("\0");s[t]||(s[t]=e)}),Object.assign(Object.assign({},e),{data:Object.values(s)})}applyStickyOptions(e){var t;return Po(e,this.options.enableInteraction?{style:{dataCell:{height:0}},interaction:{resize:null===(t=e.interaction)||void 0===t?void 0:t.resize,stickyHeader:!1,brushSelection:!1,multiSelection:!1,rangeSelection:!1,selectedCellMove:!1},tooltip:{enable:!0,operation:{hiddenColumns:!1}}}:{style:{dataCell:{height:0}},interaction:{resize:!1,stickyHeader:!1},tooltip:{enable:!1},headerActionIcons:[],showDefaultHeaderActionIcon:!1})}toStickyConfig(){const{dataCfg:e,options:t}=this.spreadsheet;return{dataCfg:this.minimizeDataCfg(e),options:this.applyStickyOptions(t)}}createStickyS2(){if(!this.stickyContainer)return;const{dataCfg:e,options:t}=this.toStickyConfig();this.stickyS2=new(0,this.spreadsheet.constructor)(this.stickyContainer,e,t),this.syncTheme()}syncTheme(){this.stickyS2&&(this.stickyS2.setThemeCfg({name:this.spreadsheet.themeName}),this.stickyS2.theme=this.spreadsheet.theme)}renderStickyS2(){return(0,A.sH)(this,void 0,void 0,function*(){var e,t,i;if(!this.stickyS2)return;const{facet:s}=this.spreadsheet;if(!s)return;const o=this.spreadsheet.getCanvasConfig(),n=null!==(t=null===(e=s.cornerBBox)||void 0===e?void 0:e.height)&&void 0!==t?t:0,r=null!==(i=o.width)&&void 0!==i?i:0;this.stickyS2.changeSheetSize(r,n),yield this.stickyS2.render()})}getOffsetTop(){const{offsetTop:e}=this.options;return(0,a.isFunction)(e)?e():(0,a.isNumber)(e)?e:0}getScrollParent(e){if(!e)return window;let t=e.parentElement;for(;t&&t!==document.body&&t!==document.documentElement;){const e=window.getComputedStyle(t),i=e.getPropertyValue("overflow")+e.getPropertyValue("overflow-y")+e.getPropertyValue("overflow-x");if(/(?:auto|scroll|overlay)/.test(i)&&t.scrollHeight>t.clientHeight)return t;t=t.parentElement}return window}resolveScrollContainer(){if(this.options.scrollContainer)return this.options.scrollContainer;const e=this.spreadsheet.getCanvasElement();return this.getScrollParent(e)}isWindowScroll(){return this.scrollContainer===window}getTableBox(){var e,t;const i=this.spreadsheet.getCanvasElement();if(!i)return null;const s=i.getBoundingClientRect(),{facet:o}=this.spreadsheet;if(!o)return null;const n=s.top,r=s.left,l=s.width,a=null!==(t=null===(e=o.cornerBBox)||void 0===e?void 0:e.height)&&void 0!==t?t:0,d=s.height,c=o.getContentHeight(),h=Math.min(c,d);return{tableTop:n,tableLeft:r,tableWidth:l,tableHeight:h,tableBottom:n+h,headerHeight:a}}bindScrollListener(){const e=(0,a.throttle)(this.syncStyle,16);this.scrollContainer.addEventListener("scroll",e,{passive:!0}),this.disposers.push(()=>{this.scrollContainer.removeEventListener("scroll",e)})}bindSyncListeners(){const{spreadsheet:e}=this,t=e=>{var t;(null===(t=this.stickyS2)||void 0===t?void 0:t.facet)&&this.stickyS2.facet.updateScrollOffset({offsetX:{value:e.scrollX,animate:!1},offsetY:{value:e.scrollY,animate:!1},rowHeaderOffsetX:{value:e.rowHeaderScrollX,animate:!1}})};e.on(m.GLOBAL_SCROLL,t),this.disposers.push(()=>{e.off(m.GLOBAL_SCROLL,t)});const i=()=>{if(this.stickyS2&&!this.isSyncing){this.isSyncing=!0;try{const{dataCfg:t,options:i}=this.toStickyConfig();this.stickyS2.setDataCfg(t),this.stickyS2.setOptions(i),this.syncTheme();const s=e.getCanvasConfig();this.stickyS2.changeSheetSize(s.width,e.facet.cornerBBox.height),this.stickyS2.render(!1),this.syncStyle()}finally{this.isSyncing=!1}}},s=[m.LAYOUT_AFTER_RENDER,m.LAYOUT_RESIZE];s.forEach(t=>{e.on(t,i)}),this.disposers.push(()=>{s.forEach(t=>{e.off(t,i)})})}bindInteractionBridge(){if(!this.options.enableInteraction||!this.stickyS2)return;const{stickyS2:e,spreadsheet:t}=this;e.on(m.LAYOUT_RESIZE,e=>(0,A.sH)(this,void 0,void 0,function*(){e.style&&(t.setOptions({style:e.style}),yield t.render(!1)),t.emit(m.LAYOUT_RESIZE,e)})),e.on(m.RANGE_SORT,e=>(0,A.sH)(this,void 0,void 0,function*(){t.setDataCfg(Object.assign(Object.assign({},t.dataCfg),{sortParams:e})),yield t.render(),t.emit(m.RANGE_SORT,e)})),e.on(m.ROW_CELL_COLLAPSED,e=>{t.emit(m.ROW_CELL_COLLAPSED__PRIVATE,e),this.scrollToTableTop()}),e.on(m.ROW_CELL_ALL_COLLAPSED,e=>(0,A.sH)(this,void 0,void 0,function*(){t.setOptions({style:{rowCell:{collapseAll:e,collapseFields:null,expandDepth:null}}}),yield t.render(!1),t.emit(m.ROW_CELL_ALL_COLLAPSED,e),this.scrollToTableTop()}))}scrollToTableTop(){var e;const t=this.spreadsheet.getCanvasElement();null===(e=null==t?void 0:t.scrollIntoView)||void 0===e||e.call(t,{behavior:"smooth",block:"start"})}destroy(){this.disposers.forEach(e=>e()),this.disposers=[],this.stickyS2&&(this.stickyS2.destroy(),this.stickyS2=null),this.wrapperElement&&(this.wrapperElement.remove(),this.wrapperElement=null),this.stickyContainer=null,this.stickyState=zn.UN_STICKY}}var Pn=i("./node_modules/.pnpm/style-loader@3.3.4_webpack@5.108.4/node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"),jn=i.n(Pn),Wn=i("./node_modules/.pnpm/style-loader@3.3.4_webpack@5.108.4/node_modules/style-loader/dist/runtime/styleDomAPI.js"),Gn=i.n(Wn),Vn=i("./node_modules/.pnpm/style-loader@3.3.4_webpack@5.108.4/node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js"),$n=i.n(Vn),Un=i("./node_modules/.pnpm/style-loader@3.3.4_webpack@5.108.4/node_modules/style-loader/dist/runtime/insertStyleElement.js"),Yn=i.n(Un),Xn=i("./node_modules/.pnpm/style-loader@3.3.4_webpack@5.108.4/node_modules/style-loader/dist/runtime/styleTagTransform.js"),Zn=i.n(Xn),qn=i("./node_modules/.pnpm/css-loader@6.11.0_webpack@5.108.4/node_modules/css-loader/dist/cjs.js!./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/ui/tooltip/index.css"),Kn={};Kn.styleTagTransform=Zn(),Kn.setAttributes=$n(),Kn.insert=function(e){const t=document.querySelector("head"),i=window._lastElementInsertedByStyleLoader;i?i.nextSibling?t.insertBefore(e,i.nextSibling):t.appendChild(e):t.insertBefore(e,t.firstChild),window._lastElementInsertedByStyleLoader=e},Kn.domAPI=Gn(),Kn.insertStyleElement=Yn();jn()(qn.A,Kn);class Jn{constructor(e){this.visible=!1,this.position={x:0,y:0},this.spreadsheet=e}show(e){var t,i,s;const{position:o,content:n,event:r}=e,{autoAdjustBoundary:l,adjustPosition:a}=this.spreadsheet.options.tooltip||{};this.visible=!0,this.options=e;const d=this.getContainer();this.renderContent(n);const{x:c,y:h}=(({spreadsheet:e,position:t,tooltipContainer:i,autoAdjustBoundary:s})=>{const o=e.getCanvasElement();let n=t.x+Do,r=t.y+Ho;if(!s||!o)return{x:n,y:r};const l="body"===s,{maxX:a,maxY:d}=e.facet.panelBBox,{width:c,height:h}=e.options,{top:u,left:p}=o.getBoundingClientRect(),{width:g,height:m}=i.getBoundingClientRect(),{width:v,height:f}=document.body.getBoundingClientRect(),C=l?v:Math.min(c,a)+p,y=l?f:Math.min(h,d)+u;return n+g>=C&&(n=C-g),r+m>=y&&(r=y-m),{x:n,y:r}})({spreadsheet:this.spreadsheet,position:o,tooltipContainer:d,autoAdjustBoundary:l});this.position=null!==(t=null==a?void 0:a({position:{x:c,y:h},event:r}))&&void 0!==t?t:{x:c,y:h},Jo(d,{style:{left:`${null===(i=this.position)||void 0===i?void 0:i.x}px`,top:`${null===(s=this.position)||void 0===s?void 0:s.y}px`,pointerEvents:"all"},visible:!0,dark:"dark"===this.spreadsheet.getThemeName()})}hide(){this.visible=!1,this.container&&(Jo(this.container,{style:{pointerEvents:"none"},visible:!1}),this.resetPosition())}destroy(){var e,t;this.visible=!1,this.container&&(this.resetPosition(),null===(t=(e=this.container).remove)||void 0===t||t.call(e),this.container=null)}renderContent(e){var t,i,s,o;if(!this.container)return;this.clearContent();const{content:n}=this.spreadsheet.options.tooltip||{},r=null!=e?e:n;return(0,a.isNil)(r)?void 0:"string"==typeof r?(this.container.innerHTML=r,void(null===(i=(t=this.options).onMounted)||void 0===i||i.call(t))):void(r instanceof Element&&(this.container.appendChild(r),null===(o=(s=this.options).onMounted)||void 0===o||o.call(s)))}clearContent(){this.container&&(this.container.innerHTML="")}disablePointerEvent(){this.container&&"none"!==this.container.style.pointerEvents&&Jo(this.container,{style:{pointerEvents:"none"}})}resetPosition(){this.position={x:0,y:0}}getContainer(){var e;if(!this.container){const{tooltip:t}=this.spreadsheet.options,i=(null===(e=null==t?void 0:t.getContainer)||void 0===e?void 0:e.call(t))||document.body,s=document.createElement("div");return Jo(s,{style:null==t?void 0:t.style,className:[Bo].concat(null==t?void 0:t.className)}),i.appendChild(s),this.container=s,this.container}return this.container}}const Qn=`${Ai.u}-offscreen-canvas`;class er extends Xs.A{constructor(e,t,i){super(),this.store=new zo,this.stickyHeaderController=null,this.destroyed=!1,this.measureText=(0,a.memoize)((e,t)=>{if(!t)return null;const i=(()=>{if(!(0,ge.Wt)())return null;let e=document.getElementById(Qn);return e||(e=document.createElement("canvas"),e.id=Qn,e.style.display="none",document.body.appendChild(e),e)})()||this.getCanvasElement(),s=null==i?void 0:i.getContext("2d"),{fontSize:o,fontFamily:n,fontWeight:r,fontStyle:l,fontVariant:a}=t;return s.font=[l,a,r,`${o}px`,n].join(" ").trim(),s.measureText(String(e))},(e,t)=>[e,...(0,a.values)(t)].join("")),this.measureTextWidth=(e,t)=>{const i=this.measureText(e,t);return(null==i?void 0:i.width)||0},this.measureTextHeight=(e,t)=>{const i=this.measureText(e,t);return i?i.actualBoundingBoxAscent+i.actualBoundingBoxDescent:0},this.measureTextWidthRoughly=(e,t)=>{const i=this.measureTextWidth("a",t),s=this.measureTextWidth("蚂",t);let o=0;if(!e)return o;for(const t of String(e)){const e=t.charCodeAt(0);o+=e>=0&&e<=255?i:s}return o},this.setupDataConfig(t),this.setupOptions(i),this.dataSet=this.getDataSet(),this.setDebug(),this.initTooltip(),this.initContainer(e),this.bindEvents(),this.initInteraction(),this.initTheme(),this.initHdAdapter(),this.registerIcons(),this.setOverscrollBehavior(),this.mountSheetInstance(),this.initStickyHeader()}setupDataConfig(e){this.dataCfg=jo(e)}setupOptions(e){this.options=((...e)=>Po(Xi,...e))(e)}isCustomHeaderFields(e){const{fields:t}=this.dataCfg;return(0,a.some)(e?null==t?void 0:t[e]:[...null==t?void 0:t.rows,...null==t?void 0:t.columns],e=>!(0,a.isString)(e))}isCustomColumnFields(){return this.isCustomHeaderFields("columns")}setOverscrollBehavior(){if((0,ge.fU)()||!(0,ge.Wt)())return;const{overscrollBehavior:e}=this.options.interaction,t=window.getComputedStyle(document.body).getPropertyValue("overscroll-behavior");t&&"auto"!==t?this.store.set("initOverscrollBehavior",t):e&&(document.body.style.overscrollBehavior=e)}restoreOverscrollBehavior(){(0,ge.Wt)()&&(document.body.style.overscrollBehavior=this.store.get("initOverscrollBehavior")||"")}setDebug(){Zi.U.getInstance().setDebug(this.options.debug)}initTheme(){this.setThemeCfg({name:"default"})}getMountContainer(e){const t=(0,a.isString)(e)?document.querySelector(e):e;if(!t)throw new Error("Target mount container is not a DOM element");return t}initHdAdapter(){this.options.hd&&(this.hdAdapter=new kn(this),this.hdAdapter.init())}initStickyHeader(){var e;if(!(null===(e=this.options.interaction)||void 0===e?void 0:e.stickyHeader))return;const t=()=>{var e;this.off(m.LAYOUT_AFTER_RENDER,t),null===(e=this.stickyHeaderController)||void 0===e||e.destroy(),this.stickyHeaderController=new Fn(this)};this.on(m.LAYOUT_AFTER_RENDER,t)}initInteraction(){var e,t;null===(t=null===(e=this.interaction)||void 0===e?void 0:e.destroy)||void 0===t||t.call(e),this.interaction=new Nn(this)}initTooltip(){var e,t,i,s;null===(t=null===(e=this.tooltip)||void 0===e?void 0:e.destroy)||void 0===t||t.call(e),this.tooltip=this.renderTooltip(),this.tooltip instanceof Jn||console.warn(`[Custom Tooltip]: ${null===(s=null===(i=this.tooltip)||void 0===i?void 0:i.constructor)||void 0===s?void 0:s.toString()} should be extends from BaseTooltip`)}renderTooltip(){var e,t;return(null===(t=null===(e=this.options.tooltip)||void 0===e?void 0:e.render)||void 0===t?void 0:t.call(e,this))||new Jn(this)}getTargetCell(e){return this.getCell(e)||(0,a.last)(this.interaction.getInteractedCells())}showTooltip(e){const{content:t,event:i}=e,s=this.getTargetCell(null==i?void 0:i.target),o=(0,a.isFunction)(t)?t(s,e):t;return new Promise(t=>{var i,s;const n=Object.assign(Object.assign({},e),{content:o,onMounted:t});null===(s=null===(i=this.tooltip)||void 0===i?void 0:i.show)||void 0===s||s.call(i,n)})}showTooltipWithInfo(e,t,i){var s;const{enable:o,content:n}=ln(this,e);if(!o)return;const r=this.getTargetCell(null==e?void 0:e.target),l=null!==(s=null==i?void 0:i.data)&&void 0!==s?s:nn({spreadsheet:this,cellInfos:t,targetCell:r,options:Object.assign({enableFormat:!0},i)});return this.showTooltip({data:l,position:{x:e.clientX,y:e.clientY},options:i,event:e,content:n})}hideTooltip(){var e,t;null===(t=null===(e=this.tooltip)||void 0===e?void 0:e.hide)||void 0===t||t.call(e)}destroyTooltip(){var e,t;null===(t=null===(e=this.tooltip)||void 0===e?void 0:e.destroy)||void 0===t||t.call(e)}registerIcons(){const e=this.options.customSVGIcons;(0,a.isEmpty)(e)||(0,a.forEach)(e,e=>{(0,ko.p)(e.name,e.src)})}setDataCfg(e,t){this.store.set("originalDataCfg",e),this.dataCfg=t?jo(e):jo(this.dataCfg,e),this.store.set(G,V)}setOptions(e,t){var i;this.hideTooltip(),t?this.setupOptions(e):this.options=Po(this.options,e),(t||(null===(i=null==e?void 0:e.tooltip)||void 0===i?void 0:i.render))&&this.initTooltip(),this.resetHiddenColumnsDetailInfoIfNeeded(),this.registerIcons(),this.syncStickyHeader()}syncStickyHeader(){var e;const t=!!(null===(e=this.options.interaction)||void 0===e?void 0:e.stickyHeader);this.stickyHeaderController&&(this.stickyHeaderController.destroy(),this.stickyHeaderController=null),t&&this.initStickyHeader()}resetDataCfg(){this.setDataCfg(null,!0)}resetOptions(){this.setOptions(null,!0)}resetHiddenColumnsDetailInfoIfNeeded(){var e;(0,a.isEmpty)(null===(e=this.options.interaction)||void 0===e?void 0:e.hiddenColumnFields)||this.store.set("hiddenColumnsDetail",[])}doRender(e){return(0,A.sH)(this,void 0,void 0,function*(){const t=this.getCanvasElement();if(!t||!t.isConnected)return;const{reloadData:i=!0,rebuildDataSet:s=!1,rebuildHiddenColumnsDetail:o=!0}=e||{};this.emit(m.LAYOUT_BEFORE_RENDER),s&&(this.dataSet=this.getDataSet()),i&&(this.clearDrillDownData("",!0),this.dataSet.setDataCfg(this.dataCfg)),this.buildFacet(),o&&(yield this.initHiddenColumnsDetail()),this.emit(m.LAYOUT_AFTER_RENDER)})}render(e){return(0,A.sH)(this,void 0,void 0,function*(){if(this.destroyed)return;const t="boolean"==typeof e?{reloadData:e}:e;yield this.container.ready,yield this.doRender(t)})}mountSheetInstance(){const e=this.getCanvasElement();e&&(e.__s2_instance__=this)}unmountSheetInstance(){const e=this.getCanvasElement();e&&delete e.__s2_instance__}destroy(){var e,t,i,s,o,n;this.destroyed||(this.destroyed=!0,this.restoreOverscrollBehavior(),this.emit(m.LAYOUT_DESTROY),null===(e=this.stickyHeaderController)||void 0===e||e.destroy(),this.stickyHeaderController=null,null===(t=this.facet)||void 0===t||t.destroy(),null===(i=this.hdAdapter)||void 0===i||i.destroy(),null===(s=this.interaction)||void 0===s||s.destroy(),null===(o=this.store)||void 0===o||o.clear(),this.destroyTooltip(),this.clearCanvasEvent(),this.unmountSheetInstance(),null===(n=this.container)||void 0===n||n.destroy(),(()=>{var e;(0,ge.Wt)()&&(null===(e=document.getElementById(Qn))||void 0===e||e.remove())})())}setThemeName(e){this.themeName=e}setThemeCfg(e={},t){const i=(null==e?void 0:e.theme)||{},s=(e=>{var t;const i=(null==e?void 0:e.palette)||ki(null==e?void 0:e.name),{basicColors:s}=i,o=null==e?void 0:e.spreadsheet,n=null===(t=null==e?void 0:e.getCustomTheme)||void 0===t?void 0:t.call(e,i,o);return(0,a.merge)({cornerCell:An(i,o),rowCell:Mn(i,o),colCell:Dn(i),dataCell:Hn(i),mergedCell:Hn(i),resizeArea:{size:3,background:s[7],backgroundOpacity:0,guideLineColor:s[7],guideLineDisableColor:"rgba(0,0,0,0.25)",guideLineDash:[3,3],interactionState:{hover:{backgroundColor:s[7],backgroundOpacity:1}}},scrollBar:{trackColor:"rgba(0,0,0,0.01)",thumbHoverColor:"rgba(0,0,0,0.25)",thumbColor:"rgba(0,0,0,0.15)",thumbHorizontalMinSize:32,thumbVerticalMinSize:32,size:me()?3:6,hoverSize:me()?4:8,lineCap:"round"},splitLine:{horizontalBorderColor:s[12],horizontalBorderColorOpacity:.2,horizontalBorderWidth:2,verticalBorderColor:s[11],verticalBorderColorOpacity:.25,verticalBorderWidth:2,showShadow:!0,shadowWidth:8,shadowColors:{left:"rgba(0,0,0,0.1)",right:"rgba(0,0,0,0)"},borderDash:[]},prepareSelectMask:{backgroundColor:s[5],backgroundOpacity:.3},background:{color:s[8],opacity:1},empty:{icon:{fill:"",width:64,height:41,margin:{top:0,right:0,bottom:24,left:0}},description:{fontFamily:Di,fontSize:Bn,fontWeight:"normal",fill:s[14],opacity:1}}},n)})(Object.assign(Object.assign({},e),{spreadsheet:this,getCustomTheme:t}));this.theme=Po(s,i),this.setThemeName(null==e?void 0:e.name)}setTheme(e){this.theme=Po(this.theme,e)}getTheme(){return this.theme}getThemeName(){return this.themeName}updatePagination(e){this.options=Po(this.options,{pagination:e}),this.facet.resetScrollOffset()}changeSheetSize(e=this.options.width,t=this.options.height){const i=this.getCanvasElement(),{width:s,height:o}=this.container.getConfig();(e!==s||t!==o)&&i&&(this.options=Po(this.options,{width:e,height:t}),this.container.resize(e,t))}on(e,t){return super.on(e,t)}emit(e,...t){super.emit(e,...t)}getCanvas(){return this.container}getCanvasConfig(){return this.getCanvas().getConfig()}getCanvasElement(){return this.getCanvas().getContextService().getDomElement()}getLayoutWidthType(){var e;return null===(e=this.options.style)||void 0===e?void 0:e.layoutWidthType}isCellType(e){return e instanceof Ce}getCell(e){let t=e;for(;t&&!(t instanceof l.Hl);){if(this.isCellType(t))return t;t=null==t?void 0:t.parentNode}return null}getCellType(e){const t=this.getCell(e);return null==t?void 0:t.cellType}getTotalsConfig(e){const{totals:t}=this.options,{rows:i}=this.dataSet.fields,s=(0,a.get)(t,(0,a.includes)(i,e)?"row":"col",{}),o=!(!s.showSubTotals||!(0,a.includes)(s.subTotalsDimensions,e))&&s.showSubTotals;return Object.assign(Object.assign({grandTotalsLabel:(0,Gi.Ru)("总计"),subTotalsLabel:(0,Gi.Ru)("小计"),grandTotalsGroupDimensions:[],subTotalsGroupDimensions:[]},s),{showSubTotals:o})}initContainer(e){const{width:t,height:i,device:s,transformCanvasConfig:o,rendererConfig:n}=this.options,r=new Io.A4(n),a=null==o?void 0:o(r,this),d=!me(s);this.container=new l.Hl(Object.assign({container:this.getMountContainer(e),width:t,height:i,renderer:r,supportsPointerEvents:d,future:{experimentalRICSyncRTree:!0,experimentalCancelEventPropagation:!0}},a)),this.setupContainerStyle()}setupContainerStyle(){const e=this.getCanvasElement();e&&(e.style.display="block",e.style.userSelect="none")}initHiddenColumnsDetail(){return(0,A.sH)(this,void 0,void 0,function*(){const{hiddenColumnFields:e}=this.options.interaction,t=this.store.get("hiddenColumnsDetail");(0,a.isEmpty)(e)&&(0,a.isEmpty)(t)||(yield k(this,e,!0))})}clearCanvasEvent(){const e=this.getEvents();(0,a.forIn)(e,(e,t)=>{this.off(t)})}updateSortMethodMap(e,t,i=!1){const s=i?null:this.store.get("sortMethodMap");this.store.set("sortMethodMap",Object.assign(Object.assign({},s),{[e]:t}))}getMenuDefaultSelectedKeys(e){const t=this.store.get("sortMethodMap"),i=(0,a.get)(t,e);return i?[i]:[]}handleGroupSort(e,t){e.stopPropagation(),this.interaction.addIntercepts([d.fR.HOVER]);const i=this.getMenuDefaultSelectedKeys(null==t?void 0:t.id),s=this.isTableMode()?[{key:"asc",icon:"groupAsc",label:(0,Gi.Ru)("升序")},{key:"desc",icon:"groupDesc",label:(0,Gi.Ru)("降序")},{key:"none",label:(0,Gi.Ru)("不排序")}]:[{key:"asc",icon:"groupAsc",label:(0,Gi.Ru)("组内升序")},{key:"desc",icon:"groupDesc",label:(0,Gi.Ru)("组内降序")},{key:"none",label:(0,Gi.Ru)("不排序")}];this.showTooltipWithInfo(e,[],{operator:{menu:{selectedKeys:i,items:s,onClick:i=>(0,A.sH)(this,[i],void 0,function*({key:i}){yield this.groupSortByMethod(i,t),this.emit(m.RANGE_SORTED,e)})}},onlyShowOperator:!0})}getSeriesNumberText(){var e;const{text:t,enable:i}=null!==(e=this.options.seriesNumber)&&void 0!==e?e:{};return i?null!=t?t:(0,h.zw)():""}enableAsyncExport(){return!0}}class tr extends er{isCustomRowFields(){return!1}getDataSet(){const{dataSet:e}=this.options;return e?e(this):new ji(this)}isPivotMode(){return!1}isTableMode(){return!0}isHierarchyTreeType(){return!1}isHierarchyGridTreeType(){return!1}isFrozenRowHeader(){return!1}clearDrillDownData(){return(0,A.sH)(this,void 0,void 0,function*(){})}isValueInCols(){return!1}bindEvents(){}buildFacet(){var e,t,i,s,o,n;null!==(e=(n=this.options).dataCell)&&void 0!==e||(n.dataCell=e=>{var t;return(null===(t=this.options.seriesNumber)||void 0===t?void 0:t.enable)&&0===e.colIndex?new Fi(e,this):new zi(e,this)}),null===(t=this.facet)||void 0===t||t.destroy(),this.facet=null!==(o=null===(s=(i=this.options).facet)||void 0===s?void 0:s.call(i,this))&&void 0!==o?o:new Ro(this),this.facet.render()}destroy(){super.destroy(),this.off(m.RANGE_SORT),this.off(m.RANGE_FILTER)}groupSortByMethod(e,t){const{field:i}=t,s={sortFieldId:i,sortMethod:e};this.updateSortMethodMap(t.id,e),this.emit(m.RANGE_SORT,[s])}}class ir extends Pi{constructor(){super(...arguments),this.handleDimensionValuesSort=()=>{(0,a.each)(this.sortParams,e=>{const{sortFieldId:t,sortByMeasure:i}=e;if(!t)return;const s=(e=>{const{dataSet:t,sortParam:i,originValues:s,isSortByMeasure:o}=e;let n;return n=o?Si(e):s,_i({sortParam:i,originValues:s,measureValues:n,dataSet:t})})({dataSet:this,sortParam:e,originValues:[...this.sortedDimensionValues[t]||[]],isSortByMeasure:!(0,a.isEmpty)(i)});this.sortedDimensionValues[t]=s,this.handlePivotMetaSort(t,s)})},this.getTotalStatus=e=>{const{columns:t,rows:i}=this.fields,s=(t,i)=>{if(i){const i=(0,a.find)(t,t=>!(0,a.has)(e,t));return!(!i||i===(0,a.first)(t))}return(0,a.every)(t,t=>!(0,a.has)(e,t))};return{isRowGrandTotal:s((0,Oe.LR)(i)),isRowSubTotal:s(i,!0),isColGrandTotal:s((0,Oe.LR)(t)),isColSubTotal:s(t,!0)}}}getExistValuesByDataItem(e,t){return(0,Oe.K0)(e,t)}setDataCfg(e){super.setDataCfg(e);const{rows:t}=this.fields;this.sortedDimensionValues={},this.rowPivotMeta=new Map,this.colPivotMeta=new Map,this.dimensionValuesCache=new Map,this.transformIndexesData(this.originData,t),this.handleDimensionValuesSort()}transformIndexesData(e,t){const{columns:i,values:s,valueInCols:o}=this.fields;let n;return Zi.U.getInstance().debugCallback(Zi.uK,()=>{n=(0,Oe.Ll)({rows:(0,Oe.AB)(t),columns:(0,Oe.AB)(i),values:s,valueInCols:o,data:e,indexesData:this.indexesData,sortedDimensionValues:this.sortedDimensionValues,rowPivotMeta:this.rowPivotMeta,colPivotMeta:this.colPivotMeta,getExistValuesByDataItem:this.getExistValuesByDataItem}),this.indexesData=n.indexesData,this.rowPivotMeta=n.rowPivotMeta,this.colPivotMeta=n.colPivotMeta,this.sortedDimensionValues=n.sortedDimensionValues}),n}transformDrillDownData(e,t,i){var s;const o=[...Ns.getFieldPath(i,!0),e],n=this.spreadsheet.store,r=null==i?void 0:i.id,l=null!==(s=n.get("drillDownIdPathMap"))&&void 0!==s?s:new Map;l.has(r)&&((0,a.forEach)(l.get(r),e=>{(0,a.unset)(this.indexesData,e)}),(0,Oe.Rl)(this.rowPivotMeta,r));const{paths:d}=this.transformIndexesData(t,o);l.set(r,d),n.set("drillDownIdPathMap",l)}clearDrillDownData(e){const t=this.spreadsheet.store,i=t.get("drillDownIdPathMap");if(!i)return!1;const s=t.get("drillDownDataCache",[]);if(e){const o=i.get(e);o&&(0,a.forEach)(o,e=>{(0,a.unset)(this.indexesData,e)}),(0,Oe.Rl)(this.rowPivotMeta,e),i.delete(e);const n=(0,a.filter)(s,e=>i.has(null==e?void 0:e.rowId));t.set("drillDownDataCache",n);const r=n.map(e=>null==e?void 0:e.drillLevel),l=t.get("drillDownFieldInLevel",[]).filter(e=>(0,a.includes)(r,null==e?void 0:e.drillLevel));t.set("drillDownFieldInLevel",l)}else{i.clear();const e=this.spreadsheet.store.get("originalDataCfg");(0,a.isEmpty)(e)||this.spreadsheet.setDataCfg(e),this.spreadsheet.store.set("drillItemsNum",-1),this.spreadsheet.store.set("drillDownDataCache",[]),this.spreadsheet.store.set("drillDownFieldInLevel",[])}return t.set("drillDownIdPathMap",i),!0}handlePivotMetaSort(e,t){const{rows:i,columns:s}=this.fields;(0,a.includes)(i,e)?this.rowPivotMeta=Ei({pivotMeta:this.rowPivotMeta,dimensions:i,sortFieldId:e,sortedDimensionValues:t}):(0,a.includes)(s,e)&&(this.colPivotMeta=Ei({pivotMeta:this.colPivotMeta,dimensions:s,sortFieldId:e,sortedDimensionValues:t}))}processDataCfg(e){const{data:t,meta:i=[],fields:s,sortParams:o=[]}=e,{columns:n=[],rows:r=[],values:l,valueInCols:d,customValueOrder:c}=s;let h=n,u=r;d?h=this.isCustomMeasuresPosition(c)?this.handleCustomMeasuresOrder(c,h):(0,a.uniq)([...n,ye.GJ]):u=this.isCustomMeasuresPosition(c)?this.handleCustomMeasuresOrder(c,u):(0,a.uniq)([...r,ye.GJ]);return{data:t,meta:this.processMeta(i,(0,Gi.Ru)("数值")),fields:Object.assign(Object.assign({},s),{rows:u,columns:h,values:l}),sortParams:o}}getFieldsAndPivotMetaByField(e){const{rows:t=[],columns:i=[]}=this.fields||{};return t.includes(e)?{dimensions:(0,Oe.AB)(t),pivotMeta:this.rowPivotMeta}:i.includes(e)?{dimensions:(0,Oe.AB)(i),pivotMeta:this.colPivotMeta}:{}}getDimensionValues(e,t={}){var i;const{pivotMeta:s,dimensions:o}=this.getFieldsAndPivotMetaByField(e);if(!s||!o)return[];const n=(0,a.isEmpty)(t);if(this.dimensionValuesCache.has(e)&&n)return null!==(i=this.dimensionValuesCache.get(e))&&void 0!==i?i:[];const r=(0,Oe.uQ)(t,o,ye.YZ),l=(0,Oe.eE)({pivotMeta:s,dimensionValues:r,fields:o,fieldIdx:(0,a.indexOf)(o,e),queryType:be.B.DetailOnly,sortedDimensionValues:this.sortedDimensionValues}),d=(0,a.uniq)(l.map(e=>(0,co.bC)(e.value)));return n&&this.dimensionValuesCache.set(e,d),d}getTotalValue(e,t){const{options:i}=this.spreadsheet,s=(0,a.some)(t)?t:this.getTotalStatus(e),{aggregation:o,calcFunc:n}=function(e,t){const{isRowGrandTotal:i,isRowSubTotal:s,isColGrandTotal:o,isColSubTotal:n}=e,{row:r,col:l}=t||{},{calcGrandTotals:a={},calcSubTotals:d={}}=r||{},{calcGrandTotals:c={},calcSubTotals:h={}}=l||{},u=(e,t)=>{if((e.aggregation||e.calcFunc)&&t)return{aggregation:e.aggregation,calcFunc:e.calcFunc}};return u(c,o)||u(h,n)||u(a,i)||u(d,s)}(s,null==i?void 0:i.totals)||{},r=!(0,a.isEmpty)(null==i?void 0:i.totals)||this.spreadsheet.isHierarchyTreeType()||this.spreadsheet.isHierarchyGridTreeType()?"":v.F4.SUM,l=vi[o||r];if(l||n){const t=this.getCellMultiData({query:e,queryType:be.B.DetailOnly});let i=null;return n?i=n(e,t,this.spreadsheet):l&&(i=l(t,ye.nj)),ci.getCellData(Object.assign(Object.assign({},(0,a.omit)(e,[ye.GJ])),{[e[ye.GJ]]:i}),e[ye.GJ])}}getCellData(e){var t,i,s,o;const{query:n={},rowNode:r,isTotals:l=!1,totalStatus:d}=e||{},{rows:c,columns:h}=this.fields;let u=c;const p=null===(t=this.spreadsheet)||void 0===t?void 0:t.store.get("drillDownIdPathMap"),g=Array.from(null!==(i=null==p?void 0:p.keys())&&void 0!==i?i:[]).some(e=>null==r?void 0:r.id.startsWith(e));r&&g&&(u=null!==(s=Ns.getFieldPath(r,g))&&void 0!==s?s:c);const m=(0,Oe.AB)(u),v=(0,Oe.AB)(h),f=(0,Oe.uQ)(n,m),C=(0,Oe.uQ)(n,v),y=(0,Oe.Ir)({rowDimensionValues:f,colDimensionValues:C,rowPivotMeta:this.rowPivotMeta,colPivotMeta:this.colPivotMeta,rowFields:m,colFields:v,prefix:(0,Oe._K)(m,v)}),w=(0,a.get)(this.indexesData,y);if(w)return ci.getCellData(w,n[ye.GJ]);if(l)return this.getTotalValue(n,d);return(null===(o=this.spreadsheet)||void 0===o?void 0:o.isHierarchyGridTreeType())&&(null==r?void 0:r.isCollapsed)?this.getTotalValue(n,d):void 0}getQueryExtraFields(e){const{values:t=[]}=this.fields,i=e[ye.GJ];return i?(0,a.includes)(t,i)?[i]:[]:t}getCellMultiData(e){const{query:t={},queryType:i=be.B.All,drillDownFields:s=[]}=e||{};(0,a.isEmpty)(t)&&console.warn(`query: ${t} shouldn't be empty, you can get all data from dataCfg if you're intended.\n you should use { EXTRA_FIELD: xxx} as least if you want query all specific value data`);const{rows:o,columns:n}=this.fields,r=(0,a.isEmpty)(s)?o:o.concat(s),l=(0,Oe.AB)(r),d=(0,Oe.AB)(n),c=(0,Oe.uQ)(t,l,ye.YZ),h=(0,Oe.uQ)(t,d,ye.YZ),{rowQueries:u,colQueries:p}=(0,Oe.t$)({rowDimensionValues:c,colDimensionValues:h,rowPivotMeta:this.rowPivotMeta,colPivotMeta:this.colPivotMeta,rowFields:l,colFields:d,sortedDimensionValues:this.sortedDimensionValues,queryType:i}),g=(0,Oe._K)(l,d),m=[];for(const e of u)for(const t of p){const s=(0,Oe.Ir)({rowDimensionValues:e,colDimensionValues:t,rowPivotMeta:this.rowPivotMeta,colPivotMeta:this.colPivotMeta,rowFields:l,colFields:d,prefix:g});let o=!1,n=this.indexesData;for(let e=0;e<s.length;e++){const t=s[e];o?n=(0,Oe.j0)(t)?(0,Oe.$0)(n,i):(0,a.compact)((0,a.map)(n,e=>null==e?void 0:e[t])):(0,Oe.j0)(t)?(o=!0,n=(0,a.compact)([n]),e--):n=null==n?void 0:n[t]}(0,a.isArray)(n)?m.push(...n):n&&m.push(n)}const v=this.getQueryExtraFields(t);return(0,a.flatMap)((0,a.uniq)(m),e=>e?ci.getCellDataList(e,v):[])}getFieldFormatter(e,t){return e===ye.jI?this.getFieldFormatterForTotalValue(t):super.getFieldFormatter(e)}getFieldFormatterForTotalValue(e){let t="";return!this.spreadsheet.isValueInCols()&&e&&(t=(0,a.get)(e.rowQuery,ye.GJ)),t=null!=t?t:(0,a.get)(this.fields.values,0),super.getFieldFormatter(t)}handleCustomMeasuresOrder(e,t){const i=(0,a.uniq)([...t]);return t.length>=e?(i.splice(e,0,ye.GJ),i):[...i,ye.GJ]}isCustomMeasuresPosition(e){return(0,a.isNumber)(e)}getRowData(e){return this.getCellMultiData({query:e.rowQuery})}}class sr extends ir{processDataCfg(e){const t=!this.spreadsheet.isCustomRowFields(),i=e.fields.rows||[],s=t?i:[...i,ye.GJ],o=this.processMeta(e.meta,(0,Gi.Ru)("数值"));return Object.assign(Object.assign({},e),{meta:o,fields:Object.assign(Object.assign({},e.fields),{rows:s,valueInCols:t})})}}const or=e=>{try{return JSON.parse(e)}catch(e){return null}};class nr extends eo{get rowCellTheme(){return this.spreadsheet.theme.rowCell.cell}getCornerCellInstance(...e){var t,i;return(null===(i=(t=this.spreadsheet.options).cornerCell)||void 0===i?void 0:i.call(t,...e))||new ms(...e)}getRowCellInstance(...e){var t,i;return(null===(i=(t=this.spreadsheet.options).rowCell)||void 0===i?void 0:i.call(t,...e))||new ds(...e)}getColCellInstance(...e){var t,i;return(null===(i=(t=this.spreadsheet.options).colCell)||void 0===i?void 0:i.call(t,...e))||new Ti(...e)}doLayout(){const{rowLeafNodes:e,colLeafNodes:t,rowsHierarchy:i,colsHierarchy:s}=this.buildAllHeaderHierarchy();return this.calculateHeaderNodesCoordinate({rowLeafNodes:e,rowsHierarchy:i,colLeafNodes:t,colsHierarchy:s}),{colNodes:s.getNodes(),colsHierarchy:s,rowNodes:i.getNodes(),rowsHierarchy:i,rowLeafNodes:e,colLeafNodes:t}}buildAllHeaderHierarchy(){const{leafNodes:e,hierarchy:t}=Oo({isRowHeader:!0,spreadsheet:this.spreadsheet}),{leafNodes:i,hierarchy:s}=Oo({isRowHeader:!1,spreadsheet:this.spreadsheet});return{rowLeafNodes:e,colLeafNodes:i,rowsHierarchy:t,colsHierarchy:s}}getDataQueryInfo(e,t){var i,s,o,n;const{options:r,dataSet:l}=this.spreadsheet,d=null!==(o=null===(s=null===(i=r.style)||void 0===i?void 0:i.colCell)||void 0===s?void 0:s.hideValue)&&void 0!==o&&o?{[ye.GJ]:null===(n=l.fields.values)||void 0===n?void 0:n[0]}:{},c=(0,a.merge)({},e,t,d);return{dataQuery:c,valueField:c[ye.GJ]}}getCellMeta(e=0,t=0){var i,s;const{options:o,dataSet:n}=this.spreadsheet,{rowLeafNodes:r,colLeafNodes:l}=this.getLayoutResult(),d=r[e],c=l[t];if(!d||!c)return null;const h=d.query,u=c.query,p=d.isTotals||d.isTotalMeasure||c.isTotals||c.isTotalMeasure,g=(0,Oe.i9)(d,c),{dataQuery:m,valueField:v}=this.getDataQueryInfo(h,u),f=n.getCellData({query:m,rowNode:d,isTotals:p,totalStatus:g}),C=(0,a.get)(f,ye.nj,null),y={spreadsheet:this.spreadsheet,x:c.x,y:d.y,width:c.width,height:d.height,data:f,rowIndex:e,colIndex:t,isTotals:p,valueField:v,fieldValue:C,rowQuery:h,colQuery:u,query:Object.assign(Object.assign({},h),u),rowId:d.id,colId:c.id,id:xe(d.id,c.id)};return null!==(s=null===(i=o.layoutCellMeta)||void 0===i?void 0:i.call(o,y))&&void 0!==s?s:y}getPreLevelSampleNode(e,t){return t.getNodes(e.level-1).find(e=>!e.isTotals)}calculateHeaderNodesCoordinate(e){this.calculateRowNodesCoordinate(e),this.calculateColNodesCoordinate(e)}calculateColNodesCoordinate(e){const{colLeafNodes:t,colsHierarchy:i,rowsHierarchy:s}=e;this.calculateColLeafNodesWidth(e),this.calculateColParentNodeWidthAndX(t),this.updateColsHierarchySampleMaxHeightNodes(i,s),this.calculateColNodesHeight(i),this.updateCustomFieldsSampleNodes(i),this.adjustCustomColLeafNodesHeight({leafNodes:t,hierarchy:i}),this.adjustColTotalNodesCoordinate(i)}calculateRowOffsets(){}adjustColTotalNodesCoordinate(e){var t;(0,a.isEmpty)(null===(t=this.spreadsheet.options.totals)||void 0===t?void 0:t.col)||(this.adjustTotalNodesCoordinate({hierarchy:e,isRowHeader:!1,isSubTotal:!0}),this.adjustTotalNodesCoordinate({hierarchy:e,isRowHeader:!1,isSubTotal:!1}))}calculateColLeafNodesWidth(e){const{rowLeafNodes:t,colLeafNodes:i,rowsHierarchy:s,colsHierarchy:o}=e;let n=Ns.blankNode(),r=0;o.getLeaves().forEach(e=>{e.colIndex=r,r++,e.x=n.x+n.width,e.width=this.getColLeafNodesWidth(e,i,t,s.width),o.width+=e.width,n=e})}calculateColNodesHeight(e){e.getNodes().forEach(t=>{if(0===t.level)t.y=0;else{const i=this.getPreLevelSampleNode(t,e);t.y=(null==i?void 0:i.y)+(null==i?void 0:i.height)||0}const i=this.getColNodeHeight({colNode:t,colsHierarchy:e,useCache:!1});t.height=t.isGrandTotals&&!t.isTotalMeasure&&t.isLeaf?e.height:i,lo(this.spreadsheet,null,t)})}getMultipleMap(e,t,i){const{maxLevel:s}=e,o=this.spreadsheet.dataSet,{totals:n}=this.spreadsheet.options,r=o.moreThanOneValue(),{rows:l,columns:a}=o.fields,d=t?l:a,c=t?n.row:n.col,h=i?(null==c?void 0:c.subTotalsGroupDimensions)||[]:(null==c?void 0:c.grandTotalsGroupDimensions)||[],u=o.isEmpty()?[]:h,p=Array.from({length:s+1},()=>1);for(let e=s;e>0;e--){const t=d[e],i=t===ye.GJ&&r;u.includes(t)||i||(p[e-1]+=p[e],p[e]=0)}return p}adjustTotalNodesCoordinate(e){const{hierarchy:t,isRowHeader:i,isSubTotal:s}=e,o=this.getMultipleMap(t,i,s),n=(0,a.filter)(t.getNodes(),e=>s?e.isSubTotals:e.isGrandTotals),r=i?"width":"height";(0,a.forEach)(n,e=>{var i;let n=o[e.level];if(!n&&s){let t=1;for(;n<1;)n=o[e.level-t]-t,t++}let l=0;for(let s=0;s<n;s++)l+=(0,a.get)(null===(i=t.sampleNodesForAllLevels)||void 0===i?void 0:i.find(t=>t.level===e.level+s),[r],0);e[r]=l})}getColLeafNodesWidth(e,t,i,s){const{colCell:o}=this.spreadsheet.options.style,n=this.getColCellDraggedWidth(e);if((0,a.isNumber)(n))return y(n);const r=this.getCellCustomSize(e,null==o?void 0:o.width);return(0,a.isNumber)(r)?y(r):this.spreadsheet.getLayoutWidthType()===Vi.Compact?this.getCompactGridColNodeWidth(e,i):this.spreadsheet.isHierarchyTreeType()?this.getAdaptTreeColWidth(e,t,i):this.getAdaptGridColWidth(t,e,s)}getRowNodeHeight(e){if(!e)return 0;const{rowCell:t}=this.spreadsheet.options.style,i=this.getRowCellHeight(e),s=(null==t?void 0:t.maxLines)>1&&(null==t?void 0:t.wordWrap)||this.spreadsheet.theme.rowCell.text.fontSize>12||this.spreadsheet.theme.rowCell.measureText.fontSize>12||this.spreadsheet.theme.rowCell.seriesText.fontSize>12||this.spreadsheet.theme.rowCell.bolderText.fontSize>12;return this.isCustomRowCellHeight(e)||!s?(e.extra.isCustomHeight=!0,i||0):this.getNodeAdaptiveHeight({meta:e,cell:this.textWrapTempRowCell,defaultHeight:i})}getExpectedCellIconWidth(e,t,i){var s,o;let n=0;if(t)n=1;else{const t=(0,a.map)(this.spreadsheet.options.headerActionIcons,e=>Object.assign(Object.assign({},e),{displayCondition:()=>!0})),i=(0,re.AS)(t,null,e);n=(null==i?void 0:i.icons.length)||0}return n?n*(i.size+(null===(s=i.margin)||void 0===s?void 0:s.left))+(null===(o=i.margin)||void 0===o?void 0:o.right):0}calculateRowNodesAllLevelSampleNodes(e){const{rowsHierarchy:t,colLeafNodes:i}=e,s=this.spreadsheet.isHierarchyTreeType(),o=t.sampleNodesForAllLevels||[];s?t.width=this.getTreeRowHeaderWidth():o.forEach(e=>{var s;e.width=this.getGridRowNodesWidth(e,i),t.width+=e.width;const n=null!==(s=o[e.level-1])&&void 0!==s?s:{x:0,width:0};e.x=(null==n?void 0:n.x)+(null==n?void 0:n.width)}),t.rootNode.width=t.width}getRowLeafNodeHeight(e){var t;const{rowCell:i}=this.spreadsheet.options.style,s=(null==i?void 0:i.maxLines)>1&&(null==i?void 0:i.wordWrap)?Ns.getBranchNodes(e).map(e=>this.getRowNodeHeight(e)):[],o=this.getRowNodeHeight(e);return y(this.isCustomRowCellHeight(e)?o:null!==(t=(0,a.max)(s))&&void 0!==t?t:o)}calculateRowNodesBBox(e){const t=this.spreadsheet.isHierarchyTreeType(),i=e.sampleNodesForAllLevels||[];let s=Ns.blankNode();e.getNodes().forEach(o=>{var n,r;const l=t||!t&&o.isLeaf;if(t)o.width=this.getTreeRowHeaderWidth();else{const e=i[o.level];o.width=null==e?void 0:e.width}if(l){const t=(null!==(n=null==s?void 0:s.rowIndex)&&void 0!==n?n:-1)+1;null!==(r=o.rowIndex)&&void 0!==r||(o.rowIndex=t),o.y=s.y+s.height,o.height=this.getRowLeafNodeHeight(o),s=o,e.height+=o.height}if(t||0===o.level)o.x=0;else{const e=i[o.level-1];o.x=(null==e?void 0:e.x)+(null==e?void 0:e.width)}lo(this.spreadsheet,o,null)})}calculateRowNodesCoordinate(e){const{rowsHierarchy:t,rowLeafNodes:i}=e,s=this.spreadsheet.isHierarchyTreeType();this.calculateRowNodesAllLevelSampleNodes(e),this.calculateRowNodesBBox(t),s||(this.adjustCustomRowLeafNodesWidth({leafNodes:i,hierarchy:t}),this.calculateRowNodeHeightAndY(i),this.adjustRowTotalNodesCoordinate(t))}adjustRowTotalNodesCoordinate(e){var t;(0,a.isEmpty)(null===(t=this.spreadsheet.options.totals)||void 0===t?void 0:t.row)||(this.adjustTotalNodesCoordinate({hierarchy:e,isRowHeader:!0,isSubTotal:!1}),this.adjustTotalNodesCoordinate({hierarchy:e,isRowHeader:!0,isSubTotal:!0}))}calculateRowNodeHeightAndY(e){let t=null,i=0;const s=e.slice(0);for(;i<s.length;){const e=s[i++],o=null==e?void 0:e.parent;t!==o&&o&&(s.push(o),o.y=o.children[0].y,o.height=(0,a.sumBy)(o.children,"height"),t=o)}}getGridRowNodesWidth(e,t){const{rowCell:i}=this.spreadsheet.options.style,s=this.getRowCellDraggedWidth(e);if((0,a.isNumber)(s))return y(s);const o=this.getCellCustomSize(e,null==i?void 0:i.width);return(0,a.isNumber)(o)?y(o):this.spreadsheet.getLayoutWidthType()!==Vi.Adaptive?this.getCompactGridRowNodeWidth(e):this.getAdaptGridColWidth(t)}getAdaptTreeColWidth(e,t,i){const s=this.getCanvasSize().width-this.getSeriesNumberWidth()-T.getVerticalBorderWidth(this.spreadsheet),o=Math.min(s/2,this.getTreeRowHeaderWidth()),n=Math.max(1,t.length),{dataCell:r}=this.spreadsheet.options.style;return y(Math.max((0,fe.jv)(r,this.getColLabelLength(e,i)),C((s-o)/n)))}getColLabelLength(e,t){const i=or(null==e?void 0:e.value);if((0,a.isArray)(i))return i.length;let s=1;for(let i=0;i<50;i++){const o=t[i];if(!o)return s;const n=this.spreadsheet.dataSet.getCellData({query:Object.assign(Object.assign({},e.query),o.query),rowNode:o,isTotals:e.isTotals||e.isTotalMeasure||o.isTotals||o.isTotalMeasure}),r=(0,a.keys)(n);for(let e=0;e<r.length;e++){const t=(0,a.get)(n,r[e]),i=(0,a.size)((0,a.get)(null==t?void 0:t.values,"0"));i>s&&(s=i)}}return s}getAdaptGridColWidth(e,t,i){const{rows:s=[]}=this.spreadsheet.dataSet.fields,{dataCell:o}=this.spreadsheet.options.style,n=s.length,r=e.length,{width:l}=this.getCanvasSize(),a=l-this.getSeriesNumberWidth()-T.getVerticalBorderWidth(this.spreadsheet),d=Math.max(1,n+r);return y(i?Math.max((0,fe.jv)(o),C((a-i)/r)):Math.max((0,fe.jv)(o),C(a/d)))}getTreeRowHeaderWidth(){var e,t,i,s;const{rowCell:o}=this.spreadsheet.options.style;if((0,a.isNumber)(null==o?void 0:o.treeWidth))return y(o.treeWidth);const n=this.getCellCustomSize(null,null==o?void 0:o.width);if((0,a.isNumber)(n))return y(n);const r=As.getTreeCornerText(this.spreadsheet),{bolderText:l,icon:d}=this.spreadsheet.theme.cornerCell,c=this.measureTextWidth(r,l)+2*d.size+(null===(e=d.margin)||void 0===e?void 0:e.left)+(null===(t=d.margin)||void 0===t?void 0:t.right)+(null===(i=this.rowCellTheme.padding)||void 0===i?void 0:i.left)+(null===(s=this.rowCellTheme.padding)||void 0===s?void 0:s.right),h=Math.max(null!=n?n:120,c);return Number.isNaN(h)?120:y(h)}getCompactGridRowNodeWidth(e){var t;const{bolderText:i,icon:s,cell:o}=this.spreadsheet.theme.rowCell,{bolderText:n,icon:r,cell:l}=this.spreadsheet.theme.cornerCell,{field:c,isLeaf:h}=e,u=this.getExpectedCellIconWidth(d.vZ.ROW_CELL,!this.spreadsheet.isValueInCols()&&h&&this.spreadsheet.options.showDefaultHeaderActionIcon,s),p=null===(t=this.spreadsheet.dataSet.getDimensionValues(c))||void 0===t?void 0:t.slice(0,50).map(t=>{var i,s;return null!==(s=null===(i=this.spreadsheet.dataSet.getFieldFormatter(c))||void 0===i?void 0:i(t,void 0,e))&&void 0!==s?s:t}),g=(0,a.maxBy)(p,e=>`${e}`.length),m=this.measureTextWidth(g,i)+u+o.padding.left+o.padding.right+o.verticalBorderWidth,v=this.spreadsheet.dataSet.getFieldName(c),f=this.getExpectedCellIconWidth(d.vZ.CORNER_CELL,!1,r),C=this.measureTextWidth(v,n)+f+l.padding.left+l.padding.right;Zi.U.getInstance().logger("Max Label In Row:",c,m>C?g:v);const{compactExtraWidth:w=0,compactMinWidth:x}=this.spreadsheet.options.style||{},_=y(Math.max(m,C)+w);return(0,a.isNumber)(x)?Math.max(_,x):_}getCompactGridColNodeWidth(e,t){var i,s,o,n,r,l;const{bolderText:c,cell:h,icon:u}=this.spreadsheet.theme.colCell,{text:p,icon:g}=this.spreadsheet.theme.dataCell,m=this.spreadsheet.dataSet.getFieldFormatter(e.field),v=null!==(i=null==m?void 0:m(e.value,void 0,e))&&void 0!==i?i:e.value,f=this.getExpectedCellIconWidth(d.vZ.COL_CELL,this.spreadsheet.isValueInCols()&&this.spreadsheet.options.showDefaultHeaderActionIcon,u),C=this.measureTextWidth(v,c)+f;let w="",x=0,_=0;for(let i=0;i<50;i++){const a=t[i];if(a){const{valueField:t,dataQuery:i}=this.getDataQueryInfo(a.query,e.query),d=this.spreadsheet.dataSet.getCellData({query:i,rowNode:a,isTotals:e.isTotals||e.isTotalMeasure||a.isTotals||a.isTotalMeasure});if(d){const i=null==d?void 0:d[ye.nj],a=null!==(o=null===(s=this.spreadsheet.dataSet.getFieldFormatter(d[ye.GJ]))||void 0===s?void 0:s(i,d,e))&&void 0!==o?o:i,c=(0,ue.NV)(null===(n=this.spreadsheet.options.conditions)||void 0===n?void 0:n.icon,t)?(null==g?void 0:g.size)+(null===(r=null==g?void 0:g.margin)||void 0===r?void 0:r.left)+(null===(l=null==g?void 0:g.margin)||void 0===l?void 0:l.right):0,h=this.measureTextWidth(a,p)+c;h>x&&(w=a,x=h,_=c)}}}const S=C>x,b=S?v:w,E=S?f:_;Zi.U.getInstance().logger("Max Label In Col:",e.field,b,x,_);const L=this.measureTextWidth(b,Object.assign(Object.assign({},c),{fontSize:Math.max(p.fontSize,c.fontSize)})),{compactExtraWidth:T=0,compactMinWidth:O}=this.spreadsheet.options.style||{},R=y(L+h.padding.left+h.padding.right+2*h.verticalBorderWidth+E+T);return(0,a.isNumber)(O)?Math.max(R,O):R}getViewCellHeights(){const e=this.getRowLeafNodes(),t=(0,a.reduce)(e,(e,t)=>{const i=(0,a.last)(e)||0;return e.push(i+t.height),e},[0]);return{getTotalHeight:()=>(0,a.last)(t)||0,getCellOffsetY:e=>t[e]||0,getTotalLength:()=>t.length-1,getIndexRange:(e,i)=>Ki(t,e,i)}}getSeriesNumberCells(){var e;const t=(null===(e=this.getSeriesNumberHeader())||void 0===e?void 0:e.children)||[];return es(t,Us)}getFrozenOptions(){return this.validFrozenOptions||(this.validFrozenOptions=((e,t)=>{const{seriesNumber:i,layoutSeriesNumberNodes:s}=t;return(null==i?void 0:i.enable)&&s?Object.assign(Object.assign({},e),{rowCount:0,trailingRowCount:0}):e})(super.getFrozenOptions(),this.spreadsheet.options)),this.validFrozenOptions}getContentWidth(){const{rowsHierarchy:e,colsHierarchy:t}=this.layoutResult;return y(e.width+t.width+T.getVerticalBorderWidth(this.spreadsheet))}getContentHeight(){const{rowsHierarchy:e,colsHierarchy:t}=this.layoutResult;return y(e.height+t.height+T.getHorizontalBorderWidth(this.spreadsheet))}}class rr extends er{isCustomRowFields(){return this.isCustomHeaderFields("rows")}getDataSet(){const{dataSet:e}=this.options;return e?e(this):this.isCustomRowFields()?new sr(this):new ir(this)}getContentHeight(){return this.facet.getContentHeight()}isPivotMode(){return!0}isTableMode(){return!1}isHierarchyTreeType(){return"tree"===this.options.hierarchyType}isHierarchyGridTreeType(){return"grid-tree"===this.options.hierarchyType}isFrozenRowHeader(){var e,t;return!!(null===(t=null===(e=this.options)||void 0===e?void 0:e.frozen)||void 0===t?void 0:t.rowHeader)}isValueInCols(){var e,t;return null===(t=null===(e=this.dataSet)||void 0===e?void 0:e.fields)||void 0===t?void 0:t.valueInCols}clearDrillDownData(e,t){return(0,A.sH)(this,void 0,void 0,function*(){if(this.dataSet instanceof ir){this.dataSet.clearDrillDownData(e)&&!t&&(this.interaction.reset(),yield this.render(!1))}})}buildFacet(){var e,t,i,s,o,n;null!==(e=(n=this.options).dataCell)&&void 0!==e||(n.dataCell=e=>new Ri(e,this)),null===(t=this.facet)||void 0===t||t.destroy(),this.facet=null!==(o=null===(s=(i=this.options).facet)||void 0===s?void 0:s.call(i,this))&&void 0!==o?o:new nr(this),this.facet.render()}bindEvents(){this.off(m.ROW_CELL_COLLAPSED__PRIVATE),this.off(m.ROW_CELL_ALL_COLLAPSED__PRIVATE),this.on(m.ROW_CELL_COLLAPSED__PRIVATE,this.handleRowCellCollapsed),this.on(m.ROW_CELL_ALL_COLLAPSED__PRIVATE,this.handleRowCellToggleCollapseAll)}handleRowCellCollapsed(e){return(0,A.sH)(this,void 0,void 0,function*(){var t;const{isCollapsed:i,node:s}=e,{collapseFields:o}=null===(t=this.options.style)||void 0===t?void 0:t.rowCell,n=Object.assign(Object.assign({},o),{[s.id]:i});this.setOptions({style:{rowCell:{collapseFields:n}}}),yield this.render(!1),this.emit(m.ROW_CELL_COLLAPSED,{isCollapsed:i,collapseFields:n,node:s})})}handleRowCellToggleCollapseAll(e){return(0,A.sH)(this,void 0,void 0,function*(){const t=!e;this.setOptions({style:{rowCell:{collapseAll:t,collapseFields:null,expandDepth:null}}}),yield this.render(!1),this.emit(m.ROW_CELL_ALL_COLLAPSED,t)})}groupSortByMethod(e,t){return(0,A.sH)(this,void 0,void 0,function*(){var i,s,o,n;const{rows:r,columns:l}=this.dataCfg.fields,{hideValue:d}=this.options.style.colCell,c=this.isValueInCols()?(0,a.last)(r):(0,a.last)(l),{query:h,field:u,value:p,extra:g}=t,v=(0,a.clone)(h);let f=(null==g?void 0:g.isCustomNode)?u:p;d&&this.isValueInCols()&&(f=this.dataSet.fields.values[0],v[ye.GJ]=f);const C=(0,a.isString)(c)?c:c.field,y=null===(i=this.dataCfg.sortParams)||void 0===i?void 0:i.find(e=>(null==e?void 0:e.sortFieldId)===C||(null==e?void 0:e.sortFieldId)===f),w=null===(s=this.dataCfg.sortParams)||void 0===s?void 0:s.find(e=>"*"===(null==e?void 0:e.sortFieldId)),x={sortFieldId:C,sortMethod:e,sortByMeasure:f,query:v,nullsPlacement:null!==(o=null==y?void 0:y.nullsPlacement)&&void 0!==o?o:null==w?void 0:w.nullsPlacement},_=null===(n=this.dataCfg.sortParams)||void 0===n?void 0:n.filter(e=>(null==e?void 0:e.sortFieldId)!==c);this.updateSortMethodMap(t.id,e,!0);const S=[..._,x];this.emit(m.RANGE_SORT,S),this.setDataCfg(Object.assign(Object.assign({},this.dataCfg),{sortParams:S})),yield this.render()})}}var lr=i("./node_modules/.pnpm/antd@6.6.8_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/theme/index.js"),ar=i("./node_modules/.pnpm/antd@6.6.8_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/spin/index.js"),dr=i("./node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/isEqual.js"),cr=i.n(dr),hr=i("./node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/cloneDeep.js"),ur=i.n(hr),pr=i("./node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/merge.js"),gr=i.n(pr),mr=i("./src/utils/antd.tsx"),vr=i("./src/utils/dashEvents.ts"),fr=i("./src/utils/dash3.ts"),Cr=i("./src/utils/funcs.ts"),yr=i("./src/utils/useDeepCompareSignal.ts"),wr=i("./src/utils/useResizeObserver.ts"),xr=i("./src/utils/visualizationTheme.ts");class _r extends Ri{drawTextShape(){this.isMultiData()?(0,fe.V)(this):super.drawTextShape()}}class Sr extends Ti{drawTextShape(){const e=this.getMeta(),t=or(e?.value);if(!Array.isArray(t))return void super.drawTextShape();const{formattedValue:i}=this.getFormattedFieldValue();(0,fe.V)(this,{values:i!==e?.value?[[i]]:[t]},!1)}}class br extends sr{getExistValuesByDataItem(e){const t=Object.keys(e).filter(t=>{const i=e[t];return"object"==typeof i&&null!==i&&!Array.isArray(i)});return 0===t.length&&t.push(ye.IW),t}processDataCfg(e){const t=super.processDataCfg(e);return{...t,meta:this.processMeta(e.meta,(0,Gi.Ru)("数值")),fields:{...t.fields,rows:[...e.fields.rows??[],ye.GJ]}}}}const Er=(e,t)=>Po((e=>({hierarchyType:"tree",dataCell:(e,t)=>new _r(e,t),colCell:(e,t,i)=>new Sr(e,t,i),dataSet:e=>new br(e),showDefaultHeaderActionIcon:!1,style:{colCell:{hideValue:1===e.fields.values?.length}},interaction:{autoResetSheetStyle:!0,brushSelection:!1,selectedCellMove:!1,multiSelection:!1,rangeSelection:!1},tooltip:{operation:{hiddenColumns:!0}}}))(e),t);var Lr=i("./src/utils/visualizationFonts.ts");const Tr=(e,t)=>(0,Lr.l)(e,t);var Or=i("./src/components/fragments/sheet/context.ts");const Rr={ColCell:Ti,DataCell:Ri,Line:l.N1,Rect:l.rw},Ir={},Nr=["cornerCell","rowCell","colCell","dataCell","seriesNumberCell","mergedCell","axisRowCell","axisColCell","axisCornerCell"],Br=["text","bolderText","seriesText","measureText","minorText"],Ar=new Set(["default","colorful","gray","dark"]),Mr=new Set(["cornerCell","colCell","seriesNumberCell","axisColCell","axisCornerCell"]),Dr=new Set(["dataCell","mergedCell"]),Hr=e=>"dark"===(0,xr.n)(e)?"dark":"default";class kr extends Ri{drawTextShape(){return this.isMultiData()?(0,fe.V)(this):super.drawTextShape()}}const zr=(e,t={},i)=>{const s="default",o=!t.name||t.name===s,n=o?(e=>{const t=Hr(e),i={fill:e.colorText,fontFamily:e.fontFamily,fontSize:e.fontSizeSM,opacity:1,linkTextFill:e.colorLink},s={...i,fill:e.colorTextHeading,fontWeight:e.fontWeightStrong},o={...i,fill:e.colorTextLightSolid},n={...o,fontWeight:e.fontWeightStrong},r={hover:{backgroundColor:e.controlItemBgHover,backgroundOpacity:.6},hoverFocus:{backgroundColor:e.controlItemBgHover,backgroundOpacity:.6,borderColor:e.colorPrimary,borderWidth:e.lineWidth,borderOpacity:1},selected:{backgroundColor:e.controlItemBgActive,backgroundOpacity:.6,borderColor:e.colorPrimary},allSelected:{backgroundColor:e.controlItemBgActive,backgroundOpacity:.6,borderColor:e.colorPrimary},rowCellBrushSelected:{backgroundColor:e.controlItemBgActive,backgroundOpacity:.6},colCellBrushSelected:{backgroundColor:e.controlItemBgActive,backgroundOpacity:.6},dataCellBrushSelected:{backgroundColor:e.controlItemBgActive,backgroundOpacity:.6},unselected:{backgroundOpacity:.3,textOpacity:.3,opacity:.3},prepareSelect:{borderColor:e.colorPrimary,borderWidth:e.lineWidth,borderOpacity:1},searchResult:{backgroundColor:e.colorInfoBg,backgroundOpacity:1},highlight:{backgroundColor:e.colorWarningBg,backgroundOpacity:1}},l={hover:{backgroundColor:e.colorPrimaryHover,backgroundOpacity:1},hoverFocus:{backgroundColor:e.colorPrimaryHover,backgroundOpacity:1,borderColor:e.colorTextLightSolid,borderWidth:e.lineWidth,borderOpacity:1},selected:{backgroundColor:e.colorPrimaryActive,backgroundOpacity:1,borderColor:e.colorTextLightSolid},allSelected:{backgroundColor:e.colorPrimaryActive,backgroundOpacity:1,borderColor:e.colorTextLightSolid},rowCellBrushSelected:{backgroundColor:e.colorPrimaryActive,backgroundOpacity:1},colCellBrushSelected:{backgroundColor:e.colorPrimaryActive,backgroundOpacity:1},dataCellBrushSelected:{backgroundColor:e.colorPrimaryActive,backgroundOpacity:1},unselected:{backgroundOpacity:.3,textOpacity:.3,opacity:.3},prepareSelect:{borderColor:e.colorTextLightSolid,borderWidth:e.lineWidth,borderOpacity:1},searchResult:{backgroundColor:e.colorInfo,backgroundOpacity:1},highlight:{backgroundColor:e.colorWarning,backgroundOpacity:1}},a={line:{point:{fill:e.colorPrimary,opacity:1},linkLine:{fill:e.colorPrimary,opacity:.6}},bar:{fill:e.colorPrimary,opacity:1},bullet:{comparativeMeasure:{fill:e.colorText,opacity:.25},rangeColors:{good:e.colorSuccess,satisfactory:e.colorWarning,bad:e.colorError},backgroundColor:e.colorFillSecondary},interval:{fill:e.colorPrimary}};return{name:t,palette:he({...ki(t),brandColor:e.colorPrimary}),theme:{...Object.fromEntries(Nr.map(t=>{const d=Mr.has(t),c=d?o:i;return[t,{cell:{backgroundColor:d?e.colorPrimary:e.colorBgContainer,crossBackgroundColor:d?e.colorPrimary:e.colorBgContainer,backgroundColorOpacity:1,horizontalBorderColor:d?e.colorPrimaryBorder:e.colorBorderSecondary,horizontalBorderColorOpacity:1,horizontalBorderWidth:e.lineWidth,verticalBorderColor:d?e.colorPrimaryBorder:e.colorBorderSecondary,verticalBorderColorOpacity:1,verticalBorderWidth:e.lineWidth,borderDash:[],padding:{top:e.paddingSM,right:e.paddingSM,bottom:e.paddingSM,left:e.paddingSM},interactionState:d?l:r},text:c,bolderText:d?n:s,seriesText:c,measureText:c,minorText:{...c,fill:d?e.colorTextLightSolid:e.colorTextSecondary},derivedMeasureText:{mainUp:e.colorError,mainDown:e.colorSuccess,minorUp:e.colorError,minorDown:e.colorSuccess},icon:{fill:d?e.colorTextLightSolid:e.colorTextSecondary},...Dr.has(t)?{miniChart:a}:{}}]})),background:{color:e.colorBgContainer,opacity:1},resizeArea:{background:e.colorBgContainer,backgroundOpacity:0,guideLineColor:e.colorPrimary,guideLineDisableColor:e.colorTextDisabled,interactionState:{hover:{backgroundColor:e.colorPrimary,backgroundOpacity:1}}},scrollBar:{trackColor:e.colorFillQuaternary,thumbColor:e.colorFillSecondary,thumbHoverColor:e.colorFill},splitLine:{horizontalBorderColor:e.colorBorderSecondary,horizontalBorderColorOpacity:1,verticalBorderColor:e.colorBorderSecondary,verticalBorderColorOpacity:1,showShadow:!0,shadowColors:{left:e.colorSplit,right:"rgba(0,0,0,0)"}},prepareSelectMask:{backgroundColor:e.colorPrimaryBg,backgroundOpacity:.3,borderColor:e.colorPrimary,borderWidth:e.lineWidth,borderOpacity:1},empty:{icon:{fill:e.colorTextDisabled},description:{fill:e.colorTextSecondary,fontFamily:e.fontFamily,fontSize:e.fontSizeSM,opacity:1}},preview:{overlay:{backgroundColor:e.colorBgMask},mediaContainer:{backgroundColor:e.colorBgElevated,border:`${e.lineWidth}px ${e.lineType} ${e.colorBorderSecondary}`,borderRadius:`${e.borderRadiusLG}px`,boxShadow:e.boxShadowSecondary}}}}})(e):(r=e.fontFamily,{name:t.name,theme:Object.fromEntries(Nr.map(e=>[e,Object.fromEntries(Br.map(e=>[e,{fontFamily:r}]))]))});var r;const l=gr()({},n,t);o&&(l.name=Hr(e));const a=i??(o?e.colorPrimary:void 0);if(a&&!t.palette){const e=l.name&&Ar.has(l.name)?l.name:s;l.palette=he({...ki(e),brandColor:a})}return l},Fr=(e,t)=>(0,Cr.qF)(ur()(e),t),Pr=(e,t,i={},s)=>{const o=((e={},t)=>(0,Cr.qF)(ur()(e),t))(i,s);return"strategy"===e?Er(Fr(t,s),o):"gridAnalysis"===e?gr()({},o,{dataCell:(e,t)=>new kr(e,t),showDefaultHeaderActionIcon:!1,style:{colCell:{hideValue:!0}}}):o},jr=(e,t)=>{if(!e)return{enabled:!1,width:!1,height:!1};if(!0===e)return{enabled:!0,width:!0,height:!1};const i=(0,Cr.qF)(e,t);return{enabled:!0,width:i.width??!0,height:i.height??!0,getContainer:i.getContainer}},Wr=(e,t)=>{const i=t.getContainer?.();return i instanceof HTMLElement?i:e},Gr=(e,t)=>"number"==typeof e&&Number.isFinite(e)&&e>0?e:Math.max(t,1),Vr=(e,t,i,s,o,n)=>{const r=Pr(e,t,i,s),l=jr(n,s),a=Wr(o,l);return{...r,width:l.width?Math.max(a.clientWidth,1):Gr(r.width,o.clientWidth),height:l.height?Math.max(a.clientHeight,1):Gr(r.height,o.clientHeight)}},$r=e=>{if(!e||"object"!=typeof e||Array.isArray(e))return;const t=Object.entries(e).filter(([e,t])=>!e.startsWith("$$")&&void 0!==t);return t.length?Object.fromEntries(t):void 0},Ur=e=>{if(!e)return;const t=e.getMeta(),i={cellType:e.cellType,rowIndex:t.rowIndex,colIndex:t.colIndex,field:t.valueField??t.field,value:t.fieldValue??t.value,label:e.getActualText(),rowQuery:$r(t.rowQuery),colQuery:$r(t.colQuery),isTotals:t.isTotals};return Object.fromEntries(Object.entries(i).filter(([,e])=>void 0!==e))},Yr=(e,t)=>{const i=t?.target;if(!i)return;const s=e.getCell(i);return Ur(s)},Xr=e=>({value:(0,mr.xE)(e),timestamp:Date.now()}),Zr=e=>{const{hashId:t,token:i}=lr.A.useToken(),{id:s,className:o,style:l,tabIndex:a,role:d,dir:c,lang:h,hidden:u,children:p,dataCfg:g,options:v={},events:f,adaptive:C,loading:y=!1,sheetType:w="pivot",themeCfg:x=Ir,themeColor:_,eventData:S,selectionState:b,sortState:E,filterState:L,loading_state:T,setProps:O,...R}=e,I=(0,n.useRef)(null),N=(0,n.useRef)(null),[B,A]=(0,n.useState)(),M=(0,n.useRef)(g),D=(0,n.useRef)(v),H=(0,n.useRef)(C),k=(0,n.useRef)(O),z=(0,n.useRef)(i),F=(0,n.useRef)("default"),P=(0,n.useRef)(null),{emit:j,emitLazy:W,getOptions:G}=(0,vr.i)("s2",f,O),V=(0,n.useRef)(j),$=(0,n.useRef)(null),U=(0,n.useRef)(null),Y=(0,n.useRef)(null),X=Hr(i);z.current=i,F.current=X,V.current=j,P.current||(P.current={...Rr,get token(){return z.current},get theme(){return F.current},normalizeCell:Ur,emit(e,t){V.current(e,"interaction",(0,mr.xE)(t))}});const Z=P.current,q=(0,n.useMemo)(()=>"gridAnalysis"===w?gr()({},zr(i,x,_),(e=>({theme:{dataCell:{text:{textAlign:"left"},bolderText:{textAlign:"left",fontWeight:e.fontWeightStrong},minorText:{textAlign:"left",fill:e.colorTextSecondary},derivedMeasureText:{mainUp:e.colorError,mainDown:e.colorSuccess,minorUp:e.colorError,minorDown:e.colorSuccess}}}}))(i)):zr(i,x,_),[i,x,_,w]),K=(0,n.useRef)(q);K.current=q;const J=(0,yr.$)({sheetType:w}),Q=(0,yr.$)({hashId:t,themeCfg:q}),ee=(0,yr.$)(g),te=(0,yr.$)(v),ie=(0,yr.$)(C);M.current=g,D.current=v,H.current=C,k.current=O;const se=(0,n.useMemo)(()=>Object.fromEntries(Object.entries(R).filter(([e,t])=>(e.startsWith("data-")||e.startsWith("aria-"))&&null!=t)),[R]);(0,n.useEffect)(()=>{const e=I.current;if(!e)return;const t=new("table"===w?tr:rr)(e,Fr(M.current,Z),Vr(w,M.current,D.current,Z,e,H.current));N.current=t,A(t),t.setThemeCfg(Tr(K.current,e)),Y.current=K.current;const i=()=>{t.destroyed||(t.measureText.cache.clear?.(),t.setThemeCfg(Tr(K.current,e)),t.render(!0).catch(e=>console.error(`S2${s?` "${s}"`:""} failed to update fonts.`,e)))},o=e.ownerDocument.fonts;o.addEventListener("loadingdone",i);const n=()=>{j("cell:pointerleave","pointer")};return t.on(m.GLOBAL_CLICK,e=>{W("cell:click","pointer",()=>{const i=Yr(t,e);return i?{cell:i}:void 0})}),t.on(m.GLOBAL_DOUBLE_CLICK,e=>{W("cell:doubleClick","pointer",()=>{const i=Yr(t,e);return i?{cell:i}:void 0})}),t.on(m.GLOBAL_HOVER,e=>{W("cell:hover","pointer",()=>{const i=Yr(t,e);return i?{cell:i}:void 0})}),t.on(m.GLOBAL_SELECTED,e=>{const t=e.map(Ur).filter(e=>void 0!==e),i=Math.max(0,Math.floor(G("selection:change")?.maxItems??500)),s={cells:t.slice(0,i),count:t.length,truncated:t.length>i,timestamp:Date.now()};k.current?.({selectionState:s}),j("selection:change","selection",s)}),t.on(m.GLOBAL_RESET,()=>{k.current?.({selectionState:null}),j("selection:reset","selection",{cells:[],count:0,truncated:!1})}),t.on(m.RANGE_SORT,e=>{const t=Xr(e);k.current?.({sortState:t}),j("range:sort","sort",{operation:t.value})}),t.on(m.RANGE_FILTER,e=>{const t=Xr(e);k.current?.({filterState:t}),j("range:filter","filter",{operation:t.value})}),e.addEventListener("pointerleave",n),$.current=M.current,U.current=D.current,t.render().catch(e=>console.error(`S2${s?` "${s}"`:""} failed to render.`,e)),()=>{o.removeEventListener("loadingdone",i),e.removeEventListener("pointerleave",n),t.destroy(),N.current===t&&(N.current=null,A(void 0))}},[j,W,Z,G,s,J,w]),(0,wr.w)(()=>{const e=I.current;if(!e)return null;const t=jr(H.current,Z);return t.enabled&&(t.width||t.height)?Wr(e,t):null},()=>{const e=N.current,t=I.current;if(!e||!t||e.destroyed)return;const i=jr(H.current,Z),o=Wr(t,i),n=Pr(w,M.current,D.current,Z),r=i.width?Math.max(o.clientWidth,1):Gr(n.width,t.clientWidth),l=i.height?Math.max(o.clientHeight,1):Gr(n.height,t.clientHeight);r===e.options.width&&l===e.options.height||(e.changeSheetSize(r,l),e.render(!1).catch(e=>console.error(`S2${s?` "${s}"`:""} failed to resize.`,e)))},[ie,Z,s,J,w]),(0,n.useEffect)(()=>{const e=N.current,t=I.current,i=K.current;e&&!e.destroyed&&t&&!cr()(Y.current,i)&&(e.setThemeCfg(Tr(i,t)),e.render(!0).then(()=>{Y.current=i}).catch(e=>console.error(`S2${s?` "${s}"`:""} failed to update theme.`,e)))},[t,Q,s]),(0,n.useEffect)(()=>{const e=N.current;if(e&&!e.destroyed&&!cr()($.current,M.current)){if(e.setDataCfg(Fr(M.current,Z),!0),"strategy"===w){const t=I.current;e.setOptions({...t?Vr(w,M.current,D.current,Z,t,H.current):{}},!0)}e.render({reloadData:!0}).then(()=>{$.current=M.current}).catch(e=>console.error(`S2${s?` "${s}"`:""} failed to update data.`,e))}},[ee,Z,s,w]),(0,n.useEffect)(()=>{const e=N.current;if(!e||e.destroyed||cr()(U.current,D.current))return;const t=I.current;e.setOptions({...t?Vr(w,M.current,D.current,Z,t,H.current):{}},!0),e.render().then(()=>{U.current=D.current}).catch(e=>console.error(`S2${s?` "${s}"`:""} failed to update options.`,e))},[te,Z,s,w]);const oe=l?.height??v?.height??450,ne={width:"100%",backgroundColor:i.colorBgContainer,color:i.colorText,...l};return delete ne.height,r().createElement(Or.A.Provider,{value:B},r().createElement("div",{...se,id:s,className:o,style:ne,tabIndex:a,role:d,dir:c,lang:h,hidden:u,"data-dac-sheet-theme":q.name??X,"data-dash-is-loading":(0,fr.A_)(T)||void 0},p,r().createElement(ar.A,{spinning:y,classNames:{root:"dac-s2-loading"}},r().createElement("div",{ref:I,style:{width:"100%",height:oe}}))))},qr=e=>r().createElement(Zr,{...e})},"./src/components/fragments/async/extensions/SheetExport.tsx"(e,t,i){"use strict";i.r(t),i.d(t,{default:()=>x});var s=i("react"),o=i.n(s),n=i("./node_modules/.pnpm/tslib@2.8.1/node_modules/tslib/tslib.es6.mjs"),r=i("./node_modules/.pnpm/@ant-design+icons@6.3.4_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@ant-design/icons/es/icons/MoreOutlined.js"),l=i("./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/common/i18n/index.js"),a=i("./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/common/constant/classnames.js"),d=i("./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/utils/export/copy/core.js"),c=i("./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/utils/export/utils.js"),h=i("./node_modules/.pnpm/antd@6.6.8_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/dropdown/index.js"),u=i("./node_modules/.pnpm/antd@6.6.8_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/button/index.js"),p=i("./node_modules/.pnpm/classnames@2.5.1/node_modules/classnames/index.js"),g=i.n(p);const m=o().memo(e=>{const{className:t,children:i,async:s=!0,copyOriginalText:p=(0,l.Ru)("复制原始数据"),copyFormatText:m=(0,l.Ru)("复制格式化数据"),downloadOriginalText:v=(0,l.Ru)("下载原始数据"),downloadFormatText:f=(0,l.Ru)("下载格式化数据"),sheetInstance:C,fileName:y="sheet",dropdown:w,customCopyMethod:x,onCopyError:_,onCopySuccess:S,onDownloadSuccess:b,onDownloadError:E}=e,L=(0,n.Tt)(e,["className","children","async","copyOriginalText","copyFormatText","downloadOriginalText","downloadFormatText","sheetInstance","fileName","dropdown","customCopyMethod","onCopyError","onCopySuccess","onDownloadSuccess","onDownloadError"]),T=`${a.u}-export`,O=(e,t,i)=>(0,n.sH)(void 0,void 0,void 0,function*(){const o={sheetInstance:C,split:e,formatOptions:t,async:s};return yield(null==x?void 0:x(o))||(null==i?void 0:i(o))}),R=e=>(0,n.sH)(void 0,void 0,void 0,function*(){const t=yield((e,t)=>(0,n.sH)(void 0,void 0,void 0,function*(){return yield O(e,t,d.mc)}))("\t",e);(0,c.lW)(t,s).then(()=>{null==S||S(t)}).catch(e=>{console.error("copy failed: ",e),null==_||_(e)})}),I=e=>(0,n.sH)(void 0,void 0,void 0,function*(){const t=yield((e,t)=>(0,n.sH)(void 0,void 0,void 0,function*(){return yield O(e,t,d.Wg)}))(",",e);try{(0,c.RG)(t,y),null==b||b(t)}catch(e){console.error("download failed: ",e),null==E||E(e)}});return o().createElement(o().Fragment,null,o().createElement(h.A,Object.assign({menu:{items:[{key:"copyOriginal",label:p,onClick:()=>{R(!1)}},{key:"copyFormat",label:m,onClick:()=>{R(!0)}},{key:"downloadOriginal",label:v,onClick:()=>{I(!1)}},{key:"downloadFormat",label:f,onClick:()=>{I(!0)}}]},trigger:["click"],className:g()(T,t)},L,w),i||o().createElement(u.A,{type:"text"},o().createElement(r.A,null))))});m.displayName="Export";i("./node_modules/.pnpm/@antv+s2-react-components@2.1.2_@ant-design+icons@6.3.4_react-dom@18.3.1_react@18.3.1___3e381e9efa4b10f7e6ec22fb55733008/node_modules/@antv/s2-react-components/dist/s2-react-components.min.css");var v=i("./node_modules/.pnpm/antd@6.6.8_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/config-provider/index.js"),f=i("./src/locales/extensionLocale.ts"),C=i("./src/utils/dash3.ts"),y=i("./src/components/fragments/sheet/context.ts");const w=e=>{const t=(0,s.useContext)(y.A),{locale:i}=(0,s.useContext)(v.Ay.ConfigContext),n=(0,s.useMemo)(()=>(0,f.m)(i?.locale).s2Export,[i?.locale]),{id:r,className:l,style:a,children:d,copyOriginalText:c=n.copyOriginalText,copyFormatText:h=n.copyFormatText,downloadOriginalText:u=n.downloadOriginalText,downloadFormatText:p=n.downloadFormatText,fileName:g,asyncExport:w,dropdown:x,loading_state:_,setProps:S,tabIndex:b,role:E,dir:L,lang:T,hidden:O,...R}=e,I=Object.fromEntries(Object.entries(R).filter(([e,t])=>(e.startsWith("data-")||e.startsWith("aria-"))&&null!=t));return o().createElement("span",{...I,id:r,className:l,style:a,tabIndex:b,role:E,dir:L,lang:T,hidden:O,"data-dash-is-loading":(0,C.A_)(_)||void 0},t?o().createElement(m,{sheetInstance:t,copyOriginalText:c,copyFormatText:h,downloadOriginalText:u,downloadFormatText:p,fileName:g,async:w,dropdown:x},d):d)},x=e=>o().createElement(w,{...e})},"./src/components/fragments/async/extensions/SheetSwitcher.tsx"(e,t,i){"use strict";i.r(t),i.d(t,{default:()=>ie});i("./node_modules/.pnpm/@antv+s2-react-components@2.1.2_@ant-design+icons@6.3.4_react-dom@18.3.1_react@18.3.1___3e381e9efa4b10f7e6ec22fb55733008/node_modules/@antv/s2-react-components/dist/s2-react-components.min.css");var s=i("./node_modules/.pnpm/antd@6.6.8_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/theme/index.js"),o=i("./node_modules/.pnpm/antd@6.6.8_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/config-provider/index.js"),n=i("react"),r=i.n(n),l=i("./src/utils/dash3.ts"),a=i("./node_modules/.pnpm/@ant-design+icons@6.3.4_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@ant-design/icons/es/icons/ReloadOutlined.js"),d=i("./node_modules/.pnpm/@ant-design+icons@6.3.4_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@ant-design/icons/es/icons/SwapOutlined.js"),c=i("./node_modules/.pnpm/@dnd-kit+react@0.5.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@dnd-kit/react/index.js"),h=i("./node_modules/.pnpm/@dnd-kit+react@0.5.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@dnd-kit/react/sortable.js"),u=i("./node_modules/.pnpm/antd@6.6.8_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/checkbox/index.js"),p=i("./node_modules/.pnpm/antd@6.6.8_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/button/index.js"),g=i("./node_modules/.pnpm/antd@6.6.8_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/popover/index.js"),m=i("./node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/isEqual.js"),v=i.n(m),f=i("./node_modules/.pnpm/antd@6.6.8_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/tooltip/index.js"),C=i("./node_modules/.pnpm/classnames@2.5.1/node_modules/classnames/index.js"),y=i.n(C),w=i("./node_modules/.pnpm/tslib@2.8.1/node_modules/tslib/tslib.es6.mjs"),x=i("./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/common/i18n/index.js"),_=i("./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/common/constant/classnames.js");var S=i("./node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/lodash.js");function b(e){return r().createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",width:12,height:12,className:"antv-s2-icon"},e),r().createElement("g",{fill:"currentColor",fillRule:"nonzero"},r().createElement("path",{d:"M4.457 11.229h6.772V3.77H4.457zm-.686 0V3.77h-3v7.543h3zM11.23 3V.771H.77V3zM12 0v12H0V0z"}),r().createElement("path",{d:"M.771.771H11.23V3H.77z"})))}function E(e){return r().createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",width:12,height:12,className:"antv-s2-icon"},e),r().createElement("g",{fill:"currentColor",fillRule:"evenodd"},r().createElement("path",{d:"M.771 3.771h3v1.886h-3zm0 2.572h3V8.57h-3zM.771 9h3v2.229h-3z"}),r().createElement("path",{d:"M.771 9v2.229H11.23V3.77H.77v1.886h3V3.771h.772v7.543H3.77V9.086h-3zm0-.771h3V6.343h-3zM11.23 3V.771H.77V3zM12 0v12H0V0z"})))}function L(e){return r().createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",width:12,height:12,className:"antv-s2-icon"},e),r().createElement("g",{fill:"currentColor",fillRule:"evenodd"},r().createElement("path",{d:"M4.229 3.771h7v8h-7z"}),r().createElement("path",{d:"M4.457 11.229h6.772V3.77H4.457zm-.686 0V3.77h-3v7.543h3zM11.23 3V.771H.77V3zM12 0v12H0V0z"})))}var T,O;!function(e){e.Rows="rows",e.Cols="columns",e.Values="values"}(T||(T={})),function(e){e.Dimensions="dimensions",e.Measures="measures",e.Rows="rows",e.Cols="cols"}(O||(O={}));const R=[T.Rows,T.Cols,T.Values],I=(...e)=>((...e)=>`${_.u}-${e.join("-")}`)("switcher",...e),N=e=>I("content","table"===e?"one-dimension":"three-dimensions"),B=(e,t)=>"table"===e||t===T.Values,A=(e=[],t,i,s)=>{const o=Object.assign({},e.find(e=>e.id===(null!=s?s:i)));return s?o.children=(0,S.map)(o.children,e=>Object.assign(Object.assign({},e),{checked:e.id===i?t:e.checked})):(o.checked=t,o.children=(0,S.map)(o.children,e=>Object.assign(Object.assign({},e),{checked:t}))),e.map(e=>e.id===o.id?o:e)},M="item",D=e=>{const{dragHandleProps:t,fieldType:i,id:s,displayName:o,selectable:n,checked:l=!0,parentId:a,className:d,disabled:c=!1,onVisibleItemChange:h}=e,p=r().useRef(null),[g,m]=r().useState(!1);r().useEffect(()=>{var e,t;m((null===(e=p.current)||void 0===e?void 0:e.offsetWidth)<(null===(t=p.current)||void 0===t?void 0:t.scrollWidth))},[]);const v=null!=o?o:s;return r().createElement("div",Object.assign({},t,{className:y()(I(M),d,{unchecked:!l})}),n&&r().createElement(u.A,{disabled:c,checked:l,onChange:e=>null==h?void 0:h(i,e.target.checked,s,a)}),g?r().createElement(f.A,{title:v,placement:"bottomRight",overlayClassName:I("tooltip")},r().createElement("div",{className:I(M,"text"),ref:p},v)):r().createElement("div",{className:I(M,"text"),ref:p},v))},H=(...e)=>e.flatMap(e=>"string"==typeof e?[e]:e?Object.entries(e).filter(([,e])=>e).map(([e])=>e):[]).join(" "),k=(e,t)=>{const i=e?.toLowerCase().startsWith("en");return{expand:["展开子项","Expand children"],title:["行列切换","Switch rows and columns"],reset:["恢复默认","Reset"],cancel:["取消","Cancel"],submit:["确定","OK"]}[t][i?1:0]},z=r().memo(({fieldType:e,item:{id:t,displayName:i,checked:s=!0,children:o=[]},expandable:n,expandChildren:l,isDragDisabled:a,selectable:d,index:c,droppableType:u,draggingItemId:p,onVisibleItemChange:g,dragPortalStyle:m})=>{const[v,f]=r().useState(null),{isDragging:C}=(0,h.g)({id:t,index:c,group:e,type:u,data:{fieldType:e},disabled:a,element:v});return r().createElement("div",{ref:f,style:C?m:void 0,className:H(I(d?"checkable-list":"normal-list"),{dragging:C,"disable-dragging":a})},r().createElement(D,{fieldType:e,id:t,displayName:i,checked:s,onVisibleItemChange:g,selectable:d,className:H(d?"checkable-item":"normal-item",{"item-collapse":!l})}),n&&l&&o.length>0&&p!==t&&r().createElement("div",{className:"child-items"},o.map(i=>r().createElement(D,{key:i.id,id:i.id,fieldType:e,displayName:i.displayName,disabled:!s,checked:i.checked,parentId:t,selectable:d,onVisibleItemChange:g,className:"checkable-item"}))))});z.displayName="PatchedDimensionItem";const F=r().memo(e=>{const{fieldType:t,crossRows:i=!1,selectable:s=!1,expandable:o=!1,expandText:n,locale:l,allowEmpty:a=!0,items:d=[],droppableType:h,text:p,icon:g,dragPortalStyle:m,...v}=e,[f,C]=r().useState(!0),[y,w]=r().useState(null),{isDropTarget:x}=(0,c.zM)({id:`s2-switcher-${t}`,type:h,data:{fieldType:t},element:y});if(!(()=>{const[e,t]=r().useState(!1);return r().useEffect(()=>{const e=requestAnimationFrame(()=>t(!0));return()=>cancelAnimationFrame(e)},[]),e})())return null;const _=!a&&1===d.length;return r().createElement("div",{className:H(I("dimension"),{"long-dimension":i})},r().createElement("div",{className:I("dimension","header")},r().createElement("div",{className:"title"},r().createElement(g,null)," ",r().createElement("span",null,p)),o&&r().createElement("div",{className:"expand-option"},r().createElement(u.A,{checked:f,onChange:e=>C(e.target.checked)},n??k(l,"expand")))),r().createElement("div",{ref:w,className:H(I("dimension","items"),{[I("dimension","items-highlight")]:x,[I("dimension","long-items")]:i})},d.map((e,i)=>r().createElement(z,{...v,key:e.id,index:i,fieldType:t,item:e,droppableType:h,dragPortalStyle:m,expandable:o,expandChildren:f,selectable:s,isDragDisabled:_}))))});F.displayName="PatchedDimension";const P=({innerContentClassName:e,contentTitleText:t,resetText:i,locale:s,allowExchangeHeader:o=!0,onToggleVisible:n,onSubmit:l,sheetType:d="pivot",dragPortalStyle:h,...u})=>{const g=(0,S.mapValues)(u,"items");const[m,f]=r().useState(g),[C,y]=r().useState(null),_=((e=!0)=>({[T.Rows]:{text:(0,x.Ru)("行头"),icon:E,droppableType:e?O.Dimensions:O.Rows},[T.Cols]:{text:(0,x.Ru)("列头"),icon:b,droppableType:e?O.Dimensions:O.Cols},[T.Values]:{text:(0,x.Ru)("值"),icon:L,droppableType:O.Measures}}))(o);return r().createElement(c.XU,{onDragStart:e=>{y(e.operation.source?String(e.operation.source.id):null)},onDragEnd:e=>{if(y(null),e.canceled)return;const t=e.operation.source,i=e.operation.target,s=t?.initialGroup??t?.group,o=i?.group??i?.data?.fieldType,n=t?.initialIndex??t?.index;s&&o&&void 0!==n&&f(e=>{const t=[...e[s]??[]],r=s===o?t:[...e[o]??[]],[l]=t.splice(n,1);if(!l)return e;const a=Math.min(i?.index??r.length,r.length);return r.splice(a,0,l),{...e,[s]:t,[o]:r}})}},r().createElement("div",{className:H(e,I("content"))},r().createElement("header",{className:I("content","header")},t??k(s,"title")),r().createElement("main",{className:H(I("content","main"),N(d))},R.filter(e=>"table"!==d||e===T.Cols).map(e=>r().createElement(F,{...u[e],..._[e],locale:s,key:e,fieldType:e,items:m[e],crossRows:B(d,e),draggingItemId:C,dragPortalStyle:h,onVisibleItemChange:(e,t,i,s)=>f(o=>({...o,[e]:A(o[e],t,i,s)}))}))),r().createElement("footer",{className:I("content","footer")},r().createElement(p.A,{type:"text",icon:r().createElement(a.A,null),className:I("content","footer","reset-button"),disabled:v()(g,m),onClick:()=>f(g)},i??k(s,"reset")),r().createElement("div",{className:I("content","footer","actions")},r().createElement(p.A,{className:"action-button",onClick:n},k(s,"cancel")),r().createElement(p.A,{className:"action-button",type:"primary",disabled:v()(g,m),onClick:()=>{n(),l?.((e=>{const t=(e=[])=>{const t=(e=[])=>(0,S.flatten)((0,S.map)(e,e=>{var{children:i}=e,s=(0,w.Tt)(e,["children"]);return[Object.assign({},s),...t(i)]})),i=t(e);return{items:i,hideItems:(0,S.filter)(i,e=>!1===e.checked)}};return{[T.Rows]:t(e[T.Rows]),[T.Cols]:t(e[T.Cols]),[T.Values]:t(e[T.Values])}})(m))}},k(s,"submit"))))))},j=({title:e,icon:t,popover:i,disabled:s,children:o,dragPortalStyle:n,locale:l,...a})=>{const[c,h]=r().useState(!1);return r().createElement(g.A,{trigger:"click",placement:"bottomLeft",destroyOnHidden:!0,...i,open:!s&&c,onOpenChange:e=>h(e),content:r().createElement(P,{...a,locale:l,dragPortalStyle:n,onToggleVisible:()=>h(!1)})},o||r().createElement(p.A,{className:I("entry-button"),size:"small",disabled:s,icon:t||r().createElement(d.A,{rotate:90})},e||k(l,"title")))};var W=i("./node_modules/.pnpm/style-loader@3.3.4_webpack@5.108.4/node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"),G=i.n(W),V=i("./node_modules/.pnpm/style-loader@3.3.4_webpack@5.108.4/node_modules/style-loader/dist/runtime/styleDomAPI.js"),$=i.n(V),U=i("./node_modules/.pnpm/style-loader@3.3.4_webpack@5.108.4/node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js"),Y=i.n(U),X=i("./node_modules/.pnpm/style-loader@3.3.4_webpack@5.108.4/node_modules/style-loader/dist/runtime/insertStyleElement.js"),Z=i.n(X),q=i("./node_modules/.pnpm/style-loader@3.3.4_webpack@5.108.4/node_modules/style-loader/dist/runtime/styleTagTransform.js"),K=i.n(q),J=i("./node_modules/.pnpm/css-loader@6.11.0_webpack@5.108.4/node_modules/css-loader/dist/cjs.js!./src/components/fragments/SheetSwitcher.css"),Q={};Q.styleTagTransform=K(),Q.setAttributes=Y(),Q.insert=function(e){const t=document.querySelector("head"),i=window._lastElementInsertedByStyleLoader;i?i.nextSibling?t.insertBefore(e,i.nextSibling):t.appendChild(e):t.insertBefore(e,t.firstChild),window._lastElementInsertedByStyleLoader=e},Q.domAPI=$(),Q.insertStyleElement=Z();G()(J.A,Q);const ee=({id:e,displayName:t,checked:i})=>({id:e,...void 0===t?{}:{displayName:t},...void 0===i?{}:{checked:i}}),te=({items:e=[],hideItems:t=[]}={})=>{const i=new Set(t.map(({id:e})=>e));return e.filter(({id:e})=>!i.has(e)).map(({id:e})=>e)},ie=e=>{const{token:t}=s.A.useToken(),{locale:i}=(0,n.useContext)(o.Ay.ConfigContext),{id:a,className:d,style:c,children:h,rows:u,columns:p,values:g,sheetType:m="pivot",title:v,icon:f,popover:C,disabled:y,contentTitleText:w,resetText:x,innerContentClassName:_,allowExchangeHeader:S=!0,result:b,fields:E,n_submit:L=0,loading_state:T,setProps:O,tabIndex:R,role:I,dir:N,lang:B,hidden:A,...M}=e,D=Object.fromEntries(Object.entries(M).filter(([e,t])=>(e.startsWith("data-")||e.startsWith("aria-"))&&null!=t)),H={"--antv-s2-container-background":t.colorBgElevated,"--antv-s2-block-background":t.colorFillTertiary,"--antv-s2-border":t.colorBorderSecondary,"--antv-s2-font-25":t.colorTextDisabled,"--antv-s2-font-65":t.colorTextSecondary,"--antv-s2-font-70":t.colorText,"--antv-s2-tooltip-background":t.colorBgSpotlight,color:t.colorText},k={...C,classNames:{...C?.classNames,root:["antv-s2-switcher-overlay","dac-s2-switcher-overlay",C?.classNames?.root].filter(Boolean).join(" ")},styles:{...C?.styles,root:{...H,...C?.styles?.root}}};return r().createElement("span",{...D,id:a,className:d,style:c,tabIndex:R,role:I,dir:N,lang:B,hidden:A,"data-dash-is-loading":(0,l.A_)(T)||void 0},r().createElement(j,{rows:u,columns:p,values:g,sheetType:m,title:v,icon:f,popover:k,dragPortalStyle:H,disabled:y,contentTitleText:w,resetText:x,locale:i?.locale,innerContentClassName:_,allowExchangeHeader:S,onSubmit:e=>{const t=(e=>{const t=({items:e=[],hideItems:t=[]}={})=>({items:e.map(ee),hideItems:t.map(ee)});return{rows:t(e.rows),columns:t(e.columns),values:t(e.values)}})(e);var i;O?.({result:t,fields:(i=t,{rows:te(i.rows),columns:te(i.columns),values:te(i.values)}),n_submit:L+1})}},h))}},"./src/components/fragments/sheet/context.ts"(e,t,i){"use strict";var s=i("react");const o=i.n(s)().createContext(void 0);i.d(t,["A",0,o])},"./src/utils/jsxRuntime.ts"(e,t,i){"use strict";var s=i("react"),o=i.n(s);const n=(e,t,i)=>o().createElement(e,void 0===i?t:{...t,key:i}),r=(e,t,i)=>{const{children:s,...n}=t??{};return void 0!==i&&(n.key=i),Array.isArray(s)?o().createElement(e,n,...s):o().createElement(e,n,s)},l=o().Fragment;i.d(t,["FD",0,r,"FK",0,l,"Y",0,n])},"./node_modules/.pnpm/classnames@2.5.1/node_modules/classnames/index.js"(e,t){var i;!function(){"use strict";var s={}.hasOwnProperty;function o(){for(var e="",t=0;t<arguments.length;t++){var i=arguments[t];i&&(e=r(e,n(i)))}return e}function n(e){if("string"==typeof e||"number"==typeof e)return e;if("object"!=typeof e)return"";if(Array.isArray(e))return o.apply(null,e);if(e.toString!==Object.prototype.toString&&!e.toString.toString().includes("[native code]"))return e.toString();var t="";for(var i in e)s.call(e,i)&&e[i]&&(t=r(t,i));return t}function r(e,t){return t?e?e+" "+t:e+t:e}e.exports?(o.default=o,e.exports=o):void 0===(i=function(){return o}.apply(t,[]))||(e.exports=i)}()},"./node_modules/.pnpm/throttle-debounce@5.0.2/node_modules/throttle-debounce/esm/index.js"(e,t,i){"use strict";function s(e,t,i){var s=(i||{}).atBegin;return function(e,t,i){var s,o=i||{},n=o.noTrailing,r=void 0!==n&&n,l=o.noLeading,a=void 0!==l&&l,d=o.debounceMode,c=void 0===d?void 0:d,h=!1,u=0;function p(){s&&clearTimeout(s)}function g(){for(var i=arguments.length,o=new Array(i),n=0;n<i;n++)o[n]=arguments[n];var l=this,d=Date.now()-u;function g(){u=Date.now(),t.apply(l,o)}function m(){s=void 0}h||(a||!c||s||g(),p(),void 0===c&&d>e?a?(u=Date.now(),r||(s=setTimeout(c?m:g,e))):g():!0!==r&&(s=setTimeout(c?m:g,void 0===c?e-d:e)))}return g.cancel=function(e){var t=(e||{}).upcomingOnly,i=void 0!==t&&t;p(),h=!i},g}(e,t,{debounceMode:!1!==(void 0!==s&&s)})}i.d(t,{s:()=>s})}}]);
1
+ (self.webpackChunkdash_antd_components=self.webpackChunkdash_antd_components||[]).push([["async-sheet"],{"./node_modules/.pnpm/@ant-design+icons@6.3.4_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@ant-design/icons/es/icons/MoreOutlined.js"(e,t,i){"use strict";i.d(t,{A:()=>l});var s=i("react");const o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M456 231a56 56 0 10112 0 56 56 0 10-112 0zm0 280a56 56 0 10112 0 56 56 0 10-112 0zm0 280a56 56 0 10112 0 56 56 0 10-112 0z"}}]},name:"more",theme:"outlined"};var n=i("./node_modules/.pnpm/@ant-design+icons@6.3.4_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@ant-design/icons/es/components/AntdIconLight.js");function r(){return r=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(e[s]=i[s])}return e},r.apply(this,arguments)}const l=s.forwardRef((e,t)=>s.createElement(n.A,r({},e,{ref:t,icon:o})))},"./node_modules/.pnpm/@ant-design+icons@6.3.4_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@ant-design/icons/es/icons/ReloadOutlined.js"(e,t,i){"use strict";i.d(t,{A:()=>l});var s=i("react");const o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M909.1 209.3l-56.4 44.1C775.8 155.1 656.2 92 521.9 92 290 92 102.3 279.5 102 511.5 101.7 743.7 289.8 932 521.9 932c181.3 0 335.8-115 394.6-276.1 1.5-4.2-.7-8.9-4.9-10.3l-56.7-19.5a8 8 0 00-10.1 4.8c-1.8 5-3.8 10-5.9 14.9-17.3 41-42.1 77.8-73.7 109.4A344.77 344.77 0 01655.9 829c-42.3 17.9-87.4 27-133.8 27-46.5 0-91.5-9.1-133.8-27A341.5 341.5 0 01279 755.2a342.16 342.16 0 01-73.7-109.4c-17.9-42.4-27-87.4-27-133.9s9.1-91.5 27-133.9c17.3-41 42.1-77.8 73.7-109.4 31.6-31.6 68.4-56.4 109.3-73.8 42.3-17.9 87.4-27 133.8-27 46.5 0 91.5 9.1 133.8 27a341.5 341.5 0 01109.3 73.8c9.9 9.9 19.2 20.4 27.8 31.4l-60.2 47a8 8 0 003 14.1l175.6 43c5 1.2 9.9-2.6 9.9-7.7l.8-180.9c-.1-6.6-7.8-10.3-13-6.2z"}}]},name:"reload",theme:"outlined"};var n=i("./node_modules/.pnpm/@ant-design+icons@6.3.4_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@ant-design/icons/es/components/AntdIconLight.js");function r(){return r=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(e[s]=i[s])}return e},r.apply(this,arguments)}const l=s.forwardRef((e,t)=>s.createElement(n.A,r({},e,{ref:t,icon:o})))},"./node_modules/.pnpm/@ant-design+icons@6.3.4_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@ant-design/icons/es/icons/SwapOutlined.js"(e,t,i){"use strict";i.d(t,{A:()=>l});var s=i("react");const o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M847.9 592H152c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h605.2L612.9 851c-4.1 5.2-.4 13 6.3 13h72.5c4.9 0 9.5-2.2 12.6-6.1l168.8-214.1c16.5-21 1.6-51.8-25.2-51.8zM872 356H266.8l144.3-183c4.1-5.2.4-13-6.3-13h-72.5c-4.9 0-9.5 2.2-12.6 6.1L150.9 380.2c-16.5 21-1.6 51.8 25.1 51.8h696c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8z"}}]},name:"swap",theme:"outlined"};var n=i("./node_modules/.pnpm/@ant-design+icons@6.3.4_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@ant-design/icons/es/components/AntdIconLight.js");function r(){return r=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(e[s]=i[s])}return e},r.apply(this,arguments)}const l=s.forwardRef((e,t)=>s.createElement(n.A,r({},e,{ref:t,icon:o})))},"./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/common/constant/basic.js"(e,t,i){"use strict";i.d(t,{Gp:()=>o});var s=i("./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/common/i18n/index.js");var o;!function(e){e.Line="line",e.Bar="bar",e.Bullet="bullet"}(o||(o={}));i.d(t,["Do",0,"colScrollGroup","E2",0,"colResizeAreaGroup","FS",0,"colFrozenTrailingGroup","G8",0,"rowIndexFrozenTrailingGroup","H",0,"mergedCellsGroup","Oe",0,"backGroundGroup","Pu",0,"frozenSplitLine","VC",0,"rowScrollGroup","YC",0,"rowHeaderFrozenGroup","YD",0,"horizontal-resize-area-","YJ",0,"cornerScrollGroup","Yq",0,()=>(0,s.Ru)("指标"),"Z0",0,"panelGroup","Zv",0,"rowIndexFrozenGroup","gN",0,"colFrozenGroup","j6",0,"rowIndexResizeAreaGroup","k5",0,"rowResizeAreaGroup","n7",0,"gridGroup","nO",0,"cornerResizeAreaGroup","qK",0,"emptyPlaceholderGroup","vO",0,"panelScrollGroup","wH",0,"rowIndexScrollGroup","x1",0,"rowHeaderFrozenTrailingGroup","xB",0,"foreGroundGroup","zw",0,()=>(0,s.Ru)("序号")])},"./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/common/constant/classnames.js"(e,t,i){"use strict";i.d(t,["u",0,"antv-s2"])},"./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/common/constant/field.js"(e,t,i){"use strict";i.d(t,["B7",0,"$$extra_column$$","GJ",0,"$$extra$$","IW",0,"$$empty_extra_placeholder$$","L4",0,"$$empty_field_value$$","SA",0,"$$undefined$$","YZ",0,"$$multi$$","Zb",0,"$$null$$","_O",0,"$$origin$$","jI",0,"$$total$$","nj",0,"$$value$$","r2",0,"$$series_number$$"])},"./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/common/constant/interaction.js"(e,t,i){"use strict";var s,o,n;i.d(t,{B4:()=>l,Dh:()=>h,Ri:()=>r,Wd:()=>u,eb:()=>c,fR:()=>d,oB:()=>s,vZ:()=>n,xT:()=>o}),function(e){e.CORNER_CELL_CLICK="cornerCellClick",e.DATA_CELL_CLICK="dataCellClick",e.ROW_CELL_CLICK="rowCellClick",e.COL_CELL_CLICK="colCellClick",e.MERGED_CELLS_CLICK="mergedCellsClick",e.ROW_COLUMN_CLICK="rowColumnClick",e.HEADER_CELL_LINK_CLICK="headerCellLinkClick",e.PREVIEW_CLICK="previewClick",e.HOVER="hover",e.DATA_CELL_BRUSH_SELECTION="dataCellBrushSelection",e.ROW_CELL_BRUSH_SELECTION="rowCellBrushSelection",e.COL_CELL_BRUSH_SELECTION="colCellBrushSelection",e.COL_ROW_RESIZE="rowColResize",e.DATA_CELL_MULTI_SELECTION="dataCellMultiSelection",e.ROW_CELL_MULTI_SELECTION="rowCellMultiSelection",e.COL_CELL_MULTI_SELECTION="colCellMultiSelection",e.RANGE_SELECTION="rangeSelection",e.SELECTED_CELL_MOVE="selectedCellMove",e.GLOBAL_RESET="globalReset"}(s||(s={})),function(e){e.ALL_SELECTED="allSelected",e.SELECTED="selected",e.ROW_CELL_BRUSH_SELECTED="rowCellBrushSelected",e.COL_CELL_BRUSH_SELECTED="colCellBrushSelected",e.DATA_CELL_BRUSH_SELECTED="dataCellBrushSelected",e.UNSELECTED="unselected",e.HOVER="hover",e.HOVER_FOCUS="hoverFocus",e.HIGHLIGHT="highlight",e.SEARCH_RESULT="searchResult",e.PREPARE_SELECT="prepareSelect"}(o||(o={})),function(e){e.DATA_CELL="dataCell",e.ROW_CELL="rowCell",e.COL_CELL="colCell",e.SERIES_NUMBER_CELL="seriesNumberCell",e.CORNER_CELL="cornerCell",e.MERGED_CELL="mergedCell"}(n||(n={}));var r,l,a,d;!function(e){e.CLICK="click",e.UN_DRAGGED="unDragged",e.DRAGGED="dragged"}(r||(r={})),function(e){e.SHIFT="Shift",e.COPY="c",e.ESC="Escape",e.META="Meta",e.CONTROL="Control",e.ARROW_UP="ArrowUp",e.ARROW_DOWN="ArrowDown",e.ARROW_LEFT="ArrowLeft",e.ARROW_RIGHT="ArrowRight"}(l||(l={})),function(e){e.ASC="ASC",e.DESC="DESC"}(a||(a={})),function(e){e.HOVER="hover",e.CLICK="click",e.DATA_CELL_BRUSH_SELECTION="dataCellBrushSelection",e.ROW_CELL_BRUSH_SELECTION="rowCellBrushSelection",e.COL_CELL_BRUSH_SELECTION="colCellBrushSelection",e.MULTI_SELECTION="multiSelection",e.RESIZE="resize"}(d||(d={}));var c,h,u;!function(e){e.CONTENT="content",e.CANVAS="canvas"}(c||(c={})),function(e){e.SCROLL_UP="scrollUp",e.SCROLL_DOWN="scrollDown",e.SCROLL_LEFT="scrollLeft",e.SCROLL_RIGHT="scrollRight"}(h||(h={})),function(e){e[e.SCROLL_UP=-1]="SCROLL_UP",e[e.SCROLL_DOWN=1]="SCROLL_DOWN"}(u||(u={}));i.d(t,["Ep",0,{textShape:["textOpacity"],textShapes:["textOpacity"],linkFieldShape:["opacity"],interactiveBgShape:["backgroundColor","backgroundOpacity"],interactiveBorderShape:["borderColor","borderOpacity","borderWidth"]},"hu",0,{x:{value:0,scroll:!1},y:{value:0,scroll:!1}},"lE",0,{textOpacity:"fillOpacity",backgroundOpacity:"fillOpacity",backgroundColor:"fill",borderOpacity:"strokeOpacity",borderColor:"stroke",borderWidth:"lineWidth",opacity:"opacity"},"sK",0,"interactionStateInfo"])},"./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/common/constant/query.js"(e,t,i){"use strict";var s;i.d(t,{B:()=>s}),function(e){e.All="all",e.DetailOnly="detailOnly"}(s||(s={}))},"./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/common/debug/index.js"(e,t,i){"use strict";i.d(t,{U:()=>s});class s{constructor(){this.debug=!1,this.debugCallback=(e,t)=>{if(this.debug){const i=performance.now();t();const s=performance.now();console.log(e,s-i+" ms")}else t()},this.logger=(e,...t)=>{this.debug&&console.log(e,...t)}}static getInstance(){return s.instance||(s.instance=new s),s.instance}setDebug(e){this.debug=e}}i.d(t,["jk",0,"Header Layout","uK",0,"Transform Data","v7",0,"Data Cell Render"])},"./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/common/i18n/index.js"(e,t,i){"use strict";i.d(t,{Ru:()=>l});var s=i("./node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/lodash.js");const o="zh_CN";let n=o,r={zh_CN:{小计:"小计",总计:"总计",总和:"(总和)",项:"项",已选择:"已选择",序号:"序号",度量:"度量",数值:"数值",共计:"共计",条:"条",趋势:"趋势",隐藏:"隐藏",组内升序:"组内升序",升序:"升序",降序:"降序",组内降序:"组内降序",不排序:"不排序",暂无数据:"暂无数据",",":","},en_US:{小计:"Total",总计:"Total",总和:"(SUM)",项:"items",已选择:"selected",序号:"Index",度量:"Measure",数值:"Measure",共计:"Total",条:"",隐藏:"Hide",组内升序:"Group ASC",组内降序:"Group DESC",升序:"ASC",降序:"DESC",不排序:"No order",暂无数据:"No Data",",":", "},ru_RU:{小计:"Промежуточный итог",总计:"Общий итог",总和:"(СУММА)",项:"элемент(-а/-ов)",已选择:"выбрано",序号:"Индекс",度量:"Мера",数值:"Численная величина",共计:"Общее количество",条:"",隐藏:"Скрыть",趋势:"Курс",组内升序:"Группировать по возрастанию",组内降序:"Группировать по убыванию",升序:"По возрастанию",降序:"По убыванию",不排序:"Не отсортировано",",":", "}};const l=(e,t=e)=>(0,s.get)(r,[n,e],t)},"./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/common/icons/factory.js"(e,t,i){"use strict";i.d(t,{s:()=>R,p:()=>O});var s={};i.r(s),i.d(s,{ArrowDown:()=>n,ArrowUp:()=>r,CellDown:()=>l,CellUp:()=>a,DrillDownIcon:()=>S,Empty:()=>E,ExpandColIcon:()=>m,EyeOutlined:()=>b,GlobalAsc:()=>d,GlobalDesc:()=>c,GroupAsc:()=>h,GroupDesc:()=>u,GroupNone:()=>p,InfoCircle:()=>g,Minus:()=>v,Play:()=>L,Plus:()=>f,SortDown:()=>y,SortDownSelected:()=>C,SortUp:()=>x,SortUpSelected:()=>w,Trend:()=>_});var o=i("./node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/lodash.js");const n='\n<svg width="10px" height="10px" viewBox="0 0 10 10" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n<g id="页面-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" font-family="Roboto, PingFangSC, Microsoft YaHei, Arial, sans-serif" font-size="12" font-weight="bold">\n <text id="↓" fill="none">\n <tspan x="-0.225097656" y="8.5">↓</tspan>\n </text>\n</g>\n</svg>',r='<svg width="10px" height="10px" viewBox="0 0 10 10" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n<g id="页面-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" font-family="Roboto, PingFangSC, Microsoft YaHei, Arial, sans-serif" font-size="12" font-weight="bold">\n <text id="↑" fill="none">\n <tspan x="-0.225097656" y="8.5">↑</tspan>\n </text>\n</g>\n</svg>\n',l='<?xml version="1.0" encoding="UTF-8"?>\n<svg width="7px" height="9px" viewBox="0 0 7 9" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n \x3c!-- Generator: Sketch 58 (84663) - https://sketch.com --\x3e\n <title>down</title>\n <desc>Created with Sketch.</desc>\n <g id="一期开发" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <polygon id="down" fill="none" transform="translate(3.500000, 4.500000) scale(1, -1) translate(-3.500000, -4.500000) " points="3.5 0 7 9 0 9"></polygon>\n </g>\n</svg>',a='<?xml version="1.0" encoding="UTF-8"?>\n<svg width="7px" height="9px" viewBox="0 0 7 9" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n \x3c!-- Generator: Sketch 58 (84663) - https://sketch.com --\x3e\n <title>up</title>\n <desc>Created with Sketch.</desc>\n <g id="一期开发" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <polygon id="up" fill="none" points="3.5 0 7 9 0 9"></polygon>\n </g>\n</svg> ',d='<svg t="1557124621626" class="icon" style="" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="17452" xmlns:xlink="http://www.w3.org/1999/xlink" width="14" height="14">\n<defs>\n <style type="text/css"></style>\n</defs>\n<path d="M182.272 167.04a8 8 0 0 0-12.544 0L57.728 309.056A8 8 0 0 0 64 321.984h76.032v530.048c0 4.352 3.584 7.936 7.936 7.936h56.064a8 8 0 0 0 7.936-7.936V321.92H288a8 8 0 0 0 6.272-12.992l-112-141.888z m209.728 626.944h176c4.416 0 8 3.584 8 8v56a8 8 0 0 1-8 8h-176A8 8 0 0 1 384 857.984v-56c0-4.416 3.584-8 8-8z m0-424h368c4.416 0 8 3.648 8 8v56a8 8 0 0 1-8 8h-368A8 8 0 0 1 384 433.984v-56c0-4.352 3.584-8 8-8z m528-139.968h-528A8 8 0 0 1 384 222.016v-56c0-4.416 3.584-8 8-8h528c4.416 0 8 3.584 8 8v56a8 8 0 0 1-8 8z m-256 424h-272A8 8 0 0 1 384 646.016v-56c0-4.416 3.584-8 8-8h272c4.416 0 8 3.584 8 8v56a8 8 0 0 1-8 8z" p-id="17453"></path>\n</svg>',c='<svg t="1557124685600" class="icon" style="" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="17561" xmlns:xlink="http://www.w3.org/1999/xlink" width="14" height="14">\n <defs>\n <style type="text/css"></style>\n </defs>\n <path d="M182.272 856.96a8 8 0 0 1-12.544 0l-112-141.952A8 8 0 0 1 64 702.08h76.032V172.032c0-4.416 3.584-8 7.936-8h56.064c4.352 0 7.936 3.584 7.936 8v529.984H288c6.72 0 10.496 7.808 6.272 12.992l-112 141.888z m209.728-626.944h176A8 8 0 0 0 576 222.016v-56a8 8 0 0 0-8-8h-176A8 8 0 0 0 384 166.016v56c0 4.416 3.584 8 8 8z m0 424h368a8 8 0 0 0 8-8v-56a8 8 0 0 0-8-8h-368A8 8 0 0 0 384 590.016v56c0 4.416 3.584 8 8 8z m528 139.968h-528a8 8 0 0 0-8 8v56c0 4.416 3.584 8 8 8h528a8 8 0 0 0 8-8v-56a8 8 0 0 0-8-8z m-256-424h-272A8 8 0 0 0 384 377.984v56c0 4.416 3.584 8 8 8h272a8 8 0 0 0 8-8v-56a8 8 0 0 0-8-8z" p-id="17562"></path>\n</svg>',h='<svg t="1557124695786" class="icon" style="" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="17670" xmlns:xlink="http://www.w3.org/1999/xlink" width="14" height="14">\n <defs>\n <style type="text/css"></style>\n </defs>\n <path d="M182.272 167.04a8 8 0 0 0-12.544 0L57.728 309.056A8 8 0 0 0 64 321.984h76.032v530.048c0 4.352 3.584 7.936 7.936 7.936h56.064a8 8 0 0 0 7.936-7.936V321.92H288a8 8 0 0 0 6.272-12.992l-112-141.888z m209.728 62.976h304A8 8 0 0 0 704 222.016v-56a8 8 0 0 0-8-8h-304A8 8 0 0 0 384 166.016v56c0 4.416 3.584 8 8 8z m0 424h304a8 8 0 0 0 8-8v-56a8 8 0 0 0-8-8h-304A8 8 0 0 0 384 590.016v56c0 4.416 3.584 8 8 8z m528 139.968h-528a8 8 0 0 0-8 8v56c0 4.416 3.584 8 8 8h528a8 8 0 0 0 8-8v-56a8 8 0 0 0-8-8z m0-424h-528A8 8 0 0 0 384 377.984v56c0 4.416 3.584 8 8 8h528a8 8 0 0 0 8-8v-56a8 8 0 0 0-8-8z" p-id="17671"></path>\n</svg>',u='<svg t="1557124710652" class="icon" style="" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="17779" xmlns:xlink="http://www.w3.org/1999/xlink" width="14" height="14">\n <defs>\n <style type="text/css"></style>\n </defs>\n <path d="M182.272 856.96a8 8 0 0 1-12.544 0l-112-141.952A8 8 0 0 1 64 702.08h76.032V172.032c0-4.416 3.584-8 7.936-8h56.064c4.352 0 7.936 3.584 7.936 8v529.984H288c6.72 0 10.496 7.808 6.272 12.992l-112 141.888z m209.728-626.944h304A8 8 0 0 0 704 222.016v-56a8 8 0 0 0-8-8h-304A8 8 0 0 0 384 166.016v56c0 4.416 3.584 8 8 8z m0 424h304a8 8 0 0 0 8-8v-56a8 8 0 0 0-8-8h-304A8 8 0 0 0 384 590.016v56c0 4.416 3.584 8 8 8z m528 139.968h-528a8 8 0 0 0-8 8v56c0 4.416 3.584 8 8 8h528a8 8 0 0 0 8-8v-56a8 8 0 0 0-8-8z m0-424h-528A8 8 0 0 0 384 377.984v56c0 4.416 3.584 8 8 8h528a8 8 0 0 0 8-8v-56a8 8 0 0 0-8-8z" p-id="17780"></path>\n</svg>',p='<svg width="16px" height="16px" viewBox="0 0 16 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n<g id="设计输出" stroke="none" stroke-width="1" fill-opacity="0.25" fill-rule="evenodd">\n <g id="设计输出-移动端指标详情页-阅读端" transform="translate(-3275.000000, -724.000000)" fill-rule="nonzero">\n <g id="编组-39" transform="translate(3064.500000, 667.000000)">\n <g id="编组-36" transform="translate(80.500000, 44.000000)">\n <g id="不排序" transform="translate(130.000000, 13.000000)">\n <path d="M12.0009375,12.40625 C12.0696875,12.40625 12.1259375,12.4625 12.1259375,12.53125 L12.1259375,12.53125 L12.1259375,13.40625 C12.1259375,13.475 12.0696875,13.53125 12.0009375,13.53125 L12.0009375,13.53125 L6.25093747,13.53125 C6.18218747,13.53125 6.12593747,13.475 6.12593747,13.40625 L6.12593747,13.40625 L6.12593747,12.53125 C6.12593747,12.4625 6.18218747,12.40625 6.25093747,12.40625 L6.25093747,12.40625 Z M2.93949997,2.5801875 L2.97437497,2.6109375 L4.72437497,4.828125 C4.78062497,4.89776786 4.74503823,4.99725765 4.66779698,5.02426203 L4.62593747,5.03125 L3.438,5.03089062 L3.43843747,10.9691406 L4.62593747,10.9691406 C4.73062497,10.9691406 4.78999997,11.0910156 4.72437497,11.1722656 L2.97437497,13.3894531 C2.92437497,13.4535156 2.82749997,13.4535156 2.77749997,13.3894531 L1.02749997,11.1722656 C0.961874969,11.0894531 1.02124997,10.9691406 1.12593747,10.9691406 L2.31343747,10.9691406 L2.313,5.03089062 L1.12593747,5.03125 C1.03620533,5.03125 0.979764,4.94285714 1.00679571,4.8654519 L1.02749997,4.828125 L2.77749997,2.6109375 C2.81749997,2.5596875 2.88749997,2.5494375 2.93949997,2.5801875 Z M10.5009375,9.09375 C10.5696875,9.09375 10.6259375,9.15 10.6259375,9.21875 L10.6259375,9.21875 L10.6259375,10.09375 C10.6259375,10.1625 10.5696875,10.21875 10.5009375,10.21875 L10.5009375,10.21875 L6.25093747,10.21875 C6.18218747,10.21875 6.12593747,10.1625 6.12593747,10.09375 L6.12593747,10.09375 L6.12593747,9.21875 C6.12593747,9.15 6.18218747,9.09375 6.25093747,9.09375 L6.25093747,9.09375 Z M14.5009375,5.78125 C14.5696875,5.78125 14.6259375,5.8375 14.6259375,5.90625 L14.6259375,5.90625 L14.6259375,6.78125 C14.6259375,6.85 14.5696875,6.90625 14.5009375,6.90625 L14.5009375,6.90625 L6.25093747,6.90625 C6.18218747,6.90625 6.12593747,6.85 6.12593747,6.78125 L6.12593747,6.78125 L6.12593747,5.90625 C6.12593747,5.8375 6.18218747,5.78125 6.25093747,5.78125 L6.25093747,5.78125 Z M9.00093747,2.46875 C9.06968747,2.46875 9.12593747,2.525 9.12593747,2.59375 L9.12593747,2.59375 L9.12593747,3.46875 C9.12593747,3.5375 9.06968747,3.59375 9.00093747,3.59375 L9.00093747,3.59375 L6.25093747,3.59375 C6.18218747,3.59375 6.12593747,3.5375 6.12593747,3.46875 L6.12593747,3.46875 L6.12593747,2.59375 C6.12593747,2.525 6.18218747,2.46875 6.25093747,2.46875 L6.25093747,2.46875 Z" id="形状结合"></path>\n </g>\n </g>\n </g>\n </g>q\n</g>\n</svg>',g='<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1590389330617" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="19656" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css"></style></defs><path d="M512 64c-247.4 0-448 200.6-448 448s200.6 448 448 448 448-200.6 448-448-200.6-448-448-448z m0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z" fill="" p-id="19657"></path><path d="M464 336c0 26.5 21.5 48 48 48s48-21.5 48-48-21.5-48-48-48-48 21.5-48 48zM536 448h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8v-272c0-4.4-3.6-8-8-8z" fill="" p-id="19658"></path></svg>',m='<?xml version="1.0" encoding="UTF-8"?>\n<svg width="23px" height="12px" viewBox="0 0 23 12" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>编组 8备份 3</title>\n <g id="----隐藏列标注!" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g id="隐藏列标注" transform="translate(-275.000000, -824.000000)">\n <rect fill="#FFFFFF" x="0" y="0" width="1333" height="1167"></rect>\n <g id="编组-8备份-3" transform="translate(275.000000, 824.000000)">\n <rect id="矩形" stroke-opacity="0.25" stroke="#000000" fill="#F7F7F7" x="0.5" y="0.5" width="11" height="11"></rect>\n <rect id="矩形备份-9" stroke-opacity="0.25" stroke="#000000" fill="#F7F7F7" x="11.5" y="0.5" width="11" height="11"></rect>\n <g id="7.Icon/arrow/15.down/fill" transform="translate(6.000000, 6.000000) rotate(90.000000) translate(-6.000000, -6.000000) " fill="#000000" fill-rule="nonzero" opacity="0.65">\n <path d="M7.25020811,6.37218077 L4.91348936,8.20968077 C4.82677061,8.27764952 4.69903624,8.21671202 4.69903624,8.10655577 L4.69903624,4.43272764 C4.69903624,4.32257139 4.82677061,4.26046202 4.91348936,4.32960264 L7.25020811,6.16593077 C7.31700499,6.21866514 7.31700499,6.31944639 7.25020811,6.37218077 Z" id="fill" transform="translate(5.999671, 6.269385) rotate(90.000000) translate(-5.999671, -6.269385) "></path>\n </g>\n <g id="7.Icon/arrow/15.down/fill" transform="translate(17.000000, 6.000000) rotate(270.000000) translate(-17.000000, -6.000000) translate(11.000000, 0.000000)" fill="#000000" fill-rule="nonzero" opacity="0.65">\n <path d="M7.25020811,6.37218077 L4.91348936,8.20968077 C4.82677061,8.27764952 4.69903624,8.21671202 4.69903624,8.10655577 L4.69903624,4.43272764 C4.69903624,4.32257139 4.82677061,4.26046202 4.91348936,4.32960264 L7.25020811,6.16593077 C7.31700499,6.21866514 7.31700499,6.31944639 7.25020811,6.37218077 Z" id="fill" transform="translate(5.999671, 6.269385) rotate(90.000000) translate(-5.999671, -6.269385) "></path>\n </g>\n </g>\n <line x1="286.5" y1="813" x2="286.5" y2="864.5" id="路径-2备份-3" stroke="#000000" opacity="0.25"></line>\n </g>\n </g>\n</svg>',v='<svg t="1557140120188" class="icon" style="" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="16909" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200">\n\t<defs>\n\t\t<style type="text/css">\n\t\t</style>\n\t</defs>\n\t<path d="M328 544h368c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8z"\n\tp-id="16910">\n\t</path>\n\t<path d="M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32z m-40 728H184V184h656v656z"\n\tp-id="16911">\n\t</path>\n</svg>',f='<svg t="1557140186692" class="icon" style="" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="17025" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200">\n\t<defs>\n\t\t<style type="text/css">\n\t\t</style>\n\t</defs>\n\t<path d="M328 544h152v152c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V544h152c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H544V328c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v152H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8z"\n\tp-id="17026">\n\t</path>\n\t<path d="M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32z m-40 728H184V184h656v656z"\n\tp-id="17027">\n\t</path>\n</svg>',C='<svg t="1565940955886" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="17472" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200">\n <defs>\n <style type="text/css"></style>\n </defs>\n <path\n d="M948 392.992l-403.008 488.99200001Q532 896 512.992 896t-32-14.016L76 392.992q-18.016-20.992-7.008-46.016T108 321.98400001L916 321.98400001q28 0 39.008 24.99199999T948 392.992z"\n p-id="17473" data-spm-anchor-id="a313x.7781069.0.i2" class="selected"></path>\n</svg>\n',y='<svg t="1565940955886" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="17472" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200">\n <defs>\n <style type="text/css"></style>\n </defs>\n <path\n fill-opacity="0.45"\n d="M948 392.992l-403.008 488.99200001Q532 896 512.992 896t-32-14.016L76 392.992q-18.016-20.992-7.008-46.016T108 321.98400001L916 321.98400001q28 0 39.008 24.99199999T948 392.992z"\n p-id="17473" data-spm-anchor-id="a313x.7781069.0.i2" class="selected"></path>\n</svg>\n',w='<svg t="1565940979768" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="17620" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200">\n<defs>\n<style type="text/css"></style>\n</defs>\n<path\nd="M76 631.008l403.008-488.99200001Q492 128 511.008 128t32 14.016L948 631.008q18.016 20.992 7.008 46.016T916 702.01599999L108 702.01599999q-28 0-39.008-24.99199999T76 631.008z"\np-id="17621"></path>\n</svg>\n',x='<svg t="1565940979768" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="17620" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200">\n <defs>\n <style type="text/css"></style>\n </defs>\n <path\n fill-opacity="0.45"\n d="M76 631.008l403.008-488.99200001Q492 128 511.008 128t32 14.016L948 631.008q18.016 20.992 7.008 46.016T916 702.01599999L108 702.01599999q-28 0-39.008-24.99199999T76 631.008z"\n p-id="17621"></path>\n</svg>\n',_='<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1596433821690" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="20229" width="16" height="16" xmlns:xlink="http://www.w3.org/1999/xlink"><defs><style type="text/css"></style></defs><path d="M888 792H200V168c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v688c0 4.4 3.6 8 8 8h752c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM305.8 637.7c3.1 3.1 8.1 3.1 11.3 0l138.3-137.6L583 628.5c3.1 3.1 8.2 3.1 11.3 0l275.4-275.3c3.1-3.1 3.1-8.2 0-11.3l-39.6-39.6c-3.1-3.1-8.2-3.1-11.3 0l-230 229.9L461.4 404c-3.1-3.1-8.2-3.1-11.3 0L266.3 586.7c-3.1 3.1-3.1 8.2 0 11.3l39.5 39.7z" p-id="20230"></path></svg>',S='<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1608030723688" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="21482" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16"><defs><style type="text/css"></style></defs><path d="M547.648 696a32 32 0 0 1 31.488 26.24l0.512 5.76v151.68l145.216-144.512a32 32 0 0 1 40.832-3.648l4.416 3.712a32 32 0 0 1 3.584 40.832l-3.712 4.48-203.072 202.24a32 32 0 0 1-40.768 3.648l-4.416-3.712-202.24-202.24a32 32 0 0 1 40.832-48.96l4.416 3.712 150.912 150.912v-158.144a32 32 0 0 1 32-32z m194.56-529.28l4.928 3.072 233.792 180.224a32 32 0 0 1 1.728 49.28l-4.864 3.52-409.792 245.568a32 32 0 0 1-27.328 2.624l-5.184-2.432-422.4-245.568a32 32 0 0 1-7.552-49.28l4.544-4.032 242.816-180.288a32 32 0 0 1 42.432 47.552l-4.288 3.84-203.84 151.296 364.16 211.648 353.28-211.712-196.608-151.552a32 32 0 0 1-8.896-40l3.136-4.864a32 32 0 0 1 40-8.96zM547.712 28.672a32 32 0 0 1 31.488 26.24l0.512 5.76v396.992a32 32 0 0 1-63.488 5.76l-0.512-5.76V60.736a32 32 0 0 1 32-32z" p-id="21483" fill="currentColor"></path></svg>\n',b='<svg viewBox="64 64 896 896" focusable="false" data-icon="eye" width="1em" height="1em" fill="currentColor" aria-hidden="true"><path d="M942.2 486.2C847.4 286.5 704.1 186 512 186c-192.2 0-335.4 100.5-430.2 300.3a60.3 60.3 0 000 51.5C176.6 737.5 319.9 838 512 838c192.2 0 335.4-100.5 430.2-300.3 7.7-16.2 7.7-35 0-51.5zM512 766c-161.3 0-279.4-81.8-362.7-254C232.6 339.8 350.7 258 512 258c161.3 0 279.4 81.8 362.7 254C791.5 684.2 673.4 766 512 766zm-4-430c-97.2 0-176 78.8-176 176s78.8 176 176 176 176-78.8 176-176-78.8-176-176-176zm0 288c-61.9 0-112-50.1-112-112s50.1-112 112-112 112 50.1 112 112-50.1 112-112 112z"></path></svg>',E='<svg width="64" height="41" viewBox="0 0 64 41" xmlns="http://www.w3.org/2000/svg"><g transform="translate(0 1)" fill="none" fill-rule="evenodd"><ellipse fill="#f5f5f5" cx="32" cy="33" rx="32" ry="7"></ellipse><g fill-rule="nonzero" stroke="#d9d9d9"><path d="M55 12.76L44.854 1.258C44.367.474 43.656 0 42.907 0H21.093c-.749 0-1.46.474-1.947 1.257L9 12.761V22h46v-9.24z"></path><path d="M41.613 15.931c0-1.605.994-2.93 2.227-2.931H55v18.137C55 33.26 53.68 35 52.05 35h-40.1C10.32 35 9 33.259 9 31.137V13h11.16c1.233 0 2.227 1.323 2.227 2.928v.022c0 1.605 1.005 2.901 2.237 2.901h14.752c1.232 0 2.237-1.308 2.237-2.913v-.007z" fill="#fafafa"></path></g></g></svg>',L='<svg class="icon" viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="200" height="200"><path d="M0 0h1024v1024H0z" fill="#000000" opacity=".01" p-id="5072"></path><path d="M520 128C736.496 128 912 303.504 912 520S736.496 912 520 912C303.6 911.76 128.24 736.4 128 520 128 303.504 303.504 128 520 128z m0 60.288c-183.12 0.192-331.52 148.592-331.712 331.712 0 183.2 148.496 331.712 331.712 331.712 183.2 0 331.712-148.512 331.712-331.712S703.2 188.288 520 188.288z m-84.528 176.576l233.776 155.264-233.76 155.024V364.864z" fill="#A8ADBB" p-id="5073"></path></svg>',T={},O=(e,t)=>{T[(0,o.lowerCase)(e)]=t},R=e=>T[(0,o.lowerCase)(e)];(0,o.keys)(s).forEach(e=>{const t=(0,o.get)(s,e);O(e,t)})},"./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/common/icons/gui-icon.js"(e,t,i){"use strict";i.d(t,{r:()=>p});var s=i("./node_modules/.pnpm/@antv+g@6.3.3/node_modules/@antv/g/dist/index.esm.js"),o=i("./node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/lodash.js"),n=i("./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/engine/CustomImage.js"),r=i("./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/utils/g-utils.js"),l=i("./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/common/debug/index.js"),a=i("./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/common/icons/factory.js");const d="<svg",c="data:image/svg+xml",h={},u={};class p extends s.YJ{constructor(e){super({name:e.name}),this.iconPathShapes=[],this.usePathMode=!1,this.isOnlineLink=e=>/^(?:https?:)?(?:\/\/)/.test(e),this.cfg=e,this.render()}getCfg(){return this.cfg}tryRenderAsPath(e,t){const i=(0,a.s)(e);if(!i)return!1;if(i.includes(c)||this.isOnlineLink(i))return!1;const o=e;let n=u[o];if(!n){const e=function(e){if(/transform|translate|scale|rotate|<g|<rect|<circle|<ellipse|<line|<polyline|<polygon|<text|<tspan/i.test(e))return null;const t=e.match(/viewBox=["']([^"']+)["']/);if(!t)return null;const i=t[1].split(/\s+/).map(Number);if(i.length<4)return null;const s={width:i[2],height:i[3]},o=e.replace(/[\r\n]+/g," ");let n=[];const r=o.match(/\bd="[^"]+"/g);if(r&&(n=r.map(e=>e.slice(3,-1))),0===n.length){const e=o.match(/\bd='[^']+'/g);e&&(n=e.map(e=>e.slice(3,-1)))}return 0===n.length?null:{viewBox:s,paths:n}}(i);e&&(n=e,u[o]=e)}if(!n)return!1;const{x:r=0,y:l=0,width:d,height:h,cursor:p}=this.cfg,g="number"==typeof d?d:0,m="number"==typeof h?h:0,v=g/n.viewBox.width,f=m/n.viewBox.height;this.iconPathShapes.forEach(e=>{this.removeChild(e),e.destroy()}),this.iconPathShapes=[];const C=new s.rw({style:{x:"number"==typeof r?r:0,y:"number"==typeof l?l:0,width:g,height:m,fill:"transparent",cursor:p||"default"}});this.appendChild(C),this.iconPathShapes.push(C);for(const e of n.paths){const i=new s.wA({style:{d:e,fill:t||"#000",transformOrigin:"0 0",transform:`translate(${r}, ${l}) scale(${v}, ${f})`,cursor:p||"default",pointerEvents:"none"}});this.appendChild(i),this.iconPathShapes.push(i)}return!0}getImage(e,t,i){return new Promise((s,o)=>{let n=(0,a.s)(e);if(!n)return;const r=new Image;if(r.onload=()=>{h[t]=r,s(r)},r.onerror=o,n&&(n.includes(c)||this.isOnlineLink(n)))r.src=n,r.crossOrigin="anonymous";else{i&&(n=n.replace(/fill=[\'\"]\#?\w+[\'\"]/g,""),n=n.replace(/fill>/g,">")),n=n.replace(d,`${d} fill="${i}"`);const e=new Blob([n],{type:"image/svg+xml"}),t=URL.createObjectURL(e),s=r.onload;r.onload=e=>{URL.revokeObjectURL(t),null==s||s.call(r,e)};const o=r.onerror;r.onerror=e=>{URL.revokeObjectURL(t),"function"==typeof o&&o.call(r,e)},r.src=t}})}render(){const{name:e,fill:t,iconStrategy:i}=this.cfg;if("path"===i&&this.tryRenderAsPath(e,t))return void(this.usePathMode=!0);this.usePathMode=!1;const s=(0,o.clone)(this.cfg),r=new n.$(p.type,{style:(0,o.omit)(s,["fill","iconStrategy"])});this.iconImageShape=r,this.setImageAttrs({name:e,fill:t})}reRender(e){this.name=e.name,this.cfg=e;const{name:t,fill:i,iconStrategy:s}=this.cfg;if(this.usePathMode&&(this.iconPathShapes.forEach(e=>{this.removeChild(e),e.destroy()}),this.iconPathShapes=[]),"path"===s&&this.tryRenderAsPath(t,i))return void(this.usePathMode=!0);this.usePathMode=!1;const l=(0,o.clone)(this.cfg);this.iconImageShape?(this.iconImageShape.imgType=p.type,(0,r.w)(this.iconImageShape,(0,o.omit)(l,["fill","iconStrategy"]))):this.iconImageShape=new n.$(p.type,{style:(0,o.omit)(l,["fill","iconStrategy"])}),this.setImageAttrs({name:t,fill:i})}updatePosition(e){if(this.usePathMode){const{width:t,height:i}=this.cfg,s=u[this.cfg.name];if(s){const o=("number"==typeof t?t:0)/s.viewBox.width,n=("number"==typeof i?i:0)/s.viewBox.height;this.iconPathShapes.forEach(t=>{t.style.transform=`translate(${e.x}, ${e.y}) scale(${o}, ${n})`})}}else this.iconImageShape&&(0,r.w)(this.iconImageShape,e)}setImageAttrs(e){if(this.usePathMode){const t=e.fill||this.cfg.fill||"#000";return void this.iconPathShapes.slice(1).forEach(e=>{e.style.fill=t})}let{name:t,fill:i}=e;const{iconImageShape:s}=this;if(!s)return;t=t||this.cfg.name,i=i||this.cfg.fill;const o=`${t}-${i}`,n=h[o];n?(s.attr("src",n),this.appendChild(s)):this.getImage(t,o,i).then(e=>{this.destroyed?l.U.getInstance().logger(`GuiIcon ${t} destroyed.`):(s.attr("src",e),this.appendChild(s))}).catch(e=>{e instanceof TypeError?console.warn(`GuiIcon ${t} destroyed:`,e):console.error(`GuiIcon ${t} load failed:`,e)})}toggleVisibility(e){const t=e?"visible":"hidden";this.setAttribute("visibility",t),this.usePathMode?this.iconPathShapes.forEach(e=>{e.style.visibility=t}):this.iconImageShape&&this.iconImageShape.setAttribute("visibility",t)}}p.type="__GUI_ICON__"},"./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/common/interface/basic.js"(e,t,i){"use strict";var s,o,n;i.d(t,{F4:()=>n,Ok:()=>o,cV:()=>s}),function(e){e.TOP="TOP",e.BOTTOM="BOTTOM",e.LEFT="LEFT",e.RIGHT="RIGHT"}(s||(s={})),function(e){e.BORDER_BOX="borderBox",e.PADDING_BOX="paddingBox",e.CONTENT_BOX="contentBox"}(o||(o={})),function(e){e.SUM="SUM",e.MIN="MIN",e.MAX="MAX",e.AVG="AVG",e.COUNT="COUNT"}(n||(n={}))},"./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/common/interface/export.js"(e,t,i){"use strict";var s;i.d(t,{q:()=>s}),function(e){e.PLAIN="text/plain",e.HTML="text/html"}(s||(s={}))},"./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/common/interface/node.js"(e,t,i){"use strict";var s;i.d(t,{Q:()=>s}),function(e){e.Row="row",e.Col="col",e.Series="series"}(s||(s={}))},"./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/engine/CustomImage.js"(e,t,i){"use strict";i.d(t,{$:()=>o});var s=i("./node_modules/.pnpm/@antv+g@6.3.3/node_modules/@antv/g/dist/index.esm.js");class o extends s._V{constructor(e,t){super(t),this.imgType=e}}},"./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/utils/cell/cell.js"(e,t,i){"use strict";var s=i("./node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/lodash.js"),o=i("./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/common/interface/basic.js"),n=i("./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/utils/cell/header-cell.js");i.d(t,["Bh",0,(e,t,i,s)=>{const o=(i-e)/2;switch(s){case"top":return t+o;case"middle":return t-e/2;default:return t-o-e}},"Cb",0,e=>{const{bbox:t,textWidth:i,textAlign:s,groupedIcons:o,iconStyle:r,isCustomRenderer:l=!1}=e,{x:a,width:d}=t,c=(0,n.kZ)(o.left,r),h=(0,n.kZ)(o.right,r);let u,p,g;switch(s){case"left":p=a,u=a+c,g=u+i+(h&&r.margin.left);break;case"right":u=a+d-h-(l?i:0),p=u-(l?0:i)-c,g=a+d-h+(h&&r.margin.left);break;default:p=a+d/2-(c+i+h)/2,u=p+c+(l?0:i/2),g=p+c+i+(h&&r.margin.left)}return{textX:u,leftIconX:p,rightIconX:g}},"f9",0,(e,t,i,s)=>{if(s===o.Ok.BORDER_BOX)return e;let{x:n,y:r,width:l,height:a}=e;const{padding:d,horizontalBorderWidth:c=0,verticalBorderWidth:h=0}=i;return t.forEach(e=>{const t=[o.cV.BOTTOM,o.cV.TOP].includes(e)?c:h;switch(e){case o.cV.TOP:r+=t,a-=t;break;case o.cV.BOTTOM:a-=t;break;case o.cV.LEFT:n+=t,l-=t;break;default:l-=t}}),s===o.Ok.CONTENT_BOX&&(n+=null==d?void 0:d.left,r+=null==d?void 0:d.top,l-=(null==d?void 0:d.left)+(null==d?void 0:d.right),a-=(null==d?void 0:d.top)+(null==d?void 0:d.bottom)),{x:n,y:r,width:l,height:a}},"l2",0,(e,t)=>{const{y:i,height:s}=e;switch(t){case"top":return i;case"middle":return i+s/2;default:return i+s}},"qi",0,(e,t,i)=>{const{x:n,y:r,width:l,height:a}=t||{},{horizontalBorderWidth:d=0,horizontalBorderColorOpacity:c,horizontalBorderColor:h,verticalBorderWidth:u=0,verticalBorderColor:p,verticalBorderColorOpacity:g,borderDash:m}=i||{},v=(0,s.isEmpty)(m)?"":m,f=[o.cV.TOP,o.cV.BOTTOM].includes(e)?{lineWidth:d,stroke:h,strokeOpacity:c,lineDash:v}:{lineWidth:u,stroke:p,strokeOpacity:g,lineDash:v};let C=0,y=0,w=0,x=0;if(e===o.cV.TOP||e===o.cV.BOTTOM){let t=r;t=e===o.cV.TOP?r+d/2:r+a-d/2,y=t,x=t,C=n,w=n+l}if(e===o.cV.LEFT||e===o.cV.RIGHT){let t=n;t=e===o.cV.LEFT?n+u/2:n+l-u/2,C=t,w=t,y=r,x=r+a}return{position:{x1:C,x2:w,y1:y,y2:x},style:f}}])},"./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/utils/cell/header-cell.js"(e,t,i){"use strict";var s=i("./node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/lodash.js"),o=i("./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/common/constant/field.js");const n=(e=[],t="right")=>e.map(e=>"string"==typeof e?{name:e,position:t}:e);i.d(t,["AS",0,(e=[],t,i)=>{const o=((e=[])=>e.map(e=>Object.assign(Object.assign({},e),{icons:n(e.icons)})))(e),r=(0,s.find)(o,e=>((e,t,i)=>{if(!e)return!1;const{icons:o,displayCondition:n,belongsCell:r}=e;return!(0,s.isEmpty)(o)&&r===i&&o.some(e=>{var i,s,o;return null===(o=null!==(s=null===(i=e.displayCondition)||void 0===i?void 0:i.call(e,t,e.name))&&void 0!==s?s:null==n?void 0:n(t,e.name))||void 0===o||o})})(e,t,i));if(!r)return;const l=r.icons.filter(e=>{var i,s,o,n;return null===(n=null!==(s=null===(i=e.displayCondition)||void 0===i?void 0:i.call(e,t,e.name))&&void 0!==s?s:null===(o=r.displayCondition)||void 0===o?void 0:o.call(r,t,e.name))||void 0===n||n});return Object.assign(Object.assign({},r),{icons:l})},"ar",0,(e,t)=>{const{value:i,field:n}=e;return(0,s.isEqual)(n,o.GJ)?{formattedValue:t||i,value:i}:{formattedValue:i,value:i}},"kZ",0,(e=[],t)=>{if((0,s.isEmpty)(e))return 0;const{margin:i,size:o}=t;return e.reduce((e,{position:t})=>e+o+("left"===t?i.right:i.left),0)},"y0",0,(e=[],t)=>{const i=(0,s.merge)({left:[],right:[]},(0,s.groupBy)(e,"position"));return t&&("left"===t.position?i.left.push(t):i.right.unshift(t)),i}])},"./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/utils/condition/condition.js"(e,t,i){"use strict";var s=i("./node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/lodash.js"),o=i("./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/utils/formatter.js");i.d(t,["NV",0,(e=[],t)=>(0,s.findLast)((0,s.compact)(e),e=>e.field instanceof RegExp?e.field.test(t):e.field===t),"dq",0,e=>{var t;return null!==(t=null==e?void 0:e.position)&&void 0!==t?t:"right"},"o1",0,(e=0,t=0)=>{if(e=(0,o.F)(e),t=(0,o.F)(t),e===t)return()=>({zeroScale:0,scale:0});const i=e>=0,n=t>=0&&e<=0,r=n?0:i?e:t,l=t-e;return t=>{const o=i?0:1;return{zeroScale:n?(0,s.clamp)(Math.abs(0-e)/l,0,1):o,scale:(0,s.clamp)((t-r)/l,-1,1)}}}])},"./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/utils/dataset/pivot-data-set.js"(e,t,i){"use strict";i.d(t,{$0:()=>S,AB:()=>m,Ir:()=>g,K0:()=>c,LR:()=>l,Ll:()=>v,Rl:()=>f,XN:()=>u,_K:()=>p,bh:()=>C,eE:()=>w,i9:()=>y,j0:()=>a,t$:()=>_,uQ:()=>d});var s=i("./node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/lodash.js"),o=i("./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/common/constant/field.js"),n=i("./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/common/constant/query.js"),r=i("./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/utils/layout/generate-id.js");function l(e=[]){return e.filter(e=>e!==o.GJ)}function a(e){return e===o.YZ}function d(e={},t=[],i=o.jI){return t.reduce((t,s)=>(t.push(s in e?(0,r.mN)(e[s]):i),t),[])}function c(e,t){const i=t.filter(t=>t in e);return(0,s.isEmpty)(i)&&i.push(o.IW),i}function h(e={},t=[],i){const s=[];function n(e,t,i){return t.reduce((t,s)=>(t.push(s in e?(0,r.mN)(e[s]):s===o.GJ&&i?i:o.jI),t),[])}return i?i.forEach(i=>{s.push(n(e,t,i))}):s.push(n(e,t)),s}function u(e,t=[],i){var s;const o=t.slice(0,t.indexOf(e)+1);return null===(s=i.map(e=>o.map(t=>e.getValueByField(t)).join("[&]")))||void 0===s?void 0:s.filter(Boolean)}function p(e,t){return e.concat(t).filter(e=>e!==o.GJ).join("[&]")}function g(e){const{rowDimensionValues:t,colDimensionValues:i,isFirstCreate:s,onFirstCreate:n,rowFields:l,colFields:d,rowPivotMeta:c,colPivotMeta:h,prefix:u=""}=e,p=(e,t,i,l)=>{let d=i;const c=[];for(let i=0;i<t.length;i++){const h=t[i];if(s&&d&&!(null==d?void 0:d.has(h))){const s=t.slice(0,i+1).map(e=>(0,r.mN)(e)),a=s.join("[&]");let c;c=h===o.jI?0:d.has(o.jI)?d.size:d.size+1,d.set(h,{id:a,dimensions:s,value:h,level:c,children:new Map}),null==n||n({dimension:null==e?void 0:e[i],dimensionPath:a,careRepeated:l})}const u=null==d?void 0:d.get(h);if(c.push(a(h)?h:null==u?void 0:u.level),u){const t=null==e?void 0:e[i+1];s&&u.childField!==t&&(u.childField=t),d=null==u?void 0:u.children}}return c};return[u,...p(l,t,c,!1),...p(d,i,h,!0)]}function m(e=[]){return e.filter(s.isString)}function v(e){const{rows:t=[],columns:i=[],values:o,valueInCols:n,data:r=[],indexesData:l={},sortedDimensionValues:a,rowPivotMeta:d,colPivotMeta:u,getExistValuesByDataItem:m}=e,v=[],f=new Set((0,s.intersection)(t,i)),C=({dimension:e,dimensionPath:t,careRepeated:i=!0})=>{i&&f.has(e)||(a[e]||(a[e]=[])).push(t)},y=p(t,i);return r.forEach(e=>{if(!e||(0,s.isEmpty)(e))return;const r=m?m(e,o):c(e,o),a=h(e,t,n?null:r),p=h(e,i,n?r:null);for(const o of a)for(const n of p){const r=g({rowDimensionValues:o,colDimensionValues:n,rowPivotMeta:d,colPivotMeta:u,rowFields:t,colFields:i,isFirstCreate:!0,onFirstCreate:C,prefix:y});v.push(r),(0,s.set)(l,r,e)}}),{paths:v,indexesData:l,rowPivotMeta:d,colPivotMeta:u,sortedDimensionValues:a}}function f(e,t){if(!e||!t)return;const i=t.split("[&]"),o=(0,s.last)(i);let n=e;(0,s.forEach)(i,(e,t)=>{const i=n.get(e);return i?(e===o?(i.children=new Map,i.childField=void 0):n=i.children,!0):0===t&&"root"===e})}function C(e,t,i){return{field:o.GJ,name:t||i,formatter:t=>(t=>{const i=(0,s.find)(e,({field:e})=>e===t);return(0,s.get)(i,"name",t)})(t)}}function y(e,t){return{isRowGrandTotal:e.isGrandTotals,isRowSubTotal:e.isSubTotals,isColGrandTotal:t.isGrandTotals,isColSubTotal:t.isSubTotals}}function w(e){const{pivotMeta:t,dimensionValues:i,fieldIdx:r,queryType:l,fields:d,sortedDimensionValues:c}=e;let h=[{children:t}];function u(e,t){var i;const r=(0,s.flatMap)(e,e=>{const t=[];for(const i of e.children.values())i.value===o.IW||l!==n.B.All&&i.value===o.jI||t.push(i);return t});if(e.length>1){const e=null!==(i=c[t])&&void 0!==i?i:[],s=new Map(e.map((e,t)=>[e,t]));return r.sort((e,t)=>{var i,o;return(null!==(i=s.get(e.id))&&void 0!==i?i:0)-(null!==(o=s.get(t.id))&&void 0!==o?o:0)}),r}return r}for(let e=0;e<=r;e++){const t=i[e],s=d[e];h=a(t)?u(h,s):h.map(e=>e.children.get(t)).filter(Boolean)}return h}function x(e){const{dimensionValues:t,pivotMeta:i,fields:o,sortedDimensionValues:r,queryType:l=n.B.All}=e;if(!function(e){let t=null;for(let i=0;i<e.length;i++)if(a(e[i]))t=i;else if(!(0,s.isNull)(t)&&t<i)return!0;return!1}(t))return[t];return w({pivotMeta:i,dimensionValues:t,fieldIdx:t.length-1,queryType:l,fields:o,sortedDimensionValues:r}).map(e=>e.dimensions)}function _(e){const{rowFields:t,rowDimensionValues:i,rowPivotMeta:s,colFields:o,colDimensionValues:n,colPivotMeta:r,queryType:l,sortedDimensionValues:a}=e;return{rowQueries:x({dimensionValues:i,pivotMeta:s,fields:t,sortedDimensionValues:a,queryType:l}),colQueries:x({dimensionValues:n,pivotMeta:r,fields:o,sortedDimensionValues:a,queryType:l})}}function S(e,t){return e?(0,s.isArray)(e)?(0,s.flatMap)(e,e=>{if(!(0,s.isArray)(e))return(0,s.compact)([e]);return(0,s.compact)(e.slice(t===n.B.DetailOnly?1:0))}):(0,s.compact)([e]):[]}},"./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/utils/export/copy/core.js"(e,t,i){"use strict";i.d(t,{mc:()=>A,Wg:()=>B,w6:()=>I});var s=i("./node_modules/.pnpm/tslib@2.8.1/node_modules/tslib/tslib.es6.mjs"),o=i("./node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/lodash.js"),n=i("./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/common/constant/interaction.js"),r=i("./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/common/interface/export.js"),l=i("./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/utils/export/method.js"),a=i("./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/utils/export/utils.js"),d=i("./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/common/constant/field.js"),c=i("./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/common/interface/node.js"),h=i("./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/utils/dataset/pivot-data-set.js"),u=i("./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/utils/ssr.js");const p=(e,t="\t")=>({type:r.q.PLAIN,content:(0,o.map)(e,e=>e.join(t)).join("\r\n")}),g=e=>{const t=(i="tr",e.map(e=>`<${i}>${function(e,t){return e.map(e=>`<${t}>${(0,o.escape)(e)}</${t}>`).join("")}(e,"td")}</${i}>`).join(""));var i;return{type:r.q.HTML,content:`<meta charset="utf-8"><table><tbody>${t}</tbody></table>`}},m={[r.q.PLAIN]:p,[r.q.HTML]:g},v=({rowMatrix:e,colMatrix:t,dataMatrix:i,cornerMatrix:s})=>{var n,r,l,a,d,c;const h=null!==(r=null===(n=null==e?void 0:e[0])||void 0===n?void 0:n.length)&&void 0!==r?r:0,u=null!==(l=null==t?void 0:t.length)&&void 0!==l?l:0,p=null!==(d=null===(a=i[0])||void 0===a?void 0:a.length)&&void 0!==d?d:0,g=null!==(c=i.length)&&void 0!==c?c:0,m=h+p,v=u||(h>0?1:0),f=v+g;let C=Array.from(Array(f),()=>new Array(m));return C=(0,o.map)(C,(n,r)=>(0,o.map)(n,(o,n)=>{var l,a;return n>=0&&n<h&&r>=0&&r<v?null!==(a=null===(l=null==s?void 0:s[r])||void 0===l?void 0:l[n])&&void 0!==a?a:"":n>=h&&n<=m&&r>=0&&r<u?t[r][n-h]:n>=0&&n<h&&r>=v&&r<f?null==e?void 0:e[r-v][n]:n>=h&&n<=m&&r>=v&&r<f?i[r-v][n-h]:void 0})),C};function f(e){var t;return null!==(t=(0,o.max)((0,o.map)(e,e=>e.length)))&&void 0!==t?t:0}function C({spreadsheet:{options:{interaction:e}},config:{formatOptions:t=!1,separator:i="\t",selectedCells:s=[],customTransformer:o,async:n=!1},isExport:l}){var a,d;const{copy:c}=e,{formatData:h,formatHeader:u}=l?(e=>{var t,i;return"object"==typeof e?{formatHeader:null!==(t=e.formatHeader)&&void 0!==t&&t,formatData:null!==(i=e.formatData)&&void 0!==i&&i}:{formatHeader:null!=e&&e,formatData:null!=e&&e}})(t):{formatData:null!==(a=null==c?void 0:c.withFormat)&&void 0!==a&&a,formatHeader:null!==(d=null==c?void 0:c.withFormat)&&void 0!==d&&d},p=function(e){if(!e)return m;const t=e(m);return{[r.q.PLAIN]:t[r.q.PLAIN]||m[r.q.PLAIN],[r.q.HTML]:t[r.q.HTML]||m[r.q.HTML]}}(l?o:null==c?void 0:c.customTransformer);return{separator:i,selectedCells:s,transformers:p,formatData:h,formatHeader:u,async:n}}const y=e=>{const t=[],i=e=>{var s,o,n;if("root"===e.id)return;const r=null===(n=null===(o=null===(s=e.spreadsheet)||void 0===s?void 0:s.dataSet)||void 0===o?void 0:o.getFieldFormatter)||void 0===n?void 0:n.call(o,e.field),l=e.isTotalRoot||!r?e.value:r(e.value);return t.unshift(l),(null==e?void 0:e.parent)?i(e.parent):void 0};return i(e),t},w=(e,t)=>{const{rowIndex:i,colIndex:s}=e,{facet:o}=t;return[o.getRowNodeByIndex(i),o.getColNodeByIndex(s)]},x={timeout:3e3};class _{initIdleCallbackCount(e){this.idleCallbackCount=e>=5e3?5e3:e}constructor(e){this.matrixHtmlTransformer=e=>this.config.transformers[r.q.HTML](e);const{spreadsheet:t,isExport:i=!1,config:s}=e;this.spreadsheet=t,this.config=C({config:s,spreadsheet:t,isExport:i})}getHeaderNodeMatrix(e){const{formatHeader:t}=this.config;return(0,l.iT)((0,l.eF)(e.id),e.spreadsheet,t)}matrixPlainTextTransformer(e,t){const i=(0,o.map)(e,e=>(0,o.map)(e,l.E0));return this.config.transformers[r.q.PLAIN](i,t)}matrixTransformer(e,t="\t"){return[this.matrixPlainTextTransformer(e,t),this.matrixHtmlTransformer(e)]}getFormatter(e){const{field:t,rowIndex:i,colIndex:s}=e;if(this.config.formatData){const e=this.spreadsheet.facet.getCellMeta(i,s);return i=>{const s=this.spreadsheet.dataSet.getFieldFormatter(t);return null==s?void 0:s(i,null==e?void 0:e.data,e)}}return e=>e}isEnableASync(){return!(0,u.fU)()&&this.config.async&&!!window.requestIdleCallback}}class S extends _{constructor(e){super(e),this.leafRowNodes=[],this.leafColNodes=[],this.compatibleHideMeasureColumn=()=>{var e,t,i,s;return(null===(i=null===(t=null===(e=this.spreadsheet.options)||void 0===e?void 0:e.style)||void 0===t?void 0:t.colCell)||void 0===i?void 0:i.hideValue)&&this.spreadsheet.isValueInCols()?{[d.GJ]:null===(s=this.spreadsheet.dataCfg.fields.values)||void 0===s?void 0:s[0]}:{}},this.getDataMatrixByHeaderNode=()=>{const e=this.compatibleHideMeasureColumn();return(0,o.map)(this.leafRowNodes,t=>this.leafColNodes.map(i=>this.getDataCellValue({rowNode:t,colNode:i,config:{measureQuery:e}})))},this.getDataMatrixByHeaderNodeRIC=()=>{const e=[];let t=0;const i=this.compatibleHideMeasureColumn();return new Promise((s,o)=>{try{const o=n=>{const r=this.leafRowNodes.length;for(this.initIdleCallbackCount(r);(n.timeRemaining()>0||n.didTimeout)&&t<=r-1&&this.idleCallbackCount>0;)for(let s=t;s<r&&this.idleCallbackCount>0;s++){const o=[],n=this.leafRowNodes[s];for(let e=0;e<this.leafColNodes.length;e++){const t=this.getDataCellValue({rowNode:n,colNode:this.leafColNodes[e],config:{measureQuery:i}});o.push(t)}t++,e.push(o),this.idleCallbackCount--}t===r?s(e):(this.initIdleCallbackCount(r),requestIdleCallback(o,x))};requestIdleCallback(o,x)}catch(e){o(e)}})},this.getDataCellValue=({rowNode:e,colNode:t,config:i})=>{var s;const{measureQuery:n}=i,r=Object.assign(Object.assign(Object.assign({},e.query),t.query),n),a=this.spreadsheet.dataSet.getCellData({query:r,rowNode:e,isTotals:e.isTotals||e.isTotalMeasure||t.isTotals||t.isTotalMeasure,totalStatus:(0,h.i9)(e,t)}),c=this.spreadsheet.isValueInCols()?t:e;let u=null!==(s=(0,l.Nk)(this.spreadsheet.isPivotMode,c))&&void 0!==s?s:"";const{values:p}=this.spreadsheet.dataCfg.fields;u=(null==p?void 0:p.includes(u))?u:null==p?void 0:p[0];const g=this.getFormatter({field:null!=u?u:t.field,rowIndex:e.rowIndex,colIndex:t.colIndex}),m=null==a?void 0:a[d.nj],v=(0,o.isPlainObject)(null==m?void 0:m.values)?"":m;return g(null!=v?v:"")},this.getCustomRowCornerMatrix=e=>{const t=f(null!=e?e:[]),i=this.spreadsheet.facet.getCornerNodes(),s=(0,o.sortBy)(i,e=>e.cornerType===c.Q.Col?0:1);return this.spreadsheet.isHierarchyTreeType()?(0,o.map)(s,e=>{const i=new Array(t).fill("");return i[t-1]=e.value,i}):Object.values((0,o.groupBy)(s,"y")).map(e=>[...new Array(t-e.length).fill(""),...e.map(e=>e.value)])},this.getFieldName=e=>this.config.formatHeader?this.spreadsheet.dataSet.getFieldName(e):this.spreadsheet.dataSet.getField(e),this.getCornerMatrix=e=>{if(this.spreadsheet.isCustomRowFields())return this.getCustomRowCornerMatrix(e);const{colsHierarchy:t}=this.spreadsheet.facet.getLayoutResult(),{fields:i}=this.spreadsheet.dataCfg,{columns:s=[],rows:n=[]}=i,r=this.spreadsheet.isCustomColumnFields()?t.getNodes().slice(0,t.sampleNodesForAllLevels.length).map(e=>e.field):[...s,""],l=this.spreadsheet.isHierarchyTreeType()?f(null!=e?e:[]):n.length,a=(0,o.slice)(n,0,l);return(0,o.map)(r,(e,t)=>(0,o.map)(a,(i,s)=>t===r.length-1?this.getFieldName(i):s===l-1?this.getFieldName(e):""))},this.getDataMatrixByDataCell=e=>{const{copy:t}=this.spreadsheet.options.interaction,i=this.compatibleHideMeasureColumn(),s=(0,o.map)(e,e=>(0,o.map)(e,e=>{const[t,s]=w(e,this.spreadsheet);return this.getDataCellValue({rowNode:t,colNode:s,config:{measureQuery:i}})}));if(!(null==t?void 0:t.withHeader))return this.matrixTransformer(s,this.config.separator);const n=this.getRowMatrix(),r=this.getColMatrix();return this.matrixTransformer(v({rowMatrix:n,colMatrix:r,dataMatrix:s}),this.config.separator)},this.getAsyncAllPivotCopyData=()=>(0,s.sH)(this,void 0,void 0,function*(){const e=this.getRowMatrix(),t=this.getColMatrix(),i=this.getCornerMatrix(e);let s=[];s=this.isEnableASync()?yield this.getDataMatrixByHeaderNodeRIC():yield Promise.resolve(this.getDataMatrixByHeaderNode());return this.matrixTransformer(v({rowMatrix:e,colMatrix:t,dataMatrix:s,cornerMatrix:i}),this.config.separator)}),this.getPivotAllCopyData=()=>{const e=this.getRowMatrix(),t=this.getColMatrix(),i=this.getCornerMatrix(e),s=this.getDataMatrixByHeaderNode();return this.matrixTransformer(v({rowMatrix:e,colMatrix:t,dataMatrix:s,cornerMatrix:i}),this.config.separator)},this.leafRowNodes=this.getLeafRowNodes(),this.leafColNodes=this.getLeafColNodes()}getHeaderNodeMatrix(e){return this.config.formatHeader?y(e):super.getHeaderNodeMatrix(e)}getLeafRowNodes(){const e=this.spreadsheet.facet.getRowLeafNodes(),t=(0,l.R5)(this.config.selectedCells),i=this.spreadsheet.isHierarchyTreeType();return(0,o.isEmpty)(t)?e:this.getSelectedNode(t,e,i)}getLeafColNodes(){const e=this.spreadsheet.facet.getColLeafNodes(),t=(0,l.F)(this.config.selectedCells);return(0,o.isEmpty)(t)?e:this.getSelectedNode(t,e)}getSelectedNode(e,t,i=!1){if(i){const i=new Set(e.map(e=>e.id));return t.filter(e=>i.has(e.id))}return e.reduce((e,i)=>{const s=i.id,o=t.filter(e=>e.id===s||e.id.startsWith(s+"[&]"));return e.push(...o),e},[])}getColMatrix(){return(0,o.zip)(...(0,o.map)(this.leafColNodes,e=>this.getHeaderNodeMatrix(e)))}getRowMatrix(){return function(e){const t=f(e);return(0,o.map)(e,e=>{const i=t-e.length;return i?[...e,...new Array(i).fill("")]:e})}((0,o.map)(this.leafRowNodes,e=>this.getHeaderNodeMatrix(e)))}getPivotCopyData(){const{copy:e}=this.spreadsheet.options.interaction,t=this.getDataMatrixByHeaderNode();if(!(null==e?void 0:e.withHeader))return this.matrixTransformer(t,this.config.separator);const i=this.getRowMatrix(),s=this.getColMatrix();return this.matrixTransformer(v({rowMatrix:i,colMatrix:s,dataMatrix:t}),this.config.separator)}}function b(e){var t,i,s,r;const a=(0,l.Z8)(e),d=null!==(t=(0,o.max)(Array.from(a)))&&void 0!==t?t:0,c=function(e,t){return(0,o.filter)(e,e=>{const i=e.getMeta(),s=i.level===t,n=i.isTotals&&(0,o.isEmpty)(i.children);return s||n})}(e,d),h=e[0].cellType===n.vZ.COL_CELL,{spreadsheet:u}=e[0].getMeta(),m=function(e,t,i,s){return(0,o.map)(e,e=>{var n;const r=e.getMeta();if(s){const e=y(r),s=null!==(n=(0,o.min)(Array.from(i)))&&void 0!==n?n:0;return e.slice(s,t+1)}const{id:a,value:d,isTotals:c,level:h,spreadsheet:u}=r;let p=a;return c&&h!==t&&(p=a+"[&]"+(0,o.repeat)(d,t-h)),(0,l.iT)((0,l.eF)(p,i.size),u,!1)})}(c,d,a,null!==(r=null===(s=null===(i=u.options.interaction)||void 0===i?void 0:i.copy)||void 0===s?void 0:s.withFormat)&&void 0!==r&&r),v=h?(0,o.zip)(...m):m;return[p(v),g(v)]}class E extends _{constructor(e){super(e),this.getValueFromMeta=e=>{var t;const[,i]=w(e,this.spreadsheet),s=(0,l.Nk)(this.spreadsheet.isPivotMode,i),o=this.isSeriesNumberField(s)?e.rowIndex+1:null===(t=this.displayData[e.rowIndex])||void 0===t?void 0:t[s];return this.getFormatter({field:s,rowIndex:e.rowIndex,colIndex:e.colIndex})(o)},this.displayData=this.getSelectedDisplayData(),this.columnNodes=this.getSelectedColNodes()}getHeaderNodeMatrix(e){return super.getHeaderNodeMatrix(e)}getSelectedColNodes(){const e=(0,l.F)(this.config.selectedCells),t=this.spreadsheet.facet.getColLeafNodes();return 0===e.length?t:(0,o.map)(e,e=>t[e.colIndex])}getSelectedDisplayData(){const e=(0,l.R5)(this.config.selectedCells),t=this.spreadsheet.dataSet.getDisplayDataSet();return 0===e.length?t:(0,o.map)(e,e=>t[e.rowIndex])}getDataMatrix(){const{seriesNumber:e}=this.spreadsheet.options;return this.displayData.map((t,i)=>this.columnNodes.map((s,o)=>{const n=null==s?void 0:s.field;if(d.r2===n&&(null==e?void 0:e.enable)){const e=i+1;return this.getFormatter({field:n,rowIndex:i,colIndex:o})(e)}return this.getFormatter({field:n,rowIndex:i,colIndex:o})(null==t?void 0:t[n])}))}getDataMatrixRIC(){const{seriesNumber:e}=this.spreadsheet.options,t=[];let i=0;return new Promise((s,o)=>{try{const o=n=>{const r=this.displayData.length;for(this.initIdleCallbackCount(r);(n.timeRemaining()>0||n.didTimeout)&&i<=r-1&&this.idleCallbackCount>0;)for(let s=i;s<r&&this.idleCallbackCount>0;s++){const o=this.displayData[s],n=[];for(let t=0;t<this.columnNodes.length;t++){const r=this.columnNodes[t].field;if(d.r2===r&&(null==e?void 0:e.enable)){const e=s+1,i=this.getFormatter({field:r,rowIndex:s,colIndex:t});n.push(i(e));continue}const l=this.getFormatter({field:r,rowIndex:i,colIndex:t})(o[r]);n.push(l)}i++,t.push(n),this.idleCallbackCount--}i===r?s(t):(this.initIdleCallbackCount(r),requestIdleCallback(o,x))};requestIdleCallback(o,x)}catch(e){o(e)}})}isSeriesNumberField(e){const{seriesNumber:t}=this.spreadsheet.options;return d.r2===e&&(null==t?void 0:t.enable)}getColMatrix(){return(0,o.zip)(...this.columnNodes.map(e=>this.getHeaderNodeMatrix(e)))}getDataMatrixByDataCell(e){const{copy:t}=this.spreadsheet.options.interaction,i=(0,o.map)(e,e=>(0,o.map)(e,e=>this.getValueFromMeta(e)));if(!(null==t?void 0:t.withHeader))return this.matrixTransformer(i,this.config.separator);const s=this.getColMatrix();return this.matrixTransformer(v({colMatrix:s,dataMatrix:i}),this.config.separator)}processSelectedTable(e=!1){const t=this.getDataMatrix();if(!e)return this.matrixTransformer(t,this.config.separator);const i=this.getColMatrix();return this.matrixTransformer(v({colMatrix:i,dataMatrix:t}),this.config.separator)}asyncProcessSelectedTable(){return(0,s.sH)(this,arguments,void 0,function*(e=!1){const t=this.isEnableASync()?yield this.getDataMatrixRIC():yield Promise.resolve(this.getDataMatrix());if(!e)return this.matrixTransformer(t,this.config.separator);const i=this.getColMatrix();return this.matrixTransformer(v({colMatrix:i,dataMatrix:t}),this.config.separator)})}}const L=(e,t)=>e.isPivotMode()?function(e,t){return new S({spreadsheet:e,config:{selectedCells:t}}).getPivotCopyData()}(e,t):((e,t)=>new E({spreadsheet:e,config:{selectedCells:t}}).processSelectedTable())(e,t);function T(e){return!(0,o.isEmpty)(e)&&(0,o.every)(e,e=>e.cellType===n.vZ.ROW_CELL||e.cellType===n.vZ.COL_CELL)}function O(e,t,i,s){return s.isPivotMode()?(({spreadsheet:e,selectedCells:t,headerSelectedCells:i})=>new S({spreadsheet:e,config:{selectedCells:i,formatOptions:!0}}).getDataMatrixByDataCell(t))({spreadsheet:s,selectedCells:e,headerSelectedCells:(0,o.concat)(t,i)}):(({spreadsheet:e,selectedCells:t,headerSelectedCells:i})=>new E({spreadsheet:e,config:{selectedCells:i,formatOptions:!0}}).getDataMatrixByDataCell(t))({spreadsheet:s,selectedCells:e,headerSelectedCells:t})}function R(e,t){let i;const s=(0,l.F)(t),a=(0,l.R5)(t);if(e.interaction.getCurrentStateName()===n.xT.ALL_SELECTED)i=L(e,[]);else if(s.length)i=L(e,s);else if(a.length)i=L(e,a);else{if(!t.length)return[{type:r.q.PLAIN,content:""},{type:r.q.HTML,content:""}];const s=(e=>{if(!(null==e?void 0:e.length))return[];const[t,i]=[{row:1/0,col:1/0},{row:0,col:0}];e.forEach(e=>{const{rowIndex:s,colIndex:o}=e;t.col=Math.min(o,t.col),t.row=Math.min(s,t.row),i.col=Math.max(o,i.col),i.row=Math.max(s,i.row)});const[s,o]=[i.row-t.row+1,i.col-t.col+1],n=new Array(s).fill("").map(()=>new Array(o).fill(""));return e.forEach(e=>{const{rowIndex:i,colIndex:s}=e,[o,r]=[i-t.row,s-t.col];n[o][r]=e}),n})(t),l=s[0].map(e=>{var t;return Object.assign(Object.assign({},e),{id:(null==e?void 0:e.colId)||(0,o.last)(null===(t=null==e?void 0:e.id)||void 0===t?void 0:t.split("-"))||"",type:n.vZ.COL_CELL})}),a=s.map(e=>{var t,i,s;return Object.assign(Object.assign({},e[0]),{id:(null===(t=e[0])||void 0===t?void 0:t.rowId)||(0,o.first)(null===(s=null===(i=e[0])||void 0===i?void 0:i.id)||void 0===s?void 0:s.split("-"))||"",type:n.vZ.ROW_CELL})});i=O(s,l,a,e)}return i}const I=e=>{var t;const i=e.interaction,s=i.getState().cells||[],o=null!==(t=i.getInteractedCells())&&void 0!==t?t:[],n=T(o)?b(o):R(e,s);return n&&(0,a.lW)(n),n},N=e=>{const{sheetInstance:t}=e,i=t.enableAsyncExport();if(i instanceof Error)throw console.warn(i),i;return t.isPivotMode()?(e=>{const{sheetInstance:t,split:i,formatOptions:s,customTransformer:o,async:n}=e;return new S({spreadsheet:t,isExport:!0,config:{separator:i,formatOptions:s,customTransformer:o,async:null==n||n}}).getAsyncAllPivotCopyData()})(e):(e=>{const{sheetInstance:t,split:i,formatOptions:s,customTransformer:o,async:n}=e;return new E({spreadsheet:t,config:{selectedCells:[],separator:i,formatOptions:s,customTransformer:o,async:null==n||n},isExport:!0}).asyncProcessSelectedTable(!0)})(e)},B=e=>(0,s.sH)(void 0,void 0,void 0,function*(){return(yield N(e))[0].content}),A=e=>(0,s.sH)(void 0,void 0,void 0,function*(){return yield N(e)})},"./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/utils/export/method.js"(e,t,i){"use strict";i.d(t,{DV:()=>a,Z8:()=>d});var s=i("./node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/lodash.js"),o=i("./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/common/constant/field.js"),n=i("./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/common/constant/interaction.js"),r=i("./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/utils/layout/generate-id.js"),l=i("./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/utils/text.js");function a(e,t){return!(!e||!t)&&String(e).toLowerCase()===String(t).toLowerCase()}function d(e){const t=new Set;return(0,s.forEach)(e,e=>{const i=e.getMeta().level;t.has(i)||t.add(i)}),t}i.d(t,["E0",0,e=>{if("string"!=typeof e)return e;if(/[",\r\n\t]/.test(e)){return`"${e.replace(/"/g,'""').replace(/\r\n/g,"\n").replace(/\n/g,"\r\n")}"`}return e},"F",0,e=>e.filter(({type:e})=>e===n.vZ.COL_CELL),"Nk",0,(e,t)=>e()?null==t?void 0:t.value:null==t?void 0:t.field,"R5",0,e=>e.filter(({type:e})=>e===n.vZ.ROW_CELL),"eF",0,(e,t)=>{const i=e.split("[&]");return t?i.slice(i.length-t):(i.shift(),i)},"iT",0,(e,t,i=!0)=>(0,s.map)(e,e=>e===o.r2?t.getSeriesNumberText():i?t.dataSet.getFieldName(e):(0,s.flow)(r.bC,l.F)(e))])},"./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/utils/export/utils.js"(e,t,i){"use strict";var s=i("./node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/lodash.js"),o=i("./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/common/interface/export.js"),n=i("./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/utils/ssr.js");const r=e=>new Promise((t,i)=>{let n;n=Array.isArray(e)?(0,s.get)(e.filter(e=>e.type===o.q.PLAIN),"[0].content",""):e.content||"";const r=document.createElement("textarea");r.value=n,document.body.appendChild(r),r.focus({preventScroll:!0}),r.select();const l=document.execCommand("copy");document.body.removeChild(r),l?t():i()});i.d(t,["RG",0,(e,t)=>{try{const i=document.createElement("a");i.download=`${t}.csv`;const s=new Blob([`\ufeff${e}`],{type:"text/csv;charset=utf-8"});i.href=URL.createObjectURL(s),i.click(),URL.revokeObjectURL(i.href)}catch(e){console.error(e)}},"lW",0,(e,t=!0)=>{let i;return i="string"==typeof e?{content:e,type:o.q.PLAIN}:e,(0,n.fU)()?Promise.resolve():(0,n.w9)()&&navigator.clipboard&&window.ClipboardItem&&t?(e=>navigator.clipboard.write([new ClipboardItem((0,s.concat)(e).reduce((e,t)=>{const{type:i,content:s}=t,o=s.replace(/\x00/g,"");return Object.assign(Object.assign({},e),{[i]:new Blob([o],{type:i})})},{}))]).catch(()=>r(e)))(i):r(i)}])},"./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/utils/formatter.js"(e,t,i){"use strict";var s=i("./node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/lodash.js");"KMBTP".split("");i.d(t,["F",0,e=>Number.parseFloat(((0,s.toNumber)(e)||0).toPrecision(16))])},"./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/utils/g-mini-charts.js"(e,t,i){"use strict";var s=i("./node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/lodash.js"),o=i("./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/common/constant/basic.js"),n=i("./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/common/constant/interaction.js"),r=i("./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/common/interface/basic.js"),l=i("./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/utils/condition/condition.js"),a=i("./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/utils/formatter.js"),d=i("./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/utils/g-renders.js"),c=i("./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/utils/g-utils.js");const h=(e,t)=>{var i;const{data:r,encode:l,type:a}=e,{x:d,y:c,height:h,width:u}=t.getMeta(),p=t.getStyle(n.vZ.DATA_CELL),{cell:g,miniChart:m}=p,v=[],f=(0,s.map)(r,e=>(v.push(null==e?void 0:e[l.y]),{x:e[l.x],y:e[l.y]})),C=(0,s.max)(v)||0,y=(0,s.min)(v)||0;let w=C-y;const{left:x=0,right:_=0,top:S=0,bottom:b=0}=g.padding,E=d+x,L=d+u-_,T=c+S,O=c+h-b,R=O-T,I=null===(i=null==m?void 0:m.bar)||void 0===i?void 0:i.intervalPadding;let N;N=a===o.Gp.Bar?(L-E-(v.length-1)*I)/v.length+I:v.length>1?(L-E)/(v.length-1):0;const B=[];return{points:(0,s.map)(f,(e,t)=>{const i=E+t*N;let n;if(n=0!==w?O-((null==e?void 0:e.y)-y)/w*R:y>0?T:O,a===o.Gp.Bar){let t,i;y<0&&C>0&&0!==w?(t=O-(0-y)/w*R,i=Math.abs(n-t),(null==e?void 0:e.y)<0&&(n=t)):(w=(0,s.max)([Math.abs(C),Math.abs(y)]),i=0===w&&0===y&&0===C?0:0===w?R:Math.abs((null==e?void 0:e.y)-0)/w*R,n=y<0?T:O-i);B.push([N-I,i])}return[i,n]}),box:B}},u=(e,t)=>{if((0,s.isEmpty)(null==e?void 0:e.data)||(0,s.isEmpty)(t))return;const i=(e=>{const{data:t,encode:i}=e,s=t.filter(e=>{const t=null==e?void 0:e[i.y];return"number"==typeof t&&!Number.isNaN(t)});return Object.assign(Object.assign({},e),{data:s})})(e);if((0,s.isEmpty)(i.data))return;const o=t.getStyle(n.vZ.DATA_CELL),{miniChart:r}=o,{point:l,linkLine:a}=null==r?void 0:r.line,{points:c}=h(i,t);c.length>1&&(0,d.Xj)(t,{points:c,stroke:null==a?void 0:a.fill,lineWidth:null==a?void 0:a.size,opacity:null==a?void 0:a.opacity});for(let e=0;e<c.length;e++)(0,d.DH)(t,{cx:c[e][0],cy:c[e][1],r:l.size,fill:l.fill,fillOpacity:null==l?void 0:l.opacity})},p=(e,t,i)=>{const s=Number(t)-Number(e);return Number.isNaN(s)||Number(e)<0?i.bad:s<=.1?i.good:s>.1&&s<=.2?i.satisfactory:i.bad},g=(e,t)=>{const i=t.getStyle(n.vZ.DATA_CELL),{x:o,y:r,height:l,width:a}=t.getMeta();if((0,s.isEmpty)(e))return void t.renderTextShape(Object.assign(Object.assign({},i.text),{x:o+a-i.cell.padding.right,y:r+l/2,text:""}));const c=i.miniChart.bullet,{progressBar:h,comparativeMeasure:u,rangeColors:g,backgroundColor:m}=c,{measure:v,target:f}=e,C=Math.max(Number(v),0),y=Math.max(Number(f),0),w=((e,t={min:0,max:0})=>{var i,s;const o=Number(e);if(Number.isNaN(o))return e;const n=null!==(i=null==t?void 0:t.min)&&void 0!==i?i:t,r=null!==(s=null==t?void 0:t.max)&&void 0!==s?s:t;return new Intl.NumberFormat("en-US",{minimumFractionDigits:n,maximumFractionDigits:r,useGrouping:!1,style:"percent"}).format(o)})(v,2),x=i.cell.padding,_=a-x.left-x.right,S=((null==h?void 0:h.widthPercent)>1?(null==h?void 0:h.widthPercent)/100:null==h?void 0:h.widthPercent)*_,b=_-S,E=o+a-x.right-S,L=r+l/2-h.height/2;(0,d.P2)(t,{x:E,y:L,width:S,height:h.height,fill:m});const T=Math.max(Math.min(S*C,S),0);(0,d.P2)(t,{x:E,y:L+(h.height-h.innerHeight)/2,width:T,height:h.innerHeight,fill:p(C,y,g)});const O=E+S*y;(0,d.ni)(t,{x1:O,y1:r+(l-u.height)/2,x2:O,y2:r+(l-u.height)/2+u.height,stroke:null==u?void 0:u.fill,lineWidth:u.width,opacity:null==u?void 0:u.opacity});const R=b-x.right;t.renderTextShape(Object.assign(Object.assign({},i.text),{x:E-x.right,y:r+l/2,text:w,wordWrapWidth:R}))};i.d(t,["Cj",0,(e,t)=>{switch(null==t?void 0:t.type){case o.Gp.Line:u(t,e);break;case o.Gp.Bar:((e,t)=>{if((0,s.isEmpty)(null==e?void 0:e.data)||(0,s.isEmpty)(t))return;const i=t.getStyle(n.vZ.DATA_CELL),{miniChart:o}=i,{bar:r}=o,{points:l,box:a}=h(e,t);for(let e=0;e<l.length;e++)(0,d.P2)(t,{x:l[e][0],y:l[e][1],width:a[e][0],height:a[e][1],fill:r.fill,fillOpacity:r.opacity})})(t,e);break;default:g(t,e)}},"U4",0,e=>{var t,i,o,n,h,u,p,g;if((0,s.isEmpty)(e))return;const{x:m,y:v,height:f,width:C}=e.getBBoxByType(r.Ok.PADDING_BOX),y=e.findFieldCondition(null===(t=e.cellConditions)||void 0===t?void 0:t.interval);if(null==y?void 0:y.mapping){const t=e.mappingValue(y);if(!t)return;const r=e.getValueRange(),w=t.isCompare?t:r,x=(0,a.F)(null!==(i=w.minValue)&&void 0!==i?i:r.minValue),_=(0,a.F)(null!==(o=w.maxValue)&&void 0!==o?o:r.maxValue),S=(0,s.isNil)(null==t?void 0:t.fieldValue)?(0,a.F)(e.getMeta().fieldValue):(0,a.F)(null==t?void 0:t.fieldValue);if(S<x||S>_)return;const b=e.getStyle(),E=null===(h=null===(n=null==b?void 0:b.miniChart)||void 0===n?void 0:n.interval)||void 0===h?void 0:h.height,L=null===(p=null===(u=null==b?void 0:b.miniChart)||void 0===u?void 0:u.interval)||void 0===p?void 0:p.fill,T=(0,l.o1)(x,_),{zeroScale:O,scale:R}=T(S),I={x:m+C*O,y:v+f/2-E/2,width:C*R,height:E,fill:null!==(g=t.fill)&&void 0!==g?g:L},N=e.getConditionIntervalShape();return N?((0,c.w)(N,I),N):(0,d.P2)(e,I)}}])},"./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/utils/g-renders.js"(e,t,i){"use strict";i.d(t,{wC:()=>v,xX:()=>f,DH:()=>c,sH:()=>g,ni:()=>u,nP:()=>a,Xj:()=>d,P2:()=>l,S5:()=>h,ms:()=>m,O3:()=>p});var s=i("./node_modules/.pnpm/@antv+g@6.3.3/node_modules/@antv/g/dist/index.esm.js"),o=i("./node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/lodash.js"),n=i("./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/common/icons/gui-icon.js");class r extends s.EY{constructor(e,t){super(e),this.appendInfo=t}}function l(e,t){return null==e?void 0:e.appendChild(new s.rw({style:t}))}function a(e,t){return null==e?void 0:e.appendChild(new s.tS({style:t}))}function d(e,t){return null==e?void 0:e.appendChild(new s.Ro({style:t}))}function c(e,t){return null==e?void 0:e.appendChild(new s.jl({style:t}))}function h(e){const{group:t,textShape:i,style:s,appendInfo:o}=e;return i&&t&&t.contains(i)&&t.removeChild(i),null==t?void 0:t.appendChild(new r({style:Object.assign({fontVariant:"normal",fontStyle:"normal",lineWidth:1},s)},o||{}))}function u(e,t){return null==e?void 0:e.appendChild(new s.N1({style:Object.assign({zIndex:100},t)}))}function p(e,t,i){if((0,o.isEmpty)(e))return;((0,o.isArray)(e)?e:[e]).forEach(e=>{var s;null===(s=null==e?void 0:e.style)||void 0===s||s.setProperty(t,i)})}function g(e,t){const i=new n.r(t);return null==e||e.appendChild(i),i}function m(e){const{group:t,iconCfg:i,isCollapsed:s,onClick:n}=e,r=g(t,Object.assign(Object.assign({},i),{name:s?"Plus":"Minus",cursor:"pointer"}));return(0,o.isFunction)(n)&&r.addEventListener("click",n),r}function v(e,t){for(const i in t)e.style[i]=t[i]}function f(e,t){const i=this,n=(0,o.get)(i,e);n?v(n,t):(0,o.set)(i,e,new s.rw({style:t}))}},"./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/utils/g-utils.js"(e,t,i){"use strict";i.d(t,{w:()=>n,x:()=>r});var s=i("./node_modules/.pnpm/@antv+g@6.3.3/node_modules/@antv/g/dist/index.esm.js"),o=i("./node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/lodash.js");function n(e,t){e.setAttributes(t,{skipDispatchAttrModifiedEvent:!0})}function r(e,t){const i=this,r=(0,o.get)(i,e);r?n(r,t):(0,o.set)(i,e,new s.rw({style:t}))}},"./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/utils/layout/generate-id.js"(e,t,i){"use strict";var s=i("./node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/lodash.js"),o=i("./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/common/constant/field.js");const n=e=>(0,s.isUndefined)(e)?o.SA:(0,s.isNull)(e)?o.Zb:String(e),r=e=>e===o.Zb?null:e!==o.SA?e:void 0;i.d(t,["$C",0,(...e)=>e.map(n).join("[&]"),"bC",0,r,"mN",0,n])},"./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/utils/ssr.js"(e,t,i){"use strict";function s(){return"undefined"==typeof window}function o(){return"undefined"!=typeof document}function n(){return"undefined"!=typeof navigator}i.d(t,{Wt:()=>o,fU:()=>s,w9:()=>n})},"./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/utils/text.js"(e,t,i){"use strict";var s=i("./node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/lodash.js"),o=i("./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/common/constant/field.js"),n=i("./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/common/constant/interaction.js"),r=i("./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/common/interface/basic.js"),l=i("./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/utils/g-renders.js"),a=i("./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/utils/cell/cell.js"),d=i("./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/utils/condition/condition.js"),c=i("./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/utils/g-mini-charts.js"),h=i("./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/utils/layout/generate-id.js");const u=(e,t,i,s="left")=>{const{right:o=0,left:n=0}=t,r=i||0;return"left"===s?e+o/2+r:"right"===s?e-o/2-r:e+n/2+r},p=({rowIndex:e,colIndex:t,meta:i,data:s,textStyle:o,textCondition:n,cell:r})=>{var l;const a=null===(l=null==n?void 0:n.mapping)||void 0===l?void 0:l.call(n,s,{rowIndex:e,colIndex:t,meta:i},r);return Object.assign(Object.assign({},o),a)};i.d(t,["F",0,e=>e===o.L4?"-":e,"Kg",0,(e,t)=>{const i=(0,h.bC)(e),n=null!=t?t:"-",r=(0,s.isNumber)(i)&&Number.isNaN(i),l=""===i||i===o.L4;return(0,s.isNil)(i)||r||l?n:(0,h.bC)(i)},"Lv",0,(e,t)=>(0,s.isFunction)(null==t?void 0:t.cell)?null==t?void 0:t.cell(e):null==t?void 0:t.cell,"V",0,(e,t,i=!0)=>{var o,h,g,m,v,f,C,y,w,x;const{x:_,y:S,height:b,width:E}=e.getBBoxByType(r.Ok.CONTENT_BOX),L=e.getMeta(),T=t||L.fieldValue,{values:O}=T,{options:R}=L.spreadsheet,I=null===(h=null===(o=null==R?void 0:R.conditions)||void 0===o?void 0:o.text)||void 0===h?void 0:h[0],N=null===(m=null===(g=null==R?void 0:R.conditions)||void 0===g?void 0:g.icon)||void 0===m?void 0:m[0];if(!(0,s.isArray)(O))return void(0,c.Cj)(e,O);const B=null===(C=null===(f=null===(v=R.style)||void 0===v?void 0:v.dataCell)||void 0===f?void 0:f.valuesCfg)||void 0===C?void 0:C.widthPercent;let A=0;if(null==T?void 0:T.label){const t=e.getStyle(n.vZ.DATA_CELL);A=b/(O.length+1),e.renderTextShape(Object.assign(Object.assign({},t.bolderText),{x:_,y:S+A/2,text:T.label,maxLines:1,wordWrapWidth:E,wordWrap:!0,textOverflow:"ellipsis"}),{shallowRender:!0})}const{cellStyle:M,textStyle:D}=(e=>{var t,i;const{isTotals:s}=e.getMeta(),o=null===(i=(t=e).isMeasureField)||void 0===i?void 0:i.call(t),r=e.getStyle(e.cellType||n.vZ.DATA_CELL);let l;return l=o?null==r?void 0:r.measureText:s?null==r?void 0:r.bolderText:null==r?void 0:r.text,{cellStyle:r,textStyle:l}})(e),H=null==M?void 0:M.icon,k=N&&N.mapping&&{name:"",size:null==H?void 0:H.size,margin:null==H?void 0:H.margin,position:(0,d.dq)(N)};let z;const F=((e,t,i)=>{const{x:o,y:n,width:r,height:l}=e,a=l/(0,s.size)(t),d=[];let c,h,p,g=0;const m=(0,s.map)(i,e=>e>1?e/100:e);for(let e=0;e<(0,s.size)(t);e++){h=n+a*e;const i=[];c=o,g=0;for(let n=0;n<(0,s.size)(t[e]);n++)p=(0,s.isEmpty)(m)?r/(0,s.size)(t[0]):r*m[n],c=u(o,{left:0,right:0},g,"left"),g+=p,i.push({x:c,y:h,width:p,height:a});d.push(i)}return d})({x:_,y:S+A,height:b-A,width:E},O,B);for(let t=0;t<O.length;t++){const o=(0,s.clone)(O[t]);for(let s=0;s<o.length;s++){z=o[s];const n=i?p({rowIndex:t,colIndex:s,meta:L,data:z,textStyle:D,textCondition:I,cell:e}):D,r=F[t][s].width-(null==H?void 0:H.size)-("left"===(null==k?void 0:k.position)?null===(y=null==H?void 0:H.margin)||void 0===y?void 0:y.right:null===(w=null==H?void 0:H.margin)||void 0===w?void 0:w.left),d={left:[],right:[]};k&&d[k.position].push(k),e.renderTextShape(Object.assign(Object.assign({},n),{x:0,y:0,maxLines:1,text:z,wordWrapWidth:r}),{shallowRender:!0});const c=e.getActualTextWidth(),{textX:h,leftIconX:u,rightIconX:g}=(0,a.Cb)({bbox:F[t][s],textAlign:n.textAlign,textWidth:c,iconStyle:H,groupedIcons:d}),m=(0,a.l2)(F[t][s],n.textBaseline);if(e.updateTextPosition({x:h,y:m}),N&&i){const i=null===(x=null==N?void 0:N.mapping)||void 0===x?void 0:x.call(N,z,{rowIndex:t,colIndex:s,meta:null==e?void 0:e.getMeta()},e),o="left"===(null==k?void 0:k.position)?u:g,r=(0,a.Bh)(H.size,m,n.fontSize,n.textBaseline);if(i){const t=(0,l.sH)(e,{x:o,y:r,name:i.icon,width:null==H?void 0:H.size,height:null==H?void 0:H.size,fill:i.fill});e.addConditionIconShape(t)}}}}},"jv",0,(e,t=1)=>(null==e?void 0:e.width)*t])},"./node_modules/.pnpm/@preact+signals-core@1.14.4/node_modules/@preact/signals-core/dist/signals-core.module.js"(e,t,i){"use strict";i.d(t,{EW:()=>S,O8:()=>a,QZ:()=>O,vA:()=>n,vP:()=>C});var s=Symbol.for("preact-signals");function o(){if(c>1)c--;else{var e,t=!1;for(!function(){var e=g;for(g=void 0;void 0!==e;){var t=e.S;if(t.v===e.v)for(var i=t.t;void 0!==i;i=i.x)i.i===e.i&&(i.i=t.i);e=e.o}}();void 0!==d;){var i=d;for(d=void 0,h++;void 0!==i;){var s=i.u;if(i.u=void 0,i.f&=-3,!(8&i.f)&&y(i))try{i.c()}catch(i){t||(e=i,t=!0)}i=s}}if(h=0,c--,t)throw e}}function n(e){if(c>0)return e();p=++u,c++;try{return e()}finally{o()}}var r,l=void 0;function a(e){var t=l,i=r;l=void 0,r=void 0;try{return e()}finally{l=t,r=i}}var d=void 0,c=0,h=0,u=0,p=0,g=void 0,m=0;function v(e){if(void 0!==l){var t=e.n;if(void 0===t||t.t!==l)return t={i:0,S:e,p:l.s,n:void 0,t:l,e:void 0,x:void 0,r:t},void 0!==l.s&&(l.s.n=t),l.s=t,e.n=t,32&l.f&&e.S(t),t;if(-1===t.i)return t.i=0,void 0!==t.n&&(t.n.p=t.p,void 0!==t.p&&(t.p.n=t.n),t.p=l.s,t.n=void 0,l.s.n=t,l.s=t),t}}function f(e,t){this.v=e,this.i=0,this.n=void 0,this.t=void 0,this.l=0,this.W=null==t?void 0:t.watched,this.Z=null==t?void 0:t.unwatched,this.name=null==t?void 0:t.name}function C(e,t){return new f(e,t)}function y(e){for(var t=e.s;void 0!==t;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function w(e){for(var t=e.s;void 0!==t;t=t.n){var i=t.S.n;if(void 0!==i&&(t.r=i),t.S.n=t,t.i=-1,void 0===t.n){e.s=t;break}}}function x(e){for(var t=e.s,i=void 0;void 0!==t;){var s=t.p;-1===t.i?(t.S.U(t),void 0!==s&&(s.n=t.n),void 0!==t.n&&(t.n.p=s)):i=t,t.S.n=t.r,void 0!==t.r&&(t.r=void 0),t=s}e.s=i}function _(e,t){f.call(this,void 0,t),this.x=e,this.s=void 0,this.g=m-1,this.f=4}function S(e,t){return new _(e,t)}function b(e){var t=e.m;if(e.m=void 0,"function"==typeof t){c++;var i=l;l=void 0;try{t()}catch(t){throw e.f&=-2,e.f|=8,E(e),t}finally{l=i,o()}}}function E(e){for(var t=e.s;void 0!==t;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,b(e)}function L(e){if(l!==this)throw new Error("Out-of-order effect");x(this),l=e,this.f&=-2,8&this.f&&E(this),o()}function T(e,t){this.x=e,this.m=void 0,this.s=void 0,this.u=void 0,this.f=32,this.name=null==t?void 0:t.name,r&&r.push(this)}function O(e,t){var i=new T(e,t);try{i.c()}catch(e){throw i.d(),e}var s=i.d.bind(i);return s[Symbol.dispose]=s,s}f.prototype.brand=s,f.prototype.h=function(){return!0},f.prototype.S=function(e){var t=this,i=this.t;i!==e&&void 0===e.e&&(e.x=i,this.t=e,void 0!==i?i.e=e:a(function(){var e;null==(e=t.W)||e.call(t)}))},f.prototype.U=function(e){var t=this;if(void 0!==this.t){var i=e.e,s=e.x;void 0!==i&&(i.x=s,e.e=void 0),void 0!==s&&(s.e=i,e.x=void 0),e===this.t&&(this.t=s,void 0===s&&a(function(){var e;null==(e=t.Z)||e.call(t)}))}},f.prototype.subscribe=function(e){var t=this;return O(function(){var i=t.value;a(function(){return e(i)})},{name:"sub"})},f.prototype.valueOf=function(){return this.value},f.prototype.toString=function(){return this.value+""},f.prototype.toJSON=function(){return this.value},f.prototype.peek=function(){var e=this;return a(function(){return e.value})},Object.defineProperty(f.prototype,"value",{get:function(){var e=v(this);return void 0!==e&&(e.i=this.i),this.v},set:function(e){if(e!==this.v){if(h>100)throw new Error("Cycle detected");!function(e){0!==c&&0===h&&e.l!==p&&(e.l=p,g={S:e,v:e.v,i:e.i,o:g})}(this),this.v=e,this.i++,m++,c++;try{for(var t=this.t;void 0!==t;t=t.x)t.t.N()}finally{o()}}}}),(_.prototype=new f).h=function(){if(this.f&=-3,1&this.f)return!1;if(32==(36&this.f))return!0;if(this.f&=-5,this.g===m)return!0;if(this.g=m,this.f|=1,this.i>0&&!y(this))return this.f&=-2,!0;var e=l;try{w(this),l=this;var t=this.x();(16&this.f||this.v!==t||0===this.i)&&(this.v=t,this.f&=-17,this.i++)}catch(e){this.v=e,this.f|=16,this.i++}return l=e,x(this),this.f&=-2,!0},_.prototype.S=function(e){if(void 0===this.t){this.f|=36;for(var t=this.s;void 0!==t;t=t.n)t.S.S(t)}f.prototype.S.call(this,e)},_.prototype.U=function(e){if(void 0!==this.t&&(f.prototype.U.call(this,e),void 0===this.t)){this.f&=-33;for(var t=this.s;void 0!==t;t=t.n)t.S.U(t)}},_.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var e=this.t;void 0!==e;e=e.x)e.t.N()}},Object.defineProperty(_.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var e=v(this);if(this.h(),void 0!==e&&(e.i=this.i),16&this.f)throw this.v;return this.v}}),T.prototype.c=function(){var e=this.S();try{if(8&this.f)return;if(void 0===this.x)return;var t=this.x();"function"==typeof t&&(this.m=t)}finally{e()}},T.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,b(this),w(this),c++;var e=l;return l=this,L.bind(this,e)},T.prototype.N=function(){2&this.f||(this.f|=2,this.u=d,d=this)},T.prototype.d=function(){this.f|=8,1&this.f||E(this)},T.prototype.dispose=function(){this.d()}},"./node_modules/.pnpm/@rc-component+checkbox@2.0.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@rc-component/checkbox/es/index.js"(e,t,i){"use strict";var s=i("./node_modules/.pnpm/@rc-component+util@1.14.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@rc-component/util/es/hooks/useControlledState.js"),o=i("./node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs"),n=i("react");function r(){return r=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(e[s]=i[s])}return e},r.apply(this,arguments)}i.d(t,["A",0,(0,n.forwardRef)((e,t)=>{const{prefixCls:i="rc-checkbox",className:l,style:a,checked:d,disabled:c,defaultChecked:h=!1,type:u="checkbox",title:p,onChange:g,...m}=e,v=(0,n.useRef)(null),f=(0,n.useRef)(null),[C,y]=(0,s.A)(h,d);(0,n.useImperativeHandle)(t,()=>({focus:e=>{v.current?.focus(e)},blur:()=>{v.current?.blur()},input:v.current,nativeElement:f.current}));const w=(0,o.$)(i,l,{[`${i}-checked`]:C,[`${i}-disabled`]:c});return n.createElement("span",{className:w,title:p,style:a,ref:f},n.createElement("input",r({},m,{className:`${i}-input`,ref:v,onChange:t=>{c||("checked"in e||y(t.target.checked),g?.({target:{...e,type:u,checked:t.target.checked},stopPropagation(){t.stopPropagation()},preventDefault(){t.preventDefault()},nativeEvent:t.nativeEvent}))},disabled:c,checked:!!C,type:u})))})])},"./node_modules/.pnpm/@rc-component+dropdown@2.0.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@rc-component/dropdown/es/index.js"(e,t,i){"use strict";i.d(t,{A:()=>v});var s=i("./node_modules/.pnpm/@rc-component+trigger@3.10.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@rc-component/trigger/es/index.js"),o=i("./node_modules/.pnpm/@rc-component+util@1.14.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@rc-component/util/es/index.js"),n=i("./node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs"),r=i("react"),l=i.n(r);const{ESC:a,TAB:d}=o.DD;const c=(0,r.forwardRef)((e,t)=>{const{overlay:i,arrow:s,prefixCls:n}=e,a=(0,r.useMemo)(()=>{let e;return e="function"==typeof i?i():i,e},[i]),d=(0,o.K4)(t,(0,o.A9)(a));return l().createElement(l().Fragment,null,s&&l().createElement("div",{className:`${n}-arrow`}),l().cloneElement(a,{ref:(0,o.f3)(a)?d:void 0}))}),h={adjustX:1,adjustY:1},u=[0,0],p={topLeft:{points:["bl","tl"],overflow:h,offset:[0,-4],targetOffset:u},top:{points:["bc","tc"],overflow:h,offset:[0,-4],targetOffset:u},topRight:{points:["br","tr"],overflow:h,offset:[0,-4],targetOffset:u},bottomLeft:{points:["tl","bl"],overflow:h,offset:[0,4],targetOffset:u},bottom:{points:["tc","bc"],overflow:h,offset:[0,4],targetOffset:u},bottomRight:{points:["tr","br"],overflow:h,offset:[0,4],targetOffset:u}};function g(){return g=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(e[s]=i[s])}return e},g.apply(this,arguments)}const m=l().forwardRef((e,t)=>{const{arrow:i=!1,prefixCls:h="rc-dropdown",transitionName:u,animation:m,align:v,placement:f="bottomLeft",placements:C=p,getPopupContainer:y,showAction:w,hideAction:x,overlayClassName:_,overlayStyle:S,open:b,trigger:E=["hover"],autoFocus:L,overlay:T,children:O,onOpenChange:R,disabled:I,...N}=e,[B,A]=l().useState(),M="open"in e?b:B,D=m?`${h}-${m}`:u,H=l().useRef(null),k=l().useRef(null),z=l().useRef(null);l().useImperativeHandle(t,()=>H.current);const F=e=>{A(e),R?.(e)};!function({open:e,triggerRef:t,onOpenChange:i,autoFocus:s,overlayRef:n}){const l=r.useRef(!1),c=()=>{e&&(t.current?.focus?.(),i?.(!1))},h=e=>!!n.current?.focus&&(n.current.focus(e),l.current=!0,!0),u=e=>{switch(e.keyCode){case a:c();break;case d:{let t=!1;l.current||(t=h()),t?e.preventDefault():c();break}}};r.useEffect(()=>e?(window.addEventListener("keydown",u),s&&(0,o.er)(()=>h({preventScroll:!0}),3),()=>{window.removeEventListener("keydown",u),l.current=!1}):()=>{l.current=!1},[e])}({open:M,triggerRef:z,onOpenChange:F,autoFocus:L,overlayRef:k});const P=()=>l().createElement(c,{ref:k,overlay:T,prefixCls:h,arrow:i}),j=O,W=(0,n.$)(j.props?.className,M&&(()=>{const{openClassName:t}=e;return void 0!==t?t:`${h}-open`})()),G={className:W,ref:(0,o.K4)(z,(0,o.A9)(j))},V=(0,o.f3)(j)?l().cloneElement(j,G):l().createElement("span",{className:W,ref:z},l().cloneElement(j,{className:W}));let $=x;return $||-1===E.indexOf("contextMenu")||($=["click"]),l().createElement(s.Ay,g({builtinPlacements:C},N,{prefixCls:h,ref:H,popupClassName:(0,n.$)(_,{[`${h}-show-arrow`]:i}),popupStyle:S,action:E,showAction:w,hideAction:$,popupPlacement:f,popupAlign:v,popupMotion:{motionName:D},popupVisible:M,stretch:(()=>{const{minOverlayWidthMatchTrigger:t,alignPoint:i}=e;return"minOverlayWidthMatchTrigger"in e?t:!i})()?"minWidth":"",popup:"function"==typeof T?P:P(),onOpenChange:F,onPopupClick:t=>{const{onOverlayClick:i}=e;A(!1),i&&i(t)},getPopupContainer:y}),V)}),v=m},"./node_modules/.pnpm/antd@6.7.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/_util/PurePanel.js"(e,t,i){"use strict";i.d(t,{U:()=>l});var s=i("react"),o=i("./node_modules/.pnpm/@rc-component+util@1.14.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@rc-component/util/es/index.js"),n=i("./node_modules/.pnpm/antd@6.7.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/config-provider/index.js"),r=i("./node_modules/.pnpm/antd@6.7.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/config-provider/context.js");function l(e){return t=>s.createElement(n.Ay,{theme:{token:{motion:!1,zIndexPopupBase:0}}},s.createElement(e,{...t}))}i.d(t,["A",0,(e,t,i,n,a)=>l(l=>{const{prefixCls:d,style:c}=l,h=s.useRef(null),[u,p]=s.useState(0),[g,m]=s.useState(0),[v,f]=(0,o.PW)(!1,l.open),{getPrefixCls:C}=s.useContext(r.QO),y=C(n||"select",d);s.useEffect(()=>{if(f(!0),"undefined"!=typeof ResizeObserver){const e=new ResizeObserver(e=>{const t=e[0].target;p(t.offsetHeight+8),m(t.offsetWidth)}),t=setInterval(()=>{const i=a?`.${a(y)}`:`.${y}-dropdown`,s=h.current?.querySelector(i);s&&(clearInterval(t),e.observe(s))},10);return()=>{clearInterval(t),e.disconnect()}}},[y]);let w={...l,style:{...c,margin:0},open:v,getPopupContainer:()=>h.current};i&&(w=i(w)),t&&(w={...w,[t]:{overflow:{adjustX:!1,adjustY:!1}}});return s.createElement("div",{ref:h,style:{paddingBottom:u,position:"relative",minWidth:g}},s.createElement(e,{...w}))})])},"./node_modules/.pnpm/antd@6.7.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/_util/getRenderPropValue.js"(e,t,i){"use strict";var s=i("./node_modules/.pnpm/@rc-component+util@1.14.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@rc-component/util/es/index.js"),o=i("./node_modules/.pnpm/antd@6.7.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/_util/is.js");i.d(t,["b",0,e=>(0,s.AZ)(e)?(0,o.Tn)(e)?e():e:null])},"./node_modules/.pnpm/antd@6.7.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/checkbox/index.js"(e,t,i){"use strict";i.d(t,{A:()=>S});var s=i("react"),o=i.n(s),n=i("./node_modules/.pnpm/@rc-component+checkbox@2.0.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@rc-component/checkbox/es/index.js"),r=i("./node_modules/.pnpm/@rc-component+util@1.14.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@rc-component/util/es/index.js"),l=i("./node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs"),a=i("./node_modules/.pnpm/antd@6.7.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/_util/hooks/useMergeSemantic/index.js"),d=i("./node_modules/.pnpm/antd@6.7.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/_util/wave/index.js"),c=i("./node_modules/.pnpm/antd@6.7.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/_util/wave/interface.js"),h=i("./node_modules/.pnpm/antd@6.7.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/config-provider/context.js"),u=i("./node_modules/.pnpm/antd@6.7.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/config-provider/DisabledContext.js"),p=i("./node_modules/.pnpm/antd@6.7.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/config-provider/hooks/useCSSVarCls.js"),g=i("./node_modules/.pnpm/antd@6.7.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/form/context.js");const m=o().createContext(null);var v=i("./node_modules/.pnpm/antd@6.7.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/checkbox/style/index.js"),f=i("./node_modules/.pnpm/antd@6.7.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/checkbox/useBubbleLock.js");const C=(e,t)=>{const{prefixCls:i,children:o,indeterminate:C=!1,onMouseEnter:y,onMouseLeave:w,onPointerEnter:x,onPointerLeave:_,skipGroup:S=!1,disabled:b,rootClassName:E,className:L,style:T,classNames:O,styles:R,name:I,value:N,checked:B,defaultChecked:A,onChange:M,...D}=e,{getPrefixCls:H,direction:k,className:z,style:F,classNames:P,styles:j}=(0,h.TP)("checkbox"),W=s.useContext(m),{isFormItemInput:G}=s.useContext(g.$W),V=s.useContext(u.A),$=b??W?.disabled??V;const[U,Y]=(0,r.PW)(A,B);let X=U;const Z=s.useRef(null),q=(0,r._q)(e=>{Z.current?.input&&(Z.current.input.indeterminate=C),Y(e.target.checked),M?.(e),!S&&W?.toggleOption&&W.toggleOption({label:o,value:N})});W&&!S&&(X=W.value.includes(N));const K=(0,r.xK)(t,Z);s.useEffect(()=>{if(!S&&W)return W.registerValue(N),()=>{W.cancelValue(N)}},[N,S]),s.useEffect(()=>{Z.current?.input&&(Z.current.input.indeterminate=C)},[C]);const J=H("checkbox",i),Q=(0,p.A)(J),[ee,te]=(0,v.Ay)(J,Q),ie={...D},se={...e,indeterminate:C,disabled:$,checked:X},oe=(0,a.XT)(F),ne=(0,a.XT)(T),[re,le]=(0,a.AV)([P,S?void 0:W?.classNames,O],[j,oe,S?void 0:W?.styles,R,ne],{props:se}),ae=(0,l.$)(`${J}-wrapper`,{[`${J}-rtl`]:"rtl"===k,[`${J}-wrapper-checked`]:X,[`${J}-wrapper-disabled`]:$,[`${J}-wrapper-in-form-item`]:G},z,L,re.root,E,te,Q,ee),de=(0,l.$)(re.icon,{[`${J}-indeterminate`]:C},c.D,ee),[ce,he]=(0,f.A)(ie.onClick);return s.createElement(d.A,{component:"Checkbox",disabled:$},s.createElement("label",{className:ae,style:le.root,onMouseEnter:y,onMouseLeave:w,onPointerEnter:x,onPointerLeave:_,onClick:ce},s.createElement(n.A,{...ie,name:!S&&W?W.name:I,checked:X,onClick:he,onChange:q,prefixCls:J,className:de,style:le.icon,disabled:$,ref:K,value:N}),(0,r.AZ)(o)&&s.createElement("span",{className:(0,l.$)(`${J}-label`,re.label),style:le.label},o)))};const y=s.forwardRef(C);var w=i("./node_modules/.pnpm/@babel+runtime@7.29.7/node_modules/@babel/runtime/helpers/esm/toConsumableArray.js"),x=i("./node_modules/.pnpm/antd@6.7.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/_util/is.js");const _=y;_.Group=o().forwardRef((e,t)=>{const{defaultValue:i,children:s,options:n=[],prefixCls:d,className:c,rootClassName:g,classNames:f,styles:C,style:_,onChange:S,role:b="group",...E}=e,{getPrefixCls:L,direction:T}=o().useContext(h.QO),O=o().useContext(u.A),R=E.disabled??O,[I,N]=(0,r.PW)(i||[],E.value),B=I||[],[A,M]=o().useState([]),D=o().useMemo(()=>n.map(e=>(0,x.Kg)(e)||(0,x.Et)(e)?{label:e,value:e}:e).filter(e=>(0,r.R)(e)&&(0,r.R)(e.value)),[n]),H=e=>{M(t=>t.filter(t=>t!==e))},k=e=>{M(t=>[].concat((0,w.A)(t),[e]))},z=e=>{const t=B.indexOf(e.value),i=(0,w.A)(B);-1===t?i.push(e.value):i.splice(t,1),N(i),S?.(i.filter(e=>A.includes(e)).sort((e,t)=>D.findIndex(t=>t.value===e)-D.findIndex(e=>e.value===t)))},F=L("checkbox",d),P=`${F}-group`,j=(0,p.A)(F),[W,G]=(0,v.Ay)(F,j),V={...e,options:n,value:I,disabled:R},$=(0,a.XT)(_),[U,Y]=(0,a.AV)([f],[C,$],{props:V}),X=(0,r.cJ)(E,["value","disabled"]),Z=D.length>0?D.map(e=>o().createElement(y,{prefixCls:F,key:e.value.toString(),disabled:"disabled"in e?e.disabled:E.disabled,value:e.value,checked:B.includes(e.value),onChange:e.onChange,className:(0,l.$)(`${P}-item`,e.className),style:e.style,title:e.title,id:e.id,required:e.required},e.label)):s,q=o().useMemo(()=>({toggleOption:z,value:B,disabled:E.disabled,name:E.name,classNames:{root:U.item,icon:U.itemIcon,label:U.itemLabel},styles:{root:Y.item,icon:Y.itemIcon,label:Y.itemLabel},registerValue:k,cancelValue:H}),[z,B,E.disabled,E.name,U,Y,k,H]),K=(0,l.$)(P,{[`${P}-rtl`]:"rtl"===T},c,g,U.root,G,j,W);return o().createElement("div",{className:K,style:Y.root,role:b,...X,ref:t},o().createElement(m.Provider,{value:q},Z))}),_.__ANT_CHECKBOX=!0;const S=_},"./node_modules/.pnpm/antd@6.7.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/checkbox/style/index.js"(e,t,i){"use strict";i.d(t,{gd:()=>a});var s=i("./node_modules/.pnpm/@ant-design+cssinjs@2.1.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@ant-design/cssinjs/es/index.js"),o=i("./node_modules/.pnpm/antd@6.7.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/style/index.js"),n=i("./node_modules/.pnpm/antd@6.7.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/style/motion/util.js"),r=i("./node_modules/.pnpm/@ant-design+cssinjs-utils@2.1.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@ant-design/cssinjs-utils/es/index.js"),l=i("./node_modules/.pnpm/antd@6.7.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/theme/util/genStyleUtils.js");function a(e,t){return(e=>{const{checkboxCls:t,checkboxSize:i,lineWidth:r}=e,l=`${t}-wrapper`,a="@media (hover: hover) and (pointer: fine)";return[{[`${t}-group`]:{...(0,o.dF)(e),display:"inline-flex",flexWrap:"wrap",columnGap:e.marginXS,[`> ${e.antCls}-row`]:{flex:1}},[l]:{...(0,o.dF)(e),display:"inline-flex",alignItems:"baseline",cursor:"pointer","&:after":{display:"inline-block",width:0,overflow:"hidden",content:"'\\a0'"},[`& + ${l}`]:{marginInlineStart:0}},[t]:{...(0,o.dF)(e),position:"relative",whiteSpace:"nowrap",lineHeight:1,cursor:"pointer",alignSelf:"center",boxSizing:"border-box",display:"block",width:i,height:i,direction:"ltr",backgroundColor:e.colorBgContainer,border:`${(0,s.zA)(r)} ${e.lineType} ${e.colorBorder}`,borderRadius:e.borderRadiusSM,borderCollapse:"separate",transition:`all ${e.motionDurationSlow}`,flex:"none",...(0,n.V)(),"&:after":{boxSizing:"border-box",position:"absolute",top:`calc(${i} / 2 - ${r})`,insetInlineStart:`calc(${i} / 4 - ${r})`,display:"table",width:e.calc(i).div(14).mul(5).equal(),height:e.calc(i).div(14).mul(8).equal(),border:`${(0,s.zA)(e.lineWidthBold)} solid ${e.colorWhite}`,borderTop:0,borderInlineStart:0,transform:"rotate(45deg) scale(0) translate(-50%,-50%)",opacity:0,content:'""',transition:`all ${e.motionDurationFast} ${e.motionEaseInBack}, opacity ${e.motionDurationFast}`,...(0,n.X)()},[`${t}-input`]:{position:"absolute",inset:`calc(-1 * (${r}))`,zIndex:1,cursor:"pointer",opacity:0,margin:0},[`&:has(${t}-input:focus-visible)`]:(0,o.jk)(e),"& + span":{paddingInlineStart:e.paddingXS,paddingInlineEnd:e.paddingXS}}},{[a]:{[`\n ${l}:not(${l}-disabled),\n ${t}:not(${t}-disabled)\n `]:{[`&:hover ${t}`]:{borderColor:e.colorPrimary}},[`${l}:not(${l}-disabled)`]:{[`&:hover ${t}-checked:not(${t}-disabled)`]:{backgroundColor:e.colorPrimaryHover,borderColor:"transparent"}}}},{[`${t}-checked`]:{backgroundColor:e.colorPrimary,borderColor:e.colorPrimary,"&:after":{opacity:1,transform:"rotate(45deg) scale(1) translate(-50%,-50%)",transition:`all ${e.motionDurationMid} ${e.motionEaseOutBack} ${e.motionDurationFast}`,...(0,n.X)()},[a]:{[`&:not(${t}-disabled):hover`]:{backgroundColor:e.colorPrimaryHover,borderColor:"transparent"}}}},{[t]:{"&-indeterminate":{backgroundColor:e.colorBgContainer,borderColor:e.colorBorder,"&:after":{top:"50%",insetInlineStart:"50%",width:e.calc(e.fontSizeLG).div(2).equal(),height:e.calc(e.fontSizeLG).div(2).equal(),backgroundColor:e.colorPrimary,border:0,transform:"translate(-50%, -50%) scale(1)",opacity:1,content:'""'},[a]:{[`&:not(${t}-disabled):hover`]:{backgroundColor:e.colorBgContainer,borderColor:e.colorPrimary}}}}},{[`${l}-disabled`]:{cursor:"not-allowed"},[`${t}-disabled`]:{[`&, ${t}-input`]:{cursor:"not-allowed",pointerEvents:"none"},background:e.colorBgContainerDisabled,borderColor:e.colorBorder,"&:after":{borderColor:e.colorTextDisabled},"& + span":{color:e.colorTextDisabled},[`&${t}-indeterminate::after`]:{background:e.colorTextDisabled}}}]})((0,r.oX)(t,{checkboxCls:`.${e}`,checkboxSize:t.controlInteractiveSize}))}const d=(0,l.OF)("Checkbox",(e,{prefixCls:t})=>[a(t,e)]);i.d(t,["Ay",0,d])},"./node_modules/.pnpm/antd@6.7.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/checkbox/useBubbleLock.js"(e,t,i){"use strict";i.d(t,{A:()=>r});var s=i("react"),o=i.n(s),n=i("./node_modules/.pnpm/@rc-component+util@1.14.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@rc-component/util/es/index.js");function r(e){const t=o().useRef(null),i=()=>{n.er.cancel(t.current),t.current=null};return[()=>{i(),t.current=(0,n.er)(()=>{t.current=null})},s=>{t.current&&(s.stopPropagation(),i()),e?.(s)}]}},"./node_modules/.pnpm/antd@6.7.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/dropdown/dropdown.js"(e,t,i){"use strict";i.d(t,{A:()=>H});var s=i("react"),o=i("./node_modules/.pnpm/@ant-design+icons@6.3.4_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@ant-design/icons/es/icons/LeftOutlined.js"),n=i("./node_modules/.pnpm/@ant-design+icons@6.3.4_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@ant-design/icons/es/icons/RightOutlined.js"),r=i("./node_modules/.pnpm/@rc-component+dropdown@2.0.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@rc-component/dropdown/es/index.js"),l=i("./node_modules/.pnpm/@rc-component+util@1.14.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@rc-component/util/es/index.js"),a=i("./node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs"),d=i("./node_modules/.pnpm/antd@6.7.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/_util/hooks/useZIndex.js"),c=i("./node_modules/.pnpm/antd@6.7.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/_util/hooks/useMergeSemantic/index.js"),h=i("./node_modules/.pnpm/antd@6.7.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/_util/is.js"),u=i("./node_modules/.pnpm/antd@6.7.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/_util/placements.js"),p=i("./node_modules/.pnpm/antd@6.7.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/_util/PurePanel.js"),g=i("./node_modules/.pnpm/antd@6.7.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/_util/reactNode.js"),m=i("./node_modules/.pnpm/antd@6.7.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/_util/warning.js"),v=i("./node_modules/.pnpm/antd@6.7.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/_util/zindexContext.js"),f=i("./node_modules/.pnpm/antd@6.7.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/config-provider/context.js"),C=i("./node_modules/.pnpm/antd@6.7.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/config-provider/hooks/useCSSVarCls.js"),y=i("./node_modules/.pnpm/antd@6.7.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/menu/index.js"),w=i("./node_modules/.pnpm/antd@6.7.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/menu/OverrideContext.js"),x=i("./node_modules/.pnpm/antd@6.7.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/theme/useToken.js"),_=i("./node_modules/.pnpm/@ant-design+cssinjs@2.1.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@ant-design/cssinjs/es/index.js"),S=i("./node_modules/.pnpm/antd@6.7.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/style/index.js"),b=i("./node_modules/.pnpm/antd@6.7.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/style/motion/slide.js"),E=i("./node_modules/.pnpm/antd@6.7.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/style/motion/move.js"),L=i("./node_modules/.pnpm/antd@6.7.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/style/motion/zoom.js"),T=i("./node_modules/.pnpm/antd@6.7.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/style/placementArrow.js"),O=i("./node_modules/.pnpm/antd@6.7.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/style/roundedArrow.js"),R=i("./node_modules/.pnpm/antd@6.7.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/theme/util/genStyleUtils.js"),I=i("./node_modules/.pnpm/@ant-design+cssinjs-utils@2.1.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@ant-design/cssinjs-utils/es/index.js");const N=e=>{const{componentCls:t,menuCls:i,colorError:s,colorTextLightSolid:o}=e,n=`${i}-item`;return{[`${t}, ${t}-menu-submenu`]:{[`${i} ${n}`]:{[`&${n}-danger:not(${n}-disabled)`]:{color:s,"&:hover":{color:o,backgroundColor:s}}}}}},B=e=>{const{componentCls:t,menuCls:i,zIndexPopup:s,dropdownArrowDistance:o,sizePopupArrow:n,antCls:r,iconCls:l,motionDurationMid:a,paddingBlock:d,fontSize:c,dropdownEdgeChildPadding:h,colorTextDisabled:u,fontSizeIcon:p,controlPaddingHorizontal:g,colorBgElevated:m,controlHeightLG:v}=e;return[{[t]:{position:"absolute",top:-9999,left:{_skip_check_:!0,value:-9999},zIndex:s,display:"block","&::before":{position:"absolute",insetBlock:e.calc(n).div(2).sub(o).equal(),zIndex:-9999,opacity:1e-4,content:'""'},"&-menu-vertical":{maxHeight:`calc(100vh - ${(0,_.zA)(e.calc(v).mul(2.5).equal())})`,overflowY:"auto"},[`&-trigger${r}-btn`]:{[`& > ${l}-down, & > ${r}-btn-icon > ${l}-down`]:{fontSize:p}},"&-hidden, &-menu-hidden, &-menu-submenu-hidden":{display:"none"},[`&${r}-slide-down-enter${r}-slide-down-enter-active${t}-placement-bottomLeft,\n &${r}-slide-down-appear${r}-slide-down-appear-active${t}-placement-bottomLeft,\n &${r}-slide-down-enter${r}-slide-down-enter-active${t}-placement-bottom,\n &${r}-slide-down-appear${r}-slide-down-appear-active${t}-placement-bottom,\n &${r}-slide-down-enter${r}-slide-down-enter-active${t}-placement-bottomRight,\n &${r}-slide-down-appear${r}-slide-down-appear-active${t}-placement-bottomRight`]:{animationName:b.ox},[`&${r}-slide-up-enter${r}-slide-up-enter-active${t}-placement-topLeft,\n &${r}-slide-up-appear${r}-slide-up-appear-active${t}-placement-topLeft,\n &${r}-slide-up-enter${r}-slide-up-enter-active${t}-placement-top,\n &${r}-slide-up-appear${r}-slide-up-appear-active${t}-placement-top,\n &${r}-slide-up-enter${r}-slide-up-enter-active${t}-placement-topRight,\n &${r}-slide-up-appear${r}-slide-up-appear-active${t}-placement-topRight`]:{animationName:b.nP},[`&${r}-slide-down-leave${r}-slide-down-leave-active${t}-placement-bottomLeft,\n &${r}-slide-down-leave${r}-slide-down-leave-active${t}-placement-bottom,\n &${r}-slide-down-leave${r}-slide-down-leave-active${t}-placement-bottomRight`]:{animationName:b.vR},[`&${r}-slide-up-leave${r}-slide-up-leave-active${t}-placement-topLeft,\n &${r}-slide-up-leave${r}-slide-up-leave-active${t}-placement-top,\n &${r}-slide-up-leave${r}-slide-up-leave-active${t}-placement-topRight`]:{animationName:b.YU},[`&${r}-slide-right-enter${r}-slide-right-enter-active${t}-placement-right,\n &${r}-slide-right-appear${r}-slide-right-appear-active${t}-placement-right,\n &${r}-slide-right-enter${r}-slide-right-enter-active${t}-placement-rightTop,\n &${r}-slide-right-appear${r}-slide-right-appear-active${t}-placement-rightTop,\n &${r}-slide-right-enter${r}-slide-right-enter-active${t}-placement-rightBottom,\n &${r}-slide-right-appear${r}-slide-right-appear-active${t}-placement-rightBottom`]:{animationName:b.gx},[`&${r}-slide-left-enter${r}-slide-left-enter-active${t}-placement-left,\n &${r}-slide-left-appear${r}-slide-left-appear-active${t}-placement-left,\n &${r}-slide-left-enter${r}-slide-left-enter-active${t}-placement-leftTop,\n &${r}-slide-left-appear${r}-slide-left-appear-active${t}-placement-leftTop,\n &${r}-slide-left-enter${r}-slide-left-enter-active${t}-placement-leftBottom,\n &${r}-slide-left-appear${r}-slide-left-appear-active${t}-placement-leftBottom`]:{animationName:b.L2},[`&${r}-slide-right-leave${r}-slide-right-leave-active${t}-placement-right,\n &${r}-slide-right-leave${r}-slide-right-leave-active${t}-placement-rightTop,\n &${r}-slide-right-leave${r}-slide-right-leave-active${t}-placement-rightBottom`]:{animationName:b.J6},[`&${r}-slide-left-leave${r}-slide-left-leave-active${t}-placement-left,\n &${r}-slide-left-leave${r}-slide-left-leave-active${t}-placement-leftTop,\n &${r}-slide-left-leave${r}-slide-left-leave-active${t}-placement-leftBottom`]:{animationName:b.EZ}}},(0,T.A)(e,m),{[`${t} ${i}`]:{position:"relative",margin:0},[`${i}-submenu-popup`]:{position:"absolute",zIndex:s,background:"transparent",boxShadow:"none",transformOrigin:"0 0","ul, li":{listStyle:"none",margin:0}},[`${t}, ${t}-menu-submenu`]:{...(0,S.dF)(e),[i]:{padding:h,listStyleType:"none",backgroundColor:m,backgroundClip:"padding-box",borderRadius:e.borderRadiusLG,outline:"none",boxShadow:e.boxShadowSecondary,...(0,S.K8)(e),"&:empty":{padding:0,boxShadow:"none"},[`${i}-item-group-title`]:{padding:`${(0,_.zA)(d)} ${(0,_.zA)(g)}`,color:e.colorTextDescription,transition:`all ${a}`},[`${i}-item`]:{position:"relative",display:"flex",alignItems:"center"},[`${i}-item-icon`]:{minWidth:c,marginInlineEnd:e.marginXS,fontSize:e.fontSizeSM},[`${i}-title-content`]:{flex:"auto","&-with-extra":{display:"inline-flex",alignItems:"center",width:"100%"},[`> a, > ${i}-item-label > a`]:{color:"inherit",transition:`all ${a}`,"&:hover":{color:"inherit"},"&::after":{position:"absolute",inset:0,content:'""'}},[`${i}-item-extra`]:{paddingInlineStart:e.padding,marginInlineStart:"auto",fontSize:e.fontSizeSM,color:e.colorTextDescription}},[`${i}-item, ${i}-submenu-title`]:{display:"flex",margin:0,padding:`${(0,_.zA)(d)} ${(0,_.zA)(g)}`,color:e.colorText,fontWeight:400,fontSize:c,lineHeight:e.lineHeight,cursor:"pointer",transition:`all ${a}`,borderRadius:e.borderRadiusSM,"&:hover, &-active":{backgroundColor:e.controlItemBgHover},...(0,S.K8)(e),"&-selected":{color:e.colorPrimary,backgroundColor:e.controlItemBgActive,"&:hover, &-active":{backgroundColor:e.controlItemBgActiveHover}},"&-disabled":{color:u,cursor:"not-allowed","&:hover":{color:u,backgroundColor:m,cursor:"not-allowed"},a:{pointerEvents:"none"}},"&-divider":{height:1,margin:`${(0,_.zA)(e.marginXXS)} 0`,overflow:"hidden",lineHeight:0,backgroundColor:e.colorSplit},[`${t}-menu-submenu-expand-icon`]:{position:"absolute",insetInlineEnd:e.paddingXS,[`${t}-menu-submenu-arrow-icon`]:{marginInlineEnd:"0 !important",color:e.colorIcon,fontSize:p,fontStyle:"normal"}}},[`${i}-item-group-list`]:{margin:`0 ${(0,_.zA)(e.marginXS)}`,padding:0,listStyle:"none"},[`${i}-submenu-title`]:{paddingInlineEnd:e.calc(g).add(e.fontSizeSM).equal()},[`${i}-submenu-vertical`]:{position:"relative"},[`${i}-submenu${i}-submenu-disabled ${t}-menu-submenu-title`]:{[`&, ${t}-menu-submenu-arrow-icon`]:{color:u,backgroundColor:m,cursor:"not-allowed"}},[`${i}-submenu-selected ${t}-menu-submenu-title`]:{color:e.colorPrimary}}}},[(0,b._j)(e,"slide-up"),(0,b._j)(e,"slide-down"),(0,b._j)(e,"slide-left"),(0,b._j)(e,"slide-right"),(0,E.Mh)(e,"move-up"),(0,E.Mh)(e,"move-down"),(0,L.aB)(e,"zoom-big")]]},A=(0,R.OF)("Dropdown",e=>{const{marginXXS:t,sizePopupArrow:i,paddingXXS:s,componentCls:o}=e,n=(0,I.oX)(e,{menuCls:`${o}-menu`,dropdownArrowDistance:e.calc(i).div(2).add(t).equal(),dropdownEdgeChildPadding:s});return[B(n),N(n)]},e=>({zIndexPopup:e.zIndexPopupBase+50,paddingBlock:(e.controlHeight-e.fontSize*e.lineHeight)/2,...(0,T.K)({contentRadius:e.borderRadiusLG,limitVerticalRadius:!0}),...(0,O.n)(e)}),{resetStyle:!1}),M=s.forwardRef((e,t)=>{const{menu:i,arrow:p,prefixCls:_,children:S,trigger:b,disabled:E,dropdownRender:L,popupRender:T,getPopupContainer:O,overlayClassName:R,rootClassName:I,overlayStyle:N,open:B,onOpenChange:M,mouseEnterDelay:D=.15,mouseLeaveDelay:H=.1,autoAdjustOverflow:k=!0,placement:z="",transitionName:F,classNames:P,styles:j,destroyPopupOnHide:W,destroyOnHidden:G}=e,{getPrefixCls:V,direction:$,getPopupContainer:U,className:Y,style:X,classNames:Z,styles:q}=(0,f.TP)("dropdown"),K={...e,mouseEnterDelay:D,mouseLeaveDelay:H,autoAdjustOverflow:k},J=(0,c.XT)(X),Q=(0,c.XT)(N),[ee,te]=(0,c.AV)([Z,P],[q,J,j,Q],{props:K}),ie={...te.root},se=T||L;(0,m.rJ)("Dropdown");const oe=s.useMemo(()=>{const e=V();return void 0!==F?F:z.startsWith("top")?`${e}-slide-down`:z.startsWith("left")?`${e}-slide-right`:z.startsWith("right")?`${e}-slide-left`:`${e}-slide-up`},[V,z,F]),ne=s.useMemo(()=>z?z.includes("Center")?z.slice(0,z.indexOf("Center")):z:"rtl"===$?"bottomRight":"bottomLeft",[z,$]),re=V("dropdown",_),le=(0,C.A)(re),[ae,de]=A(re,le),[,ce]=(0,x.Ay)(),he=s.Children.only((0,h.sO)(S)?s.createElement("span",null,S):S),ue=(0,l.xK)(t,(0,l.A9)(he)),pe=(0,g.Ob)(he,{className:(0,a.$)(`${re}-trigger`,{[`${re}-rtl`]:"rtl"===$},he.props.className),disabled:he.props.disabled??E,ref:ue}),ge=E?[]:b,me=!!ge?.includes("contextMenu"),[ve,fe]=(0,l.PW)(!1,B),Ce=(0,l._q)(e=>{M?.(e,{source:"trigger"}),fe(e)}),ye=(0,a.$)(R,I,ae,de,le,Y,ee.root,{[`${re}-rtl`]:"rtl"===$}),we=(0,u.A)({arrowPointAtCenter:(0,h.Qd)(p)&&p.pointAtCenter,autoAdjustOverflow:k,offset:ce.marginXXS,arrowWidth:p?ce.sizePopupArrow:0,borderRadius:ce.borderRadius}),xe=(0,l._q)(()=>{i?.selectable&&i?.multiple||(M?.(!1,{source:"menu"}),fe(!1))}),[_e,Se]=(0,d.YK)("Dropdown",ie.zIndex);let be=s.createElement(r.A,{alignPoint:me,...(0,l.cJ)(e,["rootClassName","onOpenChange"]),mouseEnterDelay:D,mouseLeaveDelay:H,open:ve,builtinPlacements:we,arrow:!!p,overlayClassName:ye,prefixCls:re,getPopupContainer:O||U,transitionName:oe,trigger:ge,overlay:()=>{const e=(0,l.cJ)(ee,["root","menu"]),t=(0,l.cJ)(te,["root","menu"]);let r;return i?.items&&(r=s.createElement(y.A,{...i,classNames:{root:ee.menu,...e,subMenu:{...e}},styles:{root:te.menu,...t,subMenu:{...t}}})),se&&(r=se(r)),(0,h.Kg)(r)?r=s.createElement("span",null,r):s.isValidElement(r)||(r=s.createElement(s.Fragment,null,r)),s.createElement(w.A,{prefixCls:`${re}-menu`,rootClassName:(0,a.$)(de,le),expandIcon:s.createElement("span",{className:`${re}-menu-submenu-arrow`},s.createElement("rtl"===$?o.A:n.A,{className:`${re}-menu-submenu-arrow-icon`})),mode:"vertical",selectable:!1,onClick:xe,validator:({})=>{}},r)},placement:ne,onOpenChange:Ce,overlayStyle:{...ie,zIndex:_e},autoDestroy:G??W},pe);return _e&&(be=s.createElement(v.A.Provider,{value:Se},be)),be}),D=(0,p.A)(M,"align",void 0,"dropdown",e=>e);M._InternalPanelDoNotUseOrYouWillBeFired=e=>s.createElement(D,{...e},s.createElement("span",null));const H=M},"./node_modules/.pnpm/antd@6.7.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/dropdown/index.js"(e,t,i){"use strict";i.d(t,{A:()=>p});var s=i("./node_modules/.pnpm/antd@6.7.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/dropdown/dropdown.js"),o=i("react"),n=i("./node_modules/.pnpm/@ant-design+icons@6.3.4_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@ant-design/icons/es/icons/EllipsisOutlined.js"),r=i("./node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs"),l=i("./node_modules/.pnpm/antd@6.7.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/button/index.js"),a=i("./node_modules/.pnpm/antd@6.7.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/config-provider/context.js"),d=i("./node_modules/.pnpm/antd@6.7.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/space/index.js"),c=i("./node_modules/.pnpm/antd@6.7.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/space/Compact.js");const h=e=>{const{getPopupContainer:t,getPrefixCls:i,direction:h}=o.useContext(a.QO),{prefixCls:u,type:p="default",danger:g,disabled:m,loading:v,onClick:f,htmlType:C,children:y,className:w,menu:x,arrow:_,autoFocus:S,trigger:b,align:E,open:L,onOpenChange:T,placement:O,getPopupContainer:R,href:I,icon:N=o.createElement(n.A,null),title:B,buttonsRender:A=e=>e,mouseEnterDelay:M,mouseLeaveDelay:D,overlayClassName:H,overlayStyle:k,destroyOnHidden:z,destroyPopupOnHide:F,dropdownRender:P,popupRender:j,...W}=e,G=i("dropdown",u),V=`${G}-button`,$={menu:x,arrow:_,autoFocus:S,align:E,disabled:m,trigger:m?[]:b,onOpenChange:T,getPopupContainer:R||t,mouseEnterDelay:M,mouseLeaveDelay:D,classNames:{root:H},styles:{root:k},destroyOnHidden:z,popupRender:j||P},{compactSize:U,compactItemClassnames:Y}=(0,c.RQ)(G,h),X=(0,r.$)(V,Y,w);"destroyPopupOnHide"in e&&($.destroyPopupOnHide=F),"open"in e&&($.open=L),$.placement="placement"in e?O:"rtl"===h?"bottomLeft":"bottomRight";const Z=o.createElement(l.A,{type:p,danger:g,disabled:m,loading:v,onClick:f,htmlType:C,href:I,title:B},y),q=o.createElement(l.A,{type:p,danger:g,icon:N}),[K,J]=A([Z,q]);return o.createElement(d.A.Compact,{className:X,size:U,block:!0,...W},K,o.createElement(s.A,{...$},J))};h.__ANT_BUTTON=!0;const u=s.A;u.Button=h;const p=u},"./node_modules/.pnpm/antd@6.7.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/popover/PurePanel.js"(e,t,i){"use strict";var s=i("react"),o=i("./node_modules/.pnpm/@rc-component+tooltip@1.5.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@rc-component/tooltip/es/index.js"),n=i("./node_modules/.pnpm/@rc-component+util@1.14.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@rc-component/util/es/index.js"),r=i("./node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs"),l=i("./node_modules/.pnpm/antd@6.7.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/_util/getRenderPropValue.js"),a=i("./node_modules/.pnpm/antd@6.7.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/_util/hooks/useMergeSemantic/index.js"),d=i("./node_modules/.pnpm/antd@6.7.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/config-provider/context.js"),c=i("./node_modules/.pnpm/antd@6.7.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/popover/style/index.js");const h=e=>{const{title:t,content:i,prefixCls:o,classNames:l,styles:a}=e;return(0,n.AZ)(t)||(0,n.AZ)(i)?s.createElement(s.Fragment,null,(0,n.AZ)(t)&&s.createElement("div",{className:(0,r.$)(`${o}-title`,l?.title),style:a?.title},t),(0,n.AZ)(i)&&s.createElement("div",{className:(0,r.$)(`${o}-content`,l?.content),style:a?.content},i)):null},u=e=>{const{hashId:t,prefixCls:i,className:n,style:d,placement:c="top",title:u,content:p,children:g,classNames:m,styles:v}=e,f=(0,l.b)(u),C=(0,l.b)(p),y={...e,placement:c},[w,x]=(0,a.AV)([m],[v],{props:y}),_=(0,r.$)(t,i,`${i}-pure`,`${i}-placement-${c}`,n);return s.createElement("div",{className:_,style:d},s.createElement("div",{className:`${i}-arrow`}),s.createElement(o.z,{...e,className:t,prefixCls:i,classNames:w,styles:x},g||s.createElement(h,{prefixCls:i,title:f,content:C,classNames:w,styles:x})))};i.d(t,["Ay",0,e=>{const{prefixCls:t,className:i,...o}=e,{getPrefixCls:n}=s.useContext(d.QO),l=n("popover",t),[a,h]=(0,c.A)(l);return s.createElement(u,{...o,prefixCls:l,hashId:a,className:(0,r.$)(i,h)})},"hJ",0,h,"xn",0,u])},"./node_modules/.pnpm/antd@6.7.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/popover/index.js"(e,t,i){"use strict";var s=i("react"),o=i("./node_modules/.pnpm/@rc-component+util@1.14.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@rc-component/util/es/index.js"),n=i("./node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs"),r=i("./node_modules/.pnpm/antd@6.7.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/_util/getRenderPropValue.js"),l=i("./node_modules/.pnpm/antd@6.7.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/_util/hooks/useMergeSemantic/index.js"),a=i("./node_modules/.pnpm/antd@6.7.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/_util/motion.js"),d=i("./node_modules/.pnpm/antd@6.7.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/config-provider/context.js"),c=i("./node_modules/.pnpm/antd@6.7.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/tooltip/index.js"),h=i("./node_modules/.pnpm/antd@6.7.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/tooltip/hook/useMergedArrow.js"),u=i("./node_modules/.pnpm/antd@6.7.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/popover/PurePanel.js"),p=i("./node_modules/.pnpm/antd@6.7.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/popover/style/index.js");const g=s.forwardRef((e,t)=>{const{prefixCls:i,title:g,content:m,overlayClassName:v,placement:f="top",trigger:C,children:y,mouseEnterDelay:w,mouseLeaveDelay:x,onOpenChange:_,overlayStyle:S={},styles:b,classNames:E,motion:L,arrow:T,...O}=e,{getPrefixCls:R,className:I,style:N,classNames:B,styles:A,arrow:M,trigger:D,mouseEnterDelay:H,mouseLeaveDelay:k}=(0,d.TP)("popover"),z=w??H??.1,F=x??k??.1,P=R("popover",i),[j,W]=(0,p.A)(P),G=R(),V=(0,h.A)(T,M),$=C||D||"hover";const U={...e,placement:f,trigger:$,mouseEnterDelay:z,mouseLeaveDelay:F,overlayStyle:S,styles:b,classNames:E},Y=(0,l.XT)(N),X=(0,l.XT)(S),[Z,q]=(0,l.AV)([B,E],[A,Y,b,X],{props:U}),K=(0,n.$)(v,j,W,I,Z.root),[J,Q]=(0,o.PW)(e.defaultOpen??!1,e.open),ee=(0,r.b)(g),te=(0,r.b)(m);return s.createElement(c.A,{unique:!1,arrow:V,placement:f,trigger:$,mouseEnterDelay:z,mouseLeaveDelay:F,...O,prefixCls:P,classNames:{root:K,container:Z.container,arrow:Z.arrow},styles:{root:q.root,container:q.container,arrow:q.arrow},ref:t,open:J,onOpenChange:e=>{Q(e),_?.(e)},overlay:(0,o.AZ)(ee)||(0,o.AZ)(te)?s.createElement(u.hJ,{prefixCls:P,title:ee,content:te,classNames:Z,styles:q}):null,motion:{motionName:(0,a.b)(G,"zoom-big","string"==typeof L?.motionName?L?.motionName:void 0)},"data-popover-inject":!0},y)});g._InternalPanelDoNotUseOrYouWillBeFired=u.Ay;i.d(t,["A",0,g])},"./node_modules/.pnpm/antd@6.7.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/popover/style/index.js"(e,t,i){"use strict";var s=i("./node_modules/.pnpm/antd@6.7.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/style/index.js"),o=i("./node_modules/.pnpm/antd@6.7.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/style/motion/zoom.js"),n=i("./node_modules/.pnpm/antd@6.7.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/style/placementArrow.js"),r=i("./node_modules/.pnpm/antd@6.7.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/style/roundedArrow.js"),l=i("./node_modules/.pnpm/antd@6.7.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/theme/interface/presetColors.js"),a=i("./node_modules/.pnpm/@ant-design+cssinjs-utils@2.1.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@ant-design/cssinjs-utils/es/index.js"),d=i("./node_modules/.pnpm/antd@6.7.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/theme/util/genStyleUtils.js");const c=e=>{const{componentCls:t,popoverColor:i,titleMinWidth:o,fontWeightStrong:r,innerPadding:l,dropShadowPopover:a,colorTextHeading:c,borderRadiusLG:h,zIndexPopup:u,titleMarginBottom:p,colorBgElevated:g,popoverBg:m,titleBorderBottom:v,innerContentPadding:f,titlePadding:C,antCls:y}=e,[w,x]=(0,d.PN)(y,"tooltip");return[{[t]:{...(0,s.dF)(e),position:"absolute",top:0,left:{_skip_check_:!0,value:0},zIndex:u,fontWeight:400,whiteSpace:"normal",textAlign:"start",cursor:"auto",userSelect:"text",filter:a,willChange:"transform",[w("valid-offset-x")]:x("arrow-offset-x","var(--arrow-x)"),transformOrigin:[x("valid-offset-x","50%"),"var(--arrow-y, 50%)"].join(" "),[w("arrow-background-color")]:g,width:"max-content",maxWidth:"100vw","&-rtl":{direction:"rtl"},"&-hidden":{display:"none"},[`${t}-content`]:{position:"relative"},[`${t}-container`]:{backgroundColor:m,backgroundClip:"padding-box",borderRadius:h,padding:l},[`${t}-title`]:{minWidth:o,marginBottom:p,color:c,fontWeight:r,borderBottom:v,padding:C},[`${t}-content`]:{color:i,padding:f}}},(0,n.A)(e,x("arrow-background-color"),{arrowShadow:!1}),{[`${t}-pure`]:{position:"relative",maxWidth:"none",margin:e.sizePopupArrow,display:"inline-block"}}]},h=e=>{const{componentCls:t,antCls:i}=e,[s]=(0,d.PN)(i,"tooltip");return{[t]:l.s.map(i=>{const o=e[`${i}6`];return{[`&${t}-${i}`]:{[s("arrow-background-color")]:o,[`${t}-container`]:{backgroundColor:o},[`${t}-arrow`]:{background:"transparent"}}}})}},u=(0,d.OF)("Popover",e=>{const{colorBgElevated:t,colorText:i}=e,s=(0,a.oX)(e,{popoverBg:t,popoverColor:i});return[c(s),h(s),(0,o.aB)(s,"zoom-big")]},e=>{const{lineWidth:t,controlHeight:i,fontHeight:s,padding:o,wireframe:l,zIndexPopupBase:a,borderRadiusLG:d,marginXS:c,lineType:h,colorSplit:u,paddingSM:p}=e,g=i-s,m=g/2,v=g/2-t,f=o;return{titleMinWidth:177,zIndexPopup:a+30,...(0,r.n)(e),...(0,n.K)({contentRadius:d,limitVerticalRadius:!0}),innerPadding:l?0:12,titleMarginBottom:l?0:c,titlePadding:l?`${m}px ${f}px ${v}px`:0,titleBorderBottom:l?`${t}px ${h} ${u}`:"none",innerContentPadding:l?`${p}px ${f}px`:0}},{resetStyle:!1,deprecatedTokens:[["width","titleMinWidth"],["minWidth","titleMinWidth"]]});i.d(t,["A",0,u])},"./node_modules/.pnpm/antd@6.7.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/spin/index.js"(e,t,i){"use strict";i.d(t,{A:()=>R});var s=i("react"),o=i("./node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs"),n=i("./node_modules/.pnpm/throttle-debounce@5.0.2/node_modules/throttle-debounce/esm/index.js"),r=i("./node_modules/.pnpm/antd@6.7.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/_util/hooks/useMergeSemantic/index.js"),l=i("./node_modules/.pnpm/antd@6.7.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/config-provider/context.js"),a=i("./node_modules/.pnpm/antd@6.7.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/config-provider/hooks/useSize.js"),d=i("./node_modules/.pnpm/antd@6.7.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/_util/reactNode.js"),c=i("./node_modules/.pnpm/@rc-component+util@1.14.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@rc-component/util/es/index.js");const h=80*Math.PI,u=e=>{const{dotClassName:t,style:i,hasCircleCls:n}=e;return s.createElement("circle",{className:(0,o.$)(`${t}-circle`,{[`${t}-circle-bg`]:n}),r:40,cx:50,cy:50,strokeWidth:20,style:i})},p=({percent:e,prefixCls:t})=>{const i=`${t}-dot`,n=`${i}-holder`,r=`${n}-hidden`,[l,a]=s.useState(!1);(0,c.Nf)(()=>{0!==e&&a(!0)},[e]);const d=Math.max(Math.min(e,100),0);if(!l)return null;const p={strokeDashoffset:""+h/4,strokeDasharray:`${h*d/100} ${h*(100-d)/100}`};return s.createElement("span",{className:(0,o.$)(n,`${i}-progress`,{[r]:d<=0})},s.createElement("svg",{viewBox:"0 0 100 100",role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":d},s.createElement(u,{dotClassName:i,hasCircleCls:!0}),s.createElement(u,{dotClassName:i,style:p})))};function g(e){const{prefixCls:t,percent:i=0,className:n,style:r}=e,l=`${t}-dot`,a=`${l}-holder`;return s.createElement(s.Fragment,null,s.createElement("span",{className:(0,o.$)(a,n,i>0&&`${a}-hidden`),style:r},s.createElement("span",{className:(0,o.$)(l,`${t}-dot-spin`)},[1,2,3,4].map(e=>s.createElement("i",{className:`${t}-dot-item`,key:e})))),s.createElement(p,{prefixCls:t,percent:i}))}function m(e){const{prefixCls:t,indicator:i,percent:n,className:r,style:l}=e,a=`${t}-dot`;return i&&s.isValidElement(i)?(0,d.Ob)(i,e=>({className:(0,o.$)(e.className,a,r),style:{...e.style,...l},percent:n})):s.createElement(g,{prefixCls:t,percent:n,className:r,style:l})}var v=i("./node_modules/.pnpm/@ant-design+cssinjs@2.1.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@ant-design/cssinjs/es/index.js"),f=i("./node_modules/.pnpm/antd@6.7.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/style/index.js"),C=i("./node_modules/.pnpm/antd@6.7.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/theme/util/genStyleUtils.js"),y=i("./node_modules/.pnpm/@ant-design+cssinjs-utils@2.1.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@ant-design/cssinjs-utils/es/index.js");const w=new v.Mo("antSpinMove",{to:{opacity:1}}),x=new v.Mo("antRotate",{to:{transform:"rotate(405deg)"}}),_=e=>{const{componentCls:t}=e,i=`${t}-section`;return{[t]:{...(0,f.dF)(e),position:"relative","&-rtl":{direction:"rtl"},[`&${i}, > ${i}`]:{display:"flex",alignItems:"center",flexDirection:"column",gap:e.paddingSM,color:e.colorPrimary},[`&${i}`]:{display:"inline-flex"},[`> ${i}`]:{position:"absolute",top:"50%",left:{_skip_check_:!0,value:"50%"},transform:"translate(-50%, -50%)",zIndex:1},[`${t}-description`]:{fontSize:e.fontSize,lineHeight:1},[`${t}-container`]:{position:"relative",transition:`opacity ${e.motionDurationSlow}`,"&::after":{position:"absolute",top:0,insetInlineEnd:0,bottom:0,insetInlineStart:0,zIndex:10,width:"100%",height:"100%",background:e.colorBgContainer,opacity:0,transition:`all ${e.motionDurationSlow}`,content:'""',pointerEvents:"none"}},"&-spinning":{[`${t}-description`]:{textShadow:`0 0px 5px ${e.colorBgContainer}`},[`${t}-container`]:{clear:"both",opacity:.5,userSelect:"none",pointerEvents:"none","&::after":{opacity:.4,pointerEvents:"auto"}}},"&-fullscreen":{position:"fixed",inset:0,backgroundColor:e.colorBgMask,zIndex:e.zIndexPopupBase,opacity:0,pointerEvents:"none",transition:`all ${e.motionDurationMid}`,[`&${t}-spinning`]:{opacity:1,pointerEvents:"auto"},[`> ${i}`]:{color:e.colorWhite,[`${t}-description`]:{color:e.colorTextLightSolid}}}}}},S=e=>{const{componentCls:t,antCls:i,motionDurationSlow:s}=e,[o,n]=(0,C.PN)(i,"spin");return{[t]:{[o("dot-holder-size")]:e.dotSize,[o("dot-item-size")]:`calc((${n("dot-holder-size")} - ${e.marginXXS} / 2) / 2)`,[`${t}-dot`]:{"&-holder":{width:"1em",height:"1em",fontSize:n("dot-holder-size"),display:"inline-block",transition:["transform","opacity"].map(e=>`${e} ${s} ease`).join(", "),transformOrigin:"50% 50%",lineHeight:1,"&-hidden":{transform:"scale(0.3)",opacity:0}},position:"relative",display:"inline-block",fontSize:n("dot-holder-size"),width:"1em",height:"1em","&-spin":{transform:"rotate(45deg)",animationName:x,animationDuration:"1.2s",animationIterationCount:"infinite",animationTimingFunction:"linear"},"&-item":{position:"absolute",display:"block",width:n("dot-item-size"),height:n("dot-item-size"),background:"currentColor",borderRadius:"100%",transform:"scale(0.75)",transformOrigin:"50% 50%",opacity:.3,animationName:w,animationDuration:"1s",animationIterationCount:"infinite",animationTimingFunction:"linear",animationDirection:"alternate","&:nth-child(1)":{top:0,insetInlineStart:0,animationDelay:"0s"},"&:nth-child(2)":{top:0,insetInlineEnd:0,animationDelay:"0.4s"},"&:nth-child(3)":{insetInlineEnd:0,bottom:0,animationDelay:"0.8s"},"&:nth-child(4)":{bottom:0,insetInlineStart:0,animationDelay:"1.2s"}},"&-progress":{position:"absolute",left:"50%",top:0,transform:"translateX(-50%)"},"&-circle":{strokeLinecap:"round",transition:["stroke-dashoffset","stroke-dasharray","stroke","stroke-width","opacity"].map(e=>`${e} ${s} ease`).join(","),fillOpacity:0,stroke:"currentcolor"},"&-circle-bg":{stroke:e.colorFillSecondary}}}}},b=e=>{const{componentCls:t}=e,[i]=(0,C.PN)(e.antCls,"spin");return{[t]:{"&-sm":{[i("dot-holder-size")]:e.dotSizeSM},"&-lg":{[i("dot-holder-size")]:e.dotSizeLG}}}},E=(0,C.OF)("Spin",e=>{const t=(0,y.oX)(e,{spinDotDefault:e.colorTextDescription});return[_(t),S(t),b(t)]},e=>{const{controlHeightLG:t,controlHeight:i}=e;return{contentHeight:400,dotSize:t/2,dotSizeSM:.35*t,dotSizeLG:i}}),L=[[30,.05],[70,.03],[96,.01]];let T;const O=s.forwardRef((e,t)=>{const{prefixCls:i,spinning:d=!0,delay:c=0,className:h,rootClassName:u,size:p,tip:g,description:v,wrapperClassName:f,style:C,children:y,fullscreen:w=!1,indicator:x,percent:_,classNames:S,styles:b,...O}=e,{getPrefixCls:R,direction:I,indicator:N,className:B,style:A,classNames:M,styles:D}=(0,l.TP)("spin"),H=R("spin",i),[k,z]=E(H),[F,P]=s.useState(()=>d&&!function(e,t){return!!e&&!!t&&!Number.isNaN(Number(t))}(d,c)),j=function(e,t){const[i,o]=s.useState(0),n=s.useRef(null),r="auto"===t;return s.useEffect(()=>(r&&e&&(o(0),n.current=setInterval(()=>{o(e=>{const t=100-e;for(let i=0;i<L.length;i+=1){const[s,o]=L[i];if(e<=s)return e+t*o}return e})},200)),()=>{n.current&&(clearInterval(n.current),n.current=null)}),[r,e]),r?i:t}(F,_);s.useEffect(()=>{if(d){const e=(0,n.s)(c,()=>{P(!0)});return e(),()=>{e?.cancel?.()}}P(!1)},[c,d]);const W=(0,a.A)(e=>p??e),G=v??g,V={...e,size:W,spinning:F,tip:G,description:G,fullscreen:w,children:y,percent:j},$=(0,r.XT)(A),[U,Y]=(0,r.AV)([M,S],[D,$,b],{props:V});const X=x??N??T,Z=void 0!==y,q=Z||w,K=s.createElement(s.Fragment,null,s.createElement(m,{className:(0,o.$)(U.indicator),style:Y.indicator,prefixCls:H,indicator:X,percent:j}),G&&s.createElement("div",{className:(0,o.$)(`${H}-description`,U.tip,U.description),style:{...Y.tip,...Y.description}},G)),J=s.useRef(null);return s.useImperativeHandle(t,()=>({nativeElement:J.current})),s.createElement("div",{ref:J,className:(0,o.$)(H,{[`${H}-sm`]:"small"===W,[`${H}-lg`]:"large"===W,[`${H}-spinning`]:F,[`${H}-rtl`]:"rtl"===I,[`${H}-fullscreen`]:w},u,U.root,w&&U.mask,q?f:[`${H}-section`,U.section],B,h,k,z),style:{...Y.root,...q?{}:Y.section,...w?Y.mask:{},...C},"aria-live":"polite","aria-busy":F,...O},F&&(q?s.createElement("div",{className:(0,o.$)(`${H}-section`,U.section),style:Y.section},K):K),Z&&s.createElement("div",{className:(0,o.$)(`${H}-container`,U.container),style:Y.container},y))});O.setDefaultIndicator=e=>{T=e};const R=O},"./node_modules/.pnpm/antd@6.7.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/style/motion/move.js"(e,t,i){"use strict";var s=i("./node_modules/.pnpm/@ant-design+cssinjs@2.1.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@ant-design/cssinjs/es/index.js"),o=i("./node_modules/.pnpm/antd@6.7.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/style/motion/motion.js");const n=new s.Mo("antMoveDownIn",{"0%":{transform:"translate3d(0, 100%, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),r=new s.Mo("antMoveDownOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(0, 100%, 0)",transformOrigin:"0 0",opacity:0}}),l=new s.Mo("antMoveLeftIn",{"0%":{transform:"translate3d(-100%, 0, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),a=new s.Mo("antMoveLeftOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(-100%, 0, 0)",transformOrigin:"0 0",opacity:0}}),d=new s.Mo("antMoveRightIn",{"0%":{transform:"translate3d(100%, 0, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),c=new s.Mo("antMoveRightOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(100%, 0, 0)",transformOrigin:"0 0",opacity:0}}),h={"move-up":{inKeyframes:new s.Mo("antMoveUpIn",{"0%":{transform:"translate3d(0, -100%, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),outKeyframes:new s.Mo("antMoveUpOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(0, -100%, 0)",transformOrigin:"0 0",opacity:0}})},"move-down":{inKeyframes:n,outKeyframes:r},"move-left":{inKeyframes:l,outKeyframes:a},"move-right":{inKeyframes:d,outKeyframes:c}};i.d(t,["Mh",0,(e,t)=>{const{antCls:i}=e,s=`${i}-${t}`,{inKeyframes:n,outKeyframes:r}=h[t];return[(0,o.b)(s,n,r,e.motionDurationMid),{[`\n ${s}-enter,\n ${s}-appear\n `]:{opacity:0,animationTimingFunction:e.motionEaseOutCirc},[`${s}-leave`]:{animationTimingFunction:e.motionEaseInOutCirc}}]}])},"./node_modules/.pnpm/css-loader@6.11.0_webpack@5.108.4/node_modules/css-loader/dist/cjs.js!./node_modules/.pnpm/@antv+s2-react-components@2.1.2_@ant-design+icons@6.3.4_react-dom@18.3.1_react@18.3.1___c662a9bb2c1574364f240ef8e03c3384/node_modules/@antv/s2-react-components/dist/s2-react-components.min.css"(e,t,i){"use strict";var s=i("./node_modules/.pnpm/css-loader@6.11.0_webpack@5.108.4/node_modules/css-loader/dist/runtime/noSourceMaps.js"),o=i.n(s),n=i("./node_modules/.pnpm/css-loader@6.11.0_webpack@5.108.4/node_modules/css-loader/dist/runtime/api.js"),r=i.n(n)()(o());r.push([e.id,'.antv-s2-icon{color:inherit}.antv-s2-radio-group{color:#3572f9;cursor:pointer;display:flex;justify-content:space-between;align-items:flex-start}.antv-s2-radio-group.antv-s2-radio-group-icon-only .ant-radio-group .ant-radio-button-wrapper{border:none;background:transparent;box-shadow:none}.antv-s2-radio-group.antv-s2-radio-group-icon-only .ant-radio-group .ant-radio-button-wrapper:before{display:none}.antv-s2-radio-group.antv-s2-radio-group-icon-only .ant-radio-group .ant-radio-button-wrapper-checked{background:transparent;border:none;box-shadow:none;outline:none}.antv-s2-radio-group.antv-s2-radio-group-icon-only .ant-radio-group .ant-radio-button-wrapper-checked:focus-visible,.antv-s2-radio-group.antv-s2-radio-group-icon-only .ant-radio-group .ant-radio-button-wrapper-checked:focus-within{border:none;outline:none}.antv-s2-radio-group+.antv-s2-radio-group{margin-top:6px}.antv-s2-radio-group-label{flex:1 0;flex-wrap:nowrap;display:inline-flex;color:#00000073;font-size:14px;margin-right:12px}.antv-s2-radio-group-content{display:flex;flex-direction:column;align-items:flex-start}.antv-s2-reset-btn{color:#3572f9;cursor:pointer;padding-left:8px}.antv-s2-reset-btn-text{margin-left:4px}.antv-s2-reset-group{width:340px}.antv-s2-advanced-sort{display:inline-block}.antv-s2-advanced-sort-btn.ant-btn{display:flex;align-items:center}.antv-s2-advanced-sort-btn.ant-btn .antv-s2-icon{padding-top:2px}.antv-s2-advanced-sort-modal{min-width:640px}.antv-s2-advanced-sort-modal .ant-modal-content,.antv-s2-advanced-sort-modal .ant-modal-header{background-color:var(--antv-s2-container-background, #fff)}.antv-s2-advanced-sort-modal .antv-s2-advanced-sort-sider-layout.ant-layout-sider{border-right:1px solid var(--antv-s2-border, #f0f0f0);background:var(--antv-s2-container-background, #fff)}.antv-s2-advanced-sort-modal .antv-s2-advanced-sort-sider-layout .antv-s2-advanced-sort-title{font-size:12px;padding:8px 16px 8px 0;border-bottom:1px solid var(--antv-s2-border, #f0f0f0)}.antv-s2-advanced-sort-modal .antv-s2-advanced-sort-sider-layout .antv-s2-advanced-sort-dimension-item{height:32px;padding:8px 6px 8px 0;cursor:pointer;align-items:center;color:var(--antv-s2-font-65, rgba(0, 0, 0, .65));font-size:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.antv-s2-advanced-sort-modal .antv-s2-advanced-sort-content-layout{background:var(--antv-s2-container-background, #fff)}.antv-s2-advanced-sort-modal .antv-s2-advanced-sort-content-layout .antv-s2-advanced-sort-title{font-size:12px;padding:8px 16px;border-bottom:1px solid var(--antv-s2-border, #f0f0f0)}.antv-s2-advanced-sort-modal .antv-s2-advanced-sort-content-layout .antv-s2-advanced-sort-custom-form.ant-form{padding:8px 0 0 16px}.antv-s2-advanced-sort-modal .antv-s2-advanced-sort-content-layout .antv-s2-advanced-sort-custom-form.ant-form .ant-form-item-label>label,.antv-s2-advanced-sort-modal .antv-s2-advanced-sort-content-layout .antv-s2-advanced-sort-custom-form.ant-form .ant-select,.antv-s2-advanced-sort-modal .antv-s2-advanced-sort-content-layout .antv-s2-advanced-sort-custom-form.ant-form .ant-select-item,.antv-s2-advanced-sort-modal .antv-s2-advanced-sort-content-layout .antv-s2-advanced-sort-custom-form.ant-form .ant-form label{font-size:12px}.antv-s2-advanced-sort-modal .antv-s2-advanced-sort-content-layout .antv-s2-advanced-sort-custom-form.ant-form .ant-radio-group{margin-left:16px;font-size:12px}.antv-s2-advanced-sort-modal .antv-s2-advanced-sort-content-layout .antv-s2-advanced-sort-custom-form.ant-form .ant-form-item{margin-bottom:4px}.antv-s2-advanced-sort-modal .antv-s2-advanced-sort-content-layout .antv-s2-advanced-sort-custom-form.ant-form .ant-form-item .ant-cascader-picker,.antv-s2-advanced-sort-modal .antv-s2-advanced-sort-content-layout .antv-s2-advanced-sort-custom-form.ant-form .ant-form-item .ant-select{width:120px}.antv-s2-advanced-sort-modal .antv-s2-advanced-sort-content-layout .antv-s2-advanced-sort-custom-form.ant-form .ant-form-item-control-input-content{display:flex;align-items:center}.antv-s2-advanced-sort-modal .antv-s2-advanced-sort-content-layout .antv-s2-advanced-sort-rule-end{margin-left:16px;font-size:12px}.antv-s2-advanced-sort-modal .antv-s2-advanced-sort-content-layout .antv-s2-advanced-sort-rule-end label{font-size:12px;margin:0}.antv-s2-advanced-sort-modal .antv-s2-advanced-sort-content-layout .antv-s2-advanced-sort-rule-end-delete{cursor:pointer;right:0;position:absolute}.antv-s2-advanced-sort-modal .antv-s2-advanced-sort-content-layout .antv-s2-advanced-sort-field-prefix{position:relative;padding:0 6px;color:var(--antv-s2-font-65, rgba(0, 0, 0, .65));font-weight:400;font-size:12px;text-align:center;background-color:var(--antv-s2-block-background, #fafafa);border:1px solid var(--antv-s2-border, #f0f0f0);border-radius:4px 0 0 4px;height:24px;display:inline-block;line-height:21px;margin-left:8px}.antv-s2-advanced-sort-modal .antv-s2-advanced-sort-content-layout .antv-s2-advanced-sort-field-prefix+.ant-select .ant-select-selector{border-radius:0 4px 4px 0}.antv-s2-advanced-sort-modal .ant-cascader-menus{height:100px}.antv-s2-advanced-sort-modal .ant-cascader-menus ul{height:104px}.antv-s2-advanced-sort-modal .ant-cascader-menu-item,.antv-s2-advanced-sort-modal .ant-cascader-picker-label{font-size:12px}.antv-s2-advanced-sort-custom-modal .antv-s2-advanced-sort-card-content .ant-card-body{padding:0;font-size:12px}.antv-s2-advanced-sort-custom-modal .antv-s2-advanced-sort-card-content .ant-card-body .antv-s2-advanced-sort-split-value{height:32px;color:var(--antv-s2-font-65, #333);line-height:32px;padding:0 10px 0 7px}.antv-s2-advanced-sort-custom-modal .antv-s2-advanced-sort-card-content .ant-card-body .antv-s2-advanced-sort-split-value .antv-s2-advanced-sort-split-icon{float:right;cursor:pointer;width:30px}.antv-s2-advanced-sort-custom-modal .antv-s2-advanced-sort-card-content .ant-card-body .antv-s2-advanced-sort-split-value .antv-s2-advanced-sort-split-icon svg{fill:var(--antv-s2-font-65)}.antv-s2-advanced-sort-custom-modal .antv-s2-advanced-sort-card-content .ant-card-body .antv-s2-advanced-sort-split-value:nth-child(odd){background:var(--antv-s2-block-background, #f7f9fb)}.antv-s2-drill-down{width:260px;min-height:20px;position:relative;color:var(--antv-s2-font-70, rgba(0, 0, 0, .9))}.antv-s2-drill-down-header{display:flex;height:32px;font-size:14px;padding:0 16px;margin-top:16px;align-items:center;justify-content:space-between}.antv-s2-drill-down-header button{position:absolute;right:0;top:0;font-size:12px;color:#1890ff;line-height:20px}.antv-s2-drill-down-search{height:24px;width:228px!important;margin:0 16px;border:1px solid rgba(0,0,0,.15);border-radius:2px}.antv-s2-drill-down-search input,.antv-s2-drill-down-search span{font-size:12px}.antv-s2-drill-down-search,.antv-s2-drill-down-search .ant-input::placeholder{background-color:var(--antv-s2-block-background, #fff)}.antv-s2-drill-down-menu{max-height:314px;overflow:hidden auto}.antv-s2-drill-down-menu.ant-menu{background:var(--antv-s2-tooltip-background, #fff)}.antv-s2-drill-down-menu.ant-menu:not(.ant-menu-horizontal) .ant-menu-item-selected{background-color:var(--antv-s2-block-background, #e6f7ff)}.antv-s2-drill-down-menu-item{height:32px!important;line-height:32px!important;font-size:12px;opacity:.65}.antv-s2-drill-down-menu-item span:last-child{line-height:32px}.antv-s2-drill-down-menu-item svg{margin-right:8px}.antv-s2-drill-down-empty{padding:12px;font-size:12px}.antv-s2-switcher-item{height:24px;border-radius:3px;display:flex}.antv-s2-switcher-item-text{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.antv-s2-switcher-item.normal-item{padding:0 12px;background-color:var(--antv-s2-block-background, #d9eeff);align-items:center;border:1px solid var(--antv-s2-border, #d9eeff)}.antv-s2-switcher-item.checkable-item{padding:0 4px;background-color:var(--antv-s2-block-background, #d3f4e5);align-items:baseline;border:1px solid var(--antv-s2-border, #d3f4e5);border-bottom-width:0}.antv-s2-switcher-item.checkable-item:last-child{border-bottom-width:1px}.antv-s2-switcher-item.checkable-item.item-collapse{transition:border-radius 0s .2s;border-radius:3px!important}.antv-s2-switcher-item.checkable-item.unchecked{color:var(--antv-s2-font-25, rgba(0, 0, 0, .25))}.antv-s2-switcher-item.checkable-item:not(:last-child){border-radius:3px 3px 0 0}.antv-s2-switcher-item.checkable-item .ant-checkbox{margin-right:4px}.antv-s2-switcher-normal-list,.antv-s2-switcher-checkable-list{border-radius:3px}.antv-s2-switcher-normal-list+.antv-s2-switcher-normal-list,.antv-s2-switcher-normal-list+.antv-s2-switcher-checkable-list,.antv-s2-switcher-checkable-list+.antv-s2-switcher-normal-list,.antv-s2-switcher-checkable-list+.antv-s2-switcher-checkable-list{margin-top:4px}.antv-s2-switcher-normal-list.dragging,.antv-s2-switcher-checkable-list.dragging{box-shadow:0 0 2px 1px #0000001a}.antv-s2-switcher-normal-list.disable-dragging,.antv-s2-switcher-checkable-list.disable-dragging{cursor:not-allowed}.antv-s2-switcher-normal-list .child-items,.antv-s2-switcher-checkable-list .child-items{transition:max-height .2s,opacity .4s;overflow:hidden;max-height:1000px}.antv-s2-switcher-normal-list .child-items .checkable-item,.antv-s2-switcher-checkable-list .child-items .checkable-item{padding:0 12px;background-color:var(--antv-s2-block-background, #effbf6);margin-top:0;border-radius:0}.antv-s2-switcher-normal-list .child-items .checkable-item:not(:last-child),.antv-s2-switcher-checkable-list .child-items .checkable-item:not(:last-child){border-top-width:0;border-bottom-width:0}.antv-s2-switcher-normal-list .child-items .checkable-item:last-child,.antv-s2-switcher-checkable-list .child-items .checkable-item:last-child{border-top-width:0;border-radius:0 0 3px 3px}.antv-s2-switcher-normal-list .child-items.item-hidden,.antv-s2-switcher-checkable-list .child-items.item-hidden{max-height:0;opacity:0}.antv-s2-switcher-tooltip .ant-tooltip-inner{max-width:180px}.antv-s2-switcher-dimension{background-color:transparent;display:flex;flex-direction:column}.antv-s2-switcher-dimension.long-dimension{grid-row:span 2}.antv-s2-switcher-dimension-header{display:flex;align-items:center;margin-bottom:8px;justify-content:space-between}.antv-s2-switcher-dimension-header .title{display:inline-flex;align-items:center}.antv-s2-switcher-dimension-header .title span{margin-left:8px}.antv-s2-switcher-dimension-header .expand-option{font-size:12px}.antv-s2-switcher-dimension-header .expand-option .description{margin-left:4px}.antv-s2-switcher-dimension-items{flex:1;min-height:120px;padding:8px;border:1px solid rgba(0,0,0,.15);border-radius:4px;overflow-y:auto;background:var(--antv-s2-block-background)}.antv-s2-switcher-dimension-items-highlight{border:1px solid #6b9cff;box-shadow:0 0 2px 1px #2e5bd933}.antv-s2-switcher-dimension-items::-webkit-scrollbar-thumb{border-radius:5px;background-color:#00000026}.antv-s2-switcher-dimension-items::-webkit-scrollbar-thumb:hover{background-color:#00000040}.antv-s2-switcher-dimension-items::-webkit-scrollbar{width:6px}.antv-s2-switcher-content-header,.antv-s2-switcher-content-main{margin-bottom:16px}.antv-s2-switcher-content-header{font-size:14px;font-weight:700}.antv-s2-switcher-content-main{display:grid;grid-gap:16px;grid-auto-flow:column;font-size:12px}.antv-s2-switcher-content-three-dimensions{grid-template-rows:repeat(2,160px);grid-template-columns:repeat(2,minmax(180px,1fr))}.antv-s2-switcher-content-one-dimension{grid-template-rows:160px;grid-template-columns:1fr}.antv-s2-switcher-content-footer{display:flex;align-items:center;justify-content:space-between;gap:0 10px}.antv-s2-switcher-content-footer-reset-button.ant-btn{font-size:14px;padding:0}.antv-s2-switcher-content-footer-actions .action-button+.action-button{margin-left:8px}.antv-s2-switcher-content .ant-checkbox-inner{height:14px;width:14px}.antv-s2-switcher-content .ant-checkbox-inner:after{width:4.8px;height:8px}.antv-s2-switcher-switcher-overlay .ant-popover-inner,.antv-s2-switcher-switcher-overlay .ant-popover-arrow-content:before{background:var(--antv-s2-container-background, #fff)}.antv-s2-switcher-entry-button.ant-btn{display:inline-flex;align-items:center}.antv-s2-frozen-panel{width:400px}.antv-s2-frozen-panel-container{display:flex;align-items:center;justify-content:space-between}.antv-s2-frozen-panel-container:not(:last-of-type){margin-bottom:6px}.antv-s2-frozen-panel-container-group{color:#0000006e}.antv-s2-frozen-panel-container-group:not(:last-of-type){margin-right:12px}.antv-s2-frozen-panel-container .ant-checkbox-wrapper{margin-right:50px;color:#535455}.antv-s2-frozen-panel-container .ant-input-number.antv-s2-frozen-input-number{width:50px;margin:0 4px;border-radius:4px}.antv-s2-color-box{display:inline-flex;box-sizing:border-box;width:20px;height:20px;border:1px solid rgba(0,0,0,.06);border-radius:2px;cursor:pointer;transition:all .3s}.antv-s2-color-box:hover{transform:scale(1.1)}.antv-s2-color-picker-panel{width:218px}.antv-s2-color-picker-panel-header{display:flex;align-items:center;margin-bottom:8px}.antv-s2-color-picker-panel-header-title{display:inline-flex;margin-right:8px;color:#000000d9;font-weight:500;font-size:12px;line-height:20px}.antv-s2-color-picker-panel-section{margin-bottom:8px}.antv-s2-color-picker-panel-section-title{margin-bottom:8px;color:#000000a6;font-size:12px;line-height:20px}.antv-s2-color-picker-panel-section-color-list{display:flex}.antv-s2-color-picker-panel-section-color-list .antv-s2-color-box:not(:last-child){margin-right:6px}.antv-s2-color-picker-panel-collapse-collapse-title{color:#000000a6;font-size:12px;line-height:20px}.antv-s2-color-picker-panel-collapse .ant-collapse-content-box{padding:0!important}.antv-s2-color-picker-panel-collapse .ant-collapse-content-box .antv-s2-color-picker-panel-sketch-picker{box-shadow:none!important;border-radius:0!important;padding:0!important;background:transparent!important}.antv-s2-theme-panel-custom-color{display:flex;align-items:center;padding-top:10px}.antv-s2-theme-panel-custom-color:before{position:relative;display:block;flex:1;content:""}.antv-s2-theme-panel-custom-color>div{display:flex;flex:2;align-items:center}.antv-s2-theme-panel-custom-color-title{margin-right:20px;color:#00000073;font-size:12px}\n',""]);i.d(t,["A",0,r])},"./node_modules/.pnpm/css-loader@6.11.0_webpack@5.108.4/node_modules/css-loader/dist/cjs.js!./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/ui/tooltip/index.css"(e,t,i){"use strict";var s=i("./node_modules/.pnpm/css-loader@6.11.0_webpack@5.108.4/node_modules/css-loader/dist/runtime/noSourceMaps.js"),o=i.n(s),n=i("./node_modules/.pnpm/css-loader@6.11.0_webpack@5.108.4/node_modules/css-loader/dist/runtime/api.js"),r=i.n(n)()(o());r.push([e.id,".antv-s2-tooltip-container {\n position: fixed;\n user-select: text;\n min-width: 200px;\n max-width: 640px;\n max-height: 100vh;\n overflow: auto;\n z-index: 1024;\n display: inline-block;\n background: var(--antv-s2-tooltip-background, rgba(255, 255, 255, 0.95));\n border-radius: 4px;\n box-shadow: 0 1px 4px 0 rgba(0, 0, 0, 0.2);\n font-size: 12px;\n font-family: Roboto, 'PingFang SC', 'Chinese Quote', 'Segoe UI',\n 'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial,\n sans-serif;\n}\n\n.antv-s2-tooltip-container-hide {\n opacity: 0;\n visibility: hidden;\n pointer-events: none;\n}\n\n.antv-s2-tooltip-container-hide * {\n transition: none;\n}\n\n.antv-s2-tooltip-container-show {\n opacity: 1;\n visibility: visible;\n pointer-events: all;\n}\n",""]);i.d(t,["A",0,r])},"./node_modules/.pnpm/css-loader@6.11.0_webpack@5.108.4/node_modules/css-loader/dist/cjs.js!./src/components/fragments/SheetSwitcher.css"(e,t,i){"use strict";var s=i("./node_modules/.pnpm/css-loader@6.11.0_webpack@5.108.4/node_modules/css-loader/dist/runtime/noSourceMaps.js"),o=i.n(s),n=i("./node_modules/.pnpm/css-loader@6.11.0_webpack@5.108.4/node_modules/css-loader/dist/runtime/api.js"),r=i.n(n)()(o());r.push([e.id,".dac-s2-switcher-overlay .ant-popover-inner {\n color: var(--antv-s2-font-70);\n background: var(--antv-s2-container-background);\n}\n\n.dac-s2-switcher-overlay .antv-s2-switcher-content-main {\n max-width: calc(100vw - 48px);\n}\n\n.dac-s2-switcher-overlay .antv-s2-switcher-dimension-items {\n color: var(--antv-s2-font-70);\n border-color: var(--antv-s2-border);\n overflow-x: hidden;\n overscroll-behavior: contain;\n}\n\n.dac-s2-switcher-overlay .antv-s2-switcher-item.normal-item,\n.dac-s2-switcher-overlay .antv-s2-switcher-item.checkable-item {\n color: var(--antv-s2-font-70);\n border-color: var(--antv-s2-border);\n}\n\n.dac-s2-switcher-overlay .antv-s2-switcher-item.unchecked {\n color: var(--antv-s2-font-25);\n}\n\nbody > .antv-s2-switcher-normal-list.dragging,\nbody > .antv-s2-switcher-checkable-list.dragging {\n box-sizing: border-box;\n z-index: 1100;\n}\n",""]);i.d(t,["A",0,r])},"./node_modules/.pnpm/@antv+s2-react-components@2.1.2_@ant-design+icons@6.3.4_react-dom@18.3.1_react@18.3.1___c662a9bb2c1574364f240ef8e03c3384/node_modules/@antv/s2-react-components/dist/s2-react-components.min.css"(e,t,i){"use strict";var s=i("./node_modules/.pnpm/style-loader@3.3.4_webpack@5.108.4/node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"),o=i.n(s),n=i("./node_modules/.pnpm/style-loader@3.3.4_webpack@5.108.4/node_modules/style-loader/dist/runtime/styleDomAPI.js"),r=i.n(n),l=i("./node_modules/.pnpm/style-loader@3.3.4_webpack@5.108.4/node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js"),a=i.n(l),d=i("./node_modules/.pnpm/style-loader@3.3.4_webpack@5.108.4/node_modules/style-loader/dist/runtime/insertStyleElement.js"),c=i.n(d),h=i("./node_modules/.pnpm/style-loader@3.3.4_webpack@5.108.4/node_modules/style-loader/dist/runtime/styleTagTransform.js"),u=i.n(h),p=i("./node_modules/.pnpm/css-loader@6.11.0_webpack@5.108.4/node_modules/css-loader/dist/cjs.js!./node_modules/.pnpm/@antv+s2-react-components@2.1.2_@ant-design+icons@6.3.4_react-dom@18.3.1_react@18.3.1___c662a9bb2c1574364f240ef8e03c3384/node_modules/@antv/s2-react-components/dist/s2-react-components.min.css"),g={};g.styleTagTransform=u(),g.setAttributes=a(),g.insert=function(e){const t=document.querySelector("head"),i=window._lastElementInsertedByStyleLoader;i?i.nextSibling?t.insertBefore(e,i.nextSibling):t.appendChild(e):t.insertBefore(e,t.firstChild),window._lastElementInsertedByStyleLoader=e},g.domAPI=r(),g.insertStyleElement=c();o()(p.A,g)},"./src/components/fragments/async/extensions/Sheet.tsx"(e,t,i){"use strict";i.r(t),i.d(t,{default:()=>qr});var s,o,n=i("react"),r=i.n(n),l=i("./node_modules/.pnpm/@antv+g@6.3.3/node_modules/@antv/g/dist/index.esm.js"),a=i("./node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/lodash.js"),d=i("./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/common/constant/interaction.js");!function(e){e.Row="frozenRow",e.Col="frozenCol",e.TrailingRow="frozenTrailingRow",e.TrailingCol="frozenTrailingCol"}(s||(s={})),function(e){e.Row="frozenRowGroup",e.Col="frozenColGroup",e.TrailingCol="frozenTrailingColGroup",e.TrailingRow="frozenTrailingRowGroup",e.TopLeft="frozenTopLeftGroup",e.TopRight="frozenTopRightGroup",e.BottomLeft="frozenBottomLeftGroup",e.BottomRight="frozenBottomRightGroup",e.Scroll="scrollGroup"}(o||(o={}));const c={[s.Row]:o.Row,[s.Col]:o.Col,[s.TrailingRow]:o.TrailingRow,[s.TrailingCol]:o.TrailingCol};var h=i("./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/common/constant/basic.js");var u,p,g,m;!function(e){e.Horizontal="col",e.Vertical="row"}(u||(u={})),function(e){e.Field="field",e.Cell="cell",e.Tree="tree",e.Series="series"}(p||(p={})),function(e){e.ALL="all",e.CURRENT="current",e.SELECTED="selected"}(g||(g={})),function(e){e.ROW_CELL_HOVER="row-cell:hover",e.ROW_CELL_CLICK="row-cell:click",e.ROW_CELL_DOUBLE_CLICK="row-cell:double-click",e.ROW_CELL_CONTEXT_MENU="row-cell:context-menu",e.ROW_CELL_MOUSE_DOWN="row-cell:mouse-down",e.ROW_CELL_MOUSE_UP="row-cell:mouse-up",e.ROW_CELL_MOUSE_MOVE="row-cell:mouse-move",e.ROW_CELL_SCROLL="row-cell:scroll",e.ROW_CELL_BRUSH_SELECTION="row-cell:brush-selection",e.ROW_CELL_COLLAPSED="row-cell:collapsed",e.ROW_CELL_ALL_COLLAPSED="row-cell:all-collapsed",e.ROW_CELL_RENDER="row-cell:render",e.ROW_CELL_SELECTED="row-cell:selected",e.ROW_CELL_COLLAPSED__PRIVATE="row-cell:collapsed__private",e.ROW_CELL_ALL_COLLAPSED__PRIVATE="row-cell:all-collapsed__private",e.DATA_CELL_HOVER_TRIGGERED_PRIVATE="data-cell:hover-trigger__private",e.DATA_CELL_CLICK_TRIGGERED_PRIVATE="data-cell:click-trigger__private",e.COL_CELL_HOVER="col-cell:hover",e.COL_CELL_CLICK="col-cell:click",e.COL_CELL_DOUBLE_CLICK="col-cell:double-click",e.COL_CELL_CONTEXT_MENU="col-cell:context-menu",e.COL_CELL_MOUSE_DOWN="col-cell:mouse-down",e.COL_CELL_MOUSE_UP="col-cell:mouse-up",e.COL_CELL_MOUSE_MOVE="col-cell:mouse-move",e.COL_CELL_BRUSH_SELECTION="col-cell:brush-selection",e.COL_CELL_EXPANDED="col-cell:expanded",e.COL_CELL_EXPAND_ICON_HOVER="col-cell:expand-icon-hover",e.COL_CELL_HIDDEN="col-cell:hidden",e.COL_CELL_RENDER="col-cell:render",e.COL_CELL_SELECTED="col-cell:selected",e.DATA_CELL_HOVER="data-cell:hover",e.DATA_CELL_CLICK="data-cell:click",e.DATA_CELL_DOUBLE_CLICK="data-cell:double-click",e.DATA_CELL_CONTEXT_MENU="data-cell:context-menu",e.DATA_CELL_MOUSE_UP="data-cell:mouse-up",e.DATA_CELL_MOUSE_DOWN="data-cell:mouse-down",e.DATA_CELL_MOUSE_MOVE="data-cell:mouse-move",e.DATA_CELL_BRUSH_SELECTION="data-cell:brush-selection",e.DATA_CELL_SELECT_MOVE="data-cell:select-move",e.DATA_CELL_RENDER="data-cell:render",e.DATA_CELL_SELECTED="data-cell:selected",e.CORNER_CELL_HOVER="corner-cell:hover",e.CORNER_CELL_CLICK="corner-cell:click",e.CORNER_CELL_DOUBLE_CLICK="corner-cell:double-click",e.CORNER_CELL_CONTEXT_MENU="corner-cell:context-menu",e.CORNER_CELL_MOUSE_DOWN="corner-cell:mouse-down",e.CORNER_CELL_MOUSE_UP="corner-cell:mouse-up",e.CORNER_CELL_MOUSE_MOVE="corner-cell:mouse-move",e.CORNER_CELL_RENDER="corner-cell:render",e.CORNER_CELL_SELECTED="corner-cell:selected",e.MERGED_CELLS_HOVER="merged-cells:hover",e.MERGED_CELLS_CLICK="merged-cells:click",e.MERGED_CELLS_DOUBLE_CLICK="merged-cells:double-click",e.MERGED_CELLS_CONTEXT_MENU="merged-cells:context-menu",e.MERGED_CELLS_MOUSE_DOWN="merged-cells:mouse-down",e.MERGED_CELLS_MOUSE_UP="merged-cells:mouse-up",e.MERGED_CELLS_MOUSE_MOVE="merged-cells:mouse-move",e.MERGED_CELLS_RENDER="merged-cells:render",e.SERIES_NUMBER_CELL_RENDER="series-number-cell:render",e.RANGE_SORT="sort:range-sort",e.RANGE_SORTED="sort:range-sorted",e.RANGE_FILTER="filter:range-filter",e.RANGE_FILTERED="filter:range-filtered",e.LAYOUT_AFTER_HEADER_LAYOUT="layout:after-header-layout",e.LAYOUT_CELL_RENDER="layout:cell-render",e.LAYOUT_PAGINATION="layout:pagination",e.LAYOUT_AFTER_REAL_DATA_CELL_RENDER="layout:after-real-data-cell-render",e.LAYOUT_AFTER_RENDER="layout:after-render",e.LAYOUT_BEFORE_RENDER="layout:before-render",e.LAYOUT_DESTROY="layout:destroy",e.LAYOUT_RESIZE="layout:resize",e.LAYOUT_RESIZE_SERIES_WIDTH="layout:resize-series-width",e.LAYOUT_RESIZE_ROW_WIDTH="layout:resize-row-width",e.LAYOUT_RESIZE_ROW_HEIGHT="layout:resize-row-height",e.LAYOUT_RESIZE_COL_WIDTH="layout:resize-column-width",e.LAYOUT_RESIZE_COL_HEIGHT="layout:resize-column-height",e.LAYOUT_RESIZE_TREE_WIDTH="layout:resize-tree-width",e.LAYOUT_RESIZE_MOUSE_DOWN="layout:resize:mouse-down",e.LAYOUT_RESIZE_MOUSE_MOVE="layout:resize:mouse-move",e.LAYOUT_RESIZE_MOUSE_UP="layout:resize-mouse-up",e.GLOBAL_KEYBOARD_DOWN="global:keyboard-down",e.GLOBAL_KEYBOARD_UP="global:keyboard-up",e.GLOBAL_COPIED="global:copied",e.GLOBAL_MOUSE_UP="global:mouse-up",e.GLOBAL_MOUSE_MOVE="global:mouse-move",e.GLOBAL_ACTION_ICON_CLICK="global:action-icon-click",e.GLOBAL_ACTION_ICON_HOVER="global:action-icon-hover",e.GLOBAL_ACTION_ICON_HOVER_OFF="global:action-icon-hover-off",e.GLOBAL_CONTEXT_MENU="global:context-menu",e.GLOBAL_CLICK="global:click",e.GLOBAL_PREVIEW_CLICK="global:preview-click",e.GLOBAL_DOUBLE_CLICK="global:double-click",e.GLOBAL_SELECTED="global:selected",e.GLOBAL_HOVER="global:hover",e.GLOBAL_RESET="global:reset",e.GLOBAL_LINK_FIELD_JUMP="global:link-field-jump",e.GLOBAL_SCROLL="global:scroll"}(m||(m={}));var v=i("./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/common/interface/basic.js");class f extends l.rw{constructor(e,t){super(e),this.appendInfo=t}}function C(e,t=2){return(0,a.floor)(e,t)}function y(e){return(0,a.isNumber)(e)?C(e,0):e}var w=i("./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/utils/g-renders.js");const x=(e,t)=>t>0&&e<t,_=(e,t,i)=>t>0&&e>=i-t,S=(e,t,i)=>i>0&&e<t+i,b=(e,t,i)=>i>0&&e>=t+1-i,E=(e,t,i)=>{if(e){const[s,o]=e.getPosition();e.translate(t-s,i-o)}},L=(e=[])=>{const t=(e=>{const t=[],i=e=>{e.forEach(e=>{"string"!=typeof e&&e.children?i(e.children):t.push(e)})};return i(e),t})(e);return t.map(e=>"string"==typeof e?e:e.field)};class T extends l.YJ{constructor(e){super(),this.cfg=e,this.render()}layout(){this.addCornerBottomBorder(),this.addCornerRightBorder(),this.addSplitLineShadow()}render(){this.removeChildren(),this.layout()}static getHorizontalBorderWidth(e){var t;const{horizontalBorderWidth:i}=null===(t=e.theme)||void 0===t?void 0:t.splitLine;return i}static getVerticalBorderWidth(e){var t;const{splitLine:i,cornerCell:s,colCell:o,dataCell:n}=e.theme;return e.isPivotMode()?null==i?void 0:i.verticalBorderWidth:Math.max(n.cell.verticalBorderWidth,(null===(t=e.options.seriesNumber)||void 0===t?void 0:t.enable)?s.cell.verticalBorderWidth:o.cell.verticalBorderWidth)}onBorderScroll(e){if(e!==this.cfg.scrollX){this.cfg.scrollX=e;const{position:t}=this.cfg;E(this,t.x-e,0),this.render()}}onChangeShadowVisibility(e,t){const{colCount:i,trailingColCount:s}=this.cfg.spreadsheet.facet.getFrozenOptions(),o=0===i&&e>0,n=0===s&&C(e)<C(t);this.cfg.showViewportLeftShadow===o&&this.cfg.showViewportRightShadow===n||(this.cfg.showViewportLeftShadow=o,this.cfg.showViewportRightShadow=n,this.render())}getCornerRightBorderSizeForPivotMode(){var e;const{cornerHeight:t,viewportHeight:i,position:s,spreadsheet:o}=this.cfg,{horizontalBorderWidth:n}=null===(e=o.theme)||void 0===e?void 0:e.splitLine;return{y:s.y,height:t+n+i}}addCornerRightHeadBorder(){var e,t;const{cornerWidth:i,cornerHeight:s,position:o,spreadsheet:n}=this.cfg,{verticalBorderColor:r,verticalBorderColorOpacity:l}=null===(e=n.theme)||void 0===e?void 0:e.splitLine,a=T.getVerticalBorderWidth(n),d=T.getHorizontalBorderWidth(n),c=o.x+i+a/2,{verticalBorderColor:h,verticalBorderColorOpacity:u,backgroundColor:p,backgroundColorOpacity:g}=(null===(t=n.options.seriesNumber)||void 0===t?void 0:t.enable)||n.isPivotMode()?n.theme.cornerCell.cell:n.theme.colCell.cell;[{stroke:p,strokeOpacity:g},{stroke:r||h,strokeOpacity:l||u}].forEach(({stroke:e,strokeOpacity:t})=>{(0,w.ni)(this,{x1:c,y1:o.y,x2:c,y2:o.y+s+d,lineWidth:a,stroke:e,strokeOpacity:t})})}addCornerRightBorder(){var e;const{cornerWidth:t,cornerHeight:i,viewportHeight:s,position:o,spreadsheet:n}=this.cfg,{verticalBorderColor:r,verticalBorderColorOpacity:l}=null===(e=n.theme)||void 0===e?void 0:e.splitLine,a=T.getVerticalBorderWidth(n),d=T.getHorizontalBorderWidth(n),c=o.x+t+a/2;this.addCornerRightHeadBorder();const{verticalBorderColor:h,verticalBorderColorOpacity:u,backgroundColor:p,backgroundColorOpacity:g}=n.theme.dataCell.cell;[{stroke:p,strokeOpacity:g},{stroke:r||h,strokeOpacity:l||u}].forEach(({stroke:e,strokeOpacity:t})=>{(0,w.ni)(this,{x1:c,y1:o.y+i+d,x2:c,y2:o.y+i+d+s,lineWidth:a,stroke:e,strokeOpacity:t})})}addCornerBottomBorder(){var e,t;const i=this.cfg,{cornerWidth:s,cornerHeight:o,viewportWidth:n,position:r,scrollX:l=0,spreadsheet:a}=i,{horizontalBorderColor:d,horizontalBorderWidth:c,horizontalBorderColorOpacity:h}=null===(e=a.theme)||void 0===e?void 0:e.splitLine,{horizontalBorderColor:u,horizontalBorderColorOpacity:p}=(null===(t=a.options.seriesNumber)||void 0===t?void 0:t.enable)||a.isPivotMode()?a.theme.cornerCell.cell:a.theme.colCell.cell,g=r.x,m=g+s+T.getVerticalBorderWidth(a)+n+(a.isFrozenRowHeader()?0:l),v=r.y+o+c/2;this.cornerBottomBorder=(0,w.ni)(this,{x1:g,y1:v,x2:m,y2:v,stroke:d||u,lineWidth:c,opacity:h||p})}addSplitLineShadow(){var e;const t=this.cfg,{spreadsheet:i}=t,s=null===(e=i.theme)||void 0===e?void 0:e.splitLine;i.isPivotMode()&&(null==s?void 0:s.showShadow)&&i.isFrozenRowHeader()&&(this.addSplitLineLeftShadow(),this.addSplitLineRightShadow())}addSplitLineLeftShadow(){var e;if(!this.cfg.showViewportLeftShadow)return;const{cornerWidth:t,cornerHeight:i,viewportHeight:s,position:o,spreadsheet:n}=this.cfg,{shadowColors:r,shadowWidth:a,horizontalBorderWidth:d}=null===(e=n.theme)||void 0===e?void 0:e.splitLine,c=o.x+t+T.getVerticalBorderWidth(n);this.appendChild(new l.rw({style:{x:c,y:o.y,width:a,height:i+d+s,fill:`l (0) 0:${null==r?void 0:r.left} 1:${null==r?void 0:r.right}`}}))}addSplitLineRightShadow(){var e;if(!this.cfg.showViewportRightShadow)return;const{cornerWidth:t,viewportWidth:i,position:s,spreadsheet:o}=this.cfg,{shadowColors:n,shadowWidth:r}=null===(e=o.theme)||void 0===e?void 0:e.splitLine,a=s.x+t+T.getVerticalBorderWidth(o)+i-r,{y:d,height:c}=this.getCornerRightBorderSizeForPivotMode();this.appendChild(new l.rw({style:{x:a,y:d,width:r,height:c,fill:`l (0) 0:${null==n?void 0:n.right} 1:${null==n?void 0:n.left}`}}))}}var O,R=i("./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/utils/cell/cell.js");!function(e){e[e.Start=0]="Start",e[e.Center=1]="Center",e[e.End=2]="End"}(O||(O={}));const I=e=>["left","top"].includes(e)?O.Start:["center","middle"].includes(e)?O.Center:O.End,N=(e,t,i,s)=>{const{isCustomRenderer:o=!1}=s||{},{align:n,size:r,padding:l}=i,{textSize:a,iconStartSize:d=0,iconEndSize:c=0}=r;let{betweenTextAndEndIcon:h=0}=l;h=c?h:0;const u=a+d+c,p=t.start-l.start,g=p+(t.size+l.start+l.end),m=t.start+t.size,v=e.start+e.size;function f(e){switch(n){case O.Start:return{iconStart:e.start,textStart:e.start+d,iconEnd:e.start+d+a+h};case O.Center:const t=e.start+e.size/2-u/2;return{iconStart:t,textStart:t+d+(o?0:a/2),iconEnd:t+d+a+h};default:const i=e.start+e.size;return{iconStart:i-c-a-d,textStart:i-c-(o?a:0),iconEnd:i-c+h}}}if(p>=e.start&&g<=v)return f(t);if(p<e.start&&g<=v){const i={start:e.start+(n!==O.End?l.start:0),size:t.size-(e.start-t.start)-(n!==O.End?l.start:0)};return i.size<u&&(i.size=u,i.start=m-u),f(i)}if(p>=e.start&&g>v){const e={start:t.start,size:t.size-(m-v)-(n!==O.Start?l.end:0)};return e.size<u&&(e.size=u,e.start=t.start),f(e)}const C={start:e.start+l.start,size:e.size-l.start-l.end};if(C.size<u){const e=t.start+t.size/2-u/2;e>C.start||(e+u>C.start+C.size?C.start=e:C.start-=u-C.size),C.size=u}return f(C)};var B=i("./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/utils/g-utils.js"),A=i("./node_modules/.pnpm/tslib@2.8.1/node_modules/tslib/tslib.es6.mjs");const M=e=>e.includes("[&]")?"id":"field",D=(e,t=[])=>{const i=e.facet.getInitColIndexLeafNodes();return(0,a.compact)(t.map(e=>{const t=M(e);return i.find(i=>i[t]===e)}))},H=(e,...t)=>(0,A.sH)(void 0,[e,...t],void 0,function*(e,t=[],i=!1){const s=(...t)=>(0,A.sH)(void 0,[...t],void 0,function*(t=[],i=[]){e.setOptions({interaction:{hiddenColumnFields:t}}),e.interaction.reset(),e.store.set("hiddenColumnsDetail",i),yield e.render({reloadData:!1,rebuildHiddenColumnsDetail:!1})});if((0,a.isEmpty)(t)&&i)return void(yield s());const o=e.store.get("hiddenColumnsDetail",[]),{hiddenColumnFields:n=[]}=e.options.interaction;if((0,a.isEqual)(t,n)&&!i)return;const r=(0,a.uniq)([...t,...n]),l=D(e,r).every((e,t,i)=>{const s=i[t+1];return!s||1===Math.abs(e.colIndex-s.colIndex)}),d=((e,t=[])=>{if((0,a.isEmpty)(t))return{prev:null,next:null};const i=e.facet.getInitColIndexLeafNodes(),s=D(e,t).map(e=>i.findIndex(t=>t.id===e.id)),o=Math.max(...s),n=Math.min(...s),r=i.find((e,t)=>t===o+1);return{prev:i.find((e,t)=>t===n-1)||null,next:r||null}})(e,l?r:t),c={hideColumnNodes:D(e,t),displaySiblingNode:d},h=((e,t)=>t.findIndex(t=>e.hideColumnNodes.some(e=>{var i;return null===(i=t.hideColumnNodes)||void 0===i?void 0:i.find(t=>t.id===e.id)})))(c,o);let u=[];u=-1!==h?o.map((e,t)=>t===h?c:e):[...o,c],e.emit(m.COL_CELL_HIDDEN,c,u),yield s(r,u)}),k=(e,...t)=>(0,A.sH)(void 0,[e,...t],void 0,function*(e,t=[],i=!1){(0,a.isEmpty)(t)&&i&&(yield H(e,t,!0));const s=(e=>{const{columns:t=[]}=e.dataCfg.fields;return e.isTableMode()&&!e.isCustomColumnFields()?t:e.facet.getInitColIndexLeafNodes().map(({id:e})=>e)})(e),o=((e,t)=>{if((0,a.isEmpty)(t))return[];let i=Number.NEGATIVE_INFINITY;return e.reduce((e,s,o)=>{if(!t.includes(s))return e;if(o===i+1){const t=(0,a.last)(e);null==t||t.push(s)}else e.push([s]);return i=o,e},[])})(L(s),t);yield Promise.all(o.map(t=>(0,A.sH)(void 0,void 0,void 0,function*(){yield H(e,t,i)})))}),z=(e,t,i)=>((e,t)=>{const i=((e,t)=>t?null==e?void 0:e[t]:(null==e?void 0:e.next)||(null==e?void 0:e.prev))(e,t);return null==i?void 0:i.id})(e,i)===t,F=(e,t,i)=>{var s;const o=[],n=(null===(s=e.options.interaction)||void 0===s?void 0:s.hiddenColumnFields)||[],r=D(e,n),l=new Map(r.map(e=>[e.id,e])),d=e.facet.getInitColIndexLeafNodes(),c="prev"===i?1:-1;for(let e=d.findIndex(e=>e.id===t)+c;e<d.length;e+=c){const t=d[e];if(!t)break;if(!l.has(null==t?void 0:t.id))break;o.push(t)}return(0,a.sortBy)(o,"colIndex")},P=e=>{const{type:t,theme:i,width:s,height:o}=e,n=(0,A.Tt)(e,["type","theme","width","height"]);return{style:{fill:i.background,fillOpacity:i.backgroundOpacity,cursor:`${t}-resize`,width:t===u.Horizontal?i.size:void 0,height:t===u.Vertical?i.size:void 0},appendInfo:Object.assign(Object.assign({},n),{isResizeArea:!0,type:t,width:s,height:o,size:i.size})}},j=(e,t)=>{var i;if(!(null===(i=e.facet)||void 0===i?void 0:i.foregroundGroup))return;return e.facet.foregroundGroup.getElementById(t)||e.facet.foregroundGroup.appendChild(new l.YJ({id:t,style:{zIndex:5}}))},W=(e,t,i)=>{const{scrollX:s=0,scrollY:o=0}=null!=i?i:{};return!(e.x-s>t.x+t.width||e.x+e.width-s<t.x)&&!(e.y-o>t.y+t.height||e.y+e.height-o<t.y)},G="valueRanges",V={},$="#000000",U="#FFFFFF";var Y;!function(e){e.VIDEO="VIDEO",e.IMAGE="IMAGE"}(Y||(Y={}));const X="videoRect",Z=new Error("Failed to load image and fallback");function q(e){const{src:t,fallback:i,timeout:s=1e4,mediaCache:o,crossOrigin:n="Anonymous",referrerPolicy:r,cacheKeyPrefix:l}=e,a=l?`${l}:${t}`:t;return new Promise((e,d)=>{if(null==o?void 0:o.has(a)){const t=o.get(a);if(t instanceof HTMLImageElement)return void e(t);if(null===t)return void d(Z)}const c=t=>{null==o||o.set(a,t),e(t)},h=e=>{null==o||o.set(a,null),d(e)},u=()=>{i?q({src:i,timeout:s,mediaCache:o}).then(c).catch(h):h(Z)},p=()=>{n?q({src:t,timeout:s,mediaCache:o,crossOrigin:null,referrerPolicy:"no-referrer",cacheKeyPrefix:l}).then(c).catch(u):u()},g=new Image;n&&(g.crossOrigin=n),r&&(g.referrerPolicy=r),g.src=t;const m=setTimeout(p,s);g.onload=()=>{clearTimeout(m),c(g)},g.onerror=()=>{clearTimeout(m),p()},g.onabort=()=>{clearTimeout(m),p()}})}function K(e,t,i,s){if(e<=0||t<=0)return{width:0,height:0};if(i<=0||s<=0)return{width:e,height:t};const o=Math.min(e/i,t/s);return{width:Math.floor(i*o),height:Math.floor(s*o)}}function J(e){return(0,A.sH)(this,arguments,void 0,function*(e,t=""){try{e&&(t=(yield e(t))||t)}catch(e){console.warn("fail to prepareText",e)}return t})}var Q=i("./node_modules/.pnpm/flru@1.0.2/node_modules/flru/dist/flru.mjs");class ee{static getCacheKey(e,t){return`${e}:${t}`}getLoading(e){var t;const{x:i,y:s,height:o,width:n}=this.getCellInfo(e),r=.25*Math.min(o,n),a=i+n/2,d=s+o/2,c=new l.wA({style:{d:`M${a} ${d-r}\n A${r} ${r} 0 0 1 ${a+r} ${d}`,stroke:null===(t=e.getIconStyle())||void 0===t?void 0:t.fill,transformOrigin:`${a} ${d}`}});return e.appendChild(c),setTimeout(()=>{c.animate([{transform:"rotate(0)"},{transform:"rotate(360deg)"}],{duration:1e3,iterations:1/0})}),c}process(e,t){return(0,A.sH)(this,void 0,void 0,function*(){const i=this.getLoading(t),s=yield this.prepare(e,t),o=this.generateConfig(e,t,s);t.removeChild(i),i.destroy(),this.render(t,o)})}destroy(){}getCellInfo(e){var t;const i=e.getFieldValue(),s=null!==(t=null==i?void 0:i.toString())&&void 0!==t?t:"";return Object.assign({text:s},e.getBBoxByType(v.Ok.CONTENT_BOX))}prepareText(e,t){const{text:i}=this.getCellInfo(t);return J(e.prepareText,i)}}ee.mediaCache=(0,Q.A)(200);class te extends ee{prepare(e,t){return(0,A.sH)(this,void 0,void 0,function*(){return q({src:yield this.prepareText(e,t),fallback:e.fallback,timeout:e.timeout,mediaCache:ee.mediaCache,cacheKeyPrefix:"image"})})}generateConfig(e,t,i){const{y:s,height:o,width:n}=t.getBBoxByType(v.Ok.CONTENT_BOX),{width:r,height:l}=K(n,o,i.naturalWidth,i.naturalHeight),{x:a}=t.getContentPosition({contentWidth:r});return{style:Object.assign({x:a,y:s,src:i,width:r,height:l},e.config)}}render(e,t){e.appendChild(new l._V(t))}destroy(){}}var ie=i("./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/common/icons/gui-icon.js");const se={loop:!0,autoplay:!1,preload:"auto",crossOrigin:!0,controls:!1,muted:!0};class oe extends ee{constructor(){super(...arguments),this.fallback=""}prepare(e,t){return(0,A.sH)(this,void 0,void 0,function*(){const i=yield this.prepareText(e,t);return new Promise(s=>{const{height:o,width:n}=this.getCellInfo(t),{timeout:r=1e4,fallback:l=""}=e;this.fallback=l;const a=ee.getCacheKey("video",i);if(ee.mediaCache.has(a)){const e=ee.mediaCache.get(a);if(e instanceof HTMLVideoElement||e instanceof HTMLImageElement)return void s(e);if(null===e)return void s(l)}const d=document.createElement("video"),c=()=>(0,A.sH)(this,void 0,void 0,function*(){if(l){const e=yield q({src:l,fallback:"",timeout:5e3,mediaCache:ee.mediaCache}).catch(()=>null);if(e)return ee.mediaCache.set(a,e),void s(e)}ee.mediaCache.set(a,null),s(l)}),h=setTimeout(c,r),u=Object.assign(Object.assign({height:o,width:n,src:i},se),e.videoConfig);Object.assign(d,u),d.onloadeddata=()=>{clearTimeout(h),u.autoplay||(d.pause(),d.currentTime=.001),ee.mediaCache.set(a,d),s(d)};const p=()=>{clearTimeout(h),c()};["error","abort","stalled"].forEach(e=>{d.addEventListener(e,p)})})})}generateConfig(e,t,i){const{y:s,height:o}=t.getBBoxByType(v.Ok.CONTENT_BOX),n=Math.max(t.getMaxTextWidth(),0);let r=n,l=o,a="transparent";if(i instanceof HTMLVideoElement||i instanceof HTMLImageElement){const{width:e,height:t}=(d=i)instanceof HTMLVideoElement?{width:d.videoWidth,height:d.videoHeight}:{width:d.naturalWidth,height:d.naturalHeight},{width:s,height:c}=K(n,o,e,t);r=s,l=c,a={image:i,repetition:"no-repeat",transform:`scale(${s/e}, ${c/t})`}}else a="transparent";var d;const{x:c}=t.getContentPosition({contentWidth:r});return{style:Object.assign({x:c,y:s+(o-l)/2,width:r,height:l,fill:a},e.config),isFallback:i instanceof HTMLImageElement}}render(e,t){if(t.isFallback)return void e.appendChild(new l._V((0,a.merge)({},t,{style:{src:this.fallback}})));const i=new l.rw(Object.assign(Object.assign({},t),{name:X})),{x:s,y:o,width:n,height:r}=t.style,d=.25*Math.min(n,r);i.appendChild(new ie.r({name:"Play",width:d,height:d,x:s+n/2-d/2,y:o+r/2-d/2,pointerEvents:"none",cursor:"pointer"})),e.appendChild(i)}}class ne{static getInstance(e){if(!ne.instances.has(e)){let t;switch(e){case Y.IMAGE:t=new te;break;case Y.VIDEO:t=new oe;break;default:t=null}t&&ne.instances.set(e,t)}return ne.instances.get(e)}static render(e,t){return ne.getInstance(e.type).process(e,t)}}ne.instances=new Map;var re=i("./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/utils/cell/header-cell.js"),le=i("./node_modules/.pnpm/tinycolor2@1.6.0/node_modules/tinycolor2/esm/tinycolor.js");const ae=[95,85,75,30,15,0,15,30,45,60,80],de=e=>(0,le.A)(e).getLuminance()<=.5,ce=[{fontColorIndex:0,bgColorIndex:3},{fontColorIndex:13,bgColorIndex:8},{fontColorIndex:14,bgColorIndex:1}],he=(e={})=>{const t=Array.from(Array(15)).fill(U),{basicColorRelations:i=[],brandColor:s}=e,o=(e=>{const t=[];for(let i=0;i<11;i++){const s=ae[i];t.push((0,a.toUpper)(0===s?e:le.A.mix(e,i<5?"#FFFFFF":"#000000",s).toHexString()))}return t})(s);return i.forEach(e=>{t[e.basicColorIndex]=o[e.standardColorIndex]}),ce.forEach(({fontColorIndex:e,bgColorIndex:i})=>{t[e]=de(t[i])?U:$}),Object.assign(Object.assign({},e),{basicColors:t})};var ue=i("./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/utils/condition/condition.js");var pe;!function(e){e.PC="pc",e.MOBILE="mobile"}(pe||(pe={}));var ge=i("./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/utils/ssr.js");function me(e){return e===pe.MOBILE||!((0,ge.fU)()||!(0,ge.w9)())&&/(?:iPhone|iPad|SymbianOS|Windows Phone|iPod|iOS|Android|Mobile|Phone|Tablet)/i.test(navigator.userAgent)}function ve(){return!(0,ge.fU)()&&/windows/i.test(navigator.userAgent)}var fe=i("./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/utils/text.js");class Ce extends l.YJ{get actualText(){return this.getMultiLineActualTexts().join("")}constructor(e,t,...i){super({}),this.textShapes=[],this.conditionIconShapes=[],this.stateShapes=new Map,this.borders=new Map,this.meta=e,this.spreadsheet=t,this.theme=t.theme,this.conditions=this.spreadsheet.options.conditions,this.groupedIcons={left:[],right:[]},this.handleRestOptions(...i),this.shouldInit()&&this.initCell()}handleRestOptions(...e){}getResizedTextMaxLines(){}getMeta(){return this.meta}setMeta(e){this.meta=e}getIconStyle(){var e;return null===(e=this.theme[this.cellType])||void 0===e?void 0:e.icon}isShallowRender(){return!1}getCellTextWordWrapStyle(e){var t,i;const{wordWrap:s,maxLines:o,textOverflow:n}=(null===(i=null===(t=this.spreadsheet.options)||void 0===t?void 0:t.style)||void 0===i?void 0:i[e||this.cellType])||{};return{wordWrap:s,maxLines:o,textOverflow:n}}getActualText(){return this.getMultiLineActualTexts().join("")}getActualTextWidth(){var e;return(null===(e=this.textShape)||void 0===e?void 0:e.getComputedTextLength())||0}getActualTextHeight(){return this.getMultiLineActualTextHeight()}getMultiLineActualTexts(){var e,t,i;return null===(e=this.textShape)||void 0===e||e.getGeometryBounds(),(null===(i=null===(t=this.textShape)||void 0===t?void 0:t.parsedStyle.metrics)||void 0===i?void 0:i.lines)||[]}getMultiLineActualTextWidth(){return(0,a.sumBy)(this.getTextLineBoundingRects(),"width")||0}getMultiLineActualTextHeight(){return(0,a.sumBy)(this.getTextLineBoundingRects(),"height")||0}getOriginalText(){return this.originalText}isTextOverflowing(){var e;return null===(e=this.textShape)||void 0===e?void 0:e.isOverflowing()}isMultiLineText(){const{parsedStyle:e}=this.getTextShape();return(null==e?void 0:e.maxLines)>1&&this.getTextLineBoundingRects().length>1}getTextLineBoundingRects(){var e;return(null===(e=this.textShape)||void 0===e?void 0:e.getLineBoundingRects())||[]}getTextLineHeight(){var e,t,i;return(null===(i=null===(t=null===(e=this.textShape)||void 0===e?void 0:e.parsedStyle)||void 0===t?void 0:t.metrics)||void 0===i?void 0:i.lineHeight)||16}getEmptyPlaceholder(){const{options:{placeholder:e}}=this.spreadsheet;return(0,fe.Lv)(this,e)}getFieldValue(){return this.getFormattedFieldValue().formattedValue}shouldInit(){const{width:e,height:t}=this.meta;return e>0&&t>0}getStyle(e){return(0,a.get)(this.theme,e||this.cellType)}getLinkFieldShape(){return this.linkFieldShape}getBackgroundShape(){return this.backgroundShape}getStateShapes(){return this.stateShapes}getResizeAreaStyle(){return this.getStyle("resizeArea")}shouldDrawResizeAreaByType(e,t){const{resize:i}=this.spreadsheet.options.interaction;return(0,a.isBoolean)(i)?i:(0,a.isFunction)(null==i?void 0:i.visible)?null==i?void 0:i.visible(t):null==i?void 0:i[e]}getBBoxByType(e=v.Ok.BORDER_BOX){const t={x:this.meta.x,y:this.meta.y,height:this.meta.height,width:this.meta.width},i=this.getStyle()||this.theme.dataCell;return(0,R.f9)(t,this.getBorderPositions(),null==i?void 0:i.cell,e)}drawBorders(){this.getBorderPositions().forEach(e=>{var t;const{position:i,style:s}=(0,R.qi)(e,this.getBBoxByType(),null===(t=this.getStyle())||void 0===t?void 0:t.cell),o=Object.assign(Object.assign({},i),s);this.borders.has(e)?(0,B.w)(this.borders.get(e),o):this.borders.set(e,(0,w.ni)(this,o))})}drawInteractiveBorderShape(){const e=Object.assign(Object.assign({},this.getBBoxByType(v.Ok.PADDING_BOX)),{visibility:"hidden",pointerEvents:"none"}),t=this.stateShapes.get("interactiveBorderShape");t?(0,B.w)(t,e):this.stateShapes.set("interactiveBorderShape",(0,w.P2)(this,e))}drawInteractiveBgShape(){const e=Object.assign(Object.assign({},this.getBBoxByType()),{visibility:"hidden",pointerEvents:"none"}),t=this.stateShapes.get("interactiveBgShape");t?(0,B.w)(t,e):this.stateShapes.set("interactiveBgShape",(0,w.P2)(this,e))}drawBackgroundShape(){const{backgroundColor:e,backgroundColorOpacity:t}=this.getBackgroundColor(),i=Object.assign(Object.assign({},this.getBBoxByType()),{fill:e,fillOpacity:t});this.backgroundShape?(0,B.w)(this.backgroundShape,i):this.backgroundShape=(0,w.P2)(this,i)}renderTextShape(e,t){const i=(0,fe.Kg)(e.text,this.getEmptyPlaceholder()),s=(null==t?void 0:t.shallowRender)||this.isShallowRender();return this.textShape&&!s?(0,B.w)(this.textShape,Object.assign(Object.assign({},e),{text:`${i}`})):this.textShape=(0,w.S5)({group:this,textShape:s?void 0:this.textShape,style:Object.assign(Object.assign({},e),{text:`${i}`})}),this.addTextShape(this.textShape),s||(this.originalText=i),this.textShape}updateTextPosition(e){var t,i,s,o;const n=this.getTextPosition();null===(t=this.textShape)||void 0===t||t.attr("x",null!==(i=null==e?void 0:e.x)&&void 0!==i?i:null==n?void 0:n.x),null===(s=this.textShape)||void 0===s||s.attr("y",null!==(o=null==e?void 0:e.y)&&void 0!==o?o:null==n?void 0:n.y)}drawTextOrCustomRenderer(){const e=this.getRenderer();e?ne.render(e,this).then(()=>{this.afterDrawText()}):(this.drawTextShape(),this.afterDrawText())}drawTextShape(){const e=Math.max(this.getMaxTextWidth(),0)+1,t=this.getTextStyle(),i=this.getResizedTextMaxLines()||(null==t?void 0:t.maxLines),s=this.getFieldValue();this.renderTextShape(Object.assign(Object.assign({},t),{x:0,y:0,text:s,wordWrapWidth:e,maxLines:i})),this.isShallowRender()||(this.updateTextPosition(),this.drawLinkField(this.meta))}drawLinkFieldShape(e,t){if(!e)return;const{device:i}=this.spreadsheet.options;if(!me(i)){const e=this.getTextStyle(),i=this.getTextPosition(),s=this.getActualTextWidth();let o=i.x;"center"===e.textAlign?o-=s/2:"right"===e.textAlign&&(o-=s);const{bottom:n}=this.textShape.getBBox(),r={x1:o,y1:n+1,x2:o+s,y2:n+1,stroke:t,lineWidth:1};this.linkFieldShape?(0,B.w)(this.linkFieldShape,r):this.linkFieldShape=(0,w.ni)(this,r)}this.textShape.style.fill=t,this.textShape.style.cursor="pointer",this.textShape.appendInfo={isLinkFieldText:!0,meta:this.meta}}getLinkFieldStyle(){return this.getTextStyle().linkTextFill}drawLinkField(e){const{linkFields:t=[]}=this.spreadsheet.options.interaction,i=this.getLinkFieldStyle(),s=((e,t)=>(0,a.isFunction)(e)?e(t):e.some(e=>e===t.field||e===t.id||e===t.valueField))(t,e);this.drawLinkFieldShape(s,i)}updateByState(e,t){this.spreadsheet.interaction.setInteractedCells(t);const i=(0,a.get)(this.theme,`${this.cellType}.cell.interactionState.${e}`);(0,a.each)(i,(e,t)=>{(0,a.keys)((0,a.pickBy)(d.Ep,e=>(0,a.includes)(e,t))).forEach(i=>{const s=this.stateShapes.has(i),o=s?this.stateShapes.get(i):this[i],n=(0,a.isArray)(o)?o:[o];if(s&&n.forEach(e=>{e.setAttribute("visibility","visible")}),"interactiveBorderShape"===i&&"borderWidth"===t&&(0,a.isNumber)(e)){const t=this.getInteractiveBorderShapeStyle(e);(0,a.each)(t,(e,t)=>{(0,w.O3)(n,t,e)})}(0,w.O3)(n,d.lE[t],e)})})}getInteractiveBorderShapeStyle(e){const{x:t,y:i,height:s,width:o}=this.getBBoxByType(v.Ok.PADDING_BOX),n=e/2;return{x:t+n,y:i+n,width:o-e,height:s-e}}hideInteractionShape(){this.stateShapes.forEach(e=>{(0,w.O3)(e,d.lE.backgroundOpacity,0),(0,w.O3)(e,d.lE.backgroundColor,"transparent"),(0,w.O3)(e,d.lE.borderOpacity,0),(0,w.O3)(e,d.lE.borderWidth,1),(0,w.O3)(e,d.lE.borderColor,"transparent")})}clearUnselectedState(){(0,w.O3)(this.backgroundShape,d.lE.backgroundOpacity,1),(0,w.O3)(this.textShapes,d.lE.textOpacity,1),(0,w.O3)(this.linkFieldShape,d.lE.opacity,1)}getTextShape(){return this.textShape}getTextShapes(){return this.textShapes||[this.textShape]}addTextShape(e){e&&this.textShapes.push(e)}getConditionIconShape(){return this.conditionIconShape}getConditionIconShapes(){return this.conditionIconShapes||[this.conditionIconShape]}addConditionIconShape(e){e&&this.conditionIconShapes.push(e)}resetTextAndConditionIconShapes(){this.textShapes=[],this.conditionIconShapes=[]}get cellConditions(){return this.conditions}drawConditionIconShapes(){var e;const t=this.getIconConditionResult();if(t){const i=this.getIconPosition(),{size:s}=this.getStyle().icon,o=Object.assign(Object.assign({},i),{name:null==t?void 0:t.name,width:s,height:s,fill:null==t?void 0:t.fill,iconStrategy:null===(e=this.spreadsheet.options.csp)||void 0===e?void 0:e.iconStrategy});this.conditionIconShape?this.conditionIconShape.reRender(o):this.conditionIconShape=(0,w.sH)(this,o),this.addConditionIconShape(this.conditionIconShape)}}getTextConditionMappingResult(){var e;const t=this.findFieldCondition(null===(e=this.conditions)||void 0===e?void 0:e.text);return(null==t?void 0:t.mapping)?this.mappingValue(t):null}getContainConditionMappingResultTextStyle(e){const t=this.getDefaultTextFill(e.fill),i=this.getTextConditionMappingResult();return Object.assign(Object.assign(Object.assign({},e),i),{fill:(null==i?void 0:i.fill)||t})}getDefaultTextFill(e){const{backgroundColor:t,intelligentReverseTextColor:i}=this.getBackgroundColor();return!de(t)||e!==$&&((e,t)=>le.A.isReadable(e,t,{level:"AA",size:"small"}))(t,e)||!i||(e=U),e||""}getBackgroundConditionFill(){var e;const t=this.findFieldCondition(null===(e=this.conditions)||void 0===e?void 0:e.background);if(null==t?void 0:t.mapping){const e=this.mappingValue(t);if(e)return{backgroundColor:e.fill,backgroundColorOpacity:1,intelligentReverseTextColor:e.intelligentReverseTextColor||!1}}return{intelligentReverseTextColor:!1}}getIconConditionResult(){var e;const t=this.findFieldCondition(null===(e=this.conditions)||void 0===e?void 0:e.icon);if(null==t?void 0:t.mapping){const e=this.mappingValue(t);if(e&&e.icon)return{name:e.icon,position:(0,ue.dq)(t),fill:e.fill,isConditionIcon:!0}}}getActionAndConditionIconWidth(e){const{left:t,right:i}=this.groupedIcons,s=this.getStyle().icon;return e?(0,re.kZ)(this.groupedIcons[e],s):(0,re.kZ)(t,s)+(0,re.kZ)(i,s)}getCrossBackgroundColor(e){const{crossBackgroundColor:t,backgroundColorOpacity:i}=this.getStyle().cell;return t&&e%2==0?{backgroundColorOpacity:i,backgroundColor:t}:{backgroundColorOpacity:i,backgroundColor:this.getStyle().cell.backgroundColor}}getMaxLinesByCustomHeight(e){var t;const{targetCell:i=this,displayHeight:s=this.meta.height,isCustomHeight:o=!1}=e,n=i||this,r=null===(t=this.spreadsheet.options.style)||void 0===t?void 0:t[n.cellType];if(!((null==r?void 0:r.maxLines)>1&&(null==r?void 0:r.wordWrap))||!o)return;const{cell:l}=null==n?void 0:n.getStyle(),a=l.padding.top+l.padding.bottom,d=null==n?void 0:n.getTextLineHeight();return Math.max(1,Math.round((s-a)/d))}getRenderer(){var e,t;return null===(t=null===(e=this.spreadsheet.dataCfg.meta)||void 0===e?void 0:e.find(e=>e.field===this.getMetaField()))||void 0===t?void 0:t.renderer}getConditionIntervalShape(){return this.conditionIntervalShape}}var ye=i("./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/common/constant/field.js");const we=(e,t)=>{const i=t.getMeta().id;return e.some(e=>(0,a.isEqual)(e.id,i))},xe=(e,t)=>`${e}-${t}`,_e=e=>e.type===d.vZ.DATA_CELL,Se=(e,t,i)=>{var s;const{rowHeader:o,colHeader:n,currentRow:r,currentCol:l}=i.interaction.getSelectedCellHighlight(),c=t.cellType===d.vZ.ROW_CELL,h=i.isTableMode()&&(null===(s=i.options.seriesNumber)||void 0===s?void 0:s.enable)&&o&&c;(r||h)&&((e,t)=>{(0,a.forEach)(e,e=>{_e(e)&&e.rowIndex===t.getMeta().rowIndex&&t.updateByState(d.xT.SELECTED)})})(e,t),l&&((e,t)=>{(0,a.forEach)(e,e=>{_e(e)&&e.colIndex===t.getMeta().colIndex&&t.updateByState(d.xT.SELECTED)})})(e,t),(o||n)&&((e,t)=>{(0,a.forEach)(e,e=>{_e(e)&&e.rowIndex===t.getMeta().rowIndex&&e.colIndex===t.getMeta().colIndex&&t.updateByState(d.xT.SELECTED)})})(e,t)};var be=i("./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/common/constant/query.js");const Ee=(e=[])=>e.filter(e=>e!==ye.jI&&e!==ye.IW);var Le,Te,Oe=i("./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/utils/dataset/pivot-data-set.js"),Re=9e15,Ie=1e9,Ne="0123456789abcdef",Be="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",Ae="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",Me={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-Re,maxE:Re,crypto:!1},De=!0,He="[DecimalError] ",ke=He+"Invalid argument: ",ze=He+"Precision limit exceeded",Fe=He+"crypto unavailable",Pe="[object Decimal]",je=Math.floor,We=Math.pow,Ge=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,Ve=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,$e=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,Ue=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Ye=1e7,Xe=Be.length-1,Ze=Ae.length-1,qe={toStringTag:Pe};function Ke(e){var t,i,s,o=e.length-1,n="",r=e[0];if(o>0){for(n+=r,t=1;t<o;t++)(i=7-(s=e[t]+"").length)&&(n+=at(i)),n+=s;(i=7-(s=(r=e[t])+"").length)&&(n+=at(i))}else if(0===r)return"0";for(;r%10==0;)r/=10;return n+r}function Je(e,t,i){if(e!==~~e||e<t||e>i)throw Error(ke+e)}function Qe(e,t,i,s){var o,n,r,l;for(n=e[0];n>=10;n/=10)--t;return--t<0?(t+=7,o=0):(o=Math.ceil((t+1)/7),t%=7),n=We(10,7-t),l=e[o]%n|0,null==s?t<3?(0==t?l=l/100|0:1==t&&(l=l/10|0),r=i<4&&99999==l||i>3&&49999==l||5e4==l||0==l):r=(i<4&&l+1==n||i>3&&l+1==n/2)&&(e[o+1]/n/100|0)==We(10,t-2)-1||(l==n/2||0==l)&&!(e[o+1]/n/100|0):t<4?(0==t?l=l/1e3|0:1==t?l=l/100|0:2==t&&(l=l/10|0),r=(s||i<4)&&9999==l||!s&&i>3&&4999==l):r=((s||i<4)&&l+1==n||!s&&i>3&&l+1==n/2)&&(e[o+1]/n/1e3|0)==We(10,t-3)-1,r}function et(e,t,i){for(var s,o,n=[0],r=0,l=e.length;r<l;){for(o=n.length;o--;)n[o]*=t;for(n[0]+=Ne.indexOf(e.charAt(r++)),s=0;s<n.length;s++)n[s]>i-1&&(void 0===n[s+1]&&(n[s+1]=0),n[s+1]+=n[s]/i|0,n[s]%=i)}return n.reverse()}qe.absoluteValue=qe.abs=function(){var e=new this.constructor(this);return e.s<0&&(e.s=1),it(e)},qe.ceil=function(){return it(new this.constructor(this),this.e+1,2)},qe.clampedTo=qe.clamp=function(e,t){var i=this,s=i.constructor;if(e=new s(e),t=new s(t),!e.s||!t.s)return new s(NaN);if(e.gt(t))throw Error(ke+t);return i.cmp(e)<0?e:i.cmp(t)>0?t:new s(i)},qe.comparedTo=qe.cmp=function(e){var t,i,s,o,n=this,r=n.d,l=(e=new n.constructor(e)).d,a=n.s,d=e.s;if(!r||!l)return a&&d?a!==d?a:r===l?0:!r^a<0?1:-1:NaN;if(!r[0]||!l[0])return r[0]?a:l[0]?-d:0;if(a!==d)return a;if(n.e!==e.e)return n.e>e.e^a<0?1:-1;for(t=0,i=(s=r.length)<(o=l.length)?s:o;t<i;++t)if(r[t]!==l[t])return r[t]>l[t]^a<0?1:-1;return s===o?0:s>o^a<0?1:-1},qe.cosine=qe.cos=function(){var e,t,i=this,s=i.constructor;return i.d?i.d[0]?(t=s.rounding,s.precision=(e=s.precision)+Math.max(i.e,i.sd())+7,s.rounding=1,i=function(e,t){var i,s,o;if(t.isZero())return t;s=t.d.length,s<32?o=(1/Ct(4,i=Math.ceil(s/3))).toString():(i=16,o="2.3283064365386962890625e-10");e.precision+=i,t=ft(e,1,t.times(o),new e(1));for(var n=i;n--;){var r=t.times(t);t=r.times(r).minus(r).times(8).plus(1)}return e.precision-=i,t}(s,yt(s,i)),s.precision=e,s.rounding=t,it(2==Te||3==Te?i.neg():i,e,t,!0)):new s(1):new s(NaN)},qe.cubeRoot=qe.cbrt=function(){var e,t,i,s,o,n,r,l,a,d,c=this,h=c.constructor;if(!c.isFinite()||c.isZero())return new h(c);for(De=!1,(n=c.s*We(c.s*c,1/3))&&Math.abs(n)!=1/0?s=new h(n.toString()):(i=Ke(c.d),(n=((e=c.e)-i.length+1)%3)&&(i+=1==n||-2==n?"0":"00"),n=We(i,1/3),e=je((e+1)/3)-(e%3==(e<0?-1:2)),(s=new h(i=n==1/0?"5e"+e:(i=n.toExponential()).slice(0,i.indexOf("e")+1)+e)).s=c.s),r=(e=h.precision)+3;;)if(d=(a=(l=s).times(l).times(l)).plus(c),s=tt(d.plus(c).times(l),d.plus(a),r+2,1),Ke(l.d).slice(0,r)===(i=Ke(s.d)).slice(0,r)){if("9999"!=(i=i.slice(r-3,r+1))&&(o||"4999"!=i)){+i&&(+i.slice(1)||"5"!=i.charAt(0))||(it(s,e+1,1),t=!s.times(s).times(s).eq(c));break}if(!o&&(it(l,e+1,0),l.times(l).times(l).eq(c))){s=l;break}r+=4,o=1}return De=!0,it(s,e,h.rounding,t)},qe.decimalPlaces=qe.dp=function(){var e,t=this.d,i=NaN;if(t){if(i=7*((e=t.length-1)-je(this.e/7)),e=t[e])for(;e%10==0;e/=10)i--;i<0&&(i=0)}return i},qe.dividedBy=qe.div=function(e){return tt(this,new this.constructor(e))},qe.dividedToIntegerBy=qe.divToInt=function(e){var t=this.constructor;return it(tt(this,new t(e),0,1,1),t.precision,t.rounding)},qe.equals=qe.eq=function(e){return 0===this.cmp(e)},qe.floor=function(){return it(new this.constructor(this),this.e+1,3)},qe.greaterThan=qe.gt=function(e){return this.cmp(e)>0},qe.greaterThanOrEqualTo=qe.gte=function(e){var t=this.cmp(e);return 1==t||0===t},qe.hyperbolicCosine=qe.cosh=function(){var e,t,i,s,o,n=this,r=n.constructor,l=new r(1);if(!n.isFinite())return new r(n.s?1/0:NaN);if(n.isZero())return l;s=r.rounding,r.precision=(i=r.precision)+Math.max(n.e,n.sd())+4,r.rounding=1,(o=n.d.length)<32?t=(1/Ct(4,e=Math.ceil(o/3))).toString():(e=16,t="2.3283064365386962890625e-10"),n=ft(r,1,n.times(t),new r(1),!0);for(var a,d=e,c=new r(8);d--;)a=n.times(n),n=l.minus(a.times(c.minus(a.times(c))));return it(n,r.precision=i,r.rounding=s,!0)},qe.hyperbolicSine=qe.sinh=function(){var e,t,i,s,o=this,n=o.constructor;if(!o.isFinite()||o.isZero())return new n(o);if(i=n.rounding,n.precision=(t=n.precision)+Math.max(o.e,o.sd())+4,n.rounding=1,(s=o.d.length)<3)o=ft(n,2,o,o,!0);else{e=1.4*Math.sqrt(s),o=ft(n,2,o=o.times(1/Ct(5,e=e>16?16:0|e)),o,!0);for(var r,l=new n(5),a=new n(16),d=new n(20);e--;)r=o.times(o),o=o.times(l.plus(r.times(a.times(r).plus(d))))}return n.precision=t,n.rounding=i,it(o,t,i,!0)},qe.hyperbolicTangent=qe.tanh=function(){var e,t,i=this,s=i.constructor;return i.isFinite()?i.isZero()?new s(i):(t=s.rounding,s.precision=(e=s.precision)+7,s.rounding=1,tt(i.sinh(),i.cosh(),s.precision=e,s.rounding=t)):new s(i.s)},qe.inverseCosine=qe.acos=function(){var e=this,t=e.constructor,i=e.abs().cmp(1),s=t.precision,o=t.rounding;return-1!==i?0===i?e.isNeg()?rt(t,s,o):new t(0):new t(NaN):e.isZero()?rt(t,s+4,o).times(.5):(t.precision=s+6,t.rounding=1,e=new t(1).minus(e).div(e.plus(1)).sqrt().atan(),t.precision=s,t.rounding=o,e.times(2))},qe.inverseHyperbolicCosine=qe.acosh=function(){var e,t,i=this,s=i.constructor;return i.lte(1)?new s(i.eq(1)?0:NaN):i.isFinite()?(t=s.rounding,s.precision=(e=s.precision)+Math.max(Math.abs(i.e),i.sd())+4,s.rounding=1,De=!1,i=i.times(i).minus(1).sqrt().plus(i),De=!0,s.precision=e,s.rounding=t,i.ln()):new s(i)},qe.inverseHyperbolicSine=qe.asinh=function(){var e,t,i=this,s=i.constructor;return!i.isFinite()||i.isZero()?new s(i):(t=s.rounding,s.precision=(e=s.precision)+2*Math.max(Math.abs(i.e),i.sd())+6,s.rounding=1,De=!1,i=i.times(i).plus(1).sqrt().plus(i),De=!0,s.precision=e,s.rounding=t,i.ln())},qe.inverseHyperbolicTangent=qe.atanh=function(){var e,t,i,s,o=this,n=o.constructor;return o.isFinite()?o.e>=0?new n(o.abs().eq(1)?o.s/0:o.isZero()?o:NaN):(e=n.precision,t=n.rounding,s=o.sd(),Math.max(s,e)<2*-o.e-1?it(new n(o),e,t,!0):(n.precision=i=s-o.e,o=tt(o.plus(1),new n(1).minus(o),i+e,1),n.precision=e+4,n.rounding=1,o=o.ln(),n.precision=e,n.rounding=t,o.times(.5))):new n(NaN)},qe.inverseSine=qe.asin=function(){var e,t,i,s,o=this,n=o.constructor;return o.isZero()?new n(o):(t=o.abs().cmp(1),i=n.precision,s=n.rounding,-1!==t?0===t?((e=rt(n,i+4,s).times(.5)).s=o.s,e):new n(NaN):(n.precision=i+6,n.rounding=1,o=o.div(new n(1).minus(o.times(o)).sqrt().plus(1)).atan(),n.precision=i,n.rounding=s,o.times(2)))},qe.inverseTangent=qe.atan=function(){var e,t,i,s,o,n,r,l,a,d=this,c=d.constructor,h=c.precision,u=c.rounding;if(d.isFinite()){if(d.isZero())return new c(d);if(d.abs().eq(1)&&h+4<=Ze)return(r=rt(c,h+4,u).times(.25)).s=d.s,r}else{if(!d.s)return new c(NaN);if(h+4<=Ze)return(r=rt(c,h+4,u).times(.5)).s=d.s,r}for(c.precision=l=h+10,c.rounding=1,e=i=Math.min(28,l/7+2|0);e;--e)d=d.div(d.times(d).plus(1).sqrt().plus(1));for(De=!1,t=Math.ceil(l/7),s=1,a=d.times(d),r=new c(d),o=d;-1!==e;)if(o=o.times(a),n=r.minus(o.div(s+=2)),o=o.times(a),void 0!==(r=n.plus(o.div(s+=2))).d[t])for(e=t;r.d[e]===n.d[e]&&e--;);return i&&(r=r.times(2<<i-1)),De=!0,it(r,c.precision=h,c.rounding=u,!0)},qe.isFinite=function(){return!!this.d},qe.isInteger=qe.isInt=function(){return!!this.d&&je(this.e/7)>this.d.length-2},qe.isNaN=function(){return!this.s},qe.isNegative=qe.isNeg=function(){return this.s<0},qe.isPositive=qe.isPos=function(){return this.s>0},qe.isZero=function(){return!!this.d&&0===this.d[0]},qe.lessThan=qe.lt=function(e){return this.cmp(e)<0},qe.lessThanOrEqualTo=qe.lte=function(e){return this.cmp(e)<1},qe.logarithm=qe.log=function(e){var t,i,s,o,n,r,l,a,d=this,c=d.constructor,h=c.precision,u=c.rounding;if(null==e)e=new c(10),t=!0;else{if(i=(e=new c(e)).d,e.s<0||!i||!i[0]||e.eq(1))return new c(NaN);t=e.eq(10)}if(i=d.d,d.s<0||!i||!i[0]||d.eq(1))return new c(i&&!i[0]?-1/0:1!=d.s?NaN:i?0:1/0);if(t)if(i.length>1)n=!0;else{for(o=i[0];o%10==0;)o/=10;n=1!==o}if(De=!1,r=pt(d,l=h+5),s=t?nt(c,l+10):pt(e,l),Qe((a=tt(r,s,l,1)).d,o=h,u))do{if(r=pt(d,l+=10),s=t?nt(c,l+10):pt(e,l),a=tt(r,s,l,1),!n){+Ke(a.d).slice(o+1,o+15)+1==1e14&&(a=it(a,h+1,0));break}}while(Qe(a.d,o+=10,u));return De=!0,it(a,h,u)},qe.minus=qe.sub=function(e){var t,i,s,o,n,r,l,a,d,c,h,u,p=this,g=p.constructor;if(e=new g(e),!p.d||!e.d)return p.s&&e.s?p.d?e.s=-e.s:e=new g(e.d||p.s!==e.s?p:NaN):e=new g(NaN),e;if(p.s!=e.s)return e.s=-e.s,p.plus(e);if(u=e.d,l=g.precision,a=g.rounding,!(d=p.d)[0]||!u[0]){if(u[0])e.s=-e.s;else{if(!d[0])return new g(3===a?-0:0);e=new g(p)}return De?it(e,l,a):e}if(i=je(e.e/7),c=je(p.e/7),d=d.slice(),n=c-i){for((h=n<0)?(t=d,n=-n,r=u.length):(t=u,i=c,r=d.length),n>(s=Math.max(Math.ceil(l/7),r)+2)&&(n=s,t.length=1),t.reverse(),s=n;s--;)t.push(0);t.reverse()}else{for((h=(s=d.length)<(r=u.length))&&(r=s),s=0;s<r;s++)if(d[s]!=u[s]){h=d[s]<u[s];break}n=0}for(h&&(t=d,d=u,u=t,e.s=-e.s),s=u.length-(r=d.length);s>0;--s)d[r++]=0;for(s=u.length;s>n;){if(d[--s]<u[s]){for(o=s;o&&0===d[--o];)d[o]=Ye-1;--d[o],d[s]+=Ye}d[s]-=u[s]}for(;0===d[--r];)d.pop();for(;0===d[0];d.shift())--i;return d[0]?(e.d=d,e.e=ot(d,i),De?it(e,l,a):e):new g(3===a?-0:0)},qe.modulo=qe.mod=function(e){var t,i=this,s=i.constructor;return e=new s(e),!i.d||!e.s||e.d&&!e.d[0]?new s(NaN):!e.d||i.d&&!i.d[0]?it(new s(i),s.precision,s.rounding):(De=!1,9==s.modulo?(t=tt(i,e.abs(),0,3,1)).s*=e.s:t=tt(i,e,0,s.modulo,1),t=t.times(e),De=!0,i.minus(t))},qe.naturalExponential=qe.exp=function(){return ut(this)},qe.naturalLogarithm=qe.ln=function(){return pt(this)},qe.negated=qe.neg=function(){var e=new this.constructor(this);return e.s=-e.s,it(e)},qe.plus=qe.add=function(e){var t,i,s,o,n,r,l,a,d,c,h=this,u=h.constructor;if(e=new u(e),!h.d||!e.d)return h.s&&e.s?h.d||(e=new u(e.d||h.s===e.s?h:NaN)):e=new u(NaN),e;if(h.s!=e.s)return e.s=-e.s,h.minus(e);if(c=e.d,l=u.precision,a=u.rounding,!(d=h.d)[0]||!c[0])return c[0]||(e=new u(h)),De?it(e,l,a):e;if(n=je(h.e/7),s=je(e.e/7),d=d.slice(),o=n-s){for(o<0?(i=d,o=-o,r=c.length):(i=c,s=n,r=d.length),o>(r=(n=Math.ceil(l/7))>r?n+1:r+1)&&(o=r,i.length=1),i.reverse();o--;)i.push(0);i.reverse()}for((r=d.length)-(o=c.length)<0&&(o=r,i=c,c=d,d=i),t=0;o;)t=(d[--o]=d[o]+c[o]+t)/Ye|0,d[o]%=Ye;for(t&&(d.unshift(t),++s),r=d.length;0==d[--r];)d.pop();return e.d=d,e.e=ot(d,s),De?it(e,l,a):e},qe.precision=qe.sd=function(e){var t,i=this;if(void 0!==e&&e!==!!e&&1!==e&&0!==e)throw Error(ke+e);return i.d?(t=lt(i.d),e&&i.e+1>t&&(t=i.e+1)):t=NaN,t},qe.round=function(){var e=this,t=e.constructor;return it(new t(e),e.e+1,t.rounding)},qe.sine=qe.sin=function(){var e,t,i=this,s=i.constructor;return i.isFinite()?i.isZero()?new s(i):(t=s.rounding,s.precision=(e=s.precision)+Math.max(i.e,i.sd())+7,s.rounding=1,i=function(e,t){var i,s=t.d.length;if(s<3)return t.isZero()?t:ft(e,2,t,t);i=1.4*Math.sqrt(s),t=t.times(1/Ct(5,i=i>16?16:0|i)),t=ft(e,2,t,t);for(var o,n=new e(5),r=new e(16),l=new e(20);i--;)o=t.times(t),t=t.times(n.plus(o.times(r.times(o).minus(l))));return t}(s,yt(s,i)),s.precision=e,s.rounding=t,it(Te>2?i.neg():i,e,t,!0)):new s(NaN)},qe.squareRoot=qe.sqrt=function(){var e,t,i,s,o,n,r=this,l=r.d,a=r.e,d=r.s,c=r.constructor;if(1!==d||!l||!l[0])return new c(!d||d<0&&(!l||l[0])?NaN:l?r:1/0);for(De=!1,0==(d=Math.sqrt(+r))||d==1/0?(((t=Ke(l)).length+a)%2==0&&(t+="0"),d=Math.sqrt(t),a=je((a+1)/2)-(a<0||a%2),s=new c(t=d==1/0?"5e"+a:(t=d.toExponential()).slice(0,t.indexOf("e")+1)+a)):s=new c(d.toString()),i=(a=c.precision)+3;;)if(s=(n=s).plus(tt(r,n,i+2,1)).times(.5),Ke(n.d).slice(0,i)===(t=Ke(s.d)).slice(0,i)){if("9999"!=(t=t.slice(i-3,i+1))&&(o||"4999"!=t)){+t&&(+t.slice(1)||"5"!=t.charAt(0))||(it(s,a+1,1),e=!s.times(s).eq(r));break}if(!o&&(it(n,a+1,0),n.times(n).eq(r))){s=n;break}i+=4,o=1}return De=!0,it(s,a,c.rounding,e)},qe.tangent=qe.tan=function(){var e,t,i=this,s=i.constructor;return i.isFinite()?i.isZero()?new s(i):(t=s.rounding,s.precision=(e=s.precision)+10,s.rounding=1,(i=i.sin()).s=1,i=tt(i,new s(1).minus(i.times(i)).sqrt(),e+10,0),s.precision=e,s.rounding=t,it(2==Te||4==Te?i.neg():i,e,t,!0)):new s(NaN)},qe.times=qe.mul=function(e){var t,i,s,o,n,r,l,a,d,c=this,h=c.constructor,u=c.d,p=(e=new h(e)).d;if(e.s*=c.s,!(u&&u[0]&&p&&p[0]))return new h(!e.s||u&&!u[0]&&!p||p&&!p[0]&&!u?NaN:u&&p?0*e.s:e.s/0);for(i=je(c.e/7)+je(e.e/7),(a=u.length)<(d=p.length)&&(n=u,u=p,p=n,r=a,a=d,d=r),n=[],s=r=a+d;s--;)n.push(0);for(s=d;--s>=0;){for(t=0,o=a+s;o>s;)l=n[o]+p[s]*u[o-s-1]+t,n[o--]=l%Ye|0,t=l/Ye|0;n[o]=(n[o]+t)%Ye|0}for(;!n[--r];)n.pop();return t?++i:n.shift(),e.d=n,e.e=ot(n,i),De?it(e,h.precision,h.rounding):e},qe.toBinary=function(e,t){return wt(this,2,e,t)},qe.toDecimalPlaces=qe.toDP=function(e,t){var i=this,s=i.constructor;return i=new s(i),void 0===e?i:(Je(e,0,Ie),void 0===t?t=s.rounding:Je(t,0,8),it(i,e+i.e+1,t))},qe.toExponential=function(e,t){var i,s=this,o=s.constructor;return void 0===e?i=st(s,!0):(Je(e,0,Ie),void 0===t?t=o.rounding:Je(t,0,8),i=st(s=it(new o(s),e+1,t),!0,e+1)),s.isNeg()&&!s.isZero()?"-"+i:i},qe.toFixed=function(e,t){var i,s,o=this,n=o.constructor;return void 0===e?i=st(o):(Je(e,0,Ie),void 0===t?t=n.rounding:Je(t,0,8),i=st(s=it(new n(o),e+o.e+1,t),!1,e+s.e+1)),o.isNeg()&&!o.isZero()?"-"+i:i},qe.toFraction=function(e){var t,i,s,o,n,r,l,a,d,c,h,u,p=this,g=p.d,m=p.constructor;if(!g)return new m(p);if(d=i=new m(1),s=a=new m(0),n=(t=new m(s)).e=lt(g)-p.e-1,t.d[0]=We(10,(r=n%7)<0?7+r:r),null==e)e=n>0?t:d;else{if(!(l=new m(e)).isInt()||l.lt(d))throw Error(ke+l);e=l.gt(t)?n>0?t:d:l}for(De=!1,l=new m(Ke(g)),c=m.precision,m.precision=n=7*g.length*2;h=tt(l,t,0,1,1),1!=(o=i.plus(h.times(s))).cmp(e);)i=s,s=o,d=a.plus(h.times(o=d)),a=o,t=l.minus(h.times(o=t)),l=o;return o=tt(e.minus(i),s,0,1,1),a=a.plus(o.times(d)),i=i.plus(o.times(s)),a.s=d.s=p.s,u=tt(d,s,n,1).minus(p).abs().cmp(tt(a,i,n,1).minus(p).abs())<1?[d,s]:[a,i],m.precision=c,De=!0,u},qe.toHexadecimal=qe.toHex=function(e,t){return wt(this,16,e,t)},qe.toNearest=function(e,t){var i=this,s=i.constructor;if(i=new s(i),null==e){if(!i.d)return i;e=new s(1),t=s.rounding}else{if(e=new s(e),void 0===t?t=s.rounding:Je(t,0,8),!i.d)return e.s?i:e;if(!e.d)return e.s&&(e.s=i.s),e}return e.d[0]?(De=!1,i=tt(i,e,0,t,1).times(e),De=!0,it(i)):(e.s=i.s,i=e),i},qe.toNumber=function(){return+this},qe.toOctal=function(e,t){return wt(this,8,e,t)},qe.toPower=qe.pow=function(e){var t,i,s,o,n,r,l=this,a=l.constructor,d=+(e=new a(e));if(!(l.d&&e.d&&l.d[0]&&e.d[0]))return new a(We(+l,d));if((l=new a(l)).eq(1))return l;if(s=a.precision,n=a.rounding,e.eq(1))return it(l,s,n);if((t=je(e.e/7))>=e.d.length-1&&(i=d<0?-d:d)<=9007199254740991)return o=dt(a,l,i,s),e.s<0?new a(1).div(o):it(o,s,n);if((r=l.s)<0){if(t<e.d.length-1)return new a(NaN);if(1&e.d[t]||(r=1),0==l.e&&1==l.d[0]&&1==l.d.length)return l.s=r,l}return(t=0!=(i=We(+l,d))&&isFinite(i)?new a(i+"").e:je(d*(Math.log("0."+Ke(l.d))/Math.LN10+l.e+1)))>a.maxE+1||t<a.minE-1?new a(t>0?r/0:0):(De=!1,a.rounding=l.s=1,i=Math.min(12,(t+"").length),(o=ut(e.times(pt(l,s+i)),s)).d&&Qe((o=it(o,s+5,1)).d,s,n)&&+Ke((o=it(ut(e.times(pt(l,(t=s+10)+i)),t),t+5,1)).d).slice(s+1,s+15)+1==1e14&&(o=it(o,s+1,0)),o.s=r,De=!0,a.rounding=n,it(o,s,n))},qe.toPrecision=function(e,t){var i,s=this,o=s.constructor;return void 0===e?i=st(s,s.e<=o.toExpNeg||s.e>=o.toExpPos):(Je(e,1,Ie),void 0===t?t=o.rounding:Je(t,0,8),i=st(s=it(new o(s),e,t),e<=s.e||s.e<=o.toExpNeg,e)),s.isNeg()&&!s.isZero()?"-"+i:i},qe.toSignificantDigits=qe.toSD=function(e,t){var i=this.constructor;return void 0===e?(e=i.precision,t=i.rounding):(Je(e,1,Ie),void 0===t?t=i.rounding:Je(t,0,8)),it(new i(this),e,t)},qe.toString=function(){var e=this,t=e.constructor,i=st(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()&&!e.isZero()?"-"+i:i},qe.truncated=qe.trunc=function(){return it(new this.constructor(this),this.e+1,1)},qe.valueOf=qe.toJSON=function(){var e=this,t=e.constructor,i=st(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()?"-"+i:i};var tt=function(){function e(e,t,i){var s,o=0,n=e.length;for(e=e.slice();n--;)e[n]=(s=e[n]*t+o)%i|0,o=s/i|0;return o&&e.unshift(o),e}function t(e,t,i,s){var o,n;if(i!=s)n=i>s?1:-1;else for(o=n=0;o<i;o++)if(e[o]!=t[o]){n=e[o]>t[o]?1:-1;break}return n}function i(e,t,i,s){for(var o=0;i--;)e[i]-=o,e[i]=(o=e[i]<t[i]?1:0)*s+e[i]-t[i];for(;!e[0]&&e.length>1;)e.shift()}return function(s,o,n,r,l,a){var d,c,h,u,p,g,m,v,f,C,y,w,x,_,S,b,E,L,T,O,R=s.constructor,I=s.s==o.s?1:-1,N=s.d,B=o.d;if(!(N&&N[0]&&B&&B[0]))return new R(s.s&&o.s&&(N?!B||N[0]!=B[0]:B)?N&&0==N[0]||!B?0*I:I/0:NaN);for(a?(p=1,c=s.e-o.e):(a=Ye,c=je(s.e/(p=7))-je(o.e/p)),T=B.length,E=N.length,C=(f=new R(I)).d=[],h=0;B[h]==(N[h]||0);h++);if(B[h]>(N[h]||0)&&c--,null==n?(_=n=R.precision,r=R.rounding):_=l?n+(s.e-o.e)+1:n,_<0)C.push(1),g=!0;else{if(_=_/p+2|0,h=0,1==T){for(u=0,B=B[0],_++;(h<E||u)&&_--;h++)C[h]=(S=u*a+(N[h]||0))/B|0,u=S%B|0;g=u||h<E}else{for((u=a/(B[0]+1)|0)>1&&(B=e(B,u,a),N=e(N,u,a),T=B.length,E=N.length),b=T,w=(y=N.slice(0,T)).length;w<T;)y[w++]=0;(O=B.slice()).unshift(0),L=B[0],B[1]>=a/2&&++L;do{u=0,(d=t(B,y,T,w))<0?(x=y[0],T!=w&&(x=x*a+(y[1]||0)),(u=x/L|0)>1?(u>=a&&(u=a-1),1==(d=t(m=e(B,u,a),y,v=m.length,w=y.length))&&(u--,i(m,T<v?O:B,v,a))):(0==u&&(d=u=1),m=B.slice()),(v=m.length)<w&&m.unshift(0),i(y,m,w,a),-1==d&&(d=t(B,y,T,w=y.length))<1&&(u++,i(y,T<w?O:B,w,a)),w=y.length):0===d&&(u++,y=[0]),C[h++]=u,d&&y[0]?y[w++]=N[b]||0:(y=[N[b]],w=1)}while((b++<E||void 0!==y[0])&&_--);g=void 0!==y[0]}C[0]||C.shift()}if(1==p)f.e=c,Le=g;else{for(h=1,u=C[0];u>=10;u/=10)h++;f.e=h+c*p-1,it(f,l?n+f.e+1:n,r,g)}return f}}();function it(e,t,i,s){var o,n,r,l,a,d,c,h,u,p=e.constructor;e:if(null!=t){if(!(h=e.d))return e;for(o=1,l=h[0];l>=10;l/=10)o++;if((n=t-o)<0)n+=7,a=(c=h[u=0])/We(10,o-(r=t)-1)%10|0;else if((u=Math.ceil((n+1)/7))>=(l=h.length)){if(!s)break e;for(;l++<=u;)h.push(0);c=a=0,o=1,r=(n%=7)-7+1}else{for(c=l=h[u],o=1;l>=10;l/=10)o++;a=(r=(n%=7)-7+o)<0?0:c/We(10,o-r-1)%10|0}if(s=s||t<0||void 0!==h[u+1]||(r<0?c:c%We(10,o-r-1)),d=i<4?(a||s)&&(0==i||i==(e.s<0?3:2)):a>5||5==a&&(4==i||s||6==i&&(n>0?r>0?c/We(10,o-r):0:h[u-1])%10&1||i==(e.s<0?8:7)),t<1||!h[0])return h.length=0,d?(h[0]=We(10,(7-(t-=e.e+1)%7)%7),e.e=-t||0):h[0]=e.e=0,e;if(0==n?(h.length=u,l=1,u--):(h.length=u+1,l=We(10,7-n),h[u]=r>0?(c/We(10,o-r)%We(10,r)|0)*l:0),d)for(;;){if(0==u){for(n=1,r=h[0];r>=10;r/=10)n++;for(r=h[0]+=l,l=1;r>=10;r/=10)l++;n!=l&&(e.e++,h[0]==Ye&&(h[0]=1));break}if(h[u]+=l,h[u]!=Ye)break;h[u--]=0,l=1}for(n=h.length;0===h[--n];)h.pop()}return De&&(e.e>p.maxE?(e.d=null,e.e=NaN):e.e<p.minE&&(e.e=0,e.d=[0])),e}function st(e,t,i){if(!e.isFinite())return gt(e);var s,o=e.e,n=Ke(e.d),r=n.length;return t?(i&&(s=i-r)>0?n=n.charAt(0)+"."+n.slice(1)+at(s):r>1&&(n=n.charAt(0)+"."+n.slice(1)),n=n+(e.e<0?"e":"e+")+e.e):o<0?(n="0."+at(-o-1)+n,i&&(s=i-r)>0&&(n+=at(s))):o>=r?(n+=at(o+1-r),i&&(s=i-o-1)>0&&(n=n+"."+at(s))):((s=o+1)<r&&(n=n.slice(0,s)+"."+n.slice(s)),i&&(s=i-r)>0&&(o+1===r&&(n+="."),n+=at(s))),n}function ot(e,t){var i=e[0];for(t*=7;i>=10;i/=10)t++;return t}function nt(e,t,i){if(t>Xe)throw De=!0,i&&(e.precision=i),Error(ze);return it(new e(Be),t,1,!0)}function rt(e,t,i){if(t>Ze)throw Error(ze);return it(new e(Ae),t,i,!0)}function lt(e){var t=e.length-1,i=7*t+1;if(t=e[t]){for(;t%10==0;t/=10)i--;for(t=e[0];t>=10;t/=10)i++}return i}function at(e){for(var t="";e--;)t+="0";return t}function dt(e,t,i,s){var o,n=new e(1),r=Math.ceil(s/7+4);for(De=!1;;){if(i%2&&xt((n=n.times(t)).d,r)&&(o=!0),0===(i=je(i/2))){i=n.d.length-1,o&&0===n.d[i]&&++n.d[i];break}xt((t=t.times(t)).d,r)}return De=!0,n}function ct(e){return 1&e.d[e.d.length-1]}function ht(e,t,i){for(var s,o,n=new e(t[0]),r=0;++r<t.length;){if(!(o=new e(t[r])).s){n=o;break}((s=n.cmp(o))===i||0===s&&n.s===i)&&(n=o)}return n}function ut(e,t){var i,s,o,n,r,l,a,d=0,c=0,h=0,u=e.constructor,p=u.rounding,g=u.precision;if(!e.d||!e.d[0]||e.e>17)return new u(e.d?e.d[0]?e.s<0?0:1/0:1:e.s?e.s<0?0:e:NaN);for(null==t?(De=!1,a=g):a=t,l=new u(.03125);e.e>-2;)e=e.times(l),h+=5;for(a+=s=Math.log(We(2,h))/Math.LN10*2+5|0,i=n=r=new u(1),u.precision=a;;){if(n=it(n.times(e),a,1),i=i.times(++c),Ke((l=r.plus(tt(n,i,a,1))).d).slice(0,a)===Ke(r.d).slice(0,a)){for(o=h;o--;)r=it(r.times(r),a,1);if(null!=t)return u.precision=g,r;if(!(d<3&&Qe(r.d,a-s,p,d)))return it(r,u.precision=g,p,De=!0);u.precision=a+=10,i=n=l=new u(1),c=0,d++}r=l}}function pt(e,t){var i,s,o,n,r,l,a,d,c,h,u,p=1,g=e,m=g.d,v=g.constructor,f=v.rounding,C=v.precision;if(g.s<0||!m||!m[0]||!g.e&&1==m[0]&&1==m.length)return new v(m&&!m[0]?-1/0:1!=g.s?NaN:m?0:g);if(null==t?(De=!1,c=C):c=t,v.precision=c+=10,s=(i=Ke(m)).charAt(0),!(Math.abs(n=g.e)<15e14))return d=nt(v,c+2,C).times(n+""),g=pt(new v(s+"."+i.slice(1)),c-10).plus(d),v.precision=C,null==t?it(g,C,f,De=!0):g;for(;s<7&&1!=s||1==s&&i.charAt(1)>3;)s=(i=Ke((g=g.times(e)).d)).charAt(0),p++;for(n=g.e,s>1?(g=new v("0."+i),n++):g=new v(s+"."+i.slice(1)),h=g,a=r=g=tt(g.minus(1),g.plus(1),c,1),u=it(g.times(g),c,1),o=3;;){if(r=it(r.times(u),c,1),Ke((d=a.plus(tt(r,new v(o),c,1))).d).slice(0,c)===Ke(a.d).slice(0,c)){if(a=a.times(2),0!==n&&(a=a.plus(nt(v,c+2,C).times(n+""))),a=tt(a,new v(p),c,1),null!=t)return v.precision=C,a;if(!Qe(a.d,c-10,f,l))return it(a,v.precision=C,f,De=!0);v.precision=c+=10,d=r=g=tt(h.minus(1),h.plus(1),c,1),u=it(g.times(g),c,1),o=l=1}a=d,o+=2}}function gt(e){return String(e.s*e.s/0)}function mt(e,t){var i,s,o;for((i=t.indexOf("."))>-1&&(t=t.replace(".","")),(s=t.search(/e/i))>0?(i<0&&(i=s),i+=+t.slice(s+1),t=t.substring(0,s)):i<0&&(i=t.length),s=0;48===t.charCodeAt(s);s++);for(o=t.length;48===t.charCodeAt(o-1);--o);if(t=t.slice(s,o)){if(o-=s,e.e=i=i-s-1,e.d=[],s=(i+1)%7,i<0&&(s+=7),s<o){for(s&&e.d.push(+t.slice(0,s)),o-=7;s<o;)e.d.push(+t.slice(s,s+=7));s=7-(t=t.slice(s)).length}else s-=o;for(;s--;)t+="0";e.d.push(+t),De&&(e.e>e.constructor.maxE?(e.d=null,e.e=NaN):e.e<e.constructor.minE&&(e.e=0,e.d=[0]))}else e.e=0,e.d=[0];return e}function vt(e,t){var i,s,o,n,r,l,a,d,c;if(t.indexOf("_")>-1){if(t=t.replace(/(\d)_(?=\d)/g,"$1"),Ue.test(t))return mt(e,t)}else if("Infinity"===t||"NaN"===t)return+t||(e.s=NaN),e.e=NaN,e.d=null,e;if(Ve.test(t))i=16,t=t.toLowerCase();else if(Ge.test(t))i=2;else{if(!$e.test(t))throw Error(ke+t);i=8}for((n=t.search(/p/i))>0?(a=+t.slice(n+1),t=t.substring(2,n)):t=t.slice(2),n=t.indexOf("."),s=e.constructor,(r=n>=0)&&(n=(l=(t=t.replace(".","")).length)-n,o=dt(s,new s(i),n,2*n)),n=c=(d=et(t,i,Ye)).length-1;0===d[n];--n)d.pop();return n<0?new s(0*e.s):(e.e=ot(d,c),e.d=d,De=!1,r&&(e=tt(e,o,4*l)),a&&(e=e.times(Math.abs(a)<54?We(2,a):ai.pow(2,a))),De=!0,e)}function ft(e,t,i,s,o){var n,r,l,a,d=e.precision,c=Math.ceil(d/7);for(De=!1,a=i.times(i),l=new e(s);;){if(r=tt(l.times(a),new e(t++*t++),d,1),l=o?s.plus(r):s.minus(r),s=tt(r.times(a),new e(t++*t++),d,1),void 0!==(r=l.plus(s)).d[c]){for(n=c;r.d[n]===l.d[n]&&n--;);if(-1==n)break}n=l,l=s,s=r,r=n}return De=!0,r.d.length=c+1,r}function Ct(e,t){for(var i=e;--t;)i*=e;return i}function yt(e,t){var i,s=t.s<0,o=rt(e,e.precision,1),n=o.times(.5);if((t=t.abs()).lte(n))return Te=s?4:1,t;if((i=t.divToInt(o)).isZero())Te=s?3:2;else{if((t=t.minus(i.times(o))).lte(n))return Te=ct(i)?s?2:3:s?4:1,t;Te=ct(i)?s?1:4:s?3:2}return t.minus(o).abs()}function wt(e,t,i,s){var o,n,r,l,a,d,c,h,u,p=e.constructor,g=void 0!==i;if(g?(Je(i,1,Ie),void 0===s?s=p.rounding:Je(s,0,8)):(i=p.precision,s=p.rounding),e.isFinite()){for(g?(o=2,16==t?i=4*i-3:8==t&&(i=3*i-2)):o=t,(r=(c=st(e)).indexOf("."))>=0&&(c=c.replace(".",""),(u=new p(1)).e=c.length-r,u.d=et(st(u),10,o),u.e=u.d.length),n=a=(h=et(c,10,o)).length;0==h[--a];)h.pop();if(h[0]){if(r<0?n--:((e=new p(e)).d=h,e.e=n,h=(e=tt(e,u,i,s,0,o)).d,n=e.e,d=Le),r=h[i],l=o/2,d=d||void 0!==h[i+1],d=s<4?(void 0!==r||d)&&(0===s||s===(e.s<0?3:2)):r>l||r===l&&(4===s||d||6===s&&1&h[i-1]||s===(e.s<0?8:7)),h.length=i,d)for(;++h[--i]>o-1;)h[i]=0,i||(++n,h.unshift(1));for(a=h.length;!h[a-1];--a);for(r=0,c="";r<a;r++)c+=Ne.charAt(h[r]);if(g){if(a>1)if(16==t||8==t){for(r=16==t?4:3,--a;a%r;a++)c+="0";for(a=(h=et(c,o,t)).length;!h[a-1];--a);for(r=1,c="1.";r<a;r++)c+=Ne.charAt(h[r])}else c=c.charAt(0)+"."+c.slice(1);c=c+(n<0?"p":"p+")+n}else if(n<0){for(;++n;)c="0"+c;c="0."+c}else if(++n>a)for(n-=a;n--;)c+="0";else n<a&&(c=c.slice(0,n)+"."+c.slice(n))}else c=g?"0p+0":"0";c=(16==t?"0x":2==t?"0b":8==t?"0o":"")+c}else c=gt(e);return e.s<0?"-"+c:c}function xt(e,t){if(e.length>t)return e.length=t,!0}function _t(e){return new this(e).abs()}function St(e){return new this(e).acos()}function bt(e){return new this(e).acosh()}function Et(e,t){return new this(e).plus(t)}function Lt(e){return new this(e).asin()}function Tt(e){return new this(e).asinh()}function Ot(e){return new this(e).atan()}function Rt(e){return new this(e).atanh()}function It(e,t){e=new this(e),t=new this(t);var i,s=this.precision,o=this.rounding,n=s+4;return e.s&&t.s?e.d||t.d?!t.d||e.isZero()?(i=t.s<0?rt(this,s,o):new this(0)).s=e.s:!e.d||t.isZero()?(i=rt(this,n,1).times(.5)).s=e.s:t.s<0?(this.precision=n,this.rounding=1,i=this.atan(tt(e,t,n,1)),t=rt(this,n,1),this.precision=s,this.rounding=o,i=e.s<0?i.minus(t):i.plus(t)):i=this.atan(tt(e,t,n,1)):(i=rt(this,n,1).times(t.s>0?.25:.75)).s=e.s:i=new this(NaN),i}function Nt(e){return new this(e).cbrt()}function Bt(e){return it(e=new this(e),e.e+1,2)}function At(e,t,i){return new this(e).clamp(t,i)}function Mt(e){if(!e||"object"!=typeof e)throw Error(He+"Object expected");var t,i,s,o=!0===e.defaults,n=["precision",1,Ie,"rounding",0,8,"toExpNeg",-Re,0,"toExpPos",0,Re,"maxE",0,Re,"minE",-Re,0,"modulo",0,9];for(t=0;t<n.length;t+=3)if(i=n[t],o&&(this[i]=Me[i]),void 0!==(s=e[i])){if(!(je(s)===s&&s>=n[t+1]&&s<=n[t+2]))throw Error(ke+i+": "+s);this[i]=s}if(i="crypto",o&&(this[i]=Me[i]),void 0!==(s=e[i])){if(!0!==s&&!1!==s&&0!==s&&1!==s)throw Error(ke+i+": "+s);if(s){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw Error(Fe);this[i]=!0}else this[i]=!1}return this}function Dt(e){return new this(e).cos()}function Ht(e){return new this(e).cosh()}function kt(e,t){return new this(e).div(t)}function zt(e){return new this(e).exp()}function Ft(e){return it(e=new this(e),e.e+1,3)}function Pt(){var e,t,i=new this(0);for(De=!1,e=0;e<arguments.length;)if((t=new this(arguments[e++])).d)i.d&&(i=i.plus(t.times(t)));else{if(t.s)return De=!0,new this(1/0);i=t}return De=!0,i.sqrt()}function jt(e){return e instanceof ai||e&&e.toStringTag===Pe||!1}function Wt(e){return new this(e).ln()}function Gt(e,t){return new this(e).log(t)}function Vt(e){return new this(e).log(2)}function $t(e){return new this(e).log(10)}function Ut(){return ht(this,arguments,-1)}function Yt(){return ht(this,arguments,1)}function Xt(e,t){return new this(e).mod(t)}function Zt(e,t){return new this(e).mul(t)}function qt(e,t){return new this(e).pow(t)}function Kt(e){var t,i,s,o,n=0,r=new this(1),l=[];if(void 0===e?e=this.precision:Je(e,1,Ie),s=Math.ceil(e/7),this.crypto)if(crypto.getRandomValues)for(t=crypto.getRandomValues(new Uint32Array(s));n<s;)(o=t[n])>=429e7?t[n]=crypto.getRandomValues(new Uint32Array(1))[0]:l[n++]=o%1e7;else{if(!crypto.randomBytes)throw Error(Fe);for(t=crypto.randomBytes(s*=4);n<s;)(o=t[n]+(t[n+1]<<8)+(t[n+2]<<16)+((127&t[n+3])<<24))>=214e7?crypto.randomBytes(4).copy(t,n):(l.push(o%1e7),n+=4);n=s/4}else for(;n<s;)l[n++]=1e7*Math.random()|0;for(e%=7,(s=l[--n])&&e&&(o=We(10,7-e),l[n]=(s/o|0)*o);0===l[n];n--)l.pop();if(n<0)i=0,l=[0];else{for(i=-1;0===l[0];i-=7)l.shift();for(s=1,o=l[0];o>=10;o/=10)s++;s<7&&(i-=7-s)}return r.e=i,r.d=l,r}function Jt(e){return it(e=new this(e),e.e+1,this.rounding)}function Qt(e){return(e=new this(e)).d?e.d[0]?e.s:0*e.s:e.s||NaN}function ei(e){return new this(e).sin()}function ti(e){return new this(e).sinh()}function ii(e){return new this(e).sqrt()}function si(e,t){return new this(e).sub(t)}function oi(){var e=0,t=arguments,i=new this(t[e]);for(De=!1;i.s&&++e<t.length;)i=i.plus(t[e]);return De=!0,it(i,this.precision,this.rounding)}function ni(e){return new this(e).tan()}function ri(e){return new this(e).tanh()}function li(e){return it(e=new this(e),e.e+1,1)}qe[Symbol.for("nodejs.util.inspect.custom")]=qe.toString,qe[Symbol.toStringTag]="Decimal";var ai=qe.constructor=function e(t){var i,s,o;function n(e){var t,i,s,o=this;if(!(o instanceof n))return new n(e);if(o.constructor=n,jt(e))return o.s=e.s,void(De?!e.d||e.e>n.maxE?(o.e=NaN,o.d=null):e.e<n.minE?(o.e=0,o.d=[0]):(o.e=e.e,o.d=e.d.slice()):(o.e=e.e,o.d=e.d?e.d.slice():e.d));if("number"===(s=typeof e)){if(0===e)return o.s=1/e<0?-1:1,o.e=0,void(o.d=[0]);if(e<0?(e=-e,o.s=-1):o.s=1,e===~~e&&e<1e7){for(t=0,i=e;i>=10;i/=10)t++;return void(De?t>n.maxE?(o.e=NaN,o.d=null):t<n.minE?(o.e=0,o.d=[0]):(o.e=t,o.d=[e]):(o.e=t,o.d=[e]))}return 0*e!=0?(e||(o.s=NaN),o.e=NaN,void(o.d=null)):mt(o,e.toString())}if("string"===s)return 45===(i=e.charCodeAt(0))?(e=e.slice(1),o.s=-1):(43===i&&(e=e.slice(1)),o.s=1),Ue.test(e)?mt(o,e):vt(o,e);if("bigint"===s)return e<0?(e=-e,o.s=-1):o.s=1,mt(o,e.toString());throw Error(ke+e)}if(n.prototype=qe,n.ROUND_UP=0,n.ROUND_DOWN=1,n.ROUND_CEIL=2,n.ROUND_FLOOR=3,n.ROUND_HALF_UP=4,n.ROUND_HALF_DOWN=5,n.ROUND_HALF_EVEN=6,n.ROUND_HALF_CEIL=7,n.ROUND_HALF_FLOOR=8,n.EUCLID=9,n.config=n.set=Mt,n.clone=e,n.isDecimal=jt,n.abs=_t,n.acos=St,n.acosh=bt,n.add=Et,n.asin=Lt,n.asinh=Tt,n.atan=Ot,n.atanh=Rt,n.atan2=It,n.cbrt=Nt,n.ceil=Bt,n.clamp=At,n.cos=Dt,n.cosh=Ht,n.div=kt,n.exp=zt,n.floor=Ft,n.hypot=Pt,n.ln=Wt,n.log=Gt,n.log10=$t,n.log2=Vt,n.max=Ut,n.min=Yt,n.mod=Xt,n.mul=Zt,n.pow=qt,n.random=Kt,n.round=Jt,n.sign=Qt,n.sin=ei,n.sinh=ti,n.sqrt=ii,n.sub=si,n.sum=oi,n.tan=ni,n.tanh=ri,n.trunc=li,void 0===t&&(t={}),t&&!0!==t.defaults)for(o=["precision","rounding","toExpNeg","toExpPos","maxE","minE","modulo","crypto"],i=0;i<o.length;)t.hasOwnProperty(s=o[i++])||(t[s]=this[s]);return n.config(t),n}(Me);Be=new ai(Be),Ae=new ai(Ae);const di=ai;class ci{constructor(e,t){this.raw=e,this.extraField=t}static getCellData(e,t){return new ci(e,t)}static getCellDataList(e,t){return t.map(t=>ci.getCellData(e,t))}static getFieldValue(e,t=""){return e instanceof ci?t?e.getValueByField(t):e[ye._O]:null==e?void 0:e[t]}get[ye._O](){return this.raw}get[ye.GJ](){return this.extraField}get[ye.nj](){return this.raw[this.extraField]}getValueByField(e){return e===ye.nj||e===ye.GJ?this[e]:this.raw[e]}}const hi=e=>"number"==typeof e?Number.isNaN(e):!e||("string"!=typeof e||Number.isNaN(Number(e))),ui=e=>!hi(e),pi=(e,t,i=!1)=>(null==e?void 0:e.length)?e.reduce((e,s)=>{const o=ci.getFieldValue(s,t),n=hi(o);if(i&&n)return e;return e.push(new di(n?0:o)),e},[]):[],gi=(e,t)=>{const i=pi(e,t);return i.length?di.sum(...i).toNumber():0},mi=(e,t,i)=>{const s=pi(t,i,!0);if(null==s?void 0:s.length)return di[e](...s).toNumber()},vi={[v.F4.SUM]:gi,[v.F4.MIN]:(e,t)=>mi("min",e,t),[v.F4.MAX]:(e,t)=>mi("max",e,t),[v.F4.AVG]:(e,t)=>{const i=pi(e,t);return(null==i?void 0:i.length)?di.sum(...i).dividedBy(i.length).toNumber():0},[v.F4.COUNT]:e=>(null==e?void 0:e.length)||0},fi=e=>"ASC"===(0,a.toUpper)(e),Ci=e=>"DESC"===(0,a.toUpper)(e),yi=(e,t,i,s="last")=>{const o=fi(t)?1:-1,n=fi(t),r="first"===s||"auto"===s&&n?-1:1;return null==e?void 0:e.sort((e,t)=>{let s=e,n=t;if(i){s=e.getValueByField(i),n=t.getValueByField(i);const l=(0,a.isNil)(s)||"-"===s||""===s,d=(0,a.isNil)(n)||"-"===n||""===n;if(l&&d)return 0;if(l)return r;if(d)return-r;if(ui(s)&&ui(n))return(Number(s)-Number(n))*o}return(0,a.isNil)(s)||(0,a.isNil)(n)?s?-r:r:s.toString().localeCompare(n.toString(),"zh")*o})},wi=(e,t,i)=>{return i?(s=t,o=(0,a.uniq)(e),null===(n=null==s?void 0:s.filter(e=>!(null==o?void 0:o.includes(e))))||void 0===n?void 0:n.concat(o)):[...new Set([...e,...t])];var s,o,n},xi=e=>{const{sortByValues:t=[],originValues:i=[]}=e,s=i.filter(e=>t.find(t=>(0,a.last)((0,a.split)(e,"[&]"))===t)).map(e=>{const t=e.split("[&]");if(t.length>1){return[t.slice(0,t.length-1).join("[&]"),t[t.length-1]]}return t}),o=Array.from(new Set(s.map(e=>e[0])));s.sort((e,i)=>{const s=e.slice(0,e.length-1),n=i.slice(0,i.length-1);if(s.join()!==n.join()){return o.indexOf(s[0])-o.indexOf(n[0])}return t.indexOf(e[e.length-1])-t.indexOf(i[i.length-1])});const n=s.map(e=>e.join("[&]"));return r=n,i.sort((e,t)=>{l&&(e=l(e),t=l(t));const i=r.indexOf(e),s=r.indexOf(t);return-1===i&&-1===s?0:-1===i?1:-1===s?-1:i-s});var r,l},_i=e=>{const{sortParam:t,originValues:i=[],measureValues:s,dataSet:o}=e,{sortFunc:n,sortMethod:r,sortBy:l}=t;let d=i;const c={originValues:i,measureValues:s,sortParam:t,dataSet:o};return n?d=(e=>{const{originValues:t=[],measureValues:i,sortParam:s,dataSet:o}=e,{sortFunc:n,sortFieldId:r,sortMethod:l}=s,d=null==n?void 0:n(Object.assign({data:i},s));return(null==d?void 0:d.length)?(o.fields.rows.indexOf(r)>0||o.fields.columns.indexOf(r)>0)&&!(0,a.includes)(d[0],"[&]")?xi({sortByValues:d,originValues:t}):wi(d,t,fi(l)):t})(c):l?d=xi({sortByValues:l,originValues:i}):(fi(r)||Ci(r))&&(d=(e=>{const{sortParam:t,measureValues:i,originValues:s,dataSet:o}=e,{sortByMeasure:n,query:r,sortFieldId:l,sortMethod:a,nullsPlacement:d="last"}=t,{rows:c=[],columns:h=[]}=o.fields,u=null==c?void 0:c.includes(l);let p;if(n){const e=yi(i,a,n===ye.jI?null==r?void 0:r[ye.GJ]:n,d),t=u?c:L(h);p=(0,Oe.XN)(l,t,e)}else p=yi(i,a,void 0,d);return wi(p,s,fi(a))})(c)),d},Si=e=>{const{dataSet:t,sortParam:i,originValues:s}=e,{fields:o}=t,{sortByMeasure:n,query:r,sortFieldId:l}=i;if(n!==ye.jI){return t.getCellMultiData({query:r,queryType:be.B.DetailOnly})}const d=t.getCellMultiData({query:r,queryType:be.B.All}),c=L(o.columns),h=(0,a.includes)(o.rows,l),u=(0,Oe.LR)(h?o.rows:c),p=(0,Oe.LR)(h?c:o.rows),g=u[u.indexOf(l)+1],m=(0,a.keys)(r),v=p.filter(e=>!m.includes(e)),f=d.filter(e=>{const t=new Set((0,a.keys)(e[ye._O]));if(!t.has(l))return!1;if(t.has(g))return!1;return v.every(e=>!t.has(e))});return(0,a.isEmpty)(f)?(0,a.compact)((0,a.map)(s,e=>{const i=((e,t,i)=>{var s;const o={};if((0,a.includes)(e,"[&]")){const n=(0,a.split)(e,"[&]"),r=(null===(s=null==t?void 0:t.rows)||void 0===s?void 0:s.includes(i))?t.rows:L(t.columns);for(let e=0;e<=(0,a.indexOf)(r,i);e++)o[r[e]]=n[e]}else o[i]=e;return o})(e,o,l);return t.getTotalValue(Object.assign(Object.assign({},r),i))})):f},bi=(e,t)=>{if(null==e?void 0:e.sortMethod){if(fi(null==e?void 0:e.sortMethod))return"groupAsc";if(Ci(null==e?void 0:e.sortMethod))return"groupDesc"}if(t)return"SortDown"},Ei=e=>{const{pivotMeta:t,dimensions:i,sortedDimensionValues:s,sortFieldId:o}=e,n={children:t};let r=[n];for(const e of i){if(e===o){r.forEach(e=>{const t=[...e.children.values()],i=(0,a.sortBy)(t,e=>(0,a.indexOf)(s,e.id)).map(e=>[e.value,e]);e.children=new Map(i)});break}r=(0,a.flatMap)(r,e=>[...e.children.values()])}return n.children};class Li extends Ce{constructor(){super(...arguments),this.hasMobileTouchListeners=!1}getHeaderConfig(){return this.headerConfig||{}}isShallowRender(){return super.isShallowRender()||this.headerConfig.shallowRender}shouldInit(){return super.shouldInit()&&!this.isShallowRender()}handleRestOptions(...[e]){this.headerConfig=Object.assign({},e);const{value:t,query:i}=this.meta,s=this.spreadsheet.dataCfg.sortParams||[],o=this.isSortCell(),n=(0,a.find)([...s].reverse(),e=>o&&(null==e?void 0:e.sortByMeasure)===t&&(0,a.isEqual)((0,a.get)(e,"query"),i)),r=bi(n,o);this.headerConfig.sortParam=Object.assign(Object.assign(Object.assign({},this.headerConfig.sortParam),n||{query:i}),{type:r})}initCell(){this.resetTextAndConditionIconShapes(),this.actionIcons=[],this.hasDefaultHiddenIcon=!1,this.generateIconConfig()}generateIconConfig(){var e,t;this.conditionIconMappingResult=this.getIconConditionResult();const{sortParam:i}=this.getHeaderConfig();this.actionIconConfig=this.showSortIcon()?{icons:[{name:(null==i?void 0:i.type)||"none",position:"right"}],belongsCell:this.cellType,isSortIcon:!0}:(0,re.AS)(this.spreadsheet.options.headerActionIcons,this.meta,this.cellType),this.groupedIcons=(0,re.y0)(null!==(t=null===(e=this.actionIconConfig)||void 0===e?void 0:e.icons)&&void 0!==t?t:[],this.conditionIconMappingResult)}getFormattedFieldValue(){const{isTotalRoot:e,isGrandTotals:t,value:i}=this.meta,s=this.spreadsheet.dataSet.getFieldFormatter(this.meta.field);let o=!0;o=!this.spreadsheet.isTableMode()&&(this.spreadsheet.isHierarchyTreeType()?!(t&&e):!e);return{formattedValue:o&&s?s(i,void 0,this.meta):i,value:i}}shouldShowDefaultHeaderActionIcon(){return this.spreadsheet.options.showDefaultHeaderActionIcon}showSortIcon(){const{dataCfg:e}=this.spreadsheet,t=(0,a.isEmpty)(e.fields.values);if(this.shouldShowDefaultHeaderActionIcon()&&!t){const{sortParam:e}=this.getHeaderConfig(),t=this.meta.query;return this.isShallowRender()?t:t&&(0,a.isEqual)(null==e?void 0:e.query,t)&&(null==e?void 0:e.type)&&"none"!==(null==e?void 0:e.type)}return!1}getActionIconStyle(e){const{icon:t}=this.getStyle(),i=this.getTextConditionMappingResult(),s=(null==i?void 0:i.fill)||this.getTextStyle().fill;return{width:null==t?void 0:t.size,height:null==t?void 0:t.size,fill:null===e.fill?void 0:(null==e?void 0:e.fill)||(null==t?void 0:t.fill)||s,cursor:"pointer"}}hasDefaultHideActionIcon(){return this.hasDefaultHiddenIcon}addActionIcon(e){var t;const{x:i,y:s,name:o,defaultHide:n,onClick:r,onHover:l,isSortIcon:a}=e,d=new ie.r(Object.assign(Object.assign({},this.getActionIconStyle(e)),{name:o,x:i,y:s,iconStrategy:null===(t=this.spreadsheet.options.csp)||void 0===t?void 0:t.iconStrategy}));d.toggleVisibility(!n),d.addEventListener("mouseover",e=>{this.spreadsheet.emit(m.GLOBAL_ACTION_ICON_HOVER,e),null==l||l({hovering:!0,name:o,meta:this.meta,event:e})}),d.addEventListener("mouseleave",e=>{this.spreadsheet.emit(m.GLOBAL_ACTION_ICON_HOVER_OFF,e),null==l||l({hovering:!1,name:o,meta:this.meta,event:e})}),d.addEventListener("click",e=>{this.spreadsheet.emit(m.GLOBAL_ACTION_ICON_CLICK,e),a?this.spreadsheet.handleGroupSort(e,this.meta):null==r||r({name:o,meta:this.meta,event:e})}),this.actionIcons.push(d),this.appendChild(d)}drawActionAndConditionIcons({updatePositionOnly:e=!1}={}){if((0,a.isEmpty)(this.groupedIcons.left)&&(0,a.isEmpty)(this.groupedIcons.right))return;if(!this.leftIconPosition||!this.rightIconPosition)return;let t=0;(0,a.forEach)(this.groupedIcons,(i,s)=>{const{size:o,margin:n}=this.getStyle().icon,r=n.right,l="left"===s?this.leftIconPosition:this.rightIconPosition;(0,a.forEach)(i,(i,s)=>{var n,a,d,c,h;const u=l.x+(o+r)*s,p=l.y;if(i.isConditionIcon){const t={x:u,y:p,name:i.name,width:o,height:o,fill:i.fill,iconStrategy:null===(n=this.spreadsheet.options.csp)||void 0===n?void 0:n.iconStrategy};if(this.conditionIconShape){if(e)return void this.conditionIconShape.updatePosition({x:u,y:p});this.conditionIconShape.reRender(t)}else this.conditionIconShape=(0,w.sH)(this,t);return void this.addConditionIconShape(this.conditionIconShape)}if(e)return void(null===(a=this.actionIcons[t++])||void 0===a||a.updatePosition({x:u,y:p}));const{onClick:g,onHover:m,defaultHide:v,isSortIcon:f}=this.actionIconConfig,C=null!==(d=i.defaultHide)&&void 0!==d?d:v,y="function"==typeof C?C(this.meta,i.name):C;y&&(this.hasDefaultHiddenIcon=!0),this.addActionIcon({name:i.name,fill:i.fill,x:u,y:p,defaultHide:y,onClick:null!==(c=i.onClick)&&void 0!==c?c:g,onHover:null!==(h=i.onHover)&&void 0!==h?h:m,isSortIcon:f})})})}isSortCell(){var e,t,i;const s=null===(t=null===(e=this.spreadsheet)||void 0===e?void 0:e.isValueInCols)||void 0===t?void 0:t.call(e),o=this.meta.level===(null===(i=this.meta.hierarchy)||void 0===i?void 0:i.maxLevel);return s?o&&this.cellType===d.vZ.COL_CELL:o&&this.cellType===d.vZ.ROW_CELL}handleByStateName(e,t){we(e,this)&&this.updateByState(t)}handleSearchResult(e){if(!we(e,this))return;(0,a.find)(e,e=>null==e?void 0:e.isTarget).id===this.getMeta().id?this.updateByState(d.xT.HIGHLIGHT):this.updateByState(d.xT.SEARCH_RESULT)}handleHover(e){var t;we(e,this)&&(this.updateByState(d.xT.HOVER),this.hasDefaultHideActionIcon()&&this.toggleActionIcon(null===(t=null==e?void 0:e[0])||void 0===t?void 0:t.id))}handleSelect(e,t=[]){we(e,this)&&this.updateByState(d.xT.SELECTED);const i=(0,a.map)(t,"id");(0,a.includes)(i,this.meta.id)&&this.updateByState(d.xT.SELECTED)}getTextStyle(){const e=this.getCellTextWordWrapStyle(),{text:t,bolderText:i,measureText:s}=this.getStyle();let o;return o=this.isMeasureField()?s||t:this.isBolderText()?i:t,this.getContainConditionMappingResultTextStyle(Object.assign(Object.assign({},e),o))}getBackgroundColor(){var e;const{backgroundColor:t,backgroundColorOpacity:i}=(null===(e=this.getStyle())||void 0===e?void 0:e.cell)||{};return(0,a.merge)({backgroundColor:t,backgroundColorOpacity:i},this.getBackgroundConditionFill())}toggleActionIcon(e){if(this.getMeta().id===e){const e=[];(0,a.forEach)(this.actionIcons,t=>{"visible"!==t.parsedStyle.visibility&&(t.toggleVisibility(!0),e.push(t))}),this.spreadsheet.store.set("visibleActionIcons",e)}}getIconPosition(){return this.leftIconPosition||this.rightIconPosition}getInteractedCells(){var e;return null===(e=this.spreadsheet.interaction)||void 0===e?void 0:e.getCells([d.vZ.CORNER_CELL,d.vZ.COL_CELL,d.vZ.ROW_CELL,d.vZ.SERIES_NUMBER_CELL])}update(){const{interaction:e}=this.spreadsheet,t=null==e?void 0:e.getState();if((null==t?void 0:t.stateName)===d.xT.ALL_SELECTED)return void this.updateByState(d.xT.SELECTED);const i=this.getInteractedCells();if((0,a.first)(i))switch(null==t?void 0:t.stateName){case d.xT.SELECTED:case d.xT.ROW_CELL_BRUSH_SELECTED:case d.xT.COL_CELL_BRUSH_SELECTED:this.handleSelect(i,null==t?void 0:t.nodes);break;case d.xT.HOVER_FOCUS:case d.xT.HOVER:this.handleHover(i);break;case d.xT.SEARCH_RESULT:this.handleSearchResult(i);break;default:this.handleByStateName(i,null==t?void 0:t.stateName)}}updateByState(e){super.updateByState(e,this)}hideInteractionShape(){super.hideInteractionShape()}isMeasureField(){return[ye.GJ,ye.B7].includes(this.meta.field)}mappingValue(e){var t;const i=this.getMeta().value;return null===(t=e.mapping)||void 0===t?void 0:t.call(e,i,this.meta,this)}findFieldCondition(e=[]){return(0,ue.NV)(e,this.meta.field)}getTreeIcon(){return this.treeIcon}getActionIcons(){return this.actionIcons||[]}getMetaField(){return this.meta.field}addMobileTouchListener(e){if(this.hasMobileTouchListeners)return;this.hasMobileTouchListeners=!0;let t=null;const i=e=>{var i,s;const o=e.nativeEvent,n=(null===(i=o.touches)||void 0===i?void 0:i[0])||(null===(s=o.changedTouches)||void 0===s?void 0:s[0]);n&&(t={x:n.clientX,y:n.clientY})},s=i=>{var s;const o=null===(s=i.nativeEvent.changedTouches)||void 0===s?void 0:s[0];if(!o||!t)return;const n=Math.abs(o.clientX-t.x),r=Math.abs(o.clientY-t.y);n<10&&r<10&&e(),t=null},o=()=>{t=null};this.mobileTouchHandlers={onTouchStart:i,onTouchEnd:s,onTouchCancel:o},this.addEventListener("touchstart",i),this.addEventListener("touchend",s),this.addEventListener("touchcancel",o)}destroy(){this.mobileTouchHandlers&&(this.removeEventListener("touchstart",this.mobileTouchHandlers.onTouchStart),this.removeEventListener("touchend",this.mobileTouchHandlers.onTouchEnd),this.removeEventListener("touchcancel",this.mobileTouchHandlers.onTouchCancel),this.mobileTouchHandlers=void 0),this.meta.belongsCell=null,super.destroy()}reInitCell(e,t){this.setMeta(e),this.handleRestOptions(t,void 0),this.initCell()}setHeaderConfig(e){this.handleRestOptions(e,void 0),this.updateTextPosition(),this.drawActionAndConditionIcons({updatePositionOnly:!0})}}class Ti extends Li{get cellType(){return d.vZ.COL_CELL}getBorderPositions(){return[v.cV.TOP,v.cV.RIGHT]}initCell(){super.initCell(),this.drawBackgroundShape(),this.drawInteractiveBgShape(),this.drawInteractiveBorderShape(),this.drawTextOrCustomRenderer()}afterDrawText(){this.drawActionAndConditionIcons(),this.drawBorders(),this.drawResizeArea(),this.addExpandColumnIconShapes(),this.update()}getFormattedFieldValue(){var e;const{extra:t,value:i,field:s}=this.meta,{fields:o}=this.spreadsheet.dataSet;return(null==t?void 0:t.isCustomNode)&&(null===(e=null==o?void 0:o.values)||void 0===e?void 0:e.includes(s))?{formattedValue:i,value:i}:super.getFormattedFieldValue()}getMaxTextWidth(){const{width:e}=this.getBBoxByType(v.Ok.CONTENT_BOX);return e-this.getActionAndConditionIconWidth()}isBolderText(){const{isLeaf:e,isTotals:t}=this.meta;return!(!t&&e)}handleViewport(){if(this.meta.isFrozen)return{start:0,size:Number.POSITIVE_INFINITY};const{viewportWidth:e,cornerWidth:t=0,scrollX:i=0}=this.getHeaderConfig(),o=this.spreadsheet.facet.frozenGroupAreas,n=o[s.Col].width,r=o[s.TrailingCol].width;return this.spreadsheet.isFrozenRowHeader()?{start:i+n,size:e-n-r}:{start:n+Math.max(0,i-t),size:e-n-r+Math.min(i,t)}}getContentPosition({contentWidth:e=this.getActualTextWidth()}={}){var t,i,s;const{isLeaf:o}=this.meta,n=this.getTextStyle(),r=this.getBBoxByType(v.Ok.CONTENT_BOX),l=this.getIconStyle(),a=(0,R.l2)(r,n.textBaseline),d=(0,R.Bh)(l.size,a,n.fontSize,n.textBaseline);if(o){const{textX:t,leftIconX:i,rightIconX:s}=(0,R.Cb)({bbox:r,textWidth:e,textAlign:n.textAlign,groupedIcons:this.groupedIcons,iconStyle:l,isCustomRenderer:!!this.getRenderer()});return this.leftIconPosition={x:i,y:d},this.rightIconPosition={x:s,y:d},{x:t,y:a}}const c=this.handleViewport(),{cell:h,icon:u}=this.getStyle(),{textAlign:p,textBaseline:g}=this.getTextStyle(),{textStart:m,iconStart:f,iconEnd:C}=N(c,{start:r.x,size:r.width},{align:I(p),size:{textSize:e,iconStartSize:this.getActionAndConditionIconWidth("left"),iconEndSize:this.getActionAndConditionIconWidth("right")},padding:{start:null===(t=null==h?void 0:h.padding)||void 0===t?void 0:t.left,end:null===(i=null==h?void 0:h.padding)||void 0===i?void 0:i.right,betweenTextAndEndIcon:null===(s=null==u?void 0:u.margin)||void 0===s?void 0:s.left}},{isCustomRenderer:!!this.getRenderer()}),y=(0,R.l2)(r,g);return this.leftIconPosition={x:f,y:d},this.rightIconPosition={x:C,y:d},{x:m,y}}getTextPosition(){return this.getContentPosition()}getColResizeArea(){return j(this.spreadsheet,h.E2)}getHorizontalResizeAreaName(){return`${h.YD}${this.meta.field}`}isCrossColumnLeafNode(){var e;const{colsHierarchy:t}=this.spreadsheet.facet.getLayoutResult(),{level:i,isLeaf:s}=this.meta;return(null===(e=null==t?void 0:t.sampleNodeForLastLevel)||void 0===e?void 0:e.level)!==i&&s}drawHorizontalResizeArea(){var e,t;if(0===(null===(t=null===(e=this.spreadsheet.options.style)||void 0===e?void 0:e.colCell)||void 0===t?void 0:t.height)||!this.shouldDrawResizeAreaByType("colCellVertical",this))return;const{y:i,height:s}=this.meta,{position:o}=this.getHeaderConfig(),n=this.getResizeAreaStyle(),r=this.getColResizeArea();if(!r||this.isCrossColumnLeafNode())return;const l=this.getHorizontalResizeAreaName();if(null==r?void 0:r.find(e=>e.name===l))return;const a=o.y+i,d=this.getResizeAreaWidth(),c=P({theme:n,type:u.Vertical,effect:p.Field,offsetX:0,offsetY:a,width:d,height:s,meta:this.meta,cell:this}),h=Object.assign(Object.assign({},c.style),{x:0,y:a+s-n.size,width:d});this.horizontalResizeArea?(this.horizontalResizeArea.name=l,this.horizontalResizeArea.appendInfo=c.appendInfo,(0,B.w)(this.horizontalResizeArea,h)):this.horizontalResizeArea=r.appendChild(new f({name:l,style:h},c.appendInfo))}getResizeAreaWidth(){const{cornerWidth:e=0,viewportWidth:t}=this.getHeaderConfig();return T.getVerticalBorderWidth(this.spreadsheet)+e+t}shouldAddVerticalResizeArea(){if(this.getMeta().isFrozen)return!0;const{x:e,y:t,width:i,height:o}=this.meta,{scrollX:n=0,scrollY:r,cornerWidth:l=0,height:a,width:d}=this.getHeaderConfig(),c=this.getResizeAreaStyle(),h={x:e+i-c.size,y:t,width:c.size,height:o},u=this.spreadsheet.facet.frozenGroupAreas,p=u[s.Col].width,g=u[s.TrailingCol].width;let m;return m=this.spreadsheet.isFrozenRowHeader()?{x:p,y:0,width:d-p-g,height:a}:{x:p-l,y:0,width:d-p-g+l,height:a},W(h,m,{scrollX:n,scrollY:r})}getVerticalResizeAreaOffset(){const{x:e,y:t}=this.meta,{scrollX:i=0,position:o,cornerWidth:n=0,viewportWidth:r}=this.getHeaderConfig(),l=this.spreadsheet.isFrozenRowHeader(),a=this.spreadsheet.facet.frozenGroupAreas,d=a[s.Col],c=a[s.TrailingCol];let h=null==o?void 0:o.x;return this.getMeta().isFrozenHead?h+=e-d.x-(l?0:Math.min(i,n)):this.getMeta().isFrozenTrailing?h+=e-c.x+r-c.width:h+=e-i,{x:h,y:(null==o?void 0:o.y)+t}}drawVerticalResizeArea(){if(!this.meta.isLeaf||this.meta.hideColCellHorizontalResize||!this.shouldDrawResizeAreaByType("colCellHorizontal",this))return;const{width:e,height:t}=this.meta,i=this.getResizeAreaStyle(),s=this.getColResizeArea();if(!s)return;if(!this.shouldAddVerticalResizeArea())return void(this.verticalResizeArea&&(this.verticalResizeArea.style.visibility="hidden"));const{x:o,y:n}=this.getVerticalResizeAreaOffset(),r=P({theme:i,type:u.Horizontal,effect:p.Cell,offsetX:o,offsetY:n,width:e,height:t,meta:this.meta,cell:this}),l=Object.assign(Object.assign({},r.style),{x:o+e-i.size,y:n,height:t,visibility:"visible"});this.verticalResizeArea?(this.verticalResizeArea.appendInfo=r.appendInfo,(0,B.w)(this.verticalResizeArea,l)):this.verticalResizeArea=s.appendChild(new f({style:l},r.appendInfo))}drawResizeArea(){this.drawHorizontalResizeArea(),this.drawVerticalResizeArea()}hasHiddenColumnCell(){const{interaction:e}=this.spreadsheet.options,t=this.spreadsheet.store.get("hiddenColumnsDetail",[]);return!(0,a.isEmpty)(t)&&!(0,a.isEmpty)(null==e?void 0:e.hiddenColumnFields)&&!!t.find(e=>z(null==e?void 0:e.displaySiblingNode,this.meta.id,this.isLastColumn()?"prev":"next"))}getExpandIconTheme(){return this.getStyle().icon}addExpandColumnSplitLine(){const{x:e,y:t,width:i,height:s}=this.getBBoxByType(),{horizontalBorderColor:o,horizontalBorderColorOpacity:n}=this.theme.splitLine,r=this.isLastColumn()?e+i:e;(0,w.ni)(this,{x1:r,y1:t,x2:r,y2:t+s,stroke:o,lineWidth:1,strokeOpacity:n})}addExpandColumnIconShapes(){this.hasHiddenColumnCell()&&(this.addExpandColumnSplitLine(),this.addExpandColumnIcons())}addExpandColumnIcons(){const e=this.isLastColumn();this.addExpandColumnIcon(e),this.isAllDisplaySiblingNodeHidden()&&e&&this.addExpandColumnIcon(!1)}addExpandColumnIcon(e){var t;const i=this.getExpandColumnIconConfig(e),s=(0,w.sH)(this,Object.assign(Object.assign({},i),{name:"ExpandColIcon",cursor:"pointer",iconStrategy:null===(t=this.spreadsheet.options.csp)||void 0===t?void 0:t.iconStrategy}));s.addEventListener("click",()=>{this.spreadsheet.emit(m.COL_CELL_EXPANDED,this.meta,e?"prev":"next")}),s.addEventListener("mouseenter",t=>{this.spreadsheet.emit(m.COL_CELL_EXPAND_ICON_HOVER,{event:t,meta:this.meta,hiddenColumns:F(this.spreadsheet,this.meta.id,e?"prev":"next")})})}getExpandColumnIconConfig(e){const{size:t=0}=this.getExpandIconTheme(),{x:i,y:s,width:o,height:n}=this.getBBoxByType(),r=i-t;return{x:e?r+o:r,y:s+n/2-t/2,width:2*t,height:t}}isLastColumn(){return((e,t)=>{const i=e.facet.getColLeafNodes(),s=e.facet.getInitColIndexLeafNodes(),o=M(t);return(0,a.get)((0,a.last)(i),o)===t&&(0,a.get)((0,a.last)(s),o)!==t})(this.spreadsheet,this.meta.id)}isAllDisplaySiblingNodeHidden(){const{id:e}=this.meta,t=this.spreadsheet.store.get("hiddenColumnsDetail",[]),i=t.find(({displaySiblingNode:t})=>{var i;return(null===(i=null==t?void 0:t.next)||void 0===i?void 0:i.id)===e});return t.find(({displaySiblingNode:t})=>{var i;return(null===(i=null==t?void 0:t.prev)||void 0===i?void 0:i.id)===e})&&i}getResizedTextMaxLines(){var e,t,i,s,o;const{colCell:n}=this.spreadsheet.options.style;return null!==(s=null!==(t=null===(e=null==n?void 0:n.maxLinesByField)||void 0===e?void 0:e[this.meta.id])&&void 0!==t?t:null===(i=null==n?void 0:n.maxLinesByField)||void 0===i?void 0:i[this.meta.field])&&void 0!==s?s:this.getMaxLinesByCustomHeight({isCustomHeight:null===(o=this.meta.extra)||void 0===o?void 0:o.isCustomHeight})}shouldShowDefaultHeaderActionIcon(){return this.spreadsheet.options.showDefaultHeaderActionIcon&&this.spreadsheet.isValueInCols()}setHeaderConfig(e){super.setHeaderConfig(e),this.drawResizeArea()}}var Oi=i("./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/utils/g-mini-charts.js");class Ri extends Ce{get cellType(){return d.vZ.DATA_CELL}isShallowRender(){return super.isShallowRender()||this.meta.shallowRender||!1}isMultiData(){const e=this.getFieldValue();return(0,a.isObject)(e)}getBorderPositions(){return[v.cV.BOTTOM,v.cV.RIGHT]}getValueRange(){return this.spreadsheet.dataSet.getValueRangeByField(this.meta.valueField)}handleByStateName(e,t){we(e,this)&&this.updateByState(t)}handleSearchResult(e){if(!we(e,this))return;(0,a.find)(e,e=>null==e?void 0:e.isTarget).id===this.getMeta().id?this.updateByState(d.xT.HIGHLIGHT):this.updateByState(d.xT.SEARCH_RESULT)}handleSelect(e){var t,i;switch(null===(t=null==e?void 0:e[0])||void 0===t?void 0:t.type){case d.vZ.COL_CELL:this.changeRowColSelectState("colIndex");break;case d.vZ.ROW_CELL:this.changeRowColSelectState("rowIndex");break;case d.vZ.DATA_CELL:(e=>{const{currentRow:t,currentCol:i,rowHeader:s,colHeader:o}=e.interaction.getSelectedCellHighlight();return t||i||s||o})(this.spreadsheet)?Se(e,this,this.spreadsheet):we(e,this)?this.updateByState(d.xT.SELECTED):(null===(i=this.spreadsheet.options.interaction)||void 0===i?void 0:i.selectedCellsSpotlight)&&this.updateByState(d.xT.UNSELECTED)}}isDisableHover(e){return e.type!==d.vZ.DATA_CELL}handleHover(e){const t=(0,a.first)(e);if(this.isDisableHover(t))return void this.hideInteractionShape();const{currentRow:i,currentCol:s}=this.spreadsheet.interaction.getHoverHighlight();if(i||s){s&&this.meta.colIndex===(null==t?void 0:t.colIndex)||i&&this.meta.rowIndex===(null==t?void 0:t.rowIndex)?this.updateByState(d.xT.HOVER):this.hideInteractionShape()}const{id:o,rowIndex:n,colIndex:r}=this.getMeta();(0,a.isEqual)(t.id,o)&&(0,a.isEqual)(t.rowIndex,n)&&(0,a.isEqual)(t.colIndex,r)&&this.updateByState(d.xT.HOVER_FOCUS)}update(){const e=this.spreadsheet.interaction.getCurrentStateName();if(e===d.xT.ALL_SELECTED)return void this.updateByState(d.xT.SELECTED);const t=this.spreadsheet.interaction.getCells();if(!(0,a.isEmpty)(t)&&e)switch(e){case d.xT.SELECTED:case d.xT.DATA_CELL_BRUSH_SELECTED:this.handleSelect(t);break;case d.xT.HOVER_FOCUS:case d.xT.HOVER:this.handleHover(t);break;case d.xT.SEARCH_RESULT:this.handleSearchResult(t);break;default:this.handleByStateName(t,e)}}setMeta(e){super.setMeta(e),this.isShallowRender()||this.initCell()}drawTextShape(){super.drawTextShape(),this.isShallowRender()||this.drawLinkField(this.meta)}initCell(){this.resetTextAndConditionIconShapes(),this.generateIconConfig(),this.shouldHideData=!!this.shouldHideRowSubtotalData(),this.conditionFill=this.getBackgroundConditionFill(),this.drawBackgroundShape(),this.drawInteractiveBgShape(),this.shouldHideData||this.drawConditionIntervalShape(),this.shouldHideData?this.afterDrawText():this.drawTextOrCustomRenderer()}afterDrawText(){this.shouldHideData||this.drawConditionIconShapes(),this.drawBorders(),this.drawInteractiveBorderShape(),this.update()}generateIconConfig(){var e;const t=this.findFieldCondition(null===(e=this.conditions)||void 0===e?void 0:e.icon),i=t&&t.mapping&&{name:"",position:(0,ue.dq)(t)};this.groupedIcons=(0,re.y0)([],i)}getTextStyle(){const e=this.getCellTextWordWrapStyle(),{isTotals:t}=this.meta,{dataCell:i}=this.theme,s=t?null==i?void 0:i.bolderText:null==i?void 0:i.text;return this.getContainConditionMappingResultTextStyle(Object.assign(Object.assign({},e),s))}drawConditionIntervalShape(){this.conditionIntervalShape=(0,Oi.U4)(this)}shouldHideRowSubtotalData(){var e,t;if(!this.spreadsheet.isHierarchyTreeType())return!1;const{rowId:i,rowIndex:s}=this.meta,o=this.spreadsheet.store.get("drillDownIdPathMap");if(null==o?void 0:o.has(i))return!1;const{row:n={}}=null!==(e=this.spreadsheet.options.totals)&&void 0!==e?e:{},r=null===(t=this.spreadsheet.facet)||void 0===t?void 0:t.getRowLeafNodeByIndex(s);return!n.showSubTotals&&(!(null==r?void 0:r.isGrandTotals)&&(null==r?void 0:r.isTotals))}getFormattedFieldValue(){var e;if(this.shouldHideData)return{value:null,formattedValue:"-"};const{rowId:t,valueField:i,fieldValue:s,data:o,id:n}=this.meta,r=null===(e=this.spreadsheet.dataSet.displayFormattedValueMap)||void 0===e?void 0:e.get(n),l=this.spreadsheet.dataSet.getFieldMeta(t),a=this.spreadsheet.dataSet.getFieldFormatter(l?t:i);return{value:s,formattedValue:null!=r?r:a(s,o,this.meta)}}getMaxTextWidth(){const{width:e}=this.getBBoxByType(v.Ok.CONTENT_BOX);return e-this.getActionAndConditionIconWidth()}getContentPosition({contentWidth:e=this.getActualTextWidth()}={}){const t=this.getBBoxByType(v.Ok.CONTENT_BOX),i=this.getTextStyle(),s=this.getIconStyle(),{textX:o,leftIconX:n,rightIconX:r}=(0,R.Cb)({bbox:t,iconStyle:s,textWidth:e,textAlign:i.textAlign,groupedIcons:this.groupedIcons,isCustomRenderer:!!this.getRenderer()}),l=(0,R.l2)(t,i.textBaseline),d=(0,R.Bh)(s.size,l,i.fontSize,i.textBaseline);return this.iconPosition={x:(0,a.isEmpty)(this.groupedIcons.left)?r:n,y:d},{x:o,y:l}}getTextPosition(){return this.getContentPosition()}getIconPosition(){return this.iconPosition}getBackgroundColor(){const e=this.getCrossBackgroundColor(this.meta.rowIndex),t=e.backgroundColor,i=e.backgroundColorOpacity;return this.shouldHideData?{backgroundColor:t,backgroundColorOpacity:i,intelligentReverseTextColor:!1}:(0,a.merge)({backgroundColor:t,backgroundColorOpacity:i},this.conditionFill)}changeRowColSelectState(e){var t,i,s;const{interaction:o}=this.spreadsheet,n=(0,a.get)(this.meta,e),{nodes:r=[],cells:l=[]}=o.getState();let c=!1;if(this.spreadsheet.isTableMode()&&r.length){c=((null===(i=null===(t=r[0])||void 0===t?void 0:t.hierarchy)||void 0===i?void 0:i.getLeaves())||[]).some((e,t)=>!!r.some(t=>t===e)&&t===n)}else c=[...r,...l].some(t=>(0,a.get)(t,e)===n);c?this.updateByState(d.xT.SELECTED):(null===(s=this.spreadsheet.options.interaction)||void 0===s?void 0:s.selectedCellsSpotlight)?this.updateByState(d.xT.UNSELECTED):this.hideInteractionShape()}drawBorders(){this.meta.isFrozenCorner&&Ce.prototype.drawBorders.call(this)}findFieldCondition(e=[]){return(0,ue.NV)(e,this.meta.valueField)}mappingValue(e){var t;const i=this.meta.fieldValue,s=this.spreadsheet.isTableMode()?this.spreadsheet.dataSet.getCellData({query:{rowIndex:this.meta.rowIndex}}):ci.getFieldValue(this.meta.data);return null===(t=e.mapping)||void 0===t?void 0:t.call(e,i,s,this)}updateByState(e){if(super.updateByState(e,this),e===d.xT.UNSELECTED){const t=(0,a.get)(this.theme,`${this.cellType}.cell.interactionState.${e}`);t&&this.toggleConditionIntervalShapeOpacity(t.opacity)}}clearUnselectedState(){super.clearUnselectedState(),this.toggleConditionIntervalShapeOpacity(1)}toggleConditionIntervalShapeOpacity(e){(0,w.O3)(this.conditionIntervalShape,d.lE.backgroundOpacity,e),(0,w.O3)(this.conditionIconShapes,d.lE.opacity,e)}getResizedTextMaxLines(){var e,t,i,s;const{rowCell:o}=this.spreadsheet.options.style;return null!==(s=null!==(t=null===(e=null==o?void 0:o.maxLinesByField)||void 0===e?void 0:e[this.meta.id])&&void 0!==t?t:null===(i=null==o?void 0:o.maxLinesByField)||void 0===i?void 0:i[this.meta.rowId])&&void 0!==s?s:this.getMaxLinesByCustomHeight({isCustomHeight:!0})}getMetaField(){return this.meta.valueField}}const Ii=he({brandColor:"#3471F9",semanticColors:{red:"#FF4D4F",green:"#29A294",yellow:"#FAAD14"},others:{highlight:"#87B5FF",results:"#F0F7FF"},basicColorRelations:[{basicColorIndex:1,standardColorIndex:0},{basicColorIndex:2,standardColorIndex:1},{basicColorIndex:3,standardColorIndex:5},{basicColorIndex:4,standardColorIndex:6},{basicColorIndex:5,standardColorIndex:6},{basicColorIndex:6,standardColorIndex:6},{basicColorIndex:7,standardColorIndex:5},{basicColorIndex:9,standardColorIndex:1},{basicColorIndex:10,standardColorIndex:4},{basicColorIndex:11,standardColorIndex:4},{basicColorIndex:12,standardColorIndex:5}]}),Ni=he({brandColor:"#326EF4",semanticColors:{red:"#FF4D4F",green:"#29A294",yellow:"#FAAD14"},others:{highlight:"#87B5FF",results:"#F0F7FF"},basicColorRelations:[{basicColorIndex:1,standardColorIndex:0},{basicColorIndex:2,standardColorIndex:1},{basicColorIndex:3,standardColorIndex:1},{basicColorIndex:4,standardColorIndex:2},{basicColorIndex:5,standardColorIndex:7},{basicColorIndex:6,standardColorIndex:5},{basicColorIndex:7,standardColorIndex:5},{basicColorIndex:9,standardColorIndex:1},{basicColorIndex:10,standardColorIndex:2},{basicColorIndex:11,standardColorIndex:5},{basicColorIndex:12,standardColorIndex:5}]}),Bi=he({brandColor:"#9DA7B6",semanticColors:{red:"#FF4D4F",green:"#29A294",yellow:"#FAAD14"},others:{highlight:"#87B5FF",results:"#F0F7FF"},basicColorRelations:[{basicColorIndex:1,standardColorIndex:0},{basicColorIndex:2,standardColorIndex:1},{basicColorIndex:3,standardColorIndex:1},{basicColorIndex:4,standardColorIndex:2},{basicColorIndex:5,standardColorIndex:7},{basicColorIndex:6,standardColorIndex:8},{basicColorIndex:7,standardColorIndex:5},{basicColorIndex:9,standardColorIndex:1},{basicColorIndex:10,standardColorIndex:2},{basicColorIndex:11,standardColorIndex:3},{basicColorIndex:12,standardColorIndex:3}]});var Ai=i("./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/common/constant/classnames.js");const Mi={default:Ni,colorful:Ii,gray:Bi,dark:{brandColor:"#255dff",semanticColors:{red:"#FF4D4F",green:"#29A294",yellow:"#FAAD14"},basicColors:["#ffffff","#151a27","#213f94","#133aad","#213f94","#255dff","#4b91ff","#4b91ff","#191919","#1e2436","#0647b1","#7899ff","#7899ff","#f0f0f0","#dcdcdc"],basicColorRelations:[]}},Di="Roboto, PingFangSC, Microsoft YaHei, Arial, sans-serif",Hi=`${Ai.u}-dark-theme`,ki=e=>Mi[e]||Mi.default;class zi extends Ri{getLinkFieldStyle(){return this.theme.rowCell.text.linkTextFill}getTextStyle(){if(this.meta.valueField===ye.r2){const e=this.getCellTextWordWrapStyle(d.vZ.SERIES_NUMBER_CELL),t=this.theme.rowCell.seriesText;return Object.assign(Object.assign({},e),t)}return super.getTextStyle()}shouldDrawResizeArea(){const e=`${this.meta.rowIndex}`,t=j(this.spreadsheet,h.k5);return!(null==t?void 0:t.getElementById(e))}drawResizeArea(){if(!this.shouldDrawResizeArea())return;const e=j(this.spreadsheet,h.k5);if(!e)return;const{rowIndex:t}=this.getMeta(),i=this.spreadsheet.facet.getCellRange(),{rowCount:o,trailingRowCount:n}=this.spreadsheet.facet.getFrozenOptions(),r=S(t,i.start,o),l=b(t,i.end,n),a=r||l,{y:d,height:c}=this.getBBoxByType(),{x:g,y:m,viewportWidth:v,viewportHeight:C}=this.spreadsheet.facet.panelBBox,{scrollY:y}=this.spreadsheet.facet.getScrollOffset(),w=this.spreadsheet.facet.getPaginationScrollY(),x=this.spreadsheet.facet.frozenGroupAreas,_=x[s.Row],E=x[s.TrailingRow],L=this.getResizeAreaStyle(),T=g+v;if(!W({x:0,y:d+c-L.size,width:T,height:L.size},{x:0,y:a?0:_.height,width:T,height:a?Number.POSITIVE_INFINITY:C-_.height-E.height},{scrollX:0,scrollY:a?0:w+y}))return;let O=m;O+=r?d-_.y:l?C-E.height+d-E.y:d-w-y;const R=P({theme:L,type:u.Vertical,effect:p.Cell,offsetX:0,offsetY:O,width:T,height:c,meta:this.meta,cell:this});e.appendChild(new f({style:Object.assign(Object.assign({},R.style),{x:0,y:O+c-L.size,width:T})},R.appendInfo))}isDisableHover(e){return(null==e?void 0:e.type)===d.vZ.COL_CELL}getResizedTextMaxLines(){var e,t,i,s,o;const{facet:n,options:r}=this.spreadsheet,{rowCell:l}=r.style,{id:a,rowId:d,rowIndex:c}=this.meta;return null!==(s=null!==(t=null===(e=null==l?void 0:l.maxLinesByField)||void 0===e?void 0:e[a])&&void 0!==t?t:null===(i=null==l?void 0:l.maxLinesByField)||void 0===i?void 0:i[d])&&void 0!==s?s:this.getMaxLinesByCustomHeight({isCustomHeight:null===(o=null==n?void 0:n.customRowHeightStatusMap)||void 0===o?void 0:o[c]})}}class Fi extends zi{get cellType(){return d.vZ.DATA_CELL}}class Pi{constructor(e){this.displayFormattedValueMap=new Map,this.getField=e=>((0,a.isString)(e)?e:null==e?void 0:e.field)||e,this.getFieldMeta=(0,a.memoize)((e,t)=>{const i=this.getField(e);return(0,a.find)(this.meta||t,({field:e})=>e instanceof RegExp?e.test(i):(0,a.isArray)(e)?e.includes(i):e===i)}),this.getCustomFieldDescription=e=>{var t,i;if(!e)return;const s=null===(t=e.getMeta)||void 0===t?void 0:t.call(e);if(!(null==s?void 0:s.isTotals)){if(e.cellType===d.vZ.DATA_CELL){const e=(0,a.find)(null==s?void 0:s.spreadsheet.dataCfg.meta,{field:(null==s?void 0:s.field)||(null==s?void 0:s.value)||(null==s?void 0:s.valueField)});return this.getFieldDescription(null==e?void 0:e.field)}return(null===(i=null==s?void 0:s.extra)||void 0===i?void 0:i.description)||this.getFieldDescription(null==s?void 0:s.field)}},this.spreadsheet=e}getFieldName(e,t){var i,s,o,n;if(e===ye.r2)return null===(i=this.spreadsheet)||void 0===i?void 0:i.getSeriesNumberText();const r=this.getField(e);let l;(null===(s=this.spreadsheet)||void 0===s?void 0:s.isCustomHeaderFields())&&(l=null===(n=null===(o=this.spreadsheet)||void 0===o?void 0:o.facet)||void 0===n?void 0:n.getHeaderNodes().find(e=>{var t;return e.field===r&&(null===(t=null==e?void 0:e.extra)||void 0===t?void 0:t.isCustomNode)}));const d=(null==l?void 0:l.value)||((0,a.isString)(e)?e:null==e?void 0:e.title)||e;return(0,a.get)(this.getFieldMeta(r,this.meta),"name",(0,fe.F)(null!=t?t:d))}getCustomRowFieldName(e){var t;if(!e)return;const i=null===(t=e.getMeta)||void 0===t?void 0:t.call(e);if(e.cellType===d.vZ.DATA_CELL){const e=this.spreadsheet.facet.getRowNodeByIndex(null==i?void 0:i.rowIndex);return(null==e?void 0:e.value)||this.getFieldName(null==e?void 0:e.field)}return(null==i?void 0:i.value)||this.getFieldName(null==i?void 0:i.field)}getFieldFormatter(e){const t=this.getField(e),i=(0,a.get)(this.getFieldMeta(t,this.meta),"formatter",a.identity);return(e,t,s)=>{var o,n;const r=(0,fe.Lv)(s,null===(n=null===(o=this.spreadsheet)||void 0===o?void 0:o.options)||void 0===n?void 0:n.placeholder);return(0,fe.Kg)(null==i?void 0:i(e,t,s),r)}}getFieldDescription(e){const t=this.getField(e);return(0,a.get)(this.getFieldMeta(t,this.meta),"description")}setDataCfg(e){var t,i,s;null===(s=null===(i=null===(t=this.getFieldMeta)||void 0===t?void 0:t.cache)||void 0===i?void 0:i.clear)||void 0===s||s.call(i);const{fields:o,meta:n,data:r,sortParams:l,filterParams:a}=this.processDataCfg(e);this.fields=o,this.meta=n,this.originData=r,this.sortParams=l,this.filterParams=a,this.displayData=this.originData,this.indexesData={}}processMeta(e=[],t){var i,s;return[...e,(0,Oe.bh)(e,null===(s=null===(i=this.spreadsheet)||void 0===i?void 0:i.options)||void 0===s?void 0:s.cornerExtraFieldText,t)]}getDisplayDataSet(){return this.displayData||[]}isEmpty(){return(0,a.isEmpty)(this.getDisplayDataSet())}getEmptyViewIndexes(){return[]}getValueRangeByField(e){const t=(i=e,this.spreadsheet.store.get(G,V)[i]);var i;if(t)return t;const s=(0,a.compact)((0,a.map)(this.originData,t=>{const i=t[e];return(0,a.isNil)(i)?null:Number.parseFloat(i)})),o={maxValue:(0,a.max)(s),minValue:(0,a.min)(s)};return((e,t)=>{const i=e.store.get(G,V);e.store.set(G,Object.assign(Object.assign({},i),t))})(this.spreadsheet,{[e]:o}),o}moreThanOneValue(){var e,t;return(null===(t=null===(e=this.fields)||void 0===e?void 0:e.values)||void 0===t?void 0:t.length)>1}}class ji extends Pi{constructor(){super(...arguments),this.handleDimensionValueFilter=()=>{(0,a.each)(this.filterParams,({filterKey:e,filteredValues:t,customFilter:i})=>{const s=new Set(t),o=t=>!s.has(t[e]),n=(0,a.filter)(this.displayData,e=>i?i(e)&&o(e):o(e));this.displayData=this.getDisplayData(n)})},this.handleDimensionValuesSort=()=>{(0,a.each)(this.sortParams,e=>{var t;const{sortFieldId:i,sortBy:s,sortFunc:o,sortMethod:n,query:r}=e;if(!i)return;let l=this.displayData;const d=[];if(r){const e=[];l.forEach(t=>{const i=Object.keys(r);let s=!0;for(let e=0;e<i.length;e++){const o=i[e];if(t[o]!==r[o]){s=!1,d.push(t);break}}s&&e.push(t)}),l=e}let c=l;if(o)c=o(Object.assign(Object.assign({},e),{data:l}));else if(s&&!(0,a.isFunction)(s)){const e=[...s].reverse();c=l.sort((t,s)=>{const o=e.indexOf(t[i]);return e.indexOf(s[i])-o})}else if(fi(n)||Ci(n)){const e=n.toLocaleLowerCase(),o=(0,fe.Lv)(this.spreadsheet,null===(t=this.spreadsheet.options)||void 0===t?void 0:t.placeholder),r=((0,a.isFunction)(s)?s:null)||(e=>e[i]===o?Number.MIN_VALUE:e[i]);c=[...l].sort((t,i)=>this.compareSortValues(r(t),r(i),e))}d.length&&(c=[...c,...d]),this.displayData=this.getDisplayData(c)})}}compareSortValues(e,t,i){const s=fi(i)?1:-1;return(0,a.isNil)(e)&&(0,a.isNil)(t)?0:(0,a.isNil)(e)?1:(0,a.isNil)(t)?-1:ui(e)&&ui(t)?(Number(e)-Number(t))*s:e.toString().localeCompare(t.toString(),"zh")*s}processDataCfg(e){return e}setDataCfg(e){super.setDataCfg(e),this.handleDimensionValueFilter(),this.handleDimensionValuesSort()}getStartFrozenRows(e){const{rowCount:t}=this.spreadsheet.options.frozen||{};return t?e.slice(0,t):[]}getEndFrozenRows(e){const{trailingRowCount:t}=this.spreadsheet.options.frozen||{};return t?e.slice(-t):[]}getDisplayData(e){const t=this.getStartFrozenRows(e),i=this.getEndFrozenRows(e),s=e.slice(t.length||0,-i.length||void 0);return[...t,...s,...i]}getDimensionValues(){return[]}getCellData({query:e={}}={}){if(0===this.displayData.length&&0===e.rowIndex)return;const t=this.displayData[e.rowIndex];return(0,a.hasIn)(e,"field")&&(0,a.isObject)(t)?t[e.field]:t}getCellMultiData({query:e={}}={}){if(!e)return this.displayData;const t=this.displayData[e.rowIndex]?[this.displayData[e.rowIndex]]:this.displayData;return(0,a.hasIn)(e,"field")?t.map(t=>t[e.field]):t}getRowData(e){return this.getCellData({query:{rowIndex:e.rowIndex}})}}class Wi extends Ti{handleRestOptions(...[e]){this.headerConfig=Object.assign({},e);const{field:t}=this.meta,i=(0,a.find)(this.spreadsheet.dataCfg.sortParams,e=>(null==e?void 0:e.sortFieldId)===t),s=bi(i,!0);this.headerConfig.sortParam=Object.assign(Object.assign(Object.assign({},this.headerConfig.sortParam),i||{}),{type:s})}getFormattedFieldValue(){return(0,re.ar)(this.meta,this.spreadsheet.dataSet.getFieldName(this.meta.field))}isSortCell(){return!0}showSortIcon(){const{extra:e}=this.meta,{options:t}=this.spreadsheet,{showDefaultHeaderActionIcon:i}=t;return(null==e?void 0:e.isCustomNode)?i&&this.meta.isLeaf:i}getTextStyle(){var e;const t=this.getCellTextWordWrapStyle(),i=null===(e=this.getStyle())||void 0===e?void 0:e.bolderText;return Object.assign(Object.assign({},t),i)}getHorizontalResizeAreaName(){return`${h.YD}${this.meta.id}`}drawBackgroundShape(){const{backgroundColor:e,backgroundColorOpacity:t}=this.getStyle().cell||{};this.backgroundShape=(0,w.P2)(this,Object.assign(Object.assign({},this.getBBoxByType()),{fill:e,fillOpacity:t}))}drawTextOrCustomRenderer(){this.drawTextShape(),this.afterDrawText()}}var Gi=i("./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/common/i18n/index.js");var Vi;!function(e){e.Adaptive="adaptive",e.ColAdaptive="colAdaptive",e.Compact="compact"}(Vi||(Vi={}));const $i={wordWrap:!0,maxLines:1,textOverflow:"ellipsis"},Ui={layoutWidthType:Vi.Adaptive,seriesNumberCell:$i,cornerCell:$i,rowCell:Object.assign(Object.assign({},$i),{showTreeLeafNodeAlignDot:!1}),colCell:Object.assign(Object.assign({},$i),{height:30}),dataCell:Object.assign(Object.assign({},$i),{width:96,height:30})},Yi={rowCount:0,colCount:0,trailingRowCount:0,trailingColCount:0},Xi={width:600,height:480,debug:!1,hierarchyType:"grid",device:pe.PC,conditions:{},totals:{},tooltip:{enable:!1,autoAdjustBoundary:"body",operation:{hiddenColumns:!1,sort:!1,menu:{items:[]}}},interaction:{copy:{enable:!0,withFormat:!0,withHeader:!1},linkFields:[],hiddenColumnFields:[],selectedCellsSpotlight:!1,hoverHighlight:!0,hoverFocus:{duration:800},scrollSpeedRatio:{horizontal:1,vertical:1},autoResetSheetStyle:!0,brushSelection:{dataCell:!0,rowCell:!0,colCell:!0},multiSelection:!0,rangeSelection:!0,scrollbarPosition:d.eb.CONTENT,resize:{rowCellVertical:!0,cornerCellHorizontal:!0,colCellHorizontal:!0,colCellVertical:!0,rowResizeType:g.CURRENT,colResizeType:g.CURRENT,minCellWidth:40,minCellHeight:20},eventListenerOptions:!1,selectedCellHighlight:!1,overscrollBehavior:"auto"},seriesNumber:{enable:!1},customSVGIcons:[],showDefaultHeaderActionIcon:!1,headerActionIcons:[],style:Ui,frozen:Object.assign({rowHeader:!0},Yi),hd:!0,cornerText:"",cornerExtraFieldText:"",placeholder:{cell:"-",empty:{icon:"Empty"}}};var Zi=i("./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/common/debug/index.js");const qi=(e,t,i)=>{var s,o;const n=(0,a.get)(i,"cell.padding"),r=null!==(o=null===(s=null==i?void 0:i.cell)||void 0===s?void 0:s.horizontalBorderWidth)&&void 0!==o?o:1,l=((e,t,i)=>{var s,o,n,r;const l=(null===(o=null===(s=i.icon)||void 0===s?void 0:s.margin)||void 0===o?void 0:o.left)||0,d=(null===(r=null===(n=i.icon)||void 0===n?void 0:n.margin)||void 0===r?void 0:r.right)||0,c=e.store.get("hiddenColumnsDetail",[]);let h=!1,u=!1;c.forEach(e=>{var i,s,o,n;(null===(s=null===(i=null==e?void 0:e.displaySiblingNode)||void 0===i?void 0:i.prev)||void 0===s?void 0:s.field)===t&&(h=!0),(null===(n=null===(o=null==e?void 0:e.displaySiblingNode)||void 0===o?void 0:o.next)||void 0===n?void 0:n.field)===t&&(u=!0)});const p=(0,a.get)(i,"icon.size");return{left:u?p+d:0,right:h?p+l:0}})(e,t.field,i),c=((e,t,i,s)=>{var o,n;const r=null==s?void 0:s.size,l=null==s?void 0:s.margin;let a=0;return a=e.options.showDefaultHeaderActionIcon?1:null!==(n=null===(o=(0,re.AS)(e.options.headerActionIcons,t,i))||void 0===o?void 0:o.icons.length)&&void 0!==n?n:0,a*(r+l.left)+(a>0?l.right:0)})(e,t,d.vZ.COL_CELL,null==i?void 0:i.icon);return n.left+n.right+c+l.left+l.right+r},Ki=(e,t,i)=>{if(i<=0)return{start:0,end:0};let s=(0,a.findIndex)(e,(i,s)=>t>=i&&t<e[s+1],0);s=Math.max(s,0);let o=i===t?s:(0,a.findIndex)(e,(t,s)=>i>t&&i<=e[s+1],s);return o=Math.min(-1===o?1/0:o,e.length-2),{start:s,end:o}},Ji=(e,t)=>{const{width:i,originalWidth:s}=t,o=Math.min(s-i,e);return o<0?0:o},Qi=(e,t,i)=>{const s=Math.min(t-i,e);return s<0?0:s},es=(e=[],t)=>{if((0,a.isEmpty)(e))return[];const i=[];return e.forEach(e=>{if(e instanceof t&&i.push(e),e instanceof l.YJ){e.children.forEach(e=>{e instanceof t&&i.push(e)})}}),i};class ts{constructor(e,t=!1){this.x=0,this.y=0,this.minX=0,this.minY=0,this.maxX=0,this.maxY=0,this.width=0,this.height=0,this.originalWidth=0,this.originalHeight=0,this.viewportHeight=0,this.viewportWidth=0,this.facet=e,this.spreadsheet=e.spreadsheet,this.layoutResult=e.getLayoutResult(),t&&this.calculateBBox()}}class is extends ts{calculateBBox(){const e=this.getWidth(),t=this.getHeight();this.width=e,this.height=t,this.maxX=e,this.maxY=t}calculateOriginalHeight(){var e;const{colsHierarchy:t}=this.layoutResult,{colCell:i}=this.spreadsheet.options.style;this.originalHeight=t.sampleNodeForLastLevel?C(t.height):null!==(e=this.facet.getCellCustomSize(null,null==i?void 0:i.height))&&void 0!==e?e:0}calculateOriginWidth(){const{rowsHierarchy:e}=this.layoutResult;this.originalWidth=C(e.width+this.facet.getSeriesNumberWidth())}getHeight(){return this.calculateOriginalHeight(),this.originalHeight}getWidth(){return this.calculateOriginWidth(),this.spreadsheet.isFrozenRowHeader()?this.adjustWidth():this.originalWidth}adjustWidth(){const{colsHierarchy:e}=this.layoutResult,{width:t,frozen:i}=this.spreadsheet.options,s=null==i?void 0:i.rowHeader,o=t*((0,a.isBoolean)(s)?.5:(0,a.clamp)(s,0,1)),n=null==e?void 0:e.width,r=t-this.originalWidth;if(this.originalWidth<=o||n<=r)return this.originalWidth;let l=0;return l=n<=t-o?this.originalWidth-(n-r):o,C(l)}}class ss extends l.YJ{constructor(e){const{name:t,s2:i}=e;super({name:t,style:(0,A.Tt)(e,["name","s2"])}),this.gridInfo={cols:[],rows:[]},this.updateGrid=(e,t=h.n7)=>{var i,s,o,n;this.gridGroup&&this.getElementById(t)||(this.gridGroup=this.appendChild(new l.YJ({id:t,style:{zIndex:2}})));const r=null!==(i=(0,a.last)(e.cols))&&void 0!==i?i:0,d=null!==(s=(0,a.last)(e.rows))&&void 0!==s?s:0,{theme:c}=this.s2,u=c.dataCell.cell,p=null!==(o=null==u?void 0:u.verticalBorderWidth)&&void 0!==o?o:1,g=p/2,m={stroke:u.verticalBorderColor,strokeOpacity:u.verticalBorderColorOpacity,lineWidth:p},v=null!==(n=null==u?void 0:u.horizontalBorderWidth)&&void 0!==n?n:1,f=v/2,C={stroke:u.horizontalBorderColor,strokeOpacity:u.horizontalBorderColorOpacity,lineWidth:v},y=this.gridGroup.children;let x=0;e.cols.forEach(e=>{const t=Object.assign({x1:e-g,x2:e-g,y1:0,y2:d},m);x<y.length?(0,w.wC)(y[x],t):(0,w.ni)(this.gridGroup,t),x++}),e.rows.forEach(e=>{const t=Object.assign({x1:0,x2:r,y1:-f,y2:-f,transform:`translate(0, ${e})`},C);x<y.length?(0,w.wC)(y[x],t):(0,w.ni)(this.gridGroup,t),x++});const _=x,S=y.length;if(_<S)for(let e=S-1;e>=_;e--)y[e].destroy();this.gridInfo=e},this.s2=i}}class os extends ss{}const ns=(e,t,i)=>i.slice(e,t+1).map(e=>e.x+e.width),rs=(e,t,i)=>{const s=[];for(let o=e;o<t+1;o++)s.push(i.getCellOffsetY(o+1));return s};var ls=i("./node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/array.js"),as=i("./node_modules/.pnpm/d3-timer@3.0.1/node_modules/d3-timer/src/timer.js");class ds extends Li{get cellType(){return d.vZ.ROW_CELL}getBorderPositions(){return[v.cV.BOTTOM,v.cV.LEFT]}initCell(){super.initCell(),this.drawBackgroundShape(),this.drawInteractiveBgShape(),this.drawInteractiveBorderShape(),this.drawTextOrCustomRenderer()}afterDrawText(){this.drawActionAndConditionIcons(),this.drawTreeIcon(),this.drawTreeLeafNodeAlignDot(),this.drawBorders(),this.drawResizeAreaInLeaf(),this.update()}getBackgroundColor(){const{backgroundColor:e,backgroundColorOpacity:t}=this.getCrossBackgroundColor(this.meta.rowIndex);return(0,a.merge)({backgroundColor:e,backgroundColorOpacity:t},this.getBackgroundConditionFill())}getBBoxByType(e=v.Ok.BORDER_BOX){var t,i,s,o;const n=super.getBBoxByType(e);if(!this.spreadsheet.isHierarchyGridTreeType()||!this.meta.isCollapsed)return n;const{hierarchy:r}=this.meta,l=(null==r?void 0:r.sampleNodesForAllLevels)||[];let a=0;for(let e=this.meta.level;e<=(null!==(t=null==r?void 0:r.maxLevel)&&void 0!==t?t:0);e++){const t=l[e];a+=null!==(i=null==t?void 0:t.width)&&void 0!==i?i:0}if(e===v.Ok.CONTENT_BOX){const{padding:e}=this.getStyle().cell;a-=(null!==(s=null==e?void 0:e.left)&&void 0!==s?s:0)+(null!==(o=null==e?void 0:e.right)&&void 0!==o?o:0)}return Object.assign(Object.assign({},n),{width:a||n.width})}showTreeIcon(){return!(!this.spreadsheet.isHierarchyTreeType()&&!this.spreadsheet.isHierarchyGridTreeType())&&(!!this.meta.isCollapsed||!this.meta.isLeaf)}showTreeLeafNodeAlignDot(){var e,t;return(null===(t=null===(e=this.spreadsheet.options.style)||void 0===e?void 0:e.rowCell)||void 0===t?void 0:t.showTreeLeafNodeAlignDot)&&this.spreadsheet.isHierarchyTreeType()&&!this.spreadsheet.isHierarchyGridTreeType()}getParentTreeIconCfg(){var e,t;if(!this.showTreeLeafNodeAlignDot()||!this.spreadsheet.isHierarchyTreeType()||!this.meta.isLeaf)return;const i=null===(t=null===(e=this.meta.parent)||void 0===e?void 0:e.belongsCell)||void 0===t?void 0:t.getTreeIcon();return null==i?void 0:i.style}onTreeIconClick(){const{isCollapsed:e,hierarchy:t}=this.meta,{device:i}=this.spreadsheet.options;if(!me(i)){if(!e){const{scrollY:e}=this.spreadsheet.facet.getScrollOffset(),i=this.spreadsheet.facet.panelBBox.viewportHeight||0,s=(e=>{let t=0;const i=e.children;return null==i||i.forEach(e=>{t+=e.height||0}),t})(this.meta),o=t.height-s;if(e>0&&e+i>o){const e=o-i;this.spreadsheet.facet.setScrollOffset({scrollY:e>0?e:0})}}this.emitCollapseEvent()}}emitCollapseEvent(){this.spreadsheet.emit(m.ROW_CELL_COLLAPSED__PRIVATE,{isCollapsed:!this.meta.isCollapsed,node:this.meta})}drawTreeIcon(){var e;if(!this.showTreeIcon())return;const{isCollapsed:t}=this.meta,{x:i}=this.getBBoxByType(v.Ok.CONTENT_BOX),{fill:s}=this.getTextStyle(),{size:o}=this.getStyle().icon,n=i+this.getContentIndent(),r=this.getIconPosition().y;this.treeIcon=(0,w.ms)({group:this,iconCfg:{x:n,y:r,width:o,height:o,fill:s,iconStrategy:null===(e=this.spreadsheet.options.csp)||void 0===e?void 0:e.iconStrategy},isCollapsed:t,onClick:()=>{this.onTreeIconClick()}});const{device:l}=this.spreadsheet.options;me(l)&&this.addMobileTouchListener(()=>{this.emitCollapseEvent()})}drawTreeLeafNodeAlignDot(){const e=this.getParentTreeIconCfg();if(!e)return;const{size:t,margin:i}=this.getStyle().icon,s=e.x+t+i.right,o=this.getTextPosition().y,{fill:n,fontSize:r}=this.getTextStyle(),l=t/5;this.treeLeafNodeAlignDot=(0,w.DH)(this,{cx:s+t/2,cy:o+(r-l)/2,r:l,fill:n,fillOpacity:.3})}isBolderText(){const{isLeaf:e,isTotals:t,level:i}=this.meta;return!e&&0===i||t}getResizesArea(){return j(this.spreadsheet,h.k5)}drawResizeAreaInLeaf(){if(!this.meta.isLeaf||this.meta.hideRowCellVerticalResize||!this.shouldDrawResizeAreaByType("rowCellVertical",this))return;const{x:e,y:t,width:i,height:o}=this.getBBoxByType(),n=this.getResizeAreaStyle(),r=this.getResizesArea();if(!r)return;const{position:l,width:a,viewportHeight:d,scrollX:c=0,scrollY:h=0}=this.getHeaderConfig(),g=this.meta.isFrozen,m=this.spreadsheet.facet.frozenGroupAreas,v=m[s.Row];if(!W({x:e,y:t+o-n.size,width:i,height:n.size},{x:0,y:g?0:v.height,width:a,height:g?Number.POSITIVE_INFINITY:d-v.height-m[s.TrailingRow].height},{scrollX:c,scrollY:g?0:h}))return;const{offsetX:C,offsetY:y}=this.getHorizontalResizeAreaOffset(),w=this.spreadsheet.isFrozenRowHeader()?a-l.x-(e-c):i,x=P({theme:n,type:u.Vertical,effect:p.Cell,offsetX:C,offsetY:y,width:i,height:o,meta:this.meta,cell:this});r.appendChild(new f({style:Object.assign(Object.assign({},x.style),{x:C,y:y+o-n.size,width:w})},x.appendInfo))}getHorizontalResizeAreaOffset(){const{position:e,viewportHeight:t,scrollX:i=0,scrollY:o=0}=this.getHeaderConfig(),{x:n,y:r}=this.getBBoxByType(),l=this.spreadsheet.facet.frozenGroupAreas,a=l[s.TrailingRow];let d=e.y;return d+=this.meta.isFrozenHead?r-l[s.Row].y:this.meta.isFrozenTrailing?t-a.height+r-a.y:r-o,{offsetX:e.x+n-i,offsetY:d}}getContentIndent(){if(!this.spreadsheet.isHierarchyTreeType()||this.spreadsheet.isHierarchyGridTreeType())return 0;const{icon:e,cell:t}=this.getStyle(),i=e.size+e.margin.right;let s=this.meta.parent,o=0;for(;s;)0!==s.height&&(o+=i),s=s.parent;return this.showTreeLeafNodeAlignDot()&&(o+=this.isTreeLevel()?0:t.padding.right+e.margin.right),o}getTextIndent(){const{size:e,margin:t}=this.getStyle().icon;return this.getContentIndent()+(this.showTreeIcon()||this.isTreeLevel()&&this.showTreeLeafNodeAlignDot()?e+t.right:0)}isTreeLevel(){return(0,a.find)((0,a.get)(this.meta,"parent.children"),e=>!e.isLeaf)}getMaxTextWidth(){const{width:e}=this.getBBoxByType(v.Ok.CONTENT_BOX);return e-this.getTextIndent()-this.getActionAndConditionIconWidth()}getTextArea(){const e=this.getBBoxByType(v.Ok.CONTENT_BOX),t=this.getTextIndent();return Object.assign(Object.assign({},e),{x:e.x+t,width:e.width-t})}handleViewport(){if(this.meta.isFrozen)return{start:0,size:Number.POSITIVE_INFINITY};const{scrollY:e,viewportHeight:t}=this.getHeaderConfig(),i=this.spreadsheet.facet.frozenGroupAreas,o=i[s.Row].height;return{start:e+o,size:t-o-i[s.TrailingRow].height}}getContentPosition({contentWidth:e=this.getActualTextWidth()}={}){const t=this.getTextArea(),i=this.getTextStyle(),{cell:s,icon:o}=this.getStyle(),n=this.handleViewport(),r=this.getActualTextHeight(),{textStart:l}=N(n,{start:t.y,size:t.height},{align:I(i.textBaseline),size:{textSize:r},padding:{start:s.padding.top,end:s.padding.bottom}}),{textX:a,leftIconX:d,rightIconX:c}=(0,R.Cb)({bbox:t,textWidth:e,textAlign:i.textAlign,groupedIcons:this.groupedIcons,iconStyle:o,isCustomRenderer:!!this.getRenderer()}),h=(0,R.Bh)(null==o?void 0:o.size,l,r,i.textBaseline);return this.leftIconPosition={x:d,y:h},this.rightIconPosition={x:c,y:h},{x:a,y:l}}getTextPosition(){return this.getContentPosition()}getResizedTextMaxLines(){var e,t,i,s,o;const{rowCell:n}=this.spreadsheet.options.style;return null!==(s=null!==(t=null===(e=null==n?void 0:n.maxLinesByField)||void 0===e?void 0:e[this.meta.id])&&void 0!==t?t:null===(i=null==n?void 0:n.maxLinesByField)||void 0===i?void 0:i[this.meta.field])&&void 0!==s?s:this.getMaxLinesByCustomHeight({isCustomHeight:null===(o=this.meta.extra)||void 0===o?void 0:o.isCustomHeight})}shouldShowDefaultHeaderActionIcon(){return this.spreadsheet.options.showDefaultHeaderActionIcon&&!this.spreadsheet.isValueInCols()}setHeaderConfig(e){super.setHeaderConfig(e)}}const cs=(e,t)=>(0,a.find)(t,t=>(0,a.isEqual)(t[0],e[1])),hs=e=>{let t=[];e.forEach(e=>{const i=e.getMeta(),{x:s,y:o,width:n,height:r}=i;t=t.concat(((e,t,i,s)=>{const o=[e,t],n=[e+i,t],r=[e+i,t+s],l=[e,t+s];return[[o,n],[n,r],[r,l],[l,o]]})(s,o,n,r))}),t=(e=>{const t=[];return(0,a.forEach)(e,i=>{const s=[i[1],i[0]];JSON.stringify(e).includes(JSON.stringify(s))||t.push(i)}),t})(t);let i=[];const s=t[0];let o=s,n=[];for(;!(0,a.isEqual)(s,n);)i=i.concat(o),n=cs(o,t),o=n;return i};class us extends Ri{get cellType(){return d.vZ.MERGED_CELL}constructor(e,t,i){super(i,e,t)}handleRestOptions(...[e]){this.cells=e}update(){}initCell(){this.resetTextAndConditionIconShapes(),this.drawBackgroundShape(),this.drawTextOrCustomRenderer()}afterDrawText(){this.drawBorders()}drawBackgroundShape(){const e=hs(this.cells);this.backgroundShape=(0,w.nP)(this,{points:e,fill:this.theme.dataCell.cell.backgroundColor})}drawTextShape(){if(!(0,a.isEmpty)(this.meta))return this.isMultiData()?(0,fe.V)(this):void super.drawTextShape()}drawBorders(){const{right:e,bottom:t,bottomRightCornerCell:i}=(e=>{const t=[],i=[],s=[];return e.forEach(s=>{const[o,n]=s.position||[];(0,a.find)(e,e=>{var t,i;return(null===(t=e.position)||void 0===t?void 0:t[0])===o+1&&(null===(i=e.position)||void 0===i?void 0:i[1])===n})||i.push(s),(0,a.find)(e,e=>{var t,i;return(null===(t=e.position)||void 0===t?void 0:t[1])===n+1&&(null===(i=e.position)||void 0===i?void 0:i[0])===o})||t.push(s)}),t.forEach(i=>{const[o,n]=i.position||[],r=(0,a.find)(e,e=>{var t,i;return(null===(t=e.position)||void 0===t?void 0:t[0])===o-1&&(null===(i=e.position)||void 0===i?void 0:i[1])===n});r&&!(0,a.includes)(t,r)&&s.push(r)}),{bottom:i,right:t,bottomRightCornerCell:s}})(this.cells);e.forEach(e=>{var t;const{position:i,style:s}=(0,R.qi)(v.cV.RIGHT,e.getBBoxByType(),null===(t=e.getStyle())||void 0===t?void 0:t.cell);(0,w.ni)(this,Object.assign(Object.assign({},i),s))}),t.forEach(e=>{var t;const{position:i,style:s}=(0,R.qi)(v.cV.BOTTOM,e.getBBoxByType(),null===(t=e.getStyle())||void 0===t?void 0:t.cell);(0,w.ni)(this,Object.assign(Object.assign({},i),s))}),i.forEach(e=>{var t;const{x:i,y:s,width:o,height:n}=e.getBBoxByType(),{horizontalBorderWidth:r=0,verticalBorderWidth:l=0,verticalBorderColor:a}=null===(t=e.getStyle())||void 0===t?void 0:t.cell,d=i+o-l/2;(0,w.ni)(this,{x1:d,x2:d,y1:s+n-r,y2:s+n,lineWidth:l,stroke:a,strokeOpacity:l})})}}var ps,gs=i("./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/common/interface/node.js");class ms extends Li{get cellType(){return d.vZ.CORNER_CELL}isBolderText(){const{cornerType:e}=this.meta;return e===gs.Q.Col}getBorderPositions(){return[v.cV.TOP,v.cV.LEFT]}initCell(){super.initCell(),this.resetTextAndConditionIconShapes(),this.drawBackgroundShape(),this.drawInteractiveBgShape(),this.drawInteractiveBorderShape(),this.drawTextShape(),this.drawTreeIcon(),this.drawActionAndConditionIcons(),this.drawBorders(),this.drawResizeArea(),this.update()}afterDrawText(){}onTreeIconClick(e){const{device:t}=this.spreadsheet.options;me(t)||this.emitCollapseEvent(e)}emitCollapseEvent(e){this.spreadsheet.facet.resetScrollY(),this.spreadsheet.emit(m.ROW_CELL_ALL_COLLAPSED__PRIVATE,e)}drawTreeIcon(){var e,t;if(!this.showTreeIcon())return;const{collapseFields:i={}}=null===(e=this.spreadsheet.options.style)||void 0===e?void 0:e.rowCell,{size:s=0}=this.getStyle().icon,{fill:o}=this.getTextStyle(),n=this.getBBoxByType(v.Ok.CONTENT_BOX),r=this.spreadsheet.facet.getRowNodes(0),l=(0,a.values)(i).filter(Boolean).length===r.length||r.every(e=>e.isCollapsed);this.treeIcon=(0,w.ms)({group:this,iconCfg:{x:n.x,y:this.getIconPosition().y,width:s,height:s,fill:o,iconStrategy:null===(t=this.spreadsheet.options.csp)||void 0===t?void 0:t.iconStrategy},isCollapsed:l,onClick:()=>{this.onTreeIconClick(l)}});const{device:d}=this.spreadsheet.options;me(d)&&this.addMobileTouchListener(()=>{this.emitCollapseEvent(l)})}isLastRowCornerCell(){const{cornerType:e,field:t}=this.meta,{rows:i}=this.spreadsheet.dataSet.fields;return e===gs.Q.Row&&(this.spreadsheet.isHierarchyTreeType()||(0,a.last)(i)===t)}getResizeAreaEffect(){const{cornerType:e}=this.meta;return e===gs.Q.Series?p.Series:this.isLastRowCornerCell()&&this.spreadsheet.isHierarchyTreeType()?p.Tree:p.Field}drawResizeArea(){if(!this.shouldDrawResizeAreaByType("cornerCellHorizontal",this))return;const e=this.getResizeAreaStyle(),t=j(this.spreadsheet,h.nO);if(!t)return;const{position:i,scrollX:s=0,scrollY:o=0,width:n,height:r}=this.getHeaderConfig(),{x:l,y:a,width:d,height:c}=this.getBBoxByType(),{cornerType:p}=this.meta;if(p===gs.Q.Col||!W({x:l+d-e.size,y:a,width:e.size,height:c},{x:0,y:0,width:n,height:r},{scrollX:s,scrollY:o}))return;const g=i.x+l-s,m=i.y+(this.isLastRowCornerCell()?0:a),v=P({theme:e,type:u.Horizontal,effect:this.getResizeAreaEffect(),offsetX:g,offsetY:m,width:d,height:c,meta:this.meta,cell:this});t.appendChild(new f({style:Object.assign(Object.assign({},v.style),{x:g+d-e.size,y:m,height:this.isLastRowCornerCell()?r:c})},v.appendInfo))}showTreeIcon(){return this.spreadsheet.isHierarchyTreeType()&&this.meta.cornerType===gs.Q.Row}getTreeIconWidth(){const{size:e,margin:t}=this.getStyle().icon;return this.spreadsheet.isHierarchyTreeType()?e+t.right:0}getMaxTextWidth(){const{width:e}=this.getBBoxByType(v.Ok.CONTENT_BOX);return e-this.getTreeIconWidth()-this.getActionAndConditionIconWidth()}getContentPosition({contentWidth:e=this.getActualTextWidth()}={}){const t=this.getBBoxByType(v.Ok.CONTENT_BOX),{x:i,y:s,height:o,width:n}=t,r=this.getTextStyle(),{textX:l,leftIconX:a,rightIconX:d}=(0,R.Cb)({bbox:{x:i+this.getTreeIconWidth(),y:s,width:n-this.getTreeIconWidth(),height:o},textAlign:r.textAlign,textWidth:e,groupedIcons:this.groupedIcons,iconStyle:this.getIconStyle()}),c=(0,R.l2)(t,r.textBaseline),{size:h=0}=this.getStyle().icon,u=(0,R.Bh)(h,c,r.fontSize,r.textBaseline);return this.leftIconPosition={x:a,y:u},this.rightIconPosition={x:d,y:u},{x:l,y:c}}getTextPosition(){return this.getContentPosition()}getFormattedFieldValue(){return(0,re.ar)(this.meta,this.spreadsheet.dataSet.getFieldName(this.meta.field))}getResizedTextMaxLines(){var e,t,i,s,o;const{colCell:n}=this.spreadsheet.options.style;return null!==(s=null!==(t=null===(e=null==n?void 0:n.maxLinesByField)||void 0===e?void 0:e[this.meta.id])&&void 0!==t?t:null===(i=null==n?void 0:n.maxLinesByField)||void 0===i?void 0:i[this.meta.field])&&void 0!==s?s:this.getMaxLinesByCustomHeight({isCustomHeight:null===(o=this.meta.extra)||void 0===o?void 0:o.isCustomHeight})}}class vs{constructor(){this.pool=[]}acquire(){return this.pool.pop()}release(e){this.pool.push(e)}}class fs extends vs{release(e){e.getRenderer()?e.destroy():this.pool.push(e)}}!function(e){e.MOUSE_DOWN="mousedown",e.MOUSE_MOVE="mousemove",e.MOUSE_UP="mouseup",e.MOUSE_OUT="mouseout",e.MOUSE_LEAVE="mouseleave",e.TOUCH_START="touchstart",e.TOUCH_END="touchend",e.KEY_DOWN="keydown",e.KEY_UP="keyup",e.CLICK="click",e.HOVER="hover",e.CONTEXT_MENU="contextmenu",e.POINTER_DOWN="pointerdown",e.POINTER_MOVE="pointermove",e.POINTER_OUT="pointerout",e.POINTER_LEAVE="pointerleave",e.POINTER_UP="pointerup",e.POINTER_CANCEL="pointercancel",e.POINTER_ENTER="pointerenter",e.POINTER_OVER="pointerover",e.RIGHT_DOWN="rightdown",e.RIGHT_UP="rightup",e.SCROLL="scroll"}(ps||(ps={}));const Cs=(e,t,i=[])=>{var s;const{cellsMeta:o,cells:n,invisibleCellInfo:r}=((e,t)=>{const i=[],s=[];let o;return(0,a.forEach)(e,e=>{const n=(0,a.find)(t,t=>{var i;const s=null===(i=null==t?void 0:t.getMeta)||void 0===i?void 0:i.call(t);if((null==s?void 0:s.colIndex)===(null==e?void 0:e.colIndex)&&(null==s?void 0:s.rowIndex)===(null==e?void 0:e.rowIndex))return t});n?(i.push(n),o=(null==e?void 0:e.showText)?null==n?void 0:n.getMeta():o):s.push(e)}),{cells:i,invisibleCellInfo:s,cellsMeta:o}})(i,e);let l=o,d=n;if((null==r?void 0:r.length)>0&&r.length<i.length){const{cells:e,cellsMeta:i}=((e,t)=>{const i=[];let s;return(0,a.forEach)(e,e=>{var o,n;const r=null===(o=null==t?void 0:t.facet)||void 0===o?void 0:o.getCellMeta(e.rowIndex,e.colIndex),l=null===(n=null==t?void 0:t.facet)||void 0===n?void 0:n.createDataCell(r);l&&(i.push(l),s=(null==e?void 0:e.showText)?r:s)}),{cells:i,cellsMeta:s}})(r,t);l=l||i,d=n.concat(e)}return(0,a.isEmpty)(n)||l||(l=null===(s=d[0])||void 0===s?void 0:s.getMeta()),{cells:d,viewMeta:l}},ys=(e,t,i)=>{var s;return(null===(s=e.options)||void 0===s?void 0:s.mergedCell)?e.options.mergedCell(e,t,i):new us(e,t,i)},ws=(e,t,i)=>{var s;const o=t||(e=>{const{interaction:t}=e,i=t.getActiveCells(),s=[];return(0,a.forEach)(i,(e,t)=>{const i=e.getMeta();s.push(Object.assign(Object.assign({},0===t?{showText:!0}:{}),{colIndex:null==i?void 0:i.colIndex,rowIndex:null==i?void 0:i.rowIndex}))}),s})(e);if((null==o?void 0:o.length)<=1)return void console.error("[mergeCell]: The merged cells must be more than one!");const n=e.facet.getDataCells(),{cells:r,viewMeta:l}=Cs(n,e,o);if(!(0,a.isEmpty)(r)){const t=(null===(s=e.options)||void 0===s?void 0:s.mergedCellsInfo)||[];t.push(o),e.setOptions({mergedCellsInfo:t});e.facet.panelScrollGroup.addMergeCell(ys(e,r,i?void 0:l))}},xs=(e,t)=>{var i,s,o;if(!t||t.cellType!==d.vZ.MERGED_CELL)return void console.error(`[unmergeCell]: The ${t} is not a MergedCell`);const n=((e,t)=>{const i=(0,a.map)(e.cells,e=>({colIndex:e.getMeta().colIndex,rowIndex:e.getMeta().rowIndex}));return(0,a.filter)(t,e=>{const t=e.map(e=>e.showText?{colIndex:e.colIndex,rowIndex:e.rowIndex}:e);return!(0,a.isEqual)(t,i)})})(t,(null===(i=e.options)||void 0===i?void 0:i.mergedCellsInfo)||[]);(null==n?void 0:n.length)!==(null===(o=null===(s=e.options)||void 0===s?void 0:s.mergedCellsInfo)||void 0===o?void 0:o.length)&&(e.setOptions({mergedCellsInfo:n}),t.remove())},_s=(e,t)=>(0,a.differenceWith)(e,t,(e,t)=>(0,a.isEqual)(e.viewMeta.id,t.viewMeta.id)),Ss=(e,t)=>{var i;const s=null===(i=e.options)||void 0===i?void 0:i.mergedCellsInfo;if((0,a.isEmpty)(s))return;const o=e.facet.getDataCells();if((0,a.isEmpty)(o))return;const n=[];s.forEach(t=>{const i=Cs(o,e,t);i.cells.length>0&&n.push(i)});const r=t.children,l=(e=>(0,a.map)(e,e=>({cells:e.cells,viewMeta:e.getMeta()})))(r),d=_s(l,n),c=_s(n,l);(0,a.forEach)(d,e=>{const t=(0,a.find)(r,t=>(0,a.isEqual)(t.getMeta().id,e.viewMeta.id));null==t||t.remove()}),(0,a.forEach)(c,({cells:i,viewMeta:s})=>{t.appendChild(ys(e,i,s))})};class bs extends ss{constructor(e){super(e),this.initMergedCellsGroup()}getMergedCellsGroup(){return this.mergedCellsGroup}initMergedCellsGroup(){this.mergedCellsGroup&&this.getElementById(h.H)||(this.mergedCellsGroup=this.appendChild(new l.YJ({id:h.H,style:{zIndex:3}})))}updateMergedCells(){this.initMergedCellsGroup(),Ss(this.s2,this.mergedCellsGroup)}addMergeCell(e){var t;null===(t=this.mergedCellsGroup)||void 0===t||t.appendChild(e),this.s2.emit(m.MERGED_CELLS_RENDER,e),this.s2.emit(m.LAYOUT_CELL_RENDER,e)}update(e){this.updateGrid(e),this.updateMergedCells()}}var Es;!function(e){e.ScrollChange="scroll-change",e.ScrollEnd="scroll-end"}(Es||(Es={}));class Ls extends l.YJ{constructor(e){super(),this.eventHandlers=[],this.scrollFrameId=null,this.getCoordinatesName=()=>({from:this.isHorizontal?"x1":"y1",to:this.isHorizontal?"x2":"y2"}),this.getCoordinatesWithBBoxExtraPadding=()=>{const{lineCap:e="butt",size:t=0}=this.theme;if("butt"===e)return{start:this.thumbOffset,end:this.thumbOffset+this.thumbLen};return{start:this.thumbOffset+(this.isHorizontal?0:t/2),end:this.thumbOffset+this.thumbLen-(this.isHorizontal?t:t/2)}},this.current=()=>this.thumbOffset/this.trackLen/(1-this.thumbLen/this.trackLen),this.updateThumbLen=e=>{if(this.thumbLen===e)return;this.thumbLen=e;const t=this.getCoordinatesName();this.thumbShape.attr(t.to,this.thumbOffset+e),this.emitScrollChange(this.thumbOffset/(this.trackLen-this.thumbLen)*this.scrollTargetMaxOffset,!1)},this.updateThumbOffset=(e,t=!0)=>{const i=this.validateRange(e);if(this.thumbOffset===i&&0!==i)return;this.thumbOffset=i;const{from:s,to:o}=this.getCoordinatesName(),{start:n,end:r}=this.getCoordinatesWithBBoxExtraPadding();this.thumbShape.attr({[s]:n,[o]:r}),t&&this.emitScrollChange(i/(this.trackLen-this.thumbLen)*this.scrollTargetMaxOffset,!1)},this.onlyUpdateThumbOffset=e=>{this.updateThumbOffset(e,!1)},this.emitScrollChange=(e,t=!0)=>{cancelAnimationFrame(this.scrollFrameId),this.scrollFrameId=requestAnimationFrame(()=>{this.dispatchEvent(new l.up(Es.ScrollChange,{offset:e,updateThumbOffset:t}))})},this.bindEventListener=(e,t,i)=>(null==e||e.addEventListener(t,i,!1),{remove:()=>{null==e||e.removeEventListener(t,i,!1)}}),this.addEvent=(e,t,i)=>{e.addEventListener(t,i),this.eventHandlers.push({target:e,type:t,handler:i})},this.initScrollBar=()=>{this.scrollBarGroup=this.createScrollBarGroup(),this.scrollBarGroup.setPosition(this.position.x,this.position.y),this.bindEvents()},this.createScrollBarGroup=()=>{const e=this.appendChild(new l.YJ({className:this.isHorizontal?"horizontalBar":"verticalBar"}));return this.trackShape=this.createTrackShape(e),this.thumbShape=this.createThumbShape(e),e},this.createTrackShape=e=>{const{lineCap:t="round",trackColor:i,size:s=0}=this.theme,o={lineWidth:s,stroke:i,lineCap:t};return e.appendChild(new l.N1(this.isHorizontal?{style:Object.assign(Object.assign({},o),{x1:0,y1:s/2,x2:this.trackLen,y2:s/2})}:{style:Object.assign(Object.assign({},o),{x1:s/2,y1:0,x2:s/2,y2:this.trackLen})}))},this.createThumbShape=e=>{const{size:t=0,lineCap:i="round",thumbColor:s}=this.theme,o={lineWidth:t,stroke:s,lineCap:i,cursor:"default"},{start:n,end:r}=this.getCoordinatesWithBBoxExtraPadding();return e.appendChild(new l.N1(this.isHorizontal?{style:Object.assign(Object.assign({},o),{x1:n,y1:t/2,x2:r,y2:t/2})}:{style:Object.assign(Object.assign({},o),{x1:t/2,y1:n,x2:t/2,y2:r})}))},this.bindEvents=()=>{this.addEventListener(ps.POINTER_DOWN,this.onStartEvent),this.addEventListener(ps.POINTER_UP,this.onPointerUp),this.trackShape.addEventListener("click",this.onTrackClick),this.thumbShape.addEventListener(ps.POINTER_OVER,this.onTrackPointerOver),this.thumbShape.addEventListener(ps.POINTER_OUT,this.onTrackPointerOut)},this.onStartEvent=e=>{e.preventDefault();const{clientX:t,clientY:i}=e;this.startPos=this.isHorizontal?t:i,this.bindLaterEvent()},this.bindLaterEvent=()=>{const e=this.ownerDocument.defaultView,t=document.body,i=[this.bindEventListener(t,ps.POINTER_MOVE,this.onPointerMove),this.bindEventListener(t,ps.POINTER_UP,this.onPointerUp),this.bindEventListener(t,ps.POINTER_LEAVE,this.onPointerUp)];this.addEvent(e,ps.POINTER_UP,this.onPointerUp),this.clearEvents=()=>{i.forEach(e=>{null==e||e.remove()}),(0,a.each)(this.eventHandlers,e=>{var t;null===(t=e.target)||void 0===t||t.removeEventListener(e.type,e.handler)}),this.eventHandlers.length=0}},this.onTrackClick=e=>{const t=this.validateRange(this.isHorizontal?e.x-this.position.x-this.thumbLen/2:e.y-this.position.y-this.thumbLen/2);this.updateThumbOffset(t)},this.onPointerMove=e=>{e.preventDefault();const t=this.isHorizontal?e.clientX:e.clientY,i=t-this.startPos;this.startPos=t,this.updateThumbOffset(this.thumbOffset+i)},this.onPointerUp=e=>{var t;this.dispatchEvent(new l.up(Es.ScrollEnd,{})),e.preventDefault(),null===(t=this.clearEvents)||void 0===t||t.call(this)},this.onTrackPointerOver=()=>{const{thumbHoverColor:e,hoverSize:t}=this.theme;this.thumbShape.attr("stroke",e),this.thumbShape.attr("lineWidth",t)},this.onTrackPointerOut=()=>{const{thumbColor:e,size:t}=this.theme;this.thumbShape.attr("stroke",e),this.thumbShape.attr("lineWidth",t)},this.validateRange=e=>{let t=e;return e+this.thumbLen>this.trackLen?t=this.trackLen-this.thumbLen:e+this.thumbLen<this.thumbLen&&(t=0),t};const{isHorizontal:t=!1,trackLen:i,thumbLen:s,position:o,thumbOffset:n=0,theme:r,scrollTargetMaxOffset:d}=e;this.isHorizontal=t,this.thumbOffset=n,this.trackLen=i,this.thumbLen=s,this.position=o,this.theme=r,this.scrollTargetMaxOffset=d,this.initScrollBar()}}const Ts=(e,t,i)=>{const[s,o,n,r]=i;return e>=s&&e<=o&&t>=n&&t<=r},Os=e=>{const[t,i,s,o]=e,n=[];for(let e=t;e<=i;e+=1)for(let t=s;t<=o;t+=1)n.push([e,t]);return n},Rs=(e,t)=>{const i=[],s=[];return Object.keys(t||{}).forEach(o=>{const{add:n,remove:r}=((e,t)=>{const i=[],s=[];if((0,a.isEmpty)(e))return(0,a.isEmpty)(t)?{add:i,remove:s}:{add:Os(t),remove:s};if((0,a.isEmpty)(t))return{add:i,remove:Os(e)};const[o,n,r,l]=e,[d,c,h,u]=t;for(let e=o;e<=n;e++)for(let i=r;i<=l;i++)Ts(e,i,t)||s.push([e,i]);for(let t=d;t<=c;t+=1)for(let s=h;s<=u;s+=1)Ts(t,s,e)||i.push([t,s]);return{add:i,remove:s}})((null==e?void 0:e[o])||[],t[o]);i.push(...n),s.push(...r)}),{add:i,remove:s}};class Is extends ts{calculateBBox(){this.calculateOriginWidth(),this.calculateOriginalHeight();const{cornerBBox:e}=this.facet,t=C(e.maxX),i=C(e.maxY);this.x=t+T.getVerticalBorderWidth(this.spreadsheet),this.y=i+T.getHorizontalBorderWidth(this.spreadsheet),this.minX=this.x,this.minY=this.y,this.width=this.getPanelWidth(),this.height=this.getPanelHeight(),this.viewportHeight=Math.abs(C(Math.min(this.height,this.originalHeight))),this.viewportWidth=Math.abs(C(Math.min(this.width,this.originalWidth))),this.maxX=this.x+this.viewportWidth,this.maxY=this.y+this.viewportHeight}calculateOriginalHeight(){this.originalHeight=this.facet.getRealHeight()}calculateOriginWidth(){this.originalWidth=this.facet.getRealWidth()}getPanelWidth(){const{width:e}=this.spreadsheet.options;return Math.max(0,e-this.x)}getPanelHeight(){const{height:e}=this.spreadsheet.options;return Math.max(0,e-this.y)}}class Ns{constructor(e){this.x=0,this.y=0,this.width=0,this.height=0,this.colIndex=-1,this.level=0,this.isLeaf=!1,this.children=[],this.padding=0,this.extra={},(0,a.assign)(this,e)}static getFieldPath(e,t){if(e&&!e.isTotals||e&&t){let t=e.parent;const i=[e.field];for(;t&&"root"!==t.id;)i.push(t.field),t=t.parent;return i.reverse()}return[]}static getAllLeaveNodes(e){const t=[];if(e.isLeaf)return[e];const i=[...e.children||[]];let s=i.shift();for(;s;)s.isLeaf?t.push(s):i.unshift(...s.children),s=i.shift();return t}static getAllChildrenNodes(e,t=e=>[e]){const i=[];if(e.isLeaf)return i.push(...t(e)),i;const s=[...e.children||[]];let o=s.shift();for(;o;)i.push(...t(o)),s.unshift(...o.children),o=s.shift();return i}static getBranchNodes(e){if(e&&!e.isTotals){let t=e.parent;const i=[e];for(;t&&"root"!==t.id;)i.push(t),t=t.parent;return i.reverse()}return[]}static blankNode(){return new Ns({id:"",field:"",value:""})}static rootNode(){return new Ns({id:"root",field:"",value:""})}getHeadLeafChild(){let e=this;for(;!(0,a.isEmpty)(null==e?void 0:e.children);)e=(0,a.head)(null==e?void 0:e.children);return e}getTotalHeightForTreeHierarchy(){return 0===this.height||(0,a.isEmpty)(this.children)?this.height:this.children.reduce((e,t)=>e+t.getTotalHeightForTreeHierarchy(),this.height)}isSeriesNumberNode(){return this.field===ye.r2}clone(){return new Ns(Object.assign({},this))}get isFrozen(){return this.isFrozenHead||this.isFrozenTrailing}}class Bs extends l.YJ{constructor(e){super(),this.isHeaderCellInViewport=({cellPosition:e,cellSize:t,viewportPosition:i,viewportSize:s})=>e+t>=i&&i+s>=e,this.headerConfig=e,this.initGroups()}getHeaderConfig(){return this.headerConfig||{}}render(e){this.clearResizeAreaGroup(e),this.clear(),this.layout(),this.offset(),this.clip()}onScrollXY(e,t,i){this.headerConfig.scrollX===e&&this.headerConfig.scrollY===t||(this.headerConfig.scrollX=e,this.headerConfig.scrollY=t,this.render(i))}onRowScrollX(e,t){this.headerConfig.scrollX!==e&&(this.headerConfig.scrollX=e,this.render(t))}clearResizeAreaGroup(e){if(!e)return;const t=this.parentNode,i=null==t?void 0:t.getElementById(e);null==i||i.destroyChildren()}clear(){var e,t,i;null===(e=this.scrollGroup)||void 0===e||e.destroyChildren(),null===(t=this.frozenGroup)||void 0===t||t.destroyChildren(),null===(i=this.frozenTrailingGroup)||void 0===i||i.destroyChildren()}getNodes(){const{nodes:e}=this.getHeaderConfig();return e||[]}createOrUpdate(e,t){B.x.call(this,e,t)}}class As extends Bs{initGroups(){this.scrollGroup=this.appendChild(new l.YJ({name:h.YJ,style:{zIndex:3}}))}getCellInstance(e){const t=this.getHeaderConfig(),{spreadsheet:i}=t,{cornerCell:s}=i.options;return(null==s?void 0:s(e,i,t))||new ms(e,i,t)}static getCornerHeader(e){const{panelBBox:t,cornerBBox:i,seriesNumberWidth:s,layoutResult:o,spreadsheet:n}=e,{width:r,height:l}=t,{originalWidth:a,originalHeight:d,width:c,height:h}=i,u=this.getCornerNodes({position:{x:i.x,y:i.y},width:a,height:d,layoutResult:o,seriesNumberWidth:s,spreadsheet:n});return new As({nodes:u,position:{x:i.x,y:i.y},width:c,height:h,originalHeight:d,originalWidth:a,viewportWidth:r,viewportHeight:l,seriesNumberWidth:s,spreadsheet:n})}static getTreeCornerText(e){const{rows:t=[]}=e.dataSet.fields,{cornerText:i}=e.options;if(i)return i;const s=e.store.get("drillDownFieldInLevel",[]).map(e=>e.drillField),o=t.filter(e=>!(0,a.includes)(s,e)).map(t=>e.dataSet.getFieldName(t)).join("/");return o||(0,h.Yq)()}static getCornerNodes(e){var t,i,s,o,n;const{position:r,width:l,layoutResult:a,seriesNumberWidth:d,spreadsheet:c}=e,{rowsHierarchy:h,colsHierarchy:u}=a,{rows:p=[],columns:g=[]}=(null===(t=null==c?void 0:c.dataSet)||void 0===t?void 0:t.fields)||{},{colCell:m}=c.options.style,v=[],f=null==u?void 0:u.sampleNodeForLastLevel;if(d){const e=new Ns({id:"",field:"",value:c.getSeriesNumberText()});e.x=null==r?void 0:r.x,e.y=null!==(i=null==f?void 0:f.y)&&void 0!==i?i:0,e.width=d,e.height=null!==(s=null==f?void 0:f.height)&&void 0!==s?s:null==m?void 0:m.height,e.isPivotMode=!0,e.spreadsheet=c,e.cornerType=gs.Q.Series,v.push(e)}if(c.isHierarchyTreeType()){const e=this.getTreeCornerText(c),t=new Ns({id:e,field:"",value:e});t.x=r.x+d,t.y=null!==(o=null==f?void 0:f.y)&&void 0!==o?o:0,t.width=l-d,t.height=null!==(n=null==f?void 0:f.height)&&void 0!==n?n:null==m?void 0:m.height,t.seriesNumberWidth=d,t.isPivotMode=!0,t.spreadsheet=c,t.cornerType=gs.Q.Row,v.push(t)}else{const e=h.sampleNodesForAllLevels||[],t=c.isCustomRowFields();e.forEach(e=>{var i,s,o;const n=t?e.field:p[e.level],r=c.dataSet.getFieldName(n),l=new Ns({id:n,field:n,value:r});l.x=e.x+d,l.y=null!==(i=null==f?void 0:f.y)&&void 0!==i?i:0,l.width=e.width,l.height=null!==(s=null==f?void 0:f.height)&&void 0!==s?s:null===(o=c.facet)||void 0===o?void 0:o.getCellCustomSize(null,null==m?void 0:m.height),l.isPivotMode=!0,l.cornerType=gs.Q.Row,l.spreadsheet=c,v.push(l)})}const C=u.sampleNodesForAllLevels||[],y=c.isCustomColumnFields();return C.forEach(e=>{if(e.level<u.maxLevel){const t=y?e.field:g[e.level],i=c.dataSet.getFieldName(t),s=new Ns({id:t,field:t,value:i});s.x=r.x,s.y=e.y,s.width=l,s.height=e.height,s.isPivotMode=!0,s.cornerType=gs.Q.Col,s.spreadsheet=c,v.push(s)}}),v}onCorScroll(e,t){this.headerConfig.scrollX!==e&&(this.headerConfig.scrollX=e,this.render(t))}layout(){var e,t;const{nodes:i,spreadsheet:s}=this.getHeaderConfig(),o=null===(e=s.options)||void 0===e?void 0:e.cornerHeader;if(o)return void o(this,s,this.headerConfig);const n=(null===(t=s.facet)||void 0===t?void 0:t.getColNodes())||[];i.forEach(e=>{var t;const i=null==n?void 0:n.find(t=>(null==e?void 0:e.y)===(null==t?void 0:t.y)&&(null==e?void 0:e.height)===(null==t?void 0:t.height));e.extra.isCustomHeight=null===(t=null==i?void 0:i.extra)||void 0===t?void 0:t.isCustomHeight;const o=this.getCellInstance(e);this.scrollGroup.appendChild(o),s.emit(m.CORNER_CELL_RENDER,o),s.emit(m.LAYOUT_CELL_RENDER,o)})}offset(){const{position:e,scrollX:t=0}=this.getHeaderConfig();E(this.scrollGroup,e.x-t,e.y)}clip(){const{width:e,height:t,position:i}=this.getHeaderConfig();this.createOrUpdate("scrollGroup.style.clipPath",{x:i.x,y:i.y,width:e,height:t})}}class Ms extends vs{constructor(){super(...arguments),this.cellIdPool=new Set}acquire(){const e=super.acquire();return e&&this.cellIdPool.delete(e.getMeta().id),e}release(e){if(e.getRenderer())return void e.destroy();const t=e.getMeta().id;this.cellIdPool.has(t)||(super.release(e),this.cellIdPool.add(t))}}const Ds=(e,t,i)=>{const s=i.isHierarchyTreeType();return e.getNodes(0).map((e,o)=>{const n=`${o+1}`,r=new Ns({id:n,field:"",rowIndex:o,value:n});return r.x=e.x,r.y=e.y,r.width=t,r.height=s?e.getTotalHeightForTreeHierarchy():e.height,r.isLeaf=!0,r.relatedNode=e,r.spreadsheet=i,r})},Hs=e=>e.reduce((e,t)=>{let i=t.parent;for(;i&&"root"!==i.id;)e.find(e=>e.id===i.id)||e.push(i),i=i.parent;return e},[]),ks=(e,{y:t=0,height:i=0})=>{e.y<t&&(e.height-=t-e.y,e.y=t),e.y+e.height>t+i&&(e.height-=e.y+e.height-t-i)},zs=(e,{y:t=0,height:i=0})=>{e.y+e.height>t+i&&(e.height-=e.y+e.height-t-i),e.y<t&&(e.height-=t-e.y,e.y=t)},Fs=(e,t=0,i=0)=>e.spreadsheet.isFrozenRowHeader()?0:i<=t?i:t,Ps=(e,t)=>{const i=e.frozenGroupAreas[s.TrailingCol],o=i.x+i.width;return t>o?0:o-t},js=(e,t,i)=>{const o=e.frozenGroupAreas[s.TrailingRow],n=o.y+o.height-i;return t>n?i:i+n-t},Ws=(e,t)=>{const i=e.spreadsheet.isFrozenRowHeader(),o=e.frozenGroupAreas,n=o[s.Col].width,r=o[s.TrailingCol].width;let l;l=i?t.x+n:n?T.getVerticalBorderWidth(e.spreadsheet)+n:0;const a=e.panelBBox.viewportWidth;return{x:l,width:(i?a:t.x+a)-n-r}};class Gs extends Bs{constructor(){super(...arguments),this.rowCellPool=new Ms}initGroups(){this.scrollGroup=this.appendChild(new l.YJ({name:h.VC,style:{zIndex:3}})),this.frozenGroup=this.appendChild(new l.YJ({name:h.YC,style:{zIndex:4}})),this.frozenTrailingGroup=this.appendChild(new l.YJ({name:h.x1,style:{zIndex:4}}));const{spreadsheet:e}=this.getHeaderConfig();this.extraFrozenNodes=(e=>{const t=[],{start:i,end:o}=e.getCellRange(),{rowCount:n,trailingRowCount:r}=e.getFrozenOptions();if(n){const o=e.getRowLeafNodesByRange(i,i+n-1);o.forEach(e=>{const i=e.clone();i.isFrozenHead=!0,t.push(i)}),Hs(o).forEach(i=>{const o=i.clone();o.isFrozenHead=!0,ks(o,e.frozenGroupAreas[s.Row]),t.push(o)})}if(r){const i=e.getRowLeafNodesByRange(o-r+1,o);i.forEach(e=>{const i=e.clone();i.isFrozenTrailing=!0,t.push(i)}),Hs(i).forEach(i=>{const o=i.clone();o.isFrozenTrailing=!0,zs(o,e.frozenGroupAreas[s.TrailingRow]),t.push(o)})}return t})(e.facet)}getCellInstance(e){var t;if(this.rowCellPool.pool.length>0&&(null===(t=this.headerConfig.spreadsheet.options.future)||void 0===t?void 0:t.experimentalReuseCell)){const t=this.rowCellPool.acquire();return t.reInitCell(e,this.headerConfig),t}const i=this.getHeaderConfig(),{spreadsheet:s}=i,{rowCell:o}=s.options;return(null==o?void 0:o(e,s,i))||new ds(e,s,i)}isCellInRect(e){const{width:t,viewportHeight:i,position:o,scrollY:n=0,scrollX:r=0,spreadsheet:l}=this.getHeaderConfig(),a=l.facet.frozenGroupAreas;return i+n-a[s.TrailingRow].height>e.y&&n+a[s.Row].height<e.y+e.height&&t+r-o.x>e.x&&r-o.x<e.x+e.width}getCellGroup(e){return e.isFrozenHead?this.frozenGroup:e.isFrozenTrailing?this.frozenTrailingGroup:this.scrollGroup}layout(){const{nodes:e}=this.getHeaderConfig(),t=e=>{var t;const i=this.getCellGroup(e);let s;(null===(t=e.belongsCell)||void 0===t?void 0:t.parentNode)===i&&e.belongsCell.getMeta()===e?(s=e.belongsCell,s.setHeaderConfig(this.headerConfig),s.updateTextPosition()):(s=this.getCellInstance(e),e.belongsCell=s,s.parentElement!==i&&(null==i||i.appendChild(s))),this.emitRenderEvent(s)};(0,a.each)(e,e=>{this.isCellInRect(e)&&0!==e.height&&t(e)}),(0,a.each)(this.extraFrozenNodes,e=>{0!==e.height&&t(e)})}emitRenderEvent(e){const{spreadsheet:t}=this.getHeaderConfig();t.emit(m.ROW_CELL_RENDER,e),t.emit(m.LAYOUT_CELL_RENDER,e)}offset(){const{scrollX:e=0,scrollY:t=0,position:i,spreadsheet:s,viewportHeight:o}=this.getHeaderConfig(),n=i.x-e,r=s.facet.getPaginationScrollY(),l=js(s.facet,o,r);E(this.scrollGroup,n,i.y-t),E(this.frozenGroup,n,i.y-r),E(this.frozenTrailingGroup,n,i.y-l)}clip(){const{width:e,viewportHeight:t,position:i,spreadsheet:o}=this.getHeaderConfig(),n=o.facet.frozenGroupAreas,r=n[s.Row].height,l=n[s.TrailingRow].height;this.createOrUpdate("scrollGroup.style.clipPath",{x:o.facet.cornerBBox.x,y:i.y+r,width:e,height:t-r-l}),this.createOrUpdate("frozenGroup.style.clipPath",{x:o.facet.cornerBBox.x,y:i.y,width:e,height:r}),this.createOrUpdate("frozenTrailingGroup.style.clipPath",{x:o.facet.cornerBBox.x,y:i.y+t-l,width:e,height:l})}clear(){var e;(null===(e=this.headerConfig.spreadsheet.options.future)||void 0===e?void 0:e.experimentalReuseCell)?this.scrollGroup.childNodes.forEach(e=>{this.isCellInRect(e.getMeta())||(e.getMeta().belongsCell=null,this.rowCellPool.release(e))}):super.clear()}}class Vs extends vs{constructor(){super(...arguments),this.cellIdPool=new Set}acquire(){const e=super.acquire();return e&&this.cellIdPool.delete(e.getMeta().id),e}release(e){if(e.getRenderer())return void e.destroy();const t=e.getMeta().id;this.cellIdPool.has(t)||(super.release(e),this.cellIdPool.add(t))}}class $s extends Bs{constructor(){super(...arguments),this.colCellPool=new Vs}initGroups(){this.scrollGroup=this.appendChild(new l.YJ({name:h.Do,style:{zIndex:3}})),this.frozenGroup=this.appendChild(new l.YJ({name:h.gN,style:{zIndex:4}})),this.frozenTrailingGroup=this.appendChild(new l.YJ({name:h.FS,style:{zIndex:4}})),this.extraFrozenNodes=(e=>{const t=[],{colCount:i,trailingColCount:o}=e.getFrozenOptions();if(i){const{x:o,width:n}=e.frozenGroupAreas[s.Col],r=e.getColLeafNodesByRange(0,i-1);r.forEach(e=>{const i=e.clone();i.isFrozenHead=!0,t.push(i)}),Hs(r).forEach(e=>{const i=e.clone();i.isFrozenHead=!0,i.x<o&&(i.width-=o-i.x,i.x=o),i.x+i.width>o+n&&(i.width-=i.x+i.width-o-n),t.push(i)})}if(o){const{x:i,width:n}=e.frozenGroupAreas[s.TrailingCol],r=e.getColLeafNodes().length,l=e.getColLeafNodesByRange(r-o,r-1);l.forEach(e=>{const i=e.clone();i.isFrozenTrailing=!0,t.push(i)}),Hs(l).forEach(e=>{const s=e.clone();s.isFrozenTrailing=!0,s.x+s.width>i+n&&(s.width-=s.x+s.width-i-n),s.x<i&&(s.width-=i-s.x,s.x=i),t.push(s)})}return t})(this.headerConfig.spreadsheet.facet)}getCellGroup(e){return e.isFrozenHead?this.frozenGroup:e.isFrozenTrailing?this.frozenTrailingGroup:this.scrollGroup}getCellInstance(e){var t;if(this.colCellPool.pool.length>0&&(null===(t=this.headerConfig.spreadsheet.options.future)||void 0===t?void 0:t.experimentalReuseCell)){const t=this.colCellPool.acquire();return t.reInitCell(e,this.getHeaderConfig()),t}const i=this.getHeaderConfig(),{spreadsheet:s}=this.getHeaderConfig(),{colCell:o}=s.options;return(null==o?void 0:o(e,s,i))||new Ti(e,s,i)}appendNode(e){var t;const{spreadsheet:i}=this.getHeaderConfig(),s=this.getCellGroup(e);let o;(null===(t=e.belongsCell)||void 0===t?void 0:t.parentNode)===s&&e.belongsCell.getMeta()===e?(o=e.belongsCell,o.setHeaderConfig(this.headerConfig)):(o=this.getCellInstance(e),e.belongsCell=o,o.parentElement!==s&&(null==s||s.appendChild(o))),i.emit(m.COL_CELL_RENDER,o),i.emit(m.LAYOUT_CELL_RENDER,o)}layout(){const{nodes:e}=this.getHeaderConfig();(0,a.each)(e,e=>{this.isColCellInRect(e)&&this.appendNode(e)}),(0,a.each)(this.extraFrozenNodes,e=>{this.appendNode(e)})}onColScroll(e,t){this.headerConfig.scrollX!==e&&(this.headerConfig.scrollX=e,this.render(t))}clip(){const{height:e,spreadsheet:t,position:i,viewportWidth:o,cornerWidth:n=0,scrollX:r=0}=this.getHeaderConfig(),l=t.facet,a=l.frozenGroupAreas,d=a[s.Col].width,c=a[s.TrailingCol].width,{x:h,width:u}=Ws(l,i);this.createOrUpdate("scrollGroup.style.clipPath",{x:h,y:i.y,width:u,height:e}),this.createOrUpdate("frozenGroup.style.clipPath",{x:i.x-Fs(l,n,r),y:i.y,width:d,height:e}),this.createOrUpdate("frozenTrailingGroup.style.clipPath",{x:i.x+o-c,y:i.y,width:c,height:e})}isColCellInRect(e){const{spreadsheet:t,cornerWidth:i=0,viewportWidth:o,scrollX:n=0,position:r}=this.getHeaderConfig(),l=t.facet.frozenGroupAreas;let a;const d=l[s.Col].width,c=l[s.TrailingCol].width;return a=t.isFrozenRowHeader()?d:d?d-i:-r.x,o-c>=e.x-n&&a<=e.x+e.width-n}offset(){const{viewportWidth:e,scrollX:t=0,position:i,spreadsheet:s,cornerWidth:o}=this.getHeaderConfig();E(this.scrollGroup,i.x-t,i.y);const n=s.facet,r=Fs(n,o,t),l=Ps(n,e);E(this.frozenGroup,i.x-r,i.y),E(this.frozenTrailingGroup,i.x-l,i.y)}clear(){var e;(null===(e=this.headerConfig.spreadsheet.options.future)||void 0===e?void 0:e.experimentalReuseCell)?this.scrollGroup.childNodes.forEach(e=>{this.isColCellInRect(e.getMeta())||(e.getMeta().belongsCell=null,this.colCellPool.release(e))}):super.clear()}clearResizeAreaGroup(e){var t;(null===(t=this.headerConfig.spreadsheet.options.future)||void 0===t?void 0:t.experimentalReuseCell)||super.clearResizeAreaGroup(e)}}class Us extends ds{get cellType(){return d.vZ.ROW_CELL}getBorderPositions(){return[v.cV.LEFT,v.cV.BOTTOM]}initCell(){this.drawBackgroundShape(),this.drawInteractiveBgShape(),this.drawInteractiveBorderShape(),this.drawBorders(),this.drawTextShape(),this.update()}getBackgroundColor(){const{backgroundColor:e,backgroundColorOpacity:t}=this.getCrossBackgroundColor(this.meta.rowIndex);return{backgroundColor:e,backgroundColorOpacity:t,intelligentReverseTextColor:!1}}getTextStyle(){var e;const t=this.getCellTextWordWrapStyle(d.vZ.SERIES_NUMBER_CELL),i=null===(e=this.getStyle())||void 0===e?void 0:e.seriesText;return Object.assign(Object.assign({},t),i)}getFormattedFieldValue(){var e;const{value:t,field:i}=this.meta,s=this.spreadsheet.dataSet.getFieldFormatter(i);return{value:t,formattedValue:null!==(e=null==s?void 0:s(t,void 0,this.meta))&&void 0!==e?e:t}}getMaxTextWidth(){const{width:e}=this.getBBoxByType(v.Ok.CONTENT_BOX);return e}isBolderText(){return!1}findFieldCondition(){}mappingValue(){}getIconPosition(){return{x:0,y:0}}}class Ys extends Gs{static getSeriesNumberHeader(e){var t,i;const{panelBBox:s,seriesNumberWidth:o,rowsHierarchy:n,spreadsheet:r,cornerWidth:l}=e,{height:a,viewportHeight:d}=s,c=null!==(i=null===(t=r.options)||void 0===t?void 0:t.layoutSeriesNumberNodes)&&void 0!==i?i:Ds;return new Ys({width:l,height:a,viewportWidth:l,viewportHeight:d,position:{x:0,y:s.y},nodes:c(n,o,r),spreadsheet:r})}initGroups(){this.scrollGroup=this.appendChild(new l.YJ({name:h.wH,style:{zIndex:3}})),this.frozenGroup=this.appendChild(new l.YJ({name:h.Zv,style:{zIndex:4}})),this.frozenTrailingGroup=this.appendChild(new l.YJ({name:h.G8,style:{zIndex:4}}));const{spreadsheet:e,nodes:t}=this.getHeaderConfig();this.extraFrozenNodes=((e,t)=>{const i=[],{start:o,end:n}=e.getCellRange(),{rowCount:r,trailingRowCount:l}=e.getFrozenOptions(),d=(e,t)=>{var i;const s=e.rowIndex;if((0,a.isNumber)(s)&&s>=t[0]&&s<=t[1])return!0;const o=null!==(i=e.children)&&void 0!==i?i:[];for(let e=0;e<o.length;e++)if(d(o[e],t))return!0;return!1};if(r){const n=[o,o+r-1];t.forEach(t=>{if(t.relatedNode&&!d(t.relatedNode,n))return;const o=t.clone();o.isFrozenHead=!0,ks(o,e.frozenGroupAreas[s.Row]),i.push(o)})}if(l){const o=[n-l+1,n];t.forEach(t=>{if(t.relatedNode&&!d(t.relatedNode,o))return;const n=t.clone();n.isFrozenTrailing=!0,zs(n,e.frozenGroupAreas[s.TrailingRow]),i.push(n)})}return i})(e.facet,t)}getCellInstance(e){const t=this.getHeaderConfig(),{spreadsheet:i}=t,{seriesNumberCell:s}=i.options;return(null==s?void 0:s(e,i,t))||new Us(e,i,t)}emitRenderEvent(e){const{spreadsheet:t}=this.getHeaderConfig();t.emit(m.SERIES_NUMBER_CELL_RENDER,e),t.emit(m.LAYOUT_CELL_RENDER,e)}}var Xs=i("./node_modules/.pnpm/@antv+event-emitter@0.1.3/node_modules/@antv/event-emitter/esm/index.js"),Zs=i("./node_modules/.pnpm/d3-ease@3.0.1/node_modules/d3-ease/src/cubic.js");const qs=()=>{var e;return null!==(e=null===performance||void 0===performance?void 0:performance.now())&&void 0!==e?e:Date.now()},Ks=e=>{var t;const i=e.nativeEvent;return(null===(t=null==i?void 0:i.touches)||void 0===t?void 0:t.length)>=2};class Js extends Xs.A{constructor(e,t){super(),this.bindPointerDown=e=>{Ks(e)||(window.cancelAnimationFrame(this.raf),this.panning=!0,this.preX=e.x,this.preY=e.y,this.speedX=0,this.speedY=0,this.lastMoveMS=qs())},this.bindPointerMove=e=>{var t,i,s,o;if(Ks(e))return this.panning=!1,void window.cancelAnimationFrame(this.raf);if(this.panning){const n=e.nativeEvent,r=qs(),l=r-this.lastMoveMS,a=this.preX-e.x,d=this.preY-e.y;if(null==n?void 0:n.cancelable){(null===(i=null===(t=this.shouldPreventDefault)||void 0===t?void 0:t.call(this,a,d,e.x,e.y))||void 0===i||i)&&(null===(o=(s=n).preventDefault)||void 0===o||o.call(s))}this.speedX=a/l,this.speedY=d/l,this.preX=e.x,this.preY=e.y,this.lastMoveMS=r,this.emit("wheel",Object.assign(Object.assign({},e.clone()),{x:e.x,y:e.y,deltaX:a,deltaY:d,nativeEvent:n}))}},this.bindPointerUp=e=>{this.panning=!1;const t=qs();if(!this.speedX||!this.speedY||t-this.lastMoveMS>=100)return;const i=()=>{const s=qs();this.raf=window.requestAnimationFrame(()=>{const o=qs(),n=(o-t)/800;if(n<1){const t=(0,Zs.EY)(1-n),r=o-s;this.emit("wheel",Object.assign(Object.assign({},e.clone()),{x:e.x,y:e.y,deltaX:this.speedX*t*r,deltaY:this.speedY*t*r})),i()}})};i()},this.canvas=e,this.panning=!1,this.shouldPreventDefault=t,this.init()}init(){this.canvas.addEventListener(ps.POINTER_DOWN,this.bindPointerDown),this.canvas.addEventListener(ps.POINTER_MOVE,this.bindPointerMove),this.canvas.addEventListener(ps.POINTER_UP,this.bindPointerUp)}destroy(){this.canvas.removeEventListener(ps.POINTER_DOWN,this.bindPointerDown),this.canvas.removeEventListener(ps.POINTER_MOVE,this.bindPointerMove),this.canvas.removeEventListener(ps.POINTER_UP,this.bindPointerUp)}}class Qs{get scrollBarTheme(){return this.spreadsheet.theme.scrollBar}get scrollBarSize(){var e;return null===(e=this.scrollBarTheme)||void 0===e?void 0:e.size}constructor(e){this.scrollFrameId=null,this.getLayoutResult=()=>Object.assign(Object.assign({},this.layoutResult),{cornerNodes:this.getCornerNodes(),seriesNumberNodes:this.getSeriesNumberNodes()}),this.hideScrollBar=()=>{var e,t,i;null===(e=this.hRowScrollBar)||void 0===e||e.setAttribute("visibility","hidden"),null===(t=this.hScrollBar)||void 0===t||t.setAttribute("visibility","hidden"),null===(i=this.vScrollBar)||void 0===i||i.setAttribute("visibility","hidden")},this.delayHideScrollBar=(0,a.debounce)(this.hideScrollBar,1e3),this.delayHideScrollbarOnMobile=()=>{me()&&this.delayHideScrollBar()},this.showVerticalScrollBar=()=>{var e;null===(e=this.vScrollBar)||void 0===e||e.setAttribute("visibility","visible")},this.showHorizontalScrollBar=()=>{var e,t;null===(e=this.hRowScrollBar)||void 0===e||e.setAttribute("visibility","visible"),null===(t=this.hScrollBar)||void 0===t||t.setAttribute("visibility","visible")},this.onContainerWheelForMobileCompatibility=()=>{const e=this.spreadsheet.getCanvasElement();let t,i;e.addEventListener("touchstart",e=>{t=e.touches[0].clientY,this.scrollDirection=void 0}),e.addEventListener("touchend",e=>{i=e.changedTouches[0].clientY,i<t?this.scrollDirection=d.Dh.SCROLL_UP:i>t&&(this.scrollDirection=d.Dh.SCROLL_DOWN)})},this.onContainerWheel=()=>{me()?this.onContainerWheelForMobile():this.onContainerWheelForPc()},this.getMobileWheelDeltaY=e=>this.scrollDirection===d.Dh.SCROLL_UP?Math.max(0,e):this.scrollDirection===d.Dh.SCROLL_DOWN?Math.min(0,e):e,this.onContainerWheelForPc=()=>{const e=this.spreadsheet.getCanvasElement();null==e||e.addEventListener("wheel",this.onWheel)},this.onContainerWheelForMobile=()=>{this.mobileWheel=new Js(this.spreadsheet.container,(e,t,i,s)=>{const{interaction:o}=this.spreadsheet.options;if("auto"!==(null==o?void 0:o.overscrollBehavior))return!0;return this.isScrollOverTheViewport({deltaX:e,deltaY:t,offsetX:i,offsetY:s})}),this.mobileWheel.on("wheel",e=>{this.spreadsheet.hideTooltip();const t=e.originalEvent,{deltaX:i,deltaY:s,x:o,y:n,nativeEvent:r}=e,l=this.getMobileWheelDeltaY(s);this.onWheel(Object.assign(Object.assign({},t),{deltaX:i,deltaY:l,offsetX:o,offsetY:n,__nativeEvent__:r}))}),this.onContainerWheelForMobileCompatibility()},this.bindEvents=()=>{this.onContainerWheel(),this.emitPaginationEvent()},this.setScrollOffset=e=>{Object.keys(e||{}).forEach(t=>{const i=(0,a.get)(e,t);(0,a.isUndefined)(i)||this.spreadsheet.store.set(t,C(i))})},this.getScrollOffset=()=>{const{store:e}=this.spreadsheet;return{scrollX:e.get("scrollX",0),scrollY:e.get("scrollY",0),rowHeaderScrollX:e.get("rowHeaderScrollX",0)}},this.resetScrollX=()=>{this.setScrollOffset({scrollX:0})},this.resetRowScrollX=()=>{this.setScrollOffset({rowHeaderScrollX:0})},this.resetScrollY=()=>{this.setScrollOffset({scrollY:0})},this.resetScrollOffset=()=>{this.setScrollOffset({scrollX:0,scrollY:0,rowHeaderScrollX:0})},this.emitPaginationEvent=()=>{const{pagination:e}=this.spreadsheet.options;if(e){const{current:t=1,pageSize:i}=e,s=this.viewCellHeights.getTotalLength(),o=C((s-1)/i)+1;this.spreadsheet.emit(m.LAYOUT_PAGINATION,{pageSize:i,pageCount:o,total:s,current:t})}},this.unbindEvents=()=>{var e;const t=this.spreadsheet.getCanvasElement();null==t||t.removeEventListener("wheel",this.onWheel),null===(e=this.mobileWheel)||void 0===e||e.destroy()},this.calculateCellWidthHeight=()=>{const{colLeafNodes:e}=this.layoutResult,t=(0,a.reduce)(e,(e,t)=>{const i=(0,a.last)(e)||0;return e.push(i+t.width),e},[0]);this.viewCellWidths=t,this.viewCellHeights=this.getViewCellHeights()},this.getRealScrollX=(e,t=0)=>this.spreadsheet.isFrozenRowHeader()?t:e,this.getRealWidth=()=>(0,a.last)(this.viewCellWidths)||0,this.getRealHeight=()=>{const{pagination:e}=this.spreadsheet.options,t=this.viewCellHeights;if(e){const{start:e,end:i}=this.getCellRange();return t.getCellOffsetY(i+1)-t.getCellOffsetY(e)}return t.getTotalHeight()},this.scrollWithAnimation=(e={},t=200,i)=>{var s,o,n,r;const{scrollX:l,scrollY:a,rowHeaderScrollX:d}=this.getAdjustedScrollOffset({scrollX:(null===(s=e.offsetX)||void 0===s?void 0:s.value)||0,scrollY:(null===(o=e.offsetY)||void 0===o?void 0:o.value)||0,rowHeaderScrollX:(null===(n=e.rowHeaderOffsetX)||void 0===n?void 0:n.value)||0});null===(r=this.timer)||void 0===r||r.stop();const c=this.getScrollOffset(),h=[null!=l?l:c.scrollX,null!=a?a:c.scrollY,null!=d?d:c.rowHeaderScrollX],u=(0,ls.A)(Object.values(c),h);this.timer=(0,as.O1)(s=>{try{const o=Math.min(s/t,1),[n,r,l]=u(o);this.setScrollOffset({rowHeaderScrollX:l,scrollX:n,scrollY:r}),this.startScroll(null==e?void 0:e.skipScrollEvent),s>t&&(this.timer.stop(),null==i||i())}catch(e){console.error(e),this.timer.stop()}})},this.scrollImmediately=(e={})=>{var t,i,s;const{scrollX:o,scrollY:n,rowHeaderScrollX:r}=this.getAdjustedScrollOffset({scrollX:(null===(t=e.offsetX)||void 0===t?void 0:t.value)||0,scrollY:(null===(i=e.offsetY)||void 0===i?void 0:i.value)||0,rowHeaderScrollX:(null===(s=e.rowHeaderOffsetX)||void 0===s?void 0:s.value)||0});this.setScrollOffset({scrollX:o,scrollY:n,rowHeaderScrollX:r}),this.startScroll(null==e?void 0:e.skipScrollEvent)},this.startScroll=(e=!1)=>{var t,i,s;const{rowHeaderScrollX:o,scrollX:n,scrollY:r}=this.getScrollOffset();null===(t=this.hRowScrollBar)||void 0===t||t.onlyUpdateThumbOffset(this.getScrollBarOffset(o,this.hRowScrollBar)),null===(i=this.hScrollBar)||void 0===i||i.onlyUpdateThumbOffset(this.getScrollBarOffset(n,this.hScrollBar)),null===(s=this.vScrollBar)||void 0===s||s.onlyUpdateThumbOffset(this.getScrollBarOffset(r,this.vScrollBar)),this.dynamicRenderCell(e)},this.getRendererHeight=()=>{const{start:e,end:t}=this.getCellRange();return this.viewCellHeights.getCellOffsetY(t+1)-this.viewCellHeights.getCellOffsetY(e)},this.getAdjustedScrollOffset=({scrollX:e,scrollY:t,rowHeaderScrollX:i})=>({scrollX:Qi(e,this.layoutResult.colsHierarchy.width,this.panelBBox.width),scrollY:Qi(t,this.getRendererHeight(),this.panelBBox.height),rowHeaderScrollX:Ji(i,this.cornerBBox)}),this.getScrollBarOffset=(e,t)=>{const{trackLen:i,thumbLen:s,scrollTargetMaxOffset:o}=t;return e*(i-s)/o},this.isScrollOverThePanelArea=({offsetX:e,offsetY:t})=>e>this.panelBBox.minX&&e<this.panelBBox.maxX&&t>this.panelBBox.minY&&t<this.panelBBox.maxY,this.isScrollOverTheCornerArea=({offsetX:e,offsetY:t})=>e>this.cornerBBox.minX&&e<this.cornerBBox.maxX&&t>this.cornerBBox.minY&&t<this.cornerBBox.maxY+this.panelBBox.height,this.updateHorizontalRowScrollOffset=({offset:e,offsetX:t,offsetY:i})=>{var s;this.isScrollOverTheCornerArea({offsetX:t,offsetY:i})&&(null===(s=this.hRowScrollBar)||void 0===s||s.emitScrollChange(e))},this.updateHorizontalScrollOffset=({offset:e,offsetX:t,offsetY:i})=>{var s;this.hRowScrollBar&&!this.isScrollOverThePanelArea({offsetX:t,offsetY:i})||null===(s=this.hScrollBar)||void 0===s||s.emitScrollChange(e)},this.isScrollToLeft=({deltaX:e,offsetX:t,offsetY:i})=>{if(!this.hScrollBar&&!this.hRowScrollBar)return!0;const s=!this.hRowScrollBar||this.isScrollOverThePanelArea({offsetY:i,offsetX:t})||this.hRowScrollBar.thumbOffset<=0;return e<=0&&(!this.hScrollBar||this.hScrollBar.thumbOffset<=0)&&s},this.isScrollToRight=({deltaX:e,offsetX:t,offsetY:i})=>{var s,o,n,r,l,a;if(!this.hScrollBar&&!this.hRowScrollBar)return!0;const d=this.spreadsheet.isFrozenRowHeader()?null===(s=this.panelBBox)||void 0===s?void 0:s.width:null===(o=this.panelBBox)||void 0===o?void 0:o.maxX,c=!this.hRowScrollBar||this.isScrollOverThePanelArea({offsetY:i,offsetX:t})||(null===(n=this.hRowScrollBar)||void 0===n?void 0:n.thumbOffset)+(null===(r=this.hRowScrollBar)||void 0===r?void 0:r.thumbLen)>=this.cornerBBox.width,h=this.hRowScrollBar&&this.isScrollOverTheCornerArea({offsetX:t,offsetY:i})||(null===(l=this.hScrollBar)||void 0===l?void 0:l.thumbOffset)+(null===(a=this.hScrollBar)||void 0===a?void 0:a.thumbLen)>=d;return e>=0&&h&&c},this.isScrollToTop=e=>{var t;return!this.vScrollBar||e<=0&&(null===(t=this.vScrollBar)||void 0===t?void 0:t.thumbOffset)<=0},this.isScrollToBottom=e=>{var t,i,s;return!this.vScrollBar||e>=0&&(null===(t=this.vScrollBar)||void 0===t?void 0:t.thumbOffset)+(null===(i=this.vScrollBar)||void 0===i?void 0:i.thumbLen)>=(null===(s=this.panelBBox)||void 0===s?void 0:s.height)},this.isVerticalScrollOverTheViewport=e=>!this.isScrollToTop(e)&&!this.isScrollToBottom(e),this.isHorizontalScrollOverTheViewport=e=>!this.isScrollToLeft(e)&&!this.isScrollToRight(e),this.isScrollOverTheViewport=e=>{const{deltaY:t,deltaX:i,offsetY:s}=e;return!(s<=this.cornerBBox.maxY)&&(0!==t?this.isVerticalScrollOverTheViewport(t):0!==i&&this.isHorizontalScrollOverTheViewport(e))},this.cancelScrollFrame=()=>(!me()||!this.scrollFrameId)&&(cancelAnimationFrame(this.scrollFrameId),!0),this.clearScrollFrameIdOnMobile=()=>{me()&&(this.scrollFrameId=null)},this.stopScrollChainingIfNeeded=e=>{const{interaction:t}=this.spreadsheet.options;"auto"!==(null==t?void 0:t.overscrollBehavior)&&(this.cancelScrollFrame(),this.stopScrollChaining(e))},this.stopScrollChaining=e=>{var t,i;const s=(null==e?void 0:e.__nativeEvent__)||(null==e?void 0:e.nativeEvent);(null==s?void 0:s.cancelable)&&(null===(t=null==s?void 0:s.preventDefault)||void 0===t||t.call(s)),(null==e?void 0:e.cancelable)&&(null===(i=null==e?void 0:e.preventDefault)||void 0===i||i.call(e))},this.onWheel=e=>{const{interaction:t}=this.spreadsheet.options;let{deltaX:i,deltaY:s,offsetX:o,offsetY:n}=e;const{scrollX:r,rowHeaderScrollX:l}=this.getScrollOffset(),{shiftKey:a}=e;a&&ve()&&(o=o-i+s,i=s,n-=s,s=0);const[c,h]=((e,t,i)=>{const s=Math.abs(e/t);return[(s<=.5?0:e)*i.horizontal,(s>2?0:t)*i.vertical]})(i,s,null==t?void 0:t.scrollSpeedRatio);if(this.spreadsheet.hideTooltip(),this.spreadsheet.interaction.clearHoverTimer(),this.isScrollOverTheViewport({deltaX:c,deltaY:h,offsetX:o,offsetY:n})){if(this.stopScrollChaining(e),this.spreadsheet.interaction.addIntercepts([d.fR.HOVER]),this.cancelScrollFrame()){if(0!==c&&void 0!==this.scrollDirection&&this.scrollDirection!==(c>0?d.Dh.SCROLL_LEFT:d.Dh.SCROLL_RIGHT))return this.scrollDirection=c>0?d.Dh.SCROLL_LEFT:d.Dh.SCROLL_RIGHT,this.updateHorizontalRowScrollOffset({offsetX:o,offsetY:n,offset:l}),void this.updateHorizontalScrollOffset({offsetX:o,offsetY:n,offset:r});this.scrollDirection=i>0?d.Dh.SCROLL_LEFT:d.Dh.SCROLL_RIGHT,this.scrollFrameId=requestAnimationFrame(()=>{var e;const{scrollX:t,scrollY:i,rowHeaderScrollX:s}=this.getScrollOffset();0!==c&&(this.showHorizontalScrollBar(),this.updateHorizontalRowScrollOffset({offsetX:o,offsetY:n,offset:c+s}),this.updateHorizontalScrollOffset({offsetX:o,offsetY:n,offset:c+t})),0!==h&&(this.showVerticalScrollBar(),null===(e=this.vScrollBar)||void 0===e||e.emitScrollChange(h+i)),this.delayHideScrollbarOnMobile(),this.clearScrollFrameIdOnMobile()})}}else this.stopScrollChainingIfNeeded(e)},this.realDataCellRender=(e,t)=>{const i=this.calculateXYIndexes(e,t);Zi.U.getInstance().logger("realDataCellRender:",this.preCellIndexes,i);const{add:s,remove:o}=Rs(this.preCellIndexes,i);Zi.U.getInstance().debugCallback(Zi.v7,()=>{var e;if(null===(e=this.spreadsheet.options.future)||void 0===e?void 0:e.experimentalReuseCell){const e=this.getDataCells(),t=Math.max(o.length,s.length);for(let i=0;i<t;i++){if(i<o.length){const[t,s]=o[i],n=(0,a.find)(e,e=>e.name===`${s}-${t}`);n&&this.dataCellPool.release(n)}if(i<s.length){const[e,t]=s[i],o=this.getCellMeta(t,e),n=this.createDataCell(o);n&&this.addDataCell(n)}}Zi.U.getInstance().logger(`Render Cell Panel: ${null==e?void 0:e.length}, Add: ${null==s?void 0:s.length}, Remove: ${null==o?void 0:o.length}`)}else{(0,a.each)(s,([e,t])=>{const i=this.getCellMeta(t,e),s=this.createDataCell(i);s&&this.addDataCell(s)});const e=this.getDataCells();(0,a.each)(o,([t,i])=>{const s=(0,a.find)(e,e=>e.name===`${i}-${t}`);null==s||s.destroy()}),Zi.U.getInstance().logger(`Render Cell Panel: ${null==e?void 0:e.length}, Add: ${null==s?void 0:s.length}, Remove: ${null==o?void 0:o.length}`)}}),this.preCellIndexes=i,this.spreadsheet.emit(m.LAYOUT_AFTER_REAL_DATA_CELL_RENDER,{add:s,remove:o,spreadsheet:this.spreadsheet})},this.getGridInfo=()=>{const[e,t,i,s]=this.preCellIndexes.center;return{cols:ns(e,t,this.layoutResult.colLeafNodes),rows:rs(i,s,this.viewCellHeights)}},this.onAfterScroll=(0,a.debounce)(()=>{const{interaction:e,container:t}=this.spreadsheet;if(!e.isSelectedState()&&(e.removeIntercepts([d.fR.HOVER]),e.getHoverAfterScroll())){const i=e.eventController.canvasMousemoveEvent;if(i){const{x:e,y:s}=i,o=t.document.elementFromPointSync(e,s);o&&t.emit(ps.POINTER_MOVE,Object.assign(Object.assign({},i),{shape:o,target:o,timestamp:performance.now()}))}}},300),this.getCellChildrenNodes=e=>{var t;const i=null===(t=null==e?void 0:e.getMeta)||void 0===t?void 0:t.call(e),s=(null==e?void 0:e.cellType)===d.vZ.ROW_CELL;return this.spreadsheet.isHierarchyTreeType()&&s?Ns.getAllLeaveNodes(i).filter(e=>e.rowIndex===i.rowIndex):Ns.getAllChildrenNodes(i)},this.spreadsheet=e,this.init()}shouldRender(){return!((0,a.isEmpty)((e=this.spreadsheet.dataCfg.fields).rows)&&(0,a.isEmpty)(e.columns)&&(0,a.isEmpty)(e.values));var e}initTextWrapTemp(){var e;const t=[{},this.spreadsheet,{shallowRender:!0}];this.textWrapTempRowCell=this.getRowCellInstance(...t),this.textWrapTempColCell=this.getColCellInstance(...t),this.textWrapTempCornerCell=null===(e=this.getCornerCellInstance)||void 0===e?void 0:e.call(this,...t),this.textWrapNodeHeightCache=(0,Q.A)(500),this.customRowHeightStatusMap={}}initGroups(){this.initBackgroundGroup(),this.initPanelGroups(),this.initForegroundGroup()}initForegroundGroup(){this.foregroundGroup=this.spreadsheet.container.appendChild(new l.YJ({name:h.xB,style:{zIndex:3}}))}initBackgroundGroup(){this.backgroundGroup=this.spreadsheet.container.appendChild(new l.YJ({name:h.Oe,style:{zIndex:0}}))}initPanelGroups(){this.panelGroup=this.spreadsheet.container.appendChild(new l.YJ({name:h.Z0,style:{zIndex:1}})),this.panelScrollGroup=new bs({name:h.vO,zIndex:1,s2:this.spreadsheet}),this.panelGroup.appendChild(this.panelScrollGroup)}getCellCustomSize(e,t){return(0,a.isFunction)(t)?t(e):t}getRowCellDraggedWidth(e){var t,i,s;const{rowCell:o}=this.spreadsheet.options.style;return null!==(i=null===(t=null==o?void 0:o.widthByField)||void 0===t?void 0:t[null==e?void 0:e.id])&&void 0!==i?i:null===(s=null==o?void 0:o.widthByField)||void 0===s?void 0:s[null==e?void 0:e.field]}getRowCellDraggedHeight(e){var t,i,s;const{rowCell:o}=this.spreadsheet.options.style;return null!==(i=null===(t=null==o?void 0:o.heightByField)||void 0===t?void 0:t[null==e?void 0:e.id])&&void 0!==i?i:null===(s=null==o?void 0:o.heightByField)||void 0===s?void 0:s[null==e?void 0:e.field]}isCustomRowCellHeight(e){var t;const{dataCell:i}=this.spreadsheet.options.style,s=null===(t=Ui.dataCell)||void 0===t?void 0:t.height;return(0,a.isNumber)(this.getCustomRowCellHeight(e))||(null==i?void 0:i.height)!==s}getCustomRowCellHeight(e){var t;const{rowCell:i}=this.spreadsheet.options.style;return null!==(t=this.getRowCellDraggedHeight(e))&&void 0!==t?t:this.getCellCustomSize(e,null==i?void 0:i.height)}getRowCellHeight(e){var t;const{dataCell:i}=this.spreadsheet.options.style;return null!==(t=this.getCustomRowCellHeight(e))&&void 0!==t?t:null==i?void 0:i.height}getColCellDraggedWidth(e){var t,i,s,o,n,r;const{colCell:l}=this.spreadsheet.options.style;return null!==(o=null!==(i=null===(t=null==l?void 0:l.widthByField)||void 0===t?void 0:t[null==e?void 0:e.id])&&void 0!==i?i:null===(s=null==l?void 0:l.widthByField)||void 0===s?void 0:s[null==e?void 0:e.field])&&void 0!==o?o:null===(n=null==l?void 0:l.widthByField)||void 0===n?void 0:n[null===(r=null==e?void 0:e.query)||void 0===r?void 0:r[ye.GJ]]}getColCellDraggedHeight(e){var t,i,s,o,n,r;const{colCell:l}=this.spreadsheet.options.style;return null!==(o=null!==(i=null===(t=null==l?void 0:l.heightByField)||void 0===t?void 0:t[null==e?void 0:e.id])&&void 0!==i?i:null===(s=null==l?void 0:l.heightByField)||void 0===s?void 0:s[null==e?void 0:e.field])&&void 0!==o?o:null===(n=null==l?void 0:l.heightByField)||void 0===n?void 0:n[null===(r=null==e?void 0:e.query)||void 0===r?void 0:r[ye.GJ]]}getColNodeHeight(e){var t,i,s;const{colNode:o,colsHierarchy:n,useCache:r=!0,cornerNodes:l=[]}=e;if(!o)return 0;const{colCell:d,cornerCell:c}=this.spreadsheet.options.style,h=null!==(t=this.getColCellDraggedHeight(o))&&void 0!==t?t:this.getCellCustomSize(o,null==d?void 0:d.height);if((0,a.isNumber)(h)&&h!==(null===(i=Ui.colCell)||void 0===i?void 0:i.height))return o.extra.isCustomHeight=!0,h;const u=(null==d?void 0:d.maxLines)>1&&(null==d?void 0:d.wordWrap)||this.spreadsheet.theme.colCell.text.fontSize>12||this.spreadsheet.theme.colCell.bolderText.fontSize>12,p=(null==c?void 0:c.maxLines)>1&&(null==c?void 0:c.wordWrap)||this.spreadsheet.theme.cornerCell.text.fontSize>12||this.spreadsheet.theme.cornerCell.bolderText.fontSize>12,g=this.getDefaultColNodeHeight(o,n);let m=g,v=g;if(u&&(m=this.getNodeAdaptiveHeight({meta:o,cell:this.textWrapTempColCell,defaultHeight:g,useCache:r})),p){const e=l.filter(e=>o.isLeaf?e.cornerType===gs.Q.Row:e.field===o.field);(0,a.isEmpty)(e)||(v=null!==(s=(0,a.max)(e.map(e=>this.getNodeAdaptiveHeight({meta:e,cell:this.textWrapTempCornerCell,defaultHeight:g,useCache:!1}))))&&void 0!==s?s:g)}return y(Math.max(v,m,g))}getDefaultColNodeHeight(e,t){var i,s,o,n;if(!e)return 0;const{colCell:r}=this.spreadsheet.options.style,l=(null===(s=null===(i=null==t?void 0:t.sampleNodesForAllLevels)||void 0===i?void 0:i.find(t=>t.level===e.level))||void 0===s?void 0:s.height)||0,a=null!==(n=null!==(o=this.getColCellDraggedHeight(e))&&void 0!==o?o:this.getCellCustomSize(e,null==r?void 0:r.height))&&void 0!==n?n:0;return y(Math.max(a,l))}getNodeAdaptiveHeight(e){var t,i;const{meta:s,cell:o,defaultHeight:n=0,useCache:r=!0}=e;if(!s||!o)return n;o.setMeta(Object.assign(Object.assign({},s),{shallowRender:!0}));const l=String(o.getFieldValue());if(!l)return n;const c=Math.ceil(o.getMaxTextWidth());if(c<=0&&o.cellType===d.vZ.COL_CELL)return n;const h=`${l}[&]${c}`,u=this.textWrapNodeHeightCache.get(h);if(r&&(0,a.isNumber)(u))return u||n;null===(i=(t=o).generateIconConfig)||void 0===i||i.call(t),o.drawTextShape();const{padding:p}=o.getStyle().cell,g=o.getActualTextHeight(),m=g+p.top+p.bottom,v=g>1.5*o.getTextLineHeight()||g>=n?Math.max(m,n):n;return this.textWrapNodeHeightCache.set(h,v),v}calculateColParentNodeWidthAndX(e){var t;let i=null,s=0;const o=e.slice(0);for(;s<o.length;){const e=o[s++],n=null==e?void 0:e.parent;if(i!==n&&n){o.push(n);const e=null===(t=n.children)||void 0===t?void 0:t.find(e=>e.width),s=(null==e?void 0:e.x)||0,r=(0,a.sumBy)(n.children,"width");n.x=s,n.width=r,i=n}}}updateColsHierarchySampleMaxHeightNodes(e,t){var i;const s=(0,a.isEmpty)(e.sampleNodesForAllLevels),o=(s?e.allNodesWithoutRoot:e.sampleNodesForAllLevels).map(t=>(0,a.maxBy)(e.getNodes(t.level).filter(e=>!e.isTotals||s),t=>this.getColNodeHeight({colNode:t,colsHierarchy:e})));s&&(e.sampleNodeForLastLevel=null!==(i=o[0])&&void 0!==i?i:null,e.maxLevel=0),e.sampleNodesForAllLevels=(0,a.compact)(o);const n=t?As.getCornerNodes({position:{x:0,y:0},width:t.width,height:e.height,layoutResult:{rowsHierarchy:t,colsHierarchy:e},seriesNumberWidth:this.getSeriesNumberWidth(),spreadsheet:this.spreadsheet}):[];e.sampleNodesForAllLevels.forEach(t=>{var i;if(t.height=this.getColNodeHeight({colNode:t,colsHierarchy:e,cornerNodes:n}),0===t.level)t.y=0;else{const s=null!==(i=e.sampleNodesForAllLevels[t.level-1])&&void 0!==i?i:{y:0,height:0};t.y=s.y+s.height}e.height+=t.height}),e.rootNode.height=e.height}render(){this.shouldRender()&&(this.adjustScrollOffset(),this.renderHeaders(),this.renderScrollBars(),this.renderBackground(),this.dynamicRenderCell(!0))}adjustScrollOffset(){const e=this.getAdjustedScrollOffset(this.getScrollOffset());this.setScrollOffset(e)}getSeriesNumberWidth(){var e,t;const{seriesNumber:i}=this.spreadsheet.options;return y((null==i?void 0:i.enable)&&null!==(t=null===(e=this.spreadsheet.theme.rowCell)||void 0===e?void 0:e.seriesNumberWidth)&&void 0!==t?t:0)}getCanvasSize(){const{width:e=0,height:t=0}=this.spreadsheet.options;return{width:e,height:t}}updateScrollOffset(e){var t,i,s;(null===(t=e.rowHeaderOffsetX)||void 0===t?void 0:t.animate)||(null===(i=e.offsetX)||void 0===i?void 0:i.animate)||(null===(s=e.offsetY)||void 0===s?void 0:s.animate)?this.scrollWithAnimation(e):this.scrollImmediately(e)}getPaginationScrollY(){const{pagination:e}=this.spreadsheet.options;if(e){const{current:t=1,pageSize:i}=e,s=this.viewCellHeights,o=Math.max((t-1)*i,0);return s.getCellOffsetY(o)}return 0}destroy(){this.unbindEvents(),this.clearAllGroup(),this.preCellIndexes=null,this.customRowHeightStatusMap={},this.textWrapNodeHeightCache.clear(!1),cancelAnimationFrame(this.scrollFrameId)}calculateCornerBBox(){this.cornerBBox=new is(this,!0)}calculatePanelBBox(){this.panelBBox=new Is(this,!0)}getCellRange(){const{pagination:e}=this.spreadsheet.options;return((e,t)=>{const i=e;let s=0,o=i.getTotalLength()-1;if(t){const{current:e=1,pageSize:n}=t;s=Math.max((e-1)*n,0),o=Math.min(e*n-1,i.getTotalLength()-1)}return{start:s,end:o}})(this.viewCellHeights,e)}clearAllGroup(){this.panelGroup.remove(),this.foregroundGroup.remove(),this.backgroundGroup.remove()}renderRowScrollBar(e){if(this.spreadsheet.isFrozenRowHeader()&&this.cornerBBox.width<this.cornerBBox.originalWidth){const t=this.cornerBBox.originalWidth-this.cornerBBox.width,{maxY:i}=this.getScrollbarPosition(),{splitLine:s,scrollBar:o}=this.spreadsheet.theme,n=Math.max(this.cornerBBox.width*this.cornerBBox.width/this.cornerBBox.originalWidth,null==o?void 0:o.thumbHorizontalMinSize);this.hRowScrollBar=new Ls({isHorizontal:!0,trackLen:this.cornerBBox.width,thumbLen:n-(null==s?void 0:s.verticalBorderWidth),position:{x:this.cornerBBox.minX+this.scrollBarSize/2,y:i},thumbOffset:e*(this.cornerBBox.width-n)/t,theme:this.scrollBarTheme,scrollTargetMaxOffset:t}),this.hRowScrollBar.addEventListener(Es.ScrollChange,({offset:e})=>{var i,s;const o=C(this.getValidScrollBarOffset(e,t));this.setScrollOffset({rowHeaderScrollX:o}),null===(i=this.rowHeader)||void 0===i||i.onRowScrollX(o,h.k5),null===(s=this.seriesNumberHeader)||void 0===s||s.onRowScrollX(o,h.j6),this.cornerHeader.onRowScrollX(o,h.nO);const n=this.getScrollBarOffset(o,this.hRowScrollBar),{scrollX:r,scrollY:l}=this.getScrollOffset(),a={scrollX:r,scrollY:l,rowHeaderScrollX:n};this.hRowScrollBar.updateThumbOffset(n,!1),this.spreadsheet.emit(m.ROW_CELL_SCROLL,a),this.spreadsheet.emit(m.GLOBAL_SCROLL,a)}),this.foregroundGroup.appendChild(this.hRowScrollBar)}}getValidScrollBarOffset(e,t){return(0,a.clamp)(e,0,t)}renderHScrollBar(e,t,i){if(C(e)<C(t)){const s=this.scrollBarSize/2,{maxY:o}=this.getScrollbarPosition(),n=!this.spreadsheet.isFrozenRowHeader(),r=e+(n?Math.min(this.cornerBBox.width,this.getCanvasSize().width):0),l={x:this.panelBBox.minX+(n?-this.cornerBBox.width+s:s),y:o},a=t+(n?this.cornerBBox.width:0),{scrollBar:d}=this.spreadsheet.theme,c=a-r,h=Math.max(r/a*r,null==d?void 0:d.thumbHorizontalMinSize);this.hScrollBar=new Ls({isHorizontal:!0,trackLen:r,thumbLen:h,position:l,thumbOffset:i*(r-h)/c,theme:this.scrollBarTheme,scrollTargetMaxOffset:c}),this.hScrollBar.addEventListener(Es.ScrollChange,({offset:e,updateThumbOffset:t})=>{const i=this.getValidScrollBarOffset(e,c);t&&this.hScrollBar.updateThumbOffset(this.getScrollBarOffset(i,this.hScrollBar),!1),this.setScrollOffset({scrollX:i}),this.dynamicRenderCell()}),this.foregroundGroup.appendChild(this.hScrollBar)}}getScrollbarPosition(){const{maxX:e,maxY:t}=this.panelBBox,{width:i,height:s}=this.getCanvasSize(),o=this.spreadsheet.options.interaction.scrollbarPosition===d.eb.CONTENT;return{maxX:(o?e:i)-this.scrollBarSize,maxY:(o?t:s)-this.scrollBarSize}}renderVScrollBar(e,t,i){if(e<t){const{scrollBar:s}=this.spreadsheet.theme,o=Math.max(e/t*e,null==s?void 0:s.thumbVerticalMinSize),n=t-e,{maxX:r}=this.getScrollbarPosition();this.vScrollBar=new Ls({isHorizontal:!1,trackLen:e,thumbLen:o,thumbOffset:i*(e-o)/n,position:{x:r,y:this.panelBBox.minY},theme:this.scrollBarTheme,scrollTargetMaxOffset:n}),this.vScrollBar.addEventListener(Es.ScrollChange,({offset:e,updateThumbOffset:t})=>{const i=this.getValidScrollBarOffset(e,n);t&&this.vScrollBar.updateThumbOffset(this.getScrollBarOffset(i,this.vScrollBar),!1),this.setScrollOffset({scrollY:i}),this.dynamicRenderCell()}),this.foregroundGroup.appendChild(this.vScrollBar)}}translateRelatedGroups(e,t,i){var s,o,n,r,l,a;E(this.panelScrollGroup,this.panelBBox.x-e,this.panelBBox.y-t),null===(s=this.rowHeader)||void 0===s||s.onScrollXY(this.getRealScrollX(e,i),t,h.k5),null===(o=this.seriesNumberHeader)||void 0===o||o.onScrollXY(this.getRealScrollX(e,i),t,h.j6),null===(n=this.cornerHeader)||void 0===n||n.onCorScroll(this.getRealScrollX(e,i),h.nO),null===(r=this.centerFrame)||void 0===r||r.onChangeShadowVisibility(e,this.getRealWidth()-this.panelBBox.width),null===(l=this.centerFrame)||void 0===l||l.onBorderScroll(this.getCenterFrameScrollX(e)),null===(a=this.columnHeader)||void 0===a||a.onColScroll(e,h.E2)}getCenterFrameScrollX(e){return this.getRealScrollX(e)}createDataCell(e){var t,i,s;if(!e)return;let o;if(this.dataCellPool.pool.length>0&&(null===(t=this.spreadsheet.options.future)||void 0===t?void 0:t.experimentalReuseCell)?(o=this.dataCellPool.acquire(),o.setMeta(e)):o=null===(s=(i=this.spreadsheet.options).dataCell)||void 0===s?void 0:s.call(i,e,this.spreadsheet),!o)return;const{rowIndex:n,colIndex:r}=e;return o.position=[n,r],o.name=`${n}-${r}`,o}init(){this.initCellPool(),this.initTextWrapTemp(),this.initGroups(),Zi.U.getInstance().debugCallback(Zi.jk,()=>{this.layoutResult=this.doLayout(),this.saveInitColumnLeafNodes(this.layoutResult.colLeafNodes),this.spreadsheet.emit(m.LAYOUT_AFTER_HEADER_LAYOUT,this.layoutResult)}),this.calculateCellWidthHeight(),this.calculateRowOffsets(),this.calculateCornerBBox(),this.calculatePanelBBox(),this.bindEvents()}renderBackground(){const{width:e,height:t}=this.getCanvasSize(),{color:i,opacity:s}=this.spreadsheet.theme.background;this.backgroundGroup.appendChild(new l.rw({style:{fill:i,opacity:s,x:0,y:0,width:e,height:t}}))}renderScrollBars(){const{scrollX:e,scrollY:t,rowHeaderScrollX:i}=this.getScrollOffset(),{width:s,height:o}=this.panelBBox,n=this.layoutResult.colsHierarchy.width,r=this.getRealHeight();this.renderRowScrollBar(i),this.renderHScrollBar(s,n,e),this.renderVScrollBar(o,r,t)}renderHeaders(){const e=this.getSeriesNumberWidth();this.rowHeader=this.getRowHeader(),this.columnHeader=this.getColHeader(),e>0&&!this.seriesNumberHeader&&(this.seriesNumberHeader=this.getSeriesNumberHeader()),this.cornerHeader=this.getCornerHeader(),this.centerFrame=this.getCenterFrame(),this.seriesNumberHeader&&this.foregroundGroup.appendChild(this.seriesNumberHeader),this.rowHeader&&this.foregroundGroup.appendChild(this.rowHeader),this.foregroundGroup.appendChild(this.columnHeader),this.foregroundGroup.appendChild(this.cornerHeader),this.foregroundGroup.appendChild(this.centerFrame)}getRowHeaderCfg(){const{y:e,viewportHeight:t,viewportWidth:i,height:s}=this.panelBBox,o=this.getSeriesNumberWidth();return{width:this.cornerBBox.width,height:s,viewportWidth:i,viewportHeight:t,position:{x:o,y:e},nodes:this.layoutResult.rowNodes,spreadsheet:this.spreadsheet}}getRowHeader(){return this.rowHeader?this.rowHeader:new Gs(this.getRowHeaderCfg())}getColHeader(){if(!this.columnHeader){const{x:e,width:t,viewportHeight:i,viewportWidth:s}=this.panelBBox;return new $s({width:t,cornerWidth:this.cornerBBox.width,height:this.cornerBBox.height,viewportWidth:s,viewportHeight:i,position:{x:e,y:0},nodes:this.layoutResult.colNodes,sortParam:this.spreadsheet.store.get("sortParam"),spreadsheet:this.spreadsheet})}return this.columnHeader}getCornerHeader(){return this.cornerHeader||As.getCornerHeader({panelBBox:this.panelBBox,cornerBBox:this.cornerBBox,seriesNumberWidth:this.getSeriesNumberWidth(),layoutResult:this.layoutResult,spreadsheet:this.spreadsheet})}getSeriesNumberHeader(){return this.seriesNumberHeader||Ys.getSeriesNumberHeader({spreadsheet:this.spreadsheet,panelBBox:this.panelBBox,cornerWidth:this.cornerBBox.width,seriesNumberWidth:this.getSeriesNumberWidth(),rowsHierarchy:this.layoutResult.rowsHierarchy})}getCenterFrame(){var e;if(!this.centerFrame){const{viewportWidth:t,viewportHeight:i}=this.panelBBox,s=null===(e=this.spreadsheet.options)||void 0===e?void 0:e.frame,o={position:{x:this.cornerBBox.x,y:this.cornerBBox.y},cornerWidth:this.cornerBBox.width,cornerHeight:this.cornerBBox.height,viewportWidth:t,viewportHeight:i,showViewportLeftShadow:!1,showViewportRightShadow:!1,spreadsheet:this.spreadsheet};return s?s(o):new T(o)}return this.centerFrame}updatePanelScrollGroup(){this.gridInfo=this.getGridInfo(),this.panelScrollGroup.update(this.gridInfo)}dynamicRenderCell(e){const{scrollX:t,scrollY:i,rowHeaderScrollX:s}=this.getScrollOffset(),o=i+this.getPaginationScrollY();this.spreadsheet.hideTooltip(),this.spreadsheet.interaction.clearHoverTimer(),this.realDataCellRender(t,o),this.updatePanelScrollGroup(),this.translateRelatedGroups(t,o,s),this.clip(t,o),e||this.emitScrollEvent({scrollX:t,scrollY:o,rowHeaderScrollX:s}),this.onAfterScroll()}emitScrollEvent(e){this.spreadsheet.emit(m.GLOBAL_SCROLL,e)}saveInitColumnLeafNodes(e=[]){const{store:t,options:i}=this.spreadsheet,{hiddenColumnFields:s=[]}=i.interaction,o=e.length+s.length,n=this.getInitColLeafNodes();o!==(null==n?void 0:n.length)&&t.set("initColLeafNodes",e)}getHiddenColumnsInfo(e){const t=this.spreadsheet.store.get("hiddenColumnsDetail",[]);if(!(0,a.isEmpty)(t))return t.find(t=>{var i;return null===(i=null==t?void 0:t.hideColumnNodes)||void 0===i?void 0:i.some(t=>t.id===e.id)})}updateCustomFieldsSampleNodes(e){var t;if(!this.spreadsheet.isCustomColumnFields())return;const i=(null===(t=e.sampleNodeForLastLevel)||void 0===t?void 0:t.id.split("[&]"))||[],s=e.getNodes().filter(t=>{var s;return(null===(s=e.sampleNodeForLastLevel)||void 0===s?void 0:s.id.includes(t.id))&&i.includes(t.field)});e.sampleNodesForAllLevels=s,e.height=(0,a.sumBy)(s,"height")}adjustCustomRowLeafNodesWidth(e){this.spreadsheet.isCustomRowFields()&&this.adjustLeafNodesSize("width")(e)}adjustCustomColLeafNodesHeight(e){this.spreadsheet.isCustomColumnFields()&&this.adjustLeafNodesSize("height")(e)}adjustLeafNodesSize(e){return({leafNodes:t,hierarchy:i})=>{const{sampleNodeForLastLevel:s,sampleNodesForAllLevels:o}=i;t.forEach(t=>{if(t.level>(null==s?void 0:s.level))return;const i=(0,a.sumBy)(o,i=>i.level<t.level?0:i[e]);t[e]=i})}}getHeaderNodes(e){const t=(0,a.concat)(this.getCornerNodes(),this.getSeriesNumberNodes(),this.getRowNodes(),this.getColNodes());return e?t.filter(t=>e.includes(t.id)):t}getCornerNodes(){var e;return(null===(e=this.cornerHeader)||void 0===e?void 0:e.getNodes())||[]}getSeriesNumberNodes(){var e;return(null===(e=this.seriesNumberHeader)||void 0===e?void 0:e.getNodes())||[]}getColNodes(e){const{colNodes:t=[]}=this.layoutResult;return(0,a.isNil)(e)?t:t.filter(t=>t.level===e)}getTopLevelColNodes(){return this.getColNodes(0)}getColNodeById(e){return this.getColNodes().find(t=>t.id===e)}getColNodeByIndex(e){return this.getColNodes().find(t=>t.colIndex===e)}getColLeafNodesByRange(e,t){return this.getColLeafNodes().filter(i=>i.colIndex>=e&&i.colIndex<=t)}getColLeafNodeByIndex(e){return this.getColLeafNodes().find(t=>t.colIndex===e)}getColNodesByField(e){return this.getColNodes().filter(t=>t.field===e)}getColLeafNodes(){var e;return(null===(e=this.layoutResult)||void 0===e?void 0:e.colLeafNodes)||[]}getColTotalsNodes(e){return this.getColNodes(e).filter(e=>e.isTotals)}getColSubTotalsNodes(e){return this.getColTotalsNodes(e).filter(e=>e.isSubTotals)}getColGrandTotalsNodes(e){return this.getColTotalsNodes(e).filter(e=>e.isGrandTotals)}getRowNodes(e){const{rowNodes:t=[]}=this.layoutResult;return(0,a.isNil)(e)?t:t.filter(t=>t.level===e)}getRowNodeById(e){return this.getRowNodes().find(t=>t.id===e)}getRowNodeByIndex(e){return this.getRowNodes().find(t=>t.rowIndex===e)}getRowLeafNodeByIndex(e){return this.getRowLeafNodes().find(t=>t.rowIndex===e)}getRowLeafNodesByRange(e,t){return this.getRowLeafNodes().filter(i=>i.rowIndex>=e&&i.rowIndex<=t)}getRowNodesByField(e){return this.getRowNodes().filter(t=>t.field===e)}getRowLeafNodes(){var e;return(null===(e=this.layoutResult)||void 0===e?void 0:e.rowLeafNodes)||[]}getRowTotalsNodes(e){return this.getRowNodes(e).filter(e=>e.isTotals)}getRowSubTotalsNodes(e){return this.getRowTotalsNodes(e).filter(e=>e.isSubTotals)}getRowGrandTotalsNodes(e){return this.getRowTotalsNodes(e).filter(e=>e.isGrandTotals)}getDataCells(){var e;return es(null===(e=this.panelGroup)||void 0===e?void 0:e.children,Ri)}getRowCells(){var e;const t=(null===(e=this.getRowHeader())||void 0===e?void 0:e.children)||[];return es(t,ds).filter(e=>e.cellType===d.vZ.ROW_CELL)}getRowLeafCells(){return this.getRowCells().filter(e=>e.getMeta().isLeaf)}getColCells(){var e;const t=(null===(e=this.getColHeader())||void 0===e?void 0:e.children)||[];return es(t,Ti).filter(e=>e.cellType===d.vZ.COL_CELL)}getColLeafCells(){return this.getColCells().filter(e=>e.getMeta().isLeaf)}getMergedCells(){return(0,a.filter)(this.panelScrollGroup.getMergedCellsGroup().children,e=>e instanceof us)}getCornerCells(){var e;const t=(null===(e=this.getCornerHeader())||void 0===e?void 0:e.children)||[];return es(t,ms).filter(e=>e.cellType===d.vZ.CORNER_CELL)}filterCells(e,t){return(0,a.isEmpty)(t)?e:(0,a.isArray)(t)?e.filter(e=>(0,a.includes)(t,e.getMeta().id)):e.filter(e=>{const i=t[e.cellType];return!!i&&i.includes(e.getMeta().id)})}getHeaderCells(e){const t=(0,a.concat)(this.getCornerCells(),this.getSeriesNumberCells(),this.getRowCells(),this.getColCells());return this.filterCells(t,e)}getCellById(e){return this.getCells().find(t=>t.getMeta().id===e)}getCellsByField(e){return this.getCells().filter(t=>t.getMeta().field===e)}getCells(e){const t=(0,a.concat)(this.getHeaderCells(),this.getDataCells());return e?t.filter(t=>e.includes(t.getMeta().id)):t}getInitColIndexLeafNodes(){return this.layoutResult.colsHierarchy.getIndexNodes()||[]}getInitColLeafNodes(){return this.spreadsheet.store.get("initColLeafNodes",[])}clearInitColLeafNodes(){this.spreadsheet.store.set("initColLeafNodes",void 0)}measureTextWidth(e,t){return Math.ceil(this.spreadsheet.measureTextWidth(e,t))+1}initCellPool(){this.dataCellPool=new fs}}class eo extends Qs{constructor(){super(...arguments),this.frozenGroupAreas={[s.Col]:{width:0,x:0,range:[]},[s.TrailingCol]:{width:0,x:0,range:[]},[s.Row]:{height:0,y:0,range:[]},[s.TrailingRow]:{height:0,y:0,range:[]}},this.panelScrollGroupIndexes=[0,0,0,0],this.addDataCell=e=>{const t=this.getColLeafNodes().length,i=this.getCellRange(),s=((e,t,i,s)=>{const{colCount:n=0,rowCount:r=0,trailingColCount:l=0,trailingRowCount:a=0}=t,{colIndex:d,rowIndex:c}=e;return S(c,s.start,r)?o.Row:b(c,s.end,a)?o.TrailingRow:x(d,n)?o.Col:_(d,l,i)?o.TrailingCol:o.Scroll})(e.getMeta(),this.getFrozenOptions(),t,i);var n;s===o.Scroll?e.parentElement!==this.panelScrollGroup&&this.panelScrollGroup.appendChild(e):e.parentElement!==this.frozenGroups[s]&&this.frozenGroups[s].appendChild(e),n=()=>{this.spreadsheet.emit(m.DATA_CELL_RENDER,e),this.spreadsheet.emit(m.LAYOUT_CELL_RENDER,e)},Promise.resolve().then(()=>{n()})},this.addFrozenCell=(e,t,i)=>{const s=this.getCellMeta(t,e);if(s){s.isFrozenCorner=!0;const e=this.createDataCell(s);i.appendChild(e)}},this.translateFrozenGroups=()=>{const{scrollY:e,scrollX:t}=this.getScrollOffset(),i=this.getPaginationScrollY(),{x:s,y:n,viewportWidth:r,viewportHeight:l}=this.panelBBox,a=Fs(this,this.cornerBBox.width,t),d=Ps(this,r),c=js(this,l,i);E(this.frozenGroups[o.TopLeft],s-a,n-i),E(this.frozenGroups[o.TopRight],s-d,n-i),E(this.frozenGroups[o.BottomLeft],s-a,n-c),E(this.frozenGroups[o.BottomRight],s-d,n-c),E(this.frozenGroups[o.Row],s-t,n-i),E(this.frozenGroups[o.TrailingRow],s-t,n-c),E(this.frozenGroups[o.Col],s-a,n-e-i),E(this.frozenGroups[o.TrailingCol],s-d,n-e-i)},this.renderFrozenGroupSplitLine=(e,t)=>{var i;const s=Math.floor(t-this.getPaginationScrollY());null===(i=this.foregroundGroup.getElementById(h.Pu))||void 0===i||i.remove();const{splitLine:o}=this.spreadsheet.theme,n=this.foregroundGroup.appendChild(new l.YJ({id:h.Pu,style:{zIndex:4}})),r={lineWidth:1,stroke:null==o?void 0:o.verticalBorderColor,opacity:null==o?void 0:o.verticalBorderColorOpacity},a={lineWidth:1,stroke:null==o?void 0:o.horizontalBorderColor,opacity:null==o?void 0:o.horizontalBorderColorOpacity};this.renderFrozenColSplitLine(n,o,r,e),this.renderFrozenTrailingColSplitLine(n,o,r,e),this.renderFrozenRowSplitLine(n,o,a,s),this.renderFrozenTrailingRowSplitLine(n,o,a,s)},this.renderFrozenPanelCornerGroup=()=>{const e=this.getCellRange(),t=((e,t,i)=>{const{colCount:s=0,rowCount:n=0,trailingColCount:r=0,trailingRowCount:l=0}=e,a={[o.TopLeft]:[],[o.TopRight]:[],[o.BottomLeft]:[],[o.BottomRight]:[]};for(let e=0;e<s;e++){for(let t=i.start;t<i.start+n;t++)a[o.TopLeft].push({x:e,y:t});if(l>0)for(let t=0;t<l;t++)a[o.BottomLeft].push({x:e,y:i.end-t})}for(let e=0;e<r;e++){const s=t-1-e;for(let e=i.start;e<i.start+n;e++)a[o.TopRight].push({x:s,y:e});if(l>0)for(let e=0;e<l;e++)a[o.BottomRight].push({x:s,y:i.end-e})}return a})(this.getFrozenOptions(),this.getColLeafNodes().length,e);Object.keys(t||{}).forEach(e=>{const i=this.frozenGroups[e];i&&t[e].forEach(e=>{this.addFrozenCell(e.x,e.y,i)})})},this.getTotalHeightForRange=(e,t)=>{if(e<0||t<0)return 0;if(this.rowOffsets)return this.rowOffsets[t+1]-this.rowOffsets[e];let i=0;for(let s=e;s<t+1;s++){i+=this.getDefaultCellHeight()}return i},this.getShadowFill=e=>{var t,i;const{splitLine:s}=this.spreadsheet.theme;return`l (${e}) 0:${null===(t=null==s?void 0:s.shadowColors)||void 0===t?void 0:t.left} 1:${null===(i=null==s?void 0:s.shadowColors)||void 0===i?void 0:i.right}`}}initPanelGroups(){super.initPanelGroups(),this.frozenGroups=[o.Row,o.Col,o.TrailingRow,o.TrailingCol,o.TopLeft,o.TopRight,o.BottomLeft,o.BottomRight].reduce((e,t)=>{const i=new os({name:t,zIndex:4,s2:this.spreadsheet});return this.panelGroup.appendChild(i),e[t]=i,e},{})}getFrozenOptions(){if(!this.validFrozenOptions){const e=this.getColLeafNodes().length,t=this.getCellRange();this.validFrozenOptions=((e={},t,i=0)=>{const s=Object.assign(Object.assign({},Yi),e);s.colCount>=t&&(s.colCount=t);const o=t-s.colCount;s.trailingColCount>o&&(s.trailingColCount=o),s.rowCount>=i&&(s.rowCount=i);const n=i-s.rowCount;return s.trailingRowCount>n&&(s.trailingRowCount=n),s})(this.spreadsheet.options.frozen,e,t.end-t.start+1)}return this.validFrozenOptions}calculateFrozenGroupInfo(){const{colCount:e,rowCount:t,trailingColCount:i,trailingRowCount:o}=this.getFrozenOptions(),n=this.viewCellHeights,r=this.getCellRange(),l=this.getColLeafNodes();e>0&&(this.frozenGroupAreas[s.Col].width=l[e-1].x+l[e-1].width,this.frozenGroupAreas[s.Col].x=0,this.frozenGroupAreas[s.Col].range=[0,e-1]),t>0&&(this.frozenGroupAreas[s.Row].height=n.getCellOffsetY(r.start+t)-n.getCellOffsetY(r.start),this.frozenGroupAreas[s.Row].y=n.getCellOffsetY(r.start),this.frozenGroupAreas[s.Row].range=[r.start,r.start+t-1]),i>0&&(this.frozenGroupAreas[s.TrailingCol].width=l[l.length-1].x-l[l.length-i].x+l[l.length-1].width,this.frozenGroupAreas[s.TrailingCol].x=l[l.length-i].x,this.frozenGroupAreas[s.TrailingCol].range=[l.length-i,l.length-1]),o>0&&(this.frozenGroupAreas[s.TrailingRow].height=n.getCellOffsetY(r.end+1)-n.getCellOffsetY(r.end+1-o),this.frozenGroupAreas[s.TrailingRow].y=n.getCellOffsetY(r.end+1-o),this.frozenGroupAreas[s.TrailingRow].range=[r.end-o+1,r.end])}getFinalViewport(){const{viewportHeight:e,viewportWidth:t}=this.panelBBox,{colCount:i,rowCount:o,trailingColCount:n,trailingRowCount:r}=this.getFrozenOptions(),l={width:t,height:e,x:0,y:0};return(i>0||n>0)&&(l.width-=this.frozenGroupAreas[s.Col].width+this.frozenGroupAreas[s.TrailingCol].width,l.x+=this.frozenGroupAreas[s.Col].width),(o>0||r>0)&&(l.height<this.frozenGroupAreas[s.Row].height+this.frozenGroupAreas[s.TrailingRow].height?(l.height=0,l.y=0):(l.height-=this.frozenGroupAreas[s.Row].height+this.frozenGroupAreas[s.TrailingRow].height,l.y+=this.frozenGroupAreas[s.Row].height)),l}calculateXYIndexes(e,t){var i,s;const o=this.getFinalViewport(),n=this.spreadsheet.isTableMode()&&(null===(s=null===(i=this.spreadsheet.dataSet)||void 0===i?void 0:i.isEmpty)||void 0===s?void 0:s.call(i))?this.spreadsheet.dataSet.getEmptyViewIndexes():(e=>{const{scrollX:t,scrollY:i,widths:s,heights:o,viewport:n,rowRemainWidth:r}=e;let l=(0,a.findIndex)(s,(e,i)=>{const o=t-((0,a.isNil)(r)?0:r)+n.x;return o>=e&&o<s[i+1]},0);l=Math.max(l,0);let d=(0,a.findIndex)(s,(e,i)=>{const o=n.width+t+n.x;return o>=e&&o<s[i+1]},l);d=Math.min(-1===d?1/0:d,s.length-2);const{start:c,end:h}=o.getIndexRange(i+n.y,n.height+i+n.y);return[l,d,c,h]})({scrollX:e,scrollY:t,widths:this.viewCellWidths,heights:this.viewCellHeights,viewport:o,rowRemainWidth:this.getRealScrollX(this.cornerBBox.width)});this.panelScrollGroupIndexes=n;const r=this.getColLeafNodes().length,l=this.getCellRange();return((e,t,i,s)=>{const{colCount:o=0,rowCount:n=0,trailingColCount:r=0,trailingRowCount:l=0}=t,a=[...e];x(a[0],o)&&(a[0]=o),_(a[1],r,i)&&(a[1]=i-r-1),S(a[2],s.start,n)&&(a[2]=s.start+n),b(a[3],s.end,l)&&(a[3]=s.end-l);const d=[...a];d[2]=s.start,d[3]=s.start+n-1;const c=[...a];c[0]=0,c[1]=o-1;const h=[...a];h[2]=s.end+1-l,h[3]=s.end;const u=[...a];return u[0]=i-r,u[1]=i-1,{center:a,frozenRow:d,frozenCol:c,frozenTrailingCol:u,frozenTrailingRow:h}})(n,this.getFrozenOptions(),r,l)}updateFrozenGroupGrid(){[s.Col,s.Row,s.TrailingCol,s.TrailingRow].forEach(e=>{if(!this.frozenGroupAreas[e].range)return;let t=[],i=[];if(e.toLowerCase().includes("row")){const[o,n]=this.frozenGroupAreas[e].range||[];if(t=this.gridInfo.cols,i=rs(o,n,this.viewCellHeights),e===s.TrailingRow){i=((e,t,i,s)=>{const o=rs(e,t,s),n=s.getCellOffsetY(e);return o.map(e=>e-n+i)})(o,n,this.frozenGroupAreas[s.TrailingRow].y,this.viewCellHeights)}}else{const[s,o]=this.frozenGroupAreas[e].range||[],n=this.getColLeafNodes();t=ns(s,o,n),i=this.gridInfo.rows}const o=c[e];this.frozenGroups[o].updateGrid({cols:t,rows:i},o)})}updatePanelScrollGroup(){super.updatePanelScrollGroup(),this.updateFrozenGroupGrid()}translateRelatedGroups(e,t,i){super.translateRelatedGroups(e,t,i),this.translateFrozenGroups(),this.renderRowResizeArea(),this.renderFrozenGroupSplitLine(e,t)}renderRowResizeArea(){}getFrozenColSplitLineSize(){const{viewportHeight:e,y:t}=this.panelBBox;return{y:0,height:e+t}}renderFrozenColSplitLine(e,t,i,o){const{colCount:n}=this.getFrozenOptions(),{x:r}=this.panelBBox;if(n>0){const n=this.cornerBBox.width,a=Fs(this,n,o),d=r+this.frozenGroupAreas[s.Col].width-a,{y:c,height:h}=this.getFrozenColSplitLineSize();(0,w.ni)(e,Object.assign(Object.assign({},i),{x1:d,x2:d,y1:c,y2:c+h})),(null==t?void 0:t.showShadow)&&o>0&&(this.spreadsheet.isFrozenRowHeader()||a>=n)&&e.appendChild(new l.rw({style:{x:d,y:c,width:null==t?void 0:t.shadowWidth,height:h,fill:this.getShadowFill(0)}}))}}renderFrozenTrailingColSplitLine(e,t,i,o){const{trailingColCount:n}=this.getFrozenOptions(),{viewportWidth:r,x:d}=this.panelBBox;if(n>0){const n=r-this.frozenGroupAreas[s.TrailingCol].width+d,{y:c,height:h}=this.getFrozenColSplitLineSize(),u=Math.max(0,(0,a.last)(this.viewCellWidths)-r);(0,w.ni)(e,Object.assign(Object.assign({},i),{x1:n,x2:n,y1:c,y2:c+h})),(null==t?void 0:t.showShadow)&&C(o)<C(u)&&e.appendChild(new l.rw({style:{x:n-t.shadowWidth,y:c,width:t.shadowWidth,height:h,fill:this.getShadowFill(180)}}))}}getFrozenRowSplitLineSize(){const{viewportWidth:e,x:t}=this.panelBBox;return{x:0,width:t+e}}renderFrozenRowSplitLine(e,t,i,o){const{rowCount:n}=this.getFrozenOptions(),{y:r}=this.panelBBox;if(n>0){const n=r+this.frozenGroupAreas[s.Row].height,{x:a,width:d}=this.getFrozenRowSplitLineSize();(0,w.ni)(e,Object.assign(Object.assign({},i),{x1:a,x2:a+d,y1:n,y2:n})),(null==t?void 0:t.showShadow)&&o>0&&e.appendChild(new l.rw({style:{x:a,y:n,width:d,height:null==t?void 0:t.shadowWidth,fill:this.getShadowFill(90)}}))}}renderFrozenTrailingRowSplitLine(e,t,i,o){const{trailingRowCount:n}=this.getFrozenOptions(),{viewportHeight:r}=this.panelBBox;if(n>0){const n=this.panelBBox.maxY-this.frozenGroupAreas[s.TrailingRow].height,{x:a,width:d}=this.getFrozenRowSplitLineSize(),c=this.getCellRange(),h=Math.max(0,this.viewCellHeights.getCellOffsetY(c.end+1)-this.viewCellHeights.getCellOffsetY(c.start)-r);(0,w.ni)(e,Object.assign(Object.assign({},i),{x1:a,x2:a+d,y1:n,y2:n})),(null==t?void 0:t.showShadow)&&o<C(h)&&e.appendChild(new l.rw({style:{x:a,y:n-t.shadowWidth,width:d,height:t.shadowWidth,fill:this.getShadowFill(270)}}))}}render(){this.shouldRender()&&(this.calculateFrozenGroupInfo(),this.renderFrozenPanelCornerGroup(),super.render())}getCenterFrameScrollX(e){return this.getFrozenOptions().colCount>0?Fs(this,this.cornerBBox.width,e):super.getCenterFrameScrollX(e)}getDefaultCellHeight(){var e;return null!==(e=this.getRowCellHeight(null))&&void 0!==e?e:0}createOrUpdate(e,t){w.xX.call(this,e,t)}clip(){const{colCount:e,rowCount:t,trailingColCount:i,trailingRowCount:n}=this.getFrozenOptions(),{scrollX:r}=this.getScrollOffset(),{x:l,width:a}=Ws(this,this.panelBBox),d=this.frozenGroupAreas[s.Col].width,c=this.frozenGroupAreas[s.TrailingCol].width,h=this.frozenGroupAreas[s.Row].height,u=this.frozenGroupAreas[s.TrailingRow].height,p=this.panelBBox.y+h,g=this.panelBBox.viewportHeight-h-u;this.createOrUpdate("panelScrollGroup.style.clipPath",{x:l,y:p,width:a,height:g}),e>0?this.createOrUpdate(`frozenGroups.${o.Col}.style.clipPath`,{x:this.panelBBox.x-Fs(this,this.cornerBBox.width,r),y:p,width:d,height:g}):this.frozenGroups[o.Col].style.clipPath=null,i>0?this.createOrUpdate(`frozenGroups.${o.TrailingCol}.style.clipPath`,{x:this.panelBBox.x+this.panelBBox.viewportWidth-c,y:p,width:c,height:g}):this.frozenGroups[o.TrailingCol].style.clipPath=null,t>0?this.createOrUpdate(`frozenGroups.${o.Row}.style.clipPath`,{x:l,y:this.panelBBox.y,width:a,height:h}):this.frozenGroups[o.Row].style.clipPath=null,n>0?this.createOrUpdate(`frozenGroups.${o.TrailingRow}.style.clipPath`,{x:l,y:this.panelBBox.y+this.panelBBox.viewportHeight-u,width:a,height:u}):this.frozenGroups[o.TrailingRow].style.clipPath=null}}class to extends Wi{getStyle(e){var t;return e?(0,a.get)(this.theme,e):null===(t=this.theme)||void 0===t?void 0:t.cornerCell}showSortIcon(){return!1}}class io extends $s{getCellInstance(e){const t=this.getHeaderConfig(),{spreadsheet:i}=t,{seriesNumberCell:s,colCell:o}=i.options,n=[e,i,t];return e.field===ye.r2?(null==s?void 0:s(...n))||new to(...n):(null==o?void 0:o(...n))||new Wi(...n)}}class so{constructor(e){const{label:t,isSubTotals:i,isGrandTotals:s,isTotalRoot:o=!1}=e;this.label=t,this.isSubTotals=i,this.isGrandTotals=s,this.isTotalRoot=o}static isTotalClassInstance(e){return e instanceof so}}const oo=e=>{var t;const{isFirstField:i,currentField:s,fieldValues:o,spreadsheet:n,lastField:r}=e,l=n.getTotalsConfig(i?s:r);let d,c;i?(null==l?void 0:l.showGrandTotals)&&(d=l.reverseGrandTotalsLayout?"unshift":"push",c=new so({label:l.grandTotalsLabel,isSubTotals:!1,isGrandTotals:!0,isTotalRoot:!0})):(null==l?void 0:l.showSubTotals)&&((0,a.size)(o)>1||!1!==(0,a.get)(l,"showSubTotals.always"))&&s!==ye.GJ&&(d=l.reverseSubTotalsLayout?"unshift":"push",c=new so({label:l.subTotalsLabel,isSubTotals:!0,isGrandTotals:!1,isTotalRoot:!0})),d&&(null===(t=o[d])||void 0===t||t.call(o,c))},no=(e,t,i,s)=>e.options.layoutArrange?e.options.layoutArrange(e,i,s,t):t,ro=(e,t,i,s)=>{var o,n,r,l;if((null===(o=null==e?void 0:e.facet)||void 0===o?void 0:o.getHiddenColumnsInfo(i))&&(null===(l=null===(r=null===(n=null==e?void 0:e.dataSet)||void 0===n?void 0:n.fields)||void 0===r?void 0:r.columns)||void 0===l?void 0:l.find(e=>e===(null==i?void 0:i.field))))return!1;let d=!0;const c=(e,i=-1,o=-1)=>{-1===i?(t.children.push(e),s.pushNode(e)):(t.children.splice(i,0,e),s.pushNode(e,o))};if(e.options.layoutHierarchy){const o=e.options.layoutHierarchy(e,i);if(o){const e=!!(0,a.isBoolean)(null==o?void 0:o.delete)&&(null==o?void 0:o.delete);d=!e;const{push:n,unshift:r}=o;let l=t.children.length,h=s.getNodes().length;(0,a.isEmpty)(r)||((0,a.each)(r,e=>{c(e)}),l=t.children.length,h=s.getNodes().length),(0,a.isEmpty)(n)||(0,a.each)(n,e=>{c(e)}),e||c(i,l,h)}else c(i)}else c(i);return d},lo=(e,t,i)=>{var s,o;(null===(s=e.options)||void 0===s?void 0:s.layoutCoordinate)&&((null==t?void 0:t.isLeaf)||(null==i?void 0:i.isLeaf))&&(null===(o=e.options)||void 0===o||o.layoutCoordinate(e,t,i))};class ao{constructor(e){this.label=e}static isTotalMeasureInstance(e){return e instanceof ao}}var co=i("./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/utils/layout/generate-id.js");const ho=e=>{var t,i,s,o;const{spreadsheet:n,level:r,fields:l}=e,{options:d,dataSet:c}=n,h=c.moreThanOneValue(),u=null===(i=null===(t=n.dataCfg.fields)||void 0===t?void 0:t.valueInCols)||void 0===i||i,p=(null===(o=null===(s=null==d?void 0:d.style)||void 0===s?void 0:s.colCell)||void 0===o?void 0:o.hideValue)&&u&&!h&&(0,a.includes)(l,ye.GJ);return r===l.length-(p?2:1)},uo=e=>{var t,i;const{currentField:s,fields:o,fieldValues:n,hierarchy:r,parentNode:l,level:a,query:d,addMeasureInTotalQuery:c,addTotalMeasureInTotal:h,spreadsheet:u,handler:p}=e,g=u.isTableMode();for(const[e,m]of n.entries()){const n=(0,co.bC)(m),v=so.isTotalClassInstance(n),f=ao.isTotalMeasureInstance(n);let C,y,w=!1,x=!1,_=!1,S=!1,b=s;v?(x=n.isGrandTotals,_=n.isSubTotals,S=n.isTotalRoot,C=(0,Gi.Ru)(n.label),y=S?Object.assign({},d):Object.assign(Object.assign({},d),{[s]:C}),c&&(y[ye.GJ]=null===(t=null==u?void 0:u.dataSet)||void 0===t?void 0:t.fields.values[0]),w=ho({spreadsheet:u,level:a,fields:o})):f?(C=(0,Gi.Ru)(n.label),y=Object.assign(Object.assign({},d),{[ye.GJ]:C}),b=ye.GJ,x=l.isGrandTotals,_=l.isSubTotals,w=ho({spreadsheet:u,level:a,fields:o})):g?(C=n,b=o[e],y=Object.assign(Object.assign({},d),{[b]:C}),w=!0):(C=n,y=C===ye.L4?Object.assign({},d):Object.assign(Object.assign({},d),{[s]:C}),w=ho({spreadsheet:u,level:a,fields:o}));const E=(0,co.$C)(l.id,g?b:C);if(!E)return;const L=!1,T=new Ns({id:E,value:C,level:a,field:b,parent:l,isTotals:v||f,isGrandTotals:x,isSubTotals:_,isTotalMeasure:f,isCollapsed:L,isTotalRoot:S,hierarchy:r,query:y,spreadsheet:u,isLeaf:w||L}),O=ro(u,l,T,r),R=null===(i=null==u?void 0:u.facet)||void 0===i?void 0:i.getHiddenColumnsInfo(T);!(a>r.maxLevel)||x||l.isGrandTotals||l.isSubTotals||T.isSubTotals||R||(r.sampleNodesForAllLevels.push(T),r.maxLevel=a,r.sampleNodeForLastLevel=T);w||L||!O?(T.isLeaf=!0,r.pushIndexNode(T),T.rowIndex=r.getIndexNodes().length-1):null==p||p({addTotalMeasureInTotal:h,addMeasureInTotalQuery:c,parentNode:T,currentField:o[a+1],fields:o,hierarchy:r,spreadsheet:u})}};function po(e,t){const i={};let s=e;for(;s&&s.field;)s.isTotalRoot&&!t||s.value===ye.L4||(i[s.field]=s.value),s=s.parent;return i}const go=e=>{const{addTotalMeasureInTotal:t,parentNode:i,currentField:s,fields:o,hierarchy:n,spreadsheet:r}=e,l=o.indexOf(s),d=r.dataSet,{values:c=[]}=d.fields,h=[];let u={};const p=r.getTotalsConfig(s),g=i.isGrandTotals?p.grandTotalsGroupDimensions||[]:p.subTotalsGroupDimensions||[],m=d.isEmpty()?[]:g;if(null==m?void 0:m.includes(s)){u=po(i);const e=d.getDimensionValues(s,u);h.push(...(e||[]).map(e=>new so({label:e,isSubTotals:i.isSubTotals,isGrandTotals:i.isGrandTotals,isTotalRoot:!1}))),(0,a.isEmpty)(h)&&s&&h.push(ye.L4)}else{if(!t||s!==ye.GJ)return ho({spreadsheet:r,level:l,fields:o})?(i.isLeaf=!0,n.pushIndexNode(i),void(i.rowIndex=n.getIndexNodes().length-1)):void go(Object.assign(Object.assign({},e),{currentField:o[l+1]}));u=po(i),h.push(...c.map(e=>new ao(e)))}const v=Ee(h);uo(Object.assign(Object.assign({},e),{fieldValues:v,level:l,parentNode:i,query:u,handler:mo}))};function mo(e){e.parentNode.isTotals?go(e):(e=>{const{parentNode:t,currentField:i,fields:s,spreadsheet:o}=e,n=o.dataSet,{values:r=[]}=n.fields,l=s.indexOf(i),d=[];let c={};c=po(t,!0);const h=n.getDimensionValues(i,c),u=no(o,h,t,i);d.push(...u||[]),(0,a.isEmpty)(d)&&i&&(i===ye.GJ?d.push(...r):d.push(ye.L4)),oo({currentField:i,lastField:s[l-1],isFirstField:0===l,fieldValues:d,spreadsheet:o});const p=Ee(d);uo(Object.assign(Object.assign({},e),{fieldValues:p,level:l,parentNode:t,query:c,handler:mo}))})(e)}const vo=e=>{var t,i,s,o,n;const{spreadsheet:r,nodeId:l,currentField:d,level:c,isTotals:h,isTotalMeasure:u,isLeaf:p}=e;if(p)return!1;const{collapseFields:g,collapseAll:m,expandDepth:v}=null!==(i=null===(t=r.options.style)||void 0===t?void 0:t.rowCell)&&void 0!==i?i:{},f=null!==(s=null==g?void 0:g[l])&&void 0!==s?s:null==g?void 0:g[d],C=(0,a.isNumber)(v)?c>=v:null;return!h&&!u&&(null!==(n=null!==(o=null!=f?f:C)&&void 0!==o?o:m)&&void 0!==n&&n)},fo=e=>{var t;const{fieldValue:i,currentField:s,query:o,parentNode:n,spreadsheet:r,level:l,fields:a,addMeasureInTotalQuery:d}=e,c=so.isTotalClassInstance(i),h=ao.isTotalMeasureInstance(i);let u,p,g=!1,m=!1,v=!1,f=!1;return c?(m=i.isGrandTotals,v=i.isSubTotals,f=i.isTotalRoot,u=(0,Gi.Ru)(i.label),p=f?Object.assign({},o):Object.assign(Object.assign({},o),{[s]:u}),d&&(p[ye.GJ]=null===(t=null==r?void 0:r.dataSet)||void 0===t?void 0:t.fields.values[0]),g=ho({spreadsheet:r,level:l,fields:a})):h?(u=(0,Gi.Ru)(i.label),p=Object.assign(Object.assign({},o),{[ye.GJ]:u}),m=n.isGrandTotals,v=n.isSubTotals,g=ho({spreadsheet:r,level:l,fields:a})):(u=i,p=u===ye.L4?Object.assign({},o):Object.assign(Object.assign({},o),{[s]:u}),g=ho({spreadsheet:r,level:l,fields:a})),{value:u,nodeQuery:p,isLeaf:g,isGrandTotals:m,isSubTotals:v,isTotalRoot:f,isTotals:c,isTotalMeasure:h}},Co=e=>{var t;const{currentField:i,fields:s,fieldValues:o,hierarchy:n,parentNode:r,level:l,query:a,addMeasureInTotalQuery:d,addTotalMeasureInTotal:c,spreadsheet:h,handler:u}=e;for(const e of o){const o=(0,co.bC)(e),p=i,g=fo({fieldValue:o,currentField:i,query:a,parentNode:r,spreadsheet:h,level:l,fields:s,addMeasureInTotalQuery:d}),m=(0,co.$C)(r.id,g.value);if(m){const e=vo({spreadsheet:h,nodeId:m,currentField:i,level:l,isTotals:g.isTotals,isTotalMeasure:g.isTotalMeasure,isLeaf:g.isLeaf}),o=new Ns({id:m,value:g.value,level:l,field:p,parent:r,isTotals:g.isTotals||g.isTotalMeasure,isGrandTotals:g.isGrandTotals,isSubTotals:g.isSubTotals,isTotalMeasure:g.isTotalMeasure,isCollapsed:e,isTotalRoot:g.isTotalRoot,hierarchy:n,query:g.nodeQuery,spreadsheet:h,isLeaf:g.isLeaf||e}),a=ro(h,r,o,n),v=null===(t=null==h?void 0:h.facet)||void 0===t?void 0:t.getHiddenColumnsInfo(o);!(l>n.maxLevel)||g.isGrandTotals||r.isGrandTotals||r.isSubTotals||o.isSubTotals||v||(n.sampleNodesForAllLevels.push(o),n.maxLevel=l,n.sampleNodeForLastLevel=o);g.isLeaf||e||!a?(o.isLeaf=!0,n.pushIndexNode(o),o.rowIndex=n.getIndexNodes().length-1):null==u||u({addTotalMeasureInTotal:c,addMeasureInTotalQuery:d,parentNode:o,currentField:s[l+1],fields:s,hierarchy:n,spreadsheet:h})}}},yo=e=>{const{addTotalMeasureInTotal:t,parentNode:i,currentField:s,fields:o,hierarchy:n,spreadsheet:r}=e,l=o.indexOf(s),d=r.dataSet,{values:c=[]}=d.fields,h=[];let u={};const p=r.getTotalsConfig(s),g=i.isGrandTotals?p.grandTotalsGroupDimensions||[]:p.subTotalsGroupDimensions||[],m=d.isEmpty()?[]:g;if(null==m?void 0:m.includes(s)){u=po(i);const e=d.getDimensionValues(s,u);h.push(...(e||[]).map(e=>new so({label:e,isSubTotals:i.isSubTotals,isGrandTotals:i.isGrandTotals,isTotalRoot:!1}))),(0,a.isEmpty)(h)&&s&&h.push(ye.L4)}else{if(!t||s!==ye.GJ)return ho({spreadsheet:r,level:l,fields:o})?(i.isLeaf=!0,n.pushIndexNode(i),void(i.rowIndex=n.getIndexNodes().length-1)):void yo(Object.assign(Object.assign({},e),{currentField:o[l+1]}));u=po(i),h.push(...c.map(e=>new ao(e)))}const v=Ee(h);Co(Object.assign(Object.assign({},e),{fieldValues:v,level:l,parentNode:i,query:u,handler:wo}))};function wo(e){e.parentNode.isTotals?yo(e):(e=>{const{parentNode:t,currentField:i,fields:s,spreadsheet:o}=e,n=o.dataSet,{values:r=[]}=n.fields,l=s.indexOf(i),d=[];let c={};c=po(t,!0);const h=n.getDimensionValues(i,c),u=no(o,h,t,i);d.push(...u||[]),(0,a.isEmpty)(d)&&i&&(i===ye.GJ?d.push(...r):d.push(ye.L4)),oo({currentField:i,lastField:s[l-1],isFirstField:0===l,fieldValues:d,spreadsheet:o});const p=Ee(d);Co(Object.assign(Object.assign({},e),{fieldValues:p,level:l,parentNode:t,query:c,handler:wo}))})(e)}const xo=e=>{var t;const{tree:i=[],level:s,parentNode:o,hierarchy:n,spreadsheet:r,isRowHeader:l}=e,{collapseFields:d,collapseAll:c,expandDepth:h}=null===(t=r.options.style)||void 0===t?void 0:t.rowCell,u=r.store.get("hiddenColumnsDetail")||[];i.forEach(e=>{var t,i;const{field:p,title:g,collapsed:m,children:v}=e,f=(0,A.Tt)(e,["field","title","collapsed","children"]),C=u.some(({hideColumnNodes:e})=>e.find(e=>e.field===p)),y={[ye.GJ]:p},w=(0,co.$C)(o.id,p),x=null!=m&&m,_=null!==(t=null==d?void 0:d[w])&&void 0!==t?t:null==d?void 0:d[p],S=(0,a.isNumber)(h)?s>h:null,b=null!==(i=null!=_?_:S)&&void 0!==i?i:c||x,E=r.isHierarchyTreeType()&&l&&b,L=(0,a.isEmpty)(v),T=new Ns({id:w,field:p,value:g,level:s,parent:o,isTotals:!1,isCollapsed:E,hierarchy:n,query:y,spreadsheet:r,isLeaf:L,extra:Object.assign(Object.assign({},f),{isCustomNode:!0})});if((L||C||E)&&n.pushIndexNode(T),C)return;s>n.maxLevel&&!T.isSeriesNumberNode()&&(n.maxLevel=s,n.sampleNodesForAllLevels.push(T),n.sampleNodeForLastLevel=T,n.maxLevel=s);const O=ro(r,o,T,n);(0,a.isEmpty)(v)||E||!O||xo({spreadsheet:r,parentNode:T,level:s+1,hierarchy:n,tree:v||[],isRowHeader:l})})},_o=e=>{var t,i,s,o,n,r,l;const{spreadsheet:d,parentNode:c,currentField:h,level:u,hierarchy:p,pivotMeta:g}=e,{query:m,id:v}=c,f=(null===(s=null===(i=null===(t=d.dataCfg)||void 0===t?void 0:t.fields)||void 0===i?void 0:i.rows)||void 0===s?void 0:s.length)<=u,C=Ee(Array.from(g.keys()));let y=no(d,C,c,h);const w=d.store.get("drillItemsNum");f&&w>0&&(y=y.slice(0,w)),0===u&&((e,t,i)=>{const s=e.getTotalsConfig(t);(null==s?void 0:s.showGrandTotals)&&i[s.reverseGrandTotalsLayout?"unshift":"push"](new so({label:s.grandTotalsLabel,isGrandTotals:!0,isSubTotals:!1,isTotalRoot:!1}))})(d,h,y);for(const e of y){const t=e instanceof so,i=t?null:g.get(e);let s,f=m,C=!1,y=!1;if(t){C=e.isGrandTotals,y=e.isSubTotals,s=(0,Gi.Ru)(e.label),f=m}else s=e,f=Object.assign(Object.assign({},m),{[h]:s});const w=(0,co.$C)(v,s),{collapseFields:x,collapseAll:_,expandDepth:S}=null===(o=d.options.style)||void 0===o?void 0:o.rowCell,b=null!==(n=null==x?void 0:x[w])&&void 0!==n?n:null==x?void 0:x[h],E=(0,a.isNumber)(S)?u>S:null,L=null!==(r=null!=b?b:E)&&void 0!==r?r:_,T=new Ns({id:w,value:s,level:u,parent:c,field:h,isTotals:t,isGrandTotals:C,isSubTotals:y,isCollapsed:L,hierarchy:p,query:f,spreadsheet:d});u>p.maxLevel&&(p.maxLevel=u);const O=[...(null===(l=null==i?void 0:i.children)||void 0===l?void 0:l.keys())||[]].filter(e=>e!==ye.jI),R=(0,a.isEmpty)(O);(R||t)&&(T.isLeaf=!0),R||(T.isTotals=!0);const I=ro(d,c,T,p);R||L||t||!I||_o({level:u+1,currentField:i.childField,pivotMeta:i.children,parentNode:T,hierarchy:p,spreadsheet:d})}};class So{constructor(){this.width=0,this.height=0,this.maxLevel=-1,this.sampleNodesForAllLevels=[],this.sampleNodeForLastLevel=null,this.allNodesWithoutRoot=[],this.indexNode=[],this.isPlaceholder=!1,this.rootNode=Ns.rootNode()}getLeaves(){return this.allNodesWithoutRoot.filter(e=>e.isLeaf)}getNodes(e){return void 0!==e?this.allNodesWithoutRoot.filter(t=>t.level===e):this.allNodesWithoutRoot}getNodesLessThanLevel(e){return this.allNodesWithoutRoot.filter(t=>t.level<=e)}pushNode(e,t=-1){-1===t?this.allNodesWithoutRoot.push(e):this.allNodesWithoutRoot.splice(t,0,e)}pushIndexNode(e){this.indexNode.push(e)}getIndexNodes(){return this.indexNode}}const bo=e=>{const{rootNode:t,hierarchy:i,fields:s,spreadsheet:o,isRowHeader:n}=e,r=(0,a.filter)(s,e=>e!==ye.GJ);xo({spreadsheet:o,tree:r,level:0,parentNode:t,hierarchy:i,isRowHeader:n})},Eo=e=>{const{isValueInCols:t,moreThanOneValue:i,rootNode:s,hierarchy:o,fields:n,isRowHeader:r,isCustomTreeFields:l,spreadsheet:a}=e;let d,c;r?(d=!t&&i,c=!t&&!i):(d=t&&i,c=t&&!i),l?bo(e):mo({spreadsheet:a,addTotalMeasureInTotal:d,addMeasureInTotalQuery:c,parentNode:s,currentField:n[0],fields:n,hierarchy:o})},Lo=e=>{const{spreadsheet:t}=e;t.isHierarchyGridTreeType()?(e=>{const{isValueInCols:t,moreThanOneValue:i,rootNode:s,hierarchy:o,fields:n,isCustomTreeFields:r,spreadsheet:l}=e,a=!t&&i,d=!t&&!i;r?bo(e):wo({spreadsheet:l,addTotalMeasureInTotal:a,addMeasureInTotalQuery:d,parentNode:s,currentField:n[0],fields:n,hierarchy:o})})(e):t.isHierarchyTreeType()?(e=>{const{spreadsheet:t,rootNode:i,hierarchy:s,isCustomTreeFields:o}=e,{rows:n}=t.dataSet.fields;t.isHierarchyTreeType()&&!o?_o({level:0,currentField:null==n?void 0:n[0],pivotMeta:t.dataSet.rowPivotMeta,parentNode:i,hierarchy:s,spreadsheet:t}):bo(e)})(e):Eo(e)},To=e=>{var t;const{isCustomTreeFields:i,spreadsheet:s}=e,{enable:o}=null!==(t=s.options.seriesNumber)&&void 0!==t?t:{};if(i){const t={field:ye.r2,title:s.getSeriesNumberText()},i=o?[t,...e.fields]:e.fields.filter(e=>(null==e?void 0:e.field)!==ye.r2);return void bo(Object.assign(Object.assign({},e),{fields:i}))}(e=>{var t;const{spreadsheet:i,rootNode:s,fields:o,hierarchy:n}=e,{columns:r=[]}=i.dataSet.fields,{enable:l}=null!==(t=i.options.seriesNumber)&&void 0!==t?t:{},a=i.getSeriesNumberText(),d=r.map(e=>e===ye.r2?a:i.dataSet.getFieldName(e));l&&!o.includes(ye.r2)&&(o.unshift(ye.r2),d.unshift(a)),uo({spreadsheet:i,currentField:o[0],fields:o,fieldValues:d,hierarchy:n,parentNode:s,level:0,query:{},addMeasureInTotalQuery:!1,addTotalMeasureInTotal:!1,handler:mo})})(e)},Oo=e=>{const{isRowHeader:t,spreadsheet:i}=e,{rows:s=[],columns:o=[]}=i.dataSet.fields,n=i.isValueInCols(),r=i.dataSet.moreThanOneValue(),l=new So,a=t?s:o,d=i.isCustomHeaderFields(t?"rows":"columns"),c={isValueInCols:n,moreThanOneValue:r,rootNode:l.rootNode,hierarchy:l,spreadsheet:i,fields:a,isRowHeader:t,isCustomTreeFields:d};t?Lo(c):(e=>{const{spreadsheet:t}=e;t.isPivotMode()?Eo(e):To(e)})(c);return{hierarchy:l,leafNodes:t&&i.isHierarchyTreeType()?l.getNodes():l.getLeaves()}};class Ro extends eo{constructor(e){super(e),this.onSortHandler=e=>(0,A.sH)(this,void 0,void 0,function*(){const t=this.spreadsheet;let i=e;Array.isArray(e)||(i=[e]);const s=t.dataCfg.sortParams||[];i=i.map(e=>{var t,i;const o=Object.assign(Object.assign({},e),{sortFieldId:null!==(t=e.sortKey)&&void 0!==t?t:e.sortFieldId}),n=null!==(i=s.find(e=>e.sortFieldId===o.sortFieldId))&&void 0!==i?i:{};return Object.assign(Object.assign({},n),o)});const o=s.filter(e=>!i.find(t=>t.sortFieldId===e.sortFieldId));(0,a.set)(t.dataCfg,"sortParams",[...o,...i]),t.setDataCfg(t.dataCfg),yield t.render(!0),t.emit(m.RANGE_SORTED,t.dataSet.getDisplayDataSet())}),this.onFilterHandler=e=>(0,A.sH)(this,void 0,void 0,function*(){const t=this.spreadsheet,i=!e.filteredValues||0===e.filteredValues.length,s=t.dataCfg.filterParams||[],o=s.findIndex(t=>t.filterKey===e.filterKey);-1!==o?i?s.splice(o,1):s[o]=e:s.push(e),(0,a.set)(t.dataCfg,"filterParams",s),yield t.render(!0),t.emit(m.RANGE_FILTERED,t.dataSet.getDisplayDataSet())}),this.spreadsheet.on(m.RANGE_SORT,this.onSortHandler),this.spreadsheet.on(m.RANGE_FILTER,this.onFilterHandler)}getCornerCellInstance(){return null}getRowCellInstance(e){const{dataCell:t}=this.spreadsheet.options;return(null==t?void 0:t(e,this.spreadsheet))||new zi(e,this.spreadsheet)}getColCellInstance(...e){const{colCell:t}=this.spreadsheet.options;return(null==t?void 0:t(...e))||new Wi(...e)}initGroups(){super.initGroups(),this.initEmptyPlaceholderGroup()}shouldRender(){var e;const{fields:t}=this.spreadsheet.dataSet,i=null===(e=null==t?void 0:t.columns)||void 0===e?void 0:e.every(e=>e===ye.r2);return super.shouldRender()&&!i}render(){this.shouldRender()&&(super.render(),this.renderEmptyPlaceholder())}clearAllGroup(){super.clearAllGroup(),this.emptyPlaceholderGroup.remove()}initEmptyPlaceholderGroup(){this.emptyPlaceholderGroup=this.spreadsheet.container.appendChild(new l.YJ({name:h.qK,style:{zIndex:4}}))}renderEmptyPlaceholder(){var e,t,i;if(!(null===(e=this.spreadsheet.dataSet)||void 0===e?void 0:e.isEmpty()))return;const{empty:s}=this.spreadsheet.options.placeholder,{background:o}=this.spreadsheet.theme,{icon:n,description:r}=this.spreadsheet.theme.empty,{horizontalBorderWidth:a,horizontalBorderColor:d,horizontalBorderColorOpacity:c}=this.spreadsheet.theme.dataCell.cell,{maxY:h,viewportWidth:u,height:p}=this.panelBBox,g=u/2-n.width/2,m=p/2+h-n.height/2+n.margin.top,v=null!==(t=null==s?void 0:s.description)&&void 0!==t?t:(0,Gi.Ru)("暂无数据"),f=u/2-this.measureTextWidth(v,r)/2,C=m+n.height+n.margin.bottom,y=new l.rw({style:{x:0,y:h,width:u,height:p,stroke:d,strokeWidth:a,strokeOpacity:c,fill:null==o?void 0:o.color,fillOpacity:null!==(i=null==o?void 0:o.opacity)&&void 0!==i?i:1}});this.emptyPlaceholderGroup.appendChild(y),(0,w.sH)(this.emptyPlaceholderGroup,Object.assign(Object.assign({},n),{name:null==s?void 0:s.icon,x:g,y:m,width:n.width,height:n.height})),(0,w.S5)({group:this.emptyPlaceholderGroup,style:Object.assign(Object.assign({},r),{text:v,x:f,y:C})}),this.emptyPlaceholderGroup.toFront()}getDataCellAdaptiveHeight(e){const t={id:String(null==e?void 0:e.rowIndex)},i=this.getRowCellHeight(t);if(this.isCustomRowCellHeight(t))return this.customRowHeightStatusMap[null==e?void 0:e.rowIndex]=!0,i||0;const s=this.getCellHeightByRowIndex(null==e?void 0:e.rowIndex);return this.getNodeAdaptiveHeight({meta:e,cell:this.textWrapTempRowCell,defaultHeight:s})}getCellHeightByRowIndex(e){var t;return this.rowOffsets?null!==(t=this.getRowCellHeight({id:String(e)}))&&void 0!==t?t:0:this.getDefaultCellHeight()}presetRowCellHeightIfNeeded(e){var t;const{style:i}=this.spreadsheet.options,s=this.getColLeafNodes();if(((0,a.isEmpty)(s)||(null===(t=null==i?void 0:i.dataCell)||void 0===t?void 0:t.maxLines)<=1)&&this.spreadsheet.theme.dataCell.text.fontSize<=12&&this.spreadsheet.theme.dataCell.bolderText.fontSize<=12)return;const o=(0,a.max)(s.map(t=>{const i=this.getCellMeta(e,t.colIndex);return this.getDataCellAdaptiveHeight(i)}))||this.getDefaultCellHeight();(0,a.set)(this.spreadsheet.options,`style.rowCell.heightByField.${e}`,o)}calculateRowOffsets(){var e,t,i;const{style:s}=this.spreadsheet.options,o=null===(e=null==s?void 0:s.rowCell)||void 0===e?void 0:e.heightByField,n=(null===(t=null==s?void 0:s.dataCell)||void 0===t?void 0:t.maxLines)>1&&(null===(i=null==s?void 0:s.dataCell)||void 0===i?void 0:i.wordWrap)||this.spreadsheet.theme.dataCell.text.fontSize>12||this.spreadsheet.theme.dataCell.bolderText.fontSize>12;if((0,a.keys)(o).length||n){const e=this.spreadsheet.dataSet.getDisplayDataSet();this.textWrapNodeHeightCache.clear(!1),this.customRowHeightStatusMap={},this.rowOffsets=[0],this.lastRowOffset=0,e.forEach((e,t)=>{this.presetRowCellHeightIfNeeded(t);const i=this.getCellHeightByRowIndex(t),s=this.lastRowOffset+i;this.rowOffsets.push(s),this.lastRowOffset=s})}}destroy(){super.destroy(),this.spreadsheet.off(m.RANGE_SORT,this.onSortHandler),this.spreadsheet.off(m.RANGE_FILTER,this.onFilterHandler)}calculateCornerBBox(){const{colsHierarchy:e}=this.getLayoutResult(),t=C(e.height);this.cornerBBox=new is(this),this.cornerBBox.height=t,this.cornerBBox.maxY=t}doLayout(){const e=new So,{colLeafNodes:t,colsHierarchy:i}=this.buildColHeaderHierarchy();return this.calculateColNodesCoordinate(t,i),{colNodes:i.getNodes(),colLeafNodes:t,colsHierarchy:i,rowNodes:[],rowsHierarchy:e,rowLeafNodes:[],cornerNodes:[]}}buildColHeaderHierarchy(){const e=Oo({isRowHeader:!1,spreadsheet:this.spreadsheet});return{colLeafNodes:e.leafNodes,colsHierarchy:e.hierarchy}}getCellMeta(e=0,t=0){var i,s,o;const{options:n,dataSet:r}=this.spreadsheet,l=this.getColLeafNodes()[t];if(!l)return null;let a;const d=l.x,c=this.viewCellHeights.getCellOffsetY(e),h=this.getCellHeightByRowIndex(e);a=(null===(i=n.seriesNumber)||void 0===i?void 0:i.enable)&&l.field===ye.r2?e+1:r.getCellData({query:{field:l.field,rowIndex:e}});const u=l.field,p=a,g={rowIndex:e},m={colIndex:t},v={spreadsheet:this.spreadsheet,x:d,y:c,width:l.width,height:h,data:{[l.field]:a},rowIndex:e,colIndex:t,isTotals:!1,colId:l.id,rowId:String(e),valueField:u,fieldValue:p,id:xe(String(e),l.id),rowQuery:g,colQuery:m,query:Object.assign(Object.assign({},g),m)};return null!==(o=null===(s=n.layoutCellMeta)||void 0===s?void 0:s.call(n,v))&&void 0!==o?o:v}getAdaptiveColWidth(e){var t;const{dataCell:i}=this.spreadsheet.options.style,{seriesNumber:s}=this.spreadsheet.options;if(this.spreadsheet.getLayoutWidthType()!==Vi.Compact){const t=this.getSeriesNumberWidth(),o=e.length-((null==s?void 0:s.enable)?1:0),n=this.getCanvasSize().width-t-T.getVerticalBorderWidth(this.spreadsheet);return Math.max(null==i?void 0:i.width,C(n/Math.max(1,o)))}return y(null!==(t=null==i?void 0:i.width)&&void 0!==t?t:0)}calculateColLeafNodesWidth(e,t){let i=Ns.blankNode(),s=0;const o=this.getAdaptiveColWidth(e),n=t.getLeaves(),r=this.spreadsheet.getLayoutWidthType()!==Vi.Compact;let l=-1,d=0;if(r){const{colCell:e}=this.spreadsheet.options.style;for(let t=n.length-1;t>=0;t--){const i=n[t];if(i.field!==ye.r2){const s=(0,a.isNumber)(this.getColCellDraggedWidth(i)),o=(0,a.isNumber)(this.getCellCustomSize(i,null==e?void 0:e.width));if(!s&&!o){l=t;break}}}if(l>=0){const{seriesNumber:e}=this.spreadsheet.options,t=this.getSeriesNumberWidth(),i=n.length-((null==e?void 0:e.enable)?1:0),s=this.getCanvasSize().width-t-T.getVerticalBorderWidth(this.spreadsheet);d=Math.max(0,y(s)-y(o)*Math.max(1,i))}}n.forEach((e,n)=>{e.colIndex=s,s+=1,e.x=i.x+i.width,e.width=this.getColLeafNodesWidth(e,o),n===l&&(e.width+=d),lo(this.spreadsheet,null,e),t.width+=e.width,i=e})}calculateColNodesHeight(e){e.getNodes().forEach(t=>{var i,s;t.y=0===t.level?0:(null===(i=null==t?void 0:t.parent)||void 0===i?void 0:i.y)+(null===(s=null==t?void 0:t.parent)||void 0===s?void 0:s.height)||0,t.height=this.getColNodeHeight({colNode:t,colsHierarchy:e,useCache:!1})})}calculateColNodesCoordinate(e,t){this.calculateColLeafNodesWidth(e,t),this.calculateColParentNodeWidthAndX(e),this.updateColsHierarchySampleMaxHeightNodes(t),this.calculateColNodesHeight(t),this.updateCustomFieldsSampleNodes(t),this.adjustCustomColLeafNodesHeight({leafNodes:e,hierarchy:t})}getCompactColNodeWidth(e){const{theme:t,dataSet:i}=this.spreadsheet,{bolderText:s}=t.colCell,{text:o,cell:n}=t.dataCell,r=i.getDisplayDataSet(),l=i.getFieldFormatter(e.field),d=(0,a.maxBy)(null==r?void 0:r.slice(0,50).map(t=>{var i;return`${null!==(i=null==l?void 0:l(t[e.field]))&&void 0!==i?i:t[e.field]}`}),e=>this.measureTextWidth(e,o));Zi.U.getInstance().logger("Max Label In Col:",e.field,d);const c=this.measureTextWidth(d,o)+n.padding.left+n.padding.right,h=this.measureTextWidth(e.value,s)+qi(this.spreadsheet,e,t.colCell),{compactExtraWidth:u=0,compactMinWidth:p}=this.spreadsheet.options.style||{},g=y(Math.max(h,c)+u);return(0,a.isNumber)(p)?Math.max(g,p):g}getColLeafNodesWidth(e,t){const{colCell:i}=this.spreadsheet.options.style,s=this.spreadsheet.getLayoutWidthType(),o=this.getColCellDraggedWidth(e);if((0,a.isNumber)(o))return y(o);const n=this.getCellCustomSize(e,null==i?void 0:i.width);return(0,a.isNumber)(n)?y(n):e.field===ye.r2?this.getSeriesNumberWidth():s===Vi.Compact?this.getCompactColNodeWidth(e):y(t)}getViewCellHeights(){const e=this.getDefaultCellHeight();return{getTotalHeight:()=>this.rowOffsets?(0,a.last)(this.rowOffsets)||0:e*this.spreadsheet.dataSet.getDisplayDataSet().length,getCellOffsetY:t=>t<=0?0:this.rowOffsets?this.rowOffsets[t]:t*e,getTotalLength:()=>this.spreadsheet.dataSet.getDisplayDataSet().length,getIndexRange:(t,i)=>{if(this.rowOffsets)return Ki(this.rowOffsets,t,i);const s=C(t/e,0),o=i%e===0?i/e-1:C(i/e,0);return{start:Math.max(0,s),end:Math.max(0,o)}}}}renderRowResizeArea(){const{resize:e}=this.spreadsheet.options.interaction;if(!((0,a.isBoolean)(e)?e:null==e?void 0:e.rowCellVertical))return;const t=this.foregroundGroup.getElementById(h.k5);t&&t.removeChildren();es(this.panelGroup.children,zi).forEach(e=>{e.drawResizeArea()})}getRowHeader(){return null}getColHeader(){if(!this.columnHeader){const{x:e,width:t,viewportHeight:i,viewportWidth:s}=this.panelBBox;return new io({width:t,height:this.cornerBBox.height,viewportWidth:s,viewportHeight:i,cornerWidth:this.cornerBBox.width,position:{x:e,y:0},nodes:this.getColNodes(),sortParam:this.spreadsheet.store.get("sortParam"),spreadsheet:this.spreadsheet})}return this.columnHeader}getSeriesNumberHeader(){return null}getScrollbarPosition(){const{height:e}=this.getCanvasSize(),t=super.getScrollbarPosition(),i=this.spreadsheet.dataSet.isEmpty()?e-this.scrollBarSize:t.maxY;return Object.assign(Object.assign({},t),{maxY:i})}getSeriesNumberCells(){return this.getDataCells().filter(e=>e.getMeta().valueField===ye.r2)}getContentWidth(){const{colsHierarchy:e}=this.layoutResult;return y(e.width)}getContentHeight(){const{getTotalHeight:e}=this.getViewCellHeights(),{colsHierarchy:t}=this.layoutResult;return y(e()+t.height+T.getHorizontalBorderWidth(this.spreadsheet))}}var Io=i("./node_modules/.pnpm/@antv+g-canvas@2.2.2/node_modules/@antv/g-canvas/dist/index.esm.js");const No=`${Ai.u}-tooltip`,Bo=`${No}-container`,Ao=`${Bo}-show`,Mo=`${Bo}-hide`,Do=15,Ho=10;var ko=i("./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/common/icons/factory.js");class zo{constructor(){this.store=new Map}set(e,t){return this.store.set(e,t)}get(e,t){var i;return null!==(i=this.store.get(e))&&void 0!==i?i:t}clear(){this.store.clear()}size(){return this.store.size}}const Fo={data:[],fields:{rows:[],columns:[],values:[],valueInCols:!0},meta:[],sortParams:[],filterParams:[]},Po=(...e)=>{const t=[...e,(e,t)=>{if((0,a.isArray)(e)&&(0,a.isArray)(t))return t}];return(0,a.mergeWith)({},...t)},jo=(...e)=>{var t;const i=Po(Fo,...e);i.fields=(e=>{const t=["rows","columns","values"].reduce((t,i)=>{const s=e[i],o=(0,a.uniq)(s);return(0,a.isEqual)(o,s)||console.warn(`fields.${i}:[${s}] should be unique`),t[i]=o,t},{});return Object.assign(Object.assign({},e),t)})(i.fields);const s=null===(t=i.fields.rows)||void 0===t?void 0:t.some(e=>!(0,a.isString)(e)),o=(0,a.isEmpty)(i.fields.values);return(s||o)&&(i.fields.valueInCols=!1),i},Wo=(e,t,i)=>{let s;const o=e.split("[&]");if(i)s=[e];else{s=[(0,co.$C)(o[0],o[1])];for(let e=2;e<o.length;e+=1)s.push((0,co.$C)(s[e-2],o[e]))}return(0,a.filter)(t,e=>{var t;return s.includes(null===(t=e.getMeta())||void 0===t?void 0:t.id)})};const Go=e=>[d.B4.META,d.B4.CONTROL].includes(e.key),Vo=e=>e.ctrlKey||e.metaKey,$o=e=>{const t=e.getMeta(),{id:i,colIndex:s,rowIndex:o,rowQuery:n}=t||{};return{id:i,colIndex:s,rowIndex:o,rowQuery:n,type:e instanceof Fi?d.vZ.ROW_CELL:e.cellType}};function Uo(e,t){const i=Math.min(e.rowIndex,t.rowIndex),s=Math.max(e.rowIndex,t.rowIndex);return{start:{rowIndex:i,colIndex:Math.min(e.colIndex,t.colIndex)},end:{rowIndex:s,colIndex:Math.max(e.colIndex,t.colIndex)}}}const Yo=(e,t)=>{const{facet:i}=e.spreadsheet,{colHeader:s,rowHeader:o}=e.getSelectedCellHighlight();s&&e.updateCells(i.getColCells()),o&&e.updateCells(i.getRowCells()),t()},Xo=e=>(0,a.mapValues)((0,a.groupBy)(e,"type"),e=>(0,a.map)(e,"id")),Zo=e=>{var t;const i=e.store.get("visibleActionIcons"),s=e.interaction.getInteractedCells(),o=e.interaction.getState().cells;if((0,a.isEmpty)(s)&&(0,a.isEmpty)(o)&&(0,a.isEmpty)(i))return!1;if((0,a.forEach)(i,e=>{e.toggleVisibility(!1)}),e.store.set("visibleActionIcons",[]),(0,a.forEach)(s,e=>{e.hideInteractionShape()}),e.interaction.resetState(),null===(t=e.options.interaction)||void 0===t?void 0:t.selectedCellsSpotlight){const t=e.interaction.getUnSelectedDataCells()||[];(0,a.forEach)(t,e=>{e.clearUnselectedState()})}return!0},qo=e=>e&&"appendInfo"in e?e.appendInfo:{};const Ko=e=>Object.assign(Object.assign({},null==e?void 0:e.colQuery),null==e?void 0:e.rowQuery),Jo=(e,t)=>{if(!e)return;const{style:i,className:s=[],visible:o,dark:n=!1}=t;if(i&&Object.assign(e.style,i),s.length){const t=s.filter(Boolean);e.classList.add(...t)}e.classList.toggle(Ao,o),e.classList.toggle(Mo,!o),e.classList.toggle(Hi,n)},Qo=(e,{data:t,field:i,valueField:s,useCompleteDataForFormatter:o=!0,targetCell:n})=>{var r,l;const d=null===(r=null==e?void 0:e.dataSet)||void 0===r?void 0:r.getFieldName(i),c=e.isCustomRowFields()&&(null==e?void 0:e.dataSet.getCustomRowFieldName(n))||d,h=null===(l=null==e?void 0:e.dataSet)||void 0===l?void 0:l.getFieldFormatter(i),u=ci.getFieldValue(t,i),p=(0,a.isObject)(u)?null:u;return{name:c,value:h(s||p,o?t:void 0)}},en=(e,t,i)=>{const s=(0,a.filter)((0,a.concat)([],t),e=>e!==ye.GJ&&ci.getFieldValue(i,e));return(0,a.map)(s,t=>Qo(e,{data:i,field:t,useCompleteDataForFormatter:!1}))},tn=(e,t,i=!0)=>{const s=[];return(0,a.forEach)(t,(t,o)=>{(0,a.forEach)(e,e=>{i||-1===e.colIndex?i&&-1!==e.rowIndex&&s.push([e.rowIndex,o]):s.push([o,e.colIndex])})}),s},sn=(e,t,i)=>{const{facet:s}=e,o=e=>{if(!e)return!1;const i=null==t?void 0:t.getMeta(),o=null==i?void 0:i.isTotals,n=(null==t?void 0:t.cellType)===d.vZ.COL_CELL;if(!n&&!((null==t?void 0:t.cellType)===d.vZ.ROW_CELL))return!1;const r=s.getColNodeByIndex(e.colIndex),l=s.getRowNodeByIndex(e.rowIndex);return!o&&(null==e?void 0:e.isTotals)||o&&(n?null==l?void 0:l.isTotals:null==r?void 0:r.isTotals)};if(i){const t=(e=>{var t;const i=e.facet.getRowLeafNodes(),s=e.facet.getColLeafNodes(),{nodes:o=[],cells:n=[]}=e.interaction.getState(),r=null===(t=null==n?void 0:n[0])||void 0===t?void 0:t.type,l=e.isHierarchyTreeType()?o:o.filter(e=>null==e?void 0:e.isLeaf);return r===d.vZ.COL_CELL?tn(l,i,!1):r===d.vZ.ROW_CELL?tn(l,s):[]})(e);return(0,a.compact)((0,a.map)(t,([e,t])=>{const i=s.getCellMeta(e,t);if(!o(i))return(null==i?void 0:i.data)||Ko(i)}))}return e.interaction.getCells().filter(e=>{const t=s.getCellMeta(e.rowIndex,e.colIndex);return!o(t)}).map(e=>{const t=s.getCellMeta(e.rowIndex,e.colIndex);return(null==t?void 0:t.data)||Ko(t)})},on=e=>{const{spreadsheet:t,targetCell:i,options:s={}}=e,o=[],n={};if(t.isTableMode()&&(null==s?void 0:s.onlyShowCellText)){const e=null==i?void 0:i.getMeta();return[{selectedData:(null==e?void 0:e.field)?t.dataSet.getCellMultiData({query:{field:e.field}}):[t.dataSet.getRowData(e)],name:"",value:""}]}const r=sn(t,i,s.onlyShowCellText);return(0,a.forEach)(r,e=>{var t;const i=null==e?void 0:e[ye.GJ];n[i]?null===(t=n[i])||void 0===t||t.push(e):n[i]=[e]}),(0,a.mapKeys)(n,(e,r)=>{var l,d;const c=t.isCustomHeaderFields()?null==t?void 0:t.dataSet.getCustomRowFieldName(i):((e,t,i)=>{var s;if(i)return(0,Gi.Ru)("总计");const o=null===(s=null==e?void 0:e.dataSet)||void 0===s?void 0:s.getFieldName(t);return o&&"undefined"!==o?o:""})(t,r,null==s?void 0:s.isTotals);let h="",u="";if((0,a.every)(e,e=>hi((0,a.get)(e,ye.nj)))){const{placeholder:e}=t.options,i=(0,fe.Lv)(n,e);h=i,u=i}else{const i=null===(l=null==t?void 0:t.dataSet)||void 0===l?void 0:l.getFieldFormatter(r),s=gi(e,ye.nj);u=s,h=null!==(d=null==i?void 0:i(s,e))&&void 0!==d?d:parseFloat(s.toPrecision(16))}o.push({selectedData:e,name:c||"",value:h,originValue:u})}),t.isCustomHeaderFields()?(e=>{const t=(0,a.groupBy)(e,"name");return Object.keys(t||{}).map(e=>{const i=t[e],s=(0,a.flatMap)(i,e=>e.selectedData),o=i.filter(e=>(0,a.isNumber)(e.value));return{name:e,selectedData:s,value:(0,a.isEmpty)(o)?null:(0,a.sumBy)(o,"value")}})})(o):o},nn=e=>{var t;const{spreadsheet:i,cellInfos:s=[],options:o={},targetCell:n}=e;let r=null,l=[],d=null,c=null;const h=i.dataSet.getCustomFieldDescription(n),u=s[0]||{};if(null==o?void 0:o.hideSummary)if(o.onlyShowCellText){const e=ci.getFieldValue(u,"value"),s=ci.getFieldValue(u,"valueField"),n=null===(t=null==i?void 0:i.dataSet)||void 0===t?void 0:t.getFieldFormatter(s),l=null==n?void 0:n(e),d=o.enableFormat?i.dataSet.getFieldName(e)||l:i.dataSet.getFieldName(s);r=(0,a.isString)(d)?d:""}else d=((e,t,i)=>{var s,o,n,r;const{isTotals:l}=i||{};let d=[],c=[];if(t){const i=null===(o=null===(s=null==e?void 0:e.dataSet)||void 0===s?void 0:s.fields)||void 0===o?void 0:o.columns,l=null===(r=null===(n=null==e?void 0:e.dataSet)||void 0===n?void 0:n.fields)||void 0===r?void 0:r.rows;d=en(e,L(i||[]),t),c=en(e,l,t)}return(0,a.isEmpty)(d)&&(0,a.isEmpty)(c)&&l&&(d=[{value:(0,Gi.Ru)("总计")}]),{cols:d,rows:c}})(i,u,o),c=((e,t,i,s)=>{if(!t)return[];const{isTotals:o}=i,n=t[ye.GJ],r=[];return r.push(Qo(e,o?{data:t,field:n,targetCell:s,valueField:t[ye.nj]}:{data:t,field:n,targetCell:s})),r})(i,u,o,n);else l=on({spreadsheet:i,options:o,targetCell:n});const{interpretation:p,infos:g,tips:m}=u||{};return{name:r,summaries:l,interpretation:p,infos:g,tips:m,headInfo:d,details:c,description:h}},rn=e=>{if(!e.interaction.isSelectedState())return[];const{valueInCols:t}=e.dataCfg.fields;return e.interaction.getCells().reduce((i,s)=>{const o=e.facet.getCellMeta(null==s?void 0:s.rowIndex,null==s?void 0:s.colIndex),n=Ko(o);if((0,a.isEmpty)(o)||(0,a.isEmpty)(n))return[];const r=Object.assign(Object.assign({},n),{colIndex:t?null==o?void 0:o.colIndex:null,rowIndex:t?null:null==o?void 0:o.rowIndex});return i.find(e=>(0,a.isEqual)(r,e))||i.push(r),i},[])},ln=(e,t)=>{var i;if(!t||!e)return null;const{options:s,interaction:o}=e,n=null===(i=e.getCellType)||void 0===i?void 0:i.call(e,null==t?void 0:t.target),r=(0,a.last)(o.getInteractedCells());return((e={},t)=>{const i=t=>Po(e,t),{colCell:s,rowCell:o,dataCell:n,cornerCell:r}=e;return t===d.vZ.COL_CELL?i(s):t===d.vZ.ROW_CELL?i(o):t===d.vZ.DATA_CELL?i(n):t===d.vZ.CORNER_CELL?i(r):Object.assign({},e)})(s.tooltip,n||(null==r?void 0:r.cellType))};class an{constructor(e){this.isLinkFieldText=e=>{const t=this.getCellAppendInfo(e);return null==t?void 0:t.isLinkFieldText},this.spreadsheet=e,this.bindEvents()}getCellAppendInfo(e){return qo(e)}getTooltipOperator(e,t=[]){const i=this.spreadsheet.getCell(e.target),{operation:s}=ln(this.spreadsheet,e);return((e,t)=>{var i;const{defaultMenus:s=[],cell:o}=t,n=(e=[])=>e.filter(e=>{var t;return(0,a.isFunction)(e.visible)?e.visible(o):null===(t=e.visible)||void 0===t||t}).map(e=>(e.children&&(e.children=n(e.children)),e)),r=n(null===(i=null==e?void 0:e.menu)||void 0===i?void 0:i.items);return{menu:Object.assign(Object.assign({},null==e?void 0:e.menu),{items:(0,a.compact)([...s,...r])})}})(s,{defaultMenus:t,cell:i})}reset(){}}class dn extends an{bindEvents(){this.bindDataCellClick()}bindDataCellClick(){this.spreadsheet.on(m.DATA_CELL_CLICK,e=>{var t,i;e.stopPropagation();const{interaction:s}=this.spreadsheet;if(s.clearHoverTimer(),s.hasIntercepts([d.fR.CLICK]))return;if(this.isLinkFieldText(e.target))return void this.emitLinkFieldClickEvent(e);const o=this.spreadsheet.getCell(e.target),n=o.getMeta();n&&(s.addIntercepts([d.fR.HOVER]),s.isSelectedCell(o)?(1===e.detail||1===(null===(t=e.nativeEvent)||void 0===t?void 0:t.detail)||1===(null===(i=e.originalEvent)||void 0===i?void 0:i.detail)||me())&&(s.reset(),s.emitSelectEvent({event:e,targetCell:o,interactionName:d.oB.DATA_CELL_CLICK})):(s.changeState({cells:[$o(o)],stateName:d.xT.SELECTED,onUpdateCells:Yo}),s.emitSelectEvent({event:e,targetCell:o,interactionName:d.oB.DATA_CELL_CLICK,cells:[o]}),this.showTooltip(e,n),s.updateDataCellRelevantHeaderCells(d.xT.SELECTED,n),this.spreadsheet.emit(m.DATA_CELL_CLICK_TRIGGERED_PRIVATE,o)))})}showTooltip(e,t){const{data:i,isTotals:s=!1,fieldValue:o,valueField:n}=t,r=this.spreadsheet.isTableMode(),l=[(r?Object.assign(Object.assign({},i),{value:o,valueField:n}):i)||Object.assign(Object.assign({},t.rowQuery),t.colQuery)],a=this.getTooltipOperator(e);this.spreadsheet.showTooltipWithInfo(e,l,{isTotals:s,operator:a,hideSummary:!0,onlyShowCellText:r})}emitLinkFieldClickEvent(e){const{meta:t}=this.getCellAppendInfo(e.target),{valueField:i,data:s}=t;this.spreadsheet.emit(m.GLOBAL_LINK_FIELD_JUMP,{meta:t,field:i,record:Object.assign({rowIndex:null==t?void 0:t.rowIndex},s)})}}class cn extends an{constructor(){super(...arguments),this.isMultiSelection=!1,this.handleRowColClick=e=>{if(e.stopPropagation(),this.isLinkFieldText(e.target))return;const{interaction:t,options:i}=this.spreadsheet,s=this.spreadsheet.getCell(e.target);if(s instanceof Us)return;const{multiSelection:o}=i.interaction,n=!(!o||!this.isMultiSelection);t.changeCell({event:e,cell:s,isMultiSelection:n,interactionName:n?s.cellType===d.vZ.ROW_CELL?d.oB.ROW_CELL_MULTI_SELECTION:d.oB.COL_CELL_MULTI_SELECTION:s.cellType===d.vZ.ROW_CELL?d.oB.ROW_CELL_CLICK:d.oB.COL_CELL_CLICK,scrollIntoView:!1})&&this.showTooltip(e)},this.getHideColumnField=e=>{var t;return(null===(t=e.extra)||void 0===t?void 0:t.isCustomNode)?e.id:this.spreadsheet.isTableMode()?e.field:e.id}}bindEvents(){this.bindKeyboardDown(),this.bindKeyboardUp(),this.bindColCellClick(),this.bindRowCellClick(),this.bindTableColExpand(),this.bindMouseMove()}reset(){this.isMultiSelection=!1,this.spreadsheet.interaction.removeIntercepts([d.fR.CLICK])}bindKeyboardDown(){this.spreadsheet.on(m.GLOBAL_KEYBOARD_DOWN,e=>{Go(e)&&(this.isMultiSelection=!0)})}bindKeyboardUp(){this.spreadsheet.on(m.GLOBAL_KEYBOARD_UP,e=>{Go(e)&&this.reset()})}bindMouseMove(){this.spreadsheet.on(m.GLOBAL_MOUSE_MOVE,e=>{this.isMultiSelection&&!Vo(e)&&this.reset()})}bindRowCellClick(){this.spreadsheet.on(m.ROW_CELL_CLICK,e=>{this.handleRowColClick(e)})}bindColCellClick(){this.spreadsheet.on(m.COL_CELL_CLICK,e=>{this.handleRowColClick(e)})}showTooltip(e){const{operation:t,enable:i}=ln(this.spreadsheet,e);if(!i)return;const{interaction:s}=this.spreadsheet,o=s.isSelectedState()?(n=s.getActiveCells(),(0,a.map)(n,e=>{const t=e.getMeta();return(0,a.assign)({},t.query||{},(0,a.pick)(t,["colIndex","rowIndex"]))})):[];var n;const r=this.getHeaderTooltipOperator(e,t);this.spreadsheet.showTooltipWithInfo(e,o,{onlyShowCellText:!0,operator:r})}getHeaderTooltipOperator(e,t){const i=this.spreadsheet.getCell(e.target),s=i.getMeta(),o=i.cellType===d.vZ.COL_CELL,n=1===this.spreadsheet.facet.getColLeafNodes().length,r={key:"hiddenColumns",label:(0,Gi.Ru)("隐藏"),icon:"EyeOutlined"},l=o&&!n&&s.isLeaf&&t.hiddenColumns,a=Object.assign(Object.assign({},r),{onClick:()=>{this.hideSelectedColumns()}});return this.getTooltipOperator(e,l?[a]:[])}bindTableColExpand(){this.spreadsheet.on(m.COL_CELL_EXPANDED,(e,t)=>{this.handleExpandIconClick(e,t)})}hideSelectedColumns(){return(0,A.sH)(this,void 0,void 0,function*(){const{interaction:e}=this.spreadsheet,t=e.getActiveCells().map(e=>e.getMeta()).map(this.getHideColumnField);yield k(this.spreadsheet,t,!0)})}handleExpandIconClick(e,t){return(0,A.sH)(this,void 0,void 0,function*(){const i=this.spreadsheet.store.get("hiddenColumnsDetail",[]),{hideColumnNodes:s=[]}=(0,a.findLast)(i,({displaySiblingNode:i})=>z(i,e.id,t))||{},{hiddenColumnFields:o}=this.spreadsheet.options.interaction,n=s.map(this.getHideColumnField),r=(0,a.difference)(o,n),l=i.filter(({displaySiblingNode:i})=>!z(i,e.id,t));this.spreadsheet.setOptions({interaction:{hiddenColumnFields:r}}),this.spreadsheet.store.set("hiddenColumnsDetail",l),this.spreadsheet.interaction.reset(),yield this.spreadsheet.render({reloadData:!1,rebuildHiddenColumnsDetail:!1})})}}class hn extends an{constructor(){super(...arguments),this.getCellData=e=>{var t,i;const s=e.getHeadLeafChild(),o=this.spreadsheet.dataSet.getCellMultiData({query:null==s?void 0:s.query})[0],n=ci.getFieldValue(o);return Object.assign(Object.assign({},n),{rowIndex:null!==(t=e.rowIndex)&&void 0!==t?t:null==s?void 0:s.rowIndex,colIndex:null!==(i=e.colIndex)&&void 0!==i?i:null==s?void 0:s.colIndex})}}bindEvents(){this.bindRowCellClick(),this.bindColCellClick()}onHeaderCellClick(e){if(this.spreadsheet.interaction.hasIntercepts([d.fR.CLICK]))return;if(!this.isLinkFieldText(e.target))return;const{meta:t}=this.getCellAppendInfo(e.target),i=t.field,s=this.getCellData(t);this.spreadsheet.emit(m.GLOBAL_LINK_FIELD_JUMP,{field:i,meta:t,record:s})}bindRowCellClick(){this.spreadsheet.on(m.ROW_CELL_CLICK,e=>{this.onHeaderCellClick(e)})}bindColCellClick(){this.spreadsheet.on(m.COL_CELL_CLICK,e=>{this.onHeaderCellClick(e)})}}class un extends an{bindEvents(){this.bindDataCellClick()}bindDataCellClick(){this.spreadsheet.on(m.MERGED_CELLS_CLICK,e=>{e.stopPropagation();const{interaction:t}=this.spreadsheet;t.hasIntercepts([d.fR.CLICK])||t.addIntercepts([d.fR.HOVER])})}}const pn=(e,t)=>{const i=window.matchMedia("(orientation: portrait)").matches,s=i?"90vw":"90vh",o=i?"60vw":"60vh";Object.assign(e.style,Object.assign({maxWidth:s,maxHeight:s,minHeight:o,minWidth:o,objectFit:"contain"},t))},gn=e=>(0,A.sH)(void 0,void 0,void 0,function*(){const t=e.getRenderer(),{type:i,prepareText:s}=t,o=yield J(s,e.getFieldValue().toString());if(!1===t.clickToPreview||![Y.IMAGE,Y.VIDEO].includes(t.type))return;const n=e.getStyle("preview"),r=(e=>{const t=document.createElement("div");return Object.assign(t.style,Object.assign({width:"100vw",height:"100vh",position:"fixed",top:"0",left:"0",backgroundColor:"rgba(30, 30, 30, 0.5)",display:"flex",justifyContent:"center",alignItems:"center",overflow:"hidden",zIndex:"9999",cursor:"pointer",touchAction:"none",backdropFilter:"blur(2px)",pointerEvents:"auto"},e)),t.className=`${Ai.u}-preview-overlay`,t})(null==n?void 0:n.overlay),l=i===Y.IMAGE?yield(e=>(0,A.sH)(void 0,void 0,void 0,function*(){const{src:t,mediaContainerStyle:i,config:s}=e,o=yield q({src:t,fallback:null==s?void 0:s.fallback,timeout:null==s?void 0:s.timeout});return pn(o,i),o.alt="preview",o}))({src:o,mediaContainerStyle:null==n?void 0:n.mediaContainer,config:t}):((e,t)=>{const i=document.createElement("video");return i.src=e,i.controls=!0,i.preload="auto",i.playsInline=!0,i.setAttribute("webkit-playsinline","true"),i.setAttribute("playsinline","true"),pn(i,t),i})(o,null==n?void 0:n.mediaContainer),a=e=>{e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation(),e.target===r&&(document.body.removeChild(r),l.remove(),document.body.style.overflow="auto")};setTimeout(()=>{["click","touchstart","touchend"].forEach(e=>{r.addEventListener(e,a,{passive:!1})})},500),document.body.style.overflow="hidden",r.appendChild(l),document.body.appendChild(r)});class mn extends an{bindEvents(){[m.DATA_CELL_CLICK,m.ROW_CELL_CLICK,m.COL_CELL_CLICK].forEach(e=>{this.spreadsheet.on(e,e=>this.bindMediaCellClick(e))})}bindMediaCellClick(e){var t,i,s,o;const n=this.spreadsheet.getCell(e.target),r=null===(i=null===(t=null==n?void 0:n.getRenderer)||void 0===t?void 0:t.call(n))||void 0===i?void 0:i.type;r===Y.IMAGE&&"image"!==(0,a.get)(e.target,"nodeName")||r===Y.VIDEO&&(0,a.get)(e.target,"name")!==X||(null===(o=null===(s=null==n?void 0:n.getRenderer)||void 0===s?void 0:s.call(n))||void 0===o?void 0:o.type)&&(this.spreadsheet.isPivotMode()||n.cellType!==d.vZ.COL_CELL)&&(this.spreadsheet.emit(m.GLOBAL_PREVIEW_CLICK,e),gn(n))}}class vn extends an{bindEvents(){this.bindCornerCellClick()}bindCornerCellClick(){this.spreadsheet.on(m.CORNER_CELL_CLICK,e=>{const t=this.spreadsheet.getCell(e.target);if(!t)return;const i=t.getMeta();switch(null==i?void 0:i.cornerType){case gs.Q.Row:this.onRowCornerClick(null==i?void 0:i.field,e);break;case gs.Q.Col:this.onColCornerClick(null==i?void 0:i.field,e);break;case gs.Q.Series:this.onSeriesCornerClick(null==i?void 0:i.field,e)}})}onRowCornerClick(e,t){const i=this.getSelectedRowNodes(e);this.selectCells(i,t)}onColCornerClick(e,t){const i=this.getSelectedColNodes(e);this.selectCells(i,t)}onSeriesCornerClick(e,t){const i=this.spreadsheet.facet.getSeriesNumberNodes();this.selectCells(i,t)}getSelectedRowNodes(e){const{facet:t}=this.spreadsheet;if(this.spreadsheet.isHierarchyTreeType())return t.getRowNodes();if(!this.spreadsheet.isCustomRowFields())return t.getRowNodesByField(e);const i=t.getRowNodesByField(e)[0];return t.getRowNodes(null==i?void 0:i.level)}getSelectedColNodes(e){const{facet:t}=this.spreadsheet;if(!this.spreadsheet.isCustomColumnFields())return t.getColNodesByField(e);const i=t.getColNodesByField(e)[0];return t.getColNodes(null==i?void 0:i.level)}getCellMetas(e,t){return e.map(e=>({id:e.id,colIndex:-1,rowIndex:-1,type:t}))}emitSelectEvent(e,t){this.spreadsheet.interaction.emitSelectEvent({event:e,targetCell:t,interactionName:d.oB.CORNER_CELL_CLICK})}selectCells(e,t){var i;const{interaction:s}=this.spreadsheet,o=null===(i=e[0])||void 0===i?void 0:i.belongsCell,n=this.getCellMetas(e,null==o?void 0:o.cellType),r=this.spreadsheet.getCell(t.target);if(o&&s.isSelectedCell(o))return s.reset(),void this.emitSelectEvent(t,r);(0,a.isEmpty)(e)||(0,a.isEmpty)(n)||(s.addIntercepts([d.fR.HOVER]),s.changeState({cells:n,stateName:d.xT.SELECTED}),s.highlightNodes(e,d.xT.SELECTED),null==r||r.updateByState(d.xT.SELECTED),this.showTooltip(t),this.emitSelectEvent(t,r))}showTooltip(e){const t=this.spreadsheet.interaction.getActiveCells(),i=this.getTooltipOperator(e);this.spreadsheet.showTooltipWithInfo(e,[],{operator:i,data:{summaries:[{selectedData:t,name:"",value:null}]}})}}class fn extends an{bindEvents(){this.bindDataCellHover(),this.bindHeaderCellHover()}changeStateToHoverFocus(e,t){var i;if(!e)return;const s=e.getMeta(),{interaction:o}=this.spreadsheet,{interaction:n}=this.spreadsheet.options,{hoverFocus:r}=n;o.clearHoverTimer();const l=()=>{if(o.hasIntercepts([d.fR.HOVER]))return;o.changeState({cells:[$o(e)],stateName:d.xT.HOVER_FOCUS});const i=this.spreadsheet.isTableMode(),r={isTotals:s.isTotals,hideSummary:!0,onlyShowCellText:i};(null==n?void 0:n.hoverHighlight)&&o.updateDataCellRelevantHeaderCells(d.xT.HOVER,s),this.spreadsheet.emit(m.DATA_CELL_HOVER_TRIGGERED_PRIVATE,e);const l=this.getCellData(s,i);this.spreadsheet.showTooltipWithInfo(t,l,r)},c=(0,a.isBoolean)(r)?800:null!==(i=null==r?void 0:r.duration)&&void 0!==i?i:800;if(0===c)l();else{const e=window.setTimeout(()=>l(),c);o.setHoverTimer(e)}}handleHeaderHover(e){var t;const i=this.spreadsheet.getCell(e.target);if((0,a.isEmpty)(i))return;const{interaction:s,facet:o}=this.spreadsheet;s.clearHoverTimer(),s.isActiveCell(i)||(s.changeState({cells:[$o(i)],stateName:d.xT.HOVER}),i.update(),this.showEllipsisTooltip(e,i),null===(t=o.centerFrame)||void 0===t||t.toFront())}showEllipsisTooltip(e,t){if(!t||!t.isTextOverflowing())return void this.spreadsheet.hideTooltip();const i=t.getMeta(),s={isTotals:i.isTotals,hideSummary:!0,onlyShowCellText:!0,enableFormat:!0},o=this.getCellData(i,s.onlyShowCellText);this.spreadsheet.showTooltipWithInfo(e,o,s)}getCellData(e={},t){const{data:i,query:s,value:o,field:n,fieldValue:r,valueField:l,rowQuery:a,colQuery:d}=e,c=i;return t?[Object.assign(Object.assign({},s),{value:o||r,valueField:n||l})]:[c||Object.assign(Object.assign({},a),d)]}bindDataCellHover(){this.spreadsheet.on(m.DATA_CELL_HOVER,e=>{const t=this.spreadsheet.getCell(e.target);if((0,a.isEmpty)(t))return;const{interaction:i,options:s}=this.spreadsheet;if(i.isActiveCell(t))return;const{interaction:o}=s,n=null==t?void 0:t.getMeta();i.changeState({cells:[$o(t)],stateName:d.xT.HOVER}),(null==o?void 0:o.hoverHighlight)&&i.updateDataCellRelevantHeaderCells(d.xT.HOVER,n),(null==o?void 0:o.hoverFocus)&&this.changeStateToHoverFocus(t,e),this.spreadsheet.emit(m.DATA_CELL_HOVER_TRIGGERED_PRIVATE,t)})}bindHeaderCellHover(){[m.ROW_CELL_HOVER,m.COL_CELL_HOVER,m.CORNER_CELL_HOVER].forEach(e=>{this.spreadsheet.on(e,e=>{this.handleHeaderHover(e)})})}}class Cn extends an{constructor(){super(...arguments),this.displayedCells=[],this.brushRangeCells=[],this.brushSelectionStage=d.Ri.UN_DRAGGED,this.brushSelectionMinimumMoveDistance=5,this.scrollAnimationComplete=!0,this.mouseMoveDistanceFromCanvas=0,this.setMoveDistanceFromCanvas=(e,t,i)=>{let s=0;if(t&&(s=e.x),i){const i=e.y;s=t?Math.max(i,s):i}this.mouseMoveDistanceFromCanvas=Math.abs(s)},this.formatBrushPointForScroll=(e,t=!1)=>{var i,s,o,n;const{x:r,y:l}=e,{facet:a}=this.spreadsheet,{minX:d,maxX:c}=t?a.cornerBBox:a.panelBBox,{minY:h,maxY:u}=a.panelBBox;let p=(null===(i=this.endBrushPoint)||void 0===i?void 0:i.x)+r,g=(null===(s=this.endBrushPoint)||void 0===s?void 0:s.y)+l,m=t?!!a.hRowScrollBar:!!a.hScrollBar,v=!!a.vScrollBar;const f=null===(n=null===(o=a.vScrollBar)||void 0===o?void 0:o.getBBox())||void 0===n?void 0:n.width;return p>c?p=c-f-2:p<d?p=d+2:m=!1,g>u?g=u-2:g<=h?g=h+2:v=!1,{x:{value:p,needScroll:m},y:{value:g,needScroll:v}}},this.autoScrollIntervalId=null,this.rectanglesIntersect=(e,t)=>e.maxX>t.minX&&e.minX<t.maxX&&e.minY<t.maxY&&e.maxY>t.minY,this.autoScrollConfig=(0,a.cloneDeep)(d.hu),this.validateYIndex=e=>{var t,i;const{facet:s}=this.spreadsheet,o=s.frozenGroupAreas;let n=0;const r=null===(t=null==o?void 0:o.frozenRow)||void 0===t?void 0:t.range;if((null==r?void 0:r[1])&&(n=r[1]+1),e<n)return null;let l=s.getCellRange().end;const a=null===(i=null==o?void 0:o.frozenTrailingRow)||void 0===i?void 0:i.range;return(null==a?void 0:a[0])&&(l=a[0]-1),e>l?null:e},this.validateXIndex=e=>{const{facet:t}=this.spreadsheet,i=t.frozenGroupAreas;let o=0;const n=i[s.Col].range;if((null==n?void 0:n[1])&&(o=n[1]+1),e<o)return null;let r=t.getColLeafNodes().length-1;const l=i[s.TrailingCol].range;return(null==l?void 0:l[0])&&(r=l[0]-1),e>r?null:e},this.adjustNextColIndexWithFrozen=(e,t)=>{const{facet:i}=this.spreadsheet,s=i.getColLeafNodes().length,{colCount:o,trailingColCount:n}=i.getFrozenOptions(),r=i.panelScrollGroupIndexes;return o>0&&t===d.Dh.SCROLL_UP&&x(e,o)?r[0]:n>0&&t===d.Dh.SCROLL_DOWN&&_(e,n,s)?r[1]:e},this.adjustNextRowIndexWithFrozen=(e,t)=>{const{facet:i}=this.spreadsheet,s=i.getCellRange(),{rowCount:o,trailingRowCount:n}=i.getFrozenOptions(),r=i.panelScrollGroupIndexes;return o>0&&t===d.Dh.SCROLL_UP&&S(e,s.start,o)?r[2]:n>0&&t===d.Dh.SCROLL_DOWN&&b(e,s.end,n)?r[3]:e},this.getWillScrollRowIndexDiff=e=>e===d.Dh.SCROLL_DOWN?d.Wd.SCROLL_DOWN:d.Wd.SCROLL_UP,this.getDefaultWillScrollToRowIndex=e=>{const t=this.adjustNextRowIndexWithFrozen(this.endBrushPoint.rowIndex,e)+this.getWillScrollRowIndexDiff(e);return this.validateYIndex(t)},this.getWillScrollToRowIndex=e=>this.getDefaultWillScrollToRowIndex(e),this.getNextScrollDelta=e=>{const{scrollX:t=0,scrollY:i=0}=this.spreadsheet.facet.getScrollOffset();let o=0,n=0;if(e.y.scroll){const t=e.y.value>0?d.Dh.SCROLL_DOWN:d.Dh.SCROLL_UP,o=this.getWillScrollToRowIndex(t);if((0,a.isNil)(o))n=0;else{const e=((e,t,i)=>{const{facet:o}=i,{getCellOffsetY:n}=o.viewCellHeights,{viewportHeight:r}=o.panelBBox,l=n(e+1);if((0,a.isNil)(l))return 0;const c=null==o?void 0:o.frozenGroupAreas,h=c[s.Row].height,u=c[s.TrailingRow].height;return t===d.Dh.SCROLL_UP?n(e)-h:l-(r-u)})(o,t,this.spreadsheet)-i;n=(0,a.isNil)(e)||Number.isNaN(e)?0:e}}if(e.x.scroll){const i=e.x.value>0?d.Dh.SCROLL_DOWN:d.Dh.SCROLL_UP,n=this.adjustNextColIndexWithFrozen(this.endBrushPoint.colIndex,i),r=this.validateXIndex(n+(e.x.value>0?1:-1));o=(0,a.isNil)(r)?0:((e,t,i)=>{const{facet:o}=i,{viewportWidth:n}=o.panelBBox,r=null==o?void 0:o.frozenGroupAreas,l=r[s.Col].width,a=r[s.TrailingCol].width,c=o.getColLeafNodes()[e];return t===d.Dh.SCROLL_UP?c.x-l:c.x+c.width-(n-a)})(r,i,this.spreadsheet)-t}return{x:o,y:n}},this.onScrollAnimationComplete=()=>{this.scrollAnimationComplete=!0,this.brushSelectionStage!==d.Ri.UN_DRAGGED&&this.renderPrepareSelected(this.endBrushPoint)},this.autoScroll=(e=!1)=>{if(this.brushSelectionStage===d.Ri.UN_DRAGGED||!this.scrollAnimationComplete)return;const t=this.autoScrollConfig,i=this.spreadsheet.facet.getScrollOffset(),s=e?"rowHeaderOffsetX":"offsetX",o={rowHeaderOffsetX:{value:i.rowHeaderScrollX,animate:!0},offsetX:{value:i.scrollX,animate:!0},offsetY:{value:i.scrollY,animate:!0}},{x:n,y:r}=this.getNextScrollDelta(t);if(0===r&&0===n)return void this.clearAutoScroll();if(t.y.scroll&&(o.offsetY.value+=r),t.x.scroll){const e=o[s];e.value+=n,e.value<0&&(e.value=0)}this.scrollAnimationComplete=!1;const l=Math.max(16,300-this.mouseMoveDistanceFromCanvas*(t.x.scroll?1:3));this.spreadsheet.facet.scrollWithAnimation(o,l,this.onScrollAnimationComplete)},this.handleScroll=(0,a.throttle)((e,t,i=!1)=>{if(this.brushSelectionStage===d.Ri.UN_DRAGGED)return;const{x:{value:s,needScroll:o},y:{value:n,needScroll:r}}=this.formatBrushPointForScroll({x:e,y:t},i),l=this.autoScrollConfig;r&&(l.y.value=t,l.y.scroll=!0),o&&(l.x.value=e,l.x.scroll=!0),this.setMoveDistanceFromCanvas({x:e,y:t},o,r),this.renderPrepareSelected({x:s,y:n}),(r||o)&&(this.clearAutoScroll(),this.autoScroll(i),this.autoScrollIntervalId=setInterval(()=>{this.autoScroll(i)},16))},30),this.clearAutoScroll=()=>{this.autoScrollIntervalId&&(clearInterval(this.autoScrollIntervalId),this.autoScrollIntervalId=null,this.resetScrollDelta())},this.onUpdateCells=(e,t)=>t(),this.showPrepareSelectedCells=()=>{this.brushRangeCells=this.getBrushRangeCells(),this.spreadsheet.interaction.changeState({cells:(0,a.map)(this.brushRangeCells,e=>$o(e)),stateName:d.xT.PREPARE_SELECT,force:!0,onUpdateCells:this.onUpdateCells})},this.renderPrepareSelected=e=>{const{x:t,y:i}=e,s=this.spreadsheet.container.document.elementsFromPointSync(t,i).map(e=>this.spreadsheet.getCell(e)).find(Boolean);if(!s||!(s instanceof Ri||s instanceof ds||s instanceof Ti))return;const{rowIndex:o,colIndex:n}=s.getMeta();this.endBrushPoint={x:t,y:i,rowIndex:o,colIndex:n};const{interaction:r}=this.spreadsheet;r.addIntercepts([d.fR.HOVER]),r.clearStyleIndependent(),this.isValidBrushSelection()&&(this.showPrepareSelectedCells(),this.updatePrepareSelectMask())}}bindEvents(){this.bindMouseDown(),this.bindMouseMove(),this.bindMouseUp()}getPrepareSelectMaskTheme(){var e;return null===(e=this.spreadsheet.theme)||void 0===e?void 0:e.prepareSelectMask}initPrepareSelectMaskShape(){var e;const{foregroundGroup:t}=this.spreadsheet.facet;if(!t)return;null===(e=this.prepareSelectMaskShape)||void 0===e||e.remove();const i=this.getPrepareSelectMaskTheme();this.prepareSelectMaskShape=t.appendChild(new l.rw({style:{width:0,height:0,x:0,y:0,fill:null==i?void 0:i.backgroundColor,fillOpacity:null==i?void 0:i.backgroundOpacity,zIndex:5,visibility:"hidden",pointerEvents:"none"}}))}setBrushSelectionStage(e){this.brushSelectionStage=e}isPointInCanvas(e){const{height:t,width:i}=this.spreadsheet.facet.getCanvasSize(),{minX:s,minY:o}=this.spreadsheet.facet.panelBBox;return(null==e?void 0:e.x)>s&&(null==e?void 0:e.x)<i&&(null==e?void 0:e.y)>o&&(null==e?void 0:e.y)<t}resetDrag(){this.hidePrepareSelectMaskShape(),this.setBrushSelectionStage(d.Ri.UN_DRAGGED)}isValidBrushSelection(){const{start:e,end:t}=this.getBrushRange();return t.x-e.x>this.brushSelectionMinimumMoveDistance||t.y-e.y>this.brushSelectionMinimumMoveDistance}setDisplayedCells(){this.displayedCells=this.spreadsheet.facet.getDataCells()}updatePrepareSelectMask(){const e=this.getBrushRange(),{x:t,y:i}=this.getPrepareSelectMaskPosition(e);this.prepareSelectMaskShape.attr({x:t,y:i,width:e.width,height:e.height}),this.prepareSelectMaskShape.setAttribute("visibility","visible")}hidePrepareSelectMaskShape(){var e;null===(e=this.prepareSelectMaskShape)||void 0===e||e.setAttribute("visibility","hidden")}resetScrollDelta(){this.autoScrollConfig=(0,a.cloneDeep)(d.hu)}getBrushPoint(e){const{scrollY:t,scrollX:i}=this.spreadsheet.facet.getScrollOffset(),s={x:null==e?void 0:e.x,y:null==e?void 0:e.y},o=this.spreadsheet.getCell(e.target),{colIndex:n,rowIndex:r}=o.getMeta();return Object.assign(Object.assign({},s),{rowIndex:r,colIndex:n,scrollY:t,scrollX:i})}getBrushRange(){var e,t,i,s,o,n,r,l;const{scrollX:a=0,scrollY:d=0}=this.spreadsheet.facet.getScrollOffset(),c=Math.min(this.startBrushPoint.rowIndex,null===(e=this.endBrushPoint)||void 0===e?void 0:e.rowIndex),h=Math.max(this.startBrushPoint.rowIndex,null===(t=this.endBrushPoint)||void 0===t?void 0:t.rowIndex),u=Math.min(this.startBrushPoint.colIndex,null===(i=this.endBrushPoint)||void 0===i?void 0:i.colIndex),p=Math.max(this.startBrushPoint.colIndex,null===(s=this.endBrushPoint)||void 0===s?void 0:s.colIndex),g=this.startBrushPoint.x+this.startBrushPoint.scrollX-a,m=this.startBrushPoint.y+this.startBrushPoint.scrollY-d,v=Math.min(g,null===(o=this.endBrushPoint)||void 0===o?void 0:o.x),f=Math.max(g,null===(n=this.endBrushPoint)||void 0===n?void 0:n.x),C=Math.min(m,null===(r=this.endBrushPoint)||void 0===r?void 0:r.y),y=Math.max(m,null===(l=this.endBrushPoint)||void 0===l?void 0:l.y);return{start:{rowIndex:c,colIndex:u,x:v,y:C},end:{rowIndex:h,colIndex:p,x:f,y},width:f-v,height:y-C}}getBrushRangeCells(){return this.setDisplayedCells(),this.displayedCells.filter(e=>{const t=e.getMeta();return this.isInBrushRange(t)})}mouseDown(e){var t;null===(t=null==e?void 0:e.preventDefault)||void 0===t||t.call(e),this.spreadsheet.interaction.hasIntercepts([d.fR.CLICK])||(this.setBrushSelectionStage(d.Ri.CLICK),this.initPrepareSelectMaskShape(),this.setDisplayedCells(),this.startBrushPoint=this.getBrushPoint(e))}addBrushIntercepts(){this.spreadsheet.interaction.addIntercepts([d.fR.DATA_CELL_BRUSH_SELECTION])}bindMouseUp(e=!1){this.spreadsheet.on(m.GLOBAL_MOUSE_UP,t=>{if(this.brushSelectionStage===d.Ri.DRAGGED){if(e&&this.clearAutoScroll(),this.isValidBrushSelection()){this.addBrushIntercepts(),this.updateSelectedCells(t);const e=rn(this.spreadsheet);this.spreadsheet.showTooltipWithInfo(t,e)}this.spreadsheet.interaction.getCurrentStateName()===d.xT.PREPARE_SELECT&&this.spreadsheet.interaction.reset(),this.resetDrag()}else this.resetDrag()}),this.spreadsheet.on(m.GLOBAL_CONTEXT_MENU,()=>{this.brushSelectionStage!==d.Ri.UN_DRAGGED&&(this.spreadsheet.interaction.removeIntercepts([d.fR.HOVER]),this.resetDrag())})}autoBrushScroll(e,t=!1){var i,s;if(this.clearAutoScroll(),!this.isPointInCanvas(e)){const o=(null==e?void 0:e.x)-(null===(i=this.endBrushPoint)||void 0===i?void 0:i.x),n=(null==e?void 0:e.y)-(null===(s=this.endBrushPoint)||void 0===s?void 0:s.y);return this.handleScroll(o,n,t),!0}return!1}emitBrushSelectionEvent(e,t,i){this.spreadsheet.emit(e,t,i),this.spreadsheet.emit(m.GLOBAL_SELECTED,t,i),(0,a.isEmpty)(t)&&this.spreadsheet.interaction.removeIntercepts([d.fR.HOVER])}getVisibleBrushRangeCells(e){return this.brushRangeCells.find(t=>{const i=t.getMeta();return(null==i?void 0:i.id)===e})}isInBrushRange(e){return!1}bindMouseDown(){}bindMouseMove(){}updateSelectedCells(e){}getPrepareSelectMaskPosition(e){return{x:e.start.x,y:e.start.y}}}class yn extends Cn{constructor(){super(...arguments),this.displayedCells=[],this.brushRangeCells=[],this.onUpdateCells=e=>e.updateCells(this.spreadsheet.facet.getColCells())}bindEvents(){this.bindMouseDown(),this.bindMouseMove(),this.bindMouseUp()}bindMouseDown(){this.spreadsheet.on(m.COL_CELL_MOUSE_DOWN,e=>{this.spreadsheet.interaction.getBrushSelection().colCell&&super.mouseDown(e)})}isPointInCanvas(e){const{width:t}=this.spreadsheet.facet.getCanvasSize(),{width:i,minY:s,maxY:o}=this.spreadsheet.facet.cornerBBox;return e.x>=i&&e.x<=t&&e.y>=s&&e.y<=o}bindMouseMove(){this.spreadsheet.on(m.COL_CELL_MOUSE_MOVE,e=>{var t;if(this.brushSelectionStage===d.Ri.UN_DRAGGED)return;this.setBrushSelectionStage(d.Ri.DRAGGED);const i=null===(t=this.spreadsheet.interaction.eventController)||void 0===t?void 0:t.getViewportPoint(e);this.isPointInCanvas(i)&&this.renderPrepareSelected(i)})}setDisplayedCells(){this.displayedCells=this.spreadsheet.facet.getColCells()}isInBrushRange(e){const{start:t,end:i}=this.getBrushRange(),{scrollX:s=0}=this.spreadsheet.facet.getScrollOffset(),o=this.spreadsheet.facet.cornerBBox,{x:n=0,y:r=0,width:l=0,height:a=0}=e;return this.rectanglesIntersect({minX:t.x-o.width+s,minY:t.y,maxX:i.x-o.width+s,maxY:i.y},{minX:n,maxX:n+l,minY:r,maxY:r+a})}updateSelectedCells(e){const{interaction:t,facet:i}=this.spreadsheet;t.changeState({cells:(0,a.map)(this.brushRangeCells,$o),onUpdateCells:e=>{e.updateCells(i.getColCells())},stateName:d.xT.COL_CELL_BRUSH_SELECTED}),this.emitBrushSelectionEvent(m.COL_CELL_BRUSH_SELECTION,this.brushRangeCells,{event:e,targetCell:this.brushRangeCells[0],interactionName:d.oB.COL_CELL_BRUSH_SELECTION})}addBrushIntercepts(){this.spreadsheet.interaction.addIntercepts([d.fR.COL_CELL_BRUSH_SELECTION])}}class wn extends Cn{constructor(){super(...arguments),this.displayedCells=[],this.brushRangeCells=[],this.getSelectedCellMetas=e=>{const{facet:t}=this.spreadsheet,i=[],s=t.getRowLeafNodes(),o=t.getColLeafNodes(),n=(0,a.range)(e.start.rowIndex,e.end.rowIndex+1),r=(0,a.range)(e.start.colIndex,e.end.colIndex+1);return n.forEach(e=>{r.forEach(t=>{const n=String(o[t].id),r=(0,a.isEmpty)(s)?String(e):String(s[e].id);i.push({colIndex:t,rowIndex:e,id:xe(r,n),type:d.vZ.DATA_CELL,rowId:r,colId:n,spreadsheet:this.spreadsheet})})}),i}}bindMouseDown(){this.spreadsheet.on(m.DATA_CELL_MOUSE_DOWN,e=>{this.spreadsheet.interaction.getBrushSelection().dataCell&&(super.mouseDown(e),this.resetScrollDelta())})}bindMouseMove(){this.spreadsheet.on(m.GLOBAL_MOUSE_MOVE,e=>{if(this.brushSelectionStage===d.Ri.UN_DRAGGED)return;this.setBrushSelectionStage(d.Ri.DRAGGED);const t=this.spreadsheet.interaction.eventController.getViewportPoint(e);this.autoBrushScroll(t)||this.renderPrepareSelected(t)})}isInBrushRange(e){const{start:t,end:i}=this.getBrushRange(),{rowIndex:s,colIndex:o}=e;return s>=t.rowIndex&&s<=i.rowIndex&&o>=t.colIndex&&o<=i.colIndex}updateSelectedCells(e){const t=this.getBrushRange(),i=this.getSelectedCellMetas(t);this.spreadsheet.interaction.changeState({cells:i,stateName:d.xT.DATA_CELL_BRUSH_SELECTED,onUpdateCells:Yo});const s=this.getScrollBrushRangeCells(i);this.emitBrushSelectionEvent(m.DATA_CELL_BRUSH_SELECTION,s,{event:e,targetCell:s[0],interactionName:d.oB.DATA_CELL_BRUSH_SELECTION})}getScrollBrushRangeCells(e){return e.map(e=>{const t=this.getVisibleBrushRangeCells(e.id);if(t)return t;const i=this.spreadsheet.facet.getCellMeta(e.rowIndex,e.colIndex);return this.spreadsheet.facet.createDataCell(i)})}bindMouseUp(){super.bindMouseUp(!0)}getPrepareSelectMaskPosition(e){const{minX:t,minY:i}=this.spreadsheet.facet.panelBBox;return{x:Math.max(e.start.x,t),y:Math.max(e.start.y,i)}}}class xn extends Cn{constructor(){super(...arguments),this.displayedCells=[],this.brushRangeCells=[],this.isInBrushRange=e=>{const{start:t,end:i}=this.getBrushRange(),{scrollY:s,rowHeaderScrollX:o}=this.spreadsheet.facet.getScrollOffset(),{cornerBBox:n}=this.spreadsheet.facet,{x:r=0,y:l=0,width:a=0,height:d=0}=e;return this.rectanglesIntersect({minX:t.x+o,minY:t.y-n.height+s,maxX:i.x+o,maxY:i.y-n.height+s},{minX:r,maxX:r+a,minY:l,maxY:l+d})},this.onUpdateCells=e=>e.updateCells(this.spreadsheet.facet.getRowCells()),this.getSelectedRowNodes=()=>this.spreadsheet.facet.getRowNodes().filter(this.isInBrushRange),this.getVisibleRowLeafCellByScrollDirection=e=>{const t=this.spreadsheet.facet.getRowCells();return e===d.Dh.SCROLL_DOWN?(0,a.last)(t):t.find(e=>e.getMeta().isLeaf)},this.getWillScrollToRowIndex=e=>{var t,i;if(!(0,a.isNil)(this.endBrushPoint.rowIndex))return this.getDefaultWillScrollToRowIndex(e);const s=this.getVisibleRowLeafCellByScrollDirection(e),o=(null!==(i=null===(t=null==s?void 0:s.getMeta())||void 0===t?void 0:t.rowIndex)&&void 0!==i?i:0)+this.getWillScrollRowIndexDiff(e);return this.validateYIndex(o)}}bindMouseDown(){this.spreadsheet.on(m.ROW_CELL_MOUSE_DOWN,e=>{this.spreadsheet.interaction.getBrushSelection().rowCell&&super.mouseDown(e)})}isPointInCanvas(e){const{height:t}=this.spreadsheet.facet.getCanvasSize(),{minX:i,height:s,maxX:o}=this.spreadsheet.facet.cornerBBox;return e.x>=i&&e.x<=o&&e.y>=s&&e.y<=t}bindMouseMove(){this.spreadsheet.on(m.GLOBAL_MOUSE_MOVE,e=>{if(this.brushSelectionStage===d.Ri.UN_DRAGGED)return;this.setBrushSelectionStage(d.Ri.DRAGGED);const t=this.spreadsheet.interaction.eventController.getViewportPoint(e);this.autoBrushScroll(t,!0)||this.renderPrepareSelected(t)})}setDisplayedCells(){this.displayedCells=this.spreadsheet.facet.getRowCells()}updateSelectedCells(e){const t=this.getSelectedRowNodes(),i=this.getScrollBrushRangeCells(t),s=(0,a.map)(i,$o);this.spreadsheet.interaction.changeState({cells:s,stateName:d.xT.ROW_CELL_BRUSH_SELECTED,onUpdateCells:this.onUpdateCells}),this.emitBrushSelectionEvent(m.ROW_CELL_BRUSH_SELECTION,i,{event:e,targetCell:i[0],interactionName:d.oB.ROW_CELL_BRUSH_SELECTION})}addBrushIntercepts(){this.spreadsheet.interaction.addIntercepts([d.fR.ROW_CELL_BRUSH_SELECTION])}getScrollBrushRangeCells(e){return e.map(e=>{const t=this.getVisibleBrushRangeCells(e.id);return t||this.spreadsheet.facet.rowHeader.getCellInstance(e)})}getPrepareSelectMaskPosition(e){const{minY:t}=this.spreadsheet.facet.panelBBox;return{x:e.start.x,y:Math.max(e.start.y,t)}}}class _n extends an{constructor(){super(...arguments),this.isMultiSelection=!1}bindEvents(){this.bindKeyboardDown(),this.bindDataCellClick(),this.bindKeyboardUp(),this.bindMouseMove()}reset(){this.isMultiSelection=!1,this.spreadsheet.interaction.removeIntercepts([d.fR.CLICK])}bindKeyboardDown(){this.spreadsheet.on(m.GLOBAL_KEYBOARD_DOWN,e=>{Go(e)&&(this.isMultiSelection=!0,this.spreadsheet.interaction.addIntercepts([d.fR.CLICK]))})}bindKeyboardUp(){this.spreadsheet.on(m.GLOBAL_KEYBOARD_UP,e=>{Go(e)&&this.reset()})}bindMouseMove(){this.spreadsheet.on(m.GLOBAL_MOUSE_MOVE,e=>{this.isMultiSelection&&!Vo(e)&&this.reset()})}getSelectedCells(e){const t=e.getMeta().id,{interaction:i}=this.spreadsheet;let s=i.getCells([d.vZ.DATA_CELL]),o=[];return i.getCurrentStateName()!==d.xT.SELECTED&&(s=[]),o=s.find(e=>e.id===t)?s.filter(e=>e.id!==t):[...s,$o(e)],o}bindDataCellClick(){this.spreadsheet.on(m.DATA_CELL_CLICK,e=>{e.stopPropagation();const t=this.spreadsheet.getCell(e.target),i=t.getMeta(),{interaction:s}=this.spreadsheet;if(this.isMultiSelection&&i){const i=this.getSelectedCells(t);if((0,a.isEmpty)(i))return s.clearState(),this.spreadsheet.hideTooltip(),void s.emitSelectEvent({event:e,targetCell:t,interactionName:d.oB.DATA_CELL_MULTI_SELECTION});s.addIntercepts([d.fR.CLICK,d.fR.HOVER]),this.spreadsheet.hideTooltip(),s.changeState({cells:i,stateName:d.xT.SELECTED,onUpdateCells:Yo}),s.emitSelectEvent({event:e,targetCell:t,interactionName:d.oB.DATA_CELL_MULTI_SELECTION}),this.spreadsheet.showTooltipWithInfo(e,rn(this.spreadsheet))}})}}var Sn=i("./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/engine/CustomImage.js"),bn=i("./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/utils/export/copy/core.js"),En=i("./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/utils/export/method.js");class Ln{constructor(e){this.canvasEventHandlers=[],this.s2EventHandlers=[],this.domEventListeners=[],this.isCanvasEffect=!1,this.onScroll=(0,a.throttle)(()=>{this.spreadsheet.hideTooltip()},16),this.isGuiIconShape=e=>e instanceof Sn.$&&e.imgType===ie.r.type,this.isConditionIconShape=(e,t)=>t.getConditionIconShapes().some(t=>{var i;return(null==t?void 0:t.name)===(null===(i=null==e?void 0:e.attributes)||void 0===i?void 0:i.name)}),this.onCanvasMousedown=e=>{if(this.target=e.target,this.spreadsheet.interaction.clearHoverTimer(),this.isResizeArea(e)){this.spreadsheet.emit(m.LAYOUT_RESIZE_MOUSE_DOWN,e);const t=e=>{if(!this.spreadsheet.getCanvasElement())return!1;this.spreadsheet.getCanvasElement()!==e.target&&this.spreadsheet.emit(m.LAYOUT_RESIZE_MOUSE_MOVE,e)};return window.addEventListener(ps.POINTER_MOVE,t),void window.addEventListener(ps.POINTER_UP,()=>{window.removeEventListener(ps.POINTER_MOVE,t)},{once:!0})}switch(this.spreadsheet.getCellType(e.target)){case d.vZ.DATA_CELL:this.spreadsheet.emit(m.DATA_CELL_MOUSE_DOWN,e);break;case d.vZ.ROW_CELL:this.spreadsheet.emit(m.ROW_CELL_MOUSE_DOWN,e);break;case d.vZ.COL_CELL:this.spreadsheet.emit(m.COL_CELL_MOUSE_DOWN,e);break;case d.vZ.CORNER_CELL:this.spreadsheet.emit(m.CORNER_CELL_MOUSE_DOWN,e);break;case d.vZ.MERGED_CELL:this.spreadsheet.emit(m.MERGED_CELLS_MOUSE_DOWN,e)}},this.onCanvasMousemove=e=>{if(this.canvasMousemoveEvent=e,this.isResizeArea(e))return this.activeResizeArea(e),void this.spreadsheet.emit(m.LAYOUT_RESIZE_MOUSE_MOVE,e.nativeEvent);this.resetResizeArea();const t=this.spreadsheet.getCell(e.target);if(t){const i=t.cellType;switch(i){case d.vZ.DATA_CELL:this.spreadsheet.emit(m.DATA_CELL_MOUSE_MOVE,e);break;case d.vZ.ROW_CELL:this.spreadsheet.emit(m.ROW_CELL_MOUSE_MOVE,e);break;case d.vZ.COL_CELL:this.spreadsheet.emit(m.COL_CELL_MOUSE_MOVE,e);break;case d.vZ.CORNER_CELL:this.spreadsheet.emit(m.CORNER_CELL_MOUSE_MOVE,e);break;case d.vZ.MERGED_CELL:this.spreadsheet.emit(m.MERGED_CELLS_MOUSE_MOVE,e)}if(!this.hasBrushSelectionIntercepts())switch(this.spreadsheet.emit(m.GLOBAL_HOVER,e),i){case d.vZ.DATA_CELL:this.spreadsheet.emit(m.DATA_CELL_HOVER,e);break;case d.vZ.ROW_CELL:this.spreadsheet.emit(m.ROW_CELL_HOVER,e);break;case d.vZ.COL_CELL:this.spreadsheet.emit(m.COL_CELL_HOVER,e);break;case d.vZ.CORNER_CELL:this.spreadsheet.emit(m.CORNER_CELL_HOVER,e);break;case d.vZ.MERGED_CELL:this.spreadsheet.emit(m.MERGED_CELLS_HOVER,e)}}},this.onCanvasMouseup=e=>{if(this.isResizeArea(e))return void this.spreadsheet.emit(m.LAYOUT_RESIZE_MOUSE_UP,e);const t=this.spreadsheet.getCell(e.target);if(t){switch(t.cellType){case d.vZ.DATA_CELL:this.spreadsheet.emit(m.DATA_CELL_MOUSE_UP,e);break;case d.vZ.ROW_CELL:this.spreadsheet.emit(m.ROW_CELL_MOUSE_UP,e);break;case d.vZ.COL_CELL:this.spreadsheet.emit(m.COL_CELL_MOUSE_UP,e);break;case d.vZ.CORNER_CELL:this.spreadsheet.emit(m.CORNER_CELL_MOUSE_UP,e);break;case d.vZ.MERGED_CELL:this.spreadsheet.emit(m.MERGED_CELLS_MOUSE_UP,e)}me()&&this.onCanvasSingleClick(e)}},this.onCanvasClick=e=>{const t=this.spreadsheet;if(1===e.detail&&!me())return void this.onCanvasSingleClick(e);if(2!==e.detail)return;if(this.isResizeArea(e))return void t.emit(m.LAYOUT_RESIZE_MOUSE_UP,e);t.emit(m.GLOBAL_DOUBLE_CLICK,e);const i=t.getCell(e.target);if(i){if(this.target===e.target)switch(i.cellType){case d.vZ.DATA_CELL:t.emit(m.DATA_CELL_DOUBLE_CLICK,e);break;case d.vZ.ROW_CELL:t.emit(m.ROW_CELL_DOUBLE_CLICK,e);break;case d.vZ.COL_CELL:t.emit(m.COL_CELL_DOUBLE_CLICK,e);break;case d.vZ.CORNER_CELL:t.emit(m.CORNER_CELL_DOUBLE_CLICK,e);break;case d.vZ.MERGED_CELL:t.emit(m.MERGED_CELLS_DOUBLE_CLICK,e)}}},this.onCanvasMouseout=e=>{if(!this.isAutoResetSheetStyle(e)||this.isMouseOnTheCanvasContainer(e))return;const{interaction:t}=this.spreadsheet;t.isSelectedState()||t.intercepts.size>0||t.reset()},this.onCanvasContextMenu=e=>{const t=this.spreadsheet;if(this.isResizeArea(e))return void t.emit(m.LAYOUT_RESIZE_MOUSE_UP,e);t.emit(m.GLOBAL_CONTEXT_MENU,e);switch(this.spreadsheet.getCellType(e.target)){case d.vZ.DATA_CELL:this.spreadsheet.emit(m.DATA_CELL_CONTEXT_MENU,e);break;case d.vZ.ROW_CELL:this.spreadsheet.emit(m.ROW_CELL_CONTEXT_MENU,e);break;case d.vZ.COL_CELL:this.spreadsheet.emit(m.COL_CELL_CONTEXT_MENU,e);break;case d.vZ.CORNER_CELL:this.spreadsheet.emit(m.CORNER_CELL_CONTEXT_MENU,e);break;case d.vZ.MERGED_CELL:this.spreadsheet.emit(m.MERGED_CELLS_CONTEXT_MENU,e)}},this.spreadsheet=e,this.bindEvents()}get canvasContainer(){return this.spreadsheet.container}isAutoResetSheetStyle(e){var t;const{interaction:i}=this.spreadsheet.options;return(0,a.isFunction)(null==i?void 0:i.autoResetSheetStyle)?null===(t=null==i?void 0:i.autoResetSheetStyle)||void 0===t?void 0:t.call(i,e,this.spreadsheet):null==i?void 0:i.autoResetSheetStyle}bindEvents(){this.clearAllEvents(),this.addCanvasEvent(ps.MOUSE_DOWN,this.onCanvasMousedown),this.addCanvasEvent(ps.TOUCH_START,e=>{this.target=e.target});const e=me()?ps.TOUCH_END:ps.POINTER_UP;this.addCanvasEvent(ps.POINTER_MOVE,this.onCanvasMousemove),this.addCanvasEvent(ps.MOUSE_OUT,this.onCanvasMouseout),this.addCanvasEvent(e,this.onCanvasMouseup),this.addCanvasEvent(ps.CLICK,this.onCanvasClick),this.addCanvasEvent(ps.RIGHT_DOWN,this.onCanvasContextMenu),this.addS2Event(m.GLOBAL_ACTION_ICON_CLICK,()=>{this.spreadsheet.interaction.addIntercepts([d.fR.HOVER]),this.spreadsheet.interaction.clearState()}),(0,ge.fU)()||(this.addDomEventListener(window,ps.CLICK,e=>{this.resetSheetStyle(e),this.isCanvasEffect=this.isMouseOnTheCanvasContainer(e)}),this.addDomEventListener(window,ps.KEY_DOWN,e=>{this.onKeyboardCopy(e),this.onKeyboardEsc(e),this.spreadsheet.emit(m.GLOBAL_KEYBOARD_DOWN,e)}),this.addDomEventListener(window,ps.KEY_UP,e=>{this.spreadsheet.emit(m.GLOBAL_KEYBOARD_UP,e)}),this.addDomEventListener(window,ps.POINTER_UP,e=>{this.spreadsheet.emit(m.GLOBAL_MOUSE_UP,e)}),this.addDomEventListener(window,ps.POINTER_MOVE,e=>{this.spreadsheet.emit(m.GLOBAL_MOUSE_MOVE,e)}),this.addDomEventListener(window,ps.SCROLL,this.onScroll))}onKeyboardCopy(e){const{copy:t}=this.spreadsheet.options.interaction;if(this.isCanvasEffect&&(null==t?void 0:t.enable)&&(0,En.DV)(e.key,d.B4.COPY)&&(e.metaKey||e.ctrlKey)){const e=(0,bn.w6)(this.spreadsheet);(0,a.isNil)(e)||this.spreadsheet.emit(m.GLOBAL_COPIED,e)}}onKeyboardEsc(e){this.isCanvasEffect&&(0,En.DV)(e.key,d.B4.ESC)&&this.resetSheetStyle(e)}resetSheetStyle(e){var t,i;if(!this.isAutoResetSheetStyle(e)||!this.spreadsheet)return;const{interaction:s}=this.spreadsheet;(null===(t=null==s?void 0:s.hasIntercepts)||void 0===t?void 0:t.call(s,[d.fR.DATA_CELL_BRUSH_SELECTION,d.fR.COL_CELL_BRUSH_SELECTION,d.fR.ROW_CELL_BRUSH_SELECTION]))?null===(i=null==s?void 0:s.removeIntercepts)||void 0===i||i.call(s,[d.fR.DATA_CELL_BRUSH_SELECTION,d.fR.ROW_CELL_BRUSH_SELECTION,d.fR.COL_CELL_BRUSH_SELECTION]):this.isMouseOnTheTooltip(e)||this.isMouseOnTheCanvasContainer(e)||(s.reset(),this.spreadsheet.emit(m.GLOBAL_RESET,e),this.spreadsheet.emit(m.GLOBAL_SELECTED,s.getActiveCells(),{event:e,targetCell:null,interactionName:d.oB.GLOBAL_RESET}))}isMouseEvent(e){return(0,a.hasIn)(e,"clientX")&&(0,a.hasIn)(e,"clientY")}isMatchElement(e){const t=this.spreadsheet.getCanvasElement(),{target:i}=e;return i===t||i instanceof l.q9||i instanceof l.Hl}isMatchPoint(e){const t=this.spreadsheet.getCanvasElement(),{width:i,height:s}=this.getContainerRect(),{x:o,y:n}=t.getBoundingClientRect()||{},{clientX:r,clientY:l}=e;return r<=o+i&&r>=o&&l<=n+s&&l>=n}isMouseOnTheCanvasContainer(e){if(this.isMouseEvent(e)){return!!this.spreadsheet.getCanvasElement()&&(this.spreadsheet.getCanvasConfig().supportsCSSTransform?this.isMatchElement(e):this.isMatchElement(e)&&this.isMatchPoint(e))}return!1}getContainerRect(){var e;const{facet:t,options:i}=this.spreadsheet,s=(null==t?void 0:t.hRowScrollBar)||(null==t?void 0:t.hScrollBar),{maxX:o,maxY:n}=(null==t?void 0:t.panelBBox)||{},{width:r=0,height:l=0}=i,a=(null===(e=null==s?void 0:s.theme)||void 0===e?void 0:e.size)||0;return{width:Math.min(r,o),height:Math.min(l,n+a)}}isMouseOnTheTooltip(e){var t,i,s,o;const{tooltip:n}=this.spreadsheet;if(!(null==n?void 0:n.visible))return!1;const{x:r,y:l,width:a,height:d}=(null===(s=null===(i=null===(t=this.spreadsheet.tooltip)||void 0===t?void 0:t.container)||void 0===i?void 0:i.getBoundingClientRect)||void 0===s?void 0:s.call(i))||{};return e.target instanceof Node?((e,t)=>{let i=!1,s=t;for(;s&&s!==document.body;){if(e===s){i=!0;break}s=s.parentElement}return i})(null===(o=this.spreadsheet.tooltip)||void 0===o?void 0:o.container,e.target):!!this.isMouseEvent(e)&&(e.clientX>=r&&e.clientX<=r+a&&e.clientY>=l&&e.clientY<=l+d)}isResizeArea(e){const t=qo(e.target);return null==t?void 0:t.isResizeArea}activeResizeArea(e){var t,i,s;const o=(0,a.get)(e.target,"attrs.appendInfo");if(null==o?void 0:o.isResizeMask)return;this.resetResizeArea();const n=e.target;this.spreadsheet.store.set("activeResizeArea",n),n.attr(d.lE.backgroundOpacity,null===(s=null===(i=null===(t=this.spreadsheet.theme.resizeArea)||void 0===t?void 0:t.interactionState)||void 0===i?void 0:i.hover)||void 0===s?void 0:s.backgroundOpacity)}resetResizeArea(){var e;const t=this.spreadsheet.store.get("activeResizeArea");(0,a.isEmpty)(t)||t.attr(d.lE.backgroundOpacity,null===(e=this.spreadsheet.theme.resizeArea)||void 0===e?void 0:e.backgroundOpacity),this.spreadsheet.store.set("activeResizeArea",t)}hasBrushSelectionIntercepts(){return this.spreadsheet.interaction.hasIntercepts([d.fR.HOVER,d.fR.DATA_CELL_BRUSH_SELECTION,d.fR.ROW_CELL_BRUSH_SELECTION,d.fR.COL_CELL_BRUSH_SELECTION])}onCanvasSingleClick(e){const t=this.spreadsheet.getCell(e.target);if(this.target===e.target&&t){if(this.isGuiIconShape(e.target)&&!this.isConditionIconShape(e.target,t))return;switch(this.spreadsheet.emit(m.GLOBAL_CLICK,e),t.cellType){case d.vZ.DATA_CELL:this.spreadsheet.emit(m.DATA_CELL_CLICK,e);break;case d.vZ.ROW_CELL:this.spreadsheet.emit(m.ROW_CELL_CLICK,e);break;case d.vZ.COL_CELL:this.spreadsheet.emit(m.COL_CELL_CLICK,e);break;case d.vZ.CORNER_CELL:this.spreadsheet.emit(m.CORNER_CELL_CLICK,e);break;case d.vZ.MERGED_CELL:this.spreadsheet.emit(m.MERGED_CELLS_CLICK,e)}}}clear(){this.unbindEvents()}unbindEvents(){this.clearAllEvents()}addCanvasEvent(e,t){var i;null===(i=this.canvasContainer)||void 0===i||i.on(e,t),this.canvasEventHandlers.push({type:e,handler:t})}addS2Event(e,t){this.spreadsheet.on(e,t),this.s2EventHandlers.push({type:e,handler:t})}addDomEventListener(e,t,i){if(e.addEventListener){const{eventListenerOptions:s}=this.spreadsheet.options.interaction;e.addEventListener(t,i,s),this.domEventListeners.push({target:e,type:t,handler:i,options:s})}else console.error(`Please make sure ${e} has addEventListener function`)}clearAllEvents(){(0,a.each)(this.canvasEventHandlers,({type:e,handler:t})=>{var i;null===(i=this.canvasContainer)||void 0===i||i.removeEventListener(e,t)}),(0,a.each)(this.s2EventHandlers,({type:e,handler:t})=>{this.spreadsheet.off(e,t)}),(0,a.each)(this.domEventListeners,e=>{e.target.removeEventListener(e.type,e.handler,e.options)}),this.canvasEventHandlers=[],this.s2EventHandlers=[],this.domEventListeners=[]}getViewportPoint(e){return!this.spreadsheet.getCanvasConfig().supportsCSSTransform||(0,a.isNil)(e.offsetX)||(0,a.isNil)(e.offsetY)?this.spreadsheet.container.client2Viewport({x:e.clientX,y:e.clientY}):{x:e.offsetX,y:e.offsetY}}}class Tn extends an{constructor(){super(...arguments),this.isRangeSelection=!1,this.handleColClick=e=>{e.stopPropagation();const{interaction:t,facet:i}=this.spreadsheet,s=this.spreadsheet.getCell(e.target),o=null==s?void 0:s.getMeta();if(!(0,a.isNil)(null==o?void 0:o.x)){t.addIntercepts([d.fR.HOVER]);let n=[$o(s)];const r=this.spreadsheet.store.get("lastClickedCell");if(this.isRangeSelection&&r&&r.cellType===s.cellType&&r.getMeta().level===o.level){const{rowsHierarchy:l,colsHierarchy:a}=i.getLayoutResult(),[c,h]=[l.maxLevel,a.maxLevel],{start:u,end:p}=Uo(r.getMeta(),o);s instanceof Ri?n=this.handleSeriesNumberRowSelected(u.rowIndex,p.rowIndex,s):(null==s?void 0:s.cellType)===d.vZ.ROW_CELL&&o.level===c?n=this.handleRowSelected(u.rowIndex,p.rowIndex,s):(null==s?void 0:s.cellType)===d.vZ.COL_CELL&&o.level===h&&(n=this.handleColSelected(u.colIndex,p.colIndex,s)),t.changeState({cells:n,stateName:d.xT.SELECTED});const g=Xo(n);t.updateCells(i.getHeaderCells(g)),t.emitSelectEvent({event:e,targetCell:s,interactionName:d.oB.RANGE_SELECTION})}else(0,a.isEmpty)(t.getCells())&&t.reset(),this.spreadsheet.store.set("lastClickedCell",s)}}}bindEvents(){this.bindKeyboardDown(),this.bindDataCellClick(),this.bindColCellClick(),this.bindKeyboardUp(),this.bindMouseMove()}reset(){this.isRangeSelection=!1,this.spreadsheet.interaction.removeIntercepts([d.fR.CLICK])}bindKeyboardDown(){this.spreadsheet.on(m.GLOBAL_KEYBOARD_DOWN,e=>{e.key===d.B4.SHIFT&&(this.isRangeSelection=!0,this.spreadsheet.interaction.addIntercepts([d.fR.CLICK]))})}bindKeyboardUp(){this.spreadsheet.on(m.GLOBAL_KEYBOARD_UP,e=>{e.key===d.B4.SHIFT&&this.reset()})}bindMouseMove(){this.spreadsheet.on(m.GLOBAL_MOUSE_MOVE,e=>{this.isRangeSelection&&!e.shiftKey&&this.reset()})}bindColCellClick(){this.spreadsheet.on(m.COL_CELL_CLICK,e=>{this.handleColClick(e)})}bindDataCellClick(){this.spreadsheet.on(m.DATA_CELL_CLICK,e=>{e.stopPropagation();const t=this.spreadsheet.getCell(e.target),i=t.getMeta(),{interaction:s}=this.spreadsheet;if(!i)return;const o=this.spreadsheet.store.get("lastClickedCell");if(!(this.isRangeSelection&&(null==o?void 0:o.cellType)===t.cellType))return void this.spreadsheet.store.set("lastClickedCell",t);const{start:n,end:r}=Uo(o.getMeta(),t.getMeta()),l=(0,a.range)(n.colIndex,r.colIndex+1).flatMap(e=>{const i=this.spreadsheet.facet.getColLeafNodes()[e].id;return(0,a.range)(n.rowIndex,r.rowIndex+1).map(s=>({id:`${this.spreadsheet.facet.getSeriesNumberWidth()||this.spreadsheet.isTableMode()?String(s):this.spreadsheet.facet.getRowLeafNodes()[s].id}-${i}`,colIndex:e,rowIndex:s,type:t.cellType}))});s.addIntercepts([d.fR.CLICK,d.fR.HOVER]),s.changeState({cells:l,stateName:d.xT.SELECTED}),this.spreadsheet.showTooltipWithInfo(e,rn(this.spreadsheet)),s.emitSelectEvent({targetCell:t,event:e,interactionName:d.oB.RANGE_SELECTION})})}handleSeriesNumberRowSelected(e,t,i){const s=this.spreadsheet.facet.getColLeafNodes()[0].id;return(0,a.range)(e,t+1).map(e=>({id:`${String(e)}-${s}`,colIndex:0,rowIndex:e,type:i.cellType}))}handleRowSelected(e,t,i){return this.spreadsheet.facet.getRowNodes().filter(({rowIndex:i})=>(0,a.inRange)(i,e,t+1)).map(e=>({id:e.id,colIndex:e.colIndex,rowIndex:e.rowIndex,type:i.cellType}))}handleColSelected(e,t,i){return this.spreadsheet.facet.getColLeafNodes().filter(({colIndex:i})=>(0,a.inRange)(i,e,t+1)).map(e=>({id:e.id,colIndex:e.colIndex,rowIndex:e.rowIndex,type:i.cellType}))}}class On extends an{constructor(){super(...arguments),this.resizeStartPosition={}}bindEvents(){this.bindMouseDown(),this.bindMouseMove(),this.bindMouseUp()}initResizeGroup(){if(this.resizeReferenceGroup)return;this.resizeReferenceGroup=this.spreadsheet.facet.foregroundGroup.appendChild(new l.YJ);const{width:e,height:t}=this.spreadsheet.options,{guideLineColor:i,guideLineDash:s,size:o}=this.getResizeAreaTheme(),n={d:"",lineDash:s,stroke:i,lineWidth:o};this.resizeReferenceGroup.appendChild(new l.wA({id:"RESIZE_START_GUIDE_LINE",style:n})),this.resizeReferenceGroup.appendChild(new l.wA({id:"RESIZE_END_GUIDE_LINE",style:n})),this.resizeReferenceGroup.appendChild(new f({id:"RESIZE_MASK",style:{x:0,y:0,width:e,height:t,fill:"transparent"}},{isResizeArea:!0,isResizeMask:!0}))}getResizeAreaTheme(){return this.spreadsheet.theme.resizeArea}setResizeTarget(e){this.resizeTarget=e}getGuideLineWidthAndHeight(){const{width:e,height:t}=this.spreadsheet.options,{maxY:i,maxX:s}=this.spreadsheet.facet.panelBBox;return{width:Math.min(s,e),height:Math.min(i,t)}}getResizeShapes(){var e;return(null===(e=this.resizeReferenceGroup)||void 0===e?void 0:e.children)||[]}setResizeMaskCursor(e){const[,,t]=this.getResizeShapes();null==t||t.attr("cursor",e)}updateResizeGuideLinePosition(e,t){const i=this.getResizeShapes();if((0,a.isEmpty)(i))return;const[s,o]=i,{type:n,offsetX:r,offsetY:l,width:d,height:c,size:h}=t,{width:p,height:g}=this.getGuideLineWidthAndHeight();this.cursorType=`${n}-resize`,this.setResizeMaskCursor(this.cursorType);const m=h/2;if(n===u.Horizontal)return s.attr("d",[["M",r+m,l],["L",r+m,g]]),o.attr("d",[["M",r+d-m,l],["L",r+d-m,g]]),this.resizeStartPosition.offsetX=e.offsetX,void(this.resizeStartPosition.clientX=e.clientX);s.attr("d",[["M",r,l+m],["L",p,l+m]]),o.attr("d",[["M",r,l+c-m],["L",p,l+c-m]]),this.resizeStartPosition.offsetY=e.offsetY,this.resizeStartPosition.clientY=e.clientY}bindMouseDown(){this.spreadsheet.on(m.LAYOUT_RESIZE_MOUSE_DOWN,e=>{var t;null===(t=null==e?void 0:e.preventDefault)||void 0===t||t.call(e);const i=e.target,s=this.getCellAppendInfo(e.target);this.spreadsheet.store.set("resized",!1),(null==s?void 0:s.isResizeArea)&&(this.spreadsheet.hideTooltip(),this.spreadsheet.interaction.addIntercepts([d.fR.RESIZE]),this.setResizeTarget(i),this.showResizeGroup(),this.updateResizeGuideLinePosition(e,s))})}bindMouseMove(){this.spreadsheet.on(m.LAYOUT_RESIZE_MOUSE_MOVE,(0,a.throttle)(this.resizeMouseMove.bind(this),33))}getResizeGuideLinePosition(){var e;const[t,i]=(null===(e=this.resizeReferenceGroup)||void 0===e?void 0:e.children)||[],s=(null==t?void 0:t.attr("d"))||[],o=(null==i?void 0:i.attr("d"))||[],[,n=0,r=0]=s[0]||[],[,l=0,a=0]=o[0]||[];return{start:{x:+n,y:+r},end:{x:+l,y:+a}}}getDisAllowResizeInfo(){var e;const t=this.getResizeInfo(),{resize:i}=this.spreadsheet.options.interaction,{width:s,height:o,resizedWidth:n=0,resizedHeight:r=0}=t,l=null===(e=null==i?void 0:i.disable)||void 0===e?void 0:e.call(i,t);return{displayWidth:l?s:n,displayHeight:l?o:r,isDisabled:l}}getResizeCellField(e){var t,i,s,o,n;const r=e.type===u.Vertical,l=r?!this.isEffectRowOf(g.ALL):!this.isEffectColOf(g.ALL);return this.spreadsheet.isTableMode()?r?(null===(t=null==e?void 0:e.meta)||void 0===t?void 0:t.rowId)||String(null===(i=null==e?void 0:e.meta)||void 0===i?void 0:i.rowIndex):null===(s=null==e?void 0:e.meta)||void 0===s?void 0:s.field:l?null===(o=null==e?void 0:e.meta)||void 0===o?void 0:o.id:null===(n=null==e?void 0:e.meta)||void 0===n?void 0:n.field}isEffectRowOf(e){var t,i;return(null===(i=null===(t=this.spreadsheet.options.interaction)||void 0===t?void 0:t.resize)||void 0===i?void 0:i.rowResizeType)===e}isEffectColOf(e){var t,i;return(null===(i=null===(t=this.spreadsheet.options.interaction)||void 0===t?void 0:t.resize)||void 0===i?void 0:i.colResizeType)===e}getCellStyleByField(e){const{interaction:t}=this.spreadsheet,i=this.getResizeInfo(),s=i.type===u.Vertical?t.getActiveRowCells():t.getActiveColCells(),o=t.isSelectedState()&&s.length>1;return(this.isEffectRowOf(g.SELECTED)||this.isEffectColOf(g.SELECTED))&&o?s.reduce((t,s)=>(Ns.getAllLeaveNodes(s.getMeta()).forEach(s=>{const o=Object.assign(Object.assign({},i),{meta:s});t[this.getResizeCellField(o)]=e}),t),{}):{[this.getResizeCellField(i)]:e}}getResizeWidthDetail(){const e=this.getResizeInfo(),{displayWidth:t}=this.getDisAllowResizeInfo();switch(e.effect){case p.Field:return{eventType:m.LAYOUT_RESIZE_ROW_WIDTH,style:{rowCell:{widthByField:{[e.meta.field]:t}}}};case p.Tree:return{eventType:m.LAYOUT_RESIZE_TREE_WIDTH,style:{rowCell:{treeWidth:t}}};case p.Cell:return{eventType:m.LAYOUT_RESIZE_COL_WIDTH,style:{colCell:{width:this.isEffectColOf(g.ALL)?t:void 0,widthByField:this.getCellStyleByField(t)}}};case p.Series:return{eventType:m.LAYOUT_RESIZE_SERIES_WIDTH,seriesNumberWidth:t};default:return null}}getResizeHeightDetail(){const{style:e}=this.spreadsheet.options,t=this.getResizeInfo(),{displayHeight:i}=this.getDisAllowResizeInfo();switch(t.effect){case p.Field:return{eventType:m.LAYOUT_RESIZE_COL_HEIGHT,style:{colCell:this.getResizedCellStyleByField(this.getColCellHeightByField(t,i),null==e?void 0:e.colCell,i)}};case p.Cell:return{eventType:m.LAYOUT_RESIZE_ROW_HEIGHT,style:{rowCell:Object.assign(Object.assign({},this.getResizedCellStyleByField(this.getCellStyleByField(i),null==e?void 0:e.rowCell,i)),{height:this.isEffectRowOf(g.ALL)?i:void 0})}};default:return null}}getResizedCellStyleByField(e,t,i){if(!((null==t?void 0:t.maxLines)>1&&(null==t?void 0:t.wordWrap)))return{heightByField:e};const{cell:s}=this.getResizeInfo(),o=s.getMaxLinesByCustomHeight({targetCell:s,displayHeight:i,isCustomHeight:!0});return{heightByField:e,maxLinesByField:Object.keys(e||{}).reduce((e,t)=>(e[t]=o,e),{})}}getColCellHeightByField(e,t){return this.spreadsheet.isCustomColumnFields()||this.spreadsheet.isTableMode()?this.spreadsheet.facet.getColNodes().filter(t=>{var i,s;return t.level===(null===(i=e.meta)||void 0===i?void 0:i.level)&&t.height===(null===(s=e.meta)||void 0===s?void 0:s.height)}).reduce((e,i)=>(e[i.field]=t,e),{}):{[e.meta.field]:t}}getResizeDetail(){return this.getResizeInfo().type===u.Horizontal?this.getResizeWidthDetail():this.getResizeHeightDetail()}showResizeGroup(){var e;this.initResizeGroup(),null===(e=this.resizeReferenceGroup)||void 0===e||e.setAttribute("visibility","visible")}hideResizeGroup(){var e;null===(e=this.resizeReferenceGroup)||void 0===e||e.setAttribute("visibility","hidden")}bindMouseUp(){this.spreadsheet.on(m.GLOBAL_MOUSE_UP,()=>{var e;this.cursorType="default",this.setResizeMaskCursor(this.cursorType),this.resizeReferenceGroup&&!(0,a.isEmpty)(null===(e=this.resizeReferenceGroup)||void 0===e?void 0:e.children)&&(this.hideResizeGroup(),this.renderResizedResult())})}resizeMouseMove(e){var t,i;if("visible"!==(null===(t=this.resizeReferenceGroup)||void 0===t?void 0:t.parsedStyle.visibility))return;const s=this.getResizeInfo(),o=(null===(i=this.resizeReferenceGroup)||void 0===i?void 0:i.children)||[];if((0,a.isEmpty)(o))return;const[,n]=o,[r,l]=(0,a.clone)(n.attr("d"));s.type===u.Horizontal?this.updateHorizontalResizingEndGuideLinePosition(e.offsetX,s,{start:r,end:l}):this.updateVerticalResizingEndGuideLinePosition(e.offsetY,s,{start:r,end:l}),this.updateResizeGuideLineTheme(n),n.attr("d",[r,l])}updateResizeGuideLineTheme(e){const{guideLineColor:t,guideLineDisableColor:i}=this.getResizeAreaTheme(),{isDisabled:s}=this.getDisAllowResizeInfo();e.attr("stroke",s?i:t),this.setResizeMaskCursor(s?"no-drop":this.cursorType)}updateHorizontalResizingEndGuideLinePosition(e,t,i){var s,o;const{minCellWidth:n=40}=(null===(s=this.spreadsheet.options.interaction)||void 0===s?void 0:s.resize)||{};let r=e-this.resizeStartPosition.offsetX;t.width+r<n&&(r=-(t.width-n));const l=t.offsetX+t.width+r,a=t.size/2;i.start[1]=l-a,i.end[1]=l-a,null===(o=this.resizeTarget)||void 0===o||o.attr({x:l-t.size})}updateVerticalResizingEndGuideLinePosition(e,t,i){var s,o;const{minCellHeight:n=20}=(null===(s=this.spreadsheet.options.interaction)||void 0===s?void 0:s.resize)||{};let r=e-this.resizeStartPosition.offsetY;t.height+r<n&&(r=-(t.height-n));const l=t.offsetY+t.height+r,a=t.size/2;i.start[2]=l-a,i.end[2]=l-a,null===(o=this.resizeTarget)||void 0===o||o.attr({y:l-t.size})}renderResizedResult(){return(0,A.sH)(this,void 0,void 0,function*(){const e=this.getResizeInfo(),{style:t,seriesNumberWidth:i,eventType:s}=this.getResizeDetail()||{},o={info:e,style:t};this.spreadsheet.emit(m.LAYOUT_RESIZE,o),this.spreadsheet.emit(s,o),t&&this.spreadsheet.setOptions({style:t}),i&&this.spreadsheet.setTheme({rowCell:{seriesNumberWidth:i}}),this.spreadsheet.store.set("resized",!0),yield this.render()})}getResizeInfo(){const e=this.getCellAppendInfo(this.resizeTarget),{start:t,end:i}=this.getResizeGuideLinePosition(),s=y(i.x-t.x+(e.type===u.Horizontal?e.size:0)),o=y(i.y-t.y+(e.type===u.Vertical?e.size:0));return Object.assign(Object.assign({},e),{resizedWidth:s,resizedHeight:o})}render(){return(0,A.sH)(this,void 0,void 0,function*(){this.resizeStartPosition={},this.resizeTarget=null,this.resizeReferenceGroup=null,yield this.spreadsheet.render(!1)})}}const Rn=[d.B4.ARROW_LEFT,d.B4.ARROW_RIGHT,d.B4.ARROW_UP,d.B4.ARROW_DOWN];class In extends an{constructor(e){super(e)}isCanvasEffect(){return this.spreadsheet.interaction.eventController.isCanvasEffect}bindEvents(){this.spreadsheet.on(m.GLOBAL_KEYBOARD_DOWN,e=>{if(!this.isCanvasEffect())return;const t=e.shiftKey,i=e.metaKey;let s=!1,o=!1,n=!1;Rn.includes(e.key)&&(i&&t?(s=!1,o=!0,n=!1):i?(s=!0,o=!0,n=!0):t?(s=!1,o=!1,n=!1):(s=!0,o=!1,n=!0),this.handleMove({event:e,changeStartCell:s,isJumpMode:o,isSingleSelection:n}))}),this.spreadsheet.on(m.DATA_CELL_CLICK,e=>{const t=this.spreadsheet.getCell(e.target),i=null==t?void 0:t.getMeta();i&&(this.startCell=this.getCellMetaByViewMeta(i),this.endCell=this.startCell)})}getCellMetaByViewMeta(e){return{rowIndex:e.rowIndex,colIndex:e.colIndex,id:e.id,type:d.vZ.DATA_CELL}}handleMove({event:e,changeStartCell:t,isJumpMode:i,isSingleSelection:s}){const{spreadsheet:o,startCell:n,endCell:r}=this,l=this.getMoveInfo(e.key,t?n:r,i);if(!l)return;const[a,c]=[l.row,l.col];this.scrollToActiveCell(o,a,c);const h=this.generateCellMeta(o,a,c),u=s?[h]:this.getRangeCells(o,n,h);t&&(this.startCell=h),this.endCell=h,o.interaction.changeState({stateName:d.xT.SELECTED,cells:u}),o.interaction.emitSelectEvent({event:e,interactionName:d.oB.SELECTED_CELL_MOVE}),this.spreadsheet.emit(m.DATA_CELL_SELECT_MOVE,u)}generateCellMeta(e,t,i){const{isTableMode:s,facet:o}=e,n=o.getRowLeafNodes(),r=o.getColLeafNodes(),l=s()?String(t):n[t].id;return{rowIndex:t,colIndex:i,id:xe(l,r[i].id),type:d.vZ.DATA_CELL}}getRangeCells(e,t,i){const{start:{rowIndex:s,colIndex:o},end:{rowIndex:n,colIndex:r}}=Uo(t,i),l=[];for(let t=s;t<=n;t++)for(let i=o;i<=r;i++)l.push(this.generateCellMeta(e,t,i));return l}getMoveInfo(e,t,i){const{spreadsheet:s}=this,{rowCount:o,trailingRowCount:n,colCount:r,trailingColCount:l}=s.facet.getFrozenOptions(),{start:a,end:c}=s.facet.getCellRange(),h=s.facet.getColLeafNodes(),[u,p]=[0+r,h.length-l-1],[g,m]=[a+o,c-n];if(t)switch(e){case d.B4.ARROW_RIGHT:if(t.colIndex+1>p)return;return{row:t.rowIndex,col:i?p:t.colIndex+1};case d.B4.ARROW_LEFT:if(t.colIndex-1<u)return;return{row:t.rowIndex,col:i?u:t.colIndex-1};case d.B4.ARROW_UP:if(t.rowIndex-1<g)return;return{row:i?g:t.rowIndex-1,col:t.colIndex};case d.B4.ARROW_DOWN:if(t.rowIndex+1>m)return;return{row:i?m:t.rowIndex+1,col:t.colIndex}}}calculateOffset(e,t,i){const o=e.facet,{rowCount:n}=o.getFrozenOptions(),r=o.getColLeafNodes(),{viewportHeight:l,viewportWidth:a}=o.panelBBox,d=o.frozenGroupAreas,c=d[s.Col].width,h=d[s.TrailingCol].width,u=d[s.TrailingRow].height,p=o.panelScrollGroupIndexes,g=r.find(e=>e.colIndex===i);let m=null,v=null;if(i<=p[0]?m=(null==g?void 0:g.x)-c:i>=p[1]&&(m=(null==g?void 0:g.x)+(null==g?void 0:g.width)-a+h),t<=p[2])v=o.viewCellHeights.getCellOffsetY(t-n);else if(t>=p[3]){v=o.viewCellHeights.getCellOffsetY(t+1)-l+u}return{offsetX:m,offsetY:v}}scrollToActiveCell(e,t,i){const{offsetX:s,offsetY:o}=this.calculateOffset(e,t,i),{facet:n}=e,{scrollX:r,scrollY:l}=e.facet.getScrollOffset();n.scrollWithAnimation({offsetX:{value:null!=s?s:r},offsetY:{value:null!=o?o:l}})}}class Nn{constructor(e){this.interactions=new Map,this.intercepts=new Set,this.hoverTimer=null,this.drawRafId=null,this.defaultState={cells:[],force:!1},this.onTriggerInteractionsResetEffect=()=>{this.interactions.forEach(e=>{e.reset()})},this.shouldForbidHeaderCellSelected=e=>(0,a.unionBy)(e,"type").length>1,this.highlightNodes=(e=[],t=d.xT.HOVER)=>{e.forEach(e=>{var i;null===(i=null==e?void 0:e.belongsCell)||void 0===i||i.updateByState(t,e.belongsCell)})},this.mergeCells=(e,t)=>{ws(this.spreadsheet,e,t)},this.unmergeCell=e=>{xs(this.spreadsheet,e)},this.spreadsheet=e,this.registerEventController(),this.registerInteractions(),(0,ge.fU)()||window.addEventListener("visibilitychange",this.onTriggerInteractionsResetEffect)}destroy(){this.interactions.clear(),this.intercepts.clear(),this.eventController.clear(),this.clearHoverTimer(),this.resetState(),(0,ge.fU)()||window.removeEventListener("visibilitychange",this.onTriggerInteractionsResetEffect)}reset(){this.clearState(),this.clearHoverTimer(),this.intercepts.clear(),this.spreadsheet.hideTooltip()}setState(e){((e,t)=>{e.interaction.isEqualStateName(null==t?void 0:t.stateName)||(Zo(e),e.hideTooltip(),e.store.set(d.sK,t))})(this.spreadsheet,e)}getState(){return this.spreadsheet.store.get(d.sK)||this.defaultState}setInteractedCells(e){const t=this.getInteractedCells().concat([e]),i=this.getState();i.interactedCells=t,this.setState(i)}getInteractedCells(){const e=this.getState();return(null==e?void 0:e.interactedCells)||[]}resetState(){this.spreadsheet.store.set(d.sK,this.defaultState)}getCurrentStateName(){return this.getState().stateName}isEqualStateName(e){return this.getCurrentStateName()===e}isStateOf(e){const t=this.getState();return(null==t?void 0:t.stateName)===e}isSelectedState(){return this.isBrushSelectedState()||[d.xT.SELECTED,d.xT.ALL_SELECTED].some(e=>this.isStateOf(e))}isBrushSelectedState(){return[d.xT.ROW_CELL_BRUSH_SELECTED,d.xT.COL_CELL_BRUSH_SELECTED,d.xT.DATA_CELL_BRUSH_SELECTED].some(e=>this.isStateOf(e))}isAllSelectedState(){return this.isStateOf(d.xT.ALL_SELECTED)}isHoverFocusState(){return this.isStateOf(d.xT.HOVER_FOCUS)}isHoverState(){return this.isStateOf(d.xT.HOVER)}isActiveCell(e){return!!this.getCells().find(t=>e.getMeta().id===t.id&&e.cellType===t.type)}isSelectedCell(e){return this.isSelectedState()&&this.isActiveCell(e)}getCells(e){const t=this.getState(),i=(null==t?void 0:t.cells)||[];return(0,a.isNil)(e)?i:i.filter(t=>e.includes(t.type))}getActiveCells(){var e;const t=this.getCells().map(e=>e.id),i=null===(e=this.spreadsheet.facet)||void 0===e?void 0:e.getCells();return(0,a.map)(t,e=>(0,a.find)(i,t=>{var i;return(null===(i=null==t?void 0:t.getMeta())||void 0===i?void 0:i.id)===e})).filter(Boolean)}getActiveDataCells(){return this.getActiveCells().filter(e=>e.cellType===d.vZ.DATA_CELL)}getActiveRowCells(){return this.getActiveCells().filter(e=>e.cellType===d.vZ.ROW_CELL)}getActiveColCells(){return this.getActiveCells().filter(e=>e.cellType===d.vZ.COL_CELL)}clearStyleIndependent(){(this.isSelectedState()||this.isHoverState()||this.isAllSelectedState())&&this.spreadsheet.facet.getDataCells().forEach(e=>{e.hideInteractionShape()})}getUnSelectedDataCells(){return this.spreadsheet.facet.getDataCells().filter(e=>!this.isActiveCell(e))}scrollToCellByMeta(e,t={animate:!0}){if(!e)return;const{skipScrollEvent:i,animate:s}=t,{facet:o}=this.spreadsheet;(o.hRowScrollBar||o.hScrollBar||o.vScrollBar)&&this.scrollTo({skipScrollEvent:i,rowHeaderOffsetX:{value:e.x,animate:s},offsetX:{value:e.x-(0,a.get)(o,"frozenGroupAreas.frozenCol.width",0),animate:s},offsetY:{value:e.y-(0,a.get)(o,"frozenGroupAreas.frozenRow.height",0),animate:s}})}scrollTo(e){const{facet:t}=this.spreadsheet,{scrollX:i,scrollY:s,rowHeaderScrollX:o}=t.getScrollOffset();t.updateScrollOffset(Po({skipScrollEvent:!1,offsetX:{value:i,animate:!1},offsetY:{value:s,animate:!1},rowHeaderOffsetX:{value:o,animate:!1}},e))}scrollToNode(e,t){this.scrollToCellByMeta(e,t)}scrollToCell(e,t){this.scrollToCellByMeta(e.getMeta(),t)}scrollToCellById(e,t){if(!e)return;const i=[...this.spreadsheet.facet.getHeaderNodes(),...this.spreadsheet.facet.getDataCells().map(e=>e.getMeta())].find(t=>t.id===e);i&&this.scrollToCellByMeta(i,t)}scrollToTop(e){this.scrollTo({skipScrollEvent:null==e?void 0:e.skipScrollEvent,offsetY:{value:0,animate:null==e?void 0:e.animate}})}scrollToRight(e){this.scrollTo({skipScrollEvent:null==e?void 0:e.skipScrollEvent,offsetX:{value:this.spreadsheet.facet.panelBBox.maxX,animate:null==e?void 0:e.animate}})}scrollToBottom(e){this.scrollTo({skipScrollEvent:null==e?void 0:e.skipScrollEvent,offsetY:{value:this.spreadsheet.facet.panelBBox.maxY,animate:null==e?void 0:e.animate}})}scrollToLeft(e){this.scrollTo({skipScrollEvent:null==e?void 0:e.skipScrollEvent,offsetX:{value:0,animate:null==e?void 0:e.animate}})}selectAll(){const e=this.spreadsheet.facet.getCells().map($o);this.changeState({cells:e,stateName:d.xT.ALL_SELECTED}),this.addIntercepts([d.fR.HOVER]),this.updateCells(this.spreadsheet.facet.getCells())}highlightCell(e,t){this.changeCell(Object.assign(Object.assign({},t),{cell:e,stateName:d.xT.HOVER}))}selectCell(e,t){this.changeCell(Object.assign(Object.assign({},t),{cell:e,stateName:d.xT.SELECTED}))}changeCell(e={}){var t,i;const{event:s,cell:o,stateName:n=d.xT.SELECTED,interactionName:r,scrollIntoView:l=!0,animate:c=!0,skipScrollEvent:h=!0}=e;if((0,a.isEmpty)(o))return;const u=null===(t=null==o?void 0:o.getMeta)||void 0===t?void 0:t.call(o);if(!u||(0,a.isNil)(null==u?void 0:u.x))return;this.addIntercepts([d.fR.HOVER]);const p=this.spreadsheet.isHierarchyTreeType(),g=(null==o?void 0:o.cellType)===d.vZ.COL_CELL,m=this.getState(),v=this.isSelectedCell(o),f=(null==e?void 0:e.isMultiSelection)&&this.isSelectedState();let C=v?[]:this.spreadsheet.facet.getCellChildrenNodes(o),y=v?[]:[$o(o)];if(f&&(y=(0,a.concat)((null==m?void 0:m.cells)||[],y),C=(0,a.concat)((null==m?void 0:m.nodes)||[],C),v&&(y=y.filter(({id:e})=>e!==u.id),C=C.filter(e=>!(null==e?void 0:e.id.includes(u.id))))),(0,a.isEmpty)(y))return this.reset(),void this.emitSelectEvent({event:s,targetCell:o,interactionName:r});if(this.shouldForbidHeaderCellSelected(y))return;const w=(0,a.isEmpty)(C)?[o.getMeta()]:C;this.changeState({cells:y,nodes:w,stateName:n});const x=Xo(y);return this.updateCells(this.spreadsheet.facet.getHeaderCells(x)),p&&!g||this.highlightNodes(C,n),l&&this.scrollToCell(o,{skipScrollEvent:h,animate:c}),null===(i=this.spreadsheet.facet.centerFrame)||void 0===i||i.toFront(),this.emitSelectEvent({event:s,targetCell:o,interactionName:r}),!0}hideColumns(){return(0,A.sH)(this,arguments,void 0,function*(e=[],t=!0){yield k(this.spreadsheet,e,t)})}getBrushSelectionInfo(e){var t,i,s;return(0,a.isBoolean)(e)?{dataCellBrushSelection:e,rowCellBrushSelection:e,colCellBrushSelection:e}:{dataCellBrushSelection:null!==(t=null==e?void 0:e.dataCell)&&void 0!==t&&t,rowCellBrushSelection:null!==(i=null==e?void 0:e.rowCell)&&void 0!==i&&i,colCellBrushSelection:null!==(s=null==e?void 0:e.colCell)&&void 0!==s&&s}}getDefaultInteractions(){const{resize:e,brushSelection:t,multiSelection:i,rangeSelection:s,selectedCellMove:o}=this.spreadsheet.options.interaction,{dataCellBrushSelection:n,rowCellBrushSelection:r,colCellBrushSelection:l}=this.getBrushSelectionInfo(t);return[{key:d.oB.CORNER_CELL_CLICK,interaction:vn},{key:d.oB.DATA_CELL_CLICK,interaction:dn},{key:d.oB.ROW_COLUMN_CLICK,interaction:cn},{key:d.oB.HEADER_CELL_LINK_CLICK,interaction:hn},{key:d.oB.MERGED_CELLS_CLICK,interaction:un},{key:d.oB.PREVIEW_CLICK,interaction:mn},{key:d.oB.HOVER,interaction:fn,enable:!me()},{key:d.oB.DATA_CELL_BRUSH_SELECTION,interaction:wn,enable:!me()&&n},{key:d.oB.ROW_CELL_BRUSH_SELECTION,interaction:xn,enable:!me()&&r},{key:d.oB.COL_CELL_BRUSH_SELECTION,interaction:yn,enable:!me()&&l},{key:d.oB.COL_ROW_RESIZE,interaction:On,enable:!me()&&e},{key:d.oB.DATA_CELL_MULTI_SELECTION,interaction:_n,enable:!me()&&i},{key:d.oB.RANGE_SELECTION,interaction:Tn,enable:!me()&&s},{key:d.oB.SELECTED_CELL_MOVE,interaction:In,enable:!me()&&o}]}registerInteractions(){const{customInteractions:e}=this.spreadsheet.options.interaction;this.interactions.clear();this.getDefaultInteractions().forEach(({key:e,interaction:t,enable:i})=>{!1!==i&&this.interactions.set(e,new t(this.spreadsheet))}),(0,a.isEmpty)(e)||(0,a.forEach)(e,e=>{const t=e.interaction;t&&this.interactions.set(e.key,new t(this.spreadsheet))})}registerEventController(){this.eventController=new Ln(this.spreadsheet)}draw(){null!==this.drawRafId&&cancelAnimationFrame(this.drawRafId),this.drawRafId=requestAnimationFrame(()=>{this.spreadsheet.container.render(),this.drawRafId=null})}clearState(){Zo(this.spreadsheet)&&this.draw()}changeState(e){const{interaction:t}=this.spreadsheet,{cells:i=[],force:s,stateName:o,onUpdateCells:n}=e;if((0,a.isEmpty)(i)&&o===d.xT.SELECTED)return void(s&&t.changeState({cells:[],stateName:d.xT.UNSELECTED}));this.getCurrentStateName()===d.xT.ALL_SELECTED&&this.clearStyleIndependent(),this.clearState(),this.setState(e);const r=()=>{this.updateAllDataCells()};n?n(this,r):r(),this.draw()}updateAllDataCells(){this.updateCells(this.spreadsheet.facet.getDataCells())}updateCells(e=[]){e.forEach(e=>{e.update()})}addIntercepts(e=[]){e.forEach(e=>{this.intercepts.add(e)})}hasIntercepts(e=[]){return e.some(e=>this.intercepts.has(e))}removeIntercepts(e=[]){e.forEach(e=>{this.intercepts.delete(e)})}clearHoverTimer(){clearTimeout(this.hoverTimer)}setHoverTimer(e){this.hoverTimer=e}getHoverTimer(){return this.hoverTimer}getSelectedCellHighlight(){var e;const{selectedCellHighlight:t}=this.spreadsheet.options.interaction;if((0,a.isBoolean)(t))return{rowHeader:t,colHeader:t,currentRow:t,currentCol:t};const{rowHeader:i=!1,colHeader:s=!1,currentRow:o=!1,currentCol:n=!1}=null!==(e=t)&&void 0!==e?e:{};return{rowHeader:i,colHeader:s,currentRow:o,currentCol:n}}getHoverAfterScroll(){return this.spreadsheet.options.interaction.hoverAfterScroll}getHoverHighlight(){const{hoverHighlight:e}=this.spreadsheet.options.interaction;if((0,a.isBoolean)(e))return{rowHeader:e,colHeader:e,currentRow:e,currentCol:e};const{rowHeader:t=!1,colHeader:i=!1,currentRow:s=!1,currentCol:o=!1}=null!=e?e:{};return{rowHeader:t,colHeader:i,currentRow:s,currentCol:o}}getBrushSelection(){const{brushSelection:e}=this.spreadsheet.options.interaction;if((0,a.isBoolean)(e))return{dataCell:e,rowCell:e,colCell:e};const{dataCell:t=!1,rowCell:i=!1,colCell:s=!1}=null!=e?e:{};return{dataCell:t,rowCell:i,colCell:s}}updateDataCellRelevantHeaderCells(e,t){this.updateDataCellRelevantColCells(e,t),this.updateDataCellRelevantRowCells(e,t)}updateDataCellRelevantRowCells(e,t){const{rowId:i}=t,{facet:s,interaction:o}=this.spreadsheet,n=e===d.xT.HOVER,{rowHeader:r}=n?o.getHoverHighlight():o.getSelectedCellHighlight();if(r&&i){const o=n?Wo(i,s.getRowCells(),this.spreadsheet.isHierarchyTreeType()):function(e,t){var i;const{facet:s,options:o}=t;if(t.isTableMode()){if(!(null===(i=o.seriesNumber)||void 0===i?void 0:i.enable))return[];const t=s.getColLeafNodes()[0].id,n=xe(String(e.rowIndex),t),r=[],l=s.getCellById(n);return l&&l instanceof Fi&&r.push(l),r}return Wo(e.rowId,s.getRowCells(),t.isHierarchyTreeType())}(t,this.spreadsheet),r=[...s.getSeriesNumberCells().filter(e=>o.find(t=>t.getMeta().y===e.getMeta().y)),...o];(0,a.forEach)(r,t=>{t.updateByState(e)})}}updateDataCellRelevantColCells(e,t){const{colId:i}=t,{facet:s,interaction:o}=this.spreadsheet,{colHeader:n}=e===d.xT.HOVER?o.getHoverHighlight():o.getSelectedCellHighlight();n&&i&&((e,t,i)=>{if(e){const s=Wo(e,t);(0,a.forEach)(s,e=>{e.updateByState(i)})}})(i,s.getColCells(),e)}emitSelectEvent(e){const{interaction:t}=this.spreadsheet,{cells:i}=e,s=(0,A.Tt)(e,["cells"]),o=i||t.getActiveCells(),n=(null==s?void 0:s.targetCell)||o[0],r=Object.assign(Object.assign({},s),{targetCell:n}),l=null==n?void 0:n.cellType,a={[d.vZ.CORNER_CELL]:m.CORNER_CELL_SELECTED,[d.vZ.ROW_CELL]:m.ROW_CELL_SELECTED,[d.vZ.COL_CELL]:m.COL_CELL_SELECTED,[d.vZ.DATA_CELL]:m.DATA_CELL_SELECTED}[l];a&&(this.spreadsheet.emit(a,o,r),this.spreadsheet.emit(m.GLOBAL_SELECTED,o,r))}}const Bn=12,An=(e,t)=>{var i,s;const{basicColors:o,others:n}=e,r=null==t?void 0:t.isTableMode(),l=ve()?"bold":700;return{text:{fontFamily:Di,fontSize:Bn,fontWeight:l,fill:o[0],opacity:1,textAlign:r?"center":"left",textBaseline:"middle"},bolderText:{fontFamily:Di,fontSize:Bn,fontWeight:l,fill:o[0],opacity:1,textAlign:r?"center":"right",textBaseline:"middle"},measureText:{fontFamily:Di,fontSize:Bn,fontWeight:l,fill:o[0],opacity:1,textAlign:"left",textBaseline:"middle"},cell:{backgroundColor:o[3],backgroundColorOpacity:1,horizontalBorderColor:o[10],horizontalBorderColorOpacity:1,verticalBorderColor:o[10],verticalBorderColorOpacity:1,horizontalBorderWidth:1,verticalBorderWidth:1,borderDash:[],padding:{top:8,right:8,bottom:8,left:8},interactionState:{hover:{backgroundColor:o[4],backgroundOpacity:.6},selected:{backgroundColor:o[4],backgroundOpacity:.6},unselected:{backgroundOpacity:.3,textOpacity:.3,opacity:.3},prepareSelect:{borderColor:o[14],borderOpacity:1,borderWidth:1},searchResult:{backgroundColor:null!==(i=null==n?void 0:n.results)&&void 0!==i?i:o[2],backgroundOpacity:1},highlight:{backgroundColor:null!==(s=null==n?void 0:n.highlight)&&void 0!==s?s:o[6],backgroundOpacity:1}}},icon:{fill:o[0],size:10,margin:{right:4,left:4}}}},Mn=(e,t)=>{var i,s;const{basicColors:o,others:n}=e,r=null==t?void 0:t.isTableMode(),l=ve()?"bold":700;return{seriesText:{fontFamily:Di,fontSize:Bn,fontWeight:"normal",fill:o[14],linkTextFill:o[6],opacity:1,textBaseline:"middle",textAlign:"center"},measureText:{fontFamily:Di,fontSize:Bn,fontWeight:"normal",fill:o[14],linkTextFill:o[6],opacity:1,textAlign:r?"center":"left",textBaseline:"middle"},bolderText:{fontFamily:Di,fontSize:Bn,fontWeight:l,fill:o[14],linkTextFill:o[6],opacity:1,textAlign:r?"center":"left",textBaseline:"middle"},text:{fontFamily:Di,fontSize:Bn,fontWeight:"normal",fill:o[14],linkTextFill:o[6],opacity:1,textBaseline:"middle",textAlign:r?"center":"left"},cell:{backgroundColor:o[1],backgroundColorOpacity:1,horizontalBorderColor:o[9],horizontalBorderColorOpacity:1,verticalBorderColor:o[9],verticalBorderColorOpacity:1,horizontalBorderWidth:1,verticalBorderWidth:1,borderDash:[],padding:{top:8,right:8,bottom:8,left:8},interactionState:{hover:{backgroundColor:o[2],backgroundOpacity:.6},selected:{backgroundColor:o[2],backgroundOpacity:.6},unselected:{backgroundOpacity:.3,textOpacity:.3,opacity:.3},prepareSelect:{borderColor:o[14],borderOpacity:1,borderWidth:1},searchResult:{backgroundColor:null!==(i=null==n?void 0:n.results)&&void 0!==i?i:o[2],backgroundOpacity:1},highlight:{backgroundColor:null!==(s=null==n?void 0:n.highlight)&&void 0!==s?s:o[6],backgroundOpacity:1}}},icon:{fill:o[14],size:10,margin:{right:4,left:4}},seriesNumberWidth:80}},Dn=e=>{var t,i;const{basicColors:s,others:o}=e,n=ve()?"bold":700;return{measureText:{fontFamily:Di,fontSize:Bn,fontWeight:"normal",fill:s[0],opacity:1,textAlign:"right",textBaseline:"middle",linkTextFill:s[6]},bolderText:{fontFamily:Di,fontSize:Bn,fontWeight:n,fill:s[0],opacity:1,textAlign:"center",textBaseline:"middle",linkTextFill:s[6]},text:{fontFamily:Di,fontSize:Bn,fontWeight:"normal",fill:s[0],opacity:1,textAlign:"center",textBaseline:"middle",linkTextFill:s[6]},cell:{backgroundColor:s[3],backgroundColorOpacity:1,horizontalBorderColor:s[10],horizontalBorderColorOpacity:1,verticalBorderColor:s[10],verticalBorderColorOpacity:1,horizontalBorderWidth:1,verticalBorderWidth:1,borderDash:[],padding:{top:8,right:8,bottom:8,left:8},interactionState:{hover:{backgroundColor:s[4],backgroundOpacity:.6},selected:{backgroundColor:s[4],backgroundOpacity:.6},unselected:{backgroundOpacity:.3,textOpacity:.3,opacity:.3},prepareSelect:{borderColor:s[14],borderOpacity:1,borderWidth:1},searchResult:{backgroundColor:null!==(t=null==o?void 0:o.results)&&void 0!==t?t:s[2],backgroundOpacity:1},highlight:{backgroundColor:null!==(i=null==o?void 0:o.highlight)&&void 0!==i?i:s[6],backgroundOpacity:1}}},icon:{fill:s[0],size:10,margin:{top:6,right:4,bottom:6,left:4}}}},Hn=e=>{var t,i;const{basicColors:s,others:o,semanticColors:n}=e,r=ve()?"bold":700;return{bolderText:{fontFamily:Di,fontSize:Bn,fontWeight:r,fill:s[13],opacity:1,textAlign:"right",textBaseline:"middle",linkTextFill:s[6]},text:{fontFamily:Di,fontSize:Bn,fontWeight:"normal",fill:s[13],opacity:1,textAlign:"right",textBaseline:"middle",linkTextFill:s[6]},cell:{crossBackgroundColor:s[1],backgroundColor:s[8],backgroundColorOpacity:1,horizontalBorderColor:s[9],horizontalBorderColorOpacity:1,verticalBorderColor:s[9],verticalBorderColorOpacity:1,horizontalBorderWidth:1,verticalBorderWidth:1,padding:{top:8,right:8,bottom:8,left:8},interactionState:{hover:{backgroundColor:s[2],backgroundOpacity:.6},hoverFocus:{backgroundColor:s[2],backgroundOpacity:.6,borderColor:s[14],borderWidth:1,borderOpacity:1},selected:{backgroundColor:s[2],backgroundOpacity:.6},unselected:{backgroundOpacity:.3,textOpacity:.3,opacity:.3},searchResult:{backgroundColor:null!==(t=null==o?void 0:o.results)&&void 0!==t?t:s[2],backgroundOpacity:1},highlight:{backgroundColor:null!==(i=null==o?void 0:o.highlight)&&void 0!==i?i:s[6],backgroundOpacity:1},prepareSelect:{borderColor:s[14],borderOpacity:1,borderWidth:1}}},miniChart:{line:{point:{size:2.2,fill:s[6],opacity:1},linkLine:{size:1.5,fill:s[6],opacity:.6}},bar:{intervalPadding:4,fill:s[6],opacity:1},bullet:{progressBar:{widthPercent:.6,height:10,innerHeight:6},comparativeMeasure:{width:1,height:12,fill:s[13],opacity:.25},rangeColors:{good:null==n?void 0:n.green,satisfactory:n.yellow,bad:n.red},backgroundColor:"#E9E9E9"},interval:{height:12,fill:s[7]}},icon:{fill:s[13],size:10,margin:{right:4,left:4}}}};class kn{constructor(e){this.viewport=(0,ge.fU)()?void 0:window,this.init=()=>{(0,ge.fU)()||(this.initDevicePixelRatioListener(),this.initDeviceZoomListener())},this.destroy=()=>{(0,ge.fU)()||(this.removeDevicePixelRatioListener(),this.removeDeviceZoomListener())},this.removeDevicePixelRatioListener=()=>{var e;(null===(e=this.devicePixelRatioMedia)||void 0===e?void 0:e.removeEventListener)?this.devicePixelRatioMedia.removeEventListener("change",this.renderByDevicePixelRatioChanged):this.devicePixelRatioMedia.removeListener(this.renderByDevicePixelRatioChanged)},this.initDeviceZoomListener=()=>{var e,t;me()||null===(t=null===(e=this.viewport)||void 0===e?void 0:e.visualViewport)||void 0===t||t.addEventListener("resize",this.renderByZoomScaleWithoutResizeEffect)},this.removeDeviceZoomListener=()=>{var e,t;me()||null===(t=null===(e=this.viewport)||void 0===e?void 0:e.visualViewport)||void 0===t||t.removeEventListener("resize",this.renderByZoomScaleWithoutResizeEffect)},this.renderByZoomScaleWithoutResizeEffect=e=>(0,A.sH)(this,void 0,void 0,function*(){this.isDevicePixelRatioChange=!1,yield this.renderByZoomScale(e)}),this.renderByDevicePixelRatioChanged=()=>(0,A.sH)(this,void 0,void 0,function*(){this.isDevicePixelRatioChange=!0,yield this.renderByDevicePixelRatio()}),this.renderByDevicePixelRatio=(...e)=>(0,A.sH)(this,[...e],void 0,function*(e=window.devicePixelRatio){var t;if(this.spreadsheet.destroyed)return;const{container:i,options:{width:s,height:o}}=this.spreadsheet,n=this.spreadsheet.getCanvasElement(),r=Math.ceil(e);(null!==(t=i.getConfig().devicePixelRatio)&&void 0!==t?t:1)!==r&&n&&(i.getConfig().devicePixelRatio=r,i.resize(s,o),yield this.spreadsheet.render(!1))}),this.renderByZoomScale=(0,a.debounce)(e=>(0,A.sH)(this,void 0,void 0,function*(){if(this.spreadsheet.destroyed)return;const t=e.target,i=Math.ceil(null==t?void 0:t.scale);if(i>=1&&(this.zoomOffsetLeft||0)!==((null==t?void 0:t.offsetLeft)||0)&&!this.isDevicePixelRatioChange){const e=Math.max(i,window.devicePixelRatio);yield this.renderByDevicePixelRatio(e),this.zoomOffsetLeft=t.offsetLeft}}),350),this.spreadsheet=e,this.isDevicePixelRatioChange=!1,this.zoomOffsetLeft=0}initDevicePixelRatioListener(){var e;this.devicePixelRatioMedia=window.matchMedia(`(resolution: ${window.devicePixelRatio}dppx)`),(null===(e=this.devicePixelRatioMedia)||void 0===e?void 0:e.addEventListener)?this.devicePixelRatioMedia.addEventListener("change",this.renderByDevicePixelRatioChanged):this.devicePixelRatioMedia.addListener(this.renderByDevicePixelRatioChanged)}}var zn;!function(e){e.UN_STICKY="UN_STICKY",e.STICKY="STICKY",e.STICKY_EDGE="STICKY_EDGE"}(zn||(zn={}));class Fn{constructor(e){this.stickyS2=null,this.wrapperElement=null,this.stickyContainer=null,this.stickyState=zn.UN_STICKY,this.disposers=[],this.scrollContainer=window,this.isSyncing=!1,this.syncStyle=()=>{if(!this.wrapperElement)return;const e=this.getTableBox();if(!e)return;const{headerHeight:t,tableBottom:i,tableHeight:s,tableLeft:o,tableWidth:n,tableTop:r}=e,l=this.getOffsetTop(),a=this.isWindowScroll()?l:this.scrollContainer.getBoundingClientRect().top+l,{style:d}=this.wrapperElement;return a<r||a>r+s?(this.stickyState=zn.UN_STICKY,void(d.display="none")):(d.display="",d.height=`${t}px`,r<a&&a<i-t?(this.stickyState=zn.STICKY,void(this.isWindowScroll()?(d.position="fixed",d.top=`${a}px`,d.left=`${o}px`,d.width=`${n}px`,d.right=""):(d.position="absolute",d.top=a-r+"px",d.left="0",d.right="0",d.width=""))):void(i-t<=a&&a<=i&&(this.stickyState=zn.STICKY_EDGE,d.position="absolute",d.top=s-t+"px",d.left="0",d.right="0",d.width="")))},this.spreadsheet=e,this.options=this.resolveOptions(),this.scrollContainer=this.resolveScrollContainer(),this.init()}getStickyState(){return this.stickyState}resolveOptions(){var e;const t=null===(e=this.spreadsheet.options.interaction)||void 0===e?void 0:e.stickyHeader;return!t||(0,a.isBoolean)(t)?{}:t}init(){this.createDOM(),this.createStickyS2(),this.bindScrollListener(),this.bindSyncListeners(),this.bindInteractionBridge(),this.renderStickyS2()}createDOM(){const e=this.spreadsheet.getCanvasElement();if(!e)return;const t=e.parentElement;"static"===window.getComputedStyle(t).position&&(t.style.position="relative"),this.wrapperElement=document.createElement("div"),this.wrapperElement.className="s2-sticky-header-wrapper",Object.assign(this.wrapperElement.style,{position:"absolute",top:"0",left:"0",right:"0",zIndex:"10",overflow:"hidden",display:"none"}),this.stickyContainer=document.createElement("div"),this.wrapperElement.appendChild(this.stickyContainer),t.insertBefore(this.wrapperElement,e)}minimizeDataCfg(e){var t;const i=null===(t=null==e?void 0:e.fields)||void 0===t?void 0:t.columns;if(!i)return e;const s={};return e.data.forEach(e=>{const t=i.map(t=>{const i=(0,a.isString)(t)?t:t.field;return String(e[i])}).join("\0");s[t]||(s[t]=e)}),Object.assign(Object.assign({},e),{data:Object.values(s)})}applyStickyOptions(e){var t;return Po(e,this.options.enableInteraction?{style:{dataCell:{height:0}},interaction:{resize:null===(t=e.interaction)||void 0===t?void 0:t.resize,stickyHeader:!1,brushSelection:!1,multiSelection:!1,rangeSelection:!1,selectedCellMove:!1},tooltip:{enable:!0,operation:{hiddenColumns:!1}}}:{style:{dataCell:{height:0}},interaction:{resize:!1,stickyHeader:!1},tooltip:{enable:!1},headerActionIcons:[],showDefaultHeaderActionIcon:!1})}toStickyConfig(){const{dataCfg:e,options:t}=this.spreadsheet;return{dataCfg:this.minimizeDataCfg(e),options:this.applyStickyOptions(t)}}createStickyS2(){if(!this.stickyContainer)return;const{dataCfg:e,options:t}=this.toStickyConfig();this.stickyS2=new(0,this.spreadsheet.constructor)(this.stickyContainer,e,t),this.syncTheme()}syncTheme(){this.stickyS2&&(this.stickyS2.setThemeCfg({name:this.spreadsheet.themeName}),this.stickyS2.theme=this.spreadsheet.theme)}renderStickyS2(){return(0,A.sH)(this,void 0,void 0,function*(){var e,t,i;if(!this.stickyS2)return;const{facet:s}=this.spreadsheet;if(!s)return;const o=this.spreadsheet.getCanvasConfig(),n=null!==(t=null===(e=s.cornerBBox)||void 0===e?void 0:e.height)&&void 0!==t?t:0,r=null!==(i=o.width)&&void 0!==i?i:0;this.stickyS2.changeSheetSize(r,n),yield this.stickyS2.render()})}getOffsetTop(){const{offsetTop:e}=this.options;return(0,a.isFunction)(e)?e():(0,a.isNumber)(e)?e:0}getScrollParent(e){if(!e)return window;let t=e.parentElement;for(;t&&t!==document.body&&t!==document.documentElement;){const e=window.getComputedStyle(t),i=e.getPropertyValue("overflow")+e.getPropertyValue("overflow-y")+e.getPropertyValue("overflow-x");if(/(?:auto|scroll|overlay)/.test(i)&&t.scrollHeight>t.clientHeight)return t;t=t.parentElement}return window}resolveScrollContainer(){if(this.options.scrollContainer)return this.options.scrollContainer;const e=this.spreadsheet.getCanvasElement();return this.getScrollParent(e)}isWindowScroll(){return this.scrollContainer===window}getTableBox(){var e,t;const i=this.spreadsheet.getCanvasElement();if(!i)return null;const s=i.getBoundingClientRect(),{facet:o}=this.spreadsheet;if(!o)return null;const n=s.top,r=s.left,l=s.width,a=null!==(t=null===(e=o.cornerBBox)||void 0===e?void 0:e.height)&&void 0!==t?t:0,d=s.height,c=o.getContentHeight(),h=Math.min(c,d);return{tableTop:n,tableLeft:r,tableWidth:l,tableHeight:h,tableBottom:n+h,headerHeight:a}}bindScrollListener(){const e=(0,a.throttle)(this.syncStyle,16);this.scrollContainer.addEventListener("scroll",e,{passive:!0}),this.disposers.push(()=>{this.scrollContainer.removeEventListener("scroll",e)})}bindSyncListeners(){const{spreadsheet:e}=this,t=e=>{var t;(null===(t=this.stickyS2)||void 0===t?void 0:t.facet)&&this.stickyS2.facet.updateScrollOffset({offsetX:{value:e.scrollX,animate:!1},offsetY:{value:e.scrollY,animate:!1},rowHeaderOffsetX:{value:e.rowHeaderScrollX,animate:!1}})};e.on(m.GLOBAL_SCROLL,t),this.disposers.push(()=>{e.off(m.GLOBAL_SCROLL,t)});const i=()=>{if(this.stickyS2&&!this.isSyncing){this.isSyncing=!0;try{const{dataCfg:t,options:i}=this.toStickyConfig();this.stickyS2.setDataCfg(t),this.stickyS2.setOptions(i),this.syncTheme();const s=e.getCanvasConfig();this.stickyS2.changeSheetSize(s.width,e.facet.cornerBBox.height),this.stickyS2.render(!1),this.syncStyle()}finally{this.isSyncing=!1}}},s=[m.LAYOUT_AFTER_RENDER,m.LAYOUT_RESIZE];s.forEach(t=>{e.on(t,i)}),this.disposers.push(()=>{s.forEach(t=>{e.off(t,i)})})}bindInteractionBridge(){if(!this.options.enableInteraction||!this.stickyS2)return;const{stickyS2:e,spreadsheet:t}=this;e.on(m.LAYOUT_RESIZE,e=>(0,A.sH)(this,void 0,void 0,function*(){e.style&&(t.setOptions({style:e.style}),yield t.render(!1)),t.emit(m.LAYOUT_RESIZE,e)})),e.on(m.RANGE_SORT,e=>(0,A.sH)(this,void 0,void 0,function*(){t.setDataCfg(Object.assign(Object.assign({},t.dataCfg),{sortParams:e})),yield t.render(),t.emit(m.RANGE_SORT,e)})),e.on(m.ROW_CELL_COLLAPSED,e=>{t.emit(m.ROW_CELL_COLLAPSED__PRIVATE,e),this.scrollToTableTop()}),e.on(m.ROW_CELL_ALL_COLLAPSED,e=>(0,A.sH)(this,void 0,void 0,function*(){t.setOptions({style:{rowCell:{collapseAll:e,collapseFields:null,expandDepth:null}}}),yield t.render(!1),t.emit(m.ROW_CELL_ALL_COLLAPSED,e),this.scrollToTableTop()}))}scrollToTableTop(){var e;const t=this.spreadsheet.getCanvasElement();null===(e=null==t?void 0:t.scrollIntoView)||void 0===e||e.call(t,{behavior:"smooth",block:"start"})}destroy(){this.disposers.forEach(e=>e()),this.disposers=[],this.stickyS2&&(this.stickyS2.destroy(),this.stickyS2=null),this.wrapperElement&&(this.wrapperElement.remove(),this.wrapperElement=null),this.stickyContainer=null,this.stickyState=zn.UN_STICKY}}var Pn=i("./node_modules/.pnpm/style-loader@3.3.4_webpack@5.108.4/node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"),jn=i.n(Pn),Wn=i("./node_modules/.pnpm/style-loader@3.3.4_webpack@5.108.4/node_modules/style-loader/dist/runtime/styleDomAPI.js"),Gn=i.n(Wn),Vn=i("./node_modules/.pnpm/style-loader@3.3.4_webpack@5.108.4/node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js"),$n=i.n(Vn),Un=i("./node_modules/.pnpm/style-loader@3.3.4_webpack@5.108.4/node_modules/style-loader/dist/runtime/insertStyleElement.js"),Yn=i.n(Un),Xn=i("./node_modules/.pnpm/style-loader@3.3.4_webpack@5.108.4/node_modules/style-loader/dist/runtime/styleTagTransform.js"),Zn=i.n(Xn),qn=i("./node_modules/.pnpm/css-loader@6.11.0_webpack@5.108.4/node_modules/css-loader/dist/cjs.js!./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/ui/tooltip/index.css"),Kn={};Kn.styleTagTransform=Zn(),Kn.setAttributes=$n(),Kn.insert=function(e){const t=document.querySelector("head"),i=window._lastElementInsertedByStyleLoader;i?i.nextSibling?t.insertBefore(e,i.nextSibling):t.appendChild(e):t.insertBefore(e,t.firstChild),window._lastElementInsertedByStyleLoader=e},Kn.domAPI=Gn(),Kn.insertStyleElement=Yn();jn()(qn.A,Kn);class Jn{constructor(e){this.visible=!1,this.position={x:0,y:0},this.spreadsheet=e}show(e){var t,i,s;const{position:o,content:n,event:r}=e,{autoAdjustBoundary:l,adjustPosition:a}=this.spreadsheet.options.tooltip||{};this.visible=!0,this.options=e;const d=this.getContainer();this.renderContent(n);const{x:c,y:h}=(({spreadsheet:e,position:t,tooltipContainer:i,autoAdjustBoundary:s})=>{const o=e.getCanvasElement();let n=t.x+Do,r=t.y+Ho;if(!s||!o)return{x:n,y:r};const l="body"===s,{maxX:a,maxY:d}=e.facet.panelBBox,{width:c,height:h}=e.options,{top:u,left:p}=o.getBoundingClientRect(),{width:g,height:m}=i.getBoundingClientRect(),{width:v,height:f}=document.body.getBoundingClientRect(),C=l?v:Math.min(c,a)+p,y=l?f:Math.min(h,d)+u;return n+g>=C&&(n=C-g),r+m>=y&&(r=y-m),{x:n,y:r}})({spreadsheet:this.spreadsheet,position:o,tooltipContainer:d,autoAdjustBoundary:l});this.position=null!==(t=null==a?void 0:a({position:{x:c,y:h},event:r}))&&void 0!==t?t:{x:c,y:h},Jo(d,{style:{left:`${null===(i=this.position)||void 0===i?void 0:i.x}px`,top:`${null===(s=this.position)||void 0===s?void 0:s.y}px`,pointerEvents:"all"},visible:!0,dark:"dark"===this.spreadsheet.getThemeName()})}hide(){this.visible=!1,this.container&&(Jo(this.container,{style:{pointerEvents:"none"},visible:!1}),this.resetPosition())}destroy(){var e,t;this.visible=!1,this.container&&(this.resetPosition(),null===(t=(e=this.container).remove)||void 0===t||t.call(e),this.container=null)}renderContent(e){var t,i,s,o;if(!this.container)return;this.clearContent();const{content:n}=this.spreadsheet.options.tooltip||{},r=null!=e?e:n;return(0,a.isNil)(r)?void 0:"string"==typeof r?(this.container.innerHTML=r,void(null===(i=(t=this.options).onMounted)||void 0===i||i.call(t))):void(r instanceof Element&&(this.container.appendChild(r),null===(o=(s=this.options).onMounted)||void 0===o||o.call(s)))}clearContent(){this.container&&(this.container.innerHTML="")}disablePointerEvent(){this.container&&"none"!==this.container.style.pointerEvents&&Jo(this.container,{style:{pointerEvents:"none"}})}resetPosition(){this.position={x:0,y:0}}getContainer(){var e;if(!this.container){const{tooltip:t}=this.spreadsheet.options,i=(null===(e=null==t?void 0:t.getContainer)||void 0===e?void 0:e.call(t))||document.body,s=document.createElement("div");return Jo(s,{style:null==t?void 0:t.style,className:[Bo].concat(null==t?void 0:t.className)}),i.appendChild(s),this.container=s,this.container}return this.container}}const Qn=`${Ai.u}-offscreen-canvas`;class er extends Xs.A{constructor(e,t,i){super(),this.store=new zo,this.stickyHeaderController=null,this.destroyed=!1,this.measureText=(0,a.memoize)((e,t)=>{if(!t)return null;const i=(()=>{if(!(0,ge.Wt)())return null;let e=document.getElementById(Qn);return e||(e=document.createElement("canvas"),e.id=Qn,e.style.display="none",document.body.appendChild(e),e)})()||this.getCanvasElement(),s=null==i?void 0:i.getContext("2d"),{fontSize:o,fontFamily:n,fontWeight:r,fontStyle:l,fontVariant:a}=t;return s.font=[l,a,r,`${o}px`,n].join(" ").trim(),s.measureText(String(e))},(e,t)=>[e,...(0,a.values)(t)].join("")),this.measureTextWidth=(e,t)=>{const i=this.measureText(e,t);return(null==i?void 0:i.width)||0},this.measureTextHeight=(e,t)=>{const i=this.measureText(e,t);return i?i.actualBoundingBoxAscent+i.actualBoundingBoxDescent:0},this.measureTextWidthRoughly=(e,t)=>{const i=this.measureTextWidth("a",t),s=this.measureTextWidth("蚂",t);let o=0;if(!e)return o;for(const t of String(e)){const e=t.charCodeAt(0);o+=e>=0&&e<=255?i:s}return o},this.setupDataConfig(t),this.setupOptions(i),this.dataSet=this.getDataSet(),this.setDebug(),this.initTooltip(),this.initContainer(e),this.bindEvents(),this.initInteraction(),this.initTheme(),this.initHdAdapter(),this.registerIcons(),this.setOverscrollBehavior(),this.mountSheetInstance(),this.initStickyHeader()}setupDataConfig(e){this.dataCfg=jo(e)}setupOptions(e){this.options=((...e)=>Po(Xi,...e))(e)}isCustomHeaderFields(e){const{fields:t}=this.dataCfg;return(0,a.some)(e?null==t?void 0:t[e]:[...null==t?void 0:t.rows,...null==t?void 0:t.columns],e=>!(0,a.isString)(e))}isCustomColumnFields(){return this.isCustomHeaderFields("columns")}setOverscrollBehavior(){if((0,ge.fU)()||!(0,ge.Wt)())return;const{overscrollBehavior:e}=this.options.interaction,t=window.getComputedStyle(document.body).getPropertyValue("overscroll-behavior");t&&"auto"!==t?this.store.set("initOverscrollBehavior",t):e&&(document.body.style.overscrollBehavior=e)}restoreOverscrollBehavior(){(0,ge.Wt)()&&(document.body.style.overscrollBehavior=this.store.get("initOverscrollBehavior")||"")}setDebug(){Zi.U.getInstance().setDebug(this.options.debug)}initTheme(){this.setThemeCfg({name:"default"})}getMountContainer(e){const t=(0,a.isString)(e)?document.querySelector(e):e;if(!t)throw new Error("Target mount container is not a DOM element");return t}initHdAdapter(){this.options.hd&&(this.hdAdapter=new kn(this),this.hdAdapter.init())}initStickyHeader(){var e;if(!(null===(e=this.options.interaction)||void 0===e?void 0:e.stickyHeader))return;const t=()=>{var e;this.off(m.LAYOUT_AFTER_RENDER,t),null===(e=this.stickyHeaderController)||void 0===e||e.destroy(),this.stickyHeaderController=new Fn(this)};this.on(m.LAYOUT_AFTER_RENDER,t)}initInteraction(){var e,t;null===(t=null===(e=this.interaction)||void 0===e?void 0:e.destroy)||void 0===t||t.call(e),this.interaction=new Nn(this)}initTooltip(){var e,t,i,s;null===(t=null===(e=this.tooltip)||void 0===e?void 0:e.destroy)||void 0===t||t.call(e),this.tooltip=this.renderTooltip(),this.tooltip instanceof Jn||console.warn(`[Custom Tooltip]: ${null===(s=null===(i=this.tooltip)||void 0===i?void 0:i.constructor)||void 0===s?void 0:s.toString()} should be extends from BaseTooltip`)}renderTooltip(){var e,t;return(null===(t=null===(e=this.options.tooltip)||void 0===e?void 0:e.render)||void 0===t?void 0:t.call(e,this))||new Jn(this)}getTargetCell(e){return this.getCell(e)||(0,a.last)(this.interaction.getInteractedCells())}showTooltip(e){const{content:t,event:i}=e,s=this.getTargetCell(null==i?void 0:i.target),o=(0,a.isFunction)(t)?t(s,e):t;return new Promise(t=>{var i,s;const n=Object.assign(Object.assign({},e),{content:o,onMounted:t});null===(s=null===(i=this.tooltip)||void 0===i?void 0:i.show)||void 0===s||s.call(i,n)})}showTooltipWithInfo(e,t,i){var s;const{enable:o,content:n}=ln(this,e);if(!o)return;const r=this.getTargetCell(null==e?void 0:e.target),l=null!==(s=null==i?void 0:i.data)&&void 0!==s?s:nn({spreadsheet:this,cellInfos:t,targetCell:r,options:Object.assign({enableFormat:!0},i)});return this.showTooltip({data:l,position:{x:e.clientX,y:e.clientY},options:i,event:e,content:n})}hideTooltip(){var e,t;null===(t=null===(e=this.tooltip)||void 0===e?void 0:e.hide)||void 0===t||t.call(e)}destroyTooltip(){var e,t;null===(t=null===(e=this.tooltip)||void 0===e?void 0:e.destroy)||void 0===t||t.call(e)}registerIcons(){const e=this.options.customSVGIcons;(0,a.isEmpty)(e)||(0,a.forEach)(e,e=>{(0,ko.p)(e.name,e.src)})}setDataCfg(e,t){this.store.set("originalDataCfg",e),this.dataCfg=t?jo(e):jo(this.dataCfg,e),this.store.set(G,V)}setOptions(e,t){var i;this.hideTooltip(),t?this.setupOptions(e):this.options=Po(this.options,e),(t||(null===(i=null==e?void 0:e.tooltip)||void 0===i?void 0:i.render))&&this.initTooltip(),this.resetHiddenColumnsDetailInfoIfNeeded(),this.registerIcons(),this.syncStickyHeader()}syncStickyHeader(){var e;const t=!!(null===(e=this.options.interaction)||void 0===e?void 0:e.stickyHeader);this.stickyHeaderController&&(this.stickyHeaderController.destroy(),this.stickyHeaderController=null),t&&this.initStickyHeader()}resetDataCfg(){this.setDataCfg(null,!0)}resetOptions(){this.setOptions(null,!0)}resetHiddenColumnsDetailInfoIfNeeded(){var e;(0,a.isEmpty)(null===(e=this.options.interaction)||void 0===e?void 0:e.hiddenColumnFields)||this.store.set("hiddenColumnsDetail",[])}doRender(e){return(0,A.sH)(this,void 0,void 0,function*(){const t=this.getCanvasElement();if(!t||!t.isConnected)return;const{reloadData:i=!0,rebuildDataSet:s=!1,rebuildHiddenColumnsDetail:o=!0}=e||{};this.emit(m.LAYOUT_BEFORE_RENDER),s&&(this.dataSet=this.getDataSet()),i&&(this.clearDrillDownData("",!0),this.dataSet.setDataCfg(this.dataCfg)),this.buildFacet(),o&&(yield this.initHiddenColumnsDetail()),this.emit(m.LAYOUT_AFTER_RENDER)})}render(e){return(0,A.sH)(this,void 0,void 0,function*(){if(this.destroyed)return;const t="boolean"==typeof e?{reloadData:e}:e;yield this.container.ready,yield this.doRender(t)})}mountSheetInstance(){const e=this.getCanvasElement();e&&(e.__s2_instance__=this)}unmountSheetInstance(){const e=this.getCanvasElement();e&&delete e.__s2_instance__}destroy(){var e,t,i,s,o,n;this.destroyed||(this.destroyed=!0,this.restoreOverscrollBehavior(),this.emit(m.LAYOUT_DESTROY),null===(e=this.stickyHeaderController)||void 0===e||e.destroy(),this.stickyHeaderController=null,null===(t=this.facet)||void 0===t||t.destroy(),null===(i=this.hdAdapter)||void 0===i||i.destroy(),null===(s=this.interaction)||void 0===s||s.destroy(),null===(o=this.store)||void 0===o||o.clear(),this.destroyTooltip(),this.clearCanvasEvent(),this.unmountSheetInstance(),null===(n=this.container)||void 0===n||n.destroy(),(()=>{var e;(0,ge.Wt)()&&(null===(e=document.getElementById(Qn))||void 0===e||e.remove())})())}setThemeName(e){this.themeName=e}setThemeCfg(e={},t){const i=(null==e?void 0:e.theme)||{},s=(e=>{var t;const i=(null==e?void 0:e.palette)||ki(null==e?void 0:e.name),{basicColors:s}=i,o=null==e?void 0:e.spreadsheet,n=null===(t=null==e?void 0:e.getCustomTheme)||void 0===t?void 0:t.call(e,i,o);return(0,a.merge)({cornerCell:An(i,o),rowCell:Mn(i,o),colCell:Dn(i),dataCell:Hn(i),mergedCell:Hn(i),resizeArea:{size:3,background:s[7],backgroundOpacity:0,guideLineColor:s[7],guideLineDisableColor:"rgba(0,0,0,0.25)",guideLineDash:[3,3],interactionState:{hover:{backgroundColor:s[7],backgroundOpacity:1}}},scrollBar:{trackColor:"rgba(0,0,0,0.01)",thumbHoverColor:"rgba(0,0,0,0.25)",thumbColor:"rgba(0,0,0,0.15)",thumbHorizontalMinSize:32,thumbVerticalMinSize:32,size:me()?3:6,hoverSize:me()?4:8,lineCap:"round"},splitLine:{horizontalBorderColor:s[12],horizontalBorderColorOpacity:.2,horizontalBorderWidth:2,verticalBorderColor:s[11],verticalBorderColorOpacity:.25,verticalBorderWidth:2,showShadow:!0,shadowWidth:8,shadowColors:{left:"rgba(0,0,0,0.1)",right:"rgba(0,0,0,0)"},borderDash:[]},prepareSelectMask:{backgroundColor:s[5],backgroundOpacity:.3},background:{color:s[8],opacity:1},empty:{icon:{fill:"",width:64,height:41,margin:{top:0,right:0,bottom:24,left:0}},description:{fontFamily:Di,fontSize:Bn,fontWeight:"normal",fill:s[14],opacity:1}}},n)})(Object.assign(Object.assign({},e),{spreadsheet:this,getCustomTheme:t}));this.theme=Po(s,i),this.setThemeName(null==e?void 0:e.name)}setTheme(e){this.theme=Po(this.theme,e)}getTheme(){return this.theme}getThemeName(){return this.themeName}updatePagination(e){this.options=Po(this.options,{pagination:e}),this.facet.resetScrollOffset()}changeSheetSize(e=this.options.width,t=this.options.height){const i=this.getCanvasElement(),{width:s,height:o}=this.container.getConfig();(e!==s||t!==o)&&i&&(this.options=Po(this.options,{width:e,height:t}),this.container.resize(e,t))}on(e,t){return super.on(e,t)}emit(e,...t){super.emit(e,...t)}getCanvas(){return this.container}getCanvasConfig(){return this.getCanvas().getConfig()}getCanvasElement(){return this.getCanvas().getContextService().getDomElement()}getLayoutWidthType(){var e;return null===(e=this.options.style)||void 0===e?void 0:e.layoutWidthType}isCellType(e){return e instanceof Ce}getCell(e){let t=e;for(;t&&!(t instanceof l.Hl);){if(this.isCellType(t))return t;t=null==t?void 0:t.parentNode}return null}getCellType(e){const t=this.getCell(e);return null==t?void 0:t.cellType}getTotalsConfig(e){const{totals:t}=this.options,{rows:i}=this.dataSet.fields,s=(0,a.get)(t,(0,a.includes)(i,e)?"row":"col",{}),o=!(!s.showSubTotals||!(0,a.includes)(s.subTotalsDimensions,e))&&s.showSubTotals;return Object.assign(Object.assign({grandTotalsLabel:(0,Gi.Ru)("总计"),subTotalsLabel:(0,Gi.Ru)("小计"),grandTotalsGroupDimensions:[],subTotalsGroupDimensions:[]},s),{showSubTotals:o})}initContainer(e){const{width:t,height:i,device:s,transformCanvasConfig:o,rendererConfig:n}=this.options,r=new Io.A4(n),a=null==o?void 0:o(r,this),d=!me(s);this.container=new l.Hl(Object.assign({container:this.getMountContainer(e),width:t,height:i,renderer:r,supportsPointerEvents:d,future:{experimentalRICSyncRTree:!0,experimentalCancelEventPropagation:!0}},a)),this.setupContainerStyle()}setupContainerStyle(){const e=this.getCanvasElement();e&&(e.style.display="block",e.style.userSelect="none")}initHiddenColumnsDetail(){return(0,A.sH)(this,void 0,void 0,function*(){const{hiddenColumnFields:e}=this.options.interaction,t=this.store.get("hiddenColumnsDetail");(0,a.isEmpty)(e)&&(0,a.isEmpty)(t)||(yield k(this,e,!0))})}clearCanvasEvent(){const e=this.getEvents();(0,a.forIn)(e,(e,t)=>{this.off(t)})}updateSortMethodMap(e,t,i=!1){const s=i?null:this.store.get("sortMethodMap");this.store.set("sortMethodMap",Object.assign(Object.assign({},s),{[e]:t}))}getMenuDefaultSelectedKeys(e){const t=this.store.get("sortMethodMap"),i=(0,a.get)(t,e);return i?[i]:[]}handleGroupSort(e,t){e.stopPropagation(),this.interaction.addIntercepts([d.fR.HOVER]);const i=this.getMenuDefaultSelectedKeys(null==t?void 0:t.id),s=this.isTableMode()?[{key:"asc",icon:"groupAsc",label:(0,Gi.Ru)("升序")},{key:"desc",icon:"groupDesc",label:(0,Gi.Ru)("降序")},{key:"none",label:(0,Gi.Ru)("不排序")}]:[{key:"asc",icon:"groupAsc",label:(0,Gi.Ru)("组内升序")},{key:"desc",icon:"groupDesc",label:(0,Gi.Ru)("组内降序")},{key:"none",label:(0,Gi.Ru)("不排序")}];this.showTooltipWithInfo(e,[],{operator:{menu:{selectedKeys:i,items:s,onClick:i=>(0,A.sH)(this,[i],void 0,function*({key:i}){yield this.groupSortByMethod(i,t),this.emit(m.RANGE_SORTED,e)})}},onlyShowOperator:!0})}getSeriesNumberText(){var e;const{text:t,enable:i}=null!==(e=this.options.seriesNumber)&&void 0!==e?e:{};return i?null!=t?t:(0,h.zw)():""}enableAsyncExport(){return!0}}class tr extends er{isCustomRowFields(){return!1}getDataSet(){const{dataSet:e}=this.options;return e?e(this):new ji(this)}isPivotMode(){return!1}isTableMode(){return!0}isHierarchyTreeType(){return!1}isHierarchyGridTreeType(){return!1}isFrozenRowHeader(){return!1}clearDrillDownData(){return(0,A.sH)(this,void 0,void 0,function*(){})}isValueInCols(){return!1}bindEvents(){}buildFacet(){var e,t,i,s,o,n;null!==(e=(n=this.options).dataCell)&&void 0!==e||(n.dataCell=e=>{var t;return(null===(t=this.options.seriesNumber)||void 0===t?void 0:t.enable)&&0===e.colIndex?new Fi(e,this):new zi(e,this)}),null===(t=this.facet)||void 0===t||t.destroy(),this.facet=null!==(o=null===(s=(i=this.options).facet)||void 0===s?void 0:s.call(i,this))&&void 0!==o?o:new Ro(this),this.facet.render()}destroy(){super.destroy(),this.off(m.RANGE_SORT),this.off(m.RANGE_FILTER)}groupSortByMethod(e,t){const{field:i}=t,s={sortFieldId:i,sortMethod:e};this.updateSortMethodMap(t.id,e),this.emit(m.RANGE_SORT,[s])}}class ir extends Pi{constructor(){super(...arguments),this.handleDimensionValuesSort=()=>{(0,a.each)(this.sortParams,e=>{const{sortFieldId:t,sortByMeasure:i}=e;if(!t)return;const s=(e=>{const{dataSet:t,sortParam:i,originValues:s,isSortByMeasure:o}=e;let n;return n=o?Si(e):s,_i({sortParam:i,originValues:s,measureValues:n,dataSet:t})})({dataSet:this,sortParam:e,originValues:[...this.sortedDimensionValues[t]||[]],isSortByMeasure:!(0,a.isEmpty)(i)});this.sortedDimensionValues[t]=s,this.handlePivotMetaSort(t,s)})},this.getTotalStatus=e=>{const{columns:t,rows:i}=this.fields,s=(t,i)=>{if(i){const i=(0,a.find)(t,t=>!(0,a.has)(e,t));return!(!i||i===(0,a.first)(t))}return(0,a.every)(t,t=>!(0,a.has)(e,t))};return{isRowGrandTotal:s((0,Oe.LR)(i)),isRowSubTotal:s(i,!0),isColGrandTotal:s((0,Oe.LR)(t)),isColSubTotal:s(t,!0)}}}getExistValuesByDataItem(e,t){return(0,Oe.K0)(e,t)}setDataCfg(e){super.setDataCfg(e);const{rows:t}=this.fields;this.sortedDimensionValues={},this.rowPivotMeta=new Map,this.colPivotMeta=new Map,this.dimensionValuesCache=new Map,this.transformIndexesData(this.originData,t),this.handleDimensionValuesSort()}transformIndexesData(e,t){const{columns:i,values:s,valueInCols:o}=this.fields;let n;return Zi.U.getInstance().debugCallback(Zi.uK,()=>{n=(0,Oe.Ll)({rows:(0,Oe.AB)(t),columns:(0,Oe.AB)(i),values:s,valueInCols:o,data:e,indexesData:this.indexesData,sortedDimensionValues:this.sortedDimensionValues,rowPivotMeta:this.rowPivotMeta,colPivotMeta:this.colPivotMeta,getExistValuesByDataItem:this.getExistValuesByDataItem}),this.indexesData=n.indexesData,this.rowPivotMeta=n.rowPivotMeta,this.colPivotMeta=n.colPivotMeta,this.sortedDimensionValues=n.sortedDimensionValues}),n}transformDrillDownData(e,t,i){var s;const o=[...Ns.getFieldPath(i,!0),e],n=this.spreadsheet.store,r=null==i?void 0:i.id,l=null!==(s=n.get("drillDownIdPathMap"))&&void 0!==s?s:new Map;l.has(r)&&((0,a.forEach)(l.get(r),e=>{(0,a.unset)(this.indexesData,e)}),(0,Oe.Rl)(this.rowPivotMeta,r));const{paths:d}=this.transformIndexesData(t,o);l.set(r,d),n.set("drillDownIdPathMap",l)}clearDrillDownData(e){const t=this.spreadsheet.store,i=t.get("drillDownIdPathMap");if(!i)return!1;const s=t.get("drillDownDataCache",[]);if(e){const o=i.get(e);o&&(0,a.forEach)(o,e=>{(0,a.unset)(this.indexesData,e)}),(0,Oe.Rl)(this.rowPivotMeta,e),i.delete(e);const n=(0,a.filter)(s,e=>i.has(null==e?void 0:e.rowId));t.set("drillDownDataCache",n);const r=n.map(e=>null==e?void 0:e.drillLevel),l=t.get("drillDownFieldInLevel",[]).filter(e=>(0,a.includes)(r,null==e?void 0:e.drillLevel));t.set("drillDownFieldInLevel",l)}else{i.clear();const e=this.spreadsheet.store.get("originalDataCfg");(0,a.isEmpty)(e)||this.spreadsheet.setDataCfg(e),this.spreadsheet.store.set("drillItemsNum",-1),this.spreadsheet.store.set("drillDownDataCache",[]),this.spreadsheet.store.set("drillDownFieldInLevel",[])}return t.set("drillDownIdPathMap",i),!0}handlePivotMetaSort(e,t){const{rows:i,columns:s}=this.fields;(0,a.includes)(i,e)?this.rowPivotMeta=Ei({pivotMeta:this.rowPivotMeta,dimensions:i,sortFieldId:e,sortedDimensionValues:t}):(0,a.includes)(s,e)&&(this.colPivotMeta=Ei({pivotMeta:this.colPivotMeta,dimensions:s,sortFieldId:e,sortedDimensionValues:t}))}processDataCfg(e){const{data:t,meta:i=[],fields:s,sortParams:o=[]}=e,{columns:n=[],rows:r=[],values:l,valueInCols:d,customValueOrder:c}=s;let h=n,u=r;d?h=this.isCustomMeasuresPosition(c)?this.handleCustomMeasuresOrder(c,h):(0,a.uniq)([...n,ye.GJ]):u=this.isCustomMeasuresPosition(c)?this.handleCustomMeasuresOrder(c,u):(0,a.uniq)([...r,ye.GJ]);return{data:t,meta:this.processMeta(i,(0,Gi.Ru)("数值")),fields:Object.assign(Object.assign({},s),{rows:u,columns:h,values:l}),sortParams:o}}getFieldsAndPivotMetaByField(e){const{rows:t=[],columns:i=[]}=this.fields||{};return t.includes(e)?{dimensions:(0,Oe.AB)(t),pivotMeta:this.rowPivotMeta}:i.includes(e)?{dimensions:(0,Oe.AB)(i),pivotMeta:this.colPivotMeta}:{}}getDimensionValues(e,t={}){var i;const{pivotMeta:s,dimensions:o}=this.getFieldsAndPivotMetaByField(e);if(!s||!o)return[];const n=(0,a.isEmpty)(t);if(this.dimensionValuesCache.has(e)&&n)return null!==(i=this.dimensionValuesCache.get(e))&&void 0!==i?i:[];const r=(0,Oe.uQ)(t,o,ye.YZ),l=(0,Oe.eE)({pivotMeta:s,dimensionValues:r,fields:o,fieldIdx:(0,a.indexOf)(o,e),queryType:be.B.DetailOnly,sortedDimensionValues:this.sortedDimensionValues}),d=(0,a.uniq)(l.map(e=>(0,co.bC)(e.value)));return n&&this.dimensionValuesCache.set(e,d),d}getTotalValue(e,t){const{options:i}=this.spreadsheet,s=(0,a.some)(t)?t:this.getTotalStatus(e),{aggregation:o,calcFunc:n}=function(e,t){const{isRowGrandTotal:i,isRowSubTotal:s,isColGrandTotal:o,isColSubTotal:n}=e,{row:r,col:l}=t||{},{calcGrandTotals:a={},calcSubTotals:d={}}=r||{},{calcGrandTotals:c={},calcSubTotals:h={}}=l||{},u=(e,t)=>{if((e.aggregation||e.calcFunc)&&t)return{aggregation:e.aggregation,calcFunc:e.calcFunc}};return u(c,o)||u(h,n)||u(a,i)||u(d,s)}(s,null==i?void 0:i.totals)||{},r=!(0,a.isEmpty)(null==i?void 0:i.totals)||this.spreadsheet.isHierarchyTreeType()||this.spreadsheet.isHierarchyGridTreeType()?"":v.F4.SUM,l=vi[o||r];if(l||n){const t=this.getCellMultiData({query:e,queryType:be.B.DetailOnly});let i=null;return n?i=n(e,t,this.spreadsheet):l&&(i=l(t,ye.nj)),ci.getCellData(Object.assign(Object.assign({},(0,a.omit)(e,[ye.GJ])),{[e[ye.GJ]]:i}),e[ye.GJ])}}getCellData(e){var t,i,s,o;const{query:n={},rowNode:r,isTotals:l=!1,totalStatus:d}=e||{},{rows:c,columns:h}=this.fields;let u=c;const p=null===(t=this.spreadsheet)||void 0===t?void 0:t.store.get("drillDownIdPathMap"),g=Array.from(null!==(i=null==p?void 0:p.keys())&&void 0!==i?i:[]).some(e=>null==r?void 0:r.id.startsWith(e));r&&g&&(u=null!==(s=Ns.getFieldPath(r,g))&&void 0!==s?s:c);const m=(0,Oe.AB)(u),v=(0,Oe.AB)(h),f=(0,Oe.uQ)(n,m),C=(0,Oe.uQ)(n,v),y=(0,Oe.Ir)({rowDimensionValues:f,colDimensionValues:C,rowPivotMeta:this.rowPivotMeta,colPivotMeta:this.colPivotMeta,rowFields:m,colFields:v,prefix:(0,Oe._K)(m,v)}),w=(0,a.get)(this.indexesData,y);if(w)return ci.getCellData(w,n[ye.GJ]);if(l)return this.getTotalValue(n,d);return(null===(o=this.spreadsheet)||void 0===o?void 0:o.isHierarchyGridTreeType())&&(null==r?void 0:r.isCollapsed)?this.getTotalValue(n,d):void 0}getQueryExtraFields(e){const{values:t=[]}=this.fields,i=e[ye.GJ];return i?(0,a.includes)(t,i)?[i]:[]:t}getCellMultiData(e){const{query:t={},queryType:i=be.B.All,drillDownFields:s=[]}=e||{};(0,a.isEmpty)(t)&&console.warn(`query: ${t} shouldn't be empty, you can get all data from dataCfg if you're intended.\n you should use { EXTRA_FIELD: xxx} as least if you want query all specific value data`);const{rows:o,columns:n}=this.fields,r=(0,a.isEmpty)(s)?o:o.concat(s),l=(0,Oe.AB)(r),d=(0,Oe.AB)(n),c=(0,Oe.uQ)(t,l,ye.YZ),h=(0,Oe.uQ)(t,d,ye.YZ),{rowQueries:u,colQueries:p}=(0,Oe.t$)({rowDimensionValues:c,colDimensionValues:h,rowPivotMeta:this.rowPivotMeta,colPivotMeta:this.colPivotMeta,rowFields:l,colFields:d,sortedDimensionValues:this.sortedDimensionValues,queryType:i}),g=(0,Oe._K)(l,d),m=[];for(const e of u)for(const t of p){const s=(0,Oe.Ir)({rowDimensionValues:e,colDimensionValues:t,rowPivotMeta:this.rowPivotMeta,colPivotMeta:this.colPivotMeta,rowFields:l,colFields:d,prefix:g});let o=!1,n=this.indexesData;for(let e=0;e<s.length;e++){const t=s[e];o?n=(0,Oe.j0)(t)?(0,Oe.$0)(n,i):(0,a.compact)((0,a.map)(n,e=>null==e?void 0:e[t])):(0,Oe.j0)(t)?(o=!0,n=(0,a.compact)([n]),e--):n=null==n?void 0:n[t]}(0,a.isArray)(n)?m.push(...n):n&&m.push(n)}const v=this.getQueryExtraFields(t);return(0,a.flatMap)((0,a.uniq)(m),e=>e?ci.getCellDataList(e,v):[])}getFieldFormatter(e,t){return e===ye.jI?this.getFieldFormatterForTotalValue(t):super.getFieldFormatter(e)}getFieldFormatterForTotalValue(e){let t="";return!this.spreadsheet.isValueInCols()&&e&&(t=(0,a.get)(e.rowQuery,ye.GJ)),t=null!=t?t:(0,a.get)(this.fields.values,0),super.getFieldFormatter(t)}handleCustomMeasuresOrder(e,t){const i=(0,a.uniq)([...t]);return t.length>=e?(i.splice(e,0,ye.GJ),i):[...i,ye.GJ]}isCustomMeasuresPosition(e){return(0,a.isNumber)(e)}getRowData(e){return this.getCellMultiData({query:e.rowQuery})}}class sr extends ir{processDataCfg(e){const t=!this.spreadsheet.isCustomRowFields(),i=e.fields.rows||[],s=t?i:[...i,ye.GJ],o=this.processMeta(e.meta,(0,Gi.Ru)("数值"));return Object.assign(Object.assign({},e),{meta:o,fields:Object.assign(Object.assign({},e.fields),{rows:s,valueInCols:t})})}}const or=e=>{try{return JSON.parse(e)}catch(e){return null}};class nr extends eo{get rowCellTheme(){return this.spreadsheet.theme.rowCell.cell}getCornerCellInstance(...e){var t,i;return(null===(i=(t=this.spreadsheet.options).cornerCell)||void 0===i?void 0:i.call(t,...e))||new ms(...e)}getRowCellInstance(...e){var t,i;return(null===(i=(t=this.spreadsheet.options).rowCell)||void 0===i?void 0:i.call(t,...e))||new ds(...e)}getColCellInstance(...e){var t,i;return(null===(i=(t=this.spreadsheet.options).colCell)||void 0===i?void 0:i.call(t,...e))||new Ti(...e)}doLayout(){const{rowLeafNodes:e,colLeafNodes:t,rowsHierarchy:i,colsHierarchy:s}=this.buildAllHeaderHierarchy();return this.calculateHeaderNodesCoordinate({rowLeafNodes:e,rowsHierarchy:i,colLeafNodes:t,colsHierarchy:s}),{colNodes:s.getNodes(),colsHierarchy:s,rowNodes:i.getNodes(),rowsHierarchy:i,rowLeafNodes:e,colLeafNodes:t}}buildAllHeaderHierarchy(){const{leafNodes:e,hierarchy:t}=Oo({isRowHeader:!0,spreadsheet:this.spreadsheet}),{leafNodes:i,hierarchy:s}=Oo({isRowHeader:!1,spreadsheet:this.spreadsheet});return{rowLeafNodes:e,colLeafNodes:i,rowsHierarchy:t,colsHierarchy:s}}getDataQueryInfo(e,t){var i,s,o,n;const{options:r,dataSet:l}=this.spreadsheet,d=null!==(o=null===(s=null===(i=r.style)||void 0===i?void 0:i.colCell)||void 0===s?void 0:s.hideValue)&&void 0!==o&&o?{[ye.GJ]:null===(n=l.fields.values)||void 0===n?void 0:n[0]}:{},c=(0,a.merge)({},e,t,d);return{dataQuery:c,valueField:c[ye.GJ]}}getCellMeta(e=0,t=0){var i,s;const{options:o,dataSet:n}=this.spreadsheet,{rowLeafNodes:r,colLeafNodes:l}=this.getLayoutResult(),d=r[e],c=l[t];if(!d||!c)return null;const h=d.query,u=c.query,p=d.isTotals||d.isTotalMeasure||c.isTotals||c.isTotalMeasure,g=(0,Oe.i9)(d,c),{dataQuery:m,valueField:v}=this.getDataQueryInfo(h,u),f=n.getCellData({query:m,rowNode:d,isTotals:p,totalStatus:g}),C=(0,a.get)(f,ye.nj,null),y={spreadsheet:this.spreadsheet,x:c.x,y:d.y,width:c.width,height:d.height,data:f,rowIndex:e,colIndex:t,isTotals:p,valueField:v,fieldValue:C,rowQuery:h,colQuery:u,query:Object.assign(Object.assign({},h),u),rowId:d.id,colId:c.id,id:xe(d.id,c.id)};return null!==(s=null===(i=o.layoutCellMeta)||void 0===i?void 0:i.call(o,y))&&void 0!==s?s:y}getPreLevelSampleNode(e,t){return t.getNodes(e.level-1).find(e=>!e.isTotals)}calculateHeaderNodesCoordinate(e){this.calculateRowNodesCoordinate(e),this.calculateColNodesCoordinate(e)}calculateColNodesCoordinate(e){const{colLeafNodes:t,colsHierarchy:i,rowsHierarchy:s}=e;this.calculateColLeafNodesWidth(e),this.calculateColParentNodeWidthAndX(t),this.updateColsHierarchySampleMaxHeightNodes(i,s),this.calculateColNodesHeight(i),this.updateCustomFieldsSampleNodes(i),this.adjustCustomColLeafNodesHeight({leafNodes:t,hierarchy:i}),this.adjustColTotalNodesCoordinate(i)}calculateRowOffsets(){}adjustColTotalNodesCoordinate(e){var t;(0,a.isEmpty)(null===(t=this.spreadsheet.options.totals)||void 0===t?void 0:t.col)||(this.adjustTotalNodesCoordinate({hierarchy:e,isRowHeader:!1,isSubTotal:!0}),this.adjustTotalNodesCoordinate({hierarchy:e,isRowHeader:!1,isSubTotal:!1}))}calculateColLeafNodesWidth(e){const{rowLeafNodes:t,colLeafNodes:i,rowsHierarchy:s,colsHierarchy:o}=e;let n=Ns.blankNode(),r=0;o.getLeaves().forEach(e=>{e.colIndex=r,r++,e.x=n.x+n.width,e.width=this.getColLeafNodesWidth(e,i,t,s.width),o.width+=e.width,n=e})}calculateColNodesHeight(e){e.getNodes().forEach(t=>{if(0===t.level)t.y=0;else{const i=this.getPreLevelSampleNode(t,e);t.y=(null==i?void 0:i.y)+(null==i?void 0:i.height)||0}const i=this.getColNodeHeight({colNode:t,colsHierarchy:e,useCache:!1});t.height=t.isGrandTotals&&!t.isTotalMeasure&&t.isLeaf?e.height:i,lo(this.spreadsheet,null,t)})}getMultipleMap(e,t,i){const{maxLevel:s}=e,o=this.spreadsheet.dataSet,{totals:n}=this.spreadsheet.options,r=o.moreThanOneValue(),{rows:l,columns:a}=o.fields,d=t?l:a,c=t?n.row:n.col,h=i?(null==c?void 0:c.subTotalsGroupDimensions)||[]:(null==c?void 0:c.grandTotalsGroupDimensions)||[],u=o.isEmpty()?[]:h,p=Array.from({length:s+1},()=>1);for(let e=s;e>0;e--){const t=d[e],i=t===ye.GJ&&r;u.includes(t)||i||(p[e-1]+=p[e],p[e]=0)}return p}adjustTotalNodesCoordinate(e){const{hierarchy:t,isRowHeader:i,isSubTotal:s}=e,o=this.getMultipleMap(t,i,s),n=(0,a.filter)(t.getNodes(),e=>s?e.isSubTotals:e.isGrandTotals),r=i?"width":"height";(0,a.forEach)(n,e=>{var i;let n=o[e.level];if(!n&&s){let t=1;for(;n<1;)n=o[e.level-t]-t,t++}let l=0;for(let s=0;s<n;s++)l+=(0,a.get)(null===(i=t.sampleNodesForAllLevels)||void 0===i?void 0:i.find(t=>t.level===e.level+s),[r],0);e[r]=l})}getColLeafNodesWidth(e,t,i,s){const{colCell:o}=this.spreadsheet.options.style,n=this.getColCellDraggedWidth(e);if((0,a.isNumber)(n))return y(n);const r=this.getCellCustomSize(e,null==o?void 0:o.width);return(0,a.isNumber)(r)?y(r):this.spreadsheet.getLayoutWidthType()===Vi.Compact?this.getCompactGridColNodeWidth(e,i):this.spreadsheet.isHierarchyTreeType()?this.getAdaptTreeColWidth(e,t,i):this.getAdaptGridColWidth(t,e,s)}getRowNodeHeight(e){if(!e)return 0;const{rowCell:t}=this.spreadsheet.options.style,i=this.getRowCellHeight(e),s=(null==t?void 0:t.maxLines)>1&&(null==t?void 0:t.wordWrap)||this.spreadsheet.theme.rowCell.text.fontSize>12||this.spreadsheet.theme.rowCell.measureText.fontSize>12||this.spreadsheet.theme.rowCell.seriesText.fontSize>12||this.spreadsheet.theme.rowCell.bolderText.fontSize>12;return this.isCustomRowCellHeight(e)||!s?(e.extra.isCustomHeight=!0,i||0):this.getNodeAdaptiveHeight({meta:e,cell:this.textWrapTempRowCell,defaultHeight:i})}getExpectedCellIconWidth(e,t,i){var s,o;let n=0;if(t)n=1;else{const t=(0,a.map)(this.spreadsheet.options.headerActionIcons,e=>Object.assign(Object.assign({},e),{displayCondition:()=>!0})),i=(0,re.AS)(t,null,e);n=(null==i?void 0:i.icons.length)||0}return n?n*(i.size+(null===(s=i.margin)||void 0===s?void 0:s.left))+(null===(o=i.margin)||void 0===o?void 0:o.right):0}calculateRowNodesAllLevelSampleNodes(e){const{rowsHierarchy:t,colLeafNodes:i}=e,s=this.spreadsheet.isHierarchyTreeType(),o=t.sampleNodesForAllLevels||[];s?t.width=this.getTreeRowHeaderWidth():o.forEach(e=>{var s;e.width=this.getGridRowNodesWidth(e,i),t.width+=e.width;const n=null!==(s=o[e.level-1])&&void 0!==s?s:{x:0,width:0};e.x=(null==n?void 0:n.x)+(null==n?void 0:n.width)}),t.rootNode.width=t.width}getRowLeafNodeHeight(e){var t;const{rowCell:i}=this.spreadsheet.options.style,s=(null==i?void 0:i.maxLines)>1&&(null==i?void 0:i.wordWrap)?Ns.getBranchNodes(e).map(e=>this.getRowNodeHeight(e)):[],o=this.getRowNodeHeight(e);return y(this.isCustomRowCellHeight(e)?o:null!==(t=(0,a.max)(s))&&void 0!==t?t:o)}calculateRowNodesBBox(e){const t=this.spreadsheet.isHierarchyTreeType(),i=e.sampleNodesForAllLevels||[];let s=Ns.blankNode();e.getNodes().forEach(o=>{var n,r;const l=t||!t&&o.isLeaf;if(t)o.width=this.getTreeRowHeaderWidth();else{const e=i[o.level];o.width=null==e?void 0:e.width}if(l){const t=(null!==(n=null==s?void 0:s.rowIndex)&&void 0!==n?n:-1)+1;null!==(r=o.rowIndex)&&void 0!==r||(o.rowIndex=t),o.y=s.y+s.height,o.height=this.getRowLeafNodeHeight(o),s=o,e.height+=o.height}if(t||0===o.level)o.x=0;else{const e=i[o.level-1];o.x=(null==e?void 0:e.x)+(null==e?void 0:e.width)}lo(this.spreadsheet,o,null)})}calculateRowNodesCoordinate(e){const{rowsHierarchy:t,rowLeafNodes:i}=e,s=this.spreadsheet.isHierarchyTreeType();this.calculateRowNodesAllLevelSampleNodes(e),this.calculateRowNodesBBox(t),s||(this.adjustCustomRowLeafNodesWidth({leafNodes:i,hierarchy:t}),this.calculateRowNodeHeightAndY(i),this.adjustRowTotalNodesCoordinate(t))}adjustRowTotalNodesCoordinate(e){var t;(0,a.isEmpty)(null===(t=this.spreadsheet.options.totals)||void 0===t?void 0:t.row)||(this.adjustTotalNodesCoordinate({hierarchy:e,isRowHeader:!0,isSubTotal:!1}),this.adjustTotalNodesCoordinate({hierarchy:e,isRowHeader:!0,isSubTotal:!0}))}calculateRowNodeHeightAndY(e){let t=null,i=0;const s=e.slice(0);for(;i<s.length;){const e=s[i++],o=null==e?void 0:e.parent;t!==o&&o&&(s.push(o),o.y=o.children[0].y,o.height=(0,a.sumBy)(o.children,"height"),t=o)}}getGridRowNodesWidth(e,t){const{rowCell:i}=this.spreadsheet.options.style,s=this.getRowCellDraggedWidth(e);if((0,a.isNumber)(s))return y(s);const o=this.getCellCustomSize(e,null==i?void 0:i.width);return(0,a.isNumber)(o)?y(o):this.spreadsheet.getLayoutWidthType()!==Vi.Adaptive?this.getCompactGridRowNodeWidth(e):this.getAdaptGridColWidth(t)}getAdaptTreeColWidth(e,t,i){const s=this.getCanvasSize().width-this.getSeriesNumberWidth()-T.getVerticalBorderWidth(this.spreadsheet),o=Math.min(s/2,this.getTreeRowHeaderWidth()),n=Math.max(1,t.length),{dataCell:r}=this.spreadsheet.options.style;return y(Math.max((0,fe.jv)(r,this.getColLabelLength(e,i)),C((s-o)/n)))}getColLabelLength(e,t){const i=or(null==e?void 0:e.value);if((0,a.isArray)(i))return i.length;let s=1;for(let i=0;i<50;i++){const o=t[i];if(!o)return s;const n=this.spreadsheet.dataSet.getCellData({query:Object.assign(Object.assign({},e.query),o.query),rowNode:o,isTotals:e.isTotals||e.isTotalMeasure||o.isTotals||o.isTotalMeasure}),r=(0,a.keys)(n);for(let e=0;e<r.length;e++){const t=(0,a.get)(n,r[e]),i=(0,a.size)((0,a.get)(null==t?void 0:t.values,"0"));i>s&&(s=i)}}return s}getAdaptGridColWidth(e,t,i){const{rows:s=[]}=this.spreadsheet.dataSet.fields,{dataCell:o}=this.spreadsheet.options.style,n=s.length,r=e.length,{width:l}=this.getCanvasSize(),a=l-this.getSeriesNumberWidth()-T.getVerticalBorderWidth(this.spreadsheet),d=Math.max(1,n+r);return y(i?Math.max((0,fe.jv)(o),C((a-i)/r)):Math.max((0,fe.jv)(o),C(a/d)))}getTreeRowHeaderWidth(){var e,t,i,s;const{rowCell:o}=this.spreadsheet.options.style;if((0,a.isNumber)(null==o?void 0:o.treeWidth))return y(o.treeWidth);const n=this.getCellCustomSize(null,null==o?void 0:o.width);if((0,a.isNumber)(n))return y(n);const r=As.getTreeCornerText(this.spreadsheet),{bolderText:l,icon:d}=this.spreadsheet.theme.cornerCell,c=this.measureTextWidth(r,l)+2*d.size+(null===(e=d.margin)||void 0===e?void 0:e.left)+(null===(t=d.margin)||void 0===t?void 0:t.right)+(null===(i=this.rowCellTheme.padding)||void 0===i?void 0:i.left)+(null===(s=this.rowCellTheme.padding)||void 0===s?void 0:s.right),h=Math.max(null!=n?n:120,c);return Number.isNaN(h)?120:y(h)}getCompactGridRowNodeWidth(e){var t;const{bolderText:i,icon:s,cell:o}=this.spreadsheet.theme.rowCell,{bolderText:n,icon:r,cell:l}=this.spreadsheet.theme.cornerCell,{field:c,isLeaf:h}=e,u=this.getExpectedCellIconWidth(d.vZ.ROW_CELL,!this.spreadsheet.isValueInCols()&&h&&this.spreadsheet.options.showDefaultHeaderActionIcon,s),p=null===(t=this.spreadsheet.dataSet.getDimensionValues(c))||void 0===t?void 0:t.slice(0,50).map(t=>{var i,s;return null!==(s=null===(i=this.spreadsheet.dataSet.getFieldFormatter(c))||void 0===i?void 0:i(t,void 0,e))&&void 0!==s?s:t}),g=(0,a.maxBy)(p,e=>`${e}`.length),m=this.measureTextWidth(g,i)+u+o.padding.left+o.padding.right+o.verticalBorderWidth,v=this.spreadsheet.dataSet.getFieldName(c),f=this.getExpectedCellIconWidth(d.vZ.CORNER_CELL,!1,r),C=this.measureTextWidth(v,n)+f+l.padding.left+l.padding.right;Zi.U.getInstance().logger("Max Label In Row:",c,m>C?g:v);const{compactExtraWidth:w=0,compactMinWidth:x}=this.spreadsheet.options.style||{},_=y(Math.max(m,C)+w);return(0,a.isNumber)(x)?Math.max(_,x):_}getCompactGridColNodeWidth(e,t){var i,s,o,n,r,l;const{bolderText:c,cell:h,icon:u}=this.spreadsheet.theme.colCell,{text:p,icon:g}=this.spreadsheet.theme.dataCell,m=this.spreadsheet.dataSet.getFieldFormatter(e.field),v=null!==(i=null==m?void 0:m(e.value,void 0,e))&&void 0!==i?i:e.value,f=this.getExpectedCellIconWidth(d.vZ.COL_CELL,this.spreadsheet.isValueInCols()&&this.spreadsheet.options.showDefaultHeaderActionIcon,u),C=this.measureTextWidth(v,c)+f;let w="",x=0,_=0;for(let i=0;i<50;i++){const a=t[i];if(a){const{valueField:t,dataQuery:i}=this.getDataQueryInfo(a.query,e.query),d=this.spreadsheet.dataSet.getCellData({query:i,rowNode:a,isTotals:e.isTotals||e.isTotalMeasure||a.isTotals||a.isTotalMeasure});if(d){const i=null==d?void 0:d[ye.nj],a=null!==(o=null===(s=this.spreadsheet.dataSet.getFieldFormatter(d[ye.GJ]))||void 0===s?void 0:s(i,d,e))&&void 0!==o?o:i,c=(0,ue.NV)(null===(n=this.spreadsheet.options.conditions)||void 0===n?void 0:n.icon,t)?(null==g?void 0:g.size)+(null===(r=null==g?void 0:g.margin)||void 0===r?void 0:r.left)+(null===(l=null==g?void 0:g.margin)||void 0===l?void 0:l.right):0,h=this.measureTextWidth(a,p)+c;h>x&&(w=a,x=h,_=c)}}}const S=C>x,b=S?v:w,E=S?f:_;Zi.U.getInstance().logger("Max Label In Col:",e.field,b,x,_);const L=this.measureTextWidth(b,Object.assign(Object.assign({},c),{fontSize:Math.max(p.fontSize,c.fontSize)})),{compactExtraWidth:T=0,compactMinWidth:O}=this.spreadsheet.options.style||{},R=y(L+h.padding.left+h.padding.right+2*h.verticalBorderWidth+E+T);return(0,a.isNumber)(O)?Math.max(R,O):R}getViewCellHeights(){const e=this.getRowLeafNodes(),t=(0,a.reduce)(e,(e,t)=>{const i=(0,a.last)(e)||0;return e.push(i+t.height),e},[0]);return{getTotalHeight:()=>(0,a.last)(t)||0,getCellOffsetY:e=>t[e]||0,getTotalLength:()=>t.length-1,getIndexRange:(e,i)=>Ki(t,e,i)}}getSeriesNumberCells(){var e;const t=(null===(e=this.getSeriesNumberHeader())||void 0===e?void 0:e.children)||[];return es(t,Us)}getFrozenOptions(){return this.validFrozenOptions||(this.validFrozenOptions=((e,t)=>{const{seriesNumber:i,layoutSeriesNumberNodes:s}=t;return(null==i?void 0:i.enable)&&s?Object.assign(Object.assign({},e),{rowCount:0,trailingRowCount:0}):e})(super.getFrozenOptions(),this.spreadsheet.options)),this.validFrozenOptions}getContentWidth(){const{rowsHierarchy:e,colsHierarchy:t}=this.layoutResult;return y(e.width+t.width+T.getVerticalBorderWidth(this.spreadsheet))}getContentHeight(){const{rowsHierarchy:e,colsHierarchy:t}=this.layoutResult;return y(e.height+t.height+T.getHorizontalBorderWidth(this.spreadsheet))}}class rr extends er{isCustomRowFields(){return this.isCustomHeaderFields("rows")}getDataSet(){const{dataSet:e}=this.options;return e?e(this):this.isCustomRowFields()?new sr(this):new ir(this)}getContentHeight(){return this.facet.getContentHeight()}isPivotMode(){return!0}isTableMode(){return!1}isHierarchyTreeType(){return"tree"===this.options.hierarchyType}isHierarchyGridTreeType(){return"grid-tree"===this.options.hierarchyType}isFrozenRowHeader(){var e,t;return!!(null===(t=null===(e=this.options)||void 0===e?void 0:e.frozen)||void 0===t?void 0:t.rowHeader)}isValueInCols(){var e,t;return null===(t=null===(e=this.dataSet)||void 0===e?void 0:e.fields)||void 0===t?void 0:t.valueInCols}clearDrillDownData(e,t){return(0,A.sH)(this,void 0,void 0,function*(){if(this.dataSet instanceof ir){this.dataSet.clearDrillDownData(e)&&!t&&(this.interaction.reset(),yield this.render(!1))}})}buildFacet(){var e,t,i,s,o,n;null!==(e=(n=this.options).dataCell)&&void 0!==e||(n.dataCell=e=>new Ri(e,this)),null===(t=this.facet)||void 0===t||t.destroy(),this.facet=null!==(o=null===(s=(i=this.options).facet)||void 0===s?void 0:s.call(i,this))&&void 0!==o?o:new nr(this),this.facet.render()}bindEvents(){this.off(m.ROW_CELL_COLLAPSED__PRIVATE),this.off(m.ROW_CELL_ALL_COLLAPSED__PRIVATE),this.on(m.ROW_CELL_COLLAPSED__PRIVATE,this.handleRowCellCollapsed),this.on(m.ROW_CELL_ALL_COLLAPSED__PRIVATE,this.handleRowCellToggleCollapseAll)}handleRowCellCollapsed(e){return(0,A.sH)(this,void 0,void 0,function*(){var t;const{isCollapsed:i,node:s}=e,{collapseFields:o}=null===(t=this.options.style)||void 0===t?void 0:t.rowCell,n=Object.assign(Object.assign({},o),{[s.id]:i});this.setOptions({style:{rowCell:{collapseFields:n}}}),yield this.render(!1),this.emit(m.ROW_CELL_COLLAPSED,{isCollapsed:i,collapseFields:n,node:s})})}handleRowCellToggleCollapseAll(e){return(0,A.sH)(this,void 0,void 0,function*(){const t=!e;this.setOptions({style:{rowCell:{collapseAll:t,collapseFields:null,expandDepth:null}}}),yield this.render(!1),this.emit(m.ROW_CELL_ALL_COLLAPSED,t)})}groupSortByMethod(e,t){return(0,A.sH)(this,void 0,void 0,function*(){var i,s,o,n;const{rows:r,columns:l}=this.dataCfg.fields,{hideValue:d}=this.options.style.colCell,c=this.isValueInCols()?(0,a.last)(r):(0,a.last)(l),{query:h,field:u,value:p,extra:g}=t,v=(0,a.clone)(h);let f=(null==g?void 0:g.isCustomNode)?u:p;d&&this.isValueInCols()&&(f=this.dataSet.fields.values[0],v[ye.GJ]=f);const C=(0,a.isString)(c)?c:c.field,y=null===(i=this.dataCfg.sortParams)||void 0===i?void 0:i.find(e=>(null==e?void 0:e.sortFieldId)===C||(null==e?void 0:e.sortFieldId)===f),w=null===(s=this.dataCfg.sortParams)||void 0===s?void 0:s.find(e=>"*"===(null==e?void 0:e.sortFieldId)),x={sortFieldId:C,sortMethod:e,sortByMeasure:f,query:v,nullsPlacement:null!==(o=null==y?void 0:y.nullsPlacement)&&void 0!==o?o:null==w?void 0:w.nullsPlacement},_=null===(n=this.dataCfg.sortParams)||void 0===n?void 0:n.filter(e=>(null==e?void 0:e.sortFieldId)!==c);this.updateSortMethodMap(t.id,e,!0);const S=[..._,x];this.emit(m.RANGE_SORT,S),this.setDataCfg(Object.assign(Object.assign({},this.dataCfg),{sortParams:S})),yield this.render()})}}var lr=i("./node_modules/.pnpm/antd@6.7.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/theme/index.js"),ar=i("./node_modules/.pnpm/antd@6.7.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/spin/index.js"),dr=i("./node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/isEqual.js"),cr=i.n(dr),hr=i("./node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/cloneDeep.js"),ur=i.n(hr),pr=i("./node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/merge.js"),gr=i.n(pr),mr=i("./src/utils/antd.tsx"),vr=i("./src/utils/dashEvents.ts"),fr=i("./src/utils/dash3.ts"),Cr=i("./src/utils/funcs.ts"),yr=i("./src/utils/useDeepCompareSignal.ts"),wr=i("./src/utils/useResizeObserver.ts"),xr=i("./src/utils/visualizationTheme.ts");class _r extends Ri{drawTextShape(){this.isMultiData()?(0,fe.V)(this):super.drawTextShape()}}class Sr extends Ti{drawTextShape(){const e=this.getMeta(),t=or(e?.value);if(!Array.isArray(t))return void super.drawTextShape();const{formattedValue:i}=this.getFormattedFieldValue();(0,fe.V)(this,{values:i!==e?.value?[[i]]:[t]},!1)}}class br extends sr{getExistValuesByDataItem(e){const t=Object.keys(e).filter(t=>{const i=e[t];return"object"==typeof i&&null!==i&&!Array.isArray(i)});return 0===t.length&&t.push(ye.IW),t}processDataCfg(e){const t=super.processDataCfg(e);return{...t,meta:this.processMeta(e.meta,(0,Gi.Ru)("数值")),fields:{...t.fields,rows:[...e.fields.rows??[],ye.GJ]}}}}const Er=(e,t)=>Po((e=>({hierarchyType:"tree",dataCell:(e,t)=>new _r(e,t),colCell:(e,t,i)=>new Sr(e,t,i),dataSet:e=>new br(e),showDefaultHeaderActionIcon:!1,style:{colCell:{hideValue:1===e.fields.values?.length}},interaction:{autoResetSheetStyle:!0,brushSelection:!1,selectedCellMove:!1,multiSelection:!1,rangeSelection:!1},tooltip:{operation:{hiddenColumns:!0}}}))(e),t);var Lr=i("./src/utils/visualizationFonts.ts");const Tr=(e,t)=>(0,Lr.l)(e,t);var Or=i("./src/components/fragments/sheet/context.ts");const Rr={ColCell:Ti,DataCell:Ri,Line:l.N1,Rect:l.rw},Ir={},Nr=["cornerCell","rowCell","colCell","dataCell","seriesNumberCell","mergedCell","axisRowCell","axisColCell","axisCornerCell"],Br=["text","bolderText","seriesText","measureText","minorText"],Ar=new Set(["default","colorful","gray","dark"]),Mr=new Set(["cornerCell","colCell","seriesNumberCell","axisColCell","axisCornerCell"]),Dr=new Set(["dataCell","mergedCell"]),Hr=e=>"dark"===(0,xr.n)(e)?"dark":"default";class kr extends Ri{drawTextShape(){return this.isMultiData()?(0,fe.V)(this):super.drawTextShape()}}const zr=(e,t={},i)=>{const s="default",o=!t.name||t.name===s,n=o?(e=>{const t=Hr(e),i={fill:e.colorText,fontFamily:e.fontFamily,fontSize:e.fontSizeSM,opacity:1,linkTextFill:e.colorLink},s={...i,fill:e.colorTextHeading,fontWeight:e.fontWeightStrong},o={...i,fill:e.colorTextLightSolid},n={...o,fontWeight:e.fontWeightStrong},r={hover:{backgroundColor:e.controlItemBgHover,backgroundOpacity:.6},hoverFocus:{backgroundColor:e.controlItemBgHover,backgroundOpacity:.6,borderColor:e.colorPrimary,borderWidth:e.lineWidth,borderOpacity:1},selected:{backgroundColor:e.controlItemBgActive,backgroundOpacity:.6,borderColor:e.colorPrimary},allSelected:{backgroundColor:e.controlItemBgActive,backgroundOpacity:.6,borderColor:e.colorPrimary},rowCellBrushSelected:{backgroundColor:e.controlItemBgActive,backgroundOpacity:.6},colCellBrushSelected:{backgroundColor:e.controlItemBgActive,backgroundOpacity:.6},dataCellBrushSelected:{backgroundColor:e.controlItemBgActive,backgroundOpacity:.6},unselected:{backgroundOpacity:.3,textOpacity:.3,opacity:.3},prepareSelect:{borderColor:e.colorPrimary,borderWidth:e.lineWidth,borderOpacity:1},searchResult:{backgroundColor:e.colorInfoBg,backgroundOpacity:1},highlight:{backgroundColor:e.colorWarningBg,backgroundOpacity:1}},l={hover:{backgroundColor:e.colorPrimaryHover,backgroundOpacity:1},hoverFocus:{backgroundColor:e.colorPrimaryHover,backgroundOpacity:1,borderColor:e.colorTextLightSolid,borderWidth:e.lineWidth,borderOpacity:1},selected:{backgroundColor:e.colorPrimaryActive,backgroundOpacity:1,borderColor:e.colorTextLightSolid},allSelected:{backgroundColor:e.colorPrimaryActive,backgroundOpacity:1,borderColor:e.colorTextLightSolid},rowCellBrushSelected:{backgroundColor:e.colorPrimaryActive,backgroundOpacity:1},colCellBrushSelected:{backgroundColor:e.colorPrimaryActive,backgroundOpacity:1},dataCellBrushSelected:{backgroundColor:e.colorPrimaryActive,backgroundOpacity:1},unselected:{backgroundOpacity:.3,textOpacity:.3,opacity:.3},prepareSelect:{borderColor:e.colorTextLightSolid,borderWidth:e.lineWidth,borderOpacity:1},searchResult:{backgroundColor:e.colorInfo,backgroundOpacity:1},highlight:{backgroundColor:e.colorWarning,backgroundOpacity:1}},a={line:{point:{fill:e.colorPrimary,opacity:1},linkLine:{fill:e.colorPrimary,opacity:.6}},bar:{fill:e.colorPrimary,opacity:1},bullet:{comparativeMeasure:{fill:e.colorText,opacity:.25},rangeColors:{good:e.colorSuccess,satisfactory:e.colorWarning,bad:e.colorError},backgroundColor:e.colorFillSecondary},interval:{fill:e.colorPrimary}};return{name:t,palette:he({...ki(t),brandColor:e.colorPrimary}),theme:{...Object.fromEntries(Nr.map(t=>{const d=Mr.has(t),c=d?o:i;return[t,{cell:{backgroundColor:d?e.colorPrimary:e.colorBgContainer,crossBackgroundColor:d?e.colorPrimary:e.colorBgContainer,backgroundColorOpacity:1,horizontalBorderColor:d?e.colorPrimaryBorder:e.colorBorderSecondary,horizontalBorderColorOpacity:1,horizontalBorderWidth:e.lineWidth,verticalBorderColor:d?e.colorPrimaryBorder:e.colorBorderSecondary,verticalBorderColorOpacity:1,verticalBorderWidth:e.lineWidth,borderDash:[],padding:{top:e.paddingSM,right:e.paddingSM,bottom:e.paddingSM,left:e.paddingSM},interactionState:d?l:r},text:c,bolderText:d?n:s,seriesText:c,measureText:c,minorText:{...c,fill:d?e.colorTextLightSolid:e.colorTextSecondary},derivedMeasureText:{mainUp:e.colorError,mainDown:e.colorSuccess,minorUp:e.colorError,minorDown:e.colorSuccess},icon:{fill:d?e.colorTextLightSolid:e.colorTextSecondary},...Dr.has(t)?{miniChart:a}:{}}]})),background:{color:e.colorBgContainer,opacity:1},resizeArea:{background:e.colorBgContainer,backgroundOpacity:0,guideLineColor:e.colorPrimary,guideLineDisableColor:e.colorTextDisabled,interactionState:{hover:{backgroundColor:e.colorPrimary,backgroundOpacity:1}}},scrollBar:{trackColor:e.colorFillQuaternary,thumbColor:e.colorFillSecondary,thumbHoverColor:e.colorFill},splitLine:{horizontalBorderColor:e.colorBorderSecondary,horizontalBorderColorOpacity:1,verticalBorderColor:e.colorBorderSecondary,verticalBorderColorOpacity:1,showShadow:!0,shadowColors:{left:e.colorSplit,right:"rgba(0,0,0,0)"}},prepareSelectMask:{backgroundColor:e.colorPrimaryBg,backgroundOpacity:.3,borderColor:e.colorPrimary,borderWidth:e.lineWidth,borderOpacity:1},empty:{icon:{fill:e.colorTextDisabled},description:{fill:e.colorTextSecondary,fontFamily:e.fontFamily,fontSize:e.fontSizeSM,opacity:1}},preview:{overlay:{backgroundColor:e.colorBgMask},mediaContainer:{backgroundColor:e.colorBgElevated,border:`${e.lineWidth}px ${e.lineType} ${e.colorBorderSecondary}`,borderRadius:`${e.borderRadiusLG}px`,boxShadow:e.boxShadowSecondary}}}}})(e):(r=e.fontFamily,{name:t.name,theme:Object.fromEntries(Nr.map(e=>[e,Object.fromEntries(Br.map(e=>[e,{fontFamily:r}]))]))});var r;const l=gr()({},n,t);o&&(l.name=Hr(e));const a=i??(o?e.colorPrimary:void 0);if(a&&!t.palette){const e=l.name&&Ar.has(l.name)?l.name:s;l.palette=he({...ki(e),brandColor:a})}return l},Fr=(e,t)=>(0,Cr.qF)(ur()(e),t),Pr=(e,t,i={},s)=>{const o=((e={},t)=>(0,Cr.qF)(ur()(e),t))(i,s);return"strategy"===e?Er(Fr(t,s),o):"gridAnalysis"===e?gr()({},o,{dataCell:(e,t)=>new kr(e,t),showDefaultHeaderActionIcon:!1,style:{colCell:{hideValue:!0}}}):o},jr=(e,t)=>{if(!e)return{enabled:!1,width:!1,height:!1};if(!0===e)return{enabled:!0,width:!0,height:!1};const i=(0,Cr.qF)(e,t);return{enabled:!0,width:i.width??!0,height:i.height??!0,getContainer:i.getContainer}},Wr=(e,t)=>{const i=t.getContainer?.();return i instanceof HTMLElement?i:e},Gr=(e,t)=>"number"==typeof e&&Number.isFinite(e)&&e>0?e:Math.max(t,1),Vr=(e,t,i,s,o,n)=>{const r=Pr(e,t,i,s),l=jr(n,s),a=Wr(o,l);return{...r,width:l.width?Math.max(a.clientWidth,1):Gr(r.width,o.clientWidth),height:l.height?Math.max(a.clientHeight,1):Gr(r.height,o.clientHeight)}},$r=e=>{if(!e||"object"!=typeof e||Array.isArray(e))return;const t=Object.entries(e).filter(([e,t])=>!e.startsWith("$$")&&void 0!==t);return t.length?Object.fromEntries(t):void 0},Ur=e=>{if(!e)return;const t=e.getMeta(),i={cellType:e.cellType,rowIndex:t.rowIndex,colIndex:t.colIndex,field:t.valueField??t.field,value:t.fieldValue??t.value,label:e.getActualText(),rowQuery:$r(t.rowQuery),colQuery:$r(t.colQuery),isTotals:t.isTotals};return Object.fromEntries(Object.entries(i).filter(([,e])=>void 0!==e))},Yr=(e,t)=>{const i=t?.target;if(!i)return;const s=e.getCell(i);return Ur(s)},Xr=e=>({value:(0,mr.xE)(e),timestamp:Date.now()}),Zr=e=>{const{hashId:t,token:i}=lr.A.useToken(),{id:s,className:o,style:l,tabIndex:a,role:d,dir:c,lang:h,hidden:u,children:p,dataCfg:g,options:v={},events:f,adaptive:C,loading:y=!1,sheetType:w="pivot",themeCfg:x=Ir,themeColor:_,eventData:S,selectionState:b,sortState:E,filterState:L,loading_state:T,setProps:O,...R}=e,I=(0,n.useRef)(null),N=(0,n.useRef)(null),[B,A]=(0,n.useState)(),M=(0,n.useRef)(g),D=(0,n.useRef)(v),H=(0,n.useRef)(C),k=(0,n.useRef)(O),z=(0,n.useRef)(i),F=(0,n.useRef)("default"),P=(0,n.useRef)(null),{emit:j,emitLazy:W,getOptions:G}=(0,vr.i)("s2",f,O),V=(0,n.useRef)(j),$=(0,n.useRef)(null),U=(0,n.useRef)(null),Y=(0,n.useRef)(null),X=Hr(i);z.current=i,F.current=X,V.current=j,P.current||(P.current={...Rr,get token(){return z.current},get theme(){return F.current},normalizeCell:Ur,emit(e,t){V.current(e,"interaction",(0,mr.xE)(t))}});const Z=P.current,q=(0,n.useMemo)(()=>"gridAnalysis"===w?gr()({},zr(i,x,_),(e=>({theme:{dataCell:{text:{textAlign:"left"},bolderText:{textAlign:"left",fontWeight:e.fontWeightStrong},minorText:{textAlign:"left",fill:e.colorTextSecondary},derivedMeasureText:{mainUp:e.colorError,mainDown:e.colorSuccess,minorUp:e.colorError,minorDown:e.colorSuccess}}}}))(i)):zr(i,x,_),[i,x,_,w]),K=(0,n.useRef)(q);K.current=q;const J=(0,yr.$)({sheetType:w}),Q=(0,yr.$)({hashId:t,themeCfg:q}),ee=(0,yr.$)(g),te=(0,yr.$)(v),ie=(0,yr.$)(C);M.current=g,D.current=v,H.current=C,k.current=O;const se=(0,n.useMemo)(()=>Object.fromEntries(Object.entries(R).filter(([e,t])=>(e.startsWith("data-")||e.startsWith("aria-"))&&null!=t)),[R]);(0,n.useEffect)(()=>{const e=I.current;if(!e)return;const t=new("table"===w?tr:rr)(e,Fr(M.current,Z),Vr(w,M.current,D.current,Z,e,H.current));N.current=t,A(t),t.setThemeCfg(Tr(K.current,e)),Y.current=K.current;const i=()=>{t.destroyed||(t.measureText.cache.clear?.(),t.setThemeCfg(Tr(K.current,e)),t.render(!0).catch(e=>console.error(`S2${s?` "${s}"`:""} failed to update fonts.`,e)))},o=e.ownerDocument.fonts;o.addEventListener("loadingdone",i);const n=()=>{j("cell:pointerleave","pointer")};return t.on(m.GLOBAL_CLICK,e=>{W("cell:click","pointer",()=>{const i=Yr(t,e);return i?{cell:i}:void 0})}),t.on(m.GLOBAL_DOUBLE_CLICK,e=>{W("cell:doubleClick","pointer",()=>{const i=Yr(t,e);return i?{cell:i}:void 0})}),t.on(m.GLOBAL_HOVER,e=>{W("cell:hover","pointer",()=>{const i=Yr(t,e);return i?{cell:i}:void 0})}),t.on(m.GLOBAL_SELECTED,e=>{const t=e.map(Ur).filter(e=>void 0!==e),i=Math.max(0,Math.floor(G("selection:change")?.maxItems??500)),s={cells:t.slice(0,i),count:t.length,truncated:t.length>i,timestamp:Date.now()};k.current?.({selectionState:s}),j("selection:change","selection",s)}),t.on(m.GLOBAL_RESET,()=>{k.current?.({selectionState:null}),j("selection:reset","selection",{cells:[],count:0,truncated:!1})}),t.on(m.RANGE_SORT,e=>{const t=Xr(e);k.current?.({sortState:t}),j("range:sort","sort",{operation:t.value})}),t.on(m.RANGE_FILTER,e=>{const t=Xr(e);k.current?.({filterState:t}),j("range:filter","filter",{operation:t.value})}),e.addEventListener("pointerleave",n),$.current=M.current,U.current=D.current,t.render().catch(e=>console.error(`S2${s?` "${s}"`:""} failed to render.`,e)),()=>{o.removeEventListener("loadingdone",i),e.removeEventListener("pointerleave",n),t.destroy(),N.current===t&&(N.current=null,A(void 0))}},[j,W,Z,G,s,J,w]),(0,wr.w)(()=>{const e=I.current;if(!e)return null;const t=jr(H.current,Z);return t.enabled&&(t.width||t.height)?Wr(e,t):null},()=>{const e=N.current,t=I.current;if(!e||!t||e.destroyed)return;const i=jr(H.current,Z),o=Wr(t,i),n=Pr(w,M.current,D.current,Z),r=i.width?Math.max(o.clientWidth,1):Gr(n.width,t.clientWidth),l=i.height?Math.max(o.clientHeight,1):Gr(n.height,t.clientHeight);r===e.options.width&&l===e.options.height||(e.changeSheetSize(r,l),e.render(!1).catch(e=>console.error(`S2${s?` "${s}"`:""} failed to resize.`,e)))},[ie,Z,s,J,w]),(0,n.useEffect)(()=>{const e=N.current,t=I.current,i=K.current;e&&!e.destroyed&&t&&!cr()(Y.current,i)&&(e.setThemeCfg(Tr(i,t)),e.render(!0).then(()=>{Y.current=i}).catch(e=>console.error(`S2${s?` "${s}"`:""} failed to update theme.`,e)))},[t,Q,s]),(0,n.useEffect)(()=>{const e=N.current;if(e&&!e.destroyed&&!cr()($.current,M.current)){if(e.setDataCfg(Fr(M.current,Z),!0),"strategy"===w){const t=I.current;e.setOptions({...t?Vr(w,M.current,D.current,Z,t,H.current):{}},!0)}e.render({reloadData:!0}).then(()=>{$.current=M.current}).catch(e=>console.error(`S2${s?` "${s}"`:""} failed to update data.`,e))}},[ee,Z,s,w]),(0,n.useEffect)(()=>{const e=N.current;if(!e||e.destroyed||cr()(U.current,D.current))return;const t=I.current;e.setOptions({...t?Vr(w,M.current,D.current,Z,t,H.current):{}},!0),e.render().then(()=>{U.current=D.current}).catch(e=>console.error(`S2${s?` "${s}"`:""} failed to update options.`,e))},[te,Z,s,w]);const oe=l?.height??v?.height??450,ne={width:"100%",backgroundColor:i.colorBgContainer,color:i.colorText,...l};return delete ne.height,r().createElement(Or.A.Provider,{value:B},r().createElement("div",{...se,id:s,className:o,style:ne,tabIndex:a,role:d,dir:c,lang:h,hidden:u,"data-dac-sheet-theme":q.name??X,"data-dash-is-loading":(0,fr.A_)(T)||void 0},p,r().createElement(ar.A,{spinning:y,classNames:{root:"dac-s2-loading"}},r().createElement("div",{ref:I,style:{width:"100%",height:oe}}))))},qr=e=>r().createElement(Zr,{...e})},"./src/components/fragments/async/extensions/SheetExport.tsx"(e,t,i){"use strict";i.r(t),i.d(t,{default:()=>x});var s=i("react"),o=i.n(s),n=i("./node_modules/.pnpm/tslib@2.8.1/node_modules/tslib/tslib.es6.mjs"),r=i("./node_modules/.pnpm/@ant-design+icons@6.3.4_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@ant-design/icons/es/icons/MoreOutlined.js"),l=i("./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/common/i18n/index.js"),a=i("./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/common/constant/classnames.js"),d=i("./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/utils/export/copy/core.js"),c=i("./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/utils/export/utils.js"),h=i("./node_modules/.pnpm/antd@6.7.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/dropdown/index.js"),u=i("./node_modules/.pnpm/antd@6.7.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/button/index.js"),p=i("./node_modules/.pnpm/classnames@2.5.1/node_modules/classnames/index.js"),g=i.n(p);const m=o().memo(e=>{const{className:t,children:i,async:s=!0,copyOriginalText:p=(0,l.Ru)("复制原始数据"),copyFormatText:m=(0,l.Ru)("复制格式化数据"),downloadOriginalText:v=(0,l.Ru)("下载原始数据"),downloadFormatText:f=(0,l.Ru)("下载格式化数据"),sheetInstance:C,fileName:y="sheet",dropdown:w,customCopyMethod:x,onCopyError:_,onCopySuccess:S,onDownloadSuccess:b,onDownloadError:E}=e,L=(0,n.Tt)(e,["className","children","async","copyOriginalText","copyFormatText","downloadOriginalText","downloadFormatText","sheetInstance","fileName","dropdown","customCopyMethod","onCopyError","onCopySuccess","onDownloadSuccess","onDownloadError"]),T=`${a.u}-export`,O=(e,t,i)=>(0,n.sH)(void 0,void 0,void 0,function*(){const o={sheetInstance:C,split:e,formatOptions:t,async:s};return yield(null==x?void 0:x(o))||(null==i?void 0:i(o))}),R=e=>(0,n.sH)(void 0,void 0,void 0,function*(){const t=yield((e,t)=>(0,n.sH)(void 0,void 0,void 0,function*(){return yield O(e,t,d.mc)}))("\t",e);(0,c.lW)(t,s).then(()=>{null==S||S(t)}).catch(e=>{console.error("copy failed: ",e),null==_||_(e)})}),I=e=>(0,n.sH)(void 0,void 0,void 0,function*(){const t=yield((e,t)=>(0,n.sH)(void 0,void 0,void 0,function*(){return yield O(e,t,d.Wg)}))(",",e);try{(0,c.RG)(t,y),null==b||b(t)}catch(e){console.error("download failed: ",e),null==E||E(e)}});return o().createElement(o().Fragment,null,o().createElement(h.A,Object.assign({menu:{items:[{key:"copyOriginal",label:p,onClick:()=>{R(!1)}},{key:"copyFormat",label:m,onClick:()=>{R(!0)}},{key:"downloadOriginal",label:v,onClick:()=>{I(!1)}},{key:"downloadFormat",label:f,onClick:()=>{I(!0)}}]},trigger:["click"],className:g()(T,t)},L,w),i||o().createElement(u.A,{type:"text"},o().createElement(r.A,null))))});m.displayName="Export";i("./node_modules/.pnpm/@antv+s2-react-components@2.1.2_@ant-design+icons@6.3.4_react-dom@18.3.1_react@18.3.1___c662a9bb2c1574364f240ef8e03c3384/node_modules/@antv/s2-react-components/dist/s2-react-components.min.css");var v=i("./node_modules/.pnpm/antd@6.7.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/config-provider/index.js"),f=i("./src/locales/extensionLocale.ts"),C=i("./src/utils/dash3.ts"),y=i("./src/components/fragments/sheet/context.ts");const w=e=>{const t=(0,s.useContext)(y.A),{locale:i}=(0,s.useContext)(v.Ay.ConfigContext),n=(0,s.useMemo)(()=>(0,f.m)(i?.locale).s2Export,[i?.locale]),{id:r,className:l,style:a,children:d,copyOriginalText:c=n.copyOriginalText,copyFormatText:h=n.copyFormatText,downloadOriginalText:u=n.downloadOriginalText,downloadFormatText:p=n.downloadFormatText,fileName:g,asyncExport:w,dropdown:x,loading_state:_,setProps:S,tabIndex:b,role:E,dir:L,lang:T,hidden:O,...R}=e,I=Object.fromEntries(Object.entries(R).filter(([e,t])=>(e.startsWith("data-")||e.startsWith("aria-"))&&null!=t));return o().createElement("span",{...I,id:r,className:l,style:a,tabIndex:b,role:E,dir:L,lang:T,hidden:O,"data-dash-is-loading":(0,C.A_)(_)||void 0},t?o().createElement(m,{sheetInstance:t,copyOriginalText:c,copyFormatText:h,downloadOriginalText:u,downloadFormatText:p,fileName:g,async:w,dropdown:x},d):d)},x=e=>o().createElement(w,{...e})},"./src/components/fragments/async/extensions/SheetSwitcher.tsx"(e,t,i){"use strict";i.r(t),i.d(t,{default:()=>ie});i("./node_modules/.pnpm/@antv+s2-react-components@2.1.2_@ant-design+icons@6.3.4_react-dom@18.3.1_react@18.3.1___c662a9bb2c1574364f240ef8e03c3384/node_modules/@antv/s2-react-components/dist/s2-react-components.min.css");var s=i("./node_modules/.pnpm/antd@6.7.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/theme/index.js"),o=i("./node_modules/.pnpm/antd@6.7.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/config-provider/index.js"),n=i("react"),r=i.n(n),l=i("./src/utils/dash3.ts"),a=i("./node_modules/.pnpm/@ant-design+icons@6.3.4_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@ant-design/icons/es/icons/ReloadOutlined.js"),d=i("./node_modules/.pnpm/@ant-design+icons@6.3.4_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@ant-design/icons/es/icons/SwapOutlined.js"),c=i("./node_modules/.pnpm/@dnd-kit+react@0.5.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@dnd-kit/react/index.js"),h=i("./node_modules/.pnpm/@dnd-kit+react@0.5.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@dnd-kit/react/sortable.js"),u=i("./node_modules/.pnpm/antd@6.7.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/checkbox/index.js"),p=i("./node_modules/.pnpm/antd@6.7.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/button/index.js"),g=i("./node_modules/.pnpm/antd@6.7.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/popover/index.js"),m=i("./node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/isEqual.js"),v=i.n(m),f=i("./node_modules/.pnpm/antd@6.7.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/es/tooltip/index.js"),C=i("./node_modules/.pnpm/classnames@2.5.1/node_modules/classnames/index.js"),y=i.n(C),w=i("./node_modules/.pnpm/tslib@2.8.1/node_modules/tslib/tslib.es6.mjs"),x=i("./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/common/i18n/index.js"),_=i("./node_modules/.pnpm/@antv+s2@2.7.2_@antv+g2@5.4.8/node_modules/@antv/s2/esm/common/constant/classnames.js");var S=i("./node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/lodash.js");function b(e){return r().createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",width:12,height:12,className:"antv-s2-icon"},e),r().createElement("g",{fill:"currentColor",fillRule:"nonzero"},r().createElement("path",{d:"M4.457 11.229h6.772V3.77H4.457zm-.686 0V3.77h-3v7.543h3zM11.23 3V.771H.77V3zM12 0v12H0V0z"}),r().createElement("path",{d:"M.771.771H11.23V3H.77z"})))}function E(e){return r().createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",width:12,height:12,className:"antv-s2-icon"},e),r().createElement("g",{fill:"currentColor",fillRule:"evenodd"},r().createElement("path",{d:"M.771 3.771h3v1.886h-3zm0 2.572h3V8.57h-3zM.771 9h3v2.229h-3z"}),r().createElement("path",{d:"M.771 9v2.229H11.23V3.77H.77v1.886h3V3.771h.772v7.543H3.77V9.086h-3zm0-.771h3V6.343h-3zM11.23 3V.771H.77V3zM12 0v12H0V0z"})))}function L(e){return r().createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",width:12,height:12,className:"antv-s2-icon"},e),r().createElement("g",{fill:"currentColor",fillRule:"evenodd"},r().createElement("path",{d:"M4.229 3.771h7v8h-7z"}),r().createElement("path",{d:"M4.457 11.229h6.772V3.77H4.457zm-.686 0V3.77h-3v7.543h3zM11.23 3V.771H.77V3zM12 0v12H0V0z"})))}var T,O;!function(e){e.Rows="rows",e.Cols="columns",e.Values="values"}(T||(T={})),function(e){e.Dimensions="dimensions",e.Measures="measures",e.Rows="rows",e.Cols="cols"}(O||(O={}));const R=[T.Rows,T.Cols,T.Values],I=(...e)=>((...e)=>`${_.u}-${e.join("-")}`)("switcher",...e),N=e=>I("content","table"===e?"one-dimension":"three-dimensions"),B=(e,t)=>"table"===e||t===T.Values,A=(e=[],t,i,s)=>{const o=Object.assign({},e.find(e=>e.id===(null!=s?s:i)));return s?o.children=(0,S.map)(o.children,e=>Object.assign(Object.assign({},e),{checked:e.id===i?t:e.checked})):(o.checked=t,o.children=(0,S.map)(o.children,e=>Object.assign(Object.assign({},e),{checked:t}))),e.map(e=>e.id===o.id?o:e)},M="item",D=e=>{const{dragHandleProps:t,fieldType:i,id:s,displayName:o,selectable:n,checked:l=!0,parentId:a,className:d,disabled:c=!1,onVisibleItemChange:h}=e,p=r().useRef(null),[g,m]=r().useState(!1);r().useEffect(()=>{var e,t;m((null===(e=p.current)||void 0===e?void 0:e.offsetWidth)<(null===(t=p.current)||void 0===t?void 0:t.scrollWidth))},[]);const v=null!=o?o:s;return r().createElement("div",Object.assign({},t,{className:y()(I(M),d,{unchecked:!l})}),n&&r().createElement(u.A,{disabled:c,checked:l,onChange:e=>null==h?void 0:h(i,e.target.checked,s,a)}),g?r().createElement(f.A,{title:v,placement:"bottomRight",overlayClassName:I("tooltip")},r().createElement("div",{className:I(M,"text"),ref:p},v)):r().createElement("div",{className:I(M,"text"),ref:p},v))},H=(...e)=>e.flatMap(e=>"string"==typeof e?[e]:e?Object.entries(e).filter(([,e])=>e).map(([e])=>e):[]).join(" "),k=(e,t)=>{const i=e?.toLowerCase().startsWith("en");return{expand:["展开子项","Expand children"],title:["行列切换","Switch rows and columns"],reset:["恢复默认","Reset"],cancel:["取消","Cancel"],submit:["确定","OK"]}[t][i?1:0]},z=r().memo(({fieldType:e,item:{id:t,displayName:i,checked:s=!0,children:o=[]},expandable:n,expandChildren:l,isDragDisabled:a,selectable:d,index:c,droppableType:u,draggingItemId:p,onVisibleItemChange:g,dragPortalStyle:m})=>{const[v,f]=r().useState(null),{isDragging:C}=(0,h.g)({id:t,index:c,group:e,type:u,data:{fieldType:e},disabled:a,element:v});return r().createElement("div",{ref:f,style:C?m:void 0,className:H(I(d?"checkable-list":"normal-list"),{dragging:C,"disable-dragging":a})},r().createElement(D,{fieldType:e,id:t,displayName:i,checked:s,onVisibleItemChange:g,selectable:d,className:H(d?"checkable-item":"normal-item",{"item-collapse":!l})}),n&&l&&o.length>0&&p!==t&&r().createElement("div",{className:"child-items"},o.map(i=>r().createElement(D,{key:i.id,id:i.id,fieldType:e,displayName:i.displayName,disabled:!s,checked:i.checked,parentId:t,selectable:d,onVisibleItemChange:g,className:"checkable-item"}))))});z.displayName="PatchedDimensionItem";const F=r().memo(e=>{const{fieldType:t,crossRows:i=!1,selectable:s=!1,expandable:o=!1,expandText:n,locale:l,allowEmpty:a=!0,items:d=[],droppableType:h,text:p,icon:g,dragPortalStyle:m,...v}=e,[f,C]=r().useState(!0),[y,w]=r().useState(null),{isDropTarget:x}=(0,c.zM)({id:`s2-switcher-${t}`,type:h,data:{fieldType:t},element:y});if(!(()=>{const[e,t]=r().useState(!1);return r().useEffect(()=>{const e=requestAnimationFrame(()=>t(!0));return()=>cancelAnimationFrame(e)},[]),e})())return null;const _=!a&&1===d.length;return r().createElement("div",{className:H(I("dimension"),{"long-dimension":i})},r().createElement("div",{className:I("dimension","header")},r().createElement("div",{className:"title"},r().createElement(g,null)," ",r().createElement("span",null,p)),o&&r().createElement("div",{className:"expand-option"},r().createElement(u.A,{checked:f,onChange:e=>C(e.target.checked)},n??k(l,"expand")))),r().createElement("div",{ref:w,className:H(I("dimension","items"),{[I("dimension","items-highlight")]:x,[I("dimension","long-items")]:i})},d.map((e,i)=>r().createElement(z,{...v,key:e.id,index:i,fieldType:t,item:e,droppableType:h,dragPortalStyle:m,expandable:o,expandChildren:f,selectable:s,isDragDisabled:_}))))});F.displayName="PatchedDimension";const P=({innerContentClassName:e,contentTitleText:t,resetText:i,locale:s,allowExchangeHeader:o=!0,onToggleVisible:n,onSubmit:l,sheetType:d="pivot",dragPortalStyle:h,...u})=>{const g=(0,S.mapValues)(u,"items");const[m,f]=r().useState(g),[C,y]=r().useState(null),_=((e=!0)=>({[T.Rows]:{text:(0,x.Ru)("行头"),icon:E,droppableType:e?O.Dimensions:O.Rows},[T.Cols]:{text:(0,x.Ru)("列头"),icon:b,droppableType:e?O.Dimensions:O.Cols},[T.Values]:{text:(0,x.Ru)("值"),icon:L,droppableType:O.Measures}}))(o);return r().createElement(c.XU,{onDragStart:e=>{y(e.operation.source?String(e.operation.source.id):null)},onDragEnd:e=>{if(y(null),e.canceled)return;const t=e.operation.source,i=e.operation.target,s=t?.initialGroup??t?.group,o=i?.group??i?.data?.fieldType,n=t?.initialIndex??t?.index;s&&o&&void 0!==n&&f(e=>{const t=[...e[s]??[]],r=s===o?t:[...e[o]??[]],[l]=t.splice(n,1);if(!l)return e;const a=Math.min(i?.index??r.length,r.length);return r.splice(a,0,l),{...e,[s]:t,[o]:r}})}},r().createElement("div",{className:H(e,I("content"))},r().createElement("header",{className:I("content","header")},t??k(s,"title")),r().createElement("main",{className:H(I("content","main"),N(d))},R.filter(e=>"table"!==d||e===T.Cols).map(e=>r().createElement(F,{...u[e],..._[e],locale:s,key:e,fieldType:e,items:m[e],crossRows:B(d,e),draggingItemId:C,dragPortalStyle:h,onVisibleItemChange:(e,t,i,s)=>f(o=>({...o,[e]:A(o[e],t,i,s)}))}))),r().createElement("footer",{className:I("content","footer")},r().createElement(p.A,{type:"text",icon:r().createElement(a.A,null),className:I("content","footer","reset-button"),disabled:v()(g,m),onClick:()=>f(g)},i??k(s,"reset")),r().createElement("div",{className:I("content","footer","actions")},r().createElement(p.A,{className:"action-button",onClick:n},k(s,"cancel")),r().createElement(p.A,{className:"action-button",type:"primary",disabled:v()(g,m),onClick:()=>{n(),l?.((e=>{const t=(e=[])=>{const t=(e=[])=>(0,S.flatten)((0,S.map)(e,e=>{var{children:i}=e,s=(0,w.Tt)(e,["children"]);return[Object.assign({},s),...t(i)]})),i=t(e);return{items:i,hideItems:(0,S.filter)(i,e=>!1===e.checked)}};return{[T.Rows]:t(e[T.Rows]),[T.Cols]:t(e[T.Cols]),[T.Values]:t(e[T.Values])}})(m))}},k(s,"submit"))))))},j=({title:e,icon:t,popover:i,disabled:s,children:o,dragPortalStyle:n,locale:l,...a})=>{const[c,h]=r().useState(!1);return r().createElement(g.A,{trigger:"click",placement:"bottomLeft",destroyOnHidden:!0,...i,open:!s&&c,onOpenChange:e=>h(e),content:r().createElement(P,{...a,locale:l,dragPortalStyle:n,onToggleVisible:()=>h(!1)})},o||r().createElement(p.A,{className:I("entry-button"),size:"small",disabled:s,icon:t||r().createElement(d.A,{rotate:90})},e||k(l,"title")))};var W=i("./node_modules/.pnpm/style-loader@3.3.4_webpack@5.108.4/node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"),G=i.n(W),V=i("./node_modules/.pnpm/style-loader@3.3.4_webpack@5.108.4/node_modules/style-loader/dist/runtime/styleDomAPI.js"),$=i.n(V),U=i("./node_modules/.pnpm/style-loader@3.3.4_webpack@5.108.4/node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js"),Y=i.n(U),X=i("./node_modules/.pnpm/style-loader@3.3.4_webpack@5.108.4/node_modules/style-loader/dist/runtime/insertStyleElement.js"),Z=i.n(X),q=i("./node_modules/.pnpm/style-loader@3.3.4_webpack@5.108.4/node_modules/style-loader/dist/runtime/styleTagTransform.js"),K=i.n(q),J=i("./node_modules/.pnpm/css-loader@6.11.0_webpack@5.108.4/node_modules/css-loader/dist/cjs.js!./src/components/fragments/SheetSwitcher.css"),Q={};Q.styleTagTransform=K(),Q.setAttributes=Y(),Q.insert=function(e){const t=document.querySelector("head"),i=window._lastElementInsertedByStyleLoader;i?i.nextSibling?t.insertBefore(e,i.nextSibling):t.appendChild(e):t.insertBefore(e,t.firstChild),window._lastElementInsertedByStyleLoader=e},Q.domAPI=$(),Q.insertStyleElement=Z();G()(J.A,Q);const ee=({id:e,displayName:t,checked:i})=>({id:e,...void 0===t?{}:{displayName:t},...void 0===i?{}:{checked:i}}),te=({items:e=[],hideItems:t=[]}={})=>{const i=new Set(t.map(({id:e})=>e));return e.filter(({id:e})=>!i.has(e)).map(({id:e})=>e)},ie=e=>{const{token:t}=s.A.useToken(),{locale:i}=(0,n.useContext)(o.Ay.ConfigContext),{id:a,className:d,style:c,children:h,rows:u,columns:p,values:g,sheetType:m="pivot",title:v,icon:f,popover:C,disabled:y,contentTitleText:w,resetText:x,innerContentClassName:_,allowExchangeHeader:S=!0,result:b,fields:E,n_submit:L=0,loading_state:T,setProps:O,tabIndex:R,role:I,dir:N,lang:B,hidden:A,...M}=e,D=Object.fromEntries(Object.entries(M).filter(([e,t])=>(e.startsWith("data-")||e.startsWith("aria-"))&&null!=t)),H={"--antv-s2-container-background":t.colorBgElevated,"--antv-s2-block-background":t.colorFillTertiary,"--antv-s2-border":t.colorBorderSecondary,"--antv-s2-font-25":t.colorTextDisabled,"--antv-s2-font-65":t.colorTextSecondary,"--antv-s2-font-70":t.colorText,"--antv-s2-tooltip-background":t.colorBgSpotlight,color:t.colorText},k={...C,classNames:{...C?.classNames,root:["antv-s2-switcher-overlay","dac-s2-switcher-overlay",C?.classNames?.root].filter(Boolean).join(" ")},styles:{...C?.styles,root:{...H,...C?.styles?.root}}};return r().createElement("span",{...D,id:a,className:d,style:c,tabIndex:R,role:I,dir:N,lang:B,hidden:A,"data-dash-is-loading":(0,l.A_)(T)||void 0},r().createElement(j,{rows:u,columns:p,values:g,sheetType:m,title:v,icon:f,popover:k,dragPortalStyle:H,disabled:y,contentTitleText:w,resetText:x,locale:i?.locale,innerContentClassName:_,allowExchangeHeader:S,onSubmit:e=>{const t=(e=>{const t=({items:e=[],hideItems:t=[]}={})=>({items:e.map(ee),hideItems:t.map(ee)});return{rows:t(e.rows),columns:t(e.columns),values:t(e.values)}})(e);var i;O?.({result:t,fields:(i=t,{rows:te(i.rows),columns:te(i.columns),values:te(i.values)}),n_submit:L+1})}},h))}},"./src/components/fragments/sheet/context.ts"(e,t,i){"use strict";var s=i("react");const o=i.n(s)().createContext(void 0);i.d(t,["A",0,o])},"./src/utils/jsxRuntime.ts"(e,t,i){"use strict";var s=i("react"),o=i.n(s);const n=(e,t,i)=>o().createElement(e,void 0===i?t:{...t,key:i}),r=(e,t,i)=>{const{children:s,...n}=t??{};return void 0!==i&&(n.key=i),Array.isArray(s)?o().createElement(e,n,...s):o().createElement(e,n,s)},l=o().Fragment;i.d(t,["FD",0,r,"FK",0,l,"Y",0,n])},"./node_modules/.pnpm/classnames@2.5.1/node_modules/classnames/index.js"(e,t){var i;!function(){"use strict";var s={}.hasOwnProperty;function o(){for(var e="",t=0;t<arguments.length;t++){var i=arguments[t];i&&(e=r(e,n(i)))}return e}function n(e){if("string"==typeof e||"number"==typeof e)return e;if("object"!=typeof e)return"";if(Array.isArray(e))return o.apply(null,e);if(e.toString!==Object.prototype.toString&&!e.toString.toString().includes("[native code]"))return e.toString();var t="";for(var i in e)s.call(e,i)&&e[i]&&(t=r(t,i));return t}function r(e,t){return t?e?e+" "+t:e+t:e}e.exports?(o.default=o,e.exports=o):void 0===(i=function(){return o}.apply(t,[]))||(e.exports=i)}()},"./node_modules/.pnpm/throttle-debounce@5.0.2/node_modules/throttle-debounce/esm/index.js"(e,t,i){"use strict";function s(e,t,i){var s=(i||{}).atBegin;return function(e,t,i){var s,o=i||{},n=o.noTrailing,r=void 0!==n&&n,l=o.noLeading,a=void 0!==l&&l,d=o.debounceMode,c=void 0===d?void 0:d,h=!1,u=0;function p(){s&&clearTimeout(s)}function g(){for(var i=arguments.length,o=new Array(i),n=0;n<i;n++)o[n]=arguments[n];var l=this,d=Date.now()-u;function g(){u=Date.now(),t.apply(l,o)}function m(){s=void 0}h||(a||!c||s||g(),p(),void 0===c&&d>e?a?(u=Date.now(),r||(s=setTimeout(c?m:g,e))):g():!0!==r&&(s=setTimeout(c?m:g,void 0===c?e-d:e)))}return g.cancel=function(e){var t=(e||{}).upcomingOnly,i=void 0!==t&&t;p(),h=!i},g}(e,t,{debounceMode:!1!==(void 0!==s&&s)})}i.d(t,{s:()=>s})}}]);