streamlit-nightly 1.36.1.dev20240717__py2.py3-none-any.whl → 1.36.1.dev20240719__py2.py3-none-any.whl
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.
- streamlit/elements/widgets/button_group.py +1 -10
- streamlit/runtime/fragment.py +5 -2
- streamlit/static/asset-manifest.json +4 -4
- streamlit/static/index.html +1 -1
- streamlit/static/static/js/{1116.841caf48.chunk.js → 1116.f824d083.chunk.js} +1 -1
- streamlit/static/static/js/8536.44f53d6e.chunk.js +1 -0
- streamlit/static/static/js/main.d55f6a3c.js +2 -0
- streamlit/string_util.py +8 -4
- streamlit/web/server/app_static_file_handler.py +3 -1
- {streamlit_nightly-1.36.1.dev20240717.dist-info → streamlit_nightly-1.36.1.dev20240719.dist-info}/METADATA +1 -1
- {streamlit_nightly-1.36.1.dev20240717.dist-info → streamlit_nightly-1.36.1.dev20240719.dist-info}/RECORD +16 -16
- {streamlit_nightly-1.36.1.dev20240717.dist-info → streamlit_nightly-1.36.1.dev20240719.dist-info}/WHEEL +1 -1
- streamlit/static/static/js/8536.f7b26b02.chunk.js +0 -1
- streamlit/static/static/js/main.917a5920.js +0 -2
- /streamlit/static/static/js/{main.917a5920.js.LICENSE.txt → main.d55f6a3c.js.LICENSE.txt} +0 -0
- {streamlit_nightly-1.36.1.dev20240717.data → streamlit_nightly-1.36.1.dev20240719.data}/scripts/streamlit.cmd +0 -0
- {streamlit_nightly-1.36.1.dev20240717.dist-info → streamlit_nightly-1.36.1.dev20240719.dist-info}/entry_points.txt +0 -0
- {streamlit_nightly-1.36.1.dev20240717.dist-info → streamlit_nightly-1.36.1.dev20240719.dist-info}/top_level.txt +0 -0
@@ -78,16 +78,7 @@ _NUMBER_STARS: Final = 5
|
|
78
78
|
_STAR_ICON: Final = ":material/star:"
|
79
79
|
# we don't have the filled-material icon library as a dependency. Hence, we have it here
|
80
80
|
# in base64 format and send it over the wire as an image.
|
81
|
-
_SELECTED_STAR_ICON: Final =
|
82
|
-
"<img src='data:image/svg+xml;base64,"
|
83
|
-
"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0i"
|
84
|
-
"MCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjNWY2MzY4Ij48cGF0aCBkPSJNNDgwLTI2OSAz"
|
85
|
-
"MTQtMTY5cS0xMSA3LTIzIDZ0LTIxLThxLTktNy0xNC0xNy41dC0yLTIzLjVsNDQtMTg5LTE0Ny0xMjdxLTEwL"
|
86
|
-
"TktMTIuNS0yMC41VDE0MC01NzFxNC0xMSAxMi0xOHQyMi05bDE5NC0xNyA3NS0xNzhxNS0xMiAxNS41LTE4dDI"
|
87
|
-
"xLjUtNnExMSAwIDIxLjUgNnQxNS41IDE4bDc1IDE3OCAxOTQgMTdxMTQgMiAyMiA5dDEyIDE4cTQgMTEgMS41I"
|
88
|
-
"DIyLjVUODA5LTUyOEw2NjItNDAxbDQ0IDE4OXEzIDEzLTIgMjMuNVQ2OTAtMTcxcS05IDctMjEgOHQtMjMtNkw"
|
89
|
-
"0ODAtMjY5WiIvPjwvc3ZnPg=='/>"
|
90
|
-
)
|
81
|
+
_SELECTED_STAR_ICON: Final = ":material/star_filled:"
|
91
82
|
|
92
83
|
_FeedbackOptions: TypeAlias = Literal["thumbs", "faces", "stars"]
|
93
84
|
|
streamlit/runtime/fragment.py
CHANGED
@@ -193,7 +193,10 @@ def _fragment(
|
|
193
193
|
ctx.new_fragment_ids.add(fragment_id)
|
194
194
|
# Set ctx.current_fragment_id so that elements corresponding to this
|
195
195
|
# fragment get tagged with the appropriate ID. ctx.current_fragment_id gets
|
196
|
-
# reset after the fragment function finishes running
|
196
|
+
# reset after the fragment function finishes running to either return to the
|
197
|
+
# script (outside of any fragments) or to the outer fragment this one is
|
198
|
+
# nested in.
|
199
|
+
prev_fragment_id = ctx.current_fragment_id
|
197
200
|
ctx.current_fragment_id = fragment_id
|
198
201
|
|
199
202
|
try:
|
@@ -245,7 +248,7 @@ def _fragment(
|
|
245
248
|
raise FragmentHandledException(e)
|
246
249
|
return result
|
247
250
|
finally:
|
248
|
-
ctx.current_fragment_id =
|
251
|
+
ctx.current_fragment_id = prev_fragment_id
|
249
252
|
ctx.current_fragment_delta_path = []
|
250
253
|
|
251
254
|
if not ctx.fragment_storage.contains(fragment_id):
|
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"files": {
|
3
3
|
"main.css": "./static/css/main.29bca1b5.css",
|
4
|
-
"main.js": "./static/js/main.
|
4
|
+
"main.js": "./static/js/main.d55f6a3c.js",
|
5
5
|
"static/js/9336.3e046ad7.chunk.js": "./static/js/9336.3e046ad7.chunk.js",
|
6
6
|
"static/js/9330.2b4c99e0.chunk.js": "./static/js/9330.2b4c99e0.chunk.js",
|
7
7
|
"static/js/2736.7d516fcc.chunk.js": "./static/js/2736.7d516fcc.chunk.js",
|
@@ -12,7 +12,7 @@
|
|
12
12
|
"static/js/5441.324eb9ab.chunk.js": "./static/js/5441.324eb9ab.chunk.js",
|
13
13
|
"static/js/8427.5192ee0c.chunk.js": "./static/js/8427.5192ee0c.chunk.js",
|
14
14
|
"static/js/7323.b74cc85b.chunk.js": "./static/js/7323.b74cc85b.chunk.js",
|
15
|
-
"static/js/8536.
|
15
|
+
"static/js/8536.44f53d6e.chunk.js": "./static/js/8536.44f53d6e.chunk.js",
|
16
16
|
"static/js/7805.acc6316a.chunk.js": "./static/js/7805.acc6316a.chunk.js",
|
17
17
|
"static/js/4500.be0eb305.chunk.js": "./static/js/4500.be0eb305.chunk.js",
|
18
18
|
"static/js/1307.36b77087.chunk.js": "./static/js/1307.36b77087.chunk.js",
|
@@ -21,7 +21,7 @@
|
|
21
21
|
"static/js/1168.14f7c6ff.chunk.js": "./static/js/1168.14f7c6ff.chunk.js",
|
22
22
|
"static/js/178.7bea8c5d.chunk.js": "./static/js/178.7bea8c5d.chunk.js",
|
23
23
|
"static/js/1792.8bd6ce2a.chunk.js": "./static/js/1792.8bd6ce2a.chunk.js",
|
24
|
-
"static/js/1116.
|
24
|
+
"static/js/1116.f824d083.chunk.js": "./static/js/1116.f824d083.chunk.js",
|
25
25
|
"static/js/3513.7dedbda2.chunk.js": "./static/js/3513.7dedbda2.chunk.js",
|
26
26
|
"static/js/7602.a20a999b.chunk.js": "./static/js/7602.a20a999b.chunk.js",
|
27
27
|
"static/js/6013.f6083314.chunk.js": "./static/js/6013.f6083314.chunk.js",
|
@@ -152,6 +152,6 @@
|
|
152
152
|
},
|
153
153
|
"entrypoints": [
|
154
154
|
"static/css/main.29bca1b5.css",
|
155
|
-
"static/js/main.
|
155
|
+
"static/js/main.d55f6a3c.js"
|
156
156
|
]
|
157
157
|
}
|
streamlit/static/index.html
CHANGED
@@ -1 +1 @@
|
|
1
|
-
<!doctype html><html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no"/><link rel="shortcut icon" href="./favicon.png"/><link rel="preload" href="./static/media/SourceSansPro-Regular.0d69e5ff5e92ac64a0c9.woff2" as="font" type="font/woff2" crossorigin><link rel="preload" href="./static/media/SourceSansPro-SemiBold.abed79cd0df1827e18cf.woff2" as="font" type="font/woff2" crossorigin><link rel="preload" href="./static/media/SourceSansPro-Bold.118dea98980e20a81ced.woff2" as="font" type="font/woff2" crossorigin><title>Streamlit</title><script>window.prerenderReady=!1</script><script defer="defer" src="./static/js/main.
|
1
|
+
<!doctype html><html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no"/><link rel="shortcut icon" href="./favicon.png"/><link rel="preload" href="./static/media/SourceSansPro-Regular.0d69e5ff5e92ac64a0c9.woff2" as="font" type="font/woff2" crossorigin><link rel="preload" href="./static/media/SourceSansPro-SemiBold.abed79cd0df1827e18cf.woff2" as="font" type="font/woff2" crossorigin><link rel="preload" href="./static/media/SourceSansPro-Bold.118dea98980e20a81ced.woff2" as="font" type="font/woff2" crossorigin><title>Streamlit</title><script>window.prerenderReady=!1</script><script defer="defer" src="./static/js/main.d55f6a3c.js"></script><link href="./static/css/main.29bca1b5.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
|
@@ -1 +1 @@
|
|
1
|
-
"use strict";(self.webpackChunk_streamlit_app=self.webpackChunk_streamlit_app||[]).push([[1116],{81116:(e,t,r)=>{r.r(t),r.d(t,{default:()=>
|
1
|
+
"use strict";(self.webpackChunk_streamlit_app=self.webpackChunk_streamlit_app||[]).push([[1116],{81116:(e,t,r)=>{r.r(t),r.d(t,{default:()=>M});var n=r(66845),o=r(25621),i=r(62813),c=r.n(i),a=Object.freeze({radio:"radio",checkbox:"checkbox"}),l=(Object.freeze({change:"change"}),"default"),u=r(80318),s=r(99282),f=(0,r(80745).zo)("div",(function(e){var t=e.$shape,r=e.$length,n=e.$theme,o=1===r?void 0:t!==l?"-".concat(n.sizing.scale100):"-0.5px";return{display:"flex",marginLeft:o,marginRight:o}}));function d(e){return d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},d(e)}function p(){return p=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},p.apply(this,arguments)}function h(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function y(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?h(Object(r),!0).forEach((function(t){C(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):h(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function b(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==r)return;var n,o,i=[],c=!0,a=!1;try{for(r=r.call(e);!(c=(n=r.next()).done)&&(i.push(n.value),!t||i.length!==t);c=!0);}catch(l){a=!0,o=l}finally{try{c||null==r.return||r.return()}finally{if(a)throw o}}return i}(e,t)||function(e,t){if(!e)return;if("string"===typeof e)return m(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return m(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function m(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function v(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function g(e,t){return g=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},g(e,t)}function O(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=w(e);if(t){var o=w(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return function(e,t){if(t&&("object"===d(t)||"function"===typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return E(e)}(this,r)}}function E(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function w(e){return w=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},w(e)}function C(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}f.displayName="StyledRoot",f.displayName="StyledRoot";var j=function(e){!function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&g(e,t)}(c,e);var t,r,o,i=O(c);function c(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,c);for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return C(E(e=i.call.apply(i,[this].concat(r))),"childRefs",{}),e}return t=c,r=[{key:"render",value:function(){var e=this,t=this.props,r=t.overrides,o=void 0===r?{}:r,i=t.mode,c=void 0===i?a.checkbox:i,d=t.children,h=t.selected,m=t.disabled,v=t.onClick,g=t.kind,O=t.shape,E=t.size,w=b((0,u.jb)(o.Root,f),2),C=w[0],j=w[1],S=this.props["aria-label"]||this.props.ariaLabel,k=c===a.radio,L=n.Children.count(d);return n.createElement(s.R.Consumer,null,(function(t){return n.createElement(C,p({"aria-label":S||t.buttongroup.ariaLabel,"data-baseweb":"button-group",role:k?"radiogroup":"group",$shape:O,$length:d.length},j),n.Children.map(d,(function(t,r){if(!n.isValidElement(t))return null;var o=t.props.isSelected?t.props.isSelected:function(e,t){return!(!Array.isArray(e)&&"number"!==typeof e)&&(Array.isArray(e)?e.includes(t):e===t)}(h,r);return k&&(e.childRefs[r]=n.createRef()),n.cloneElement(t,{disabled:m||t.props.disabled,isSelected:o,ref:k?e.childRefs[r]:void 0,tabIndex:!k||o||k&&(!h||-1===h)&&0===r?0:-1,onKeyDown:function(t){if(k){var r=Number(h)?Number(h):0;if("ArrowUp"===t.key||"ArrowLeft"===t.key){t.preventDefault&&t.preventDefault();var n=r-1<0?L-1:r-1;v&&v(t,n),e.childRefs[n].current&&e.childRefs[n].current.focus()}if("ArrowDown"===t.key||"ArrowRight"===t.key){t.preventDefault&&t.preventDefault();var o=r+1>L-1?0:r+1;v&&v(t,o),e.childRefs[o].current&&e.childRefs[o].current.focus()}}},kind:g,onClick:function(e){m||(t.props.onClick&&t.props.onClick(e),v&&v(e,r))},shape:O,size:E,overrides:y({BaseButton:{style:function(e){var t=e.$theme;return 1===d.length?{}:O!==l?{marginLeft:t.sizing.scale100,marginRight:t.sizing.scale100}:{marginLeft:"0.5px",marginRight:"0.5px"}},props:{"aria-checked":o,role:k?"radio":"checkbox"}}},t.props.overrides)})})))}))}}],r&&v(t.prototype,r),o&&v(t,o),Object.defineProperty(t,"prototype",{writable:!1}),c}(n.Component);C(j,"defaultProps",{disabled:!1,onClick:function(){},shape:l,size:"default",kind:"secondary"});var S=r(81354),k=r(9003),L=r(22704),R=r(16295),_=r(87814),I=r(40864);function P(e,t,r,n){let o=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];r.setIntArrayValue(t,e,{fromUi:o},n)}function A(e){return(0,I.jsx)(L.p,{size:"lg",iconValue:e})}function x(e,t,r,o,i){var c;const a=function(e,t,r,n){return r.indexOf(n)>-1||t===R.hE.ClickMode.SINGLE_SELECT&&e===R.hE.SelectionVisualization.ALL_UP_TO_SELECTED&&r.length>0&&n<r[0]}(r,o,i,t),l=function(e,t,r){return e&&r?r:t}(a,null!==(c=e.content)&&void 0!==c?c:"",e.selectedContent),u=!a||e.selectedContent?S.nW.BORDERLESS_ICON:S.nW.BORDERLESS_ICON_ACTIVE;return(0,n.forwardRef)((function(e,t){return(0,I.jsx)(k.ZP,{...e,size:S.V5.XSMALL,kind:u,children:A(l)})}))}const M=function(e){const{disabled:t,element:r,fragmentId:i,widgetMgr:l}=e,{clickMode:u,default:s,options:f,value:d,selectionVisualization:p}=r,h=(0,o.u)(),[y,b]=(0,n.useState)(function(e,t){const r=e.getIntArrayValue(t);return null!==r&&void 0!==r?r:t.default}(l,r)||[]),m=n.useRef(r),v=n.useRef(void 0);(0,n.useEffect)((()=>{if(!r.formId)return;const e=new _.K;return e.manageFormClearListener(l,r.formId,(()=>{b(s)})),()=>{e.disconnect()}}),[r.formId,l,s]);const g=(0,n.useMemo)((()=>JSON.stringify(d)),[d]);let O;(0,n.useEffect)((()=>{const e=JSON.parse(g);if(m.current.setValue)b(e),P(y,m.current,l,i,!1),m.current.setValue=!1;else{if(c()(y,v.current))return;const e=void 0!==v.current;P(y,m.current,l,i,e)}v.current=y}),[y,l,i,g]),u===R.hE.ClickMode.SINGLE_SELECT?O=a.radio:u===R.hE.ClickMode.MULTI_SELECT&&(O=a.checkbox);const E=f.map(((e,t)=>{const r=x(e,t,p,u,y);return(0,I.jsx)(r,{},"".concat(e.content,"-").concat(t))}));return(0,I.jsx)(j,{disabled:t,mode:O,onClick:(e,t)=>{const r=function(e,t,r){return e==R.hE.ClickMode.MULTI_SELECT?function(e,t){return t.includes(e)?t.filter((t=>t!==e)):[...t,e]}(t,null!==r&&void 0!==r?r:[]):[t]}(u,t,y);b(r)},selected:u===R.hE.ClickMode.MULTI_SELECT?y:(w=y,0===w.length?-1:w[0]),overrides:{Root:{style:{flexWrap:"wrap",gap:h.spacing.threeXS},props:{"data-testid":"stButtonGroup"}}},children:E});var w}},87814:(e,t,r)=>{r.d(t,{K:()=>o});var n=r(50641);class o{constructor(){this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}manageFormClearListener(e,t,r){null!=this.formClearListener&&this.lastWidgetMgr===e&&this.lastFormId===t||(this.disconnect(),(0,n.bM)(t)&&(this.formClearListener=e.addFormClearedListener(t,r),this.lastWidgetMgr=e,this.lastFormId=t))}disconnect(){var e;null===(e=this.formClearListener)||void 0===e||e.disconnect(),this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}}}}]);
|
@@ -0,0 +1 @@
|
|
1
|
+
(self.webpackChunk_streamlit_app=self.webpackChunk_streamlit_app||[]).push([[8536],{72394:(e,t,i)=>{"use strict";i.r(t),i.d(t,{default:()=>K});var o=i(66845),n=i(70145),s=i(97365),r=i(62813),a=i.n(r),l=i(3717),c=i(25621),h=i(27466),d=i(88766),p=i(699),m=i(96260),u=i(24002),g=i(29378),x=i(80248),w=i(87072),b=i(12879),y=i(47203),S=i(61355),v=i(56264),f=i(19754),k=i(23593),j=i(63765),T=i(13005),C=i.n(T),z=i(82309),E=i(40864);const F=e=>{let{error:t,width:i,deltaType:o}=e;return t instanceof D?(0,E.jsx)(z.Z,{width:i,name:"No Mapbox token provided",message:(0,E.jsxs)(E.Fragment,{children:[(0,E.jsxs)("p",{children:["To use ",(0,E.jsxs)("code",{children:["st.",o]})," or ",(0,E.jsx)("code",{children:"st.map"})," you need to set up a Mapbox access token."]}),(0,E.jsxs)("p",{children:["To get a token, create an account at"," ",(0,E.jsx)("a",{href:"https://mapbox.com",children:"https://mapbox.com"}),". It's free for moderate usage levels!"]}),(0,E.jsxs)("p",{children:["Once you have a token, just set it using the Streamlit config option ",(0,E.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,E.jsxs)("p",{children:["See"," ",(0,E.jsx)("a",{href:"https://docs.streamlit.io/develop/api-reference/configuration/config.toml",children:"our documentation"})," ","for more info on how to set config options."]})]})}):t instanceof M?(0,E.jsx)(z.Z,{width:i,name:"Error fetching Streamlit Mapbox token",message:(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)("p",{children:"This app requires an internet connection."}),(0,E.jsx)("p",{children:"Please check your connection and try again."}),(0,E.jsxs)("p",{children:["If you think this is a bug, please file bug report"," ",(0,E.jsx)("a",{href:"https://github.com/streamlit/streamlit/issues/new/choose",children:"here"}),"."]})]})}):(0,E.jsx)(z.Z,{width:i,name:"Error fetching Streamlit Mapbox token",message:t.message})};var V=i(18080),Z=i(16295),I=i(72012),O=i(66694);class D extends Error{}class M extends Error{}const P="https://data.streamlit.io/tokens.json",W="mapbox",J=e=>t=>{class i extends o.PureComponent{constructor(i){super(i),this.context=void 0,this.initMapboxToken=async()=>{try{const e=await V.Z.get(P),{[W]:t}=e.data;if(!t)throw new Error("Missing token ".concat(W));this.setState({mapboxToken:t,isFetching:!1})}catch(e){const t=(0,j.b)(e);throw this.setState({mapboxTokenError:t,isFetching:!1}),new M("".concat(t.message," (").concat(P,")"))}},this.render=()=>{const{mapboxToken:i,mapboxTokenError:o,isFetching:n}=this.state,{width:s}=this.props;return o?(0,E.jsx)(F,{width:s,error:o,deltaType:e}):n?(0,E.jsx)(I.O,{element:Z.Od.create({style:Z.Od.SkeletonStyle.ELEMENT})}):(0,E.jsx)(t,{...this.props,mapboxToken:i,width:s})},this.state={isFetching:!0,mapboxToken:void 0,mapboxTokenError:void 0}}componentDidMount(){const e=this.props.element.mapboxToken||this.context.libConfig.mapboxToken;e?this.setState({mapboxToken:e,isFetching:!1}):this.initMapboxToken()}}return i.displayName="withMapboxToken(".concat(t.displayName||t.name,")"),i.contextType=O.E,C()(i,t)};var L=i(1515);const N=(0,L.Z)("div",{target:"e1az0zs51"})((e=>{let{width:t,height:i,theme:o}=e;return{marginTop:o.spacing.sm,position:"relative",height:i,width:t}}),""),B=(0,L.Z)("div",{target:"e1az0zs50"})((e=>{let{theme:t}=e;return{position:"absolute",right:"2.625rem",top:t.spacing.md,zIndex:1,"button:not(:disabled)":{background:t.colors.bgColor,"& + button":{borderTopColor:t.colors.secondaryBg},"& span":{filter:(0,h.Iy)(t)?"":"invert(100%)"}}}}),"");i(79259);const _={classes:{...g,...b,...w,...y,CartoLayer:d.Z},functions:{colorBins:p.Z,colorCategories:m.Z,colorContinuous:u.Z}};(0,f.fh)([S.w,v.E]);const R=new x.Z({configuration:_});class H 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,h.Iy)(this.props.theme)},this.componentDidMount=()=>{this.setState({initialized:!0})},this.createTooltip=e=>{const{element:t}=this.props;if(!e||!e.object||!t.tooltip)return!1;const i=s.Z.parse(t.tooltip);return i.html?i.html=this.interpolate(e,i.html):i.text=this.interpolate(e,i.text),i},this.interpolate=(e,t)=>{const i=t.match(/{(.*?)}/g);return i&&i.forEach((i=>{const o=i.substring(1,i.length-1);e.object.hasOwnProperty(o)?t=t.replace(i,e.object[o]):e.object.hasOwnProperty("properties")&&e.object.properties.hasOwnProperty(o)&&(t=t.replace(i,e.object.properties[o]))})),t},this.onViewStateChange=e=>{let{viewState:t}=e;this.setState({viewState:t})}}static getDerivedStateFromProps(e,t){const i=H.getDeckObject(e,t);if(!a()(i.initialViewState,t.initialViewState)){const e=Object.keys(i.initialViewState).reduce(((e,o)=>i.initialViewState[o]===t.initialViewState[o]?e:{...e,[o]:i.initialViewState[o]}),{});return{viewState:{...t.viewState,...e},initialViewState:i.initialViewState}}return null}render(){const e=H.getDeckObject(this.props,this.state),{viewState:t}=this.state,{width:i}=this.props;return(0,E.jsx)(N,{className:"stDeckGlJsonChart",width:i,height:e.initialViewState.height,"data-testid":"stDeckGlJsonChart",children:(0,E.jsxs)(n.Z,{viewState:t,onViewStateChange:this.onViewStateChange,height:e.initialViewState.height,width:i,layers:this.state.initialized?e.layers:[],getTooltip:this.createTooltip,ContextProvider:l.X$.Provider,controller:!0,children:[(0,E.jsx)(l.Z3,{height:e.initialViewState.height,width:i,mapStyle:e.mapStyle&&("string"===typeof e.mapStyle?e.mapStyle:e.mapStyle[0]),mapboxApiAccessToken:this.props.element.mapboxToken||this.props.mapboxToken}),(0,E.jsx)(B,{children:(0,E.jsx)(l.Pv,{className:"zoomButton",showCompass:!1})})]})})}}H.getDeckObject=(e,t)=>{var i,o;const{element:n,width:r,height:a,theme:l,isFullScreen:c}=e,d=null!==c&&void 0!==c&&c;var p,m,u;(n.id===t.id&&t.isFullScreen===d&&t.isLightTheme===(0,h.Iy)(l)||(t.pydeckJson=s.Z.parse(n.json),t.id=n.id),null!==(i=t.pydeckJson)&&void 0!==i&&i.mapStyle||(t.pydeckJson.mapStyle="mapbox://styles/mapbox/".concat((0,h.Iy)(l)?"light":"dark","-v9")),c)?Object.assign(null===(p=t.pydeckJson)||void 0===p?void 0:p.initialViewState,{width:r,height:a}):(null!==(m=t.pydeckJson)&&void 0!==m&&null!==(u=m.initialViewState)&&void 0!==u&&u.height||(t.pydeckJson.initialViewState.height=500),n.useContainerWidth&&(t.pydeckJson.initialViewState.width=r));return t.isFullScreen=c,t.isLightTheme=(0,h.Iy)(l),null===(o=t.pydeckJson)||void 0===o||delete o.views,R.convert(t.pydeckJson)};const K=(0,c.b)(J("st.pydeck_chart")((0,k.Z)(H)))},23593:(e,t,i)=>{"use strict";i.d(t,{Z:()=>w});var o=i(66845),n=i(13005),s=i.n(n),r=i(25621),a=i(82218),l=i(97781),c=i(46927),h=i(66694),d=i(1515);const p=(0,d.Z)("button",{target:"e1vs0wn31"})((e=>{let{isExpanded:t,theme:i}=e;const o=t?{right:"0.4rem",top:"0.5rem",backgroundColor:"transparent"}:{right:"-3.0rem",top:"-0.375rem",opacity:0,transform:"scale(0)",backgroundColor:i.colors.lightenedBg05};return{position:"absolute",display:"flex",alignItems:"center",justifyContent:"center",zIndex:i.zIndices.sidebar+1,height:"2.5rem",width:"2.5rem",transition:"opacity 300ms 150ms, transform 300ms 150ms",border:"none",color:i.colors.fadedText60,borderRadius:"50%",...o,"&:focus":{outline:"none"},"&:active, &:focus-visible, &:hover":{opacity:1,outline:"none",transform:"scale(1)",color:i.colors.bodyText,transition:"none"}}}),""),m=(0,d.Z)("div",{target:"e1vs0wn30"})((e=>{let{theme:t,isExpanded:i}=e;return{"&:hover":{[p]:{opacity:1,transform:"scale(1)",transition:"none"}},...i?{position:"fixed",top:0,left:0,bottom:0,right:0,background:t.colors.bgColor,zIndex:t.zIndices.fullscreenWrapper,padding:t.spacing.md,paddingTop:"2.875rem",overflow:["auto","overlay"],display:"flex",alignItems:"center",justifyContent:"center"}:{}}}),"");var u=i(40864);class g extends o.PureComponent{constructor(e){super(e),this.context=void 0,this.controlKeys=e=>{const{expanded:t}=this.state;27===e.keyCode&&t&&this.zoomOut()},this.zoomIn=()=>{document.body.style.overflow="hidden",this.context.setFullScreen(!0),this.setState({expanded:!0})},this.zoomOut=()=>{document.body.style.overflow="unset",this.context.setFullScreen(!1),this.setState({expanded:!1})},this.convertScssRemValueToPixels=e=>parseFloat(e)*parseFloat(getComputedStyle(document.documentElement).fontSize),this.getWindowDimensions=()=>{const e=this.convertScssRemValueToPixels(this.props.theme.spacing.md),t=this.convertScssRemValueToPixels("2.875rem");return{fullWidth:window.innerWidth-2*e,fullHeight:window.innerHeight-(e+t)}},this.updateWindowDimensions=()=>{this.setState(this.getWindowDimensions())},this.state={expanded:!1,...this.getWindowDimensions()}}componentDidMount(){window.addEventListener("resize",this.updateWindowDimensions),document.addEventListener("keydown",this.controlKeys,!1)}componentWillUnmount(){window.removeEventListener("resize",this.updateWindowDimensions),document.removeEventListener("keydown",this.controlKeys,!1)}render(){const{expanded:e,fullWidth:t,fullHeight:i}=this.state,{children:o,width:n,height:s,disableFullscreenMode:r}=this.props;let h=a.d,d=this.zoomIn,g="View fullscreen";return e&&(h=l.m,d=this.zoomOut,g="Exit fullscreen"),(0,u.jsxs)(m,{isExpanded:e,"data-testid":"stFullScreenFrame",children:[!r&&(0,u.jsx)(p,{"data-testid":"StyledFullScreenButton",onClick:d,title:g,isExpanded:e,children:(0,u.jsx)(c.Z,{content:h})}),o(e?{width:t,height:i,expanded:e,expand:this.zoomIn,collapse:this.zoomOut}:{width:n,height:s,expanded:e,expand:this.zoomIn,collapse:this.zoomOut})]})}}g.contextType=h.E;const x=(0,r.b)(g);const w=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];class i extends o.PureComponent{constructor(){super(...arguments),this.render=()=>{const{width:i,height:o,disableFullscreenMode:n}=this.props;return(0,u.jsx)(x,{width:i,height:o,disableFullscreenMode:t||n,children:t=>{let{width:i,height:o,expanded:n,expand:s,collapse:r}=t;return(0,u.jsx)(e,{...this.props,width:i,height:o,isFullScreen:n,expand:s,collapse:r})}})}}}return i.displayName="withFullScreenWrapper(".concat(e.displayName||e.name,")"),s()(i,e)}},72709:()=>{},72672:()=>{}}]);
|