@datalayer/agent-runtimes 1.6.66 → 1.6.67
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist-embed/chunks/{AgentDetails-DG6uOk7I.js → AgentDetails-BF_5ciFm.js} +1 -1
- package/dist-embed/chunks/{AgentDetailsDialog-D3QFcAsj.js → AgentDetailsDialog-HoFvwtjO.js} +1 -1
- package/dist-embed/chunks/{AgentInspector-CuevpT3A.js → AgentInspector-DI3nGdoh.js} +1 -1
- package/dist-embed/chunks/{AgentInspectorDialog-C4MZOtaw.js → AgentInspectorDialog-T1QI-cGu.js} +1 -1
- package/dist-embed/chunks/{CellSidebarExtension-CwU9KIEf.js → CellSidebarExtension-COAR2VxE.js} +1 -1
- package/dist-embed/chunks/{ChatView-Bg-IvVbM.js → ChatView-BZnKYY0_.js} +1 -1
- package/dist-embed/chunks/{CollapsiblePlugin-CvJ7xecZ.js → CollapsiblePlugin-iSVyLt0a.js} +1 -1
- package/dist-embed/chunks/{ContextPie-ncFgUHmX.js → ContextPie-BC11pcBQ.js} +1 -1
- package/dist-embed/chunks/{DeckComponent-nqYeknUW.js → DeckComponent-BrmnQBGn.js} +2 -2
- package/dist-embed/chunks/{DocumentView-D0Qph_mS.js → DocumentView-CK9J_10Z.js} +1 -1
- package/dist-embed/chunks/{EphemeralDocument-CR2wHSLb.js → EphemeralDocument-C-GsV9d_.js} +1 -1
- package/dist-embed/chunks/{EphemeralNotebook-BXDfkuxr.js → EphemeralNotebook-WarViown.js} +1 -1
- package/dist-embed/chunks/{ExcalidrawComponent-BIID4P8a.js → ExcalidrawComponent-C1o7xaAT.js} +1 -1
- package/dist-embed/chunks/{ExcalidrawModal-VG3zZYgJ.js → ExcalidrawModal-AzA2uqxH.js} +1 -1
- package/dist-embed/chunks/{JupyterLexicalExtension-0W0-TUuV.js → JupyterLexicalExtension-2cy2JM3c.js} +9 -9
- package/dist-embed/chunks/{KernelVariables-Cyr5X_pI.js → KernelVariables-INnfLlYr.js} +1 -1
- package/dist-embed/chunks/{LexicalToolRegistry-6Vozo3NG.js → LexicalToolRegistry-D44mKdur.js} +1 -1
- package/dist-embed/chunks/{NotebookToolSurfaces-nvKz9jsJ.js → NotebookToolSurfaces-DSIrILh4.js} +1 -1
- package/dist-embed/chunks/{NotebookView-CYnMPPBp.js → NotebookView-BIxC_x8C.js} +1 -1
- package/dist-embed/chunks/{Output-CxP7dwY_.js → Output-BsFagSE6.js} +1 -1
- package/dist-embed/chunks/{SandboxDetailsDialog-CUaFl23M.js → SandboxDetailsDialog-Brzi9HOt.js} +1 -1
- package/dist-embed/chunks/SchemaForm--WesCjhm.js +1 -0
- package/dist-embed/chunks/{SheetTabs-CHGwXIgV.js → SheetTabs-sU8ohZES.js} +2 -2
- package/dist-embed/chunks/{SpreadsheetPreviewView-BWjTH4L9.js → SpreadsheetPreviewView-BZK7EV2t.js} +1 -1
- package/dist-embed/chunks/SpreadsheetView-p1UDsVUp.js +1 -0
- package/dist-embed/chunks/UnlockIcon-pl0zUqkQ.js +1 -0
- package/dist-embed/chunks/{WidgetVariableView-eGLA57M5.js → WidgetVariableView-BF_j1Di-.js} +1 -1
- package/dist-embed/chunks/{YouTubePlugin-De7Nra03.js → YouTubePlugin-Yis7VDLP.js} +1 -1
- package/dist-embed/chunks/{abnfDiagram-VCTEODGH-D4s5Uro8.js → abnfDiagram-VCTEODGH--ri5-_TC.js} +1 -1
- package/dist-embed/chunks/{abnfDiagram-VCTEODGH-DKf-OjTD.js → abnfDiagram-VCTEODGH-UpGkvLwI.js} +1 -1
- package/dist-embed/chunks/{abnfDiagram-VCTEODGH-D-1j1NLV.js → abnfDiagram-VCTEODGH-_DRy8nrp.js} +1 -1
- package/dist-embed/chunks/{ar-SA-G6X2FPQ2-BIRY3_hX.js → ar-SA-G6X2FPQ2-Da6mZEMy.js} +1 -1
- package/dist-embed/chunks/{architectureDiagram-5GKGNRK7-D-Ov5UfK.js → architectureDiagram-5GKGNRK7-AujnAftk.js} +1 -1
- package/dist-embed/chunks/{architectureDiagram-5GKGNRK7-C8ssszga.js → architectureDiagram-5GKGNRK7-B_ZtXJbh.js} +1 -1
- package/dist-embed/chunks/{architectureDiagram-5GKGNRK7-Dlcf8yjW.js → architectureDiagram-5GKGNRK7-CoeREcCh.js} +1 -1
- package/dist-embed/chunks/{az-AZ-76LH7QW2-DYQT9m16.js → az-AZ-76LH7QW2-D9mOYTZd.js} +1 -1
- package/dist-embed/chunks/{bg-BG-XCXSNQG7-DHOqSf6X.js → bg-BG-XCXSNQG7-voBQDzze.js} +1 -1
- package/dist-embed/chunks/{blockDiagram-868be97b-CMcLgaN9.js → blockDiagram-868be97b-NwoCw2x4.js} +1 -1
- package/dist-embed/chunks/{blockDiagram-I7D4REHJ-xcsRlpOH.js → blockDiagram-I7D4REHJ-BBd-kKRM.js} +1 -1
- package/dist-embed/chunks/{blockDiagram-I7D4REHJ-B5AvXbq0.js → blockDiagram-I7D4REHJ-CDvePg2M.js} +1 -1
- package/dist-embed/chunks/{blockDiagram-I7D4REHJ-7OA5gVP4.js → blockDiagram-I7D4REHJ-CG2ozt8w.js} +1 -1
- package/dist-embed/chunks/{bn-BD-2XOGV67Q-CFK0MhFM.js → bn-BD-2XOGV67Q-CA6kP-Tz.js} +1 -1
- package/dist-embed/chunks/{c4Diagram-3f4bdde3-JjVtfP5_.js → c4Diagram-3f4bdde3-DF6e_igU.js} +1 -1
- package/dist-embed/chunks/{c4Diagram-7LVT6UL2-BIDmoj5m.js → c4Diagram-7LVT6UL2-Bgwf9rfF.js} +1 -1
- package/dist-embed/chunks/{c4Diagram-7LVT6UL2-DKnG_7i3.js → c4Diagram-7LVT6UL2-BiGjkL8l.js} +1 -1
- package/dist-embed/chunks/{c4Diagram-7LVT6UL2-CErpbVh8.js → c4Diagram-7LVT6UL2-ysRvOOWv.js} +1 -1
- package/dist-embed/chunks/{ca-ES-6MX7JW3Y-DldfYPtN.js → ca-ES-6MX7JW3Y-BnuF7YSE.js} +1 -1
- package/dist-embed/chunks/{celltoolbartracker-MogG1NWw.js → celltoolbartracker-DUxGddsx.js} +1 -1
- package/dist-embed/chunks/{chunk-2Q5K7J3B-H6AXCn7X.js → chunk-2Q5K7J3B-Dg-EYvKS.js} +1 -1
- package/dist-embed/chunks/{chunk-2Q5K7J3B-C7FoNyzd.js → chunk-2Q5K7J3B-DkLk-Zp_.js} +1 -1
- package/dist-embed/chunks/{chunk-2Q5K7J3B-CUPqLmZB.js → chunk-2Q5K7J3B-MDJGJjfj.js} +1 -1
- package/dist-embed/chunks/{chunk-5VM5RSS4-D3y1kfJ1.js → chunk-5VM5RSS4-9dDZUNna.js} +1 -1
- package/dist-embed/chunks/{chunk-5VM5RSS4-DBEavhtQ.js → chunk-5VM5RSS4-BT2cjPh2.js} +1 -1
- package/dist-embed/chunks/{chunk-5VM5RSS4-nHvVvXYH.js → chunk-5VM5RSS4-C9X0RY4I.js} +1 -1
- package/dist-embed/chunks/{chunk-F27PBJKO-BGnr8z6H.js → chunk-F27PBJKO-BV0K7Xm8.js} +1 -1
- package/dist-embed/chunks/{chunk-F27PBJKO-ZlpsfcCV.js → chunk-F27PBJKO-CGc0Awxu.js} +1 -1
- package/dist-embed/chunks/{chunk-F27PBJKO-DF5vIY_P.js → chunk-F27PBJKO-g_sYjxFk.js} +1 -1
- package/dist-embed/chunks/{chunk-IMKFNOWR-CvrlwOkh.js → chunk-IMKFNOWR-BW_wGb83.js} +1 -1
- package/dist-embed/chunks/{chunk-IMKFNOWR-CxKylLqe.js → chunk-IMKFNOWR-C-3L9ugR.js} +1 -1
- package/dist-embed/chunks/{chunk-IMKFNOWR-DFu4OzEr.js → chunk-IMKFNOWR-ChfGet-4.js} +1 -1
- package/dist-embed/chunks/{chunk-JWPE2WC7-CDbGLj7H.js → chunk-JWPE2WC7-395Nfues.js} +1 -1
- package/dist-embed/chunks/{chunk-JWPE2WC7-BszTJGSD.js → chunk-JWPE2WC7-B5aWhnDE.js} +1 -1
- package/dist-embed/chunks/{chunk-JWPE2WC7-D121VPMF.js → chunk-JWPE2WC7-CLfkl6Q-.js} +1 -1
- package/dist-embed/chunks/{chunk-POPQ4Y6H-B3RgM5yX.js → chunk-POPQ4Y6H-D5joFFHd.js} +1 -1
- package/dist-embed/chunks/{chunk-POPQ4Y6H-T1SAIH-u.js → chunk-POPQ4Y6H-DD-tIAa2.js} +1 -1
- package/dist-embed/chunks/{chunk-POPQ4Y6H-XAvKkLW6.js → chunk-POPQ4Y6H-DT7q2gIV.js} +1 -1
- package/dist-embed/chunks/{chunk-SVP7TREG-GalZpeaK.js → chunk-SVP7TREG-CiS15kK9.js} +1 -1
- package/dist-embed/chunks/{chunk-SVP7TREG-CMiosKBd.js → chunk-SVP7TREG-eqgf7wtg.js} +1 -1
- package/dist-embed/chunks/{chunk-SVP7TREG-PeSLEMbu.js → chunk-SVP7TREG-zPoLkqhg.js} +1 -1
- package/dist-embed/chunks/{chunk-TICWLB2K-CGSPSHK5.js → chunk-TICWLB2K-BCxZi3ql.js} +1 -1
- package/dist-embed/chunks/{chunk-TICWLB2K-DtKDv94P.js → chunk-TICWLB2K-Bl3TNoUi.js} +1 -1
- package/dist-embed/chunks/{chunk-TICWLB2K-CoByw4jg.js → chunk-TICWLB2K-DgLQGmJw.js} +1 -1
- package/dist-embed/chunks/{chunk-XXDRQBXY-CMDYWdz3.js → chunk-XXDRQBXY-B5jeZbs6.js} +1 -1
- package/dist-embed/chunks/{chunk-XXDRQBXY-CTJ5t9_M.js → chunk-XXDRQBXY-C0EGO2d_.js} +1 -1
- package/dist-embed/chunks/{chunk-XXDRQBXY-DxSrmW_R.js → chunk-XXDRQBXY-DCRWDA8g.js} +1 -1
- package/dist-embed/chunks/{classDiagram-ZZMXUADV-C7oCc7vu.js → classDiagram-ZZMXUADV-BW6AcVWQ.js} +1 -1
- package/dist-embed/chunks/{classDiagram-ZZMXUADV-C7Ckqws0.js → classDiagram-ZZMXUADV-BwS30iBL.js} +1 -1
- package/dist-embed/chunks/{classDiagram-ZZMXUADV-DiTbfkV6.js → classDiagram-ZZMXUADV-DCb9ciQg.js} +1 -1
- package/dist-embed/chunks/{classDiagram-f62afe4f-BPmc-obR.js → classDiagram-f62afe4f-CZRzyZms.js} +1 -1
- package/dist-embed/chunks/{classDiagram-v2-604399ef-BYY42PzO.js → classDiagram-v2-604399ef-BzIXmcGC.js} +1 -1
- package/dist-embed/chunks/{classDiagram-v2-VYDZK3BY-C7oCc7vu.js → classDiagram-v2-VYDZK3BY-BW6AcVWQ.js} +1 -1
- package/dist-embed/chunks/{classDiagram-v2-VYDZK3BY-C7Ckqws0.js → classDiagram-v2-VYDZK3BY-BwS30iBL.js} +1 -1
- package/dist-embed/chunks/{classDiagram-v2-VYDZK3BY-DiTbfkV6.js → classDiagram-v2-VYDZK3BY-DCb9ciQg.js} +1 -1
- package/dist-embed/chunks/{code-block-IT6T5CEO-Rra2QX20.js → code-block-IT6T5CEO-Dknov-BU.js} +1 -1
- package/dist-embed/chunks/{component-5byAKCsa.js → component-n0OsR7uM.js} +1 -1
- package/dist-embed/chunks/{cose-bilkent-JH36ORCC-CVPO6GK4.js → cose-bilkent-JH36ORCC-CZxQm4TC.js} +1 -1
- package/dist-embed/chunks/{cose-bilkent-JH36ORCC-DLa40PMg.js → cose-bilkent-JH36ORCC-Cz5kqs1J.js} +1 -1
- package/dist-embed/chunks/{cose-bilkent-JH36ORCC-CzXtlqyv.js → cose-bilkent-JH36ORCC-DgDzDJQ7.js} +1 -1
- package/dist-embed/chunks/{createText-aed3d8b3-CK3CN4xz.js → createText-aed3d8b3-DYWlLEn1.js} +2 -2
- package/dist-embed/chunks/{cs-CZ-2BRQDIVT-9iX5aXmE.js → cs-CZ-2BRQDIVT-zK-8AaLv.js} +1 -1
- package/dist-embed/chunks/{cynefinDiagram-5FMLGOSQ-CKDLx_le.js → cynefinDiagram-5FMLGOSQ-D532LKSh.js} +1 -1
- package/dist-embed/chunks/{cynefinDiagram-5FMLGOSQ-DSVXUPg3.js → cynefinDiagram-5FMLGOSQ-emc1W4mk.js} +1 -1
- package/dist-embed/chunks/{cynefinDiagram-5FMLGOSQ-CMJISQf2.js → cynefinDiagram-5FMLGOSQ-ynOn4s55.js} +1 -1
- package/dist-embed/chunks/{da-DK-5WZEPLOC-CBIf-Uvi.js → da-DK-5WZEPLOC-CPu6WpvR.js} +1 -1
- package/dist-embed/chunks/{dagre-GXQ25YYZ-BxPI5_g5.js → dagre-GXQ25YYZ-3dgv4H19.js} +1 -1
- package/dist-embed/chunks/{dagre-GXQ25YYZ-CFGu2HDn.js → dagre-GXQ25YYZ-B7K3Jduf.js} +1 -1
- package/dist-embed/chunks/{dagre-GXQ25YYZ-CvVEsnFa.js → dagre-GXQ25YYZ-CPJFBIsG.js} +1 -1
- package/dist-embed/chunks/{de-DE-XR44H4JA-WsQe2X4P.js → de-DE-XR44H4JA-D60WsBXX.js} +1 -1
- package/dist-embed/chunks/{diagram-S7CK7UJ4-BXctJVvI.js → diagram-S7CK7UJ4-BJho1zT4.js} +1 -1
- package/dist-embed/chunks/{diagram-S7CK7UJ4-DNojdRrP.js → diagram-S7CK7UJ4-BsR-zj_A.js} +1 -1
- package/dist-embed/chunks/{diagram-S7CK7UJ4-Bfww9pDh.js → diagram-S7CK7UJ4-CfJgXIJF.js} +1 -1
- package/dist-embed/chunks/{diagram-UQ7AKVKN-BWIjqGTD.js → diagram-UQ7AKVKN-BA16FsKW.js} +1 -1
- package/dist-embed/chunks/{diagram-UQ7AKVKN-CMCrD8Zm.js → diagram-UQ7AKVKN-BxoQUs9R.js} +1 -1
- package/dist-embed/chunks/{diagram-UQ7AKVKN-CyAvYz0S.js → diagram-UQ7AKVKN-z1SmaQKj.js} +1 -1
- package/dist-embed/chunks/{diagram-VSXAHHWV-CKHEWx-6.js → diagram-VSXAHHWV-B_7S30El.js} +1 -1
- package/dist-embed/chunks/{diagram-VSXAHHWV-CTUTEVSD.js → diagram-VSXAHHWV-Dc-SYz8u.js} +1 -1
- package/dist-embed/chunks/{diagram-VSXAHHWV-BDcL-Obt.js → diagram-VSXAHHWV-DoGi54kO.js} +1 -1
- package/dist-embed/chunks/{diagram-VX7I27RA-B_t-C149.js → diagram-VX7I27RA-CXpWBrhO.js} +1 -1
- package/dist-embed/chunks/{diagram-VX7I27RA-BXd9STzv.js → diagram-VX7I27RA-CYsrwKSr.js} +1 -1
- package/dist-embed/chunks/{diagram-VX7I27RA-C_ybjO0j.js → diagram-VX7I27RA-CiTrbGEO.js} +1 -1
- package/dist-embed/chunks/{diagram-Z3DM3KII-DTtV--L4.js → diagram-Z3DM3KII-C4eFBaC-.js} +1 -1
- package/dist-embed/chunks/{diagram-Z3DM3KII-BCWEu4Rx.js → diagram-Z3DM3KII-CcwYMiHW.js} +1 -1
- package/dist-embed/chunks/{diagram-Z3DM3KII-kZqLVStL.js → diagram-Z3DM3KII-D7ZKLVpq.js} +1 -1
- package/dist-embed/chunks/{ebnfDiagram-PWID7BFC-Bum8hvOz.js → ebnfDiagram-PWID7BFC-BfN1y1fo.js} +1 -1
- package/dist-embed/chunks/{ebnfDiagram-PWID7BFC-hi9y_bvO.js → ebnfDiagram-PWID7BFC-BzpnIaOU.js} +1 -1
- package/dist-embed/chunks/{ebnfDiagram-PWID7BFC-DOHjjjrZ.js → ebnfDiagram-PWID7BFC-DoP7WA_T.js} +1 -1
- package/dist-embed/chunks/{edges-b2856ca0-CtBxKOmX.js → edges-b2856ca0-B9X9yvo3.js} +1 -1
- package/dist-embed/chunks/{el-GR-BZB4AONW-iDzstq8G.js → el-GR-BZB4AONW-BHr1ro-z.js} +1 -1
- package/dist-embed/chunks/{erDiagram-5d81789a-DHoJxPmu.js → erDiagram-5d81789a-CQxlGIL9.js} +1 -1
- package/dist-embed/chunks/{erDiagram-RLTQ6QDP-DlB-PV_o.js → erDiagram-RLTQ6QDP-DWiR0D0I.js} +1 -1
- package/dist-embed/chunks/{erDiagram-RLTQ6QDP-D_ixQkcN.js → erDiagram-RLTQ6QDP-DfZpVJNm.js} +1 -1
- package/dist-embed/chunks/{erDiagram-RLTQ6QDP-DxV2l_Mh.js → erDiagram-RLTQ6QDP-GBstfTJz.js} +1 -1
- package/dist-embed/chunks/{es-ES-U4NZUMDT-AXNoLAY0.js → es-ES-U4NZUMDT-BUMhIEKb.js} +1 -1
- package/dist-embed/chunks/{esm-BfflGAkV.js → esm-CGgWz33Z.js} +1 -1
- package/dist-embed/chunks/{esm-CBgG2ca6.js → esm-CpbcG1EK.js} +1 -1
- package/dist-embed/chunks/{eu-ES-A7QVB2H4-CdBcG_j6.js → eu-ES-A7QVB2H4-DVFRhifa.js} +1 -1
- package/dist-embed/chunks/{fa-IR-HGAKTJCU-Br2sWKas.js → fa-IR-HGAKTJCU-vug3QnYi.js} +1 -1
- package/dist-embed/chunks/{fi-FI-Z5N7JZ37-BqMTd3Dd.js → fi-FI-Z5N7JZ37-g_IFjTps.js} +1 -1
- package/dist-embed/chunks/{flowDb-185abca5-C44P5Qqv.js → flowDb-185abca5-BkILCIDo.js} +1 -1
- package/dist-embed/chunks/{flowDiagram-1629c991-Ca0SO5hj.js → flowDiagram-1629c991-DwTavjay.js} +1 -1
- package/dist-embed/chunks/{flowDiagram-HODETNUW-BQcu8D8t.js → flowDiagram-HODETNUW-BAxq4B4u.js} +1 -1
- package/dist-embed/chunks/{flowDiagram-HODETNUW-DfBzTHGP.js → flowDiagram-HODETNUW-DyLT-j2U.js} +1 -1
- package/dist-embed/chunks/{flowDiagram-HODETNUW-CTwj7gbY.js → flowDiagram-HODETNUW-zty_XhqL.js} +1 -1
- package/dist-embed/chunks/{flowDiagram-v2-1d953310-d3nuZ7ZS.js → flowDiagram-v2-1d953310-tCdtIr3W.js} +1 -1
- package/dist-embed/chunks/{flowchart-elk-definition-6df44142-DuqsBN2R.js → flowchart-elk-definition-6df44142-Xz5-qFUT.js} +1 -1
- package/dist-embed/chunks/{fr-FR-RHASNOE6-JescLNxr.js → fr-FR-RHASNOE6-aGlSoYmL.js} +1 -1
- package/dist-embed/chunks/{ganttDiagram-3b0b3873-DoQS_3aw.js → ganttDiagram-3b0b3873-DGv507ib.js} +1 -1
- package/dist-embed/chunks/{ganttDiagram-EL5Y4UJY-BP5CGDPl.js → ganttDiagram-EL5Y4UJY-D7LM_WuG.js} +1 -1
- package/dist-embed/chunks/{ganttDiagram-EL5Y4UJY-DXT906Lr.js → ganttDiagram-EL5Y4UJY-DEdvr5IV.js} +1 -1
- package/dist-embed/chunks/{ganttDiagram-EL5Y4UJY-D5P_Fs98.js → ganttDiagram-EL5Y4UJY-Doc-iM0q.js} +1 -1
- package/dist-embed/chunks/{gitGraphDiagram-WWUBYQGX-CtCcTWP5.js → gitGraphDiagram-WWUBYQGX-BLYjPRSD.js} +1 -1
- package/dist-embed/chunks/{gitGraphDiagram-WWUBYQGX-CnGawdeJ.js → gitGraphDiagram-WWUBYQGX-BglA1e-c.js} +1 -1
- package/dist-embed/chunks/{gitGraphDiagram-WWUBYQGX-4O3TZWd9.js → gitGraphDiagram-WWUBYQGX-CubF70e_.js} +1 -1
- package/dist-embed/chunks/{gitGraphDiagram-f01e8bc2-BPu0X7AI.js → gitGraphDiagram-f01e8bc2-DjrOgK62.js} +1 -1
- package/dist-embed/chunks/{gl-ES-HMX3MZ6V-CA96xF_L.js → gl-ES-HMX3MZ6V-CGsQ7-H_.js} +1 -1
- package/dist-embed/chunks/{he-IL-6SHJWFNN-Bed9QFd_.js → he-IL-6SHJWFNN-BIzOej_7.js} +1 -1
- package/dist-embed/chunks/{hi-IN-IWLTKZ5I-Co4vEZuV.js → hi-IN-IWLTKZ5I-CaTliqH6.js} +1 -1
- package/dist-embed/chunks/{hu-HU-A5ZG7DT2-CB4PoqV0.js → hu-HU-A5ZG7DT2-BKG51rBJ.js} +1 -1
- package/dist-embed/chunks/{id-ID-SAP4L64H-i0WziNkz.js → id-ID-SAP4L64H-BLmiSjxL.js} +1 -1
- package/dist-embed/chunks/{index-DN5gTjJY.js → index-07h7T7N-.js} +41 -41
- package/dist-embed/chunks/{index-9bae90f3-CKvpMD7I.js → index-9bae90f3-rErY9Sr_.js} +1 -1
- package/dist-embed/chunks/{index-B4V6qqnk.js → index-BdN_7er1.js} +1 -1
- package/dist-embed/chunks/{index-C6mz-EyC.js → index-Bv6GubYe.js} +1 -1
- package/dist-embed/chunks/{index-BPBZr639.js → index-C1Tx7ck6.js} +2 -2
- package/dist-embed/chunks/{index-DT7EdeIs.js → index-DHpFjpWk.js} +1 -1
- package/dist-embed/chunks/{index-BYGVk1jo.js → index-DYBuJWF3.js} +1 -1
- package/dist-embed/chunks/{index-DFKcFkoF.js → index-DlXtuNOm.js} +4 -4
- package/dist-embed/chunks/{index-B09D9j_V.js → index-FRUXunp7.js} +2 -2
- package/dist-embed/chunks/{index-DWdhqvRC.js → index-gFUsWgU1.js} +1 -1
- package/dist-embed/chunks/index.esm-83FY014g.js +1 -0
- package/dist-embed/chunks/{index.esm-IOY4uixS.js → index.esm-C7KUTO-H.js} +1 -1
- package/dist-embed/chunks/{infoDiagram-27XIBGKW-CC-yHErn.js → infoDiagram-27XIBGKW-DcMxb5bQ.js} +1 -1
- package/dist-embed/chunks/{infoDiagram-27XIBGKW-BZ4m3Wh-.js → infoDiagram-27XIBGKW-DrOgMRXL.js} +1 -1
- package/dist-embed/chunks/{infoDiagram-27XIBGKW-DM8DXst8.js → infoDiagram-27XIBGKW-qQmXa_Zy.js} +1 -1
- package/dist-embed/chunks/{infoDiagram-a29d40f1-DsAXqRTw.js → infoDiagram-a29d40f1-B_EuEuAt.js} +1 -1
- package/dist-embed/chunks/{isEqual-BqptHyYZ.js → isEqual-D9LEOOsI.js} +1 -1
- package/dist-embed/chunks/{ishikawaDiagram-5VMMS53U--fILzD4l.js → ishikawaDiagram-5VMMS53U-BMn7AQZj.js} +1 -1
- package/dist-embed/chunks/{ishikawaDiagram-5VMMS53U-BVcYpKd_.js → ishikawaDiagram-5VMMS53U-DlmF-Rrc.js} +1 -1
- package/dist-embed/chunks/{ishikawaDiagram-5VMMS53U-CL7mVauP.js → ishikawaDiagram-5VMMS53U-DvxdcJGT.js} +1 -1
- package/dist-embed/chunks/{it-IT-JPQ66NNP-BXdknCFq.js → it-IT-JPQ66NNP-CPQntQJv.js} +1 -1
- package/dist-embed/chunks/{ja-JP-DBVTYXUO-CBzuv_n2.js → ja-JP-DBVTYXUO-DhNa82yw.js} +1 -1
- package/dist-embed/chunks/{journeyDiagram-3NMN7TZE-CeowXWE6.js → journeyDiagram-3NMN7TZE-7nTdQ0Ap.js} +1 -1
- package/dist-embed/chunks/{journeyDiagram-3NMN7TZE-J5KR4ZOw.js → journeyDiagram-3NMN7TZE-GTscSQY8.js} +1 -1
- package/dist-embed/chunks/{journeyDiagram-3NMN7TZE-B0qmYsXP.js → journeyDiagram-3NMN7TZE-eYnjdS_F.js} +1 -1
- package/dist-embed/chunks/{journeyDiagram-95396277-B2VJJg6W.js → journeyDiagram-95396277-xNK2vAOt.js} +1 -1
- package/dist-embed/chunks/{kaa-6HZHGXH3-oELMHWR6.js → kaa-6HZHGXH3-DpSNzC1F.js} +1 -1
- package/dist-embed/chunks/{kab-KAB-ZGHBKWFO-DmnxUIaD.js → kab-KAB-ZGHBKWFO-oGmKlsfH.js} +1 -1
- package/dist-embed/chunks/{kanban-definition-UXKFOSKX-DOciMW2U.js → kanban-definition-UXKFOSKX-BC7V9b6V.js} +1 -1
- package/dist-embed/chunks/{kanban-definition-UXKFOSKX-DUyYUxUr.js → kanban-definition-UXKFOSKX-Cncfu2yw.js} +1 -1
- package/dist-embed/chunks/{kanban-definition-UXKFOSKX-C9jORcEI.js → kanban-definition-UXKFOSKX-Wy3aU1Nn.js} +1 -1
- package/dist-embed/chunks/{kk-KZ-P5N5QNE5-BkndlwFJ.js → kk-KZ-P5N5QNE5-QL4XizKU.js} +1 -1
- package/dist-embed/chunks/{km-KH-HSX4SM5Z-Cq2ZX6y8.js → km-KH-HSX4SM5Z-C_cbM6UY.js} +1 -1
- package/dist-embed/chunks/{ko-KR-MTYHY66A-DywOc4to.js → ko-KR-MTYHY66A-sUEFRnQA.js} +1 -1
- package/dist-embed/chunks/{ku-TR-6OUDTVRD-DUWYSIaw.js → ku-TR-6OUDTVRD-CuXmGiPZ.js} +1 -1
- package/dist-embed/chunks/{layout-CQn10spC.js → layout-CWYFS7dj.js} +1 -1
- package/dist-embed/chunks/{layout-CZQJtave.js → layout-CwZb7DB3.js} +1 -1
- package/dist-embed/chunks/{layout-D3I_b9Rl.js → layout-D4WL0044.js} +1 -1
- package/dist-embed/chunks/{lexicalHooks-DNHwWp6C.js → lexicalHooks-CV1ayxqd.js} +1 -1
- package/dist-embed/chunks/{lib-CYug-wo8.js → lib-1wHnciLq.js} +4 -4
- package/dist-embed/chunks/{lib-DNhD4oO7.js → lib-BNsM1tzX.js} +1 -1
- package/dist-embed/chunks/{lib-sTCNmZD4.js → lib-BURFkAWJ.js} +2 -2
- package/dist-embed/chunks/{lib-B_hxfRaq.js → lib-Bizr1er1.js} +1 -1
- package/dist-embed/chunks/{lib-CkHT0BYE.js → lib-BuwAP-X6.js} +1 -1
- package/dist-embed/chunks/{lib-CI7PtIuO.js → lib-Bx30WLfv.js} +1 -1
- package/dist-embed/chunks/{lib-DCbP3nDN.js → lib-CAHMtNnY.js} +1 -1
- package/dist-embed/chunks/{lib-C_9l_WiJ.js → lib-CCWKYseC.js} +1 -1
- package/dist-embed/chunks/{lib-DGfrK1ga.js → lib-CbU_6oKu.js} +1 -1
- package/dist-embed/chunks/{lib-Dyyg9CuM.js → lib-CjXFZUT6.js} +1 -1
- package/dist-embed/chunks/{lib-DNQSgaV4.js → lib-CkSZtR0D.js} +1 -1
- package/dist-embed/chunks/{lib-BgH6dvl0.js → lib-CsOLeYYs.js} +1 -1
- package/dist-embed/chunks/{lib-CH8fSBkx.js → lib-CwrSIDCX.js} +1 -1
- package/dist-embed/chunks/{lib-DMgC0ugU.js → lib-D0-0alpU.js} +1 -1
- package/dist-embed/chunks/{lib-1LjjIMA6.js → lib-DHkCtoQ4.js} +1 -1
- package/dist-embed/chunks/{lib-DsrZdrbq.js → lib-D_Wps02T.js} +2 -2
- package/dist-embed/chunks/{lib-B1l51_X6.js → lib-DbdtSUMf.js} +1 -1
- package/dist-embed/chunks/{lib-BcNoEIxU.js → lib-SqNFgE2y.js} +1 -1
- package/dist-embed/chunks/{lib-B9BIpCdh.js → lib-hu58duo_.js} +8 -8
- package/dist-embed/chunks/{lib-buOHpkrF.js → lib-jn64iH_N.js} +1 -1
- package/dist-embed/chunks/{lt-LT-XHIRWOB4-kxLK-Qlk.js → lt-LT-XHIRWOB4-C7BxbAra.js} +1 -1
- package/dist-embed/chunks/{lv-LV-5QDEKY6T-Bmci-FJa.js → lv-LV-5QDEKY6T-kt2ju8Ud.js} +1 -1
- package/dist-embed/chunks/{mermaid.core-CnUsgZUp.js → mermaid.core-CN7SxvKB.js} +16 -16
- package/dist-embed/chunks/{mermaid.core-Cx-AR0mC.js → mermaid.core-DZ4I2wXj.js} +5 -5
- package/dist-embed/chunks/{mindmap-definition-YA3MSWOX-BCseR_8C.js → mindmap-definition-YA3MSWOX-BnFOKEEy.js} +1 -1
- package/dist-embed/chunks/{mindmap-definition-YA3MSWOX-CknR6QAx.js → mindmap-definition-YA3MSWOX-CIFJIBWK.js} +1 -1
- package/dist-embed/chunks/{mindmap-definition-YA3MSWOX-6pkFxCPl.js → mindmap-definition-YA3MSWOX-vjo9Nbc4.js} +1 -1
- package/dist-embed/chunks/{mindmap-definition-e4c1d938-77SVzjv8.js → mindmap-definition-e4c1d938-Br3vyVQg.js} +1 -1
- package/dist-embed/chunks/{mr-IN-CRQNXWMA-C71qXSyn.js → mr-IN-CRQNXWMA-DrLujnnK.js} +1 -1
- package/dist-embed/chunks/{my-MM-5M5IBNSE-BoJX1T_C.js → my-MM-5M5IBNSE-D147A9_u.js} +1 -1
- package/dist-embed/chunks/{nb-NO-T6EIAALU-fCX6kQyr.js → nb-NO-T6EIAALU-BSjyJxI7.js} +1 -1
- package/dist-embed/chunks/{nl-NL-IS3SIHDZ-C6axjbrp.js → nl-NL-IS3SIHDZ-ChkhDAJ5.js} +1 -1
- package/dist-embed/chunks/{nn-NO-6E72VCQL-CMg-w3Vl.js → nn-NO-6E72VCQL-DRSYbNZB.js} +1 -1
- package/dist-embed/chunks/{oc-FR-POXYY2M6-RFIyPzqK.js → oc-FR-POXYY2M6-Ch4-NoBL.js} +1 -1
- package/dist-embed/chunks/{pa-IN-N4M65BXN-DRwFZ-LV.js → pa-IN-N4M65BXN-DtX3i-w8.js} +1 -1
- package/dist-embed/chunks/{pegDiagram-XKGWAZYB-kKkz0Sam.js → pegDiagram-XKGWAZYB-BHov5CqU.js} +1 -1
- package/dist-embed/chunks/{pegDiagram-XKGWAZYB-BEg_iAil.js → pegDiagram-XKGWAZYB-CD4wtGJP.js} +1 -1
- package/dist-embed/chunks/{pegDiagram-XKGWAZYB-Cglf81AR.js → pegDiagram-XKGWAZYB-WM2ZIYg_.js} +1 -1
- package/dist-embed/chunks/{percentages-BXMCSKIN-C7Y8Gae9.js → percentages-BXMCSKIN-CW6DmtN7.js} +5 -5
- package/dist-embed/chunks/{pieDiagram-E7YTZNPT-eKzCNAFL.js → pieDiagram-E7YTZNPT-2ZaGFf8r.js} +1 -1
- package/dist-embed/chunks/{pieDiagram-E7YTZNPT-B8umNIwC.js → pieDiagram-E7YTZNPT-CQPIHY9W.js} +1 -1
- package/dist-embed/chunks/{pieDiagram-E7YTZNPT-CzQGtyds.js → pieDiagram-E7YTZNPT-Da3CXwiK.js} +1 -1
- package/dist-embed/chunks/{pieDiagram-c941bede-CXgrRWkr.js → pieDiagram-c941bede-B8JhyeC4.js} +1 -1
- package/dist-embed/chunks/{pl-PL-T2D74RX3-MIshs9FC.js → pl-PL-T2D74RX3-P6jcW9pW.js} +1 -1
- package/dist-embed/chunks/{plugin-DKSE7zB1.js → plugin-DlyueHsZ.js} +1 -1
- package/dist-embed/chunks/{pt-BR-5N22H2LF-C51sqaG3.js → pt-BR-5N22H2LF-BSxdfms9.js} +1 -1
- package/dist-embed/chunks/{pt-PT-UZXXM6DQ-CUOrgegB.js → pt-PT-UZXXM6DQ-PtjN_aAy.js} +1 -1
- package/dist-embed/chunks/{quadrantDiagram-AXDQQJYC-DNF9bfiJ.js → quadrantDiagram-AXDQQJYC-BX8ftnLR.js} +1 -1
- package/dist-embed/chunks/{quadrantDiagram-AXDQQJYC-BB0ikH_3.js → quadrantDiagram-AXDQQJYC-CfmPrLe-.js} +1 -1
- package/dist-embed/chunks/{quadrantDiagram-AXDQQJYC-CEu1kH-c.js → quadrantDiagram-AXDQQJYC-CyjgReFb.js} +1 -1
- package/dist-embed/chunks/{quadrantDiagram-cf8b8fe0-D1RWBabs.js → quadrantDiagram-cf8b8fe0-HYzvHp7H.js} +1 -1
- package/dist-embed/chunks/{railroadDiagram-O6MQD6OU-DOVJhcBQ.js → railroadDiagram-O6MQD6OU-BgZeQt19.js} +1 -1
- package/dist-embed/chunks/{railroadDiagram-O6MQD6OU-BywJje2P.js → railroadDiagram-O6MQD6OU-DNgcy5rA.js} +1 -1
- package/dist-embed/chunks/{railroadDiagram-O6MQD6OU-CocZA-8C.js → railroadDiagram-O6MQD6OU-DZI01Z21.js} +1 -1
- package/dist-embed/chunks/{renderer-C8LttmYX.js → renderer-DdYo8U7J.js} +1 -1
- package/dist-embed/chunks/{requirementDiagram-53bda41b-D7s0_2iF.js → requirementDiagram-53bda41b-nM_4CJVF.js} +1 -1
- package/dist-embed/chunks/{requirementDiagram-BXWQKSXE-DNsbj1tA.js → requirementDiagram-BXWQKSXE-DNIzj_IO.js} +1 -1
- package/dist-embed/chunks/{requirementDiagram-BXWQKSXE-PHOuYwsL.js → requirementDiagram-BXWQKSXE-s2E38f4Y.js} +1 -1
- package/dist-embed/chunks/{requirementDiagram-BXWQKSXE-BNZJ8Pl6.js → requirementDiagram-BXWQKSXE-zmw2mTK0.js} +1 -1
- package/dist-embed/chunks/{ro-RO-JPDTUUEW-CO34-3L-.js → ro-RO-JPDTUUEW-DB5UQh-c.js} +1 -1
- package/dist-embed/chunks/{ru-RU-B4JR7IUQ-I1ElfxUz.js → ru-RU-B4JR7IUQ-u8YCIOnR.js} +1 -1
- package/dist-embed/chunks/{sankeyDiagram-P5KCCOFB-CLgglmoE.js → sankeyDiagram-P5KCCOFB-BsKc0e1e.js} +1 -1
- package/dist-embed/chunks/{sankeyDiagram-P5KCCOFB-Dsc6Y7N_.js → sankeyDiagram-P5KCCOFB-BxnVbb9i.js} +1 -1
- package/dist-embed/chunks/{sankeyDiagram-P5KCCOFB-TArXErtO.js → sankeyDiagram-P5KCCOFB-CZjzGHkF.js} +1 -1
- package/dist-embed/chunks/{sankeyDiagram-c3ef121a-Dx9_M58p.js → sankeyDiagram-c3ef121a-Csx5C6c-.js} +1 -1
- package/dist-embed/chunks/{sequenceDiagram-82a5b84f-DbalIYcH.js → sequenceDiagram-82a5b84f-DHkhxq5s.js} +1 -1
- package/dist-embed/chunks/{sequenceDiagram-WJ2MYXX4-C0nZl1yt.js → sequenceDiagram-WJ2MYXX4-B0XWMFde.js} +1 -1
- package/dist-embed/chunks/{sequenceDiagram-WJ2MYXX4-BPyPDxP-.js → sequenceDiagram-WJ2MYXX4-BuQNzyij.js} +1 -1
- package/dist-embed/chunks/{sequenceDiagram-WJ2MYXX4-Bc2J1TS3.js → sequenceDiagram-WJ2MYXX4-lbk1kNKx.js} +1 -1
- package/dist-embed/chunks/{server-extension-CSNQivRp.js → server-extension-B_38voj9.js} +1 -1
- package/dist-embed/chunks/{sessions-C-AH_Lec.js → sessions-Dy-NqKRu.js} +1 -1
- package/dist-embed/chunks/{si-LK-N5RQ5JYF-DhlGVUZ-.js → si-LK-N5RQ5JYF-Dq0-CWaM.js} +1 -1
- package/dist-embed/chunks/{sizeCapture-INFHLROL-CAqU0XqW.js → sizeCapture-INFHLROL-BDTUe0KN.js} +1 -1
- package/dist-embed/chunks/{sizeCapture-INFHLROL-DoirSDGp.js → sizeCapture-INFHLROL-D7UeXkEw.js} +1 -1
- package/dist-embed/chunks/{sizeCapture-INFHLROL-CfcotsHH.js → sizeCapture-INFHLROL-jmBgjYtl.js} +1 -1
- package/dist-embed/chunks/{sk-SK-C5VTKIMK-Powg1uMW.js → sk-SK-C5VTKIMK-DNRQ4ZoR.js} +1 -1
- package/dist-embed/chunks/{sl-SI-NN7IZMDC-C-RGpik6.js → sl-SI-NN7IZMDC-BKEsrYcK.js} +1 -1
- package/dist-embed/chunks/{state-DpcP42Yh.js → state-9fI8UPS2.js} +1 -1
- package/dist-embed/chunks/{stateDiagram-43e79a5f-CBC6Dbf7.js → stateDiagram-43e79a5f-DHNcS28Z.js} +1 -1
- package/dist-embed/chunks/{stateDiagram-D77RDMKH-C9alX1uB.js → stateDiagram-D77RDMKH-B71if5DR.js} +1 -1
- package/dist-embed/chunks/{stateDiagram-D77RDMKH-D6_XPsie.js → stateDiagram-D77RDMKH-CoL-h8eb.js} +1 -1
- package/dist-embed/chunks/{stateDiagram-D77RDMKH-n7CBXfbn.js → stateDiagram-D77RDMKH-DjrPR8ru.js} +1 -1
- package/dist-embed/chunks/{stateDiagram-v2-2041ed4f-dibLmZeO.js → stateDiagram-v2-2041ed4f-DGhD8tlH.js} +1 -1
- package/dist-embed/chunks/{stateDiagram-v2-MP3YSRHH-BHggFnoY.js → stateDiagram-v2-MP3YSRHH-Bp6pf8ES.js} +1 -1
- package/dist-embed/chunks/{stateDiagram-v2-MP3YSRHH-B_RgfNeH.js → stateDiagram-v2-MP3YSRHH-BtrqK7K7.js} +1 -1
- package/dist-embed/chunks/{stateDiagram-v2-MP3YSRHH-DkOaCT9Q.js → stateDiagram-v2-MP3YSRHH-DUMt1Jpw.js} +1 -1
- package/dist-embed/chunks/{styles-455b33cd-DD80vfbg.js → styles-455b33cd-ykZVA52U.js} +1 -1
- package/dist-embed/chunks/{styles-f932cba9-BsS4dYno.js → styles-f932cba9-DUqGyxc3.js} +1 -1
- package/dist-embed/chunks/{styles-fcc2142b-BqdPgpfa.js → styles-fcc2142b-DIwy_vh-.js} +1 -1
- package/dist-embed/chunks/{subset-shared.chunk-CqCfzIts.js → subset-shared.chunk-DDtd7CAl.js} +1 -1
- package/dist-embed/chunks/{subset-worker.chunk-BGL3DWK4.js → subset-worker.chunk-QkNWWVA4.js} +1 -1
- package/dist-embed/chunks/{substates-BrIEkpHg.js → substates-D4U0zpiL.js} +1 -1
- package/dist-embed/chunks/{sv-SE-XGPEYMSR-F5fNEFWG.js → sv-SE-XGPEYMSR-BI-BivwT.js} +1 -1
- package/dist-embed/chunks/{svgDrawCommon-148a3cd9-CUHfNkOe.js → svgDrawCommon-148a3cd9-DMD3OaDF.js} +1 -1
- package/dist-embed/chunks/{swimlanes-42K2YHIH-CEsIe_9R.js → swimlanes-42K2YHIH-Cneeqvjj.js} +1 -1
- package/dist-embed/chunks/{swimlanes-42K2YHIH-tSuPmvtv.js → swimlanes-42K2YHIH-wymlTjQp.js} +1 -1
- package/dist-embed/chunks/{swimlanes-42K2YHIH-B7tNOmIS.js → swimlanes-42K2YHIH-yoQ_hB-F.js} +1 -1
- package/dist-embed/chunks/{swimlanesDiagram-VR7AAH4N-DStVUxkf.js → swimlanesDiagram-VR7AAH4N-CAo5HpB4.js} +1 -1
- package/dist-embed/chunks/{swimlanesDiagram-VR7AAH4N-BWjhSok0.js → swimlanesDiagram-VR7AAH4N-DTyfvCTu.js} +1 -1
- package/dist-embed/chunks/{swimlanesDiagram-VR7AAH4N-C9OJYcAD.js → swimlanesDiagram-VR7AAH4N-y3z6Xvtj.js} +1 -1
- package/dist-embed/chunks/{ta-IN-2NMHFXQM-ZMfMrdVx.js → ta-IN-2NMHFXQM-CXR2iNgh.js} +1 -1
- package/dist-embed/chunks/{th-TH-HPSO5L25-p3OkfEs9.js → th-TH-HPSO5L25-Do__5qpO.js} +1 -1
- package/dist-embed/chunks/{timeline-definition-24CTP7MA-Bs8zhxca.js → timeline-definition-24CTP7MA-CJYUxN4r.js} +1 -1
- package/dist-embed/chunks/{timeline-definition-24CTP7MA-CZtzcI43.js → timeline-definition-24CTP7MA-C_mgir0o.js} +1 -1
- package/dist-embed/chunks/{timeline-definition-24CTP7MA-DCY6SxPK.js → timeline-definition-24CTP7MA-CnqRW47X.js} +1 -1
- package/dist-embed/chunks/{timeline-definition-7545f45a-Cy1xkNpB.js → timeline-definition-7545f45a-yu_EctU2.js} +1 -1
- package/dist-embed/chunks/{tr-TR-DEFEU3FU-URuGcExI.js → tr-TR-DEFEU3FU-oBFcY3gs.js} +1 -1
- package/dist-embed/chunks/{uk-UA-QMV73CPH-7ROkicRa.js → uk-UA-QMV73CPH-03kew5Q0.js} +1 -1
- package/dist-embed/chunks/{vennDiagram-4TSXK5OY-BrbR-CEj.js → vennDiagram-4TSXK5OY-B7XldBYg.js} +1 -1
- package/dist-embed/chunks/{vennDiagram-4TSXK5OY-DRWwK3J1.js → vennDiagram-4TSXK5OY-BndPt1e4.js} +1 -1
- package/dist-embed/chunks/{vennDiagram-4TSXK5OY-C9OR8PJF.js → vennDiagram-4TSXK5OY-DJmAXfvt.js} +1 -1
- package/dist-embed/chunks/{vi-VN-M7AON7JQ-BlBOGax9.js → vi-VN-M7AON7JQ-DwS7ChJU.js} +1 -1
- package/dist-embed/chunks/{wardleyDiagram-VM6X3IG4-Dc0cHj2x.js → wardleyDiagram-VM6X3IG4-BdafCyfl.js} +1 -1
- package/dist-embed/chunks/{wardleyDiagram-VM6X3IG4-BXMs8m0S.js → wardleyDiagram-VM6X3IG4-CUzROjzp.js} +1 -1
- package/dist-embed/chunks/{wardleyDiagram-VM6X3IG4-B4h67LCF.js → wardleyDiagram-VM6X3IG4-DjBPstF5.js} +1 -1
- package/dist-embed/chunks/{xychartDiagram-3f383b91-Dn-fJsXP.js → xychartDiagram-3f383b91-ikAug0GX.js} +1 -1
- package/dist-embed/chunks/{xychartDiagram-S5SC5T6Z-CgM50iAb.js → xychartDiagram-S5SC5T6Z-B8-49rEf.js} +1 -1
- package/dist-embed/chunks/{xychartDiagram-S5SC5T6Z-N_EkX4Dl.js → xychartDiagram-S5SC5T6Z-CSs-jQfW.js} +1 -1
- package/dist-embed/chunks/{xychartDiagram-S5SC5T6Z-5L6kINsv.js → xychartDiagram-S5SC5T6Z-CZXNh1II.js} +1 -1
- package/dist-embed/chunks/{zh-CN-LNUGB5OW-F-_ltau1.js → zh-CN-LNUGB5OW-Doit0LrB.js} +1 -1
- package/dist-embed/chunks/{zh-HK-E62DVLB3-ZHqkruH1.js → zh-HK-E62DVLB3-DE-SUCpj.js} +1 -1
- package/dist-embed/chunks/{zh-TW-RAJ6MFWO-CB6XkCmO.js → zh-TW-RAJ6MFWO-CVpzyGKt.js} +1 -1
- package/dist-embed/datalayer-app-main.js +37 -37
- package/lib/apps/agentUiPlugins.d.ts +29 -0
- package/lib/apps/agentUiPlugins.js +44 -0
- package/lib/apps/apps/AppRenderer.d.ts +6 -0
- package/lib/apps/apps/AppRenderer.js +16 -4
- package/lib/apps/embed/visitorApp.js +14 -6
- package/lib/apps/plugins/browser-session/index.js +2 -1
- package/lib/apps/plugins/linkedin-link/index.d.ts +1 -1
- package/lib/apps/plugins/locked-ui/index.d.ts +27 -0
- package/lib/apps/plugins/locked-ui/index.js +33 -0
- package/lib/apps/plugins/x-budget/index.js +2 -1
- package/lib/apps/presets.d.ts +3 -1
- package/lib/apps/presets.js +10 -3
- package/lib/chat/Chat.d.ts +5 -1
- package/lib/chat/Chat.js +12 -3
- package/lib/chat/anonymous/anonymousMode.d.ts +11 -0
- package/lib/chat/anonymous/anonymousMode.js +11 -0
- package/lib/portable/displays.js +3 -1
- package/package.json +1 -1
- package/dist-embed/chunks/SchemaForm-DC0PTrM2.js +0 -1
- package/dist-embed/chunks/SpreadsheetView-DPbfD18s.js +0 -1
- package/dist-embed/chunks/UnlockIcon-CKDBWE-s.js +0 -1
- package/dist-embed/chunks/index.esm-EoS0Yo1L.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{T as De,q as he,t as ht,r as ce,b as $e,g as Je,I as pt,k as gt,a as ze,f as Ge,C as Re,h as Ie}from"./index-DWdhqvRC.js";import{J as M,aA as ee,cg as ie,aD as R,gu as mt,eI as Ct,fR as bt,ci as me,aJ as Te,eg as ft,ck as vt,eh as _t,ce as Ce,iB as yt,r as J,eO as xt,iu as wt,eM as kt,dB as Z,co as St,iC as v,dM as Ye,dI as Xe,dN as Qe,fP as Ze,fQ as et,eL as Be,aI as At,aE as tt,aF as ke,iD as Mt,iE as Tt,iw as Bt,k as Y,bg as Et,gm as Nt,a9 as Ot,aB as be,gz as G,iF as ge,az as le,iG as xe,iH as Q,eF as Pe,iI as jt,iJ as Rt,dW as we,dY as It,d_ as Le,iK as We,dX as Pt,iL as Lt,iM as Wt,aw as ot,iN as Ht,iO as Ft,eK as Kt,iP as Vt,aC as F,ev as fe,iQ as Se,dw as Ut,eD as qt,e2 as Dt,iR as $t,iS as se,iT as nt,cd as pe,dy as Jt,aG as zt,dD as Gt,cq as Yt,gx as Xt,iU as Qt,dR as Zt,dU as eo,iV as to,dG as oo,iW as no,iX as io,ec as lo,ed as so,dx as ro,bf as ao,fj as co}from"../datalayer-app-main.js";import{b as uo,I as it}from"./token-d9po19EN.js";import{ToolbarItems as ho}from"./lib-C_9l_WiJ.js";import{I as po}from"./index-PKH5uAl-.js";import{I as ve}from"./tokens-Dyd4wiX6.js";import{a as lt,I as L,b as st,c as go}from"./tokens-DiDi0Nkm.js";import{I as mo,a as rt}from"./tokens-DbNnxPrX.js";import{I as Co}from"./tokens-D1WVYIDT.js";import{f as at,e as bo,c as fo,I as vo,b as _o}from"./index-B09D9j_V.js";import{I as dt}from"./tokens-B7nNzQEE.js";import{I as _e}from"./tokens-DY_UrMLq.js";import{a as Ee}from"./tokens-BYcJtuKD.js";import{I as yo}from"./tokens-Nkg3e_k9.js";import{I as xo}from"./index-BPBZr639.js";import{I as wo}from"./tokens-BcAeNU3z.js";import{W as ko,u as He,V as So,I as Ao,a as Mo,b as To,c as Bo}from"./document-Dp0KpIjg.js";import{s as Eo}from"./hover-B3uFmZ-0.js";import{b as No,c as Oo,d as jo}from"./CellSidebarExtension-CwU9KIEf.js";import{H as Ro}from"./htmlselect-5N6NdDqL.js";import{T as Io,a as Po}from"./model-DbDJZyri.js";import{C as Fe}from"./celltoolbartracker-MogG1NWw.js";import"./hoverbox-CStlKQWE.js";import"./Output-CxP7dwY_.js";import"./index-BYGVk1jo.js";import"./dayjs.min-u3zuoSR8.js";import"./isEqual-BqptHyYZ.js";import"./d3-color-Jd8hXty2.js";import"./dist-BrUAt6vF.js";import"./KebabHorizontalIcon-D6AY8pIS.js";import"./PaintbrushIcon-CFBHU-3l.js";import"./index-CKWSKbHe.js";import"./RestartIcon-DvpOf5Mf.js";import"./NotebookSkeleton-BaU6vrsb.js";import"./Avatar-Cv5OpUWu.js";import"./renderer-C8LttmYX.js";import"./SquareIcon-Dy3l3VdH.js";import"./FileDirectoryOpenFillIcon-jGhuRcP3.js";import"./url-C6fJII94.js";/* empty css *//* empty css */import"./style-DdAxk_bj.js";/* empty css */import"./style-Cj1gzCjo.js";/* empty css */import"./style-rkw8dR9f.js";import"./style-GHJFdtIz.js";import"./style-ZSIOeMoX.js";import"./style-iVfD6mFL.js";import"./style-DA-Ya7rp.js";import"./style-D3tvWcFO.js";import"./style-BOqStzF9.js";import"./style-ADLQJ-E9.js";import"./style-DgglluaK.js";import"./ArrowLeftIcon-sX3iNMG1.js";import"./SkubbleIcon-CAaVh_BE.js";import"./usePrimerThemeBridge-NsTRGuo7.js";import"./index-DT7EdeIs.js";import"./KernelVariables-Cyr5X_pI.js";import"./index-C0d-d3s4.js";import"./SortAscIcon-CmH04s3F.js";import"./SortDescIcon-Qif6E10I.js";import"./NotebookToolbar-CO_qaXBp.js";import"./RepoPushIcon-BtXQRhLa.js";import"./Toolbar-ByUGXe7J.js";import"./sessions-C-AH_Lec.js";import"./tokens-CTXFWLvM.js";import"./drivecontents-BsC6Y2Vl.js";import"./kernel-BmfZmtIo.js";function Lo(r){const n=s=>{const a=Math.max(s*3.6,.1),l=a*Math.PI/180,p=Math.sin(l)*104,i=Math.cos(l)*-104;return"M 0 0 v -104 A 104 104 1 "+(a<180?1:0)+" 0 "+p.toFixed(4)+" "+i.toFixed(4)+" z"};return M.createElement("div",{className:"jp-Statusbar-ProgressCircle",role:"progressbar","aria-label":r.label||"Unlabelled progress circle","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":r.progress,onClick:r.onClick},M.createElement("svg",{viewBox:"0 0 250 250"},M.createElement("circle",{cx:"125",cy:"125",r:"104",stroke:"var(--jp-inverse-layout-color3)",strokeWidth:"20",fill:"none"}),M.createElement("path",{className:"jp-Statusbar-ProgressCirclePath",transform:"translate(125,125) scale(.9)",d:n(r.progress),fill:"var(--jp-inverse-layout-color3)"})))}const Wo="jp-JSONEditor",ue="jp-mod-error",Ho="jp-JSONEditor-host",Fo="jp-JSONEditor-header";class Ko extends ee{constructor(e){super(),this._dataDirty=!1,this._inputDirty=!1,this._source=null,this._originalValue=ie.emptyObject,this._changeGuard=!1,this.translator=e.translator||R,this._trans=this.translator.load("jupyterlab"),this.addClass(Wo),this.headerNode=document.createElement("div"),this.headerNode.className=Fo,this.revertButtonNode=mt.element({tag:"span",title:this._trans.__("Revert changes to data")}),this.commitButtonNode=Ct.element({tag:"span",title:this._trans.__("Commit changes to data"),marginLeft:"8px"}),this.editorHostNode=document.createElement("div"),this.editorHostNode.className=Ho,this.headerNode.appendChild(this.revertButtonNode),this.headerNode.appendChild(this.commitButtonNode),this.node.appendChild(this.headerNode),this.node.appendChild(this.editorHostNode);const n=new bt.Model({mimeType:"application/json"});n.sharedModel.changed.connect(this._onModelChanged,this),this.model=n,this.editor=e.editorFactory({host:this.editorHostNode,model:n,config:{readOnly:!0}})}get source(){return this._source}set source(e){this._source!==e&&(this._source&&this._source.changed.disconnect(this._onSourceChanged,this),this._source=e,this.editor.setOption("readOnly",e===null),e&&e.changed.connect(this._onSourceChanged,this),this._setValue())}get isDirty(){return this._dataDirty||this._inputDirty}dispose(){var e;this.isDisposed||((e=this.source)===null||e===void 0||e.dispose(),this.model.dispose(),this.editor.dispose(),super.dispose())}handleEvent(e){switch(e.type){case"blur":this._evtBlur(e);break;case"click":this._evtClick(e);break}}onAfterAttach(e){const n=this.editorHostNode;n.addEventListener("blur",this,!0),n.addEventListener("click",this,!0),this.revertButtonNode.hidden=!0,this.commitButtonNode.hidden=!0,this.headerNode.addEventListener("click",this)}onBeforeDetach(e){const n=this.editorHostNode;n.removeEventListener("blur",this,!0),n.removeEventListener("click",this,!0),this.headerNode.removeEventListener("click",this)}_onSourceChanged(e,n){if(!this._changeGuard){if(this._inputDirty||this.editor.hasFocus()){this._dataDirty=!0;return}this._setValue()}}_onModelChanged(e,n){if(n.sourceChange){let s=!0;try{const a=JSON.parse(this.editor.model.sharedModel.getSource());this.removeClass(ue),this._inputDirty=!this._changeGuard&&!ie.deepEqual(a,this._originalValue)}catch{this.addClass(ue),this._inputDirty=!0,s=!1}this.revertButtonNode.hidden=!this._inputDirty,this.commitButtonNode.hidden=!s||!this._inputDirty}}_evtBlur(e){!this._inputDirty&&this._dataDirty&&this._setValue()}_evtClick(e){const n=e.target;this.revertButtonNode.contains(n)?this._setValue():this.commitButtonNode.contains(n)?!this.commitButtonNode.hidden&&!this.hasClass(ue)&&(this._changeGuard=!0,this._mergeContent(),this._changeGuard=!1,this._setValue()):this.editorHostNode.contains(n)&&this.editor.focus()}_mergeContent(){const e=this.editor.model,n=this._originalValue,s=JSON.parse(e.sharedModel.getSource()),a=this.source;if(a){for(const l in s)ie.deepEqual(s[l],n[l]||null)||a.set(l,s[l]);for(const l in n)l in s||a.delete(l)}}_setValue(){this._dataDirty=!1,this._inputDirty=!1,this.revertButtonNode.hidden=!0,this.commitButtonNode.hidden=!0,this.removeClass(ue);const e=this.editor.model,n=this._source?this._source.toJSON():{};if(this._changeGuard=!0,n===void 0)e.sharedModel.setSource(this._trans.__("No data!")),this._originalValue=ie.emptyObject;else{const s=JSON.stringify(n,null,4);e.sharedModel.setSource(s),this._originalValue=n,s.length>1&&s[0]==="{"&&this.editor.setCursorPosition({line:0,column:1})}this._changeGuard=!1,this.commitButtonNode.hidden=!0,this.revertButtonNode.hidden=!0}}class Vo extends M.Component{constructor(e){super(e),this._handleChange=s=>{this.setState({value:s.currentTarget.value})},this._handleSubmit=s=>{var a,l;s.preventDefault();const p=parseInt((l=(a=this._textInput)===null||a===void 0?void 0:a.value)!==null&&l!==void 0?l:"",10);return!isNaN(p)&&isFinite(p)&&1<=p&&p<=this.props.maxCell&&this.props.handleSubmit(p),!1},this._handleFocus=()=>{this.setState({hasFocus:!0})},this._handleBlur=()=>{this.setState({hasFocus:!1})},this._textInput=null;const n=e.translator||R;this._trans=n.load("jupyterlab"),this.state={value:"",hasFocus:!1,textInputId:ft.createDomID()+"-cell-number-input"}}componentDidMount(){var e;(e=this._textInput)===null||e===void 0||e.focus()}render(){return M.createElement("div",{className:"jp-lineFormSearch"},M.createElement("form",{name:"cellNumberForm",onSubmit:this._handleSubmit,noValidate:!0},M.createElement("div",{className:vt("jp-lineFormWrapper","lm-lineForm-wrapper",this.state.hasFocus?"jp-lineFormWrapperFocusWithin":void 0)},M.createElement("input",{type:"number",id:this.state.textInputId,className:"jp-lineFormInput",min:1,max:this.props.maxCell,onChange:this._handleChange,onFocus:this._handleFocus,onBlur:this._handleBlur,value:this.state.value,ref:e=>{this._textInput=e}}),M.createElement("div",{className:"jp-baseLineForm jp-lineFormButtonContainer"},M.createElement(_t.react,{className:"jp-baseLineForm jp-lineFormButtonIcon",elementPosition:"center"}),M.createElement("input",{type:"submit",className:"jp-baseLineForm jp-lineFormButton",value:""}))),M.createElement("label",{className:"jp-lineFormCaption",htmlFor:this.state.textInputId},this._trans.__("Go to cell number between 1 and %1",this.props.maxCell))))}}function Uo(r){const n=(r.translator||R).load("jupyterlab"),s=r.selectionStart>0&&r.selectionStart!==r.selectionEnd?n.__("%1:%2/%3",r.selectionStart,r.selectionEnd,r.totalCells):n.__("Cell %1/%2",r.activeCell,r.totalCells),a=l=>{(l.key==="Enter"||l.key==="Spacebar"||l.key===" ")&&(l.preventDefault(),l.stopPropagation(),r.handleClick())};return M.createElement(De,{role:"button","aria-haspopup":!0,onClick:r.handleClick,source:s,title:n.__("Go to cell…"),tabIndex:0,onKeyDown:a})}class re extends me{constructor(e={}){super(new re.Model),this._popup=null,this.addClass("jp-mod-highlighted"),this._translator=e.translator||R}render(){return this.model===null?null:M.createElement(Uo,{activeCell:this.model.activeCell,selectionStart:this.model.selectionStart,selectionEnd:this.model.selectionEnd,totalCells:this.model.totalCells,translator:this._translator,handleClick:()=>this._handleClick()})}_handleClick(){if(this.model.totalCells<1)return;this._popup&&this._popup.dispose();const e=Te.create(M.createElement(Vo,{handleSubmit:n=>this._handleSubmit(n),maxCell:this.model.totalCells,translator:this._translator}));this._popup=Eo({body:e,anchor:this,align:"right"})}_handleSubmit(e){var n;const s=this.model.notebook;if(!s)return;const a=e-1;s.activeCellIndex=a,s.deselectAll(),s.scrollToItem(a).catch(l=>{console.error("Go to cell",l)}),(n=this._popup)===null||n===void 0||n.dispose(),s.activate()}}(function(r){class e extends Ce{constructor(){super(...arguments),this._activeCell=0,this._selectionStart=0,this._selectionEnd=0,this._totalCells=0,this._notebook=null}get notebook(){return this._notebook}set notebook(s){const a=this._notebook;a&&(a.activeCellChanged.disconnect(this._onChanged,this),a.modelContentChanged.disconnect(this._onChanged,this),a.selectionChanged.disconnect(this._onChanged,this));const l=this._getAllState();this._notebook=s,this._notebook?(this._notebook.activeCellChanged.connect(this._onChanged,this),this._notebook.modelContentChanged.connect(this._onChanged,this),this._notebook.selectionChanged.connect(this._onChanged,this),this._updateStateFromNotebook(this._notebook)):(this._activeCell=0,this._selectionStart=0,this._selectionEnd=0,this._totalCells=0),this._triggerChange(l,this._getAllState())}get activeCell(){return this._activeCell}get selectionStart(){return this._selectionStart}get selectionEnd(){return this._selectionEnd}get totalCells(){return this._totalCells}_onChanged(s){const a=this._getAllState();this._updateStateFromNotebook(s),this._triggerChange(a,this._getAllState())}_updateStateFromNotebook(s){const a=s.activeCellIndex;this._activeCell=a>=0?a+1:0,this._totalCells=s.widgets.length;let l=this._activeCell,p=this._activeCell,i=!1;s.widgets.forEach((u,d)=>{if(!s.isSelectedOrActive(u))return;const g=d+1;if(!i){l=g,p=g,i=!0;return}p=g}),this._selectionStart=i?l:0,this._selectionEnd=i?p:0}_getAllState(){return{activeCell:this._activeCell,selectionStart:this._selectionStart,selectionEnd:this._selectionEnd,totalCells:this._totalCells}}_triggerChange(s,a){(s.activeCell!==a.activeCell||s.selectionStart!==a.selectionStart||s.selectionEnd!==a.selectionEnd||s.totalCells!==a.totalCells)&&this.stateChanged.emit(void 0)}}r.Model=e})(re||(re={}));const qo="jp-Notebook-toolbarCellType",Do="jp-Notebook-toolbarCellTypeDropdown";var Ae;(function(r){function e(g,b){const f=(b||R).load("jupyterlab");function _(){if(g.context.model.readOnly)return tt({title:f.__("Cannot Save"),body:f.__("Document is read-only"),buttons:[ke.okButton()]});g.context.save().then(()=>{if(!g.isDisposed)return g.context.createCheckpoint()})}return yt(Te.create(J.createElement(xt,{signal:g.context.fileChanged},()=>J.createElement(wt,{icon:kt,onClick:_,tooltip:f.__("Save the notebook contents and create checkpoint"),enabled:!!(g&&g.context&&g.context.contentsModel&&g.context.contentsModel.writable)}))))}r.createSaveButton=e;function n(g,b){const f=(b||R).load("jupyterlab");return new Z({icon:St,onClick:()=>{v.insertBelow(g.content)},tooltip:f.__("Insert a cell below")})}r.createInsertButton=n;function s(g,b,f){const _=(b||R).load("jupyterlab");return new Z({icon:Ye,onClick:async()=>{f?.get("useSystemClipboardForCells").composite?await v.cutToSystemClipboard(g.content):v.cut(g.content)},tooltip:_.__("Cut the selected cells")})}r.createCutButton=s;function a(g,b,f){const _=(b||R).load("jupyterlab");return new Z({icon:Xe,onClick:async()=>{f?.get("useSystemClipboardForCells").composite?await v.copyToSystemClipboard(g.content):v.copy(g.content)},tooltip:_.__("Copy the selected cells")})}r.createCopyButton=a;function l(g,b,f){const _=(b||R).load("jupyterlab");return new Z({icon:Qe,onClick:async()=>{f?.get("useSystemClipboardForCells").composite?await v.pasteFromSystemClipboard(g.content):v.paste(g.content)},tooltip:_.__("Paste cells from the clipboard")})}r.createPasteButton=l;function p(g,b,f){const _=(f??R).load("jupyterlab");return new Z({icon:Ze,onClick:()=>{v.runAndAdvance(g.content,g.sessionContext,b,f)},tooltip:_.__("Run the selected cells and advance")})}r.createRunButton=p;function i(g,b,f){const _=(f??R).load("jupyterlab");return new Z({icon:et,onClick:()=>{const y=b??new Be({translator:f});y.restart(g.sessionContext).then(w=>(w&&v.runAll(g.content,g.sessionContext,y,f),w))},tooltip:_.__("Restart the kernel, then re-run the whole notebook")})}r.createRestartRunAllButton=i;function u(g,b){return new $o(g.content,b)}r.createCellTypeItem=u;function d(g,b,f,_){return[{name:"save",widget:e(g,f)},{name:"insert",widget:n(g,f)},{name:"cut",widget:s(g,f,_)},{name:"copy",widget:a(g,f,_)},{name:"paste",widget:l(g,f,_)},{name:"run",widget:p(g,b,f)},{name:"interrupt",widget:he.createInterruptButton(g.sessionContext,f)},{name:"restart",widget:he.createRestartButton(g.sessionContext,b,f)},{name:"restart-and-run",widget:i(g,b,f)},{name:"cellType",widget:u(g,f)},{name:"spacer",widget:At.createSpacerItem()},{name:"kernelName",widget:he.createKernelNameItem(g.sessionContext,b,f)}]}r.getDefaultItems=d})(Ae||(Ae={}));class $o extends Te{constructor(e,n){super(),this.handleChange=s=>{s.target.value!=="-"&&(v.changeCellType(this._notebook,s.target.value),this._notebook.activate())},this.handleKeyDown=s=>{s.key==="Enter"&&this._notebook.activate()},this._trans=(n||R).load("jupyterlab"),this.addClass(qo),this._notebook=e,e.model&&this.update(),e.activeCellChanged.connect(this.update,this),e.selectionChanged.connect(this.update,this)}render(){let e="-";this._notebook.activeCell&&(e=this._notebook.activeCell.model.type);for(const n of this._notebook.widgets)if(this._notebook.isSelectedOrActive(n)&&n.model.type!==e){e="-";break}return J.createElement(Ro,{className:Do,onChange:this.handleChange,onKeyDown:this.handleKeyDown,value:e,"aria-label":this._trans.__("Cell type"),title:this._trans.__("Select the cell type")},J.createElement("option",{value:"-"},"-"),J.createElement("option",{value:"code"},this._trans.__("Code")),J.createElement("option",{value:"markdown"},this._trans.__("Markdown")),J.createElement("option",{value:"raw"},this._trans.__("Raw")))}}function Ke(r){var e;const n=r.translator||R,s=ht(n),a=n.load("jupyterlab"),l=(e=r.displayOption.showJumpToCell)!==null&&e!==void 0?e:!1,p=r.state,i=r.displayOption.showOnToolBar,u=r.displayOption.showProgress,d=i?"down":"up",g=M.createElement("div",null),[b,f]=M.useState(!1);if(M.useEffect(()=>{if(b)return;const j=()=>{f(!0)};return v.executionScheduled.connect(j),()=>{v.executionScheduled.disconnect(j)}},[l,b]),!p)return g;const _=p.kernelStatus,y={alignSelf:"normal",height:"24px"},w=p.totalTime,S=p.scheduledCellNumber||0,o=p.scheduledCell.size||0,t=S-o;let h=100*t/S,C=u?"":"hidden";!u&&h<100&&(h=0);const k=j=>M.createElement(Lo,{progress:j,width:16,height:24,label:a.__("Kernel status")}),A=j=>a.__("Kernel status: %1",j),B=()=>{const j=r.notebook;v.selectLastRunCell(j),j.activeCell&&j.scrollToCell(j.activeCell)},E=(j,K,W)=>M.createElement("div",{className:"jp-Notebook-ExecutionIndicator",title:u?"":A(s[j]),"data-status":j},K,M.createElement("div",{className:`jp-Notebook-ExecutionIndicator-tooltip ${d} ${C}`},M.createElement("span",null," ",A(s[j])," "),W,l&&b&&M.createElement(Bt,{className:"jp-Notebook-ExecutionIndicator-jumpButton",onClick:B,title:a.__("Jump to current or last executed cell")},a.__("Jump to cell"))));if(p.kernelStatus==="connecting"||p.kernelStatus==="disconnected"||p.kernelStatus==="unknown")return E(_,M.createElement(Mt.react,{...y}),[]);if(p.kernelStatus==="starting"||p.kernelStatus==="terminating"||p.kernelStatus==="restarting"||p.kernelStatus==="initializing")return E(_,M.createElement(Tt.react,{...y}),[]);if(p.executionStatus==="busy")return E("busy",k(h),[M.createElement("span",{key:0},a.__("Executed %1/%2 cells",t,S)),M.createElement("span",{key:1},a._n("Elapsed time: %1 second","Elapsed time: %1 seconds",w))]);{const j=p.kernelStatus==="busy"?0:100,K=p.kernelStatus==="busy"||w===0?[]:[M.createElement("span",{key:0},a._n("Executed %1 cell","Executed %1 cells",S)),M.createElement("span",{key:1},a._n("Elapsed time: %1 second","Elapsed time: %1 seconds",w))];return E(p.kernelStatus,k(j),K)}}class X extends me{constructor(e,n=!0){super(new X.Model),this.translator=e||R,this.addClass("jp-mod-highlighted")}dispose(){var e;this.isDisposed||((e=this.model)===null||e===void 0||e.dispose(),super.dispose())}render(){if(this.model===null||!this.model.renderFlag)return M.createElement("div",null);{const e=this.model.currentNotebook;return e?M.createElement(Ke,{displayOption:this.model.displayOption,state:this.model.executionState(e),translator:this.translator,notebook:e}):M.createElement(Ke,{displayOption:this.model.displayOption,state:void 0,translator:this.translator,notebook:void 0})}}}(function(r){class e extends Ce{constructor(){super(),this._notebookExecutionProgress=new WeakMap,this._displayOption={showOnToolBar:!0,showProgress:!0,showJumpToCell:!1},this._renderFlag=!0}attachNotebook(l){var p,i,u,d;if(l&&l.content&&l.context){const g=l.content,b=l.context;if(this._currentNotebook=g,!this._notebookExecutionProgress.has(g)){this._notebookExecutionProgress.set(g,{executionStatus:"idle",kernelStatus:"idle",totalTime:0,interval:0,timeout:0,scheduledCell:new Set,scheduledCellNumber:0,needReset:!0});const f=this._notebookExecutionProgress.get(g),_=o=>{f&&(f.kernelStatus=o.kernelDisplayStatus),this.stateChanged.emit(void 0)};b.statusChanged.connect(_,this);const y=o=>{f&&(f.kernelStatus=o.kernelDisplayStatus),this.stateChanged.emit(void 0)};b.connectionStatusChanged.connect(y,this),b.disposed.connect(o=>{o.connectionStatusChanged.disconnect(y,this),o.statusChanged.disconnect(_,this)},this);const w=(o,t)=>{const h=t.msg,C=h.header.msg_id;if(h.header.msg_type==="execute_request")this._cellScheduledCallback(g,C);else if(Y.KernelMessage.isStatusMsg(h)&&h.content.execution_state==="idle"){const k=h.parent_header.msg_id;this._cellExecutedCallback(g,k)}else Y.KernelMessage.isStatusMsg(h)&&h.content.execution_state==="restarting"?this._restartHandler(g):h.header.msg_type==="execute_input"&&this._startTimer(g)};(i=(p=b.session)===null||p===void 0?void 0:p.kernel)===null||i===void 0||i.anyMessage.connect(w,this),(d=(u=b.session)===null||u===void 0?void 0:u.kernel)===null||d===void 0||d.disposed.connect(o=>o.anyMessage.disconnect(w,this),this);const S=(o,t)=>{f&&(this._resetTime(f),this.stateChanged.emit(void 0),t.newValue&&t.newValue.anyMessage.connect(w,this))};b.kernelChanged.connect(S,this),b.disposed.connect(o=>o.kernelChanged.disconnect(S,this),this)}}}get currentNotebook(){return this._currentNotebook}get displayOption(){return this._displayOption}set displayOption(l){this._displayOption=l}executionState(l){return this._notebookExecutionProgress.get(l)}_scheduleSwitchToIdle(l){window.setTimeout(()=>{l.executionStatus="idle",clearInterval(l.interval),this.stateChanged.emit(void 0)},150),l.timeout=window.setTimeout(()=>{l.needReset=!0},1e3)}_cellExecutedCallback(l,p){const i=this._notebookExecutionProgress.get(l);i&&i.scheduledCell.has(p)&&(i.scheduledCell.delete(p),i.scheduledCell.size===0&&this._scheduleSwitchToIdle(i))}_restartHandler(l){const p=this._notebookExecutionProgress.get(l);p&&(p.scheduledCell.clear(),this._scheduleSwitchToIdle(p))}_startTimer(l){const p=this._notebookExecutionProgress.get(l);p&&(p.scheduledCell.size>0?p.executionStatus!=="busy"&&(p.executionStatus="busy",clearTimeout(p.timeout),this.stateChanged.emit(void 0),p.interval=window.setInterval(()=>{this._tick(p)},1e3)):this._resetTime(p))}_cellScheduledCallback(l,p){const i=this._notebookExecutionProgress.get(l);i&&!i.scheduledCell.has(p)&&(i.needReset&&this._resetTime(i),i.scheduledCell.add(p),i.scheduledCellNumber+=1)}_tick(l){if(this.isDisposed){clearInterval(l.interval),clearTimeout(l.timeout);return}l.totalTime+=1,this.stateChanged.emit(void 0)}_resetTime(l){l.totalTime=0,l.scheduledCellNumber=0,l.executionStatus="idle",l.scheduledCell=new Set,clearTimeout(l.timeout),clearInterval(l.interval),l.needReset=!1}get renderFlag(){return this._renderFlag}updateRenderOption(l){this.displayOption.showOnToolBar&&(l.showOnToolBar?this._renderFlag=!0:this._renderFlag=!1),this.displayOption.showProgress=l.showProgress,this.displayOption.showJumpToCell=l.showJumpToCell,this.stateChanged.emit(void 0)}}r.Model=e;function n(a,l,p){const i=new r(l);return i.model.displayOption={showOnToolBar:!0,showProgress:!0,showJumpToCell:!1},i.model.attachNotebook({content:a.content,context:a.sessionContext}),p&&p.then(u=>{const d=g=>{const b=s(g);b.showJumpToCell&&(g.get("recordTiming").composite||g.set("recordTiming",!0).catch(_=>{console.error("Failed to auto-enable recordTiming:",_.message)})),i.model.updateRenderOption(b)};u.changed.connect(d),d(u),i.disposed.connect(()=>{u.changed.disconnect(d)})}).catch(u=>{console.error(u.message)}),i}r.createExecutionIndicatorItem=n;function s(a){let l=!0,p=!0,i=!1;const u=a.get("kernelStatus").composite;return u&&(l=!u.showOnStatusBar,p=u.showProgress,i=u.showJumpToRecentExecutionButton),{showOnToolBar:l,showProgress:p,showJumpToCell:i}}r.getSettingValue=s})(X||(X={}));function Jo(r){const e=(r.translator||R).load("jupyterlab");return J.createElement(De,{source:e.__("Mode: %1",r.modeNames[r.notebookMode])})}class ae extends me{constructor(e){super(new ae.Model),this.translator=e||R,this._trans=this.translator.load("jupyterlab"),this._modeNames={command:this._trans.__("Command"),edit:this._trans.__("Edit")}}render(){return this.model?(this.node.title=this._trans.__("Notebook is in %1 mode",this._modeNames[this.model.notebookMode]),J.createElement(Jo,{notebookMode:this.model.notebookMode,translator:this.translator,modeNames:this._modeNames})):null}}(function(r){class e extends Ce{constructor(){super(...arguments),this._onChanged=s=>{const a=this._notebookMode;this._notebook?this._notebookMode=s.mode:this._notebookMode="command",this._triggerChange(a,this._notebookMode)},this._notebookMode="command",this._notebook=null}get notebookMode(){return this._notebookMode}set notebook(s){const a=this._notebook;a!==null&&(a.stateChanged.disconnect(this._onChanged,this),a.activeCellChanged.disconnect(this._onChanged,this),a.modelContentChanged.disconnect(this._onChanged,this));const l=this._notebookMode;this._notebook=s,this._notebook===null?this._notebookMode="command":(this._notebookMode=this._notebook.mode,this._notebook.stateChanged.connect(this._onChanged,this),this._notebook.activeCellChanged.connect(this._onChanged,this),this._notebook.modelContentChanged.connect(this._onChanged,this)),this._triggerChange(l,this._notebookMode)}_triggerChange(s,a){s!==a&&this.stateChanged.emit(void 0)}}r.Model=e})(ae||(ae={}));class zo extends ko{constructor(e,n){super(e,n),this.editorWidget=e,this.options=n,this._type="code",this._readyDelegate=new Et,this._editorToCell=new Map,this.editor=e.content,this._cellToEditor=new WeakMap,this.isReady=this.isReady.bind(this),Promise.all([this.widget.context.sessionContext.ready,this.connectionManager.ready]).then(async()=>{await this.initOnceReady(),this._readyDelegate.resolve()}).catch(console.error)}get documentPath(){return this.widget.context.path}get mimeType(){var e;let n,s=this.language_info();return!s||!s.mimetype?n=this.widget.content.codeMimetype:n=s.mimetype,Array.isArray(n)?(e=n[0])!==null&&e!==void 0?e:Nt.defaultMimeType:n}get languageFileExtension(){let e=this.language_info();if(!(!e||!e.file_extension))return e.file_extension.replace(".","")}get wrapperElement(){return this.widget.node}get editors(){if(this.isDisposed)return[];let e=this.widget.content;return this._editorToCell.clear(),e.isDisposed?[]:e.widgets.map(n=>({ceEditor:this._getCellEditor(n),type:n.model.type,value:n.model.sharedModel.getSource()}))}get activeEditor(){return this.editor.activeCell?this._getCellEditor(this.editor.activeCell):void 0}get ready(){return this._readyDelegate.promise}getEditorIndexAt(e){let n=this._getCellAt(e);return this.widget.content.widgets.findIndex(a=>n===a)}getEditorIndex(e){let n=this._editorToCell.get(e);return this.editor.widgets.findIndex(s=>n===s)}getEditorWrapper(e){return this._editorToCell.get(e).node}async onKernelChanged(e,n){if(n.newValue)try{const s=this._languageInfo;await He(this.isReady,-1),await this._updateLanguageInfo();const a=this._languageInfo;s?.name!=a.name||s?.mimetype!=a?.mimetype||s?.file_extension!=a?.file_extension?(console.log(`Changed to ${this._languageInfo.name} kernel, reconnecting`),this.reloadConnection()):console.log("Keeping old LSP connection as the new kernel uses the same language")}catch(s){console.warn(s),this.reloadConnection()}}dispose(){this.isDisposed||(this.widget.context.sessionContext.kernelChanged.disconnect(this.onKernelChanged,this),this.widget.content.activeCellChanged.disconnect(this._activeCellChanged,this),super.dispose(),this._editorToCell.clear(),Ot.clearData(this))}isReady(){var e;return!this.widget.isDisposed&&this.widget.context.isReady&&this.widget.content.isVisible&&this.widget.content.widgets.length>0&&((e=this.widget.context.sessionContext.session)===null||e===void 0?void 0:e.kernel)!=null}async handleCellChange(e,n){let s=[],a=[];const l=this._type;if(n.type==="set"){let p=[],i=[];if(n.newValues.length===n.oldValues.length){for(let u=0;u<n.newValues.length;u++)n.oldValues[u].type===l&&n.newValues[u].type!==l?p.push(n.newValues[u]):n.oldValues[u].type!==l&&n.newValues[u].type===l&&i.push(n.newValues[u]);s=i,a=p}}else n.type=="add"&&(s=n.newValues.filter(p=>p.type===l));(a.length||s.length||n.type==="set"||n.type==="move"||n.type==="remove"||n.type==="clear")&&await this.updateDocuments();for(let p of s){let i=this.widget.content.widgets.find(u=>u.model.id===p.id);if(!i){console.warn(`Widget for added cell with ID: ${p.id} not found!`);continue}this._getCellEditor(i)}}createVirtualDocument(){return new So({language:this.language,foreignCodeExtractors:this.options.foreignCodeExtractorsManager,path:this.documentPath,fileExtension:this.languageFileExtension,standalone:!1,hasLspSupportedFile:!1})}language_info(){return this._languageInfo}async initOnceReady(){await He(this.isReady.bind(this),-1),await this._updateLanguageInfo(),this.initVirtual(),this.connectDocument(this.virtualDocument,!1).catch(console.warn),this.widget.context.sessionContext.kernelChanged.connect(this.onKernelChanged,this),this.widget.content.activeCellChanged.connect(this._activeCellChanged,this),this._connectModelSignals(this.widget),this.editor.modelChanged.connect(e=>{console.warn("Model changed, connecting cell change handler; this is not something we were expecting"),this._connectModelSignals(e)})}_connectModelSignals(e){e.model===null?console.warn(`Model is missing for notebook ${e}, cannot connect cell changed signal!`):e.model.cells.changed.connect(this.handleCellChange,this)}async _updateLanguageInfo(){var e,n,s,a;const l=(a=await((s=(n=(e=this.widget.context.sessionContext)===null||e===void 0?void 0:e.session)===null||n===void 0?void 0:n.kernel)===null||s===void 0?void 0:s.info))===null||a===void 0?void 0:a.language_info;if(l)this._languageInfo=l;else throw new Error("Language info update failed (no session, kernel, or info available)")}_activeCellChanged(e,n){!n||n.model.type!==this._type||this._activeEditorChanged.emit({editor:this._getCellEditor(n)})}_getCellAt(e){let n=this.virtualDocument.getEditorAtVirtualLine(e);return this._editorToCell.get(n)}_getCellEditor(e){if(!this._cellToEditor.has(e)){const n=Object.freeze({getEditor:()=>e.editor,ready:async()=>(await e.ready,e.editor),reveal:async()=>(await this.editor.scrollToCell(e),e.editor)});this._cellToEditor.set(e,n),this._editorToCell.set(n,e),e.disposed.connect(()=>{this._cellToEditor.delete(e),this._editorToCell.delete(n),this._editorRemoved.emit({editor:n})}),this._editorAdded.emit({editor:n})}return this._cellToEditor.get(e)}}class Go extends ee{constructor(){super(),this._items=[],this.layout=new be,this.addClass("jp-RankedPanel")}addWidget(e,n){const s={widget:e,rank:n},a=le.upperBound(this._items,s,Me.itemCmp);le.insert(this._items,a,s),this.layout.insertWidget(a,e)}onChildRemoved(e){const n=le.findFirstIndex(this._items,s=>s.widget===e.child);n!==-1&&le.removeAt(this._items,n)}}class q extends ee{constructor(e){super(),this.addClass("jp-NotebookTools"),this.translator=e.translator||R,this._tools=[],this.layout=new be,this._tracker=e.tracker,this._tracker.currentChanged.connect(this._onActiveNotebookPanelChanged,this),this._tracker.activeCellChanged.connect(this._onActiveCellChanged,this),this._tracker.selectionChanged.connect(this._onSelectionChanged,this),this._onActiveNotebookPanelChanged(),this._onActiveCellChanged(),this._onSelectionChanged()}get activeCell(){return this._tracker.activeCell}get selectedCells(){const e=this._tracker.currentWidget;if(!e)return[];const n=e.content;return n.widgets.filter(s=>n.isSelectedOrActive(s))}get activeNotebookPanel(){return this._tracker.currentWidget}addItem(e){var n;const s=e.tool,a=(n=e.rank)!==null&&n!==void 0?n:100;let l;const p=this._tools.find(i=>i.section===e.section);if(p)l=p.panel;else throw new Error(`The section ${e.section} does not exist`);s.addClass("jp-NotebookTools-tool"),l.addWidget(s,a),s.notebookTools=this,G.sendMessage(s,q.ActiveNotebookPanelMessage),G.sendMessage(s,q.ActiveCellMessage)}addSection(e){var n;const s=e.sectionName,a=e.label||e.sectionName,l=e.tool;let p=(n=e.rank)!==null&&n!==void 0?n:null;const i=new Go;if(i.title.label=a,l&&i.addWidget(l,0),this._tools.push({section:s,panel:i,rank:p}),p!=null)this.layout.insertWidget(p,new ce({widget:i}));else{let u=null;const d=this.layout;for(let g=0;g<d.widgets.length;g++){let b=d.widgets[g];if(b instanceof ce&&b.widget.id==="advancedToolsSection"){u=g;break}}u!==null?this.layout.insertWidget(u,new ce({widget:i})):this.layout.addWidget(new ce({widget:i}))}}_onActiveNotebookPanelChanged(){this._prevActiveNotebookModel&&!this._prevActiveNotebookModel.isDisposed&&this._prevActiveNotebookModel.metadataChanged.disconnect(this._onActiveNotebookPanelMetadataChanged,this);const e=this.activeNotebookPanel&&this.activeNotebookPanel.content?this.activeNotebookPanel.content.model:null;this._prevActiveNotebookModel=e,e&&e.metadataChanged.connect(this._onActiveNotebookPanelMetadataChanged,this);for(const n of this._toolChildren())G.sendMessage(n,q.ActiveNotebookPanelMessage)}_onActiveCellChanged(){this._prevActiveCell&&!this._prevActiveCell.isDisposed&&this._prevActiveCell.metadataChanged.disconnect(this._onActiveCellMetadataChanged,this);const e=this.activeCell?this.activeCell.model:null;this._prevActiveCell=e,e&&e.metadataChanged.connect(this._onActiveCellMetadataChanged,this);for(const n of this._toolChildren())G.sendMessage(n,q.ActiveCellMessage)}_onSelectionChanged(){for(const e of this._toolChildren())G.sendMessage(e,q.SelectionMessage)}_onActiveNotebookPanelMetadataChanged(e,n){const s=new ge.ChangeMessage("activenotebookpanel-metadata-changed",{oldValue:void 0,newValue:void 0,...n});for(const a of this._toolChildren())G.sendMessage(a,s)}_onActiveCellMetadataChanged(e,n){const s=new ge.ChangeMessage("activecell-metadata-changed",{newValue:void 0,oldValue:void 0,...n});for(const a of this._toolChildren())G.sendMessage(a,s)}*_toolChildren(){for(let e of this._tools)yield*e.panel.children()}}(function(r){r.ActiveNotebookPanelMessage=new xe("activenotebookpanel-changed"),r.ActiveCellMessage=new xe("activecell-changed"),r.SelectionMessage=new xe("selection-changed");class e extends ee{dispose(){super.dispose(),this.notebookTools&&(this.notebookTools=null)}processMessage(a){switch(super.processMessage(a),a.type){case"activenotebookpanel-changed":this.onActiveNotebookPanelChanged(a);break;case"activecell-changed":this.onActiveCellChanged(a);break;case"selection-changed":this.onSelectionChanged(a);break;case"activecell-metadata-changed":this.onActiveCellMetadataChanged(a);break;case"activenotebookpanel-metadata-changed":this.onActiveNotebookPanelMetadataChanged(a);break}}onActiveNotebookPanelChanged(a){}onActiveCellChanged(a){}onSelectionChanged(a){}onActiveCellMetadataChanged(a){}onActiveNotebookPanelMetadataChanged(a){}}r.Tool=e;class n extends e{constructor(a){super();const{editorFactory:l}=a;this.addClass("jp-MetadataEditorTool");const p=this.layout=new be;this._editorFactory=l,this._editorLabel=a.label||"Edit Metadata",this.createEditor();const i=new ee({node:document.createElement("label")});i.node.textContent=a.label||"Edit Metadata",p.addWidget(i),p.addWidget(this.editor)}get editor(){return this._editor}onActiveNotebookPanelChanged(a){this.editor.dispose(),this.notebookTools.activeNotebookPanel&&this.createEditor()}createEditor(){this._editor=new Ko({editorFactory:this._editorFactory}),this.editor.title.label=this._editorLabel,this.layout.addWidget(this.editor)}}r.MetadataEditorTool=n})(q||(q={}));var Me;(function(r){function e(n,s){return n.rank-s.rank}r.itemCmp=e})(Me||(Me={}));const Yo=6;var V;(function(r){r[r.Idle=-1]="Idle",r[r.Error=-.5]="Error",r[r.Scheduled=0]="Scheduled",r[r.Running=1]="Running"})(V||(V={}));class Xo extends Po{constructor(e,n,s,a){super(e,a),this.parser=n,this.sanitizer=s,this.configMetadataMap={numberHeaders:["toc-autonumbering","toc/number_sections"],numberingH1:["!toc/skip_h1_title"],baseNumbering:["toc/base_numbering"]},this._runningCells=new Array,this._errorCells=new Array,this._cellToHeadingIndex=new WeakMap,e.context.ready.then(()=>{this.setConfiguration({})}),this.widget.context.model.metadataChanged.connect(this.onMetadataChanged,this),this.widget.content.activeCellChanged.connect(this.onActiveCellChanged,this),v.executionScheduled.connect(this.onExecutionScheduled,this),v.executed.connect(this.onExecuted,this),v.outputCleared.connect(this.onOutputCleared,this),this.headingsChanged.connect(this.onHeadingsChanged,this)}get documentType(){return"notebook"}get isAlwaysActive(){return!0}get supportedOptions(){return["baseNumbering","maximalDepth","numberingH1","numberHeaders","includeOutput","syncCollapseState"]}getCellHeadings(e){const n=new Array;let s=this._cellToHeadingIndex.get(e);if(s!==void 0){const a=this.headings[s];for(n.push(a);this.headings[s-1]&&this.headings[s-1].cellRef===a.cellRef;)s--,n.unshift(this.headings[s])}return n}dispose(){var e,n,s;this.isDisposed||(this.headingsChanged.disconnect(this.onHeadingsChanged,this),(n=(e=this.widget.context)===null||e===void 0?void 0:e.model)===null||n===void 0||n.metadataChanged.disconnect(this.onMetadataChanged,this),(s=this.widget.content)===null||s===void 0||s.activeCellChanged.disconnect(this.onActiveCellChanged,this),v.executionScheduled.disconnect(this.onExecutionScheduled,this),v.executed.disconnect(this.onExecuted,this),v.outputCleared.disconnect(this.onOutputCleared,this),this._runningCells.length=0,this._errorCells.length=0,super.dispose())}setConfiguration(e){const n=this.loadConfigurationFromMetadata();super.setConfiguration({...this.configuration,...n,...e})}toggleCollapse(e){super.toggleCollapse(e),this.updateRunningStatus(this.headings)}async getHeadings(){const e=this.widget.content.widgets,n=new Set(e),s=[],a=new Array,l=new WeakMap;for(let p=0;p<e.length;p++){const i=e[p];switch(i.model.type){case"code":{!this.configuration.syncCollapseState&&this.configuration.includeOutput&&s.push(...Le(await i.getHeadings(),this.configuration,a).map(d=>({...d,cellRef:i,collapsed:!1,isRunning:V.Idle})));break}case"markdown":{const d=Le(await i.getHeadings(),this.configuration,a).map((g,b)=>({...g,cellRef:i,collapsed:!1,isRunning:V.Idle}));if(this.configuration.syncCollapseState&&i.headingCollapsed){const g=Math.min(...d.map(f=>f.level)),b=d.find(f=>f.level===g);b.collapsed=i.headingCollapsed}s.push(...d);break}}s.length>0&&l.set(i,s.length-1)}return this._cellToHeadingIndex=l,this._runningCells=this._runningCells.filter(p=>n.has(p)),this._errorCells=this._errorCells.filter(p=>n.has(p)),this.updateRunningStatus(s),Promise.resolve(s)}isHeadingEqual(e,n){return super.isHeadingEqual(e,n)&&e.cellRef===n.cellRef&&e.isRunning===n.isRunning}loadConfigurationFromMetadata(){const e=this.widget.content.model,n={};if(e)for(const s in this.configMetadataMap){const a=this.configMetadataMap[s];for(const l of a){let p=l;const i=p[0]==="!";i&&(p=p.slice(1));const u=p.split("/");let d=e.getMetadata(u[0]);for(let g=1;g<u.length;g++)d=(d??{})[u[g]];d!==void 0&&(typeof d=="boolean"&&i&&(d=!d),n[s]=d)}}return n}onActiveCellChanged(e,n){const s=this.getCellHeadings(n)[0];this.setActiveHeading(s??null,!1)}onHeadingsChanged(){this.widget.content.activeCell&&this.onActiveCellChanged(this.widget.content,this.widget.content.activeCell)}onExecuted(e,n){this._runningCells.forEach((s,a)=>{var l;if(s===n.cell){this._runningCells.splice(a,1);const p=this._cellToHeadingIndex.get(s);if(p!==void 0){const i=this.headings[p];if(n.success||((l=n.error)===null||l===void 0?void 0:l.errorName)===void 0){i.isRunning=V.Idle;return}i.isRunning=V.Error,this._errorCells.includes(s)||this._errorCells.push(s)}}}),this.updateRunningStatus(this.headings),this.stateChanged.emit()}onExecutionScheduled(e,n){this._runningCells.includes(n.cell)||this._runningCells.push(n.cell),this._errorCells.forEach((s,a)=>{s===n.cell&&this._errorCells.splice(a,1)}),this.updateRunningStatus(this.headings),this.stateChanged.emit()}onOutputCleared(e,n){this._errorCells.forEach((s,a)=>{if(s===n.cell){this._errorCells.splice(a,1);const l=this._cellToHeadingIndex.get(s);if(l!==void 0){const p=this.headings[l];p.isRunning=V.Idle}}}),this.updateRunningStatus(this.headings),this.stateChanged.emit()}onMetadataChanged(){this.setConfiguration({})}updateRunningStatus(e){e.forEach(a=>{a.isRunning=V.Idle}),this._runningCells.forEach((a,l)=>{const p=this._cellToHeadingIndex.get(a);if(p!==void 0){const i=e[p];i.isRunning!==V.Running&&(i.isRunning=l>0?V.Scheduled:V.Running)}}),this._errorCells.forEach((a,l)=>{const p=this._cellToHeadingIndex.get(a);if(p!==void 0){const i=e[p];i.isRunning===V.Idle&&(i.isRunning=V.Error)}});let n=0;for(;n<e.length;){const a=e[n];if(n++,a.collapsed){const l=Math.max(a.isRunning,s(e,a.level));a.dataset={...a.dataset,"data-running":l.toString()}}else a.dataset={...a.dataset,"data-running":a.isRunning.toString()}}function s(a,l){let p=V.Idle;for(;n<a.length;){const i=a[n];if(i.dataset={...i.dataset,"data-running":i.isRunning.toString()},i.level>l)n++,p=Math.max(i.isRunning,p),i.collapsed&&(p=Math.max(p,s(a,i.level)),i.dataset={...i.dataset,"data-running":p.toString()});else break}return p}}}class Qo extends Io{constructor(e,n,s,a){super(e),this.parser=n,this.sanitizer=s,this.commands=a,this._scrollToTop=!0}get scrollToTop(){return this._scrollToTop}set scrollToTop(e){this._scrollToTop=e}_createNew(e,n){const s=new Xo(e,this.parser,this.sanitizer,n);let a=new WeakMap;const l=(_,y)=>{if(y){const w=async h=>{if(!h.inViewport)return;let C=a.get(y);if((!C||!y.cellRef.node.contains(C))&&(await i(h),C=a.get(y)),C)if(this.scrollToTop)C.scrollIntoView({block:"start"}),e.content.outerNode.scrollTop-=Yo;else{const k=e.content.node.getBoundingClientRect(),A=C.getBoundingClientRect();(A.top>k.bottom||A.bottom<k.top)&&C.scrollIntoView({block:"center"})}else console.debug("scrolling to heading: using fallback strategy"),await e.content.scrollToItem(e.content.activeCellIndex,this.scrollToTop?"start":void 0,0)},S=y.cellRef,t=e.content.widgets.indexOf(S);S.model.type=="markdown"&&e.content.mode!="command"&&(e.content.mode="command"),e.content.activeCellIndex=t,S.inViewport?w(S).catch(h=>{console.error(`Fail to scroll to cell to display the required heading (${h}).`)}):e.content.scrollToItem(t,this.scrollToTop?"start":void 0).then(()=>i(S)).then(()=>w(S)).catch(h=>{console.error(`Fail to scroll to cell to display the required heading (${h}).`)})}},p=_=>s.getCellHeadings(_).filter(y=>y.cellRef===_),i=async _=>{var y;const w=p(_),S=(y=this.sanitizer.allowNamedProperties)!==null&&y!==void 0&&y?"id":"data-jupyter-id",o=await Promise.all(w.map(async h=>{const C=await Zo(h,this.parser,this.sanitizer);return C?`h${h.level}[${S}="${CSS.escape(C)}"]`:`h${h.level}`})),t=p(_);t.length!==w.length||t.some((h,C)=>h!==w[C])||(we(_.node),w.forEach((h,C)=>{var k,A;const B=h.outputIndex===void 0?h.cellRef.node:(k=h.cellRef.outputArea.widgets[h.outputIndex])===null||k===void 0?void 0:k.node;a.set(h,B?It(B,o[C],(A=h.prefix)!==null&&A!==void 0?A:""):null)}))},u=_=>{if(this.parser){we(e.content.node),a=new WeakMap;for(const y of e.content.widgets)y instanceof Q&&y.renderedChanged.connect(f);return Promise.all(e.content.widgets.map(y=>i(y)))}},d=(_,y)=>{var w,S,o,t;if(s.configuration.syncCollapseState)if(y!==null){const h=y.cellRef;h.headingCollapsed!==((w=y.collapsed)!==null&&w!==void 0?w:!1)&&(h.headingCollapsed=(S=y.collapsed)!==null&&S!==void 0?S:!1)}else{const h=(t=(o=s.headings[0])===null||o===void 0?void 0:o.collapsed)!==null&&t!==void 0?t:!1;e.content.widgets.forEach(C=>{C instanceof Q&&C.headingInfo.level>=0&&(C.headingCollapsed=h)})}},g=(_,y)=>{if(s.configuration.syncCollapseState){const w=s.getCellHeadings(y)[0];w&&s.toggleCollapse({heading:w,collapsed:y.headingCollapsed})}},b=(_,y)=>{var w;y.inViewport?(w=i(y))===null||w===void 0||w.catch(console.warn):we(y.node)},f=(_,y)=>{y&&i(_).catch(console.warn)};return e.context.ready.then(()=>{var _;(_=u())===null||_===void 0||_.catch(console.warn),s.activeHeadingChanged.connect(l),s.headingsChanged.connect(u),s.collapseChanged.connect(d),e.content.cellCollapsed.connect(g),e.content.cellInViewportChanged.connect(b),e.disposed.connect(()=>{s.activeHeadingChanged.disconnect(l),s.headingsChanged.disconnect(u),s.collapseChanged.disconnect(d),e.content.cellCollapsed.disconnect(g),e.content.cellInViewportChanged.disconnect(b);for(const y of e.content.widgets)y instanceof Q&&y.renderedChanged.disconnect(f)})}),s}getToolbarItems(e){return this.commands?[{name:"select-last-modified-back",widget:new Pe({commands:this.commands,id:"notebook:select-last-modified-cell",args:{toolbar:!0},icon:jt,label:""})},{name:"select-last-modified-forward",widget:new Pe({commands:this.commands,id:"notebook:select-next-modified-cell",args:{toolbar:!0},icon:Rt,label:""})}]:[]}}async function Zo(r,e,n){let s=null;return r.type===We.HeadingType.Markdown?s=await Pt(e,r.raw,r.level,n):r.type===We.HeadingType.HTML&&(s=r.id),s}const en="jp-StatusItem-trust";function tn(r,e){e=e||R;const n=e.load("jupyterlab");return r.trustedCells===r.totalCells?n.__("Notebook trusted: %1 of %2 code cells trusted.",r.trustedCells,r.totalCells):r.activeCellTrusted?n.__("Active cell trusted: %1 of %2 code cells trusted.",r.trustedCells,r.totalCells):n.__("Notebook not trusted: %1 of %2 code cells trusted.",r.trustedCells,r.totalCells)}function on(r){return r.allCellsTrusted?M.createElement(Lt.react,{top:"2px",stylesheet:"statusBar"}):M.createElement(Wt.react,{top:"2px",stylesheet:"statusBar"})}class de extends me{constructor(e){super(new de.Model),this.translator=e||R,this.node.classList.add(en)}render(){if(!this.model)return null;const e=tn(this.model,this.translator);return e!==this.node.title&&(this.node.title=e),M.createElement(on,{allCellsTrusted:this.model.trustedCells===this.model.totalCells,activeCellTrusted:this.model.activeCellTrusted,totalCells:this.model.totalCells,trustedCells:this.model.trustedCells})}}(function(r){class e extends Ce{constructor(){super(...arguments),this._trustedCells=0,this._totalCells=0,this._activeCellTrusted=!1,this._notebook=null}get trustedCells(){return this._trustedCells}get totalCells(){return this._totalCells}get activeCellTrusted(){return this._activeCellTrusted}get notebook(){return this._notebook}set notebook(s){const a=this._notebook;a!==null&&(a.activeCellChanged.disconnect(this._onActiveCellChanged,this),a.modelContentChanged.disconnect(this._onModelChanged,this));const l=this._getAllState();if(this._notebook=s,this._notebook===null)this._trustedCells=0,this._totalCells=0,this._activeCellTrusted=!1;else{this._notebook.activeCellChanged.connect(this._onActiveCellChanged,this),this._notebook.modelContentChanged.connect(this._onModelChanged,this),this._notebook.activeCell?this._activeCellTrusted=this._notebook.activeCell.model.trusted:this._activeCellTrusted=!1;const{total:p,trusted:i}=this._deriveCellTrustState(this._notebook.model);this._totalCells=p,this._trustedCells=i}this._triggerChange(l,this._getAllState())}_onModelChanged(s){const a=this._getAllState(),{total:l,trusted:p}=this._deriveCellTrustState(s.model);this._totalCells=l,this._trustedCells=p,this._triggerChange(a,this._getAllState())}_onActiveCellChanged(s,a){const l=this._getAllState();a?this._activeCellTrusted=a.model.trusted:this._activeCellTrusted=!1,this._triggerChange(l,this._getAllState())}_deriveCellTrustState(s){if(s===null)return{total:0,trusted:0};let a=0,l=0;for(const p of s.cells)p.type==="code"&&(a++,p.trusted&&l++);return{total:a,trusted:l}}_getAllState(){return[this._trustedCells,this._totalCells,this.activeCellTrusted]}_triggerChange(s,a){(s[0]!==a[0]||s[1]!==a[1]||s[2]!==a[2])&&this.stateChanged.emit(void 0)}}r.Model=e})(de||(de={}));const nn=new ot("@jupyterlab/metadataform:IMetadataFormProvider","A service to register new metadata editor widgets."),ln={id:"@jupyterlab/notebook-extension:cell-executor",description:"Provides the notebook cell executor.",autoStart:!0,provides:lt,activate:()=>Object.freeze({runCell:Ht})},sn=new ot("@jupyterlab/logconsole:ILoggerRegistry","A service providing a logger infrastructure."),rn={activate:an,id:"@jupyterlab/notebook-extension:log-output",description:"Adds cell outputs log to the application logger.",requires:[L],optional:[sn],autoStart:!0};function an(r,e,n){if(!n)return;function s(a){function l(p,i,u){if(Y.KernelMessage.isDisplayDataMsg(p)||Y.KernelMessage.isStreamMsg(p)||Y.KernelMessage.isErrorMsg(p)||Y.KernelMessage.isExecuteResultMsg(p)){const d=n.getLogger(a.context.path);d.rendermime=a.content.rendermime;const g={...p.content,output_type:p.header.msg_type};let b=i;(Y.KernelMessage.isErrorMsg(p)||Y.KernelMessage.isStreamMsg(p)&&p.content.name==="stderr")&&(b=u),d.log({type:"output",data:g,level:b})}}a.context.sessionContext.iopubMessage.connect((p,i)=>l(i,"info","info"),a),a.context.sessionContext.unhandledMessage.connect((p,i)=>l(i,"warning","error"),a)}e.forEach(a=>s(a)),e.widgetAdded.connect((a,l)=>s(l))}const dn="jp-ActiveCellTool",cn="jp-ActiveCellTool-Content",un="jp-ActiveCellTool-CellContent";class hn extends q.Tool{constructor(e){super(),this._cellModel=null,this._updateId=0,this._pendingUpdate=!1,this._promptOutdated=!1,this._tracker=e.tracker,this._languages=e.languages,this.addClass(dn),this.layout=new be,this._inputPrompt=new Ft,this.layout.addWidget(this._inputPrompt);const n=document.createElement("div");n.classList.add(cn);const s=n.appendChild(document.createElement("div")),a=s.appendChild(document.createElement("pre"));s.className=un,this._editorEl=a,this.layout.addWidget(new ee({node:n})),this._previewDebouncer=new Kt(()=>this._update(),150),this._tracker.activeCellChanged.connect(this._onActiveCellChanged,this),this._tracker.currentChanged.connect(this._onActiveCellChanged,this),this._onActiveCellChanged()}dispose(){this.isDisposed||(this._tracker.activeCellChanged.disconnect(this._onActiveCellChanged,this),this._tracker.currentChanged.disconnect(this._onActiveCellChanged,this),this._disconnectCellModel(),this._previewDebouncer.dispose(),super.dispose())}render(e){return M.createElement("div",{ref:n=>{!n||this.node.parentElement===n||(n.appendChild(this.node),this._pendingUpdate&&this._update().catch(console.warn))}})}_onActiveCellChanged(){var e,n;const s=(n=(e=this._tracker.activeCell)===null||e===void 0?void 0:e.model)!==null&&n!==void 0?n:null;s!==this._cellModel&&(this._disconnectCellModel(),this._cellModel=s,s&&(s.sharedModel.changed.connect(this._onCellContentChanged,this),s.mimeTypeChanged.connect(this._onCellContentChanged,this)),this._promptOutdated=!0,this._update().catch(console.warn))}_onCellContentChanged(){if(!this.node.isConnected){this._pendingUpdate=!0,this._promptOutdated=!0;return}this._promptOutdated||this._updatePrompt(),this._previewDebouncer.invoke().catch(console.warn)}_disconnectCellModel(){const e=this._cellModel;e&&(e.sharedModel.changed.disconnect(this._onCellContentChanged,this),e.mimeTypeChanged.disconnect(this._onCellContentChanged,this),this._cellModel=null)}_updatePrompt(){var e;const n=this._cellModel;n&&Vt(n)?(this._inputPrompt.executionCount=`${(e=n.executionCount)!==null&&e!==void 0?e:""}`,this._inputPrompt.show()):(this._inputPrompt.executionCount=null,this._inputPrompt.hide())}async _update(){if(!this.node.isConnected){this._pendingUpdate=!0;return}this._pendingUpdate=!1;const e=this._cellModel,n=++this._updateId;if(!e){this._promptOutdated=!1,this._updatePrompt(),this._editorEl.replaceChildren();return}const s=e.sharedModel.getSource(),a=s.indexOf(`
|
|
1
|
+
import{T as De,q as he,t as ht,r as ce,b as $e,g as Je,I as pt,k as gt,a as ze,f as Ge,C as Re,h as Ie}from"./index-gFUsWgU1.js";import{J as M,aA as ee,cg as ie,aD as R,gv as mt,eJ as Ct,fS as bt,ci as me,aJ as Te,eh as ft,ck as vt,ei as _t,ce as Ce,iC as yt,r as J,eP as xt,iv as wt,eN as kt,dB as Z,co as St,iD as v,dM as Ye,dI as Xe,dN as Qe,fQ as Ze,fR as et,eM as Be,aI as At,aE as tt,aF as ke,iE as Mt,iF as Tt,ix as Bt,k as Y,bg as Et,gn as Nt,a9 as Ot,aB as be,gA as G,iG as ge,az as le,iH as xe,iI as Q,eG as Pe,iJ as jt,iK as Rt,dW as we,dY as It,d_ as Le,iL as We,dX as Pt,iM as Lt,iN as Wt,aw as ot,iO as Ht,iP as Ft,eL as Kt,iQ as Vt,aC as F,ew as fe,iR as Se,dw as Ut,eE as qt,e2 as Dt,iS as $t,iT as se,iU as nt,cd as pe,dy as Jt,aG as zt,dD as Gt,cq as Yt,gy as Xt,iV as Qt,dR as Zt,dU as eo,iW as to,dG as oo,iX as no,iY as io,ed as lo,ee as so,dx as ro,bf as ao,fk as co}from"../datalayer-app-main.js";import{b as uo,I as it}from"./token-d9po19EN.js";import{ToolbarItems as ho}from"./lib-CCWKYseC.js";import{I as po}from"./index-PKH5uAl-.js";import{I as ve}from"./tokens-Dyd4wiX6.js";import{a as lt,I as L,b as st,c as go}from"./tokens-DiDi0Nkm.js";import{I as mo,a as rt}from"./tokens-DbNnxPrX.js";import{I as Co}from"./tokens-D1WVYIDT.js";import{f as at,e as bo,c as fo,I as vo,b as _o}from"./index-FRUXunp7.js";import{I as dt}from"./tokens-B7nNzQEE.js";import{I as _e}from"./tokens-DY_UrMLq.js";import{a as Ee}from"./tokens-BYcJtuKD.js";import{I as yo}from"./tokens-Nkg3e_k9.js";import{I as xo}from"./index-C1Tx7ck6.js";import{I as wo}from"./tokens-BcAeNU3z.js";import{W as ko,u as He,V as So,I as Ao,a as Mo,b as To,c as Bo}from"./document-Dp0KpIjg.js";import{s as Eo}from"./hover-B3uFmZ-0.js";import{b as No,c as Oo,d as jo}from"./CellSidebarExtension-COAR2VxE.js";import{H as Ro}from"./htmlselect-5N6NdDqL.js";import{T as Io,a as Po}from"./model-DbDJZyri.js";import{C as Fe}from"./celltoolbartracker-DUxGddsx.js";import"./hoverbox-CStlKQWE.js";import"./Output-BsFagSE6.js";import"./index-DYBuJWF3.js";import"./dayjs.min-u3zuoSR8.js";import"./isEqual-D9LEOOsI.js";import"./d3-color-Jd8hXty2.js";import"./dist-BrUAt6vF.js";import"./KebabHorizontalIcon-D6AY8pIS.js";import"./PaintbrushIcon-CFBHU-3l.js";import"./index-CKWSKbHe.js";import"./RestartIcon-DvpOf5Mf.js";import"./NotebookSkeleton-BaU6vrsb.js";import"./Avatar-Cv5OpUWu.js";import"./renderer-DdYo8U7J.js";import"./SquareIcon-Dy3l3VdH.js";import"./FileDirectoryOpenFillIcon-jGhuRcP3.js";import"./url-C6fJII94.js";/* empty css *//* empty css */import"./style-DdAxk_bj.js";/* empty css */import"./style-Cj1gzCjo.js";/* empty css */import"./style-rkw8dR9f.js";import"./style-GHJFdtIz.js";import"./style-ZSIOeMoX.js";import"./style-iVfD6mFL.js";import"./style-DA-Ya7rp.js";import"./style-D3tvWcFO.js";import"./style-BOqStzF9.js";import"./style-ADLQJ-E9.js";import"./style-DgglluaK.js";import"./ArrowLeftIcon-sX3iNMG1.js";import"./SkubbleIcon-CAaVh_BE.js";import"./usePrimerThemeBridge-NsTRGuo7.js";import"./index-DHpFjpWk.js";import"./KernelVariables-INnfLlYr.js";import"./index-C0d-d3s4.js";import"./SortAscIcon-CmH04s3F.js";import"./SortDescIcon-Qif6E10I.js";import"./NotebookToolbar-CO_qaXBp.js";import"./RepoPushIcon-BtXQRhLa.js";import"./Toolbar-ByUGXe7J.js";import"./sessions-Dy-NqKRu.js";import"./tokens-CTXFWLvM.js";import"./drivecontents-BsC6Y2Vl.js";import"./kernel-BmfZmtIo.js";function Lo(r){const n=s=>{const a=Math.max(s*3.6,.1),l=a*Math.PI/180,p=Math.sin(l)*104,i=Math.cos(l)*-104;return"M 0 0 v -104 A 104 104 1 "+(a<180?1:0)+" 0 "+p.toFixed(4)+" "+i.toFixed(4)+" z"};return M.createElement("div",{className:"jp-Statusbar-ProgressCircle",role:"progressbar","aria-label":r.label||"Unlabelled progress circle","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":r.progress,onClick:r.onClick},M.createElement("svg",{viewBox:"0 0 250 250"},M.createElement("circle",{cx:"125",cy:"125",r:"104",stroke:"var(--jp-inverse-layout-color3)",strokeWidth:"20",fill:"none"}),M.createElement("path",{className:"jp-Statusbar-ProgressCirclePath",transform:"translate(125,125) scale(.9)",d:n(r.progress),fill:"var(--jp-inverse-layout-color3)"})))}const Wo="jp-JSONEditor",ue="jp-mod-error",Ho="jp-JSONEditor-host",Fo="jp-JSONEditor-header";class Ko extends ee{constructor(e){super(),this._dataDirty=!1,this._inputDirty=!1,this._source=null,this._originalValue=ie.emptyObject,this._changeGuard=!1,this.translator=e.translator||R,this._trans=this.translator.load("jupyterlab"),this.addClass(Wo),this.headerNode=document.createElement("div"),this.headerNode.className=Fo,this.revertButtonNode=mt.element({tag:"span",title:this._trans.__("Revert changes to data")}),this.commitButtonNode=Ct.element({tag:"span",title:this._trans.__("Commit changes to data"),marginLeft:"8px"}),this.editorHostNode=document.createElement("div"),this.editorHostNode.className=Ho,this.headerNode.appendChild(this.revertButtonNode),this.headerNode.appendChild(this.commitButtonNode),this.node.appendChild(this.headerNode),this.node.appendChild(this.editorHostNode);const n=new bt.Model({mimeType:"application/json"});n.sharedModel.changed.connect(this._onModelChanged,this),this.model=n,this.editor=e.editorFactory({host:this.editorHostNode,model:n,config:{readOnly:!0}})}get source(){return this._source}set source(e){this._source!==e&&(this._source&&this._source.changed.disconnect(this._onSourceChanged,this),this._source=e,this.editor.setOption("readOnly",e===null),e&&e.changed.connect(this._onSourceChanged,this),this._setValue())}get isDirty(){return this._dataDirty||this._inputDirty}dispose(){var e;this.isDisposed||((e=this.source)===null||e===void 0||e.dispose(),this.model.dispose(),this.editor.dispose(),super.dispose())}handleEvent(e){switch(e.type){case"blur":this._evtBlur(e);break;case"click":this._evtClick(e);break}}onAfterAttach(e){const n=this.editorHostNode;n.addEventListener("blur",this,!0),n.addEventListener("click",this,!0),this.revertButtonNode.hidden=!0,this.commitButtonNode.hidden=!0,this.headerNode.addEventListener("click",this)}onBeforeDetach(e){const n=this.editorHostNode;n.removeEventListener("blur",this,!0),n.removeEventListener("click",this,!0),this.headerNode.removeEventListener("click",this)}_onSourceChanged(e,n){if(!this._changeGuard){if(this._inputDirty||this.editor.hasFocus()){this._dataDirty=!0;return}this._setValue()}}_onModelChanged(e,n){if(n.sourceChange){let s=!0;try{const a=JSON.parse(this.editor.model.sharedModel.getSource());this.removeClass(ue),this._inputDirty=!this._changeGuard&&!ie.deepEqual(a,this._originalValue)}catch{this.addClass(ue),this._inputDirty=!0,s=!1}this.revertButtonNode.hidden=!this._inputDirty,this.commitButtonNode.hidden=!s||!this._inputDirty}}_evtBlur(e){!this._inputDirty&&this._dataDirty&&this._setValue()}_evtClick(e){const n=e.target;this.revertButtonNode.contains(n)?this._setValue():this.commitButtonNode.contains(n)?!this.commitButtonNode.hidden&&!this.hasClass(ue)&&(this._changeGuard=!0,this._mergeContent(),this._changeGuard=!1,this._setValue()):this.editorHostNode.contains(n)&&this.editor.focus()}_mergeContent(){const e=this.editor.model,n=this._originalValue,s=JSON.parse(e.sharedModel.getSource()),a=this.source;if(a){for(const l in s)ie.deepEqual(s[l],n[l]||null)||a.set(l,s[l]);for(const l in n)l in s||a.delete(l)}}_setValue(){this._dataDirty=!1,this._inputDirty=!1,this.revertButtonNode.hidden=!0,this.commitButtonNode.hidden=!0,this.removeClass(ue);const e=this.editor.model,n=this._source?this._source.toJSON():{};if(this._changeGuard=!0,n===void 0)e.sharedModel.setSource(this._trans.__("No data!")),this._originalValue=ie.emptyObject;else{const s=JSON.stringify(n,null,4);e.sharedModel.setSource(s),this._originalValue=n,s.length>1&&s[0]==="{"&&this.editor.setCursorPosition({line:0,column:1})}this._changeGuard=!1,this.commitButtonNode.hidden=!0,this.revertButtonNode.hidden=!0}}class Vo extends M.Component{constructor(e){super(e),this._handleChange=s=>{this.setState({value:s.currentTarget.value})},this._handleSubmit=s=>{var a,l;s.preventDefault();const p=parseInt((l=(a=this._textInput)===null||a===void 0?void 0:a.value)!==null&&l!==void 0?l:"",10);return!isNaN(p)&&isFinite(p)&&1<=p&&p<=this.props.maxCell&&this.props.handleSubmit(p),!1},this._handleFocus=()=>{this.setState({hasFocus:!0})},this._handleBlur=()=>{this.setState({hasFocus:!1})},this._textInput=null;const n=e.translator||R;this._trans=n.load("jupyterlab"),this.state={value:"",hasFocus:!1,textInputId:ft.createDomID()+"-cell-number-input"}}componentDidMount(){var e;(e=this._textInput)===null||e===void 0||e.focus()}render(){return M.createElement("div",{className:"jp-lineFormSearch"},M.createElement("form",{name:"cellNumberForm",onSubmit:this._handleSubmit,noValidate:!0},M.createElement("div",{className:vt("jp-lineFormWrapper","lm-lineForm-wrapper",this.state.hasFocus?"jp-lineFormWrapperFocusWithin":void 0)},M.createElement("input",{type:"number",id:this.state.textInputId,className:"jp-lineFormInput",min:1,max:this.props.maxCell,onChange:this._handleChange,onFocus:this._handleFocus,onBlur:this._handleBlur,value:this.state.value,ref:e=>{this._textInput=e}}),M.createElement("div",{className:"jp-baseLineForm jp-lineFormButtonContainer"},M.createElement(_t.react,{className:"jp-baseLineForm jp-lineFormButtonIcon",elementPosition:"center"}),M.createElement("input",{type:"submit",className:"jp-baseLineForm jp-lineFormButton",value:""}))),M.createElement("label",{className:"jp-lineFormCaption",htmlFor:this.state.textInputId},this._trans.__("Go to cell number between 1 and %1",this.props.maxCell))))}}function Uo(r){const n=(r.translator||R).load("jupyterlab"),s=r.selectionStart>0&&r.selectionStart!==r.selectionEnd?n.__("%1:%2/%3",r.selectionStart,r.selectionEnd,r.totalCells):n.__("Cell %1/%2",r.activeCell,r.totalCells),a=l=>{(l.key==="Enter"||l.key==="Spacebar"||l.key===" ")&&(l.preventDefault(),l.stopPropagation(),r.handleClick())};return M.createElement(De,{role:"button","aria-haspopup":!0,onClick:r.handleClick,source:s,title:n.__("Go to cell…"),tabIndex:0,onKeyDown:a})}class re extends me{constructor(e={}){super(new re.Model),this._popup=null,this.addClass("jp-mod-highlighted"),this._translator=e.translator||R}render(){return this.model===null?null:M.createElement(Uo,{activeCell:this.model.activeCell,selectionStart:this.model.selectionStart,selectionEnd:this.model.selectionEnd,totalCells:this.model.totalCells,translator:this._translator,handleClick:()=>this._handleClick()})}_handleClick(){if(this.model.totalCells<1)return;this._popup&&this._popup.dispose();const e=Te.create(M.createElement(Vo,{handleSubmit:n=>this._handleSubmit(n),maxCell:this.model.totalCells,translator:this._translator}));this._popup=Eo({body:e,anchor:this,align:"right"})}_handleSubmit(e){var n;const s=this.model.notebook;if(!s)return;const a=e-1;s.activeCellIndex=a,s.deselectAll(),s.scrollToItem(a).catch(l=>{console.error("Go to cell",l)}),(n=this._popup)===null||n===void 0||n.dispose(),s.activate()}}(function(r){class e extends Ce{constructor(){super(...arguments),this._activeCell=0,this._selectionStart=0,this._selectionEnd=0,this._totalCells=0,this._notebook=null}get notebook(){return this._notebook}set notebook(s){const a=this._notebook;a&&(a.activeCellChanged.disconnect(this._onChanged,this),a.modelContentChanged.disconnect(this._onChanged,this),a.selectionChanged.disconnect(this._onChanged,this));const l=this._getAllState();this._notebook=s,this._notebook?(this._notebook.activeCellChanged.connect(this._onChanged,this),this._notebook.modelContentChanged.connect(this._onChanged,this),this._notebook.selectionChanged.connect(this._onChanged,this),this._updateStateFromNotebook(this._notebook)):(this._activeCell=0,this._selectionStart=0,this._selectionEnd=0,this._totalCells=0),this._triggerChange(l,this._getAllState())}get activeCell(){return this._activeCell}get selectionStart(){return this._selectionStart}get selectionEnd(){return this._selectionEnd}get totalCells(){return this._totalCells}_onChanged(s){const a=this._getAllState();this._updateStateFromNotebook(s),this._triggerChange(a,this._getAllState())}_updateStateFromNotebook(s){const a=s.activeCellIndex;this._activeCell=a>=0?a+1:0,this._totalCells=s.widgets.length;let l=this._activeCell,p=this._activeCell,i=!1;s.widgets.forEach((u,d)=>{if(!s.isSelectedOrActive(u))return;const g=d+1;if(!i){l=g,p=g,i=!0;return}p=g}),this._selectionStart=i?l:0,this._selectionEnd=i?p:0}_getAllState(){return{activeCell:this._activeCell,selectionStart:this._selectionStart,selectionEnd:this._selectionEnd,totalCells:this._totalCells}}_triggerChange(s,a){(s.activeCell!==a.activeCell||s.selectionStart!==a.selectionStart||s.selectionEnd!==a.selectionEnd||s.totalCells!==a.totalCells)&&this.stateChanged.emit(void 0)}}r.Model=e})(re||(re={}));const qo="jp-Notebook-toolbarCellType",Do="jp-Notebook-toolbarCellTypeDropdown";var Ae;(function(r){function e(g,b){const f=(b||R).load("jupyterlab");function _(){if(g.context.model.readOnly)return tt({title:f.__("Cannot Save"),body:f.__("Document is read-only"),buttons:[ke.okButton()]});g.context.save().then(()=>{if(!g.isDisposed)return g.context.createCheckpoint()})}return yt(Te.create(J.createElement(xt,{signal:g.context.fileChanged},()=>J.createElement(wt,{icon:kt,onClick:_,tooltip:f.__("Save the notebook contents and create checkpoint"),enabled:!!(g&&g.context&&g.context.contentsModel&&g.context.contentsModel.writable)}))))}r.createSaveButton=e;function n(g,b){const f=(b||R).load("jupyterlab");return new Z({icon:St,onClick:()=>{v.insertBelow(g.content)},tooltip:f.__("Insert a cell below")})}r.createInsertButton=n;function s(g,b,f){const _=(b||R).load("jupyterlab");return new Z({icon:Ye,onClick:async()=>{f?.get("useSystemClipboardForCells").composite?await v.cutToSystemClipboard(g.content):v.cut(g.content)},tooltip:_.__("Cut the selected cells")})}r.createCutButton=s;function a(g,b,f){const _=(b||R).load("jupyterlab");return new Z({icon:Xe,onClick:async()=>{f?.get("useSystemClipboardForCells").composite?await v.copyToSystemClipboard(g.content):v.copy(g.content)},tooltip:_.__("Copy the selected cells")})}r.createCopyButton=a;function l(g,b,f){const _=(b||R).load("jupyterlab");return new Z({icon:Qe,onClick:async()=>{f?.get("useSystemClipboardForCells").composite?await v.pasteFromSystemClipboard(g.content):v.paste(g.content)},tooltip:_.__("Paste cells from the clipboard")})}r.createPasteButton=l;function p(g,b,f){const _=(f??R).load("jupyterlab");return new Z({icon:Ze,onClick:()=>{v.runAndAdvance(g.content,g.sessionContext,b,f)},tooltip:_.__("Run the selected cells and advance")})}r.createRunButton=p;function i(g,b,f){const _=(f??R).load("jupyterlab");return new Z({icon:et,onClick:()=>{const y=b??new Be({translator:f});y.restart(g.sessionContext).then(w=>(w&&v.runAll(g.content,g.sessionContext,y,f),w))},tooltip:_.__("Restart the kernel, then re-run the whole notebook")})}r.createRestartRunAllButton=i;function u(g,b){return new $o(g.content,b)}r.createCellTypeItem=u;function d(g,b,f,_){return[{name:"save",widget:e(g,f)},{name:"insert",widget:n(g,f)},{name:"cut",widget:s(g,f,_)},{name:"copy",widget:a(g,f,_)},{name:"paste",widget:l(g,f,_)},{name:"run",widget:p(g,b,f)},{name:"interrupt",widget:he.createInterruptButton(g.sessionContext,f)},{name:"restart",widget:he.createRestartButton(g.sessionContext,b,f)},{name:"restart-and-run",widget:i(g,b,f)},{name:"cellType",widget:u(g,f)},{name:"spacer",widget:At.createSpacerItem()},{name:"kernelName",widget:he.createKernelNameItem(g.sessionContext,b,f)}]}r.getDefaultItems=d})(Ae||(Ae={}));class $o extends Te{constructor(e,n){super(),this.handleChange=s=>{s.target.value!=="-"&&(v.changeCellType(this._notebook,s.target.value),this._notebook.activate())},this.handleKeyDown=s=>{s.key==="Enter"&&this._notebook.activate()},this._trans=(n||R).load("jupyterlab"),this.addClass(qo),this._notebook=e,e.model&&this.update(),e.activeCellChanged.connect(this.update,this),e.selectionChanged.connect(this.update,this)}render(){let e="-";this._notebook.activeCell&&(e=this._notebook.activeCell.model.type);for(const n of this._notebook.widgets)if(this._notebook.isSelectedOrActive(n)&&n.model.type!==e){e="-";break}return J.createElement(Ro,{className:Do,onChange:this.handleChange,onKeyDown:this.handleKeyDown,value:e,"aria-label":this._trans.__("Cell type"),title:this._trans.__("Select the cell type")},J.createElement("option",{value:"-"},"-"),J.createElement("option",{value:"code"},this._trans.__("Code")),J.createElement("option",{value:"markdown"},this._trans.__("Markdown")),J.createElement("option",{value:"raw"},this._trans.__("Raw")))}}function Ke(r){var e;const n=r.translator||R,s=ht(n),a=n.load("jupyterlab"),l=(e=r.displayOption.showJumpToCell)!==null&&e!==void 0?e:!1,p=r.state,i=r.displayOption.showOnToolBar,u=r.displayOption.showProgress,d=i?"down":"up",g=M.createElement("div",null),[b,f]=M.useState(!1);if(M.useEffect(()=>{if(b)return;const j=()=>{f(!0)};return v.executionScheduled.connect(j),()=>{v.executionScheduled.disconnect(j)}},[l,b]),!p)return g;const _=p.kernelStatus,y={alignSelf:"normal",height:"24px"},w=p.totalTime,S=p.scheduledCellNumber||0,o=p.scheduledCell.size||0,t=S-o;let h=100*t/S,C=u?"":"hidden";!u&&h<100&&(h=0);const k=j=>M.createElement(Lo,{progress:j,width:16,height:24,label:a.__("Kernel status")}),A=j=>a.__("Kernel status: %1",j),B=()=>{const j=r.notebook;v.selectLastRunCell(j),j.activeCell&&j.scrollToCell(j.activeCell)},E=(j,K,W)=>M.createElement("div",{className:"jp-Notebook-ExecutionIndicator",title:u?"":A(s[j]),"data-status":j},K,M.createElement("div",{className:`jp-Notebook-ExecutionIndicator-tooltip ${d} ${C}`},M.createElement("span",null," ",A(s[j])," "),W,l&&b&&M.createElement(Bt,{className:"jp-Notebook-ExecutionIndicator-jumpButton",onClick:B,title:a.__("Jump to current or last executed cell")},a.__("Jump to cell"))));if(p.kernelStatus==="connecting"||p.kernelStatus==="disconnected"||p.kernelStatus==="unknown")return E(_,M.createElement(Mt.react,{...y}),[]);if(p.kernelStatus==="starting"||p.kernelStatus==="terminating"||p.kernelStatus==="restarting"||p.kernelStatus==="initializing")return E(_,M.createElement(Tt.react,{...y}),[]);if(p.executionStatus==="busy")return E("busy",k(h),[M.createElement("span",{key:0},a.__("Executed %1/%2 cells",t,S)),M.createElement("span",{key:1},a._n("Elapsed time: %1 second","Elapsed time: %1 seconds",w))]);{const j=p.kernelStatus==="busy"?0:100,K=p.kernelStatus==="busy"||w===0?[]:[M.createElement("span",{key:0},a._n("Executed %1 cell","Executed %1 cells",S)),M.createElement("span",{key:1},a._n("Elapsed time: %1 second","Elapsed time: %1 seconds",w))];return E(p.kernelStatus,k(j),K)}}class X extends me{constructor(e,n=!0){super(new X.Model),this.translator=e||R,this.addClass("jp-mod-highlighted")}dispose(){var e;this.isDisposed||((e=this.model)===null||e===void 0||e.dispose(),super.dispose())}render(){if(this.model===null||!this.model.renderFlag)return M.createElement("div",null);{const e=this.model.currentNotebook;return e?M.createElement(Ke,{displayOption:this.model.displayOption,state:this.model.executionState(e),translator:this.translator,notebook:e}):M.createElement(Ke,{displayOption:this.model.displayOption,state:void 0,translator:this.translator,notebook:void 0})}}}(function(r){class e extends Ce{constructor(){super(),this._notebookExecutionProgress=new WeakMap,this._displayOption={showOnToolBar:!0,showProgress:!0,showJumpToCell:!1},this._renderFlag=!0}attachNotebook(l){var p,i,u,d;if(l&&l.content&&l.context){const g=l.content,b=l.context;if(this._currentNotebook=g,!this._notebookExecutionProgress.has(g)){this._notebookExecutionProgress.set(g,{executionStatus:"idle",kernelStatus:"idle",totalTime:0,interval:0,timeout:0,scheduledCell:new Set,scheduledCellNumber:0,needReset:!0});const f=this._notebookExecutionProgress.get(g),_=o=>{f&&(f.kernelStatus=o.kernelDisplayStatus),this.stateChanged.emit(void 0)};b.statusChanged.connect(_,this);const y=o=>{f&&(f.kernelStatus=o.kernelDisplayStatus),this.stateChanged.emit(void 0)};b.connectionStatusChanged.connect(y,this),b.disposed.connect(o=>{o.connectionStatusChanged.disconnect(y,this),o.statusChanged.disconnect(_,this)},this);const w=(o,t)=>{const h=t.msg,C=h.header.msg_id;if(h.header.msg_type==="execute_request")this._cellScheduledCallback(g,C);else if(Y.KernelMessage.isStatusMsg(h)&&h.content.execution_state==="idle"){const k=h.parent_header.msg_id;this._cellExecutedCallback(g,k)}else Y.KernelMessage.isStatusMsg(h)&&h.content.execution_state==="restarting"?this._restartHandler(g):h.header.msg_type==="execute_input"&&this._startTimer(g)};(i=(p=b.session)===null||p===void 0?void 0:p.kernel)===null||i===void 0||i.anyMessage.connect(w,this),(d=(u=b.session)===null||u===void 0?void 0:u.kernel)===null||d===void 0||d.disposed.connect(o=>o.anyMessage.disconnect(w,this),this);const S=(o,t)=>{f&&(this._resetTime(f),this.stateChanged.emit(void 0),t.newValue&&t.newValue.anyMessage.connect(w,this))};b.kernelChanged.connect(S,this),b.disposed.connect(o=>o.kernelChanged.disconnect(S,this),this)}}}get currentNotebook(){return this._currentNotebook}get displayOption(){return this._displayOption}set displayOption(l){this._displayOption=l}executionState(l){return this._notebookExecutionProgress.get(l)}_scheduleSwitchToIdle(l){window.setTimeout(()=>{l.executionStatus="idle",clearInterval(l.interval),this.stateChanged.emit(void 0)},150),l.timeout=window.setTimeout(()=>{l.needReset=!0},1e3)}_cellExecutedCallback(l,p){const i=this._notebookExecutionProgress.get(l);i&&i.scheduledCell.has(p)&&(i.scheduledCell.delete(p),i.scheduledCell.size===0&&this._scheduleSwitchToIdle(i))}_restartHandler(l){const p=this._notebookExecutionProgress.get(l);p&&(p.scheduledCell.clear(),this._scheduleSwitchToIdle(p))}_startTimer(l){const p=this._notebookExecutionProgress.get(l);p&&(p.scheduledCell.size>0?p.executionStatus!=="busy"&&(p.executionStatus="busy",clearTimeout(p.timeout),this.stateChanged.emit(void 0),p.interval=window.setInterval(()=>{this._tick(p)},1e3)):this._resetTime(p))}_cellScheduledCallback(l,p){const i=this._notebookExecutionProgress.get(l);i&&!i.scheduledCell.has(p)&&(i.needReset&&this._resetTime(i),i.scheduledCell.add(p),i.scheduledCellNumber+=1)}_tick(l){if(this.isDisposed){clearInterval(l.interval),clearTimeout(l.timeout);return}l.totalTime+=1,this.stateChanged.emit(void 0)}_resetTime(l){l.totalTime=0,l.scheduledCellNumber=0,l.executionStatus="idle",l.scheduledCell=new Set,clearTimeout(l.timeout),clearInterval(l.interval),l.needReset=!1}get renderFlag(){return this._renderFlag}updateRenderOption(l){this.displayOption.showOnToolBar&&(l.showOnToolBar?this._renderFlag=!0:this._renderFlag=!1),this.displayOption.showProgress=l.showProgress,this.displayOption.showJumpToCell=l.showJumpToCell,this.stateChanged.emit(void 0)}}r.Model=e;function n(a,l,p){const i=new r(l);return i.model.displayOption={showOnToolBar:!0,showProgress:!0,showJumpToCell:!1},i.model.attachNotebook({content:a.content,context:a.sessionContext}),p&&p.then(u=>{const d=g=>{const b=s(g);b.showJumpToCell&&(g.get("recordTiming").composite||g.set("recordTiming",!0).catch(_=>{console.error("Failed to auto-enable recordTiming:",_.message)})),i.model.updateRenderOption(b)};u.changed.connect(d),d(u),i.disposed.connect(()=>{u.changed.disconnect(d)})}).catch(u=>{console.error(u.message)}),i}r.createExecutionIndicatorItem=n;function s(a){let l=!0,p=!0,i=!1;const u=a.get("kernelStatus").composite;return u&&(l=!u.showOnStatusBar,p=u.showProgress,i=u.showJumpToRecentExecutionButton),{showOnToolBar:l,showProgress:p,showJumpToCell:i}}r.getSettingValue=s})(X||(X={}));function Jo(r){const e=(r.translator||R).load("jupyterlab");return J.createElement(De,{source:e.__("Mode: %1",r.modeNames[r.notebookMode])})}class ae extends me{constructor(e){super(new ae.Model),this.translator=e||R,this._trans=this.translator.load("jupyterlab"),this._modeNames={command:this._trans.__("Command"),edit:this._trans.__("Edit")}}render(){return this.model?(this.node.title=this._trans.__("Notebook is in %1 mode",this._modeNames[this.model.notebookMode]),J.createElement(Jo,{notebookMode:this.model.notebookMode,translator:this.translator,modeNames:this._modeNames})):null}}(function(r){class e extends Ce{constructor(){super(...arguments),this._onChanged=s=>{const a=this._notebookMode;this._notebook?this._notebookMode=s.mode:this._notebookMode="command",this._triggerChange(a,this._notebookMode)},this._notebookMode="command",this._notebook=null}get notebookMode(){return this._notebookMode}set notebook(s){const a=this._notebook;a!==null&&(a.stateChanged.disconnect(this._onChanged,this),a.activeCellChanged.disconnect(this._onChanged,this),a.modelContentChanged.disconnect(this._onChanged,this));const l=this._notebookMode;this._notebook=s,this._notebook===null?this._notebookMode="command":(this._notebookMode=this._notebook.mode,this._notebook.stateChanged.connect(this._onChanged,this),this._notebook.activeCellChanged.connect(this._onChanged,this),this._notebook.modelContentChanged.connect(this._onChanged,this)),this._triggerChange(l,this._notebookMode)}_triggerChange(s,a){s!==a&&this.stateChanged.emit(void 0)}}r.Model=e})(ae||(ae={}));class zo extends ko{constructor(e,n){super(e,n),this.editorWidget=e,this.options=n,this._type="code",this._readyDelegate=new Et,this._editorToCell=new Map,this.editor=e.content,this._cellToEditor=new WeakMap,this.isReady=this.isReady.bind(this),Promise.all([this.widget.context.sessionContext.ready,this.connectionManager.ready]).then(async()=>{await this.initOnceReady(),this._readyDelegate.resolve()}).catch(console.error)}get documentPath(){return this.widget.context.path}get mimeType(){var e;let n,s=this.language_info();return!s||!s.mimetype?n=this.widget.content.codeMimetype:n=s.mimetype,Array.isArray(n)?(e=n[0])!==null&&e!==void 0?e:Nt.defaultMimeType:n}get languageFileExtension(){let e=this.language_info();if(!(!e||!e.file_extension))return e.file_extension.replace(".","")}get wrapperElement(){return this.widget.node}get editors(){if(this.isDisposed)return[];let e=this.widget.content;return this._editorToCell.clear(),e.isDisposed?[]:e.widgets.map(n=>({ceEditor:this._getCellEditor(n),type:n.model.type,value:n.model.sharedModel.getSource()}))}get activeEditor(){return this.editor.activeCell?this._getCellEditor(this.editor.activeCell):void 0}get ready(){return this._readyDelegate.promise}getEditorIndexAt(e){let n=this._getCellAt(e);return this.widget.content.widgets.findIndex(a=>n===a)}getEditorIndex(e){let n=this._editorToCell.get(e);return this.editor.widgets.findIndex(s=>n===s)}getEditorWrapper(e){return this._editorToCell.get(e).node}async onKernelChanged(e,n){if(n.newValue)try{const s=this._languageInfo;await He(this.isReady,-1),await this._updateLanguageInfo();const a=this._languageInfo;s?.name!=a.name||s?.mimetype!=a?.mimetype||s?.file_extension!=a?.file_extension?(console.log(`Changed to ${this._languageInfo.name} kernel, reconnecting`),this.reloadConnection()):console.log("Keeping old LSP connection as the new kernel uses the same language")}catch(s){console.warn(s),this.reloadConnection()}}dispose(){this.isDisposed||(this.widget.context.sessionContext.kernelChanged.disconnect(this.onKernelChanged,this),this.widget.content.activeCellChanged.disconnect(this._activeCellChanged,this),super.dispose(),this._editorToCell.clear(),Ot.clearData(this))}isReady(){var e;return!this.widget.isDisposed&&this.widget.context.isReady&&this.widget.content.isVisible&&this.widget.content.widgets.length>0&&((e=this.widget.context.sessionContext.session)===null||e===void 0?void 0:e.kernel)!=null}async handleCellChange(e,n){let s=[],a=[];const l=this._type;if(n.type==="set"){let p=[],i=[];if(n.newValues.length===n.oldValues.length){for(let u=0;u<n.newValues.length;u++)n.oldValues[u].type===l&&n.newValues[u].type!==l?p.push(n.newValues[u]):n.oldValues[u].type!==l&&n.newValues[u].type===l&&i.push(n.newValues[u]);s=i,a=p}}else n.type=="add"&&(s=n.newValues.filter(p=>p.type===l));(a.length||s.length||n.type==="set"||n.type==="move"||n.type==="remove"||n.type==="clear")&&await this.updateDocuments();for(let p of s){let i=this.widget.content.widgets.find(u=>u.model.id===p.id);if(!i){console.warn(`Widget for added cell with ID: ${p.id} not found!`);continue}this._getCellEditor(i)}}createVirtualDocument(){return new So({language:this.language,foreignCodeExtractors:this.options.foreignCodeExtractorsManager,path:this.documentPath,fileExtension:this.languageFileExtension,standalone:!1,hasLspSupportedFile:!1})}language_info(){return this._languageInfo}async initOnceReady(){await He(this.isReady.bind(this),-1),await this._updateLanguageInfo(),this.initVirtual(),this.connectDocument(this.virtualDocument,!1).catch(console.warn),this.widget.context.sessionContext.kernelChanged.connect(this.onKernelChanged,this),this.widget.content.activeCellChanged.connect(this._activeCellChanged,this),this._connectModelSignals(this.widget),this.editor.modelChanged.connect(e=>{console.warn("Model changed, connecting cell change handler; this is not something we were expecting"),this._connectModelSignals(e)})}_connectModelSignals(e){e.model===null?console.warn(`Model is missing for notebook ${e}, cannot connect cell changed signal!`):e.model.cells.changed.connect(this.handleCellChange,this)}async _updateLanguageInfo(){var e,n,s,a;const l=(a=await((s=(n=(e=this.widget.context.sessionContext)===null||e===void 0?void 0:e.session)===null||n===void 0?void 0:n.kernel)===null||s===void 0?void 0:s.info))===null||a===void 0?void 0:a.language_info;if(l)this._languageInfo=l;else throw new Error("Language info update failed (no session, kernel, or info available)")}_activeCellChanged(e,n){!n||n.model.type!==this._type||this._activeEditorChanged.emit({editor:this._getCellEditor(n)})}_getCellAt(e){let n=this.virtualDocument.getEditorAtVirtualLine(e);return this._editorToCell.get(n)}_getCellEditor(e){if(!this._cellToEditor.has(e)){const n=Object.freeze({getEditor:()=>e.editor,ready:async()=>(await e.ready,e.editor),reveal:async()=>(await this.editor.scrollToCell(e),e.editor)});this._cellToEditor.set(e,n),this._editorToCell.set(n,e),e.disposed.connect(()=>{this._cellToEditor.delete(e),this._editorToCell.delete(n),this._editorRemoved.emit({editor:n})}),this._editorAdded.emit({editor:n})}return this._cellToEditor.get(e)}}class Go extends ee{constructor(){super(),this._items=[],this.layout=new be,this.addClass("jp-RankedPanel")}addWidget(e,n){const s={widget:e,rank:n},a=le.upperBound(this._items,s,Me.itemCmp);le.insert(this._items,a,s),this.layout.insertWidget(a,e)}onChildRemoved(e){const n=le.findFirstIndex(this._items,s=>s.widget===e.child);n!==-1&&le.removeAt(this._items,n)}}class q extends ee{constructor(e){super(),this.addClass("jp-NotebookTools"),this.translator=e.translator||R,this._tools=[],this.layout=new be,this._tracker=e.tracker,this._tracker.currentChanged.connect(this._onActiveNotebookPanelChanged,this),this._tracker.activeCellChanged.connect(this._onActiveCellChanged,this),this._tracker.selectionChanged.connect(this._onSelectionChanged,this),this._onActiveNotebookPanelChanged(),this._onActiveCellChanged(),this._onSelectionChanged()}get activeCell(){return this._tracker.activeCell}get selectedCells(){const e=this._tracker.currentWidget;if(!e)return[];const n=e.content;return n.widgets.filter(s=>n.isSelectedOrActive(s))}get activeNotebookPanel(){return this._tracker.currentWidget}addItem(e){var n;const s=e.tool,a=(n=e.rank)!==null&&n!==void 0?n:100;let l;const p=this._tools.find(i=>i.section===e.section);if(p)l=p.panel;else throw new Error(`The section ${e.section} does not exist`);s.addClass("jp-NotebookTools-tool"),l.addWidget(s,a),s.notebookTools=this,G.sendMessage(s,q.ActiveNotebookPanelMessage),G.sendMessage(s,q.ActiveCellMessage)}addSection(e){var n;const s=e.sectionName,a=e.label||e.sectionName,l=e.tool;let p=(n=e.rank)!==null&&n!==void 0?n:null;const i=new Go;if(i.title.label=a,l&&i.addWidget(l,0),this._tools.push({section:s,panel:i,rank:p}),p!=null)this.layout.insertWidget(p,new ce({widget:i}));else{let u=null;const d=this.layout;for(let g=0;g<d.widgets.length;g++){let b=d.widgets[g];if(b instanceof ce&&b.widget.id==="advancedToolsSection"){u=g;break}}u!==null?this.layout.insertWidget(u,new ce({widget:i})):this.layout.addWidget(new ce({widget:i}))}}_onActiveNotebookPanelChanged(){this._prevActiveNotebookModel&&!this._prevActiveNotebookModel.isDisposed&&this._prevActiveNotebookModel.metadataChanged.disconnect(this._onActiveNotebookPanelMetadataChanged,this);const e=this.activeNotebookPanel&&this.activeNotebookPanel.content?this.activeNotebookPanel.content.model:null;this._prevActiveNotebookModel=e,e&&e.metadataChanged.connect(this._onActiveNotebookPanelMetadataChanged,this);for(const n of this._toolChildren())G.sendMessage(n,q.ActiveNotebookPanelMessage)}_onActiveCellChanged(){this._prevActiveCell&&!this._prevActiveCell.isDisposed&&this._prevActiveCell.metadataChanged.disconnect(this._onActiveCellMetadataChanged,this);const e=this.activeCell?this.activeCell.model:null;this._prevActiveCell=e,e&&e.metadataChanged.connect(this._onActiveCellMetadataChanged,this);for(const n of this._toolChildren())G.sendMessage(n,q.ActiveCellMessage)}_onSelectionChanged(){for(const e of this._toolChildren())G.sendMessage(e,q.SelectionMessage)}_onActiveNotebookPanelMetadataChanged(e,n){const s=new ge.ChangeMessage("activenotebookpanel-metadata-changed",{oldValue:void 0,newValue:void 0,...n});for(const a of this._toolChildren())G.sendMessage(a,s)}_onActiveCellMetadataChanged(e,n){const s=new ge.ChangeMessage("activecell-metadata-changed",{newValue:void 0,oldValue:void 0,...n});for(const a of this._toolChildren())G.sendMessage(a,s)}*_toolChildren(){for(let e of this._tools)yield*e.panel.children()}}(function(r){r.ActiveNotebookPanelMessage=new xe("activenotebookpanel-changed"),r.ActiveCellMessage=new xe("activecell-changed"),r.SelectionMessage=new xe("selection-changed");class e extends ee{dispose(){super.dispose(),this.notebookTools&&(this.notebookTools=null)}processMessage(a){switch(super.processMessage(a),a.type){case"activenotebookpanel-changed":this.onActiveNotebookPanelChanged(a);break;case"activecell-changed":this.onActiveCellChanged(a);break;case"selection-changed":this.onSelectionChanged(a);break;case"activecell-metadata-changed":this.onActiveCellMetadataChanged(a);break;case"activenotebookpanel-metadata-changed":this.onActiveNotebookPanelMetadataChanged(a);break}}onActiveNotebookPanelChanged(a){}onActiveCellChanged(a){}onSelectionChanged(a){}onActiveCellMetadataChanged(a){}onActiveNotebookPanelMetadataChanged(a){}}r.Tool=e;class n extends e{constructor(a){super();const{editorFactory:l}=a;this.addClass("jp-MetadataEditorTool");const p=this.layout=new be;this._editorFactory=l,this._editorLabel=a.label||"Edit Metadata",this.createEditor();const i=new ee({node:document.createElement("label")});i.node.textContent=a.label||"Edit Metadata",p.addWidget(i),p.addWidget(this.editor)}get editor(){return this._editor}onActiveNotebookPanelChanged(a){this.editor.dispose(),this.notebookTools.activeNotebookPanel&&this.createEditor()}createEditor(){this._editor=new Ko({editorFactory:this._editorFactory}),this.editor.title.label=this._editorLabel,this.layout.addWidget(this.editor)}}r.MetadataEditorTool=n})(q||(q={}));var Me;(function(r){function e(n,s){return n.rank-s.rank}r.itemCmp=e})(Me||(Me={}));const Yo=6;var V;(function(r){r[r.Idle=-1]="Idle",r[r.Error=-.5]="Error",r[r.Scheduled=0]="Scheduled",r[r.Running=1]="Running"})(V||(V={}));class Xo extends Po{constructor(e,n,s,a){super(e,a),this.parser=n,this.sanitizer=s,this.configMetadataMap={numberHeaders:["toc-autonumbering","toc/number_sections"],numberingH1:["!toc/skip_h1_title"],baseNumbering:["toc/base_numbering"]},this._runningCells=new Array,this._errorCells=new Array,this._cellToHeadingIndex=new WeakMap,e.context.ready.then(()=>{this.setConfiguration({})}),this.widget.context.model.metadataChanged.connect(this.onMetadataChanged,this),this.widget.content.activeCellChanged.connect(this.onActiveCellChanged,this),v.executionScheduled.connect(this.onExecutionScheduled,this),v.executed.connect(this.onExecuted,this),v.outputCleared.connect(this.onOutputCleared,this),this.headingsChanged.connect(this.onHeadingsChanged,this)}get documentType(){return"notebook"}get isAlwaysActive(){return!0}get supportedOptions(){return["baseNumbering","maximalDepth","numberingH1","numberHeaders","includeOutput","syncCollapseState"]}getCellHeadings(e){const n=new Array;let s=this._cellToHeadingIndex.get(e);if(s!==void 0){const a=this.headings[s];for(n.push(a);this.headings[s-1]&&this.headings[s-1].cellRef===a.cellRef;)s--,n.unshift(this.headings[s])}return n}dispose(){var e,n,s;this.isDisposed||(this.headingsChanged.disconnect(this.onHeadingsChanged,this),(n=(e=this.widget.context)===null||e===void 0?void 0:e.model)===null||n===void 0||n.metadataChanged.disconnect(this.onMetadataChanged,this),(s=this.widget.content)===null||s===void 0||s.activeCellChanged.disconnect(this.onActiveCellChanged,this),v.executionScheduled.disconnect(this.onExecutionScheduled,this),v.executed.disconnect(this.onExecuted,this),v.outputCleared.disconnect(this.onOutputCleared,this),this._runningCells.length=0,this._errorCells.length=0,super.dispose())}setConfiguration(e){const n=this.loadConfigurationFromMetadata();super.setConfiguration({...this.configuration,...n,...e})}toggleCollapse(e){super.toggleCollapse(e),this.updateRunningStatus(this.headings)}async getHeadings(){const e=this.widget.content.widgets,n=new Set(e),s=[],a=new Array,l=new WeakMap;for(let p=0;p<e.length;p++){const i=e[p];switch(i.model.type){case"code":{!this.configuration.syncCollapseState&&this.configuration.includeOutput&&s.push(...Le(await i.getHeadings(),this.configuration,a).map(d=>({...d,cellRef:i,collapsed:!1,isRunning:V.Idle})));break}case"markdown":{const d=Le(await i.getHeadings(),this.configuration,a).map((g,b)=>({...g,cellRef:i,collapsed:!1,isRunning:V.Idle}));if(this.configuration.syncCollapseState&&i.headingCollapsed){const g=Math.min(...d.map(f=>f.level)),b=d.find(f=>f.level===g);b.collapsed=i.headingCollapsed}s.push(...d);break}}s.length>0&&l.set(i,s.length-1)}return this._cellToHeadingIndex=l,this._runningCells=this._runningCells.filter(p=>n.has(p)),this._errorCells=this._errorCells.filter(p=>n.has(p)),this.updateRunningStatus(s),Promise.resolve(s)}isHeadingEqual(e,n){return super.isHeadingEqual(e,n)&&e.cellRef===n.cellRef&&e.isRunning===n.isRunning}loadConfigurationFromMetadata(){const e=this.widget.content.model,n={};if(e)for(const s in this.configMetadataMap){const a=this.configMetadataMap[s];for(const l of a){let p=l;const i=p[0]==="!";i&&(p=p.slice(1));const u=p.split("/");let d=e.getMetadata(u[0]);for(let g=1;g<u.length;g++)d=(d??{})[u[g]];d!==void 0&&(typeof d=="boolean"&&i&&(d=!d),n[s]=d)}}return n}onActiveCellChanged(e,n){const s=this.getCellHeadings(n)[0];this.setActiveHeading(s??null,!1)}onHeadingsChanged(){this.widget.content.activeCell&&this.onActiveCellChanged(this.widget.content,this.widget.content.activeCell)}onExecuted(e,n){this._runningCells.forEach((s,a)=>{var l;if(s===n.cell){this._runningCells.splice(a,1);const p=this._cellToHeadingIndex.get(s);if(p!==void 0){const i=this.headings[p];if(n.success||((l=n.error)===null||l===void 0?void 0:l.errorName)===void 0){i.isRunning=V.Idle;return}i.isRunning=V.Error,this._errorCells.includes(s)||this._errorCells.push(s)}}}),this.updateRunningStatus(this.headings),this.stateChanged.emit()}onExecutionScheduled(e,n){this._runningCells.includes(n.cell)||this._runningCells.push(n.cell),this._errorCells.forEach((s,a)=>{s===n.cell&&this._errorCells.splice(a,1)}),this.updateRunningStatus(this.headings),this.stateChanged.emit()}onOutputCleared(e,n){this._errorCells.forEach((s,a)=>{if(s===n.cell){this._errorCells.splice(a,1);const l=this._cellToHeadingIndex.get(s);if(l!==void 0){const p=this.headings[l];p.isRunning=V.Idle}}}),this.updateRunningStatus(this.headings),this.stateChanged.emit()}onMetadataChanged(){this.setConfiguration({})}updateRunningStatus(e){e.forEach(a=>{a.isRunning=V.Idle}),this._runningCells.forEach((a,l)=>{const p=this._cellToHeadingIndex.get(a);if(p!==void 0){const i=e[p];i.isRunning!==V.Running&&(i.isRunning=l>0?V.Scheduled:V.Running)}}),this._errorCells.forEach((a,l)=>{const p=this._cellToHeadingIndex.get(a);if(p!==void 0){const i=e[p];i.isRunning===V.Idle&&(i.isRunning=V.Error)}});let n=0;for(;n<e.length;){const a=e[n];if(n++,a.collapsed){const l=Math.max(a.isRunning,s(e,a.level));a.dataset={...a.dataset,"data-running":l.toString()}}else a.dataset={...a.dataset,"data-running":a.isRunning.toString()}}function s(a,l){let p=V.Idle;for(;n<a.length;){const i=a[n];if(i.dataset={...i.dataset,"data-running":i.isRunning.toString()},i.level>l)n++,p=Math.max(i.isRunning,p),i.collapsed&&(p=Math.max(p,s(a,i.level)),i.dataset={...i.dataset,"data-running":p.toString()});else break}return p}}}class Qo extends Io{constructor(e,n,s,a){super(e),this.parser=n,this.sanitizer=s,this.commands=a,this._scrollToTop=!0}get scrollToTop(){return this._scrollToTop}set scrollToTop(e){this._scrollToTop=e}_createNew(e,n){const s=new Xo(e,this.parser,this.sanitizer,n);let a=new WeakMap;const l=(_,y)=>{if(y){const w=async h=>{if(!h.inViewport)return;let C=a.get(y);if((!C||!y.cellRef.node.contains(C))&&(await i(h),C=a.get(y)),C)if(this.scrollToTop)C.scrollIntoView({block:"start"}),e.content.outerNode.scrollTop-=Yo;else{const k=e.content.node.getBoundingClientRect(),A=C.getBoundingClientRect();(A.top>k.bottom||A.bottom<k.top)&&C.scrollIntoView({block:"center"})}else console.debug("scrolling to heading: using fallback strategy"),await e.content.scrollToItem(e.content.activeCellIndex,this.scrollToTop?"start":void 0,0)},S=y.cellRef,t=e.content.widgets.indexOf(S);S.model.type=="markdown"&&e.content.mode!="command"&&(e.content.mode="command"),e.content.activeCellIndex=t,S.inViewport?w(S).catch(h=>{console.error(`Fail to scroll to cell to display the required heading (${h}).`)}):e.content.scrollToItem(t,this.scrollToTop?"start":void 0).then(()=>i(S)).then(()=>w(S)).catch(h=>{console.error(`Fail to scroll to cell to display the required heading (${h}).`)})}},p=_=>s.getCellHeadings(_).filter(y=>y.cellRef===_),i=async _=>{var y;const w=p(_),S=(y=this.sanitizer.allowNamedProperties)!==null&&y!==void 0&&y?"id":"data-jupyter-id",o=await Promise.all(w.map(async h=>{const C=await Zo(h,this.parser,this.sanitizer);return C?`h${h.level}[${S}="${CSS.escape(C)}"]`:`h${h.level}`})),t=p(_);t.length!==w.length||t.some((h,C)=>h!==w[C])||(we(_.node),w.forEach((h,C)=>{var k,A;const B=h.outputIndex===void 0?h.cellRef.node:(k=h.cellRef.outputArea.widgets[h.outputIndex])===null||k===void 0?void 0:k.node;a.set(h,B?It(B,o[C],(A=h.prefix)!==null&&A!==void 0?A:""):null)}))},u=_=>{if(this.parser){we(e.content.node),a=new WeakMap;for(const y of e.content.widgets)y instanceof Q&&y.renderedChanged.connect(f);return Promise.all(e.content.widgets.map(y=>i(y)))}},d=(_,y)=>{var w,S,o,t;if(s.configuration.syncCollapseState)if(y!==null){const h=y.cellRef;h.headingCollapsed!==((w=y.collapsed)!==null&&w!==void 0?w:!1)&&(h.headingCollapsed=(S=y.collapsed)!==null&&S!==void 0?S:!1)}else{const h=(t=(o=s.headings[0])===null||o===void 0?void 0:o.collapsed)!==null&&t!==void 0?t:!1;e.content.widgets.forEach(C=>{C instanceof Q&&C.headingInfo.level>=0&&(C.headingCollapsed=h)})}},g=(_,y)=>{if(s.configuration.syncCollapseState){const w=s.getCellHeadings(y)[0];w&&s.toggleCollapse({heading:w,collapsed:y.headingCollapsed})}},b=(_,y)=>{var w;y.inViewport?(w=i(y))===null||w===void 0||w.catch(console.warn):we(y.node)},f=(_,y)=>{y&&i(_).catch(console.warn)};return e.context.ready.then(()=>{var _;(_=u())===null||_===void 0||_.catch(console.warn),s.activeHeadingChanged.connect(l),s.headingsChanged.connect(u),s.collapseChanged.connect(d),e.content.cellCollapsed.connect(g),e.content.cellInViewportChanged.connect(b),e.disposed.connect(()=>{s.activeHeadingChanged.disconnect(l),s.headingsChanged.disconnect(u),s.collapseChanged.disconnect(d),e.content.cellCollapsed.disconnect(g),e.content.cellInViewportChanged.disconnect(b);for(const y of e.content.widgets)y instanceof Q&&y.renderedChanged.disconnect(f)})}),s}getToolbarItems(e){return this.commands?[{name:"select-last-modified-back",widget:new Pe({commands:this.commands,id:"notebook:select-last-modified-cell",args:{toolbar:!0},icon:jt,label:""})},{name:"select-last-modified-forward",widget:new Pe({commands:this.commands,id:"notebook:select-next-modified-cell",args:{toolbar:!0},icon:Rt,label:""})}]:[]}}async function Zo(r,e,n){let s=null;return r.type===We.HeadingType.Markdown?s=await Pt(e,r.raw,r.level,n):r.type===We.HeadingType.HTML&&(s=r.id),s}const en="jp-StatusItem-trust";function tn(r,e){e=e||R;const n=e.load("jupyterlab");return r.trustedCells===r.totalCells?n.__("Notebook trusted: %1 of %2 code cells trusted.",r.trustedCells,r.totalCells):r.activeCellTrusted?n.__("Active cell trusted: %1 of %2 code cells trusted.",r.trustedCells,r.totalCells):n.__("Notebook not trusted: %1 of %2 code cells trusted.",r.trustedCells,r.totalCells)}function on(r){return r.allCellsTrusted?M.createElement(Lt.react,{top:"2px",stylesheet:"statusBar"}):M.createElement(Wt.react,{top:"2px",stylesheet:"statusBar"})}class de extends me{constructor(e){super(new de.Model),this.translator=e||R,this.node.classList.add(en)}render(){if(!this.model)return null;const e=tn(this.model,this.translator);return e!==this.node.title&&(this.node.title=e),M.createElement(on,{allCellsTrusted:this.model.trustedCells===this.model.totalCells,activeCellTrusted:this.model.activeCellTrusted,totalCells:this.model.totalCells,trustedCells:this.model.trustedCells})}}(function(r){class e extends Ce{constructor(){super(...arguments),this._trustedCells=0,this._totalCells=0,this._activeCellTrusted=!1,this._notebook=null}get trustedCells(){return this._trustedCells}get totalCells(){return this._totalCells}get activeCellTrusted(){return this._activeCellTrusted}get notebook(){return this._notebook}set notebook(s){const a=this._notebook;a!==null&&(a.activeCellChanged.disconnect(this._onActiveCellChanged,this),a.modelContentChanged.disconnect(this._onModelChanged,this));const l=this._getAllState();if(this._notebook=s,this._notebook===null)this._trustedCells=0,this._totalCells=0,this._activeCellTrusted=!1;else{this._notebook.activeCellChanged.connect(this._onActiveCellChanged,this),this._notebook.modelContentChanged.connect(this._onModelChanged,this),this._notebook.activeCell?this._activeCellTrusted=this._notebook.activeCell.model.trusted:this._activeCellTrusted=!1;const{total:p,trusted:i}=this._deriveCellTrustState(this._notebook.model);this._totalCells=p,this._trustedCells=i}this._triggerChange(l,this._getAllState())}_onModelChanged(s){const a=this._getAllState(),{total:l,trusted:p}=this._deriveCellTrustState(s.model);this._totalCells=l,this._trustedCells=p,this._triggerChange(a,this._getAllState())}_onActiveCellChanged(s,a){const l=this._getAllState();a?this._activeCellTrusted=a.model.trusted:this._activeCellTrusted=!1,this._triggerChange(l,this._getAllState())}_deriveCellTrustState(s){if(s===null)return{total:0,trusted:0};let a=0,l=0;for(const p of s.cells)p.type==="code"&&(a++,p.trusted&&l++);return{total:a,trusted:l}}_getAllState(){return[this._trustedCells,this._totalCells,this.activeCellTrusted]}_triggerChange(s,a){(s[0]!==a[0]||s[1]!==a[1]||s[2]!==a[2])&&this.stateChanged.emit(void 0)}}r.Model=e})(de||(de={}));const nn=new ot("@jupyterlab/metadataform:IMetadataFormProvider","A service to register new metadata editor widgets."),ln={id:"@jupyterlab/notebook-extension:cell-executor",description:"Provides the notebook cell executor.",autoStart:!0,provides:lt,activate:()=>Object.freeze({runCell:Ht})},sn=new ot("@jupyterlab/logconsole:ILoggerRegistry","A service providing a logger infrastructure."),rn={activate:an,id:"@jupyterlab/notebook-extension:log-output",description:"Adds cell outputs log to the application logger.",requires:[L],optional:[sn],autoStart:!0};function an(r,e,n){if(!n)return;function s(a){function l(p,i,u){if(Y.KernelMessage.isDisplayDataMsg(p)||Y.KernelMessage.isStreamMsg(p)||Y.KernelMessage.isErrorMsg(p)||Y.KernelMessage.isExecuteResultMsg(p)){const d=n.getLogger(a.context.path);d.rendermime=a.content.rendermime;const g={...p.content,output_type:p.header.msg_type};let b=i;(Y.KernelMessage.isErrorMsg(p)||Y.KernelMessage.isStreamMsg(p)&&p.content.name==="stderr")&&(b=u),d.log({type:"output",data:g,level:b})}}a.context.sessionContext.iopubMessage.connect((p,i)=>l(i,"info","info"),a),a.context.sessionContext.unhandledMessage.connect((p,i)=>l(i,"warning","error"),a)}e.forEach(a=>s(a)),e.widgetAdded.connect((a,l)=>s(l))}const dn="jp-ActiveCellTool",cn="jp-ActiveCellTool-Content",un="jp-ActiveCellTool-CellContent";class hn extends q.Tool{constructor(e){super(),this._cellModel=null,this._updateId=0,this._pendingUpdate=!1,this._promptOutdated=!1,this._tracker=e.tracker,this._languages=e.languages,this.addClass(dn),this.layout=new be,this._inputPrompt=new Ft,this.layout.addWidget(this._inputPrompt);const n=document.createElement("div");n.classList.add(cn);const s=n.appendChild(document.createElement("div")),a=s.appendChild(document.createElement("pre"));s.className=un,this._editorEl=a,this.layout.addWidget(new ee({node:n})),this._previewDebouncer=new Kt(()=>this._update(),150),this._tracker.activeCellChanged.connect(this._onActiveCellChanged,this),this._tracker.currentChanged.connect(this._onActiveCellChanged,this),this._onActiveCellChanged()}dispose(){this.isDisposed||(this._tracker.activeCellChanged.disconnect(this._onActiveCellChanged,this),this._tracker.currentChanged.disconnect(this._onActiveCellChanged,this),this._disconnectCellModel(),this._previewDebouncer.dispose(),super.dispose())}render(e){return M.createElement("div",{ref:n=>{!n||this.node.parentElement===n||(n.appendChild(this.node),this._pendingUpdate&&this._update().catch(console.warn))}})}_onActiveCellChanged(){var e,n;const s=(n=(e=this._tracker.activeCell)===null||e===void 0?void 0:e.model)!==null&&n!==void 0?n:null;s!==this._cellModel&&(this._disconnectCellModel(),this._cellModel=s,s&&(s.sharedModel.changed.connect(this._onCellContentChanged,this),s.mimeTypeChanged.connect(this._onCellContentChanged,this)),this._promptOutdated=!0,this._update().catch(console.warn))}_onCellContentChanged(){if(!this.node.isConnected){this._pendingUpdate=!0,this._promptOutdated=!0;return}this._promptOutdated||this._updatePrompt(),this._previewDebouncer.invoke().catch(console.warn)}_disconnectCellModel(){const e=this._cellModel;e&&(e.sharedModel.changed.disconnect(this._onCellContentChanged,this),e.mimeTypeChanged.disconnect(this._onCellContentChanged,this),this._cellModel=null)}_updatePrompt(){var e;const n=this._cellModel;n&&Vt(n)?(this._inputPrompt.executionCount=`${(e=n.executionCount)!==null&&e!==void 0?e:""}`,this._inputPrompt.show()):(this._inputPrompt.executionCount=null,this._inputPrompt.hide())}async _update(){if(!this.node.isConnected){this._pendingUpdate=!0;return}this._pendingUpdate=!1;const e=this._cellModel,n=++this._updateId;if(!e){this._promptOutdated=!1,this._updatePrompt(),this._editorEl.replaceChildren();return}const s=e.sharedModel.getSource(),a=s.indexOf(`
|
|
2
2
|
`),l=a===-1?s:s.slice(0,a),p=document.createElement("pre");try{await this._languages.highlight(l,this._languages.findByMIME(e.mimeType),p)}catch(u){console.warn(u),p.replaceChildren(document.createTextNode(l))}if(n!==this._updateId)return;this._promptOutdated&&(this._updatePrompt(),this._promptOutdated=!1);const i=document.createDocumentFragment();for(;p.firstChild;)i.appendChild(p.firstChild);this._editorEl.replaceChildren(i)}}const pn="jp-CellMetadataEditor",gn="jp-NotebookMetadataEditor";class mn extends q.MetadataEditorTool{constructor(e){super(e),this._tracker=e.tracker,this.editor.editorHostNode.addEventListener("blur",this.editor,!0),this.editor.editorHostNode.addEventListener("click",this.editor,!0),this.editor.headerNode.addEventListener("click",this.editor)}_onSourceChanged(){var e,n,s;const a=(e=this._tracker.activeCell)===null||e===void 0?void 0:e.model.sharedModel;if(a&&this.editor.source){const l=Object.keys((n=a.metadata)!==null&&n!==void 0?n:{}),p=(s=this.editor.source.toJSON())!==null&&s!==void 0?s:{};a.transact(()=>{l.forEach(i=>a.deleteMetadata(i)),a.setMetadata(p)})}}render(e){var n;const s=this._tracker.activeCell,a=this.editor.source;return this.editor.source=s?new ge({values:s.model.metadata}):null,a?.dispose(),(n=this.editor.source)===null||n===void 0||n.changed.connect(this._onSourceChanged,this),M.createElement("div",{className:pn},M.createElement("div",{ref:l=>l?.appendChild(this.node)}))}}class Cn extends q.MetadataEditorTool{constructor(e){super(e),this._tracker=e.tracker,this.editor.editorHostNode.addEventListener("blur",this.editor,!0),this.editor.editorHostNode.addEventListener("click",this.editor,!0),this.editor.headerNode.addEventListener("click",this.editor)}_onSourceChanged(){var e,n;this.editor.source&&((n=(e=this._tracker.currentWidget)===null||e===void 0?void 0:e.model)===null||n===void 0||n.sharedModel.setMetadata(this.editor.source.toJSON()))}render(e){var n,s;const a=this._tracker.currentWidget,l=this.editor.source;return this.editor.source=a?new ge({values:(n=a.model)===null||n===void 0?void 0:n.metadata}):null,l?.dispose(),(s=this.editor.source)===null||s===void 0||s.changed.connect(this._onSourceChanged,this),M.createElement("div",{className:gn},M.createElement("div",{ref:p=>p?.appendChild(this.node)}))}}var c;(function(r){r.createNew="notebook:create-new",r.interrupt="notebook:interrupt-kernel",r.restart="notebook:restart-kernel",r.restartClear="notebook:restart-clear-output",r.restartAndRunToSelected="notebook:restart-and-run-to-selected",r.restartRunAll="notebook:restart-run-all",r.reconnectToKernel="notebook:reconnect-to-kernel",r.changeKernel="notebook:change-kernel",r.getKernel="notebook:get-kernel",r.createConsole="notebook:create-console",r.createSubshellConsole="notebook:create-subshell-console",r.createOutputView="notebook:create-output-view",r.clearAllOutputs="notebook:clear-all-cell-outputs",r.shutdown="notebook:shutdown-kernel",r.closeAndShutdown="notebook:close-and-shutdown",r.trust="notebook:trust",r.exportToFormat="notebook:export-to-format",r.run="notebook:run-cell",r.runAndAdvance="notebook:run-cell-and-select-next",r.runAndInsert="notebook:run-cell-and-insert-below",r.runInConsole="notebook:run-in-console",r.runAll="notebook:run-all-cells",r.runAllAbove="notebook:run-all-above",r.runAllBelow="notebook:run-all-below",r.renderAllMarkdown="notebook:render-all-markdown",r.toCode="notebook:change-cell-to-code",r.toMarkdown="notebook:change-cell-to-markdown",r.toRaw="notebook:change-cell-to-raw",r.cut="notebook:cut-cell",r.copy="notebook:copy-cell",r.pasteAbove="notebook:paste-cell-above",r.pasteBelow="notebook:paste-cell-below",r.duplicateBelow="notebook:duplicate-below",r.pasteAndReplace="notebook:paste-and-replace-cell",r.moveUp="notebook:move-cell-up",r.moveDown="notebook:move-cell-down",r.clearOutputs="notebook:clear-cell-output",r.deleteCell="notebook:delete-cell",r.insertAbove="notebook:insert-cell-above",r.insertBelow="notebook:insert-cell-below",r.selectAbove="notebook:move-cursor-up",r.selectBelow="notebook:move-cursor-down",r.selectHeadingAboveOrCollapse="notebook:move-cursor-heading-above-or-collapse",r.selectHeadingBelowOrExpand="notebook:move-cursor-heading-below-or-expand",r.insertHeadingAbove="notebook:insert-heading-above",r.insertHeadingBelow="notebook:insert-heading-below",r.extendAbove="notebook:extend-marked-cells-above",r.extendTop="notebook:extend-marked-cells-top",r.extendBelow="notebook:extend-marked-cells-below",r.extendBottom="notebook:extend-marked-cells-bottom",r.selectAll="notebook:select-all",r.deselectAll="notebook:deselect-all",r.editMode="notebook:enter-edit-mode",r.merge="notebook:merge-cells",r.mergeAbove="notebook:merge-cell-above",r.mergeBelow="notebook:merge-cell-below",r.split="notebook:split-cell-at-cursor",r.commandMode="notebook:enter-command-mode",r.toggleAllLines="notebook:toggle-all-cell-line-numbers",r.undoCellAction="notebook:undo-cell-action",r.redoCellAction="notebook:redo-cell-action",r.redo="notebook:redo",r.undo="notebook:undo",r.markdown1="notebook:change-cell-to-heading-1",r.markdown2="notebook:change-cell-to-heading-2",r.markdown3="notebook:change-cell-to-heading-3",r.markdown4="notebook:change-cell-to-heading-4",r.markdown5="notebook:change-cell-to-heading-5",r.markdown6="notebook:change-cell-to-heading-6",r.hideCode="notebook:hide-cell-code",r.showCode="notebook:show-cell-code",r.hideAllCode="notebook:hide-all-cell-code",r.showAllCode="notebook:show-all-cell-code",r.hideOutput="notebook:hide-cell-outputs",r.showOutput="notebook:show-cell-outputs",r.toggleOutput="notebook:toggle-cell-outputs",r.hideAllOutputs="notebook:hide-all-cell-outputs",r.showAllOutputs="notebook:show-all-cell-outputs",r.toggleRenderSideBySideCurrentNotebook="notebook:toggle-render-side-by-side-current",r.setSideBySideRatio="notebook:set-side-by-side-ratio",r.enableOutputScrolling="notebook:enable-output-scrolling",r.disableOutputScrolling="notebook:disable-output-scrolling",r.toggleOutputScrolling="notebook:toggle-output-scrolling",r.selectLastRunCell="notebook:select-last-run-cell",r.selectLastModifiedCell="notebook:select-last-modified-cell",r.selectNextModifiedCell="notebook:select-next-modified-cell",r.replaceSelection="notebook:replace-selection",r.autoClosingBrackets="notebook:toggle-autoclosing-brackets",r.toggleCollapseCmd="notebook:toggle-heading-collapse",r.collapseAllCmd="notebook:collapse-all-headings",r.expandAllCmd="notebook:expand-all-headings",r.copyToClipboard="notebook:copy-to-clipboard",r.invokeCompleter="completer:invoke-notebook",r.selectCompleter="completer:select-notebook",r.tocRunCells="toc:run-cells",r.accessPreviousHistory="notebook:access-previous-history-entry",r.accessNextHistory="notebook:access-next-history-entry",r.virtualScrollbar="notebook:toggle-virtual-scrollbar",r.copySelectedtext="notebook:copy-selected-text",r.pasteText="notebook:paste-text",r.cutSelectedtext="notebook:cut-selected-text"})(c||(c={}));const D="Notebook",bn=["notebook","python","custom"],fn="@jupyterlab/notebook-extension:panel",Ve="jp-NotebookExtension-sideBySideMargins",te={id:"@jupyterlab/notebook-extension:tracker",description:"Provides the notebook widget tracker.",provides:L,requires:[st,uo,lt],optional:[$e,mo,Co,at,dt,bo,_e,Je,F,Ee,rt],activate:qn,autoStart:!0},vn={id:"@jupyterlab/notebook-extension:factory",description:"Provides the notebook and cell factory.",provides:Se.IContentFactory,requires:[fe],autoStart:!0,activate:(r,e)=>{const n=e.factoryService.newInlineEditor;return new Se.ContentFactory({editorFactory:n})}},_n={activate:Hn,provides:go,id:"@jupyterlab/notebook-extension:tools",description:"Provides the notebook tools.",autoStart:!0,requires:[L,fe,it,Ut.IStateDB,F],optional:[po]},yn={id:"@jupyterlab/notebook-extension:mode-status",description:"Adds a notebook mode status widget.",autoStart:!0,requires:[L,F],optional:[ve],activate:(r,e,n,s)=>{if(!s)return;const{shell:a}=r,l=new ae(n);e.currentChanged.connect(()=>{const p=e.currentWidget;l.model.notebook=p&&p.content}),s.registerStatusItem("@jupyterlab/notebook-extension:mode-status",{priority:1,item:l,align:"right",rank:4,isActive:()=>!!a.currentWidget&&!!e.currentWidget&&a.currentWidget===e.currentWidget})}},ct={id:"@jupyterlab/notebook-extension:cell-counter-status",description:"Adds a notebook cell counter status widget.",autoStart:!0,requires:[L,F],optional:[ve],activate:(r,e,n,s)=>{if(!s)return;const{shell:a}=r,l=new re({translator:n}),p=()=>{const i=e.currentWidget;l.model.notebook=i&&i.content};e.currentChanged.connect(p),p(),s.registerStatusItem(ct.id,{priority:1,item:l,align:"right",rank:2.5,isActive:()=>!!a.currentWidget&&!!e.currentWidget&&a.currentWidget===e.currentWidget})}},xn={id:"@jupyterlab/notebook-extension:execution-indicator",description:"Adds a notebook execution status widget.",autoStart:!0,requires:[L,fo,F],optional:[ve,_e],activate:(r,e,n,s,a,l)=>{let p,i,u;const d=g=>{var b,f;let{showOnToolBar:_,showProgress:y,showJumpToCell:w}=g;if(_)u&&(n.currentChanged.disconnect(i),u.dispose());else{if(!a)return;p?.model||(p=new X(s),i=(S,o)=>{const{newValue:t}=o;if(t&&e.has(t)){const h=t;p.model.attachNotebook({content:h.content,context:h.sessionContext})}},u=a.registerStatusItem("@jupyterlab/notebook-extension:execution-indicator",{item:p,align:"left",rank:3,isActive:()=>{const S=n.currentWidget;return!!S&&e.has(S)}}),p.model.attachNotebook({content:(b=e.currentWidget)===null||b===void 0?void 0:b.content,context:(f=e.currentWidget)===null||f===void 0?void 0:f.sessionContext}),n.currentChanged.connect(i),p.disposed.connect(()=>{n.currentChanged.disconnect(i)})),p.model.displayOption={showOnToolBar:_,showProgress:y,showJumpToCell:w}}};if(l){const g=l.load(te.id);Promise.all([g,r.restored]).then(([b])=>{d(X.getSettingValue(b)),b.changed.connect(f=>d(X.getSettingValue(f)))}).catch(b=>{console.error(b.message)})}}},wn={id:"@jupyterlab/notebook-extension:export",description:"Adds the export notebook commands.",autoStart:!0,requires:[F,L],optional:[dt,$e],activate:(r,e,n,s,a)=>{var l;const p=e.load("jupyterlab"),{commands:i,shell:u}=r,d=r.serviceManager,g=()=>H.isEnabled(u,n);i.addCommand(c.exportToFormat,{label:y=>{if(y.label===void 0)return p.__("Save and Export Notebook to the given `format`.");const w=y.label;return y.isPalette?p.__("Save and Export Notebook: %1",w):w},execute:async y=>{var w,S,o;const t=m(n,u,y);if(!t)return;const{context:h}=t,C=pe.PageConfig.getNotebookVersion(),k=pe.compareVersions(C,[4,0,0])<0&&pe.compareVersions(C,[2,18,0])>=0;let A=!1;if(y.format==="html"&&k){const E=await Ge.getBoolean({title:p.__("Export as HTML"),label:p.__("Sanitize HTML output"),value:!0});if(!E.button.accept)return;A=(w=E.value)!==null&&w!==void 0?w:!1}const B={format:y.format,path:t.context.path,exporterOptions:{download:!0,sanitizeHtml:A}};return h.model.dirty&&!h.model.readOnly&&await h.save(),(o=(S=d.nbconvert).exportAs)===null||o===void 0?void 0:o.call(S,B)},isEnabled:g,describedBy:{args:{type:"object",properties:{format:{type:"string",description:p.__("The export format (e.g., pdf, html, latex)")},label:{type:"string",description:p.__("The label to display for this format")},isPalette:{type:"boolean",description:p.__("Whether the command is called from the command palette")}},required:["format"]}}});let b;s&&(b=(l=s.fileMenu.items.find(y=>{var w;return y.type==="submenu"&&((w=y.submenu)===null||w===void 0?void 0:w.id)==="jp-mainmenu-file-notebookexport"}))===null||l===void 0?void 0:l.submenu);let f=!1;const _=async()=>{if(f)return;n.widgetAdded.disconnect(_),f=!0;const y=await d.nbconvert.getExportFormats(!1);if(!y)return;const w=H.getFormatLabels(e);Object.keys(y).forEach(function(o){const t=o[0].toLocaleUpperCase()+o.slice(1),h=p.__(t),C=w[o]?w[o]:h;let k={format:o,label:C,isPalette:!1};if(bn.indexOf(o)===-1&&(b&&b.addItem({command:c.exportToFormat,args:k}),a)){k={format:o,label:C,isPalette:!0};const A=p.__("Notebook Operations");a.addItem({command:c.exportToFormat,category:A,args:k})}})};n.widgetAdded.connect(_)}},kn={id:"@jupyterlab/notebook-extension:trust-status",description:"Adds the notebook trusted status widget.",autoStart:!0,requires:[L,F],optional:[ve],activate:(r,e,n,s)=>{if(!s)return;const{shell:a}=r,l=new de(n);e.currentChanged.connect(()=>{const p=e.currentWidget;l.model.notebook=p&&p.content}),s.registerStatusItem("@jupyterlab/notebook-extension:trust-status",{item:l,align:"right",rank:3,isActive:()=>!!a.currentWidget&&!!e.currentWidget&&a.currentWidget===e.currentWidget})}},Sn={id:"@jupyterlab/notebook-extension:widget-factory",description:"Provides the notebook widget factory.",provides:st,requires:[Se.IContentFactory,fe,vo,pt],optional:[_e,Je,F],activate:Fn,autoStart:!0},An={id:"@jupyterlab/notebook-extension:cloned-outputs",description:"Adds the clone output feature.",requires:[yo,L,F],optional:[at],activate:Kn,autoStart:!0},Mn={id:"@jupyterlab/notebook-extension:code-console",description:"Adds the notebook code consoles features.",requires:[L,F],activate:Vn,autoStart:!0},Tn={id:"@jupyterlab/notebook-extension:copy-output",description:"Adds the copy cell outputs feature.",activate:Un,requires:[F,L],autoStart:!0},Bn={id:"@jupyterlab/notebook-extension:kernel-status",description:"Adds the notebook kernel status.",activate:(r,e,n)=>{const s=a=>{let l=null;return a&&e.has(a)?a.sessionContext:l};n.addSessionProvider(s)},requires:[L,gt],autoStart:!0},En={id:"@jupyterlab/notebook-extension:cursor-position",description:"Adds the notebook cursor position status.",activate:(r,e,n)=>{let s=null;const a=async l=>{let p=null;if(l!==s){if(s?.content.activeCellChanged.disconnect(n.update),s=null,l&&e.has(l)){l.content.activeCellChanged.connect(n.update);const i=l.content.activeCell;p=null,i&&(await i.ready,p=i.editor),s=l}}else if(l){const i=l.content.activeCell;p=null,i&&(await i.ready,p=i.editor)}return p};n.addEditorProvider(a)},requires:[L,qt],autoStart:!0},Nn={id:"@jupyterlab/notebook-extension:completer",description:"Adds the code completion capability to notebooks.",requires:[L],optional:[xo,F,ze],activate:Dn,autoStart:!0},On={id:"@jupyterlab/notebook-extension:search",description:"Adds search capability to notebooks.",requires:[wo],autoStart:!0,activate:(r,e)=>{e.add("jp-notebookSearchProvider",Qt)}},jn={id:"@jupyterlab/notebook-extension:toc",description:"Adds table of content capability to the notebooks",requires:[L,Dt,ze],optional:[_o,_e],autoStart:!0,activate:(r,e,n,s,a,l)=>{const p=new Qo(e,a,s,r.commands);n.add(p),l&&Promise.all([r.restored,l.load(te.id)]).then(([i,u])=>{const d=()=>{var g;p.scrollToTop=(g=u.composite.scrollHeadingToTop)!==null&&g!==void 0?g:!0};d(),u.changed.connect(d)}).catch(i=>{console.error("Failed to load notebook table of content settings.",i)})}},Rn={id:"@jupyterlab/notebook-extension:language-server",description:"Adds language server capability to the notebooks.",requires:[L,Ao,Mo,To,Bo],activate:$n,autoStart:!0},In={id:"@jupyterlab/notebook-extension:update-raw-mimetype",description:"Adds metadata form editor for raw cell mimetype.",autoStart:!0,requires:[L,nn,F],activate:(r,e,n,s)=>{const a=s.load("jupyterlab");let l=!1;async function p(){if(l||!n.get("commonToolsSection"))return;const i=n.get("commonToolsSection").getProperties("/raw_mimetype");if(!i)return;e.widgetAdded.disconnect(p),l=!0;const d=await r.serviceManager.nbconvert.getExportFormats(!1);if(!d)return;const g=Object.keys(d),b=H.getFormatLabels(s);g.forEach(function(f){var _;if(!(((_=i.oneOf)===null||_===void 0?void 0:_.filter(w=>w.const===f).length)>0)){const w=f[0].toLocaleUpperCase()+f.slice(1),S=a.__(w),o=b[f]?b[f]:S,t=d[f].output_mimetype;i.oneOf.push({const:t,title:o})}}),n.get("commonToolsSection").setProperties("/raw_mimetype",i)}e.widgetAdded.connect(p)}},Pn={id:"@jupyterlab/notebook-extension:metadata-editor",description:"Adds metadata form for full metadata editor.",autoStart:!0,requires:[L,fe,Ee],optional:[F],activate:(r,e,n,s,a)=>{const l=g=>n.factoryService.newInlineEditor(g),p=new mn({editorFactory:l,tracker:e,label:"Cell metadata",translator:a}),i={fieldRenderer:g=>p.render(g)};s.addRenderer("@jupyterlab/notebook-extension:metadata-editor.cell-metadata",i);const u=new Cn({editorFactory:l,tracker:e,label:"Notebook metadata",translator:a}),d={fieldRenderer:g=>u.render(g)};s.addRenderer("@jupyterlab/notebook-extension:metadata-editor.notebook-metadata",d)}},Ln={id:"@jupyterlab/notebook-extension:active-cell-tool",description:"Adds active cell field in the metadata editor tab.",autoStart:!0,requires:[L,Ee,it],activate:(r,e,n,s)=>{const a=new hn({tracker:e,languages:s}),l={fieldRenderer:p=>a.render(p)};n.addRenderer("@jupyterlab/notebook-extension:active-cell-tool.renderer",l)}},Wn={id:"@jupyterlab/notebook-extension:open-with-no-kernel",description:'Adds the "Notebook (no kernel)" option to the Open With menu.',requires:[rt],optional:[F],autoStart:!0,activate:(r,e,n)=>{const{tracker:s}=e,a=(n??R).load("jupyterlab"),l=[];function p(i){var u,d;l.forEach(_=>_.dispose()),l.length=0;const g=(d=(u=i.menu.items.find(_=>{var y;return _.type==="submenu"&&((y=_.submenu)===null||y===void 0?void 0:y.id)==="jp-contextmenu-open-with"}))===null||u===void 0?void 0:u.submenu)!==null&&d!==void 0?d:null;if(!g)return;(s.currentWidget?Array.from(s.currentWidget.selectedItems()):[]).some(_=>_.type==="notebook")&&l.push(g.addItem({command:"filebrowser:open",args:{label:a.__("Notebook (no kernel)"),factory:D,kernelPreference:{shouldStart:!1,shouldReuse:!1}}}))}r.contextMenu.opened.connect(p)}},cl=[ln,vn,te,xn,wn,_n,ct,yn,kn,Sn,rn,An,Mn,Tn,Bn,En,Nn,On,jn,Rn,In,Pn,Ln,Wn];function Hn(r,e,n,s,a,l,p){const i=l.load("jupyterlab"),u="notebook-tools",d=new q({tracker:e,translator:l}),g=(b,f)=>{switch(f.type){case"activate-request":a.save(u,{open:!0});break;case"after-hide":case"close-request":a.remove(u);break}return!0};return d.title.icon=Jt,d.title.dataset={...d.title.dataset,jpTabLabel:i.__("Notebook Tools")},d.title.caption=i.__("Notebook Tools"),d.id=u,G.installMessageHook(d,g),p&&e.widgetAdded.connect((b,f)=>{p.register(f).render(d)}),d}function Fn(r,e,n,s,a,l,p,i){const u=i??R,d=p??new Be({translator:u}),g=pe.PageConfig.getOption("notebookStartsKernel"),b=g===""||g.toLowerCase()==="true",{commands:f}=r;let _;a.addFactory(D,"save",S=>ho.createSaveButton(f,S.context.fileChanged)),a.addFactory(D,"cellType",S=>Ae.createCellTypeItem(S,u)),a.addFactory(D,"kernelName",S=>he.createKernelNameItem(S.sessionContext,d,u)),a.addFactory(D,"executionProgress",S=>{const o=l?.load(te.id),t=X.createExecutionIndicatorItem(S,u,o);return o?.then(h=>{S.disposed.connect(()=>{h.dispose()})}),t}),l&&(_=zt(a,l,D,fn,u));const y=u.load("jupyterlab"),w=new jo({name:D,label:y.__("Notebook"),fileTypes:["notebook"],modelName:"notebook",defaultFor:["notebook"],preferKernel:b,canStartKernel:!0,rendermime:s,contentFactory:e,editorConfig:se.defaultEditorConfig,notebookConfig:se.defaultNotebookConfig,mimeTypeService:n.mimeTypeService,toolbarFactory:_,translator:u});return r.docRegistry.addWidgetFactory(w),w}function Kn(r,e,n,s,a){const l=s.load("jupyterlab"),p=new Gt({namespace:"cloned-outputs"});a&&a.restore(p,{command:c.createOutputView,args:g=>({path:g.content.path,index:g.content.index}),name:g=>`${g.content.path}:${g.content.index}`,when:n.restored});const{commands:i,shell:u}=r,d=()=>H.isEnabledAndSingleSelected(u,n);i.addCommand(c.createOutputView,{label:l.__("Create New View for Cell Output"),execute:async g=>{var b;let f,_;const y=g.path;let w=g.index;if(y&&w!==void 0&&w!==null){if(_=e.findWidget(y,D),!_)return}else{if(_=n.currentWidget,!_)return;f=_.content.activeCell,w=_.content.activeCellIndex}const S=new H.ClonedOutputArea({notebook:_,cell:f,index:w,translator:s}),o=new Yt({content:S});_.context.addSibling(o,{ref:_.id,mode:"split-bottom",type:"Cloned Output"});const t=()=>{p.save(o)};_.context.pathChanged.connect(t),(b=_.context.model)===null||b===void 0||b.cells.changed.connect(t),p.add(o),_.content.disposed.connect(()=>{var h;_.context.pathChanged.disconnect(t),(h=_.context.model)===null||h===void 0||h.cells.changed.disconnect(t),o.dispose()})},isEnabled:d,describedBy:{args:{type:"object",properties:{path:{type:"string",description:l.__("The path to the notebook containing the cell")},index:{type:"number",description:l.__("The index of the cell to create an output view for")}}}}})}function Vn(r,e,n){const s=n.load("jupyterlab"),{commands:a,shell:l}=r,p=()=>H.isEnabled(l,e);a.addCommand(c.createConsole,{label:s.__("New Console for Notebook"),execute:i=>{const u=e.currentWidget;if(u)return H.createConsole(a,u,i.activate)},isEnabled:p,describedBy:{args:{type:"object",properties:{activate:{type:"boolean",description:s.__("Whether to activate the console after creation")}}}}}),a.addCommand(c.createSubshellConsole,{label:s.__("New Subshell Console for Notebook"),execute:i=>{const u=e.currentWidget;if(u)return H.createConsole(a,u,i.activate,!0)},isEnabled:p,isVisible:()=>{var i,u,d;const g=(u=(i=e.currentWidget)===null||i===void 0?void 0:i.context.sessionContext.session)===null||u===void 0?void 0:u.kernel;return(d=g?.supportsSubshells)!==null&&d!==void 0?d:!1},describedBy:{args:{type:"object",properties:{activate:{type:"boolean",description:s.__("Whether to activate the console after creation")}}}}}),a.addCommand(c.runInConsole,{label:s.__("Run Selected Text or Current Line in Console"),execute:async i=>{var u,d;const g=e.currentWidget;if(!g)return;const{context:b,content:f}=g,_=f.activeCell,y=_?.model.metadata,w=b.path;if(!_||_.model.type!=="code")return;let S;const o=_.editor;if(!o)return;const t=o.getSelection(),{start:h,end:C}=t;if(h.column!==C.column||h.line!==C.line){const A=o.getOffsetAt(t.start),B=o.getOffsetAt(t.end);S=o.model.sharedModel.getSource().substring(A,B)}else{const A=o.getCursorPosition(),B=o.model.sharedModel.getSource().split(`
|
|
3
3
|
`);let E=t.start.line;for(;E<o.lineCount&&!B[E].replace(/\s/g,"").length;)E+=1;let j=E>0,K=0,W=K+1;for(;;){S=B.slice(K,W).join(`
|
|
4
4
|
`);const oe=await((d=(u=g.context.sessionContext.session)===null||u===void 0?void 0:u.kernel)===null||d===void 0?void 0:d.requestIsComplete({code:S+`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as j,dB as Z,dC as X,cm as B,a9 as ee,aD as T,ci as te,J as k,ce as oe,az as I,dw as V,aC as x,dD as re,dE as H,cd as v,dF as ie,dG as N,dH as ne,dI as O,dv as ae,aG as se,co as le,cl as L,dJ as E,dK as de,dL as ce,dM as pe,dN as ue,dO as he,cj as me,dP as fe,dQ as ge,dR as we,dS as be,dT as ye,dU as _e,dV as ve,dx as A}from"../datalayer-app-main.js";import{T as R,G as Fe,e as xe,b as U,I as Ce,f as q}from"./index-DWdhqvRC.js";import{I as Be}from"./tokens-Dyd4wiX6.js";import{h as ke,e as Pe,J as Se,c as D,f as Te,k as Ie,F as je,l as Ne}from"./index-B09D9j_V.js";import{I as G}from"./tokens-Nkg3e_k9.js";import{a as C,b as We,I as P,c as J}from"./tokens-DbNnxPrX.js";import{I as M}from"./tokens-DY_UrMLq.js";import{I as Me}from"./treepathupdater-DiwXSt-s.js";import{g as Oe}from"./kernelfilestypes-D2B-sFfi.js";import"./hoverbox-CStlKQWE.js";import"./Output-CxP7dwY_.js";import"./index-BPBZr639.js";import"./index-BYGVk1jo.js";import"./dayjs.min-u3zuoSR8.js";import"./isEqual-BqptHyYZ.js";import"./d3-color-Jd8hXty2.js";import"./dist-BrUAt6vF.js";import"./KebabHorizontalIcon-D6AY8pIS.js";import"./PaintbrushIcon-CFBHU-3l.js";import"./index-CKWSKbHe.js";import"./RestartIcon-DvpOf5Mf.js";import"./CellSidebarExtension-CwU9KIEf.js";import"./NotebookSkeleton-BaU6vrsb.js";import"./Avatar-Cv5OpUWu.js";import"./renderer-C8LttmYX.js";import"./SquareIcon-Dy3l3VdH.js";import"./FileDirectoryOpenFillIcon-jGhuRcP3.js";import"./url-C6fJII94.js";/* empty css *//* empty css */import"./style-DdAxk_bj.js";/* empty css */import"./style-Cj1gzCjo.js";/* empty css */import"./style-rkw8dR9f.js";import"./style-GHJFdtIz.js";import"./style-ZSIOeMoX.js";import"./style-iVfD6mFL.js";import"./style-DA-Ya7rp.js";import"./style-D3tvWcFO.js";import"./style-BOqStzF9.js";import"./style-ADLQJ-E9.js";import"./style-DgglluaK.js";import"./ArrowLeftIcon-sX3iNMG1.js";import"./SkubbleIcon-CAaVh_BE.js";import"./usePrimerThemeBridge-NsTRGuo7.js";import"./index-DT7EdeIs.js";import"./KernelVariables-Cyr5X_pI.js";import"./index-C0d-d3s4.js";import"./SortAscIcon-CmH04s3F.js";import"./SortDescIcon-Qif6E10I.js";import"./NotebookToolbar-CO_qaXBp.js";import"./RepoPushIcon-BtXQRhLa.js";import"./Toolbar-ByUGXe7J.js";import"./sessions-C-AH_Lec.js";import"./tokens-CTXFWLvM.js";import"./drivecontents-BsC6Y2Vl.js";import"./kernel-BmfZmtIo.js";function Le(o){const{width:a,percentage:h,...p}=o;return j.createElement("div",{className:"jp-Statusbar-ProgressBar-progress-bar",role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":h},j.createElement(Ue,{percentage:h,...p,contentWidth:a}))}function Ue(o){return j.createElement("div",{style:{width:`${o.percentage}%`}},j.createElement("p",null,o.content))}class K extends Z{constructor(a){super({icon:X,label:a.label,onClick:()=>{this._input.click()},tooltip:W.translateToolTip(a.translator),enabled:a.model.allowFileUploads}),this._onInputChanged=()=>{const p=Array.prototype.slice.call(this._input.files).map(r=>this.fileBrowserModel.upload(r));Promise.all(p).then(r=>{this._filesUploaded.emit(r)}).catch(r=>{B(this._trans._p("showErrorMessage","Upload Error"),r)})},this._onInputClicked=()=>{this._input.value=""},this._input=W.createUploadInput(),this._filesUploaded=new ee(this),this.fileBrowserModel=a.model,this.translator=a.translator||T,this._trans=this.translator.load("jupyterlab"),this._input.onclick=this._onInputClicked,this._input.onchange=this._onInputChanged,this.addClass("jp-id-upload")}get filesUploaded(){return this._filesUploaded}}var W;(function(o){function a(){const p=document.createElement("input");return p.type="file",p.multiple=!0,p}o.createUploadInput=a;function h(p){return p=p||T,p.load("jupyterlab").__("Upload Files")}o.translateToolTip=h})(W||(W={}));const Ee=4;function z(o){const h=(o.translator||T).load("jupyterlab");return k.createElement(Fe,{spacing:Ee},k.createElement(R,{source:h.__("Uploading…")}),k.createElement(Le,{percentage:o.upload}))}const Ae=2e3;class S extends te{constructor(a){super(new S.Model(a.tracker.currentWidget&&a.tracker.currentWidget.model)),this._onBrowserChange=(h,p)=>{p===null?this.model.browserModel=null:this.model.browserModel=p.model},this.translator=a.translator||T,this._trans=this.translator.load("jupyterlab"),this._tracker=a.tracker,this._tracker.currentChanged.connect(this._onBrowserChange)}render(){return this.model.items.length>0?this.model.items[0].complete?k.createElement(R,{source:this._trans.__("Complete!")}):k.createElement(z,{upload:this.model.items[0].progress,translator:this.translator}):k.createElement(z,{upload:100,translator:this.translator})}dispose(){super.dispose(),this._tracker.currentChanged.disconnect(this._onBrowserChange)}}(function(o){class a extends oe{constructor(p){super(),this._uploadChanged=(r,s)=>{if(s.name==="start")this._items.push({path:s.newValue.path,progress:s.newValue.progress*100,complete:!1});else if(s.name==="update"){const t=I.findFirstIndex(this._items,c=>c.path===s.oldValue.path);t!==-1&&(this._items[t].progress=s.newValue.progress*100)}else if(s.name==="finish"){const t=I.findFirstValue(this._items,c=>c.path===s.oldValue.path);t&&(t.complete=!0,setTimeout(()=>{I.removeFirstOf(this._items,t),this.stateChanged.emit(void 0)},Ae))}else if(s.name==="failure")I.removeFirstWhere(this._items,t=>t.path===s.newValue.path);else return;this.stateChanged.emit(void 0)},this._items=[],this._browserModel=null,this.browserModel=p}get items(){return this._items}get browserModel(){return this._browserModel}set browserModel(p){const r=this._browserModel;r&&r.uploadChanged.disconnect(this._uploadChanged),this._browserModel=p,this._items=[],this._browserModel!==null&&this._browserModel.uploadChanged.connect(this._uploadChanged),this.stateChanged.emit(void 0)}}o.Model=a})(S||(S={}));const $="FileBrowser",_="@jupyterlab/filebrowser-extension:browser";var u;(function(o){o.copy="filebrowser:copy",o.copyDownloadLink="filebrowser:copy-download-link",o.cut="filebrowser:cut",o.del="filebrowser:delete",o.download="filebrowser:download",o.duplicate="filebrowser:duplicate",o.selectAll="filebrowser:select-all",o.hideBrowser="filebrowser:hide-main",o.goToPath="filebrowser:go-to-path",o.goUp="filebrowser:go-up",o.openPath="filebrowser:open-path",o.openUrl="filebrowser:open-url",o.open="filebrowser:open",o.openBrowserTab="filebrowser:open-browser-tab",o.paste="filebrowser:paste",o.createNewDirectory="filebrowser:create-new-directory",o.createNewFile="filebrowser:create-new-file",o.createNewMarkdownFile="filebrowser:create-new-markdown-file",o.refresh="filebrowser:refresh",o.rename="filebrowser:rename",o.copyShareableLink="filebrowser:share-main",o.copyPath="filebrowser:copy-path",o.showBrowser="filebrowser:activate",o.shutdown="filebrowser:shutdown",o.toggleBrowser="filebrowser:toggle-main",o.toggleFileFilter="filebrowser:toggle-file-filter",o.toggleNavigateToCurrentDirectory="filebrowser:toggle-navigate-to-current-directory",o.toggleLastModified="filebrowser:toggle-last-modified",o.toggleShowFullPath="filebrowser:toggle-show-full-path",o.toggleDateCreated="filebrowser:toggle-date-created",o.toggleFileSize="filebrowser:toggle-file-size",o.toggleSortNotebooksFirst="filebrowser:toggle-sort-notebooks-first",o.toggleHiddenFiles="filebrowser:toggle-hidden-files",o.toggleSingleClick="filebrowser:toggle-single-click-navigation",o.toggleFileCheckboxes="filebrowser:toggle-file-checkboxes",o.editPath="filebrowser:edit-path"})(u||(u={}));const Y="filebrowser",ze={id:_,description:"Set up the default file browser commands and state restoration",requires:[P,C,x],optional:[Te,M,Me,U],provides:J,autoStart:!0,activate:async(o,a,h,p,r,s,t,c)=>{const i=a;r&&r.add(i,Y);const d=v.PageConfig.getOption("preferredPath");return d&&await i.model.cd(d),Ze(o,i,h,p,s,c),Promise.all([o.restored,i.model.restored]).then(()=>{t&&i.model.pathChanged.connect((f,e)=>{t(e.newValue)})}),{openPath:u.openPath}}},$e={id:"@jupyterlab/filebrowser-extension:settings",description:"Set up the default file browser settings",requires:[P],optional:[M],autoStart:!0,activate:(o,a,h)=>{h&&h.load(_).then(p=>{const r={navigateToCurrentDirectory:!1,singleClickNavigation:!1,showLastModifiedColumn:!0,showDateCreatedColumn:!1,showFileSizeColumn:!1,showHiddenFiles:!1,showFileCheckboxes:!1,sortNotebooksFirst:!1,sortFileNamesNaturally:!0,showFullPath:!1,allowFileUploads:!0};a.showFileFilter=p.get("showFileFilter").composite;function s(t){let c;for(c in r){const e=t.get(c).composite;a[c]=e}const i=t.get("breadcrumbs").composite;a.minimumBreadcrumbsLeftItems=i.minimumLeftItems,a.minimumBreadcrumbsRightItems=i.minimumRightItems;const d=t.get("filterDirectories").composite,f=t.get("useFuzzyFilter").composite;a.model.filterDirectories=d,a.model.useFuzzyFilter=f,a.clearFilterOnNavigation=t.get("clearFilterOnNavigation").composite}p.changed.connect(s),s(p)})}},Ve={id:"@jupyterlab/filebrowser-extension:factory",description:"Provides the file browser factory.",provides:C,requires:[G,x],optional:[V.IStateDB,ke.IInfo],activate:async(o,a,h,p,r)=>{const s=new re({namespace:Y});return{createFileBrowser:(c,i={})=>{var d,f;const e=i.state===null?void 0:i.state||p||void 0,n=new je({translator:h,auto:(d=i.auto)!==null&&d!==void 0?d:!0,manager:a,driveName:i.driveName||"",refreshInterval:i.refreshInterval,refreshStandby:()=>r&&!r.isConnected||"when-hidden",state:e,allowFileUploads:(f=i.allowFileUploads)!==null&&f!==void 0?f:!0}),l=i.restore,m=new Ne({id:c,model:n,restore:l,translator:h,state:e,renderer:i.renderer});return s.add(m),m},tracker:s}}},He={id:"@jupyterlab/filebrowser-extension:default-file-browser",description:"Provides the default file browser",provides:P,requires:[C],optional:[Pe,Se.ITreeResolver,D,x,We,xe,V.IStateDB],activate:async(o,a,h,p,r,s,t,c,i)=>{const{commands:d}=o,f=(s??T).load("jupyterlab"),e=a.createFileBrowser("filebrowser",{auto:!1,restore:!1,renderer:t??void 0});e.node.setAttribute("role","region"),e.node.setAttribute("aria-label",f.__("File Browser Section")),e.title.icon=H,e.title.dataset={...e.title.dataset,jpTabLabel:f.__("File Browser")};const n=()=>{const l=o.commands.keyBindings.find(m=>m.command===u.toggleBrowser);if(l){const m=l.keys.map(de.formatKeystroke).join(", ");e.title.caption=f.__("File Browser (%1)",m)}else e.title.caption=f.__("File Browser")};if(n(),o.commands.keyBindingChanged.connect(()=>{n()}),c&&c.registerTarget("@jupyterlab/filebrowser-extension:default-file-browser",f.__("File Browser"),e),i){const l="filebrowser:section-sizes";let m=null;const w=()=>{const g=e.accordionPanel;if(!g||m===g)return;m=g;const b=async()=>{await i.save(l,g.relativeSizes())};g.handleMoved.connect(b),i.fetch(l).then(y=>{Array.isArray(y)&&g.setRelativeSizes(y)})};e.sectionChanged.connect(()=>{w(),m&&i.save(l,m.relativeSizes())})}return F.restoreBrowser(e,d,h,p,o,r),e}},Re={id:"@jupyterlab/filebrowser-extension:download",description:"Adds the download file commands. Disabling this plugin will NOT disable downloading files from the server, if the user enters the appropriate download URLs.",requires:[C,x],autoStart:!0,activate:(o,a,h)=>{const p=h.load("jupyterlab"),{commands:r}=o,{tracker:s}=a;r.addCommand(u.download,{execute:()=>{const t=s.currentWidget;if(t)return t.download()},icon:ne.bindprops({stylesheet:"menuItem"}),label:p.__("Download"),describedBy:{args:{type:"object",properties:{}}}}),r.addCommand(u.copyDownloadLink,{execute:()=>{const t=s.currentWidget;if(t)return t.model.manager.services.contents.getDownloadUrl(t.selectedItems().next().value.path).then(c=>{N.copyToSystem(c)})},isVisible:()=>!!s.currentWidget&&Array.from(s.currentWidget.selectedItems()).length===1,icon:O.bindprops({stylesheet:"menuItem"}),label:p.__("Copy Download Link"),mnemonic:0,describedBy:{args:{type:"object",properties:{}}}})}},qe={id:"@jupyterlab/filebrowser-extension:create-new-language-file",description:"Adds context menu entries for creating Python/R/Julia files",requires:[x],autoStart:!0,activate:async(o,a)=>{const h=a.load("jupyterlab");let p=new A;const r=o.serviceManager.kernelspecs,s=async()=>{var t,c;const i=await Oe(r);p.dispose(),p=new A;for(const d of i)p.add(o.contextMenu.addItem({command:u.createNewFile,selector:".jp-DirListing-content",args:{ext:d.extensions[0],label:h.__("New %1 File",d.displayName),iconName:(c=(t=d.icon)===null||t===void 0?void 0:t.toString())!==null&&c!==void 0?c:""},rank:52}))};r.specsChanged.connect(s),s().catch(console.warn)}},Q={id:"@jupyterlab/filebrowser-extension:widget",description:"Adds the file browser to the application shell.",requires:[G,P,C,M,Ce,x,D,J],optional:[U],autoStart:!0,activate:(o,a,h,p,r,s,t,c,i,d)=>{const{commands:f}=o,{tracker:e}=p,n=t.load("jupyterlab");s.addFactory($,"uploader",l=>new K({model:l.model,translator:t})),ae(h,se(s,r,$,Q.id,t)),c.add(h,"left",{rank:100,type:"File Browser"}),f.addCommand(u.toggleBrowser,{label:n.__("File Browser"),describedBy:{args:{type:"object",properties:{}}},execute:()=>h.isHidden?f.execute(u.showBrowser,void 0):f.execute(u.hideBrowser,void 0)}),f.addCommand(u.showBrowser,{label:n.__("Open the file browser for the provided `path`."),describedBy:{args:{type:"object",properties:{path:{type:"string",description:n.__("The path to open in the file browser")}}}},execute:l=>{const m=l.path||"",w=F.getBrowserForPath(m,h,p);if(w)if(h===w){c.activateById(h.id);return}else{const g=["left","right"];for(const b of g)for(const y of c.widgets(b))if(y.contains(w)){c.activateById(y.id);return}}}}),f.addCommand(u.hideBrowser,{label:n.__("Hide the file browser."),describedBy:{args:{type:"object",properties:{}}},execute:()=>{const l=e.currentWidget;l&&!l.isHidden&&c.collapseLeft()}}),f.addCommand(u.toggleNavigateToCurrentDirectory,{label:n.__("Show Active File in File Browser"),isToggled:()=>h.navigateToCurrentDirectory,execute:()=>{const l=!h.navigateToCurrentDirectory;return r.set(_,"navigateToCurrentDirectory",l).catch(w=>{console.error("Failed to set navigateToCurrentDirectory setting")})},describedBy:{args:{type:"object",properties:{}}}}),d&&d.addItem({command:u.toggleNavigateToCurrentDirectory,category:n.__("File Operations")}),c.restored.then(l=>{l.fresh&&c.mode!=="single-document"&&f.execute(u.showBrowser,void 0)}),Promise.all([o.restored,h.model.restored]).then(()=>{c.currentChanged.connect(async(l,m)=>{if(h.navigateToCurrentDirectory&&m.newValue){const{newValue:w}=m,g=a.contextForWidget(w);if(g){const{path:b}=g;try{await F.navigateToPath(b,h,p,t)}catch(y){console.warn(`${u.goToPath} failed to open: ${b}`,y)}}}})})}},De={id:"@jupyterlab/filebrowser-extension:share-file",description:'Adds the "Copy Shareable Link" command; useful for JupyterHub deployment for example.',requires:[C,x],autoStart:!0,activate:(o,a,h)=>{const p=h.load("jupyterlab"),{commands:r}=o,{tracker:s}=a;r.addCommand(u.copyShareableLink,{execute:()=>{const t=s.currentWidget,c=t?.selectedItems().next();c===void 0||c.done||N.copyToSystem(v.PageConfig.getUrl({workspace:v.PageConfig.defaultWorkspace,treePath:c.value.path,toShare:!0}))},isVisible:()=>!!s.currentWidget&&Array.from(s.currentWidget.selectedItems()).length===1,icon:ie.bindprops({stylesheet:"menuItem"}),label:p.__("Copy Shareable Link"),describedBy:{args:{type:"object",properties:{}}}})}},Ge={id:"@jupyterlab/filebrowser-extension:open-with",description:"Adds the open-with feature allowing an user to pick the non-preferred document viewer.",requires:[C],autoStart:!0,activate:(o,a)=>{const{docRegistry:h}=o,{tracker:p}=a;let r=[];function s(t){var c,i;const d=(i=(c=t.menu.items.find(e=>{var n;return e.type==="submenu"&&((n=e.submenu)===null||n===void 0?void 0:n.id)==="jp-contextmenu-open-with"}))===null||c===void 0?void 0:c.submenu)!==null&&i!==void 0?i:null;if(!d)return;r.forEach(e=>e.dispose()),r.length=0,d.clearItems(),r=[...p.currentWidget?F.OpenWith.intersection(L(p.currentWidget.selectedItems(),e=>F.OpenWith.getFactories(h,e))):new Set].map(e=>d.addItem({args:{factory:e.name,label:e.label||e.name},command:u.open}))}o.contextMenu.opened.connect(s)}},Je={id:"@jupyterlab/filebrowser-extension:open-browser-tab",description:"Adds the open-in-new-browser-tab features.",requires:[C,x],autoStart:!0,activate:(o,a,h)=>{const{commands:p}=o,r=h.load("jupyterlab"),{tracker:s}=a;p.addCommand(u.openBrowserTab,{execute:t=>{const c=s.currentWidget;if(!c)return;const i=t.mode;return Promise.all(Array.from(L(c.selectedItems(),d=>{if(i==="single-document"){const f=v.PageConfig.getUrl({mode:"single-document",treePath:d.path}),e=window.open();if(e)e.opener=null,e.location.href=f;else throw new Error("Failed to open new browser tab.")}else return p.execute("docmanager:open-browser-tab",{path:d.path})})))},icon:le.bindprops({stylesheet:"menuItem"}),label:t=>t.mode==="single-document"?r.__("Open in Simple Mode"):r.__("Open in New Browser Tab"),mnemonic:0,describedBy:{args:{type:"object",properties:{mode:{type:"string",description:r.__("Mode for opening files (e.g., single-document)")}}}}})}},Ke={id:"@jupyterlab/filebrowser-extension:file-upload-status",description:"Adds a file upload status widget.",autoStart:!0,requires:[C,x],optional:[Be],activate:(o,a,h,p)=>{if(!p)return;const r=new S({tracker:a.tracker,translator:h});p.registerStatusItem("@jupyterlab/filebrowser-extension:file-upload-status",{item:r,align:"middle",isActive:()=>!!r.model&&r.model.items.length>0,activeStateChanged:r.model.stateChanged})}},Ye={id:"@jupyterlab/filebrowser-extension:open-url",description:'Adds the feature "Open files from remote URLs".',autoStart:!0,requires:[P,x],optional:[U],activate:(o,a,h,p)=>{const{commands:r}=o,s=h.load("jupyterlab"),t=u.openUrl;r.addCommand(t,{label:c=>c.url?s.__("Open %1",c.url):s.__("Open from URL…"),caption:c=>c.url?s.__("Open %1",c.url):s.__("Open from URL"),execute:async c=>{var i,d,f;let e=(i=c?.url)!==null&&i!==void 0?i:"";if(e||(e=(d=(await q.getText({label:s.__("URL"),placeholder:"https://example.com/path/to/file",title:s.__("Open URL"),okLabel:s.__("Open")})).value)!==null&&d!==void 0?d:void 0),!e)return;let n="",l;try{const m=await fetch(e);l=await m.blob(),n=(f=m.headers.get("Content-Type"))!==null&&f!==void 0?f:""}catch(m){return m.response&&m.response.status!==200&&(m.message=s.__("Could not open URL: %1",e)),B(s.__("Cannot fetch"),m)}try{const m=v.PathExt.basename(e),w=new File([l],m,{type:n}),g=await a.model.upload(w);return r.execute("docmanager:open",{path:g.path})}catch(m){return B(s._p("showErrorMessage","Upload Error"),m)}},describedBy:{args:{type:"object",properties:{url:{type:"string",description:s.__("URL of the file to open")}}}}}),p&&p.addItem({command:t,category:s.__("File Operations")})}},Qe={id:"@jupyterlab/filebrowser-extension:notify-upload",requires:[P,M,x],description:"Adds feature to auto-open supported files after upload",autoStart:!0,activate:async(o,a,h,p)=>{const r=p.load("jupyterlab"),s=await h.load(_);let t=s.get("autoOpenUploads").composite,c=s.get("maxAutoOpenSizeMB").composite*1024*1024;s.changed.connect(()=>{t=s.get("autoOpenUploads").composite,c=s.get("maxAutoOpenSizeMB").composite*1024*1024}),o.restored.then(()=>{const d=Array.from(a.toolbar.children()).find(f=>f instanceof K);if(!d){console.warn("Uploader widget not found");return}d.filesUploaded.connect((f,e)=>{const l=Array.from(o.docRegistry.fileTypes()).reduce((g,b)=>{if(b.extensions)for(const y of b.extensions)g.push(y.toLowerCase());return g},[]),m=e[0].name.toLowerCase(),w=l.some(g=>m.endsWith(g));if(e.length===1&&(e[0].type==="notebook"||e[0].type==="file")){const g=e[0];t&&g.size&&g.size<=c&&w?o.commands.execute("docmanager:open",{path:g.path}).catch(b=>{B(`Opening ${g.name} failed`,b)}):E.emit(r.__("Uploaded %1%2",g.name,g.size?` (${Ie(g.size,1,1024)})`:""),"info",{autoClose:5e3,actions:[{label:r.__("Open File"),callback:()=>{o.commands.execute("docmanager:open",{path:g.path}).catch(b=>{B(`Could not open ${g.name}`,b)})}}]})}else E.emit(r.__("Upload complete (%1 files)",e.length),"info",{autoClose:5e3,actions:[{label:r.__("Open All"),callback:()=>{e.forEach(g=>{o.commands.execute("docmanager:open",{path:g.path}).catch(b=>{B(`Could not open ${g.path}`,b)})})}}]})})})}};function Ze(o,a,h,p,r,s){const t=p.load("jupyterlab"),{docRegistry:c,commands:i}=o,{tracker:d}=h,f=v.PageConfig.getOption("delete_to_trash")==="true";i.addCommand(u.del,{execute:()=>{const e=d.currentWidget;if(e)return e.delete()},icon:ce.bindprops({stylesheet:"menuItem"}),label:f?t.__("Move to Trash"):t.__("Delete"),mnemonic:0,describedBy:{args:{type:"object",properties:{}}}}),i.addCommand(u.copy,{execute:()=>{const e=d.currentWidget;if(e)return e.copy()},icon:O.bindprops({stylesheet:"menuItem"}),label:t.__("Copy"),mnemonic:0,describedBy:{args:{type:"object",properties:{}}}}),i.addCommand(u.cut,{execute:()=>{const e=d.currentWidget;if(e)return e.cut()},icon:pe.bindprops({stylesheet:"menuItem"}),label:t.__("Cut"),describedBy:{args:{type:"object",properties:{}}}}),i.addCommand(u.duplicate,{execute:()=>{const e=d.currentWidget;if(e)return e.duplicate()},icon:O.bindprops({stylesheet:"menuItem"}),label:t.__("Duplicate"),describedBy:{args:{type:"object",properties:{}}}}),i.addCommand(u.selectAll,{execute:()=>{const e=d.currentWidget;if(e)return e.selectAll()},label:t.__("Select All"),describedBy:{args:{type:"object",properties:{}}}}),i.addCommand(u.goToPath,{label:t.__("Update the file browser to display the provided `path`."),describedBy:{args:{type:"object",properties:{path:{type:"string",description:t.__("The path to navigate to")},dontShowBrowser:{type:"boolean",description:t.__("Whether to avoid showing the browser")}}}},execute:async e=>{var n;const l=e.path||"",m=!((n=e?.dontShowBrowser)!==null&&n!==void 0&&n);try{if((await F.navigateToPath(l,a,h,p)).type!=="directory"&&m){const g=F.getBrowserForPath(l,a,h);if(g){g.clearSelectedItems();const b=l.split("/"),y=b[b.length-1];y&&await g.selectItemByName(y)}}}catch(w){console.warn(`${u.goToPath} failed to go to: ${l}`,w)}if(m)return i.execute(u.showBrowser,{path:l})}}),i.addCommand(u.goUp,{label:t.__("Go Up"),execute:async()=>{const e=F.getBrowserForPath("",a,h);if(!e)return;const{model:n}=e;await n.restored,e.goUp()},describedBy:{args:{type:"object",properties:{}}}}),i.addCommand(u.openPath,{label:e=>e.path?t.__("Open %1",e.path):t.__("Open from Path…"),caption:e=>e.path?t.__("Open %1",e.path):t.__("Open from path"),execute:async e=>{var n;let l;if(e?.path?l=e.path:l=(n=(await q.getText({label:t.__("Path"),placeholder:"/path/relative/to/jlab/root",title:t.__("Open Path"),okLabel:t.__("Open")})).value)!==null&&n!==void 0?n:void 0,!!l)try{const m=l!=="/"&&l.endsWith("/");m&&(l=l.slice(0,l.length-1));const w=F.getBrowserForPath(l,a,h),{services:g}=w.model.manager,b=await g.contents.get(l,{content:!1});if(m&&b.type!=="directory")throw new Error(`Path ${l}/ is not a directory`);return await i.execute(u.goToPath,{path:l,dontShowBrowser:e.dontShowBrowser}),b.type==="directory"?void 0:i.execute("docmanager:open",{path:l})}catch(m){return m.response&&m.response.status===404&&(m.message=t.__("Could not find path: %1",l)),B(t.__("Cannot open"),m)}},describedBy:{args:{type:"object",properties:{path:{type:"string",description:t.__("Path to the file or directory to open")},dontShowBrowser:{type:"boolean",description:t.__("Whether to avoid showing the file browser")}}}}}),s&&s.addItem({command:u.openPath,category:t.__("File Operations")}),i.addCommand(u.open,{execute:e=>{const n=e.factory||void 0,l=d.currentWidget;if(!l)return;const{contents:m}=l.model.manager.services;return Promise.all(Array.from(L(l.selectedItems(),w=>{if(w.type==="directory"){const g=m.localPath(w.path);return l.model.cd(`/${g}`)}return i.execute("docmanager:open",{factory:n,path:w.path,kernelPreference:e.kernelPreference})})))},icon:e=>{var n;const l=e.factory||void 0;if(l){const m=c.getFileType(l);return(n=m?.icon)===null||n===void 0?void 0:n.bindprops({stylesheet:"menuItem"})}else return H.bindprops({stylesheet:"menuItem"})},label:e=>e.label||e.factory||t.__("Open"),mnemonic:0,describedBy:{args:{type:"object",properties:{factory:{type:"string",description:t.__("The name of the widget factory to use")},label:{type:"string",description:t.__("The label to display for the command")}}}}}),i.addCommand(u.paste,{execute:()=>{const e=d.currentWidget;if(e)return e.paste()},icon:ue.bindprops({stylesheet:"menuItem"}),label:t.__("Paste"),mnemonic:0,describedBy:{args:{type:"object",properties:{}}}}),i.addCommand(u.createNewDirectory,{execute:()=>{const e=d.currentWidget;if(e)return e.createNewDirectory()},icon:he.bindprops({stylesheet:"menuItem"}),label:t.__("New Folder"),describedBy:{args:{type:"object",properties:{}}}}),i.addCommand(u.createNewFile,{execute:e=>{var n;const l=d.currentWidget;if(l)return l.createNewFile({ext:(n=e.ext)!==null&&n!==void 0?n:"txt"})},icon:e=>e.iconName?me.resolve({icon:e.iconName}):fe.bindprops({stylesheet:"menuItem"}),label:e=>e.label===void 0||e.label===null?t.__("New File"):t.__(e.label),describedBy:{args:{type:"object",properties:{label:{type:"string",default:"New File",description:t.__("The command label.")},iconName:{type:"string",description:t.__("The command icon.")},ext:{type:"string",default:"txt",description:t.__("The file extension.")}}}}}),i.addCommand(u.createNewMarkdownFile,{execute:()=>{const e=d.currentWidget;if(e)return e.createNewFile({ext:"md"})},icon:ge.bindprops({stylesheet:"menuItem"}),label:t.__("New Markdown File"),describedBy:{args:{type:"object",properties:{}}}}),i.addCommand(u.refresh,{execute:async()=>{const e=d.currentWidget;if(e){e.node.classList.add("jp-mod-refreshing");try{await e.model.refresh()}finally{e.node.classList.remove("jp-mod-refreshing")}}},icon:we.bindprops({stylesheet:"menuItem"}),caption:t.__("Refresh the file browser."),label:t.__("Refresh File List"),describedBy:{args:{type:"object",properties:{}}}}),i.addCommand(u.rename,{execute:e=>{const n=d.currentWidget;if(n)return n.rename()},isVisible:()=>!!d.currentWidget&&Array.from(d.currentWidget.selectedItems()).length===1,icon:be.bindprops({stylesheet:"menuItem"}),label:t.__("Rename"),mnemonic:0,describedBy:{args:{type:"object",properties:{}}}}),i.addCommand(u.copyPath,{execute:()=>{var e;const n=d.currentWidget;if(!n)return;const l=n.selectedItems().next();if(!l.done)if(v.PageConfig.getOption("copyAbsolutePath")==="true"){const m=v.PathExt.joinWithLeadingSlash((e=v.PageConfig.getOption("serverRoot"))!==null&&e!==void 0?e:"",l.value.path);N.copyToSystem(m)}else N.copyToSystem(l.value.path)},isVisible:()=>!!d.currentWidget&&Array.from(d.currentWidget.selectedItems()).length===1,icon:ye.bindprops({stylesheet:"menuItem"}),label:t.__("Copy Path"),describedBy:{args:{type:"object",properties:{}}}}),i.addCommand(u.shutdown,{execute:()=>{const e=d.currentWidget;if(e)return e.shutdownKernels()},icon:_e.bindprops({stylesheet:"menuItem"}),label:t.__("Shut Down Kernel"),describedBy:{args:{type:"object",properties:{}}}}),i.addCommand(u.toggleFileFilter,{execute:()=>{a.showFileFilter=!a.showFileFilter,i.notifyCommandChanged(u.toggleFileFilter)},isToggled:()=>a.showFileFilter,icon:ve.bindprops({stylesheet:"menuItem"}),label:t.__("Toggle File Filter"),describedBy:{args:{type:"object",properties:{}}}}),i.addCommand(u.toggleLastModified,{label:t.__("Show Last Modified Column"),isToggled:()=>a.showLastModifiedColumn,execute:()=>{const e=!a.showLastModifiedColumn,n="showLastModifiedColumn";if(r)return r.set(_,n,e).catch(l=>{console.error(`Failed to set ${n} setting`)})},describedBy:{args:{type:"object",properties:{}}}}),i.addCommand(u.toggleShowFullPath,{label:t.__("Show Full Path"),isToggled:()=>a.showFullPath,execute:()=>{const e=!a.showFullPath,n="showFullPath";if(r)return r.set(_,n,e).catch(l=>{console.error(`Failed to set ${n} setting`)})},describedBy:{args:{type:"object",properties:{}}}}),i.addCommand(u.toggleSortNotebooksFirst,{label:t.__("Sort Notebooks Above Files"),isToggled:()=>a.sortNotebooksFirst,execute:()=>{const e=!a.sortNotebooksFirst,n="sortNotebooksFirst";if(r)return r.set(_,n,e).catch(l=>{console.error(`Failed to set ${n} setting`)})},describedBy:{args:{type:"object",properties:{}}}}),i.addCommand(u.toggleDateCreated,{label:t.__("Show Date Created Column"),isToggled:()=>a.showDateCreatedColumn,execute:()=>{const e=!a.showDateCreatedColumn,n="showDateCreatedColumn";if(r)return r.set(_,n,e).catch(l=>{console.error(`Failed to set ${n} setting`)})},describedBy:{args:{type:"object",properties:{}}}}),i.addCommand(u.toggleFileSize,{label:t.__("Show File Size Column"),isToggled:()=>a.showFileSizeColumn,execute:()=>{const e=!a.showFileSizeColumn,n="showFileSizeColumn";if(r)return r.set(_,n,e).catch(l=>{console.error(`Failed to set ${n} setting`)})},describedBy:{args:{type:"object",properties:{}}}}),i.addCommand(u.toggleSingleClick,{label:t.__("Enable Single Click Navigation"),isToggled:()=>a.singleClickNavigation,execute:()=>{const e=!a.singleClickNavigation,n="singleClickNavigation";if(r)return r.set(_,n,e).catch(l=>{console.error("Failed to set singleClickNavigation setting")})},describedBy:{args:{type:"object",properties:{}}}}),i.addCommand(u.toggleHiddenFiles,{label:t.__("Show Hidden Files"),isToggled:()=>a.showHiddenFiles,isVisible:()=>v.PageConfig.getOption("allow_hidden_files")==="true",execute:()=>{const e=!a.showHiddenFiles,n="showHiddenFiles";if(r)return r.set(_,n,e).catch(l=>{console.error("Failed to set showHiddenFiles setting")})},describedBy:{args:{type:"object",properties:{}}}}),s&&s.addItem({command:u.toggleHiddenFiles,category:t.__("File Operations")}),i.addCommand(u.toggleFileCheckboxes,{label:t.__("Show File Checkboxes"),isToggled:()=>a.showFileCheckboxes,execute:()=>{const e=!a.showFileCheckboxes,n="showFileCheckboxes";if(r)return r.set(_,n,e).catch(l=>{console.error("Failed to set showFileCheckboxes setting")})},describedBy:{args:{type:"object",properties:{}}}}),i.addCommand(u.editPath,{execute:async()=>{var e;if(typeof a.editPath!="function"){console.error("`editPath` is not available on the current file browser");return}await i.execute(u.showBrowser),((e=d.currentWidget)!==null&&e!==void 0?e:a).editPath()},label:t.__("Edit File Browser Path"),isVisible:()=>typeof a.editPath=="function",describedBy:{args:{type:"object",properties:{}}}}),s&&s.addItem({command:u.editPath,category:t.__("File Operations")})}const ro=[Ve,He,ze,$e,De,Ke,Re,Q,Ge,Je,Ye,Qe,qe];var F;(function(o){function a(r,s,t){const{tracker:c}=t,i=s.model.manager.services.contents.driveName(r);if(i){const d=c.find(f=>f.model.driveName===i);if(!d){console.warn(`${u.goToPath} failed to find filebrowser for path: ${r}`);return}return d}return s}o.getBrowserForPath=a;async function h(r,s,t,c){const i=c.load("jupyterlab"),d=o.getBrowserForPath(r,s,t);if(!d)throw new Error(i.__("No browser for path"));const{services:f}=d.model.manager,e=f.contents.localPath(r);await f.ready;const n=await f.contents.get(r,{content:!1}),{model:l}=d;return await l.restored,n.type==="directory"?await l.cd(`/${e}`):await l.cd(`/${v.PathExt.dirname(e)}`),n}o.navigateToPath=h;async function p(r,s,t,c,i,d){const f="jp-mod-restoring";if(r.addClass(f),!t){await r.model.restore(r.id),await r.model.refresh(),r.removeClass(f);return}const e=async()=>{t.routed.disconnect(e);const n=await c?.paths;n?.file||n?.browser?(await r.model.restore(r.id,!1),n.file&&await s.execute(u.openPath,{path:n.file,dontShowBrowser:!0}),n.browser&&await s.execute(u.openPath,{path:n.browser,dontShowBrowser:!0})):(await r.model.restore(r.id),await r.model.refresh()),r.removeClass(f),d?.isEmpty("main")&&s.execute("launcher:create")};t.routed.connect(e)}o.restoreBrowser=p,(function(r){function s(c,i){const d=c.preferredWidgetFactories(i.path),f=c.getWidgetFactory("notebook");return f&&i.type==="notebook"&&d.indexOf(f)===-1&&d.unshift(f),d}r.getFactories=s;function t(c){let i;for(const d of c){if(i===void 0){i=new Set(d);continue}if(i.size===0)return i;let f=new Set;for(const e of d)i.has(e)&&f.add(e);i=f}return i??new Set}r.intersection=t})(o.OpenWith||(o.OpenWith={}))})(F||(F={}));export{ro as default,Ke as fileUploadStatus};
|
|
1
|
+
import{r as j,dB as Z,dC as X,cm as B,a9 as ee,aD as T,ci as te,J as k,ce as oe,az as I,dw as V,aC as x,dD as re,dE as H,cd as v,dF as ie,dG as N,dH as ne,dI as O,dv as ae,aG as se,co as le,cl as L,dJ as E,dK as de,dL as ce,dM as pe,dN as ue,dO as he,cj as me,dP as fe,dQ as ge,dR as we,dS as be,dT as ye,dU as _e,dV as ve,dx as A}from"../datalayer-app-main.js";import{T as R,G as Fe,e as xe,b as U,I as Ce,f as q}from"./index-gFUsWgU1.js";import{I as Be}from"./tokens-Dyd4wiX6.js";import{h as ke,e as Pe,J as Se,c as D,f as Te,k as Ie,F as je,l as Ne}from"./index-FRUXunp7.js";import{I as G}from"./tokens-Nkg3e_k9.js";import{a as C,b as We,I as P,c as J}from"./tokens-DbNnxPrX.js";import{I as M}from"./tokens-DY_UrMLq.js";import{I as Me}from"./treepathupdater-DiwXSt-s.js";import{g as Oe}from"./kernelfilestypes-D2B-sFfi.js";import"./hoverbox-CStlKQWE.js";import"./Output-BsFagSE6.js";import"./index-C1Tx7ck6.js";import"./index-DYBuJWF3.js";import"./dayjs.min-u3zuoSR8.js";import"./isEqual-D9LEOOsI.js";import"./d3-color-Jd8hXty2.js";import"./dist-BrUAt6vF.js";import"./KebabHorizontalIcon-D6AY8pIS.js";import"./PaintbrushIcon-CFBHU-3l.js";import"./index-CKWSKbHe.js";import"./RestartIcon-DvpOf5Mf.js";import"./CellSidebarExtension-COAR2VxE.js";import"./NotebookSkeleton-BaU6vrsb.js";import"./Avatar-Cv5OpUWu.js";import"./renderer-DdYo8U7J.js";import"./SquareIcon-Dy3l3VdH.js";import"./FileDirectoryOpenFillIcon-jGhuRcP3.js";import"./url-C6fJII94.js";/* empty css *//* empty css */import"./style-DdAxk_bj.js";/* empty css */import"./style-Cj1gzCjo.js";/* empty css */import"./style-rkw8dR9f.js";import"./style-GHJFdtIz.js";import"./style-ZSIOeMoX.js";import"./style-iVfD6mFL.js";import"./style-DA-Ya7rp.js";import"./style-D3tvWcFO.js";import"./style-BOqStzF9.js";import"./style-ADLQJ-E9.js";import"./style-DgglluaK.js";import"./ArrowLeftIcon-sX3iNMG1.js";import"./SkubbleIcon-CAaVh_BE.js";import"./usePrimerThemeBridge-NsTRGuo7.js";import"./index-DHpFjpWk.js";import"./KernelVariables-INnfLlYr.js";import"./index-C0d-d3s4.js";import"./SortAscIcon-CmH04s3F.js";import"./SortDescIcon-Qif6E10I.js";import"./NotebookToolbar-CO_qaXBp.js";import"./RepoPushIcon-BtXQRhLa.js";import"./Toolbar-ByUGXe7J.js";import"./sessions-Dy-NqKRu.js";import"./tokens-CTXFWLvM.js";import"./drivecontents-BsC6Y2Vl.js";import"./kernel-BmfZmtIo.js";function Le(o){const{width:a,percentage:h,...p}=o;return j.createElement("div",{className:"jp-Statusbar-ProgressBar-progress-bar",role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":h},j.createElement(Ue,{percentage:h,...p,contentWidth:a}))}function Ue(o){return j.createElement("div",{style:{width:`${o.percentage}%`}},j.createElement("p",null,o.content))}class K extends Z{constructor(a){super({icon:X,label:a.label,onClick:()=>{this._input.click()},tooltip:W.translateToolTip(a.translator),enabled:a.model.allowFileUploads}),this._onInputChanged=()=>{const p=Array.prototype.slice.call(this._input.files).map(r=>this.fileBrowserModel.upload(r));Promise.all(p).then(r=>{this._filesUploaded.emit(r)}).catch(r=>{B(this._trans._p("showErrorMessage","Upload Error"),r)})},this._onInputClicked=()=>{this._input.value=""},this._input=W.createUploadInput(),this._filesUploaded=new ee(this),this.fileBrowserModel=a.model,this.translator=a.translator||T,this._trans=this.translator.load("jupyterlab"),this._input.onclick=this._onInputClicked,this._input.onchange=this._onInputChanged,this.addClass("jp-id-upload")}get filesUploaded(){return this._filesUploaded}}var W;(function(o){function a(){const p=document.createElement("input");return p.type="file",p.multiple=!0,p}o.createUploadInput=a;function h(p){return p=p||T,p.load("jupyterlab").__("Upload Files")}o.translateToolTip=h})(W||(W={}));const Ee=4;function z(o){const h=(o.translator||T).load("jupyterlab");return k.createElement(Fe,{spacing:Ee},k.createElement(R,{source:h.__("Uploading…")}),k.createElement(Le,{percentage:o.upload}))}const Ae=2e3;class S extends te{constructor(a){super(new S.Model(a.tracker.currentWidget&&a.tracker.currentWidget.model)),this._onBrowserChange=(h,p)=>{p===null?this.model.browserModel=null:this.model.browserModel=p.model},this.translator=a.translator||T,this._trans=this.translator.load("jupyterlab"),this._tracker=a.tracker,this._tracker.currentChanged.connect(this._onBrowserChange)}render(){return this.model.items.length>0?this.model.items[0].complete?k.createElement(R,{source:this._trans.__("Complete!")}):k.createElement(z,{upload:this.model.items[0].progress,translator:this.translator}):k.createElement(z,{upload:100,translator:this.translator})}dispose(){super.dispose(),this._tracker.currentChanged.disconnect(this._onBrowserChange)}}(function(o){class a extends oe{constructor(p){super(),this._uploadChanged=(r,s)=>{if(s.name==="start")this._items.push({path:s.newValue.path,progress:s.newValue.progress*100,complete:!1});else if(s.name==="update"){const t=I.findFirstIndex(this._items,c=>c.path===s.oldValue.path);t!==-1&&(this._items[t].progress=s.newValue.progress*100)}else if(s.name==="finish"){const t=I.findFirstValue(this._items,c=>c.path===s.oldValue.path);t&&(t.complete=!0,setTimeout(()=>{I.removeFirstOf(this._items,t),this.stateChanged.emit(void 0)},Ae))}else if(s.name==="failure")I.removeFirstWhere(this._items,t=>t.path===s.newValue.path);else return;this.stateChanged.emit(void 0)},this._items=[],this._browserModel=null,this.browserModel=p}get items(){return this._items}get browserModel(){return this._browserModel}set browserModel(p){const r=this._browserModel;r&&r.uploadChanged.disconnect(this._uploadChanged),this._browserModel=p,this._items=[],this._browserModel!==null&&this._browserModel.uploadChanged.connect(this._uploadChanged),this.stateChanged.emit(void 0)}}o.Model=a})(S||(S={}));const $="FileBrowser",_="@jupyterlab/filebrowser-extension:browser";var u;(function(o){o.copy="filebrowser:copy",o.copyDownloadLink="filebrowser:copy-download-link",o.cut="filebrowser:cut",o.del="filebrowser:delete",o.download="filebrowser:download",o.duplicate="filebrowser:duplicate",o.selectAll="filebrowser:select-all",o.hideBrowser="filebrowser:hide-main",o.goToPath="filebrowser:go-to-path",o.goUp="filebrowser:go-up",o.openPath="filebrowser:open-path",o.openUrl="filebrowser:open-url",o.open="filebrowser:open",o.openBrowserTab="filebrowser:open-browser-tab",o.paste="filebrowser:paste",o.createNewDirectory="filebrowser:create-new-directory",o.createNewFile="filebrowser:create-new-file",o.createNewMarkdownFile="filebrowser:create-new-markdown-file",o.refresh="filebrowser:refresh",o.rename="filebrowser:rename",o.copyShareableLink="filebrowser:share-main",o.copyPath="filebrowser:copy-path",o.showBrowser="filebrowser:activate",o.shutdown="filebrowser:shutdown",o.toggleBrowser="filebrowser:toggle-main",o.toggleFileFilter="filebrowser:toggle-file-filter",o.toggleNavigateToCurrentDirectory="filebrowser:toggle-navigate-to-current-directory",o.toggleLastModified="filebrowser:toggle-last-modified",o.toggleShowFullPath="filebrowser:toggle-show-full-path",o.toggleDateCreated="filebrowser:toggle-date-created",o.toggleFileSize="filebrowser:toggle-file-size",o.toggleSortNotebooksFirst="filebrowser:toggle-sort-notebooks-first",o.toggleHiddenFiles="filebrowser:toggle-hidden-files",o.toggleSingleClick="filebrowser:toggle-single-click-navigation",o.toggleFileCheckboxes="filebrowser:toggle-file-checkboxes",o.editPath="filebrowser:edit-path"})(u||(u={}));const Y="filebrowser",ze={id:_,description:"Set up the default file browser commands and state restoration",requires:[P,C,x],optional:[Te,M,Me,U],provides:J,autoStart:!0,activate:async(o,a,h,p,r,s,t,c)=>{const i=a;r&&r.add(i,Y);const d=v.PageConfig.getOption("preferredPath");return d&&await i.model.cd(d),Ze(o,i,h,p,s,c),Promise.all([o.restored,i.model.restored]).then(()=>{t&&i.model.pathChanged.connect((f,e)=>{t(e.newValue)})}),{openPath:u.openPath}}},$e={id:"@jupyterlab/filebrowser-extension:settings",description:"Set up the default file browser settings",requires:[P],optional:[M],autoStart:!0,activate:(o,a,h)=>{h&&h.load(_).then(p=>{const r={navigateToCurrentDirectory:!1,singleClickNavigation:!1,showLastModifiedColumn:!0,showDateCreatedColumn:!1,showFileSizeColumn:!1,showHiddenFiles:!1,showFileCheckboxes:!1,sortNotebooksFirst:!1,sortFileNamesNaturally:!0,showFullPath:!1,allowFileUploads:!0};a.showFileFilter=p.get("showFileFilter").composite;function s(t){let c;for(c in r){const e=t.get(c).composite;a[c]=e}const i=t.get("breadcrumbs").composite;a.minimumBreadcrumbsLeftItems=i.minimumLeftItems,a.minimumBreadcrumbsRightItems=i.minimumRightItems;const d=t.get("filterDirectories").composite,f=t.get("useFuzzyFilter").composite;a.model.filterDirectories=d,a.model.useFuzzyFilter=f,a.clearFilterOnNavigation=t.get("clearFilterOnNavigation").composite}p.changed.connect(s),s(p)})}},Ve={id:"@jupyterlab/filebrowser-extension:factory",description:"Provides the file browser factory.",provides:C,requires:[G,x],optional:[V.IStateDB,ke.IInfo],activate:async(o,a,h,p,r)=>{const s=new re({namespace:Y});return{createFileBrowser:(c,i={})=>{var d,f;const e=i.state===null?void 0:i.state||p||void 0,n=new je({translator:h,auto:(d=i.auto)!==null&&d!==void 0?d:!0,manager:a,driveName:i.driveName||"",refreshInterval:i.refreshInterval,refreshStandby:()=>r&&!r.isConnected||"when-hidden",state:e,allowFileUploads:(f=i.allowFileUploads)!==null&&f!==void 0?f:!0}),l=i.restore,m=new Ne({id:c,model:n,restore:l,translator:h,state:e,renderer:i.renderer});return s.add(m),m},tracker:s}}},He={id:"@jupyterlab/filebrowser-extension:default-file-browser",description:"Provides the default file browser",provides:P,requires:[C],optional:[Pe,Se.ITreeResolver,D,x,We,xe,V.IStateDB],activate:async(o,a,h,p,r,s,t,c,i)=>{const{commands:d}=o,f=(s??T).load("jupyterlab"),e=a.createFileBrowser("filebrowser",{auto:!1,restore:!1,renderer:t??void 0});e.node.setAttribute("role","region"),e.node.setAttribute("aria-label",f.__("File Browser Section")),e.title.icon=H,e.title.dataset={...e.title.dataset,jpTabLabel:f.__("File Browser")};const n=()=>{const l=o.commands.keyBindings.find(m=>m.command===u.toggleBrowser);if(l){const m=l.keys.map(de.formatKeystroke).join(", ");e.title.caption=f.__("File Browser (%1)",m)}else e.title.caption=f.__("File Browser")};if(n(),o.commands.keyBindingChanged.connect(()=>{n()}),c&&c.registerTarget("@jupyterlab/filebrowser-extension:default-file-browser",f.__("File Browser"),e),i){const l="filebrowser:section-sizes";let m=null;const w=()=>{const g=e.accordionPanel;if(!g||m===g)return;m=g;const b=async()=>{await i.save(l,g.relativeSizes())};g.handleMoved.connect(b),i.fetch(l).then(y=>{Array.isArray(y)&&g.setRelativeSizes(y)})};e.sectionChanged.connect(()=>{w(),m&&i.save(l,m.relativeSizes())})}return F.restoreBrowser(e,d,h,p,o,r),e}},Re={id:"@jupyterlab/filebrowser-extension:download",description:"Adds the download file commands. Disabling this plugin will NOT disable downloading files from the server, if the user enters the appropriate download URLs.",requires:[C,x],autoStart:!0,activate:(o,a,h)=>{const p=h.load("jupyterlab"),{commands:r}=o,{tracker:s}=a;r.addCommand(u.download,{execute:()=>{const t=s.currentWidget;if(t)return t.download()},icon:ne.bindprops({stylesheet:"menuItem"}),label:p.__("Download"),describedBy:{args:{type:"object",properties:{}}}}),r.addCommand(u.copyDownloadLink,{execute:()=>{const t=s.currentWidget;if(t)return t.model.manager.services.contents.getDownloadUrl(t.selectedItems().next().value.path).then(c=>{N.copyToSystem(c)})},isVisible:()=>!!s.currentWidget&&Array.from(s.currentWidget.selectedItems()).length===1,icon:O.bindprops({stylesheet:"menuItem"}),label:p.__("Copy Download Link"),mnemonic:0,describedBy:{args:{type:"object",properties:{}}}})}},qe={id:"@jupyterlab/filebrowser-extension:create-new-language-file",description:"Adds context menu entries for creating Python/R/Julia files",requires:[x],autoStart:!0,activate:async(o,a)=>{const h=a.load("jupyterlab");let p=new A;const r=o.serviceManager.kernelspecs,s=async()=>{var t,c;const i=await Oe(r);p.dispose(),p=new A;for(const d of i)p.add(o.contextMenu.addItem({command:u.createNewFile,selector:".jp-DirListing-content",args:{ext:d.extensions[0],label:h.__("New %1 File",d.displayName),iconName:(c=(t=d.icon)===null||t===void 0?void 0:t.toString())!==null&&c!==void 0?c:""},rank:52}))};r.specsChanged.connect(s),s().catch(console.warn)}},Q={id:"@jupyterlab/filebrowser-extension:widget",description:"Adds the file browser to the application shell.",requires:[G,P,C,M,Ce,x,D,J],optional:[U],autoStart:!0,activate:(o,a,h,p,r,s,t,c,i,d)=>{const{commands:f}=o,{tracker:e}=p,n=t.load("jupyterlab");s.addFactory($,"uploader",l=>new K({model:l.model,translator:t})),ae(h,se(s,r,$,Q.id,t)),c.add(h,"left",{rank:100,type:"File Browser"}),f.addCommand(u.toggleBrowser,{label:n.__("File Browser"),describedBy:{args:{type:"object",properties:{}}},execute:()=>h.isHidden?f.execute(u.showBrowser,void 0):f.execute(u.hideBrowser,void 0)}),f.addCommand(u.showBrowser,{label:n.__("Open the file browser for the provided `path`."),describedBy:{args:{type:"object",properties:{path:{type:"string",description:n.__("The path to open in the file browser")}}}},execute:l=>{const m=l.path||"",w=F.getBrowserForPath(m,h,p);if(w)if(h===w){c.activateById(h.id);return}else{const g=["left","right"];for(const b of g)for(const y of c.widgets(b))if(y.contains(w)){c.activateById(y.id);return}}}}),f.addCommand(u.hideBrowser,{label:n.__("Hide the file browser."),describedBy:{args:{type:"object",properties:{}}},execute:()=>{const l=e.currentWidget;l&&!l.isHidden&&c.collapseLeft()}}),f.addCommand(u.toggleNavigateToCurrentDirectory,{label:n.__("Show Active File in File Browser"),isToggled:()=>h.navigateToCurrentDirectory,execute:()=>{const l=!h.navigateToCurrentDirectory;return r.set(_,"navigateToCurrentDirectory",l).catch(w=>{console.error("Failed to set navigateToCurrentDirectory setting")})},describedBy:{args:{type:"object",properties:{}}}}),d&&d.addItem({command:u.toggleNavigateToCurrentDirectory,category:n.__("File Operations")}),c.restored.then(l=>{l.fresh&&c.mode!=="single-document"&&f.execute(u.showBrowser,void 0)}),Promise.all([o.restored,h.model.restored]).then(()=>{c.currentChanged.connect(async(l,m)=>{if(h.navigateToCurrentDirectory&&m.newValue){const{newValue:w}=m,g=a.contextForWidget(w);if(g){const{path:b}=g;try{await F.navigateToPath(b,h,p,t)}catch(y){console.warn(`${u.goToPath} failed to open: ${b}`,y)}}}})})}},De={id:"@jupyterlab/filebrowser-extension:share-file",description:'Adds the "Copy Shareable Link" command; useful for JupyterHub deployment for example.',requires:[C,x],autoStart:!0,activate:(o,a,h)=>{const p=h.load("jupyterlab"),{commands:r}=o,{tracker:s}=a;r.addCommand(u.copyShareableLink,{execute:()=>{const t=s.currentWidget,c=t?.selectedItems().next();c===void 0||c.done||N.copyToSystem(v.PageConfig.getUrl({workspace:v.PageConfig.defaultWorkspace,treePath:c.value.path,toShare:!0}))},isVisible:()=>!!s.currentWidget&&Array.from(s.currentWidget.selectedItems()).length===1,icon:ie.bindprops({stylesheet:"menuItem"}),label:p.__("Copy Shareable Link"),describedBy:{args:{type:"object",properties:{}}}})}},Ge={id:"@jupyterlab/filebrowser-extension:open-with",description:"Adds the open-with feature allowing an user to pick the non-preferred document viewer.",requires:[C],autoStart:!0,activate:(o,a)=>{const{docRegistry:h}=o,{tracker:p}=a;let r=[];function s(t){var c,i;const d=(i=(c=t.menu.items.find(e=>{var n;return e.type==="submenu"&&((n=e.submenu)===null||n===void 0?void 0:n.id)==="jp-contextmenu-open-with"}))===null||c===void 0?void 0:c.submenu)!==null&&i!==void 0?i:null;if(!d)return;r.forEach(e=>e.dispose()),r.length=0,d.clearItems(),r=[...p.currentWidget?F.OpenWith.intersection(L(p.currentWidget.selectedItems(),e=>F.OpenWith.getFactories(h,e))):new Set].map(e=>d.addItem({args:{factory:e.name,label:e.label||e.name},command:u.open}))}o.contextMenu.opened.connect(s)}},Je={id:"@jupyterlab/filebrowser-extension:open-browser-tab",description:"Adds the open-in-new-browser-tab features.",requires:[C,x],autoStart:!0,activate:(o,a,h)=>{const{commands:p}=o,r=h.load("jupyterlab"),{tracker:s}=a;p.addCommand(u.openBrowserTab,{execute:t=>{const c=s.currentWidget;if(!c)return;const i=t.mode;return Promise.all(Array.from(L(c.selectedItems(),d=>{if(i==="single-document"){const f=v.PageConfig.getUrl({mode:"single-document",treePath:d.path}),e=window.open();if(e)e.opener=null,e.location.href=f;else throw new Error("Failed to open new browser tab.")}else return p.execute("docmanager:open-browser-tab",{path:d.path})})))},icon:le.bindprops({stylesheet:"menuItem"}),label:t=>t.mode==="single-document"?r.__("Open in Simple Mode"):r.__("Open in New Browser Tab"),mnemonic:0,describedBy:{args:{type:"object",properties:{mode:{type:"string",description:r.__("Mode for opening files (e.g., single-document)")}}}}})}},Ke={id:"@jupyterlab/filebrowser-extension:file-upload-status",description:"Adds a file upload status widget.",autoStart:!0,requires:[C,x],optional:[Be],activate:(o,a,h,p)=>{if(!p)return;const r=new S({tracker:a.tracker,translator:h});p.registerStatusItem("@jupyterlab/filebrowser-extension:file-upload-status",{item:r,align:"middle",isActive:()=>!!r.model&&r.model.items.length>0,activeStateChanged:r.model.stateChanged})}},Ye={id:"@jupyterlab/filebrowser-extension:open-url",description:'Adds the feature "Open files from remote URLs".',autoStart:!0,requires:[P,x],optional:[U],activate:(o,a,h,p)=>{const{commands:r}=o,s=h.load("jupyterlab"),t=u.openUrl;r.addCommand(t,{label:c=>c.url?s.__("Open %1",c.url):s.__("Open from URL…"),caption:c=>c.url?s.__("Open %1",c.url):s.__("Open from URL"),execute:async c=>{var i,d,f;let e=(i=c?.url)!==null&&i!==void 0?i:"";if(e||(e=(d=(await q.getText({label:s.__("URL"),placeholder:"https://example.com/path/to/file",title:s.__("Open URL"),okLabel:s.__("Open")})).value)!==null&&d!==void 0?d:void 0),!e)return;let n="",l;try{const m=await fetch(e);l=await m.blob(),n=(f=m.headers.get("Content-Type"))!==null&&f!==void 0?f:""}catch(m){return m.response&&m.response.status!==200&&(m.message=s.__("Could not open URL: %1",e)),B(s.__("Cannot fetch"),m)}try{const m=v.PathExt.basename(e),w=new File([l],m,{type:n}),g=await a.model.upload(w);return r.execute("docmanager:open",{path:g.path})}catch(m){return B(s._p("showErrorMessage","Upload Error"),m)}},describedBy:{args:{type:"object",properties:{url:{type:"string",description:s.__("URL of the file to open")}}}}}),p&&p.addItem({command:t,category:s.__("File Operations")})}},Qe={id:"@jupyterlab/filebrowser-extension:notify-upload",requires:[P,M,x],description:"Adds feature to auto-open supported files after upload",autoStart:!0,activate:async(o,a,h,p)=>{const r=p.load("jupyterlab"),s=await h.load(_);let t=s.get("autoOpenUploads").composite,c=s.get("maxAutoOpenSizeMB").composite*1024*1024;s.changed.connect(()=>{t=s.get("autoOpenUploads").composite,c=s.get("maxAutoOpenSizeMB").composite*1024*1024}),o.restored.then(()=>{const d=Array.from(a.toolbar.children()).find(f=>f instanceof K);if(!d){console.warn("Uploader widget not found");return}d.filesUploaded.connect((f,e)=>{const l=Array.from(o.docRegistry.fileTypes()).reduce((g,b)=>{if(b.extensions)for(const y of b.extensions)g.push(y.toLowerCase());return g},[]),m=e[0].name.toLowerCase(),w=l.some(g=>m.endsWith(g));if(e.length===1&&(e[0].type==="notebook"||e[0].type==="file")){const g=e[0];t&&g.size&&g.size<=c&&w?o.commands.execute("docmanager:open",{path:g.path}).catch(b=>{B(`Opening ${g.name} failed`,b)}):E.emit(r.__("Uploaded %1%2",g.name,g.size?` (${Ie(g.size,1,1024)})`:""),"info",{autoClose:5e3,actions:[{label:r.__("Open File"),callback:()=>{o.commands.execute("docmanager:open",{path:g.path}).catch(b=>{B(`Could not open ${g.name}`,b)})}}]})}else E.emit(r.__("Upload complete (%1 files)",e.length),"info",{autoClose:5e3,actions:[{label:r.__("Open All"),callback:()=>{e.forEach(g=>{o.commands.execute("docmanager:open",{path:g.path}).catch(b=>{B(`Could not open ${g.path}`,b)})})}}]})})})}};function Ze(o,a,h,p,r,s){const t=p.load("jupyterlab"),{docRegistry:c,commands:i}=o,{tracker:d}=h,f=v.PageConfig.getOption("delete_to_trash")==="true";i.addCommand(u.del,{execute:()=>{const e=d.currentWidget;if(e)return e.delete()},icon:ce.bindprops({stylesheet:"menuItem"}),label:f?t.__("Move to Trash"):t.__("Delete"),mnemonic:0,describedBy:{args:{type:"object",properties:{}}}}),i.addCommand(u.copy,{execute:()=>{const e=d.currentWidget;if(e)return e.copy()},icon:O.bindprops({stylesheet:"menuItem"}),label:t.__("Copy"),mnemonic:0,describedBy:{args:{type:"object",properties:{}}}}),i.addCommand(u.cut,{execute:()=>{const e=d.currentWidget;if(e)return e.cut()},icon:pe.bindprops({stylesheet:"menuItem"}),label:t.__("Cut"),describedBy:{args:{type:"object",properties:{}}}}),i.addCommand(u.duplicate,{execute:()=>{const e=d.currentWidget;if(e)return e.duplicate()},icon:O.bindprops({stylesheet:"menuItem"}),label:t.__("Duplicate"),describedBy:{args:{type:"object",properties:{}}}}),i.addCommand(u.selectAll,{execute:()=>{const e=d.currentWidget;if(e)return e.selectAll()},label:t.__("Select All"),describedBy:{args:{type:"object",properties:{}}}}),i.addCommand(u.goToPath,{label:t.__("Update the file browser to display the provided `path`."),describedBy:{args:{type:"object",properties:{path:{type:"string",description:t.__("The path to navigate to")},dontShowBrowser:{type:"boolean",description:t.__("Whether to avoid showing the browser")}}}},execute:async e=>{var n;const l=e.path||"",m=!((n=e?.dontShowBrowser)!==null&&n!==void 0&&n);try{if((await F.navigateToPath(l,a,h,p)).type!=="directory"&&m){const g=F.getBrowserForPath(l,a,h);if(g){g.clearSelectedItems();const b=l.split("/"),y=b[b.length-1];y&&await g.selectItemByName(y)}}}catch(w){console.warn(`${u.goToPath} failed to go to: ${l}`,w)}if(m)return i.execute(u.showBrowser,{path:l})}}),i.addCommand(u.goUp,{label:t.__("Go Up"),execute:async()=>{const e=F.getBrowserForPath("",a,h);if(!e)return;const{model:n}=e;await n.restored,e.goUp()},describedBy:{args:{type:"object",properties:{}}}}),i.addCommand(u.openPath,{label:e=>e.path?t.__("Open %1",e.path):t.__("Open from Path…"),caption:e=>e.path?t.__("Open %1",e.path):t.__("Open from path"),execute:async e=>{var n;let l;if(e?.path?l=e.path:l=(n=(await q.getText({label:t.__("Path"),placeholder:"/path/relative/to/jlab/root",title:t.__("Open Path"),okLabel:t.__("Open")})).value)!==null&&n!==void 0?n:void 0,!!l)try{const m=l!=="/"&&l.endsWith("/");m&&(l=l.slice(0,l.length-1));const w=F.getBrowserForPath(l,a,h),{services:g}=w.model.manager,b=await g.contents.get(l,{content:!1});if(m&&b.type!=="directory")throw new Error(`Path ${l}/ is not a directory`);return await i.execute(u.goToPath,{path:l,dontShowBrowser:e.dontShowBrowser}),b.type==="directory"?void 0:i.execute("docmanager:open",{path:l})}catch(m){return m.response&&m.response.status===404&&(m.message=t.__("Could not find path: %1",l)),B(t.__("Cannot open"),m)}},describedBy:{args:{type:"object",properties:{path:{type:"string",description:t.__("Path to the file or directory to open")},dontShowBrowser:{type:"boolean",description:t.__("Whether to avoid showing the file browser")}}}}}),s&&s.addItem({command:u.openPath,category:t.__("File Operations")}),i.addCommand(u.open,{execute:e=>{const n=e.factory||void 0,l=d.currentWidget;if(!l)return;const{contents:m}=l.model.manager.services;return Promise.all(Array.from(L(l.selectedItems(),w=>{if(w.type==="directory"){const g=m.localPath(w.path);return l.model.cd(`/${g}`)}return i.execute("docmanager:open",{factory:n,path:w.path,kernelPreference:e.kernelPreference})})))},icon:e=>{var n;const l=e.factory||void 0;if(l){const m=c.getFileType(l);return(n=m?.icon)===null||n===void 0?void 0:n.bindprops({stylesheet:"menuItem"})}else return H.bindprops({stylesheet:"menuItem"})},label:e=>e.label||e.factory||t.__("Open"),mnemonic:0,describedBy:{args:{type:"object",properties:{factory:{type:"string",description:t.__("The name of the widget factory to use")},label:{type:"string",description:t.__("The label to display for the command")}}}}}),i.addCommand(u.paste,{execute:()=>{const e=d.currentWidget;if(e)return e.paste()},icon:ue.bindprops({stylesheet:"menuItem"}),label:t.__("Paste"),mnemonic:0,describedBy:{args:{type:"object",properties:{}}}}),i.addCommand(u.createNewDirectory,{execute:()=>{const e=d.currentWidget;if(e)return e.createNewDirectory()},icon:he.bindprops({stylesheet:"menuItem"}),label:t.__("New Folder"),describedBy:{args:{type:"object",properties:{}}}}),i.addCommand(u.createNewFile,{execute:e=>{var n;const l=d.currentWidget;if(l)return l.createNewFile({ext:(n=e.ext)!==null&&n!==void 0?n:"txt"})},icon:e=>e.iconName?me.resolve({icon:e.iconName}):fe.bindprops({stylesheet:"menuItem"}),label:e=>e.label===void 0||e.label===null?t.__("New File"):t.__(e.label),describedBy:{args:{type:"object",properties:{label:{type:"string",default:"New File",description:t.__("The command label.")},iconName:{type:"string",description:t.__("The command icon.")},ext:{type:"string",default:"txt",description:t.__("The file extension.")}}}}}),i.addCommand(u.createNewMarkdownFile,{execute:()=>{const e=d.currentWidget;if(e)return e.createNewFile({ext:"md"})},icon:ge.bindprops({stylesheet:"menuItem"}),label:t.__("New Markdown File"),describedBy:{args:{type:"object",properties:{}}}}),i.addCommand(u.refresh,{execute:async()=>{const e=d.currentWidget;if(e){e.node.classList.add("jp-mod-refreshing");try{await e.model.refresh()}finally{e.node.classList.remove("jp-mod-refreshing")}}},icon:we.bindprops({stylesheet:"menuItem"}),caption:t.__("Refresh the file browser."),label:t.__("Refresh File List"),describedBy:{args:{type:"object",properties:{}}}}),i.addCommand(u.rename,{execute:e=>{const n=d.currentWidget;if(n)return n.rename()},isVisible:()=>!!d.currentWidget&&Array.from(d.currentWidget.selectedItems()).length===1,icon:be.bindprops({stylesheet:"menuItem"}),label:t.__("Rename"),mnemonic:0,describedBy:{args:{type:"object",properties:{}}}}),i.addCommand(u.copyPath,{execute:()=>{var e;const n=d.currentWidget;if(!n)return;const l=n.selectedItems().next();if(!l.done)if(v.PageConfig.getOption("copyAbsolutePath")==="true"){const m=v.PathExt.joinWithLeadingSlash((e=v.PageConfig.getOption("serverRoot"))!==null&&e!==void 0?e:"",l.value.path);N.copyToSystem(m)}else N.copyToSystem(l.value.path)},isVisible:()=>!!d.currentWidget&&Array.from(d.currentWidget.selectedItems()).length===1,icon:ye.bindprops({stylesheet:"menuItem"}),label:t.__("Copy Path"),describedBy:{args:{type:"object",properties:{}}}}),i.addCommand(u.shutdown,{execute:()=>{const e=d.currentWidget;if(e)return e.shutdownKernels()},icon:_e.bindprops({stylesheet:"menuItem"}),label:t.__("Shut Down Kernel"),describedBy:{args:{type:"object",properties:{}}}}),i.addCommand(u.toggleFileFilter,{execute:()=>{a.showFileFilter=!a.showFileFilter,i.notifyCommandChanged(u.toggleFileFilter)},isToggled:()=>a.showFileFilter,icon:ve.bindprops({stylesheet:"menuItem"}),label:t.__("Toggle File Filter"),describedBy:{args:{type:"object",properties:{}}}}),i.addCommand(u.toggleLastModified,{label:t.__("Show Last Modified Column"),isToggled:()=>a.showLastModifiedColumn,execute:()=>{const e=!a.showLastModifiedColumn,n="showLastModifiedColumn";if(r)return r.set(_,n,e).catch(l=>{console.error(`Failed to set ${n} setting`)})},describedBy:{args:{type:"object",properties:{}}}}),i.addCommand(u.toggleShowFullPath,{label:t.__("Show Full Path"),isToggled:()=>a.showFullPath,execute:()=>{const e=!a.showFullPath,n="showFullPath";if(r)return r.set(_,n,e).catch(l=>{console.error(`Failed to set ${n} setting`)})},describedBy:{args:{type:"object",properties:{}}}}),i.addCommand(u.toggleSortNotebooksFirst,{label:t.__("Sort Notebooks Above Files"),isToggled:()=>a.sortNotebooksFirst,execute:()=>{const e=!a.sortNotebooksFirst,n="sortNotebooksFirst";if(r)return r.set(_,n,e).catch(l=>{console.error(`Failed to set ${n} setting`)})},describedBy:{args:{type:"object",properties:{}}}}),i.addCommand(u.toggleDateCreated,{label:t.__("Show Date Created Column"),isToggled:()=>a.showDateCreatedColumn,execute:()=>{const e=!a.showDateCreatedColumn,n="showDateCreatedColumn";if(r)return r.set(_,n,e).catch(l=>{console.error(`Failed to set ${n} setting`)})},describedBy:{args:{type:"object",properties:{}}}}),i.addCommand(u.toggleFileSize,{label:t.__("Show File Size Column"),isToggled:()=>a.showFileSizeColumn,execute:()=>{const e=!a.showFileSizeColumn,n="showFileSizeColumn";if(r)return r.set(_,n,e).catch(l=>{console.error(`Failed to set ${n} setting`)})},describedBy:{args:{type:"object",properties:{}}}}),i.addCommand(u.toggleSingleClick,{label:t.__("Enable Single Click Navigation"),isToggled:()=>a.singleClickNavigation,execute:()=>{const e=!a.singleClickNavigation,n="singleClickNavigation";if(r)return r.set(_,n,e).catch(l=>{console.error("Failed to set singleClickNavigation setting")})},describedBy:{args:{type:"object",properties:{}}}}),i.addCommand(u.toggleHiddenFiles,{label:t.__("Show Hidden Files"),isToggled:()=>a.showHiddenFiles,isVisible:()=>v.PageConfig.getOption("allow_hidden_files")==="true",execute:()=>{const e=!a.showHiddenFiles,n="showHiddenFiles";if(r)return r.set(_,n,e).catch(l=>{console.error("Failed to set showHiddenFiles setting")})},describedBy:{args:{type:"object",properties:{}}}}),s&&s.addItem({command:u.toggleHiddenFiles,category:t.__("File Operations")}),i.addCommand(u.toggleFileCheckboxes,{label:t.__("Show File Checkboxes"),isToggled:()=>a.showFileCheckboxes,execute:()=>{const e=!a.showFileCheckboxes,n="showFileCheckboxes";if(r)return r.set(_,n,e).catch(l=>{console.error("Failed to set showFileCheckboxes setting")})},describedBy:{args:{type:"object",properties:{}}}}),i.addCommand(u.editPath,{execute:async()=>{var e;if(typeof a.editPath!="function"){console.error("`editPath` is not available on the current file browser");return}await i.execute(u.showBrowser),((e=d.currentWidget)!==null&&e!==void 0?e:a).editPath()},label:t.__("Edit File Browser Path"),isVisible:()=>typeof a.editPath=="function",describedBy:{args:{type:"object",properties:{}}}}),s&&s.addItem({command:u.editPath,category:t.__("File Operations")})}const ro=[Ve,He,ze,$e,De,Ke,Re,Q,Ge,Je,Ye,Qe,qe];var F;(function(o){function a(r,s,t){const{tracker:c}=t,i=s.model.manager.services.contents.driveName(r);if(i){const d=c.find(f=>f.model.driveName===i);if(!d){console.warn(`${u.goToPath} failed to find filebrowser for path: ${r}`);return}return d}return s}o.getBrowserForPath=a;async function h(r,s,t,c){const i=c.load("jupyterlab"),d=o.getBrowserForPath(r,s,t);if(!d)throw new Error(i.__("No browser for path"));const{services:f}=d.model.manager,e=f.contents.localPath(r);await f.ready;const n=await f.contents.get(r,{content:!1}),{model:l}=d;return await l.restored,n.type==="directory"?await l.cd(`/${e}`):await l.cd(`/${v.PathExt.dirname(e)}`),n}o.navigateToPath=h;async function p(r,s,t,c,i,d){const f="jp-mod-restoring";if(r.addClass(f),!t){await r.model.restore(r.id),await r.model.refresh(),r.removeClass(f);return}const e=async()=>{t.routed.disconnect(e);const n=await c?.paths;n?.file||n?.browser?(await r.model.restore(r.id,!1),n.file&&await s.execute(u.openPath,{path:n.file,dontShowBrowser:!0}),n.browser&&await s.execute(u.openPath,{path:n.browser,dontShowBrowser:!0})):(await r.model.restore(r.id),await r.model.refresh()),r.removeClass(f),d?.isEmpty("main")&&s.execute("launcher:create")};t.routed.connect(e)}o.restoreBrowser=p,(function(r){function s(c,i){const d=c.preferredWidgetFactories(i.path),f=c.getWidgetFactory("notebook");return f&&i.type==="notebook"&&d.indexOf(f)===-1&&d.unshift(f),d}r.getFactories=s;function t(c){let i;for(const d of c){if(i===void 0){i=new Set(d);continue}if(i.size===0)return i;let f=new Set;for(const e of d)i.has(e)&&f.add(e);i=f}return i??new Set}r.intersection=t})(o.OpenWith||(o.OpenWith={}))})(F||(F={}));export{ro as default,Ke as fileUploadStatus};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{d as V}from"./LexicalToolRegistry-6Vozo3NG.js";import{D as Vl,a as Yl,b as Gl,e as Zl,c as Kl,g as Ql,i as ec,f as tc,l as nc,h as sc,j as oc,k as rc,m as ic,n as ac,r as lc,o as cc,p as uc,q as dc,s as pc,t as fc,v as mc,w as gc,x as hc,y as bc,z as yc,u as xc}from"./LexicalToolRegistry-6Vozo3NG.js";import{_ as qt,E as Mn,G as Dn,H as Bn,K as me,M as Wt,O as ot,P as rt,Q as jn,R as Fn,S as Xt,U as Un,V as Jt,W as zn,X as Hn,Y as Vt,Z as Yt,a0 as qn,a1 as Wn,a2 as Xn,a3 as Jn,C as Gt,a4 as Vn,a5 as Zt,a6 as Yn,a7 as Gn,a8 as Ce,a9 as Q,aa as Kt,ab as it,ac as xe,ad as at,ae as Re,af as Zn,ag as Be,ah as Ve,ai as lt,aj as Kn,ak as Ye,al as Qn,am as es,an as ts,ao as Ge,ap as Qt,aq as en,ar as tn,as as Ie,at as ns,au as ss,av as nn,aw as os,ax as Pe,$ as rs,b as is,a as as,c as ls,ay as sn,az as Y,aA as cs,aB as us,aC as Ze,aD as ds,aE as ps,aF as fs,aG as ms,aH as ct,aI as gs,aJ as hs,aK as bs,aL as ys,aM as xs,aN as Es,aO as Oe,aP as Ke,aQ as bt,aR as yt,aS as Ts,aT as Cs,aU as vs,aV as ws,aW as Ss,aX as Ls,aY as _s,aZ as ks,a_ as As,x as on,a$ as Ns,b0 as $s,b1 as Rs,b2 as Is,b3 as Ps,b4 as Os,b5 as Ue,b6 as Ms,b7 as Ds,b8 as Bs,b9 as js,ba as Fs,bb as rn,bc as an,bd as ln,be as cn,j as Us,T as zs,L as Hs,w as qs,k as Ws,l as Xs,D as Js,m as Vs,n as Ys,o as Gs,p as Zs,t as Ks,bf as Qs,s as eo,F as to,u as no,v as so,bg as oo,bh as ro}from"./JupyterLexicalExtension-0W0-TUuV.js";import{bi as Tc,bj as Cc,bk as vc,bl as wc,bm as Sc,bn as Lc,bo as _c,bp as kc,bq as Ac,br as Nc,bs as $c,bt as Rc,bu as Ic,bv as Pc,d as Oc,e as Mc,bw as Dc,bx as Bc,B as jc,by as Fc,A as Uc,bz as zc,bA as Hc,bB as qc,bC as Wc,bD as Xc,bE as Jc,bF as Vc,bG as Yc,bH as Gc,bI as Zc,bJ as Kc,bK as Qc,bL as eu,bM as tu,bN as nu,bO as su,bP as ou,f as ru,bQ as iu,g as au,bR as lu,bS as cu,bT as uu,bU as du,bV as pu,q as fu,bW as mu,bX as gu,bY as hu,bZ as bu,b_ as yu,b$ as xu,c0 as Eu,c1 as Tu,c2 as Cu,c3 as vu,c4 as wu,c5 as Su,c6 as Lu,c7 as _u,c8 as ku,c9 as Au,ca as Nu,cb as $u,cc as Ru,cd as Iu,ce as Pu,cf as Ou,cg as Mu,ch as Du,ci as Bu,cj as ju,I as Fu,ck as Uu,cl as zu,cm as Hu,cn as qu,co as Wu,cp as Xu,cq as Ju,cr as Vu,cs as Yu,ct as Gu,cu as Zu,cv as Ku,h as Qu,z as ed,cw as td,cx as nd,cy as sd,cz as od,cA as rd,cB as id,cC as ad,cD as ld,cE as cd,cF as ud,cG as dd,J as pd,cH as fd,cI as md,cJ as gd,cK as hd,cL as bd,cM as yd,cN as xd,cO as Ed,cP as Td,cQ as Cd,cR as vd,cS as wd,cT as Sd,cU as Ld,cV as _d,cW as kd,cX as Ad,cY as Nd,cZ as $d,c_ as Rd,c$ as Id,d0 as Pd,d1 as Od,d2 as Md,d3 as Dd,d4 as Bd,d5 as jd,d6 as Fd,d7 as Ud,d8 as zd,d9 as Hd,da as qd,db as Wd,dc as Xd,dd as Jd,de as Vd,df as Yd,dg as Gd,dh as Zd,di as Kd,dj as Qd,dk as ep,dl as tp,dm as np,dn as sp,dp as op,dq as rp,dr as ip,ds as ap,dt as lp,du as cp,dv as up,dw as dp,dx as pp,dy as fp,dz as mp,dA as gp,dB as hp,dC as bp,dD as yp,dE as xp,dF as Ep,dG as Tp,dH as Cp,dI as vp,dJ as wp,dK as Sp,dL as Lp,dM as _p,dN as kp,dO as Ap,dP as Np,dQ as $p,dR as Rp,dS as Ip,dT as Pp,dU as Op,dV as Mp,dW as Dp,dX as Bp,dY as jp,dZ as Fp,d_ as Up,d$ as zp,e0 as Hp,e1 as qp,e2 as Wp,e3 as Xp,e4 as Jp,e5 as Vp,e6 as Yp,e7 as Gp,e8 as Zp,e9 as Kp,ea as Qp,eb as ef,ec as tf,ed as nf,ee as sf,ef as of,eg as rf,eh as af,ei as lf,ej as cf,ek as uf,el as df,em as pf,en as ff,eo as mf,ep as gf,eq as hf,er as bf,es as yf,et as xf,eu as Ef,ev as Tf,ew as Cf,ex as vf,ey as wf,ez as Sf,eA as Lf,eB as _f,eC as kf,eD as Af,eE as Nf,eF as $f,eG as Rf,eH as If,eI as Pf,eJ as Of,eK as Mf,eL as Df,eM as Bf,eN as jf,eO as Ff,eP as Uf,eQ as zf,eR as Hf,eS as qf,eT as Wf,eU as Xf,eV as Jf,eW as Vf,eX as Yf,r as Gf,eY as Zf,eZ as Kf,e_ as Qf,e$ as em,i as tm,f0 as nm,f1 as sm,f2 as om,f3 as rm,f4 as im,f5 as am,f6 as lm,f7 as cm,f8 as um,f9 as dm,fa as pm,fb as fm,fc as mm,fd as gm,fe as hm,ff as bm,fg as ym,fh as xm,fi as Em,fj as Tm,fk as Cm,fl as vm,fm as wm,fn as Sm,fo as Lm,fp as _m,fq as km,fr as Am,fs as Nm,ft as $m,fu as Rm,fv as Im}from"./JupyterLexicalExtension-0W0-TUuV.js";import{l$ as io,r as m,j as h,aW as ao,aQ as lo,B as co,a_ as ee,m0 as F,m1 as ae,m2 as un,m3 as fe,m4 as z,m5 as uo,m6 as po,m7 as fo,m8 as mo,m9 as j,aZ as ce,ma as Ee,mb as ut,mc as go,md as ho,me as bo,mf as yo,mg as dn,mh as xo,mi as Eo,mj as To,mk as Co,ml as vo,mm as wo,aY as So,aa as M,c5 as ve,mn as Lo,mo as se,mp as X,mq as ye,mr as _o,ms as ko,mt as Ao,c6 as No,mu as le,c8 as pn,mv as fn,mw as mn,br as gn,mx as pe,my as $o,mz as Ro,bw as ie,dn as Io,I as Le,f5 as hn,z as Po,y as Oo,ca as Mo,V as Do,mA as Bo,mB as jo,c9 as ze,mC as Fo,mD as xt,e7 as Uo,fl as zo,T as Ho,mE as Et,mF as qo,mG as Wo,mH as Xo,mI as Tt,mJ as Jo,mK as Vo,aR as Yo,aS as Go,aM as Zo,aX as Ko}from"../datalayer-app-main.js";import{CollapsiblePlugin as Om}from"./CollapsiblePlugin-CvJ7xecZ.js";import{u as Qo,N as Ct}from"./usePrimerThemeBridge-NsTRGuo7.js";import{u as er}from"./Output-CxP7dwY_.js";import{T as tr}from"./ThemeContext-D9ztCaU3.js";import{a as Dm,u as Bm}from"./ThemeContext-D9ztCaU3.js";import{YouTubePlugin as Fm}from"./YouTubePlugin-De7Nra03.js";import"./NotebookSkeleton-BaU6vrsb.js";import"./Avatar-Cv5OpUWu.js";import"./url-C6fJII94.js";import"./isSymbol-BLtK9CV6.js";import"./toNumber-B1wj8-wx.js";import"./StrikethroughIcon-CbiEuPT-.js";import"./VideoIcon-C3wcjUxu.js";import"./Toolbar-ByUGXe7J.js";import"./KebabHorizontalIcon-D6AY8pIS.js";import"./ArrowUpIcon-y5enrVH9.js";import"./SortDescIcon-Qif6E10I.js";import"./PaintbrushIcon-CFBHU-3l.js";import"./PrismCss-DQMhvzcI.js";import"./index-DWdhqvRC.js";import"./hoverbox-CStlKQWE.js";import"./index-BPBZr639.js";import"./index-BYGVk1jo.js";import"./dayjs.min-u3zuoSR8.js";import"./isEqual-BqptHyYZ.js";import"./d3-color-Jd8hXty2.js";import"./dist-BrUAt6vF.js";import"./index-CKWSKbHe.js";import"./RestartIcon-DvpOf5Mf.js";class nr{registry;_debug;constructor(t,n=!1){this.registry=t,this._debug=n}calculateIndent(t){const n=this.registry.getConfigOrDefault(t.language),s=this.getLeadingWhitespaceCount(t.currentLine);let o=s,r=!1,i=!1,l;for(const a of n.indentTriggers)if(this.matchesIndentRule(t.currentLine,a)){o=s+a.indentAmount,r=!0,l=a.name;break}if(!r){for(const a of n.dedentTriggers)if(this.matchesDedentRule(t.currentLine,a)){i=!0,l=a.name;break}}if(n.customRules){for(const a of n.customRules)if(a.condition(t.currentLine,t)){o=a.apply(o,t);break}}return o=Math.max(0,o),{spaces:o,shouldIndent:r,shouldDedent:i,triggeredRule:l}}getTabString(t){const n=this.registry.getConfigOrDefault(t);return n.useTabs?" ":" ".repeat(n.tabSize)}getTabSize(t){return this.registry.getConfigOrDefault(t).tabSize}calculateOutdent(t,n){const s=this.registry.getConfigOrDefault(n),o=t-s.tabSize;return Math.max(0,o)}getLeadingWhitespaceCount(t){const n=t.match(/^[\t ]*/);if(!n)return 0;const s=n[0];let o=0;for(const r of s)r===" "?o+=4:o+=1;return o}getLeadingWhitespace(t){const n=t.match(/^[\t ]*/);return n?n[0]:""}matchesIndentRule(t,n){switch(n.context){case"line-end":return n.pattern.test(t);case"line-start":return n.pattern.test(t);case"anywhere":return n.pattern.test(t);default:return!1}}matchesDedentRule(t,n){switch(n.context){case"line-start":return n.pattern.test(t);case"anywhere":return n.pattern.test(t);default:return!1}}normalizeIndentation(t,n){const s=this.registry.getConfigOrDefault(n);if(s.useTabs){const o=this.getLeadingWhitespace(t),r=o.length,i=Math.floor(r/s.tabSize),l=r%s.tabSize;return" ".repeat(i)+" ".repeat(l)+t.substring(o.length)}else{const o=this.getLeadingWhitespace(t);return o.replace(/\t/g," ".repeat(s.tabSize)).concat(t.substring(o.length))}}}const sr={language:"python",tabSize:4,useTabs:!1,indentTriggers:[{name:"colon-indent",pattern:/:\s*(#.*)?$/,context:"line-end",indentAmount:4},{name:"continuation-backslash",pattern:/\\\s*(#.*)?$/,context:"line-end",indentAmount:4},{name:"open-bracket",pattern:/[[({]\s*$/,context:"line-end",indentAmount:4}],dedentTriggers:[{name:"flow-control-keywords",pattern:/^\s*(return|break|continue|pass)(\s|$)/,context:"line-start",dedentAmount:4},{name:"raise-keyword",pattern:/^\s*raise(\s|$)/,context:"line-start",dedentAmount:4}],customRules:[{name:"close-bracket-dedent",condition:e=>/^\s*[\])}]/.test(e),apply:e=>Math.max(0,e-4)}]},bn={language:"javascript",tabSize:2,useTabs:!1,indentTriggers:[{name:"open-brace",pattern:/\{\s*(\/\/.*)?$/,context:"line-end",indentAmount:2},{name:"open-bracket",pattern:/\[\s*(\/\/.*)?$/,context:"line-end",indentAmount:2},{name:"open-paren",pattern:/\(\s*(\/\/.*)?$/,context:"line-end",indentAmount:2},{name:"arrow-function",pattern:/=>\s*(\/\/.*)?$/,context:"line-end",indentAmount:2},{name:"ternary-operator",pattern:/\?\s*(\/\/.*)?$/,context:"line-end",indentAmount:2}],dedentTriggers:[{name:"return-statement",pattern:/^\s*return(\s|;)/,context:"line-start",dedentAmount:2},{name:"break-continue",pattern:/^\s*(break|continue)(\s|;)/,context:"line-start",dedentAmount:2},{name:"throw-statement",pattern:/^\s*throw(\s|;)/,context:"line-start",dedentAmount:2}],customRules:[{name:"close-brace-dedent",condition:e=>/^\s*}/.test(e),apply:e=>Math.max(0,e-2)},{name:"close-bracket-dedent",condition:e=>/^\s*\]/.test(e),apply:e=>Math.max(0,e-2)},{name:"close-paren-dedent",condition:e=>/^\s*\)/.test(e),apply:e=>Math.max(0,e-2)},{name:"case-label",condition:e=>/^\s*(case\s+.*:|default:)/.test(e),apply:(e,t)=>e}]},or={...bn,language:"typescript"};class rr{configs;options;constructor(t={}){this.configs=new Map,this.options={defaultLanguage:"python",fallbackTabSize:4,debug:!1,...t},this.registerDefaultLanguages(),t.customConfigs&&t.customConfigs.forEach(n=>this.registerLanguage(n))}registerDefaultLanguages(){this.registerLanguage(sr),this.registerLanguage(bn),this.registerLanguage(or),this.registerAlias("py","python"),this.registerAlias("js","javascript"),this.registerAlias("ts","typescript"),this.registerAlias("jsx","javascript"),this.registerAlias("tsx","typescript")}registerLanguage(t){if(this.configs.has(t.language)){this.options.debug&&console.warn(`[LanguageIndentRegistry] Language '${t.language}' already registered. Use updateConfig() to modify.`);return}this.configs.set(t.language,t)}registerAlias(t,n){const s=this.configs.get(n);s&&this.configs.set(t,s)}getConfig(t){if(!t)return this.getConfig(this.options.defaultLanguage);const n=t.toLowerCase().trim();return this.configs.get(n)}getConfigOrDefault(t){const n=this.getConfig(t);if(n)return n;const s=this.getConfig(this.options.defaultLanguage);return s?(this.options.debug&&console.warn(`[LanguageIndentRegistry] Language '${t}' not found, using default: ${this.options.defaultLanguage}`),s):(this.options.debug&&console.error(`[LanguageIndentRegistry] No config found for '${t}' and default '${this.options.defaultLanguage}' missing!`),this.createFallbackConfig(t||"unknown"))}createFallbackConfig(t){return{language:t,tabSize:this.options.fallbackTabSize||4,useTabs:this.options.preserveTabs||!1,indentTriggers:[],dedentTriggers:[]}}hasLanguage(t){if(!t)return!1;const n=t.toLowerCase().trim();return this.configs.has(n)}updateConfig(t,n){const s=t.toLowerCase().trim(),o=this.configs.get(s);if(!o)return this.options.debug&&console.warn(`[LanguageIndentRegistry] Cannot update '${t}' - not registered`),!1;const r={...o,...n,language:o.language};return this.configs.set(s,r),!0}getRegisteredLanguages(){return Array.from(this.configs.keys())}clear(){this.configs.clear()}reset(){this.clear(),this.registerDefaultLanguages()}}const ir="[Deleted Comment]",Qe=e=>e.uid===e.thread_uid,yn=e=>e.anchor?.mark_id??e.uid,ar=(e,t)=>e.created_at!==t.created_at?e.created_at<t.created_at?-1:1:e.uid<t.uid?-1:e.uid>t.uid?1:0,He=(e,t)=>e!==void 0&&e.updated_at>t.updated_at?e:t,vt=e=>{const{uid:t,handle:n,name:s,agent_uid:o}=e.author;return t?{kind:"user",uid:t,handle:n??null,name:s??null,...o?{agentUid:o}:{}}:Bn(s||n)},lr=e=>({type:"comment",id:e.uid,author:Dn(vt(e)),authorPrincipal:vt(e),content:e.deleted?ir:e.body,deleted:e.deleted,...e.mentions&&e.mentions.length>0?{mentions:e.mentions}:{},timeStamp:Date.parse(e.created_at)});function cr(e){const t=[...e].sort(ar),n=new Map;for(const s of t)Qe(s)||n.set(s.thread_uid,[...n.get(s.thread_uid)??[],s]);return t.filter(s=>Qe(s)&&!s.deleted&&s.status==="open").map(s=>({type:"thread",id:yn(s),quote:s.quote??"",assignee:s.assignee??null,comments:[s,...n.get(s.uid)??[]].map(lr)}))}const wt=e=>e&&e.length>0?{mentions:e}:{};class dl{searchPeople;assignThread;_editor;_backend;_options;_listeners=new Set;_heardDuringReads=new Set;_records=new Map;_comments=[];constructor(t,n,s={}){this._editor=t,this._backend=n,this._options=s;const{searchPeople:o,assign:r}=n;o&&(this.searchPeople=i=>o.call(n,i).catch(l=>{throw this._options.onError?.(l),l})),r&&(this.assignThread=(i,l)=>this._write(()=>r.call(n,this._threadRecord(i).uid,l?.uid??null)))}connect(){const t=this._backend.subscribe({comment:n=>this._heard(n),ready:()=>{this.refresh()}});return this.refresh(),t}async refresh(){const t=new Map;this._heardDuringReads.add(t);try{const n=await this._backend.list(),s=new Map(n.map(o=>[o.uid,o]));for(const[o,r]of t)s.set(o,He(s.get(o),r));this._records=s,this._changed()}catch(n){this._options.onError?.(n)}finally{this._heardDuringReads.delete(t)}}getComments(){return this._comments}addComment(t,n){if(t.type==="thread"){const s=t.id,o=t.comments[0];this._write(()=>this._backend.create({body:o?.content??"",anchor:{mark_id:s},quote:t.quote,...wt(o?.mentions)}),()=>this._unmark(s))}else n!==void 0?this._write(()=>this._backend.create({body:t.content,thread_uid:this._threadRecord(n).uid,...wt(t.mentions)})):this._options.onError?.(new Error("A comment is written in a thread."))}deleteComment(t){this._write(()=>this._backend.delete(t.id))}deleteThread(t){this._write(()=>this._backend.delete(this._threadRecord(t).uid))}resolveThread(t){this._write(()=>this._backend.resolve(this._threadRecord(t).uid))}registerOnChange(t){return this._listeners.add(t),()=>{this._listeners.delete(t)}}_write(t,n){Promise.resolve().then(t).then(s=>this._heard(s),s=>{n?.(),this._options.onError?.(s)})}_threadRecord(t){for(const n of this._records.values())if(Qe(n)&&yn(n)===t.id)return n;throw new Error(`The thread ${t.id} is not one the store read.`)}_heard(t){for(const n of this._heardDuringReads)n.set(t.uid,He(n.get(t.uid),t));this._records.set(t.uid,He(this._records.get(t.uid),t)),this._changed()}_changed(){this._comments=cr(this._records.values());for(const t of this._listeners)t()}_unmark(t){this._editor.update(()=>{for(const{node:n}of io())qt(n)&&n.getIDs().includes(t)&&(n.deleteID(t),n.getIDs().length===0&&Mn(n))})}}const dt=m.createContext(void 0);function ur(){const e=m.useContext(dt);if(!e)throw new Error("useContext must be inside a Provider with a value");return e}const dr=dt.Provider,pl=dt.Consumer,fl=({children:e})=>{const[t,n]=m.useState();return h.jsx(dr,{value:{editor:t,setEditor:n},children:e})};function ml(e){const{useStore:t,children:n}=e,{colorMode:s,resolvedMode:o,themeConfig:r,themeBackground:i,lexicalTheme:l}=Qo(t);return h.jsx(ao,{colorMode:s,theme:r.primerTheme,themeStyles:r.themeStyles,children:h.jsx(lo,{colormode:o,backgroundColor:i,useBaseStyles:!1,children:h.jsx(co,{sx:{"& .editor-shell":{backgroundColor:i,borderRadius:2},"& .editor-container":{backgroundColor:i},"& .editor-inner":{backgroundColor:i},"& .editor-input":{backgroundColor:i},'& [role="toolbar"][aria-label="Editor toolbar"]':{backgroundColor:i}},children:h.jsx(tr.Provider,{value:{theme:l},children:n})})})})}const pr={"\\":"\\textbackslash{}","{":"\\{","}":"\\}",$:"\\$","&":"\\&","#":"\\#","^":"\\^{}",_:"\\_","%":"\\%","~":"\\~{}"};function K(e){return e.replace(/[\\{}$&#^_%~]/g,t=>pr[t]??t)}function pt(e,t,n="{",s="}"){let o=0;for(let r=t;r<e.length;r++){const i=e[r];if(i==="\\"){r++;continue}if(i===n)o++;else if(i===s&&(o--,o===0))return r}return-1}function W(e,t){let n=t;for(;n<e.length&&(e[n]===" "||e[n]===`
|
|
1
|
+
import{d as V}from"./LexicalToolRegistry-D44mKdur.js";import{D as Vl,a as Yl,b as Gl,e as Zl,c as Kl,g as Ql,i as ec,f as tc,l as nc,h as sc,j as oc,k as rc,m as ic,n as ac,r as lc,o as cc,p as uc,q as dc,s as pc,t as fc,v as mc,w as gc,x as hc,y as bc,z as yc,u as xc}from"./LexicalToolRegistry-D44mKdur.js";import{_ as qt,E as Mn,G as Dn,H as Bn,K as me,M as Wt,O as ot,P as rt,Q as jn,R as Fn,S as Xt,U as Un,V as Jt,W as zn,X as Hn,Y as Vt,Z as Yt,a0 as qn,a1 as Wn,a2 as Xn,a3 as Jn,C as Gt,a4 as Vn,a5 as Zt,a6 as Yn,a7 as Gn,a8 as Ce,a9 as Q,aa as Kt,ab as it,ac as xe,ad as at,ae as Re,af as Zn,ag as Be,ah as Ve,ai as lt,aj as Kn,ak as Ye,al as Qn,am as es,an as ts,ao as Ge,ap as Qt,aq as en,ar as tn,as as Ie,at as ns,au as ss,av as nn,aw as os,ax as Pe,$ as rs,b as is,a as as,c as ls,ay as sn,az as Y,aA as cs,aB as us,aC as Ze,aD as ds,aE as ps,aF as fs,aG as ms,aH as ct,aI as gs,aJ as hs,aK as bs,aL as ys,aM as xs,aN as Es,aO as Oe,aP as Ke,aQ as bt,aR as yt,aS as Ts,aT as Cs,aU as vs,aV as ws,aW as Ss,aX as Ls,aY as _s,aZ as ks,a_ as As,x as on,a$ as Ns,b0 as $s,b1 as Rs,b2 as Is,b3 as Ps,b4 as Os,b5 as Ue,b6 as Ms,b7 as Ds,b8 as Bs,b9 as js,ba as Fs,bb as rn,bc as an,bd as ln,be as cn,j as Us,T as zs,L as Hs,w as qs,k as Ws,l as Xs,D as Js,m as Vs,n as Ys,o as Gs,p as Zs,t as Ks,bf as Qs,s as eo,F as to,u as no,v as so,bg as oo,bh as ro}from"./JupyterLexicalExtension-2cy2JM3c.js";import{bi as Tc,bj as Cc,bk as vc,bl as wc,bm as Sc,bn as Lc,bo as _c,bp as kc,bq as Ac,br as Nc,bs as $c,bt as Rc,bu as Ic,bv as Pc,d as Oc,e as Mc,bw as Dc,bx as Bc,B as jc,by as Fc,A as Uc,bz as zc,bA as Hc,bB as qc,bC as Wc,bD as Xc,bE as Jc,bF as Vc,bG as Yc,bH as Gc,bI as Zc,bJ as Kc,bK as Qc,bL as eu,bM as tu,bN as nu,bO as su,bP as ou,f as ru,bQ as iu,g as au,bR as lu,bS as cu,bT as uu,bU as du,bV as pu,q as fu,bW as mu,bX as gu,bY as hu,bZ as bu,b_ as yu,b$ as xu,c0 as Eu,c1 as Tu,c2 as Cu,c3 as vu,c4 as wu,c5 as Su,c6 as Lu,c7 as _u,c8 as ku,c9 as Au,ca as Nu,cb as $u,cc as Ru,cd as Iu,ce as Pu,cf as Ou,cg as Mu,ch as Du,ci as Bu,cj as ju,I as Fu,ck as Uu,cl as zu,cm as Hu,cn as qu,co as Wu,cp as Xu,cq as Ju,cr as Vu,cs as Yu,ct as Gu,cu as Zu,cv as Ku,h as Qu,z as ed,cw as td,cx as nd,cy as sd,cz as od,cA as rd,cB as id,cC as ad,cD as ld,cE as cd,cF as ud,cG as dd,J as pd,cH as fd,cI as md,cJ as gd,cK as hd,cL as bd,cM as yd,cN as xd,cO as Ed,cP as Td,cQ as Cd,cR as vd,cS as wd,cT as Sd,cU as Ld,cV as _d,cW as kd,cX as Ad,cY as Nd,cZ as $d,c_ as Rd,c$ as Id,d0 as Pd,d1 as Od,d2 as Md,d3 as Dd,d4 as Bd,d5 as jd,d6 as Fd,d7 as Ud,d8 as zd,d9 as Hd,da as qd,db as Wd,dc as Xd,dd as Jd,de as Vd,df as Yd,dg as Gd,dh as Zd,di as Kd,dj as Qd,dk as ep,dl as tp,dm as np,dn as sp,dp as op,dq as rp,dr as ip,ds as ap,dt as lp,du as cp,dv as up,dw as dp,dx as pp,dy as fp,dz as mp,dA as gp,dB as hp,dC as bp,dD as yp,dE as xp,dF as Ep,dG as Tp,dH as Cp,dI as vp,dJ as wp,dK as Sp,dL as Lp,dM as _p,dN as kp,dO as Ap,dP as Np,dQ as $p,dR as Rp,dS as Ip,dT as Pp,dU as Op,dV as Mp,dW as Dp,dX as Bp,dY as jp,dZ as Fp,d_ as Up,d$ as zp,e0 as Hp,e1 as qp,e2 as Wp,e3 as Xp,e4 as Jp,e5 as Vp,e6 as Yp,e7 as Gp,e8 as Zp,e9 as Kp,ea as Qp,eb as ef,ec as tf,ed as nf,ee as sf,ef as of,eg as rf,eh as af,ei as lf,ej as cf,ek as uf,el as df,em as pf,en as ff,eo as mf,ep as gf,eq as hf,er as bf,es as yf,et as xf,eu as Ef,ev as Tf,ew as Cf,ex as vf,ey as wf,ez as Sf,eA as Lf,eB as _f,eC as kf,eD as Af,eE as Nf,eF as $f,eG as Rf,eH as If,eI as Pf,eJ as Of,eK as Mf,eL as Df,eM as Bf,eN as jf,eO as Ff,eP as Uf,eQ as zf,eR as Hf,eS as qf,eT as Wf,eU as Xf,eV as Jf,eW as Vf,eX as Yf,r as Gf,eY as Zf,eZ as Kf,e_ as Qf,e$ as em,i as tm,f0 as nm,f1 as sm,f2 as om,f3 as rm,f4 as im,f5 as am,f6 as lm,f7 as cm,f8 as um,f9 as dm,fa as pm,fb as fm,fc as mm,fd as gm,fe as hm,ff as bm,fg as ym,fh as xm,fi as Em,fj as Tm,fk as Cm,fl as vm,fm as wm,fn as Sm,fo as Lm,fp as _m,fq as km,fr as Am,fs as Nm,ft as $m,fu as Rm,fv as Im}from"./JupyterLexicalExtension-2cy2JM3c.js";import{m0 as io,r as m,j as h,aW as ao,aQ as lo,B as co,a_ as ee,m1 as F,m2 as ae,m3 as un,m4 as fe,m5 as z,m6 as uo,m7 as po,m8 as fo,m9 as mo,ma as j,aZ as ce,mb as Ee,mc as ut,md as go,me as ho,mf as bo,mg as yo,mh as dn,mi as xo,mj as Eo,mk as To,ml as Co,mm as vo,mn as wo,aY as So,aa as M,c5 as ve,mo as Lo,mp as se,mq as X,mr as ye,ms as _o,mt as ko,mu as Ao,c6 as No,mv as le,c8 as pn,mw as fn,mx as mn,br as gn,my as pe,mz as $o,mA as Ro,bw as ie,dn as Io,I as Le,f6 as hn,z as Po,y as Oo,ca as Mo,V as Do,mB as Bo,mC as jo,c9 as ze,mD as Fo,mE as xt,e7 as Uo,fm as zo,T as Ho,mF as Et,mG as qo,mH as Wo,mI as Xo,mJ as Tt,mK as Jo,mL as Vo,aR as Yo,aS as Go,aM as Zo,aX as Ko}from"../datalayer-app-main.js";import{CollapsiblePlugin as Om}from"./CollapsiblePlugin-iSVyLt0a.js";import{u as Qo,N as Ct}from"./usePrimerThemeBridge-NsTRGuo7.js";import{u as er}from"./Output-BsFagSE6.js";import{T as tr}from"./ThemeContext-D9ztCaU3.js";import{a as Dm,u as Bm}from"./ThemeContext-D9ztCaU3.js";import{YouTubePlugin as Fm}from"./YouTubePlugin-Yis7VDLP.js";import"./NotebookSkeleton-BaU6vrsb.js";import"./Avatar-Cv5OpUWu.js";import"./url-C6fJII94.js";import"./isSymbol-BLtK9CV6.js";import"./toNumber-B1wj8-wx.js";import"./StrikethroughIcon-CbiEuPT-.js";import"./VideoIcon-C3wcjUxu.js";import"./Toolbar-ByUGXe7J.js";import"./KebabHorizontalIcon-D6AY8pIS.js";import"./ArrowUpIcon-y5enrVH9.js";import"./SortDescIcon-Qif6E10I.js";import"./PaintbrushIcon-CFBHU-3l.js";import"./PrismCss-DQMhvzcI.js";import"./index-gFUsWgU1.js";import"./hoverbox-CStlKQWE.js";import"./index-C1Tx7ck6.js";import"./index-DYBuJWF3.js";import"./dayjs.min-u3zuoSR8.js";import"./isEqual-D9LEOOsI.js";import"./d3-color-Jd8hXty2.js";import"./dist-BrUAt6vF.js";import"./index-CKWSKbHe.js";import"./RestartIcon-DvpOf5Mf.js";class nr{registry;_debug;constructor(t,n=!1){this.registry=t,this._debug=n}calculateIndent(t){const n=this.registry.getConfigOrDefault(t.language),s=this.getLeadingWhitespaceCount(t.currentLine);let o=s,r=!1,i=!1,l;for(const a of n.indentTriggers)if(this.matchesIndentRule(t.currentLine,a)){o=s+a.indentAmount,r=!0,l=a.name;break}if(!r){for(const a of n.dedentTriggers)if(this.matchesDedentRule(t.currentLine,a)){i=!0,l=a.name;break}}if(n.customRules){for(const a of n.customRules)if(a.condition(t.currentLine,t)){o=a.apply(o,t);break}}return o=Math.max(0,o),{spaces:o,shouldIndent:r,shouldDedent:i,triggeredRule:l}}getTabString(t){const n=this.registry.getConfigOrDefault(t);return n.useTabs?" ":" ".repeat(n.tabSize)}getTabSize(t){return this.registry.getConfigOrDefault(t).tabSize}calculateOutdent(t,n){const s=this.registry.getConfigOrDefault(n),o=t-s.tabSize;return Math.max(0,o)}getLeadingWhitespaceCount(t){const n=t.match(/^[\t ]*/);if(!n)return 0;const s=n[0];let o=0;for(const r of s)r===" "?o+=4:o+=1;return o}getLeadingWhitespace(t){const n=t.match(/^[\t ]*/);return n?n[0]:""}matchesIndentRule(t,n){switch(n.context){case"line-end":return n.pattern.test(t);case"line-start":return n.pattern.test(t);case"anywhere":return n.pattern.test(t);default:return!1}}matchesDedentRule(t,n){switch(n.context){case"line-start":return n.pattern.test(t);case"anywhere":return n.pattern.test(t);default:return!1}}normalizeIndentation(t,n){const s=this.registry.getConfigOrDefault(n);if(s.useTabs){const o=this.getLeadingWhitespace(t),r=o.length,i=Math.floor(r/s.tabSize),l=r%s.tabSize;return" ".repeat(i)+" ".repeat(l)+t.substring(o.length)}else{const o=this.getLeadingWhitespace(t);return o.replace(/\t/g," ".repeat(s.tabSize)).concat(t.substring(o.length))}}}const sr={language:"python",tabSize:4,useTabs:!1,indentTriggers:[{name:"colon-indent",pattern:/:\s*(#.*)?$/,context:"line-end",indentAmount:4},{name:"continuation-backslash",pattern:/\\\s*(#.*)?$/,context:"line-end",indentAmount:4},{name:"open-bracket",pattern:/[[({]\s*$/,context:"line-end",indentAmount:4}],dedentTriggers:[{name:"flow-control-keywords",pattern:/^\s*(return|break|continue|pass)(\s|$)/,context:"line-start",dedentAmount:4},{name:"raise-keyword",pattern:/^\s*raise(\s|$)/,context:"line-start",dedentAmount:4}],customRules:[{name:"close-bracket-dedent",condition:e=>/^\s*[\])}]/.test(e),apply:e=>Math.max(0,e-4)}]},bn={language:"javascript",tabSize:2,useTabs:!1,indentTriggers:[{name:"open-brace",pattern:/\{\s*(\/\/.*)?$/,context:"line-end",indentAmount:2},{name:"open-bracket",pattern:/\[\s*(\/\/.*)?$/,context:"line-end",indentAmount:2},{name:"open-paren",pattern:/\(\s*(\/\/.*)?$/,context:"line-end",indentAmount:2},{name:"arrow-function",pattern:/=>\s*(\/\/.*)?$/,context:"line-end",indentAmount:2},{name:"ternary-operator",pattern:/\?\s*(\/\/.*)?$/,context:"line-end",indentAmount:2}],dedentTriggers:[{name:"return-statement",pattern:/^\s*return(\s|;)/,context:"line-start",dedentAmount:2},{name:"break-continue",pattern:/^\s*(break|continue)(\s|;)/,context:"line-start",dedentAmount:2},{name:"throw-statement",pattern:/^\s*throw(\s|;)/,context:"line-start",dedentAmount:2}],customRules:[{name:"close-brace-dedent",condition:e=>/^\s*}/.test(e),apply:e=>Math.max(0,e-2)},{name:"close-bracket-dedent",condition:e=>/^\s*\]/.test(e),apply:e=>Math.max(0,e-2)},{name:"close-paren-dedent",condition:e=>/^\s*\)/.test(e),apply:e=>Math.max(0,e-2)},{name:"case-label",condition:e=>/^\s*(case\s+.*:|default:)/.test(e),apply:(e,t)=>e}]},or={...bn,language:"typescript"};class rr{configs;options;constructor(t={}){this.configs=new Map,this.options={defaultLanguage:"python",fallbackTabSize:4,debug:!1,...t},this.registerDefaultLanguages(),t.customConfigs&&t.customConfigs.forEach(n=>this.registerLanguage(n))}registerDefaultLanguages(){this.registerLanguage(sr),this.registerLanguage(bn),this.registerLanguage(or),this.registerAlias("py","python"),this.registerAlias("js","javascript"),this.registerAlias("ts","typescript"),this.registerAlias("jsx","javascript"),this.registerAlias("tsx","typescript")}registerLanguage(t){if(this.configs.has(t.language)){this.options.debug&&console.warn(`[LanguageIndentRegistry] Language '${t.language}' already registered. Use updateConfig() to modify.`);return}this.configs.set(t.language,t)}registerAlias(t,n){const s=this.configs.get(n);s&&this.configs.set(t,s)}getConfig(t){if(!t)return this.getConfig(this.options.defaultLanguage);const n=t.toLowerCase().trim();return this.configs.get(n)}getConfigOrDefault(t){const n=this.getConfig(t);if(n)return n;const s=this.getConfig(this.options.defaultLanguage);return s?(this.options.debug&&console.warn(`[LanguageIndentRegistry] Language '${t}' not found, using default: ${this.options.defaultLanguage}`),s):(this.options.debug&&console.error(`[LanguageIndentRegistry] No config found for '${t}' and default '${this.options.defaultLanguage}' missing!`),this.createFallbackConfig(t||"unknown"))}createFallbackConfig(t){return{language:t,tabSize:this.options.fallbackTabSize||4,useTabs:this.options.preserveTabs||!1,indentTriggers:[],dedentTriggers:[]}}hasLanguage(t){if(!t)return!1;const n=t.toLowerCase().trim();return this.configs.has(n)}updateConfig(t,n){const s=t.toLowerCase().trim(),o=this.configs.get(s);if(!o)return this.options.debug&&console.warn(`[LanguageIndentRegistry] Cannot update '${t}' - not registered`),!1;const r={...o,...n,language:o.language};return this.configs.set(s,r),!0}getRegisteredLanguages(){return Array.from(this.configs.keys())}clear(){this.configs.clear()}reset(){this.clear(),this.registerDefaultLanguages()}}const ir="[Deleted Comment]",Qe=e=>e.uid===e.thread_uid,yn=e=>e.anchor?.mark_id??e.uid,ar=(e,t)=>e.created_at!==t.created_at?e.created_at<t.created_at?-1:1:e.uid<t.uid?-1:e.uid>t.uid?1:0,He=(e,t)=>e!==void 0&&e.updated_at>t.updated_at?e:t,vt=e=>{const{uid:t,handle:n,name:s,agent_uid:o}=e.author;return t?{kind:"user",uid:t,handle:n??null,name:s??null,...o?{agentUid:o}:{}}:Bn(s||n)},lr=e=>({type:"comment",id:e.uid,author:Dn(vt(e)),authorPrincipal:vt(e),content:e.deleted?ir:e.body,deleted:e.deleted,...e.mentions&&e.mentions.length>0?{mentions:e.mentions}:{},timeStamp:Date.parse(e.created_at)});function cr(e){const t=[...e].sort(ar),n=new Map;for(const s of t)Qe(s)||n.set(s.thread_uid,[...n.get(s.thread_uid)??[],s]);return t.filter(s=>Qe(s)&&!s.deleted&&s.status==="open").map(s=>({type:"thread",id:yn(s),quote:s.quote??"",assignee:s.assignee??null,comments:[s,...n.get(s.uid)??[]].map(lr)}))}const wt=e=>e&&e.length>0?{mentions:e}:{};class dl{searchPeople;assignThread;_editor;_backend;_options;_listeners=new Set;_heardDuringReads=new Set;_records=new Map;_comments=[];constructor(t,n,s={}){this._editor=t,this._backend=n,this._options=s;const{searchPeople:o,assign:r}=n;o&&(this.searchPeople=i=>o.call(n,i).catch(l=>{throw this._options.onError?.(l),l})),r&&(this.assignThread=(i,l)=>this._write(()=>r.call(n,this._threadRecord(i).uid,l?.uid??null)))}connect(){const t=this._backend.subscribe({comment:n=>this._heard(n),ready:()=>{this.refresh()}});return this.refresh(),t}async refresh(){const t=new Map;this._heardDuringReads.add(t);try{const n=await this._backend.list(),s=new Map(n.map(o=>[o.uid,o]));for(const[o,r]of t)s.set(o,He(s.get(o),r));this._records=s,this._changed()}catch(n){this._options.onError?.(n)}finally{this._heardDuringReads.delete(t)}}getComments(){return this._comments}addComment(t,n){if(t.type==="thread"){const s=t.id,o=t.comments[0];this._write(()=>this._backend.create({body:o?.content??"",anchor:{mark_id:s},quote:t.quote,...wt(o?.mentions)}),()=>this._unmark(s))}else n!==void 0?this._write(()=>this._backend.create({body:t.content,thread_uid:this._threadRecord(n).uid,...wt(t.mentions)})):this._options.onError?.(new Error("A comment is written in a thread."))}deleteComment(t){this._write(()=>this._backend.delete(t.id))}deleteThread(t){this._write(()=>this._backend.delete(this._threadRecord(t).uid))}resolveThread(t){this._write(()=>this._backend.resolve(this._threadRecord(t).uid))}registerOnChange(t){return this._listeners.add(t),()=>{this._listeners.delete(t)}}_write(t,n){Promise.resolve().then(t).then(s=>this._heard(s),s=>{n?.(),this._options.onError?.(s)})}_threadRecord(t){for(const n of this._records.values())if(Qe(n)&&yn(n)===t.id)return n;throw new Error(`The thread ${t.id} is not one the store read.`)}_heard(t){for(const n of this._heardDuringReads)n.set(t.uid,He(n.get(t.uid),t));this._records.set(t.uid,He(this._records.get(t.uid),t)),this._changed()}_changed(){this._comments=cr(this._records.values());for(const t of this._listeners)t()}_unmark(t){this._editor.update(()=>{for(const{node:n}of io())qt(n)&&n.getIDs().includes(t)&&(n.deleteID(t),n.getIDs().length===0&&Mn(n))})}}const dt=m.createContext(void 0);function ur(){const e=m.useContext(dt);if(!e)throw new Error("useContext must be inside a Provider with a value");return e}const dr=dt.Provider,pl=dt.Consumer,fl=({children:e})=>{const[t,n]=m.useState();return h.jsx(dr,{value:{editor:t,setEditor:n},children:e})};function ml(e){const{useStore:t,children:n}=e,{colorMode:s,resolvedMode:o,themeConfig:r,themeBackground:i,lexicalTheme:l}=Qo(t);return h.jsx(ao,{colorMode:s,theme:r.primerTheme,themeStyles:r.themeStyles,children:h.jsx(lo,{colormode:o,backgroundColor:i,useBaseStyles:!1,children:h.jsx(co,{sx:{"& .editor-shell":{backgroundColor:i,borderRadius:2},"& .editor-container":{backgroundColor:i},"& .editor-inner":{backgroundColor:i},"& .editor-input":{backgroundColor:i},'& [role="toolbar"][aria-label="Editor toolbar"]':{backgroundColor:i}},children:h.jsx(tr.Provider,{value:{theme:l},children:n})})})})}const pr={"\\":"\\textbackslash{}","{":"\\{","}":"\\}",$:"\\$","&":"\\&","#":"\\#","^":"\\^{}",_:"\\_","%":"\\%","~":"\\~{}"};function K(e){return e.replace(/[\\{}$&#^_%~]/g,t=>pr[t]??t)}function pt(e,t,n="{",s="}"){let o=0;for(let r=t;r<e.length;r++){const i=e[r];if(i==="\\"){r++;continue}if(i===n)o++;else if(i===s&&(o--,o===0))return r}return-1}function W(e,t){let n=t;for(;n<e.length&&(e[n]===" "||e[n]===`
|
|
2
2
|
`);)n++;if(e[n]!=="{")return null;const s=pt(e,n);return s===-1?null:{value:e.slice(n+1,s),end:s+1}}function ne(e,t){let n=t;for(;n<e.length&&e[n]===" ";)n++;if(e[n]!=="[")return null;const s=pt(e,n,"[","]");return s===-1?null:{value:e.slice(n+1,s),end:s+1}}function xn(e){return e.split(`
|
|
3
3
|
`).map(t=>{for(let n=0;n<t.length;n++){if(t[n]==="\\"){n++;continue}if(t[n]==="%")return t.slice(0,n)}return t}).join(`
|
|
4
4
|
`)}function En(e,t){if(!e)return null;const n=new RegExp(`(?:^|,)\\s*${t}\\s*=\\s*([^,]+)`).exec(e);return n?n[1].trim():null}function oe(e,t,n){const s=[];let o=t;for(let r=0;r<n;r++){const i=W(e,o);if(!i)break;s.push(i.value),o=i.end}return{values:s,end:o}}function fr(e){const t=e.indexOf("\\begin{document}");if(t===-1)return{body:e,preamble:""};const n=t+16,s=e.lastIndexOf("\\end{document}");return{body:s===-1?e.slice(n):e.slice(n,s),preamble:e.slice(0,t)}}function Tn(e){return e.charAt(0).toUpperCase()+e.slice(1)}const mr=new Set(["book","report","memoir","scrbook","scrreprt","amsbook","thesis","mitthesis","phdthesis","bookest"]);function Cn(e,t){return mr.has((e??"").toLowerCase())||t!==void 0&&/(?<!\\)\\chapter\b/.test(t)}const gr={h1:"section",h2:"subsection",h3:"subsubsection",h4:"paragraph",h5:"subparagraph",h6:"subparagraph"},hr={h1:"chapter",h2:"section",h3:"subsection",h4:"subsubsection",h5:"paragraph",h6:"subparagraph"},br={part:"h1",chapter:"h1",section:"h1",subsection:"h2",subsubsection:"h3",paragraph:"h4",subparagraph:"h5"},yr={part:"h1",chapter:"h1",section:"h2",subsection:"h3",subsubsection:"h4",paragraph:"h5",subparagraph:"h6"};function xr(e){return e?{js:"JavaScript",javascript:"JavaScript",ts:"TypeScript",typescript:"TypeScript",py:"Python",python:"Python",sh:"bash",bash:"bash",r:"R",sql:"SQL",c:"C",cpp:"C++",java:"Java",html:"HTML",xml:"XML",json:"JSON",markdown:"Markdown",md:"Markdown"}[e.toLowerCase()]??e:null}function ft(e){return e.replace(/^\n/,"").replace(/\n[ \t]*$/,"")}function Er(e){if(uo(e))return St(e.text);if(po(e)||fo(e)){const t=e.data["text/plain"];return t===void 0?null:St(t)}return mo(e)?e.traceback.join(`
|