@datalayer/agent-runtimes 1.6.95 → 1.6.96

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 (362) hide show
  1. package/dist-embed/chunks/{AgentDetails-BvfdY3uO.js → AgentDetails-Ddc6d7Vb.js} +1 -1
  2. package/dist-embed/chunks/{AgentDetailsDialog-fQMt4AfV.js → AgentDetailsDialog-BqYyyNpE.js} +1 -1
  3. package/dist-embed/chunks/{AgentInspector-Bk_6hnzQ.js → AgentInspector-Dwh_YetA.js} +1 -1
  4. package/dist-embed/chunks/{AgentInspectorDialog-COpHclrh.js → AgentInspectorDialog-Cau9xrvM.js} +1 -1
  5. package/dist-embed/chunks/{CellSidebarExtension-BSomRlJ-.js → CellSidebarExtension-DSNmntUX.js} +7 -7
  6. package/dist-embed/chunks/{ChatView-C8fvqoAH.js → ChatView-Dzy1KRzJ.js} +4 -4
  7. package/dist-embed/chunks/{CollapsiblePlugin-BcCRY7vG.js → CollapsiblePlugin-DmoruakD.js} +1 -1
  8. package/dist-embed/chunks/{ContextPie-BHsXiDRO.js → ContextPie-x_xvOUQW.js} +1 -1
  9. package/dist-embed/chunks/{DeckComponent-DGJwaGWE.js → DeckComponent-B2pu-8Gg.js} +1 -1
  10. package/dist-embed/chunks/{DeckRenderer-B8PqIWaS.js → DeckRenderer-BitpK9Co.js} +2 -2
  11. package/dist-embed/chunks/{DeckStage-b6WCYIrt.js → DeckStage-D4emgALl.js} +3 -3
  12. package/dist-embed/chunks/{DocumentView-2NxPEuqp.js → DocumentView-GCdq20sR.js} +1 -1
  13. package/dist-embed/chunks/{EphemeralDocument-GaUco3ov.js → EphemeralDocument-BxEBdArS.js} +1 -1
  14. package/dist-embed/chunks/{EphemeralNotebook-DBs08R5-.js → EphemeralNotebook-iWR0tOaY.js} +1 -1
  15. package/dist-embed/chunks/{ExcalidrawComponent-vHJ6t4Sx.js → ExcalidrawComponent-BNE0rUus.js} +1 -1
  16. package/dist-embed/chunks/{ExcalidrawModal-DwWGmnRQ.js → ExcalidrawModal-B0d7EMm1.js} +1 -1
  17. package/dist-embed/chunks/{FormulaBar-CPCjPhlD.js → FormulaBar-BBm1JXuS.js} +1 -1
  18. package/dist-embed/chunks/{JupyterLexicalExtension-Df6IrbR-.js → JupyterLexicalExtension-DEiuU9XK.js} +29 -29
  19. package/dist-embed/chunks/{KernelVariables-oNW3cYs4.js → KernelVariables-BehGjCby.js} +1 -1
  20. package/dist-embed/chunks/{LexicalToolRegistry-CxE-muFM.js → LexicalToolRegistry-CjiooYJz.js} +1 -1
  21. package/dist-embed/chunks/{NotebookToolSurfaces-B3MY-vYT.js → NotebookToolSurfaces-D2niRSgN.js} +1 -1
  22. package/dist-embed/chunks/{NotebookView-B84bIB_s.js → NotebookView--XqCYFyy.js} +1 -1
  23. package/dist-embed/chunks/{Output-DbuS5mTW.js → Output-DIp_tlWH.js} +6 -6
  24. package/dist-embed/chunks/{SandboxDetailsDialog-DxyOgkVN.js → SandboxDetailsDialog-DXoy-U_w.js} +1 -1
  25. package/dist-embed/chunks/{SchemaForm-BpQuFPdH.js → SchemaForm-Cmv4n0Os.js} +1 -1
  26. package/dist-embed/chunks/{SheetStage-C6XKe73k.js → SheetStage-CPrhxiEk.js} +1 -1
  27. package/dist-embed/chunks/{SheetTabs-L2YN86GJ.js → SheetTabs-CIoATuqe.js} +1 -1
  28. package/dist-embed/chunks/SpreadsheetPreviewView-DA_p2PVw.js +1 -0
  29. package/dist-embed/chunks/{SpreadsheetView-DCMl89-H.js → SpreadsheetView-D6J2ll9x.js} +1 -1
  30. package/dist-embed/chunks/TripMapView-Chu4CxoP.js +800 -0
  31. package/dist-embed/chunks/{WidgetVariableView-tHluwrGK.js → WidgetVariableView-pK_kA46x.js} +1 -1
  32. package/dist-embed/chunks/{YouTubePlugin-C-3vxmlQ.js → YouTubePlugin-DkAnyShg.js} +1 -1
  33. package/dist-embed/chunks/{abnfDiagram-VCTEODGH-Bhd2l8QD.js → abnfDiagram-VCTEODGH-CX9mMYXT.js} +1 -1
  34. package/dist-embed/chunks/{abnfDiagram-VCTEODGH-kVHfIAbZ.js → abnfDiagram-VCTEODGH-D1af2ghA.js} +1 -1
  35. package/dist-embed/chunks/{abnfDiagram-VCTEODGH-BCGK5XKK.js → abnfDiagram-VCTEODGH-Ri346RDd.js} +1 -1
  36. package/dist-embed/chunks/{ar-SA-G6X2FPQ2-UWUqTy-K.js → ar-SA-G6X2FPQ2-CXTKdzGs.js} +1 -1
  37. package/dist-embed/chunks/{architectureDiagram-5GKGNRK7-DXEtcMhi.js → architectureDiagram-5GKGNRK7-2OGYSHGz.js} +1 -1
  38. package/dist-embed/chunks/{architectureDiagram-5GKGNRK7-BV0c57bp.js → architectureDiagram-5GKGNRK7-C0-0iqdj.js} +1 -1
  39. package/dist-embed/chunks/{architectureDiagram-5GKGNRK7-Fw3FuyyK.js → architectureDiagram-5GKGNRK7-CsLrz5V8.js} +1 -1
  40. package/dist-embed/chunks/{az-AZ-76LH7QW2-DWmo_K9N.js → az-AZ-76LH7QW2-C2FVIwGa.js} +1 -1
  41. package/dist-embed/chunks/{bg-BG-XCXSNQG7-DEIS8jN8.js → bg-BG-XCXSNQG7-Do7qP3y5.js} +1 -1
  42. package/dist-embed/chunks/{blockDiagram-868be97b-atYMh58B.js → blockDiagram-868be97b-CCPwkNQD.js} +1 -1
  43. package/dist-embed/chunks/{blockDiagram-I7D4REHJ-B5YMuboC.js → blockDiagram-I7D4REHJ-BwtxKaHd.js} +1 -1
  44. package/dist-embed/chunks/{blockDiagram-I7D4REHJ-c2uxRyEL.js → blockDiagram-I7D4REHJ-Dkac8pDH.js} +1 -1
  45. package/dist-embed/chunks/{blockDiagram-I7D4REHJ-2Nx-2jmD.js → blockDiagram-I7D4REHJ-DuFs7Ehc.js} +1 -1
  46. package/dist-embed/chunks/{bn-BD-2XOGV67Q-CdGydfQA.js → bn-BD-2XOGV67Q-CncsPSj6.js} +1 -1
  47. package/dist-embed/chunks/browser-CjxI_vdc.js +1 -0
  48. package/dist-embed/chunks/{c4Diagram-3f4bdde3-DrAykr_M.js → c4Diagram-3f4bdde3-BLw1hbRS.js} +1 -1
  49. package/dist-embed/chunks/{c4Diagram-7LVT6UL2-CxQfmxDp.js → c4Diagram-7LVT6UL2-COW8SWY8.js} +1 -1
  50. package/dist-embed/chunks/{c4Diagram-7LVT6UL2-D9KYeQdn.js → c4Diagram-7LVT6UL2-Cvhvycsr.js} +1 -1
  51. package/dist-embed/chunks/{c4Diagram-7LVT6UL2-CCUWeXWN.js → c4Diagram-7LVT6UL2-Db67ewBM.js} +1 -1
  52. package/dist-embed/chunks/{ca-ES-6MX7JW3Y-Cmxh4hHb.js → ca-ES-6MX7JW3Y-C0yxvCPt.js} +1 -1
  53. package/dist-embed/chunks/{celltoolbartracker-6bzTgI7x.js → celltoolbartracker-BEMovM_S.js} +1 -1
  54. package/dist-embed/chunks/{chunk-2Q5K7J3B-BlidW8Ew.js → chunk-2Q5K7J3B-Ct-A4CCZ.js} +1 -1
  55. package/dist-embed/chunks/{chunk-2Q5K7J3B-C81BMfQj.js → chunk-2Q5K7J3B-Dth1v10p.js} +1 -1
  56. package/dist-embed/chunks/{chunk-2Q5K7J3B-pB9xAJMI.js → chunk-2Q5K7J3B-TussmrZx.js} +1 -1
  57. package/dist-embed/chunks/{chunk-5VM5RSS4-1bQxgqop.js → chunk-5VM5RSS4--_g5ThPK.js} +1 -1
  58. package/dist-embed/chunks/{chunk-5VM5RSS4-BLaN6vZP.js → chunk-5VM5RSS4-EV3_59Fj.js} +1 -1
  59. package/dist-embed/chunks/{chunk-5VM5RSS4-BTk_puBE.js → chunk-5VM5RSS4-PCyW8e7X.js} +1 -1
  60. package/dist-embed/chunks/{chunk-F27PBJKO-Ccv2Z4Dk.js → chunk-F27PBJKO-BEGqbZOG.js} +1 -1
  61. package/dist-embed/chunks/{chunk-F27PBJKO-V8QZRvNX.js → chunk-F27PBJKO-BElpQlek.js} +1 -1
  62. package/dist-embed/chunks/{chunk-F27PBJKO-DIaRuD6P.js → chunk-F27PBJKO-D_dK9KO0.js} +1 -1
  63. package/dist-embed/chunks/{chunk-IMKFNOWR-ChFGHsmA.js → chunk-IMKFNOWR-63rCyYBN.js} +1 -1
  64. package/dist-embed/chunks/{chunk-IMKFNOWR-C6EghkRl.js → chunk-IMKFNOWR-CXlJYg5e.js} +1 -1
  65. package/dist-embed/chunks/{chunk-IMKFNOWR-eUuKtHwj.js → chunk-IMKFNOWR-CvHJsrEQ.js} +1 -1
  66. package/dist-embed/chunks/{chunk-JWPE2WC7-DaXZnYxt.js → chunk-JWPE2WC7-DjRqg4Bs.js} +1 -1
  67. package/dist-embed/chunks/{chunk-JWPE2WC7-C_--LD31.js → chunk-JWPE2WC7-KjfHmyaP.js} +1 -1
  68. package/dist-embed/chunks/{chunk-JWPE2WC7-TEJpnjgJ.js → chunk-JWPE2WC7-i03aNExK.js} +1 -1
  69. package/dist-embed/chunks/{chunk-POPQ4Y6H-C2h36Rd-.js → chunk-POPQ4Y6H-8SJD7Lj6.js} +1 -1
  70. package/dist-embed/chunks/{chunk-POPQ4Y6H-DFDiDT07.js → chunk-POPQ4Y6H-CTgPwukU.js} +1 -1
  71. package/dist-embed/chunks/{chunk-POPQ4Y6H-DE45RGQz.js → chunk-POPQ4Y6H-DD_FZOBG.js} +1 -1
  72. package/dist-embed/chunks/{chunk-SVP7TREG-NHZa_Cm7.js → chunk-SVP7TREG-Be_dVsBv.js} +1 -1
  73. package/dist-embed/chunks/{chunk-SVP7TREG-DuvZnJuX.js → chunk-SVP7TREG-BmKcdcZf.js} +1 -1
  74. package/dist-embed/chunks/{chunk-SVP7TREG-CguX5xuV.js → chunk-SVP7TREG-oWMhd7-x.js} +1 -1
  75. package/dist-embed/chunks/{chunk-TICWLB2K-DZSn1hoa.js → chunk-TICWLB2K-BWrWaYZh.js} +1 -1
  76. package/dist-embed/chunks/{chunk-TICWLB2K-C6yeHtH-.js → chunk-TICWLB2K-DPw0Zd3X.js} +1 -1
  77. package/dist-embed/chunks/{chunk-TICWLB2K-CdnwBh6S.js → chunk-TICWLB2K-oYX1pnTC.js} +1 -1
  78. package/dist-embed/chunks/{chunk-XXDRQBXY-CkHqIglg.js → chunk-XXDRQBXY-B_8mfvZs.js} +1 -1
  79. package/dist-embed/chunks/{chunk-XXDRQBXY-BfS84YmJ.js → chunk-XXDRQBXY-ClhwppX9.js} +1 -1
  80. package/dist-embed/chunks/{chunk-XXDRQBXY-DgalMoCT.js → chunk-XXDRQBXY-DFqSJS_V.js} +1 -1
  81. package/dist-embed/chunks/{classDiagram-ZZMXUADV-3ejDnz-R.js → classDiagram-ZZMXUADV--KG2C8h5.js} +1 -1
  82. package/dist-embed/chunks/{classDiagram-ZZMXUADV-BBfLN17b.js → classDiagram-ZZMXUADV-B7xDgsRr.js} +1 -1
  83. package/dist-embed/chunks/{classDiagram-ZZMXUADV-ClDeAawy.js → classDiagram-ZZMXUADV-DE4to6sK.js} +1 -1
  84. package/dist-embed/chunks/{classDiagram-f62afe4f-BkVbm46G.js → classDiagram-f62afe4f-Dc6e8Her.js} +1 -1
  85. package/dist-embed/chunks/{classDiagram-v2-604399ef-CHjLgl6H.js → classDiagram-v2-604399ef-C495Aipq.js} +1 -1
  86. package/dist-embed/chunks/{classDiagram-v2-VYDZK3BY-3ejDnz-R.js → classDiagram-v2-VYDZK3BY--KG2C8h5.js} +1 -1
  87. package/dist-embed/chunks/{classDiagram-v2-VYDZK3BY-BBfLN17b.js → classDiagram-v2-VYDZK3BY-B7xDgsRr.js} +1 -1
  88. package/dist-embed/chunks/{classDiagram-v2-VYDZK3BY-ClDeAawy.js → classDiagram-v2-VYDZK3BY-DE4to6sK.js} +1 -1
  89. package/dist-embed/chunks/{code-block-IT6T5CEO-Wkpbh9X2.js → code-block-IT6T5CEO-iJrkFsOH.js} +1 -1
  90. package/dist-embed/chunks/{component-CyKYadVm.js → component-DrP6jrik.js} +1 -1
  91. package/dist-embed/chunks/{core-COPCyO2o.js → core-BGGgYrZ9.js} +1 -1
  92. package/dist-embed/chunks/{cose-bilkent-JH36ORCC-5e8DCgyb.js → cose-bilkent-JH36ORCC-Bsk4YY80.js} +1 -1
  93. package/dist-embed/chunks/{cose-bilkent-JH36ORCC-Bi-L9aFT.js → cose-bilkent-JH36ORCC-MSc1rEXR.js} +1 -1
  94. package/dist-embed/chunks/{cose-bilkent-JH36ORCC-CG1KcI5m.js → cose-bilkent-JH36ORCC-tnzM7MrS.js} +1 -1
  95. package/dist-embed/chunks/{createText-aed3d8b3-dWIlVV-C.js → createText-aed3d8b3-PiG8oTtZ.js} +1 -1
  96. package/dist-embed/chunks/{cs-CZ-2BRQDIVT-B1CoQCS8.js → cs-CZ-2BRQDIVT-BlipVn6W.js} +1 -1
  97. package/dist-embed/chunks/{cynefinDiagram-5FMLGOSQ-DsvgMVdR.js → cynefinDiagram-5FMLGOSQ-BJSLWLpL.js} +1 -1
  98. package/dist-embed/chunks/{cynefinDiagram-5FMLGOSQ-CMqYhCCV.js → cynefinDiagram-5FMLGOSQ-CBkkpqSz.js} +1 -1
  99. package/dist-embed/chunks/{cynefinDiagram-5FMLGOSQ-BVOqZUM5.js → cynefinDiagram-5FMLGOSQ-Cxd4hJ0P.js} +1 -1
  100. package/dist-embed/chunks/{da-DK-5WZEPLOC-cOefviqg.js → da-DK-5WZEPLOC-Bw6Ix-Y_.js} +1 -1
  101. package/dist-embed/chunks/{dagre-GXQ25YYZ-Dv7BBqJM.js → dagre-GXQ25YYZ-CkLWQcoy.js} +1 -1
  102. package/dist-embed/chunks/{dagre-GXQ25YYZ-DB5hgFOJ.js → dagre-GXQ25YYZ-DmOK599e.js} +1 -1
  103. package/dist-embed/chunks/{dagre-GXQ25YYZ-DbL89rL1.js → dagre-GXQ25YYZ-u0MmbdNG.js} +1 -1
  104. package/dist-embed/chunks/{de-DE-XR44H4JA-B8A_EIdX.js → de-DE-XR44H4JA-hT0iw9Bo.js} +1 -1
  105. package/dist-embed/chunks/{diagram-S7CK7UJ4-DH-JGQ3O.js → diagram-S7CK7UJ4--1SOVzNY.js} +1 -1
  106. package/dist-embed/chunks/{diagram-S7CK7UJ4-Djh1lnDY.js → diagram-S7CK7UJ4-B7IcrsxK.js} +1 -1
  107. package/dist-embed/chunks/{diagram-S7CK7UJ4-_oQjxS8J.js → diagram-S7CK7UJ4-D0ZMd2cK.js} +1 -1
  108. package/dist-embed/chunks/{diagram-UQ7AKVKN-DrVhyvuK.js → diagram-UQ7AKVKN-CR9r4bhp.js} +1 -1
  109. package/dist-embed/chunks/{diagram-UQ7AKVKN-CkvISpbc.js → diagram-UQ7AKVKN-CZAZODO9.js} +1 -1
  110. package/dist-embed/chunks/{diagram-UQ7AKVKN-rAdoD-XE.js → diagram-UQ7AKVKN-DGk1jOrN.js} +1 -1
  111. package/dist-embed/chunks/{diagram-VSXAHHWV-6xNoFc1e.js → diagram-VSXAHHWV-BGuGdwAu.js} +1 -1
  112. package/dist-embed/chunks/{diagram-VSXAHHWV-BWRulDaN.js → diagram-VSXAHHWV-CPR3SHv_.js} +1 -1
  113. package/dist-embed/chunks/{diagram-VSXAHHWV-Kq0WyfDW.js → diagram-VSXAHHWV-DO0L5yoE.js} +1 -1
  114. package/dist-embed/chunks/{diagram-VX7I27RA-BSENIJml.js → diagram-VX7I27RA-BOMRUaLY.js} +1 -1
  115. package/dist-embed/chunks/{diagram-VX7I27RA-pBVtEscQ.js → diagram-VX7I27RA-BfmIQLZX.js} +1 -1
  116. package/dist-embed/chunks/{diagram-VX7I27RA-B5e3Qv0x.js → diagram-VX7I27RA-DMRKeXbI.js} +1 -1
  117. package/dist-embed/chunks/{diagram-Z3DM3KII-DkTW7b_d.js → diagram-Z3DM3KII-B2OiuH_C.js} +1 -1
  118. package/dist-embed/chunks/{diagram-Z3DM3KII-dQNfxGJA.js → diagram-Z3DM3KII-DAiKcNEv.js} +1 -1
  119. package/dist-embed/chunks/{diagram-Z3DM3KII-CCtO4ivG.js → diagram-Z3DM3KII-DKDeEH1W.js} +1 -1
  120. package/dist-embed/chunks/{ebnfDiagram-PWID7BFC-fRVaHZix.js → ebnfDiagram-PWID7BFC-Cru7ooRB.js} +1 -1
  121. package/dist-embed/chunks/{ebnfDiagram-PWID7BFC-DFo1owyO.js → ebnfDiagram-PWID7BFC-DRjyqxcH.js} +1 -1
  122. package/dist-embed/chunks/{ebnfDiagram-PWID7BFC-DhashMjX.js → ebnfDiagram-PWID7BFC-uMVSPDOp.js} +1 -1
  123. package/dist-embed/chunks/{edges-b2856ca0-CxR_AYFU.js → edges-b2856ca0-Cggl2xrH.js} +1 -1
  124. package/dist-embed/chunks/{el-GR-BZB4AONW-r6OOggAo.js → el-GR-BZB4AONW-BmNYPiJK.js} +1 -1
  125. package/dist-embed/chunks/{erDiagram-5d81789a-pWCuXn86.js → erDiagram-5d81789a-CGBXBycw.js} +1 -1
  126. package/dist-embed/chunks/{erDiagram-RLTQ6QDP-qBMO3ODf.js → erDiagram-RLTQ6QDP-CN1X55A5.js} +1 -1
  127. package/dist-embed/chunks/{erDiagram-RLTQ6QDP-Cn71QFng.js → erDiagram-RLTQ6QDP-CSpJrmyr.js} +1 -1
  128. package/dist-embed/chunks/{erDiagram-RLTQ6QDP-C1-L32ui.js → erDiagram-RLTQ6QDP-DIFLAmTe.js} +1 -1
  129. package/dist-embed/chunks/{es-ES-U4NZUMDT-B_e9d454.js → es-ES-U4NZUMDT-CE7hUJnw.js} +1 -1
  130. package/dist-embed/chunks/{esm-BBkfzxv_.js → esm-Bs-8Cbf_.js} +1 -1
  131. package/dist-embed/chunks/{esm-DEiQo7YS.js → esm-CsO1ipmZ.js} +1 -1
  132. package/dist-embed/chunks/{eu-ES-A7QVB2H4-Blt0C5Cr.js → eu-ES-A7QVB2H4-BUk5broy.js} +1 -1
  133. package/dist-embed/chunks/{fa-IR-HGAKTJCU-CTozxxBD.js → fa-IR-HGAKTJCU-DvlFAlYH.js} +1 -1
  134. package/dist-embed/chunks/{fi-FI-Z5N7JZ37-CyAB-y-D.js → fi-FI-Z5N7JZ37-DzF1j0vM.js} +1 -1
  135. package/dist-embed/chunks/{flowDb-185abca5-mGOFN4Rm.js → flowDb-185abca5-CR_eNtea.js} +1 -1
  136. package/dist-embed/chunks/{flowDiagram-1629c991-BpFY8YdN.js → flowDiagram-1629c991-BUCdGiy7.js} +1 -1
  137. package/dist-embed/chunks/{flowDiagram-HODETNUW-Bid_pFDK.js → flowDiagram-HODETNUW-40v2AZyg.js} +1 -1
  138. package/dist-embed/chunks/{flowDiagram-HODETNUW-luWVHeDm.js → flowDiagram-HODETNUW-Ehnca2ni.js} +1 -1
  139. package/dist-embed/chunks/{flowDiagram-HODETNUW-DK6nfPXm.js → flowDiagram-HODETNUW-rrCrE8ag.js} +1 -1
  140. package/dist-embed/chunks/{flowDiagram-v2-1d953310-D6OBW8Rm.js → flowDiagram-v2-1d953310-C-mQVR3d.js} +1 -1
  141. package/dist-embed/chunks/{flowchart-elk-definition-6df44142-BVaCKHm8.js → flowchart-elk-definition-6df44142-BUjCU9MT.js} +1 -1
  142. package/dist-embed/chunks/{fr-FR-RHASNOE6-DqQdDGJI.js → fr-FR-RHASNOE6-DGF_Vyig.js} +1 -1
  143. package/dist-embed/chunks/{ganttDiagram-3b0b3873-Cv_0V3zO.js → ganttDiagram-3b0b3873-CU1sjzSg.js} +1 -1
  144. package/dist-embed/chunks/{ganttDiagram-EL5Y4UJY-m6mZe7W0.js → ganttDiagram-EL5Y4UJY-B2NVsC-C.js} +1 -1
  145. package/dist-embed/chunks/{ganttDiagram-EL5Y4UJY-DZHrkG45.js → ganttDiagram-EL5Y4UJY-BHLbHQvv.js} +1 -1
  146. package/dist-embed/chunks/{ganttDiagram-EL5Y4UJY--60tKSM9.js → ganttDiagram-EL5Y4UJY-CL_uGZmq.js} +1 -1
  147. package/dist-embed/chunks/{gitGraphDiagram-WWUBYQGX-aZuraF8j.js → gitGraphDiagram-WWUBYQGX-C9dQonfW.js} +1 -1
  148. package/dist-embed/chunks/{gitGraphDiagram-WWUBYQGX-DQGRL7uj.js → gitGraphDiagram-WWUBYQGX-CCUBvn_Y.js} +1 -1
  149. package/dist-embed/chunks/{gitGraphDiagram-WWUBYQGX-BNb2xhKp.js → gitGraphDiagram-WWUBYQGX-DtuCNBUK.js} +1 -1
  150. package/dist-embed/chunks/{gitGraphDiagram-f01e8bc2-C14H7TVH.js → gitGraphDiagram-f01e8bc2-BbkFL6o9.js} +1 -1
  151. package/dist-embed/chunks/{gl-ES-HMX3MZ6V-DqEBlLxz.js → gl-ES-HMX3MZ6V-xM5HzxAU.js} +1 -1
  152. package/dist-embed/chunks/{he-IL-6SHJWFNN-BvhQ--Ic.js → he-IL-6SHJWFNN-nbUgZbH-.js} +1 -1
  153. package/dist-embed/chunks/{hi-IN-IWLTKZ5I-DYH2l25d.js → hi-IN-IWLTKZ5I-Cdlzp28w.js} +1 -1
  154. package/dist-embed/chunks/{hu-HU-A5ZG7DT2-DQgUyc8H.js → hu-HU-A5ZG7DT2-CMH5lTGq.js} +1 -1
  155. package/dist-embed/chunks/{id-ID-SAP4L64H-pbXSdQ7E.js → id-ID-SAP4L64H-Bi5Ltt4D.js} +1 -1
  156. package/dist-embed/chunks/{index-9bae90f3-FAkVZI_I.js → index-9bae90f3-C-MowVD8.js} +1 -1
  157. package/dist-embed/chunks/{index-Bc6gicqV.js → index-BNjq7TZD.js} +1 -1
  158. package/dist-embed/chunks/{index-B6Qu-Ldt.js → index-BQEJgzm9.js} +4 -4
  159. package/dist-embed/chunks/{index-BXARqQ-K.js → index-BjMNv4qG.js} +1 -1
  160. package/dist-embed/chunks/{index-CnpOaqg6.js → index-CUjcBn1v.js} +3 -3
  161. package/dist-embed/chunks/{index-BQ5muxLJ.js → index-Ch2yqELA.js} +15 -15
  162. package/dist-embed/chunks/{index-BIUfp2AH.js → index-DF5urV1Q.js} +1 -1
  163. package/dist-embed/chunks/{index-UqDGAeD4.js → index-D_112S5W.js} +1 -1
  164. package/dist-embed/chunks/{index-C8Ip0RIO.js → index-PwNNIVgK.js} +1 -1
  165. package/dist-embed/chunks/{index-UMhfKl2p.js → index-tO6w-mHa.js} +2 -2
  166. package/dist-embed/chunks/{index-vGRALwj6.js → index-yjEWxzbP.js} +4 -4
  167. package/dist-embed/chunks/{index.esm-zVCHVwV3.js → index.esm-B7H9qIsG.js} +1 -1
  168. package/dist-embed/chunks/{index.esm-DGPDabeX.js → index.esm-CS_7aH6j.js} +1 -1
  169. package/dist-embed/chunks/{infoDiagram-27XIBGKW-B6XclB9A.js → infoDiagram-27XIBGKW-11rIl0SX.js} +1 -1
  170. package/dist-embed/chunks/{infoDiagram-27XIBGKW-BnvfNhoo.js → infoDiagram-27XIBGKW-B7vKfShh.js} +1 -1
  171. package/dist-embed/chunks/{infoDiagram-27XIBGKW-BSmA5qBE.js → infoDiagram-27XIBGKW-DJuz15cI.js} +1 -1
  172. package/dist-embed/chunks/{infoDiagram-a29d40f1-CaObtgvQ.js → infoDiagram-a29d40f1-DY20od-W.js} +1 -1
  173. package/dist-embed/chunks/{isEqual-BybBNsZK.js → isEqual-niFNV5MZ.js} +1 -1
  174. package/dist-embed/chunks/{ishikawaDiagram-5VMMS53U-CoYeuvtz.js → ishikawaDiagram-5VMMS53U-BxF1LxPw.js} +1 -1
  175. package/dist-embed/chunks/{ishikawaDiagram-5VMMS53U-BjZ55y3a.js → ishikawaDiagram-5VMMS53U-CAgZHNJ1.js} +1 -1
  176. package/dist-embed/chunks/{ishikawaDiagram-5VMMS53U-DZof4mVq.js → ishikawaDiagram-5VMMS53U-CGhkG9xO.js} +1 -1
  177. package/dist-embed/chunks/{it-IT-JPQ66NNP-Dfqt8qws.js → it-IT-JPQ66NNP-CQG7I-7I.js} +1 -1
  178. package/dist-embed/chunks/{ja-JP-DBVTYXUO-CJl2BGZ0.js → ja-JP-DBVTYXUO-N1Fy__-x.js} +1 -1
  179. package/dist-embed/chunks/{journeyDiagram-3NMN7TZE-BQbXSJPZ.js → journeyDiagram-3NMN7TZE-BWry4eJr.js} +1 -1
  180. package/dist-embed/chunks/{journeyDiagram-3NMN7TZE-DUk5noZ3.js → journeyDiagram-3NMN7TZE-PMSgj3LU.js} +1 -1
  181. package/dist-embed/chunks/{journeyDiagram-3NMN7TZE-lMh4QSWD.js → journeyDiagram-3NMN7TZE-ymHKbZWG.js} +1 -1
  182. package/dist-embed/chunks/{journeyDiagram-95396277-B-wKHrA2.js → journeyDiagram-95396277-D8JFKSEp.js} +1 -1
  183. package/dist-embed/chunks/{kaa-6HZHGXH3-CkuYTE9k.js → kaa-6HZHGXH3-CV61GofE.js} +1 -1
  184. package/dist-embed/chunks/{kab-KAB-ZGHBKWFO-DwGUYmYz.js → kab-KAB-ZGHBKWFO-pu8Ov9No.js} +1 -1
  185. package/dist-embed/chunks/{kanban-definition-UXKFOSKX-Dfptc1fl.js → kanban-definition-UXKFOSKX-BnOah8Nd.js} +1 -1
  186. package/dist-embed/chunks/{kanban-definition-UXKFOSKX-DsS5AFXs.js → kanban-definition-UXKFOSKX-C_KPxfzn.js} +1 -1
  187. package/dist-embed/chunks/{kanban-definition-UXKFOSKX-D6Efkxin.js → kanban-definition-UXKFOSKX-UuVYvKiH.js} +1 -1
  188. package/dist-embed/chunks/{kk-KZ-P5N5QNE5-hKF6fBok.js → kk-KZ-P5N5QNE5-B8voVV7U.js} +1 -1
  189. package/dist-embed/chunks/{km-KH-HSX4SM5Z-CZBBU2M1.js → km-KH-HSX4SM5Z-C0VX4oEM.js} +1 -1
  190. package/dist-embed/chunks/{ko-KR-MTYHY66A-C-cMpFID.js → ko-KR-MTYHY66A-CcmFHDM1.js} +1 -1
  191. package/dist-embed/chunks/{ku-TR-6OUDTVRD-BhT89N8u.js → ku-TR-6OUDTVRD-CMFEX55_.js} +1 -1
  192. package/dist-embed/chunks/{layout-DwxE-zZ9.js → layout-CFVjfoYF.js} +1 -1
  193. package/dist-embed/chunks/{layout-3P_7xyJi.js → layout-CkB5JWAM.js} +1 -1
  194. package/dist-embed/chunks/{layout-NgpwW7nA.js → layout-oj4w4R5j.js} +1 -1
  195. package/dist-embed/chunks/{lexicalHooks-CVBA8Kup.js → lexicalHooks-Bh9Bp3P-.js} +1 -1
  196. package/dist-embed/chunks/{lib-DdQRcxuM.js → lib-5rtxMXPk.js} +1 -1
  197. package/dist-embed/chunks/{lib-D3T0Aw2k.js → lib-B8dqehoH.js} +1 -1
  198. package/dist-embed/chunks/{lib-BMrXwoDK.js → lib-BCnNB350.js} +1 -1
  199. package/dist-embed/chunks/{lib-USWrkybh.js → lib-BEADLX2g.js} +1 -1
  200. package/dist-embed/chunks/{lib-qTRu1lKk.js → lib-BPAFvW23.js} +1 -1
  201. package/dist-embed/chunks/{lib-HxF1xu1E.js → lib-BQZeV_uH.js} +1 -1
  202. package/dist-embed/chunks/{lib-BkcHzjVY.js → lib-BewlLHfg.js} +1 -1
  203. package/dist-embed/chunks/{lib-ClNhs2cv.js → lib-Bj-F8WWr.js} +1 -1
  204. package/dist-embed/chunks/{lib-DHt04E5T.js → lib-C-Ggs4iB.js} +1 -1
  205. package/dist-embed/chunks/{lib-DlFNTFJX.js → lib-CBSRQHoK.js} +1 -1
  206. package/dist-embed/chunks/{lib-C553WOkt.js → lib-CXZrbtJ9.js} +1 -1
  207. package/dist-embed/chunks/{lib-CfkV3N1c.js → lib-CiFgHF6H.js} +1 -1
  208. package/dist-embed/chunks/{lib-BkgDQr4b.js → lib-Cs68pT1f.js} +5 -5
  209. package/dist-embed/chunks/{lib-K8ZzEBaR.js → lib-D8Qc-bJh.js} +1 -1
  210. package/dist-embed/chunks/{lib-ClnZlQTa.js → lib-D8bmwG1Q.js} +1 -1
  211. package/dist-embed/chunks/{lib-DNqisZNg.js → lib-DDBakXc_.js} +1 -1
  212. package/dist-embed/chunks/{lib-DjYu7LUh.js → lib-DdHOeWKF.js} +1 -1
  213. package/dist-embed/chunks/{lib-CUuelUb1.js → lib-DtwAoDYT.js} +1 -1
  214. package/dist-embed/chunks/{lib-CSYbEQXY.js → lib-bSDF86bC.js} +1 -1
  215. package/dist-embed/chunks/{lib-CcQ1AdFH.js → lib-euir_64d.js} +1 -1
  216. package/dist-embed/chunks/{lt-LT-XHIRWOB4-DAnwG3pL.js → lt-LT-XHIRWOB4-CSs-cwk2.js} +1 -1
  217. package/dist-embed/chunks/{lv-LV-5QDEKY6T-DKutSEbv.js → lv-LV-5QDEKY6T-DBBrXhCL.js} +1 -1
  218. package/dist-embed/chunks/{mermaid.core-BKpjbvr4.js → mermaid.core-59YcUgz5.js} +3 -3
  219. package/dist-embed/chunks/{mermaid.core-BsYC7G_m.js → mermaid.core-BQpV-itu.js} +5 -5
  220. package/dist-embed/chunks/{mindmap-definition-YA3MSWOX-CHG6GkTy.js → mindmap-definition-YA3MSWOX-CDtT_DYs.js} +1 -1
  221. package/dist-embed/chunks/{mindmap-definition-YA3MSWOX-Cpij5zvN.js → mindmap-definition-YA3MSWOX-Cv6GXhbx.js} +1 -1
  222. package/dist-embed/chunks/{mindmap-definition-YA3MSWOX-BVjt4l-I.js → mindmap-definition-YA3MSWOX-Dpx3iQ9G.js} +1 -1
  223. package/dist-embed/chunks/{mindmap-definition-e4c1d938--68TxVLH.js → mindmap-definition-e4c1d938-BAEXTTXT.js} +1 -1
  224. package/dist-embed/chunks/{model-C6vyI0zW.js → model-BUkhfry_.js} +1 -1
  225. package/dist-embed/chunks/{mr-IN-CRQNXWMA-BHnTqpR5.js → mr-IN-CRQNXWMA-BoxiDYTQ.js} +1 -1
  226. package/dist-embed/chunks/{my-MM-5M5IBNSE-D7B2cCpQ.js → my-MM-5M5IBNSE-O2vgzfJi.js} +1 -1
  227. package/dist-embed/chunks/{nb-NO-T6EIAALU-CcZKsAQj.js → nb-NO-T6EIAALU-t_ME7jfF.js} +1 -1
  228. package/dist-embed/chunks/{nl-NL-IS3SIHDZ-Bg4B5s14.js → nl-NL-IS3SIHDZ-CJOgjJen.js} +1 -1
  229. package/dist-embed/chunks/{nn-NO-6E72VCQL-g7xBg2p-.js → nn-NO-6E72VCQL-CKJROtf6.js} +1 -1
  230. package/dist-embed/chunks/{oc-FR-POXYY2M6-Dhbf2zJv.js → oc-FR-POXYY2M6-hekTJXBh.js} +1 -1
  231. package/dist-embed/chunks/{pa-IN-N4M65BXN-KR1yA3_P.js → pa-IN-N4M65BXN-C0nR_lWW.js} +1 -1
  232. package/dist-embed/chunks/{pegDiagram-XKGWAZYB-BIkw8nt9.js → pegDiagram-XKGWAZYB-6GkUf1Ix.js} +1 -1
  233. package/dist-embed/chunks/{pegDiagram-XKGWAZYB-FCAU3TOo.js → pegDiagram-XKGWAZYB-BLi2ATBT.js} +1 -1
  234. package/dist-embed/chunks/{pegDiagram-XKGWAZYB-CE26qzAb.js → pegDiagram-XKGWAZYB-BxHZsnZc.js} +1 -1
  235. package/dist-embed/chunks/{percentages-BXMCSKIN-NdFZNkF5.js → percentages-BXMCSKIN-aDx1Abuj.js} +5 -5
  236. package/dist-embed/chunks/{pieDiagram-E7YTZNPT-7IUSm4Cd.js → pieDiagram-E7YTZNPT-0y9vHfxN.js} +1 -1
  237. package/dist-embed/chunks/{pieDiagram-E7YTZNPT-CmRfYSUK.js → pieDiagram-E7YTZNPT-BuSxz3f3.js} +1 -1
  238. package/dist-embed/chunks/{pieDiagram-E7YTZNPT-DnfolJly.js → pieDiagram-E7YTZNPT-CdMa7Tp_.js} +1 -1
  239. package/dist-embed/chunks/{pieDiagram-c941bede-BOM0hWZE.js → pieDiagram-c941bede-B4wYxQiG.js} +1 -1
  240. package/dist-embed/chunks/{pl-PL-T2D74RX3-BFMj2kIn.js → pl-PL-T2D74RX3-Bz6-nRIX.js} +1 -1
  241. package/dist-embed/chunks/{plugin-L-k9onR1.js → plugin-BeYApBgc.js} +1 -1
  242. package/dist-embed/chunks/{pt-BR-5N22H2LF-QBjImZeD.js → pt-BR-5N22H2LF-CIsrl0RF.js} +1 -1
  243. package/dist-embed/chunks/{pt-PT-UZXXM6DQ-BOajnzhW.js → pt-PT-UZXXM6DQ-Cm5V6d4j.js} +1 -1
  244. package/dist-embed/chunks/{quadrantDiagram-AXDQQJYC-CBuCLTK0.js → quadrantDiagram-AXDQQJYC-C3pbnXL8.js} +1 -1
  245. package/dist-embed/chunks/{quadrantDiagram-AXDQQJYC-D_YPReS-.js → quadrantDiagram-AXDQQJYC-CR6z5DUd.js} +1 -1
  246. package/dist-embed/chunks/{quadrantDiagram-AXDQQJYC-CAX9oQAl.js → quadrantDiagram-AXDQQJYC-CeT_Rjti.js} +1 -1
  247. package/dist-embed/chunks/{quadrantDiagram-cf8b8fe0-r_4FwxxN.js → quadrantDiagram-cf8b8fe0-CkBzFHkI.js} +1 -1
  248. package/dist-embed/chunks/{railroadDiagram-O6MQD6OU-CtOU0UiI.js → railroadDiagram-O6MQD6OU-BdfroHrK.js} +1 -1
  249. package/dist-embed/chunks/{railroadDiagram-O6MQD6OU-Dyq4RidU.js → railroadDiagram-O6MQD6OU-CqW4kNU7.js} +1 -1
  250. package/dist-embed/chunks/{railroadDiagram-O6MQD6OU-CFRdBxSp.js → railroadDiagram-O6MQD6OU-D4k0ckwJ.js} +1 -1
  251. package/dist-embed/chunks/{renderer-DQzulrO-.js → renderer-BTUDFH3O.js} +1 -1
  252. package/dist-embed/chunks/{requirementDiagram-53bda41b-YrNRNVqN.js → requirementDiagram-53bda41b-CGcKbmSY.js} +1 -1
  253. package/dist-embed/chunks/{requirementDiagram-BXWQKSXE-DW6fqUb-.js → requirementDiagram-BXWQKSXE-BZv3TS5_.js} +1 -1
  254. package/dist-embed/chunks/{requirementDiagram-BXWQKSXE-2Tq7Hgrr.js → requirementDiagram-BXWQKSXE-Bx-qNrGP.js} +1 -1
  255. package/dist-embed/chunks/{requirementDiagram-BXWQKSXE-6gtvqQ6g.js → requirementDiagram-BXWQKSXE-Dv-n3Ik2.js} +1 -1
  256. package/dist-embed/chunks/{ro-RO-JPDTUUEW-BicyuCgI.js → ro-RO-JPDTUUEW-BhCiwtAd.js} +1 -1
  257. package/dist-embed/chunks/{ru-RU-B4JR7IUQ-D5Lzo4K2.js → ru-RU-B4JR7IUQ-1R8PROIW.js} +1 -1
  258. package/dist-embed/chunks/{sankeyDiagram-P5KCCOFB-DBQ1HZxe.js → sankeyDiagram-P5KCCOFB-B1hPyVOc.js} +1 -1
  259. package/dist-embed/chunks/{sankeyDiagram-P5KCCOFB-ywB-7Sh8.js → sankeyDiagram-P5KCCOFB-B23f7m-H.js} +1 -1
  260. package/dist-embed/chunks/{sankeyDiagram-P5KCCOFB-Cjqnuiax.js → sankeyDiagram-P5KCCOFB-BK_3FXbs.js} +1 -1
  261. package/dist-embed/chunks/{sankeyDiagram-c3ef121a-BdHUFbke.js → sankeyDiagram-c3ef121a-B7rPgNOw.js} +1 -1
  262. package/dist-embed/chunks/{sequenceDiagram-82a5b84f-BsYsnScA.js → sequenceDiagram-82a5b84f-C_EzuSFh.js} +1 -1
  263. package/dist-embed/chunks/{sequenceDiagram-WJ2MYXX4-C9wu6JeV.js → sequenceDiagram-WJ2MYXX4-CqoMFij0.js} +1 -1
  264. package/dist-embed/chunks/{sequenceDiagram-WJ2MYXX4-BIU2Cbmw.js → sequenceDiagram-WJ2MYXX4-DiB7s_Dn.js} +1 -1
  265. package/dist-embed/chunks/{sequenceDiagram-WJ2MYXX4-tkRuJaD1.js → sequenceDiagram-WJ2MYXX4-f-0nVisj.js} +1 -1
  266. package/dist-embed/chunks/{server-extension-CwZK4t_R.js → server-extension-BjSjt875.js} +1 -1
  267. package/dist-embed/chunks/{sessions-B7ox-mRM.js → sessions-B0EUsrzs.js} +1 -1
  268. package/dist-embed/chunks/{sheet-BRqBiQwD.js → sheet-Do4NLOO5.js} +1 -1
  269. package/dist-embed/chunks/{si-LK-N5RQ5JYF-DFJ2FmYp.js → si-LK-N5RQ5JYF-V5ENer19.js} +1 -1
  270. package/dist-embed/chunks/{sizeCapture-INFHLROL-o5EsXBaa.js → sizeCapture-INFHLROL-Dn38jHtH.js} +1 -1
  271. package/dist-embed/chunks/{sizeCapture-INFHLROL-Cf65oZaf.js → sizeCapture-INFHLROL-_Af6e7vY.js} +1 -1
  272. package/dist-embed/chunks/{sizeCapture-INFHLROL-vFYFzq10.js → sizeCapture-INFHLROL-iClobhK8.js} +1 -1
  273. package/dist-embed/chunks/{sk-SK-C5VTKIMK-8LPB4Lnr.js → sk-SK-C5VTKIMK-CDbew_Lj.js} +1 -1
  274. package/dist-embed/chunks/{sl-SI-NN7IZMDC-B2BOaojE.js → sl-SI-NN7IZMDC-CYGDd2fT.js} +1 -1
  275. package/dist-embed/chunks/{state-CmWU_Gvx.js → state-DOjezY4E.js} +1 -1
  276. package/dist-embed/chunks/{stateDiagram-43e79a5f-BM8vNgoJ.js → stateDiagram-43e79a5f-CGkwABTG.js} +1 -1
  277. package/dist-embed/chunks/{stateDiagram-D77RDMKH-C900iM9W.js → stateDiagram-D77RDMKH-BYf5AFsH.js} +1 -1
  278. package/dist-embed/chunks/{stateDiagram-D77RDMKH-CuPDKatL.js → stateDiagram-D77RDMKH-DL2pkKsX.js} +1 -1
  279. package/dist-embed/chunks/{stateDiagram-D77RDMKH-LWwb-5tB.js → stateDiagram-D77RDMKH-TNAdn7Fw.js} +1 -1
  280. package/dist-embed/chunks/{stateDiagram-v2-2041ed4f-CyS6v5HY.js → stateDiagram-v2-2041ed4f-DOi2jMsy.js} +1 -1
  281. package/dist-embed/chunks/{stateDiagram-v2-MP3YSRHH-B9nNH36K.js → stateDiagram-v2-MP3YSRHH-BcOB4zh_.js} +1 -1
  282. package/dist-embed/chunks/{stateDiagram-v2-MP3YSRHH-D0oidLuM.js → stateDiagram-v2-MP3YSRHH-COkC2cKQ.js} +1 -1
  283. package/dist-embed/chunks/{stateDiagram-v2-MP3YSRHH-CCTFOmE7.js → stateDiagram-v2-MP3YSRHH-Dkn5bUd0.js} +1 -1
  284. package/dist-embed/chunks/{styles-455b33cd-D9VLOwJ1.js → styles-455b33cd-CLktXgUm.js} +1 -1
  285. package/dist-embed/chunks/{styles-f932cba9-Cd5ppA9M.js → styles-f932cba9-BwPvHxRQ.js} +1 -1
  286. package/dist-embed/chunks/{styles-fcc2142b-wYbY1ne5.js → styles-fcc2142b-CAXdEfcj.js} +1 -1
  287. package/dist-embed/chunks/{subset-shared.chunk-BGJYDNE3.js → subset-shared.chunk-C5GbluZS.js} +1 -1
  288. package/dist-embed/chunks/{subset-worker.chunk-DS6Y9CCK.js → subset-worker.chunk-DdgsqZkc.js} +1 -1
  289. package/dist-embed/chunks/{substates-qiB0bt2l.js → substates-DOXz-cie.js} +1 -1
  290. package/dist-embed/chunks/{sv-SE-XGPEYMSR-UPdAYYSP.js → sv-SE-XGPEYMSR-DC1SNPJE.js} +1 -1
  291. package/dist-embed/chunks/{svgDrawCommon-148a3cd9-Fa5fqeh3.js → svgDrawCommon-148a3cd9-CaQ5vpEO.js} +1 -1
  292. package/dist-embed/chunks/{swimlanes-42K2YHIH-BgvIcpoF.js → swimlanes-42K2YHIH-2IxujMpF.js} +1 -1
  293. package/dist-embed/chunks/{swimlanes-42K2YHIH-BBMKjjkW.js → swimlanes-42K2YHIH-BpCz-Rn6.js} +1 -1
  294. package/dist-embed/chunks/{swimlanes-42K2YHIH-Cq7pR56Q.js → swimlanes-42K2YHIH-DU9K-vT0.js} +1 -1
  295. package/dist-embed/chunks/{swimlanesDiagram-VR7AAH4N-wHfu_rwu.js → swimlanesDiagram-VR7AAH4N-BrV6X3P_.js} +1 -1
  296. package/dist-embed/chunks/{swimlanesDiagram-VR7AAH4N-gjt8K12P.js → swimlanesDiagram-VR7AAH4N-DXze4cE-.js} +1 -1
  297. package/dist-embed/chunks/{swimlanesDiagram-VR7AAH4N-BrssO_ZI.js → swimlanesDiagram-VR7AAH4N-wBxLzBji.js} +1 -1
  298. package/dist-embed/chunks/{ta-IN-2NMHFXQM-BA2NukSS.js → ta-IN-2NMHFXQM-DKSKwTtf.js} +1 -1
  299. package/dist-embed/chunks/{th-TH-HPSO5L25-LUayWo7x.js → th-TH-HPSO5L25-Dr1iFJp8.js} +1 -1
  300. package/dist-embed/chunks/{timeline-definition-24CTP7MA-CFvNBz_D.js → timeline-definition-24CTP7MA-BwZDNvPa.js} +1 -1
  301. package/dist-embed/chunks/{timeline-definition-24CTP7MA-Nut54L6A.js → timeline-definition-24CTP7MA-CVfYW-Nc.js} +1 -1
  302. package/dist-embed/chunks/{timeline-definition-24CTP7MA-BKyvL5dI.js → timeline-definition-24CTP7MA-DfMsrwKw.js} +1 -1
  303. package/dist-embed/chunks/{timeline-definition-7545f45a-RSfH6FTC.js → timeline-definition-7545f45a-DWcYkVIi.js} +1 -1
  304. package/dist-embed/chunks/{tr-TR-DEFEU3FU-BwLe2i48.js → tr-TR-DEFEU3FU-A_BYNcri.js} +1 -1
  305. package/dist-embed/chunks/{uk-UA-QMV73CPH-wjLkWFtn.js → uk-UA-QMV73CPH-lmL1fri3.js} +1 -1
  306. package/dist-embed/chunks/{vennDiagram-4TSXK5OY-CfkoE6en.js → vennDiagram-4TSXK5OY-C8_HpFyJ.js} +1 -1
  307. package/dist-embed/chunks/{vennDiagram-4TSXK5OY-iZRiPWDS.js → vennDiagram-4TSXK5OY-CsoLlfBZ.js} +1 -1
  308. package/dist-embed/chunks/{vennDiagram-4TSXK5OY-DcrhwQNy.js → vennDiagram-4TSXK5OY-MUcXUckP.js} +1 -1
  309. package/dist-embed/chunks/{vi-VN-M7AON7JQ-CVJrQXTE.js → vi-VN-M7AON7JQ-mMTEvrN2.js} +1 -1
  310. package/dist-embed/chunks/{wardleyDiagram-VM6X3IG4-C5LGiOpU.js → wardleyDiagram-VM6X3IG4-BKVSHBPg.js} +1 -1
  311. package/dist-embed/chunks/{wardleyDiagram-VM6X3IG4-CZLSTdrG.js → wardleyDiagram-VM6X3IG4-BksuirOR.js} +1 -1
  312. package/dist-embed/chunks/{wardleyDiagram-VM6X3IG4-W6fZ-zLj.js → wardleyDiagram-VM6X3IG4-CoFe_0Hs.js} +1 -1
  313. package/dist-embed/chunks/workbook-sMECd4Jk.js +1 -0
  314. package/dist-embed/chunks/{write-BPEehXmk.js → write-Q_DIQOWJ.js} +1 -1
  315. package/dist-embed/chunks/{xychartDiagram-3f383b91-DgGr7hwA.js → xychartDiagram-3f383b91-BB4yqnEL.js} +1 -1
  316. package/dist-embed/chunks/{xychartDiagram-S5SC5T6Z-DLQ3Wwtq.js → xychartDiagram-S5SC5T6Z-B6-P99h2.js} +1 -1
  317. package/dist-embed/chunks/{xychartDiagram-S5SC5T6Z-BlXuP2jM.js → xychartDiagram-S5SC5T6Z-BLIy7IJR.js} +1 -1
  318. package/dist-embed/chunks/{xychartDiagram-S5SC5T6Z-CsfBzeiF.js → xychartDiagram-S5SC5T6Z-BQlsBmbt.js} +1 -1
  319. package/dist-embed/chunks/{zh-CN-LNUGB5OW-DHFaH2P8.js → zh-CN-LNUGB5OW-DkgLfOH-.js} +1 -1
  320. package/dist-embed/chunks/{zh-HK-E62DVLB3-DKCAFB1q.js → zh-HK-E62DVLB3-bphdQsyC.js} +1 -1
  321. package/dist-embed/chunks/{zh-TW-RAJ6MFWO-D6WATM0Q.js → zh-TW-RAJ6MFWO-f8qOFFzB.js} +1 -1
  322. package/dist-embed/datalayer-app-main.js +32 -31
  323. package/dist-embed/datalayer-app.css +1 -1
  324. package/lib/apps/Application.d.ts +1 -1
  325. package/lib/apps/Application.js +1 -1
  326. package/lib/apps/agentUiPlugins.js +2 -0
  327. package/lib/apps/embed/AppEmbed.d.ts +1 -1
  328. package/lib/apps/embed/visitorApp.d.ts +4 -4
  329. package/lib/apps/embed/visitorApp.js +10 -10
  330. package/lib/apps/plugins/agents/DatalayerAgentBridge.js +1 -1
  331. package/lib/apps/plugins/agents/plugin.d.ts +1 -1
  332. package/lib/apps/plugins/trip-map/TripMapView.d.ts +18 -0
  333. package/lib/apps/plugins/trip-map/TripMapView.js +138 -0
  334. package/lib/apps/plugins/trip-map/index.d.ts +29 -0
  335. package/lib/apps/plugins/trip-map/index.js +75 -0
  336. package/lib/apps/plugins/trip-map/read.d.ts +47 -0
  337. package/lib/apps/plugins/trip-map/read.js +93 -0
  338. package/lib/apps/plugins/trip-map/style.d.ts +46 -0
  339. package/lib/apps/plugins/trip-map/style.js +249 -0
  340. package/lib/apps/presets.d.ts +1 -1
  341. package/lib/portable/hosts/agentClient.d.ts +1 -1
  342. package/lib/portable/hosts/agentClient.js +8 -8
  343. package/lib/portable/hosts/client.d.ts +2 -2
  344. package/lib/portable/hosts/client.js +2 -2
  345. package/lib/portable/hosts/contracts.d.ts +1 -1
  346. package/lib/portable/hosts/contracts.js +1 -1
  347. package/lib/portable/hosts/contracts.json +1 -1
  348. package/lib/specs/actions.js +18 -0
  349. package/lib/specs/agentPresentations.js +1 -1
  350. package/lib/specs/agents/agents.js +10 -4
  351. package/lib/specs/apps.d.ts +1 -1
  352. package/lib/specs/apps.js +35 -17
  353. package/lib/specs/backendTools.d.ts +1 -0
  354. package/lib/specs/backendTools.js +20 -0
  355. package/lib/specs/mcpServers.d.ts +1 -0
  356. package/lib/specs/mcpServers.js +41 -1
  357. package/lib/specs/ui.d.ts +1 -0
  358. package/lib/specs/ui.js +22 -0
  359. package/package.json +3 -1
  360. package/scripts/codegen/generate_mcp_servers.py +3 -1
  361. package/dist-embed/chunks/SpreadsheetPreviewView-BcPYoRJU.js +0 -1
  362. package/dist-embed/chunks/workbook-4v5EV9v6.js +0 -1
@@ -1,7 +1,7 @@
1
- import{r as d,j as l,bE as $e,aE as z,T as V,v as C,kt as qe,ku as Ge,ff as Xe,dB as X,a2 as se,H as Ye,fT as Ke,U as fe,fh as Je,V as Qe,j3 as Ze,j4 as et,bJ as tt,a_ as nt}from"../datalayer-app-main.js";import{u as st,a as rt,D as ot,b as it}from"./DeckRenderer-B8PqIWaS.js";import{V as at}from"./VideoIcon-DIIszW1S.js";import{P as ct}from"./index-C0KhmyXF.js";const Q=4e3,lt=700,ut=12,he=/[.!?…](?=["'»”’)\]]*(\s|$))/g,ie=e=>{const t=(e??"").replace(/[*_`]+/g,"").replace(/\s+/g," ").trim();if(!t)return[];const s=[];let n=0;he.lastIndex=0;let r;for(;(r=he.exec(t))!==null;){const i=r.index+r[0].length,a=t.slice(n,i).trim();a.length>=ut&&(s.push(a),n=i)}const o=t.slice(n).trim();return o&&s.push(o),s},Pe={status:"idle",script:[],slide:0,sentence:0,run:0},te=e=>e.status==="playing"||e.status==="paused",dt=(e,t)=>{switch(t.type){case"play":{const s=t.script.length-1;return s<0?{...Pe,status:"ended",run:e.run+1}:{status:"playing",script:t.script,slide:Math.min(Math.max(0,t.slide),s),sentence:0,run:e.run+1}}case"sentence":return e.status!=="playing"?e:{...e,sentence:Math.min(Math.max(0,t.index),Math.max(0,(e.script[e.slide]?.length??1)-1))};case"slideDone":return e.status!=="playing"?e:e.slide+1>=e.script.length?{...e,status:"ended",sentence:0}:{...e,slide:e.slide+1,sentence:0,run:e.run+1};case"pause":return e.status==="playing"?{...e,status:"paused"}:e;case"resume":return e.status==="paused"?{...e,status:"playing",run:e.run+1}:e;case"stop":return te(e)?{...e,status:"idle",reason:void 0}:e;case"refused":return te(e)?{...e,status:"refused",reason:t.reason}:e;case"moved":return!te(e)||t.slide===e.slide||t.slide<0||t.slide>=e.script.length?e:{...e,slide:t.slide,sentence:0,run:e.run+1};default:return e}},ft=e=>(e.script[e.slide]??[]).slice(e.sentence),ht=e=>{const t=e.script[e.slide]??[],s=Math.max(0,e.sentence-1);return t.slice(s,e.sentence+2).map((n,r)=>({text:n,index:s+r,current:s+r===e.sentence}))},Ie=(e,t=ie)=>e.map(s=>t(s.notes)),mt=(e,t,s)=>{const[n,r]=d.useReducer(dt,Pe);d.useEffect(()=>{if(n.status!=="playing"||!t)return;const h=s.current,g=!!h&&h.getIndices().h!==n.slide;g&&h.slide(n.slide);const p=ft(n),j=n.sentence;if(!p.length){const w=window.setTimeout(()=>r({type:"slideDone"}),Q);return()=>window.clearTimeout(w)}let D=!1;const S=()=>{D=!0,t.speak(p,{onSentence:w=>r({type:"sentence",index:j+w}),onEnd:()=>r({type:"slideDone"}),onRefused:w=>r({type:"refused",reason:w})})},A=g?window.setTimeout(S,lt):void 0;return g||S(),()=>{window.clearTimeout(A),D&&t.stop()}},[n.run,n.status,t]),d.useEffect(()=>()=>t?.stop(),[t]);const o=d.useCallback(h=>{t?.unlock?.(),r({type:"play",slide:h,script:Ie(e.slides,t?.sentences??ie)})},[t,e.slides]),i=d.useCallback(()=>r({type:"pause"}),[]),a=d.useCallback(()=>{t?.unlock?.(),r({type:"resume"})},[t]),c=d.useCallback(()=>r({type:"stop"}),[]),m=d.useCallback(h=>r({type:"moved",slide:h}),[]),u=n.status==="playing"||n.status==="paused",f=n.status==="paused";return d.useEffect(()=>{if(!u)return;const h=g=>{const p=g.target;p&&/^(INPUT|TEXTAREA|SELECT)$/.test(p.tagName)||(g.key===" "||g.key==="Spacebar"?(g.preventDefault(),g.stopPropagation(),f?a():i()):g.key==="Escape"&&c())};return window.addEventListener("keydown",h,!0),()=>window.removeEventListener("keydown",h,!0)},[u,f,i,a,c]),{state:n,play:o,pause:i,resume:a,stop:c,moved:m}},Me={position:"absolute",left:"6%",right:"6%",bottom:"5%",zIndex:40,padding:"0.6em 1em",borderRadius:10,background:"rgba(15, 18, 24, 0.82)",color:"#f6f8fa",fontFamily:"var(--dla-deck-font, inherit)",fontSize:"clamp(13px, 1.5vw, 30px)",lineHeight:1.45,textAlign:"center",pointerEvents:"none"},me=({state:e,target:t})=>{if(!t||e.status!=="playing"&&e.status!=="paused")return null;const s=ht(e),n=s.length?s.map(r=>l.jsxs("span",{"data-caption":r.current?"current":"context",style:{opacity:r.current?1:.45,fontWeight:r.current?600:400},children:[r.text," "]},r.index)):l.jsxs("span",{"data-caption":"silent",style:{opacity:.8,fontStyle:"italic"},children:["No notes on this slide — the next one follows in ",Math.round(Q/1e3)," ","seconds."]});return $e.createPortal(l.jsxs("div",{className:"dla-deck-captions",role:"status","aria-live":"polite",style:Me,children:[n,e.status==="paused"&&l.jsx("div",{style:{fontSize:"0.7em",opacity:.8,marginTop:"0.3em"},children:"Paused · space resumes · Escape stops"})]}),t)},gt=({notes:e,presenting:t,target:s})=>{const n=e?.trim(),r=n?l.jsx("span",{style:{whiteSpace:"pre-wrap"},children:n}):l.jsx("span",{style:{fontStyle:"italic",opacity:.75},children:"No speaker notes on this slide."});return t?s?$e.createPortal(l.jsx("div",{className:"dla-deck-speaker-notes","data-speaker-notes":"",style:{...Me,textAlign:"left",fontSize:"clamp(13px, 1.1vw, 22px)",maxHeight:"30%",overflowY:"auto",pointerEvents:"auto"},children:r}),s):null:l.jsxs("div",{className:"dla-deck-speaker-notes","data-speaker-notes":"",style:{padding:"12px 16px",borderRadius:6,border:"1px solid var(--borderColor-default, #d0d7de)",fontSize:14,lineHeight:1.5},children:[l.jsx("strong",{style:{display:"block",fontSize:12,marginBottom:4},children:"Speaker notes"}),r]})};function pt(e,t){if(e.match(/^[a-z]+:\/\//i))return e;if(e.match(/^\/\//))return window.location.protocol+e;if(e.match(/^[a-z]+:/i))return e;const s=document.implementation.createHTMLDocument(),n=s.createElement("base"),r=s.createElement("a");return s.head.appendChild(n),s.body.appendChild(r),t&&(n.href=t),r.href=e,r.href}const wt=(()=>{let e=0;const t=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(e+=1,`u${t()}${e}`)})();function F(e){const t=[];for(let s=0,n=e.length;s<n;s++)t.push(e[s]);return t}let U=null;function De(e={}){return U||(e.includeStyleProperties?(U=e.includeStyleProperties,U):(U=F(window.getComputedStyle(document.documentElement)),U))}function Y(e,t){const n=(e.ownerDocument.defaultView||window).getComputedStyle(e).getPropertyValue(t);return n?parseFloat(n.replace("px","")):0}function yt(e){const t=Y(e,"border-left-width"),s=Y(e,"border-right-width");return e.clientWidth+t+s}function xt(e){const t=Y(e,"border-top-width"),s=Y(e,"border-bottom-width");return e.clientHeight+t+s}function Le(e,t={}){const s=t.width||yt(e),n=t.height||xt(e);return{width:s,height:n}}function St(){let e,t;try{t=process}catch{}const s=t&&t.env?t.env.devicePixelRatio:null;return s&&(e=parseInt(s,10),Number.isNaN(e)&&(e=1)),e||window.devicePixelRatio||1}const I=16384;function bt(e){(e.width>I||e.height>I)&&(e.width>I&&e.height>I?e.width>e.height?(e.height*=I/e.width,e.width=I):(e.width*=I/e.height,e.height=I):e.width>I?(e.height*=I/e.width,e.width=I):(e.width*=I/e.height,e.height=I))}function K(e){return new Promise((t,s)=>{const n=new Image;n.onload=()=>{n.decode().then(()=>{requestAnimationFrame(()=>t(n))})},n.onerror=s,n.crossOrigin="anonymous",n.decoding="async",n.src=e})}async function Et(e){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then(t=>`data:image/svg+xml;charset=utf-8,${t}`)}async function kt(e,t,s){const n="http://www.w3.org/2000/svg",r=document.createElementNS(n,"svg"),o=document.createElementNS(n,"foreignObject");return r.setAttribute("width",`${t}`),r.setAttribute("height",`${s}`),r.setAttribute("viewBox",`0 0 ${t} ${s}`),o.setAttribute("width","100%"),o.setAttribute("height","100%"),o.setAttribute("x","0"),o.setAttribute("y","0"),o.setAttribute("externalResourcesRequired","true"),r.appendChild(o),o.appendChild(e),Et(r)}const P=(e,t)=>{if(e instanceof t)return!0;const s=Object.getPrototypeOf(e);return s===null?!1:s.constructor.name===t.name||P(s,t)};function vt(e){const t=e.getPropertyValue("content");return`${e.cssText} content: '${t.replace(/'|"/g,"")}';`}function Ct(e,t){return De(t).map(s=>{const n=e.getPropertyValue(s),r=e.getPropertyPriority(s);return`${s}: ${n}${r?" !important":""};`}).join(" ")}function Tt(e,t,s,n){const r=`.${e}:${t}`,o=s.cssText?vt(s):Ct(s,n);return document.createTextNode(`${r}{${o}}`)}function ge(e,t,s,n){const r=window.getComputedStyle(e,s),o=r.getPropertyValue("content");if(o===""||o==="none")return;const i=wt();try{t.className=`${t.className} ${i}`}catch{return}const a=document.createElement("style");a.appendChild(Tt(i,s,r,n)),t.appendChild(a)}function Rt(e,t,s){ge(e,t,":before",s),ge(e,t,":after",s)}const pe="application/font-woff",we="image/jpeg",$t={woff:pe,woff2:pe,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:we,jpeg:we,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function Pt(e){const t=/\.([^./]*?)$/g.exec(e);return t?t[1]:""}function ae(e){const t=Pt(e).toLowerCase();return $t[t]||""}function It(e){return e.split(/,/)[1]}function re(e){return e.search(/^(data:)/)!==-1}function Mt(e,t){return`data:${t};base64,${e}`}async function je(e,t,s){const n=await fetch(e,t);if(n.status===404)throw new Error(`Resource "${n.url}" not found`);const r=await n.blob();return new Promise((o,i)=>{const a=new FileReader;a.onerror=i,a.onloadend=()=>{try{o(s({res:n,result:a.result}))}catch(c){i(c)}},a.readAsDataURL(r)})}const ne={};function Dt(e,t,s){let n=e.replace(/\?.*/,"");return s&&(n=e),/ttf|otf|eot|woff2?/i.test(n)&&(n=n.replace(/.*\//,"")),t?`[${t}]${n}`:n}async function ce(e,t,s){const n=Dt(e,t,s.includeQueryParams);if(ne[n]!=null)return ne[n];s.cacheBust&&(e+=(/\?/.test(e)?"&":"?")+new Date().getTime());let r;try{const o=await je(e,s.fetchRequestInit,({res:i,result:a})=>(t||(t=i.headers.get("Content-Type")||""),It(a)));r=Mt(o,t)}catch(o){r=s.imagePlaceholder||"";let i=`Failed to fetch resource: ${e}`;o&&(i=typeof o=="string"?o:o.message),i&&console.warn(i)}return ne[n]=r,r}async function Lt(e){const t=e.toDataURL();return t==="data:,"?e.cloneNode(!1):K(t)}async function jt(e,t){if(e.currentSrc){const o=document.createElement("canvas"),i=o.getContext("2d");o.width=e.clientWidth,o.height=e.clientHeight,i?.drawImage(e,0,0,o.width,o.height);const a=o.toDataURL();return K(a)}const s=e.poster,n=ae(s),r=await ce(s,n,t);return K(r)}async function At(e,t){var s;try{if(!((s=e?.contentDocument)===null||s===void 0)&&s.body)return await Z(e.contentDocument.body,t,!0)}catch{}return e.cloneNode(!1)}async function Ft(e,t){return P(e,HTMLCanvasElement)?Lt(e):P(e,HTMLVideoElement)?jt(e,t):P(e,HTMLIFrameElement)?At(e,t):e.cloneNode(Ae(e))}const _t=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SLOT",Ae=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SVG";async function Vt(e,t,s){var n,r;if(Ae(t))return t;let o=[];return _t(e)&&e.assignedNodes?o=F(e.assignedNodes()):P(e,HTMLIFrameElement)&&(!((n=e.contentDocument)===null||n===void 0)&&n.body)?o=F(e.contentDocument.body.childNodes):o=F(((r=e.shadowRoot)!==null&&r!==void 0?r:e).childNodes),o.length===0||P(e,HTMLVideoElement)||await o.reduce((i,a)=>i.then(()=>Z(a,s)).then(c=>{c&&t.appendChild(c)}),Promise.resolve()),t}function Ht(e,t,s){const n=t.style;if(!n)return;const r=window.getComputedStyle(e);r.cssText?(n.cssText=r.cssText,n.transformOrigin=r.transformOrigin):De(s).forEach(o=>{let i=r.getPropertyValue(o);o==="font-size"&&i.endsWith("px")&&(i=`${Math.floor(parseFloat(i.substring(0,i.length-2)))-.1}px`),P(e,HTMLIFrameElement)&&o==="display"&&i==="inline"&&(i="block"),o==="d"&&t.getAttribute("d")&&(i=`path(${t.getAttribute("d")})`),n.setProperty(o,i,r.getPropertyPriority(o))})}function Ot(e,t){P(e,HTMLTextAreaElement)&&(t.innerHTML=e.value),P(e,HTMLInputElement)&&t.setAttribute("value",e.value)}function Ut(e,t){if(P(e,HTMLSelectElement)){const n=Array.from(t.children).find(r=>e.value===r.getAttribute("value"));n&&n.setAttribute("selected","")}}function Bt(e,t,s){return P(t,Element)&&(Ht(e,t,s),Rt(e,t,s),Ot(e,t),Ut(e,t)),t}async function zt(e,t){const s=e.querySelectorAll?e.querySelectorAll("use"):[];if(s.length===0)return e;const n={};for(let o=0;o<s.length;o++){const a=s[o].getAttribute("xlink:href");if(a){const c=e.querySelector(a),m=document.querySelector(a);!c&&m&&!n[a]&&(n[a]=await Z(m,t,!0))}}const r=Object.values(n);if(r.length){const o="http://www.w3.org/1999/xhtml",i=document.createElementNS(o,"svg");i.setAttribute("xmlns",o),i.style.position="absolute",i.style.width="0",i.style.height="0",i.style.overflow="hidden",i.style.display="none";const a=document.createElementNS(o,"defs");i.appendChild(a);for(let c=0;c<r.length;c++)a.appendChild(r[c]);e.appendChild(i)}return e}async function Z(e,t,s){return!s&&t.filter&&!t.filter(e)?null:Promise.resolve(e).then(n=>Ft(n,t)).then(n=>Vt(e,n,t)).then(n=>Bt(e,n,t)).then(n=>zt(n,t))}const Fe=/url\((['"]?)([^'"]+?)\1\)/g,Wt=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,Nt=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function qt(e){const t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}function Gt(e){const t=[];return e.replace(Fe,(s,n,r)=>(t.push(r),s)),t.filter(s=>!re(s))}async function Xt(e,t,s,n,r){try{const o=s?pt(t,s):t,i=ae(t);let a;return r||(a=await ce(o,i,n)),e.replace(qt(t),`$1${a}$3`)}catch{}return e}function Yt(e,{preferredFontFormat:t}){return t?e.replace(Nt,s=>{for(;;){const[n,,r]=Wt.exec(s)||[];if(!r)return"";if(r===t)return`src: ${n};`}}):e}function _e(e){return e.search(Fe)!==-1}async function Ve(e,t,s){if(!_e(e))return e;const n=Yt(e,s);return Gt(n).reduce((o,i)=>o.then(a=>Xt(a,i,t,s)),Promise.resolve(n))}async function B(e,t,s){var n;const r=(n=t.style)===null||n===void 0?void 0:n.getPropertyValue(e);if(r){const o=await Ve(r,null,s);return t.style.setProperty(e,o,t.style.getPropertyPriority(e)),!0}return!1}async function Kt(e,t){await B("background",e,t)||await B("background-image",e,t),await B("mask",e,t)||await B("-webkit-mask",e,t)||await B("mask-image",e,t)||await B("-webkit-mask-image",e,t)}async function Jt(e,t){const s=P(e,HTMLImageElement);if(!(s&&!re(e.src))&&!(P(e,SVGImageElement)&&!re(e.href.baseVal)))return;const n=s?e.src:e.href.baseVal,r=await ce(n,ae(n),t);await new Promise((o,i)=>{e.onload=o,e.onerror=t.onImageErrorHandler?(...c)=>{try{o(t.onImageErrorHandler(...c))}catch(m){i(m)}}:i;const a=e;a.decode&&(a.decode=o),a.loading==="lazy"&&(a.loading="eager"),s?(e.srcset="",e.src=r):e.href.baseVal=r})}async function Qt(e,t){const n=F(e.childNodes).map(r=>He(r,t));await Promise.all(n).then(()=>e)}async function He(e,t){P(e,Element)&&(await Kt(e,t),await Jt(e,t),await Qt(e,t))}function Zt(e,t){const{style:s}=e;t.backgroundColor&&(s.backgroundColor=t.backgroundColor),t.width&&(s.width=`${t.width}px`),t.height&&(s.height=`${t.height}px`);const n=t.style;return n!=null&&Object.keys(n).forEach(r=>{s[r]=n[r]}),e}const ye={};async function xe(e){let t=ye[e];if(t!=null)return t;const n=await(await fetch(e)).text();return t={url:e,cssText:n},ye[e]=t,t}async function Se(e,t){let s=e.cssText;const n=/url\(["']?([^"')]+)["']?\)/g,o=(s.match(/url\([^)]+\)/g)||[]).map(async i=>{let a=i.replace(n,"$1");return a.startsWith("https://")||(a=new URL(a,e.url).href),je(a,t.fetchRequestInit,({result:c})=>(s=s.replace(i,`url(${c})`),[i,c]))});return Promise.all(o).then(()=>s)}function be(e){if(e==null)return[];const t=[],s=/(\/\*[\s\S]*?\*\/)/gi;let n=e.replace(s,"");const r=new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})","gi");for(;;){const c=r.exec(n);if(c===null)break;t.push(c[0])}n=n.replace(r,"");const o=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,i="((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})",a=new RegExp(i,"gi");for(;;){let c=o.exec(n);if(c===null){if(c=a.exec(n),c===null)break;o.lastIndex=a.lastIndex}else a.lastIndex=o.lastIndex;t.push(c[0])}return t}async function en(e,t){const s=[],n=[];return e.forEach(r=>{if("cssRules"in r)try{F(r.cssRules||[]).forEach((o,i)=>{if(o.type===CSSRule.IMPORT_RULE){let a=i+1;const c=o.href,m=xe(c).then(u=>Se(u,t)).then(u=>be(u).forEach(f=>{try{r.insertRule(f,f.startsWith("@import")?a+=1:r.cssRules.length)}catch(h){console.error("Error inserting rule from remote css",{rule:f,error:h})}})).catch(u=>{console.error("Error loading remote css",u.toString())});n.push(m)}})}catch(o){const i=e.find(a=>a.href==null)||document.styleSheets[0];r.href!=null&&n.push(xe(r.href).then(a=>Se(a,t)).then(a=>be(a).forEach(c=>{i.insertRule(c,i.cssRules.length)})).catch(a=>{console.error("Error loading remote stylesheet",a)})),console.error("Error inlining remote css file",o)}}),Promise.all(n).then(()=>(e.forEach(r=>{if("cssRules"in r)try{F(r.cssRules||[]).forEach(o=>{s.push(o)})}catch(o){console.error(`Error while reading CSS rules from ${r.href}`,o)}}),s))}function tn(e){return e.filter(t=>t.type===CSSRule.FONT_FACE_RULE).filter(t=>_e(t.style.getPropertyValue("src")))}async function nn(e,t){if(e.ownerDocument==null)throw new Error("Provided element is not within a Document");const s=F(e.ownerDocument.styleSheets),n=await en(s,t);return tn(n)}function Oe(e){return e.trim().replace(/["']/g,"")}function sn(e){const t=new Set;function s(n){(n.style.fontFamily||getComputedStyle(n).fontFamily).split(",").forEach(o=>{t.add(Oe(o))}),Array.from(n.children).forEach(o=>{o instanceof HTMLElement&&s(o)})}return s(e),t}async function Ue(e,t){const s=await nn(e,t),n=sn(e);return(await Promise.all(s.filter(o=>n.has(Oe(o.style.fontFamily))).map(o=>{const i=o.parentStyleSheet?o.parentStyleSheet.href:null;return Ve(o.cssText,i,t)}))).join(`
2
- `)}async function rn(e,t){const s=t.fontEmbedCSS!=null?t.fontEmbedCSS:t.skipFonts?null:await Ue(e,t);if(s){const n=document.createElement("style"),r=document.createTextNode(s);n.appendChild(r),e.firstChild?e.insertBefore(n,e.firstChild):e.appendChild(n)}}async function on(e,t={}){const{width:s,height:n}=Le(e,t),r=await Z(e,t,!0);return await rn(r,t),await He(r,t),Zt(r,t),await kt(r,s,n)}async function an(e,t={}){const{width:s,height:n}=Le(e,t),r=await on(e,t),o=await K(r),i=document.createElement("canvas"),a=i.getContext("2d"),c=t.pixelRatio||St(),m=t.canvasWidth||s,u=t.canvasHeight||n;return i.width=m*c,i.height=u*c,t.skipAutoScale||bt(i),i.style.width=`${m}`,i.style.height=`${u}`,t.backgroundColor&&(a.fillStyle=t.backgroundColor,a.fillRect(0,0,i.width,i.height)),a.drawImage(o,0,0,i.width,i.height),i}async function cn(e,t={}){return Ue(e,t)}const Ee=(e,t,s,n)=>{const r=e.replace(/\s+/g," ").trim().split(" ").filter(Boolean),o=[];let i="";for(const a of r){const c=i?`${i} ${a}`:a;!i||n(c,s)<=t?i=c:(o.push(i),i=a)}return i&&o.push(i),o},ln=(e,t,s,n,r)=>{if(!n.length)throw new Error("A caption needs at least one size.");for(const i of n){const a=Ee(e,t,i,r);if(a.length<=s)return{size:i,lines:a}}const o=n[n.length-1];return{size:o,lines:Ee(e,t,o,r)}},un=(e,t)=>{const s=e.createGain();return s.gain.value=t?1:0,s.connect(e.destination),s},dn=(e,t)=>{e.gain.value=t?1:0},fn=(e,t,s)=>{const n=e.createGain();return n.connect(t),s&&n.connect(s),n},hn=.6,mn=.35,gn=.9,pn=Q/1e3,wn=(e,t)=>{if(e.length!==t.length)throw new Error(`The deck has ${e.length} slides but ${t.length} were voiced.`);const s=[],n=[];let r=0;return e.forEach((o,i)=>{const a=t[i];if(a.length!==o.length)throw new Error(`Slide ${i+1} has ${o.length} sentences but ${a.length} were voiced.`);const c=r;if(!o.length){r+=pn,s.push({slide:i,start:c,end:r,cues:[]});return}r+=hn;const m=o.map((u,f)=>{const h=a[f];if(!Number.isFinite(h)||h<0)throw new Error(`Slide ${i+1}, sentence ${f+1} has no length.`);f>0&&(r+=mn);const g={slide:i,sentence:f,text:u,start:r,end:r+h};return r+=h,g});r+=gn,s.push({slide:i,start:c,end:r,cues:m}),n.push(...m)}),{slides:s,cues:n,duration:r}},Be=(e,t)=>{const{slides:s}=e;if(!s.length)return{slide:0};const n=s.find(o=>t<o.end)??s[s.length-1],r=n.cues.find(o=>t>=o.start&&t<o.end);return{slide:n.slide,cue:r}},yn=(e,t)=>{const{slide:s}=Be(e,t),n=e.slides.find(o=>o.slide===s)?.cues??[];let r=0;for(const o of n)t>=o.start&&(r=o.sentence);return{slide:s,sentence:r}},oe=e=>{const t=Math.max(0,Math.floor(e)),s=Math.floor(t/3600),n=Math.floor(t%3600/60),r=String(t%60).padStart(2,"0");return s?`${s}:${String(n).padStart(2,"0")}:${r}`:`${n}:${r}`},xn=e=>e.normalize("NFKD").replace(/[̀-ͯ]/g,"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,80)||"deck",ke=e=>{const t=Math.max(0,Math.round(e*1e3)),s=Math.floor(t/36e5),n=Math.floor(t%36e5/6e4),r=Math.floor(t%6e4/1e3),o=t%1e3,i=a=>String(a).padStart(2,"0");return`${i(s)}:${i(n)}:${i(r)}.${String(o).padStart(3,"0")}`},ve=e=>e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\s+/g," ").trim(),Sn=(e,t)=>{const s=t?`WEBVTT - ${ve(t)}`:"WEBVTT",n=e.map((r,o)=>`${o+1} · slide ${r.slide+1}
1
+ import{r as d,j as l,bE as $e,aE as z,T as V,v as C,ku as qe,kv as Ge,fk as Xe,dB as X,a2 as se,H as Ye,fU as Ke,U as fe,fm as Je,V as Qe,j4 as Ze,j5 as et,bJ as tt,a_ as nt}from"../datalayer-app-main.js";import{u as st,a as rt,D as ot,b as it}from"./DeckRenderer-BitpK9Co.js";import{V as at}from"./VideoIcon-DIIszW1S.js";import{P as ct}from"./index-C0KhmyXF.js";const Q=4e3,lt=700,ut=12,he=/[.!?…](?=["'»”’)\]]*(\s|$))/g,ie=e=>{const t=(e??"").replace(/[*_`]+/g,"").replace(/\s+/g," ").trim();if(!t)return[];const s=[];let n=0;he.lastIndex=0;let r;for(;(r=he.exec(t))!==null;){const i=r.index+r[0].length,a=t.slice(n,i).trim();a.length>=ut&&(s.push(a),n=i)}const o=t.slice(n).trim();return o&&s.push(o),s},Pe={status:"idle",script:[],slide:0,sentence:0,run:0},te=e=>e.status==="playing"||e.status==="paused",dt=(e,t)=>{switch(t.type){case"play":{const s=t.script.length-1;return s<0?{...Pe,status:"ended",run:e.run+1}:{status:"playing",script:t.script,slide:Math.min(Math.max(0,t.slide),s),sentence:0,run:e.run+1}}case"sentence":return e.status!=="playing"?e:{...e,sentence:Math.min(Math.max(0,t.index),Math.max(0,(e.script[e.slide]?.length??1)-1))};case"slideDone":return e.status!=="playing"?e:e.slide+1>=e.script.length?{...e,status:"ended",sentence:0}:{...e,slide:e.slide+1,sentence:0,run:e.run+1};case"pause":return e.status==="playing"?{...e,status:"paused"}:e;case"resume":return e.status==="paused"?{...e,status:"playing",run:e.run+1}:e;case"stop":return te(e)?{...e,status:"idle",reason:void 0}:e;case"refused":return te(e)?{...e,status:"refused",reason:t.reason}:e;case"moved":return!te(e)||t.slide===e.slide||t.slide<0||t.slide>=e.script.length?e:{...e,slide:t.slide,sentence:0,run:e.run+1};default:return e}},ft=e=>(e.script[e.slide]??[]).slice(e.sentence),ht=e=>{const t=e.script[e.slide]??[],s=Math.max(0,e.sentence-1);return t.slice(s,e.sentence+2).map((n,r)=>({text:n,index:s+r,current:s+r===e.sentence}))},Ie=(e,t=ie)=>e.map(s=>t(s.notes)),mt=(e,t,s)=>{const[n,r]=d.useReducer(dt,Pe);d.useEffect(()=>{if(n.status!=="playing"||!t)return;const h=s.current,g=!!h&&h.getIndices().h!==n.slide;g&&h.slide(n.slide);const p=ft(n),j=n.sentence;if(!p.length){const w=window.setTimeout(()=>r({type:"slideDone"}),Q);return()=>window.clearTimeout(w)}let D=!1;const S=()=>{D=!0,t.speak(p,{onSentence:w=>r({type:"sentence",index:j+w}),onEnd:()=>r({type:"slideDone"}),onRefused:w=>r({type:"refused",reason:w})})},A=g?window.setTimeout(S,lt):void 0;return g||S(),()=>{window.clearTimeout(A),D&&t.stop()}},[n.run,n.status,t]),d.useEffect(()=>()=>t?.stop(),[t]);const o=d.useCallback(h=>{t?.unlock?.(),r({type:"play",slide:h,script:Ie(e.slides,t?.sentences??ie)})},[t,e.slides]),i=d.useCallback(()=>r({type:"pause"}),[]),a=d.useCallback(()=>{t?.unlock?.(),r({type:"resume"})},[t]),c=d.useCallback(()=>r({type:"stop"}),[]),m=d.useCallback(h=>r({type:"moved",slide:h}),[]),u=n.status==="playing"||n.status==="paused",f=n.status==="paused";return d.useEffect(()=>{if(!u)return;const h=g=>{const p=g.target;p&&/^(INPUT|TEXTAREA|SELECT)$/.test(p.tagName)||(g.key===" "||g.key==="Spacebar"?(g.preventDefault(),g.stopPropagation(),f?a():i()):g.key==="Escape"&&c())};return window.addEventListener("keydown",h,!0),()=>window.removeEventListener("keydown",h,!0)},[u,f,i,a,c]),{state:n,play:o,pause:i,resume:a,stop:c,moved:m}},Me={position:"absolute",left:"6%",right:"6%",bottom:"5%",zIndex:40,padding:"0.6em 1em",borderRadius:10,background:"rgba(15, 18, 24, 0.82)",color:"#f6f8fa",fontFamily:"var(--dla-deck-font, inherit)",fontSize:"clamp(13px, 1.5vw, 30px)",lineHeight:1.45,textAlign:"center",pointerEvents:"none"},me=({state:e,target:t})=>{if(!t||e.status!=="playing"&&e.status!=="paused")return null;const s=ht(e),n=s.length?s.map(r=>l.jsxs("span",{"data-caption":r.current?"current":"context",style:{opacity:r.current?1:.45,fontWeight:r.current?600:400},children:[r.text," "]},r.index)):l.jsxs("span",{"data-caption":"silent",style:{opacity:.8,fontStyle:"italic"},children:["No notes on this slide — the next one follows in ",Math.round(Q/1e3)," ","seconds."]});return $e.createPortal(l.jsxs("div",{className:"dla-deck-captions",role:"status","aria-live":"polite",style:Me,children:[n,e.status==="paused"&&l.jsx("div",{style:{fontSize:"0.7em",opacity:.8,marginTop:"0.3em"},children:"Paused · space resumes · Escape stops"})]}),t)},gt=({notes:e,presenting:t,target:s})=>{const n=e?.trim(),r=n?l.jsx("span",{style:{whiteSpace:"pre-wrap"},children:n}):l.jsx("span",{style:{fontStyle:"italic",opacity:.75},children:"No speaker notes on this slide."});return t?s?$e.createPortal(l.jsx("div",{className:"dla-deck-speaker-notes","data-speaker-notes":"",style:{...Me,textAlign:"left",fontSize:"clamp(13px, 1.1vw, 22px)",maxHeight:"30%",overflowY:"auto",pointerEvents:"auto"},children:r}),s):null:l.jsxs("div",{className:"dla-deck-speaker-notes","data-speaker-notes":"",style:{padding:"12px 16px",borderRadius:6,border:"1px solid var(--borderColor-default, #d0d7de)",fontSize:14,lineHeight:1.5},children:[l.jsx("strong",{style:{display:"block",fontSize:12,marginBottom:4},children:"Speaker notes"}),r]})};function pt(e,t){if(e.match(/^[a-z]+:\/\//i))return e;if(e.match(/^\/\//))return window.location.protocol+e;if(e.match(/^[a-z]+:/i))return e;const s=document.implementation.createHTMLDocument(),n=s.createElement("base"),r=s.createElement("a");return s.head.appendChild(n),s.body.appendChild(r),t&&(n.href=t),r.href=e,r.href}const wt=(()=>{let e=0;const t=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(e+=1,`u${t()}${e}`)})();function F(e){const t=[];for(let s=0,n=e.length;s<n;s++)t.push(e[s]);return t}let O=null;function De(e={}){return O||(e.includeStyleProperties?(O=e.includeStyleProperties,O):(O=F(window.getComputedStyle(document.documentElement)),O))}function Y(e,t){const n=(e.ownerDocument.defaultView||window).getComputedStyle(e).getPropertyValue(t);return n?parseFloat(n.replace("px","")):0}function yt(e){const t=Y(e,"border-left-width"),s=Y(e,"border-right-width");return e.clientWidth+t+s}function xt(e){const t=Y(e,"border-top-width"),s=Y(e,"border-bottom-width");return e.clientHeight+t+s}function Le(e,t={}){const s=t.width||yt(e),n=t.height||xt(e);return{width:s,height:n}}function St(){let e,t;try{t=process}catch{}const s=t&&t.env?t.env.devicePixelRatio:null;return s&&(e=parseInt(s,10),Number.isNaN(e)&&(e=1)),e||window.devicePixelRatio||1}const I=16384;function bt(e){(e.width>I||e.height>I)&&(e.width>I&&e.height>I?e.width>e.height?(e.height*=I/e.width,e.width=I):(e.width*=I/e.height,e.height=I):e.width>I?(e.height*=I/e.width,e.width=I):(e.width*=I/e.height,e.height=I))}function K(e){return new Promise((t,s)=>{const n=new Image;n.onload=()=>{n.decode().then(()=>{requestAnimationFrame(()=>t(n))})},n.onerror=s,n.crossOrigin="anonymous",n.decoding="async",n.src=e})}async function Et(e){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then(t=>`data:image/svg+xml;charset=utf-8,${t}`)}async function kt(e,t,s){const n="http://www.w3.org/2000/svg",r=document.createElementNS(n,"svg"),o=document.createElementNS(n,"foreignObject");return r.setAttribute("width",`${t}`),r.setAttribute("height",`${s}`),r.setAttribute("viewBox",`0 0 ${t} ${s}`),o.setAttribute("width","100%"),o.setAttribute("height","100%"),o.setAttribute("x","0"),o.setAttribute("y","0"),o.setAttribute("externalResourcesRequired","true"),r.appendChild(o),o.appendChild(e),Et(r)}const P=(e,t)=>{if(e instanceof t)return!0;const s=Object.getPrototypeOf(e);return s===null?!1:s.constructor.name===t.name||P(s,t)};function vt(e){const t=e.getPropertyValue("content");return`${e.cssText} content: '${t.replace(/'|"/g,"")}';`}function Ct(e,t){return De(t).map(s=>{const n=e.getPropertyValue(s),r=e.getPropertyPriority(s);return`${s}: ${n}${r?" !important":""};`}).join(" ")}function Tt(e,t,s,n){const r=`.${e}:${t}`,o=s.cssText?vt(s):Ct(s,n);return document.createTextNode(`${r}{${o}}`)}function ge(e,t,s,n){const r=window.getComputedStyle(e,s),o=r.getPropertyValue("content");if(o===""||o==="none")return;const i=wt();try{t.className=`${t.className} ${i}`}catch{return}const a=document.createElement("style");a.appendChild(Tt(i,s,r,n)),t.appendChild(a)}function Rt(e,t,s){ge(e,t,":before",s),ge(e,t,":after",s)}const pe="application/font-woff",we="image/jpeg",$t={woff:pe,woff2:pe,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:we,jpeg:we,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function Pt(e){const t=/\.([^./]*?)$/g.exec(e);return t?t[1]:""}function ae(e){const t=Pt(e).toLowerCase();return $t[t]||""}function It(e){return e.split(/,/)[1]}function re(e){return e.search(/^(data:)/)!==-1}function Mt(e,t){return`data:${t};base64,${e}`}async function je(e,t,s){const n=await fetch(e,t);if(n.status===404)throw new Error(`Resource "${n.url}" not found`);const r=await n.blob();return new Promise((o,i)=>{const a=new FileReader;a.onerror=i,a.onloadend=()=>{try{o(s({res:n,result:a.result}))}catch(c){i(c)}},a.readAsDataURL(r)})}const ne={};function Dt(e,t,s){let n=e.replace(/\?.*/,"");return s&&(n=e),/ttf|otf|eot|woff2?/i.test(n)&&(n=n.replace(/.*\//,"")),t?`[${t}]${n}`:n}async function ce(e,t,s){const n=Dt(e,t,s.includeQueryParams);if(ne[n]!=null)return ne[n];s.cacheBust&&(e+=(/\?/.test(e)?"&":"?")+new Date().getTime());let r;try{const o=await je(e,s.fetchRequestInit,({res:i,result:a})=>(t||(t=i.headers.get("Content-Type")||""),It(a)));r=Mt(o,t)}catch(o){r=s.imagePlaceholder||"";let i=`Failed to fetch resource: ${e}`;o&&(i=typeof o=="string"?o:o.message),i&&console.warn(i)}return ne[n]=r,r}async function Lt(e){const t=e.toDataURL();return t==="data:,"?e.cloneNode(!1):K(t)}async function jt(e,t){if(e.currentSrc){const o=document.createElement("canvas"),i=o.getContext("2d");o.width=e.clientWidth,o.height=e.clientHeight,i?.drawImage(e,0,0,o.width,o.height);const a=o.toDataURL();return K(a)}const s=e.poster,n=ae(s),r=await ce(s,n,t);return K(r)}async function At(e,t){var s;try{if(!((s=e?.contentDocument)===null||s===void 0)&&s.body)return await Z(e.contentDocument.body,t,!0)}catch{}return e.cloneNode(!1)}async function Ft(e,t){return P(e,HTMLCanvasElement)?Lt(e):P(e,HTMLVideoElement)?jt(e,t):P(e,HTMLIFrameElement)?At(e,t):e.cloneNode(Ae(e))}const _t=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SLOT",Ae=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SVG";async function Vt(e,t,s){var n,r;if(Ae(t))return t;let o=[];return _t(e)&&e.assignedNodes?o=F(e.assignedNodes()):P(e,HTMLIFrameElement)&&(!((n=e.contentDocument)===null||n===void 0)&&n.body)?o=F(e.contentDocument.body.childNodes):o=F(((r=e.shadowRoot)!==null&&r!==void 0?r:e).childNodes),o.length===0||P(e,HTMLVideoElement)||await o.reduce((i,a)=>i.then(()=>Z(a,s)).then(c=>{c&&t.appendChild(c)}),Promise.resolve()),t}function Ut(e,t,s){const n=t.style;if(!n)return;const r=window.getComputedStyle(e);r.cssText?(n.cssText=r.cssText,n.transformOrigin=r.transformOrigin):De(s).forEach(o=>{let i=r.getPropertyValue(o);o==="font-size"&&i.endsWith("px")&&(i=`${Math.floor(parseFloat(i.substring(0,i.length-2)))-.1}px`),P(e,HTMLIFrameElement)&&o==="display"&&i==="inline"&&(i="block"),o==="d"&&t.getAttribute("d")&&(i=`path(${t.getAttribute("d")})`),n.setProperty(o,i,r.getPropertyPriority(o))})}function Ht(e,t){P(e,HTMLTextAreaElement)&&(t.innerHTML=e.value),P(e,HTMLInputElement)&&t.setAttribute("value",e.value)}function Ot(e,t){if(P(e,HTMLSelectElement)){const n=Array.from(t.children).find(r=>e.value===r.getAttribute("value"));n&&n.setAttribute("selected","")}}function Bt(e,t,s){return P(t,Element)&&(Ut(e,t,s),Rt(e,t,s),Ht(e,t),Ot(e,t)),t}async function zt(e,t){const s=e.querySelectorAll?e.querySelectorAll("use"):[];if(s.length===0)return e;const n={};for(let o=0;o<s.length;o++){const a=s[o].getAttribute("xlink:href");if(a){const c=e.querySelector(a),m=document.querySelector(a);!c&&m&&!n[a]&&(n[a]=await Z(m,t,!0))}}const r=Object.values(n);if(r.length){const o="http://www.w3.org/1999/xhtml",i=document.createElementNS(o,"svg");i.setAttribute("xmlns",o),i.style.position="absolute",i.style.width="0",i.style.height="0",i.style.overflow="hidden",i.style.display="none";const a=document.createElementNS(o,"defs");i.appendChild(a);for(let c=0;c<r.length;c++)a.appendChild(r[c]);e.appendChild(i)}return e}async function Z(e,t,s){return!s&&t.filter&&!t.filter(e)?null:Promise.resolve(e).then(n=>Ft(n,t)).then(n=>Vt(e,n,t)).then(n=>Bt(e,n,t)).then(n=>zt(n,t))}const Fe=/url\((['"]?)([^'"]+?)\1\)/g,Wt=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,Nt=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function qt(e){const t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}function Gt(e){const t=[];return e.replace(Fe,(s,n,r)=>(t.push(r),s)),t.filter(s=>!re(s))}async function Xt(e,t,s,n,r){try{const o=s?pt(t,s):t,i=ae(t);let a;return r||(a=await ce(o,i,n)),e.replace(qt(t),`$1${a}$3`)}catch{}return e}function Yt(e,{preferredFontFormat:t}){return t?e.replace(Nt,s=>{for(;;){const[n,,r]=Wt.exec(s)||[];if(!r)return"";if(r===t)return`src: ${n};`}}):e}function _e(e){return e.search(Fe)!==-1}async function Ve(e,t,s){if(!_e(e))return e;const n=Yt(e,s);return Gt(n).reduce((o,i)=>o.then(a=>Xt(a,i,t,s)),Promise.resolve(n))}async function B(e,t,s){var n;const r=(n=t.style)===null||n===void 0?void 0:n.getPropertyValue(e);if(r){const o=await Ve(r,null,s);return t.style.setProperty(e,o,t.style.getPropertyPriority(e)),!0}return!1}async function Kt(e,t){await B("background",e,t)||await B("background-image",e,t),await B("mask",e,t)||await B("-webkit-mask",e,t)||await B("mask-image",e,t)||await B("-webkit-mask-image",e,t)}async function Jt(e,t){const s=P(e,HTMLImageElement);if(!(s&&!re(e.src))&&!(P(e,SVGImageElement)&&!re(e.href.baseVal)))return;const n=s?e.src:e.href.baseVal,r=await ce(n,ae(n),t);await new Promise((o,i)=>{e.onload=o,e.onerror=t.onImageErrorHandler?(...c)=>{try{o(t.onImageErrorHandler(...c))}catch(m){i(m)}}:i;const a=e;a.decode&&(a.decode=o),a.loading==="lazy"&&(a.loading="eager"),s?(e.srcset="",e.src=r):e.href.baseVal=r})}async function Qt(e,t){const n=F(e.childNodes).map(r=>Ue(r,t));await Promise.all(n).then(()=>e)}async function Ue(e,t){P(e,Element)&&(await Kt(e,t),await Jt(e,t),await Qt(e,t))}function Zt(e,t){const{style:s}=e;t.backgroundColor&&(s.backgroundColor=t.backgroundColor),t.width&&(s.width=`${t.width}px`),t.height&&(s.height=`${t.height}px`);const n=t.style;return n!=null&&Object.keys(n).forEach(r=>{s[r]=n[r]}),e}const ye={};async function xe(e){let t=ye[e];if(t!=null)return t;const n=await(await fetch(e)).text();return t={url:e,cssText:n},ye[e]=t,t}async function Se(e,t){let s=e.cssText;const n=/url\(["']?([^"')]+)["']?\)/g,o=(s.match(/url\([^)]+\)/g)||[]).map(async i=>{let a=i.replace(n,"$1");return a.startsWith("https://")||(a=new URL(a,e.url).href),je(a,t.fetchRequestInit,({result:c})=>(s=s.replace(i,`url(${c})`),[i,c]))});return Promise.all(o).then(()=>s)}function be(e){if(e==null)return[];const t=[],s=/(\/\*[\s\S]*?\*\/)/gi;let n=e.replace(s,"");const r=new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})","gi");for(;;){const c=r.exec(n);if(c===null)break;t.push(c[0])}n=n.replace(r,"");const o=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,i="((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})",a=new RegExp(i,"gi");for(;;){let c=o.exec(n);if(c===null){if(c=a.exec(n),c===null)break;o.lastIndex=a.lastIndex}else a.lastIndex=o.lastIndex;t.push(c[0])}return t}async function en(e,t){const s=[],n=[];return e.forEach(r=>{if("cssRules"in r)try{F(r.cssRules||[]).forEach((o,i)=>{if(o.type===CSSRule.IMPORT_RULE){let a=i+1;const c=o.href,m=xe(c).then(u=>Se(u,t)).then(u=>be(u).forEach(f=>{try{r.insertRule(f,f.startsWith("@import")?a+=1:r.cssRules.length)}catch(h){console.error("Error inserting rule from remote css",{rule:f,error:h})}})).catch(u=>{console.error("Error loading remote css",u.toString())});n.push(m)}})}catch(o){const i=e.find(a=>a.href==null)||document.styleSheets[0];r.href!=null&&n.push(xe(r.href).then(a=>Se(a,t)).then(a=>be(a).forEach(c=>{i.insertRule(c,i.cssRules.length)})).catch(a=>{console.error("Error loading remote stylesheet",a)})),console.error("Error inlining remote css file",o)}}),Promise.all(n).then(()=>(e.forEach(r=>{if("cssRules"in r)try{F(r.cssRules||[]).forEach(o=>{s.push(o)})}catch(o){console.error(`Error while reading CSS rules from ${r.href}`,o)}}),s))}function tn(e){return e.filter(t=>t.type===CSSRule.FONT_FACE_RULE).filter(t=>_e(t.style.getPropertyValue("src")))}async function nn(e,t){if(e.ownerDocument==null)throw new Error("Provided element is not within a Document");const s=F(e.ownerDocument.styleSheets),n=await en(s,t);return tn(n)}function He(e){return e.trim().replace(/["']/g,"")}function sn(e){const t=new Set;function s(n){(n.style.fontFamily||getComputedStyle(n).fontFamily).split(",").forEach(o=>{t.add(He(o))}),Array.from(n.children).forEach(o=>{o instanceof HTMLElement&&s(o)})}return s(e),t}async function Oe(e,t){const s=await nn(e,t),n=sn(e);return(await Promise.all(s.filter(o=>n.has(He(o.style.fontFamily))).map(o=>{const i=o.parentStyleSheet?o.parentStyleSheet.href:null;return Ve(o.cssText,i,t)}))).join(`
2
+ `)}async function rn(e,t){const s=t.fontEmbedCSS!=null?t.fontEmbedCSS:t.skipFonts?null:await Oe(e,t);if(s){const n=document.createElement("style"),r=document.createTextNode(s);n.appendChild(r),e.firstChild?e.insertBefore(n,e.firstChild):e.appendChild(n)}}async function on(e,t={}){const{width:s,height:n}=Le(e,t),r=await Z(e,t,!0);return await rn(r,t),await Ue(r,t),Zt(r,t),await kt(r,s,n)}async function an(e,t={}){const{width:s,height:n}=Le(e,t),r=await on(e,t),o=await K(r),i=document.createElement("canvas"),a=i.getContext("2d"),c=t.pixelRatio||St(),m=t.canvasWidth||s,u=t.canvasHeight||n;return i.width=m*c,i.height=u*c,t.skipAutoScale||bt(i),i.style.width=`${m}`,i.style.height=`${u}`,t.backgroundColor&&(a.fillStyle=t.backgroundColor,a.fillRect(0,0,i.width,i.height)),a.drawImage(o,0,0,i.width,i.height),i}async function cn(e,t={}){return Oe(e,t)}const Ee=(e,t,s,n)=>{const r=e.replace(/\s+/g," ").trim().split(" ").filter(Boolean),o=[];let i="";for(const a of r){const c=i?`${i} ${a}`:a;!i||n(c,s)<=t?i=c:(o.push(i),i=a)}return i&&o.push(i),o},ln=(e,t,s,n,r)=>{if(!n.length)throw new Error("A caption needs at least one size.");for(const i of n){const a=Ee(e,t,i,r);if(a.length<=s)return{size:i,lines:a}}const o=n[n.length-1];return{size:o,lines:Ee(e,t,o,r)}},un=(e,t)=>{const s=e.createGain();return s.gain.value=t?1:0,s.connect(e.destination),s},dn=(e,t)=>{e.gain.value=t?1:0},fn=(e,t,s)=>{const n=e.createGain();return n.connect(t),s&&n.connect(s),n},hn=.6,mn=.35,gn=.9,pn=Q/1e3,wn=(e,t)=>{if(e.length!==t.length)throw new Error(`The deck has ${e.length} slides but ${t.length} were voiced.`);const s=[],n=[];let r=0;return e.forEach((o,i)=>{const a=t[i];if(a.length!==o.length)throw new Error(`Slide ${i+1} has ${o.length} sentences but ${a.length} were voiced.`);const c=r;if(!o.length){r+=pn,s.push({slide:i,start:c,end:r,cues:[]});return}r+=hn;const m=o.map((u,f)=>{const h=a[f];if(!Number.isFinite(h)||h<0)throw new Error(`Slide ${i+1}, sentence ${f+1} has no length.`);f>0&&(r+=mn);const g={slide:i,sentence:f,text:u,start:r,end:r+h};return r+=h,g});r+=gn,s.push({slide:i,start:c,end:r,cues:m}),n.push(...m)}),{slides:s,cues:n,duration:r}},Be=(e,t)=>{const{slides:s}=e;if(!s.length)return{slide:0};const n=s.find(o=>t<o.end)??s[s.length-1],r=n.cues.find(o=>t>=o.start&&t<o.end);return{slide:n.slide,cue:r}},yn=(e,t)=>{const{slide:s}=Be(e,t),n=e.slides.find(o=>o.slide===s)?.cues??[];let r=0;for(const o of n)t>=o.start&&(r=o.sentence);return{slide:s,sentence:r}},oe=e=>{const t=Math.max(0,Math.floor(e)),s=Math.floor(t/3600),n=Math.floor(t%3600/60),r=String(t%60).padStart(2,"0");return s?`${s}:${String(n).padStart(2,"0")}:${r}`:`${n}:${r}`},xn=e=>e.normalize("NFKD").replace(/[̀-ͯ]/g,"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,80)||"deck",ke=e=>{const t=Math.max(0,Math.round(e*1e3)),s=Math.floor(t/36e5),n=Math.floor(t%36e5/6e4),r=Math.floor(t%6e4/1e3),o=t%1e3,i=a=>String(a).padStart(2,"0");return`${i(s)}:${i(n)}:${i(r)}.${String(o).padStart(3,"0")}`},ve=e=>e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\s+/g," ").trim(),Sn=(e,t)=>{const s=t?`WEBVTT - ${ve(t)}`:"WEBVTT",n=e.map((r,o)=>`${o+1} · slide ${r.slide+1}
3
3
  ${ke(r.start)} --> ${ke(r.end)}
4
4
  `+ve(r.text));return[s,...n].join(`
5
5
 
6
6
  `)+`
7
- `},q=1920,ee=1080,bn=30,En=2,Ce=15e3,kn=3e3,vn=["video/mp4;codecs=avc1,mp4a.40.2","video/mp4;codecs=avc1,mp4a","video/mp4;codecs=avc1,opus","video/webm;codecs=vp9,opus","video/webm;codecs=vp8,opus"],Cn=()=>typeof MediaRecorder>"u"?void 0:vn.find(e=>MediaRecorder.isTypeSupported(e)),Tn=e=>new Promise((t,s)=>e.toBlob(n=>n?t(n):s(new Error("The slide could not be made a picture.")),"image/png"));class le extends Error{constructor(){super("Making the video was cancelled."),this.name="VideoCancelled"}}const J=e=>{if(e.aborted)throw new le},ze=e=>new Promise(t=>window.setTimeout(t,e)),Rn=["controls","progress","slide-number","pause-overlay","dla-deck-captions","dla-deck-speaker-notes"],Te=e=>!(e.classList&&Rn.some(t=>e.classList.contains(t))),$n=async(e,t)=>{await document.fonts.ready;const s=Date.now()+Ce;for(;;){const n=[...e.querySelectorAll("img")].every(o=>o.complete),r=[...e.querySelectorAll(".dla-mermaid-svg")].every(o=>o.querySelector("svg")!==null||o.classList.contains("dla-mermaid-svg--hidden"));if(n&&r)return;if(Date.now()>s)throw new Error(`Slide ${t} did not finish drawing its ${n?"diagram":"pictures"} in ${Ce/1e3} seconds.`);await ze(100)}},Pn=/^(transparent|rgba\(.*,\s*0\))$/,In=e=>{for(let t=e;t;t=t.parentElement){const s=getComputedStyle(t).backgroundColor;if(s&&!Pn.test(s))return s}return"#ffffff"},We=(e,t)=>{e.slide(t,0);const s=e.getCurrentSlide(),n=[...s.querySelectorAll(".fragment")].map(r=>Number(r.getAttribute("data-fragment-index"))).filter(Number.isFinite);return n.length&&e.slide(t,0,Math.max(...n)),s},W="dla-deck--capturing",Mn=`.${W}, .${W} *, .${W} *::before, .${W} *::after { transition: none !important; animation: none !important; }`,Dn=async(e,t)=>{const s=e.getRevealElement();if(!s)throw new Error("The deck is not on screen.");const n=e.getIndices(),r=document.createElement("style");r.textContent=Mn,document.head.appendChild(r),s.classList.add(W);try{const o=s.clientWidth,i=s.clientHeight;if(!o||!i)throw new Error("The deck has no size on screen.");const a=In(s),c=await cn(s,{filter:Te});return await t(async(m,u)=>{const f=We(e,m);await $n(f,m+1),await ze(80);const h=await an(s,{filter:Te,fontEmbedCSS:c,backgroundColor:a,pixelRatio:u.width/o,width:o,height:i,skipAutoScale:!0}),g=document.createElement("canvas");g.width=u.width,g.height=u.height;const p=g.getContext("2d");if(!p)throw new Error("This browser gives no canvas to draw the slides on.");return p.fillStyle=a,p.fillRect(0,0,u.width,u.height),p.drawImage(h,0,0,u.width,u.height),g})}finally{e.slide(n.h,n.v,n.f),window.setTimeout(()=>{s.classList.remove(W),r.remove()},100)}},Ln=(e,t,s,n)=>Dn(e,async r=>{const o=[];for(let i=0;i<t;i++)J(s),n({phase:"slides",done:i,total:t}),o.push(await r(i,{width:q,height:ee}));return n({phase:"slides",done:t,total:t}),o}),jn=async(e,t,s,n,r)=>{const o=e.flatMap((u,f)=>u.map((h,g)=>({slide:f,sentence:g,text:h}))),i=e.map(()=>[]);let a=0,c=0;r({phase:"voice",done:c,total:o.length});const m=async()=>{for(;a<o.length;){J(n);const u=o[a++],f=await t(u.text);J(n);try{i[u.slide][u.sentence]=await s.decodeAudioData(f.slice(0))}catch(h){throw new Error(`The voice of slide ${u.slide+1} could not be decoded: ${h instanceof Error?h.message:String(h)}`)}c+=1,r({phase:"voice",done:c,total:o.length})}};return await Promise.all(Array.from({length:Math.min(En,o.length)},m)),i},M={side:q*.06,bottom:ee*.05,padX:44,padY:24,radius:15,lineHeight:1.45,maxLines:3,sizes:[44,40,36,32,28],background:"rgba(15, 18, 24, 0.82)",color:"#f6f8fa",weight:600},An=(e,t,s,n)=>{if(e.drawImage(t,0,0),!s)return;const r=q-2*M.side,o=f=>`${M.weight} ${f}px ${n}`,{size:i,lines:a}=ln(s,r-2*M.padX,M.maxLines,M.sizes,(f,h)=>(e.font=o(h),e.measureText(f).width)),c=i*M.lineHeight,m=a.length*c+2*M.padY,u=ee-M.bottom-m;e.fillStyle=M.background,e.beginPath(),e.roundRect(M.side,u,r,m,M.radius),e.fill(),e.font=o(i),e.fillStyle=M.color,e.textAlign="center",e.textBaseline="middle",a.forEach((f,h)=>{e.fillText(f,q/2,u+M.padY+c*(h+.5))})},Fn=(e,t,s)=>{const n=URL.createObjectURL(new Blob([`setInterval(() => postMessage(0), ${e});`],{type:"text/javascript"})),r=new Worker(n);return r.onmessage=t,r.onerror=()=>s("The page would not start the timer that paces the video."),()=>{r.terminate(),URL.revokeObjectURL(n)}},_n=async({pictures:e,timeline:t,voiced:s,audio:n,font:r,mimeType:o,speakers:i,signal:a,onProgress:c})=>{const m=document.createElement("canvas");m.width=q,m.height=ee;const u=m.getContext("2d");if(!u)throw new Error("This browser gives no canvas to draw the video on.");const f=m.captureStream(0).getVideoTracks()[0],h=n.createMediaStreamDestination(),g=fn(n,h,i),p=new MediaRecorder(new MediaStream([f,...h.stream.getAudioTracks()]),{mimeType:o,videoBitsPerSecond:6e6,audioBitsPerSecond:128e3}),j=[];p.ondataavailable=x=>{x.data.size&&j.push(x.data)};const D=new Promise(x=>{p.onstop=()=>x()}),S=x=>{const E=Be(t,x);return An(u,e[E.slide],E.cue?.text,r),f.requestFrame(),E};await n.resume(),S(0),p.start(1e3);const A=n.currentTime,w=t.cues.map(x=>{const E=n.createBufferSource();return E.buffer=s[x.slide][x.sentence],E.connect(g),E.start(A+x.start),E});let _;try{await new Promise((x,E)=>{const v=Date.now(),y=n.currentTime;_=Fn(1e3/bn,()=>{if(a.aborted){E(new le);return}if(n.currentTime===y&&Date.now()-v>kn){E(new Error("The browser would not start the sound. Press Video again."));return}const k=Math.max(0,n.currentTime-A),T=S(k);c({phase:"recording",slide:T.slide,sentence:yn(t,k).sentence,slides:t.slides.length,time:Math.min(k,t.duration),duration:t.duration}),k>=t.duration&&x()},k=>E(new Error(k)))})}finally{_?.(),w.forEach(x=>{try{x.stop()}catch{}x.disconnect()}),g.disconnect(),p.stop(),await D,f.stop()}return new Blob(j,{type:p.mimeType||o})},Vn=async({deck:e,script:t,synthesize:s,audio:n,speakers:r,title:o,signal:i,onProgress:a})=>{const c=Cn();if(!c)throw new Error("This browser cannot record a video (MediaRecorder records neither MP4 nor WebM).");const m=e.getRevealElement(),u=m&&getComputedStyle(m).getPropertyValue("--dla-deck-font").trim()||"system-ui, sans-serif",f=await Ln(e,t.length,i,a),h=await Tn(f[0]),g=await jn(t,s,n,i,a);J(i);const p=wn(t,g.map(D=>D.map(S=>S.duration)));return{video:await _n({pictures:f,timeline:p,voiced:g,audio:n,font:u,mimeType:c,speakers:r,signal:i,onProgress:a}),extension:c.startsWith("video/mp4")?"mp4":"webm",vtt:Sn(p.cues,o),poster:h,timeline:p}},Hn=(e,t,s)=>{const n=`The video is ready: ${oe(e)}, with its captions.`;if(!t||!s)return n;switch(t.status){case"keeping":return`${n} Uploading it…`;case"kept":return`${n} ${s.published}`;case"refused":return`${n} It could not be uploaded: ${t.reason}`}},On=(e,t,s,n)=>{const[r,o]=d.useState({status:"idle"}),i=d.useRef(null),[a,c]=d.useState(!0),m=d.useRef(!0),u=d.useRef(null),[f,h]=d.useState([]),g=d.useRef([]),p=d.useRef(null),j=d.useRef(e),D=d.useRef(n);D.current=n;const S=d.useCallback(()=>{g.current.forEach(y=>URL.revokeObjectURL(y)),g.current=[],p.current=null},[]),A=d.useCallback(()=>{const y=p.current,k=D.current;if(!y||!k)return;const T=L=>o(R=>R.status==="done"&&p.current===y?{...R,kept:L}:R);T({status:"keeping"}),k.publish(y,j.current).then(()=>T({status:"kept"})).catch(L=>T({status:"refused",reason:L instanceof Error?L.message:String(L)}))},[]),w=d.useCallback(()=>{const y=t?.synthesize,k=s.current;if(!y||!k||i.current)return;S(),j.current=e;const T=k.getIndices(),L=Ie(e.slides,t?.sentences??ie);h(L);let R=-1;const H=new AbortController;i.current=H;const O=new AudioContext;O.resume(),u.current=un(O,m.current),o({status:"making",progress:{phase:"slides",done:0,total:e.slides.length}});const G=e.deck.title;Vn({deck:k,script:L,synthesize:y,audio:O,speakers:u.current,title:G,signal:H.signal,onProgress:b=>{H.signal.aborted||(b.phase==="recording"&&b.slide!==R&&(R=b.slide,We(k,b.slide)),o({status:"making",progress:b}))}}).then(b=>{const $=xn(G),ue=URL.createObjectURL(b.video),de=URL.createObjectURL(new Blob([b.vtt],{type:"text/vtt;charset=utf-8"}));g.current=[ue,de],p.current=b,o({status:"done",videoUrl:ue,videoName:`${$}.${b.extension}`,captionsUrl:de,captionsName:`${$}.vtt`,duration:b.timeline.duration}),A()}).catch(b=>{o(b instanceof le?{status:"idle"}:{status:"failed",reason:b instanceof Error?b.message:String(b)})}).finally(()=>{if(i.current=null,u.current=null,R>=0)try{k.slide(T.h,T.v,T.f)}catch{}O.close()})},[s,S,A,t,e]),_=d.useCallback(()=>i.current?.abort(),[]),x=d.useCallback(y=>{m.current=y,c(y),u.current&&dn(u.current,y)},[]),E=d.useCallback(()=>{S(),o({status:"idle"})},[S]);d.useEffect(()=>()=>{i.current?.abort(),S()},[S]);const v=r.status==="making"&&r.progress.phase==="recording"?{status:"playing",script:f,slide:r.progress.slide,sentence:r.progress.sentence,run:0}:void 0;return{state:r,start:w,cancel:_,heard:a,setHeard:x,following:v,dismiss:E,publisher:n,keep:A}},Un=e=>{switch(e.phase){case"slides":return{text:`Drawing slide ${Math.min(e.done+1,e.total)} of ${e.total}`,percent:100*e.done/Math.max(1,e.total)};case"voice":return{text:`Voicing sentence ${Math.min(e.done+1,e.total)} of ${e.total}`,percent:100*e.done/Math.max(1,e.total)};case"recording":return{text:`Recording slide ${e.slide+1} of ${e.slides} · ${oe(e.time)} / ${oe(e.duration)} — in real time; the tab may go to the background`,percent:100*e.time/Math.max(1,e.duration)};default:return{text:"",percent:0}}},Bn=({control:e})=>{const{state:t,cancel:s,dismiss:n,heard:r,setHeard:o,publisher:i,keep:a}=e;if(t.status==="making"){const{text:c,percent:m}=Un(t.progress);return l.jsxs(z,{"data-deck-video":"making",sx:{display:"flex",alignItems:"center",gap:3,p:3,borderRadius:2,border:"1px solid",borderColor:"border.default"},children:[l.jsxs(z,{sx:{flex:1,display:"flex",flexDirection:"column",gap:2},children:[l.jsx(V,{sx:{fontSize:1},children:c}),l.jsx(ct,{progress:m,"aria-label":"Making the video"})]}),l.jsx(C,{leadingVisual:r?qe:Ge,"aria-pressed":!r,title:r?"Silence the speakers; the video keeps its sound":"Hear the narration as it is recorded",onClick:()=>o(!r),children:r?"Sound on":"Sound off"}),l.jsx(C,{leadingVisual:Xe,onClick:s,children:"Cancel"})]})}if(t.status==="done"){const c=(m,u)=>{const f=document.createElement("a");f.href=m,f.download=u,f.click()};return l.jsxs(X,{variant:t.kept?.status==="refused"?"warning":"success","data-deck-video":"done","data-deck-video-kept":t.kept?.status,sx:{display:"flex",alignItems:"center",gap:3,flexWrap:"wrap"},children:[l.jsx(V,{sx:{flex:1},children:Hn(t.duration,t.kept,i)}),t.kept?.status==="refused"&&l.jsx(C,{size:"small",onClick:a,children:"Upload again"}),l.jsx(C,{size:"small",leadingVisual:se,onClick:()=>c(t.videoUrl,t.videoName),children:t.videoName}),l.jsx(C,{size:"small",leadingVisual:se,onClick:()=>c(t.captionsUrl,t.captionsName),children:t.captionsName}),l.jsx(C,{size:"small",variant:"invisible",onClick:n,children:"Close"})]})}return t.status==="failed"?l.jsxs(X,{variant:"danger",sx:{display:"flex",alignItems:"center",gap:3},children:[l.jsxs(V,{sx:{flex:1},children:["The video could not be made: ",t.reason]}),l.jsx(C,{size:"small",variant:"invisible",onClick:n,children:"Close"})]}):null},Ne={};let N=Ne;const zn=new Set,Wn=()=>{zn.forEach(e=>e())},Re=e=>{const t=e&&(e.variant||e.colorMode)?e:Ne;t!==N&&(t.variant===N.variant&&t.colorMode===N.colorMode||(N=t,Wn()))},Nn=()=>N,qn=Math.round(Q/1e3),Gn=e=>{const[t,s]=d.useState(260);return d.useLayoutEffect(()=>{const n=()=>{const r=e.current;if(!r)return;const o=r.getBoundingClientRect().top+window.scrollY;s(Math.max(120,Math.round(o+48)))};return n(),window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)},[e]),t},Xn=e=>{const[t,s]=d.useState(!1),n=d.useCallback(()=>e.current?.querySelector(".dla-deck"),[e]);d.useEffect(()=>{const o=()=>s(document.fullscreenElement===n());return document.addEventListener("fullscreenchange",o),()=>document.removeEventListener("fullscreenchange",o)},[n]);const r=d.useCallback(()=>{if(document.fullscreenElement){document.exitFullscreen();return}const o=n();o?.requestFullscreen?.(),o?.dispatchEvent(new Event("pointerdown"))},[n]);return[t,r]},Yn=["notes","pdf","play","video","present"],Kn=e=>{const t=e.deck.theme,s=e.deck.colorMode;d.useEffect(()=>{const n=t&&t in tt?t:void 0,r=s==="light"||s==="dark"||s==="auto"?s:void 0;if(!n&&!r)return;const o=Nn();return Re({variant:n,colorMode:r}),()=>Re(o)},[t,s])},Jn=({spec:e,controls:t=Yn,printPath:s,slide:n,onSlideChange:r,videoPublisher:o})=>{const i=d.useRef(null),a=Gn(i),[c,m]=Xn(i);Kn(e);const u=$=>t.includes($),f=d.useRef(null),[h,g]=d.useState(null),p=d.useCallback($=>{f.current=$,g($?$.getRevealElement()??null:null)},[]),[j,D]=d.useState(Math.max(0,(n??1)-1));d.useEffect(()=>{n&&D(Math.min(e.slides.length-1,Math.max(0,n-1)))},[n,e.slides.length]);const[S,A]=d.useState(!1),w=st(),{signIn:_,videoPublisher:x}=rt(),E=o??x,v=mt(e,w,f),y=On(e,w,f,E),[k,T]=d.useState(!1),L=v.state.status==="playing",R=v.state.status==="paused",H=y.state.status==="making",O=()=>{if(w?.unavailable){T(!0);return}T(!1),v.play(f.current?.getIndices().h??j)},G=()=>{if(w?.unavailable){T(!0);return}T(!1),y.start()},b=d.useCallback($=>{D($-1),v.moved($-1),r?.($)},[r,v.moved]);return l.jsxs(z,{sx:{display:"flex",flexDirection:"column",gap:3,maxWidth:1280,mx:"auto",px:4,py:4},children:[l.jsxs(z,{sx:{display:"flex",alignItems:"flex-end",justifyContent:"space-between",flexWrap:"wrap",gap:3},children:[l.jsxs(z,{children:[l.jsx(Ye,{as:"h2",sx:{fontSize:4},children:e.deck.title}),e.deck.subtitle&&l.jsx(V,{sx:{color:"fg.muted",fontSize:1},children:e.deck.subtitle})]}),l.jsxs(z,{sx:{display:"flex",alignItems:"center",gap:2,flexWrap:"wrap"},children:[u("notes")&&l.jsx(C,{leadingVisual:Ke,"aria-pressed":S,onClick:()=>A($=>!$),children:S?"Hide notes":"Notes"}),u("pdf")&&s&&l.jsx(C,{leadingVisual:se,onClick:()=>window.open(s,"_blank","noopener"),children:"Download PDF"}),u("play")&&w&&(L||R?l.jsxs(l.Fragment,{children:[l.jsx(C,{leadingVisual:R?fe:Je,onClick:R?v.resume:v.pause,children:R?"Resume":"Pause"}),l.jsx(C,{leadingVisual:Qe,onClick:v.stop,children:"Stop"})]}):l.jsx(C,{leadingVisual:fe,onClick:O,disabled:H,children:"Play"})),u("video")&&w?.synthesize&&l.jsx(C,{leadingVisual:at,onClick:G,disabled:H||L||R,children:E?.label??"Video"}),(u("present")||c)&&l.jsx(C,{leadingVisual:c?Ze:et,onClick:m,children:c?"Exit":"Present"})]})]}),w&&k&&w.unavailable&&l.jsxs(X,{variant:"warning",sx:{display:"flex",alignItems:"center",gap:3},children:[l.jsx(V,{sx:{flex:1},children:w.unavailable}),w.needsSignIn&&_&&l.jsx(C,{size:"small",onClick:()=>_(window.location.pathname+window.location.search),children:"Sign in"})]}),l.jsx(Bn,{control:y}),v.state.status==="refused"&&l.jsxs(X,{variant:"danger",children:["Playing stopped: ",v.state.reason]}),v.state.status==="ended"&&l.jsx(V,{sx:{color:"fg.muted",fontSize:1},children:"Played to the last slide."}),l.jsx(ot,{spec:e,deckRef:p,frameRef:i,chrome:a,slide:n,onSlideChange:b}),l.jsx(me,{state:v.state,target:h}),y.following&&l.jsx(me,{state:y.following,target:h}),S&&!(c&&(L||R))&&l.jsx(gt,{notes:e.slides[j]?.notes,presenting:c,target:h}),l.jsxs(V,{sx:{color:"fg.muted",fontSize:0,textAlign:"center"},children:["Click the deck to steer it, then arrow keys or space to move ·"," ",l.jsx("strong",{children:"f"})," or Present for fullscreen · ",l.jsx("strong",{children:"o"})," for the overview · ",l.jsx("strong",{children:"?"})," for the rest · Download PDF opens the print dialog, where “Save as PDF” keeps the text and the links · Notes shows the speaker notes",w?l.jsxs(l.Fragment,{children:[" ","· Play reads them aloud, slide after slide, as captions (space pauses, Escape stops; a slide without notes stays ",qn," seconds)"]}):null,w?.synthesize?l.jsxs(l.Fragment,{children:[" ","· Video records the same, voice and captions, as a video file with its captions file (in real time)"]}):null]})]})},Qn=["notes","present"];function Zn(e){const{theme:t,colorMode:s,...n}=e.deck;return{spec:{...e,deck:n},theme:t,colorMode:s}}function rs({spec:e,moves:t,shown:s}){const n=d.useMemo(()=>Zn(e),[e]),r=d.useMemo(()=>({useTheme:()=>{const o=nt();return{theme:n.theme??o.theme,colorMode:n.colorMode??o.colorMode}}}),[n.theme,n.colorMode]);return l.jsx(it,{host:r,children:l.jsx(Jn,{spec:n.spec,controls:Qn,slide:s??n.spec.slides.length},t)})}export{Qn as PAGE_DECK_CONTROLS,rs as default,Zn as stagedDeck};
7
+ `},q=1920,ee=1080,bn=30,En=2,Ce=15e3,kn=3e3,vn=["video/mp4;codecs=avc1,mp4a.40.2","video/mp4;codecs=avc1,mp4a","video/mp4;codecs=avc1,opus","video/webm;codecs=vp9,opus","video/webm;codecs=vp8,opus"],Cn=()=>typeof MediaRecorder>"u"?void 0:vn.find(e=>MediaRecorder.isTypeSupported(e)),Tn=e=>new Promise((t,s)=>e.toBlob(n=>n?t(n):s(new Error("The slide could not be made a picture.")),"image/png"));class le extends Error{constructor(){super("Making the video was cancelled."),this.name="VideoCancelled"}}const J=e=>{if(e.aborted)throw new le},ze=e=>new Promise(t=>window.setTimeout(t,e)),Rn=["controls","progress","slide-number","pause-overlay","dla-deck-captions","dla-deck-speaker-notes"],Te=e=>!(e.classList&&Rn.some(t=>e.classList.contains(t))),$n=async(e,t)=>{await document.fonts.ready;const s=Date.now()+Ce;for(;;){const n=[...e.querySelectorAll("img")].every(o=>o.complete),r=[...e.querySelectorAll(".dla-mermaid-svg")].every(o=>o.querySelector("svg")!==null||o.classList.contains("dla-mermaid-svg--hidden"));if(n&&r)return;if(Date.now()>s)throw new Error(`Slide ${t} did not finish drawing its ${n?"diagram":"pictures"} in ${Ce/1e3} seconds.`);await ze(100)}},Pn=/^(transparent|rgba\(.*,\s*0\))$/,In=e=>{for(let t=e;t;t=t.parentElement){const s=getComputedStyle(t).backgroundColor;if(s&&!Pn.test(s))return s}return"#ffffff"},We=(e,t)=>{e.slide(t,0);const s=e.getCurrentSlide(),n=[...s.querySelectorAll(".fragment")].map(r=>Number(r.getAttribute("data-fragment-index"))).filter(Number.isFinite);return n.length&&e.slide(t,0,Math.max(...n)),s},W="dla-deck--capturing",Mn=`.${W}, .${W} *, .${W} *::before, .${W} *::after { transition: none !important; animation: none !important; }`,Dn=async(e,t)=>{const s=e.getRevealElement();if(!s)throw new Error("The deck is not on screen.");const n=e.getIndices(),r=document.createElement("style");r.textContent=Mn,document.head.appendChild(r),s.classList.add(W);try{const o=s.clientWidth,i=s.clientHeight;if(!o||!i)throw new Error("The deck has no size on screen.");const a=In(s),c=await cn(s,{filter:Te});return await t(async(m,u)=>{const f=We(e,m);await $n(f,m+1),await ze(80);const h=await an(s,{filter:Te,fontEmbedCSS:c,backgroundColor:a,pixelRatio:u.width/o,width:o,height:i,skipAutoScale:!0}),g=document.createElement("canvas");g.width=u.width,g.height=u.height;const p=g.getContext("2d");if(!p)throw new Error("This browser gives no canvas to draw the slides on.");return p.fillStyle=a,p.fillRect(0,0,u.width,u.height),p.drawImage(h,0,0,u.width,u.height),g})}finally{e.slide(n.h,n.v,n.f),window.setTimeout(()=>{s.classList.remove(W),r.remove()},100)}},Ln=(e,t,s,n)=>Dn(e,async r=>{const o=[];for(let i=0;i<t;i++)J(s),n({phase:"slides",done:i,total:t}),o.push(await r(i,{width:q,height:ee}));return n({phase:"slides",done:t,total:t}),o}),jn=async(e,t,s,n,r)=>{const o=e.flatMap((u,f)=>u.map((h,g)=>({slide:f,sentence:g,text:h}))),i=e.map(()=>[]);let a=0,c=0;r({phase:"voice",done:c,total:o.length});const m=async()=>{for(;a<o.length;){J(n);const u=o[a++],f=await t(u.text);J(n);try{i[u.slide][u.sentence]=await s.decodeAudioData(f.slice(0))}catch(h){throw new Error(`The voice of slide ${u.slide+1} could not be decoded: ${h instanceof Error?h.message:String(h)}`)}c+=1,r({phase:"voice",done:c,total:o.length})}};return await Promise.all(Array.from({length:Math.min(En,o.length)},m)),i},M={side:q*.06,bottom:ee*.05,padX:44,padY:24,radius:15,lineHeight:1.45,maxLines:3,sizes:[44,40,36,32,28],background:"rgba(15, 18, 24, 0.82)",color:"#f6f8fa",weight:600},An=(e,t,s,n)=>{if(e.drawImage(t,0,0),!s)return;const r=q-2*M.side,o=f=>`${M.weight} ${f}px ${n}`,{size:i,lines:a}=ln(s,r-2*M.padX,M.maxLines,M.sizes,(f,h)=>(e.font=o(h),e.measureText(f).width)),c=i*M.lineHeight,m=a.length*c+2*M.padY,u=ee-M.bottom-m;e.fillStyle=M.background,e.beginPath(),e.roundRect(M.side,u,r,m,M.radius),e.fill(),e.font=o(i),e.fillStyle=M.color,e.textAlign="center",e.textBaseline="middle",a.forEach((f,h)=>{e.fillText(f,q/2,u+M.padY+c*(h+.5))})},Fn=(e,t,s)=>{const n=URL.createObjectURL(new Blob([`setInterval(() => postMessage(0), ${e});`],{type:"text/javascript"})),r=new Worker(n);return r.onmessage=t,r.onerror=()=>s("The page would not start the timer that paces the video."),()=>{r.terminate(),URL.revokeObjectURL(n)}},_n=async({pictures:e,timeline:t,voiced:s,audio:n,font:r,mimeType:o,speakers:i,signal:a,onProgress:c})=>{const m=document.createElement("canvas");m.width=q,m.height=ee;const u=m.getContext("2d");if(!u)throw new Error("This browser gives no canvas to draw the video on.");const f=m.captureStream(0).getVideoTracks()[0],h=n.createMediaStreamDestination(),g=fn(n,h,i),p=new MediaRecorder(new MediaStream([f,...h.stream.getAudioTracks()]),{mimeType:o,videoBitsPerSecond:6e6,audioBitsPerSecond:128e3}),j=[];p.ondataavailable=x=>{x.data.size&&j.push(x.data)};const D=new Promise(x=>{p.onstop=()=>x()}),S=x=>{const E=Be(t,x);return An(u,e[E.slide],E.cue?.text,r),f.requestFrame(),E};await n.resume(),S(0),p.start(1e3);const A=n.currentTime,w=t.cues.map(x=>{const E=n.createBufferSource();return E.buffer=s[x.slide][x.sentence],E.connect(g),E.start(A+x.start),E});let _;try{await new Promise((x,E)=>{const v=Date.now(),y=n.currentTime;_=Fn(1e3/bn,()=>{if(a.aborted){E(new le);return}if(n.currentTime===y&&Date.now()-v>kn){E(new Error("The browser would not start the sound. Press Video again."));return}const k=Math.max(0,n.currentTime-A),T=S(k);c({phase:"recording",slide:T.slide,sentence:yn(t,k).sentence,slides:t.slides.length,time:Math.min(k,t.duration),duration:t.duration}),k>=t.duration&&x()},k=>E(new Error(k)))})}finally{_?.(),w.forEach(x=>{try{x.stop()}catch{}x.disconnect()}),g.disconnect(),p.stop(),await D,f.stop()}return new Blob(j,{type:p.mimeType||o})},Vn=async({deck:e,script:t,synthesize:s,audio:n,speakers:r,title:o,signal:i,onProgress:a})=>{const c=Cn();if(!c)throw new Error("This browser cannot record a video (MediaRecorder records neither MP4 nor WebM).");const m=e.getRevealElement(),u=m&&getComputedStyle(m).getPropertyValue("--dla-deck-font").trim()||"system-ui, sans-serif",f=await Ln(e,t.length,i,a),h=await Tn(f[0]),g=await jn(t,s,n,i,a);J(i);const p=wn(t,g.map(D=>D.map(S=>S.duration)));return{video:await _n({pictures:f,timeline:p,voiced:g,audio:n,font:u,mimeType:c,speakers:r,signal:i,onProgress:a}),extension:c.startsWith("video/mp4")?"mp4":"webm",vtt:Sn(p.cues,o),poster:h,timeline:p}},Un=(e,t,s)=>{const n=`The video is ready: ${oe(e)}, with its captions.`;if(!t||!s)return n;switch(t.status){case"keeping":return`${n} Uploading it…`;case"kept":return`${n} ${s.published}`;case"refused":return`${n} It could not be uploaded: ${t.reason}`}},Hn=(e,t,s,n)=>{const[r,o]=d.useState({status:"idle"}),i=d.useRef(null),[a,c]=d.useState(!0),m=d.useRef(!0),u=d.useRef(null),[f,h]=d.useState([]),g=d.useRef([]),p=d.useRef(null),j=d.useRef(e),D=d.useRef(n);D.current=n;const S=d.useCallback(()=>{g.current.forEach(y=>URL.revokeObjectURL(y)),g.current=[],p.current=null},[]),A=d.useCallback(()=>{const y=p.current,k=D.current;if(!y||!k)return;const T=L=>o(R=>R.status==="done"&&p.current===y?{...R,kept:L}:R);T({status:"keeping"}),k.publish(y,j.current).then(()=>T({status:"kept"})).catch(L=>T({status:"refused",reason:L instanceof Error?L.message:String(L)}))},[]),w=d.useCallback(()=>{const y=t?.synthesize,k=s.current;if(!y||!k||i.current)return;S(),j.current=e;const T=k.getIndices(),L=Ie(e.slides,t?.sentences??ie);h(L);let R=-1;const U=new AbortController;i.current=U;const H=new AudioContext;H.resume(),u.current=un(H,m.current),o({status:"making",progress:{phase:"slides",done:0,total:e.slides.length}});const G=e.deck.title;Vn({deck:k,script:L,synthesize:y,audio:H,speakers:u.current,title:G,signal:U.signal,onProgress:b=>{U.signal.aborted||(b.phase==="recording"&&b.slide!==R&&(R=b.slide,We(k,b.slide)),o({status:"making",progress:b}))}}).then(b=>{const $=xn(G),ue=URL.createObjectURL(b.video),de=URL.createObjectURL(new Blob([b.vtt],{type:"text/vtt;charset=utf-8"}));g.current=[ue,de],p.current=b,o({status:"done",videoUrl:ue,videoName:`${$}.${b.extension}`,captionsUrl:de,captionsName:`${$}.vtt`,duration:b.timeline.duration}),A()}).catch(b=>{o(b instanceof le?{status:"idle"}:{status:"failed",reason:b instanceof Error?b.message:String(b)})}).finally(()=>{if(i.current=null,u.current=null,R>=0)try{k.slide(T.h,T.v,T.f)}catch{}H.close()})},[s,S,A,t,e]),_=d.useCallback(()=>i.current?.abort(),[]),x=d.useCallback(y=>{m.current=y,c(y),u.current&&dn(u.current,y)},[]),E=d.useCallback(()=>{S(),o({status:"idle"})},[S]);d.useEffect(()=>()=>{i.current?.abort(),S()},[S]);const v=r.status==="making"&&r.progress.phase==="recording"?{status:"playing",script:f,slide:r.progress.slide,sentence:r.progress.sentence,run:0}:void 0;return{state:r,start:w,cancel:_,heard:a,setHeard:x,following:v,dismiss:E,publisher:n,keep:A}},On=e=>{switch(e.phase){case"slides":return{text:`Drawing slide ${Math.min(e.done+1,e.total)} of ${e.total}`,percent:100*e.done/Math.max(1,e.total)};case"voice":return{text:`Voicing sentence ${Math.min(e.done+1,e.total)} of ${e.total}`,percent:100*e.done/Math.max(1,e.total)};case"recording":return{text:`Recording slide ${e.slide+1} of ${e.slides} · ${oe(e.time)} / ${oe(e.duration)} — in real time; the tab may go to the background`,percent:100*e.time/Math.max(1,e.duration)};default:return{text:"",percent:0}}},Bn=({control:e})=>{const{state:t,cancel:s,dismiss:n,heard:r,setHeard:o,publisher:i,keep:a}=e;if(t.status==="making"){const{text:c,percent:m}=On(t.progress);return l.jsxs(z,{"data-deck-video":"making",sx:{display:"flex",alignItems:"center",gap:3,p:3,borderRadius:2,border:"1px solid",borderColor:"border.default"},children:[l.jsxs(z,{sx:{flex:1,display:"flex",flexDirection:"column",gap:2},children:[l.jsx(V,{sx:{fontSize:1},children:c}),l.jsx(ct,{progress:m,"aria-label":"Making the video"})]}),l.jsx(C,{leadingVisual:r?qe:Ge,"aria-pressed":!r,title:r?"Silence the speakers; the video keeps its sound":"Hear the narration as it is recorded",onClick:()=>o(!r),children:r?"Sound on":"Sound off"}),l.jsx(C,{leadingVisual:Xe,onClick:s,children:"Cancel"})]})}if(t.status==="done"){const c=(m,u)=>{const f=document.createElement("a");f.href=m,f.download=u,f.click()};return l.jsxs(X,{variant:t.kept?.status==="refused"?"warning":"success","data-deck-video":"done","data-deck-video-kept":t.kept?.status,sx:{display:"flex",alignItems:"center",gap:3,flexWrap:"wrap"},children:[l.jsx(V,{sx:{flex:1},children:Un(t.duration,t.kept,i)}),t.kept?.status==="refused"&&l.jsx(C,{size:"small",onClick:a,children:"Upload again"}),l.jsx(C,{size:"small",leadingVisual:se,onClick:()=>c(t.videoUrl,t.videoName),children:t.videoName}),l.jsx(C,{size:"small",leadingVisual:se,onClick:()=>c(t.captionsUrl,t.captionsName),children:t.captionsName}),l.jsx(C,{size:"small",variant:"invisible",onClick:n,children:"Close"})]})}return t.status==="failed"?l.jsxs(X,{variant:"danger",sx:{display:"flex",alignItems:"center",gap:3},children:[l.jsxs(V,{sx:{flex:1},children:["The video could not be made: ",t.reason]}),l.jsx(C,{size:"small",variant:"invisible",onClick:n,children:"Close"})]}):null},Ne={};let N=Ne;const zn=new Set,Wn=()=>{zn.forEach(e=>e())},Re=e=>{const t=e&&(e.variant||e.colorMode)?e:Ne;t!==N&&(t.variant===N.variant&&t.colorMode===N.colorMode||(N=t,Wn()))},Nn=()=>N,qn=Math.round(Q/1e3),Gn=e=>{const[t,s]=d.useState(260);return d.useLayoutEffect(()=>{const n=()=>{const r=e.current;if(!r)return;const o=r.getBoundingClientRect().top+window.scrollY;s(Math.max(120,Math.round(o+48)))};return n(),window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)},[e]),t},Xn=e=>{const[t,s]=d.useState(!1),n=d.useCallback(()=>e.current?.querySelector(".dla-deck"),[e]);d.useEffect(()=>{const o=()=>s(document.fullscreenElement===n());return document.addEventListener("fullscreenchange",o),()=>document.removeEventListener("fullscreenchange",o)},[n]);const r=d.useCallback(()=>{if(document.fullscreenElement){document.exitFullscreen();return}const o=n();o?.requestFullscreen?.(),o?.dispatchEvent(new Event("pointerdown"))},[n]);return[t,r]},Yn=["notes","pdf","play","video","present"],Kn=e=>{const t=e.deck.theme,s=e.deck.colorMode;d.useEffect(()=>{const n=t&&t in tt?t:void 0,r=s==="light"||s==="dark"||s==="auto"?s:void 0;if(!n&&!r)return;const o=Nn();return Re({variant:n,colorMode:r}),()=>Re(o)},[t,s])},Jn=({spec:e,controls:t=Yn,printPath:s,slide:n,onSlideChange:r,videoPublisher:o})=>{const i=d.useRef(null),a=Gn(i),[c,m]=Xn(i);Kn(e);const u=$=>t.includes($),f=d.useRef(null),[h,g]=d.useState(null),p=d.useCallback($=>{f.current=$,g($?$.getRevealElement()??null:null)},[]),[j,D]=d.useState(Math.max(0,(n??1)-1));d.useEffect(()=>{n&&D(Math.min(e.slides.length-1,Math.max(0,n-1)))},[n,e.slides.length]);const[S,A]=d.useState(!1),w=st(),{signIn:_,videoPublisher:x}=rt(),E=o??x,v=mt(e,w,f),y=Hn(e,w,f,E),[k,T]=d.useState(!1),L=v.state.status==="playing",R=v.state.status==="paused",U=y.state.status==="making",H=()=>{if(w?.unavailable){T(!0);return}T(!1),v.play(f.current?.getIndices().h??j)},G=()=>{if(w?.unavailable){T(!0);return}T(!1),y.start()},b=d.useCallback($=>{D($-1),v.moved($-1),r?.($)},[r,v.moved]);return l.jsxs(z,{sx:{display:"flex",flexDirection:"column",gap:3,maxWidth:1280,mx:"auto",px:4,py:4},children:[l.jsxs(z,{sx:{display:"flex",alignItems:"flex-end",justifyContent:"space-between",flexWrap:"wrap",gap:3},children:[l.jsxs(z,{children:[l.jsx(Ye,{as:"h2",sx:{fontSize:4},children:e.deck.title}),e.deck.subtitle&&l.jsx(V,{sx:{color:"fg.muted",fontSize:1},children:e.deck.subtitle})]}),l.jsxs(z,{sx:{display:"flex",alignItems:"center",gap:2,flexWrap:"wrap"},children:[u("notes")&&l.jsx(C,{leadingVisual:Ke,"aria-pressed":S,onClick:()=>A($=>!$),children:S?"Hide notes":"Notes"}),u("pdf")&&s&&l.jsx(C,{leadingVisual:se,onClick:()=>window.open(s,"_blank","noopener"),children:"Download PDF"}),u("play")&&w&&(L||R?l.jsxs(l.Fragment,{children:[l.jsx(C,{leadingVisual:R?fe:Je,onClick:R?v.resume:v.pause,children:R?"Resume":"Pause"}),l.jsx(C,{leadingVisual:Qe,onClick:v.stop,children:"Stop"})]}):l.jsx(C,{leadingVisual:fe,onClick:H,disabled:U,children:"Play"})),u("video")&&w?.synthesize&&l.jsx(C,{leadingVisual:at,onClick:G,disabled:U||L||R,children:E?.label??"Video"}),(u("present")||c)&&l.jsx(C,{leadingVisual:c?Ze:et,onClick:m,children:c?"Exit":"Present"})]})]}),w&&k&&w.unavailable&&l.jsxs(X,{variant:"warning",sx:{display:"flex",alignItems:"center",gap:3},children:[l.jsx(V,{sx:{flex:1},children:w.unavailable}),w.needsSignIn&&_&&l.jsx(C,{size:"small",onClick:()=>_(window.location.pathname+window.location.search),children:"Sign in"})]}),l.jsx(Bn,{control:y}),v.state.status==="refused"&&l.jsxs(X,{variant:"danger",children:["Playing stopped: ",v.state.reason]}),v.state.status==="ended"&&l.jsx(V,{sx:{color:"fg.muted",fontSize:1},children:"Played to the last slide."}),l.jsx(ot,{spec:e,deckRef:p,frameRef:i,chrome:a,slide:n,onSlideChange:b}),l.jsx(me,{state:v.state,target:h}),y.following&&l.jsx(me,{state:y.following,target:h}),S&&!(c&&(L||R))&&l.jsx(gt,{notes:e.slides[j]?.notes,presenting:c,target:h}),l.jsxs(V,{sx:{color:"fg.muted",fontSize:0,textAlign:"center"},children:["Click the deck to steer it, then arrow keys or space to move ·"," ",l.jsx("strong",{children:"f"})," or Present for fullscreen · ",l.jsx("strong",{children:"o"})," for the overview · ",l.jsx("strong",{children:"?"})," for the rest · Download PDF opens the print dialog, where “Save as PDF” keeps the text and the links · Notes shows the speaker notes",w?l.jsxs(l.Fragment,{children:[" ","· Play reads them aloud, slide after slide, as captions (space pauses, Escape stops; a slide without notes stays ",qn," seconds)"]}):null,w?.synthesize?l.jsxs(l.Fragment,{children:[" ","· Video records the same, voice and captions, as a video file with its captions file (in real time)"]}):null]})]})},Qn=["notes","present"];function Zn(e){const{theme:t,colorMode:s,...n}=e.deck;return{spec:{...e,deck:n},theme:t,colorMode:s}}function rs({spec:e,moves:t,shown:s}){const n=d.useMemo(()=>Zn(e),[e]),r=d.useMemo(()=>({useTheme:()=>{const o=nt();return{theme:n.theme??o.theme,colorMode:n.colorMode??o.colorMode}}}),[n.theme,n.colorMode]);return l.jsx(it,{host:r,children:l.jsx(Jn,{spec:n.spec,controls:Qn,slide:s??n.spec.slides.length},t)})}export{Qn as PAGE_DECK_CONTROLS,rs as default,Zn as stagedDeck};
@@ -1,3 +1,3 @@
1
- import{a7 as b,a8 as v,ad as E,r as I,j as i,B as c,T as N,bK as j,bL as T,bM as U}from"../datalayer-app-main.js";import{EphemeralDocument as O}from"./EphemeralDocument-GaUco3ov.js";import{O as _,b as M,u as P}from"./openingNotebook-Cgaunp7v.js";import{P as d}from"./PrismCss-Dd5n9e4a.js";import"./lexicalHooks-CVBA8Kup.js";import"./LexicalToolRegistry-CxE-muFM.js";import"./useProgressTask-XOysd2vC.js";import"./JupyterLexicalExtension-Df6IrbR-.js";import"./NotebookSkeleton-KHb2YSpG.js";import"./Avatar-CBmqA_yJ.js";import"./url-DhPU-y-U.js";import"./isObject-CeOzAI2h.js";import"./toNumber-DUdf79Nr.js";import"./isSymbol-DfwdEMHq.js";import"./StrikethroughIcon-CbiEuPT-.js";import"./TypographyIcon-CCkcdj7U.js";import"./ArrowUpIcon-y5enrVH9.js";import"./SortDescIcon-Qif6E10I.js";import"./PaintbrushIcon-CFBHU-3l.js";import"./VideoIcon-DIIszW1S.js";import"./Output-DbuS5mTW.js";import"./index-CnpOaqg6.js";import"./hoverbox-CStlKQWE.js";import"./index-UMhfKl2p.js";import"./index-Bc6gicqV.js";import"./dayjs.min-u3zuoSR8.js";import"./isEqual-BybBNsZK.js";import"./d3-color-Jd8hXty2.js";import"./dist-SKaIYcRD.js";import"./index-C0KhmyXF.js";import"./RestartIcon-DvpOf5Mf.js";const D="Quarterly revenue by region",S="Six rows of revenue, two quarters, three regions. The cell below loads them and shows the frame; run it, change it, or ask an agent to take it further — the code and its output live in this document, beside the words about them.",l="opening-document-input",w="opening-document-output",g=e=>({detail:0,format:0,mode:"normal",style:"",text:e,type:"text",version:1}),u=(e,o,t={})=>({children:o,direction:"ltr",format:"",indent:0,type:e,version:1,...t}),h={type:"linebreak",version:1},s=(e,o)=>({detail:0,format:0,mode:"normal",style:"",text:e,type:"jupyter-input-highlight",version:1,highlightType:o}),f=e=>e.flatMap(o=>{if(typeof o=="string")return o.split(`
1
+ import{a7 as b,a8 as v,ad as E,r as I,j as i,B as c,T as N,bK as j,bL as T,bM as U}from"../datalayer-app-main.js";import{EphemeralDocument as O}from"./EphemeralDocument-BxEBdArS.js";import{O as _,b as M,u as P}from"./openingNotebook-Cgaunp7v.js";import{P as d}from"./PrismCss-Dd5n9e4a.js";import"./lexicalHooks-Bh9Bp3P-.js";import"./LexicalToolRegistry-CjiooYJz.js";import"./useProgressTask-XOysd2vC.js";import"./JupyterLexicalExtension-DEiuU9XK.js";import"./NotebookSkeleton-KHb2YSpG.js";import"./Avatar-CBmqA_yJ.js";import"./url-DhPU-y-U.js";import"./isObject-CeOzAI2h.js";import"./toNumber-DUdf79Nr.js";import"./isSymbol-DfwdEMHq.js";import"./StrikethroughIcon-CbiEuPT-.js";import"./TypographyIcon-CCkcdj7U.js";import"./ArrowUpIcon-y5enrVH9.js";import"./SortDescIcon-Qif6E10I.js";import"./PaintbrushIcon-CFBHU-3l.js";import"./VideoIcon-DIIszW1S.js";import"./Output-DIp_tlWH.js";import"./index-CUjcBn1v.js";import"./hoverbox-CStlKQWE.js";import"./index-tO6w-mHa.js";import"./index-BNjq7TZD.js";import"./dayjs.min-u3zuoSR8.js";import"./isEqual-niFNV5MZ.js";import"./d3-color-Jd8hXty2.js";import"./dist-SKaIYcRD.js";import"./index-C0KhmyXF.js";import"./RestartIcon-DvpOf5Mf.js";const D="Quarterly revenue by region",S="Six rows of revenue, two quarters, three regions. The cell below loads them and shows the frame; run it, change it, or ask an agent to take it further — the code and its output live in this document, beside the words about them.",l="opening-document-input",w="opening-document-output",g=e=>({detail:0,format:0,mode:"normal",style:"",text:e,type:"text",version:1}),u=(e,o,t={})=>({children:o,direction:"ltr",format:"",indent:0,type:e,version:1,...t}),h={type:"linebreak",version:1},s=(e,o)=>({detail:0,format:0,mode:"normal",style:"",text:e,type:"jupyter-input-highlight",version:1,highlightType:o}),f=e=>e.flatMap(o=>{if(typeof o=="string")return o.split(`
2
2
  `).flatMap((n,m)=>[...m>0?[h]:[],...n.length>0?[s(n)]:[]]);const{content:t,type:r}=o;return typeof t=="string"?[s(t,r)]:Array.isArray(t)?t.length===1&&typeof t[0]=="string"?[s(t[0],r)]:f(t):[]}),k=e=>{const o=d.languages.python;return o?f(d.tokenize(e,o)):e.split(`
3
3
  `).flatMap((t,r)=>[...r>0?[h]:[],...t.length>0?[s(t)]:[]])};function A(){const e=_.join("");return{root:{children:[u("heading",[g(D)],{tag:"h1"}),u("paragraph",[g(S)],{textFormat:0,textStyle:""}),u("jupyter-input",k(e),{language:"python",jupyterInputNodeUuid:l}),{type:"jupyter-output",version:1,format:"",source:e,outputs:[{output_type:"execute_result",execution_count:1,data:{"text/plain":M},metadata:{}}],jupyterInputNodeUuid:l,jupyterOutputNodeUuid:w}],direction:"ltr",format:"",indent:0,type:"root",version:1}}}function lt({workspace:e}){const o=b(),t=v(o.snapshot),r=e.surfaceId,n=P(T,j,{workspace:e,editorId:r}),a=E(U)[0]?.value,y=I.useMemo(()=>JSON.stringify((a?.document??A)()),[a]),x=a?.autoFocus??!0;if(t.state!=="running")return i.jsx(c,{height:"100%",display:"flex",alignItems:"center",justifyContent:"center",color:"fg.muted",fontSize:1,px:4,textAlign:"center",children:i.jsx(N,{children:"The document needs a running sandbox for its code blocks. Open the Sandbox view to see what it is doing."})});const p=o.getServiceManager()??void 0;return i.jsx(c,{height:"100%",minHeight:0,children:i.jsx(O,{inheritTheme:!0,documentId:r,content:y,autoFocus:x,serviceManager:p,showToolbar:n.present,toolbarExtraItems:n.items,kernelId:p?t.kernelId:void 0,runtimeOverride:!p&&t.jupyterUrl?{baseUrl:t.jupyterUrl,token:t.jupyterToken}:void 0})})}export{lt as default};
@@ -1 +1 @@
1
- import{r,aY as ke,aZ as be,a_ as Se,a$ as je,b0 as we,j as e,B as M,b1 as ve,b2 as Ce,b3 as Ee,b4 as Re,b5 as V,k as $,b6 as Me,b7 as Te,b8 as Pe,aj as T,b9 as Ne,ba as Y,bb as q,bc as De,bd as Ue}from"../datalayer-app-main.js";import{useLexicalTools as He}from"./lexicalHooks-CVBA8Kup.js";import{u as Be}from"./useProgressTask-XOysd2vC.js";import{L as Ie,k as Le,T as We,m as Ae,n as _e,o as Fe,D as K,p as Je,q as ze,s as Ve,t as $e,J as Ye,u as qe,F as Ke,v as Ze,w as Ge,x as Qe,y as Xe}from"./JupyterLexicalExtension-Df6IrbR-.js";import"./LexicalToolRegistry-CxE-muFM.js";import"./NotebookSkeleton-KHb2YSpG.js";import"./Avatar-CBmqA_yJ.js";import"./url-DhPU-y-U.js";import"./isObject-CeOzAI2h.js";import"./toNumber-DUdf79Nr.js";import"./isSymbol-DfwdEMHq.js";import"./StrikethroughIcon-CbiEuPT-.js";import"./TypographyIcon-CCkcdj7U.js";import"./ArrowUpIcon-y5enrVH9.js";import"./SortDescIcon-Qif6E10I.js";import"./PaintbrushIcon-CFBHU-3l.js";import"./VideoIcon-DIIszW1S.js";import"./PrismCss-Dd5n9e4a.js";import"./Output-DbuS5mTW.js";import"./index-CnpOaqg6.js";import"./hoverbox-CStlKQWE.js";import"./index-UMhfKl2p.js";import"./index-Bc6gicqV.js";import"./dayjs.min-u3zuoSR8.js";import"./isEqual-BybBNsZK.js";import"./d3-color-Jd8hXty2.js";import"./dist-SKaIYcRD.js";import"./index-C0KhmyXF.js";import"./RestartIcon-DvpOf5Mf.js";function Oe({content:o}){const[s]=T(),l=r.useRef(!0);return r.useEffect(()=>{if(l.current){if(l.current=!1,!o){s.update(()=>{const t=Y();t.getChildrenSize()===0&&t.append(q())},{tag:"history-merge"});return}try{const t=JSON.parse(o);if(t&&typeof t=="object"&&t.root){const d=s.parseEditorState(o);s.setEditorState(d,{tag:"history-merge"})}else throw new Error("Invalid Lexical editor state format")}catch{s.update(()=>{const t=Y();t.clear(),t.append(q())},{tag:"history-merge"})}}},[o,s]),null}function et({disabled:o}){const[s]=T();return r.useEffect(()=>{Ne(s,De).output.disabled.value=o},[s,o]),null}function tt({setIsLinkEditMode:o,extraItems:s}){const[l]=T(),[t,d]=r.useState(l);return e.jsx(Xe,{editor:l,activeEditor:t,setActiveEditor:d,setIsLinkEditMode:o,extraItems:s})}function Z({inherit:o,colorMode:s,themeConfig:l,children:t}){return o?e.jsx(e.Fragment,{children:t}):e.jsx(Te,{colorMode:s,theme:l.primerTheme,themeStyles:l.themeStyles,children:t})}function Ut({documentId:o,runtimeName:s,runtimeOverride:l,serviceManager:t,kernelId:d,themeVariant:G,colorMode:Q,content:P,onContentChange:j,onToolsReady:N,onKernelChange:w,collaboration:n,toolbarExtraItems:X,showToolbar:O=!0,inheritTheme:D=!1,autoFocus:U=!0}){const h=!!(n?.websocketUrl&&n?.roomId),ee=n?.identity?.displayName||n?.identity?.handle||n?.identity?.userId,te=n?.identity?.color,ne=r.useMemo(()=>({user:{id:n?.identity?.userId,username:n?.identity?.userId||n?.identity?.handle||n?.identity?.displayName,name:n?.identity?.handle||n?.identity?.displayName,display_name:n?.identity?.displayName||n?.identity?.handle,initials:n?.identity?.initials,color:n?.identity?.color,avatar_url:n?.identity?.avatarUrl,handle:n?.identity?.handle}}),[n?.identity]),H=r.useRef(P),B=r.useRef(o);B.current!==o&&(B.current=o,H.current=P);const I=H.current,L=r.useRef(I??""),W=He(o);r.useEffect(()=>{N?.(W)},[W,N]);const{runtimes:A,refetchRuntimes:v}=ke(),m=r.useMemo(()=>{const i=String(l?.baseUrl||"").trim();if(i)return{url:i,wsUrl:String(l?.wsUrl||"").trim()||void 0,token:String(l?.token||"").trim(),runtime_name:String(l?.runtimeName||"").trim()||"agent-node-proxy"};const a=String(s||"").trim();if(a)return A.find(S=>String(S?.runtime_name||"")===a)},[l,s,A]),_=!!(!l?.baseUrl&&String(s||"").trim()&&!m);r.useEffect(()=>{if(!_)return;v();const i=window.setInterval(()=>{v()},1e3);return()=>{window.clearInterval(i)}},[_,v]);const[re,g]=r.useState(null),[p,f]=r.useState(void 0);r.useEffect(()=>{let i=!1,a=null,S=null;return(async()=>{if(t){try{await t.ready;const u=d?t.kernels.connectTo({model:{id:d,name:"python"}}):await t.kernels.startNew();i||(g(t),f(new V({kernelName:u.model.name,kernelSpecName:u.model.name,kernelModel:u.model,kernelManager:t.kernels,kernelspecsManager:t.kernelspecs,sessionManager:t.sessions})))}catch(u){console.error("[agent-runtimes] The document could not reach the kernel of the sandbox it was given.",u),i||(g(null),f(void 0))}return}const E=String(m?.url||"").trim();if(!E){i||(g(null),f(void 0));return}try{const u=String(m?.token||"").trim(),pe=String(m?.wsUrl||"").trim()||E.replace(/^http/,"ws"),xe=$.ServerConnection.makeSettings({baseUrl:E,wsUrl:pe,token:u,appendToken:!0});a=new $.ServiceManager({serverSettings:xe}),S=Me(String(m?.runtime_name||""),a),await a.ready;const R=await a.kernels.startNew();if(!i){const ye=new V({kernelName:R.model.name,kernelSpecName:R.model.name,kernelModel:R.model,kernelManager:a.kernels,kernelspecsManager:a.kernelspecs,sessionManager:a.sessions});g(a),f(ye)}}catch{i||(g(null),f(void 0))}})(),()=>{i=!0,S?.(),a&&Ue(a)}},[t,d,m?.runtime_name,m?.url,m?.token]),r.useEffect(()=>(w?.(p?.connection??null),()=>{w?.(null)}),[p,w]);const C=re,F=!!((String(s||"").trim()||String(l?.baseUrl||"").trim()||t)&&!C);Be(`ephemeral-document-start-${o}`,F);const oe=r.useMemo(()=>be({name:"@datalayer/agent-runtimes/EphemeralDocument",namespace:`ephemeral-document-${o}`,theme:Qe,dependencies:[Ge,...U?[Pe]:[]],onError(i){console.error("[EphemeralDocument]",i)}}),[o,U]),ie=r.useCallback(i=>{if(!j)return;const a=JSON.stringify(i.toJSON());a!==L.current&&(L.current=a,j(a))},[j]),[x,se]=r.useState(null),[,J]=r.useState(!1),y=h?n?.roomId:void 0,[ae,le]=r.useState(),ce=y===void 0||ae===y,me=r.useCallback(i=>le(i?y:void 0),[y]),de=i=>{i!==null&&se(i)},{colorMode:ue,theme:he}=Se(),k=Q??ue,ge=G??he,fe=je(),b=we(ge),z=k==="auto"?fe:k,c=(z==="dark"?b.themeStyles.dark:b.themeStyles.light).backgroundColor??"";return e.jsx(M,{flex:1,minHeight:0,height:"100%",position:"relative",overflow:"hidden",bg:"canvas.default",children:C?e.jsx(Z,{inherit:D,colorMode:k,themeConfig:b,children:e.jsx(ve,{colormode:z,backgroundColor:c,children:e.jsx(M,{sx:{position:"absolute",inset:0,display:"flex",flexDirection:"column",minHeight:0,overflow:"hidden",overscrollBehaviorY:"contain",padding:2,backgroundColor:c,"--bgColor-default":c,"& .editor-shell":{backgroundColor:c,borderRadius:2,display:"flex",flexDirection:"column",minHeight:0,flex:1,maxWidth:"none",width:"100%",margin:0},"& .editor-container":{backgroundColor:c,display:"flex",flexDirection:"column",minHeight:0,flex:1,width:"100%",maxWidth:"none",margin:0},"& .editor-inner":{backgroundColor:c,display:"flex",flexDirection:"column",minHeight:0,flex:1,width:"100%",maxWidth:"none"},"& .editor-scroller":{minHeight:0,flex:1,overflow:"auto",width:"100%",maxWidth:"none"},"& .editor":{minHeight:"100%",width:"100%",maxWidth:"none",margin:0},"& .editor-input":{backgroundColor:c,width:"100%",maxWidth:"none",margin:0},"& .ContentEditable__root":{width:"100%",maxWidth:"none",margin:0},'& [role="toolbar"][aria-label="Editor toolbar"]':{backgroundColor:c}},children:e.jsx(Ie,{lexicalId:o,serviceManager:C,children:e.jsx(Ce,{extension:oe,contentEditable:null,children:e.jsx(Le,{children:e.jsx(We,{children:e.jsxs("div",{className:"editor-shell",children:[O?e.jsx(tt,{setIsLinkEditMode:J,extraItems:X}):null,e.jsx("div",{className:"editor-container",children:e.jsxs("div",{className:"editor-inner",children:[h&&n?e.jsx(Ae,{id:n.roomId,providerFactory:_e,websocketUrl:n.websocketUrl,shouldBootstrap:!0,showCollaborators:!0,username:ee,cursorColor:te,awarenessData:ne,onInitialization:me}):null,e.jsx(Fe,{}),ce?e.jsx("div",{className:"editor-scroller",children:e.jsx("div",{className:"editor",ref:de,children:e.jsx(Ee,{className:"editor-input","aria-label":"Ephemeral document editor"})})}):e.jsx(K,{maxWidth:"100%"}),!h&&e.jsx(Re,{onChange:ie}),e.jsx(et,{disabled:h}),!h&&e.jsx(Oe,{content:I}),e.jsx(Je,{}),e.jsx(ze,{}),e.jsx(Ve,{}),e.jsx($e,{kernel:p}),e.jsx(Ye,{kernel:p}),x&&e.jsxs(e.Fragment,{children:[e.jsx(qe,{anchorElem:x}),e.jsx(Ke,{anchorElem:x,setIsLinkEditMode:J}),e.jsx(Ze,{anchorElem:x})]})]})})]})})})})})})})}):F?e.jsx(Z,{inherit:D,colorMode:k,themeConfig:b,children:e.jsx(M,{position:"absolute",inset:0,display:"flex",flexDirection:"column",padding:2,backgroundColor:c,children:e.jsx(K,{label:"Starting the document",maxWidth:"100%"})})}):null})}export{Ut as EphemeralDocument,Ut as default};
1
+ import{r,aY as ke,aZ as be,a_ as Se,a$ as je,b0 as we,j as e,B as M,b1 as ve,b2 as Ce,b3 as Ee,b4 as Re,b5 as V,k as $,b6 as Me,b7 as Te,b8 as Pe,aj as T,b9 as Ne,ba as Y,bb as q,bc as De,bd as Ue}from"../datalayer-app-main.js";import{useLexicalTools as He}from"./lexicalHooks-Bh9Bp3P-.js";import{u as Be}from"./useProgressTask-XOysd2vC.js";import{L as Ie,k as Le,T as We,m as Ae,n as _e,o as Fe,D as K,p as Je,q as ze,s as Ve,t as $e,J as Ye,u as qe,F as Ke,v as Ze,w as Ge,x as Qe,y as Xe}from"./JupyterLexicalExtension-DEiuU9XK.js";import"./LexicalToolRegistry-CjiooYJz.js";import"./NotebookSkeleton-KHb2YSpG.js";import"./Avatar-CBmqA_yJ.js";import"./url-DhPU-y-U.js";import"./isObject-CeOzAI2h.js";import"./toNumber-DUdf79Nr.js";import"./isSymbol-DfwdEMHq.js";import"./StrikethroughIcon-CbiEuPT-.js";import"./TypographyIcon-CCkcdj7U.js";import"./ArrowUpIcon-y5enrVH9.js";import"./SortDescIcon-Qif6E10I.js";import"./PaintbrushIcon-CFBHU-3l.js";import"./VideoIcon-DIIszW1S.js";import"./PrismCss-Dd5n9e4a.js";import"./Output-DIp_tlWH.js";import"./index-CUjcBn1v.js";import"./hoverbox-CStlKQWE.js";import"./index-tO6w-mHa.js";import"./index-BNjq7TZD.js";import"./dayjs.min-u3zuoSR8.js";import"./isEqual-niFNV5MZ.js";import"./d3-color-Jd8hXty2.js";import"./dist-SKaIYcRD.js";import"./index-C0KhmyXF.js";import"./RestartIcon-DvpOf5Mf.js";function Oe({content:o}){const[s]=T(),l=r.useRef(!0);return r.useEffect(()=>{if(l.current){if(l.current=!1,!o){s.update(()=>{const t=Y();t.getChildrenSize()===0&&t.append(q())},{tag:"history-merge"});return}try{const t=JSON.parse(o);if(t&&typeof t=="object"&&t.root){const d=s.parseEditorState(o);s.setEditorState(d,{tag:"history-merge"})}else throw new Error("Invalid Lexical editor state format")}catch{s.update(()=>{const t=Y();t.clear(),t.append(q())},{tag:"history-merge"})}}},[o,s]),null}function et({disabled:o}){const[s]=T();return r.useEffect(()=>{Ne(s,De).output.disabled.value=o},[s,o]),null}function tt({setIsLinkEditMode:o,extraItems:s}){const[l]=T(),[t,d]=r.useState(l);return e.jsx(Xe,{editor:l,activeEditor:t,setActiveEditor:d,setIsLinkEditMode:o,extraItems:s})}function Z({inherit:o,colorMode:s,themeConfig:l,children:t}){return o?e.jsx(e.Fragment,{children:t}):e.jsx(Te,{colorMode:s,theme:l.primerTheme,themeStyles:l.themeStyles,children:t})}function Ut({documentId:o,runtimeName:s,runtimeOverride:l,serviceManager:t,kernelId:d,themeVariant:G,colorMode:Q,content:P,onContentChange:j,onToolsReady:N,onKernelChange:w,collaboration:n,toolbarExtraItems:X,showToolbar:O=!0,inheritTheme:D=!1,autoFocus:U=!0}){const h=!!(n?.websocketUrl&&n?.roomId),ee=n?.identity?.displayName||n?.identity?.handle||n?.identity?.userId,te=n?.identity?.color,ne=r.useMemo(()=>({user:{id:n?.identity?.userId,username:n?.identity?.userId||n?.identity?.handle||n?.identity?.displayName,name:n?.identity?.handle||n?.identity?.displayName,display_name:n?.identity?.displayName||n?.identity?.handle,initials:n?.identity?.initials,color:n?.identity?.color,avatar_url:n?.identity?.avatarUrl,handle:n?.identity?.handle}}),[n?.identity]),H=r.useRef(P),B=r.useRef(o);B.current!==o&&(B.current=o,H.current=P);const I=H.current,L=r.useRef(I??""),W=He(o);r.useEffect(()=>{N?.(W)},[W,N]);const{runtimes:A,refetchRuntimes:v}=ke(),m=r.useMemo(()=>{const i=String(l?.baseUrl||"").trim();if(i)return{url:i,wsUrl:String(l?.wsUrl||"").trim()||void 0,token:String(l?.token||"").trim(),runtime_name:String(l?.runtimeName||"").trim()||"agent-node-proxy"};const a=String(s||"").trim();if(a)return A.find(S=>String(S?.runtime_name||"")===a)},[l,s,A]),_=!!(!l?.baseUrl&&String(s||"").trim()&&!m);r.useEffect(()=>{if(!_)return;v();const i=window.setInterval(()=>{v()},1e3);return()=>{window.clearInterval(i)}},[_,v]);const[re,g]=r.useState(null),[p,f]=r.useState(void 0);r.useEffect(()=>{let i=!1,a=null,S=null;return(async()=>{if(t){try{await t.ready;const u=d?t.kernels.connectTo({model:{id:d,name:"python"}}):await t.kernels.startNew();i||(g(t),f(new V({kernelName:u.model.name,kernelSpecName:u.model.name,kernelModel:u.model,kernelManager:t.kernels,kernelspecsManager:t.kernelspecs,sessionManager:t.sessions})))}catch(u){console.error("[agent-runtimes] The document could not reach the kernel of the sandbox it was given.",u),i||(g(null),f(void 0))}return}const E=String(m?.url||"").trim();if(!E){i||(g(null),f(void 0));return}try{const u=String(m?.token||"").trim(),pe=String(m?.wsUrl||"").trim()||E.replace(/^http/,"ws"),xe=$.ServerConnection.makeSettings({baseUrl:E,wsUrl:pe,token:u,appendToken:!0});a=new $.ServiceManager({serverSettings:xe}),S=Me(String(m?.runtime_name||""),a),await a.ready;const R=await a.kernels.startNew();if(!i){const ye=new V({kernelName:R.model.name,kernelSpecName:R.model.name,kernelModel:R.model,kernelManager:a.kernels,kernelspecsManager:a.kernelspecs,sessionManager:a.sessions});g(a),f(ye)}}catch{i||(g(null),f(void 0))}})(),()=>{i=!0,S?.(),a&&Ue(a)}},[t,d,m?.runtime_name,m?.url,m?.token]),r.useEffect(()=>(w?.(p?.connection??null),()=>{w?.(null)}),[p,w]);const C=re,F=!!((String(s||"").trim()||String(l?.baseUrl||"").trim()||t)&&!C);Be(`ephemeral-document-start-${o}`,F);const oe=r.useMemo(()=>be({name:"@datalayer/agent-runtimes/EphemeralDocument",namespace:`ephemeral-document-${o}`,theme:Qe,dependencies:[Ge,...U?[Pe]:[]],onError(i){console.error("[EphemeralDocument]",i)}}),[o,U]),ie=r.useCallback(i=>{if(!j)return;const a=JSON.stringify(i.toJSON());a!==L.current&&(L.current=a,j(a))},[j]),[x,se]=r.useState(null),[,J]=r.useState(!1),y=h?n?.roomId:void 0,[ae,le]=r.useState(),ce=y===void 0||ae===y,me=r.useCallback(i=>le(i?y:void 0),[y]),de=i=>{i!==null&&se(i)},{colorMode:ue,theme:he}=Se(),k=Q??ue,ge=G??he,fe=je(),b=we(ge),z=k==="auto"?fe:k,c=(z==="dark"?b.themeStyles.dark:b.themeStyles.light).backgroundColor??"";return e.jsx(M,{flex:1,minHeight:0,height:"100%",position:"relative",overflow:"hidden",bg:"canvas.default",children:C?e.jsx(Z,{inherit:D,colorMode:k,themeConfig:b,children:e.jsx(ve,{colormode:z,backgroundColor:c,children:e.jsx(M,{sx:{position:"absolute",inset:0,display:"flex",flexDirection:"column",minHeight:0,overflow:"hidden",overscrollBehaviorY:"contain",padding:2,backgroundColor:c,"--bgColor-default":c,"& .editor-shell":{backgroundColor:c,borderRadius:2,display:"flex",flexDirection:"column",minHeight:0,flex:1,maxWidth:"none",width:"100%",margin:0},"& .editor-container":{backgroundColor:c,display:"flex",flexDirection:"column",minHeight:0,flex:1,width:"100%",maxWidth:"none",margin:0},"& .editor-inner":{backgroundColor:c,display:"flex",flexDirection:"column",minHeight:0,flex:1,width:"100%",maxWidth:"none"},"& .editor-scroller":{minHeight:0,flex:1,overflow:"auto",width:"100%",maxWidth:"none"},"& .editor":{minHeight:"100%",width:"100%",maxWidth:"none",margin:0},"& .editor-input":{backgroundColor:c,width:"100%",maxWidth:"none",margin:0},"& .ContentEditable__root":{width:"100%",maxWidth:"none",margin:0},'& [role="toolbar"][aria-label="Editor toolbar"]':{backgroundColor:c}},children:e.jsx(Ie,{lexicalId:o,serviceManager:C,children:e.jsx(Ce,{extension:oe,contentEditable:null,children:e.jsx(Le,{children:e.jsx(We,{children:e.jsxs("div",{className:"editor-shell",children:[O?e.jsx(tt,{setIsLinkEditMode:J,extraItems:X}):null,e.jsx("div",{className:"editor-container",children:e.jsxs("div",{className:"editor-inner",children:[h&&n?e.jsx(Ae,{id:n.roomId,providerFactory:_e,websocketUrl:n.websocketUrl,shouldBootstrap:!0,showCollaborators:!0,username:ee,cursorColor:te,awarenessData:ne,onInitialization:me}):null,e.jsx(Fe,{}),ce?e.jsx("div",{className:"editor-scroller",children:e.jsx("div",{className:"editor",ref:de,children:e.jsx(Ee,{className:"editor-input","aria-label":"Ephemeral document editor"})})}):e.jsx(K,{maxWidth:"100%"}),!h&&e.jsx(Re,{onChange:ie}),e.jsx(et,{disabled:h}),!h&&e.jsx(Oe,{content:I}),e.jsx(Je,{}),e.jsx(ze,{}),e.jsx(Ve,{}),e.jsx($e,{kernel:p}),e.jsx(Ye,{kernel:p}),x&&e.jsxs(e.Fragment,{children:[e.jsx(qe,{anchorElem:x}),e.jsx(Ke,{anchorElem:x,setIsLinkEditMode:J}),e.jsx(Ze,{anchorElem:x})]})]})})]})})})})})})})}):F?e.jsx(Z,{inherit:D,colorMode:k,themeConfig:b,children:e.jsx(M,{position:"absolute",inset:0,display:"flex",flexDirection:"column",padding:2,backgroundColor:c,children:e.jsx(K,{label:"Starting the document",maxWidth:"100%"})})}):null})}export{Ut as EphemeralDocument,Ut as default};
@@ -1,2 +1,2 @@
1
- import{cq as O,bt as be,k as x,cn as I,bs as Ee,fa as _e,fb as Re,fc as Ce,r as f,Z as ne,aY as Me,fd as Ue,j as v,a_ as qe,a$ as je,b0 as Te,B as Z,b1 as Ae,b6 as Ne,b7 as Ie,bd as Oe}from"../datalayer-app-main.js";import{u as Le}from"./useProgressTask-XOysd2vC.js";import{a as De}from"./NotebookToolbar-C1fpK-Vi.js";import{C as Je,a as $e,N as Be}from"./CellSidebarExtension-BSomRlJ-.js";import"./RepoPushIcon-BtXQRhLa.js";import"./index-UMhfKl2p.js";import"./hoverbox-CStlKQWE.js";import"./NotebookSkeleton-KHb2YSpG.js";import"./Avatar-CBmqA_yJ.js";import"./index-Bc6gicqV.js";import"./dayjs.min-u3zuoSR8.js";import"./isEqual-BybBNsZK.js";import"./d3-color-Jd8hXty2.js";import"./renderer-DQzulrO-.js";import"./SquareIcon-Dy3l3VdH.js";const H="jupyter_server_nbmodel",Pe=new WeakSet;function We(e){return Pe.has(e)}function re(e){const n=e.model.getMetadata(H);return n?.kernelId&&n.requestId&&n.requestUrl?n:void 0}function oe(e,n){e.model.setMetadata(H,n)}function Q(e){e.model.deleteMetadata(H)}function se(e){return(typeof e=="string"?JSON.parse(e):e).reduce((r,t)=>{const o=r[r.length-1];if(t.output_type==="stream"&&o?.output_type==="stream"&&o.name===t.name){const s=Array.isArray(o.text)?o.text.join(""):o.text??"",a=Array.isArray(t.text)?t.text.join(""):t.text??"";o.text=s+a}else r.push(t);return r},[])}function q(e){return Array.isArray(e.text)?e.text.join(""):e.text??""}function Ke(e,n){return e?.output_type==="stream"&&n?.output_type==="stream"&&e.name===n.name&&q(n).startsWith(q(e))}function He(e,n){return e.length>n.length?!1:e.every((r,t)=>O.deepEqual(r,n[t])||t===e.length-1&&Ke(r,n[t]))}function Fe(e,n){const r=Math.min(e.length,n.length);for(let t=0;t<r;t+=1){const o=e[t],s=n[t];if(O.deepEqual(o,s))continue;if(!(o?.output_type==="stream"&&s?.output_type==="stream"&&o.name===s.name))return-1;const i=q(o),u=q(s);if(!u.startsWith(i)&&!i.startsWith(u)||t<r-1)return-1}return r}function Ge(e,n,r){let t=n.length;if(n.length>0&&r.length>=n.length){const o=n.length-1,s=n[o],a=r[o];if(!O.deepEqual(s,a)){const i=q(a).slice(q(s).length);i&&e.outputArea.model.add({...a,text:i})}}for(;t<r.length;)e.outputArea.model.add(r[t]),t+=1}function ae(e,n,r){const t=e.model.sharedModel,o=t.getOutputs();if(O.deepEqual(o,n))return;if(n.length===0){r?.length&&o.length&&e.outputArea.model.clear();return}if(He(n,o))return;console.debug("[jupyter-server-nbmodel] Applying pending output snapshot",{cellId:t.getId(),outputCount:n.length});const s=Fe(o,n);s>=0?Ge(e,o.slice(0,s),n):t.setOutputs(n)}const Ve=1e3;async function Ye(e,n,r){let t;try{t=await n.json()}catch{return}if(t.request_id&&t.kernel_id){const a=n.headers.get("Location")??t.request_url;a&&(r.requestUrl=a),a&&r.recoverOutputs&&oe(e,{kernelId:t.kernel_id,requestId:t.request_id,requestUrl:a}),r.accepted||(r.accepted=!0,r.onAccepted?.())}if(t.outputs===void 0||!r.recoverOutputs)return;const o=se(t.outputs),s=r.serverOutputs;r.serverOutputs=o,ae(e,o,s)}async function K(e,n,r,t,o,s=100,a={}){const i=new be;return x.ServerConnection.makeRequest(n,r,t).then(async u=>{if(u.ok)if(u.status===202){await Ye(e,u,a);let l=u.headers.get("Location")||a.requestUrl||n;l.startsWith(t.baseUrl)||(l=I.URLExt.join(t.baseUrl,l)),setTimeout(async(_,w,m,M,k,U,p)=>{try{const h=await K(_,w,m,M,k,U,p);i.resolve(h)}catch(h){i.reject(h)}},s,e,l,{method:"GET"},t,o,Math.min(Ve,s*2),a)}else i.resolve(u);else if(u.status===300){let l=u.headers.get("Location")||"";if(!l){const p=n.match(/^(.*\/api\/kernels\/[^/?]+)/);l=p?`${p[1]}/input`:""}if(!l){i.reject(new Error(`The kernel asked for an input, and where to send it could not be determined: no Location header, and the polled URL names no kernel (${n}).`));return}l.startsWith(t.baseUrl)||(l=I.URLExt.join(t.baseUrl,l));const{parent_header:_,input_request:w}=await u.json(),m=new Ee;m.addClass("jp-OutputArea-child"),m.addClass("jp-OutputArea-stdin-item");const M=new _e;M.addClass("jp-OutputArea-prompt"),m.addWidget(M);const k=new Re({future:Object.freeze({sendInputReply:(p,h)=>{x.ServerConnection.makeRequest(l,{method:"POST",body:JSON.stringify({input:p.value})},t).catch(b=>{console.error(`Failed to set input to ${JSON.stringify(p)}.`,b)})}}),parent_header:_,password:w.password,prompt:w.prompt,translator:o});k.addClass("jp-OutputArea-output"),m.addWidget(k);const U=k.node.getElementsByTagName("input")[0];k.value.then(p=>{m.addClass("jp-OutputArea-stdin-hiding"),e.outputArea.model.add({output_type:"stream",name:"stdin",text:p+`
1
+ import{cq as O,bt as be,k as x,cn as I,bs as Ee,fa as _e,fb as Re,fc as Ce,r as f,Z as ne,aY as Me,fd as Ue,j as v,a_ as qe,a$ as je,b0 as Te,B as Z,b1 as Ae,b6 as Ne,b7 as Ie,bd as Oe}from"../datalayer-app-main.js";import{u as Le}from"./useProgressTask-XOysd2vC.js";import{a as De}from"./NotebookToolbar-C1fpK-Vi.js";import{C as Je,a as $e,N as Be}from"./CellSidebarExtension-DSNmntUX.js";import"./RepoPushIcon-BtXQRhLa.js";import"./index-tO6w-mHa.js";import"./hoverbox-CStlKQWE.js";import"./NotebookSkeleton-KHb2YSpG.js";import"./Avatar-CBmqA_yJ.js";import"./index-BNjq7TZD.js";import"./dayjs.min-u3zuoSR8.js";import"./isEqual-niFNV5MZ.js";import"./d3-color-Jd8hXty2.js";import"./renderer-BTUDFH3O.js";import"./SquareIcon-Dy3l3VdH.js";const H="jupyter_server_nbmodel",Pe=new WeakSet;function We(e){return Pe.has(e)}function re(e){const n=e.model.getMetadata(H);return n?.kernelId&&n.requestId&&n.requestUrl?n:void 0}function oe(e,n){e.model.setMetadata(H,n)}function Q(e){e.model.deleteMetadata(H)}function se(e){return(typeof e=="string"?JSON.parse(e):e).reduce((r,t)=>{const o=r[r.length-1];if(t.output_type==="stream"&&o?.output_type==="stream"&&o.name===t.name){const s=Array.isArray(o.text)?o.text.join(""):o.text??"",a=Array.isArray(t.text)?t.text.join(""):t.text??"";o.text=s+a}else r.push(t);return r},[])}function q(e){return Array.isArray(e.text)?e.text.join(""):e.text??""}function Ke(e,n){return e?.output_type==="stream"&&n?.output_type==="stream"&&e.name===n.name&&q(n).startsWith(q(e))}function He(e,n){return e.length>n.length?!1:e.every((r,t)=>O.deepEqual(r,n[t])||t===e.length-1&&Ke(r,n[t]))}function Fe(e,n){const r=Math.min(e.length,n.length);for(let t=0;t<r;t+=1){const o=e[t],s=n[t];if(O.deepEqual(o,s))continue;if(!(o?.output_type==="stream"&&s?.output_type==="stream"&&o.name===s.name))return-1;const i=q(o),u=q(s);if(!u.startsWith(i)&&!i.startsWith(u)||t<r-1)return-1}return r}function Ge(e,n,r){let t=n.length;if(n.length>0&&r.length>=n.length){const o=n.length-1,s=n[o],a=r[o];if(!O.deepEqual(s,a)){const i=q(a).slice(q(s).length);i&&e.outputArea.model.add({...a,text:i})}}for(;t<r.length;)e.outputArea.model.add(r[t]),t+=1}function ae(e,n,r){const t=e.model.sharedModel,o=t.getOutputs();if(O.deepEqual(o,n))return;if(n.length===0){r?.length&&o.length&&e.outputArea.model.clear();return}if(He(n,o))return;console.debug("[jupyter-server-nbmodel] Applying pending output snapshot",{cellId:t.getId(),outputCount:n.length});const s=Fe(o,n);s>=0?Ge(e,o.slice(0,s),n):t.setOutputs(n)}const Ve=1e3;async function Ye(e,n,r){let t;try{t=await n.json()}catch{return}if(t.request_id&&t.kernel_id){const a=n.headers.get("Location")??t.request_url;a&&(r.requestUrl=a),a&&r.recoverOutputs&&oe(e,{kernelId:t.kernel_id,requestId:t.request_id,requestUrl:a}),r.accepted||(r.accepted=!0,r.onAccepted?.())}if(t.outputs===void 0||!r.recoverOutputs)return;const o=se(t.outputs),s=r.serverOutputs;r.serverOutputs=o,ae(e,o,s)}async function K(e,n,r,t,o,s=100,a={}){const i=new be;return x.ServerConnection.makeRequest(n,r,t).then(async u=>{if(u.ok)if(u.status===202){await Ye(e,u,a);let l=u.headers.get("Location")||a.requestUrl||n;l.startsWith(t.baseUrl)||(l=I.URLExt.join(t.baseUrl,l)),setTimeout(async(_,w,m,M,k,U,p)=>{try{const h=await K(_,w,m,M,k,U,p);i.resolve(h)}catch(h){i.reject(h)}},s,e,l,{method:"GET"},t,o,Math.min(Ve,s*2),a)}else i.resolve(u);else if(u.status===300){let l=u.headers.get("Location")||"";if(!l){const p=n.match(/^(.*\/api\/kernels\/[^/?]+)/);l=p?`${p[1]}/input`:""}if(!l){i.reject(new Error(`The kernel asked for an input, and where to send it could not be determined: no Location header, and the polled URL names no kernel (${n}).`));return}l.startsWith(t.baseUrl)||(l=I.URLExt.join(t.baseUrl,l));const{parent_header:_,input_request:w}=await u.json(),m=new Ee;m.addClass("jp-OutputArea-child"),m.addClass("jp-OutputArea-stdin-item");const M=new _e;M.addClass("jp-OutputArea-prompt"),m.addWidget(M);const k=new Re({future:Object.freeze({sendInputReply:(p,h)=>{x.ServerConnection.makeRequest(l,{method:"POST",body:JSON.stringify({input:p.value})},t).catch(b=>{console.error(`Failed to set input to ${JSON.stringify(p)}.`,b)})}}),parent_header:_,password:w.password,prompt:w.prompt,translator:o});k.addClass("jp-OutputArea-output"),m.addWidget(k);const U=k.node.getElementsByTagName("input")[0];k.value.then(p=>{m.addClass("jp-OutputArea-stdin-hiding"),e.outputArea.model.add({output_type:"stream",name:"stdin",text:p+`
2
2
  `}),U.focus(),window.setTimeout(async()=>{const h=document.activeElement;m.dispose(),h&&h instanceof HTMLElement&&h.focus();try{const b=await K(e,n,r,t,o,100,a);i.resolve(b)}catch(b){i.reject(b)}},500)}),e.outputArea.layout.addWidget(m)}else i.reject(await x.ServerConnection.ResponseError.create(u))}).catch(u=>{i.reject(new x.ServerConnection.NetworkError(u))}),i.promise}async function ze(e,n,r,t,o,s=100,a,i=!1){return K(e,n,r,t,o,s,{onAccepted:a,recoverOutputs:i})}async function Xe(e,n,r){const t=e.model.sharedModel;t.executionState="running";try{const s=await(await ze(e,n,{method:"GET"},r,void 0,100,void 0,!0)).json(),a=se(s.outputs??"[]");return ae(e,a),t.execution_count=s.execution_count??null,t.executionState="idle",Q(e),s.status==="ok"}catch(o){if(o instanceof x.ServerConnection.ResponseError&&o.response.status===404)return Q(e),t.executionState="idle",!1;throw o}}const N=new Set;function Ze(e,n){if(e.startsWith(n.baseUrl))return e;const r=e.startsWith("http")?new URL(e).pathname:e;return I.URLExt.join(n.baseUrl,r)}function Qe(e,n){if(We(e))return!1;const r=re(e);if(!r||N.has(r.requestId)||e.isDisposed||!e.model)return!1;N.add(r.requestId);const t=Ze(r.requestUrl,n);return console.info("[agent-runtimes] Resuming a server execution",{cellId:e.model.sharedModel.getId(),requestId:r.requestId,requestUrl:t}),Xe(e,t,n).catch(o=>{if(e.isDisposed){N.delete(r.requestId);return}console.warn(`[agent-runtimes] Failed to resume the execution ${r.requestId}.`,o)}),!0}const W=new Set;async function et(e,n,r){const t=`${r.baseUrl}#${n.id}`;if(W.has(t))return 0;const o=await x.ServerConnection.makeRequest(I.URLExt.join(r.baseUrl,`api/kernels/${n.id}/execute`),{method:"GET"},r);if(o.status===404)return W.add(t),0;if(!o.ok)throw await x.ServerConnection.ResponseError.create(o).catch(()=>new Error(`Invalid response: ${o.status} ${o.statusText}`.trim()));W.add(t);const s=await o.json();let a=0;for(const i of s.requests??[]){if(!i.cell_id||N.has(i.request_id))continue;const u=e.find(l=>l.model?.sharedModel.getId()===i.cell_id);!u||u.isDisposed||re(u)||(oe(u,{kernelId:i.kernel_id,requestId:i.request_id,requestUrl:i.request_url}),a+=1)}return a}async function tt(e){if(e.isDisposed)return 0;const n=e.sessionContext?.session?.kernel,r=n?.serverSettings;if(!n||!r)return 0;const t=e.content.widgets.filter(s=>s instanceof Ce);if(t.length===0)return 0;try{await et(t,n,r)}catch(s){console.warn("[agent-runtimes] Failed to discover the active executions of the kernel.",s)}let o=0;for(const s of t)Qe(s,r)&&(o+=1);return o}const ee=1e3,nt=3e4;function rt(e,n){f.useEffect(()=>{if(!e||!n)return;let r=0;const t=()=>{const a=ne.getState().selectNotebook(e)?.adapter?.panel;!a||a.isDisposed||tt(a)};t();const o=window.setInterval(()=>{if(r+=ee,r>=nt){window.clearInterval(o);return}t()},ee);return()=>{window.clearInterval(o)}},[e,n])}const te={cells:[{cell_type:"code",source:[""],metadata:{},outputs:[],execution_count:null}],metadata:{kernelspec:{display_name:"Python 3",language:"python",name:"python3"},language_info:{name:"python"}},nbformat:4,nbformat_minor:5};function ot({inherit:e,colorMode:n,themeConfig:r,children:t}){return e?v.jsx(v.Fragment,{children:t}):v.jsx(Ie,{colorMode:n,theme:r.primerTheme,themeStyles:r.themeStyles,children:t})}function wt({notebookId:e,runtimeName:n,runtimeOverride:r,serviceManager:t,inheritTheme:o=!1,kernelId:s,cellSidebarMargin:a=120,nbformat:i,onNbformatChange:u,toolbarComponent:l,toolbarExtraItems:_,showToolbar:w=!0,showSaveItem:m=!1,themeVariant:M,colorMode:k,collaborationProvider:U}){const p=f.useRef(i??te),h=f.useRef(e);h.current!==e&&(h.current=e,p.current=i??te);const b=p.current,F=f.useRef(JSON.stringify(b)),{runtimes:G,refetchRuntimes:L}=Me(void 0,{enabled:!!String(n||"").trim()&&!t&&!String(r?.baseUrl||"").trim()}),V=f.useMemo(()=>{const c=String(n||"").trim();if(c)return G.find(d=>String(d?.runtime_name||"")===c)},[n,G]),S=f.useMemo(()=>{const c=String(r?.baseUrl||"").trim();return c?{url:c,wsUrl:String(r?.wsUrl||"").trim()||void 0,token:String(r?.token||"").trim(),runtime_name:String(r?.runtimeName||"").trim()||"agent-node-proxy"}:V},[r,V]),Y=!!(!r?.baseUrl&&String(n||"").trim()&&!S);f.useEffect(()=>{if(!Y)return;L();const c=window.setInterval(()=>{L()},1e3);return()=>{window.clearInterval(c)}},[Y,L]);const[ie,D]=f.useState(null),[ue,J]=f.useState(void 0),[ce,$]=f.useState(!1);f.useEffect(()=>{let c=!1,d=null,E=null;const y=async()=>{const R=String(S?.url||"").trim();if(!R){c||(D(null),J(void 0),$(!1));return}try{const A=String(S?.token||"").trim(),we=String(S?.wsUrl||"").trim()||R.replace(/^http/,"ws"),ke=x.ServerConnection.makeSettings({baseUrl:R,wsUrl:we,token:A,appendToken:!0}),C=new x.ServiceManager({serverSettings:ke});if(d=C,E=Ne(String(S?.runtime_name||""),d),c){g(C);return}await C.ready,await C.kernels.refreshRunning();const X=[...C.kernels.running()][0];if(c){g(C);return}D(C),J(X?.id),$(!X)}catch(A){d&&(g(d),d=null),c||(console.warn(`[agent-runtimes] Could not reach the sandbox at ${R}.`,A),D(null),J(void 0),$(!1))}},g=R=>{E?.(),E=null,Oe(R)};return y(),()=>{c=!0,d?(g(d),d=null):(E?.(),E=null)}},[S?.runtime_name,S?.url,S?.token,S?.wsUrl]);const j=t??ie,le=Ue(),de=s??ue,fe=t?!s:ce,me=f.useMemo(()=>{if(!w)return;const c=l||De,d=m?void 0:["notebook-save","notebook-divider-file"];return!_?.length&&!d?c:function(y){return v.jsx(c,{...y,extraItems:_,hiddenItems:d})}},[w,m,l,_]),pe=!!((String(n||"").trim()||String(r?.baseUrl||"").trim())&&!j);Le(`ephemeral-notebook-start-${e}`,pe),rt(e,j??void 0),f.useEffect(()=>{if(U)return;const c=()=>{const g=ne.getState().selectNotebook(e)?.adapter;return(g?.notebook?.model??g?.panel?.content?.model??null)?.toJSON?.()??null},d=()=>{const y=c();if(!y||!Array.isArray(y.cells))return;const g=JSON.stringify(y);g!==F.current&&(F.current=g,u?.(y))},E=window.setInterval(d,500);return()=>{window.clearInterval(E),d()}},[j,e,u]);const{colorMode:he,theme:ge}=qe(),B=k??he,Se=M??ge,ye=je(),P=Te(Se),z=B==="auto"?ye:B,T=(z==="dark"?P.themeStyles.dark:P.themeStyles.light).backgroundColor??"",ve=f.useMemo(()=>[new Je({factory:$e})],[]),xe=f.useMemo(()=>`.datalayer/${e}.ipynb`,[e]);return v.jsx(Z,{flex:1,minHeight:0,height:"100%",position:"relative",overflow:"hidden",bg:"canvas.default",children:j&&le?v.jsx(ot,{inherit:o,colorMode:B,themeConfig:P,children:v.jsx(Ae,{colormode:z,backgroundColor:T,children:v.jsx(Z,{sx:{position:"absolute",inset:0,display:"flex",flexDirection:"column",overflow:"hidden",overscrollBehaviorY:"contain",overflowAnchor:"none",padding:2,backgroundColor:T,"& #dla-Jupyter-Notebook":{display:"flex",flexDirection:"column"},...w?{"& #dla-Jupyter-Notebook > :first-of-type":{position:"sticky",top:0,zIndex:2,flex:"0 0 auto",backgroundColor:T}}:{"& .datalayer-NotebookPanel-header":{display:"none",minHeight:0}},"& #dla-Jupyter-Notebook > .dla-Box-Notebook":{flex:"1 1 auto",minHeight:0},'& [role="toolbar"][aria-label="Notebook toolbar"]':{backgroundColor:T}},children:v.jsx(Be,{nbformat:b,id:e,path:xe,serviceManager:j,startDefaultKernel:fe,kernelId:de,height:"100%",cellSidebarMargin:a,extensions:ve,Toolbar:me,collaborationProvider:U})})})}):null})}export{wt as EphemeralNotebook,wt as default};
@@ -1 +1 @@
1
- import{r as o,j as p,aj as N,ch as z,ci as L,cj as T,ck as F,aB as R,I as O,aC as _}from"../datalayer-app-main.js";import{l as U,z as W,A as $,B as M}from"./JupyterLexicalExtension-Df6IrbR-.js";import H from"./ExcalidrawModal-DwWGmnRQ.js";import{r as X}from"./percentages-BXMCSKIN-NdFZNkF5.js";import{u as J}from"./ThemeContext-D9ztCaU3.js";import"./NotebookSkeleton-KHb2YSpG.js";import"./Avatar-CBmqA_yJ.js";import"./url-DhPU-y-U.js";import"./isObject-CeOzAI2h.js";import"./toNumber-DUdf79Nr.js";import"./isSymbol-DfwdEMHq.js";import"./StrikethroughIcon-CbiEuPT-.js";import"./TypographyIcon-CCkcdj7U.js";import"./ArrowUpIcon-y5enrVH9.js";import"./SortDescIcon-Qif6E10I.js";import"./PaintbrushIcon-CFBHU-3l.js";import"./VideoIcon-DIIszW1S.js";import"./PrismCss-Dd5n9e4a.js";import"./Output-DbuS5mTW.js";import"./index-CnpOaqg6.js";import"./hoverbox-CStlKQWE.js";import"./index-UMhfKl2p.js";import"./index-Bc6gicqV.js";import"./dayjs.min-u3zuoSR8.js";import"./isEqual-BybBNsZK.js";import"./d3-color-Jd8hXty2.js";import"./dist-SKaIYcRD.js";import"./index-C0KhmyXF.js";import"./RestartIcon-DvpOf5Mf.js";import"./LexicalToolRegistry-CxE-muFM.js";import"./extends-CF3RwP-h.js";import"./index-Dlvxer3A.js";import"./index-DoBkwclg.js";const P=e=>{const n=e?.firstElementChild?.firstElementChild,g=e.getAttribute("viewBox");if(g!=null){const a=g.split(" ");e.setAttribute("width",a[2]),e.setAttribute("height",a[3])}n&&n.tagName==="style"&&n.remove()};function V({elements:e,files:n,imageContainerRef:g,appState:a,rootClassName:s=null,width:c="inherit",height:E="inherit"}){const[h,x]=o.useState(null),{theme:C}=J(h),[B,u]=o.useState(null),[v,w]=o.useState(0);o.useEffect(()=>{const r=new MutationObserver(S=>{for(const b of S)if(b.type==="attributes"&&(b.attributeName==="style"||b.attributeName==="class")){w(l=>l+1);break}});return r.observe(document.documentElement,{attributes:!0,attributeFilter:["style","class"]}),r.observe(document.body,{attributes:!0,attributeFilter:["style","class"]}),()=>r.disconnect()},[]),o.useEffect(()=>{(async()=>{await new Promise(j=>setTimeout(j,150));const S=["#ffffff","#000000","transparent",""],b=a?.viewBackgroundColor||"transparent",l=S.includes(b.toLowerCase()),A={...a,viewBackgroundColor:l?"transparent":a?.viewBackgroundColor,exportBackground:!l,exportWithDarkMode:C==="dark"},m=await X({appState:A,elements:e,files:n});P(m),m.setAttribute("width","100%"),m.setAttribute("height","100%"),m.setAttribute("display","block"),u(m)})()},[e,n,a,C,v]);const f={};c!=="inherit"&&(f.width=`${c}px`),E!=="inherit"&&(f.height=`${E}px`);const k=a?.viewBackgroundColor||"transparent";if(["#ffffff","#000000","transparent",""].includes(k.toLowerCase())){const r=C==="dark"?"#1e1e1e":"#ffffff";f.backgroundColor=`var(--bgColor-default, var(--jp-layout-color0, var(--vscode-editor-background, ${r})))`}return p.jsx("div",{ref:r=>{x(r),r&&g&&(g.current=r)},className:s??"",style:f,dangerouslySetInnerHTML:{__html:B?.outerHTML??""}})}function Bt({nodeKey:e,data:n,width:g,height:a}){const[s]=N(),c=U(),[E,h]=o.useState(n==="[]"&&s.isEditable()),x=o.useRef(null),C=o.useRef(null),B=o.useRef(null),[u,v,w]=W(e),[f,k]=o.useState(!1);o.useEffect(()=>{if(!c){u&&w();return}return z(s.registerCommand(L,t=>{const d=C.current,i=t.target;return f?!0:d!==null&&T(i)&&d.contains(i)?(t.shiftKey||w(),v(!u),t.detail>1&&h(!0),!0):!1},F))},[w,s,u,f,v,c]);const y=o.useCallback(()=>(h(!1),s.update(()=>{const t=R(e);t&&t.remove()})),[s,e]),I=(t,d,i)=>s.update(()=>{const D=R(e);M(D)&&(t&&t.length>0||Object.keys(i).length>0?D.setData(JSON.stringify({appState:d,elements:t,files:i})):D.remove())}),r=()=>{k(!0)},S=(t,d)=>{setTimeout(()=>{k(!1)},200),s.update(()=>{const i=R(e);M(i)&&(i.setWidth(t),i.setHeight(d))})},b=o.useCallback(()=>{h(!0)},[]),{elements:l=[],files:A={},appState:m={}}=o.useMemo(()=>JSON.parse(n),[n]),j=o.useCallback(()=>{h(!1),l.length===0&&s.update(()=>{const t=R(e);t&&t.remove()})},[s,e,l.length]);return p.jsxs(p.Fragment,{children:[c&&E&&p.jsx(H,{initialElements:l,initialFiles:A,initialAppState:m,isShown:E,onDelete:y,onClose:j,onSave:(t,d,i)=>{I(t,d,i),h(!1)},closeOnClickOutside:!1}),l.length>0&&p.jsxs("button",{ref:C,className:`excalidraw-button ${u?"selected":""}`,children:[p.jsx(V,{imageContainerRef:x,className:"image",elements:l,files:A,appState:m,width:g,height:a}),u&&c&&p.jsx(O,{icon:_,"aria-label":"Edit the drawing",size:"small",variant:"default",sx:{position:"absolute",top:8,right:8,zIndex:10},onMouseDown:t=>t.preventDefault(),onClick:b}),(u||f)&&c&&p.jsx($,{buttonRef:B,showCaption:!0,setShowCaption:()=>null,imageRef:x,editor:s,onResizeStart:r,onResizeEnd:S})]})]})}export{Bt as default};
1
+ import{r as o,j as p,aj as N,ch as z,ci as L,cj as T,ck as F,aB as R,I as O,aC as _}from"../datalayer-app-main.js";import{l as U,z as W,A as $,B as M}from"./JupyterLexicalExtension-DEiuU9XK.js";import H from"./ExcalidrawModal-B0d7EMm1.js";import{r as X}from"./percentages-BXMCSKIN-aDx1Abuj.js";import{u as J}from"./ThemeContext-D9ztCaU3.js";import"./NotebookSkeleton-KHb2YSpG.js";import"./Avatar-CBmqA_yJ.js";import"./url-DhPU-y-U.js";import"./isObject-CeOzAI2h.js";import"./toNumber-DUdf79Nr.js";import"./isSymbol-DfwdEMHq.js";import"./StrikethroughIcon-CbiEuPT-.js";import"./TypographyIcon-CCkcdj7U.js";import"./ArrowUpIcon-y5enrVH9.js";import"./SortDescIcon-Qif6E10I.js";import"./PaintbrushIcon-CFBHU-3l.js";import"./VideoIcon-DIIszW1S.js";import"./PrismCss-Dd5n9e4a.js";import"./Output-DIp_tlWH.js";import"./index-CUjcBn1v.js";import"./hoverbox-CStlKQWE.js";import"./index-tO6w-mHa.js";import"./index-BNjq7TZD.js";import"./dayjs.min-u3zuoSR8.js";import"./isEqual-niFNV5MZ.js";import"./d3-color-Jd8hXty2.js";import"./dist-SKaIYcRD.js";import"./index-C0KhmyXF.js";import"./RestartIcon-DvpOf5Mf.js";import"./LexicalToolRegistry-CjiooYJz.js";import"./extends-CF3RwP-h.js";import"./index-Dlvxer3A.js";import"./index-DoBkwclg.js";const P=e=>{const n=e?.firstElementChild?.firstElementChild,g=e.getAttribute("viewBox");if(g!=null){const a=g.split(" ");e.setAttribute("width",a[2]),e.setAttribute("height",a[3])}n&&n.tagName==="style"&&n.remove()};function V({elements:e,files:n,imageContainerRef:g,appState:a,rootClassName:s=null,width:c="inherit",height:E="inherit"}){const[h,x]=o.useState(null),{theme:C}=J(h),[B,u]=o.useState(null),[v,w]=o.useState(0);o.useEffect(()=>{const r=new MutationObserver(S=>{for(const b of S)if(b.type==="attributes"&&(b.attributeName==="style"||b.attributeName==="class")){w(l=>l+1);break}});return r.observe(document.documentElement,{attributes:!0,attributeFilter:["style","class"]}),r.observe(document.body,{attributes:!0,attributeFilter:["style","class"]}),()=>r.disconnect()},[]),o.useEffect(()=>{(async()=>{await new Promise(j=>setTimeout(j,150));const S=["#ffffff","#000000","transparent",""],b=a?.viewBackgroundColor||"transparent",l=S.includes(b.toLowerCase()),A={...a,viewBackgroundColor:l?"transparent":a?.viewBackgroundColor,exportBackground:!l,exportWithDarkMode:C==="dark"},m=await X({appState:A,elements:e,files:n});P(m),m.setAttribute("width","100%"),m.setAttribute("height","100%"),m.setAttribute("display","block"),u(m)})()},[e,n,a,C,v]);const f={};c!=="inherit"&&(f.width=`${c}px`),E!=="inherit"&&(f.height=`${E}px`);const k=a?.viewBackgroundColor||"transparent";if(["#ffffff","#000000","transparent",""].includes(k.toLowerCase())){const r=C==="dark"?"#1e1e1e":"#ffffff";f.backgroundColor=`var(--bgColor-default, var(--jp-layout-color0, var(--vscode-editor-background, ${r})))`}return p.jsx("div",{ref:r=>{x(r),r&&g&&(g.current=r)},className:s??"",style:f,dangerouslySetInnerHTML:{__html:B?.outerHTML??""}})}function Bt({nodeKey:e,data:n,width:g,height:a}){const[s]=N(),c=U(),[E,h]=o.useState(n==="[]"&&s.isEditable()),x=o.useRef(null),C=o.useRef(null),B=o.useRef(null),[u,v,w]=W(e),[f,k]=o.useState(!1);o.useEffect(()=>{if(!c){u&&w();return}return z(s.registerCommand(L,t=>{const d=C.current,i=t.target;return f?!0:d!==null&&T(i)&&d.contains(i)?(t.shiftKey||w(),v(!u),t.detail>1&&h(!0),!0):!1},F))},[w,s,u,f,v,c]);const y=o.useCallback(()=>(h(!1),s.update(()=>{const t=R(e);t&&t.remove()})),[s,e]),I=(t,d,i)=>s.update(()=>{const D=R(e);M(D)&&(t&&t.length>0||Object.keys(i).length>0?D.setData(JSON.stringify({appState:d,elements:t,files:i})):D.remove())}),r=()=>{k(!0)},S=(t,d)=>{setTimeout(()=>{k(!1)},200),s.update(()=>{const i=R(e);M(i)&&(i.setWidth(t),i.setHeight(d))})},b=o.useCallback(()=>{h(!0)},[]),{elements:l=[],files:A={},appState:m={}}=o.useMemo(()=>JSON.parse(n),[n]),j=o.useCallback(()=>{h(!1),l.length===0&&s.update(()=>{const t=R(e);t&&t.remove()})},[s,e,l.length]);return p.jsxs(p.Fragment,{children:[c&&E&&p.jsx(H,{initialElements:l,initialFiles:A,initialAppState:m,isShown:E,onDelete:y,onClose:j,onSave:(t,d,i)=>{I(t,d,i),h(!1)},closeOnClickOutside:!1}),l.length>0&&p.jsxs("button",{ref:C,className:`excalidraw-button ${u?"selected":""}`,children:[p.jsx(V,{imageContainerRef:x,className:"image",elements:l,files:A,appState:m,width:g,height:a}),u&&c&&p.jsx(O,{icon:_,"aria-label":"Edit the drawing",size:"small",variant:"default",sx:{position:"absolute",top:8,right:8,zIndex:10},onMouseDown:t=>t.preventDefault(),onClick:b}),(u||f)&&c&&p.jsx($,{buttonRef:B,showCaption:!0,setShowCaption:()=>null,imageRef:x,editor:s,onResizeStart:r,onResizeEnd:S})]})]})}export{Bt as default};
@@ -1 +1 @@
1
- import{r as t,j as o,D as u,aE as h,v as f}from"../datalayer-app-main.js";import{I as T}from"./percentages-BXMCSKIN-NdFZNkF5.js";import{u as z}from"./ThemeContext-D9ztCaU3.js";import"./JupyterLexicalExtension-Df6IrbR-.js";import"./NotebookSkeleton-KHb2YSpG.js";import"./Avatar-CBmqA_yJ.js";import"./url-DhPU-y-U.js";import"./isObject-CeOzAI2h.js";import"./toNumber-DUdf79Nr.js";import"./isSymbol-DfwdEMHq.js";import"./StrikethroughIcon-CbiEuPT-.js";import"./TypographyIcon-CCkcdj7U.js";import"./ArrowUpIcon-y5enrVH9.js";import"./SortDescIcon-Qif6E10I.js";import"./PaintbrushIcon-CFBHU-3l.js";import"./VideoIcon-DIIszW1S.js";import"./PrismCss-Dd5n9e4a.js";import"./Output-DbuS5mTW.js";import"./index-CnpOaqg6.js";import"./hoverbox-CStlKQWE.js";import"./index-UMhfKl2p.js";import"./index-Bc6gicqV.js";import"./dayjs.min-u3zuoSR8.js";import"./isEqual-BybBNsZK.js";import"./d3-color-Jd8hXty2.js";import"./dist-SKaIYcRD.js";import"./index-C0KhmyXF.js";import"./RestartIcon-DvpOf5Mf.js";import"./LexicalToolRegistry-CxE-muFM.js";import"./extends-CF3RwP-h.js";import"./index-Dlvxer3A.js";import"./index-DoBkwclg.js";function pe({closeOnClickOutside:I=!1,onSave:x,initialElements:l,initialAppState:g,initialFiles:d,isShown:n=!1,onDelete:v,onClose:c}){const[w,C]=t.useState(null),{theme:E}=z(w),m=t.useRef(null),b=t.useCallback(e=>{m.current=e,C(e)},[]),[r,k]=t.useState(null),[j,i]=t.useState(!1),[p,M]=t.useState(l),[D,S]=t.useState(d);t.useEffect(()=>{m.current?.focus()},[]),t.useEffect(()=>{if(!r||!n)return;const e=()=>r.refresh(),a=requestAnimationFrame(e),s=setTimeout(e,300);return window.addEventListener("resize",e),()=>{cancelAnimationFrame(a),clearTimeout(s),window.removeEventListener("resize",e)}},[r,n]);const A=()=>{if(p?.some(e=>!e.isDeleted)){const e=r?.getAppState(),a={exportBackground:e?.exportBackground,exportScale:e?.exportScale,exportWithDarkMode:e?.theme==="dark",isBindingEnabled:e?.isBindingEnabled,isLoading:e?.isLoading,name:e?.name,theme:e?.theme,viewBackgroundColor:e?.viewBackgroundColor,viewModeEnabled:e?.viewModeEnabled,zenModeEnabled:e?.zenModeEnabled,zoom:e?.zoom};x(p,a,D)}else v()},B=()=>{i(!0)};if(n===!1)return null;const y=(e,a,s)=>{M(e),S(s)};return o.jsxs(o.Fragment,{children:[o.jsxs(u,{title:"Excalidraw",onClose:()=>c(),width:"xlarge",height:"auto",sx:{width:"80vw !important",maxWidth:"80vw !important",height:"80vh !important",maxHeight:"80vh !important"},children:[o.jsx(h,{ref:b,tabIndex:-1,sx:{height:"calc(80vh - 140px)",position:"relative",overflow:"hidden"},children:o.jsx(T,{onChange:y,excalidrawAPI:e=>k(e),initialData:{appState:g||{isLoading:!1},elements:l,files:d},theme:E})}),o.jsxs(h,{sx:{display:"flex",gap:2,justifyContent:"flex-end",p:2,borderTop:"1px solid",borderColor:"var(--borderColor-default)"},children:[o.jsx(f,{variant:"invisible",onClick:B,children:"Discard"}),o.jsx(f,{variant:"primary",onClick:A,children:"Save"})]})]}),j&&o.jsx(u,{title:"Discard",onClose:()=>i(!1),width:"small",height:"auto",footerButtons:[{buttonType:"danger",content:"Discard",onClick:()=>{i(!1),c()}},{buttonType:"default",content:"Cancel",onClick:()=>i(!1)}],children:"Are you sure you want to discard the changes?"})]})}export{pe as default};
1
+ import{r as t,j as o,D as u,aE as h,v as f}from"../datalayer-app-main.js";import{I as T}from"./percentages-BXMCSKIN-aDx1Abuj.js";import{u as z}from"./ThemeContext-D9ztCaU3.js";import"./JupyterLexicalExtension-DEiuU9XK.js";import"./NotebookSkeleton-KHb2YSpG.js";import"./Avatar-CBmqA_yJ.js";import"./url-DhPU-y-U.js";import"./isObject-CeOzAI2h.js";import"./toNumber-DUdf79Nr.js";import"./isSymbol-DfwdEMHq.js";import"./StrikethroughIcon-CbiEuPT-.js";import"./TypographyIcon-CCkcdj7U.js";import"./ArrowUpIcon-y5enrVH9.js";import"./SortDescIcon-Qif6E10I.js";import"./PaintbrushIcon-CFBHU-3l.js";import"./VideoIcon-DIIszW1S.js";import"./PrismCss-Dd5n9e4a.js";import"./Output-DIp_tlWH.js";import"./index-CUjcBn1v.js";import"./hoverbox-CStlKQWE.js";import"./index-tO6w-mHa.js";import"./index-BNjq7TZD.js";import"./dayjs.min-u3zuoSR8.js";import"./isEqual-niFNV5MZ.js";import"./d3-color-Jd8hXty2.js";import"./dist-SKaIYcRD.js";import"./index-C0KhmyXF.js";import"./RestartIcon-DvpOf5Mf.js";import"./LexicalToolRegistry-CjiooYJz.js";import"./extends-CF3RwP-h.js";import"./index-Dlvxer3A.js";import"./index-DoBkwclg.js";function pe({closeOnClickOutside:I=!1,onSave:x,initialElements:l,initialAppState:g,initialFiles:d,isShown:n=!1,onDelete:v,onClose:c}){const[w,C]=t.useState(null),{theme:E}=z(w),m=t.useRef(null),b=t.useCallback(e=>{m.current=e,C(e)},[]),[r,k]=t.useState(null),[j,i]=t.useState(!1),[p,M]=t.useState(l),[D,S]=t.useState(d);t.useEffect(()=>{m.current?.focus()},[]),t.useEffect(()=>{if(!r||!n)return;const e=()=>r.refresh(),a=requestAnimationFrame(e),s=setTimeout(e,300);return window.addEventListener("resize",e),()=>{cancelAnimationFrame(a),clearTimeout(s),window.removeEventListener("resize",e)}},[r,n]);const A=()=>{if(p?.some(e=>!e.isDeleted)){const e=r?.getAppState(),a={exportBackground:e?.exportBackground,exportScale:e?.exportScale,exportWithDarkMode:e?.theme==="dark",isBindingEnabled:e?.isBindingEnabled,isLoading:e?.isLoading,name:e?.name,theme:e?.theme,viewBackgroundColor:e?.viewBackgroundColor,viewModeEnabled:e?.viewModeEnabled,zenModeEnabled:e?.zenModeEnabled,zoom:e?.zoom};x(p,a,D)}else v()},B=()=>{i(!0)};if(n===!1)return null;const y=(e,a,s)=>{M(e),S(s)};return o.jsxs(o.Fragment,{children:[o.jsxs(u,{title:"Excalidraw",onClose:()=>c(),width:"xlarge",height:"auto",sx:{width:"80vw !important",maxWidth:"80vw !important",height:"80vh !important",maxHeight:"80vh !important"},children:[o.jsx(h,{ref:b,tabIndex:-1,sx:{height:"calc(80vh - 140px)",position:"relative",overflow:"hidden"},children:o.jsx(T,{onChange:y,excalidrawAPI:e=>k(e),initialData:{appState:g||{isLoading:!1},elements:l,files:d},theme:E})}),o.jsxs(h,{sx:{display:"flex",gap:2,justifyContent:"flex-end",p:2,borderTop:"1px solid",borderColor:"var(--borderColor-default)"},children:[o.jsx(f,{variant:"invisible",onClick:B,children:"Discard"}),o.jsx(f,{variant:"primary",onClick:A,children:"Save"})]})]}),j&&o.jsx(u,{title:"Discard",onClose:()=>i(!1),width:"small",height:"auto",footerButtons:[{buttonType:"danger",content:"Discard",onClick:()=>{i(!1),c()}},{buttonType:"default",content:"Cancel",onClick:()=>i(!1)}],children:"Are you sure you want to discard the changes?"})]})}export{pe as default};
@@ -1 +1 @@
1
- import{r as l,j as n,a6 as b}from"../datalayer-app-main.js";import{c as C,z as F,n as $,b as k}from"./model-C6vyI0zW.js";import{u as S,b as T,c as D,d as N}from"./SheetTabs-L2YN86GJ.js";function L(v){const E=S(),a=T(),t=D(),j=`'${E.sheet(a.sheet).name.replace(/'/g,"''")}'`,p=`${C(a.active.col)}${a.active.row+1}`,{content:g,value:s}=N(`${j}!${p}`),o=a.zones[a.zones.length-1],i=o.top===o.bottom&&o.left===o.right?p:F(o),[h,d]=l.useState(i),[x,m]=l.useState(!1),[c,r]=l.useState(""),y=l.useId();l.useEffect(()=>{x||d(i)},[i,x]);const f=t.edit!==null&&t.edit.sheet===a.sheet&&t.edit.row===a.active.row&&t.edit.col===a.active.col,w=f?t.edit.text:g?.formula!==void 0?`=${g.formula}`:s===null?"":typeof s=="number"?$(s):typeof s=="boolean"?s?"TRUE":"FALSE":k(s)?s.error:s;return n.jsxs("div",{role:"group","aria-label":v["aria-label"]??"Formula bar","data-cells-formula-bar":"",style:{display:"flex",alignItems:"center",gap:4,padding:4},children:[n.jsx(b,{"aria-label":"Name box",size:"small",value:h,style:{width:96},onFocus:()=>m(!0),onBlur:()=>m(!1),onChange:e=>d(e.target.value),onKeyDown:e=>{if(e.key==="Enter"){e.preventDefault();try{a.select(h.trim()),r(""),m(!1)}catch(u){r(u.message)}}else e.key==="Escape"&&(d(i),r(""))}}),n.jsx("span",{"aria-hidden":"true",style:{fontStyle:"italic",opacity:.7},children:"fx"}),n.jsx(b,{"aria-label":"Formula","aria-describedby":c?y:void 0,"aria-invalid":c?!0:void 0,size:"small",block:!0,value:w,onFocus:()=>{f||t.start()},onChange:e=>{f||t.start(),t.setText(e.target.value)},onKeyDown:e=>{if(e.key==="Enter"){e.preventDefault();const u=t.commit();r(u.ok?"":u.refusals.map(z=>z.message).join(" "))}else e.key==="Escape"&&(e.preventDefault(),t.cancel(),r(""))}}),c&&n.jsx("span",{id:y,role:"alert",style:{color:"var(--fgColor-danger, #d1242f)"},children:c})]})}export{L as F};
1
+ import{r as l,j as n,a6 as b}from"../datalayer-app-main.js";import{c as C,z as F,n as $,b as k}from"./model-BUkhfry_.js";import{u as S,b as T,c as D,d as N}from"./SheetTabs-CIoATuqe.js";function L(v){const E=S(),a=T(),t=D(),j=`'${E.sheet(a.sheet).name.replace(/'/g,"''")}'`,p=`${C(a.active.col)}${a.active.row+1}`,{content:g,value:s}=N(`${j}!${p}`),o=a.zones[a.zones.length-1],i=o.top===o.bottom&&o.left===o.right?p:F(o),[h,d]=l.useState(i),[x,m]=l.useState(!1),[c,r]=l.useState(""),y=l.useId();l.useEffect(()=>{x||d(i)},[i,x]);const f=t.edit!==null&&t.edit.sheet===a.sheet&&t.edit.row===a.active.row&&t.edit.col===a.active.col,w=f?t.edit.text:g?.formula!==void 0?`=${g.formula}`:s===null?"":typeof s=="number"?$(s):typeof s=="boolean"?s?"TRUE":"FALSE":k(s)?s.error:s;return n.jsxs("div",{role:"group","aria-label":v["aria-label"]??"Formula bar","data-cells-formula-bar":"",style:{display:"flex",alignItems:"center",gap:4,padding:4},children:[n.jsx(b,{"aria-label":"Name box",size:"small",value:h,style:{width:96},onFocus:()=>m(!0),onBlur:()=>m(!1),onChange:e=>d(e.target.value),onKeyDown:e=>{if(e.key==="Enter"){e.preventDefault();try{a.select(h.trim()),r(""),m(!1)}catch(u){r(u.message)}}else e.key==="Escape"&&(d(i),r(""))}}),n.jsx("span",{"aria-hidden":"true",style:{fontStyle:"italic",opacity:.7},children:"fx"}),n.jsx(b,{"aria-label":"Formula","aria-describedby":c?y:void 0,"aria-invalid":c?!0:void 0,size:"small",block:!0,value:w,onFocus:()=>{f||t.start()},onChange:e=>{f||t.start(),t.setText(e.target.value)},onKeyDown:e=>{if(e.key==="Enter"){e.preventDefault();const u=t.commit();r(u.ok?"":u.refusals.map(z=>z.message).join(" "))}else e.key==="Escape"&&(e.preventDefault(),t.cancel(),r(""))}}),c&&n.jsx("span",{id:y,role:"alert",style:{color:"var(--fgColor-danger, #d1242f)"},children:c})]})}export{L as F};