jupytergis-core 0.1.3__tar.gz → 0.1.4__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 (117) hide show
  1. {jupytergis_core-0.1.3 → jupytergis_core-0.1.4}/PKG-INFO +1 -1
  2. {jupytergis_core-0.1.3 → jupytergis_core-0.1.4}/jupytergis_core/_version.py +1 -1
  3. {jupytergis_core-0.1.3 → jupytergis_core-0.1.4}/jupytergis_core/labextension/package.json +4 -4
  4. jupytergis_core-0.1.4/jupytergis_core/labextension/static/557.124adeab9ddcc6efbcfa.js +1 -0
  5. jupytergis_core-0.1.4/jupytergis_core/labextension/static/5826034e4f8281d7f0ed.png +0 -0
  6. jupytergis_core-0.1.3/jupytergis_core/labextension/static/342e1e3d19b03b1fe609.png → jupytergis_core-0.1.4/jupytergis_core/labextension/static/6b757d947c8275c8a00a.png +0 -0
  7. jupytergis_core-0.1.3/jupytergis_core/labextension/static/936.169e398d63d619903349.js → jupytergis_core-0.1.4/jupytergis_core/labextension/static/936.eb473ed6556cf34dda15.js +1 -1
  8. jupytergis_core-0.1.4/jupytergis_core/labextension/static/991.973db496b4c31530b673.js +1 -0
  9. jupytergis_core-0.1.4/jupytergis_core/labextension/static/d1e6643691fc2fba7cc9.png +0 -0
  10. jupytergis_core-0.1.4/jupytergis_core/labextension/static/e70ac67d6f8fa78151d7.png +0 -0
  11. jupytergis_core-0.1.4/jupytergis_core/labextension/static/remoteEntry.7fbe4827740661d9dbf7.js +1 -0
  12. {jupytergis_core-0.1.3 → jupytergis_core-0.1.4}/jupytergis_core/labextension/static/third-party-licenses.json +2 -2
  13. {jupytergis_core-0.1.3 → jupytergis_core-0.1.4}/package.json +3 -3
  14. {jupytergis_core-0.1.3 → jupytergis_core-0.1.4}/tsconfig.tsbuildinfo +1 -1
  15. jupytergis_core-0.1.3/jupytergis_core/labextension/static/557.fe291f5575a15c36d24c.js +0 -1
  16. jupytergis_core-0.1.3/jupytergis_core/labextension/static/81ffc09a91df6d865b2a.png +0 -0
  17. jupytergis_core-0.1.3/jupytergis_core/labextension/static/880b33982acf113f7814.png +0 -0
  18. jupytergis_core-0.1.3/jupytergis_core/labextension/static/991.31397828c39e542d58cd.js +0 -1
  19. jupytergis_core-0.1.3/jupytergis_core/labextension/static/f96120c463d07664c2e3.png +0 -0
  20. jupytergis_core-0.1.3/jupytergis_core/labextension/static/remoteEntry.2c0a4f1ad6ed25d278ab.js +0 -1
  21. {jupytergis_core-0.1.3 → jupytergis_core-0.1.4}/.gitignore +0 -0
  22. {jupytergis_core-0.1.3 → jupytergis_core-0.1.4}/LICENSE +0 -0
  23. {jupytergis_core-0.1.3 → jupytergis_core-0.1.4}/README.md +0 -0
  24. {jupytergis_core-0.1.3 → jupytergis_core-0.1.4}/jupyter-config/server-config/jupytergis_core.json +0 -0
  25. {jupytergis_core-0.1.3 → jupytergis_core-0.1.4}/jupytergis_core/__init__.py +0 -0
  26. {jupytergis_core-0.1.3 → jupytergis_core-0.1.4}/jupytergis_core/handler.py +0 -0
  27. {jupytergis_core-0.1.3 → jupytergis_core-0.1.4}/jupytergis_core/jgis_ydoc.py +0 -0
  28. {jupytergis_core-0.1.3 → jupytergis_core-0.1.4}/jupytergis_core/labextension/static/034e72037478aea1bd04.png +0 -0
  29. {jupytergis_core-0.1.3 → jupytergis_core-0.1.4}/jupytergis_core/labextension/static/05cd6f9ef7cee99b045d.png +0 -0
  30. {jupytergis_core-0.1.3 → jupytergis_core-0.1.4}/jupytergis_core/labextension/static/062a9554f6b4caac9713.png +0 -0
  31. {jupytergis_core-0.1.3 → jupytergis_core-0.1.4}/jupytergis_core/labextension/static/064f37cecb8130ad66e8.png +0 -0
  32. {jupytergis_core-0.1.3 → jupytergis_core-0.1.4}/jupytergis_core/labextension/static/08da2741746ddab81d04.png +0 -0
  33. {jupytergis_core-0.1.3 → jupytergis_core-0.1.4}/jupytergis_core/labextension/static/154.0d16fbe1d1182d138b2c.js +0 -0
  34. {jupytergis_core-0.1.3 → jupytergis_core-0.1.4}/jupytergis_core/labextension/static/197.34d9096e78e2f4b7138c.js +0 -0
  35. {jupytergis_core-0.1.3 → jupytergis_core-0.1.4}/jupytergis_core/labextension/static/1d440270da19a2f22fee.png +0 -0
  36. {jupytergis_core-0.1.3 → jupytergis_core-0.1.4}/jupytergis_core/labextension/static/1f152a2e838d5bc9734a.png +0 -0
  37. {jupytergis_core-0.1.3 → jupytergis_core-0.1.4}/jupytergis_core/labextension/static/226.280aa14a2e4c0654c374.js +0 -0
  38. {jupytergis_core-0.1.3 → jupytergis_core-0.1.4}/jupytergis_core/labextension/static/25add056a64c313112c1.png +0 -0
  39. {jupytergis_core-0.1.3 → jupytergis_core-0.1.4}/jupytergis_core/labextension/static/27.aea9e291ba3dd16790fb.js +0 -0
  40. {jupytergis_core-0.1.3 → jupytergis_core-0.1.4}/jupytergis_core/labextension/static/27.aea9e291ba3dd16790fb.js.LICENSE.txt +0 -0
  41. {jupytergis_core-0.1.3 → jupytergis_core-0.1.4}/jupytergis_core/labextension/static/2b3d42a470b5ce14859a.png +0 -0
  42. {jupytergis_core-0.1.3 → jupytergis_core-0.1.4}/jupytergis_core/labextension/static/2fd48688b8db6630a98b.png +0 -0
  43. {jupytergis_core-0.1.3 → jupytergis_core-0.1.4}/jupytergis_core/labextension/static/32c7a73662cceb5bb1d7.png +0 -0
  44. {jupytergis_core-0.1.3 → jupytergis_core-0.1.4}/jupytergis_core/labextension/static/350eec4ce9ae4bc10bca.wasm +0 -0
  45. {jupytergis_core-0.1.3 → jupytergis_core-0.1.4}/jupytergis_core/labextension/static/36.b2f6adaa2d1def5c163f.js +0 -0
  46. {jupytergis_core-0.1.3 → jupytergis_core-0.1.4}/jupytergis_core/labextension/static/363ca7c5f78deb6fd033.png +0 -0
  47. {jupytergis_core-0.1.3 → jupytergis_core-0.1.4}/jupytergis_core/labextension/static/366.33cb40029b4f4da3d3ad.js +0 -0
  48. {jupytergis_core-0.1.3 → jupytergis_core-0.1.4}/jupytergis_core/labextension/static/378afa99d57ed2ae3412.png +0 -0
  49. {jupytergis_core-0.1.3 → jupytergis_core-0.1.4}/jupytergis_core/labextension/static/3d48be10ffea86eb15de.png +0 -0
  50. {jupytergis_core-0.1.3 → jupytergis_core-0.1.4}/jupytergis_core/labextension/static/407.fa2f7a0dc4d3371a5e2c.js +0 -0
  51. {jupytergis_core-0.1.3 → jupytergis_core-0.1.4}/jupytergis_core/labextension/static/432.19e693d578a221132366.js +0 -0
  52. {jupytergis_core-0.1.3 → jupytergis_core-0.1.4}/jupytergis_core/labextension/static/460.a2074380632031c05e8d.js +0 -0
  53. {jupytergis_core-0.1.3 → jupytergis_core-0.1.4}/jupytergis_core/labextension/static/472.08add5249d72d563ba32.js +0 -0
  54. {jupytergis_core-0.1.3 → jupytergis_core-0.1.4}/jupytergis_core/labextension/static/49aaa70fdbd358566081.png +0 -0
  55. {jupytergis_core-0.1.3 → jupytergis_core-0.1.4}/jupytergis_core/labextension/static/4ed4ae4121d38d85100b.png +0 -0
  56. {jupytergis_core-0.1.3 → jupytergis_core-0.1.4}/jupytergis_core/labextension/static/509.0d58394cd3a34bdbd0b9.js +0 -0
  57. {jupytergis_core-0.1.3 → jupytergis_core-0.1.4}/jupytergis_core/labextension/static/542.3038c6cef679f15b8d9a.js +0 -0
  58. {jupytergis_core-0.1.3 → jupytergis_core-0.1.4}/jupytergis_core/labextension/static/552.9f37fbb73d9f60b6c3f3.js +0 -0
  59. {jupytergis_core-0.1.3 → jupytergis_core-0.1.4}/jupytergis_core/labextension/static/555.7d0c1d2ee9e49a619cb9.js +0 -0
  60. {jupytergis_core-0.1.3 → jupytergis_core-0.1.4}/jupytergis_core/labextension/static/57.5de96a80fc76b40d5c98.js +0 -0
  61. {jupytergis_core-0.1.3 → jupytergis_core-0.1.4}/jupytergis_core/labextension/static/57.5de96a80fc76b40d5c98.js.LICENSE.txt +0 -0
  62. {jupytergis_core-0.1.3 → jupytergis_core-0.1.4}/jupytergis_core/labextension/static/618.86523276f857e0a3362e.js +0 -0
  63. {jupytergis_core-0.1.3 → jupytergis_core-0.1.4}/jupytergis_core/labextension/static/65a5e66f99e9379dfc35.png +0 -0
  64. {jupytergis_core-0.1.3 → jupytergis_core-0.1.4}/jupytergis_core/labextension/static/6d8404aa058fc40542b5.png +0 -0
  65. {jupytergis_core-0.1.3 → jupytergis_core-0.1.4}/jupytergis_core/labextension/static/733.9bce9fdd113869d413d0.js +0 -0
  66. {jupytergis_core-0.1.3 → jupytergis_core-0.1.4}/jupytergis_core/labextension/static/777.b41e81dd6b0af001baab.js +0 -0
  67. {jupytergis_core-0.1.3 → jupytergis_core-0.1.4}/jupytergis_core/labextension/static/777.b41e81dd6b0af001baab.js.LICENSE.txt +0 -0
  68. {jupytergis_core-0.1.3 → jupytergis_core-0.1.4}/jupytergis_core/labextension/static/803.959deb5eafbb3ab489c6.js +0 -0
  69. {jupytergis_core-0.1.3 → jupytergis_core-0.1.4}/jupytergis_core/labextension/static/91d7eac484745f2cc5be.png +0 -0
  70. {jupytergis_core-0.1.3 → jupytergis_core-0.1.4}/jupytergis_core/labextension/static/987b25b09e2ab3aa14c7.png +0 -0
  71. {jupytergis_core-0.1.3 → jupytergis_core-0.1.4}/jupytergis_core/labextension/static/9d23b9ebf800c009f835.png +0 -0
  72. {jupytergis_core-0.1.3 → jupytergis_core-0.1.4}/jupytergis_core/labextension/static/9ed013096549f2bf7c22.png +0 -0
  73. {jupytergis_core-0.1.3 → jupytergis_core-0.1.4}/jupytergis_core/labextension/static/a3d0ada3998dc5eedfd3.png +0 -0
  74. {jupytergis_core-0.1.3 → jupytergis_core-0.1.4}/jupytergis_core/labextension/static/aa0d1282df07ef3c385f.png +0 -0
  75. {jupytergis_core-0.1.3 → jupytergis_core-0.1.4}/jupytergis_core/labextension/static/ae2589dc6f6090080a25.png +0 -0
  76. {jupytergis_core-0.1.3 → jupytergis_core-0.1.4}/jupytergis_core/labextension/static/b55cd9c1ba258194a75b.png +0 -0
  77. {jupytergis_core-0.1.3 → jupytergis_core-0.1.4}/jupytergis_core/labextension/static/bf9c5537f242b3244cfd.png +0 -0
  78. {jupytergis_core-0.1.3 → jupytergis_core-0.1.4}/jupytergis_core/labextension/static/c5f242778732b5dc2895.png +0 -0
  79. {jupytergis_core-0.1.3 → jupytergis_core-0.1.4}/jupytergis_core/labextension/static/c6533f8919fbd9204588.png +0 -0
  80. {jupytergis_core-0.1.3 → jupytergis_core-0.1.4}/jupytergis_core/labextension/static/d0917c2edc1eee1562a2.png +0 -0
  81. {jupytergis_core-0.1.3 → jupytergis_core-0.1.4}/jupytergis_core/labextension/static/d7eb57ad53f788b1fa92.png +0 -0
  82. {jupytergis_core-0.1.3 → jupytergis_core-0.1.4}/jupytergis_core/labextension/static/d83457b1b925c1718f6d.png +0 -0
  83. {jupytergis_core-0.1.3 → jupytergis_core-0.1.4}/jupytergis_core/labextension/static/e473e1e9f20af114bbb4.data +0 -0
  84. {jupytergis_core-0.1.3 → jupytergis_core-0.1.4}/jupytergis_core/labextension/static/e48a0a08bd9700f029ef.png +0 -0
  85. {jupytergis_core-0.1.3 → jupytergis_core-0.1.4}/jupytergis_core/labextension/static/edf2f8b4d83dca6ed541.png +0 -0
  86. {jupytergis_core-0.1.3 → jupytergis_core-0.1.4}/jupytergis_core/labextension/static/style.js +0 -0
  87. {jupytergis_core-0.1.3 → jupytergis_core-0.1.4}/lib/externalcommand.d.ts +0 -0
  88. {jupytergis_core-0.1.3 → jupytergis_core-0.1.4}/lib/externalcommand.js +0 -0
  89. {jupytergis_core-0.1.3 → jupytergis_core-0.1.4}/lib/factory.d.ts +0 -0
  90. {jupytergis_core-0.1.3 → jupytergis_core-0.1.4}/lib/factory.js +0 -0
  91. {jupytergis_core-0.1.3 → jupytergis_core-0.1.4}/lib/index.d.ts +0 -0
  92. {jupytergis_core-0.1.3 → jupytergis_core-0.1.4}/lib/index.js +0 -0
  93. {jupytergis_core-0.1.3 → jupytergis_core-0.1.4}/lib/jgisplugin/modelfactory.d.ts +0 -0
  94. {jupytergis_core-0.1.3 → jupytergis_core-0.1.4}/lib/jgisplugin/modelfactory.js +0 -0
  95. {jupytergis_core-0.1.3 → jupytergis_core-0.1.4}/lib/jgisplugin/plugins.d.ts +0 -0
  96. {jupytergis_core-0.1.3 → jupytergis_core-0.1.4}/lib/jgisplugin/plugins.js +0 -0
  97. {jupytergis_core-0.1.3 → jupytergis_core-0.1.4}/lib/layerBrowserRegistry.d.ts +0 -0
  98. {jupytergis_core-0.1.3 → jupytergis_core-0.1.4}/lib/layerBrowserRegistry.js +0 -0
  99. {jupytergis_core-0.1.3 → jupytergis_core-0.1.4}/lib/plugin.d.ts +0 -0
  100. {jupytergis_core-0.1.3 → jupytergis_core-0.1.4}/lib/plugin.js +0 -0
  101. {jupytergis_core-0.1.3 → jupytergis_core-0.1.4}/lib/schemaregistry.d.ts +0 -0
  102. {jupytergis_core-0.1.3 → jupytergis_core-0.1.4}/lib/schemaregistry.js +0 -0
  103. {jupytergis_core-0.1.3 → jupytergis_core-0.1.4}/pyproject.toml +0 -0
  104. {jupytergis_core-0.1.3 → jupytergis_core-0.1.4}/scripts/bump-version.py +0 -0
  105. {jupytergis_core-0.1.3 → jupytergis_core-0.1.4}/setup.py +0 -0
  106. {jupytergis_core-0.1.3 → jupytergis_core-0.1.4}/src/externalcommand.ts +0 -0
  107. {jupytergis_core-0.1.3 → jupytergis_core-0.1.4}/src/factory.ts +0 -0
  108. {jupytergis_core-0.1.3 → jupytergis_core-0.1.4}/src/index.ts +0 -0
  109. {jupytergis_core-0.1.3 → jupytergis_core-0.1.4}/src/jgisplugin/modelfactory.ts +0 -0
  110. {jupytergis_core-0.1.3 → jupytergis_core-0.1.4}/src/jgisplugin/plugins.ts +0 -0
  111. {jupytergis_core-0.1.3 → jupytergis_core-0.1.4}/src/layerBrowserRegistry.ts +0 -0
  112. {jupytergis_core-0.1.3 → jupytergis_core-0.1.4}/src/plugin.ts +0 -0
  113. {jupytergis_core-0.1.3 → jupytergis_core-0.1.4}/src/schemaregistry.ts +0 -0
  114. {jupytergis_core-0.1.3 → jupytergis_core-0.1.4}/style/base.css +0 -0
  115. {jupytergis_core-0.1.3 → jupytergis_core-0.1.4}/style/index.css +0 -0
  116. {jupytergis_core-0.1.3 → jupytergis_core-0.1.4}/style/index.js +0 -0
  117. {jupytergis_core-0.1.3 → jupytergis_core-0.1.4}/tsconfig.json +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: jupytergis_core
3
- Version: 0.1.3
3
+ Version: 0.1.4
4
4
  Dynamic: Keywords
5
5
  Summary: JupyterGIS core extension
6
6
  Project-URL: Homepage, https://github.com/geojupyter/jupytergis
@@ -1,4 +1,4 @@
1
1
  # This file is auto-generated by Hatchling. As such, do not:
2
2
  # - modify
3
3
  # - track in version control e.g. be sure to add to .gitignore
4
- __version__ = VERSION = '0.1.3'
4
+ __version__ = VERSION = '0.1.4'
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jupytergis/jupytergis-core",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "description": "JupyterGIS core extension",
5
5
  "keywords": [
6
6
  "jupyter",
@@ -53,8 +53,8 @@
53
53
  },
54
54
  "dependencies": {
55
55
  "@jupyter/docprovider": "^2.0.0",
56
- "@jupytergis/base": "^0.1.3",
57
- "@jupytergis/schema": "^0.1.3",
56
+ "@jupytergis/base": "^0.1.4",
57
+ "@jupytergis/schema": "^0.1.4",
58
58
  "@jupyterlab/application": "^4.0.0",
59
59
  "@jupyterlab/apputils": "^4.0.0",
60
60
  "@jupyterlab/docregistry": "^4.0.0",
@@ -118,7 +118,7 @@
118
118
  }
119
119
  },
120
120
  "_build": {
121
- "load": "static/remoteEntry.2c0a4f1ad6ed25d278ab.js",
121
+ "load": "static/remoteEntry.7fbe4827740661d9dbf7.js",
122
122
  "extension": "./extension",
123
123
  "style": "./style"
124
124
  }
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_jupytergis_jupytergis_core=self.webpackChunk_jupytergis_jupytergis_core||[]).push([[557],{92557:(e,t,r)=>{r.r(t),r.d(t,{IJGISExternalCommandRegistryToken:()=>g,IJGISFormSchemaRegistryToken:()=>c,IJGISLayerBrowserRegistryToken:()=>f,IJupyterGISDocTracker:()=>p,JupyterGISDoc:()=>d,JupyterGISModel:()=>u});var s=r(81473),i=r(74602),a=r(26803),n=r.n(a),o=r(22697),h=r(67262);class d extends o.YDocument{constructor(){super(),this.editable=!0,this._optionsObserver=e=>{this._optionsChanged.emit(e.keys)},this._optionsChanged=new i.Signal(this),this._layersChanged=new i.Signal(this),this._layerTreeChanged=new i.Signal(this),this._sourcesChanged=new i.Signal(this),this._terrainChanged=new i.Signal(this),this._options=this.ydoc.getMap("options"),this._layers=this.ydoc.getMap("layers"),this._layerTree=this.ydoc.getArray("layerTree"),this._sources=this.ydoc.getMap("sources"),this._terrain=this.ydoc.getMap("terrain"),this.undoManager.addToScope(this._layers),this.undoManager.addToScope(this._sources),this.undoManager.addToScope(this._layerTree),this._layers.observeDeep(this._layersObserver.bind(this)),this._layerTree.observe(this._layerTreeObserver.bind(this)),this._sources.observeDeep(this._sourcesObserver.bind(this)),this._terrain.observe(this._terrainObserver.bind(this)),this._options.observe(this._optionsObserver.bind(this))}dispose(){super.dispose()}get version(){return"0.1.0"}get layers(){return h.JSONExt.deepCopy(this._layers.toJSON())}set layers(e){this.transact((()=>{for(const[t,r]of Object.entries(e))this._layers.set(t,r)}))}set sources(e){this.transact((()=>{for(const[t,r]of Object.entries(e))this._sources.set(t,r)}))}get sources(){return h.JSONExt.deepCopy(this._sources.toJSON())}get layerTree(){return h.JSONExt.deepCopy(this._layerTree.toJSON())}set layerTree(e){this.transact((()=>{this._layerTree.delete(0,this._layerTree.length),this._layerTree.push(e)}))}get terrain(){return h.JSONExt.deepCopy(this._terrain.toJSON())}set terrain(e){this.transact((()=>{for(const[t,r]of Object.entries(e))this._terrain.set(t,r)}))}getLayer(e){if(this._layers.has(e))return h.JSONExt.deepCopy(this._layers.get(e))}getSource(e){if(this._sources.has(e))return h.JSONExt.deepCopy(this._sources.get(e))}set options(e){this.transact((()=>{for(const[t,r]of Object.entries(e))this._options.set(t,r)}))}get options(){return h.JSONExt.deepCopy(this._options.toJSON())}get layersChanged(){return this._layersChanged}get layerTreeChanged(){return this._layerTreeChanged}get sourcesChanged(){return this._sourcesChanged}get optionsChanged(){return this._optionsChanged}get terrainChanged(){return this._terrainChanged}layerExists(e){return Boolean(this._getLayerAsYMap(e))}removeLayer(e){this.transact((()=>{this._layers.delete(e)}))}addLayer(e,t){this.transact((()=>{this._layers.set(e,t)}))}updateLayer(e,t){this.transact((()=>{this._layers.set(e,t)}))}addLayerTreeItem(e,t){this.transact((()=>{this._layerTree.insert(e,[t])}))}updateLayerTreeItem(e,t){this.transact((()=>{this._layerTree.delete(e),t&&this._layerTree.insert(e,[t])}))}getObject(e){const t=this.getLayer(e);if(t)return t;return this.getSource(e)||void 0}updateObjectParameters(e,t){const r=this.getLayer(e);r&&(r.parameters=Object.assign(Object.assign({},r.parameters),t),this.updateLayer(e,r));const s=this.getSource(e);s&&(s.parameters=Object.assign(Object.assign({},s.parameters),t),this.updateSource(e,s))}sourceExists(e){return Boolean(this._getSourceAsYMap(e))}removeSource(e){this.transact((()=>{this._sources.delete(e)}))}addSource(e,t){this.transact((()=>{this._sources.set(e,t)}))}updateSource(e,t){this.transact((()=>this._sources.set(e,t)))}getOption(e){const t=this._options.get(e);if(t)return h.JSONExt.deepCopy(t)}setOption(e,t){this.transact((()=>{this._options.set(e,t)}))}static create(){return new d}_getLayerAsYMap(e){if(this._layers.has(e))return this._layers.get(e)}_getSourceAsYMap(e){if(this._sources.has(e))return this._sources.get(e)}_layersObserver(e){const t=[];let r=!1;e.forEach((e=>{e.keys.forEach(((s,i)=>{r||(r=!0),t.push({id:i,newValue:h.JSONExt.deepCopy(e.target.toJSON()[i])})}))})),r=0===t.length||r,r&&this._layersChanged.emit({layerChange:t})}_layerTreeObserver(e){const t=e.delta;this._layerTreeChanged.emit({layerTreeChange:t})}_sourcesObserver(e){const t=[];let r=!1;e.forEach((e=>{e.keys.forEach(((s,i)=>{r||(r=!0),t.push({id:i,newValue:h.JSONExt.deepCopy(e.target.toJSON()[i])})}))})),r=0===t.length||r,r&&this._sourcesChanged.emit({sourceChange:t})}_terrainObserver(e){this._terrainChanged.emit(this.terrain)}}const l=JSON.parse('{"type":"object","title":"IJGISContent","required":["layers","sources"],"additionalProperties":false,"properties":{"layers":{"$ref":"#/definitions/jGISLayers"},"sources":{"$ref":"#/definitions/jGISSources"},"layerTree":{"$ref":"#/definitions/jGISLayerTree"},"terrain":{"$ref":"#/definitions/jGISTerrain"},"options":{"$ref":"#/definitions/jGISOptions"}},"definitions":{"layerType":{"type":"string","enum":["RasterLayer","VectorLayer","VectorTileLayer","HillshadeLayer","WebGlLayer","ImageLayer"]},"sourceType":{"type":"string","enum":["RasterSource","VectorTileSource","GeoJSONSource","RasterDemSource","VideoSource","ImageSource","ShapefileSource","GeoTiffSource"]},"jGISLayer":{"title":"IJGISLayer","type":"object","additionalProperties":false,"required":["name","type","visible"],"properties":{"name":{"type":"string"},"type":{"$ref":"#/definitions/layerType"},"visible":{"type":"boolean","default":true},"parameters":{"type":"object"},"filters":{"$ref":"#/definitions/jGISFilter"}}},"jGISSource":{"title":"IJGISSource","type":"object","additionalProperties":false,"required":["name","type"],"properties":{"name":{"type":"string"},"type":{"$ref":"#/definitions/sourceType"},"parameters":{"type":"object"}}},"jGISLayerGroup":{"title":"IJGISLayerGroup","type":"object","additionalProperties":false,"required":["name","layers"],"properties":{"name":{"type":"string"},"layers":{"type":"array","default":[],"items":{"$ref":"#/definitions/jGISLayerItem"}},"visible":{"type":"boolean","default":true},"parameters":{"type":"object"}}},"jGISLayerItem":{"title":"IJGISLayerItem","oneOf":[{"type":"string"},{"$ref":"#/definitions/jGISLayerGroup"}]},"jGISLayers":{"title":"IJGISLayers","type":"object","default":{},"additionalProperties":{"$ref":"#/definitions/jGISLayer"}},"jGISSources":{"title":"IJGISSources","type":"object","default":{},"additionalProperties":{"$ref":"#/definitions/jGISSource"}},"jGISLayerTree":{"title":"IJGISLayerTree","type":"array","default":[],"items":{"$ref":"#/definitions/jGISLayerItem"}},"jGISTerrain":{"title":"IJGISTerrain","type":"object","default":{},"required":["source","exaggeration"],"additionalProperties":false,"properties":{"source":{"type":"string","description":"The id of the DEM source","default":""},"exaggeration":{"type":"number","default":1}}},"jGISOptions":{"title":"IJGISOptions","type":"object","default":{},"required":[],"additionalProperties":false,"properties":{"latitude":{"type":"number","default":0},"longitude":{"type":"number","default":0},"zoom":{"type":"number","default":0},"bearing":{"type":"number","default":0},"pitch":{"type":"number","default":0},"extent":{"type":"array","default":null,"items":{"type":"number"}},"projection":{"type":"string","default":"EPSG:3857"},"useExtent":{"type":"boolean","default":false}}},"jGISFilterItem":{"title":"IJGISFilterItem","type":"object","default":{},"required":["operator","feature","value"],"additionalProperties":false,"properties":{"operator":{"type":"string","enum":["==","!=",">","<",">=","<="],"default":"=="},"feature":{"type":"string","default":""},"value":{"type":["string","number"]}}},"jGISFilter":{"title":"IJGISFilter","type":"object","required":["logicalOp","appliedFilters"],"additionalProperties":false,"properties":{"logicalOp":{"type":"string","default":"all"},"appliedFilters":{"type":"array","default":[],"items":{"$ref":"#/definitions/jGISFilterItem"}}}}}}');class u{constructor(e){this._onSharedModelChanged=(e,t)=>{var r;t&&(null===(r=null==t?void 0:t.objectChange)||void 0===r?void 0:r.length)&&(this._contentChanged.emit(void 0),this.dirty=!0)},this.collaborative=!0,this._onClientStateChanged=e=>{const t=this.sharedModel.awareness.getStates();this._clientStateChanged.emit(t),this._sharedModel.awareness.on("change",(e=>{(e.added.length||e.removed.length)&&this._userChanged.emit(this.users)}))},this.defaultKernelName="",this.defaultKernelLanguage="",this._dirty=!1,this._readOnly=!1,this._isDisposed=!1,this._userChanged=new i.Signal(this),this._disposed=new i.Signal(this),this._contentChanged=new i.Signal(this),this._stateChanged=new i.Signal(this),this._themeChanged=new i.Signal(this),this._clientStateChanged=new i.Signal(this);const{sharedModel:t}=e;t?this._sharedModel=t:(this._sharedModel=d.create(),this._sharedModel.changed.connect(this._onSharedModelChanged)),this.sharedModel.awareness.on("change",this._onClientStateChanged)}get sharedModel(){return this._sharedModel}get isDisposed(){return this._isDisposed}get contentChanged(){return this._contentChanged}get stateChanged(){return this._stateChanged}get themeChanged(){return this._themeChanged}get currentUserId(){var e;return null===(e=this.sharedModel)||void 0===e?void 0:e.awareness.clientID}get users(){var e;this._usersMap=null===(e=this._sharedModel)||void 0===e?void 0:e.awareness.getStates();const t=[];return this._usersMap&&this._usersMap.forEach(((e,r)=>{t.push({userId:r,userData:e.user})})),t}get userChanged(){return this._userChanged}get dirty(){return this._dirty}set dirty(e){this._dirty=e}get readOnly(){return this._readOnly}set readOnly(e){this._readOnly=e}get localState(){return this.sharedModel.awareness.getLocalState()}get clientStateChanged(){return this._clientStateChanged}get sharedOptionsChanged(){return this.sharedModel.optionsChanged}get sharedLayersChanged(){return this.sharedModel.layersChanged}get sharedLayerTreeChanged(){return this.sharedModel.layerTreeChanged}get sharedSourcesChanged(){return this.sharedModel.sourcesChanged}get terrainChanged(){return this.sharedModel.terrainChanged}get disposed(){return this._disposed}dispose(){this._isDisposed||(this._isDisposed=!0,this._sharedModel.dispose(),this._disposed.emit(),i.Signal.clearData(this))}toString(){return JSON.stringify(this.getContent(),null,2)}fromString(e){const t=JSON.parse(e),r=(new(n())).compile(l);if(!r(t)){let e="File format errors:\n";for(const t of r.errors||[])e=`${e}- ${t.instancePath} ${t.message}\n`;throw Error(e)}this.sharedModel.transact((()=>{var e,r,s,i,a;this.sharedModel.sources=null!==(e=t.sources)&&void 0!==e?e:{},this.sharedModel.layers=null!==(r=t.layers)&&void 0!==r?r:{},this.sharedModel.layerTree=null!==(s=t.layerTree)&&void 0!==s?s:[],this.sharedModel.terrain=null!==(i=t.terrain)&&void 0!==i?i:{source:"",exaggeration:0},this.sharedModel.options=null!==(a=t.options)&&void 0!==a?a:{latitude:0,longitude:0,zoom:0,bearing:0,pitch:0,projection:"EPSG:3857"}})),this.dirty=!0}toJSON(){return JSON.parse(this.toString())}fromJSON(e){}initialize(){}getWorker(){return u.worker}getContent(){return{sources:this.sharedModel.sources,layers:this.sharedModel.layers,layerTree:this.sharedModel.layerTree,options:this.sharedModel.options,terrain:this.sharedModel.terrain}}setDrive(e,t){this._drive=e,this._filePath=t}getLayers(){return this.sharedModel.layers}getSources(){return this.sharedModel.sources}getLayerTree(){return this.sharedModel.layerTree}getLayer(e){return this.sharedModel.getLayer(e)}getSource(e){return this.sharedModel.getSource(e)}getSourcesByType(e){const t={};for(const r of Object.keys(this.getSources()||{})){const s=this.getSource(r);(null==s?void 0:s.type)===e&&(t[r]=s.name)}return t}getLayersBySource(e){const t=[];return Object.entries(this.getLayers()||{}).forEach((([r,s])=>{var i;(null===(i=s.parameters)||void 0===i?void 0:i.source)===e&&t.push(r)})),t}async readGeoJSON(e){if(!this._drive)return;let t=s.PathExt.dirname(this._filePath);t.includes(":")&&(t=t.split(":")[1]);const r=s.PathExt.join(t,e);return this._drive.get(r).then((e=>JSON.parse(e.content))).catch((e=>{throw e}))}addGroup(e,t,r){if(y.findItemPath(this.getLayerTree(),e).length)return void console.warn(`The group "${t}" already exist in the layer tree`);const s={name:e,layers:[]};this._addLayerTreeItem(s,t,r)}addLayer(e,t,r,s){this.getLayer(e)||this.sharedModel.addLayer(e,t),this._addLayerTreeItem(e,r,s)}removeLayer(e){this._removeLayerTreeLayer(this.getLayerTree(),e),this.sharedModel.removeLayer(e)}setTerrain(e){this._sharedModel.terrain=e}setOptions(e){this._sharedModel.options=e}getOptions(){return this._sharedModel.options}syncSelected(e,t){this.sharedModel.awareness.setLocalStateField("selected",{value:e,emitter:t})}setUserToFollow(e){this._sharedModel&&this._sharedModel.awareness.setLocalStateField("remoteUser",e)}getClientId(){return this.sharedModel.awareness.clientID}_addLayerTreeItem(e,t,r){if(t){const s=this._getLayerTreeInfo(t);s&&(s.workingGroup.layers.splice(null!=r?r:s.workingGroup.layers.length,0,e),this._sharedModel.updateLayerTreeItem(s.mainGroupIndex,s.mainGroup))}else this.sharedModel.addLayerTreeItem(null!=r?r:this.getLayerTree().length,e)}moveItemsToGroup(e,t,r){const s=this.getLayerTree();for(const i of e)if(this.getLayer(i))this._removeLayerTreeLayer(s,i),this._addLayerTreeItem(i,t,r);else{const e=this._getLayerTreeInfo(i);if(void 0===e)continue;const a=Object.assign({},e.workingGroup);this._removeLayerTreeGroup(s,i),this._addLayerTreeItem(a,t,r)}}moveItemRelatedTo(e,t,r){var s;const i=this.getLayerTree();let a;if(this.getLayer(e))this._removeLayerTreeLayer(i,e),a=e;else{const t=this._getLayerTreeInfo(e);if(void 0===t)return;a=Object.assign({},t.workingGroup),this._removeLayerTreeGroup(i,e)}const n=y.findItemPath(i,t),o=(null!==(s=n.pop())&&void 0!==s?s:0)+(r?1:0);let h="",d=n.shift();if(void 0!==d){let e=i[d];for(;n.length&&(d=n.shift(),void 0!==d);)e=e.layers[d];h=e.name}this._addLayerTreeItem(a,h,o)}addNewLayerGroup(e,t){const r=this.getLayerTree();for(const t in e)this._removeLayerTreeLayer(r,t);this._addLayerTreeItem(t)}_removeLayerTreeLayer(e,t){for(let r=0;r<e.length;r++){const s=e[r];"string"==typeof s&&s===t?(e.splice(r,1),r--):"string"!=typeof s&&"layers"in s&&this._removeLayerTreeLayer(s.layers,t)}this.sharedModel.layerTree=e}_removeLayerTreeGroup(e,t){for(let r=0;r<e.length;r++){const s=e[r];"string"!=typeof s&&s.name===t?(e.splice(r,1),r--):"string"!=typeof s&&"layers"in s&&this._removeLayerTreeGroup(s.layers,t)}this.sharedModel.layerTree=e}renameLayerGroup(e,t){const r=this._getLayerTreeInfo(e);r?(r.workingGroup.name=t,this._sharedModel.updateLayerTreeItem(r.mainGroupIndex,r.mainGroup)):console.log("Something went wrong when renaming layer")}removeLayerGroup(e){const t=this.getLayerTree(),r=this._getLayerTreeInfo(e),s=function e(t,r){const s=[];for(const i of t)if("string"==typeof i)s.push(i);else if(i.name!==r){const t=e(i.layers,r);s.push(Object.assign(Object.assign({},i),{layers:t}))}return s}(t,e);r&&this._sharedModel.updateLayerTreeItem(r.mainGroupIndex,s[r.mainGroupIndex])}_getLayerTreeInfo(e){const t=this.getLayerTree(),r=y.findItemPath(t,e);if(!r.length)return void console.warn(`The group "${e}" does not exist in the layer tree`);const s=r.shift();if(void 0===s)return;const i=t[s];let a=i;for(;r.length;){const e=r.shift();if(void 0===e)break;a=a.layers[e]}return{mainGroup:i,workingGroup:a,mainGroupIndex:s}}}var y;!function(e){e.getOrderedLayerIds=function(e){return y.layerTreeRecursion(e.sharedModel.layerTree)}}(u||(u={})),function(e){e.layerTreeRecursion=function e(t,r=[]){for(const s of t)"string"==typeof s?r.push(s):r.push(...e(s.layers));return r},e.findItemPath=function e(t,r,s=[]){for(let i=0;i<t.length;i++){const a=t[i];if("string"==typeof a){if(a===r){const e=[...s];return e.push(i),e}}else{const t=[...s];if(t.push(i),a.name===r)return t;const n=e(a.layers,r,t);if(n.length>t.length)return n}}return s}}(y||(y={}));const p=new h.Token("jupyterGISDocTracker"),c=new h.Token("jupytergisFormSchemaRegistry"),g=new h.Token("jupytergisExternalCommandRegistry"),f=new h.Token("jupytergisExternalCommandRegistry")}}]);