@stlite/desktop 0.47.1 → 0.48.0

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 (42) hide show
  1. package/bin/dump_artifacts.js +1 -1
  2. package/build/asset-manifest.json +20 -20
  3. package/build/index.html +1 -1
  4. package/build/static/css/8957.cd5b39ce.chunk.css +1 -0
  5. package/build/static/js/1122.cbaa29b2.chunk.js +1 -0
  6. package/build/static/js/{144.7b870b6f.chunk.js → 144.a72a0130.chunk.js} +1 -1
  7. package/build/static/js/{1740.893c6c48.chunk.js → 1740.f2cc8a49.chunk.js} +1 -1
  8. package/build/static/js/{2448.e6f85eda.chunk.js → 2448.7dff34e3.chunk.js} +1 -1
  9. package/build/static/js/2694.2ef7325a.chunk.js +2 -0
  10. package/build/static/js/4004.725eef9d.chunk.js +1 -0
  11. package/build/static/js/{4021.ec2e87b0.chunk.js → 4021.d0a55d54.chunk.js} +1 -1
  12. package/build/static/js/{4785.f0fa2d5d.chunk.js → 4785.f21e0ace.chunk.js} +1 -1
  13. package/build/static/js/5599.f94de6cb.chunk.js +1 -0
  14. package/build/static/js/5783.26aeaea5.chunk.js +1 -0
  15. package/build/static/js/6134.243d4a10.chunk.js +1 -0
  16. package/build/static/js/7125.0ba671ec.chunk.js +1 -0
  17. package/build/static/js/7332.71a3c522.chunk.js +1 -0
  18. package/build/static/js/{8050.029f3dc8.chunk.js → 8050.54afb9d0.chunk.js} +1 -1
  19. package/build/static/js/8957.ff10b5e2.chunk.js +1 -0
  20. package/build/static/js/main.b5316fd2.js +28 -0
  21. package/build/static/js/{main.f5b1d852.js.LICENSE.txt → main.b5316fd2.js.LICENSE.txt} +23 -25
  22. package/package.json +8 -8
  23. package/wheels/stlite_server-0.1.0-py3-none-any.whl +0 -0
  24. package/wheels/streamlit-1.32.2-cp311-none-any.whl +0 -0
  25. package/build/static/css/9699.7ce51b75.chunk.css +0 -1
  26. package/build/static/js/1122.422f58fc.chunk.js +0 -1
  27. package/build/static/js/2372.844b5190.chunk.js +0 -2
  28. package/build/static/js/4949.391c96be.chunk.js +0 -2
  29. package/build/static/js/4949.391c96be.chunk.js.LICENSE.txt +0 -45
  30. package/build/static/js/6134.20400e9e.chunk.js +0 -1
  31. package/build/static/js/7125.afecc159.chunk.js +0 -1
  32. package/build/static/js/7332.c686e157.chunk.js +0 -1
  33. package/build/static/js/790.4b5acd65.chunk.js +0 -1
  34. package/build/static/js/9699.fd4930f2.chunk.js +0 -1
  35. package/build/static/js/main.f5b1d852.js +0 -28
  36. package/build/static/media/index.294a0edb7af7d19b781b.cjs +0 -1
  37. package/build/static/media/index.c05687ef19f5bac24939.cjs +0 -1
  38. package/build/static/media/index.cf5b321a6e04bf47c12e.cjs +0 -1
  39. package/build/static/media/index.db61103fb7fdd62b9c44.cjs +0 -1
  40. package/build/static/media/index.f29488c1099d5e3883ac.cjs +0 -1
  41. package/wheels/streamlit-1.31.0-cp311-none-any.whl +0 -0
  42. /package/build/static/js/{2372.844b5190.chunk.js.LICENSE.txt → 2694.2ef7325a.chunk.js.LICENSE.txt} +0 -0
@@ -1,9 +1,3 @@
1
- /*
2
- object-assign
3
- (c) Sindre Sorhus
4
- @license MIT
5
- */
6
-
7
1
  /*!
8
2
  Copyright (c) 2018 Jed Watson.
9
3
  Licensed under the MIT License (MIT), see
@@ -100,7 +94,7 @@ object-assign
100
94
 
101
95
  /**
102
96
  * @license React
103
- * react-is.production.min.js
97
+ * react-dom.production.min.js
104
98
  *
105
99
  * Copyright (c) Facebook, Inc. and its affiliates.
106
100
  *
@@ -109,16 +103,8 @@ object-assign
109
103
  */
110
104
 
111
105
  /**
112
- * Prism: Lightweight, robust, elegant syntax highlighting
113
- *
114
- * @license MIT <https://opensource.org/licenses/MIT>
115
- * @author Lea Verou <https://lea.verou.me>
116
- * @namespace
117
- * @public
118
- */
119
-
120
- /** @license React v0.20.2
121
- * scheduler.production.min.js
106
+ * @license React
107
+ * react-is.production.min.js
122
108
  *
123
109
  * Copyright (c) Facebook, Inc. and its affiliates.
124
110
  *
@@ -126,8 +112,9 @@ object-assign
126
112
  * LICENSE file in the root directory of this source tree.
127
113
  */
128
114
 
129
- /** @license React v16.13.1
130
- * react-is.production.min.js
115
+ /**
116
+ * @license React
117
+ * react-jsx-runtime.production.min.js
131
118
  *
132
119
  * Copyright (c) Facebook, Inc. and its affiliates.
133
120
  *
@@ -135,8 +122,9 @@ object-assign
135
122
  * LICENSE file in the root directory of this source tree.
136
123
  */
137
124
 
138
- /** @license React v17.0.2
139
- * react-dom.production.min.js
125
+ /**
126
+ * @license React
127
+ * react.production.min.js
140
128
  *
141
129
  * Copyright (c) Facebook, Inc. and its affiliates.
142
130
  *
@@ -144,8 +132,9 @@ object-assign
144
132
  * LICENSE file in the root directory of this source tree.
145
133
  */
146
134
 
147
- /** @license React v17.0.2
148
- * react-jsx-runtime.production.min.js
135
+ /**
136
+ * @license React
137
+ * scheduler.production.min.js
149
138
  *
150
139
  * Copyright (c) Facebook, Inc. and its affiliates.
151
140
  *
@@ -153,8 +142,17 @@ object-assign
153
142
  * LICENSE file in the root directory of this source tree.
154
143
  */
155
144
 
156
- /** @license React v17.0.2
157
- * react.production.min.js
145
+ /**
146
+ * Prism: Lightweight, robust, elegant syntax highlighting
147
+ *
148
+ * @license MIT <https://opensource.org/licenses/MIT>
149
+ * @author Lea Verou <https://lea.verou.me>
150
+ * @namespace
151
+ * @public
152
+ */
153
+
154
+ /** @license React v16.13.1
155
+ * react-is.production.min.js
158
156
  *
159
157
  * Copyright (c) Facebook, Inc. and its affiliates.
160
158
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stlite/desktop",
3
- "version": "0.47.1",
3
+ "version": "0.48.0",
4
4
  "license": "Apache-2.0",
5
5
  "homepage": "/",
6
6
  "main": "./build/electron/main.js",
@@ -60,11 +60,11 @@
60
60
  },
61
61
  "devDependencies": {
62
62
  "@craco/craco": "^7.0.0",
63
- "@stlite/common": "^0.47.1",
64
- "@stlite/common-react": "^0.47.1",
65
- "@stlite/kernel": "^0.47.1",
66
- "@streamlit/app": "1.31.0",
67
- "@testing-library/react": "^12.1.4",
63
+ "@stlite/common": "^0.48.0",
64
+ "@stlite/common-react": "^0.48.0",
65
+ "@stlite/kernel": "^0.48.0",
66
+ "@streamlit/app": "1.32.2",
67
+ "@testing-library/react": "^14.1.2",
68
68
  "@testing-library/user-event": "^14.0.0",
69
69
  "@types/jest": "^27.4.3",
70
70
  "@types/node": "^16.18.12",
@@ -77,8 +77,8 @@
77
77
  "esbuild": "^0.20.0",
78
78
  "parquet-wasm": "^0.4.0",
79
79
  "raw-loader": "^4.0.2",
80
- "react": "^17.0.2",
81
- "react-dom": "^17.0.2",
80
+ "react": "^18.2.0",
81
+ "react-dom": "^18.2.0",
82
82
  "react-scripts": "5.0.1",
83
83
  "react-toastify": "^9.1.1",
84
84
  "ts-node": "^10.9.1",
@@ -1 +0,0 @@
1
- .d1t1th9s{--overlay-top:var(--d1t1th9s-0);box-sizing:border-box;display:flex;flex-direction:column;font-family:var(--gdg-font-family);font-size:var(--gdg-editor-font-size);left:var(--d1t1th9s-1);max-height:calc(100vh - var(--d1t1th9s-5));max-width:400px;min-height:var(--d1t1th9s-4);min-width:var(--d1t1th9s-3);overflow:hidden;position:absolute;text-align:start;top:var(--d1t1th9s-2);width:-moz-max-content;width:max-content}@keyframes glide_fade_in-d1t1th9s{0%{opacity:0}to{opacity:100%}}.d1t1th9s.gdg-style{animation:glide_fade_in-d1t1th9s 60ms 1;background-color:var(--gdg-bg-cell);border-radius:2px;box-shadow:0 0 0 1px var(--gdg-accent-color),0 0 1px rgba(62,65,86,.4),0 6px 12px rgba(62,65,86,.15)}.d1t1th9s.pad{padding:var(--d1t1th9s-6) 8.5px 3px}.d1t1th9s .clip-region{border-radius:2px;display:flex;flex-direction:column;flex-grow:1;overflow-x:hidden;overflow-y:auto}.d1t1th9s .clip-region .gdg-growing-entry{height:100%}.d1t1th9s .clip-region input.gdg-input{border:0;outline:none;width:100%}.d1t1th9s .clip-region textarea.gdg-input{border:0;outline:none}.m15w2ly5{background-color:var(--gdg-bg-cell);background:linear-gradient(var(--gdg-bg-cell),var(--gdg-bg-cell-medium));border-radius:4px;bottom:44px;box-shadow:0 0 0 1px var(--gdg-border-color),0 2px 5px rgba(0,0,0,.08);overflow:hidden;position:absolute;right:44px;z-index:1}.m15w2ly5 .header{background-color:var(--gdg-bg-header);box-shadow:0 0 0 1px var(--gdg-border-color);height:4px;left:0;position:absolute;top:0;width:100%}.m15w2ly5 .locationMarker{background-color:var(--gdg-accent-light);border:1px solid var(--gdg-accent-color);position:absolute}.s1jz82f8 .dvn-scroller{overflow:var(--s1jz82f8-0);transform:translateZ(0)}.s1jz82f8 .hidden{visibility:hidden}.s1jz82f8 .dvn-scroll-inner{display:flex;pointer-events:none}.s1jz82f8 .dvn-scroll-inner>*{flex-shrink:0}.s1jz82f8 .dvn-scroll-inner .dvn-spacer{flex-grow:1}.s1jz82f8 .dvn-scroll-inner .dvn-stack{display:flex;flex-direction:column}.s1jz82f8 .dvn-underlay>*{left:0;position:absolute;top:0}.s1jz82f8 canvas{outline:none}.s1jz82f8 canvas *{height:0}.sxep88s{background-color:var(--gdg-bg-cell);border:1px solid var(--gdg-border-color);border-radius:6px;color:var(--gdg-text-dark);font-size:var(--gdg-editor-font-size);padding:8px;position:absolute;right:20px;top:4px;transform:translateX(var(--sxep88s-0));transition:transform .15s}.sxep88s .search-bar-inner{display:flex}.sxep88s .search-status{font-size:11px;padding-top:4px}.sxep88s .search-progress{background-color:var(--gdg-text-light);bottom:0;height:4px;left:0;position:absolute}.sxep88s input{background-color:var(--gdg-bg-cell);border:0;color:var(--gdg-textDark);outline:none;width:220px}.sxep88s button{align-items:center;background:none;border:none;color:var(--gdg-text-medium);cursor:pointer;display:flex;height:24px;justify-content:center;outline:none;padding:0;width:24px}.sxep88s button:hover{color:var(--gdg-text-dark)}.sxep88s button .button-icon{height:16px;width:16px}.sxep88s button:disabled{opacity:.4;pointer-events:none}.r1kzy40b{background-color:var(--gdg-bg-header-has-focus);border:none;border-radius:9px;box-shadow:0 0 0 1px var(--gdg-border-color);color:var(--gdg-text-group-header);flex-grow:1;font:var(--gdg-header-font-style) var(--gdg-font-family);min-height:var(--r1kzy40b-0);outline:none;padding:0 8px}.c1sqdbw3{align-items:center;background-color:var(--gdg-bg-header);display:flex;padding:0 8px}.wzg2m5k{contain:strict;direction:ltr;height:var(--wzg2m5k-1);max-height:100%;max-width:100%;min-height:10px;min-width:10px;overflow:hidden;overflow:clip;position:relative;width:var(--wzg2m5k-0)}.wzg2m5k>:first-child{height:100%;left:0;position:absolute;top:0;width:100%}.b1bqsp5z{display:flex;flex-wrap:wrap}.b1bqsp5z .boe-bubble{align-items:center;background-color:var(--gdg-bg-bubble);border-radius:100px;color:var(--gdg-text-dark);display:flex;height:20px;justify-content:center;margin:2px;padding:0 8px}.b1bqsp5z textarea{height:0;left:0;opacity:0;position:absolute;top:0;width:0}.df2kt4a{display:flex;flex-wrap:wrap}.df2kt4a .doe-bubble{align-items:center;background-color:var(--gdg-bg-cell);border-radius:100px;border-radius:6px;box-shadow:0 0 1px rgba(62,65,86,.4),0 1px 3px rgba(62,65,86,.4);color:var(--gdg-text-dark);display:flex;height:24px;justify-content:center;margin:2px;padding:0 8px}.df2kt4a .doe-bubble img{height:16px;margin-right:4px;-o-object-fit:contain;object-fit:contain}.df2kt4a textarea{height:0;left:0;opacity:0;position:absolute;top:0;width:0}.i1eozt10{display:flex;height:100%}.i1eozt10 .centering-container{align-items:center;display:flex;height:100%;justify-content:center}.i1eozt10 .centering-container canvas,.i1eozt10 .centering-container img{max-height:calc(100vh - var(--overlay-top) - 20px);-o-object-fit:contain;object-fit:contain;-webkit-user-select:none;-moz-user-select:none;user-select:none}.i1eozt10 .centering-container canvas{max-width:380px}.i1eozt10 .edit-icon{align-items:center;color:var(--gdg-accent-color);cursor:pointer;display:flex;height:48px;justify-content:center;position:absolute;right:0;top:12px;width:48px}.i1eozt10 .edit-icon>*{height:24px;width:24px}.i1eozt10 textarea{height:0;left:0;opacity:0;position:absolute;top:0;width:0}.mlbeo71{-webkit-touch-callout:default;padding-top:6px;word-break:break-word}.mlbeo71>*{margin:0}.mlbeo71 :last-child{margin-bottom:0}.ijuk0po,.mlbeo71 p img{width:100%}.ijuk0po{background-color:transparent;border:0;border-radius:0;bottom:0;color:var(--gdg-text-dark);font-family:var(--gdg-font-family);font-size:var(--gdg-editor-font-size);height:100%;left:0;line-height:16px;margin:0;min-width:100%;overflow:hidden;padding:0;position:absolute;resize:none;right:0;top:0;white-space:pre-wrap}.ijuk0po::-moz-placeholder{color:var(--gdg-text-light)}.ijuk0po::placeholder{color:var(--gdg-text-light)}.invalid .ijuk0po{-webkit-text-decoration:underline;text-decoration:underline;text-decoration-color:#d60606}.saq3p5l{word-wrap:break-word;color:var(--gdg-text-dark);font-family:var(--gdg-font-family);font-size:var(--gdg-editor-font-size);line-height:16px;margin:0;max-width:100%;min-width:100%;padding:0 0 2px;visibility:hidden;white-space:pre-wrap;width:-moz-max-content;width:max-content}.gf8vzix{margin-top:6px;position:relative}.mdwzdl1{align-items:flex-start;color:var(--gdg-text-dark);display:flex;justify-content:space-between;min-width:var(--mdwzdl1-0);position:relative;width:100%}.mdwzdl1 .gf8vzix{flex-shrink:1;min-width:0}.mdwzdl1 .spacer{flex:1 1}.mdwzdl1 .edit-icon{align-items:center;border-radius:6px;color:var(--gdg-accent-color);cursor:pointer;display:flex;flex-shrink:0;height:24px;justify-content:center;padding:0;position:relative;transition:all "0.125s ease";width:24px}.mdwzdl1 .edit-icon>*{height:16px;width:16px}.mdwzdl1 .edit-hover:hover{background-color:var(--gdg-accent-light);transition:background-color .15s}.mdwzdl1 .checkmark-hover:hover{background-color:var(--gdg-accent-color);color:#fff}.mdwzdl1 .md-edit-textarea{height:0;left:0;margin-top:25px;opacity:0;padding:0;position:relative;top:0;width:0}.mdwzdl1 .ml-6{margin-left:6px}.n1czszh3{display:flex;margin:6px 0 3px}.n1czszh3,.n1czszh3>input{color:var(--gdg-text-dark)}.n1czszh3>input{background-color:var(--gdg-bg-cell);font-family:var(--gdg-font-family);font-size:var(--gdg-editor-font-size);padding:0}.uf0sjo8{align-items:center;display:flex;flex-grow:1;min-height:21px}.uf0sjo8 .link-area{color:var(--gdg-link-color);cursor:pointer;flex-grow:1;flex-shrink:1;margin-right:8px;overflow:hidden;-webkit-text-decoration:underline!important;text-decoration:underline!important;text-overflow:ellipsis;white-space:nowrap}.uf0sjo8 .edit-icon{align-items:center;color:var(--gdg-accent-color);cursor:pointer;display:flex;flex-shrink:0;justify-content:center;width:32px}.uf0sjo8 .edit-icon>*{height:24px;width:24px}.uf0sjo8 textarea{height:0;left:0;opacity:0;position:absolute;top:0;width:0}.e17a8fyf{align-items:center;color:var(--gdg-text-light);display:flex;padding:6px 0}.e17a8fyf .active{color:var(--gdg-text-dark)}.e17a8fyf>*{cursor:pointer;height:16px;margin-right:2px;position:relative;width:16px}.e17a8fyf>* svg{height:100%;width:100%}.e43amum{align-items:stretch;color:var(--gdg-text-dark);display:flex;flex-direction:column;padding-top:6px}.e43amum,.e43amum *{box-sizing:border-box}.e43amum.e43amum.e43amum.e43amum label{cursor:pointer;display:flex}.e43amum.e43amum.e43amum.e43amum label input{cursor:pointer;width:auto}.e43amum.e43amum.e43amum.e43amum label .pill{align-items:center;background-color:var(--gdg-bg-bubble);border-radius:var(--e43amum-0);display:flex;font:12px var(--gdg-font-family);margin-bottom:6px;margin-left:8px;margin-right:6px;min-height:var(--e43amum-1);padding:2px var(--e43amum-2);transition:box-shadow .15s}.e43amum.e43amum.e43amum.e43amum label .pill.unselected{opacity:.8}.e43amum label:hover .pill{box-shadow:0 1px 4px rgba(0,0,0,.15)}.e43amum.e43amum.e43amum.e43amum.readonly label{cursor:default}.e43amum.e43amum.e43amum.e43amum.readonly label .pill{box-shadow:none!important}.w13j932a{align-items:stretch;display:flex;flex-direction:column}.p19663q2,.w13j932a .glide-select{font-family:var(--gdg-font-family);font-size:var(--gdg-editor-font-size)}.p19663q2{color:var(--gdg-text-dark)}.p19663q2>div{border:1px solid var(--gdg-border-color);border-radius:4px}.r1jyvvws{display:"flex";margin:auto 8.5px;padding-bottom:3px}.wkyirgj .footer{display:flex;justify-content:flex-end;padding:20px}.wkyirgj .footer button{border:none;border-radius:9px;cursor:pointer;font-family:var(--gdg-font-family);font-size:14px;font-weight:500;padding:8px 16px}.wkyirgj .save-button{background-color:var(--gdg-accent-color);color:var(--gdg-accent-fg)}.wkyirgj .close-button{background-color:var(--gdg-bg-header);color:var(--gdg-text-medium);margin-right:8px}.s1sdc9r3{background-color:transparent;border:none;color:var(--gdg-text-dark);font-family:var(--gdg-font-family);font-size:var(--gdg-editor-font-size);min-height:26px;outline:none}.s1sdc9r3::-webkit-calendar-picker-indicator{background-color:#fff}.lneeve5{display:flex;flex-direction:column;margin:4px 0}.lneeve5>button{align-self:flex-end;background-color:transparent;border:none;border-radius:4px;color:var(--gdg-accent-color);cursor:pointer;font-weight:600;outline:none;padding:6px 8px;transition:background-color .2s}.lneeve5>button:focus-visible,.lneeve5>button:hover{background-color:var(--gdg-accent-light)}.lneeve5>button:disabled{opacity:.4;pointer-events:none}.lneeve5 .gdg-link-title-editor{display:flex;min-width:250px}.lneeve5 .gdg-link-title-editor>input{border:1px solid var(--gdg-border-color);border-radius:4px;box-shadow:none;flex-grow:1;min-width:0;outline:none;padding:6px 8px;transition:border .2s;width:0}.lneeve5 .gdg-link-title-editor>input:not(:last-child){margin-right:4px}.lneeve5 .gdg-link-title-editor>input:focus{border:1px solid var(--gdg-accent-color)}.lneeve5 .gdg-link-title-editor:not(:last-child){margin-bottom:4px}.lneeve5 .gdg-link-title-editor>button{background-color:transparent;border:none;border-radius:4px;color:var(--gdg-text-medium);cursor:pointer;outline:none;transition:background-color .2s,color .2s}.lneeve5 .gdg-link-title-editor>button:focus-visible,.lneeve5 .gdg-link-title-editor>button:hover{background-color:var(--gdg-accent-light);color:var(--gdg-text-dark)}
@@ -1 +0,0 @@
1
- "use strict";(globalThis.webpackChunk_stlite_desktop=globalThis.webpackChunk_stlite_desktop||[]).push([[1122],{21122:(t,e,i)=>{i.r(e),i.d(e,{default:()=>L});var o=i(5057),s=i(59663),n=i(41656),a=i(50482),r=i.n(a),h=i(87333),c=i(47206),l=i(96601),p=i(72212),d=i(80552),m=i(13012),g=i(65815),u=i(50256),w=i(98899),x=i(31324),b=i(719),k=i(50651),S=i(64327),y=i(56129),v=i.n(y),j=i(87672),T=i(96266);const f=t=>{let{error:e,width:i,deltaType:o}=t;return e instanceof J?(0,T.jsx)(j.Z,{width:i,name:"No Mapbox token provided",message:(0,T.jsxs)(T.Fragment,{children:[(0,T.jsxs)("p",{children:["To use ",(0,T.jsxs)("code",{children:["st.",o]})," or ",(0,T.jsx)("code",{children:"st.map"})," you need to set up a Mapbox access token."]}),(0,T.jsxs)("p",{children:["To get a token, create an account at"," ",(0,T.jsx)("a",{href:"https://mapbox.com",children:"https://mapbox.com"}),". It's free for moderate usage levels!"]}),(0,T.jsxs)("p",{children:["Once you have a token, just set it using the Streamlit config option ",(0,T.jsx)("code",{children:"mapbox.token"})," and don't forget to restart your Streamlit server at this point if it's still running, then reload this tab."]}),(0,T.jsxs)("p",{children:["See"," ",(0,T.jsx)("a",{href:"https://docs.streamlit.io/library/advanced-features/configuration#view-all-configuration-options",children:"our documentation"})," ","for more info on how to set config options."]})]})}):e instanceof Z?(0,T.jsx)(j.Z,{width:i,name:"Error fetching Streamlit Mapbox token",message:(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)("p",{children:"This app requires an internet connection."}),(0,T.jsx)("p",{children:"Please check your connection and try again."}),(0,T.jsxs)("p",{children:["If you think this is a bug, please file bug report"," ",(0,T.jsx)("a",{href:"https://github.com/streamlit/streamlit/issues/new/choose",children:"here"}),"."]})]})}):(0,T.jsx)(j.Z,{width:i,name:"Error fetching Streamlit Mapbox token",message:e.message})};var V=i(51673),C=i(30147),F=i(31808);class J extends Error{}class Z extends Error{}const E="https://data.streamlit.io/tokens.json",z="mapbox",M=t=>e=>{class i extends o.PureComponent{constructor(i){super(i),this.initMapboxToken=async()=>{try{const t=await V.Z.get(E),{[z]:e}=t.data;if(!e)throw new Error("Missing token ".concat(z));this.setState({mapboxToken:e,isFetching:!1})}catch(t){const e=(0,S.b)(t);throw this.setState({mapboxTokenError:e,isFetching:!1}),new Z("".concat(e.message," (").concat(E,")"))}},this.render=()=>{const{mapboxToken:i,mapboxTokenError:o,isFetching:s}=this.state,{width:n}=this.props;return o?(0,T.jsx)(f,{width:n,error:o,deltaType:t}):s?(0,T.jsx)(C.O,{}):(0,T.jsx)(e,{...this.props,mapboxToken:i,width:n})},this.state={isFetching:!0,mapboxToken:void 0,mapboxTokenError:void 0}}componentDidMount(){const t=this.props.element.mapboxToken||this.context.libConfig.mapboxToken;t?this.setState({mapboxToken:t,isFetching:!1}):this.initMapboxToken()}}return i.displayName="withMapboxToken(".concat(e.displayName||e.name,")"),i.contextType=F.E,v()(i,e)};var D=i(82160);const I=(0,D.Z)("div",{target:"e1az0zs51"})((t=>{let{width:e,height:i,theme:o}=t;return{marginTop:o.spacing.sm,position:"relative",height:i,width:e}}),""),O=(0,D.Z)("div",{target:"e1az0zs50"})((t=>{let{theme:e}=t;return{position:"absolute",right:"2.625rem",top:e.spacing.md,zIndex:1,"button:not(:disabled)":{background:e.colors.bgColor,"& + button":{borderTopColor:e.colors.secondaryBg},"& span":{filter:(0,l.Iy)(e)?"":"invert(100%)"}}}}),"");i(20512);const P={classes:{...p,...g,...m,...u}};(0,b.fh)([w.w,x.E]);const N=new d.Z({configuration:P});class _ extends o.PureComponent{constructor(){super(...arguments),this.state={viewState:{bearing:0,pitch:0,zoom:11},initialized:!1,initialViewState:{},id:void 0,pydeckJson:void 0,isFullScreen:!1,isLightTheme:(0,l.Iy)(this.props.theme)},this.componentDidMount=()=>{this.setState({initialized:!0})},this.createTooltip=t=>{const{element:e}=this.props;if(!t||!t.object||!e.tooltip)return!1;const i=n.Z.parse(e.tooltip);return i.html?i.html=this.interpolate(t,i.html):i.text=this.interpolate(t,i.text),i},this.interpolate=(t,e)=>{const i=e.match(/{(.*?)}/g);return i&&i.forEach((i=>{const o=i.substring(1,i.length-1);t.object.hasOwnProperty(o)&&(e=e.replace(i,t.object[o]))})),e},this.onViewStateChange=t=>{let{viewState:e}=t;this.setState({viewState:e})}}static getDerivedStateFromProps(t,e){const i=_.getDeckObject(t,e);if(!r()(i.initialViewState,e.initialViewState)){const t=Object.keys(i.initialViewState).reduce(((t,o)=>i.initialViewState[o]===e.initialViewState[o]?t:{...t,[o]:i.initialViewState[o]}),{});return{viewState:{...e.viewState,...t},initialViewState:i.initialViewState}}return null}render(){const t=_.getDeckObject(this.props,this.state),{viewState:e}=this.state;return(0,T.jsx)(I,{className:"stDeckGlJsonChart",width:t.initialViewState.width,height:t.initialViewState.height,"data-testid":"stDeckGlJsonChart",children:(0,T.jsxs)(s.Z,{viewState:e,onViewStateChange:this.onViewStateChange,height:t.initialViewState.height,width:t.initialViewState.width,layers:this.state.initialized?t.layers:[],getTooltip:this.createTooltip,ContextProvider:h.X$.Provider,controller:!0,children:[(0,T.jsx)(h.Z3,{height:t.initialViewState.height,width:t.initialViewState.width,mapStyle:t.mapStyle&&("string"===typeof t.mapStyle?t.mapStyle:t.mapStyle[0]),mapboxApiAccessToken:this.props.element.mapboxToken||this.props.mapboxToken}),(0,T.jsx)(O,{children:(0,T.jsx)(h.Pv,{className:"zoomButton",showCompass:!1})})]})})}}_.getDeckObject=(t,e)=>{var i,o;const{element:s,width:a,height:r,theme:h,isFullScreen:c}=t,p=null!==c&&void 0!==c&&c;var d,m;(s.id===e.id&&e.isFullScreen===p&&e.isLightTheme===(0,l.Iy)(h)||(e.pydeckJson=n.Z.parse(s.json),e.id=s.id),null!==(i=e.pydeckJson)&&void 0!==i&&i.mapStyle||(e.pydeckJson.mapStyle="mapbox://styles/mapbox/".concat((0,l.Iy)(h)?"light":"dark","-v9")),c)?Object.assign(null===(d=e.pydeckJson)||void 0===d?void 0:d.initialViewState,{width:a,height:r}):(null!==(m=e.pydeckJson)&&void 0!==m&&null!==(m=m.initialViewState)&&void 0!==m&&m.height||(e.pydeckJson.initialViewState.height=500),s.useContainerWidth&&(e.pydeckJson.initialViewState.width=a));return e.isFullScreen=c,e.isLightTheme=(0,l.Iy)(h),null===(o=e.pydeckJson)||void 0===o||delete o.views,N.convert(e.pydeckJson)};const L=(0,c.b)(M("st.pydeck_chart")((0,k.Z)(_)))}}]);