streamlit-nightly 1.35.1.dev20240601__py2.py3-none-any.whl → 1.35.1.dev20240604__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.
Files changed (230) hide show
  1. streamlit/commands/navigation.py +8 -5
  2. streamlit/elements/deck_gl_json_chart.py +1 -1
  3. streamlit/elements/form.py +8 -3
  4. streamlit/elements/layouts.py +11 -3
  5. streamlit/elements/lib/policies.py +28 -2
  6. streamlit/elements/map.py +6 -6
  7. streamlit/elements/plotly_chart.py +3 -0
  8. streamlit/elements/pyplot.py +6 -5
  9. streamlit/elements/vega_charts.py +26 -16
  10. streamlit/elements/widgets/button.py +28 -11
  11. streamlit/elements/widgets/camera_input.py +2 -0
  12. streamlit/elements/widgets/chat.py +7 -6
  13. streamlit/elements/widgets/checkbox.py +2 -0
  14. streamlit/elements/widgets/color_picker.py +2 -0
  15. streamlit/elements/widgets/data_editor.py +2 -2
  16. streamlit/elements/widgets/file_uploader.py +2 -0
  17. streamlit/elements/widgets/multiselect.py +2 -0
  18. streamlit/elements/widgets/number_input.py +2 -0
  19. streamlit/elements/widgets/radio.py +2 -0
  20. streamlit/elements/widgets/selectbox.py +2 -0
  21. streamlit/elements/widgets/slider.py +2 -0
  22. streamlit/elements/widgets/text_widgets.py +4 -0
  23. streamlit/elements/widgets/time_widgets.py +4 -0
  24. streamlit/elements/write.py +3 -0
  25. streamlit/hello/Hello.py +22 -28
  26. streamlit/hello/streamlit_app.py +37 -0
  27. streamlit/proto/Alert_pb2.py +12 -11
  28. streamlit/proto/Alert_pb2.pyi +4 -2
  29. streamlit/proto/AppPage_pb2.py +10 -9
  30. streamlit/proto/AppPage_pb2.pyi +4 -7
  31. streamlit/proto/ArrowNamedDataSet_pb2.py +10 -9
  32. streamlit/proto/ArrowNamedDataSet_pb2.pyi +6 -8
  33. streamlit/proto/ArrowVegaLiteChart_pb2.py +10 -9
  34. streamlit/proto/ArrowVegaLiteChart_pb2.pyi +16 -16
  35. streamlit/proto/Arrow_pb2.py +16 -15
  36. streamlit/proto/Arrow_pb2.pyi +14 -8
  37. streamlit/proto/Audio_pb2.py +10 -9
  38. streamlit/proto/Audio_pb2.pyi +4 -7
  39. streamlit/proto/AutoRerun_pb2.py +9 -8
  40. streamlit/proto/AutoRerun_pb2.pyi +4 -7
  41. streamlit/proto/BackMsg_pb2.py +10 -9
  42. streamlit/proto/BackMsg_pb2.pyi +18 -19
  43. streamlit/proto/Balloons_pb2.py +10 -9
  44. streamlit/proto/Balloons_pb2.pyi +4 -7
  45. streamlit/proto/Block_pb2.py +34 -33
  46. streamlit/proto/Block_pb2.pyi +31 -19
  47. streamlit/proto/BokehChart_pb2.py +10 -9
  48. streamlit/proto/BokehChart_pb2.pyi +4 -7
  49. streamlit/proto/Button_pb2.py +10 -9
  50. streamlit/proto/Button_pb2.pyi +4 -7
  51. streamlit/proto/CameraInput_pb2.py +10 -9
  52. streamlit/proto/CameraInput_pb2.pyi +5 -8
  53. streamlit/proto/ChatInput_pb2.py +12 -11
  54. streamlit/proto/ChatInput_pb2.pyi +4 -2
  55. streamlit/proto/Checkbox_pb2.py +12 -11
  56. streamlit/proto/Checkbox_pb2.pyi +6 -4
  57. streamlit/proto/ClientState_pb2.py +10 -9
  58. streamlit/proto/ClientState_pb2.pyi +7 -10
  59. streamlit/proto/Code_pb2.py +10 -9
  60. streamlit/proto/Code_pb2.pyi +4 -7
  61. streamlit/proto/ColorPicker_pb2.py +10 -9
  62. streamlit/proto/ColorPicker_pb2.pyi +5 -8
  63. streamlit/proto/Common_pb2.py +32 -31
  64. streamlit/proto/Common_pb2.pyi +32 -23
  65. streamlit/proto/Components_pb2.py +18 -17
  66. streamlit/proto/Components_pb2.pyi +25 -23
  67. streamlit/proto/DataFrame_pb2.py +38 -37
  68. streamlit/proto/DataFrame_pb2.pyi +52 -33
  69. streamlit/proto/DateInput_pb2.py +10 -9
  70. streamlit/proto/DateInput_pb2.pyi +10 -13
  71. streamlit/proto/DeckGlJsonChart_pb2.py +10 -9
  72. streamlit/proto/DeckGlJsonChart_pb2.pyi +4 -7
  73. streamlit/proto/Delta_pb2.py +10 -9
  74. streamlit/proto/Delta_pb2.pyi +10 -10
  75. streamlit/proto/DocString_pb2.py +12 -11
  76. streamlit/proto/DocString_pb2.pyi +9 -10
  77. streamlit/proto/DownloadButton_pb2.py +10 -9
  78. streamlit/proto/DownloadButton_pb2.pyi +4 -7
  79. streamlit/proto/Element_pb2.py +10 -9
  80. streamlit/proto/Element_pb2.pyi +10 -9
  81. streamlit/proto/Empty_pb2.py +10 -9
  82. streamlit/proto/Empty_pb2.pyi +3 -0
  83. streamlit/proto/Exception_pb2.py +10 -9
  84. streamlit/proto/Exception_pb2.pyi +8 -10
  85. streamlit/proto/Favicon_pb2.py +10 -9
  86. streamlit/proto/Favicon_pb2.pyi +4 -7
  87. streamlit/proto/FileUploader_pb2.py +10 -9
  88. streamlit/proto/FileUploader_pb2.pyi +9 -11
  89. streamlit/proto/ForwardMsg_pb2.py +16 -15
  90. streamlit/proto/ForwardMsg_pb2.pyi +36 -24
  91. streamlit/proto/GitInfo_pb2.py +12 -11
  92. streamlit/proto/GitInfo_pb2.pyi +5 -3
  93. streamlit/proto/GraphVizChart_pb2.py +10 -9
  94. streamlit/proto/GraphVizChart_pb2.pyi +4 -7
  95. streamlit/proto/Heading_pb2.py +10 -9
  96. streamlit/proto/Heading_pb2.pyi +4 -7
  97. streamlit/proto/Html_pb2.py +10 -9
  98. streamlit/proto/Html_pb2.pyi +4 -7
  99. streamlit/proto/IFrame_pb2.py +10 -9
  100. streamlit/proto/IFrame_pb2.pyi +6 -9
  101. streamlit/proto/Image_pb2.py +12 -11
  102. streamlit/proto/Image_pb2.pyi +8 -10
  103. streamlit/proto/Json_pb2.py +10 -9
  104. streamlit/proto/Json_pb2.pyi +4 -7
  105. streamlit/proto/LabelVisibilityMessage_pb2.py +12 -11
  106. streamlit/proto/LabelVisibilityMessage_pb2.pyi +4 -2
  107. streamlit/proto/LinkButton_pb2.py +10 -9
  108. streamlit/proto/LinkButton_pb2.pyi +4 -7
  109. streamlit/proto/Logo_pb2.py +10 -9
  110. streamlit/proto/Logo_pb2.pyi +4 -7
  111. streamlit/proto/Markdown_pb2.py +12 -11
  112. streamlit/proto/Markdown_pb2.pyi +4 -2
  113. streamlit/proto/Metric_pb2.py +14 -13
  114. streamlit/proto/Metric_pb2.pyi +6 -4
  115. streamlit/proto/MultiSelect_pb2.py +10 -9
  116. streamlit/proto/MultiSelect_pb2.pyi +11 -14
  117. streamlit/proto/NamedDataSet_pb2.py +10 -9
  118. streamlit/proto/NamedDataSet_pb2.pyi +6 -8
  119. streamlit/proto/Navigation_pb2.py +12 -11
  120. streamlit/proto/Navigation_pb2.pyi +7 -5
  121. streamlit/proto/NewSession_pb2.py +32 -31
  122. streamlit/proto/NewSession_pb2.pyi +52 -36
  123. streamlit/proto/NumberInput_pb2.py +12 -11
  124. streamlit/proto/NumberInput_pb2.pyi +8 -6
  125. streamlit/proto/PageConfig_pb2.py +16 -15
  126. streamlit/proto/PageConfig_pb2.pyi +8 -5
  127. streamlit/proto/PageInfo_pb2.py +10 -9
  128. streamlit/proto/PageInfo_pb2.pyi +4 -7
  129. streamlit/proto/PageLink_pb2.py +10 -9
  130. streamlit/proto/PageLink_pb2.pyi +6 -9
  131. streamlit/proto/PageNotFound_pb2.py +10 -9
  132. streamlit/proto/PageNotFound_pb2.pyi +4 -7
  133. streamlit/proto/PageProfile_pb2.py +14 -13
  134. streamlit/proto/PageProfile_pb2.pyi +15 -16
  135. streamlit/proto/PagesChanged_pb2.py +10 -9
  136. streamlit/proto/PagesChanged_pb2.pyi +4 -7
  137. streamlit/proto/ParentMessage_pb2.py +10 -9
  138. streamlit/proto/ParentMessage_pb2.pyi +4 -7
  139. streamlit/proto/PlotlyChart_pb2.py +14 -13
  140. streamlit/proto/PlotlyChart_pb2.pyi +13 -8
  141. streamlit/proto/Progress_pb2.py +10 -9
  142. streamlit/proto/Progress_pb2.pyi +4 -7
  143. streamlit/proto/Radio_pb2.py +10 -9
  144. streamlit/proto/Radio_pb2.pyi +8 -12
  145. streamlit/proto/RootContainer_pb2.py +10 -9
  146. streamlit/proto/RootContainer_pb2.pyi +2 -1
  147. streamlit/proto/Selectbox_pb2.py +10 -9
  148. streamlit/proto/Selectbox_pb2.pyi +9 -13
  149. streamlit/proto/SessionEvent_pb2.py +10 -9
  150. streamlit/proto/SessionEvent_pb2.pyi +7 -9
  151. streamlit/proto/SessionStatus_pb2.py +10 -9
  152. streamlit/proto/SessionStatus_pb2.pyi +4 -7
  153. streamlit/proto/Skeleton_pb2.py +12 -11
  154. streamlit/proto/Skeleton_pb2.pyi +6 -4
  155. streamlit/proto/Slider_pb2.py +14 -13
  156. streamlit/proto/Slider_pb2.pyi +12 -10
  157. streamlit/proto/Snow_pb2.py +10 -9
  158. streamlit/proto/Snow_pb2.pyi +4 -7
  159. streamlit/proto/Spinner_pb2.py +10 -9
  160. streamlit/proto/Spinner_pb2.pyi +4 -7
  161. streamlit/proto/TextArea_pb2.py +10 -9
  162. streamlit/proto/TextArea_pb2.pyi +6 -10
  163. streamlit/proto/TextInput_pb2.py +12 -11
  164. streamlit/proto/TextInput_pb2.pyi +7 -5
  165. streamlit/proto/Text_pb2.py +10 -9
  166. streamlit/proto/Text_pb2.pyi +4 -7
  167. streamlit/proto/TimeInput_pb2.py +10 -9
  168. streamlit/proto/TimeInput_pb2.pyi +7 -11
  169. streamlit/proto/Toast_pb2.py +10 -9
  170. streamlit/proto/Toast_pb2.pyi +4 -7
  171. streamlit/proto/VegaLiteChart_pb2.py +10 -9
  172. streamlit/proto/VegaLiteChart_pb2.pyi +9 -10
  173. streamlit/proto/Video_pb2.py +14 -13
  174. streamlit/proto/Video_pb2.pyi +10 -6
  175. streamlit/proto/WidgetStates_pb2.py +12 -11
  176. streamlit/proto/WidgetStates_pb2.pyi +11 -12
  177. streamlit/proto/openmetrics_data_model_pb2.py +42 -41
  178. streamlit/proto/openmetrics_data_model_pb2.pyi +64 -31
  179. streamlit/runtime/caching/cached_message_replay.py +14 -29
  180. streamlit/runtime/fragment.py +3 -0
  181. streamlit/runtime/scriptrunner/script_run_context.py +1 -0
  182. streamlit/runtime/secrets.py +14 -0
  183. streamlit/static/asset-manifest.json +19 -19
  184. streamlit/static/index.html +1 -1
  185. streamlit/static/static/js/{1074.73973756.chunk.js → 1074.a92bc15f.chunk.js} +1 -1
  186. streamlit/static/static/js/1307.36b77087.chunk.js +1 -0
  187. streamlit/static/static/js/1451.229b62c4.chunk.js +1 -0
  188. streamlit/static/static/js/2469.5a75ba8e.chunk.js +1 -0
  189. streamlit/static/static/js/3599.565b1eba.chunk.js +1 -0
  190. streamlit/static/static/js/{4477.1bd49702.chunk.js → 4477.87935ac8.chunk.js} +1 -1
  191. streamlit/static/static/js/4500.be0eb305.chunk.js +1 -0
  192. streamlit/static/static/js/4666.a9344a3a.chunk.js +1 -0
  193. streamlit/static/static/js/5441.87f335e6.chunk.js +1 -0
  194. streamlit/static/static/js/6013.f6083314.chunk.js +1 -0
  195. streamlit/static/static/js/{6718.802da17e.chunk.js → 6718.2e6586ef.chunk.js} +1 -1
  196. streamlit/static/static/js/7175.8f4014ec.chunk.js +1 -0
  197. streamlit/static/static/js/7602.a20a999b.chunk.js +1 -0
  198. streamlit/static/static/js/8148.1b2c085e.chunk.js +1 -0
  199. streamlit/static/static/js/8427.59805a7f.chunk.js +1 -0
  200. streamlit/static/static/js/{8492.0d93bd08.chunk.js → 8492.8ad745d1.chunk.js} +1 -1
  201. streamlit/static/static/js/8691.cb9c04cf.chunk.js +1 -0
  202. streamlit/static/static/js/main.ea823277.js +2 -0
  203. streamlit/type_util.py +7 -0
  204. streamlit/web/cli.py +2 -2
  205. streamlit/web/server/server.py +2 -2
  206. {streamlit_nightly-1.35.1.dev20240601.dist-info → streamlit_nightly-1.35.1.dev20240604.dist-info}/METADATA +5 -5
  207. {streamlit_nightly-1.35.1.dev20240601.dist-info → streamlit_nightly-1.35.1.dev20240604.dist-info}/RECORD +216 -215
  208. streamlit/static/static/js/1307.0f0cca93.chunk.js +0 -1
  209. streamlit/static/static/js/1451.3b0a3e31.chunk.js +0 -1
  210. streamlit/static/static/js/2469.09ea79bb.chunk.js +0 -1
  211. streamlit/static/static/js/4500.b6f348d1.chunk.js +0 -1
  212. streamlit/static/static/js/4666.c4b22a63.chunk.js +0 -1
  213. streamlit/static/static/js/5379.f08eddd1.chunk.js +0 -1
  214. streamlit/static/static/js/5441.1b94928f.chunk.js +0 -1
  215. streamlit/static/static/js/6013.4ba2d616.chunk.js +0 -1
  216. streamlit/static/static/js/7175.583ff733.chunk.js +0 -1
  217. streamlit/static/static/js/7602.e8abc06b.chunk.js +0 -1
  218. streamlit/static/static/js/8148.293984e0.chunk.js +0 -1
  219. streamlit/static/static/js/8427.bd0a7cf3.chunk.js +0 -1
  220. streamlit/static/static/js/8691.4211c305.chunk.js +0 -1
  221. streamlit/static/static/js/main.707da454.js +0 -2
  222. /streamlit/hello/{pages/0_Animation_Demo.py → Animation_Demo.py} +0 -0
  223. /streamlit/hello/{pages/3_DataFrame_Demo.py → Dataframe_Demo.py} +0 -0
  224. /streamlit/hello/{pages/2_Mapping_Demo.py → Mapping_Demo.py} +0 -0
  225. /streamlit/hello/{pages/1_Plotting_Demo.py → Plotting_Demo.py} +0 -0
  226. /streamlit/static/static/js/{main.707da454.js.LICENSE.txt → main.ea823277.js.LICENSE.txt} +0 -0
  227. {streamlit_nightly-1.35.1.dev20240601.data → streamlit_nightly-1.35.1.dev20240604.data}/scripts/streamlit.cmd +0 -0
  228. {streamlit_nightly-1.35.1.dev20240601.dist-info → streamlit_nightly-1.35.1.dev20240604.dist-info}/WHEEL +0 -0
  229. {streamlit_nightly-1.35.1.dev20240601.dist-info → streamlit_nightly-1.35.1.dev20240604.dist-info}/entry_points.txt +0 -0
  230. {streamlit_nightly-1.35.1.dev20240601.dist-info → streamlit_nightly-1.35.1.dev20240604.dist-info}/top_level.txt +0 -0
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunk_streamlit_app=self.webpackChunk_streamlit_app||[]).push([[1307],{51307:(e,t,n)=>{n.r(t),n.d(t,{default:()=>c});n(66845);var i=n(23593),o=n(1515);const s=(0,o.Z)("div",{target:"e115fcil2"})((e=>{let{theme:t}=e;return{display:"flex",flexDirection:"row",flexWrap:"wrap",rowGap:t.spacing.lg}}),""),r=(0,o.Z)("div",{target:"e115fcil1"})((()=>({display:"flex",flexDirection:"column",alignItems:"stretch",width:"auto",flexGrow:0})),""),l=(0,o.Z)("div",{target:"e115fcil0"})((e=>{let{theme:t}=e;return{fontFamily:t.genericFonts.bodyFont,fontSize:t.fontSizes.sm,color:t.colors.fadedText60,textAlign:"center",marginTop:t.spacing.xs,wordWrap:"break-word",padding:"0.125rem"}}),"");var d,a=n(40864);!function(e){e[e.OriginalWidth=-1]="OriginalWidth",e[e.ColumnWidth=-2]="ColumnWidth",e[e.AutoWidth=-3]="AutoWidth"}(d||(d={}));const c=(0,i.Z)((function(e){let t,{width:n,isFullScreen:i,element:o,height:c,endpoints:h}=e;const m=o.width;if(m===d.OriginalWidth||m===d.AutoWidth)t=void 0;else if(m===d.ColumnWidth)t=n;else{if(!(m>0))throw Error("Invalid image width: ".concat(m));t=m}const u={};return c&&i?(u.maxHeight=c,u["object-fit"]="contain"):(u.width=t,m===d.AutoWidth&&(u.maxWidth="100%")),(0,a.jsx)(s,{style:{width:n},children:o.imgs.map(((e,t)=>{const n=e;return(0,a.jsxs)(r,{"data-testid":"stImage",children:[(0,a.jsx)("img",{style:u,src:h.buildMediaURL(n.url),alt:t.toString()}),n.caption&&(0,a.jsx)(l,{"data-testid":"stImageCaption",style:u,children:" ".concat(n.caption," ")})]},t)}))})}))},23593:(e,t,n)=>{n.d(t,{Z:()=>x});var i=n(66845),o=n(13005),s=n.n(o),r=n(25621),l=n(82218),d=n(97781),a=n(46927),c=n(66694),h=n(1515);const m=(0,h.Z)("button",{target:"e1vs0wn31"})((e=>{let{isExpanded:t,theme:n}=e;const i=t?{right:"0.4rem",top:"0.5rem",backgroundColor:"transparent"}:{right:"-3.0rem",top:"-0.375rem",opacity:0,transform:"scale(0)",backgroundColor:n.colors.lightenedBg05};return{position:"absolute",display:"flex",alignItems:"center",justifyContent:"center",zIndex:n.zIndices.sidebar+1,height:"2.5rem",width:"2.5rem",transition:"opacity 300ms 150ms, transform 300ms 150ms",border:"none",color:n.colors.fadedText60,borderRadius:"50%",...i,"&:focus":{outline:"none"},"&:active, &:focus-visible, &:hover":{opacity:1,outline:"none",transform:"scale(1)",color:n.colors.bodyText,transition:"none"}}}),""),u=(0,h.Z)("div",{target:"e1vs0wn30"})((e=>{let{theme:t,isExpanded:n}=e;return{"&:hover":{[m]:{opacity:1,transform:"scale(1)",transition:"none"}},...n?{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 p=n(40864);class g extends i.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:n}=this.state,{children:i,width:o,height:s,disableFullscreenMode:r}=this.props;let c=l.d,h=this.zoomIn,g="View fullscreen";return e&&(c=d.m,h=this.zoomOut,g="Exit fullscreen"),(0,p.jsxs)(u,{isExpanded:e,"data-testid":"stFullScreenFrame",children:[!r&&(0,p.jsx)(m,{"data-testid":"StyledFullScreenButton",onClick:h,title:g,isExpanded:e,children:(0,p.jsx)(a.Z,{content:c})}),i(e?{width:t,height:n,expanded:e,expand:this.zoomIn,collapse:this.zoomOut}:{width:o,height:s,expanded:e,expand:this.zoomIn,collapse:this.zoomOut})]})}}g.contextType=c.E;const w=(0,r.b)(g);const x=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];class n extends i.PureComponent{constructor(){super(...arguments),this.render=()=>{const{width:n,height:i,disableFullscreenMode:o}=this.props;return(0,p.jsx)(w,{width:n,height:i,disableFullscreenMode:t||o,children:t=>{let{width:n,height:i,expanded:o,expand:s,collapse:r}=t;return(0,p.jsx)(e,{...this.props,width:n,height:i,isFullScreen:o,expand:s,collapse:r})}})}}}return n.displayName="withFullScreenWrapper(".concat(e.displayName||e.name,")"),s()(n,e)}},82218:(e,t,n)=>{n.d(t,{d:()=>r});var i=n(25773),o=n(66845),s=n(69),r=o.forwardRef((function(e,t){return o.createElement(s.D,(0,i.Z)({iconAttrs:{fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},iconVerticalAlign:"middle",iconViewBox:"0 0 8 8"},e,{ref:t}),o.createElement("path",{d:"M0 0v4l1.5-1.5L3 4l1-1-1.5-1.5L4 0H0zm5 4L4 5l1.5 1.5L4 8h4V4L6.5 5.5 5 4z"}))}));r.displayName="FullscreenEnter"},97781:(e,t,n)=>{n.d(t,{m:()=>r});var i=n(25773),o=n(66845),s=n(69),r=o.forwardRef((function(e,t){return o.createElement(s.D,(0,i.Z)({iconAttrs:{fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},iconVerticalAlign:"middle",iconViewBox:"0 0 8 8"},e,{ref:t}),o.createElement("path",{d:"M1 0L0 1l1.5 1.5L0 4h4V0L2.5 1.5 1 0zm3 4v4l1.5-1.5L7 8l1-1-1.5-1.5L8 4H4z"}))}));r.displayName="FullscreenExit"}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunk_streamlit_app=self.webpackChunk_streamlit_app||[]).push([[1451],{61451:(t,e,s)=>{s.r(e),s.d(e,{default:()=>C});var a=s(66845),i=s(53608),r=s.n(i),o=s(25621),n=s(15791),l=s(28278),d=s(13553),p=s(87814),m=s(98478),h=s(86659),c=s(8879),u=s(68411),g=s(50641),f=s(40864);const v="YYYY/MM/DD";function y(t){return t.map((t=>new Date(t)))}class b extends a.PureComponent{constructor(){super(...arguments),this.formClearHelper=new p.K,this.state={values:this.initialValue,isRange:this.props.element.isRange,isEmpty:!1},this.commitWidgetValue=t=>{const{widgetMgr:e,element:s,fragmentId:a}=this.props;var i;e.setStringArrayValue(s,(i=this.state.values)?i.map((t=>r()(t).format(v))):[],t,a)},this.onFormCleared=()=>{const t=y(this.props.element.default);this.setState({values:t,isEmpty:!t},(()=>this.commitWidgetValue({fromUi:!0})))},this.handleChange=t=>{let{date:e}=t;if(null===e||void 0===e)return void this.setState({values:[],isEmpty:!0});const s=[];Array.isArray(e)?e.forEach((t=>{t&&s.push(t)})):s.push(e),this.setState({values:s,isEmpty:!s},(()=>{this.state.isEmpty||this.commitWidgetValue({fromUi:!0})}))},this.handleClose=()=>{const{isEmpty:t}=this.state;t&&this.setState(((t,e)=>({values:y(e.element.default),isEmpty:!y(e.element.default)})),(()=>{this.commitWidgetValue({fromUi:!0})}))},this.getMaxDate=()=>{const{element:t}=this.props,e=t.max;return e&&e.length>0?r()(e,v).toDate():void 0}}get initialValue(){const t=this.props.widgetMgr.getStringArrayValue(this.props.element);return y(void 0!==t?t:this.props.element.default||[])}componentDidMount(){this.props.element.setValue?this.updateFromProtobuf():this.commitWidgetValue({fromUi:!1})}componentDidUpdate(){this.maybeUpdateFromProtobuf()}componentWillUnmount(){this.formClearHelper.disconnect()}maybeUpdateFromProtobuf(){const{setValue:t}=this.props.element;t&&this.updateFromProtobuf()}updateFromProtobuf(){const{value:t}=this.props.element;this.props.element.setValue=!1;const e=t.map((t=>new Date(t)));this.setState({values:e,isEmpty:!e},(()=>{this.commitWidgetValue({fromUi:!1})}))}render(){var t;const{width:e,element:s,disabled:a,theme:i,widgetMgr:o}=this.props,{values:p,isRange:y}=this.state,{colors:b,fontSizes:C,lineHeights:x}=i,D={width:e},I=r()(s.min,v).toDate(),W=this.getMaxDate(),F=0===s.default.length&&!a,V=s.format.replaceAll(/[a-zA-Z]/g,"9"),S=s.format.replaceAll("Y","y").replaceAll("D","d");return this.formClearHelper.manageFormClearListener(o,s.formId,this.onFormCleared),(0,f.jsxs)("div",{className:"stDateInput",style:D,"data-testid":"stDateInput",children:[(0,f.jsx)(m.O,{label:s.label,disabled:a,labelVisibility:(0,g.iF)(null===(t=s.labelVisibility)||void 0===t?void 0:t.value),children:s.help&&(0,f.jsx)(h.dT,{children:(0,f.jsx)(c.Z,{content:s.help,placement:u.u.TOP_RIGHT})})}),(0,f.jsx)(n.Z,{density:l.pw.high,formatString:S,mask:y?"".concat(V," \u2013 ").concat(V):V,placeholder:y?"".concat(s.format," \u2013 ").concat(s.format):s.format,disabled:a,onChange:this.handleChange,onClose:this.handleClose,overrides:{Popover:{props:{placement:d.r4.bottomLeft,overrides:{Body:{style:{border:"1px solid ".concat(b.fadedText10)}}}}},CalendarContainer:{style:{fontSize:C.sm,paddingRight:i.spacing.sm,paddingLeft:i.spacing.sm,paddingBottom:i.spacing.sm,paddingTop:i.spacing.sm}},Week:{style:{fontSize:C.sm}},Day:{style:t=>{let{$pseudoHighlighted:e,$pseudoSelected:s,$selected:a,$isHovered:i}=t;return{fontSize:C.sm,lineHeight:x.base,"::before":{backgroundColor:a||s||e||i?"".concat(b.secondaryBg," !important"):b.transparent},"::after":{borderColor:b.transparent}}}},PrevButton:{style:()=>({display:"flex",alignItems:"center",justifyContent:"center",":active":{backgroundColor:b.transparent},":focus":{backgroundColor:b.transparent,outline:0}})},NextButton:{style:{display:"flex",alignItems:"center",justifyContent:"center",":active":{backgroundColor:b.transparent},":focus":{backgroundColor:b.transparent,outline:0}}},Input:{props:{maskChar:null,overrides:{Root:{style:{borderLeftWidth:"1px",borderRightWidth:"1px",borderTopWidth:"1px",borderBottomWidth:"1px"}},ClearIcon:{props:{overrides:{Svg:{style:{color:i.colors.darkGray,transform:"scale(1.41)",width:i.spacing.twoXL,marginRight:"-8px",":hover":{fill:i.colors.bodyText}}}}}},Input:{style:{paddingRight:".5rem",paddingLeft:".5rem",paddingBottom:".5rem",paddingTop:".5rem",lineHeight:1.4},props:{"data-testid":"stDateInput-Input"}}}}}},value:p,minDate:I,maxDate:W,range:y,clearable:F})]})}}const C=(0,o.b)(b)},87814:(t,e,s)=>{s.d(e,{K:()=>i});var a=s(50641);class i{constructor(){this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}manageFormClearListener(t,e,s){null!=this.formClearListener&&this.lastWidgetMgr===t&&this.lastFormId===e||(this.disconnect(),(0,a.bM)(e)&&(this.formClearListener=t.addFormClearedListener(e,s),this.lastWidgetMgr=t,this.lastFormId=e))}disconnect(){var t;null===(t=this.formClearListener)||void 0===t||t.disconnect(),this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}}}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunk_streamlit_app=self.webpackChunk_streamlit_app||[]).push([[2469],{62469:(o,r,e)=>{e.r(r),e.d(r,{default:()=>h});e(66845);var t=e(81354),a=e(27446),i=e(1515),c=e(35704);function n(o,r){switch(o){case t.V5.XSMALL:return{padding:"".concat(r.spacing.twoXS," ").concat(r.spacing.sm),fontSize:r.fontSizes.sm};case t.V5.SMALL:return{padding:"".concat(r.spacing.twoXS," ").concat(r.spacing.md)};case t.V5.LARGE:return{padding:"".concat(r.spacing.md," ").concat(r.spacing.md)};default:return{padding:"".concat(r.spacing.xs," ").concat(r.spacing.md)}}}const l=(0,i.Z)("a",{target:"e16zdaao2"})((o=>{let{fluidWidth:r,size:e,theme:t}=o;const a="number"==typeof r?"".concat(r,"px"):"100%";return{display:"inline-flex",alignItems:"center",justifyContent:"center",fontWeight:t.fontWeights.normal,padding:"".concat(t.spacing.xs," ").concat(t.spacing.md),borderRadius:t.radii.lg,minHeight:"38.4px",margin:0,lineHeight:t.lineHeights.base,color:t.colors.primary,textDecoration:"none",width:r?a:"auto",userSelect:"none","&:visited":{color:t.colors.primary},"&:focus":{outline:"none"},"&:focus-visible":{boxShadow:"0 0 0 0.2rem ".concat((0,c.DZ)(t.colors.primary,.5))},"&:hover":{textDecoration:"none"},"&:active":{textDecoration:"none"},...n(e,t)}}),""),s=(0,i.Z)(l,{target:"e16zdaao1"})((o=>{let{theme:r}=o;return{backgroundColor:r.colors.primary,color:r.colors.white,border:"1px solid ".concat(r.colors.primary),"&:hover":{backgroundColor:(0,c._j)(r.colors.primary,.05),color:r.colors.white},"&:active":{backgroundColor:"transparent",color:r.colors.primary},"&:visited:not(:active)":{color:r.colors.white},"&[disabled], &[disabled]:hover, &[disabled]:active, &[disabled]:visited":{borderColor:r.colors.fadedText10,backgroundColor:r.colors.transparent,color:r.colors.fadedText40,cursor:"not-allowed"}}}),""),d=(0,i.Z)(l,{target:"e16zdaao0"})((o=>{let{theme:r}=o;return{backgroundColor:r.colors.lightenedBg05,color:r.colors.bodyText,border:"1px solid ".concat(r.colors.fadedText10),"&:visited":{color:r.colors.bodyText},"&:hover":{borderColor:r.colors.primary,color:r.colors.primary},"&:active":{color:r.colors.white,borderColor:r.colors.primary,backgroundColor:r.colors.primary},"&:focus:not(:active)":{borderColor:r.colors.primary,color:r.colors.primary},"&[disabled], &[disabled]:hover, &[disabled]:active":{borderColor:r.colors.fadedText10,backgroundColor:r.colors.transparent,color:r.colors.fadedText40,cursor:"not-allowed"}}}),"");var u=e(40864);const p=function(o){let{kind:r,size:e,disabled:a,fluidWidth:i,children:c,autoFocus:n,href:l,rel:p,target:b,onClick:h}=o,g=s;return r===t.nW.SECONDARY&&(g=d),(0,u.jsx)(g,{kind:r,size:e||t.V5.MEDIUM,fluidWidth:i||!1,disabled:a||!1,autoFocus:n||!1,"data-testid":"baseLinkButton-".concat(r),href:l,target:b,rel:p,onClick:h,tabIndex:a?-1:0,children:c})};var b=e(63730);const h=function(o){const{disabled:r,element:e,width:i}=o,c={width:i},n="primary"===e.type?t.nW.PRIMARY:t.nW.SECONDARY,l=!e.help||i;return(0,u.jsx)("div",{className:"row-widget stLinkButton","data-testid":"stLinkButton",style:c,children:(0,u.jsx)(a.t,{help:e.help,children:(0,u.jsx)(p,{kind:n,size:t.V5.SMALL,disabled:r,onClick:r=>{o.disabled&&r.preventDefault()},fluidWidth:!!e.useContainerWidth&&l,href:e.url,target:"_blank",rel:"noreferrer","aria-disabled":r,children:(0,u.jsx)(b.ZP,{source:e.label,allowHTML:!1,isLabel:!0,largerLabel:!0,disableLinks:!0})})})})}}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunk_streamlit_app=self.webpackChunk_streamlit_app||[]).push([[4500],{54500:(t,e,l)=>{l.r(e),l.d(e,{default:()=>i});var s=l(90994),r=(l(66845),l(40864));function i(t){let{element:e,width:l}=t;const i=e.hasWidth?e.width:l;let o,a;e.scrolling?(o="auto",a={}):(o="no",a={overflow:"hidden"}),a.colorScheme="normal";const c=n(e.src),d=null!=c?void 0:n(e.srcdoc);return(0,r.jsx)("iframe",{"data-testid":"stIFrame",allow:s.p,style:a,src:c,srcDoc:d,width:i,height:e.height,scrolling:o,sandbox:s.T,title:"st.iframe"})}function n(t){return null==t||""===t?void 0:t}}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunk_streamlit_app=self.webpackChunk_streamlit_app||[]).push([[4666],{90186:(e,t,i)=>{i.d(t,{$:()=>p,Z:()=>c});var s=i(66845),n=i(25621),l=i(66694),a=i(27466),r=i(38570),o=i(80318),d=i(40864);let p;!function(e){e.EXTRASMALL="xs",e.SMALL="sm",e.MEDIUM="md",e.LARGE="lg",e.EXTRALARGE="xl"}(p||(p={}));const c=function(e){let{value:t,width:i,size:c=p.SMALL,overrides:g}=e;const h=(0,n.u)(),u={xs:h.spacing.twoXS,sm:h.spacing.sm,md:h.spacing.lg,lg:h.spacing.xl,xl:h.spacing.twoXL},{activeTheme:m}=s.useContext(l.E),f=!(0,a.MJ)(m),x={BarContainer:{style:{marginTop:h.spacing.none,marginBottom:h.spacing.none,marginRight:h.spacing.none,marginLeft:h.spacing.none}},Bar:{style:e=>{let{$theme:t}=e;return{width:i?i.toString():void 0,marginTop:h.spacing.none,marginBottom:h.spacing.none,marginRight:h.spacing.none,marginLeft:h.spacing.none,height:u[c],backgroundColor:t.colors.progressbarTrackFill,borderTopLeftRadius:h.spacing.twoXS,borderTopRightRadius:h.spacing.twoXS,borderBottomLeftRadius:h.spacing.twoXS,borderBottomRightRadius:h.spacing.twoXS}}},BarProgress:{style:()=>({backgroundColor:f?h.colors.primary:h.colors.blue70,borderTopLeftRadius:h.spacing.twoXS,borderTopRightRadius:h.spacing.twoXS,borderBottomLeftRadius:h.spacing.twoXS,borderBottomRightRadius:h.spacing.twoXS})}};return(0,d.jsx)(r.Z,{value:t,overrides:(0,o.aO)(x,g)})}},77367:(e,t,i)=>{i.d(t,{R:()=>s});class s{setStatus(e){return new s(this.name,this.size,this.id,e)}constructor(e,t,i,s){this.name=void 0,this.size=void 0,this.status=void 0,this.id=void 0,this.name=e,this.size=t,this.id=i,this.status=s}}},14666:(e,t,i)=>{i.r(t),i.d(t,{default:()=>he});var s=i(18080),n=i(62813),l=i.n(n),a=i(84693),r=i.n(a),o=i(66845),d=i(16295),p=i(87814),c=i(50641);let g;!function(e){e.Gigabyte="gb",e.Megabyte="mb",e.Kilobyte="kb",e.Byte="b"}(g||(g={}));const h=(0,c.rA)()?1024:1e3,u=[g.Gigabyte,g.Megabyte,g.Kilobyte,g.Byte],m=function(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;if(t||(t=g.Byte),i<0&&(i=0),e<0)throw new Error("Size must be greater than or equal to 0");const s=u.indexOf(t);return s&&e>h/2?m(e/h,u[s-1],i):"".concat(e.toFixed(i)).concat(t.toUpperCase())};var f=i(98478),x=i(86659),w=i(8879),y=i(68411),b=i(51622),F=i(9003),S=i(81354),v=i(1515);const j=(0,v.Z)("section",{target:"e1b2p2ww15"})((e=>{let{isDisabled:t,theme:i}=e;return{display:"flex",alignItems:"center",padding:i.spacing.lg,backgroundColor:i.colors.secondaryBg,borderRadius:i.radii.lg,":focus":{outline:"none"},":focus-visible":{boxShadow:"0 0 0 1px ".concat(i.colors.primary)},color:t?i.colors.gray:i.colors.bodyText}}),""),I=(0,v.Z)("div",{target:"e1b2p2ww14"})((()=>({marginRight:"auto",alignItems:"center",display:"flex"})),""),U=(0,v.Z)("span",{target:"e1b2p2ww13"})((e=>{let{theme:t}=e;return{color:t.colors.darkenedBgMix100,marginRight:t.spacing.lg}}),""),M=(0,v.Z)("span",{target:"e1b2p2ww12"})((e=>{let{theme:t}=e;return{marginBottom:t.spacing.twoXS}}),""),z=(0,v.Z)("div",{target:"e1b2p2ww11"})({name:"1fttcpj",styles:"display:flex;flex-direction:column"}),L=(0,v.Z)("div",{target:"e1b2p2ww10"})((e=>{let{theme:t}=e;return{left:0,right:0,lineHeight:t.lineHeights.tight,paddingTop:t.spacing.md,paddingLeft:t.spacing.lg,paddingRight:t.spacing.lg}}),""),C=(0,v.Z)("ul",{target:"e1b2p2ww9"})((()=>({listStyleType:"none",marginBottom:0})),""),B=(0,v.Z)("li",{target:"e1b2p2ww8"})((e=>{let{theme:t}=e;return{margin:t.spacing.none,padding:t.spacing.none}}),""),Z=(0,v.Z)("div",{target:"e1b2p2ww7"})((e=>{let{theme:t}=e;return{display:"flex",alignItems:"baseline",flex:1,paddingLeft:t.spacing.lg,overflow:"hidden"}}),""),R=(0,v.Z)("div",{target:"e1b2p2ww6"})((e=>{let{theme:t}=e;return{marginRight:t.spacing.sm,marginBottom:t.spacing.twoXS,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}),""),k=(0,v.Z)("div",{target:"e1b2p2ww5"})((e=>{let{theme:t}=e;return{display:"flex",alignItems:"center",marginBottom:t.spacing.twoXS}}),""),T=(0,v.Z)("span",{target:"e1b2p2ww4"})((e=>{let{theme:t}=e;return{marginRight:t.spacing.twoXS}}),""),D=(0,v.Z)("div",{target:"e1b2p2ww3"})((e=>{let{theme:t}=e;return{display:"flex",padding:t.spacing.twoXS,color:t.colors.darkenedBgMix100}}),""),X=(0,v.Z)("small",{target:"e1b2p2ww2"})((e=>{let{theme:t}=e;return{color:t.colors.danger,fontSize:t.fontSizes.sm,height:t.fontSizes.sm,lineHeight:t.fontSizes.sm,display:"flex",alignItems:"center",whiteSpace:"nowrap"}}),""),P=(0,v.Z)("span",{target:"e1b2p2ww1"})({name:"0",styles:""}),E=e=>({[j]:{display:"flex",flexDirection:"column",alignItems:"flex-start"},[I]:{marginBottom:e.spacing.lg},[U]:{display:"none"},[L]:{paddingRight:e.spacing.lg},[k]:{maxWidth:"inherit",flex:1,alignItems:"flex-start",marginBottom:e.spacing.sm},[R]:{width:e.sizes.full},[Z]:{flexDirection:"column"},[X]:{height:"auto",whiteSpace:"initial"},[P]:{display:"none"},[B]:{margin:e.spacing.none,padding:e.spacing.none}}),A=(0,v.Z)("div",{target:"e1b2p2ww0"})((e=>{let{theme:t}=e;return t.inSidebar?E(t):{["@media (max-width: ".concat(t.breakpoints.sm,")")]:E(t)}}),"");var V=i(74529),N=i(46927),W=i(33746),O=i(40864);const H=e=>{let{multiple:t,acceptedExtensions:i,maxSizeBytes:s}=e;return(0,O.jsxs)(I,{"data-testid":"stFileUploaderDropzoneInstructions",children:[(0,O.jsx)(U,{children:(0,O.jsx)(N.Z,{content:V.n,size:"threeXL"})}),(0,O.jsxs)(z,{children:[(0,O.jsxs)(M,{children:["Drag and drop file",t?"s":""," here"]}),(0,O.jsxs)(W.x,{children:["Limit ".concat(m(s,g.Byte,0)," per file"),i.length?" \u2022 ".concat(i.map((e=>e.replace(/^\./,"").toUpperCase())).join(", ")):null]})]})]})},_=e=>{let{onDrop:t,multiple:i,acceptedExtensions:s,maxSizeBytes:n,disabled:l,label:a}=e;return(0,O.jsx)(b.ZP,{onDrop:t,multiple:i,accept:s.length?s:void 0,maxSize:n,disabled:l,useFsAccessApi:!1,children:e=>{let{getRootProps:t,getInputProps:r}=e;return(0,O.jsxs)(j,{...t(),"data-testid":"stFileUploaderDropzone",isDisabled:l,"aria-label":a,children:[(0,O.jsx)("input",{"data-testid":"stFileUploaderDropzoneInput",...r()}),(0,O.jsx)(H,{multiple:i,acceptedExtensions:s,maxSizeBytes:n}),(0,O.jsx)(F.ZP,{kind:S.nW.SECONDARY,disabled:l,size:S.V5.SMALL,children:"Browse files"})]})}})};var G=i(13005),K=i.n(G),$=i(30351),q=i(14609);const J=(0,v.Z)("div",{target:"e16k0npc1"})((e=>{let{theme:t}=e;return{display:"flex",alignItems:"center",justifyContent:"space-between",paddingBottom:t.spacing.twoXS,marginBottom:t.spacing.twoXS}}),""),Y=(0,v.Z)("div",{target:"e16k0npc0"})((e=>{let{theme:t}=e;return{display:"flex",alignItems:"center",justifyContent:"center",color:t.colors.fadedText40}}),""),Q=e=>{let{className:t,currentPage:i,totalPages:s,onNext:n,onPrevious:l}=e;return(0,O.jsxs)(J,{className:t,"data-testid":"stPagination",children:[(0,O.jsx)(W.x,{children:"Showing page ".concat(i," of ").concat(s)}),(0,O.jsxs)(Y,{children:[(0,O.jsx)(F.ZP,{onClick:l,kind:S.nW.MINIMAL,children:(0,O.jsx)(N.Z,{content:$.s,size:"xl"})}),(0,O.jsx)(F.ZP,{onClick:n,kind:S.nW.MINIMAL,children:(0,O.jsx)(N.Z,{content:q._,size:"xl"})})]})]})};var ee=i(88235);const te=(e,t)=>Math.ceil(e.length/t),ie=e=>K()((t=>{let{pageSize:i,items:s,resetOnAdd:n,...l}=t;const[a,r]=(0,o.useState)(0),[d,p]=(0,o.useState)(te(s,i)),c=(0,ee.D)(s);(0,o.useEffect)((()=>{c&&c.length!==s.length&&p(te(s,i)),c&&c.length<s.length?n&&r(0):a+1>=d&&r(d-1)}),[s,a,i,c,n,d]);const g=s.slice(a*i,a*i+i);return(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(e,{items:g,...l}),s.length>i?(0,O.jsx)(Q,{className:"streamlit-paginator",pageSize:i,totalPages:d,currentPage:a+1,onNext:()=>{r(Math.min(a+1,d-1))},onPrevious:()=>{r(Math.max(0,a-1))}}):null]})}),e);var se=i(62288),ne=i(87847),le=i(31197),ae=i(90186);const re=e=>{let{fileInfo:t}=e;return"uploading"===t.status.type?(0,O.jsx)(ae.Z,{value:t.status.progress,size:ae.$.SMALL,overrides:{Bar:{style:{marginLeft:0,marginTop:"4px"}}}}):"error"===t.status.type?(0,O.jsxs)(X,{children:[(0,O.jsx)(T,{"data-testid":"stFileUploaderFileErrorMessage",children:t.status.errorMessage}),(0,O.jsx)(P,{children:(0,O.jsx)(N.Z,{content:se.j,size:"lg"})})]}):"uploaded"===t.status.type?(0,O.jsx)(W.x,{children:m(t.size,g.Byte)}):null},oe=e=>{let{fileInfo:t,onDelete:i}=e;return(0,O.jsxs)(k,{className:"stFileUploaderFile","data-testid":"stFileUploaderFile",children:[(0,O.jsx)(D,{children:(0,O.jsx)(N.Z,{content:ne.h,size:"twoXL"})}),(0,O.jsxs)(Z,{className:"stFileUploaderFileData",children:[(0,O.jsx)(R,{className:"stFileUploaderFileName","data-testid":"stFileUploaderFileName",title:t.name,children:t.name}),(0,O.jsx)(re,{fileInfo:t})]}),(0,O.jsx)("div",{"data-testid":"stFileUploaderDeleteBtn",children:(0,O.jsx)(F.ZP,{onClick:()=>i(t.id),kind:S.nW.MINIMAL,children:(0,O.jsx)(N.Z,{content:le.U,size:"lg"})})})]})},de=ie((e=>{let{items:t,onDelete:i}=e;return(0,O.jsx)(C,{children:t.map((e=>(0,O.jsx)(B,{children:(0,O.jsx)(oe,{fileInfo:e,onDelete:i})},e.id)))})})),pe=e=>(0,O.jsx)(L,{children:(0,O.jsx)(de,{...e})});var ce=i(77367);class ge extends o.PureComponent{constructor(e){super(e),this.formClearHelper=new p.K,this.localFileIdCounter=1,this.forceUpdatingStatus=!1,this.componentDidUpdate=()=>{if("ready"!==this.status)return;const e=this.createWidgetValue(),{element:t,widgetMgr:i,fragmentId:s}=this.props,n=i.getFileUploaderStateValue(t);l()(e,n)||i.setFileUploaderStateValue(t,e,{fromUi:!0},s)},this.reset=()=>{this.setState({files:[]})},this.dropHandler=(e,t)=>{const{element:i}=this.props,{multipleFiles:s}=i;if(!s&&0===e.length&&t.length>1){const i=t.findIndex((e=>1===e.errors.length&&"too-many-files"===e.errors[0].code));i>=0&&(e.push(t[i].file),t.splice(i,1))}if(this.props.uploadClient.fetchFileURLs(e).then((t=>{if(!s&&e.length>0){const e=this.state.files.find((e=>"error"!==e.status.type));e&&(this.forceUpdatingStatus=!0,this.deleteFile(e.id),this.forceUpdatingStatus=!1)}r()(t,e).forEach((e=>{let[t,i]=e;this.uploadFile(t,i)}))})).catch((t=>{this.addFiles(e.map((e=>new ce.R(e.name,e.size,this.nextLocalFileId(),{type:"error",errorMessage:t}))))})),t.length>0){const e=t.map((e=>{const{file:t}=e;return new ce.R(t.name,t.size,this.nextLocalFileId(),{type:"error",errorMessage:this.getErrorMessage(e.errors[0].code,e.file)})}));this.addFiles(e)}},this.uploadFile=(e,t)=>{const i=s.Z.CancelToken.source(),n=new ce.R(t.name,t.size,this.nextLocalFileId(),{type:"uploading",cancelToken:i,progress:1});this.addFile(n),this.props.uploadClient.uploadFile(this.props.element,e.uploadUrl,t,(e=>this.onUploadProgress(e,n.id)),i.token).then((()=>this.onUploadComplete(n.id,e))).catch((e=>{s.Z.isCancel(e)||this.updateFile(n.id,n.setStatus({type:"error",errorMessage:e?e.toString():"Unknown error"}))}))},this.onUploadComplete=(e,t)=>{const i=this.getFile(e);null!=i&&"uploading"===i.status.type&&this.updateFile(i.id,i.setStatus({type:"uploaded",fileId:t.fileId,fileUrls:t}))},this.getErrorMessage=(e,t)=>{switch(e){case"file-too-large":return"File must be ".concat(m(this.maxUploadSizeInBytes,g.Byte)," or smaller.");case"file-invalid-type":return"".concat(t.type," files are not allowed.");case"file-too-small":return"File size is too small.";case"too-many-files":return"Only one file is allowed.";default:return"Unexpected error. Please try again."}},this.deleteFile=e=>{const t=this.getFile(e);null!=t&&("uploading"===t.status.type&&t.status.cancelToken.cancel(),"uploaded"===t.status.type&&t.status.fileUrls.deleteUrl&&this.props.uploadClient.deleteFile(t.status.fileUrls.deleteUrl),this.removeFile(e))},this.addFile=e=>{this.setState((t=>({files:[...t.files,e]})))},this.addFiles=e=>{this.setState((t=>({files:[...t.files,...e]})))},this.removeFile=e=>{this.setState((t=>({files:t.files.filter((t=>t.id!==e))})))},this.getFile=e=>this.state.files.find((t=>t.id===e)),this.updateFile=(e,t)=>{this.setState((i=>({files:i.files.map((i=>i.id===e?t:i))})))},this.onUploadProgress=(e,t)=>{const i=this.getFile(t);if(null==i||"uploading"!==i.status.type)return;const s=Math.round(100*e.loaded/e.total);i.status.progress!==s&&this.updateFile(t,i.setStatus({type:"uploading",cancelToken:i.status.cancelToken,progress:s}))},this.onFormCleared=()=>{this.setState({files:[]},(()=>{const e=this.createWidgetValue();if(null==e)return;const{widgetMgr:t,element:i,fragmentId:s}=this.props;t.setFileUploaderStateValue(i,e,{fromUi:!0},s)}))},this.state=this.initialValue}get initialValue(){const e={files:[],newestServerFileId:0},{widgetMgr:t,element:i}=this.props,s=t.getFileUploaderStateValue(i);if(null==s)return e;const{uploadedFileInfo:n}=s;return null==n||0===n.length?e:{files:n.map((e=>{const t=e.name,i=e.size,s=e.fileId,n=e.fileUrls;return new ce.R(t,i,this.nextLocalFileId(),{type:"uploaded",fileId:s,fileUrls:n})}))}}componentWillUnmount(){this.formClearHelper.disconnect()}get maxUploadSizeInBytes(){return((e,t,i)=>{if(e<0)throw Error("Size must be 0 or greater");const s=u.findIndex((e=>e===t)),n=u.findIndex((e=>e===i));if(-1===s||-1===n)throw Error("Unexpected byte unit provided");if(s===n)return e;const l=Math.abs(s-n),a=h**l;return s>n?e/a:e*a})(this.props.element.maxUploadSizeMb,g.Megabyte,g.Byte)}get status(){return this.state.files.some((e=>"uploading"===e.status.type))||this.forceUpdatingStatus?"updating":"ready"}componentDidMount(){const e=this.createWidgetValue(),{element:t,widgetMgr:i,fragmentId:s}=this.props;void 0===i.getFileUploaderStateValue(t)&&i.setFileUploaderStateValue(t,e,{fromUi:!1},s)}createWidgetValue(){const e=this.state.files.filter((e=>"uploaded"===e.status.type)).map((e=>{const{name:t,size:i,status:s}=e,{fileId:n,fileUrls:l}=s;return new d.jM({fileId:n,fileUrls:l,name:t,size:i})}));return new d.xO({uploadedFileInfo:e})}render(){var e;const{files:t}=this.state,{element:i,disabled:s,widgetMgr:n}=this.props,l=i.type;this.formClearHelper.manageFormClearListener(n,i.formId,this.onFormCleared);const a=t.slice().reverse();return(0,O.jsxs)(A,{"data-testid":"stFileUploader",children:[(0,O.jsx)(f.O,{label:i.label,disabled:s,labelVisibility:(0,c.iF)(null===(e=i.labelVisibility)||void 0===e?void 0:e.value),children:i.help&&(0,O.jsx)(x.dT,{children:(0,O.jsx)(w.Z,{content:i.help,placement:y.u.TOP_RIGHT})})}),(0,O.jsx)(_,{onDrop:this.dropHandler,multiple:i.multipleFiles,acceptedExtensions:l,maxSizeBytes:this.maxUploadSizeInBytes,label:i.label,disabled:s}),a.length>0&&(0,O.jsx)(pe,{items:a,pageSize:3,onDelete:this.deleteFile,resetOnAdd:!0})]})}nextLocalFileId(){return this.localFileIdCounter++}}const he=ge},87814:(e,t,i)=>{i.d(t,{K:()=>n});var s=i(50641);class n{constructor(){this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}manageFormClearListener(e,t,i){null!=this.formClearListener&&this.lastWidgetMgr===e&&this.lastFormId===t||(this.disconnect(),(0,s.bM)(t)&&(this.formClearListener=e.addFormClearedListener(t,i),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}}}}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_streamlit_app=self.webpackChunk_streamlit_app||[]).push([[5379],{79986:(t,e,r)=>{"use strict";r.d(e,{Z:()=>d});r(66845);var n,o=r(50641),i=r(86659),s=r(50669),a=r(1515);const l=(0,r(7865).F4)(n||(n=(0,s.Z)(["\n 50% {\n color: rgba(0, 0, 0, 0);\n }\n"]))),u=(0,a.Z)("span",{target:"edlqvik0"})((t=>{let{includeDot:e,shouldBlink:r,theme:n}=t;return{...e?{"&::before":{opacity:1,content:'"\u2022"',animation:"none",color:n.colors.gray,margin:"0 5px"}}:{},...r?{color:n.colors.red,animationName:"".concat(l),animationDuration:"0.5s",animationIterationCount:5}:{}}}),"");var c=r(40864);const d=t=>{let{dirty:e,value:r,maxLength:n,className:s,type:a="single",inForm:l}=t;const d=[],p=function(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];d.push((0,c.jsx)(u,{includeDot:d.length>0,shouldBlink:e,children:t},d.length))};if(e){const t=l?"submit form":"apply";if("multiline"===a){const e=(0,o.Ge)()?"\u2318":"Ctrl";p("Press ".concat(e,"+Enter to ").concat(t))}else"single"===a&&p("Press Enter to ".concat(t))}return n&&("chat"!==a||e)&&p("".concat(r.length,"/").concat(n),e&&r.length>=n),(0,c.jsx)(i.X7,{"data-testid":"InputInstructions",className:s,children:d})}},87814:(t,e,r)=>{"use strict";r.d(e,{K:()=>o});var n=r(50641);class o{constructor(){this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}manageFormClearListener(t,e,r){null!=this.formClearListener&&this.lastWidgetMgr===t&&this.lastFormId===e||(this.disconnect(),(0,n.bM)(e)&&(this.formClearListener=t.addFormClearedListener(e,r),this.lastWidgetMgr=t,this.lastFormId=e))}disconnect(){var t;null===(t=this.formClearListener)||void 0===t||t.disconnect(),this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}}},35379:(t,e,r)=>{"use strict";r.r(e),r.d(e,{default:()=>v});var n=r(66845),o=r(87814),i=r(118),s=r(79986),a=r(98478),l=r(86659),u=r(8879),c=r(68411),d=r(50641),p=r(48266);const f=(0,r(1515).Z)("div",{target:"ezh4s2r0"})({name:"1om1ktf",styles:"div{border-width:1px;}"});var h=r(70479),m=r.n(h),y=r(40864);class b extends n.PureComponent{get initialValue(){var t;const e=this.props.widgetMgr.getStringValue(this.props.element);return null!==(t=null!==e&&void 0!==e?e:this.props.element.default)&&void 0!==t?t:null}constructor(t){super(t),this.formClearHelper=new o.K,this.id=void 0,this.state={dirty:!1,value:this.initialValue},this.commitWidgetValue=t=>{const{widgetMgr:e,element:r,fragmentId:n}=this.props;e.setStringValue(r,this.state.value,t,n),this.setState({dirty:!1})},this.onFormCleared=()=>{this.setState(((t,e)=>{var r;return{value:null!==(r=e.element.default)&&void 0!==r?r:null}}),(()=>this.commitWidgetValue({fromUi:!0})))},this.onBlur=()=>{this.state.dirty&&this.commitWidgetValue({fromUi:!0})},this.onChange=t=>{const{value:e}=t.target,{element:r}=this.props,{maxChars:n}=r;0!==n&&e.length>n||this.setState({dirty:!0,value:e})},this.isEnterKeyPressed=t=>{var e;const{keyCode:r,key:n}=t;return("Enter"===n||13===r||10===r)&&!(!0===(null===(e=t.nativeEvent)||void 0===e?void 0:e.isComposing))},this.onKeyDown=t=>{const{metaKey:e,ctrlKey:r}=t,{dirty:n}=this.state;if(this.isEnterKeyPressed(t)&&(r||e)&&n){t.preventDefault(),this.commitWidgetValue({fromUi:!0});const{formId:e}=this.props.element;(0,d.$b)({formId:e})&&this.props.widgetMgr.submitForm(this.props.element.formId,this.props.fragmentId)}},this.id=m()("text_area_")}componentDidMount(){this.props.element.setValue?this.updateFromProtobuf():this.commitWidgetValue({fromUi:!1})}componentDidUpdate(){this.maybeUpdateFromProtobuf()}componentWillUnmount(){this.formClearHelper.disconnect()}maybeUpdateFromProtobuf(){const{setValue:t}=this.props.element;t&&this.updateFromProtobuf()}updateFromProtobuf(){const{value:t}=this.props.element;this.props.element.setValue=!1,this.setState({value:null!==t&&void 0!==t?t:null},(()=>{this.commitWidgetValue({fromUi:!1})}))}render(){var t;const{element:e,disabled:r,width:n,widgetMgr:o}=this.props,{value:h,dirty:m}=this.state,b={width:n},{height:v,placeholder:g}=e;return this.formClearHelper.manageFormClearListener(o,e.formId,this.onFormCleared),(0,y.jsxs)("div",{className:"stTextArea","data-testid":"stTextArea",style:b,children:[(0,y.jsx)(a.O,{label:e.label,disabled:r,labelVisibility:(0,d.iF)(null===(t=e.labelVisibility)||void 0===t?void 0:t.value),htmlFor:this.id,children:e.help&&(0,y.jsx)(l.dT,{children:(0,y.jsx)(u.Z,{content:e.help,placement:c.u.TOP_RIGHT})})}),(0,y.jsx)(f,{children:(0,y.jsx)(i.Z,{value:null!==h&&void 0!==h?h:"",placeholder:g,onBlur:this.onBlur,onChange:this.onChange,onKeyDown:this.onKeyDown,"aria-label":e.label,disabled:r,id:this.id,overrides:{Input:{style:{lineHeight:"1.4",height:v?"".concat(v,"px"):"",minHeight:"95px",resize:"vertical","::placeholder":{opacity:"0.7"},paddingRight:"1rem",paddingLeft:"1rem",paddingBottom:"1rem",paddingTop:"1rem"}}}})}),n>p.A.hideWidgetDetails&&(0,y.jsx)(s.Z,{dirty:m,value:null!==h&&void 0!==h?h:"",maxLength:e.maxChars,type:"multiline",inForm:(0,d.$b)({formId:e.formId})})]})}}const v=b},118:(t,e,r)=>{"use strict";r.d(e,{Z:()=>F});var n=r(66845),o=r(80318),i=r(9656),s=r(38254),a=r(80745),l=r(98479);function u(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function c(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?u(Object(r),!0).forEach((function(e){d(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):u(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function d(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var p=(0,a.zo)("div",(function(t){return c(c({},(0,l.d5)(c(c({$positive:!1},t),{},{$hasIconTrailing:!1}))),{},{width:t.$resize?"fit-content":"100%"})}));p.displayName="StyledTextAreaRoot",p.displayName="StyledTextAreaRoot";var f=(0,a.zo)("div",(function(t){return(0,l.hB)(c({$positive:!1},t))}));f.displayName="StyledTextareaContainer",f.displayName="StyledTextareaContainer";var h=(0,a.zo)("textarea",(function(t){return c(c({},(0,l.Hx)(t)),{},{resize:t.$resize||"none"})}));function m(t){return m="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},m(t)}function y(){return y=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},y.apply(this,arguments)}function b(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!==typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==r)return;var n,o,i=[],s=!0,a=!1;try{for(r=r.call(t);!(s=(n=r.next()).done)&&(i.push(n.value),!e||i.length!==e);s=!0);}catch(l){a=!0,o=l}finally{try{s||null==r.return||r.return()}finally{if(a)throw o}}return i}(t,e)||function(t,e){if(!t)return;if("string"===typeof t)return v(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return v(t,e)}(t,e)||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 v(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function g(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function O(t,e){return O=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},O(t,e)}function w(t){var e=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(t){return!1}}();return function(){var r,n=x(t);if(e){var o=x(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return function(t,e){if(e&&("object"===m(e)||"function"===typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return j(t)}(this,r)}}function j(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function x(t){return x=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},x(t)}function P(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}h.displayName="StyledTextarea",h.displayName="StyledTextarea";var C=function(t){!function(t,e){if("function"!==typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&O(t,e)}(u,t);var e,r,a,l=w(u);function u(){var t;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,u);for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return P(j(t=l.call.apply(l,[this].concat(r))),"state",{isFocused:t.props.autoFocus||!1}),P(j(t),"onFocus",(function(e){t.setState({isFocused:!0}),t.props.onFocus(e)})),P(j(t),"onBlur",(function(e){t.setState({isFocused:!1}),t.props.onBlur(e)})),t}return e=u,(r=[{key:"render",value:function(){var t=this.props.overrides,e=void 0===t?{}:t,r=b((0,o.jb)(e.Root,p),2),a=r[0],l=r[1],u=(0,o.aO)({Input:{component:h},InputContainer:{component:f}},e);return n.createElement(a,y({"data-baseweb":"textarea",$isFocused:this.state.isFocused,$isReadOnly:this.props.readOnly,$disabled:this.props.disabled,$error:this.props.error,$positive:this.props.positive,$required:this.props.required,$resize:this.props.resize},l),n.createElement(i.Z,y({},this.props,{type:s.iB.textarea,overrides:u,onFocus:this.onFocus,onBlur:this.onBlur,resize:this.props.resize})))}}])&&g(e.prototype,r),a&&g(e,a),Object.defineProperty(e,"prototype",{writable:!1}),u}(n.Component);P(C,"defaultProps",{autoFocus:!1,disabled:!1,readOnly:!1,error:!1,name:"",onBlur:function(){},onChange:function(){},onKeyDown:function(){},onKeyPress:function(){},onKeyUp:function(){},onFocus:function(){},overrides:{},placeholder:"",required:!1,rows:3,size:s.NO.default});const F=C},70479:(t,e,r)=>{var n=r(38145),o=0;t.exports=function(t){var e=++o;return n(t)+e}}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunk_streamlit_app=self.webpackChunk_streamlit_app||[]).push([[5441],{5441:(e,t,o)=>{o.r(t),o.d(t,{default:()=>P});var n=o(66845),i=o(25621),s=o(72965),a=o(94206),r=o(60784),l=o(62813),d=o.n(l),c=o(50641),h=o(23849),u=o(23593),m=o(63765),g=o(87814),p=o(91191);const f={DATAFRAME_INDEX:"(index)"},v=new Set([p.GI.DatetimeIndex,p.GI.Float64Index,p.GI.Int64Index,p.GI.RangeIndex,p.GI.UInt64Index]);function b(e){var t;if(0===(null===(t=e.datasets)||void 0===t?void 0:t.length))return null;const o={};return e.datasets.forEach((e=>{if(!e)return;const t=e.hasName?e.name:null;o[t]=e.data})),o}function w(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(e.isEmpty())return[];const o=[],{dataRows:n,dataColumns:i}=e.dimensions,s=p.fu.getTypeName(e.types.index[0]),a=v.has(s);for(let r=t;r<n;r++){const t={};if(a){const o=e.getIndexValue(r,0);t[f.DATAFRAME_INDEX]="bigint"===typeof o?Number(o):o}for(let o=0;o<i;o++){const n=e.getDataValue(r,o),i=e.types.data[o],s=p.fu.getTypeName(i);if("datetimetz"!==s&&(n instanceof Date||Number.isFinite(n))&&(s.startsWith("datetime")||"date"===s)){const i=60*new Date(n).getTimezoneOffset()*1e3;t[e.columns[0][o]]=n.valueOf()+i}else t[e.columns[0][o]]="bigint"===typeof n?Number(n):n}o.push(t)}return o}var y=o(96825),x=o.n(y),S=o(99394),F=o.n(S),C=o(27466);function z(e,t){const o={font:t.genericFonts.bodyFont,background:t.colors.bgColor,fieldTitle:"verbal",autosize:{type:"fit",contains:"padding"},title:{align:"left",anchor:"start",color:t.colors.headingColor,titleFontStyle:"normal",fontWeight:t.fontWeights.bold,fontSize:t.fontSizes.smPx+2,orient:"top",offset:26},header:{titleFontWeight:t.fontWeights.normal,titleFontSize:t.fontSizes.mdPx,titleColor:(0,C.Xy)(t),titleFontStyle:"normal",labelFontSize:t.fontSizes.twoSmPx,labelFontWeight:t.fontWeights.normal,labelColor:(0,C.Xy)(t),labelFontStyle:"normal"},axis:{labelFontSize:t.fontSizes.twoSmPx,labelFontWeight:t.fontWeights.normal,labelColor:(0,C.Xy)(t),labelFontStyle:"normal",titleFontWeight:t.fontWeights.normal,titleFontSize:t.fontSizes.smPx,titleColor:(0,C.Xy)(t),titleFontStyle:"normal",ticks:!1,gridColor:(0,C.ny)(t),domain:!1,domainWidth:1,domainColor:(0,C.ny)(t),labelFlush:!0,labelFlushOffset:1,labelBound:!1,labelLimit:100,titlePadding:t.spacing.lgPx,labelPadding:t.spacing.lgPx,labelSeparation:t.spacing.twoXSPx,labelOverlap:!0},legend:{labelFontSize:t.fontSizes.smPx,labelFontWeight:t.fontWeights.normal,labelColor:(0,C.Xy)(t),titleFontSize:t.fontSizes.smPx,titleFontWeight:t.fontWeights.normal,titleFontStyle:"normal",titleColor:(0,C.Xy)(t),titlePadding:5,labelPadding:t.spacing.lgPx,columnPadding:t.spacing.smPx,rowPadding:t.spacing.twoXSPx,padding:7,symbolStrokeWidth:4},range:{category:(0,C.iY)(t),diverging:(0,C.ru)(t),ramp:(0,C.Gy)(t),heatmap:(0,C.Gy)(t)},view:{columns:1,strokeWidth:0,stroke:"transparent",continuousHeight:350,continuousWidth:400,discreteHeight:350,discreteWidth:{step:20}},concat:{columns:1},facet:{columns:1},mark:{tooltip:!0,...(0,C.Iy)(t)?{color:"#0068C9"}:{color:"#83C9FF"}},bar:{binSpacing:t.spacing.twoXSPx,discreteBandSize:{band:.85}},axisDiscrete:{grid:!1},axisXPoint:{grid:!1},axisTemporal:{grid:!1},axisXBand:{grid:!1}};return e?F()({},o,e,((e,t)=>Array.isArray(t)?t:void 0)):o}const W=(0,o(1515).Z)("div",{target:"egd2k5h0"})((e=>{let{theme:t,useContainerWidth:o,isFullScreen:n}=e;return{width:o||n?"100%":"auto",height:n?"100%":"auto","&.vega-embed":{"&:hover summary, .vega-embed:focus summary":{background:"transparent"},"&.has-actions":{paddingRight:0},".vega-actions":{zIndex:t.zIndices.popupMenu,backgroundColor:t.colors.bgColor,boxShadow:"rgb(0 0 0 / 16%) 0px 4px 16px",border:"1px solid ".concat(t.colors.fadedText10),a:{fontFamily:t.genericFonts.bodyFont,fontWeight:t.fontWeights.normal,fontSize:t.fontSizes.md,margin:0,padding:"".concat(t.spacing.twoXS," ").concat(t.spacing.twoXL),color:t.colors.bodyText},"a:hover":{backgroundColor:t.colors.secondaryBg,color:t.colors.bodyText},":before":{content:"none"},":after":{content:"none"}},summary:{opacity:0,height:"auto",zIndex:t.zIndices.menuButton,border:"none",boxShadow:"none",borderRadius:t.radii.lg,color:t.colors.fadedText10,backgroundColor:"transparent",transition:"opacity 300ms 150ms,transform 300ms 150ms","&:active, &:focus-visible, &:hover":{border:"none",boxShadow:"none",color:t.colors.bodyText,opacity:"1 !important",background:t.colors.darkenedBgMix25}}}}}),"");var V=o(40864);const I="source";class D extends n.PureComponent{constructor(){super(...arguments),this.vegaView=void 0,this.vegaFinalizer=void 0,this.defaultDataName=I,this.element=null,this.formClearHelper=new g.K,this.state={error:void 0},this.finalizeView=()=>{this.vegaFinalizer&&this.vegaFinalizer(),this.vegaFinalizer=void 0,this.vegaView=void 0},this.generateSpec=()=>{var e,t;const{element:o,theme:n,isFullScreen:i,width:s,height:a}=this.props,r=JSON.parse(o.spec),{useContainerWidth:l}=o;if("streamlit"===o.vegaLiteTheme?r.config=z(r.config,n):"streamlit"===(null===(e=r.usermeta)||void 0===e||null===(t=e.embedOptions)||void 0===t?void 0:t.theme)?(r.config=z(r.config,n),r.usermeta.embedOptions.theme=void 0):r.config=function(e,t){const{colors:o,fontSizes:n,genericFonts:i}=t,s={labelFont:i.bodyFont,titleFont:i.bodyFont,labelFontSize:n.twoSmPx,titleFontSize:n.twoSmPx},a={background:o.bgColor,axis:{labelColor:o.bodyText,titleColor:o.bodyText,gridColor:(0,C.ny)(t),...s},legend:{labelColor:o.bodyText,titleColor:o.bodyText,...s},title:{color:o.bodyText,subtitleColor:o.bodyText,...s},header:{labelColor:o.bodyText,titleColor:o.bodyText,...s},view:{stroke:(0,C.ny)(t),continuousHeight:350,continuousWidth:400,discreteHeight:350,discreteWidth:{step:20}},mark:{tooltip:!0}};return e?x()({},a,e):a}(r.config,n),i?(r.width=s,r.height=a,"vconcat"in r&&r.vconcat.forEach((e=>{e.width=s}))):l&&(r.width=s,"vconcat"in r&&r.vconcat.forEach((e=>{e.width=s}))),r.padding||(r.padding={}),null==r.padding.bottom&&(r.padding.bottom=20),r.datasets)throw new Error("Datasets should not be passed as part of the spec");return o.selectionMode.length>0&&function(e){"params"in e&&"encoding"in e&&e.params.forEach((t=>{"select"in t&&(["interval","point"].includes(t.select)&&(t.select={type:t.select}),"type"in t.select&&"point"===t.select.type&&!("encodings"in t.select)&&(0,c.le)(t.select.encodings)&&(t.select.encodings=Object.keys(e.encoding)))}))}(r),r},this.maybeConfigureSelections=()=>{if(void 0===this.vegaView)return;const{widgetMgr:e,element:t}=this.props;if(null===t||void 0===t||!t.id||0===t.selectionMode.length)return;const o=e.getElementState(this.props.element.id,"viewState");if((0,c.bb)(o))try{this.vegaView=this.vegaView.setState(o)}catch(i){(0,h.KE)("Failed to restore view state",i)}t.selectionMode.forEach(((o,n)=>{var i;null===(i=this.vegaView)||void 0===i||i.addSignalListener(o,(0,c.Ds)(150,((o,n)=>{var i;const s=null===(i=this.vegaView)||void 0===i?void 0:i.getState({data:(e,o)=>t.selectionMode.some((t=>"".concat(t,"_store")===e)),recurse:!1});(0,c.bb)(s)&&e.setElementState(t.id,"viewState",s);let a=n;"vlPoint"in n&&"or"in n.vlPoint&&(a=n.vlPoint.or);const r=JSON.parse(e.getStringValue(t)||"{}"),l={selection:{...(null===r||void 0===r?void 0:r.selection)||{},[o]:a||{}}};d()(r,l)||e.setStringValue(t,JSON.stringify(l),{fromUi:!0},this.props.fragmentId)})))}));const n=()=>{const o={selection:{}};this.props.element.selectionMode.forEach((e=>{o.selection[e]={}}));const n=e.getStringValue(t),i=n?JSON.parse(n):o;var s;d()(i,o)||(null===(s=this.props.widgetMgr)||void 0===s||s.setStringValue(this.props.element,JSON.stringify(o),{fromUi:!0},this.props.fragmentId))};this.props.element.formId&&this.formClearHelper.manageFormClearListener(this.props.widgetMgr,this.props.element.formId,n)}}async componentDidMount(){try{await this.createView()}catch(e){const t=(0,m.b)(e);this.setState({error:t})}}componentWillUnmount(){this.finalizeView()}async componentDidUpdate(e){const{element:t,theme:o}=e,{element:n,theme:i}=this.props,s=t.spec,{spec:a}=n;if(!this.vegaView||s!==a||o!==i||e.width!==this.props.width||e.height!==this.props.height||e.element.vegaLiteTheme!==this.props.element.vegaLiteTheme||!d()(e.element.selectionMode,this.props.element.selectionMode)){(0,h.ji)("Vega spec changed.");try{await this.createView()}catch(g){const e=(0,m.b)(g);this.setState({error:e})}return}const r=t.data,{data:l}=n;(r||l)&&this.updateData(this.defaultDataName,r,l);const c=b(t)||{},u=b(n)||{};for(const[d,h]of Object.entries(u)){const e=d||this.defaultDataName,t=c[e];this.updateData(e,t,h)}for(const d of Object.keys(c))u.hasOwnProperty(d)||d===this.defaultDataName||this.updateData(d,null,null);this.vegaView.resize().runAsync()}updateData(e,t,o){if(!this.vegaView)throw new Error("Chart has not been drawn yet");if(!o||0===o.data.numRows)try{this.vegaView.remove(e,a.truthy)}finally{return}if(!t||0===t.data.numRows)return void this.vegaView.insert(e,w(o));const{dataRows:n,dataColumns:i}=t.dimensions,{dataRows:s,dataColumns:r}=o.dimensions;!function(e,t,o,n,i,s){if(o!==s)return!1;if(t>=i)return!1;if(0===t)return!1;const a=s-1,r=t-1;return e.getDataValue(0,a)===n.getDataValue(0,a)&&e.getDataValue(r,a)===n.getDataValue(r,a)}(t,n,i,o,s,r)?(this.vegaView.data(e,w(o)),(0,h.ji)("Had to clear the ".concat(e," dataset before inserting data through Vega view."))):n<s&&this.vegaView.insert(e,w(o,n))}async createView(){if((0,h.ji)("Creating a new Vega view."),!this.element)throw Error("Element missing.");this.finalizeView();const{element:e}=this.props,t=this.generateSpec(),o={ast:!0,expr:r.N,tooltip:{disableDefaultStyle:!0},defaultStyle:!1,forceActionsMenu:!0},{vgSpec:n,view:i,finalize:a}=await(0,s.ZP)(this.element,t,o);this.vegaView=i,this.maybeConfigureSelections(),this.vegaFinalizer=a;const l=function(e){const t=b(e);if(null==t)return null;const o={};for(const[n,i]of Object.entries(t))o[n]=w(i);return o}(e),d=l?Object.keys(l):[];if(1===d.length){const[e]=d;this.defaultDataName=e}else 0===d.length&&n.data&&(this.defaultDataName=I);const c=function(e){const t=e.data;return t&&0!==t.data.numRows?w(t):null}(e);if(c&&i.insert(this.defaultDataName,c),l)for(const[s,r]of Object.entries(l))i.insert(s,r);await i.runAsync(),this.vegaView.resize().runAsync()}render(){if(this.state.error)throw this.state.error;return(0,V.jsx)(W,{"data-testid":"stArrowVegaLiteChart",useContainerWidth:this.props.element.useContainerWidth,isFullScreen:this.props.isFullScreen,ref:e=>{this.element=e}})}}const P=(0,i.b)((0,u.Z)(D))},23593:(e,t,o)=>{o.d(t,{Z:()=>v});var n=o(66845),i=o(13005),s=o.n(i),a=o(25621),r=o(82218),l=o(97781),d=o(46927),c=o(66694),h=o(1515);const u=(0,h.Z)("button",{target:"e1vs0wn31"})((e=>{let{isExpanded:t,theme:o}=e;const n=t?{right:"0.4rem",top:"0.5rem",backgroundColor:"transparent"}:{right:"-3.0rem",top:"-0.375rem",opacity:0,transform:"scale(0)",backgroundColor:o.colors.lightenedBg05};return{position:"absolute",display:"flex",alignItems:"center",justifyContent:"center",zIndex:o.zIndices.sidebar+1,height:"2.5rem",width:"2.5rem",transition:"opacity 300ms 150ms, transform 300ms 150ms",border:"none",color:o.colors.fadedText60,borderRadius:"50%",...n,"&:focus":{outline:"none"},"&:active, &:focus-visible, &:hover":{opacity:1,outline:"none",transform:"scale(1)",color:o.colors.bodyText,transition:"none"}}}),""),m=(0,h.Z)("div",{target:"e1vs0wn30"})((e=>{let{theme:t,isExpanded:o}=e;return{"&:hover":{[u]:{opacity:1,transform:"scale(1)",transition:"none"}},...o?{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 g=o(40864);class p extends n.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:o}=this.state,{children:n,width:i,height:s,disableFullscreenMode:a}=this.props;let c=r.d,h=this.zoomIn,p="View fullscreen";return e&&(c=l.m,h=this.zoomOut,p="Exit fullscreen"),(0,g.jsxs)(m,{isExpanded:e,"data-testid":"stFullScreenFrame",children:[!a&&(0,g.jsx)(u,{"data-testid":"StyledFullScreenButton",onClick:h,title:p,isExpanded:e,children:(0,g.jsx)(d.Z,{content:c})}),n(e?{width:t,height:o,expanded:e,expand:this.zoomIn,collapse:this.zoomOut}:{width:i,height:s,expanded:e,expand:this.zoomIn,collapse:this.zoomOut})]})}}p.contextType=c.E;const f=(0,a.b)(p);const v=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];class o extends n.PureComponent{constructor(){super(...arguments),this.render=()=>{const{width:o,height:n,disableFullscreenMode:i}=this.props;return(0,g.jsx)(f,{width:o,height:n,disableFullscreenMode:t||i,children:t=>{let{width:o,height:n,expanded:i,expand:s,collapse:a}=t;return(0,g.jsx)(e,{...this.props,width:o,height:n,isFullScreen:i,expand:s,collapse:a})}})}}}return o.displayName="withFullScreenWrapper(".concat(e.displayName||e.name,")"),s()(o,e)}},87814:(e,t,o)=>{o.d(t,{K:()=>i});var n=o(50641);class i{constructor(){this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}manageFormClearListener(e,t,o){null!=this.formClearListener&&this.lastWidgetMgr===e&&this.lastFormId===t||(this.disconnect(),(0,n.bM)(t)&&(this.formClearListener=e.addFormClearedListener(t,o),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}}}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunk_streamlit_app=self.webpackChunk_streamlit_app||[]).push([[6013],{79986:(e,t,r)=>{r.d(t,{Z:()=>d});r(66845);var n,o=r(50641),i=r(86659),a=r(50669),s=r(1515);const c=(0,r(7865).F4)(n||(n=(0,a.Z)(["\n 50% {\n color: rgba(0, 0, 0, 0);\n }\n"]))),l=(0,s.Z)("span",{target:"edlqvik0"})((e=>{let{includeDot:t,shouldBlink:r,theme:n}=e;return{...t?{"&::before":{opacity:1,content:'"\u2022"',animation:"none",color:n.colors.gray,margin:"0 5px"}}:{},...r?{color:n.colors.red,animationName:"".concat(c),animationDuration:"0.5s",animationIterationCount:5}:{}}}),"");var u=r(40864);const d=e=>{let{dirty:t,value:r,maxLength:n,className:a,type:s="single",inForm:c}=e;const d=[],p=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];d.push((0,u.jsx)(l,{includeDot:d.length>0,shouldBlink:t,children:e},d.length))};if(t){const e=c?"submit form":"apply";if("multiline"===s){const t=(0,o.Ge)()?"\u2318":"Ctrl";p("Press ".concat(t,"+Enter to ").concat(e))}else"single"===s&&p("Press Enter to ".concat(e))}return n&&("chat"!==s||t)&&p("".concat(r.length,"/").concat(n),t&&r.length>=n),(0,u.jsx)(i.X7,{"data-testid":"InputInstructions",className:a,children:d})}},46013:(e,t,r)=>{r.r(t),r.d(t,{default:()=>x});var n=r(66845),o=r(25621),i=r(25773),a=r(69),s=n.forwardRef((function(e,t){return n.createElement(a.D,(0,i.Z)({iconAttrs:{fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),n.createElement("rect",{width:24,height:24,fill:"none"}),n.createElement("path",{d:"M3 5.51v3.71c0 .46.31.86.76.97L11 12l-7.24 1.81c-.45.11-.76.51-.76.97v3.71c0 .72.73 1.2 1.39.92l15.42-6.49c.82-.34.82-1.5 0-1.84L4.39 4.58C3.73 4.31 3 4.79 3 5.51z"}))}));s.displayName="Send";var c=r(118),l=r(46927),u=r(79986),d=r(27466),p=r(48266),f=r(1515);const h=(0,f.Z)("div",{target:"e1d2x3se4"})((e=>{var t;let{theme:r,width:n}=e;return{borderRadius:r.radii.lg,display:"flex",backgroundColor:null!==(t=r.colors.widgetBackgroundColor)&&void 0!==t?t:r.colors.secondaryBg,width:"".concat(n,"px")}}),""),y=(0,f.Z)("div",{target:"e1d2x3se3"})((e=>{let{theme:t}=e;return{backgroundColor:t.colors.transparent,position:"relative",flexGrow:1,borderRadius:t.radii.lg,display:"flex",alignItems:"center"}}),""),g=(0,f.Z)("button",{target:"e1d2x3se2"})((e=>{let{theme:t,disabled:r,extended:n}=e;const o=(0,d.Iy)(t),[i,a]=o?[t.colors.gray60,t.colors.gray80]:[t.colors.gray80,t.colors.gray40];return{border:"none",backgroundColor:t.colors.transparent,borderTopRightRadius:n?t.radii.none:t.radii.lg,borderTopLeftRadius:n?t.radii.lg:t.radii.none,borderBottomRightRadius:t.radii.lg,display:"inline-flex",alignItems:"center",justifyContent:"center",lineHeight:1,margin:0,padding:t.spacing.sm,color:r?i:a,pointerEvents:"auto","&:focus":{outline:"none"},":focus":{outline:"none"},"&:focus-visible":{backgroundColor:o?t.colors.gray10:t.colors.gray90},"&:hover":{backgroundColor:t.colors.primary,color:t.colors.white},"&:disabled, &:disabled:hover, &:disabled:active":{backgroundColor:t.colors.transparent,borderColor:t.colors.transparent,color:t.colors.gray}}}),""),b=(0,f.Z)("div",{target:"e1d2x3se1"})((()=>({display:"flex",alignItems:"flex-end",height:"100%",position:"absolute",right:"0px",pointerEvents:"none"})),""),m=(0,f.Z)("div",{target:"e1d2x3se0"})({name:"1lm6gnd",styles:"position:absolute;bottom:0px;right:3rem"});var v=r(40864);const x=function(e){let{width:t,element:r,widgetMgr:i,fragmentId:a}=e;const f=(0,o.u)(),[x,w]=(0,n.useState)(!1),[O,j]=(0,n.useState)(r.default),[C,S]=(0,n.useState)(0),P=(0,n.useRef)(null),R=(0,n.useRef)({minHeight:0,maxHeight:0}),k=()=>{P.current&&P.current.focus(),O&&(i.setStringTriggerValue(r,O,{fromUi:!0},a),w(!1),j(""),S(0))};(0,n.useEffect)((()=>{if(r.setValue){r.setValue=!1;const e=r.value||"";j(e),w(""!==e)}}),[r]),(0,n.useEffect)((()=>{if(P.current){const{offsetHeight:e}=P.current;R.current.minHeight=e,R.current.maxHeight=6.5*e}}),[P]);const{disabled:I,placeholder:E,maxChars:B}=r,T=(0,d.Iy)(f),{minHeight:F,maxHeight:Z}=R.current,z=T?f.colors.gray70:f.colors.gray80,A=!!(C>0&&P.current)&&Math.abs(C-F)>1;return(0,v.jsx)(h,{className:"stChatInput","data-testid":"stChatInput",width:t,children:(0,v.jsxs)(y,{children:[(0,v.jsx)(c.Z,{inputRef:P,value:O,placeholder:E,onChange:e=>{const{value:t}=e.target,{maxChars:n}=r;0!==n&&t.length>n||(w(""!==t),j(t),S((()=>{let e=0;const{current:t}=P;if(t){const r=t.placeholder;t.placeholder="",t.style.height="auto",e=t.scrollHeight,t.placeholder=r,t.style.height=""}return e})()))},onKeyDown:e=>{const{metaKey:t,ctrlKey:r,shiftKey:n}=e;(e=>{var t;const{keyCode:r,key:n}=e;return("Enter"===n||13===r||10===r)&&!(!0===(null===(t=e.nativeEvent)||void 0===t?void 0:t.isComposing))})(e)&&!n&&!r&&!t&&(e.preventDefault(),k())},"aria-label":E,disabled:I,rows:1,overrides:{Root:{style:{outline:"none",backgroundColor:f.colors.transparent,borderLeftWidth:"1px",borderRightWidth:"1px",borderTopWidth:"1px",borderBottomWidth:"1px",width:"".concat(t,"px")}},InputContainer:{style:{backgroundColor:f.colors.transparent}},Input:{props:{"data-testid":"stChatInputTextArea"},style:{lineHeight:"1.4",backgroundColor:f.colors.transparent,"::placeholder":{color:z},height:A?"".concat(C+1,"px"):"auto",maxHeight:Z?"".concat(Z,"px"):"none",paddingRight:"3rem",paddingLeft:f.spacing.sm,paddingBottom:f.spacing.sm,paddingTop:f.spacing.sm}}}}),t>p.A.hideWidgetDetails&&(0,v.jsx)(m,{children:(0,v.jsx)(u.Z,{dirty:x,value:O,maxLength:B,type:"chat",inForm:!1})}),(0,v.jsx)(b,{children:(0,v.jsx)(g,{onClick:k,disabled:!x||I,extended:A,"data-testid":"stChatInputSubmitButton",children:(0,v.jsx)(l.Z,{content:s,size:"xl",color:"inherit"})})})]})})}},118:(e,t,r)=>{r.d(t,{Z:()=>P});var n=r(66845),o=r(80318),i=r(9656),a=r(38254),s=r(80745),c=r(98479);function l(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 u(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?l(Object(r),!0).forEach((function(t){d(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):l(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function d(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var p=(0,s.zo)("div",(function(e){return u(u({},(0,c.d5)(u(u({$positive:!1},e),{},{$hasIconTrailing:!1}))),{},{width:e.$resize?"fit-content":"100%"})}));p.displayName="StyledTextAreaRoot",p.displayName="StyledTextAreaRoot";var f=(0,s.zo)("div",(function(e){return(0,c.hB)(u({$positive:!1},e))}));f.displayName="StyledTextareaContainer",f.displayName="StyledTextareaContainer";var h=(0,s.zo)("textarea",(function(e){return u(u({},(0,c.Hx)(e)),{},{resize:e.$resize||"none"})}));function y(e){return y="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},y(e)}function g(){return g=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},g.apply(this,arguments)}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=[],a=!0,s=!1;try{for(r=r.call(e);!(a=(n=r.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(c){s=!0,o=c}finally{try{a||null==r.return||r.return()}finally{if(s)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 x(e,t){return x=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},x(e,t)}function w(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=j(e);if(t){var o=j(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return function(e,t){if(t&&("object"===y(t)||"function"===typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return O(e)}(this,r)}}function O(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function j(e){return j=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},j(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}h.displayName="StyledTextarea",h.displayName="StyledTextarea";var S=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&&x(e,t)}(l,e);var t,r,s,c=w(l);function l(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,l);for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return C(O(e=c.call.apply(c,[this].concat(r))),"state",{isFocused:e.props.autoFocus||!1}),C(O(e),"onFocus",(function(t){e.setState({isFocused:!0}),e.props.onFocus(t)})),C(O(e),"onBlur",(function(t){e.setState({isFocused:!1}),e.props.onBlur(t)})),e}return t=l,(r=[{key:"render",value:function(){var e=this.props.overrides,t=void 0===e?{}:e,r=b((0,o.jb)(t.Root,p),2),s=r[0],c=r[1],l=(0,o.aO)({Input:{component:h},InputContainer:{component:f}},t);return n.createElement(s,g({"data-baseweb":"textarea",$isFocused:this.state.isFocused,$isReadOnly:this.props.readOnly,$disabled:this.props.disabled,$error:this.props.error,$positive:this.props.positive,$required:this.props.required,$resize:this.props.resize},c),n.createElement(i.Z,g({},this.props,{type:a.iB.textarea,overrides:l,onFocus:this.onFocus,onBlur:this.onBlur,resize:this.props.resize})))}}])&&v(t.prototype,r),s&&v(t,s),Object.defineProperty(t,"prototype",{writable:!1}),l}(n.Component);C(S,"defaultProps",{autoFocus:!1,disabled:!1,readOnly:!1,error:!1,name:"",onBlur:function(){},onChange:function(){},onKeyDown:function(){},onKeyPress:function(){},onKeyUp:function(){},onFocus:function(){},overrides:{},placeholder:"",required:!1,rows:3,size:a.NO.default});const P=S}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunk_streamlit_app=self.webpackChunk_streamlit_app||[]).push([[7175],{79986:(t,e,i)=>{i.d(e,{Z:()=>c});i(66845);var s,r=i(50641),o=i(86659),n=i(50669),a=i(1515);const l=(0,i(7865).F4)(s||(s=(0,n.Z)(["\n 50% {\n color: rgba(0, 0, 0, 0);\n }\n"]))),d=(0,a.Z)("span",{target:"edlqvik0"})((t=>{let{includeDot:e,shouldBlink:i,theme:s}=t;return{...e?{"&::before":{opacity:1,content:'"\u2022"',animation:"none",color:s.colors.gray,margin:"0 5px"}}:{},...i?{color:s.colors.red,animationName:"".concat(l),animationDuration:"0.5s",animationIterationCount:5}:{}}}),"");var u=i(40864);const c=t=>{let{dirty:e,value:i,maxLength:s,className:n,type:a="single",inForm:l}=t;const c=[],h=function(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];c.push((0,u.jsx)(d,{includeDot:c.length>0,shouldBlink:e,children:t},c.length))};if(e){const t=l?"submit form":"apply";if("multiline"===a){const e=(0,r.Ge)()?"\u2318":"Ctrl";h("Press ".concat(e,"+Enter to ").concat(t))}else"single"===a&&h("Press Enter to ".concat(t))}return s&&("chat"!==a||e)&&h("".concat(i.length,"/").concat(s),e&&i.length>=s),(0,u.jsx)(o.X7,{"data-testid":"InputInstructions",className:n,children:c})}},87814:(t,e,i)=>{i.d(e,{K:()=>r});var s=i(50641);class r{constructor(){this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}manageFormClearListener(t,e,i){null!=this.formClearListener&&this.lastWidgetMgr===t&&this.lastFormId===e||(this.disconnect(),(0,s.bM)(e)&&(this.formClearListener=t.addFormClearedListener(e,i),this.lastWidgetMgr=t,this.lastFormId=e))}disconnect(){var t;null===(t=this.formClearListener)||void 0===t||t.disconnect(),this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}}},67175:(t,e,i)=>{i.r(e),i.d(e,{default:()=>M});var s=i(66845),r=i(20607),o=i(89997),n=i(25621),a=i(52347),l=i(87814),d=i(23849),u=i(16295),c=i(48266),h=i(8879),m=i(68411),p=i(46927),g=i(82534),f=i(79986),b=i(98478),v=i(86659),y=i(50641),x=i(1515);const I=(0,x.Z)("div",{target:"e116k4er3"})((t=>{let{theme:e}=t;return{display:"flex",flexDirection:"row",flexWrap:"nowrap",alignItems:"center",borderWidth:"1px",borderStyle:"solid",borderColor:e.colors.widgetBorderColor||e.colors.widgetBackgroundColor||e.colors.bgColor,transitionDuration:"200ms",transitionProperty:"border",transitionTimingFunction:"cubic-bezier(0.2, 0.8, 0.4, 1)",borderRadius:e.radii.lg,overflow:"hidden","&.focused":{borderColor:e.colors.primary},input:{MozAppearance:"textfield","&::-webkit-inner-spin-button, &::-webkit-outer-spin-button":{WebkitAppearance:"none",margin:e.spacing.none}}}}),""),C=(0,x.Z)("div",{target:"e116k4er2"})({name:"76z9jo",styles:"display:flex;flex-direction:row;align-self:stretch"}),V=(0,x.Z)("button",{target:"e116k4er1"})((t=>{let{theme:e}=t;return{margin:e.spacing.none,border:"none",height:e.sizes.full,display:"flex",alignItems:"center",width:"".concat(32,"px"),justifyContent:"center",color:e.colors.bodyText,transition:"color 300ms, backgroundColor 300ms",backgroundColor:e.colors.widgetBackgroundColor||e.colors.secondaryBg,"&:hover:enabled, &:focus:enabled":{color:e.colors.white,backgroundColor:e.colors.primary,transition:"none",outline:"none"},"&:active":{outline:"none",border:"none"},"&:last-of-type":{borderTopRightRadius:e.radii.lg,borderBottomRightRadius:e.radii.lg},"&:disabled":{cursor:"not-allowed",color:e.colors.fadedText40}}}),""),w=(0,x.Z)("div",{target:"e116k4er0"})((t=>{let{theme:e,clearable:i}=t;return{position:"absolute",marginRight:e.spacing.twoXS,left:0,right:"".concat(64+(i?12:0),"px")}}),"");var F=i(70479),D=i.n(F),k=i(40864);class S extends s.PureComponent{constructor(t){super(t),this.formClearHelper=new l.K,this.id=void 0,this.inputRef=s.createRef(),this.formatValue=t=>{if((0,y.le)(t))return null;const e=function(t){return null==t||""===t?void 0:t}(this.props.element.format);if(null==e)return t.toString();try{return(0,a.sprintf)(e,t)}catch(i){return(0,d.KE)("Error in sprintf(".concat(e,", ").concat(t,"): ").concat(i)),String(t)}},this.isIntData=()=>this.props.element.dataType===u.Y2.DataType.INT,this.getMin=()=>this.props.element.hasMin?this.props.element.min:-1/0,this.getMax=()=>this.props.element.hasMax?this.props.element.max:1/0,this.getStep=()=>{const{step:t}=this.props.element;return t||(this.isIntData()?1:.01)},this.commitWidgetValue=t=>{const{value:e}=this.state,{element:i,widgetMgr:s,fragmentId:r}=this.props,o=this.props.element,n=this.getMin(),a=this.getMax();if((0,y.bb)(e)&&(n>e||e>a)){const t=this.inputRef.current;t&&t.reportValidity()}else{var l;const n=null!==(l=null!==e&&void 0!==e?e:o.default)&&void 0!==l?l:null;this.isIntData()?s.setIntValue(i,n,t,r):s.setDoubleValue(i,n,t,r),this.setState({dirty:!1,value:n,formattedValue:this.formatValue(n)})}},this.onFormCleared=()=>{this.setState(((t,e)=>{var i;return{value:null!==(i=e.element.default)&&void 0!==i?i:null}}),(()=>this.commitWidgetValue({fromUi:!0})))},this.onBlur=()=>{this.state.dirty&&this.commitWidgetValue({fromUi:!0}),this.setState({isFocused:!1})},this.onFocus=()=>{this.setState({isFocused:!0})},this.onChange=t=>{const{value:e}=t.target;if(""===e)this.setState({dirty:!0,value:null,formattedValue:null});else{let t;t=this.isIntData()?parseInt(e,10):parseFloat(e),this.setState({dirty:!0,value:t,formattedValue:e})}},this.onKeyDown=t=>{const{key:e}=t;switch(e){case"ArrowUp":t.preventDefault(),this.modifyValueUsingStep("increment")();break;case"ArrowDown":t.preventDefault(),this.modifyValueUsingStep("decrement")()}},this.onKeyPress=t=>{"Enter"===t.key&&(this.state.dirty&&this.commitWidgetValue({fromUi:!0}),(0,y.$b)(this.props.element)&&this.props.widgetMgr.submitForm(this.props.element.formId,this.props.fragmentId))},this.modifyValueUsingStep=t=>()=>{const{value:e}=this.state,i=this.getStep();switch(t){case"increment":this.canIncrement&&this.setState({dirty:!0,value:(null!==e&&void 0!==e?e:this.getMin())+i},(()=>{this.commitWidgetValue({fromUi:!0})}));break;case"decrement":this.canDecrement&&this.setState({dirty:!0,value:(null!==e&&void 0!==e?e:this.getMax())-i},(()=>{this.commitWidgetValue({fromUi:!0})}))}},this.state={dirty:!1,value:this.initialValue,formattedValue:this.formatValue(this.initialValue),isFocused:!1},this.id=D()("number_input_")}get initialValue(){var t;const e=this.isIntData()?this.props.widgetMgr.getIntValue(this.props.element):this.props.widgetMgr.getDoubleValue(this.props.element);return null!==(t=null!==e&&void 0!==e?e:this.props.element.default)&&void 0!==t?t:null}componentDidMount(){this.props.element.setValue?this.updateFromProtobuf():this.commitWidgetValue({fromUi:!1})}componentDidUpdate(){this.maybeUpdateFromProtobuf()}componentWillUnmount(){this.formClearHelper.disconnect()}maybeUpdateFromProtobuf(){const{setValue:t}=this.props.element;t&&this.updateFromProtobuf()}updateFromProtobuf(){const{value:t}=this.props.element;this.props.element.setValue=!1,this.setState({value:null!==t&&void 0!==t?t:null,formattedValue:this.formatValue(null!==t&&void 0!==t?t:null)},(()=>{this.commitWidgetValue({fromUi:!1})}))}get canDecrement(){return!(0,y.le)(this.state.value)&&this.state.value-this.getStep()>=this.getMin()}get canIncrement(){return!(0,y.le)(this.state.value)&&this.state.value+this.getStep()<=this.getMax()}render(){var t;const{element:e,width:i,disabled:s,widgetMgr:n,theme:a}=this.props,{formattedValue:l,dirty:d,isFocused:u}=this.state,x={width:i},F=!this.canDecrement||s,D=!this.canIncrement||s,S=(0,y.le)(e.default)&&!s;return this.formClearHelper.manageFormClearListener(n,e.formId,this.onFormCleared),(0,k.jsxs)("div",{className:"stNumberInput",style:x,"data-testid":"stNumberInput",children:[(0,k.jsx)(b.O,{label:e.label,disabled:s,labelVisibility:(0,y.iF)(null===(t=e.labelVisibility)||void 0===t?void 0:t.value),htmlFor:this.id,children:e.help&&(0,k.jsx)(v.dT,{children:(0,k.jsx)(h.Z,{content:e.help,placement:m.u.TOP_RIGHT})})}),(0,k.jsxs)(I,{className:u?"focused":"","data-testid":"stNumberInputContainer",children:[(0,k.jsx)(g.Z,{type:"number",inputRef:this.inputRef,value:null!==l&&void 0!==l?l:"",placeholder:e.placeholder,onBlur:this.onBlur,onFocus:this.onFocus,onChange:this.onChange,onKeyPress:this.onKeyPress,onKeyDown:this.onKeyDown,clearable:S,clearOnEscape:S,disabled:s,"aria-label":e.label,id:this.id,overrides:{ClearIcon:{props:{overrides:{Svg:{style:{color:a.colors.darkGray,transform:"scale(1.4)",width:a.spacing.twoXL,marginRight:"-1.25em",":hover":{fill:a.colors.bodyText}}}}}},Input:{props:{"data-testid":"stNumberInput-Input",step:this.getStep(),min:this.getMin(),max:this.getMax()},style:{lineHeight:"1.4",paddingRight:".5rem",paddingLeft:".5rem",paddingBottom:".5rem",paddingTop:".5rem"}},InputContainer:{style:()=>({borderTopRightRadius:0,borderBottomRightRadius:0})},Root:{style:()=>({borderTopRightRadius:0,borderBottomRightRadius:0,borderLeftWidth:0,borderRightWidth:0,borderTopWidth:0,borderBottomWidth:0})}}}),i>c.A.hideNumberInputControls&&(0,k.jsxs)(C,{children:[(0,k.jsx)(V,{className:"step-down","data-testid":"stNumberInput-StepDown",onClick:this.modifyValueUsingStep("decrement"),disabled:F,tabIndex:-1,children:(0,k.jsx)(p.Z,{content:r.W,size:"xs",color:this.canDecrement?"inherit":"disabled"})}),(0,k.jsx)(V,{className:"step-up","data-testid":"stNumberInput-StepUp",onClick:this.modifyValueUsingStep("increment"),disabled:D,tabIndex:-1,children:(0,k.jsx)(p.Z,{content:o.v,size:"xs",color:this.canIncrement?"inherit":"disabled"})})]})]}),i>c.A.hideWidgetDetails&&(0,k.jsx)(w,{clearable:S,children:(0,k.jsx)(f.Z,{dirty:d,value:null!==l&&void 0!==l?l:"",className:"input-instructions",inForm:(0,y.$b)({formId:e.formId})})})]})}}const M=(0,n.b)(S)}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunk_streamlit_app=self.webpackChunk_streamlit_app||[]).push([[7602],{90186:(e,t,s)=>{s.d(t,{$:()=>c,Z:()=>h});var i=s(66845),r=s(25621),o=s(66694),a=s(27466),n=s(38570),l=s(80318),d=s(40864);let c;!function(e){e.EXTRASMALL="xs",e.SMALL="sm",e.MEDIUM="md",e.LARGE="lg",e.EXTRALARGE="xl"}(c||(c={}));const h=function(e){let{value:t,width:s,size:h=c.SMALL,overrides:u}=e;const g=(0,r.u)(),p={xs:g.spacing.twoXS,sm:g.spacing.sm,md:g.spacing.lg,lg:g.spacing.xl,xl:g.spacing.twoXL},{activeTheme:m}=i.useContext(o.E),f=!(0,a.MJ)(m),S={BarContainer:{style:{marginTop:g.spacing.none,marginBottom:g.spacing.none,marginRight:g.spacing.none,marginLeft:g.spacing.none}},Bar:{style:e=>{let{$theme:t}=e;return{width:s?s.toString():void 0,marginTop:g.spacing.none,marginBottom:g.spacing.none,marginRight:g.spacing.none,marginLeft:g.spacing.none,height:p[h],backgroundColor:t.colors.progressbarTrackFill,borderTopLeftRadius:g.spacing.twoXS,borderTopRightRadius:g.spacing.twoXS,borderBottomLeftRadius:g.spacing.twoXS,borderBottomRightRadius:g.spacing.twoXS}}},BarProgress:{style:()=>({backgroundColor:f?g.colors.primary:g.colors.blue70,borderTopLeftRadius:g.spacing.twoXS,borderTopRightRadius:g.spacing.twoXS,borderBottomLeftRadius:g.spacing.twoXS,borderBottomRightRadius:g.spacing.twoXS})}};return(0,d.jsx)(n.Z,{value:t,overrides:(0,l.aO)(S,u)})}},47602:(e,t,s)=>{s.r(t),s.d(t,{default:()=>q});var i,r=s(47869),o=s(18080),a=s(62813),n=s.n(a),l=s(66845),d=s(16295),c=s(46927),h=s(68411),u=s(8879),g=s(98478),p=s(86659),m=s(87814),f=s(23849),S=s(50641),C=s(77367),R=s(90186),x=s(1515),w=s(35704);function b(e,t){switch(e){case i.XSMALL:return{padding:"".concat(t.spacing.twoXS," ").concat(t.spacing.sm),fontSize:t.fontSizes.sm};case i.SMALL:return{padding:"".concat(t.spacing.twoXS," ").concat(t.spacing.md)};case i.LARGE:return{padding:"".concat(t.spacing.md," ").concat(t.spacing.md)};default:return{padding:"".concat(t.spacing.xs," ").concat(t.spacing.md)}}}!function(e){e.XSMALL="xsmall",e.SMALL="small",e.MEDIUM="medium",e.LARGE="large"}(i||(i={}));const F=(0,x.Z)("div",{target:"etz5kuj9"})((()=>({position:"relative",overflow:"hidden",width:"100%",objectFit:"contain"})),""),I=(0,x.Z)("div",{target:"etz5kuj8"})((e=>{let{theme:t,width:s}=e;return{backgroundColor:t.colors.secondaryBg,borderRadius:"".concat(t.radii.lg," ").concat(t.radii.lg," 0 0"),width:"100%",height:9*s/16,display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center"}}),""),v=(0,x.Z)("p",{target:"etz5kuj7"})((e=>{let{theme:t}=e;return{marginTop:t.spacing.sm,textAlign:"center"}}),""),M=(0,x.Z)("img",{target:"etz5kuj6"})((e=>{let{theme:t,opacity:s}=e;return{borderRadius:"".concat(t.radii.lg," ").concat(t.radii.lg," 0 0"),objectFit:"contain",opacity:s}}),""),y=(0,x.Z)("a",{target:"etz5kuj5"})((e=>{let{theme:t}=e;return{color:t.colors.primary,display:"block",textDecoration:"none"}}),""),E=(0,x.Z)("span",{target:"etz5kuj4"})((()=>({display:"flex",alignItems:"center"})),""),T=(0,x.Z)("div",{target:"etz5kuj3"})((e=>{let{theme:t}=e;return{position:"absolute",top:t.spacing.lg,right:t.spacing.lg,zIndex:1,color:t.colors.fadedText40,mixBlendMode:"difference",opacity:.6}}),""),j=(0,x.Z)("div",{target:"etz5kuj1"})((()=>({height:"fit-content",width:"100%",position:"absolute",bottom:0})),""),L=(0,x.Z)("button",{target:"etz5kuj0"})((e=>{let{theme:t}=e;return{position:"relative",display:"inline-flex",flexDirection:"column",alignItems:"center",justifyContent:"center",backgroundColor:t.colors.lightenedBg05,border:"1px solid ".concat(t.colors.fadedText10),borderRadius:"0 0 ".concat(t.radii.lg," ").concat(t.radii.lg),"&:hover":{borderColor:t.colors.primary,color:t.colors.primary},"&:active":{color:t.colors.white,borderColor:t.colors.primary,backgroundColor:t.colors.primary},"&:focus:not(:active)":{borderColor:t.colors.primary,color:t.colors.primary},"&:disabled, &:disabled:hover, &:disabled:active":{color:t.colors.fadedText40},fontWeight:t.fontWeights.normal,padding:"".concat(t.spacing.xs," ").concat(t.spacing.md),margin:0,lineHeight:t.lineHeights.base,color:"inherit",width:"100%",userSelect:"none","&:focus":{outline:"none"},"&:focus-visible":{boxShadow:"0 0 0 0.2rem ".concat((0,w.DZ)(t.colors.primary,.5))},...b(i.MEDIUM,t)}}),"");var U=s(40864);const P=function(e){let{disabled:t,onClick:s,children:i,progress:r}=e;return(0,U.jsxs)(L,{disabled:t||!1,onClick:s||(()=>{}),progress:r||null,"data-testid":"stCameraInputButton",children:[i,r&&(0,U.jsx)(j,{children:(0,U.jsx)(R.Z,{value:r,size:R.$.EXTRASMALL,overrides:{Bar:{style:{borderTopLeftRadius:"0px",borderTopRightRadius:"0px"}},BarProgress:{style:{borderTopLeftRadius:"0px",borderTopRightRadius:"0px"}},BarContainer:{style:{borderTopLeftRadius:"0px",borderTopRightRadius:"0px"}}}})})]})};var k=s(77979),z=s(9003),Z=s(81354),D=s(11765);let O;!function(e){e.USER="user",e.ENVIRONMENT="environment"}(O||(O={}));const X=e=>{let{switchFacingMode:t}=e;return(0,U.jsx)(T,{"data-testid":"stCameraSwitchButton",children:(0,U.jsx)(h.Z,{content:"Switch camera",placement:h.u.TOP_RIGHT,children:(0,U.jsx)(z.ZP,{kind:Z.nW.MINIMAL,onClick:t,children:(0,U.jsx)(c.Z,{content:k.Z,size:"twoXL",color:D.Z.white})})})})};var B=s(3084),_=s(25621),W=s(91706),A=s(48051),V=s.n(A),G=s(84192);let N;!function(e){e.PENDING="pending",e.SUCCESS="success",e.ERROR="error"}(N||(N={}));const H=e=>{let{width:t}=e;return(0,U.jsxs)(I,{width:t,children:[(0,U.jsx)(c.Z,{size:"threeXL",color:D.Z.gray60,content:B.n}),(0,U.jsxs)(v,{children:["This app would like to use your camera.",(0,U.jsx)(y,{href:G.U3,rel:"noopener noreferrer",target:"_blank",children:"Learn how to allow access."})]})]})},$=e=>{let{handleCapture:t,width:s,disabled:i,clearPhotoInProgress:r,setClearPhotoInProgress:o,facingMode:a,setFacingMode:n,testOverride:d}=e;const[c,h]=(0,l.useState)(d||N.PENDING),u=(0,l.useRef)(null),[g,p]=(0,l.useState)(s),m=(0,l.useCallback)((0,S.Ds)(1e3,p),[]);(0,l.useEffect)((()=>{m(s)}),[s,m]);const f=(0,_.u)();return(0,U.jsxs)(F,{width:g,"data-testid":"stWebcamComponent",children:[c===N.SUCCESS||i||r?W.tq&&(0,U.jsx)(X,{switchFacingMode:n}):(0,U.jsx)(H,{width:g}),(0,U.jsx)(I,{"data-testid":"stWebcamStyledBox",hidden:c!==N.SUCCESS&&!i&&!r,width:g,children:!i&&(0,U.jsx)(V(),{audio:!1,ref:u,screenshotFormat:"image/jpeg",screenshotQuality:1,width:g,height:9*g/16,style:{borderRadius:"".concat(f.radii.lg," ").concat(f.radii.lg," 0 0")},onUserMediaError:()=>{h(N.ERROR)},onUserMedia:()=>{h(N.SUCCESS),o(!1)},videoConstraints:{width:{ideal:g},facingMode:a}})}),(0,U.jsx)(P,{onClick:function(){if(null!==u.current){const e=u.current.getScreenshot();t(e)}},disabled:c!==N.SUCCESS||i||r,children:"Take Photo"})]})};class K extends l.PureComponent{constructor(e){super(e),this.localFileIdCounter=1,this.RESTORED_FROM_WIDGET_STRING="RESTORED_FROM_WIDGET",this.formClearHelper=new m.K,this.getProgress=()=>{if(this.state.files.length>0&&"uploading"===this.state.files[this.state.files.length-1].status.type){return this.state.files[this.state.files.length-1].status.progress}},this.setClearPhotoInProgress=e=>{this.setState({clearPhotoInProgress:e})},this.setFacingMode=()=>{this.setState((e=>({facingMode:e.facingMode===O.USER?O.ENVIRONMENT:O.USER})))},this.handleCapture=e=>{if(null===e)return Promise.resolve();this.setState({imgSrc:e,shutter:!0,minShutterEffectPassed:!1});return(t=e,s="camera-input-".concat((new Date).toISOString().replace(/:/g,"_"),".jpg"),fetch(t).then((e=>e.arrayBuffer())).then((e=>new File([e],s,{type:"image/jpeg"})))).then((e=>this.props.uploadClient.fetchFileURLs([e]).then((t=>({file:e,fileUrls:t[0]}))))).then((e=>{let{file:t,fileUrls:s}=e;return this.uploadFile(s,t)})).then((()=>{return e=150,new Promise((t=>setTimeout(t,e)));var e})).then((()=>{this.setState(((t,s)=>({imgSrc:e,shutter:t.shutter,minShutterEffectPassed:!0})))})).catch((e=>{(0,f.H)(e)}));var t,s},this.removeCapture=()=>{0!==this.state.files.length&&(this.state.files.forEach((e=>this.deleteFile(e.id))),this.setState({imgSrc:null,clearPhotoInProgress:!0}))},this.componentDidUpdate=()=>{if("ready"!==this.status)return;const e=this.createWidgetValue(),{element:t,widgetMgr:s,fragmentId:i}=this.props,r=s.getFileUploaderStateValue(t);n()(e,r)||s.setFileUploaderStateValue(t,e,{fromUi:!0},i)},this.onFormCleared=()=>{this.setState({files:[]},(()=>{const e=this.createWidgetValue();if(null==e)return;this.setState({imgSrc:null});const{widgetMgr:t,element:s,fragmentId:i}=this.props;t.setFileUploaderStateValue(s,e,{fromUi:!0},i)}))},this.deleteFile=e=>{const t=this.getFile(e);null!=t&&("uploading"===t.status.type&&t.status.cancelToken.cancel(),"uploaded"===t.status.type&&t.status.fileUrls.deleteUrl&&this.props.uploadClient.deleteFile(t.status.fileUrls.deleteUrl),this.removeFile(e))},this.addFile=e=>{this.setState((t=>({files:[...t.files,e]})))},this.removeFile=e=>{this.setState((t=>({files:t.files.filter((t=>t.id!==e))})))},this.getFile=e=>this.state.files.find((t=>t.id===e)),this.updateFile=(e,t)=>{this.setState((s=>({files:s.files.map((s=>s.id===e?t:s))})))},this.onUploadComplete=(e,t)=>{this.setState((()=>({shutter:!1})));const s=this.getFile(e);null!=s&&"uploading"===s.status.type&&this.updateFile(s.id,s.setStatus({type:"uploaded",fileId:t.fileId,fileUrls:t}))},this.onUploadProgress=(e,t)=>{const s=this.getFile(t);if(null==s||"uploading"!==s.status.type)return;const i=Math.round(100*e.loaded/e.total);s.status.progress!==i&&this.updateFile(t,s.setStatus({type:"uploading",cancelToken:s.status.cancelToken,progress:i}))},this.reset=()=>{this.setState({files:[],imgSrc:null})},this.uploadFile=(e,t)=>{const s=o.Z.CancelToken.source(),i=new C.R(t.name,t.size,this.nextLocalFileId(),{type:"uploading",cancelToken:s,progress:1});this.addFile(i),this.props.uploadClient.uploadFile(this.props.element,e.uploadUrl,t,(e=>this.onUploadProgress(e,i.id)),s.token).then((()=>this.onUploadComplete(i.id,e))).catch((e=>{o.Z.isCancel(e)||this.updateFile(i.id,i.setStatus({type:"error",errorMessage:e?e.toString():"Unknown error"}))}))},this.state=this.initialValue}get initialValue(){const e={files:[],imgSrc:null,shutter:!1,minShutterEffectPassed:!0,clearPhotoInProgress:!1,facingMode:O.USER},{widgetMgr:t,element:s}=this.props,i=t.getFileUploaderStateValue(s);if(null==i)return e;const{uploadedFileInfo:r}=i;return null==r||0===r.length?e:{files:r.map((e=>{const t=e.name,s=e.size,i=e.fileId,r=e.fileUrls;return new C.R(t,s,this.nextLocalFileId(),{type:"uploaded",fileId:i,fileUrls:r})})),imgSrc:0===r.length?"":this.RESTORED_FROM_WIDGET_STRING,shutter:!1,minShutterEffectPassed:!1,clearPhotoInProgress:!1,facingMode:O.USER}}componentWillUnmount(){this.formClearHelper.disconnect()}get status(){return this.state.files.some((e=>"uploading"===e.status.type))?"updating":"ready"}componentDidMount(){const e=this.createWidgetValue(),{element:t,widgetMgr:s,fragmentId:i}=this.props;void 0===s.getFileUploaderStateValue(t)&&s.setFileUploaderStateValue(t,e,{fromUi:!1},i)}createWidgetValue(){const e=this.state.files.filter((e=>"uploaded"===e.status.type)).map((e=>{const{name:t,size:s,status:i}=e;return new d.jM({fileId:i.fileId,fileUrls:i.fileUrls,name:t,size:s})}));return new d.xO({uploadedFileInfo:e})}render(){var e;const{element:t,widgetMgr:s,disabled:i,width:o}=this.props;return this.formClearHelper.manageFormClearListener(s,t.formId,this.onFormCleared),(0,U.jsxs)(F,{width:o,className:"row-widget","data-testid":"stCameraInput",children:[(0,U.jsx)(g.O,{label:t.label,disabled:i,labelVisibility:(0,S.iF)(null===(e=t.labelVisibility)||void 0===e?void 0:e.value),children:t.help&&(0,U.jsx)(p.dT,{children:(0,U.jsx)(u.Z,{content:t.help,placement:h.u.TOP_RIGHT})})}),this.state.imgSrc?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(I,{width:o,children:this.state.imgSrc!==this.RESTORED_FROM_WIDGET_STRING&&(0,U.jsx)(M,{src:this.state.imgSrc,alt:"Snapshot",opacity:this.state.shutter||!this.state.minShutterEffectPassed?"50%":"100%",width:o,height:9*o/16})}),(0,U.jsx)(P,{onClick:this.removeCapture,progress:this.getProgress(),disabled:!!this.getProgress()||i,children:this.getProgress()?"Uploading...":(0,U.jsxs)(E,{children:[(0,U.jsx)(c.Z,{content:r.X,margin:"0 xs 0 0",size:"sm"})," Clear photo"]})})]}):(0,U.jsx)($,{handleCapture:this.handleCapture,width:o,disabled:i,clearPhotoInProgress:this.state.clearPhotoInProgress,setClearPhotoInProgress:this.setClearPhotoInProgress,facingMode:this.state.facingMode,setFacingMode:this.setFacingMode,testOverride:this.props.testOverride})]})}nextLocalFileId(){return this.localFileIdCounter++}}const q=K},77367:(e,t,s)=>{s.d(t,{R:()=>i});class i{setStatus(e){return new i(this.name,this.size,this.id,e)}constructor(e,t,s,i){this.name=void 0,this.size=void 0,this.status=void 0,this.id=void 0,this.name=e,this.size=t,this.id=s,this.status=i}}},87814:(e,t,s)=>{s.d(t,{K:()=>r});var i=s(50641);class r{constructor(){this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}manageFormClearListener(e,t,s){null!=this.formClearListener&&this.lastWidgetMgr===e&&this.lastFormId===t||(this.disconnect(),(0,i.bM)(t)&&(this.formClearListener=e.addFormClearedListener(t,s),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}}}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunk_streamlit_app=self.webpackChunk_streamlit_app||[]).push([[8148],{23593:(e,t,n)=>{n.d(t,{Z:()=>b});var i=n(66845),o=n(13005),l=n.n(o),r=n(25621),a=n(82218),s=n(97781),d=n(46927),c=n(66694),u=n(1515);const m=(0,u.Z)("button",{target:"e1vs0wn31"})((e=>{let{isExpanded:t,theme:n}=e;const i=t?{right:"0.4rem",top:"0.5rem",backgroundColor:"transparent"}:{right:"-3.0rem",top:"-0.375rem",opacity:0,transform:"scale(0)",backgroundColor:n.colors.lightenedBg05};return{position:"absolute",display:"flex",alignItems:"center",justifyContent:"center",zIndex:n.zIndices.sidebar+1,height:"2.5rem",width:"2.5rem",transition:"opacity 300ms 150ms, transform 300ms 150ms",border:"none",color:n.colors.fadedText60,borderRadius:"50%",...i,"&:focus":{outline:"none"},"&:active, &:focus-visible, &:hover":{opacity:1,outline:"none",transform:"scale(1)",color:n.colors.bodyText,transition:"none"}}}),""),h=(0,u.Z)("div",{target:"e1vs0wn30"})((e=>{let{theme:t,isExpanded:n}=e;return{"&:hover":{[m]:{opacity:1,transform:"scale(1)",transition:"none"}},...n?{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 p=n(40864);class g extends i.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:n}=this.state,{children:i,width:o,height:l,disableFullscreenMode:r}=this.props;let c=a.d,u=this.zoomIn,g="View fullscreen";return e&&(c=s.m,u=this.zoomOut,g="Exit fullscreen"),(0,p.jsxs)(h,{isExpanded:e,"data-testid":"stFullScreenFrame",children:[!r&&(0,p.jsx)(m,{"data-testid":"StyledFullScreenButton",onClick:u,title:g,isExpanded:e,children:(0,p.jsx)(d.Z,{content:c})}),i(e?{width:t,height:n,expanded:e,expand:this.zoomIn,collapse:this.zoomOut}:{width:o,height:l,expanded:e,expand:this.zoomIn,collapse:this.zoomOut})]})}}g.contextType=c.E;const f=(0,r.b)(g);const b=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];class n extends i.PureComponent{constructor(){super(...arguments),this.render=()=>{const{width:n,height:i,disableFullscreenMode:o}=this.props;return(0,p.jsx)(f,{width:n,height:i,disableFullscreenMode:t||o,children:t=>{let{width:n,height:i,expanded:o,expand:l,collapse:r}=t;return(0,p.jsx)(e,{...this.props,width:n,height:i,isFullScreen:o,expand:l,collapse:r})}})}}}return n.displayName="withFullScreenWrapper(".concat(e.displayName||e.name,")"),l()(n,e)}},75064:(e,t,n)=>{n.r(t),n.d(t,{default:()=>Ft});var i=n(66845),o=n(67930),l=n(78170),r=n(17330),a=n(20545),s=n(57463),d=n(97943),c=n(41342),u=n(17875),m=n(87814),h=n(23593),p=n(16295),g=n(50641),f=n(25621),b=n(34367),v=n(31011),y=n(63730),w=n(68411),x=n(9003),C=n(81354),E=n(46927),S=n(1515),M=n(27466);const k=(0,S.Z)("div",{target:"e2wxzia1"})((e=>{let{theme:t,locked:n,target:i}=e;return{padding:"0.5rem 0 0.5rem 0.5rem",position:"absolute",top:n?"-2.4rem":"-1rem",right:t.spacing.none,transition:"none",...!n&&{opacity:0,"&:active, &:focus-visible, &:hover":{transition:"opacity 150ms 100ms, top 100ms 100ms",opacity:1,top:"-2.4rem"},...i&&{["".concat(i,":hover &, ").concat(i,":active &, ").concat(i,":focus-visible &")]:{transition:"opacity 150ms 100ms, top 100ms 100ms",opacity:1,top:"-2.4rem"}}}}}),""),T=(0,S.Z)("div",{target:"e2wxzia0"})((e=>{let{theme:t}=e;return{color:(0,M.Iy)(t)?t.colors.fadedText60:t.colors.bodyText,display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"flex-end",boxShadow:"1px 2px 8px rgba(0, 0, 0, 0.08)",borderRadius:t.radii.lg,backgroundColor:t.colors.lightenedBg05,width:"fit-content",zIndex:t.zIndices.sidebar+1}}),"");var R=n(40864);function N(e){let{label:t,show_label:n,icon:i,onClick:o}=e;const l=(0,f.u)(),r=n?t:"";return(0,R.jsx)("div",{"data-testid":"stElementToolbarButton",children:(0,R.jsx)(w.Z,{content:(0,R.jsx)(y.ZP,{source:t,allowHTML:!1,style:{fontSize:l.fontSizes.sm}}),placement:w.u.TOP,onMouseEnterDelay:1e3,inline:!0,children:(0,R.jsxs)(x.ZP,{onClick:e=>{o&&o(),e.stopPropagation()},kind:C.nW.ELEMENT_TOOLBAR,children:[i&&(0,R.jsx)(E.Z,{content:i,size:"md",testid:"stElementToolbarButtonIcon"}),r&&(0,R.jsx)("span",{children:r})]})})})}const I=e=>{let{onExpand:t,onCollapse:n,isFullScreen:i,locked:o,children:l,target:r,disableFullscreenMode:a}=e;return(0,R.jsx)(k,{className:"stElementToolbar","data-testid":"stElementToolbar",locked:o||i,target:r,children:(0,R.jsxs)(T,{children:[l,t&&!a&&!i&&(0,R.jsx)(N,{label:"Fullscreen",icon:b.i,onClick:()=>t()}),n&&!a&&i&&(0,R.jsx)(N,{label:"Close fullscreen",icon:v.m,onClick:()=>n()})]})})};var _=n(66694),O=n(38145),D=n.n(O),A=n(96825),F=n.n(A),z=n(29724),V=n.n(z),H=n(52347),L=n(53608),W=n.n(L),j=(n(87717),n(55842),n(91191));const B=["true","t","yes","y","on","1"],P=["false","f","no","n","off","0"];function Z(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return e="\u26a0\ufe0f ".concat(e),{kind:o.p6.Text,readonly:!0,allowOverlay:!0,data:e+(t?"\n\n".concat(t,"\n"):""),displayData:e,isError:!0}}function Y(e){return e.hasOwnProperty("isError")&&e.isError}function U(e){return e.hasOwnProperty("isMissingValue")&&e.isMissingValue}function q(){return arguments.length>0&&void 0!==arguments[0]&&arguments[0]?{kind:o.p6.Loading,allowOverlay:!1,isMissingValue:!0}:{kind:o.p6.Loading,allowOverlay:!1}}function J(e,t){const n=t?"faded":"normal";return{kind:o.p6.Text,data:"",displayData:"",allowOverlay:!0,readonly:e,style:n}}function K(e){return{id:e.id,title:e.title,hasMenu:!1,themeOverride:e.themeOverride,icon:e.icon,...e.isStretched&&{grow:e.isIndex?1:3},...e.width&&{width:e.width}}}function G(e,t){return(0,g.le)(e)?t||{}:(0,g.le)(t)?e||{}:F()(e,t)}function X(e){if((0,g.le)(e))return[];if("number"===typeof e||"boolean"===typeof e)return[e];if("string"===typeof e){if(""===e)return[];if(!e.trim().startsWith("[")||!e.trim().endsWith("]"))return e.split(",");try{return JSON.parse(e)}catch(t){return[e]}}try{const t=JSON.parse(JSON.stringify(e,((e,t)=>"bigint"===typeof t?Number(t):t)));return Array.isArray(t)?t.map((e=>["string","number","boolean","null"].includes(typeof e)?e:Q(e))):[Q(t)]}catch(t){return[Q(e)]}}function Q(e){try{try{return D()(e)}catch(t){return JSON.stringify(e,((e,t)=>"bigint"===typeof t?Number(t):t))}}catch(t){return"[".concat(typeof e,"]")}}function $(e){if((0,g.le)(e))return null;if("boolean"===typeof e)return e;const t=Q(e).toLowerCase().trim();return""===t?null:!!B.includes(t)||!P.includes(t)&&void 0}function ee(e){if((0,g.le)(e))return null;if(Array.isArray(e))return NaN;if("string"===typeof e){if(0===e.trim().length)return null;try{const t=V().unformat(e.trim());if((0,g.bb)(t))return t}catch(t){}}else if(e instanceof Int32Array)return Number(e[0]);return Number(e)}function te(e,t,n){return Number.isNaN(e)||!Number.isFinite(e)?"":(0,g.le)(t)||""===t?(0===n&&(e=Math.round(e)),V()(e).format((0,g.bb)(n)?"0,0.".concat("0".repeat(n)):"0,0.[0000]")):"percent"===t?new Intl.NumberFormat(void 0,{style:"percent",minimumFractionDigits:2,maximumFractionDigits:2}).format(e):["compact","scientific","engineering"].includes(t)?new Intl.NumberFormat(void 0,{notation:t}).format(e):"duration[ns]"===t?W().duration(e/1e6,"milliseconds").humanize():t.startsWith("period[")?j.fu.formatPeriodType(BigInt(e),t):(0,H.sprintf)(t,e)}function ne(e,t){return"locale"===t?new Intl.DateTimeFormat(void 0,{dateStyle:"medium",timeStyle:"medium"}).format(e.toDate()):"distance"===t?e.fromNow():"relative"===t?e.calendar():e.format(t)}function ie(e){if((0,g.le)(e))return null;if(e instanceof Date)return isNaN(e.getTime())?void 0:e;if("string"===typeof e&&0===e.trim().length)return null;try{const t=Number(e);if(!isNaN(t)){let e=t;t>=10**18?e=t/1e3**3:t>=10**15?e=t/1e6:t>=10**12&&(e=t/1e3);const n=W().unix(e).utc();if(n.isValid())return n.toDate()}if("string"===typeof e){const t=W().utc(e);if(t.isValid())return t.toDate();const n=W().utc(e,[W().HTML5_FMT.TIME_MS,W().HTML5_FMT.TIME_SECONDS,W().HTML5_FMT.TIME]);if(n.isValid())return n.toDate()}}catch(t){return}}function oe(e){if(e%1===0)return 0;let t=e.toString();return-1!==t.indexOf("e")&&(t=e.toLocaleString("fullwide",{useGrouping:!1,maximumFractionDigits:20})),-1===t.indexOf(".")?0:t.split(".")[1].length}const le=new RegExp(/(\r\n|\n|\r)/gm);function re(e){return-1!==e.indexOf("\n")?e.replace(le," "):e}var ae=n(23849);function se(e){const t={kind:o.p6.Text,data:"",displayData:"",allowOverlay:!0,contentAlignment:e.contentAlignment,readonly:!0,style:e.isIndex?"faded":"normal"};return{...e,kind:"object",sortMode:"default",isEditable:!1,getCell(e){try{const n=(0,g.bb)(e)?Q(e):null,i=(0,g.bb)(n)?re(n):"";return{...t,data:n,displayData:i,isMissingValue:(0,g.le)(e)}}catch(n){return Z(Q(e),"The value cannot be interpreted as a string. Error: ".concat(n))}},getCellValue:e=>void 0===e.data?null:e.data}}se.isEditableType=!1;const de=se;function ce(e){const t=e.columnTypeOptions||{};let n;if(t.validate)try{n=new RegExp(t.validate,"us")}catch(r){n="Invalid validate regex: ".concat(t.validate,".\nError: ").concat(r)}const i={kind:o.p6.Text,data:"",displayData:"",allowOverlay:!0,contentAlignment:e.contentAlignment,readonly:!e.isEditable,style:e.isIndex?"faded":"normal"},l=i=>{if((0,g.le)(i))return!e.isRequired;let o=Q(i),l=!1;return t.max_chars&&o.length>t.max_chars&&(o=o.slice(0,t.max_chars),l=!0),!(n instanceof RegExp&&!1===n.test(o))&&(!l||o)};return{...e,kind:"text",sortMode:"default",validateInput:l,getCell(e,t){if("string"===typeof n)return Z(Q(e),n);if(t){const t=l(e);if(!1===t)return Z(Q(e),"Invalid input.");"string"===typeof t&&(e=t)}try{const t=(0,g.bb)(e)?Q(e):null,n=(0,g.bb)(t)?re(t):"";return{...i,isMissingValue:(0,g.le)(t),data:t,displayData:n}}catch(r){return Z("Incompatible value","The value cannot be interpreted as string. Error: ".concat(r))}},getCellValue:e=>void 0===e.data?null:e.data}}ce.isEditableType=!0;const ue=ce;function me(e,t){return e=t.startsWith("+")||t.startsWith("-")?e.utcOffset(t,!1):e.tz(t)}function he(e,t,n,i,l,r,a){var s;const d=G({format:n,step:i,timezone:a},t.columnTypeOptions);let c,u,m;if((0,g.bb)(d.timezone))try{var h;c=(null===(h=me(W()(),d.timezone))||void 0===h?void 0:h.utcOffset())||void 0}catch(b){}(0,g.bb)(d.min_value)&&(u=ie(d.min_value)||void 0),(0,g.bb)(d.max_value)&&(m=ie(d.max_value)||void 0);const p={kind:o.p6.Custom,allowOverlay:!0,copyData:"",readonly:!t.isEditable,contentAlign:t.contentAlignment,style:t.isIndex?"faded":"normal",data:{kind:"date-picker-cell",date:void 0,displayDate:"",step:(null===(s=d.step)||void 0===s?void 0:s.toString())||"1",format:l,min:u,max:m}},f=e=>{const n=ie(e);return null===n?!t.isRequired:void 0!==n&&(!((0,g.bb)(u)&&r(n)<r(u))&&!((0,g.bb)(m)&&r(n)>r(m)))};return{...t,kind:e,sortMode:"default",validateInput:f,getCell(e,t){if(!0===t){const t=f(e);if(!1===t)return Z(Q(e),"Invalid input.");t instanceof Date&&(e=t)}const i=ie(e);let o="",l="",r=c;if(void 0===i)return Z(Q(e),"The value cannot be interpreted as a datetime object.");if(null!==i){let e=W().utc(i);if(!e.isValid())return Z(Q(i),"This should never happen. Please report this bug. \nError: ".concat(e.toString()));if(d.timezone){try{e=me(e,d.timezone)}catch(b){return Z(e.toISOString(),"Failed to adjust to the provided timezone: ".concat(d.timezone,". \nError: ").concat(b))}r=e.utcOffset()}try{l=ne(e,d.format||n)}catch(b){return Z(e.toISOString(),"Failed to format the date for rendering with: ".concat(d.format,". \nError: ").concat(b))}o=ne(e,n)}return{...p,copyData:o,isMissingValue:(0,g.le)(i),data:{...p.data,date:i,displayDate:l,timezoneOffset:r}}},getCellValue(e){var t;return(0,g.le)(null===e||void 0===e||null===(t=e.data)||void 0===t?void 0:t.date)?null:r(e.data.date)}}}function pe(e){var t,n,i,o,l;let r="YYYY-MM-DD HH:mm:ss";(null===(t=e.columnTypeOptions)||void 0===t?void 0:t.step)>=60?r="YYYY-MM-DD HH:mm":(null===(n=e.columnTypeOptions)||void 0===n?void 0:n.step)<1&&(r="YYYY-MM-DD HH:mm:ss.SSS");const a=null===(i=e.arrowType)||void 0===i||null===(o=i.meta)||void 0===o?void 0:o.timezone,s=(0,g.bb)(a)||(0,g.bb)(null===e||void 0===e||null===(l=e.columnTypeOptions)||void 0===l?void 0:l.timezone);return he("datetime",e,s?r+"Z":r,1,"datetime-local",(e=>s?e.toISOString():e.toISOString().replace("Z","")),a)}function ge(e){var t,n;let i="HH:mm:ss";return(null===(t=e.columnTypeOptions)||void 0===t?void 0:t.step)>=60?i="HH:mm":(null===(n=e.columnTypeOptions)||void 0===n?void 0:n.step)<1&&(i="HH:mm:ss.SSS"),he("time",e,i,1,"time",(e=>e.toISOString().split("T")[1].replace("Z","")))}function fe(e){return he("date",e,"YYYY-MM-DD",1,"date",(e=>e.toISOString().split("T")[0]))}function be(e){const t={kind:o.p6.Boolean,data:!1,allowOverlay:!1,contentAlign:e.contentAlignment,readonly:!e.isEditable,style:e.isIndex?"faded":"normal"};return{...e,kind:"checkbox",sortMode:"default",getCell(e){let n=null;return n=$(e),void 0===n?Z(Q(e),"The value cannot be interpreted as boolean."):{...t,data:n,isMissingValue:(0,g.le)(n)}},getCellValue:e=>void 0===e.data?null:e.data}}pe.isEditableType=!0,ge.isEditableType=!0,fe.isEditableType=!0,be.isEditableType=!0;const ve=be;function ye(e){return e.startsWith("int")&&!e.startsWith("interval")||"range"===e||e.startsWith("uint")}function we(e){const t=j.fu.getTypeName(e.arrowType);let n;"timedelta64[ns]"===t?n="duration[ns]":t.startsWith("period[")&&(n=t);const i=G({step:ye(t)?1:void 0,min_value:t.startsWith("uint")?0:void 0,format:n},e.columnTypeOptions),l=(0,g.le)(i.min_value)||i.min_value<0,r=(0,g.bb)(i.step)&&!Number.isNaN(i.step)?oe(i.step):void 0,a={kind:o.p6.Number,data:void 0,displayData:"",readonly:!e.isEditable,allowOverlay:!0,contentAlign:e.contentAlignment||"right",style:e.isIndex?"faded":"normal",allowNegative:l,fixedDecimals:r,thousandSeparator:""},s=t=>{let n=ee(t);if((0,g.le)(n))return!e.isRequired;if(Number.isNaN(n))return!1;let o=!1;return(0,g.bb)(i.max_value)&&n>i.max_value&&(n=i.max_value,o=!0),!((0,g.bb)(i.min_value)&&n<i.min_value)&&(!o||n)};return{...e,kind:"number",sortMode:"smart",validateInput:s,getCell(e,t){if(!0===t){const t=s(e);if(!1===t)return Z(Q(e),"Invalid input.");"number"===typeof t&&(e=t)}let n=ee(e),o="";if((0,g.bb)(n)){if(Number.isNaN(n))return Z(Q(e),"The value cannot be interpreted as a number.");if((0,g.bb)(r)&&(l=n,n=0===(d=r)?Math.trunc(l):Math.trunc(l*10**d)/10**d),Number.isInteger(n)&&!Number.isSafeInteger(n))return Z(Q(e),"The value is larger than the maximum supported integer values in number columns (2^53).");try{o=te(n,i.format,r)}catch(c){return Z(Q(n),(0,g.bb)(i.format)?"Failed to format the number based on the provided format configuration: (".concat(i.format,"). Error: ").concat(c):"Failed to format the number. Error: ".concat(c))}}var l,d;return{...a,data:n,displayData:o,isMissingValue:(0,g.le)(n),copyData:(0,g.le)(n)?"":Q(n)}},getCellValue:e=>void 0===e.data?null:e.data}}we.isEditableType=!0;const xe=we;function Ce(e){let t="string";const n=G({options:"bool"===j.fu.getTypeName(e.arrowType)?[!0,!1]:[]},e.columnTypeOptions),i=new Set(n.options.map((e=>typeof e)));1===i.size&&(i.has("number")||i.has("bigint")?t="number":i.has("boolean")&&(t="boolean"));const l={kind:o.p6.Custom,allowOverlay:!0,copyData:"",contentAlign:e.contentAlignment,readonly:!e.isEditable,data:{kind:"dropdown-cell",allowedValues:[...!0!==e.isRequired?[null]:[],...n.options.filter((e=>null!==e&&""!==e)).map((e=>Q(e)))],value:"",readonly:!e.isEditable}};return{...e,kind:"selectbox",sortMode:"default",getCell(e,t){let n=null;return(0,g.bb)(e)&&""!==e&&(n=Q(e)),t&&!l.data.allowedValues.includes(n)?Z(Q(n),"The value is not part of the allowed options."):{...l,isMissingValue:null===n,copyData:n||"",data:{...l.data,value:n}}},getCellValue(e){var n,i,o,l,r,a,s;return(0,g.le)(null===(n=e.data)||void 0===n?void 0:n.value)||""===(null===(i=e.data)||void 0===i?void 0:i.value)?null:"number"===t?null!==(l=ee(null===(r=e.data)||void 0===r?void 0:r.value))&&void 0!==l?l:null:"boolean"===t?null!==(a=$(null===(s=e.data)||void 0===s?void 0:s.value))&&void 0!==a?a:null:null===(o=e.data)||void 0===o?void 0:o.value}}}Ce.isEditableType=!0;const Ee=Ce;function Se(e){const t={kind:o.p6.Bubble,data:[],allowOverlay:!0,contentAlign:e.contentAlignment,style:e.isIndex?"faded":"normal"};return{...e,kind:"list",sortMode:"default",isEditable:!1,getCell(e){const n=(0,g.le)(e)?[]:X(e);return{...t,data:n,isMissingValue:(0,g.le)(e),copyData:(0,g.le)(e)?"":Q(n.map((e=>"string"===typeof e&&e.includes(",")?e.replace(/,/g," "):e)))}},getCellValue:e=>(0,g.le)(e.data)||U(e)?null:e.data}}Se.isEditableType=!1;const Me=Se;function ke(e,t,n){const i=new RegExp("".concat(e,"[,\\s].*{(?:[^}]*[\\s;]{1})?").concat(t,":\\s*([^;}]+)[;]?.*}"),"gm");n=n.replace(/{/g," {");const o=i.exec(n);if(o)return o[1].trim()}function Te(e,t){const n=e.types.index[t],i=e.indexNames[t];let o=!0;return"range"===j.fu.getTypeName(n)&&(o=!1),{id:"index-".concat(t),name:i,title:i,isEditable:o,arrowType:n,isIndex:!0,isHidden:!1}}function Re(e,t){const n=e.columns[0][t];let i,o=e.types.data[t];if((0,g.le)(o)&&(o={meta:null,numpy_type:"object",pandas_type:"object"}),"categorical"===j.fu.getTypeName(o)){const n=e.getCategoricalOptions(t);(0,g.bb)(n)&&(i={options:n})}return{id:"column-".concat(n,"-").concat(t),name:n,title:n,isEditable:!0,arrowType:o,columnTypeOptions:i,isIndex:!1,isHidden:!1}}function Ne(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;const i=e.arrowType?j.fu.getTypeName(e.arrowType):null;let l;if("object"===e.kind)l=e.getCell((0,g.bb)(t.content)?re(j.fu.format(t.content,t.contentType,t.field)):null);else if(["time","date","datetime"].includes(e.kind)&&(0,g.bb)(t.content)&&("number"===typeof t.content||"bigint"===typeof t.content)){var r,a;let n;var s,d,c;if("time"===i&&(0,g.bb)(null===(r=t.field)||void 0===r||null===(a=r.type)||void 0===a?void 0:a.unit))n=W().unix(j.fu.convertToSeconds(t.content,null!==(s=null===(d=t.field)||void 0===d||null===(c=d.type)||void 0===c?void 0:c.unit)&&void 0!==s?s:0)).utc().toDate();else n=W().utc(Number(t.content)).toDate();l=e.getCell(n)}else if("decimal"===i){const n=(0,g.le)(t.content)?null:j.fu.format(t.content,t.contentType,t.field);l=e.getCell(n)}else l=e.getCell(t.content);if(Y(l))return l;if(!e.isEditable){if((0,g.bb)(t.displayContent)){var u;const e=re(t.displayContent);l.kind===o.p6.Text||l.kind===o.p6.Number||l.kind===o.p6.Uri?l={...l,displayData:e}:l.kind===o.p6.Custom&&"date-picker-cell"===(null===(u=l.data)||void 0===u?void 0:u.kind)&&(l={...l,data:{...l.data,displayDate:e}})}n&&t.cssId&&(l=function(e,t,n){const i={},o=ke(t,"color",n);o&&(i.textDark=o);const l=ke(t,"background-color",n);return l&&(i.bgCell=l),"yellow"===l&&void 0===o&&(i.textDark="#31333F"),i?{...e,themeOverride:i}:e}(l,t.cssId,n))}return l}function Ie(e){const t=e.columnTypeOptions||{};let n,i;if(t.validate)try{n=new RegExp(t.validate,"us")}catch(a){n="Invalid validate regex: ".concat(t.validate,".\nError: ").concat(a)}if(!(0,g.le)(t.display_text)&&t.display_text.includes("(")&&t.display_text.includes(")"))try{i=new RegExp(t.display_text,"us")}catch(a){i=void 0}const l={kind:o.p6.Uri,readonly:!e.isEditable,allowOverlay:!0,contentAlign:e.contentAlignment,style:e.isIndex?"faded":"normal",hoverEffect:!0,data:"",displayData:"",copyData:""},r=i=>{if((0,g.le)(i))return!e.isRequired;const o=Q(i);return!(t.max_chars&&o.length>t.max_chars)&&!(n instanceof RegExp&&!1===n.test(o))};return{...e,kind:"link",sortMode:"default",validateInput:r,getCell(e,o){if((0,g.le)(e))return{...l,data:null,isMissingValue:!0,onClickUri:()=>{}};const s=e;if("string"===typeof n)return Z(Q(s),n);if(o){if(!1===r(s))return Z(Q(s),"Invalid input.")}let d="";return s&&(d=void 0!==i?function(e,t){if((0,g.le)(t))return"";try{const n=t.match(e);return n&&void 0!==n[1]?decodeURI(n[1]):t}catch(a){return t}}(i,s):t.display_text||s),{...l,data:s,displayData:d,isMissingValue:(0,g.le)(s),onClickUri:e=>{window.open(s.startsWith("www.")?"https://".concat(s):s,"_blank","noopener,noreferrer"),e.preventDefault()},copyData:s}},getCellValue:e=>(0,g.le)(e.data)?null:e.data}}Ie.isEditableType=!0;const _e=Ie;function Oe(e){const t={kind:o.p6.Image,data:[],displayData:[],readonly:!0,allowOverlay:!0,contentAlign:e.contentAlignment||"center",style:e.isIndex?"faded":"normal"};return{...e,kind:"image",sortMode:"default",isEditable:!1,getCell(e){const n=(0,g.bb)(e)?[Q(e)]:[];return{...t,data:n,isMissingValue:!(0,g.bb)(e),displayData:n}},getCellValue:e=>void 0===e.data||0===e.data.length?null:e.data[0]}}Oe.isEditableType=!1;const De=Oe;function Ae(e){const t=ye(j.fu.getTypeName(e.arrowType)),n=G({min_value:0,max_value:t?100:1,step:t?1:.01,format:t?"%3d%%":"percent"},e.columnTypeOptions);let i;try{i=te(n.max_value,n.format)}catch(a){i=Q(n.max_value)}const l=(0,g.le)(n.step)||Number.isNaN(n.step)?void 0:oe(n.step),r={kind:o.p6.Custom,allowOverlay:!1,copyData:"",contentAlign:e.contentAlignment,data:{kind:"range-cell",min:n.min_value,max:n.max_value,step:n.step,value:n.min_value,label:String(n.min_value),measureLabel:i,readonly:!0}};return{...e,kind:"progress",sortMode:"smart",isEditable:!1,getCell(e){if((0,g.le)(e))return q();if((0,g.le)(n.min_value)||(0,g.le)(n.max_value)||Number.isNaN(n.min_value)||Number.isNaN(n.max_value)||n.min_value>=n.max_value)return Z("Invalid min/max parameters","The min_value (".concat(n.min_value,") and max_value (").concat(n.max_value,") parameters must be valid numbers."));if((0,g.le)(n.step)||Number.isNaN(n.step))return Z("Invalid step parameter","The step parameter (".concat(n.step,") must be a valid number."));const t=ee(e);if(Number.isNaN(t)||(0,g.le)(t))return Z(Q(e),"The value cannot be interpreted as a number.");if(Number.isInteger(t)&&!Number.isSafeInteger(t))return Z(Q(e),"The value is larger than the maximum supported integer values in number columns (2^53).");let i="";try{i=te(t,n.format,l)}catch(a){return Z(Q(t),(0,g.bb)(n.format)?"Failed to format the number based on the provided format configuration: (".concat(n.format,"). Error: ").concat(a):"Failed to format the number. Error: ".concat(a))}const o=Math.min(n.max_value,Math.max(n.min_value,t));return{...r,isMissingValue:(0,g.le)(e),copyData:String(t),data:{...r.data,value:o,label:i}}},getCellValue(e){var t,n;return e.kind===o.p6.Loading||void 0===(null===(t=e.data)||void 0===t?void 0:t.value)?null:null===(n=e.data)||void 0===n?void 0:n.value}}}Ae.isEditableType=!1;const Fe=Ae;function ze(e,t,n){const i=G({y_min:0,y_max:1},t.columnTypeOptions),l={kind:o.p6.Custom,allowOverlay:!1,copyData:"",contentAlign:t.contentAlignment,data:{kind:"sparkline-cell",values:[],displayValues:[],graphKind:n,yAxis:[i.y_min,i.y_max]}};return{...t,kind:e,sortMode:"default",isEditable:!1,getCell(e){if((0,g.le)(i.y_min)||(0,g.le)(i.y_max)||Number.isNaN(i.y_min)||Number.isNaN(i.y_max)||i.y_min>=i.y_max)return Z("Invalid min/max y-axis configuration","The y_min (".concat(i.y_min,") and y_max (").concat(i.y_max,") configuration options must be valid numbers."));if((0,g.le)(e))return q();const t=X(e),n=[];let o=[];if(0===t.length)return q();let r=Number.MIN_SAFE_INTEGER,a=Number.MAX_SAFE_INTEGER;for(let i=0;i<t.length;i++){const e=ee(t[i]);if(Number.isNaN(e)||(0,g.le)(e))return Z(Q(t),"The value cannot be interpreted as a numeric array. ".concat(Q(e)," is not a number."));e>r&&(r=e),e<a&&(a=e),n.push(e)}return o=n.length>0&&(r>i.y_max||a<i.y_min)?n.map((e=>r-a===0?r>(i.y_max||1)?i.y_max||1:i.y_min||0:((i.y_max||1)-(i.y_min||0))*((e-a)/(r-a))+(i.y_min||0))):n,{...l,copyData:n.join(","),data:{...l.data,values:o,displayValues:n.map((e=>te(e)))},isMissingValue:(0,g.le)(e)}},getCellValue(e){var t,n;return e.kind===o.p6.Loading||void 0===(null===(t=e.data)||void 0===t?void 0:t.values)?null:null===(n=e.data)||void 0===n?void 0:n.values}}}function Ve(e){return ze("line_chart",e,"line")}function He(e){return ze("bar_chart",e,"bar")}function Le(e){return ze("area_chart",e,"area")}Ve.isEditableType=!1,He.isEditableType=!1,Le.isEditableType=!1;const We=new Map(Object.entries({object:de,text:ue,checkbox:ve,selectbox:Ee,list:Me,number:xe,link:_e,datetime:pe,date:fe,time:ge,line_chart:Ve,bar_chart:He,area_chart:Le,image:De,progress:Fe})),je=[],Be="_index",Pe="_pos:",Ze={small:75,medium:200,large:400};function Ye(e){if(!(0,g.le)(e))return"number"===typeof e?e:e in Ze?Ze[e]:void 0}function Ue(e,t){if(!t)return e;let n;return t.has(e.name)&&e.name!==Be?n=t.get(e.name):t.has("".concat(Pe).concat(e.indexNumber))?n=t.get("".concat(Pe).concat(e.indexNumber)):e.isIndex&&t.has(Be)&&(n=t.get(Be)),n?F()({...e},{title:n.label,width:Ye(n.width),isEditable:(0,g.bb)(n.disabled)?!n.disabled:void 0,isHidden:n.hidden,isRequired:n.required,columnTypeOptions:n.type_config,contentAlignment:n.alignment,defaultValue:n.default,help:n.help}):e}function qe(e){var t;const n=null===(t=e.columnTypeOptions)||void 0===t?void 0:t.type;let i;return(0,g.bb)(n)&&(We.has(n)?i=We.get(n):(0,ae.KE)("Unknown column type configured in column configuration: ".concat(n))),(0,g.le)(i)&&(i=function(e){let t=e?j.fu.getTypeName(e):null;return t?(t=t.toLowerCase().trim(),["unicode","empty"].includes(t)?ue:["datetime","datetimetz"].includes(t)?pe:"time"===t?ge:"date"===t?fe:["object","bytes"].includes(t)?de:["bool"].includes(t)?ve:["int8","int16","int32","int64","uint8","uint16","uint32","uint64","float16","float32","float64","float96","float128","range","decimal"].includes(t)?xe:"categorical"===t?Ee:t.startsWith("list")?Me:de):de}(e.arrowType)),i}const Je=function(e,t,n){const o=(0,f.u)(),l=i.useMemo((()=>function(e){if(!e)return new Map;try{return new Map(Object.entries(JSON.parse(e)))}catch(t){return(0,ae.H)(t),new Map}}(e.columns)),[e.columns]),r=e.useContainerWidth||(0,g.bb)(e.width)&&e.width>0;return{columns:i.useMemo((()=>{let i=function(e){const t=[],{dimensions:n}=e,i=n.headerColumns,o=n.dataColumns;if(0===i&&0===o)return t.push({id:"empty-index",title:"",indexNumber:0,isEditable:!1,isIndex:!0}),t;for(let l=0;l<i;l++){const n={...Te(e,l),indexNumber:l};t.push(n)}for(let l=0;l<o;l++){const n={...Re(e,l),indexNumber:l+i};t.push(n)}return t}(t).map((t=>{let i={...t,...Ue(t,l),isStretched:r};const a=qe(i);return(e.editingMode===p.Eh.EditingMode.READ_ONLY||n||!1===a.isEditableType)&&(i={...i,isEditable:!1}),e.editingMode!==p.Eh.EditingMode.READ_ONLY&&1==i.isEditable&&(i={...i,icon:"editable"},i.isRequired&&e.editingMode===p.Eh.EditingMode.DYNAMIC&&(i={...i,isHidden:!1})),a(i,o)})).filter((e=>!e.isHidden));if(e.columnOrder&&e.columnOrder.length>0){const t=[];i.forEach((e=>{e.isIndex&&t.push(e)})),e.columnOrder.forEach((e=>{const n=i.find((t=>t.name===e));n&&!n.isIndex&&t.push(n)})),i=t}return i.length>0?i:[de({id:"empty-index",title:"",indexNumber:0,isEditable:!1,isIndex:!0})]}),[t,l,r,n,e.editingMode,e.columnOrder,o])}};function Ke(e){return e.isIndex?Be:(0,g.le)(e.name)?"":e.name}const Ge=class{constructor(e){this.editedCells=new Map,this.addedRows=[],this.deletedRows=[],this.numRows=0,this.numRows=e}toJson(e){const t=new Map;e.forEach((e=>{t.set(e.indexNumber,e)}));const n={edited_rows:{},added_rows:[],deleted_rows:[]};this.editedCells.forEach(((e,i,o)=>{const l={};e.forEach(((e,n,i)=>{const o=t.get(n);o&&(l[Ke(o)]=o.getCellValue(e))})),n.edited_rows[i]=l})),this.addedRows.forEach((e=>{const i={};let o=!1;e.forEach(((e,n,l)=>{const r=t.get(n);if(r){const t=r.getCellValue(e);r.isRequired&&r.isEditable&&U(e)&&(o=!0),(0,g.bb)(t)&&(i[Ke(r)]=t)}})),o||n.added_rows.push(i)})),n.deleted_rows=this.deletedRows;return JSON.stringify(n,((e,t)=>void 0===t?null:t))}fromJson(e,t){this.editedCells=new Map,this.addedRows=[],this.deletedRows=[];const n=JSON.parse(e),i=new Map;t.forEach((e=>{i.set(e.indexNumber,e)}));const o=new Map;t.forEach((e=>{o.set(Ke(e),e)})),Object.keys(n.edited_rows).forEach((e=>{const t=Number(e),i=n.edited_rows[e];Object.keys(i).forEach((e=>{const n=i[e],l=o.get(e);if(l){const e=l.getCell(n);var r;if(e)this.editedCells.has(t)||this.editedCells.set(t,new Map),null===(r=this.editedCells.get(t))||void 0===r||r.set(l.indexNumber,e)}}))})),n.added_rows.forEach((e=>{const n=new Map;t.forEach((e=>{n.set(e.indexNumber,e.getCell(null))})),Object.keys(e).forEach((t=>{const i=e[t],l=o.get(t);if(l){const e=l.getCell(i);e&&n.set(l.indexNumber,e)}})),this.addedRows.push(n)})),this.deletedRows=n.deleted_rows}isAddedRow(e){return e>=this.numRows}getCell(e,t){if(this.isAddedRow(t))return this.addedRows[t-this.numRows].get(e);const n=this.editedCells.get(t);return void 0!==n?n.get(e):void 0}setCell(e,t,n){if(this.isAddedRow(t)){if(t-this.numRows>=this.addedRows.length)return;this.addedRows[t-this.numRows].set(e,n)}else{void 0===this.editedCells.get(t)&&this.editedCells.set(t,new Map);this.editedCells.get(t).set(e,n)}}addRow(e){this.addedRows.push(e)}deleteRows(e){e.sort(((e,t)=>t-e)).forEach((e=>{this.deleteRow(e)}))}deleteRow(e){(0,g.le)(e)||e<0||(this.isAddedRow(e)?this.addedRows.splice(e-this.numRows,1):(this.deletedRows.includes(e)||(this.deletedRows.push(e),this.deletedRows=this.deletedRows.sort(((e,t)=>e-t))),this.editedCells.delete(e)))}getOriginalRowIndex(e){let t=e;for(let n=0;n<this.deletedRows.length&&!(this.deletedRows[n]>t);n++)t+=1;return t}getNumRows(){return this.numRows+this.addedRows.length-this.deletedRows.length}};var Xe=n(35704);const Qe=function(){const e=(0,f.u)(),t=i.useMemo((()=>({editable:e=>'<svg xmlns="http://www.w3.org/2000/svg" height="40" viewBox="0 96 960 960" width="40" fill="'.concat(e.bgColor,'"><path d="m800.641 679.743-64.384-64.384 29-29q7.156-6.948 17.642-6.948 10.485 0 17.742 6.948l29 29q6.948 7.464 6.948 17.95 0 10.486-6.948 17.434l-29 29Zm-310.64 246.256v-64.383l210.82-210.821 64.384 64.384-210.821 210.82h-64.383Zm-360-204.872v-50.254h289.743v50.254H130.001Zm0-162.564v-50.255h454.615v50.255H130.001Zm0-162.307v-50.255h454.615v50.255H130.001Z"/></svg>')})),[]);return{theme:i.useMemo((()=>({accentColor:e.colors.primary,accentFg:e.colors.white,accentLight:(0,Xe.DZ)(e.colors.primary,.9),borderColor:e.colors.fadedText05,horizontalBorderColor:e.colors.fadedText05,fontFamily:e.genericFonts.bodyFont,bgSearchResult:(0,Xe.DZ)(e.colors.primary,.9),resizeIndicatorColor:e.colors.primary,bgIconHeader:e.colors.fadedText60,fgIconHeader:e.colors.white,bgHeader:e.colors.bgMix,bgHeaderHasFocus:e.colors.secondaryBg,bgHeaderHovered:e.colors.secondaryBg,textHeader:e.colors.fadedText60,textHeaderSelected:e.colors.white,textGroupHeader:e.colors.fadedText60,headerFontStyle:"".concat(e.fontSizes.sm),baseFontStyle:e.fontSizes.sm,editorFontSize:e.fontSizes.sm,textDark:e.colors.bodyText,textMedium:(0,Xe.DZ)(e.colors.bodyText,.2),textLight:e.colors.fadedText40,textBubble:e.colors.fadedText60,bgCell:e.colors.bgColor,bgCellMedium:e.colors.bgColor,cellHorizontalPadding:8,cellVerticalPadding:3,bgBubble:e.colors.secondaryBg,bgBubbleSelected:e.colors.secondaryBg,linkColor:e.colors.linkText,drilldownBorder:e.colors.darkenedBgMix25})),[e]),tableBorderRadius:e.radii.lg,headerIcons:t}};const $e=function(e,t,n,o){return{getCellContent:i.useCallback((i=>{let[l,r]=i;if(l>t.length-1)return Z("Column index out of bounds.","This should never happen. Please report this bug.");if(r>n-1)return Z("Row index out of bounds.","This should never happen. Please report this bug.");const a=t[l],s=a.indexNumber,d=o.current.getOriginalRowIndex(r),c=o.current.isAddedRow(d);if(a.isEditable||c){const e=o.current.getCell(s,d);if((0,g.bb)(e))return e;if(c)return Z("Error during cell creation.","This should never happen. Please report this bug. "+"No cell found for an added row: col=".concat(s,"; row=").concat(d))}try{return Ne(a,e.getCell(d+1,s),e.cssStyles)}catch(u){return Z("Error during cell creation.","This should never happen. Please report this bug. \nError: ".concat(u))}}),[t,n,e,o])}};var et=n(32700);const tt=function(e,t,n){const[o,l]=i.useState(),{getCellContent:r,getOriginalIndex:a}=(0,et.fF)({columns:t.map((e=>K(e))),getCellContent:n,rows:e,sort:o}),s=i.useMemo((()=>function(e,t){return void 0===t?e:e.map((e=>e.id===t.column.id?{...e,title:"asc"===t.direction?"\u2191 ".concat(e.title):"\u2193 ".concat(e.title)}:e))}(t,o)),[t,o]),d=i.useCallback((e=>{let t="asc";const n=s[e];if(o&&o.column.id===n.id){if("asc"!==o.direction)return void l(void 0);t="desc"}l({column:K(n),direction:t,mode:n.sortMode})}),[o,s]);return{columns:s,sortColumn:d,getOriginalIndex:a,getCellContent:r}};var nt=n(62813),it=n.n(nt);const ot=function(e,t,n,l,r){const[a,s]=i.useState({columns:o.EV.empty(),rows:o.EV.empty(),current:void 0}),d=!t&&!n&&(e.selectionMode.includes(p.Eh.SelectionMode.MULTI_ROW)||e.selectionMode.includes(p.Eh.SelectionMode.SINGLE_ROW)),c=d&&e.selectionMode.includes(p.Eh.SelectionMode.MULTI_ROW),u=!t&&!n&&(e.selectionMode.includes(p.Eh.SelectionMode.SINGLE_COLUMN)||e.selectionMode.includes(p.Eh.SelectionMode.MULTI_COLUMN)),m=u&&e.selectionMode.includes(p.Eh.SelectionMode.MULTI_COLUMN),h=a.rows.length>0,g=a.columns.length>0,f=void 0!==a.current,b=i.useCallback((e=>{const t=!it()(e.rows.toArray(),a.rows.toArray()),n=!it()(e.columns.toArray(),a.columns.toArray()),i=!it()(e.current,a.current);let o=d&&t||u&&n,c=e;if((d||u)&&void 0!==e.current&&i&&(c={...e,rows:a.rows,columns:a.columns},o=!1),t&&e.rows.length>0&&n&&0===e.columns.length&&(c={...c,columns:a.columns},o=!0),n&&e.columns.length>0&&t&&0===e.rows.length&&(c={...c,rows:a.rows},o=!0),n&&c.columns.length>=0){let e=c.columns;l.forEach(((t,n)=>{t.isIndex&&(e=e.remove(n))})),e.length<c.columns.length&&(c={...c,columns:e})}s(c),o&&r(c)}),[a,d,u,r,l]),v=i.useCallback((function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n={columns:t?a.columns:o.EV.empty(),rows:e?a.rows:o.EV.empty(),current:void 0};s(n),(!e&&d||!t&&u)&&r(n)}),[a,d,u,r]);return{gridSelection:a,isRowSelectionActivated:d,isMultiRowSelectionActivated:c,isColumnSelectionActivated:u,isMultiColumnSelectionActivated:m,isRowSelected:h,isColumnSelected:g,isCellSelected:f,clearSelection:v,processSelectionChange:b}},lt=",",rt='"',at='"',st="\n",dt="\ufeff",ct=new RegExp("[".concat([lt,rt,st].join(""),"]"));function ut(e){return e.map((e=>function(e){if((0,g.le)(e))return"";const t=Q(e);if(ct.test(t))return"".concat(rt).concat(t.replace(new RegExp(rt,"g"),at+rt)).concat(rt);return t}(e))).join(lt)+st}async function mt(e,t,n,i){const o=new TextEncoder;await e.write(o.encode(dt));const l=n.map((e=>e.name));await e.write(o.encode(ut(l)));for(let r=0;r<i;r++){const i=[];n.forEach(((e,n,o)=>{i.push(e.getCellValue(t([n,r])))})),await e.write(o.encode(ut(i)))}await e.close()}const ht=function(e,t,o,l){return{exportToCsv:i.useCallback((async()=>{const i=(new Date).toISOString().slice(0,16).replace(":","-"),r="".concat(i,"_export.csv");try{const i=await n.e(5345).then(n.bind(n,95345)),l=await i.showSaveFilePicker({suggestedName:r,types:[{accept:{"text/csv":[".csv"]}}],excludeAcceptAllOption:!1}),a=await l.createWritable();await mt(a,e,t,o)}catch(a){if(a instanceof Error&&"AbortError"===a.name)return;try{(0,ae.KE)("Failed to export data as CSV with FileSystem API, trying fallback method",a);let n="";const i=new WritableStream({write:async e=>{n+=new TextDecoder("utf-8").decode(e)},close:async()=>{}});await mt(i.getWriter(),e,t,o);const s=new Blob([n],{type:"text/csv;charset=utf-8;"}),d=URL.createObjectURL(s),c=document.createElement("a");l?c.setAttribute("target","_blank"):c.setAttribute("target","_self"),c.style.display="none",c.href=d,c.download=r,document.body.appendChild(c),c.click(),document.body.removeChild(c),URL.revokeObjectURL(d)}catch(a){(0,ae.H)("Failed to export data as CSV",a)}}}),[t,o,e,l])}};const pt=function(e,t,n,o,l,r,a,s,d){const c=i.useCallback(((t,i)=>{let[r,a]=t;const d=e[r];if(!d.isEditable)return;const c=d.indexNumber,u=n.current.getOriginalRowIndex(l(a)),m=o([r,a]),h=d.getCellValue(m),p=d.getCellValue(i);if(!Y(m)&&p===h)return;const g=d.getCell(p,!0);Y(g)?(0,ae.KE)("Not applying the cell edit since it causes this error:\n ".concat(g.data)):(n.current.setCell(c,u,{...g,lastUpdated:performance.now()}),s())}),[e,n,l,o,s]),u=i.useCallback((()=>{if(t)return;const i=new Map;e.forEach((e=>{i.set(e.indexNumber,e.getCell(e.defaultValue))})),n.current.addRow(i),a()}),[e,n,t,a]),m=i.useCallback((()=>{t||(u(),s())}),[u,s,t]),h=i.useCallback((i=>{var o;if(i.rows.length>0){if(t)return!0;const e=i.rows.toArray().map((e=>n.current.getOriginalRowIndex(l(e))));return n.current.deleteRows(e),a(),d(),s(),!1}if(null!==(o=i.current)&&void 0!==o&&o.range){const t=[],n=i.current.range;for(let i=n.y;i<n.y+n.height;i++)for(let o=n.x;o<n.x+n.width;o++){const n=e[o];n.isEditable&&!n.isRequired&&(t.push({cell:[o,i]}),c([o,i],n.getCell(null)))}return t.length>0&&(s(),r(t)),!1}return!0}),[e,n,t,r,l,s,c,d,a]),p=i.useCallback(((i,a)=>{const[d,c]=i,m=[];for(let h=0;h<a.length;h++){const i=a[h];if(h+c>=n.current.getNumRows()){if(t)break;u()}for(let t=0;t<i.length;t++){const r=i[t],a=h+c,s=t+d;if(s>=e.length)break;const u=e[s];if(u.isEditable){const e=u.getCell(r,!0);if((0,g.bb)(e)&&!Y(e)){const t=u.indexNumber,i=n.current.getOriginalRowIndex(l(a)),r=u.getCellValue(o([s,a]));u.getCellValue(e)!==r&&(n.current.setCell(t,i,{...e,lastUpdated:performance.now()}),m.push({cell:[s,a]}))}}}m.length>0&&(s(),r(m))}return!1}),[e,n,t,l,o,u,s,r]),f=i.useCallback(((t,n)=>{const i=t[0];if(i>=e.length)return!0;const o=e[i];if(o.validateInput){const e=o.validateInput(o.getCellValue(n));return!0===e||!1===e?e:o.getCell(e)}return!0}),[e]);return{onCellEdited:c,onPaste:p,onRowAppended:m,onDelete:h,validateCell:f}};const gt=function(e,t){const[n,o]=i.useState(),l=i.useRef(null),r=i.useCallback((n=>{if(clearTimeout(l.current),l.current=0,o(void 0),("header"===n.kind||"cell"===n.kind)&&n.location){const i=n.location[0],r=n.location[1];let a;if(i<0||i>=e.length)return;const s=e[i];if("header"===n.kind&&(0,g.bb)(s))a=s.help;else if("cell"===n.kind){const e=t([i,r]);s.isRequired&&s.isEditable&&U(e)?a="\u26a0\ufe0f Please fill out this cell.":function(e){return e.hasOwnProperty("tooltip")&&""!==e.tooltip}(e)&&(a=e.tooltip)}a&&(l.current=setTimeout((()=>{a&&o({content:a,left:n.bounds.x+n.bounds.width/2,top:n.bounds.y})}),600))}}),[e,t,o,l]);return{tooltip:n,clearTooltip:i.useCallback((()=>{o(void 0)}),[o]),onItemHovered:r}};var ft=n(39806),bt=n(97613),vt=n(5527),yt=n(85e3),wt=n(37538);const xt=function(e){return{drawCell:i.useCallback(((t,n)=>{const{cell:i,theme:o,ctx:l,rect:r}=t,a=t.col;if(U(i)&&a<e.length){const i=e[a];return["checkbox","line_chart","bar_chart","progress"].includes(i.kind)?n():(e=>{const{cell:t,theme:n,ctx:i}=e;(0,ft.L6)({...e,theme:{...n,textDark:n.textLight,headerFontFull:"".concat(n.headerFontStyle," ").concat(n.fontFamily),baseFontFull:"".concat(n.baseFontStyle," ").concat(n.fontFamily),markerFontFull:"".concat(n.markerFontStyle," ").concat(n.fontFamily)},spriteManager:{},hyperWrapping:!1},"None",t.contentAlign),i.fillStyle=n.textDark})(t),void(i.isRequired&&i.isEditable&&function(e,t,n){e.save(),e.beginPath(),e.moveTo(t.x+t.width-8,t.y+1),e.lineTo(t.x+t.width,t.y+1),e.lineTo(t.x+t.width,t.y+1+8),e.fillStyle=n.accentColor,e.fill(),e.restore()}(l,r,o))}n()}),[e]),customRenderers:i.useMemo((()=>[bt.Z,vt.Z,yt.Z,wt.ZP,...je]),[])}};const Ct=function(e){const[t,n]=(0,i.useState)((()=>new Map)),o=i.useCallback(((e,i,o,l)=>{e.id&&n(new Map(t).set(e.id,l))}),[t]);return{columns:i.useMemo((()=>e.map((e=>e.id&&t.has(e.id)&&void 0!==t.get(e.id)?{...e,width:t.get(e.id),grow:0}:e))),[e,t]),onColumnResize:o}},Et=2,St=35,Mt=50+Et,kt=2*St+Et;const Tt=function(e,t,n,o,l){let r,a=function(e){return Math.max(e*St+Et,kt)}(t+1+(e.editingMode===p.Eh.EditingMode.DYNAMIC?1:0)),s=Math.min(a,400);e.height&&(s=Math.max(e.height,kt),a=Math.max(e.height,a)),o&&(s=Math.min(s,o),a=Math.min(a,o),e.height||(s=a));let d=n;e.useContainerWidth?r=n:e.width&&(r=Math.min(Math.max(e.width,Mt),n),d=Math.min(Math.max(e.width,d),n));const[c,u]=i.useState({width:r||"100%",height:s});return i.useLayoutEffect((()=>{e.useContainerWidth&&"100%"===c.width&&u({width:n,height:c.height})}),[n]),i.useLayoutEffect((()=>{u({width:c.width,height:s})}),[t]),i.useLayoutEffect((()=>{u({width:r||"100%",height:c.height})}),[r]),i.useLayoutEffect((()=>{u({width:c.width,height:s})}),[s]),i.useLayoutEffect((()=>{if(l){const t=e.useContainerWidth||(0,g.bb)(e.width)&&e.width>0;u({width:t?d:"100%",height:a})}else u({width:r||"100%",height:s})}),[l]),{minHeight:kt,maxHeight:a,minWidth:Mt,maxWidth:d,resizableSize:c,setResizableSize:u}},Rt=(0,S.Z)("img",{target:"e24uaba0"})((()=>({maxWidth:"100%",maxHeight:"600px",objectFit:"scale-down"})),""),Nt=e=>{let{urls:t}=e;const n=t&&t.length>0?t[0]:"";return n.startsWith("http")?(0,R.jsx)("a",{href:n,target:"_blank",rel:"noreferrer noopener",children:(0,R.jsx)(Rt,{src:n})}):(0,R.jsx)(Rt,{src:n})};var It=n(31572),_t=n(13553),Ot=n(80152);const Dt=function(e){let{top:t,left:n,content:o,clearTooltip:l}=e;const[r,a]=i.useState(!0),s=(0,f.u)(),{colors:d,fontSizes:c,radii:u}=s,m=i.useCallback((()=>{a(!1),l()}),[l,a]);return(0,R.jsx)(It.Z,{content:(0,R.jsx)(Ot.Uo,{className:"stTooltipContent",children:(0,R.jsx)(y.ZP,{style:{fontSize:c.sm},source:o,allowHTML:!1})}),placement:_t.r4.top,accessibilityType:_t.SI.tooltip,showArrow:!1,popoverMargin:5,onClickOutside:m,onEsc:m,overrides:{Body:{style:{borderTopLeftRadius:u.md,borderTopRightRadius:u.md,borderBottomLeftRadius:u.md,borderBottomRightRadius:u.md,paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important",backgroundColor:"transparent"}},Inner:{style:{backgroundColor:(0,M.Iy)(s)?d.bgColor:d.secondaryBg,color:d.bodyText,fontSize:c.sm,fontWeight:"normal",paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important"}}},isOpen:r,children:(0,R.jsx)("div",{className:"stTooltipTarget","data-testid":"stTooltipTarget",style:{position:"fixed",top:t,left:n}})})},At=(0,S.Z)("div",{target:"e1w7nams0"})((e=>{let{hasCustomizedScrollbars:t,theme:n}=e;return{position:"relative",display:"inline-block","& .glideDataEditor":{height:"100%",minWidth:"100%",borderRadius:n.radii.lg},"& .dvn-scroller":{...!t&&{scrollbarWidth:"thin"},overflowX:"auto !important",overflowY:"auto !important"}}}),"");n(2739),n(24665);const Ft=(0,h.Z)((function(e){let{element:t,data:n,width:h,height:f,disabled:b,widgetMgr:v,isFullScreen:y,disableFullscreenMode:w,expand:x,collapse:C,fragmentId:E}=e;const S=i.useRef(null),M=i.useRef(null),k=i.useRef(null),{theme:T,headerIcons:O,tableBorderRadius:D}=Qe(),{libConfig:{enforceDownloadInNewTab:A=!1}}=i.useContext(_.E),[F,z]=i.useState(!0),[V,H]=i.useState(!1),[L,W]=i.useState(!1),[j,B]=i.useState(!1),P=i.useMemo((()=>window.matchMedia&&window.matchMedia("(pointer: coarse)").matches),[]),Z=i.useMemo((()=>window.navigator.userAgent.includes("Mac OS")&&window.navigator.userAgent.includes("Safari")||window.navigator.userAgent.includes("Chrome")),[]);(0,g.le)(t.editingMode)&&(t.editingMode=p.Eh.EditingMode.READ_ONLY);const{READ_ONLY:Y,DYNAMIC:U}=p.Eh.EditingMode,q=n.dimensions,G=Math.max(0,q.rows-1),X=0===G&&!(t.editingMode===U&&q.dataColumns>0),Q=G>15e4,$=i.useRef(new Ge(G)),[ee,te]=i.useState($.current.getNumRows());i.useEffect((()=>{$.current=new Ge(G),te($.current.getNumRows())}),[G]);const ne=i.useCallback((()=>{$.current=new Ge(G),te($.current.getNumRows())}),[G]),{columns:ie}=Je(t,n,b);i.useEffect((()=>{if(t.editingMode===Y)return;const e=v.getStringValue({id:t.id,formId:t.formId});e&&($.current.fromJson(e,ie),te($.current.getNumRows()))}),[]);const{getCellContent:oe}=$e(n,ie,ee,$),{columns:le,sortColumn:re,getOriginalIndex:ae,getCellContent:se}=tt(G,ie,oe),de=i.useCallback((0,g.Ds)(150,(e=>{const n={selection:{rows:[],columns:[]}};n.selection.rows=e.rows.toArray().map((e=>ae(e))),n.selection.columns=e.columns.toArray().map((e=>Ke(le[e])));const i=JSON.stringify(n),o=v.getStringValue({id:t.id,formId:t.formId});void 0!==o&&o===i||v.setStringValue({id:t.id,formId:t.formId},i,{fromUi:!0},E)})),[t.id,t.formId,v,E,ae,Ke]),{gridSelection:ce,isRowSelectionActivated:ue,isMultiRowSelectionActivated:me,isColumnSelectionActivated:he,isMultiColumnSelectionActivated:pe,isRowSelected:ge,isColumnSelected:fe,isCellSelected:be,clearSelection:ve,processSelectionChange:ye}=ot(t,X,b,le,de);i.useEffect((()=>{ve(!0,!0)}),[y]);const we=i.useCallback((e=>{var t;null===(t=M.current)||void 0===t||t.updateCells(e)}),[]);i.useEffect((()=>{if(!ue&&!he)return;const e=v.getStringValue({id:t.id,formId:t.formId});if(e){var n,i,l,r;const t=le.map((e=>Ke(e))),a=JSON.parse(e);let s=o.EV.empty(),d=o.EV.empty();if(null===(n=a.selection)||void 0===n||null===(i=n.rows)||void 0===i||i.forEach((e=>{s=s.add(e)})),null===(l=a.selection)||void 0===l||null===(r=l.columns)||void 0===r||r.forEach((e=>{d=d.add(t.indexOf(e))})),s.length>0||d.length>0){ye({rows:s,columns:d,current:void 0})}}}),[]);const xe=i.useCallback((()=>{ee!==$.current.getNumRows()&&te($.current.getNumRows())}),[ee]),Ce=i.useCallback((0,g.Ds)(150,(()=>{const e=$.current.toJson(le);let n=v.getStringValue({id:t.id,formId:t.formId});void 0===n&&(n=new Ge(0).toJson([])),e!==n&&v.setStringValue({id:t.id,formId:t.formId},e,{fromUi:!0},E)})),[t.id,t.formId,v,E,le,$.current]),{exportToCsv:Ee}=ht(se,le,ee,A),{onCellEdited:Se,onPaste:Me,onRowAppended:ke,onDelete:Te,validateCell:Re}=pt(le,t.editingMode!==U,$,se,ae,we,xe,Ce,ve),{tooltip:Ne,clearTooltip:Ie,onItemHovered:_e}=gt(le,se),{drawCell:Oe,customRenderers:De}=xt(le),Ae=i.useMemo((()=>le.map((e=>K(e)))),[le]),{columns:Fe,onColumnResize:ze}=Ct(Ae),{minHeight:Ve,maxHeight:He,minWidth:Le,maxWidth:We,resizableSize:je,setResizableSize:Be}=Tt(t,ee,h,f,y),Pe=i.useCallback((e=>{let[t,n]=e;return{...J(!0,!1),displayData:"empty",contentAlign:"center",allowOverlay:!1,themeOverride:{textDark:T.textLight},span:[0,Math.max(le.length-1,0)]}}),[le,T.textLight]);i.useEffect((()=>{if(!t.formId)return;const e=new m.K;return e.manageFormClearListener(v,t.formId,(()=>{ne(),ve()})),()=>{e.disconnect()}}),[t.formId,ne,ve,v]);const Ze=!X&&t.editingMode===U&&!b,Ye=X?0:le.filter((e=>e.isIndex)).length;return i.useEffect((()=>{setTimeout((()=>{if(k.current&&M.current){var e,t;const n=null===(e=k.current)||void 0===e||null===(t=e.querySelector(".dvn-stack"))||void 0===t?void 0:t.getBoundingClientRect();n&&(W(n.height>k.current.clientHeight),B(n.width>k.current.clientWidth))}}),1)}),[je,ee,Fe]),(0,R.jsxs)(At,{"data-testid":"stDataFrame",className:"stDataFrame",hasCustomizedScrollbars:Z,ref:k,onMouseDown:e=>{if(k.current&&Z){const t=k.current.getBoundingClientRect();j&&t.height-7<e.clientY-t.top&&e.stopPropagation(),L&&t.width-7<e.clientX-t.left&&e.stopPropagation()}},onBlur:e=>{F||P||e.currentTarget.contains(e.relatedTarget)||ve(!0,!0)},children:[(0,R.jsxs)(I,{isFullScreen:y,disableFullscreenMode:w,locked:ge&&!ue||be||P&&F,onExpand:x,onCollapse:C,target:At,children:[(ue&&ge||he&&fe)&&(0,R.jsx)(N,{label:"Clear selection",icon:a.x,onClick:()=>{ve(),Ie()}}),Ze&&ge&&(0,R.jsx)(N,{label:"Delete row(s)",icon:s.H,onClick:()=>{Te&&(Te(ce),Ie())}}),Ze&&!ge&&(0,R.jsx)(N,{label:"Add row",icon:d.m,onClick:()=>{ke&&(z(!0),ke(),Ie())}}),!Q&&!X&&(0,R.jsx)(N,{label:"Download as CSV",icon:c.k,onClick:()=>Ee()}),!X&&(0,R.jsx)(N,{label:"Search",icon:u.o,onClick:()=>{V?H(!1):(z(!0),H(!0)),Ie()}})]}),(0,R.jsx)(r.e,{"data-testid":"stDataFrameResizable",ref:S,defaultSize:je,style:{border:"1px solid ".concat(T.borderColor),borderRadius:"".concat(D)},minHeight:Ve,maxHeight:He,minWidth:Le,maxWidth:We,size:je,enable:{top:!1,right:!1,bottom:!1,left:!1,topRight:!1,bottomRight:!0,bottomLeft:!1,topLeft:!1},grid:[1,St],snapGap:St/3,onResizeStop:(e,t,n,i)=>{S.current&&Be({width:S.current.size.width,height:He-S.current.size.height===Et?S.current.size.height+Et:S.current.size.height})},children:(0,R.jsx)(l.F,{className:"glideDataEditor",ref:M,columns:Fe,rows:X?1:ee,minColumnWidth:50,maxColumnWidth:1e3,maxColumnAutoWidth:500,rowHeight:St,headerHeight:St,getCellContent:X?Pe:se,onColumnResize:P?void 0:ze,resizeIndicator:"header",freezeColumns:Ye,smoothScrollX:!0,smoothScrollY:!0,verticalBorder:!0,getCellsForSelection:!0,rowMarkers:"none",rangeSelect:P?"cell":"rect",columnSelect:"none",rowSelect:"none",onItemHovered:_e,keybindings:{downFill:!0},onKeyDown:e=>{(e.ctrlKey||e.metaKey)&&"f"===e.key&&(H((e=>!e)),e.stopPropagation(),e.preventDefault())},showSearch:V,onSearchClose:()=>{H(!1),Ie()},onHeaderClicked:(e,t)=>{X||Q||he||(ue&&ge&&ve(),re(e))},gridSelection:ce,onGridSelectionChange:e=>{(F||P)&&(ye(e),void 0!==Ne&&Ie())},theme:T,onMouseMove:e=>{"out-of-bounds"===e.kind&&F?z(!1):"out-of-bounds"===e.kind||F||z(!0)},fixedShadowX:!0,fixedShadowY:!0,experimental:{scrollbarWidthOverride:0,...Z&&{paddingBottom:j?-6:void 0,paddingRight:L?-6:void 0}},drawCell:Oe,customRenderers:De,imageEditorOverride:Nt,headerIcons:O,validateCell:Re,onPaste:!1,...ue&&{rowMarkers:{kind:"checkbox",checkboxStyle:"square",theme:{bgCell:T.bgHeader,bgCellMedium:T.bgHeader}},rowSelectionMode:me?"multi":"auto",rowSelect:b?"none":me?"multi":"single",rowSelectionBlending:"mixed",rangeSelectionBlending:"exclusive"},...he&&{columnSelect:b?"none":pe?"multi":"single",columnSelectionBlending:"mixed",rangeSelectionBlending:"exclusive"},...!X&&t.editingMode!==Y&&!b&&{fillHandle:!P,onCellEdited:Se,onPaste:Me,onDelete:Te},...!X&&t.editingMode===U&&{trailingRowOptions:{sticky:!1,tint:!0},rowMarkers:{kind:"checkbox",checkboxStyle:"square",theme:{bgCell:T.bgHeader,bgCellMedium:T.bgHeader}},rowSelectionMode:"multi",rowSelect:b?"none":"multi",onRowAppended:b?void 0:ke,onHeaderClicked:void 0}})}),Ne&&Ne.content&&(0,R.jsx)(Dt,{top:Ne.top,left:Ne.left,content:Ne.content,clearTooltip:Ie})]})}),!0)},87814:(e,t,n)=>{n.d(t,{K:()=>o});var i=n(50641);class o{constructor(){this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}manageFormClearListener(e,t,n){null!=this.formClearListener&&this.lastWidgetMgr===e&&this.lastFormId===t||(this.disconnect(),(0,i.bM)(t)&&(this.formClearListener=e.addFormClearedListener(t,n),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}}}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunk_streamlit_app=self.webpackChunk_streamlit_app||[]).push([[8427],{18427:(e,t,o)=>{o.r(t),o.d(t,{default:()=>b});var i=o(66845),r=o(25621),s=o(69021),n=o(27466),a=o(63730),l=o(59033),d=o(36989),c=o(1515);const g=(0,c.Z)("button",{target:"elibz2u3"})((e=>{let{theme:t}=e;return{fontSize:t.fontSizes.sm,lineHeight:"1.4rem",color:t.colors.fadedText60,backgroundColor:t.colors.transparent,border:"none",boxShadow:"none",padding:"0px","&:hover, &:active, &:focus":{border:"none",outline:"none",boxShadow:"none"},"&:hover":{color:t.colors.primary}}}),""),p=(0,c.Z)("div",{target:"elibz2u2"})((e=>{let{theme:t}=e;return{display:"flex",flexDirection:"row",gap:t.spacing.lg,"> span":{marginTop:"0.25rem"}}}),""),u=(0,c.Z)("div",{target:"elibz2u0"})((e=>{let{theme:t}=e;return{display:"flex",flexDirection:"column",gap:t.spacing.sm,alignItems:"start",justifyContent:"center",overflow:"hidden",minHeight:"100%",fontSize:t.fontSizes.sm,lineHeight:t.lineHeights.base}}),"");var h=o(22704),f=o(40864);const b=(0,r.b)((function(e){let{theme:t,body:o,icon:r,width:c}=e;const b=function(e){if(e.length>104){let t=e.replace(/^(.{104}[^\s]*).*/,"$1");return t.length>104&&(t=t.substring(0,104).split(" ").slice(0,-1).join(" ")),t.trim()}return e}(o),m=o!==b,[x,w]=(0,i.useState)(!m),[y,S]=(0,i.useState)(0),v=(0,i.useCallback)((()=>{w(!x)}),[x]),T=(0,i.useMemo)((()=>function(e){const t=(0,n.Iy)(e);return{Body:{props:{"data-testid":"stToast"},style:{display:"flex",flexDirection:"row",gap:e.spacing.md,width:e.sizes.sidebar,marginTop:"8px",borderTopLeftRadius:e.radii.lg,borderTopRightRadius:e.radii.lg,borderBottomLeftRadius:e.radii.lg,borderBottomRightRadius:e.radii.lg,paddingTop:e.spacing.lg,paddingBottom:e.spacing.lg,paddingLeft:e.spacing.twoXL,paddingRight:e.spacing.twoXL,backgroundColor:t?e.colors.gray10:e.colors.gray90,color:e.colors.bodyText,boxShadow:t?"0px 4px 16px rgba(0, 0, 0, 0.16)":"0px 4px 16px rgba(0, 0, 0, 0.7)"}},CloseIcon:{style:{color:e.colors.fadedText40,width:e.fontSizes.lg,height:e.fontSizes.lg,marginRight:"calc(-1 * ".concat(e.spacing.lg," / 2)"),":hover":{color:e.colors.bodyText}}}}}(t)),[t]),z=(0,i.useMemo)((()=>(0,f.jsx)(f.Fragment,{children:(0,f.jsxs)(p,{expanded:x,children:[r&&(0,f.jsx)(h.p,{iconValue:r,size:"xl",testid:"stToastDynamicIcon"}),(0,f.jsxs)(u,{children:[(0,f.jsx)(a.ZP,{source:x?o:b,allowHTML:!1,isToast:!0}),m&&(0,f.jsx)(g,{"data-testid":"toastViewButton",className:"toastViewButton",onClick:v,children:x?"view less":"view more"})]})]})})),[m,x,o,r,b,v]);(0,i.useEffect)((()=>{if(t.inSidebar)return;const e=s.Z.info(z,{overrides:{...T}});return S(e),()=>{s.Z.update(e,{overrides:{Body:{style:{transitionDuration:0}}}}),s.Z.clear(e)}}),[]),(0,i.useEffect)((()=>{s.Z.update(y,{children:z,overrides:{...T}})}),[y,z,T]);const R=(0,f.jsx)(d.Z,{kind:l.h.ERROR,body:"Streamlit API Error: `st.toast` cannot be called directly on the sidebar with `st.sidebar.toast`. See our `st.toast` API [docs](https://docs.streamlit.io/library/api-reference/status/st.toast) for more information.",width:c});return(0,f.jsx)(f.Fragment,{children:t.inSidebar&&R})}))}}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_streamlit_app=self.webpackChunk_streamlit_app||[]).push([[8691],{79986:(t,e,r)=>{"use strict";r.d(e,{Z:()=>d});r(66845);var n,o=r(50641),i=r(86659),s=r(50669),a=r(1515);const l=(0,r(7865).F4)(n||(n=(0,s.Z)(["\n 50% {\n color: rgba(0, 0, 0, 0);\n }\n"]))),u=(0,a.Z)("span",{target:"edlqvik0"})((t=>{let{includeDot:e,shouldBlink:r,theme:n}=t;return{...e?{"&::before":{opacity:1,content:'"\u2022"',animation:"none",color:n.colors.gray,margin:"0 5px"}}:{},...r?{color:n.colors.red,animationName:"".concat(l),animationDuration:"0.5s",animationIterationCount:5}:{}}}),"");var c=r(40864);const d=t=>{let{dirty:e,value:r,maxLength:n,className:s,type:a="single",inForm:l}=t;const d=[],p=function(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];d.push((0,c.jsx)(u,{includeDot:d.length>0,shouldBlink:e,children:t},d.length))};if(e){const t=l?"submit form":"apply";if("multiline"===a){const e=(0,o.Ge)()?"\u2318":"Ctrl";p("Press ".concat(e,"+Enter to ").concat(t))}else"single"===a&&p("Press Enter to ".concat(t))}return n&&("chat"!==a||e)&&p("".concat(r.length,"/").concat(n),e&&r.length>=n),(0,c.jsx)(i.X7,{"data-testid":"InputInstructions",className:s,children:d})}},87814:(t,e,r)=>{"use strict";r.d(e,{K:()=>o});var n=r(50641);class o{constructor(){this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}manageFormClearListener(t,e,r){null!=this.formClearListener&&this.lastWidgetMgr===t&&this.lastFormId===e||(this.disconnect(),(0,n.bM)(e)&&(this.formClearListener=t.addFormClearedListener(e,r),this.lastWidgetMgr=t,this.lastFormId=e))}disconnect(){var t;null===(t=this.formClearListener)||void 0===t||t.disconnect(),this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}}},58691:(t,e,r)=>{"use strict";r.r(e),r.d(e,{default:()=>v});var n=r(66845),o=r(70479),i=r.n(o),s=r(82534),a=r(16295),l=r(87814),u=r(79986),c=r(98478),d=r(86659),p=r(8879),h=r(68411),f=r(50641),m=r(48266);const y=(0,r(1515).Z)("div",{target:"e11y4ecf0"})((t=>{let{width:e}=t;return{position:"relative",width:e}}),"");var b=r(40864);class g extends n.PureComponent{constructor(t){var e;super(t),e=this,this.formClearHelper=new l.K,this.id=void 0,this.state={dirty:!1,value:this.initialValue},this.commitWidgetValue=function(t){let r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const{widgetMgr:n,element:o,fragmentId:i}=e.props;n.setStringValue(o,e.state.value,t,i),r&&e.setState({dirty:!1})},this.onFormCleared=()=>{this.setState(((t,e)=>{var r;return{value:null!==(r=e.element.default)&&void 0!==r?r:null}}),(()=>this.commitWidgetValue({fromUi:!0})))},this.onBlur=()=>{this.state.dirty&&this.commitWidgetValue({fromUi:!0})},this.onChange=t=>{const{value:e}=t.target,{element:r}=this.props,{maxChars:n}=r;0!==n&&e.length>n||((0,f.$b)(this.props.element)?this.setState({dirty:!0,value:e},(()=>{this.commitWidgetValue({fromUi:!0},!1)})):this.setState({dirty:!0,value:e}))},this.onKeyPress=t=>{"Enter"===t.key&&(this.state.dirty&&this.commitWidgetValue({fromUi:!0}),(0,f.$b)(this.props.element)&&this.props.widgetMgr.submitForm(this.props.element.formId,this.props.fragmentId))},this.id=i()("text_input_")}get initialValue(){var t;const e=this.props.widgetMgr.getStringValue(this.props.element);return null!==(t=null!==e&&void 0!==e?e:this.props.element.default)&&void 0!==t?t:null}componentDidMount(){this.props.element.setValue?this.updateFromProtobuf():this.commitWidgetValue({fromUi:!1})}componentDidUpdate(){this.maybeUpdateFromProtobuf()}componentWillUnmount(){this.formClearHelper.disconnect()}maybeUpdateFromProtobuf(){const{setValue:t}=this.props.element;t&&this.updateFromProtobuf()}updateFromProtobuf(){const{value:t}=this.props.element;this.props.element.setValue=!1,this.setState({value:null!==t&&void 0!==t?t:null},(()=>{this.commitWidgetValue({fromUi:!1})}))}getTypeString(){return this.props.element.type===a.oi.Type.PASSWORD?"password":"text"}render(){var t;const{dirty:e,value:r}=this.state,{element:n,width:o,disabled:i,widgetMgr:a}=this.props,{placeholder:l}=n;return this.formClearHelper.manageFormClearListener(a,n.formId,this.onFormCleared),(0,b.jsxs)(y,{className:"row-widget stTextInput","data-testid":"stTextInput",width:o,children:[(0,b.jsx)(c.O,{label:n.label,disabled:i,labelVisibility:(0,f.iF)(null===(t=n.labelVisibility)||void 0===t?void 0:t.value),htmlFor:this.id,children:n.help&&(0,b.jsx)(d.dT,{children:(0,b.jsx)(p.Z,{content:n.help,placement:h.u.TOP_RIGHT})})}),(0,b.jsx)(s.Z,{value:null!==r&&void 0!==r?r:"",placeholder:l,onBlur:this.onBlur,onChange:this.onChange,onKeyPress:this.onKeyPress,"aria-label":n.label,disabled:i,id:this.id,type:this.getTypeString(),autoComplete:n.autocomplete,overrides:{Input:{style:{minWidth:0,"::placeholder":{opacity:"0.7"},lineHeight:"1.4",paddingRight:".5rem",paddingLeft:".5rem",paddingBottom:".5rem",paddingTop:".5rem"}},Root:{props:{"data-testid":"textInputRootElement"},style:{borderLeftWidth:"1px",borderRightWidth:"1px",borderTopWidth:"1px",borderBottomWidth:"1px"}}}}),o>m.A.hideWidgetDetails&&(0,b.jsx)(u.Z,{dirty:e,value:null!==r&&void 0!==r?r:"",maxLength:n.maxChars,inForm:(0,f.$b)({formId:n.formId})})]})}}const v=g},82534:(t,e,r)=>{"use strict";r.d(e,{Z:()=>C});var n=r(66845),o=r(80318),i=r(32510),s=r(9656),a=r(98479),l=r(38254);function u(t){return u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},u(t)}var c=["Root","StartEnhancer","EndEnhancer"],d=["startEnhancer","endEnhancer","overrides"];function p(){return p=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},p.apply(this,arguments)}function h(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!==typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==r)return;var n,o,i=[],s=!0,a=!1;try{for(r=r.call(t);!(s=(n=r.next()).done)&&(i.push(n.value),!e||i.length!==e);s=!0);}catch(l){a=!0,o=l}finally{try{s||null==r.return||r.return()}finally{if(a)throw o}}return i}(t,e)||function(t,e){if(!t)return;if("string"===typeof t)return f(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return f(t,e)}(t,e)||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 f(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function m(t,e){if(null==t)return{};var r,n,o=function(t,e){if(null==t)return{};var r,n,o={},i=Object.keys(t);for(n=0;n<i.length;n++)r=i[n],e.indexOf(r)>=0||(o[r]=t[r]);return o}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(n=0;n<i.length;n++)r=i[n],e.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}function y(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function b(t,e){return b=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},b(t,e)}function g(t){var e=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(t){return!1}}();return function(){var r,n=w(t);if(e){var o=w(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return function(t,e){if(e&&("object"===u(e)||"function"===typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return v(t)}(this,r)}}function v(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function w(t){return w=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},w(t)}function j(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var O=function(t){!function(t,e){if("function"!==typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&b(t,e)}(w,t);var e,r,u,f=g(w);function w(){var t;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,w);for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return j(v(t=f.call.apply(f,[this].concat(r))),"state",{isFocused:t.props.autoFocus||!1}),j(v(t),"onFocus",(function(e){t.setState({isFocused:!0}),t.props.onFocus(e)})),j(v(t),"onBlur",(function(e){t.setState({isFocused:!1}),t.props.onBlur(e)})),t}return e=w,(r=[{key:"render",value:function(){var t=this.props,e=t.startEnhancer,r=t.endEnhancer,u=t.overrides,f=u.Root,y=u.StartEnhancer,b=u.EndEnhancer,g=m(u,c),v=m(t,d),w=h((0,o.jb)(f,a.fC),2),j=w[0],O=w[1],C=h((0,o.jb)(y,a.Fp),2),S=C[0],P=C[1],E=h((0,o.jb)(b,a.Fp),2),I=E[0],W=E[1],V=(0,i.t)(this.props,this.state);return n.createElement(j,p({"data-baseweb":"input"},V,O,{$adjoined:F(e,r),$hasIconTrailing:this.props.clearable||"password"==this.props.type}),x(e)&&n.createElement(S,p({},V,P,{$position:l.Xf.start}),"function"===typeof e?e(V):e),n.createElement(s.Z,p({},v,{overrides:g,adjoined:F(e,r),onFocus:this.onFocus,onBlur:this.onBlur})),x(r)&&n.createElement(I,p({},V,W,{$position:l.Xf.end}),"function"===typeof r?r(V):r))}}])&&y(e.prototype,r),u&&y(e,u),Object.defineProperty(e,"prototype",{writable:!1}),w}(n.Component);function F(t,e){return x(t)&&x(e)?l.y4.both:x(t)?l.y4.left:x(e)?l.y4.right:l.y4.none}function x(t){return Boolean(t||0===t)}j(O,"defaultProps",{autoComplete:"on",autoFocus:!1,disabled:!1,name:"",onBlur:function(){},onFocus:function(){},overrides:{},required:!1,size:l.NO.default,startEnhancer:null,endEnhancer:null,clearable:!1,type:"text",readOnly:!1});const C=O},70479:(t,e,r)=>{var n=r(38145),o=0;t.exports=function(t){var e=++o;return n(t)+e}}}]);