streamlit-nightly 1.42.3.dev20250224__py2.py3-none-any.whl → 1.42.3.dev20250225__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 (86) hide show
  1. streamlit/elements/arrow.py +16 -8
  2. streamlit/elements/widgets/data_editor.py +12 -7
  3. streamlit/runtime/caching/hashing.py +67 -5
  4. streamlit/static/index.html +1 -1
  5. streamlit/static/static/js/{FileDownload.esm.Db6P60XC.js → FileDownload.esm.BlYgQAwd.js} +1 -1
  6. streamlit/static/static/js/{FileHelper.LHDgAkEu.js → FileHelper.Da-FUCX4.js} +1 -1
  7. streamlit/static/static/js/{FormClearHelper.BkPbs0OF.js → FormClearHelper.B4WYSqDL.js} +1 -1
  8. streamlit/static/static/js/{Hooks.CW1Ujj-E.js → Hooks.BoeFlDaA.js} +1 -1
  9. streamlit/static/static/js/{InputInstructions.CHpHVupe.js → InputInstructions.DiPa6u6x.js} +1 -1
  10. streamlit/static/static/js/{ProgressBar.CSZV-k_M.js → ProgressBar.B-iCNc1a.js} +1 -1
  11. streamlit/static/static/js/{RenderInPortalIfExists.CrI9B0Qh.js → RenderInPortalIfExists.DPgp77ia.js} +1 -1
  12. streamlit/static/static/js/{Toolbar.CfNF-56q.js → Toolbar.9G2Er6_r.js} +1 -1
  13. streamlit/static/static/js/{base-input.BBFJwxWO.js → base-input.z22leTiB.js} +3 -3
  14. streamlit/static/static/js/checkbox.DT5JbCKx.js +9 -0
  15. streamlit/static/static/js/{createSuper.rz8EjYR0.js → createSuper.9dngDO4F.js} +1 -1
  16. streamlit/static/static/js/data-grid-overlay-editor.DnBgrJEy.js +1 -0
  17. streamlit/static/static/js/{downloader.DEY2_Oao.js → downloader.BgiOz4Dy.js} +1 -1
  18. streamlit/static/static/js/{es6.Cbt8Qb0v.js → es6.C2nbxS8x.js} +2 -2
  19. streamlit/static/static/js/{iframeResizer.contentWindow.DlY1zPt7.js → iframeResizer.contentWindow.XvWZp7Dg.js} +1 -1
  20. streamlit/static/static/js/{index.BtBNIxWC.js → index.B5-iXfzx.js} +1 -1
  21. streamlit/static/static/js/{index.7HEH_7fJ.js → index.BDSGWkr0.js} +3 -3
  22. streamlit/static/static/js/{index.I2Ij_yHL.js → index.BFYGskaf.js} +1 -1
  23. streamlit/static/static/js/{index.Df3vkO_v.js → index.BNc20KTN.js} +1 -1
  24. streamlit/static/static/js/{index.D1sfL1bE.js → index.BTK3gx3H.js} +1 -1
  25. streamlit/static/static/js/{index.C41AtD-D.js → index.BdtKHTgl.js} +1 -1
  26. streamlit/static/static/js/{index.LmMDdxLh.js → index.Bgn4z-Mp.js} +1 -1
  27. streamlit/static/static/js/{index.jj20zRA4.js → index.BiPYzGZi.js} +1 -1
  28. streamlit/static/static/js/{index.D2PC_wwi.js → index.BkyYp5Em.js} +1 -1
  29. streamlit/static/static/js/{index.LypQPPkP.js → index.BxYliQ9c.js} +1 -1
  30. streamlit/static/static/js/{index.C3FZ8TOb.js → index.C5bx6jEW.js} +2 -2
  31. streamlit/static/static/js/index.CAC6FyHh.js +1 -0
  32. streamlit/static/static/js/{index.B5Q1lb1E.js → index.CBYIbEuv.js} +1 -1
  33. streamlit/static/static/js/{index.BcIDRdbw.js → index.CBoIJv6M.js} +1 -1
  34. streamlit/static/static/js/{index.InwDjRN5.js → index.CMvo7Iwl.js} +1 -1
  35. streamlit/static/static/js/{index.CUFUpykP.js → index.CrNuA-BG.js} +2 -2
  36. streamlit/static/static/js/index.D-9nQW74.js +1 -0
  37. streamlit/static/static/js/{index.DEz7mrAp.js → index.D5wciRNz.js} +1 -1
  38. streamlit/static/static/js/{index.DxvQWdtj.js → index.D9bqDCB_.js} +18 -18
  39. streamlit/static/static/js/index.DC6PJYZU.js +1 -0
  40. streamlit/static/static/js/{index.CgZ_3VRU.js → index.DMreumKF.js} +1 -1
  41. streamlit/static/static/js/{index.BFFhpOhV.js → index.DTP3exjF.js} +1 -1
  42. streamlit/static/static/js/{index.D8mp5ppE.js → index.DV46EgCO.js} +1 -1
  43. streamlit/static/static/js/{index.CjN5S59O.js → index.DZ_FHOJd.js} +1 -1
  44. streamlit/static/static/js/{index.8pg9ijwI.js → index.DcXXaGYK.js} +1 -1
  45. streamlit/static/static/js/index.DjTdTgti.js +197 -0
  46. streamlit/static/static/js/{index.Bv1JbhEf.js → index.DkwDCuk1.js} +1 -1
  47. streamlit/static/static/js/{index.RDHMaPCV.js → index.DyyHt_xV.js} +1 -1
  48. streamlit/static/static/js/{index.Bhf5i-o4.js → index.Hnms5TSS.js} +1 -1
  49. streamlit/static/static/js/{index.CUepHEom.js → index.JgS0whqe.js} +1 -1
  50. streamlit/static/static/js/{index.DPZJrrNj.js → index.T5vKsEVA.js} +1 -1
  51. streamlit/static/static/js/{index.DuUcgXrv.js → index.UrE-Phqy.js} +1 -1
  52. streamlit/static/static/js/index.bDDanN90.js +2 -0
  53. streamlit/static/static/js/{index.C9kvqGu0.js → index.exPoJHIW.js} +1 -1
  54. streamlit/static/static/js/index.pWHQEj0Q.js +1 -0
  55. streamlit/static/static/js/index.qC8qMz0q.js +3865 -0
  56. streamlit/static/static/js/{index.CIDueoC2.js → index.rECpAXqX.js} +1 -1
  57. streamlit/static/static/js/{input.QeLiGsyn.js → input.mCBQrtCY.js} +1 -1
  58. streamlit/static/static/js/{memory.0fYVo8Wx.js → memory.Te_zHgq3.js} +1 -1
  59. streamlit/static/static/js/{mergeWith.AOqADio_.js → mergeWith.Di9Yv3PE.js} +1 -1
  60. streamlit/static/static/js/number-overlay-editor.Du6B2U8c.js +9 -0
  61. streamlit/static/static/js/{possibleConstructorReturn.C4RsC1R8.js → possibleConstructorReturn.DqqPe-iu.js} +1 -1
  62. streamlit/static/static/js/{sandbox.DT2p3KTe.js → sandbox.iqWXuowq.js} +1 -1
  63. streamlit/static/static/js/{textarea.DQh9RYKV.js → textarea.DUN7d2zN.js} +1 -1
  64. streamlit/static/static/js/{timepicker.Br_cR0hi.js → timepicker.BkmEJ-b8.js} +1 -1
  65. streamlit/static/static/js/{toConsumableArray.CzYSWELu.js → toConsumableArray.D4OFzlWy.js} +1 -1
  66. streamlit/static/static/js/uniqueId.6OlKTkzK.js +1 -0
  67. streamlit/static/static/js/{useBasicWidgetState.6R32QW2v.js → useBasicWidgetState.Btr3rzhN.js} +1 -1
  68. streamlit/static/static/js/{useOnInputChange.C4OiWI1_.js → useOnInputChange.BM7LVpC-.js} +1 -1
  69. streamlit/static/static/js/{withFullScreenWrapper.BLeP_b5i.js → withFullScreenWrapper.BCTIo1o2.js} +1 -1
  70. streamlit/user_info.py +4 -12
  71. {streamlit_nightly-1.42.3.dev20250224.dist-info → streamlit_nightly-1.42.3.dev20250225.dist-info}/METADATA +1 -1
  72. {streamlit_nightly-1.42.3.dev20250224.dist-info → streamlit_nightly-1.42.3.dev20250225.dist-info}/RECORD +76 -75
  73. {streamlit_nightly-1.42.3.dev20250224.dist-info → streamlit_nightly-1.42.3.dev20250225.dist-info}/WHEEL +1 -1
  74. streamlit/static/static/js/data-grid-overlay-editor.DUagmDpG.js +0 -1
  75. streamlit/static/static/js/index.C29vTftb.js +0 -3865
  76. streamlit/static/static/js/index.CUWXxL_C.js +0 -1
  77. streamlit/static/static/js/index.C_SUbLL7.js +0 -1
  78. streamlit/static/static/js/index.CdiPATR3.js +0 -197
  79. streamlit/static/static/js/index.Con6tiNg.js +0 -1
  80. streamlit/static/static/js/index.DymllY6d.js +0 -2
  81. streamlit/static/static/js/index.G1PSqufB.js +0 -9
  82. streamlit/static/static/js/number-overlay-editor.DAvAckzz.js +0 -9
  83. streamlit/static/static/js/uniqueId.BdUnRe3-.js +0 -1
  84. {streamlit_nightly-1.42.3.dev20250224.data → streamlit_nightly-1.42.3.dev20250225.data}/scripts/streamlit.cmd +0 -0
  85. {streamlit_nightly-1.42.3.dev20250224.dist-info → streamlit_nightly-1.42.3.dev20250225.dist-info}/entry_points.txt +0 -0
  86. {streamlit_nightly-1.42.3.dev20250224.dist-info → streamlit_nightly-1.42.3.dev20250225.dist-info}/top_level.txt +0 -0
@@ -1,4 +1,4 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index.LmMDdxLh.js","./RenderInPortalIfExists.CrI9B0Qh.js","./index.D2PC_wwi.js","./index.CdiPATR3.js","./FormClearHelper.BkPbs0OF.js","./withFullScreenWrapper.BLeP_b5i.js","./Toolbar.CfNF-56q.js","./mergeWith.AOqADio_.js","./sprintf.D7DtBTRn.js","./createDownloadLinkElement.DZMwyjvU.js","./toConsumableArray.CzYSWELu.js","./possibleConstructorReturn.C4RsC1R8.js","./createSuper.rz8EjYR0.js","./FileDownload.esm.Db6P60XC.js","../css/index.Bmkmz40k.css","./index.D8mp5ppE.js","./threshold.DjX0wlsa.js","./value.CgPGBV_l.js","./timer.CAwTRJ_g.js","./index.C29vTftb.js","./useBasicWidgetState.6R32QW2v.js","./index.DW_MHI2K.js","../css/index.DzuxGC_t.css","./index.InwDjRN5.js","./index.Df3vkO_v.js","./index.DxvQWdtj.js","./index.CUFUpykP.js","./Hooks.CW1Ujj-E.js","./index.BtBNIxWC.js","./index.BFFhpOhV.js","./index.C_SUbLL7.js","./UploadFileInfo.C-jY39rj.js","./ProgressBar.CSZV-k_M.js","./index.RDHMaPCV.js","./FileHelper.LHDgAkEu.js","./InputInstructions.CHpHVupe.js","./inputUtils.CQWz5UKz.js","./textarea.DQh9RYKV.js","./base-input.BBFJwxWO.js","./index.G1PSqufB.js","./index.DEz7mrAp.js","./index.C9kvqGu0.js","./timepicker.Br_cR0hi.js","./input.QeLiGsyn.js","./index.Bhf5i-o4.js","./index.DPZJrrNj.js","./index.C3FZ8TOb.js","./index.BcIDRdbw.js","./index.DymllY6d.js","./index.jj20zRA4.js","./index.C41AtD-D.js","./uniqueId.BdUnRe3-.js","./useOnInputChange.C4OiWI1_.js","./index.CgZ_3VRU.js","./index.LypQPPkP.js","./index.CUWXxL_C.js"])))=>i.map(i=>d[i]);
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index.Bgn4z-Mp.js","./RenderInPortalIfExists.DPgp77ia.js","./index.BkyYp5Em.js","./index.DjTdTgti.js","./FormClearHelper.B4WYSqDL.js","./withFullScreenWrapper.BCTIo1o2.js","./Toolbar.9G2Er6_r.js","./checkbox.DT5JbCKx.js","./mergeWith.Di9Yv3PE.js","./sprintf.D7DtBTRn.js","./createDownloadLinkElement.DZMwyjvU.js","./toConsumableArray.D4OFzlWy.js","./possibleConstructorReturn.DqqPe-iu.js","./createSuper.9dngDO4F.js","./FileDownload.esm.BlYgQAwd.js","../css/index.Bmkmz40k.css","./index.DV46EgCO.js","./threshold.DjX0wlsa.js","./value.CgPGBV_l.js","./timer.CAwTRJ_g.js","./index.qC8qMz0q.js","./useBasicWidgetState.Btr3rzhN.js","./index.DW_MHI2K.js","../css/index.DzuxGC_t.css","./index.CMvo7Iwl.js","./index.BNc20KTN.js","./index.D9bqDCB_.js","./index.CrNuA-BG.js","./Hooks.BoeFlDaA.js","./index.B5-iXfzx.js","./index.DTP3exjF.js","./index.D-9nQW74.js","./UploadFileInfo.C-jY39rj.js","./ProgressBar.B-iCNc1a.js","./index.DyyHt_xV.js","./FileHelper.Da-FUCX4.js","./InputInstructions.DiPa6u6x.js","./inputUtils.CQWz5UKz.js","./textarea.DUN7d2zN.js","./base-input.z22leTiB.js","./index.CAC6FyHh.js","./index.D5wciRNz.js","./index.exPoJHIW.js","./timepicker.BkmEJ-b8.js","./input.mCBQrtCY.js","./index.Hnms5TSS.js","./index.T5vKsEVA.js","./index.C5bx6jEW.js","./index.CBoIJv6M.js","./index.bDDanN90.js","./index.BiPYzGZi.js","./index.BdtKHTgl.js","./uniqueId.6OlKTkzK.js","./useOnInputChange.BM7LVpC-.js","./index.DMreumKF.js","./index.BxYliQ9c.js","./index.DC6PJYZU.js"])))=>i.map(i=>d[i]);
2
2
  var qp=Object.defineProperty;var Uc=ye=>{throw TypeError(ye)};var Pp=(ye,$,e)=>$ in ye?qp(ye,$,{enumerable:!0,configurable:!0,writable:!0,value:e}):ye[$]=e;var Aa=(ye,$,e)=>Pp(ye,typeof $!="symbol"?$+"":$,e),gs=(ye,$,e)=>$.has(ye)||Uc("Cannot "+e);var Cr=(ye,$,e)=>(gs(ye,$,"read from private field"),e?e.call(ye):$.get(ye)),vi=(ye,$,e)=>$.has(ye)?Uc("Cannot add the same private member more than once"):$ instanceof WeakSet?$.add(ye):$.set(ye,e),gi=(ye,$,e,Y)=>(gs(ye,$,"write to private field"),Y?Y.call(ye,e):$.set(ye,e),e),Hr=(ye,$,e)=>(gs(ye,$,"access private method"),e);function _mergeNamespaces(ye,$){for(var e=0;e<$.length;e++){const Y=$[e];if(typeof Y!="string"&&!Array.isArray(Y)){for(const Me in Y)if(Me!=="default"&&!(Me in ye)){const Ae=Object.getOwnPropertyDescriptor(Y,Me);Ae&&Object.defineProperty(ye,Me,Ae.get?Ae:{enumerable:!0,get:()=>Y[Me]})}}}return Object.freeze(Object.defineProperty(ye,Symbol.toStringTag,{value:"Module"}))}(function(){const $=document.createElement("link").relList;if($&&$.supports&&$.supports("modulepreload"))return;for(const Me of document.querySelectorAll('link[rel="modulepreload"]'))Y(Me);new MutationObserver(Me=>{for(const Ae of Me)if(Ae.type==="childList")for(const Se of Ae.addedNodes)Se.tagName==="LINK"&&Se.rel==="modulepreload"&&Y(Se)}).observe(document,{childList:!0,subtree:!0});function e(Me){const Ae={};return Me.integrity&&(Ae.integrity=Me.integrity),Me.referrerPolicy&&(Ae.referrerPolicy=Me.referrerPolicy),Me.crossOrigin==="use-credentials"?Ae.credentials="include":Me.crossOrigin==="anonymous"?Ae.credentials="omit":Ae.credentials="same-origin",Ae}function Y(Me){if(Me.ep)return;Me.ep=!0;const Ae=e(Me);fetch(Me.href,Ae)}})();var commonjsGlobal$2=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function getDefaultExportFromCjs$1(ye){return ye&&ye.__esModule&&Object.prototype.hasOwnProperty.call(ye,"default")?ye.default:ye}function getAugmentedNamespace(ye){if(ye.__esModule)return ye;var $=ye.default;if(typeof $=="function"){var e=function Y(){return this instanceof Y?Reflect.construct($,arguments,this.constructor):$.apply(this,arguments)};e.prototype=$.prototype}else e={};return Object.defineProperty(e,"__esModule",{value:!0}),Object.keys(ye).forEach(function(Y){var Me=Object.getOwnPropertyDescriptor(ye,Y);Object.defineProperty(e,Y,Me.get?Me:{enumerable:!0,get:function(){return ye[Y]}})}),e}var jsxRuntime={exports:{}},reactJsxRuntime_production_min={},react={exports:{}},react_production_min={};/**
3
3
  * @license React
4
4
  * react.production.min.js
@@ -691,7 +691,7 @@ If this is an installed component that works locally, the app may be having trou
691
691
 
692
692
  For more troubleshooting help, please see the [Streamlit Component docs](${COMPONENT_DEVELOPER_URL}) or visit our [forums](${COMMUNITY_URL}).`,e}function tryParseArgs(ye,$,e,Y){if(!Y)try{return parseArgs(ye,$)}catch(Me){const Ae=ensureError(Me);e(Ae)}return[{},[]]}function compareDataframeArgs(ye,$){return ye===$||ye.length===$.length&&ye.every((e,Y)=>{const Me=$[Y];return e.key===Me.key&&e.value===Me.value})}function ComponentInstance(ye){const $=useTheme(),[e,Y]=reactExports.useState(),{disabled:Me,element:Ae,registry:Se,widgetMgr:ve,width:ze,fragmentId:Te}=ye,{componentName:we,jsonArgs:De,specialArgs:Ie,url:Ce}=Ae,[Ne,$e]=tryParseArgs(De,Ie,Y,e),Le=reactExports.useRef({args:{},dataframeArgs:[]}),Fe=compareDataframeArgs(Le.current.dataframeArgs,$e);Le.current.args=Ne,Le.current.dataframeArgs=$e;const[We,je]=reactExports.useState(),[Ue,Ge]=reactExports.useState(isNaN(Ne.height)?void 0:Ne.height),He=reactExports.useRef(!1),Xe=reactExports.useRef(null),st=reactExports.useRef(),Ke=useTimeout(()=>LOG$8.warn(getWarnMessage(we,Ce)),COMPONENT_READY_WARNING_TIME_MS/4),Je=useTimeout(()=>je(!0),COMPONENT_READY_WARNING_TIME_MS);if(reactExports.useEffect(()=>{He.current&&sendRenderMessage(Le.current.args,Le.current.dataframeArgs,Me,$,Xe.current??void 0)},[Me,Ue,Fe,De,$,ze]),reactExports.useEffect(()=>{const ft=bt=>{if(bt===void 0){LOG$8.warn("handleSetFrameHeight: missing 'height' prop");return}if(bt!==Ue){if(m$3(Xe.current)){LOG$8.warn("handleSetFrameHeight: missing our iframeRef!");return}Xe.current.height=bt.toString(),Ge(bt)}},At=()=>{sendRenderMessage(Le.current.args,Le.current.dataframeArgs,Me,$,Xe.current??void 0),Ke(),Je(),He.current=!0,je(!1)};st.current={isReady:()=>He.current,element:Ae,widgetMgr:ve,setComponentError:Y,componentReadyCallback:At,frameHeightCallback:ft,fragmentId:Te}},[we,Me,Ae,Ue,Fe,We,De,$,ve,Je,Ke,Te]),reactExports.useEffect(()=>{var At;const ft=((At=Xe.current)==null?void 0:At.contentWindow)??void 0;if(ft)return Se.registerListener(ft,createIframeMessageHandler(st)),()=>{ft&&Se.deregisterListener(ft)}},[Se,we]),e)return jsx$1(ErrorElement,{name:e.name,message:e.message});const rt=!He.current&&!We&&Ue!==0&&jsx$1(Skeleton,{element:Skeleton$1.create({height:Ue,style:Skeleton$1.SkeletonStyle.ELEMENT})}),ut=!He.current&&We?jsx$1(AlertElement$1,{body:getWarnMessage(we,Ce),kind:Kind.WARNING}):null;return jsxs(Fragment,{children:[rt,ut,jsx$1(StyledComponentIframe,{className:"stCustomComponentV1","data-testid":"stCustomComponentV1",allow:DEFAULT_IFRAME_FEATURE_POLICY,ref:Xe,src:getSrc(we,Se,Ce),width:ze,height:Ue??0,scrolling:"no",sandbox:DEFAULT_IFRAME_SANDBOX_POLICY,title:we,componentReady:He.current})]})}const ComponentInstance$1=withCalculatedWidth(reactExports.memo(ComponentInstance)),LOG$7=loglevelExports$1.getLogger("ComponentRegistry");class ComponentRegistry{constructor($){this.msgListeners=new Map,this.registerListener=(e,Y)=>{this.msgListeners.has(e)&&LOG$7.warn("MessageEventSource registered multiple times!",e),this.msgListeners.set(e,Y)},this.deregisterListener=e=>{this.msgListeners.delete(e)||LOG$7.warn("Could not deregister unregistered MessageEventSource!")},this.getComponentURL=(e,Y)=>this.endpoints.buildComponentURL(e,Y),this.onMessageEvent=e=>{if(m$3(e.data)||!e.data.hasOwnProperty("isStreamlitMessage"))return;if(m$3(e.source)){LOG$7.warn("Received component message with no eventSource!",e.data);return}const Y=this.msgListeners.get(e.source);if(m$3(Y)||typeof Y!="function"){LOG$7.warn("Received component message for unregistered ComponentInstance!",e.data);return}const{type:Me}=e.data;if(m$3(Me)){LOG$7.warn("Received Streamlit message with no type!",e.data);return}Y(Me,e.data)},this.endpoints=$,window.addEventListener("message",this.onMessageEvent)}}const Maybe=reactExports.memo(function ye({children:$}){return jsx$1(Fragment,{children:$})},(ye,$)=>!(ye.enable||$.enable));function makeMarkdownHeading(ye,$){switch(ye.toLowerCase()){case Tags.H1:return`# ${$}`;case Tags.H2:return`## ${$}`;case Tags.H3:return`### ${$}`;default:throw new Error(`Unrecognized tag for header: ${ye}`)}}function Heading(ye){const{element:$}=ye,{tag:e,anchor:Y,body:Me,help:Ae,hideAnchor:Se,divider:ve}=$,ze=React.useContext(IsSidebarContext),Te=React.useContext(IsDialogContext),[we,...De]=Me.split(`
693
693
  `);return jsxs("div",{className:"stHeading","data-testid":"stHeading",children:[jsxs(StyledStreamlitMarkdown,{isCaption:!1,isInSidebarOrDialog:ze||Te,"data-testid":"stMarkdownContainer",children:[jsx$1(HeadingWithActionElements,{anchor:Y,help:Ae,hideAnchor:Se,tag:e,children:jsx$1(RenderedMarkdown,{allowHTML:!1,source:makeMarkdownHeading(e,we),overrideComponents:{p:reactExports.Fragment,h1:reactExports.Fragment,h2:reactExports.Fragment,h3:reactExports.Fragment,h4:reactExports.Fragment,h5:reactExports.Fragment,h6:reactExports.Fragment}})}),De.length>0&&jsx$1(RenderedMarkdown,{source:De.join(`
694
- `),allowHTML:!1})]}),ve&&jsx$1(StyledHeaderDivider,{"data-testid":"stHeadingDivider",rainbow:ve.includes("linear"),color:ve})]})}const StyledCheckbox$1=newStyled("div",{target:"eg2gxky0"})(({theme:ye})=>({display:"flex",alignItems:"center",minHeight:ye.sizes.smallElementHeight})),StyledContent=newStyled("div",{target:"eg2gxky1"})(({visibility:ye})=>({display:ye===LabelVisibilityOptions.Collapsed?"none":"flex",visibility:ye===LabelVisibilityOptions.Hidden?"hidden":"visible",verticalAlign:"middle",flexDirection:"row",alignItems:"center"}));function translateGapWidth(ye,$){let e=$.spacing.lg;return ye==="medium"?e=$.spacing.threeXL:ye==="large"&&(e=$.spacing.fourXL),e}const StyledHorizontalBlock=newStyled("div",{target:"eu6p4el0"})(({theme:ye,gap:$})=>({display:"flex",flexWrap:"wrap",flexGrow:1,alignItems:"stretch",gap:translateGapWidth($,ye)})),GLOBAL_ELEMENTS=["balloons","snow"],StyledElementContainer=newStyled("div",{target:"eu6p4el1"})(({theme:ye,isStale:$,width:e,elementType:Y})=>({width:e,position:"relative","@media print":{overflow:"visible"},":is(.stHtml-empty)":{display:"none"},":has(> .stCacheSpinner)":{height:ye.spacing.none,overflow:"visible",visibility:"visible",marginBottom:`-${ye.spacing.lg}`,zIndex:ye.zIndices.cacheSpinner},":has(> .stPageLink)":{marginTop:`-${ye.spacing.xs}`,marginBottom:`-${ye.spacing.xs}`},...$&&Y!=="skeleton"&&STALE_STYLES,...Y==="empty"?{display:"none"}:{},...GLOBAL_ELEMENTS.includes(Y)?{marginBottom:`-${ye.spacing.lg}`}:{}})),StyledColumn=newStyled("div",{target:"eu6p4el2"})(({theme:ye,weight:$,gap:e,showBorder:Y,verticalAlignment:Me})=>{const{VerticalAlignment:Ae}=Block$2.Column,Se=$*100,ve=translateGapWidth(e,ye),ze=`calc(${Se}% - ${ve})`;return{width:ze,flex:`1 1 ${ze}`,[`@media (max-width: ${ye.breakpoints.columns})`]:{minWidth:`calc(100% - ${ye.spacing.twoXL})`},...Me===Ae.BOTTOM&&{marginTop:"auto",[`& ${StyledElementContainer}:last-of-type > ${StyledCheckbox$1}`]:{marginBottom:ye.spacing.sm}},...Me===Ae.TOP&&{[`& ${StyledElementContainer}:first-of-type > ${StyledCheckbox$1}`]:{marginTop:ye.spacing.sm}},...Me===Ae.CENTER&&{marginTop:"auto",marginBottom:"auto"},...Y&&{border:`${ye.sizes.borderWidth} solid ${ye.colors.borderColor}`,borderRadius:ye.radii.default,padding:`calc(${ye.spacing.lg} - ${ye.sizes.borderWidth})`}}}),StyledVerticalBlock=newStyled("div",{target:"eu6p4el3"})(({width:ye,maxWidth:$,theme:e})=>({width:ye,maxWidth:$,position:"relative",display:"flex",flex:1,flexDirection:"column",gap:e.spacing.lg})),StyledVerticalBlockWrapper=newStyled("div",{target:"eu6p4el4"})({display:"flex",flexDirection:"column",flex:1}),StyledVerticalBlockBorderWrapper=newStyled("div",{target:"eu6p4el5"})(({theme:ye,border:$,height:e})=>({...$&&{border:`${ye.sizes.borderWidth} solid ${ye.colors.borderColor}`,borderRadius:ye.radii.default,padding:`calc(${ye.spacing.lg} - ${ye.sizes.borderWidth})`},...e&&{height:`${e}px`,overflow:"auto"}})),StyledElementContainerLayoutWrapper=({width:ye,node:$,...e})=>{var Me;const Y=useLayoutStyles({width:ye,element:((Me=$.element)==null?void 0:Me.type)&&$.element[$.element.type]||void 0});return jsx$1(StyledElementContainer,{...e,...Y})},Audio=React.lazy(()=>__vitePreload(()=>import("./index.D1sfL1bE.js"),[],import.meta.url)),Balloons=React.lazy(()=>__vitePreload(()=>import("./index.LmMDdxLh.js"),__vite__mapDeps([0,1]),import.meta.url)),Snow=React.lazy(()=>__vitePreload(()=>import("./index.D2PC_wwi.js"),__vite__mapDeps([2,1]),import.meta.url)),ArrowDataFrame=React.lazy(()=>__vitePreload(()=>import("./index.CdiPATR3.js").then(ye=>ye.c),__vite__mapDeps([3,4,5,6,7,8,9,10,11,12,13,14]),import.meta.url)),ArrowVegaLiteChart=React.lazy(()=>__vitePreload(()=>import("./index.D8mp5ppE.js"),__vite__mapDeps([15,6,5,7,16,17,18,4]),import.meta.url)),Toast=React.lazy(()=>__vitePreload(()=>import("./index.I2Ij_yHL.js"),[],import.meta.url)),BokehChart=React.lazy(()=>__vitePreload(()=>import("./index.Bv1JbhEf.js"),[],import.meta.url)),DebouncedBokehChart=withCalculatedWidth(debounceRender(BokehChart,100)),DeckGlJsonChart=React.lazy(()=>__vitePreload(()=>import("./index.C29vTftb.js"),__vite__mapDeps([19,10,11,6,5,20,4,16,17,21,22]),import.meta.url)),GraphVizChart=React.lazy(()=>__vitePreload(()=>import("./index.InwDjRN5.js"),__vite__mapDeps([23,18,17,6,5]),import.meta.url)),IFrame=React.lazy(()=>__vitePreload(()=>import("./index.B5Q1lb1E.js"),[],import.meta.url)),ImageList=React.lazy(()=>__vitePreload(()=>import("./index.Df3vkO_v.js"),__vite__mapDeps([24,5,6]),import.meta.url)),LinkButton=React.lazy(()=>__vitePreload(()=>import("./index.Con6tiNg.js"),[],import.meta.url)),PageLink=React.lazy(()=>__vitePreload(()=>import("./index.DuUcgXrv.js"),[],import.meta.url)),PlotlyChart=React.lazy(()=>__vitePreload(()=>import("./index.DxvQWdtj.js"),__vite__mapDeps([25,4,5]),import.meta.url)),Video=React.lazy(()=>__vitePreload(()=>import("./index.CjN5S59O.js"),[],import.meta.url)),AudioInput=React.lazy(()=>__vitePreload(()=>import("./index.CUFUpykP.js"),__vite__mapDeps([26,4,6,27,9,13]),import.meta.url)),Button=React.lazy(()=>__vitePreload(()=>import("./index.CUepHEom.js"),[],import.meta.url)),ButtonGroup=React.lazy(()=>__vitePreload(()=>import("./index.BtBNIxWC.js"),__vite__mapDeps([28,20,4]),import.meta.url)),DownloadButton=React.lazy(()=>__vitePreload(()=>import("./index.BFFhpOhV.js"),__vite__mapDeps([29,9]),import.meta.url)),CameraInput=React.lazy(()=>__vitePreload(()=>import("./index.C_SUbLL7.js"),__vite__mapDeps([30,21,4,31,32]),import.meta.url)),ChatInput=React.lazy(()=>__vitePreload(()=>import("./index.RDHMaPCV.js"),__vite__mapDeps([33,34,35,36,21,31,37,38]),import.meta.url)),Checkbox=React.lazy(()=>__vitePreload(()=>import("./index.G1PSqufB.js"),__vite__mapDeps([39,20,4]),import.meta.url)),ColorPicker=React.lazy(()=>__vitePreload(()=>import("./index.DEz7mrAp.js"),__vite__mapDeps([40,20,4]),import.meta.url)),DateInput=React.lazy(()=>__vitePreload(()=>import("./index.C9kvqGu0.js"),__vite__mapDeps([41,20,4,42,11,12,43,38]),import.meta.url)),Html=React.lazy(()=>__vitePreload(()=>import("./index.CIDueoC2.js"),[],import.meta.url)),Multiselect=React.lazy(()=>__vitePreload(()=>import("./index.Bhf5i-o4.js"),__vite__mapDeps([44,20,4]),import.meta.url)),Progress=React.lazy(()=>__vitePreload(()=>import("./index.DPZJrrNj.js"),__vite__mapDeps([45,32]),import.meta.url)),Spinner=React.lazy(()=>__vitePreload(()=>import("./index.8pg9ijwI.js"),[],import.meta.url)),Radio=React.lazy(()=>__vitePreload(()=>import("./index.C3FZ8TOb.js"),__vite__mapDeps([46,20,4]),import.meta.url)),Selectbox$1=React.lazy(()=>__vitePreload(()=>import("./index.BcIDRdbw.js"),__vite__mapDeps([47,20,4]),import.meta.url)),Slider$1=React.lazy(()=>__vitePreload(()=>import("./index.DymllY6d.js"),__vite__mapDeps([48,8,20,4]),import.meta.url)),FileUploader=React.lazy(()=>__vitePreload(()=>import("./index.jj20zRA4.js"),__vite__mapDeps([49,21,4,34,32,27,31]),import.meta.url)),TextArea=React.lazy(()=>__vitePreload(()=>import("./index.C41AtD-D.js"),__vite__mapDeps([50,51,52,36,35,20,4,37,38]),import.meta.url)),TextInput=React.lazy(()=>__vitePreload(()=>import("./index.CgZ_3VRU.js"),__vite__mapDeps([53,51,52,36,20,4,35,43,38]),import.meta.url)),TimeInput=React.lazy(()=>__vitePreload(()=>import("./index.LypQPPkP.js"),__vite__mapDeps([54,20,4,42,11,12]),import.meta.url)),NumberInput=React.lazy(()=>__vitePreload(()=>import("./index.CUWXxL_C.js"),__vite__mapDeps([55,8,51,4,35,43,38]),import.meta.url)),StreamlitSyntaxHighlighter=React.lazy(()=>__vitePreload(()=>Promise.resolve().then(()=>StreamlitSyntaxHighlighter$2),void 0,import.meta.url));function hideIfStale(ye,$){return ye?jsx$1(Fragment,{}):$}const RawElementNodeRenderer=ye=>{const{node:$}=ye;if(!$)throw new Error("ElementNode not found.");const e={disableFullscreenMode:ye.disableFullscreenMode},Y={...e,widgetMgr:ye.widgetMgr,disabled:ye.widgetsDisabled,fragmentId:$.fragmentId};switch($.element.type){case"alert":{const Ae=$.element.alert;return jsx$1(AlertElement$1,{icon:Ae.icon,body:Ae.body,kind:getAlertElementKind(Ae.format),...e})}case"arrowTable":return jsx$1(ArrowTable$1,{element:$.quiverElement,...e});case"audio":return jsx$1(Audio,{element:$.element.audio,endpoints:ye.endpoints,...e,elementMgr:ye.widgetMgr});case"balloons":return hideIfStale(ye.isStale,jsx$1(Balloons,{scriptRunId:ye.scriptRunId}));case"bokehChart":return jsx$1(DebouncedBokehChart,{element:$.element.bokehChart,...e});case"code":{const Ae=$.element.code;return jsx$1(StreamlitSyntaxHighlighter,{language:Ae.language,showLineNumbers:Ae.showLineNumbers,wrapLines:Ae.wrapLines,height:Ae.height,children:Ae.codeText})}case"deckGlJsonChart":return jsx$1(DeckGlJsonChart,{element:$.element.deckGlJsonChart,...Y});case"docString":return jsx$1(DocString$1,{element:$.element.docString,...e});case"empty":return jsx$1("div",{className:"stEmpty","data-testid":"stEmpty"});case"exception":return jsx$1(ExceptionElement$1,{element:$.element.exception,...e});case"graphvizChart":return jsx$1(GraphVizChart,{element:$.element.graphvizChart,...e});case"heading":return jsx$1(Heading,{element:$.element.heading,...e});case"iframe":return jsx$1(IFrame,{element:$.element.iframe,...e});case"imgs":return jsx$1(ImageList,{element:$.element.imgs,endpoints:ye.endpoints,...e});case"json":return jsx$1(Json$1,{element:$.element.json,...e});case"markdown":return jsx$1(Markdown$1,{element:$.element.markdown,...e});case"metric":return jsx$1(Metric$1,{element:$.element.metric});case"html":return jsx$1(Html,{element:$.element.html,...e});case"pageLink":{const Ae=$.element.pageLink,Se=Y.disabled||Ae.disabled;return jsx$1(PageLink,{element:Ae,disabled:Se,...e})}case"progress":return jsx$1(Progress,{element:$.element.progress,...e});case"skeleton":return jsx$1(Skeleton,{element:$.element.skeleton});case"snow":return hideIfStale(ye.isStale,jsx$1(Snow,{scriptRunId:ye.scriptRunId}));case"spinner":return jsx$1(Spinner,{element:$.element.spinner,...e});case"text":return jsx$1(TextElement$1,{element:$.element.text,...e});case"video":return jsx$1(Video,{element:$.element.video,endpoints:ye.endpoints,...e,elementMgr:ye.widgetMgr});case"toast":{const Ae=$.element.toast;return jsx$1(Toast,{body:Ae.body,icon:Ae.icon,...e},$.scriptRunId)}case"arrowDataFrame":{const Ae=$.element.arrowDataFrame;return Y.disabled=Y.disabled||Ae.disabled,jsx$1(ArrowDataFrame,{element:Ae,data:$.quiverElement,...Ae.id&&{key:Ae.id},...Y})}case"arrowVegaLiteChart":const Me=$.vegaLiteChartElement;return jsx$1(ArrowVegaLiteChart,{element:Me,...Y},Me.id||void 0);case"audioInput":{const Ae=$.element.audioInput;return Y.disabled=Y.disabled||Ae.disabled,jsx$1(AudioInput,{uploadClient:ye.uploadClient,element:Ae,...Y},Ae.id)}case"button":{const Ae=$.element.button;if(Y.disabled=Y.disabled||Ae.disabled,Ae.isFormSubmitter){const{formId:Se}=Ae,ve=ye.formsData.formsWithUploads.has(Se);return jsx$1(FormSubmitContent,{element:Ae,hasInProgressUpload:ve,...Y})}return jsx$1(Button,{element:Ae,...Y})}case"buttonGroup":{const Ae=$.element.buttonGroup;return Y.disabled=Y.disabled||Ae.disabled,jsx$1(ButtonGroup,{element:Ae,...Y},Ae.id)}case"downloadButton":{const Ae=$.element.downloadButton;return Y.disabled=Y.disabled||Ae.disabled,jsx$1(DownloadButton,{endpoints:ye.endpoints,element:Ae,...Y},Ae.id)}case"cameraInput":{const Ae=$.element.cameraInput;return Y.disabled=Y.disabled||Ae.disabled,jsx$1(CameraInput,{element:Ae,uploadClient:ye.uploadClient,...Y},Ae.id)}case"chatInput":{const Ae=$.element.chatInput;return Y.disabled=Y.disabled||Ae.disabled,jsx$1(ChatInput,{element:Ae,uploadClient:ye.uploadClient,...Y},Ae.id)}case"checkbox":{const Ae=$.element.checkbox;return Y.disabled=Y.disabled||Ae.disabled,jsx$1(Checkbox,{element:Ae,...Y},Ae.id)}case"colorPicker":{const Ae=$.element.colorPicker;return Y.disabled=Y.disabled||Ae.disabled,jsx$1(ColorPicker,{element:Ae,...Y},Ae.id)}case"componentInstance":return jsx$1(ComponentInstance$1,{registry:ye.componentRegistry,element:$.element.componentInstance,...Y});case"dateInput":{const Ae=$.element.dateInput;return Y.disabled=Y.disabled||Ae.disabled,jsx$1(DateInput,{element:Ae,...Y},Ae.id)}case"fileUploader":{const Ae=$.element.fileUploader;return Y.disabled=Y.disabled||Ae.disabled,jsx$1(FileUploader,{element:Ae,uploadClient:ye.uploadClient,...Y},Ae.id)}case"linkButton":{const Ae=$.element.linkButton;return Y.disabled=Y.disabled||Ae.disabled,jsx$1(LinkButton,{element:Ae,...Y})}case"multiselect":{const Ae=$.element.multiselect;return Y.disabled=Y.disabled||Ae.disabled,jsx$1(Multiselect,{element:Ae,...Y},Ae.id)}case"numberInput":{const Ae=$.element.numberInput;return Y.disabled=Y.disabled||Ae.disabled,jsx$1(NumberInput,{element:Ae,...Y},Ae.id)}case"plotlyChart":{const Ae=$.element.plotlyChart;return jsx$1(PlotlyChart,{element:Ae,...Y},Ae.id)}case"radio":{const Ae=$.element.radio;return Y.disabled=Y.disabled||Ae.disabled,jsx$1(Radio,{element:Ae,...Y},Ae.id)}case"selectbox":{const Ae=$.element.selectbox;return Y.disabled=Y.disabled||Ae.disabled,jsx$1(Selectbox$1,{element:Ae,...Y},Ae.id)}case"slider":{const Ae=$.element.slider;return Y.disabled=Y.disabled||Ae.disabled,jsx$1(Slider$1,{element:Ae,...Y},Ae.id)}case"textArea":{const Ae=$.element.textArea;return Y.disabled=Y.disabled||Ae.disabled,jsx$1(TextArea,{element:Ae,...Y},Ae.id)}case"textInput":{const Ae=$.element.textInput;return Y.disabled=Y.disabled||Ae.disabled,jsx$1(TextInput,{element:Ae,...Y},Ae.id)}case"timeInput":{const Ae=$.element.timeInput;return Y.disabled=Y.disabled||Ae.disabled,jsx$1(TimeInput,{element:Ae,...Y},Ae.id)}default:throw new Error(`Unrecognized Element type ${$.element.type}`)}},ElementNodeRenderer=ye=>{const{isFullScreen:$,fragmentIdsThisRun:e}=React.useContext(LibContext),{node:Y,width:Me}=ye,Ae=Y.element.type||"",Se=shouldComponentBeEnabled(Ae,ye.scriptRunState),ve=isComponentStale(Se,Y,ye.scriptRunState,ye.scriptRunId,e),ze=getElementId(Y.element),Te=getKeyFromId(ze);return jsx$1(Maybe,{enable:Se,children:jsx$1(StyledElementContainerLayoutWrapper,{className:classNames("stElementContainer","element-container",convertKeyToClassName(Te)),"data-testid":"stElementContainer","data-stale":ve,isStale:ve&&!$,width:Me,elementType:Ae,node:Y,children:jsx$1(ErrorBoundary,{children:jsx$1(reactExports.Suspense,{fallback:jsx$1(Skeleton,{element:Skeleton$1.create({style:Skeleton$1.SkeletonStyle.ELEMENT})}),children:jsx$1(RawElementNodeRenderer,{...ye,isStale:ve})})})})})},BlockNodeRenderer=ye=>{const{node:$}=ye,{fragmentIdsThisRun:e}=reactExports.useContext(LibContext);if($.isEmpty&&!$.deltaBlock.allowEmpty)return jsx$1(Fragment,{});const Y=shouldComponentBeEnabled("",ye.scriptRunState),Me=isComponentStale(Y,$,ye.scriptRunState,ye.scriptRunId,e),Ae={...ye,node:$},Se=ye.disableFullscreenMode||d$2($.deltaBlock.dialog)||d$2($.deltaBlock.popover),ve=jsx$1(LayoutBlock,{...Ae,disableFullscreenMode:Se});if($.deltaBlock.dialog)return jsx$1(Dialog$1,{element:$.deltaBlock.dialog,deltaMsgReceivedAt:$.deltaMsgReceivedAt,children:ve});if($.deltaBlock.expandable)return jsx$1(Expander$1,{empty:$.isEmpty,isStale:Me,element:$.deltaBlock.expandable,children:ve});if($.deltaBlock.popover)return jsx$1(Popover$1,{empty:$.isEmpty,element:$.deltaBlock.popover,children:ve});if($.deltaBlock.type==="form"){const{formId:ze,clearOnSubmit:Te,enterToSubmit:we,border:De}=$.deltaBlock.form,Ie=ye.formsData.submitButtons.get(ze),Ce=Ie!==void 0&&Ie.length>0;return jsx$1(Form$1,{formId:ze,clearOnSubmit:Te,enterToSubmit:we,hasSubmitButton:Ce,scriptRunState:ye.scriptRunState,widgetMgr:ye.widgetMgr,border:De,children:ve})}if($.deltaBlock.chatMessage)return jsx$1(ChatMessage$1,{element:$.deltaBlock.chatMessage,endpoints:ye.endpoints,children:ve});if($.deltaBlock.column)return jsx$1(StyledColumn,{weight:$.deltaBlock.column.weight??0,gap:$.deltaBlock.column.gap??"",verticalAlignment:$.deltaBlock.column.verticalAlignment??void 0,showBorder:$.deltaBlock.column.showBorder??!1,className:"stColumn","data-testid":"stColumn",children:ve});if($.deltaBlock.tabContainer){if(!Ae.width)return jsx$1("div",{});const Te={...Ae,isStale:Me,renderTabContent:we=>jsx$1(VerticalBlock,{...we})};return jsx$1(Tabs$1,{...Te})}return ve},ChildRenderer=ye=>{const{libConfig:$}=reactExports.useContext(LibContext);assignDividerColor(ye.node,useTheme());const e=new Set;return jsx$1(Fragment,{children:ye.node.children&&ye.node.children.map((Y,Me)=>{const Ae=$.disableFullscreenMode||ye.disableFullscreenMode;if(Y instanceof ElementNode){const Se={...ye,disableFullscreenMode:Ae,node:Y},ve=getElementId(Y.element)||Me.toString();return e.has(ve)?null:(e.add(ve),jsx$1(ElementNodeRenderer,{...Se},ve))}if(Y instanceof BlockNode){const Se={...ye,disableFullscreenMode:Ae,node:Y};return jsx$1(BlockNodeRenderer,{...Se},Me)}throw new Error(`Unrecognized AppNode: ${Y}`)})})};function ScrollToBottomVerticalBlockWrapper(ye){const{border:$,height:e,children:Y}=ye,Me=useScrollToBottom();return jsx$1(StyledVerticalBlockBorderWrapper,{border:$,height:e,"data-testid":"stVerticalBlockBorderWrapper","data-test-scroll-behavior":"scroll-to-bottom",ref:Me,children:Y})}const VerticalBlock=ye=>{var De,Ie;const{values:[$],elementRef:e,forceRecalculate:Y}=useResizeObserver(reactExports.useMemo(()=>["width"],[])),Me=((De=ye.node.deltaBlock.vertical)==null?void 0:De.border)??!1,Ae=((Ie=ye.node.deltaBlock.vertical)==null?void 0:Ie.height)||void 0,Se=Ae&&ye.node.children.some(Ce=>Ce instanceof BlockNode&&Ce.deltaBlock.type==="chatMessage");reactExports.useEffect(()=>{Y()},[Y,Se]);const ve=Se?ScrollToBottomVerticalBlockWrapper:StyledVerticalBlockBorderWrapper,ze=getKeyFromId(ye.node.deltaBlock.id),Te=useLayoutStyles({width:$,element:void 0}),we={...ye,width:Te.width};return jsx$1(ve,{border:Me,height:Ae,"data-testid":"stVerticalBlockBorderWrapper","data-test-scroll-behavior":"normal",children:jsx$1(StyledVerticalBlockWrapper,{ref:e,children:jsx$1(StyledVerticalBlock,{className:classNames("stVerticalBlock",convertKeyToClassName(ze)),"data-testid":"stVerticalBlock",...Te,children:jsx$1(ChildRenderer,{...we})})})})},HorizontalBlock=ye=>{var e;const $=((e=ye.node.deltaBlock.horizontal)==null?void 0:e.gap)??"";return jsx$1(StyledHorizontalBlock,{gap:$,className:"stHorizontalBlock","data-testid":"stHorizontalBlock",children:jsx$1(ChildRenderer,{...ye})})};function LayoutBlock(ye){return ye.node.deltaBlock.horizontal?jsx$1(HorizontalBlock,{...ye}):jsx$1(VerticalBlock,{...ye})}const StyledDataFrameOverlay=newStyled("div",{target:"e19n7mk11"})(({theme:ye})=>({position:"fixed",top:0,left:0,zIndex:ye.zIndices.tablePortal,lineHeight:"100%"})),PortalContext=React.createContext(null),PortalProvider=({children:ye})=>{const $=reactExports.useRef(null),e=reactExports.useCallback(()=>$.current,[]);return jsxs(PortalContext.Provider,{value:e,children:[ye,jsx$1(StyledDataFrameOverlay,{"data-testid":"portal",id:"portal",ref:$})]})};function ThemeProvider({theme:ye,baseuiTheme:$,children:e}){return jsx$1(ThemeProvider$1,{theme:$||baseuiLightTheme,children:jsx$1(ThemeProvider$2,{theme:ye,children:e})})}function toCodePoint(ye,$){const e=[];let Y=0,Me=0,Ae=0;for(;Ae<ye.length;)Y=ye.charCodeAt(Ae++),Me?(e.push((65536+(Me-55296<<10)+(Y-56320)).toString(16)),Me=0):55296<=Y&&Y<=56319?Me=Y:e.push(Y.toString(16));return e.join("-")}const UFE0Fg=/\uFE0F/g,U200D="‍";function grabTheRightIcon(ye){return toCodePoint(ye.indexOf(U200D)<0?ye.replace(UFE0Fg,""):ye)}function iconToUrl(ye){const $=/^:(.+)\/(.+):$/,e=ye.match($);return e===null?"":`https://fonts.gstatic.com/s/i/short-term/release/materialsymbolsrounded/${e[2]}/default/24px.svg`}function handleFavicon(ye,$,e){const Y=extractEmoji(ye);let Me;Y&&!ye.startsWith(":material")?Me=`https://cdn.jsdelivr.net/gh/twitter/twemoji@14.0.2/assets/72x72/${grabTheRightIcon(Y)}.png`:ye.startsWith(":material")?Me=iconToUrl(ye):Me=e.buildMediaURL(ye),overwriteFavicon(Me),$({type:"SET_PAGE_FAVICON",favicon:Me})}function overwriteFavicon(ye){const $=document.querySelector("link[rel='shortcut icon']");$&&($.href=ye)}function extractEmoji(ye){const $=ye.replace("-","_");return nodeEmoji.hasEmoji(nodeEmoji.get($))?nodeEmoji.get($):nodeEmoji.hasEmoji(ye)?ye:""}var lib$2={},flattenNames={},_baseForOwn,hasRequired_baseForOwn;function require_baseForOwn(){if(hasRequired_baseForOwn)return _baseForOwn;hasRequired_baseForOwn=1;var ye=require_baseFor(),$=requireKeys();function e(Y,Me){return Y&&ye(Y,Me,$)}return _baseForOwn=e,_baseForOwn}var _castFunction,hasRequired_castFunction;function require_castFunction(){if(hasRequired_castFunction)return _castFunction;hasRequired_castFunction=1;var ye=requireIdentity();function $(e){return typeof e=="function"?e:ye}return _castFunction=$,_castFunction}var forOwn_1,hasRequiredForOwn;function requireForOwn(){if(hasRequiredForOwn)return forOwn_1;hasRequiredForOwn=1;var ye=require_baseForOwn(),$=require_castFunction();function e(Y,Me){return Y&&ye(Y,$(Me))}return forOwn_1=e,forOwn_1}var _setCacheAdd,hasRequired_setCacheAdd;function require_setCacheAdd(){if(hasRequired_setCacheAdd)return _setCacheAdd;hasRequired_setCacheAdd=1;var ye="__lodash_hash_undefined__";function $(e){return this.__data__.set(e,ye),this}return _setCacheAdd=$,_setCacheAdd}var _setCacheHas,hasRequired_setCacheHas;function require_setCacheHas(){if(hasRequired_setCacheHas)return _setCacheHas;hasRequired_setCacheHas=1;function ye($){return this.__data__.has($)}return _setCacheHas=ye,_setCacheHas}var _SetCache,hasRequired_SetCache;function require_SetCache(){if(hasRequired_SetCache)return _SetCache;hasRequired_SetCache=1;var ye=require_MapCache(),$=require_setCacheAdd(),e=require_setCacheHas();function Y(Me){var Ae=-1,Se=Me==null?0:Me.length;for(this.__data__=new ye;++Ae<Se;)this.add(Me[Ae])}return Y.prototype.add=Y.prototype.push=$,Y.prototype.has=e,_SetCache=Y,_SetCache}var _arraySome,hasRequired_arraySome;function require_arraySome(){if(hasRequired_arraySome)return _arraySome;hasRequired_arraySome=1;function ye($,e){for(var Y=-1,Me=$==null?0:$.length;++Y<Me;)if(e($[Y],Y,$))return!0;return!1}return _arraySome=ye,_arraySome}var _cacheHas,hasRequired_cacheHas;function require_cacheHas(){if(hasRequired_cacheHas)return _cacheHas;hasRequired_cacheHas=1;function ye($,e){return $.has(e)}return _cacheHas=ye,_cacheHas}var _equalArrays,hasRequired_equalArrays;function require_equalArrays(){if(hasRequired_equalArrays)return _equalArrays;hasRequired_equalArrays=1;var ye=require_SetCache(),$=require_arraySome(),e=require_cacheHas(),Y=1,Me=2;function Ae(Se,ve,ze,Te,we,De){var Ie=ze&Y,Ce=Se.length,Ne=ve.length;if(Ce!=Ne&&!(Ie&&Ne>Ce))return!1;var $e=De.get(Se),Le=De.get(ve);if($e&&Le)return $e==ve&&Le==Se;var Fe=-1,We=!0,je=ze&Me?new ye:void 0;for(De.set(Se,ve),De.set(ve,Se);++Fe<Ce;){var Ue=Se[Fe],Ge=ve[Fe];if(Te)var He=Ie?Te(Ge,Ue,Fe,ve,Se,De):Te(Ue,Ge,Fe,Se,ve,De);if(He!==void 0){if(He)continue;We=!1;break}if(je){if(!$(ve,function(Xe,st){if(!e(je,st)&&(Ue===Xe||we(Ue,Xe,ze,Te,De)))return je.push(st)})){We=!1;break}}else if(!(Ue===Ge||we(Ue,Ge,ze,Te,De))){We=!1;break}}return De.delete(Se),De.delete(ve),We}return _equalArrays=Ae,_equalArrays}var _equalByTag,hasRequired_equalByTag;function require_equalByTag(){if(hasRequired_equalByTag)return _equalByTag;hasRequired_equalByTag=1;var ye=require_Symbol(),$=require_Uint8Array(),e=requireEq(),Y=require_equalArrays(),Me=require_mapToArray(),Ae=require_setToArray(),Se=1,ve=2,ze="[object Boolean]",Te="[object Date]",we="[object Error]",De="[object Map]",Ie="[object Number]",Ce="[object RegExp]",Ne="[object Set]",$e="[object String]",Le="[object Symbol]",Fe="[object ArrayBuffer]",We="[object DataView]",je=ye?ye.prototype:void 0,Ue=je?je.valueOf:void 0;function Ge(He,Xe,st,Ke,Je,rt,ut){switch(st){case We:if(He.byteLength!=Xe.byteLength||He.byteOffset!=Xe.byteOffset)return!1;He=He.buffer,Xe=Xe.buffer;case Fe:return!(He.byteLength!=Xe.byteLength||!rt(new $(He),new $(Xe)));case ze:case Te:case Ie:return e(+He,+Xe);case we:return He.name==Xe.name&&He.message==Xe.message;case Ce:case $e:return He==Xe+"";case De:var ft=Me;case Ne:var At=Ke&Se;if(ft||(ft=Ae),He.size!=Xe.size&&!At)return!1;var bt=ut.get(He);if(bt)return bt==Xe;Ke|=ve,ut.set(He,Xe);var Ot=Y(ft(He),ft(Xe),Ke,Je,rt,ut);return ut.delete(He),Ot;case Le:if(Ue)return Ue.call(He)==Ue.call(Xe)}return!1}return _equalByTag=Ge,_equalByTag}var _equalObjects,hasRequired_equalObjects;function require_equalObjects(){if(hasRequired_equalObjects)return _equalObjects;hasRequired_equalObjects=1;var ye=require_getAllKeys(),$=1,e=Object.prototype,Y=e.hasOwnProperty;function Me(Ae,Se,ve,ze,Te,we){var De=ve&$,Ie=ye(Ae),Ce=Ie.length,Ne=ye(Se),$e=Ne.length;if(Ce!=$e&&!De)return!1;for(var Le=Ce;Le--;){var Fe=Ie[Le];if(!(De?Fe in Se:Y.call(Se,Fe)))return!1}var We=we.get(Ae),je=we.get(Se);if(We&&je)return We==Se&&je==Ae;var Ue=!0;we.set(Ae,Se),we.set(Se,Ae);for(var Ge=De;++Le<Ce;){Fe=Ie[Le];var He=Ae[Fe],Xe=Se[Fe];if(ze)var st=De?ze(Xe,He,Fe,Se,Ae,we):ze(He,Xe,Fe,Ae,Se,we);if(!(st===void 0?He===Xe||Te(He,Xe,ve,ze,we):st)){Ue=!1;break}Ge||(Ge=Fe=="constructor")}if(Ue&&!Ge){var Ke=Ae.constructor,Je=Se.constructor;Ke!=Je&&"constructor"in Ae&&"constructor"in Se&&!(typeof Ke=="function"&&Ke instanceof Ke&&typeof Je=="function"&&Je instanceof Je)&&(Ue=!1)}return we.delete(Ae),we.delete(Se),Ue}return _equalObjects=Me,_equalObjects}var _baseIsEqualDeep,hasRequired_baseIsEqualDeep;function require_baseIsEqualDeep(){if(hasRequired_baseIsEqualDeep)return _baseIsEqualDeep;hasRequired_baseIsEqualDeep=1;var ye=require_Stack(),$=require_equalArrays(),e=require_equalByTag(),Y=require_equalObjects(),Me=require_getTag(),Ae=requireIsArray(),Se=requireIsBuffer$1(),ve=requireIsTypedArray(),ze=1,Te="[object Arguments]",we="[object Array]",De="[object Object]",Ie=Object.prototype,Ce=Ie.hasOwnProperty;function Ne($e,Le,Fe,We,je,Ue){var Ge=Ae($e),He=Ae(Le),Xe=Ge?we:Me($e),st=He?we:Me(Le);Xe=Xe==Te?De:Xe,st=st==Te?De:st;var Ke=Xe==De,Je=st==De,rt=Xe==st;if(rt&&Se($e)){if(!Se(Le))return!1;Ge=!0,Ke=!1}if(rt&&!Ke)return Ue||(Ue=new ye),Ge||ve($e)?$($e,Le,Fe,We,je,Ue):e($e,Le,Xe,Fe,We,je,Ue);if(!(Fe&ze)){var ut=Ke&&Ce.call($e,"__wrapped__"),ft=Je&&Ce.call(Le,"__wrapped__");if(ut||ft){var At=ut?$e.value():$e,bt=ft?Le.value():Le;return Ue||(Ue=new ye),je(At,bt,Fe,We,Ue)}}return rt?(Ue||(Ue=new ye),Y($e,Le,Fe,We,je,Ue)):!1}return _baseIsEqualDeep=Ne,_baseIsEqualDeep}var _baseIsEqual,hasRequired_baseIsEqual;function require_baseIsEqual(){if(hasRequired_baseIsEqual)return _baseIsEqual;hasRequired_baseIsEqual=1;var ye=require_baseIsEqualDeep(),$=requireIsObjectLike();function e(Y,Me,Ae,Se,ve){return Y===Me?!0:Y==null||Me==null||!$(Y)&&!$(Me)?Y!==Y&&Me!==Me:ye(Y,Me,Ae,Se,e,ve)}return _baseIsEqual=e,_baseIsEqual}var _baseIsMatch,hasRequired_baseIsMatch;function require_baseIsMatch(){if(hasRequired_baseIsMatch)return _baseIsMatch;hasRequired_baseIsMatch=1;var ye=require_Stack(),$=require_baseIsEqual(),e=1,Y=2;function Me(Ae,Se,ve,ze){var Te=ve.length,we=Te,De=!ze;if(Ae==null)return!we;for(Ae=Object(Ae);Te--;){var Ie=ve[Te];if(De&&Ie[2]?Ie[1]!==Ae[Ie[0]]:!(Ie[0]in Ae))return!1}for(;++Te<we;){Ie=ve[Te];var Ce=Ie[0],Ne=Ae[Ce],$e=Ie[1];if(De&&Ie[2]){if(Ne===void 0&&!(Ce in Ae))return!1}else{var Le=new ye;if(ze)var Fe=ze(Ne,$e,Ce,Ae,Se,Le);if(!(Fe===void 0?$($e,Ne,e|Y,ze,Le):Fe))return!1}}return!0}return _baseIsMatch=Me,_baseIsMatch}var _isStrictComparable,hasRequired_isStrictComparable;function require_isStrictComparable(){if(hasRequired_isStrictComparable)return _isStrictComparable;hasRequired_isStrictComparable=1;var ye=requireIsObject();function $(e){return e===e&&!ye(e)}return _isStrictComparable=$,_isStrictComparable}var _getMatchData,hasRequired_getMatchData;function require_getMatchData(){if(hasRequired_getMatchData)return _getMatchData;hasRequired_getMatchData=1;var ye=require_isStrictComparable(),$=requireKeys();function e(Y){for(var Me=$(Y),Ae=Me.length;Ae--;){var Se=Me[Ae],ve=Y[Se];Me[Ae]=[Se,ve,ye(ve)]}return Me}return _getMatchData=e,_getMatchData}var _matchesStrictComparable,hasRequired_matchesStrictComparable;function require_matchesStrictComparable(){if(hasRequired_matchesStrictComparable)return _matchesStrictComparable;hasRequired_matchesStrictComparable=1;function ye($,e){return function(Y){return Y==null?!1:Y[$]===e&&(e!==void 0||$ in Object(Y))}}return _matchesStrictComparable=ye,_matchesStrictComparable}var _baseMatches,hasRequired_baseMatches;function require_baseMatches(){if(hasRequired_baseMatches)return _baseMatches;hasRequired_baseMatches=1;var ye=require_baseIsMatch(),$=require_getMatchData(),e=require_matchesStrictComparable();function Y(Me){var Ae=$(Me);return Ae.length==1&&Ae[0][2]?e(Ae[0][0],Ae[0][1]):function(Se){return Se===Me||ye(Se,Me,Ae)}}return _baseMatches=Y,_baseMatches}var _baseHasIn,hasRequired_baseHasIn;function require_baseHasIn(){if(hasRequired_baseHasIn)return _baseHasIn;hasRequired_baseHasIn=1;function ye($,e){return $!=null&&e in Object($)}return _baseHasIn=ye,_baseHasIn}var _hasPath,hasRequired_hasPath;function require_hasPath(){if(hasRequired_hasPath)return _hasPath;hasRequired_hasPath=1;var ye=require_castPath(),$=requireIsArguments(),e=requireIsArray(),Y=require_isIndex(),Me=requireIsLength(),Ae=require_toKey();function Se(ve,ze,Te){ze=ye(ze,ve);for(var we=-1,De=ze.length,Ie=!1;++we<De;){var Ce=Ae(ze[we]);if(!(Ie=ve!=null&&Te(ve,Ce)))break;ve=ve[Ce]}return Ie||++we!=De?Ie:(De=ve==null?0:ve.length,!!De&&Me(De)&&Y(Ce,De)&&(e(ve)||$(ve)))}return _hasPath=Se,_hasPath}var hasIn_1,hasRequiredHasIn;function requireHasIn(){if(hasRequiredHasIn)return hasIn_1;hasRequiredHasIn=1;var ye=require_baseHasIn(),$=require_hasPath();function e(Y,Me){return Y!=null&&$(Y,Me,ye)}return hasIn_1=e,hasIn_1}var _baseMatchesProperty,hasRequired_baseMatchesProperty;function require_baseMatchesProperty(){if(hasRequired_baseMatchesProperty)return _baseMatchesProperty;hasRequired_baseMatchesProperty=1;var ye=require_baseIsEqual(),$=requireGet(),e=requireHasIn(),Y=require_isKey(),Me=require_isStrictComparable(),Ae=require_matchesStrictComparable(),Se=require_toKey(),ve=1,ze=2;function Te(we,De){return Y(we)&&Me(De)?Ae(Se(we),De):function(Ie){var Ce=$(Ie,we);return Ce===void 0&&Ce===De?e(Ie,we):ye(De,Ce,ve|ze)}}return _baseMatchesProperty=Te,_baseMatchesProperty}var _basePropertyDeep,hasRequired_basePropertyDeep;function require_basePropertyDeep(){if(hasRequired_basePropertyDeep)return _basePropertyDeep;hasRequired_basePropertyDeep=1;var ye=require_baseGet();function $(e){return function(Y){return ye(Y,e)}}return _basePropertyDeep=$,_basePropertyDeep}var property_1,hasRequiredProperty;function requireProperty(){if(hasRequiredProperty)return property_1;hasRequiredProperty=1;var ye=require_baseProperty(),$=require_basePropertyDeep(),e=require_isKey(),Y=require_toKey();function Me(Ae){return e(Ae)?ye(Y(Ae)):$(Ae)}return property_1=Me,property_1}var _baseIteratee,hasRequired_baseIteratee;function require_baseIteratee(){if(hasRequired_baseIteratee)return _baseIteratee;hasRequired_baseIteratee=1;var ye=require_baseMatches(),$=require_baseMatchesProperty(),e=requireIdentity(),Y=requireIsArray(),Me=requireProperty();function Ae(Se){return typeof Se=="function"?Se:Se==null?e:typeof Se=="object"?Y(Se)?$(Se[0],Se[1]):ye(Se):Me(Se)}return _baseIteratee=Ae,_baseIteratee}var _createBaseEach,hasRequired_createBaseEach;function require_createBaseEach(){if(hasRequired_createBaseEach)return _createBaseEach;hasRequired_createBaseEach=1;var ye=requireIsArrayLike();function $(e,Y){return function(Me,Ae){if(Me==null)return Me;if(!ye(Me))return e(Me,Ae);for(var Se=Me.length,ve=Y?Se:-1,ze=Object(Me);(Y?ve--:++ve<Se)&&Ae(ze[ve],ve,ze)!==!1;);return Me}}return _createBaseEach=$,_createBaseEach}var _baseEach,hasRequired_baseEach;function require_baseEach(){if(hasRequired_baseEach)return _baseEach;hasRequired_baseEach=1;var ye=require_baseForOwn(),$=require_createBaseEach(),e=$(ye);return _baseEach=e,_baseEach}var _baseMap,hasRequired_baseMap;function require_baseMap(){if(hasRequired_baseMap)return _baseMap;hasRequired_baseMap=1;var ye=require_baseEach(),$=requireIsArrayLike();function e(Y,Me){var Ae=-1,Se=$(Y)?Array(Y.length):[];return ye(Y,function(ve,ze,Te){Se[++Ae]=Me(ve,ze,Te)}),Se}return _baseMap=e,_baseMap}var map_1,hasRequiredMap;function requireMap(){if(hasRequiredMap)return map_1;hasRequiredMap=1;var ye=require_arrayMap(),$=require_baseIteratee(),e=require_baseMap(),Y=requireIsArray();function Me(Ae,Se){var ve=Y(Ae)?ye:e;return ve(Ae,$(Se,3))}return map_1=Me,map_1}var hasRequiredFlattenNames;function requireFlattenNames(){if(hasRequiredFlattenNames)return flattenNames;hasRequiredFlattenNames=1,Object.defineProperty(flattenNames,"__esModule",{value:!0}),flattenNames.flattenNames=void 0;var ye=requireIsString(),$=ze(ye),e=requireForOwn(),Y=ze(e),Me=requireIsPlainObject(),Ae=ze(Me),Se=requireMap(),ve=ze(Se);function ze(we){return we&&we.__esModule?we:{default:we}}var Te=flattenNames.flattenNames=function we(){var De=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],Ie=[];return(0,ve.default)(De,function(Ce){Array.isArray(Ce)?we(Ce).map(function(Ne){return Ie.push(Ne)}):(0,Ae.default)(Ce)?(0,Y.default)(Ce,function(Ne,$e){Ne===!0&&Ie.push($e),Ie.push($e+"-"+Ne)}):(0,$.default)(Ce)&&Ie.push(Ce)}),Ie};return flattenNames.default=Te,flattenNames}var mergeClasses={},hasRequiredMergeClasses;function requireMergeClasses(){if(hasRequiredMergeClasses)return mergeClasses;hasRequiredMergeClasses=1,Object.defineProperty(mergeClasses,"__esModule",{value:!0}),mergeClasses.mergeClasses=void 0;var ye=requireForOwn(),$=Ae(ye),e=requireCloneDeep(),Y=Ae(e),Me=Object.assign||function(ve){for(var ze=1;ze<arguments.length;ze++){var Te=arguments[ze];for(var we in Te)Object.prototype.hasOwnProperty.call(Te,we)&&(ve[we]=Te[we])}return ve};function Ae(ve){return ve&&ve.__esModule?ve:{default:ve}}var Se=mergeClasses.mergeClasses=function(ze){var Te=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],we=ze.default&&(0,Y.default)(ze.default)||{};return Te.map(function(De){var Ie=ze[De];return Ie&&(0,$.default)(Ie,function(Ce,Ne){we[Ne]||(we[Ne]={}),we[Ne]=Me({},we[Ne],Ie[Ne])}),De}),we};return mergeClasses.default=Se,mergeClasses}var autoprefix={},hasRequiredAutoprefix;function requireAutoprefix(){if(hasRequiredAutoprefix)return autoprefix;hasRequiredAutoprefix=1,Object.defineProperty(autoprefix,"__esModule",{value:!0}),autoprefix.autoprefix=void 0;var ye=requireForOwn(),$=Y(ye),e=Object.assign||function(Se){for(var ve=1;ve<arguments.length;ve++){var ze=arguments[ve];for(var Te in ze)Object.prototype.hasOwnProperty.call(ze,Te)&&(Se[Te]=ze[Te])}return Se};function Y(Se){return Se&&Se.__esModule?Se:{default:Se}}var Me={borderRadius:function(ve){return{msBorderRadius:ve,MozBorderRadius:ve,OBorderRadius:ve,WebkitBorderRadius:ve,borderRadius:ve}},boxShadow:function(ve){return{msBoxShadow:ve,MozBoxShadow:ve,OBoxShadow:ve,WebkitBoxShadow:ve,boxShadow:ve}},userSelect:function(ve){return{WebkitTouchCallout:ve,KhtmlUserSelect:ve,MozUserSelect:ve,msUserSelect:ve,WebkitUserSelect:ve,userSelect:ve}},flex:function(ve){return{WebkitBoxFlex:ve,MozBoxFlex:ve,WebkitFlex:ve,msFlex:ve,flex:ve}},flexBasis:function(ve){return{WebkitFlexBasis:ve,flexBasis:ve}},justifyContent:function(ve){return{WebkitJustifyContent:ve,justifyContent:ve}},transition:function(ve){return{msTransition:ve,MozTransition:ve,OTransition:ve,WebkitTransition:ve,transition:ve}},transform:function(ve){return{msTransform:ve,MozTransform:ve,OTransform:ve,WebkitTransform:ve,transform:ve}},absolute:function(ve){var ze=ve&&ve.split(" ");return{position:"absolute",top:ze&&ze[0],right:ze&&ze[1],bottom:ze&&ze[2],left:ze&&ze[3]}},extend:function(ve,ze){var Te=ze[ve];return Te||{extend:ve}}},Ae=autoprefix.autoprefix=function(ve){var ze={};return(0,$.default)(ve,function(Te,we){var De={};(0,$.default)(Te,function(Ie,Ce){var Ne=Me[Ce];Ne?De=e({},De,Ne(Ie)):De[Ce]=Ie}),ze[we]=De}),ze};return autoprefix.default=Ae,autoprefix}var hover={},hasRequiredHover;function requireHover(){if(hasRequiredHover)return hover;hasRequiredHover=1,Object.defineProperty(hover,"__esModule",{value:!0}),hover.hover=void 0;var ye=Object.assign||function(ze){for(var Te=1;Te<arguments.length;Te++){var we=arguments[Te];for(var De in we)Object.prototype.hasOwnProperty.call(we,De)&&(ze[De]=we[De])}return ze},$=requireReact(),e=Y($);function Y(ze){return ze&&ze.__esModule?ze:{default:ze}}function Me(ze,Te){if(!(ze instanceof Te))throw new TypeError("Cannot call a class as a function")}function Ae(ze,Te){if(!ze)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return Te&&(typeof Te=="object"||typeof Te=="function")?Te:ze}function Se(ze,Te){if(typeof Te!="function"&&Te!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof Te);ze.prototype=Object.create(Te&&Te.prototype,{constructor:{value:ze,enumerable:!1,writable:!0,configurable:!0}}),Te&&(Object.setPrototypeOf?Object.setPrototypeOf(ze,Te):ze.__proto__=Te)}var ve=hover.hover=function(Te){var we=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"span";return function(De){Se(Ie,De);function Ie(){var Ce,Ne,$e,Le;Me(this,Ie);for(var Fe=arguments.length,We=Array(Fe),je=0;je<Fe;je++)We[je]=arguments[je];return Le=(Ne=($e=Ae(this,(Ce=Ie.__proto__||Object.getPrototypeOf(Ie)).call.apply(Ce,[this].concat(We))),$e),$e.state={hover:!1},$e.handleMouseOver=function(){return $e.setState({hover:!0})},$e.handleMouseOut=function(){return $e.setState({hover:!1})},$e.render=function(){return e.default.createElement(we,{onMouseOver:$e.handleMouseOver,onMouseOut:$e.handleMouseOut},e.default.createElement(Te,ye({},$e.props,$e.state)))},Ne),Ae($e,Le)}return Ie}(e.default.Component)};return hover.default=ve,hover}var active={},hasRequiredActive;function requireActive(){if(hasRequiredActive)return active;hasRequiredActive=1,Object.defineProperty(active,"__esModule",{value:!0}),active.active=void 0;var ye=Object.assign||function(ze){for(var Te=1;Te<arguments.length;Te++){var we=arguments[Te];for(var De in we)Object.prototype.hasOwnProperty.call(we,De)&&(ze[De]=we[De])}return ze},$=requireReact(),e=Y($);function Y(ze){return ze&&ze.__esModule?ze:{default:ze}}function Me(ze,Te){if(!(ze instanceof Te))throw new TypeError("Cannot call a class as a function")}function Ae(ze,Te){if(!ze)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return Te&&(typeof Te=="object"||typeof Te=="function")?Te:ze}function Se(ze,Te){if(typeof Te!="function"&&Te!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof Te);ze.prototype=Object.create(Te&&Te.prototype,{constructor:{value:ze,enumerable:!1,writable:!0,configurable:!0}}),Te&&(Object.setPrototypeOf?Object.setPrototypeOf(ze,Te):ze.__proto__=Te)}var ve=active.active=function(Te){var we=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"span";return function(De){Se(Ie,De);function Ie(){var Ce,Ne,$e,Le;Me(this,Ie);for(var Fe=arguments.length,We=Array(Fe),je=0;je<Fe;je++)We[je]=arguments[je];return Le=(Ne=($e=Ae(this,(Ce=Ie.__proto__||Object.getPrototypeOf(Ie)).call.apply(Ce,[this].concat(We))),$e),$e.state={active:!1},$e.handleMouseDown=function(){return $e.setState({active:!0})},$e.handleMouseUp=function(){return $e.setState({active:!1})},$e.render=function(){return e.default.createElement(we,{onMouseDown:$e.handleMouseDown,onMouseUp:$e.handleMouseUp},e.default.createElement(Te,ye({},$e.props,$e.state)))},Ne),Ae($e,Le)}return Ie}(e.default.Component)};return active.default=ve,active}var loop={},hasRequiredLoop;function requireLoop(){if(hasRequiredLoop)return loop;hasRequiredLoop=1,Object.defineProperty(loop,"__esModule",{value:!0});var ye=function(e,Y){var Me={},Ae=function(ve){var ze=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;Me[ve]=ze};return e===0&&Ae("first-child"),e===Y-1&&Ae("last-child"),(e===0||e%2===0)&&Ae("even"),Math.abs(e%2)===1&&Ae("odd"),Ae("nth-child",e),Me};return loop.default=ye,loop}var hasRequiredLib$2;function requireLib$2(){if(hasRequiredLib$2)return lib$2;hasRequiredLib$2=1,Object.defineProperty(lib$2,"__esModule",{value:!0}),lib$2.ReactCSS=lib$2.loop=lib$2.handleActive=lib$2.handleHover=lib$2.hover=void 0;var ye=requireFlattenNames(),$=Ie(ye),e=requireMergeClasses(),Y=Ie(e),Me=requireAutoprefix(),Ae=Ie(Me),Se=requireHover(),ve=Ie(Se),ze=requireActive(),Te=Ie(ze),we=requireLoop(),De=Ie(we);function Ie(Ne){return Ne&&Ne.__esModule?Ne:{default:Ne}}lib$2.hover=ve.default,lib$2.handleHover=ve.default,lib$2.handleActive=Te.default,lib$2.loop=De.default;var Ce=lib$2.ReactCSS=function($e){for(var Le=arguments.length,Fe=Array(Le>1?Le-1:0),We=1;We<Le;We++)Fe[We-1]=arguments[We];var je=(0,$.default)(Fe),Ue=(0,Y.default)($e,je);return(0,Ae.default)(Ue)};return lib$2.default=Ce,lib$2}var libExports$1=requireLib$2();const reactCSS=getDefaultExportFromCjs$1(libExports$1);var calculateChange$2=function ye($,e,Y,Me,Ae){var Se=Ae.clientWidth,ve=Ae.clientHeight,ze=typeof $.pageX=="number"?$.pageX:$.touches[0].pageX,Te=typeof $.pageY=="number"?$.pageY:$.touches[0].pageY,we=ze-(Ae.getBoundingClientRect().left+window.pageXOffset),De=Te-(Ae.getBoundingClientRect().top+window.pageYOffset);if(Y==="vertical"){var Ie=void 0;if(De<0?Ie=0:De>ve?Ie=1:Ie=Math.round(De*100/ve)/100,e.a!==Ie)return{h:e.h,s:e.s,l:e.l,a:Ie,source:"rgb"}}else{var Ce=void 0;if(we<0?Ce=0:we>Se?Ce=1:Ce=Math.round(we*100/Se)/100,Me!==Ce)return{h:e.h,s:e.s,l:e.l,a:Ce,source:"rgb"}}return null},checkboardCache={},render=function ye($,e,Y,Me){if(typeof document>"u"&&!Me)return null;var Ae=Me?new Me:document.createElement("canvas");Ae.width=Y*2,Ae.height=Y*2;var Se=Ae.getContext("2d");return Se?(Se.fillStyle=$,Se.fillRect(0,0,Ae.width,Ae.height),Se.fillStyle=e,Se.fillRect(0,0,Y,Y),Se.translate(Y,Y),Se.fillRect(0,0,Y,Y),Ae.toDataURL()):null},get$1=function ye($,e,Y,Me){var Ae=$+"-"+e+"-"+Y+(Me?"-server":"");if(checkboardCache[Ae])return checkboardCache[Ae];var Se=render($,e,Y,Me);return checkboardCache[Ae]=Se,Se},_extends$p=Object.assign||function(ye){for(var $=1;$<arguments.length;$++){var e=arguments[$];for(var Y in e)Object.prototype.hasOwnProperty.call(e,Y)&&(ye[Y]=e[Y])}return ye},Checkboard=function ye($){var e=$.white,Y=$.grey,Me=$.size,Ae=$.renderers,Se=$.borderRadius,ve=$.boxShadow,ze=$.children,Te=reactCSS({default:{grid:{borderRadius:Se,boxShadow:ve,absolute:"0px 0px 0px 0px",background:"url("+get$1(e,Y,Me,Ae.canvas)+") center left"}}});return reactExports.isValidElement(ze)?React.cloneElement(ze,_extends$p({},ze.props,{style:_extends$p({},ze.props.style,Te.grid)})):React.createElement("div",{style:Te.grid})};Checkboard.defaultProps={size:8,white:"transparent",grey:"rgba(0,0,0,.08)",renderers:{}};var _extends$o=Object.assign||function(ye){for(var $=1;$<arguments.length;$++){var e=arguments[$];for(var Y in e)Object.prototype.hasOwnProperty.call(e,Y)&&(ye[Y]=e[Y])}return ye},_createClass$c=function(){function ye($,e){for(var Y=0;Y<e.length;Y++){var Me=e[Y];Me.enumerable=Me.enumerable||!1,Me.configurable=!0,"value"in Me&&(Me.writable=!0),Object.defineProperty($,Me.key,Me)}}return function($,e,Y){return e&&ye($.prototype,e),Y&&ye($,Y),$}}();function _classCallCheck$c(ye,$){if(!(ye instanceof $))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn$c(ye,$){if(!ye)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return $&&(typeof $=="object"||typeof $=="function")?$:ye}function _inherits$c(ye,$){if(typeof $!="function"&&$!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof $);ye.prototype=Object.create($&&$.prototype,{constructor:{value:ye,enumerable:!1,writable:!0,configurable:!0}}),$&&(Object.setPrototypeOf?Object.setPrototypeOf(ye,$):ye.__proto__=$)}var Alpha=function(ye){_inherits$c($,ye);function $(){var e,Y,Me,Ae;_classCallCheck$c(this,$);for(var Se=arguments.length,ve=Array(Se),ze=0;ze<Se;ze++)ve[ze]=arguments[ze];return Ae=(Y=(Me=_possibleConstructorReturn$c(this,(e=$.__proto__||Object.getPrototypeOf($)).call.apply(e,[this].concat(ve))),Me),Me.handleChange=function(Te){var we=calculateChange$2(Te,Me.props.hsl,Me.props.direction,Me.props.a,Me.container);we&&typeof Me.props.onChange=="function"&&Me.props.onChange(we,Te)},Me.handleMouseDown=function(Te){Me.handleChange(Te),window.addEventListener("mousemove",Me.handleChange),window.addEventListener("mouseup",Me.handleMouseUp)},Me.handleMouseUp=function(){Me.unbindEventListeners()},Me.unbindEventListeners=function(){window.removeEventListener("mousemove",Me.handleChange),window.removeEventListener("mouseup",Me.handleMouseUp)},Y),_possibleConstructorReturn$c(Me,Ae)}return _createClass$c($,[{key:"componentWillUnmount",value:function(){this.unbindEventListeners()}},{key:"render",value:function(){var Y=this,Me=this.props.rgb,Ae=reactCSS({default:{alpha:{absolute:"0px 0px 0px 0px",borderRadius:this.props.radius},checkboard:{absolute:"0px 0px 0px 0px",overflow:"hidden",borderRadius:this.props.radius},gradient:{absolute:"0px 0px 0px 0px",background:"linear-gradient(to right, rgba("+Me.r+","+Me.g+","+Me.b+`, 0) 0%,
694
+ `),allowHTML:!1})]}),ve&&jsx$1(StyledHeaderDivider,{"data-testid":"stHeadingDivider",rainbow:ve.includes("linear"),color:ve})]})}const StyledCheckbox$1=newStyled("div",{target:"eg2gxky0"})(({theme:ye})=>({display:"flex",alignItems:"center",minHeight:ye.sizes.smallElementHeight})),StyledContent=newStyled("div",{target:"eg2gxky1"})(({visibility:ye})=>({display:ye===LabelVisibilityOptions.Collapsed?"none":"flex",visibility:ye===LabelVisibilityOptions.Hidden?"hidden":"visible",verticalAlign:"middle",flexDirection:"row",alignItems:"center"}));function translateGapWidth(ye,$){let e=$.spacing.lg;return ye==="medium"?e=$.spacing.threeXL:ye==="large"&&(e=$.spacing.fourXL),e}const StyledHorizontalBlock=newStyled("div",{target:"eu6p4el0"})(({theme:ye,gap:$})=>({display:"flex",flexWrap:"wrap",flexGrow:1,alignItems:"stretch",gap:translateGapWidth($,ye)})),GLOBAL_ELEMENTS=["balloons","snow"],StyledElementContainer=newStyled("div",{target:"eu6p4el1"})(({theme:ye,isStale:$,width:e,elementType:Y})=>({width:e,position:"relative","@media print":{overflow:"visible"},":is(.stHtml-empty)":{display:"none"},":has(> .stCacheSpinner)":{height:ye.spacing.none,overflow:"visible",visibility:"visible",marginBottom:`-${ye.spacing.lg}`,zIndex:ye.zIndices.cacheSpinner},":has(> .stPageLink)":{marginTop:`-${ye.spacing.xs}`,marginBottom:`-${ye.spacing.xs}`},...$&&Y!=="skeleton"&&STALE_STYLES,...Y==="empty"?{display:"none"}:{},...GLOBAL_ELEMENTS.includes(Y)?{marginBottom:`-${ye.spacing.lg}`}:{}})),StyledColumn=newStyled("div",{target:"eu6p4el2"})(({theme:ye,weight:$,gap:e,showBorder:Y,verticalAlignment:Me})=>{const{VerticalAlignment:Ae}=Block$2.Column,Se=$*100,ve=translateGapWidth(e,ye),ze=`calc(${Se}% - ${ve})`;return{width:ze,flex:`1 1 ${ze}`,[`@media (max-width: ${ye.breakpoints.columns})`]:{minWidth:`calc(100% - ${ye.spacing.twoXL})`},...Me===Ae.BOTTOM&&{marginTop:"auto",[`& ${StyledElementContainer}:last-of-type > ${StyledCheckbox$1}`]:{marginBottom:ye.spacing.sm}},...Me===Ae.TOP&&{[`& ${StyledElementContainer}:first-of-type > ${StyledCheckbox$1}`]:{marginTop:ye.spacing.sm}},...Me===Ae.CENTER&&{marginTop:"auto",marginBottom:"auto"},...Y&&{border:`${ye.sizes.borderWidth} solid ${ye.colors.borderColor}`,borderRadius:ye.radii.default,padding:`calc(${ye.spacing.lg} - ${ye.sizes.borderWidth})`}}}),StyledVerticalBlock=newStyled("div",{target:"eu6p4el3"})(({width:ye,maxWidth:$,theme:e})=>({width:ye,maxWidth:$,position:"relative",display:"flex",flex:1,flexDirection:"column",gap:e.spacing.lg})),StyledVerticalBlockWrapper=newStyled("div",{target:"eu6p4el4"})({display:"flex",flexDirection:"column",flex:1}),StyledVerticalBlockBorderWrapper=newStyled("div",{target:"eu6p4el5"})(({theme:ye,border:$,height:e})=>({...$&&{border:`${ye.sizes.borderWidth} solid ${ye.colors.borderColor}`,borderRadius:ye.radii.default,padding:`calc(${ye.spacing.lg} - ${ye.sizes.borderWidth})`},...e&&{height:`${e}px`,overflow:"auto"}})),StyledElementContainerLayoutWrapper=({width:ye,node:$,...e})=>{var Me;const Y=useLayoutStyles({width:ye,element:((Me=$.element)==null?void 0:Me.type)&&$.element[$.element.type]||void 0});return jsx$1(StyledElementContainer,{...e,...Y})},Audio=React.lazy(()=>__vitePreload(()=>import("./index.BTK3gx3H.js"),[],import.meta.url)),Balloons=React.lazy(()=>__vitePreload(()=>import("./index.Bgn4z-Mp.js"),__vite__mapDeps([0,1]),import.meta.url)),Snow=React.lazy(()=>__vitePreload(()=>import("./index.BkyYp5Em.js"),__vite__mapDeps([2,1]),import.meta.url)),ArrowDataFrame=React.lazy(()=>__vitePreload(()=>import("./index.DjTdTgti.js").then(ye=>ye.c),__vite__mapDeps([3,4,5,6,7,8,9,10,11,12,13,14,15]),import.meta.url)),ArrowVegaLiteChart=React.lazy(()=>__vitePreload(()=>import("./index.DV46EgCO.js"),__vite__mapDeps([16,6,5,8,17,18,19,4]),import.meta.url)),Toast=React.lazy(()=>__vitePreload(()=>import("./index.BFYGskaf.js"),[],import.meta.url)),BokehChart=React.lazy(()=>__vitePreload(()=>import("./index.DkwDCuk1.js"),[],import.meta.url)),DebouncedBokehChart=withCalculatedWidth(debounceRender(BokehChart,100)),DeckGlJsonChart=React.lazy(()=>__vitePreload(()=>import("./index.qC8qMz0q.js"),__vite__mapDeps([20,11,12,6,5,21,4,17,18,22,23]),import.meta.url)),GraphVizChart=React.lazy(()=>__vitePreload(()=>import("./index.CMvo7Iwl.js"),__vite__mapDeps([24,19,18,6,5]),import.meta.url)),IFrame=React.lazy(()=>__vitePreload(()=>import("./index.CBYIbEuv.js"),[],import.meta.url)),ImageList=React.lazy(()=>__vitePreload(()=>import("./index.BNc20KTN.js"),__vite__mapDeps([25,5,6]),import.meta.url)),LinkButton=React.lazy(()=>__vitePreload(()=>import("./index.pWHQEj0Q.js"),[],import.meta.url)),PageLink=React.lazy(()=>__vitePreload(()=>import("./index.UrE-Phqy.js"),[],import.meta.url)),PlotlyChart=React.lazy(()=>__vitePreload(()=>import("./index.D9bqDCB_.js"),__vite__mapDeps([26,4,5]),import.meta.url)),Video=React.lazy(()=>__vitePreload(()=>import("./index.DZ_FHOJd.js"),[],import.meta.url)),AudioInput=React.lazy(()=>__vitePreload(()=>import("./index.CrNuA-BG.js"),__vite__mapDeps([27,4,6,28,10,14]),import.meta.url)),Button=React.lazy(()=>__vitePreload(()=>import("./index.JgS0whqe.js"),[],import.meta.url)),ButtonGroup=React.lazy(()=>__vitePreload(()=>import("./index.B5-iXfzx.js"),__vite__mapDeps([29,21,4]),import.meta.url)),DownloadButton=React.lazy(()=>__vitePreload(()=>import("./index.DTP3exjF.js"),__vite__mapDeps([30,10]),import.meta.url)),CameraInput=React.lazy(()=>__vitePreload(()=>import("./index.D-9nQW74.js"),__vite__mapDeps([31,22,4,32,33]),import.meta.url)),ChatInput=React.lazy(()=>__vitePreload(()=>import("./index.DyyHt_xV.js"),__vite__mapDeps([34,35,36,37,22,32,38,39]),import.meta.url)),Checkbox=React.lazy(()=>__vitePreload(()=>import("./index.CAC6FyHh.js"),__vite__mapDeps([40,21,4,7]),import.meta.url)),ColorPicker=React.lazy(()=>__vitePreload(()=>import("./index.D5wciRNz.js"),__vite__mapDeps([41,21,4]),import.meta.url)),DateInput=React.lazy(()=>__vitePreload(()=>import("./index.exPoJHIW.js"),__vite__mapDeps([42,21,4,43,12,13,44,39]),import.meta.url)),Html=React.lazy(()=>__vitePreload(()=>import("./index.rECpAXqX.js"),[],import.meta.url)),Multiselect=React.lazy(()=>__vitePreload(()=>import("./index.Hnms5TSS.js"),__vite__mapDeps([45,21,4]),import.meta.url)),Progress=React.lazy(()=>__vitePreload(()=>import("./index.T5vKsEVA.js"),__vite__mapDeps([46,33]),import.meta.url)),Spinner=React.lazy(()=>__vitePreload(()=>import("./index.DcXXaGYK.js"),[],import.meta.url)),Radio=React.lazy(()=>__vitePreload(()=>import("./index.C5bx6jEW.js"),__vite__mapDeps([47,21,4]),import.meta.url)),Selectbox$1=React.lazy(()=>__vitePreload(()=>import("./index.CBoIJv6M.js"),__vite__mapDeps([48,21,4]),import.meta.url)),Slider$1=React.lazy(()=>__vitePreload(()=>import("./index.bDDanN90.js"),__vite__mapDeps([49,9,21,4]),import.meta.url)),FileUploader=React.lazy(()=>__vitePreload(()=>import("./index.BiPYzGZi.js"),__vite__mapDeps([50,22,4,35,33,28,32]),import.meta.url)),TextArea=React.lazy(()=>__vitePreload(()=>import("./index.BdtKHTgl.js"),__vite__mapDeps([51,52,53,37,36,21,4,38,39]),import.meta.url)),TextInput=React.lazy(()=>__vitePreload(()=>import("./index.DMreumKF.js"),__vite__mapDeps([54,52,53,37,21,4,36,44,39]),import.meta.url)),TimeInput=React.lazy(()=>__vitePreload(()=>import("./index.BxYliQ9c.js"),__vite__mapDeps([55,21,4,43,12,13]),import.meta.url)),NumberInput=React.lazy(()=>__vitePreload(()=>import("./index.DC6PJYZU.js"),__vite__mapDeps([56,52,4,36,9,44,39]),import.meta.url)),StreamlitSyntaxHighlighter=React.lazy(()=>__vitePreload(()=>Promise.resolve().then(()=>StreamlitSyntaxHighlighter$2),void 0,import.meta.url));function hideIfStale(ye,$){return ye?jsx$1(Fragment,{}):$}const RawElementNodeRenderer=ye=>{const{node:$}=ye;if(!$)throw new Error("ElementNode not found.");const e={disableFullscreenMode:ye.disableFullscreenMode},Y={...e,widgetMgr:ye.widgetMgr,disabled:ye.widgetsDisabled,fragmentId:$.fragmentId};switch($.element.type){case"alert":{const Ae=$.element.alert;return jsx$1(AlertElement$1,{icon:Ae.icon,body:Ae.body,kind:getAlertElementKind(Ae.format),...e})}case"arrowTable":return jsx$1(ArrowTable$1,{element:$.quiverElement,...e});case"audio":return jsx$1(Audio,{element:$.element.audio,endpoints:ye.endpoints,...e,elementMgr:ye.widgetMgr});case"balloons":return hideIfStale(ye.isStale,jsx$1(Balloons,{scriptRunId:ye.scriptRunId}));case"bokehChart":return jsx$1(DebouncedBokehChart,{element:$.element.bokehChart,...e});case"code":{const Ae=$.element.code;return jsx$1(StreamlitSyntaxHighlighter,{language:Ae.language,showLineNumbers:Ae.showLineNumbers,wrapLines:Ae.wrapLines,height:Ae.height,children:Ae.codeText})}case"deckGlJsonChart":return jsx$1(DeckGlJsonChart,{element:$.element.deckGlJsonChart,...Y});case"docString":return jsx$1(DocString$1,{element:$.element.docString,...e});case"empty":return jsx$1("div",{className:"stEmpty","data-testid":"stEmpty"});case"exception":return jsx$1(ExceptionElement$1,{element:$.element.exception,...e});case"graphvizChart":return jsx$1(GraphVizChart,{element:$.element.graphvizChart,...e});case"heading":return jsx$1(Heading,{element:$.element.heading,...e});case"iframe":return jsx$1(IFrame,{element:$.element.iframe,...e});case"imgs":return jsx$1(ImageList,{element:$.element.imgs,endpoints:ye.endpoints,...e});case"json":return jsx$1(Json$1,{element:$.element.json,...e});case"markdown":return jsx$1(Markdown$1,{element:$.element.markdown,...e});case"metric":return jsx$1(Metric$1,{element:$.element.metric});case"html":return jsx$1(Html,{element:$.element.html,...e});case"pageLink":{const Ae=$.element.pageLink,Se=Y.disabled||Ae.disabled;return jsx$1(PageLink,{element:Ae,disabled:Se,...e})}case"progress":return jsx$1(Progress,{element:$.element.progress,...e});case"skeleton":return jsx$1(Skeleton,{element:$.element.skeleton});case"snow":return hideIfStale(ye.isStale,jsx$1(Snow,{scriptRunId:ye.scriptRunId}));case"spinner":return jsx$1(Spinner,{element:$.element.spinner,...e});case"text":return jsx$1(TextElement$1,{element:$.element.text,...e});case"video":return jsx$1(Video,{element:$.element.video,endpoints:ye.endpoints,...e,elementMgr:ye.widgetMgr});case"toast":{const Ae=$.element.toast;return jsx$1(Toast,{body:Ae.body,icon:Ae.icon,...e},$.scriptRunId)}case"arrowDataFrame":{const Ae=$.element.arrowDataFrame;return Y.disabled=Y.disabled||Ae.disabled,jsx$1(ArrowDataFrame,{element:Ae,data:$.quiverElement,...Ae.id&&{key:Ae.id},...Y})}case"arrowVegaLiteChart":const Me=$.vegaLiteChartElement;return jsx$1(ArrowVegaLiteChart,{element:Me,...Y},Me.id||void 0);case"audioInput":{const Ae=$.element.audioInput;return Y.disabled=Y.disabled||Ae.disabled,jsx$1(AudioInput,{uploadClient:ye.uploadClient,element:Ae,...Y},Ae.id)}case"button":{const Ae=$.element.button;if(Y.disabled=Y.disabled||Ae.disabled,Ae.isFormSubmitter){const{formId:Se}=Ae,ve=ye.formsData.formsWithUploads.has(Se);return jsx$1(FormSubmitContent,{element:Ae,hasInProgressUpload:ve,...Y})}return jsx$1(Button,{element:Ae,...Y})}case"buttonGroup":{const Ae=$.element.buttonGroup;return Y.disabled=Y.disabled||Ae.disabled,jsx$1(ButtonGroup,{element:Ae,...Y},Ae.id)}case"downloadButton":{const Ae=$.element.downloadButton;return Y.disabled=Y.disabled||Ae.disabled,jsx$1(DownloadButton,{endpoints:ye.endpoints,element:Ae,...Y},Ae.id)}case"cameraInput":{const Ae=$.element.cameraInput;return Y.disabled=Y.disabled||Ae.disabled,jsx$1(CameraInput,{element:Ae,uploadClient:ye.uploadClient,...Y},Ae.id)}case"chatInput":{const Ae=$.element.chatInput;return Y.disabled=Y.disabled||Ae.disabled,jsx$1(ChatInput,{element:Ae,uploadClient:ye.uploadClient,...Y},Ae.id)}case"checkbox":{const Ae=$.element.checkbox;return Y.disabled=Y.disabled||Ae.disabled,jsx$1(Checkbox,{element:Ae,...Y},Ae.id)}case"colorPicker":{const Ae=$.element.colorPicker;return Y.disabled=Y.disabled||Ae.disabled,jsx$1(ColorPicker,{element:Ae,...Y},Ae.id)}case"componentInstance":return jsx$1(ComponentInstance$1,{registry:ye.componentRegistry,element:$.element.componentInstance,...Y});case"dateInput":{const Ae=$.element.dateInput;return Y.disabled=Y.disabled||Ae.disabled,jsx$1(DateInput,{element:Ae,...Y},Ae.id)}case"fileUploader":{const Ae=$.element.fileUploader;return Y.disabled=Y.disabled||Ae.disabled,jsx$1(FileUploader,{element:Ae,uploadClient:ye.uploadClient,...Y},Ae.id)}case"linkButton":{const Ae=$.element.linkButton;return Y.disabled=Y.disabled||Ae.disabled,jsx$1(LinkButton,{element:Ae,...Y})}case"multiselect":{const Ae=$.element.multiselect;return Y.disabled=Y.disabled||Ae.disabled,jsx$1(Multiselect,{element:Ae,...Y},Ae.id)}case"numberInput":{const Ae=$.element.numberInput;return Y.disabled=Y.disabled||Ae.disabled,jsx$1(NumberInput,{element:Ae,...Y},Ae.id)}case"plotlyChart":{const Ae=$.element.plotlyChart;return jsx$1(PlotlyChart,{element:Ae,...Y},Ae.id)}case"radio":{const Ae=$.element.radio;return Y.disabled=Y.disabled||Ae.disabled,jsx$1(Radio,{element:Ae,...Y},Ae.id)}case"selectbox":{const Ae=$.element.selectbox;return Y.disabled=Y.disabled||Ae.disabled,jsx$1(Selectbox$1,{element:Ae,...Y},Ae.id)}case"slider":{const Ae=$.element.slider;return Y.disabled=Y.disabled||Ae.disabled,jsx$1(Slider$1,{element:Ae,...Y},Ae.id)}case"textArea":{const Ae=$.element.textArea;return Y.disabled=Y.disabled||Ae.disabled,jsx$1(TextArea,{element:Ae,...Y},Ae.id)}case"textInput":{const Ae=$.element.textInput;return Y.disabled=Y.disabled||Ae.disabled,jsx$1(TextInput,{element:Ae,...Y},Ae.id)}case"timeInput":{const Ae=$.element.timeInput;return Y.disabled=Y.disabled||Ae.disabled,jsx$1(TimeInput,{element:Ae,...Y},Ae.id)}default:throw new Error(`Unrecognized Element type ${$.element.type}`)}},ElementNodeRenderer=ye=>{const{isFullScreen:$,fragmentIdsThisRun:e}=React.useContext(LibContext),{node:Y,width:Me}=ye,Ae=Y.element.type||"",Se=shouldComponentBeEnabled(Ae,ye.scriptRunState),ve=isComponentStale(Se,Y,ye.scriptRunState,ye.scriptRunId,e),ze=getElementId(Y.element),Te=getKeyFromId(ze);return jsx$1(Maybe,{enable:Se,children:jsx$1(StyledElementContainerLayoutWrapper,{className:classNames("stElementContainer","element-container",convertKeyToClassName(Te)),"data-testid":"stElementContainer","data-stale":ve,isStale:ve&&!$,width:Me,elementType:Ae,node:Y,children:jsx$1(ErrorBoundary,{children:jsx$1(reactExports.Suspense,{fallback:jsx$1(Skeleton,{element:Skeleton$1.create({style:Skeleton$1.SkeletonStyle.ELEMENT})}),children:jsx$1(RawElementNodeRenderer,{...ye,isStale:ve})})})})})},BlockNodeRenderer=ye=>{const{node:$}=ye,{fragmentIdsThisRun:e}=reactExports.useContext(LibContext);if($.isEmpty&&!$.deltaBlock.allowEmpty)return jsx$1(Fragment,{});const Y=shouldComponentBeEnabled("",ye.scriptRunState),Me=isComponentStale(Y,$,ye.scriptRunState,ye.scriptRunId,e),Ae={...ye,node:$},Se=ye.disableFullscreenMode||d$2($.deltaBlock.dialog)||d$2($.deltaBlock.popover),ve=jsx$1(LayoutBlock,{...Ae,disableFullscreenMode:Se});if($.deltaBlock.dialog)return jsx$1(Dialog$1,{element:$.deltaBlock.dialog,deltaMsgReceivedAt:$.deltaMsgReceivedAt,children:ve});if($.deltaBlock.expandable)return jsx$1(Expander$1,{empty:$.isEmpty,isStale:Me,element:$.deltaBlock.expandable,children:ve});if($.deltaBlock.popover)return jsx$1(Popover$1,{empty:$.isEmpty,element:$.deltaBlock.popover,children:ve});if($.deltaBlock.type==="form"){const{formId:ze,clearOnSubmit:Te,enterToSubmit:we,border:De}=$.deltaBlock.form,Ie=ye.formsData.submitButtons.get(ze),Ce=Ie!==void 0&&Ie.length>0;return jsx$1(Form$1,{formId:ze,clearOnSubmit:Te,enterToSubmit:we,hasSubmitButton:Ce,scriptRunState:ye.scriptRunState,widgetMgr:ye.widgetMgr,border:De,children:ve})}if($.deltaBlock.chatMessage)return jsx$1(ChatMessage$1,{element:$.deltaBlock.chatMessage,endpoints:ye.endpoints,children:ve});if($.deltaBlock.column)return jsx$1(StyledColumn,{weight:$.deltaBlock.column.weight??0,gap:$.deltaBlock.column.gap??"",verticalAlignment:$.deltaBlock.column.verticalAlignment??void 0,showBorder:$.deltaBlock.column.showBorder??!1,className:"stColumn","data-testid":"stColumn",children:ve});if($.deltaBlock.tabContainer){if(!Ae.width)return jsx$1("div",{});const Te={...Ae,isStale:Me,renderTabContent:we=>jsx$1(VerticalBlock,{...we})};return jsx$1(Tabs$1,{...Te})}return ve},ChildRenderer=ye=>{const{libConfig:$}=reactExports.useContext(LibContext);assignDividerColor(ye.node,useTheme());const e=new Set;return jsx$1(Fragment,{children:ye.node.children&&ye.node.children.map((Y,Me)=>{const Ae=$.disableFullscreenMode||ye.disableFullscreenMode;if(Y instanceof ElementNode){const Se={...ye,disableFullscreenMode:Ae,node:Y},ve=getElementId(Y.element)||Me.toString();return e.has(ve)?null:(e.add(ve),jsx$1(ElementNodeRenderer,{...Se},ve))}if(Y instanceof BlockNode){const Se={...ye,disableFullscreenMode:Ae,node:Y};return jsx$1(BlockNodeRenderer,{...Se},Me)}throw new Error(`Unrecognized AppNode: ${Y}`)})})};function ScrollToBottomVerticalBlockWrapper(ye){const{border:$,height:e,children:Y}=ye,Me=useScrollToBottom();return jsx$1(StyledVerticalBlockBorderWrapper,{border:$,height:e,"data-testid":"stVerticalBlockBorderWrapper","data-test-scroll-behavior":"scroll-to-bottom",ref:Me,children:Y})}const VerticalBlock=ye=>{var De,Ie;const{values:[$],elementRef:e,forceRecalculate:Y}=useResizeObserver(reactExports.useMemo(()=>["width"],[])),Me=((De=ye.node.deltaBlock.vertical)==null?void 0:De.border)??!1,Ae=((Ie=ye.node.deltaBlock.vertical)==null?void 0:Ie.height)||void 0,Se=Ae&&ye.node.children.some(Ce=>Ce instanceof BlockNode&&Ce.deltaBlock.type==="chatMessage");reactExports.useEffect(()=>{Y()},[Y,Se]);const ve=Se?ScrollToBottomVerticalBlockWrapper:StyledVerticalBlockBorderWrapper,ze=getKeyFromId(ye.node.deltaBlock.id),Te=useLayoutStyles({width:$,element:void 0}),we={...ye,width:Te.width};return jsx$1(ve,{border:Me,height:Ae,"data-testid":"stVerticalBlockBorderWrapper","data-test-scroll-behavior":"normal",children:jsx$1(StyledVerticalBlockWrapper,{ref:e,children:jsx$1(StyledVerticalBlock,{className:classNames("stVerticalBlock",convertKeyToClassName(ze)),"data-testid":"stVerticalBlock",...Te,children:jsx$1(ChildRenderer,{...we})})})})},HorizontalBlock=ye=>{var e;const $=((e=ye.node.deltaBlock.horizontal)==null?void 0:e.gap)??"";return jsx$1(StyledHorizontalBlock,{gap:$,className:"stHorizontalBlock","data-testid":"stHorizontalBlock",children:jsx$1(ChildRenderer,{...ye})})};function LayoutBlock(ye){return ye.node.deltaBlock.horizontal?jsx$1(HorizontalBlock,{...ye}):jsx$1(VerticalBlock,{...ye})}const StyledDataFrameOverlay=newStyled("div",{target:"e19n7mk11"})(({theme:ye})=>({position:"fixed",top:0,left:0,zIndex:ye.zIndices.tablePortal,lineHeight:"100%"})),PortalContext=React.createContext(null),PortalProvider=({children:ye})=>{const $=reactExports.useRef(null),e=reactExports.useCallback(()=>$.current,[]);return jsxs(PortalContext.Provider,{value:e,children:[ye,jsx$1(StyledDataFrameOverlay,{"data-testid":"portal",id:"portal",ref:$})]})};function ThemeProvider({theme:ye,baseuiTheme:$,children:e}){return jsx$1(ThemeProvider$1,{theme:$||baseuiLightTheme,children:jsx$1(ThemeProvider$2,{theme:ye,children:e})})}function toCodePoint(ye,$){const e=[];let Y=0,Me=0,Ae=0;for(;Ae<ye.length;)Y=ye.charCodeAt(Ae++),Me?(e.push((65536+(Me-55296<<10)+(Y-56320)).toString(16)),Me=0):55296<=Y&&Y<=56319?Me=Y:e.push(Y.toString(16));return e.join("-")}const UFE0Fg=/\uFE0F/g,U200D="‍";function grabTheRightIcon(ye){return toCodePoint(ye.indexOf(U200D)<0?ye.replace(UFE0Fg,""):ye)}function iconToUrl(ye){const $=/^:(.+)\/(.+):$/,e=ye.match($);return e===null?"":`https://fonts.gstatic.com/s/i/short-term/release/materialsymbolsrounded/${e[2]}/default/24px.svg`}function handleFavicon(ye,$,e){const Y=extractEmoji(ye);let Me;Y&&!ye.startsWith(":material")?Me=`https://cdn.jsdelivr.net/gh/twitter/twemoji@14.0.2/assets/72x72/${grabTheRightIcon(Y)}.png`:ye.startsWith(":material")?Me=iconToUrl(ye):Me=e.buildMediaURL(ye),overwriteFavicon(Me),$({type:"SET_PAGE_FAVICON",favicon:Me})}function overwriteFavicon(ye){const $=document.querySelector("link[rel='shortcut icon']");$&&($.href=ye)}function extractEmoji(ye){const $=ye.replace("-","_");return nodeEmoji.hasEmoji(nodeEmoji.get($))?nodeEmoji.get($):nodeEmoji.hasEmoji(ye)?ye:""}var lib$2={},flattenNames={},_baseForOwn,hasRequired_baseForOwn;function require_baseForOwn(){if(hasRequired_baseForOwn)return _baseForOwn;hasRequired_baseForOwn=1;var ye=require_baseFor(),$=requireKeys();function e(Y,Me){return Y&&ye(Y,Me,$)}return _baseForOwn=e,_baseForOwn}var _castFunction,hasRequired_castFunction;function require_castFunction(){if(hasRequired_castFunction)return _castFunction;hasRequired_castFunction=1;var ye=requireIdentity();function $(e){return typeof e=="function"?e:ye}return _castFunction=$,_castFunction}var forOwn_1,hasRequiredForOwn;function requireForOwn(){if(hasRequiredForOwn)return forOwn_1;hasRequiredForOwn=1;var ye=require_baseForOwn(),$=require_castFunction();function e(Y,Me){return Y&&ye(Y,$(Me))}return forOwn_1=e,forOwn_1}var _setCacheAdd,hasRequired_setCacheAdd;function require_setCacheAdd(){if(hasRequired_setCacheAdd)return _setCacheAdd;hasRequired_setCacheAdd=1;var ye="__lodash_hash_undefined__";function $(e){return this.__data__.set(e,ye),this}return _setCacheAdd=$,_setCacheAdd}var _setCacheHas,hasRequired_setCacheHas;function require_setCacheHas(){if(hasRequired_setCacheHas)return _setCacheHas;hasRequired_setCacheHas=1;function ye($){return this.__data__.has($)}return _setCacheHas=ye,_setCacheHas}var _SetCache,hasRequired_SetCache;function require_SetCache(){if(hasRequired_SetCache)return _SetCache;hasRequired_SetCache=1;var ye=require_MapCache(),$=require_setCacheAdd(),e=require_setCacheHas();function Y(Me){var Ae=-1,Se=Me==null?0:Me.length;for(this.__data__=new ye;++Ae<Se;)this.add(Me[Ae])}return Y.prototype.add=Y.prototype.push=$,Y.prototype.has=e,_SetCache=Y,_SetCache}var _arraySome,hasRequired_arraySome;function require_arraySome(){if(hasRequired_arraySome)return _arraySome;hasRequired_arraySome=1;function ye($,e){for(var Y=-1,Me=$==null?0:$.length;++Y<Me;)if(e($[Y],Y,$))return!0;return!1}return _arraySome=ye,_arraySome}var _cacheHas,hasRequired_cacheHas;function require_cacheHas(){if(hasRequired_cacheHas)return _cacheHas;hasRequired_cacheHas=1;function ye($,e){return $.has(e)}return _cacheHas=ye,_cacheHas}var _equalArrays,hasRequired_equalArrays;function require_equalArrays(){if(hasRequired_equalArrays)return _equalArrays;hasRequired_equalArrays=1;var ye=require_SetCache(),$=require_arraySome(),e=require_cacheHas(),Y=1,Me=2;function Ae(Se,ve,ze,Te,we,De){var Ie=ze&Y,Ce=Se.length,Ne=ve.length;if(Ce!=Ne&&!(Ie&&Ne>Ce))return!1;var $e=De.get(Se),Le=De.get(ve);if($e&&Le)return $e==ve&&Le==Se;var Fe=-1,We=!0,je=ze&Me?new ye:void 0;for(De.set(Se,ve),De.set(ve,Se);++Fe<Ce;){var Ue=Se[Fe],Ge=ve[Fe];if(Te)var He=Ie?Te(Ge,Ue,Fe,ve,Se,De):Te(Ue,Ge,Fe,Se,ve,De);if(He!==void 0){if(He)continue;We=!1;break}if(je){if(!$(ve,function(Xe,st){if(!e(je,st)&&(Ue===Xe||we(Ue,Xe,ze,Te,De)))return je.push(st)})){We=!1;break}}else if(!(Ue===Ge||we(Ue,Ge,ze,Te,De))){We=!1;break}}return De.delete(Se),De.delete(ve),We}return _equalArrays=Ae,_equalArrays}var _equalByTag,hasRequired_equalByTag;function require_equalByTag(){if(hasRequired_equalByTag)return _equalByTag;hasRequired_equalByTag=1;var ye=require_Symbol(),$=require_Uint8Array(),e=requireEq(),Y=require_equalArrays(),Me=require_mapToArray(),Ae=require_setToArray(),Se=1,ve=2,ze="[object Boolean]",Te="[object Date]",we="[object Error]",De="[object Map]",Ie="[object Number]",Ce="[object RegExp]",Ne="[object Set]",$e="[object String]",Le="[object Symbol]",Fe="[object ArrayBuffer]",We="[object DataView]",je=ye?ye.prototype:void 0,Ue=je?je.valueOf:void 0;function Ge(He,Xe,st,Ke,Je,rt,ut){switch(st){case We:if(He.byteLength!=Xe.byteLength||He.byteOffset!=Xe.byteOffset)return!1;He=He.buffer,Xe=Xe.buffer;case Fe:return!(He.byteLength!=Xe.byteLength||!rt(new $(He),new $(Xe)));case ze:case Te:case Ie:return e(+He,+Xe);case we:return He.name==Xe.name&&He.message==Xe.message;case Ce:case $e:return He==Xe+"";case De:var ft=Me;case Ne:var At=Ke&Se;if(ft||(ft=Ae),He.size!=Xe.size&&!At)return!1;var bt=ut.get(He);if(bt)return bt==Xe;Ke|=ve,ut.set(He,Xe);var Ot=Y(ft(He),ft(Xe),Ke,Je,rt,ut);return ut.delete(He),Ot;case Le:if(Ue)return Ue.call(He)==Ue.call(Xe)}return!1}return _equalByTag=Ge,_equalByTag}var _equalObjects,hasRequired_equalObjects;function require_equalObjects(){if(hasRequired_equalObjects)return _equalObjects;hasRequired_equalObjects=1;var ye=require_getAllKeys(),$=1,e=Object.prototype,Y=e.hasOwnProperty;function Me(Ae,Se,ve,ze,Te,we){var De=ve&$,Ie=ye(Ae),Ce=Ie.length,Ne=ye(Se),$e=Ne.length;if(Ce!=$e&&!De)return!1;for(var Le=Ce;Le--;){var Fe=Ie[Le];if(!(De?Fe in Se:Y.call(Se,Fe)))return!1}var We=we.get(Ae),je=we.get(Se);if(We&&je)return We==Se&&je==Ae;var Ue=!0;we.set(Ae,Se),we.set(Se,Ae);for(var Ge=De;++Le<Ce;){Fe=Ie[Le];var He=Ae[Fe],Xe=Se[Fe];if(ze)var st=De?ze(Xe,He,Fe,Se,Ae,we):ze(He,Xe,Fe,Ae,Se,we);if(!(st===void 0?He===Xe||Te(He,Xe,ve,ze,we):st)){Ue=!1;break}Ge||(Ge=Fe=="constructor")}if(Ue&&!Ge){var Ke=Ae.constructor,Je=Se.constructor;Ke!=Je&&"constructor"in Ae&&"constructor"in Se&&!(typeof Ke=="function"&&Ke instanceof Ke&&typeof Je=="function"&&Je instanceof Je)&&(Ue=!1)}return we.delete(Ae),we.delete(Se),Ue}return _equalObjects=Me,_equalObjects}var _baseIsEqualDeep,hasRequired_baseIsEqualDeep;function require_baseIsEqualDeep(){if(hasRequired_baseIsEqualDeep)return _baseIsEqualDeep;hasRequired_baseIsEqualDeep=1;var ye=require_Stack(),$=require_equalArrays(),e=require_equalByTag(),Y=require_equalObjects(),Me=require_getTag(),Ae=requireIsArray(),Se=requireIsBuffer$1(),ve=requireIsTypedArray(),ze=1,Te="[object Arguments]",we="[object Array]",De="[object Object]",Ie=Object.prototype,Ce=Ie.hasOwnProperty;function Ne($e,Le,Fe,We,je,Ue){var Ge=Ae($e),He=Ae(Le),Xe=Ge?we:Me($e),st=He?we:Me(Le);Xe=Xe==Te?De:Xe,st=st==Te?De:st;var Ke=Xe==De,Je=st==De,rt=Xe==st;if(rt&&Se($e)){if(!Se(Le))return!1;Ge=!0,Ke=!1}if(rt&&!Ke)return Ue||(Ue=new ye),Ge||ve($e)?$($e,Le,Fe,We,je,Ue):e($e,Le,Xe,Fe,We,je,Ue);if(!(Fe&ze)){var ut=Ke&&Ce.call($e,"__wrapped__"),ft=Je&&Ce.call(Le,"__wrapped__");if(ut||ft){var At=ut?$e.value():$e,bt=ft?Le.value():Le;return Ue||(Ue=new ye),je(At,bt,Fe,We,Ue)}}return rt?(Ue||(Ue=new ye),Y($e,Le,Fe,We,je,Ue)):!1}return _baseIsEqualDeep=Ne,_baseIsEqualDeep}var _baseIsEqual,hasRequired_baseIsEqual;function require_baseIsEqual(){if(hasRequired_baseIsEqual)return _baseIsEqual;hasRequired_baseIsEqual=1;var ye=require_baseIsEqualDeep(),$=requireIsObjectLike();function e(Y,Me,Ae,Se,ve){return Y===Me?!0:Y==null||Me==null||!$(Y)&&!$(Me)?Y!==Y&&Me!==Me:ye(Y,Me,Ae,Se,e,ve)}return _baseIsEqual=e,_baseIsEqual}var _baseIsMatch,hasRequired_baseIsMatch;function require_baseIsMatch(){if(hasRequired_baseIsMatch)return _baseIsMatch;hasRequired_baseIsMatch=1;var ye=require_Stack(),$=require_baseIsEqual(),e=1,Y=2;function Me(Ae,Se,ve,ze){var Te=ve.length,we=Te,De=!ze;if(Ae==null)return!we;for(Ae=Object(Ae);Te--;){var Ie=ve[Te];if(De&&Ie[2]?Ie[1]!==Ae[Ie[0]]:!(Ie[0]in Ae))return!1}for(;++Te<we;){Ie=ve[Te];var Ce=Ie[0],Ne=Ae[Ce],$e=Ie[1];if(De&&Ie[2]){if(Ne===void 0&&!(Ce in Ae))return!1}else{var Le=new ye;if(ze)var Fe=ze(Ne,$e,Ce,Ae,Se,Le);if(!(Fe===void 0?$($e,Ne,e|Y,ze,Le):Fe))return!1}}return!0}return _baseIsMatch=Me,_baseIsMatch}var _isStrictComparable,hasRequired_isStrictComparable;function require_isStrictComparable(){if(hasRequired_isStrictComparable)return _isStrictComparable;hasRequired_isStrictComparable=1;var ye=requireIsObject();function $(e){return e===e&&!ye(e)}return _isStrictComparable=$,_isStrictComparable}var _getMatchData,hasRequired_getMatchData;function require_getMatchData(){if(hasRequired_getMatchData)return _getMatchData;hasRequired_getMatchData=1;var ye=require_isStrictComparable(),$=requireKeys();function e(Y){for(var Me=$(Y),Ae=Me.length;Ae--;){var Se=Me[Ae],ve=Y[Se];Me[Ae]=[Se,ve,ye(ve)]}return Me}return _getMatchData=e,_getMatchData}var _matchesStrictComparable,hasRequired_matchesStrictComparable;function require_matchesStrictComparable(){if(hasRequired_matchesStrictComparable)return _matchesStrictComparable;hasRequired_matchesStrictComparable=1;function ye($,e){return function(Y){return Y==null?!1:Y[$]===e&&(e!==void 0||$ in Object(Y))}}return _matchesStrictComparable=ye,_matchesStrictComparable}var _baseMatches,hasRequired_baseMatches;function require_baseMatches(){if(hasRequired_baseMatches)return _baseMatches;hasRequired_baseMatches=1;var ye=require_baseIsMatch(),$=require_getMatchData(),e=require_matchesStrictComparable();function Y(Me){var Ae=$(Me);return Ae.length==1&&Ae[0][2]?e(Ae[0][0],Ae[0][1]):function(Se){return Se===Me||ye(Se,Me,Ae)}}return _baseMatches=Y,_baseMatches}var _baseHasIn,hasRequired_baseHasIn;function require_baseHasIn(){if(hasRequired_baseHasIn)return _baseHasIn;hasRequired_baseHasIn=1;function ye($,e){return $!=null&&e in Object($)}return _baseHasIn=ye,_baseHasIn}var _hasPath,hasRequired_hasPath;function require_hasPath(){if(hasRequired_hasPath)return _hasPath;hasRequired_hasPath=1;var ye=require_castPath(),$=requireIsArguments(),e=requireIsArray(),Y=require_isIndex(),Me=requireIsLength(),Ae=require_toKey();function Se(ve,ze,Te){ze=ye(ze,ve);for(var we=-1,De=ze.length,Ie=!1;++we<De;){var Ce=Ae(ze[we]);if(!(Ie=ve!=null&&Te(ve,Ce)))break;ve=ve[Ce]}return Ie||++we!=De?Ie:(De=ve==null?0:ve.length,!!De&&Me(De)&&Y(Ce,De)&&(e(ve)||$(ve)))}return _hasPath=Se,_hasPath}var hasIn_1,hasRequiredHasIn;function requireHasIn(){if(hasRequiredHasIn)return hasIn_1;hasRequiredHasIn=1;var ye=require_baseHasIn(),$=require_hasPath();function e(Y,Me){return Y!=null&&$(Y,Me,ye)}return hasIn_1=e,hasIn_1}var _baseMatchesProperty,hasRequired_baseMatchesProperty;function require_baseMatchesProperty(){if(hasRequired_baseMatchesProperty)return _baseMatchesProperty;hasRequired_baseMatchesProperty=1;var ye=require_baseIsEqual(),$=requireGet(),e=requireHasIn(),Y=require_isKey(),Me=require_isStrictComparable(),Ae=require_matchesStrictComparable(),Se=require_toKey(),ve=1,ze=2;function Te(we,De){return Y(we)&&Me(De)?Ae(Se(we),De):function(Ie){var Ce=$(Ie,we);return Ce===void 0&&Ce===De?e(Ie,we):ye(De,Ce,ve|ze)}}return _baseMatchesProperty=Te,_baseMatchesProperty}var _basePropertyDeep,hasRequired_basePropertyDeep;function require_basePropertyDeep(){if(hasRequired_basePropertyDeep)return _basePropertyDeep;hasRequired_basePropertyDeep=1;var ye=require_baseGet();function $(e){return function(Y){return ye(Y,e)}}return _basePropertyDeep=$,_basePropertyDeep}var property_1,hasRequiredProperty;function requireProperty(){if(hasRequiredProperty)return property_1;hasRequiredProperty=1;var ye=require_baseProperty(),$=require_basePropertyDeep(),e=require_isKey(),Y=require_toKey();function Me(Ae){return e(Ae)?ye(Y(Ae)):$(Ae)}return property_1=Me,property_1}var _baseIteratee,hasRequired_baseIteratee;function require_baseIteratee(){if(hasRequired_baseIteratee)return _baseIteratee;hasRequired_baseIteratee=1;var ye=require_baseMatches(),$=require_baseMatchesProperty(),e=requireIdentity(),Y=requireIsArray(),Me=requireProperty();function Ae(Se){return typeof Se=="function"?Se:Se==null?e:typeof Se=="object"?Y(Se)?$(Se[0],Se[1]):ye(Se):Me(Se)}return _baseIteratee=Ae,_baseIteratee}var _createBaseEach,hasRequired_createBaseEach;function require_createBaseEach(){if(hasRequired_createBaseEach)return _createBaseEach;hasRequired_createBaseEach=1;var ye=requireIsArrayLike();function $(e,Y){return function(Me,Ae){if(Me==null)return Me;if(!ye(Me))return e(Me,Ae);for(var Se=Me.length,ve=Y?Se:-1,ze=Object(Me);(Y?ve--:++ve<Se)&&Ae(ze[ve],ve,ze)!==!1;);return Me}}return _createBaseEach=$,_createBaseEach}var _baseEach,hasRequired_baseEach;function require_baseEach(){if(hasRequired_baseEach)return _baseEach;hasRequired_baseEach=1;var ye=require_baseForOwn(),$=require_createBaseEach(),e=$(ye);return _baseEach=e,_baseEach}var _baseMap,hasRequired_baseMap;function require_baseMap(){if(hasRequired_baseMap)return _baseMap;hasRequired_baseMap=1;var ye=require_baseEach(),$=requireIsArrayLike();function e(Y,Me){var Ae=-1,Se=$(Y)?Array(Y.length):[];return ye(Y,function(ve,ze,Te){Se[++Ae]=Me(ve,ze,Te)}),Se}return _baseMap=e,_baseMap}var map_1,hasRequiredMap;function requireMap(){if(hasRequiredMap)return map_1;hasRequiredMap=1;var ye=require_arrayMap(),$=require_baseIteratee(),e=require_baseMap(),Y=requireIsArray();function Me(Ae,Se){var ve=Y(Ae)?ye:e;return ve(Ae,$(Se,3))}return map_1=Me,map_1}var hasRequiredFlattenNames;function requireFlattenNames(){if(hasRequiredFlattenNames)return flattenNames;hasRequiredFlattenNames=1,Object.defineProperty(flattenNames,"__esModule",{value:!0}),flattenNames.flattenNames=void 0;var ye=requireIsString(),$=ze(ye),e=requireForOwn(),Y=ze(e),Me=requireIsPlainObject(),Ae=ze(Me),Se=requireMap(),ve=ze(Se);function ze(we){return we&&we.__esModule?we:{default:we}}var Te=flattenNames.flattenNames=function we(){var De=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],Ie=[];return(0,ve.default)(De,function(Ce){Array.isArray(Ce)?we(Ce).map(function(Ne){return Ie.push(Ne)}):(0,Ae.default)(Ce)?(0,Y.default)(Ce,function(Ne,$e){Ne===!0&&Ie.push($e),Ie.push($e+"-"+Ne)}):(0,$.default)(Ce)&&Ie.push(Ce)}),Ie};return flattenNames.default=Te,flattenNames}var mergeClasses={},hasRequiredMergeClasses;function requireMergeClasses(){if(hasRequiredMergeClasses)return mergeClasses;hasRequiredMergeClasses=1,Object.defineProperty(mergeClasses,"__esModule",{value:!0}),mergeClasses.mergeClasses=void 0;var ye=requireForOwn(),$=Ae(ye),e=requireCloneDeep(),Y=Ae(e),Me=Object.assign||function(ve){for(var ze=1;ze<arguments.length;ze++){var Te=arguments[ze];for(var we in Te)Object.prototype.hasOwnProperty.call(Te,we)&&(ve[we]=Te[we])}return ve};function Ae(ve){return ve&&ve.__esModule?ve:{default:ve}}var Se=mergeClasses.mergeClasses=function(ze){var Te=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],we=ze.default&&(0,Y.default)(ze.default)||{};return Te.map(function(De){var Ie=ze[De];return Ie&&(0,$.default)(Ie,function(Ce,Ne){we[Ne]||(we[Ne]={}),we[Ne]=Me({},we[Ne],Ie[Ne])}),De}),we};return mergeClasses.default=Se,mergeClasses}var autoprefix={},hasRequiredAutoprefix;function requireAutoprefix(){if(hasRequiredAutoprefix)return autoprefix;hasRequiredAutoprefix=1,Object.defineProperty(autoprefix,"__esModule",{value:!0}),autoprefix.autoprefix=void 0;var ye=requireForOwn(),$=Y(ye),e=Object.assign||function(Se){for(var ve=1;ve<arguments.length;ve++){var ze=arguments[ve];for(var Te in ze)Object.prototype.hasOwnProperty.call(ze,Te)&&(Se[Te]=ze[Te])}return Se};function Y(Se){return Se&&Se.__esModule?Se:{default:Se}}var Me={borderRadius:function(ve){return{msBorderRadius:ve,MozBorderRadius:ve,OBorderRadius:ve,WebkitBorderRadius:ve,borderRadius:ve}},boxShadow:function(ve){return{msBoxShadow:ve,MozBoxShadow:ve,OBoxShadow:ve,WebkitBoxShadow:ve,boxShadow:ve}},userSelect:function(ve){return{WebkitTouchCallout:ve,KhtmlUserSelect:ve,MozUserSelect:ve,msUserSelect:ve,WebkitUserSelect:ve,userSelect:ve}},flex:function(ve){return{WebkitBoxFlex:ve,MozBoxFlex:ve,WebkitFlex:ve,msFlex:ve,flex:ve}},flexBasis:function(ve){return{WebkitFlexBasis:ve,flexBasis:ve}},justifyContent:function(ve){return{WebkitJustifyContent:ve,justifyContent:ve}},transition:function(ve){return{msTransition:ve,MozTransition:ve,OTransition:ve,WebkitTransition:ve,transition:ve}},transform:function(ve){return{msTransform:ve,MozTransform:ve,OTransform:ve,WebkitTransform:ve,transform:ve}},absolute:function(ve){var ze=ve&&ve.split(" ");return{position:"absolute",top:ze&&ze[0],right:ze&&ze[1],bottom:ze&&ze[2],left:ze&&ze[3]}},extend:function(ve,ze){var Te=ze[ve];return Te||{extend:ve}}},Ae=autoprefix.autoprefix=function(ve){var ze={};return(0,$.default)(ve,function(Te,we){var De={};(0,$.default)(Te,function(Ie,Ce){var Ne=Me[Ce];Ne?De=e({},De,Ne(Ie)):De[Ce]=Ie}),ze[we]=De}),ze};return autoprefix.default=Ae,autoprefix}var hover={},hasRequiredHover;function requireHover(){if(hasRequiredHover)return hover;hasRequiredHover=1,Object.defineProperty(hover,"__esModule",{value:!0}),hover.hover=void 0;var ye=Object.assign||function(ze){for(var Te=1;Te<arguments.length;Te++){var we=arguments[Te];for(var De in we)Object.prototype.hasOwnProperty.call(we,De)&&(ze[De]=we[De])}return ze},$=requireReact(),e=Y($);function Y(ze){return ze&&ze.__esModule?ze:{default:ze}}function Me(ze,Te){if(!(ze instanceof Te))throw new TypeError("Cannot call a class as a function")}function Ae(ze,Te){if(!ze)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return Te&&(typeof Te=="object"||typeof Te=="function")?Te:ze}function Se(ze,Te){if(typeof Te!="function"&&Te!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof Te);ze.prototype=Object.create(Te&&Te.prototype,{constructor:{value:ze,enumerable:!1,writable:!0,configurable:!0}}),Te&&(Object.setPrototypeOf?Object.setPrototypeOf(ze,Te):ze.__proto__=Te)}var ve=hover.hover=function(Te){var we=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"span";return function(De){Se(Ie,De);function Ie(){var Ce,Ne,$e,Le;Me(this,Ie);for(var Fe=arguments.length,We=Array(Fe),je=0;je<Fe;je++)We[je]=arguments[je];return Le=(Ne=($e=Ae(this,(Ce=Ie.__proto__||Object.getPrototypeOf(Ie)).call.apply(Ce,[this].concat(We))),$e),$e.state={hover:!1},$e.handleMouseOver=function(){return $e.setState({hover:!0})},$e.handleMouseOut=function(){return $e.setState({hover:!1})},$e.render=function(){return e.default.createElement(we,{onMouseOver:$e.handleMouseOver,onMouseOut:$e.handleMouseOut},e.default.createElement(Te,ye({},$e.props,$e.state)))},Ne),Ae($e,Le)}return Ie}(e.default.Component)};return hover.default=ve,hover}var active={},hasRequiredActive;function requireActive(){if(hasRequiredActive)return active;hasRequiredActive=1,Object.defineProperty(active,"__esModule",{value:!0}),active.active=void 0;var ye=Object.assign||function(ze){for(var Te=1;Te<arguments.length;Te++){var we=arguments[Te];for(var De in we)Object.prototype.hasOwnProperty.call(we,De)&&(ze[De]=we[De])}return ze},$=requireReact(),e=Y($);function Y(ze){return ze&&ze.__esModule?ze:{default:ze}}function Me(ze,Te){if(!(ze instanceof Te))throw new TypeError("Cannot call a class as a function")}function Ae(ze,Te){if(!ze)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return Te&&(typeof Te=="object"||typeof Te=="function")?Te:ze}function Se(ze,Te){if(typeof Te!="function"&&Te!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof Te);ze.prototype=Object.create(Te&&Te.prototype,{constructor:{value:ze,enumerable:!1,writable:!0,configurable:!0}}),Te&&(Object.setPrototypeOf?Object.setPrototypeOf(ze,Te):ze.__proto__=Te)}var ve=active.active=function(Te){var we=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"span";return function(De){Se(Ie,De);function Ie(){var Ce,Ne,$e,Le;Me(this,Ie);for(var Fe=arguments.length,We=Array(Fe),je=0;je<Fe;je++)We[je]=arguments[je];return Le=(Ne=($e=Ae(this,(Ce=Ie.__proto__||Object.getPrototypeOf(Ie)).call.apply(Ce,[this].concat(We))),$e),$e.state={active:!1},$e.handleMouseDown=function(){return $e.setState({active:!0})},$e.handleMouseUp=function(){return $e.setState({active:!1})},$e.render=function(){return e.default.createElement(we,{onMouseDown:$e.handleMouseDown,onMouseUp:$e.handleMouseUp},e.default.createElement(Te,ye({},$e.props,$e.state)))},Ne),Ae($e,Le)}return Ie}(e.default.Component)};return active.default=ve,active}var loop={},hasRequiredLoop;function requireLoop(){if(hasRequiredLoop)return loop;hasRequiredLoop=1,Object.defineProperty(loop,"__esModule",{value:!0});var ye=function(e,Y){var Me={},Ae=function(ve){var ze=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;Me[ve]=ze};return e===0&&Ae("first-child"),e===Y-1&&Ae("last-child"),(e===0||e%2===0)&&Ae("even"),Math.abs(e%2)===1&&Ae("odd"),Ae("nth-child",e),Me};return loop.default=ye,loop}var hasRequiredLib$2;function requireLib$2(){if(hasRequiredLib$2)return lib$2;hasRequiredLib$2=1,Object.defineProperty(lib$2,"__esModule",{value:!0}),lib$2.ReactCSS=lib$2.loop=lib$2.handleActive=lib$2.handleHover=lib$2.hover=void 0;var ye=requireFlattenNames(),$=Ie(ye),e=requireMergeClasses(),Y=Ie(e),Me=requireAutoprefix(),Ae=Ie(Me),Se=requireHover(),ve=Ie(Se),ze=requireActive(),Te=Ie(ze),we=requireLoop(),De=Ie(we);function Ie(Ne){return Ne&&Ne.__esModule?Ne:{default:Ne}}lib$2.hover=ve.default,lib$2.handleHover=ve.default,lib$2.handleActive=Te.default,lib$2.loop=De.default;var Ce=lib$2.ReactCSS=function($e){for(var Le=arguments.length,Fe=Array(Le>1?Le-1:0),We=1;We<Le;We++)Fe[We-1]=arguments[We];var je=(0,$.default)(Fe),Ue=(0,Y.default)($e,je);return(0,Ae.default)(Ue)};return lib$2.default=Ce,lib$2}var libExports$1=requireLib$2();const reactCSS=getDefaultExportFromCjs$1(libExports$1);var calculateChange$2=function ye($,e,Y,Me,Ae){var Se=Ae.clientWidth,ve=Ae.clientHeight,ze=typeof $.pageX=="number"?$.pageX:$.touches[0].pageX,Te=typeof $.pageY=="number"?$.pageY:$.touches[0].pageY,we=ze-(Ae.getBoundingClientRect().left+window.pageXOffset),De=Te-(Ae.getBoundingClientRect().top+window.pageYOffset);if(Y==="vertical"){var Ie=void 0;if(De<0?Ie=0:De>ve?Ie=1:Ie=Math.round(De*100/ve)/100,e.a!==Ie)return{h:e.h,s:e.s,l:e.l,a:Ie,source:"rgb"}}else{var Ce=void 0;if(we<0?Ce=0:we>Se?Ce=1:Ce=Math.round(we*100/Se)/100,Me!==Ce)return{h:e.h,s:e.s,l:e.l,a:Ce,source:"rgb"}}return null},checkboardCache={},render=function ye($,e,Y,Me){if(typeof document>"u"&&!Me)return null;var Ae=Me?new Me:document.createElement("canvas");Ae.width=Y*2,Ae.height=Y*2;var Se=Ae.getContext("2d");return Se?(Se.fillStyle=$,Se.fillRect(0,0,Ae.width,Ae.height),Se.fillStyle=e,Se.fillRect(0,0,Y,Y),Se.translate(Y,Y),Se.fillRect(0,0,Y,Y),Ae.toDataURL()):null},get$1=function ye($,e,Y,Me){var Ae=$+"-"+e+"-"+Y+(Me?"-server":"");if(checkboardCache[Ae])return checkboardCache[Ae];var Se=render($,e,Y,Me);return checkboardCache[Ae]=Se,Se},_extends$p=Object.assign||function(ye){for(var $=1;$<arguments.length;$++){var e=arguments[$];for(var Y in e)Object.prototype.hasOwnProperty.call(e,Y)&&(ye[Y]=e[Y])}return ye},Checkboard=function ye($){var e=$.white,Y=$.grey,Me=$.size,Ae=$.renderers,Se=$.borderRadius,ve=$.boxShadow,ze=$.children,Te=reactCSS({default:{grid:{borderRadius:Se,boxShadow:ve,absolute:"0px 0px 0px 0px",background:"url("+get$1(e,Y,Me,Ae.canvas)+") center left"}}});return reactExports.isValidElement(ze)?React.cloneElement(ze,_extends$p({},ze.props,{style:_extends$p({},ze.props.style,Te.grid)})):React.createElement("div",{style:Te.grid})};Checkboard.defaultProps={size:8,white:"transparent",grey:"rgba(0,0,0,.08)",renderers:{}};var _extends$o=Object.assign||function(ye){for(var $=1;$<arguments.length;$++){var e=arguments[$];for(var Y in e)Object.prototype.hasOwnProperty.call(e,Y)&&(ye[Y]=e[Y])}return ye},_createClass$c=function(){function ye($,e){for(var Y=0;Y<e.length;Y++){var Me=e[Y];Me.enumerable=Me.enumerable||!1,Me.configurable=!0,"value"in Me&&(Me.writable=!0),Object.defineProperty($,Me.key,Me)}}return function($,e,Y){return e&&ye($.prototype,e),Y&&ye($,Y),$}}();function _classCallCheck$c(ye,$){if(!(ye instanceof $))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn$c(ye,$){if(!ye)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return $&&(typeof $=="object"||typeof $=="function")?$:ye}function _inherits$c(ye,$){if(typeof $!="function"&&$!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof $);ye.prototype=Object.create($&&$.prototype,{constructor:{value:ye,enumerable:!1,writable:!0,configurable:!0}}),$&&(Object.setPrototypeOf?Object.setPrototypeOf(ye,$):ye.__proto__=$)}var Alpha=function(ye){_inherits$c($,ye);function $(){var e,Y,Me,Ae;_classCallCheck$c(this,$);for(var Se=arguments.length,ve=Array(Se),ze=0;ze<Se;ze++)ve[ze]=arguments[ze];return Ae=(Y=(Me=_possibleConstructorReturn$c(this,(e=$.__proto__||Object.getPrototypeOf($)).call.apply(e,[this].concat(ve))),Me),Me.handleChange=function(Te){var we=calculateChange$2(Te,Me.props.hsl,Me.props.direction,Me.props.a,Me.container);we&&typeof Me.props.onChange=="function"&&Me.props.onChange(we,Te)},Me.handleMouseDown=function(Te){Me.handleChange(Te),window.addEventListener("mousemove",Me.handleChange),window.addEventListener("mouseup",Me.handleMouseUp)},Me.handleMouseUp=function(){Me.unbindEventListeners()},Me.unbindEventListeners=function(){window.removeEventListener("mousemove",Me.handleChange),window.removeEventListener("mouseup",Me.handleMouseUp)},Y),_possibleConstructorReturn$c(Me,Ae)}return _createClass$c($,[{key:"componentWillUnmount",value:function(){this.unbindEventListeners()}},{key:"render",value:function(){var Y=this,Me=this.props.rgb,Ae=reactCSS({default:{alpha:{absolute:"0px 0px 0px 0px",borderRadius:this.props.radius},checkboard:{absolute:"0px 0px 0px 0px",overflow:"hidden",borderRadius:this.props.radius},gradient:{absolute:"0px 0px 0px 0px",background:"linear-gradient(to right, rgba("+Me.r+","+Me.g+","+Me.b+`, 0) 0%,
695
695
  rgba(`+Me.r+","+Me.g+","+Me.b+", 1) 100%)",boxShadow:this.props.shadow,borderRadius:this.props.radius},container:{position:"relative",height:"100%",margin:"0 3px"},pointer:{position:"absolute",left:Me.a*100+"%"},slider:{width:"4px",borderRadius:"1px",height:"8px",boxShadow:"0 0 2px rgba(0, 0, 0, .6)",background:"#fff",marginTop:"1px",transform:"translateX(-2px)"}},vertical:{gradient:{background:"linear-gradient(to bottom, rgba("+Me.r+","+Me.g+","+Me.b+`, 0) 0%,
696
696
  rgba(`+Me.r+","+Me.g+","+Me.b+", 1) 100%)"},pointer:{left:0,top:Me.a*100+"%"}},overwrite:_extends$o({},this.props.style)},{vertical:this.props.direction==="vertical",overwrite:!0});return React.createElement("div",{style:Ae.alpha},React.createElement("div",{style:Ae.checkboard},React.createElement(Checkboard,{renderers:this.props.renderers})),React.createElement("div",{style:Ae.gradient}),React.createElement("div",{style:Ae.container,ref:function(ve){return Y.container=ve},onMouseDown:this.handleMouseDown,onTouchMove:this.handleChange,onTouchStart:this.handleChange},React.createElement("div",{style:Ae.pointer},this.props.pointer?React.createElement(this.props.pointer,this.props):React.createElement("div",{style:Ae.slider}))))}}]),$}(reactExports.PureComponent||reactExports.Component),_createClass$b=function(){function ye($,e){for(var Y=0;Y<e.length;Y++){var Me=e[Y];Me.enumerable=Me.enumerable||!1,Me.configurable=!0,"value"in Me&&(Me.writable=!0),Object.defineProperty($,Me.key,Me)}}return function($,e,Y){return e&&ye($.prototype,e),Y&&ye($,Y),$}}();function _defineProperty$c(ye,$,e){return $ in ye?Object.defineProperty(ye,$,{value:e,enumerable:!0,configurable:!0,writable:!0}):ye[$]=e,ye}function _classCallCheck$b(ye,$){if(!(ye instanceof $))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn$b(ye,$){if(!ye)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return $&&(typeof $=="object"||typeof $=="function")?$:ye}function _inherits$b(ye,$){if(typeof $!="function"&&$!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof $);ye.prototype=Object.create($&&$.prototype,{constructor:{value:ye,enumerable:!1,writable:!0,configurable:!0}}),$&&(Object.setPrototypeOf?Object.setPrototypeOf(ye,$):ye.__proto__=$)}var DEFAULT_ARROW_OFFSET=1,UP_KEY_CODE=38,DOWN_KEY_CODE=40,VALID_KEY_CODES=[UP_KEY_CODE,DOWN_KEY_CODE],isValidKeyCode=function ye($){return VALID_KEY_CODES.indexOf($)>-1},getNumberValue=function ye($){return Number(String($).replace(/%/g,""))},idCounter=1,EditableInput=function(ye){_inherits$b($,ye);function $(e){_classCallCheck$b(this,$);var Y=_possibleConstructorReturn$b(this,($.__proto__||Object.getPrototypeOf($)).call(this));return Y.handleBlur=function(){Y.state.blurValue&&Y.setState({value:Y.state.blurValue,blurValue:null})},Y.handleChange=function(Me){Y.setUpdatedValue(Me.target.value,Me)},Y.handleKeyDown=function(Me){var Ae=getNumberValue(Me.target.value);if(!isNaN(Ae)&&isValidKeyCode(Me.keyCode)){var Se=Y.getArrowOffset(),ve=Me.keyCode===UP_KEY_CODE?Ae+Se:Ae-Se;Y.setUpdatedValue(ve,Me)}},Y.handleDrag=function(Me){if(Y.props.dragLabel){var Ae=Math.round(Y.props.value+Me.movementX);Ae>=0&&Ae<=Y.props.dragMax&&Y.props.onChange&&Y.props.onChange(Y.getValueObjectWithLabel(Ae),Me)}},Y.handleMouseDown=function(Me){Y.props.dragLabel&&(Me.preventDefault(),Y.handleDrag(Me),window.addEventListener("mousemove",Y.handleDrag),window.addEventListener("mouseup",Y.handleMouseUp))},Y.handleMouseUp=function(){Y.unbindEventListeners()},Y.unbindEventListeners=function(){window.removeEventListener("mousemove",Y.handleDrag),window.removeEventListener("mouseup",Y.handleMouseUp)},Y.state={value:String(e.value).toUpperCase(),blurValue:String(e.value).toUpperCase()},Y.inputId="rc-editable-input-"+idCounter++,Y}return _createClass$b($,[{key:"componentDidUpdate",value:function(Y,Me){this.props.value!==this.state.value&&(Y.value!==this.props.value||Me.value!==this.state.value)&&(this.input===document.activeElement?this.setState({blurValue:String(this.props.value).toUpperCase()}):this.setState({value:String(this.props.value).toUpperCase(),blurValue:!this.state.blurValue&&String(this.props.value).toUpperCase()}))}},{key:"componentWillUnmount",value:function(){this.unbindEventListeners()}},{key:"getValueObjectWithLabel",value:function(Y){return _defineProperty$c({},this.props.label,Y)}},{key:"getArrowOffset",value:function(){return this.props.arrowOffset||DEFAULT_ARROW_OFFSET}},{key:"setUpdatedValue",value:function(Y,Me){var Ae=this.props.label?this.getValueObjectWithLabel(Y):Y;this.props.onChange&&this.props.onChange(Ae,Me),this.setState({value:Y})}},{key:"render",value:function(){var Y=this,Me=reactCSS({default:{wrap:{position:"relative"}},"user-override":{wrap:this.props.style&&this.props.style.wrap?this.props.style.wrap:{},input:this.props.style&&this.props.style.input?this.props.style.input:{},label:this.props.style&&this.props.style.label?this.props.style.label:{}},"dragLabel-true":{label:{cursor:"ew-resize"}}},{"user-override":!0},this.props);return React.createElement("div",{style:Me.wrap},React.createElement("input",{id:this.inputId,style:Me.input,ref:function(Se){return Y.input=Se},value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,onBlur:this.handleBlur,placeholder:this.props.placeholder,spellCheck:"false"}),this.props.label&&!this.props.hideLabel?React.createElement("label",{htmlFor:this.inputId,style:Me.label,onMouseDown:this.handleMouseDown},this.props.label):null)}}]),$}(reactExports.PureComponent||reactExports.Component),calculateChange$1=function ye($,e,Y,Me){var Ae=Me.clientWidth,Se=Me.clientHeight,ve=typeof $.pageX=="number"?$.pageX:$.touches[0].pageX,ze=typeof $.pageY=="number"?$.pageY:$.touches[0].pageY,Te=ve-(Me.getBoundingClientRect().left+window.pageXOffset),we=ze-(Me.getBoundingClientRect().top+window.pageYOffset);if(e==="vertical"){var De=void 0;if(we<0)De=359;else if(we>Se)De=0;else{var Ie=-(we*100/Se)+100;De=360*Ie/100}if(Y.h!==De)return{h:De,s:Y.s,l:Y.l,a:Y.a,source:"hsl"}}else{var Ce=void 0;if(Te<0)Ce=0;else if(Te>Ae)Ce=359;else{var Ne=Te*100/Ae;Ce=360*Ne/100}if(Y.h!==Ce)return{h:Ce,s:Y.s,l:Y.l,a:Y.a,source:"hsl"}}return null},_createClass$a=function(){function ye($,e){for(var Y=0;Y<e.length;Y++){var Me=e[Y];Me.enumerable=Me.enumerable||!1,Me.configurable=!0,"value"in Me&&(Me.writable=!0),Object.defineProperty($,Me.key,Me)}}return function($,e,Y){return e&&ye($.prototype,e),Y&&ye($,Y),$}}();function _classCallCheck$a(ye,$){if(!(ye instanceof $))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn$a(ye,$){if(!ye)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return $&&(typeof $=="object"||typeof $=="function")?$:ye}function _inherits$a(ye,$){if(typeof $!="function"&&$!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof $);ye.prototype=Object.create($&&$.prototype,{constructor:{value:ye,enumerable:!1,writable:!0,configurable:!0}}),$&&(Object.setPrototypeOf?Object.setPrototypeOf(ye,$):ye.__proto__=$)}var Hue=function(ye){_inherits$a($,ye);function $(){var e,Y,Me,Ae;_classCallCheck$a(this,$);for(var Se=arguments.length,ve=Array(Se),ze=0;ze<Se;ze++)ve[ze]=arguments[ze];return Ae=(Y=(Me=_possibleConstructorReturn$a(this,(e=$.__proto__||Object.getPrototypeOf($)).call.apply(e,[this].concat(ve))),Me),Me.handleChange=function(Te){var we=calculateChange$1(Te,Me.props.direction,Me.props.hsl,Me.container);we&&typeof Me.props.onChange=="function"&&Me.props.onChange(we,Te)},Me.handleMouseDown=function(Te){Me.handleChange(Te),window.addEventListener("mousemove",Me.handleChange),window.addEventListener("mouseup",Me.handleMouseUp)},Me.handleMouseUp=function(){Me.unbindEventListeners()},Y),_possibleConstructorReturn$a(Me,Ae)}return _createClass$a($,[{key:"componentWillUnmount",value:function(){this.unbindEventListeners()}},{key:"unbindEventListeners",value:function(){window.removeEventListener("mousemove",this.handleChange),window.removeEventListener("mouseup",this.handleMouseUp)}},{key:"render",value:function(){var Y=this,Me=this.props.direction,Ae=Me===void 0?"horizontal":Me,Se=reactCSS({default:{hue:{absolute:"0px 0px 0px 0px",borderRadius:this.props.radius,boxShadow:this.props.shadow},container:{padding:"0 2px",position:"relative",height:"100%",borderRadius:this.props.radius},pointer:{position:"absolute",left:this.props.hsl.h*100/360+"%"},slider:{marginTop:"1px",width:"4px",borderRadius:"1px",height:"8px",boxShadow:"0 0 2px rgba(0, 0, 0, .6)",background:"#fff",transform:"translateX(-2px)"}},vertical:{pointer:{left:"0px",top:-(this.props.hsl.h*100/360)+100+"%"}}},{vertical:Ae==="vertical"});return React.createElement("div",{style:Se.hue},React.createElement("div",{className:"hue-"+Ae,style:Se.container,ref:function(ze){return Y.container=ze},onMouseDown:this.handleMouseDown,onTouchMove:this.handleChange,onTouchStart:this.handleChange},React.createElement("style",null,`
697
697
  .hue-horizontal {
@@ -808,4 +808,4 @@ The app's main file \`${ye}\` has
808
808
  not been pushed to GitHub. Please add it to continue.
809
809
  `,allowHTML:!1})}}const StyledParagraph=newStyled("p",{target:"edgwnvj0"})({textAlign:"justify"});function NoRepositoryDetected(){return{title:"Unable to deploy",body:jsxs(StyledParagraph,{children:["The app’s code is not connected to a remote GitHub repository. To deploy on Streamlit Community Cloud, please put your code in a GitHub repository and publish the current branch. Read more in"," ",jsx$1("a",{href:STREAMLIT_COMMUNITY_CLOUD_DOCS_URL,rel:"noopener noreferrer",target:"_blank",children:"our documentation"}),"."]})}}function ModalBody({children:ye}){const{colors:$,fontSizes:e,spacing:Y}=useTheme();return jsx$1(ModalBody$2,{style:{marginTop:Y.none,marginLeft:Y.none,marginRight:Y.none,marginBottom:Y.none,paddingTop:Y.md,paddingRight:Y.none,paddingBottom:Y.none,paddingLeft:Y.none,color:$.bodyText,fontSize:e.md,overflowY:"auto"},children:ye})}function DeployModal(ye){const{children:$,onClose:e}=ye;return jsxs(Modal,{isOpen:!0,closeable:!0,onClose:e,size:"auto",children:[jsx$1(ModalHeader,{children:"Deploy this app using..."}),jsx$1(ModalBody,{children:$})]})}function DeployCard(ye){const{colors:$,spacing:e,radii:Y,breakpoints:Me,sizes:Ae}=useTheme(),{children:Se}=ye;return jsx$1(Card,{overrides:{Root:{style:{borderTopWidth:Ae.borderWidth,borderBottomWidth:Ae.borderWidth,borderLeftWidth:Ae.borderWidth,borderRightWidth:Ae.borderWidth,borderTopStyle:"solid",borderBottomStyle:"none",borderLeftStyle:"none",borderRightStyle:"solid",borderTopColor:$.borderColor,borderBottomColor:$.borderColor,borderLeftColor:$.borderColor,borderRightColor:$.borderColor,borderTopLeftRadius:"none",borderTopRightRadius:"none",borderBottomLeftRadius:"none",borderBottomRightRadius:"none",":last-child":{borderRightStyle:"none",borderBottomRightRadius:Y.xl},":first-child":{borderBottomLeftRadius:Y.xl},[`@media (max-width: ${Me.md})`]:{":last-child":{borderBottomLeftRadius:Y.xl}}}},Contents:{style:{marginBottom:0,marginTop:0,marginLeft:0,marginRight:0,height:"100%"}},Body:{style:{padding:e.twoXL,marginBottom:0,marginTop:0,marginLeft:0,marginRight:0,height:"100%",display:"flex",flexDirection:"column",[`@media (max-width: ${Me.md})`]:{padding:e.xl}}}},children:Se})}const Checkmark="data:image/svg+xml,%3csvg%20width='12'%20height='9'%20viewBox='0%200%2012%209'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M4.00009%206.78L1.68676%204.46667C1.42676%204.20667%201.00676%204.20667%200.746758%204.46667C0.486758%204.72667%200.486758%205.14667%200.746758%205.40667L3.53342%208.19334C3.79342%208.45334%204.21342%208.45334%204.47342%208.19334L11.5268%201.14C11.7868%200.880005%2011.7868%200.460005%2011.5268%200.200005C11.2668%20-0.0599951%2010.8468%20-0.0599951%2010.5868%200.200005L4.00009%206.78Z'%20fill='%23808495'/%3e%3c/svg%3e",StyledHeader=newStyled("div",{target:"edlp5wu0"})(({theme:ye})=>({fontFamily:ye.fonts.sansSerif,fontWeight:ye.fontWeights.bold,fontSize:ye.fontSizes.lg,color:ye.colors.grey90,marginTop:ye.spacing.twoXL,marginBottom:ye.spacing.twoXS,[`@media (max-width: ${ye.breakpoints.md})`]:{marginTop:ye.spacing.md}})),StyledSubheader=newStyled("div",{target:"edlp5wu1"})(({theme:ye})=>({fontFamily:ye.fonts.sansSerif,fontWeight:ye.fontWeights.normal,fontSize:ye.fontSizes.md,color:ye.colors.grey90,marginTop:ye.spacing.twoXS,marginBottom:ye.spacing.md,[`@media (max-width: ${ye.breakpoints.md})`]:{marginTop:ye.spacing.md}})),StyledCardContainer=newStyled("div",{target:"edlp5wu2"})(({theme:ye})=>({display:"grid",maxWidth:`calc(1.25 * ${ye.sizes.contentMaxWidth})`,gridTemplateColumns:"1fr 1fr 1fr",gridGap:ye.spacing.none,[`@media (max-width: ${ye.breakpoints.md})`]:{gridTemplateColumns:"1fr"}})),StyledElement=newStyled("div",{target:"edlp5wu3"})(({theme:ye})=>({display:"inline-flex",marginTop:ye.spacing.sm,"& > span":{fontFamily:ye.fonts.sansSerif,fontWeight:ye.fontWeights.normal,fontSize:ye.fontSizes.md,marginLeft:ye.spacing.twoXL,color:ye.colors.gray70},"& > img":{position:"absolute",marginTop:ye.spacing.sm}})),StyledActionsWrapper=newStyled("div",{target:"edlp5wu4"})(({theme:ye})=>({display:"flex",marginTop:ye.spacing.threeXL,"& > button":{marginRight:ye.spacing.twoXL},[`@media (max-width: ${ye.breakpoints.md})`]:{marginTop:ye.spacing.xl}}));function DeployListElement(ye){const{children:$}=ye;return jsxs(StyledElement,{children:[jsx$1("img",{src:Checkmark,alt:"Checkmark"}),jsx$1("span",{children:$})]})}const{GitStates}=GitInfo,openUrl=ye=>{window.open(ye,"_blank")},getDeployAppUrl=ye=>{if(ye){const $=new URL(DEPLOY_URL);return $.searchParams.set("repository",ye.repository??""),$.searchParams.set("branch",ye.branch??""),$.searchParams.set("mainModule",ye.module??""),$.toString()}return STREAMLIT_CLOUD_URL};function DeployDialog(ye){const{gitInfo:$}=reactExports.useContext(AppContext),{onClose:e,metricsMgr:Y}=ye,Me=reactExports.useCallback(()=>{const{showDeployError:Ae,isDeployErrorModalOpen:Se,metricsMgr:ve}=ye;if(ve.enqueue("menuClick",{label:"deployButtonInDialog"}),!$){const Ne=NoRepositoryDetected();Ae(Ne.title,Ne.body);return}const{repository:ze,branch:Te,module:we,untrackedFiles:De,state:Ie}=$;if((!ze||!Te||!we)&&Ie===GitStates.DEFAULT){const Ne=NoRepositoryDetected();Ae(Ne.title,Ne.body);return}if(Ie===GitStates.HEAD_DETACHED){const Ne=DetachedHead();Ae(Ne.title,Ne.body);return}if(we&&(De!=null&&De.includes(we))){const Ne=ModuleIsNotAdded(we);Ae(Ne.title,Ne.body);return}Se&&e(),openUrl(getDeployAppUrl($))},[ye,e,$]);return jsx$1(DeployModal,{onClose:e,children:jsxs(StyledCardContainer,{children:[jsxs(DeployCard,{children:[jsxs(Body,{style:{flexGrow:1},children:[jsx$1("img",{src:StreamlitLogo,alt:"Streamlit Logo","data-testid":"stDeployDialogCommunityCloudIcon"}),jsx$1(StyledHeader,{children:"Streamlit Community Cloud"}),jsx$1(StyledSubheader,{children:"For community, always free"}),jsx$1(DeployListElement,{children:"For personal hobbies and learning"}),jsx$1(DeployListElement,{children:"Deploy unlimited public apps"}),jsx$1(DeployListElement,{children:"Explore and learn from Streamlit’s community and popular apps"})]}),jsx$1(Action,{children:jsxs(StyledActionsWrapper,{children:[jsx$1(BaseButton,{kind:BaseButtonKind.PRIMARY,onClick:Me,children:"Deploy now"}),jsx$1(BaseButton,{onClick:()=>{Y.enqueue("menuClick",{label:"readMoreCommunityCloudInDeployDialog"}),openUrl(STREAMLIT_COMMUNITY_CLOUD_DOCS_URL)},kind:BaseButtonKind.MINIMAL,children:"Learn more"})]})})]}),jsxs(DeployCard,{children:[jsxs(Body,{style:{flexGrow:1},children:[jsx$1("img",{src:Snowflake,alt:"Snowflake","data-testid":"stDeployDialogSnowflakeDeploymentIcon"}),jsx$1(StyledHeader,{children:"Snowflake"}),jsx$1(StyledSubheader,{children:"For enterprise"}),jsx$1(DeployListElement,{children:"Enterprise-level security, support, and fully managed infrastructure"}),jsx$1(DeployListElement,{children:"Deploy unlimited private apps with role-based sharing"}),jsx$1(DeployListElement,{children:"Integrate with Snowflake’s full data stack"})]}),jsx$1(Action,{children:jsxs(StyledActionsWrapper,{children:[jsx$1(BaseButton,{kind:BaseButtonKind.SECONDARY,onClick:()=>{Y.enqueue("menuClick",{label:"startTrialInDeployDialog"}),openUrl(SNOWFLAKE_TRIAL_URL)},children:"Start trial"}),jsx$1(BaseButton,{onClick:()=>{Y.enqueue("menuClick",{label:"learnMoreSnowflakeInDeployDialog"}),openUrl(SNOWFLAKE_LEARN_MORE_URL)},kind:BaseButtonKind.MINIMAL,children:"Learn more"})]})})]}),jsxs(DeployCard,{children:[jsxs(Body,{style:{flexGrow:2},children:[jsx$1("img",{src:Rocket,alt:"Rocket","data-testid":"stDeployDialogCustomDeploymentIcon"}),jsx$1(StyledHeader,{children:"Other platforms"}),jsx$1(StyledSubheader,{children:"For custom deployment "}),jsx$1(DeployListElement,{children:"Deploy on your own hardware or cloud service"}),jsx$1(DeployListElement,{children:"Set up and maintain your own authentication, resources, and costs"})]}),jsx$1(Action,{children:jsx$1(StyledActionsWrapper,{children:jsx$1(BaseButton,{onClick:()=>{Y.enqueue("menuClick",{label:"readMoreDeployTutorialInDeployDialog"}),openUrl(STREAMLIT_DEPLOY_TUTORIAL_URL)},kind:BaseButtonKind.MINIMAL,children:"Learn more"})})})]})]})})}function StreamlitDialog(ye){switch(ye.type){case DialogType.ABOUT:return aboutDialog(ye);case DialogType.CLEAR_CACHE:return clearCacheDialog(ye);case DialogType.SETTINGS:return settingsDialog(ye);case DialogType.SCRIPT_COMPILE_ERROR:return scriptCompileErrorDialog(ye);case DialogType.THEME_CREATOR:return jsx$1(ThemeCreatorDialog,{...ye});case DialogType.WARNING:return warningDialog(ye);case DialogType.DEPLOY_DIALOG:return jsx$1(DeployDialog,{...ye});case DialogType.DEPLOY_ERROR:return deployErrorDialog(ye);case void 0:return noDialog(ye);default:return typeNotRecognizedDialog(ye)}}function aboutDialog(ye){if(ye.aboutSectionMd){const $={overflowY:"auto",overflowX:"hidden",maxHeight:"35vh"},e=`
810
810
  `,Y=[`Made with Streamlit v${ye.sessionInfo.current.streamlitVersion}`,STREAMLIT_HOME_URL,`Copyright ${new Date().getFullYear()} Snowflake Inc. All rights reserved.`].join(e),Me=`${ye.aboutSectionMd} ${e} ${e} ${Y}`;return jsxs(Modal,{isOpen:!0,onClose:ye.onClose,children:[jsx$1(ModalHeader,{children:"About"}),jsx$1(ModalBody$1,{children:jsx$1(StyledAboutInfo,{children:jsx$1(StreamlitMarkdown$1,{source:Me,allowHTML:!1,style:$})})})]})}return jsxs(Modal,{isOpen:!0,onClose:ye.onClose,children:[jsx$1(ModalHeader,{children:"Made with"}),jsx$1(ModalBody$1,{children:jsxs("div",{children:[ye.sessionInfo.isSet&&jsxs(Fragment,{children:["Streamlit v",ye.sessionInfo.current.streamlitVersion,jsx$1("br",{})]}),jsx$1(StyledAboutLink,{href:STREAMLIT_HOME_URL,children:STREAMLIT_HOME_URL}),jsx$1("br",{}),"Copyright ",new Date().getFullYear()," Snowflake Inc. All rights reserved."]})})]})}function clearCacheDialog(ye){const e=["**Are you sure you want to clear the app's function caches?**","This will remove all cached entries from functions using","`@st.cache_data` and `@st.cache_resource`."].join(`
811
- `);return jsx$1("div",{"data-testid":"stClearCacheDialog",children:jsxs(Modal,{isOpen:!0,onClose:ye.onClose,children:[jsx$1(ModalHeader,{children:"Clear caches"}),jsx$1(ModalBody$1,{children:jsx$1(StreamlitMarkdown$1,{source:e,allowHTML:!1})}),jsxs(ModalFooter,{children:[jsx$1(ModalButton,{kind:BaseButtonKind.GHOST,onClick:ye.onClose,children:"Cancel"}),jsx$1(ModalButton,{autoFocus:!0,kind:BaseButtonKind.SECONDARY,onClick:ye.confirmCallback,children:"Clear caches"})]})]})})}function scriptCompileErrorDialog(ye){var $;return jsxs(Modal,{isOpen:!0,onClose:ye.onClose,size:"auto",autoFocus:!1,children:[jsx$1(ModalHeader,{children:"Script execution error"}),jsx$1(ModalBody$1,{children:jsx$1(StreamlitSyntaxHighlighter$1,{showLineNumbers:!1,wrapLines:!1,children:($=ye.exception)!=null&&$.message?ye.exception.message:"No message"})}),jsx$1(ModalFooter,{children:jsx$1(ModalButton,{kind:BaseButtonKind.SECONDARY,onClick:ye.onClose,children:"Close"})})]})}function settingsDialog(ye){return jsx$1(SettingsDialog,{...ye})}function warningDialog(ye){return jsxs(Modal,{isOpen:!0,onClose:ye.onClose,children:[jsx$1(ModalHeader,{children:ye.title}),jsx$1(ModalBody$1,{children:ye.msg})]})}function deployErrorDialog({title:ye,msg:$,onClose:e,onContinue:Y,onTryAgain:Me}){const Ae=()=>{e(),Y&&Y()};return jsxs(Modal,{isOpen:!0,onClose:e,children:[jsx$1(ModalHeader,{children:ye}),jsx$1(ModalBody$1,{children:jsx$1(StyledDeployErrorContent,{children:$})}),jsxs(ModalFooter,{children:[jsx$1(ModalButton,{kind:BaseButtonKind.GHOST,onClick:Me,children:"Try again"}),jsx$1(ModalButton,{kind:BaseButtonKind.SECONDARY,onClick:Ae,children:Y?"Continue anyway":"Close"})]})]})}function noDialog({onClose:ye}){return jsx$1(Modal,{isOpen:!1,onClose:ye})}function typeNotRecognizedDialog(ye){return jsx$1(Modal,{isOpen:!0,onClose:ye.onClose,children:jsx$1(ModalBody$1,{children:`Dialog type "${ye.type}" not recognized.`})})}class SessionEventDispatcher{constructor(){this.onSessionEvent=new distExports.Signal}handleSessionEventMsg($){this.onSessionEvent.emit($)}}var _baseSet,hasRequired_baseSet;function require_baseSet(){if(hasRequired_baseSet)return _baseSet;hasRequired_baseSet=1;var ye=require_assignValue(),$=require_castPath(),e=require_isIndex(),Y=requireIsObject(),Me=require_toKey();function Ae(Se,ve,ze,Te){if(!Y(Se))return Se;ve=$(ve,Se);for(var we=-1,De=ve.length,Ie=De-1,Ce=Se;Ce!=null&&++we<De;){var Ne=Me(ve[we]),$e=ze;if(Ne==="__proto__"||Ne==="constructor"||Ne==="prototype")return Se;if(we!=Ie){var Le=Ce[Ne];$e=Te?Te(Le,Ne,Ce):void 0,$e===void 0&&($e=Y(Le)?Le:e(ve[we+1])?[]:{})}ye(Ce,Ne,$e),Ce=Ce[Ne]}return Se}return _baseSet=Ae,_baseSet}var _basePickBy,hasRequired_basePickBy;function require_basePickBy(){if(hasRequired_basePickBy)return _basePickBy;hasRequired_basePickBy=1;var ye=require_baseGet(),$=require_baseSet(),e=require_castPath();function Y(Me,Ae,Se){for(var ve=-1,ze=Ae.length,Te={};++ve<ze;){var we=Ae[ve],De=ye(Me,we);Se(De,we)&&$(Te,e(we,Me),De)}return Te}return _basePickBy=Y,_basePickBy}var _basePick,hasRequired_basePick;function require_basePick(){if(hasRequired_basePick)return _basePick;hasRequired_basePick=1;var ye=require_basePickBy(),$=requireHasIn();function e(Y,Me){return ye(Y,Me,function(Ae,Se){return $(Y,Se)})}return _basePick=e,_basePick}var pick_1,hasRequiredPick;function requirePick(){if(hasRequiredPick)return pick_1;hasRequiredPick=1;var ye=require_basePick(),$=require_flatRest(),e=$(function(Y,Me){return Y==null?{}:ye(Y,Me)});return pick_1=e,pick_1}var pickExports=requirePick();const pick=getDefaultExportFromCjs$1(pickExports),DEFAULT_METRICS_CONFIG="https://data.streamlit.io/metrics.json",LOG$2=loglevelExports$1.getLogger("MetricsManager");class MetricsManager{constructor($){this.initialized=!1,this.actuallySendMetrics=!1,this.metricsUrl=void 0,this.sendMessageToHost=()=>{},this.anonymousId="",this.pendingEvents=[],this.appHash="Not initialized",this.metadata={},this.setAppHash=e=>{this.appHash=e},this.setMetricsConfig=(e="")=>{this.metricsUrl=e},this.sessionInfo=$}async initialize({gatherUsageStats:$,sendMessageToHost:e}){this.sendMessageToHost=e,this.actuallySendMetrics=$&&this.metricsUrl!=="off",this.getAnonymousId(),this.actuallySendMetrics&&!this.metricsUrl&&(await this.requestDefaultMetricsConfig(),this.metricsUrl||(LOG$2.error("Undefined metrics config - deactivating metrics tracking."),this.actuallySendMetrics=!1)),this.actuallySendMetrics&&this.sendPendingEvents(),LOG$2.info("Gather usage stats: ",this.actuallySendMetrics),this.initialized=!0}enqueue($,e={}){if(!this.initialized||!this.sessionInfo.isSet){this.pendingEvents.push([$,e]);return}this.actuallySendMetrics&&(this.pendingEvents.length&&this.sendPendingEvents(),this.send($,e))}setMetadata($){this.metadata=$}async requestDefaultMetricsConfig(){const $=p$3();if($){const e=window.localStorage.getItem("stMetricsConfig");if(e){this.metricsUrl=e;return}}try{const e=await fetch(DEFAULT_METRICS_CONFIG,{signal:AbortSignal.timeout(5e3)});if(!e.ok)this.metricsUrl=void 0,LOG$2.error("Failed to fetch metrics config: ",e.status);else{const Y=await e.json();this.metricsUrl=Y.url??void 0,$&&this.metricsUrl&&window.localStorage.setItem("stMetricsConfig",this.metricsUrl)}}catch(e){LOG$2.error("Failed to fetch metrics config:",e)}}send($,e={}){const Y=this.buildEventProto($,e);this.metricsUrl==="postMessage"?this.postMessageEvent($,Y):this.track(Y)}sendPendingEvents(){this.pendingEvents.forEach(([$,e])=>{this.send($,e)}),this.pendingEvents=[]}async track($){const e=new Request(this.metricsUrl,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify($.toJSON())});await fetch(e)}postMessageEvent($,e){this.sendMessageToHost({type:"METRICS_EVENT",eventName:$,data:e})}buildEventProto($,e){const Y=new MetricsEvent({event:$,anonymousId:this.anonymousId,...this.getHostTrackingData(),...this.getInstallationData(),reportHash:this.appHash,dev:IS_DEV_ENV,source:"browser",streamlitVersion:this.sessionInfo.current.streamlitVersion,isHello:this.sessionInfo.isHello,...this.getContextData()});if($==="menuClick")Y.label=e.label;else if($==="pageProfile")return new MetricsEvent({...Y,...e});return Y}getInstallationData(){return{machineIdV3:this.sessionInfo.current.installationIdV3}}getHostTrackingData(){return this.metadata?pick(this.metadata,["hostedAt","owner","repo","branch","mainModule","creatorId"]):{}}getContextData(){return{contextPageUrl:window.location.href,contextPageTitle:document.title,contextPagePath:window.location.pathname,contextPageReferrer:document.referrer,contextPageSearch:window.location.search,contextLocale:window.navigator.language,contextUserAgent:window.navigator.userAgent}}getAnonymousId(){if(!this.actuallySendMetrics)return;const $="ajs_anonymous_id",e=p$3(),Y=f$2($),Me=e?window.localStorage.getItem($):null,Ae=new Date;if(Ae.setFullYear(new Date().getFullYear()+1),Y)this.anonymousId=Y,e&&window.localStorage.setItem($,Y);else if(Me){try{this.anonymousId=JSON.parse(Me)}catch{this.anonymousId=Me}setCookie($,this.anonymousId,Ae)}else this.anonymousId=v4(),setCookie($,this.anonymousId,Ae),e&&window.localStorage.setItem($,this.anonymousId)}}const StyledApp=newStyled("div",{target:"ee4bbma0"})(({theme:ye})=>{const $=hasLightBackgroundColor(ye);return{position:"absolute",background:ye.colors.bgColor,color:ye.colors.bodyText,top:ye.spacing.none,left:ye.spacing.none,right:ye.spacing.none,bottom:ye.spacing.none,colorScheme:$?"light":"dark",overflow:"hidden","@media print":{float:"none",height:ye.sizes.full,position:"static",overflow:"visible"}}}),StyledRecordAudioLabel=newStyled("label",{target:"ej964cx0"})({margin:0}),StyledInstruction=newStyled("p",{target:"ej964cx1"})({margin:0}),ScreencastDialog=({onClose:ye,toggleRecordAudio:$,recordAudio:e,startRecording:Y})=>{const[Me,Ae]=reactExports.useState(e),Se=reactExports.useCallback(ze=>{const{checked:Te}=ze.target;Te!==Me&&(Ae(Te),$())},[Me,$]),ve=reactExports.useCallback(()=>{Y(),ye()},[Y,ye]);return jsxs(Modal,{isOpen:!0,onClose:ye,children:[jsx$1(ModalHeader,{children:"Record a screencast"}),jsxs(ModalBody$1,{children:[jsx$1("p",{children:"This will record a video with the contents of your screen, so you can easily share what you're seeing with others."}),jsx$1("p",{children:jsxs(StyledRecordAudioLabel,{"data-testid":"stScreencastAudioCheckbox",children:[jsx$1("input",{type:"checkbox",name:"recordAudio",checked:Me,onChange:Se})," ","Also record audio"]})}),jsx$1(StyledInstruction,{"data-testid":"stScreencastInstruction",children:jsx$1(StreamlitMarkdown$1,{source:"Press `Esc` any time to stop recording.",allowHTML:!1})})]}),jsx$1(ModalFooter,{children:jsx$1(ModalButton,{kind:BaseButtonKind.SECONDARY,onClick:ve,children:"Start recording!"})})]})},StyledVideo=newStyled("video",{target:"emkt0dj0"})(({theme:ye})=>({width:ye.sizes.full,borderRadius:ye.radii.md})),StyledDialogContainer=newStyled("div",{target:"emkt0dj1"})(({theme:ye})=>({display:"flex",flexDirection:"column",width:ye.sizes.full})),StyledRow=newStyled("div",{target:"emkt0dj2"})(({theme:ye})=>({display:"flex",flexDirection:"row",paddingTop:ye.spacing.md,paddingBottom:ye.spacing.md})),StyledFirstColumn=newStyled("div",{target:"emkt0dj3"})(({theme:ye})=>({paddingRight:ye.spacing.lg,textAlign:"right",color:ye.colors.gray,fontWeight:ye.fontWeights.bold,width:"6em"})),StyledSecondColumn=newStyled("div",{target:"emkt0dj4"})(({theme:ye})=>({flex:1,paddingRight:ye.spacing.lg,marginRight:"6em",[`@media (max-width: ${ye.breakpoints.sm})`]:{marginRight:ye.spacing.none}})),StyledVideoFormatInstructions=newStyled("p",{target:"emkt0dj5"})(({theme:ye})=>({marginTop:ye.spacing.sm,marginBottom:ye.spacing.none,fontSize:ye.fontSizes.sm})),StyledDownloadButtonContainer=newStyled("div",{target:"emkt0dj6"})(({theme:ye})=>({marginTop:ye.spacing.twoXS})),VideoRecordedDialog=({onClose:ye,videoBlob:$,fileName:e})=>{const Y=URL.createObjectURL($),Me=()=>{const Ae=document.createElement("a");Ae.setAttribute("href",Y),Ae.setAttribute("download",`${e}.webm`),Ae.click(),ye()};return jsxs(Modal,{isOpen:!0,onClose:ye,overrides:{Dialog:{style:{width:"80vw"}}},children:[jsx$1(ModalHeader,{children:"Next steps"}),jsx$1(ModalBody$1,{children:jsxs(StyledDialogContainer,{"data-testid":"stVideoRecordedDialog",children:[jsxs(StyledRow,{children:[jsx$1(StyledFirstColumn,{children:"Step 1"}),jsxs(StyledSecondColumn,{children:[jsx$1("p",{children:"Preview your video below:"}),jsx$1(StyledVideo,{src:Y,controls:!0})]})]}),jsxs(StyledRow,{children:[jsx$1(StyledFirstColumn,{children:"Step 2"}),jsxs(StyledSecondColumn,{children:[jsx$1(StyledDownloadButtonContainer,{children:jsx$1(BaseButton,{kind:BaseButtonKind.SECONDARY,onClick:Me,children:"Save video to disk"})}),jsxs(StyledVideoFormatInstructions,{children:["This video is encoded in the"," ",jsx$1("a",{href:"https://www.webmproject.org/",children:"WebM format"}),", which is only supported by newer video players. You can also play it by dragging the file directly into your browser."]})]})]}),jsxs(StyledRow,{children:[jsx$1(StyledFirstColumn,{children:"Step 3"}),jsxs(StyledSecondColumn,{children:["Share your video with the world on Twitter, LinkedIn, YouTube, or just plain email!"," ",jsx$1("span",{role:"img","aria-label":"Happy",children:"😀"})]})]})]})})]})},StyledScreenCastWarningDialog=newStyled("div",{target:"e1o5y2010"})({display:"flex"}),StyledUnsupportedScreenCastIcon=newStyled("div",{target:"e1o5y2011"})(({theme:ye})=>({display:"flex",alignItems:"center",justifyItems:"center",marginRight:ye.spacing.twoXL,marginLeft:ye.spacing.sm,fontSize:ye.fontSizes.fourXL})),StyledUnsupportedScreenCastExplanation=newStyled("p",{target:"e1o5y2012"})(({theme:ye})=>({margin:ye.spacing.none})),UnsupportedBrowserDialog=({onClose:ye})=>jsxs(Modal,{isOpen:!0,onClose:ye,children:[jsx$1(ModalHeader,{children:"Record a screencast"}),jsx$1(ModalBody$1,{children:jsxs(StyledScreenCastWarningDialog,{"data-testid":"stUnsupportedBrowserDialog",children:[jsx$1(StyledUnsupportedScreenCastIcon,{children:jsx$1("span",{role:"img","aria-label":"Alien Monster",children:"👾"})}),jsx$1(StyledUnsupportedScreenCastExplanation,{children:"Due to limitations with some browsers, this feature is only supported on recent desktop versions of Chrome, Firefox, and Edge."})]})})]}),UnsupportedBrowserDialog$1=reactExports.memo(UnsupportedBrowserDialog),screencastCounterAnimation=keyframes("0%{opacity:0;}25%{opacity:1;}100%{opacity:0;}"),StyledCountdown=newStyled("div",{target:"evez3ra0"})(({theme:ye})=>({position:"fixed",display:"flex",justifyContent:"center",alignItems:"center",top:0,left:0,width:ye.sizes.full,height:ye.sizes.full,fontSize:"40vh",color:ye.colors.red,fontWeight:ye.fontWeights.bold,opacity:"0.8",textShadow:`1px 1px 10px ${ye.colors.darkGray}`,transition:"opacity 0.3s ease-in-out",animation:`${screencastCounterAnimation} 1s`})),Countdown=({countdown:ye,endCallback:$})=>{const[e,Y]=reactExports.useState(ye);return jsx$1(StyledCountdown,{"data-testid":"stCountdown",onAnimationEnd:()=>{const Ae=e-1;Ae>=0&&Y(Ae),Ae===0&&$()},children:jsx$1("span",{children:e})},`frame${e}`)},LOG$1=loglevelExports$1.getLogger("withScreencast");function withScreencast(ye){const $=e=>{const{testOverride:Y}=e,Me=reactExports.useRef(null),[Ae,Se]=reactExports.useState("streamlit-screencast"),[ve,ze]=reactExports.useState(!1),[Te,we]=reactExports.useState(void 0),[De,Ie]=reactExports.useState(Y||"OFF"),Ce=reactExports.useCallback(()=>{ze(Ue=>!Ue)},[]),Ne=reactExports.useCallback(async()=>{if(!(De==="OFF"||m$3(Me.current))){if(De==="COUNTDOWN"){Ie("OFF");return}if(De==="RECORDING"){const Ue=Me.current;if(!Ue||Ue.getState()==="inactive")Ie("OFF");else{const Ge=await Ue.stop();we(Ge),Ie("PREVIEW_FILE")}}}},[De]),$e=reactExports.useCallback(async()=>{if(!ScreenCastRecorder.isSupportedBrowser()){Ie("UNSUPPORTED");return}Me.current=new ScreenCastRecorder({recordAudio:ve,onErrorOrStop:()=>{Ne().catch(Ue=>LOG$1.warn(`withScreencast.stopRecording threw an error: ${Ue}`))}});try{await Me.current.initialize()}catch(Ue){LOG$1.warn(`ScreenCastRecorder.initialize error: ${Ue}`),Ie("UNSUPPORTED");return}Ie("COUNTDOWN")},[ve,Ne]),Le=reactExports.useCallback(Ue=>{if(!ScreenCastRecorder.isSupportedBrowser()){Ie("UNSUPPORTED");return}if(De==="OFF"){Se(Ue),Ie("SETUP");return}Ne().catch(Ge=>LOG$1.warn(`withScreencast.stopRecording threw an error: ${Ge}`))},[De,Ne]),Fe=reactExports.useCallback(async()=>{if(m$3(Me.current))throw new Error("Countdown finished but recorder is null");Me.current.start()?Ie("RECORDING"):Ne().catch(Ge=>LOG$1.warn(`withScreencast.stopRecording threw an error: ${Ge}`))},[Ne]),We=reactExports.useCallback(()=>{Ie("OFF")},[]);return jsxs("div",{className:"withScreencast","data-testid":"stScreencast",children:[jsx$1(ye,{...e,screenCast:{currentState:De,toggleRecordAudio:Ce,startRecording:Le,stopRecording:Ne}}),De==="UNSUPPORTED"&&jsx$1(UnsupportedBrowserDialog$1,{onClose:We}),De==="SETUP"&&jsx$1(ScreencastDialog,{recordAudio:ve,onClose:We,startRecording:$e,toggleRecordAudio:Ce}),De==="COUNTDOWN"&&jsx$1(Countdown,{countdown:3,endCallback:Fe}),De==="PREVIEW_FILE"&&Te&&jsx$1(VideoRecordedDialog,{onClose:We,videoBlob:Te,fileName:Ae})]})};return $.displayName=`withScreencast(${ye.displayName||ye.name||"Component"})`,hoistNonReactStatics($,ye)}const showDevelopmentOptions=(ye,$)=>$==Config.ToolbarMode.DEVELOPER?!0:Config.ToolbarMode.VIEWER==$||Config.ToolbarMode.MINIMAL==$?!1:ye||isLocalhost();function getTitle(ye){return ye||"Streamlit"}class StrategyV1{constructor($){this.appNav=$,this.appPages=[],this.currentPageScriptHash=null,this.hideSidebarNav=null}handleNewSession($){var Se,ve;this.appPages=$.appPages,this.currentPageScriptHash=$.pageScriptHash,this.hideSidebarNav=((Se=$.config)==null?void 0:Se.hideSidebarNav)??!1;const e=this.appPages[0],Y=e.urlPathname??"",Me=((ve=this.appPages.find(ze=>ze.pageScriptHash===this.currentPageScriptHash))==null?void 0:ve.urlPathname)??"",Ae=e.pageScriptHash===this.currentPageScriptHash;return this.appNav.onUpdatePageUrl(Y,Me,Ae),document.title=getTitle(Me??""),[{hideSidebarNav:this.hideSidebarNav,appPages:this.appPages,currentPageScriptHash:this.currentPageScriptHash},()=>{this.appNav.hostCommunicationMgr.sendMessageToHost({type:"SET_APP_PAGES",appPages:this.appPages}),this.appNav.hostCommunicationMgr.sendMessageToHost({type:"SET_CURRENT_PAGE_NAME",currentPageName:Ae?"":Me,currentPageScriptHash:this.currentPageScriptHash})}]}handlePagesChanged($){const{appPages:e}=$;return[{appPages:e},()=>{this.appNav.hostCommunicationMgr.sendMessageToHost({type:"SET_APP_PAGES",appPages:e})}]}handlePageNotFound($){var Me;const{pageName:e}=$;this.appNav.onPageNotFound(e);const Y=((Me=this.appPages[0])==null?void 0:Me.pageScriptHash)??"";return this.currentPageScriptHash=Y,[{currentPageScriptHash:Y},()=>{this.appNav.hostCommunicationMgr.sendMessageToHost({type:"SET_CURRENT_PAGE_NAME",currentPageName:"",currentPageScriptHash:Y})}]}handleNavigation($){}findPageByUrlPath($){return this.appPages.length===0?null:this.appPages.find(e=>$.endsWith("/"+e.urlPathname))??this.appPages[0]}clearPageElements($,e,Y){return AppRoot.empty(e,!1,Y,$.logo)}}class StrategyV2{constructor($){this.appNav=$,this.mainScriptHash=null,this.appPages=[],this.mainPage=null,this.hideSidebarNav=null}handleNewSession($){var e;return this.mainScriptHash=$.mainScriptHash,this.hideSidebarNav===null&&(this.hideSidebarNav=((e=$.config)==null?void 0:e.hideSidebarNav)??null),document.title=getTitle(""),[{hideSidebarNav:this.hideSidebarNav??!1},()=>{}]}handlePagesChanged($){}handlePageNotFound($){const{pageName:e}=$;return this.appNav.onPageNotFound(e),[{currentPageScriptHash:this.mainScriptHash??""},()=>{this.appNav.hostCommunicationMgr.sendMessageToHost({type:"SET_CURRENT_PAGE_NAME",currentPageName:"",currentPageScriptHash:this.mainScriptHash??""})}]}handleNavigation($){const{sections:e,position:Y,appPages:Me}=$;this.appPages=Me,this.hideSidebarNav=Y===Navigation.Position.HIDDEN;const Ae=$.pageScriptHash,Se=Me.find(Te=>Te.pageScriptHash===Ae),ve=Me.find(Te=>Te.isDefault);this.mainPage=ve;const ze=Se.urlPathname;if(!this.appNav.isPageTitleSet){const Te=getTitle(Se.pageName);document.title=Te,this.appNav.hostCommunicationMgr.sendMessageToHost({type:"SET_PAGE_TITLE",title:Se.pageName??""})}return!this.appNav.isPageIconSet&&Se.icon&&this.appNav.onPageIconChange(Se.icon),this.appNav.onUpdatePageUrl(ve.urlPathname??"",ze,Se.isDefault??!1),[{appPages:Me,navSections:e,hideSidebarNav:this.hideSidebarNav,expandSidebarNav:$.expanded,currentPageScriptHash:Ae},()=>{this.appNav.hostCommunicationMgr.sendMessageToHost({type:"SET_APP_PAGES",appPages:Me}),this.appNav.hostCommunicationMgr.sendMessageToHost({type:"SET_CURRENT_PAGE_NAME",currentPageName:Se.isDefault?"":ze,currentPageScriptHash:Ae})}]}findPageByUrlPath($){return this.appPages.find(e=>$.endsWith("/"+e.urlPathname))??this.mainPage}clearPageElements($,e,Y){return $.filterMainScriptElements(e)}}class AppNavigation{constructor($,e,Y,Me){this.hostCommunicationMgr=$,this.onUpdatePageUrl=e,this.onPageNotFound=Y,this.onPageIconChange=Me,this.isPageIconSet=!1,this.isPageTitleSet=!1,this.strategy=new StrategyV1(this)}handleNewSession($){return this.isPageTitleSet=!1,this.isPageIconSet=!1,this.strategy.handleNewSession($)}handleNavigation($){return this.strategy instanceof StrategyV1&&(this.strategy=new StrategyV2(this)),this.strategy.handleNavigation($)}handlePagesChanged($){return this.strategy.handlePagesChanged($)}handlePageNotFound($){return this.strategy.handlePageNotFound($)}findPageByUrlPath($){return this.strategy.findPageByUrlPath($)}handlePageConfigChanged($){this.isPageIconSet=!!$.favicon,this.isPageTitleSet=!!$.title}clearPageElements($,e,Y){return this.strategy.clearPageElements($,e,Y)}}var define_PACKAGE_METADATA_default={version:"1.42.2"};const ELEMENT_LIST_BUFFER_TIMEOUT_MS=10,INITIAL_SCRIPT_RUN_ID="<null>",LOG=loglevelExports$1.getLogger("App");class App extends reactExports.PureComponent{constructor($){super($),this.sessionInfo=new SessionInfo,this.metricsMgr=new MetricsManager(this.sessionInfo),this.sessionEventDispatcher=new SessionEventDispatcher,this.embeddingId=generateUID$2(),this.showDeployError=(Y,Me,Ae)=>{this.openDialog({type:DialogType.DEPLOY_ERROR,title:Y,msg:Me,onContinue:Ae,onClose:()=>{},onTryAgain:this.sendLoadGitInfoBackMsg})},this.handleThemeMessage=(Y,Me)=>{const[,Ae,Se]=createPresetThemes(),ve=isPresetTheme(this.props.theme.activeTheme);Y===Ae.name&&ve?this.props.theme.setTheme(Ae):Y===Se.name&&ve?this.props.theme.setTheme(Se):Me&&this.props.theme.setImportedTheme(Me)},this.handleConnectionStateChanged=Y=>{if(LOG.info(`Connection state changed from ${this.state.connectionState} to ${Y}`),Y===ConnectionState.CONNECTED){LOG.info("Reconnected to server.");const Me=this.state.scriptRunState===ScriptRunState.RUNNING,Ae=this.state.scriptRunState===ScriptRunState.RERUN_REQUESTED;(!this.sessionInfo.last||Me||Ae)&&(LOG.info("Requesting a script run."),this.widgetMgr.sendUpdateWidgetsMessage(void 0),this.setState({dialog:null})),this.hostCommunicationMgr.sendMessageToHost({type:"WEBSOCKET_CONNECTED"})}else this.state.connectionState===ConnectionState.CONNECTED&&this.hostCommunicationMgr.sendMessageToHost({type:"WEBSOCKET_DISCONNECTED",attemptingToReconnect:Y!==ConnectionState.DISCONNECTED_FOREVER}),this.sessionInfo.isSet&&this.sessionInfo.clearCurrent();this.setState({connectionState:Y})},this.handleGitInfoChanged=Y=>{this.setState({gitInfo:Y})},this.handleCustomParentMessage=Y=>{this.state.appConfig.enableCustomParentMessages?this.hostCommunicationMgr.sendMessageToHost({type:"CUSTOM_PARENT_MESSAGE",message:Y.message}):LOG.error("Sending messages to the host is disabled in line with the platform policy.")},this.handleMessage=Y=>{const Me=(Ae,Se,ve)=>{const ze=Ae[Se];if(ze in ve)return ve[ze](Ae[ze]);throw new Error(`Cannot handle ${Se} "${ze}".`)};try{Me(Y,"type",{newSession:Ae=>this.handleNewSession(Ae),sessionStatusChanged:Ae=>this.handleSessionStatusChanged(Ae),sessionEvent:Ae=>this.handleSessionEvent(Ae),delta:Ae=>this.handleDeltaMsg(Ae,Y.metadata),pageConfigChanged:Ae=>this.handlePageConfigChanged(Ae),pageInfoChanged:Ae=>this.handlePageInfoChanged(Ae),pagesChanged:Ae=>this.handlePagesChanged(Ae),pageNotFound:Ae=>this.handlePageNotFound(Ae),gitInfoChanged:Ae=>this.handleGitInfoChanged(Ae),scriptFinished:Ae=>this.handleScriptFinished(Ae),pageProfile:Ae=>this.handlePageProfileMsg(Ae),autoRerun:Ae=>this.handleAutoRerun(Ae),fileUrlsResponse:Ae=>this.uploadClient.onFileURLsResponse(Ae),parentMessage:Ae=>this.handleCustomParentMessage(Ae),logo:Ae=>this.handleLogo(Ae,Y.metadata),navigation:Ae=>this.handleNavigation(Ae),authRedirect:Ae=>{isInChildFrame()?this.hostCommunicationMgr.sendMessageToSameOriginHost({type:"REDIRECT_TO_URL",url:Ae.url}):window.location.href=Ae.url}})}catch(Ae){const Se=ensureError(Ae);LOG.error(Se),this.showError("Bad message format",Se.message)}},this.handleLogo=(Y,Me)=>{const Ae={activeScriptHash:Me.activeScriptHash,scriptRunId:this.state.scriptRunId};this.setState({elements:this.pendingElementsBuffer.appRootWithLogo(Y,Ae)},()=>{this.pendingElementsBuffer=this.state.elements})},this.handlePageConfigChanged=Y=>{const{title:Me,favicon:Ae,layout:Se,initialSidebarState:ve,menuItems:ze}=Y;this.appNavigation.handlePageConfigChanged(Y),Me&&(this.hostCommunicationMgr.sendMessageToHost({type:"SET_PAGE_TITLE",title:Me}),document.title=Me),Ae&&this.onPageIconChanged(Ae),Se!==this.state.layout&&this.setState(Te=>({layout:Se,userSettings:{...Te.userSettings,wideMode:Se===PageConfig.Layout.WIDE}})),ve!==this.state.initialSidebarState&&this.setState(()=>({initialSidebarState:ve})),this.setState({menuItems:ze})},this.handlePageInfoChanged=Y=>{const{queryString:Me}=Y,Ae=document.location.pathname+(Me?`?${Me}`:"");window.history.pushState({},"",Ae),this.hostCommunicationMgr.sendMessageToHost({type:"SET_QUERY_PARAM",queryParams:Me?`?${Me}`:""})},this.onPageNotFound=Y=>{const Me=Y?`You have requested page /${Y}, but no corresponding file was found in the app's pages/ directory`:"The page that you have requested does not seem to exist";this.showError("Page not found",`${Me}. Running the app's main page.`)},this.handlePageNotFound=Y=>{this.maybeSetState(this.appNavigation.handlePageNotFound(Y))},this.onPageIconChanged=Y=>{handleFavicon(Y,this.hostCommunicationMgr.sendMessageToHost,this.endpoints)},this.handlePagesChanged=Y=>{this.maybeSetState(this.appNavigation.handlePagesChanged(Y))},this.handleNavigation=Y=>{this.maybeSetState(this.appNavigation.handleNavigation(Y))},this.handlePageProfileMsg=Y=>{var Se,ve,ze;const Me=PageProfile.toObject(Y),Ae=getBrowserInfo();this.metricsMgr.enqueue("pageProfile",{...Me,isFragmentRun:!!Me.isFragmentRun,appId:this.sessionInfo.current.appId,numPages:(Se=this.state.appPages)==null?void 0:Se.length,sessionId:this.sessionInfo.current.sessionId,pythonVersion:this.sessionInfo.current.pythonVersion,pageScriptHash:this.state.currentPageScriptHash,activeTheme:(ze=(ve=this.props.theme)==null?void 0:ve.activeTheme)==null?void 0:ze.name,totalLoadTime:Math.round((performance.now()-this.state.latestRunTime)*1e3),browserInfo:Ae})},this.handleAutoRerun=Y=>{const Me=setInterval(()=>{this.widgetMgr.sendUpdateWidgetsMessage(Y.fragmentId,!0)},Y.interval*1e3);this.setState(Ae=>({autoReruns:[...Ae.autoReruns,Me]}))},this.handleSessionStatusChanged=Y=>{this.setState(Me=>{let{scriptRunState:Ae}=Me,{dialog:Se}=Me;return Y.scriptIsRunning&&Me.scriptRunState!==ScriptRunState.STOP_REQUESTED?(Ae=ScriptRunState.RUNNING,d$2(Se)&&Se.type===DialogType.SCRIPT_COMPILE_ERROR&&(Se=void 0)):!Y.scriptIsRunning&&Me.scriptRunState!==ScriptRunState.RERUN_REQUESTED&&Me.scriptRunState!==ScriptRunState.COMPILATION_ERROR&&(Ae=ScriptRunState.NOT_RUNNING),{userSettings:{...Me.userSettings,runOnSave:!!Y.runOnSave},dialog:Se,scriptRunState:Ae}})},this.handleSessionEvent=Y=>{if(this.sessionEventDispatcher.handleSessionEventMsg(Y),Y.type==="scriptCompilationException"){this.setState({scriptRunState:ScriptRunState.COMPILATION_ERROR});const Me={type:DialogType.SCRIPT_COMPILE_ERROR,exception:Y.scriptCompilationException,onClose:()=>{}};this.openDialog(Me)}},this.maybeUpdatePageUrl=(Y,Me,Ae)=>{const Se=this.getBaseUriParts();if(Se){const{pathname:ve}=Se,ze=extractPageNameFromPathName(document.location.pathname,ve);if((ze===""?Y:ze)!==Me){const we=Ae?"":Me,De=preserveEmbedQueryParams(),Ie=De?`?${De}`:"",Ne=`${ve==="/"?"":ve}/${we}${Ie}`;window.history.pushState({},"",Ne)}}},this.handleNewSession=Y=>{const Me=Y.initialize;if(this.hasStreamlitVersionChanged(Me)){window.location.reload();return}this.sessionInfo.isSet||this.handleOneTimeInitialization(Y);const{appHash:Ae,currentPageScriptHash:Se}=this.state,{scriptRunId:ve,name:ze,mainScriptPath:Te,fragmentIdsThisRun:we,pageScriptHash:De,mainScriptHash:Ie}=Y;if(we.length)this.setState({fragmentIdsThisRun:we,latestRunTime:performance.now()});else{this.cleanupAutoReruns();const Ne=Y.config,$e=Y.customTheme;this.processThemeInput($e),this.setState({allowRunOnSave:Ne.allowRunOnSave,hideTopBar:Ne.hideTopBar,toolbarMode:Ne.toolbarMode,latestRunTime:performance.now(),mainScriptHash:Ie,fragmentIdsThisRun:we}),this.maybeSetState(this.appNavigation.handleNewSession(Y)),this.onPageIconChanged("./favicon.png")}const Ce=hashString(this.sessionInfo.current.installationId+Te);this.metricsMgr.setMetadata(this.state.deployedAppMetadata),this.metricsMgr.setAppHash(Ce),this.metricsMgr.enqueue("updateReport"),Ae===Ce&&Se===De?this.setState({scriptRunId:ve}):this.clearAppState(Ce,ve,ze,Ie)},this.handleOneTimeInitialization=Y=>{const Me=Y.initialize,Ae=Y.config;this.sessionInfo.setCurrent(SessionInfo.propsFromNewSessionMessage(Y)),this.metricsMgr.initialize({gatherUsageStats:Ae.gatherUsageStats,sendMessageToHost:this.hostCommunicationMgr.sendMessageToHost}),this.handleSessionStatusChanged(Me.sessionStatus)},this.onHistoryChange=()=>{const{currentPageScriptHash:Y}=this.state,Me=this.appNavigation.findPageByUrlPath(document.location.pathname),Ae=document.location.toString().includes("#"),Se=(Me==null?void 0:Me.pageScriptHash)===Y;m$3(Me)||Ae&&Se||this.onPageChange(Me.pageScriptHash)},this.setAndSendTheme=Y=>{this.props.theme.setTheme(Y),this.setState({hideColoredLine:!isPresetTheme(Y)}),this.hostCommunicationMgr.sendMessageToHost({type:"SET_THEME_CONFIG",themeInfo:toExportedTheme(Y.emotion)})},this.createThemeHash=Y=>{if(!Y)return"hash_for_undefined_custom_theme";const Me=Object.entries(Y);return Me.sort(),hashString(Me.join(":"))},this.closeDialog=()=>{this.setState({dialog:void 0})},this.saveSettings=Y=>{const{runOnSave:Me}=this.state.userSettings,{runOnSave:Ae}=Y;if(this.setState({userSettings:Y}),Me!==Ae&&this.isServerConnected()){const Se=new BackMsg$1({setRunOnSave:Ae});Se.type="setRunOnSave",this.sendBackMsg(Se)}},this.handleDeltaMsg=(Y,Me)=>{if(this.pendingElementsBuffer=this.pendingElementsBuffer.applyDelta(this.state.scriptRunId,Y,Me),!this.pendingElementsTimerRunning){this.pendingElementsTimerRunning=!0;const Ae=this.state.scriptRunState===ScriptRunState.RUNNING;setTimeout(()=>{this.pendingElementsTimerRunning=!1,Ae&&this.setState({elements:this.pendingElementsBuffer})},ELEMENT_LIST_BUFFER_TIMEOUT_MS)}},this.debugShutdownRuntime=()=>{if(this.isServerConnected()){const Y=new BackMsg$1({debugShutdownRuntime:!0});Y.type="debugShutdownRuntime",this.sendBackMsg(Y)}},this.debugDisconnectWebsocket=()=>{if(this.isServerConnected()){const Y=new BackMsg$1({debugDisconnectWebsocket:!0});Y.type="debugDisconnectWebsocket",this.sendBackMsg(Y)}},this.debugClearForwardMsgCache=()=>{var Y,Me;isLocalhost()&&((Me=(Y=this.connectionManager)==null?void 0:Y.websocketConnection)==null||Me.cache.messages.clear())},this.cleanupAutoReruns=()=>{this.state.autoReruns.forEach(Y=>{clearInterval(Y)}),this.setState({autoReruns:[]})},this.rerunScript=(Y=!1)=>{if(this.closeDialog(),!this.isServerConnected()){LOG.error("Cannot rerun script when disconnected from server.");return}this.state.scriptRunState===ScriptRunState.RUNNING||this.state.scriptRunState===ScriptRunState.RERUN_REQUESTED||(this.setState({scriptRunState:ScriptRunState.RERUN_REQUESTED}),Y===!0&&this.saveSettings({...this.state.userSettings,runOnSave:!0}),this.widgetMgr.sendUpdateWidgetsMessage(void 0))},this.sendLoadGitInfoBackMsg=()=>{if(!this.isServerConnected()){LOG.error("Cannot load git information when disconnected from server.");return}this.sendBackMsg(new BackMsg$1({loadGitInfo:!0}))},this.onPageChange=Y=>{const{elements:Me,mainScriptHash:Ae}=this.state;this.cleanupAutoReruns();const Se=this.appNavigation.clearPageElements(Me,Ae,void 0),ve=new Set(Array.from(Se.getElements()).map(ze=>getElementId(ze)).filter(notUndefined));this.sendRerunBackMsg(this.widgetMgr.getActiveWidgetStates(ve),void 0,Y)},this.isAppInReadyState=Y=>this.state.connectionState===ConnectionState.CONNECTED&&this.state.scriptRunState===ScriptRunState.NOT_RUNNING&&Y.scriptRunState===ScriptRunState.RUNNING&&Y.connectionState===ConnectionState.CONNECTED,this.sendRerunBackMsg=(Y,Me,Ae,Se)=>{const ve=this.getBaseUriParts();if(!ve){LOG.error("Cannot send rerun backMessage when disconnected from server.");return}const{currentPageScriptHash:ze}=this.state,{pathname:Te}=ve;let we=this.getQueryString(),De="";Ae?Ae!=ze&&(we=preserveEmbedQueryParams(),this.hostCommunicationMgr.sendMessageToHost({type:"SET_QUERY_PARAM",queryParams:we})):ze?Ae=ze:(De=extractPageNameFromPathName(document.location.pathname,Te),Ae=""),this.sendBackMsg(new BackMsg$1({rerunScript:{queryString:we,widgetStates:Y,pageScriptHash:Ae,pageName:De,fragmentId:Me,isAutoRerun:Se}}))},this.stopScript=()=>{if(!this.isServerConnected()){LOG.error("Cannot stop app when disconnected from server.");return}if(this.state.scriptRunState===ScriptRunState.NOT_RUNNING||this.state.scriptRunState===ScriptRunState.STOP_REQUESTED)return;const Y=new BackMsg$1({stopScript:!0});Y.type="stopScript",this.sendBackMsg(Y),this.setState({scriptRunState:ScriptRunState.STOP_REQUESTED})},this.openClearCacheDialog=()=>{if(this.isServerConnected()){const Y={type:DialogType.CLEAR_CACHE,confirmCallback:this.clearCache,defaultAction:this.clearCache,onClose:()=>{}};this.openDialog(Y)}else LOG.error("Cannot clear cache: disconnected from server")},this.openDeployDialog=()=>{var Me;const Y={type:DialogType.DEPLOY_DIALOG,onClose:this.closeDialog,showDeployError:this.showDeployError,isDeployErrorModalOpen:((Me=this.state.dialog)==null?void 0:Me.type)===DialogType.DEPLOY_ERROR,metricsMgr:this.metricsMgr};this.openDialog(Y)},this.openThemeCreatorDialog=()=>{this.metricsMgr.enqueue("menuClick",{label:"editTheme"});const Y={type:DialogType.THEME_CREATOR,backToSettings:this.settingsCallback,onClose:this.closeDialog,metricsMgr:this.metricsMgr};this.openDialog(Y)},this.clearCache=()=>{if(this.closeDialog(),this.isServerConnected()){const Y=new BackMsg$1({clearCache:!0});Y.type="clearCache",this.sendBackMsg(Y)}else LOG.error("Cannot clear cache: disconnected from server")},this.sendAppHeartbeat=()=>{if(this.isServerConnected()){const Y=new BackMsg$1({appHeartbeat:!0});Y.type="appHeartbeat",this.sendBackMsg(Y)}else LOG.error("Cannot send app heartbeat: disconnected from server")},this.sendBackMsg=Y=>{this.connectionManager?(LOG.info(Y),this.connectionManager.sendMessage(Y)):LOG.error(`Not connected. Cannot send back message: ${Y}`)},this.handleConnectionError=Y=>{this.showError("Connection error",Y)},this.isServerConnected=()=>this.connectionManager?this.connectionManager.isConnected():!1,this.settingsCallback=(Y=!0)=>{const Me={type:DialogType.SETTINGS,isServerConnected:this.isServerConnected(),settings:this.state.userSettings,allowRunOnSave:this.state.allowRunOnSave,onSave:this.saveSettings,onClose:()=>{},developerMode:showDevelopmentOptions(this.state.isOwner,this.state.toolbarMode),openThemeCreator:this.openThemeCreatorDialog,animateModal:Y,metricsMgr:this.metricsMgr};this.openDialog(Me)},this.aboutCallback=()=>{const{menuItems:Y}=this.state,Me={type:DialogType.ABOUT,sessionInfo:this.sessionInfo,onClose:this.closeDialog,aboutSectionMd:Y==null?void 0:Y.aboutSectionMd};this.openDialog(Me)},this.printCallback=()=>{const{scriptRunState:Y}=this.state;if(Y!==ScriptRunState.NOT_RUNNING){setTimeout(this.printCallback,500);return}let Me;try{const Ae=getIFrameEnclosingApp(this.embeddingId);Ae&&Ae.contentWindow?Me=Ae.contentWindow.window:Me=window}catch{Me=window}finally{Me||(Me=window),Me.print()}},this.screencastCallback=()=>{const{scriptName:Y}=this.state,{startRecording:Me}=this.props.screenCast,Ae=hooks().format("YYYY-MM-DD-HH-MM-SS");Me(`streamlit-${Y}-${Ae}`)},this.handleFullScreen=Y=>{this.setState({isFullScreen:Y})},this.setLibConfig=Y=>{this.setState({libConfig:Y})},this.setAppConfig=Y=>{this.setState({appConfig:Y})},this.addScriptFinishedHandler=Y=>{this.setState((Me,Ae)=>({scriptFinishedHandlers:Me.scriptFinishedHandlers.concat(Y)}))},this.removeScriptFinishedHandler=Y=>{this.setState((Me,Ae)=>({scriptFinishedHandlers:without(Me.scriptFinishedHandlers,Y)}))},this.getBaseUriParts=()=>this.connectionManager?this.connectionManager.getBaseUriParts():void 0,this.getQueryString=()=>{const{queryParams:Y}=this.state,Me=Y&&Y.length>0?Y:document.location.search;return Me.startsWith("?")?Me.substring(1):Me},this.isInCloudEnvironment=()=>{const{hostMenuItems:Y}=this.state;return Y&&(Y==null?void 0:Y.length)>0},this.showDeployButton=()=>showDevelopmentOptions(this.state.isOwner,this.state.toolbarMode)&&!this.isInCloudEnvironment()&&this.sessionInfo.isSet&&!this.sessionInfo.isHello,this.deployButtonClicked=()=>{this.metricsMgr.enqueue("menuClick",{label:"deployButtonInApp"}),this.sendLoadGitInfoBackMsg(),this.openDeployDialog()},this.requestFileURLs=(Y,Me)=>{if(this.isServerConnected()){const Ae=new BackMsg$1({fileUrlsRequest:{requestId:Y,fileNames:Me.map(Se=>Se.name),sessionId:this.sessionInfo.current.sessionId}});Ae.type="fileUrlsRequest",this.sendBackMsg(Ae)}},this.handleKeyDown=Y=>{switch(Y){case"c":showDevelopmentOptions(this.state.isOwner,this.state.toolbarMode)&&this.openClearCacheDialog();break;case"r":this.rerunScript();break}},this.handleKeyUp=Y=>{Y==="esc"&&this.props.screenCast.stopRecording()},J$1();let e=this.createThemeHash();isPresetTheme($.theme.activeTheme)||(e=this.createThemeHash(toThemeInput($.theme.activeTheme.emotion))),this.state={connectionState:ConnectionState.INITIAL,elements:AppRoot.empty("",!0),isFullScreen:!1,scriptName:"",scriptRunId:INITIAL_SCRIPT_RUN_ID,appHash:null,scriptRunState:ScriptRunState.NOT_RUNNING,userSettings:{wideMode:!1,runOnSave:!1},layout:PageConfig.Layout.CENTERED,initialSidebarState:PageConfig.SidebarState.AUTO,menuItems:void 0,allowRunOnSave:!0,scriptFinishedHandlers:[],themeHash:e,gitInfo:null,formsData:createFormsData(),appPages:[],navSections:[],currentPageScriptHash:"",mainScriptHash:"",hideTopBar:!0,hideSidebarNav:!0,hideColoredLine:!1,expandSidebarNav:!1,toolbarMode:Config.ToolbarMode.MINIMAL,latestRunTime:performance.now(),fragmentIdsThisRun:[],isOwner:!1,hostMenuItems:[],hostToolbarItems:[],hostHideSidebarNav:!1,sidebarChevronDownshift:0,pageLinkBaseUrl:"",queryParams:"",deployedAppMetadata:{},libConfig:{},appConfig:{},autoReruns:[],inputsDisabled:!1},this.connectionManager=null,this.widgetMgr=new WidgetStateManager({sendRerunBackMsg:this.sendRerunBackMsg,formsDataChanged:Y=>this.setState({formsData:Y})}),this.hostCommunicationMgr=new HostCommunicationManager({streamlitExecutionStartedAt:$.streamlitExecutionStartedAt,sendRerunBackMsg:this.sendRerunBackMsg,closeModal:this.closeDialog,stopScript:this.stopScript,rerunScript:this.rerunScript,clearCache:this.clearCache,sendAppHeartbeat:this.sendAppHeartbeat,setInputsDisabled:Y=>{this.setState({inputsDisabled:Y})},themeChanged:this.handleThemeMessage,pageChanged:this.onPageChange,isOwnerChanged:Y=>this.setState({isOwner:Y}),fileUploadClientConfigChanged:Y=>{this.endpoints.setFileUploadClientConfig!==void 0&&this.endpoints.setFileUploadClientConfig(Y)},hostMenuItemsChanged:Y=>{this.setState({hostMenuItems:Y})},hostToolbarItemsChanged:Y=>{this.setState({hostToolbarItems:Y})},hostHideSidebarNavChanged:Y=>{this.setState({hostHideSidebarNav:Y})},sidebarChevronDownshiftChanged:Y=>{this.setState({sidebarChevronDownshift:Y})},pageLinkBaseUrlChanged:Y=>{this.setState({pageLinkBaseUrl:Y})},queryParamsChanged:Y=>{this.setState({queryParams:Y})},deployedAppMetadataChanged:Y=>{this.setState({deployedAppMetadata:Y})},restartWebsocketConnection:()=>{this.connectionManager||(this.setState({scriptRunState:ScriptRunState.RERUN_REQUESTED}),this.initializeConnectionManager())},terminateWebsocketConnection:()=>{var Y;(Y=this.connectionManager)==null||Y.disconnect(),this.connectionManager=null}}),this.endpoints=new DefaultStreamlitEndpoints({getServerUri:this.getBaseUriParts,csrfEnabled:!0}),this.uploadClient=new FileUploadClient({sessionInfo:this.sessionInfo,endpoints:this.endpoints,formsWithPendingRequestsChanged:Y=>this.widgetMgr.setFormsWithUploadsInProgress(Y),requestFileURLs:this.requestFileURLs}),this.componentRegistry=new ComponentRegistry(this.endpoints),this.pendingElementsTimerRunning=!1,this.pendingElementsBuffer=this.state.elements,this.appNavigation=new AppNavigation(this.hostCommunicationMgr,this.maybeUpdatePageUrl,this.onPageNotFound,this.onPageIconChanged),window.streamlitDebug={clearForwardMsgCache:this.debugClearForwardMsgCache,disconnectWebsocket:this.debugDisconnectWebsocket,shutdownRuntime:this.debugShutdownRuntime}}initializeConnectionManager(){this.connectionManager=new ConnectionManager({getLastSessionId:()=>{var $;return($=this.sessionInfo.last)==null?void 0:$.sessionId},endpoints:this.endpoints,onMessage:this.handleMessage,onConnectionError:this.handleConnectionError,connectionStateChanged:this.handleConnectionStateChanged,claimHostAuthToken:this.hostCommunicationMgr.claimAuthToken,resetHostAuthToken:this.hostCommunicationMgr.resetAuthToken,onHostConfigResp:$=>{const{allowedOrigins:e,useExternalAuthToken:Y,disableFullscreenMode:Me,enableCustomParentMessages:Ae,mapboxToken:Se,enforceDownloadInNewTab:ve,metricsUrl:ze}=$,Te={allowedOrigins:e,useExternalAuthToken:Y,enableCustomParentMessages:Ae},we={mapboxToken:Se,disableFullscreenMode:Me,enforceDownloadInNewTab:ve};this.metricsMgr.setMetricsConfig(ze),this.hostCommunicationMgr.setAllowedOrigins(Te),this.setAppConfig(Te),this.setLibConfig(we)}})}componentDidMount(){this.initializeConnectionManager(),mark(this.state.scriptRunState),this.hostCommunicationMgr.sendMessageToHost({type:"SCRIPT_RUN_STATE_CHANGED",scriptRunState:this.state.scriptRunState}),isScrollingHidden()&&document.body.classList.add("embedded"),isInChildFrame()&&(window.iFrameResizer={heightCalculationMethod:()=>{const $=document.querySelectorAll("[data-iframe-height]"),e=Array.from($).map(Y=>Math.ceil(Y.getBoundingClientRect().bottom));return Math.max(0,...e)}},__vitePreload(()=>import("./iframeResizer.contentWindow.DlY1zPt7.js").then($=>$.i),[],import.meta.url)),this.hostCommunicationMgr.sendMessageToHost({type:"SET_THEME_CONFIG",themeInfo:toExportedTheme(this.props.theme.activeTheme.emotion)}),this.metricsMgr.enqueue("viewReport"),window.addEventListener("popstate",this.onHistoryChange,!1)}componentDidUpdate($,e){window.prerenderReady===!1&&this.isAppInReadyState(e)&&(window.prerenderReady=!0),this.state.scriptRunState!==e.scriptRunState&&(mark(this.state.scriptRunState),this.state.scriptRunState===ScriptRunState.NOT_RUNNING&&measure("script-run-cycle",ScriptRunState.RUNNING,ScriptRunState.NOT_RUNNING),this.hostCommunicationMgr.sendMessageToHost({type:"SCRIPT_RUN_STATE_CHANGED",scriptRunState:this.state.scriptRunState}))}componentWillUnmount(){var $;($=this.connectionManager)==null||$.disconnect(),this.hostCommunicationMgr.closeHostCommunication(),window.removeEventListener("popstate",this.onHistoryChange,!1)}showError($,e){LOG.error(e);const Y={type:DialogType.WARNING,title:$,msg:jsx$1(StreamlitMarkdown$1,{source:e,allowHTML:!1}),onClose:()=>{}};this.openDialog(Y)}hasStreamlitVersionChanged($){var Y;let e;if(((Y=window.__streamlit)==null?void 0:Y.ENABLE_RELOAD_BASED_ON_HARDCODED_STREAMLIT_VERSION)===!0?e=define_PACKAGE_METADATA_default.version:this.sessionInfo.isSet&&(e=this.sessionInfo.current.streamlitVersion),e){const{environmentInfo:Me}=$;if(d$2(Me)&&d$2(Me.streamlitVersion))return e!=Me.streamlitVersion}return!1}maybeSetState($){if($){const[e,Y]=$;this.setState(e,Y)}}processThemeInput($){const e=this.createThemeHash($);if(e===this.state.themeHash)return;this.setState({themeHash:e});const Y=!isPresetTheme(this.props.theme.activeTheme);if($){const Me=createTheme(CUSTOM_THEME_NAME,$);this.props.theme.addThemes([Me]),(getCachedTheme()===null||Y)&&this.setAndSendTheme(Me)}else this.props.theme.addThemes([]),Y&&this.setAndSendTheme(getHostSpecifiedTheme());$!=null&&$.fontFaces&&this.props.theme.setImportedTheme($)}handleScriptFinished($){if($===ForwardMsg$1.ScriptFinishedStatus.FINISHED_SUCCESSFULLY||$===ForwardMsg$1.ScriptFinishedStatus.FINISHED_EARLY_FOR_RERUN||$===ForwardMsg$1.ScriptFinishedStatus.FINISHED_FRAGMENT_RUN_SUCCESSFULLY){if(window.setTimeout(()=>{this.state.scriptFinishedHandlers.map(e=>e())},0),$===ForwardMsg$1.ScriptFinishedStatus.FINISHED_SUCCESSFULLY||$===ForwardMsg$1.ScriptFinishedStatus.FINISHED_FRAGMENT_RUN_SUCCESSFULLY){this.setState(({scriptRunId:Y,fragmentIdsThisRun:Me})=>({elements:this.pendingElementsBuffer.clearStaleNodes(Y,Me)}),()=>{this.pendingElementsBuffer=this.state.elements});const e=new Set(Array.from(this.state.elements.getElements()).map(Y=>getElementId(Y)).filter(notUndefined));this.widgetMgr.removeInactive(e)}this.connectionManager!==null&&$!==ForwardMsg$1.ScriptFinishedStatus.FINISHED_EARLY_FOR_RERUN&&this.sessionInfo.isSet&&this.connectionManager.incrementMessageCacheRunCount(this.sessionInfo.current.maxCachedMessageAge)}}clearAppState($,e,Y,Me){const{hideSidebarNav:Ae,elements:Se}=this.state,ve=Ae&&Se.sidebar||void 0;this.setState({scriptRunId:e,scriptName:Y,appHash:$,elements:this.appNavigation.clearPageElements(this.pendingElementsBuffer,Me,ve)},()=>{this.pendingElementsBuffer=this.state.elements;const ze=new Set(Array.from(this.state.elements.getElements()).map(Te=>getElementId(Te)).filter(notUndefined));this.widgetMgr.removeInactive(ze)})}openDialog($){this.setState({dialog:$})}render(){const{allowRunOnSave:$,connectionState:e,dialog:Y,elements:Me,initialSidebarState:Ae,menuItems:Se,isFullScreen:ve,scriptRunId:ze,scriptRunState:Te,userSettings:we,hideTopBar:De,hideSidebarNav:Ie,hideColoredLine:Ce,expandSidebarNav:Ne,currentPageScriptHash:$e,hostHideSidebarNav:Le,pageLinkBaseUrl:Fe,sidebarChevronDownshift:We,hostMenuItems:je,hostToolbarItems:Ue,libConfig:Ge,appConfig:He,inputsDisabled:Xe,appPages:st,navSections:Ke}=this.state,Je=showDevelopmentOptions(this.state.isOwner,this.state.toolbarMode),rt=classNames("stApp",getEmbeddingIdClassName(this.embeddingId),{"streamlit-embedded":isEmbed(),"streamlit-wide":we.wideMode}),ut=Y?StreamlitDialog({...Y,onClose:this.closeDialog}):null,ft=Xe||e!==ConnectionState.CONNECTED;return jsx$1(AppContext.Provider,{value:{initialSidebarState:Ae,wideMode:we.wideMode,embedded:isEmbed(),showPadding:!isEmbed()||isPaddingDisplayed(),disableScrolling:isScrollingHidden(),showToolbar:!isEmbed()||isToolbarDisplayed(),showColoredLine:!Ce&&!isEmbed()||isColoredLineDisplayed(),pageLinkBaseUrl:Fe,sidebarChevronDownshift:We,gitInfo:this.state.gitInfo,appConfig:He},children:jsx$1(LibContext.Provider,{value:{isFullScreen:ve,setFullScreen:this.handleFullScreen,addScriptFinishedHandler:this.addScriptFinishedHandler,removeScriptFinishedHandler:this.removeScriptFinishedHandler,activeTheme:this.props.theme.activeTheme,setTheme:this.setAndSendTheme,availableThemes:this.props.theme.availableThemes,addThemes:this.props.theme.addThemes,onPageChange:this.onPageChange,currentPageScriptHash:$e,libConfig:Ge,fragmentIdsThisRun:this.state.fragmentIdsThisRun,locale:window.navigator.language},children:jsx$1(ReactHotkeys,{keyName:"r,c,esc",onKeyDown:this.handleKeyDown,onKeyUp:this.handleKeyUp,children:jsxs(StyledApp,{className:rt,"data-testid":"stApp","data-test-script-state":ze==INITIAL_SCRIPT_RUN_ID?"initial":Te,"data-test-connection-state":e,children:[jsxs(Header,{children:[!De&&jsxs(Fragment,{children:[jsx$1(StatusWidget,{connectionState:e,sessionEventDispatcher:this.sessionEventDispatcher,scriptRunState:Te,rerunScript:this.rerunScript,stopScript:this.stopScript,allowRunOnSave:$}),jsx$1(ToolbarActions,{hostToolbarItems:Ue,sendMessageToHost:this.hostCommunicationMgr.sendMessageToHost,metricsMgr:this.metricsMgr})]}),this.showDeployButton()&&jsx$1(DeployButton,{onClick:this.deployButtonClicked.bind(this)}),jsx$1(MainMenu$1,{isServerConnected:this.isServerConnected(),quickRerunCallback:this.rerunScript,clearCacheCallback:this.openClearCacheDialog,settingsCallback:this.settingsCallback,aboutCallback:this.aboutCallback,printCallback:this.printCallback,screencastCallback:this.screencastCallback,screenCastState:this.props.screenCast.currentState,hostMenuItems:je,developmentMode:Je,sendMessageToHost:this.hostCommunicationMgr.sendMessageToHost,menuItems:Se,metricsMgr:this.metricsMgr,toolbarMode:this.state.toolbarMode})]}),jsx$1(AppView,{endpoints:this.endpoints,sendMessageToHost:this.hostCommunicationMgr.sendMessageToHost,elements:Me,scriptRunId:ze,scriptRunState:Te,widgetMgr:this.widgetMgr,widgetsDisabled:ft,uploadClient:this.uploadClient,componentRegistry:this.componentRegistry,formsData:this.state.formsData,appLogo:Me.logo,appPages:st,navSections:Ke,onPageChange:this.onPageChange,currentPageScriptHash:$e,hideSidebarNav:Ie||Le,expandSidebarNav:Ne}),ut]})})})})}}const AppWithScreenCast=withScreencast(App);function useThemeManager(){const ye=getDefaultTheme(),[$,e]=reactExports.useState(ye),[Y,Me]=reactExports.useState([]),[Ae,Se]=reactExports.useState([...createPresetThemes(),...isPresetTheme(ye)?[]:[ye]]),ve=De=>{Se([...createPresetThemes(),...De])},ze=reactExports.useCallback(De=>{De!==$&&(e(De),De.name===AUTO_THEME_NAME?removeCachedTheme():setCachedTheme(De))},[e,$]),Te=reactExports.useCallback(()=>{$.name===AUTO_THEME_NAME&&ze(getHostSpecifiedTheme());const De=Ae.filter(Ie=>Ie.name!==AUTO_THEME_NAME);Se([createAutoTheme(),...De])},[$.name,Ae,ze]),we=reactExports.useCallback(De=>{De.fontFaces&&Me(De.fontFaces);const Ie=new CustomThemeConfig(De),Ce=createTheme(CUSTOM_THEME_NAME,Ie);ze(Ce)},[Me,ze]);return reactExports.useEffect(()=>{const De=window.matchMedia("(prefers-color-scheme: dark)");return De.addEventListener("change",Te),window.addEventListener("afterprint",Te),()=>{window.removeEventListener("afterprint",Te),De.removeEventListener("change",Te)}},[$,Ae,Te]),[{setTheme:ze,activeTheme:$,addThemes:ve,availableThemes:Ae,setImportedTheme:we},Y]}const ThemedApp=({streamlitExecutionStartedAt:ye})=>{const[$,e]=useThemeManager(),{activeTheme:Y}=$,Me=Y.name===CUSTOM_THEME_NAME&&e.length>0;return jsx$1(RootStyleProvider,{theme:Y,children:jsx$1(WindowDimensionsProvider,{children:jsxs(PortalProvider,{children:[Me&&jsx$1(FontFaceDeclaration,{fontFaces:e}),jsx$1(AppWithScreenCast,{theme:$,streamlitExecutionStartedAt:ye})]})})})},streamlitExecutionStartedAt=Date.now(),engine=new StyletronClient({prefix:"st-"});ReactDOM.render(jsx$1(Provider$1,{value:engine,children:jsx$1(ThemedApp,{streamlitExecutionStartedAt})}),document.getElementById("root"));export{isPeriodType as $,hasLightBackgroundColor as A,jsxs as B,Popover$2 as C,DynamicIcon as D,EmotionIconBase as E,Fragment as F,convertRemToPx as G,ACCESSIBILITY_TYPE as H,requireToString as I,require$$0 as J,m$3 as K,merge$3 as L,d$2 as M,numbro$1 as N,hooks as O,PortalContext as P,lib$3 as Q,React as R,ReactJson as S,TRIGGER_TYPE as T,getLuminance as U,getTimezone as V,moment as W,isUnsignedIntegerType as X,isIntegerType as Y,isDurationType as Z,_extends$K as _,range as a,assertNever as a$,format as a0,isBooleanType as a1,requireIsArray as a2,require_baseKeys as a3,require_getTag as a4,requireIsArguments as a5,requireIsArrayLike as a6,requireIsBuffer$1 as a7,require_isPrototype as a8,requireIsTypedArray as a9,isEqual as aA,StyledTooltipContentWrapper as aB,StreamlitMarkdown$1 as aC,LibContext as aD,Resizable as aE,getBlue80 as aF,getSequentialColorsArray as aG,getDivergingColorsArray as aH,getCategoricalColorsArray as aI,getGray70 as aJ,getGray30 as aK,debounce$3 as aL,Global as aM,require_baseMerge as aN,require_createAssigner as aO,toaster as aP,Kind as aQ,AlertElement$1 as aR,propTypesExports as aS,_assertThisInitialized as aT,StyledInlineCode as aU,ErrorElement as aV,ensureError as aW,Skeleton$1 as aX,Skeleton as aY,hoistNonReactStatics as aZ,parseToRgba as a_,Field as aa,Null as ab,DataFrameCellType as ac,isTimeType as ad,convertTimeToDate as ae,isDecimalType as af,isRangeIndexType as ag,isStringType as ah,isEmptyType as ai,isDatetimeType as aj,isDateType as ak,isObjectType as al,isBytesType as am,isNumericType as an,isCategoricalType as ao,isListType as ap,Arrow$2 as aq,loglevelExports$1 as ar,_defineProperty$n as as,_objectWithoutProperties$f as at,jsx as au,_typeof$b as av,css as aw,transparentize as ax,mix$1 as ay,getStyledCell as az,reactDomExports as b,forkFocus as b$,DeckGlJsonChart$1 as b0,DEFAULT_IFRAME_SANDBOX_POLICY as b1,DEFAULT_IFRAME_FEATURE_POLICY as b2,darken as b3,BaseButtonSize as b4,BaseButtonKind as b5,BaseButtonTooltip as b6,DynamicButtonLabel as b7,Box as b8,IsSidebarContext as b9,StyledWidgetLabelHelpInline as bA,LabelVisibilityMessage as bB,themeColors as bC,libExports as bD,CAMERA_PERMISSION_URL as bE,StyledWidgetLabelHelp as bF,StyledSpinnerIcon as bG,AcceptFileValue as bH,chatInputAcceptFileProtoValueToEnum as bI,isFocusVisible as bJ,getOverride as bK,getOverrideProps as bL,StyledContent as bM,Checkbox$1 as bN,StyledCheckbox$1 as bO,BaseColorPicker$1 as bP,useStyletron as bQ,mergeOverride as bR,toObjectOverride as bS,Icon$1 as bT,requireReactDom as bU,UIDConsumer as bV,StatefulMenu as bW,mergeOverrides as bX,ChevronDown$1 as bY,ThemeContext as bZ,forkBlur as b_,Placement as ba,getIncreasingGreen as bb,getDecreasingRed as bc,getGray90 as bd,PlotlyChart$1 as be,keysToSnakeCase as bf,WindowDimensionsContext as bg,useResizeObserver as bh,withCalculatedWidth as bi,Video$1 as bj,zip as bk,FileUploaderState as bl,UploadedFileInfo as bm,StyledSpinner as bn,ENABLE_PERIPHERALS_DOCS_URL as bo,Icon$2 as bp,BaseButton as bq,blend as br,labelVisibilityProtoValueToEnum as bs,TooltipIcon as bt,WidgetLabel as bu,Tooltip as bv,styled as bw,getOverrides as bx,LocaleContext as by,ButtonGroup$1 as bz,require_hasPath as c,Select as c0,without as c1,fuzzyFilterSelectOptions as c2,VirtualDropdown as c3,TYPE as c4,classNames as c5,UISelectbox as c6,isValidFormId as c7,toPropertyKey as c8,_setPrototypeOf$9 as c9,requireReactIs$1 as cA,NumberInput$1 as cB,hexToRgb as ca,withWrapper as cb,__awaiter as cc,PropTypes as cd,isFromWindows as ce,StyledWidgetInstructions as cf,isFromMac as cg,SIZE$1 as ch,CUSTOM_INPUT_TYPE as ci,ADJOINED as cj,DeleteAlt$1 as ck,filterOptions as cl,ENHANCER_POSITION as cm,pick as cn,Slider$2 as co,ChevronLeft as cp,ChevronRight as cq,isInForm as cr,TextInput$1 as cs,ThemeProvider$1 as ct,createThemedStyled as cu,createThemedUseStyletron as cv,createThemedWithStyle as cw,expandBorderStyles as cx,withStyle as cy,getAugmentedNamespace as cz,requireReact as d,requirePropTypes as e,requireClassnames as f,getDefaultExportFromCjs$1 as g,require_root as h,isPropValid as i,jsx$1 as j,keyframes as k,requireIsObject as l,requireToNumber as m,newStyled as n,require_Set as o,require_setToArray as p,require_SetCache as q,reactExports as r,require_arrayIncludes as s,require_cacheHas as t,require_arrayIncludesWith as u,requireFlatten as v,groupBy as w,__vitePreload as x,useTheme as y,PLACEMENT as z};
811
+ `);return jsx$1("div",{"data-testid":"stClearCacheDialog",children:jsxs(Modal,{isOpen:!0,onClose:ye.onClose,children:[jsx$1(ModalHeader,{children:"Clear caches"}),jsx$1(ModalBody$1,{children:jsx$1(StreamlitMarkdown$1,{source:e,allowHTML:!1})}),jsxs(ModalFooter,{children:[jsx$1(ModalButton,{kind:BaseButtonKind.GHOST,onClick:ye.onClose,children:"Cancel"}),jsx$1(ModalButton,{autoFocus:!0,kind:BaseButtonKind.SECONDARY,onClick:ye.confirmCallback,children:"Clear caches"})]})]})})}function scriptCompileErrorDialog(ye){var $;return jsxs(Modal,{isOpen:!0,onClose:ye.onClose,size:"auto",autoFocus:!1,children:[jsx$1(ModalHeader,{children:"Script execution error"}),jsx$1(ModalBody$1,{children:jsx$1(StreamlitSyntaxHighlighter$1,{showLineNumbers:!1,wrapLines:!1,children:($=ye.exception)!=null&&$.message?ye.exception.message:"No message"})}),jsx$1(ModalFooter,{children:jsx$1(ModalButton,{kind:BaseButtonKind.SECONDARY,onClick:ye.onClose,children:"Close"})})]})}function settingsDialog(ye){return jsx$1(SettingsDialog,{...ye})}function warningDialog(ye){return jsxs(Modal,{isOpen:!0,onClose:ye.onClose,children:[jsx$1(ModalHeader,{children:ye.title}),jsx$1(ModalBody$1,{children:ye.msg})]})}function deployErrorDialog({title:ye,msg:$,onClose:e,onContinue:Y,onTryAgain:Me}){const Ae=()=>{e(),Y&&Y()};return jsxs(Modal,{isOpen:!0,onClose:e,children:[jsx$1(ModalHeader,{children:ye}),jsx$1(ModalBody$1,{children:jsx$1(StyledDeployErrorContent,{children:$})}),jsxs(ModalFooter,{children:[jsx$1(ModalButton,{kind:BaseButtonKind.GHOST,onClick:Me,children:"Try again"}),jsx$1(ModalButton,{kind:BaseButtonKind.SECONDARY,onClick:Ae,children:Y?"Continue anyway":"Close"})]})]})}function noDialog({onClose:ye}){return jsx$1(Modal,{isOpen:!1,onClose:ye})}function typeNotRecognizedDialog(ye){return jsx$1(Modal,{isOpen:!0,onClose:ye.onClose,children:jsx$1(ModalBody$1,{children:`Dialog type "${ye.type}" not recognized.`})})}class SessionEventDispatcher{constructor(){this.onSessionEvent=new distExports.Signal}handleSessionEventMsg($){this.onSessionEvent.emit($)}}var _baseSet,hasRequired_baseSet;function require_baseSet(){if(hasRequired_baseSet)return _baseSet;hasRequired_baseSet=1;var ye=require_assignValue(),$=require_castPath(),e=require_isIndex(),Y=requireIsObject(),Me=require_toKey();function Ae(Se,ve,ze,Te){if(!Y(Se))return Se;ve=$(ve,Se);for(var we=-1,De=ve.length,Ie=De-1,Ce=Se;Ce!=null&&++we<De;){var Ne=Me(ve[we]),$e=ze;if(Ne==="__proto__"||Ne==="constructor"||Ne==="prototype")return Se;if(we!=Ie){var Le=Ce[Ne];$e=Te?Te(Le,Ne,Ce):void 0,$e===void 0&&($e=Y(Le)?Le:e(ve[we+1])?[]:{})}ye(Ce,Ne,$e),Ce=Ce[Ne]}return Se}return _baseSet=Ae,_baseSet}var _basePickBy,hasRequired_basePickBy;function require_basePickBy(){if(hasRequired_basePickBy)return _basePickBy;hasRequired_basePickBy=1;var ye=require_baseGet(),$=require_baseSet(),e=require_castPath();function Y(Me,Ae,Se){for(var ve=-1,ze=Ae.length,Te={};++ve<ze;){var we=Ae[ve],De=ye(Me,we);Se(De,we)&&$(Te,e(we,Me),De)}return Te}return _basePickBy=Y,_basePickBy}var _basePick,hasRequired_basePick;function require_basePick(){if(hasRequired_basePick)return _basePick;hasRequired_basePick=1;var ye=require_basePickBy(),$=requireHasIn();function e(Y,Me){return ye(Y,Me,function(Ae,Se){return $(Y,Se)})}return _basePick=e,_basePick}var pick_1,hasRequiredPick;function requirePick(){if(hasRequiredPick)return pick_1;hasRequiredPick=1;var ye=require_basePick(),$=require_flatRest(),e=$(function(Y,Me){return Y==null?{}:ye(Y,Me)});return pick_1=e,pick_1}var pickExports=requirePick();const pick=getDefaultExportFromCjs$1(pickExports),DEFAULT_METRICS_CONFIG="https://data.streamlit.io/metrics.json",LOG$2=loglevelExports$1.getLogger("MetricsManager");class MetricsManager{constructor($){this.initialized=!1,this.actuallySendMetrics=!1,this.metricsUrl=void 0,this.sendMessageToHost=()=>{},this.anonymousId="",this.pendingEvents=[],this.appHash="Not initialized",this.metadata={},this.setAppHash=e=>{this.appHash=e},this.setMetricsConfig=(e="")=>{this.metricsUrl=e},this.sessionInfo=$}async initialize({gatherUsageStats:$,sendMessageToHost:e}){this.sendMessageToHost=e,this.actuallySendMetrics=$&&this.metricsUrl!=="off",this.getAnonymousId(),this.actuallySendMetrics&&!this.metricsUrl&&(await this.requestDefaultMetricsConfig(),this.metricsUrl||(LOG$2.error("Undefined metrics config - deactivating metrics tracking."),this.actuallySendMetrics=!1)),this.actuallySendMetrics&&this.sendPendingEvents(),LOG$2.info("Gather usage stats: ",this.actuallySendMetrics),this.initialized=!0}enqueue($,e={}){if(!this.initialized||!this.sessionInfo.isSet){this.pendingEvents.push([$,e]);return}this.actuallySendMetrics&&(this.pendingEvents.length&&this.sendPendingEvents(),this.send($,e))}setMetadata($){this.metadata=$}async requestDefaultMetricsConfig(){const $=p$3();if($){const e=window.localStorage.getItem("stMetricsConfig");if(e){this.metricsUrl=e;return}}try{const e=await fetch(DEFAULT_METRICS_CONFIG,{signal:AbortSignal.timeout(5e3)});if(!e.ok)this.metricsUrl=void 0,LOG$2.error("Failed to fetch metrics config: ",e.status);else{const Y=await e.json();this.metricsUrl=Y.url??void 0,$&&this.metricsUrl&&window.localStorage.setItem("stMetricsConfig",this.metricsUrl)}}catch(e){LOG$2.error("Failed to fetch metrics config:",e)}}send($,e={}){const Y=this.buildEventProto($,e);this.metricsUrl==="postMessage"?this.postMessageEvent($,Y):this.track(Y)}sendPendingEvents(){this.pendingEvents.forEach(([$,e])=>{this.send($,e)}),this.pendingEvents=[]}async track($){const e=new Request(this.metricsUrl,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify($.toJSON())});await fetch(e)}postMessageEvent($,e){this.sendMessageToHost({type:"METRICS_EVENT",eventName:$,data:e})}buildEventProto($,e){const Y=new MetricsEvent({event:$,anonymousId:this.anonymousId,...this.getHostTrackingData(),...this.getInstallationData(),reportHash:this.appHash,dev:IS_DEV_ENV,source:"browser",streamlitVersion:this.sessionInfo.current.streamlitVersion,isHello:this.sessionInfo.isHello,...this.getContextData()});if($==="menuClick")Y.label=e.label;else if($==="pageProfile")return new MetricsEvent({...Y,...e});return Y}getInstallationData(){return{machineIdV3:this.sessionInfo.current.installationIdV3}}getHostTrackingData(){return this.metadata?pick(this.metadata,["hostedAt","owner","repo","branch","mainModule","creatorId"]):{}}getContextData(){return{contextPageUrl:window.location.href,contextPageTitle:document.title,contextPagePath:window.location.pathname,contextPageReferrer:document.referrer,contextPageSearch:window.location.search,contextLocale:window.navigator.language,contextUserAgent:window.navigator.userAgent}}getAnonymousId(){if(!this.actuallySendMetrics)return;const $="ajs_anonymous_id",e=p$3(),Y=f$2($),Me=e?window.localStorage.getItem($):null,Ae=new Date;if(Ae.setFullYear(new Date().getFullYear()+1),Y)this.anonymousId=Y,e&&window.localStorage.setItem($,Y);else if(Me){try{this.anonymousId=JSON.parse(Me)}catch{this.anonymousId=Me}setCookie($,this.anonymousId,Ae)}else this.anonymousId=v4(),setCookie($,this.anonymousId,Ae),e&&window.localStorage.setItem($,this.anonymousId)}}const StyledApp=newStyled("div",{target:"ee4bbma0"})(({theme:ye})=>{const $=hasLightBackgroundColor(ye);return{position:"absolute",background:ye.colors.bgColor,color:ye.colors.bodyText,top:ye.spacing.none,left:ye.spacing.none,right:ye.spacing.none,bottom:ye.spacing.none,colorScheme:$?"light":"dark",overflow:"hidden","@media print":{float:"none",height:ye.sizes.full,position:"static",overflow:"visible"}}}),StyledRecordAudioLabel=newStyled("label",{target:"ej964cx0"})({margin:0}),StyledInstruction=newStyled("p",{target:"ej964cx1"})({margin:0}),ScreencastDialog=({onClose:ye,toggleRecordAudio:$,recordAudio:e,startRecording:Y})=>{const[Me,Ae]=reactExports.useState(e),Se=reactExports.useCallback(ze=>{const{checked:Te}=ze.target;Te!==Me&&(Ae(Te),$())},[Me,$]),ve=reactExports.useCallback(()=>{Y(),ye()},[Y,ye]);return jsxs(Modal,{isOpen:!0,onClose:ye,children:[jsx$1(ModalHeader,{children:"Record a screencast"}),jsxs(ModalBody$1,{children:[jsx$1("p",{children:"This will record a video with the contents of your screen, so you can easily share what you're seeing with others."}),jsx$1("p",{children:jsxs(StyledRecordAudioLabel,{"data-testid":"stScreencastAudioCheckbox",children:[jsx$1("input",{type:"checkbox",name:"recordAudio",checked:Me,onChange:Se})," ","Also record audio"]})}),jsx$1(StyledInstruction,{"data-testid":"stScreencastInstruction",children:jsx$1(StreamlitMarkdown$1,{source:"Press `Esc` any time to stop recording.",allowHTML:!1})})]}),jsx$1(ModalFooter,{children:jsx$1(ModalButton,{kind:BaseButtonKind.SECONDARY,onClick:ve,children:"Start recording!"})})]})},StyledVideo=newStyled("video",{target:"emkt0dj0"})(({theme:ye})=>({width:ye.sizes.full,borderRadius:ye.radii.md})),StyledDialogContainer=newStyled("div",{target:"emkt0dj1"})(({theme:ye})=>({display:"flex",flexDirection:"column",width:ye.sizes.full})),StyledRow=newStyled("div",{target:"emkt0dj2"})(({theme:ye})=>({display:"flex",flexDirection:"row",paddingTop:ye.spacing.md,paddingBottom:ye.spacing.md})),StyledFirstColumn=newStyled("div",{target:"emkt0dj3"})(({theme:ye})=>({paddingRight:ye.spacing.lg,textAlign:"right",color:ye.colors.gray,fontWeight:ye.fontWeights.bold,width:"6em"})),StyledSecondColumn=newStyled("div",{target:"emkt0dj4"})(({theme:ye})=>({flex:1,paddingRight:ye.spacing.lg,marginRight:"6em",[`@media (max-width: ${ye.breakpoints.sm})`]:{marginRight:ye.spacing.none}})),StyledVideoFormatInstructions=newStyled("p",{target:"emkt0dj5"})(({theme:ye})=>({marginTop:ye.spacing.sm,marginBottom:ye.spacing.none,fontSize:ye.fontSizes.sm})),StyledDownloadButtonContainer=newStyled("div",{target:"emkt0dj6"})(({theme:ye})=>({marginTop:ye.spacing.twoXS})),VideoRecordedDialog=({onClose:ye,videoBlob:$,fileName:e})=>{const Y=URL.createObjectURL($),Me=()=>{const Ae=document.createElement("a");Ae.setAttribute("href",Y),Ae.setAttribute("download",`${e}.webm`),Ae.click(),ye()};return jsxs(Modal,{isOpen:!0,onClose:ye,overrides:{Dialog:{style:{width:"80vw"}}},children:[jsx$1(ModalHeader,{children:"Next steps"}),jsx$1(ModalBody$1,{children:jsxs(StyledDialogContainer,{"data-testid":"stVideoRecordedDialog",children:[jsxs(StyledRow,{children:[jsx$1(StyledFirstColumn,{children:"Step 1"}),jsxs(StyledSecondColumn,{children:[jsx$1("p",{children:"Preview your video below:"}),jsx$1(StyledVideo,{src:Y,controls:!0})]})]}),jsxs(StyledRow,{children:[jsx$1(StyledFirstColumn,{children:"Step 2"}),jsxs(StyledSecondColumn,{children:[jsx$1(StyledDownloadButtonContainer,{children:jsx$1(BaseButton,{kind:BaseButtonKind.SECONDARY,onClick:Me,children:"Save video to disk"})}),jsxs(StyledVideoFormatInstructions,{children:["This video is encoded in the"," ",jsx$1("a",{href:"https://www.webmproject.org/",children:"WebM format"}),", which is only supported by newer video players. You can also play it by dragging the file directly into your browser."]})]})]}),jsxs(StyledRow,{children:[jsx$1(StyledFirstColumn,{children:"Step 3"}),jsxs(StyledSecondColumn,{children:["Share your video with the world on Twitter, LinkedIn, YouTube, or just plain email!"," ",jsx$1("span",{role:"img","aria-label":"Happy",children:"😀"})]})]})]})})]})},StyledScreenCastWarningDialog=newStyled("div",{target:"e1o5y2010"})({display:"flex"}),StyledUnsupportedScreenCastIcon=newStyled("div",{target:"e1o5y2011"})(({theme:ye})=>({display:"flex",alignItems:"center",justifyItems:"center",marginRight:ye.spacing.twoXL,marginLeft:ye.spacing.sm,fontSize:ye.fontSizes.fourXL})),StyledUnsupportedScreenCastExplanation=newStyled("p",{target:"e1o5y2012"})(({theme:ye})=>({margin:ye.spacing.none})),UnsupportedBrowserDialog=({onClose:ye})=>jsxs(Modal,{isOpen:!0,onClose:ye,children:[jsx$1(ModalHeader,{children:"Record a screencast"}),jsx$1(ModalBody$1,{children:jsxs(StyledScreenCastWarningDialog,{"data-testid":"stUnsupportedBrowserDialog",children:[jsx$1(StyledUnsupportedScreenCastIcon,{children:jsx$1("span",{role:"img","aria-label":"Alien Monster",children:"👾"})}),jsx$1(StyledUnsupportedScreenCastExplanation,{children:"Due to limitations with some browsers, this feature is only supported on recent desktop versions of Chrome, Firefox, and Edge."})]})})]}),UnsupportedBrowserDialog$1=reactExports.memo(UnsupportedBrowserDialog),screencastCounterAnimation=keyframes("0%{opacity:0;}25%{opacity:1;}100%{opacity:0;}"),StyledCountdown=newStyled("div",{target:"evez3ra0"})(({theme:ye})=>({position:"fixed",display:"flex",justifyContent:"center",alignItems:"center",top:0,left:0,width:ye.sizes.full,height:ye.sizes.full,fontSize:"40vh",color:ye.colors.red,fontWeight:ye.fontWeights.bold,opacity:"0.8",textShadow:`1px 1px 10px ${ye.colors.darkGray}`,transition:"opacity 0.3s ease-in-out",animation:`${screencastCounterAnimation} 1s`})),Countdown=({countdown:ye,endCallback:$})=>{const[e,Y]=reactExports.useState(ye);return jsx$1(StyledCountdown,{"data-testid":"stCountdown",onAnimationEnd:()=>{const Ae=e-1;Ae>=0&&Y(Ae),Ae===0&&$()},children:jsx$1("span",{children:e})},`frame${e}`)},LOG$1=loglevelExports$1.getLogger("withScreencast");function withScreencast(ye){const $=e=>{const{testOverride:Y}=e,Me=reactExports.useRef(null),[Ae,Se]=reactExports.useState("streamlit-screencast"),[ve,ze]=reactExports.useState(!1),[Te,we]=reactExports.useState(void 0),[De,Ie]=reactExports.useState(Y||"OFF"),Ce=reactExports.useCallback(()=>{ze(Ue=>!Ue)},[]),Ne=reactExports.useCallback(async()=>{if(!(De==="OFF"||m$3(Me.current))){if(De==="COUNTDOWN"){Ie("OFF");return}if(De==="RECORDING"){const Ue=Me.current;if(!Ue||Ue.getState()==="inactive")Ie("OFF");else{const Ge=await Ue.stop();we(Ge),Ie("PREVIEW_FILE")}}}},[De]),$e=reactExports.useCallback(async()=>{if(!ScreenCastRecorder.isSupportedBrowser()){Ie("UNSUPPORTED");return}Me.current=new ScreenCastRecorder({recordAudio:ve,onErrorOrStop:()=>{Ne().catch(Ue=>LOG$1.warn(`withScreencast.stopRecording threw an error: ${Ue}`))}});try{await Me.current.initialize()}catch(Ue){LOG$1.warn(`ScreenCastRecorder.initialize error: ${Ue}`),Ie("UNSUPPORTED");return}Ie("COUNTDOWN")},[ve,Ne]),Le=reactExports.useCallback(Ue=>{if(!ScreenCastRecorder.isSupportedBrowser()){Ie("UNSUPPORTED");return}if(De==="OFF"){Se(Ue),Ie("SETUP");return}Ne().catch(Ge=>LOG$1.warn(`withScreencast.stopRecording threw an error: ${Ge}`))},[De,Ne]),Fe=reactExports.useCallback(async()=>{if(m$3(Me.current))throw new Error("Countdown finished but recorder is null");Me.current.start()?Ie("RECORDING"):Ne().catch(Ge=>LOG$1.warn(`withScreencast.stopRecording threw an error: ${Ge}`))},[Ne]),We=reactExports.useCallback(()=>{Ie("OFF")},[]);return jsxs("div",{className:"withScreencast","data-testid":"stScreencast",children:[jsx$1(ye,{...e,screenCast:{currentState:De,toggleRecordAudio:Ce,startRecording:Le,stopRecording:Ne}}),De==="UNSUPPORTED"&&jsx$1(UnsupportedBrowserDialog$1,{onClose:We}),De==="SETUP"&&jsx$1(ScreencastDialog,{recordAudio:ve,onClose:We,startRecording:$e,toggleRecordAudio:Ce}),De==="COUNTDOWN"&&jsx$1(Countdown,{countdown:3,endCallback:Fe}),De==="PREVIEW_FILE"&&Te&&jsx$1(VideoRecordedDialog,{onClose:We,videoBlob:Te,fileName:Ae})]})};return $.displayName=`withScreencast(${ye.displayName||ye.name||"Component"})`,hoistNonReactStatics($,ye)}const showDevelopmentOptions=(ye,$)=>$==Config.ToolbarMode.DEVELOPER?!0:Config.ToolbarMode.VIEWER==$||Config.ToolbarMode.MINIMAL==$?!1:ye||isLocalhost();function getTitle(ye){return ye||"Streamlit"}class StrategyV1{constructor($){this.appNav=$,this.appPages=[],this.currentPageScriptHash=null,this.hideSidebarNav=null}handleNewSession($){var Se,ve;this.appPages=$.appPages,this.currentPageScriptHash=$.pageScriptHash,this.hideSidebarNav=((Se=$.config)==null?void 0:Se.hideSidebarNav)??!1;const e=this.appPages[0],Y=e.urlPathname??"",Me=((ve=this.appPages.find(ze=>ze.pageScriptHash===this.currentPageScriptHash))==null?void 0:ve.urlPathname)??"",Ae=e.pageScriptHash===this.currentPageScriptHash;return this.appNav.onUpdatePageUrl(Y,Me,Ae),document.title=getTitle(Me??""),[{hideSidebarNav:this.hideSidebarNav,appPages:this.appPages,currentPageScriptHash:this.currentPageScriptHash},()=>{this.appNav.hostCommunicationMgr.sendMessageToHost({type:"SET_APP_PAGES",appPages:this.appPages}),this.appNav.hostCommunicationMgr.sendMessageToHost({type:"SET_CURRENT_PAGE_NAME",currentPageName:Ae?"":Me,currentPageScriptHash:this.currentPageScriptHash})}]}handlePagesChanged($){const{appPages:e}=$;return[{appPages:e},()=>{this.appNav.hostCommunicationMgr.sendMessageToHost({type:"SET_APP_PAGES",appPages:e})}]}handlePageNotFound($){var Me;const{pageName:e}=$;this.appNav.onPageNotFound(e);const Y=((Me=this.appPages[0])==null?void 0:Me.pageScriptHash)??"";return this.currentPageScriptHash=Y,[{currentPageScriptHash:Y},()=>{this.appNav.hostCommunicationMgr.sendMessageToHost({type:"SET_CURRENT_PAGE_NAME",currentPageName:"",currentPageScriptHash:Y})}]}handleNavigation($){}findPageByUrlPath($){return this.appPages.length===0?null:this.appPages.find(e=>$.endsWith("/"+e.urlPathname))??this.appPages[0]}clearPageElements($,e,Y){return AppRoot.empty(e,!1,Y,$.logo)}}class StrategyV2{constructor($){this.appNav=$,this.mainScriptHash=null,this.appPages=[],this.mainPage=null,this.hideSidebarNav=null}handleNewSession($){var e;return this.mainScriptHash=$.mainScriptHash,this.hideSidebarNav===null&&(this.hideSidebarNav=((e=$.config)==null?void 0:e.hideSidebarNav)??null),document.title=getTitle(""),[{hideSidebarNav:this.hideSidebarNav??!1},()=>{}]}handlePagesChanged($){}handlePageNotFound($){const{pageName:e}=$;return this.appNav.onPageNotFound(e),[{currentPageScriptHash:this.mainScriptHash??""},()=>{this.appNav.hostCommunicationMgr.sendMessageToHost({type:"SET_CURRENT_PAGE_NAME",currentPageName:"",currentPageScriptHash:this.mainScriptHash??""})}]}handleNavigation($){const{sections:e,position:Y,appPages:Me}=$;this.appPages=Me,this.hideSidebarNav=Y===Navigation.Position.HIDDEN;const Ae=$.pageScriptHash,Se=Me.find(Te=>Te.pageScriptHash===Ae),ve=Me.find(Te=>Te.isDefault);this.mainPage=ve;const ze=Se.urlPathname;if(!this.appNav.isPageTitleSet){const Te=getTitle(Se.pageName);document.title=Te,this.appNav.hostCommunicationMgr.sendMessageToHost({type:"SET_PAGE_TITLE",title:Se.pageName??""})}return!this.appNav.isPageIconSet&&Se.icon&&this.appNav.onPageIconChange(Se.icon),this.appNav.onUpdatePageUrl(ve.urlPathname??"",ze,Se.isDefault??!1),[{appPages:Me,navSections:e,hideSidebarNav:this.hideSidebarNav,expandSidebarNav:$.expanded,currentPageScriptHash:Ae},()=>{this.appNav.hostCommunicationMgr.sendMessageToHost({type:"SET_APP_PAGES",appPages:Me}),this.appNav.hostCommunicationMgr.sendMessageToHost({type:"SET_CURRENT_PAGE_NAME",currentPageName:Se.isDefault?"":ze,currentPageScriptHash:Ae})}]}findPageByUrlPath($){return this.appPages.find(e=>$.endsWith("/"+e.urlPathname))??this.mainPage}clearPageElements($,e,Y){return $.filterMainScriptElements(e)}}class AppNavigation{constructor($,e,Y,Me){this.hostCommunicationMgr=$,this.onUpdatePageUrl=e,this.onPageNotFound=Y,this.onPageIconChange=Me,this.isPageIconSet=!1,this.isPageTitleSet=!1,this.strategy=new StrategyV1(this)}handleNewSession($){return this.isPageTitleSet=!1,this.isPageIconSet=!1,this.strategy.handleNewSession($)}handleNavigation($){return this.strategy instanceof StrategyV1&&(this.strategy=new StrategyV2(this)),this.strategy.handleNavigation($)}handlePagesChanged($){return this.strategy.handlePagesChanged($)}handlePageNotFound($){return this.strategy.handlePageNotFound($)}findPageByUrlPath($){return this.strategy.findPageByUrlPath($)}handlePageConfigChanged($){this.isPageIconSet=!!$.favicon,this.isPageTitleSet=!!$.title}clearPageElements($,e,Y){return this.strategy.clearPageElements($,e,Y)}}var define_PACKAGE_METADATA_default={version:"1.42.2"};const ELEMENT_LIST_BUFFER_TIMEOUT_MS=10,INITIAL_SCRIPT_RUN_ID="<null>",LOG=loglevelExports$1.getLogger("App");class App extends reactExports.PureComponent{constructor($){super($),this.sessionInfo=new SessionInfo,this.metricsMgr=new MetricsManager(this.sessionInfo),this.sessionEventDispatcher=new SessionEventDispatcher,this.embeddingId=generateUID$2(),this.showDeployError=(Y,Me,Ae)=>{this.openDialog({type:DialogType.DEPLOY_ERROR,title:Y,msg:Me,onContinue:Ae,onClose:()=>{},onTryAgain:this.sendLoadGitInfoBackMsg})},this.handleThemeMessage=(Y,Me)=>{const[,Ae,Se]=createPresetThemes(),ve=isPresetTheme(this.props.theme.activeTheme);Y===Ae.name&&ve?this.props.theme.setTheme(Ae):Y===Se.name&&ve?this.props.theme.setTheme(Se):Me&&this.props.theme.setImportedTheme(Me)},this.handleConnectionStateChanged=Y=>{if(LOG.info(`Connection state changed from ${this.state.connectionState} to ${Y}`),Y===ConnectionState.CONNECTED){LOG.info("Reconnected to server.");const Me=this.state.scriptRunState===ScriptRunState.RUNNING,Ae=this.state.scriptRunState===ScriptRunState.RERUN_REQUESTED;(!this.sessionInfo.last||Me||Ae)&&(LOG.info("Requesting a script run."),this.widgetMgr.sendUpdateWidgetsMessage(void 0),this.setState({dialog:null})),this.hostCommunicationMgr.sendMessageToHost({type:"WEBSOCKET_CONNECTED"})}else this.state.connectionState===ConnectionState.CONNECTED&&this.hostCommunicationMgr.sendMessageToHost({type:"WEBSOCKET_DISCONNECTED",attemptingToReconnect:Y!==ConnectionState.DISCONNECTED_FOREVER}),this.sessionInfo.isSet&&this.sessionInfo.clearCurrent();this.setState({connectionState:Y})},this.handleGitInfoChanged=Y=>{this.setState({gitInfo:Y})},this.handleCustomParentMessage=Y=>{this.state.appConfig.enableCustomParentMessages?this.hostCommunicationMgr.sendMessageToHost({type:"CUSTOM_PARENT_MESSAGE",message:Y.message}):LOG.error("Sending messages to the host is disabled in line with the platform policy.")},this.handleMessage=Y=>{const Me=(Ae,Se,ve)=>{const ze=Ae[Se];if(ze in ve)return ve[ze](Ae[ze]);throw new Error(`Cannot handle ${Se} "${ze}".`)};try{Me(Y,"type",{newSession:Ae=>this.handleNewSession(Ae),sessionStatusChanged:Ae=>this.handleSessionStatusChanged(Ae),sessionEvent:Ae=>this.handleSessionEvent(Ae),delta:Ae=>this.handleDeltaMsg(Ae,Y.metadata),pageConfigChanged:Ae=>this.handlePageConfigChanged(Ae),pageInfoChanged:Ae=>this.handlePageInfoChanged(Ae),pagesChanged:Ae=>this.handlePagesChanged(Ae),pageNotFound:Ae=>this.handlePageNotFound(Ae),gitInfoChanged:Ae=>this.handleGitInfoChanged(Ae),scriptFinished:Ae=>this.handleScriptFinished(Ae),pageProfile:Ae=>this.handlePageProfileMsg(Ae),autoRerun:Ae=>this.handleAutoRerun(Ae),fileUrlsResponse:Ae=>this.uploadClient.onFileURLsResponse(Ae),parentMessage:Ae=>this.handleCustomParentMessage(Ae),logo:Ae=>this.handleLogo(Ae,Y.metadata),navigation:Ae=>this.handleNavigation(Ae),authRedirect:Ae=>{isInChildFrame()?this.hostCommunicationMgr.sendMessageToSameOriginHost({type:"REDIRECT_TO_URL",url:Ae.url}):window.location.href=Ae.url}})}catch(Ae){const Se=ensureError(Ae);LOG.error(Se),this.showError("Bad message format",Se.message)}},this.handleLogo=(Y,Me)=>{const Ae={activeScriptHash:Me.activeScriptHash,scriptRunId:this.state.scriptRunId};this.setState({elements:this.pendingElementsBuffer.appRootWithLogo(Y,Ae)},()=>{this.pendingElementsBuffer=this.state.elements})},this.handlePageConfigChanged=Y=>{const{title:Me,favicon:Ae,layout:Se,initialSidebarState:ve,menuItems:ze}=Y;this.appNavigation.handlePageConfigChanged(Y),Me&&(this.hostCommunicationMgr.sendMessageToHost({type:"SET_PAGE_TITLE",title:Me}),document.title=Me),Ae&&this.onPageIconChanged(Ae),Se!==this.state.layout&&this.setState(Te=>({layout:Se,userSettings:{...Te.userSettings,wideMode:Se===PageConfig.Layout.WIDE}})),ve!==this.state.initialSidebarState&&this.setState(()=>({initialSidebarState:ve})),this.setState({menuItems:ze})},this.handlePageInfoChanged=Y=>{const{queryString:Me}=Y,Ae=document.location.pathname+(Me?`?${Me}`:"");window.history.pushState({},"",Ae),this.hostCommunicationMgr.sendMessageToHost({type:"SET_QUERY_PARAM",queryParams:Me?`?${Me}`:""})},this.onPageNotFound=Y=>{const Me=Y?`You have requested page /${Y}, but no corresponding file was found in the app's pages/ directory`:"The page that you have requested does not seem to exist";this.showError("Page not found",`${Me}. Running the app's main page.`)},this.handlePageNotFound=Y=>{this.maybeSetState(this.appNavigation.handlePageNotFound(Y))},this.onPageIconChanged=Y=>{handleFavicon(Y,this.hostCommunicationMgr.sendMessageToHost,this.endpoints)},this.handlePagesChanged=Y=>{this.maybeSetState(this.appNavigation.handlePagesChanged(Y))},this.handleNavigation=Y=>{this.maybeSetState(this.appNavigation.handleNavigation(Y))},this.handlePageProfileMsg=Y=>{var Se,ve,ze;const Me=PageProfile.toObject(Y),Ae=getBrowserInfo();this.metricsMgr.enqueue("pageProfile",{...Me,isFragmentRun:!!Me.isFragmentRun,appId:this.sessionInfo.current.appId,numPages:(Se=this.state.appPages)==null?void 0:Se.length,sessionId:this.sessionInfo.current.sessionId,pythonVersion:this.sessionInfo.current.pythonVersion,pageScriptHash:this.state.currentPageScriptHash,activeTheme:(ze=(ve=this.props.theme)==null?void 0:ve.activeTheme)==null?void 0:ze.name,totalLoadTime:Math.round((performance.now()-this.state.latestRunTime)*1e3),browserInfo:Ae})},this.handleAutoRerun=Y=>{const Me=setInterval(()=>{this.widgetMgr.sendUpdateWidgetsMessage(Y.fragmentId,!0)},Y.interval*1e3);this.setState(Ae=>({autoReruns:[...Ae.autoReruns,Me]}))},this.handleSessionStatusChanged=Y=>{this.setState(Me=>{let{scriptRunState:Ae}=Me,{dialog:Se}=Me;return Y.scriptIsRunning&&Me.scriptRunState!==ScriptRunState.STOP_REQUESTED?(Ae=ScriptRunState.RUNNING,d$2(Se)&&Se.type===DialogType.SCRIPT_COMPILE_ERROR&&(Se=void 0)):!Y.scriptIsRunning&&Me.scriptRunState!==ScriptRunState.RERUN_REQUESTED&&Me.scriptRunState!==ScriptRunState.COMPILATION_ERROR&&(Ae=ScriptRunState.NOT_RUNNING),{userSettings:{...Me.userSettings,runOnSave:!!Y.runOnSave},dialog:Se,scriptRunState:Ae}})},this.handleSessionEvent=Y=>{if(this.sessionEventDispatcher.handleSessionEventMsg(Y),Y.type==="scriptCompilationException"){this.setState({scriptRunState:ScriptRunState.COMPILATION_ERROR});const Me={type:DialogType.SCRIPT_COMPILE_ERROR,exception:Y.scriptCompilationException,onClose:()=>{}};this.openDialog(Me)}},this.maybeUpdatePageUrl=(Y,Me,Ae)=>{const Se=this.getBaseUriParts();if(Se){const{pathname:ve}=Se,ze=extractPageNameFromPathName(document.location.pathname,ve);if((ze===""?Y:ze)!==Me){const we=Ae?"":Me,De=preserveEmbedQueryParams(),Ie=De?`?${De}`:"",Ne=`${ve==="/"?"":ve}/${we}${Ie}`;window.history.pushState({},"",Ne)}}},this.handleNewSession=Y=>{const Me=Y.initialize;if(this.hasStreamlitVersionChanged(Me)){window.location.reload();return}this.sessionInfo.isSet||this.handleOneTimeInitialization(Y);const{appHash:Ae,currentPageScriptHash:Se}=this.state,{scriptRunId:ve,name:ze,mainScriptPath:Te,fragmentIdsThisRun:we,pageScriptHash:De,mainScriptHash:Ie}=Y;if(we.length)this.setState({fragmentIdsThisRun:we,latestRunTime:performance.now()});else{this.cleanupAutoReruns();const Ne=Y.config,$e=Y.customTheme;this.processThemeInput($e),this.setState({allowRunOnSave:Ne.allowRunOnSave,hideTopBar:Ne.hideTopBar,toolbarMode:Ne.toolbarMode,latestRunTime:performance.now(),mainScriptHash:Ie,fragmentIdsThisRun:we}),this.maybeSetState(this.appNavigation.handleNewSession(Y)),this.onPageIconChanged("./favicon.png")}const Ce=hashString(this.sessionInfo.current.installationId+Te);this.metricsMgr.setMetadata(this.state.deployedAppMetadata),this.metricsMgr.setAppHash(Ce),this.metricsMgr.enqueue("updateReport"),Ae===Ce&&Se===De?this.setState({scriptRunId:ve}):this.clearAppState(Ce,ve,ze,Ie)},this.handleOneTimeInitialization=Y=>{const Me=Y.initialize,Ae=Y.config;this.sessionInfo.setCurrent(SessionInfo.propsFromNewSessionMessage(Y)),this.metricsMgr.initialize({gatherUsageStats:Ae.gatherUsageStats,sendMessageToHost:this.hostCommunicationMgr.sendMessageToHost}),this.handleSessionStatusChanged(Me.sessionStatus)},this.onHistoryChange=()=>{const{currentPageScriptHash:Y}=this.state,Me=this.appNavigation.findPageByUrlPath(document.location.pathname),Ae=document.location.toString().includes("#"),Se=(Me==null?void 0:Me.pageScriptHash)===Y;m$3(Me)||Ae&&Se||this.onPageChange(Me.pageScriptHash)},this.setAndSendTheme=Y=>{this.props.theme.setTheme(Y),this.setState({hideColoredLine:!isPresetTheme(Y)}),this.hostCommunicationMgr.sendMessageToHost({type:"SET_THEME_CONFIG",themeInfo:toExportedTheme(Y.emotion)})},this.createThemeHash=Y=>{if(!Y)return"hash_for_undefined_custom_theme";const Me=Object.entries(Y);return Me.sort(),hashString(Me.join(":"))},this.closeDialog=()=>{this.setState({dialog:void 0})},this.saveSettings=Y=>{const{runOnSave:Me}=this.state.userSettings,{runOnSave:Ae}=Y;if(this.setState({userSettings:Y}),Me!==Ae&&this.isServerConnected()){const Se=new BackMsg$1({setRunOnSave:Ae});Se.type="setRunOnSave",this.sendBackMsg(Se)}},this.handleDeltaMsg=(Y,Me)=>{if(this.pendingElementsBuffer=this.pendingElementsBuffer.applyDelta(this.state.scriptRunId,Y,Me),!this.pendingElementsTimerRunning){this.pendingElementsTimerRunning=!0;const Ae=this.state.scriptRunState===ScriptRunState.RUNNING;setTimeout(()=>{this.pendingElementsTimerRunning=!1,Ae&&this.setState({elements:this.pendingElementsBuffer})},ELEMENT_LIST_BUFFER_TIMEOUT_MS)}},this.debugShutdownRuntime=()=>{if(this.isServerConnected()){const Y=new BackMsg$1({debugShutdownRuntime:!0});Y.type="debugShutdownRuntime",this.sendBackMsg(Y)}},this.debugDisconnectWebsocket=()=>{if(this.isServerConnected()){const Y=new BackMsg$1({debugDisconnectWebsocket:!0});Y.type="debugDisconnectWebsocket",this.sendBackMsg(Y)}},this.debugClearForwardMsgCache=()=>{var Y,Me;isLocalhost()&&((Me=(Y=this.connectionManager)==null?void 0:Y.websocketConnection)==null||Me.cache.messages.clear())},this.cleanupAutoReruns=()=>{this.state.autoReruns.forEach(Y=>{clearInterval(Y)}),this.setState({autoReruns:[]})},this.rerunScript=(Y=!1)=>{if(this.closeDialog(),!this.isServerConnected()){LOG.error("Cannot rerun script when disconnected from server.");return}this.state.scriptRunState===ScriptRunState.RUNNING||this.state.scriptRunState===ScriptRunState.RERUN_REQUESTED||(this.setState({scriptRunState:ScriptRunState.RERUN_REQUESTED}),Y===!0&&this.saveSettings({...this.state.userSettings,runOnSave:!0}),this.widgetMgr.sendUpdateWidgetsMessage(void 0))},this.sendLoadGitInfoBackMsg=()=>{if(!this.isServerConnected()){LOG.error("Cannot load git information when disconnected from server.");return}this.sendBackMsg(new BackMsg$1({loadGitInfo:!0}))},this.onPageChange=Y=>{const{elements:Me,mainScriptHash:Ae}=this.state;this.cleanupAutoReruns();const Se=this.appNavigation.clearPageElements(Me,Ae,void 0),ve=new Set(Array.from(Se.getElements()).map(ze=>getElementId(ze)).filter(notUndefined));this.sendRerunBackMsg(this.widgetMgr.getActiveWidgetStates(ve),void 0,Y)},this.isAppInReadyState=Y=>this.state.connectionState===ConnectionState.CONNECTED&&this.state.scriptRunState===ScriptRunState.NOT_RUNNING&&Y.scriptRunState===ScriptRunState.RUNNING&&Y.connectionState===ConnectionState.CONNECTED,this.sendRerunBackMsg=(Y,Me,Ae,Se)=>{const ve=this.getBaseUriParts();if(!ve){LOG.error("Cannot send rerun backMessage when disconnected from server.");return}const{currentPageScriptHash:ze}=this.state,{pathname:Te}=ve;let we=this.getQueryString(),De="";Ae?Ae!=ze&&(we=preserveEmbedQueryParams(),this.hostCommunicationMgr.sendMessageToHost({type:"SET_QUERY_PARAM",queryParams:we})):ze?Ae=ze:(De=extractPageNameFromPathName(document.location.pathname,Te),Ae=""),this.sendBackMsg(new BackMsg$1({rerunScript:{queryString:we,widgetStates:Y,pageScriptHash:Ae,pageName:De,fragmentId:Me,isAutoRerun:Se}}))},this.stopScript=()=>{if(!this.isServerConnected()){LOG.error("Cannot stop app when disconnected from server.");return}if(this.state.scriptRunState===ScriptRunState.NOT_RUNNING||this.state.scriptRunState===ScriptRunState.STOP_REQUESTED)return;const Y=new BackMsg$1({stopScript:!0});Y.type="stopScript",this.sendBackMsg(Y),this.setState({scriptRunState:ScriptRunState.STOP_REQUESTED})},this.openClearCacheDialog=()=>{if(this.isServerConnected()){const Y={type:DialogType.CLEAR_CACHE,confirmCallback:this.clearCache,defaultAction:this.clearCache,onClose:()=>{}};this.openDialog(Y)}else LOG.error("Cannot clear cache: disconnected from server")},this.openDeployDialog=()=>{var Me;const Y={type:DialogType.DEPLOY_DIALOG,onClose:this.closeDialog,showDeployError:this.showDeployError,isDeployErrorModalOpen:((Me=this.state.dialog)==null?void 0:Me.type)===DialogType.DEPLOY_ERROR,metricsMgr:this.metricsMgr};this.openDialog(Y)},this.openThemeCreatorDialog=()=>{this.metricsMgr.enqueue("menuClick",{label:"editTheme"});const Y={type:DialogType.THEME_CREATOR,backToSettings:this.settingsCallback,onClose:this.closeDialog,metricsMgr:this.metricsMgr};this.openDialog(Y)},this.clearCache=()=>{if(this.closeDialog(),this.isServerConnected()){const Y=new BackMsg$1({clearCache:!0});Y.type="clearCache",this.sendBackMsg(Y)}else LOG.error("Cannot clear cache: disconnected from server")},this.sendAppHeartbeat=()=>{if(this.isServerConnected()){const Y=new BackMsg$1({appHeartbeat:!0});Y.type="appHeartbeat",this.sendBackMsg(Y)}else LOG.error("Cannot send app heartbeat: disconnected from server")},this.sendBackMsg=Y=>{this.connectionManager?(LOG.info(Y),this.connectionManager.sendMessage(Y)):LOG.error(`Not connected. Cannot send back message: ${Y}`)},this.handleConnectionError=Y=>{this.showError("Connection error",Y)},this.isServerConnected=()=>this.connectionManager?this.connectionManager.isConnected():!1,this.settingsCallback=(Y=!0)=>{const Me={type:DialogType.SETTINGS,isServerConnected:this.isServerConnected(),settings:this.state.userSettings,allowRunOnSave:this.state.allowRunOnSave,onSave:this.saveSettings,onClose:()=>{},developerMode:showDevelopmentOptions(this.state.isOwner,this.state.toolbarMode),openThemeCreator:this.openThemeCreatorDialog,animateModal:Y,metricsMgr:this.metricsMgr};this.openDialog(Me)},this.aboutCallback=()=>{const{menuItems:Y}=this.state,Me={type:DialogType.ABOUT,sessionInfo:this.sessionInfo,onClose:this.closeDialog,aboutSectionMd:Y==null?void 0:Y.aboutSectionMd};this.openDialog(Me)},this.printCallback=()=>{const{scriptRunState:Y}=this.state;if(Y!==ScriptRunState.NOT_RUNNING){setTimeout(this.printCallback,500);return}let Me;try{const Ae=getIFrameEnclosingApp(this.embeddingId);Ae&&Ae.contentWindow?Me=Ae.contentWindow.window:Me=window}catch{Me=window}finally{Me||(Me=window),Me.print()}},this.screencastCallback=()=>{const{scriptName:Y}=this.state,{startRecording:Me}=this.props.screenCast,Ae=hooks().format("YYYY-MM-DD-HH-MM-SS");Me(`streamlit-${Y}-${Ae}`)},this.handleFullScreen=Y=>{this.setState({isFullScreen:Y})},this.setLibConfig=Y=>{this.setState({libConfig:Y})},this.setAppConfig=Y=>{this.setState({appConfig:Y})},this.addScriptFinishedHandler=Y=>{this.setState((Me,Ae)=>({scriptFinishedHandlers:Me.scriptFinishedHandlers.concat(Y)}))},this.removeScriptFinishedHandler=Y=>{this.setState((Me,Ae)=>({scriptFinishedHandlers:without(Me.scriptFinishedHandlers,Y)}))},this.getBaseUriParts=()=>this.connectionManager?this.connectionManager.getBaseUriParts():void 0,this.getQueryString=()=>{const{queryParams:Y}=this.state,Me=Y&&Y.length>0?Y:document.location.search;return Me.startsWith("?")?Me.substring(1):Me},this.isInCloudEnvironment=()=>{const{hostMenuItems:Y}=this.state;return Y&&(Y==null?void 0:Y.length)>0},this.showDeployButton=()=>showDevelopmentOptions(this.state.isOwner,this.state.toolbarMode)&&!this.isInCloudEnvironment()&&this.sessionInfo.isSet&&!this.sessionInfo.isHello,this.deployButtonClicked=()=>{this.metricsMgr.enqueue("menuClick",{label:"deployButtonInApp"}),this.sendLoadGitInfoBackMsg(),this.openDeployDialog()},this.requestFileURLs=(Y,Me)=>{if(this.isServerConnected()){const Ae=new BackMsg$1({fileUrlsRequest:{requestId:Y,fileNames:Me.map(Se=>Se.name),sessionId:this.sessionInfo.current.sessionId}});Ae.type="fileUrlsRequest",this.sendBackMsg(Ae)}},this.handleKeyDown=Y=>{switch(Y){case"c":showDevelopmentOptions(this.state.isOwner,this.state.toolbarMode)&&this.openClearCacheDialog();break;case"r":this.rerunScript();break}},this.handleKeyUp=Y=>{Y==="esc"&&this.props.screenCast.stopRecording()},J$1();let e=this.createThemeHash();isPresetTheme($.theme.activeTheme)||(e=this.createThemeHash(toThemeInput($.theme.activeTheme.emotion))),this.state={connectionState:ConnectionState.INITIAL,elements:AppRoot.empty("",!0),isFullScreen:!1,scriptName:"",scriptRunId:INITIAL_SCRIPT_RUN_ID,appHash:null,scriptRunState:ScriptRunState.NOT_RUNNING,userSettings:{wideMode:!1,runOnSave:!1},layout:PageConfig.Layout.CENTERED,initialSidebarState:PageConfig.SidebarState.AUTO,menuItems:void 0,allowRunOnSave:!0,scriptFinishedHandlers:[],themeHash:e,gitInfo:null,formsData:createFormsData(),appPages:[],navSections:[],currentPageScriptHash:"",mainScriptHash:"",hideTopBar:!0,hideSidebarNav:!0,hideColoredLine:!1,expandSidebarNav:!1,toolbarMode:Config.ToolbarMode.MINIMAL,latestRunTime:performance.now(),fragmentIdsThisRun:[],isOwner:!1,hostMenuItems:[],hostToolbarItems:[],hostHideSidebarNav:!1,sidebarChevronDownshift:0,pageLinkBaseUrl:"",queryParams:"",deployedAppMetadata:{},libConfig:{},appConfig:{},autoReruns:[],inputsDisabled:!1},this.connectionManager=null,this.widgetMgr=new WidgetStateManager({sendRerunBackMsg:this.sendRerunBackMsg,formsDataChanged:Y=>this.setState({formsData:Y})}),this.hostCommunicationMgr=new HostCommunicationManager({streamlitExecutionStartedAt:$.streamlitExecutionStartedAt,sendRerunBackMsg:this.sendRerunBackMsg,closeModal:this.closeDialog,stopScript:this.stopScript,rerunScript:this.rerunScript,clearCache:this.clearCache,sendAppHeartbeat:this.sendAppHeartbeat,setInputsDisabled:Y=>{this.setState({inputsDisabled:Y})},themeChanged:this.handleThemeMessage,pageChanged:this.onPageChange,isOwnerChanged:Y=>this.setState({isOwner:Y}),fileUploadClientConfigChanged:Y=>{this.endpoints.setFileUploadClientConfig!==void 0&&this.endpoints.setFileUploadClientConfig(Y)},hostMenuItemsChanged:Y=>{this.setState({hostMenuItems:Y})},hostToolbarItemsChanged:Y=>{this.setState({hostToolbarItems:Y})},hostHideSidebarNavChanged:Y=>{this.setState({hostHideSidebarNav:Y})},sidebarChevronDownshiftChanged:Y=>{this.setState({sidebarChevronDownshift:Y})},pageLinkBaseUrlChanged:Y=>{this.setState({pageLinkBaseUrl:Y})},queryParamsChanged:Y=>{this.setState({queryParams:Y})},deployedAppMetadataChanged:Y=>{this.setState({deployedAppMetadata:Y})},restartWebsocketConnection:()=>{this.connectionManager||(this.setState({scriptRunState:ScriptRunState.RERUN_REQUESTED}),this.initializeConnectionManager())},terminateWebsocketConnection:()=>{var Y;(Y=this.connectionManager)==null||Y.disconnect(),this.connectionManager=null}}),this.endpoints=new DefaultStreamlitEndpoints({getServerUri:this.getBaseUriParts,csrfEnabled:!0}),this.uploadClient=new FileUploadClient({sessionInfo:this.sessionInfo,endpoints:this.endpoints,formsWithPendingRequestsChanged:Y=>this.widgetMgr.setFormsWithUploadsInProgress(Y),requestFileURLs:this.requestFileURLs}),this.componentRegistry=new ComponentRegistry(this.endpoints),this.pendingElementsTimerRunning=!1,this.pendingElementsBuffer=this.state.elements,this.appNavigation=new AppNavigation(this.hostCommunicationMgr,this.maybeUpdatePageUrl,this.onPageNotFound,this.onPageIconChanged),window.streamlitDebug={clearForwardMsgCache:this.debugClearForwardMsgCache,disconnectWebsocket:this.debugDisconnectWebsocket,shutdownRuntime:this.debugShutdownRuntime}}initializeConnectionManager(){this.connectionManager=new ConnectionManager({getLastSessionId:()=>{var $;return($=this.sessionInfo.last)==null?void 0:$.sessionId},endpoints:this.endpoints,onMessage:this.handleMessage,onConnectionError:this.handleConnectionError,connectionStateChanged:this.handleConnectionStateChanged,claimHostAuthToken:this.hostCommunicationMgr.claimAuthToken,resetHostAuthToken:this.hostCommunicationMgr.resetAuthToken,onHostConfigResp:$=>{const{allowedOrigins:e,useExternalAuthToken:Y,disableFullscreenMode:Me,enableCustomParentMessages:Ae,mapboxToken:Se,enforceDownloadInNewTab:ve,metricsUrl:ze}=$,Te={allowedOrigins:e,useExternalAuthToken:Y,enableCustomParentMessages:Ae},we={mapboxToken:Se,disableFullscreenMode:Me,enforceDownloadInNewTab:ve};this.metricsMgr.setMetricsConfig(ze),this.hostCommunicationMgr.setAllowedOrigins(Te),this.setAppConfig(Te),this.setLibConfig(we)}})}componentDidMount(){this.initializeConnectionManager(),mark(this.state.scriptRunState),this.hostCommunicationMgr.sendMessageToHost({type:"SCRIPT_RUN_STATE_CHANGED",scriptRunState:this.state.scriptRunState}),isScrollingHidden()&&document.body.classList.add("embedded"),isInChildFrame()&&(window.iFrameResizer={heightCalculationMethod:()=>{const $=document.querySelectorAll("[data-iframe-height]"),e=Array.from($).map(Y=>Math.ceil(Y.getBoundingClientRect().bottom));return Math.max(0,...e)}},__vitePreload(()=>import("./iframeResizer.contentWindow.XvWZp7Dg.js").then($=>$.i),[],import.meta.url)),this.hostCommunicationMgr.sendMessageToHost({type:"SET_THEME_CONFIG",themeInfo:toExportedTheme(this.props.theme.activeTheme.emotion)}),this.metricsMgr.enqueue("viewReport"),window.addEventListener("popstate",this.onHistoryChange,!1)}componentDidUpdate($,e){window.prerenderReady===!1&&this.isAppInReadyState(e)&&(window.prerenderReady=!0),this.state.scriptRunState!==e.scriptRunState&&(mark(this.state.scriptRunState),this.state.scriptRunState===ScriptRunState.NOT_RUNNING&&measure("script-run-cycle",ScriptRunState.RUNNING,ScriptRunState.NOT_RUNNING),this.hostCommunicationMgr.sendMessageToHost({type:"SCRIPT_RUN_STATE_CHANGED",scriptRunState:this.state.scriptRunState}))}componentWillUnmount(){var $;($=this.connectionManager)==null||$.disconnect(),this.hostCommunicationMgr.closeHostCommunication(),window.removeEventListener("popstate",this.onHistoryChange,!1)}showError($,e){LOG.error(e);const Y={type:DialogType.WARNING,title:$,msg:jsx$1(StreamlitMarkdown$1,{source:e,allowHTML:!1}),onClose:()=>{}};this.openDialog(Y)}hasStreamlitVersionChanged($){var Y;let e;if(((Y=window.__streamlit)==null?void 0:Y.ENABLE_RELOAD_BASED_ON_HARDCODED_STREAMLIT_VERSION)===!0?e=define_PACKAGE_METADATA_default.version:this.sessionInfo.isSet&&(e=this.sessionInfo.current.streamlitVersion),e){const{environmentInfo:Me}=$;if(d$2(Me)&&d$2(Me.streamlitVersion))return e!=Me.streamlitVersion}return!1}maybeSetState($){if($){const[e,Y]=$;this.setState(e,Y)}}processThemeInput($){const e=this.createThemeHash($);if(e===this.state.themeHash)return;this.setState({themeHash:e});const Y=!isPresetTheme(this.props.theme.activeTheme);if($){const Me=createTheme(CUSTOM_THEME_NAME,$);this.props.theme.addThemes([Me]),(getCachedTheme()===null||Y)&&this.setAndSendTheme(Me)}else this.props.theme.addThemes([]),Y&&this.setAndSendTheme(getHostSpecifiedTheme());$!=null&&$.fontFaces&&this.props.theme.setImportedTheme($)}handleScriptFinished($){if($===ForwardMsg$1.ScriptFinishedStatus.FINISHED_SUCCESSFULLY||$===ForwardMsg$1.ScriptFinishedStatus.FINISHED_EARLY_FOR_RERUN||$===ForwardMsg$1.ScriptFinishedStatus.FINISHED_FRAGMENT_RUN_SUCCESSFULLY){if(window.setTimeout(()=>{this.state.scriptFinishedHandlers.map(e=>e())},0),$===ForwardMsg$1.ScriptFinishedStatus.FINISHED_SUCCESSFULLY||$===ForwardMsg$1.ScriptFinishedStatus.FINISHED_FRAGMENT_RUN_SUCCESSFULLY){this.setState(({scriptRunId:Y,fragmentIdsThisRun:Me})=>({elements:this.pendingElementsBuffer.clearStaleNodes(Y,Me)}),()=>{this.pendingElementsBuffer=this.state.elements});const e=new Set(Array.from(this.state.elements.getElements()).map(Y=>getElementId(Y)).filter(notUndefined));this.widgetMgr.removeInactive(e)}this.connectionManager!==null&&$!==ForwardMsg$1.ScriptFinishedStatus.FINISHED_EARLY_FOR_RERUN&&this.sessionInfo.isSet&&this.connectionManager.incrementMessageCacheRunCount(this.sessionInfo.current.maxCachedMessageAge)}}clearAppState($,e,Y,Me){const{hideSidebarNav:Ae,elements:Se}=this.state,ve=Ae&&Se.sidebar||void 0;this.setState({scriptRunId:e,scriptName:Y,appHash:$,elements:this.appNavigation.clearPageElements(this.pendingElementsBuffer,Me,ve)},()=>{this.pendingElementsBuffer=this.state.elements;const ze=new Set(Array.from(this.state.elements.getElements()).map(Te=>getElementId(Te)).filter(notUndefined));this.widgetMgr.removeInactive(ze)})}openDialog($){this.setState({dialog:$})}render(){const{allowRunOnSave:$,connectionState:e,dialog:Y,elements:Me,initialSidebarState:Ae,menuItems:Se,isFullScreen:ve,scriptRunId:ze,scriptRunState:Te,userSettings:we,hideTopBar:De,hideSidebarNav:Ie,hideColoredLine:Ce,expandSidebarNav:Ne,currentPageScriptHash:$e,hostHideSidebarNav:Le,pageLinkBaseUrl:Fe,sidebarChevronDownshift:We,hostMenuItems:je,hostToolbarItems:Ue,libConfig:Ge,appConfig:He,inputsDisabled:Xe,appPages:st,navSections:Ke}=this.state,Je=showDevelopmentOptions(this.state.isOwner,this.state.toolbarMode),rt=classNames("stApp",getEmbeddingIdClassName(this.embeddingId),{"streamlit-embedded":isEmbed(),"streamlit-wide":we.wideMode}),ut=Y?StreamlitDialog({...Y,onClose:this.closeDialog}):null,ft=Xe||e!==ConnectionState.CONNECTED;return jsx$1(AppContext.Provider,{value:{initialSidebarState:Ae,wideMode:we.wideMode,embedded:isEmbed(),showPadding:!isEmbed()||isPaddingDisplayed(),disableScrolling:isScrollingHidden(),showToolbar:!isEmbed()||isToolbarDisplayed(),showColoredLine:!Ce&&!isEmbed()||isColoredLineDisplayed(),pageLinkBaseUrl:Fe,sidebarChevronDownshift:We,gitInfo:this.state.gitInfo,appConfig:He},children:jsx$1(LibContext.Provider,{value:{isFullScreen:ve,setFullScreen:this.handleFullScreen,addScriptFinishedHandler:this.addScriptFinishedHandler,removeScriptFinishedHandler:this.removeScriptFinishedHandler,activeTheme:this.props.theme.activeTheme,setTheme:this.setAndSendTheme,availableThemes:this.props.theme.availableThemes,addThemes:this.props.theme.addThemes,onPageChange:this.onPageChange,currentPageScriptHash:$e,libConfig:Ge,fragmentIdsThisRun:this.state.fragmentIdsThisRun,locale:window.navigator.language},children:jsx$1(ReactHotkeys,{keyName:"r,c,esc",onKeyDown:this.handleKeyDown,onKeyUp:this.handleKeyUp,children:jsxs(StyledApp,{className:rt,"data-testid":"stApp","data-test-script-state":ze==INITIAL_SCRIPT_RUN_ID?"initial":Te,"data-test-connection-state":e,children:[jsxs(Header,{children:[!De&&jsxs(Fragment,{children:[jsx$1(StatusWidget,{connectionState:e,sessionEventDispatcher:this.sessionEventDispatcher,scriptRunState:Te,rerunScript:this.rerunScript,stopScript:this.stopScript,allowRunOnSave:$}),jsx$1(ToolbarActions,{hostToolbarItems:Ue,sendMessageToHost:this.hostCommunicationMgr.sendMessageToHost,metricsMgr:this.metricsMgr})]}),this.showDeployButton()&&jsx$1(DeployButton,{onClick:this.deployButtonClicked.bind(this)}),jsx$1(MainMenu$1,{isServerConnected:this.isServerConnected(),quickRerunCallback:this.rerunScript,clearCacheCallback:this.openClearCacheDialog,settingsCallback:this.settingsCallback,aboutCallback:this.aboutCallback,printCallback:this.printCallback,screencastCallback:this.screencastCallback,screenCastState:this.props.screenCast.currentState,hostMenuItems:je,developmentMode:Je,sendMessageToHost:this.hostCommunicationMgr.sendMessageToHost,menuItems:Se,metricsMgr:this.metricsMgr,toolbarMode:this.state.toolbarMode})]}),jsx$1(AppView,{endpoints:this.endpoints,sendMessageToHost:this.hostCommunicationMgr.sendMessageToHost,elements:Me,scriptRunId:ze,scriptRunState:Te,widgetMgr:this.widgetMgr,widgetsDisabled:ft,uploadClient:this.uploadClient,componentRegistry:this.componentRegistry,formsData:this.state.formsData,appLogo:Me.logo,appPages:st,navSections:Ke,onPageChange:this.onPageChange,currentPageScriptHash:$e,hideSidebarNav:Ie||Le,expandSidebarNav:Ne}),ut]})})})})}}const AppWithScreenCast=withScreencast(App);function useThemeManager(){const ye=getDefaultTheme(),[$,e]=reactExports.useState(ye),[Y,Me]=reactExports.useState([]),[Ae,Se]=reactExports.useState([...createPresetThemes(),...isPresetTheme(ye)?[]:[ye]]),ve=De=>{Se([...createPresetThemes(),...De])},ze=reactExports.useCallback(De=>{De!==$&&(e(De),De.name===AUTO_THEME_NAME?removeCachedTheme():setCachedTheme(De))},[e,$]),Te=reactExports.useCallback(()=>{$.name===AUTO_THEME_NAME&&ze(getHostSpecifiedTheme());const De=Ae.filter(Ie=>Ie.name!==AUTO_THEME_NAME);Se([createAutoTheme(),...De])},[$.name,Ae,ze]),we=reactExports.useCallback(De=>{De.fontFaces&&Me(De.fontFaces);const Ie=new CustomThemeConfig(De),Ce=createTheme(CUSTOM_THEME_NAME,Ie);ze(Ce)},[Me,ze]);return reactExports.useEffect(()=>{const De=window.matchMedia("(prefers-color-scheme: dark)");return De.addEventListener("change",Te),window.addEventListener("afterprint",Te),()=>{window.removeEventListener("afterprint",Te),De.removeEventListener("change",Te)}},[$,Ae,Te]),[{setTheme:ze,activeTheme:$,addThemes:ve,availableThemes:Ae,setImportedTheme:we},Y]}const ThemedApp=({streamlitExecutionStartedAt:ye})=>{const[$,e]=useThemeManager(),{activeTheme:Y}=$,Me=Y.name===CUSTOM_THEME_NAME&&e.length>0;return jsx$1(RootStyleProvider,{theme:Y,children:jsx$1(WindowDimensionsProvider,{children:jsxs(PortalProvider,{children:[Me&&jsx$1(FontFaceDeclaration,{fontFaces:e}),jsx$1(AppWithScreenCast,{theme:$,streamlitExecutionStartedAt:ye})]})})})},streamlitExecutionStartedAt=Date.now(),engine=new StyletronClient({prefix:"st-"});ReactDOM.render(jsx$1(Provider$1,{value:engine,children:jsx$1(ThemedApp,{streamlitExecutionStartedAt})}),document.getElementById("root"));export{isDurationType as $,hasLightBackgroundColor as A,jsxs as B,Popover$2 as C,DynamicIcon as D,EmotionIconBase as E,Fragment as F,convertRemToPx as G,ACCESSIBILITY_TYPE as H,transparentize as I,requireToString as J,require$$0 as K,m$3 as L,merge$3 as M,d$2 as N,numbro$1 as O,PortalContext as P,hooks as Q,React as R,lib$3 as S,TRIGGER_TYPE as T,ReactJson as U,getLuminance as V,getTimezone as W,moment as X,isUnsignedIntegerType as Y,isIntegerType as Z,_extends$K as _,range as a,assertNever as a$,isPeriodType as a0,format as a1,isBooleanType as a2,requireIsArray as a3,require_baseKeys as a4,require_getTag as a5,requireIsArguments as a6,requireIsArrayLike as a7,requireIsBuffer$1 as a8,require_isPrototype as a9,isEqual as aA,StyledTooltipContentWrapper as aB,StreamlitMarkdown$1 as aC,LibContext as aD,Resizable as aE,getBlue80 as aF,getSequentialColorsArray as aG,getDivergingColorsArray as aH,getCategoricalColorsArray as aI,getGray70 as aJ,getGray30 as aK,debounce$3 as aL,Global as aM,require_baseMerge as aN,require_createAssigner as aO,toaster as aP,Kind as aQ,AlertElement$1 as aR,propTypesExports as aS,_assertThisInitialized as aT,StyledInlineCode as aU,ErrorElement as aV,ensureError as aW,Skeleton$1 as aX,Skeleton as aY,hoistNonReactStatics as aZ,parseToRgba as a_,requireIsTypedArray as aa,Field as ab,Null as ac,DataFrameCellType as ad,isTimeType as ae,convertTimeToDate as af,isDecimalType as ag,isRangeIndexType as ah,isStringType as ai,isEmptyType as aj,isDatetimeType as ak,isDateType as al,isObjectType as am,isBytesType as an,isNumericType as ao,isCategoricalType as ap,isListType as aq,Arrow$2 as ar,loglevelExports$1 as as,_defineProperty$n as at,_objectWithoutProperties$f as au,jsx as av,_typeof$b as aw,css as ax,mix$1 as ay,getStyledCell as az,reactDomExports as b,forkFocus as b$,DeckGlJsonChart$1 as b0,DEFAULT_IFRAME_SANDBOX_POLICY as b1,DEFAULT_IFRAME_FEATURE_POLICY as b2,darken as b3,BaseButtonSize as b4,BaseButtonKind as b5,BaseButtonTooltip as b6,DynamicButtonLabel as b7,Box as b8,IsSidebarContext as b9,StyledWidgetLabelHelpInline as bA,LabelVisibilityMessage as bB,themeColors as bC,libExports as bD,CAMERA_PERMISSION_URL as bE,StyledWidgetLabelHelp as bF,StyledSpinnerIcon as bG,AcceptFileValue as bH,chatInputAcceptFileProtoValueToEnum as bI,StyledContent as bJ,Checkbox$1 as bK,StyledCheckbox$1 as bL,isFocusVisible as bM,getOverride as bN,getOverrideProps as bO,BaseColorPicker$1 as bP,useStyletron as bQ,mergeOverride as bR,toObjectOverride as bS,Icon$1 as bT,requireReactDom as bU,UIDConsumer as bV,StatefulMenu as bW,mergeOverrides as bX,ChevronDown$1 as bY,ThemeContext as bZ,forkBlur as b_,Placement as ba,getIncreasingGreen as bb,getDecreasingRed as bc,getGray90 as bd,keysToSnakeCase as be,PlotlyChart$1 as bf,WindowDimensionsContext as bg,useResizeObserver as bh,withCalculatedWidth as bi,Video$1 as bj,zip as bk,FileUploaderState as bl,UploadedFileInfo as bm,StyledSpinner as bn,ENABLE_PERIPHERALS_DOCS_URL as bo,Icon$2 as bp,BaseButton as bq,blend as br,labelVisibilityProtoValueToEnum as bs,TooltipIcon as bt,WidgetLabel as bu,Tooltip as bv,styled as bw,getOverrides as bx,LocaleContext as by,ButtonGroup$1 as bz,require_hasPath as c,Select as c0,without as c1,fuzzyFilterSelectOptions as c2,VirtualDropdown as c3,TYPE as c4,classNames as c5,UISelectbox as c6,isValidFormId as c7,toPropertyKey as c8,_setPrototypeOf$9 as c9,requireReactIs$1 as cA,NumberInput$1 as cB,hexToRgb as ca,withWrapper as cb,__awaiter as cc,PropTypes as cd,isFromWindows as ce,StyledWidgetInstructions as cf,isFromMac as cg,SIZE$1 as ch,CUSTOM_INPUT_TYPE as ci,ADJOINED as cj,DeleteAlt$1 as ck,filterOptions as cl,ENHANCER_POSITION as cm,pick as cn,Slider$2 as co,ChevronLeft as cp,ChevronRight as cq,isInForm as cr,TextInput$1 as cs,ThemeProvider$1 as ct,createThemedStyled as cu,createThemedUseStyletron as cv,createThemedWithStyle as cw,expandBorderStyles as cx,withStyle as cy,getAugmentedNamespace as cz,requireReact as d,requirePropTypes as e,requireClassnames as f,getDefaultExportFromCjs$1 as g,require_root as h,isPropValid as i,jsx$1 as j,keyframes as k,requireIsObject as l,requireToNumber as m,newStyled as n,require_Set as o,require_setToArray as p,require_SetCache as q,reactExports as r,require_arrayIncludes as s,require_cacheHas as t,require_arrayIncludesWith as u,requireFlatten as v,groupBy as w,__vitePreload as x,useTheme as y,PLACEMENT as z};