@fudanda/admin-antd 0.0.0-stage → 2.20261024.1-beta.1

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 (482) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +58 -3
  3. package/THIRD_PARTY_NOTICES.md +55 -0
  4. package/dist/assets/libarchive-DxGirPmi.wasm +0 -0
  5. package/dist/assets/pdfium-BJ2Yip8Q.wasm +0 -0
  6. package/dist/assets/ppt-font-cjk-DxgKpThH.otf +0 -0
  7. package/dist/assets/ppt-native-Cz5DBbag.wasm +0 -0
  8. package/dist/assets/pptx.worker-CtaL8LO_.js +30 -0
  9. package/dist/assets/worker-C5LZNsKY.mjs +1650 -0
  10. package/dist/assets/worker-CDeo9jS-.js +40 -0
  11. package/dist/assets/worker-bundle-Dx5mKZOL.js +6 -0
  12. package/dist/automation.d.ts +3 -0
  13. package/dist/automation.js +15 -0
  14. package/dist/chunks/App-DNjXLysb.js +79 -0
  15. package/dist/chunks/AppModal-DJzQA6FR.js +1 -0
  16. package/dist/chunks/ArcBaseAdmin-BZrHGq2f.js +1 -0
  17. package/dist/chunks/ConfigurableTable-DzmZDd8F.js +55 -0
  18. package/dist/chunks/DashboardPage-BohGodSl.js +22 -0
  19. package/dist/chunks/DataScopePanel-B2-x8Jcz.js +1 -0
  20. package/dist/chunks/DateTimeText-CIt0Qy45.js +1 -0
  21. package/dist/chunks/DepartmentsPage-DMWY__Y_.js +1 -0
  22. package/dist/chunks/DictTag-2-adKbYg.js +1 -0
  23. package/dist/chunks/DictsPage-DILDyHi-.js +15 -0
  24. package/dist/chunks/EditFormModal-DNHOZHxM.js +1 -0
  25. package/dist/chunks/EmptyIllustration-DUC3RZmF.js +1 -0
  26. package/dist/chunks/EntityContextRuntime-DMklAv-k.js +1 -0
  27. package/dist/chunks/EntityContextRuntime-sslBZqYD.js +1 -0
  28. package/dist/chunks/EntityRelationButton-DWn1rC2J.js +8 -0
  29. package/dist/chunks/ExportButton-AzH4D0oW.js +1 -0
  30. package/dist/chunks/FileNameCell-DPyi64Rv.js +1 -0
  31. package/dist/chunks/FileStorageConfigsPage-CzuOgeK0.js +15 -0
  32. package/dist/chunks/FileTypeIcon-DIih3XQG.js +1 -0
  33. package/dist/chunks/FileViewerPreviewPanel-CMqVtGCr.js +41 -0
  34. package/dist/chunks/FilesPage-BaEBCOCs.js +43 -0
  35. package/dist/chunks/IdentitySecurityPage-BO7nY8id.js +1 -0
  36. package/dist/chunks/JsonPreviewPanel-Dhbza-Uu.js +1 -0
  37. package/dist/chunks/LogStatsScaffold-CLycj3da.js +1 -0
  38. package/dist/chunks/LoginLogsPage-DTmHi8u0.js +1 -0
  39. package/dist/chunks/LoginLogsTable-DVmHnC6V.js +1 -0
  40. package/dist/chunks/MarkdownPreviewPanel-DoiaAeRv.js +51 -0
  41. package/dist/chunks/MasterDetailLayout-sjPWw8BI.js +8 -0
  42. package/dist/chunks/MemberAssignmentSheet-Czbt6_zv.js +1 -0
  43. package/dist/chunks/MenuCommandPalette-BCOzf-Kq.js +8 -0
  44. package/dist/chunks/MenusPage-DN8DTGB1.js +1 -0
  45. package/dist/chunks/ModalFooter-RMlvqrO9.js +1 -0
  46. package/dist/chunks/MonacoPreviewPanel-Dnz7xpWP.js +1 -0
  47. package/dist/chunks/NavListPanel-vjIOIqK0.js +1 -0
  48. package/dist/chunks/OnlineSessionsPage-FoHYZKlR.js +1 -0
  49. package/dist/chunks/OperationLogsPage-BeRnGcBJ.js +1 -0
  50. package/dist/chunks/OperationLogsTable-COI-Lp-y.js +1 -0
  51. package/dist/chunks/PDFPreviewPanel-BIQuBnZZ.js +37 -0
  52. package/dist/chunks/PasswordInput-DGEJO9yx.js +1 -0
  53. package/dist/chunks/PositionsPage-DohI0luX.js +1 -0
  54. package/dist/chunks/PreferencesSheetBody-B9niQABW.js +43 -0
  55. package/dist/chunks/ProfilePage-CVTRv7xb.js +15 -0
  56. package/dist/chunks/RelationPanel-B1X6AVaM.js +36 -0
  57. package/dist/chunks/ResponsiveTableActions-y54aSdhs.js +1 -0
  58. package/dist/chunks/RolesPage-CtUw93L8.js +1 -0
  59. package/dist/chunks/ScrollArea-DqjJmHDN.js +11 -0
  60. package/dist/chunks/SearchToolbar-CvgYKUjr.js +1 -0
  61. package/dist/chunks/SessionClientTag-DIwnYodW.js +22 -0
  62. package/dist/chunks/SessionConflictModal-BLNuDsN_.js +1 -0
  63. package/dist/chunks/SettingRow-DVNmTJWC.js +1 -0
  64. package/dist/chunks/SettingsPage-BRnCxYQm.js +26 -0
  65. package/dist/chunks/StatCard-Czjfs0fa.js +4 -0
  66. package/dist/chunks/UTIF-QUtClmQd.js +1 -0
  67. package/dist/chunks/UserAvatar-B8CFnTCn.js +1 -0
  68. package/dist/chunks/UserDisplay-J0Re8z-7.js +1 -0
  69. package/dist/chunks/UserGroupsPage-CNwbejx-.js +1 -0
  70. package/dist/chunks/UserLogsPanels-BHeSxWrk.js +36 -0
  71. package/dist/chunks/UserTransferSelect-CAeyxdor.js +22 -0
  72. package/dist/chunks/UsersPage-BXt9fOru.js +36 -0
  73. package/dist/chunks/abnfDiagram-VCTEODGH-Z6OhNjoW.js +1 -0
  74. package/dist/chunks/activity-DBu4axwF.js +8 -0
  75. package/dist/chunks/arc-B3K1fDeF.js +1 -0
  76. package/dist/chunks/architecture-7GRP2DOG-CMtoOwin.js +1 -0
  77. package/dist/chunks/architectureDiagram-5GKGNRK7-V5A7S5fY.js +36 -0
  78. package/dist/chunks/archive-B_IKvysI.js +72 -0
  79. package/dist/chunks/array-BrHhzP_A.js +1 -0
  80. package/dist/chunks/arrow-left-CsxBMzKY.js +8 -0
  81. package/dist/chunks/avsc-C0VoJRmm.js +160 -0
  82. package/dist/chunks/blockDiagram-I7D4REHJ-CFKGJkc_.js +129 -0
  83. package/dist/chunks/browser-BKLM0ThC-mnGPrtB_.js +1 -0
  84. package/dist/chunks/browser-index-JqxD-45S.js +1 -0
  85. package/dist/chunks/builtin_esm-external-require-react-BsBndGeN.js +1 -0
  86. package/dist/chunks/bundle-DbfUnEV1.js +29 -0
  87. package/dist/chunks/c4Diagram-7LVT6UL2-BqYYoXPe.js +38 -0
  88. package/dist/chunks/channel-C9Dr7Z-W.js +1 -0
  89. package/dist/chunks/chart-data-DImT_Mzn.js +5 -0
  90. package/dist/chunks/chart-renderer-k-Rd8vdL.js +7 -0
  91. package/dist/chunks/chevron-down-mn2tSKQd.js +8 -0
  92. package/dist/chunks/chevron-right-EBApfX6q.js +15 -0
  93. package/dist/chunks/chevrons-up-down-2M6hY6wt.js +15 -0
  94. package/dist/chunks/chunk-2E4U76K2-DNbbdpCx.js +1 -0
  95. package/dist/chunks/chunk-2Q5K7J3B-CmAE3Vs0.js +1 -0
  96. package/dist/chunks/chunk-2ZTRR5NV-BjsSRgBv.js +2 -0
  97. package/dist/chunks/chunk-3Z5EZCMW-uYiqz-6y.js +1 -0
  98. package/dist/chunks/chunk-4HAMMTFA-Aw59LwS3.js +62 -0
  99. package/dist/chunks/chunk-5V3GS4D5-B_CVcJic.js +1 -0
  100. package/dist/chunks/chunk-5VM5RSS4-DMlsEAcl.js +15 -0
  101. package/dist/chunks/chunk-6AZGARVD-CgAiC5mV.js +1 -0
  102. package/dist/chunks/chunk-6EIED4P4-CXz5D9B0.js +1 -0
  103. package/dist/chunks/chunk-6K3QC6MW-DtaQ52mY.js +1 -0
  104. package/dist/chunks/chunk-6TQVIW2G-D0YDxefI.js +1 -0
  105. package/dist/chunks/chunk-747NJXEK-DGoElbDa.js +2 -0
  106. package/dist/chunks/chunk-75Z2AOVW-IO9R6faP.js +2 -0
  107. package/dist/chunks/chunk-CLGD4ZFX-tRS89bnq.js +1 -0
  108. package/dist/chunks/chunk-DU6HZSFF-Bx48E1rg.js +125 -0
  109. package/dist/chunks/chunk-F27PBJKO-DtLva7y0.js +1 -0
  110. package/dist/chunks/chunk-FOHPRMQF-B8MMrnxV.js +255 -0
  111. package/dist/chunks/chunk-GMAD6QVW-D41KnniX.js +72 -0
  112. package/dist/chunks/chunk-GVQU2GXP-CVzgM_ui.js +1 -0
  113. package/dist/chunks/chunk-I5DQTOEV-CoecQT42.js +1 -0
  114. package/dist/chunks/chunk-ICYGCRZG-lH3opfCY.js +1 -0
  115. package/dist/chunks/chunk-IH6LHLGP-tD-j3Rsy.js +1 -0
  116. package/dist/chunks/chunk-IMKFNOWR-CL9pLQhV.js +231 -0
  117. package/dist/chunks/chunk-JWPE2WC7-Wk0BVLn5.js +1 -0
  118. package/dist/chunks/chunk-KI3K4JFJ-C-3Y_9er.js +1 -0
  119. package/dist/chunks/chunk-L3NEJ4N5-CmvrS7Dt.js +1 -0
  120. package/dist/chunks/chunk-LNGE3PJU-BP1fsJRz.js +34 -0
  121. package/dist/chunks/chunk-OSK3NFVY-C9uWOXTC.js +10 -0
  122. package/dist/chunks/chunk-OUJLGHUK-Cm55l9bx.js +2 -0
  123. package/dist/chunks/chunk-P2QGCYS3-C9bc1yiM.js +1 -0
  124. package/dist/chunks/chunk-POPQ4Y6H-P1s5xaxM.js +1 -0
  125. package/dist/chunks/chunk-PWAF6VOD-IORmPx9D.js +1 -0
  126. package/dist/chunks/chunk-SHT3W25Y-Bip4melZ.js +168 -0
  127. package/dist/chunks/chunk-SVP7TREG-BKCgUOuy.js +88 -0
  128. package/dist/chunks/chunk-TICWLB2K-12W2EmSx.js +206 -0
  129. package/dist/chunks/chunk-TLUHSLCS-DsqF476v.js +1 -0
  130. package/dist/chunks/chunk-UY3FDG6J-71d_M6t3.js +1 -0
  131. package/dist/chunks/chunk-XHIXRSVI-C2X1-xC6.js +1 -0
  132. package/dist/chunks/chunk-XXDRQBXY-Bl6AoSZF.js +1 -0
  133. package/dist/chunks/chunk-Y2CYZVJY-DjEHBC-3.js +1 -0
  134. package/dist/chunks/circle-check-RKAno__V.js +8 -0
  135. package/dist/chunks/circle-x-BB5x-D-8.js +8 -0
  136. package/dist/chunks/classDiagram-ZZMXUADV-CZrpYcfK.js +1 -0
  137. package/dist/chunks/classDiagram-v2-VYDZK3BY-CZrpYcfK.js +1 -0
  138. package/dist/chunks/clipboard-ERcMSMRH.js +1 -0
  139. package/dist/chunks/clock-CniP1gZS.js +8 -0
  140. package/dist/chunks/confirm-BtBBEqk8.js +1 -0
  141. package/dist/chunks/controls-C5dPckUT.js +1 -0
  142. package/dist/chunks/copy-ofLPH1I0.js +8 -0
  143. package/dist/chunks/cose-bilkent-JH36ORCC-D9OUqkk5.js +1 -0
  144. package/dist/chunks/createLucideIcon-BtwfYE6A.js +83 -0
  145. package/dist/chunks/cynefin-OW5HDTMX-B8_kUynj.js +1 -0
  146. package/dist/chunks/cynefinDiagram-5FMLGOSQ-DhQChnCg.js +62 -0
  147. package/dist/chunks/cytoscape.esm-wDUnleWx.js +339 -0
  148. package/dist/chunks/dagre-GXQ25YYZ-CfbwC_a5.js +4 -0
  149. package/dist/chunks/dagre-ZVAWSfFw.js +1 -0
  150. package/dist/chunks/data-B05HzECj.js +28 -0
  151. package/dist/chunks/date-picker-CPUxgHVv.js +1 -0
  152. package/dist/chunks/defaultLocale-BvxIcb9Y.js +1 -0
  153. package/dist/chunks/deleteAction-CCocr5uV.js +1 -0
  154. package/dist/chunks/diagram-D9cwc7QH.js +5 -0
  155. package/dist/chunks/diagram-S7CK7UJ4-DVPbdtMm.js +30 -0
  156. package/dist/chunks/diagram-UQ7AKVKN-D_ZBhGLL.js +41 -0
  157. package/dist/chunks/diagram-VSXAHHWV-Dqypp-OX.js +3 -0
  158. package/dist/chunks/diagram-VX7I27RA-CbWJVJ_L.js +24 -0
  159. package/dist/chunks/diagram-Z3DM3KII-CUyP4-RY.js +24 -0
  160. package/dist/chunks/direct-engine-thps0u7R.js +5 -0
  161. package/dist/chunks/dist-Bauqz5on.js +1 -0
  162. package/dist/chunks/dist-CWj_XYki.js +1 -0
  163. package/dist/chunks/dist-D_KGQS7-.js +11 -0
  164. package/dist/chunks/dist-DdW4yNBK.js +1 -0
  165. package/dist/chunks/docx-preview-CPN81HCr.js +11 -0
  166. package/dist/chunks/download--5IybXxz.js +8 -0
  167. package/dist/chunks/drawing-D2Qrun-P.js +48 -0
  168. package/dist/chunks/ebnfDiagram-PWID7BFC-C5NMigjm.js +1 -0
  169. package/dist/chunks/ellipsis-Dux1Nxa5.js +8 -0
  170. package/dist/chunks/email-ByshRsFv.js +61 -0
  171. package/dist/chunks/emailHtml-BAKcRhSm.js +1 -0
  172. package/dist/chunks/erDiagram-RLTQ6QDP-B5rUHJPJ.js +99 -0
  173. package/dist/chunks/eventmodeling-NTZA5JFV-C74no5BH.js +1 -0
  174. package/dist/chunks/export-BkwewH6Q.js +1 -0
  175. package/dist/chunks/export-DlTz5dc2.js +341 -0
  176. package/dist/chunks/eye-off-BtJoIT5n.js +8 -0
  177. package/dist/chunks/feedback-BnjMKZpz.js +1 -0
  178. package/dist/chunks/file-utils-DyvnVEoH.js +1 -0
  179. package/dist/chunks/fit-CsnhEncA.js +1 -0
  180. package/dist/chunks/flowDiagram-HODETNUW-BuMvaSeo.js +1 -0
  181. package/dist/chunks/form-CQutQFiD.js +1 -0
  182. package/dist/chunks/funnel-BwQjQI4Y.js +8 -0
  183. package/dist/chunks/ganttDiagram-EL5Y4UJY-DIAlbvVg.js +292 -0
  184. package/dist/chunks/geo-DR0fL7r2.js +38 -0
  185. package/dist/chunks/gitGraph-4MIJSDKK-Ce5mOfp1.js +1 -0
  186. package/dist/chunks/gitGraphDiagram-WWUBYQGX-DN3G9xiQ.js +106 -0
  187. package/dist/chunks/graphlib-CYBMTUbW.js +1 -0
  188. package/dist/chunks/icons-CbRx5Om7.js +1 -0
  189. package/dist/chunks/illustrations-DT1eq6jI.js +1 -0
  190. package/dist/chunks/image-ez9hvzKT.js +17 -0
  191. package/dist/chunks/index.es-OAWlVkoK.js +16 -0
  192. package/dist/chunks/info-A6RAGUB7-BP6lMBIR.js +1 -0
  193. package/dist/chunks/info-BQa8C31Y.js +8 -0
  194. package/dist/chunks/infoDiagram-27XIBGKW-BhQtr_Ti.js +2 -0
  195. package/dist/chunks/init-Ca_Ibf4y.js +1 -0
  196. package/dist/chunks/ishikawaDiagram-5VMMS53U-CLR6CAi4.js +70 -0
  197. package/dist/chunks/journeyDiagram-3NMN7TZE-_-Q7sjsP.js +139 -0
  198. package/dist/chunks/json-viewer-DHYRjY8I.js +1 -0
  199. package/dist/chunks/jszip.min-hNOoGCeG.js +14 -0
  200. package/dist/chunks/kanban-definition-UXKFOSKX-D97mHeUZ.js +89 -0
  201. package/dist/chunks/katex-D5qu7EYh.js +257 -0
  202. package/dist/chunks/layout-grid-Bp9bwiQZ.js +8 -0
  203. package/dist/chunks/lib-BlRm3nk1.js +15 -0
  204. package/dist/chunks/lib-C1nFUu19.js +4 -0
  205. package/dist/chunks/lib-CqYXBtHb.js +1 -0
  206. package/dist/chunks/libarchive-DRzzJvQl.js +7 -0
  207. package/dist/chunks/line-BV7qVRkM.js +1 -0
  208. package/dist/chunks/line-qVHaOdPp.js +1 -0
  209. package/dist/chunks/linear-DXABSWHW.js +1 -0
  210. package/dist/chunks/list-0CbyOlT9.js +1 -0
  211. package/dist/chunks/list-DCcWnjUg.js +8 -0
  212. package/dist/chunks/listTableProps-DDynsnLF.js +1 -0
  213. package/dist/chunks/log-in-OzbNes8i.js +8 -0
  214. package/dist/chunks/lucide-react-VfAPsQQ5.js +8 -0
  215. package/dist/chunks/maplibre-gl-Bxi83GUP.js +819 -0
  216. package/dist/chunks/maplibre-shared-Oo0L8Lll.js +6 -0
  217. package/dist/chunks/maximize-CnmQ11E7.js +8 -0
  218. package/dist/chunks/media-DoGe_p4O.js +1 -0
  219. package/dist/chunks/menu-mQgsexFx.js +15 -0
  220. package/dist/chunks/mermaid-parser.core-DvCAQkzY.js +3 -0
  221. package/dist/chunks/mermaid.core-CxOC6yPr.js +15 -0
  222. package/dist/chunks/messages-CFyOVxEM.js +1 -0
  223. package/dist/chunks/mindmap-definition-YA3MSWOX-A2UgnMwx.js +96 -0
  224. package/dist/chunks/minimize-Bpau_zCe.js +8 -0
  225. package/dist/chunks/msg-BzZbudMm.js +7 -0
  226. package/dist/chunks/ofd-C7DKqJ6Z.js +33 -0
  227. package/dist/chunks/ofd-DrJyXIpS.js +14 -0
  228. package/dist/chunks/openDocument-DGzqlyJg.js +12 -0
  229. package/dist/chunks/options-B65xkxOY.js +1 -0
  230. package/dist/chunks/ordinal-NuFkISw7.js +1 -0
  231. package/dist/chunks/packet-AYTQ26CC-DS6h3a5l.js +1 -0
  232. package/dist/chunks/panzoom.es-DnuzxUQi.js +1 -0
  233. package/dist/chunks/parse-6ZQGx714.js +1 -0
  234. package/dist/chunks/parser-DC3PvpL4.js +72 -0
  235. package/dist/chunks/path-VUNELGFR.js +1 -0
  236. package/dist/chunks/pegDiagram-XKGWAZYB-DxQqpKfh.js +1 -0
  237. package/dist/chunks/pie-WAS4IAKB-BsaegmNA.js +1 -0
  238. package/dist/chunks/pieDiagram-E7YTZNPT-BUsnkTkJ.js +39 -0
  239. package/dist/chunks/postal-mime-DMcA5b7k.js +28 -0
  240. package/dist/chunks/ppt-B0WY5Gks.js +30 -0
  241. package/dist/chunks/ppt-BIiNnCyj.js +1 -0
  242. package/dist/chunks/pptx-DX5KDFZ7.js +109 -0
  243. package/dist/chunks/preload-helper-C-73SErw.js +1 -0
  244. package/dist/chunks/print-mask-Dguzv0rv.js +17 -0
  245. package/dist/chunks/printLayout-oeudvFkr.js +34 -0
  246. package/dist/chunks/printMask-LefOTJqk.js +8 -0
  247. package/dist/chunks/psd-hjeNFQZ-.js +36 -0
  248. package/dist/chunks/purify.es-BsWMI_aG.js +5 -0
  249. package/dist/chunks/quadrantDiagram-AXDQQJYC-BmQNSzhY.js +7 -0
  250. package/dist/chunks/radar-RG4KPBEZ-BoHdw2h7.js +1 -0
  251. package/dist/chunks/railroad-74A4TZTK-BifJffb4.js +1 -0
  252. package/dist/chunks/railroad-abnf-HS5TGJTU-CMEPumRO.js +1 -0
  253. package/dist/chunks/railroad-ebnf-LZEXJU2U-B06BgAeN.js +1 -0
  254. package/dist/chunks/railroad-peg-WCYAUIDC-CMjriUEs.js +1 -0
  255. package/dist/chunks/railroadDiagram-O6MQD6OU-B2t5KY26.js +1 -0
  256. package/dist/chunks/react-runtime-x2lFbSKq.js +11 -0
  257. package/dist/chunks/refresh-cw-Dz8O9-Hp.js +8 -0
  258. package/dist/chunks/rendered-slot-YhfmcMJr.js +1 -0
  259. package/dist/chunks/requirementDiagram-BXWQKSXE-CBBfNOAp.js +84 -0
  260. package/dist/chunks/rolldown-runtime-BKuNeK48.js +1 -0
  261. package/dist/chunks/rotate-ccw-D2__Zisi.js +8 -0
  262. package/dist/chunks/rotate-cw-BSTVLlWY.js +8 -0
  263. package/dist/chunks/rough.esm-CVrpq1dW.js +1 -0
  264. package/dist/chunks/sankeyDiagram-P5KCCOFB-Cp8SrFyb.js +40 -0
  265. package/dist/chunks/save-w-NwiMMY.js +8 -0
  266. package/dist/chunks/search-DYZU68h1.js +8 -0
  267. package/dist/chunks/search-filters-CRIhZ0gL.js +1 -0
  268. package/dist/chunks/sequenceDiagram-WJ2MYXX4-PDtVfEoj.js +162 -0
  269. package/dist/chunks/shield-alert-De_Hx56I.js +8 -0
  270. package/dist/chunks/sizeCapture-INFHLROL-DA-kAaXB.js +1 -0
  271. package/dist/chunks/skeleton-CrjMjJNr.js +1 -0
  272. package/dist/chunks/spreadsheet-BzbBEhmY.js +1 -0
  273. package/dist/chunks/spreadsheet-LR3SOG-x.js +58 -0
  274. package/dist/chunks/sql-wasm-browser-CFddXd9f.js +2 -0
  275. package/dist/chunks/src-C1iDJpBK.js +1 -0
  276. package/dist/chunks/src-vLpLkuQx.js +1 -0
  277. package/dist/chunks/stateDiagram-D77RDMKH-C1Sx8KUD.js +1 -0
  278. package/dist/chunks/stateDiagram-v2-MP3YSRHH-7wYLSzBX.js +1 -0
  279. package/dist/chunks/swimlanes-42K2YHIH-BmybX9eL.js +1 -0
  280. package/dist/chunks/swimlanesDiagram-VR7AAH4N-DxhXklfm.js +8 -0
  281. package/dist/chunks/tabs-BobA_IcO.js +1 -0
  282. package/dist/chunks/theme-controller-D-ATwFal.js +1 -0
  283. package/dist/chunks/timeline-definition-24CTP7MA-QS9QNm2i.js +120 -0
  284. package/dist/chunks/tinycolor-CG1wnM-U.js +1 -0
  285. package/dist/chunks/togeojson.es-BE8iM7U6.js +1 -0
  286. package/dist/chunks/toolbar-controls-CThS0xuP.js +15 -0
  287. package/dist/chunks/trash-tHBT8Mpw.js +8 -0
  288. package/dist/chunks/treeView-Q6P3EWNA-CN0l7whJ.js +1 -0
  289. package/dist/chunks/treemap-WGGIJYW6-C4P1fQxS.js +1 -0
  290. package/dist/chunks/typography-DKK_iHcj.js +1 -0
  291. package/dist/chunks/ui-BFsHoY7a.js +1 -0
  292. package/dist/chunks/ui-utils-ClxYogUQ.js +1 -0
  293. package/dist/chunks/upload-M-n6woFv.js +8 -0
  294. package/dist/chunks/useCrudOperationColumn-D935tixd.js +1 -0
  295. package/dist/chunks/useListPage-CbcOQG4m.js +1 -0
  296. package/dist/chunks/useModalViewport-HF7te75S.js +1 -0
  297. package/dist/chunks/useRowSelection-4GOMFmjG.js +1 -0
  298. package/dist/chunks/useStatusToggle-B2qZaoc-.js +1 -0
  299. package/dist/chunks/user-round-kYfBkPNu.js +15 -0
  300. package/dist/chunks/users-BXZLb4TY.js +8 -0
  301. package/dist/chunks/vennDiagram-4TSXK5OY-CVd73ycc.js +34 -0
  302. package/dist/chunks/view-B8ZvC8z3.js +1 -0
  303. package/dist/chunks/viewer-Ct88ypIL.js +24 -0
  304. package/dist/chunks/wardley-WFR3VGLG-cG9pRFwD.js +1 -0
  305. package/dist/chunks/wardleyDiagram-VM6X3IG4-B42d0Gqz.js +78 -0
  306. package/dist/chunks/wordDoc-BZY3ZnxN.js +152 -0
  307. package/dist/chunks/wordDocx-Bt2mlB3C.js +77 -0
  308. package/dist/chunks/wordMl-Y_ghyTZ8.js +1 -0
  309. package/dist/chunks/worker-engine-B4e92GsN.js +17369 -0
  310. package/dist/chunks/x-Ak9hw1R9.js +8 -0
  311. package/dist/chunks/xmind-CF9YwkOD.js +58 -0
  312. package/dist/chunks/xychartDiagram-S5SC5T6Z-B_Owv9Ho.js +7 -0
  313. package/dist/file-viewer/flyfish-viewer-assets.json +46 -0
  314. package/dist/file-viewer/vendor/docx/docx.worker.js +5 -0
  315. package/dist/file-viewer/vendor/docx/jszip.min.js +13 -0
  316. package/dist/file-viewer/vendor/xlsx/sheet.worker.js +107 -0
  317. package/dist/file-viewer/wasm/data/sql-wasm.wasm +0 -0
  318. package/dist/index.d.ts +5 -0
  319. package/dist/index.js +1 -0
  320. package/dist/public/avatars/avatar-01.svg +1 -0
  321. package/dist/public/avatars/avatar-02.svg +1 -0
  322. package/dist/public/avatars/avatar-03.svg +1 -0
  323. package/dist/public/avatars/avatar-04.svg +1 -0
  324. package/dist/public/avatars/avatar-05.svg +1 -0
  325. package/dist/public/avatars/avatar-06.svg +1 -0
  326. package/dist/public/avatars/avatar-07.svg +1 -0
  327. package/dist/public/avatars/avatar-08.svg +1 -0
  328. package/dist/public/avatars/avatar-09.svg +1 -0
  329. package/dist/public/avatars/avatar-10.svg +1 -0
  330. package/dist/public/avatars/avatar-11.svg +1 -0
  331. package/dist/public/avatars/avatar-12.svg +1 -0
  332. package/dist/public/monaco/vs/abap-D-t0cyap.js +1 -0
  333. package/dist/public/monaco/vs/apex-CcIm7xu6.js +1 -0
  334. package/dist/public/monaco/vs/assets/css.worker-URu8fCFR.js +97 -0
  335. package/dist/public/monaco/vs/assets/editor.worker-lj3bdIIn.js +30 -0
  336. package/dist/public/monaco/vs/assets/editorWebWorkerMain-CA_vMoUU.js +30 -0
  337. package/dist/public/monaco/vs/assets/html.worker-D1SL3iM8.js +474 -0
  338. package/dist/public/monaco/vs/assets/json.worker-CoJx_OPf.js +62 -0
  339. package/dist/public/monaco/vs/assets/ts.worker-BWKtMYOk.js +67722 -0
  340. package/dist/public/monaco/vs/azcli-BA0tQDCg.js +1 -0
  341. package/dist/public/monaco/vs/basic-languages/monaco.contribution.js +1 -0
  342. package/dist/public/monaco/vs/bat-C397hTD6.js +1 -0
  343. package/dist/public/monaco/vs/bicep-DF5aW17k.js +2 -0
  344. package/dist/public/monaco/vs/cameligo-plsz8qhj.js +1 -0
  345. package/dist/public/monaco/vs/clojure-Y2auQMzK.js +1 -0
  346. package/dist/public/monaco/vs/coffee-Bu45yuWE.js +1 -0
  347. package/dist/public/monaco/vs/cpp-CkKPQIni.js +1 -0
  348. package/dist/public/monaco/vs/csharp-CX28MZyh.js +1 -0
  349. package/dist/public/monaco/vs/csp-D8uWnyxW.js +1 -0
  350. package/dist/public/monaco/vs/css-CaeNmE3S.js +3 -0
  351. package/dist/public/monaco/vs/css.worker-CyhWkhHo.js +1 -0
  352. package/dist/public/monaco/vs/cssMode-CV6Ay48H.js +1 -0
  353. package/dist/public/monaco/vs/cypher-DVThT8BS.js +1 -0
  354. package/dist/public/monaco/vs/dart-CmGfCvrO.js +1 -0
  355. package/dist/public/monaco/vs/dockerfile-CZqqYdch.js +1 -0
  356. package/dist/public/monaco/vs/ecl-30fUercY.js +1 -0
  357. package/dist/public/monaco/vs/editor/editor.main.css +1 -0
  358. package/dist/public/monaco/vs/editor/editor.main.js +1 -0
  359. package/dist/public/monaco/vs/editor-KLE6jdfb.js +831 -0
  360. package/dist/public/monaco/vs/editor.js +1 -0
  361. package/dist/public/monaco/vs/editorWorkerHost-fVE1cjcC.js +35 -0
  362. package/dist/public/monaco/vs/elixir-xjPaIfzF.js +1 -0
  363. package/dist/public/monaco/vs/flow9-DqtmStfK.js +1 -0
  364. package/dist/public/monaco/vs/freemarker2-FWreY7v7.js +3 -0
  365. package/dist/public/monaco/vs/fsharp-BOMdg4U1.js +1 -0
  366. package/dist/public/monaco/vs/go-D_hbi-Jt.js +1 -0
  367. package/dist/public/monaco/vs/graphql-CKUU4kLG.js +1 -0
  368. package/dist/public/monaco/vs/handlebars-CZi4pHCH.js +1 -0
  369. package/dist/public/monaco/vs/hcl-DTaboeZW.js +1 -0
  370. package/dist/public/monaco/vs/html-j_7ZTNRU.js +1 -0
  371. package/dist/public/monaco/vs/html.worker-CA3iAimZ.js +1 -0
  372. package/dist/public/monaco/vs/htmlMode-27by_KM4.js +1 -0
  373. package/dist/public/monaco/vs/index-049xrXrp.js +1 -0
  374. package/dist/public/monaco/vs/index-CBVt3dzv.js +5 -0
  375. package/dist/public/monaco/vs/index.js +1 -0
  376. package/dist/public/monaco/vs/ini-CsNwO04R.js +1 -0
  377. package/dist/public/monaco/vs/initialize-DL0l1TGY.js +1 -0
  378. package/dist/public/monaco/vs/java-CI4ZMsH9.js +1 -0
  379. package/dist/public/monaco/vs/javascript-DTJl4Jn1.js +1 -0
  380. package/dist/public/monaco/vs/json.worker-BizpAl9O.js +1 -0
  381. package/dist/public/monaco/vs/jsonMode-DLUiMUrI.js +1 -0
  382. package/dist/public/monaco/vs/julia-BwzEvaQw.js +1 -0
  383. package/dist/public/monaco/vs/kotlin-IUYPiTV8.js +1 -0
  384. package/dist/public/monaco/vs/language/css/monaco.contribution.js +1 -0
  385. package/dist/public/monaco/vs/language/html/monaco.contribution.js +1 -0
  386. package/dist/public/monaco/vs/language/json/monaco.contribution.js +1 -0
  387. package/dist/public/monaco/vs/language/typescript/monaco.contribution.js +1 -0
  388. package/dist/public/monaco/vs/less-C0eDYdqa.js +2 -0
  389. package/dist/public/monaco/vs/lexon-iON-Kj97.js +1 -0
  390. package/dist/public/monaco/vs/liquid-CLJYelW6.js +1 -0
  391. package/dist/public/monaco/vs/loader.js +1368 -0
  392. package/dist/public/monaco/vs/lspLanguageFeatures-BIkJOWLw.js +2 -0
  393. package/dist/public/monaco/vs/lua-DtygF91M.js +1 -0
  394. package/dist/public/monaco/vs/m3-CsR4AuFi.js +1 -0
  395. package/dist/public/monaco/vs/main-BEx-Fmlo.js +15 -0
  396. package/dist/public/monaco/vs/main-DsK8pnKg.js +3 -0
  397. package/dist/public/monaco/vs/markdown-C_rD0bIw.js +1 -0
  398. package/dist/public/monaco/vs/mdx-CpzZIPHF.js +1 -0
  399. package/dist/public/monaco/vs/mips-CiYP61RB.js +1 -0
  400. package/dist/public/monaco/vs/monaco.contribution-9cKT3C7t.js +1 -0
  401. package/dist/public/monaco/vs/monaco.contribution-BE88ZNGY.js +1 -0
  402. package/dist/public/monaco/vs/monaco.contribution-BPhsneLd.js +1 -0
  403. package/dist/public/monaco/vs/monaco.contribution-BgRy6xDf.js +1 -0
  404. package/dist/public/monaco/vs/msdax-C38-sJlp.js +1 -0
  405. package/dist/public/monaco/vs/mysql-CdtbpvbG.js +1 -0
  406. package/dist/public/monaco/vs/nls/lang/cs.d.ts +1 -0
  407. package/dist/public/monaco/vs/nls/lang/cs.js +9 -0
  408. package/dist/public/monaco/vs/nls/lang/de.d.ts +1 -0
  409. package/dist/public/monaco/vs/nls/lang/de.js +9 -0
  410. package/dist/public/monaco/vs/nls/lang/es.d.ts +1 -0
  411. package/dist/public/monaco/vs/nls/lang/es.js +9 -0
  412. package/dist/public/monaco/vs/nls/lang/fr.d.ts +1 -0
  413. package/dist/public/monaco/vs/nls/lang/fr.js +9 -0
  414. package/dist/public/monaco/vs/nls/lang/it.d.ts +1 -0
  415. package/dist/public/monaco/vs/nls/lang/it.js +9 -0
  416. package/dist/public/monaco/vs/nls/lang/ja.d.ts +1 -0
  417. package/dist/public/monaco/vs/nls/lang/ja.js +9 -0
  418. package/dist/public/monaco/vs/nls/lang/ko.d.ts +1 -0
  419. package/dist/public/monaco/vs/nls/lang/ko.js +9 -0
  420. package/dist/public/monaco/vs/nls/lang/pl.d.ts +1 -0
  421. package/dist/public/monaco/vs/nls/lang/pl.js +9 -0
  422. package/dist/public/monaco/vs/nls/lang/pt-br.d.ts +1 -0
  423. package/dist/public/monaco/vs/nls/lang/pt-br.js +9 -0
  424. package/dist/public/monaco/vs/nls/lang/ru.d.ts +1 -0
  425. package/dist/public/monaco/vs/nls/lang/ru.js +9 -0
  426. package/dist/public/monaco/vs/nls/lang/tr.d.ts +1 -0
  427. package/dist/public/monaco/vs/nls/lang/tr.js +9 -0
  428. package/dist/public/monaco/vs/nls/lang/zh-cn.d.ts +1 -0
  429. package/dist/public/monaco/vs/nls/lang/zh-cn.js +9 -0
  430. package/dist/public/monaco/vs/nls/lang/zh-tw.d.ts +1 -0
  431. package/dist/public/monaco/vs/nls/lang/zh-tw.js +9 -0
  432. package/dist/public/monaco/vs/nls.messages-loader.js +1 -0
  433. package/dist/public/monaco/vs/objective-c-CntZFaHX.js +1 -0
  434. package/dist/public/monaco/vs/pascal-r6kuqfl_.js +1 -0
  435. package/dist/public/monaco/vs/pascaligo-BiXoTmXh.js +1 -0
  436. package/dist/public/monaco/vs/perl-DABw_TcH.js +1 -0
  437. package/dist/public/monaco/vs/pgsql-me_jFXeX.js +1 -0
  438. package/dist/public/monaco/vs/php-D_kh-9LK.js +1 -0
  439. package/dist/public/monaco/vs/pla-VfZjczW0.js +1 -0
  440. package/dist/public/monaco/vs/postiats-BBSzz8Pk.js +1 -0
  441. package/dist/public/monaco/vs/powerquery-Dt-g_2cc.js +1 -0
  442. package/dist/public/monaco/vs/powershell-B-7ap1zc.js +1 -0
  443. package/dist/public/monaco/vs/protobuf-BmtuEB1A.js +2 -0
  444. package/dist/public/monaco/vs/pug-BRpRNeEb.js +1 -0
  445. package/dist/public/monaco/vs/python-CqWUUgfu.js +1 -0
  446. package/dist/public/monaco/vs/qsharp-BzsFaUU9.js +1 -0
  447. package/dist/public/monaco/vs/r-f8dDdrp4.js +1 -0
  448. package/dist/public/monaco/vs/razor-hok5y9Km.js +1 -0
  449. package/dist/public/monaco/vs/redis-fvZQY4PI.js +1 -0
  450. package/dist/public/monaco/vs/redshift-45Et0LQi.js +1 -0
  451. package/dist/public/monaco/vs/restructuredtext-C7UUFKFD.js +1 -0
  452. package/dist/public/monaco/vs/ruby-CZO8zYTz.js +1 -0
  453. package/dist/public/monaco/vs/rust-Bfetafyc.js +1 -0
  454. package/dist/public/monaco/vs/sb-3GYllVck.js +1 -0
  455. package/dist/public/monaco/vs/scala-foMgrKo1.js +1 -0
  456. package/dist/public/monaco/vs/scheme-CHdMtr7p.js +1 -0
  457. package/dist/public/monaco/vs/scss-C1cmLt9V.js +3 -0
  458. package/dist/public/monaco/vs/shell-ClXCKCEW.js +1 -0
  459. package/dist/public/monaco/vs/solidity-MZ6ExpPy.js +1 -0
  460. package/dist/public/monaco/vs/sophia-DWkuSsPQ.js +1 -0
  461. package/dist/public/monaco/vs/sparql-AUGFYSyk.js +1 -0
  462. package/dist/public/monaco/vs/sql-32GpJSV2.js +1 -0
  463. package/dist/public/monaco/vs/st-CuDFIVZ_.js +1 -0
  464. package/dist/public/monaco/vs/swift-t-PfMj7W.js +1 -0
  465. package/dist/public/monaco/vs/systemverilog-Ch4vA8Yt.js +1 -0
  466. package/dist/public/monaco/vs/tcl-D74tq1nH.js +1 -0
  467. package/dist/public/monaco/vs/toggleHighContrast-qGX7E9o7.js +61 -0
  468. package/dist/public/monaco/vs/ts.worker-2QLmBukE.js +1 -0
  469. package/dist/public/monaco/vs/tsMode-B0S_kp2q.js +11 -0
  470. package/dist/public/monaco/vs/twig-C6taOxMV.js +1 -0
  471. package/dist/public/monaco/vs/typescript-_2t_511t.js +1 -0
  472. package/dist/public/monaco/vs/typespec-8OfoLt6R.js +1 -0
  473. package/dist/public/monaco/vs/vb-Dyb2648j.js +1 -0
  474. package/dist/public/monaco/vs/wgsl-BhLXMOR0.js +298 -0
  475. package/dist/public/monaco/vs/workers-BBttULjf.js +1 -0
  476. package/dist/public/monaco/vs/xml-cZjNDqDT.js +1 -0
  477. package/dist/public/monaco/vs/yaml-A1fOIdH6.js +1 -0
  478. package/dist/src-LbWcrSWe.js +3 -0
  479. package/dist/styles.css +2 -0
  480. package/dist/styles.d.ts +1 -0
  481. package/dist/types.d.ts +1 -0
  482. package/package.json +113 -4
@@ -0,0 +1,16 @@
1
+ import{n as e}from"./rolldown-runtime-BKuNeK48.js";function t(){return`xxxxxxxxxxxxxxxxxx`.replace(/[x]/g,function(e){let t=Math.random()*16|0;return(e===`x`?t:t&3|8).toString(16)})}function n(e,t){let n=0,r;return function(...i){let a=(/* @__PURE__ */ new Date()).getTime(),o=a-n,s=typeof t==`function`?t():t;!n||o>=s?(e.apply(this,i),n=a):r||=setTimeout(()=>{e.apply(this,i),n=(/* @__PURE__ */ new Date()).getTime(),r=void 0},s-o)}}function r(e=[]){return e.length?e.map(e=>r(e.children)+1).sort((e,t)=>t-e)[0]:0}function i(e=[]){let t=[],n=[],r=[];return e.forEach(e=>{e.fixed===`left`?t.push(e):e.fixed===`right`?r.push(e):n.push(e)}),[...t.sort((e,t)=>(e.sort??0)-(t.sort??0)),...n.sort((e,t)=>(e.sort??0)-(t.sort??0)),...r.sort((e,t)=>(e.sort??0)-(t.sort??0))]}function a(e=[],t=1,n=0,r=``){return e.sort((e,t)=>(e.sort??0)-(t.sort??0)).map(e=>{if(e.children){let i=0,o=e.fixed;e.children.forEach(e=>{e.fixed=o});let s=a(e.children,t-1,n+1,e.key);return s&&s.forEach(e=>{i+=e.colspan??0}),{...e,width:e.width,level:n,rowspan:1,colspan:i,parentKey:r,children:s.sort((e,t)=>(e.sort??0)-(t.sort??0))}}return{...e,level:n,rowspan:t,colspan:1,parentKey:r}})}function o(e=[]){let t=[];return e.forEach(e=>{e.children?t=t.concat(o(e.children)):t.push(e)}),t}function s(e){return e.filter(e=>!e.hide).map(e=>Array.isArray(e.children)&&e.children.length>0?{...e,children:s(e.children)}:{...e})}function c(e){let t=[[``]];if(e.length===0)return t;let n=0,r=0,i;for(;e.length>0&&i!==e.length;)if(i=e.length,e.match(ut))e=e.replace(ut,``),n+=1,t[r][n]=``;else if(e.match(ct))e=e.replace(ct,``),n=0,r+=1,t[r]=[``];else{let i=``;if(e.startsWith(`"`)){let t=0,n=!0;for(;n;){let r=e.slice(0,1);r===`"`&&(t+=1),i+=r,e=e.slice(1),(e.length===0||e.match(/^[\t\r\n]/)&&t%2==0)&&(n=!1)}i=i.replace(/^"/,``).replace(/"$/,``).replace(/["]*/g,e=>Array(Math.floor(e.length/2)).fill(`"`).join(``))}else{let t=e.match(lt);i=t?t[0]:``,e=e.slice(i.length)}t[r][n]=i}return Array.isArray(t)&&t.length>1&&t[t.length-1].length===1&&t[t.length-1][0]===``&&(t=t.slice(0,t.length-1)),t}function l(e){let t,n,r,i,a=``,o;for(t=0,n=e.length;t<n;t+=1){for(i=e[t].length,r=0;r<i;r+=1)r>0&&(a+=` `),o=e[t][r],typeof o==`string`?o.indexOf(`
2
+ `)>-1?a+=`"${o.replace(/"/g,`""`)}"`:a+=o:a+=o??``;t!==n-1&&(a+=`
3
+ `)}return a}function u(e,t,n=[]){let r=0,i=[];return e.forEach((a,o)=>{o===0?i.push(1):(n.reduce((e,t)=>`${e}${a[t]??``}`,``)||a[t])===(n.reduce((t,n)=>`${t}${e[o-1][n]??``}`,``)||e[o-1][t])?(i[r]+=1,i.push(0)):(i.push(1),r=o)}),i}function d(e,t){let n=``,r=``,i={};return t.forEach((t,a)=>{a===0?(n=t.key,r=t.key,i[t.key]=1):e[t.key]===e[n]?(i[t.key]=0,i[r]+=1):(i[t.key]=1,n=t.key,r=t.key)}),i}function f(e,t,n=[]){let{visibleRows:r,rowIndex:i,headIndex:a}=e,o=u(r,t,n);return o[i-a]===0?{rowspan:0,colspan:0,relationRowKeys:n,mergeRow:!0}:{rowspan:o[i-a],colspan:1,relationRowKeys:n,mergeRow:!0}}function p(e,t=[]){let{column:n,row:r,visibleLeafColumns:i}=e,a=i.filter(e=>t.includes(e.key));if(t.includes(n.key)){let e=d(r,a);return e[n.key]===0?{rowspan:0,colspan:0,relationColKeys:t,mergeCol:!0}:{rowspan:1,colspan:e[n.key],relationColKeys:t,mergeCol:!0}}}function m(e,t=document.documentElement){let n=e.startsWith(`--`)?e:`--${e}`;return getComputedStyle(t).getPropertyValue(n).trim()}function h(e){if(!e)return/* @__PURE__ */ new Date(0);if(typeof e==`number`)return new Date(e);let t=String(e).trim(),n=new Date(t);if(!isNaN(n.getTime()))return n;for(let e of[/^(\d{4})-(\d{1,2})-(\d{1,2})$/,/^(\d{4})\/(\d{1,2})\/(\d{1,2})$/,/^(\d{4})\.(\d{1,2})\.(\d{1,2})$/,/^(\d{1,2})-(\d{1,2})-(\d{4})$/,/^(\d{1,2})\/(\d{1,2})\/(\d{4})$/,/^(\d{1,2})\.(\d{1,2})\.(\d{4})$/,/^(\d{1,2})-(\d{1,2})-(\d{4})$/,/^(\d{1,2})\/(\d{1,2})\/(\d{4})$/,/^(\d{1,2})\.(\d{1,2})\.(\d{4})$/,/^(\d{4})(\d{2})(\d{2})$/,/^(\d{4})-(\d{1,2})-(\d{1,2})\s+(\d{1,2}):(\d{1,2})(?::(\d{1,2}))?$/,/^(\d{4})\/(\d{1,2})\/(\d{1,2})\s+(\d{1,2}):(\d{1,2})(?::(\d{1,2}))?$/]){let n=t.match(e);if(n){let t=n.slice(1).map(Number);if(e.source.includes(`YYYY-MM-DD`)||e.source.includes(`YYYY/MM/DD`)||e.source.includes(`YYYY.MM.DD`)){let[e,n,r,i=0,a=0,o=0]=t;return new Date(e,n-1,r,i,a,o)}if(e.source.includes(`DD-MM-YYYY`)||e.source.includes(`DD/MM/YYYY`)||e.source.includes(`DD.MM.YYYY`)){let[e,n,r,i=0,a=0,o=0]=t;return new Date(r,n-1,e,i,a,o)}if(e.source.includes(`MM-DD-YYYY`)||e.source.includes(`MM/DD/YYYY`)||e.source.includes(`MM.DD.YYYY`)){let[e,n,r,i=0,a=0,o=0]=t;return new Date(r,e-1,n,i,a,o)}if(e.source.includes(`YYYYMMDD`)){let[e,n,r]=t;return new Date(e,n-1,r)}}}return/* @__PURE__ */ new Date(NaN)}function g(e,t){let n=h(e),r=h(t);return isNaN(n.getTime())&&isNaN(r.getTime())?0:isNaN(n.getTime())?-1:isNaN(r.getTime())?1:n.getTime()-r.getTime()}function _(e){return String(e).match(/\.(\d+)/)?.[1].length??0}function v(e){return(e.scrollbarMode??e.SCROLLBAR_MODE)===`inner`?`inner`:`outer`}function y(e){return v(e)===`inner`}function b(e){return y(e)?0:e.SCROLLER_TRACK_SIZE||0}function x(e){return e.SCROLLER_TRACK_SIZE||0}function S(e,t){return!y(e)||!t?0:x(e)}function C(e){return+!!y(e)}function w(e){return!y(e)}function T(e){return!y(e)}function E(e,t){return y(e)&&t}function D(e,t){return!y(e)||t.innerVisible||t.isFocus||t.isDragging}function ee(e){return e.ENABLE_RESIZE_COLUMN?e.RESIZE_COLUMN_DIVIDER_COLOR:void 0}function O(e){return e===!0?`default`:e===!1?`inner`:e}function k(e){return O(e)==="default"}function A(e){let t=O(e);return t==="default"||t===`inner`}function te(e,t,n,r,i={}){let{fixedLeftEnd:a=r,fixedRightStart:o=0}=i;return e===`right`?t>o+.01?`left`:null:e===`left`?t+n<a-.01?`right`:null:t+n<r-.01?`right`:null}function ne(e){let t=O(e);return t==="default"||t===`outer`}function re(e){return O(e)==="default"}function ie(e,t){return re(e)||t}function ae(e,t,n,r=t,i=30){if(e<=0||t<=0||n<=0||r<=0)return 0;let a=Math.floor(t/n*r);return a<i?Math.min(i,r):a>r?0:a}function oe(e){return e.shiftKey?Math.abs(e.deltaX)>Math.abs(e.deltaY)?e.deltaX:e.deltaY:e.deltaX}function se(e,t,n){return X(e,Y(t,n))}function j(e,t){return typeof e==`function`?e(t):e}function M(e){return e.split(`-`)[0]}function N(e){return e.split(`-`)[1]}function ce(e){return e===`x`?`y`:`x`}function le(e){return e===`y`?`height`:`width`}function P(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function ue(e){return ce(P(e))}function de(e,t,n){n===void 0&&(n=!1);let r=N(e),i=ue(e),a=le(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=ge(o)),[o,ge(o)]}function fe(e){let t=ge(e);return[pe(e),t,pe(t)]}function pe(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}function me(e,t,n){switch(e){case`top`:case`bottom`:return n?t?Yt:Jt:t?Jt:Yt;case`left`:case`right`:return t?Xt:Zt;default:return[]}}function he(e,t,n,r){let i=N(e),a=me(M(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(pe)))),a}function ge(e){let t=M(e);return qt[t]+e.slice(t.length)}function _e(e){return{top:0,right:0,bottom:0,left:0,...e}}function ve(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:_e(e)}function ye(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function be(e,t,n){let{reference:r,floating:i}=e,a=P(t),o=ue(t),s=le(o),c=M(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}switch(N(t)){case`start`:p[o]-=f*(n&&l?-1:1);break;case`end`:p[o]+=f*(n&&l?-1:1)}return p}async function xe(e,t){var n;t===void 0&&(t={});let{x:r,y:i,platform:a,rects:o,elements:s,strategy:c}=e,{boundary:l=`clippingAncestors`,rootBoundary:u=`viewport`,elementContext:d=`floating`,altBoundary:f=!1,padding:p=0}=j(t,e),m=ve(p),h=s[f?d===`floating`?`reference`:`floating`:d],g=ye(await a.getClippingRect({element:(n=await(a.isElement==null?void 0:a.isElement(h)))==null||n?h:h.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(s.floating)),boundary:l,rootBoundary:u,strategy:c})),_=d===`floating`?{x:r,y:i,width:o.floating.width,height:o.floating.height}:o.reference,v=await(a.getOffsetParent==null?void 0:a.getOffsetParent(s.floating)),y=await(a.isElement==null?void 0:a.isElement(v))&&await(a.getScale==null?void 0:a.getScale(v))||{x:1,y:1},b=ye(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:_,offsetParent:v,strategy:c}):_);return{top:(g.top-b.top+m.top)/y.y,bottom:(b.bottom-g.bottom+m.bottom)/y.y,left:(g.left-b.left+m.left)/y.x,right:(b.right-g.right+m.right)/y.x}}async function Se(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=M(n),s=N(n),c=P(n)===`y`,l=nn.has(o)?-1:1,u=a&&c?-1:1,d=j(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}function Ce(){return typeof window<`u`}function F(e){return we(e)?(e.nodeName||``).toLowerCase():`#document`}function I(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function L(e){return((we(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function we(e){return Ce()?e instanceof Node||e instanceof I(e).Node:!1}function R(e){return Ce()?e instanceof Element||e instanceof I(e).Element:!1}function z(e){return Ce()?e instanceof HTMLElement||e instanceof I(e).HTMLElement:!1}function Te(e){return!Ce()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof I(e).ShadowRoot}function Ee(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=V(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function De(e){return/^(table|td|th)$/.test(F(e))}function Oe(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}function ke(e){let t=R(e)?V(e):e;return Q(t.transform)||Q(t.translate)||Q(t.scale)||Q(t.rotate)||Q(t.perspective)||!je()&&(Q(t.backdropFilter)||Q(t.filter))||on.test(t.willChange||``)||sn.test(t.contain||``)}function Ae(e){let t=H(e);for(;z(t)&&!B(t);){if(ke(t))return t;if(Oe(t))return null;t=H(t)}return null}function je(){return cn??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),cn}function B(e){return/^(html|body|#document)$/.test(F(e))}function V(e){return I(e).getComputedStyle(e)}function Me(e){return R(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function H(e){if(F(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||Te(e)&&e.host||L(e);return Te(t)?t.host:t}function Ne(e){let t=H(e);return B(t)?e.ownerDocument?e.ownerDocument.body:e.body:z(t)&&Ee(t)?t:Ne(t)}function U(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=Ne(e),i=r===e.ownerDocument?.body,a=I(r);if(i){let e=Pe(a);return t.concat(a,a.visualViewport||[],Ee(r)?r:[],e&&n?U(e):[])}return t.concat(r,U(r,[],n))}function Pe(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Fe(e){let t=V(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=z(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=Gt(n)!==a||Gt(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Ie(e){return R(e)?e:e.contextElement}function W(e){let t=Ie(e);if(!z(t))return Z(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=Fe(t),o=(a?Gt(n.width):n.width)/r,s=(a?Gt(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}function Le(e){let t=I(e);return!je()||!t.visualViewport?ln:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Re(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==I(e)?!1:t}function G(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=Ie(e),o=Z(1);t&&(r?R(r)&&(o=W(r)):o=W(e));let s=Re(a,n,r)?Le(a):Z(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a){let e=I(a),t=r&&R(r)?I(r):r,n=e,i=Pe(n);for(;i&&r&&t!==n;){let e=W(i),t=i.getBoundingClientRect(),r=V(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=I(i),i=Pe(n)}}return ye({width:u,height:d,x:c,y:l})}function ze(e,t){let n=Me(e).scrollLeft;return t?t.left+n:G(L(e)).left+n}function Be(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-ze(e,n),y:n.top+t.scrollTop}}function Ve(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=L(r),s=t?Oe(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=Z(1),u=Z(0),d=z(r);if((d||!d&&!a)&&((F(r)!==`body`||Ee(o))&&(c=Me(r)),d)){let e=G(r);l=W(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?Be(o,c):Z(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function He(e){return Array.from(e.getClientRects())}function Ue(e){let t=L(e),n=Me(e),r=e.ownerDocument.body,i=X(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=X(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+ze(e),s=-n.scrollTop;return V(r).direction===`rtl`&&(o+=X(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}function We(e,t){let n=I(e),r=L(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=je();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=ze(r);if(l<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(r.clientWidth-t.clientWidth-i);o<=un&&(a-=o)}else l<=un&&(a+=l);return{width:a,height:o,x:s,y:c}}function Ge(e,t){let n=G(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=z(e)?W(e):Z(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function Ke(e,t,n){let r;if(t===`viewport`)r=We(e,n);else if(t===`document`)r=Ue(L(e));else if(R(t))r=Ge(t,n);else{let n=Le(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return ye(r)}function qe(e,t){let n=H(e);return n===t||!R(n)||B(n)?!1:V(n).position===`fixed`||qe(n,t)}function Je(e,t){let n=t.get(e);if(n)return n;let r=U(e,[],!1).filter(e=>R(e)&&F(e)!==`body`),i=null,a=V(e).position===`fixed`,o=a?H(e):e;for(;R(o)&&!B(o);){let t=V(o),n=ke(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&(i.position===`absolute`||i.position===`fixed`)||Ee(o)&&!n&&qe(e,o))?r=r.filter(e=>e!==o):i=t,o=H(o)}return t.set(e,r),r}function Ye(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?Oe(t)?[]:Je(t,this._c):[].concat(n),r],o=Ke(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=Ke(t,a[e],i);s=X(n.top,s),c=Y(n.right,c),l=Y(n.bottom,l),u=X(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function Xe(e){let{width:t,height:n}=Fe(e);return{width:t,height:n}}function Ze(e,t,n){let r=z(t),i=L(t),a=n===`fixed`,o=G(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=Z(0);function l(){c.x=ze(i)}if(r||!r&&!a){if((F(t)!==`body`||Ee(i))&&(s=Me(t)),r){let e=G(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else i&&l()}a&&!r&&i&&l();let u=i&&!r&&!a?Be(i,s):Z(0);return{x:o.left+s.scrollLeft-c.x-u.x,y:o.top+s.scrollTop-c.y-u.y,width:o.width,height:o.height}}function Qe(e){return V(e).position===`static`}function $e(e,t){if(!z(e)||V(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return L(e)===n&&(n=n.ownerDocument.body),n}function et(e,t){let n=I(e);if(Oe(e))return n;if(!z(e)){let t=H(e);for(;t&&!B(t);){if(R(t)&&!Qe(t))return t;t=H(t)}return n}let r=$e(e,t);for(;r&&De(r)&&Qe(r);)r=$e(r,t);return r&&B(r)&&Qe(r)&&!ke(r)?n:r||Ae(e)||n}function tt(e){return V(e).direction===`rtl`}function nt(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function rt(e,t){let n=null,r,i=L(e);function a(){var e;clearTimeout(r),(e=n)==null||e.disconnect(),n=null}function o(s,c){s===void 0&&(s=!1),c===void 0&&(c=1),a();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(s||t(),!f||!p)return;let m=Kt(d),h=Kt(i.clientWidth-(u+f)),g=Kt(i.clientHeight-(d+p)),_=Kt(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:X(0,Y(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(n!==c){if(!y)return o();n?o(!1,n):r=setTimeout(()=>{o(!1,1e-7)},1e3)}n===1&&!nt(l,e.getBoundingClientRect())&&o(),y=!1}try{n=new IntersectionObserver(b,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(b,v)}n.observe(e)}return o(!0),a}function it(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=Ie(e),u=i||a?[...l?U(l):[],...t?U(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?rt(l,n):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?G(e):null;c&&g();function g(){let t=G(e);h&&!nt(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var at,ot,K,st,ct,lt,ut,dt,q,ft,pt,mt,ht,gt,_t,vt,J,yt,bt,xt,St,Ct,wt,Tt,Et,Dt,Ot,kt,At,jt,Mt,Nt,Pt,Ft,It,Lt,Rt,zt,Bt,Vt,Ht,Ut,Wt,Y,X,Gt,Kt,Z,qt,Jt,Yt,Xt,Zt,Qt,$t,en,tn,nn,rn,an,on,sn,Q,cn,ln,un,dn,fn,pn,mn,hn,gn,$,_n,vn,yn,bn,xn,Sn,Cn,wn,Tn,En,Dn,On;function kn(){return(kn=e((()=>{(function(){try{if(typeof document<`u`){var e=document.createElement(`style`);e.appendChild(document.createTextNode(`:root{--evt-header-font: 12px normal Arial;--evt-body-font: 12px normal Arial;--evt-color-white: #fff;--evt-color-black: #000000;--evt-color-primary: rgb(82, 146, 247);--evt-text-color-primary: #333;--evt-text-color-regular: #666;--evt-text-color-secondary: #999;--evt-box-shadow: 0 2px 12px 0 #0000001a;--evt-editor-bg-color: #fff;--evt-editor-text-color: #333;--evt-border-color: #e1e6eb;--evt-fixed-column-shadow-color: rgba(0, 0, 0, .1);--evt-fixed-column-shadow-fade-color: rgba(0, 0, 0, 0);--evt-body-bg-color: #fff;--evt-stripe-color: #fafafa;--evt-placeholder-color: #cdd0dc;--evt-header-bg-color: #f8faff;--evt-header-text-color: #1d2129;--evt-body-text-color: #4e5969;--evt-footer-text-color: #4e5969;--evt-loading-icon-color: #4e5969;--evt-expand-icon-color: #4e5969;--evt-shrink-icon-color: #4e5969;--evt-error-tip-icon-color: red;--evt-required-color: #f56c6c;--evt-cell-hover-icon-bg-color: #fff;--evt-cell-hover-icon-border-color: #dde0ea;--evt-scroller-color: #dee0e3;--evt-scroller-track-color: #fff;--evt-scroller-focus-color: #bbbec4;--evt-select-border-color: var(--evt-color-primary);--evt-select-area-color: rgba(82, 146, 247, .1);--evt-select-row-col-bg-color: rgba(82, 146, 247, .1);--evt-autofill-point-border-color: #fff;--evt-edit-bg-color: #fcf6ed;--evt-checkbox-color: var(--evt-color-primary);--evt-checkbox-uncheck-color: #dde0ea;--evt-checkbox-disabled-color: #f1f2f4;--evt-checkbox-check-disabled-color: #dde0ea;--evt-icon-edit-color: #4e5969;--evt-icon-select-color: #4e5969;--evt-readonly-color: #fff;--evt-readonly-text-color: var(--evt-body-text-color);--evt-error-tip-color: #ed3f14;--evt-footer-bg-color: #fafafa;--evt-highlight-hover-row-color: rgba(186, 203, 231, .1);--evt-highlight-selected-row-color: rgba(82, 146, 247, .1);--evt-tooltip-bg-color: #303133;--evt-tooltip-text-color: #fff;--evt-resize-row-line-color: #e1e6eb;--evt-resize-column-text-color: #fff;--evt-resize-column-text-bg-color: var(--evt-color-primary);--evt-resize-column-line-color: #e1e6eb;--evt-tree-line-color: #e1e6eb;--evt-sort-icon-color: var(--evt-color-primary);--evt-drag-tip-bg-color: rgba(82, 146, 247, .1);--evt-drag-tip-line-color: var(--evt-color-primary);--evt-context-menu-min-width: 150px;--evt-context-menu-max-width: 220px;--evt-context-menu-item-padding: 8px 12px;--evt-context-menu-bg-color: #fff;--evt-context-menu-text-color: #333;--evt-context-menu-item-hover-text-color: var(--evt-color-primary);--evt-context-menu-item-hover-bg-color: #f5f5f5;--evt-context-menu-text-size: 13px}.dark{--evt-border-color: #363637;--evt-header-bg-color: #141414;--evt-body-bg-color: #141414;--evt-header-text-color: #a3a6ad;--evt-body-text-color: #cfd3dc;--evt-readonly-text-color: #cfd3dc;--evt-footer-text-color: #cfd3dc;--evt-scroller-color: #414243;--evt-scroller-track-color: #141414;--evt-scroller-focus-color: #a3a6ad;--evt-edit-bg-color: #141414;--evt-footer-bg-color: #262727;--evt-autofill-point-border-color: #fff;--evt-editor-bg-color: #434343;--evt-editor-text-color: #cfd3dc;--evt-context-menu-bg-color: #141414;--evt-context-menu-text-color: #cfd3dc;--evt-context-menu-item-hover-text-color: var(--evt-color-primary);--evt-context-menu-item-hover-bg-color: #414243}.e-virt-table-container{position:relative;outline:none}.e-virt-table-stage{position:relative;overflow:hidden;outline:none;box-sizing:border-box;z-index:10;border-radius:8px;border:1px solid var(--evt-border-color)}.e-virt-table-canvas{position:absolute;left:0;top:0;box-sizing:border-box;background-color:var(--evt-body-bg-color);border:none;outline:none;z-index:10}.e-virt-table-editor{position:absolute;top:-10000px;left:-10000px;text-align:left;height:auto;line-height:0;z-index:100;overflow:hidden;background-color:var(--evt-editor-bg-color);border:2px solid var(--evt-color-primary);box-sizing:border-box;box-shadow:var(--evt-box-shadow);display:flex;align-items:center}.e-virt-table-overlayer{position:absolute;left:0;top:0;overflow:hidden;z-index:100;pointer-events:none}.e-virt-table-editor-textarea{width:100%;box-sizing:border-box;outline:none;font-weight:400;padding:8px;font-size:12px;color:inherit;white-space:pre-wrap;word-wrap:break-word;word-break:break-all;line-height:1.5;margin:0;border:none;vertical-align:middle;background:var(--evt-editor-bg-color);color:var(--evt-editor-text-color);overflow-y:auto;resize:none}.e-virt-table-context-menu{position:absolute;font-size:14px;color:var(--evt-text-color-regular);background-color:var(--evt-color-white);border-radius:4px;border:1px solid #e4e7ed;box-shadow:var(--evt-box-shadow);width:fit-content;padding:6px 0;z-index:9999;left:-99999px;top:-99999px}.e-virt-table-context-menu-item{cursor:pointer;padding:6px 24px;color:var(--evt-text-color-regular)}.e-virt-table-context-menu-item:hover{color:var(--evt-color-primary);background-color:#f5f7fa}.e-virt-table-loading{display:none;position:absolute;left:0;top:0;right:0;bottom:0;width:100%;height:100%;z-index:2000;background-color:#fff6;display:flex;align-items:center;justify-content:center}.e-virt-table-loading-spinner{opacity:1;display:flex;flex-direction:column;align-items:center;justify-content:center}.e-virt-table-loading-spinner svg{color:var(--evt-text-color-regular);animation:rotate 1s linear infinite}@keyframes rotate{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.e-virt-table-loading-text{margin:0;font-size:12px;color:var(--evt-text-color-regular)}.e-virt-table-main-menu,.e-virt-table-submenu{position:absolute;background:var(--evt-context-menu-bg-color);border-radius:4px;box-shadow:0 2px 8px #0000001a;min-width:var(--evt-context-menu-min-width);max-width:var(--evt-context-menu-max-width);color:var(--evt-text-color-primary)}.e-virt-table-main-menu{border:1px solid var(--evt-border-color);z-index:3000;left:-99999px;top:-99999px;display:none;position:fixed;background-color:var(--evt-body-bg-color)}.e-virt-table-submenu{border:1px solid var(--evt-border-color);z-index:1000;max-height:350px;overflow-y:auto;opacity:0;visibility:hidden;transform:translate(-10px);transition:opacity .2s,visibility .2s,transform .2s;-ms-overflow-style:none;scrollbar-width:none}.e-virt-table-submenu::-webkit-scrollbar{display:none}.e-virt-table-submenu.show{opacity:1;visibility:visible;transform:translate(0)}.e-virt-table-submenu:not(.show){transition:none}.e-virt-table-menu-item,.e-virt-table-submenu-item{position:relative;-webkit-user-select:none;user-select:none;padding:var(--evt-context-menu-item-padding);cursor:pointer;display:flex;justify-content:space-between;align-items:center;transition:background .2s,color .2s;color:var(--evt-context-menu-text-color);font-size:var(--evt-context-menu-text-size)}.e-virt-table-menu-item:last-child,.e-virt-table-submenu-item:last-child{border-bottom:none}.e-virt-table-menu-item:has(.e-virt-table-menu-item-icon){padding-left:8px}.e-virt-table-menu-item-content{display:flex;align-items:center;flex:1;min-width:0}.e-virt-table-menu-item-icon{display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;margin-right:8px;flex-shrink:0}.e-virt-table-menu-item-icon svg{width:100%;height:100%;fill:currentColor}.e-virt-table-menu-item-text{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.e-virt-table-menu-arrow{display:inline-flex;align-items:center;justify-content:center;color:var(--evt-text-color-regular);transition:color .2s}.e-virt-table-menu-arrow svg{width:20px;height:20px;fill:currentColor}.e-virt-table-submenu-item:hover,.e-virt-table-menu-item:hover,.e-virt-table-menu-item.active{background:var(--evt-context-menu-item-hover-bg-color);color:var(--evt-context-menu-item-hover-text-color)}.e-virt-table-menu-item.disabled,.e-virt-table-submenu-item.disabled{cursor:not-allowed}.e-virt-table-finder-bar{position:absolute;top:8px;right:16px;display:none;z-index:10000;background:#fff;border:1px solid #dadce0;border-radius:12px;box-shadow:0 2px 6px #0003;padding:0 8px;height:48px;min-width:250px;align-items:center;font-size:12px}.e-virt-table-finder-bar.show{display:flex}.e-virt-table-finder-bar-input-wrapper{display:flex;align-items:center;flex:1;padding:0 8px;position:relative}.e-virt-table-finder-bar-input{border:none;outline:none;flex:1;font-size:12px;background:transparent;color:#333;min-width:150px;padding-left:0;position:relative}.e-virt-table-finder-bar-nav{display:flex;flex-direction:row;gap:8px;margin:0 8px;align-items:center}.e-virt-table-finder-bar-nav-btn{border:none;background:transparent;cursor:pointer;padding:0;color:#666;border-radius:50%;display:flex;align-items:center;justify-content:center}.e-virt-table-finder-bar-nav-btn svg{width:24px;height:24px}.e-virt-table-finder-bar-nav-btn.prev-btn{transform:rotate(-90deg)}.e-virt-table-finder-bar-nav-btn.next-btn{transform:rotate(90deg)}.e-virt-table-finder-bar-nav-btn.close-btn{font-size:24px;color:#666;line-height:1;width:24px;height:24px}.e-virt-table-finder-bar-nav-btn:hover{color:#666;background-color:#f0f0f0}.e-virt-table-finder-bar-count{color:#666;font-size:12px;margin:0 8px;white-space:nowrap;flex-shrink:0}.e-virt-table-finder-bar-count.no-results{color:#999}.e-virt-table-finder-bar-loading{display:none;position:absolute;left:8px;top:0;width:16px;height:16px;flex-shrink:0;pointer-events:none;z-index:0}.e-virt-table-finder-bar-loading.show{display:block}.e-virt-table-finder-bar-loading svg{width:100%;height:100%;color:#666;animation:rotate 1s linear infinite}.e-virt-table-empty{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);font-size:14px;color:#666;z-index:15}`)),document.head.appendChild(e)}}catch(e){console.error(`vite-plugin-css-injected-by-js`,e)}})(),at=Object.defineProperty,ot=(e,t,n)=>t in e?at(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,K=(e,t,n)=>ot(e,typeof t==`symbol`?t:t+``,n),st=class{constructor(e){K(this,`rules`),this.rules=e}validate(e){let t=[],{column:n,row:r,key:i,rowKey:a,colIndex:o,rowIndex:s,value:c,field:l,fieldValue:u}=e;Array.isArray(this.rules)||(this.rules=[this.rules]);for(let e of this.rules){if(e.validator){let d={field:l,fieldValue:u,value:c,column:n,colIndex:o,rowIndex:s,row:r,key:i,rowKey:a,...e};e.validator(d,c,e=>{e&&t.push({...d,message:e})})}if(!e.required&&(c==null||c===``))return t;e.pattern&&!e.pattern.test(c)&&t.push({value:c,column:n,row:r,key:i,rowKey:a,colIndex:o,rowIndex:s,field:l,fieldValue:u,message:e.message||`${i} is pattern validation error`}),e.required&&(c==null||c===``)&&t.push({value:c,column:n,row:r,key:i,rowKey:a,colIndex:o,rowIndex:s,field:l,fieldValue:u,message:e.message||`${i} is required`})}return t}},ct=/^(\r\n|\n\r|\r|\n)/,lt=/^[^\t\r\n]+/,ut=/^\t/,dt=class{constructor(e,t,n,r,i,a,o){K(this,`ctx`),K(this,`x`,0),K(this,`y`,0),K(this,`width`,0),K(this,`height`,0),K(this,`visibleWidth`,0),K(this,`visibleHeight`,0),K(this,`fixed`),K(this,`cellType`),K(this,`drawX`,0),K(this,`drawY`,0),K(this,`cellImages`,/* @__PURE__ */ new Map),this.ctx=e,this.x=t,this.y=n,this.width=r,this.height=i,this.fixed=o,this.cellType=a}isHorizontalVisible(){if(this.fixed)return!0;let{stageWidth:e,fixedLeftWidth:t,scrollX:n,fixedRightWidth:r}=this.ctx,i=e;return!(this.x+this.width-t-n<=0||this.x-n>=i-r)}isVerticalVisible(){let{stageHeight:e,scrollY:t}=this.ctx,n=e;return!(this.y+this.height-t<=0||this.y-t>=n)}getDrawX(){if(this.fixed===`left`)return this.x;if(this.fixed===`right`){let{stageWidth:e}=this.ctx;return e-(this.ctx.header.width-this.x)-b(this.ctx.config)}return this.x-this.ctx.scrollX}getDrawY(){return this.cellType===`header`||this.cellType===`footer`&&this.ctx.config.FOOTER_FIXED?this.y:this.y-this.ctx.scrollY}getLeftFixedX(){return this.x-this.ctx.scrollX}isInside(e,t){return e>=this.drawX&&e<=this.drawX+this.width&&t>=this.drawY&&t<=this.drawY+this.height}isInsideVisible(e,t){return e>=this.drawX&&e<=this.drawX+this.visibleWidth&&t>=this.drawY&&t<=this.drawY+this.visibleHeight&&this.isInside(e,t)}setImage(e,t){this.cellImages.set(e,t)}getImages(){return this.cellImages}getImage(e){return this.cellImages.get(e)}isImageInside(e,t){let{offsetX:n,offsetY:r}=this.ctx.getOffset(t),i=this.getImage(e);return i?i.isInside(n,r):!1}getImageClickDirection(e,t){let{offsetX:n,offsetY:r}=this.ctx.getOffset(t),i=this.getImage(e);if(!i)return null;let a=n-i.x,o=r-i.y,s=i.width/2;return o<i.height/2?a<s?`up-left`:`up-right`:a<s?`down-left`:`down-right`}},q=class{constructor(e,t,n,r,i,a){K(this,`source`),K(this,`name`),K(this,`x`),K(this,`y`),K(this,`width`),K(this,`height`),K(this,`visible`,!0),this.source=a,this.name=e,this.x=t,this.y=n,this.width=r,this.height=i}drawWrapper(e,t){e.paint.drawRect(this.x-2,this.y-2,this.width+4,this.height+4,{radius:4,borderWidth:1,...t})}setVisible(e){this.visible=e}isInside(e,t){return this.visible?!!(this.source&&e>this.x&&e<this.x+this.width&&t>this.y&&t<this.y+this.height):!1}},ft=class extends dt{constructor(e,t,n,r,i,a,o,s,c,l=`body`,u=!0){super(e,r,i,a,o,l,s.fixed),K(this,`parentRowKey`,``),K(this,`parentRowKeys`,[]),K(this,`formatter`),K(this,`formatterFinderValue`),K(this,`formatterFinderFooterValue`),K(this,`formatterFooter`),K(this,`hoverIconName`,``),K(this,`operation`,!1),K(this,`align`),K(this,`verticalAlign`),K(this,`fixed`),K(this,`type`),K(this,`editorType`),K(this,`editorProps`),K(this,`cellType`),K(this,`level`),K(this,`colspan`,1),K(this,`rowspan`,1),K(this,`mergeRow`,!1),K(this,`mergeCol`,!1),K(this,`relationRowKeys`,[]),K(this,`relationColKeys`,[]),K(this,`key`),K(this,`column`),K(this,`rowIndex`),K(this,`colIndex`),K(this,`rowKey`),K(this,`row`),K(this,`value`),K(this,`render`),K(this,`renderFooter`),K(this,`style`,{}),K(this,`domDataset`,{}),K(this,`rules`,[]),K(this,`message`,``),K(this,`text`,``),K(this,`displayText`,``),K(this,`visibleWidth`,0),K(this,`visibleHeight`,0),K(this,`isHasChanged`,!1),K(this,`drawX`,0),K(this,`drawY`,0),K(this,`drawCellBgColor`,``),K(this,`drawCellSkyBgColor`,``),K(this,`drawTextColor`,``),K(this,`drawTextFont`,``),K(this,`drawTextX`,0),K(this,`drawTextY`,0),K(this,`drawTextWidth`,0),K(this,`drawTextHeight`,0),K(this,`autoRowHeight`,!1),K(this,`calculatedHeight`,0),K(this,`ellipsis`,!1),K(this,`rowExpand`,!1),K(this,`rowHasChildren`,!1),K(this,`overflowTooltipShow`,!0),K(this,`selectorCellValueType`,`value`),K(this,`overflowTooltipMaxWidth`,500),K(this,`overflowTooltipPlacement`,`top`),K(this,`maxLineClamp`,`auto`),K(this,`precision`),K(this,`min`),K(this,`max`),K(this,`maxlength`),K(this,`mixedRender`,!1),K(this,`renderType`,`default`),K(this,`renderFooterType`,`default`),this.visibleWidth=this.width,this.visibleHeight=this.height,this.colIndex=n,this.rowIndex=t,this.key=s.key,this.type=s.type||``,this.editorType=s.editorType||`text`,this.selectorCellValueType=s.selectorCellValueType||this.ctx.config.SELECTOR_CELL_VALUE_TYPE||`value`,this.editorProps=s.editorProps||{},this.cellType=l,this.align=s.align||this.ctx.config.COLUMNS_ALIGN,this.verticalAlign=s.verticalAlign||this.ctx.config.COLUMNS_VERTICAL_ALIGN,this.fixed=s.fixed||``,this.level=s.level||0,this.operation=s.operation||!1,this.column=s,this.rules=s.rules||[],this.row=c,this.rowKey=this.cellType===`body`?this.ctx.database.getRowKeyForRowIndex(t):`${this.cellType}_${this.rowIndex}`,this.value=this.getValue(),this.render=s.render,this.overflowTooltipShow=s.overflowTooltipShow!==!1,this.autoRowHeight=s.autoRowHeight===void 0?this.ctx.config.AUTO_ROW_HEIGHT:s.autoRowHeight,this.overflowTooltipMaxWidth=s.overflowTooltipMaxWidth||500,this.overflowTooltipPlacement=s.overflowTooltipPlacement||`top`,this.renderFooter=s.renderFooter,this.hoverIconName=s.hoverIconName,this.formatter=s.formatter,this.formatterFinderValue=s.formatterFinderValue,this.formatterFinderFooterValue=s.formatterFinderFooterValue,this.formatterFooter=s.formatterFooter,this.maxLineClamp=s.maxLineClamp||`auto`,this.precision=s.precision,this.min=s.min,this.max=s.max,this.maxlength=s.maxlength,this.mixedRender=s.mixedRender||!1,this.renderType=s.renderType||`default`,this.renderFooterType=s.renderFooterType||`default`;let d=this.ctx.database.getRowForRowKey(this.rowKey);this.cellType===`body`&&d&&(this.parentRowKey=d.parentRowKey,this.parentRowKeys=d.parentRowKeys),u&&this.update()}setWidthHeight(e,t){this.width=e,this.height=t}getValidationMessage(){let e=this.ctx.database.getValidationError(this.rowKey,this.key);if(Array.isArray(e)&&e.length){let[t]=e;this.message=t.message||``}return this.message}update(){this.drawX=this.getDrawX(),this.drawY=this.getDrawY(),this.updateSpan(),this.updateDragImage();let e=this.getImage(`drag`),t=e?e.width:0;this.drawTextX=this.drawX+t,this.drawTextY=this.drawY,this.isHasChanged=this.ctx.database.isHasChangedData(this.rowKey,this.key),this.drawTextWidth=this.visibleWidth-t,this.drawTextHeight=this.visibleHeight,this.updateStyle(),this.updateType(),this.updateHoverIcon(),this.updateSelection(),this.updateTree(),this.updateEditor(),this.updateRender(),this.getValidationMessage(),this.updateContainer(),this.text=this.getText(),this.displayText=this.getDisplayText()}updateSpan(){if(this.cellType===`footer`)return;let{SPAN_METHOD:e}=this.ctx.config;if(typeof e==`function`){let{colspan:t=1,rowspan:n=1,relationRowKeys:r,relationColKeys:i,mergeRow:a=!1,mergeCol:o=!1}=e({row:this.row,rowIndex:this.rowIndex,colIndex:this.colIndex,column:this.column,value:this.getValue(),headIndex:this.ctx.body.headIndex,headPosition:this.ctx.database.getPositionForRowIndex(this.ctx.body.headIndex),visibleRows:this.ctx.body.visibleRows,visibleLeafColumns:this.ctx.header.visibleLeafColumns,rows:this.ctx.body.data})||{};this.relationRowKeys=Array.isArray(r)&&r.length>0?r:[this.key],this.relationColKeys=Array.isArray(i)&&i.length>0?i:[this.key],this.mergeCol=o,this.mergeRow=a,this.colspan=t,this.rowspan=n,this.visibleWidth=this.getWidthByColIndexColSpan(this.colIndex,this.colspan),this.visibleHeight=this.ctx.database.getHeightByRowIndexRowSpan(this.rowIndex,this.rowspan)}}updateSpanInfo(){if(this.mergeRow||this.mergeCol){let e=this.getSpanInfo();this.height=e.height,this.width=e.width,this.drawX=this.getDrawX(),this.drawY=this.getDrawY(),this.drawY-=e.offsetTop,this.drawX-=e.offsetLeft}}updateType(){let{BODY_CELL_TYPE_METHOD:e}=this.ctx.config;if(typeof e==`function`){let t=e({row:this.row,rowIndex:this.rowIndex,colIndex:this.colIndex,column:this.column,value:this.getValue()});t!==void 0&&(this.type=t)}}updateEditor(){let{BODY_CELL_EDITOR_METHOD:e}=this.ctx.config;if(typeof e==`function`){let t=e({row:this.row,rowIndex:this.rowIndex,colIndex:this.colIndex,column:this.column,value:this.getValue()});if(t!==void 0){let{type:e,props:n={}}=t;this.editorType=e,this.editorProps=n}}}updateRender(){let{BODY_CELL_RENDER_METHOD:e}=this.ctx.config;if(typeof e==`function`){let t=e({row:this.row,rowIndex:this.rowIndex,colIndex:this.colIndex,column:this.column,value:this.getValue()});t!==void 0&&(this.render=t)}}validate(){this.ctx.database.getValidator(this.rowKey,this.key).then(e=>{if(Array.isArray(e)&&e.length){let[t]=e;this.message=t.message}else this.message=``}).finally(()=>{this.ctx.emit(`draw`)})}updateStyle(){this.autoRowHeight&&(this.domDataset={"data-auto-height":!0,"data-row-index":this.rowIndex,"data-col-index":this.colIndex}),this.style=this.getOverlayerViewsStyle()}isInsideVisible(e,t){return e>=this.drawX&&e<=this.drawX+this.visibleWidth&&t>=this.drawY&&t<=this.drawY+this.visibleHeight}updateTree(){let{CELL_PADDING:e=0}=this.ctx.config,{rowKey:t,cellType:n}=this,r,i=0,a=``;if(!([`tree`,`selection-tree`,`tree-selection`].includes(this.type)&&n===`body`))return;let{expand:o=!1,hasChildren:s=!1,expandLoading:c=!1,level:l=0}=this.ctx.database.getRowForRowKey(t)||{};this.rowExpand=o,this.rowHasChildren=s;let{TREE_INDENT:u=16,CHECKBOX_SIZE:d,TREE_ICON_SIZE:f}=this.ctx.config;if(i=l*u,c){let e=this.ctx.icons.get(`loading`);a=`loading`,r=e}else if(s){let e=this.ctx.icons.get(`expand`),t=this.ctx.icons.get(`shrink`);r=o?t:e,a=o?`shrink`:`expand`}let p=f,m=f,h=this.drawX;(this.align===`center`||this.align===`right`)&&(h=this.drawX+(this.visibleWidth-p-2*e)/2,this.align=`left`);let g=h+i+e,_=this.drawY+(this.visibleHeight-m)/2,v=i+this.drawX+p-.5,y=this.getImage(`selection`),b=this.getImage(`drag`),x=b?b.width:0;if(this.type===`selection-tree`&&y){let t=y.x,n=y.width;g=i+t+n,v=g+p-e/2}else this.type===`tree-selection`?(g+=x,v=g+d+p-e/2):(g+=x,v=g+p-e/2);this.drawTextX=v,this.drawTextWidth=this.drawX+this.visibleWidth-v,!(g+p+e>this.drawX+this.visibleWidth)&&(_+m+e>this.drawY+this.visibleHeight||this.setImage(`tree`,new q(a,g,_,p,m,r)))}updateDragImage(){if(this.cellType===`body`&&this.column.dragRow){let{DRAG_ROW_ICON_SIZE:e,CELL_PADDING:t}=this.ctx.config,n=this.drawX+t/2,r=this.drawY+(this.visibleHeight-e)/2,i=new q(`drag`,n,r,e,e,this.ctx.icons.get(`drag`));this.rowspan===0&&i.setVisible(!1),this.setImage(`drag`,i)}}drawTreeLine(){let{TREE_LINE:e,TREE_INDENT:t=16,TREE_ICON_SIZE:n=16,TREE_LINE_COLOR:r=`#e1e6eb`}=this.ctx.config;if(!e||this.cellType!==`body`||![`tree`,`selection-tree`,`tree-selection`].includes(this.type)||this.rowspan===0||this.colspan===0)return;let i=this.ctx.database.getRowForRowKey(this.rowKey)||{},a=i.level??0,o=this.getImage(`tree`);if(!o)return;let s=o.x,c=o.y,l=o.width,u=o.height,d=s+l/2,f=c+u/2,p=s-a*t,m=Array.isArray(i.parentRowKeys)?i.parentRowKeys:[];if(a>0){for(let e=0;e<a-1;e+=1){let i=m[e+1];if((i&&this.ctx.database.getRowForRowKey(i)||{}).isLastChild)continue;let o=Math.round(s-(a-e)*t+n/2);this.ctx.paint.drawLine([o,this.drawY,o,this.drawY+this.visibleHeight],{borderColor:r,borderWidth:1,lineDash:[4,4],lineDashOffset:0})}let e=Math.round(s-t+n/2),o=i.isLastChild?f:this.drawY+this.visibleHeight;this.ctx.paint.drawLine([e,this.drawY,e,o],{borderColor:r,borderWidth:1,lineDash:[4,4],lineDashOffset:0});let c=Math.round(p+(a-1)*t+n/2);this.ctx.paint.drawLine([c,f,d,f],{borderColor:r,borderWidth:1,lineDash:[4,4],lineDashOffset:0})}if(i.hasChildren&&i.expand){let e=c+u,t=this.drawY+this.visibleHeight;this.ctx.paint.drawLine([d,e,d,t],{borderColor:r,borderWidth:1,lineDash:[4,4],lineDashOffset:0})}}updateContainer(){let{BODY_BG_COLOR:e,EDIT_BG_COLOR:t,BODY_CELL_STYLE_METHOD:n,FOOTER_CELL_STYLE_METHOD:r,READONLY_TEXT_COLOR:i,BODY_TEXT_COLOR:a,FOOTER_TEXT_COLOR:o,FOOTER_BG_COLOR:s,HIGHLIGHT_SELECTED_ROW:c,HIGHLIGHT_SELECTED_ROW_COLOR:l,HIGHLIGHT_HOVER_ROW:u,HIGHLIGHT_HOVER_ROW_COLOR:d,STRIPE:f,STRIPE_COLOR:p,FINDER_CELL_BG_COLOR:m}=this.ctx.config;if(this.cellType===`footer`){let e=s,t=o;if(typeof r==`function`){let{backgroundColor:n,color:i,font:a}=r({row:this.row,rowIndex:this.rowIndex,colIndex:this.colIndex,column:this.column,value:this.getValue()})||{};n&&(e=n),i&&(t=i),a&&(this.drawTextFont=a)}let{rowIndex:n,colIndex:i,type:a}=this.ctx.finderBar;n===this.rowIndex&&i===this.colIndex&&a===`footer`&&(e=m),this.drawCellSkyBgColor=`transparent`,this.drawCellBgColor=e,this.drawTextColor=t;return}let h=`transparent`,g=this.ctx.hoverCell,_=this.ctx.currentCell,v=this.rowIndex,y=this.rowIndex;if(this.rowspan!==1&&(u||c)){let{yArr:e}=this.getSpanInfo();v=e[0],y=e[1]}u&&g&&!this.ctx.dragRowIng&&(g.rowKey===this.rowKey&&(h=d),g.rowIndex>=v&&g.rowIndex<=y&&(h=d)),c&&_&&!this.ctx.dragRowIng&&(_.rowKey===this.rowKey&&(h=l),_.rowIndex>=v&&_.rowIndex<=y&&(h=l)),this.drawCellSkyBgColor=h;let b=e,x=a;if(!this.ctx.database.getReadonly(this.rowKey,this.key)&&![`index`,`index-selection`].includes(this.type)&&(b=t,x=i),f&&(b=this.rowIndex%2?p:e),typeof n==`function`){let{backgroundColor:e,color:t,font:r}=n({row:this.row,rowIndex:this.rowIndex,colIndex:this.colIndex,column:this.column,isHasChanged:this.isHasChanged,value:this.getValue()})||{};e&&(b=e),t&&(x=t),r&&(this.drawTextFont=r)}let{rowIndex:S,colIndex:C,type:w}=this.ctx.finderBar;S===this.rowIndex&&C===this.colIndex&&w===`body`&&(b=m),this.drawCellBgColor=b,this.drawTextColor=x}updateSelection(){let{visibleWidth:e,visibleHeight:t,rowspan:n,colspan:r,cellType:i,type:a,rowIndex:o,rowKey:s}=this;if(n===0||r===0||i===`footer`||![`index-selection`,`selection`,`selection-tree`,`tree-selection`].includes(a))return;let c=this.ctx.database.getRowSelectable(s),{CHECKBOX_SIZE:l=0,CELL_PADDING:u}=this.ctx.config,d=this.drawX+u;(this.align===`center`||this.align===`right`)&&(d=this.drawX+(e-l)/2);let f=d,p=this.drawY+(t-l)/2;if(a!==`selection-tree`&&a===`tree-selection`){let{TREE_INDENT:e=16,TREE_ICON_SIZE:t}=this.ctx.config,{level:n=0}=this.ctx.database.getRowForRowKey(s)||{},r=n*e;f=d+t+r}let m=this.ctx.icons.get(`checkbox-uncheck`),h=`checkbox-uncheck`;if(a===`selection-tree`||a===`tree-selection`){let e=this.ctx.database.getTreeSelectionState(s);e.indeterminate&&c?(m=this.ctx.icons.get(`checkbox-indeterminate`),h=`checkbox-indeterminate`):e.checked&&c?(m=this.ctx.icons.get(`checkbox-check`),h=`checkbox-check`):!e.checked&&c?(m=this.ctx.icons.get(`checkbox-uncheck`),h=`checkbox-uncheck`):(m=this.ctx.icons.get(`checkbox-disabled`),h=`checkbox-disabled`)}else{let e=this.ctx.database.getRowSelection(s);e&&c?(m=this.ctx.icons.get(`checkbox-check`),h=`checkbox-check`):e&&!c?(m=this.ctx.icons.get(`checkbox-check-disabled`),h=`checkbox-check-disabled`):!e&&c?(m=this.ctx.icons.get(`checkbox-uncheck`),h=`checkbox-uncheck`):(m=this.ctx.icons.get(`checkbox-disabled`),h=`checkbox-disabled`)}let g=this.getImage(`drag`),_=g?g.width:0;if(f+=_,f+l+u>this.drawX+this.visibleWidth||p+l+u>this.drawY+this.visibleHeight)return;let v=new q(h,f,p,l,l,m);if(a===`index-selection`){v.setVisible(!1),(this.ctx.hoverCell&&this.ctx.hoverCell.rowIndex===o||[`checkbox-disabled`,`checkbox-check`].includes(h))&&v.setVisible(!0);let e=this.rowIndex,t=this.rowIndex,n=this.ctx.hoverCell,{yArr:r}=this.getSpanInfo();e=r[0],t=r[1],n&&n.rowIndex>=e&&n.rowIndex<=t&&v.setVisible(!0)}this.setImage(`selection`,v)}updateHoverIcon(){if(this.ctx.database.getReadonly(this.rowKey,this.key))return;let{BODY_CELL_HOVER_ICON_METHOD:e,CELL_HOVER_ICON_SIZE:t,CELL_PADDING:n,ENABLE_MERGE_CELL_LINK:r}=this.ctx.config;if(typeof e==`function`){let t=e({row:this.row,rowIndex:this.rowIndex,colIndex:this.colIndex,column:this.column,value:this.getValue()});t!==void 0&&(this.hoverIconName=t)}let{hoverCell:i}=this.ctx;if(this.hoverIconName&&!this.ctx.editing&&!this.ctx.dragRowIng&&i){let e=0,a=0;if(i.rowKey===this.rowKey&&(e=this.drawX+this.width-t-n,a=this.drawY+(this.height-t)/2),this.rowspan!==1&&r){let r=this.getSpanInfo(),{yArr:o}=r,s=o[0],c=o[1];if(i.rowIndex>=s&&i.rowIndex<=c){let{width:i,height:o,offsetTop:s,offsetLeft:c}=r;e=this.drawX-c+i-t-n,a=this.drawY-s+(o-t)/2}}let o=this.ctx.icons.get(this.hoverIconName),s=new q(this.hoverIconName,e,a,t,t,o);(this.rowspan===0||this.colspan===0)&&s.setVisible(!1),this.setImage(`hover`,s)}}getAutoHeight(){if(this.cellType!==`body`||!this.autoRowHeight||this.rowspan===0)return 0;if(this.render){let e=this.ctx.database.getOverlayerAutoHeight(this.rowIndex,this.colIndex);return this.rowspan>1?e<this.visibleHeight?0:Math.round(e-(this.visibleHeight-this.height)):Math.round(e)}if(!(this.displayText&&typeof this.displayText==`string`))return 0;let{BODY_FONT:e,CELL_PADDING:t,CELL_LINE_HEIGHT:n}=this.ctx.config,r=`${this.displayText}_${this.drawTextWidth}_${this.drawTextFont}`,i=this.ctx.paint.calculateTextHeight(this.displayText,this.drawTextWidth,{font:this.drawTextFont||e,padding:t,align:this.align,verticalAlign:this.verticalAlign,color:this.drawTextColor,autoRowHeight:this.autoRowHeight,lineHeight:n,maxLineClamp:this.maxLineClamp,cacheTextKey:r});return this.rowspan>1?i<this.visibleHeight?0:Math.round(i-(this.visibleHeight-this.height)):Math.round(i)}getSpanInfo(){return this.ctx.database.getSpanInfo(this)}getDisplayText(e=this.text){if(this.cellType===`footer`)return this.renderFooter&&this.renderFooterType==="default"||e==null?``:`${e}`;{if(this.rowspan===0||this.colspan===0||this.render&&this.renderType==="default"&&!this.mixedRender)return``;let t=this.getImage(`selection`);return this.type===`index-selection`&&t&&t.visible||e==null?``:`${e}`}}getText(){if(this.cellType===`footer`)return typeof this.formatterFooter==`function`?this.formatterFooter({row:this.row,rowIndex:this.rowIndex,colIndex:this.colIndex,column:this.column,value:this.row[this.key]}):this.row[this.key];if(typeof this.formatter==`function`)return this.formatter({row:this.row,rowIndex:this.rowIndex,colIndex:this.colIndex,column:this.column,value:this.getValue()});let{BODY_CELL_FORMATTER_METHOD:e}=this.ctx.config;return typeof e==`function`?e({row:this.row,rowIndex:this.rowIndex,colIndex:this.colIndex,column:this.column,value:this.getValue()}):[`index-selection`,`index`].includes(this.type)?`${this.rowIndex+1}`:(this.value=this.ctx.database.getItemValue(this.rowKey,this.key),this.value)}getFinderText(){let e=this.getDisplayText(this.getText()),t=this.cellType===`footer`?this.formatterFinderFooterValue:this.formatterFinderValue;if(typeof t!=`function`)return e;let n=t({row:this.row,rowIndex:this.rowIndex,colIndex:this.colIndex,column:this.column,value:this.cellType===`footer`?this.row[this.key]:this.getValue(),displayText:e});return n==null?e:`${n}`}getValue(){return this.ctx.database.getItemValue(this.rowKey,this.key)}setValue(e){this.ctx.setItemValueByEditor(this.rowKey,this.key,e)}getOverlayerViewsStyle(){let e=this.drawX-this.ctx.fixedLeftWidth,t=this.drawY-this.ctx.body.y;if(this.fixed===`left`?e=this.drawX:this.fixed===`right`&&(e=this.drawX-(this.ctx.stageWidth-this.ctx.fixedRightWidth)),this.cellType===`footer`&&this.ctx.config.FOOTER_FIXED&&(t=this.drawY-this.ctx.footer.y),this.autoRowHeight&&this.render&&this.verticalAlign===`middle`){let e=this.ctx.database.getOverlayerAutoHeight(this.rowIndex,this.colIndex);if(e<this.visibleHeight&&e>0){let n=(this.visibleHeight-e)/2;t+=n}}this.autoRowHeight&&this.ctx.database.getOverlayerAutoHeight(this.rowIndex,this.colIndex)===0&&(e=-99999,t=-99999);let n={};return this.rowspan===0&&(n={display:`none`}),{position:`absolute`,overflow:`hidden`,left:`${Math.round(e-1)}px`,top:`${Math.round(t-1)}px`,width:`${this.visibleWidth}px`,height:this.autoRowHeight&&this.renderType==="default"?`auto`:`${this.visibleHeight}px`,pointerEvents:`initial`,userSelect:`none`,...n}}drawContainer(){let{paint:e,config:t}=this.ctx,{BORDER:n}=t,{drawX:r,drawY:i}=this,a=k(n)?t.BORDER_COLOR:void 0;e.drawRect(r,i,this.visibleWidth,this.visibleHeight,{borderColor:a,fillColor:this.drawCellBgColor}),e.drawRect(r,i,this.width,this.height,{fillColor:this.drawCellSkyBgColor})}drawHorizontalBorder(){let{config:e}=this.ctx,{BORDER:t}=e;if(!A(t)||this.cellType!==`footer`&&k(t))return;let{drawX:n,drawY:r}=this,i=e.BORDER_COLOR;this.ctx.paint.drawLine([n,r+this.visibleHeight,n+this.visibleWidth,r+this.visibleHeight],{borderColor:i,fillColor:i,borderWidth:1,lineCap:`round`,lineJoin:`round`})}drawAutofillPiont(){if(this.cellType===`footer`)return;let{SELECT_BORDER_COLOR:e,ENABLE_AUTOFILL:t,ENABLE_SELECTOR:n,AUTOFILL_POINT_BORDER_COLOR:r}=this.ctx.config;if(!n||!t||this.ctx.editing)return;let{xArr:i,yArr:a}=this.ctx.selector,o=i[1],s=a[1],{colIndex:c,rowIndex:l,drawX:u,drawY:d}=this;if(c===o&&l===s){let t=c===this.ctx.maxColIndex||l===this.ctx.maxRowIndex||c===this.ctx.lastCenterColIndex?6:4;this.ctx.paint.drawRect(u+this.width-t,d+this.height-t,6,6,{borderColor:r,fillColor:e})}}draw(){this.drawTreeLine(),this.drawText(),this.drawImage(),this.drawSelector(),this.drawAutofillPiont(),this.drawErrorTip()}getWidthByColIndexColSpan(e,t){if(t===0)return 0;let n=0;for(let r=e;r<e+t;r++){let e=this.ctx.header.leafCellHeaders[r];n+=e.width}return n}drawText(){let{CELL_PADDING:e,BODY_FONT:t,PLACEHOLDER_COLOR:n,CELL_LINE_HEIGHT:r}=this.ctx.config,{placeholder:i}=this.column,a=this.displayText,o=this.drawTextColor;if(!this.ctx.database.getReadonly(this.rowKey,this.key)&&i&&[``,null,void 0].includes(this.text)&&this.cellType===`body`&&this.rowspan!==0&&this.colspan!==0&&(a=i,o=n),[``,null,void 0].includes(a))return!1;typeof a!=`string`&&(a=`${a}`);let s=`${a}_${this.drawTextWidth}_${this.drawTextFont}`;return this.ellipsis=this.ctx.paint.drawText(a,this.drawTextX,this.drawTextY,this.drawTextWidth,this.drawTextHeight,{font:this.drawTextFont||t,padding:e,align:this.align,verticalAlign:this.verticalAlign,color:o,autoRowHeight:this.autoRowHeight,lineHeight:r,maxLineClamp:this.maxLineClamp,cacheTextKey:s,layoutCallback:e=>{this.ctx.emit(`registerTextLayout`,`${this.cellType}-${this.rowIndex}-${this.colIndex}`,e)}}),this.ellipsis}drawImage(){this.getImages().forEach((e,t)=>{if(e.visible&&e.source){if(t===`hover`){let{CELL_HOVER_ICON_BG_COLOR:t,CELL_HOVER_ICON_BORDER_COLOR:n}=this.ctx.config;e.drawWrapper(this.ctx,{borderColor:n,fillColor:t})}this.ctx.paint.drawImage(e.source,e.x,e.y,e.width,e.height)}})}drawSelector(){if(this.cellType===`footer`)return;let{ENABLE_SELECTOR:e}=this.ctx.config;if(!e)return;let{xArr:t,yArr:n,xArrCopy:r,yArrCopy:i}=this.ctx.selector;this.drawBorder({xArr:r,yArr:i,borderColor:this.ctx.config.SELECT_BORDER_COLOR||`rgb(82,146,247)`,fillColor:`transparent`,borderWidth:1,lineDash:[4,4]}),this.drawBorder({xArr:this.ctx.autofill.xArr,yArr:this.ctx.autofill.yArr,borderColor:this.ctx.config.SELECT_BORDER_COLOR||`rgb(82,146,247)`,fillColor:`transparent`,borderWidth:1,lineDash:[4,4]}),this.drawBorder({xArr:t,yArr:n,borderColor:this.ctx.config.SELECT_BORDER_COLOR||`rgb(82,146,247)`,fillColor:`transparent`,borderWidth:1});let[a,o]=t,[s,c]=n;(a!==o||s!==c)&&this.colIndex>=a&&this.colIndex<=o&&this.rowIndex>=s&&this.rowIndex<=c&&this.ctx.paint.drawRect(this.drawX,this.drawY,this.width,this.height,{borderColor:`transparent`,fillColor:this.ctx.config.SELECT_AREA_COLOR||`rgba(82,146,247,0.1)`}),this.operation&&this.rowIndex>=s&&this.rowIndex<=c&&this.ctx.paint.drawRect(this.drawX,this.drawY,this.visibleWidth,this.visibleHeight,{borderColor:`transparent`,fillColor:this.ctx.config.SELECT_ROW_COL_BG_COLOR||`transparent`})}drawErrorTip(){if(this.cellType===`footer`||!this.message||this.rowspan===0||this.colspan===0)return;let{ERROR_TIP_ICON_SIZE:e,ERROR_TIP_COLOR:t}=this.ctx.config,{width:n}=this,r=this.drawX,i=this.drawY,a=[r+n-e-.5,i,r+n-.5,i,r+n-.5,i+e];this.ctx.paint.drawLine(a,{borderColor:t,fillColor:t,borderWidth:1,lineCap:`round`,lineJoin:`round`})}drawBorder(e){let{drawX:t,drawY:n,rowIndex:r,colIndex:i,height:a,width:o}=this,s=t,c=n,{xArr:l,yArr:u,lineDash:d=[],borderWidth:f=1,borderColor:p,fillColor:m}=e,h=l[0],g=l[1],_=u[0],v=u[1];if(i>=h&&i<=g&&r===_){let e=+(i===g),t=+(i===h);this.ctx.paint.drawLine([s+t,c+1,s+o-e,c+1],{borderColor:p,fillColor:m,borderWidth:f,lineCap:`round`,lineJoin:`round`,lineDash:d})}if(i===g&&r>=_&&r<=v){let e=+(r===_),t=+(r===v);this.ctx.paint.drawLine([s+o-1,c+e,s+o-1,c+a-t],{borderColor:p,fillColor:m,borderWidth:f,lineCap:`round`,lineJoin:`round`,lineDash:d})}if(i>=h&&i<=g&&r===v){let e=+(i===g),t=+(i===h);this.ctx.paint.drawLine([s+t,c+a-1,s+o-e,c+a-1],{borderColor:p,fillColor:m,borderWidth:f,lineCap:`round`,lineJoin:`round`,lineDash:d})}if(i===h&&r>=_&&r<=v){let e=+(r===v),t=+(r===_);this.ctx.paint.drawLine([s+1,c+t,s+1,c+a-e],{borderColor:p,fillColor:m,borderWidth:f,lineCap:`round`,lineJoin:`round`,lineDash:d})}}},pt=class{constructor(e,t){K(this,`ctx`),K(this,`data`),K(this,`columns`),K(this,`footerData`,[]),K(this,`rowKeyMap`,/* @__PURE__ */ new Map),K(this,`colIndexKeyMap`,/* @__PURE__ */ new Map),K(this,`headerMap`,/* @__PURE__ */ new Map),K(this,`rowIndexRowKeyMap`,/* @__PURE__ */ new Map),K(this,`rowKeyRowIndexMap`,/* @__PURE__ */ new Map),K(this,`checkboxKeyMap`,/* @__PURE__ */ new Map),K(this,`selectionMap`,/* @__PURE__ */ new Map),K(this,`expandMap`,/* @__PURE__ */ new Map),K(this,`originalDataMap`,/* @__PURE__ */ new Map),K(this,`changedDataMap`,/* @__PURE__ */ new Map),K(this,`validationErrorMap`,/* @__PURE__ */ new Map),K(this,`itemRowKeyMap`,/* @__PURE__ */ new WeakMap),K(this,`bufferData`,[]),K(this,`customHeader`,{fixedData:{},sortData:{},hideData:{},resizableData:{}}),K(this,`overlayerAutoHeightMap`,/* @__PURE__ */ new Map),K(this,`maxRowHeightCellMap`,/* @__PURE__ */ new Map),K(this,`bufferCheckState`,{buffer:!1,check:!1,indeterminate:!1,selectable:!0}),K(this,`sumHeight`,0),K(this,`filterMethod`),K(this,`positions`,[]),K(this,`sortState`,/* @__PURE__ */ new Map),this.ctx=e;let{data:n=[],columns:r=[],footerData:i=[]}=t;this.data=n,this.footerData=i,this.columns=r,this.init()}init(e=!0){this.ctx.paint.clearTextCache(),this.clearBufferData(),this.rowKeyMap.clear(),this.checkboxKeyMap.clear(),this.colIndexKeyMap.clear(),this.rowIndexRowKeyMap.clear(),this.rowKeyRowIndexMap.clear(),this.maxRowHeightCellMap.clear();let t=o(this.getColumns());if(this.ctx.hasSelection=t.some(e=>e.type===`selection`),this.ctx.hasTree=t.some(e=>e.type?.includes(`tree`)),e){this.originalDataMap.clear(),this.changedDataMap.clear(),this.validationErrorMap.clear();let{ROW_KEY:e}=this.ctx.config;e?(this.ctx.hasSelection||this.selectionMap.clear(),this.ctx.hasTree||this.expandMap.clear()):(this.selectionMap.clear(),this.expandMap.clear())}this.itemRowKeyMap=/* @__PURE__ */ new WeakMap,this.initData(this.data),this.getData(),this.bufferCheckState.buffer=!1}clearBufferData(){this.bufferData=[]}resolveRowKey(e,n=``){let r;return typeof n==`function`?r=n(e):n&&(r=e[n]),r==null?t():String(r)}initData(e,t=0,n=[]){let r=e.length,{ROW_KEY:i=``,DEFAULT_EXPAND_ALL:a,CELL_HEIGHT:o,SELECTABLE_METHOD:s,CHECKBOX_KEY:c,TREE_CHILDREN_KEY:l}=this.ctx.config;e.forEach((e,u)=>{l!==`children`&&(e.children=e[l]);let d=this.resolveRowKey(e,i);this.itemRowKeyMap.set(e,d);let f=e._height||o,p=e._readonly,m=!0;if(typeof s==`function`&&(m=s),c){let t=e[c];if(this.checkboxKeyMap.has(t)){let e=this.checkboxKeyMap.get(t)||[];e.push(d),this.checkboxKeyMap.set(t,e)}else this.checkboxKeyMap.set(t,[d])}this.selectionMap.set(d,{key:c?e[c]:d,row:e,check:this.selectionMap.get(d)?.check||!1});let h=a||this.expandMap.get(d)||e._expand||!1;this.expandMap.set(d,h),this.rowKeyMap.set(d,{readonly:p,index:u,rowIndex:u,level:t,height:f,calculatedHeight:-1,check:!1,selectable:m,expand:h,expandLazy:!1,hasChildren:e._hasChildren||(Array.isArray(e.children)?e.children.length>0:!1),expandLoading:!1,item:e,parentRowKeys:n,parentRowKey:n[n.length-1]||``,isLastChild:u===r-1}),Array.isArray(e.children)&&e.children.length&&this.initData(e.children,t+1,[...n,d])})}setRowHeight(e,t){let n=this.rowIndexRowKeyMap.get(e);if(n===void 0)return;let r=this.rowKeyMap.get(n);r.height=t,r.item._height=t,this.clearBufferData()}setBatchRowHeight(e){e.forEach(({rowIndex:e,height:t})=>{let n=this.rowIndexRowKeyMap.get(e);if(n){let e=this.rowKeyMap.get(n);e.height=t,e.item._height=t}}),this.clearBufferData()}setBatchCalculatedRowHeight(e){return!e.every(({height:e,rowIndex:t})=>this.getPositionForRowIndex(t).calculatedHeight===e)&&(e.forEach(({rowIndex:e,height:t})=>{let n=this.rowIndexRowKeyMap.get(e);if(n){let e=this.rowKeyMap.get(n),{height:r=-1}=this.getMaxRowHeightItem(n)||{};e.calculatedHeight=Math.max(t,r)}}),this.clearBufferData(),this.getData(),!0)}getAllRowsData(){let e=[],t=n=>{n.forEach(n=>{e.push(n),Array.isArray(n.children)&&t(n.children)})};return t(this.data),e}generateColumns(e){let t=e=>e.map(e=>{let n=e.children&&Array.isArray(e.children)?t(e.children):void 0,r={hide:this.customHeader?.hideData?.[e.key],fixed:this.customHeader?.fixedData?.[e.key],sort:this.customHeader?.sortData?.[e.key],width:this.customHeader?.resizableData?.[e.key]},i={};for(let[e,t]of Object.entries(r))t!==void 0&&(i[e]=t);let a=n&&n.every(e=>e.hide);return{...e,children:n,hide:a||(typeof e.hide==`function`?e.hide(e):e.hide),...i}});return t(e)}getColumns(){return this.generateColumns(this.columns)}setColumns(e){this.columns=e,this.clearBufferData()}setData(e){this.data=e,this.init()}getOriginalData(){return this.data}getData(){if(this.bufferData.length>0)return{data:this.bufferData,sumHeight:this.sumHeight,positions:this.positions};let e=[],t=0;this.sumHeight=0,this.positions=[];let n=r=>{r?.forEach(r=>{e.push(r);let i=this.itemRowKeyMap.get(r),{expand:a,hasChildren:o,height:s,calculatedHeight:c}=this.rowKeyMap.get(i),l=this.sumHeight,u=Math.max(c,s);this.sumHeight+=u,this.rowIndexRowKeyMap.set(t,i),this.rowKeyRowIndexMap.set(i,t),this.positions.push({top:l,height:u,bottom:this.sumHeight,calculatedHeight:c}),t+=1,a&&o&&n(r.children)})};this.rowIndexRowKeyMap.clear(),this.rowKeyRowIndexMap.clear();let r=this.data;if(typeof this.filterMethod==`function`&&(r=this.filterMethod(r)),this.sortState.size){let e=Array.from(this.sortState.entries()).sort((e,t)=>e[1].timestamp-t[1].timestamp);r=this.sortDataRecursive(r,e)}return n(r),this.bufferData=e,{data:e,sumHeight:this.sumHeight,positions:this.positions}}setFooterData(e){this.footerData=e}getFooterData(){return this.footerData}setFilterMethod(e){this.filterMethod=e}clearFilterMethod(){this.filterMethod=void 0}getSortState(e){return this.sortState.get(e)||{direction:`none`,timestamp:0}}setSortState(e,t){let n=Date.now();this.ctx.config.SORT_STRICTLY&&this.sortState.clear(),t===`none`?this.sortState.delete(e):this.sortState.set(e,{direction:t,timestamp:n}),this.ctx.emit(`sortChange`,this.sortState),this.clearBufferData(),this.ctx.emit(`draw`)}clearSort(){this.sortState.clear(),this.ctx.emit(`sortChange`,this.sortState),this.clearBufferData(),this.ctx.emit(`draw`)}sortDataRecursive(e,t){let n=[...e];for(let[e,{direction:r}]of t){if(r===`none`)continue;let t=this.getColumnByKey(e);!t||!t.column.sortBy||(n=this.applySingleColumnSort(n,e,r,t.column.sortBy))}return n.map(e=>(e.children&&Array.isArray(e.children)&&(e.children=this.sortDataRecursive(e.children,t)),e))}applySingleColumnSort(e,t,n,r){return e.sort((e,i)=>{let a=e[t],o=i[t],s=0;if(typeof r==`function`)s=r(e,i);else if(r===`number`)s=(Number(a)||0)-(Number(o)||0);else if(r===`string`){let e=String(a||``),t=String(o||``);s=e.localeCompare(t)}else r===`date`&&(s=g(a,o));return n===`asc`?s:-s})}expandItem(e,t=!1){let n=this.rowKeyMap.get(e);n.expand=t,this.expandMap.set(e,t),this.clearBufferData(),this.ctx.emit(`draw`)}setExpandRowKeys(e,t=!0){this.expandMap.clear(),e.forEach(e=>{let n=this.rowKeyMap.get(e);this.expandMap.set(e,t),n.expand=t}),this.clearBufferData(),this.ctx.emit(`draw`)}getExpandRowKeys(){let e=[];return this.rowKeyMap.forEach((t,n)=>{t.expand&&e.push(n)}),e}expandAll(e){this.expandMap.clear(),this.rowKeyMap.forEach((t,n)=>{t.expand=e,this.expandMap.set(n,e)}),this.clearBufferData(),this.ctx.emit(`draw`)}expandLoading(e,t=!1){let n=this.rowKeyMap.get(e);n.expandLoading=t,this.clearBufferData(),this.ctx.emit(`draw`)}setExpandChildren(e,t){let n=this.rowKeyMap.get(e);n.expand=!0,this.expandMap.set(e,!0),n.expandLazy=!0,n.item.children=t,this.initData(n.item.children,n.level+1),this.clearBufferData()}getIsExpandLoading(e){return this.rowKeyMap.get(e).expandLoading}getIsExpandLazy(e){return this.rowKeyMap.get(e).expandLazy}getIsExpand(e){return this.rowKeyMap.get(e).expand}getRowForRowKey(e){return this.rowKeyMap.get(e)}getRowForRowIndex(e){let t=this.getRowKeyForRowIndex(e);return this.rowKeyMap.get(t)}getRowKeyForRowIndex(e){return this.rowIndexRowKeyMap.get(e)||``}getRowKeyByItem(e){return this.itemRowKeyMap.get(e)}getRowIndexForRowKey(e){return this.rowKeyRowIndexMap.get(e)}getItemValueForRowIndexAndColIndex(e,t){if(!(this.rowIndexRowKeyMap.has(e)&&this.colIndexKeyMap.get(t)))return null;let n=this.rowIndexRowKeyMap.get(e),r=this.colIndexKeyMap.get(t);return n===void 0||r===void 0?null:{rowKey:n,key:r,value:this.getItemValue(n,r)}}getItemValue(e,t){let n=this.rowKeyMap.get(e);return n&&n.item?n.item[t]===void 0?null:n.item[t]:null}async batchSetItemValue(e,t=!1,n=!0,r=`none`){let i=[],a=n,o=/* @__PURE__ */ new Map,s=[],c=[];for(let t of e){let{rowKey:e,key:n}=t,r=t.value,i=this.getRowDataItemForRowKey(e),a=this.getItemValue(e,n),o=this.getVirtualBodyCellByKey(e,n),l={...t,oldValue:a,row:i};if(o?.type===`number`){if([``,void 0,null].includes(r))r=null;else if(/^-?\d+(\.\d+)?$/.test(String(r))){let e=_(r);if(typeof o.precision==`number`&&o.precision>=0&&e>o.precision){let e=10**o.precision;r=Math.round(Number(r)*e)/e;let t=this.ctx.locale.getText(`numberTruncated`,{precision:o.precision});s.push({...l,column:o?.column,code:`ERR_NUMBER_PRECISION`,message:t})}else r=Number(r);if(typeof o.min==`number`&&Number(r)<o.min){let e=this.ctx.locale.getText(`numberMin`,{min:o.min});r=o.min,s.push({...l,column:o?.column,code:`ERR_NUMBER_MIN`,message:e})}else if(typeof o.max==`number`&&Number(r)>o.max){let e=this.ctx.locale.getText(`numberMax`,{max:o.max});r=o.max,s.push({...l,column:o?.column,code:`ERR_NUMBER_MAX`,message:e})}}else r=a,s.push({...l,column:o?.column,code:`ERR_INVALID_NUMBER`,message:this.ctx.locale.getText(`invalidNumber`)})}else if(o?.editorType===`text`&&typeof o.maxlength==`number`&&String(r).length>o.maxlength){r=String(r).slice(0,o.maxlength);let e=this.ctx.locale.getText(`stringMaxlength`,{maxlength:o.maxlength});s.push({...l,column:o?.column,code:`ERR_STRING_MAXLENGTH`,message:e})}typeof o?.column?.canValueChange==`function`&&(await o.column.canValueChange({...l,value:r})||(r=a)),typeof o?.column?.beforeValueChange==`function`&&(r=(await o.column.beforeValueChange({...l,value:r})).value),r!==a&&c.push({...t,value:r,oldValue:a,row:i})}if(s.length){let e={code:`ERR_BATCH_SET_ITEM_VALUE`,message:this.ctx.locale.getText(`batchSetItemValueError`),data:s};this.ctx.emit(`error`,e)}if(!c.length)return;let{BEFORE_VALUE_CHANGE_METHOD:l}=this.ctx.config;r===`none`&&typeof l==`function`&&(c=await l(c),a=!1);let u=[];c.forEach(e=>{let{value:t,rowKey:n,key:r,row:s}=e,c=this.getItemValue(n,r);o.set(n,s),this.setItemValue(n,r,t,!1,!1,!1,a),u.push(this.getValidator(e.rowKey,e.key)),i.push({rowKey:n,key:r,oldValue:c,newValue:t})});let d=Array.from(o.values());await Promise.all(u),this.validationErrorMap.size===0&&this.changedDataMap.size>0&&this.ctx.emit(`validateChangedData`,this.getChangedData());let f=c.map(e=>{let t=!!this.getValidationError(e.rowKey,e.key).length,{rowKey:n,key:r}=e,i=this.getVirtualBodyCellByKey(n,r);return typeof i?.column?.valueChange==`function`&&i.column.valueChange({...e,errorTip:t}),{...e,errorTip:t}});this.ctx.emit(`change`,f,d),t&&this.ctx.history.pushState({changeList:i,scrollX:this.ctx.scrollX,scrollY:this.ctx.scrollY,type:`multiple`}),this.ctx.emit(`draw`)}async setItemValue(e,t,n,r=!1,i=!1,a=!1,o=!0){if(!this.rowKeyMap.has(e))return{};let{item:s}=this.rowKeyMap.get(e),c=s[t],l=n;if(o&&this.ctx.database.getReadonly(e,t))return{oldValue:c,newValue:c};s[t]!==null&&typeof s[t]==`object`&&(c=JSON.parse(JSON.stringify(s[t])));let u=`${e}​_${t}`;this.originalDataMap.has(u)||this.originalDataMap.set(u,c);let d=this.originalDataMap.get(u),f=this.getRowDataItemForRowKey(e),p={rowKey:e,key:t,value:l,oldValue:c,row:f};if(a){if(l===c)return{oldValue:c,newValue:c};this.batchSetItemValue([p],r,!1),this.ctx.emit(`editChange`,{...p,originalValue:d})}else this.changedDataMap.set(u,l),s[t]=l;return this.ctx.hasEvent(`iterationChange`)&&this.ctx.emit(`iterationChange`,{...p,originalValue:d}),i&&this.ctx.emit(`draw`),{oldValue:c,newValue:l}}getRowDataItemForRowKey(e){if(!this.rowKeyMap.has(e))return{};let{item:t}=this.rowKeyMap.get(e);return t}setRowSelectionByCheckboxKey(e,t){let{CHECKBOX_KEY:n}=this.ctx.config;if(n){if(!this.rowKeyMap.has(e))return!1;let{item:r}=this.rowKeyMap.get(e),i=r[n];this.checkboxKeyMap.has(i)&&(this.checkboxKeyMap.get(i)||[]).forEach(e=>{let n=this.selectionMap.get(e);n&&(n.check=t)})}}toggleRowSelection(e,t){let n=this.rowKeyMap.get(e),r=this.selectionMap.get(e);if(!r)return;t===`selection-tree`||t===`tree-selection`?this.toggleTreeSelection(e):(r.check=!r.check,this.setRowSelectionByCheckboxKey(e,r.check)),this.ctx.emit(`toggleRowSelection`,n);let i=this.getSelectionRows();this.ctx.emit(`selectionChange`,i),this.bufferCheckState.buffer=!1,this.ctx.emit(`draw`)}toggleTreeSelection(e){let t=this.getTreeSelectionState(e),n=this.ctx.config.TREE_SELECT_MODE;if(n===`auto`)t.checked&&!t.indeterminate?(this.clearTreeSelectionRecursive(e),this.setRowSelection(e,!1,!1)):(this.selectTreeSelectionRecursive(e),this.setRowSelection(e,!0,!1));else if(n===`cautious`)t.checked&&!t.indeterminate?(this.clearTreeSelectionRecursive(e),this.setRowSelection(e,!1,!1)):(this.selectTreeSelectionRecursive(e),this.setRowSelection(e,!0,!1));else if(n===`strictly`){let t=this.selectionMap.get(e);t&&(t.check=!t.check,this.setRowSelectionByCheckboxKey(e,t.check))}this.ctx.emit(`selectionChange`,this.getSelectionRows()),this.ctx.emit(`draw`)}selectTreeSelectionRecursive(e){this.getTreeChildren(e).forEach(e=>{this.setRowSelectionByParent(e,!0),this.selectTreeSelectionRecursive(e)})}clearTreeSelectionRecursive(e){this.getTreeChildren(e).forEach(e=>{this.setRowSelectionByParent(e,!1),this.clearTreeSelectionRecursive(e)})}updateParentTreeSelection(e){let t=this.getTreeParent(e);if(!t)return;let n=this.getTreeChildren(t).map(e=>this.selectionMap.get(e)),r=n.filter(e=>e?.check).length,i=n.length,a=!1;i>0&&(r===0?a=!1:r===i||this.ctx.config.TREE_SELECT_MODE===`auto`?a=!0:this.ctx.config.TREE_SELECT_MODE===`cautious`&&(a=!1));let o=this.selectionMap.get(t);o&&o.check!==a&&(o.check=a,this.setRowSelectionByCheckboxKey(t,a),this.updateParentTreeSelection(t))}setRowSelection(e,t,n=!0){let r=this.selectionMap.get(e);r&&(r.check=t,this.setRowSelectionByCheckboxKey(e,r.check),this.ctx.emit(`setRowSelection`,t,r.row),(this.ctx.config.TREE_SELECT_MODE===`auto`||this.ctx.config.TREE_SELECT_MODE===`cautious`)&&this.updateParentTreeSelection(e),n&&(this.bufferCheckState.buffer=!1,this.ctx.emit(`draw`)))}setRowSelectionByParent(e,t){let n=this.selectionMap.get(e);n&&(n.check=t,this.setRowSelectionByCheckboxKey(e,n.check))}getSelectionRows(){let e=[];return this.selectionMap.forEach(t=>{t.check&&e.push(t.row)}),e}getRowSelection(e){let t=this.selectionMap.get(e);return t?t.check:!1}getTreeSelectionState(e){if(!this.getRowForRowKey(e))return{checked:!1,indeterminate:!1};let t=this.selectionMap.get(e)?.check||!1;if(this.getTreeChildren(e).length===0)return{checked:t,indeterminate:!1};let n=!1,r=t;if(this.ctx.config.TREE_SELECT_MODE===`auto`){let i=e=>{let t=this.getTreeChildren(e),n=[];for(let e of t)n.push(e),n.push(...i(e));return n},a=i(e).map(e=>this.selectionMap.get(e)),o=a.filter(e=>e?.check).length,s=a.length,c=o>0;n=c&&o!==s,r=t||c,t&&s>0&&o===0&&(r=!1,n=!1)}else if(this.ctx.config.TREE_SELECT_MODE===`cautious`){let i=e=>{let t=this.getTreeChildren(e),n=[];for(let e of t)n.push(e),n.push(...i(e));return n},a=i(e).map(e=>this.selectionMap.get(e)),o=a.filter(e=>e?.check).length,s=a.length,c=o>0,l=o===s;n=c&&!l,r=t||l,t&&s>0&&o===0&&(r=!1,n=!1)}else this.ctx.config.TREE_SELECT_MODE===`strictly`&&(n=!1,r=t);return{checked:r,indeterminate:n}}getTreeChildren(e){let t=this.getRowForRowKey(e);if(!t||!t.item||!t.item.children)return[];let n=[],r=e=>{for(let t of e){let e=this.getRowKeyByItem(t);e&&n.push(e),t.children&&t.children.length>0&&r(t.children)}};return r(t.item.children),n}getTreeParent(e){let t=(e,n)=>{for(let r of e){let e=this.getRowKeyByItem(r);if(r.children)for(let i of r.children){if(this.getRowKeyByItem(i)===n)return e;let a=t(r.children,n);if(a)return a}}return null};return t(this.data,e)}getRowSelectable(e){let{selectable:t,item:n,rowIndex:r}=this.rowKeyMap.get(e);return typeof t==`function`?t({row:n,rowIndex:r}):t}toggleAllSelection(){this.ctx.config.TREE_SELECT_MODE===`auto`||this.ctx.config.TREE_SELECT_MODE===`cautious`?this.rowKeyMap.forEach((e,t)=>{let n=e.selectable;if(typeof n==`function`&&(n=n({row:e.item,rowIndex:e.rowIndex})),n){let e=this.selectionMap.get(t);e&&(e.check=!0,this.setRowSelectionByCheckboxKey(t,!0))}}):this.rowKeyMap.forEach((e,t)=>{let n=e.selectable;typeof n==`function`&&(n=n({row:e.item,rowIndex:e.rowIndex})),n&&this.setRowSelection(t,!0,!1)});let e=this.getSelectionRows();this.ctx.emit(`toggleAllSelection`,e),this.ctx.emit(`selectionChange`,e),this.bufferCheckState.buffer=!1,this.ctx.emit(`draw`)}clearSelection(e=!1){let t=this.ctx.config.TREE_SELECT_MODE===`auto`||this.ctx.config.TREE_SELECT_MODE===`cautious`;e?t?this.rowKeyMap.forEach((e,t)=>{let n=this.selectionMap.get(t);n&&(n.check=!1,this.setRowSelectionByCheckboxKey(t,!1))}):this.rowKeyMap.forEach((e,t)=>{this.setRowSelection(t,!1,!1)}):(this.selectionMap.clear(),this.rowKeyMap.forEach((e,t)=>{this.selectionMap.set(t,{check:!1,row:e.item,key:t})}));let n=this.getSelectionRows();this.ctx.emit(`clearSelection`),this.ctx.emit(`selectionChange`,n),this.bufferCheckState.buffer=!1,this.ctx.emit(`draw`)}getCheckedState(){let{buffer:e,...t}=this.bufferCheckState;if(e)return t;let n=this.rowKeyMap.size,r=0,i=0,a=this.selectionMap.size,o=Array.from(this.selectionMap.values()).some(e=>e.check);this.rowKeyMap.forEach((e,t)=>{var n;(n=this.selectionMap.get(t))!=null&&n.check&&(r+=1);let a=e.selectable;typeof a==`function`&&(a=a({row:e.item,rowIndex:e.rowIndex})),a&&(i+=1)});let s=i&&i>r&&r>0||a>n&&r===0&&o,c=i!==0,l=!!i&&i===r;return this.bufferCheckState={buffer:!0,check:l,indeterminate:s,selectable:c},{check:l,indeterminate:s,selectable:c}}updateColIndexKeyMap(e=[]){this.colIndexKeyMap.clear(),e.forEach(e=>{this.colIndexKeyMap.set(e.colIndex,e.key)})}getColumnByColIndex(e){let t=this.colIndexKeyMap.get(e);if(t&&this.headerMap.has(t))return this.headerMap.get(t)?.column}getColumnByKey(e){let t=this.headerMap.get(e);if(t)return t}getColIndexForKey(e){if(e&&this.headerMap.has(e))return this.headerMap.get(e)?.colIndex}getColHeaderByIndex(e){let t=this.colIndexKeyMap.get(e);if(t&&this.headerMap.has(t))return this.headerMap.get(t)}getChangedData(){let e=[];return this.changedDataMap.forEach((t,n)=>{let r=this.originalDataMap.get(n),i=n.split(`​_`)[0],a=n.split(`​_`)[1];r!==t&&e.push({rowKey:i,colKey:a,originalValue:r,row:this.ctx.database.getRowDataItemForRowKey(i),value:t})}),e}getChangedRows(){let e=/* @__PURE__ */ new Set;this.changedDataMap.forEach((t,n)=>{let r=this.originalDataMap.get(n),i=n.split(`​_`)[0];r!==t&&e.add(i)});let t=[];return e.forEach(e=>{t.push(this.ctx.database.getRowDataItemForRowKey(e))}),t}isHasChangedData(e,t){let n=`${e}​_${t}`;return this.changedDataMap.has(n)?this.originalDataMap.get(n)!==this.changedDataMap.get(n):!1}getPositionForRowIndex(e){return e<this.positions.length?this.positions[e]:{height:0,top:0,bottom:0,calculatedHeight:0}}setHeader(e,t){return e?(this.headerMap.set(e,t),!0):!1}getReadonly(e,t){let{DISABLED:n}=this.ctx.config;if(n)return!0;let r=this.rowKeyMap.get(e),i=this.headerMap.get(t);if(!r||!i)return!0;let a=r.readonly,o=i.readonly,{BODY_CELL_READONLY_METHOD:s}=this.ctx.config;if(typeof s==`function`&&i){let n=s({row:r.item,rowIndex:r.rowIndex,colIndex:i.colIndex,column:i.column,value:this.getItemValue(e,t)});if(n!==void 0)return n}if(typeof i.column?.readonly==`function`){let n=i.column.readonly({row:r.item,rowIndex:r.rowIndex,colIndex:i.colIndex,column:i.column,value:this.getItemValue(e,t)});if(n!==void 0)return n}return o||a}clearValidate(){this.validationErrorMap.clear()}hasValidationError(){return this.validationErrorMap.size!==0}getValidator(e,t){let n=this.ctx.database.getReadonly(e,t),{ENABLE_READONLY_VALIDATE:r}=this.ctx.config;return!r&&n?new Promise(e=>{e([])}):new Promise(n=>{let r=this.rowKeyMap.get(e),i=this.headerMap.get(t),{BODY_CELL_RULES_METHOD:a}=this.ctx.config;if(r===void 0||i===void 0)return n([]);let o=i.column,s=o.rules;if(typeof a==`function`){let n=a({row:r.item,rowIndex:r.rowIndex,colIndex:i.colIndex,column:o,value:this.getItemValue(e,t)});n&&(s=n)}if(s){let a={row:r.item,rowIndex:r.rowIndex,colIndex:i.colIndex,column:o,key:t,rowKey:e,value:this.getItemValue(e,t),field:t,fieldValue:this.getItemValue(e,t)},c=new st(s).validate(a);c.length?this.setValidationError(e,t,c):this.clearValidationError(e,t),n(c)}else this.clearValidationError(e,t),n([])})}getHeightByRowIndexRowSpan(e,t){let n=0;for(let r=0;r<t;r++){let t=this.positions[e+r];t&&(n+=t.height)}return n}getSpanInfo(e){let{rowIndex:t,key:n,rowKey:r,row:i,value:a,colIndex:o,relationRowKeys:s,relationColKeys:c,rowspan:l,height:u,width:d,colspan:f,mergeRow:p,mergeCol:m}=e;if(l===1&&f===1)return{xArr:[o,o],yArr:[t,t],rowspan:l,colspan:f,height:u,width:d,offsetTop:0,offsetLeft:0,dataList:[{rowKey:r,key:n,row:i,value:a}]};let h=t,g=t,_=o,v=o,y=[],b=0,x=0,S=0,C=0;if(l!==1&&p){C=d;let e=s.reduce((e,t)=>`${e}${this.getItemValue(r,t)??``}`,``);for(let n=t-1;n>=0;n--){let t=this.rowIndexRowKeyMap.get(n)||``;if(e===s.reduce((e,n)=>`${e}${this.getItemValue(t,n)??``}`,``))h=n;else break}for(let n=t;n<=this.ctx.maxRowIndex;n++){let t=this.rowIndexRowKeyMap.get(n)||``;if(e===s.reduce((e,n)=>`${e}${this.getItemValue(t,n)??``}`,``))g=n;else break}for(let e=h;e<t;e++){let{height:t}=this.positions[e];b+=t}for(let e=h;e<=g;e++){let{height:t}=this.positions[e];S+=t;let r=this.rowIndexRowKeyMap.get(e)||``,{item:i}=this.rowKeyMap.get(r),a=this.getItemValue(r,n);y.push({rowKey:r,key:n,value:a,row:i})}}if(f!==1&&m){S=u;for(let e=o-1;e>=0;e--){let t=this.getColumnByColIndex(e);if(!t)break;if(this.getItemValue(r,n)===this.getItemValue(r,t.key)&&c.includes(t.key))_=e;else break}for(let e=o;e<=this.ctx.maxColIndex;e++){let t=this.getColumnByColIndex(e);if(!t)break;if(this.getItemValue(r,n)===this.getItemValue(r,t.key)&&c.includes(t.key))v=e;else break}for(let e=_;e<o;e++){let t=this.getColumnByColIndex(e);if(!t)break;x+=t.width||100}for(let e=_;e<=v;e++){let t=this.getColumnByColIndex(e);if(!t)break;C+=t.width||100,y.push({rowKey:r,key:t.key,value:this.getItemValue(r,t.key),row:i})}}return{xArr:[_,v],yArr:[h,g],rowspan:l,colspan:f,height:S,width:C,offsetTop:b,offsetLeft:x,dataList:y}}setValidationErrorByRowKey(e,t,n){let r=`${e}​_${t}`,i=this.getRowForRowKey(e),a=i?.rowIndex,o=this.getColumnByKey(t);if(!e||!o||!i)return;let s=this.getItemValue(e,t),c=[{key:t,rowKey:e,rowIndex:a,colIndex:o.colIndex,column:o.column,row:i,value:s,message:n,field:t,fieldValue:s}];this.validationErrorMap.set(r,c)}setValidationError(e,t,n){let r=`${e}​_${t}`;this.validationErrorMap.set(r,n)}clearValidationError(e,t){let n=`${e}​_${t}`;this.validationErrorMap.has(n)&&this.validationErrorMap.delete(n)}getValidationError(e,t){let n=`${e}​_${t}`;return this.validationErrorMap.get(n)||[]}getVirtualBodyCell(e,t,n=!0){let r=this.getColumnByColIndex(t),i=this.getRowForRowIndex(e);return!r||!i?void 0:new ft(this.ctx,e,t,0,0,0,0,r,i.item,`body`,n)}getVirtualBodyCellByKey(e,t){let n=this.getRowIndexForRowKey(e),r=this.getColIndexForKey(t);if(n!==void 0&&r!==void 0)return this.getVirtualBodyCell(n,r)}hasMergeCell(e,t){let n=!1;for(let r=t[0];r<=t[1];r++)for(let t=e[0];t<=e[1];t++){let e=this.getVirtualBodyCell(r,t);if(e&&(e.rowspan!==1||e.colspan!==1)){n=!0;break}}return n}calculateMaxTreeDepth(e,t=0){let n=t;return e.forEach(e=>{if(Array.isArray(e.children)&&e.children.length>0){let r=this.calculateMaxTreeDepth(e.children,t+1);n=Math.max(n,r)}}),n}setOverlayerAutoHeightMap(e){this.overlayerAutoHeightMap=e}getOverlayerAutoHeightMap(){return this.overlayerAutoHeightMap}getOverlayerAutoHeight(e,t){let n=`${e}​_${t}`;return this.overlayerAutoHeightMap.get(n)||0}setCustomHeader(e,t=!1){if([`fixedData`,`sortData`,`hideData`,`resizableData`].forEach(t=>{let n=e[t];n!==void 0&&(this.customHeader[t]=n)}),!t){let e=this.clearCustomHeaderInvalidValues(this.columns);this.ctx.emit(`customHeaderChange`,e)}}resetCustomHeader(){this.customHeader={},this.ctx.emit(`resetHeader`),this.ctx.emit(`customHeaderChange`,this.customHeader)}getCustomHeader(){return this.customHeader}setCustomHeaderResizableData(e,t){let{resizableData:n={}}=this.customHeader;n[e]=t,this.setCustomHeader({resizableData:n})}setCustomHeaderHideData(e,t){let{hideData:n={}}=this.customHeader;e.forEach(e=>{n[e]=t}),this.setCustomHeader({hideData:n}),this.ctx.emit(`resetHeader`)}setCustomHeaderFixedData(e,t){let{fixedData:n={}}=this.customHeader;e.forEach(e=>{n[e]=t}),this.setCustomHeader({fixedData:n}),this.ctx.emit(`resetHeader`)}clearCustomHeaderInvalidValues(e){let t=(e,n={})=>{e.forEach(e=>{e.children&&e.children.length>0&&t(e.children,n);let r=(t,r)=>{var i;let a=this.customHeader[t]?.[e.key];a!==void 0&&a!==r&&(n[t]||(n[t]={}),n[t][e.key]=a,t===`fixedData`&&!a&&!r&&((i=n[t])==null||delete i[e.key]))};r(`fixedData`,e.fixed),r(`sortData`,e.sort),r(`hideData`,e.hide),r(`resizableData`,e.width)})},n={};return t(e,n),n}setMaxRowHeightItem(e,t,n){this.maxRowHeightCellMap.set(e,{key:t,height:n})}getMaxRowHeightItem(e){return this.maxRowHeightCellMap.get(e)}clearChangeData(){this.changedDataMap.clear()}},mt=class{constructor(e){K(this,`ctx`),K(this,`history`,[]),K(this,`historyIndex`,-1),this.ctx=e,this.init()}init(){this.ctx.on(`keydown`,e=>{if(!this.ctx.editing){if(e.ctrlKey&&!e.shiftKey&&e.code===`KeyZ`||e.metaKey&&!e.shiftKey&&e.code===`KeyZ`){e.preventDefault(),this.ctx.clearSelector(),this.ctx.clearAutofill(),this.backState();return}if(e.ctrlKey&&e.code===`KeyY`||e.ctrlKey&&e.shiftKey&&e.code===`KeyZ`||e.metaKey&&e.shiftKey&&e.code===`KeyZ`){e.preventDefault(),this.ctx.clearSelector(),this.ctx.clearAutofill(),this.forwardState();return}}})}pushState(e){let{HISTORY_NUM:t=0,ENABLE_HISTORY:n}=this.ctx.config;n&&(this.history.push(e),this.history.length>t&&this.history.splice(0,1),this.historyIndex=this.history.length-1)}backState(){if(this.historyIndex>=0){let{changeList:e,scrollX:t,scrollY:n}=this.history[this.historyIndex],r=e.map(e=>({rowKey:e.rowKey,key:e.key,value:e.oldValue,row:{}}));this.ctx.setScroll(t,n),this.ctx.database.batchSetItemValue(r,!1,!1,`back`),--this.historyIndex}}forwardState(){if(this.historyIndex<this.history.length-1){this.historyIndex+=1;let{changeList:e}=this.history[this.historyIndex],t=e.map(e=>({rowKey:e.rowKey,key:e.key,value:e.newValue,row:{}}));this.ctx.database.batchSetItemValue(t,!1,!1,`forward`)}}clear(){this.history=[],this.historyIndex=-1}},ht=class{constructor(e){K(this,`eventTasks`,/* @__PURE__ */ new Set),K(this,`ctx`),this.ctx=e,this.init()}init(){this.bind(window,`resize`,this.handleResize.bind(this)),this.bind(window,`mouseup`,this.handleMouseUp.bind(this)),this.bind(window,`mousemove`,this.handleMousemove.bind(this)),this.bind(window,`blur`,this.handleOutsideMousedown.bind(this)),this.bind(window,`mousedown`,this.handleOutsideMousedown.bind(this)),this.bind(this.ctx.stageElement,`click`,this.handleClick.bind(this)),this.bind(window,`keydown`,this.handleKeydown.bind(this)),this.bind(this.ctx.stageElement,`wheel`,this.handleWheel.bind(this),{passive:!1}),this.bind(this.ctx.stageElement,`touchstart`,this.handleTouchstart.bind(this),{passive:!1}),this.bind(this.ctx.stageElement,`touchend`,this.handleTouchend.bind(this)),this.bind(this.ctx.stageElement,`touchmove`,this.handleTouchmove.bind(this),{passive:!1}),this.bind(this.ctx.stageElement,`contextmenu`,this.handleContextMenu.bind(this)),this.bind(this.ctx.stageElement,`mousedown`,this.handleMouseDown.bind(this)),this.bind(this.ctx.stageElement,`dblclick`,this.handleDblclick.bind(this)),this.bind(this.ctx.stageElement,`mouseover`,this.handleMouseover.bind(this)),this.bind(this.ctx.stageElement,`mouseout`,this.handleMouseout.bind(this)),this.bind(document,`selectionchange`,this.selectionchange.bind(this))}selectionchange(){this.ctx.domSelectionStr=``;let e=window.getSelection();e&&e.toString()&&(this.ctx.domSelectionStr=e.toString())}clearDomSelection(){let e=window.getSelection();e&&!e.isCollapsed&&e.removeAllRanges()}destroy(){Array.from(this.eventTasks).forEach(({target:e,name:t,fn:n,options:r})=>{this.unbind(e,t,n,r)}),this.eventTasks.clear()}handleResize(e){this.ctx.emit(`resetHeader`,e),this.ctx.emit(`resize`,e)}handleMouseDown(e){this.clearDomSelection(),e.button===0&&(this.ctx.mousedown=!0),this.ctx.emit(`mousedown`,e)}handleMousemove(e){let t=e,n=this.ctx.containerElement.getBoundingClientRect(),r=t.clientX-n.left,i=t.clientY-n.top;this.ctx.mouseX=r,this.ctx.mouseY=i,this.ctx.emit(`mousemove`,e)}handleMouseUp(e){e.button===0&&(this.ctx.mousedown=!1),this.ctx.emit(`mouseup`,e)}handleClick(e){this.ctx.emit(`click`,e)}handleKeydown(e){let{ENABLE_KEYBOARD:t}=this.ctx.config;t&&this.ctx.isTarget(e)&&(this.ctx.dragHeaderIng||this.ctx.emit(`keydown`,e))}handleWheel(e){this.ctx.emit(`wheel`,e)}handleTouchstart(e){this.ctx.emit(`touchstart`,e)}handleTouchend(e){this.ctx.emit(`touchend`,e)}handleTouchmove(e){this.ctx.emit(`touchmove`,e)}handleContextMenu(e){e.preventDefault(),this.ctx.emit(`contextMenu`,e)}handleMouseover(e){this.ctx.isMouseoverTargetContainer=!0,this.ctx.emit(`mouseover`,e)}handleMouseout(e){this.ctx.isMouseoverTargetContainer=!1,this.ctx.emit(`mouseout`,e)}handleDblclick(e){this.ctx.emit(`dblclick`,e)}handleOutsideMousedown(e){this.ctx.selector.enable&&(e.target instanceof Window||e.target instanceof Node&&!this.ctx.containerElement.contains(e.target))&&this.ctx.emit(`outsideMousedown`,e)}bind(e,t,n,r){e.addEventListener(t,n,r),this.eventTasks.add({target:e,name:t,fn:n,options:r})}unbind(e,t,n,r){e.removeEventListener(t,n,r);for(let r of this.eventTasks)if(r.target===e&&r.name===t&&r.fn===n){this.eventTasks.delete(r);break}}},gt=class{constructor(){K(this,`events`,/* @__PURE__ */ new Map)}has(e){return this.events.has(e)}on(e,t){let n=this.events.get(e)||[];n.push(t),this.events.set(e,n)}once(e,t){let n=(...r)=>{t(...r),this.off(e,n)};return this.on(e,n),this}off(e,t){let n=this.events.get(e);if(n){let r=n.indexOf(t);r>=0&&(n.splice(r,1),n.length===0?this.events.delete(e):this.events.set(e,n))}}emit(e,...t){let n=this.events.get(e);n&&n.forEach(e=>{e(...t)})}destroy(){this.events.clear()}},_t=class{constructor(e){K(this,`ctx`),K(this,`textCacheMap`,/* @__PURE__ */ new Map);let t=e.getContext(`2d`);if(!t)throw Error(`canvas context not found`);this.ctx=t}getCtx(){return this.ctx}clearTextCache(){this.textCacheMap.clear()}scale(e){this.ctx.setTransform(1,0,0,1,0,0),this.ctx.scale(e,e)}save(){this.ctx.save()}restore(){this.ctx.restore()}translate(e,t){this.ctx.translate(e,t)}setCursor(e=`default`){this.ctx.canvas.style.cursor=e}clear(e=0,t=0,n,r){this.ctx.clearRect(e,t,n||this.ctx.canvas.width,r||this.ctx.canvas.height)}drawShadow(e,t,n,r,i){let{fillColor:a,side:o,shadowWidth:s,colorStart:c,colorEnd:l}=i;if(this.ctx.save(),a&&(this.ctx.fillStyle=a,this.ctx.fillRect(e,t,n,r)),!Number.isFinite(s)||s<=0){this.ctx.restore();return}let u;switch(o){case`left`:u=this.ctx.createLinearGradient(e-s,t,e,t),u.addColorStop(0,c),u.addColorStop(1,l),this.ctx.fillStyle=u,this.ctx.fillRect(e-s,t,s,r);break;case`right`:u=this.ctx.createLinearGradient(e+n,t,e+n+s,t),u.addColorStop(0,c),u.addColorStop(1,l),this.ctx.fillStyle=u,this.ctx.fillRect(e+n,t,s,r);break;case`top`:u=this.ctx.createLinearGradient(e,t-s,e,t),u.addColorStop(0,c),u.addColorStop(1,l),this.ctx.fillStyle=u,this.ctx.fillRect(e,t-s,n,s);break;case`bottom`:u=this.ctx.createLinearGradient(e,t+r,e,t+r+s),u.addColorStop(0,c),u.addColorStop(1,l),this.ctx.fillStyle=u,this.ctx.fillRect(e,t+r,n,s);break;default:console.error(`Invalid side specified for shadow`)}this.ctx.restore()}drawLine(e,t){if(e.length<4||e.length%2!=0)throw Error(`A valid array of points is required to draw a line`);this.ctx.save();let{borderColor:n=`black`,borderWidth:r=1}=t;this.ctx.beginPath(),this.ctx.moveTo(e[0]-.5,e[1]-.5);for(let t=2;t<e.length;t+=2)this.ctx.lineTo(e[t]-.5,e[t+1]-.5);this.ctx.strokeStyle=n,this.ctx.lineWidth=r,t.lineDash&&(this.ctx.lineDashOffset=t.lineDashOffset??0,this.ctx.setLineDash(t.lineDash)),t.fillColor&&(this.ctx.fillStyle=t.fillColor,this.ctx.fill()),t.borderColor&&(this.ctx.strokeStyle=t.borderColor),this.ctx.stroke(),this.ctx.closePath(),this.ctx.restore()}drawImage(e,t,n,r,i){this.ctx.save(),this.ctx.drawImage(e,t,n,r,i),this.ctx.restore()}drawRect(e,t,n,r,{borderWidth:i=1,borderColor:a,fillColor:o,radius:s=0}={}){if(this.ctx.save(),o!==void 0&&(this.ctx.fillStyle=o),a!==void 0&&(this.ctx.lineWidth=i,this.ctx.strokeStyle=a),this.ctx.beginPath(),s===0)o!==void 0&&this.ctx.fillRect(e,t,n,r),this.ctx.rect(e-.5,t-.5,n,r);else{let[i,a,o,c]=typeof s==`number`?[s,s,s,s]:s;this.ctx.moveTo(e+i,t),this.ctx.arcTo(e+n,t,e+n,t+a,a),this.ctx.arcTo(e+n,t+r,e+n-o,t+r,o),this.ctx.arcTo(e,t+r,e,t+r-c,c),this.ctx.arcTo(e,t,e+i,t,i)}o!==void 0&&s!==0&&this.ctx.fill(),a!==void 0&&this.ctx.stroke(),this.ctx.restore()}drawText(e=``,t,n,r,i,a={}){this.ctx.save();let{font:o=`12px Arial`,align:s=`center`,color:c=`#495060`,padding:l=0,verticalAlign:u=`middle`,maxLineClamp:d=1,autoRowHeight:f=!1,offsetLeft:p=0,offsetRight:m=0}=a;if(this.ctx.font=o,this.ctx.fillStyle=c,[``,null,void 0].includes(e))return this.ctx.restore(),!1;let h=parseInt(o.match(/\d+/)?.[0]||`12`)*(a.lineHeight||1.2),g=this.buildTextLayout(e,t,n,r,i,{font:o,color:c,align:s,padding:l,verticalAlign:u,maxLineClamp:d,autoRowHeight:f,lineHeight:h,offsetLeft:p,offsetRight:m});if(this.ctx.textBaseline=`middle`,this.ctx.textAlign=`left`,g.lines.forEach(e=>{this.ctx.fillText(e.text,e.drawX,e.drawY+g.lineHeight/2)}),a.textCallback&&g.lines.length){let e=g.lines.reduce((e,t)=>Math.max(e,t.width),0),n=Math.round(e),i=g.lines[0]?.drawX??t+l+p,o=i+n;s===`center`?(i=t+r/2-n/2,o=t+r/2+n/2):s===`right`&&(i=t+r-l-m-n,o=t+r-l-m);let c={x:g.lines[0]?.drawX??i,y:g.contentY,width:n,height:g.lines.length*h,left:i,right:o,top:g.contentY,bottom:g.contentY+g.lines.length*h};a.textCallback(c)}return a.layoutCallback&&a.layoutCallback(g),this.ctx.restore(),g.ellipsis}buildTextLayout(e,t,n,r,i,a){let{font:o,color:s,align:c,padding:l,verticalAlign:u,maxLineClamp:d,autoRowHeight:f,lineHeight:p,offsetLeft:m,offsetRight:h}=a;this.ctx.save(),this.ctx.font=o;let g=r-l*2-m-h,_=g,v=i-l*2,y=Array.from(e),b=this.wrapTextToLines(e,g),x=Math.round(v/p),S=Math.min(b.length,Math.max(x,1));d===`auto`&&f?S=b.length:typeof d==`number`&&d<S&&d!==1?S=d:(d===1&&(b=[{items:y.map((e,t)=>({char:e,sourceIndex:t})),text:e,caretIndex:0,lineIndex:0,drawX:0,drawY:0,width:0,segments:[]}],S=1),d===`auto`&&x===1&&(b=[{items:y.map((e,t)=>({char:e,sourceIndex:t})),text:e,caretIndex:0,lineIndex:0,drawX:0,drawY:0,width:0,segments:[]}],S=1));let C=!1,w=b.slice(0,S);if(b.length>S){C=!0;let e=b.slice(S-1),t=this.buildEllipsisLine(e,r,l);t.lineIndex=S-1,w[S-1]=t}else if(S>0){let e=S-1,t=b.slice(e),n=t.map(e=>e.text).join(``),{ellipsis:i}=this.handleEllipsis(n,r,l,o);if(i){C=!0;let n=this.buildEllipsisLine(t,r,l);n.lineIndex=e,w[e]=n}}let T=w.length*p,E=n+l;u===`middle`?E=n+(i-T)/2:u===`bottom`&&(E=n+i-T-l);let D=[];return w.forEach((e,n)=>{e.lineIndex=n;let i=this.buildLineSegments(e),a=i.reduce((e,t)=>e+t.width,0),o=t+l+m;c===`center`?o=t+(r-a)/2:c===`right`&&(o=t+r-l-h-a);let s=E+n*p;e.drawX=o,e.drawY=s,e.width=a,e.segments=i,i.forEach(e=>{e.sourceIndex<0||D.push({char:e.char,index:e.sourceIndex,line:n,x:o+e.x,y:s,width:e.width,height:p})})}),this.ctx.restore(),{text:e,chars:y,glyphs:D,lines:w,box:{x:t,y:n,width:r,height:i},contentBox:{x:t+l+m,y:n+l,width:_,height:v},contentY:E,lineHeight:p,font:o,color:s,align:c,ellipsis:C}}wrapTextToLines(e,t){if(!e)return[{items:[],text:``,caretIndex:0,lineIndex:0,drawX:0,drawY:0,width:0,segments:[]}];let n=Array.from(e),r=[],i=[],a=0,o=0,s=e=>{let t=i.map(e=>e.char).join(``);r.push({items:i,text:t,caretIndex:o,lineIndex:r.length,drawX:0,drawY:0,width:0,segments:[]}),i=[],a=0,o=e};for(let e=0;e<n.length;e++){let r=n[e];if(r===`
4
+ `){s(e+1);continue}let o=this.ctx.measureText(r).width;a+o>t&&i.length>0?(s(i[i.length-1].sourceIndex+1),i.push({char:r,sourceIndex:e}),a=o):(i.push({char:r,sourceIndex:e}),a+=o)}return(i.length>0||r.length===0)&&s(n.length),r}buildEllipsisLine(e,t,n){let r=e.flatMap(e=>e.items),i=r.map(e=>e.char).join(``),{_text:a,ellipsis:o}=this.handleEllipsis(i,t,n,this.ctx.font),s=o?a.slice(0,-3):a,c=[];for(let e=0;e<s.length;e++){let t=r[e];if(!t)break;c.push({char:t.char,sourceIndex:t.sourceIndex})}return o&&c.push({char:`.`,sourceIndex:-1,ellipsis:!0},{char:`.`,sourceIndex:-1,ellipsis:!0},{char:`.`,sourceIndex:-1,ellipsis:!0}),{items:c,text:a,caretIndex:e[0]?.caretIndex??0,lineIndex:0,drawX:0,drawY:0,width:0,segments:[]}}buildLineSegments(e){let t=[],n=0;return e.items.forEach((e,r)=>{let i=this.ctx.measureText(e.char).width;t.push({char:e.char,itemIndex:r,sourceIndex:e.sourceIndex,x:n,width:i}),n+=i}),t}wrapText(e,t,n=``){if(!e)return[``];if(n&&this.textCacheMap.has(n))return this.textCacheMap.get(n)||[``];let r=[],i=e.split(`
5
+ `);for(let e of i){if(e===``){r.push(``);continue}let n=e.split(``),i=``;for(let e of n){let n=i+e;this.ctx.measureText(n).width<=t?i=n:i?(r.push(i),i=e):(r.push(e),i=``)}i&&r.push(i)}let a=r.length>0?r:[``];return n&&this.textCacheMap.set(n,a),a}calculateTextHeight(e=``,t,n={}){let{font:r=`12px Arial`,padding:i=0,align:a=`center`,color:o=`#495060`,maxLineClamp:s=1,cacheTextKey:c=``}=n;this.ctx.save(),this.ctx.font=r,this.ctx.fillStyle=o,this.ctx.textAlign=a;let l=parseInt(r.match(/\d+/)?.[0]||`12`),u=l*(n.lineHeight||1.2),d=t-i*2,f=this.wrapText(e,d,c),p=1;return p=s===`auto`?f.length:f.length>s?s:f.length,this.ctx.restore(),Math.max(Math.floor(p*u+i*2),Math.floor(l+i*2))}handleEllipsis(e,t,n=0,r=`12px Arial`){this.ctx.save();let i=!1,a=e;if(this.ctx.font=r,e==null||e===``)return this.ctx.restore(),{_text:``,ellipsis:i};let o=this.ctx.measureText(`...`).width;if(t<=o+n*2)return this.ctx.restore(),{_text:``,ellipsis:!0};let s=this.ctx.measureText(e).width,c=t-n*2;if(s&&s>=c){i=!0;let t=0;for(let n=0;n<e.length;n++)if(t+=this.ctx.measureText(e[n]).width,t>=c-o){a=e.slice(0,n)+`...`,i=!0;break}}return this.ctx.restore(),{_text:a,ellipsis:i}}},vt=class{constructor(e){K(this,`_config`,{}),K(this,`CSS_PREFIX`,`e-virt-table`),K(this,`ICONS`,[]),K(this,`ROW_KEY`,``),K(this,`DISABLED`,!1),K(this,`HEADER_FONT`,`12px normal Arial`),K(this,`BODY_FONT`,`12px normal Arial`),K(this,`BORDER`,!0),K(this,`STRIPE`,!1),K(this,`STRIPE_COLOR`,`#fafafa`),K(this,`BORDER_COLOR`,`#e1e6eb`),K(this,`FIXED_COLUMN_SHADOW_COLOR`,`rgba(0,0,0,0.1)`),K(this,`FIXED_COLUMN_SHADOW_FADE_COLOR`,`rgba(0,0,0,0)`),K(this,`FIXED_COLUMN_SHADOW_WIDTH`,4),K(this,`HEIGHT`,0),K(this,`PLACEHOLDER_COLOR`,`#CDD0DC`),K(this,`EMPTY_BODY_HEIGHT`,120),K(this,`EMPTY_CUSTOM_STYLE`,{}),K(this,`EMPTY_TEXT`,``),K(this,`LOADING_TEXT`,``),K(this,`MAX_HEIGHT`,1e3),K(this,`BORDER_RADIUS`,8),K(this,`ENABLE_OFFSET_HEIGHT`,!1),K(this,`OFFSET_HEIGHT`,0),K(this,`HEADER_HEIGHT`,36),K(this,`ENABLE_HEADER_STICKY`,!1),K(this,`HEADER_BG_COLOR`,`#F8FAFF`),K(this,`BODY_BG_COLOR`,`#FFF`),K(this,`HEADER_TEXT_COLOR`,`#1D2129`),K(this,`REQUIRED_COLOR`,`#F56C6C`),K(this,`BODY_TEXT_COLOR`,`#4E5969`),K(this,`FOOTER_TEXT_COLOR`,`#4E5969`),K(this,`LOADING_ICON_SVG`,``),K(this,`LOADING_ICON_COLOR`,`#4E5969`),K(this,`EXPAND_ICON_SVG`,``),K(this,`SHRINK_ICON_SVG`,``),K(this,`EXPAND_ICON_COLOR`,`#4E5969`),K(this,`SHRINK_ICON_COLOR`,`#4E5969`),K(this,`ERROR_TIP_ICON_COLOR`,`red`),K(this,`ERROR_TIP_ICON_SIZE`,6),K(this,`COLUMNS_ALIGN`,`left`),K(this,`COLUMNS_VERTICAL_ALIGN`,`middle`),K(this,`EXPAND_LAZY`,!0),K(this,`DEFAULT_EXPAND_ALL`,!1),K(this,`CELL_WIDTH`,100),K(this,`CELL_HEIGHT`,36),K(this,`CELL_PADDING`,8),K(this,`CELL_HOVER_ICON_SIZE`,14),K(this,`CELL_HOVER_ICON_BG_COLOR`,`#fff`),K(this,`CELL_HOVER_ICON_BORDER_COLOR`,`#DDE0EA`),K(this,`SCROLLER_TRACK_SIZE`,14),K(this,`scrollbarMode`,`outer`),K(this,`SCROLLBAR_SHOW_DELAY`,300),K(this,`SCROLLER_SIZE`,8),K(this,`SCROLLER_COLOR`,`#dee0e3`),K(this,`SCROLLER_TRACK_COLOR`,`#fff`),K(this,`SCROLLER_FOCUS_COLOR`,`#bbbec4`),K(this,`SELECT_BORDER_COLOR`,`rgb(82,146,247)`),K(this,`SELECT_AREA_COLOR`,`rgba(82,146,247,0.1)`),K(this,`SELECT_ROW_COL_BG_COLOR`,`transparent`),K(this,`AUTOFILL_POINT_BORDER_COLOR`,`#fff`),K(this,`EDIT_BG_COLOR`,`#fcf6ed`),K(this,`CHECKBOX_KEY`,``),K(this,`CHECKBOX_COLOR`,`rgb(82,146,247)`),K(this,`FINDER_CELL_BG_COLOR`,`rgb(255,229,144)`),K(this,`ENABLE_FINDER`,!0),K(this,`CHECKBOX_SIZE`,20),K(this,`CHECKBOX_DISABLED_SVG`,``),K(this,`CHECKBOX_DISABLED_COLOR`,`#F1F2F4`),K(this,`CHECKBOX_CHECK_SVG`,``),K(this,`CHECKBOX_UNCHECK_SVG`,``),K(this,`CHECKBOX_UNCHECK_COLOR`,`#DDE0EA`),K(this,`CHECKBOX_INDETERMINATE_SVG`,``),K(this,`CHECKBOX_CHECK_DISABLED_SVG`,``),K(this,`CHECKBOX_CHECK_DISABLED_COLOR`,`#DDE0EA`),K(this,`ICON_EDIT_SVG`,``),K(this,`ICON_EDIT_COLOR`,`#4E5969`),K(this,`ICON_SELECT_SVG`,``),K(this,`ICON_SELECT_COLOR`,`#4E5969`),K(this,`SORT_STRICTLY`,!0),K(this,`SORT_ASC_ICON_SVG`,``),K(this,`SORT_DESC_ICON_SVG`,``),K(this,`SORTABLE_ICON_SVG`,``),K(this,`SORT_ICON_COLOR`,`rgb(82,146,247)`),K(this,`READONLY_COLOR`,`#fff`),K(this,`READONLY_TEXT_COLOR`,`#4E5969`),K(this,`ENABLE_READONLY_VALIDATE`,!1),K(this,`ERROR_TIP_COLOR`,`#ED3F14`),K(this,`FOOTER_BG_COLOR`,`#fafafa`),K(this,`FOOTER_FIXED`,!0),K(this,`FOOTER_POSITION`,`bottom`),K(this,`CELL_FOOTER_HEIGHT`,36),K(this,`ENABLE_SELECTOR`,!0),K(this,`TREE_SELECT_MODE`,`auto`),K(this,`TREE_CHILDREN_KEY`,`children`),K(this,`TREE_INDENT`,20),K(this,`TREE_ICON_SIZE`,20),K(this,`TREE_LINE`,!1),K(this,`TREE_LINE_COLOR`,`#e1e6eb`),K(this,`ENABLE_EDIT_SINGLE_CLICK`,!1),K(this,`ENABLE_EDIT_CLICK_SELECTOR`,!0),K(this,`SELECTOR_AREA_MIN_X`,0),K(this,`SELECTOR_AREA_MAX_X_OFFSET`,0),K(this,`SELECTOR_AREA_MAX_X`,0),K(this,`SELECTOR_AREA_MIN_Y`,0),K(this,`SELECTOR_AREA_MAX_Y`,0),K(this,`SELECTOR_AREA_MAX_Y_OFFSET`,0),K(this,`SELECTOR_CELL_VALUE_TYPE`,`value`),K(this,`ENABLE_AUTO_THEME`,!0),K(this,`ENABLE_SELECTOR_SINGLE`,!1),K(this,`ENABLE_SELECTOR_SPAN_COL`,!0),K(this,`ENABLE_SELECTOR_SPAN_ROW`,!0),K(this,`ENABLE_SELECTOR_ALL_ROWS`,!0),K(this,`ENABLE_SELECTOR_ALL_COLS`,!0),K(this,`ENABLE_MERGE_CELL_LINK`,!1),K(this,`ENABLE_AUTOFILL`,!1),K(this,`ENABLE_AUTOFILL_SPAN_COL`,!0),K(this,`ENABLE_AUTOFILL_SPAN_ROW`,!0),K(this,`ENABLE_CONTEXT_MENU`,!1),K(this,`ENABLE_HEADER_CONTEXT_MENU`,!1),K(this,`ENABLE_TEXT_SELECTION`,!0),K(this,`ENABLE_COPY`,!0),K(this,`ENABLE_PASTER`,!0),K(this,`ENABLE_RESIZE_ROW`,!0),K(this,`ENABLE_RESIZE_COLUMN`,!0),K(this,`RESIZE_COLUMN_DIVIDER_COLOR`),K(this,`RESIZE_ROW_LINE_COLOR`,`#e1e6eb`),K(this,`RESIZE_COLUMN_LINE_COLOR`,`#e1e6eb`),K(this,`ENABLE_RESIZE_COLUMN_TEXT`,!0),K(this,`RESIZE_COLUMN_TEXT_COLOR`,`#fff`),K(this,`RESIZE_COLUMN_TEXT_BG_COLOR`,`rgb(82,146,247)`),K(this,`RESIZE_ROW_MIN_HEIGHT`,36),K(this,`RESIZE_COLUMN_MIN_WIDTH`,40),K(this,`DRAG_TIP_BG_COLOR`,`rgba(82,146,247,0.1)`),K(this,`DRAG_TIP_LINE_COLOR`,`rgb(82,146,247)`),K(this,`ENABLE_KEYBOARD`,!0),K(this,`ENABLE_HISTORY`,!1),K(this,`ENABLE_VALIDATOR_IMMEDIATE`,!0),K(this,`HISTORY_NUM`,50),K(this,`HIGHLIGHT_HOVER_ROW`,!1),K(this,`HIGHLIGHT_HOVER_ROW_COLOR`,`rgba(186,203,231,0.1)`),K(this,`HIGHLIGHT_SELECTED_ROW`,!1),K(this,`HIGHLIGHT_SELECTED_ROW_COLOR`,`rgba(82,146,247,0.1)`),K(this,`TOOLTIP_BG_COLOR`,`#303133`),K(this,`TOOLTIP_TEXT_COLOR`,`#fff`),K(this,`TOOLTIP_ZINDEX`,3e3),K(this,`TOOLTIP_CUSTOM_STYLE`,{}),K(this,`CONTEXT_MENU`,[{value:`copy`},{value:`cut`},{value:`paste`},{value:`clearSelected`}]),K(this,`CUSTOM_BODY_CONTEXT_MENU`,[]),K(this,`HEADER_CONTEXT_MENU`,[{value:`fixedLeft`},{value:`fixedRight`},{value:`fixedNone`},{value:`hide`},{value:`visible`},{value:`resetHeader`}]),K(this,`CUSTOM_HEADER_CONTEXT_MENU`,[]),K(this,`CELL_LINE_HEIGHT`,1.2),K(this,`AUTO_ROW_HEIGHT`,!1),K(this,`ENABLE_DRAG_COLUMN`,!1),K(this,`ENABLE_DRAG_ROW`,!1),K(this,`ENABLE_DRAG_ROW_CROSS_LEVEL`,!1),K(this,`ENABLE_DRAG_ROW_CUSTOM`,!1),K(this,`DRAG_ROW_TIP_LINE_COLOR`,`rgb(82,146,247)`),K(this,`DRAG_ROW_ICON_SVG`,``),K(this,`DRAG_ROW_ICON_SIZE`,18),K(this,`DRAG_ROW_ICON_COLOR`,`#bec4c7`),K(this,`HEADER_CELL_STYLE_METHOD`),K(this,`BODY_CELL_STYLE_METHOD`),K(this,`FOOTER_CELL_STYLE_METHOD`),K(this,`BODY_CELL_READONLY_METHOD`),K(this,`BODY_CELL_FORMATTER_METHOD`),K(this,`BODY_CELL_RULES_METHOD`),K(this,`BODY_CELL_TYPE_METHOD`),K(this,`BODY_CELL_EDITOR_METHOD`),K(this,`BODY_CELL_RENDER_METHOD`),K(this,`BODY_CELL_HOVER_ICON_METHOD`),K(this,`SPAN_METHOD`),K(this,`SELECTABLE_METHOD`),K(this,`EXPAND_LAZY_METHOD`),K(this,`BEFORE_VALUE_CHANGE_METHOD`),K(this,`BEFORE_PASTE_DATA_METHOD`),K(this,`BEFORE_AUTOFILL_DATA_METHOD`),K(this,`BEFORE_SET_SELECTOR_METHOD`),K(this,`BEFORE_SET_AUTOFILL_METHOD`),K(this,`BEFORE_HEADER_CONTEXT_MENU_METHOD`),K(this,`BEFORE_BODY_CONTEXT_MENU_METHOD`),K(this,`BEFORE_COPY_METHOD`),K(this,`BEFORE_DRAG_ROW_METHOD`),this._config=e,this.updateCssVar()}init(e){this._config=e,this.updateCssVar()}updateCssVar(){let e={};Object.keys(this).forEach(t=>{if(t.endsWith(`_COLOR`)||t.endsWith(`_FONT`)){let n=m(`--evt-${t.toLocaleLowerCase().replace(/_/g,`-`)}`);n&&(e[t]=n)}}),Object.assign(this,e,this._config)}},J=`<svg t="1724122015492" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4237" width="32" height="32"><path d="M401.472 316.992l159.04 217.664L591.488 512l-30.976-22.656-159.04 217.728q-2.24 3.008-3.84 6.464-1.6 3.456-2.496 7.104-0.896 3.648-1.024 7.424-0.192 3.84 0.384 7.552 0.64 3.712 1.92 7.296 1.28 3.52 3.2 6.784 1.984 3.2 4.544 6.016 2.56 2.752 5.632 4.992 3.072 2.24 6.464 3.84 3.456 1.6 7.168 2.496 3.648 0.896 7.424 1.024 3.776 0.192 7.488-0.448 3.776-0.576 7.296-1.856 3.584-1.28 6.784-3.264 3.2-1.92 6.016-4.48 2.816-2.56 5.056-5.632l159.04-217.728q3.584-4.928 5.504-10.752 1.92-5.76 1.92-11.904 0-6.08-1.92-11.904-1.92-5.76-5.504-10.752L463.488 271.68q-2.24-3.072-5.056-5.632-2.752-2.56-6.016-4.48-3.2-1.984-6.784-3.328-3.52-1.28-7.296-1.856-3.712-0.576-7.488-0.448-3.84 0.192-7.424 1.088-3.712 0.896-7.168 2.496-3.392 1.6-6.4 3.84-3.136 2.176-5.696 4.992-2.56 2.752-4.48 6.016-1.984 3.2-3.264 6.784-1.28 3.52-1.92 7.296-0.576 3.712-0.384 7.488 0.128 3.84 1.024 7.488 0.896 3.648 2.496 7.04 1.6 3.456 3.84 6.528z m30.976-61.056q-3.776 0-7.488 0.704-3.712 0.768-7.168 2.24-3.52 1.408-6.656 3.52-3.2 2.112-5.824 4.8-2.688 2.624-4.8 5.76-2.112 3.2-3.52 6.656-1.472 3.52-2.176 7.232-0.768 3.712-0.768 7.488 0 3.776 0.768 7.488 0.704 3.712 2.176 7.232 1.408 3.456 3.52 6.592 2.112 3.2 4.8 5.824 2.688 2.688 5.76 4.8 3.2 2.112 6.72 3.52 3.456 1.472 7.168 2.176 3.712 0.768 7.488 0.768 3.84 0 7.488-0.768 3.712-0.704 7.232-2.176 3.456-1.408 6.592-3.52 3.2-2.112 5.824-4.8 2.688-2.688 4.8-5.76 2.112-3.2 3.52-6.656 1.472-3.52 2.24-7.232 0.704-3.712 0.704-7.488 0-3.84-0.704-7.488-0.768-3.712-2.24-7.232-1.408-3.456-3.52-6.592-2.112-3.2-4.8-5.824-2.624-2.688-5.76-4.8-3.2-2.112-6.656-3.52-3.52-1.472-7.232-2.24Q436.224 256 432.448 256z m0 435.392q-3.776 0-7.488 0.704-3.712 0.768-7.168 2.176-3.52 1.472-6.656 3.584-3.2 2.112-5.824 4.736-2.688 2.688-4.8 5.824-2.112 3.2-3.52 6.656-1.472 3.52-2.176 7.232-0.768 3.712-0.768 7.488 0 3.776 0.768 7.488 0.704 3.712 2.176 7.168 1.408 3.52 3.52 6.656 2.112 3.2 4.8 5.76 2.688 2.752 5.76 4.8 3.2 2.112 6.72 3.584 3.456 1.472 7.168 2.176 3.712 0.768 7.488 0.768 3.84 0 7.488-0.768 3.712-0.704 7.232-2.176 3.456-1.472 6.592-3.584 3.2-2.048 5.824-4.736 2.688-2.688 4.8-5.824 2.112-3.2 3.52-6.656 1.472-3.456 2.24-7.168 0.704-3.712 0.704-7.488 0-3.84-0.704-7.488-0.768-3.712-2.24-7.232-1.408-3.52-3.52-6.656-2.112-3.136-4.8-5.76-2.624-2.688-5.76-4.8-3.2-2.112-6.656-3.584-3.52-1.408-7.232-2.176-3.712-0.704-7.488-0.704z" p-id="4238"></path></svg>\r
6
+ `,yt=`<svg t="1722595535853" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4551" width="32" height="32"><path d="M640 128H384c-170.496 0-256 85.504-256 256v256c0 170.496 85.504 256 256 256h256c170.496 0 256-85.504 256-256V384c0-170.496-85.504-256-256-256z m67.584 302.592c-2.048 4.608-4.608 8.704-8.192 12.288L506.88 634.88c-3.584 3.584-7.68 6.144-12.288 8.192-4.608 2.048-9.728 3.072-14.848 3.072s-10.24-1.024-14.848-3.072c-4.608-2.048-8.704-4.608-12.288-8.192l-96.256-96.256c-3.584-3.584-6.144-7.68-8.192-12.288-2.048-4.608-3.072-9.728-3.072-14.848 0-2.56 0-5.12 1.024-7.68 0.512-2.56 1.024-5.12 2.048-7.168 1.024-2.56 2.048-4.608 3.584-6.656 1.536-2.048 3.072-4.096 4.608-5.632 1.536-2.048 3.584-3.584 5.632-4.608 2.048-1.536 4.096-2.56 6.656-3.584 2.56-1.024 4.608-1.536 7.168-2.048 2.56-0.512 5.12-0.512 7.68-0.512 5.12 0 10.24 1.024 14.848 3.072 4.608 2.048 8.704 4.608 12.288 8.192l69.12 68.608L645.12 389.12c3.584-3.584 7.68-6.144 12.288-8.192 4.608-2.048 9.728-3.072 14.848-3.072 2.56 0 5.12 0 7.68 0.512s5.12 1.024 7.168 2.048c2.56 1.024 4.608 2.048 6.656 3.584 2.048 1.536 4.096 3.072 5.632 4.608 1.536 1.536 3.584 3.584 4.608 5.632 1.536 2.048 2.56 4.096 3.584 6.656 1.024 2.56 1.536 4.608 2.048 7.168 0.512 2.56 1.024 5.12 1.024 7.68 0 5.12-1.024 10.24-3.072 14.848z" p-id="4552"></path></svg>
7
+ `,bt=`<svg t="1724122044148" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4551" width="32" height="32"><path d="M707.648 401.28L489.28 560.704l22.656 30.976 22.656-30.976L316.16 401.216q-3.072-2.24-6.464-3.84-3.456-1.536-7.104-2.432-3.712-0.896-7.488-1.088-3.776-0.128-7.488 0.448-3.776 0.64-7.296 1.92-3.584 1.28-6.784 3.2-3.2 1.984-6.016 4.544-2.816 2.56-5.056 5.632-2.176 3.072-3.84 6.464-1.536 3.456-2.432 7.104-0.896 3.712-1.088 7.488-0.128 3.776 0.448 7.488 0.64 3.776 1.92 7.296 1.28 3.584 3.2 6.784 1.984 3.2 4.544 6.016 2.56 2.752 5.632 4.992l218.368 159.552q4.928 3.584 10.752 5.504 5.76 1.92 11.904 1.92 6.08 0 11.904-1.92 5.76-1.92 10.752-5.504l218.368-159.552q3.008-2.24 5.568-4.992 2.56-2.816 4.544-6.016 1.92-3.2 3.264-6.784 1.28-3.52 1.92-7.296 0.576-3.712 0.384-7.488-0.128-3.84-1.024-7.488-0.896-3.648-2.496-7.04-1.6-3.456-3.84-6.528-2.24-3.072-4.992-5.632-2.816-2.56-6.016-4.48-3.2-1.984-6.784-3.328-3.584-1.28-7.296-1.856-3.712-0.64-7.488-0.448-3.84 0.192-7.488 1.088-3.648 0.896-7.04 2.496-3.456 1.536-6.528 3.84z m61.056 30.976q0-3.84-0.768-7.488-0.704-3.712-2.176-7.232-1.472-3.456-3.52-6.656-2.112-3.136-4.8-5.76-2.688-2.688-5.76-4.8-3.2-2.112-6.72-3.584-3.456-1.408-7.168-2.176-3.712-0.704-7.488-0.704-3.84 0-7.488 0.704-3.712 0.768-7.232 2.176-3.456 1.472-6.656 3.584-3.136 2.112-5.76 4.8-2.688 2.624-4.8 5.76-2.112 3.2-3.584 6.656-1.408 3.52-2.176 7.232-0.704 3.712-0.704 7.488 0 3.776 0.704 7.488 0.768 3.712 2.176 7.168 1.472 3.52 3.584 6.656 2.112 3.2 4.8 5.824 2.624 2.688 5.76 4.8 3.2 2.112 6.656 3.52 3.52 1.472 7.232 2.176 3.712 0.768 7.488 0.768 3.776 0 7.488-0.768 3.712-0.704 7.168-2.176 3.52-1.408 6.656-3.52 3.2-2.112 5.824-4.8 2.688-2.688 4.8-5.76 2.048-3.2 3.52-6.72 1.472-3.456 2.176-7.168 0.768-3.712 0.768-7.488z m-436.736 0q0-3.84-0.768-7.488-0.704-3.712-2.176-7.232-1.408-3.456-3.52-6.656-2.112-3.136-4.8-5.76-2.688-2.688-5.76-4.8-3.2-2.112-6.656-3.584-3.52-1.408-7.232-2.176-3.712-0.704-7.488-0.704-3.84 0-7.488 0.704-3.712 0.768-7.232 2.176-3.456 1.472-6.592 3.584-3.2 2.112-5.824 4.8-2.688 2.624-4.8 5.76-2.112 3.2-3.52 6.656-1.472 3.52-2.24 7.232-0.704 3.712-0.704 7.488 0 3.776 0.704 7.488 0.768 3.712 2.24 7.168 1.408 3.52 3.52 6.656 2.112 3.2 4.8 5.824 2.624 2.688 5.76 4.8 3.2 2.112 6.656 3.52 3.52 1.472 7.232 2.176 3.712 0.768 7.488 0.768 3.776 0 7.488-0.768 3.712-0.704 7.232-2.176 3.456-1.408 6.592-3.52 3.2-2.112 5.824-4.8 2.688-2.688 4.8-5.76 2.112-3.2 3.52-6.72 1.472-3.456 2.176-7.168 0.768-3.712 0.768-7.488z" p-id="4552"></path></svg>
8
+ `,xt=`<svg t="1755138507987" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5079" width="200" height="200"><path d="M512 938.688a42.688 42.688 0 0 1-35.072-18.432l-192-277.312A42.56 42.56 0 0 1 320 576h384a42.752 42.752 0 0 1 35.072 66.944l-192 277.312a42.688 42.688 0 0 1-35.072 18.432" fill="currentColor" p-id="2016"></path><path d="M704 448H320a42.752 42.752 0 0 1-35.072-66.944l192-277.312c16-23.04 54.208-23.04 70.144 0l192 277.312A42.56 42.56 0 0 1 704 448" fill="currentColor" p-id="2015"></path></svg>
9
+ `,St=`<svg t="1724133395728" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2893" width="32" height="32"><path d="M512 226.8476541a19.82487759 19.82487759 0 0 1 14.66497778 5.70304692c3.80203107 3.82918865 5.70304692 8.71751457 5.70304693 14.66497779v122.20814825a19.82487759 19.82487759 0 0 1-5.70304693 14.66497778 19.82487759 19.82487759 0 0 1-14.66497778 5.70304691 19.82487759 19.82487759 0 0 1-14.66497778-5.70304691 19.82487759 19.82487759 0 0 1-5.70304693-14.66497778v-122.20814825a19.82487759 19.82487759 0 0 1 5.70304693-14.66497779 19.82487759 19.82487759 0 0 1 14.66497778-5.70304692z m0 407.36049415a19.82487759 19.82487759 0 0 1 14.66497778 5.70304691c3.80203107 3.82918865 5.70304692 8.71751457 5.70304693 14.66497778v122.20814827a19.82487759 19.82487759 0 0 1-5.70304693 14.66497776 19.82487759 19.82487759 0 0 1-14.66497778 5.70304693 19.82487759 19.82487759 0 0 1-14.66497778-5.70304693 19.82487759 19.82487759 0 0 1-5.70304693-14.66497776v-122.20814827a19.82487759 19.82487759 0 0 1 5.70304693-14.66497778 19.82487759 19.82487759 0 0 1 14.66497778-5.70304691zM797.1523459 512a19.82487759 19.82487759 0 0 1-5.70304692 14.66497778 19.82487759 19.82487759 0 0 1-14.66497779 5.70304693h-122.20814825a19.82487759 19.82487759 0 0 1-14.66497778-5.70304693 19.82487759 19.82487759 0 0 1-5.70304691-14.66497778 19.82487759 19.82487759 0 0 1 5.70304691-14.66497778 19.82487759 19.82487759 0 0 1 14.66497778-5.70304693h122.20814825a19.82487759 19.82487759 0 0 1 14.66497779 5.70304693c3.80203107 3.82918865 5.70304692 8.71751457 5.70304692 14.66497778z m-407.36049415 0a19.82487759 19.82487759 0 0 1-5.70304691 14.66497778 19.82487759 19.82487759 0 0 1-14.66497778 5.70304693h-122.20814827a19.82487759 19.82487759 0 0 1-14.66497776-5.70304693 19.82487759 19.82487759 0 0 1-5.70304693-14.66497778 19.82487759 19.82487759 0 0 1 5.70304693-14.66497778 19.82487759 19.82487759 0 0 1 14.66497776-5.70304693h122.20814827a19.82487759 19.82487759 0 0 1 14.66497778 5.70304693c3.80203107 3.82918865 5.70304692 8.71751457 5.70304691 14.66497778zM310.22076878 310.22076878a21.29137537 21.29137537 0 0 1 14.66497779-5.70304693c5.51294514 0 10.18401235 1.90101585 14.01320099 5.70304693l86.55052591 86.57768347a20.91117183 20.91117183 0 0 1 5.73020449 14.31193182 19.28172983 19.28172983 0 0 1-6.05609289 14.013201 19.11878565 19.11878565 0 0 1-14.013201 6.05609289 20.96548698 20.96548698 0 0 1-14.31193182-5.70304692L310.22076878 338.87178998a19.06447114 19.06447114 0 0 1-5.70304693-14.01320099c0-5.54010272 1.90101585-10.42842865 5.70304693-14.66497778z m288.32975775 288.32975775a19.79772001 19.79772001 0 0 1 14.3390894-6.35482371c5.29568642 0 10.04822572 2.11827457 14.31193182 6.38198066l86.57768347 86.55052651c3.80203107 3.80203107 5.70304692 8.47309828 5.70304691 14.01320102a19.55330372 19.55330372 0 0 1-6.05609225 14.31193182 19.66193339 19.66193339 0 0 1-14.31193245 6.05609288 19.01015661 19.01015661 0 0 1-14.01320099-5.70304692l-86.55052591-86.57768347a19.79772001 19.79772001 0 0 1-6.38198129-14.31193245c0-5.29568642 2.11827457-10.07538268 6.38198129-14.33908939zM713.77923122 310.22076878c3.80203107 4.26370672 5.70304692 9.15203265 5.70304693 14.66497779s-1.90101585 10.18401235-5.70304693 14.01320099l-86.57768347 86.55052591a20.91117183 20.91117183 0 0 1-14.31193182 5.73020449 19.28172983 19.28172983 0 0 1-14.013201-6.05609289 19.11878565 19.11878565 0 0 1-6.05609289-14.013201c0-5.29568642 1.90101585-10.07538268 5.70304692-14.31193182l86.57768348-86.57768347c3.80203107-3.80203107 8.50025585-5.70304692 14.01320099-5.70304693 5.54010272 0 10.40127108 1.90101585 14.66497779 5.70304693zM425.44947347 598.57768347a19.79772001 19.79772001 0 0 1 6.35482371 14.33908939c0 5.29568642-2.11827457 10.04822572-6.38198066 14.31193245L338.89894756 713.77923122a19.06447114 19.06447114 0 0 1-14.01320099 5.70304693 19.55330372 19.55330372 0 0 1-14.31193245-6.05609227 19.68909035 19.68909035 0 0 1-6.05609227-14.31193245 19.01015661 19.01015661 0 0 1 5.70304693-14.01320099l86.57768347-86.55052591a19.79772001 19.79772001 0 0 1 14.31193182-6.38198129c5.29568642 0 10.07538268 2.11827457 14.3390894 6.38198129z" fill="#000000" fill-opacity=".65" p-id="2894"></path></svg>
10
+ `,Ct=`<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 24 24"><path d="M11 18c0 1.1-.9 2-2 2s-2-.9-2-2s.9-2 2-2s2 .9 2 2zm-2-8c-1.1 0-2 .9-2 2s.9 2 2 2s2-.9 2-2s-.9-2-2-2zm0-6c-1.1 0-2 .9-2 2s.9 2 2 2s2-.9 2-2s-.9-2-2-2zm6 4c1.1 0 2-.9 2-2s-.9-2-2-2s-2 .9-2 2s.9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2s2-.9 2-2s-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2s2-.9 2-2s-.9-2-2-2z" fill="currentColor"></path></svg>
11
+ `,wt=`<svg t="1722595639920" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4708" width="32" height="32"><path d="M128 640V384a256 256 0 0 1 256-256h256a256 256 0 0 1 256 256v256a256 256 0 0 1-256 256H384a256 256 0 0 1-256-256z m64 0q0 79.552 56.256 135.744Q304.448 832 384 832h256q79.552 0 135.744-56.256Q832 719.552 832 640V384q0-79.552-56.256-135.744Q719.552 192 640 192H384q-79.552 0-135.744 56.256Q192 304.448 192 384v256z" p-id="4709"></path></svg>
12
+ `,Tt=`<svg t="1722595280953" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4394" width="32" height="32"><path d="M128 384v256q0 12.608 1.28 25.088 1.216 12.544 3.648 24.832 2.432 12.352 6.08 24.384t8.448 23.68q4.864 11.584 10.752 22.72 5.952 11.072 12.928 21.504 7.04 10.496 14.976 20.224 8 9.728 16.896 18.56 8.896 8.96 18.56 16.896 9.728 8 20.224 14.976 10.432 7.04 21.504 12.928 11.136 5.888 22.72 10.688 11.648 4.864 23.68 8.512 12.032 3.648 24.32 6.08 12.352 2.432 24.896 3.712Q371.392 896 384 896h256q12.608 0 25.088-1.28 12.544-1.216 24.832-3.648 12.352-2.432 24.384-6.08t23.68-8.512q11.584-4.8 22.72-10.688 11.072-5.952 21.504-12.928 10.496-7.04 20.224-14.976 9.728-8 18.56-16.896 8.96-8.832 16.896-18.56 8-9.728 14.976-20.224 7.04-10.432 12.928-21.504 5.888-11.136 10.688-22.72 4.864-11.648 8.512-23.68 3.648-12.032 6.08-24.32 2.432-12.352 3.712-24.896Q896 652.608 896 640V384q0-12.608-1.28-25.088-1.216-12.544-3.648-24.832-2.432-12.352-6.08-24.384t-8.512-23.68q-4.8-11.584-10.688-22.72-5.952-11.072-12.928-21.504-7.04-10.496-14.976-20.224-8-9.664-16.896-18.56-8.832-8.96-18.56-16.896-9.728-8-20.224-14.976-10.432-7.04-21.504-12.928-11.136-5.888-22.72-10.752-11.648-4.8-23.68-8.448-12.032-3.648-24.32-6.08-12.352-2.432-24.896-3.712Q652.608 128 640 128H384q-12.608 0-25.088 1.28-12.544 1.216-24.832 3.648-12.352 2.432-24.384 6.08t-23.68 8.448q-11.584 4.864-22.72 10.752-11.072 5.952-21.504 12.928-10.496 7.04-20.224 14.976-9.664 8-18.56 16.896-8.96 8.896-16.896 18.56-8 9.728-14.976 20.224-7.04 10.432-12.928 21.504-5.888 11.136-10.752 22.72-4.8 11.648-8.448 23.68-3.648 12.032-6.08 24.32-2.432 12.352-3.712 24.896Q128 371.392 128 384z m566.016 166.336H330.112a38.4 38.4 0 0 1 0-76.8h363.904a38.4 38.4 0 0 1 0 76.8z" p-id="4395"></path></svg>
13
+ `,Et=`<svg t="1722595946663" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4865" width="32" height="32"><path d="M128 640V384a256 256 0 0 1 256-256h256a256 256 0 0 1 256 256v256a256 256 0 0 1-256 256H384a256 256 0 0 1-256-256z" p-id="4866"></path><path d="M128 640V384a256 256 0 0 1 256-256h256a256 256 0 0 1 256 256v256a256 256 0 0 1-256 256H384a256 256 0 0 1-256-256z m64 0q0 79.552 56.256 135.744Q304.448 832 384 832h256q79.552 0 135.744-56.256Q832 719.552 832 640V384q0-79.552-56.256-135.744Q719.552 192 640 192H384q-79.552 0-135.744 56.256Q192 304.448 192 384v256z" fill="#DDE0EA" p-id="4867"></path></svg>
14
+ `,Dt=`<svg t="1744798692576" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6606" width="200" height="200"><path d="M855.296 894.528H168.768v-76.8h686.528v76.8z m38.4-38.4q0 3.84-0.768 7.488-0.704 3.712-2.176 7.232-1.472 3.52-3.52 6.656-2.112 3.136-4.8 5.76-2.688 2.688-5.824 4.8-3.2 2.112-6.656 3.584-3.456 1.408-7.168 2.176-3.712 0.704-7.488 0.704-3.84 0-7.488-0.704-3.712-0.768-7.232-2.176-3.52-1.472-6.656-3.584-3.136-2.112-5.76-4.736-2.688-2.688-4.8-5.824-2.112-3.2-3.584-6.656-1.408-3.52-2.176-7.232-0.704-3.648-0.704-7.488 0-3.776 0.704-7.488 0.768-3.712 2.176-7.168 1.472-3.52 3.584-6.656 2.112-3.136 4.736-5.76 2.688-2.752 5.824-4.8 3.2-2.112 6.656-3.584 3.52-1.472 7.232-2.176 3.712-0.768 7.488-0.768 3.776 0 7.488 0.768 3.712 0.704 7.168 2.176 3.52 1.472 6.656 3.584 3.2 2.048 5.76 4.736 2.752 2.688 4.864 5.824 2.048 3.2 3.52 6.656 1.472 3.456 2.176 7.168 0.768 3.712 0.768 7.488z m-686.528 0q0 3.84-0.768 7.488-0.704 3.712-2.176 7.232-1.472 3.52-3.52 6.656-2.112 3.136-4.8 5.76-2.688 2.688-5.76 4.8-3.2 2.112-6.72 3.584-3.456 1.408-7.168 2.176-3.712 0.704-7.488 0.704-3.84 0-7.488-0.704-3.712-0.768-7.232-2.176-3.456-1.472-6.656-3.584-3.136-2.112-5.76-4.736-2.688-2.688-4.8-5.824-2.112-3.2-3.584-6.656-1.408-3.52-2.176-7.232-0.704-3.648-0.704-7.488 0-3.776 0.704-7.488 0.768-3.712 2.176-7.168 1.472-3.52 3.584-6.656 2.112-3.136 4.736-5.76 2.688-2.752 5.824-4.8 3.2-2.112 6.656-3.584 3.52-1.472 7.232-2.176 3.712-0.768 7.488-0.768 3.776 0 7.488 0.768 3.712 0.704 7.168 2.176 3.52 1.472 6.656 3.584 3.2 2.048 5.824 4.736 2.688 2.688 4.8 5.824 2.048 3.2 3.52 6.656 1.472 3.456 2.176 7.168 0.768 3.712 0.768 7.488zM652.032 211.2l-369.92 370.368v89.344h90.048l369.664-369.856L652.032 211.2z m-54.4-54.272q22.528-22.528 54.4-22.528 31.808 0 54.336 22.528l89.792 89.856q22.464 22.464 22.464 54.272t-22.464 54.272l-369.664 369.856q-22.464 22.528-54.336 22.528H282.24q-31.808 0-54.336-22.528-22.464-22.464-22.464-54.272V581.568q0-31.808 22.4-54.272l369.92-370.368z" p-id="6607"></path></svg>
15
+ `,Ot=xt.replace(`fill="currentColor" p-id="2016"`,`fill="#bec4c7" p-id="2016"`),kt=xt.replace(`fill="currentColor" p-id="2015"`,`fill="#bec4c7" p-id="2015"`),At=class{constructor(e){K(this,`ctx`),K(this,`list`,[{name:`loading`,configName:`LOADING_ICON_SVG`,configColorName:`LOADING_ICON_COLOR`,svg:St,color:`#4E5969`},{name:`expand`,configName:`EXPAND_ICON_SVG`,configColorName:`EXPAND_ICON_COLOR`,svg:J,color:`#4E5969`},{name:`shrink`,configName:`SHRINK_ICON_SVG`,configColorName:`SHRINK_ICON_COLOR`,svg:bt,color:`#4E5969`},{name:`checkbox-uncheck`,configName:`CHECKBOX_UNCHECK_SVG`,configColorName:`CHECKBOX_UNCHECK_COLOR`,svg:wt,color:``},{name:`checkbox-check`,configName:`CHECKBOX_CHECK_SVG`,configColorName:`CHECKBOX_COLOR`,svg:yt,color:`rgb(82,146,247)`},{name:`checkbox-indeterminate`,configName:`CHECKBOX_INDETERMINATE_SVG`,configColorName:`CHECKBOX_COLOR`,svg:Tt,color:`rgb(82,146,247)`},{name:`checkbox-check-disabled`,configName:`CHECKBOX_CHECK_DISABLED_SVG`,svg:yt,color:`#DDE0EA`},{name:`checkbox-disabled`,configName:`CHECKBOX_DISABLED_SVG`,configColorName:`CHECKBOX_DISABLED_COLOR`,svg:Et,color:`#F1F2F4`},{name:`icon-edit`,configName:`ICON_EDIT_SVG`,configColorName:`ICON_EDIT_COLOR`,svg:Dt,color:`#4E5969`},{name:`icon-select`,configName:`ICON_SELECT_SVG`,configColorName:`ICON_SELECT_COLOR`,svg:bt,color:`#4E5969`},{name:`sort-asc`,configName:`SORT_ASC_ICON_SVG`,configColorName:`SORT_ICON_COLOR`,svg:Ot,color:`rgb(82,146,247)`},{name:`sort-desc`,configName:`SORT_DESC_ICON_SVG`,configColorName:`SORT_ICON_COLOR`,svg:kt,color:`rgb(82,146,247)`},{name:`sort-default`,configName:`SORTABLE_ICON_SVG`,svg:xt,color:`#bec4c7`},{name:`drag`,configName:`DRAG_ROW_ICON_SVG`,svg:Ct,color:`#4E5969`}]),K(this,`icons`,/* @__PURE__ */ new Map),this.ctx=e,this.init()}async init(){let e=[];for(let t=0;t<this.list.length;t++){let n=this.list[t],r=n.color,i=n.svg;if(n.configColorName){let e=this.ctx.config[n.configColorName];e&&(r=e)}if(n.configName){let e=this.ctx.config[n.configName];e&&(i=e)}let a=this.createImageFromSVG(i,r).then(e=>{this.icons.set(n.name,e)});e.push(a)}for(let t=0;t<this.ctx.config.ICONS.length;t++){let n=this.ctx.config.ICONS[t],r=n.color,i=this.createImageFromSVG(n.svg,r,n.isBlob).then(e=>{this.icons.set(n.name,e)});e.push(i)}await Promise.all(e),this.ctx.emit(`draw`)}async createImageFromSVG(e,t,n=!1){let r=new DOMParser().parseFromString(e,`image/svg+xml`).documentElement;t&&r.querySelectorAll(`*`).forEach(e=>{let n=e.getAttribute(`fill`);(n===`currentColor`||n===null)&&e.setAttribute(`fill`,t)});let i=new Image,a=``;if(n){let e=new Blob([new XMLSerializer().serializeToString(r)],{type:`image/svg+xml`});a=URL.createObjectURL(e)}else a=`data:image/svg+xml;charset=utf-8,`+encodeURIComponent(new XMLSerializer().serializeToString(r));return i.src=a,new Promise((t,n)=>{i.onerror=()=>n(/* @__PURE__ */ Error(`Failed to load image:`+e)),i.onload=()=>{t(i)}})}get(e){return this.icons.get(e)}getSvg(e){return this.list.find(t=>t.name===e)}},jt=class{constructor(e){K(this,`ctx`),K(this,`visibleHoverCell`),K(this,`resizeObserver`),K(this,`mutationObserver`),this.ctx=e,this.init()}init(){this.resizeObserver=new ResizeObserver(e=>{this.ctx.emit(`resetHeader`),this.ctx.emit(`resizeObserver`,e),this.ctx.emit(`containerResize`,this.ctx.containerElement)}),this.resizeObserver.observe(this.ctx.containerElement),this.mutationObserver=new MutationObserver(e=>{for(let t of e)t.type===`attributes`&&t.attributeName===`class`&&(this.ctx.config.updateCssVar(),this.ctx.emit(`draw`))}),this.ctx.config.ENABLE_AUTO_THEME&&this.mutationObserver.observe(document.documentElement,{attributes:!0,attributeFilter:[`class`]}),this.ctx.on(`mousedown`,e=>{if(this.isBusy(e))return;let{offsetY:t,offsetX:n}=this.ctx.getOffset(e),r=t,i=n;this.isInsideBody(i,r)||this.ctx.emit(`mousedownBodyOutside`,e),e.button===0&&(this.handleHeaderEvent(i,r,this.ctx.header.renderCellHeaders,t=>{this.ctx.focusCellHeader=t,this.ctx.focusCell=void 0,this.ctx.emit(`cellHeaderMousedown`,t,e)}),this.handleBodyEvent(i,r,this.ctx.body.renderRows,t=>{this.ctx.setFocusCell(t),this.ctx.focusCellHeader=void 0,this.ctx.emit(`cellMousedown`,t,e)},!0))}),this.ctx.on(`mouseup`,e=>{if(e.button!==0||this.isBusy(e))return;let{offsetY:t,offsetX:n}=this.ctx.getOffset(e),r=t,i=n;this.handleHeaderEvent(i,r,this.ctx.header.renderCellHeaders,t=>{this.ctx.emit(`cellHeaderMouseup`,t,e)}),this.handleBodyEvent(i,r,this.ctx.body.renderRows,t=>{this.ctx.emit(`cellMouseup`,t,e)})}),this.ctx.on(`click`,e=>{if(e.button!==0||this.isBusy(e))return;let t=this.ctx.getOffset(e).offsetY,n=this.ctx.getOffset(e).offsetX;this.handleHeaderEvent(n,t,this.ctx.header.renderCellHeaders,t=>{this.ctx.clickCellHeader=t,this.ctx.emit(`cellHeaderClick`,t,e)}),this.handleBodyEvent(n,t,this.ctx.body.renderRows,r=>{this.ctx.clickCell=r,this.ctx.emit(`cellClick`,r,e);let i=r.getImage(`hover`);!this.ctx.disableHoverIconClick&&i&&i.isInside(n,t)&&this.ctx.emit(`hoverIconClick`,r)},!0)}),this.ctx.on(`dblclick`,e=>{if(e.button!==0||this.isBusy(e))return;let t=this.ctx.getOffset(e).offsetY,n=this.ctx.getOffset(e).offsetX;this.handleHeaderEvent(n,t,this.ctx.header.renderCellHeaders,t=>{this.ctx.emit(`cellHeaderDblclick`,t,e)}),this.handleBodyEvent(n,t,this.ctx.body.renderRows,t=>{this.ctx.clickCell=t,this.ctx.emit(`cellDblclick`,t,e)})}),this.ctx.on(`contextMenu`,e=>{if(this.isBusy(e))return;let{offsetY:t,offsetX:n}=this.ctx.getOffset(e),r=t,i=n;this.handleHeaderEvent(i,r,this.ctx.header.renderCellHeaders,t=>{this.ctx.emit(`cellHeaderContextMenuClick`,t,e)}),this.handleBodyEvent(i,r,this.ctx.body.renderRows,t=>{this.ctx.emit(`cellContextMenuClick`,t,e)})}),this.ctx.on(`mouseout`,e=>{!this.ctx.containerElement.contains(e.relatedTarget)&&this.ctx.hoverCell!==void 0&&(this.ctx.hoverRow=void 0,this.ctx.hoverCell=void 0,this.ctx.emit(`draw`))}),this.ctx.on(`mousemove`,e=>{if(this.isBusy(e))return;!this.ctx.mousedown&&this.ctx.stageElement.style.cursor!=="default"&&(this.ctx.stageElement.style.cursor=`default`);let t=this.ctx.getOffset(e).offsetY,n=this.ctx.getOffset(e).offsetX;this.handleHeaderEvent(n,t,this.ctx.header.renderCellHeaders,t=>{this.imageEnterAndLeave(t,e),this.ctx.emit(`cellHeaderMouseenter`,t,e),this.ctx.hoverCellHeader&&this.ctx.hoverCellHeader!==t&&this.ctx.emit(`cellHeaderMouseleave`,this.ctx.hoverCellHeader,e),this.ctx.hoverCellHeader!==t&&(this.ctx.hoverCellHeader=t,this.visibleHoverCell=void 0,this.ctx.emit(`cellHeaderHoverChange`,t,e))}),this.handleBodyEvent(n,t,this.ctx.body.renderRows,t=>{this.imageEnterAndLeave(t,e),this.visibleHoverCell!==t&&(this.ctx.emit(`visibleCellMouseleave`,t,e),this.visibleHoverCell=t,this.ctx.hoverCellHeader=void 0,this.ctx.emit(`visibleCellHoverChange`,t,e))},!0),this.handleBodyEvent(n,t,this.ctx.body.renderRows,t=>{this.ctx.emit(`cellMouseenter`,t,e),this.ctx.hoverCell&&this.ctx.hoverCell!==t&&this.ctx.emit(`cellMouseleave`,t,e),this.ctx.hoverCell!==t&&(this.ctx.hoverCell?.rowKey!==t.rowKey&&(this.ctx.hoverCell=t,this.ctx.hoverRow=this.ctx.body.renderRows.find(e=>e.rowKey===t.rowKey),this.ctx.emit(`rowHoverChange`,this.ctx.hoverRow,t,e),this.ctx.emit(`draw`)),this.ctx.hoverCell=t,this.ctx.emit(`cellHoverChange`,t,e))}),this.handleFooterEvent(n,t,this.ctx.footer.renderRows,t=>{this.ctx.emit(`cellFooterMouseenter`,t,e),this.ctx.hoverCell&&this.ctx.hoverCell!==t&&this.ctx.emit(`cellFooterMouseleave`,t,e),this.ctx.emit(`cellFooterHoverChange`,t,e)})})}imageEnterAndLeave(e,t){if(this.ctx.dragRowIng||this.ctx.dragHeaderIng||this.ctx.selectorMove||this.ctx.autofillMove)return;let{offsetY:n,offsetX:r}=this.ctx.getOffset(t),i=n,a=r;e.cellImages.forEach((e,t)=>{e.isInside(a,i)&&(t===`drag`?this.ctx.stageElement.style.cursor=`grab`:this.ctx.stageElement.style.cursor=`pointer`)})}isBusy(e){let{offsetY:t,offsetX:n}=this.ctx.getOffset(e),r=t,i=n;if(this.ctx.loading||!this.ctx.isTarget(e)||this.ctx.stageElement.style.cursor===`row-resize`||this.ctx.stageElement.style.cursor===`col-resize`||this.ctx.columnResizing||this.ctx.rowResizing)return!0;let{SCROLLER_TRACK_SIZE:a}=this.ctx.config,o=y(this.ctx.config);return!!(this.ctx.scrollerMove||this.ctx.scrollerFocus||!o&&r>this.ctx.stageHeight-a||!o&&i>this.ctx.stageWidth-a)}handleBodyEvent(e,t,n,r,i=!1){if(this.isInsideBody(e,t))for(let a of n){let n=a.fixedCells.concat(a.noFixedCells);for(let a of n)if(i?a.isInsideVisible(e,t):a.isInside(e,t)){r(a);return}}}handleHeaderEvent(e,t,n,r){for(let i of n)if(i.isInside(e,t)){r(i);return}}handleFooterEvent(e,t,n,r){for(let i of n){let n=i.fixedCells.concat(i.noFixedCells);for(let i of n)if(i.isInside(e,t)){r(i);return}}}isInsideBody(e,t){let{body:{y:n,visibleHeight:r,height:i,visibleWidth:a}}=this.ctx;return e>0&&e<a&&t>n&&t<n+Math.min(i,r)}destroy(){this.resizeObserver.unobserve(this.ctx.stageElement),this.mutationObserver.disconnect()}},Mt={numberErrorTip:`只允许输入数字`,emptyText:`暂无数据`,loadingText:`加载中...`,copy:`复制`,cut:`剪切`,paste:`粘贴`,clearSelected:`清空选中内容`,fixedLeft:`左固定`,fixedRight:`右固定`,fixedNone:`取消固定`,hide:`隐藏`,visible:`显示`,resetHeader:`恢复默认`,invalidNumber:`请输入数字类型`,mergeCellNoFill:`合并单元格不能填充`,mergeCellNoCopy:`合并单元格不能复制`,mergeCellNoPaste:`合并单元格不能粘贴`,numberTruncated:`输入的数字已截取至小数点后{precision}位`,batchSetItemValueError:`批量赋值错误`,numberMin:`输入值小于{min},已自动调整为{min}`,numberMax:`输入值大于{max},已自动调整为{max}`,stringMaxlength:`输入值超过{maxlength}个字符,已自动截取`},Nt=class{constructor(){K(this,`langConfig`)}use(e){this.langConfig=e}getText(e,t){let n={...Mt};Object.assign(n,On.locale,this.langConfig);let r=n[e];return r?r.replace(/{(\w+)}/g,(e,n)=>t?.[n]||e):``}},Pt=class{constructor(e,t){K(this,`eventBus`),K(this,`eventBrowser`),K(this,`eventTable`),K(this,`locale`,new Nt),K(this,`containerElement`),K(this,`stageElement`),K(this,`canvasElement`),K(this,`overlayerElement`),K(this,`editorElement`),K(this,`emptyElement`),K(this,`contextMenuElement`),K(this,`loadingElement`),K(this,`stageWidth`,0),K(this,`stageHeight`,0),K(this,`paint`),K(this,`icons`),K(this,`domSelectionStr`,``),K(this,`textSelectionStr`,``),K(this,`textSelecting`,!1),K(this,`isMouseoverTargetContainer`,!1),K(this,`mousedown`,!1),K(this,`isEmpty`,!1),K(this,`rowResizing`,!1),K(this,`columnResizing`,!1),K(this,`scrollerMove`,!1),K(this,`scrollerFocus`,!1),K(this,`autofillMove`,!1),K(this,`selectorMove`,!1),K(this,`disableHoverIconClick`,!1),K(this,`selectColsIng`,!1),K(this,`selectRowsIng`,!1),K(this,`dragHeaderIng`,!1),K(this,`dragRowIng`,!1),K(this,`finding`,!1),K(this,`contextMenuIng`,!1),K(this,`editing`,!1),K(this,`loading`,!1),K(this,`onlyMergeCell`,!1),K(this,`selectOnlyOne`,!1),K(this,`hasSelection`,!1),K(this,`hasTree`,!1),K(this,`scrollY`,0),K(this,`scrollX`,0),K(this,`fixedLeftWidth`,0),K(this,`fixedRightWidth`,0),K(this,`lastCenterColIndex`,0),K(this,`maxColIndex`,0),K(this,`maxRowIndex`,0),K(this,`hoverRow`),K(this,`clickCell`),K(this,`focusCell`),K(this,`currentCell`),K(this,`hoverCell`),K(this,`clickCellHeader`),K(this,`focusCellHeader`),K(this,`hoverCellHeader`),K(this,`mouseX`,0),K(this,`mouseY`,0),K(this,`body`,{x:0,y:0,width:0,height:0,visibleHeight:0,visibleWidth:0,headIndex:0,tailIndex:0,visibleRows:[],renderRows:[],data:[]}),K(this,`footer`,{x:0,y:0,width:0,height:0,visibleHeight:0,visibleWidth:0,renderRows:[]}),K(this,`header`,{x:0,y:0,width:0,height:0,visibleHeight:0,visibleWidth:0,visibleLeafColumns:[],leafCellHeaders:[],allCellHeaders:[],renderLeafCellHeaders:[],renderCellHeaders:[],fixedLeftCellHeaders:[],fixedRightCellHeaders:[],renderCenterCellHeaders:[]}),K(this,`selector`,{enable:!1,xArr:[-1,-1],yArr:[-1,-1],xArrCopy:[-1,-1],yArrCopy:[-1,-1]}),K(this,`autofill`,{enable:!1,xArr:[-1,-1],yArr:[-1,-1]}),K(this,`finderBar`,{text:``,rowIndex:-1,colIndex:-1,type:`body`}),K(this,`database`),K(this,`history`),K(this,`config`);let{containerElement:n,stageElement:r,canvasElement:i,overlayerElement:a,editorElement:o,emptyElement:s,loadingElement:c,contextMenuElement:l}=e;this.containerElement=n,r.tabIndex=0,this.stageElement=r,this.canvasElement=i,this.overlayerElement=a,this.editorElement=o,this.emptyElement=s,this.loadingElement=c,this.contextMenuElement=l,this.config=new vt(t.config||{}),this.eventBus=new gt,this.eventBrowser=new ht(this),this.eventTable=new jt(this),this.paint=new _t(this.canvasElement),this.database=new pt(this,t),this.history=new mt(this),this.icons=new At(this)}setConfig(e){this.config=new vt(e)}setItemValueByEditor(e,t,n,r=!0,i=!0,a=!0){if(this.config.ENABLE_MERGE_CELL_LINK){let i=this.database.getVirtualBodyCellByKey(e,t);if(i&&(i.mergeRow||i.mergeCol)){let{dataList:e}=i.getSpanInfo(),t=e.map(e=>({...e,value:n}));this.database.batchSetItemValue(t,r,a);return}}this.database.setItemValue(e,t,n,r,i,!0,a)}batchSetItemValueByEditor(e,t=!0,n=!0){if(this.config.ENABLE_MERGE_CELL_LINK){let r=[];e.forEach(e=>{let t=this.database.getRowIndexForRowKey(e.rowKey),n=this.database.getColIndexForKey(e.key);if(t===void 0||n===void 0)return;let i=this.database.getVirtualBodyCell(t,n);if(i){let{dataList:t}=i.getSpanInfo(),n=t.map(t=>({...t,value:e.value}));r.push(...n)}}),this.database.batchSetItemValue(r,t,n)}else this.database.batchSetItemValue(e,t,n)}setFocusCell(e){if(this.focusCell!==e){if(this.focusCell?.rowKey!==e.rowKey){this.currentCell=e,this.emit(`rowFocusChange`,e);let t={rowIndex:e.rowIndex,rowKey:e.rowKey,row:e.row};this.emit(`currentRowChange`,t)}this.focusCell=e,this.emit(`cellFocusChange`,e)}}clearSelector(){this.selector.enable=!1,this.selector.xArr=[-1,-1],this.selector.yArr=[-1,-1],this.emit(`clearSelector`)}clearSelectorCopy(){this.selector.xArrCopy=[-1,-1],this.selector.yArrCopy=[-1,-1]}clearAutofill(){this.autofill={enable:!1,xArr:[-1,-1],yArr:[-1,-1]}}getSelectedData(){var e;let t=[],n=this.selector.yArr,r=this.selector.xArr,i=``;for(let a=0;a<=n[1]-n[0];a++){let o=[];for(let t=0;t<=r[1]-r[0];t++){let i=a+n[0],s=t+r[0],c=this.database.getVirtualBodyCell(i,s);if(c){if((e=c?.column)!=null&&e.formatterSelectorValue){let{row:e,rowIndex:t,colIndex:n,column:r}=c,i=c.column.formatterSelectorValue({row:e,rowIndex:t,colIndex:n,column:r,value:c.getValue()});o.push(i)}else c.selectorCellValueType===`displayText`?o.push(c.displayText):o.push(c.getValue())}}i+=`${o.join(` `)}\r`,t.push(o)}return i=i?i.replace(/\r$/,``):` `,{xArr:r,yArr:n,text:i,value:t}}setScroll(e,t){let n=Math.floor(e),r=this.body.width-this.body.visibleWidth;n<0?n=0:n>r&&(n=r);let i=Math.floor(t),a=this.body.height-this.body.visibleHeight;this.config.FOOTER_FIXED||(a=this.body.height+this.footer.height-this.body.visibleHeight),i<0?i=0:i>a&&(i=a),this.emit(`setScroll`,n,i)}setScrollX(e){let t=Math.floor(e),n=this.body.width-this.body.visibleWidth;t<0?t=0:t>n&&(t=n),this.emit(`setScrollX`,t)}setScrollY(e){let t=Math.floor(e),n=0;this.config.FOOTER_FIXED||(n=this.footer.height);let r=this.body.height-this.body.visibleHeight+n;t<0?t=0:t>r&&(t=r),this.emit(`setScrollY`,t)}startAdjustPosition(e){this.emit(`startAdjustPosition`,e)}stopAdjustPosition(){this.emit(`stopAdjustPosition`)}isTarget(e){return!!this.containerElement.contains(e.target)}getOffset(e){let{left:t,top:n}=this.containerElement.getBoundingClientRect();return{offsetX:e.clientX-t,offsetY:e.clientY-n}}hasEvent(e){return this.eventBus.has(e)}on(e,t){this.eventBus.on(e,t)}once(e,t){this.eventBus.once(e,t)}off(e,t){this.eventBus.off(e,t)}emit(e,...t){this.eventBus.emit(e,...t)}destroy(){this.eventTable.destroy(),this.eventBrowser.destroy(),this.eventBus.destroy()}},Ft=class{constructor(e,t){K(this,`ctx`),K(this,`type`),K(this,`isFocus`,!1),K(this,`trackX`,0),K(this,`trackY`,0),K(this,`trackWidth`,0),K(this,`trackHeight`,0),K(this,`splitPoints`,[]),K(this,`barX`,0),K(this,`barY`,0),K(this,`barWidth`,0),K(this,`barHeight`,0),K(this,`distance`,0),K(this,`visibleDistance`,0),K(this,`thumbTrackDistance`,0),K(this,`thumbTravelDistance`,0),K(this,`clientX`,0),K(this,`clientY`,0),K(this,`dragStart`,0),K(this,`innerVisible`,!1),K(this,`innerShowTimer`,0),K(this,`isDragging`,!1),K(this,`scroll`,0),this.ctx=e,this.type=t,this.scroll=this.type===`vertical`?this.ctx.scrollY:this.ctx.scrollX}onWheel(e){this.updateScroll(e)}onTouchmove(e){let{clientY:t,clientX:n}=e.touches[0],r=t-this.clientY,i=n-this.clientX,a=0;this.type===`vertical`?(a=Math.max(0,Math.min(this.dragStart-r,this.distance)),this.hasScrollbar()&&!(a===0&&r>0||a===this.distance&&r<0)&&e.preventDefault()):this.type===`horizontal`&&(a=Math.max(0,Math.min(this.dragStart-i,this.distance))),this.scroll=a}onTouchstart(e){let{clientY:t,clientX:n}=e.touches[0];this.clientX=n,this.clientY=t,this.dragStart=this.scroll}onMouseDown(e){if(!(e.target instanceof Element)||!this.ctx.isTarget(e))return;if(this.ctx.stageElement.style.cursor===`row-resize`||this.ctx.stageElement.style.cursor===`col-resize`)return!0;let{clientX:t,clientY:n}=e,{offsetX:r,offsetY:i}=this.ctx.getOffset(e);if((t!=this.clientX||n!=this.clientY)&&(!this.isInnerMode()||this.canInteractWithScrollbar())){if(this.isOnScrollbar(r,i))this.clientX=t,this.clientY=n,this.isDragging=!0,this.ctx.scrollerMove=!0,this.isFocus=!0,this.dragStart=this.scroll,e.preventDefault();else if(this.isOnTrack(r,i)){let e=0;e=this.type===`vertical`?(i-this.ctx.header.height-this.barHeight/2)/this.thumbTravelDistance*this.distance:(r-this.barWidth/2)/this.thumbTravelDistance*this.distance,this.scroll=Math.max(0,Math.min(e,this.distance))}}}onMouseUp(){this.isDragging=!1,this.isFocus=!1,this.clientX=0,this.clientY=0}onMouseMove(e,t){let{clientX:n,clientY:r,buttons:i}=e,{offsetX:a,offsetY:o}=this.ctx.getOffset(e),s=!1;if(E(this.ctx.config,t)?this.startInnerShowTimer():s=this.hideInnerScrollbar(),this.canInteractWithScrollbar()&&(this.isOnScrollbar(a,o)||this.isOnTrack(a,o))&&t?(this.isFocus=!0,this.ctx.stageElement.style.cursor=`pointer`):this.isFocus=!1,i===0||n==this.clientX&&r==this.clientY)return s;let c=0;if(c=this.type===`horizontal`?n-this.clientX:r-this.clientY,this.isDragging&&c!==0){let e=0;e=(this.type,this.dragStart+c/this.thumbTravelDistance*this.distance),this.scroll=Math.max(0,Math.min(e,this.distance))}return s}isPointInElement(e,t,n,r,i,a){return e>=n&&e<=n+i&&t>=r&&t<=r+a}hasScrollbar(){return this.type===`vertical`?this.barHeight>0:this.type===`horizontal`&&this.barWidth>0}isOnScrollbar(e,t){return this.isPointInElement(e,t,this.barX,this.barY,this.barWidth,this.barHeight)}isOnTrack(e,t){return this.isPointInElement(e,t,this.trackX,this.trackY,this.trackWidth,this.trackHeight)}isInnerMode(){return y(this.ctx.config)}shouldDrawInnerScrollbar(){return D(this.ctx.config,{innerVisible:this.innerVisible,isFocus:this.isFocus,isDragging:this.isDragging})}canInteractWithScrollbar(){return!this.isInnerMode()||this.shouldDrawInnerScrollbar()}startInnerShowTimer(){if(!this.isInnerMode()||this.innerVisible||this.innerShowTimer)return;let e=Math.max(0,this.ctx.config.SCROLLBAR_SHOW_DELAY||0);this.innerShowTimer=window.setTimeout(()=>{this.innerVisible=!0,this.innerShowTimer=0,this.ctx.emit(`draw`)},e)}cancelInnerShowTimer(){this.innerShowTimer&&=(clearTimeout(this.innerShowTimer),0)}hideInnerScrollbar(){if(!this.isInnerMode()||this.isDragging)return!1;let e=this.innerVisible||this.isFocus;return this.cancelInnerShowTimer(),this.innerVisible=!1,this.isFocus=!1,e}updateScroll(e){let t=e.deltaY;if(this.type===`vertical`&&e.shiftKey===!1)this.hasScrollbar()&&!(this.scroll===0&&t<0||this.scroll===this.distance&&t>0)&&e.preventDefault(),this.scroll=Math.max(0,Math.min(this.scroll+t,this.distance));else if(this.type===`horizontal`){let t=oe(e),n=this.hasScrollbar();t!==0&&n&&!(this.scroll===0&&t<0||this.scroll===this.distance&&t>0)&&e.preventDefault(),this.scroll=Math.max(0,Math.min(this.scroll+t,this.distance))}}updatedSize(){let{body:e,header:t,stageHeight:n,stageWidth:r,config:{SCROLLER_SIZE:i=0,BORDER:a}}=this.ctx,o=b(this.ctx.config),s=x(this.ctx.config),c=r,l=n,u=t.height,d=t.width,f=e.height,p=this.ctx.footer.height,m=l-o-u,h=c-o,g=Math.max(0,f-m+p),_=Math.max(0,d-h),v=C(this.ctx.config);if(this.type===`vertical`){this.visibleDistance=m,this.distance=g;let e=S(this.ctx.config,_>0);this.thumbTrackDistance=Math.max(0,this.visibleDistance-e),this.trackX=c-s,this.trackY=0,this.splitPoints=[this.trackX,u,this.trackX+s,u],this.trackWidth=s,this.trackHeight=Math.max(0,l-e),this.barX=this.trackX-1+(s-i)/2,this.barWidth=i,this.barHeight=ae(this.distance,this.visibleDistance,f+p,this.thumbTrackDistance),this.thumbTravelDistance=Math.max(0,this.thumbTrackDistance-this.barHeight-v);let t=this.distance?this.scroll/this.distance:0;this.barY=u+t*this.thumbTravelDistance,this.scroll=Math.max(0,Math.min(this.scroll,this.distance))}else{this.visibleDistance=h,this.distance=_;let e=S(this.ctx.config,g>0);this.thumbTrackDistance=Math.max(0,this.visibleDistance-e),this.splitPoints=[c-s,l-s,c-s,l];let t=re(a)?0:.5;this.trackX=0,this.trackY=l-s+t,this.trackWidth=Math.max(0,c-e),this.trackHeight=s,this.barWidth=ae(this.distance,this.visibleDistance,d,this.thumbTrackDistance),this.thumbTravelDistance=Math.max(0,this.thumbTrackDistance-this.barWidth-v),this.barY=this.trackY-1+(s-i)/2,this.barHeight=i;let n=this.distance?this.scroll/this.distance:0;this.barX=n*this.thumbTravelDistance,this.scroll=Math.max(0,Math.min(this.scroll,this.distance))}}draw(){let{config:{SCROLLER_FOCUS_COLOR:e,SCROLLER_COLOR:t,BORDER_COLOR:n,BORDER:r,SCROLLER_TRACK_COLOR:i}}=this.ctx;if(this.updatedSize(),this.isInnerMode()&&!this.shouldDrawInnerScrollbar())return this.isFocus||this.isDragging;let a=w(this.ctx.config),o=T(this.ctx.config),s=a&&re(r)?n:`transparent`,c=this.hasScrollbar(),l=ie(r,c);return o&&l?(this.ctx.paint.drawRect(this.trackX,this.trackY,this.trackWidth,this.trackHeight,{fillColor:i}),this.drawTrackHeaderBackground(),a&&(this.ctx.paint.drawRect(this.trackX,this.trackY,this.trackWidth,this.trackHeight,{borderColor:s}),this.drawRightBoundaryBorder())):o&&this.drawInactiveTrackBackground(),c&&this.ctx.paint.drawRect(this.barX,this.barY,this.barWidth,this.barHeight,{fillColor:this.isFocus||this.isDragging?e:t,radius:4}),a&&l&&this.splitPoints.length>0&&this.ctx.paint.drawLine(this.splitPoints,{borderColor:s,borderWidth:1}),this.isFocus||this.isDragging}drawTrackHeaderBackground(){if(this.type!==`vertical`||this.trackWidth<=0)return;let{header:e,config:{HEADER_BG_COLOR:t}}=this.ctx,n=Math.max(0,Math.min(e.height,this.trackHeight));n<=0||this.ctx.paint.drawRect(this.trackX,this.trackY,this.trackWidth,n,{fillColor:t})}drawInactiveTrackBackground(){if(this.type!==`vertical`)return;let{footer:e,header:t,scrollY:n,stageHeight:r,config:{BODY_BG_COLOR:i,FOOTER_BG_COLOR:a,FOOTER_FIXED:o,FOOTER_POSITION:s,HEADER_BG_COLOR:c,SCROLLER_TRACK_SIZE:l=0}}=this.ctx,u=Math.max(0,r-l);if(u<=0||this.trackWidth<=0||(this.ctx.paint.drawRect(this.trackX,0,this.trackWidth,u,{fillColor:i}),this.ctx.paint.drawRect(this.trackX,0,this.trackWidth,t.height,{fillColor:c}),!e.height))return;let d=o?s===`top`?t.height:u-e.height:e.y-n,f=Math.max(t.height,Math.min(d,u)),p=Math.max(0,Math.min(e.height,u-f));p>0&&this.ctx.paint.drawRect(this.trackX,f,this.trackWidth,p,{fillColor:a})}drawRightBoundaryBorder(){let{stageHeight:e,config:{BORDER:t,BORDER_COLOR:n,SCROLLER_TRACK_SIZE:r=0}}=this.ctx;this.type}},It=class{constructor(e){K(this,`ctx`),K(this,`verticalScrollbar`),K(this,`horizontalScrollbar`),K(this,`mousedownHeader`,!1),K(this,`adjustPositionX`,``),K(this,`adjustPositionY`,``),K(this,`timerX`,0),K(this,`timerY`,0),this.ctx=e,this.verticalScrollbar=new Ft(e,`vertical`),this.horizontalScrollbar=new Ft(e,`horizontal`),this.ctx.on(`wheel`,e=>this.onWheel(e)),this.ctx.on(`mousedown`,e=>this.onMouseDown(e)),this.ctx.on(`mousemove`,e=>this.onMouseMove(e)),this.ctx.on(`mouseup`,()=>this.onMouseUp()),this.ctx.on(`mouseout`,e=>this.onMouseOut(e)),this.ctx.on(`touchmove`,e=>this.onTouchmove(e)),this.ctx.on(`touchstart`,e=>{this.onTouchstart(e)}),this.ctx.on(`setScroll`,(e,t)=>{this.setScroll(e,t)}),this.ctx.on(`setScrollX`,e=>{this.setScrollX(e)}),this.ctx.on(`setScrollY`,e=>{this.setScrollY(e)}),this.ctx.on(`scrollToIndex`,(e,t,n=`body`)=>{this.scrollToIndex(e,t,n)}),this.ctx.on(`cellHeaderMousedown`,()=>{this.mousedownHeader=!0}),this.ctx.on(`startAdjustPosition`,e=>{this.startAdjustPosition(e)}),this.ctx.on(`stopAdjustPosition`,()=>{this.stopAdjustPosition()})}onWheel(e){this.verticalScrollbar.onWheel(e),this.horizontalScrollbar.onWheel(e),this.draw()}onTouchmove(e){this.verticalScrollbar.onTouchmove(e),this.horizontalScrollbar.onTouchmove(e),this.draw()}onTouchstart(e){this.verticalScrollbar.onTouchstart(e),this.horizontalScrollbar.onTouchstart(e),this.draw()}onMouseDown(e){this.verticalScrollbar.onMouseDown(e),this.horizontalScrollbar.onMouseDown(e),this.draw()}onMouseMove(e){let t=this.ctx.containerElement.getBoundingClientRect(),n=e.clientX>=t.left&&e.clientX<=t.right&&e.clientY>=t.top&&e.clientY<=t.bottom,r=this.verticalScrollbar.onMouseMove(e,n),i=this.horizontalScrollbar.onMouseMove(e,n);r||i?this.ctx.emit(`draw`):this.draw()}onMouseUp(){this.mousedownHeader=!1,this.verticalScrollbar.onMouseUp(),this.horizontalScrollbar.onMouseUp(),this.ctx.scrollerMove=!1}onMouseOut(e){this.ctx.containerElement.contains(e.relatedTarget)||(this.verticalScrollbar.hideInnerScrollbar(),this.horizontalScrollbar.hideInnerScrollbar(),this.ctx.emit(`draw`))}draw(){let e=this.verticalScrollbar.draw(),t=this.horizontalScrollbar.draw();this.ctx.scrollerFocus=e||t;let n=Math.floor(this.horizontalScrollbar.scroll),r=Math.floor(this.verticalScrollbar.scroll);(n!==this.ctx.scrollX||r!==this.ctx.scrollY)&&(this.ctx.emit(`onScroll`,n,r),n!==this.ctx.scrollX&&this.ctx.emit(`onScrollX`,n),r!==this.ctx.scrollY&&this.ctx.emit(`onScrollY`,r),this.ctx.scrollX=n,this.ctx.scrollY=r,this.ctx.emit(`draw`))}setScroll(e,t){this.horizontalScrollbar.scroll=e,this.verticalScrollbar.scroll=t,this.ctx.emit(`draw`),this.ctx.emit(`onScroll`,e,t)}setScrollX(e){this.horizontalScrollbar.scroll=e,this.ctx.emit(`draw`)}setScrollY(e){this.verticalScrollbar.scroll=e,this.ctx.emit(`draw`)}scrollToColkey(e){let{header:t}=this.ctx,n=t.leafCellHeaders.find(t=>t.key===e);n&&this.setScrollX(n.x-t.visibleWidth/2)}scrollToColIndex(e){let{header:t}=this.ctx,n=t.leafCellHeaders.find(t=>t.colIndex===e);n&&this.setScrollX(n.x-t.visibleWidth/2)}scrollToRowIndex(e){let{body:t,database:n}=this.ctx,{top:r}=n.getPositionForRowIndex(e);this.setScrollY(r-t.visibleHeight/2)}scrollToFooterRowIndex(e){let{body:t,config:n,footer:r}=this.ctx;if(n.FOOTER_FIXED)return;let i=r.renderRows.find(t=>t.rowIndex===e);i&&this.setScrollY(i.y-t.y-(t.visibleHeight-i.height)/2)}scrollToIndex(e,t,n=`body`){n===`body`?this.scrollToRowIndex(e):n===`footer`&&this.scrollToFooterRowIndex(e),this.scrollToColIndex(t)}scrollToRowKey(e){let{body:t,database:n}=this.ctx,r=n.getRowIndexForRowKey(e);if(r===void 0)return;let{top:i}=n.getPositionForRowIndex(r);this.setScrollY(i-t.visibleHeight/2)}startAdjustPosition(e){let{offsetX:t,offsetY:n}=this.ctx.getOffset(e),r=``,i=``;if(this.ctx.focusCell?.fixed!==`left`&&t<this.ctx.fixedLeftWidth?r=`left`:this.ctx.focusCell?.fixed!==`right`&&t>this.ctx.body.visibleWidth-this.ctx.fixedRightWidth?r=`right`:(r=``,this.stopAdjustPosition(!0,!1)),!this.mousedownHeader&&n<this.ctx.header.visibleHeight?i=`top`:n>this.ctx.header.visibleHeight+this.ctx.body.visibleHeight?i=`bottom`:(i=``,this.stopAdjustPosition(!1,!0)),r&&this.adjustPositionX!==r){this.adjustPositionX=r;let e=10*(r===`left`?-1:1);this.timerX&&=(clearInterval(this.timerX),0),this.timerX=setInterval(()=>{e*=1.5;let{scrollX:t}=this.ctx,n=t+e;(n<0||n>this.ctx.body.width)&&(clearInterval(this.timerX),this.timerX=0),this.ctx.setScrollX(n)},100)}if(i&&this.adjustPositionY!==i){this.adjustPositionY=i;let e=10*(i===`top`?-1:1);this.timerY&&=(clearInterval(this.timerY),0),this.timerY=setInterval(()=>{e*=1.5;let{scrollY:t}=this.ctx,n=t+e;(n<0||n>this.ctx.body.height)&&(clearInterval(this.timerY),this.timerY=0),this.ctx.setScrollY(n)},100)}}stopAdjustPosition(e=!0,t=!0){e&&(this.adjustPositionX=``,this.timerX&&=(clearInterval(this.timerX),0)),t&&(this.adjustPositionY=``,this.timerY&&=(clearInterval(this.timerY),0))}},Lt=class extends dt{constructor(e,n,r,i,a,o,s){super(e,r,i,a,o,`header`,s.fixed),K(this,`align`),K(this,`hideHeaderSelection`,!1),K(this,`verticalAlign`,`middle`),K(this,`fixed`),K(this,`minWidth`),K(this,`maxWidth`),K(this,`formatterFinderHeaderValue`),K(this,`widthFillDisable`),K(this,`type`),K(this,`operation`,!1),K(this,`editorType`),K(this,`level`),K(this,`text`),K(this,`hide`,!1),K(this,`displayText`,``),K(this,`colspan`),K(this,`rowspan`),K(this,`row`),K(this,`key`),K(this,`required`,!1),K(this,`readonly`,!1),K(this,`ellipsis`,!1),K(this,`overflowTooltipShow`,!0),K(this,`children`,[]),K(this,`column`),K(this,`colIndex`),K(this,`rowKey`),K(this,`rules`),K(this,`hasChildren`),K(this,`render`),K(this,`style`,{}),K(this,`drawX`,0),K(this,`drawY`,0),K(this,`sortIconName`,`sort-default`),K(this,`sortAscIconName`,`sort-asc`),K(this,`sortDescIconName`,`sort-desc`),K(this,`visibleWidth`,0),K(this,`visibleHeight`,0),K(this,`maxLineClampHeader`,`auto`),K(this,`domDataset`,{}),K(this,`textOffsetRight`,0),K(this,`textOffsetLeft`,0),K(this,`textInfo`),K(this,`drawTextX`,0),K(this,`drawTextY`,0),K(this,`drawTextWidth`,0),K(this,`drawTextHeight`,0),K(this,`drawCellBgColor`,``),K(this,`drawTextColor`,``),K(this,`drawTextFont`,``),K(this,`drawSelectionImageX`,0),K(this,`drawSelectionImageY`,0),K(this,`drawSelectionImageWidth`,0),K(this,`drawSelectionImageHeight`,0),K(this,`drawSelectionImageName`,``),K(this,`drawSelectionImageSource`),K(this,`drawSortImageX`,0),K(this,`drawSortImageY`,0),K(this,`drawSortImageWidth`,0),K(this,`drawSortImageHeight`,0),K(this,`drawSortImageName`,``),K(this,`drawSortImageSource`),K(this,`renderHeaderType`,`default`),this.ctx=e,this.x=r,this.y=i,this.width=a,this.height=o,this.visibleWidth=a,this.visibleHeight=o,this.colIndex=n,this.key=s.key,this.minWidth=s.minWidth,this.maxWidth=s.maxWidth,this.formatterFinderHeaderValue=s.formatterFinderHeaderValue,this.hide=(typeof s.hide==`function`?s.hide(s):s.hide)||!1,this.type=s.type||``,this.editorType=s.editorType||`text`,this.hideHeaderSelection=s.hideHeaderSelection||!1,this.align=s.headerAlign||s.align||this.ctx.config.COLUMNS_ALIGN,this.verticalAlign=s.headerVerticalAlign||s.verticalAlign||this.ctx.config.COLUMNS_VERTICAL_ALIGN,this.fixed=s.fixed||``,this.level=s.level||0,this.operation=s.operation||!1,this.text=s.title,this.column=s,this.colspan=s.colspan||1,this.widthFillDisable=s.widthFillDisable||!1,this.rowspan=s.rowspan||1,this.rules=s.rules,this.readonly=typeof s.readonly==`boolean`&&s.readonly,this.required=s.required||!1,this.sortIconName=s.sortIconName||`sort-default`,this.sortAscIconName=s.sortAscIconName||`sort-asc`,this.sortDescIconName=s.sortDescIconName||`sort-desc`,this.rowKey=t(),this.overflowTooltipShow=s.overflowTooltipHeaderShow!==!1,this.hasChildren=s.children&&s.children.length>0||!1,this.render=s.renderHeader,this.maxLineClampHeader=s.maxLineClampHeader||`auto`,this.renderHeaderType=s.renderHeaderType||`default`}isVerticalVisible(){let{stageHeight:e}=this.ctx,t=e;return!(this.y+this.height<=0||this.y>=t)}updateStyle(){this.style=this.getOverlayerViewsStyle()}updateContainer(){let{HEADER_CELL_STYLE_METHOD:e,HEADER_BG_COLOR:t,HEADER_TEXT_COLOR:n}=this.ctx.config,r=t,i=n;if(typeof e==`function`){let{backgroundColor:t,color:n,font:a}=e({colIndex:this.colIndex,column:this.column})||{};t&&(r=t),n&&(i=n),a&&(this.drawTextFont=a)}let{colKey:a,type:o}=this.ctx.finderBar;o===`header`&&a===this.key&&(r=this.ctx.config.FINDER_CELL_BG_COLOR),this.drawCellBgColor=r,this.drawTextColor=i}updateOffset(){this.column.sortBy&&(this.textOffsetRight=16),this.required&&(this.textOffsetLeft=12)}update(){this.updateContainer(),this.updateOffset(),this.displayText=this.getText(),this.drawX=this.getDrawX(),this.drawY=this.getDrawY(),this.drawTextX=this.drawX,this.drawTextY=this.drawY,this.drawTextWidth=this.width,this.drawTextHeight=this.height,this.updateSelection(),this.updateStyle()}draw(){this.drawEdge(),this.drawText(),this.drawBg(),this.updateSortIcon(),this.drawImages(),this.drawRequired()}drawImages(){this.getImages().forEach(e=>{e.visible&&e.source&&this.ctx.paint.drawImage(e.source,e.x,e.y,e.width,e.height)})}getFinderText(){let e=this.displayText;if(typeof this.formatterFinderHeaderValue!=`function`)return e;let t=this.formatterFinderHeaderValue({rowIndex:this.level,colIndex:this.colIndex,column:this.column,value:this.text,displayText:e});return t==null?e:`${t}`}drawEdge(){let{paint:e,config:t}=this.ctx,n=ee(t),r=k(t.BORDER)&&n===void 0;e.drawRect(this.drawX,this.drawY,this.width,this.height,{borderColor:r?t.BORDER_COLOR:void 0,fillColor:this.drawCellBgColor}),r||(this.drawColumnDivider(n),this.drawHorizontalDivider())}drawColumnDivider(e){let{paint:t,header:n,config:r,fixedLeftWidth:i,fixedRightWidth:a,scrollX:o,stageWidth:s}=this.ctx;if(e===void 0)return;let c=o>0?i:void 0,l=o<Math.floor(n.width-s-1)?n.width-a+b(r):void 0,u=te(this.fixed,this.x,this.width,n.width,{fixedLeftEnd:c,fixedRightStart:l});if(!u)return;let d=u===`left`?this.drawX:this.drawX+this.visibleWidth;t.drawLine([d,this.drawY,d,this.drawY+this.visibleHeight],{borderColor:e,borderWidth:1})}drawHorizontalDivider(){let{paint:e,config:t,header:n}=this.ctx;if(!k(t.BORDER)||this.y+this.height>=n.height)return;let r=this.drawY+this.visibleHeight;e.drawLine([this.drawX,r,this.drawX+this.visibleWidth,r],{borderColor:t.BORDER_COLOR,borderWidth:1})}drawText(){let{paint:e,config:{HEADER_FONT:t,CELL_PADDING:n}}=this.ctx,r=`${this.displayText}_${this.drawTextWidth}_${this.drawTextFont}`;this.ellipsis=e.drawText(this.displayText,this.drawTextX,this.drawTextY,this.drawTextWidth,this.drawTextHeight,{font:this.drawTextFont||t,padding:n,color:this.drawTextColor,align:this.align,verticalAlign:this.verticalAlign,maxLineClamp:this.maxLineClampHeader,offsetRight:this.textOffsetRight,offsetLeft:this.textOffsetLeft,cacheTextKey:r,textCallback:e=>{this.textInfo=e},layoutCallback:e=>{this.ctx.emit(`registerTextLayout`,`${this.cellType}-${this.colIndex}-${this.level}`,e)}})}drawRequired(){if(!this.required||!this.textInfo)return;let{left:e,top:t,height:n}=this.textInfo,{paint:r,config:{REQUIRED_COLOR:i}}=this.ctx;r.drawText(`*`,e-18,t+(n-12)/2,24,24,{color:i,font:`18px Arial`,align:`center`,verticalAlign:`middle`,padding:0})}drawBg(){if(this.ctx.dragHeaderIng)return;let{ENABLE_SELECTOR:e,ENABLE_SELECTOR_SINGLE:t}=this.ctx.config,n=-1,r=-1;if(this.ctx.focusCellHeader&&(n=this.ctx.focusCellHeader.colIndex,r=this.ctx.focusCellHeader.colIndex+this.ctx.focusCellHeader.colspan-1),e&&!t){let{xArr:e}=this.ctx.selector;n=e[0],r=e[1]}let i=this.colspan+this.colIndex-1;this.colIndex>=n&&this.colIndex<=r&&i<=r&&this.ctx.paint.drawRect(this.drawX,this.drawY,this.width,this.height,{borderColor:`transparent`,fillColor:this.ctx.config.SELECT_ROW_COL_BG_COLOR||`transparent`})}updateSelection(){if([`index-selection`,`selection`,`selection-tree`,`tree-selection`].includes(this.type)){let{indeterminate:e,check:t,selectable:n}=this.ctx.database.getCheckedState(),{CHECKBOX_SIZE:r=0,CELL_PADDING:i}=this.ctx.config,a=this.drawX+(this.width-r)/2,o=this.drawY+(this.height-r)/2;this.drawTextX=a+r-i/2,this.drawTextWidth=this.drawX+this.visibleWidth-this.drawTextX,(this.align===`left`||this.align===`right`)&&(a=this.drawX+i,this.drawTextX=a+r-i/2,this.drawTextWidth=this.drawX+this.visibleWidth-this.drawTextX),this.verticalAlign===`top`?o=this.drawY+i/2:this.verticalAlign===`bottom`&&(o=this.drawY+this.height-r-i/2),this.column.dragRow&&(a+=this.ctx.config.DRAG_ROW_ICON_SIZE,this.drawTextX+=this.ctx.config.DRAG_ROW_ICON_SIZE,this.drawTextWidth-=this.ctx.config.DRAG_ROW_ICON_SIZE);let s=this.ctx.icons.get(`checkbox-uncheck`),c=`checkbox-uncheck`;e?(s=this.ctx.icons.get(`checkbox-indeterminate`),c=`checkbox-indeterminate`):t&&n?(s=this.ctx.icons.get(`checkbox-check`),c=`checkbox-check`):t&&!n?(s=this.ctx.icons.get(`checkbox-check-disabled`),c=`checkbox-check-disabled`):!t&&n?(s=this.ctx.icons.get(`checkbox-uncheck`),c=`checkbox-uncheck`):(s=this.ctx.icons.get(`checkbox-disabled`),c=`checkbox-disabled`);let l=new q(c,a,o,r,r,s);l.setVisible(!this.hideHeaderSelection),this.setImage(`selection`,l)}}updateSortIcon(){if(!this.column.sortBy||!this.textInfo)return;let{right:e,top:t,height:n}=this.textInfo,r=e+4,i=t+(n-16)/2,a=this.sortIconName,o=this.ctx.database.getSortState(this.key);o.direction===`asc`?a=this.sortAscIconName:o.direction===`desc`&&(a=this.sortDescIconName);let s=this.ctx.icons.get(a),c=new q(a,r,i,16,16,s);this.setImage(`sort`,c)}getText(){return this.render&&this.renderHeaderType==="default"||[``,null,void 0].includes(this.text)?``:`${this.text}`}getOverlayerViewsStyle(){let e=``;return e=this.fixed===`left`?`${this.drawX}px`:this.fixed===`right`?`${this.drawX-(this.ctx.stageWidth-this.ctx.fixedRightWidth)}px`:`${this.drawX-this.ctx.fixedLeftWidth}px`,{position:`absolute`,overflow:`hidden`,left:e,top:`${this.drawY+1}px`,width:`${this.width}px`,height:`${this.height-2}px`,pointerEvents:`initial`,userSelect:`none`}}},Rt=class{constructor(e,t){K(this,`root`),K(this,`key`),K(this,`childrenKey`),this.root=e,this.key=t?.key||`key`,this.childrenKey=t?.childrenKey||`children`}getTree(){return this.root}treeMove(e,t,n){if(n===`none`||String(e)===String(t))return;let r=this.findNodeWithParent(this.root,e);if(!r)return;let i=this.findNodeWithParent(this.root,t);if(!i)return;let{parent:a,index:o,node:s}=r,{parent:c,index:l,node:u}=i;if(this.isDescendant(s,t))return;let d=a?a[this.childrenKey]:this.root;if(d.splice(o,1),a&&d.length===0&&delete a[this.childrenKey],n===`inside`){Array.isArray(u[this.childrenKey])||(u[this.childrenKey]=[]),u[this.childrenKey].push(s);return}let f=c?c[this.childrenKey]:this.root,p=l;a===c&&o<l&&p--,n===`after`&&p++,f.splice(p,0,s)}getNodeKey(e){return typeof this.key==`function`?this.key(e):e[this.key]}isSameKey(e,t){return e==null||t==null?!1:String(e)===String(t)}findNodeWithParent(e,t,n=null){for(let r=0;r<e.length;r++){let i=e[r];if(this.isSameKey(this.getNodeKey(i),t))return{parent:n,index:r,node:i};let a=i[this.childrenKey];if(Array.isArray(a)){let e=this.findNodeWithParent(a,t,i);if(e)return e}}return null}isDescendant(e,t){let n=e[this.childrenKey];if(!Array.isArray(n))return!1;for(let e of n)if(this.isSameKey(this.getNodeKey(e),t)||this.isDescendant(e,t))return!0;return!1}},zt=class{constructor(e){K(this,`ctx`),K(this,`x`,0),K(this,`y`,0),K(this,`width`,0),K(this,`height`,0),K(this,`resizeTarget`,null),K(this,`dragTarget`,null),K(this,`dragingCell`),K(this,`dragCellDiff`,0),K(this,`resizeNum`,0),K(this,`isResizing`,!1),K(this,`clientX`,0),K(this,`resizeDiff`,0),K(this,`columnIndex`,0),K(this,`isMouseDown`,!1),K(this,`columns`),K(this,`visibleColumns`),K(this,`visibleLeafColumns`,[]),K(this,`visibleHeight`,0),K(this,`visibleWidth`,0),K(this,`allCellHeaders`,[]),K(this,`leafCellHeaders`,[]),K(this,`renderLeafCellHeaders`,[]),K(this,`fixedLeftCellHeaders`,[]),K(this,`centerCellHeaders`,[]),K(this,`fixedRightCellHeaders`,[]),K(this,`renderCenterCellHeaders`,[]),K(this,`renderFixedCellHeaders`,[]),this.ctx=e,this.ctx.on(`resetHeader`,n(()=>{this.init(),this.ctx.clearSelector(),this.ctx.emit(`draw`)},100)),this.init(),this.initSelection(),this.initSort(),this.initResizeColumn(),this.initDragColumn()}init(e=!1){let{config:{HEADER_HEIGHT:t}}=this.ctx,n=b(this.ctx.config);if(!e){let e=this.ctx.database.getColumns();this.columns=e}this.allCellHeaders=[],this.leafCellHeaders=[],this.fixedLeftCellHeaders=[],this.fixedRightCellHeaders=[],this.centerCellHeaders=[],this.visibleColumns=s(this.columns);let c=r(this.visibleColumns),l=o(this.visibleColumns);this.height=t*c,this.visibleHeight=this.height,this.width=l.reduce((e,t)=>{let n=t.width||100,{maxWidth:r,minWidth:i}=t;return r&&n>r?e+r:i&&n<i?e+i:e+n},0),this.columnIndex=0,this.resizeNum=0;let u=i(a(this.visibleColumns,c));this.render(u,0),this.ctx.database.updateColIndexKeyMap(this.leafCellHeaders);let d=this.ctx.containerElement.getBoundingClientRect();this.resizeNum>0?this.ctx.stageWidth=Math.floor(d.width):this.ctx.stageWidth=Math.min(Math.floor(this.width+n),Math.floor(d.width)),this.ctx.stageElement.style.width=`${this.ctx.stageWidth}px`,this.visibleWidth=this.ctx.stageWidth-n;let f=this.visibleWidth-this.width;if(this.resizeNum&&f>0){let e=Math.floor(f/this.resizeNum*100)/100;this.resizeAllColumn(e)}let p=this.fixedLeftCellHeaders.filter(e=>!e.hasChildren);this.ctx.fixedLeftWidth=p.reduce((e,t)=>e+t.width,0);let m=this.fixedRightCellHeaders.filter(e=>!e.hasChildren);this.ctx.fixedRightWidth=m.reduce((e,t)=>e+t.width,n),this.ctx.maxColIndex=this.leafCellHeaders.length-1,this.ctx.header.x=this.x,this.ctx.header.y=this.y,this.ctx.header.width=this.width,this.ctx.header.height=this.height,this.ctx.header.allCellHeaders=this.allCellHeaders,this.ctx.header.visibleWidth=this.visibleWidth,this.ctx.header.visibleHeight=this.visibleHeight}initSort(){this.ctx.on(`cellHeaderClick`,(e,t)=>{if(!e.isImageInside(`sort`,t))return;let{sortIconType:n=`up-down`}=e.column,r=e.getImageClickDirection(`sort`,t),i=`none`,a=this.ctx.database.getSortState(e.key);function o(e,t){return e===`none`?t:e===t?`none`:t}n===`loop`?i=a.direction===`none`?`asc`:a.direction===`asc`?`desc`:`none`:r&&n===`up-down`?r.includes(`up`)?i=o(a.direction,`asc`):r.includes(`down`)&&(i=o(a.direction,`desc`)):r&&n===`left-right`&&(r.includes(`left`)?i=o(a.direction,`asc`):r.includes(`right`)&&(i=o(a.direction,`desc`))),this.ctx.database.setSortState(e.key,i)})}initSelection(){this.ctx.on(`cellHeaderClick`,(e,t)=>{if(this.ctx.stageElement.style.cursor!==`pointer`||!e.isImageInside(`selection`,t))return;let n=e.getImage(`selection`);[`checkbox-uncheck`,`checkbox-indeterminate`].includes(n.name)?this.ctx.database.toggleAllSelection():n.name===`checkbox-check`&&this.ctx.database.clearSelection(!0)})}initResizeColumn(){this.ctx.on(`mousedown`,e=>{this.ctx.config.ENABLE_RESIZE_COLUMN&&this.ctx.isTarget(e)&&(this.clientX=e.clientX,this.resizeTarget?(this.isResizing=!0,this.ctx.columnResizing=!0):this.isResizing=!1,this.isMouseDown=!0)}),this.ctx.on(`mouseup`,()=>{this.ctx.config.ENABLE_RESIZE_COLUMN&&(this.isMouseDown=!1,this.resizeDiff!==0&&this.resizeTarget&&this.resizeColumn(this.resizeTarget,this.resizeDiff),this.resizeTarget=null,this.isResizing=!1,this.isMouseDown=!1,this.ctx.columnResizing=!1,this.clientX=0,this.resizeDiff=0)}),this.ctx.on(`mousemove`,e=>{if(!this.ctx.config.ENABLE_RESIZE_COLUMN||this.ctx.editing)return;let{stageWidth:t,config:{RESIZE_COLUMN_MIN_WIDTH:n}}=this.ctx;if(this.isResizing&&this.resizeTarget){let t=this.resizeTarget.width,r=this.resizeTarget.minWidth,i=this.resizeTarget.maxWidth,a=e.clientX-this.clientX;a+t<n&&(a=-(t-n)),r&&a+t<r&&(a=-(t-r)),i&&a+t>i&&(a=i-t),this.resizeDiff=a,this.ctx.emit(`draw`)}else{if(this.resizeTarget=null,this.isMouseDown)return;let{offsetX:n}=this.ctx.getOffset(e);if(n<0||n>this.visibleWidth){this.ctx.stageElement.style.cursor===`col-resize`&&(this.ctx.stageElement.style.cursor=`default`);return}this.ctx.stageElement.style.cursor===`col-resize`&&(this.ctx.stageElement.style.cursor=`default`);let r=[...this.renderFixedCellHeaders,...this.renderCenterCellHeaders];for(let n of r){let{offsetX:r,offsetY:i}=this.ctx.getOffset(e),a=r,o=i,s=n.getDrawX(),c=n.getDrawY();if(a>s+n.width-5&&a<s+n.width+4&&a<t-4&&o>c){let t=n.colIndex+n.colspan-1,r=this.leafCellHeaders.find(e=>e.colIndex===t);if(!r||!r.fixed&&this.ctx.stageWidth-this.ctx.fixedRightWidth<s+n.width)return;this.ctx.isTarget(e)&&i<=this.height&&(this.ctx.stageElement.style.cursor=`col-resize`,this.resizeTarget=r)}}}})}initDragColumn(){this.ctx.on(`cellHeaderMousedown`,e=>{this.ctx.stageElement.style.cursor==="default"&&this.ctx.config.ENABLE_DRAG_COLUMN&&(e.column.dragDisabled||(this.dragTarget===e?(this.ctx.dragHeaderIng=!0,this.dragCellDiff=this.ctx.mouseX-e.drawX,this.ctx.stageElement.style.cursor=`grabbing`):(this.dragTarget=e,this.ctx.dragHeaderIng=!1)))}),this.ctx.on(`cellMousedown`,()=>{this.ctx.config.ENABLE_DRAG_COLUMN&&(this.dragTarget=null,this.ctx.dragHeaderIng=!1)}),this.ctx.on(`mouseup`,()=>{if(this.ctx.config.ENABLE_DRAG_COLUMN){if(this.dragingCell&&this.dragTarget){let e=(t,n={})=>(t.forEach((t,r)=>{t.children&&e(t.children,n),n[t.key]=r}),n),t=this.ctx.database.getColumns(),n=a(t,r(t)),i=new Rt(n,{key:`key`,childrenKey:`children`}),o=this.dragTarget.colIndex>this.dragingCell.colIndex?`before`:`after`;i.treeMove(this.dragTarget.column.key,this.dragingCell.column.key,o);let s=e(i.getTree());this.ctx.database.setCustomHeader({sortData:s}),this.init();let c={source:this.dragTarget,target:this.dragingCell,columns:n};this.ctx.emit(`columnDragChange`,c)}this.ctx.dragHeaderIng&&this.dragTarget&&(this.ctx.stageElement.style.cursor===`grabbing`&&(this.ctx.stageElement.style.cursor=`default`),this.ctx.dragHeaderIng=!1,this.dragTarget=null,this.dragingCell=void 0,this.dragCellDiff=0,this.ctx.clearSelector(),this.ctx.focusCellHeader=void 0,this.ctx.emit(`draw`))}}),this.ctx.on(`mousemove`,e=>{this.ctx.config.ENABLE_DRAG_COLUMN&&(!this.ctx.dragHeaderIng||!this.dragTarget||(this.dragTarget.fixed||this.ctx.startAdjustPosition(e),this.ctx.emit(`draw`)))}),this.ctx.on(`cellHoverChange`,e=>{this.ctx.config.ENABLE_DRAG_COLUMN&&(e.column.dragDisabled||(this.dragingCell=this.getDragCellHeader(e.colIndex)))}),this.ctx.on(`cellHeaderHoverChange`,e=>{this.ctx.config.ENABLE_DRAG_COLUMN&&(e.column.dragDisabled||(this.dragingCell=this.getDragCellHeader(e.colIndex)))})}getDragCellHeader(e){if(!this.dragTarget||!this.ctx.dragHeaderIng)return;let{column:{parentKey:t},key:n,level:r,fixed:i}=this.dragTarget,a=this.allCellHeaders.find(a=>a.key!==n&&a.fixed===i&&a.column.level===r&&a.column.parentKey===t&&a.colIndex<=e&&a.colIndex+a.colspan-1>=e);if(this.ctx.dragHeaderIng){let e=a?`grabbing`:`not-allowed`;this.ctx.stageElement.style.cursor=e}return a}resizeColumn(e,t){let n=r=>{r.forEach(r=>{r.children&&r.children.length>0&&n(r.children),r.key===e.key&&(r.width=(r.width||100)+t)})};n(this.columns);let r=0;if(this.width<this.visibleWidth){let e=this.visibleWidth-this.width;r=Math.floor(e/this.resizeNum*100)/100,this.resizeAllColumn(r)}let i=e.width+t+r;this.ctx.emit(`resizeColumnChange`,{colIndex:e.colIndex,key:e.key,oldWidth:e.width,width:i,column:e.column,columns:this.columns}),this.ctx.database.setCustomHeaderResizableData(e.key,i),this.init(!0),this.ctx.emit(`draw`)}resizeAllColumn(e){if(e===0)return;let t=/* @__PURE__ */ new Map,n=!0;for(let r of this.allCellHeaders)if(r.widthFillDisable)t.set(r.key,r.width);else{let i=r.width+e*r.colspan;t.set(r.key,i),i<this.ctx.config.RESIZE_COLUMN_MIN_WIDTH&&(n=!1)}if(!n)return;let r=e=>{e.forEach(e=>{t.has(e.key)&&(e.width=t.get(e.key)),e.children&&e.children.length>0&&r(e.children)})};r(this.columns),this.init(!0),this.ctx.emit(`draw`)}getCustomHeader(){let e=this.ctx.database.getColumns(),t=this.ctx.database.getCustomHeader(),{sortData:n={}}=t;return Object.keys(n).length===0?{columns:e,customHeader:t}:{columns:a(e,r(e)),customHeader:t}}render(e,t){let n=e.length,r=t,{HEADER_HEIGHT:i=0}=this.ctx.config;for(let t=0;t<n;t++){let n=e[t],a=i*(n.rowspan||0),s=i*(n.level||0),{minWidth:c,maxWidth:l}=n,u=n.width||100;c&&u<c&&(u=c),l&&u>l&&(u=l),n.children&&(u=o(n.children).reduce((e,t)=>e+(t?.width||100),0));let d=new Lt(this.ctx,this.columnIndex,r,s,u,a,n);this.ctx.database.setHeader(n.key,d),this.allCellHeaders.push(d),n.children||(this.leafCellHeaders.push(d),d.column.widthFillDisable||this.resizeNum++),n.fixed===`left`?this.fixedLeftCellHeaders.push(d):n.fixed===`right`?this.fixedRightCellHeaders.push(d):this.centerCellHeaders.push(d),!n.children&&this.columnIndex++,n.children&&this.render(n.children,r),r+=u}}drawTipLine(){if(this.isResizing&&this.resizeTarget){let{stageHeight:e,config:{RESIZE_COLUMN_LINE_COLOR:t,RESIZE_COLUMN_TEXT_COLOR:n,RESIZE_COLUMN_TEXT_BG_COLOR:r,ENABLE_RESIZE_COLUMN_TEXT:i}}=this.ctx,a=this.resizeTarget.getDrawX(),o=this.resizeTarget.width,s=a+o+this.resizeDiff-.5,c=[s-.5,0,s-.5,e];if(this.ctx.paint.drawLine(c,{borderColor:t}),i){let e=`${Math.floor(o+this.resizeDiff)}px`;this.ctx.paint.drawRect(s+45/2,this.ctx.mouseY-12,45,24,{fillColor:r,borderWidth:0,borderColor:`transparent`}),this.ctx.paint.drawText(e,s+45/2,this.ctx.mouseY-12,45,26,{padding:0,color:n,align:`center`,verticalAlign:`middle`})}}}drawDragTip(){if(this.dragTarget&&this.ctx.dragHeaderIng){let{DRAG_TIP_BG_COLOR:e,DRAG_TIP_LINE_COLOR:t}=this.ctx.config,n=this.dragTarget.width;if(this.ctx.paint.drawRect(this.ctx.mouseX-this.dragCellDiff,this.visibleHeight,n,this.ctx.body.visibleHeight,{fillColor:e,borderWidth:0,borderColor:`transparent`}),this.dragingCell){let{drawX:e,drawY:n,visibleWidth:r,colIndex:i}=this.dragingCell,a=e,o=n;i>this.dragTarget.colIndex&&(a=e+r),i===0&&(a+=1),i===this.ctx.maxColIndex&&--a;let s=[a,o,a,this.ctx.stageHeight],c=[a-4,o,a+4,o,a,o+6,a-4,o];this.ctx.paint.drawLine(c,{borderColor:t,borderWidth:1.2,fillColor:t}),this.ctx.paint.drawLine(s,{borderColor:t,borderWidth:1.2})}}}drawFixedShadow(){let{fixedLeftWidth:e,fixedRightWidth:t,scrollX:n,header:r,stageWidth:i,config:{HEADER_BG_COLOR:a,FIXED_COLUMN_SHADOW_COLOR:o,FIXED_COLUMN_SHADOW_FADE_COLOR:s,FIXED_COLUMN_SHADOW_WIDTH:c}}=this.ctx,l=b(this.ctx.config);if(n>0&&e!==0&&this.ctx.paint.drawShadow(this.x,this.y,e,this.height,{fillColor:a,side:`right`,shadowWidth:c,colorStart:o,colorEnd:s}),n<Math.floor(r.width-i-1)&&t!==l){let e=r.width-(this.x+this.width)+i-t;this.ctx.paint.drawShadow(e,this.y,t,this.height,{fillColor:a,side:`left`,shadowWidth:c,colorStart:s,colorEnd:o})}}update(){let e=[],t=[],n=[];if(this.centerCellHeaders.length){let e=this.centerCellHeaders[this.centerCellHeaders.length-1];this.ctx.lastCenterColIndex=e.colIndex}this.centerCellHeaders.forEach(n=>{n.isHorizontalVisible()&&n.isVerticalVisible()&&(t.push(n),n.hasChildren||e.push(n))}),this.fixedLeftCellHeaders.forEach(t=>{n.push(t),t.hasChildren||e.push(t)}),this.fixedRightCellHeaders.forEach(t=>{n.push(t),t.hasChildren||e.push(t)}),this.renderCenterCellHeaders=t,this.renderFixedCellHeaders=n,this.renderLeafCellHeaders=e.sort((e,t)=>e.x-t.x),this.visibleLeafColumns=this.renderLeafCellHeaders.map(e=>e.column),this.ctx.header.visibleLeafColumns=this.visibleLeafColumns,this.ctx.header.leafCellHeaders=this.leafCellHeaders,this.ctx.header.renderLeafCellHeaders=this.renderLeafCellHeaders,this.ctx.header.renderCellHeaders=this.renderFixedCellHeaders.concat(this.renderCenterCellHeaders)}drawBottomLine(){let{stageWidth:e,config:t}=this.ctx,{BORDER:n}=t;if(!A(n))return;let r=[0,this.height,e,this.height];this.ctx.paint.drawLine(r,{borderColor:t.BORDER_COLOR,borderWidth:1})}draw(){this.renderCenterCellHeaders.forEach(e=>{e.update(),e.draw()}),this.drawFixedShadow(),this.renderFixedCellHeaders.forEach(e=>{e.update(),e.draw()}),this.drawBottomLine(),this.drawTipLine(),this.drawDragTip()}},Bt=class{constructor(e,t,n=0,r=0,i=0,a=0,o,s=`body`){K(this,`ctx`),K(this,`x`,0),K(this,`y`,0),K(this,`width`,0),K(this,`height`),K(this,`cells`,[]),K(this,`fixedCells`,[]),K(this,`noFixedCells`,[]),K(this,`calculatedHeightCells`,[]),K(this,`rowIndex`,0),K(this,`rowKey`,``),K(this,`rowType`,`body`),K(this,`data`),K(this,`calculatedHeight`,-1),this.ctx=e,this.x=n,this.y=r,this.width=i,this.height=a,this.rowIndex=t,this.rowKey=e.database.getRowKeyForRowIndex(t)||``,this.rowType=s,this.data=o,this.update()}update(){let{header:e}=this.ctx,t=[],n=[],r=[],i=[];e.renderLeafCellHeaders.forEach(e=>{let a=new ft(this.ctx,this.rowIndex,e.colIndex,e.x,this.y,e.width,this.height,e.column,this.data,this.rowType);a.fixed?n.push(a):r.push(a),t.push(a),a.autoRowHeight&&i.push(a)}),this.cells=t,this.calculatedHeightCells=i,this.fixedCells=n,this.noFixedCells=r}updateCalculatedHeight(){let e=this.calculatedHeightCells.map(e=>{let t=e.getAutoHeight(),{key:n,height:r=-1}=this.ctx.database.getMaxRowHeightItem(this.rowKey)||{};return(t>r||e.key===n&&t<r)&&this.ctx.database.setMaxRowHeightItem(this.rowKey,e.key,t),t});return this.calculatedHeight=e.length?Math.max(...e):-1,this.calculatedHeight}drawCenter(){this.noFixedCells.forEach(e=>{e.draw()})}drawFixed(){this.fixedCells.forEach(e=>{e.draw()})}drawContainer(){this.noFixedCells.forEach(e=>{e.drawContainer()})}drawFixedContainer(){this.fixedCells.forEach(e=>{e.drawContainer()})}drawHorizontalBorder(){this.noFixedCells.forEach(e=>{e.drawHorizontalBorder()})}drawFixedHorizontalBorder(){this.fixedCells.forEach(e=>{e.drawHorizontalBorder()})}},Vt=class{constructor(e){K(this,`resizeTarget`,null),K(this,`dragSource`,null),K(this,`dragTarget`,null),K(this,`dragRowDiff`,0),K(this,`dragPosition`,`none`),K(this,`isMouseDown`,!1),K(this,`resizeDiff`,0),K(this,`clientY`,0),K(this,`ctx`),K(this,`x`,0),K(this,`y`,0),K(this,`width`,0),K(this,`height`,0),K(this,`headIndex`,0),K(this,`tailIndex`,0),K(this,`isResizing`,!1),K(this,`renderRows`,[]),K(this,`visibleRows`,[]),K(this,`visibleHeight`,0),K(this,`visibleWidth`,0),K(this,`containerRect`),K(this,`data`,[]),this.ctx=e,this.init(),this.initTree(),this.initSelection(),this.initResizeRow(),this.initDragRow()}init(){let{canvasElement:e,header:t,footer:n,database:r,config:{FOOTER_FIXED:i,HEIGHT:a,EMPTY_BODY_HEIGHT:o=0,MAX_HEIGHT:s=0,ENABLE_OFFSET_HEIGHT:c=0,OFFSET_HEIGHT:l=0,FOOTER_POSITION:u}}=this.ctx,d=b(this.ctx.config);if(!t.width)return;this.x=0,this.y=u===`top`&&i?t.height+n.height:t.height;let{data:f,sumHeight:p}=r.getData();this.height=p,this.data=f,this.width=t.width,this.visibleWidth=this.ctx.stageWidth-d;let m=this.ctx.footer.height;this.ctx.isEmpty=!this.data.length,!this.data.length&&!a?this.height=o:!this.data.length&&a&&(this.height=a-t.height-m-d);let h=this.height+t.height+d;h+=m;let g=h,_=window.innerHeight,{top:v}=this.containerRect||this.ctx.containerElement.getBoundingClientRect();if(_>v&&c&&!a){let e=_-v-l;e>t.height+d?g=e:h>s&&(g=s)}else this.data.length&&a?g=a:this.data.length&&s&&h>s&&(g=s);g>0&&(this.ctx.stageHeight=Math.floor(g),this.ctx.stageElement.style.height=`${this.ctx.stageHeight}px`);let y=this.ctx.stageHeight-t.height-d;this.visibleHeight=i?y-m:y,this.data.length||(this.height=this.visibleHeight),this.ctx.body.x=this.x,this.ctx.body.y=this.y,this.ctx.body.width=this.width,this.ctx.body.height=this.height,this.ctx.body.visibleWidth=this.visibleWidth,this.ctx.body.visibleHeight=this.visibleHeight,this.ctx.body.data=f;let x=window.devicePixelRatio||1,S=this.ctx.stageWidth*x,C=this.ctx.stageHeight*x;e.width=Math.round(S),e.height=Math.round(C);let w=this.data.length?`not-empty`:`empty`;this.ctx.emit(`emptyChange`,{isEmpty:w,type:w,headerHeight:t.height,bodyHeight:this.height,footerHeight:m,width:this.width,height:this.data.length?0:o+m});let T=Math.round(e.width/x*1e4)/1e4,E=Math.round(e.height/x*1e4)/1e4;this.ctx.canvasElement.setAttribute(`style`,`height:${E}px;width:${T}px;`),this.ctx.paint.scale(x)}initTree(){this.ctx.on(`cellClick`,(e,t)=>{if(this.ctx.stageElement.style.cursor!==`pointer`||!e.isImageInside(`tree`,t))return;let{expand:n=!1,expandLazy:r=!1}=this.ctx.database.getRowForRowKey(e.rowKey)||{},{EXPAND_LAZY:i,EXPAND_LAZY_METHOD:a}=this.ctx.config;if(i&&a&&!n&&!r)typeof a==`function`&&(this.ctx.database.expandLoading(e.rowKey,!0),a({row:e.row,rowIndex:e.rowIndex,colIndex:e.colIndex,column:e.column,value:e.getValue()}).then(t=>{this.ctx.database.setExpandChildren(e.rowKey,t),this.ctx.database.expandLoading(e.rowKey,!1),this.ctx.emit(`expandChange`,this.ctx.database.getExpandRowKeys())}).catch(t=>{this.ctx.database.expandLoading(e.rowKey,!1),console.error(t)}));else{let t=this.ctx.database.getIsExpand(e.rowKey);this.ctx.database.expandItem(e.rowKey,!t),this.ctx.emit(`expandChange`,this.ctx.database.getExpandRowKeys())}})}initSelection(){this.ctx.on(`cellClick`,(e,t)=>{this.ctx.stageElement.style.cursor!==`pointer`||!e.isImageInside(`selection`,t)||!this.ctx.database.getRowSelectable(e.rowKey)||this.ctx.database.toggleRowSelection(e.rowKey,e.type)})}initResizeRow(){this.ctx.on(`resize`,()=>{this.ctx.config.ENABLE_RESIZE_ROW&&(this.containerRect=this.ctx.containerElement.getBoundingClientRect())}),this.ctx.on(`resizeObserver`,()=>{this.ctx.config.ENABLE_RESIZE_ROW&&(this.containerRect=this.ctx.containerElement.getBoundingClientRect())}),this.ctx.on(`mouseup`,()=>{this.ctx.config.ENABLE_RESIZE_ROW&&(this.isMouseDown=!1,this.resizeDiff!==0&&this.resizeTarget&&this.resizeRow(this.resizeTarget,this.resizeDiff),this.resizeTarget=null,this.resizeDiff=0,this.isResizing=!1,setTimeout(()=>{this.ctx.rowResizing=!1},0),this.clientY=0)}),this.ctx.on(`mousedown`,e=>{this.ctx.config.ENABLE_RESIZE_ROW&&this.ctx.isTarget(e)&&(this.clientY=e.clientY,this.resizeTarget?(this.isResizing=!0,this.ctx.rowResizing=!0):(this.isResizing=!1,this.ctx.rowResizing=!1),this.isMouseDown=!0)}),this.ctx.on(`mousemove`,e=>{if(!this.ctx.config.ENABLE_RESIZE_ROW||this.ctx.editing)return;let{offsetY:t,offsetX:n}=this.ctx.getOffset(e),r=t,i=n,a=e.clientY,{stageHeight:o,scrollY:s,config:{RESIZE_ROW_MIN_HEIGHT:c=0}}=this.ctx;if(this.isResizing&&this.resizeTarget){let e=this.resizeTarget.height,t=a-this.clientY,{calculatedHeight:n}=this.resizeTarget,r=n===-1?c:n;t+e<r&&(t=-(e-r)),this.resizeDiff=t,this.ctx.emit(`draw`)}else{if(this.resizeTarget=null,this.isMouseDown)return;if(i<0||i>this.ctx.body.visibleWidth||r<0||r>this.ctx.header.visibleHeight+this.ctx.body.visibleHeight){this.ctx.stageElement.style.cursor===`row-resize`&&(this.ctx.stageElement.style.cursor=`default`);return}if(this.ctx.stageElement.style.cursor===`crosshair`)return;this.ctx.stageElement.style.cursor===`row-resize`&&(this.ctx.stageElement.style.cursor=`default`);for(let e=0;e<this.renderRows.length;e++){let t=this.renderRows[e];if(r>t.y-s+t.height-1.5&&r<t.y-s+t.height+1.5&&r<o-4)for(let e=0;e<t.cells.length;e++){let n=t.cells[e];i>n.drawX+10&&i<n.drawX+n.width-10&&n.rowspan===1&&(this.ctx.stageElement.style.cursor=`row-resize`,this.resizeTarget=t)}}}})}initDragRow(){this.ctx.on(`cellMousedown`,(e,t)=>{this.ctx.config.ENABLE_DRAG_ROW&&e.isImageInside(`drag`,t)&&(this.dragSource=e,this.ctx.database.expandItem(e.rowKey,!1),this.ctx.dragRowIng=!0,this.dragRowDiff=this.ctx.mouseY-e.drawY,this.ctx.stageElement.style.cursor=`grabbing`,this.ctx.clearSelector(),this.ctx.emit(`dragRowMouseDown`,e),this.ctx.emit(`draw`))}),this.ctx.on(`mouseup`,async()=>{if(this.ctx.dragRowIng){if(this.dragSource&&this.dragTarget&&this.ctx.stageElement.style.cursor!==`not-allowed`){let e=this.dragSource,t=this.dragTarget,n={source:e,target:t,position:this.dragPosition};this.ctx.emit(`dragRowChange`,n);let r=!0,{BEFORE_DRAG_ROW_METHOD:i}=this.ctx.config;if(typeof i==`function`&&(r=await i(n)),r&&!this.ctx.config.ENABLE_DRAG_ROW_CUSTOM){let n=this.ctx.database.getOriginalData(),{TREE_CHILDREN_KEY:r,ROW_KEY:i}=this.ctx.config,a=new Rt(n,{key:i,childrenKey:r});a.treeMove(e.rowKey,t.rowKey,this.dragPosition),this.ctx.emit(`loadData`,a.getTree())}}this.dragTarget||(this.ctx.stageElement.style.cursor=`grab`),this.ctx.dragRowIng=!1,this.dragSource=null,this.dragTarget=null,this.dragPosition=`after`,this.dragRowDiff=0,this.ctx.emit(`draw`)}}),this.ctx.on(`mousemove`,e=>{if(!this.ctx.dragRowIng)return;let{offsetY:t}=this.ctx.getOffset(e),{drawY:n}=this.dragTarget;n<t||n>t?this.ctx.startAdjustPosition(e):this.ctx.stopAdjustPosition()}),this.ctx.on(`cellMouseenter`,e=>{if(!this.ctx.dragRowIng)return;this.dragTarget=e;let{ENABLE_DRAG_ROW_CROSS_LEVEL:t}=this.ctx.config,n=this.dragSource,r=this.dragTarget;if(!t&&n&&r&&n.parentRowKey!==r.parentRowKey){this.ctx.stageElement.style.cursor=`not-allowed`;return}this.ctx.stageElement.style.cursor=`grabbing`,this.dragTarget=e;let{drawY:i,visibleHeight:a}=e,o=t?a/3:a/2;this.dragPosition=this.ctx.mouseY<=i+o?`before`:this.ctx.mouseY>i+a-o?`after`:`inside`;let s={dragSource:this.dragSource,dragTarget:this.dragTarget,dragPosition:this.dragPosition};this.ctx.emit(`dragRowMove`,s),this.ctx.emit(`draw`)})}resizeRow(e,t){let{rowIndex:n,height:r,rowKey:i,data:a}=e;this.ctx.database.setRowHeight(n,r+t),this.init(),this.ctx.emit(`draw`),this.ctx.emit(`resizeRowChange`,{rowIndex:n,oldHeight:r,height:r+t,rowKey:i,row:a,data:this.data})}drawTipLine(){if(this.isResizing&&this.resizeTarget){let{stageWidth:e,scrollY:t,config:{RESIZE_ROW_LINE_COLOR:n}}=this.ctx,r=this.resizeTarget.y-t+this.resizeTarget.height+this.resizeDiff-.5,i=[0,r-.5,e,r-.5];this.ctx.paint.drawLine(i,{borderColor:n,borderWidth:1})}}drawDragRowTip(){if(this.ctx.dragRowIng&&this.dragTarget&&this.dragSource){let{stageWidth:e,config:{DRAG_ROW_TIP_LINE_COLOR:t,DRAG_TIP_BG_COLOR:n}}=this.ctx,r=this.dragSource.visibleHeight;this.ctx.paint.drawRect(0,this.ctx.mouseY-this.dragRowDiff,this.visibleWidth,r,{fillColor:n,borderWidth:0,borderColor:`transparent`});let i=this.dragTarget.drawY,a=this.dragTarget.height,o=i;if([`before`,`after`].includes(this.dragPosition)){this.dragPosition===`after`&&(o=i+a);let n=[0,o-.5,e,o-.5];this.ctx.paint.drawLine(n,{borderColor:t,borderWidth:1.2})}[`inside`].includes(this.dragPosition)&&(o=i+a/2);let s=[0,o-4,6,o,0,o+4,0,o-4];this.ctx.paint.drawLine(s,{borderColor:t,borderWidth:1.2,fillColor:t})}}drawFixedShadow(){let{fixedLeftWidth:e,fixedRightWidth:t,scrollX:n,header:r,stageWidth:i,config:{HEADER_BG_COLOR:a,FIXED_COLUMN_SHADOW_COLOR:o,FIXED_COLUMN_SHADOW_FADE_COLOR:s,FIXED_COLUMN_SHADOW_WIDTH:c}}=this.ctx,l=b(this.ctx.config);if(n>0&&e!==0&&!this.ctx.isEmpty&&this.ctx.paint.drawShadow(this.x,this.y,e,this.height,{fillColor:a,side:`right`,shadowWidth:c,colorStart:o,colorEnd:s}),n<Math.floor(r.width-i-1)&&t!==l&&!this.ctx.isEmpty){let e=r.width-(this.x+this.width)+i-t;this.ctx.paint.drawShadow(e,this.y,t,this.height,{fillColor:a,side:`left`,shadowWidth:c,colorStart:s,colorEnd:o})}}binarySearch(e,t){let n=0,r=e.length-1,i=-1;for(;n<=r;){let a=Math.floor((n+r)/2),o=e[a].bottom;if(o===t)return a;o<t?n=a+1:(i=a,r=a-1)}return i}update(){this.init();let{header:e,database:t,scrollY:n,config:{CELL_HEIGHT:r}}=this.ctx,i=n,{data:a,positions:o}=t.getData();this.ctx.maxRowIndex=a.length-1;let s=this.binarySearch(o,i),c=this.binarySearch(o,i+this.visibleHeight);if(c===-1&&(c=this.ctx.maxRowIndex),s===-1&&c===this.ctx.maxRowIndex){let e=Math.floor(this.visibleHeight/r);s=this.ctx.maxRowIndex-e}this.headIndex=Math.max(0,s),this.tailIndex=Math.min(this.ctx.maxRowIndex,c+1),this.visibleRows=a.slice(this.headIndex,this.tailIndex+1),this.ctx.body.headIndex=this.headIndex,this.ctx.body.tailIndex=this.tailIndex,this.ctx.body.visibleRows=this.visibleRows;let l=[];for(let t=0;t<this.visibleRows.length;t++){let n=this.headIndex+t,r=this.visibleRows[t],{height:i,top:a}=this.ctx.database.getPositionForRowIndex(n),o=new Bt(this.ctx,n,0,a+this.y,e.width,i,r);l.push(o)}this.renderRows=l,this.ctx.body.renderRows=l}updateAutoHeight(){let e=this.ctx.body.renderRows;if(!e.some(e=>e.calculatedHeightCells.length>0))return!1;e.forEach(e=>{e.updateCalculatedHeight()});let t=e.map(e=>({height:e.calculatedHeight,rowIndex:e.rowIndex}));return this.ctx.database.setBatchCalculatedRowHeight(t)}draw(){this.renderRows.forEach(e=>{e.drawContainer()}),this.renderRows.forEach(e=>{e.drawHorizontalBorder()}),this.renderRows.forEach(e=>{e.drawCenter()}),this.drawFixedShadow(),this.renderRows.forEach(e=>{e.drawFixedContainer()}),this.renderRows.forEach(e=>{e.drawFixedHorizontalBorder()}),this.renderRows.forEach(e=>{e.drawFixed()}),this.drawTipLine()}},Ht=class{constructor(e){K(this,`ctx`),K(this,`renderRows`,[]),K(this,`data`,[]),K(this,`x`,0),K(this,`y`,0),K(this,`width`,0),K(this,`height`,0),K(this,`visibleWidth`,0),K(this,`visibleHeight`,0),this.ctx=e,this.init()}init(){this.data=this.ctx.database.getFooterData();let{header:e,body:t,config:{CELL_FOOTER_HEIGHT:n,FOOTER_FIXED:r,FOOTER_POSITION:i}}=this.ctx,a=b(this.ctx.config);this.width=e.width,this.visibleWidth=e.visibleWidth,this.height=this.data.reduce(e=>e+n,0),this.visibleHeight=this.height,this.y=r?i===`top`?this.ctx.header.height:this.ctx.stageHeight-this.height-a:t.y+t.height,this.ctx.footer.x=this.x,this.ctx.footer.y=this.y,this.ctx.footer.height=this.height,this.ctx.footer.width=this.width,this.ctx.footer.visibleWidth=this.visibleWidth,this.ctx.footer.visibleHeight=this.visibleHeight}drawFixedShadow(){let{fixedLeftWidth:e,fixedRightWidth:t,scrollX:n,header:r,stageWidth:i,config:{HEADER_BG_COLOR:a,FIXED_COLUMN_SHADOW_COLOR:o,FIXED_COLUMN_SHADOW_FADE_COLOR:s,FIXED_COLUMN_SHADOW_WIDTH:c}}=this.ctx,l=b(this.ctx.config),u=this.y;if(this.ctx.config.FOOTER_FIXED||(u=this.y-this.ctx.scrollY),n>0&&e!==0&&this.ctx.paint.drawShadow(this.x,u,e,this.height,{fillColor:a,side:`right`,shadowWidth:c,colorStart:o,colorEnd:s}),n<Math.floor(r.width-i-1)&&t!==l){let e=r.width-(this.x+this.width)+i-t;this.ctx.paint.drawShadow(e,u,t,this.height,{fillColor:a,side:`left`,shadowWidth:c,colorStart:s,colorEnd:o})}}update(){this.init();let{CELL_FOOTER_HEIGHT:e}=this.ctx.config,t=this.y,n=[];this.data.forEach((r,i)=>{let a=new Bt(this.ctx,i,0,t,this.width,e,r,`footer`);t+=e,n.push(a)}),this.renderRows=n,this.ctx.footer.renderRows=this.renderRows}drawTopLine(){let{stageWidth:e,config:t}=this.ctx,{BORDER:n}=t;if(!A(n))return;let r=[0,this.y,e,this.y];this.ctx.paint.drawLine(r,{borderColor:t.BORDER_COLOR,borderWidth:1})}draw(){this.renderRows.forEach(e=>{e.drawContainer()}),this.renderRows.forEach(e=>{e.drawHorizontalBorder()}),this.renderRows.forEach(e=>{e.drawCenter()}),this.drawFixedShadow(),this.renderRows.forEach(e=>{e.drawFixedContainer()}),this.renderRows.forEach(e=>{e.drawFixedHorizontalBorder()}),this.renderRows.forEach(e=>{e.drawFixed()}),this.drawTopLine()}},Ut=class{constructor(e){K(this,`isCut`,!1),K(this,`isMultipleRow`,!1),K(this,`ctx`),this.ctx=e,this.init()}init(){this.ctx.on(`setMoveFocus`,e=>{this.moveFocus(e)}),this.ctx.on(`mousemove`,n(e=>{var t;(t=this.ctx.focusCellHeader)!=null&&t.fixed||!this.ctx.dragHeaderIng&&this.ctx.selectorMove&&this.ctx.startAdjustPosition(e)},100)),this.ctx.on(`cellHoverChange`,e=>{if(!this.ctx.autofillMove){if(e.operation){this.selectRows(e,!1);return}this.isMultipleRow||this.mouseenter()}}),this.ctx.on(`cellClick`,()=>{this.adjustBoundaryPosition()}),this.ctx.on(`cellMousedown`,(e,t)=>{this.ctx.isTarget(t)&&this.ctx.stageElement.style.cursor!==`pointer`&&this.ctx.stageElement.style.cursor!==`crosshair`&&(e.operation?(this.isMultipleRow=!0,this.selectRows(e)):(window.getComputedStyle(t.target).userSelect!==`text`&&t.preventDefault(),this.isMultipleRow=!1,this.click(t.shiftKey),this.ctx.emit(`selectorClick`,e)))}),this.ctx.on(`mouseup`,()=>{this.ctx.selectorMove=!1,this.ctx.stopAdjustPosition(),setTimeout(()=>{this.ctx.disableHoverIconClick=!1},0)}),this.ctx.on(`cellHeaderHoverChange`,e=>{this.ctx.textSelecting||this.ctx.mousedown&&this.selectCols(e)}),this.ctx.on(`cellHoverChange`,e=>{this.ctx.textSelecting||this.ctx.mousedown&&this.selectCols(e)}),this.ctx.on(`cellHeaderMousedown`,(e,t)=>{this.ctx.stageElement.style.cursor!==`pointer`&&(window.getComputedStyle(t.target).userSelect!==`text`&&t.preventDefault(),this.ctx.clearSelector(),e.operation?this.selectAll():this.selectCols(e))}),this.ctx.on(`keydown`,e=>{if(!this.ctx.editing&&!this.ctx.finding){if(e.ctrlKey&&e.code===`KeyV`||e.metaKey&&e.code===`KeyV`){this.paste();return}if(e.ctrlKey&&e.code===`KeyC`||e.metaKey&&e.code===`KeyC`){this.copy(),this.isCut=!1;return}if(e.ctrlKey&&e.code===`KeyX`||e.metaKey&&e.code===`KeyX`){this.isCut=!0,this.copy();return}if((e.ctrlKey&&e.code===`KeyA`||e.metaKey&&e.code===`KeyA`)&&(e.preventDefault(),this.selectAll()),e.code===`ArrowLeft`||e.shiftKey&&e.code===`Tab`){e.preventDefault(),this.moveFocus(`LEFT`);return}if(e.code===`ArrowUp`){e.preventDefault(),this.moveFocus(`TOP`);return}if(e.code===`ArrowRight`||e.code===`Tab`){e.preventDefault(),this.moveFocus(`RIGHT`);return}if(e.code===`ArrowDown`){e.preventDefault(),this.moveFocus(`BOTTOM`);return}if(e.code===`Delete`||e.code===`Backspace`){e.preventDefault();let{xArr:t,yArr:n}=this.ctx.selector;this.clearSelectedData(t,n);return}}}),this.ctx.on(`contextMenuClearSelected`,()=>{let{xArr:e,yArr:t}=this.ctx.selector;this.clearSelectedData(e,t)}),this.ctx.on(`contextMenuCopy`,()=>{this.copy()}),this.ctx.on(`contextMenuPaste`,()=>{this.paste()}),this.ctx.on(`contextMenuCut`,()=>{this.isCut=!0,this.copy()}),this.ctx.on(`setSelectorCell`,e=>{this.ctx.setFocusCell(e),this.click(),this.adjustBoundaryPosition()}),this.ctx.on(`selectCols`,e=>{this.selectCols(e)})}setSelector(e,t){if(this.ctx.dragHeaderIng||this.ctx.dragRowIng)return;let{ENABLE_SELECTOR_SPAN_COL:n,ENABLE_SELECTOR_SPAN_ROW:r}=this.ctx.config,i=e,a=t;if(!r){let[e]=a;a=[e,e]}if(!n){let[e]=i;i=[e,e]}if(JSON.stringify(this.ctx.selector.xArr)!==JSON.stringify(i)||JSON.stringify(this.ctx.selector.yArr)!==JSON.stringify(a)){this.ctx.mousedown&&(this.ctx.selectorMove=!0,this.ctx.disableHoverIconClick=!0),this.ctx.selector.enable=!0;let{SELECTOR_AREA_MIN_X:e,SELECTOR_AREA_MAX_X:t,SELECTOR_AREA_MIN_Y:n,SELECTOR_AREA_MAX_Y:r,SELECTOR_AREA_MAX_X_OFFSET:o,SELECTOR_AREA_MAX_Y_OFFSET:s}=this.ctx.config,c=e,l=t||this.ctx.maxColIndex-o,u=n,d=r||this.ctx.maxRowIndex-s,[f,p]=i,[m,h]=a;if(f<c||p>l||m<u||h>d)return;if(this.ctx.config.ENABLE_MERGE_CELL_LINK){let e=this.adjustMergeCells(i,a);m=e.yArr[0],h=e.yArr[1],f=e.xArr[0],p=e.xArr[1],this.ctx.onlyMergeCell=e.onlyMergeCell}f===p&&m===h?this.ctx.selectOnlyOne=!0:this.ctx.selectOnlyOne=!1,i=[Math.max(c,f),Math.min(l,p)],a=[Math.max(u,m),Math.min(d,h)];let{BEFORE_SET_SELECTOR_METHOD:g}=this.ctx.config;if(typeof g==`function`){let e=g({focusCell:this.ctx.focusCell,xArr:i,yArr:a});if(!e)return;i=e.xArr,a=e.yArr}this.ctx.selector.xArr=i,this.ctx.selector.yArr=a,h===this.ctx.maxRowIndex&&m===0?this.ctx.selectColsIng=!0:this.ctx.selectColsIng=!1,p===this.ctx.maxColIndex&&f===0?this.ctx.selectRowsIng=!0:this.ctx.selectRowsIng=!1,this.ctx.emit(`setSelector`,this.ctx.selector),this.ctx.emit(`drawView`)}}adjustMergeCells(e,t){let[n,r]=t,[i,a]=e;if(r===this.ctx.maxRowIndex&&n===0||a===this.ctx.maxColIndex&&i===0)return{xArr:e,yArr:t,onlyMergeCell:!1};let o=[],s=[];for(let c=0;c<=t[1]-t[0];c++)for(let l=0;l<=e[1]-e[0];l++){let u=c+t[0],d=l+e[0],f=this.ctx.database.getVirtualBodyCell(u,d);f&&((u===n||u===r)&&o.push(f),(d===i||d===a)&&s.push(f))}let c=o.reduce((e,t)=>{let{yArr:n}=t.getSpanInfo(),[r,i]=n;return e.minY=Math.min(e.minY,r),e.maxY=Math.max(e.maxY,i),e},{minY:n,maxY:r}),l=s.reduce((e,t)=>{let{xArr:n}=t.getSpanInfo(),[r,i]=n;return e.minX=Math.min(e.minX,r),e.maxX=Math.max(e.maxX,i),e},{minX:i,maxX:a}),u=[l.minX,l.maxX],d=[c.minY,c.maxY],f=!1;if(l.minX!==l.maxX||c.minY!==c.maxY){let e=JSON.stringify(u)+JSON.stringify(d),t=this.ctx.focusCell?.getSpanInfo();f=(t&&JSON.stringify(t.xArr)+JSON.stringify(t.yArr))===e}return{xArr:u,yArr:d,onlyMergeCell:f}}selectCols(e){if(this.ctx.config.ENABLE_SELECTOR_SINGLE||!this.ctx.config.ENABLE_SELECTOR_ALL_ROWS||this.ctx.autofillMove||this.ctx.columnResizing||this.ctx.editing)return;let{SELECTOR_AREA_MIN_Y:t,SELECTOR_AREA_MAX_Y:n,SELECTOR_AREA_MAX_Y_OFFSET:r}=this.ctx.config,i=t,a=n||this.ctx.maxRowIndex-r;if(this.ctx.focusCellHeader){let{colIndex:t}=this.ctx.focusCellHeader;if(this.ctx.clearSelector(),this.ctx.mousedown&&e.colIndex>=t){let n=[t,e.colIndex+e.colspan-1],r=[i,a];this.setSelector(n,r)}else{let n=[e.colIndex,t+e.colspan-1],r=[i,a];this.setSelector(n,r)}}}selectAll(){if(this.ctx.autofillMove||this.ctx.editing)return;let{ENABLE_SELECTOR_ALL_ROWS:e,ENABLE_SELECTOR_ALL_COLS:t}=this.ctx.config;if(e&&t){let{SELECTOR_AREA_MIN_X:e,SELECTOR_AREA_MAX_X:t,SELECTOR_AREA_MIN_Y:n,SELECTOR_AREA_MAX_Y:r,SELECTOR_AREA_MAX_X_OFFSET:i,SELECTOR_AREA_MAX_Y_OFFSET:a}=this.ctx.config,o=e,s=t||this.ctx.maxColIndex-i,c=n,l=r||this.ctx.maxRowIndex-a,u=[o,s],d=[c,l];this.setSelector(u,d)}}selectRows(e,t=!0){if(this.ctx.config.ENABLE_SELECTOR_SINGLE||!this.ctx.config.ENABLE_SELECTOR_ALL_COLS||this.ctx.autofillMove||this.ctx.editing)return;let{SELECTOR_AREA_MIN_X:n,SELECTOR_AREA_MAX_X:r,SELECTOR_AREA_MAX_X_OFFSET:i}=this.ctx.config,a=r||this.ctx.maxColIndex-i,o=n;if(t){this.ctx.setFocusCell(e);let t=[o,a],n=[e.rowIndex,e.rowIndex];this.setSelector(t,n)}if(this.ctx.focusCell&&this.ctx.mousedown){let{rowIndex:t}=this.ctx.focusCell;if(e.rowIndex>=t){let n=[o,a],r=[t,e.rowIndex];this.setSelector(n,r)}else{let n=[o,a],r=[e.rowIndex,t];this.setSelector(n,r)}}}mouseenter(){if(this.ctx.config.ENABLE_SELECTOR_SINGLE||this.ctx.editing)return;let{mousedown:e,focusCell:t,hoverCell:n}=this.ctx;if(e&&t&&n){let{rowIndex:e,colIndex:r}=t,i=Math.min(n.colIndex,r),a=Math.max(n.colIndex,r),o=Math.min(n.rowIndex,e),s=Math.max(n.rowIndex,e),c=[i,a],l=[o,s];this.setSelector(c,l)}}click(e=!1){let{focusCell:t,clickCell:n}=this.ctx;if(t&&this.isInSettingRange(t.rowIndex,t.colIndex)){if(this.ctx.selector.enable=!0,n&&e){if(this.ctx.config.ENABLE_SELECTOR_SINGLE)return;let{colIndex:e,rowIndex:r}=n,{colIndex:i,rowIndex:a}=t,o=Math.min(i,e),s=Math.max(i,e),c=Math.min(a,r),l=Math.max(a,r),u=[o,s],d=[c,l];this.setSelector(u,d)}else{this.ctx.emit(`cellSelectedClick`,t);let e=[t.colIndex,t.colIndex],n=[t.rowIndex,t.rowIndex];this.setSelector(e,n)}}}clearCopyLine(){this.ctx.selector.xArrCopy=[-1,-1],this.ctx.selector.yArrCopy=[-1,-1]}getCell(e,t){return this.ctx.body.renderRows.find(t=>t.rowIndex===e)?.cells.find(e=>e.colIndex===t)}copy(){if(!this.ctx.config.ENABLE_COPY||this.ctx.domSelectionStr||this.ctx.textSelectionStr)return;let{value:e,xArr:t,yArr:n}=this.ctx.getSelectedData();if(this.ctx.config.ENABLE_MERGE_CELL_LINK&&this.ctx.database.hasMergeCell(t,n)){if(this.ctx.onlyMergeCell&&this.ctx.focusCell){let r=this.ctx.focusCell;e=[[r.getValue()]],t=[r.colIndex,r.colIndex],n=[r.rowIndex,r.rowIndex]}else{let e={code:`ERR_MERGED_CELLS_COPY`,message:this.ctx.locale.getText(`mergeCellNoCopy`)};this.ctx.hasEvent(`error`)?this.ctx.emit(`error`,e):console.error(e.message);return}}let{BEFORE_COPY_METHOD:r}=this.ctx.config;if(typeof r==`function`){let i=r({focusCell:this.ctx.focusCell,data:e,xArr:t,yArr:n});if(!i)return;e=i.data}let i=l(e);navigator.clipboard?navigator.clipboard.writeText(i).then(()=>{this.ctx.selector.xArrCopy=this.ctx.selector.xArr.slice(),this.ctx.selector.yArrCopy=this.ctx.selector.yArr.slice(),this.ctx.emit(`copyChange`,{xArr:this.ctx.selector.xArrCopy,yArr:this.ctx.selector.yArrCopy,data:e}),this.ctx.emit(`draw`)}).catch(e=>console.error(`Copy Failure:`,e)):console.error(`current browser does not support the Clipboard API`)}clearSelectedData(e,t,n=!1,r=null){let i=[],a=/* @__PURE__ */ new Set;for(let n=0;n<=t[1]-t[0];n++)for(let o=0;o<=e[1]-e[0];o++){let s=n+t[0],c=o+e[0],l=this.ctx.database.getItemValueForRowIndexAndColIndex(s,c);if(l){let{rowKey:e,key:t}=l;this.ctx.database.getReadonly(e,t)||(a.add(e),i.push({rowKey:e,key:t,value:r,row:{}}))}}if(!i.length)return[];if(n)return i;this.ctx.database.batchSetItemValue(i,!0);let o=[];return a.forEach(e=>{o.push(this.ctx.database.getRowDataItemForRowKey(e))}),this.ctx.emit(`clearSelectedDataChange`,i,o),i}paste(){if(!navigator.clipboard){console.error(`current browser does not support the Clipboard API`);return}let{ENABLE_PASTER:e}=this.ctx.config;if(this.ctx.selector.enable&&e){let e=this.ctx.selector.yArr[0],t=this.ctx.selector.xArr[0],n=/* @__PURE__ */ new Set;navigator.clipboard.readText().then(async r=>{let i=c(r),a=[t,t+i[0].length-1],o=[e,e+i.length-1],[s,l]=o,[u,d]=a,f=l-this.ctx.maxRowIndex,p=d-this.ctx.maxColIndex;(f>0||p>0)&&this.ctx.emit(`onPastedDataOverflow`,{maxY:l,maxX:d,minY:s,minX:u,overflowRowCount:f,overflowColCount:p,textArr:i});let m=i.length===1&&i[0].length===1;if(this.ctx.config.ENABLE_MERGE_CELL_LINK&&this.ctx.database.hasMergeCell(a,o)&&!m){let e={code:`ERR_MERGED_CELLS_PASTE`,message:this.ctx.locale.getText(`mergeCellNoPaste`),data:[]};this.ctx.hasEvent(`error`)?this.ctx.emit(`error`,e):console.error(e.message);return}let h=[];for(let r=0;r<=i.length-1;r++){let a=i[r].length;for(let o=0;o<=a-1;o++){let a=r+e,s=o+t,c=i[r][o],l=this.ctx.database.getItemValueForRowIndexAndColIndex(a,s);if(l){let{rowKey:e,key:t}=l;this.ctx.database.getReadonly(e,t)||(n.add(e),h.push({rowKey:e,key:t,value:c,row:{}}))}}}if(this.isCut){let e=this.clearSelectedData(this.ctx.selector.xArrCopy,this.ctx.selector.yArrCopy,!0),t=h.map(e=>`${e.rowKey}-${e.key}`);e.forEach(e=>{t.includes(`${e.rowKey}-${e.key}`)||h.unshift(e)}),this.isCut=!1}if(!h.length)return;let{BEFORE_PASTE_DATA_METHOD:g}=this.ctx.config;if(typeof g==`function`&&(h=await g(h.map(e=>({rowKey:e.rowKey,key:e.key,value:e.value,oldValue:this.ctx.database.getItemValue(e.rowKey,e.key),row:this.ctx.database.getRowDataItemForRowKey(e.rowKey)})),a,o,i),h&&!h.length))return;this.clearCopyLine(),this.ctx.batchSetItemValueByEditor(h,!0);let _=[];n.forEach(e=>{_.push(this.ctx.database.getRowDataItemForRowKey(e))}),this.ctx.emit(`pasteChange`,h,_),this.ctx.emit(`draw`)}).catch(e=>{console.error(`Failed to get the clipboard content:`,e)})}}moveFocus(e){if(this.ctx.editing)return;let{focusCell:t}=this.ctx;if(!t)return;let{colIndex:n=0,rowIndex:r=0}=t,i=this.ctx.maxColIndex,a=this.ctx.maxRowIndex;switch(e){case`LEFT`:n>0&&n--;break;case`TOP`:r>0&&r--;break;case`RIGHT`:n<i&&n++;break;case`BOTTOM`:r<a&&r++}let o=[n,n],s=[r,r],c=this.getCell(r,n);c&&(c.operation||this.isInSettingRange(c.rowIndex,c.colIndex)&&(this.ctx.setFocusCell(c),this.setSelector(o,s),this.adjustBoundaryPosition(),this.ctx.emit(`moveFocus`,c),this.ctx.emit(`draw`)))}isInSettingRange(e,t){let{SELECTOR_AREA_MIN_X:n,SELECTOR_AREA_MAX_X:r,SELECTOR_AREA_MIN_Y:i,SELECTOR_AREA_MAX_Y:a,SELECTOR_AREA_MAX_X_OFFSET:o,SELECTOR_AREA_MAX_Y_OFFSET:s}=this.ctx.config,c=n,l=r||this.ctx.maxColIndex-o,u=i,d=a||this.ctx.maxRowIndex-s;return!(t<c||t>l||e<u||e>d)}adjustBoundaryPosition(){let{stageHeight:e,stageWidth:t,focusCell:n,fixedRightWidth:r,fixedLeftWidth:i,header:a,footer:o,body:s,scrollX:c,scrollY:l,config:{FOOTER_FIXED:u,FOOTER_POSITION:d,ENABLE_MERGE_CELL_LINK:f}}=this.ctx,p=b(this.ctx.config);if(!n)return;f&&this.ctx.onlyMergeCell&&n.updateSpanInfo();let{drawX:m,drawY:h,width:g,height:_,fixed:v}=n,y=i-m+1,x=n.drawX+g-(t-r)+1,S=a.height-h,C=_;C>s.visibleHeight&&(C=s.visibleHeight);let w=0;u&&(d===`top`?S=a.height+o.height-h:w=o.visibleHeight);let T=h+C-(e-w-p),E=c,D=l;x>0&&!v?E=Math.floor(c+x):y>0&&!v&&(E=Math.floor(c-y)),S>0?D=Math.floor(l-S):T>0&&(D=Math.floor(l+T)),(Math.abs(c-E)>2.5||Math.abs(l-D)>2.5)&&this.ctx.setScroll(E,D)}destroy(){}},Wt=class{constructor(e){K(this,`ctx`),K(this,`maxColRowCell`),this.ctx=e,this.init()}init(){this.ctx.on(`mousemove`,e=>{if(this.ctx.stageElement.style.cursor===`crosshair`&&(this.ctx.stageElement.style.cursor=`default`),this.ctx.editing||!this.ctx.focusCell||!this.maxColRowCell)return;let{offsetX:t,offsetY:n}=this.ctx.getOffset(e),{colIndex:r,rowIndex:i,drawX:a,drawY:o,width:s,height:c}=this.maxColRowCell,l=r===this.ctx.maxColIndex||i===this.ctx.maxRowIndex?0:2,u=a+s-6+l,d=o+c-6+l;t>u&&n>d&&t<u+6&&n<d+6&&(this.ctx.stageElement.style.cursor=`crosshair`),this.ctx.autofillMove&&this.ctx.startAdjustPosition(e)}),this.ctx.on(`cellMouseenter`,e=>{let{xArr:t,yArr:n}=this.ctx.selector,r=t[1],i=n[1],{colIndex:a,rowIndex:o}=e;this.ctx.config.ENABLE_AUTOFILL&&a===r&&o===i&&(this.maxColRowCell=e),this.mouseenter(e)}),this.ctx.on(`mousedown`,()=>{this.ctx.stageElement.style.cursor===`crosshair`&&this.setMousedown()}),this.ctx.on(`mouseup`,()=>{this.setMouseUp(),this.ctx.stopAdjustPosition()})}isAutofillIng(){let{xArr:e,yArr:t}=this.ctx.selector;return JSON.stringify(this.ctx.autofill.xArr)!==JSON.stringify(e)||JSON.stringify(this.ctx.autofill.yArr)!==JSON.stringify(t)}setMousedown(){this.ctx.autofill.enable=!0,this.ctx.autofillMove=!0,this.ctx.disableHoverIconClick=!0}setMouseUp(){this.ctx.autofill.enable&&(this.isAutofillIng()&&this.autofillData(),this.ctx.autofill.enable=!1,this.ctx.autofillMove=!1,this.ctx.autofill.xArr=[-1,-1],this.ctx.autofill.yArr=[-1,-1],setTimeout(()=>{this.ctx.disableHoverIconClick=!1},0))}setAutofill(e,t){let{ENABLE_AUTOFILL:n,ENABLE_AUTOFILL_SPAN_COL:r,ENABLE_AUTOFILL_SPAN_ROW:i}=this.ctx.config;if(!n)return;let a=e,o=t,s=this.ctx.selector.xArr,c=this.ctx.selector.yArr;if((i||JSON.stringify(c)===JSON.stringify(o))&&(r||JSON.stringify(s)===JSON.stringify(a))&&(JSON.stringify(this.ctx.autofill.xArr)!==JSON.stringify(a)||JSON.stringify(this.ctx.autofill.yArr)!==JSON.stringify(o))){let{SELECTOR_AREA_MIN_X:e,SELECTOR_AREA_MAX_X:t,SELECTOR_AREA_MIN_Y:n,SELECTOR_AREA_MAX_Y:r,SELECTOR_AREA_MAX_X_OFFSET:i,SELECTOR_AREA_MAX_Y_OFFSET:s}=this.ctx.config,c=e,l=t||this.ctx.maxColIndex-i,u=n,d=r||this.ctx.maxRowIndex-s,[f,p]=a,[m,h]=o;if(f<c||m<u)return;a=[Math.max(c,f),Math.min(l,p)],o=[Math.max(u,m),Math.min(d,h)];let{BEFORE_SET_AUTOFILL_METHOD:g}=this.ctx.config;if(typeof g==`function`){let e=g({focusCell:this.ctx.focusCell,xArr:a,yArr:o});if(!e)return;a=e.xArr,o=e.yArr}this.ctx.autofill.xArr=a,this.ctx.autofill.yArr=o,this.ctx.emit(`setAutofill`,this.ctx.autofill),this.ctx.emit(`draw`)}}async autofillData(){let e=/* @__PURE__ */ new Set,t=this.ctx.getSelectedData(),n=/* @__PURE__ */ new Map;for(let e=0;e<=t.yArr[1]-t.yArr[0];e++)for(let r=0;r<=t.xArr[1]-t.xArr[0];r++){let i=e+t.yArr[0],a=r+t.xArr[0];n.set(`${i}-${a}`,!0)}let{value:r}=t,i=r[0].length,a=r.length,o=this.ctx.autofill.xArr,s=this.ctx.autofill.yArr,c=i===1&&a===1;if(this.ctx.config.ENABLE_MERGE_CELL_LINK&&this.ctx.database.hasMergeCell(o,s)&&!c){let e={code:`ERR_MERGED_CELLS_AUTOFILL`,message:this.ctx.locale.getText(`mergeCellNoFill`),data:[]};this.ctx.hasEvent(`error`)?this.ctx.emit(`error`,e):console.error(e.message);return}let l=[];for(let t=0;t<=s[1]-s[0];t++)for(let c=0;c<=o[1]-o[0];c++){let u=c+o[0],d=t+s[0],f=r[t%a][c%i],p=this.ctx.database.getItemValueForRowIndexAndColIndex(d,u),m=`${d}-${u}`;if(p&&!n.has(m)){let{rowKey:t,key:n}=p;this.ctx.database.getReadonly(t,n)||(e.add(t),l.push({rowKey:t,key:n,value:f,row:{}}))}}if(!l.length)return;this.ctx.selector.xArr=this.ctx.autofill.xArr,this.ctx.selector.yArr=this.ctx.autofill.yArr;let{BEFORE_AUTOFILL_DATA_METHOD:u}=this.ctx.config;if(typeof u==`function`&&(l=await u(l.map(e=>({rowKey:e.rowKey,key:e.key,value:e.value,oldValue:this.ctx.database.getItemValue(e.rowKey,e.key),row:this.ctx.database.getRowDataItemForRowKey(e.rowKey)})),o,s),l&&!l.length))return;this.ctx.batchSetItemValueByEditor(l,!0);let d=[];e.forEach(e=>{d.push(this.ctx.database.getRowDataItemForRowKey(e))}),this.ctx.emit(`autofillChange`,l,d),this.ctx.emit(`draw`)}mouseenter(e){if([`index`,`selection`,`index-selection`].includes(e.type))return;let{selector:t,autofill:n}=this.ctx;if(this.ctx.mousedown&&t.enable&&n.enable){let{rowIndex:n,colIndex:r}=e,i=t.xArr.slice(),a=t.yArr.slice();n>=t.yArr[0]&&n<=t.yArr[1]?r>t.xArr[1]?i.splice(1,1,r):r<t.xArr[0]&&i.splice(0,1,r):n>t.yArr[1]?a.splice(1,1,n):n<t.yArr[0]&&a.splice(0,1,n),this.setAutofill(i,a)}}destroy(){}},Y=Math.min,X=Math.max,Gt=Math.round,Kt=Math.floor,Z=e=>({x:e,y:e}),qt={left:`right`,right:`left`,bottom:`top`,top:`bottom`},Jt=[`left`,`right`],Yt=[`right`,`left`],Xt=[`top`,`bottom`],Zt=[`bottom`,`top`],Qt=50,$t=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:xe},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=be(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<Qt&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=be(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},en=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=j(e,t)||{};if(l==null)return{};let d=ve(u),f={x:n,y:r},p=ue(i),m=le(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=Y(d[_],T),D=Y(d[v],T),ee=E,O=C-h[m]-D,k=C/2-h[m]/2+w,A=se(ee,k,O),te=!c.arrow&&N(i)!=null&&k!==A&&a.reference[m]/2-(k<ee?E:D)-h[m]/2<0,ne=te?k<ee?k-ee:k-O:0;return{[p]:f[p]+ne,data:{[p]:A,centerOffset:k-A-ne,...te&&{alignmentOffset:ne}},reset:te}}}),tn=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=j(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=M(r),_=P(o),v=M(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[ge(o)]:fe(o)),x=p!==`none`;!d&&x&&b.push(...he(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=de(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(u!==`alignment`||_===P(t)||T.every(e=>P(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=P(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o}if(r!==n)return{reset:{placement:n}}}return{}}}},nn=/* @__PURE__ */ new Set([`left`,`top`]),rn=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await Se(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},an=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=j(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=P(M(i)),p=ce(f),m=u[p],h=u[f];if(o){let e=p===`y`?`top`:`left`,t=p===`y`?`bottom`:`right`,n=m+d[e],r=m-d[t];m=se(n,m,r)}if(s){let e=f===`y`?`top`:`left`,t=f===`y`?`bottom`:`right`,n=h+d[e],r=h-d[t];h=se(n,h,r)}let g=c.fn({...t,[p]:m,[f]:h});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[p]:o,[f]:s}}}}}},on=/transform|translate|scale|rotate|perspective|filter/,sn=/paint|layout|strict|content/,Q=e=>!!e&&e!==`none`,ln=/* @__PURE__ */ Z(0),un=25,dn=async function(e){let t=this.getOffsetParent||et,n=this.getDimensions,r=await n(e.floating);return{reference:Ze(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}},fn={convertOffsetParentRelativeRectToViewportRelativeRect:Ve,getDocumentElement:L,getClippingRect:Ye,getOffsetParent:et,getElementRects:dn,getClientRects:He,getDimensions:Xe,getScale:W,isElement:R,isRTL:tt},pn=rn,mn=an,hn=tn,gn=en,$=(e,t,n)=>{let r=/* @__PURE__ */ new Map,i={platform:fn,...n},a={...i.platform,_c:r};return $t(e,t,{...i,platform:a})},_n=class{constructor(e){K(this,`ctx`),K(this,`enable`,!1),K(this,`contentEl`),K(this,`floatingEl`),K(this,`arrowEl`),this.ctx=e;let{TOOLTIP_BG_COLOR:t,TOOLTIP_TEXT_COLOR:n,TOOLTIP_ZINDEX:r,TOOLTIP_CUSTOM_STYLE:i,CSS_PREFIX:a}=this.ctx.config;this.contentEl=document.createElement(`div`),this.arrowEl=document.createElement(`div`),this.floatingEl=document.createElement(`div`),this.floatingEl.className=`${a}-tooltip`,this.contentEl.className=`${a}-tooltip-content`,this.arrowEl.className=`${a}-tooltip-arrow`;let o={display:`none`,position:`absolute`,background:t,color:n,boxSizing:`border-box`,zIndex:r,padding:`8px`,borderRadius:`4px`,fontSize:`12px`,...i},s={position:`absolute`,width:`10px`,height:`10px`,background:o.background,backgroundColor:o.backgroundColor,transform:`rotate(45deg)`,zIndex:o.zIndex};Object.assign(this.arrowEl.style,s),Object.assign(this.floatingEl.style,o),this.floatingEl.appendChild(this.contentEl),this.floatingEl.appendChild(this.arrowEl),this.ctx.containerElement.appendChild(this.floatingEl),this.init()}init(){this.floatingEl.addEventListener(`mouseleave`,()=>{this.hide()}),this.ctx.on(`mouseout`,e=>{this.floatingEl.contains(e.relatedTarget)||this.hide()}),this.ctx.on(`onScroll`,()=>{this.hide()}),this.ctx.on(`startEdit`,()=>{this.hide()}),this.ctx.on(`visibleCellHoverChange`,(e,t)=>{this.floatingEl.contains(t.target)||(e.ellipsis||e.message)&&this.show(e)}),this.ctx.on(`visibleCellMouseleave`,(e,t)=>{this.floatingEl.contains(t.target)||this.hide()}),this.ctx.on(`cellHeaderMouseleave`,(e,t)=>{this.floatingEl.contains(t.target)||this.hide()}),this.ctx.on(`cellHeaderHoverChange`,(e,t)=>{this.floatingEl.contains(t.target)||e.ellipsis&&this.show(e)}),this.ctx.on(`cellFooterMouseleave`,(e,t)=>{this.floatingEl.contains(t.target)||this.hide()}),this.ctx.on(`cellFooterHoverChange`,(e,t)=>{this.floatingEl.contains(t.target)||e.ellipsis&&this.show(e)}),this.ctx.on(`cellShowTooltip`,(e,t)=>{this.show(e,t)}),this.ctx.on(`cellHideTooltip`,()=>{this.hide()})}show(e,t){if(this.ctx.contextMenuIng||!e.overflowTooltipShow||this.ctx.mousedown)return;this.floatingEl.style.display=`block`;let n=e.getText();e.message&&(n=e.message),t&&(n=t);let r=this.ctx.containerElement.getBoundingClientRect();if(!r)return;this.enable=!0,this.contentEl.style.maxWidth=`${e.overflowTooltipMaxWidth||500}px`,this.contentEl.style.minWidth=`100px`,this.contentEl.style.width=`100%`,this.contentEl.style.display=`inline-block`,this.contentEl.style.wordBreak=`break-all`,this.contentEl.style.lineHeight=`1.5`,this.contentEl.innerText=n;let i=e.drawX+r.x,a=e.drawY+r.y;$({getBoundingClientRect(){return{width:e.visibleWidth,height:e.visibleHeight,x:i,y:a,left:i,right:i+e.visibleWidth,top:a,bottom:a+e.visibleHeight}}},this.floatingEl,{placement:e.overflowTooltipPlacement,middleware:[mn(),hn(),pn(6),gn({element:this.arrowEl})]}).then(e=>{let{x:t,y:n,placement:r,middlewareData:i}=e;if(Object.assign(this.floatingEl.style,{top:`${n}px`,left:`${t}px`}),i.arrow){let e=i.arrow;[`left`,`left-start`,`left-end`].includes(r)?Object.assign(this.arrowEl.style,{top:`${e.y}px`,bottom:``,left:``,right:`-5px`}):[`right`,`right-start`,`right-end`].includes(r)?Object.assign(this.arrowEl.style,{top:`${e.y}px`,bottom:``,left:`-5px`,right:``}):[`bottom`,`bottom-start`,`bottom-end`].includes(r)?Object.assign(this.arrowEl.style,{top:`-5px`,bottom:``,left:`${e.x}px`,right:``}):[`top`,`top-start`,`top-end`].includes(r)&&Object.assign(this.arrowEl.style,{top:``,bottom:`-5px`,left:`${e.x}px`,right:``})}})}hide(){this.enable&&(this.enable=!1,this.floatingEl.style.display=`none`)}destroy(){this.contentEl.remove(),this.arrowEl.remove(),this.floatingEl.remove()}},vn=class{constructor(e){K(this,`editorEl`),K(this,`inputEl`),K(this,`enable`,!1),K(this,`cellTarget`,null),K(this,`selectorArrStr`,``),K(this,`ctx`),K(this,`drawY`,0),K(this,`drawX`,0),K(this,`cancel`,!1),this.ctx=e,this.initTextEditor(),this.init()}init(){this.ctx.on(`outsideMousedown`,()=>{this.cellTarget&&this.cellTarget.editorType===`text`&&this.clearEditor()}),this.ctx.on(`moveFocus`,e=>{this.cellTarget=e,this.resetEditorStyle();let{xArr:t,yArr:n}=this.ctx.selector;this.selectorArrStr=JSON.stringify(t)+JSON.stringify(n),this.focusInput()}),this.ctx.on(`onScroll`,()=>{this.enable&&this.doneEdit()}),this.ctx.on(`hoverIconClick`,e=>{this.editCell(e.rowIndex,e.colIndex)}),this.ctx.on(`keydown`,e=>{if(!this.ctx.isTarget(e)||!this.ctx.focusCell||this.ctx.finding)return;let{focusCell:t}=this.ctx;if(e.code===`Escape`&&this.ctx.editing){this.cancel=!0;let{focusCell:e}=this.ctx;e&&(this.ctx.emit(`setSelectorCell`,e),this.cellTarget=e),this.doneEdit();return}if((e.altKey||e.metaKey)&&e.key===`Enter`&&this.ctx.editing&&this.inputEl){e.preventDefault();let t=this.inputEl.selectionStart,n=this.inputEl.value.substring(0,t),r=this.inputEl.value.substring(t);this.inputEl.value=n+`
16
+ `+r,this.inputEl.selectionStart=this.inputEl.selectionEnd=t+1,this.autoSize();return}if(e.code===`Tab`&&this.ctx.editing){if(e.preventDefault(),this.doneEdit(),e.shiftKey){this.ctx.emit(`setMoveFocus`,`LEFT`);return}this.ctx.emit(`setMoveFocus`,`RIGHT`);return}if(e.key===`Enter`&&this.ctx.editing){if(e.preventDefault(),this.doneEdit(),e.shiftKey){this.ctx.emit(`setMoveFocus`,`TOP`);return}this.ctx.emit(`setMoveFocus`,`BOTTOM`);return}if(e.key===`Enter`&&!this.ctx.editing){e.preventDefault(),this.startEdit();return}let n=e.key,r=e.ctrlKey,i=e.altKey,a=e.shiftKey,o=e.metaKey;r||i||a||o||(/* @__PURE__ */ `Enter.CapsLock.Escape.Tab.Backspace.Delete.ArrowUp.ArrowDown.ArrowLeft.ArrowRight.Home.End.PageUp.PageDown.Insert.F1.F2.F3.F4.F5.F6.F7.F8.F9.F10.F11.F12`.split(`.`)).includes(n)||(document.activeElement!==this.inputEl&&t.editorType===`text`?e.preventDefault():this.startEdit(!0))}),this.ctx.on(`cellClick`,e=>{if(this.ctx.stageElement.style.cursor===`pointer`||!this.isInSelectorRange(e.rowIndex,e.colIndex))return;let{xArr:t,yArr:n}=this.ctx.selector,r=JSON.stringify(t)+JSON.stringify(n);if(this.focusInput(),this.selectorArrStr===r&&this.cellTarget&&(this.ctx.config.ENABLE_MERGE_CELL_LINK&&this.ctx.onlyMergeCell||this.ctx.selectOnlyOne&&e.rowKey===this.cellTarget.rowKey&&e.key===this.cellTarget.key))this.startEdit();else if(this.selectorArrStr=r,this.doneEdit(),this.cellTarget=e,this.resetEditorStyle(),this.ctx.config.ENABLE_EDIT_SINGLE_CLICK){if(this.ctx.config.ENABLE_MERGE_CELL_LINK&&this.ctx.onlyMergeCell){this.startEdit();return}this.ctx.selectOnlyOne&&this.startEdit()}})}isTextSelectionActive(){return this.ctx.config.ENABLE_TEXT_SELECTION&&(this.ctx.textSelecting||!!this.ctx.textSelectionStr)}isInSelectorRange(e,t){let{xArr:n,yArr:r}=this.ctx.selector,[i,a]=n,[o,s]=r;return!(t<i||t>a||e<o||e>s)}initTextEditor(){this.inputEl=document.createElement(`textarea`),this.inputEl.id=`e-virt-table-editor-textarea`,this.inputEl.setAttribute(`rows`,`1`),this.inputEl.setAttribute(`tabindex`,`-1`),this.inputEl.addEventListener(`input`,this.autoSize.bind(this)),this.editorEl=this.ctx.editorElement,this.inputEl.className=`e-virt-table-editor-textarea`,this.editorEl.appendChild(this.inputEl),this.ctx.containerElement.appendChild(this.editorEl)}autoSize(){if(!this.ctx.editing)return;let e=this.inputEl.value;if(this.cellTarget&&this.cellTarget.type===`number`&&e!==``&&(this.ctx.emit(`cellHideTooltip`),!/^-?\d+(\.\d+)?$/.test(e))){let e=this.ctx.locale.getText(`numberErrorTip`);this.ctx.emit(`cellShowTooltip`,this.cellTarget,e)}this.inputEl.style.height=`auto`;let t=this.inputEl.scrollHeight,n=this.ctx.body.visibleHeight;t>n&&(t=n);let{stageHeight:r,footer:i,header:a}=this.ctx,o=r-i.height-b(this.ctx.config);this.editorEl.style.bottom=`auto`,this.drawY<a.height&&(this.editorEl.style.top=`${a.height-1}px`),this.drawY+t>o&&(this.editorEl.style.left=`${this.drawX-1}px`,this.editorEl.style.top=`auto`,this.editorEl.style.bottom=`${r-o}px`),this.inputEl.style.height=`${t}px`}startEditByInput(e,t=!1){let n=t?null:e.getValue(),{editorType:r}=e;if(r===`none`)return;e.update(),this.ctx.config.ENABLE_MERGE_CELL_LINK&&e.updateSpanInfo();let{height:i,width:a,drawY:o,drawX:s}=e;this.drawX=s,this.drawY=o;let{config:{CELL_PADDING:c},header:l}=this.ctx,u=this.ctx.body.visibleHeight;i>u&&(i=u),this.editorEl.style.zIndex=`100`,this.editorEl.style.left=`${this.drawX-1}px`,this.editorEl.style.top=`${this.drawY}px`,this.editorEl.style.bottom=`auto`,this.editorEl.style.maxWidth=`none`,this.editorEl.style.border=``,this.editorEl.style.maxHeight=`${u}px`,[`text`].includes(r)?(this.inputEl.style.opacity=`1`,this.inputEl.style.position=`relative`,this.inputEl.style.minWidth=`${a-1}px`,this.inputEl.style.minHeight=`${i-1}px`,this.inputEl.style.maxHeight=`${u}px`,this.inputEl.style.width=`${a}px`,this.inputEl.style.height=`auto`,this.inputEl.style.padding=`${c}px`,this.inputEl.value=``,n!==null&&(this.inputEl.value=n),(this.inputEl.scrollHeight>i||this.drawY<l.height)&&this.autoSize()):(this.inputEl.style.opacity=`0`,this.inputEl.style.zIndex=`-1`,this.inputEl.style.width=`1px`,this.inputEl.style.height=`1px`,this.inputEl.style.position=`absolute`,this.inputEl.style.left=`0px`,this.inputEl.style.top=`0px`)}doneEditByInput(){if(this.cellTarget&&this.cellTarget.editorType===`text`){let{rowKey:e,key:t}=this.cellTarget,n=this.cellTarget.getValue(),r=this.inputEl.value;r!==n&&(r!==``||n!==null)&&!this.cancel&&this.ctx.setItemValueByEditor(e,t,r,!0)}}focusInput(){document.activeElement!==this.inputEl&&this.inputEl.focus({preventScroll:!0})}startEdit(e=!1){if(this.isTextSelectionActive())return;this.cancel=!1;let{ENABLE_EDIT_CLICK_SELECTOR:t}=this.ctx.config;if(!t)return;let n=this.ctx.focusCell;n&&(n.isVerticalVisible()&&n.isHorizontalVisible()||this.ctx.emit(`scrollToIndex`,n.rowIndex,n.colIndex),this.editCell(n.rowIndex,n.colIndex,e))}editCell(e,t,n=!1){let r=this.ctx.body.renderRows.find(t=>t.rowIndex===e);if(!r)return;let i=r.cells.find(e=>e.colIndex===t);if(!i||!(i.isVerticalVisible()&&i.isHorizontalVisible()))return;this.ctx.emit(`setSelectorCell`,i);let a=this.ctx.focusCell;if(!a||[`index`,`index-selection`,`selection`].includes(a.type)||this.enable)return;let{rowKey:o,key:s}=a,c=this.ctx.database.getReadonly(o,s);a&&!c&&(this.enable=!0,this.ctx.editing=!0,this.cellTarget=a,this.startEditByInput(this.cellTarget,n),this.ctx.emit(`startEdit`,this.cellTarget),this.ctx.emit(`draw`))}doneEdit(){this.enable&&(this.doneEditByInput(),this.ctx.emit(`cellHideTooltip`),this.ctx.emit(`doneEdit`,this.cellTarget),this.enable=!1,this.ctx.editing=!1,this.resetEditorStyle(),setTimeout(()=>{this.focusInput()},0),this.ctx.emit(`draw`))}resetEditorStyle(){let e=this.cellTarget;e&&(this.editorEl.style.left=`${e.drawX}px`,this.editorEl.style.top=`${e.drawY}px`,this.editorEl.style.maxWidth=`1px`,this.editorEl.style.maxHeight=`1px`,this.editorEl.style.zIndex=`-1`,this.editorEl.style.border=`none`)}clearEditor(){this.doneEdit(),this.cellTarget=null,this.selectorArrStr=``,this.ctx.clearSelector(),this.ctx.focusCell=void 0,this.inputEl.blur(),this.ctx.emit(`draw`)}destroy(){var e;(e=this.editorEl)==null||e.remove()}},yn=class{constructor(e){K(this,`ctx`),K(this,`emptyEl`),this.ctx=e;let{EMPTY_CUSTOM_STYLE:t}=this.ctx.config;this.ctx.emptyElement?this.emptyEl=this.ctx.emptyElement:(this.emptyEl=document.createElement(`div`),this.emptyEl.innerText=this.getText()),this.emptyEl.className=`e-virt-table-empty`,this.emptyEl.style.display=`none`,this.ctx.containerElement.appendChild(this.emptyEl),this.ctx.on(`emptyChange`,({type:e,headerHeight:n,bodyHeight:r,footerHeight:i})=>{let a=n+(r+i)/2,o={display:e===`empty`?`block`:`none`,top:`${a}px`,...t};Object.assign(this.emptyEl.style,o)})}getText(){return this.ctx.config.EMPTY_TEXT||this.ctx.locale.getText(`emptyText`)}draw(){this.ctx.emptyElement||(this.emptyEl.innerText=this.getText())}destroy(){this.emptyEl.remove()}},bn=class{constructor(e){K(this,`ctx`),K(this,`observer`),this.ctx=e,this.init()}arerMapsEqual(e,t){if(e.size!==t.size)return!1;for(let[n,r]of e)if(!t.has(n)||t.get(n)!==r)return!1;return!0}init(){this.observer=new MutationObserver(n(()=>{let e=this.ctx.overlayerElement.querySelectorAll(`[data-auto-height="true"]`),t=/* @__PURE__ */ new Map;e.forEach(e=>{let n=Number(e.getAttribute(`data-row-index`)),r=Number(e.getAttribute(`data-col-index`));if(isNaN(n)||isNaN(r))return;let i=e.getBoundingClientRect(),a=`${n}​_${r}`;t.set(a,Math.round(i.height))});let n=this.ctx.database.getOverlayerAutoHeightMap();if(!this.arerMapsEqual(n,t)){if(this.ctx.database.setOverlayerAutoHeightMap(t),n.size===0&&t.size===0)return;this.ctx.emit(`draw`)}},16.67)),this.observer.observe(this.ctx.overlayerElement,{childList:!0,subtree:!0,attributes:!0,characterData:!0}),this.ctx.overlayerElement.getAttribute(`data-overlayer`)==="default"&&this.ctx.on(`overlayerChange`,e=>{let t=this.ctx.overlayerElement;t.replaceChildren(),Object.assign(t.style,e.style),e.views.forEach(e=>{let n=document.createElement(`div`);n.className=e.class,Object.assign(n.style,e.style),e.views.forEach(e=>{let t=document.createElement(`div`);Object.assign(t.style,e.style),e.cells.forEach(e=>{let n=document.createElement(`div`);Object.assign(n.style,e.style),Object.keys(e.domDataset||{}).forEach(t=>{n.setAttribute(t,e.domDataset[t])}),typeof e.render==`function`&&e.render(n,e),t.appendChild(n)}),n.appendChild(t)}),t.appendChild(n)})})}draw(){let e=this.getContainer();this.ctx.emit(`overlayerChange`,e)}destroy(){this.observer&&this.observer.disconnect(),this.ctx.emit(`overlayerChange`,{style:{},views:[]})}getContainer(){let e=this.getHeader(),t=this.getBody(),n=this.getFooter(),r=[],{FOOTER_FIXED:i,FOOTER_POSITION:a}=this.ctx.config;return r=i?a===`top`?[e,n,t]:[e,t,n]:[e,t],{views:r}}getHeader(){let{fixedLeftWidth:e,fixedRightWidth:t,config:{CSS_PREFIX:n}}=this.ctx,r=b(this.ctx.config),{visibleWidth:i,visibleHeight:a,renderCellHeaders:o}=this.ctx.header,s=[],c=[],l=[];o.forEach(e=>{e.render&&(e.fixed===`left`?c.push(e):e.fixed===`right`?l.push(e):s.push(e))});let u=t-r,d={key:`left`,style:{position:`absolute`,top:`0px`,left:`0px`,overflow:`hidden`,width:`${e}px`,height:`${a}px`},cells:c},f={key:`center`,style:{position:`absolute`,top:`0px`,left:`${e}px`,overflow:`hidden`,width:`${i-e-u+1}px`,height:`${a}px`},cells:s},p={key:`right`,style:{position:`absolute`,top:`0px`,right:`0px`,overflow:`hidden`,width:`${u+1}px`,height:`${a}px`},cells:l};return{type:`header`,class:`${n}-overlayer-header`,style:{position:`relative`,overflow:`hidden`,width:`${i}px`,height:`${a}px`},views:[d,f,p]}}getBody(){let e=[],t=[],n=[],r=this.ctx.body.renderRows;this.ctx.config.FOOTER_FIXED||(r=r.concat(this.ctx.footer.renderRows)),r.forEach(r=>{r.cells.forEach(r=>{r.cellType===`footer`&&(r.render=r.renderFooter),r.render&&(r.fixed===`left`?t.push(r):r.fixed===`right`?n.push(r):e.push(r))})});let{fixedLeftWidth:i,fixedRightWidth:a,config:{CSS_PREFIX:o}}=this.ctx,s=b(this.ctx.config),{visibleWidth:c,visibleHeight:l}=this.ctx.body,u=a-s,d={key:`left`,style:{position:`absolute`,top:`0.5px`,left:`0.5px`,overflow:`hidden`,width:`${i}px`,height:`${l}px`},cells:t},f={key:`center`,style:{position:`absolute`,top:`0.5px`,left:`${i-.5}px`,overflow:`hidden`,width:`${c-i-u}px`,height:`${l}px`},cells:e},p={key:`right`,style:{position:`absolute`,top:`0px`,right:`0px`,overflow:`hidden`,width:`${u}px`,height:`${l}px`},cells:n};return{type:`body`,class:`${o}-overlayer-body`,style:{position:`relative`,overflow:`hidden`,width:`${c}px`,height:`${l}px`},views:[d,f,p]}}getFooter(){let e=[],t=[],n=[];this.ctx.footer.renderRows.forEach(r=>{r.cells.forEach(r=>{r.cellType===`footer`&&r.renderFooter&&(r.render=r.renderFooter,r.fixed===`left`?t.push(r):r.fixed===`right`?n.push(r):e.push(r))})});let{fixedLeftWidth:r,fixedRightWidth:i,config:{CSS_PREFIX:a}}=this.ctx,o=b(this.ctx.config),{visibleWidth:s,visibleHeight:c}=this.ctx.footer,l=i-o,u={key:`left`,style:{position:`absolute`,top:`0.5px`,left:`0.5px`,overflow:`hidden`,width:`${r}px`,height:`${c}px`},cells:t},d={key:`center`,style:{position:`absolute`,top:`0.5px`,left:`${r-.5}px`,overflow:`hidden`,width:`${s-r-l}px`,height:`${c}px`},cells:e},f={key:`right`,style:{position:`absolute`,top:`0.5px`,right:`0.5px`,overflow:`hidden`,width:`${l}px`,height:`${c}px`},cells:n};return{type:`footer`,class:`${a}-overlayer-footer`,style:{position:`relative`,overflow:`hidden`,width:`${s}px`,height:`${c}px`},views:[u,d,f]}}},xn=class{constructor(e,t=[],n={}){K(this,`container`),K(this,`menuData`),K(this,`onClick`),K(this,`activeSubmenus`,/* @__PURE__ */ new Set),K(this,`boundMouseEnterHandler`),K(this,`boundMouseLeaveHandler`),K(this,`boundClickHandler`),this.container=e,this.menuData=t,this.onClick=n.onClick,this.boundMouseEnterHandler=e=>this.handleMouseEvent(e,`enter`),this.boundMouseLeaveHandler=e=>this.handleMouseEvent(e,`leave`),this.boundClickHandler=e=>this.handleClick(e),this.createMenu(),this.bindEvents()}createMenu(){this.container.className=`e-virt-table-main-menu`,this.container.style.display=`block`;let e=document.createDocumentFragment();this.menuData.forEach(t=>{e.appendChild(this.createMenuItem(t))}),this.container.appendChild(e)}createMenuItem(e,t=!1){var n;let r=this.createElement(`div`,t?`e-virt-table-submenu-item`:`e-virt-table-menu-item`);r.setAttribute(t?`data-submenu`:`data-menu`,e.value),e.disabled&&r.classList.add(`disabled`);let i=this.createElement(`div`,`e-virt-table-menu-item-content`);if(e.icon){let t=this.createElement(`span`,`e-virt-table-menu-item-icon`);t.innerHTML=e.icon,i.appendChild(t)}else i.classList.add(`menu-item-no-icon`);let a=this.createElement(`span`,`e-virt-table-menu-item-text`);if(a.textContent=e.label||``,i.appendChild(a),r.appendChild(i),(n=e.children)!=null&&n.length){let t=this.createElement(`span`,`e-virt-table-menu-arrow`);t.innerHTML=J,r.appendChild(t);let n=this.createSubmenu(e.children);r._submenu=n,this.container.appendChild(n)}return r}createSubmenu(e){let t=this.createElement(`div`,`e-virt-table-submenu`);return e.forEach(e=>{t.appendChild(this.createMenuItem(e,!0))}),t}createElement(e,t=``){let n=document.createElement(e);return t&&(n.className=t),n}bindEvents(){this.container.addEventListener(`mouseenter`,this.boundMouseEnterHandler,!0),this.container.addEventListener(`mouseleave`,this.boundMouseLeaveHandler,!0),this.container.addEventListener(`click`,this.boundClickHandler)}handleMouseEvent(e,t){e.stopPropagation();let n=e.target.closest(`.e-virt-table-menu-item, .e-virt-table-submenu-item`);n&&(this.container.contains(n)||n.classList.contains(`e-virt-table-submenu-item`))&&(t===`enter`?this.handleHover(n):this.handleLeave(n))}handleHover(e){e.classList.contains(`e-virt-table-menu-item`)&&(this.container.querySelectorAll(`.e-virt-table-menu-item`).forEach(e=>e.classList.remove(`active`)),e.classList.contains(`disabled`)||e.classList.add(`active`));let t=e._submenu||e.querySelector(`.e-virt-table-submenu`);t&&(this.hideSiblingSubmenus(e),this.showSubmenu(e,t))}handleLeave(e){let t=e._submenu||e.querySelector(`.e-virt-table-submenu`);setTimeout(()=>{let n=t;n&&!n.matches(`:hover`)&&!e.matches(`:hover`)&&(this.hideSubmenu(n),e.classList.contains(`e-virt-table-menu-item`)&&e.classList.remove(`active`))},150)}hideSiblingSubmenus(e){let t;if(e.classList.contains(`e-virt-table-menu-item`))t=this.container.querySelectorAll(`.e-virt-table-menu-item`);else{let n=e.closest(`.e-virt-table-submenu`);if(n)t=n.querySelectorAll(`.e-virt-table-submenu-item`);else return}t.forEach(t=>{t!==e&&t._submenu&&this.hideSubmenu(t._submenu)})}async showSubmenu(e,t){this.activeSubmenus.has(t)||(this.activeSubmenus.add(t),t.classList.add(`show`),t._cleanup=it(e,t,async()=>{let n=this.container.getBoundingClientRect(),r=window.innerWidth,i=t.offsetWidth||200,a=r-n.right,o=n.left,{x:s,y:c}=await $(e,t,{placement:a>=i||a>=o?`right-start`:`left-start`,middleware:[pn(8),mn({padding:8})]});Object.assign(t.style,{left:`${s}px`,top:`${c}px`})}))}hideSubmenu(e){if(!this.activeSubmenus.has(e))return;this.activeSubmenus.delete(e),e.classList.remove(`show`),this.hideAllChildSubmenus(e);let t=e;t._cleanup&&(t._cleanup(),delete t._cleanup)}hideAllChildSubmenus(e){e.querySelectorAll(`.e-virt-table-submenu-item`).forEach(e=>{if(e._submenu){let t=e._submenu;if(this.activeSubmenus.has(t)){this.activeSubmenus.delete(t),t.classList.remove(`show`);let e=t;e._cleanup&&(e._cleanup(),delete e._cleanup),this.hideAllChildSubmenus(t)}}})}handleClick(e){e.stopPropagation();let t=e.target.closest(`.e-virt-table-menu-item, .e-virt-table-submenu-item`);if(!t||t.classList.contains(`disabled`))return;if(t.classList.contains(`e-virt-table-menu-item`)){let e=t._submenu||t.querySelector(`.e-virt-table-submenu`);if(e){this.showSubmenu(t,e);return}}let n=t.getAttribute(`data-menu`)||t?.getAttribute(`data-submenu`),r=this.findMenuItem(n||``);r&&this.onClick&&this.onClick(r,n||``)}findMenuItem(e,t=this.menuData){for(let n of t){if(n.value===e)return n;if(n.children){let t=this.findMenuItem(e,n.children);if(t)return t}}return null}positionMenu(e){let t={getBoundingClientRect:()=>({width:0,height:0,top:e.clientY,left:e.clientX,right:e.clientX,bottom:e.clientY,x:e.clientX,y:e.clientY}),contextElement:document.body};it(t,this.container,()=>{$(t,this.container,{placement:`right-start`,middleware:[pn(),mn(),hn()]}).then(({x:e,y:t})=>{this.container&&Object.assign(this.container.style,{left:`${e}px`,top:`${t}px`})})})}destroy(){this.container.removeEventListener(`mouseenter`,this.boundMouseEnterHandler,!0),this.container.removeEventListener(`mouseleave`,this.boundMouseLeaveHandler,!0),this.container.removeEventListener(`click`,this.boundClickHandler),this.cleanupAllSubmenus(this.container),this.container.style.display=`none`,this.container.replaceChildren()}removeMenuItem(e){let t=this.container.querySelector(`[data-menu="${e}"]`);if(!t)return!1;let n=t.querySelector(`.e-virt-table-submenu`);return n&&this.cleanupSubmenuRecursively(n),t.remove(),!0}removeSubMenuItem(e){let t=this.container.querySelector(`[data-submenu="${e}"]`);if(!t)return!1;let n=t.closest(`.e-virt-table-submenu`),r=t._submenu;if(r&&this.cleanupSubmenuRecursively(r),t.remove(),n&&n.querySelectorAll(`.e-virt-table-submenu-item`).length===0){let e=this.container.querySelector(`[data-menu]`);if(e&&e._submenu===n)this.removeMenuItem(e.getAttribute(`data-menu`)||``);else{let e=this.container.querySelectorAll(`[data-menu], [data-submenu]`);for(let t of e)if(t._submenu===n){let e=t.getAttribute(`data-menu`)||t.getAttribute(`data-submenu`);e&&(t.hasAttribute(`data-menu`)?this.removeMenuItem(e):this.removeSubMenuItem(e));break}}}return!0}cleanupAllSubmenus(e){e.querySelectorAll(`.e-virt-table-menu-item`).forEach(e=>{e._submenu&&=(this.cleanupSubmenuRecursively(e._submenu),void 0)})}cleanupSubmenuRecursively(e){let t=e;t._cleanup&&(t._cleanup(),delete t._cleanup),e.querySelectorAll(`.e-virt-table-submenu-item`).forEach(e=>{e._submenu&&this.cleanupSubmenuRecursively(e._submenu)}),e.remove()}},Sn=class{constructor(e){K(this,`ctx`),K(this,`contextMenuEl`),K(this,`currentDOMTreeMenu`),K(this,`isCustom`,!1),this.ctx=e,this.ctx.contextMenuElement?(this.contextMenuEl=this.ctx.contextMenuElement,this.contextMenuEl.className=`e-virt-table-main-menu`,this.isCustom=!0):(this.contextMenuEl=document.createElement(`div`),this.isCustom=!1),this.ctx.containerElement.appendChild(this.contextMenuEl),this.init()}init(){this.ctx.on(`outsideMousedown`,()=>{this.hide()}),this.ctx.on(`cellContextMenuClick`,async(e,t)=>{if(this.isCustom){this.contextMenuEl.style.display=`block`,this.positionMenu(t);return}let{ENABLE_CONTEXT_MENU:n,CUSTOM_BODY_CONTEXT_MENU:r,CONTEXT_MENU:i,BEFORE_BODY_CONTEXT_MENU_METHOD:a}=this.ctx.config,o=i.map(e=>({...e,label:e.label||this.ctx.locale.getText(e.value)}));if(o=[...o,...r],a&&(o=await a({list:o,cell:e,hide:this.hide.bind(this)})),!n||o.length===0)return;t.preventDefault();let{xArr:s,yArr:c}=this.ctx.selector,[l,u]=s,[d,f]=c,{rowIndex:p,colIndex:m}=e;p>=d&&p<=f&&m>=l&&m<=u||this.ctx.emit(`setSelectorCell`,e,t),this.currentDOMTreeMenu&&this.currentDOMTreeMenu.destroy(),this.ctx.contextMenuIng=!0,this.currentDOMTreeMenu=new xn(this.contextMenuEl,o,{onClick:(n,r)=>{r===`copy`?(this.ctx.emit(`contextMenuCopy`),this.hide()):r===`paste`?(this.ctx.emit(`contextMenuPaste`),this.hide()):r===`cut`?(this.ctx.emit(`contextMenuCut`),this.hide()):r===`clearSelected`?(this.ctx.emit(`contextMenuClearSelected`),this.hide()):n.event&&n.event(t,{hide:this.hide.bind(this),cell:e})}}),this.currentDOMTreeMenu.positionMenu(t)}),this.ctx.on(`cellHeaderContextMenuClick`,async(e,t)=>{if(this.isCustom){this.contextMenuEl.style.display=`block`,this.positionMenu(t);return}let{SELECTOR_AREA_MIN_X:n,SELECTOR_AREA_MAX_X:r,SELECTOR_AREA_MAX_X_OFFSET:i,BEFORE_HEADER_CONTEXT_MENU_METHOD:a}=this.ctx.config,s=n,c=r||this.ctx.maxColIndex-i;if(e.colIndex<s||e.colIndex>c)return;let{HEADER_CONTEXT_MENU:l,CUSTOM_HEADER_CONTEXT_MENU:u,ENABLE_HEADER_CONTEXT_MENU:d}=this.ctx.config,f=l.map(e=>({...e,label:e.label||this.ctx.locale.getText(e.value)}));if(f=[...f,...u],a&&(f=await a({list:f,cell:e,hide:this.hide.bind(this)})),!d||f.length===0)return;t.preventDefault();let{xArr:p}=this.ctx.selector,[m,h]=p,{colIndex:g}=e;g>=m&&g<=h||(this.ctx.focusCellHeader=e,this.ctx.emit(`selectCols`,e)),this.currentDOMTreeMenu&&this.currentDOMTreeMenu.destroy();let _=this.ctx.database.getColumns(),v=f.map(e=>e.value===`visible`?{...e,children:this.filterColumns(_)}:e);this.ctx.contextMenuIng=!0,this.currentDOMTreeMenu=new xn(this.contextMenuEl,v,{onClick:(n,r)=>{let{xArr:i}=this.ctx.selector,[a,s]=i;if(r===`fixedLeft`||r===`fixedRight`||r===`fixedNone`){let e=this.ctx.header.allCellHeaders.filter(e=>e.colIndex>=a&&e.colIndex<=s).filter(e=>e.level===0).filter(e=>!e.column.fixedDisabled).map(e=>e.key);this.ctx.database.setCustomHeaderFixedData(e,r===`fixedLeft`?`left`:r===`fixedRight`?`right`:``),this.hide()}else if(r===`hide`){let e=this.ctx.header.leafCellHeaders.filter(e=>e.colIndex>=a&&e.colIndex<=s).filter(e=>!e.children.length).filter(e=>!e.column.hideDisabled).map(e=>e.key);e.length>0&&this.ctx.database.setCustomHeaderHideData(e,!0),this.hide()}else if(r!==`visible`){if(r.startsWith(`visible_`)){if(!n.key)return;if(n.children){let e=this.getLeafKeys(n.children);this.ctx.database.setCustomHeaderHideData(e,!1)}else this.ctx.database.setCustomHeaderHideData([n.key],!1);this.currentDOMTreeMenu&&this.currentDOMTreeMenu.removeSubMenuItem(r),o(this.ctx.database.getColumns()).filter(e=>e.hide).length===0&&this.hide()}else r===`resetHeader`?(this.ctx.database.resetCustomHeader(),this.hide()):n.event&&n.event(t,{hide:this.hide.bind(this),cell:e})}}}),this.positionMenu(t)}),this.ctx.on(`click`,()=>{this.hide()}),this.ctx.on(`onScroll`,this.hide.bind(this)),this.ctx.on(`resize`,this.hide.bind(this))}positionMenu(e){let t={getBoundingClientRect:()=>({width:0,height:0,top:e.clientY,left:e.clientX,right:e.clientX,bottom:e.clientY,x:e.clientX,y:e.clientY}),contextElement:document.body};it(t,this.contextMenuEl,()=>{$(t,this.contextMenuEl,{placement:`right-start`,middleware:[pn(),mn(),hn()]}).then(({x:e,y:t})=>{this.contextMenuEl&&Object.assign(this.contextMenuEl.style,{left:`${e}px`,top:`${t}px`})})})}filterColumns(e){let t=[];for(let n of e)if(n.children&&n.children.length>0){let e=this.filterColumns(n.children);e.length>0&&t.push({label:n.title,key:n.key,value:`visible_${n.key}`,children:e})}else n.hide&&t.push({label:n.title,value:`visible_${n.key}`,key:n.key});return t}getLeafKeys(e){return e.reduce((e,t)=>(!t.children||t.children.length===0?e.push(String(t.key)):e.push(...this.getLeafKeys(t.children)),e),[])}hide(){this.currentDOMTreeMenu&&=(this.currentDOMTreeMenu.destroy(),void 0),this.contextMenuEl.style.display=`none`,this.ctx.contextMenuIng=!1}destroy(){var e;this.hide(),(e=this.contextMenuEl)==null||e.remove()}},Cn=class{constructor(e){if(K(this,`ctx`),K(this,`loadingEl`),K(this,`textEl`,document.createElement(`p`)),this.ctx=e,this.ctx.loadingElement)this.loadingEl=this.ctx.loadingElement;else{this.loadingEl=document.createElement(`div`);let e=document.createElement(`div`);e.className=`e-virt-table-loading-spinner`;let t=this.ctx.icons.getSvg(`loading`);if(t){let n=new DOMParser().parseFromString(t.svg,`image/svg+xml`).documentElement;e.appendChild(n)}this.textEl.className=`e-virt-table-loading-text`,this.textEl.innerText=this.getText(),e.appendChild(this.textEl),this.loadingEl.appendChild(e)}this.loadingEl.className=`e-virt-table-loading`,this.loadingEl.style.display=`none`,this.ctx.containerElement.appendChild(this.loadingEl)}getText(){return this.ctx.config.LOADING_TEXT||this.ctx.locale.getText(`loadingText`)}show(){this.loadingEl.style.display=`flex`}hide(){this.loadingEl.style.display=`none`}draw(){this.ctx.loadingElement||(this.textEl.innerText=this.getText())}destroy(){this.loadingEl.remove()}},wn=class{constructor(e){K(this,`ctx`),K(this,`container`),K(this,`input`),K(this,`prevBtn`),K(this,`nextBtn`),K(this,`closeBtn`),K(this,`countEl`),K(this,`loadingEl`),K(this,`isVisible`,!1),K(this,`searchResults`,[]),K(this,`currentIndex`,-1),K(this,`searchData`,[]),K(this,`isComposing`,!1),this.ctx=e,this.container=this.createContainer(),this.ctx.containerElement.appendChild(this.container),this.bindEvents(),this.ctx.on(`keydown`,e=>{if(this.ctx.config.ENABLE_FINDER&&!this.ctx.editing){if((e.ctrlKey||e.metaKey)&&e.code===`KeyF`){e.preventDefault(),this.show();return}if(this.ctx.finding){if(e.code===`Escape`){e.preventDefault(),this.hide();return}if(e.code===`ArrowUp`||e.shiftKey&&e.key===`Enter`){e.preventDefault(),this.navigatePrevious();return}if(e.code===`ArrowDown`||e.key===`Enter`){e.preventDefault(),this.navigateNext();return}}}}),this.ctx.on(`setSelector`,()=>{this.hide()}),this.ctx.on(`outsideMousedown`,()=>{this.hide()})}async initSearchData(){this.showLoading(),this.searchData=[],setTimeout(()=>{let{allCellHeaders:e}=this.ctx.header;for(let t=0;t<e.length;t++){let n=e[t];if(!n)continue;let r=n.getFinderText();r&&this.searchData.push({rowIndex:n.level,colIndex:n.colIndex,text:r,type:`header`,colKey:n.key})}let{maxColIndex:t,maxRowIndex:n}=this.ctx;for(let e=0;e<=n;e++)for(let n=0;n<=t;n++){let t=this.ctx.database.getVirtualBodyCell(e,n,!1)?.getFinderText();t&&this.searchData.push({rowIndex:e,colIndex:n,text:t,type:`body`})}for(let e of this.ctx.footer.renderRows)for(let t of e.cells){let e=t.getFinderText();e&&this.searchData.push({rowIndex:t.rowIndex,colIndex:t.colIndex,text:e,type:`footer`})}this.hideLoading()},0)}createContainer(){let e=document.createElement(`div`);e.className=`e-virt-table-finder-bar`;let t=document.createElement(`div`);t.className=`e-virt-table-finder-bar-input-wrapper`,this.input=document.createElement(`input`),this.input.type=`text`,this.input.className=`e-virt-table-finder-bar-input`,this.input.placeholder=``,t.appendChild(this.input),this.loadingEl=document.createElement(`div`),this.loadingEl.className=`e-virt-table-finder-bar-loading`;let n=St;this.loadingEl.innerHTML=n,t.appendChild(this.loadingEl),this.countEl=document.createElement(`span`),this.countEl.className=`e-virt-table-finder-bar-count`;let r=document.createElement(`div`);return r.className=`e-virt-table-finder-bar-nav`,this.prevBtn=document.createElement(`button`),this.prevBtn.className=`e-virt-table-finder-bar-nav-btn prev-btn`,this.prevBtn.innerHTML=J,this.nextBtn=document.createElement(`button`),this.nextBtn.className=`e-virt-table-finder-bar-nav-btn next-btn`,this.nextBtn.innerHTML=J,r.appendChild(this.prevBtn),r.appendChild(this.nextBtn),this.closeBtn=document.createElement(`button`),this.closeBtn.className=`e-virt-table-finder-bar-nav-btn close-btn`,this.closeBtn.innerHTML=`×`,e.appendChild(t),e.appendChild(this.countEl),e.appendChild(r),e.appendChild(this.closeBtn),e}bindEvents(){this.input.addEventListener(`input`,()=>{this.isComposing||this.performSearch()}),this.input.addEventListener(`compositionstart`,()=>{this.isComposing=!0}),this.input.addEventListener(`compositionend`,()=>{this.isComposing=!1,this.performSearch()}),this.prevBtn.addEventListener(`click`,()=>{this.navigatePrevious()}),this.nextBtn.addEventListener(`click`,()=>{this.navigateNext()}),this.closeBtn.addEventListener(`click`,()=>{this.hide()})}performSearch(){let e=this.input.value.trim();this.searchResults=[],this.currentIndex=-1,e?(this.showLoading(),setTimeout(()=>{this.searchResults=this.searchData.filter(t=>t.text.toLowerCase().includes(e.toLowerCase())),this.searchResults.length>0?(this.currentIndex=0,this.scrollToCurrentResult()):this.cearFinderBar(),this.updateCount(),this.hideLoading()},0)):(this.cearFinderBar(),this.updateCount())}scrollToCurrentResult(){if(this.currentIndex<0||this.currentIndex>=this.searchResults.length)return;let e=this.searchResults[this.currentIndex];this.ctx.finderBar=e;let{rowIndex:t,colIndex:n}=e;this.ctx.emit(`scrollToIndex`,t,n,e.type)}navigateNext(){this.searchResults.length!==0&&(this.currentIndex=(this.currentIndex+1)%this.searchResults.length,this.scrollToCurrentResult(),this.updateCount())}navigatePrevious(){this.searchResults.length!==0&&(this.currentIndex=this.currentIndex<=0?this.searchResults.length-1:this.currentIndex-1,this.scrollToCurrentResult(),this.updateCount())}updateCount(){if(this.searchResults.length===0)this.input.value.trim()?(this.countEl.textContent=`0/0`,this.countEl.classList.add(`no-results`)):(this.countEl.textContent=``,this.countEl.classList.remove(`no-results`));else{let e=this.currentIndex+1,t=this.searchResults.length;this.countEl.textContent=`${e}/${t}`,this.countEl.classList.remove(`no-results`)}}show(){this.isVisible||(this.isVisible=!0,this.ctx.finding=!0,this.container.classList.add(`show`),this.input.focus(),this.initSearchData())}showLoading(){var e;this.loadingEl.classList.add(`show`),(e=this.loadingEl.parentElement)==null||e.classList.add(`loading`),this.input.readOnly=!0}hideLoading(){var e;this.loadingEl.classList.remove(`show`),(e=this.loadingEl.parentElement)==null||e.classList.remove(`loading`),this.input.readOnly=!1}cearFinderBar(){this.ctx.finderBar={rowIndex:-1,colIndex:-1,text:``,type:`header`},this.ctx.emit(`draw`)}hide(){this.isVisible&&(this.isVisible=!1,this.container.classList.remove(`show`),this.ctx.finding=!1,this.input.value=``,this.searchResults=[],this.searchData=[],this.currentIndex=-1,this.hideLoading(),this.ctx.finderBar={rowIndex:-1,colIndex:-1,text:``,type:`header`},this.updateCount(),this.ctx.emit(`draw`))}destroy(){this.hide(),this.container.remove()}},Tn=class e{constructor(e){K(this,`ctx`),K(this,`layouts`,/* @__PURE__ */ new Map),K(this,`activeCellKey`,``),K(this,`selectionStart`,null),K(this,`selectionEnd`,null),K(this,`pending`,null),this.ctx=e,this.ctx.on(`registerTextLayout`,(e,t)=>this.layouts.set(e,t)),this.ctx.on(`mousedown`,e=>this.onMouseDown(e)),this.ctx.on(`mousemove`,e=>this.onMouseMove(e)),this.ctx.on(`mouseup`,()=>this.onMouseUp()),this.ctx.on(`cellHeaderHoverChange`,e=>this.yieldToColumnDrag(e)),this.ctx.on(`cellHoverChange`,()=>this.yieldToColumnDrag()),this.ctx.on(`setSelector`,()=>this.yieldToSelectorSpan()),this.ctx.on(`keydown`,e=>this.onCopyKeydown(e)),this.ctx.on(`outsideMousedown`,()=>this.resetSelection())}get canSelect(){return this.ctx.config.ENABLE_TEXT_SELECTION&&!this.ctx.editing&&!this.ctx.finding&&!this.isSelectorSpanningCells}get isSelectorSpanningCells(){return this.ctx.selector.enable&&!this.ctx.selectOnlyOne&&!this.ctx.onlyMergeCell}yieldToSelectorSpan(){this.isSelectorSpanningCells&&this.resetSelection()}yieldToColumnDrag(e){let t=this.ctx.focusCellHeader;if(this.ctx.textSelecting&&t){if(e){let n=t.colIndex,r=t.colIndex+t.colspan-1,i=e.colIndex,a=e.colIndex+e.colspan-1;if(i>=n&&a<=r)return}this.resetSelection()}}onMouseDown(e){if(!this.canSelect||!this.ctx.isTarget(e))return;this.ctx.containerElement.contains(document.activeElement)||this.ctx.containerElement.focus({preventScroll:!0});let t=this.hitTest(e);if(!t){this.resetSelection();return}let{offsetX:n,offsetY:r}=this.ctx.getOffset(e);this.pending={cellKey:t.cellKey,index:t.index,startX:n,startY:r}}onMouseMove(e){if(!this.canSelect||(this.ctx.textSelecting||this.tryStartDrag(e),!this.ctx.textSelecting))return;let t=this.layouts.get(this.activeCellKey);if(!t)return;let{offsetX:n,offsetY:r}=this.ctx.getOffset(e),i=this.hitTestText(t,n,r);i!==null&&(this.selectionEnd=i,this.updateSelection())}tryStartDrag(t){if(!this.pending||!this.ctx.mousedown)return;let{offsetX:n,offsetY:r}=this.ctx.getOffset(t),i=Math.abs(n-this.pending.startX),a=Math.abs(r-this.pending.startY);if(i<e.DRAG_THRESHOLD&&a<e.DRAG_THRESHOLD)return;let o=this.hitTest(t);!o||o.cellKey!==this.pending.cellKey?this.pending=null:(this.activeCellKey=this.pending.cellKey,this.selectionStart=this.pending.index,this.selectionEnd=o.index,this.pending=null,this.ctx.textSelecting=!0,this.updateSelection())}onMouseUp(){this.pending=null,this.ctx.textSelecting=!1,this.ctx.textSelectionStr=this.getSelectedText(),this.ctx.textSelectionStr&&this.ctx.emit(`drawView`)}onCopyKeydown(e){var t;if(!this.canSelect||!e.ctrlKey&&!e.metaKey||e.code!==`KeyC`)return;let n=this.getSelectedText();n&&(e.preventDefault(),(t=navigator.clipboard)==null||t.writeText(n).catch(e=>console.error(`Copy Failure:`,e)))}hitTest(e){let{offsetX:t,offsetY:n}=this.ctx.getOffset(e),r=null;for(let[e,i]of this.layouts){let a=this.hitTestText(i,t,n);a!==null&&(r={cellKey:e,index:a})}return r}updateSelection(){this.ctx.textSelectionStr=this.getSelectedText(),this.ctx.emit(`drawView`)}hitTestText(e,t,n){let{glyphs:r,contentY:i,lineHeight:a,lines:o}=e;if(!r.length)return null;let s=Math.floor((n-i)/a);if(s<0||s>=o.length)return null;let c=r.filter(e=>e.line===s);if(!c.length)return null;let l=i+s*a;if(n<l-2||n>=l+a+2)return null;let u=c[0],d=c[c.length-1];if(t<u.x-2||t>d.x+d.width+2)return null;if(t<=u.x)return u.index;for(let e of c)if(t<e.x+e.width/2)return e.index;return d.index+1}clearLayouts(){this.layouts.clear()}draw(){if(!this.ctx.config.ENABLE_TEXT_SELECTION||this.isSelectorSpanningCells)return;let e=this.getSelectionRange(),t=e&&this.layouts.get(this.activeCellKey);t&&this.drawTextSelection(t,e)}drawTextSelection(e,t,n=`#fff`,r=`#3b82f6`){if(t.start>=t.end)return;let i=/* @__PURE__ */ new Map;for(let n of e.glyphs){if(n.index<t.start||n.index>=t.end)continue;let e=i.get(n.line)??[];e.push(n),i.set(n.line,e)}if(!i.size)return;let a=this.ctx.paint.getCtx();a.save(),a.font=e.font,a.textBaseline=`middle`,a.textAlign=`left`,i.forEach(t=>{let i=t[0],o=t[t.length-1];a.fillStyle=r,a.fillRect(i.x,i.y-1,o.x+o.width-i.x,i.height),a.fillStyle=n;for(let n of t)a.fillText(n.char,n.x,n.y+e.lineHeight/2)}),a.restore()}getSelectionRange(){return this.selectionStart===null||this.selectionEnd===null?null:{start:Math.min(this.selectionStart,this.selectionEnd),end:Math.max(this.selectionStart,this.selectionEnd)}}getSelectedText(){let e=this.getSelectionRange(),t=e&&this.layouts.get(this.activeCellKey);return!t||e.start>=e.end?``:t.chars.slice(e.start,e.end).join(``)}resetSelection(){!this.activeCellKey&&this.selectionStart===null&&!this.pending&&!this.ctx.textSelecting&&!this.ctx.textSelectionStr||(this.activeCellKey=``,this.selectionStart=null,this.selectionEnd=null,this.pending=null,this.ctx.textSelecting=!1,this.ctx.textSelectionStr=``,this.ctx.emit(`drawView`))}destroy(){this.layouts.clear(),this.resetSelection()}},K(Tn,`DRAG_THRESHOLD`,4),En=Tn,Dn=class e{constructor(e,t){K(this,`options`),K(this,`scroller`),K(this,`header`),K(this,`body`),K(this,`footer`),K(this,`selector`),K(this,`autofill`),K(this,`tooltip`),K(this,`editor`),K(this,`empty`),K(this,`overlayer`),K(this,`contextMenu`),K(this,`loading`),K(this,`finderBar`),K(this,`textSelector`),K(this,`animationFrameId`),K(this,`ctx`),this.options=t;let{overlayerElement:n,editorElement:r,emptyElement:i,contextMenuElement:a}=this.options,o=this.createContainer(e,n,r,i,a);this.ctx=new Pt(o,this.options),this.textSelector=new En(this.ctx),this.header=new zt(this.ctx),this.footer=new Ht(this.ctx),this.body=new Vt(this.ctx),this.scroller=new It(this.ctx),this.selector=new Ut(this.ctx),this.autofill=new Wt(this.ctx),this.tooltip=new _n(this.ctx),this.empty=new yn(this.ctx),this.editor=new vn(this.ctx),this.overlayer=new bn(this.ctx),this.contextMenu=new Sn(this.ctx),this.loading=new Cn(this.ctx),this.finderBar=new wn(this.ctx),this.ctx.on(`loadData`,e=>{this.loadData(e)}),this.ctx.on(`draw`,()=>{this.draw()}),this.ctx.on(`drawView`,()=>{this.draw(!0)}),this.draw()}static useLocale(t){e.locale=t}createContainer(e,t,n,r,i){e.className=`e-virt-table-container`;let a=document.createElement(`div`),o=document.createElement(`canvas`),s=t||document.createElement(`div`);a.className=`e-virt-table-stage`,e.tabIndex=0,o.className=`e-virt-table-canvas`,s.className=`e-virt-table-overlayer`,s.setAttribute(`data-overlayer`,t?`custom`:`default`);let c=n||document.createElement(`div`);c.className=`e-virt-table-editor`;let l=r,u=i;return a.appendChild(o),a.appendChild(s),e.appendChild(a),{containerElement:e,stageElement:a,canvasElement:o,overlayerElement:s,editorElement:c,emptyElement:l,contextMenuElement:u}}doDraw(e=!1){this.updateStageBorder(),this.header.update(),this.body.update(),this.footer.update(),this.ctx.paint.clear(),this.textSelector.clearLayouts(),this.body.draw(),this.footer.draw(),this.header.draw(),this.textSelector.draw(),this.body.drawDragRowTip(),this.scroller.draw(),this.empty.draw(),this.loading.draw(),e||this.overlayer.draw()}updateStageBorder(){let{BORDER:e,BORDER_COLOR:t,BORDER_RADIUS:n}=this.ctx.config;this.ctx.stageElement.dataset.borderStyle=O(e),this.ctx.stageElement.style.borderColor=ne(e)?t:`transparent`,this.ctx.stageElement.style.borderRadius=`${n}px`}draw(e=!1){this.animationFrameId&&cancelAnimationFrame(this.animationFrameId),this.animationFrameId=requestAnimationFrame(()=>{this.doDraw(e),this.body.updateAutoHeight()&&this.doDraw(e)})}loadConfig(e){this.ctx.config.init(e),this.ctx.database.init(!1),this.header.init(),this.ctx.emit(`draw`)}loadColumns(e){this.editor.doneEdit(),this.ctx.database.setColumns(e),this.header.init(),this.ctx.emit(`draw`)}loadData(e){this.editor.doneEdit(),this.ctx.database.setData(e),this.header.init(),this.tooltip.hide(),this.ctx.emit(`draw`)}loadFooterData(e){this.ctx.database.setFooterData(e),this.ctx.emit(`draw`)}setCustomHeader(e,t=!0){this.ctx.database.setCustomHeader(e,t),this.header.init(),this.ctx.emit(`draw`)}getCustomHeader(){return this.header.getCustomHeader()}showColumns(e,t=!0){this.ctx.database.setCustomHeaderHideData(e,!t),this.header.init(),this.ctx.emit(`draw`)}fixedColumns(e,t){this.ctx.database.setCustomHeaderFixedData(e,t),this.header.init(),this.ctx.emit(`draw`)}setLoading(e){this.ctx.loading=e,e?this.loading.show():this.loading.hide()}on(e,t){this.ctx.on(e,t)}emit(e,...t){this.ctx.emit(e,...t)}off(e,t){this.ctx.off(e,t)}filterMethod(e){this.ctx.database.setFilterMethod(e),this.ctx.database.init(!1),this.header.init(),this.ctx.emit(`draw`)}editCell(e,t){this.editor.editCell(e,t)}setItemValue(e,t,n,r=!0,i=!0,a=!1,o=!0){this.ctx.database.setItemValue(e,t,n,r,i,a,o)}batchSetItemValue(e,t=!0,n=!0){this.ctx.database.batchSetItemValue(e,t,n)}setItemValueByEditor(e,t,n,r=!0,i=!0,a=!0){this.ctx.setItemValueByEditor(e,t,n,r,i,a),this.editor.doneEdit()}clearEditableData(e=null){let t=[0,this.ctx.maxColIndex],n=[0,this.ctx.maxRowIndex];return this.selector.clearSelectedData(t,n,!1,e)}clearEditor(){this.editor.clearEditor()}doLayout(){this.ctx.emit(`draw`)}getChangedData(){return this.ctx.database.getChangedData()}getChangedRows(){return this.ctx.database.getChangedRows()}setCurrentRowByRowIndex(e){this.ctx.currentCell=this.ctx.database.getVirtualBodyCell(e,0),this.ctx.emit(`draw`)}setCurrentRow(e){let t=this.ctx.database.getColumnByColIndex(0);t&&(this.ctx.currentCell=this.ctx.database.getVirtualBodyCellByKey(e,t.key),this.ctx.emit(`draw`))}getCurrentRow(){let e=this.ctx.currentCell;return e?{row:e.row,rowIndex:e.rowIndex,rowKey:e.rowKey}:void 0}clearValidate(){this.ctx.database.clearValidate(),this.ctx.emit(`draw`)}validateFields(e,t=!0){return new Promise(async(n,r)=>{let i=[];for(let t=0;t<e.length;t++){let{rowKey:n,key:r}=e[t],a=await this.ctx.database.getValidator(n,r);Array.isArray(a)&&a.length&&i.push(a)}if(i.length){if(r(i),t){let[e]=i;if(Array.isArray(e)&&e.length){let[t]=e,{rowKey:n,key:r}=t;this.scrollToRowkey(n),this.scrollToColkey(r)}}this.ctx.emit(`draw`)}else n([]),this.ctx.emit(`draw`)})}async validate(e=!0){return new Promise(async(t,n)=>{try{t(await this.getValidations())}catch(t){if(e&&Array.isArray(t)&&t.length){let[e]=t;if(Array.isArray(e)&&e.length){let[t]=e,{rowKey:n,key:r}=t,i=this.ctx.database.getRowForRowKey(n);if(i){let{parentRowKeys:e=[]}=i;e&&e.length&&this.setExpandRowKeys(e,!0)}this.scrollToRowkey(n),this.scrollToColkey(r)}}n(t)}})}setValidations(e){if(e.forEach(e=>{let{rowIndex:t,key:n,message:r,rowKey:i}=e;if(t!==void 0&&i===void 0){let e=this.ctx.database.getRowKeyForRowIndex(t);this.ctx.database.setValidationErrorByRowKey(e,n,r)}i&&this.ctx.database.setValidationErrorByRowKey(i,n,r)}),e&&Array.isArray(e)&&e.length){let[t]=e;if(t&&t.rowKey)this.scrollToRowkey(t.rowKey),this.scrollToColkey(t.key);else if(t&&t.rowIndex!==void 0&&t.rowIndex>=0&&t.key){let{rowIndex:e,key:n}=t;this.scrollToRowIndex(e),this.scrollToColkey(n)}}}getValidations(){return this.ctx.config.DISABLED?new Promise(e=>{e([])}):new Promise(async(e,t)=>{let n=this.ctx.database.getAllRowsData(),r=this.ctx.header.leafCellHeaders,i=[];for(let e=0;e<n.length;e++)for(let t=0;t<r.length;t++){let a=this.ctx.database.getRowKeyByItem(n[e]),o=r[t].key,s=await this.ctx.database.getValidator(a,o);Array.isArray(s)&&s.length&&i.push(s)}i.length?(t(i),this.ctx.emit(`draw`)):(e([]),this.ctx.emit(`draw`))})}hasValidationError(){return this.ctx.database.hasValidationError()}scrollTo(e,t){this.scroller.setScroll(e,t)}scrollXTo(e){this.scroller.setScrollX(e)}scrollToColkey(e){this.scroller.scrollToColkey(e)}scrollToRowkey(e){this.scroller.scrollToRowKey(e)}scrollToColIndex(e){this.scroller.scrollToColIndex(e)}scrollToRowIndex(e){this.scroller.scrollToRowIndex(e)}scrollYTo(e){this.scroller.setScrollY(e)}setExpandRowKeys(e,t=!0){this.ctx.database.setExpandRowKeys(e,t)}getExpandRowKeys(){return this.ctx.database.getExpandRowKeys()}clearSelection(){this.ctx.database.clearSelection(),this.ctx.emit(`draw`)}toggleRowSelection(e){let t=this.ctx.database.getRowKeyByItem(e);this.ctx.database.toggleRowSelection(t),this.ctx.emit(`draw`)}setSelectionByRows(e,t=!0){e.forEach(e=>{let n=this.ctx.database.getRowKeyByItem(e);this.ctx.database.setRowSelection(n,t,!1)}),this.ctx.emit(`selectionChange`,this.getSelectionRows()),this.ctx.emit(`draw`)}setSelectionByRowKeys(e,t=!0){e.forEach(e=>{this.ctx.database.setRowSelection(e,t,!1)}),this.ctx.emit(`selectionChange`,this.getSelectionRows()),this.ctx.emit(`draw`)}toggleAllSelection(){this.ctx.database.toggleAllSelection(),this.ctx.emit(`draw`)}toggleRowExpand(e,t){this.ctx.database.expandItem(e,t),this.ctx.emit(`draw`)}toggleExpandAll(e){this.ctx.database.expandAll(e),this.ctx.emit(`draw`)}getSelectionRows(){return this.ctx.database.getSelectionRows()}getPositionForRowIndex(e){return this.ctx.database.getPositionForRowIndex(e)}getCellValue(e,t){return this.ctx.database.getItemValue(e,t)}getCellValueByIndex(e,t){return this.ctx.database.getItemValueForRowIndexAndColIndex(e,t)}clearSort(){this.ctx.database.clearSort()}contextMenuHide(){this.contextMenu.hide()}getUtils(){return{mergeColCell:p,mergeRowCell:f,getSpanArrByRow:u,getSpanObjByColumn:d}}getColumnByKey(e){return this.ctx.database.getColumnByKey(e)?.column}clearChangeData(){this.ctx.database.clearChangeData(),this.ctx.emit(`draw`)}getReadonly(e,t){return this.ctx.database.getReadonly(e,t)}useLocale(e){this.ctx.locale.use(e)}destroy(){this.overlayer.destroy(),this.empty.destroy(),this.editor.destroy(),this.tooltip.destroy(),this.selector.destroy(),this.autofill.destroy(),this.contextMenu.destroy(),this.loading.destroy(),this.finderBar.destroy(),this.textSelector.destroy(),this.ctx.destroy(),this.ctx.containerElement.remove()}},K(Dn,`locale`),On=Dn})))()}kn();export{On as default};