@datalayer/agent-runtimes 1.6.83 → 1.6.85

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 (826) hide show
  1. package/dist-embed/chunks/{AgentDetails-LhuDov4Q.js → AgentDetails-BRhO9qA_.js} +1 -1
  2. package/dist-embed/chunks/AgentDetailsDialog-DAWAmYS1.js +1 -0
  3. package/dist-embed/chunks/{CellSidebarExtension-DwGg7VbR.js → CellSidebarExtension-BMTA9AQz.js} +1 -1
  4. package/dist-embed/chunks/{CollapsiblePlugin-DS2HZl7a.js → CollapsiblePlugin-D_fVK4i3.js} +1 -1
  5. package/dist-embed/chunks/ContextPie-h_II4EDU.js +1 -0
  6. package/dist-embed/chunks/{DeckComponent-1aJoEglD.js → DeckComponent-CGFO-xGa.js} +2 -2
  7. package/dist-embed/chunks/{DocumentView-CaVDL8X7.js → DocumentView-BzBCyOZP.js} +1 -1
  8. package/dist-embed/chunks/{EphemeralDocument-SeXQLZbi.js → EphemeralDocument-spGg7WCy.js} +1 -1
  9. package/dist-embed/chunks/{EphemeralNotebook-DrL1r8Nx.js → EphemeralNotebook-BqUNh0zm.js} +1 -1
  10. package/dist-embed/chunks/{ExcalidrawComponent-CoZvA0u7.js → ExcalidrawComponent-Cb0JOQDr.js} +1 -1
  11. package/dist-embed/chunks/{ExcalidrawModal-Czd2Kx8H.js → ExcalidrawModal-MG-b9Tus.js} +1 -1
  12. package/dist-embed/chunks/{JupyterLexicalExtension-Du1Loz2o.js → JupyterLexicalExtension-lz41mjjY.js} +29 -29
  13. package/dist-embed/chunks/{KernelVariables-CmWkosM8.js → KernelVariables-BXCbgHG5.js} +1 -1
  14. package/dist-embed/chunks/{LexicalToolRegistry-BZUJ9wvF.js → LexicalToolRegistry-rXaW8uXA.js} +4 -4
  15. package/dist-embed/chunks/{NotebookToolSurfaces-m37Crb7c.js → NotebookToolSurfaces-BT_hNR4k.js} +1 -1
  16. package/dist-embed/chunks/{NotebookView-DeCxHOph.js → NotebookView-wYwtORMB.js} +1 -1
  17. package/dist-embed/chunks/{Output-CJVIj3Io.js → Output-BfjIM99o.js} +1 -1
  18. package/dist-embed/chunks/{SandboxDetailsDialog-B4_0r2A_.js → SandboxDetailsDialog-B_nI8zH_.js} +1 -1
  19. package/dist-embed/chunks/{SchemaForm-9JmMbUiD.js → SchemaForm-1QzMu6Zk.js} +1 -1
  20. package/dist-embed/chunks/{SheetTabs-DJLVReVo.js → SheetTabs-DJG69znU.js} +2 -2
  21. package/dist-embed/chunks/{SpreadsheetPreviewView-BGdz5D65.js → SpreadsheetPreviewView-5marsdKE.js} +1 -1
  22. package/dist-embed/chunks/{SpreadsheetView-BvCWGCsx.js → SpreadsheetView-CmD-dAjn.js} +1 -1
  23. package/dist-embed/chunks/{WidgetVariableView-B9KgSbhv.js → WidgetVariableView-Dqsy8MDf.js} +1 -1
  24. package/dist-embed/chunks/{YouTubePlugin-DtVTIrdm.js → YouTubePlugin-BLdLNfNB.js} +1 -1
  25. package/dist-embed/chunks/{abnfDiagram-VCTEODGH-DN0kRlog.js → abnfDiagram-VCTEODGH-BSmEjUJk.js} +1 -1
  26. package/dist-embed/chunks/{abnfDiagram-VCTEODGH-BG9Jt7Hr.js → abnfDiagram-VCTEODGH-CF8QpiZa.js} +1 -1
  27. package/dist-embed/chunks/{abnfDiagram-VCTEODGH-CvZ8usho.js → abnfDiagram-VCTEODGH-GnaR64st.js} +1 -1
  28. package/dist-embed/chunks/{ar-SA-G6X2FPQ2-C-nP9nq8.js → ar-SA-G6X2FPQ2-Boa4jpGN.js} +1 -1
  29. package/dist-embed/chunks/{architectureDiagram-5GKGNRK7-Bwqgkba9.js → architectureDiagram-5GKGNRK7-ByAYkSMW.js} +1 -1
  30. package/dist-embed/chunks/{architectureDiagram-5GKGNRK7-DRfUn2vu.js → architectureDiagram-5GKGNRK7-Cy6c9GhS.js} +1 -1
  31. package/dist-embed/chunks/{architectureDiagram-5GKGNRK7-87FtCsnw.js → architectureDiagram-5GKGNRK7-b_EnmOeS.js} +1 -1
  32. package/dist-embed/chunks/{az-AZ-76LH7QW2-WoAwmwN_.js → az-AZ-76LH7QW2-DS7v8DUm.js} +1 -1
  33. package/dist-embed/chunks/{bg-BG-XCXSNQG7-SLqAK6qo.js → bg-BG-XCXSNQG7-CPWbvkhp.js} +1 -1
  34. package/dist-embed/chunks/{blockDiagram-868be97b-CH6k87Wa.js → blockDiagram-868be97b-C6Xxmbgc.js} +1 -1
  35. package/dist-embed/chunks/{blockDiagram-I7D4REHJ-BWHrrqXo.js → blockDiagram-I7D4REHJ-BBd_q6Z7.js} +1 -1
  36. package/dist-embed/chunks/{blockDiagram-I7D4REHJ-DUfJri3_.js → blockDiagram-I7D4REHJ-Clrwi7_Q.js} +1 -1
  37. package/dist-embed/chunks/{blockDiagram-I7D4REHJ-BjLfxD7u.js → blockDiagram-I7D4REHJ-zXh6gZYF.js} +1 -1
  38. package/dist-embed/chunks/{bn-BD-2XOGV67Q-DfCeTaG1.js → bn-BD-2XOGV67Q-DJlv8gSj.js} +1 -1
  39. package/dist-embed/chunks/{c4Diagram-3f4bdde3-ufrtLRrD.js → c4Diagram-3f4bdde3-BhBNs69f.js} +1 -1
  40. package/dist-embed/chunks/{c4Diagram-7LVT6UL2-BK8yvli2.js → c4Diagram-7LVT6UL2-BWQ9xHoN.js} +1 -1
  41. package/dist-embed/chunks/{c4Diagram-7LVT6UL2-C-0ZQ8Xa.js → c4Diagram-7LVT6UL2-DcCc8HaH.js} +1 -1
  42. package/dist-embed/chunks/{c4Diagram-7LVT6UL2-O_rZefrz.js → c4Diagram-7LVT6UL2-p14SIG7V.js} +1 -1
  43. package/dist-embed/chunks/{ca-ES-6MX7JW3Y-1rV8dCez.js → ca-ES-6MX7JW3Y-_XMb5PXx.js} +1 -1
  44. package/dist-embed/chunks/{celltoolbartracker-B_UScIax.js → celltoolbartracker-8YTtJOxD.js} +1 -1
  45. package/dist-embed/chunks/{chunk-2Q5K7J3B-BX9u1bBi.js → chunk-2Q5K7J3B-BkzWX8eg.js} +1 -1
  46. package/dist-embed/chunks/{chunk-2Q5K7J3B-DiqqlJZw.js → chunk-2Q5K7J3B-CWx-QJ0-.js} +1 -1
  47. package/dist-embed/chunks/{chunk-2Q5K7J3B-BFUbUsBE.js → chunk-2Q5K7J3B-CtmdieBX.js} +1 -1
  48. package/dist-embed/chunks/{chunk-5VM5RSS4-D4N_xxBJ.js → chunk-5VM5RSS4-C7mbT2Vq.js} +1 -1
  49. package/dist-embed/chunks/{chunk-5VM5RSS4-BbOPwJfe.js → chunk-5VM5RSS4-Ciba-ybC.js} +1 -1
  50. package/dist-embed/chunks/{chunk-5VM5RSS4-box8kQsT.js → chunk-5VM5RSS4-O8p7luYq.js} +1 -1
  51. package/dist-embed/chunks/{chunk-F27PBJKO-BUeWPnw5.js → chunk-F27PBJKO-Bo5boRfj.js} +1 -1
  52. package/dist-embed/chunks/{chunk-F27PBJKO-CQM02DXR.js → chunk-F27PBJKO-CZHz6AS9.js} +1 -1
  53. package/dist-embed/chunks/{chunk-F27PBJKO-DPF3nC8g.js → chunk-F27PBJKO-WqHcL2s0.js} +1 -1
  54. package/dist-embed/chunks/{chunk-IMKFNOWR-CPIe37ka.js → chunk-IMKFNOWR-BJR6rkFo.js} +1 -1
  55. package/dist-embed/chunks/{chunk-IMKFNOWR-DAOxV09i.js → chunk-IMKFNOWR-CPdtPffh.js} +1 -1
  56. package/dist-embed/chunks/{chunk-IMKFNOWR-rg2BEcj6.js → chunk-IMKFNOWR-Csfu1kFU.js} +1 -1
  57. package/dist-embed/chunks/{chunk-JWPE2WC7-BGdc9-bH.js → chunk-JWPE2WC7-BVXd-ICe.js} +1 -1
  58. package/dist-embed/chunks/{chunk-JWPE2WC7-NvLQtuoq.js → chunk-JWPE2WC7-Bf4pFlIJ.js} +1 -1
  59. package/dist-embed/chunks/{chunk-JWPE2WC7-QIDUQRBr.js → chunk-JWPE2WC7-Cq6Q947j.js} +1 -1
  60. package/dist-embed/chunks/{chunk-POPQ4Y6H-Cl1oUaAM.js → chunk-POPQ4Y6H-B_rWRGt2.js} +1 -1
  61. package/dist-embed/chunks/{chunk-POPQ4Y6H-BgR92oKl.js → chunk-POPQ4Y6H-DhNnPwZp.js} +1 -1
  62. package/dist-embed/chunks/{chunk-POPQ4Y6H-DWWKSDND.js → chunk-POPQ4Y6H-s1yt1ZtK.js} +1 -1
  63. package/dist-embed/chunks/{chunk-SVP7TREG-BGHt1HDi.js → chunk-SVP7TREG-8oKVa2mm.js} +1 -1
  64. package/dist-embed/chunks/{chunk-SVP7TREG-DtwPtAP8.js → chunk-SVP7TREG-CHN6fclq.js} +1 -1
  65. package/dist-embed/chunks/{chunk-SVP7TREG-lMq3S-u-.js → chunk-SVP7TREG-CsFEUe5B.js} +1 -1
  66. package/dist-embed/chunks/{chunk-TICWLB2K-CaVrVRpm.js → chunk-TICWLB2K-BsCtCkEM.js} +1 -1
  67. package/dist-embed/chunks/{chunk-TICWLB2K-BdUzhQPw.js → chunk-TICWLB2K-CSCMv_QA.js} +1 -1
  68. package/dist-embed/chunks/{chunk-TICWLB2K-D6WJ64X6.js → chunk-TICWLB2K-InZQ5ZEH.js} +1 -1
  69. package/dist-embed/chunks/{chunk-XXDRQBXY-BU32lP3z.js → chunk-XXDRQBXY-Y8pSpMzF.js} +1 -1
  70. package/dist-embed/chunks/{chunk-XXDRQBXY-CjAMT3RS.js → chunk-XXDRQBXY-sm2AIgJ5.js} +1 -1
  71. package/dist-embed/chunks/{chunk-XXDRQBXY-CtNPThT-.js → chunk-XXDRQBXY-z8go8Kjf.js} +1 -1
  72. package/dist-embed/chunks/{classDiagram-ZZMXUADV-Cy9bb-Ja.js → classDiagram-ZZMXUADV-BjEOw29S.js} +1 -1
  73. package/dist-embed/chunks/{classDiagram-ZZMXUADV-9x2pAf81.js → classDiagram-ZZMXUADV-DJ40c8si.js} +1 -1
  74. package/dist-embed/chunks/{classDiagram-ZZMXUADV-HBhnoh6h.js → classDiagram-ZZMXUADV-G9WI_1Zg.js} +1 -1
  75. package/dist-embed/chunks/{classDiagram-f62afe4f-DKREECyJ.js → classDiagram-f62afe4f-Blm1wT1_.js} +1 -1
  76. package/dist-embed/chunks/{classDiagram-v2-604399ef-CQ5TgOQe.js → classDiagram-v2-604399ef-DtWqjJhW.js} +1 -1
  77. package/dist-embed/chunks/{classDiagram-v2-VYDZK3BY-Cy9bb-Ja.js → classDiagram-v2-VYDZK3BY-BjEOw29S.js} +1 -1
  78. package/dist-embed/chunks/{classDiagram-v2-VYDZK3BY-9x2pAf81.js → classDiagram-v2-VYDZK3BY-DJ40c8si.js} +1 -1
  79. package/dist-embed/chunks/{classDiagram-v2-VYDZK3BY-HBhnoh6h.js → classDiagram-v2-VYDZK3BY-G9WI_1Zg.js} +1 -1
  80. package/dist-embed/chunks/{code-block-IT6T5CEO-B1q5VFMK.js → code-block-IT6T5CEO-Rra2QX20.js} +1 -1
  81. package/dist-embed/chunks/{component-CHd9jmXQ.js → component-DxhBhMYf.js} +1 -1
  82. package/dist-embed/chunks/{index-BhCoJe__.js → core-BrYTRvTy.js} +13 -13
  83. package/dist-embed/chunks/{cose-bilkent-JH36ORCC-DFWJgtSE.js → cose-bilkent-JH36ORCC-C73aLaB-.js} +1 -1
  84. package/dist-embed/chunks/{cose-bilkent-JH36ORCC-DGrxjlJ4.js → cose-bilkent-JH36ORCC-DCtKiRmD.js} +1 -1
  85. package/dist-embed/chunks/{cose-bilkent-JH36ORCC-F97qu5nX.js → cose-bilkent-JH36ORCC-j_7L0NF5.js} +1 -1
  86. package/dist-embed/chunks/{createText-aed3d8b3-B1Tmb4Mr.js → createText-aed3d8b3-B0tLexrf.js} +2 -2
  87. package/dist-embed/chunks/{cs-CZ-2BRQDIVT-SF5YII-L.js → cs-CZ-2BRQDIVT-Cc6P0HN5.js} +1 -1
  88. package/dist-embed/chunks/{cynefinDiagram-5FMLGOSQ-DhFh7Gts.js → cynefinDiagram-5FMLGOSQ-BSwaTAfL.js} +1 -1
  89. package/dist-embed/chunks/{cynefinDiagram-5FMLGOSQ-BZ1LtKUy.js → cynefinDiagram-5FMLGOSQ-DLyDkFEh.js} +1 -1
  90. package/dist-embed/chunks/{cynefinDiagram-5FMLGOSQ-CR7crOrC.js → cynefinDiagram-5FMLGOSQ-DXr1M_CB.js} +1 -1
  91. package/dist-embed/chunks/{da-DK-5WZEPLOC-nd3n1KuA.js → da-DK-5WZEPLOC-BPgmzhCM.js} +1 -1
  92. package/dist-embed/chunks/{dagre-GXQ25YYZ-BpWd0wTo.js → dagre-GXQ25YYZ-Bfxayyi1.js} +1 -1
  93. package/dist-embed/chunks/{dagre-GXQ25YYZ-4P90jeEC.js → dagre-GXQ25YYZ-CPu-St26.js} +1 -1
  94. package/dist-embed/chunks/{dagre-GXQ25YYZ-MXGi4287.js → dagre-GXQ25YYZ-DTWZ8vY1.js} +1 -1
  95. package/dist-embed/chunks/{de-DE-XR44H4JA-DxoPxuG0.js → de-DE-XR44H4JA-DjNk3C1Q.js} +1 -1
  96. package/dist-embed/chunks/{diagram-S7CK7UJ4-DhLnfG8J.js → diagram-S7CK7UJ4-Biw5mnoN.js} +1 -1
  97. package/dist-embed/chunks/{diagram-S7CK7UJ4-Ccq8-Zxr.js → diagram-S7CK7UJ4-ERKr1j6v.js} +1 -1
  98. package/dist-embed/chunks/{diagram-S7CK7UJ4-xgW0lqt_.js → diagram-S7CK7UJ4-ewBgYmRN.js} +1 -1
  99. package/dist-embed/chunks/{diagram-UQ7AKVKN-Csc8IuSs.js → diagram-UQ7AKVKN-B-f2Afei.js} +1 -1
  100. package/dist-embed/chunks/{diagram-UQ7AKVKN-vfaPVBIp.js → diagram-UQ7AKVKN-C-6kzgTn.js} +1 -1
  101. package/dist-embed/chunks/{diagram-UQ7AKVKN-DM05uJg0.js → diagram-UQ7AKVKN-CGNA7gub.js} +1 -1
  102. package/dist-embed/chunks/{diagram-VSXAHHWV-BpkflTV8.js → diagram-VSXAHHWV-7M08zFHc.js} +1 -1
  103. package/dist-embed/chunks/{diagram-VSXAHHWV-ChcqzpvG.js → diagram-VSXAHHWV-CTQu2IBp.js} +1 -1
  104. package/dist-embed/chunks/{diagram-VSXAHHWV-C0Dte6B4.js → diagram-VSXAHHWV-DRVoe_PH.js} +1 -1
  105. package/dist-embed/chunks/{diagram-VX7I27RA-DA3s85ZI.js → diagram-VX7I27RA-B_LkfTnq.js} +1 -1
  106. package/dist-embed/chunks/{diagram-VX7I27RA-DFBWpFKi.js → diagram-VX7I27RA-DHwSWNj4.js} +1 -1
  107. package/dist-embed/chunks/{diagram-VX7I27RA-D3eZ6yyK.js → diagram-VX7I27RA-vkcQI8-t.js} +1 -1
  108. package/dist-embed/chunks/{diagram-Z3DM3KII-DpwpLNON.js → diagram-Z3DM3KII-BZ9tmKdd.js} +1 -1
  109. package/dist-embed/chunks/{diagram-Z3DM3KII-CWv5dRb1.js → diagram-Z3DM3KII-D0Xt6xwn.js} +1 -1
  110. package/dist-embed/chunks/{diagram-Z3DM3KII-BPDco9BP.js → diagram-Z3DM3KII-YAo8QSYR.js} +1 -1
  111. package/dist-embed/chunks/{ebnfDiagram-PWID7BFC-BrHZve2O.js → ebnfDiagram-PWID7BFC-C2oLjL45.js} +1 -1
  112. package/dist-embed/chunks/{ebnfDiagram-PWID7BFC-CeZcQDV3.js → ebnfDiagram-PWID7BFC-DN2tb-X8.js} +1 -1
  113. package/dist-embed/chunks/{ebnfDiagram-PWID7BFC-ZbRTmpLY.js → ebnfDiagram-PWID7BFC-Dk5WVIim.js} +1 -1
  114. package/dist-embed/chunks/{edges-b2856ca0-CHQtJW0X.js → edges-b2856ca0-BSzU9ga-.js} +1 -1
  115. package/dist-embed/chunks/{el-GR-BZB4AONW-B_p1F0WP.js → el-GR-BZB4AONW-BA_6_8BV.js} +1 -1
  116. package/dist-embed/chunks/{erDiagram-5d81789a-7uQXDmYP.js → erDiagram-5d81789a--wvCe6Ur.js} +1 -1
  117. package/dist-embed/chunks/{erDiagram-RLTQ6QDP-DO7X3O5w.js → erDiagram-RLTQ6QDP-BDw_Db3e.js} +1 -1
  118. package/dist-embed/chunks/{erDiagram-RLTQ6QDP-CmahDLTF.js → erDiagram-RLTQ6QDP-BTXMcY7Y.js} +1 -1
  119. package/dist-embed/chunks/{erDiagram-RLTQ6QDP-QI_LQlaL.js → erDiagram-RLTQ6QDP-BsU1EeJN.js} +1 -1
  120. package/dist-embed/chunks/{es-ES-U4NZUMDT-BWCUsoic.js → es-ES-U4NZUMDT-DB2skShM.js} +1 -1
  121. package/dist-embed/chunks/{esm-M4z_FfnQ.js → esm-BFRTiV0k.js} +1 -1
  122. package/dist-embed/chunks/{esm-itrlzhnT.js → esm-VjpQWsU9.js} +14 -14
  123. package/dist-embed/chunks/{eu-ES-A7QVB2H4-QqCRXKSF.js → eu-ES-A7QVB2H4-D4jAAmi7.js} +1 -1
  124. package/dist-embed/chunks/{fa-IR-HGAKTJCU-C0NVSF_c.js → fa-IR-HGAKTJCU-Cm5LhQ8o.js} +1 -1
  125. package/dist-embed/chunks/{fi-FI-Z5N7JZ37-BP_C4Wwz.js → fi-FI-Z5N7JZ37-DEH_Gx5V.js} +1 -1
  126. package/dist-embed/chunks/{flowDb-185abca5-BmhWH32g.js → flowDb-185abca5-CBeP2_ZY.js} +1 -1
  127. package/dist-embed/chunks/{flowDiagram-1629c991-oMWtc4C3.js → flowDiagram-1629c991-LZzO5ZR8.js} +1 -1
  128. package/dist-embed/chunks/{flowDiagram-HODETNUW-CmuRDMmw.js → flowDiagram-HODETNUW-DNjEQlAR.js} +1 -1
  129. package/dist-embed/chunks/{flowDiagram-HODETNUW-CgvZqEVs.js → flowDiagram-HODETNUW-DP1PWdQF.js} +1 -1
  130. package/dist-embed/chunks/{flowDiagram-HODETNUW-Cy-T1qw4.js → flowDiagram-HODETNUW-_U05MBMl.js} +1 -1
  131. package/dist-embed/chunks/{flowDiagram-v2-1d953310-OG6RhgdC.js → flowDiagram-v2-1d953310-DeqYSBVG.js} +1 -1
  132. package/dist-embed/chunks/{flowchart-elk-definition-6df44142-I8LO2x_c.js → flowchart-elk-definition-6df44142-Dg5bSBS4.js} +1 -1
  133. package/dist-embed/chunks/{fr-FR-RHASNOE6-B1_hgegA.js → fr-FR-RHASNOE6-Blvt0egy.js} +1 -1
  134. package/dist-embed/chunks/{ganttDiagram-3b0b3873-Ch394Td4.js → ganttDiagram-3b0b3873-D9Pr_Kxk.js} +1 -1
  135. package/dist-embed/chunks/{ganttDiagram-EL5Y4UJY-iVAJV8uC.js → ganttDiagram-EL5Y4UJY-Baccn166.js} +1 -1
  136. package/dist-embed/chunks/{ganttDiagram-EL5Y4UJY-sX30iW6f.js → ganttDiagram-EL5Y4UJY-DmwhuzrV.js} +1 -1
  137. package/dist-embed/chunks/{ganttDiagram-EL5Y4UJY-DjmeWOsd.js → ganttDiagram-EL5Y4UJY-Qz5HuyzZ.js} +1 -1
  138. package/dist-embed/chunks/{gitGraphDiagram-WWUBYQGX-BuldyYGe.js → gitGraphDiagram-WWUBYQGX-BUlSUrle.js} +1 -1
  139. package/dist-embed/chunks/{gitGraphDiagram-WWUBYQGX-CVcSYkDK.js → gitGraphDiagram-WWUBYQGX-CF5nE-hV.js} +1 -1
  140. package/dist-embed/chunks/{gitGraphDiagram-WWUBYQGX-CeOMDDRZ.js → gitGraphDiagram-WWUBYQGX-ZgEb3qK-.js} +1 -1
  141. package/dist-embed/chunks/{gitGraphDiagram-f01e8bc2-CfNzWqtG.js → gitGraphDiagram-f01e8bc2-BqpGV-_U.js} +1 -1
  142. package/dist-embed/chunks/{gl-ES-HMX3MZ6V-BhVM3-ho.js → gl-ES-HMX3MZ6V-CTMS_g-D.js} +1 -1
  143. package/dist-embed/chunks/{he-IL-6SHJWFNN-oud0_kOl.js → he-IL-6SHJWFNN-CwRAX3eS.js} +1 -1
  144. package/dist-embed/chunks/{hi-IN-IWLTKZ5I-CD6iySjh.js → hi-IN-IWLTKZ5I-BGqXOwtD.js} +1 -1
  145. package/dist-embed/chunks/{hu-HU-A5ZG7DT2-DXuEZMlE.js → hu-HU-A5ZG7DT2-DPTG8MEz.js} +1 -1
  146. package/dist-embed/chunks/{id-ID-SAP4L64H-C-E1a9_p.js → id-ID-SAP4L64H-SGVYgM36.js} +1 -1
  147. package/dist-embed/chunks/{index-CaEDkyBB.js → index--Rl4aMiU.js} +1 -1
  148. package/dist-embed/chunks/{index-9bae90f3-BZE71ijg.js → index-9bae90f3-9T5x-xqi.js} +1 -1
  149. package/dist-embed/chunks/{index-86hxexQA.js → index-BGTb9Nvb.js} +1 -1
  150. package/dist-embed/chunks/{index-DakHBTji.js → index-CHu5zo1L.js} +1 -1
  151. package/dist-embed/chunks/{index-s25RSqvt.js → index-DObGLuCI.js} +4 -4
  152. package/dist-embed/chunks/{index-CvKH_NYI.js → index-DRUP-YmW.js} +2 -2
  153. package/dist-embed/chunks/{index-CLB4KPZs.js → index-Df2MkvAW.js} +4 -4
  154. package/dist-embed/chunks/{index-CXSUknte.js → index-_yFHxlc9.js} +1 -1
  155. package/dist-embed/chunks/{index-BMY48-7N.js → index-i9IsP_xD.js} +1 -1
  156. package/dist-embed/chunks/{index.esm-CDmg415B.js → index.esm-BA_6VWW2.js} +1 -1
  157. package/dist-embed/chunks/index.esm-CjezntnN.js +1 -0
  158. package/dist-embed/chunks/{infoDiagram-27XIBGKW-r53wKy7u.js → infoDiagram-27XIBGKW-B4XVsJvC.js} +1 -1
  159. package/dist-embed/chunks/{infoDiagram-27XIBGKW-ZpA0pyod.js → infoDiagram-27XIBGKW-Cs7bZlH6.js} +1 -1
  160. package/dist-embed/chunks/{infoDiagram-27XIBGKW-CJ3r0yt4.js → infoDiagram-27XIBGKW-D3fIZzte.js} +1 -1
  161. package/dist-embed/chunks/{infoDiagram-a29d40f1-SCeFVgXv.js → infoDiagram-a29d40f1-DkWa9MRC.js} +1 -1
  162. package/dist-embed/chunks/{ishikawaDiagram-5VMMS53U-CvqPw0ea.js → ishikawaDiagram-5VMMS53U-B6nIkJxX.js} +1 -1
  163. package/dist-embed/chunks/{ishikawaDiagram-5VMMS53U-DZTg3ecD.js → ishikawaDiagram-5VMMS53U-BB-Kv-Mj.js} +1 -1
  164. package/dist-embed/chunks/{ishikawaDiagram-5VMMS53U-DyyVsa6G.js → ishikawaDiagram-5VMMS53U-BIytcjnR.js} +1 -1
  165. package/dist-embed/chunks/{it-IT-JPQ66NNP-iU7kI7qX.js → it-IT-JPQ66NNP-BVqiIDuA.js} +1 -1
  166. package/dist-embed/chunks/{ja-JP-DBVTYXUO-CgiuMyHB.js → ja-JP-DBVTYXUO-BVru9viS.js} +1 -1
  167. package/dist-embed/chunks/{journeyDiagram-3NMN7TZE-DAnc386V.js → journeyDiagram-3NMN7TZE-Bs6ObzT9.js} +1 -1
  168. package/dist-embed/chunks/{journeyDiagram-3NMN7TZE-Bc9JVKJo.js → journeyDiagram-3NMN7TZE-C3yCP95B.js} +1 -1
  169. package/dist-embed/chunks/{journeyDiagram-3NMN7TZE-MiKYaC2s.js → journeyDiagram-3NMN7TZE-DjgUmoWA.js} +1 -1
  170. package/dist-embed/chunks/{journeyDiagram-95396277-DT_97eTw.js → journeyDiagram-95396277-Dj4xwdzk.js} +1 -1
  171. package/dist-embed/chunks/{kaa-6HZHGXH3-kCO_bmZz.js → kaa-6HZHGXH3-COq8GIG8.js} +1 -1
  172. package/dist-embed/chunks/{kab-KAB-ZGHBKWFO-XZlP8YRp.js → kab-KAB-ZGHBKWFO-C6sCJW81.js} +1 -1
  173. package/dist-embed/chunks/{kanban-definition-UXKFOSKX-C2nVULib.js → kanban-definition-UXKFOSKX-B9DSJpj9.js} +1 -1
  174. package/dist-embed/chunks/{kanban-definition-UXKFOSKX-BkReeSIH.js → kanban-definition-UXKFOSKX-Chsw2-Nq.js} +1 -1
  175. package/dist-embed/chunks/{kanban-definition-UXKFOSKX-CaaDxJqC.js → kanban-definition-UXKFOSKX-_mcHB773.js} +1 -1
  176. package/dist-embed/chunks/{kk-KZ-P5N5QNE5-BYUwHB4m.js → kk-KZ-P5N5QNE5-dn5L62v9.js} +1 -1
  177. package/dist-embed/chunks/{km-KH-HSX4SM5Z-CUO0IDD-.js → km-KH-HSX4SM5Z-DHRs2Dac.js} +1 -1
  178. package/dist-embed/chunks/{ko-KR-MTYHY66A-CuR4MTdp.js → ko-KR-MTYHY66A-B-6WTOYs.js} +1 -1
  179. package/dist-embed/chunks/{ku-TR-6OUDTVRD-CuFtqN6b.js → ku-TR-6OUDTVRD-DtHakiL_.js} +1 -1
  180. package/dist-embed/chunks/{layout-BjpOdFu2.js → layout-DTdkd155.js} +1 -1
  181. package/dist-embed/chunks/{layout-DQIVAfpO.js → layout-D_LOxL0l.js} +1 -1
  182. package/dist-embed/chunks/{layout-BD_a0kBf.js → layout-W4AzWc9F.js} +1 -1
  183. package/dist-embed/chunks/{lexicalHooks-BM3oRORX.js → lexicalHooks-eeb6BvjZ.js} +1 -1
  184. package/dist-embed/chunks/{lib-BXb6Der8.js → lib-BMPXKfof.js} +1 -1
  185. package/dist-embed/chunks/{lib-Dfg3vZM8.js → lib-BQwc_iHi.js} +1 -1
  186. package/dist-embed/chunks/{lib-CXURv0CD.js → lib-BZqd0lRo.js} +1 -1
  187. package/dist-embed/chunks/{lib-CEAQckSu.js → lib-BrI7Hb25.js} +1 -1
  188. package/dist-embed/chunks/{lib-Bx0zoo2z.js → lib-Bt3UDo1P.js} +1 -1
  189. package/dist-embed/chunks/{lib-0t46pS-5.js → lib-Btas-Vc2.js} +1 -1
  190. package/dist-embed/chunks/{lib-DXoXqPR6.js → lib-Bukh35h2.js} +1 -1
  191. package/dist-embed/chunks/{lib-Yguxonvz.js → lib-BzbIpAN9.js} +1 -1
  192. package/dist-embed/chunks/{lib-BZnIPSNY.js → lib-CM6qdZu_.js} +1 -1
  193. package/dist-embed/chunks/{lib-B5XoICB9.js → lib-CYKJVq8i.js} +1 -1
  194. package/dist-embed/chunks/{lib-CJ9ULCcA.js → lib-C_8F-jrZ.js} +1 -1
  195. package/dist-embed/chunks/{lib-WvggSsMk.js → lib-Cz-lZRHD.js} +1 -1
  196. package/dist-embed/chunks/{lib-CqNuA7eJ.js → lib-D--prlsO.js} +1 -1
  197. package/dist-embed/chunks/{lib-CtFV0V1H.js → lib-DLTzM19O.js} +11 -11
  198. package/dist-embed/chunks/{lib-Bf4e9-pt.js → lib-DPx8N2oL.js} +1 -1
  199. package/dist-embed/chunks/{lib-CBlEbdz_.js → lib-DS4NMFQk.js} +1 -1
  200. package/dist-embed/chunks/{lib-B_ADtK-Y.js → lib-DekQ5MbL.js} +1 -1
  201. package/dist-embed/chunks/{lib-eeN6DkZa.js → lib-DyPVwxhD.js} +1 -1
  202. package/dist-embed/chunks/{lib-QwGhpmEd.js → lib-Y2W358Nu.js} +1 -1
  203. package/dist-embed/chunks/{lib-Bj6VnDnz.js → lib-ZsSgUH3L.js} +1 -1
  204. package/dist-embed/chunks/{lt-LT-XHIRWOB4-TpyDKA3C.js → lt-LT-XHIRWOB4-Bov6lsrL.js} +1 -1
  205. package/dist-embed/chunks/{lv-LV-5QDEKY6T-Dz0_ikqR.js → lv-LV-5QDEKY6T-7TYkSlIn.js} +1 -1
  206. package/dist-embed/chunks/{mermaid.core-meWUGbq7.js → mermaid.core-By9AWIOp.js} +3 -3
  207. package/dist-embed/chunks/{mermaid.core-Dkoaa-_D.js → mermaid.core-Dd-D7tJ4.js} +5 -5
  208. package/dist-embed/chunks/{mindmap-definition-YA3MSWOX-BxYK9vLg.js → mindmap-definition-YA3MSWOX-CCpwK8vh.js} +1 -1
  209. package/dist-embed/chunks/{mindmap-definition-YA3MSWOX-DQSoT62j.js → mindmap-definition-YA3MSWOX-CmGscTNk.js} +1 -1
  210. package/dist-embed/chunks/{mindmap-definition-YA3MSWOX-1p4XwdjF.js → mindmap-definition-YA3MSWOX-Uv7-26v7.js} +1 -1
  211. package/dist-embed/chunks/{mindmap-definition-e4c1d938-BGiAi0LL.js → mindmap-definition-e4c1d938-aCX0qYqH.js} +1 -1
  212. package/dist-embed/chunks/{mr-IN-CRQNXWMA-Vbci-IWj.js → mr-IN-CRQNXWMA-C1hMHCkZ.js} +1 -1
  213. package/dist-embed/chunks/{my-MM-5M5IBNSE-C0JHZ0Gp.js → my-MM-5M5IBNSE-CmNBubDy.js} +1 -1
  214. package/dist-embed/chunks/{nb-NO-T6EIAALU-eFOvuJCy.js → nb-NO-T6EIAALU-NtLUc485.js} +1 -1
  215. package/dist-embed/chunks/{nl-NL-IS3SIHDZ-Din9L_2S.js → nl-NL-IS3SIHDZ-CCHd5AqI.js} +1 -1
  216. package/dist-embed/chunks/{nn-NO-6E72VCQL-D7cIpOBH.js → nn-NO-6E72VCQL-BYMvh_fX.js} +1 -1
  217. package/dist-embed/chunks/{oc-FR-POXYY2M6-Bcxv3YfP.js → oc-FR-POXYY2M6-CkuSUWy_.js} +1 -1
  218. package/dist-embed/chunks/{pa-IN-N4M65BXN-IrBb1NlL.js → pa-IN-N4M65BXN-Daq4uKWi.js} +1 -1
  219. package/dist-embed/chunks/{pegDiagram-XKGWAZYB-GlLsdSxR.js → pegDiagram-XKGWAZYB-C1R8Kk6K.js} +1 -1
  220. package/dist-embed/chunks/{pegDiagram-XKGWAZYB-DDgyLvau.js → pegDiagram-XKGWAZYB-DLONs192.js} +1 -1
  221. package/dist-embed/chunks/{pegDiagram-XKGWAZYB-iCCMOEMa.js → pegDiagram-XKGWAZYB-dwQNJiaW.js} +1 -1
  222. package/dist-embed/chunks/{percentages-BXMCSKIN-BaaVroR_.js → percentages-BXMCSKIN-_vjQ8CcA.js} +5 -5
  223. package/dist-embed/chunks/{pieDiagram-E7YTZNPT-CIfzhxTy.js → pieDiagram-E7YTZNPT-CH60iHt1.js} +1 -1
  224. package/dist-embed/chunks/{pieDiagram-E7YTZNPT-ffhUIieA.js → pieDiagram-E7YTZNPT-Cm-wzRi8.js} +1 -1
  225. package/dist-embed/chunks/{pieDiagram-E7YTZNPT-DIErsg9L.js → pieDiagram-E7YTZNPT-DiT0kFGb.js} +1 -1
  226. package/dist-embed/chunks/{pieDiagram-c941bede-JKyix3vD.js → pieDiagram-c941bede-BF587JLB.js} +1 -1
  227. package/dist-embed/chunks/{pl-PL-T2D74RX3-bF5WEfvP.js → pl-PL-T2D74RX3-DUHQouxW.js} +1 -1
  228. package/dist-embed/chunks/plugin-Bvp_HQZg.js +1 -0
  229. package/dist-embed/chunks/{pt-BR-5N22H2LF-K9lAvfY5.js → pt-BR-5N22H2LF-DK_6K-F_.js} +1 -1
  230. package/dist-embed/chunks/{pt-PT-UZXXM6DQ-DAlaVYmT.js → pt-PT-UZXXM6DQ-DtH8Iay_.js} +1 -1
  231. package/dist-embed/chunks/{quadrantDiagram-AXDQQJYC-DbYIZcyN.js → quadrantDiagram-AXDQQJYC-B1wf6Zth.js} +1 -1
  232. package/dist-embed/chunks/{quadrantDiagram-AXDQQJYC-D3pxCP4M.js → quadrantDiagram-AXDQQJYC-DWDtOx8-.js} +1 -1
  233. package/dist-embed/chunks/{quadrantDiagram-AXDQQJYC-BE9RPE6m.js → quadrantDiagram-AXDQQJYC-mkOZIUHb.js} +1 -1
  234. package/dist-embed/chunks/{quadrantDiagram-cf8b8fe0-C_nd7FeD.js → quadrantDiagram-cf8b8fe0-CE6GwviF.js} +1 -1
  235. package/dist-embed/chunks/{railroadDiagram-O6MQD6OU-CwaTW3Mo.js → railroadDiagram-O6MQD6OU-DEB7gRmX.js} +1 -1
  236. package/dist-embed/chunks/{railroadDiagram-O6MQD6OU-CpXUNzTV.js → railroadDiagram-O6MQD6OU-DjA_m2-o.js} +1 -1
  237. package/dist-embed/chunks/{railroadDiagram-O6MQD6OU-CEl2l0ZE.js → railroadDiagram-O6MQD6OU-DrkBEH1z.js} +1 -1
  238. package/dist-embed/chunks/{renderer-CtmiT4nP.js → renderer-jLLXpZ99.js} +1 -1
  239. package/dist-embed/chunks/{requirementDiagram-53bda41b-WVBAkQmj.js → requirementDiagram-53bda41b-BsRjuGBf.js} +1 -1
  240. package/dist-embed/chunks/{requirementDiagram-BXWQKSXE-sE3y_NEM.js → requirementDiagram-BXWQKSXE-82Ybj2ki.js} +1 -1
  241. package/dist-embed/chunks/{requirementDiagram-BXWQKSXE-ClYVmNTl.js → requirementDiagram-BXWQKSXE-C8d0kJ1A.js} +1 -1
  242. package/dist-embed/chunks/{requirementDiagram-BXWQKSXE-Bd0fV1Bn.js → requirementDiagram-BXWQKSXE-S8WT8VJ1.js} +1 -1
  243. package/dist-embed/chunks/{ro-RO-JPDTUUEW-kn8FzruZ.js → ro-RO-JPDTUUEW-CfeEiLsp.js} +1 -1
  244. package/dist-embed/chunks/{ru-RU-B4JR7IUQ-iQW1KMip.js → ru-RU-B4JR7IUQ-xuXvLXWI.js} +1 -1
  245. package/dist-embed/chunks/{sankeyDiagram-P5KCCOFB-CLR82118.js → sankeyDiagram-P5KCCOFB-C2LowYxA.js} +1 -1
  246. package/dist-embed/chunks/{sankeyDiagram-P5KCCOFB-BZnLyt_G.js → sankeyDiagram-P5KCCOFB-CKqSAqcJ.js} +1 -1
  247. package/dist-embed/chunks/{sankeyDiagram-P5KCCOFB-DH-uxGJV.js → sankeyDiagram-P5KCCOFB-eNBOyfBR.js} +1 -1
  248. package/dist-embed/chunks/{sankeyDiagram-c3ef121a-CINAq9g5.js → sankeyDiagram-c3ef121a-BAS8V2Ov.js} +1 -1
  249. package/dist-embed/chunks/{sequenceDiagram-82a5b84f-Bx7xO8lv.js → sequenceDiagram-82a5b84f-BWNvF-m7.js} +1 -1
  250. package/dist-embed/chunks/{sequenceDiagram-WJ2MYXX4-D00NbcmA.js → sequenceDiagram-WJ2MYXX4-C_2alFNp.js} +1 -1
  251. package/dist-embed/chunks/{sequenceDiagram-WJ2MYXX4-CxHuil7I.js → sequenceDiagram-WJ2MYXX4-CxH0MlFa.js} +1 -1
  252. package/dist-embed/chunks/{sequenceDiagram-WJ2MYXX4-VyUqwKEJ.js → sequenceDiagram-WJ2MYXX4-fsR56p6L.js} +1 -1
  253. package/dist-embed/chunks/{si-LK-N5RQ5JYF-C1J6zA3p.js → si-LK-N5RQ5JYF-CP-9ouz_.js} +1 -1
  254. package/dist-embed/chunks/{sizeCapture-INFHLROL-B_CNNL_v.js → sizeCapture-INFHLROL-BCe0IiFV.js} +1 -1
  255. package/dist-embed/chunks/{sizeCapture-INFHLROL-_h3QW8w5.js → sizeCapture-INFHLROL-BsZaIjAU.js} +1 -1
  256. package/dist-embed/chunks/{sizeCapture-INFHLROL-BhSnrZjU.js → sizeCapture-INFHLROL-Y7lBmAj6.js} +1 -1
  257. package/dist-embed/chunks/{sk-SK-C5VTKIMK-CK9RvjRD.js → sk-SK-C5VTKIMK-BB-nLd53.js} +1 -1
  258. package/dist-embed/chunks/{sl-SI-NN7IZMDC-CcDWOBHp.js → sl-SI-NN7IZMDC-Ct4gcmka.js} +1 -1
  259. package/dist-embed/chunks/{state-CGa66Nqd.js → state-DeMGhTAB.js} +1 -1
  260. package/dist-embed/chunks/{stateDiagram-43e79a5f-DFrFK9qM.js → stateDiagram-43e79a5f-2cuSVith.js} +1 -1
  261. package/dist-embed/chunks/{stateDiagram-D77RDMKH-QwBnfyKm.js → stateDiagram-D77RDMKH-3P7AgNud.js} +1 -1
  262. package/dist-embed/chunks/{stateDiagram-D77RDMKH-BVJqlFiv.js → stateDiagram-D77RDMKH-DosU0FIz.js} +1 -1
  263. package/dist-embed/chunks/{stateDiagram-D77RDMKH-CEvuFuTH.js → stateDiagram-D77RDMKH-ul2eLf5Q.js} +1 -1
  264. package/dist-embed/chunks/{stateDiagram-v2-2041ed4f-CcaIZYWt.js → stateDiagram-v2-2041ed4f-Ur2pX7Zl.js} +1 -1
  265. package/dist-embed/chunks/{stateDiagram-v2-MP3YSRHH-BaZ6xgsr.js → stateDiagram-v2-MP3YSRHH-BvlJBilq.js} +1 -1
  266. package/dist-embed/chunks/{stateDiagram-v2-MP3YSRHH-C_JHNwKt.js → stateDiagram-v2-MP3YSRHH-D0rhfnrW.js} +1 -1
  267. package/dist-embed/chunks/{stateDiagram-v2-MP3YSRHH-ok1qePbZ.js → stateDiagram-v2-MP3YSRHH-DeEmivLr.js} +1 -1
  268. package/dist-embed/chunks/{styles-455b33cd-CAiZEic0.js → styles-455b33cd-DPOVDa0x.js} +1 -1
  269. package/dist-embed/chunks/{styles-f932cba9-CEhWf7q3.js → styles-f932cba9-Dev7yXQc.js} +1 -1
  270. package/dist-embed/chunks/{styles-fcc2142b-v0gPnZ9U.js → styles-fcc2142b-70zGEKfV.js} +1 -1
  271. package/dist-embed/chunks/{subset-shared.chunk-C0JvsRAi.js → subset-shared.chunk-Jbgk4hFg.js} +1 -1
  272. package/dist-embed/chunks/{subset-worker.chunk-qynV-rht.js → subset-worker.chunk-C52XcgS8.js} +1 -1
  273. package/dist-embed/chunks/{substates-Bs9ZMVGa.js → substates-BuHNVWkx.js} +1 -1
  274. package/dist-embed/chunks/{sv-SE-XGPEYMSR-B38oK2Y4.js → sv-SE-XGPEYMSR-DSfTTYTP.js} +1 -1
  275. package/dist-embed/chunks/{svgDrawCommon-148a3cd9-vsaJmSq8.js → svgDrawCommon-148a3cd9-zokUeLzq.js} +1 -1
  276. package/dist-embed/chunks/{swimlanes-42K2YHIH-CpRw9PHz.js → swimlanes-42K2YHIH-CIW2hU2l.js} +1 -1
  277. package/dist-embed/chunks/{swimlanes-42K2YHIH-DO1ZzP4k.js → swimlanes-42K2YHIH-DOkKP2_2.js} +1 -1
  278. package/dist-embed/chunks/{swimlanes-42K2YHIH-C_43oheZ.js → swimlanes-42K2YHIH-x4BMo9Cs.js} +1 -1
  279. package/dist-embed/chunks/{swimlanesDiagram-VR7AAH4N-BucpGmoC.js → swimlanesDiagram-VR7AAH4N-9yw92Xx_.js} +1 -1
  280. package/dist-embed/chunks/{swimlanesDiagram-VR7AAH4N-BYKvE-MW.js → swimlanesDiagram-VR7AAH4N-BlFZ7eQS.js} +1 -1
  281. package/dist-embed/chunks/{swimlanesDiagram-VR7AAH4N-BBi0wpOL.js → swimlanesDiagram-VR7AAH4N-zOAH82Ya.js} +1 -1
  282. package/dist-embed/chunks/{ta-IN-2NMHFXQM-uSQqrrN6.js → ta-IN-2NMHFXQM-_SwRKWkS.js} +1 -1
  283. package/dist-embed/chunks/{th-TH-HPSO5L25-Cs2r4usA.js → th-TH-HPSO5L25-NbkJxgfv.js} +1 -1
  284. package/dist-embed/chunks/{timeline-definition-24CTP7MA-C9oiFt1s.js → timeline-definition-24CTP7MA-BfM-0614.js} +1 -1
  285. package/dist-embed/chunks/{timeline-definition-24CTP7MA-CRpA2xfq.js → timeline-definition-24CTP7MA-C9Ed6D0K.js} +1 -1
  286. package/dist-embed/chunks/{timeline-definition-24CTP7MA-C_RPFzcS.js → timeline-definition-24CTP7MA-kHlycslq.js} +1 -1
  287. package/dist-embed/chunks/{timeline-definition-7545f45a-diaQHYG7.js → timeline-definition-7545f45a-B4ECAP9Q.js} +1 -1
  288. package/dist-embed/chunks/{tr-TR-DEFEU3FU-D8o50B7O.js → tr-TR-DEFEU3FU-DrMMVO-E.js} +1 -1
  289. package/dist-embed/chunks/{uk-UA-QMV73CPH-B5fUoSFX.js → uk-UA-QMV73CPH-B53y70gR.js} +1 -1
  290. package/dist-embed/chunks/{vennDiagram-4TSXK5OY-ByKQXzaL.js → vennDiagram-4TSXK5OY-7gMUaOyw.js} +1 -1
  291. package/dist-embed/chunks/{vennDiagram-4TSXK5OY-6I3E2S1J.js → vennDiagram-4TSXK5OY-CrE30dtz.js} +1 -1
  292. package/dist-embed/chunks/{vennDiagram-4TSXK5OY-C4cLgb45.js → vennDiagram-4TSXK5OY-Dt9fBhlj.js} +1 -1
  293. package/dist-embed/chunks/{vi-VN-M7AON7JQ-Dj_kFfvZ.js → vi-VN-M7AON7JQ-BVHYf59K.js} +1 -1
  294. package/dist-embed/chunks/{wardleyDiagram-VM6X3IG4-CLayLpj4.js → wardleyDiagram-VM6X3IG4-6HRbbvDt.js} +1 -1
  295. package/dist-embed/chunks/{wardleyDiagram-VM6X3IG4-CnxCRlDr.js → wardleyDiagram-VM6X3IG4-AvAVDPLG.js} +1 -1
  296. package/dist-embed/chunks/{wardleyDiagram-VM6X3IG4-6QgHmuap.js → wardleyDiagram-VM6X3IG4-CsR-8GhP.js} +1 -1
  297. package/dist-embed/chunks/{xychartDiagram-3f383b91-COn0cE9r.js → xychartDiagram-3f383b91-C09F8RkF.js} +1 -1
  298. package/dist-embed/chunks/{xychartDiagram-S5SC5T6Z-Hrzni--y.js → xychartDiagram-S5SC5T6Z-CkZtbHvK.js} +1 -1
  299. package/dist-embed/chunks/{xychartDiagram-S5SC5T6Z-CoRCml5l.js → xychartDiagram-S5SC5T6Z-VWPR98LV.js} +1 -1
  300. package/dist-embed/chunks/{xychartDiagram-S5SC5T6Z-RhhCg-yn.js → xychartDiagram-S5SC5T6Z-ZZD1fZ1L.js} +1 -1
  301. package/dist-embed/chunks/{zh-CN-LNUGB5OW-CHJxgGXp.js → zh-CN-LNUGB5OW-z2taSDkS.js} +1 -1
  302. package/dist-embed/chunks/{zh-HK-E62DVLB3-CLxE_xvU.js → zh-HK-E62DVLB3-Rkl2piEx.js} +1 -1
  303. package/dist-embed/chunks/{zh-TW-RAJ6MFWO-CpEgHY46.js → zh-TW-RAJ6MFWO-BgDiBZag.js} +1 -1
  304. package/dist-embed/datalayer-app-main.js +21 -21
  305. package/lib/api/runtimes/environments.d.ts +15 -16
  306. package/lib/api/runtimes/environments.js +19 -20
  307. package/lib/api/runtimes/runtimes.d.ts +8 -8
  308. package/lib/api/runtimes/runtimes.js +6 -6
  309. package/lib/apps/Application.d.ts +3 -3
  310. package/lib/apps/Application.js +2 -2
  311. package/lib/apps/__tests__/fixtures/sceneCheckCases.json +1 -1
  312. package/lib/apps/apps/AppBrowserSandbox.js +1 -1
  313. package/lib/apps/apps/AppComposer.d.ts +7 -7
  314. package/lib/apps/apps/AppComposer.js +9 -9
  315. package/lib/apps/apps/AppFeedback.d.ts +1 -1
  316. package/lib/apps/apps/AppFeedback.js +1 -1
  317. package/lib/apps/apps/AppKept.d.ts +1 -1
  318. package/lib/apps/apps/AppKept.js +1 -2
  319. package/lib/apps/apps/AppRenderer.d.ts +41 -42
  320. package/lib/apps/apps/AppRenderer.js +54 -55
  321. package/lib/apps/apps/AppRuntimePlugins.d.ts +1 -1
  322. package/lib/apps/apps/AppRuntimePlugins.js +3 -3
  323. package/lib/apps/apps/agent.js +1 -1
  324. package/lib/apps/apps/browserSandbox.d.ts +1 -1
  325. package/lib/apps/apps/checks.d.ts +8 -8
  326. package/lib/apps/apps/checks.js +40 -40
  327. package/lib/apps/apps/composer.d.ts +3 -3
  328. package/lib/apps/apps/composer.js +2 -2
  329. package/lib/apps/apps/computer.d.ts +5 -5
  330. package/lib/apps/apps/computer.js +2 -2
  331. package/lib/apps/apps/customComponents.d.ts +3 -3
  332. package/lib/apps/apps/customComponents.js +4 -4
  333. package/lib/apps/apps/feedback.d.ts +2 -2
  334. package/lib/apps/apps/feedback.js +1 -1
  335. package/lib/apps/apps/hostTools.d.ts +4 -4
  336. package/lib/apps/apps/hostTools.js +3 -3
  337. package/lib/apps/apps/kept.d.ts +2 -2
  338. package/lib/apps/apps/language.d.ts +1 -1
  339. package/lib/apps/apps/pluginPair.d.ts +1 -1
  340. package/lib/apps/apps/records.d.ts +6 -6
  341. package/lib/apps/apps/records.js +4 -4
  342. package/lib/apps/apps/rules.d.ts +4 -4
  343. package/lib/apps/apps/rules.js +4 -4
  344. package/lib/apps/apps/saved.d.ts +1 -1
  345. package/lib/apps/apps/saved.js +1 -1
  346. package/lib/apps/apps/sceneChecks.d.ts +5 -5
  347. package/lib/apps/apps/sceneChecks.js +7 -7
  348. package/lib/apps/apps/sceneYaml.d.ts +2 -2
  349. package/lib/apps/apps/sceneYaml.js +4 -4
  350. package/lib/apps/apps/sessionRules.d.ts +2 -2
  351. package/lib/apps/apps/sessionRules.js +2 -2
  352. package/lib/apps/apps/settingsInputs.d.ts +1 -1
  353. package/lib/apps/apps/settingsInputs.js +1 -1
  354. package/lib/apps/apps/threads.d.ts +3 -3
  355. package/lib/apps/apps/uploads.d.ts +1 -1
  356. package/lib/apps/apps/visitorToken.d.ts +3 -3
  357. package/lib/apps/apps/visitorToken.js +4 -4
  358. package/lib/apps/core/a2uiComponents.js +1 -1
  359. package/lib/apps/core/appFiles.js +1 -1
  360. package/lib/apps/core/canvasParts.d.ts +3 -3
  361. package/lib/apps/core/canvasParts.js +2 -2
  362. package/lib/apps/core/index.d.ts +20 -21
  363. package/lib/apps/core/index.js +5 -5
  364. package/lib/apps/embed/AppEmbed.d.ts +19 -19
  365. package/lib/apps/embed/AppEmbed.js +27 -27
  366. package/lib/apps/embed/LoopEmbed.d.ts +2 -2
  367. package/lib/apps/embed/LoopEmbed.js +1 -1
  368. package/lib/apps/embed/datalayer-app.js +1 -1
  369. package/lib/apps/embed/element.d.ts +1 -1
  370. package/lib/apps/embed/element.js +25 -25
  371. package/lib/apps/embed/embedConfig.d.ts +14 -14
  372. package/lib/apps/embed/embedConfig.js +11 -11
  373. package/lib/apps/embed/embedSession.d.ts +2 -2
  374. package/lib/apps/embed/embedSession.js +1 -1
  375. package/lib/apps/embed/embedTheme.d.ts +4 -4
  376. package/lib/apps/embed/embedTheme.js +5 -5
  377. package/lib/apps/embed/embeddedSecrets.d.ts +1 -1
  378. package/lib/apps/embed/embeddedSecrets.js +1 -1
  379. package/lib/apps/embed/hostBridge.d.ts +15 -15
  380. package/lib/apps/embed/hostBridge.js +10 -10
  381. package/lib/apps/embed/loader.js +2 -2
  382. package/lib/apps/embed/visitorApp.d.ts +2 -2
  383. package/lib/apps/embed/visitorApp.js +3 -4
  384. package/lib/apps/index.js +2 -2
  385. package/lib/apps/plugins/a2ui-surface/AnswerShows.d.ts +2 -2
  386. package/lib/apps/plugins/a2ui-surface/AnswerShows.js +1 -1
  387. package/lib/apps/plugins/a2ui-surface/InlineSurface.d.ts +1 -1
  388. package/lib/apps/plugins/a2ui-surface/SurfaceToolResult.js +2 -2
  389. package/lib/apps/plugins/a2ui-surface/index.js +1 -1
  390. package/lib/apps/plugins/a2ui-surface/ownComponents.js +1 -1
  391. package/lib/apps/plugins/a2ui-surface/toolResult.d.ts +2 -2
  392. package/lib/apps/plugins/a2ui-surface/toolResult.js +2 -2
  393. package/lib/apps/plugins/agent-capacity/index.d.ts +2 -2
  394. package/lib/apps/plugins/agents/DatalayerAgentBridge.js +5 -5
  395. package/lib/apps/plugins/agents/appLaunch.d.ts +1 -1
  396. package/lib/apps/plugins/agents/plugin.d.ts +4 -4
  397. package/lib/apps/plugins/agents/switchable.js +1 -1
  398. package/lib/apps/plugins/app-activity/AppActivity.d.ts +2 -2
  399. package/lib/apps/plugins/app-activity/index.js +1 -1
  400. package/lib/apps/plugins/app-components/index.d.ts +1 -1
  401. package/lib/apps/plugins/app-components/index.js +1 -1
  402. package/lib/apps/plugins/app-computer/AppComputer.d.ts +1 -1
  403. package/lib/apps/plugins/app-computer/AppComputer.js +2 -2
  404. package/lib/apps/plugins/app-computer/index.js +1 -1
  405. package/lib/apps/plugins/app-elements/AppElements.d.ts +1 -1
  406. package/lib/apps/plugins/app-elements/AppElements.js +1 -1
  407. package/lib/apps/plugins/app-elements/QuestionView.d.ts +2 -2
  408. package/lib/apps/plugins/app-elements/QuestionView.js +1 -1
  409. package/lib/apps/plugins/app-elements/index.d.ts +4 -4
  410. package/lib/apps/plugins/app-elements/index.js +4 -4
  411. package/lib/apps/plugins/app-page/AppPage.d.ts +5 -5
  412. package/lib/apps/plugins/app-page/AppPage.js +5 -5
  413. package/lib/apps/plugins/app-page/appPageModel.d.ts +13 -14
  414. package/lib/apps/plugins/app-page/appPageModel.js +12 -12
  415. package/lib/apps/plugins/app-page/index.d.ts +3 -4
  416. package/lib/apps/plugins/app-page/index.js +1 -1
  417. package/lib/apps/plugins/app-page/pageRun.d.ts +2 -2
  418. package/lib/apps/plugins/app-page/pageRun.js +2 -2
  419. package/lib/apps/plugins/app-rules/AppRulesCard.d.ts +5 -6
  420. package/lib/apps/plugins/app-rules/AppRulesCard.js +4 -4
  421. package/lib/apps/plugins/app-rules/index.js +1 -1
  422. package/lib/apps/plugins/app-rules/sessionRulesAction.d.ts +1 -1
  423. package/lib/apps/plugins/assistant/index.d.ts +9 -9
  424. package/lib/apps/plugins/assistant/index.js +5 -5
  425. package/lib/apps/plugins/assistant-characters/index.d.ts +6 -6
  426. package/lib/apps/plugins/assistant-characters/index.js +5 -5
  427. package/lib/apps/plugins/canvas-blocks/index.d.ts +2 -2
  428. package/lib/apps/plugins/canvas-blocks/index.js +2 -2
  429. package/lib/apps/plugins/canvas-parts/index.d.ts +6 -6
  430. package/lib/apps/plugins/canvas-parts/index.js +6 -6
  431. package/lib/apps/plugins/chat/ChatView.js +61 -61
  432. package/lib/apps/plugins/chat/SessionActionsMenu.d.ts +4 -4
  433. package/lib/apps/plugins/chat/SessionActionsMenu.js +3 -3
  434. package/lib/apps/plugins/chat/SessionChooseDialog.d.ts +1 -1
  435. package/lib/apps/plugins/chat/index.d.ts +9 -9
  436. package/lib/apps/plugins/chat/index.js +1 -1
  437. package/lib/apps/plugins/chat/sessionActions.js +1 -1
  438. package/lib/apps/plugins/chat/turnState.d.ts +1 -1
  439. package/lib/apps/plugins/page-layout/SplitLayout.d.ts +2 -2
  440. package/lib/apps/plugins/page-layout/SplitLayout.js +1 -1
  441. package/lib/apps/plugins/page-layout/index.js +1 -1
  442. package/lib/apps/plugins/pap-purchase/index.d.ts +9 -0
  443. package/lib/apps/plugins/pap-purchase/index.js +68 -4
  444. package/lib/apps/plugins/pap-sign-in/PapSignInCard.d.ts +1 -1
  445. package/lib/apps/plugins/pap-sign-in/PapSignInCard.js +2 -2
  446. package/lib/apps/plugins/pap-sign-in/index.js +1 -1
  447. package/lib/apps/plugins/pap-sign-in/signIn.d.ts +1 -1
  448. package/lib/apps/plugins/pap-sign-in/signIn.js +1 -1
  449. package/lib/apps/plugins/plugins-panel/index.d.ts +1 -1
  450. package/lib/apps/plugins/plugins-panel/index.js +1 -1
  451. package/lib/apps/plugins/shield-displays/DiffCard.d.ts +1 -1
  452. package/lib/apps/plugins/shield-displays/TerminalCard.d.ts +1 -1
  453. package/lib/apps/plugins/shield-displays/index.js +4 -4
  454. package/lib/apps/presets.d.ts +8 -8
  455. package/lib/apps/presets.js +1 -1
  456. package/lib/apps/shell/LoopWorkspace.d.ts +1 -1
  457. package/lib/apps/shell/LoopWorkspace.js +2 -2
  458. package/lib/apps/shell/SidebarRail.d.ts +2 -2
  459. package/lib/apps/shell/paneMotion.d.ts +1 -1
  460. package/lib/apps/shell/paneMotion.js +1 -1
  461. package/lib/chat/Chat.d.ts +2 -2
  462. package/lib/chat/Chat.js +2 -2
  463. package/lib/chat/ChatFloating.d.ts +8 -8
  464. package/lib/chat/ChatFloating.js +15 -15
  465. package/lib/chat/ChatInline.js +1 -1
  466. package/lib/chat/ChatLanguage.d.ts +1 -1
  467. package/lib/chat/ChatLanguage.js +1 -1
  468. package/lib/chat/assistant/AssistantContextMenu.d.ts +1 -1
  469. package/lib/chat/assistant/AssistantStage.d.ts +14 -14
  470. package/lib/chat/assistant/AssistantStage.js +11 -12
  471. package/lib/chat/assistant/Avatar3D.d.ts +1 -1
  472. package/lib/chat/assistant/BalloonParts.d.ts +2 -2
  473. package/lib/chat/assistant/BalloonParts.js +1 -1
  474. package/lib/chat/assistant/BalloonVisual.d.ts +1 -1
  475. package/lib/chat/assistant/ConversationBalloon.d.ts +2 -2
  476. package/lib/chat/assistant/ConversationBalloon.js +1 -1
  477. package/lib/chat/assistant/SpeechBalloon.d.ts +2 -2
  478. package/lib/chat/assistant/SpriteCharacter.d.ts +2 -2
  479. package/lib/chat/assistant/characters.d.ts +5 -5
  480. package/lib/chat/assistant/clearance.d.ts +3 -3
  481. package/lib/chat/assistant/clearance.js +3 -3
  482. package/lib/chat/assistant/formats/acf.js +1 -1
  483. package/lib/chat/assistant/formats/files.js +1 -1
  484. package/lib/chat/assistant/formats/index.d.ts +1 -1
  485. package/lib/chat/assistant/formats/index.js +1 -1
  486. package/lib/chat/assistant/formats/stateAnimations.d.ts +1 -1
  487. package/lib/chat/assistant/formats/types.d.ts +1 -1
  488. package/lib/chat/assistant/state.d.ts +10 -10
  489. package/lib/chat/assistant/state.js +5 -5
  490. package/lib/chat/assistant/toolLine.d.ts +1 -1
  491. package/lib/chat/assistant/toolLine.js +2 -2
  492. package/lib/chat/base/ChatBase.js +44 -44
  493. package/lib/chat/base/conversationItems.d.ts +2 -2
  494. package/lib/chat/base/loopElement.d.ts +4 -4
  495. package/lib/chat/base/loopStep.d.ts +4 -4
  496. package/lib/chat/base/loopStep.js +1 -1
  497. package/lib/chat/base/loopWindow.d.ts +2 -2
  498. package/lib/chat/base/loopWindow.js +2 -2
  499. package/lib/chat/base/uiFiles.d.ts +1 -1
  500. package/lib/chat/base/uiFiles.js +1 -1
  501. package/lib/chat/base/uiOps.d.ts +2 -2
  502. package/lib/chat/base/uiOps.js +2 -2
  503. package/lib/chat/index.js +1 -1
  504. package/lib/chat/indicators/McpStatusIndicator.js +1 -1
  505. package/lib/chat/indicators/SkillsStatusIndicator.js +1 -1
  506. package/lib/chat/messages/ChatMessageList.d.ts +3 -3
  507. package/lib/chat/messages/ChatMessageList.js +3 -3
  508. package/lib/chat/messages/markdownWithoutHtml.d.ts +1 -1
  509. package/lib/chat/messages/markdownWithoutHtml.js +1 -1
  510. package/lib/chat/presence/Presence.d.ts +4 -4
  511. package/lib/chat/presence/Presence.js +1 -1
  512. package/lib/chat/presence/presenceStatus.d.ts +2 -2
  513. package/lib/chat/presence/presenceStatus.js +2 -2
  514. package/lib/chat/prompt/InputPrompt.d.ts +2 -2
  515. package/lib/chat/prompt/InputPrompt.js +2 -2
  516. package/lib/chat/prompt/InputPromptBase.d.ts +1 -1
  517. package/lib/chat/prompt/InputPromptBase.js +1 -1
  518. package/lib/chat/prompt/InputPromptLexical.d.ts +1 -1
  519. package/lib/chat/styles/streamdownStyles.js +1 -1
  520. package/lib/chat/tools/IdentityAuthorization.js +1 -1
  521. package/lib/chat/useViewportDrag.d.ts +1 -1
  522. package/lib/chat/viewModes.d.ts +1 -1
  523. package/lib/chat/viewModes.js +2 -2
  524. package/lib/chat/words.js +1 -1
  525. package/lib/client/mixins/RuntimesMixin.d.ts +5 -5
  526. package/lib/client/mixins/RuntimesMixin.js +5 -5
  527. package/lib/components/a2ui/custom/index.d.ts +3 -3
  528. package/lib/components/a2ui/custom/index.js +1 -1
  529. package/lib/components/a2ui/custom/sandbox.d.ts +2 -2
  530. package/lib/components/a2ui/custom/sandbox.js +2 -2
  531. package/lib/components/a2ui/datalayer/Chart.js +2 -2
  532. package/lib/components/a2ui/datalayer/Chat.js +1 -1
  533. package/lib/components/a2ui/datalayer/Download.js +1 -1
  534. package/lib/components/a2ui/datalayer/Evidence.js +1 -1
  535. package/lib/components/a2ui/datalayer/FileUpload.d.ts +1 -1
  536. package/lib/components/a2ui/datalayer/FileUpload.js +2 -2
  537. package/lib/components/a2ui/datalayer/Form.d.ts +1 -1
  538. package/lib/components/a2ui/datalayer/Form.js +3 -3
  539. package/lib/components/a2ui/datalayer/SchemaForm.d.ts +1 -1
  540. package/lib/components/a2ui/datalayer/Table.js +1 -1
  541. package/lib/components/a2ui/datalayer/drawn.d.ts +1 -1
  542. package/lib/components/a2ui/datalayer/drawn.js +1 -1
  543. package/lib/components/a2ui/datalayer/formWidgets.js +1 -1
  544. package/lib/components/a2ui/datalayer/index.d.ts +1 -1
  545. package/lib/components/a2ui/datalayer/schema.d.ts +3 -3
  546. package/lib/components/a2ui/datalayer/schema.js +3 -3
  547. package/lib/components/a2ui/styles.js +1 -1
  548. package/lib/components/a2ui/visibleWhen.d.ts +4 -4
  549. package/lib/components/a2ui/visibleWhen.js +4 -4
  550. package/lib/components/code-sandboxes/CodeSandboxEnvironmentSelect.d.ts +2 -2
  551. package/lib/components/code-sandboxes/CodeSandboxEnvironmentSelect.js +2 -2
  552. package/lib/components/code-sandboxes/CodeSandboxLauncher.d.ts +1 -1
  553. package/lib/components/code-sandboxes/CodeSandboxLauncher.js +4 -4
  554. package/lib/components/code-sandboxes/CodeSandboxUtils.d.ts +2 -2
  555. package/lib/components/code-sandboxes/codeSandboxEnvironments.d.ts +6 -8
  556. package/lib/components/code-sandboxes/codeSandboxEnvironments.js +4 -6
  557. package/lib/components/inspector/a2aSpans.d.ts +1 -1
  558. package/lib/components/inspector/a2aSpans.js +1 -1
  559. package/lib/components/teams/A2ATeamGraph.d.ts +3 -3
  560. package/lib/components/teams/A2ATeamGraph.js +1 -1
  561. package/lib/components/teams/AnswerSurfaces.d.ts +1 -1
  562. package/lib/components/teams/AnswerSurfacesView.d.ts +1 -1
  563. package/lib/components/teams/AnswerSurfacesView.js +1 -1
  564. package/lib/components/teams/NotebookPreview.d.ts +1 -1
  565. package/lib/components/teams/SceneTranscript.d.ts +2 -2
  566. package/lib/components/teams/SceneView.d.ts +3 -3
  567. package/lib/components/teams/a2aTeamFlow.d.ts +1 -1
  568. package/lib/components/teams/a2aTeamFlow.js +1 -1
  569. package/lib/components/teams/backdrops/halo.d.ts +1 -1
  570. package/lib/components/teams/backdrops/types.d.ts +3 -3
  571. package/lib/components/teams/sceneStage.d.ts +1 -1
  572. package/lib/components/teams/sceneTranscriptRules.d.ts +2 -2
  573. package/lib/components/teams/toolEventLoop.js +1 -1
  574. package/lib/components/teams/transcript/SequenceDiagram.d.ts +1 -1
  575. package/lib/components/teams/transcript/TranscriptDetail.d.ts +1 -1
  576. package/lib/components/teams/transcript/TranscriptTable.d.ts +1 -1
  577. package/lib/components/teams/transcript/TranscriptViews.d.ts +3 -4
  578. package/lib/components/teams/transcript/index.d.ts +1 -1
  579. package/lib/components/teams/transcript/index.js +1 -1
  580. package/lib/components/teams/transcript/selection.d.ts +1 -1
  581. package/lib/components/teams/transcript/sequenceDiagramRules.d.ts +1 -1
  582. package/lib/components/teams/transcript/sequenceDiagramRules.js +1 -1
  583. package/lib/components/teams/transcript/transcriptDetailRules.d.ts +1 -1
  584. package/lib/components/teams/transcript/transcriptExport.d.ts +1 -1
  585. package/lib/components/teams/transcript/transcriptRows.d.ts +1 -1
  586. package/lib/components/teams/transcript/transcriptRows.js +1 -1
  587. package/lib/components/teams/useA2ATeam.d.ts +9 -9
  588. package/lib/components/teams/useA2ATeam.js +6 -6
  589. package/lib/examples/AvatarExample.d.ts +2 -2
  590. package/lib/examples/AvatarExample.js +3 -3
  591. package/lib/examples/AvatarGalleryExample.d.ts +3 -3
  592. package/lib/examples/AvatarGalleryExample.js +4 -4
  593. package/lib/examples/LoopAppComputerExample.d.ts +1 -1
  594. package/lib/examples/LoopAppComputerExample.js +1 -1
  595. package/lib/examples/ProtocolSignedRequestsExample.d.ts +1 -1
  596. package/lib/examples/ProtocolSignedRequestsExample.js +1 -1
  597. package/lib/examples/ProtocolUcpCheckoutExample.d.ts +1 -1
  598. package/lib/examples/ProtocolUcpCheckoutExample.js +1 -1
  599. package/lib/examples/ScenesExample.js +4 -4
  600. package/lib/examples/ShieldHarnessExample.d.ts +1 -1
  601. package/lib/examples/ShieldHarnessExample.js +1 -1
  602. package/lib/examples/ShieldPolicyExample.d.ts +1 -1
  603. package/lib/examples/ShieldPolicyExample.js +1 -1
  604. package/lib/examples/VoiceChatExample.js +1 -1
  605. package/lib/examples/example-selector.js +1 -1
  606. package/lib/examples/exampleGroups.js +4 -4
  607. package/lib/examples/pap/papSignInCases.js +1 -1
  608. package/lib/examples/protocols/signedRequestsDemo.d.ts +1 -1
  609. package/lib/examples/protocols/signedRequestsDemo.js +1 -1
  610. package/lib/examples/protocols/ucpCheckoutDemo.d.ts +1 -2
  611. package/lib/examples/protocols/ucpCheckoutDemo.js +1 -2
  612. package/lib/examples/shield/shieldHarness.d.ts +1 -1
  613. package/lib/examples/shield/shieldPolicyDemo.d.ts +1 -1
  614. package/lib/examples/utils/AvatarGalleryGrid.d.ts +2 -2
  615. package/lib/examples/utils/AvatarGalleryGrid.js +2 -2
  616. package/lib/examples/utils/avatarGallery.d.ts +5 -5
  617. package/lib/examples/utils/avatarGallery.js +2 -2
  618. package/lib/examples/utils/testSpriteCharacter.js +1 -1
  619. package/lib/hooks/useAgUi.js +1 -1
  620. package/lib/hooks/useAgentRuntimes.d.ts +3 -3
  621. package/lib/hooks/useAgentRuntimes.js +2 -2
  622. package/lib/hooks/useChat.js +1 -1
  623. package/lib/models/Environment.d.ts +39 -39
  624. package/lib/models/Environment.js +1 -1
  625. package/lib/models/EnvironmentDTO.d.ts +6 -6
  626. package/lib/models/EnvironmentDTO.js +2 -2
  627. package/lib/models/RuntimeDTO.d.ts +2 -2
  628. package/lib/portable/activity.d.ts +7 -7
  629. package/lib/portable/activity.js +3 -3
  630. package/lib/portable/adapterEvents.d.ts +2 -2
  631. package/lib/portable/agUiRefusal.d.ts +1 -1
  632. package/lib/portable/agUiRefusal.js +1 -1
  633. package/lib/portable/approvalCard.d.ts +1 -1
  634. package/lib/portable/approvalCard.js +1 -1
  635. package/lib/portable/approvals.d.ts +4 -4
  636. package/lib/portable/approvals.js +2 -2
  637. package/lib/portable/attention.d.ts +4 -4
  638. package/lib/portable/attention.js +6 -6
  639. package/lib/portable/conversation.d.ts +2 -2
  640. package/lib/portable/conversation.js +1 -1
  641. package/lib/portable/direct.d.ts +2 -2
  642. package/lib/portable/fixtures.d.ts +3 -3
  643. package/lib/portable/fixtures.js +3 -3
  644. package/lib/portable/hosts/agentClient.d.ts +4 -4
  645. package/lib/portable/hosts/agentClient.js +2 -2
  646. package/lib/portable/hosts/client.d.ts +2 -2
  647. package/lib/portable/hosts/client.js +3 -3
  648. package/lib/portable/hosts/contracts.d.ts +2 -2
  649. package/lib/portable/hosts/contracts.js +3 -3
  650. package/lib/portable/hosts/contracts.json +1 -1
  651. package/lib/portable/hosts/deadLetters.d.ts +1 -1
  652. package/lib/portable/hosts/deadLetters.js +4 -4
  653. package/lib/portable/hosts/deliveries.d.ts +1 -1
  654. package/lib/portable/hosts/forbiddenGraph.d.ts +2 -3
  655. package/lib/portable/hosts/forbiddenGraph.js +2 -3
  656. package/lib/portable/hosts/health.d.ts +2 -2
  657. package/lib/portable/hosts/health.js +2 -2
  658. package/lib/portable/hosts/index.d.ts +1 -1
  659. package/lib/portable/hosts/index.js +1 -1
  660. package/lib/portable/hosts/observability.d.ts +2 -2
  661. package/lib/portable/hosts/observability.js +3 -3
  662. package/lib/portable/hosts/postgresQueue.d.ts +5 -6
  663. package/lib/portable/hosts/postgresQueue.js +4 -5
  664. package/lib/portable/hosts/queue.d.ts +1 -1
  665. package/lib/portable/hosts/quotas.d.ts +3 -3
  666. package/lib/portable/hosts/quotas.js +2 -2
  667. package/lib/portable/hosts/rateLimit.d.ts +1 -1
  668. package/lib/portable/hosts/resolution.d.ts +3 -3
  669. package/lib/portable/hosts/schema.d.ts +1 -1
  670. package/lib/portable/hosts/schema.js +1 -1
  671. package/lib/portable/hosts/secretCipher.d.ts +1 -2
  672. package/lib/portable/hosts/turnState.d.ts +1 -1
  673. package/lib/portable/index.js +13 -13
  674. package/lib/portable/lifecycle.d.ts +4 -4
  675. package/lib/portable/lifecycle.js +1 -1
  676. package/lib/portable/localApprovals.d.ts +1 -1
  677. package/lib/portable/localApprovals.js +1 -1
  678. package/lib/portable/localRuntime.d.ts +7 -7
  679. package/lib/portable/localRuntime.js +5 -5
  680. package/lib/portable/presence.d.ts +3 -3
  681. package/lib/portable/protectedInput.d.ts +1 -1
  682. package/lib/portable/records.d.ts +1 -1
  683. package/lib/portable/records.js +1 -1
  684. package/lib/portable/runMeasures.d.ts +1 -1
  685. package/lib/portable/runMeasures.js +1 -1
  686. package/lib/portable/runtimes.d.ts +1 -1
  687. package/lib/portable/semantic-events.json +1 -1
  688. package/lib/portable/semantic.d.ts +1 -1
  689. package/lib/portable/semanticOfAgUi.d.ts +2 -2
  690. package/lib/portable/semanticOfAgUi.js +1 -1
  691. package/lib/portable/sessionList.d.ts +11 -11
  692. package/lib/portable/sessionList.js +8 -8
  693. package/lib/portable/signIn.d.ts +9 -9
  694. package/lib/portable/signIn.js +4 -4
  695. package/lib/portable/signInStatus.d.ts +1 -1
  696. package/lib/portable/signInStatus.js +1 -1
  697. package/lib/portable/thread.d.ts +1 -1
  698. package/lib/portable/views.d.ts +3 -3
  699. package/lib/protocols/A2AAdapter.d.ts +1 -1
  700. package/lib/protocols/A2AAdapter.js +4 -4
  701. package/lib/protocols/AGUIAdapter.d.ts +1 -1
  702. package/lib/protocols/AGUIAdapter.js +2 -2
  703. package/lib/protocols/BrowserAgentAdapter.d.ts +2 -2
  704. package/lib/protocols/BrowserAgentAdapter.js +1 -1
  705. package/lib/protocols/VercelAIAdapter.js +2 -2
  706. package/lib/protocols/a2a/index.d.ts +1 -1
  707. package/lib/protocols/a2a/index.js +1 -1
  708. package/lib/protocols/agentic-commerce/index.d.ts +3 -3
  709. package/lib/protocols/agentic-commerce/index.js +3 -3
  710. package/lib/protocols/commerce.d.ts +3 -3
  711. package/lib/protocols/commerce.js +3 -3
  712. package/lib/protocols/core.d.ts +3 -3
  713. package/lib/protocols/mcp/client.js +1 -1
  714. package/lib/protocols/mcp/index.js +2 -2
  715. package/lib/protocols/pact/index.d.ts +2 -2
  716. package/lib/protocols/pact/index.js +1 -1
  717. package/lib/protocols/ucp/index.d.ts +3 -3
  718. package/lib/protocols/ucp/index.js +3 -3
  719. package/lib/protocols/ucp/merchant.js +1 -1
  720. package/lib/protocols/web-bot-auth/index.d.ts +2 -3
  721. package/lib/protocols/web-bot-auth/index.js +2 -3
  722. package/lib/protocols/web-bot-auth/tap.js +1 -1
  723. package/lib/runtimes/actions.d.ts +1 -1
  724. package/lib/runtimes/actions.js +3 -3
  725. package/lib/runtimes/apis.d.ts +4 -4
  726. package/lib/runtimes/browser/a2aPeer.d.ts +1 -1
  727. package/lib/runtimes/browser/a2aPeer.js +1 -1
  728. package/lib/runtimes/browser/frontendTools.d.ts +1 -1
  729. package/lib/runtimes/browser/protocol.d.ts +1 -1
  730. package/lib/runtimes/variants.d.ts +3 -3
  731. package/lib/runtimes/variants.js +4 -4
  732. package/lib/specs/apps.js +37 -37
  733. package/lib/specs/appspecSchema.js +2 -2
  734. package/lib/specs/harnesses.d.ts +2 -2
  735. package/lib/specs/harnesses.js +1 -1
  736. package/lib/specs/policies.d.ts +1 -1
  737. package/lib/specs/protocols.d.ts +1 -1
  738. package/lib/specs/sessionFiles.d.ts +1 -1
  739. package/lib/specs/sessionFiles.js +1 -1
  740. package/lib/specs/standards.d.ts +1 -1
  741. package/lib/specs/ui.d.ts +1 -1
  742. package/lib/specs/ui.js +1 -1
  743. package/lib/specs/voices.d.ts +1 -1
  744. package/lib/stores/agentRuntimeStore.js +1 -1
  745. package/lib/stories/loop/ReferenceScreens.d.ts +3 -3
  746. package/lib/stories/loop/ReferenceScreens.js +12 -12
  747. package/lib/stories/loop/pictures-main.js +3 -3
  748. package/lib/tools/adapters/agent-runtimes/AgentRuntimesToolAdapter.js +1 -1
  749. package/lib/tools/toolEventTurns.d.ts +2 -2
  750. package/lib/types/agentspecs.d.ts +4 -4
  751. package/lib/types/chat.d.ts +22 -22
  752. package/lib/types/mcp.d.ts +2 -2
  753. package/lib/types/messages.d.ts +1 -1
  754. package/lib/types/protocol.d.ts +1 -1
  755. package/lib/types/scenes.d.ts +7 -7
  756. package/lib/types/teams.d.ts +5 -5
  757. package/lib/types/tools.d.ts +2 -2
  758. package/lib/ui-plugins/MCPUIPlugin.d.ts +2 -2
  759. package/lib/ui-plugins/MCPUIPlugin.js +1 -1
  760. package/lib/voice/ComposerVoice.d.ts +13 -13
  761. package/lib/voice/ComposerVoice.js +3 -3
  762. package/lib/voice/HandsFree.d.ts +13 -13
  763. package/lib/voice/HandsFree.js +5 -5
  764. package/lib/voice/ReadAloud.d.ts +1 -1
  765. package/lib/voice/VoiceInput.d.ts +7 -7
  766. package/lib/voice/VoiceInput.js +5 -5
  767. package/lib/voice/VoiceMenu.d.ts +2 -2
  768. package/lib/voice/captions.d.ts +1 -1
  769. package/lib/voice/captions.js +1 -1
  770. package/lib/voice/capture.d.ts +3 -3
  771. package/lib/voice/capture.js +3 -3
  772. package/lib/voice/chatVoice.d.ts +8 -8
  773. package/lib/voice/chatVoice.js +11 -11
  774. package/lib/voice/choices.d.ts +3 -3
  775. package/lib/voice/choices.js +3 -3
  776. package/lib/voice/consent.d.ts +3 -3
  777. package/lib/voice/consent.js +4 -4
  778. package/lib/voice/handsFreeRules.d.ts +11 -11
  779. package/lib/voice/handsFreeRules.js +8 -8
  780. package/lib/voice/hearing.d.ts +7 -7
  781. package/lib/voice/hearing.js +4 -4
  782. package/lib/voice/index.d.ts +11 -11
  783. package/lib/voice/keptSound.d.ts +2 -2
  784. package/lib/voice/keptSound.js +3 -3
  785. package/lib/voice/pinned.d.ts +2 -2
  786. package/lib/voice/pinned.js +2 -2
  787. package/lib/voice/sayAloud.d.ts +5 -5
  788. package/lib/voice/sayAloud.js +5 -5
  789. package/lib/voice/sentences.d.ts +2 -2
  790. package/lib/voice/sentences.js +3 -3
  791. package/lib/voice/serverHearing.d.ts +2 -2
  792. package/lib/voice/serverHearing.js +5 -5
  793. package/lib/voice/settings.d.ts +11 -11
  794. package/lib/voice/settings.js +7 -7
  795. package/lib/voice/speaker.d.ts +14 -14
  796. package/lib/voice/speaker.js +7 -7
  797. package/lib/voice/types.d.ts +3 -3
  798. package/lib/voice/useSpokenAnswers.js +1 -1
  799. package/lib/voice/useVoiceSettings.js +1 -1
  800. package/lib/voice/useVoiceSpeaker.d.ts +2 -2
  801. package/lib/voice/useVoiceSpeaker.js +2 -2
  802. package/package.json +2 -2
  803. package/scripts/codegen/generate_agentic_commerce.sh +1 -1
  804. package/scripts/codegen/generate_agents.py +6 -6
  805. package/scripts/codegen/generate_harnesses.py +7 -7
  806. package/scripts/codegen/generate_mcp_servers.py +4 -4
  807. package/scripts/codegen/generate_policies.py +3 -3
  808. package/scripts/codegen/generate_protocols.py +4 -4
  809. package/scripts/codegen/generate_scenes.py +4 -4
  810. package/scripts/codegen/generate_session_files.py +3 -3
  811. package/scripts/codegen/generate_standards.py +3 -3
  812. package/scripts/codegen/generate_teams.py +1 -1
  813. package/scripts/codegen/generate_ui.py +5 -5
  814. package/scripts/codegen/generate_ui_renderers.py +2 -2
  815. package/scripts/codegen/generate_voices.py +3 -3
  816. package/scripts/dist-embed.mjs +1 -1
  817. package/scripts/generate-environments-types.py +2 -2
  818. package/scripts/record-scene-checks.py +2 -2
  819. package/scripts/voice/measure.py +3 -3
  820. package/scripts/voice/pin_store.py +2 -2
  821. package/scripts/voice/serve_store.py +1 -1
  822. package/scripts/voice/transcribe.mjs +1 -1
  823. package/dist-embed/chunks/AgentDetailsDialog-DMTVgMus.js +0 -1
  824. package/dist-embed/chunks/ContextPie-C0N8hwmj.js +0 -1
  825. package/dist-embed/chunks/index.esm-tNe_Tes8.js +0 -1
  826. package/dist-embed/chunks/plugin-BFdQv_3f.js +0 -1
@@ -1 +1 @@
1
- import{kV as ne,kW as se,kX as ae,bm as ie,J as O,kY as le,j as t,kZ as oe,k_ as de,gM as F,k$ as H,gc as ce,r as E,bx as T,f8 as ue,I as ee,X as pe,dp as te,T as K,dt as he,W as me,A as xe,v as re,l0 as Y,l1 as fe,l2 as ye,gh as ge,h3 as J,gO as be,l3 as je,B as Ce,ds as Te}from"../datalayer-app-main.js";import{F as Se,T as D,a as X,g as A,b as Fe,e as Z,d as L,f as Be,h as ke,t as ve,i as we,c as Ae,j as Ie,A as De,s as Le,k as We,o as G,l as Oe,m as Ve,n as v,u as Re,p as _e,r as Ee,q as $e,v as qe}from"./index-DakHBTji.js";import{A as Ge,a as Pe}from"./ArrowUpIcon-y5enrVH9.js";import"./_baseRest-BmxuuM4H.js";import"./isSymbol-BLtK9CV6.js";import"./forEach-hknrtmxV.js";import"./uniqueId-BVuTZY3F.js";import"./toNumber-B1wj8-wx.js";import"./_baseClone-ByJL1tkX.js";import"./merge-B_wcPK4Y.js";import"./isEqual-DXPB_0fo.js";const Me=r=>{const e=ie.c(24);let n,s,a,o;e[0]!==r?({children:n,disabled:s,onChange:a,...o}=r,e[0]=r,e[1]=n,e[2]=s,e[3]=a,e[4]=o):(n=e[1],s=e[2],a=e[3],o=e[4]);let m;if(e[5]!==n){const y=O.Children.toArray(n).filter(Ne).map(Ue).flat();m=O.Children.toArray(y).filter(ze).map(He).filter(Boolean),e[5]=n,e[6]=m}else m=e[6];const u=m,[d,c]=le(u);let x;e[7]!==d||e[8]!==c?(x=y=>{const{value:b,checked:j}=y.currentTarget;if(j){c([...d.current||[],b]);return}c((d.current||[]).filter(S=>S!==b))},e[7]=d,e[8]=c,e[9]=x):x=e[9];const i=x;let l;e[10]!==a||e[11]!==d||e[12]!==i?(l=y=>{a&&(i(y),a(d.current||[],y))},e[10]=a,e[11]=d,e[12]=i,e[13]=l):l=e[13];let h;e[14]!==s||e[15]!==l?(h={disabled:s,onChange:l},e[14]=s,e[15]=l,e[16]=h):h=e[16];let p;e[17]!==n||e[18]!==s||e[19]!==o?(p=t.jsx(oe,{disabled:s,...o,children:n}),e[17]=n,e[18]=s,e[19]=o,e[20]=p):p=e[20];let f;return e[21]!==h||e[22]!==p?(f=t.jsx(de.Provider,{value:h,children:p}),e[21]=h,e[22]=p,e[23]=f):f=e[23],f};var Q=Object.assign(Me,{Caption:ae,Label:se,Validation:ne});function Ne(r){return O.isValidElement(r)&&r.type===F}function Ue(r){return O.isValidElement(r)?r.props.children:[]}function ze(r){return O.isValidElement(r)&&r.type===H}function He(r){return O.isValidElement(r)&&(r.props.checked||r.props.defaultChecked)&&r.props.value}const Ke=({name:r="slider",id:e="slider",min:n=0,max:s=10,value:a=5,label:o="label",step:m=1,markers:u=!1,displayValue:d=!0,disabled:c=!1,orientation:x="horizontal",width:i="200px",onChange:l})=>{const{colorMode:h}=ce(),p=s<n?n:n+(s-n)/2,[f,y]=E.useState(p);E.useEffect(()=>{y(a??p)},[a,p]);const b=S=>{const g=Number(S.target.value);y(g),l(g)},j={width:i,...x==="vertical"?{transform:"rotate(-90deg)"}:{},colorScheme:h=="day"?"light":"dark",accentColor:"var(--fgColor-accent)"};return t.jsxs(T,{display:"flex",alignItems:"center",children:[t.jsx("input",{type:"range",id:e,name:r,min:n,max:s,value:f,step:m??"any",list:"slider-markers",style:j,onChange:b,disabled:c}),u&&m&&t.jsx("datalist",{id:"slider-markers",children:Array.from({length:Math.floor((s-n)/m)+1},(S,g)=>n+g*m).map(S=>t.jsx("option",{value:S},`slider-marker-${S}`))}),o&&t.jsx(F.Label,{htmlFor:e,sx:{ml:2},children:o}),d&&x==="horizontal"&&t.jsx(ue,{sx:{ml:2},children:f})]})};function Xe(r){return E.forwardRef(({fields:e,widgets:n,templates:s,...a},o)=>(e={...r?.fields,...e},n={...r?.widgets,...n},s={...r?.templates,...s,ButtonTemplates:{...r?.templates?.ButtonTemplates,...s?.ButtonTemplates}},t.jsx(Se,{...r,...a,fields:e,widgets:n,templates:s,ref:o})))}function Ye({uiSchema:r,registry:e,...n}){const{translateString:s}=e;return t.jsx(ee,{variant:"default",size:"small",icon:pe,"aria-label":s(D.AddItemButton),...n})}function Je(r){const{children:e,disabled:n,hasToolbar:s,hasMoveDown:a,hasMoveUp:o,hasRemove:m,index:u,onDropIndexClick:d,onReorderClick:c,readonly:x,uiSchema:i,registry:l}=r,{MoveDownButton:h,MoveUpButton:p,RemoveButton:f}=l.templates.ButtonTemplates,y={flex:1,paddingLeft:6,paddingRight:6,fontWeight:"bold",minWidth:0};return t.jsxs(T,{sx:{display:"flex",width:"100%",flexFlow:"row wrap"},alignItems:"center",children:[t.jsx(T,{sx:{flexBasis:0,flexGrow:1,maxWidth:"100%"},style:{overflow:"auto"},children:t.jsx(T,{mb:2,p:2,sx:{borderWidth:1,borderStyle:"solid",borderColor:"border.default",borderRadius:2},children:e})}),s&&t.jsxs(T,{p:1,children:[(o||a)&&t.jsx(p,{style:y,disabled:n||x||!o,onClick:c(u,u-1),uiSchema:i,registry:l}),(o||a)&&t.jsx(h,{style:y,disabled:n||x||!a,onClick:c(u,u+1),uiSchema:i,registry:l}),m&&t.jsx(f,{style:y,disabled:n||x,onClick:d(u),uiSchema:i,registry:l})]})]})}function Ze(r){const{canAdd:e,disabled:n,idSchema:s,uiSchema:a,items:o,onAddClick:m,readonly:u,registry:d,required:c,schema:x,title:i}=r,l=X(a),h=A("ArrayFieldDescriptionTemplate",d,l),p=A("ArrayFieldItemTemplate",d,l),f=A("ArrayFieldTitleTemplate",d,l),{ButtonTemplates:{AddButton:y}}=d.templates;return t.jsxs(T,{p:3,sx:{display:"flex",width:"100%",flexFlow:"row wrap",borderWidth:1,borderStyle:"solid",borderColor:"border.default",borderRadius:2},children:[t.jsx(f,{idSchema:s,title:l.title||i,schema:x,uiSchema:a,required:c,registry:d}),t.jsx(h,{idSchema:s,description:l.description||x.description,schema:x,uiSchema:a,registry:d}),t.jsxs(T,{sx:{display:"flex",width:"100%",flexFlow:"row wrap"},children:[o&&o.map(({key:b,...j})=>t.jsx(p,{...j},b)),e&&t.jsx(T,{sx:{display:"flex",width:"100%",flexFlow:"row wrap"},justifyContent:"flex-end",children:t.jsx(T,{sx:{flexBasis:0,flexGrow:1,maxWidth:"100%"},children:t.jsx(T,{mt:2,children:t.jsx(y,{className:"array-item-add",onClick:m,disabled:n||u,uiSchema:a,registry:d})})})})]},`array-item-list-${s.$id}`)]})}function Qe(r){const{id:e,placeholder:n,required:s,readonly:a,disabled:o,type:m,label:u,value:d,onChange:c,onBlur:x,onFocus:i,autofocus:l,options:h,schema:p,uiSchema:f,rawErrors:y=[],formContext:b,registry:j,hideLabel:S,hideError:g,...C}=r,w=Fe(p,m,h),{step:I,min:V,max:R,...M}=w,$={...Array.isArray(p.examples)?{list:Z(e)}:void 0,...M,...I!==void 0?{step:I}:void 0,...V!==void 0?{min:V}:void 0,...R!==void 0?{max:R}:void 0},N=({target:{value:B}})=>c(B===""?h.emptyValue:B),U=({target:{value:B}})=>x(e,B),z=({target:{value:B}})=>i(e,B),{schemaUtils:q}=j,k=q.getDisplayLabel(p,f);return t.jsxs(t.Fragment,{children:[t.jsx(F.Label,{visuallyHidden:!k,htmlFor:e,children:u||p.title}),t.jsx(te,{id:e,name:e,placeholder:n,autoFocus:l,required:s,disabled:o||a,...$,value:d||d===0?d:"",validationStatus:y.length>0?"error":void 0,onChange:N,onBlur:U,onFocus:z,block:!0,...C,"aria-describedby":L(e,!!p.examples)}),Array.isArray(p.examples)&&t.jsx("datalist",{id:Z(e),children:p.examples.concat(p.default&&!p.examples.includes(p.default)?[p.default]:[]).map(B=>t.jsx("option",{value:B},B))})]})}function et(r){const{id:e,description:n}=r;return n?t.jsx(K,{id:e,as:"p",mt:1,children:n}):null}function tt({errors:r,registry:e}){const{translateString:n}=e;return t.jsx(T,{mb:3,sx:{borderWidth:1,borderStyle:"solid",borderColor:"border.default",borderRadius:2},children:t.jsxs(T,{p:3,children:[t.jsx(T,{as:"h3",sx:{fontSize:3,fontWeight:"semibold",m:0},children:n(D.ErrorsLabel)}),t.jsx(t.Fragment,{children:r.map((s,a)=>t.jsx(he,{variant:"danger",sx:{marginTop:2},children:s.stack},a))})]})})}function P({color:r,title:e,icon:n,...s}){return r||(r="invisible"),t.jsx(ee,{variant:r,size:"small",icon:n,onClick:a=>a.preventDefault(),onSubmit:a=>a.preventDefault(),"aria-label":e,...s})}function rt(r){const{registry:{translateString:e}}=r;return t.jsx(P,{title:e(D.CopyButton),...r,icon:xe})}function nt(r){const{registry:{translateString:e}}=r;return t.jsx(P,{title:e(D.MoveDownButton),...r,icon:Pe})}function st(r){const{registry:{translateString:e}}=r;return t.jsx(P,{title:e(D.MoveUpButton),...r,icon:Ge})}function at(r){const{iconType:e,...n}=r,{registry:{translateString:s}}=n;return t.jsx(P,{title:s(D.RemoveButton),...n,icon:me})}function it(r){const{errors:e=[],idSchema:n}=r;if(e.length===0)return null;const s=Be(n);return t.jsx("div",{id:s,children:e.map((a,o)=>t.jsxs(K,{as:"p",mb:1,sx:{fontSize:"12px",display:"block",color:"danger.fg"},children:["•"," "+a]},o))})}function lt(r){const{idSchema:e,help:n}=r;if(!n)return null;const s=ke(e);return t.jsx(F.Caption,{id:s,children:n})}function ot(r){const{id:e,children:n,classNames:s,style:a,disabled:o,displayLabel:m,hidden:u,label:d,onDropPropertyClick:c,onKeyChange:x,readonly:i,required:l,rawErrors:h=[],errors:p,help:f,rawDescription:y,schema:b,uiSchema:j,registry:S}=r,g=X(j),C=A("WrapIfAdditionalTemplate",S,g);return u?t.jsx("div",{style:{display:"none"},children:n}):t.jsx(C,{classNames:s,style:a,disabled:o,id:e,label:d,onDropPropertyClick:c,onKeyChange:x,readonly:i,required:l,schema:b,uiSchema:j,registry:S,children:t.jsxs(F,{required:l,children:[t.jsx(F.Label,{visuallyHidden:!0}),n,m&&y?t.jsx(F.Caption,{id:e,children:y}):null,p,f]})})}function dt(r){const{description:e,title:n,properties:s,required:a,disabled:o,readonly:m,uiSchema:u,idSchema:d,schema:c,formData:x,onAddClick:i,registry:l}=r,h=X(u),p=A("TitleFieldTemplate",l,h),f=A("DescriptionFieldTemplate",l,h),{ButtonTemplates:{AddButton:y}}=l.templates;return t.jsxs(t.Fragment,{children:[(h.title||n)&&t.jsx(p,{id:ve(d),title:n,required:a,schema:c,uiSchema:u,registry:l}),(h.description||e)&&t.jsx(f,{id:we(d),description:h.description||e,schema:c,uiSchema:u,registry:l}),t.jsxs(T,{sx:{display:"flex",width:"100%",flexDirection:"column",flexFlow:"row wrap"},style:{marginTop:"10px"},children:[s.map((b,j)=>b.hidden?b.content:t.jsx(T,{sx:{flexBasis:"100%",flexGrow:0,maxWidth:"100%"},mb:1,children:b.content},j)),Ae(c,u,x)&&t.jsx(T,{sx:{display:"flex",width:"100%",flexFlow:"row wrap"},justifyContent:"flex-end",children:t.jsx(T,{sx:{flexBasis:0,flexGrow:1,maxWidth:"100%"},children:t.jsx(y,{className:"object-property-expand",onClick:b=>{b.preventDefault(),i(c)()},disabled:o||m,uiSchema:u,registry:l})})})]})]})}function ct({uiSchema:r}){const{submitText:e,norender:n,props:s={}}=Ie(r);return n?null:t.jsx(T,{marginTop:2,children:t.jsx(re,{type:"submit",variant:"primary",...s,children:e})})}function ut({id:r,title:e}){return t.jsx(T,{id:r,my:2,children:t.jsx(T,{as:"h5",sx:{fontSize:1,fontWeight:"semibold",m:0,borderBottom:"1px solid",borderColor:"border.default",paddingBottom:1},children:e})})}function pt(r){const{children:e,classNames:n,style:s,disabled:a,id:o,label:m,onDropPropertyClick:u,onKeyChange:d,readonly:c,required:x,schema:i,uiSchema:l,registry:h}=r,{templates:p,translateString:f}=h,{RemoveButton:y}=p.ButtonTemplates,b=f(D.KeyLabel,[m]),j=De in i,S={flex:1,paddingLeft:6,paddingRight:6,fontWeight:"bold"};if(!j)return t.jsx("div",{className:n,style:s,children:e});const g=({target:C})=>d(C.value);return t.jsxs(T,{sx:{display:"flex",width:"100%",flexFlow:"row wrap"},alignItems:"center",className:n,style:s,children:[t.jsx(T,{pr:2,sx:{flexBasis:0,flexGrow:1,maxWidth:"100%"},children:t.jsxs(F,{id:`${o}-key`,required:x,children:[t.jsx(F.Label,{children:b}),t.jsx(te,{defaultValue:m,disabled:a||c,name:`${o}-key`,onBlur:c?void 0:g,type:"text",block:!0})]})}),t.jsx(T,{pr:2,sx:{flexBasis:0,flexGrow:1,maxWidth:"100%"},children:e}),t.jsx(T,{children:t.jsx(y,{iconType:"default",style:S,disabled:a||c,onClick:u(m),uiSchema:l,registry:h})})]},`${o}-key`)}function ht(){return{ArrayFieldItemTemplate:Je,ArrayFieldTemplate:Ze,BaseInputTemplate:Qe,ButtonTemplates:{AddButton:Ye,CopyButton:rt,MoveDownButton:nt,MoveUpButton:st,RemoveButton:at,SubmitButton:ct},DescriptionFieldTemplate:et,ErrorListTemplate:tt,FieldErrorTemplate:it,FieldHelpTemplate:lt,FieldTemplate:ot,ObjectFieldTemplate:dt,TitleFieldTemplate:ut,WrapIfAdditionalTemplate:pt}}function mt(r){const{schema:e,id:n,value:s,disabled:a,readonly:o,label:m,autofocus:u,onChange:d,onBlur:c,onFocus:x}=r,i=Le(e),l=({target:{checked:f}})=>d(f),h=({target:{value:f}})=>c(n,f),p=({target:{value:f}})=>x(n,f);return t.jsxs(F,{id:n,children:[t.jsx(H,{checked:typeof s>"u"?!1:!!s,required:i,disabled:a||o,autoFocus:u,onChange:l,onBlur:h,onFocus:p,"aria-describedby":L(n)}),t.jsx(F.Label,{children:m||""})]})}function xt({schema:r,label:e,id:n,disabled:s,options:a,value:o,autofocus:m,readonly:u,required:d,onChange:c,onBlur:x,onFocus:i}){const{enumOptions:l,enumDisabled:h,inline:p,emptyValue:f}=a,y=Array.isArray(o)?o:[o],b=g=>({target:{checked:C}})=>{c(C?Oe(g,y,l):Ve(g,y,l))},j=({target:{value:g}})=>x(n,v(g,l,f)),S=({target:{value:g}})=>i(n,v(g,l,f));return t.jsxs(Q,{required:d,children:[t.jsx(Q.Label,{children:e||r.title}),Array.isArray(l)&&l.map((g,C)=>{const w=We(g.value,y),I=Array.isArray(h)&&h.indexOf(g.value)!==-1;return t.jsxs(F,{id:G(n,C),children:[t.jsx(H,{checked:w,disabled:s||I||u,autoFocus:m&&C===0,onChange:b(C),onBlur:j,onFocus:S,"aria-describedby":L(n)}),t.jsx(F.Label,{children:g.label})]},G(n,C))})]})}function ft(r){const{options:e,registry:n}=r,s=A("BaseInputTemplate",n,e);return t.jsx(s,{type:"date",InputLabelProps:{shrink:!0},...r})}function yt(r){const{options:e,registry:n}=r,s=A("BaseInputTemplate",n,e),a=Re(r.value),o=m=>{r.onChange(_e(m))};return t.jsx(s,{type:"datetime-local",...r,value:a,onChange:o})}function gt({id:r,schema:e,options:n,value:s,required:a,disabled:o,readonly:m,label:u,onChange:d,onBlur:c,onFocus:x}){const{enumOptions:i,enumDisabled:l,emptyValue:h}=n,p=({target:{value:b}})=>d(v(b,i,h)),f=({target:{value:b}})=>c(r,v(b,i,h)),y=({target:{value:b}})=>x(r,v(b,i,h));return t.jsxs(Y,{name:r,required:a,children:[t.jsx(Y.Label,{children:u||e.title}),t.jsx(t.Fragment,{children:Array.isArray(i)&&i.map((b,j)=>{const S=Array.isArray(l)&&l.indexOf(b.value)!==-1;return t.jsxs(F,{id:G(r,j),children:[t.jsx(fe,{value:String(j),onChange:p,onBlur:f,onFocus:y,"aria-describedby":L(r),disabled:o||S||m},j),t.jsx(F.Label,{children:b.label})]},G(r,j))})})]})}function bt(r){const{value:e,readonly:n,disabled:s,options:a,schema:o,onChange:m,label:u,id:d}=r,c={value:e,label:u,id:d,name:d,...Ee(o)},x=i=>{m(i??a.emptyValue)};return t.jsxs(t.Fragment,{children:[t.jsx(F.Label,{htmlFor:d,children:u||o.title}),t.jsx(Ke,{disabled:s||n,onChange:x,...c,"aria-describedby":L(d)})]})}function jt({schema:r,id:e,options:n,label:s,required:a,disabled:o,placeholder:m,readonly:u,value:d,multiple:c,autofocus:x,onChange:i,onBlur:l,onFocus:h,rawErrors:p=[],registry:f,uiSchema:y,hideError:b,formContext:j,...S}){const{enumOptions:g,enumDisabled:C,emptyValue:w}=n,[I,V]=E.useState(!1);c=typeof c>"u"?!1:!!c;const R=c?[]:"",M=typeof d>"u"||c&&d.length<1||!c&&d===R,$=g?.map(({value:k,label:B},W)=>{const _=Array.isArray(C)&&C.indexOf(k)!==-1;return{text:B,id:W,disabled:_}}),N=({target:{value:k}})=>i(v(k,g,w)),U=({target:{value:k}})=>l(e,v(k,g,w)),z=({target:{value:k}})=>h(e,v(k,g,w)),q=$e(d,g,c);return t.jsxs(F,{id:e,required:a,children:[t.jsx(F.Label,{visuallyHidden:!(s||r.title),htmlFor:e,children:s||r.title}),c&&Array.isArray(g)?t.jsx(ye,{placeholderText:(s||r.title)??"",renderAnchor:({children:k,"aria-labelledby":B,...W})=>t.jsx(re,{trailingAction:ge,"aria-labelledby":` ${B}`,...W,onClick:_=>{V(!I),_.preventDefault()},children:k||`Select ${s||r.title}`}),open:I,onOpenChange:V,items:$??[],selected:($??[]).filter((k,B)=>q?.includes(String(B))),onSelectedChange:k=>{i(v(k.map(B=>B.id),g,w))},onFilterChange:()=>null,overlayProps:{width:"small"}}):t.jsx(J,{name:e,value:M?R:q,disabled:o||u,autoFocus:x,placeholder:s||r.title,validationStatus:p.length>0?"error":void 0,onChange:N,onBlur:U,onFocus:z,defaultValue:void 0,...S,"aria-describedby":L(e),children:Array.isArray(g)&&g.map(({value:k,label:B},W)=>{const _=Array.isArray(C)&&C.indexOf(k)!==-1;return t.jsx(J.Option,{value:String(W),disabled:_,children:B},W)})})]})}function Ct({id:r,placeholder:e,value:n,label:s,disabled:a,autofocus:o,readonly:m,onBlur:u,onFocus:d,onChange:c,options:x,schema:i,uiSchema:l,required:h,rawErrors:p=[],registry:f}){const{schemaUtils:y}=f,b=y.getDisplayLabel(i,l)&&(!!s||!!i.title),j=({target:{value:C}})=>c(C===""?x.emptyValue:C),S=({target:{value:C}})=>u(r,C),g=({target:{value:C}})=>d(r,C);return t.jsxs(t.Fragment,{children:[t.jsx(F.Label,{visuallyHidden:!b,htmlFor:r,children:s||i.title}),t.jsx(be,{id:r,name:r,value:n??"",placeholder:e,autoFocus:o,required:h,disabled:a||m,validationStatus:p.length>0?"error":void 0,onChange:j,onBlur:S,onFocus:g,block:!0,"aria-describedby":L(r)})]})}function Tt(){return{CheckboxWidget:mt,CheckboxesWidget:xt,DateWidget:ft,DateTimeWidget:yt,RadioWidget:gt,RangeWidget:bt,SelectWidget:jt,TextareaWidget:Ct}}function St(){return{templates:ht(),widgets:Tt()}}function Ft(){return Xe(St())}const Bt=Ft();function kt({id:r,value:e,label:n,disabled:s,readonly:a,onChange:o}){return t.jsxs(Ce,{display:"flex",flexDirection:"column",gap:1,children:[t.jsx(K,{as:"span",id:`${r}-label`,sx:{fontWeight:"semibold"},children:n}),t.jsx(Te,{size:"small","aria-labelledby":`${r}-label`,checked:!!e,disabled:s||a,onClick:()=>o(!e)})]})}function vt({id:r,value:e,label:n,disabled:s,readonly:a,placeholder:o,onChange:m}){const u=Array.isArray(e)?e.map(String):[],[d,c]=E.useState(""),x=()=>{const i=d.trim();i&&!u.includes(i)&&m([...u,i]),c("")};return t.jsxs(F,{id:r,disabled:s||a,children:[t.jsx(F.Label,{children:n}),t.jsx(je,{block:!0,placeholder:o,tokens:u.map((i,l)=>({id:l,text:i})),value:d,onChange:i=>c(i.target.value.replace(",","")),onKeyDown:i=>{(i.key==="Enter"||i.key===",")&&(i.preventDefault(),x())},onBlur:x,onTokenRemove:i=>{m(u.filter((l,h)=>h!==i))}})]})}const wt={switch:kt,tags:vt};function qt(r){return t.jsx(Bt,{...r,widgets:wt,validator:qe})}export{qt as default};
1
+ import{kR as ne,kS as se,kT as ae,bm as ie,J as O,kU as le,j as t,kV as oe,kW as de,gM as F,kX as H,gc as ce,r as E,bx as T,f8 as ue,I as ee,X as pe,dp as te,T as K,dt as he,W as me,A as xe,v as re,kY as Y,kZ as fe,k_ as ye,gh as ge,h3 as J,gO as be,k$ as je,B as Ce,ds as Te}from"../datalayer-app-main.js";import{F as Se,T as D,a as X,g as A,b as Fe,e as Z,d as L,f as ke,h as Be,t as ve,i as we,c as Ae,j as Ie,A as De,s as Le,k as We,o as G,l as Oe,m as Re,n as v,u as Ve,p as _e,r as Ee,q as $e,v as qe}from"./index-CHu5zo1L.js";import{A as Ge,a as Pe}from"./ArrowUpIcon-y5enrVH9.js";import"./_baseRest-BmxuuM4H.js";import"./isSymbol-BLtK9CV6.js";import"./forEach-hknrtmxV.js";import"./uniqueId-BVuTZY3F.js";import"./toNumber-B1wj8-wx.js";import"./_baseClone-ByJL1tkX.js";import"./merge-B_wcPK4Y.js";import"./isEqual-DXPB_0fo.js";const Me=r=>{const e=ie.c(24);let n,s,a,o;e[0]!==r?({children:n,disabled:s,onChange:a,...o}=r,e[0]=r,e[1]=n,e[2]=s,e[3]=a,e[4]=o):(n=e[1],s=e[2],a=e[3],o=e[4]);let m;if(e[5]!==n){const y=O.Children.toArray(n).filter(Ue).map(Ne).flat();m=O.Children.toArray(y).filter(ze).map(He).filter(Boolean),e[5]=n,e[6]=m}else m=e[6];const u=m,[d,c]=le(u);let x;e[7]!==d||e[8]!==c?(x=y=>{const{value:b,checked:j}=y.currentTarget;if(j){c([...d.current||[],b]);return}c((d.current||[]).filter(S=>S!==b))},e[7]=d,e[8]=c,e[9]=x):x=e[9];const i=x;let l;e[10]!==a||e[11]!==d||e[12]!==i?(l=y=>{a&&(i(y),a(d.current||[],y))},e[10]=a,e[11]=d,e[12]=i,e[13]=l):l=e[13];let h;e[14]!==s||e[15]!==l?(h={disabled:s,onChange:l},e[14]=s,e[15]=l,e[16]=h):h=e[16];let p;e[17]!==n||e[18]!==s||e[19]!==o?(p=t.jsx(oe,{disabled:s,...o,children:n}),e[17]=n,e[18]=s,e[19]=o,e[20]=p):p=e[20];let f;return e[21]!==h||e[22]!==p?(f=t.jsx(de.Provider,{value:h,children:p}),e[21]=h,e[22]=p,e[23]=f):f=e[23],f};var Q=Object.assign(Me,{Caption:ae,Label:se,Validation:ne});function Ue(r){return O.isValidElement(r)&&r.type===F}function Ne(r){return O.isValidElement(r)?r.props.children:[]}function ze(r){return O.isValidElement(r)&&r.type===H}function He(r){return O.isValidElement(r)&&(r.props.checked||r.props.defaultChecked)&&r.props.value}const Ke=({name:r="slider",id:e="slider",min:n=0,max:s=10,value:a=5,label:o="label",step:m=1,markers:u=!1,displayValue:d=!0,disabled:c=!1,orientation:x="horizontal",width:i="200px",onChange:l})=>{const{colorMode:h}=ce(),p=s<n?n:n+(s-n)/2,[f,y]=E.useState(p);E.useEffect(()=>{y(a??p)},[a,p]);const b=S=>{const g=Number(S.target.value);y(g),l(g)},j={width:i,...x==="vertical"?{transform:"rotate(-90deg)"}:{},colorScheme:h=="day"?"light":"dark",accentColor:"var(--fgColor-accent)"};return t.jsxs(T,{display:"flex",alignItems:"center",children:[t.jsx("input",{type:"range",id:e,name:r,min:n,max:s,value:f,step:m??"any",list:"slider-markers",style:j,onChange:b,disabled:c}),u&&m&&t.jsx("datalist",{id:"slider-markers",children:Array.from({length:Math.floor((s-n)/m)+1},(S,g)=>n+g*m).map(S=>t.jsx("option",{value:S},`slider-marker-${S}`))}),o&&t.jsx(F.Label,{htmlFor:e,sx:{ml:2},children:o}),d&&x==="horizontal"&&t.jsx(ue,{sx:{ml:2},children:f})]})};function Xe(r){return E.forwardRef(({fields:e,widgets:n,templates:s,...a},o)=>(e={...r?.fields,...e},n={...r?.widgets,...n},s={...r?.templates,...s,ButtonTemplates:{...r?.templates?.ButtonTemplates,...s?.ButtonTemplates}},t.jsx(Se,{...r,...a,fields:e,widgets:n,templates:s,ref:o})))}function Ye({uiSchema:r,registry:e,...n}){const{translateString:s}=e;return t.jsx(ee,{variant:"default",size:"small",icon:pe,"aria-label":s(D.AddItemButton),...n})}function Je(r){const{children:e,disabled:n,hasToolbar:s,hasMoveDown:a,hasMoveUp:o,hasRemove:m,index:u,onDropIndexClick:d,onReorderClick:c,readonly:x,uiSchema:i,registry:l}=r,{MoveDownButton:h,MoveUpButton:p,RemoveButton:f}=l.templates.ButtonTemplates,y={flex:1,paddingLeft:6,paddingRight:6,fontWeight:"bold",minWidth:0};return t.jsxs(T,{sx:{display:"flex",width:"100%",flexFlow:"row wrap"},alignItems:"center",children:[t.jsx(T,{sx:{flexBasis:0,flexGrow:1,maxWidth:"100%"},style:{overflow:"auto"},children:t.jsx(T,{mb:2,p:2,sx:{borderWidth:1,borderStyle:"solid",borderColor:"border.default",borderRadius:2},children:e})}),s&&t.jsxs(T,{p:1,children:[(o||a)&&t.jsx(p,{style:y,disabled:n||x||!o,onClick:c(u,u-1),uiSchema:i,registry:l}),(o||a)&&t.jsx(h,{style:y,disabled:n||x||!a,onClick:c(u,u+1),uiSchema:i,registry:l}),m&&t.jsx(f,{style:y,disabled:n||x,onClick:d(u),uiSchema:i,registry:l})]})]})}function Ze(r){const{canAdd:e,disabled:n,idSchema:s,uiSchema:a,items:o,onAddClick:m,readonly:u,registry:d,required:c,schema:x,title:i}=r,l=X(a),h=A("ArrayFieldDescriptionTemplate",d,l),p=A("ArrayFieldItemTemplate",d,l),f=A("ArrayFieldTitleTemplate",d,l),{ButtonTemplates:{AddButton:y}}=d.templates;return t.jsxs(T,{p:3,sx:{display:"flex",width:"100%",flexFlow:"row wrap",borderWidth:1,borderStyle:"solid",borderColor:"border.default",borderRadius:2},children:[t.jsx(f,{idSchema:s,title:l.title||i,schema:x,uiSchema:a,required:c,registry:d}),t.jsx(h,{idSchema:s,description:l.description||x.description,schema:x,uiSchema:a,registry:d}),t.jsxs(T,{sx:{display:"flex",width:"100%",flexFlow:"row wrap"},children:[o&&o.map(({key:b,...j})=>t.jsx(p,{...j},b)),e&&t.jsx(T,{sx:{display:"flex",width:"100%",flexFlow:"row wrap"},justifyContent:"flex-end",children:t.jsx(T,{sx:{flexBasis:0,flexGrow:1,maxWidth:"100%"},children:t.jsx(T,{mt:2,children:t.jsx(y,{className:"array-item-add",onClick:m,disabled:n||u,uiSchema:a,registry:d})})})})]},`array-item-list-${s.$id}`)]})}function Qe(r){const{id:e,placeholder:n,required:s,readonly:a,disabled:o,type:m,label:u,value:d,onChange:c,onBlur:x,onFocus:i,autofocus:l,options:h,schema:p,uiSchema:f,rawErrors:y=[],formContext:b,registry:j,hideLabel:S,hideError:g,...C}=r,w=Fe(p,m,h),{step:I,min:R,max:V,...M}=w,$={...Array.isArray(p.examples)?{list:Z(e)}:void 0,...M,...I!==void 0?{step:I}:void 0,...R!==void 0?{min:R}:void 0,...V!==void 0?{max:V}:void 0},U=({target:{value:k}})=>c(k===""?h.emptyValue:k),N=({target:{value:k}})=>x(e,k),z=({target:{value:k}})=>i(e,k),{schemaUtils:q}=j,B=q.getDisplayLabel(p,f);return t.jsxs(t.Fragment,{children:[t.jsx(F.Label,{visuallyHidden:!B,htmlFor:e,children:u||p.title}),t.jsx(te,{id:e,name:e,placeholder:n,autoFocus:l,required:s,disabled:o||a,...$,value:d||d===0?d:"",validationStatus:y.length>0?"error":void 0,onChange:U,onBlur:N,onFocus:z,block:!0,...C,"aria-describedby":L(e,!!p.examples)}),Array.isArray(p.examples)&&t.jsx("datalist",{id:Z(e),children:p.examples.concat(p.default&&!p.examples.includes(p.default)?[p.default]:[]).map(k=>t.jsx("option",{value:k},k))})]})}function et(r){const{id:e,description:n}=r;return n?t.jsx(K,{id:e,as:"p",mt:1,children:n}):null}function tt({errors:r,registry:e}){const{translateString:n}=e;return t.jsx(T,{mb:3,sx:{borderWidth:1,borderStyle:"solid",borderColor:"border.default",borderRadius:2},children:t.jsxs(T,{p:3,children:[t.jsx(T,{as:"h3",sx:{fontSize:3,fontWeight:"semibold",m:0},children:n(D.ErrorsLabel)}),t.jsx(t.Fragment,{children:r.map((s,a)=>t.jsx(he,{variant:"danger",sx:{marginTop:2},children:s.stack},a))})]})})}function P({color:r,title:e,icon:n,...s}){return r||(r="invisible"),t.jsx(ee,{variant:r,size:"small",icon:n,onClick:a=>a.preventDefault(),onSubmit:a=>a.preventDefault(),"aria-label":e,...s})}function rt(r){const{registry:{translateString:e}}=r;return t.jsx(P,{title:e(D.CopyButton),...r,icon:xe})}function nt(r){const{registry:{translateString:e}}=r;return t.jsx(P,{title:e(D.MoveDownButton),...r,icon:Pe})}function st(r){const{registry:{translateString:e}}=r;return t.jsx(P,{title:e(D.MoveUpButton),...r,icon:Ge})}function at(r){const{iconType:e,...n}=r,{registry:{translateString:s}}=n;return t.jsx(P,{title:s(D.RemoveButton),...n,icon:me})}function it(r){const{errors:e=[],idSchema:n}=r;if(e.length===0)return null;const s=ke(n);return t.jsx("div",{id:s,children:e.map((a,o)=>t.jsxs(K,{as:"p",mb:1,sx:{fontSize:"12px",display:"block",color:"danger.fg"},children:["•"," "+a]},o))})}function lt(r){const{idSchema:e,help:n}=r;if(!n)return null;const s=Be(e);return t.jsx(F.Caption,{id:s,children:n})}function ot(r){const{id:e,children:n,classNames:s,style:a,disabled:o,displayLabel:m,hidden:u,label:d,onDropPropertyClick:c,onKeyChange:x,readonly:i,required:l,rawErrors:h=[],errors:p,help:f,rawDescription:y,schema:b,uiSchema:j,registry:S}=r,g=X(j),C=A("WrapIfAdditionalTemplate",S,g);return u?t.jsx("div",{style:{display:"none"},children:n}):t.jsx(C,{classNames:s,style:a,disabled:o,id:e,label:d,onDropPropertyClick:c,onKeyChange:x,readonly:i,required:l,schema:b,uiSchema:j,registry:S,children:t.jsxs(F,{required:l,children:[t.jsx(F.Label,{visuallyHidden:!0}),n,m&&y?t.jsx(F.Caption,{id:e,children:y}):null,p,f]})})}function dt(r){const{description:e,title:n,properties:s,required:a,disabled:o,readonly:m,uiSchema:u,idSchema:d,schema:c,formData:x,onAddClick:i,registry:l}=r,h=X(u),p=A("TitleFieldTemplate",l,h),f=A("DescriptionFieldTemplate",l,h),{ButtonTemplates:{AddButton:y}}=l.templates;return t.jsxs(t.Fragment,{children:[(h.title||n)&&t.jsx(p,{id:ve(d),title:n,required:a,schema:c,uiSchema:u,registry:l}),(h.description||e)&&t.jsx(f,{id:we(d),description:h.description||e,schema:c,uiSchema:u,registry:l}),t.jsxs(T,{sx:{display:"flex",width:"100%",flexDirection:"column",flexFlow:"row wrap"},style:{marginTop:"10px"},children:[s.map((b,j)=>b.hidden?b.content:t.jsx(T,{sx:{flexBasis:"100%",flexGrow:0,maxWidth:"100%"},mb:1,children:b.content},j)),Ae(c,u,x)&&t.jsx(T,{sx:{display:"flex",width:"100%",flexFlow:"row wrap"},justifyContent:"flex-end",children:t.jsx(T,{sx:{flexBasis:0,flexGrow:1,maxWidth:"100%"},children:t.jsx(y,{className:"object-property-expand",onClick:b=>{b.preventDefault(),i(c)()},disabled:o||m,uiSchema:u,registry:l})})})]})]})}function ct({uiSchema:r}){const{submitText:e,norender:n,props:s={}}=Ie(r);return n?null:t.jsx(T,{marginTop:2,children:t.jsx(re,{type:"submit",variant:"primary",...s,children:e})})}function ut({id:r,title:e}){return t.jsx(T,{id:r,my:2,children:t.jsx(T,{as:"h5",sx:{fontSize:1,fontWeight:"semibold",m:0,borderBottom:"1px solid",borderColor:"border.default",paddingBottom:1},children:e})})}function pt(r){const{children:e,classNames:n,style:s,disabled:a,id:o,label:m,onDropPropertyClick:u,onKeyChange:d,readonly:c,required:x,schema:i,uiSchema:l,registry:h}=r,{templates:p,translateString:f}=h,{RemoveButton:y}=p.ButtonTemplates,b=f(D.KeyLabel,[m]),j=De in i,S={flex:1,paddingLeft:6,paddingRight:6,fontWeight:"bold"};if(!j)return t.jsx("div",{className:n,style:s,children:e});const g=({target:C})=>d(C.value);return t.jsxs(T,{sx:{display:"flex",width:"100%",flexFlow:"row wrap"},alignItems:"center",className:n,style:s,children:[t.jsx(T,{pr:2,sx:{flexBasis:0,flexGrow:1,maxWidth:"100%"},children:t.jsxs(F,{id:`${o}-key`,required:x,children:[t.jsx(F.Label,{children:b}),t.jsx(te,{defaultValue:m,disabled:a||c,name:`${o}-key`,onBlur:c?void 0:g,type:"text",block:!0})]})}),t.jsx(T,{pr:2,sx:{flexBasis:0,flexGrow:1,maxWidth:"100%"},children:e}),t.jsx(T,{children:t.jsx(y,{iconType:"default",style:S,disabled:a||c,onClick:u(m),uiSchema:l,registry:h})})]},`${o}-key`)}function ht(){return{ArrayFieldItemTemplate:Je,ArrayFieldTemplate:Ze,BaseInputTemplate:Qe,ButtonTemplates:{AddButton:Ye,CopyButton:rt,MoveDownButton:nt,MoveUpButton:st,RemoveButton:at,SubmitButton:ct},DescriptionFieldTemplate:et,ErrorListTemplate:tt,FieldErrorTemplate:it,FieldHelpTemplate:lt,FieldTemplate:ot,ObjectFieldTemplate:dt,TitleFieldTemplate:ut,WrapIfAdditionalTemplate:pt}}function mt(r){const{schema:e,id:n,value:s,disabled:a,readonly:o,label:m,autofocus:u,onChange:d,onBlur:c,onFocus:x}=r,i=Le(e),l=({target:{checked:f}})=>d(f),h=({target:{value:f}})=>c(n,f),p=({target:{value:f}})=>x(n,f);return t.jsxs(F,{id:n,children:[t.jsx(H,{checked:typeof s>"u"?!1:!!s,required:i,disabled:a||o,autoFocus:u,onChange:l,onBlur:h,onFocus:p,"aria-describedby":L(n)}),t.jsx(F.Label,{children:m||""})]})}function xt({schema:r,label:e,id:n,disabled:s,options:a,value:o,autofocus:m,readonly:u,required:d,onChange:c,onBlur:x,onFocus:i}){const{enumOptions:l,enumDisabled:h,inline:p,emptyValue:f}=a,y=Array.isArray(o)?o:[o],b=g=>({target:{checked:C}})=>{c(C?Oe(g,y,l):Re(g,y,l))},j=({target:{value:g}})=>x(n,v(g,l,f)),S=({target:{value:g}})=>i(n,v(g,l,f));return t.jsxs(Q,{required:d,children:[t.jsx(Q.Label,{children:e||r.title}),Array.isArray(l)&&l.map((g,C)=>{const w=We(g.value,y),I=Array.isArray(h)&&h.indexOf(g.value)!==-1;return t.jsxs(F,{id:G(n,C),children:[t.jsx(H,{checked:w,disabled:s||I||u,autoFocus:m&&C===0,onChange:b(C),onBlur:j,onFocus:S,"aria-describedby":L(n)}),t.jsx(F.Label,{children:g.label})]},G(n,C))})]})}function ft(r){const{options:e,registry:n}=r,s=A("BaseInputTemplate",n,e);return t.jsx(s,{type:"date",InputLabelProps:{shrink:!0},...r})}function yt(r){const{options:e,registry:n}=r,s=A("BaseInputTemplate",n,e),a=Ve(r.value),o=m=>{r.onChange(_e(m))};return t.jsx(s,{type:"datetime-local",...r,value:a,onChange:o})}function gt({id:r,schema:e,options:n,value:s,required:a,disabled:o,readonly:m,label:u,onChange:d,onBlur:c,onFocus:x}){const{enumOptions:i,enumDisabled:l,emptyValue:h}=n,p=({target:{value:b}})=>d(v(b,i,h)),f=({target:{value:b}})=>c(r,v(b,i,h)),y=({target:{value:b}})=>x(r,v(b,i,h));return t.jsxs(Y,{name:r,required:a,children:[t.jsx(Y.Label,{children:u||e.title}),t.jsx(t.Fragment,{children:Array.isArray(i)&&i.map((b,j)=>{const S=Array.isArray(l)&&l.indexOf(b.value)!==-1;return t.jsxs(F,{id:G(r,j),children:[t.jsx(fe,{value:String(j),onChange:p,onBlur:f,onFocus:y,"aria-describedby":L(r),disabled:o||S||m},j),t.jsx(F.Label,{children:b.label})]},G(r,j))})})]})}function bt(r){const{value:e,readonly:n,disabled:s,options:a,schema:o,onChange:m,label:u,id:d}=r,c={value:e,label:u,id:d,name:d,...Ee(o)},x=i=>{m(i??a.emptyValue)};return t.jsxs(t.Fragment,{children:[t.jsx(F.Label,{htmlFor:d,children:u||o.title}),t.jsx(Ke,{disabled:s||n,onChange:x,...c,"aria-describedby":L(d)})]})}function jt({schema:r,id:e,options:n,label:s,required:a,disabled:o,placeholder:m,readonly:u,value:d,multiple:c,autofocus:x,onChange:i,onBlur:l,onFocus:h,rawErrors:p=[],registry:f,uiSchema:y,hideError:b,formContext:j,...S}){const{enumOptions:g,enumDisabled:C,emptyValue:w}=n,[I,R]=E.useState(!1);c=typeof c>"u"?!1:!!c;const V=c?[]:"",M=typeof d>"u"||c&&d.length<1||!c&&d===V,$=g?.map(({value:B,label:k},W)=>{const _=Array.isArray(C)&&C.indexOf(B)!==-1;return{text:k,id:W,disabled:_}}),U=({target:{value:B}})=>i(v(B,g,w)),N=({target:{value:B}})=>l(e,v(B,g,w)),z=({target:{value:B}})=>h(e,v(B,g,w)),q=$e(d,g,c);return t.jsxs(F,{id:e,required:a,children:[t.jsx(F.Label,{visuallyHidden:!(s||r.title),htmlFor:e,children:s||r.title}),c&&Array.isArray(g)?t.jsx(ye,{placeholderText:(s||r.title)??"",renderAnchor:({children:B,"aria-labelledby":k,...W})=>t.jsx(re,{trailingAction:ge,"aria-labelledby":` ${k}`,...W,onClick:_=>{R(!I),_.preventDefault()},children:B||`Select ${s||r.title}`}),open:I,onOpenChange:R,items:$??[],selected:($??[]).filter((B,k)=>q?.includes(String(k))),onSelectedChange:B=>{i(v(B.map(k=>k.id),g,w))},onFilterChange:()=>null,overlayProps:{width:"small"}}):t.jsx(J,{name:e,value:M?V:q,disabled:o||u,autoFocus:x,placeholder:s||r.title,validationStatus:p.length>0?"error":void 0,onChange:U,onBlur:N,onFocus:z,defaultValue:void 0,...S,"aria-describedby":L(e),children:Array.isArray(g)&&g.map(({value:B,label:k},W)=>{const _=Array.isArray(C)&&C.indexOf(B)!==-1;return t.jsx(J.Option,{value:String(W),disabled:_,children:k},W)})})]})}function Ct({id:r,placeholder:e,value:n,label:s,disabled:a,autofocus:o,readonly:m,onBlur:u,onFocus:d,onChange:c,options:x,schema:i,uiSchema:l,required:h,rawErrors:p=[],registry:f}){const{schemaUtils:y}=f,b=y.getDisplayLabel(i,l)&&(!!s||!!i.title),j=({target:{value:C}})=>c(C===""?x.emptyValue:C),S=({target:{value:C}})=>u(r,C),g=({target:{value:C}})=>d(r,C);return t.jsxs(t.Fragment,{children:[t.jsx(F.Label,{visuallyHidden:!b,htmlFor:r,children:s||i.title}),t.jsx(be,{id:r,name:r,value:n??"",placeholder:e,autoFocus:o,required:h,disabled:a||m,validationStatus:p.length>0?"error":void 0,onChange:j,onBlur:S,onFocus:g,block:!0,"aria-describedby":L(r)})]})}function Tt(){return{CheckboxWidget:mt,CheckboxesWidget:xt,DateWidget:ft,DateTimeWidget:yt,RadioWidget:gt,RangeWidget:bt,SelectWidget:jt,TextareaWidget:Ct}}function St(){return{templates:ht(),widgets:Tt()}}function Ft(){return Xe(St())}const kt=Ft();function Bt({id:r,value:e,label:n,disabled:s,readonly:a,onChange:o}){return t.jsxs(Ce,{display:"flex",flexDirection:"column",gap:1,children:[t.jsx(K,{as:"span",id:`${r}-label`,sx:{fontWeight:"semibold"},children:n}),t.jsx(Te,{size:"small","aria-labelledby":`${r}-label`,checked:!!e,disabled:s||a,onClick:()=>o(!e)})]})}function vt({id:r,value:e,label:n,disabled:s,readonly:a,placeholder:o,onChange:m}){const u=Array.isArray(e)?e.map(String):[],[d,c]=E.useState(""),x=()=>{const i=d.trim();i&&!u.includes(i)&&m([...u,i]),c("")};return t.jsxs(F,{id:r,disabled:s||a,children:[t.jsx(F.Label,{children:n}),t.jsx(je,{block:!0,placeholder:o,tokens:u.map((i,l)=>({id:l,text:i})),value:d,onChange:i=>c(i.target.value.replace(",","")),onKeyDown:i=>{(i.key==="Enter"||i.key===",")&&(i.preventDefault(),x())},onBlur:x,onTokenRemove:i=>{m(u.filter((l,h)=>h!==i))}})]})}const wt={switch:Bt,tags:vt};function qt(r){return t.jsx(kt,{...r,widgets:wt,validator:qe})}export{qt as default};
@@ -1,4 +1,4 @@
1
- import{mQ as pe,mR as sa,bE as nt,bG as oe,ea as Ti,mS as ia,j as C,r as k,e8 as Cr,mT as $r,gO as la,v as hs,_ as Ri,mU as aa,mV as ca,mW as ua,bl as Be,mX as ha,mY as fs,dp as fa,I as ds,X as da,e9 as Uo,h2 as ma}from"../datalayer-app-main.js";const zi={rows:new Int32Array(0),cols:new Int32Array(0),values:[],formulas:[],styles:new Uint16Array(0)};function Kt(t,e){const n=[],o=[],r=[],s=[],i=[];for(const[a,l,c]of t.cells.entries(e))n.push(a),o.push(l),r.push(c.value),s.push(c.formula),i.push(c.style);return{rows:Int32Array.from(n),cols:Int32Array.from(o),values:r,formulas:s,styles:Uint16Array.from(i)}}function Rt(t){return{rows:Int32Array.from(t,e=>e[0]),cols:Int32Array.from(t,e=>e[1]),values:t.map(e=>e[2].value),formulas:t.map(e=>e[2].formula),styles:Uint16Array.from(t,e=>e[2].style)}}function Mn(t){const e=[];for(let n=0;n<t.rows.length;n+=1){const o=t.formulas[n];e.push([t.rows[n],t.cols[n],o===void 0?{value:t.values[n],style:t.styles[n]}:{value:t.values[n],formula:o,style:t.styles[n]}])}return e}function ms(t){let e=64+t.rows.length*26;for(const n of t.values)typeof n=="string"&&(e+=n.length*2);for(const n of t.formulas)n!==void 0&&(e+=n.length*2);return e}function fo(t){return 64+t.ids.byteLength+(t.sizes?.byteLength??0)+(t.hidden?.byteLength??0)}const Co=(t,e)=>e==="rows"?t.rows:t.cols,ur=t=>({ids:Int32Array.from(t),sizes:null,hidden:null}),ga={op:"cells",apply(t,e){const n=t.sheet(e.sheet);for(const[o,r]of[...n.cells.entries(e.zone)])n.cells.set(o,r,null);for(const[o,r,s]of Mn(e.after)){if(o<e.zone.top||o>e.zone.bottom||r<e.zone.left||r>e.zone.right)throw new Error(`A cells patch writes ${o},${r} outside its zone.`);n.cells.set(o,r,s)}},invert:t=>({...t,before:t.after,after:t.before}),example:()=>({op:"cells",sheet:"s1",zone:{top:0,left:0,bottom:1,right:1},before:zi,after:Rt([[1,1,{value:42,style:0}]])}),bytes:t=>ms(t.before)+ms(t.after)};function Ni(t,e,n,o){e==="rows"?t.cells.shiftRows(n,o,t.rows.count):t.cells.shiftCols(n,o,t.cols.count)}const pa={op:"axis-insert",apply(t,e){const n=t.sheet(e.sheet);Co(n,e.axis).insert(e.at,e.n,e.inserted),Ni(n,e.axis,e.at,e.n)},invert:t=>({op:"axis-delete",sheet:t.sheet,axis:t.axis,at:t.at,n:t.n,removed:t.inserted,tail:t.dropped}),example:t=>{const e=t.sheet("s1").rows.count;return{op:"axis-insert",sheet:"s1",axis:"rows",at:2,n:2,inserted:ur([1<<30,(1<<30)+1]),dropped:ur([e-2,e-1])}},bytes:t=>fo(t.inserted)+(t.dropped?fo(t.dropped):0)},wa={op:"axis-delete",apply(t,e){const n=t.sheet(e.sheet);Co(n,e.axis).delete(e.at,e.n,e.tail),Ni(n,e.axis,e.at,-e.n)},invert:t=>({op:"axis-insert",sheet:t.sheet,axis:t.axis,at:t.at,n:t.n,inserted:t.removed,dropped:t.tail}),example:t=>({op:"axis-delete",sheet:"s1",axis:"rows",at:1,n:1,removed:ur([1])}),bytes:t=>fo(t.removed)+(t.tail?fo(t.tail):0)},ya={op:"axis-move",apply(t,e){Co(t.sheet(e.sheet),e.axis).move(e.at,e.n,e.to)},invert:t=>t.to<t.at?{...t,at:t.to,to:t.at+t.n}:{...t,at:t.to-t.n,to:t.at},example:()=>({op:"axis-move",sheet:"s1",axis:"cols",at:1,n:2,to:6})},ba={op:"axis-sizes",apply(t,e){Co(t.sheet(e.sheet),e.axis).setSegmentSizes(e.at,e.after.sizes,e.after.hidden,e.n)},invert:t=>({...t,before:t.after,after:t.before}),example:()=>({op:"axis-sizes",sheet:"s1",axis:"cols",at:3,n:2,before:{sizes:null,hidden:null},after:{sizes:Float64Array.of(40,50),hidden:Uint8Array.of(0,1)}})},xa={op:"merges",apply(t,e){t.sheet(e.sheet).merges=e.after.map(n=>({...n}))},invert:t=>({...t,before:t.after,after:t.before}),example:()=>({op:"merges",sheet:"s1",before:[],after:[{top:0,left:0,bottom:1,right:2}]})},va={op:"sheet-add",apply(t,e){if(t.hasSheet(e.sheet.id))throw new Error(`Sheet '${e.sheet.id}' is in the workbook already.`);if(e.index<0||e.index>t.sheets.length)throw new Error(`No sheet position ${e.index}.`);t.sheets.splice(e.index,0,e.sheet)},invert:t=>({op:"sheet-delete",index:t.index,sheet:t.sheet}),example:t=>({op:"sheet-add",index:1,sheet:t.createSheet("Example","example")})},Ea={op:"sheet-delete",apply(t,e){if(t.sheets[e.index]!==e.sheet)throw new Error(`Sheet '${e.sheet.id}' is not at position ${e.index}.`);t.sheets.splice(e.index,1)},invert:t=>({op:"sheet-add",index:t.index,sheet:t.sheet}),example:t=>({op:"sheet-delete",index:0,sheet:t.sheet("s1")})},ka={op:"sheet-rename",apply(t,e){t.sheet(e.sheet).name=e.after},invert:t=>({...t,before:t.after,after:t.before}),example:()=>({op:"sheet-rename",sheet:"s1",before:"Sheet1",after:"Budget"})},Sa={op:"sheet-move",apply(t,e){const[n]=t.sheets.splice(e.from,1);if(n===void 0)throw new Error(`No sheet at position ${e.from}.`);t.sheets.splice(e.to,0,n)},invert:t=>({...t,from:t.to,to:t.from}),example:()=>({op:"sheet-move",from:0,to:0})},Ca={op:"frozen",apply(t,e){t.sheet(e.sheet).frozen={...e.after}},invert:t=>({...t,before:t.after,after:t.before}),example:()=>({op:"frozen",sheet:"s1",before:{rows:0,cols:0},after:{rows:1,cols:2}})},$a=[ga,pa,wa,ya,ba,xa,va,Ea,ka,Sa,Ca],Oi=["#DIV/0!","#REF!","#NAME?","#VALUE!","#N/A","#NUM!","#NULL!","#CYCLE!","#BUSY!","#SPILL!","#ERROR!"],Ar=new Set(Oi);function Je(t,e){if(!Ar.has(t))throw new Error(`'${t}' is not a cell error; there are ${Oi.join(" ")}.`);return e===void 0?{error:t}:{error:t,message:e}}function j(t){return typeof t=="object"&&t!==null&&Ar.has(t.error)}function Cn(t){return Ar.has(t)}const $n={decimal:".",group:",",months:["January","February","March","April","May","June","July","August","September","October","November","December"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]};class At extends Error{}const gs={black:"#000000",blue:"#0000ff",cyan:"#00ffff",green:"#00ff00",magenta:"#ff00ff",red:"#ff0000",white:"#ffffff",yellow:"#ffff00"};function Aa(t){const e=[];let n="";for(let o=0;o<t.length;o+=1){const r=t[o];if(r==='"'){const s=t.indexOf('"',o+1);if(s<0)throw new At(`'${t}' opens a quote it never closes.`);n+=t.slice(o,s+1),o=s}else if(r==="["){const s=t.indexOf("]",o+1);if(s<0)throw new At(`'${t}' opens a bracket it never closes.`);n+=t.slice(o,s+1),o=s}else if(r==="\\"||r==="_"||r==="*"){if(o+1>=t.length)throw new At(`'${t}' ends with ${r} and nothing after it.`);n+=t.slice(o,o+2),o+=1}else r===";"?(e.push(n),n=""):n+=r}if(e.push(n),e.length>4)throw new At(`'${t}' has ${e.length} sections; a format has at most four.`);return e}const Ma=/[ymdhsYMDHS]/;function Ta(t,e){const n=[],o={tokens:n,isDate:!1,isText:!1,hasAmPm:!1};let r=0;const s=l=>{const c=n[n.length-1];c?.t==="lit"?c.s+=l:n.push({t:"lit",s:l})};for(;r<t.length;){const l=t[r],c=t.slice(r);if(l==='"'){const u=t.indexOf('"',r+1);s(t.slice(r+1,u)),r=u+1}else if(l==="\\")s(t[r+1]),r+=2;else if(l==="_")s(" "),r+=2;else if(l==="*")r+=2;else if(l==="["){const u=t.indexOf("]",r),h=t.slice(r+1,u),d=h.toLowerCase();if(d in gs)o.color=gs[d];else if(/^color\d+$/.test(d))o.color=void 0;else if(/^(<=|>=|<>|<|>|=)-?\d+(\.\d+)?$/.test(h)){const f=/^(<=|>=|<>|<|>|=)(-?\d+(?:\.\d+)?)$/.exec(h);o.condition={op:f[1],value:Number(f[2])}}else if(/^h+$/i.test(h)||/^m+$/i.test(h)||/^s+$/i.test(h))n.push({t:"elapsed",unit:h[0].toLowerCase(),width:h.length}),o.isDate=!0;else if(h.startsWith("$"))s(h.slice(1).split("-")[0]);else throw new At(`'${e}': [${h}] is not a colour, a condition or an elapsed time.`);r=u+1}else if(/^general/i.test(c))n.push({t:"general"}),r+=7;else if(/^(am\/pm|a\/p)/i.test(c)){const u=/^am\/pm/i.test(c)?t.slice(r,r+5):t.slice(r,r+3);n.push({t:"ampm",s:u}),o.hasAmPm=!0,o.isDate=!0,r+=u.length}else if(l==="0"||l==="#"||l==="?")n.push({t:"digit",c:l}),r+=1;else if(l==="."){const u=n[n.length-1];if(u?.t==="date"&&u.s.toLowerCase().startsWith("s")){let h=r+1;for(;t[h]==="0";)h+=1;n.push({t:"date",s:`.${"0".repeat(h-r-1)}`}),r=h}else n.push({t:"point"}),r+=1}else if(l===",")n.push({t:"comma"}),r+=1;else if(l==="%")n.push({t:"percent"}),r+=1;else if((l==="E"||l==="e")&&(t[r+1]==="+"||t[r+1]==="-"))n.push({t:"exp",sign:t[r+1]}),r+=2;else if(l==="@")n.push({t:"text"}),o.isText=!0,r+=1;else if(Ma.test(l)){let u=r+1;for(;u<t.length&&t[u].toLowerCase()===l.toLowerCase();)u+=1;n.push({t:"date",s:t.slice(r,u).toLowerCase()}),o.isDate=!0,r=u}else{if(l==="/"&&n.some(u=>u.t==="digit")&&!o.isDate)throw new At(`'${e}': fractions (# ?/?) are not supported yet.`);s(l),r+=1}}if(o.isDate)for(let l=0;l<n.length;l+=1){const c=n[l];c.t==="comma"?n[l]={t:"lit",s:","}:c.t==="point"?n[l]={t:"lit",s:"."}:c.t==="percent"&&(n[l]={t:"lit",s:"%"})}const i=n.filter(l=>l.t==="date"||l.t==="elapsed"),a=l=>l===void 0?"":l.t==="date"?l.s[0]:l.unit;return i.forEach((l,c)=>{l.t!=="date"||l.s[0]!=="m"||l.s.length>2||(a(i[c-1])==="h"||a(i[c+1])==="s")&&(l.s=l.s==="m"?"mi":"mmi")}),o}function Mr(t,e){if(t===0)return"0";const n=Math.abs(t);let o;if(n>=1e11||n<1e-9)o=t.toExponential(5).replace(/\.?0+e/,"e").replace("e+","E+").replace("e-","E-"),o=o.replace(/E([+-])(\d)$/,"E$10$2");else if(Number.isInteger(t))o=String(t);else{const r=String(Math.trunc(n)).length+(t<0?1:0),s=Math.max(0,Math.min(10,11-r-1));o=String(Number(t.toFixed(s)))}return o.replace(".",e.decimal)}function Ra(t){const e=Math.floor(t),n=Math.round((t-e)*864e5),o=e<60?e+1:e,r=new Date(Date.UTC(1899,11,30)+o*864e5-(e<60?864e5:0));return{...e===60?{y:1900,m:2,d:29,dow:4}:{y:r.getUTCFullYear(),m:r.getUTCMonth()+1,d:r.getUTCDate(),dow:r.getUTCDay()},ms:n}}function Ge(t,e){return String(t).padStart(e,"0")}function za(t,e,n){const o=t.tokens.reduce((m,g)=>g.t==="date"&&g.s.startsWith(".")?Math.max(m,g.s.length-1):m,0),r=86400*10**o,s=t.tokens.some(m=>m.t==="elapsed"),i=o>0||s?Math.round(e*r)/r:Math.floor(e*r+1e-9)/r,a=Ra(i),l=Math.round(i*864e5);let c=Math.floor(a.ms/36e5);const u=Math.floor(a.ms%36e5/6e4),h=Math.floor(a.ms%6e4/1e3),d=a.ms%1e3;let f="";for(const m of t.tokens)if(m.t==="lit")f+=m.s;else if(m.t==="ampm"){const g=c>=12;f+=m.s.length===5?g?"PM":"AM":g?"P":"A"}else if(m.t==="elapsed"){const g=m.unit==="h"?Math.floor(l/36e5):m.unit==="m"?Math.floor(l/6e4):Math.floor(l/1e3);f+=Ge(g,m.width)}else if(m.t==="date"){const g=t.hasAmPm?(c+11)%12+1:c;switch(m.s){case"y":case"yy":f+=Ge(a.y%100,2);break;case"yyy":case"yyyy":f+=String(a.y);break;case"m":f+=String(a.m);break;case"mm":f+=Ge(a.m,2);break;case"mmm":f+=n.months[a.m-1].slice(0,3);break;case"mmmm":f+=n.months[a.m-1];break;case"mmmmm":f+=n.months[a.m-1][0];break;case"d":f+=String(a.d);break;case"dd":f+=Ge(a.d,2);break;case"ddd":f+=n.days[a.dow].slice(0,3);break;case"dddd":f+=n.days[a.dow];break;case"h":f+=String(g);break;case"hh":f+=Ge(g,2);break;case"mi":f+=String(u);break;case"mmi":f+=Ge(u,2);break;case"s":f+=String(h);break;case"ss":f+=Ge(h,2);break;default:m.s.startsWith(".")?f+=n.decimal+Ge(Math.floor(d/10**(3-(m.s.length-1))),m.s.length-1):f+=m.s}}else m.t==="general"&&(f+=Mr(e,n));return c=0,f}function Na(t,e,n,o){const r=e.filter(a=>a==="0").length;let s=t==="0"&&r===0?"":t;s=s.padStart(r,"0");const i=Math.max(0,e.filter(a=>a==="?").length+r-s.length);return n&&(s=s.replace(/\B(?=(\d{3})+(?!\d))/g,o.group))," ".repeat(e.includes("?")?Math.max(0,i-r):0)+s}function Oa(t,e,n){const o=t.tokens;if(o.some(z=>z.t==="general"))return o.map(z=>z.t==="lit"?z.s:z.t==="general"?Mr(e,n):"").join("");let r=e;const s=o.filter(z=>z.t==="percent").length;r*=100**s;let i=-1;o.forEach((z,P)=>{z.t==="digit"&&(i=P)});const a=o.findIndex(z=>z.t==="point"),l=a>=0?a:i+1,c=new Set;if(a>=0)for(let z=a-1;z>=0&&o[z].t==="comma";z-=1)c.add(z);for(let z=i+1;z<o.length&&o[z].t==="comma";z+=1)c.add(z);r/=1e3**c.size;const u=o.findIndex(z=>z.t==="exp"),h=u>=0?o.slice(0,u):o,d=[],f=[];let m=!1,g=!1;h.forEach((z,P)=>{z.t==="point"?m=!0:z.t==="digit"?(m?f:d).push(z.c):z.t==="comma"&&!m&&!c.has(P)&&P<l&&(g=!0)});let w=0;if(u>=0&&r!==0){const z=d.length>1&&d[0]==="#"?d.length:1;w=Math.floor(Math.log10(Math.abs(r))/z)*z,z===1&&(w=Math.floor(Math.log10(Math.abs(r)))-Math.max(0,d.filter(P=>P==="0").length-1)),r/=10**w}const y=Math.abs(r).toFixed(f.length);let[x,$=""]=y.split(".");if(u>=0&&y.startsWith("10")&&d.length<=1){w+=1;const z=(Math.abs(r)/10).toFixed(f.length).split(".");x=z[0],$=z[1]??""}let A="";for(let z=f.length-1,P=!1;z>=0;z-=1){const F=$[z];if(!P&&F==="0"&&f[z]!=="0"){A=(f[z]==="?"?" ":"")+A;continue}P=!0,A=F+A}const O=Na(x,d,g,n);let D="",I=!1,U=!1,X=!1;for(let z=0;z<o.length;z+=1){const P=o[z];if(P.t==="lit")D+=P.s;else if(P.t==="percent")D+="%";else if(P.t==="text")D+="";else if(P.t==="digit"&&(u<0||z<u))z<(a>=0?a:1/0)&&!I?(D+=O,I=!0):z>a&&a>=0&&!U&&(D+=A,U=!0);else if(P.t==="point")I||(D+=O,I=!0),A.trim()===""&&f.every(F=>F==="#")||(D+=n.decimal);else if(P.t==="exp"&&!X){const F=o.slice(z+1).filter(J=>J.t==="digit").length,K=w<0?"-":P.sign==="+"?"+":"";D+=`E${K}${Ge(Math.abs(w),Math.max(1,F))}`,X=!0}}return D}const ps=new Map;function Tr(t,e=$n){const n=e===$n?t:`${t}\0${e.decimal}${e.group}`,o=ps.get(n);if(o)return o;const r=Aa(t).map(u=>Ta(u,t)),s=r.find(u=>u.isText),i=r.filter(u=>u!==s||r.length===1),a=r.some(u=>u.condition!==void 0),l=u=>{if(a){for(const d of i){const f=d.condition;if(f===void 0)continue;if(f.op==="<"?u<f.value:f.op==="<="?u<=f.value:f.op===">"?u>f.value:f.op===">="?u>=f.value:f.op==="="?u===f.value:u!==f.value)return{section:d,signed:f.value>=0&&u<0}}return{section:i.find(d=>d.condition===void 0)??i[i.length-1],signed:u<0}}return i.length>=3&&u===0?{section:i[2],signed:!1}:i.length>=2&&u<0?{section:i[1],signed:!1}:{section:i[0],signed:u<0}},c=u=>{if(u===null)return{text:""};if(j(u))return{text:u.error};if(typeof u=="boolean")return{text:u?"TRUE":"FALSE"};if(typeof u=="string"){const w=s??(r.length===1&&r[0].isText?r[0]:void 0);return w===void 0?{text:u}:{text:w.tokens.map(y=>y.t==="lit"?y.s:y.t==="text"?u:"").join(""),color:w.color}}const{section:h,signed:d}=l(u);if(h.isText)return{text:Mr(u,e)};const f=Math.abs(u),m=h.isDate?za(h,f,e):Oa(h,f,e),g=/^[^1-9]*$/.test(m);return{text:d&&!g?`-${m}`:m,color:h.color}};return ps.set(n,c),c}function Ii(t){Tr(t)}const Rr=["font","size","bold","italic","underline","strike","color","fill","align","valign","wrap","borders","format","type"],Ia=new Set(Rr),ws=65535;function ys(t){const e={};for(const n of Rr){const o=t[n];o===void 0||o===!1||(e[n]=n==="borders"?_a(o):o)}return JSON.stringify(e)}function _a(t){if(t===void 0)return;const e={};for(const n of["top","right","bottom","left"])t[n]&&(e[n]=t[n]);return e}function zr(t,e="style"){if(typeof t!="object"||t===null||Array.isArray(t))throw new Error(`${e}: a style is an object.`);for(const o of Object.keys(t))if(!Ia.has(o))throw new Error(`${e}: '${o}' is not a style property (${Rr.join(", ")}).`);const n=t;for(const o of["bold","italic","underline","strike","wrap"])if(n[o]!==void 0&&typeof n[o]!="boolean")throw new Error(`${e}.${o}: true or false.`);for(const o of["font","color","fill","format"])if(n[o]!==void 0&&typeof n[o]!="string")throw new Error(`${e}.${o}: a string.`);if(n.type!==void 0&&!(typeof n.type=="string"&&n.type!==""))throw new Error(`${e}.type: the id of a cell type, a non-empty string.`);if(n.format!==void 0)try{Ii(n.format)}catch(o){throw new Error(`${e}.format: ${o.message}`)}if(n.size!==void 0&&!(typeof n.size=="number"&&n.size>0))throw new Error(`${e}.size: a positive number.`);if(n.align!==void 0&&!["left","center","right"].includes(n.align))throw new Error(`${e}.align: left, center or right.`);if(n.valign!==void 0&&!["top","middle","bottom"].includes(n.valign))throw new Error(`${e}.valign: top, middle or bottom.`)}class La{#e=[{}];#t=new Map([[ys({}),0]]);intern(e){const n=ys(e);let o=this.#t.get(n);if(o===void 0){if(this.#e.length>ws)throw new Error(`A workbook holds at most ${ws+1} distinct styles.`);o=this.#e.length,this.#e.push(JSON.parse(n)),this.#t.set(n,o)}return o}get(e){const n=this.#e[e];if(n===void 0)throw new Error(`No style ${e}; the workbook has ${this.#e.length}.`);return n}get size(){return this.#e.length}all(){return this.#e}}function Ye(t){if(!Number.isInteger(t)||t<0)throw new Error(`No column at index ${t}.`);let e="",n=t+1;for(;n>0;){const o=(n-1)%26;e=String.fromCharCode(65+o)+e,n=Math.floor((n-1)/26)}return e}function _i(t){if(!/^[A-Za-z]{1,3}$/.test(t))throw new Error(`'${t}' is not a column (A to XFD).`);let e=0;for(const n of t.toUpperCase())e=e*26+(n.charCodeAt(0)-64);return e-1}function hr(t){return`${Ye(t.col)}${t.row+1}`}const Da=/^\$?([A-Za-z]{1,3})\$?([1-9][0-9]{0,6})$/;function fr(t){const e=Da.exec(t.trim());if(!e)throw new Error(`'${t}' is not a cell reference such as B3.`);return{row:Number(e[2])-1,col:_i(e[1])}}function Li(t){const e=t.trim().split(":");if(e.length>2||e[0]==="")throw new Error(`'${t}' is not a range such as A1:C4.`);const n=fr(e[0]),o=e.length===2?fr(e[1]):n;return $o(n,o)}function Oe(t){const e=hr({row:t.top,col:t.left});return t.top===t.bottom&&t.left===t.right?e:`${e}:${hr({row:t.bottom,col:t.right})}`}function $o(t,e=t){return{top:Math.min(t.row,e.row),left:Math.min(t.col,e.col),bottom:Math.max(t.row,e.row),right:Math.max(t.col,e.col)}}function zt(t,e){return e.row>=t.top&&e.row<=t.bottom&&e.col>=t.left&&e.col<=t.right}function mt(t,e){return t.left<=e.right&&e.left<=t.right&&t.top<=e.bottom&&e.top<=t.bottom}function Nr(t){const e=t.lastIndexOf("!");if(e<0)return{ref:t};let n=t.slice(0,e);if(n.startsWith("'")){if(!n.endsWith("'")||n.length<2)throw new Error(`'${t}' has an unclosed sheet name.`);n=n.slice(1,-1).replace(/''/g,"'")}if(n==="")throw new Error(`'${t}' names an empty sheet.`);return{sheet:n,ref:t.slice(e+1)}}const Di={argumentSeparator:",",decimal:".",arrayColumn:","},Ua=["#DIV/0!","#REF!","#NAME?","#VALUE!","#N/A","#NUM!","#NULL!","#CYCLE!","#BUSY!","#SPILL!","#ERROR!","#GETTING_DATA"],Fa=["<>","<=",">=","+","-","*","/","^","&","=","<",">","%",":"],Pa=/\$?[A-Za-z]{1,3}\$?[0-9]{1,7}/y,ja=/\$?[A-Za-z]{1,3}(?=\s*:)/y,Ba=/[0-9]*(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?/y,Ha=/[0-9]*(?:,[0-9]*)?(?:[eE][+-]?[0-9]+)?/y,Ya=/\$?[0-9]{1,7}(?=\s*:)/y,Xa=/\$?[0-9]{1,7}(?![0-9.eE%A-Za-z(])/y,Wa=/\$[0-9]{1,7}/y,Va=/[A-Za-z_\\][A-Za-z0-9_.\\]*/y,bs=/\$?[A-Za-z]{1,3}(?![A-Za-z0-9_(])/y;function Ve(t,e,n){t.lastIndex=n;const o=t.exec(e);return o===null?-1:o[0].length}const Fo=t=>t===" "||t===" "||t===`
1
+ import{mM as pe,mN as sa,bE as nt,bG as oe,ea as Ti,mO as ia,j as C,r as k,e8 as Cr,mP as $r,gO as la,v as hs,_ as Ri,mQ as aa,mR as ca,mS as ua,bl as Be,mT as ha,mU as fs,dp as fa,I as ds,X as da,e9 as Uo,h2 as ma}from"../datalayer-app-main.js";const zi={rows:new Int32Array(0),cols:new Int32Array(0),values:[],formulas:[],styles:new Uint16Array(0)};function Kt(t,e){const n=[],o=[],r=[],s=[],i=[];for(const[a,l,c]of t.cells.entries(e))n.push(a),o.push(l),r.push(c.value),s.push(c.formula),i.push(c.style);return{rows:Int32Array.from(n),cols:Int32Array.from(o),values:r,formulas:s,styles:Uint16Array.from(i)}}function Rt(t){return{rows:Int32Array.from(t,e=>e[0]),cols:Int32Array.from(t,e=>e[1]),values:t.map(e=>e[2].value),formulas:t.map(e=>e[2].formula),styles:Uint16Array.from(t,e=>e[2].style)}}function Mn(t){const e=[];for(let n=0;n<t.rows.length;n+=1){const o=t.formulas[n];e.push([t.rows[n],t.cols[n],o===void 0?{value:t.values[n],style:t.styles[n]}:{value:t.values[n],formula:o,style:t.styles[n]}])}return e}function ms(t){let e=64+t.rows.length*26;for(const n of t.values)typeof n=="string"&&(e+=n.length*2);for(const n of t.formulas)n!==void 0&&(e+=n.length*2);return e}function fo(t){return 64+t.ids.byteLength+(t.sizes?.byteLength??0)+(t.hidden?.byteLength??0)}const Co=(t,e)=>e==="rows"?t.rows:t.cols,ur=t=>({ids:Int32Array.from(t),sizes:null,hidden:null}),ga={op:"cells",apply(t,e){const n=t.sheet(e.sheet);for(const[o,r]of[...n.cells.entries(e.zone)])n.cells.set(o,r,null);for(const[o,r,s]of Mn(e.after)){if(o<e.zone.top||o>e.zone.bottom||r<e.zone.left||r>e.zone.right)throw new Error(`A cells patch writes ${o},${r} outside its zone.`);n.cells.set(o,r,s)}},invert:t=>({...t,before:t.after,after:t.before}),example:()=>({op:"cells",sheet:"s1",zone:{top:0,left:0,bottom:1,right:1},before:zi,after:Rt([[1,1,{value:42,style:0}]])}),bytes:t=>ms(t.before)+ms(t.after)};function Ni(t,e,n,o){e==="rows"?t.cells.shiftRows(n,o,t.rows.count):t.cells.shiftCols(n,o,t.cols.count)}const pa={op:"axis-insert",apply(t,e){const n=t.sheet(e.sheet);Co(n,e.axis).insert(e.at,e.n,e.inserted),Ni(n,e.axis,e.at,e.n)},invert:t=>({op:"axis-delete",sheet:t.sheet,axis:t.axis,at:t.at,n:t.n,removed:t.inserted,tail:t.dropped}),example:t=>{const e=t.sheet("s1").rows.count;return{op:"axis-insert",sheet:"s1",axis:"rows",at:2,n:2,inserted:ur([1<<30,(1<<30)+1]),dropped:ur([e-2,e-1])}},bytes:t=>fo(t.inserted)+(t.dropped?fo(t.dropped):0)},wa={op:"axis-delete",apply(t,e){const n=t.sheet(e.sheet);Co(n,e.axis).delete(e.at,e.n,e.tail),Ni(n,e.axis,e.at,-e.n)},invert:t=>({op:"axis-insert",sheet:t.sheet,axis:t.axis,at:t.at,n:t.n,inserted:t.removed,dropped:t.tail}),example:t=>({op:"axis-delete",sheet:"s1",axis:"rows",at:1,n:1,removed:ur([1])}),bytes:t=>fo(t.removed)+(t.tail?fo(t.tail):0)},ya={op:"axis-move",apply(t,e){Co(t.sheet(e.sheet),e.axis).move(e.at,e.n,e.to)},invert:t=>t.to<t.at?{...t,at:t.to,to:t.at+t.n}:{...t,at:t.to-t.n,to:t.at},example:()=>({op:"axis-move",sheet:"s1",axis:"cols",at:1,n:2,to:6})},ba={op:"axis-sizes",apply(t,e){Co(t.sheet(e.sheet),e.axis).setSegmentSizes(e.at,e.after.sizes,e.after.hidden,e.n)},invert:t=>({...t,before:t.after,after:t.before}),example:()=>({op:"axis-sizes",sheet:"s1",axis:"cols",at:3,n:2,before:{sizes:null,hidden:null},after:{sizes:Float64Array.of(40,50),hidden:Uint8Array.of(0,1)}})},xa={op:"merges",apply(t,e){t.sheet(e.sheet).merges=e.after.map(n=>({...n}))},invert:t=>({...t,before:t.after,after:t.before}),example:()=>({op:"merges",sheet:"s1",before:[],after:[{top:0,left:0,bottom:1,right:2}]})},va={op:"sheet-add",apply(t,e){if(t.hasSheet(e.sheet.id))throw new Error(`Sheet '${e.sheet.id}' is in the workbook already.`);if(e.index<0||e.index>t.sheets.length)throw new Error(`No sheet position ${e.index}.`);t.sheets.splice(e.index,0,e.sheet)},invert:t=>({op:"sheet-delete",index:t.index,sheet:t.sheet}),example:t=>({op:"sheet-add",index:1,sheet:t.createSheet("Example","example")})},Ea={op:"sheet-delete",apply(t,e){if(t.sheets[e.index]!==e.sheet)throw new Error(`Sheet '${e.sheet.id}' is not at position ${e.index}.`);t.sheets.splice(e.index,1)},invert:t=>({op:"sheet-add",index:t.index,sheet:t.sheet}),example:t=>({op:"sheet-delete",index:0,sheet:t.sheet("s1")})},ka={op:"sheet-rename",apply(t,e){t.sheet(e.sheet).name=e.after},invert:t=>({...t,before:t.after,after:t.before}),example:()=>({op:"sheet-rename",sheet:"s1",before:"Sheet1",after:"Budget"})},Sa={op:"sheet-move",apply(t,e){const[n]=t.sheets.splice(e.from,1);if(n===void 0)throw new Error(`No sheet at position ${e.from}.`);t.sheets.splice(e.to,0,n)},invert:t=>({...t,from:t.to,to:t.from}),example:()=>({op:"sheet-move",from:0,to:0})},Ca={op:"frozen",apply(t,e){t.sheet(e.sheet).frozen={...e.after}},invert:t=>({...t,before:t.after,after:t.before}),example:()=>({op:"frozen",sheet:"s1",before:{rows:0,cols:0},after:{rows:1,cols:2}})},$a=[ga,pa,wa,ya,ba,xa,va,Ea,ka,Sa,Ca],Oi=["#DIV/0!","#REF!","#NAME?","#VALUE!","#N/A","#NUM!","#NULL!","#CYCLE!","#BUSY!","#SPILL!","#ERROR!"],Ar=new Set(Oi);function Je(t,e){if(!Ar.has(t))throw new Error(`'${t}' is not a cell error; there are ${Oi.join(" ")}.`);return e===void 0?{error:t}:{error:t,message:e}}function j(t){return typeof t=="object"&&t!==null&&Ar.has(t.error)}function Cn(t){return Ar.has(t)}const $n={decimal:".",group:",",months:["January","February","March","April","May","June","July","August","September","October","November","December"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]};class At extends Error{}const gs={black:"#000000",blue:"#0000ff",cyan:"#00ffff",green:"#00ff00",magenta:"#ff00ff",red:"#ff0000",white:"#ffffff",yellow:"#ffff00"};function Aa(t){const e=[];let n="";for(let o=0;o<t.length;o+=1){const r=t[o];if(r==='"'){const s=t.indexOf('"',o+1);if(s<0)throw new At(`'${t}' opens a quote it never closes.`);n+=t.slice(o,s+1),o=s}else if(r==="["){const s=t.indexOf("]",o+1);if(s<0)throw new At(`'${t}' opens a bracket it never closes.`);n+=t.slice(o,s+1),o=s}else if(r==="\\"||r==="_"||r==="*"){if(o+1>=t.length)throw new At(`'${t}' ends with ${r} and nothing after it.`);n+=t.slice(o,o+2),o+=1}else r===";"?(e.push(n),n=""):n+=r}if(e.push(n),e.length>4)throw new At(`'${t}' has ${e.length} sections; a format has at most four.`);return e}const Ma=/[ymdhsYMDHS]/;function Ta(t,e){const n=[],o={tokens:n,isDate:!1,isText:!1,hasAmPm:!1};let r=0;const s=l=>{const c=n[n.length-1];c?.t==="lit"?c.s+=l:n.push({t:"lit",s:l})};for(;r<t.length;){const l=t[r],c=t.slice(r);if(l==='"'){const u=t.indexOf('"',r+1);s(t.slice(r+1,u)),r=u+1}else if(l==="\\")s(t[r+1]),r+=2;else if(l==="_")s(" "),r+=2;else if(l==="*")r+=2;else if(l==="["){const u=t.indexOf("]",r),h=t.slice(r+1,u),d=h.toLowerCase();if(d in gs)o.color=gs[d];else if(/^color\d+$/.test(d))o.color=void 0;else if(/^(<=|>=|<>|<|>|=)-?\d+(\.\d+)?$/.test(h)){const f=/^(<=|>=|<>|<|>|=)(-?\d+(?:\.\d+)?)$/.exec(h);o.condition={op:f[1],value:Number(f[2])}}else if(/^h+$/i.test(h)||/^m+$/i.test(h)||/^s+$/i.test(h))n.push({t:"elapsed",unit:h[0].toLowerCase(),width:h.length}),o.isDate=!0;else if(h.startsWith("$"))s(h.slice(1).split("-")[0]);else throw new At(`'${e}': [${h}] is not a colour, a condition or an elapsed time.`);r=u+1}else if(/^general/i.test(c))n.push({t:"general"}),r+=7;else if(/^(am\/pm|a\/p)/i.test(c)){const u=/^am\/pm/i.test(c)?t.slice(r,r+5):t.slice(r,r+3);n.push({t:"ampm",s:u}),o.hasAmPm=!0,o.isDate=!0,r+=u.length}else if(l==="0"||l==="#"||l==="?")n.push({t:"digit",c:l}),r+=1;else if(l==="."){const u=n[n.length-1];if(u?.t==="date"&&u.s.toLowerCase().startsWith("s")){let h=r+1;for(;t[h]==="0";)h+=1;n.push({t:"date",s:`.${"0".repeat(h-r-1)}`}),r=h}else n.push({t:"point"}),r+=1}else if(l===",")n.push({t:"comma"}),r+=1;else if(l==="%")n.push({t:"percent"}),r+=1;else if((l==="E"||l==="e")&&(t[r+1]==="+"||t[r+1]==="-"))n.push({t:"exp",sign:t[r+1]}),r+=2;else if(l==="@")n.push({t:"text"}),o.isText=!0,r+=1;else if(Ma.test(l)){let u=r+1;for(;u<t.length&&t[u].toLowerCase()===l.toLowerCase();)u+=1;n.push({t:"date",s:t.slice(r,u).toLowerCase()}),o.isDate=!0,r=u}else{if(l==="/"&&n.some(u=>u.t==="digit")&&!o.isDate)throw new At(`'${e}': fractions (# ?/?) are not supported yet.`);s(l),r+=1}}if(o.isDate)for(let l=0;l<n.length;l+=1){const c=n[l];c.t==="comma"?n[l]={t:"lit",s:","}:c.t==="point"?n[l]={t:"lit",s:"."}:c.t==="percent"&&(n[l]={t:"lit",s:"%"})}const i=n.filter(l=>l.t==="date"||l.t==="elapsed"),a=l=>l===void 0?"":l.t==="date"?l.s[0]:l.unit;return i.forEach((l,c)=>{l.t!=="date"||l.s[0]!=="m"||l.s.length>2||(a(i[c-1])==="h"||a(i[c+1])==="s")&&(l.s=l.s==="m"?"mi":"mmi")}),o}function Mr(t,e){if(t===0)return"0";const n=Math.abs(t);let o;if(n>=1e11||n<1e-9)o=t.toExponential(5).replace(/\.?0+e/,"e").replace("e+","E+").replace("e-","E-"),o=o.replace(/E([+-])(\d)$/,"E$10$2");else if(Number.isInteger(t))o=String(t);else{const r=String(Math.trunc(n)).length+(t<0?1:0),s=Math.max(0,Math.min(10,11-r-1));o=String(Number(t.toFixed(s)))}return o.replace(".",e.decimal)}function Ra(t){const e=Math.floor(t),n=Math.round((t-e)*864e5),o=e<60?e+1:e,r=new Date(Date.UTC(1899,11,30)+o*864e5-(e<60?864e5:0));return{...e===60?{y:1900,m:2,d:29,dow:4}:{y:r.getUTCFullYear(),m:r.getUTCMonth()+1,d:r.getUTCDate(),dow:r.getUTCDay()},ms:n}}function Ge(t,e){return String(t).padStart(e,"0")}function za(t,e,n){const o=t.tokens.reduce((m,g)=>g.t==="date"&&g.s.startsWith(".")?Math.max(m,g.s.length-1):m,0),r=86400*10**o,s=t.tokens.some(m=>m.t==="elapsed"),i=o>0||s?Math.round(e*r)/r:Math.floor(e*r+1e-9)/r,a=Ra(i),l=Math.round(i*864e5);let c=Math.floor(a.ms/36e5);const u=Math.floor(a.ms%36e5/6e4),h=Math.floor(a.ms%6e4/1e3),d=a.ms%1e3;let f="";for(const m of t.tokens)if(m.t==="lit")f+=m.s;else if(m.t==="ampm"){const g=c>=12;f+=m.s.length===5?g?"PM":"AM":g?"P":"A"}else if(m.t==="elapsed"){const g=m.unit==="h"?Math.floor(l/36e5):m.unit==="m"?Math.floor(l/6e4):Math.floor(l/1e3);f+=Ge(g,m.width)}else if(m.t==="date"){const g=t.hasAmPm?(c+11)%12+1:c;switch(m.s){case"y":case"yy":f+=Ge(a.y%100,2);break;case"yyy":case"yyyy":f+=String(a.y);break;case"m":f+=String(a.m);break;case"mm":f+=Ge(a.m,2);break;case"mmm":f+=n.months[a.m-1].slice(0,3);break;case"mmmm":f+=n.months[a.m-1];break;case"mmmmm":f+=n.months[a.m-1][0];break;case"d":f+=String(a.d);break;case"dd":f+=Ge(a.d,2);break;case"ddd":f+=n.days[a.dow].slice(0,3);break;case"dddd":f+=n.days[a.dow];break;case"h":f+=String(g);break;case"hh":f+=Ge(g,2);break;case"mi":f+=String(u);break;case"mmi":f+=Ge(u,2);break;case"s":f+=String(h);break;case"ss":f+=Ge(h,2);break;default:m.s.startsWith(".")?f+=n.decimal+Ge(Math.floor(d/10**(3-(m.s.length-1))),m.s.length-1):f+=m.s}}else m.t==="general"&&(f+=Mr(e,n));return c=0,f}function Na(t,e,n,o){const r=e.filter(a=>a==="0").length;let s=t==="0"&&r===0?"":t;s=s.padStart(r,"0");const i=Math.max(0,e.filter(a=>a==="?").length+r-s.length);return n&&(s=s.replace(/\B(?=(\d{3})+(?!\d))/g,o.group))," ".repeat(e.includes("?")?Math.max(0,i-r):0)+s}function Oa(t,e,n){const o=t.tokens;if(o.some(z=>z.t==="general"))return o.map(z=>z.t==="lit"?z.s:z.t==="general"?Mr(e,n):"").join("");let r=e;const s=o.filter(z=>z.t==="percent").length;r*=100**s;let i=-1;o.forEach((z,P)=>{z.t==="digit"&&(i=P)});const a=o.findIndex(z=>z.t==="point"),l=a>=0?a:i+1,c=new Set;if(a>=0)for(let z=a-1;z>=0&&o[z].t==="comma";z-=1)c.add(z);for(let z=i+1;z<o.length&&o[z].t==="comma";z+=1)c.add(z);r/=1e3**c.size;const u=o.findIndex(z=>z.t==="exp"),h=u>=0?o.slice(0,u):o,d=[],f=[];let m=!1,g=!1;h.forEach((z,P)=>{z.t==="point"?m=!0:z.t==="digit"?(m?f:d).push(z.c):z.t==="comma"&&!m&&!c.has(P)&&P<l&&(g=!0)});let w=0;if(u>=0&&r!==0){const z=d.length>1&&d[0]==="#"?d.length:1;w=Math.floor(Math.log10(Math.abs(r))/z)*z,z===1&&(w=Math.floor(Math.log10(Math.abs(r)))-Math.max(0,d.filter(P=>P==="0").length-1)),r/=10**w}const y=Math.abs(r).toFixed(f.length);let[x,$=""]=y.split(".");if(u>=0&&y.startsWith("10")&&d.length<=1){w+=1;const z=(Math.abs(r)/10).toFixed(f.length).split(".");x=z[0],$=z[1]??""}let A="";for(let z=f.length-1,P=!1;z>=0;z-=1){const F=$[z];if(!P&&F==="0"&&f[z]!=="0"){A=(f[z]==="?"?" ":"")+A;continue}P=!0,A=F+A}const O=Na(x,d,g,n);let D="",I=!1,U=!1,X=!1;for(let z=0;z<o.length;z+=1){const P=o[z];if(P.t==="lit")D+=P.s;else if(P.t==="percent")D+="%";else if(P.t==="text")D+="";else if(P.t==="digit"&&(u<0||z<u))z<(a>=0?a:1/0)&&!I?(D+=O,I=!0):z>a&&a>=0&&!U&&(D+=A,U=!0);else if(P.t==="point")I||(D+=O,I=!0),A.trim()===""&&f.every(F=>F==="#")||(D+=n.decimal);else if(P.t==="exp"&&!X){const F=o.slice(z+1).filter(J=>J.t==="digit").length,K=w<0?"-":P.sign==="+"?"+":"";D+=`E${K}${Ge(Math.abs(w),Math.max(1,F))}`,X=!0}}return D}const ps=new Map;function Tr(t,e=$n){const n=e===$n?t:`${t}\0${e.decimal}${e.group}`,o=ps.get(n);if(o)return o;const r=Aa(t).map(u=>Ta(u,t)),s=r.find(u=>u.isText),i=r.filter(u=>u!==s||r.length===1),a=r.some(u=>u.condition!==void 0),l=u=>{if(a){for(const d of i){const f=d.condition;if(f===void 0)continue;if(f.op==="<"?u<f.value:f.op==="<="?u<=f.value:f.op===">"?u>f.value:f.op===">="?u>=f.value:f.op==="="?u===f.value:u!==f.value)return{section:d,signed:f.value>=0&&u<0}}return{section:i.find(d=>d.condition===void 0)??i[i.length-1],signed:u<0}}return i.length>=3&&u===0?{section:i[2],signed:!1}:i.length>=2&&u<0?{section:i[1],signed:!1}:{section:i[0],signed:u<0}},c=u=>{if(u===null)return{text:""};if(j(u))return{text:u.error};if(typeof u=="boolean")return{text:u?"TRUE":"FALSE"};if(typeof u=="string"){const w=s??(r.length===1&&r[0].isText?r[0]:void 0);return w===void 0?{text:u}:{text:w.tokens.map(y=>y.t==="lit"?y.s:y.t==="text"?u:"").join(""),color:w.color}}const{section:h,signed:d}=l(u);if(h.isText)return{text:Mr(u,e)};const f=Math.abs(u),m=h.isDate?za(h,f,e):Oa(h,f,e),g=/^[^1-9]*$/.test(m);return{text:d&&!g?`-${m}`:m,color:h.color}};return ps.set(n,c),c}function Ii(t){Tr(t)}const Rr=["font","size","bold","italic","underline","strike","color","fill","align","valign","wrap","borders","format","type"],Ia=new Set(Rr),ws=65535;function ys(t){const e={};for(const n of Rr){const o=t[n];o===void 0||o===!1||(e[n]=n==="borders"?_a(o):o)}return JSON.stringify(e)}function _a(t){if(t===void 0)return;const e={};for(const n of["top","right","bottom","left"])t[n]&&(e[n]=t[n]);return e}function zr(t,e="style"){if(typeof t!="object"||t===null||Array.isArray(t))throw new Error(`${e}: a style is an object.`);for(const o of Object.keys(t))if(!Ia.has(o))throw new Error(`${e}: '${o}' is not a style property (${Rr.join(", ")}).`);const n=t;for(const o of["bold","italic","underline","strike","wrap"])if(n[o]!==void 0&&typeof n[o]!="boolean")throw new Error(`${e}.${o}: true or false.`);for(const o of["font","color","fill","format"])if(n[o]!==void 0&&typeof n[o]!="string")throw new Error(`${e}.${o}: a string.`);if(n.type!==void 0&&!(typeof n.type=="string"&&n.type!==""))throw new Error(`${e}.type: the id of a cell type, a non-empty string.`);if(n.format!==void 0)try{Ii(n.format)}catch(o){throw new Error(`${e}.format: ${o.message}`)}if(n.size!==void 0&&!(typeof n.size=="number"&&n.size>0))throw new Error(`${e}.size: a positive number.`);if(n.align!==void 0&&!["left","center","right"].includes(n.align))throw new Error(`${e}.align: left, center or right.`);if(n.valign!==void 0&&!["top","middle","bottom"].includes(n.valign))throw new Error(`${e}.valign: top, middle or bottom.`)}class La{#e=[{}];#t=new Map([[ys({}),0]]);intern(e){const n=ys(e);let o=this.#t.get(n);if(o===void 0){if(this.#e.length>ws)throw new Error(`A workbook holds at most ${ws+1} distinct styles.`);o=this.#e.length,this.#e.push(JSON.parse(n)),this.#t.set(n,o)}return o}get(e){const n=this.#e[e];if(n===void 0)throw new Error(`No style ${e}; the workbook has ${this.#e.length}.`);return n}get size(){return this.#e.length}all(){return this.#e}}function Ye(t){if(!Number.isInteger(t)||t<0)throw new Error(`No column at index ${t}.`);let e="",n=t+1;for(;n>0;){const o=(n-1)%26;e=String.fromCharCode(65+o)+e,n=Math.floor((n-1)/26)}return e}function _i(t){if(!/^[A-Za-z]{1,3}$/.test(t))throw new Error(`'${t}' is not a column (A to XFD).`);let e=0;for(const n of t.toUpperCase())e=e*26+(n.charCodeAt(0)-64);return e-1}function hr(t){return`${Ye(t.col)}${t.row+1}`}const Da=/^\$?([A-Za-z]{1,3})\$?([1-9][0-9]{0,6})$/;function fr(t){const e=Da.exec(t.trim());if(!e)throw new Error(`'${t}' is not a cell reference such as B3.`);return{row:Number(e[2])-1,col:_i(e[1])}}function Li(t){const e=t.trim().split(":");if(e.length>2||e[0]==="")throw new Error(`'${t}' is not a range such as A1:C4.`);const n=fr(e[0]),o=e.length===2?fr(e[1]):n;return $o(n,o)}function Oe(t){const e=hr({row:t.top,col:t.left});return t.top===t.bottom&&t.left===t.right?e:`${e}:${hr({row:t.bottom,col:t.right})}`}function $o(t,e=t){return{top:Math.min(t.row,e.row),left:Math.min(t.col,e.col),bottom:Math.max(t.row,e.row),right:Math.max(t.col,e.col)}}function zt(t,e){return e.row>=t.top&&e.row<=t.bottom&&e.col>=t.left&&e.col<=t.right}function mt(t,e){return t.left<=e.right&&e.left<=t.right&&t.top<=e.bottom&&e.top<=t.bottom}function Nr(t){const e=t.lastIndexOf("!");if(e<0)return{ref:t};let n=t.slice(0,e);if(n.startsWith("'")){if(!n.endsWith("'")||n.length<2)throw new Error(`'${t}' has an unclosed sheet name.`);n=n.slice(1,-1).replace(/''/g,"'")}if(n==="")throw new Error(`'${t}' names an empty sheet.`);return{sheet:n,ref:t.slice(e+1)}}const Di={argumentSeparator:",",decimal:".",arrayColumn:","},Ua=["#DIV/0!","#REF!","#NAME?","#VALUE!","#N/A","#NUM!","#NULL!","#CYCLE!","#BUSY!","#SPILL!","#ERROR!","#GETTING_DATA"],Fa=["<>","<=",">=","+","-","*","/","^","&","=","<",">","%",":"],Pa=/\$?[A-Za-z]{1,3}\$?[0-9]{1,7}/y,ja=/\$?[A-Za-z]{1,3}(?=\s*:)/y,Ba=/[0-9]*(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?/y,Ha=/[0-9]*(?:,[0-9]*)?(?:[eE][+-]?[0-9]+)?/y,Ya=/\$?[0-9]{1,7}(?=\s*:)/y,Xa=/\$?[0-9]{1,7}(?![0-9.eE%A-Za-z(])/y,Wa=/\$[0-9]{1,7}/y,Va=/[A-Za-z_\\][A-Za-z0-9_.\\]*/y,bs=/\$?[A-Za-z]{1,3}(?![A-Za-z0-9_(])/y;function Ve(t,e,n){t.lastIndex=n;const o=t.exec(e);return o===null?-1:o[0].length}const Fo=t=>t===" "||t===" "||t===`
2
2
  `||t==="\r"||t!==void 0&&/\s/.test(t),Po=t=>t!==void 0&&t>="0"&&t<="9",Ka=t=>t>="A"&&t<="Z"||t>="a"&&t<="z"||t==="_"||t==="\\";function Ui(t,e=Di){const n=[];let o=0;const r=(i,a)=>{n.push({kind:i,text:t.slice(o,a),start:o,end:a}),o=a},s=()=>{for(let i=n.length-1;i>=0;i-=1)if(n[i].kind!=="whitespace")return n[i].kind==="operator"&&n[i].text===":";return!1};for(;o<t.length;){const i=t[o];if(Fo(i)){let a=o+1;for(;a<t.length&&Fo(t[a]);)a+=1;r("whitespace",a)}else if(i==='"'){let a=o+1;for(;!(a>=t.length);)if(t[a]==='"')if(t[a+1]==='"')a+=2;else{a+=1;break}else a+=1;r("string",a)}else if(i==="'"){let a=o+1;for(;!(a>=t.length);)if(t[a]==="'")if(t[a+1]==="'")a+=2;else{a+=1;break}else a+=1;t[a]==="!"?r("sheet",a+1):r("unknown",a)}else if(i==="#"){const a=Ua.find(l=>t.slice(o,o+l.length).toUpperCase()===l);a?r("error",o+a.length):r("unknown",o+1)}else if(i==="(")r("lparen",o+1);else if(i===")")r("rparen",o+1);else if(i==="{")r("lbrace",o+1);else if(i==="}")r("rbrace",o+1);else if(i===e.argumentSeparator)r("separator",o+1);else if(i===";"||e.arrayColumn!==e.argumentSeparator&&i===e.arrayColumn)r("arraySeparator",o+1);else if(Po(i)||i===e.decimal&&Po(t[o+1])){const a=Ve(Ya,t,o);if(a>=0){r("ref",o+a);continue}if(s()){const l=Ve(Xa,t,o);if(l>=0){r("ref",o+l);continue}}r("number",o+Ve(e.decimal==="."?Ba:Ha,t,o))}else if(i==="$"||Ka(i)){const a=Ve(Pa,t,o),l=Math.max(0,Ve(Va,t,o)),c=Ve(ja,t,o);if(l>0&&t[o+l]==="!")r("sheet",o+l+1);else if(a>=0&&a>=l&&t[o+a]!=="(")r("ref",o+a);else if(i==="$"&&Po(t[o+1]))r("ref",o+Ve(Wa,t,o));else if(c>=0&&(l===0||c>=l))r("ref",o+c);else if(s()&&Ve(bs,t,o)>=0)r("ref",o+Ve(bs,t,o));else if(l>0){const u=t.slice(o,o+l).toUpperCase();let h=o+l;for(;Fo(t[h]);)h+=1;t[h]==="("?r("function",o+l):r(u==="TRUE"||u==="FALSE"?"bool":"name",o+l)}else r("unknown",o+1)}else{const a=Fa.find(l=>t.startsWith(l,o));a?r("operator",o+a.length):r("unknown",o+1)}}return n}class te extends Error{start;end;constructor(e,n,o){super(e),this.start=n,this.end=o}}const Ga={"=":10,"<>":10,"<":10,"<=":10,">":10,">=":10,"&":20,"+":30,"-":30,"*":40,"/":40,"^":50},Za=60,Ja=70,xs=80,vs=90,Es=1048576,qa=16384;function ks(t,e,n){const o=/^(\$?)([A-Za-z]{1,3})?(\$?)([0-9]{1,7})?$/.exec(t);if(!o||o[2]===void 0&&o[4]===void 0)throw new te(`'${t}' is not a reference.`,e,n);const r={rowAbs:!1,colAbs:!1};if(o[2]!==void 0){if(r.col=_i(o[2]),r.colAbs=o[1]==="$",r.col>=qa)throw new te(`'${t}' is past the last column, XFD.`,e,n);o[4]!==void 0&&(r.rowAbs=o[3]==="$",r.row=Number(o[4])-1)}else r.rowAbs=o[1]==="$"||o[3]==="$",r.row=Number(o[4])-1;if(r.row!==void 0&&(r.row<0||r.row>=Es))throw new te(`'${t}' is outside rows 1 to ${Es}.`,e,n);return r}function Qa(t){const e=t.slice(0,-1);return e.startsWith("'")?e.slice(1,-1).replace(/''/g,"'"):e}class ec{#e;#t;#r;#o=0;constructor(e,n,o){this.#t=e,this.#e=n,this.#r=o}parse(){if(this.#n(),this.#o>=this.#e.length)throw new te("The formula is empty.",0,this.#t.length);const e=this.#l(0);this.#n();const n=this.#e[this.#o];if(n!==void 0)throw new te(n.kind==="rparen"?"A closing parenthesis has no opening one.":`Unexpected '${n.text}'.`,n.start,n.end);return e}#s(){return this.#n(),this.#e[this.#o]}#i(){let e=this.#o;for(;this.#e[e]?.kind==="whitespace";)e+=1;return{token:this.#e[e],at:e}}#n(){for(;this.#e[this.#o]?.kind==="whitespace";)this.#o+=1}#d(){if(this.#e[this.#o]?.kind!=="whitespace")return!1;const n=this.#e[this.#o+1];return n!==void 0&&(n.kind==="ref"||n.kind==="sheet"||n.kind==="name"||n.kind==="lparen"||n.kind==="function")}#l(e){let n=this.#h();for(;;){if(this.#d()&&xs>e&&this.#f(n)){this.#o+=1;const a=this.#l(xs);n={type:"binary",op:" ",left:n,right:a};continue}const{token:o,at:r}=this.#i();if(o===void 0||o.kind!=="operator")break;if(o.text==="%"){if(Ja<=e)break;this.#o=r+1,n={type:"percent",arg:n};continue}if(o.text===":"){if(vs<=e)break;this.#o=r+1;const a=this.#l(vs);n=this.#m(n,a,o);continue}const s=Ga[o.text];if(s===void 0||s<=e)break;this.#o=r+1;const i=this.#l(s);n={type:"binary",op:o.text,left:n,right:i}}return n}#f(e){return e.type==="cell"||e.type==="range"||e.type==="name"||e.type==="union"||e.type==="binary"&&e.op===" "||e.type==="call"}#m(e,n,o){const r=a=>a.type==="cell"?{sheet:a.sheet,part:a.ref}:void 0,s=r(e),i=r(n);if(s&&i){if(i.sheet!==void 0&&i.sheet!==s.sheet)throw new te("A range lies on one sheet.",o.start,o.end);const a=l=>l.row===void 0?"cols":l.col===void 0?"rows":"cells";if(a(s.part)!==a(i.part))throw new te("Both ends of a range are cells, columns or rows alike.",o.start,o.end);return{type:"range",sheet:s.sheet,from:s.part,to:i.part}}if(this.#f(e)&&this.#f(n))return{type:"call",name:":",args:[e,n]};throw new te("':' joins two references.",o.start,o.end)}#h(){const e=this.#s();if(e===void 0)throw new te("The formula ends where a value was expected.",this.#t.length,this.#t.length);switch(this.#o+=1,e.kind){case"number":{const n=Number(e.text.replace(this.#r.decimal,"."));if(!Number.isFinite(n))throw new te(`'${e.text}' is not a number.`,e.start,e.end);return{type:"number",value:n}}case"string":if(!/^"(?:[^"]|"")*"$/.test(e.text))throw new te("A text opens a quote it never closes.",e.start,this.#t.length);return{type:"string",value:e.text.slice(1,-1).replace(/""/g,'"')};case"bool":return{type:"bool",value:e.text.toUpperCase()==="TRUE"};case"error":{const n=e.text.toUpperCase();if(!Cn(n))throw new te(`'${e.text}' is not an error value.`,e.start,e.end);return{type:"error",code:n}}case"sheet":{const n=this.#e[this.#o];if(n?.kind!=="ref")throw new te(`A reference follows ${e.text}.`,e.start,e.end);return this.#o+=1,{type:"cell",sheet:Qa(e.text),ref:ks(n.text,n.start,n.end)}}case"ref":return{type:"cell",ref:ks(e.text,e.start,e.end)};case"name":return{type:"name",name:e.text};case"function":return this.#c(e);case"operator":if(e.text==="-"||e.text==="+"){const n=this.#l(Za);return{type:"unary",op:e.text,arg:n}}throw new te(`'${e.text}' needs a value before it.`,e.start,e.end);case"lparen":{const n=this.#l(0),o=[n];for(;this.#s()?.kind==="separator";)this.#o+=1,o.push(this.#l(0));const r=this.#s();if(r?.kind!=="rparen")throw new te("A parenthesis is never closed.",e.start,r?.start??this.#t.length);if(this.#o+=1,o.length===1)return n;if(!o.every(s=>this.#f(s)))throw new te("A union joins references only.",e.start,r.end);return{type:"union",items:o}}case"lbrace":return this.#u(e);case"rparen":throw new te("A closing parenthesis has no opening one.",e.start,e.end);default:throw new te(`Unexpected '${e.text}'.`,e.start,e.end)}}#c(e){if(this.#s()?.kind!=="lparen")throw new te(`${e.text} is called with ( ).`,e.start,e.end);this.#o+=1;const o=[],r=()=>{const i=this.#s();return i?.kind==="rparen"||i?.kind==="separator"};if(this.#s()?.kind!=="rparen")for(;;){if(o.push(r()?{type:"empty"}:this.#l(0)),this.#s()?.kind==="separator"){this.#o+=1,this.#s()?.kind==="rparen"&&o.push({type:"empty"});continue}break}const s=this.#s();if(s?.kind!=="rparen")throw new te(`${e.text}( is never closed.`,e.start,s?.start??this.#t.length);return this.#o+=1,{type:"call",name:e.text.toUpperCase(),args:o}}#u(e){const n=[[]];for(;;){const r=this.#s();if(r===void 0)throw new te("An array is never closed.",e.start,this.#t.length);if(r.kind==="rbrace"){this.#o+=1;break}if(r.kind==="separator"&&this.#r.argumentSeparator!==";"||r.kind==="arraySeparator"&&r.text===this.#r.arrayColumn){this.#o+=1;continue}if(r.kind==="arraySeparator"||r.kind==="separator"){this.#o+=1,n.push([]);continue}const s=this.#h();if(!(s.type==="number"||s.type==="string"||s.type==="bool"||s.type==="error"||s.type==="unary"&&s.arg.type==="number"))throw new te("An array holds constants only.",r.start,r.end);n[n.length-1].push(s)}const o=n[0].length;if(o===0||n.some(r=>r.length!==o))throw new te("Every row of an array has the same number of values.",e.start,e.end);return{type:"array",rows:n}}}function Nt(t,e=Di){const n=Ui(t,e),o=n.find(r=>r.kind==="unknown");if(o)throw new te(`'${o.text}' is not part of a formula.`,o.start,o.end);return{ast:new ec(t,n,e).parse(),tokens:n}}function Xt(t,e){return{rowAbs:t.rowAbs,colAbs:t.colAbs,...t.row!==void 0?{row:t.rowAbs?t.row:t.row-e.row}:{},...t.col!==void 0?{col:t.colAbs?t.col:t.col-e.col}:{}}}const jo=t=>`${t.row===void 0?"":t.rowAbs?`R${t.row}`:`R[${t.row}]`}${t.col===void 0?"":t.colAbs?`C${t.col}`:`C[${t.col}]`}`;function tc(t,e){const n=[],o=r=>{switch(r.type){case"number":return n.push(r.value),"#n";case"string":return n.push(r.value),"#s";case"bool":return r.value?"T":"F";case"error":return r.code;case"cell":return`${r.sheet===void 0?"":`'${r.sheet}'!`}${jo(Xt(r.ref,e))}`;case"range":return`${r.sheet===void 0?"":`'${r.sheet}'!`}${jo(Xt(r.from,e))}:${jo(Xt(r.to,e))}`;case"name":return`N(${r.name.toUpperCase()})`;case"call":return`${r.name}(${r.args.map(o).join(",")})`;case"unary":return`${r.op}(${o(r.arg)})`;case"percent":return`%(${o(r.arg)})`;case"binary":return`(${o(r.left)}${r.op===" "?"_":r.op}${o(r.right)})`;case"union":return`U(${r.items.map(o).join(",")})`;case"array":return`{${r.rows.map(s=>s.map(o).join(",")).join(";")}}`;case"empty":return"~"}};return{key:o(t),constants:n}}const Ss=t=>/^[A-Za-z_][A-Za-z0-9_.]*$/.test(t)&&!/^[A-Za-z]{1,3}[0-9]+$/.test(t)?t:`'${t.replace(/'/g,"''")}'`;function Bo(t){const e=t.col===void 0?"":`${t.colAbs?"$":""}${Ye(t.col)}`,n=t.row===void 0?"":`${t.rowAbs?"$":""}${t.row+1}`;return e+n}const nc={"=":10,"<>":10,"<":10,"<=":10,">":10,">=":10,"&":20,"+":30,"-":30,"*":40,"/":40,"^":50," ":80};function Ao(t){const e=(n,o=0)=>{switch(n.type){case"number":return String(n.value);case"string":return`"${n.value.replace(/"/g,'""')}"`;case"bool":return n.value?"TRUE":"FALSE";case"error":return n.code;case"cell":return`${n.sheet===void 0?"":`${Ss(n.sheet)}!`}${Bo(n.ref)}`;case"range":return`${n.sheet===void 0?"":`${Ss(n.sheet)}!`}${Bo(n.from)}:${Bo(n.to)}`;case"name":return n.name;case"call":return n.name===":"?`${e(n.args[0],90)}:${e(n.args[1],90)}`:`${n.name}(${n.args.map(r=>e(r)).join(",")})`;case"unary":return`${n.op}${e(n.arg,60)}`;case"percent":return`${e(n.arg,70)}%`;case"binary":{const r=nc[n.op],s=`${e(n.left,r-.5)}${n.op}${e(n.right,r)}`;return r<=o?`(${s})`:s}case"union":return`(${n.items.map(r=>e(r)).join(",")})`;case"array":return`{${n.rows.map(r=>r.map(s=>e(s)).join(",")).join(";")}}`;case"empty":return""}};return e(t)}function oc(t,e,n,o={rows:1048576,cols:16384}){return Fi(t,o,r=>({row:r.row===void 0||r.rowAbs?r.row:r.row+e,col:r.col===void 0||r.colAbs?r.col:r.col+n}))}function rc(t,e,n,o={rows:1048576,cols:16384}){return Fi(t,o,r=>r.row!==void 0&&r.col!==void 0&&!r.rowAbs&&!r.colAbs?{row:n.row+(r.col-e.col),col:n.col+(r.row-e.row)}:{row:r.row===void 0||r.rowAbs?r.row:r.row+n.row-e.row,col:r.col===void 0||r.colAbs?r.col:r.col+n.col-e.col})}function Fi(t,e,n){const o=s=>{const{row:i,col:a}=n(s);if(!(i!==void 0&&(i<0||i>=e.rows)||a!==void 0&&(a<0||a>=e.cols)))return{...s,...i!==void 0?{row:i}:{},...a!==void 0?{col:a}:{}}},r=s=>{switch(s.type){case"cell":{const i=o(s.ref);return i===void 0?{type:"error",code:"#REF!"}:{...s,ref:i}}case"range":{const i=o(s.from),a=o(s.to);return i===void 0||a===void 0?{type:"error",code:"#REF!"}:{...s,from:i,to:a}}case"call":return{...s,args:s.args.map(r)};case"unary":case"percent":return{...s,arg:r(s.arg)};case"binary":return{...s,left:r(s.left),right:r(s.right)};case"union":return{...s,items:s.items.map(r)};default:return s}};return r(t)}function sc(t,e,n,o){let r;try{r=Nt(t).ast}catch{return t}return Ao(rc(r,e,n,o))}function Or(t,e,n,o){if(e===0&&n===0)return t;let r;try{r=Nt(t).ast}catch{return t}return Ao(oc(r,e,n,o))}const im=["bar","column","line","area","pie","scatter","combo"],Cs=["clustered","stacked","percent","smooth","doughnut"],$s=["top","right","bottom","left","none"],mo=1e5;class Pi extends Error{}function Y(t,e){throw new Pi(`${t}: ${e}`)}const at=t=>typeof t=="object"&&t!==null&&!Array.isArray(t);function Gt(t){let e;try{e=Nt(t).ast}catch{return}if(e.type==="cell"||e.type==="range"||e.type==="error"&&e.code==="#REF!")return e}function Ho(t,e){(typeof t!="string"||Gt(t)===void 0)&&Y(e,"not a range")}function Yo(t,e,n){at(t)||Y(e,"a cell offset is { row, col, dx, dy }");for(const o of["row","col"])(!Number.isInteger(t[o])||t[o]<0)&&Y(`${e}.${o}`,"a non-negative integer");(t.row>=n.rows||t.col>=n.cols)&&Y(e,"outside the sheet");for(const o of["dx","dy"])(typeof t[o]!="number"||!Number.isFinite(t[o])||t[o]<0)&&Y(`${e}.${o}`,"a non-negative number of px")}const Dn=t=>typeof t=="number"&&Number.isFinite(t)&&t>0;function ic(t,e){at(t)||Y(e,"an axis is { title?, min?, max?, format?, log?, gridlines? }");for(const n of Object.keys(t))["title","min","max","format","log","gridlines"].includes(n)||Y(`${e}.${n}`,"not a field of an axis");t.title!==void 0&&typeof t.title!="string"&&Y(`${e}.title`,"a text");for(const n of["min","max"])t[n]!==void 0&&(typeof t[n]!="number"||!Number.isFinite(t[n]))&&Y(`${e}.${n}`,"a number");t.format!==void 0&&typeof t.format!="string"&&Y(`${e}.format`,"a number format");for(const n of["log","gridlines"])t[n]!==void 0&&typeof t[n]!="boolean"&&Y(`${e}.${n}`,"true or false")}function ji(t,e,n){at(t)||Y(e,"a chart is an object");for(const s of Object.keys(t))["id","type","variant","anchor","data","title","legend","axes","labels"].includes(s)||Y(`${e}.${s}`,"not a field of a chart");(typeof t.id!="string"||t.id==="")&&Y(`${e}.id`,"a non-empty string"),(typeof t.type!="string"||!/^[a-z][a-zA-Z0-9.-]*$/.test(t.type))&&Y(`${e}.type`,"a chart type (column, line, … or a contributed type)"),t.variant!==void 0&&!Cs.includes(t.variant)&&Y(`${e}.variant`,`one of ${Cs.join(", ")}`);const o=t.anchor;if(at(o)||Y(`${e}.anchor`,"an anchor is { kind, … }"),o.kind==="cells"){Yo(o.from,`${e}.anchor.from`,n),Yo(o.to,`${e}.anchor.to`,n);const s=o.from,i=o.to;(i.row<s.row||i.col<s.col)&&Y(`${e}.anchor`,"from after to")}else if(o.kind==="cell")Yo(o.from,`${e}.anchor.from`,n),Dn(o.width)||Y(`${e}.anchor.width`,"a positive number of px"),Dn(o.height)||Y(`${e}.anchor.height`,"a positive number of px");else if(o.kind==="absolute"){for(const s of["x","y"])(typeof o[s]!="number"||!Number.isFinite(o[s])||o[s]<0)&&Y(`${e}.anchor.${s}`,"a non-negative number of px");Dn(o.width)||Y(`${e}.anchor.width`,"a positive number of px"),Dn(o.height)||Y(`${e}.anchor.height`,"a positive number of px")}else Y(`${e}.anchor.kind`,"cells, cell or absolute");const r=t.data;if(at(r)||Y(`${e}.data`,"the data is { series, by, headers, blanks }"),(!Array.isArray(r.series)||r.series.length===0)&&Y(`${e}.data.series`,"a non-empty list"),r.series.forEach((s,i)=>{const a=`${e}.data.series[${i}]`;at(s)||Y(a,"a series is { values, … }");for(const l of Object.keys(s))["name","values","categories","x","type","axis","color"].includes(l)||Y(`${a}.${l}`,"not a field of a series");Ho(s.values,`${a}.values`),s.categories!==void 0&&Ho(s.categories,`${a}.categories`),s.x!==void 0&&Ho(s.x,`${a}.x`),s.name!==void 0&&typeof s.name!="string"&&Y(`${a}.name`,"a text or a range"),s.type!==void 0&&!["column","line","area"].includes(s.type)&&Y(`${a}.type`,"column, line or area"),s.axis!==void 0&&s.axis!=="primary"&&s.axis!=="secondary"&&Y(`${a}.axis`,"primary or secondary"),s.color!==void 0&&(typeof s.color!="string"||!/^#[0-9a-fA-F]{6}$/.test(s.color))&&Y(`${a}.color`,"a colour such as #1f77b4")}),r.by!=="columns"&&r.by!=="rows"&&Y(`${e}.data.by`,"columns or rows"),(!at(r.headers)||typeof r.headers.row!="boolean"||typeof r.headers.column!="boolean")&&Y(`${e}.data.headers`,"{ row, column }, true or false each"),["gap","zero","connect"].includes(r.blanks)||Y(`${e}.data.blanks`,"gap, zero or connect"),t.title!==void 0&&typeof t.title!="string"&&Y(`${e}.title`,"a text or a range"),$s.includes(t.legend)||Y(`${e}.legend`,`one of ${$s.join(", ")}`),t.axes!==void 0){at(t.axes)||Y(`${e}.axes`,"{ x?, y?, y2? }");for(const s of Object.keys(t.axes))["x","y","y2"].includes(s)||Y(`${e}.axes.${s}`,"not an axis (x, y or y2)"),ic(t.axes[s],`${e}.axes.${s}`)}return t.labels!==void 0&&typeof t.labels!="boolean"&&Y(`${e}.labels`,"true or false"),t}function Ir(t,e,n="chart"){try{ji(t,n,e);return}catch(o){if(o instanceof Pi)return o.message;throw o}}function dt(t,e,n){const o=Gt(n);if(o===void 0||o.type==="error")return;const r=o.type==="cell"||o.type==="range"?o.sheet===void 0?e:t.sheetByName(o.sheet)?.id:void 0;if(r===void 0)return;const s=t.sheet(r);if(o.type==="cell"){const{row:u,col:h}=o.ref;return u===void 0||h===void 0?void 0:{sheet:r,zone:{top:u,left:h,bottom:u,right:h}}}if(o.type!=="range")return;const i=o.from.row??0,a=o.to.row??s.rows.count-1,l=o.from.col??0,c=o.to.col??s.cols.count-1;return{sheet:r,zone:{top:Math.min(i,a),left:Math.min(l,c),bottom:Math.max(i,a),right:Math.max(l,c)}}}const Bi=t=>(t.bottom-t.top+1)*(t.right-t.left+1);function Hi(t,e){const n=e.anchor;if(n.kind==="absolute")return{x:n.x,y:n.y,width:n.width,height:n.height};const o=t.cols.offsetOf(n.from.col)+n.from.dx,r=t.rows.offsetOf(n.from.row)+n.from.dy;if(n.kind==="cell")return{x:o,y:r,width:n.width,height:n.height};const s=t.cols.offsetOf(n.to.col)+n.to.dx,i=t.rows.offsetOf(n.to.row)+n.to.dy;return{x:o,y:r,width:Math.max(1,s-o),height:Math.max(1,i-r)}}function Yi(t){const e=[];for(const n of t.data.series)e.push(n.values),n.categories!==void 0&&e.push(n.categories),n.x!==void 0&&e.push(n.x),n.name!==void 0&&Gt(n.name)!==void 0&&e.push(n.name);return e}function lc(t,e,n){const o=[];for(const r of Yi(n)){const s=dt(t,e,r);s!==void 0&&o.push(s)}return o}function*As(t){for(let e=t.top;e<=t.bottom;e+=1)for(let n=t.left;n<=t.right;n+=1)yield[e,n]}function ac(t,e,n,o){const r=[],s=c=>{if(c===void 0)return;const u=dt(e,n,c);if(u===void 0)return r.push(c),[];const h=[];for(const[d,f]of As(u.zone)){const m=t(u.sheet,d,f);typeof m=="number"?h.push(m):h.push(m===null&&o.data.blanks==="zero"?0:null)}return h},i=c=>{const u=dt(e,n,c);if(u===void 0)return r.push(c),[];const h=[];for(const[d,f]of As(u.zone)){const m=t(u.sheet,d,f);h.push(typeof m=="number"||typeof m=="string"?m:m===null?"":String(m))}return h};let a;const l=o.data.series.map((c,u)=>{a===void 0&&c.categories!==void 0&&(a=i(c.categories));let h=`Series ${u+1}`;if(c.name!==void 0)if(Gt(c.name)===void 0)h=c.name;else{const g=dt(e,n,c.name);if(g===void 0)r.push(c.name);else{const w=t(g.sheet,g.zone.top,g.zone.left);w!==null&&typeof w!="object"&&(h=String(w))}}const d=s(c.values),f=s(c.x),m=dt(e,n,c.values)===void 0;return{name:h,values:d,...f!==void 0?{x:f}:{},...c.type!==void 0?{type:c.type}:{},...c.axis!==void 0?{axis:c.axis}:{},...c.color!==void 0?{color:c.color}:{},...m?{}:{source:c.values}}});return{categories:a??[],series:l,deleted:[...new Set(r)]}}function cc(t,e,n){let o=0;for(const r of n.data.series){const s=dt(t,e,r.values);s!==void 0&&(o+=Bi(s.zone))}return o}function uc(t,e,n){for(const o of n.data.series){const r=dt(t.workbook,e,o.values);if(r!==void 0){for(const[s,i]of t.workbook.sheet(r.sheet).cells.entries(r.zone))if(typeof t.value(r.sheet,s,i)=="number")return!0}}return!1}function Lt(t,e){const n=/^[A-Za-z_][A-Za-z0-9_.]*$/.test(t)&&!/^[A-Za-z]{1,3}[0-9]+$/.test(t)?t:`'${t.replace(/'/g,"''")}'`,o=`$${Ye(e.left)}$${e.top+1}`,r=`$${Ye(e.right)}$${e.bottom+1}`;return`${n}!${o===r?o:`${o}:${r}`}`}function hc(t,e,n,o=()=>!1){const r=n.bottom-n.top+1,s=n.right-n.left+1,i=(g,w)=>typeof t(g,w)=="string",a=(g,w)=>typeof t(g,w)=="number"&&!o(g,w);let l=0;for(let g=n.top;g<=n.bottom;g+=1)for(let w=n.left;w<=n.right;w+=1)a(g,w)&&(l+=1);if(l===0)return{ok:!1,reason:"NoNumericData",message:"The selection holds no number to chart."};let c=r>1;for(let g=n.left+(s>1?1:0);g<=n.right&&c;g+=1)i(n.top,g)||t(n.top,g)===null||(c=!1);if(c){let g=!1;for(let w=n.left;w<=n.right;w+=1)i(n.top,w)&&(g=!0);c=g}let u=s>1;for(let g=n.top+(c?1:0);g<=n.bottom&&u;g+=1)i(g,n.left)||o(g,n.left)||t(g,n.left)===null||(u=!1);const h={top:n.top+(c?1:0),left:n.left+(u?1:0),bottom:n.bottom,right:n.right};if(h.top>h.bottom||h.left>h.right)return{ok:!1,reason:"NoNumericData",message:"The selection holds no number to chart."};const d=Bi(h);if(d>mo)return{ok:!1,reason:"ChartTooLarge",message:`A chart holds at most ${mo.toLocaleString("en-US")} points; this selection has ${d.toLocaleString("en-US")}.`};const f=h.bottom-h.top>=h.right-h.left,m=[];if(f)for(let g=h.left;g<=h.right;g+=1)m.push({values:Lt(e,{top:h.top,left:g,bottom:h.bottom,right:g}),...c?{name:Lt(e,{top:n.top,left:g,bottom:n.top,right:g})}:{},...u?{categories:Lt(e,{top:h.top,left:n.left,bottom:h.bottom,right:n.left})}:{}});else for(let g=h.top;g<=h.bottom;g+=1)m.push({values:Lt(e,{top:g,left:h.left,bottom:g,right:h.right}),...u?{name:Lt(e,{top:g,left:n.left,bottom:g,right:n.left})}:{},...c?{categories:Lt(e,{top:n.top,left:h.left,bottom:n.top,right:h.right})}:{}});return{ok:!0,data:{series:m,by:f?"columns":"rows",headers:{row:c,column:u},blanks:"gap"}}}const fc={op:"chart",apply(t,e){const n=t.sheet(e.sheet);e.after===null?n.charts.delete(e.id):n.charts.set(e.id,e.after)},invert:t=>({...t,before:t.after,after:t.before}),bytes:()=>512,example:()=>({op:"chart",sheet:"s1",id:"c1",before:null,after:{id:"c1",type:"column",anchor:{kind:"cells",from:{row:1,col:4,dx:0,dy:0},to:{row:10,col:9,dx:0,dy:0}},data:{series:[{values:"Sheet1!$B$2:$B$5"}],by:"columns",headers:{row:!1,column:!1},blanks:"gap"},legend:"bottom"}})};function Xi(t,e){return t.workbook.hasSheet(e)?void 0:_("UnknownSheet",`No sheet '${e}'.`)}function Mo(t,e,n){const o=Xi(t,e);return o||(t.workbook.sheet(e).charts.get(n)??_("UnknownChart",`No chart '${n}' on this sheet.`))}const To=t=>typeof t=="object"&&t!==null&&"ok"in t&&typeof t.ok=="boolean";function Wi(t,e,n){const o=Ir(n,t.workbook.limits);if(o!==void 0)return _("InvalidArgument",o);const r=cc(t.workbook,e,n);return r>mo?_("ChartTooLarge",`A chart holds at most ${mo.toLocaleString("en-US")} points; this one has ${r.toLocaleString("en-US")}.`):uc(t,e,n)?se:_("NoNumericData","The chart’s ranges hold no number to draw.")}function dc(t,e){const n=t.workbook.sheet(e).charts;for(let o=1;;o+=1)if(!n.has(`chart${o}`))return`chart${o}`}const Tn=(t,e,n,o)=>({op:"chart",sheet:t,id:e,before:n,after:o});function Ms(t,e){return{...e.chart,id:e.chart.id??dc(t,e.sheet)}}const mc={type:"INSERT_CHART",allow:(t,e)=>{const n=Xi(t,e.sheet);if(n)return n;const o=Ms(t,e);return t.workbook.sheet(e.sheet).charts.has(o.id)?_("DuplicateChart",`A chart '${o.id}' is on this sheet already.`):Wi(t,e.sheet,o)},apply:(t,e)=>{const n=Ms(t,e);return[Tn(e.sheet,n.id,null,n)]}},gc={type:"UPDATE_CHART",allow:(t,e)=>{const n=Mo(t,e.sheet,e.id);return To(n)?n:"id"in e.changes||"anchor"in e.changes?_("InvalidArgument","An update changes neither the id nor the anchor (MOVE_CHART, RESIZE_CHART)."):Wi(t,e.sheet,{...n,...e.changes})},apply:(t,e)=>{const n=t.workbook.sheet(e.sheet).charts.get(e.id);return[Tn(e.sheet,e.id,n,{...n,...e.changes})]}};function Ts(t,e){const n=t.anchor;return n.kind==="absolute"?"x"in e?{...n,x:e.x,y:e.y}:"An absolute chart moves to px (x, y), not to a cell.":"row"in e?n.kind==="cell"?{...n,from:{...n.from,row:e.row,col:e.col}}:{...n,from:{...n.from,row:e.row,col:e.col},to:{...n.to,row:e.row+(n.to.row-n.from.row),col:e.col+(n.to.col-n.from.col)}}:"A chart anchored on cells moves to a cell (row, col), not to px."}const pc={type:"MOVE_CHART",allow:(t,e)=>{const n=Mo(t,e.sheet,e.id);if(To(n))return n;const o=Ts(n,e.to);if(typeof o=="string")return _("InvalidArgument",o);const r=Ir({...n,anchor:o},t.workbook.limits);return r===void 0?se:_("InvalidArgument",r)},apply:(t,e)=>{const n=t.workbook.sheet(e.sheet).charts.get(e.id);return[Tn(e.sheet,e.id,n,{...n,anchor:Ts(n,e.to)})]}};function Rs(t,e){const n=t.anchor;return n.kind==="cells"?"row"in e?{...n,to:{...n.to,row:e.row,col:e.col}}:"A chart anchored on cells is resized to a cell (row, col).":"width"in e?{...n,width:e.width,height:e.height}:"This chart is resized in px (width, height)."}const wc={type:"RESIZE_CHART",allow:(t,e)=>{const n=Mo(t,e.sheet,e.id);if(To(n))return n;const o=Rs(n,e.to);if(typeof o=="string")return _("InvalidArgument",o);const r=Ir({...n,anchor:o},t.workbook.limits);return r===void 0?se:_("InvalidArgument",r)},apply:(t,e)=>{const n=t.workbook.sheet(e.sheet).charts.get(e.id);return[Tn(e.sheet,e.id,n,{...n,anchor:Rs(n,e.to)})]}},yc={type:"DELETE_CHART",allow:(t,e)=>{const n=Mo(t,e.sheet,e.id);return To(n)?n:se},apply:(t,e)=>{const n=t.workbook.sheet(e.sheet).charts.get(e.id);return[Tn(e.sheet,e.id,n,null)]}},bc=[mc,gc,pc,wc,yc];function ut(t,e){const{at:n,n:o}=t;switch(t.kind){case"insert":return e>=n?e+o:e;case"delete":return e<n?e:e<n+o?void 0:e-o;case"move":{const{to:r}=t;return e>=n&&e<n+o?r<n?r+(e-n):r-o+(e-n):r<n&&e>=r&&e<n?e+o:r>n&&e>=n+o&&e<r?e-o:e}}}function Vi(t,e,n,o){const r=n==="rows"?"row":"col",s={type:"error",code:"#REF!"},i=(u,h)=>({...u,[r]:h});let a=!1;const l=u=>{switch(u.type){case"cell":{const h=u.ref[r];if(!e(u.sheet)||h===void 0)return u;const d=ut(o,h);return d===h?u:(a=!0,d===void 0?s:{...u,ref:i(u.ref,d)})}case"range":{const h=u.from[r],d=u.to[r];if(!e(u.sheet)||h===void 0||d===void 0)return u;const f=Math.min(h,d),m=Math.max(h,d);let g,w;if(o.kind==="delete"){if(g=f>=o.at&&f<o.at+o.n?o.at:ut(o,f),w=m>=o.at&&m<o.at+o.n?o.at-1:ut(o,m),g>w)return a=!0,s}else{const $=ut(o,f),A=ut(o,m);g=Math.min($,A),w=Math.max($,A)}const[y,x]=h<=d?[u.from,u.to]:[u.to,u.from];return g===f&&w===m&&h<=d?u:(a=!0,{...u,from:i(y,g),to:i(x,w)})}case"call":return{...u,args:u.args.map(l)};case"unary":case"percent":return{...u,arg:l(u.arg)};case"binary":return{...u,left:l(u.left),right:l(u.right)};case"union":return{...u,items:u.items.map(l)};default:return u}},c=l(t);return a?c:t}function _r(t,e,n,o){const s=t.sheet(e).name.toLowerCase(),i=[];for(const l of t.sheets){const c=l.id===e,u=h=>h===void 0?c:h.toLowerCase()===s;for(const[h,d,f]of l.cells.entries()){if(f.formula===void 0)continue;let m;try{m=Nt(f.formula).ast}catch{continue}const g=Vi(m,u,n,o);if(g===m)continue;const w=Ao(g);let y=h,x=d;if(c){const A=ut(o,n==="rows"?h:d);if(A===void 0)continue;n==="rows"?y=A:x=A}const $={...f,formula:w,value:null};i.push({op:"cells",sheet:l.id,zone:{top:y,left:x,bottom:y,right:x},before:Rt([[y,x,f]]),after:Rt([[y,x,$]])})}}i.push(...xc(t,e,n,o));const a=t.sheet(e).dataSource;if(a!==null){const l=n==="rows"?"row":"col",c=ut(o,a.at[l]);c!==void 0&&c!==a.at[l]&&i.push({op:"dataSource",sheet:e,before:a,after:{...a,at:{...a.at,[l]:c}}})}return i}function zs(t,e,n){const o=ut(t,e);return o!==void 0?o:n?Math.max(0,t.at-1):t.at}function xc(t,e,n,o){const r=t.sheet(e).name.toLowerCase(),s=[];for(const i of t.sheets){const a=i.id===e,l=c=>c===void 0?a:c.toLowerCase()===r;for(const[c,u]of i.charts){let h=!1;const d=w=>{if(w===void 0)return;const y=Gt(w);if(y===void 0||y.type==="error")return w;const x=Vi(y,l,n,o);return x===y?w:(h=!0,Ao(x))},f=u.data.series.map(w=>{const y=d(w.values),x=d(w.categories),$=d(w.x),A=w.name!==void 0&&Gt(w.name)!==void 0?d(w.name):w.name;return{...w,values:y,...x!==void 0?{categories:x}:{},...$!==void 0?{x:$}:{},...A!==void 0?{name:A}:{}}});let m=u.anchor;if(a&&m.kind!=="absolute"){const w=n==="rows"?"row":"col",y={...m.from,[w]:zs(o,m.from[w],!1)};if(m.kind==="cells"){let x={...m.to,[w]:zs(o,m.to[w],!0)};x[w]<y[w]&&(x={...x,[w]:y[w]}),m={...m,from:y,to:x}}else m={...m,from:y};JSON.stringify(m)!==JSON.stringify(u.anchor)&&(h=!0)}if(!h)continue;const g={...u,anchor:m,data:{...u.data,series:f}};s.push({op:"chart",sheet:i.id,id:c,before:u,after:g})}}return s}const se={ok:!0};function _(t,e){return{ok:!1,refusals:[{reason:t,message:e}]}}function dr(t){if(t.startsWith("'"))return t.slice(1);if(t.startsWith("=")&&t.length>1)return{formula:t.slice(1)};const e=t.trim();return e!==""&&/^[+-]?(\d+\.?\d*|\.\d+)([eE][+-]?\d+)?$/.test(e)?Number(e):/^true$/i.test(e)?!0:/^false$/i.test(e)?!1:t===""?null:t}function Ce(t,e){return t.hasSheet(e)?t.sheet(e):_("UnknownSheet",`No sheet '${e}'.`)}const $e=t=>typeof t=="object"&&t!==null&&"ok"in t&&typeof t.ok=="boolean";function Rn(t,e){return![e.top,e.left,e.bottom,e.right].every(Number.isInteger)||e.top<0||e.left<0||e.top>e.bottom||e.left>e.right?_("InvalidArgument",`The zone ${JSON.stringify(e)} is not a zone.`):e.bottom>=t.rows.count||e.right>=t.cols.count?_("OutOfBounds",`The zone reaches past the sheet's ${t.rows.count} rows or ${t.cols.count} columns.`):se}function zn(t,e,n,o){const r=e==="rows"?t.rows.count:t.cols.count;return!Number.isInteger(n)||!Number.isInteger(o)||o<1||n<0?_("InvalidArgument",`${o} ${e} at ${n} is not a span.`):n+o>r?_("OutOfBounds",`${o} ${e} at ${n} reach past the sheet's ${r}.`):se}function vc(t,e,n){if(e===null||typeof e!="object"||j(e))return{value:e,style:n?.style??0};const o=e.style===void 0?n?.style??0:e.style===null?0:t.styles.intern(e.style);return e.formula!==void 0?e.value!==void 0&&e.value!==null?{value:e.value,formula:e.formula,style:o}:{value:null,formula:e.formula,style:o}:{value:e.value??null,style:o}}function Ec(t){if(t===null||typeof t=="string"||typeof t=="boolean")return;if(typeof t=="number")return Number.isFinite(t)?void 0:`${t} is not a cell value`;if(j(t))return;if(typeof t!="object")return`${String(t)} is not a cell input`;if(t.formula!==void 0&&(typeof t.formula!="string"||t.formula===""))return"a formula is a non-empty string, without the =";if(t.style!==void 0&&t.style!==null)try{zr(t.style)}catch(n){return n.message}const e=t.value;if(e!=null&&typeof e=="number"&&!Number.isFinite(e))return`${e} is not a cell value`}function en(t,e,n){const o=Kt(t,e),r=new Map;for(const s of Mn(o))r.set(`${s[0]},${s[1]}`,s);for(const[s,i,a]of n){const l=`${s},${i}`;a===null||a.value===null&&a.formula===void 0&&a.style===0?r.delete(l):r.set(l,[s,i,a])}return{op:"cells",sheet:t.id,zone:e,before:o,after:Rt([...r.values()])}}function Ns(t,e,n){return n===null?0:t.styles.intern({...t.styles.get(e),...n})}function Ki(t,e,n,o,r){const s=e==="rows"?t.rows:t.cols,i={sizes:new Float64Array(o),hidden:new Uint8Array(o)},a={sizes:new Float64Array(o),hidden:new Uint8Array(o)};for(let l=0;l<o;l+=1){const c=s.sizeOf(n+l),u=s.isHidden(n+l);i.sizes[l]=c,i.hidden[l]=u?1:0;const[h,d]=r(l,c,u);a.sizes[l]=h,a.hidden[l]=d?1:0}return{op:"axis-sizes",sheet:t.id,axis:e,at:n,n:o,before:i,after:a}}function Gi(t,e,n,o,r){const s=[];for(const i of t){const a=e==="rows"?i.top:i.left,l=e==="rows"?i.bottom:i.right;let c=a,u=l;if(o>0){if(a>=n&&(c+=o),l>=n&&(u+=o),u>=r)continue}else{const d=-o,f=n+d;if(c=(g=>g>=f?g-d:g>=n?n:g)(a),u=l>=f?l-d:l>=n?n-1:l,u<c)continue}const h=e==="rows"?{...i,top:c,bottom:u}:{...i,left:c,right:u};h.top===h.bottom&&h.left===h.right||s.push(h)}return s}const Zi=(t,e)=>JSON.stringify(t)===JSON.stringify(e),kc={type:"SET_CELLS",allow({workbook:t},e){const n=Ce(t,e.sheet);if($e(n))return n;if(!Array.isArray(e.cells)||e.cells.length===0||!e.cells.every(r=>Array.isArray(r)))return _("InvalidArgument","SET_CELLS takes a non-empty block of rows.");const o=Math.max(...e.cells.map(r=>r.length));if(o===0)return _("InvalidArgument","SET_CELLS takes at least one cell.");for(const r of e.cells)for(const s of r){const i=Ec(s);if(i)return _("InvalidArgument",`SET_CELLS: ${i}.`)}return Rn(n,{top:e.at.row,left:e.at.col,bottom:e.at.row+e.cells.length-1,right:e.at.col+o-1})},apply({workbook:t},e){const n=t.sheet(e.sheet),o=Math.max(...e.cells.map(i=>i.length)),r={top:e.at.row,left:e.at.col,bottom:e.at.row+e.cells.length-1,right:e.at.col+o-1},s=[];return e.cells.forEach((i,a)=>i.forEach((l,c)=>{const u=e.at.row+a,h=e.at.col+c;s.push([u,h,vc(t,l,n.cells.get(u,h))])})),[en(n,r,s)]}},Sc={type:"SET_STYLE",allow({workbook:t},e){const n=Ce(t,e.sheet);if($e(n))return n;if(e.style!==null)try{zr(e.style)}catch(o){return _("InvalidArgument",o.message)}return Rn(n,e.zone)},apply({workbook:t},e){const n=t.sheet(e.sheet),o=[],{top:r,left:s,bottom:i,right:a}=e.zone;if((i-r+1)*(a-s+1)>1e6)for(const[c,u,h]of n.cells.entries(e.zone))o.push([c,u,{...h,style:Ns(t,h.style,e.style)}]);else for(let c=r;c<=i;c+=1)for(let u=s;u<=a;u+=1){const h=n.cells.get(c,u)??{value:null,style:0};o.push([c,u,{...h,style:Ns(t,h.style,e.style)}])}return[en(n,e.zone,o)]}},Cc={type:"CLEAR",allow({workbook:t},e){const n=Ce(t,e.sheet);return $e(n)?n:e.what!==void 0&&!["all","contents","styles"].includes(e.what)?_("InvalidArgument",`CLEAR clears all, contents or styles, not '${e.what}'.`):Rn(n,e.zone)},apply({workbook:t},e){const n=t.sheet(e.sheet),o=e.what??"all",r=[];for(const[s,i,a]of n.cells.entries(e.zone))o==="all"?r.push([s,i,null]):o==="contents"?r.push([s,i,{value:null,style:a.style}]):r.push([s,i,{...a,style:0}]);return[en(n,e.zone,r)]}},$c={type:"INSERT_AXIS",allow({workbook:t},e){const n=Ce(t,e.sheet);if($e(n))return n;if(e.axis!=="rows"&&e.axis!=="cols")return _("InvalidArgument",`No axis '${String(e.axis)}'.`);const o=zn(n,e.axis,e.at,e.n);if(!o.ok)return o;const r=e.axis==="rows"?n.rows.count:n.cols.count,s=e.axis==="rows"?{top:r-e.n,left:0,bottom:r-1,right:n.cols.count-1}:{top:0,left:r-e.n,bottom:n.rows.count-1,right:r-1};return!n.cells.isEmpty(s)||n.mergesIn(s).length>0?_("NotEmptyAtEnd",`Inserting ${e.n} ${e.axis} would push content off the end of the sheet.`):se},apply({workbook:t},e){const n=t.sheet(e.sheet),o=e.axis==="rows"?n.rows:n.cols,r=o.count,s=o.segment(r-e.n,e.n),i={op:"axis-insert",sheet:n.id,axis:e.axis,at:e.at,n:e.n,inserted:{ids:o.freshIds(e.n),sizes:null,hidden:null},dropped:s},a=Gi(n.merges,e.axis,e.at,e.n,r),l=[i];return Zi(a,n.merges)||l.push({op:"merges",sheet:n.id,before:n.merges,after:a}),l.push(..._r(t,n.id,e.axis,{kind:"insert",at:e.at,n:e.n})),l}},Ac={type:"DELETE_AXIS",allow({workbook:t},e){const n=Ce(t,e.sheet);return $e(n)?n:e.axis!=="rows"&&e.axis!=="cols"?_("InvalidArgument",`No axis '${String(e.axis)}'.`):zn(n,e.axis,e.at,e.n)},apply({workbook:t},e){const n=t.sheet(e.sheet),o=e.axis==="rows"?n.rows:n.cols,r=e.axis==="rows"?{top:e.at,left:0,bottom:e.at+e.n-1,right:n.cols.count-1}:{top:0,left:e.at,bottom:n.rows.count-1,right:e.at+e.n-1},s=[],i=Kt(n,r);i.rows.length>0&&s.push({op:"cells",sheet:n.id,zone:r,before:i,after:zi});const a=Gi(n.merges,e.axis,e.at,-e.n,o.count);return Zi(a,n.merges)||s.push({op:"merges",sheet:n.id,before:n.merges,after:a}),s.push({op:"axis-delete",sheet:n.id,axis:e.axis,at:e.at,n:e.n,removed:o.segment(e.at,e.n)}),s.push(..._r(t,n.id,e.axis,{kind:"delete",at:e.at,n:e.n})),s}},Mc={type:"MOVE_AXIS",allow({workbook:t},e){const n=Ce(t,e.sheet);if($e(n))return n;const o=zn(n,e.axis,e.at,e.n);if(!o.ok)return o;const r=e.axis==="rows"?n.rows.count:n.cols.count;if(!Number.isInteger(e.to)||e.to<0||e.to>r||e.to>=e.at&&e.to<=e.at+e.n)return _("InvalidArgument",`Cannot move ${e.n} ${e.axis} at ${e.at} to ${e.to}.`);const s=Math.min(e.at,e.to),i=Math.max(e.at+e.n,e.to)-1,a=e.axis==="rows"?{top:s,left:0,bottom:i,right:n.cols.count-1}:{top:0,left:s,bottom:n.rows.count-1,right:i};return n.mergesIn(a).length>0?_("MergeOverlap","Moving across merged cells is not supported yet; unmerge first."):se},apply({workbook:t},e){const n=t.sheet(e.sheet),o=Math.min(e.at,e.to),r=Math.max(e.at+e.n,e.to)-1,s=e.axis==="rows"?{top:o,left:0,bottom:r,right:n.cols.count-1}:{top:0,left:o,bottom:n.rows.count-1,right:r},i=c=>c>=e.at&&c<e.at+e.n?e.to<e.at?e.to+(c-e.at):e.to-e.n+(c-e.at):e.to<e.at&&c>=e.to&&c<e.at?c+e.n:e.to>e.at&&c>=e.at+e.n&&c<e.to?c-e.n:c,a=Kt(n,s),l=Mn(a).map(([c,u,h])=>e.axis==="rows"?[i(c),u,h]:[c,i(u),h]);return[{op:"cells",sheet:n.id,zone:s,before:a,after:Rt(l)},{op:"axis-move",sheet:n.id,axis:e.axis,at:e.at,n:e.n,to:e.to},..._r(t,n.id,e.axis,{kind:"move",at:e.at,n:e.n,to:e.to})]}},Tc={type:"RESIZE_AXIS",allow({workbook:t},e){const n=Ce(t,e.sheet);return $e(n)?n:!(e.size>0)||!Number.isFinite(e.size)?_("InvalidArgument",`A size must be positive; ${e.size} was given.`):zn(n,e.axis,e.from,e.to-e.from+1)},apply({workbook:t},e){const n=t.sheet(e.sheet);return[Ki(n,e.axis,e.from,e.to-e.from+1,(o,r,s)=>[e.size,s])]}},Rc={type:"HIDE_AXIS",allow({workbook:t},e){const n=Ce(t,e.sheet);return $e(n)?n:zn(n,e.axis,e.from,e.to-e.from+1)},apply({workbook:t},e){const n=t.sheet(e.sheet);return[Ki(n,e.axis,e.from,e.to-e.from+1,(o,r)=>[r,e.hidden])]}},zc={type:"MERGE",allow({workbook:t},e){const n=Ce(t,e.sheet);if($e(n))return n;const o=Rn(n,e.zone);return o.ok?e.zone.top===e.zone.bottom&&e.zone.left===e.zone.right?_("InvalidArgument","A merge spans more than one cell."):n.mergesIn(e.zone).length>0?_("MergeOverlap","The zone overlaps a merge; unmerge it first."):se:o},apply({workbook:t},e){const n=t.sheet(e.sheet),o=[];for(const[s,i]of n.cells.entries(e.zone))(s!==e.zone.top||i!==e.zone.left)&&o.push([s,i,null]);const r=[];return o.length>0&&r.push(en(n,e.zone,o)),r.push({op:"merges",sheet:n.id,before:n.merges,after:[...n.merges,e.zone]}),r}},Nc={type:"UNMERGE",allow({workbook:t},e){const n=Ce(t,e.sheet);if($e(n))return n;const o=Rn(n,e.zone);return o.ok?n.mergesIn(e.zone).length===0?_("NoMerge","Nothing is merged there."):se:o},apply({workbook:t},e){const n=t.sheet(e.sheet),o=n.merges.filter(r=>!mt(r,e.zone));return[{op:"merges",sheet:n.id,before:n.merges,after:o}]}};function Ji(t,e,n){if(typeof e!="string"||e.trim()===""||e.length>31||/[\\/?*[\]:]/.test(e)||/^'|'$/.test(e))return _("InvalidSheetName",`'${String(e)}' is not a sheet name: 1 to 31 characters, none of \\ / ? * [ ] :, no leading or trailing '.`);const o=t.sheetByName(e);return o!==void 0&&o.id!==n?_("DuplicateSheetName",`A sheet is called '${e}' already.`):se}const Oc={type:"ADD_SHEET",allow({workbook:t},e){return e.at!==void 0&&(!Number.isInteger(e.at)||e.at<0||e.at>t.sheets.length)?_("OutOfBounds",`No tab position ${e.at}.`):e.id!==void 0&&t.hasSheet(e.id)?_("InvalidArgument",`A sheet has the id '${e.id}' already.`):e.name===void 0?se:Ji(t,e.name)},apply({workbook:t},e){const n=t.createSheet(e.name??t.freshSheetName(),e.id);return[{op:"sheet-add",index:e.at??t.sheets.length,sheet:n}]}},Ic={type:"DELETE_SHEET",allow({workbook:t},e){const n=Ce(t,e.sheet);return $e(n)?n:t.sheets.length===1?_("LastSheet","A workbook keeps at least one sheet."):se},apply({workbook:t},e){const n=t.sheet(e.sheet);return[{op:"sheet-delete",index:t.sheets.indexOf(n),sheet:n}]}},_c={type:"RENAME_SHEET",allow({workbook:t},e){const n=Ce(t,e.sheet);return $e(n)?n:Ji(t,e.name,e.sheet)},apply({workbook:t},e){const n=t.sheet(e.sheet);return[{op:"sheet-rename",sheet:n.id,before:n.name,after:e.name}]}},Lc={type:"MOVE_SHEET",allow({workbook:t},e){const n=Ce(t,e.sheet);return $e(n)?n:!Number.isInteger(e.to)||e.to<0||e.to>=t.sheets.length?_("OutOfBounds",`No tab position ${e.to}.`):se},apply({workbook:t},e){const n=t.sheets.indexOf(t.sheet(e.sheet));return n===e.to?[]:[{op:"sheet-move",from:n,to:e.to}]}},Dc={type:"FREEZE",allow({workbook:t},e){const n=Ce(t,e.sheet);if($e(n))return n;const o=(s,i)=>Number.isInteger(s)&&s>=0&&s<i;if(!o(e.rows,n.rows.count)||!o(e.cols,n.cols.count))return _("OutOfBounds",`Cannot freeze ${e.rows} rows and ${e.cols} columns.`);const r=s=>e.rows>0&&s.top<e.rows&&s.bottom>=e.rows||e.cols>0&&s.left<e.cols&&s.right>=e.cols;return n.merges.some(r)?_("MergeOverlap","A merge crosses the frozen edge."):se},apply({workbook:t},e){const n=t.sheet(e.sheet);return[{op:"frozen",sheet:n.id,before:n.frozen,after:{rows:e.rows,cols:e.cols}}]}},Uc=[kc,Sc,Cc,$c,Ac,Mc,Tc,Rc,zc,Nc,Oc,Ic,_c,Lc,Dc],Os=["width","height","dx","dy"],Fc="code",Is=["stream","display_data","execute_result","error"],_s=["source","language","outputs","result","executionCount","lastRun","run","frame"],yn=t=>typeof t=="object"&&t!==null&&!Array.isArray(t);function qi(t,e="code"){if(!yn(t))return`${e}: a code cell is { source, language, outputs, result, run }`;for(const r of Object.keys(t))if(!_s.includes(r))return`${e}.${r}: a code cell has ${_s.join(", ")} only`;if(typeof t.source!="string")return`${e}.source: the code, a string`;if(t.language!=="python")return`${e}.language: 'python'`;if(!Array.isArray(t.outputs))return`${e}.outputs: a list of nbformat outputs`;for(let r=0;r<t.outputs.length;r+=1){const s=t.outputs[r];if(!yn(s)||!Is.includes(s.output_type))return`${e}.outputs[${r}].output_type: one of ${Is.join(", ")}`}const n=t.result;if(!(n===null||typeof n=="string"||typeof n=="boolean"||typeof n=="number"&&Number.isFinite(n)||yn(n)&&Object.keys(n).length===1&&typeof n.error=="string"&&Cn(n.error)))return`${e}.result: a value (a number, a string, a boolean, null or { error })`;if(t.executionCount!==void 0&&!(Number.isInteger(t.executionCount)&&t.executionCount>=0))return`${e}.executionCount: a non-negative integer`;if(t.lastRun!==void 0&&(typeof t.lastRun!="string"||Number.isNaN(Date.parse(t.lastRun))))return`${e}.lastRun: an ISO time`;if(t.run!=="manual"&&t.run!=="auto")return`${e}.run: 'manual' or 'auto'`;if(t.frame!==void 0&&t.frame!==null){const r=t.frame;if(!yn(r))return`${e}.frame: { width, height } or null`;for(const s of Object.keys(r))if(!Os.includes(s))return`${e}.frame.${s}: a frame has ${Os.join(", ")} only`;for(const s of["width","height"])if(!(typeof r[s]=="number"&&r[s]>0&&Number.isFinite(r[s])))return`${e}.frame.${s}: a positive size in px`;for(const s of["dx","dy"])if(r[s]!==void 0&&!(typeof r[s]=="number"&&Number.isFinite(r[s])))return`${e}.frame.${s}: an offset in px, a finite number`}}function Qi(t,e={}){return{source:t,language:"python",outputs:[],result:null,run:"manual",...e}}function Pc(t){return yn(t)?{error:t.error}:t}const jc={width:360,height:240};function Wt(t){if(!(t.frame===null||t.outputs.length===0))return t.frame??jc}function ht(t,e,n){return`${t.rows.materialize(e)}.${t.cols.materialize(n)}`}function Bc(t,e,n){if(t.code.size!==0)return t.code.get(`${t.rows.idAt(e)}.${t.cols.idAt(n)}`)}function el(t,e){const[n,o]=e.split(".").map(Number),r=t.rows.indexOfId(n),s=t.cols.indexOfId(o);return r<0||s<0?void 0:{row:r,col:s}}function En(t){const e=[];for(const[n,o]of t.code){const r=el(t,n);r!==void 0&&e.push({...r,code:o})}return e.sort((n,o)=>n.row-o.row||n.col-o.col)}const et=(t,e)=>`${Ye(e)}${t+1}`,Hc={op:"code",apply(t,e){const n=t.sheet(e.sheet);e.after===null?n.code.delete(e.key):n.code.set(e.key,e.after)},invert:t=>({...t,before:t.after,after:t.before}),bytes:t=>256+JSON.stringify(t.after??t.before??{}).length*2,example:t=>({op:"code",sheet:"s1",key:ht(t.sheet("s1"),1,1),before:null,after:Qi("1 + 1")})};function Yc(t,e,n){const{type:o,...r}=t.styles.get(e);return t.styles.intern(n===void 0?r:{...r,type:n})}function Xc(t,e){const n=t.sheet(e.sheet),o=ht(n,e.row,e.col),r=n.code.get(o)??null,s={top:e.row,left:e.col,bottom:e.row,right:e.col},i=Kt(n,s),a=Mn(i)[0]?.[2],l=Yc(t,a?.style??0,e.code===null?void 0:Fc),c=e.code===null?l===0?null:{value:null,style:l}:{value:Pc(e.code.result),style:l},u={op:"cells",sheet:n.id,zone:s,before:i,after:Rt(c===null?[]:[[e.row,e.col,c]])};return[{op:"code",sheet:n.id,key:o,before:r,after:e.code},u]}const Wc={type:"SET_CODE",allow({workbook:t},e){if(!t.hasSheet(e.sheet))return _("UnknownSheet",`No sheet '${e.sheet}'.`);const n=t.sheet(e.sheet);if(!Number.isInteger(e.row)||!Number.isInteger(e.col)||e.row<0||e.col<0||e.row>=n.rows.count||e.col>=n.cols.count)return _("OutOfBounds",`No cell at row ${e.row}, column ${e.col}.`);if(e.code!==null){const r=qi(e.code);if(r!==void 0)return _("InvalidArgument",r)}const o=n.mergeAt(e.row,e.col);return o!==void 0&&(o.top!==e.row||o.left!==e.col)?_("MergeOverlap","A code cell cannot sit under a merge."):se},apply:({workbook:t},e)=>Xc(t,e)},un=0,Un=1<<30;class Ls{count;defaultSize;#e=new Int32Array(0);#t=0;#r=0;#o=Un;#s=null;#i=null;#n=null;constructor(e){if(!Number.isInteger(e.count)||e.count<1||e.count>Un-1)throw new Error(`An axis holds 1 to ${Un-1} indexes; ${e.count} was asked for.`);if(!(e.defaultSize>0))throw new Error(`An axis's default size must be positive; ${e.defaultSize} was given.`);this.count=e.count,this.defaultSize=e.defaultSize}idAt(e){return this.#y(e),e<this.#t?this.#e[e]:un+this.#r+(e-this.#t)}materialize(e){if(this.#y(e),e>=this.#t){const n=e+1-this.#t;this.#a(e+1);for(let o=0;o<n;o+=1)this.#e[this.#t+o]=un+this.#r+o;this.#r+=n,this.#t=e+1}return this.#e[e]}get materialized(){return this.#t}freshIds(e){const n=new Int32Array(e);for(let o=0;o<e;o+=1)n[o]=this.#o++;return n}#d(e,n){if(e.sizes!==null||e.hidden!==null)return!1;const o=this.#t-n;for(let r=0;r<n;r+=1){const s=this.count-n+r;if(s<o||e.ids[r]!==un+this.#r+(s-o))return!1}return!0}indexOfId(e){for(let n=0;n<this.#t;n+=1)if(this.#e[n]===e)return n;if(e>=un+this.#r&&e<Un){const n=this.#t+(e-un-this.#r);return n<this.count?n:-1}return-1}ids(){return this.#e.slice(0,this.#t)}segment(e,n){return this.#b(e,n,!1),{ids:Int32Array.from({length:n},(o,r)=>this.idAt(e+r)),sizes:this.#s===null?null:this.#s.slice(e,e+n),hidden:this.#n===null?null:Uint8Array.from({length:n},(o,r)=>this.isHidden(e+r)?1:0)}}insert(e,n,o){if(this.#b(e,n,!0),o!==void 0&&o.ids.length!==n)throw new Error(`insert: ${n} indexes but a segment of ${o.ids.length}.`);const r=this.segment(this.count-n,n);let s;if(o!==void 0)s=o.ids.slice();else{s=new Int32Array(n);for(let a=0;a<n;a+=1)s[a]=this.#o++}if(e>this.#t&&this.materialize(e-1),this.#a(Math.min(this.#t+n,this.count)),this.#e.copyWithin(e+n,e,Math.min(this.#t,this.count-n)),this.#e.set(s,e),this.#t=Math.min(this.#t+n,this.count),this.#s!==null||o?.sizes!=null||o?.hidden!=null){this.#f();const a=this.#s;if(a.copyWithin(e+n,e,this.count-n),o?.sizes?a.set(o.sizes,e):a.fill(this.defaultSize,e,e+n),(this.#n!==null||o?.hidden)&&(this.#n===null&&(this.#n=new Uint32Array(Math.ceil(this.count/32))),Ds(this.#n,this.count,e,n),o?.hidden))for(let l=0;l<n;l+=1)o.hidden[l]&&this.#m(e+l,!0);this.#c(e)}return{inserted:{ids:s,sizes:o?.sizes??null,hidden:o?.hidden??null},dropped:r}}delete(e,n,o){if(this.#b(e,n,!1),o!==void 0&&o.ids.length!==n)throw new Error(`delete: ${n} indexes but a tail of ${o.ids.length}.`);const r=this.segment(e,n);this.materialize(e+n-1);const s=o!==void 0&&!this.#d(o,n);if(s&&this.materialize(this.count-1),this.#e.copyWithin(e,e+n,this.#t),this.#t-=n,s&&(this.#e.set(o.ids,this.count-n),this.#t=this.count),this.#s!==null||o?.sizes!=null||o?.hidden!=null){this.#f();const a=this.#s;if(a.copyWithin(e,e+n,this.count),o?.sizes?a.set(o.sizes,this.count-n):a.fill(this.defaultSize,this.count-n,this.count),(this.#n!==null||o?.hidden)&&(this.#n===null&&(this.#n=new Uint32Array(Math.ceil(this.count/32))),Ds(this.#n,this.count,e,-n),o?.hidden))for(let l=0;l<n;l+=1)o.hidden[l]&&this.#m(this.count-n+l,!0);this.#c(e)}return r}move(e,n,o){if(this.#b(e,n,!1),!Number.isInteger(o)||o<0||o>this.count||o>=e&&o<=e+n)throw new Error(`Cannot move ${n} index(es) at ${e} to ${o}.`);const r=Math.min(e,o),s=Math.max(e+n,o);this.materialize(s-1);const i=a=>{const l=a.slice(e,e+n);o<e?(a.copyWithin(o+n,o,e),a.set(l,o)):(a.copyWithin(e,e+n,o),a.set(l,o-n))};if(i(this.#e),this.#s!==null){if(i(this.#s),this.#n!==null){const a=Float64Array.from({length:this.count},(l,c)=>c>=r&&c<s&&this.isHidden(c)?1:0);i(a);for(let l=r;l<s;l+=1)this.#m(l,a[l]===1)}this.#c(r)}}setSegmentSizes(e,n,o,r){if(this.#b(e,r,!1),!(n===null&&o===null&&this.#s===null)){if(this.#f(),n?this.#s.set(n,e):this.#s.fill(this.defaultSize,e,e+r),o||this.#n!==null){this.#n===null&&(this.#n=new Uint32Array(Math.ceil(this.count/32)));for(let s=0;s<r;s+=1)this.#m(e+s,o?o[s]===1:!1)}this.#c(e)}}sizeOf(e){return this.#y(e),this.#s===null?this.defaultSize:this.#s[e]}effectiveSizeOf(e){return this.isHidden(e)?0:this.sizeOf(e)}resize(e,n){if(this.#y(e),!(n>0)||!Number.isFinite(n))throw new Error(`A size must be positive; ${n} was given.`);this.#f();const o=this.effectiveSizeOf(e);this.#s[e]=n;const r=this.effectiveSizeOf(e);r!==o&&this.#h(e,r-o)}get customized(){return this.#s!==null}get hasHidden(){return this.#n!==null&&this.#n.some(e=>e!==0)}isHidden(e){this.#y(e);const n=this.#n;return n!==null&&(n[e>>>5]&1<<(e&31))!==0}setHidden(e,n){if(this.isHidden(e)===n)return;this.#f(),this.#n===null&&(this.#n=new Uint32Array(Math.ceil(this.count/32)));const o=this.#s[e];n?this.#n[e>>>5]|=1<<(e&31):this.#n[e>>>5]&=~(1<<(e&31)),this.#h(e,n?-o:o)}offsetOf(e){if(!Number.isInteger(e)||e<0||e>this.count)throw new Error(`No offset at index ${e} of an axis of ${this.count}.`);if(this.#i===null)return e*this.defaultSize;let n=0;for(let o=e;o>0;o-=o&-o)n+=this.#i[o];return n}get extent(){return this.offsetOf(this.count)}indexAt(e){if(e<=0)return this.#l(0);if(this.#i===null)return Math.min(Math.floor(e/this.defaultSize),this.count-1);const n=this.#i;let o=0,r=e;for(let s=Vc(this.count);s>0;s>>=1){const i=o+s;i<=this.count&&n[i]<=r&&(o=i,r-=n[i])}return Math.min(o,this.count-1)}#l(e){let n=e;for(;n<this.count-1&&this.effectiveSizeOf(n)===0;)n+=1;return n}#f(){this.#s===null&&(this.#s=new Float64Array(this.count).fill(this.defaultSize),this.#i=new Float64Array(this.count+1),this.#c(0))}#m(e,n){const o=this.#n;n?o[e>>>5]|=1<<(e&31):o[e>>>5]&=~(1<<(e&31))}#h(e,n){const o=this.#i;for(let r=e+1;r<=this.count;r+=r&-r)o[r]+=n}#c(e){const n=this.#i,o=this.count,r=e+1,s=this.#u(e),i=new Float64Array(o-e+1);i[0]=s;let a=s;for(let l=r;l<=o;l+=1){a+=this.effectiveSizeOf(l-1),i[l-e]=a;const c=l-(l&-l),u=c>=e?i[c-e]:this.#u(c);n[l]=a-u}}#u(e){const n=this.#i;let o=0;for(let r=e;r>0;r-=r&-r)o+=n[r];return o}#a(e){if(e<=this.#e.length)return;let n=Math.max(64,this.#e.length);for(;n<e;)n*=2;const o=new Int32Array(Math.min(n,this.count+1));o.set(this.#e.subarray(0,this.#t)),this.#e=o}#y(e){if(!Number.isInteger(e)||e<0||e>=this.count)throw new Error(`Index ${e} is outside an axis of ${this.count}.`)}#b(e,n,o){if(!Number.isInteger(n)||n<1)throw new Error(`A span needs at least one index; ${n} was given.`);if(!Number.isInteger(e)||e<0||e+n>this.count||o&&e>=this.count)throw new Error(`${n} index(es) at ${e} do not fit an axis of ${this.count}.`)}}function Vc(t){let e=1;for(;e*2<=t;)e*=2;return e}function Ds(t,e,n,o){const r=i=>(t[i>>>5]&1<<(i&31))!==0,s=(i,a)=>{a?t[i>>>5]|=1<<(i&31):t[i>>>5]&=~(1<<(i&31))};if(o>0){for(let i=e-1;i>=n+o;i-=1)s(i,r(i-o));for(let i=n;i<n+o;i+=1)s(i,!1)}else{const i=-o;for(let a=n;a<e-i;a+=1)s(a,r(a+i));for(let a=e-i;a<e;a+=1)s(a,!1)}}const ve=1024,ze=10,hn=ve-1;class Kc{source;cached;parsed;constructor(e,n,o=void 0){this.source=e,this.cached=n,this.parsed=o}}class Gc{#e=[];#t=[];add(e){const n=this.#t.pop()??this.#e.length;return this.#e[n]=e,n}get(e){const n=this.#e[e];if(n===void 0)throw new Error(`No formula at ${e} in the formula table.`);return n}remove(e){this.get(e),this.#e[e]=void 0,this.#t.push(e)}get size(){return this.#e.length-this.#t.length}forEach(e){for(const n of this.#e)n!==void 0&&e(n)}}function Fn(t,e){const n=new Array(e-t+1);for(let o=t;o<=e;o+=1)n[o-t]=o;return n}class Zc{kind=new Uint8Array(ve);num=new Float64Array(ve);ref=new Uint32Array(ve);style=new Uint16Array(ve);filled=0}class Jc{chunks=new Map}class qc{#e;#t=new Map;#r=0;constructor(e){this.#e=e}get filled(){return this.#r}get chunkCount(){let e=0;for(const n of this.#t.values())e+=n.chunks.size;return e}columnIndexes(){return this.#t.keys()}get(e,n){const o=this.#t.get(n)?.chunks.get(e>>>ze);if(o===void 0)return null;const r=e&hn;return o.kind[r]===0&&o.style[r]===0?null:this.#o(o,r)}styleAt(e,n){const o=this.#t.get(n)?.chunks.get(e>>>ze);return o===void 0?0:o.style[e&hn]}formulaAt(e,n){const o=this.#t.get(n)?.chunks.get(e>>>ze);if(o===void 0)return;const r=e&hn;return o.kind[r]===5?this.#e.formulas.get(o.ref[r]):void 0}numberAt(e,n){const o=this.#t.get(n)?.chunks.get(e>>>ze);if(o===void 0)return;const r=e&hn;return o.kind[r]===1?o.num[r]:void 0}set(e,n,o){let r=this.#t.get(n);const s=e>>>ze;let i=r?.chunks.get(s);const a=e&hn;if(i!==void 0&&this.#i(i,a),o===null||o.value===null&&o.formula===void 0&&o.style===0){i!==void 0&&i.filled===0&&(r.chunks.delete(s),r.chunks.size===0&&this.#t.delete(n));return}r===void 0&&(r=new Jc,this.#t.set(n,r)),i===void 0&&(i=new Zc,r.chunks.set(s,i)),this.#s(i,a,o)}*entries(e){const n=e!==void 0&&e.right-e.left<this.#t.size?Fn(e.left,e.right):[...this.#t.keys()].sort((o,r)=>o-r);for(const o of n){if(e&&(o<e.left||o>e.right))continue;const r=this.#t.get(o);if(r===void 0)continue;const s=e===void 0?0:e.top>>>ze,i=e===void 0?1/0:e.bottom>>>ze,a=i-s<r.chunks.size?Fn(s,i):[...r.chunks.keys()].sort((l,c)=>l-c);for(const l of a){const c=l<<ze;if(e&&(c+ve-1<e.top||c>e.bottom))continue;const u=r.chunks.get(l);if(u===void 0)continue;const h=e?Math.max(0,e.top-c):0,d=e?Math.min(ve-1,e.bottom-c):ve-1;for(let f=h;f<=d;f+=1)u.kind[f]===0&&u.style[f]===0||(yield[c+f,o,this.#o(u,f)])}}}scan(e,n){const o=e.right-e.left<this.#t.size?Fn(e.left,e.right):[...this.#t.keys()].sort((s,i)=>s-i),r=this.#e.strings;for(const s of o){if(s<e.left||s>e.right)continue;const i=this.#t.get(s);if(i===void 0)continue;const a=e.top>>>ze,l=e.bottom>>>ze,c=l-a<i.chunks.size?Fn(a,l):[...i.chunks.keys()].sort((u,h)=>u-h);for(const u of c){const h=u<<ze;if(h+ve-1<e.top||h>e.bottom)continue;const d=i.chunks.get(u);if(d===void 0)continue;const f=Math.max(0,e.top-h),m=Math.min(ve-1,e.bottom-h),{kind:g,num:w,ref:y}=d;for(let x=f;x<=m;x+=1)switch(g[x]){case 0:break;case 1:n(h+x,s,w[x],!1);break;case 3:n(h+x,s,w[x]!==0,!1);break;case 2:n(h+x,s,r.get(y[x]),!1);break;case 4:{const $=r.get(y[x]);if(!Cn($))throw new Error(`The store holds '${$}' as an error.`);n(h+x,s,Je($),!1);break}case 5:n(h+x,s,null,!0);break}}}}lastRowIn(e){const n=this.#t.get(e);if(n===void 0)return-1;const o=Math.max(...n.chunks.keys()),r=n.chunks.get(o);for(let s=ve-1;s>=0;s-=1)if(r.kind[s]!==0||r.style[s]!==0)return(o<<ze)+s;throw new Error("A kept chunk holds nothing: the store is inconsistent.")}isEmpty(e){for(const n of this.entries(e))return!1;return!0}shiftRows(e,n,o){for(const[r,s]of[...this.#t]){const i=[];for(const[a,l]of[...s.chunks]){const c=a<<ze;if(!(c+ve-1<e))for(let u=0;u<ve;u+=1){const h=c+u;if(h<e||l.kind[u]===0&&l.style[u]===0)continue;const d=this.#o(l,u);if(this.set(h,r,null),n<0&&h<e-n)continue;const f=h+n;f<o&&i.push([f,d])}}for(const[a,l]of i)this.set(a,r,l)}}shiftCols(e,n,o){const r=[...this.#t.keys()].filter(s=>s>=e).sort((s,i)=>n>0?i-s:s-i);for(const s of r){const i=this.#t.get(s);if(this.#t.delete(s),n<0&&s<e-n){for(const[l,c]of i.chunks)for(let u=0;u<ve;u+=1)this.#i(c,u);continue}const a=s+n;if(a<o)this.#t.set(a,i);else for(const l of i.chunks.values())for(let c=0;c<ve;c+=1)this.#i(l,c)}}#o(e,n){const o=e.style[n];switch(e.kind[n]){case 0:return{value:null,style:o};case 1:return{value:e.num[n],style:o};case 3:return{value:e.num[n]!==0,style:o};case 2:return{value:this.#e.strings.get(e.ref[n]),style:o};case 4:{const r=this.#e.strings.get(e.ref[n]);if(!Cn(r))throw new Error(`The store holds '${r}' as an error.`);return{value:Je(r),style:o}}case 5:{const r=this.#e.formulas.get(e.ref[n]);return{value:r.cached,formula:r.source,style:o}}}}#s(e,n,o){const{value:r,formula:s,style:i}=o;if(!Number.isInteger(i)||i<0||i>65535)throw new Error(`No style index ${i}.`);if(e.style[n]=i,s!==void 0)e.kind[n]=5,e.ref[n]=this.#e.formulas.add(new Kc(s,r));else if(r===null)e.kind[n]=0;else if(typeof r=="number"){if(!Number.isFinite(r))throw new Error(`A cell cannot hold ${r}; use an error value.`);e.kind[n]=1,e.num[n]=r}else if(typeof r=="boolean")e.kind[n]=3,e.num[n]=r?1:0;else if(typeof r=="string")e.kind[n]=2,e.ref[n]=this.#e.strings.intern(r);else if(j(r))e.kind[n]=4,e.ref[n]=this.#e.strings.intern(r.error);else throw new Error(`A cell cannot hold ${JSON.stringify(r)}.`);e.filled+=1,this.#r+=1}#i(e,n){const o=e.kind[n];o===0&&e.style[n]===0||(o===2||o===4?this.#e.strings.release(e.ref[n]):o===5&&this.#e.formulas.remove(e.ref[n]),e.kind[n]=0,e.num[n]=0,e.ref[n]=0,e.style[n]=0,e.filled-=1,this.#r-=1)}}class Qc{#e=[];#t=new Int32Array(64);#r=new Map;#o=[];intern(e){let n=this.#r.get(e);if(n===void 0&&(n=this.#o.pop()??this.#e.length,this.#e[n]=e,this.#r.set(e,n),n>=this.#t.length)){const o=new Int32Array(this.#t.length*2);o.set(this.#t),this.#t=o}return this.#t[n]+=1,n}release(e){const n=this.#e[e];if(n===void 0||this.#t[e]<=0)throw new Error(`The string pool holds nothing at ${e}: released twice?`);this.#t[e]-=1,this.#t[e]===0&&(this.#e[e]=void 0,this.#r.delete(n),this.#o.push(e))}get(e){const n=this.#e[e];if(n===void 0)throw new Error(`The string pool holds nothing at ${e}.`);return n}get size(){return this.#r.size}references(e){return this.#t[e]??0}}const Lr={rows:1048576,cols:16384,rowHeight:21,colWidth:100};class eu{id;name;rows;cols;cells;merges=[];frozen={rows:0,cols:0};charts=new Map;code=new Map;dataSource=null;constructor(e,n,o,r){this.id=e,this.name=n,this.rows=new Ls({count:o.rows,defaultSize:o.rowHeight}),this.cols=new Ls({count:o.cols,defaultSize:o.colWidth}),this.cells=r}mergeAt(e,n){return this.merges.find(o=>e>=o.top&&e<=o.bottom&&n>=o.left&&n<=o.right)}mergesIn(e){return this.merges.filter(n=>mt(n,e))}}class tu{limits;sheetIdPrefix="s";strings=new Qc;styles=new La;formulas=new Gc;sheets=[];#e=1;constructor(e=Lr){for(const[n,o]of Object.entries(e))if(!(typeof o=="number"&&o>0))throw new Error(`limits.${n} must be positive; ${o} was given.`);this.limits=e}createSheet(e,n){const o=n??this.#t();if(this.sheets.some(r=>r.id===o))throw new Error(`A sheet with id '${o}' exists already.`);return new eu(o,e,this.limits,new qc({strings:this.strings,formulas:this.formulas}))}sheet(e){const n=this.sheets.find(o=>o.id===e);if(n===void 0)throw new Error(`No sheet '${e}'; the workbook has ${this.sheets.map(o=>o.id).join(", ")||"none"}.`);return n}hasSheet(e){return this.sheets.some(n=>n.id===e)}sheetByName(e){const n=e.toLowerCase();return this.sheets.find(o=>o.name.toLowerCase()===n)}freshSheetName(){for(let e=1;;e+=1)if(this.sheetByName(`Sheet${e}`)===void 0)return`Sheet${e}`}#t(){for(;;){const e=`${this.sheetIdPrefix}${this.#e++}`;if(!this.hasSheet(e))return e}}}class ct{#e;#t;#r;#o=-1;#s=new Map;#i=[];constructor(e,n,o){this.#e=e,this.#t=n,this.#r=o}get(e){return this.#n(),this.#s.get(e)}all(){return this.#n(),this.#i}keys(){return this.#n(),this.#s.keys()}get revision(){return this.#n(),this.#o}#n(){const e=this.#e.getRevision();if(e===this.#o)return;const n=this.#e.getContributions(this.#t),o=new Map,r=[];for(const s of n){const i=nu(s,this.#r),a=this.#r.key(s.value),l=o.get(a);if(l!==void 0)throw new Error(`The ${this.#r.label} '${a}' is contributed twice to ${this.#t.id}: by ${l.plugin} (id '${l.id}') and by ${s.plugin} (id '${s.id}'). Disable one of the two plugins, or rename one ${this.#r.label}.`);o.set(a,i),r.push(i)}this.#o=e,this.#s=o,this.#i=r}}function nu(t,e){if(e.check)try{e.check(t.value)}catch(n){throw new Error(`${t.plugin} contributes a malformed ${e.label} (id '${t.id}'): ${n.message}`)}return{value:t.value,plugin:t.plugin,id:t.id}}function tl(t,e,n){const o=t.getContributions(e),[r,s]=o;if(r!==void 0){if(s!==void 0&&s.order===r.order)throw new Error(`Two plugins contribute a ${n} (${e.id}) at the same order ${r.order}: ${r.plugin} (id '${r.id}') and ${s.plugin} (id '${s.id}'). Give one a lower order, or disable one.`);return{value:r.value,plugin:r.plugin,id:r.id}}}const Dr=pe("datalayer.cells.patchOp"),Zt=pe("datalayer.cells.command"),Ur=pe("datalayer.cells.function"),Fr=pe("datalayer.cells.cellType"),nl=pe("datalayer.cells.renderLayer"),Tt=pe("datalayer.cells.clipboard"),Pr=pe("datalayer.cells.fillRule"),ou=pe("datalayer.cells.importer"),ol=pe("datalayer.cells.exporter"),go=pe("datalayer.cells.dataSource"),ru=pe("datalayer.cells.collabProvider"),rl=pe("datalayer.cells.codeRenderer"),sl=pe("datalayer.cells.kernel"),po=pe("datalayer.cells.toolbarItem"),qe=pe("datalayer.cells.menuItem"),jr=pe("datalayer.cells.chartType"),il=pe("datalayer.cells.chartOption"),Br=pe("datalayer.cells.chartRenderer"),ll=sa("datalayer.cells.gate.edit"),su=[Dr,Zt,Ur,Fr,nl,Tt,Pr,ou,ol,go,ru,po,qe,jr,il,Br,ll,sl,rl],Fe=1024,iu=256;function kn(t){return{top:t.at.row,left:t.at.col,bottom:t.at.row+t.rows-1,right:t.at.col+t.cols-1}}const lu={op:"dataSource",apply(t,e){t.sheet(e.sheet).dataSource=e.after===null?null:{...e.after,at:{...e.after.at}}},invert:t=>({...t,before:t.after,after:t.before}),example:()=>({op:"dataSource",sheet:"s1",before:null,after:{id:"example",at:{row:1,col:1},rows:10,cols:2}})},au={type:"BIND_DATA_SOURCE",allow(t,e){const{workbook:n}=t;if(!n.hasSheet(e.sheet))return _("UnknownSheet",`No sheet '${e.sheet}'.`);const o=n.sheet(e.sheet);if(e.source===null)return o.dataSource===null?_("InvalidArgument",`Sheet '${o.name}' is bound to no data source.`):{ok:!0};if(typeof e.source!="string"||e.source==="")return _("InvalidArgument","BIND_DATA_SOURCE names a data source by id, or null.");const r=t.contributions(go).find(u=>u.id===e.source);if(r===void 0)return _("UnknownDataSource",`No plugin contributes the data source '${e.source}'.`);const s=e.at??{row:0,col:0},i=u=>Number.isInteger(u)&&u>=0;if(!i(s.row)||!i(s.col))return _("InvalidArgument","BIND_DATA_SOURCE lands at a cell: { row, col }.");if(o.dataSource!==null)return _("InvalidArgument",`Sheet '${o.name}' is bound to the data source '${o.dataSource.id}' already; unbind it first.`);const a=r.rowCount,l=r.columns.length;if(a<1||l<1)return _("InvalidArgument",`The data source '${r.id}' has no rows or no columns.`);if(s.row+a>o.rows.count||s.col+l>o.cols.count)return _("OutOfBounds",`The data source '${r.id}' has ${a.toLocaleString("en-US")} rows and ${l} columns: from ${Oe({top:s.row,left:s.col,bottom:s.row,right:s.col})} it reaches past the sheet's ${o.rows.count.toLocaleString("en-US")} rows and ${o.cols.count.toLocaleString("en-US")} columns.`);const c=kn({id:r.id,at:s,rows:a,cols:l});return o.cells.isEmpty(c)?o.mergesIn(c).length>0?_("MergeOverlap",`${Oe(c)} holds merges; a data source lands on plain cells.`):{ok:!0}:_("InvalidArgument",`${Oe(c)} holds cells; a data source lands on empty cells.`)},apply(t,e){const n=t.workbook.sheet(e.sheet),o=n.dataSource;if(e.source===null)return[{op:"dataSource",sheet:n.id,before:o,after:null}];const r=t.contributions(go).find(i=>i.id===e.source),s={id:r.id,at:e.at??{row:0,col:0},rows:r.rowCount,cols:r.columns.length};return[{op:"dataSource",sheet:n.id,before:o,after:s}]}};class cu{#e;#t;#r;#o;#s;#i=new Map;#n=new Map;stats={resident:0,loading:0,failed:0,fetches:0,evictions:0};constructor(e,n,o){if(this.#e=e,this.#t=n,this.#r=o.pages??iu,!(Number.isInteger(this.#r)&&this.#r>=1))throw new Error(`dataSources.pages is a positive integer; ${String(o.pages)} was given.`);this.#o=o.onWritten,this.#s=o.onError}get capacity(){return this.#r}resolve(e){if(!this.#e.hasSheet(e))return;const n=this.#e.sheet(e).dataSource;if(n===null)return;const o=this.#t.revision,r=this.#n.get(e);return r!==void 0&&r.revision===o&&r.binding===n?r.out:this.#d(e,n,o,r)}#d(e,n,o,r){const s=kn(n),i=this.#t.get(n.id);let a;return i===void 0?a={binding:n,zone:s,problem:`No plugin contributes the data source '${n.id}'.`}:i.value.rowCount!==n.rows||i.value.columns.length!==n.cols?a={binding:n,zone:s,problem:`The data source '${n.id}' has ${i.value.rowCount.toLocaleString("en-US")} rows and ${i.value.columns.length} columns; the sheet binds ${n.rows.toLocaleString("en-US")} rows and ${n.cols} columns. Bind it again.`}:a={binding:n,zone:s,source:i},this.#n.set(e,{revision:o,binding:n,out:a}),r!==void 0&&r.binding===n&&r.out.source!==a.source&&this.forget(e),a}zoneOf(e){return this.resolve(e)?.zone}missing(e,n,o){const r=e.dataSource;if(r===null||n<r.at.row||n>=r.at.row+r.rows||o<r.at.col||o>=r.at.col+r.cols)return;const s=this.resolve(e.id);if(s.source===void 0)return Je("#N/A",s.problem);const i=Math.floor((n-s.zone.top)/Fe),a=this.#f(e.id,i,s);if(a.state!=="resident")return this.#l(a,s)}ensureZone(e,n){const o=this.resolve(e);if(o===void 0||!mt(o.zone,n))return;if(o.source===void 0)return Je("#N/A",o.problem);const r=Math.max(n.top,o.zone.top),s=Math.min(n.bottom,o.zone.bottom),i=Math.floor((r-o.zone.top)/Fe),a=Math.floor((s-o.zone.top)/Fe),l=a-i+1;if(l>this.#r)return Je("#N/A",`Reading ${Oe(n)} needs ${l.toLocaleString("en-US")} pages of the data source '${o.binding.id}'; ${this.#r} stay resident. Read a smaller range.`);let c;for(let u=i;u<=a;u+=1){const h=this.#f(e,u,o);h.state!=="resident"&&c===void 0&&(c=this.#l(h,o))}return c}forget(e){for(const[n,o]of[...this.#i])o.sheet===e&&this.#u(n,o,!0)}forgetAll(){this.#i.clear(),this.#n.clear(),this.stats.resident=0,this.stats.loading=0,this.stats.failed=0}willApply(e){if(e.op!=="dataSource")return;const{sheet:n,before:o,after:r}=e;o!==null&&(r===null||r.id!==o.id||r.rows!==o.rows||r.cols!==o.cols)&&this.forget(n)}refuses(e){const n=[...e.filter(o=>o.op.startsWith("axis-")),...e.filter(o=>!o.op.startsWith("axis-"))];for(const o of n){const r=o.sheet;if(typeof r!="string"||!this.#e.hasSheet(r))continue;const s=this.#e.sheet(r).dataSource;if(s===null)continue;const i=kn(s),a=l=>_("ReadOnly",`${Oe(i)} shows the data source '${s.id}' and cannot be changed${l}.`);if(o.op==="cells"){if(mt(o.zone,i))return a("")}else if(o.op==="merges"){if(o.after.some(c=>mt(c,i)))return a(": no merge over it")}else if(o.op==="axis-insert"||o.op==="axis-delete"||o.op==="axis-move"){const l=o,c=l.axis==="rows"?i.top:i.left,u=l.axis==="rows"?i.bottom:i.right,h=f=>f>c&&f<=u,d=l.at<=u&&l.at+l.n-1>=c;if(o.op==="axis-insert"&&h(l.at))return a(`: no ${l.axis} inserted inside it`);if(o.op==="axis-delete"&&d)return a(`: no ${l.axis} deleted from it`);if(o.op==="axis-move"&&(d||h(l.to)))return a(`: no ${l.axis} moved into or out of it`)}}}#l(e,n){return e.state==="failed"?Je("#N/A",`The data source '${n.binding.id}' failed for rows ${(e.index*Fe+1).toLocaleString("en-US")}–${Math.min((e.index+1)*Fe,n.binding.rows).toLocaleString("en-US")}: ${e.error}`):Je("#BUSY!",`The data source '${n.binding.id}' is reading rows ${(e.index*Fe+1).toLocaleString("en-US")}–${Math.min((e.index+1)*Fe,n.binding.rows).toLocaleString("en-US")}.`)}#f(e,n,o){const r=`${e}:${n}`,s=this.#i.get(r);if(s!==void 0)return this.#i.delete(r),this.#i.set(r,s),s;const i={sheet:e,index:n,state:"loading"};this.#i.set(r,i),this.stats.loading+=1,this.stats.fetches+=1;const a=n*Fe,l=Math.min(a+Fe-1,o.binding.rows-1),c=o.source.value,u=(h,d)=>{if(!(this.#i.get(r)!==i||i.state!=="loading")){if(this.stats.loading-=1,d===void 0&&h!==void 0&&(Array.isArray(h)&&h.length===o.binding.cols?h.find(m=>!Array.isArray(m)||m.length!==l-a+1):h)!==void 0&&(d=new Error(`the data source '${c.id}' answered ${Array.isArray(h)?h.length:"no"} columns for rows ${a+1}–${l+1}, not ${o.binding.cols} columns of ${l-a+1} rows.`)),d!==void 0){i.state="failed",i.error=d.message,this.stats.failed+=1,this.#s({sheet:e,source:c.id,rows:{from:a,to:l},error:d}),this.#o(e,this.#m(o,n));return}this.#c(i),i.state="resident",this.stats.resident+=1,this.#h(e,o,n,h,a,l),this.#o(e,this.#m(o,n))}};try{Promise.resolve(c.fetch({from:a,to:l})).then(h=>u(h,void 0),h=>u(void 0,h instanceof Error?h:new Error(String(h))))}catch(h){u(void 0,h instanceof Error?h:new Error(String(h)))}return i}#m(e,n){const o=e.zone;return{top:o.top+n*Fe,left:o.left,bottom:Math.min(o.top+(n+1)*Fe-1,o.bottom),right:o.right}}#h(e,n,o,r,s,i){const a=this.#e.sheet(e).cells,l=n.zone;for(let c=0;c<r.length;c+=1){const u=l.left+c,h=r[c];for(let d=0;d<=i-s;d+=1){const f=h[d],m=l.top+s+d;f!=null&&a.set(m,u,{value:f,style:a.styleAt(m,u)})}}}#c(e){for(;this.stats.resident>=this.#r;){let n;for(const o of this.#i)if(o[1].state==="resident"&&o[1]!==e){n=o;break}if(n===void 0)return;this.#u(n[0],n[1],!0),this.stats.evictions+=1}}#u(e,n,o){if(this.#i.delete(e),n.state==="resident"?this.stats.resident-=1:n.state==="loading"?this.stats.loading-=1:this.stats.failed-=1,n.state!=="resident"||!o)return;const r=this.#e.sheet(n.sheet).dataSource;if(r===null)return;const s=this.#m({binding:r,zone:kn(r)},n.index),i=this.#e.sheet(n.sheet).cells;for(const[a,l]of[...i.entries(s)])i.set(a,l,null);this.#o(n.sheet,s)}}function uu(t){return t.dataSource===null?void 0:kn(t.dataSource)}const mr=1;class al extends Error{}function B(t,e){throw new al(`${t}: ${e}`)}const xe=t=>typeof t=="object"&&t!==null&&!Array.isArray(t),Xo=(t,e)=>/^(0|[1-9][0-9]*)$/.test(t)&&Number(t)<e;function hu(t,e){if(!(t===null||typeof t=="string"||typeof t=="boolean")){if(typeof t=="number"){Number.isFinite(t)||B(e(),`${t} is not a value`);return}if(xe(t)&&typeof t.error=="string"&&Object.keys(t).length===1){Cn(t.error)||B(e(),`'${t.error}' is not an error code`);return}B(e(),`${JSON.stringify(t)} is not a value (a number, a string, a boolean, null or { error })`)}}function fu(t,e,n){xe(t)||B(e,"a zone is { top, left, bottom, right }");for(const a of["top","left","bottom","right"])(!Number.isInteger(t[a])||t[a]<0)&&B(`${e}.${a}`,"a non-negative integer");const{top:o,left:r,bottom:s,right:i}=t;(o>s||r>i)&&B(e,"top-left after bottom-right"),(s>=n.rows||i>=n.cols)&&B(e,"outside the sheet")}function cl(t,e=Lr){xe(t)||B("workbook","a CellsWorkbook is a JSON object"),t.version!==mr&&B("version",`this is format version ${JSON.stringify(t.version)}; Cells reads version ${mr}`);const n=t.styles??[];Array.isArray(n)||B("styles","a list"),n.forEach((s,i)=>zr(s,`styles[${i}]`)),n.length>0&&Object.keys(n[0]).length>0&&B("styles[0]","style 0 is the default: {}"),(!Array.isArray(t.sheets)||t.sheets.length===0)&&B("sheets","a non-empty list");const o=new Set,r=new Set;return t.sheets.forEach((s,i)=>{const a=`sheets[${i}]`;xe(s)||B(a,"a sheet is an object"),(typeof s.id!="string"||s.id==="")&&B(`${a}.id`,"a non-empty string"),o.has(s.id)&&B(`${a}.id`,`'${s.id}' is used twice`),o.add(s.id),(typeof s.name!="string"||s.name.trim()==="")&&B(`${a}.name`,"a non-empty string"),r.has(s.name.toLowerCase())&&B(`${a}.name`,`'${s.name}' is used twice`),r.add(s.name.toLowerCase()),xe(s.rows)||B(`${a}.rows`,"an object keyed by row index");for(const l in s.rows){const c=s.rows[l],u=()=>`${a}.rows["${l}"]`;Xo(l,e.rows)||B(u(),`'${l}' is not a row index below ${e.rows}`),(!xe(c)||!xe(c.cells))&&B(u(),"a row is { cells: { … } }");const h=c.cells;for(const d in h){const f=h[d],m=()=>`${u()}.cells["${d}"]`;Xo(d,e.cols)||B(m(),`'${d}' is not a column index below ${e.cols}`),xe(f)||B(m(),"a cell is { v?, f?, s? }");for(const g in f)g!=="v"&&g!=="f"&&g!=="s"&&B(`${m()}.${g}`,"a cell has v, f and s only");"v"in f&&hu(f.v,()=>`${m()}.v`),"f"in f&&(typeof f.f!="string"||f.f==="")&&B(`${m()}.f`,"a formula without the ="),"s"in f&&(!Number.isInteger(f.s)||f.s<0||f.s>=Math.max(1,n.length))&&B(`${m()}.s`,`no style ${JSON.stringify(f.s)}`)}}if(s.sizes!==void 0){xe(s.sizes)||B(`${a}.sizes`,"{ rows?, cols? }");for(const l of["rows","cols"]){const c=s.sizes[l];if(c!==void 0){xe(c)||B(`${a}.sizes.${l}`,"an object keyed by index");for(const[u,h]of Object.entries(c))Xo(u,e[l])||B(`${a}.sizes.${l}["${u}"]`,"not an index of the sheet"),typeof h=="number"&&h>0&&Number.isFinite(h)||B(`${a}.sizes.${l}["${u}"]`,"a positive size")}}}if(s.hidden!==void 0){xe(s.hidden)||B(`${a}.hidden`,"{ rows?, cols? }");for(const l of["rows","cols"]){const c=s.hidden[l];c!==void 0&&(Array.isArray(c)||B(`${a}.hidden.${l}`,"a list of indexes"),c.forEach((u,h)=>{(!Number.isInteger(u)||u<0||u>=e[l])&&B(`${a}.hidden.${l}[${h}]`,"not an index of the sheet")}))}}if(s.merges!==void 0&&(Array.isArray(s.merges)||B(`${a}.merges`,"a list of zones"),s.merges.forEach((l,c)=>fu(l,`${a}.merges[${c}]`,e))),s.charts!==void 0){xe(s.charts)||B(`${a}.charts`,"an object of charts by id");for(const[l,c]of Object.entries(s.charts)){const u=`${a}.charts["${l}"]`,h=ji(c,u,e);h.id!==l&&B(`${u}.id`,`the chart is filed under '${l}' and says '${h.id}'`)}}if(s.code!==void 0){xe(s.code)||B(`${a}.code`,"an object of code cells by cell (B4)");for(const[l,c]of Object.entries(s.code)){const u=`${a}.code["${l}"]`,h=/^([A-Z]{1,3})([1-9][0-9]*)$/.exec(l);let d=-1;if(h!==null)for(const m of h[1])d=(d+1)*26+m.charCodeAt(0)-65;(h===null||Number(h[2])>e.rows||d>=e.cols)&&B(u,`'${l}' is not a cell of the sheet`);const f=qi(c,u);if(f!==void 0)throw new al(f)}}if(s.dataSource!==void 0){const l=s.dataSource,c=`${a}.dataSource`;xe(l)||B(c,"{ id, row, col, rows, cols }"),(typeof l.id!="string"||l.id==="")&&B(`${c}.id`,"the id of a data source");for(const u of["row","col","rows","cols"])(!Number.isInteger(l[u])||l[u]<0)&&B(`${c}.${u}`,"a non-negative integer");for(const u of["rows","cols"])l[u]<1&&B(`${c}.${u}`,"at least 1");(l.row+l.rows>e.rows||l.col+l.cols>e.cols)&&B(c,"reaches outside the sheet")}if(s.frozen!==void 0){const l=s.frozen;(!xe(l)||!Number.isInteger(l.rows)||!Number.isInteger(l.cols)||l.rows<0||l.cols<0)&&B(`${a}.frozen`,"{ rows, cols }, non-negative integers")}}),t}const Us=t=>t==null?null:typeof t=="object"?Je(t.error):t,du=t=>j(t)?{error:t.error}:t;function Fs(t,e){if(t.sheets.length>0)throw new Error("loadInto fills an empty workbook.");const n=cl(e,t.limits),o=(n.styles??[]).map(r=>t.styles.intern(r));for(const r of n.sheets){const s=t.createSheet(r.name,r.id);for(const i in r.rows){const a=Number(i),l=r.rows[i].cells;for(const c in l){const u=l[c],h=u.s===void 0?0:o[u.s]??0,d=u.f===void 0?{value:Us(u.v),style:h}:{value:Us(u.v),formula:u.f,style:h};s.cells.set(a,Number(c),d)}}for(const i of["rows","cols"]){const a=i==="rows"?s.rows:s.cols;for(const[l,c]of Object.entries(r.sizes?.[i]??{}))a.resize(Number(l),c);for(const l of r.hidden?.[i]??[])a.setHidden(l,!0)}s.merges=(r.merges??[]).map(i=>({...i}));for(const[i,a]of Object.entries(r.charts??{}))s.charts.set(i,a);for(const[i,a]of Object.entries(r.code??{})){const l=/^([A-Z]+)([0-9]+)$/.exec(i);let c=-1;for(const u of l[1])c=(c+1)*26+u.charCodeAt(0)-65;s.code.set(ht(s,Number(l[2])-1,c),a)}s.frozen=r.frozen?{rows:r.frozen.rows,cols:r.frozen.cols}:{rows:0,cols:0},s.dataSource=r.dataSource?{id:r.dataSource.id,at:{row:r.dataSource.row,col:r.dataSource.col},rows:r.dataSource.rows,cols:r.dataSource.cols}:null,t.sheets.push(s)}}function mu(t){const e=new Map([[0,0]]),n=[{}],o=s=>{let i=e.get(s);return i===void 0&&(i=n.length,n.push(t.styles.get(s)),e.set(s,i)),i},r=t.sheets.map(s=>{const i={},a=uu(s),l=[...s.cells.entries()].filter(([f,m])=>a===void 0||!zt(a,{row:f,col:m})).sort((f,m)=>f[0]-m[0]||f[1]-m[1]);for(const[f,m,g]of l){const w={};g.value!==null&&(w.v=du(g.value)),g.formula!==void 0&&(w.f=g.formula),g.style!==0&&(w.s=o(g.style)),(i[f]??={cells:{}}).cells[m]=w}const c={id:s.id,name:s.name,rows:i},u={},h={};for(const f of["rows","cols"]){const m=f==="rows"?s.rows:s.cols,g=gu(m);Object.keys(g.sizes).length>0&&(u[f]=g.sizes),g.hidden.length>0&&(h[f]=g.hidden)}Object.keys(u).length>0&&(c.sizes=u),Object.keys(h).length>0&&(c.hidden=h),s.merges.length>0&&(c.merges=s.merges.map(f=>({...f}))),(s.frozen.rows>0||s.frozen.cols>0)&&(c.frozen={...s.frozen}),s.charts.size>0&&(c.charts=Object.fromEntries(s.charts));const d={};for(const[f,m]of s.code){const g=el(s,f);g!==void 0&&(d[et(g.row,g.col)]=m)}return Object.keys(d).length>0&&(c.code=Object.fromEntries(Object.entries(d).sort(([f],[m])=>f.localeCompare(m)))),s.dataSource!==null&&(c.dataSource={id:s.dataSource.id,row:s.dataSource.at.row,col:s.dataSource.at.col,rows:s.dataSource.rows,cols:s.dataSource.cols}),c});return{version:mr,sheets:r,styles:n}}function gu(t){const e={},n=[];if(!t.customized)return{sizes:e,hidden:n};for(let o=0;o<t.count;o+=1){const r=t.sizeOf(o);r!==t.defaultSize&&(e[o]=r),t.isHidden(o)&&n.push(o)}return{sizes:e,hidden:n}}const ul={steps:500,bytes:64*1024*1024};class pu{limits;#e=[];#t=[];#r=0;constructor(e=ul){if(!(e.steps>=1)||!(e.bytes>=1))throw new Error("History limits must be positive.");this.limits=e}push(e){this.#e.push(e),this.#r+=e.bytes;for(const n of this.#t)this.#r-=n.bytes;for(this.#t=[];this.#e.length>this.limits.steps||this.#r>this.limits.bytes&&this.#e.length>1;)this.#r-=this.#e.shift().bytes}popUndo(){const e=this.#e.pop();return e&&this.#t.push(e),e}popRedo(){const e=this.#t.pop();return e&&this.#e.push(e),e}get canUndo(){return this.#e.length>0}get canRedo(){return this.#t.length>0}get size(){return{steps:this.#e.length,bytes:this.#r}}get undoLabel(){return this.#e.at(-1)?.label}get redoLabel(){return this.#t.at(-1)?.label}clear(){this.#e=[],this.#t=[],this.#r=0}}const wo=1;function hl(t,e={}){return e.transpose?{rows:t.cols,cols:t.rows}:{rows:t.rows,cols:t.cols}}function fl(t){const e=t;if(typeof t!="object"||t===null)throw new Error("A clipboard slice is an object.");if(e.version!==wo)throw new Error(`This clipboard slice is version ${String(e.version)}; Cells reads version ${wo}.`);if(!Number.isInteger(e.rows)||!Number.isInteger(e.cols)||e.rows<1||e.cols<1)throw new Error("A clipboard slice has a size of at least one cell.");if(typeof e.parts!="object"||e.parts===null)throw new Error("A clipboard slice has parts.")}function wu(t,e,n){const{workbook:o}=t,r=o.sheet(e),s=[];for(const[i,a,l]of r.cells.entries(n)){const c=l.style===0?void 0:o.styles.get(l.style),u=l.formula===void 0?l.value:t.value(e,i,a);s.push({r:i-n.top,c:a-n.left,...u!==null?{v:u}:{},...l.formula!==void 0?{f:l.formula}:{},...c?{style:c}:{}})}return s}function yu(t,e,n,o,r,s){const i=t.workbook,a=i.sheet(e),l={rows:a.rows.count,cols:a.cols.count},c=r.special??"all",u=[],h=new Set;for(const d of n){const[f,m]=r.transpose?[d.c,d.r]:[d.r,d.c],g=o.top+f,w=o.left+m,y=a.cells.get(g,w);h.add(`${g},${w}`);const x=c==="values"||c==="formulas"?y?.style??0:d.style?i.styles.intern(d.style):0;if(c==="formats")u.push([g,w,y===null?{value:null,style:x}:{...y,style:x}]);else if(c==="values"||d.f===void 0)u.push([g,w,{value:d.v??null,style:x}]);else{const $=s&&{row:s.zone.top+d.r,col:s.zone.left+d.c},A=s===void 0||s.cut?d.f:r.transpose?sc(d.f,$,{row:g,col:w},l):Or(d.f,g-$.row,w-$.col,l);u.push([g,w,{value:null,formula:A,style:x}])}}for(const[d,f,m]of a.cells.entries(o))h.has(`${d},${f}`)||(c==="all"?u.push([d,f,null]):c==="values"||c==="formulas"?u.push([d,f,{value:null,style:m.style}]):u.push([d,f,{...m,style:0}]));return en(a,o,u)}function dl(t,e){return{top:t.row,left:t.col,bottom:t.row+e.rows-1,right:t.col+e.cols-1}}function bu(t,e){if(!t.workbook.hasSheet(e.sheet))return _("UnknownSheet",`No sheet '${e.sheet}'.`);try{fl(e.slice)}catch(r){return _("InvalidArgument",r.message)}const n=t.workbook.sheet(e.sheet),o=dl(e.at,hl(e.slice,e.options));if(o.top<0||o.left<0||o.bottom>=n.rows.count||o.right>=n.cols.count)return _("OutOfBounds",`The paste of ${o.bottom-o.top+1} × ${o.right-o.left+1} cells reaches past the end of the sheet.`);for(const r of n.mergesIn(o))if(!(r.top>=o.top&&r.bottom<=o.bottom&&r.left>=o.left&&r.right<=o.right))return _("MergeOverlap","The paste would cut a merged cell in two; unmerge it first.");return se}function xu(t){const e=n=>/[\t\n\r"]/.test(n)?`"${n.replace(/"/g,'""')}"`:n;return t.map(n=>n.map(e).join(" ")).join(`
3
3
  `)}function vu(t){const e=[];let n=[],o="",r=!1;const s=t.replace(/\r\n?/g,`
4
4
  `).replace(/\n$/,"");for(let i=0;i<s.length;i+=1){const a=s[i];r?a==='"'&&s[i+1]==='"'?(o+='"',i+=1):a==='"'?r=!1:o+=a:a==='"'&&o===""?r=!0:a===" "?(n.push(o),o=""):a===`
@@ -84,4 +84,4 @@ ${n.text.slice(ie.selectionEnd)}`)}else R.key==="Enter"?(R.preventDefault(),xt({
84
84
  grid full ${o.gridFull} · partial ${o.gridPartial} · blits ${o.blits} · overlay ${o.overlay}
85
85
  painted ${o.cells} cells, ${o.texts} texts
86
86
  text cache ${s.size} · hit ${i} %
87
- cells ${r.cells.toLocaleString()} · chunks ${r.chunks} · strings ${r.strings} · styles ${r.styles}`})}const rm="@datalayer/cells-charts",dm=ha({name:rm,displayName:"Cells charts",description:"Column, bar, line, area, pie, scatter and combo charts, drawn with Apache ECharts.",octicon:"graph",activationEvents:[fs(jr),fs(Br)],load:()=>Ri(()=>import("./plugin-BFdQv_3f.js"),[],import.meta.url)});function mm(t){const{sheets:e,active:n,add:o,rename:r,move:s,remove:i,activate:a}=Hf(),[l,c]=k.useState(null),[u,h]=k.useState(""),d=k.useRef(new Map),f=()=>{if(l===null)return;const y=r(l.id,l.name.trim());y.ok?(c(null),h("")):h(y.refusals.map(x=>x.message).join(" "))},m=(y,x)=>{const $=e.length,A=y.key==="ArrowRight"?(x+1)%$:y.key==="ArrowLeft"?(x+$-1)%$:y.key==="Home"?0:y.key==="End"?$-1:void 0;A!==void 0?(y.preventDefault(),a(e[A].id),d.current.get(e[A].id)?.focus()):y.key==="F2"&&(y.preventDefault(),c({id:e[x].id,name:e[x].name}))},g=e.findIndex(y=>y.id===n),w=e[g];return C.jsxs("div",{"data-cells-sheet-tabs":"",style:{display:"flex",alignItems:"center",gap:4,padding:4},children:[C.jsx("div",{role:"tablist","aria-label":t["aria-label"]??"Sheets",style:{display:"flex",gap:2},children:e.map((y,x)=>{const $=y.id===n;return C.jsx("button",{ref:A=>{d.current.set(y.id,A)},role:"tab",type:"button","aria-selected":$,tabIndex:$?0:-1,onClick:()=>a(y.id),onDoubleClick:()=>c({id:y.id,name:y.name}),onKeyDown:A=>m(A,x),style:{padding:"2px 10px",border:"1px solid var(--borderColor-muted, #d0d7de)",borderBottom:$?"2px solid var(--borderColor-accent-emphasis, #0969da)":void 0,background:$?"var(--bgColor-default, #fff)":"var(--bgColor-muted, #f6f8fa)",color:"var(--fgColor-default, #1f2328)",fontWeight:$?600:400,cursor:"pointer"},children:y.name},y.id)})}),l!==null&&C.jsx(fa,{"aria-label":`Rename ${e.find(y=>y.id===l.id)?.name??""}`,size:"small",autoFocus:!0,value:l.name,onChange:y=>c({id:l.id,name:y.target.value}),onBlur:f,onKeyDown:y=>{y.key==="Enter"?(y.preventDefault(),f()):y.key==="Escape"&&(c(null),h(""))}}),C.jsx(ds,{icon:da,"aria-label":"Add a sheet",size:"small",variant:"invisible",onClick:()=>{const y=o();y.ok||h(y.refusals.map(x=>x.message).join(" "))}}),w!==void 0&&C.jsxs(Uo,{children:[C.jsx(Uo.Anchor,{children:C.jsx(ds,{icon:ma,"aria-label":`More for ${w.name}`,size:"small",variant:"invisible"})}),C.jsx(Uo.Overlay,{children:C.jsxs(Be,{children:[C.jsx(Be.Item,{onSelect:()=>c({id:w.id,name:w.name}),children:"Rename"}),C.jsx(Be.Item,{disabled:g===0,onSelect:()=>s(w.id,g-1),children:"Move left"}),C.jsx(Be.Item,{disabled:g===e.length-1,onSelect:()=>s(w.id,g+1),children:"Move right"}),C.jsx(Be.Divider,{}),C.jsx(Be.Item,{variant:"danger",disabled:e.length===1,onSelect:()=>{const y=i(w.id);y.ok||h(y.refusals.map(x=>x.message).join(" "))},children:"Delete"})]})})]}),u&&C.jsx("span",{role:"alert",style:{color:"var(--fgColor-danger, #d1242f)"},children:u})]})}export{Hi as A,im as B,po as C,jr as D,Br as E,fm as S,am as a,cm as b,Ye as c,Bf as d,_f as e,um as f,hm as g,lm as h,j as i,Pf as j,mm as k,If as l,dm as m,Jt as n,qi as o,Cn as p,Wr as q,Li as r,hc as s,Or as t,yt as u,Yh as v,fr as w,Yi as x,dr as y,Oe as z};
87
+ cells ${r.cells.toLocaleString()} · chunks ${r.chunks} · strings ${r.strings} · styles ${r.styles}`})}const rm="@datalayer/cells-charts",dm=ha({name:rm,displayName:"Cells charts",description:"Column, bar, line, area, pie, scatter and combo charts, drawn with Apache ECharts.",octicon:"graph",activationEvents:[fs(jr),fs(Br)],load:()=>Ri(()=>import("./plugin-Bvp_HQZg.js"),[],import.meta.url)});function mm(t){const{sheets:e,active:n,add:o,rename:r,move:s,remove:i,activate:a}=Hf(),[l,c]=k.useState(null),[u,h]=k.useState(""),d=k.useRef(new Map),f=()=>{if(l===null)return;const y=r(l.id,l.name.trim());y.ok?(c(null),h("")):h(y.refusals.map(x=>x.message).join(" "))},m=(y,x)=>{const $=e.length,A=y.key==="ArrowRight"?(x+1)%$:y.key==="ArrowLeft"?(x+$-1)%$:y.key==="Home"?0:y.key==="End"?$-1:void 0;A!==void 0?(y.preventDefault(),a(e[A].id),d.current.get(e[A].id)?.focus()):y.key==="F2"&&(y.preventDefault(),c({id:e[x].id,name:e[x].name}))},g=e.findIndex(y=>y.id===n),w=e[g];return C.jsxs("div",{"data-cells-sheet-tabs":"",style:{display:"flex",alignItems:"center",gap:4,padding:4},children:[C.jsx("div",{role:"tablist","aria-label":t["aria-label"]??"Sheets",style:{display:"flex",gap:2},children:e.map((y,x)=>{const $=y.id===n;return C.jsx("button",{ref:A=>{d.current.set(y.id,A)},role:"tab",type:"button","aria-selected":$,tabIndex:$?0:-1,onClick:()=>a(y.id),onDoubleClick:()=>c({id:y.id,name:y.name}),onKeyDown:A=>m(A,x),style:{padding:"2px 10px",border:"1px solid var(--borderColor-muted, #d0d7de)",borderBottom:$?"2px solid var(--borderColor-accent-emphasis, #0969da)":void 0,background:$?"var(--bgColor-default, #fff)":"var(--bgColor-muted, #f6f8fa)",color:"var(--fgColor-default, #1f2328)",fontWeight:$?600:400,cursor:"pointer"},children:y.name},y.id)})}),l!==null&&C.jsx(fa,{"aria-label":`Rename ${e.find(y=>y.id===l.id)?.name??""}`,size:"small",autoFocus:!0,value:l.name,onChange:y=>c({id:l.id,name:y.target.value}),onBlur:f,onKeyDown:y=>{y.key==="Enter"?(y.preventDefault(),f()):y.key==="Escape"&&(c(null),h(""))}}),C.jsx(ds,{icon:da,"aria-label":"Add a sheet",size:"small",variant:"invisible",onClick:()=>{const y=o();y.ok||h(y.refusals.map(x=>x.message).join(" "))}}),w!==void 0&&C.jsxs(Uo,{children:[C.jsx(Uo.Anchor,{children:C.jsx(ds,{icon:ma,"aria-label":`More for ${w.name}`,size:"small",variant:"invisible"})}),C.jsx(Uo.Overlay,{children:C.jsxs(Be,{children:[C.jsx(Be.Item,{onSelect:()=>c({id:w.id,name:w.name}),children:"Rename"}),C.jsx(Be.Item,{disabled:g===0,onSelect:()=>s(w.id,g-1),children:"Move left"}),C.jsx(Be.Item,{disabled:g===e.length-1,onSelect:()=>s(w.id,g+1),children:"Move right"}),C.jsx(Be.Divider,{}),C.jsx(Be.Item,{variant:"danger",disabled:e.length===1,onSelect:()=>{const y=i(w.id);y.ok||h(y.refusals.map(x=>x.message).join(" "))},children:"Delete"})]})})]}),u&&C.jsx("span",{role:"alert",style:{color:"var(--fgColor-danger, #d1242f)"},children:u})]})}export{Yi as A,im as B,po as C,dr as D,Hi as E,fm as S,am as a,cm as b,Ye as c,Bf as d,_f as e,um as f,hm as g,lm as h,j as i,Pf as j,mm as k,If as l,dm as m,Jt as n,jr as o,Br as p,qi as q,Cn as r,Wr as s,Or as t,yt as u,Li as v,hc as w,Yh as x,fr as y,Oe as z};