jupyter-docprovider 1.0.1__tar.gz → 1.1.0a0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. {jupyter_docprovider-1.0.1 → jupyter_docprovider-1.1.0a0}/PKG-INFO +1 -1
  2. jupyter_docprovider-1.1.0a0/jupyter_docprovider/_version.py +1 -0
  3. {jupyter_docprovider-1.0.1 → jupyter_docprovider-1.1.0a0}/jupyter_docprovider/labextension/package.json +4 -4
  4. jupyter_docprovider-1.1.0a0/jupyter_docprovider/labextension/static/240.5aa622ea121e34d22c41.js +1 -0
  5. jupyter_docprovider-1.0.1/jupyter_docprovider/labextension/static/544.8301e2e6bebb7807a73e.js → jupyter_docprovider-1.1.0a0/jupyter_docprovider/labextension/static/703.96968af03651921862ee.js +1 -1
  6. jupyter_docprovider-1.0.1/jupyter_docprovider/labextension/static/944.4ff35dbd5ee5dd46c226.js → jupyter_docprovider-1.1.0a0/jupyter_docprovider/labextension/static/944.b85c55dff0f14165f872.js +1 -1
  7. jupyter_docprovider-1.1.0a0/jupyter_docprovider/labextension/static/remoteEntry.b892448bd108d88d3288.js +1 -0
  8. {jupyter_docprovider-1.0.1 → jupyter_docprovider-1.1.0a0}/jupyter_docprovider/labextension/static/third-party-licenses.json +3 -3
  9. {jupyter_docprovider-1.0.1 → jupyter_docprovider-1.1.0a0}/packages/docprovider/package.json +2 -2
  10. jupyter_docprovider-1.1.0a0/packages/docprovider/src/__tests__/forkManager.spec.ts +96 -0
  11. {jupyter_docprovider-1.0.1 → jupyter_docprovider-1.1.0a0}/packages/docprovider/src/component.tsx +0 -1
  12. jupyter_docprovider-1.1.0a0/packages/docprovider/src/forkManager.ts +126 -0
  13. {jupyter_docprovider-1.0.1 → jupyter_docprovider-1.1.0a0}/packages/docprovider/src/index.ts +2 -0
  14. {jupyter_docprovider-1.0.1 → jupyter_docprovider-1.1.0a0}/packages/docprovider/src/requests.ts +41 -0
  15. jupyter_docprovider-1.1.0a0/packages/docprovider/src/tokens.ts +117 -0
  16. {jupyter_docprovider-1.0.1 → jupyter_docprovider-1.1.0a0}/packages/docprovider/src/ydrive.ts +0 -1
  17. {jupyter_docprovider-1.0.1 → jupyter_docprovider-1.1.0a0}/packages/docprovider-extension/package.json +3 -3
  18. jupyter_docprovider-1.1.0a0/packages/docprovider-extension/src/forkManager.ts +28 -0
  19. {jupyter_docprovider-1.0.1 → jupyter_docprovider-1.1.0a0}/packages/docprovider-extension/src/index.ts +3 -1
  20. jupyter_docprovider-1.0.1/jupyter_docprovider/_version.py +0 -1
  21. jupyter_docprovider-1.0.1/jupyter_docprovider/labextension/static/618.3664587b0727fbaef163.js +0 -1
  22. jupyter_docprovider-1.0.1/jupyter_docprovider/labextension/static/remoteEntry.0cc9c1b7d583e2058c7e.js +0 -1
  23. {jupyter_docprovider-1.0.1 → jupyter_docprovider-1.1.0a0}/.gitignore +0 -0
  24. {jupyter_docprovider-1.0.1 → jupyter_docprovider-1.1.0a0}/LICENSE +0 -0
  25. {jupyter_docprovider-1.0.1 → jupyter_docprovider-1.1.0a0}/README.md +0 -0
  26. {jupyter_docprovider-1.0.1 → jupyter_docprovider-1.1.0a0}/install.json +0 -0
  27. {jupyter_docprovider-1.0.1 → jupyter_docprovider-1.1.0a0}/jupyter_docprovider/__init__.py +0 -0
  28. {jupyter_docprovider-1.0.1 → jupyter_docprovider-1.1.0a0}/jupyter_docprovider/labextension/static/444.12adfae9a2b50e91531f.js +0 -0
  29. {jupyter_docprovider-1.0.1 → jupyter_docprovider-1.1.0a0}/jupyter_docprovider/labextension/static/576.21a3c1a9ebaebb58d346.js +0 -0
  30. {jupyter_docprovider-1.0.1 → jupyter_docprovider-1.1.0a0}/jupyter_docprovider/labextension/static/style.js +0 -0
  31. {jupyter_docprovider-1.0.1 → jupyter_docprovider-1.1.0a0}/packages/docprovider/babel.config.js +0 -0
  32. {jupyter_docprovider-1.0.1 → jupyter_docprovider-1.1.0a0}/packages/docprovider/jest.config.js +0 -0
  33. {jupyter_docprovider-1.0.1 → jupyter_docprovider-1.1.0a0}/packages/docprovider/src/TimelineSlider.tsx +0 -0
  34. {jupyter_docprovider-1.0.1 → jupyter_docprovider-1.1.0a0}/packages/docprovider/src/__tests__/yprovider.spec.ts +0 -0
  35. {jupyter_docprovider-1.0.1 → jupyter_docprovider-1.1.0a0}/packages/docprovider/src/awareness.ts +0 -0
  36. {jupyter_docprovider-1.0.1 → jupyter_docprovider-1.1.0a0}/packages/docprovider/src/notebookCellExecutor.ts +0 -0
  37. {jupyter_docprovider-1.0.1 → jupyter_docprovider-1.1.0a0}/packages/docprovider/src/yprovider.ts +0 -0
  38. {jupyter_docprovider-1.0.1 → jupyter_docprovider-1.1.0a0}/packages/docprovider/style/base.css +0 -0
  39. {jupyter_docprovider-1.0.1 → jupyter_docprovider-1.1.0a0}/packages/docprovider/style/index.css +0 -0
  40. {jupyter_docprovider-1.0.1 → jupyter_docprovider-1.1.0a0}/packages/docprovider/style/index.js +0 -0
  41. {jupyter_docprovider-1.0.1 → jupyter_docprovider-1.1.0a0}/packages/docprovider/style/slider.css +0 -0
  42. {jupyter_docprovider-1.0.1 → jupyter_docprovider-1.1.0a0}/packages/docprovider/tsconfig.json +0 -0
  43. {jupyter_docprovider-1.0.1 → jupyter_docprovider-1.1.0a0}/packages/docprovider/tsconfig.test.json +0 -0
  44. {jupyter_docprovider-1.0.1 → jupyter_docprovider-1.1.0a0}/packages/docprovider-extension/README.md +0 -0
  45. {jupyter_docprovider-1.0.1 → jupyter_docprovider-1.1.0a0}/packages/docprovider-extension/src/executor.ts +0 -0
  46. {jupyter_docprovider-1.0.1 → jupyter_docprovider-1.1.0a0}/packages/docprovider-extension/src/filebrowser.ts +0 -0
  47. {jupyter_docprovider-1.0.1 → jupyter_docprovider-1.1.0a0}/packages/docprovider-extension/style/index.css +0 -0
  48. {jupyter_docprovider-1.0.1 → jupyter_docprovider-1.1.0a0}/packages/docprovider-extension/style/index.js +0 -0
  49. {jupyter_docprovider-1.0.1 → jupyter_docprovider-1.1.0a0}/packages/docprovider-extension/tsconfig.json +0 -0
  50. {jupyter_docprovider-1.0.1 → jupyter_docprovider-1.1.0a0}/pyproject.toml +0 -0
  51. {jupyter_docprovider-1.0.1 → jupyter_docprovider-1.1.0a0}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: jupyter-docprovider
3
- Version: 1.0.1
3
+ Version: 1.1.0a0
4
4
  Summary: JupyterLab/Jupyter Notebook 7+ extension integrating collaborative shared models.
5
5
  Project-URL: Documentation, https://jupyterlab-realtime-collaboration.readthedocs.io/
6
6
  Project-URL: Repository, https://github.com/jupyterlab/jupyter-collaboration
@@ -0,0 +1 @@
1
+ __version__ = "1.1.0.a0"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jupyter/docprovider-extension",
3
- "version": "3.0.1",
3
+ "version": "3.1.0-alpha.0",
4
4
  "description": "JupyterLab - Collaborative Shared Models",
5
5
  "keywords": [
6
6
  "jupyter",
@@ -53,8 +53,8 @@
53
53
  "watch:labextension": "jupyter labextension watch ."
54
54
  },
55
55
  "dependencies": {
56
- "@jupyter/collaborative-drive": "^3.0.1",
57
- "@jupyter/docprovider": "^3.0.1",
56
+ "@jupyter/collaborative-drive": "^3.1.0-alpha.0",
57
+ "@jupyter/docprovider": "^3.1.0-alpha.0",
58
58
  "@jupyter/ydoc": "^2.0.0 || ^3.0.0",
59
59
  "@jupyterlab/application": "^4.2.0",
60
60
  "@jupyterlab/apputils": "^4.2.0",
@@ -128,7 +128,7 @@
128
128
  }
129
129
  },
130
130
  "_build": {
131
- "load": "static/remoteEntry.0cc9c1b7d583e2058c7e.js",
131
+ "load": "static/remoteEntry.b892448bd108d88d3288.js",
132
132
  "extension": "./extension",
133
133
  "style": "./style"
134
134
  }
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_jupyter_docprovider_extension=self.webpackChunk_jupyter_docprovider_extension||[]).push([[240],{68:(e,t,n)=>{n.d(t,{A:()=>a});var o=n(758),r=n.n(o),s=n(935),i=n.n(s)()(r());i.push([e.id,"/* -----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|---------------------------------------------------------------------------- */\n\n.jp-timelineSliderWrapper .jp-sliderContainer{\n display: flex;\n align-items: center;\n}\n\n.jp-Slider {\n height: 4.5px\n}\n\n#jp-slider-status-bar {\n display: flex;\n}\n\n.jp-timestampDisplay {\n display: flex;\n flex-direction: row;\n align-items: center;\n gap: 6px;\n}\n\n.jp-restoreBtnContainer {\n width: 192px;\n}\n\n.jp-ToolbarButtonComponent.jp-restoreBtn {\n cursor: pointer;\n color: var(--jp-layout-color2);\n width: 100%;\n background: var(--jp-accept-color-normal)\n}\n",""]);const a=i},935:e=>{e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n="",o=void 0!==t[5];return t[4]&&(n+="@supports (".concat(t[4],") {")),t[2]&&(n+="@media ".concat(t[2]," {")),o&&(n+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),n+=e(t),o&&(n+="}"),t[2]&&(n+="}"),t[4]&&(n+="}"),n})).join("")},t.i=function(e,n,o,r,s){"string"==typeof e&&(e=[[null,e,void 0]]);var i={};if(o)for(var a=0;a<this.length;a++){var c=this[a][0];null!=c&&(i[c]=!0)}for(var l=0;l<e.length;l++){var d=[].concat(e[l]);o&&i[d[0]]||(void 0!==s&&(void 0===d[5]||(d[1]="@layer".concat(d[5].length>0?" ".concat(d[5]):""," {").concat(d[1],"}")),d[5]=s),n&&(d[2]?(d[1]="@media ".concat(d[2]," {").concat(d[1],"}"),d[2]=n):d[2]=n),r&&(d[4]?(d[1]="@supports (".concat(d[4],") {").concat(d[1],"}"),d[4]=r):d[4]="".concat(r)),t.push(d))}},t}},758:e=>{e.exports=function(e){return e[1]}},591:e=>{var t=[];function n(e){for(var n=-1,o=0;o<t.length;o++)if(t[o].identifier===e){n=o;break}return n}function o(e,o){for(var s={},i=[],a=0;a<e.length;a++){var c=e[a],l=o.base?c[0]+o.base:c[0],d=s[l]||0,h="".concat(l," ").concat(d);s[l]=d+1;var u=n(h),p={css:c[1],media:c[2],sourceMap:c[3],supports:c[4],layer:c[5]};if(-1!==u)t[u].references++,t[u].updater(p);else{var m=r(p,o);o.byIndex=a,t.splice(a,0,{identifier:h,updater:m,references:1})}i.push(h)}return i}function r(e,t){var n=t.domAPI(t);return n.update(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap&&t.supports===e.supports&&t.layer===e.layer)return;n.update(e=t)}else n.remove()}}e.exports=function(e,r){var s=o(e=e||[],r=r||{});return function(e){e=e||[];for(var i=0;i<s.length;i++){var a=n(s[i]);t[a].references--}for(var c=o(e,r),l=0;l<s.length;l++){var d=n(s[l]);0===t[d].references&&(t[d].updater(),t.splice(d,1))}s=c}}},128:e=>{var t={};e.exports=function(e,n){var o=function(e){if(void 0===t[e]){var n=document.querySelector(e);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}t[e]=n}return t[e]}(e);if(!o)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");o.appendChild(n)}},51:e=>{e.exports=function(e){var t=document.createElement("style");return e.setAttributes(t,e.attributes),e.insert(t,e.options),t}},855:(e,t,n)=>{e.exports=function(e){var t=n.nc;t&&e.setAttribute("nonce",t)}},740:e=>{e.exports=function(e){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var t=e.insertStyleElement(e);return{update:function(n){!function(e,t,n){var o="";n.supports&&(o+="@supports (".concat(n.supports,") {")),n.media&&(o+="@media ".concat(n.media," {"));var r=void 0!==n.layer;r&&(o+="@layer".concat(n.layer.length>0?" ".concat(n.layer):""," {")),o+=n.css,r&&(o+="}"),n.media&&(o+="}"),n.supports&&(o+="}");var s=n.sourceMap;s&&"undefined"!=typeof btoa&&(o+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(s))))," */")),t.styleTagTransform(o,e,t.options)}(t,e,n)},remove:function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(t)}}}},656:e=>{e.exports=function(e,t){if(t.styleSheet)t.styleSheet.cssText=e;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(e))}}},240:(e,t,n)=>{n.r(t),n.d(t,{ForkManager:()=>K,IForkManagerToken:()=>J,JUPYTER_COLLABORATION_FORK_EVENTS_URI:()=>q,NotebookCellServerExecutor:()=>l,ROOM_FORK_URL:()=>p,TimelineWidget:()=>B,WebSocketAwarenessProvider:()=>r,WebSocketProvider:()=>w,YDrive:()=>k,requestAPI:()=>m,requestDocSession:()=>f,requestDocumentTimeline:()=>v,requestUndoRedo:()=>g});var o=n(560);class r extends o.WebsocketProvider{constructor(e){super(e.url,e.roomID,e.awareness.doc,{awareness:e.awareness}),this._isDisposed=!1,this._awareness=e.awareness,this._user=e.user,this._user.ready.then((()=>this._onUserChanged(this._user))).catch((e=>console.error(e))),this._user.userChanged.connect(this._onUserChanged,this)}get isDisposed(){return this._isDisposed}dispose(){this._isDisposed||(this._user.userChanged.disconnect(this._onUserChanged,this),this._isDisposed=!0,this.destroy())}_onUserChanged(e){this._awareness.setLocalStateField("user",e.identity)}}var s=n(501),i=n(314),a=n(33),c=n(877);class l{constructor(e){var t;this._serverSettings=null!==(t=e.serverSettings)&&void 0!==t?t:a.ServerConnection.makeSettings()}async runCell({cell:e,notebook:t,notebookConfig:n,onCellExecuted:o,onCellExecutionScheduled:r,sessionContext:l,sessionDialogs:d,translator:h}){var u,p,m;const f=(h=null!=h?h:c.nullTranslator).load("jupyterlab");switch(e.model.type){case"markdown":e.rendered=!0,e.inputHidden=!1,o({cell:e,success:!0});break;case"code":if(l){if(l.isTerminating){await(0,s.showDialog)({title:f.__("Kernel Terminating"),body:f.__("The kernel for %1 appears to be terminating. You can not run any cell for now.",null===(u=l.session)||void 0===u?void 0:u.path),buttons:[s.Dialog.okButton()]});break}if(l.pendingInput)return await(0,s.showDialog)({title:f.__("Cell not executed due to pending input"),body:f.__("The cell has not been executed to avoid kernel deadlock as there is another pending input! Submit your pending input and try again."),buttons:[s.Dialog.okButton()]}),!1;if(l.hasNoKernel&&await l.startKernel()&&d&&await d.selectKernel(l),l.hasNoKernel)return e.model.sharedModel.transact((()=>{e.model.clearExecution()})),!0;const n=null===(m=null===(p=null==l?void 0:l.session)||void 0===p?void 0:p.kernel)||void 0===m?void 0:m.id,c=i.URLExt.join(this._serverSettings.baseUrl,`api/kernels/${n}/execute`),h=e.model.sharedModel.getId(),v=t.sharedModel.getState("document_id"),g={method:"POST",body:JSON.stringify({cell_id:h,document_id:v})};r({cell:e});let y=!1;try{y=(await a.ServerConnection.makeRequest(c,g,this._serverSettings)).ok}catch(t){if(o({cell:e,success:!1}),e.isDisposed)return!1;throw t}return o({cell:e,success:y}),!0}e.model.sharedModel.transact((()=>{e.model.clearExecution()}),!1)}return Promise.resolve(!0)}}const d="api/collaboration/session",h="api/collaboration/undo_redo",u="api/collaboration/timeline",p="api/collaboration/fork";async function m(e="",t={}){const n=a.ServerConnection.makeSettings(),o=i.URLExt.join(n.baseUrl,e);let r;try{r=await a.ServerConnection.makeRequest(o,t,n)}catch(e){throw new a.ServerConnection.NetworkError(e)}let s=await r.text();if(s.length>0)try{s=JSON.parse(s)}catch(e){console.error("Not a JSON response body.",r)}if(!r.ok)throw new a.ServerConnection.ResponseError(r,s.message||s);return s}async function f(e,t,n){const o=a.ServerConnection.makeSettings(),r=i.URLExt.join(o.baseUrl,d,encodeURIComponent(n)),s={method:"PUT",body:JSON.stringify({format:e,type:t})};let c;try{c=await a.ServerConnection.makeRequest(r,s,o)}catch(e){throw new a.ServerConnection.NetworkError(e)}let l=await c.text();if(l.length>0)try{l=JSON.parse(l)}catch(e){console.log("Not a JSON response body.",c)}if(!c.ok)throw new a.ServerConnection.ResponseError(c,l.message||l);return l}async function v(e,t,n){const o=a.ServerConnection.makeSettings();let r=i.URLExt.join(o.baseUrl,u,n);r=r.concat(`?format=${e}&&type=${t}`);const s={method:"GET"};let c;try{c=await a.ServerConnection.makeRequest(r,s,o)}catch(e){throw new a.ServerConnection.NetworkError(e)}return c}async function g(e,t,n,o){const r=a.ServerConnection.makeSettings();let s=i.URLExt.join(r.baseUrl,h,encodeURIComponent(e));s=s.concat(`?action=${t}&&steps=${n}&&forkRoom=${o}`);const c={method:"PUT"};let l;try{l=await a.ServerConnection.makeRequest(s,c,r)}catch(e){throw new a.ServerConnection.NetworkError(e)}let d=await l.text();if(d.length>0)try{d=JSON.parse(d)}catch(e){console.log("Not a JSON response body.",l)}if(!l.ok)throw new a.ServerConnection.ResponseError(l,d.message||d);return d}var y=n(602),_=n(262);class w{constructor(e){this._onConnectionClosed=e=>{1003===e.code&&(console.error("Document provider closed:",e.reason),(0,s.showErrorMessage)(this._trans.__("Document session error"),e.reason,[s.Dialog.okButton()]),this._sharedModel.dispose())},this._onSync=e=>{e&&(this._yWebsocketProvider&&(this._yWebsocketProvider.off("sync",this._onSync),this._sharedModel.ydoc.getMap("state").set("document_id",this._yWebsocketProvider.roomname)),this._ready.resolve())},this._ready=new _.PromiseDelegate,this._isDisposed=!1,this._path=e.path,this._contentType=e.contentType,this._format=e.format,this._serverUrl=e.url,this._sharedModel=e.model,this._awareness=e.model.awareness,this._yWebsocketProvider=null,this._trans=e.translator;const t=e.user;t.ready.then((()=>{this._onUserChanged(t)})).catch((e=>console.error(e))),t.userChanged.connect(this._onUserChanged,this),this._connect().catch((e=>console.warn(e)))}get isDisposed(){return this._isDisposed}get ready(){return this._ready.promise}get contentType(){return this._contentType}get format(){return this._format}dispose(){var e,t,n;this.isDisposed||(this._isDisposed=!0,null===(e=this._yWebsocketProvider)||void 0===e||e.off("connection-close",this._onConnectionClosed),null===(t=this._yWebsocketProvider)||void 0===t||t.off("sync",this._onSync),null===(n=this._yWebsocketProvider)||void 0===n||n.destroy(),this._disconnect(),y.Signal.clearData(this))}async reconnect(){this._disconnect(),this._connect()}async _connect(){const e=await f(this._format,this._contentType,this._path);this._yWebsocketProvider=new o.WebsocketProvider(this._serverUrl,`${e.format}:${e.type}:${e.fileId}`,this._sharedModel.ydoc,{disableBc:!0,params:{sessionId:e.sessionId},awareness:this._awareness}),this._yWebsocketProvider.on("sync",this._onSync),this._yWebsocketProvider.on("connection-close",this._onConnectionClosed)}async connectToForkDoc(e,t){this._disconnect(),this._yWebsocketProvider=new o.WebsocketProvider(this._serverUrl,e,this._sharedModel.ydoc,{disableBc:!0,params:{sessionId:t},awareness:this._awareness})}get wsProvider(){return this._yWebsocketProvider}_disconnect(){var e,t,n;null===(e=this._yWebsocketProvider)||void 0===e||e.off("connection-close",this._onConnectionClosed),null===(t=this._yWebsocketProvider)||void 0===t||t.off("sync",this._onSync),null===(n=this._yWebsocketProvider)||void 0===n||n.destroy(),this._yWebsocketProvider=null}_onUserChanged(e){this._awareness.setLocalStateField("user",e.identity)}}const S="true"===i.PageConfig.getOption("disableRTC");class k extends a.Drive{constructor(e,t,n){super({name:"RTC"}),this._onCreate=(e,t)=>{var n,o;if("string"==typeof e.format)try{const r=new w({url:i.URLExt.join(this.serverSettings.wsUrl,"api/collaboration/room"),path:e.path,format:e.format,contentType:e.contentType,model:t,user:this._user,translator:this._trans}),s=((null===(n=this._globalAwareness)||void 0===n?void 0:n.getLocalState())||{}).documents||[];s.includes(e.path)||(s.push(`${this.name}:${e.path}`),null===(o=this._globalAwareness)||void 0===o||o.setLocalStateField("documents",s));const a=`${e.format}:${e.contentType}:${e.path}`;this._providers.set(a,r),t.changed.connect((async(t,n)=>{if(!n.stateChange)return;const o=n.stateChange.filter((e=>"hash"===e.name));if(0===o.length)return;o.length>1&&console.error("Unexpected multiple changes to hash value in a single transaction");const r=o[0],s=await this.get(e.path,{content:!1});this._ydriveFileChanged.emit({type:"save",newValue:{...s,hash:r.newValue},oldValue:{hash:r.oldValue}})})),t.disposed.connect((()=>{var t,n;const o=this._providers.get(a);o&&(o.dispose(),this._providers.delete(a));const r=((null===(t=this._globalAwareness)||void 0===t?void 0:t.getLocalState())||{}).documents||[],s=r.indexOf(`${this.name}:${e.path}`);s>-1&&r.splice(s,1),null===(n=this._globalAwareness)||void 0===n||n.setLocalStateField("documents",r)}))}catch(t){console.error(`Failed to open websocket connection for ${e.path}.\n:${t}`)}},this._ydriveFileChanged=new y.Signal(this),this._user=e,this._trans=t,this._globalAwareness=n,this._providers=new Map,this.sharedModelFactory=new b(this._onCreate),super.fileChanged.connect(((e,t)=>{this._ydriveFileChanged.emit(t)}))}get providers(){return this._providers}dispose(){this.isDisposed||(this._providers.forEach((e=>e.dispose())),this._providers.clear(),super.dispose())}async get(e,t){if(t&&t.format&&t.type){const n=`${t.format}:${t.type}:${e}`,o=this._providers.get(n);if(o){const[n]=await Promise.all([super.get(e,{...t,content:!1}),o.ready]);return{...n,format:t.format}}}return super.get(e,t)}async save(e,t={}){if(t.format&&t.type){const n=`${t.format}:${t.type}:${e}`;if(this._providers.get(n)){const n={type:t.type,format:t.format,content:!1};return this.get(e,n)}}return super.save(e,t)}get fileChanged(){return this._ydriveFileChanged}}class b{constructor(e){this._onCreate=e,this.collaborative=!S,this.documentFactories=new Map}registerDocumentFactory(e,t){if(this.documentFactories.has(e))throw new Error(`The content type ${e} already exists`);this.documentFactories.set(e,t)}createNew(e){if("string"==typeof e.format){if(this.collaborative&&e.collaborative&&this.documentFactories.has(e.contentType)){const t=this.documentFactories.get(e.contentType)(e);return this._onCreate(e,t),t}}else console.warn(`Only defined format are supported; got ${e.format}.`)}}var C=n(345),T=n.n(C),E=n(591),x=n.n(E),R=n(740),U=n.n(R),D=n(128),$=n.n(D),N=n(855),P=n.n(N),j=n(51),I=n.n(j),L=n(656),M=n.n(L),F=n(68),W={};W.styleTagTransform=M(),W.setAttributes=P(),W.insert=$().bind(null,"head"),W.domAPI=U(),W.insertStyleElement=I(),x()(F.A,W),F.A&&F.A.locals&&F.A.locals;var A=n(963);const O=({apiURL:e,provider:t,contentType:n,format:o,documentTimelineUrl:r})=>{const[i,a]=(0,C.useState)({roomId:"",timestamps:[],forkRoom:"",sessionId:""}),[c,l]=(0,C.useState)(i.timestamps.length-1),[d,h]=(0,C.useState)(!1),[u,p]=(0,C.useState)(!1),m=(0,C.useRef)(!0),y=(0,C.useRef)(!0),_=(0,C.useRef)(null);function w(e){try{const t=new URL(e).pathname,n=t.lastIndexOf(r);if(-1===n)throw new Error(`API segment "${r}" not found in URL.`);return t.slice(n+r.length)}catch(e){return console.error("Invalid URL or unable to extract filename:",e),""}}return T().createElement("div",{className:"jp-sliderContainer"},T().createElement("div",{onClick:()=>{!async function(r){try{if(m.current){const i=await v(o,n,r);if(!i.ok)throw 404===i.status?new Error("Not found"):503===i.status?new Error("WebSocket closed"):new Error(`Failed to fetch data: ${i.statusText}`);const c=await i.text();let d={roomId:"",timestamps:[],forkRoom:"",sessionId:""};return c&&(s.Notification.warning("Document is now in read-only mode. Changes will not be saved.",{autoClose:2500}),d=JSON.parse(c),a(d),l(d.timestamps.length-1),t.connectToForkDoc(d.forkRoom,d.sessionId),_.current=await f(o,n,w(e))),h(!0),m.current=!1,d}}catch(e){console.error("Error fetching data:",e)}}(w(e))},className:"jp-mod-highlighted",title:"Document Timeline"},T().createElement(A.historyIcon.react,{marginRight:"4px"})),d&&T().createElement("div",{className:"jp-timestampDisplay"},T().createElement("input",{type:"range",min:0,max:i.timestamps.length-1,value:c,onChange:async e=>{const t=parseInt(e.target.value),n=Math.abs(t-c);try{const e=function(e){return e<c?"undo":"redo"}(t);if(l(t),y.current&&(p(!0),y.current=!1),!_.current)return void console.error("Session is not initialized");await g(`${_.current.format}:${_.current.type}:${_.current.fileId}`,e,n,i.forkRoom)}catch(e){console.error("Error fetching or applying updates:",e)}},className:"jp-Slider"}),T().createElement("div",null,T().createElement("strong",null,w(e).split("/").pop()," ")," "),u&&T().createElement("div",{className:"jp-restoreBtnContainer"},T().createElement("button",{onClick:async()=>{if(!_.current)return void console.error("Session is not initialized");const e=await g(`${_.current.format}:${_.current.type}:${_.current.fileId}`,"restore",0,i.forkRoom);200===e.code?(s.Notification.success(e.status,{autoClose:4e3}),t.reconnect(),h(!1),m.current=!0):s.Notification.error(e.status,{autoClose:4e3})},className:"jp-ToolbarButtonComponent jp-restoreBtn"},"Restore version"," ",(e=>{const t=new Date(1e3*e);return`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,"0")}-${String(t.getDate()).padStart(2,"0")} ${String(t.getHours()).padStart(2,"0")}:${String(t.getMinutes()).padStart(2,"0")}:${String(t.getSeconds()).padStart(2,"0")}`})(i.timestamps[c])))))};class B extends s.ReactWidget{constructor(e,t,n,o,r){super(),this.apiURL=e,this.provider=t,this.contentType=n,this.format=o,this.documentTimelineUrl=r,this.addClass("jp-timelineSliderWrapper")}render(){return C.createElement(O,{key:this.apiURL,apiURL:this.apiURL,provider:this.provider,contentType:this.contentType,format:this.format,documentTimelineUrl:this.documentTimelineUrl})}updateContent(e,t){this.apiURL=e,this.provider=t,this.contentType=this.provider.contentType,this.format=this.provider.format,this.update()}}const J=new _.Token("@jupyter/docprovider:IForkManagerToken"),q="https://schema.jupyter.org/jupyter_collaboration/fork/v1";class K{constructor(e){this._disposed=!1,this._forkAddedSignal=new y.Signal(this),this._forkDeletedSignal=new y.Signal(this);const{drive:t,eventManager:n}=e;this._drive=t,this._eventManager=n,this._eventManager.stream.connect(this._handleEvent,this)}get isDisposed(){return this._disposed}get forkAdded(){return this._forkAddedSignal}get forkDeleted(){return this._forkDeletedSignal}dispose(){var e;this._disposed||(null===(e=this._eventManager)||void 0===e||e.stream.disconnect(this._handleEvent),this._disposed=!0)}async createFork(e){const{rootId:t,title:n,description:o,synchronize:r}=e,s={method:"PUT",body:JSON.stringify({title:n,description:o,synchronize:r})},a=i.URLExt.join(p,t);return await m(a,s)}async getAllForks(e){const t=i.URLExt.join(p,e);return await m(t,{method:"GET"})}async deleteFork(e){const{forkId:t,merge:n}=e,o=i.URLExt.join(p,t),r=i.URLExt.objectToQueryString({merge:n});await m(`${o}${r}`,{method:"DELETE"})}getProvider(e){const{documentPath:t,format:n,type:o}=e,r=this._drive;if(r){const e=r.name;let s=t;return t.startsWith(e)&&(s=t.slice(e.length+1)),r.providers.get(`${n}:${o}:${s}`)}}_handleEvent(e,t){if(t.schema_id===q)switch(t.action){case"create":this._forkAddedSignal.emit(t);break;case"delete":this._forkDeletedSignal.emit(t)}}}}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_jupyter_docprovider_extension=self.webpackChunk_jupyter_docprovider_extension||[]).push([[544],{544:(e,t,o)=>{o.r(t),o.d(t,{default:()=>S});var r,n=o(782),a=o(501),i=o(256),s=o(594),l=o(969),d=o(637),c=o(937),u=o(295),p=o(981),v=o(877),g=o(0),h=o(944),b=o(971),m=o(314);!function(e){e.openPath="filebrowser:open-path"}(r||(r={}));const w="api/collaboration/timeline",y="The file %1 has been opened with two different views. This is not supported. Please close this view; otherwise, some of your edits may not be saved properly.",f={id:"@jupyter/docprovider-extension:drive",description:"The default collaborative drive provider",provides:h.ICollaborativeDrive,requires:[v.ITranslator],optional:[h.IGlobalAwareness],activate:(e,t,o)=>{const r=t.load("jupyter_collaboration"),n=new b.YDrive(e.serviceManager.user,r,o);return e.serviceManager.contents.addDrive(n),n}},x={id:"@jupyter/docprovider-extension:yfile",description:"Plugin to register the shared model factory for the content type 'file'",autoStart:!0,requires:[h.ICollaborativeDrive],optional:[],activate:(e,t)=>{t.sharedModelFactory.registerDocumentFactory("file",(()=>new g.YFile))}},I={id:"@jupyter/docprovider-extension:ynotebook",description:"Plugin to register the shared model factory for the content type 'notebook'",autoStart:!0,requires:[h.ICollaborativeDrive],optional:[p.ISettingRegistry],activate:(e,t,o)=>{let r=!0;o&&o.load("@jupyterlab/notebook-extension:tracker").then((e=>{const t=e=>{var t;const o=null==e?void 0:e.get("experimentalEnableDocumentWideUndoRedo").composite;r=null===(t=!o)||void 0===t||t};t(e),e.changed.connect((e=>t(e)))})),t.sharedModelFactory.registerDocumentFactory("notebook",(()=>new g.YNotebook({disableDocumentWideUndoRedo:r})))}},_={id:"@jupyter/docprovider-extension:statusBarTimeline",description:"Plugin to add a timeline slider to the status bar",autoStart:!0,requires:[l.IStatusBar,h.ICollaborativeDrive],activate:async(e,t,o)=>{try{let r=null,n=null;const a=async(t,r)=>{if(r&&"RTC"===t.split(":")[0]&&o){t=t.slice(o.name.length+1),n&&(n.dispose(),n=null);const[a,s]=r.split(":"),l=o.providers.get(`${a}:${s}:${t}`),d=m.URLExt.join(e.serviceManager.serverSettings.baseUrl,w,t);n=new b.TimelineWidget(d,l,l.contentType,l.format,w);const c=document.getElementById("jp-slider-status-bar");c&&!n.isAttached&&i.Widget.attach(n,c)}};e.shell.currentChanged&&e.shell.currentChanged.connect((async(e,t)=>{const o=t.newValue;n&&(n.dispose(),n=null),o&&"context"in o&&(await o.context.ready,await a(o.context.path,o.context.model.sharedModel.getState("document_id")))})),t&&(r||(r=new i.Widget,r.addClass("jp-StatusBar-GroupItem"),r.addClass("jp-mod-highlighted"),r.id="jp-slider-status-bar",t.registerStatusItem("jp-slider-status-bar",{item:r,align:"left",rank:4,isActive:()=>{const t=e.shell.currentWidget;if(t&&t.context&&"string"==typeof t.context.path){const e=t.context.path;return!!t.context.model.sharedModel.getState("document_id")&&"RTC"===e.split(":")[0]}return!1}})))}catch(e){console.error("Failed to activate statusBarTimeline plugin:",e)}}},j={id:"@jupyter/docprovider-extension:defaultFileBrowser",description:"The default file browser factory provider",provides:s.IDefaultFileBrowser,requires:[h.ICollaborativeDrive,s.IFileBrowserFactory],optional:[n.IRouter,n.JupyterFrontEnd.ITreeResolver,n.ILabShell,v.ITranslator],activate:async(e,t,o,r,n,a,i)=>{const{commands:s}=e,l=(null!=i?i:v.nullTranslator).load("jupyterlab");e.serviceManager.contents.addDrive(t);const d=o.createFileBrowser("filebrowser",{auto:!1,restore:!1,driveName:t.name});return d.node.setAttribute("role","region"),d.node.setAttribute("aria-label",l.__("File Browser Section")),C.restoreBrowser(d,s,r,n,a),d}},k={id:"@jupyter/docprovider-extension:logger",description:"A logging plugin for debugging purposes.",autoStart:!0,optional:[c.ILoggerRegistry,d.IEditorTracker,u.INotebookTracker,v.ITranslator],activate:(e,t,o,r,n)=>{const i=(null!=n?n:v.nullTranslator).load("jupyter_collaboration"),s="https://schema.jupyter.org/jupyter_collaboration/session/v1";if(!t)return void e.serviceManager.events.stream.connect(((e,t)=>{var o,r;t.schema_id===s&&(console.debug(`[${t.room}(${t.path})] ${null!==(o=t.action)&&void 0!==o?o:""}: ${null!==(r=t.msg)&&void 0!==r?r:""}`),"WARNING"===t.level&&(0,a.showDialog)({title:i.__("Warning"),body:i.__(y,t.path),buttons:[a.Dialog.okButton()]}))}));const l=new Map,d=(e,o)=>{const r=t.getLogger(o.context.path);l.set(o.context.localPath,r),o.disposed.connect((e=>{l.delete(e.context.localPath)}))};o&&o.widgetAdded.connect(d),r&&r.widgetAdded.connect(d),(async()=>{var t,o;const{events:r}=e.serviceManager;for await(const e of r.stream)if(e.schema_id===s){const r=l.get(e.path);null==r||r.log({type:"text",level:e.level.toLowerCase(),data:`[${e.room}] ${null!==(t=e.action)&&void 0!==t?t:""}: ${null!==(o=e.msg)&&void 0!==o?o:""}`}),"WARNING"===e.level&&(0,a.showDialog)({title:i.__("Warning"),body:i.__(y,e.path),buttons:[a.Dialog.warnButton({label:i.__("Ok")})]})}})()}};var C;!function(e){e.restoreBrowser=async function(e,t,o,n,a){const i="jp-mod-restoring";if(e.addClass(i),!o)return await e.model.restore(e.id),await e.model.refresh(),void e.removeClass(i);const s=async()=>{o.routed.disconnect(s);const l=await(null==n?void 0:n.paths);(null==l?void 0:l.file)||(null==l?void 0:l.browser)?(await e.model.restore(e.id,!1),l.file&&await t.execute(r.openPath,{path:l.file,dontShowBrowser:!0}),l.browser&&await t.execute(r.openPath,{path:l.browser,dontShowBrowser:!0})):(await e.model.restore(e.id),await e.model.refresh()),e.removeClass(i),(null==a?void 0:a.isEmpty("main"))&&t.execute("launcher:create")};o.routed.connect(s)}}(C||(C={}));const S=[f,x,I,j,k,{id:"@jupyter/docprovider-extension:notebook-cell-executor",description:"Add notebook cell executor that uses REST API instead of kernel protocol over WebSocket.",autoStart:!0,provides:u.INotebookCellExecutor,activate:e=>"true"===m.PageConfig.getOption("serverSideExecution")?new b.NotebookCellServerExecutor({serverSettings:e.serviceManager.serverSettings}):Object.freeze({runCell:u.runCell})},_]}}]);
1
+ "use strict";(self.webpackChunk_jupyter_docprovider_extension=self.webpackChunk_jupyter_docprovider_extension||[]).push([[703],{703:(e,t,o)=>{o.r(t),o.d(t,{default:()=>D});var r,a=o(782),n=o(501),i=o(256),s=o(594),l=o(969),d=o(637),c=o(937),u=o(295),p=o(981),v=o(877),g=o(0),h=o(727),b=o(791),w=o(314);!function(e){e.openPath="filebrowser:open-path"}(r||(r={}));const m="api/collaboration/timeline",y="The file %1 has been opened with two different views. This is not supported. Please close this view; otherwise, some of your edits may not be saved properly.",f={id:"@jupyter/docprovider-extension:drive",description:"The default collaborative drive provider",provides:h.ICollaborativeDrive,requires:[v.ITranslator],optional:[h.IGlobalAwareness],activate:(e,t,o)=>{const r=t.load("jupyter_collaboration"),a=new b.YDrive(e.serviceManager.user,r,o);return e.serviceManager.contents.addDrive(a),a}},x={id:"@jupyter/docprovider-extension:yfile",description:"Plugin to register the shared model factory for the content type 'file'",autoStart:!0,requires:[h.ICollaborativeDrive],optional:[],activate:(e,t)=>{t.sharedModelFactory.registerDocumentFactory("file",(()=>new g.YFile))}},I={id:"@jupyter/docprovider-extension:ynotebook",description:"Plugin to register the shared model factory for the content type 'notebook'",autoStart:!0,requires:[h.ICollaborativeDrive],optional:[p.ISettingRegistry],activate:(e,t,o)=>{let r=!0;o&&o.load("@jupyterlab/notebook-extension:tracker").then((e=>{const t=e=>{var t;const o=null==e?void 0:e.get("experimentalEnableDocumentWideUndoRedo").composite;r=null===(t=!o)||void 0===t||t};t(e),e.changed.connect((e=>t(e)))})),t.sharedModelFactory.registerDocumentFactory("notebook",(()=>new g.YNotebook({disableDocumentWideUndoRedo:r})))}},k={id:"@jupyter/docprovider-extension:statusBarTimeline",description:"Plugin to add a timeline slider to the status bar",autoStart:!0,requires:[l.IStatusBar,h.ICollaborativeDrive],activate:async(e,t,o)=>{try{let r=null,a=null;const n=async(t,r)=>{if(r&&"RTC"===t.split(":")[0]&&o){t=t.slice(o.name.length+1),a&&(a.dispose(),a=null);const[n,s]=r.split(":"),l=o.providers.get(`${n}:${s}:${t}`),d=w.URLExt.join(e.serviceManager.serverSettings.baseUrl,m,t);a=new b.TimelineWidget(d,l,l.contentType,l.format,m);const c=document.getElementById("jp-slider-status-bar");c&&!a.isAttached&&i.Widget.attach(a,c)}};e.shell.currentChanged&&e.shell.currentChanged.connect((async(e,t)=>{const o=t.newValue;a&&(a.dispose(),a=null),o&&"context"in o&&(await o.context.ready,await n(o.context.path,o.context.model.sharedModel.getState("document_id")))})),t&&(r||(r=new i.Widget,r.addClass("jp-StatusBar-GroupItem"),r.addClass("jp-mod-highlighted"),r.id="jp-slider-status-bar",t.registerStatusItem("jp-slider-status-bar",{item:r,align:"left",rank:4,isActive:()=>{const t=e.shell.currentWidget;if(t&&t.context&&"string"==typeof t.context.path){const e=t.context.path;return!!t.context.model.sharedModel.getState("document_id")&&"RTC"===e.split(":")[0]}return!1}})))}catch(e){console.error("Failed to activate statusBarTimeline plugin:",e)}}},_={id:"@jupyter/docprovider-extension:defaultFileBrowser",description:"The default file browser factory provider",provides:s.IDefaultFileBrowser,requires:[h.ICollaborativeDrive,s.IFileBrowserFactory],optional:[a.IRouter,a.JupyterFrontEnd.ITreeResolver,a.ILabShell,v.ITranslator],activate:async(e,t,o,r,a,n,i)=>{const{commands:s}=e,l=(null!=i?i:v.nullTranslator).load("jupyterlab");e.serviceManager.contents.addDrive(t);const d=o.createFileBrowser("filebrowser",{auto:!1,restore:!1,driveName:t.name});return d.node.setAttribute("role","region"),d.node.setAttribute("aria-label",l.__("File Browser Section")),C.restoreBrowser(d,s,r,a,n),d}},j={id:"@jupyter/docprovider-extension:logger",description:"A logging plugin for debugging purposes.",autoStart:!0,optional:[c.ILoggerRegistry,d.IEditorTracker,u.INotebookTracker,v.ITranslator],activate:(e,t,o,r,a)=>{const i=(null!=a?a:v.nullTranslator).load("jupyter_collaboration"),s="https://schema.jupyter.org/jupyter_collaboration/session/v1";if(!t)return void e.serviceManager.events.stream.connect(((e,t)=>{var o,r;t.schema_id===s&&(console.debug(`[${t.room}(${t.path})] ${null!==(o=t.action)&&void 0!==o?o:""}: ${null!==(r=t.msg)&&void 0!==r?r:""}`),"WARNING"===t.level&&(0,n.showDialog)({title:i.__("Warning"),body:i.__(y,t.path),buttons:[n.Dialog.okButton()]}))}));const l=new Map,d=(e,o)=>{const r=t.getLogger(o.context.path);l.set(o.context.localPath,r),o.disposed.connect((e=>{l.delete(e.context.localPath)}))};o&&o.widgetAdded.connect(d),r&&r.widgetAdded.connect(d),(async()=>{var t,o;const{events:r}=e.serviceManager;for await(const e of r.stream)if(e.schema_id===s){const r=l.get(e.path);null==r||r.log({type:"text",level:e.level.toLowerCase(),data:`[${e.room}] ${null!==(t=e.action)&&void 0!==t?t:""}: ${null!==(o=e.msg)&&void 0!==o?o:""}`}),"WARNING"===e.level&&(0,n.showDialog)({title:i.__("Warning"),body:i.__(y,e.path),buttons:[n.Dialog.warnButton({label:i.__("Ok")})]})}})()}};var C;!function(e){e.restoreBrowser=async function(e,t,o,a,n){const i="jp-mod-restoring";if(e.addClass(i),!o)return await e.model.restore(e.id),await e.model.refresh(),void e.removeClass(i);const s=async()=>{o.routed.disconnect(s);const l=await(null==a?void 0:a.paths);(null==l?void 0:l.file)||(null==l?void 0:l.browser)?(await e.model.restore(e.id,!1),l.file&&await t.execute(r.openPath,{path:l.file,dontShowBrowser:!0}),l.browser&&await t.execute(r.openPath,{path:l.browser,dontShowBrowser:!0})):(await e.model.restore(e.id),await e.model.refresh()),e.removeClass(i),(null==n?void 0:n.isEmpty("main"))&&t.execute("launcher:create")};o.routed.connect(s)}}(C||(C={}));const S={id:"@jupyter/docprovider-extension:notebook-cell-executor",description:"Add notebook cell executor that uses REST API instead of kernel protocol over WebSocket.",autoStart:!0,provides:u.INotebookCellExecutor,activate:e=>"true"===w.PageConfig.getOption("serverSideExecution")?new b.NotebookCellServerExecutor({serverSettings:e.serviceManager.serverSettings}):Object.freeze({runCell:u.runCell})},T={id:"@jupyter/docprovider-extension:forkManager",autoStart:!0,requires:[h.ICollaborativeDrive],provides:b.IForkManagerToken,activate:(e,t)=>{const o=e.serviceManager.events;return new b.ForkManager({drive:t,eventManager:o})}},D=[f,x,I,_,j,S,k,T]}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_jupyter_docprovider_extension=self.webpackChunk_jupyter_docprovider_extension||[]).push([[944],{78:(n,e,o)=>{o.d(e,{A:()=>s});var r=o(758),t=o.n(r),a=o(935),i=o.n(a),l=o(875),p=o(28),c=i()(t());c.i(l.A),c.i(p.A),c.push([n.id,"/* -----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|---------------------------------------------------------------------------- */\n\n.jp-shared-link-body {\n user-select: none;\n}\n",""]);const s=c},875:(n,e,o)=>{o.d(e,{A:()=>l});var r=o(758),t=o.n(r),a=o(935),i=o.n(a)()(t());i.push([n.id,"/* -----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|---------------------------------------------------------------------------- */\n\n.jp-MenuBar-label {\n margin-left: 25px;\n}\n\n.jp-MenuBar-anonymousIcon span {\n width: 24px;\n text-align: center;\n fill: var(--jp-ui-font-color1);\n color: var(--jp-ui-font-color1);\n}\n\n.jp-MenuBar-anonymousIcon,\n.jp-MenuBar-imageIcon {\n position: absolute;\n top: 1px;\n left: 8px;\n width: 24px;\n height: 24px;\n display: flex;\n align-items: center;\n vertical-align: middle;\n border-radius: 100%;\n}\n\n.jp-MenuBar-imageIcon img {\n width: 24px;\n border-radius: 100%;\n fill: var(--jp-ui-font-color1);\n color: var(--jp-ui-font-color1);\n}\n\n.jp-UserMenu-caretDownIcon {\n height: 22px;\n position: relative;\n top: 15%;\n}\n",""]);const l=i},28:(n,e,o)=>{o.d(e,{A:()=>l});var r=o(758),t=o.n(r),a=o(935),i=o.n(a)()(t());i.push([n.id,"/*\n * Copyright (c) Jupyter Development Team.\n * Distributed under the terms of the Modified BSD License.\n */\n\n/************************************************************\n Main Panel\n*************************************************************/\n\n.jp-RTCPanel {\n min-width: var(--jp-sidebar-min-width) !important;\n color: var(--jp-ui-font-color1);\n background: var(--jp-layout-color1);\n font-size: var(--jp-ui-font-size1);\n}\n\n/************************************************************\n User Info Panel\n*************************************************************/\n.jp-UserInfoPanel {\n display: flex;\n flex-direction: column;\n max-height: 140px;\n padding-top: 3px;\n}\n\n.jp-UserInfo-Container {\n margin: 20px;\n display: flex;\n flex-direction: column;\n align-items: center;\n}\n\n.jp-UserInfo-Icon {\n margin: auto;\n width: 50px;\n height: 50px;\n border-radius: 50px;\n display: inline-flex;\n align-items: center;\n}\n\n.jp-UserInfo-Icon span {\n margin: auto;\n text-align: center;\n font-size: 25px;\n fill: var(--jp-ui-font-color1);\n color: var(--jp-ui-font-color1);\n}\n\n.jp-UserInfo-Info {\n margin: 20px;\n display: inline-flex;\n flex-direction: column;\n}\n\n.jp-UserInfo-Info label {\n font-weight: bold;\n fill: var(--jp-ui-font-color1);\n color: var(--jp-ui-font-color1);\n}\n\n.jp-UserInfo-Info input {\n text-decoration: none;\n border-top: none;\n border-left: none;\n border-right: none;\n border-color: var(--jp-ui-font-color1);\n border-width: 0.5px;\n background-color: transparent;\n fill: var(--jp-ui-font-color1);\n color: var(--jp-ui-font-color1);\n}\n\n/************************************************************\n Collaborators Info Panel\n*************************************************************/\n\n.jp-CollaboratorsPanel {\n overflow-y: auto;\n}\n\n.jp-CollaboratorsList {\n flex-direction: column;\n display: flex;\n z-index: 1000;\n}\n\n.jp-CollaboratorHeader {\n padding: 10px;\n display: flex;\n align-items: center;\n font-size: var(--jp-ui-font-size0);\n fill: var(--jp-ui-font-color1);\n color: var(--jp-ui-font-color1);\n}\n\n.jp-CollaboratorHeader > span {\n padding-left: 7px;\n}\n\n.jp-ClickableCollaborator:hover {\n cursor: pointer;\n background-color: var(--jp-layout-color2);\n fill: var(--jp-ui-font-color0);\n color: var(--jp-ui-font-color0);\n}\n\n.jp-CollaboratorHeaderCollapser {\n transform: rotate(-90deg);\n margin: auto 0;\n height: 16px;\n}\n\n.jp-CollaboratorHeader:not(.jp-ClickableCollaborator) .jp-CollaboratorHeaderCollapser {\n visibility: hidden;\n}\n\n.jp-CollaboratorHeaderCollapser.jp-mod-expanded {\n transform: rotate(0deg);\n}\n\n.jp-CollaboratorIcon {\n border-radius: 100%;\n padding: 2px;\n width: 24px;\n height: 24px;\n display: flex;\n}\n\n.jp-CollaboratorIcon > span {\n text-align: center;\n margin: auto;\n font-size: 12px;\n fill: var(--jp-ui-font-color1);\n color: var(--jp-ui-font-color1);\n}\n\n.jp-CollaboratorFiles {\n padding-left: 1em;\n margin-top: 0;\n box-shadow: 0 2px 2px -2px rgb(0 0 0 / 24%);\n\n}\n",""]);const l=i},935:n=>{n.exports=function(n){var e=[];return e.toString=function(){return this.map((function(e){var o="",r=void 0!==e[5];return e[4]&&(o+="@supports (".concat(e[4],") {")),e[2]&&(o+="@media ".concat(e[2]," {")),r&&(o+="@layer".concat(e[5].length>0?" ".concat(e[5]):""," {")),o+=n(e),r&&(o+="}"),e[2]&&(o+="}"),e[4]&&(o+="}"),o})).join("")},e.i=function(n,o,r,t,a){"string"==typeof n&&(n=[[null,n,void 0]]);var i={};if(r)for(var l=0;l<this.length;l++){var p=this[l][0];null!=p&&(i[p]=!0)}for(var c=0;c<n.length;c++){var s=[].concat(n[c]);r&&i[s[0]]||(void 0!==a&&(void 0===s[5]||(s[1]="@layer".concat(s[5].length>0?" ".concat(s[5]):""," {").concat(s[1],"}")),s[5]=a),o&&(s[2]?(s[1]="@media ".concat(s[2]," {").concat(s[1],"}"),s[2]=o):s[2]=o),t&&(s[4]?(s[1]="@supports (".concat(s[4],") {").concat(s[1],"}"),s[4]=t):s[4]="".concat(t)),e.push(s))}},e}},758:n=>{n.exports=function(n){return n[1]}},591:n=>{var e=[];function o(n){for(var o=-1,r=0;r<e.length;r++)if(e[r].identifier===n){o=r;break}return o}function r(n,r){for(var a={},i=[],l=0;l<n.length;l++){var p=n[l],c=r.base?p[0]+r.base:p[0],s=a[c]||0,u="".concat(c," ").concat(s);a[c]=s+1;var d=o(u),f={css:p[1],media:p[2],sourceMap:p[3],supports:p[4],layer:p[5]};if(-1!==d)e[d].references++,e[d].updater(f);else{var v=t(f,r);r.byIndex=l,e.splice(l,0,{identifier:u,updater:v,references:1})}i.push(u)}return i}function t(n,e){var o=e.domAPI(e);return o.update(n),function(e){if(e){if(e.css===n.css&&e.media===n.media&&e.sourceMap===n.sourceMap&&e.supports===n.supports&&e.layer===n.layer)return;o.update(n=e)}else o.remove()}}n.exports=function(n,t){var a=r(n=n||[],t=t||{});return function(n){n=n||[];for(var i=0;i<a.length;i++){var l=o(a[i]);e[l].references--}for(var p=r(n,t),c=0;c<a.length;c++){var s=o(a[c]);0===e[s].references&&(e[s].updater(),e.splice(s,1))}a=p}}},128:n=>{var e={};n.exports=function(n,o){var r=function(n){if(void 0===e[n]){var o=document.querySelector(n);if(window.HTMLIFrameElement&&o instanceof window.HTMLIFrameElement)try{o=o.contentDocument.head}catch(n){o=null}e[n]=o}return e[n]}(n);if(!r)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");r.appendChild(o)}},51:n=>{n.exports=function(n){var e=document.createElement("style");return n.setAttributes(e,n.attributes),n.insert(e,n.options),e}},855:(n,e,o)=>{n.exports=function(n){var e=o.nc;e&&n.setAttribute("nonce",e)}},740:n=>{n.exports=function(n){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var e=n.insertStyleElement(n);return{update:function(o){!function(n,e,o){var r="";o.supports&&(r+="@supports (".concat(o.supports,") {")),o.media&&(r+="@media ".concat(o.media," {"));var t=void 0!==o.layer;t&&(r+="@layer".concat(o.layer.length>0?" ".concat(o.layer):""," {")),r+=o.css,t&&(r+="}"),o.media&&(r+="}"),o.supports&&(r+="}");var a=o.sourceMap;a&&"undefined"!=typeof btoa&&(r+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(a))))," */")),e.styleTagTransform(r,n,e.options)}(e,n,o)},remove:function(){!function(n){if(null===n.parentNode)return!1;n.parentNode.removeChild(n)}(e)}}}},656:n=>{n.exports=function(n,e){if(e.styleSheet)e.styleSheet.cssText=n;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(n))}}},563:(n,e,o)=>{var r=o(591),t=o.n(r),a=o(740),i=o.n(a),l=o(128),p=o.n(l),c=o(855),s=o.n(c),u=o(51),d=o.n(u),f=o(656),v=o.n(f),m=o(78),h={};h.styleTagTransform=v(),h.setAttributes=s(),h.insert=p().bind(null,"head"),h.domAPI=i(),h.insertStyleElement=d(),t()(m.A,h),m.A&&m.A.locals&&m.A.locals}}]);
1
+ "use strict";(self.webpackChunk_jupyter_docprovider_extension=self.webpackChunk_jupyter_docprovider_extension||[]).push([[944],{78:(n,e,o)=>{o.d(e,{A:()=>s});var r=o(758),t=o.n(r),a=o(935),i=o.n(a),l=o(875),p=o(28),c=i()(t());c.i(l.A),c.i(p.A),c.push([n.id,"/* -----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|---------------------------------------------------------------------------- */\n\n.jp-shared-link-body {\n user-select: none;\n}\n",""]);const s=c},875:(n,e,o)=>{o.d(e,{A:()=>l});var r=o(758),t=o.n(r),a=o(935),i=o.n(a)()(t());i.push([n.id,"/* -----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|---------------------------------------------------------------------------- */\n\n.jp-MenuBar-label {\n margin-left: 25px;\n}\n\n.jp-MenuBar-anonymousIcon span {\n width: 24px;\n text-align: center;\n fill: var(--jp-ui-font-color1);\n color: var(--jp-ui-font-color1);\n}\n\n.jp-MenuBar-anonymousIcon,\n.jp-MenuBar-imageIcon {\n position: absolute;\n top: 1px;\n left: 8px;\n width: 24px;\n height: 24px;\n display: flex;\n align-items: center;\n vertical-align: middle;\n border-radius: 100%;\n}\n\n.jp-MenuBar-imageIcon img {\n width: 24px;\n border-radius: 100%;\n fill: var(--jp-ui-font-color1);\n color: var(--jp-ui-font-color1);\n}\n\n.jp-UserMenu-caretDownIcon {\n height: 22px;\n position: relative;\n top: 15%;\n}\n",""]);const l=i},28:(n,e,o)=>{o.d(e,{A:()=>l});var r=o(758),t=o.n(r),a=o(935),i=o.n(a)()(t());i.push([n.id,"/*\n * Copyright (c) Jupyter Development Team.\n * Distributed under the terms of the Modified BSD License.\n */\n\n/************************************************************\n Main Panel\n*************************************************************/\n\n.jp-RTCPanel {\n min-width: var(--jp-sidebar-min-width) !important;\n color: var(--jp-ui-font-color1);\n background: var(--jp-layout-color1);\n font-size: var(--jp-ui-font-size1);\n}\n\n/************************************************************\n User Info Panel\n*************************************************************/\n.jp-UserInfoPanel {\n display: flex;\n flex-direction: column;\n max-height: 140px;\n padding-top: 3px;\n}\n\n.jp-UserInfo-Container {\n margin: 20px;\n display: flex;\n flex-direction: column;\n align-items: center;\n}\n\n.jp-UserInfo-Icon {\n margin: auto;\n width: 50px;\n height: 50px;\n border-radius: 50px;\n display: inline-flex;\n align-items: center;\n}\n\n.jp-UserInfo-Icon span {\n margin: auto;\n text-align: center;\n font-size: 25px;\n fill: var(--jp-ui-font-color1);\n color: var(--jp-ui-font-color1);\n}\n\n.jp-UserInfo-Info {\n margin: 20px;\n display: inline-flex;\n flex-direction: column;\n}\n\n.jp-UserInfo-Info label {\n font-weight: bold;\n fill: var(--jp-ui-font-color1);\n color: var(--jp-ui-font-color1);\n}\n\n.jp-UserInfo-Info input {\n text-decoration: none;\n border-top: none;\n border-left: none;\n border-right: none;\n border-color: var(--jp-ui-font-color1);\n border-width: 0.5px;\n background-color: transparent;\n fill: var(--jp-ui-font-color1);\n color: var(--jp-ui-font-color1);\n}\n\n/************************************************************\n Collaborators Info Panel\n*************************************************************/\n\n.jp-CollaboratorsPanel {\n overflow-y: auto;\n}\n\n.jp-CollaboratorsList {\n flex-direction: column;\n display: flex;\n z-index: 1000;\n}\n\n.jp-CollaboratorHeader {\n padding: 10px;\n display: flex;\n align-items: center;\n font-size: var(--jp-ui-font-size0);\n fill: var(--jp-ui-font-color1);\n color: var(--jp-ui-font-color1);\n}\n\n.jp-CollaboratorHeader > span {\n padding-left: 7px;\n}\n\n.jp-ClickableCollaborator:hover {\n cursor: pointer;\n background-color: var(--jp-layout-color2);\n fill: var(--jp-ui-font-color0);\n color: var(--jp-ui-font-color0);\n}\n\n.jp-CollaboratorHeaderCollapser {\n transform: rotate(-90deg);\n margin: auto 0;\n height: 16px;\n}\n\n.jp-CollaboratorHeader:not(.jp-ClickableCollaborator) .jp-CollaboratorHeaderCollapser {\n visibility: hidden;\n}\n\n.jp-CollaboratorHeaderCollapser.jp-mod-expanded {\n transform: rotate(0deg);\n}\n\n.jp-CollaboratorIcon {\n border-radius: 100%;\n padding: 2px;\n width: 24px;\n height: 24px;\n display: flex;\n}\n\n.jp-CollaboratorIcon > span {\n text-align: center;\n margin: auto;\n font-size: 12px;\n fill: var(--jp-ui-font-color1);\n color: var(--jp-ui-font-color1);\n}\n\n.jp-CollaboratorFiles {\n padding-left: 1em;\n margin-top: 0;\n box-shadow: 0 2px 2px -2px rgb(0 0 0 / 24%);\n\n}\n",""]);const l=i},935:n=>{n.exports=function(n){var e=[];return e.toString=function(){return this.map((function(e){var o="",r=void 0!==e[5];return e[4]&&(o+="@supports (".concat(e[4],") {")),e[2]&&(o+="@media ".concat(e[2]," {")),r&&(o+="@layer".concat(e[5].length>0?" ".concat(e[5]):""," {")),o+=n(e),r&&(o+="}"),e[2]&&(o+="}"),e[4]&&(o+="}"),o})).join("")},e.i=function(n,o,r,t,a){"string"==typeof n&&(n=[[null,n,void 0]]);var i={};if(r)for(var l=0;l<this.length;l++){var p=this[l][0];null!=p&&(i[p]=!0)}for(var c=0;c<n.length;c++){var s=[].concat(n[c]);r&&i[s[0]]||(void 0!==a&&(void 0===s[5]||(s[1]="@layer".concat(s[5].length>0?" ".concat(s[5]):""," {").concat(s[1],"}")),s[5]=a),o&&(s[2]?(s[1]="@media ".concat(s[2]," {").concat(s[1],"}"),s[2]=o):s[2]=o),t&&(s[4]?(s[1]="@supports (".concat(s[4],") {").concat(s[1],"}"),s[4]=t):s[4]="".concat(t)),e.push(s))}},e}},758:n=>{n.exports=function(n){return n[1]}},591:n=>{var e=[];function o(n){for(var o=-1,r=0;r<e.length;r++)if(e[r].identifier===n){o=r;break}return o}function r(n,r){for(var a={},i=[],l=0;l<n.length;l++){var p=n[l],c=r.base?p[0]+r.base:p[0],s=a[c]||0,u="".concat(c," ").concat(s);a[c]=s+1;var d=o(u),f={css:p[1],media:p[2],sourceMap:p[3],supports:p[4],layer:p[5]};if(-1!==d)e[d].references++,e[d].updater(f);else{var v=t(f,r);r.byIndex=l,e.splice(l,0,{identifier:u,updater:v,references:1})}i.push(u)}return i}function t(n,e){var o=e.domAPI(e);return o.update(n),function(e){if(e){if(e.css===n.css&&e.media===n.media&&e.sourceMap===n.sourceMap&&e.supports===n.supports&&e.layer===n.layer)return;o.update(n=e)}else o.remove()}}n.exports=function(n,t){var a=r(n=n||[],t=t||{});return function(n){n=n||[];for(var i=0;i<a.length;i++){var l=o(a[i]);e[l].references--}for(var p=r(n,t),c=0;c<a.length;c++){var s=o(a[c]);0===e[s].references&&(e[s].updater(),e.splice(s,1))}a=p}}},128:n=>{var e={};n.exports=function(n,o){var r=function(n){if(void 0===e[n]){var o=document.querySelector(n);if(window.HTMLIFrameElement&&o instanceof window.HTMLIFrameElement)try{o=o.contentDocument.head}catch(n){o=null}e[n]=o}return e[n]}(n);if(!r)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");r.appendChild(o)}},51:n=>{n.exports=function(n){var e=document.createElement("style");return n.setAttributes(e,n.attributes),n.insert(e,n.options),e}},855:(n,e,o)=>{n.exports=function(n){var e=o.nc;e&&n.setAttribute("nonce",e)}},740:n=>{n.exports=function(n){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var e=n.insertStyleElement(n);return{update:function(o){!function(n,e,o){var r="";o.supports&&(r+="@supports (".concat(o.supports,") {")),o.media&&(r+="@media ".concat(o.media," {"));var t=void 0!==o.layer;t&&(r+="@layer".concat(o.layer.length>0?" ".concat(o.layer):""," {")),r+=o.css,t&&(r+="}"),o.media&&(r+="}"),o.supports&&(r+="}");var a=o.sourceMap;a&&"undefined"!=typeof btoa&&(r+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(a))))," */")),e.styleTagTransform(r,n,e.options)}(e,n,o)},remove:function(){!function(n){if(null===n.parentNode)return!1;n.parentNode.removeChild(n)}(e)}}}},656:n=>{n.exports=function(n,e){if(e.styleSheet)e.styleSheet.cssText=n;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(n))}}},944:(n,e,o)=>{var r=o(591),t=o.n(r),a=o(740),i=o.n(a),l=o(128),p=o.n(l),c=o(855),s=o.n(c),u=o(51),d=o.n(u),f=o(656),v=o.n(f),m=o(78),h={};h.styleTagTransform=v(),h.setAttributes=s(),h.insert=p().bind(null,"head"),h.domAPI=i(),h.insertStyleElement=d(),t()(m.A,h),m.A&&m.A.locals&&m.A.locals}}]);
@@ -0,0 +1 @@
1
+ var _JUPYTERLAB;(()=>{"use strict";var e,r,t,o,a,n,i,l,u,s,f,d,p,c,h,v,b,y,m,g,j,w,P,S={496:(e,r,t)=>{var o={"./index":()=>Promise.all([t.e(266),t.e(813),t.e(703)]).then((()=>()=>t(703))),"./extension":()=>Promise.all([t.e(266),t.e(813),t.e(703)]).then((()=>()=>t(703))),"./style":()=>t.e(944).then((()=>()=>t(944)))},a=(e,r)=>(t.R=r,r=t.o(o,e)?o[e]():Promise.resolve().then((()=>{throw new Error('Module "'+e+'" does not exist in container.')})),t.R=void 0,r),n=(e,r)=>{if(t.S){var o="default",a=t.S[o];if(a&&a!==e)throw new Error("Container initialization failed as it has already been initialized with a different share scope");return t.S[o]=e,t.I(o,r)}};t.d(r,{get:()=>a,init:()=>n})}},k={};function x(e){var r=k[e];if(void 0!==r)return r.exports;var t=k[e]={id:e,exports:{}};return S[e](t,t.exports,x),t.exports}x.m=S,x.c=k,x.n=e=>{var r=e&&e.__esModule?()=>e.default:()=>e;return x.d(r,{a:r}),r},x.d=(e,r)=>{for(var t in r)x.o(r,t)&&!x.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},x.f={},x.e=e=>Promise.all(Object.keys(x.f).reduce(((r,t)=>(x.f[t](e,r),r)),[])),x.u=e=>e+"."+{240:"5aa622ea121e34d22c41",444:"12adfae9a2b50e91531f",576:"21a3c1a9ebaebb58d346",703:"96968af03651921862ee",944:"b85c55dff0f14165f872"}[e]+".js?v="+{240:"5aa622ea121e34d22c41",444:"12adfae9a2b50e91531f",576:"21a3c1a9ebaebb58d346",703:"96968af03651921862ee",944:"b85c55dff0f14165f872"}[e],x.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),x.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),e={},r="@jupyter/docprovider-extension:",x.l=(t,o,a,n)=>{if(e[t])e[t].push(o);else{var i,l;if(void 0!==a)for(var u=document.getElementsByTagName("script"),s=0;s<u.length;s++){var f=u[s];if(f.getAttribute("src")==t||f.getAttribute("data-webpack")==r+a){i=f;break}}i||(l=!0,(i=document.createElement("script")).charset="utf-8",i.timeout=120,x.nc&&i.setAttribute("nonce",x.nc),i.setAttribute("data-webpack",r+a),i.src=t),e[t]=[o];var d=(r,o)=>{i.onerror=i.onload=null,clearTimeout(p);var a=e[t];if(delete e[t],i.parentNode&&i.parentNode.removeChild(i),a&&a.forEach((e=>e(o))),r)return r(o)},p=setTimeout(d.bind(null,void 0,{type:"timeout",target:i}),12e4);i.onerror=d.bind(null,i.onerror),i.onload=d.bind(null,i.onload),l&&document.head.appendChild(i)}},x.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{x.S={};var e={},r={};x.I=(t,o)=>{o||(o=[]);var a=r[t];if(a||(a=r[t]={}),!(o.indexOf(a)>=0)){if(o.push(a),e[t])return e[t];x.o(x.S,t)||(x.S[t]={});var n=x.S[t],i="@jupyter/docprovider-extension",l=(e,r,t,o)=>{var a=n[e]=n[e]||{},l=a[r];(!l||!l.loaded&&(!o!=!l.eager?o:i>l.from))&&(a[r]={get:t,from:i,eager:!!o})},u=[];return"default"===t&&(l("@jupyter/collaborative-drive","3.1.0-alpha.0",(()=>Promise.all([x.e(262),x.e(444)]).then((()=>()=>x(444))))),l("@jupyter/docprovider-extension","3.1.0-alpha.0",(()=>Promise.all([x.e(266),x.e(813),x.e(703)]).then((()=>()=>x(703))))),l("@jupyter/docprovider","3.1.0-alpha.0",(()=>Promise.all([x.e(266),x.e(262),x.e(240)]).then((()=>()=>x(240))))),l("y-websocket","1.5.4",(()=>Promise.all([x.e(576),x.e(206)]).then((()=>()=>x(576)))))),e[t]=u.length?Promise.all(u).then((()=>e[t]=1)):1}}})(),(()=>{var e;x.g.importScripts&&(e=x.g.location+"");var r=x.g.document;if(!e&&r&&(r.currentScript&&"SCRIPT"===r.currentScript.tagName.toUpperCase()&&(e=r.currentScript.src),!e)){var t=r.getElementsByTagName("script");if(t.length)for(var o=t.length-1;o>-1&&(!e||!/^http(s?):/.test(e));)e=t[o--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),x.p=e})(),t=e=>{var r=e=>e.split(".").map((e=>+e==e?+e:e)),t=/^([^-+]+)?(?:-([^+]+))?(?:\+(.+))?$/.exec(e),o=t[1]?r(t[1]):[];return t[2]&&(o.length++,o.push.apply(o,r(t[2]))),t[3]&&(o.push([]),o.push.apply(o,r(t[3]))),o},o=(e,r)=>{e=t(e),r=t(r);for(var o=0;;){if(o>=e.length)return o<r.length&&"u"!=(typeof r[o])[0];var a=e[o],n=(typeof a)[0];if(o>=r.length)return"u"==n;var i=r[o],l=(typeof i)[0];if(n!=l)return"o"==n&&"n"==l||"s"==l||"u"==n;if("o"!=n&&"u"!=n&&a!=i)return a<i;o++}},a=e=>{var r=e[0],t="";if(1===e.length)return"*";if(r+.5){t+=0==r?">=":-1==r?"<":1==r?"^":2==r?"~":r>0?"=":"!=";for(var o=1,n=1;n<e.length;n++)o--,t+="u"==(typeof(l=e[n]))[0]?"-":(o>0?".":"")+(o=2,l);return t}var i=[];for(n=1;n<e.length;n++){var l=e[n];i.push(0===l?"not("+u()+")":1===l?"("+u()+" || "+u()+")":2===l?i.pop()+" "+i.pop():a(l))}return u();function u(){return i.pop().replace(/^\((.+)\)$/,"$1")}},n=(e,r)=>{if(0 in e){r=t(r);var o=e[0],a=o<0;a&&(o=-o-1);for(var i=0,l=1,u=!0;;l++,i++){var s,f,d=l<e.length?(typeof e[l])[0]:"";if(i>=r.length||"o"==(f=(typeof(s=r[i]))[0]))return!u||("u"==d?l>o&&!a:""==d!=a);if("u"==f){if(!u||"u"!=d)return!1}else if(u)if(d==f)if(l<=o){if(s!=e[l])return!1}else{if(a?s>e[l]:s<e[l])return!1;s!=e[l]&&(u=!1)}else if("s"!=d&&"n"!=d){if(a||l<=o)return!1;u=!1,l--}else{if(l<=o||f<d!=a)return!1;u=!1}else"s"!=d&&"n"!=d&&(u=!1,l--)}}var p=[],c=p.pop.bind(p);for(i=1;i<e.length;i++){var h=e[i];p.push(1==h?c()|c():2==h?c()&c():h?n(h,r):!c())}return!!c()},i=(e,r)=>e&&x.o(e,r),l=e=>(e.loaded=1,e.get()),u=e=>Object.keys(e).reduce(((r,t)=>(e[t].eager&&(r[t]=e[t]),r)),{}),s=(e,r,t,a)=>{var i=a?u(e[r]):e[r];return(r=Object.keys(i).reduce(((e,r)=>!n(t,r)||e&&!o(e,r)?e:r),0))&&i[r]},f=(e,r,t)=>{var a=t?u(e[r]):e[r];return Object.keys(a).reduce(((e,r)=>!e||!a[e].loaded&&o(e,r)?r:e),0)},d=(e,r,t,o)=>"Unsatisfied version "+t+" from "+(t&&e[r][t].from)+" of shared singleton module "+r+" (required "+a(o)+")",p=(e,r,t,o,n)=>{var i=e[t];return"No satisfying version ("+a(o)+")"+(n?" for eager consumption":"")+" of shared module "+t+" found in shared scope "+r+".\nAvailable versions: "+Object.keys(i).map((e=>e+" from "+i[e].from)).join(", ")},c=e=>{throw new Error(e)},h=e=>{"undefined"!=typeof console&&console.warn&&console.warn(e)},b=(e,r,t)=>t?t():((e,r)=>c("Shared module "+r+" doesn't exist in shared scope "+e))(e,r),y=(v=e=>function(r,t,o,a,n){var i=x.I(r);return i&&i.then&&!o?i.then(e.bind(e,r,x.S[r],t,!1,a,n)):e(r,x.S[r],t,o,a,n)})(((e,r,t,o,a,n)=>{if(!i(r,t))return b(e,t,n);var u=s(r,t,a,o);return u?l(u):n?n():void c(p(r,e,t,a,o))})),m=v(((e,r,t,o,a,u)=>{if(!i(r,t))return b(e,t,u);var s=f(r,t,o);return n(a,s)||h(d(r,t,s,a)),l(r[t][s])})),g={},j={314:()=>m("default","@jupyterlab/coreutils",!1,[1,6,3,1]),501:()=>m("default","@jupyterlab/apputils",!1,[1,4,4,1]),877:()=>m("default","@jupyterlab/translation",!1,[1,4,3,1]),0:()=>m("default","@jupyter/ydoc",!1,[1,3,0,0,,"a3"]),256:()=>m("default","@lumino/widgets",!1,[1,2,3,1,,"alpha",0]),295:()=>m("default","@jupyterlab/notebook",!1,[1,4,3,1]),594:()=>m("default","@jupyterlab/filebrowser",!1,[1,4,3,1]),637:()=>m("default","@jupyterlab/fileeditor",!1,[1,4,3,1]),727:()=>m("default","@jupyter/collaborative-drive",!1,[1,3,1,0,,"alpha",0],(()=>Promise.all([x.e(262),x.e(444)]).then((()=>()=>x(444))))),782:()=>m("default","@jupyterlab/application",!1,[1,4,3,1]),791:()=>m("default","@jupyter/docprovider",!1,[1,3,1,0,,"alpha",0],(()=>Promise.all([x.e(262),x.e(240)]).then((()=>()=>x(240))))),937:()=>m("default","@jupyterlab/logconsole",!1,[1,4,3,1]),969:()=>m("default","@jupyterlab/statusbar",!1,[1,4,3,1]),981:()=>m("default","@jupyterlab/settingregistry",!1,[1,4,3,1]),262:()=>m("default","@lumino/coreutils",!1,[1,2,0,0]),33:()=>m("default","@jupyterlab/services",!1,[1,7,3,1]),345:()=>m("default","react",!1,[1,18,2,0]),560:()=>y("default","y-websocket",!1,[1,1,3,15],(()=>Promise.all([x.e(576),x.e(206)]).then((()=>()=>x(576))))),602:()=>m("default","@lumino/signaling",!1,[1,2,0,0]),963:()=>m("default","@jupyterlab/ui-components",!1,[1,4,3,1]),206:()=>m("default","yjs",!1,[1,13,5,40])},w={206:[206],240:[33,345,560,602,963],262:[262],266:[314,501,877],813:[0,256,295,594,637,727,782,791,937,969,981]},P={},x.f.consumes=(e,r)=>{x.o(w,e)&&w[e].forEach((e=>{if(x.o(g,e))return r.push(g[e]);if(!P[e]){var t=r=>{g[e]=0,x.m[e]=t=>{delete x.c[e],t.exports=r()}};P[e]=!0;var o=r=>{delete g[e],x.m[e]=t=>{throw delete x.c[e],r}};try{var a=j[e]();a.then?r.push(g[e]=a.then(t).catch(o)):t(a)}catch(e){o(e)}}}))},(()=>{var e={552:0};x.f.j=(r,t)=>{var o=x.o(e,r)?e[r]:void 0;if(0!==o)if(o)t.push(o[2]);else if(/^(2(06|62|66)|813)$/.test(r))e[r]=0;else{var a=new Promise(((t,a)=>o=e[r]=[t,a]));t.push(o[2]=a);var n=x.p+x.u(r),i=new Error;x.l(n,(t=>{if(x.o(e,r)&&(0!==(o=e[r])&&(e[r]=void 0),o)){var a=t&&("load"===t.type?"missing":t.type),n=t&&t.target&&t.target.src;i.message="Loading chunk "+r+" failed.\n("+a+": "+n+")",i.name="ChunkLoadError",i.type=a,i.request=n,o[1](i)}}),"chunk-"+r,r)}};var r=(r,t)=>{var o,a,[n,i,l]=t,u=0;if(n.some((r=>0!==e[r]))){for(o in i)x.o(i,o)&&(x.m[o]=i[o]);l&&l(x)}for(r&&r(t);u<n.length;u++)a=n[u],x.o(e,a)&&e[a]&&e[a][0](),e[a]=0},t=self.webpackChunk_jupyter_docprovider_extension=self.webpackChunk_jupyter_docprovider_extension||[];t.forEach(r.bind(null,0)),t.push=r.bind(null,t.push.bind(t))})(),x.nc=void 0;var E=x(496);(_JUPYTERLAB=void 0===_JUPYTERLAB?{}:_JUPYTERLAB)["@jupyter/docprovider-extension"]=E})();
@@ -2,19 +2,19 @@
2
2
  "packages": [
3
3
  {
4
4
  "name": "@jupyter/collaboration",
5
- "versionInfo": "3.0.1",
5
+ "versionInfo": "3.1.0-alpha.0",
6
6
  "licenseId": "BSD-3-Clause",
7
7
  "extractedText": ""
8
8
  },
9
9
  {
10
10
  "name": "@jupyter/collaborative-drive",
11
- "versionInfo": "3.0.1",
11
+ "versionInfo": "3.1.0-alpha.0",
12
12
  "licenseId": "BSD-3-Clause",
13
13
  "extractedText": ""
14
14
  },
15
15
  {
16
16
  "name": "@jupyter/docprovider",
17
- "versionInfo": "3.0.1",
17
+ "versionInfo": "3.1.0-alpha.0",
18
18
  "licenseId": "BSD-3-Clause",
19
19
  "extractedText": ""
20
20
  },
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jupyter/docprovider",
3
- "version": "3.0.1",
3
+ "version": "3.1.0-alpha.0",
4
4
  "description": "JupyterLab - Document Provider",
5
5
  "homepage": "https://github.com/jupyterlab/jupyter-collaboration",
6
6
  "bugs": {
@@ -41,7 +41,7 @@
41
41
  "watch": "tsc -b --watch"
42
42
  },
43
43
  "dependencies": {
44
- "@jupyter/collaborative-drive": "^3.0.1",
44
+ "@jupyter/collaborative-drive": "^3.1.0-alpha.0",
45
45
  "@jupyter/ydoc": "^2.0.0 || ^3.0.0",
46
46
  "@jupyterlab/apputils": "^4.2.0",
47
47
  "@jupyterlab/cells": "^4.2.0",
@@ -0,0 +1,96 @@
1
+ // Copyright (c) Jupyter Development Team.
2
+ // Distributed under the terms of the Modified BSD License.
3
+
4
+ import { ICollaborativeDrive } from '@jupyter/collaborative-drive';
5
+ import {
6
+ ForkManager,
7
+ JUPYTER_COLLABORATION_FORK_EVENTS_URI
8
+ } from '../forkManager';
9
+ import { Event } from '@jupyterlab/services';
10
+ import { Signal } from '@lumino/signaling';
11
+ import { requestAPI } from '../requests';
12
+ jest.mock('../requests');
13
+
14
+ const driveMock = {
15
+ name: 'rtc',
16
+ providers: new Map()
17
+ } as ICollaborativeDrive;
18
+ const stream = new Signal({});
19
+ const eventManagerMock = {
20
+ stream: stream as any
21
+ } as Event.IManager;
22
+
23
+ describe('@jupyter/docprovider', () => {
24
+ let manager: ForkManager;
25
+ beforeEach(() => {
26
+ manager = new ForkManager({
27
+ drive: driveMock,
28
+ eventManager: eventManagerMock
29
+ });
30
+ });
31
+ describe('forkManager', () => {
32
+ it('should have a type', () => {
33
+ expect(ForkManager).not.toBeUndefined();
34
+ });
35
+ it('should be able to create instance', () => {
36
+ expect(manager).toBeInstanceOf(ForkManager);
37
+ });
38
+ it('should be able to create new fork', async () => {
39
+ await manager.createFork({
40
+ rootId: 'root-uuid',
41
+ synchronize: true,
42
+ title: 'my fork label',
43
+ description: 'my fork description'
44
+ });
45
+ expect(requestAPI).toHaveBeenCalledWith(
46
+ 'api/collaboration/fork/root-uuid',
47
+ {
48
+ method: 'PUT',
49
+ body: JSON.stringify({
50
+ title: 'my fork label',
51
+ description: 'my fork description',
52
+ synchronize: true
53
+ })
54
+ }
55
+ );
56
+ });
57
+ it('should be able to get all forks', async () => {
58
+ await manager.getAllForks('root-uuid');
59
+ expect(requestAPI).toHaveBeenCalledWith(
60
+ 'api/collaboration/fork/root-uuid',
61
+ {
62
+ method: 'GET'
63
+ }
64
+ );
65
+ });
66
+ it('should be able to get delete forks', async () => {
67
+ await manager.deleteFork({ forkId: 'fork-uuid', merge: true });
68
+ expect(requestAPI).toHaveBeenCalledWith(
69
+ 'api/collaboration/fork/fork-uuid?merge=true',
70
+ {
71
+ method: 'DELETE'
72
+ }
73
+ );
74
+ });
75
+ it('should be able to emit fork added signal', async () => {
76
+ const listener = jest.fn();
77
+ manager.forkAdded.connect(listener);
78
+ const data = {
79
+ schema_id: JUPYTER_COLLABORATION_FORK_EVENTS_URI,
80
+ action: 'create'
81
+ };
82
+ stream.emit(data);
83
+ expect(listener).toHaveBeenCalledWith(manager, data);
84
+ });
85
+ it('should be able to emit fork deleted signal', async () => {
86
+ const listener = jest.fn();
87
+ manager.forkDeleted.connect(listener);
88
+ const data = {
89
+ schema_id: JUPYTER_COLLABORATION_FORK_EVENTS_URI,
90
+ action: 'delete'
91
+ };
92
+ stream.emit(data);
93
+ expect(listener).toHaveBeenCalledWith(manager, data);
94
+ });
95
+ });
96
+ });
@@ -76,7 +76,6 @@ export const TimelineSliderComponent: React.FC<Props> = ({
76
76
  setData(data);
77
77
  setCurrentTimestampIndex(data.timestamps.length - 1);
78
78
  provider.connectToForkDoc(data.forkRoom, data.sessionId);
79
-
80
79
  sessionRef.current = await requestDocSession(
81
80
  format,
82
81
  contentType,
@@ -0,0 +1,126 @@
1
+ /*
2
+ * Copyright (c) Jupyter Development Team.
3
+ * Distributed under the terms of the Modified BSD License.
4
+ */
5
+
6
+ import { ICollaborativeDrive } from '@jupyter/collaborative-drive';
7
+ import { URLExt } from '@jupyterlab/coreutils';
8
+ import { Event } from '@jupyterlab/services';
9
+ import { ISignal, Signal } from '@lumino/signaling';
10
+
11
+ import { requestAPI, ROOM_FORK_URL } from './requests';
12
+ import {
13
+ IAllForksResponse,
14
+ IForkChangedEvent,
15
+ IForkCreationResponse,
16
+ IForkManager
17
+ } from './tokens';
18
+ import { IForkProvider } from './ydrive';
19
+
20
+ export const JUPYTER_COLLABORATION_FORK_EVENTS_URI =
21
+ 'https://schema.jupyter.org/jupyter_collaboration/fork/v1';
22
+
23
+ export class ForkManager implements IForkManager {
24
+ constructor(options: ForkManager.IOptions) {
25
+ const { drive, eventManager } = options;
26
+ this._drive = drive;
27
+ this._eventManager = eventManager;
28
+ this._eventManager.stream.connect(this._handleEvent, this);
29
+ }
30
+
31
+ get isDisposed(): boolean {
32
+ return this._disposed;
33
+ }
34
+ get forkAdded(): ISignal<ForkManager, IForkChangedEvent> {
35
+ return this._forkAddedSignal;
36
+ }
37
+ get forkDeleted(): ISignal<ForkManager, IForkChangedEvent> {
38
+ return this._forkDeletedSignal;
39
+ }
40
+
41
+ dispose(): void {
42
+ if (this._disposed) {
43
+ return;
44
+ }
45
+ this._eventManager?.stream.disconnect(this._handleEvent);
46
+ this._disposed = true;
47
+ }
48
+ async createFork(options: {
49
+ rootId: string;
50
+ synchronize: boolean;
51
+ title?: string;
52
+ description?: string;
53
+ }): Promise<IForkCreationResponse | undefined> {
54
+ const { rootId, title, description, synchronize } = options;
55
+ const init: RequestInit = {
56
+ method: 'PUT',
57
+ body: JSON.stringify({ title, description, synchronize })
58
+ };
59
+ const url = URLExt.join(ROOM_FORK_URL, rootId);
60
+ const response = await requestAPI<IForkCreationResponse>(url, init);
61
+ return response;
62
+ }
63
+
64
+ async getAllForks(rootId: string) {
65
+ const url = URLExt.join(ROOM_FORK_URL, rootId);
66
+ const init = { method: 'GET' };
67
+ const response = await requestAPI<IAllForksResponse>(url, init);
68
+ return response;
69
+ }
70
+
71
+ async deleteFork(options: { forkId: string; merge: boolean }): Promise<void> {
72
+ const { forkId, merge } = options;
73
+ const url = URLExt.join(ROOM_FORK_URL, forkId);
74
+ const query = URLExt.objectToQueryString({ merge });
75
+ const init = { method: 'DELETE' };
76
+ await requestAPI(`${url}${query}`, init);
77
+ }
78
+ getProvider(options: {
79
+ documentPath: string;
80
+ format: string;
81
+ type: string;
82
+ }): IForkProvider | undefined {
83
+ const { documentPath, format, type } = options;
84
+ const drive = this._drive;
85
+ if (drive) {
86
+ const driveName = drive.name;
87
+ let docPath = documentPath;
88
+ if (documentPath.startsWith(driveName)) {
89
+ docPath = documentPath.slice(driveName.length + 1);
90
+ }
91
+ const provider = drive.providers.get(`${format}:${type}:${docPath}`);
92
+ return provider as IForkProvider | undefined;
93
+ }
94
+ return;
95
+ }
96
+
97
+ private _handleEvent(_: Event.IManager, emission: Event.Emission) {
98
+ if (emission.schema_id === JUPYTER_COLLABORATION_FORK_EVENTS_URI) {
99
+ switch (emission.action) {
100
+ case 'create': {
101
+ this._forkAddedSignal.emit(emission as any);
102
+ break;
103
+ }
104
+ case 'delete': {
105
+ this._forkDeletedSignal.emit(emission as any);
106
+ break;
107
+ }
108
+ default:
109
+ break;
110
+ }
111
+ }
112
+ }
113
+
114
+ private _disposed = false;
115
+ private _drive: ICollaborativeDrive | undefined;
116
+ private _eventManager: Event.IManager | undefined;
117
+ private _forkAddedSignal = new Signal<ForkManager, IForkChangedEvent>(this);
118
+ private _forkDeletedSignal = new Signal<ForkManager, IForkChangedEvent>(this);
119
+ }
120
+
121
+ export namespace ForkManager {
122
+ export interface IOptions {
123
+ drive: ICollaborativeDrive;
124
+ eventManager: Event.IManager;
125
+ }
126
+ }
@@ -13,3 +13,5 @@ export * from './requests';
13
13
  export * from './ydrive';
14
14
  export * from './yprovider';
15
15
  export * from './TimelineSlider';
16
+ export * from './tokens';
17
+ export * from './forkManager';
@@ -14,6 +14,8 @@ const DOC_SESSION_URL = 'api/collaboration/session';
14
14
  const DOC_FORK_URL = 'api/collaboration/undo_redo';
15
15
  const TIMELINE_URL = 'api/collaboration/timeline';
16
16
 
17
+ export const ROOM_FORK_URL = 'api/collaboration/fork';
18
+
17
19
  /**
18
20
  * Document session model
19
21
  */
@@ -36,6 +38,45 @@ export interface ISessionModel {
36
38
  sessionId: string;
37
39
  }
38
40
 
41
+ /**
42
+ * Call the API extension
43
+ *
44
+ * @param endPoint API REST end point for the extension
45
+ * @param init Initial values for the request
46
+ * @returns The response body interpreted as JSON
47
+ */
48
+ export async function requestAPI<T = any>(
49
+ endPoint = '',
50
+ init: RequestInit = {}
51
+ ): Promise<T> {
52
+ // Make request to Jupyter API
53
+ const settings = ServerConnection.makeSettings();
54
+ const requestUrl = URLExt.join(settings.baseUrl, endPoint);
55
+
56
+ let response: Response;
57
+ try {
58
+ response = await ServerConnection.makeRequest(requestUrl, init, settings);
59
+ } catch (error) {
60
+ throw new ServerConnection.NetworkError(error as any);
61
+ }
62
+
63
+ let data: any = await response.text();
64
+
65
+ if (data.length > 0) {
66
+ try {
67
+ data = JSON.parse(data);
68
+ } catch (error) {
69
+ console.error('Not a JSON response body.', response);
70
+ }
71
+ }
72
+
73
+ if (!response.ok) {
74
+ throw new ServerConnection.ResponseError(response, data.message || data);
75
+ }
76
+
77
+ return data;
78
+ }
79
+
39
80
  export async function requestDocSession(
40
81
  format: string,
41
82
  type: string,
@@ -0,0 +1,117 @@
1
+ /*
2
+ * Copyright (c) Jupyter Development Team.
3
+ * Distributed under the terms of the Modified BSD License.
4
+ */
5
+
6
+ import { Token } from '@lumino/coreutils';
7
+ import { IDisposable } from '@lumino/disposable';
8
+ import { ISignal } from '@lumino/signaling';
9
+ import { IForkProvider } from './ydrive';
10
+ export interface IForkInfo {
11
+ description?: string;
12
+ root_roomid: string;
13
+ synchronize: boolean;
14
+ title?: string;
15
+ }
16
+
17
+ export interface IForkCreationResponse {
18
+ fork_info: IForkInfo;
19
+ fork_roomid: string;
20
+ sessionId: string;
21
+ }
22
+
23
+ export interface IAllForksResponse {
24
+ [forkId: string]: IForkInfo;
25
+ }
26
+
27
+ export interface IForkChangedEvent {
28
+ fork_info: IForkInfo;
29
+ fork_roomid: string;
30
+ username?: string;
31
+ }
32
+
33
+ /**
34
+ * Interface representing a Fork Manager that manages forked documents and
35
+ * provides signals for fork-related events.
36
+ *
37
+ * @interface IForkManager
38
+ * @extends IDisposable
39
+ */
40
+ export interface IForkManager extends IDisposable {
41
+ /**
42
+ * Get the fork provider of a given document.
43
+ *
44
+ * @param options.documentPath - The document path including the
45
+ * drive prefix.
46
+ * @param options.format - Format of the document.
47
+ * @param options.type - Content type of the document.
48
+ * @returns The fork provider of the document.
49
+ */
50
+ getProvider(options: {
51
+ documentPath: string;
52
+ format: string;
53
+ type: string;
54
+ }): IForkProvider | undefined;
55
+
56
+ /**
57
+ * Creates a new fork for a given document.
58
+ *
59
+ * @param options.rootId - The ID of the root document to fork.
60
+ * @param options.synchronize - A flag indicating whether the fork should be kept
61
+ * synchronized with the root document.
62
+ * @param options.title - An optional label for the fork.
63
+ * @param options.description - An optional description for the fork.
64
+ *
65
+ * @returns A promise that resolves to an `IForkCreationResponse` if the fork
66
+ * is created successfully, or `undefined` if the creation fails.
67
+ */
68
+ createFork(options: {
69
+ rootId: string;
70
+ synchronize: boolean;
71
+ title?: string;
72
+ description?: string;
73
+ }): Promise<IForkCreationResponse | undefined>;
74
+
75
+ /**
76
+ * Retrieves all forks associated with a specific document.
77
+ *
78
+ * @param documentId - The ID of the document for which forks are to be retrieved.
79
+ *
80
+ * @returns A promise that resolves to an `IAllForksResponse` containing information about all forks.
81
+ */
82
+ getAllForks(documentId: string): Promise<IAllForksResponse>;
83
+
84
+ /**
85
+ * Deletes a specified fork and optionally merges its changes.
86
+ *
87
+ * @param options - Options for deleting the fork.
88
+ * @param options.forkId - The ID of the fork to be deleted.
89
+ * @param options.merge - A flag indicating whether changes from the fork should be merged back into the root document.
90
+ *
91
+ * @returns A promise that resolves when the fork is successfully deleted.
92
+ */
93
+ deleteFork(options: { forkId: string; merge: boolean }): Promise<void>;
94
+
95
+ /**
96
+ * Signal emitted when a new fork is added.
97
+ *
98
+ * @event forkAdded
99
+ * @type ISignal<IForkManager, IForkChangedEvent>
100
+ */
101
+ forkAdded: ISignal<IForkManager, IForkChangedEvent>;
102
+
103
+ /**
104
+ * Signal emitted when a fork is deleted.
105
+ *
106
+ * @event forkDeleted
107
+ * @type ISignal<IForkManager, IForkChangedEvent>
108
+ */
109
+ forkDeleted: ISignal<IForkManager, IForkChangedEvent>;
110
+ }
111
+
112
+ /**
113
+ * Token providing a fork manager instance.
114
+ */
115
+ export const IForkManagerToken = new Token<IForkManager>(
116
+ '@jupyter/docprovider:IForkManagerToken'
117
+ );
@@ -308,7 +308,6 @@ class SharedModelFactory implements ISharedModelFactory {
308
308
  // the `sharedModel` will be the default one.
309
309
  return;
310
310
  }
311
-
312
311
  if (this.documentFactories.has(options.contentType)) {
313
312
  const factory = this.documentFactories.get(options.contentType)!;
314
313
  const sharedModel = factory(options);
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jupyter/docprovider-extension",
3
- "version": "3.0.1",
3
+ "version": "3.1.0-alpha.0",
4
4
  "description": "JupyterLab - Collaborative Shared Models",
5
5
  "keywords": [
6
6
  "jupyter",
@@ -53,8 +53,8 @@
53
53
  "watch:labextension": "jupyter labextension watch ."
54
54
  },
55
55
  "dependencies": {
56
- "@jupyter/collaborative-drive": "^3.0.1",
57
- "@jupyter/docprovider": "^3.0.1",
56
+ "@jupyter/collaborative-drive": "^3.1.0-alpha.0",
57
+ "@jupyter/docprovider": "^3.1.0-alpha.0",
58
58
  "@jupyter/ydoc": "^2.0.0 || ^3.0.0",
59
59
  "@jupyterlab/application": "^4.2.0",
60
60
  "@jupyterlab/apputils": "^4.2.0",
@@ -0,0 +1,28 @@
1
+ /*
2
+ * Copyright (c) Jupyter Development Team.
3
+ * Distributed under the terms of the Modified BSD License.
4
+ */
5
+
6
+ import { ICollaborativeDrive } from '@jupyter/collaborative-drive';
7
+ import {
8
+ ForkManager,
9
+ IForkManager,
10
+ IForkManagerToken
11
+ } from '@jupyter/docprovider';
12
+
13
+ import {
14
+ JupyterFrontEnd,
15
+ JupyterFrontEndPlugin
16
+ } from '@jupyterlab/application';
17
+
18
+ export const forkManagerPlugin: JupyterFrontEndPlugin<IForkManager> = {
19
+ id: '@jupyter/docprovider-extension:forkManager',
20
+ autoStart: true,
21
+ requires: [ICollaborativeDrive],
22
+ provides: IForkManagerToken,
23
+ activate: (app: JupyterFrontEnd, drive: ICollaborativeDrive) => {
24
+ const eventManager = app.serviceManager.events;
25
+ const manager = new ForkManager({ drive, eventManager });
26
+ return manager;
27
+ }
28
+ };
@@ -16,6 +16,7 @@ import {
16
16
  statusBarTimeline
17
17
  } from './filebrowser';
18
18
  import { notebookCellExecutor } from './executor';
19
+ import { forkManagerPlugin } from './forkManager';
19
20
 
20
21
  /**
21
22
  * Export the plugins as default.
@@ -27,7 +28,8 @@ const plugins: JupyterFrontEndPlugin<any>[] = [
27
28
  defaultFileBrowser,
28
29
  logger,
29
30
  notebookCellExecutor,
30
- statusBarTimeline
31
+ statusBarTimeline,
32
+ forkManagerPlugin
31
33
  ];
32
34
 
33
35
  export default plugins;
@@ -1 +0,0 @@
1
- __version__ = "1.0.1"
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunk_jupyter_docprovider_extension=self.webpackChunk_jupyter_docprovider_extension||[]).push([[618],{68:(e,t,n)=>{n.d(t,{A:()=>a});var o=n(758),r=n.n(o),s=n(935),i=n.n(s)()(r());i.push([e.id,"/* -----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|---------------------------------------------------------------------------- */\n\n.jp-timelineSliderWrapper .jp-sliderContainer{\n display: flex;\n align-items: center;\n}\n\n.jp-Slider {\n height: 4.5px\n}\n\n#jp-slider-status-bar {\n display: flex;\n}\n\n.jp-timestampDisplay {\n display: flex;\n flex-direction: row;\n align-items: center;\n gap: 6px;\n}\n\n.jp-restoreBtnContainer {\n width: 192px;\n}\n\n.jp-ToolbarButtonComponent.jp-restoreBtn {\n cursor: pointer;\n color: var(--jp-layout-color2);\n width: 100%;\n background: var(--jp-accept-color-normal)\n}\n",""]);const a=i},935:e=>{e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n="",o=void 0!==t[5];return t[4]&&(n+="@supports (".concat(t[4],") {")),t[2]&&(n+="@media ".concat(t[2]," {")),o&&(n+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),n+=e(t),o&&(n+="}"),t[2]&&(n+="}"),t[4]&&(n+="}"),n})).join("")},t.i=function(e,n,o,r,s){"string"==typeof e&&(e=[[null,e,void 0]]);var i={};if(o)for(var a=0;a<this.length;a++){var c=this[a][0];null!=c&&(i[c]=!0)}for(var l=0;l<e.length;l++){var d=[].concat(e[l]);o&&i[d[0]]||(void 0!==s&&(void 0===d[5]||(d[1]="@layer".concat(d[5].length>0?" ".concat(d[5]):""," {").concat(d[1],"}")),d[5]=s),n&&(d[2]?(d[1]="@media ".concat(d[2]," {").concat(d[1],"}"),d[2]=n):d[2]=n),r&&(d[4]?(d[1]="@supports (".concat(d[4],") {").concat(d[1],"}"),d[4]=r):d[4]="".concat(r)),t.push(d))}},t}},758:e=>{e.exports=function(e){return e[1]}},591:e=>{var t=[];function n(e){for(var n=-1,o=0;o<t.length;o++)if(t[o].identifier===e){n=o;break}return n}function o(e,o){for(var s={},i=[],a=0;a<e.length;a++){var c=e[a],l=o.base?c[0]+o.base:c[0],d=s[l]||0,u="".concat(l," ").concat(d);s[l]=d+1;var h=n(u),p={css:c[1],media:c[2],sourceMap:c[3],supports:c[4],layer:c[5]};if(-1!==h)t[h].references++,t[h].updater(p);else{var m=r(p,o);o.byIndex=a,t.splice(a,0,{identifier:u,updater:m,references:1})}i.push(u)}return i}function r(e,t){var n=t.domAPI(t);return n.update(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap&&t.supports===e.supports&&t.layer===e.layer)return;n.update(e=t)}else n.remove()}}e.exports=function(e,r){var s=o(e=e||[],r=r||{});return function(e){e=e||[];for(var i=0;i<s.length;i++){var a=n(s[i]);t[a].references--}for(var c=o(e,r),l=0;l<s.length;l++){var d=n(s[l]);0===t[d].references&&(t[d].updater(),t.splice(d,1))}s=c}}},128:e=>{var t={};e.exports=function(e,n){var o=function(e){if(void 0===t[e]){var n=document.querySelector(e);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}t[e]=n}return t[e]}(e);if(!o)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");o.appendChild(n)}},51:e=>{e.exports=function(e){var t=document.createElement("style");return e.setAttributes(t,e.attributes),e.insert(t,e.options),t}},855:(e,t,n)=>{e.exports=function(e){var t=n.nc;t&&e.setAttribute("nonce",t)}},740:e=>{e.exports=function(e){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var t=e.insertStyleElement(e);return{update:function(n){!function(e,t,n){var o="";n.supports&&(o+="@supports (".concat(n.supports,") {")),n.media&&(o+="@media ".concat(n.media," {"));var r=void 0!==n.layer;r&&(o+="@layer".concat(n.layer.length>0?" ".concat(n.layer):""," {")),o+=n.css,r&&(o+="}"),n.media&&(o+="}"),n.supports&&(o+="}");var s=n.sourceMap;s&&"undefined"!=typeof btoa&&(o+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(s))))," */")),t.styleTagTransform(o,e,t.options)}(t,e,n)},remove:function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(t)}}}},656:e=>{e.exports=function(e,t){if(t.styleSheet)t.styleSheet.cssText=e;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(e))}}},618:(e,t,n)=>{n.r(t),n.d(t,{NotebookCellServerExecutor:()=>l,TimelineWidget:()=>A,WebSocketAwarenessProvider:()=>r,WebSocketProvider:()=>g,YDrive:()=>w,requestDocSession:()=>p,requestDocumentTimeline:()=>m,requestUndoRedo:()=>f});var o=n(560);class r extends o.WebsocketProvider{constructor(e){super(e.url,e.roomID,e.awareness.doc,{awareness:e.awareness}),this._isDisposed=!1,this._awareness=e.awareness,this._user=e.user,this._user.ready.then((()=>this._onUserChanged(this._user))).catch((e=>console.error(e))),this._user.userChanged.connect(this._onUserChanged,this)}get isDisposed(){return this._isDisposed}dispose(){this._isDisposed||(this._user.userChanged.disconnect(this._onUserChanged,this),this._isDisposed=!0,this.destroy())}_onUserChanged(e){this._awareness.setLocalStateField("user",e.identity)}}var s=n(501),i=n(314),a=n(33),c=n(877);class l{constructor(e){var t;this._serverSettings=null!==(t=e.serverSettings)&&void 0!==t?t:a.ServerConnection.makeSettings()}async runCell({cell:e,notebook:t,notebookConfig:n,onCellExecuted:o,onCellExecutionScheduled:r,sessionContext:l,sessionDialogs:d,translator:u}){var h,p,m;const f=(u=null!=u?u:c.nullTranslator).load("jupyterlab");switch(e.model.type){case"markdown":e.rendered=!0,e.inputHidden=!1,o({cell:e,success:!0});break;case"code":if(l){if(l.isTerminating){await(0,s.showDialog)({title:f.__("Kernel Terminating"),body:f.__("The kernel for %1 appears to be terminating. You can not run any cell for now.",null===(h=l.session)||void 0===h?void 0:h.path),buttons:[s.Dialog.okButton()]});break}if(l.pendingInput)return await(0,s.showDialog)({title:f.__("Cell not executed due to pending input"),body:f.__("The cell has not been executed to avoid kernel deadlock as there is another pending input! Submit your pending input and try again."),buttons:[s.Dialog.okButton()]}),!1;if(l.hasNoKernel&&await l.startKernel()&&d&&await d.selectKernel(l),l.hasNoKernel)return e.model.sharedModel.transact((()=>{e.model.clearExecution()})),!0;const n=null===(m=null===(p=null==l?void 0:l.session)||void 0===p?void 0:p.kernel)||void 0===m?void 0:m.id,c=i.URLExt.join(this._serverSettings.baseUrl,`api/kernels/${n}/execute`),u=e.model.sharedModel.getId(),v=t.sharedModel.getState("document_id"),y={method:"POST",body:JSON.stringify({cell_id:u,document_id:v})};r({cell:e});let g=!1;try{g=(await a.ServerConnection.makeRequest(c,y,this._serverSettings)).ok}catch(t){if(o({cell:e,success:!1}),e.isDisposed)return!1;throw t}return o({cell:e,success:g}),!0}e.model.sharedModel.transact((()=>{e.model.clearExecution()}),!1)}return Promise.resolve(!0)}}const d="api/collaboration/session",u="api/collaboration/undo_redo",h="api/collaboration/timeline";async function p(e,t,n){const o=a.ServerConnection.makeSettings(),r=i.URLExt.join(o.baseUrl,d,encodeURIComponent(n)),s={method:"PUT",body:JSON.stringify({format:e,type:t})};let c;try{c=await a.ServerConnection.makeRequest(r,s,o)}catch(e){throw new a.ServerConnection.NetworkError(e)}let l=await c.text();if(l.length>0)try{l=JSON.parse(l)}catch(e){console.log("Not a JSON response body.",c)}if(!c.ok)throw new a.ServerConnection.ResponseError(c,l.message||l);return l}async function m(e,t,n){const o=a.ServerConnection.makeSettings();let r=i.URLExt.join(o.baseUrl,h,n);r=r.concat(`?format=${e}&&type=${t}`);const s={method:"GET"};let c;try{c=await a.ServerConnection.makeRequest(r,s,o)}catch(e){throw new a.ServerConnection.NetworkError(e)}return c}async function f(e,t,n,o){const r=a.ServerConnection.makeSettings();let s=i.URLExt.join(r.baseUrl,u,encodeURIComponent(e));s=s.concat(`?action=${t}&&steps=${n}&&forkRoom=${o}`);const c={method:"PUT"};let l;try{l=await a.ServerConnection.makeRequest(s,c,r)}catch(e){throw new a.ServerConnection.NetworkError(e)}let d=await l.text();if(d.length>0)try{d=JSON.parse(d)}catch(e){console.log("Not a JSON response body.",l)}if(!l.ok)throw new a.ServerConnection.ResponseError(l,d.message||d);return d}var v=n(602),y=n(262);class g{constructor(e){this._onConnectionClosed=e=>{1003===e.code&&(console.error("Document provider closed:",e.reason),(0,s.showErrorMessage)(this._trans.__("Document session error"),e.reason,[s.Dialog.okButton()]),this._sharedModel.dispose())},this._onSync=e=>{e&&(this._yWebsocketProvider&&(this._yWebsocketProvider.off("sync",this._onSync),this._sharedModel.ydoc.getMap("state").set("document_id",this._yWebsocketProvider.roomname)),this._ready.resolve())},this._ready=new y.PromiseDelegate,this._isDisposed=!1,this._path=e.path,this._contentType=e.contentType,this._format=e.format,this._serverUrl=e.url,this._sharedModel=e.model,this._awareness=e.model.awareness,this._yWebsocketProvider=null,this._trans=e.translator;const t=e.user;t.ready.then((()=>{this._onUserChanged(t)})).catch((e=>console.error(e))),t.userChanged.connect(this._onUserChanged,this),this._connect().catch((e=>console.warn(e)))}get isDisposed(){return this._isDisposed}get ready(){return this._ready.promise}get contentType(){return this._contentType}get format(){return this._format}dispose(){var e,t,n;this.isDisposed||(this._isDisposed=!0,null===(e=this._yWebsocketProvider)||void 0===e||e.off("connection-close",this._onConnectionClosed),null===(t=this._yWebsocketProvider)||void 0===t||t.off("sync",this._onSync),null===(n=this._yWebsocketProvider)||void 0===n||n.destroy(),this._disconnect(),v.Signal.clearData(this))}async reconnect(){this._disconnect(),this._connect()}async _connect(){const e=await p(this._format,this._contentType,this._path);this._yWebsocketProvider=new o.WebsocketProvider(this._serverUrl,`${e.format}:${e.type}:${e.fileId}`,this._sharedModel.ydoc,{disableBc:!0,params:{sessionId:e.sessionId},awareness:this._awareness}),this._yWebsocketProvider.on("sync",this._onSync),this._yWebsocketProvider.on("connection-close",this._onConnectionClosed)}async connectToForkDoc(e,t){this._disconnect(),this._yWebsocketProvider=new o.WebsocketProvider(this._serverUrl,e,this._sharedModel.ydoc,{disableBc:!0,params:{sessionId:t},awareness:this._awareness})}get wsProvider(){return this._yWebsocketProvider}_disconnect(){var e,t,n;null===(e=this._yWebsocketProvider)||void 0===e||e.off("connection-close",this._onConnectionClosed),null===(t=this._yWebsocketProvider)||void 0===t||t.off("sync",this._onSync),null===(n=this._yWebsocketProvider)||void 0===n||n.destroy(),this._yWebsocketProvider=null}_onUserChanged(e){this._awareness.setLocalStateField("user",e.identity)}}const _="true"===i.PageConfig.getOption("disableRTC");class w extends a.Drive{constructor(e,t,n){super({name:"RTC"}),this._onCreate=(e,t)=>{var n,o;if("string"==typeof e.format)try{const r=new g({url:i.URLExt.join(this.serverSettings.wsUrl,"api/collaboration/room"),path:e.path,format:e.format,contentType:e.contentType,model:t,user:this._user,translator:this._trans}),s=((null===(n=this._globalAwareness)||void 0===n?void 0:n.getLocalState())||{}).documents||[];s.includes(e.path)||(s.push(`${this.name}:${e.path}`),null===(o=this._globalAwareness)||void 0===o||o.setLocalStateField("documents",s));const a=`${e.format}:${e.contentType}:${e.path}`;this._providers.set(a,r),t.changed.connect((async(t,n)=>{if(!n.stateChange)return;const o=n.stateChange.filter((e=>"hash"===e.name));if(0===o.length)return;o.length>1&&console.error("Unexpected multiple changes to hash value in a single transaction");const r=o[0],s=await this.get(e.path,{content:!1});this._ydriveFileChanged.emit({type:"save",newValue:{...s,hash:r.newValue},oldValue:{hash:r.oldValue}})})),t.disposed.connect((()=>{var t,n;const o=this._providers.get(a);o&&(o.dispose(),this._providers.delete(a));const r=((null===(t=this._globalAwareness)||void 0===t?void 0:t.getLocalState())||{}).documents||[],s=r.indexOf(`${this.name}:${e.path}`);s>-1&&r.splice(s,1),null===(n=this._globalAwareness)||void 0===n||n.setLocalStateField("documents",r)}))}catch(t){console.error(`Failed to open websocket connection for ${e.path}.\n:${t}`)}},this._ydriveFileChanged=new v.Signal(this),this._user=e,this._trans=t,this._globalAwareness=n,this._providers=new Map,this.sharedModelFactory=new b(this._onCreate),super.fileChanged.connect(((e,t)=>{this._ydriveFileChanged.emit(t)}))}get providers(){return this._providers}dispose(){this.isDisposed||(this._providers.forEach((e=>e.dispose())),this._providers.clear(),super.dispose())}async get(e,t){if(t&&t.format&&t.type){const n=`${t.format}:${t.type}:${e}`,o=this._providers.get(n);if(o){const[n]=await Promise.all([super.get(e,{...t,content:!1}),o.ready]);return{...n,format:t.format}}}return super.get(e,t)}async save(e,t={}){if(t.format&&t.type){const n=`${t.format}:${t.type}:${e}`;if(this._providers.get(n)){const n={type:t.type,format:t.format,content:!1};return this.get(e,n)}}return super.save(e,t)}get fileChanged(){return this._ydriveFileChanged}}class b{constructor(e){this._onCreate=e,this.collaborative=!_,this.documentFactories=new Map}registerDocumentFactory(e,t){if(this.documentFactories.has(e))throw new Error(`The content type ${e} already exists`);this.documentFactories.set(e,t)}createNew(e){if("string"==typeof e.format){if(this.collaborative&&e.collaborative&&this.documentFactories.has(e.contentType)){const t=this.documentFactories.get(e.contentType)(e);return this._onCreate(e,t),t}}else console.warn(`Only defined format are supported; got ${e.format}.`)}}var C=n(345),S=n.n(C),k=n(591),T=n.n(k),x=n(740),E=n.n(x),U=n(128),D=n.n(U),$=n(855),R=n.n($),P=n(51),N=n.n(P),j=n(656),I=n.n(j),W=n(68),M={};M.styleTagTransform=I(),M.setAttributes=R(),M.insert=D().bind(null,"head"),M.domAPI=E(),M.insertStyleElement=N(),T()(W.A,M),W.A&&W.A.locals&&W.A.locals;var L=n(963);const F=({apiURL:e,provider:t,contentType:n,format:o,documentTimelineUrl:r})=>{const[i,a]=(0,C.useState)({roomId:"",timestamps:[],forkRoom:"",sessionId:""}),[c,l]=(0,C.useState)(i.timestamps.length-1),[d,u]=(0,C.useState)(!1),[h,v]=(0,C.useState)(!1),y=(0,C.useRef)(!0),g=(0,C.useRef)(!0),_=(0,C.useRef)(null);function w(e){try{const t=new URL(e).pathname,n=t.lastIndexOf(r);if(-1===n)throw new Error(`API segment "${r}" not found in URL.`);return t.slice(n+r.length)}catch(e){return console.error("Invalid URL or unable to extract filename:",e),""}}return S().createElement("div",{className:"jp-sliderContainer"},S().createElement("div",{onClick:()=>{!async function(r){try{if(y.current){const i=await m(o,n,r);if(!i.ok)throw 404===i.status?new Error("Not found"):503===i.status?new Error("WebSocket closed"):new Error(`Failed to fetch data: ${i.statusText}`);const c=await i.text();let d={roomId:"",timestamps:[],forkRoom:"",sessionId:""};return c&&(s.Notification.warning("Document is now in read-only mode. Changes will not be saved.",{autoClose:2500}),d=JSON.parse(c),a(d),l(d.timestamps.length-1),t.connectToForkDoc(d.forkRoom,d.sessionId),_.current=await p(o,n,w(e))),u(!0),y.current=!1,d}}catch(e){console.error("Error fetching data:",e)}}(w(e))},className:"jp-mod-highlighted",title:"Document Timeline"},S().createElement(L.historyIcon.react,{marginRight:"4px"})),d&&S().createElement("div",{className:"jp-timestampDisplay"},S().createElement("input",{type:"range",min:0,max:i.timestamps.length-1,value:c,onChange:async e=>{const t=parseInt(e.target.value),n=Math.abs(t-c);try{const e=function(e){return e<c?"undo":"redo"}(t);if(l(t),g.current&&(v(!0),g.current=!1),!_.current)return void console.error("Session is not initialized");await f(`${_.current.format}:${_.current.type}:${_.current.fileId}`,e,n,i.forkRoom)}catch(e){console.error("Error fetching or applying updates:",e)}},className:"jp-Slider"}),S().createElement("div",null,S().createElement("strong",null,w(e).split("/").pop()," ")," "),h&&S().createElement("div",{className:"jp-restoreBtnContainer"},S().createElement("button",{onClick:async()=>{if(!_.current)return void console.error("Session is not initialized");const e=await f(`${_.current.format}:${_.current.type}:${_.current.fileId}`,"restore",0,i.forkRoom);200===e.code?(s.Notification.success(e.status,{autoClose:4e3}),t.reconnect(),u(!1),y.current=!0):s.Notification.error(e.status,{autoClose:4e3})},className:"jp-ToolbarButtonComponent jp-restoreBtn"},"Restore version"," ",(e=>{const t=new Date(1e3*e);return`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,"0")}-${String(t.getDate()).padStart(2,"0")} ${String(t.getHours()).padStart(2,"0")}:${String(t.getMinutes()).padStart(2,"0")}:${String(t.getSeconds()).padStart(2,"0")}`})(i.timestamps[c])))))};class A extends s.ReactWidget{constructor(e,t,n,o,r){super(),this.apiURL=e,this.provider=t,this.contentType=n,this.format=o,this.documentTimelineUrl=r,this.addClass("jp-timelineSliderWrapper")}render(){return C.createElement(F,{key:this.apiURL,apiURL:this.apiURL,provider:this.provider,contentType:this.contentType,format:this.format,documentTimelineUrl:this.documentTimelineUrl})}updateContent(e,t){this.apiURL=e,this.provider=t,this.contentType=this.provider.contentType,this.format=this.provider.format,this.update()}}}}]);
@@ -1 +0,0 @@
1
- var _JUPYTERLAB;(()=>{"use strict";var e,r,t,o,n,a,i,l,u,d,s,f,p,c,v,h,b,y,m,g,j,w,P,S={496:(e,r,t)=>{var o={"./index":()=>Promise.all([t.e(266),t.e(671),t.e(544)]).then((()=>()=>t(544))),"./extension":()=>Promise.all([t.e(266),t.e(671),t.e(544)]).then((()=>()=>t(544))),"./style":()=>t.e(944).then((()=>()=>t(563)))},n=(e,r)=>(t.R=r,r=t.o(o,e)?o[e]():Promise.resolve().then((()=>{throw new Error('Module "'+e+'" does not exist in container.')})),t.R=void 0,r),a=(e,r)=>{if(t.S){var o="default",n=t.S[o];if(n&&n!==e)throw new Error("Container initialization failed as it has already been initialized with a different share scope");return t.S[o]=e,t.I(o,r)}};t.d(r,{get:()=>n,init:()=>a})}},k={};function x(e){var r=k[e];if(void 0!==r)return r.exports;var t=k[e]={id:e,exports:{}};return S[e](t,t.exports,x),t.exports}x.m=S,x.c=k,x.n=e=>{var r=e&&e.__esModule?()=>e.default:()=>e;return x.d(r,{a:r}),r},x.d=(e,r)=>{for(var t in r)x.o(r,t)&&!x.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},x.f={},x.e=e=>Promise.all(Object.keys(x.f).reduce(((r,t)=>(x.f[t](e,r),r)),[])),x.u=e=>e+"."+{444:"12adfae9a2b50e91531f",544:"8301e2e6bebb7807a73e",576:"21a3c1a9ebaebb58d346",618:"3664587b0727fbaef163",944:"4ff35dbd5ee5dd46c226"}[e]+".js?v="+{444:"12adfae9a2b50e91531f",544:"8301e2e6bebb7807a73e",576:"21a3c1a9ebaebb58d346",618:"3664587b0727fbaef163",944:"4ff35dbd5ee5dd46c226"}[e],x.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),x.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),e={},r="@jupyter/docprovider-extension:",x.l=(t,o,n,a)=>{if(e[t])e[t].push(o);else{var i,l;if(void 0!==n)for(var u=document.getElementsByTagName("script"),d=0;d<u.length;d++){var s=u[d];if(s.getAttribute("src")==t||s.getAttribute("data-webpack")==r+n){i=s;break}}i||(l=!0,(i=document.createElement("script")).charset="utf-8",i.timeout=120,x.nc&&i.setAttribute("nonce",x.nc),i.setAttribute("data-webpack",r+n),i.src=t),e[t]=[o];var f=(r,o)=>{i.onerror=i.onload=null,clearTimeout(p);var n=e[t];if(delete e[t],i.parentNode&&i.parentNode.removeChild(i),n&&n.forEach((e=>e(o))),r)return r(o)},p=setTimeout(f.bind(null,void 0,{type:"timeout",target:i}),12e4);i.onerror=f.bind(null,i.onerror),i.onload=f.bind(null,i.onload),l&&document.head.appendChild(i)}},x.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{x.S={};var e={},r={};x.I=(t,o)=>{o||(o=[]);var n=r[t];if(n||(n=r[t]={}),!(o.indexOf(n)>=0)){if(o.push(n),e[t])return e[t];x.o(x.S,t)||(x.S[t]={});var a=x.S[t],i="@jupyter/docprovider-extension",l=(e,r,t,o)=>{var n=a[e]=a[e]||{},l=n[r];(!l||!l.loaded&&(!o!=!l.eager?o:i>l.from))&&(n[r]={get:t,from:i,eager:!!o})},u=[];return"default"===t&&(l("@jupyter/collaborative-drive","3.0.1",(()=>Promise.all([x.e(262),x.e(444)]).then((()=>()=>x(444))))),l("@jupyter/docprovider-extension","3.0.1",(()=>Promise.all([x.e(266),x.e(671),x.e(544)]).then((()=>()=>x(544))))),l("@jupyter/docprovider","3.0.1",(()=>Promise.all([x.e(266),x.e(262),x.e(618)]).then((()=>()=>x(618))))),l("y-websocket","1.5.4",(()=>Promise.all([x.e(576),x.e(206)]).then((()=>()=>x(576)))))),e[t]=u.length?Promise.all(u).then((()=>e[t]=1)):1}}})(),(()=>{var e;x.g.importScripts&&(e=x.g.location+"");var r=x.g.document;if(!e&&r&&(r.currentScript&&"SCRIPT"===r.currentScript.tagName.toUpperCase()&&(e=r.currentScript.src),!e)){var t=r.getElementsByTagName("script");if(t.length)for(var o=t.length-1;o>-1&&(!e||!/^http(s?):/.test(e));)e=t[o--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),x.p=e})(),t=e=>{var r=e=>e.split(".").map((e=>+e==e?+e:e)),t=/^([^-+]+)?(?:-([^+]+))?(?:\+(.+))?$/.exec(e),o=t[1]?r(t[1]):[];return t[2]&&(o.length++,o.push.apply(o,r(t[2]))),t[3]&&(o.push([]),o.push.apply(o,r(t[3]))),o},o=(e,r)=>{e=t(e),r=t(r);for(var o=0;;){if(o>=e.length)return o<r.length&&"u"!=(typeof r[o])[0];var n=e[o],a=(typeof n)[0];if(o>=r.length)return"u"==a;var i=r[o],l=(typeof i)[0];if(a!=l)return"o"==a&&"n"==l||"s"==l||"u"==a;if("o"!=a&&"u"!=a&&n!=i)return n<i;o++}},n=e=>{var r=e[0],t="";if(1===e.length)return"*";if(r+.5){t+=0==r?">=":-1==r?"<":1==r?"^":2==r?"~":r>0?"=":"!=";for(var o=1,a=1;a<e.length;a++)o--,t+="u"==(typeof(l=e[a]))[0]?"-":(o>0?".":"")+(o=2,l);return t}var i=[];for(a=1;a<e.length;a++){var l=e[a];i.push(0===l?"not("+u()+")":1===l?"("+u()+" || "+u()+")":2===l?i.pop()+" "+i.pop():n(l))}return u();function u(){return i.pop().replace(/^\((.+)\)$/,"$1")}},a=(e,r)=>{if(0 in e){r=t(r);var o=e[0],n=o<0;n&&(o=-o-1);for(var i=0,l=1,u=!0;;l++,i++){var d,s,f=l<e.length?(typeof e[l])[0]:"";if(i>=r.length||"o"==(s=(typeof(d=r[i]))[0]))return!u||("u"==f?l>o&&!n:""==f!=n);if("u"==s){if(!u||"u"!=f)return!1}else if(u)if(f==s)if(l<=o){if(d!=e[l])return!1}else{if(n?d>e[l]:d<e[l])return!1;d!=e[l]&&(u=!1)}else if("s"!=f&&"n"!=f){if(n||l<=o)return!1;u=!1,l--}else{if(l<=o||s<f!=n)return!1;u=!1}else"s"!=f&&"n"!=f&&(u=!1,l--)}}var p=[],c=p.pop.bind(p);for(i=1;i<e.length;i++){var v=e[i];p.push(1==v?c()|c():2==v?c()&c():v?a(v,r):!c())}return!!c()},i=(e,r)=>e&&x.o(e,r),l=e=>(e.loaded=1,e.get()),u=e=>Object.keys(e).reduce(((r,t)=>(e[t].eager&&(r[t]=e[t]),r)),{}),d=(e,r,t,n)=>{var i=n?u(e[r]):e[r];return(r=Object.keys(i).reduce(((e,r)=>!a(t,r)||e&&!o(e,r)?e:r),0))&&i[r]},s=(e,r,t)=>{var n=t?u(e[r]):e[r];return Object.keys(n).reduce(((e,r)=>!e||!n[e].loaded&&o(e,r)?r:e),0)},f=(e,r,t,o)=>"Unsatisfied version "+t+" from "+(t&&e[r][t].from)+" of shared singleton module "+r+" (required "+n(o)+")",p=(e,r,t,o,a)=>{var i=e[t];return"No satisfying version ("+n(o)+")"+(a?" for eager consumption":"")+" of shared module "+t+" found in shared scope "+r+".\nAvailable versions: "+Object.keys(i).map((e=>e+" from "+i[e].from)).join(", ")},c=e=>{throw new Error(e)},v=e=>{"undefined"!=typeof console&&console.warn&&console.warn(e)},b=(e,r,t)=>t?t():((e,r)=>c("Shared module "+r+" doesn't exist in shared scope "+e))(e,r),y=(h=e=>function(r,t,o,n,a){var i=x.I(r);return i&&i.then&&!o?i.then(e.bind(e,r,x.S[r],t,!1,n,a)):e(r,x.S[r],t,o,n,a)})(((e,r,t,o,n,a)=>{if(!i(r,t))return b(e,t,a);var u=d(r,t,n,o);return u?l(u):a?a():void c(p(r,e,t,n,o))})),m=h(((e,r,t,o,n,u)=>{if(!i(r,t))return b(e,t,u);var d=s(r,t,o);return a(n,d)||v(f(r,t,d,n)),l(r[t][d])})),g={},j={314:()=>m("default","@jupyterlab/coreutils",!1,[1,6,3,1]),501:()=>m("default","@jupyterlab/apputils",!1,[1,4,4,1]),877:()=>m("default","@jupyterlab/translation",!1,[1,4,3,1]),0:()=>m("default","@jupyter/ydoc",!1,[1,3,0,0,,"a3"]),256:()=>m("default","@lumino/widgets",!1,[1,2,3,1,,"alpha",0]),295:()=>m("default","@jupyterlab/notebook",!1,[1,4,3,1]),594:()=>m("default","@jupyterlab/filebrowser",!1,[1,4,3,1]),637:()=>m("default","@jupyterlab/fileeditor",!1,[1,4,3,1]),782:()=>m("default","@jupyterlab/application",!1,[1,4,3,1]),937:()=>m("default","@jupyterlab/logconsole",!1,[1,4,3,1]),944:()=>m("default","@jupyter/collaborative-drive",!1,[1,3,0,1],(()=>Promise.all([x.e(262),x.e(444)]).then((()=>()=>x(444))))),969:()=>m("default","@jupyterlab/statusbar",!1,[1,4,3,1]),971:()=>m("default","@jupyter/docprovider",!1,[1,3,0,1],(()=>Promise.all([x.e(262),x.e(618)]).then((()=>()=>x(618))))),981:()=>m("default","@jupyterlab/settingregistry",!1,[1,4,3,1]),262:()=>m("default","@lumino/coreutils",!1,[1,2,0,0]),33:()=>m("default","@jupyterlab/services",!1,[1,7,3,1]),345:()=>m("default","react",!1,[1,18,2,0]),560:()=>y("default","y-websocket",!1,[1,1,3,15],(()=>Promise.all([x.e(576),x.e(206)]).then((()=>()=>x(576))))),602:()=>m("default","@lumino/signaling",!1,[1,2,0,0]),963:()=>m("default","@jupyterlab/ui-components",!1,[1,4,3,1]),206:()=>m("default","yjs",!1,[1,13,5,40])},w={206:[206],262:[262],266:[314,501,877],618:[33,345,560,602,963],671:[0,256,295,594,637,782,937,944,969,971,981]},P={},x.f.consumes=(e,r)=>{x.o(w,e)&&w[e].forEach((e=>{if(x.o(g,e))return r.push(g[e]);if(!P[e]){var t=r=>{g[e]=0,x.m[e]=t=>{delete x.c[e],t.exports=r()}};P[e]=!0;var o=r=>{delete g[e],x.m[e]=t=>{throw delete x.c[e],r}};try{var n=j[e]();n.then?r.push(g[e]=n.then(t).catch(o)):t(n)}catch(e){o(e)}}}))},(()=>{var e={552:0};x.f.j=(r,t)=>{var o=x.o(e,r)?e[r]:void 0;if(0!==o)if(o)t.push(o[2]);else if(/^(2(06|62|66)|671)$/.test(r))e[r]=0;else{var n=new Promise(((t,n)=>o=e[r]=[t,n]));t.push(o[2]=n);var a=x.p+x.u(r),i=new Error;x.l(a,(t=>{if(x.o(e,r)&&(0!==(o=e[r])&&(e[r]=void 0),o)){var n=t&&("load"===t.type?"missing":t.type),a=t&&t.target&&t.target.src;i.message="Loading chunk "+r+" failed.\n("+n+": "+a+")",i.name="ChunkLoadError",i.type=n,i.request=a,o[1](i)}}),"chunk-"+r,r)}};var r=(r,t)=>{var o,n,[a,i,l]=t,u=0;if(a.some((r=>0!==e[r]))){for(o in i)x.o(i,o)&&(x.m[o]=i[o]);l&&l(x)}for(r&&r(t);u<a.length;u++)n=a[u],x.o(e,n)&&e[n]&&e[n][0](),e[n]=0},t=self.webpackChunk_jupyter_docprovider_extension=self.webpackChunk_jupyter_docprovider_extension||[];t.forEach(r.bind(null,0)),t.push=r.bind(null,t.push.bind(t))})(),x.nc=void 0;var E=x(496);(_JUPYTERLAB=void 0===_JUPYTERLAB?{}:_JUPYTERLAB)["@jupyter/docprovider-extension"]=E})();