@datalayer/agent-runtimes 1.6.85 → 1.6.87
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/{CellSidebarExtension-BMTA9AQz.js → CellSidebarExtension-B_Bqi3Eh.js} +1 -1
- package/dist-embed/chunks/{CollapsiblePlugin-D_fVK4i3.js → CollapsiblePlugin-DPGnrmLj.js} +1 -1
- package/dist-embed/chunks/{DeckComponent-CGFO-xGa.js → DeckComponent-oBh8nbTa.js} +1 -1
- package/dist-embed/chunks/{DocumentView-BzBCyOZP.js → DocumentView-C8G8fA7K.js} +1 -1
- package/dist-embed/chunks/{EphemeralDocument-spGg7WCy.js → EphemeralDocument-Bm1w17Zw.js} +1 -1
- package/dist-embed/chunks/{EphemeralNotebook-BqUNh0zm.js → EphemeralNotebook-jQ7FGCY-.js} +1 -1
- package/dist-embed/chunks/{ExcalidrawComponent-Cb0JOQDr.js → ExcalidrawComponent-BgjhoJC3.js} +1 -1
- package/dist-embed/chunks/{ExcalidrawModal-MG-b9Tus.js → ExcalidrawModal-DtdsEiaS.js} +1 -1
- package/dist-embed/chunks/{JupyterLexicalExtension-lz41mjjY.js → JupyterLexicalExtension-Dr8dgCst.js} +5 -5
- package/dist-embed/chunks/{KernelVariables-BXCbgHG5.js → KernelVariables-cH-x-Hrc.js} +1 -1
- package/dist-embed/chunks/{NotebookToolSurfaces-BT_hNR4k.js → NotebookToolSurfaces-BcIduPcQ.js} +1 -1
- package/dist-embed/chunks/{NotebookView-wYwtORMB.js → NotebookView-LJ0GBHTQ.js} +1 -1
- package/dist-embed/chunks/{Output-BfjIM99o.js → Output-Do1CYRIF.js} +1 -1
- package/dist-embed/chunks/{SandboxDetailsDialog-B_nI8zH_.js → SandboxDetailsDialog-DjP6mCWy.js} +1 -1
- package/dist-embed/chunks/{WidgetVariableView-Dqsy8MDf.js → WidgetVariableView-BQoMV999.js} +1 -1
- package/dist-embed/chunks/{YouTubePlugin-BLdLNfNB.js → YouTubePlugin-BCHN7vdi.js} +1 -1
- package/dist-embed/chunks/{ar-SA-G6X2FPQ2-Boa4jpGN.js → ar-SA-G6X2FPQ2-4AR7vABL.js} +1 -1
- package/dist-embed/chunks/{az-AZ-76LH7QW2-DS7v8DUm.js → az-AZ-76LH7QW2-DQ2RQ6Bt.js} +1 -1
- package/dist-embed/chunks/{bg-BG-XCXSNQG7-CPWbvkhp.js → bg-BG-XCXSNQG7-BRTYabxb.js} +1 -1
- package/dist-embed/chunks/{bn-BD-2XOGV67Q-DJlv8gSj.js → bn-BD-2XOGV67Q-DJpR_aiV.js} +1 -1
- package/dist-embed/chunks/{ca-ES-6MX7JW3Y-_XMb5PXx.js → ca-ES-6MX7JW3Y-BrHrTXrx.js} +1 -1
- package/dist-embed/chunks/{cs-CZ-2BRQDIVT-Cc6P0HN5.js → cs-CZ-2BRQDIVT-CmCt0bDq.js} +1 -1
- package/dist-embed/chunks/{da-DK-5WZEPLOC-BPgmzhCM.js → da-DK-5WZEPLOC-Bow4-dps.js} +1 -1
- package/dist-embed/chunks/{de-DE-XR44H4JA-DjNk3C1Q.js → de-DE-XR44H4JA-DOrKYiYP.js} +1 -1
- package/dist-embed/chunks/{el-GR-BZB4AONW-BA_6_8BV.js → el-GR-BZB4AONW-BTtxEAc0.js} +1 -1
- package/dist-embed/chunks/{es-ES-U4NZUMDT-DB2skShM.js → es-ES-U4NZUMDT-DhrLOB7I.js} +1 -1
- package/dist-embed/chunks/{eu-ES-A7QVB2H4-D4jAAmi7.js → eu-ES-A7QVB2H4-CdpglPNY.js} +1 -1
- package/dist-embed/chunks/{fa-IR-HGAKTJCU-Cm5LhQ8o.js → fa-IR-HGAKTJCU-Ea2hzNvl.js} +1 -1
- package/dist-embed/chunks/{fi-FI-Z5N7JZ37-DEH_Gx5V.js → fi-FI-Z5N7JZ37-D6KBS1-v.js} +1 -1
- package/dist-embed/chunks/{fr-FR-RHASNOE6-Blvt0egy.js → fr-FR-RHASNOE6-CeDw1EdR.js} +1 -1
- package/dist-embed/chunks/{gl-ES-HMX3MZ6V-CTMS_g-D.js → gl-ES-HMX3MZ6V-DK2-uVTg.js} +1 -1
- package/dist-embed/chunks/{he-IL-6SHJWFNN-CwRAX3eS.js → he-IL-6SHJWFNN-Fk0F_rV-.js} +1 -1
- package/dist-embed/chunks/{hi-IN-IWLTKZ5I-BGqXOwtD.js → hi-IN-IWLTKZ5I-03USmwuM.js} +1 -1
- package/dist-embed/chunks/{hu-HU-A5ZG7DT2-DPTG8MEz.js → hu-HU-A5ZG7DT2-BSbsIqRs.js} +1 -1
- package/dist-embed/chunks/{id-ID-SAP4L64H-SGVYgM36.js → id-ID-SAP4L64H-Def1ERB7.js} +1 -1
- package/dist-embed/chunks/{index-BGTb9Nvb.js → index-DB6fbGKT.js} +1 -1
- package/dist-embed/chunks/{index-_yFHxlc9.js → index-DrrVr0x3.js} +14 -14
- package/dist-embed/chunks/{index-DRUP-YmW.js → index-z8PItpd8.js} +2 -2
- package/dist-embed/chunks/{it-IT-JPQ66NNP-BVqiIDuA.js → it-IT-JPQ66NNP-SLcJY1NM.js} +1 -1
- package/dist-embed/chunks/{ja-JP-DBVTYXUO-BVru9viS.js → ja-JP-DBVTYXUO-Cc9AUQ4A.js} +1 -1
- package/dist-embed/chunks/{kaa-6HZHGXH3-COq8GIG8.js → kaa-6HZHGXH3-CzXQn7ER.js} +1 -1
- package/dist-embed/chunks/{kab-KAB-ZGHBKWFO-C6sCJW81.js → kab-KAB-ZGHBKWFO-Cd1AWKsn.js} +1 -1
- package/dist-embed/chunks/{kk-KZ-P5N5QNE5-dn5L62v9.js → kk-KZ-P5N5QNE5-CoeOUA0W.js} +1 -1
- package/dist-embed/chunks/{km-KH-HSX4SM5Z-DHRs2Dac.js → km-KH-HSX4SM5Z-Newj9En6.js} +1 -1
- package/dist-embed/chunks/{ko-KR-MTYHY66A-B-6WTOYs.js → ko-KR-MTYHY66A-B0HPCdz1.js} +1 -1
- package/dist-embed/chunks/{ku-TR-6OUDTVRD-DtHakiL_.js → ku-TR-6OUDTVRD-DGP0qnbh.js} +1 -1
- package/dist-embed/chunks/{lib-BzbIpAN9.js → lib-B8KSw9bH.js} +1 -1
- package/dist-embed/chunks/{lib-Btas-Vc2.js → lib-B8ebpTVD.js} +1 -1
- package/dist-embed/chunks/{lib-DekQ5MbL.js → lib-BSeAgx1v.js} +1 -1
- package/dist-embed/chunks/{lib-Cz-lZRHD.js → lib-BYzUzQ6H.js} +1 -1
- package/dist-embed/chunks/{lib-BrI7Hb25.js → lib-Bc3R7boK.js} +1 -1
- package/dist-embed/chunks/{lib-BMPXKfof.js → lib-CADgZZ9y.js} +1 -1
- package/dist-embed/chunks/{lib-Bt3UDo1P.js → lib-CLcIUOT7.js} +1 -1
- package/dist-embed/chunks/{lib-CYKJVq8i.js → lib-CXGDRspZ.js} +1 -1
- package/dist-embed/chunks/{lib-DLTzM19O.js → lib-CaukawRB.js} +1 -1
- package/dist-embed/chunks/{lib-DS4NMFQk.js → lib-Cn7qCM0u.js} +1 -1
- package/dist-embed/chunks/{lib-ZsSgUH3L.js → lib-Coc8tcSm.js} +1 -1
- package/dist-embed/chunks/{lib-CM6qdZu_.js → lib-CrCTDU2F.js} +1 -1
- package/dist-embed/chunks/{lib-C_8F-jrZ.js → lib-DDbDl1bK.js} +1 -1
- package/dist-embed/chunks/{lib-Y2W358Nu.js → lib-DKIJv0vv.js} +1 -1
- package/dist-embed/chunks/{lib-BQwc_iHi.js → lib-Enno6S7H.js} +1 -1
- package/dist-embed/chunks/{lib-BZqd0lRo.js → lib-EuT6O3Jf.js} +1 -1
- package/dist-embed/chunks/{lib-D--prlsO.js → lib-Y90USIm4.js} +1 -1
- package/dist-embed/chunks/{lib-DPx8N2oL.js → lib-YvkJZ6Rp.js} +1 -1
- package/dist-embed/chunks/{lib-Bukh35h2.js → lib-nq0B6NsD.js} +1 -1
- package/dist-embed/chunks/{lt-LT-XHIRWOB4-Bov6lsrL.js → lt-LT-XHIRWOB4-BIsLadFj.js} +1 -1
- package/dist-embed/chunks/{lv-LV-5QDEKY6T-7TYkSlIn.js → lv-LV-5QDEKY6T-C8HmZZBF.js} +1 -1
- package/dist-embed/chunks/{mr-IN-CRQNXWMA-C1hMHCkZ.js → mr-IN-CRQNXWMA-DKYnEuji.js} +1 -1
- package/dist-embed/chunks/{my-MM-5M5IBNSE-CmNBubDy.js → my-MM-5M5IBNSE-MY3GKeMd.js} +1 -1
- package/dist-embed/chunks/{nb-NO-T6EIAALU-NtLUc485.js → nb-NO-T6EIAALU-txIp5vuE.js} +1 -1
- package/dist-embed/chunks/{nl-NL-IS3SIHDZ-CCHd5AqI.js → nl-NL-IS3SIHDZ-C6xelwh4.js} +1 -1
- package/dist-embed/chunks/{nn-NO-6E72VCQL-BYMvh_fX.js → nn-NO-6E72VCQL-BFYvN5n1.js} +1 -1
- package/dist-embed/chunks/{oc-FR-POXYY2M6-CkuSUWy_.js → oc-FR-POXYY2M6-uGpH7RML.js} +1 -1
- package/dist-embed/chunks/{pa-IN-N4M65BXN-Daq4uKWi.js → pa-IN-N4M65BXN-Cg4Z-vtz.js} +1 -1
- package/dist-embed/chunks/{percentages-BXMCSKIN-_vjQ8CcA.js → percentages-BXMCSKIN-9RttMFHC.js} +3 -3
- package/dist-embed/chunks/{pl-PL-T2D74RX3-DUHQouxW.js → pl-PL-T2D74RX3-Dv_CTL10.js} +1 -1
- package/dist-embed/chunks/{pt-BR-5N22H2LF-DK_6K-F_.js → pt-BR-5N22H2LF-CK-yjA9j.js} +1 -1
- package/dist-embed/chunks/{pt-PT-UZXXM6DQ-DtH8Iay_.js → pt-PT-UZXXM6DQ-DYb7ailg.js} +1 -1
- package/dist-embed/chunks/{renderer-jLLXpZ99.js → renderer-B_98xkGt.js} +1 -1
- package/dist-embed/chunks/{ro-RO-JPDTUUEW-CfeEiLsp.js → ro-RO-JPDTUUEW-1Cu9X8j1.js} +1 -1
- package/dist-embed/chunks/{ru-RU-B4JR7IUQ-xuXvLXWI.js → ru-RU-B4JR7IUQ-Bl3rV2YR.js} +1 -1
- package/dist-embed/chunks/{si-LK-N5RQ5JYF-CP-9ouz_.js → si-LK-N5RQ5JYF-C2t5ES1t.js} +1 -1
- package/dist-embed/chunks/{sk-SK-C5VTKIMK-BB-nLd53.js → sk-SK-C5VTKIMK-BPwM2QoN.js} +1 -1
- package/dist-embed/chunks/{sl-SI-NN7IZMDC-Ct4gcmka.js → sl-SI-NN7IZMDC-BCS7eO-5.js} +1 -1
- package/dist-embed/chunks/{subset-shared.chunk-Jbgk4hFg.js → subset-shared.chunk-Cs06OLE4.js} +1 -1
- package/dist-embed/chunks/{subset-worker.chunk-C52XcgS8.js → subset-worker.chunk-C-vXxYep.js} +1 -1
- package/dist-embed/chunks/{sv-SE-XGPEYMSR-DSfTTYTP.js → sv-SE-XGPEYMSR-sUR_yJ3Z.js} +1 -1
- package/dist-embed/chunks/{ta-IN-2NMHFXQM-_SwRKWkS.js → ta-IN-2NMHFXQM-c1DneC5B.js} +1 -1
- package/dist-embed/chunks/{th-TH-HPSO5L25-NbkJxgfv.js → th-TH-HPSO5L25-TIsXPiQR.js} +1 -1
- package/dist-embed/chunks/{tr-TR-DEFEU3FU-DrMMVO-E.js → tr-TR-DEFEU3FU-Bvb4Ep_L.js} +1 -1
- package/dist-embed/chunks/{uk-UA-QMV73CPH-B53y70gR.js → uk-UA-QMV73CPH-BNgdD_2E.js} +1 -1
- package/dist-embed/chunks/{vi-VN-M7AON7JQ-BVHYf59K.js → vi-VN-M7AON7JQ-T0aYX7Py.js} +1 -1
- package/dist-embed/chunks/{zh-CN-LNUGB5OW-z2taSDkS.js → zh-CN-LNUGB5OW-CpDHeCAz.js} +1 -1
- package/dist-embed/chunks/{zh-HK-E62DVLB3-Rkl2piEx.js → zh-HK-E62DVLB3-B5Kmyhoq.js} +1 -1
- package/dist-embed/chunks/{zh-TW-RAJ6MFWO-BgDiBZag.js → zh-TW-RAJ6MFWO-D-Gvp4EC.js} +1 -1
- package/dist-embed/datalayer-app-main.js +13 -13
- package/lib/apps/agentUiPlugins.d.ts +1 -1
- package/lib/apps/agentUiPlugins.js +1 -1
- package/lib/apps/plugins/trip-budget/index.d.ts +1 -1
- package/lib/apps/plugins/trip-budget/read.d.ts +1 -1
- package/lib/apps/plugins/trip-budget/read.js +1 -1
- package/lib/apps/plugins/trip-itinerary/index.d.ts +1 -1
- package/lib/apps/plugins/trip-itinerary/read.d.ts +1 -1
- package/lib/apps/plugins/trip-itinerary/read.js +1 -1
- package/lib/apps/plugins/trip-options/index.d.ts +1 -1
- package/lib/apps/plugins/trip-options/read.d.ts +1 -1
- package/lib/apps/plugins/trip-options/read.js +1 -1
- package/lib/apps/plugins/trip-summary/index.d.ts +1 -1
- package/lib/chat/assistant/SpeechBalloon.d.ts +4 -2
- package/lib/chat/assistant/SpeechBalloon.js +3 -1
- package/lib/specs/actions.js +2 -2
- package/lib/specs/agents/agents.d.ts +1 -1
- package/lib/specs/agents/agents.js +106 -106
- package/lib/specs/apps.d.ts +2 -2
- package/lib/specs/apps.js +114 -40
- package/lib/specs/backendTools.js +3 -3
- package/lib/specs/mcpServers.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ch as I,J as i,aE as F,ed as ae,ee as le,ef as Y,eg as se,cp as ce,cj as de,aK as me,eh as ue,cl as pe,ei as fe,cf as he,aD as T,ej as ge,ek as Q,el as be,em as ve,en as M,eo as $,ep as W,eq as V,er as ye,es as _e,et as Ee,eu as Ce,bN as je,ev as Fe,bO as Se,ew as xe,ex as q,_ as D,ey as ke,ez as Ie,ag as we,eA as Te,eB as U,eC as O,eD as Ne,eE as Ae}from"../datalayer-app-main.js";import{T as Me,b as Le}from"./index-i9IsP_xD.js";import{I as Be}from"./tokens-C5FWZLTC.js";import{I as Pe}from"./tokens-BiQDy_zz.js";import{C as De,a as Oe}from"./index--Rl4aMiU.js";import{I as X,a as Z,b as R}from"./token-CdPvDaO6.js";import{F as Re,c as Ge,A as $e,g as J,v as We}from"./index-CHu5zo1L.js";import{I as Ve}from"./tokens-1h_N3aLM.js";import{a as qe}from"./tokens-B3Xc25f7.js";import{c as Ue}from"./index-DRUP-YmW.js";import{s as Je}from"./hover-DpawhsId.js";import"./hoverbox-CStlKQWE.js";import"./_baseRest-BmxuuM4H.js";import"./isSymbol-BLtK9CV6.js";import"./forEach-hknrtmxV.js";import"./uniqueId-BVuTZY3F.js";import"./toNumber-B1wj8-wx.js";import"./_baseClone-ByJL1tkX.js";import"./merge-B_wcPK4Y.js";import"./isEqual-DXPB_0fo.js";import"./Output-BfjIM99o.js";import"./index-_yFHxlc9.js";import"./dayjs.min-u3zuoSR8.js";import"./d3-color-Jd8hXty2.js";import"./dist-Frc5TvpU.js";import"./PaintbrushIcon-CFBHU-3l.js";import"./index-BaRoLDk0.js";import"./RestartIcon-DvpOf5Mf.js";import"./CellSidebarExtension-BMTA9AQz.js";import"./NotebookSkeleton-GSdyJDf_.js";import"./Avatar-DUPBQXVt.js";import"./renderer-jLLXpZ99.js";import"./SquareIcon-Dy3l3VdH.js";import"./FileDirectoryOpenFillIcon-jGhuRcP3.js";import"./url-DY3jeuF8.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-BoT73xjq.js";import"./index-CShCHnof.js";import"./KernelVariables-BXCbgHG5.js";import"./index-BWeXDhSd.js";import"./SortAscIcon-CmH04s3F.js";import"./SortDescIcon-Qif6E10I.js";import"./NotebookToolbar-C1fpK-Vi.js";import"./RepoPushIcon-BtXQRhLa.js";import"./sessions-LMslHH3H.js";import"./tokens-UgGv77-l.js";import"./drivecontents-BabrDJge.js";import"./kernel-DWlDRhgJ.js";const ze={submitButtonOptions:{norender:!0}},z=t=>{var e;const r=((e=t.translator)!==null&&e!==void 0?e:F).load("jupyterlab");let a;const n=()=>t.direction==="up"?!t.item.hasMoveUp:!t.item.hasMoveDown,u=t.direction==="up"?t.item.index-1:t.item.index+1;if(t.buttonStyle==="icons"){const m={tag:"span",elementPosition:"center"};return a=t.direction==="up"?i.createElement(ae.react,{...m}):i.createElement(le.react,{...m}),i.createElement(Y,{className:"jp-ArrayOperationsButton",onClick:t.item.onReorderClick(t.item.index,u),disabled:n(),appearance:"stealth",title:r.__("Move item %1",t.direction)},a)}else return i.createElement("button",{className:"jp-mod-styled jp-mod-reject jp-ArrayOperationsButton",onClick:t.item.onReorderClick(t.item.index,u),disabled:n()},t.direction==="up"?r.__("Move up"):r.__("Move down"))},He=t=>{var e;const r=((e=t.translator)!==null&&e!==void 0?e:F).load("jupyterlab");let a;return t.buttonStyle==="icons"?(a=i.createElement(se.react,{tag:"span",elementPosition:"center"}),i.createElement(Y,{className:"jp-mod-styled jp-mod-warn jp-ArrayOperationsButton",onClick:t.item.onDropIndexClick(t.item.index),appearance:"stealth",title:r.__("Remove item")},a)):i.createElement("button",{className:"jp-mod-styled jp-mod-warn jp-ArrayOperationsButton",onClick:t.item.onDropIndexClick(t.item.index)},r.__("Remove"))},ee=t=>{var e;const r=((e=t.translator)!==null&&e!==void 0?e:F).load("jupyterlab");let a;return t.buttonStyle==="icons"?a=i.createElement(ce.react,{tag:"span",elementSize:"xlarge",elementPosition:"center"}):a=r.__("Add"),i.createElement("button",{className:"jp-mod-styled jp-mod-accept jp-ArrayOperationsButton",onClick:t.onAddClick,title:r.__("Add item")},a)};function G(t){const{component:e,name:r,buttonStyle:a,compact:n,showModifiedFromDefault:u,translator:m}=t,s=n??!1,p=a??(s?"icons":"text"),h=f=>e({...f,buttonStyle:p,compact:s,showModifiedFromDefault:u??!0,translator:m??F});return r&&(h.displayName=r),h}function te(t,e){const r=J("TitleFieldTemplate",t,e),a=J("DescriptionFieldTemplate",t,e);return{TitleField:r,DescriptionField:a}}const Ke=t=>G({...t,name:"JupyterLabArrayTemplate",component:e=>{var r;const{schema:a,registry:n,uiSchema:u,required:m}=e,s={schema:a,registry:n,uiSchema:u,required:m},{TitleField:p,DescriptionField:h}=te(n,u);return i.createElement("div",{className:e.className},e.compact?i.createElement("div",{className:"jp-FormGroup-compactTitle"},i.createElement("div",{className:"jp-FormGroup-fieldLabel jp-FormGroup-contentItem",id:`${e.idSchema.$id}__title`},e.title||""),i.createElement("div",{className:"jp-FormGroup-description",id:`${e.idSchema.$id}-description`},e.schema.description||"")):i.createElement(i.Fragment,null,e.title&&i.createElement(p,{...s,title:e.title,id:`${e.idSchema.$id}-title`}),i.createElement(h,{...s,id:`${e.idSchema.$id}-description`,description:(r=e.schema.description)!==null&&r!==void 0?r:""})),e.items.map(f=>i.createElement("div",{key:f.key,className:f.className},f.children,i.createElement("div",{className:"jp-ArrayOperations"},i.createElement(z,{buttonStyle:e.buttonStyle,translator:e.translator,item:f,direction:"up"}),i.createElement(z,{buttonStyle:e.buttonStyle,translator:e.translator,item:f,direction:"down"}),i.createElement(He,{buttonStyle:e.buttonStyle,translator:e.translator,item:f})))),e.canAdd&&i.createElement(ee,{onAddClick:e.onAddClick,buttonStyle:e.buttonStyle,translator:e.translator}))}}),Ye=t=>G({...t,name:"JupyterLabObjectTemplate",component:e=>{var r;const{schema:a,registry:n,uiSchema:u,required:m}=e,s={schema:a,registry:n,uiSchema:u,required:m},{TitleField:p,DescriptionField:h}=te(n,u);return i.createElement("fieldset",{id:e.idSchema.$id},e.compact?i.createElement("div",{className:"jp-FormGroup-compactTitle"},i.createElement("div",{className:"jp-FormGroup-fieldLabel jp-FormGroup-contentItem",id:`${e.idSchema.$id}__title`},e.title||""),i.createElement("div",{className:"jp-FormGroup-description",id:`${e.idSchema.$id}__description`},e.schema.description||"")):i.createElement(i.Fragment,null,(e.title||(e.uiSchema||I.emptyObject)["ui:title"])&&i.createElement(p,{...s,id:`${e.idSchema.$id}__title`,title:e.title||`${(e.uiSchema||I.emptyObject)["ui:title"]}`||""}),i.createElement(h,{...s,id:`${e.idSchema.$id}__description`,description:(r=e.schema.description)!==null&&r!==void 0?r:""})),e.properties.map(f=>f.content),Ge(e.schema,e.uiSchema,e.formData)&&i.createElement(ee,{onAddClick:e.onAddClick(e.schema),buttonStyle:e.buttonStyle,translator:e.translator}))}}),Qe=t=>G({...t,name:"JupyterLabFieldTemplate",component:e=>{var r;const a=((r=e.translator)!==null&&r!==void 0?r:F).load("jupyterlab");let n=!1,u;const{formData:m,schema:s,label:p,displayLabel:h,id:f,formContext:o,errors:l,rawErrors:d,children:c,onKeyChange:g,onDropPropertyClick:_}=e,{defaultFormData:y}=o,C=f.split("_");C.shift();const E=C.join("."),v=E==="",j=E===(e.uiSchema||I.emptyObject)["ui:field"];e.showModifiedFromDefault&&(u=C.reduce((x,P)=>x?.[P],y),n=!v&&m!==void 0&&u!==void 0&&!s.properties&&s.type!=="array"&&!I.deepEqual(m,u));const S=!v&&s.type!="object"&&f!="jp-SettingsEditor-@jupyterlab/shortcuts-extension:shortcuts_shortcuts",N=s.hasOwnProperty($e),B=!(s.type==="object"||s.type==="array");return i.createElement("div",{className:`form-group ${h||s.type==="boolean"?"small-field":""}`},!j&&(d?.length?i.createElement("div",{className:"jp-modifiedIndicator jp-errorIndicator"}):n&&i.createElement("div",{className:"jp-modifiedIndicator"})),i.createElement("div",{className:`jp-FormGroup-content ${e.compact?"jp-FormGroup-contentCompact":"jp-FormGroup-contentNormal"}`},B&&h&&!v&&p&&!N?e.compact?i.createElement("div",{className:"jp-FormGroup-compactTitle"},i.createElement("div",{className:"jp-FormGroup-fieldLabel jp-FormGroup-contentItem"},p),B&&s.description&&S&&i.createElement("div",{className:"jp-FormGroup-description"},s.description)):i.createElement("h3",{className:"jp-FormGroup-fieldLabel jp-FormGroup-contentItem"},p):i.createElement(i.Fragment,null),N&&i.createElement("input",{className:"jp-FormGroup-contentItem jp-mod-styled",type:"text",onBlur:x=>g(x.target.value),defaultValue:p}),i.createElement("div",{className:`${v?"jp-root":s.type==="object"?"jp-objectFieldWrapper":s.type==="array"?"jp-arrayFieldWrapper":"jp-inputFieldWrapper jp-FormGroup-contentItem"}`},c),N&&i.createElement("button",{className:"jp-FormGroup-contentItem jp-mod-styled jp-mod-warn jp-FormGroup-removeButton",onClick:_(p)},a.__("Remove")),!e.compact&&s.description&&S&&i.createElement("div",{className:"jp-FormGroup-description"},s.description),n&&u!==void 0&&s.type!=="object"&&i.createElement("div",{className:"jp-FormGroup-default"},a.__("Default: %1",u!==null?u.toLocaleString():"null")),i.createElement("div",{className:"validationErrors"},l)))}});function Xe(t){const{buttonStyle:e,compact:r,showModifiedFromDefault:a,translator:n,formContext:u,...m}=t,s={...m.uiSchema||I.emptyObject};s["ui:options"]={...ze,...s["ui:options"]},m.uiSchema=s;const{FieldTemplate:p,ArrayFieldTemplate:h,ObjectFieldTemplate:f}=t.templates||I.emptyObject,o={buttonStyle:e,compact:r,showModifiedFromDefault:a,translator:n},l=i.useMemo(()=>p??Qe(o),[p,e,r,a,n]),d=i.useMemo(()=>h??Ke(o),[h,e,r,a,n]),c=i.useMemo(()=>f??Ye(o),[f,e,r,a,n]),g={FieldTemplate:l,ArrayFieldTemplate:d,ObjectFieldTemplate:c};return i.createElement(Re,{templates:g,formContext:u,...m})}class Ze extends i.Component{constructor(e){super(e),this._handleChange=r=>{this.setState({value:r.currentTarget.value})},this._handleSubmit=r=>{r.preventDefault();const a=parseInt(this._textInput.value,10);return!isNaN(a)&&isFinite(a)&&1<=a&&a<=this.props.maxLine&&this.props.handleSubmit(a),!1},this._handleFocus=()=>{this.setState({hasFocus:!0})},this._handleBlur=()=>{this.setState({hasFocus:!1})},this._textInput=null,this.translator=e.translator||F,this._trans=this.translator.load("jupyterlab"),this.state={value:"",hasFocus:!1,textInputId:ue.createDomID()+"-line-number-input"}}componentDidMount(){this._textInput.focus()}render(){return i.createElement("div",{className:"jp-lineFormSearch"},i.createElement("form",{name:"lineColumnForm",onSubmit:this._handleSubmit,noValidate:!0},i.createElement("div",{className:pe("jp-lineFormWrapper","lm-lineForm-wrapper",this.state.hasFocus?"jp-lineFormWrapperFocusWithin":void 0)},i.createElement("input",{type:"text",id:this.state.textInputId,className:"jp-lineFormInput",onChange:this._handleChange,onFocus:this._handleFocus,onBlur:this._handleBlur,value:this.state.value,ref:e=>{this._textInput=e}}),i.createElement("div",{className:"jp-baseLineForm jp-lineFormButtonContainer"},i.createElement(fe.react,{className:"jp-baseLineForm jp-lineFormButtonIcon",elementPosition:"center"}),i.createElement("input",{type:"submit",className:"jp-baseLineForm jp-lineFormButton",value:""}))),i.createElement("label",{className:"jp-lineFormCaption",htmlFor:this.state.textInputId},this._trans.__("Go to line number between 1 and %1",this.props.maxLine))))}}function et(t){const r=(t.translator||F).load("jupyterlab"),a=n=>{if(n.key==="Enter"||n.key==="Spacebar"||n.key===" ")n.preventDefault(),n.stopPropagation(),t.handleClick();else return};return i.createElement(Me,{role:"button","aria-haspopup":!0,onClick:t.handleClick,source:r.__("Ln %1, Col %2",t.line,t.column),title:r.__("Go to line number…"),tabIndex:0,onKeyDown:a})}class L extends de{constructor(e){super(new L.Model),this._popup=null,this.addClass("jp-mod-highlighted"),this.translator=e||F}render(){return this.model===null?null:i.createElement(et,{line:this.model.line,column:this.model.column,translator:this.translator,handleClick:()=>this._handleClick()})}_handleClick(){this._popup&&this._popup.dispose();const e=me.create(i.createElement(Ze,{handleSubmit:r=>this._handleSubmit(r),currentLine:this.model.line,maxLine:this.model.editor.lineCount,translator:this.translator}));this._popup=Je({body:e,anchor:this,align:"right"})}_handleSubmit(e){this.model.editor.setCursorPosition({line:e-1,column:0}),this._popup.dispose(),this.model.editor.focus()}}(function(t){class e extends he{constructor(){super(...arguments),this._onSelectionChanged=()=>{const a=this._getAllState(),n=this.editor.getCursorPosition();this._line=n.line+1,this._column=n.column+1,this._triggerChange(a,this._getAllState())},this._line=1,this._column=1,this._editor=null}get editor(){return this._editor}set editor(a){var n;const u=this._editor;!((n=u?.model)===null||n===void 0)&&n.selections&&u.model.selections.changed.disconnect(this._onSelectionChanged);const m=this._getAllState();if(this._editor=a,!this._editor)this._column=1,this._line=1;else{this._editor.model.selections.changed.connect(this._onSelectionChanged);const s=this._editor.getCursorPosition();this._column=s.column+1,this._line=s.line+1}this._triggerChange(m,this._getAllState())}get line(){return this._line}get column(){return this._column}_getAllState(){return[this._line,this._column]}_triggerChange(a,n){(a[0]!==n[0]||a[1]!==n[1])&&this.stateChanged.emit(void 0)}}t.Model=e})(L||(L={}));var b;(function(t){t.deleteLine="codemirror:delete-line",t.toggleBlockComment="codemirror:toggle-block-comment",t.toggleComment="codemirror:toggle-comment",t.selectNextOccurrence="codemirror:select-next-occurrence",t.toggleTabFocusMode="codemirror:toggle-tab-focus-mode",t.toggleBold="codemirror:markdown-toggle-bold",t.foldCurrent="codemirror:fold-current",t.unfoldCurrent="codemirror:unfold-current",t.foldSubregions="codemirror:fold-subregions",t.unfoldSubregions="codemirror:unfold-subregions",t.foldAll="codemirror:fold-all",t.unfoldAll="codemirror:unfold-all"})(b||(b={}));function tt(t){return Fe(t)||Q(t)}const H=".cm-content",ot={id:"@jupyterlab/codemirror-extension:commands",description:"Registers commands acting on selected/active CodeMirror editor.",autoStart:!0,requires:[Pe],optional:[T,Le],activate:(t,e,r,a)=>{r=r??F;const n=r.load("jupyterlab"),u=o=>o.classList.contains(H),m=()=>{var o,l;const d=(o=t.contextMenuHitTest(u))!==null&&o!==void 0?o:(l=document.activeElement)===null||l===void 0?void 0:l.closest(H);if(d)return je.findFromDOM(d)},s=()=>!!m(),p=o=>{const{state:l}=o,{main:d}=l.selection;if(d.empty)return!1;const{from:c,to:g,anchor:_,head:y}=d,C=_>y,E=l.doc,v=E.sliceString(c,g),j=c>=2&&E.sliceString(c-2,c)==="**",S=E.sliceString(g,g+2)==="**",N=v.startsWith("**"),B=v.endsWith("**"),x=(k,w)=>{const A=C?w:k,re=C?k:w;return Se.single(A,re)};if(j&&S){const k=c-2,w=g+2,A=g-c;return o.dispatch({changes:{from:k,to:w,insert:v},selection:x(k,k+A)}),!0}if(N&&B&&v.length>=4){const k=v.slice(2,-2),w=c,A=c+k.length;return o.dispatch({changes:{from:c,to:g,insert:k},selection:x(w,A)}),!0}const P=`**${v}**`,ne=c+2,ie=g+2;return o.dispatch({changes:{from:c,to:g,insert:P},selection:x(ne,ie)}),!0},h=()=>{var o,l;const d=t.shell.currentWidget,c=(o=e.currentWidget)===null||o===void 0?void 0:o.content;if(e.currentWidget!==null&&e.currentWidget===d&&c&&c.activeCell)return{type:"notebook",widget:d,notebook:c,isEnabled:!0};const g=d;return g&&g.content&&typeof((l=g.content.editor)===null||l===void 0?void 0:l.focus)=="function"?{type:"fileEditor",widget:g,isEnabled:!0}:{type:"none",widget:null,isEnabled:!1}},f=()=>h().isEnabled;if(t.commands.addCommand(b.deleteLine,{label:n.__("Delete the current line"),describedBy:{args:{type:"object",properties:{}}},execute:()=>{const o=m();o&&ge(o)},isEnabled:s}),t.commands.addCommand(b.toggleBlockComment,{label:n.__("Toggle Block Comment"),caption:n.__("Toggles block comments; falls back to regular comment toggle when block comment syntax is unavailable"),describedBy:{args:{type:"object",properties:{}}},execute:()=>{const o=m();o&&tt(o)},isEnabled:s}),t.commands.addCommand(b.toggleComment,{label:n.__("Toggle Comment"),describedBy:{args:{type:"object",properties:{}}},execute:()=>{const o=m();o&&Q(o)},isEnabled:s}),t.commands.addCommand(b.toggleTabFocusMode,{label:n.__("Toggle Tab Focus Mode"),caption:n.__("Toggles behavior of Tab key between inserting indentation and moving to next focusable element"),describedBy:{args:{type:"object",properties:{}}},execute:()=>{const o=m();o&&be(o)},isEnabled:s}),t.commands.addCommand(b.selectNextOccurrence,{label:n.__("Select Next Occurrence"),describedBy:{args:{type:"object",properties:{}}},execute:()=>{const o=m();o&&ve(o)},isEnabled:s}),t.commands.addCommand(b.toggleBold,{label:n.__("Toggle Bold"),caption:n.__("Toggle bold formatting by wrapping/unwrapping selected text with **"),describedBy:{args:{type:"object",properties:{}}},execute:()=>{const o=m();o&&p(o)},isEnabled:s}),t.commands.addCommand(b.foldCurrent,{label:n.__("Fold Current Region"),describedBy:{args:{type:"object",properties:{}}},execute:()=>{var o;const l=h();l.type==="notebook"?(l.notebook.mode="edit",l.notebook.activeCell&&((o=l.notebook.activeCell.editor)===null||o===void 0||o.focus())):l.type==="fileEditor"&&l.widget.content.editor.focus();const d=m();if(!d)return;const{state:c}=d,g=c.selection.main.head,_=c.doc.lineAt(g);M(c,_.from,_.to)&&$(d)},isEnabled:f}),t.commands.addCommand(b.unfoldCurrent,{label:n.__("Unfold Current Region"),describedBy:{args:{type:"object",properties:{}}},execute:()=>{var o;const l=h();l.type==="notebook"?(l.notebook.mode="edit",l.notebook.activeCell&&((o=l.notebook.activeCell.editor)===null||o===void 0||o.focus())):l.type==="fileEditor"&&l.widget.content.editor.focus();const d=m();if(!d)return;const{state:c}=d,g=c.selection.main.head,_=c.doc.lineAt(g);M(c,_.from,_.to)&&W(d)},isEnabled:f}),t.commands.addCommand(b.foldSubregions,{label:n.__("Fold All Subregions"),describedBy:{args:{type:"object",properties:{}}},execute:()=>{var o;const l=h();l.type==="notebook"?(l.notebook.mode="edit",l.notebook.activeCell&&((o=l.notebook.activeCell.editor)===null||o===void 0||o.focus())):l.type==="fileEditor"&&l.widget.content.editor.focus();const d=m();if(d)try{const{state:c}=d,g=c.selection.main.head,_=c.doc.lineAt(g),y=M(c,_.from,_.to);let C=!1;try{C=c.field(V,!1)!==void 0}catch{C=!1}if(C||($(d),W(d)),!y)return;const E=[];let v=y.from+1;for(;v<y.to;){const j=c.doc.lineAt(v),S=M(c,j.from,j.to);S&&S.from>y.from&&S.to<=y.to?(E.push(ye.of(S)),v=S.to):v=j.to+1}E.length>0&&d.dispatch({effects:E})}catch{}},isEnabled:f}),t.commands.addCommand(b.unfoldSubregions,{label:n.__("Unfold All Subregions"),describedBy:{args:{type:"object",properties:{}}},execute:()=>{var o;const l=h();l.type==="notebook"?(l.notebook.mode="edit",l.notebook.activeCell&&((o=l.notebook.activeCell.editor)===null||o===void 0||o.focus())):l.type==="fileEditor"&&l.widget.content.editor.focus();const d=m();if(d)try{const{state:c}=d,g=c.selection.main.head,_=c.doc.lineAt(g),y=M(c,_.from,_.to);if(!y)return;const C=c.field(V,!1);if(!C)return;const E=[];C.between(y.from+1,y.to,(v,j)=>{v>y.from&&j<=y.to&&E.push(_e.of({from:v,to:j}))}),E.length>0&&d.dispatch({effects:E})}catch{}},isEnabled:f}),t.commands.addCommand(b.foldAll,{label:n.__("Fold All Regions"),describedBy:{args:{type:"object",properties:{}}},execute:()=>{var o;const l=h();l.type==="notebook"?(l.notebook.mode="edit",l.notebook.activeCell&&((o=l.notebook.activeCell.editor)===null||o===void 0||o.focus())):l.type==="fileEditor"&&l.widget.content.editor.focus();const d=m();if(d)try{Ee(d)}catch{}},isEnabled:f}),t.commands.addCommand(b.unfoldAll,{label:n.__("Unfold All Regions"),describedBy:{args:{type:"object",properties:{}}},execute:()=>{var o;const l=h();l.type==="notebook"?(l.notebook.mode="edit",l.notebook.activeCell&&((o=l.notebook.activeCell.editor)===null||o===void 0||o.focus())):l.type==="fileEditor"&&l.widget.content.editor.focus();const d=m();if(d)try{Ce(d)}catch{}},isEnabled:f}),a){const o=n.__("File Operations");[b.foldCurrent,b.unfoldCurrent,b.foldSubregions,b.unfoldSubregions,b.foldAll,b.unfoldAll].forEach(l=>{a.addItem({command:l,category:o})})}}},K="@jupyterlab/codemirror-extension:plugin",nt={id:"@jupyterlab/codemirror-extension:languages",description:"Provides the CodeMirror languages registry.",provides:X,optional:[T],activate:(t,e)=>{const r=new q;for(const a of q.getDefaultLanguages(e,n=>r.findBest(n)))r.addLanguage(a);return r.addLanguage({name:"ipythongfm",mime:"text/x-ipythongfm",load:async()=>{const[a,n,u]=await Promise.all([D(()=>import("./dist-eeUvSSUK.js"),[],import.meta.url),D(()=>import("./dist-Frc5TvpU.js"),[],import.meta.url),D(()=>import("./stex-C3f8Ysf7.js"),[],import.meta.url)]),m=a.markdown({base:a.markdownLanguage,codeLanguages:s=>r.findBest(s),extensions:[ke(Ie.define(u.stexMath).parser)]});return new we(m.language,[m.support,Te(n.pythonLanguage)])}}),r}},it={id:"@jupyterlab/codemirror-extension:themes",description:"Provides the CodeMirror theme registry",provides:Z,optional:[T],activate:(t,e)=>{const r=new U;for(const a of U.getDefaultThemes(e))r.addTheme(a);return r}},rt={id:"@jupyterlab/codemirror-extension:extensions",description:"Provides the CodeMirror extension factory registry.",provides:R,requires:[Z],optional:[T,Ve,qe],activate:(t,e,r,a,n)=>{const u=new O;for(const m of O.getDefaultExtensions({themes:e,translator:r}))u.addExtension(m);if(a){const m=s=>{var p;u.baseConfiguration=(p=s.get("defaultConfig").composite)!==null&&p!==void 0?p:{}};Promise.all([a.load(K),t.restored]).then(([s])=>{m(s),s.changed.connect(m)}),n?.addRenderer(`${K}.defaultConfig`,{fieldRenderer:s=>{let p;const h=i.useMemo(()=>u.settingsSchema,[]);s.name in s.formContext.defaultFormData?p=s.formContext.defaultFormData[s.name]:p={};for(const[f,o]of Object.entries(u.defaultConfiguration))typeof h[f]<"u"&&!(f in p)&&(p[f]=o);return i.createElement("div",{className:"jp-FormGroup-contentNormal"},i.createElement("h3",{className:"jp-FormGroup-fieldLabel jp-FormGroup-contentItem"},s.schema.title),s.schema.description&&i.createElement("div",{className:"jp-FormGroup-description"},s.schema.description),i.createElement(Xe,{schema:{title:s.schema.title,description:s.schema.description,type:"object",properties:h,additionalProperties:!1},validator:We,formData:{...p,...s.formData},formContext:{defaultFormData:p},liveValidate:!0,onChange:f=>{var o;const l={};for(const[d,c]of Object.entries((o=f.formData)!==null&&o!==void 0?o:{})){const g=p[d];(g===void 0||!I.deepEqual(c,g))&&(l[d]=c)}s.onChange(l)},tagName:"div",translator:r??F,buttonStyle:"icons"}))}})}return u}},at={id:"@jupyterlab/codemirror-extension:binding",description:"Register the CodeMirror extension factory binding the editor and the shared model.",autoStart:!0,requires:[R],activate:(t,e)=>{e.addExtension({name:"shared-model-binding",factory:r=>{var a;const n=r.model.sharedModel;return O.createImmutableExtension(Ne({ytext:n.ysource,undoManager:(a=n.undoManager)!==null&&a!==void 0?a:void 0}))}})}},lt={id:"@jupyterlab/codemirror-extension:services",description:"Provides the service to instantiate CodeMirror editors.",provides:xe,requires:[X,R],optional:[T],activate:(t,e,r,a)=>({factoryService:new De({extensions:r,languages:e,translator:a??F}),mimeTypeService:new Oe(e)})},oe={id:"@jupyterlab/codemirror-extension:line-col-status",description:"Provides the code editor cursor position model.",autoStart:!0,requires:[T],optional:[Ue,Be],provides:Ae,activate:(t,e,r,a)=>{const n=new L(e),u=new Set;a&&a.registerStatusItem(oe.id,{priority:1,item:n,align:"right",rank:2,isActive:()=>!!n.model.editor});const m=h=>{u.add(h),t.shell.currentWidget&&p(t.shell,{newValue:t.shell.currentWidget})},s=()=>{p(t.shell,{oldValue:t.shell.currentWidget,newValue:t.shell.currentWidget})};function p(h,f){Promise.all([...u].map(o=>o(f.newValue))).then(o=>{var l;n.model.editor=(l=o.filter(d=>d!==null)[0])!==null&&l!==void 0?l:null}).catch(o=>{console.error("Get editors",o)})}return r&&r.currentChanged.connect(p),{addEditorProvider:m,update:s}}},yo=[ot,nt,it,at,rt,lt,oe];export{yo as default,oe as lineColItem};
|
|
1
|
+
import{ch as I,J as i,aE as F,ed as ae,ee as le,ef as Y,eg as se,cp as ce,cj as de,aK as me,eh as ue,cl as pe,ei as fe,cf as he,aD as T,ej as ge,ek as Q,el as be,em as ve,en as M,eo as $,ep as W,eq as V,er as ye,es as _e,et as Ee,eu as Ce,bN as je,ev as Fe,bO as Se,ew as xe,ex as q,_ as D,ey as ke,ez as Ie,ag as we,eA as Te,eB as U,eC as O,eD as Ne,eE as Ae}from"../datalayer-app-main.js";import{T as Me,b as Le}from"./index-i9IsP_xD.js";import{I as Be}from"./tokens-C5FWZLTC.js";import{I as Pe}from"./tokens-BiQDy_zz.js";import{C as De,a as Oe}from"./index--Rl4aMiU.js";import{I as X,a as Z,b as R}from"./token-CdPvDaO6.js";import{F as Re,c as Ge,A as $e,g as J,v as We}from"./index-CHu5zo1L.js";import{I as Ve}from"./tokens-1h_N3aLM.js";import{a as qe}from"./tokens-B3Xc25f7.js";import{c as Ue}from"./index-z8PItpd8.js";import{s as Je}from"./hover-DpawhsId.js";import"./hoverbox-CStlKQWE.js";import"./_baseRest-BmxuuM4H.js";import"./isSymbol-BLtK9CV6.js";import"./forEach-hknrtmxV.js";import"./uniqueId-BVuTZY3F.js";import"./toNumber-B1wj8-wx.js";import"./_baseClone-ByJL1tkX.js";import"./merge-B_wcPK4Y.js";import"./isEqual-DXPB_0fo.js";import"./Output-Do1CYRIF.js";import"./index-DrrVr0x3.js";import"./dayjs.min-u3zuoSR8.js";import"./d3-color-Jd8hXty2.js";import"./dist-Frc5TvpU.js";import"./PaintbrushIcon-CFBHU-3l.js";import"./index-BaRoLDk0.js";import"./RestartIcon-DvpOf5Mf.js";import"./CellSidebarExtension-B_Bqi3Eh.js";import"./NotebookSkeleton-GSdyJDf_.js";import"./Avatar-DUPBQXVt.js";import"./renderer-B_98xkGt.js";import"./SquareIcon-Dy3l3VdH.js";import"./FileDirectoryOpenFillIcon-jGhuRcP3.js";import"./url-DY3jeuF8.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-BoT73xjq.js";import"./index-CShCHnof.js";import"./KernelVariables-cH-x-Hrc.js";import"./index-BWeXDhSd.js";import"./SortAscIcon-CmH04s3F.js";import"./SortDescIcon-Qif6E10I.js";import"./NotebookToolbar-C1fpK-Vi.js";import"./RepoPushIcon-BtXQRhLa.js";import"./sessions-LMslHH3H.js";import"./tokens-UgGv77-l.js";import"./drivecontents-BabrDJge.js";import"./kernel-DWlDRhgJ.js";const ze={submitButtonOptions:{norender:!0}},z=t=>{var e;const r=((e=t.translator)!==null&&e!==void 0?e:F).load("jupyterlab");let a;const n=()=>t.direction==="up"?!t.item.hasMoveUp:!t.item.hasMoveDown,u=t.direction==="up"?t.item.index-1:t.item.index+1;if(t.buttonStyle==="icons"){const m={tag:"span",elementPosition:"center"};return a=t.direction==="up"?i.createElement(ae.react,{...m}):i.createElement(le.react,{...m}),i.createElement(Y,{className:"jp-ArrayOperationsButton",onClick:t.item.onReorderClick(t.item.index,u),disabled:n(),appearance:"stealth",title:r.__("Move item %1",t.direction)},a)}else return i.createElement("button",{className:"jp-mod-styled jp-mod-reject jp-ArrayOperationsButton",onClick:t.item.onReorderClick(t.item.index,u),disabled:n()},t.direction==="up"?r.__("Move up"):r.__("Move down"))},He=t=>{var e;const r=((e=t.translator)!==null&&e!==void 0?e:F).load("jupyterlab");let a;return t.buttonStyle==="icons"?(a=i.createElement(se.react,{tag:"span",elementPosition:"center"}),i.createElement(Y,{className:"jp-mod-styled jp-mod-warn jp-ArrayOperationsButton",onClick:t.item.onDropIndexClick(t.item.index),appearance:"stealth",title:r.__("Remove item")},a)):i.createElement("button",{className:"jp-mod-styled jp-mod-warn jp-ArrayOperationsButton",onClick:t.item.onDropIndexClick(t.item.index)},r.__("Remove"))},ee=t=>{var e;const r=((e=t.translator)!==null&&e!==void 0?e:F).load("jupyterlab");let a;return t.buttonStyle==="icons"?a=i.createElement(ce.react,{tag:"span",elementSize:"xlarge",elementPosition:"center"}):a=r.__("Add"),i.createElement("button",{className:"jp-mod-styled jp-mod-accept jp-ArrayOperationsButton",onClick:t.onAddClick,title:r.__("Add item")},a)};function G(t){const{component:e,name:r,buttonStyle:a,compact:n,showModifiedFromDefault:u,translator:m}=t,s=n??!1,p=a??(s?"icons":"text"),h=f=>e({...f,buttonStyle:p,compact:s,showModifiedFromDefault:u??!0,translator:m??F});return r&&(h.displayName=r),h}function te(t,e){const r=J("TitleFieldTemplate",t,e),a=J("DescriptionFieldTemplate",t,e);return{TitleField:r,DescriptionField:a}}const Ke=t=>G({...t,name:"JupyterLabArrayTemplate",component:e=>{var r;const{schema:a,registry:n,uiSchema:u,required:m}=e,s={schema:a,registry:n,uiSchema:u,required:m},{TitleField:p,DescriptionField:h}=te(n,u);return i.createElement("div",{className:e.className},e.compact?i.createElement("div",{className:"jp-FormGroup-compactTitle"},i.createElement("div",{className:"jp-FormGroup-fieldLabel jp-FormGroup-contentItem",id:`${e.idSchema.$id}__title`},e.title||""),i.createElement("div",{className:"jp-FormGroup-description",id:`${e.idSchema.$id}-description`},e.schema.description||"")):i.createElement(i.Fragment,null,e.title&&i.createElement(p,{...s,title:e.title,id:`${e.idSchema.$id}-title`}),i.createElement(h,{...s,id:`${e.idSchema.$id}-description`,description:(r=e.schema.description)!==null&&r!==void 0?r:""})),e.items.map(f=>i.createElement("div",{key:f.key,className:f.className},f.children,i.createElement("div",{className:"jp-ArrayOperations"},i.createElement(z,{buttonStyle:e.buttonStyle,translator:e.translator,item:f,direction:"up"}),i.createElement(z,{buttonStyle:e.buttonStyle,translator:e.translator,item:f,direction:"down"}),i.createElement(He,{buttonStyle:e.buttonStyle,translator:e.translator,item:f})))),e.canAdd&&i.createElement(ee,{onAddClick:e.onAddClick,buttonStyle:e.buttonStyle,translator:e.translator}))}}),Ye=t=>G({...t,name:"JupyterLabObjectTemplate",component:e=>{var r;const{schema:a,registry:n,uiSchema:u,required:m}=e,s={schema:a,registry:n,uiSchema:u,required:m},{TitleField:p,DescriptionField:h}=te(n,u);return i.createElement("fieldset",{id:e.idSchema.$id},e.compact?i.createElement("div",{className:"jp-FormGroup-compactTitle"},i.createElement("div",{className:"jp-FormGroup-fieldLabel jp-FormGroup-contentItem",id:`${e.idSchema.$id}__title`},e.title||""),i.createElement("div",{className:"jp-FormGroup-description",id:`${e.idSchema.$id}__description`},e.schema.description||"")):i.createElement(i.Fragment,null,(e.title||(e.uiSchema||I.emptyObject)["ui:title"])&&i.createElement(p,{...s,id:`${e.idSchema.$id}__title`,title:e.title||`${(e.uiSchema||I.emptyObject)["ui:title"]}`||""}),i.createElement(h,{...s,id:`${e.idSchema.$id}__description`,description:(r=e.schema.description)!==null&&r!==void 0?r:""})),e.properties.map(f=>f.content),Ge(e.schema,e.uiSchema,e.formData)&&i.createElement(ee,{onAddClick:e.onAddClick(e.schema),buttonStyle:e.buttonStyle,translator:e.translator}))}}),Qe=t=>G({...t,name:"JupyterLabFieldTemplate",component:e=>{var r;const a=((r=e.translator)!==null&&r!==void 0?r:F).load("jupyterlab");let n=!1,u;const{formData:m,schema:s,label:p,displayLabel:h,id:f,formContext:o,errors:l,rawErrors:d,children:c,onKeyChange:g,onDropPropertyClick:_}=e,{defaultFormData:y}=o,C=f.split("_");C.shift();const E=C.join("."),v=E==="",j=E===(e.uiSchema||I.emptyObject)["ui:field"];e.showModifiedFromDefault&&(u=C.reduce((x,P)=>x?.[P],y),n=!v&&m!==void 0&&u!==void 0&&!s.properties&&s.type!=="array"&&!I.deepEqual(m,u));const S=!v&&s.type!="object"&&f!="jp-SettingsEditor-@jupyterlab/shortcuts-extension:shortcuts_shortcuts",N=s.hasOwnProperty($e),B=!(s.type==="object"||s.type==="array");return i.createElement("div",{className:`form-group ${h||s.type==="boolean"?"small-field":""}`},!j&&(d?.length?i.createElement("div",{className:"jp-modifiedIndicator jp-errorIndicator"}):n&&i.createElement("div",{className:"jp-modifiedIndicator"})),i.createElement("div",{className:`jp-FormGroup-content ${e.compact?"jp-FormGroup-contentCompact":"jp-FormGroup-contentNormal"}`},B&&h&&!v&&p&&!N?e.compact?i.createElement("div",{className:"jp-FormGroup-compactTitle"},i.createElement("div",{className:"jp-FormGroup-fieldLabel jp-FormGroup-contentItem"},p),B&&s.description&&S&&i.createElement("div",{className:"jp-FormGroup-description"},s.description)):i.createElement("h3",{className:"jp-FormGroup-fieldLabel jp-FormGroup-contentItem"},p):i.createElement(i.Fragment,null),N&&i.createElement("input",{className:"jp-FormGroup-contentItem jp-mod-styled",type:"text",onBlur:x=>g(x.target.value),defaultValue:p}),i.createElement("div",{className:`${v?"jp-root":s.type==="object"?"jp-objectFieldWrapper":s.type==="array"?"jp-arrayFieldWrapper":"jp-inputFieldWrapper jp-FormGroup-contentItem"}`},c),N&&i.createElement("button",{className:"jp-FormGroup-contentItem jp-mod-styled jp-mod-warn jp-FormGroup-removeButton",onClick:_(p)},a.__("Remove")),!e.compact&&s.description&&S&&i.createElement("div",{className:"jp-FormGroup-description"},s.description),n&&u!==void 0&&s.type!=="object"&&i.createElement("div",{className:"jp-FormGroup-default"},a.__("Default: %1",u!==null?u.toLocaleString():"null")),i.createElement("div",{className:"validationErrors"},l)))}});function Xe(t){const{buttonStyle:e,compact:r,showModifiedFromDefault:a,translator:n,formContext:u,...m}=t,s={...m.uiSchema||I.emptyObject};s["ui:options"]={...ze,...s["ui:options"]},m.uiSchema=s;const{FieldTemplate:p,ArrayFieldTemplate:h,ObjectFieldTemplate:f}=t.templates||I.emptyObject,o={buttonStyle:e,compact:r,showModifiedFromDefault:a,translator:n},l=i.useMemo(()=>p??Qe(o),[p,e,r,a,n]),d=i.useMemo(()=>h??Ke(o),[h,e,r,a,n]),c=i.useMemo(()=>f??Ye(o),[f,e,r,a,n]),g={FieldTemplate:l,ArrayFieldTemplate:d,ObjectFieldTemplate:c};return i.createElement(Re,{templates:g,formContext:u,...m})}class Ze extends i.Component{constructor(e){super(e),this._handleChange=r=>{this.setState({value:r.currentTarget.value})},this._handleSubmit=r=>{r.preventDefault();const a=parseInt(this._textInput.value,10);return!isNaN(a)&&isFinite(a)&&1<=a&&a<=this.props.maxLine&&this.props.handleSubmit(a),!1},this._handleFocus=()=>{this.setState({hasFocus:!0})},this._handleBlur=()=>{this.setState({hasFocus:!1})},this._textInput=null,this.translator=e.translator||F,this._trans=this.translator.load("jupyterlab"),this.state={value:"",hasFocus:!1,textInputId:ue.createDomID()+"-line-number-input"}}componentDidMount(){this._textInput.focus()}render(){return i.createElement("div",{className:"jp-lineFormSearch"},i.createElement("form",{name:"lineColumnForm",onSubmit:this._handleSubmit,noValidate:!0},i.createElement("div",{className:pe("jp-lineFormWrapper","lm-lineForm-wrapper",this.state.hasFocus?"jp-lineFormWrapperFocusWithin":void 0)},i.createElement("input",{type:"text",id:this.state.textInputId,className:"jp-lineFormInput",onChange:this._handleChange,onFocus:this._handleFocus,onBlur:this._handleBlur,value:this.state.value,ref:e=>{this._textInput=e}}),i.createElement("div",{className:"jp-baseLineForm jp-lineFormButtonContainer"},i.createElement(fe.react,{className:"jp-baseLineForm jp-lineFormButtonIcon",elementPosition:"center"}),i.createElement("input",{type:"submit",className:"jp-baseLineForm jp-lineFormButton",value:""}))),i.createElement("label",{className:"jp-lineFormCaption",htmlFor:this.state.textInputId},this._trans.__("Go to line number between 1 and %1",this.props.maxLine))))}}function et(t){const r=(t.translator||F).load("jupyterlab"),a=n=>{if(n.key==="Enter"||n.key==="Spacebar"||n.key===" ")n.preventDefault(),n.stopPropagation(),t.handleClick();else return};return i.createElement(Me,{role:"button","aria-haspopup":!0,onClick:t.handleClick,source:r.__("Ln %1, Col %2",t.line,t.column),title:r.__("Go to line number…"),tabIndex:0,onKeyDown:a})}class L extends de{constructor(e){super(new L.Model),this._popup=null,this.addClass("jp-mod-highlighted"),this.translator=e||F}render(){return this.model===null?null:i.createElement(et,{line:this.model.line,column:this.model.column,translator:this.translator,handleClick:()=>this._handleClick()})}_handleClick(){this._popup&&this._popup.dispose();const e=me.create(i.createElement(Ze,{handleSubmit:r=>this._handleSubmit(r),currentLine:this.model.line,maxLine:this.model.editor.lineCount,translator:this.translator}));this._popup=Je({body:e,anchor:this,align:"right"})}_handleSubmit(e){this.model.editor.setCursorPosition({line:e-1,column:0}),this._popup.dispose(),this.model.editor.focus()}}(function(t){class e extends he{constructor(){super(...arguments),this._onSelectionChanged=()=>{const a=this._getAllState(),n=this.editor.getCursorPosition();this._line=n.line+1,this._column=n.column+1,this._triggerChange(a,this._getAllState())},this._line=1,this._column=1,this._editor=null}get editor(){return this._editor}set editor(a){var n;const u=this._editor;!((n=u?.model)===null||n===void 0)&&n.selections&&u.model.selections.changed.disconnect(this._onSelectionChanged);const m=this._getAllState();if(this._editor=a,!this._editor)this._column=1,this._line=1;else{this._editor.model.selections.changed.connect(this._onSelectionChanged);const s=this._editor.getCursorPosition();this._column=s.column+1,this._line=s.line+1}this._triggerChange(m,this._getAllState())}get line(){return this._line}get column(){return this._column}_getAllState(){return[this._line,this._column]}_triggerChange(a,n){(a[0]!==n[0]||a[1]!==n[1])&&this.stateChanged.emit(void 0)}}t.Model=e})(L||(L={}));var b;(function(t){t.deleteLine="codemirror:delete-line",t.toggleBlockComment="codemirror:toggle-block-comment",t.toggleComment="codemirror:toggle-comment",t.selectNextOccurrence="codemirror:select-next-occurrence",t.toggleTabFocusMode="codemirror:toggle-tab-focus-mode",t.toggleBold="codemirror:markdown-toggle-bold",t.foldCurrent="codemirror:fold-current",t.unfoldCurrent="codemirror:unfold-current",t.foldSubregions="codemirror:fold-subregions",t.unfoldSubregions="codemirror:unfold-subregions",t.foldAll="codemirror:fold-all",t.unfoldAll="codemirror:unfold-all"})(b||(b={}));function tt(t){return Fe(t)||Q(t)}const H=".cm-content",ot={id:"@jupyterlab/codemirror-extension:commands",description:"Registers commands acting on selected/active CodeMirror editor.",autoStart:!0,requires:[Pe],optional:[T,Le],activate:(t,e,r,a)=>{r=r??F;const n=r.load("jupyterlab"),u=o=>o.classList.contains(H),m=()=>{var o,l;const d=(o=t.contextMenuHitTest(u))!==null&&o!==void 0?o:(l=document.activeElement)===null||l===void 0?void 0:l.closest(H);if(d)return je.findFromDOM(d)},s=()=>!!m(),p=o=>{const{state:l}=o,{main:d}=l.selection;if(d.empty)return!1;const{from:c,to:g,anchor:_,head:y}=d,C=_>y,E=l.doc,v=E.sliceString(c,g),j=c>=2&&E.sliceString(c-2,c)==="**",S=E.sliceString(g,g+2)==="**",N=v.startsWith("**"),B=v.endsWith("**"),x=(k,w)=>{const A=C?w:k,re=C?k:w;return Se.single(A,re)};if(j&&S){const k=c-2,w=g+2,A=g-c;return o.dispatch({changes:{from:k,to:w,insert:v},selection:x(k,k+A)}),!0}if(N&&B&&v.length>=4){const k=v.slice(2,-2),w=c,A=c+k.length;return o.dispatch({changes:{from:c,to:g,insert:k},selection:x(w,A)}),!0}const P=`**${v}**`,ne=c+2,ie=g+2;return o.dispatch({changes:{from:c,to:g,insert:P},selection:x(ne,ie)}),!0},h=()=>{var o,l;const d=t.shell.currentWidget,c=(o=e.currentWidget)===null||o===void 0?void 0:o.content;if(e.currentWidget!==null&&e.currentWidget===d&&c&&c.activeCell)return{type:"notebook",widget:d,notebook:c,isEnabled:!0};const g=d;return g&&g.content&&typeof((l=g.content.editor)===null||l===void 0?void 0:l.focus)=="function"?{type:"fileEditor",widget:g,isEnabled:!0}:{type:"none",widget:null,isEnabled:!1}},f=()=>h().isEnabled;if(t.commands.addCommand(b.deleteLine,{label:n.__("Delete the current line"),describedBy:{args:{type:"object",properties:{}}},execute:()=>{const o=m();o&&ge(o)},isEnabled:s}),t.commands.addCommand(b.toggleBlockComment,{label:n.__("Toggle Block Comment"),caption:n.__("Toggles block comments; falls back to regular comment toggle when block comment syntax is unavailable"),describedBy:{args:{type:"object",properties:{}}},execute:()=>{const o=m();o&&tt(o)},isEnabled:s}),t.commands.addCommand(b.toggleComment,{label:n.__("Toggle Comment"),describedBy:{args:{type:"object",properties:{}}},execute:()=>{const o=m();o&&Q(o)},isEnabled:s}),t.commands.addCommand(b.toggleTabFocusMode,{label:n.__("Toggle Tab Focus Mode"),caption:n.__("Toggles behavior of Tab key between inserting indentation and moving to next focusable element"),describedBy:{args:{type:"object",properties:{}}},execute:()=>{const o=m();o&&be(o)},isEnabled:s}),t.commands.addCommand(b.selectNextOccurrence,{label:n.__("Select Next Occurrence"),describedBy:{args:{type:"object",properties:{}}},execute:()=>{const o=m();o&&ve(o)},isEnabled:s}),t.commands.addCommand(b.toggleBold,{label:n.__("Toggle Bold"),caption:n.__("Toggle bold formatting by wrapping/unwrapping selected text with **"),describedBy:{args:{type:"object",properties:{}}},execute:()=>{const o=m();o&&p(o)},isEnabled:s}),t.commands.addCommand(b.foldCurrent,{label:n.__("Fold Current Region"),describedBy:{args:{type:"object",properties:{}}},execute:()=>{var o;const l=h();l.type==="notebook"?(l.notebook.mode="edit",l.notebook.activeCell&&((o=l.notebook.activeCell.editor)===null||o===void 0||o.focus())):l.type==="fileEditor"&&l.widget.content.editor.focus();const d=m();if(!d)return;const{state:c}=d,g=c.selection.main.head,_=c.doc.lineAt(g);M(c,_.from,_.to)&&$(d)},isEnabled:f}),t.commands.addCommand(b.unfoldCurrent,{label:n.__("Unfold Current Region"),describedBy:{args:{type:"object",properties:{}}},execute:()=>{var o;const l=h();l.type==="notebook"?(l.notebook.mode="edit",l.notebook.activeCell&&((o=l.notebook.activeCell.editor)===null||o===void 0||o.focus())):l.type==="fileEditor"&&l.widget.content.editor.focus();const d=m();if(!d)return;const{state:c}=d,g=c.selection.main.head,_=c.doc.lineAt(g);M(c,_.from,_.to)&&W(d)},isEnabled:f}),t.commands.addCommand(b.foldSubregions,{label:n.__("Fold All Subregions"),describedBy:{args:{type:"object",properties:{}}},execute:()=>{var o;const l=h();l.type==="notebook"?(l.notebook.mode="edit",l.notebook.activeCell&&((o=l.notebook.activeCell.editor)===null||o===void 0||o.focus())):l.type==="fileEditor"&&l.widget.content.editor.focus();const d=m();if(d)try{const{state:c}=d,g=c.selection.main.head,_=c.doc.lineAt(g),y=M(c,_.from,_.to);let C=!1;try{C=c.field(V,!1)!==void 0}catch{C=!1}if(C||($(d),W(d)),!y)return;const E=[];let v=y.from+1;for(;v<y.to;){const j=c.doc.lineAt(v),S=M(c,j.from,j.to);S&&S.from>y.from&&S.to<=y.to?(E.push(ye.of(S)),v=S.to):v=j.to+1}E.length>0&&d.dispatch({effects:E})}catch{}},isEnabled:f}),t.commands.addCommand(b.unfoldSubregions,{label:n.__("Unfold All Subregions"),describedBy:{args:{type:"object",properties:{}}},execute:()=>{var o;const l=h();l.type==="notebook"?(l.notebook.mode="edit",l.notebook.activeCell&&((o=l.notebook.activeCell.editor)===null||o===void 0||o.focus())):l.type==="fileEditor"&&l.widget.content.editor.focus();const d=m();if(d)try{const{state:c}=d,g=c.selection.main.head,_=c.doc.lineAt(g),y=M(c,_.from,_.to);if(!y)return;const C=c.field(V,!1);if(!C)return;const E=[];C.between(y.from+1,y.to,(v,j)=>{v>y.from&&j<=y.to&&E.push(_e.of({from:v,to:j}))}),E.length>0&&d.dispatch({effects:E})}catch{}},isEnabled:f}),t.commands.addCommand(b.foldAll,{label:n.__("Fold All Regions"),describedBy:{args:{type:"object",properties:{}}},execute:()=>{var o;const l=h();l.type==="notebook"?(l.notebook.mode="edit",l.notebook.activeCell&&((o=l.notebook.activeCell.editor)===null||o===void 0||o.focus())):l.type==="fileEditor"&&l.widget.content.editor.focus();const d=m();if(d)try{Ee(d)}catch{}},isEnabled:f}),t.commands.addCommand(b.unfoldAll,{label:n.__("Unfold All Regions"),describedBy:{args:{type:"object",properties:{}}},execute:()=>{var o;const l=h();l.type==="notebook"?(l.notebook.mode="edit",l.notebook.activeCell&&((o=l.notebook.activeCell.editor)===null||o===void 0||o.focus())):l.type==="fileEditor"&&l.widget.content.editor.focus();const d=m();if(d)try{Ce(d)}catch{}},isEnabled:f}),a){const o=n.__("File Operations");[b.foldCurrent,b.unfoldCurrent,b.foldSubregions,b.unfoldSubregions,b.foldAll,b.unfoldAll].forEach(l=>{a.addItem({command:l,category:o})})}}},K="@jupyterlab/codemirror-extension:plugin",nt={id:"@jupyterlab/codemirror-extension:languages",description:"Provides the CodeMirror languages registry.",provides:X,optional:[T],activate:(t,e)=>{const r=new q;for(const a of q.getDefaultLanguages(e,n=>r.findBest(n)))r.addLanguage(a);return r.addLanguage({name:"ipythongfm",mime:"text/x-ipythongfm",load:async()=>{const[a,n,u]=await Promise.all([D(()=>import("./dist-eeUvSSUK.js"),[],import.meta.url),D(()=>import("./dist-Frc5TvpU.js"),[],import.meta.url),D(()=>import("./stex-C3f8Ysf7.js"),[],import.meta.url)]),m=a.markdown({base:a.markdownLanguage,codeLanguages:s=>r.findBest(s),extensions:[ke(Ie.define(u.stexMath).parser)]});return new we(m.language,[m.support,Te(n.pythonLanguage)])}}),r}},it={id:"@jupyterlab/codemirror-extension:themes",description:"Provides the CodeMirror theme registry",provides:Z,optional:[T],activate:(t,e)=>{const r=new U;for(const a of U.getDefaultThemes(e))r.addTheme(a);return r}},rt={id:"@jupyterlab/codemirror-extension:extensions",description:"Provides the CodeMirror extension factory registry.",provides:R,requires:[Z],optional:[T,Ve,qe],activate:(t,e,r,a,n)=>{const u=new O;for(const m of O.getDefaultExtensions({themes:e,translator:r}))u.addExtension(m);if(a){const m=s=>{var p;u.baseConfiguration=(p=s.get("defaultConfig").composite)!==null&&p!==void 0?p:{}};Promise.all([a.load(K),t.restored]).then(([s])=>{m(s),s.changed.connect(m)}),n?.addRenderer(`${K}.defaultConfig`,{fieldRenderer:s=>{let p;const h=i.useMemo(()=>u.settingsSchema,[]);s.name in s.formContext.defaultFormData?p=s.formContext.defaultFormData[s.name]:p={};for(const[f,o]of Object.entries(u.defaultConfiguration))typeof h[f]<"u"&&!(f in p)&&(p[f]=o);return i.createElement("div",{className:"jp-FormGroup-contentNormal"},i.createElement("h3",{className:"jp-FormGroup-fieldLabel jp-FormGroup-contentItem"},s.schema.title),s.schema.description&&i.createElement("div",{className:"jp-FormGroup-description"},s.schema.description),i.createElement(Xe,{schema:{title:s.schema.title,description:s.schema.description,type:"object",properties:h,additionalProperties:!1},validator:We,formData:{...p,...s.formData},formContext:{defaultFormData:p},liveValidate:!0,onChange:f=>{var o;const l={};for(const[d,c]of Object.entries((o=f.formData)!==null&&o!==void 0?o:{})){const g=p[d];(g===void 0||!I.deepEqual(c,g))&&(l[d]=c)}s.onChange(l)},tagName:"div",translator:r??F,buttonStyle:"icons"}))}})}return u}},at={id:"@jupyterlab/codemirror-extension:binding",description:"Register the CodeMirror extension factory binding the editor and the shared model.",autoStart:!0,requires:[R],activate:(t,e)=>{e.addExtension({name:"shared-model-binding",factory:r=>{var a;const n=r.model.sharedModel;return O.createImmutableExtension(Ne({ytext:n.ysource,undoManager:(a=n.undoManager)!==null&&a!==void 0?a:void 0}))}})}},lt={id:"@jupyterlab/codemirror-extension:services",description:"Provides the service to instantiate CodeMirror editors.",provides:xe,requires:[X,R],optional:[T],activate:(t,e,r,a)=>({factoryService:new De({extensions:r,languages:e,translator:a??F}),mimeTypeService:new Oe(e)})},oe={id:"@jupyterlab/codemirror-extension:line-col-status",description:"Provides the code editor cursor position model.",autoStart:!0,requires:[T],optional:[Ue,Be],provides:Ae,activate:(t,e,r,a)=>{const n=new L(e),u=new Set;a&&a.registerStatusItem(oe.id,{priority:1,item:n,align:"right",rank:2,isActive:()=>!!n.model.editor});const m=h=>{u.add(h),t.shell.currentWidget&&p(t.shell,{newValue:t.shell.currentWidget})},s=()=>{p(t.shell,{oldValue:t.shell.currentWidget,newValue:t.shell.currentWidget})};function p(h,f){Promise.all([...u].map(o=>o(f.newValue))).then(o=>{var l;n.model.editor=(l=o.filter(d=>d!==null)[0])!==null&&l!==void 0?l:null}).catch(o=>{console.error("Get editors",o)})}return r&&r.currentChanged.connect(p),{addEditorProvider:m,update:s}}},yo=[ot,nt,it,at,rt,lt,oe];export{yo as default,oe as lineColItem};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{aa as L,aB as D,aE as w,eF as W,r as M,J as I,aD as T,eG as k,eH as V,eI as K,eJ as G,dL as $,eK as z}from"../datalayer-app-main.js";import{K as j,b as F,c as J,P as U,d as X,I as E,e as B,f as Q}from"./index--Rl4aMiU.js";import{a as Y}from"./tokens-B3Xc25f7.js";import{I as q}from"./tokens-1h_N3aLM.js";import{I as H}from"./CellSidebarExtension-
|
|
1
|
+
import{aa as L,aB as D,aE as w,eF as W,r as M,J as I,aD as T,eG as k,eH as V,eI as K,eJ as G,dL as $,eK as z}from"../datalayer-app-main.js";import{K as j,b as F,c as J,P as U,d as X,I as E,e as B,f as Q}from"./index--Rl4aMiU.js";import{a as Y}from"./tokens-B3Xc25f7.js";import{I as q}from"./tokens-1h_N3aLM.js";import{I as H}from"./CellSidebarExtension-B_Bqi3Eh.js";import"./hoverbox-CStlKQWE.js";import"./NotebookSkeleton-GSdyJDf_.js";import"./Avatar-DUPBQXVt.js";import"./index-DrrVr0x3.js";import"./dayjs.min-u3zuoSR8.js";import"./isEqual-DXPB_0fo.js";import"./d3-color-Jd8hXty2.js";import"./renderer-B_98xkGt.js";import"./SquareIcon-Dy3l3VdH.js";const A="CompletionProvider:context";class Z{constructor(){this.identifier=A,this.rank=500,this.renderer=null}async isApplicable(t){return!0}fetch(t,e){const n=e.editor;return n?new Promise(i=>{i(R.contextHint(n))}):Promise.reject("No editor")}}var R;(function(l){function t(n){const i=n.getTokenAtCursor(),r=e(i,n).filter(c=>c.type).map(c=>c.value),m=new Set(r),u=new Array;return m.forEach(c=>u.push({label:c})),{start:i.offset,end:i.offset+i.value.length,items:u}}l.contextHint=t;function e(n,i){return i.getTokens().filter(r=>r.value.indexOf(n.value)===0&&r.value!==n.value)}})(R||(R={}));class ee{constructor(){this._activeProviders=new Set([j,A]),this._inlineCompleterSettings=H.defaultSettings,this._providers=new Map,this._inlineProviders=new Map,this._panelHandlers=new Map,this._mostRecentContext=new Map,this._activeProvidersChanged=new L(this),this._selected=new L(this),this._inlineCompleterFactory=null}get activeProvidersChanged(){return this._activeProvidersChanged}get selected(){return this._selected}setTimeout(t){this._timeout=t}setShowDocumentationPanel(t){this._panelHandlers.forEach(e=>e.completer.showDocsPanel=t),this._showDoc=t}setSuppressIfInlineCompleterActive(t){this._panelHandlers.forEach(e=>e.completer.suppressIfInlineCompleterActive=t),this._suppressIfInlineCompleterActive=t}setContinuousHinting(t){this._panelHandlers.forEach(e=>e.autoCompletion=t),this._autoCompletion=t}registerProvider(t){const e=t.identifier;this._providers.has(e)?console.warn(`Completion provider with identifier ${e} is already registered`):(this._providers.set(e,t),this._panelHandlers.forEach((n,i)=>{this.updateCompleter(this._mostRecentContext.get(i))}))}registerInlineProvider(t){const e=t.identifier;this._inlineProviders.has(e)?console.warn(`Completion provider with identifier ${e} is already registered`):(this._inlineProviders.set(e,t),this._panelHandlers.forEach((n,i)=>{this.updateCompleter(this._mostRecentContext.get(i))}))}getProviders(){return this._providers}activateProvider(t){this._activeProviders=new Set([]),t.forEach(e=>{this._providers.has(e)&&this._activeProviders.add(e)}),this._activeProviders.size===0&&(this._activeProviders.add(j),this._activeProviders.add(A)),this._activeProvidersChanged.emit()}async updateCompleter(t){var e,n;const{widget:i,editor:o,sanitizer:r}=t,m=i.id,u=this._panelHandlers.get(m),c=[...this._activeProviders][0],a=this._providers.get(c);let _=(e=a?.renderer)!==null&&e!==void 0?e:F.getDefaultRenderer(r);const s=a?.modelFactory;let d;s?d=await s.call(a,t):d=new J,this._mostRecentContext.set(i.id,t);const f={model:d,editor:o,renderer:_,sanitizer:r,showDoc:this._showDoc};if(u){const h=u.completer;(n=h.model)===null||n===void 0||n.dispose(),h.model=f.model,h.renderer=f.renderer,h.showDocsPanel=f.showDoc,h.suppressIfInlineCompleterActive=this._suppressIfInlineCompleterActive,u.autoCompletion=this._autoCompletion,o&&(u.editor=o,u.reconciliator=await this.generateReconciliator(t))}else{const h=await this._generateHandler(t,f);this._panelHandlers.set(i.id,h),h.completer.selected.connect((p,g)=>this._selected.emit({insertText:g})),i.disposed.connect(p=>{this.disposeHandler(p.id,h),this._mostRecentContext.delete(m)})}}invoke(t){const e=this._panelHandlers.get(t);e&&e.invoke()}select(t){const e=this._panelHandlers.get(t);e&&e.completer.selectActive()}setInlineCompleterFactory(t){this._inlineCompleterFactory=t,this._panelHandlers.forEach((e,n)=>{this.updateCompleter(this._mostRecentContext.get(n))}),!this.inline&&(this.inline={invoke:e=>{const n=this._panelHandlers.get(e);n&&n.inlineCompleter&&n.invokeInline()},isActive:e=>{const n=this._panelHandlers.get(e);return n&&n.inlineCompleter?n.inlineCompleter.isActive:!1},cycle:(e,n)=>{const i=this._panelHandlers.get(e);i&&i.inlineCompleter&&i.inlineCompleter.cycle(n)},accept:e=>{const n=this._panelHandlers.get(e);n&&n.inlineCompleter&&n.inlineCompleter.accept()},configure:e=>{this._inlineCompleterSettings=e;for(const[n,i]of this._inlineProviders.entries())i.configure&&i.configure(e.providers[n]);this._panelHandlers.forEach((n,i)=>{n.inlineCompleter&&n.inlineCompleter.configure(e),this.updateCompleter(this._mostRecentContext.get(i))})}})}get inlineProviders(){return[...this._inlineProviders.values()]}async generateReconciliator(t){const e=[];for(const[o,r]of Object.entries(this._inlineCompleterSettings.providers))r.enabled===!0&&e.push(o);const n=[...this._inlineProviders.values()].filter(o=>e.includes(o.identifier)),i=[];for(const o of this._activeProviders){const r=this._providers.get(o);r&&i.push(r)}return new U({context:t,providers:i,inlineProviders:n,inlineProvidersSettings:this._inlineCompleterSettings.providers,timeout:this._timeout})}disposeHandler(t,e){var n,i,o,r;(n=e.completer.model)===null||n===void 0||n.dispose(),e.completer.dispose(),(o=(i=e.inlineCompleter)===null||i===void 0?void 0:i.model)===null||o===void 0||o.dispose(),(r=e.inlineCompleter)===null||r===void 0||r.dispose(),e.dispose(),this._panelHandlers.delete(t)}async _generateHandler(t,e){const n=new F(e),i=this._inlineCompleterFactory?this._inlineCompleterFactory.factory({...e,model:new H.Model}):void 0;n.hide(),D.attach(n,document.body),i&&(D.attach(i,document.body),i.hide(),i.configure(this._inlineCompleterSettings));const o=await this.generateReconciliator(t),r=new X({completer:n,inlineCompleter:i,reconciliator:o});return r.editor=t.editor,r}}class te{constructor(t){this.options=t,this.identifier="@jupyterlab/inline-completer:history",this._maxSuggestions=100;const e=t.translator||w;this._trans=e.load("jupyterlab")}get name(){return this._trans.__("History")}get icon(){return W}get schema(){return{properties:{maxSuggestions:{title:this._trans.__("Maximum number of suggestions"),description:this._trans.__("The maximum number of suggestions to retrieve from history."),type:"number"}},default:{enabled:!1,maxSuggestions:100}}}configure(t){var e;this._maxSuggestions=(e=t.maxSuggestions)!==null&&e!==void 0?e:100}async fetch(t,e,n){var i;const o=(i=e.session)===null||i===void 0?void 0:i.kernel;if(!o)throw new Error("No kernel for completion request.");const m=t.text.slice(0,t.offset).split(`
|
|
2
2
|
`).slice(-1)[0],u=t.text.slice(t.offset).split(`
|
|
3
3
|
`)[0];let c;const a=[];if(m===""){c={output:!1,raw:!0,hist_access_type:"tail",n:this._maxSuggestions};const _=await o.requestHistory(c);if(_.content.status==="ok"){let s=_.content.history;const d=new Map;for(const p of s.reverse()){const g=p[2];d.set(g,(d.get(g)||0)+1)}const h=Array.from(d.entries()).sort((p,g)=>p[1]>g[1]?-1:p[1]<g[1]?1:0);for(const p of h)a.push({insertText:p[0]})}}else{c={output:!1,raw:!0,hist_access_type:"search",pattern:O(m)+"*"+(u?O(u)+"*":""),unique:!0,n:this._maxSuggestions};const _=await o.requestHistory(c);if(_.content.status==="ok")for(const s of _.content.history){const d=s[2].split(`
|
|
4
4
|
`);for(let f=0;f<d.length;f++){const h=d[f];if(h.startsWith(m)){let p=h.slice(m.length);f+1<d.length&&(p+=`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{aD as v,aE as h,av as k}from"../datalayer-app-main.js";import{I as g,a as y,b as L}from"./index-
|
|
1
|
+
import{aD as v,aE as h,av as k}from"../datalayer-app-main.js";import{I as g,a as y,b as L}from"./index-z8PItpd8.js";import{I as b}from"./tokens-BoOsoUsu.js";import{a as R}from"./index-i9IsP_xD.js";import{R as _}from"./index-DrrVr0x3.js";import"./Output-Do1CYRIF.js";import"./index--Rl4aMiU.js";import"./hoverbox-CStlKQWE.js";import"./dist-Frc5TvpU.js";import"./PaintbrushIcon-CFBHU-3l.js";import"./index-BaRoLDk0.js";import"./RestartIcon-DvpOf5Mf.js";import"./CellSidebarExtension-B_Bqi3Eh.js";import"./NotebookSkeleton-GSdyJDf_.js";import"./Avatar-DUPBQXVt.js";import"./renderer-B_98xkGt.js";import"./SquareIcon-Dy3l3VdH.js";import"./FileDirectoryOpenFillIcon-jGhuRcP3.js";import"./url-DY3jeuF8.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-BoT73xjq.js";import"./index-CShCHnof.js";import"./KernelVariables-cH-x-Hrc.js";import"./index-BWeXDhSd.js";import"./SortAscIcon-CmH04s3F.js";import"./SortDescIcon-Qif6E10I.js";import"./NotebookToolbar-C1fpK-Vi.js";import"./RepoPushIcon-BtXQRhLa.js";import"./sessions-LMslHH3H.js";import"./tokens-UgGv77-l.js";import"./drivecontents-BabrDJge.js";import"./kernel-DWlDRhgJ.js";import"./dayjs.min-u3zuoSR8.js";import"./isEqual-DXPB_0fo.js";import"./d3-color-Jd8hXty2.js";var a;(function(t){t.handleLink="rendermime:handle-local-link"})(a||(a={}));const Re={id:"@jupyterlab/rendermime-extension:plugin",description:"Provides the render mime registry.",optional:[b,y,R,L,v],provides:g,activate:I,autoStart:!0},f="debugger:open-source";function I(t,n,p,s,l,i){const d=(i??h).load("jupyterlab");return n&&t.commands.addCommand(a.handleLink,{label:d.__("Handle Local Link"),execute:e=>{const r=e.path,o=e.id,m=e.scope||"server";if(r){if(m==="kernel"){if(!t.commands.hasCommand(f)){console.warn("Cannot open kernel file: debugger sources provider not available");return}return t.commands.execute(f,{path:r})}return n.services.contents.get(r,{content:!1}).then(()=>{const u=n.registry.defaultRenderedWidgetFactory(r),c=n.openOrReveal(r,u.name);c&&o&&c.setFragment(o)})}},describedBy:{args:{type:"object",properties:{path:{type:"string",description:d.__("The file path to open")},id:{type:"string",description:d.__("Fragment identifier to navigate to")},scope:{type:"string",enum:["kernel","server"],description:d.__("Scope of the file location")}},required:["path"]}}}),new _({initialFactories:k,trustHandler:{markTrusted:e=>{t.commandLinker.markTrusted(e)},unmarkTrusted:e=>{t.commandLinker.unmarkTrusted(e)}},linkHandler:n?{handleLink:(e,r,o)=>{e.tagName==="A"&&e.hasAttribute("download")||e.addEventListener("click",m=>{m.preventDefault(),t.commands.execute(a.handleLink,{path:r,id:o})})},handlePath:(e,r,o,m)=>{e.addEventListener("click",u=>{u.preventDefault(),t.commands.execute(a.handleLink,{path:r,id:m,scope:o})})}}:void 0,latexTypesetter:p??void 0,markdownParser:l??void 0,translator:i??void 0,sanitizer:s??void 0})}export{Re as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{T as $e,q as he,t as ht,r as ce,b as De,g as Je,I as pt,k as gt,a as ze,f as Ge,C as Re,h as Ie}from"./index-i9IsP_xD.js";import{J as M,aB as ee,ch as ie,aE as R,gx as mt,eJ as Ct,fU as bt,cj as me,aK as Te,eh as ft,cl as vt,ei as _t,cf as Ce,iF as yt,r as J,eP as xt,iy as wt,eN as kt,dC as Q,cp as St,iG as v,dN as Ye,dJ as Xe,dO as Ze,fS as Qe,fT as et,eM as Be,aJ as At,aF as tt,aG as ke,iH as Mt,iI as Tt,iA as Bt,k as Y,bh as Et,gp as Nt,aa as Ot,aC as be,gC as G,iJ as ge,aA as le,iK as xe,iL as Z,eG as Pe,iM as jt,iN as Rt,dX as we,dZ as It,d$ as Le,iO as We,dY as Pt,iP as Lt,iQ as Wt,ax as ot,iR as Ht,iS as Ft,eL as Kt,iT as Vt,aD as F,ew as fe,iU as Se,dx as Ut,eE as qt,e3 as $t,iV as Dt,iW as se,iX as nt,ce as pe,dz as Jt,aH as zt,dE as Gt,cr as Yt,gA as Xt,iY as Zt,dS as Qt,dV as eo,iZ as to,dH as oo,i_ as no,i$ as io,ed as lo,ee as so,dy as ro,bg as ao,fl as co}from"../datalayer-app-main.js";import{b as uo,I as it}from"./token-CdPvDaO6.js";import{ToolbarItems as ho}from"./lib-BQwc_iHi.js";import{I as po}from"./index-B3Hf3MzW.js";import{I as ve}from"./tokens-C5FWZLTC.js";import{a as lt,I as L,b as st,c as go}from"./tokens-BiQDy_zz.js";import{I as mo,a as rt}from"./tokens-DuSIK5iU.js";import{I as Co}from"./tokens-iGMkLb0v.js";import{f as at,e as bo,c as fo,I as vo,b as _o}from"./index-DRUP-YmW.js";import{I as dt}from"./tokens-DfQxPp01.js";import{I as _e}from"./tokens-1h_N3aLM.js";import{a as Ee}from"./tokens-B3Xc25f7.js";import{I as yo}from"./tokens-BoOsoUsu.js";import{I as xo}from"./index--Rl4aMiU.js";import{I as wo}from"./tokens-udK9JDBx.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-Dx9me6Cm.js";import{s as Eo}from"./hover-DpawhsId.js";import{b as No,c as Oo,d as jo}from"./CellSidebarExtension-BMTA9AQz.js";import{H as Ro}from"./htmlselect-CIhYGigR.js";import{T as Io,a as Po}from"./model-DrXnd96t.js";import{C as Fe}from"./celltoolbartracker-8YTtJOxD.js";import"./hoverbox-CStlKQWE.js";import"./Output-BfjIM99o.js";import"./index-_yFHxlc9.js";import"./dayjs.min-u3zuoSR8.js";import"./isEqual-DXPB_0fo.js";import"./d3-color-Jd8hXty2.js";import"./dist-Frc5TvpU.js";import"./PaintbrushIcon-CFBHU-3l.js";import"./index-BaRoLDk0.js";import"./RestartIcon-DvpOf5Mf.js";import"./NotebookSkeleton-GSdyJDf_.js";import"./Avatar-DUPBQXVt.js";import"./renderer-jLLXpZ99.js";import"./SquareIcon-Dy3l3VdH.js";import"./FileDirectoryOpenFillIcon-jGhuRcP3.js";import"./url-DY3jeuF8.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-BoT73xjq.js";import"./index-CShCHnof.js";import"./KernelVariables-BXCbgHG5.js";import"./index-BWeXDhSd.js";import"./SortAscIcon-CmH04s3F.js";import"./SortDescIcon-Qif6E10I.js";import"./NotebookToolbar-C1fpK-Vi.js";import"./RepoPushIcon-BtXQRhLa.js";import"./sessions-LMslHH3H.js";import"./tokens-UgGv77-l.js";import"./drivecontents-BabrDJge.js";import"./kernel-DWlDRhgJ.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($e,{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",$o="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 Q({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 Q({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 Q({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 Q({icon:Ze,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 Q({icon:Qe,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 Q({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 Do(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 Do 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:$o,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($e,{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 Zo 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 Qo(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 Z&&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 Z&&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 Z&&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 Qo(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 $e,q as he,t as ht,r as ce,b as De,g as Je,I as pt,k as gt,a as ze,f as Ge,C as Re,h as Ie}from"./index-i9IsP_xD.js";import{J as M,aB as ee,ch as ie,aE as R,gx as mt,eJ as Ct,fU as bt,cj as me,aK as Te,eh as ft,cl as vt,ei as _t,cf as Ce,iF as yt,r as J,eP as xt,iy as wt,eN as kt,dC as Q,cp as St,iG as v,dN as Ye,dJ as Xe,dO as Ze,fS as Qe,fT as et,eM as Be,aJ as At,aF as tt,aG as ke,iH as Mt,iI as Tt,iA as Bt,k as Y,bh as Et,gp as Nt,aa as Ot,aC as be,gC as G,iJ as ge,aA as le,iK as xe,iL as Z,eG as Pe,iM as jt,iN as Rt,dX as we,dZ as It,d$ as Le,iO as We,dY as Pt,iP as Lt,iQ as Wt,ax as ot,iR as Ht,iS as Ft,eL as Kt,iT as Vt,aD as F,ew as fe,iU as Se,dx as Ut,eE as qt,e3 as $t,iV as Dt,iW as se,iX as nt,ce as pe,dz as Jt,aH as zt,dE as Gt,cr as Yt,gA as Xt,iY as Zt,dS as Qt,dV as eo,iZ as to,dH as oo,i_ as no,i$ as io,ed as lo,ee as so,dy as ro,bg as ao,fl as co}from"../datalayer-app-main.js";import{b as uo,I as it}from"./token-CdPvDaO6.js";import{ToolbarItems as ho}from"./lib-Enno6S7H.js";import{I as po}from"./index-B3Hf3MzW.js";import{I as ve}from"./tokens-C5FWZLTC.js";import{a as lt,I as L,b as st,c as go}from"./tokens-BiQDy_zz.js";import{I as mo,a as rt}from"./tokens-DuSIK5iU.js";import{I as Co}from"./tokens-iGMkLb0v.js";import{f as at,e as bo,c as fo,I as vo,b as _o}from"./index-z8PItpd8.js";import{I as dt}from"./tokens-DfQxPp01.js";import{I as _e}from"./tokens-1h_N3aLM.js";import{a as Ee}from"./tokens-B3Xc25f7.js";import{I as yo}from"./tokens-BoOsoUsu.js";import{I as xo}from"./index--Rl4aMiU.js";import{I as wo}from"./tokens-udK9JDBx.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-Dx9me6Cm.js";import{s as Eo}from"./hover-DpawhsId.js";import{b as No,c as Oo,d as jo}from"./CellSidebarExtension-B_Bqi3Eh.js";import{H as Ro}from"./htmlselect-CIhYGigR.js";import{T as Io,a as Po}from"./model-DrXnd96t.js";import{C as Fe}from"./celltoolbartracker-8YTtJOxD.js";import"./hoverbox-CStlKQWE.js";import"./Output-Do1CYRIF.js";import"./index-DrrVr0x3.js";import"./dayjs.min-u3zuoSR8.js";import"./isEqual-DXPB_0fo.js";import"./d3-color-Jd8hXty2.js";import"./dist-Frc5TvpU.js";import"./PaintbrushIcon-CFBHU-3l.js";import"./index-BaRoLDk0.js";import"./RestartIcon-DvpOf5Mf.js";import"./NotebookSkeleton-GSdyJDf_.js";import"./Avatar-DUPBQXVt.js";import"./renderer-B_98xkGt.js";import"./SquareIcon-Dy3l3VdH.js";import"./FileDirectoryOpenFillIcon-jGhuRcP3.js";import"./url-DY3jeuF8.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-BoT73xjq.js";import"./index-CShCHnof.js";import"./KernelVariables-cH-x-Hrc.js";import"./index-BWeXDhSd.js";import"./SortAscIcon-CmH04s3F.js";import"./SortDescIcon-Qif6E10I.js";import"./NotebookToolbar-C1fpK-Vi.js";import"./RepoPushIcon-BtXQRhLa.js";import"./sessions-LMslHH3H.js";import"./tokens-UgGv77-l.js";import"./drivecontents-BabrDJge.js";import"./kernel-DWlDRhgJ.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($e,{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",$o="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 Q({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 Q({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 Q({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 Q({icon:Ze,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 Q({icon:Qe,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 Q({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 Do(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 Do 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:$o,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($e,{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 Zo 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 Qo(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 Z&&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 Z&&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 Z&&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 Qo(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 $="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:[De,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,De],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:$n,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",Zt)}},jn={id:"@jupyterlab/notebook-extension:toc",description:"Adds table of content capability to the notebooks",requires:[L,$t,ze],optional:[_o,_e],autoStart:!0,activate:(r,e,n,s,a,l)=>{const p=new Zo(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:Dn,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:$,kernelPreference:{shouldStart:!1,shouldReuse:!1}}}))}r.contextMenu.opened.connect(p)}},al=[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($,"save",S=>ho.createSaveButton(f,S.context.fileChanged)),a.addFactory($,"cellType",S=>Ae.createCellTypeItem(S,u)),a.addFactory($,"kernelName",S=>he.createKernelNameItem(S.sessionContext,d,u)),a.addFactory($,"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,$,fn,u));const y=u.load("jupyterlab"),w=new jo({name:$,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,$),!_)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,3 +1,3 @@
|
|
|
1
|
-
import"./percentages-BXMCSKIN-
|
|
1
|
+
import"./percentages-BXMCSKIN-9RttMFHC.js";import"../datalayer-app-main.js";import"./JupyterLexicalExtension-Dr8dgCst.js";import"./NotebookSkeleton-GSdyJDf_.js";import"./Avatar-DUPBQXVt.js";import"./url-DY3jeuF8.js";import"./isSymbol-BLtK9CV6.js";import"./toNumber-B1wj8-wx.js";import"./StrikethroughIcon-CbiEuPT-.js";import"./VideoIcon-C3wcjUxu.js";import"./ArrowUpIcon-y5enrVH9.js";import"./SortDescIcon-Qif6E10I.js";import"./PaintbrushIcon-CFBHU-3l.js";import"./PrismCss-c7kvMU60.js";import"./Output-Do1CYRIF.js";import"./index-i9IsP_xD.js";import"./hoverbox-CStlKQWE.js";import"./index--Rl4aMiU.js";import"./index-DrrVr0x3.js";import"./dayjs.min-u3zuoSR8.js";import"./isEqual-DXPB_0fo.js";import"./d3-color-Jd8hXty2.js";import"./dist-Frc5TvpU.js";import"./index-BaRoLDk0.js";import"./RestartIcon-DvpOf5Mf.js";import"./LexicalToolRegistry-rXaW8uXA.js";import"./extends-CF3RwP-h.js";import"./index-BWeXDhSd.js";import"./index-DoBkwclg.js";var i={paste:"Įklijuoti",pasteAsPlaintext:"Įklijuoti kaip paprastą tekstą",pasteCharts:"Įklijuoti diagramas",selectAll:"Pažymėti viską",multiSelect:"Pridėkite elementą prie pasirinktų",moveCanvas:"Judinti drobę",cut:"Iškirpti",copy:"Kopijuoti",copyAsPng:"Kopijuoti į iškarpinę kaip PNG",copyAsSvg:"Kopijuoti į iškarpinę kaip SVG",copyText:"Kopijuoti į iškarpinę kaip tekstą",copySource:"",convertToCode:"",bringForward:"Kelti priekio link",sendToBack:"Nustumti į užnugarį",bringToFront:"Iškelti į priekį",sendBackward:"Nustumti link užnugario",delete:"Ištrinti",copyStyles:"Kopijuoti stilius",pasteStyles:"Įklijuoti stilius",stroke:"Linija",background:"Fonas",fill:"Užpildymas",strokeWidth:"Linijos storis",strokeStyle:"Linijos stilius",strokeStyle_solid:"Ištisinė",strokeStyle_dashed:"Brūkšniuota",strokeStyle_dotted:"Taškuota",sloppiness:"Netvarkingumas",opacity:"Nepermatomumas",textAlign:"Teksto lygiavimas",edges:"Kraštai",sharp:"Aštrus",round:"Užapvalintas",arrowheads:"Rodyklės viršūnės",arrowhead_none:"Jokios",arrowhead_arrow:"Rodyklė",arrowhead_bar:"Brukšnys",arrowhead_circle:"",arrowhead_circle_outline:"",arrowhead_triangle:"Trikampis",arrowhead_triangle_outline:"",arrowhead_diamond:"",arrowhead_diamond_outline:"",fontSize:"Šrifto dydis",fontFamily:"Šriftas",addWatermark:"Sukurta su Excalidraw",handDrawn:"Ranka rašytas",normal:"Normalus",code:"Kodas",small:"Mažas",medium:"Vidutinis",large:"Didelis",veryLarge:"Labai didelis",solid:"",hachure:"",zigzag:"",crossHatch:"",thin:"Plonas",bold:"Pastorintas",left:"Kairėje",center:"Centre",right:"Dešinėje",extraBold:"Labiau pastorintas",architect:"Architektas",artist:"Menininkas",cartoonist:"Karikatūristas",fileTitle:"Failo pavadinimas",colorPicker:"Spalvos parinkiklis",canvasColors:"",canvasBackground:"Drobės fonas",drawingCanvas:"",layers:"Sluoksniai",actions:"Veiksmai",language:"Kalba",liveCollaboration:"Bendradarbiavimas gyvai...",duplicateSelection:"",untitled:"",name:"",yourName:"Jūsų vardas",madeWithExcalidraw:"Sukurta su Excalidraw",group:"Grupuoti pasirinkimą",ungroup:"Išgrupuoti pasirinkimą",collaborators:"Bendradarbiautojai",showGrid:"Rodyti tinklelį",addToLibrary:"Pridėti į biblioteką",removeFromLibrary:"Pašalinti iš bibliotekos",libraryLoadingMessage:"",libraries:"Naršyti bibliotekas",loadingScene:"",align:"Lygiuoti",alignTop:"Lygiuoti viršuje",alignBottom:"Lygiuoti apačioje",alignLeft:"Lygiuoti kairėje",alignRight:"Lygiuoti dešinėje",centerVertically:"Centruoti vertikaliai",centerHorizontally:"Centruoti horizontaliai",distributeHorizontally:"",distributeVertically:"",flipHorizontal:"Apversti horizontaliai",flipVertical:"Apversti vertikaliai",viewMode:"",share:"Dalintis",showStroke:"",showBackground:"",toggleTheme:"",personalLib:"Asmeninė biblioteka",excalidrawLib:"Exaclidraw biblioteka",decreaseFontSize:"",increaseFontSize:"",unbindText:"",bindText:"",createContainerFromText:"",link:{edit:"Redeguoti nuorodą",editEmbed:"",create:"Sukurti nuorodą",createEmbed:"",label:"Nuoroda",labelEmbed:"",empty:""},lineEditor:{edit:"",exit:""},elementLock:{lock:"Užrakinti",unlock:"Atrakinti",lockAll:"",unlockAll:""},statusPublished:"",sidebarLock:"",selectAllElementsInFrame:"",removeAllElementsFromFrame:"",eyeDropper:"",textToDiagram:"",prompt:""},a={noItems:"",hint_emptyLibrary:"",hint_emptyPrivateLibrary:""},e={clearReset:"",exportJSON:"Eksportuoti į failą",exportImage:"",export:"",copyToClipboard:"Kopijuoti į iškarpinę",save:"",saveAs:"Išsaugoti kaip",load:"",getShareableLink:"Gauti nuorodą dalinimuisi",close:"Uždaryti",selectLanguage:"Pasirinkite kalbą",scrollBackToContent:"",zoomIn:"Priartinti",zoomOut:"Nutolinti",resetZoom:"",menu:"Meniu",done:"",edit:"Redaguoti",undo:"Anuliuoti",redo:"",resetLibrary:"Atstatyti biblioteką",createNewRoom:"Sukurti naują kambarį",fullScreen:"Visas ekranas",darkMode:"Tamsus režimas",lightMode:"Šviesus režimas",zenMode:"„Zen“ režimas",objectsSnapMode:"",exitZenMode:"Išeiti iš „Zen“ režimo",cancel:"Atšaukti",clear:"Išvalyti",remove:"Pašalinti",embed:"",publishLibrary:"Paskelbti",submit:"Pateikti",confirm:"Patvirtinti",embeddableInteractionButton:""},t={clearReset:"",couldNotCreateShareableLink:"",couldNotCreateShareableLinkTooBig:"",couldNotLoadInvalidFile:"",importBackendFailed:"",cannotExportEmptyCanvas:"",couldNotCopyToClipboard:"",decryptFailed:"",uploadedSecurly:"",loadSceneOverridePrompt:"",collabStopOverridePrompt:`Sesijos nutraukimas perrašys ankstesnį, lokaliai išsaugotą piešinį. Ar tikrai to nori?
|
|
2
2
|
|
|
3
3
|
(Jei nori išlaikyti lokalų piešinį, tiesiog uždaryk naršyklės skirtuką.)`,errorAddingToLibrary:"Nepavyko įtraukti elemento į biblioteką",errorRemovingFromLibrary:"Nepavyko pašalinti elemento iš bibliotekos",confirmAddLibrary:"Tai įtrauks {{numShapes}} figūrą/-as į tavo biblioteką. Ar tikrai to nori?",imageDoesNotContainScene:"Panašu, jog šis paveiksliukas neturi scenos duomenų. Ar yra įjuntas scenos įtraukimas ekportavimo metu?",cannotRestoreFromImage:"Nepavyko atstatyti scenos iš šio nuotraukos failo",invalidSceneUrl:"Nepavyko suimportuoti scenos iš pateiktos nuorodos (URL). Ji arba blogai suformatuota, arba savyje neturi teisingų Excalidraw JSON duomenų.",resetLibrary:"Tai išvalys tavo biblioteką. Ar tikrai to nori?",removeItemsFromsLibrary:"Ištrinti {{count}} elementą/-us iš bibliotekos?",invalidEncryptionKey:"Šifravimo raktas turi būti iš 22 simbolių. Redagavimas gyvai yra išjungtas.",collabOfflineWarning:""},o={unsupportedFileType:"Nepalaikomas failo tipas.",imageInsertError:"Nepyko įkelti paveiksliuko. Pabandyk vėliau...",fileTooBig:"Per didelis failas. Didžiausias leidžiamas dydis yra {{maxSize}}.",svgImageInsertError:"Nepavyko įtraukti SVG paveiksliuko. Panašu, jog SVG yra nevalidus.",failedToFetchImage:"",invalidSVGString:"Nevalidus SVG.",cannotResolveCollabServer:"Nepavyko prisijungti prie serverio bendradarbiavimui. Perkrauk puslapį ir pabandyk prisijungti dar kartą.",importLibraryError:"Nepavyko įkelti bibliotekos",collabSaveFailed:"",collabSaveFailed_sizeExceeded:"",imageToolNotSupported:"",brave_measure_text_error:{line1:"",line2:"",line3:"",line4:""},libraryElementTypeError:{embeddable:"",iframe:"",image:""},asyncPasteFailedOnRead:"",asyncPasteFailedOnParse:"",copyToSystemClipboardFailed:""},r={selection:"Žymėjimas",image:"Įkelti paveiksliuką",rectangle:"Stačiakampis",diamond:"Deimantas",ellipse:"Elipsė",arrow:"Rodyklė",line:"Linija",freedraw:"Piešti",text:"Tekstas",library:"Biblioteka",lock:"Baigus piešti, išlaikyti pasirinktą įrankį",penMode:"Rašyklio režimas - neleisti prisilietimų",link:"Pridėti / Atnaujinti pasirinktos figūros nuorodą",eraser:"Trintukas",frame:"",magicframe:"",embeddable:"",laser:"",hand:"",extraTools:"",mermaidToExcalidraw:"",magicSettings:""},u={canvasActions:"Veiksmai su drobe",selectedShapeActions:"Veiksmai su pasirinkta figūra",shapes:"Figūros"},s={canvasPanning:"",linearElement:"Paspaudimai sukurs papildomus taškus, nepertraukiamas tempimas sukurs liniją",freeDraw:"Spausk ir tempk, paleisk kai norėsi pabaigti",text:"Užuomina: tekstą taip pat galima pridėti bet kur su dvigubu pelės paspaudimu, kol parinkas žymėjimo įrankis",embeddable:"",text_selected:"",text_editing:"",linearElementMulti:"",lockAngle:"",resize:"",resizeImage:"",rotate:"",lineEditor_info:"",lineEditor_pointSelected:"",lineEditor_nothingSelected:"",placeImage:"",publishLibrary:"",bindTextToElement:"",deepBoxSelect:"",eraserRevert:"",firefox_clipboard_write:"",disableSnapping:""},l={cannotShowPreview:"",canvasTooBig:"",canvasTooBigTip:""},n={headingMain:"",clearCanvasMessage:"",clearCanvasCaveat:"",trackedToSentry:"",openIssueMessage:"",sceneContent:""},d={desc_intro:"",desc_privacy:"",button_startSession:"Pradėti seansą",button_stopSession:"Sustabdyti seansą",desc_inProgressIntro:"",desc_shareLink:"",desc_exitSession:"",shareTitle:""},p={title:"Klaida"},m={disk_title:"Įrašyti į diską",disk_details:"",disk_button:"Įrašyti į failą",link_title:"Nuoroda dalinimuisi",link_details:"",link_button:"",excalidrawplus_description:"",excalidrawplus_button:"Eksportuoti",excalidrawplus_exportError:""},k={blog:"",click:"paspaudimas",deepSelect:"",deepBoxSelect:"",curvedArrow:"Banguota rodyklė",curvedLine:"Banguota linija",documentation:"Dokumentacija",doubleClick:"dvigubas paspaudimas",drag:"vilkti",editor:"Redaktorius",editLineArrowPoints:"",editText:"",github:"Radai klaidą? Pateik",howto:"Vadovaukis mūsų gidu",or:"arba",preventBinding:"",tools:"Įrankiai",shortcuts:"Spartieji klavišai",textFinish:"Baigti redagavimą (teksto redaktoriuje)",textNewLine:"Pridėti naują eilutę (tekto redaktoriuje)",title:"Pagalba",view:"",zoomToFit:"",zoomToSelection:"Priartinti iki pažymėtos vietos",toggleElementLock:"",movePageUpDown:"Pajudinti puslapį aukštyn/žemyn",movePageLeftRight:"Pajudinti puslapį kairėn/dešinėn"},c={title:"Išvalyti drobę"},b={title:"Paviešinti biblioteką",itemName:"Elemento pavadinimas",authorName:"Autoriaus vardas",githubUsername:"Github spalyvardis",twitterUsername:"Twitter slapyvardis",libraryName:"Bibliotekos pavadinimas",libraryDesc:"Bibliotekos aprašas",website:"Tinklalapis",placeholder:{authorName:"Tavo vardas arba spalyvardis",libraryName:"Tavo bibliotekos pavadinimas",libraryDesc:"Tavo bibliotekos aprašas, padėti žmonėms geriau suprasti jos paskirtį",githubHandle:"",twitterHandle:"",website:""},errors:{required:"Privalomas",website:"Įveskite teisingą nuorodą (URL)"},noteDescription:"Pateik savo biblioteką, jog ji galėtų būti įtraukta į <link></link>jog kiti žmonės galėtų tai naudoti savo piešiniuose.",noteGuidelines:"Visų pirma, biblioteka turi būti rankiniu būdu patvirtinta. Prašome paskaityti <link>gairės</link>",noteLicense:"<link>MIT licencija, </link>",noteItems:"",atleastOneLibItem:"",republishWarning:""},g={title:"Biblioteka pateikta",content:"Ačiū {{authorName}}. Tavo biblioteka buvo pateikta peržiūrai. Gali sekti būseną<link>čia</link>"},y={resetLibrary:"Atstatyti biblioteką",removeItemsFromLib:"Pašalinti pasirinktus elementus iš bibliotekos"},v={header:"",label:{withBackground:"",onlySelected:"",darkMode:"",embedScene:"",scale:"",padding:""},tooltip:{embedScene:""},title:{exportToPng:"",exportToSvg:"",copyPngToClipboard:""},button:{exportToPng:"",exportToSvg:"",copyPngToClipboard:""}},h={tooltip:"",link:""},S={angle:"",element:"Elementas",elements:"Elementai",height:"Aukštis",scene:"Scena",selected:"Pasirinkta",storage:"Saugykla",title:"Informacija moksliukams",total:"",version:"",versionCopy:"",versionNotAvailable:"",width:"Plotis"},E={addedToLibrary:"Pridėta į biblioteką",copyStyles:"",copyToClipboard:"Nukopijuota į iškarpinę.",copyToClipboardAsPng:"",fileSaved:"Failas išsaugotas.",fileSavedToFilename:"Išsaugota į {filename}",canvas:"drobė",selection:"",pasteAsSingleElement:"",unableToEmbed:"",unrecognizedLinkFormat:""},F={transparent:"Permatoma",black:"",white:"",red:"",pink:"",grape:"",violet:"",gray:"",blue:"",cyan:"",teal:"",green:"",yellow:"",orange:"",bronze:""},T={app:{center_heading:"",center_heading_plus:"",menuHint:""},defaults:{menuHint:"",center_heading:"",toolbarHint:"",helpHint:""}},P={mostUsedCustomColors:"",colors:"",shades:"",hexCode:"",noShades:""},w={action:{exportToImage:{title:"",button:"",description:""},saveToDisk:{title:"",button:"",description:""},excalidrawPlus:{title:"",button:"",description:""}},modal:{loadFromFile:{title:"",button:"",description:""},shareableLink:{title:"",button:"",description:""}}},x={title:"",button:"",description:"",syntax:"",preview:""},ei={labels:i,library:a,buttons:e,alerts:t,errors:o,toolBar:r,headings:u,hints:s,canvasError:l,errorSplash:n,roomDialog:d,errorDialog:p,exportDialog:m,helpDialog:k,clearCanvasDialog:c,publishDialog:b,publishSuccessDialog:g,confirmDialog:y,imageExportDialog:v,encrypted:h,stats:S,toast:E,colors:F,welcomeScreen:T,colorPicker:P,overwriteConfirm:w,mermaid:x};export{t as alerts,e as buttons,l as canvasError,c as clearCanvasDialog,P as colorPicker,F as colors,y as confirmDialog,ei as default,h as encrypted,p as errorDialog,n as errorSplash,o as errors,m as exportDialog,u as headings,k as helpDialog,s as hints,v as imageExportDialog,i as labels,a as library,x as mermaid,w as overwriteConfirm,b as publishDialog,g as publishSuccessDialog,d as roomDialog,S as stats,E as toast,r as toolBar,T as welcomeScreen};
|