streamlit-nightly 1.42.1.dev20250212__py2.py3-none-any.whl → 1.42.1.dev20250213__py2.py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- streamlit/static/index.html +1 -1
- streamlit/static/static/js/{FileDownload.esm.gmDYBMnS.js → FileDownload.esm.CQLk8h19.js} +1 -1
- streamlit/static/static/js/{FileDropzone.BhS2dkwO.js → FileDropzone.pSxz-Ahp.js} +1 -1
- streamlit/static/static/js/{FormClearHelper.BjdyfMQx.js → FormClearHelper.MBTMVtJR.js} +1 -1
- streamlit/static/static/js/{Hooks.BKB06vs4.js → Hooks.BB61yGbP.js} +1 -1
- streamlit/static/static/js/{InputInstructions.BEaJdOY6.js → InputInstructions.DUkCTpEd.js} +1 -1
- streamlit/static/static/js/{ProgressBar.DycN90bZ.js → ProgressBar.C5fgQJfD.js} +1 -1
- streamlit/static/static/js/{RenderInPortalIfExists.BhsYk57k.js → RenderInPortalIfExists.CpaOvG93.js} +1 -1
- streamlit/static/static/js/{Toolbar.M28tVbcl.js → Toolbar.v8Tqv2Gq.js} +1 -1
- streamlit/static/static/js/{base-input.BJFXZaN6.js → base-input.DQoCWi66.js} +1 -1
- streamlit/static/static/js/{createSuper.CR2BB5ll.js → createSuper.BK8Z-_aN.js} +1 -1
- streamlit/static/static/js/{data-grid-overlay-editor.DThw5LO3.js → data-grid-overlay-editor.sQXXbEQc.js} +1 -1
- streamlit/static/static/js/{downloader.oXcdDod3.js → downloader.CBU6LqAH.js} +1 -1
- streamlit/static/static/js/{es6.Dm6Lr5sS.js → es6.BkzLR4SH.js} +2 -2
- streamlit/static/static/js/{iframeResizer.contentWindow.EQIQrAd4.js → iframeResizer.contentWindow.BWR-QZPU.js} +1 -1
- streamlit/static/static/js/{index.BjOrvaSf.js → index.02UPRM4u.js} +1 -1
- streamlit/static/static/js/{index.DwnmFzkn.js → index.BFgBiiD3.js} +1 -1
- streamlit/static/static/js/{index.BZUNGvtg.js → index.B_WG5L8M.js} +1 -1
- streamlit/static/static/js/{index.BmunCvlQ.js → index.Bfg30EwC.js} +1 -1
- streamlit/static/static/js/{index.BELZ0Ua3.js → index.BxCfgnjZ.js} +1 -1
- streamlit/static/static/js/{index.YLipy1A9.js → index.CDVZ2TDm.js} +1 -1
- streamlit/static/static/js/{index.D-x9B5Oa.js → index.COkvJMzk.js} +1 -1
- streamlit/static/static/js/{index.C8ahq2Yl.js → index.CR2BflF1.js} +1 -1
- streamlit/static/static/js/{index.X-CeecsU.js → index.Cc062Jg9.js} +1 -1
- streamlit/static/static/js/{index.CYR86Hh7.js → index.Cf0iIAIE.js} +1 -1
- streamlit/static/static/js/{index.Cb9G_5ys.js → index.CffLO6hN.js} +1 -1
- streamlit/static/static/js/{index.B2zhJEHf.js → index.CixCUOrl.js} +1 -1
- streamlit/static/static/js/{index.CIgcpP2h.js → index.Clj6OmMF.js} +1 -1
- streamlit/static/static/js/{index.C02XURgk.js → index.CoMa-t-w.js} +1 -1
- streamlit/static/static/js/{index.V7XbIe_g.js → index.CrxVEeB-.js} +1 -1
- streamlit/static/static/js/{index.CPA4hfh-.js → index.CvEI9X-f.js} +1 -1
- streamlit/static/static/js/{index.CAvxO15c.js → index.CwAYTt1Y.js} +1 -1
- streamlit/static/static/js/{index.DHr41xKA.js → index.D0osH916.js} +1 -1
- streamlit/static/static/js/{index.tuHBuV8y.js → index.D8iXl6x2.js} +1 -1
- streamlit/static/static/js/{index.DvCjEp1s.js → index.DAToD4K3.js} +1 -1
- streamlit/static/static/js/{index.B1X_ANFX.js → index.DELSGlxt.js} +1 -1
- streamlit/static/static/js/{index.0Eb9CO_K.js → index.DEM0L6H3.js} +1 -1
- streamlit/static/static/js/{index.DxFBqI9I.js → index.DKf-DfNC.js} +1 -1
- streamlit/static/static/js/{index.DXjCUYHV.js → index.DYr9xjMM.js} +1 -1
- streamlit/static/static/js/{index.B49jyHZy.js → index.DomTQtR6.js} +1 -1
- streamlit/static/static/js/{index.BkwFDrjh.js → index.Dpj7tPYL.js} +1 -1
- streamlit/static/static/js/index.DsQaFQFS.js +3866 -0
- streamlit/static/static/js/{index.xghdNmh6.js → index.EH4m1wP6.js} +1 -1
- streamlit/static/static/js/{index.DhzvJb2S.js → index.Ii5wPeV7.js} +1 -1
- streamlit/static/static/js/{index.D2G_9kKo.js → index.a7BGlvvM.js} +1 -1
- streamlit/static/static/js/{index.BzhkD1G1.js → index.eHoq0Wlo.js} +1 -1
- streamlit/static/static/js/{index.C-qfcK5k.js → index.fj3RIZWm.js} +5 -5
- streamlit/static/static/js/{index.Vm77sF3W.js → index.llR6tBo1.js} +1 -1
- streamlit/static/static/js/{index.BrTAJ7cx.js → index.qnLB2_zl.js} +4 -4
- streamlit/static/static/js/{index.CqE8cJhC.js → index.tSuoenpM.js} +1 -1
- streamlit/static/static/js/{index.Cm_RlOaX.js → index.yO4xH6uE.js} +1 -1
- streamlit/static/static/js/{index.CYO_k8m0.js → index.ykXmoFpc.js} +1 -1
- streamlit/static/static/js/{input.Ch5EKcBw.js → input.B4stmvN0.js} +1 -1
- streamlit/static/static/js/{memory.cKfo0PEw.js → memory.XA-dIWLT.js} +1 -1
- streamlit/static/static/js/{mergeWith.CrVvaazT.js → mergeWith.CcgQuDzY.js} +1 -1
- streamlit/static/static/js/{number-overlay-editor.C5_oSHKj.js → number-overlay-editor.DYhrfubJ.js} +1 -1
- streamlit/static/static/js/{possibleConstructorReturn.B1H1HPCb.js → possibleConstructorReturn.xDcsJx3s.js} +1 -1
- streamlit/static/static/js/{sandbox.ZiYcTL56.js → sandbox.CLJ4gp4I.js} +1 -1
- streamlit/static/static/js/{textarea.GanBEqei.js → textarea.DSm0hm1U.js} +1 -1
- streamlit/static/static/js/{timepicker.D-6GNeM1.js → timepicker.Fjiqqxx5.js} +1 -1
- streamlit/static/static/js/{toConsumableArray.DP3pcQU2.js → toConsumableArray.PenvhOPs.js} +1 -1
- streamlit/static/static/js/{uniqueId.Br0SB0lz.js → uniqueId.ynnLb_x1.js} +1 -1
- streamlit/static/static/js/{useBasicWidgetState.DDri_chl.js → useBasicWidgetState.XVUHxSoX.js} +1 -1
- streamlit/static/static/js/{useOnInputChange.DwB-vggD.js → useOnInputChange.CpUN-Dxl.js} +1 -1
- streamlit/static/static/js/{withFullScreenWrapper.sAYwL3bu.js → withFullScreenWrapper.ClJkH0kM.js} +1 -1
- {streamlit_nightly-1.42.1.dev20250212.dist-info → streamlit_nightly-1.42.1.dev20250213.dist-info}/METADATA +1 -1
- {streamlit_nightly-1.42.1.dev20250212.dist-info → streamlit_nightly-1.42.1.dev20250213.dist-info}/RECORD +71 -71
- streamlit/static/static/js/index.L2uUYiab.js +0 -3842
- {streamlit_nightly-1.42.1.dev20250212.data → streamlit_nightly-1.42.1.dev20250213.data}/scripts/streamlit.cmd +0 -0
- {streamlit_nightly-1.42.1.dev20250212.dist-info → streamlit_nightly-1.42.1.dev20250213.dist-info}/WHEEL +0 -0
- {streamlit_nightly-1.42.1.dev20250212.dist-info → streamlit_nightly-1.42.1.dev20250213.dist-info}/entry_points.txt +0 -0
- {streamlit_nightly-1.42.1.dev20250212.dist-info → streamlit_nightly-1.42.1.dev20250213.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.
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index.BxCfgnjZ.js","./RenderInPortalIfExists.CpaOvG93.js","./index.CixCUOrl.js","./index.fj3RIZWm.js","./FormClearHelper.MBTMVtJR.js","./withFullScreenWrapper.ClJkH0kM.js","./Toolbar.v8Tqv2Gq.js","./mergeWith.CcgQuDzY.js","./sprintf.C-r3gIuM.js","./createDownloadLinkElement.DZMwyjvU.js","./toConsumableArray.PenvhOPs.js","./possibleConstructorReturn.xDcsJx3s.js","./createSuper.BK8Z-_aN.js","./FileDownload.esm.CQLk8h19.js","../css/index.Bmkmz40k.css","./index.CvEI9X-f.js","./threshold.B8r8f5kt.js","./value.iufjd77T.js","./timer.RueuYoQV.js","./index.DsQaFQFS.js","./useBasicWidgetState.XVUHxSoX.js","./axios.upsvKRUO.js","../css/index.DzuxGC_t.css","./index.B_WG5L8M.js","./index.Dpj7tPYL.js","./index.yO4xH6uE.js","./index.llR6tBo1.js","./Hooks.BB61yGbP.js","./index.Cc062Jg9.js","./index.DYr9xjMM.js","./index.Bfg30EwC.js","./UploadFileInfo.C-jY39rj.js","./ProgressBar.C5fgQJfD.js","./index.ykXmoFpc.js","./FileDropzone.pSxz-Ahp.js","./InputInstructions.DUkCTpEd.js","./inputUtils.CQWz5UKz.js","./textarea.DSm0hm1U.js","./base-input.DQoCWi66.js","./index.CffLO6hN.js","./index.eHoq0Wlo.js","./index.tSuoenpM.js","./timepicker.Fjiqqxx5.js","./input.B4stmvN0.js","./index.DELSGlxt.js","./index.DEM0L6H3.js","./index.CoMa-t-w.js","./index.CwAYTt1Y.js","./index.DAToD4K3.js","./index.02UPRM4u.js","./index.D8iXl6x2.js","./uniqueId.ynnLb_x1.js","./useOnInputChange.CpUN-Dxl.js","./index.Clj6OmMF.js","./index.EH4m1wP6.js","./index.CR2BflF1.js"])))=>i.map(i=>d[i]);
|
2
2
|
var E0=Object.defineProperty;var l0=rt=>{throw TypeError(rt)};var S0=(rt,tt,et)=>tt in rt?E0(rt,tt,{enumerable:!0,configurable:!0,writable:!0,value:et}):rt[tt]=et;var fo=(rt,tt,et)=>S0(rt,typeof tt!="symbol"?tt+"":tt,et),xa=(rt,tt,et)=>tt.has(rt)||l0("Cannot "+et);var xr=(rt,tt,et)=>(xa(rt,tt,"read from private field"),et?et.call(rt):tt.get(rt)),xn=(rt,tt,et)=>tt.has(rt)?l0("Cannot add the same private member more than once"):tt instanceof WeakSet?tt.add(rt):tt.set(rt,et),Cn=(rt,tt,et,nt)=>(xa(rt,tt,"write to private field"),nt?nt.call(rt,et):tt.set(rt,et),et),Wr=(rt,tt,et)=>(xa(rt,tt,"access private method"),et);function _mergeNamespaces(rt,tt){for(var et=0;et<tt.length;et++){const nt=tt[et];if(typeof nt!="string"&&!Array.isArray(nt)){for(const ot in nt)if(ot!=="default"&&!(ot in rt)){const at=Object.getOwnPropertyDescriptor(nt,ot);at&&Object.defineProperty(rt,ot,at.get?at:{enumerable:!0,get:()=>nt[ot]})}}}return Object.freeze(Object.defineProperty(rt,Symbol.toStringTag,{value:"Module"}))}(function(){const tt=document.createElement("link").relList;if(tt&&tt.supports&&tt.supports("modulepreload"))return;for(const ot of document.querySelectorAll('link[rel="modulepreload"]'))nt(ot);new MutationObserver(ot=>{for(const at of ot)if(at.type==="childList")for(const st of at.addedNodes)st.tagName==="LINK"&&st.rel==="modulepreload"&&nt(st)}).observe(document,{childList:!0,subtree:!0});function et(ot){const at={};return ot.integrity&&(at.integrity=ot.integrity),ot.referrerPolicy&&(at.referrerPolicy=ot.referrerPolicy),ot.crossOrigin==="use-credentials"?at.credentials="include":ot.crossOrigin==="anonymous"?at.credentials="omit":at.credentials="same-origin",at}function nt(ot){if(ot.ep)return;ot.ep=!0;const at=et(ot);fetch(ot.href,at)}})();var commonjsGlobal$2=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function getDefaultExportFromCjs$1(rt){return rt&&rt.__esModule&&Object.prototype.hasOwnProperty.call(rt,"default")?rt.default:rt}function getAugmentedNamespace(rt){if(rt.__esModule)return rt;var tt=rt.default;if(typeof tt=="function"){var et=function nt(){return this instanceof nt?Reflect.construct(tt,arguments,this.constructor):tt.apply(this,arguments)};et.prototype=tt.prototype}else et={};return Object.defineProperty(et,"__esModule",{value:!0}),Object.keys(rt).forEach(function(nt){var ot=Object.getOwnPropertyDescriptor(rt,nt);Object.defineProperty(et,nt,ot.get?ot:{enumerable:!0,get:function(){return rt[nt]}})}),et}var jsxRuntime={exports:{}},reactJsxRuntime_production_min={},react={exports:{}},react_production_min={};/**
|
3
3
|
* @license React
|
4
4
|
* react.production.min.js
|
@@ -66,7 +66,7 @@ index signature as the original data.
|
|
66
66
|
|
67
67
|
In this case, \`add_rows()\` received \`${JSON.stringify(et)}\`
|
68
68
|
but was expecting \`${JSON.stringify(nt)}\`.
|
69
|
-
`)}return rt.map(et=>{var nt;if(isRangeIndexType(et)&&et.pandasType){const{stop:ot,step:at}=et.pandasType.metadata,{start:st,stop:ut,step:ct}=(nt=tt[0].pandasType)==null?void 0:nt.metadata,pt=(ut-st)/ct,dt=ot+pt*at;return{...et,pandasType:{...et.pandasType,metadata:{...et.pandasType.metadata,stop:dt}}}}return et})}function concatDataTypes(rt,tt){return rt.length===0?tt:rt}function concat(rt,tt,et,nt,ot,at,st,ut){const ct=concatIndexes(et,tt,st,at),pt=concatData(nt,rt,ut,ot),{indexTypes:dt,dataTypes:ft}=concatTypes(tt,rt,at,ot);return{index:ct,data:pt,indexTypes:dt,dataTypes:ft}}function isPandasRangeIndex(rt){return typeof rt=="object"&&rt.kind==="range"}function parsePandasSchema(rt){const tt=rt.schema.metadata.get("pandas");if(!m$4(tt))return JSON.parse(tt)}function parsePandasIndexData(rt,tt){return tt?tt.index_columns.map(et=>{if(isPandasRangeIndex(et)){const{start:ot,stop:at,step:st}=et;return range$1(ot,at,st)}const nt=rt.getChild(et);return nt instanceof Vector&&nt.type instanceof Null?null:nt}).filter(et=>et!==null):[]}function parseHeaderName(rt,tt){if(tt===1)return[rt];try{return JSON.parse(rt.replace(/\(/g,"[").replace(/\)/g,"]").replace(/'/g,'"'))}catch{return[...Array(tt-1).fill(""),rt]}}function parseColumnNames(rt,tt,et){const nt=tt.concat(rt);return unzip$2(nt.map(ot=>ot.arrowField.name.startsWith("__index_level_")?"":ot.arrowField.name).map(ot=>parseHeaderName(ot,(et==null?void 0:et.column_indexes.length)??1)))}function parseData(rt,tt){const et=rt.numRows,nt=tt.length;if(et===0||nt===0)return rt.select([]);const ot=tt.map(at=>at.arrowField.name);return rt.select(ot)}function parsePandasIndexColumnTypes(rt,tt,et){return tt?tt.index_columns.map(ot=>{if(isPandasRangeIndex(ot)){const st=ot.name||"";return{type:DataFrameCellType.INDEX,arrowField:new Field$1(st,new Int_(!0,64),!0),pandasType:{field_name:st,name:st,pandas_type:PandasRangeIndexType,numpy_type:PandasRangeIndexType,metadata:ot}}}const at=rt.fields.find(st=>st.name===ot);if(!at)throw new Error(`Index field ${ot} not found in arrow schema`);return{type:DataFrameCellType.INDEX,arrowField:at,pandasType:tt.columns.find(st=>st.field_name===ot),categoricalOptions:et[at.name]}}):[]}function parseDataColumnTypes(rt,tt,et){return rt.fields.filter(at=>tt?!tt.index_columns.includes(at.name):!0).map(at=>({type:DataFrameCellType.DATA,arrowField:at,pandasType:tt==null?void 0:tt.columns.find(st=>st.field_name===at.name),categoricalOptions:et[at.name]}))}function parseCategoricalOptionsForColumns(rt){const tt={};return rt.schema.fields.forEach((et,nt)=>{var ot,at;if(et.type instanceof Dictionary){const st=(at=(ot=rt.getChildAt(nt))==null?void 0:ot.data[0])==null?void 0:at.dictionary;d$3(st)&&(tt[et.name]=convertVectorToList(st))}}),tt}function parseArrowIpcBytes(rt){const tt=tableFromIPC(rt),et=tt.schema,nt=parsePandasSchema(tt),ot=parseCategoricalOptionsForColumns(tt),at=parsePandasIndexColumnTypes(et,nt,ot),st=parseDataColumnTypes(et,nt,ot),ut=parseData(tt,st),ct=parsePandasIndexData(tt,nt),pt=parseColumnNames(st,at,nt);return{pandasIndexData:ct,data:ut,columnNames:pt,pandasIndexColumnTypes:at,dataColumnTypes:st}}var _a;_a=L;class Quiver{constructor(tt){var ct;this[_a]=!0;const{pandasIndexData:et,columnNames:nt,data:ot,dataColumnTypes:at,pandasIndexColumnTypes:st}=parseArrowIpcBytes(tt.data),ut=tt.styler?parseStyler(tt.styler):void 0;this._pandasIndexData=et,this._columnNames=nt,this._data=ot,this._dataColumnTypes=at,this._pandasIndexColumnTypes=st,this._styler=ut,this._num_bytes=((ct=tt.data)==null?void 0:ct.length)??0}get columnNames(){return this._columnNames}get columnTypes(){return this._pandasIndexColumnTypes.concat(this._dataColumnTypes)}get styler(){return this._styler}get dimensions(){const tt=this._pandasIndexColumnTypes.length||0,et=this._columnNames.length||1,nt=this._data.numRows||0,ot=this._dataColumnTypes.length||0,at=et+nt,st=tt+ot;return{numHeaderRows:et,numIndexColumns:tt,numDataRows:nt,numDataColumns:ot,numRows:at,numColumns:st}}get hash(){const tt=[this.dimensions.numColumns,this.dimensions.numDataColumns,this.dimensions.numDataRows,this.dimensions.numIndexColumns,this.dimensions.numHeaderRows,this.dimensions.numRows,this._num_bytes,this._columnNames];return hashString(tt.join("-"))}getCell(tt,et){const{numIndexColumns:nt,numDataRows:ot,numColumns:at}=this.dimensions;if(tt<0||tt>=ot)throw new Error(`Row index is out of range: ${tt}`);if(et<0||et>=at)throw new Error(`Column index is out of range: ${et}`);if(et<nt){const dt=this._pandasIndexColumnTypes[et],ft=this.getIndexValue(tt,et);return{type:DataFrameCellType.INDEX,content:ft,contentType:dt,field:dt.arrowField}}const ut=et-nt,ct=this._dataColumnTypes[ut],pt=this.getDataValue(tt,ut);return{type:DataFrameCellType.DATA,content:pt,contentType:ct,field:ct.arrowField}}getIndexValue(tt,et){const nt=this._pandasIndexData[et];return nt instanceof Vector?nt.get(tt):nt[tt]}getDataValue(tt,et){var nt;return(nt=this._data.getChildAt(et))==null?void 0:nt.get(tt)}addRows(tt){if(this.styler||tt.styler)throw new Error("\nUnsupported operation. `add_rows()` does not support Pandas Styler objects.\n\nIf you do not need the Styler's styles, try passing the `.data` attribute of\nthe Styler object instead to concatenate just the underlying dataframe.\n\nFor example:\n```\nst.add_rows(my_styler.data)\n```\n");if(tt.dimensions.numDataRows===0)return fn(this,st=>st);if(this.dimensions.numDataRows===0)return fn(tt,st=>st);const{index:et,data:nt,indexTypes:ot,dataTypes:at}=concat(this._dataColumnTypes,this._pandasIndexColumnTypes,this._pandasIndexData,this._data,tt._dataColumnTypes,tt._pandasIndexColumnTypes,tt._pandasIndexData,tt._data);return fn(this,st=>{st._pandasIndexData=et,st._data=nt,st._pandasIndexColumnTypes=ot,st._dataColumnTypes=at})}}function parseStyler(rt){return{uuid:rt.uuid,caption:rt.caption,cssStyles:rt.styles,cssId:rt.uuid?`T_${rt.uuid}`:void 0,displayValues:new Quiver({data:rt.displayValues})}}function ensureError(rt){return rt instanceof Error?rt:new Error(`${rt}`)}const NO_SCRIPT_RUN_ID="NO_SCRIPT_RUN_ID";class ElementNode{constructor(tt,et,nt,ot,at){this.element=tt,this.metadata=et,this.scriptRunId=nt,this.activeScriptHash=ot,this.fragmentId=at}get quiverElement(){if(this.lazyQuiverElement!==void 0)return this.lazyQuiverElement;if(this.element.type!=="arrowTable"&&this.element.type!=="arrowDataFrame")throw new Error(`elementType '${this.element.type}' is not a valid Quiver element!`);const tt=new Quiver(this.element[this.element.type]);return this.lazyQuiverElement=tt,tt}get vegaLiteChartElement(){if(this.lazyVegaLiteChartElement!==void 0)return this.lazyVegaLiteChartElement;if(this.element.type!=="arrowVegaLiteChart")throw new Error(`elementType '${this.element.type}' is not a valid VegaLiteChartElement!`);const tt=this.element.arrowVegaLiteChart,et=tt.data?new Quiver(tt.data):null,nt=tt.datasets.length>0?wrapDatasets(tt.datasets):[],ot={data:et,spec:tt.spec,datasets:nt,useContainerWidth:tt.useContainerWidth,vegaLiteTheme:tt.theme,id:tt.id,selectionMode:tt.selectionMode,formId:tt.formId};return this.lazyVegaLiteChartElement=ot,ot}getIn(){}setIn(){throw new Error("'setIn' cannot be called on an ElementNode")}filterMainScriptElements(tt){if(this.activeScriptHash===tt)return this}clearStaleNodes(tt,et,nt){return et&&et.length&&(!this.fragmentId||!nt||this.scriptRunId===tt)?this:this.scriptRunId===tt?this:void 0}getElements(tt){return m$4(tt)&&(tt=new Set),tt.add(this.element),tt}arrowAddRows(tt,et){const nt=this.element.type,ot=new ElementNode(this.element,this.metadata,et,this.activeScriptHash,this.fragmentId);switch(nt){case"arrowTable":case"arrowDataFrame":{ot.lazyQuiverElement=ElementNode.quiverAddRowsHelper(this.quiverElement,tt);break}case"arrowVegaLiteChart":{ot.lazyVegaLiteChartElement=ElementNode.vegaLiteChartAddRowsHelper(this.vegaLiteChartElement,tt);break}default:throw new Error(`elementType '${this.element.type}' is not a valid arrowAddRows target!`)}return ot}static quiverAddRowsHelper(tt,et){if(et.hasName)throw new Error("Add rows cannot be used with a named dataset for this element.");const nt=new Quiver(et.data);return tt.addRows(nt)}static vegaLiteChartAddRowsHelper(tt,et){const nt=et.hasName?et.name:null,ot=new Quiver(et.data);return fn(tt,at=>{const st=getNamedDataSet(at.datasets,nt);st?st.data=st.data.addRows(ot):at.data=at.data?at.data.addRows(ot):ot})}}function getNamedDataSet(rt,tt){return rt.length===1?rt[0]:rt.find(et=>et.hasName&&et.name===tt)}class BlockNode{constructor(tt,et,nt,ot,at,st){this.activeScriptHash=tt,this.children=et??[],this.deltaBlock=nt??new Block$2({}),this.scriptRunId=ot??NO_SCRIPT_RUN_ID,this.fragmentId=at,this.deltaMsgReceivedAt=st}get isEmpty(){return this.children.length===0}getIn(tt){if(tt.length===0)return;const et=tt[0];if(!(et<0||et>=this.children.length))return tt.length===1?this.children[et]:this.children[et].getIn(tt.slice(1))}setIn(tt,et,nt){if(tt.length===0)throw new Error("empty path!");const ot=tt[0];if(ot<0||ot>this.children.length)throw new Error(`Bad 'setIn' index ${ot} (should be between [0, ${this.children.length}])`);const at=this.children.slice();return tt.length===1?at[ot]=et:at[ot]=at[ot].setIn(tt.slice(1),et,nt),new BlockNode(this.activeScriptHash,at,this.deltaBlock,nt,this.fragmentId,this.deltaMsgReceivedAt)}filterMainScriptElements(tt){if(this.activeScriptHash!==tt)return;const et=this.children.map(nt=>nt.filterMainScriptElements(tt)).filter(notUndefined);return new BlockNode(this.activeScriptHash,et,this.deltaBlock,this.scriptRunId,this.fragmentId,this.deltaMsgReceivedAt)}clearStaleNodes(tt,et,nt){if(!et||!et.length){if(this.scriptRunId!==tt)return}else{if(nt&&this.scriptRunId!==tt)return;this.fragmentId&&et.includes(this.fragmentId)&&this.scriptRunId===tt&&(nt=this.fragmentId)}const ot=this.children.map(at=>at.clearStaleNodes(tt,et,nt)).filter(notUndefined);return new BlockNode(this.activeScriptHash,ot,this.deltaBlock,tt,this.fragmentId,this.deltaMsgReceivedAt)}getElements(tt){m$4(tt)&&(tt=new Set);for(const et of this.children)et.getElements(tt);return tt}}class AppRoot{static empty(tt="",et=!0,nt,ot){const at=[];let st;switch(getLoadingScreenType()){case LoadingScreenType.NONE:break;case LoadingScreenType.V1:et&&(st=makeElementWithInfoText("Please wait..."));break;default:st=makeAppSkeletonElement()}st&&at.push(new ElementNode(st,ForwardMsgMetadata.create({}),NO_SCRIPT_RUN_ID,tt));const ut=new BlockNode(tt,at,new Block$2({allowEmpty:!0}),NO_SCRIPT_RUN_ID),ct=nt||new BlockNode(tt,[],new Block$2({allowEmpty:!0}),NO_SCRIPT_RUN_ID),pt=new BlockNode(tt,[],new Block$2({allowEmpty:!0}),NO_SCRIPT_RUN_ID),dt=new BlockNode(tt,[],new Block$2({allowEmpty:!0}),NO_SCRIPT_RUN_ID),ft=ot?{logo:ot,activeScriptHash:tt,scriptRunId:NO_SCRIPT_RUN_ID}:null;return new AppRoot(tt,new BlockNode(tt,[ut,ct,pt,dt]),ft)}constructor(tt,et,nt=null){if(this.mainScriptHash=tt,this.root=et,this.appLogo=nt,this.root.children.length!==4||m$4(this.main)||m$4(this.sidebar)||m$4(this.event)||m$4(this.bottom))throw new Error(`Invalid root node children! ${et}`)}get main(){const[tt]=this.root.children;return tt}get sidebar(){const[,tt]=this.root.children;return tt}get event(){const[,,tt]=this.root.children;return tt}get bottom(){const[,,,tt]=this.root.children;return tt}get logo(){var tt;return((tt=this.appLogo)==null?void 0:tt.logo)??null}appRootWithLogo(tt,et){return new AppRoot(this.mainScriptHash,this.root,{logo:tt,...et})}applyDelta(tt,et,nt){const{deltaPath:ot,activeScriptHash:at}=nt;switch(et.type){case"newElement":{const st=et.newElement;return this.addElement(ot,tt,st,nt,at,et.fragmentId)}case"addBlock":{const st=Date.now();return this.addBlock(ot,et.addBlock,tt,at,et.fragmentId,st)}case"arrowAddRows":try{return this.arrowAddRows(ot,et.arrowAddRows,tt)}catch(st){const ut=makeElementWithErrorText(ensureError(st).message);return this.addElement(ot,tt,ut,nt,at)}default:throw new Error(`Unrecognized deltaType: '${et.type}'`)}}filterMainScriptElements(tt){var ct;const et=this.main.scriptRunId,nt=this.main.filterMainScriptElements(tt)||new BlockNode(tt),ot=this.sidebar.filterMainScriptElements(tt)||new BlockNode(tt),at=this.event.filterMainScriptElements(tt)||new BlockNode(tt),st=this.bottom.filterMainScriptElements(tt)||new BlockNode(tt),ut=((ct=this.appLogo)==null?void 0:ct.activeScriptHash)===tt?this.appLogo:null;return new AppRoot(tt,new BlockNode(tt,[nt,ot,at,st],new Block$2({allowEmpty:!0}),et),ut)}clearStaleNodes(tt,et){var ct;const nt=this.main.clearStaleNodes(tt,et)||new BlockNode(this.mainScriptHash),ot=this.sidebar.clearStaleNodes(tt,et)||new BlockNode(this.mainScriptHash),at=this.event.clearStaleNodes(tt,et)||new BlockNode(this.mainScriptHash),st=this.bottom.clearStaleNodes(tt,et)||new BlockNode(this.mainScriptHash),ut=((ct=this.appLogo)==null?void 0:ct.scriptRunId)===tt?this.appLogo:null;return new AppRoot(this.mainScriptHash,new BlockNode(this.mainScriptHash,[nt,ot,at,st],new Block$2({allowEmpty:!0}),tt),ut)}getElements(){const tt=new Set;return this.main.getElements(tt),this.sidebar.getElements(tt),this.event.getElements(tt),this.bottom.getElements(tt),tt}addElement(tt,et,nt,ot,at,st){const ut=new ElementNode(nt,ot,et,at,st);return new AppRoot(this.mainScriptHash,this.root.setIn(tt,ut,et),this.appLogo)}addBlock(tt,et,nt,ot,at,st){const ut=this.root.getIn(tt);let ct=[];ut instanceof BlockNode&&ut.deltaBlock.type===et.type&&(ct=ut.children);const pt=new BlockNode(ot,ct,et,nt,at,st);return new AppRoot(this.mainScriptHash,this.root.setIn(tt,pt,nt),this.appLogo)}arrowAddRows(tt,et,nt){const ot=this.root.getIn(tt);if(m$4(ot))throw new Error(`Can't arrowAddRows: invalid deltaPath: ${tt}`);const at=ot.arrowAddRows(et,nt);return new AppRoot(this.mainScriptHash,this.root.setIn(tt,at,nt),this.appLogo)}}function wrapDatasets(rt){return rt.map(tt=>({hasName:tt.hasName,name:tt.name,data:new Quiver(tt.data)}))}var classnames={exports:{}};/*!
|
69
|
+
`)}return rt.map(et=>{var nt;if(isRangeIndexType(et)&&et.pandasType){const{stop:ot,step:at}=et.pandasType.metadata,{start:st,stop:ut,step:ct}=(nt=tt[0].pandasType)==null?void 0:nt.metadata,pt=(ut-st)/ct,dt=ot+pt*at;return{...et,pandasType:{...et.pandasType,metadata:{...et.pandasType.metadata,stop:dt}}}}return et})}function concatDataTypes(rt,tt){return rt.length===0?tt:rt}function concat(rt,tt,et,nt,ot,at,st,ut){const ct=concatIndexes(et,tt,st,at),pt=concatData(nt,rt,ut,ot),{indexTypes:dt,dataTypes:ft}=concatTypes(tt,rt,at,ot);return{index:ct,data:pt,indexTypes:dt,dataTypes:ft}}function isPandasRangeIndex(rt){return typeof rt=="object"&&rt.kind==="range"}function parsePandasSchema(rt){const tt=rt.schema.metadata.get("pandas");if(!m$4(tt))return JSON.parse(tt)}function parsePandasIndexData(rt,tt){return tt?tt.index_columns.map(et=>{if(isPandasRangeIndex(et)){const{start:ot,stop:at,step:st}=et;return range$1(ot,at,st)}const nt=rt.getChild(et);return nt instanceof Vector&&nt.type instanceof Null?null:nt}).filter(et=>et!==null):[]}function parseHeaderName(rt,tt){if(tt===1)return[rt];try{return JSON.parse(rt.replace(/\(/g,"[").replace(/\)/g,"]").replace(/'/g,'"'))}catch{return[...Array(tt-1).fill(""),rt]}}function parseColumnNames(rt,tt,et){const nt=tt.concat(rt);return unzip$2(nt.map(ot=>ot.arrowField.name.startsWith("__index_level_")?"":ot.arrowField.name).map(ot=>parseHeaderName(ot,(et==null?void 0:et.column_indexes.length)??1)))}function parseData(rt,tt){const et=rt.numRows,nt=tt.length;if(et===0||nt===0)return rt.select([]);const ot=tt.map(at=>at.arrowField.name);return rt.select(ot)}function parsePandasIndexColumnTypes(rt,tt,et){return tt?tt.index_columns.map(ot=>{if(isPandasRangeIndex(ot)){const st=ot.name||"";return{type:DataFrameCellType.INDEX,arrowField:new Field$1(st,new Int_(!0,64),!0),pandasType:{field_name:st,name:st,pandas_type:PandasRangeIndexType,numpy_type:PandasRangeIndexType,metadata:ot}}}const at=rt.fields.find(st=>st.name===ot);if(!at)throw new Error(`Index field ${ot} not found in arrow schema`);return{type:DataFrameCellType.INDEX,arrowField:at,pandasType:tt.columns.find(st=>st.field_name===ot),categoricalOptions:et[at.name]}}):[]}function parseDataColumnTypes(rt,tt,et){return rt.fields.filter(at=>tt?!tt.index_columns.includes(at.name):!0).map(at=>({type:DataFrameCellType.DATA,arrowField:at,pandasType:tt==null?void 0:tt.columns.find(st=>st.field_name===at.name),categoricalOptions:et[at.name]}))}function parseCategoricalOptionsForColumns(rt){const tt={};return rt.schema.fields.forEach((et,nt)=>{var ot,at;if(et.type instanceof Dictionary){const st=(at=(ot=rt.getChildAt(nt))==null?void 0:ot.data[0])==null?void 0:at.dictionary;d$3(st)&&(tt[et.name]=convertVectorToList(st))}}),tt}function parseArrowIpcBytes(rt){const tt=tableFromIPC(rt),et=tt.schema,nt=parsePandasSchema(tt),ot=parseCategoricalOptionsForColumns(tt),at=parsePandasIndexColumnTypes(et,nt,ot),st=parseDataColumnTypes(et,nt,ot),ut=parseData(tt,st),ct=parsePandasIndexData(tt,nt),pt=parseColumnNames(st,at,nt);return{pandasIndexData:ct,data:ut,columnNames:pt,pandasIndexColumnTypes:at,dataColumnTypes:st}}var _a;_a=L;class Quiver{constructor(tt){var ct;this[_a]=!0;const{pandasIndexData:et,columnNames:nt,data:ot,dataColumnTypes:at,pandasIndexColumnTypes:st}=parseArrowIpcBytes(tt.data),ut=tt.styler?parseStyler(tt.styler):void 0;this._pandasIndexData=et,this._columnNames=nt,this._data=ot,this._dataColumnTypes=at,this._pandasIndexColumnTypes=st,this._styler=ut,this._num_bytes=((ct=tt.data)==null?void 0:ct.length)??0}get columnNames(){return this._columnNames}get columnTypes(){return this._pandasIndexColumnTypes.concat(this._dataColumnTypes)}get styler(){return this._styler}get dimensions(){const tt=this._pandasIndexColumnTypes.length||0,et=this._columnNames.length||1,nt=this._data.numRows||0,ot=this._dataColumnTypes.length||0,at=et+nt,st=tt+ot;return{numHeaderRows:et,numIndexColumns:tt,numDataRows:nt,numDataColumns:ot,numRows:at,numColumns:st}}get hash(){const tt=[this.dimensions.numColumns,this.dimensions.numDataColumns,this.dimensions.numDataRows,this.dimensions.numIndexColumns,this.dimensions.numHeaderRows,this.dimensions.numRows,this._num_bytes,this._columnNames];return hashString(tt.join("-"))}getCell(tt,et){const{numIndexColumns:nt,numDataRows:ot,numColumns:at}=this.dimensions;if(tt<0||tt>=ot)throw new Error(`Row index is out of range: ${tt}`);if(et<0||et>=at)throw new Error(`Column index is out of range: ${et}`);if(et<nt){const dt=this._pandasIndexColumnTypes[et],ft=this.getIndexValue(tt,et);return{type:DataFrameCellType.INDEX,content:ft,contentType:dt,field:dt.arrowField}}const ut=et-nt,ct=this._dataColumnTypes[ut],pt=this.getDataValue(tt,ut);return{type:DataFrameCellType.DATA,content:pt,contentType:ct,field:ct.arrowField}}getIndexValue(tt,et){const nt=this._pandasIndexData[et];return nt instanceof Vector?nt.get(tt):nt[tt]}getDataValue(tt,et){var nt;return(nt=this._data.getChildAt(et))==null?void 0:nt.get(tt)}addRows(tt){if(this.styler||tt.styler)throw new Error("\nUnsupported operation. `add_rows()` does not support Pandas Styler objects.\n\nIf you do not need the Styler's styles, try passing the `.data` attribute of\nthe Styler object instead to concatenate just the underlying dataframe.\n\nFor example:\n```\nst.add_rows(my_styler.data)\n```\n");if(tt.dimensions.numDataRows===0)return fn(this,st=>st);if(this.dimensions.numDataRows===0)return fn(tt,st=>st);const{index:et,data:nt,indexTypes:ot,dataTypes:at}=concat(this._dataColumnTypes,this._pandasIndexColumnTypes,this._pandasIndexData,this._data,tt._dataColumnTypes,tt._pandasIndexColumnTypes,tt._pandasIndexData,tt._data);return fn(this,st=>{st._pandasIndexData=et,st._data=nt,st._pandasIndexColumnTypes=ot,st._dataColumnTypes=at})}}function parseStyler(rt){return{uuid:rt.uuid,caption:rt.caption,cssStyles:rt.styles,cssId:rt.uuid?`T_${rt.uuid}`:void 0,displayValues:new Quiver({data:rt.displayValues})}}function ensureError(rt){return rt instanceof Error?rt:new Error(`${rt}`)}const NO_SCRIPT_RUN_ID="NO_SCRIPT_RUN_ID";class ElementNode{constructor(tt,et,nt,ot,at){this.element=tt,this.metadata=et,this.scriptRunId=nt,this.activeScriptHash=ot,this.fragmentId=at}get quiverElement(){if(this.lazyQuiverElement!==void 0)return this.lazyQuiverElement;if(this.element.type!=="arrowTable"&&this.element.type!=="arrowDataFrame")throw new Error(`elementType '${this.element.type}' is not a valid Quiver element!`);const tt=new Quiver(this.element[this.element.type]);return this.lazyQuiverElement=tt,tt}get vegaLiteChartElement(){if(this.lazyVegaLiteChartElement!==void 0)return this.lazyVegaLiteChartElement;if(this.element.type!=="arrowVegaLiteChart")throw new Error(`elementType '${this.element.type}' is not a valid VegaLiteChartElement!`);const tt=this.element.arrowVegaLiteChart,et=tt.data?new Quiver(tt.data):null,nt=tt.datasets.length>0?wrapDatasets(tt.datasets):[],ot={data:et,spec:tt.spec,datasets:nt,useContainerWidth:tt.useContainerWidth,vegaLiteTheme:tt.theme,id:tt.id,selectionMode:tt.selectionMode,formId:tt.formId};return this.lazyVegaLiteChartElement=ot,ot}getIn(){}setIn(){throw new Error("'setIn' cannot be called on an ElementNode")}filterMainScriptElements(tt){if(this.activeScriptHash===tt)return this}clearStaleNodes(tt,et,nt){return et&&et.length&&(!this.fragmentId||!nt||this.scriptRunId===tt)?this:this.scriptRunId===tt?this:void 0}getElements(tt){return m$4(tt)&&(tt=new Set),tt.add(this.element),tt}arrowAddRows(tt,et){const nt=this.element.type,ot=new ElementNode(this.element,this.metadata,et,this.activeScriptHash,this.fragmentId);switch(nt){case"arrowTable":case"arrowDataFrame":{ot.lazyQuiverElement=ElementNode.quiverAddRowsHelper(this.quiverElement,tt);break}case"arrowVegaLiteChart":{ot.lazyVegaLiteChartElement=ElementNode.vegaLiteChartAddRowsHelper(this.vegaLiteChartElement,tt);break}default:throw new Error(`elementType '${this.element.type}' is not a valid arrowAddRows target!`)}return ot}static quiverAddRowsHelper(tt,et){if(et.hasName)throw new Error("Add rows cannot be used with a named dataset for this element.");const nt=new Quiver(et.data);return tt.addRows(nt)}static vegaLiteChartAddRowsHelper(tt,et){const nt=et.hasName?et.name:null,ot=new Quiver(et.data);return fn(tt,at=>{const st=getNamedDataSet(at.datasets,nt);st?st.data=st.data.addRows(ot):at.data=at.data?at.data.addRows(ot):ot})}}function getNamedDataSet(rt,tt){return rt.length===1?rt[0]:rt.find(et=>et.hasName&&et.name===tt)}class BlockNode{constructor(tt,et,nt,ot,at,st){this.activeScriptHash=tt,this.children=et??[],this.deltaBlock=nt??new Block$2({}),this.scriptRunId=ot??NO_SCRIPT_RUN_ID,this.fragmentId=at,this.deltaMsgReceivedAt=st}get isEmpty(){return this.children.length===0}getIn(tt){if(tt.length===0)return;const et=tt[0];if(!(et<0||et>=this.children.length))return tt.length===1?this.children[et]:this.children[et].getIn(tt.slice(1))}setIn(tt,et,nt){if(tt.length===0)throw new Error("empty path!");const ot=tt[0];if(ot<0||ot>this.children.length)throw new Error(`Bad 'setIn' index ${ot} (should be between [0, ${this.children.length}])`);const at=this.children.slice();return tt.length===1?at[ot]=et:at[ot]=at[ot].setIn(tt.slice(1),et,nt),new BlockNode(this.activeScriptHash,at,this.deltaBlock,nt,this.fragmentId,this.deltaMsgReceivedAt)}filterMainScriptElements(tt){if(this.activeScriptHash!==tt)return;const et=this.children.map(nt=>nt.filterMainScriptElements(tt)).filter(notUndefined);return new BlockNode(this.activeScriptHash,et,this.deltaBlock,this.scriptRunId,this.fragmentId,this.deltaMsgReceivedAt)}clearStaleNodes(tt,et,nt){if(!et||!et.length){if(this.scriptRunId!==tt)return}else{if(nt&&this.scriptRunId!==tt)return;this.fragmentId&&et.includes(this.fragmentId)&&this.scriptRunId===tt&&(nt=this.fragmentId)}const ot=this.children.map(at=>at.clearStaleNodes(tt,et,nt)).filter(notUndefined);return new BlockNode(this.activeScriptHash,ot,this.deltaBlock,tt,this.fragmentId,this.deltaMsgReceivedAt)}getElements(tt){m$4(tt)&&(tt=new Set);for(const et of this.children)et.getElements(tt);return tt}}class AppRoot{static empty(tt="",et=!0,nt,ot){const at=[];let st;switch(getLoadingScreenType()){case LoadingScreenType.NONE:break;case LoadingScreenType.V1:et&&(st=makeElementWithInfoText("Please wait..."));break;default:st=makeAppSkeletonElement()}st&&at.push(new ElementNode(st,ForwardMsgMetadata.create({}),NO_SCRIPT_RUN_ID,tt));const ut=new BlockNode(tt,at,new Block$2({allowEmpty:!0}),NO_SCRIPT_RUN_ID),ct=nt||new BlockNode(tt,[],new Block$2({allowEmpty:!0}),NO_SCRIPT_RUN_ID),pt=new BlockNode(tt,[],new Block$2({allowEmpty:!0}),NO_SCRIPT_RUN_ID),dt=new BlockNode(tt,[],new Block$2({allowEmpty:!0}),NO_SCRIPT_RUN_ID),ft=ot?{logo:ot,activeScriptHash:tt,scriptRunId:NO_SCRIPT_RUN_ID}:null;return new AppRoot(tt,new BlockNode(tt,[ut,ct,pt,dt]),ft)}constructor(tt,et,nt=null){if(this.mainScriptHash=tt,this.root=et,this.appLogo=nt,this.root.children.length!==4||m$4(this.main)||m$4(this.sidebar)||m$4(this.event)||m$4(this.bottom))throw new Error(`Invalid root node children! ${et}`)}get main(){const[tt]=this.root.children;return tt}get sidebar(){const[,tt]=this.root.children;return tt}get event(){const[,,tt]=this.root.children;return tt}get bottom(){const[,,,tt]=this.root.children;return tt}get logo(){var tt;return((tt=this.appLogo)==null?void 0:tt.logo)??null}appRootWithLogo(tt,et){return new AppRoot(this.mainScriptHash,this.root,{logo:tt,...et})}applyDelta(tt,et,nt){const{deltaPath:ot,activeScriptHash:at}=nt;switch(et.type){case"newElement":{const st=et.newElement;return this.addElement(ot,tt,st,nt,at,et.fragmentId)}case"addBlock":{const st=Date.now();return this.addBlock(ot,et.addBlock,tt,at,et.fragmentId,st)}case"arrowAddRows":try{return this.arrowAddRows(ot,et.arrowAddRows,tt)}catch(st){const ut=makeElementWithErrorText(ensureError(st).message);return this.addElement(ot,tt,ut,nt,at)}default:throw new Error(`Unrecognized deltaType: '${et.type}'`)}}filterMainScriptElements(tt){var ct;const et=this.main.scriptRunId,nt=this.main.filterMainScriptElements(tt)||new BlockNode(tt),ot=this.sidebar.filterMainScriptElements(tt)||new BlockNode(tt),at=this.event.filterMainScriptElements(tt)||new BlockNode(tt),st=this.bottom.filterMainScriptElements(tt)||new BlockNode(tt),ut=((ct=this.appLogo)==null?void 0:ct.activeScriptHash)===tt?this.appLogo:null;return new AppRoot(tt,new BlockNode(tt,[nt,ot,at,st],new Block$2({allowEmpty:!0}),et),ut)}clearStaleNodes(tt,et){var pt;const nt=this.main.clearStaleNodes(tt,et)||new BlockNode(this.mainScriptHash),ot=this.sidebar.clearStaleNodes(tt,et)||new BlockNode(this.mainScriptHash),at=this.event.clearStaleNodes(tt,et)||new BlockNode(this.mainScriptHash),st=this.bottom.clearStaleNodes(tt,et)||new BlockNode(this.mainScriptHash),ct=et&&et.length>0||((pt=this.appLogo)==null?void 0:pt.scriptRunId)===tt?this.appLogo:null;return new AppRoot(this.mainScriptHash,new BlockNode(this.mainScriptHash,[nt,ot,at,st],new Block$2({allowEmpty:!0}),tt),ct)}getElements(){const tt=new Set;return this.main.getElements(tt),this.sidebar.getElements(tt),this.event.getElements(tt),this.bottom.getElements(tt),tt}addElement(tt,et,nt,ot,at,st){const ut=new ElementNode(nt,ot,et,at,st);return new AppRoot(this.mainScriptHash,this.root.setIn(tt,ut,et),this.appLogo)}addBlock(tt,et,nt,ot,at,st){const ut=this.root.getIn(tt);let ct=[];ut instanceof BlockNode&&ut.deltaBlock.type===et.type&&(ct=ut.children);const pt=new BlockNode(ot,ct,et,nt,at,st);return new AppRoot(this.mainScriptHash,this.root.setIn(tt,pt,nt),this.appLogo)}arrowAddRows(tt,et,nt){const ot=this.root.getIn(tt);if(m$4(ot))throw new Error(`Can't arrowAddRows: invalid deltaPath: ${tt}`);const at=ot.arrowAddRows(et,nt);return new AppRoot(this.mainScriptHash,this.root.setIn(tt,at,nt),this.appLogo)}}function wrapDatasets(rt){return rt.map(tt=>({hasName:tt.hasName,name:tt.name,data:new Quiver(tt.data)}))}var classnames={exports:{}};/*!
|
70
70
|
Copyright (c) 2018 Jed Watson.
|
71
71
|
Licensed under the MIT License (MIT), see
|
72
72
|
http://jedwatson.github.io/classnames
|
@@ -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}).`,et}function tryParseArgs(rt,tt,et,nt){if(!nt)try{return parseArgs(rt,tt)}catch(ot){const at=ensureError(ot);et(at)}return[{},[]]}function compareDataframeArgs(rt,tt){return rt===tt||rt.length===tt.length&&rt.every((et,nt)=>{const ot=tt[nt];return et.key===ot.key&&et.value===ot.value})}function ComponentInstance(rt){const tt=useTheme(),[et,nt]=reactExports.useState(),{disabled:ot,element:at,registry:st,widgetMgr:ut,width:ct,fragmentId:pt}=rt,{componentName:dt,jsonArgs:ft,specialArgs:bt,url:ht}=at,[mt,Ot]=tryParseArgs(ft,bt,nt,et),yt=reactExports.useRef({args:{},dataframeArgs:[]}),Mt=compareDataframeArgs(yt.current.dataframeArgs,Ot);yt.current.args=mt,yt.current.dataframeArgs=Ot;const[At,St]=reactExports.useState(),[Et,zt]=reactExports.useState(isNaN(mt.height)?void 0:mt.height),vt=reactExports.useRef(!1),Tt=reactExports.useRef(null),$t=reactExports.useRef(),Rt=useTimeout(()=>log$8.warn(getWarnMessage(dt,ht)),COMPONENT_READY_WARNING_TIME_MS/4),wt=useTimeout(()=>St(!0),COMPONENT_READY_WARNING_TIME_MS);if(reactExports.useEffect(()=>{vt.current&&sendRenderMessage(yt.current.args,yt.current.dataframeArgs,ot,tt,Tt.current??void 0)},[ot,Et,Mt,ft,tt,ct]),reactExports.useEffect(()=>{const Ft=Ut=>{if(Ut===void 0){log$8.warn("handleSetFrameHeight: missing 'height' prop");return}if(Ut!==Et){if(m$4(Tt.current)){log$8.warn("handleSetFrameHeight: missing our iframeRef!");return}Tt.current.height=Ut.toString(),zt(Ut)}},nr=()=>{sendRenderMessage(yt.current.args,yt.current.dataframeArgs,ot,tt,Tt.current??void 0),Rt(),wt(),vt.current=!0,St(!1)};$t.current={isReady:()=>vt.current,element:at,widgetMgr:ut,setComponentError:nt,componentReadyCallback:nr,frameHeightCallback:Ft,fragmentId:pt}},[dt,ot,at,Et,Mt,At,ft,tt,ut,wt,Rt,pt]),reactExports.useEffect(()=>{var nr;const Ft=((nr=Tt.current)==null?void 0:nr.contentWindow)??void 0;if(Ft)return st.registerListener(Ft,createIframeMessageHandler($t)),()=>{Ft&&st.deregisterListener(Ft)}},[st,dt]),et)return jsx$1(ErrorElement,{name:et.name,message:et.message});const It=!vt.current&&!At&&Et!==0&&jsx$1(Skeleton,{element:Skeleton$1.create({height:Et,style:Skeleton$1.SkeletonStyle.ELEMENT})}),kt=!vt.current&&At?jsx$1(AlertElement$1,{width:ct,body:getWarnMessage(dt,ht),kind:Kind.WARNING}):null;return jsxs(Fragment,{children:[It,kt,jsx$1(StyledComponentIframe,{className:"stCustomComponentV1","data-testid":"stCustomComponentV1",allow:DEFAULT_IFRAME_FEATURE_POLICY,ref:Tt,src:getSrc(dt,st,ht),width:ct,height:Et??0,scrolling:"no",sandbox:DEFAULT_IFRAME_SANDBOX_POLICY,title:dt,componentReady:vt.current})]})}const ComponentInstance$1=reactExports.memo(ComponentInstance),log$7=loglevelExports$1.getLogger("ComponentRegistry");class ComponentRegistry{constructor(tt){this.msgListeners=new Map,this.registerListener=(et,nt)=>{this.msgListeners.has(et)&&log$7.warn("MessageEventSource registered multiple times!",et),this.msgListeners.set(et,nt)},this.deregisterListener=et=>{this.msgListeners.delete(et)||log$7.warn("Could not deregister unregistered MessageEventSource!")},this.getComponentURL=(et,nt)=>this.endpoints.buildComponentURL(et,nt),this.onMessageEvent=et=>{if(m$4(et.data)||!et.data.hasOwnProperty("isStreamlitMessage"))return;if(m$4(et.source)){log$7.warn("Received component message with no eventSource!",et.data);return}const nt=this.msgListeners.get(et.source);if(m$4(nt)||typeof nt!="function"){log$7.warn("Received component message for unregistered ComponentInstance!",et.data);return}const{type:ot}=et.data;if(m$4(ot)){log$7.warn("Received Streamlit message with no type!",et.data);return}nt(ot,et.data)},this.endpoints=tt,window.addEventListener("message",this.onMessageEvent)}}const Maybe=reactExports.memo(function rt({children:tt}){return jsx$1(Fragment,{children:tt})},(rt,tt)=>!(rt.enable||tt.enable));function makeMarkdownHeading(rt,tt){switch(rt.toLowerCase()){case Tags.H1:return`# ${tt}`;case Tags.H2:return`## ${tt}`;case Tags.H3:return`### ${tt}`;default:throw new Error(`Unrecognized tag for header: ${rt}`)}}function Heading(rt){const{width:tt,element:et}=rt,{tag:nt,anchor:ot,body:at,help:st,hideAnchor:ut,divider:ct}=et,pt=React$1.useContext(IsSidebarContext),dt=React$1.useContext(IsDialogContext),[ft,...bt]=at.split(`
|
693
693
|
`);return jsxs("div",{style:{width:tt},className:"stHeading","data-testid":"stHeading",children:[jsxs(StyledStreamlitMarkdown,{isCaption:!1,isInSidebarOrDialog:pt||dt,style:{width:tt},"data-testid":"stMarkdownContainer",children:[jsx$1(HeadingWithActionElements,{anchor:ot,help:st,hideAnchor:ut,tag:nt,children:jsx$1(RenderedMarkdown,{allowHTML:!1,source:makeMarkdownHeading(nt,ft),overrideComponents:{p:reactExports.Fragment,h1:reactExports.Fragment,h2:reactExports.Fragment,h3:reactExports.Fragment,h4:reactExports.Fragment,h5:reactExports.Fragment,h6:reactExports.Fragment}})}),bt.length>0&&jsx$1(RenderedMarkdown,{source:bt.join(`
|
694
|
-
`),allowHTML:!1})]}),ct&&jsx$1(StyledHeaderDivider,{"data-testid":"stHeadingDivider",rainbow:ct.includes("linear"),color:ct})]})}const StyledCheckbox$1=newStyled("div",{target:"e6x5rwu0"})(({width:rt,theme:tt})=>({width:rt,display:"flex",alignItems:"center",minHeight:tt.sizes.smallElementHeight})),StyledContent=newStyled("div",{target:"e6x5rwu1"})(({visibility:rt})=>({display:rt===LabelVisibilityOptions.Collapsed?"none":"flex",visibility:rt===LabelVisibilityOptions.Hidden?"hidden":"visible",verticalAlign:"middle",flexDirection:"row",alignItems:"center"}));function translateGapWidth(rt,tt){let et=tt.spacing.lg;return rt==="medium"?et=tt.spacing.threeXL:rt==="large"&&(et=tt.spacing.fourXL),et}const StyledHorizontalBlock=newStyled("div",{target:"e6rk8up0"})(({theme:rt,gap:tt})=>({display:"flex",flexWrap:"wrap",flexGrow:1,alignItems:"stretch",gap:translateGapWidth(tt,rt)})),GLOBAL_ELEMENTS=["balloons","snow"],StyledElementContainer=newStyled("div",{target:"e6rk8up1"})(({theme:rt,isStale:tt,width:et,elementType:nt})=>({width:et,position:"relative","@media print":{overflow:"visible"},":is(.stHtml-empty)":{display:"none"},":has(> .stCacheSpinner)":{height:rt.spacing.none,overflow:"visible",visibility:"visible",marginBottom:`-${rt.spacing.lg}`,zIndex:rt.zIndices.cacheSpinner},":has(> .stPageLink)":{marginTop:`-${rt.spacing.xs}`,marginBottom:`-${rt.spacing.xs}`},...tt&&nt!=="skeleton"&&STALE_STYLES,...nt==="empty"?{display:"none"}:{},...GLOBAL_ELEMENTS.includes(nt)?{marginBottom:`-${rt.spacing.lg}`}:{}})),StyledColumn=newStyled("div",{target:"e6rk8up2"})(({theme:rt,weight:tt,gap:et,showBorder:nt,verticalAlignment:ot})=>{const{VerticalAlignment:at}=Block$2.Column,st=tt*100,ut=translateGapWidth(et,rt),ct=`calc(${st}% - ${ut})`;return{width:ct,flex:`1 1 ${ct}`,[`@media (max-width: ${rt.breakpoints.columns})`]:{minWidth:`calc(100% - ${rt.spacing.twoXL})`},...ot===at.BOTTOM&&{marginTop:"auto",[`& ${StyledElementContainer}:last-of-type > ${StyledCheckbox$1}`]:{marginBottom:rt.spacing.sm}},...ot===at.TOP&&{[`& ${StyledElementContainer}:first-of-type > ${StyledCheckbox$1}`]:{marginTop:rt.spacing.sm}},...ot===at.CENTER&&{marginTop:"auto",marginBottom:"auto"},...nt&&{border:`${rt.sizes.borderWidth} solid ${rt.colors.borderColor}`,borderRadius:rt.radii.default,padding:`calc(${rt.spacing.lg} - ${rt.sizes.borderWidth})`}}}),StyledVerticalBlock=newStyled("div",{target:"e6rk8up3"})(({width:rt,theme:tt})=>({width:rt,position:"relative",display:"flex",flex:1,flexDirection:"column",gap:tt.spacing.lg})),StyledVerticalBlockWrapper=newStyled("div",{target:"e6rk8up4"})({display:"flex",flexDirection:"column",flex:1}),StyledVerticalBlockBorderWrapper=newStyled("div",{target:"e6rk8up5"})(({theme:rt,border:tt,height:et})=>({...tt&&{border:`${rt.sizes.borderWidth} solid ${rt.colors.borderColor}`,borderRadius:rt.radii.default,padding:`calc(${rt.spacing.lg} - ${rt.sizes.borderWidth})`},...et&&{height:`${et}px`,overflow:"auto"}})),Audio=React$1.lazy(()=>__vitePreload(()=>import("./index.CYR86Hh7.js"),[],import.meta.url)),Balloons=React$1.lazy(()=>__vitePreload(()=>import("./index.BELZ0Ua3.js"),__vite__mapDeps([0,1]),import.meta.url)),Snow=React$1.lazy(()=>__vitePreload(()=>import("./index.B2zhJEHf.js"),__vite__mapDeps([2,1]),import.meta.url)),ArrowDataFrame=React$1.lazy(()=>__vitePreload(()=>import("./index.C-qfcK5k.js").then(rt=>rt.c),__vite__mapDeps([3,4,5,6,7,8,9,10,11,12,13,14]),import.meta.url)),ArrowVegaLiteChart=React$1.lazy(()=>__vitePreload(()=>import("./index.CPA4hfh-.js"),__vite__mapDeps([15,6,5,7,16,17,18,4]),import.meta.url)),Toast=React$1.lazy(()=>__vitePreload(()=>import("./index.DwnmFzkn.js"),[],import.meta.url)),BokehChart=React$1.lazy(()=>__vitePreload(()=>import("./index.D2G_9kKo.js"),[],import.meta.url)),DebouncedBokehChart=debounceRender(BokehChart,100),DeckGlJsonChart=React$1.lazy(()=>__vitePreload(()=>import("./index.L2uUYiab.js"),__vite__mapDeps([19,10,11,6,5,20,4,16,17,21,22]),import.meta.url)),GraphVizChart=React$1.lazy(()=>__vitePreload(()=>import("./index.BZUNGvtg.js"),__vite__mapDeps([23,18,17,6,5]),import.meta.url)),IFrame=React$1.lazy(()=>__vitePreload(()=>import("./index.DhzvJb2S.js"),[],import.meta.url)),ImageList=React$1.lazy(()=>__vitePreload(()=>import("./index.BkwFDrjh.js"),__vite__mapDeps([24,6,5]),import.meta.url)),LinkButton=React$1.lazy(()=>__vitePreload(()=>import("./index.YLipy1A9.js"),[],import.meta.url)),PageLink=React$1.lazy(()=>__vitePreload(()=>import("./index.V7XbIe_g.js"),[],import.meta.url)),PlotlyChart=React$1.lazy(()=>__vitePreload(()=>import("./index.Cm_RlOaX.js"),__vite__mapDeps([25,4,5]),import.meta.url)),Video=React$1.lazy(()=>__vitePreload(()=>import("./index.DHr41xKA.js"),[],import.meta.url)),AudioInput=React$1.lazy(()=>__vitePreload(()=>import("./index.Vm77sF3W.js"),__vite__mapDeps([26,4,6,27,9,13]),import.meta.url)),Button=React$1.lazy(()=>__vitePreload(()=>import("./index.B49jyHZy.js"),[],import.meta.url)),ButtonGroup=React$1.lazy(()=>__vitePreload(()=>import("./index.X-CeecsU.js"),__vite__mapDeps([28,20,4]),import.meta.url)),DownloadButton=React$1.lazy(()=>__vitePreload(()=>import("./index.DXjCUYHV.js"),__vite__mapDeps([29,9]),import.meta.url)),CameraInput=React$1.lazy(()=>__vitePreload(()=>import("./index.BmunCvlQ.js"),__vite__mapDeps([30,21,4,31,32]),import.meta.url)),ChatInput=React$1.lazy(()=>__vitePreload(()=>import("./index.CYO_k8m0.js"),__vite__mapDeps([33,34,35,36,21,31,37,38]),import.meta.url)),Checkbox=React$1.lazy(()=>__vitePreload(()=>import("./index.Cb9G_5ys.js"),__vite__mapDeps([39,20,4]),import.meta.url)),ColorPicker=React$1.lazy(()=>__vitePreload(()=>import("./index.BzhkD1G1.js"),__vite__mapDeps([40,20,4]),import.meta.url)),DateInput=React$1.lazy(()=>__vitePreload(()=>import("./index.CqE8cJhC.js"),__vite__mapDeps([41,20,4,42,11,12,43,38]),import.meta.url)),Html=React$1.lazy(()=>__vitePreload(()=>import("./index.DxFBqI9I.js"),[],import.meta.url)),Multiselect=React$1.lazy(()=>__vitePreload(()=>import("./index.B1X_ANFX.js"),__vite__mapDeps([44,20,4]),import.meta.url)),Progress=React$1.lazy(()=>__vitePreload(()=>import("./index.0Eb9CO_K.js"),__vite__mapDeps([45,32]),import.meta.url)),Spinner=React$1.lazy(()=>__vitePreload(()=>import("./index.D-x9B5Oa.js"),[],import.meta.url)),Radio=React$1.lazy(()=>__vitePreload(()=>import("./index.C02XURgk.js"),__vite__mapDeps([46,20,4]),import.meta.url)),Selectbox$1=React$1.lazy(()=>__vitePreload(()=>import("./index.CAvxO15c.js"),__vite__mapDeps([47,20,4]),import.meta.url)),Slider$1=React$1.lazy(()=>__vitePreload(()=>import("./index.DvCjEp1s.js"),__vite__mapDeps([48,8,20,4]),import.meta.url)),FileUploader=React$1.lazy(()=>__vitePreload(()=>import("./index.BjOrvaSf.js"),__vite__mapDeps([49,21,4,34,32,27,31]),import.meta.url)),TextArea=React$1.lazy(()=>__vitePreload(()=>import("./index.tuHBuV8y.js"),__vite__mapDeps([50,51,52,36,35,20,4,37,38]),import.meta.url)),TextInput=React$1.lazy(()=>__vitePreload(()=>import("./index.CIgcpP2h.js"),__vite__mapDeps([53,51,52,36,20,4,35,43,38]),import.meta.url)),TimeInput=React$1.lazy(()=>__vitePreload(()=>import("./index.xghdNmh6.js"),__vite__mapDeps([54,20,4,42,11,12]),import.meta.url)),NumberInput=React$1.lazy(()=>__vitePreload(()=>import("./index.C8ahq2Yl.js"),__vite__mapDeps([55,8,51,4,35,43,38]),import.meta.url)),StreamlitSyntaxHighlighter=React$1.lazy(()=>__vitePreload(()=>Promise.resolve().then(()=>StreamlitSyntaxHighlighter$2),void 0,import.meta.url));function hideIfStale(rt,tt){return rt?jsx$1(Fragment,{}):tt}const RawElementNodeRenderer=rt=>{const{node:tt}=rt;if(!tt)throw new Error("ElementNode not found.");const et={width:rt.width,disableFullscreenMode:rt.disableFullscreenMode},nt={...et,widgetMgr:rt.widgetMgr,disabled:rt.widgetsDisabled,fragmentId:tt.fragmentId};switch(tt.element.type){case"alert":{const at=tt.element.alert;return jsx$1(AlertElement$1,{icon:at.icon,body:at.body,kind:getAlertElementKind(at.format),...et})}case"arrowTable":return jsx$1(ArrowTable$1,{element:tt.quiverElement,...et});case"audio":return jsx$1(Audio,{element:tt.element.audio,endpoints:rt.endpoints,...et,elementMgr:rt.widgetMgr});case"balloons":return hideIfStale(rt.isStale,jsx$1(Balloons,{scriptRunId:rt.scriptRunId}));case"bokehChart":return jsx$1(DebouncedBokehChart,{element:tt.element.bokehChart,...et});case"code":{const at=tt.element.code;return jsx$1(StreamlitSyntaxHighlighter,{language:at.language,showLineNumbers:at.showLineNumbers,wrapLines:at.wrapLines,height:at.height,children:at.codeText})}case"deckGlJsonChart":return jsx$1(DeckGlJsonChart,{element:tt.element.deckGlJsonChart,...nt});case"docString":return jsx$1(DocString$1,{element:tt.element.docString,...et});case"empty":return jsx$1("div",{className:"stEmpty","data-testid":"stEmpty"});case"exception":return jsx$1(ExceptionElement$1,{element:tt.element.exception,...et});case"graphvizChart":return jsx$1(GraphVizChart,{element:tt.element.graphvizChart,...et});case"heading":return jsx$1(Heading,{element:tt.element.heading,...et});case"iframe":return jsx$1(IFrame,{element:tt.element.iframe,...et});case"imgs":return jsx$1(ImageList,{element:tt.element.imgs,endpoints:rt.endpoints,...et});case"json":return jsx$1(Json$1,{element:tt.element.json,...et});case"markdown":return jsx$1(Markdown$1,{element:tt.element.markdown,...et});case"metric":return jsx$1(Metric$1,{element:tt.element.metric});case"html":return jsx$1(Html,{element:tt.element.html,...et});case"pageLink":{const at=tt.element.pageLink,st=nt.disabled||at.disabled;return jsx$1(PageLink,{element:at,disabled:st,...et})}case"progress":return jsx$1(Progress,{element:tt.element.progress,...et});case"skeleton":return jsx$1(Skeleton,{element:tt.element.skeleton});case"snow":return hideIfStale(rt.isStale,jsx$1(Snow,{scriptRunId:rt.scriptRunId}));case"spinner":return jsx$1(Spinner,{element:tt.element.spinner,...et});case"text":return jsx$1(TextElement$1,{element:tt.element.text,...et});case"video":return jsx$1(Video,{element:tt.element.video,endpoints:rt.endpoints,...et,elementMgr:rt.widgetMgr});case"toast":{const at=tt.element.toast;return jsx$1(Toast,{body:at.body,icon:at.icon,...et},tt.scriptRunId)}case"arrowDataFrame":{const at=tt.element.arrowDataFrame;return nt.disabled=nt.disabled||at.disabled,jsx$1(ArrowDataFrame,{element:at,data:tt.quiverElement,...at.id&&{key:at.id},...nt})}case"arrowVegaLiteChart":const ot=tt.vegaLiteChartElement;return jsx$1(ArrowVegaLiteChart,{element:ot,...nt},ot.id||void 0);case"audioInput":{const at=tt.element.audioInput;return nt.disabled=nt.disabled||at.disabled,jsx$1(AudioInput,{uploadClient:rt.uploadClient,element:at,...nt},at.id)}case"button":{const at=tt.element.button;if(nt.disabled=nt.disabled||at.disabled,at.isFormSubmitter){const{formId:st}=at,ut=rt.formsData.formsWithUploads.has(st);return jsx$1(FormSubmitContent,{element:at,hasInProgressUpload:ut,...nt})}return jsx$1(Button,{element:at,...nt})}case"buttonGroup":{const at=tt.element.buttonGroup;return nt.disabled=nt.disabled||at.disabled,jsx$1(ButtonGroup,{element:at,...nt},at.id)}case"downloadButton":{const at=tt.element.downloadButton;return nt.disabled=nt.disabled||at.disabled,jsx$1(DownloadButton,{endpoints:rt.endpoints,element:at,...nt},at.id)}case"cameraInput":{const at=tt.element.cameraInput;return nt.disabled=nt.disabled||at.disabled,jsx$1(CameraInput,{element:at,uploadClient:rt.uploadClient,...nt},at.id)}case"chatInput":{const at=tt.element.chatInput;return nt.disabled=nt.disabled||at.disabled,jsx$1(ChatInput,{element:at,uploadClient:rt.uploadClient,...nt},at.id)}case"checkbox":{const at=tt.element.checkbox;return nt.disabled=nt.disabled||at.disabled,jsx$1(Checkbox,{element:at,...nt},at.id)}case"colorPicker":{const at=tt.element.colorPicker;return nt.disabled=nt.disabled||at.disabled,jsx$1(ColorPicker,{element:at,...nt},at.id)}case"componentInstance":return jsx$1(ComponentInstance$1,{registry:rt.componentRegistry,element:tt.element.componentInstance,...nt});case"dateInput":{const at=tt.element.dateInput;return nt.disabled=nt.disabled||at.disabled,jsx$1(DateInput,{element:at,...nt},at.id)}case"fileUploader":{const at=tt.element.fileUploader;return nt.disabled=nt.disabled||at.disabled,jsx$1(FileUploader,{element:at,uploadClient:rt.uploadClient,...nt},at.id)}case"linkButton":{const at=tt.element.linkButton;return nt.disabled=nt.disabled||at.disabled,jsx$1(LinkButton,{element:at,...nt})}case"multiselect":{const at=tt.element.multiselect;return nt.disabled=nt.disabled||at.disabled,jsx$1(Multiselect,{element:at,...nt},at.id)}case"numberInput":{const at=tt.element.numberInput;return nt.disabled=nt.disabled||at.disabled,jsx$1(NumberInput,{element:at,...nt},at.id)}case"plotlyChart":{const at=tt.element.plotlyChart;return jsx$1(PlotlyChart,{element:at,...nt},at.id)}case"radio":{const at=tt.element.radio;return nt.disabled=nt.disabled||at.disabled,jsx$1(Radio,{element:at,...nt},at.id)}case"selectbox":{const at=tt.element.selectbox;return nt.disabled=nt.disabled||at.disabled,jsx$1(Selectbox$1,{element:at,...nt},at.id)}case"slider":{const at=tt.element.slider;return nt.disabled=nt.disabled||at.disabled,jsx$1(Slider$1,{element:at,...nt},at.id)}case"textArea":{const at=tt.element.textArea;return nt.disabled=nt.disabled||at.disabled,jsx$1(TextArea,{element:at,...nt},at.id)}case"textInput":{const at=tt.element.textInput;return nt.disabled=nt.disabled||at.disabled,jsx$1(TextInput,{element:at,...nt},at.id)}case"timeInput":{const at=tt.element.timeInput;return nt.disabled=nt.disabled||at.disabled,jsx$1(TimeInput,{element:at,...nt},at.id)}default:throw new Error(`Unrecognized Element type ${tt.element.type}`)}},ElementNodeRenderer=rt=>{const{isFullScreen:tt,fragmentIdsThisRun:et}=React$1.useContext(LibContext),{node:nt,width:ot}=rt,at=nt.element.type||"",st=shouldComponentBeEnabled(at,rt.scriptRunState),ut=isComponentStale(st,nt,rt.scriptRunState,rt.scriptRunId,et),ct=getElementId(nt.element),pt=getKeyFromId(ct);return jsx$1(Maybe,{enable:st,children:jsx$1(StyledElementContainer,{className:classNames("stElementContainer","element-container",convertKeyToClassName(pt)),"data-testid":"stElementContainer","data-stale":ut,isStale:ut&&!tt,width:ot,elementType:at,children:jsx$1(ErrorBoundary,{width:ot,children:jsx$1(reactExports.Suspense,{fallback:jsx$1(Skeleton,{element:Skeleton$1.create({style:Skeleton$1.SkeletonStyle.ELEMENT})}),children:jsx$1(RawElementNodeRenderer,{...rt,isStale:ut})})})})})},BlockNodeRenderer=rt=>{const{node:tt}=rt,{fragmentIdsThisRun:et}=reactExports.useContext(LibContext);if(tt.isEmpty&&!tt.deltaBlock.allowEmpty)return jsx$1(Fragment,{});const nt=shouldComponentBeEnabled("",rt.scriptRunState),ot=isComponentStale(nt,tt,rt.scriptRunState,rt.scriptRunId,et),at={...rt,node:tt},st=rt.disableFullscreenMode||d$3(tt.deltaBlock.dialog)||d$3(tt.deltaBlock.popover),ut=jsx$1(LayoutBlock,{...at,disableFullscreenMode:st});if(tt.deltaBlock.dialog)return jsx$1(Dialog$1,{element:tt.deltaBlock.dialog,deltaMsgReceivedAt:tt.deltaMsgReceivedAt,children:ut});if(tt.deltaBlock.expandable)return jsx$1(Expander$1,{empty:tt.isEmpty,isStale:ot,element:tt.deltaBlock.expandable,children:ut});if(tt.deltaBlock.popover)return jsx$1(Popover$1,{empty:tt.isEmpty,element:tt.deltaBlock.popover,width:rt.width,children:ut});if(tt.deltaBlock.type==="form"){const{formId:ct,clearOnSubmit:pt,enterToSubmit:dt,border:ft}=tt.deltaBlock.form,bt=rt.formsData.submitButtons.get(ct),ht=bt!==void 0&&bt.length>0;return jsx$1(Form$1,{formId:ct,clearOnSubmit:pt,enterToSubmit:dt,width:rt.width,hasSubmitButton:ht,scriptRunState:rt.scriptRunState,widgetMgr:rt.widgetMgr,border:ft,children:ut})}if(tt.deltaBlock.chatMessage)return jsx$1(ChatMessage$1,{element:tt.deltaBlock.chatMessage,endpoints:rt.endpoints,children:ut});if(tt.deltaBlock.column)return jsx$1(StyledColumn,{weight:tt.deltaBlock.column.weight??0,gap:tt.deltaBlock.column.gap??"",verticalAlignment:tt.deltaBlock.column.verticalAlignment??void 0,showBorder:tt.deltaBlock.column.showBorder??!1,className:"stColumn","data-testid":"stColumn",children:ut});if(tt.deltaBlock.tabContainer){const pt={...at,isStale:ot,renderTabContent:dt=>jsx$1(VerticalBlock,{...dt})};return jsx$1(Tabs$1,{...pt})}return ut},ChildRenderer=rt=>{const{libConfig:tt}=reactExports.useContext(LibContext);assignDividerColor(rt.node,useTheme());const et=new Set;return jsx$1(Fragment,{children:rt.node.children&&rt.node.children.map((nt,ot)=>{const at=tt.disableFullscreenMode||rt.disableFullscreenMode;if(nt instanceof ElementNode){const st={...rt,disableFullscreenMode:at,node:nt},ut=getElementId(nt.element)||ot.toString();return et.has(ut)?null:(et.add(ut),jsx$1(ElementNodeRenderer,{...st},ut))}if(nt instanceof BlockNode){const st={...rt,disableFullscreenMode:at,node:nt};return jsx$1(BlockNodeRenderer,{...st},ot)}throw new Error(`Unrecognized AppNode: ${nt}`)})})};function ScrollToBottomVerticalBlockWrapper(rt){const{border:tt,height:et,children:nt}=rt,ot=useScrollToBottom();return jsx$1(StyledVerticalBlockBorderWrapper,{border:tt,height:et,"data-testid":"stVerticalBlockBorderWrapper","data-test-scroll-behavior":"scroll-to-bottom",ref:ot,children:nt})}const VerticalBlock=rt=>{var ft,bt;const tt=reactExports.useRef(null),[et,nt]=React$1.useState(-1),ot=reactExports.useMemo(()=>new ResizeObserver(([ht])=>{window.requestAnimationFrame(()=>{nt(ht.target.getBoundingClientRect().width||-1)})}),[nt]),at=((ft=rt.node.deltaBlock.vertical)==null?void 0:ft.border)??!1,st=((bt=rt.node.deltaBlock.vertical)==null?void 0:bt.height)||void 0,ut=st&&rt.node.children.find(ht=>ht instanceof BlockNode&&ht.deltaBlock.type==="chatMessage")!==void 0;reactExports.useEffect(()=>(tt.current&&ot.observe(tt.current),()=>{ot.disconnect()}),[ot,ut]);const ct=ut?ScrollToBottomVerticalBlockWrapper:StyledVerticalBlockBorderWrapper,pt={...rt,width:et},dt=getKeyFromId(rt.node.deltaBlock.id);return jsx$1(ct,{border:at,height:st,"data-testid":"stVerticalBlockBorderWrapper","data-test-scroll-behavior":"normal",children:jsx$1(StyledVerticalBlockWrapper,{ref:tt,children:jsx$1(StyledVerticalBlock,{width:et,className:classNames("stVerticalBlock",convertKeyToClassName(dt)),"data-testid":"stVerticalBlock",children:jsx$1(ChildRenderer,{...pt})})})})},HorizontalBlock=rt=>{var et;const tt=((et=rt.node.deltaBlock.horizontal)==null?void 0:et.gap)??"";return jsx$1(StyledHorizontalBlock,{gap:tt,className:"stHorizontalBlock","data-testid":"stHorizontalBlock",children:jsx$1(ChildRenderer,{...rt})})};function LayoutBlock(rt){return rt.node.deltaBlock.horizontal?jsx$1(HorizontalBlock,{...rt}):jsx$1(VerticalBlock,{...rt})}const StyledDataFrameOverlay=newStyled("div",{target:"e19n7mk11"})(({theme:rt})=>({position:"fixed",top:0,left:0,zIndex:rt.zIndices.tablePortal,lineHeight:"100%"})),PortalContext=React$1.createContext(null),PortalProvider=({children:rt})=>{const tt=reactExports.useRef(null),et=reactExports.useCallback(()=>tt.current,[]);return jsxs(PortalContext.Provider,{value:et,children:[rt,jsx$1(StyledDataFrameOverlay,{"data-testid":"portal",id:"portal",ref:tt})]})};function ThemeProvider({theme:rt,baseuiTheme:tt,children:et}){return jsx$1(ThemeProvider$1,{theme:tt||baseuiLightTheme,children:jsx$1(ThemeProvider$2,{theme:rt,children:et})})}function toCodePoint(rt,tt){const et=[];let nt=0,ot=0,at=0;for(;at<rt.length;)nt=rt.charCodeAt(at++),ot?(et.push((65536+(ot-55296<<10)+(nt-56320)).toString(16)),ot=0):55296<=nt&&nt<=56319?ot=nt:et.push(nt.toString(16));return et.join("-")}const UFE0Fg=/\uFE0F/g,U200D="";function grabTheRightIcon(rt){return toCodePoint(rt.indexOf(U200D)<0?rt.replace(UFE0Fg,""):rt)}function iconToUrl(rt){const tt=/^:(.+)\/(.+):$/,et=rt.match(tt);return et===null?"":`https://fonts.gstatic.com/s/i/short-term/release/materialsymbolsrounded/${et[2]}/default/24px.svg`}function handleFavicon(rt,tt,et){const nt=extractEmoji(rt);let ot;nt&&!rt.startsWith(":material")?ot=`https://cdn.jsdelivr.net/gh/twitter/twemoji@14.0.2/assets/72x72/${grabTheRightIcon(nt)}.png`:rt.startsWith(":material")?ot=iconToUrl(rt):ot=et.buildMediaURL(rt),overwriteFavicon(ot),tt({type:"SET_PAGE_FAVICON",favicon:ot})}function overwriteFavicon(rt){const tt=document.querySelector("link[rel='shortcut icon']");tt&&(tt.href=rt)}function extractEmoji(rt){const tt=rt.replace("-","_");return nodeEmoji$1.hasEmoji(nodeEmoji$1.get(tt))?nodeEmoji$1.get(tt):nodeEmoji$1.hasEmoji(rt)?rt:""}var lib$2={},flattenNames$1={},baseFor$1=_baseFor,keys$2=keys_1;function baseForOwn$4(rt,tt){return rt&&baseFor$1(rt,tt,keys$2)}var _baseForOwn=baseForOwn$4,identity$3=identity_1;function castFunction$2(rt){return typeof rt=="function"?rt:identity$3}var _castFunction=castFunction$2,baseForOwn$3=_baseForOwn,castFunction$1=_castFunction;function forOwn(rt,tt){return rt&&baseForOwn$3(rt,castFunction$1(tt))}var forOwn_1=forOwn,HASH_UNDEFINED$3="__lodash_hash_undefined__";function setCacheAdd$2(rt){return this.__data__.set(rt,HASH_UNDEFINED$3),this}var _setCacheAdd=setCacheAdd$2;function setCacheHas$2(rt){return this.__data__.has(rt)}var _setCacheHas=setCacheHas$2,MapCache$1=_MapCache,setCacheAdd$1=_setCacheAdd,setCacheHas$1=_setCacheHas;function SetCache$3(rt){var tt=-1,et=rt==null?0:rt.length;for(this.__data__=new MapCache$1;++tt<et;)this.add(rt[tt])}SetCache$3.prototype.add=SetCache$3.prototype.push=setCacheAdd$1;SetCache$3.prototype.has=setCacheHas$1;var _SetCache=SetCache$3;function arraySome$2(rt,tt){for(var et=-1,nt=rt==null?0:rt.length;++et<nt;)if(tt(rt[et],et,rt))return!0;return!1}var _arraySome=arraySome$2;function cacheHas$3(rt,tt){return rt.has(tt)}var _cacheHas=cacheHas$3,SetCache$2=_SetCache,arraySome$1=_arraySome,cacheHas$2=_cacheHas,COMPARE_PARTIAL_FLAG$b=1,COMPARE_UNORDERED_FLAG$7=2;function equalArrays$3(rt,tt,et,nt,ot,at){var st=et&COMPARE_PARTIAL_FLAG$b,ut=rt.length,ct=tt.length;if(ut!=ct&&!(st&&ct>ut))return!1;var pt=at.get(rt),dt=at.get(tt);if(pt&&dt)return pt==tt&&dt==rt;var ft=-1,bt=!0,ht=et&COMPARE_UNORDERED_FLAG$7?new SetCache$2:void 0;for(at.set(rt,tt),at.set(tt,rt);++ft<ut;){var mt=rt[ft],Ot=tt[ft];if(nt)var yt=st?nt(Ot,mt,ft,tt,rt,at):nt(mt,Ot,ft,rt,tt,at);if(yt!==void 0){if(yt)continue;bt=!1;break}if(ht){if(!arraySome$1(tt,function(Mt,At){if(!cacheHas$2(ht,At)&&(mt===Mt||ot(mt,Mt,et,nt,at)))return ht.push(At)})){bt=!1;break}}else if(!(mt===Ot||ot(mt,Ot,et,nt,at))){bt=!1;break}}return at.delete(rt),at.delete(tt),bt}var _equalArrays=equalArrays$3,Symbol$2=_Symbol,Uint8Array$2=_Uint8Array,eq$1=eq_1,equalArrays$2=_equalArrays,mapToArray$1=_mapToArray,setToArray$1=_setToArray,COMPARE_PARTIAL_FLAG$a=1,COMPARE_UNORDERED_FLAG$6=2,boolTag$2="[object Boolean]",dateTag$2="[object Date]",errorTag$2="[object Error]",mapTag$3="[object Map]",numberTag$2="[object Number]",regexpTag$2="[object RegExp]",setTag$3="[object Set]",stringTag$2="[object String]",symbolTag$2="[object Symbol]",arrayBufferTag$2="[object ArrayBuffer]",dataViewTag$3="[object DataView]",symbolProto$2=Symbol$2?Symbol$2.prototype:void 0,symbolValueOf$1=symbolProto$2?symbolProto$2.valueOf:void 0;function equalByTag$2(rt,tt,et,nt,ot,at,st){switch(et){case dataViewTag$3:if(rt.byteLength!=tt.byteLength||rt.byteOffset!=tt.byteOffset)return!1;rt=rt.buffer,tt=tt.buffer;case arrayBufferTag$2:return!(rt.byteLength!=tt.byteLength||!at(new Uint8Array$2(rt),new Uint8Array$2(tt)));case boolTag$2:case dateTag$2:case numberTag$2:return eq$1(+rt,+tt);case errorTag$2:return rt.name==tt.name&&rt.message==tt.message;case regexpTag$2:case stringTag$2:return rt==tt+"";case mapTag$3:var ut=mapToArray$1;case setTag$3:var ct=nt&COMPARE_PARTIAL_FLAG$a;if(ut||(ut=setToArray$1),rt.size!=tt.size&&!ct)return!1;var pt=st.get(rt);if(pt)return pt==tt;nt|=COMPARE_UNORDERED_FLAG$6,st.set(rt,tt);var dt=equalArrays$2(ut(rt),ut(tt),nt,ot,at,st);return st.delete(rt),dt;case symbolTag$2:if(symbolValueOf$1)return symbolValueOf$1.call(rt)==symbolValueOf$1.call(tt)}return!1}var _equalByTag=equalByTag$2,getAllKeys$1=_getAllKeys,COMPARE_PARTIAL_FLAG$9=1,objectProto$h=Object.prototype,hasOwnProperty$f=objectProto$h.hasOwnProperty;function equalObjects$2(rt,tt,et,nt,ot,at){var st=et&COMPARE_PARTIAL_FLAG$9,ut=getAllKeys$1(rt),ct=ut.length,pt=getAllKeys$1(tt),dt=pt.length;if(ct!=dt&&!st)return!1;for(var ft=ct;ft--;){var bt=ut[ft];if(!(st?bt in tt:hasOwnProperty$f.call(tt,bt)))return!1}var ht=at.get(rt),mt=at.get(tt);if(ht&&mt)return ht==tt&&mt==rt;var Ot=!0;at.set(rt,tt),at.set(tt,rt);for(var yt=st;++ft<ct;){bt=ut[ft];var Mt=rt[bt],At=tt[bt];if(nt)var St=st?nt(At,Mt,bt,tt,rt,at):nt(Mt,At,bt,rt,tt,at);if(!(St===void 0?Mt===At||ot(Mt,At,et,nt,at):St)){Ot=!1;break}yt||(yt=bt=="constructor")}if(Ot&&!yt){var Et=rt.constructor,zt=tt.constructor;Et!=zt&&"constructor"in rt&&"constructor"in tt&&!(typeof Et=="function"&&Et instanceof Et&&typeof zt=="function"&&zt instanceof zt)&&(Ot=!1)}return at.delete(rt),at.delete(tt),Ot}var _equalObjects=equalObjects$2,Stack$2=_Stack,equalArrays$1=_equalArrays,equalByTag$1=_equalByTag,equalObjects$1=_equalObjects,getTag$1=_getTag,isArray$7=isArray_1,isBuffer$2=isBufferExports,isTypedArray$2=isTypedArray_1,COMPARE_PARTIAL_FLAG$8=1,argsTag$3="[object Arguments]",arrayTag$2="[object Array]",objectTag$4="[object Object]",objectProto$g=Object.prototype,hasOwnProperty$e=objectProto$g.hasOwnProperty;function baseIsEqualDeep$2(rt,tt,et,nt,ot,at){var st=isArray$7(rt),ut=isArray$7(tt),ct=st?arrayTag$2:getTag$1(rt),pt=ut?arrayTag$2:getTag$1(tt);ct=ct==argsTag$3?objectTag$4:ct,pt=pt==argsTag$3?objectTag$4:pt;var dt=ct==objectTag$4,ft=pt==objectTag$4,bt=ct==pt;if(bt&&isBuffer$2(rt)){if(!isBuffer$2(tt))return!1;st=!0,dt=!1}if(bt&&!dt)return at||(at=new Stack$2),st||isTypedArray$2(rt)?equalArrays$1(rt,tt,et,nt,ot,at):equalByTag$1(rt,tt,ct,et,nt,ot,at);if(!(et&COMPARE_PARTIAL_FLAG$8)){var ht=dt&&hasOwnProperty$e.call(rt,"__wrapped__"),mt=ft&&hasOwnProperty$e.call(tt,"__wrapped__");if(ht||mt){var Ot=ht?rt.value():rt,yt=mt?tt.value():tt;return at||(at=new Stack$2),ot(Ot,yt,et,nt,at)}}return bt?(at||(at=new Stack$2),equalObjects$1(rt,tt,et,nt,ot,at)):!1}var _baseIsEqualDeep=baseIsEqualDeep$2,baseIsEqualDeep$1=_baseIsEqualDeep,isObjectLike$1=isObjectLike_1;function baseIsEqual$4(rt,tt,et,nt,ot){return rt===tt?!0:rt==null||tt==null||!isObjectLike$1(rt)&&!isObjectLike$1(tt)?rt!==rt&&tt!==tt:baseIsEqualDeep$1(rt,tt,et,nt,baseIsEqual$4,ot)}var _baseIsEqual=baseIsEqual$4,Stack$1=_Stack,baseIsEqual$3=_baseIsEqual,COMPARE_PARTIAL_FLAG$7=1,COMPARE_UNORDERED_FLAG$5=2;function baseIsMatch$2(rt,tt,et,nt){var ot=et.length,at=ot,st=!nt;if(rt==null)return!at;for(rt=Object(rt);ot--;){var ut=et[ot];if(st&&ut[2]?ut[1]!==rt[ut[0]]:!(ut[0]in rt))return!1}for(;++ot<at;){ut=et[ot];var ct=ut[0],pt=rt[ct],dt=ut[1];if(st&&ut[2]){if(pt===void 0&&!(ct in rt))return!1}else{var ft=new Stack$1;if(nt)var bt=nt(pt,dt,ct,rt,tt,ft);if(!(bt===void 0?baseIsEqual$3(dt,pt,COMPARE_PARTIAL_FLAG$7|COMPARE_UNORDERED_FLAG$5,nt,ft):bt))return!1}}return!0}var _baseIsMatch=baseIsMatch$2,isObject$3=isObject_1;function isStrictComparable$3(rt){return rt===rt&&!isObject$3(rt)}var _isStrictComparable=isStrictComparable$3,isStrictComparable$2=_isStrictComparable,keys$1=keys_1;function getMatchData$2(rt){for(var tt=keys$1(rt),et=tt.length;et--;){var nt=tt[et],ot=rt[nt];tt[et]=[nt,ot,isStrictComparable$2(ot)]}return tt}var _getMatchData=getMatchData$2;function matchesStrictComparable$3(rt,tt){return function(et){return et==null?!1:et[rt]===tt&&(tt!==void 0||rt in Object(et))}}var _matchesStrictComparable=matchesStrictComparable$3,baseIsMatch$1=_baseIsMatch,getMatchData$1=_getMatchData,matchesStrictComparable$2=_matchesStrictComparable;function baseMatches$2(rt){var tt=getMatchData$1(rt);return tt.length==1&&tt[0][2]?matchesStrictComparable$2(tt[0][0],tt[0][1]):function(et){return et===rt||baseIsMatch$1(et,rt,tt)}}var _baseMatches=baseMatches$2;function baseHasIn$2(rt,tt){return rt!=null&&tt in Object(rt)}var _baseHasIn=baseHasIn$2,castPath$3=_castPath,isArguments$1=isArguments_1,isArray$6=isArray_1,isIndex$2=_isIndex,isLength$1=isLength_1,toKey$4=_toKey;function hasPath$2(rt,tt,et){tt=castPath$3(tt,rt);for(var nt=-1,ot=tt.length,at=!1;++nt<ot;){var st=toKey$4(tt[nt]);if(!(at=rt!=null&&et(rt,st)))break;rt=rt[st]}return at||++nt!=ot?at:(ot=rt==null?0:rt.length,!!ot&&isLength$1(ot)&&isIndex$2(st,ot)&&(isArray$6(rt)||isArguments$1(rt)))}var _hasPath=hasPath$2,baseHasIn$1=_baseHasIn,hasPath$1=_hasPath;function hasIn$3(rt,tt){return rt!=null&&hasPath$1(rt,tt,baseHasIn$1)}var hasIn_1=hasIn$3,baseIsEqual$2=_baseIsEqual,get$2=get_1,hasIn$2=hasIn_1,isKey$2=_isKey,isStrictComparable$1=_isStrictComparable,matchesStrictComparable$1=_matchesStrictComparable,toKey$3=_toKey,COMPARE_PARTIAL_FLAG$6=1,COMPARE_UNORDERED_FLAG$4=2;function baseMatchesProperty$2(rt,tt){return isKey$2(rt)&&isStrictComparable$1(tt)?matchesStrictComparable$1(toKey$3(rt),tt):function(et){var nt=get$2(et,rt);return nt===void 0&&nt===tt?hasIn$2(et,rt):baseIsEqual$2(tt,nt,COMPARE_PARTIAL_FLAG$6|COMPARE_UNORDERED_FLAG$4)}}var _baseMatchesProperty=baseMatchesProperty$2,baseGet$3=_baseGet;function basePropertyDeep$2(rt){return function(tt){return baseGet$3(tt,rt)}}var _basePropertyDeep=basePropertyDeep$2,baseProperty$1=_baseProperty,basePropertyDeep$1=_basePropertyDeep,isKey$1=_isKey,toKey$2=_toKey;function property$2(rt){return isKey$1(rt)?baseProperty$1(toKey$2(rt)):basePropertyDeep$1(rt)}var property_1=property$2,baseMatches$1=_baseMatches,baseMatchesProperty$1=_baseMatchesProperty,identity$2=identity_1,isArray$5=isArray_1,property$1=property_1;function baseIteratee$5(rt){return typeof rt=="function"?rt:rt==null?identity$2:typeof rt=="object"?isArray$5(rt)?baseMatchesProperty$1(rt[0],rt[1]):baseMatches$1(rt):property$1(rt)}var _baseIteratee=baseIteratee$5,isArrayLike$2=isArrayLike_1;function createBaseEach$2(rt,tt){return function(et,nt){if(et==null)return et;if(!isArrayLike$2(et))return rt(et,nt);for(var ot=et.length,at=tt?ot:-1,st=Object(et);(tt?at--:++at<ot)&&nt(st[at],at,st)!==!1;);return et}}var _createBaseEach=createBaseEach$2,baseForOwn$2=_baseForOwn,createBaseEach$1=_createBaseEach,baseEach$3=createBaseEach$1(baseForOwn$2),_baseEach=baseEach$3,baseEach$2=_baseEach,isArrayLike$1=isArrayLike_1;function baseMap$3(rt,tt){var et=-1,nt=isArrayLike$1(rt)?Array(rt.length):[];return baseEach$2(rt,function(ot,at,st){nt[++et]=tt(ot,at,st)}),nt}var _baseMap=baseMap$3,arrayMap$3=_arrayMap,baseIteratee$4=_baseIteratee,baseMap$2=_baseMap,isArray$4=isArray_1;function map$1(rt,tt){var et=isArray$4(rt)?arrayMap$3:baseMap$2;return et(rt,baseIteratee$4(tt))}var map_1=map$1;Object.defineProperty(flattenNames$1,"__esModule",{value:!0});flattenNames$1.flattenNames=void 0;var _isString2=isString_1,_isString3=_interopRequireDefault$7(_isString2),_forOwn2$2=forOwn_1,_forOwn3$2=_interopRequireDefault$7(_forOwn2$2),_isPlainObject2=isPlainObject_1,_isPlainObject3=_interopRequireDefault$7(_isPlainObject2),_map2=map_1,_map3=_interopRequireDefault$7(_map2);function _interopRequireDefault$7(rt){return rt&&rt.__esModule?rt:{default:rt}}var flattenNames=flattenNames$1.flattenNames=function rt(){var tt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],et=[];return(0,_map3.default)(tt,function(nt){Array.isArray(nt)?rt(nt).map(function(ot){return et.push(ot)}):(0,_isPlainObject3.default)(nt)?(0,_forOwn3$2.default)(nt,function(ot,at){ot===!0&&et.push(at),et.push(at+"-"+ot)}):(0,_isString3.default)(nt)&&et.push(nt)}),et};flattenNames$1.default=flattenNames;var mergeClasses$1={};Object.defineProperty(mergeClasses$1,"__esModule",{value:!0});mergeClasses$1.mergeClasses=void 0;var _forOwn2$1=forOwn_1,_forOwn3$1=_interopRequireDefault$6(_forOwn2$1),_cloneDeep2=cloneDeep_1,_cloneDeep3=_interopRequireDefault$6(_cloneDeep2),_extends$w=Object.assign||function(rt){for(var tt=1;tt<arguments.length;tt++){var et=arguments[tt];for(var nt in et)Object.prototype.hasOwnProperty.call(et,nt)&&(rt[nt]=et[nt])}return rt};function _interopRequireDefault$6(rt){return rt&&rt.__esModule?rt:{default:rt}}var mergeClasses=mergeClasses$1.mergeClasses=function rt(tt){var et=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],nt=tt.default&&(0,_cloneDeep3.default)(tt.default)||{};return et.map(function(ot){var at=tt[ot];return at&&(0,_forOwn3$1.default)(at,function(st,ut){nt[ut]||(nt[ut]={}),nt[ut]=_extends$w({},nt[ut],at[ut])}),ot}),nt};mergeClasses$1.default=mergeClasses;var autoprefix$1={};Object.defineProperty(autoprefix$1,"__esModule",{value:!0});autoprefix$1.autoprefix=void 0;var _forOwn2=forOwn_1,_forOwn3=_interopRequireDefault$5(_forOwn2),_extends$v=Object.assign||function(rt){for(var tt=1;tt<arguments.length;tt++){var et=arguments[tt];for(var nt in et)Object.prototype.hasOwnProperty.call(et,nt)&&(rt[nt]=et[nt])}return rt};function _interopRequireDefault$5(rt){return rt&&rt.__esModule?rt:{default:rt}}var transforms={borderRadius:function rt(tt){return{msBorderRadius:tt,MozBorderRadius:tt,OBorderRadius:tt,WebkitBorderRadius:tt,borderRadius:tt}},boxShadow:function rt(tt){return{msBoxShadow:tt,MozBoxShadow:tt,OBoxShadow:tt,WebkitBoxShadow:tt,boxShadow:tt}},userSelect:function rt(tt){return{WebkitTouchCallout:tt,KhtmlUserSelect:tt,MozUserSelect:tt,msUserSelect:tt,WebkitUserSelect:tt,userSelect:tt}},flex:function rt(tt){return{WebkitBoxFlex:tt,MozBoxFlex:tt,WebkitFlex:tt,msFlex:tt,flex:tt}},flexBasis:function rt(tt){return{WebkitFlexBasis:tt,flexBasis:tt}},justifyContent:function rt(tt){return{WebkitJustifyContent:tt,justifyContent:tt}},transition:function rt(tt){return{msTransition:tt,MozTransition:tt,OTransition:tt,WebkitTransition:tt,transition:tt}},transform:function rt(tt){return{msTransform:tt,MozTransform:tt,OTransform:tt,WebkitTransform:tt,transform:tt}},absolute:function rt(tt){var et=tt&&tt.split(" ");return{position:"absolute",top:et&&et[0],right:et&&et[1],bottom:et&&et[2],left:et&&et[3]}},extend:function rt(tt,et){var nt=et[tt];return nt||{extend:tt}}},autoprefix=autoprefix$1.autoprefix=function rt(tt){var et={};return(0,_forOwn3.default)(tt,function(nt,ot){var at={};(0,_forOwn3.default)(nt,function(st,ut){var ct=transforms[ut];ct?at=_extends$v({},at,ct(st)):at[ut]=st}),et[ot]=at}),et};autoprefix$1.default=autoprefix;var hover$1={};Object.defineProperty(hover$1,"__esModule",{value:!0});hover$1.hover=void 0;var _extends$u=Object.assign||function(rt){for(var tt=1;tt<arguments.length;tt++){var et=arguments[tt];for(var nt in et)Object.prototype.hasOwnProperty.call(et,nt)&&(rt[nt]=et[nt])}return rt},_react$3=reactExports,_react2$3=_interopRequireDefault$4(_react$3);function _interopRequireDefault$4(rt){return rt&&rt.__esModule?rt:{default:rt}}function _classCallCheck$f(rt,tt){if(!(rt instanceof tt))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn$f(rt,tt){if(!rt)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return tt&&(typeof tt=="object"||typeof tt=="function")?tt:rt}function _inherits$f(rt,tt){if(typeof tt!="function"&&tt!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof tt);rt.prototype=Object.create(tt&&tt.prototype,{constructor:{value:rt,enumerable:!1,writable:!0,configurable:!0}}),tt&&(Object.setPrototypeOf?Object.setPrototypeOf(rt,tt):rt.__proto__=tt)}var hover=hover$1.hover=function rt(tt){var et=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"span";return function(nt){_inherits$f(ot,nt);function ot(){var at,st,ut,ct;_classCallCheck$f(this,ot);for(var pt=arguments.length,dt=Array(pt),ft=0;ft<pt;ft++)dt[ft]=arguments[ft];return ct=(st=(ut=_possibleConstructorReturn$f(this,(at=ot.__proto__||Object.getPrototypeOf(ot)).call.apply(at,[this].concat(dt))),ut),ut.state={hover:!1},ut.handleMouseOver=function(){return ut.setState({hover:!0})},ut.handleMouseOut=function(){return ut.setState({hover:!1})},ut.render=function(){return _react2$3.default.createElement(et,{onMouseOver:ut.handleMouseOver,onMouseOut:ut.handleMouseOut},_react2$3.default.createElement(tt,_extends$u({},ut.props,ut.state)))},st),_possibleConstructorReturn$f(ut,ct)}return ot}(_react2$3.default.Component)};hover$1.default=hover;var active$1={};Object.defineProperty(active$1,"__esModule",{value:!0});active$1.active=void 0;var _extends$t=Object.assign||function(rt){for(var tt=1;tt<arguments.length;tt++){var et=arguments[tt];for(var nt in et)Object.prototype.hasOwnProperty.call(et,nt)&&(rt[nt]=et[nt])}return rt},_react$2=reactExports,_react2$2=_interopRequireDefault$3(_react$2);function _interopRequireDefault$3(rt){return rt&&rt.__esModule?rt:{default:rt}}function _classCallCheck$e(rt,tt){if(!(rt instanceof tt))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn$e(rt,tt){if(!rt)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return tt&&(typeof tt=="object"||typeof tt=="function")?tt:rt}function _inherits$e(rt,tt){if(typeof tt!="function"&&tt!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof tt);rt.prototype=Object.create(tt&&tt.prototype,{constructor:{value:rt,enumerable:!1,writable:!0,configurable:!0}}),tt&&(Object.setPrototypeOf?Object.setPrototypeOf(rt,tt):rt.__proto__=tt)}var active=active$1.active=function rt(tt){var et=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"span";return function(nt){_inherits$e(ot,nt);function ot(){var at,st,ut,ct;_classCallCheck$e(this,ot);for(var pt=arguments.length,dt=Array(pt),ft=0;ft<pt;ft++)dt[ft]=arguments[ft];return ct=(st=(ut=_possibleConstructorReturn$e(this,(at=ot.__proto__||Object.getPrototypeOf(ot)).call.apply(at,[this].concat(dt))),ut),ut.state={active:!1},ut.handleMouseDown=function(){return ut.setState({active:!0})},ut.handleMouseUp=function(){return ut.setState({active:!1})},ut.render=function(){return _react2$2.default.createElement(et,{onMouseDown:ut.handleMouseDown,onMouseUp:ut.handleMouseUp},_react2$2.default.createElement(tt,_extends$t({},ut.props,ut.state)))},st),_possibleConstructorReturn$e(ut,ct)}return ot}(_react2$2.default.Component)};active$1.default=active;var loop={};Object.defineProperty(loop,"__esModule",{value:!0});var loopable=function rt(tt,et){var nt={},ot=function(st){var ut=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;nt[st]=ut};return tt===0&&ot("first-child"),tt===et-1&&ot("last-child"),(tt===0||tt%2===0)&&ot("even"),Math.abs(tt%2)===1&&ot("odd"),ot("nth-child",tt),nt};loop.default=loopable;Object.defineProperty(lib$2,"__esModule",{value:!0});lib$2.ReactCSS=lib$2.loop=lib$2.handleActive=handleHover=lib$2.handleHover=lib$2.hover=void 0;var _flattenNames=flattenNames$1,_flattenNames2=_interopRequireDefault$2(_flattenNames),_mergeClasses=mergeClasses$1,_mergeClasses2=_interopRequireDefault$2(_mergeClasses),_autoprefix=autoprefix$1,_autoprefix2=_interopRequireDefault$2(_autoprefix),_hover2=hover$1,_hover3=_interopRequireDefault$2(_hover2),_active=active$1,_active2=_interopRequireDefault$2(_active),_loop2=loop,_loop3=_interopRequireDefault$2(_loop2);function _interopRequireDefault$2(rt){return rt&&rt.__esModule?rt:{default:rt}}lib$2.hover=_hover3.default;var handleHover=lib$2.handleHover=_hover3.default;lib$2.handleActive=_active2.default;lib$2.loop=_loop3.default;var ReactCSS=lib$2.ReactCSS=function rt(tt){for(var et=arguments.length,nt=Array(et>1?et-1:0),ot=1;ot<et;ot++)nt[ot-1]=arguments[ot];var at=(0,_flattenNames2.default)(nt),st=(0,_mergeClasses2.default)(tt,at);return(0,_autoprefix2.default)(st)},_default$2=lib$2.default=ReactCSS,calculateChange$2=function rt(tt,et,nt,ot,at){var st=at.clientWidth,ut=at.clientHeight,ct=typeof tt.pageX=="number"?tt.pageX:tt.touches[0].pageX,pt=typeof tt.pageY=="number"?tt.pageY:tt.touches[0].pageY,dt=ct-(at.getBoundingClientRect().left+window.pageXOffset),ft=pt-(at.getBoundingClientRect().top+window.pageYOffset);if(nt==="vertical"){var bt=void 0;if(ft<0?bt=0:ft>ut?bt=1:bt=Math.round(ft*100/ut)/100,et.a!==bt)return{h:et.h,s:et.s,l:et.l,a:bt,source:"rgb"}}else{var ht=void 0;if(dt<0?ht=0:dt>st?ht=1:ht=Math.round(dt*100/st)/100,ot!==ht)return{h:et.h,s:et.s,l:et.l,a:ht,source:"rgb"}}return null},checkboardCache={},render=function rt(tt,et,nt,ot){if(typeof document>"u"&&!ot)return null;var at=ot?new ot:document.createElement("canvas");at.width=nt*2,at.height=nt*2;var st=at.getContext("2d");return st?(st.fillStyle=tt,st.fillRect(0,0,at.width,at.height),st.fillStyle=et,st.fillRect(0,0,nt,nt),st.translate(nt,nt),st.fillRect(0,0,nt,nt),at.toDataURL()):null},get$1=function rt(tt,et,nt,ot){var at=tt+"-"+et+"-"+nt+(ot?"-server":"");if(checkboardCache[at])return checkboardCache[at];var st=render(tt,et,nt,ot);return checkboardCache[at]=st,st},_extends$s=Object.assign||function(rt){for(var tt=1;tt<arguments.length;tt++){var et=arguments[tt];for(var nt in et)Object.prototype.hasOwnProperty.call(et,nt)&&(rt[nt]=et[nt])}return rt},Checkboard=function rt(tt){var et=tt.white,nt=tt.grey,ot=tt.size,at=tt.renderers,st=tt.borderRadius,ut=tt.boxShadow,ct=tt.children,pt=_default$2({default:{grid:{borderRadius:st,boxShadow:ut,absolute:"0px 0px 0px 0px",background:"url("+get$1(et,nt,ot,at.canvas)+") center left"}}});return reactExports.isValidElement(ct)?React$1.cloneElement(ct,_extends$s({},ct.props,{style:_extends$s({},ct.props.style,pt.grid)})):React$1.createElement("div",{style:pt.grid})};Checkboard.defaultProps={size:8,white:"transparent",grey:"rgba(0,0,0,.08)",renderers:{}};var _extends$r=Object.assign||function(rt){for(var tt=1;tt<arguments.length;tt++){var et=arguments[tt];for(var nt in et)Object.prototype.hasOwnProperty.call(et,nt)&&(rt[nt]=et[nt])}return rt},_createClass$d=function(){function rt(tt,et){for(var nt=0;nt<et.length;nt++){var ot=et[nt];ot.enumerable=ot.enumerable||!1,ot.configurable=!0,"value"in ot&&(ot.writable=!0),Object.defineProperty(tt,ot.key,ot)}}return function(tt,et,nt){return et&&rt(tt.prototype,et),nt&&rt(tt,nt),tt}}();function _classCallCheck$d(rt,tt){if(!(rt instanceof tt))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn$d(rt,tt){if(!rt)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return tt&&(typeof tt=="object"||typeof tt=="function")?tt:rt}function _inherits$d(rt,tt){if(typeof tt!="function"&&tt!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof tt);rt.prototype=Object.create(tt&&tt.prototype,{constructor:{value:rt,enumerable:!1,writable:!0,configurable:!0}}),tt&&(Object.setPrototypeOf?Object.setPrototypeOf(rt,tt):rt.__proto__=tt)}var Alpha=function(rt){_inherits$d(tt,rt);function tt(){var et,nt,ot,at;_classCallCheck$d(this,tt);for(var st=arguments.length,ut=Array(st),ct=0;ct<st;ct++)ut[ct]=arguments[ct];return at=(nt=(ot=_possibleConstructorReturn$d(this,(et=tt.__proto__||Object.getPrototypeOf(tt)).call.apply(et,[this].concat(ut))),ot),ot.handleChange=function(pt){var dt=calculateChange$2(pt,ot.props.hsl,ot.props.direction,ot.props.a,ot.container);dt&&typeof ot.props.onChange=="function"&&ot.props.onChange(dt,pt)},ot.handleMouseDown=function(pt){ot.handleChange(pt),window.addEventListener("mousemove",ot.handleChange),window.addEventListener("mouseup",ot.handleMouseUp)},ot.handleMouseUp=function(){ot.unbindEventListeners()},ot.unbindEventListeners=function(){window.removeEventListener("mousemove",ot.handleChange),window.removeEventListener("mouseup",ot.handleMouseUp)},nt),_possibleConstructorReturn$d(ot,at)}return _createClass$d(tt,[{key:"componentWillUnmount",value:function(){this.unbindEventListeners()}},{key:"render",value:function(){var nt=this,ot=this.props.rgb,at=_default$2({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("+ot.r+","+ot.g+","+ot.b+`, 0) 0%,
|
694
|
+
`),allowHTML:!1})]}),ct&&jsx$1(StyledHeaderDivider,{"data-testid":"stHeadingDivider",rainbow:ct.includes("linear"),color:ct})]})}const StyledCheckbox$1=newStyled("div",{target:"e6x5rwu0"})(({width:rt,theme:tt})=>({width:rt,display:"flex",alignItems:"center",minHeight:tt.sizes.smallElementHeight})),StyledContent=newStyled("div",{target:"e6x5rwu1"})(({visibility:rt})=>({display:rt===LabelVisibilityOptions.Collapsed?"none":"flex",visibility:rt===LabelVisibilityOptions.Hidden?"hidden":"visible",verticalAlign:"middle",flexDirection:"row",alignItems:"center"}));function translateGapWidth(rt,tt){let et=tt.spacing.lg;return rt==="medium"?et=tt.spacing.threeXL:rt==="large"&&(et=tt.spacing.fourXL),et}const StyledHorizontalBlock=newStyled("div",{target:"e6rk8up0"})(({theme:rt,gap:tt})=>({display:"flex",flexWrap:"wrap",flexGrow:1,alignItems:"stretch",gap:translateGapWidth(tt,rt)})),GLOBAL_ELEMENTS=["balloons","snow"],StyledElementContainer=newStyled("div",{target:"e6rk8up1"})(({theme:rt,isStale:tt,width:et,elementType:nt})=>({width:et,position:"relative","@media print":{overflow:"visible"},":is(.stHtml-empty)":{display:"none"},":has(> .stCacheSpinner)":{height:rt.spacing.none,overflow:"visible",visibility:"visible",marginBottom:`-${rt.spacing.lg}`,zIndex:rt.zIndices.cacheSpinner},":has(> .stPageLink)":{marginTop:`-${rt.spacing.xs}`,marginBottom:`-${rt.spacing.xs}`},...tt&&nt!=="skeleton"&&STALE_STYLES,...nt==="empty"?{display:"none"}:{},...GLOBAL_ELEMENTS.includes(nt)?{marginBottom:`-${rt.spacing.lg}`}:{}})),StyledColumn=newStyled("div",{target:"e6rk8up2"})(({theme:rt,weight:tt,gap:et,showBorder:nt,verticalAlignment:ot})=>{const{VerticalAlignment:at}=Block$2.Column,st=tt*100,ut=translateGapWidth(et,rt),ct=`calc(${st}% - ${ut})`;return{width:ct,flex:`1 1 ${ct}`,[`@media (max-width: ${rt.breakpoints.columns})`]:{minWidth:`calc(100% - ${rt.spacing.twoXL})`},...ot===at.BOTTOM&&{marginTop:"auto",[`& ${StyledElementContainer}:last-of-type > ${StyledCheckbox$1}`]:{marginBottom:rt.spacing.sm}},...ot===at.TOP&&{[`& ${StyledElementContainer}:first-of-type > ${StyledCheckbox$1}`]:{marginTop:rt.spacing.sm}},...ot===at.CENTER&&{marginTop:"auto",marginBottom:"auto"},...nt&&{border:`${rt.sizes.borderWidth} solid ${rt.colors.borderColor}`,borderRadius:rt.radii.default,padding:`calc(${rt.spacing.lg} - ${rt.sizes.borderWidth})`}}}),StyledVerticalBlock=newStyled("div",{target:"e6rk8up3"})(({width:rt,theme:tt})=>({width:rt,position:"relative",display:"flex",flex:1,flexDirection:"column",gap:tt.spacing.lg})),StyledVerticalBlockWrapper=newStyled("div",{target:"e6rk8up4"})({display:"flex",flexDirection:"column",flex:1}),StyledVerticalBlockBorderWrapper=newStyled("div",{target:"e6rk8up5"})(({theme:rt,border:tt,height:et})=>({...tt&&{border:`${rt.sizes.borderWidth} solid ${rt.colors.borderColor}`,borderRadius:rt.radii.default,padding:`calc(${rt.spacing.lg} - ${rt.sizes.borderWidth})`},...et&&{height:`${et}px`,overflow:"auto"}})),Audio=React$1.lazy(()=>__vitePreload(()=>import("./index.Cf0iIAIE.js"),[],import.meta.url)),Balloons=React$1.lazy(()=>__vitePreload(()=>import("./index.BxCfgnjZ.js"),__vite__mapDeps([0,1]),import.meta.url)),Snow=React$1.lazy(()=>__vitePreload(()=>import("./index.CixCUOrl.js"),__vite__mapDeps([2,1]),import.meta.url)),ArrowDataFrame=React$1.lazy(()=>__vitePreload(()=>import("./index.fj3RIZWm.js").then(rt=>rt.c),__vite__mapDeps([3,4,5,6,7,8,9,10,11,12,13,14]),import.meta.url)),ArrowVegaLiteChart=React$1.lazy(()=>__vitePreload(()=>import("./index.CvEI9X-f.js"),__vite__mapDeps([15,6,5,7,16,17,18,4]),import.meta.url)),Toast=React$1.lazy(()=>__vitePreload(()=>import("./index.BFgBiiD3.js"),[],import.meta.url)),BokehChart=React$1.lazy(()=>__vitePreload(()=>import("./index.a7BGlvvM.js"),[],import.meta.url)),DebouncedBokehChart=debounceRender(BokehChart,100),DeckGlJsonChart=React$1.lazy(()=>__vitePreload(()=>import("./index.DsQaFQFS.js"),__vite__mapDeps([19,10,11,6,5,20,4,16,17,21,22]),import.meta.url)),GraphVizChart=React$1.lazy(()=>__vitePreload(()=>import("./index.B_WG5L8M.js"),__vite__mapDeps([23,18,17,6,5]),import.meta.url)),IFrame=React$1.lazy(()=>__vitePreload(()=>import("./index.Ii5wPeV7.js"),[],import.meta.url)),ImageList=React$1.lazy(()=>__vitePreload(()=>import("./index.Dpj7tPYL.js"),__vite__mapDeps([24,6,5]),import.meta.url)),LinkButton=React$1.lazy(()=>__vitePreload(()=>import("./index.CDVZ2TDm.js"),[],import.meta.url)),PageLink=React$1.lazy(()=>__vitePreload(()=>import("./index.CrxVEeB-.js"),[],import.meta.url)),PlotlyChart=React$1.lazy(()=>__vitePreload(()=>import("./index.yO4xH6uE.js"),__vite__mapDeps([25,4,5]),import.meta.url)),Video=React$1.lazy(()=>__vitePreload(()=>import("./index.D0osH916.js"),[],import.meta.url)),AudioInput=React$1.lazy(()=>__vitePreload(()=>import("./index.llR6tBo1.js"),__vite__mapDeps([26,4,6,27,9,13]),import.meta.url)),Button=React$1.lazy(()=>__vitePreload(()=>import("./index.DomTQtR6.js"),[],import.meta.url)),ButtonGroup=React$1.lazy(()=>__vitePreload(()=>import("./index.Cc062Jg9.js"),__vite__mapDeps([28,20,4]),import.meta.url)),DownloadButton=React$1.lazy(()=>__vitePreload(()=>import("./index.DYr9xjMM.js"),__vite__mapDeps([29,9]),import.meta.url)),CameraInput=React$1.lazy(()=>__vitePreload(()=>import("./index.Bfg30EwC.js"),__vite__mapDeps([30,21,4,31,32]),import.meta.url)),ChatInput=React$1.lazy(()=>__vitePreload(()=>import("./index.ykXmoFpc.js"),__vite__mapDeps([33,34,35,36,21,31,37,38]),import.meta.url)),Checkbox=React$1.lazy(()=>__vitePreload(()=>import("./index.CffLO6hN.js"),__vite__mapDeps([39,20,4]),import.meta.url)),ColorPicker=React$1.lazy(()=>__vitePreload(()=>import("./index.eHoq0Wlo.js"),__vite__mapDeps([40,20,4]),import.meta.url)),DateInput=React$1.lazy(()=>__vitePreload(()=>import("./index.tSuoenpM.js"),__vite__mapDeps([41,20,4,42,11,12,43,38]),import.meta.url)),Html=React$1.lazy(()=>__vitePreload(()=>import("./index.DKf-DfNC.js"),[],import.meta.url)),Multiselect=React$1.lazy(()=>__vitePreload(()=>import("./index.DELSGlxt.js"),__vite__mapDeps([44,20,4]),import.meta.url)),Progress=React$1.lazy(()=>__vitePreload(()=>import("./index.DEM0L6H3.js"),__vite__mapDeps([45,32]),import.meta.url)),Spinner=React$1.lazy(()=>__vitePreload(()=>import("./index.COkvJMzk.js"),[],import.meta.url)),Radio=React$1.lazy(()=>__vitePreload(()=>import("./index.CoMa-t-w.js"),__vite__mapDeps([46,20,4]),import.meta.url)),Selectbox$1=React$1.lazy(()=>__vitePreload(()=>import("./index.CwAYTt1Y.js"),__vite__mapDeps([47,20,4]),import.meta.url)),Slider$1=React$1.lazy(()=>__vitePreload(()=>import("./index.DAToD4K3.js"),__vite__mapDeps([48,8,20,4]),import.meta.url)),FileUploader=React$1.lazy(()=>__vitePreload(()=>import("./index.02UPRM4u.js"),__vite__mapDeps([49,21,4,34,32,27,31]),import.meta.url)),TextArea=React$1.lazy(()=>__vitePreload(()=>import("./index.D8iXl6x2.js"),__vite__mapDeps([50,51,52,36,35,20,4,37,38]),import.meta.url)),TextInput=React$1.lazy(()=>__vitePreload(()=>import("./index.Clj6OmMF.js"),__vite__mapDeps([53,51,52,36,20,4,35,43,38]),import.meta.url)),TimeInput=React$1.lazy(()=>__vitePreload(()=>import("./index.EH4m1wP6.js"),__vite__mapDeps([54,20,4,42,11,12]),import.meta.url)),NumberInput=React$1.lazy(()=>__vitePreload(()=>import("./index.CR2BflF1.js"),__vite__mapDeps([55,8,51,4,35,43,38]),import.meta.url)),StreamlitSyntaxHighlighter=React$1.lazy(()=>__vitePreload(()=>Promise.resolve().then(()=>StreamlitSyntaxHighlighter$2),void 0,import.meta.url));function hideIfStale(rt,tt){return rt?jsx$1(Fragment,{}):tt}const RawElementNodeRenderer=rt=>{const{node:tt}=rt;if(!tt)throw new Error("ElementNode not found.");const et={width:rt.width,disableFullscreenMode:rt.disableFullscreenMode},nt={...et,widgetMgr:rt.widgetMgr,disabled:rt.widgetsDisabled,fragmentId:tt.fragmentId};switch(tt.element.type){case"alert":{const at=tt.element.alert;return jsx$1(AlertElement$1,{icon:at.icon,body:at.body,kind:getAlertElementKind(at.format),...et})}case"arrowTable":return jsx$1(ArrowTable$1,{element:tt.quiverElement,...et});case"audio":return jsx$1(Audio,{element:tt.element.audio,endpoints:rt.endpoints,...et,elementMgr:rt.widgetMgr});case"balloons":return hideIfStale(rt.isStale,jsx$1(Balloons,{scriptRunId:rt.scriptRunId}));case"bokehChart":return jsx$1(DebouncedBokehChart,{element:tt.element.bokehChart,...et});case"code":{const at=tt.element.code;return jsx$1(StreamlitSyntaxHighlighter,{language:at.language,showLineNumbers:at.showLineNumbers,wrapLines:at.wrapLines,height:at.height,children:at.codeText})}case"deckGlJsonChart":return jsx$1(DeckGlJsonChart,{element:tt.element.deckGlJsonChart,...nt});case"docString":return jsx$1(DocString$1,{element:tt.element.docString,...et});case"empty":return jsx$1("div",{className:"stEmpty","data-testid":"stEmpty"});case"exception":return jsx$1(ExceptionElement$1,{element:tt.element.exception,...et});case"graphvizChart":return jsx$1(GraphVizChart,{element:tt.element.graphvizChart,...et});case"heading":return jsx$1(Heading,{element:tt.element.heading,...et});case"iframe":return jsx$1(IFrame,{element:tt.element.iframe,...et});case"imgs":return jsx$1(ImageList,{element:tt.element.imgs,endpoints:rt.endpoints,...et});case"json":return jsx$1(Json$1,{element:tt.element.json,...et});case"markdown":return jsx$1(Markdown$1,{element:tt.element.markdown,...et});case"metric":return jsx$1(Metric$1,{element:tt.element.metric});case"html":return jsx$1(Html,{element:tt.element.html,...et});case"pageLink":{const at=tt.element.pageLink,st=nt.disabled||at.disabled;return jsx$1(PageLink,{element:at,disabled:st,...et})}case"progress":return jsx$1(Progress,{element:tt.element.progress,...et});case"skeleton":return jsx$1(Skeleton,{element:tt.element.skeleton});case"snow":return hideIfStale(rt.isStale,jsx$1(Snow,{scriptRunId:rt.scriptRunId}));case"spinner":return jsx$1(Spinner,{element:tt.element.spinner,...et});case"text":return jsx$1(TextElement$1,{element:tt.element.text,...et});case"video":return jsx$1(Video,{element:tt.element.video,endpoints:rt.endpoints,...et,elementMgr:rt.widgetMgr});case"toast":{const at=tt.element.toast;return jsx$1(Toast,{body:at.body,icon:at.icon,...et},tt.scriptRunId)}case"arrowDataFrame":{const at=tt.element.arrowDataFrame;return nt.disabled=nt.disabled||at.disabled,jsx$1(ArrowDataFrame,{element:at,data:tt.quiverElement,...at.id&&{key:at.id},...nt})}case"arrowVegaLiteChart":const ot=tt.vegaLiteChartElement;return jsx$1(ArrowVegaLiteChart,{element:ot,...nt},ot.id||void 0);case"audioInput":{const at=tt.element.audioInput;return nt.disabled=nt.disabled||at.disabled,jsx$1(AudioInput,{uploadClient:rt.uploadClient,element:at,...nt},at.id)}case"button":{const at=tt.element.button;if(nt.disabled=nt.disabled||at.disabled,at.isFormSubmitter){const{formId:st}=at,ut=rt.formsData.formsWithUploads.has(st);return jsx$1(FormSubmitContent,{element:at,hasInProgressUpload:ut,...nt})}return jsx$1(Button,{element:at,...nt})}case"buttonGroup":{const at=tt.element.buttonGroup;return nt.disabled=nt.disabled||at.disabled,jsx$1(ButtonGroup,{element:at,...nt},at.id)}case"downloadButton":{const at=tt.element.downloadButton;return nt.disabled=nt.disabled||at.disabled,jsx$1(DownloadButton,{endpoints:rt.endpoints,element:at,...nt},at.id)}case"cameraInput":{const at=tt.element.cameraInput;return nt.disabled=nt.disabled||at.disabled,jsx$1(CameraInput,{element:at,uploadClient:rt.uploadClient,...nt},at.id)}case"chatInput":{const at=tt.element.chatInput;return nt.disabled=nt.disabled||at.disabled,jsx$1(ChatInput,{element:at,uploadClient:rt.uploadClient,...nt},at.id)}case"checkbox":{const at=tt.element.checkbox;return nt.disabled=nt.disabled||at.disabled,jsx$1(Checkbox,{element:at,...nt},at.id)}case"colorPicker":{const at=tt.element.colorPicker;return nt.disabled=nt.disabled||at.disabled,jsx$1(ColorPicker,{element:at,...nt},at.id)}case"componentInstance":return jsx$1(ComponentInstance$1,{registry:rt.componentRegistry,element:tt.element.componentInstance,...nt});case"dateInput":{const at=tt.element.dateInput;return nt.disabled=nt.disabled||at.disabled,jsx$1(DateInput,{element:at,...nt},at.id)}case"fileUploader":{const at=tt.element.fileUploader;return nt.disabled=nt.disabled||at.disabled,jsx$1(FileUploader,{element:at,uploadClient:rt.uploadClient,...nt},at.id)}case"linkButton":{const at=tt.element.linkButton;return nt.disabled=nt.disabled||at.disabled,jsx$1(LinkButton,{element:at,...nt})}case"multiselect":{const at=tt.element.multiselect;return nt.disabled=nt.disabled||at.disabled,jsx$1(Multiselect,{element:at,...nt},at.id)}case"numberInput":{const at=tt.element.numberInput;return nt.disabled=nt.disabled||at.disabled,jsx$1(NumberInput,{element:at,...nt},at.id)}case"plotlyChart":{const at=tt.element.plotlyChart;return jsx$1(PlotlyChart,{element:at,...nt},at.id)}case"radio":{const at=tt.element.radio;return nt.disabled=nt.disabled||at.disabled,jsx$1(Radio,{element:at,...nt},at.id)}case"selectbox":{const at=tt.element.selectbox;return nt.disabled=nt.disabled||at.disabled,jsx$1(Selectbox$1,{element:at,...nt},at.id)}case"slider":{const at=tt.element.slider;return nt.disabled=nt.disabled||at.disabled,jsx$1(Slider$1,{element:at,...nt},at.id)}case"textArea":{const at=tt.element.textArea;return nt.disabled=nt.disabled||at.disabled,jsx$1(TextArea,{element:at,...nt},at.id)}case"textInput":{const at=tt.element.textInput;return nt.disabled=nt.disabled||at.disabled,jsx$1(TextInput,{element:at,...nt},at.id)}case"timeInput":{const at=tt.element.timeInput;return nt.disabled=nt.disabled||at.disabled,jsx$1(TimeInput,{element:at,...nt},at.id)}default:throw new Error(`Unrecognized Element type ${tt.element.type}`)}},ElementNodeRenderer=rt=>{const{isFullScreen:tt,fragmentIdsThisRun:et}=React$1.useContext(LibContext),{node:nt,width:ot}=rt,at=nt.element.type||"",st=shouldComponentBeEnabled(at,rt.scriptRunState),ut=isComponentStale(st,nt,rt.scriptRunState,rt.scriptRunId,et),ct=getElementId(nt.element),pt=getKeyFromId(ct);return jsx$1(Maybe,{enable:st,children:jsx$1(StyledElementContainer,{className:classNames("stElementContainer","element-container",convertKeyToClassName(pt)),"data-testid":"stElementContainer","data-stale":ut,isStale:ut&&!tt,width:ot,elementType:at,children:jsx$1(ErrorBoundary,{width:ot,children:jsx$1(reactExports.Suspense,{fallback:jsx$1(Skeleton,{element:Skeleton$1.create({style:Skeleton$1.SkeletonStyle.ELEMENT})}),children:jsx$1(RawElementNodeRenderer,{...rt,isStale:ut})})})})})},BlockNodeRenderer=rt=>{const{node:tt}=rt,{fragmentIdsThisRun:et}=reactExports.useContext(LibContext);if(tt.isEmpty&&!tt.deltaBlock.allowEmpty)return jsx$1(Fragment,{});const nt=shouldComponentBeEnabled("",rt.scriptRunState),ot=isComponentStale(nt,tt,rt.scriptRunState,rt.scriptRunId,et),at={...rt,node:tt},st=rt.disableFullscreenMode||d$3(tt.deltaBlock.dialog)||d$3(tt.deltaBlock.popover),ut=jsx$1(LayoutBlock,{...at,disableFullscreenMode:st});if(tt.deltaBlock.dialog)return jsx$1(Dialog$1,{element:tt.deltaBlock.dialog,deltaMsgReceivedAt:tt.deltaMsgReceivedAt,children:ut});if(tt.deltaBlock.expandable)return jsx$1(Expander$1,{empty:tt.isEmpty,isStale:ot,element:tt.deltaBlock.expandable,children:ut});if(tt.deltaBlock.popover)return jsx$1(Popover$1,{empty:tt.isEmpty,element:tt.deltaBlock.popover,width:rt.width,children:ut});if(tt.deltaBlock.type==="form"){const{formId:ct,clearOnSubmit:pt,enterToSubmit:dt,border:ft}=tt.deltaBlock.form,bt=rt.formsData.submitButtons.get(ct),ht=bt!==void 0&&bt.length>0;return jsx$1(Form$1,{formId:ct,clearOnSubmit:pt,enterToSubmit:dt,width:rt.width,hasSubmitButton:ht,scriptRunState:rt.scriptRunState,widgetMgr:rt.widgetMgr,border:ft,children:ut})}if(tt.deltaBlock.chatMessage)return jsx$1(ChatMessage$1,{element:tt.deltaBlock.chatMessage,endpoints:rt.endpoints,children:ut});if(tt.deltaBlock.column)return jsx$1(StyledColumn,{weight:tt.deltaBlock.column.weight??0,gap:tt.deltaBlock.column.gap??"",verticalAlignment:tt.deltaBlock.column.verticalAlignment??void 0,showBorder:tt.deltaBlock.column.showBorder??!1,className:"stColumn","data-testid":"stColumn",children:ut});if(tt.deltaBlock.tabContainer){const pt={...at,isStale:ot,renderTabContent:dt=>jsx$1(VerticalBlock,{...dt})};return jsx$1(Tabs$1,{...pt})}return ut},ChildRenderer=rt=>{const{libConfig:tt}=reactExports.useContext(LibContext);assignDividerColor(rt.node,useTheme());const et=new Set;return jsx$1(Fragment,{children:rt.node.children&&rt.node.children.map((nt,ot)=>{const at=tt.disableFullscreenMode||rt.disableFullscreenMode;if(nt instanceof ElementNode){const st={...rt,disableFullscreenMode:at,node:nt},ut=getElementId(nt.element)||ot.toString();return et.has(ut)?null:(et.add(ut),jsx$1(ElementNodeRenderer,{...st},ut))}if(nt instanceof BlockNode){const st={...rt,disableFullscreenMode:at,node:nt};return jsx$1(BlockNodeRenderer,{...st},ot)}throw new Error(`Unrecognized AppNode: ${nt}`)})})};function ScrollToBottomVerticalBlockWrapper(rt){const{border:tt,height:et,children:nt}=rt,ot=useScrollToBottom();return jsx$1(StyledVerticalBlockBorderWrapper,{border:tt,height:et,"data-testid":"stVerticalBlockBorderWrapper","data-test-scroll-behavior":"scroll-to-bottom",ref:ot,children:nt})}const VerticalBlock=rt=>{var ft,bt;const tt=reactExports.useRef(null),[et,nt]=React$1.useState(-1),ot=reactExports.useMemo(()=>new ResizeObserver(([ht])=>{window.requestAnimationFrame(()=>{nt(ht.target.getBoundingClientRect().width||-1)})}),[nt]),at=((ft=rt.node.deltaBlock.vertical)==null?void 0:ft.border)??!1,st=((bt=rt.node.deltaBlock.vertical)==null?void 0:bt.height)||void 0,ut=st&&rt.node.children.find(ht=>ht instanceof BlockNode&&ht.deltaBlock.type==="chatMessage")!==void 0;reactExports.useEffect(()=>(tt.current&&ot.observe(tt.current),()=>{ot.disconnect()}),[ot,ut]);const ct=ut?ScrollToBottomVerticalBlockWrapper:StyledVerticalBlockBorderWrapper,pt={...rt,width:et},dt=getKeyFromId(rt.node.deltaBlock.id);return jsx$1(ct,{border:at,height:st,"data-testid":"stVerticalBlockBorderWrapper","data-test-scroll-behavior":"normal",children:jsx$1(StyledVerticalBlockWrapper,{ref:tt,children:jsx$1(StyledVerticalBlock,{width:et,className:classNames("stVerticalBlock",convertKeyToClassName(dt)),"data-testid":"stVerticalBlock",children:jsx$1(ChildRenderer,{...pt})})})})},HorizontalBlock=rt=>{var et;const tt=((et=rt.node.deltaBlock.horizontal)==null?void 0:et.gap)??"";return jsx$1(StyledHorizontalBlock,{gap:tt,className:"stHorizontalBlock","data-testid":"stHorizontalBlock",children:jsx$1(ChildRenderer,{...rt})})};function LayoutBlock(rt){return rt.node.deltaBlock.horizontal?jsx$1(HorizontalBlock,{...rt}):jsx$1(VerticalBlock,{...rt})}const StyledDataFrameOverlay=newStyled("div",{target:"e19n7mk11"})(({theme:rt})=>({position:"fixed",top:0,left:0,zIndex:rt.zIndices.tablePortal,lineHeight:"100%"})),PortalContext=React$1.createContext(null),PortalProvider=({children:rt})=>{const tt=reactExports.useRef(null),et=reactExports.useCallback(()=>tt.current,[]);return jsxs(PortalContext.Provider,{value:et,children:[rt,jsx$1(StyledDataFrameOverlay,{"data-testid":"portal",id:"portal",ref:tt})]})};function ThemeProvider({theme:rt,baseuiTheme:tt,children:et}){return jsx$1(ThemeProvider$1,{theme:tt||baseuiLightTheme,children:jsx$1(ThemeProvider$2,{theme:rt,children:et})})}function toCodePoint(rt,tt){const et=[];let nt=0,ot=0,at=0;for(;at<rt.length;)nt=rt.charCodeAt(at++),ot?(et.push((65536+(ot-55296<<10)+(nt-56320)).toString(16)),ot=0):55296<=nt&&nt<=56319?ot=nt:et.push(nt.toString(16));return et.join("-")}const UFE0Fg=/\uFE0F/g,U200D="";function grabTheRightIcon(rt){return toCodePoint(rt.indexOf(U200D)<0?rt.replace(UFE0Fg,""):rt)}function iconToUrl(rt){const tt=/^:(.+)\/(.+):$/,et=rt.match(tt);return et===null?"":`https://fonts.gstatic.com/s/i/short-term/release/materialsymbolsrounded/${et[2]}/default/24px.svg`}function handleFavicon(rt,tt,et){const nt=extractEmoji(rt);let ot;nt&&!rt.startsWith(":material")?ot=`https://cdn.jsdelivr.net/gh/twitter/twemoji@14.0.2/assets/72x72/${grabTheRightIcon(nt)}.png`:rt.startsWith(":material")?ot=iconToUrl(rt):ot=et.buildMediaURL(rt),overwriteFavicon(ot),tt({type:"SET_PAGE_FAVICON",favicon:ot})}function overwriteFavicon(rt){const tt=document.querySelector("link[rel='shortcut icon']");tt&&(tt.href=rt)}function extractEmoji(rt){const tt=rt.replace("-","_");return nodeEmoji$1.hasEmoji(nodeEmoji$1.get(tt))?nodeEmoji$1.get(tt):nodeEmoji$1.hasEmoji(rt)?rt:""}var lib$2={},flattenNames$1={},baseFor$1=_baseFor,keys$2=keys_1;function baseForOwn$4(rt,tt){return rt&&baseFor$1(rt,tt,keys$2)}var _baseForOwn=baseForOwn$4,identity$3=identity_1;function castFunction$2(rt){return typeof rt=="function"?rt:identity$3}var _castFunction=castFunction$2,baseForOwn$3=_baseForOwn,castFunction$1=_castFunction;function forOwn(rt,tt){return rt&&baseForOwn$3(rt,castFunction$1(tt))}var forOwn_1=forOwn,HASH_UNDEFINED$3="__lodash_hash_undefined__";function setCacheAdd$2(rt){return this.__data__.set(rt,HASH_UNDEFINED$3),this}var _setCacheAdd=setCacheAdd$2;function setCacheHas$2(rt){return this.__data__.has(rt)}var _setCacheHas=setCacheHas$2,MapCache$1=_MapCache,setCacheAdd$1=_setCacheAdd,setCacheHas$1=_setCacheHas;function SetCache$3(rt){var tt=-1,et=rt==null?0:rt.length;for(this.__data__=new MapCache$1;++tt<et;)this.add(rt[tt])}SetCache$3.prototype.add=SetCache$3.prototype.push=setCacheAdd$1;SetCache$3.prototype.has=setCacheHas$1;var _SetCache=SetCache$3;function arraySome$2(rt,tt){for(var et=-1,nt=rt==null?0:rt.length;++et<nt;)if(tt(rt[et],et,rt))return!0;return!1}var _arraySome=arraySome$2;function cacheHas$3(rt,tt){return rt.has(tt)}var _cacheHas=cacheHas$3,SetCache$2=_SetCache,arraySome$1=_arraySome,cacheHas$2=_cacheHas,COMPARE_PARTIAL_FLAG$b=1,COMPARE_UNORDERED_FLAG$7=2;function equalArrays$3(rt,tt,et,nt,ot,at){var st=et&COMPARE_PARTIAL_FLAG$b,ut=rt.length,ct=tt.length;if(ut!=ct&&!(st&&ct>ut))return!1;var pt=at.get(rt),dt=at.get(tt);if(pt&&dt)return pt==tt&&dt==rt;var ft=-1,bt=!0,ht=et&COMPARE_UNORDERED_FLAG$7?new SetCache$2:void 0;for(at.set(rt,tt),at.set(tt,rt);++ft<ut;){var mt=rt[ft],Ot=tt[ft];if(nt)var yt=st?nt(Ot,mt,ft,tt,rt,at):nt(mt,Ot,ft,rt,tt,at);if(yt!==void 0){if(yt)continue;bt=!1;break}if(ht){if(!arraySome$1(tt,function(Mt,At){if(!cacheHas$2(ht,At)&&(mt===Mt||ot(mt,Mt,et,nt,at)))return ht.push(At)})){bt=!1;break}}else if(!(mt===Ot||ot(mt,Ot,et,nt,at))){bt=!1;break}}return at.delete(rt),at.delete(tt),bt}var _equalArrays=equalArrays$3,Symbol$2=_Symbol,Uint8Array$2=_Uint8Array,eq$1=eq_1,equalArrays$2=_equalArrays,mapToArray$1=_mapToArray,setToArray$1=_setToArray,COMPARE_PARTIAL_FLAG$a=1,COMPARE_UNORDERED_FLAG$6=2,boolTag$2="[object Boolean]",dateTag$2="[object Date]",errorTag$2="[object Error]",mapTag$3="[object Map]",numberTag$2="[object Number]",regexpTag$2="[object RegExp]",setTag$3="[object Set]",stringTag$2="[object String]",symbolTag$2="[object Symbol]",arrayBufferTag$2="[object ArrayBuffer]",dataViewTag$3="[object DataView]",symbolProto$2=Symbol$2?Symbol$2.prototype:void 0,symbolValueOf$1=symbolProto$2?symbolProto$2.valueOf:void 0;function equalByTag$2(rt,tt,et,nt,ot,at,st){switch(et){case dataViewTag$3:if(rt.byteLength!=tt.byteLength||rt.byteOffset!=tt.byteOffset)return!1;rt=rt.buffer,tt=tt.buffer;case arrayBufferTag$2:return!(rt.byteLength!=tt.byteLength||!at(new Uint8Array$2(rt),new Uint8Array$2(tt)));case boolTag$2:case dateTag$2:case numberTag$2:return eq$1(+rt,+tt);case errorTag$2:return rt.name==tt.name&&rt.message==tt.message;case regexpTag$2:case stringTag$2:return rt==tt+"";case mapTag$3:var ut=mapToArray$1;case setTag$3:var ct=nt&COMPARE_PARTIAL_FLAG$a;if(ut||(ut=setToArray$1),rt.size!=tt.size&&!ct)return!1;var pt=st.get(rt);if(pt)return pt==tt;nt|=COMPARE_UNORDERED_FLAG$6,st.set(rt,tt);var dt=equalArrays$2(ut(rt),ut(tt),nt,ot,at,st);return st.delete(rt),dt;case symbolTag$2:if(symbolValueOf$1)return symbolValueOf$1.call(rt)==symbolValueOf$1.call(tt)}return!1}var _equalByTag=equalByTag$2,getAllKeys$1=_getAllKeys,COMPARE_PARTIAL_FLAG$9=1,objectProto$h=Object.prototype,hasOwnProperty$f=objectProto$h.hasOwnProperty;function equalObjects$2(rt,tt,et,nt,ot,at){var st=et&COMPARE_PARTIAL_FLAG$9,ut=getAllKeys$1(rt),ct=ut.length,pt=getAllKeys$1(tt),dt=pt.length;if(ct!=dt&&!st)return!1;for(var ft=ct;ft--;){var bt=ut[ft];if(!(st?bt in tt:hasOwnProperty$f.call(tt,bt)))return!1}var ht=at.get(rt),mt=at.get(tt);if(ht&&mt)return ht==tt&&mt==rt;var Ot=!0;at.set(rt,tt),at.set(tt,rt);for(var yt=st;++ft<ct;){bt=ut[ft];var Mt=rt[bt],At=tt[bt];if(nt)var St=st?nt(At,Mt,bt,tt,rt,at):nt(Mt,At,bt,rt,tt,at);if(!(St===void 0?Mt===At||ot(Mt,At,et,nt,at):St)){Ot=!1;break}yt||(yt=bt=="constructor")}if(Ot&&!yt){var Et=rt.constructor,zt=tt.constructor;Et!=zt&&"constructor"in rt&&"constructor"in tt&&!(typeof Et=="function"&&Et instanceof Et&&typeof zt=="function"&&zt instanceof zt)&&(Ot=!1)}return at.delete(rt),at.delete(tt),Ot}var _equalObjects=equalObjects$2,Stack$2=_Stack,equalArrays$1=_equalArrays,equalByTag$1=_equalByTag,equalObjects$1=_equalObjects,getTag$1=_getTag,isArray$7=isArray_1,isBuffer$2=isBufferExports,isTypedArray$2=isTypedArray_1,COMPARE_PARTIAL_FLAG$8=1,argsTag$3="[object Arguments]",arrayTag$2="[object Array]",objectTag$4="[object Object]",objectProto$g=Object.prototype,hasOwnProperty$e=objectProto$g.hasOwnProperty;function baseIsEqualDeep$2(rt,tt,et,nt,ot,at){var st=isArray$7(rt),ut=isArray$7(tt),ct=st?arrayTag$2:getTag$1(rt),pt=ut?arrayTag$2:getTag$1(tt);ct=ct==argsTag$3?objectTag$4:ct,pt=pt==argsTag$3?objectTag$4:pt;var dt=ct==objectTag$4,ft=pt==objectTag$4,bt=ct==pt;if(bt&&isBuffer$2(rt)){if(!isBuffer$2(tt))return!1;st=!0,dt=!1}if(bt&&!dt)return at||(at=new Stack$2),st||isTypedArray$2(rt)?equalArrays$1(rt,tt,et,nt,ot,at):equalByTag$1(rt,tt,ct,et,nt,ot,at);if(!(et&COMPARE_PARTIAL_FLAG$8)){var ht=dt&&hasOwnProperty$e.call(rt,"__wrapped__"),mt=ft&&hasOwnProperty$e.call(tt,"__wrapped__");if(ht||mt){var Ot=ht?rt.value():rt,yt=mt?tt.value():tt;return at||(at=new Stack$2),ot(Ot,yt,et,nt,at)}}return bt?(at||(at=new Stack$2),equalObjects$1(rt,tt,et,nt,ot,at)):!1}var _baseIsEqualDeep=baseIsEqualDeep$2,baseIsEqualDeep$1=_baseIsEqualDeep,isObjectLike$1=isObjectLike_1;function baseIsEqual$4(rt,tt,et,nt,ot){return rt===tt?!0:rt==null||tt==null||!isObjectLike$1(rt)&&!isObjectLike$1(tt)?rt!==rt&&tt!==tt:baseIsEqualDeep$1(rt,tt,et,nt,baseIsEqual$4,ot)}var _baseIsEqual=baseIsEqual$4,Stack$1=_Stack,baseIsEqual$3=_baseIsEqual,COMPARE_PARTIAL_FLAG$7=1,COMPARE_UNORDERED_FLAG$5=2;function baseIsMatch$2(rt,tt,et,nt){var ot=et.length,at=ot,st=!nt;if(rt==null)return!at;for(rt=Object(rt);ot--;){var ut=et[ot];if(st&&ut[2]?ut[1]!==rt[ut[0]]:!(ut[0]in rt))return!1}for(;++ot<at;){ut=et[ot];var ct=ut[0],pt=rt[ct],dt=ut[1];if(st&&ut[2]){if(pt===void 0&&!(ct in rt))return!1}else{var ft=new Stack$1;if(nt)var bt=nt(pt,dt,ct,rt,tt,ft);if(!(bt===void 0?baseIsEqual$3(dt,pt,COMPARE_PARTIAL_FLAG$7|COMPARE_UNORDERED_FLAG$5,nt,ft):bt))return!1}}return!0}var _baseIsMatch=baseIsMatch$2,isObject$3=isObject_1;function isStrictComparable$3(rt){return rt===rt&&!isObject$3(rt)}var _isStrictComparable=isStrictComparable$3,isStrictComparable$2=_isStrictComparable,keys$1=keys_1;function getMatchData$2(rt){for(var tt=keys$1(rt),et=tt.length;et--;){var nt=tt[et],ot=rt[nt];tt[et]=[nt,ot,isStrictComparable$2(ot)]}return tt}var _getMatchData=getMatchData$2;function matchesStrictComparable$3(rt,tt){return function(et){return et==null?!1:et[rt]===tt&&(tt!==void 0||rt in Object(et))}}var _matchesStrictComparable=matchesStrictComparable$3,baseIsMatch$1=_baseIsMatch,getMatchData$1=_getMatchData,matchesStrictComparable$2=_matchesStrictComparable;function baseMatches$2(rt){var tt=getMatchData$1(rt);return tt.length==1&&tt[0][2]?matchesStrictComparable$2(tt[0][0],tt[0][1]):function(et){return et===rt||baseIsMatch$1(et,rt,tt)}}var _baseMatches=baseMatches$2;function baseHasIn$2(rt,tt){return rt!=null&&tt in Object(rt)}var _baseHasIn=baseHasIn$2,castPath$3=_castPath,isArguments$1=isArguments_1,isArray$6=isArray_1,isIndex$2=_isIndex,isLength$1=isLength_1,toKey$4=_toKey;function hasPath$2(rt,tt,et){tt=castPath$3(tt,rt);for(var nt=-1,ot=tt.length,at=!1;++nt<ot;){var st=toKey$4(tt[nt]);if(!(at=rt!=null&&et(rt,st)))break;rt=rt[st]}return at||++nt!=ot?at:(ot=rt==null?0:rt.length,!!ot&&isLength$1(ot)&&isIndex$2(st,ot)&&(isArray$6(rt)||isArguments$1(rt)))}var _hasPath=hasPath$2,baseHasIn$1=_baseHasIn,hasPath$1=_hasPath;function hasIn$3(rt,tt){return rt!=null&&hasPath$1(rt,tt,baseHasIn$1)}var hasIn_1=hasIn$3,baseIsEqual$2=_baseIsEqual,get$2=get_1,hasIn$2=hasIn_1,isKey$2=_isKey,isStrictComparable$1=_isStrictComparable,matchesStrictComparable$1=_matchesStrictComparable,toKey$3=_toKey,COMPARE_PARTIAL_FLAG$6=1,COMPARE_UNORDERED_FLAG$4=2;function baseMatchesProperty$2(rt,tt){return isKey$2(rt)&&isStrictComparable$1(tt)?matchesStrictComparable$1(toKey$3(rt),tt):function(et){var nt=get$2(et,rt);return nt===void 0&&nt===tt?hasIn$2(et,rt):baseIsEqual$2(tt,nt,COMPARE_PARTIAL_FLAG$6|COMPARE_UNORDERED_FLAG$4)}}var _baseMatchesProperty=baseMatchesProperty$2,baseGet$3=_baseGet;function basePropertyDeep$2(rt){return function(tt){return baseGet$3(tt,rt)}}var _basePropertyDeep=basePropertyDeep$2,baseProperty$1=_baseProperty,basePropertyDeep$1=_basePropertyDeep,isKey$1=_isKey,toKey$2=_toKey;function property$2(rt){return isKey$1(rt)?baseProperty$1(toKey$2(rt)):basePropertyDeep$1(rt)}var property_1=property$2,baseMatches$1=_baseMatches,baseMatchesProperty$1=_baseMatchesProperty,identity$2=identity_1,isArray$5=isArray_1,property$1=property_1;function baseIteratee$5(rt){return typeof rt=="function"?rt:rt==null?identity$2:typeof rt=="object"?isArray$5(rt)?baseMatchesProperty$1(rt[0],rt[1]):baseMatches$1(rt):property$1(rt)}var _baseIteratee=baseIteratee$5,isArrayLike$2=isArrayLike_1;function createBaseEach$2(rt,tt){return function(et,nt){if(et==null)return et;if(!isArrayLike$2(et))return rt(et,nt);for(var ot=et.length,at=tt?ot:-1,st=Object(et);(tt?at--:++at<ot)&&nt(st[at],at,st)!==!1;);return et}}var _createBaseEach=createBaseEach$2,baseForOwn$2=_baseForOwn,createBaseEach$1=_createBaseEach,baseEach$3=createBaseEach$1(baseForOwn$2),_baseEach=baseEach$3,baseEach$2=_baseEach,isArrayLike$1=isArrayLike_1;function baseMap$3(rt,tt){var et=-1,nt=isArrayLike$1(rt)?Array(rt.length):[];return baseEach$2(rt,function(ot,at,st){nt[++et]=tt(ot,at,st)}),nt}var _baseMap=baseMap$3,arrayMap$3=_arrayMap,baseIteratee$4=_baseIteratee,baseMap$2=_baseMap,isArray$4=isArray_1;function map$1(rt,tt){var et=isArray$4(rt)?arrayMap$3:baseMap$2;return et(rt,baseIteratee$4(tt))}var map_1=map$1;Object.defineProperty(flattenNames$1,"__esModule",{value:!0});flattenNames$1.flattenNames=void 0;var _isString2=isString_1,_isString3=_interopRequireDefault$7(_isString2),_forOwn2$2=forOwn_1,_forOwn3$2=_interopRequireDefault$7(_forOwn2$2),_isPlainObject2=isPlainObject_1,_isPlainObject3=_interopRequireDefault$7(_isPlainObject2),_map2=map_1,_map3=_interopRequireDefault$7(_map2);function _interopRequireDefault$7(rt){return rt&&rt.__esModule?rt:{default:rt}}var flattenNames=flattenNames$1.flattenNames=function rt(){var tt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],et=[];return(0,_map3.default)(tt,function(nt){Array.isArray(nt)?rt(nt).map(function(ot){return et.push(ot)}):(0,_isPlainObject3.default)(nt)?(0,_forOwn3$2.default)(nt,function(ot,at){ot===!0&&et.push(at),et.push(at+"-"+ot)}):(0,_isString3.default)(nt)&&et.push(nt)}),et};flattenNames$1.default=flattenNames;var mergeClasses$1={};Object.defineProperty(mergeClasses$1,"__esModule",{value:!0});mergeClasses$1.mergeClasses=void 0;var _forOwn2$1=forOwn_1,_forOwn3$1=_interopRequireDefault$6(_forOwn2$1),_cloneDeep2=cloneDeep_1,_cloneDeep3=_interopRequireDefault$6(_cloneDeep2),_extends$w=Object.assign||function(rt){for(var tt=1;tt<arguments.length;tt++){var et=arguments[tt];for(var nt in et)Object.prototype.hasOwnProperty.call(et,nt)&&(rt[nt]=et[nt])}return rt};function _interopRequireDefault$6(rt){return rt&&rt.__esModule?rt:{default:rt}}var mergeClasses=mergeClasses$1.mergeClasses=function rt(tt){var et=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],nt=tt.default&&(0,_cloneDeep3.default)(tt.default)||{};return et.map(function(ot){var at=tt[ot];return at&&(0,_forOwn3$1.default)(at,function(st,ut){nt[ut]||(nt[ut]={}),nt[ut]=_extends$w({},nt[ut],at[ut])}),ot}),nt};mergeClasses$1.default=mergeClasses;var autoprefix$1={};Object.defineProperty(autoprefix$1,"__esModule",{value:!0});autoprefix$1.autoprefix=void 0;var _forOwn2=forOwn_1,_forOwn3=_interopRequireDefault$5(_forOwn2),_extends$v=Object.assign||function(rt){for(var tt=1;tt<arguments.length;tt++){var et=arguments[tt];for(var nt in et)Object.prototype.hasOwnProperty.call(et,nt)&&(rt[nt]=et[nt])}return rt};function _interopRequireDefault$5(rt){return rt&&rt.__esModule?rt:{default:rt}}var transforms={borderRadius:function rt(tt){return{msBorderRadius:tt,MozBorderRadius:tt,OBorderRadius:tt,WebkitBorderRadius:tt,borderRadius:tt}},boxShadow:function rt(tt){return{msBoxShadow:tt,MozBoxShadow:tt,OBoxShadow:tt,WebkitBoxShadow:tt,boxShadow:tt}},userSelect:function rt(tt){return{WebkitTouchCallout:tt,KhtmlUserSelect:tt,MozUserSelect:tt,msUserSelect:tt,WebkitUserSelect:tt,userSelect:tt}},flex:function rt(tt){return{WebkitBoxFlex:tt,MozBoxFlex:tt,WebkitFlex:tt,msFlex:tt,flex:tt}},flexBasis:function rt(tt){return{WebkitFlexBasis:tt,flexBasis:tt}},justifyContent:function rt(tt){return{WebkitJustifyContent:tt,justifyContent:tt}},transition:function rt(tt){return{msTransition:tt,MozTransition:tt,OTransition:tt,WebkitTransition:tt,transition:tt}},transform:function rt(tt){return{msTransform:tt,MozTransform:tt,OTransform:tt,WebkitTransform:tt,transform:tt}},absolute:function rt(tt){var et=tt&&tt.split(" ");return{position:"absolute",top:et&&et[0],right:et&&et[1],bottom:et&&et[2],left:et&&et[3]}},extend:function rt(tt,et){var nt=et[tt];return nt||{extend:tt}}},autoprefix=autoprefix$1.autoprefix=function rt(tt){var et={};return(0,_forOwn3.default)(tt,function(nt,ot){var at={};(0,_forOwn3.default)(nt,function(st,ut){var ct=transforms[ut];ct?at=_extends$v({},at,ct(st)):at[ut]=st}),et[ot]=at}),et};autoprefix$1.default=autoprefix;var hover$1={};Object.defineProperty(hover$1,"__esModule",{value:!0});hover$1.hover=void 0;var _extends$u=Object.assign||function(rt){for(var tt=1;tt<arguments.length;tt++){var et=arguments[tt];for(var nt in et)Object.prototype.hasOwnProperty.call(et,nt)&&(rt[nt]=et[nt])}return rt},_react$3=reactExports,_react2$3=_interopRequireDefault$4(_react$3);function _interopRequireDefault$4(rt){return rt&&rt.__esModule?rt:{default:rt}}function _classCallCheck$f(rt,tt){if(!(rt instanceof tt))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn$f(rt,tt){if(!rt)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return tt&&(typeof tt=="object"||typeof tt=="function")?tt:rt}function _inherits$f(rt,tt){if(typeof tt!="function"&&tt!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof tt);rt.prototype=Object.create(tt&&tt.prototype,{constructor:{value:rt,enumerable:!1,writable:!0,configurable:!0}}),tt&&(Object.setPrototypeOf?Object.setPrototypeOf(rt,tt):rt.__proto__=tt)}var hover=hover$1.hover=function rt(tt){var et=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"span";return function(nt){_inherits$f(ot,nt);function ot(){var at,st,ut,ct;_classCallCheck$f(this,ot);for(var pt=arguments.length,dt=Array(pt),ft=0;ft<pt;ft++)dt[ft]=arguments[ft];return ct=(st=(ut=_possibleConstructorReturn$f(this,(at=ot.__proto__||Object.getPrototypeOf(ot)).call.apply(at,[this].concat(dt))),ut),ut.state={hover:!1},ut.handleMouseOver=function(){return ut.setState({hover:!0})},ut.handleMouseOut=function(){return ut.setState({hover:!1})},ut.render=function(){return _react2$3.default.createElement(et,{onMouseOver:ut.handleMouseOver,onMouseOut:ut.handleMouseOut},_react2$3.default.createElement(tt,_extends$u({},ut.props,ut.state)))},st),_possibleConstructorReturn$f(ut,ct)}return ot}(_react2$3.default.Component)};hover$1.default=hover;var active$1={};Object.defineProperty(active$1,"__esModule",{value:!0});active$1.active=void 0;var _extends$t=Object.assign||function(rt){for(var tt=1;tt<arguments.length;tt++){var et=arguments[tt];for(var nt in et)Object.prototype.hasOwnProperty.call(et,nt)&&(rt[nt]=et[nt])}return rt},_react$2=reactExports,_react2$2=_interopRequireDefault$3(_react$2);function _interopRequireDefault$3(rt){return rt&&rt.__esModule?rt:{default:rt}}function _classCallCheck$e(rt,tt){if(!(rt instanceof tt))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn$e(rt,tt){if(!rt)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return tt&&(typeof tt=="object"||typeof tt=="function")?tt:rt}function _inherits$e(rt,tt){if(typeof tt!="function"&&tt!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof tt);rt.prototype=Object.create(tt&&tt.prototype,{constructor:{value:rt,enumerable:!1,writable:!0,configurable:!0}}),tt&&(Object.setPrototypeOf?Object.setPrototypeOf(rt,tt):rt.__proto__=tt)}var active=active$1.active=function rt(tt){var et=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"span";return function(nt){_inherits$e(ot,nt);function ot(){var at,st,ut,ct;_classCallCheck$e(this,ot);for(var pt=arguments.length,dt=Array(pt),ft=0;ft<pt;ft++)dt[ft]=arguments[ft];return ct=(st=(ut=_possibleConstructorReturn$e(this,(at=ot.__proto__||Object.getPrototypeOf(ot)).call.apply(at,[this].concat(dt))),ut),ut.state={active:!1},ut.handleMouseDown=function(){return ut.setState({active:!0})},ut.handleMouseUp=function(){return ut.setState({active:!1})},ut.render=function(){return _react2$2.default.createElement(et,{onMouseDown:ut.handleMouseDown,onMouseUp:ut.handleMouseUp},_react2$2.default.createElement(tt,_extends$t({},ut.props,ut.state)))},st),_possibleConstructorReturn$e(ut,ct)}return ot}(_react2$2.default.Component)};active$1.default=active;var loop={};Object.defineProperty(loop,"__esModule",{value:!0});var loopable=function rt(tt,et){var nt={},ot=function(st){var ut=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;nt[st]=ut};return tt===0&&ot("first-child"),tt===et-1&&ot("last-child"),(tt===0||tt%2===0)&&ot("even"),Math.abs(tt%2)===1&&ot("odd"),ot("nth-child",tt),nt};loop.default=loopable;Object.defineProperty(lib$2,"__esModule",{value:!0});lib$2.ReactCSS=lib$2.loop=lib$2.handleActive=handleHover=lib$2.handleHover=lib$2.hover=void 0;var _flattenNames=flattenNames$1,_flattenNames2=_interopRequireDefault$2(_flattenNames),_mergeClasses=mergeClasses$1,_mergeClasses2=_interopRequireDefault$2(_mergeClasses),_autoprefix=autoprefix$1,_autoprefix2=_interopRequireDefault$2(_autoprefix),_hover2=hover$1,_hover3=_interopRequireDefault$2(_hover2),_active=active$1,_active2=_interopRequireDefault$2(_active),_loop2=loop,_loop3=_interopRequireDefault$2(_loop2);function _interopRequireDefault$2(rt){return rt&&rt.__esModule?rt:{default:rt}}lib$2.hover=_hover3.default;var handleHover=lib$2.handleHover=_hover3.default;lib$2.handleActive=_active2.default;lib$2.loop=_loop3.default;var ReactCSS=lib$2.ReactCSS=function rt(tt){for(var et=arguments.length,nt=Array(et>1?et-1:0),ot=1;ot<et;ot++)nt[ot-1]=arguments[ot];var at=(0,_flattenNames2.default)(nt),st=(0,_mergeClasses2.default)(tt,at);return(0,_autoprefix2.default)(st)},_default$2=lib$2.default=ReactCSS,calculateChange$2=function rt(tt,et,nt,ot,at){var st=at.clientWidth,ut=at.clientHeight,ct=typeof tt.pageX=="number"?tt.pageX:tt.touches[0].pageX,pt=typeof tt.pageY=="number"?tt.pageY:tt.touches[0].pageY,dt=ct-(at.getBoundingClientRect().left+window.pageXOffset),ft=pt-(at.getBoundingClientRect().top+window.pageYOffset);if(nt==="vertical"){var bt=void 0;if(ft<0?bt=0:ft>ut?bt=1:bt=Math.round(ft*100/ut)/100,et.a!==bt)return{h:et.h,s:et.s,l:et.l,a:bt,source:"rgb"}}else{var ht=void 0;if(dt<0?ht=0:dt>st?ht=1:ht=Math.round(dt*100/st)/100,ot!==ht)return{h:et.h,s:et.s,l:et.l,a:ht,source:"rgb"}}return null},checkboardCache={},render=function rt(tt,et,nt,ot){if(typeof document>"u"&&!ot)return null;var at=ot?new ot:document.createElement("canvas");at.width=nt*2,at.height=nt*2;var st=at.getContext("2d");return st?(st.fillStyle=tt,st.fillRect(0,0,at.width,at.height),st.fillStyle=et,st.fillRect(0,0,nt,nt),st.translate(nt,nt),st.fillRect(0,0,nt,nt),at.toDataURL()):null},get$1=function rt(tt,et,nt,ot){var at=tt+"-"+et+"-"+nt+(ot?"-server":"");if(checkboardCache[at])return checkboardCache[at];var st=render(tt,et,nt,ot);return checkboardCache[at]=st,st},_extends$s=Object.assign||function(rt){for(var tt=1;tt<arguments.length;tt++){var et=arguments[tt];for(var nt in et)Object.prototype.hasOwnProperty.call(et,nt)&&(rt[nt]=et[nt])}return rt},Checkboard=function rt(tt){var et=tt.white,nt=tt.grey,ot=tt.size,at=tt.renderers,st=tt.borderRadius,ut=tt.boxShadow,ct=tt.children,pt=_default$2({default:{grid:{borderRadius:st,boxShadow:ut,absolute:"0px 0px 0px 0px",background:"url("+get$1(et,nt,ot,at.canvas)+") center left"}}});return reactExports.isValidElement(ct)?React$1.cloneElement(ct,_extends$s({},ct.props,{style:_extends$s({},ct.props.style,pt.grid)})):React$1.createElement("div",{style:pt.grid})};Checkboard.defaultProps={size:8,white:"transparent",grey:"rgba(0,0,0,.08)",renderers:{}};var _extends$r=Object.assign||function(rt){for(var tt=1;tt<arguments.length;tt++){var et=arguments[tt];for(var nt in et)Object.prototype.hasOwnProperty.call(et,nt)&&(rt[nt]=et[nt])}return rt},_createClass$d=function(){function rt(tt,et){for(var nt=0;nt<et.length;nt++){var ot=et[nt];ot.enumerable=ot.enumerable||!1,ot.configurable=!0,"value"in ot&&(ot.writable=!0),Object.defineProperty(tt,ot.key,ot)}}return function(tt,et,nt){return et&&rt(tt.prototype,et),nt&&rt(tt,nt),tt}}();function _classCallCheck$d(rt,tt){if(!(rt instanceof tt))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn$d(rt,tt){if(!rt)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return tt&&(typeof tt=="object"||typeof tt=="function")?tt:rt}function _inherits$d(rt,tt){if(typeof tt!="function"&&tt!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof tt);rt.prototype=Object.create(tt&&tt.prototype,{constructor:{value:rt,enumerable:!1,writable:!0,configurable:!0}}),tt&&(Object.setPrototypeOf?Object.setPrototypeOf(rt,tt):rt.__proto__=tt)}var Alpha=function(rt){_inherits$d(tt,rt);function tt(){var et,nt,ot,at;_classCallCheck$d(this,tt);for(var st=arguments.length,ut=Array(st),ct=0;ct<st;ct++)ut[ct]=arguments[ct];return at=(nt=(ot=_possibleConstructorReturn$d(this,(et=tt.__proto__||Object.getPrototypeOf(tt)).call.apply(et,[this].concat(ut))),ot),ot.handleChange=function(pt){var dt=calculateChange$2(pt,ot.props.hsl,ot.props.direction,ot.props.a,ot.container);dt&&typeof ot.props.onChange=="function"&&ot.props.onChange(dt,pt)},ot.handleMouseDown=function(pt){ot.handleChange(pt),window.addEventListener("mousemove",ot.handleChange),window.addEventListener("mouseup",ot.handleMouseUp)},ot.handleMouseUp=function(){ot.unbindEventListeners()},ot.unbindEventListeners=function(){window.removeEventListener("mousemove",ot.handleChange),window.removeEventListener("mouseup",ot.handleMouseUp)},nt),_possibleConstructorReturn$d(ot,at)}return _createClass$d(tt,[{key:"componentWillUnmount",value:function(){this.unbindEventListeners()}},{key:"render",value:function(){var nt=this,ot=this.props.rgb,at=_default$2({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("+ot.r+","+ot.g+","+ot.b+`, 0) 0%,
|
695
695
|
rgba(`+ot.r+","+ot.g+","+ot.b+", 1) 100%)",boxShadow:this.props.shadow,borderRadius:this.props.radius},container:{position:"relative",height:"100%",margin:"0 3px"},pointer:{position:"absolute",left:ot.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("+ot.r+","+ot.g+","+ot.b+`, 0) 0%,
|
696
696
|
rgba(`+ot.r+","+ot.g+","+ot.b+", 1) 100%)"},pointer:{left:0,top:ot.a*100+"%"}},overwrite:_extends$r({},this.props.style)},{vertical:this.props.direction==="vertical",overwrite:!0});return React$1.createElement("div",{style:at.alpha},React$1.createElement("div",{style:at.checkboard},React$1.createElement(Checkboard,{renderers:this.props.renderers})),React$1.createElement("div",{style:at.gradient}),React$1.createElement("div",{style:at.container,ref:function(ut){return nt.container=ut},onMouseDown:this.handleMouseDown,onTouchMove:this.handleChange,onTouchStart:this.handleChange},React$1.createElement("div",{style:at.pointer},this.props.pointer?React$1.createElement(this.props.pointer,this.props):React$1.createElement("div",{style:at.slider}))))}}]),tt}(reactExports.PureComponent||reactExports.Component),_createClass$c=function(){function rt(tt,et){for(var nt=0;nt<et.length;nt++){var ot=et[nt];ot.enumerable=ot.enumerable||!1,ot.configurable=!0,"value"in ot&&(ot.writable=!0),Object.defineProperty(tt,ot.key,ot)}}return function(tt,et,nt){return et&&rt(tt.prototype,et),nt&&rt(tt,nt),tt}}();function _defineProperty$d(rt,tt,et){return tt in rt?Object.defineProperty(rt,tt,{value:et,enumerable:!0,configurable:!0,writable:!0}):rt[tt]=et,rt}function _classCallCheck$c(rt,tt){if(!(rt instanceof tt))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn$c(rt,tt){if(!rt)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return tt&&(typeof tt=="object"||typeof tt=="function")?tt:rt}function _inherits$c(rt,tt){if(typeof tt!="function"&&tt!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof tt);rt.prototype=Object.create(tt&&tt.prototype,{constructor:{value:rt,enumerable:!1,writable:!0,configurable:!0}}),tt&&(Object.setPrototypeOf?Object.setPrototypeOf(rt,tt):rt.__proto__=tt)}var DEFAULT_ARROW_OFFSET=1,UP_KEY_CODE=38,DOWN_KEY_CODE=40,VALID_KEY_CODES=[UP_KEY_CODE,DOWN_KEY_CODE],isValidKeyCode=function rt(tt){return VALID_KEY_CODES.indexOf(tt)>-1},getNumberValue=function rt(tt){return Number(String(tt).replace(/%/g,""))},idCounter=1,EditableInput=function(rt){_inherits$c(tt,rt);function tt(et){_classCallCheck$c(this,tt);var nt=_possibleConstructorReturn$c(this,(tt.__proto__||Object.getPrototypeOf(tt)).call(this));return nt.handleBlur=function(){nt.state.blurValue&&nt.setState({value:nt.state.blurValue,blurValue:null})},nt.handleChange=function(ot){nt.setUpdatedValue(ot.target.value,ot)},nt.handleKeyDown=function(ot){var at=getNumberValue(ot.target.value);if(!isNaN(at)&&isValidKeyCode(ot.keyCode)){var st=nt.getArrowOffset(),ut=ot.keyCode===UP_KEY_CODE?at+st:at-st;nt.setUpdatedValue(ut,ot)}},nt.handleDrag=function(ot){if(nt.props.dragLabel){var at=Math.round(nt.props.value+ot.movementX);at>=0&&at<=nt.props.dragMax&&nt.props.onChange&&nt.props.onChange(nt.getValueObjectWithLabel(at),ot)}},nt.handleMouseDown=function(ot){nt.props.dragLabel&&(ot.preventDefault(),nt.handleDrag(ot),window.addEventListener("mousemove",nt.handleDrag),window.addEventListener("mouseup",nt.handleMouseUp))},nt.handleMouseUp=function(){nt.unbindEventListeners()},nt.unbindEventListeners=function(){window.removeEventListener("mousemove",nt.handleDrag),window.removeEventListener("mouseup",nt.handleMouseUp)},nt.state={value:String(et.value).toUpperCase(),blurValue:String(et.value).toUpperCase()},nt.inputId="rc-editable-input-"+idCounter++,nt}return _createClass$c(tt,[{key:"componentDidUpdate",value:function(nt,ot){this.props.value!==this.state.value&&(nt.value!==this.props.value||ot.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(nt){return _defineProperty$d({},this.props.label,nt)}},{key:"getArrowOffset",value:function(){return this.props.arrowOffset||DEFAULT_ARROW_OFFSET}},{key:"setUpdatedValue",value:function(nt,ot){var at=this.props.label?this.getValueObjectWithLabel(nt):nt;this.props.onChange&&this.props.onChange(at,ot),this.setState({value:nt})}},{key:"render",value:function(){var nt=this,ot=_default$2({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$1.createElement("div",{style:ot.wrap},React$1.createElement("input",{id:this.inputId,style:ot.input,ref:function(st){return nt.input=st},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$1.createElement("label",{htmlFor:this.inputId,style:ot.label,onMouseDown:this.handleMouseDown},this.props.label):null)}}]),tt}(reactExports.PureComponent||reactExports.Component),calculateChange$1=function rt(tt,et,nt,ot){var at=ot.clientWidth,st=ot.clientHeight,ut=typeof tt.pageX=="number"?tt.pageX:tt.touches[0].pageX,ct=typeof tt.pageY=="number"?tt.pageY:tt.touches[0].pageY,pt=ut-(ot.getBoundingClientRect().left+window.pageXOffset),dt=ct-(ot.getBoundingClientRect().top+window.pageYOffset);if(et==="vertical"){var ft=void 0;if(dt<0)ft=359;else if(dt>st)ft=0;else{var bt=-(dt*100/st)+100;ft=360*bt/100}if(nt.h!==ft)return{h:ft,s:nt.s,l:nt.l,a:nt.a,source:"hsl"}}else{var ht=void 0;if(pt<0)ht=0;else if(pt>at)ht=359;else{var mt=pt*100/at;ht=360*mt/100}if(nt.h!==ht)return{h:ht,s:nt.s,l:nt.l,a:nt.a,source:"hsl"}}return null},_createClass$b=function(){function rt(tt,et){for(var nt=0;nt<et.length;nt++){var ot=et[nt];ot.enumerable=ot.enumerable||!1,ot.configurable=!0,"value"in ot&&(ot.writable=!0),Object.defineProperty(tt,ot.key,ot)}}return function(tt,et,nt){return et&&rt(tt.prototype,et),nt&&rt(tt,nt),tt}}();function _classCallCheck$b(rt,tt){if(!(rt instanceof tt))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn$b(rt,tt){if(!rt)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return tt&&(typeof tt=="object"||typeof tt=="function")?tt:rt}function _inherits$b(rt,tt){if(typeof tt!="function"&&tt!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof tt);rt.prototype=Object.create(tt&&tt.prototype,{constructor:{value:rt,enumerable:!1,writable:!0,configurable:!0}}),tt&&(Object.setPrototypeOf?Object.setPrototypeOf(rt,tt):rt.__proto__=tt)}var Hue=function(rt){_inherits$b(tt,rt);function tt(){var et,nt,ot,at;_classCallCheck$b(this,tt);for(var st=arguments.length,ut=Array(st),ct=0;ct<st;ct++)ut[ct]=arguments[ct];return at=(nt=(ot=_possibleConstructorReturn$b(this,(et=tt.__proto__||Object.getPrototypeOf(tt)).call.apply(et,[this].concat(ut))),ot),ot.handleChange=function(pt){var dt=calculateChange$1(pt,ot.props.direction,ot.props.hsl,ot.container);dt&&typeof ot.props.onChange=="function"&&ot.props.onChange(dt,pt)},ot.handleMouseDown=function(pt){ot.handleChange(pt),window.addEventListener("mousemove",ot.handleChange),window.addEventListener("mouseup",ot.handleMouseUp)},ot.handleMouseUp=function(){ot.unbindEventListeners()},nt),_possibleConstructorReturn$b(ot,at)}return _createClass$b(tt,[{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 nt=this,ot=this.props.direction,at=ot===void 0?"horizontal":ot,st=_default$2({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:at==="vertical"});return React$1.createElement("div",{style:st.hue},React$1.createElement("div",{className:"hue-"+at,style:st.container,ref:function(ct){return nt.container=ct},onMouseDown:this.handleMouseDown,onTouchMove:this.handleChange,onTouchStart:this.handleChange},React$1.createElement("style",null,`
|
697
697
|
.hue-horizontal {
|
@@ -808,4 +808,4 @@ The app's main file \`${rt}\` 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:rt}){const{colors:tt,fontSizes:et,spacing:nt}=useTheme();return jsx$1(ModalBody$2,{style:{marginTop:nt.none,marginLeft:nt.none,marginRight:nt.none,marginBottom:nt.none,paddingTop:nt.md,paddingRight:nt.none,paddingBottom:nt.none,paddingLeft:nt.none,color:tt.bodyText,fontSize:et.md,overflowY:"auto"},children:rt})}function DeployModal(rt){const{children:tt,onClose:et}=rt;return jsxs(Modal,{isOpen:!0,closeable:!0,onClose:et,size:"auto",children:[jsx$1(ModalHeader,{children:"Deploy this app using..."}),jsx$1(ModalBody,{children:tt})]})}function DeployCard(rt){const{colors:tt,spacing:et,radii:nt,breakpoints:ot,sizes:at}=useTheme(),{children:st}=rt;return jsx$1(Card,{overrides:{Root:{style:{borderTopWidth:at.borderWidth,borderBottomWidth:at.borderWidth,borderLeftWidth:at.borderWidth,borderRightWidth:at.borderWidth,borderTopStyle:"solid",borderBottomStyle:"none",borderLeftStyle:"none",borderRightStyle:"solid",borderTopColor:tt.borderColor,borderBottomColor:tt.borderColor,borderLeftColor:tt.borderColor,borderRightColor:tt.borderColor,borderTopLeftRadius:"none",borderTopRightRadius:"none",borderBottomLeftRadius:"none",borderBottomRightRadius:"none",":last-child":{borderRightStyle:"none",borderBottomRightRadius:nt.xl},":first-child":{borderBottomLeftRadius:nt.xl},[`@media (max-width: ${ot.md})`]:{":last-child":{borderBottomLeftRadius:nt.xl}}}},Contents:{style:{marginBottom:0,marginTop:0,marginLeft:0,marginRight:0,height:"100%"}},Body:{style:{padding:et.twoXL,marginBottom:0,marginTop:0,marginLeft:0,marginRight:0,height:"100%",display:"flex",flexDirection:"column",[`@media (max-width: ${ot.md})`]:{padding:et.xl}}}},children:st})}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:rt})=>({fontFamily:rt.fonts.sansSerif,fontWeight:rt.fontWeights.bold,fontSize:rt.fontSizes.lg,color:rt.colors.grey90,marginTop:rt.spacing.twoXL,marginBottom:rt.spacing.twoXS,[`@media (max-width: ${rt.breakpoints.md})`]:{marginTop:rt.spacing.md}})),StyledSubheader=newStyled("div",{target:"edlp5wu1"})(({theme:rt})=>({fontFamily:rt.fonts.sansSerif,fontWeight:rt.fontWeights.normal,fontSize:rt.fontSizes.md,color:rt.colors.grey90,marginTop:rt.spacing.twoXS,marginBottom:rt.spacing.md,[`@media (max-width: ${rt.breakpoints.md})`]:{marginTop:rt.spacing.md}})),StyledCardContainer=newStyled("div",{target:"edlp5wu2"})(({theme:rt})=>({display:"grid",maxWidth:`calc(1.25 * ${rt.sizes.contentMaxWidth})`,gridTemplateColumns:"1fr 1fr 1fr",gridGap:rt.spacing.none,[`@media (max-width: ${rt.breakpoints.md})`]:{gridTemplateColumns:"1fr"}})),StyledElement=newStyled("div",{target:"edlp5wu3"})(({theme:rt})=>({display:"inline-flex",marginTop:rt.spacing.sm,"& > span":{fontFamily:rt.fonts.sansSerif,fontWeight:rt.fontWeights.normal,fontSize:rt.fontSizes.md,marginLeft:rt.spacing.twoXL,color:rt.colors.gray70},"& > img":{position:"absolute",marginTop:rt.spacing.sm}})),StyledActionsWrapper=newStyled("div",{target:"edlp5wu4"})(({theme:rt})=>({display:"flex",marginTop:rt.spacing.threeXL,"& > button":{marginRight:rt.spacing.twoXL},[`@media (max-width: ${rt.breakpoints.md})`]:{marginTop:rt.spacing.xl}}));function DeployListElement(rt){const{children:tt}=rt;return jsxs(StyledElement,{children:[jsx$1("img",{src:Checkmark,alt:"Checkmark"}),jsx$1("span",{children:tt})]})}const{GitStates}=GitInfo,openUrl=rt=>{window.open(rt,"_blank")},getDeployAppUrl=rt=>{if(rt){const tt=new URL(DEPLOY_URL);return tt.searchParams.set("repository",rt.repository??""),tt.searchParams.set("branch",rt.branch??""),tt.searchParams.set("mainModule",rt.module??""),tt.toString()}return STREAMLIT_CLOUD_URL};function DeployDialog(rt){const{gitInfo:tt}=reactExports.useContext(AppContext),{onClose:et,metricsMgr:nt}=rt,ot=reactExports.useCallback(()=>{const{showDeployError:at,isDeployErrorModalOpen:st,metricsMgr:ut}=rt;if(ut.enqueue("menuClick",{label:"deployButtonInDialog"}),!tt){const mt=NoRepositoryDetected();at(mt.title,mt.body);return}const{repository:ct,branch:pt,module:dt,untrackedFiles:ft,state:bt}=tt;if((!ct||!pt||!dt)&&bt===GitStates.DEFAULT){const mt=NoRepositoryDetected();at(mt.title,mt.body);return}if(bt===GitStates.HEAD_DETACHED){const mt=DetachedHead();at(mt.title,mt.body);return}if(dt&&(ft!=null&&ft.includes(dt))){const mt=ModuleIsNotAdded(dt);at(mt.title,mt.body);return}st&&et(),openUrl(getDeployAppUrl(tt))},[rt,et,tt]);return jsx$1(DeployModal,{onClose:et,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:ot,children:"Deploy now"}),jsx$1(BaseButton,{onClick:()=>{nt.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:()=>{nt.enqueue("menuClick",{label:"startTrialInDeployDialog"}),openUrl(SNOWFLAKE_TRIAL_URL)},children:"Start trial"}),jsx$1(BaseButton,{onClick:()=>{nt.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:()=>{nt.enqueue("menuClick",{label:"readMoreDeployTutorialInDeployDialog"}),openUrl(STREAMLIT_DEPLOY_TUTORIAL_URL)},kind:BaseButtonKind.MINIMAL,children:"Learn more"})})})]})]})})}function StreamlitDialog(rt){switch(rt.type){case DialogType.ABOUT:return aboutDialog(rt);case DialogType.CLEAR_CACHE:return clearCacheDialog(rt);case DialogType.SETTINGS:return settingsDialog(rt);case DialogType.SCRIPT_COMPILE_ERROR:return scriptCompileErrorDialog(rt);case DialogType.THEME_CREATOR:return jsx$1(ThemeCreatorDialog,{...rt});case DialogType.WARNING:return warningDialog(rt);case DialogType.DEPLOY_DIALOG:return jsx$1(DeployDialog,{...rt});case DialogType.DEPLOY_ERROR:return deployErrorDialog(rt);case void 0:return noDialog(rt);default:return typeNotRecognizedDialog(rt)}}function aboutDialog(rt){if(rt.aboutSectionMd){const tt={overflowY:"auto",overflowX:"hidden",maxHeight:"35vh"},et=`
|
810
810
|
`,nt=[`Made with Streamlit v${rt.sessionInfo.current.streamlitVersion}`,STREAMLIT_HOME_URL,`Copyright ${new Date().getFullYear()} Snowflake Inc. All rights reserved.`].join(et),ot=`${rt.aboutSectionMd} ${et} ${et} ${nt}`;return jsxs(Modal,{isOpen:!0,onClose:rt.onClose,children:[jsx$1(ModalHeader,{children:"About"}),jsx$1(ModalBody$1,{children:jsx$1(StyledAboutInfo,{children:jsx$1(StreamlitMarkdown$1,{source:ot,allowHTML:!1,style:tt})})})]})}return jsxs(Modal,{isOpen:!0,onClose:rt.onClose,children:[jsx$1(ModalHeader,{children:"Made with"}),jsx$1(ModalBody$1,{children:jsxs("div",{children:[rt.sessionInfo.isSet&&jsxs(Fragment,{children:["Streamlit v",rt.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(rt){const et=["**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:rt.onClose,children:[jsx$1(ModalHeader,{children:"Clear caches"}),jsx$1(ModalBody$1,{children:jsx$1(StreamlitMarkdown$1,{source:et,allowHTML:!1})}),jsxs(ModalFooter,{children:[jsx$1(ModalButton,{kind:BaseButtonKind.GHOST,onClick:rt.onClose,children:"Cancel"}),jsx$1(ModalButton,{autoFocus:!0,kind:BaseButtonKind.SECONDARY,onClick:rt.confirmCallback,children:"Clear caches"})]})]})})}function scriptCompileErrorDialog(rt){var tt;return jsxs(Modal,{isOpen:!0,onClose:rt.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:(tt=rt.exception)!=null&&tt.message?rt.exception.message:"No message"})}),jsx$1(ModalFooter,{children:jsx$1(ModalButton,{kind:BaseButtonKind.SECONDARY,onClick:rt.onClose,children:"Close"})})]})}function settingsDialog(rt){return jsx$1(SettingsDialog,{...rt})}function warningDialog(rt){return jsxs(Modal,{isOpen:!0,onClose:rt.onClose,children:[jsx$1(ModalHeader,{children:rt.title}),jsx$1(ModalBody$1,{children:rt.msg})]})}function deployErrorDialog({title:rt,msg:tt,onClose:et,onContinue:nt,onTryAgain:ot}){const at=()=>{et(),nt&&nt()};return jsxs(Modal,{isOpen:!0,onClose:et,children:[jsx$1(ModalHeader,{children:rt}),jsx$1(ModalBody$1,{children:jsx$1(StyledDeployErrorContent,{children:tt})}),jsxs(ModalFooter,{children:[jsx$1(ModalButton,{kind:BaseButtonKind.GHOST,onClick:ot,children:"Try again"}),jsx$1(ModalButton,{kind:BaseButtonKind.SECONDARY,onClick:at,children:nt?"Continue anyway":"Close"})]})]})}function noDialog({onClose:rt}){return jsx$1(Modal,{isOpen:!1,onClose:rt})}function typeNotRecognizedDialog(rt){return jsx$1(Modal,{isOpen:!0,onClose:rt.onClose,children:jsx$1(ModalBody$1,{children:`Dialog type "${rt.type}" not recognized.`})})}class SessionEventDispatcher{constructor(){this.onSessionEvent=new dist.Signal}handleSessionEventMsg(tt){this.onSessionEvent.emit(tt)}}var assignValue=_assignValue,castPath$1=_castPath,isIndex=_isIndex,isObject=isObject_1,toKey=_toKey;function baseSet$1(rt,tt,et,nt){if(!isObject(rt))return rt;tt=castPath$1(tt,rt);for(var ot=-1,at=tt.length,st=at-1,ut=rt;ut!=null&&++ot<at;){var ct=toKey(tt[ot]),pt=et;if(ct==="__proto__"||ct==="constructor"||ct==="prototype")return rt;if(ot!=st){var dt=ut[ct];pt=nt?nt(dt,ct,ut):void 0,pt===void 0&&(pt=isObject(dt)?dt:isIndex(tt[ot+1])?[]:{})}assignValue(ut,ct,pt),ut=ut[ct]}return rt}var _baseSet=baseSet$1,baseGet=_baseGet,baseSet=_baseSet,castPath=_castPath;function basePickBy$1(rt,tt,et){for(var nt=-1,ot=tt.length,at={};++nt<ot;){var st=tt[nt],ut=baseGet(rt,st);et(ut,st)&&baseSet(at,castPath(st,rt),ut)}return at}var _basePickBy=basePickBy$1,basePickBy=_basePickBy,hasIn=hasIn_1;function basePick$1(rt,tt){return basePickBy(rt,tt,function(et,nt){return hasIn(rt,nt)})}var _basePick=basePick$1,basePick=_basePick,flatRest=_flatRest,pick=flatRest(function(rt,tt){return rt==null?{}:basePick(rt,tt)}),pick_1=pick;const pick$1=getDefaultExportFromCjs$1(pick_1),DEFAULT_METRICS_CONFIG="https://data.streamlit.io/metrics.json",log$1=loglevelExports$1.getLogger("MetricsManager");class MetricsManager{constructor(tt){this.initialized=!1,this.actuallySendMetrics=!1,this.metricsUrl=void 0,this.sendMessageToHost=()=>{},this.anonymousId="",this.pendingEvents=[],this.appHash="Not initialized",this.metadata={},this.setAppHash=et=>{this.appHash=et},this.setMetricsConfig=(et="")=>{this.metricsUrl=et},this.sessionInfo=tt}async initialize({gatherUsageStats:tt,sendMessageToHost:et}){this.sendMessageToHost=et,this.actuallySendMetrics=tt&&this.metricsUrl!=="off",this.getAnonymousId(),this.actuallySendMetrics&&!this.metricsUrl&&(await this.requestDefaultMetricsConfig(),this.metricsUrl||(log$1.error("Undefined metrics config - deactivating metrics tracking."),this.actuallySendMetrics=!1)),this.actuallySendMetrics&&this.sendPendingEvents(),log$1.info("Gather usage stats: ",this.actuallySendMetrics),this.initialized=!0}enqueue(tt,et={}){if(!this.initialized||!this.sessionInfo.isSet){this.pendingEvents.push([tt,et]);return}this.actuallySendMetrics&&(this.pendingEvents.length&&this.sendPendingEvents(),this.send(tt,et))}setMetadata(tt){this.metadata=tt}async requestDefaultMetricsConfig(){const tt=p$4();if(tt){const et=window.localStorage.getItem("stMetricsConfig");if(et){this.metricsUrl=et;return}}try{const et=await fetch(DEFAULT_METRICS_CONFIG,{signal:AbortSignal.timeout(5e3)});if(!et.ok)this.metricsUrl=void 0,log$1.error("Failed to fetch metrics config: ",et.status);else{const nt=await et.json();this.metricsUrl=nt.url??void 0,tt&&this.metricsUrl&&window.localStorage.setItem("stMetricsConfig",this.metricsUrl)}}catch(et){log$1.error("Failed to fetch metrics config:",et)}}send(tt,et={}){const nt=this.buildEventProto(tt,et);this.metricsUrl==="postMessage"?this.postMessageEvent(tt,nt):this.track(nt)}sendPendingEvents(){this.pendingEvents.forEach(([tt,et])=>{this.send(tt,et)}),this.pendingEvents=[]}async track(tt){const et=new Request(this.metricsUrl,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(tt.toJSON())});await fetch(et)}postMessageEvent(tt,et){this.sendMessageToHost({type:"METRICS_EVENT",eventName:tt,data:et})}buildEventProto(tt,et){const nt=new MetricsEvent({event:tt,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(tt==="menuClick")nt.label=et.label;else if(tt==="pageProfile")return new MetricsEvent({...nt,...et});return nt}getInstallationData(){return{machineIdV3:this.sessionInfo.current.installationIdV3}}getHostTrackingData(){return this.metadata?pick$1(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 tt="ajs_anonymous_id",et=p$4(),nt=f$3(tt),ot=et?window.localStorage.getItem(tt):null,at=new Date;if(at.setFullYear(new Date().getFullYear()+1),nt)this.anonymousId=nt,et&&window.localStorage.setItem(tt,nt);else if(ot){try{this.anonymousId=JSON.parse(ot)}catch{this.anonymousId=ot}setCookie(tt,this.anonymousId,at)}else this.anonymousId=v4(),setCookie(tt,this.anonymousId,at),et&&window.localStorage.setItem(tt,this.anonymousId)}}const StyledApp=newStyled("div",{target:"ee4bbma0"})(({theme:rt})=>{const tt=hasLightBackgroundColor(rt);return{position:"absolute",background:rt.colors.bgColor,color:rt.colors.bodyText,top:rt.spacing.none,left:rt.spacing.none,right:rt.spacing.none,bottom:rt.spacing.none,colorScheme:tt?"light":"dark",overflow:"hidden","@media print":{float:"none",height:rt.sizes.full,position:"static",overflow:"visible"}}}),StyledRecordAudioLabel=newStyled("label",{target:"ej964cx0"})({margin:0}),StyledInstruction=newStyled("p",{target:"ej964cx1"})({margin:0}),ScreencastDialog=({onClose:rt,toggleRecordAudio:tt,recordAudio:et,startRecording:nt})=>{const[ot,at]=reactExports.useState(et),st=reactExports.useCallback(ct=>{const{checked:pt}=ct.target;pt!==ot&&(at(pt),tt())},[ot,tt]),ut=reactExports.useCallback(()=>{nt(),rt()},[nt,rt]);return jsxs(Modal,{isOpen:!0,onClose:rt,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:ot,onChange:st})," ","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:ut,children:"Start recording!"})})]})},StyledVideo=newStyled("video",{target:"emkt0dj0"})(({theme:rt})=>({width:rt.sizes.full,borderRadius:rt.radii.md})),StyledDialogContainer=newStyled("div",{target:"emkt0dj1"})(({theme:rt})=>({display:"flex",flexDirection:"column",width:rt.sizes.full})),StyledRow=newStyled("div",{target:"emkt0dj2"})(({theme:rt})=>({display:"flex",flexDirection:"row",paddingTop:rt.spacing.md,paddingBottom:rt.spacing.md})),StyledFirstColumn=newStyled("div",{target:"emkt0dj3"})(({theme:rt})=>({paddingRight:rt.spacing.lg,textAlign:"right",color:rt.colors.gray,fontWeight:rt.fontWeights.bold,width:"6em"})),StyledSecondColumn=newStyled("div",{target:"emkt0dj4"})(({theme:rt})=>({flex:1,paddingRight:rt.spacing.lg,marginRight:"6em",[`@media (max-width: ${rt.breakpoints.sm})`]:{marginRight:rt.spacing.none}})),StyledVideoFormatInstructions=newStyled("p",{target:"emkt0dj5"})(({theme:rt})=>({marginTop:rt.spacing.sm,marginBottom:rt.spacing.none,fontSize:rt.fontSizes.sm})),StyledDownloadButtonContainer=newStyled("div",{target:"emkt0dj6"})(({theme:rt})=>({marginTop:rt.spacing.twoXS})),VideoRecordedDialog=({onClose:rt,videoBlob:tt,fileName:et})=>{const nt=URL.createObjectURL(tt),ot=()=>{const at=document.createElement("a");at.setAttribute("href",nt),at.setAttribute("download",`${et}.webm`),at.click(),rt()};return jsxs(Modal,{isOpen:!0,onClose:rt,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:nt,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:ot,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:rt})=>({display:"flex",alignItems:"center",justifyItems:"center",marginRight:rt.spacing.twoXL,marginLeft:rt.spacing.sm,fontSize:rt.fontSizes.fourXL})),StyledUnsupportedScreenCastExplanation=newStyled("p",{target:"e1o5y2012"})(({theme:rt})=>({margin:rt.spacing.none})),UnsupportedBrowserDialog=({onClose:rt})=>jsxs(Modal,{isOpen:!0,onClose:rt,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:rt})=>({position:"fixed",display:"flex",justifyContent:"center",alignItems:"center",top:0,left:0,width:rt.sizes.full,height:rt.sizes.full,fontSize:"40vh",color:rt.colors.red,fontWeight:rt.fontWeights.bold,opacity:"0.8",textShadow:`1px 1px 10px ${rt.colors.darkGray}`,transition:"opacity 0.3s ease-in-out",animation:`${screencastCounterAnimation} 1s`})),Countdown=({countdown:rt,endCallback:tt})=>{const[et,nt]=reactExports.useState(rt);return jsx$1(StyledCountdown,{"data-testid":"stCountdown",onAnimationEnd:()=>{const at=et-1;at>=0&&nt(at),at===0&&tt()},children:jsx$1("span",{children:et})},`frame${et}`)},log=loglevelExports$1.getLogger("withScreencast");function withScreencast(rt){const tt=et=>{const{testOverride:nt}=et,ot=reactExports.useRef(null),[at,st]=reactExports.useState("streamlit-screencast"),[ut,ct]=reactExports.useState(!1),[pt,dt]=reactExports.useState(void 0),[ft,bt]=reactExports.useState(nt||"OFF"),ht=reactExports.useCallback(()=>{ct(Et=>!Et)},[]),mt=reactExports.useCallback(async()=>{if(!(ft==="OFF"||m$4(ot.current))){if(ft==="COUNTDOWN"){bt("OFF");return}if(ft==="RECORDING"){const Et=ot.current;if(!Et||Et.getState()==="inactive")bt("OFF");else{const zt=await Et.stop();dt(zt),bt("PREVIEW_FILE")}}}},[ft]),Ot=reactExports.useCallback(async()=>{if(!ScreenCastRecorder.isSupportedBrowser()){bt("UNSUPPORTED");return}ot.current=new ScreenCastRecorder({recordAudio:ut,onErrorOrStop:()=>{mt().catch(Et=>log.warn(`withScreencast.stopRecording threw an error: ${Et}`))}});try{await ot.current.initialize()}catch(Et){log.warn(`ScreenCastRecorder.initialize error: ${Et}`),bt("UNSUPPORTED");return}bt("COUNTDOWN")},[ut,mt]),yt=reactExports.useCallback(Et=>{if(!ScreenCastRecorder.isSupportedBrowser()){bt("UNSUPPORTED");return}if(ft==="OFF"){st(Et),bt("SETUP");return}mt().catch(zt=>log.warn(`withScreencast.stopRecording threw an error: ${zt}`))},[ft,mt]),Mt=reactExports.useCallback(async()=>{if(m$4(ot.current))throw new Error("Countdown finished but recorder is null");ot.current.start()?bt("RECORDING"):mt().catch(zt=>log.warn(`withScreencast.stopRecording threw an error: ${zt}`))},[mt]),At=reactExports.useCallback(()=>{bt("OFF")},[]);return jsxs("div",{className:"withScreencast","data-testid":"stScreencast",children:[jsx$1(rt,{...et,screenCast:{currentState:ft,toggleRecordAudio:ht,startRecording:yt,stopRecording:mt}}),ft==="UNSUPPORTED"&&jsx$1(UnsupportedBrowserDialog$1,{onClose:At}),ft==="SETUP"&&jsx$1(ScreencastDialog,{recordAudio:ut,onClose:At,startRecording:Ot,toggleRecordAudio:ht}),ft==="COUNTDOWN"&&jsx$1(Countdown,{countdown:3,endCallback:Mt}),ft==="PREVIEW_FILE"&&pt&&jsx$1(VideoRecordedDialog,{onClose:At,videoBlob:pt,fileName:at})]})};return tt.displayName=`withScreencast(${rt.displayName||rt.name||"Component"})`,hoistNonReactStatics$1(tt,rt)}const showDevelopmentOptions=(rt,tt)=>tt==Config.ToolbarMode.DEVELOPER?!0:Config.ToolbarMode.VIEWER==tt||Config.ToolbarMode.MINIMAL==tt?!1:rt||isLocalhost();function getTitle(rt){return rt||"Streamlit"}class StrategyV1{constructor(tt){this.appNav=tt,this.appPages=[],this.currentPageScriptHash=null,this.hideSidebarNav=null}handleNewSession(tt){var st,ut;this.appPages=tt.appPages,this.currentPageScriptHash=tt.pageScriptHash,this.hideSidebarNav=((st=tt.config)==null?void 0:st.hideSidebarNav)??!1;const et=this.appPages[0],nt=et.urlPathname??"",ot=((ut=this.appPages.find(ct=>ct.pageScriptHash===this.currentPageScriptHash))==null?void 0:ut.urlPathname)??"",at=et.pageScriptHash===this.currentPageScriptHash;return this.appNav.onUpdatePageUrl(nt,ot,at),document.title=getTitle(ot??""),[{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:at?"":ot,currentPageScriptHash:this.currentPageScriptHash})}]}handlePagesChanged(tt){const{appPages:et}=tt;return[{appPages:et},()=>{this.appNav.hostCommunicationMgr.sendMessageToHost({type:"SET_APP_PAGES",appPages:et})}]}handlePageNotFound(tt){var ot;const{pageName:et}=tt;this.appNav.onPageNotFound(et);const nt=((ot=this.appPages[0])==null?void 0:ot.pageScriptHash)??"";return this.currentPageScriptHash=nt,[{currentPageScriptHash:nt},()=>{this.appNav.hostCommunicationMgr.sendMessageToHost({type:"SET_CURRENT_PAGE_NAME",currentPageName:"",currentPageScriptHash:nt})}]}handleNavigation(tt){}findPageByUrlPath(tt){return this.appPages.length===0?null:this.appPages.find(et=>tt.endsWith("/"+et.urlPathname))??this.appPages[0]}clearPageElements(tt,et,nt){return AppRoot.empty(et,!1,nt,tt.logo)}}class StrategyV2{constructor(tt){this.appNav=tt,this.mainScriptHash=null,this.appPages=[],this.mainPage=null,this.hideSidebarNav=null}handleNewSession(tt){var et;return this.mainScriptHash=tt.mainScriptHash,this.hideSidebarNav===null&&(this.hideSidebarNav=((et=tt.config)==null?void 0:et.hideSidebarNav)??null),document.title=getTitle(""),[{hideSidebarNav:this.hideSidebarNav??!1},()=>{}]}handlePagesChanged(tt){}handlePageNotFound(tt){const{pageName:et}=tt;return this.appNav.onPageNotFound(et),[{currentPageScriptHash:this.mainScriptHash??""},()=>{this.appNav.hostCommunicationMgr.sendMessageToHost({type:"SET_CURRENT_PAGE_NAME",currentPageName:"",currentPageScriptHash:this.mainScriptHash??""})}]}handleNavigation(tt){const{sections:et,position:nt,appPages:ot}=tt;this.appPages=ot,this.hideSidebarNav=nt===Navigation.Position.HIDDEN;const at=tt.pageScriptHash,st=ot.find(pt=>pt.pageScriptHash===at),ut=ot.find(pt=>pt.isDefault);this.mainPage=ut;const ct=st.urlPathname;if(!this.appNav.isPageTitleSet){const pt=getTitle(st.pageName);document.title=pt,this.appNav.hostCommunicationMgr.sendMessageToHost({type:"SET_PAGE_TITLE",title:st.pageName??""})}return!this.appNav.isPageIconSet&&st.icon&&this.appNav.onPageIconChange(st.icon),this.appNav.onUpdatePageUrl(ut.urlPathname??"",ct,st.isDefault??!1),[{appPages:ot,navSections:et,hideSidebarNav:this.hideSidebarNav,expandSidebarNav:tt.expanded,currentPageScriptHash:at},()=>{this.appNav.hostCommunicationMgr.sendMessageToHost({type:"SET_APP_PAGES",appPages:ot}),this.appNav.hostCommunicationMgr.sendMessageToHost({type:"SET_CURRENT_PAGE_NAME",currentPageName:st.isDefault?"":ct,currentPageScriptHash:at})}]}findPageByUrlPath(tt){return this.appPages.find(et=>tt.endsWith("/"+et.urlPathname))??this.mainPage}clearPageElements(tt,et,nt){return tt.filterMainScriptElements(et)}}class AppNavigation{constructor(tt,et,nt,ot){this.hostCommunicationMgr=tt,this.onUpdatePageUrl=et,this.onPageNotFound=nt,this.onPageIconChange=ot,this.isPageIconSet=!1,this.isPageTitleSet=!1,this.strategy=new StrategyV1(this)}handleNewSession(tt){return this.isPageTitleSet=!1,this.isPageIconSet=!1,this.strategy.handleNewSession(tt)}handleNavigation(tt){return this.strategy instanceof StrategyV1&&(this.strategy=new StrategyV2(this)),this.strategy.handleNavigation(tt)}handlePagesChanged(tt){return this.strategy.handlePagesChanged(tt)}handlePageNotFound(tt){return this.strategy.handlePageNotFound(tt)}findPageByUrlPath(tt){return this.strategy.findPageByUrlPath(tt)}handlePageConfigChanged(tt){this.isPageIconSet=!!tt.favicon,this.isPageTitleSet=!!tt.title}clearPageElements(tt,et,nt){return this.strategy.clearPageElements(tt,et,nt)}}var define_PACKAGE_METADATA_default={version:"1.42.0"};const ELEMENT_LIST_BUFFER_TIMEOUT_MS=10,INITIAL_SCRIPT_RUN_ID="<null>",LOG=loglevelExports$1.getLogger("App");class App extends reactExports.PureComponent{constructor(tt){super(tt),this.sessionInfo=new SessionInfo,this.metricsMgr=new MetricsManager(this.sessionInfo),this.sessionEventDispatcher=new SessionEventDispatcher,this.embeddingId=generateUID$2(),this.showDeployError=(nt,ot,at)=>{this.openDialog({type:DialogType.DEPLOY_ERROR,title:nt,msg:ot,onContinue:at,onClose:()=>{},onTryAgain:this.sendLoadGitInfoBackMsg})},this.handleThemeMessage=(nt,ot)=>{const[,at,st]=createPresetThemes(),ut=isPresetTheme(this.props.theme.activeTheme);nt===at.name&&ut?this.props.theme.setTheme(at):nt===st.name&&ut?this.props.theme.setTheme(st):ot&&this.props.theme.setImportedTheme(ot)},this.handleConnectionStateChanged=nt=>{if(LOG.info(`Connection state changed from ${this.state.connectionState} to ${nt}`),nt===ConnectionState.CONNECTED){LOG.info("Reconnected to server.");const ot=this.state.scriptRunState===ScriptRunState.RERUN_REQUESTED||this.state.scriptRunState===ScriptRunState.RUNNING;(!this.sessionInfo.last||ot)&&(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:nt!==ConnectionState.DISCONNECTED_FOREVER}),this.sessionInfo.isSet&&this.sessionInfo.clearCurrent();this.setState({connectionState:nt})},this.handleGitInfoChanged=nt=>{this.setState({gitInfo:nt})},this.handleCustomParentMessage=nt=>{this.state.appConfig.enableCustomParentMessages?this.hostCommunicationMgr.sendMessageToHost({type:"CUSTOM_PARENT_MESSAGE",message:nt.message}):LOG.error("Sending messages to the host is disabled in line with the platform policy.")},this.handleMessage=nt=>{const ot=(at,st,ut)=>{const ct=at[st];if(ct in ut)return ut[ct](at[ct]);throw new Error(`Cannot handle ${st} "${ct}".`)};try{ot(nt,"type",{newSession:at=>this.handleNewSession(at),sessionStatusChanged:at=>this.handleSessionStatusChanged(at),sessionEvent:at=>this.handleSessionEvent(at),delta:at=>this.handleDeltaMsg(at,nt.metadata),pageConfigChanged:at=>this.handlePageConfigChanged(at),pageInfoChanged:at=>this.handlePageInfoChanged(at),pagesChanged:at=>this.handlePagesChanged(at),pageNotFound:at=>this.handlePageNotFound(at),gitInfoChanged:at=>this.handleGitInfoChanged(at),scriptFinished:at=>this.handleScriptFinished(at),pageProfile:at=>this.handlePageProfileMsg(at),autoRerun:at=>this.handleAutoRerun(at),fileUrlsResponse:at=>this.uploadClient.onFileURLsResponse(at),parentMessage:at=>this.handleCustomParentMessage(at),logo:at=>this.handleLogo(at,nt.metadata),navigation:at=>this.handleNavigation(at),authRedirect:at=>{isInChildFrame()?this.hostCommunicationMgr.sendMessageToSameOriginHost({type:"REDIRECT_TO_URL",url:at.url}):window.location.href=at.url}})}catch(at){const st=ensureError(at);LOG.error(st),this.showError("Bad message format",st.message)}},this.handleLogo=(nt,ot)=>{const at={activeScriptHash:ot.activeScriptHash,scriptRunId:this.state.scriptRunId};this.setState({elements:this.pendingElementsBuffer.appRootWithLogo(nt,at)},()=>{this.pendingElementsBuffer=this.state.elements})},this.handlePageConfigChanged=nt=>{const{title:ot,favicon:at,layout:st,initialSidebarState:ut,menuItems:ct}=nt;this.appNavigation.handlePageConfigChanged(nt),ot&&(this.hostCommunicationMgr.sendMessageToHost({type:"SET_PAGE_TITLE",title:ot}),document.title=ot),at&&this.onPageIconChanged(at),st!==this.state.layout&&this.setState(pt=>({layout:st,userSettings:{...pt.userSettings,wideMode:st===PageConfig.Layout.WIDE}})),ut!==this.state.initialSidebarState&&this.setState(()=>({initialSidebarState:ut})),this.setState({menuItems:ct})},this.handlePageInfoChanged=nt=>{const{queryString:ot}=nt,at=document.location.pathname+(ot?`?${ot}`:"");window.history.pushState({},"",at),this.hostCommunicationMgr.sendMessageToHost({type:"SET_QUERY_PARAM",queryParams:ot?`?${ot}`:""})},this.onPageNotFound=nt=>{const ot=nt?`You have requested page /${nt}, 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",`${ot}. Running the app's main page.`)},this.handlePageNotFound=nt=>{this.maybeSetState(this.appNavigation.handlePageNotFound(nt))},this.onPageIconChanged=nt=>{handleFavicon(nt,this.hostCommunicationMgr.sendMessageToHost,this.endpoints)},this.handlePagesChanged=nt=>{this.maybeSetState(this.appNavigation.handlePagesChanged(nt))},this.handleNavigation=nt=>{this.maybeSetState(this.appNavigation.handleNavigation(nt))},this.handlePageProfileMsg=nt=>{var st,ut,ct;const ot=PageProfile.toObject(nt),at=getBrowserInfo();this.metricsMgr.enqueue("pageProfile",{...ot,isFragmentRun:!!ot.isFragmentRun,appId:this.sessionInfo.current.appId,numPages:(st=this.state.appPages)==null?void 0:st.length,sessionId:this.sessionInfo.current.sessionId,pythonVersion:this.sessionInfo.current.pythonVersion,pageScriptHash:this.state.currentPageScriptHash,activeTheme:(ct=(ut=this.props.theme)==null?void 0:ut.activeTheme)==null?void 0:ct.name,totalLoadTime:Math.round((performance.now()-this.state.latestRunTime)*1e3),browserInfo:at})},this.handleAutoRerun=nt=>{const ot=setInterval(()=>{this.widgetMgr.sendUpdateWidgetsMessage(nt.fragmentId,!0)},nt.interval*1e3);this.setState(at=>({autoReruns:[...at.autoReruns,ot]}))},this.handleSessionStatusChanged=nt=>{this.setState(ot=>{let{scriptRunState:at}=ot,{dialog:st}=ot;return nt.scriptIsRunning&&ot.scriptRunState!==ScriptRunState.STOP_REQUESTED?(at=ScriptRunState.RUNNING,d$3(st)&&st.type===DialogType.SCRIPT_COMPILE_ERROR&&(st=void 0)):!nt.scriptIsRunning&&ot.scriptRunState!==ScriptRunState.RERUN_REQUESTED&&ot.scriptRunState!==ScriptRunState.COMPILATION_ERROR&&(at=ScriptRunState.NOT_RUNNING),{userSettings:{...ot.userSettings,runOnSave:!!nt.runOnSave},dialog:st,scriptRunState:at}})},this.handleSessionEvent=nt=>{if(this.sessionEventDispatcher.handleSessionEventMsg(nt),nt.type==="scriptCompilationException"){this.setState({scriptRunState:ScriptRunState.COMPILATION_ERROR});const ot={type:DialogType.SCRIPT_COMPILE_ERROR,exception:nt.scriptCompilationException,onClose:()=>{}};this.openDialog(ot)}},this.maybeUpdatePageUrl=(nt,ot,at)=>{const st=this.getBaseUriParts();if(st){const{pathname:ut}=st,ct=extractPageNameFromPathName(document.location.pathname,ut);if((ct===""?nt:ct)!==ot){const dt=at?"":ot,ft=preserveEmbedQueryParams(),bt=ft?`?${ft}`:"",mt=`${ut==="/"?"":ut}/${dt}${bt}`;window.history.pushState({},"",mt)}}},this.handleNewSession=nt=>{const ot=nt.initialize;if(this.hasStreamlitVersionChanged(ot)){window.location.reload();return}this.sessionInfo.isSet||this.handleOneTimeInitialization(nt);const{appHash:at,currentPageScriptHash:st}=this.state,{scriptRunId:ut,name:ct,mainScriptPath:pt,fragmentIdsThisRun:dt,pageScriptHash:ft,mainScriptHash:bt}=nt;if(dt.length)this.setState({fragmentIdsThisRun:dt,latestRunTime:performance.now()});else{this.cleanupAutoReruns();const mt=nt.config,Ot=nt.customTheme;this.processThemeInput(Ot),this.setState({allowRunOnSave:mt.allowRunOnSave,hideTopBar:mt.hideTopBar,toolbarMode:mt.toolbarMode,latestRunTime:performance.now(),mainScriptHash:bt,fragmentIdsThisRun:dt}),this.maybeSetState(this.appNavigation.handleNewSession(nt)),this.onPageIconChanged("./favicon.png")}const ht=hashString(this.sessionInfo.current.installationId+pt);this.metricsMgr.setMetadata(this.state.deployedAppMetadata),this.metricsMgr.setAppHash(ht),this.metricsMgr.enqueue("updateReport"),at===ht&&st===ft?this.setState({scriptRunId:ut}):this.clearAppState(ht,ut,ct,bt)},this.handleOneTimeInitialization=nt=>{const ot=nt.initialize,at=nt.config;this.sessionInfo.setCurrent(SessionInfo.propsFromNewSessionMessage(nt)),this.metricsMgr.initialize({gatherUsageStats:at.gatherUsageStats,sendMessageToHost:this.hostCommunicationMgr.sendMessageToHost}),this.handleSessionStatusChanged(ot.sessionStatus)},this.onHistoryChange=()=>{const{currentPageScriptHash:nt}=this.state,ot=this.appNavigation.findPageByUrlPath(document.location.pathname),at=document.location.toString().includes("#"),st=(ot==null?void 0:ot.pageScriptHash)===nt;m$4(ot)||at&&st||this.onPageChange(ot.pageScriptHash)},this.setAndSendTheme=nt=>{this.props.theme.setTheme(nt),this.setState({hideColoredLine:!isPresetTheme(nt)}),this.hostCommunicationMgr.sendMessageToHost({type:"SET_THEME_CONFIG",themeInfo:toExportedTheme(nt.emotion)})},this.createThemeHash=nt=>{if(!nt)return"hash_for_undefined_custom_theme";const ot=Object.entries(nt);return ot.sort(),hashString(ot.join(":"))},this.closeDialog=()=>{this.setState({dialog:void 0})},this.saveSettings=nt=>{const{runOnSave:ot}=this.state.userSettings,{runOnSave:at}=nt;if(this.setState({userSettings:nt}),ot!==at&&this.isServerConnected()){const st=new BackMsg$1({setRunOnSave:at});st.type="setRunOnSave",this.sendBackMsg(st)}},this.handleDeltaMsg=(nt,ot)=>{if(this.pendingElementsBuffer=this.pendingElementsBuffer.applyDelta(this.state.scriptRunId,nt,ot),!this.pendingElementsTimerRunning){this.pendingElementsTimerRunning=!0;const at=this.state.scriptRunState===ScriptRunState.RUNNING;setTimeout(()=>{this.pendingElementsTimerRunning=!1,at&&this.setState({elements:this.pendingElementsBuffer})},ELEMENT_LIST_BUFFER_TIMEOUT_MS)}},this.debugShutdownRuntime=()=>{if(this.isServerConnected()){const nt=new BackMsg$1({debugShutdownRuntime:!0});nt.type="debugShutdownRuntime",this.sendBackMsg(nt)}},this.debugDisconnectWebsocket=()=>{if(this.isServerConnected()){const nt=new BackMsg$1({debugDisconnectWebsocket:!0});nt.type="debugDisconnectWebsocket",this.sendBackMsg(nt)}},this.debugClearForwardMsgCache=()=>{var nt,ot;isLocalhost()&&((ot=(nt=this.connectionManager)==null?void 0:nt.websocketConnection)==null||ot.cache.messages.clear())},this.cleanupAutoReruns=()=>{this.state.autoReruns.forEach(nt=>{clearInterval(nt)}),this.setState({autoReruns:[]})},this.rerunScript=(nt=!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}),nt===!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=nt=>{const{elements:ot,mainScriptHash:at}=this.state;this.cleanupAutoReruns();const st=this.appNavigation.clearPageElements(ot,at,void 0),ut=new Set(Array.from(st.getElements()).map(ct=>getElementId(ct)).filter(notUndefined));this.sendRerunBackMsg(this.widgetMgr.getActiveWidgetStates(ut),void 0,nt)},this.isAppInReadyState=nt=>this.state.connectionState===ConnectionState.CONNECTED&&this.state.scriptRunState===ScriptRunState.NOT_RUNNING&&nt.scriptRunState===ScriptRunState.RUNNING&&nt.connectionState===ConnectionState.CONNECTED,this.sendRerunBackMsg=(nt,ot,at,st)=>{const ut=this.getBaseUriParts();if(!ut){LOG.error("Cannot send rerun backMessage when disconnected from server.");return}const{currentPageScriptHash:ct}=this.state,{pathname:pt}=ut;let dt=this.getQueryString(),ft="";at?at!=ct&&(dt=preserveEmbedQueryParams(),this.hostCommunicationMgr.sendMessageToHost({type:"SET_QUERY_PARAM",queryParams:dt})):ct?at=ct:(ft=extractPageNameFromPathName(document.location.pathname,pt),at=""),this.sendBackMsg(new BackMsg$1({rerunScript:{queryString:dt,widgetStates:nt,pageScriptHash:at,pageName:ft,fragmentId:ot,isAutoRerun:st}}))},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 nt=new BackMsg$1({stopScript:!0});nt.type="stopScript",this.sendBackMsg(nt),this.setState({scriptRunState:ScriptRunState.STOP_REQUESTED})},this.openClearCacheDialog=()=>{if(this.isServerConnected()){const nt={type:DialogType.CLEAR_CACHE,confirmCallback:this.clearCache,defaultAction:this.clearCache,onClose:()=>{}};this.openDialog(nt)}else LOG.error("Cannot clear cache: disconnected from server")},this.openDeployDialog=()=>{var ot;const nt={type:DialogType.DEPLOY_DIALOG,onClose:this.closeDialog,showDeployError:this.showDeployError,isDeployErrorModalOpen:((ot=this.state.dialog)==null?void 0:ot.type)===DialogType.DEPLOY_ERROR,metricsMgr:this.metricsMgr};this.openDialog(nt)},this.openThemeCreatorDialog=()=>{this.metricsMgr.enqueue("menuClick",{label:"editTheme"});const nt={type:DialogType.THEME_CREATOR,backToSettings:this.settingsCallback,onClose:this.closeDialog,metricsMgr:this.metricsMgr};this.openDialog(nt)},this.clearCache=()=>{if(this.closeDialog(),this.isServerConnected()){const nt=new BackMsg$1({clearCache:!0});nt.type="clearCache",this.sendBackMsg(nt)}else LOG.error("Cannot clear cache: disconnected from server")},this.sendAppHeartbeat=()=>{if(this.isServerConnected()){const nt=new BackMsg$1({appHeartbeat:!0});nt.type="appHeartbeat",this.sendBackMsg(nt)}else LOG.error("Cannot send app heartbeat: disconnected from server")},this.sendBackMsg=nt=>{this.connectionManager?(LOG.info(nt),this.connectionManager.sendMessage(nt)):LOG.error(`Not connected. Cannot send back message: ${nt}`)},this.handleConnectionError=nt=>{this.showError("Connection error",nt)},this.isServerConnected=()=>this.connectionManager?this.connectionManager.isConnected():!1,this.settingsCallback=(nt=!0)=>{const ot={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:nt,metricsMgr:this.metricsMgr};this.openDialog(ot)},this.aboutCallback=()=>{const{menuItems:nt}=this.state,ot={type:DialogType.ABOUT,sessionInfo:this.sessionInfo,onClose:this.closeDialog,aboutSectionMd:nt==null?void 0:nt.aboutSectionMd};this.openDialog(ot)},this.printCallback=()=>{const{scriptRunState:nt}=this.state;if(nt!==ScriptRunState.NOT_RUNNING){setTimeout(this.printCallback,500);return}let ot;try{const at=getIFrameEnclosingApp(this.embeddingId);at&&at.contentWindow?ot=at.contentWindow.window:ot=window}catch{ot=window}finally{ot||(ot=window),ot.print()}},this.screencastCallback=()=>{const{scriptName:nt}=this.state,{startRecording:ot}=this.props.screenCast,at=hooks().format("YYYY-MM-DD-HH-MM-SS");ot(`streamlit-${nt}-${at}`)},this.handleFullScreen=nt=>{this.setState({isFullScreen:nt})},this.setLibConfig=nt=>{this.setState({libConfig:nt})},this.setAppConfig=nt=>{this.setState({appConfig:nt})},this.addScriptFinishedHandler=nt=>{this.setState((ot,at)=>({scriptFinishedHandlers:ot.scriptFinishedHandlers.concat(nt)}))},this.removeScriptFinishedHandler=nt=>{this.setState((ot,at)=>({scriptFinishedHandlers:without$1(ot.scriptFinishedHandlers,nt)}))},this.getBaseUriParts=()=>this.connectionManager?this.connectionManager.getBaseUriParts():void 0,this.getQueryString=()=>{const{queryParams:nt}=this.state,ot=nt&&nt.length>0?nt:document.location.search;return ot.startsWith("?")?ot.substring(1):ot},this.isInCloudEnvironment=()=>{const{hostMenuItems:nt}=this.state;return nt&&(nt==null?void 0:nt.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=(nt,ot)=>{if(this.isServerConnected()){const at=new BackMsg$1({fileUrlsRequest:{requestId:nt,fileNames:ot.map(st=>st.name),sessionId:this.sessionInfo.current.sessionId}});at.type="fileUrlsRequest",this.sendBackMsg(at)}},this.handleKeyDown=nt=>{switch(nt){case"c":showDevelopmentOptions(this.state.isOwner,this.state.toolbarMode)&&this.openClearCacheDialog();break;case"r":this.rerunScript();break}},this.handleKeyUp=nt=>{nt==="esc"&&this.props.screenCast.stopRecording()},J$1();let et=this.createThemeHash();isPresetTheme(tt.theme.activeTheme)||(et=this.createThemeHash(toThemeInput(tt.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:et,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:nt=>this.setState({formsData:nt})}),this.hostCommunicationMgr=new HostCommunicationManager({streamlitExecutionStartedAt:tt.streamlitExecutionStartedAt,sendRerunBackMsg:this.sendRerunBackMsg,closeModal:this.closeDialog,stopScript:this.stopScript,rerunScript:this.rerunScript,clearCache:this.clearCache,sendAppHeartbeat:this.sendAppHeartbeat,setInputsDisabled:nt=>{this.setState({inputsDisabled:nt})},themeChanged:this.handleThemeMessage,pageChanged:this.onPageChange,isOwnerChanged:nt=>this.setState({isOwner:nt}),fileUploadClientConfigChanged:nt=>{this.endpoints.setFileUploadClientConfig!==void 0&&this.endpoints.setFileUploadClientConfig(nt)},hostMenuItemsChanged:nt=>{this.setState({hostMenuItems:nt})},hostToolbarItemsChanged:nt=>{this.setState({hostToolbarItems:nt})},hostHideSidebarNavChanged:nt=>{this.setState({hostHideSidebarNav:nt})},sidebarChevronDownshiftChanged:nt=>{this.setState({sidebarChevronDownshift:nt})},pageLinkBaseUrlChanged:nt=>{this.setState({pageLinkBaseUrl:nt})},queryParamsChanged:nt=>{this.setState({queryParams:nt})},deployedAppMetadataChanged:nt=>{this.setState({deployedAppMetadata:nt})},restartWebsocketConnection:()=>{this.connectionManager||this.initializeConnectionManager()},terminateWebsocketConnection:()=>{var nt;(nt=this.connectionManager)==null||nt.disconnect(),this.connectionManager=null}}),this.endpoints=new DefaultStreamlitEndpoints({getServerUri:this.getBaseUriParts,csrfEnabled:!0}),this.uploadClient=new FileUploadClient({sessionInfo:this.sessionInfo,endpoints:this.endpoints,formsWithPendingRequestsChanged:nt=>this.widgetMgr.setFormsWithUploadsInProgress(nt),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 tt;return(tt=this.sessionInfo.last)==null?void 0:tt.sessionId},endpoints:this.endpoints,onMessage:this.handleMessage,onConnectionError:this.handleConnectionError,connectionStateChanged:this.handleConnectionStateChanged,claimHostAuthToken:this.hostCommunicationMgr.claimAuthToken,resetHostAuthToken:this.hostCommunicationMgr.resetAuthToken,onHostConfigResp:tt=>{const{allowedOrigins:et,useExternalAuthToken:nt,disableFullscreenMode:ot,enableCustomParentMessages:at,mapboxToken:st,enforceDownloadInNewTab:ut,metricsUrl:ct}=tt,pt={allowedOrigins:et,useExternalAuthToken:nt,enableCustomParentMessages:at},dt={mapboxToken:st,disableFullscreenMode:ot,enforceDownloadInNewTab:ut};this.metricsMgr.setMetricsConfig(ct),this.hostCommunicationMgr.setAllowedOrigins(pt),this.setAppConfig(pt),this.setLibConfig(dt)}})}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 tt=document.querySelectorAll("[data-iframe-height]"),et=Array.from(tt).map(nt=>Math.ceil(nt.getBoundingClientRect().bottom));return Math.max(0,...et)}},__vitePreload(()=>import("./iframeResizer.contentWindow.EQIQrAd4.js").then(tt=>tt.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(tt,et){window.prerenderReady===!1&&this.isAppInReadyState(et)&&(window.prerenderReady=!0),this.state.scriptRunState!==et.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 tt;(tt=this.connectionManager)==null||tt.disconnect(),this.hostCommunicationMgr.closeHostCommunication(),window.removeEventListener("popstate",this.onHistoryChange,!1)}showError(tt,et){LOG.error(et);const nt={type:DialogType.WARNING,title:tt,msg:jsx$1(StreamlitMarkdown$1,{source:et,allowHTML:!1}),onClose:()=>{}};this.openDialog(nt)}hasStreamlitVersionChanged(tt){var nt;let et;if(((nt=window.__streamlit)==null?void 0:nt.ENABLE_RELOAD_BASED_ON_HARDCODED_STREAMLIT_VERSION)===!0?et=define_PACKAGE_METADATA_default.version:this.sessionInfo.isSet&&(et=this.sessionInfo.current.streamlitVersion),et){const{environmentInfo:ot}=tt;if(d$3(ot)&&d$3(ot.streamlitVersion))return et!=ot.streamlitVersion}return!1}maybeSetState(tt){if(tt){const[et,nt]=tt;this.setState(et,nt)}}processThemeInput(tt){const et=this.createThemeHash(tt);if(et===this.state.themeHash)return;this.setState({themeHash:et});const nt=!isPresetTheme(this.props.theme.activeTheme);if(tt){const ot=createTheme(CUSTOM_THEME_NAME,tt);this.props.theme.addThemes([ot]),(getCachedTheme()===null||nt)&&this.setAndSendTheme(ot)}else this.props.theme.addThemes([]),nt&&this.setAndSendTheme(getHostSpecifiedTheme());tt!=null&&tt.fontFaces&&this.props.theme.setImportedTheme(tt)}handleScriptFinished(tt){if(tt===ForwardMsg$1.ScriptFinishedStatus.FINISHED_SUCCESSFULLY||tt===ForwardMsg$1.ScriptFinishedStatus.FINISHED_EARLY_FOR_RERUN||tt===ForwardMsg$1.ScriptFinishedStatus.FINISHED_FRAGMENT_RUN_SUCCESSFULLY){if(window.setTimeout(()=>{this.state.scriptFinishedHandlers.map(et=>et())},0),tt===ForwardMsg$1.ScriptFinishedStatus.FINISHED_SUCCESSFULLY||tt===ForwardMsg$1.ScriptFinishedStatus.FINISHED_FRAGMENT_RUN_SUCCESSFULLY){this.setState(({scriptRunId:nt,fragmentIdsThisRun:ot})=>({elements:this.pendingElementsBuffer.clearStaleNodes(nt,ot)}),()=>{this.pendingElementsBuffer=this.state.elements});const et=new Set(Array.from(this.state.elements.getElements()).map(nt=>getElementId(nt)).filter(notUndefined));this.widgetMgr.removeInactive(et)}this.connectionManager!==null&&tt!==ForwardMsg$1.ScriptFinishedStatus.FINISHED_EARLY_FOR_RERUN&&this.sessionInfo.isSet&&this.connectionManager.incrementMessageCacheRunCount(this.sessionInfo.current.maxCachedMessageAge)}}clearAppState(tt,et,nt,ot){const{hideSidebarNav:at,elements:st}=this.state,ut=at&&st.sidebar||void 0;this.setState({scriptRunId:et,scriptName:nt,appHash:tt,elements:this.appNavigation.clearPageElements(this.pendingElementsBuffer,ot,ut)},()=>{this.pendingElementsBuffer=this.state.elements;const ct=new Set(Array.from(this.state.elements.getElements()).map(pt=>getElementId(pt)).filter(notUndefined));this.widgetMgr.removeInactive(ct)})}openDialog(tt){this.setState({dialog:tt})}render(){const{allowRunOnSave:tt,connectionState:et,dialog:nt,elements:ot,initialSidebarState:at,menuItems:st,isFullScreen:ut,scriptRunId:ct,scriptRunState:pt,userSettings:dt,hideTopBar:ft,hideSidebarNav:bt,hideColoredLine:ht,expandSidebarNav:mt,currentPageScriptHash:Ot,hostHideSidebarNav:yt,pageLinkBaseUrl:Mt,sidebarChevronDownshift:At,hostMenuItems:St,hostToolbarItems:Et,libConfig:zt,appConfig:vt,inputsDisabled:Tt,appPages:$t,navSections:Rt}=this.state,wt=showDevelopmentOptions(this.state.isOwner,this.state.toolbarMode),It=classNames("stApp",getEmbeddingIdClassName(this.embeddingId),{"streamlit-embedded":isEmbed(),"streamlit-wide":dt.wideMode}),kt=nt?StreamlitDialog({...nt,onClose:this.closeDialog}):null,Ft=Tt||et!==ConnectionState.CONNECTED;return jsx$1(AppContext.Provider,{value:{initialSidebarState:at,wideMode:dt.wideMode,embedded:isEmbed(),showPadding:!isEmbed()||isPaddingDisplayed(),disableScrolling:isScrollingHidden(),showToolbar:!isEmbed()||isToolbarDisplayed(),showColoredLine:!ht&&!isEmbed()||isColoredLineDisplayed(),pageLinkBaseUrl:Mt,sidebarChevronDownshift:At,gitInfo:this.state.gitInfo,appConfig:vt},children:jsx$1(LibContext.Provider,{value:{isFullScreen:ut,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:Ot,libConfig:zt,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:It,"data-testid":"stApp","data-test-script-state":ct==INITIAL_SCRIPT_RUN_ID?"initial":pt,"data-test-connection-state":et,children:[jsxs(Header,{children:[!ft&&jsxs(Fragment,{children:[jsx$1(StatusWidget,{connectionState:et,sessionEventDispatcher:this.sessionEventDispatcher,scriptRunState:pt,rerunScript:this.rerunScript,stopScript:this.stopScript,allowRunOnSave:tt}),jsx$1(ToolbarActions,{hostToolbarItems:Et,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:St,developmentMode:wt,sendMessageToHost:this.hostCommunicationMgr.sendMessageToHost,menuItems:st,metricsMgr:this.metricsMgr,toolbarMode:this.state.toolbarMode})]}),jsx$1(AppView,{endpoints:this.endpoints,sendMessageToHost:this.hostCommunicationMgr.sendMessageToHost,elements:ot,scriptRunId:ct,scriptRunState:pt,widgetMgr:this.widgetMgr,widgetsDisabled:Ft,uploadClient:this.uploadClient,componentRegistry:this.componentRegistry,formsData:this.state.formsData,appLogo:ot.logo,appPages:$t,navSections:Rt,onPageChange:this.onPageChange,currentPageScriptHash:Ot,hideSidebarNav:bt||yt,expandSidebarNav:mt}),kt]})})})})}}const AppWithScreenCast=withScreencast(App);function useThemeManager(){const rt=getDefaultTheme(),[tt,et]=reactExports.useState(rt),[nt,ot]=reactExports.useState([]),[at,st]=reactExports.useState([...createPresetThemes(),...isPresetTheme(rt)?[]:[rt]]),ut=ft=>{st([...createPresetThemes(),...ft])},ct=reactExports.useCallback(ft=>{ft!==tt&&(et(ft),ft.name===AUTO_THEME_NAME?removeCachedTheme():setCachedTheme(ft))},[et,tt]),pt=reactExports.useCallback(()=>{tt.name===AUTO_THEME_NAME&&ct(getHostSpecifiedTheme());const ft=at.filter(bt=>bt.name!==AUTO_THEME_NAME);st([createAutoTheme(),...ft])},[tt.name,at,ct]),dt=reactExports.useCallback(ft=>{ft.fontFaces&&ot(ft.fontFaces);const bt=new CustomThemeConfig(ft),ht=createTheme(CUSTOM_THEME_NAME,bt);ct(ht)},[ot,ct]);return reactExports.useEffect(()=>{const ft=window.matchMedia("(prefers-color-scheme: dark)");return ft.addEventListener("change",pt),window.addEventListener("afterprint",pt),()=>{window.removeEventListener("afterprint",pt),ft.removeEventListener("change",pt)}},[tt,at,pt]),[{setTheme:ct,activeTheme:tt,addThemes:ut,availableThemes:at,setImportedTheme:dt},nt]}const ThemedApp=({streamlitExecutionStartedAt:rt})=>{const[tt,et]=useThemeManager(),{activeTheme:nt}=tt,ot=nt.name===CUSTOM_THEME_NAME&&et.length>0;return jsx$1(RootStyleProvider,{theme:nt,children:jsx$1(WindowDimensionsProvider,{children:jsxs(PortalProvider,{children:[ot&&jsx$1(FontFaceDeclaration,{fontFaces:et}),jsx$1(AppWithScreenCast,{theme:tt,streamlitExecutionStartedAt:rt})]})})})},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{_getTag as $,PLACEMENT as A,ACCESSIBILITY_TYPE as B,convertRemToPx as C,DynamicIcon as D,EmotionIconBase as E,Fragment as F,hasLightBackgroundColor as G,Popover$2 as H,require$$0 as I,toString$7 as J,m$4 as K,merge$4 as L,numbro$1 as M,d$3 as N,hooks as O,PortalContext as P,getTimezone as Q,React$1 as R,moment$1 as S,isIntegerType as T,isUnsignedIntegerType as U,isDurationType as V,isPeriodType as W,format as X,isBooleanType as Y,_baseKeys as Z,_extends$Q as _,range$1 as a,lib$3 as a$,isArguments_1 as a0,isArray_1 as a1,isArrayLike_1 as a2,isBufferExports as a3,_isPrototype as a4,isTypedArray_1 as a5,DataFrameCellType as a6,Field$1 as a7,Null as a8,isTimeType as a9,mix$1 as aA,getStyledCell as aB,isEqual$1 as aC,StyledTooltipContentWrapper as aD,StreamlitMarkdown$1 as aE,LibContext as aF,Resizable as aG,getGray70 as aH,getGray30 as aI,getCategoricalColorsArray as aJ,getDivergingColorsArray as aK,getSequentialColorsArray as aL,getBlue80 as aM,debounce$4 as aN,Global as aO,_baseMerge as aP,_createAssigner as aQ,toaster as aR,Kind as aS,AlertElement$1 as aT,_assertThisInitialized as aU,StyledInlineCode as aV,ErrorElement as aW,Skeleton$1 as aX,Skeleton as aY,hoistNonReactStatics$1 as aZ,ensureError as a_,convertTimeToDate as aa,isDecimalType as ab,isStringType as ac,isEmptyType as ad,isDatetimeType as ae,isDateType as af,isObjectType as ag,isBytesType as ah,isNumericType as ai,isCategoricalType as aj,isListType as ak,isRangeIndexType as al,loglevelExports$1 as am,Arrow$2 as an,isArray$k as ao,_defineProperty$p as ap,_objectWithoutPropertiesLoose$j as aq,_typeof$c as ar,jsx as as,css as at,requireClassCallCheck as au,requireCreateClass as av,requireInherits as aw,requireToConsumableArray as ax,require_typeof as ay,transparentize as az,reactDomExports as b,without$1 as b$,parseToRgba as b0,assertNever as b1,DeckGlJsonChart$1 as b2,DEFAULT_IFRAME_FEATURE_POLICY as b3,DEFAULT_IFRAME_SANDBOX_POLICY as b4,darken as b5,BaseButtonSize as b6,BaseButtonKind as b7,BaseButtonTooltip as b8,DynamicButtonLabel as b9,StyledWidgetLabelHelpInline as bA,themeColors as bB,isMobile_1 as bC,CAMERA_PERMISSION_URL as bD,StyledWidgetLabelHelp as bE,StyledSpinnerIcon as bF,AcceptFileValue as bG,chatInputAcceptFileProtoValueToEnum as bH,isFocusVisible as bI,getOverride as bJ,getOverrideProps as bK,Checkbox$1 as bL,StyledContent as bM,StyledCheckbox$1 as bN,BaseColorPicker$1 as bO,useStyletron as bP,mergeOverride as bQ,toObjectOverride as bR,Icon$1 as bS,UIDConsumer as bT,StatefulMenu as bU,mergeOverrides as bV,ChevronDown$1 as bW,ThemeContext as bX,forkFocus as bY,forkBlur as bZ,Select as b_,IsSidebarContext as ba,Placement as bb,getGray90 as bc,getIncreasingGreen as bd,getDecreasingRed as be,PlotlyChart$1 as bf,keysToSnakeCase as bg,WindowDimensionsContext as bh,Video$1 as bi,zip$1 as bj,FileUploaderState as bk,UploadedFileInfo as bl,StyledSpinner as bm,ENABLE_PERIPHERALS_DOCS_URL as bn,Icon$2 as bo,BaseButton as bp,blend as bq,labelVisibilityProtoValueToEnum as br,TooltipIcon as bs,WidgetLabel as bt,Tooltip as bu,styled as bv,getOverrides as bw,LocaleContext as bx,ButtonGroup$1 as by,LabelVisibilityMessage as bz,_hasPath as c,fuzzyFilterSelectOptions as c0,TYPE as c1,VirtualDropdown as c2,classNames as c3,UISelectbox as c4,isValidFormId as c5,toPropertyKey as c6,_setPrototypeOf$a as c7,hexToRgb as c8,withWrapper as c9,NumberInput$1 as cA,__awaiter as ca,PropTypes as cb,isFromWindows as cc,StyledWidgetInstructions as cd,isFromMac as ce,CUSTOM_INPUT_TYPE as cf,SIZE$1 as cg,DeleteAlt$1 as ch,ADJOINED as ci,filterOptions as cj,ENHANCER_POSITION as ck,pick$1 as cl,Slider$2 as cm,ChevronLeft as cn,ChevronRight as co,isInForm as cp,toString_1 as cq,TextInput$1 as cr,ThemeProvider$1 as cs,createThemedStyled as ct,createThemedUseStyletron as cu,createThemedWithStyle as cv,expandBorderStyles as cw,withStyle as cx,getAugmentedNamespace as cy,reactIsExports$1 as cz,commonjsGlobal$2 as d,classnamesExports as e,_root as f,getDefaultExportFromCjs$1 as g,isObject_1 as h,isPropValid as i,jsx$1 as j,keyframes as k,_Set as l,_setToArray as m,newStyled as n,_SetCache as o,propTypesExports as p,_arrayIncludes as q,reactExports as r,_arrayIncludesWith as s,toNumber_1 as t,_cacheHas as u,groupBy$1 as v,__vitePreload as w,flatten$2 as x,useTheme as y,jsxs as z};
|
811
|
+
`);return jsx$1("div",{"data-testid":"stClearCacheDialog",children:jsxs(Modal,{isOpen:!0,onClose:rt.onClose,children:[jsx$1(ModalHeader,{children:"Clear caches"}),jsx$1(ModalBody$1,{children:jsx$1(StreamlitMarkdown$1,{source:et,allowHTML:!1})}),jsxs(ModalFooter,{children:[jsx$1(ModalButton,{kind:BaseButtonKind.GHOST,onClick:rt.onClose,children:"Cancel"}),jsx$1(ModalButton,{autoFocus:!0,kind:BaseButtonKind.SECONDARY,onClick:rt.confirmCallback,children:"Clear caches"})]})]})})}function scriptCompileErrorDialog(rt){var tt;return jsxs(Modal,{isOpen:!0,onClose:rt.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:(tt=rt.exception)!=null&&tt.message?rt.exception.message:"No message"})}),jsx$1(ModalFooter,{children:jsx$1(ModalButton,{kind:BaseButtonKind.SECONDARY,onClick:rt.onClose,children:"Close"})})]})}function settingsDialog(rt){return jsx$1(SettingsDialog,{...rt})}function warningDialog(rt){return jsxs(Modal,{isOpen:!0,onClose:rt.onClose,children:[jsx$1(ModalHeader,{children:rt.title}),jsx$1(ModalBody$1,{children:rt.msg})]})}function deployErrorDialog({title:rt,msg:tt,onClose:et,onContinue:nt,onTryAgain:ot}){const at=()=>{et(),nt&&nt()};return jsxs(Modal,{isOpen:!0,onClose:et,children:[jsx$1(ModalHeader,{children:rt}),jsx$1(ModalBody$1,{children:jsx$1(StyledDeployErrorContent,{children:tt})}),jsxs(ModalFooter,{children:[jsx$1(ModalButton,{kind:BaseButtonKind.GHOST,onClick:ot,children:"Try again"}),jsx$1(ModalButton,{kind:BaseButtonKind.SECONDARY,onClick:at,children:nt?"Continue anyway":"Close"})]})]})}function noDialog({onClose:rt}){return jsx$1(Modal,{isOpen:!1,onClose:rt})}function typeNotRecognizedDialog(rt){return jsx$1(Modal,{isOpen:!0,onClose:rt.onClose,children:jsx$1(ModalBody$1,{children:`Dialog type "${rt.type}" not recognized.`})})}class SessionEventDispatcher{constructor(){this.onSessionEvent=new dist.Signal}handleSessionEventMsg(tt){this.onSessionEvent.emit(tt)}}var assignValue=_assignValue,castPath$1=_castPath,isIndex=_isIndex,isObject=isObject_1,toKey=_toKey;function baseSet$1(rt,tt,et,nt){if(!isObject(rt))return rt;tt=castPath$1(tt,rt);for(var ot=-1,at=tt.length,st=at-1,ut=rt;ut!=null&&++ot<at;){var ct=toKey(tt[ot]),pt=et;if(ct==="__proto__"||ct==="constructor"||ct==="prototype")return rt;if(ot!=st){var dt=ut[ct];pt=nt?nt(dt,ct,ut):void 0,pt===void 0&&(pt=isObject(dt)?dt:isIndex(tt[ot+1])?[]:{})}assignValue(ut,ct,pt),ut=ut[ct]}return rt}var _baseSet=baseSet$1,baseGet=_baseGet,baseSet=_baseSet,castPath=_castPath;function basePickBy$1(rt,tt,et){for(var nt=-1,ot=tt.length,at={};++nt<ot;){var st=tt[nt],ut=baseGet(rt,st);et(ut,st)&&baseSet(at,castPath(st,rt),ut)}return at}var _basePickBy=basePickBy$1,basePickBy=_basePickBy,hasIn=hasIn_1;function basePick$1(rt,tt){return basePickBy(rt,tt,function(et,nt){return hasIn(rt,nt)})}var _basePick=basePick$1,basePick=_basePick,flatRest=_flatRest,pick=flatRest(function(rt,tt){return rt==null?{}:basePick(rt,tt)}),pick_1=pick;const pick$1=getDefaultExportFromCjs$1(pick_1),DEFAULT_METRICS_CONFIG="https://data.streamlit.io/metrics.json",log$1=loglevelExports$1.getLogger("MetricsManager");class MetricsManager{constructor(tt){this.initialized=!1,this.actuallySendMetrics=!1,this.metricsUrl=void 0,this.sendMessageToHost=()=>{},this.anonymousId="",this.pendingEvents=[],this.appHash="Not initialized",this.metadata={},this.setAppHash=et=>{this.appHash=et},this.setMetricsConfig=(et="")=>{this.metricsUrl=et},this.sessionInfo=tt}async initialize({gatherUsageStats:tt,sendMessageToHost:et}){this.sendMessageToHost=et,this.actuallySendMetrics=tt&&this.metricsUrl!=="off",this.getAnonymousId(),this.actuallySendMetrics&&!this.metricsUrl&&(await this.requestDefaultMetricsConfig(),this.metricsUrl||(log$1.error("Undefined metrics config - deactivating metrics tracking."),this.actuallySendMetrics=!1)),this.actuallySendMetrics&&this.sendPendingEvents(),log$1.info("Gather usage stats: ",this.actuallySendMetrics),this.initialized=!0}enqueue(tt,et={}){if(!this.initialized||!this.sessionInfo.isSet){this.pendingEvents.push([tt,et]);return}this.actuallySendMetrics&&(this.pendingEvents.length&&this.sendPendingEvents(),this.send(tt,et))}setMetadata(tt){this.metadata=tt}async requestDefaultMetricsConfig(){const tt=p$4();if(tt){const et=window.localStorage.getItem("stMetricsConfig");if(et){this.metricsUrl=et;return}}try{const et=await fetch(DEFAULT_METRICS_CONFIG,{signal:AbortSignal.timeout(5e3)});if(!et.ok)this.metricsUrl=void 0,log$1.error("Failed to fetch metrics config: ",et.status);else{const nt=await et.json();this.metricsUrl=nt.url??void 0,tt&&this.metricsUrl&&window.localStorage.setItem("stMetricsConfig",this.metricsUrl)}}catch(et){log$1.error("Failed to fetch metrics config:",et)}}send(tt,et={}){const nt=this.buildEventProto(tt,et);this.metricsUrl==="postMessage"?this.postMessageEvent(tt,nt):this.track(nt)}sendPendingEvents(){this.pendingEvents.forEach(([tt,et])=>{this.send(tt,et)}),this.pendingEvents=[]}async track(tt){const et=new Request(this.metricsUrl,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(tt.toJSON())});await fetch(et)}postMessageEvent(tt,et){this.sendMessageToHost({type:"METRICS_EVENT",eventName:tt,data:et})}buildEventProto(tt,et){const nt=new MetricsEvent({event:tt,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(tt==="menuClick")nt.label=et.label;else if(tt==="pageProfile")return new MetricsEvent({...nt,...et});return nt}getInstallationData(){return{machineIdV3:this.sessionInfo.current.installationIdV3}}getHostTrackingData(){return this.metadata?pick$1(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 tt="ajs_anonymous_id",et=p$4(),nt=f$3(tt),ot=et?window.localStorage.getItem(tt):null,at=new Date;if(at.setFullYear(new Date().getFullYear()+1),nt)this.anonymousId=nt,et&&window.localStorage.setItem(tt,nt);else if(ot){try{this.anonymousId=JSON.parse(ot)}catch{this.anonymousId=ot}setCookie(tt,this.anonymousId,at)}else this.anonymousId=v4(),setCookie(tt,this.anonymousId,at),et&&window.localStorage.setItem(tt,this.anonymousId)}}const StyledApp=newStyled("div",{target:"ee4bbma0"})(({theme:rt})=>{const tt=hasLightBackgroundColor(rt);return{position:"absolute",background:rt.colors.bgColor,color:rt.colors.bodyText,top:rt.spacing.none,left:rt.spacing.none,right:rt.spacing.none,bottom:rt.spacing.none,colorScheme:tt?"light":"dark",overflow:"hidden","@media print":{float:"none",height:rt.sizes.full,position:"static",overflow:"visible"}}}),StyledRecordAudioLabel=newStyled("label",{target:"ej964cx0"})({margin:0}),StyledInstruction=newStyled("p",{target:"ej964cx1"})({margin:0}),ScreencastDialog=({onClose:rt,toggleRecordAudio:tt,recordAudio:et,startRecording:nt})=>{const[ot,at]=reactExports.useState(et),st=reactExports.useCallback(ct=>{const{checked:pt}=ct.target;pt!==ot&&(at(pt),tt())},[ot,tt]),ut=reactExports.useCallback(()=>{nt(),rt()},[nt,rt]);return jsxs(Modal,{isOpen:!0,onClose:rt,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:ot,onChange:st})," ","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:ut,children:"Start recording!"})})]})},StyledVideo=newStyled("video",{target:"emkt0dj0"})(({theme:rt})=>({width:rt.sizes.full,borderRadius:rt.radii.md})),StyledDialogContainer=newStyled("div",{target:"emkt0dj1"})(({theme:rt})=>({display:"flex",flexDirection:"column",width:rt.sizes.full})),StyledRow=newStyled("div",{target:"emkt0dj2"})(({theme:rt})=>({display:"flex",flexDirection:"row",paddingTop:rt.spacing.md,paddingBottom:rt.spacing.md})),StyledFirstColumn=newStyled("div",{target:"emkt0dj3"})(({theme:rt})=>({paddingRight:rt.spacing.lg,textAlign:"right",color:rt.colors.gray,fontWeight:rt.fontWeights.bold,width:"6em"})),StyledSecondColumn=newStyled("div",{target:"emkt0dj4"})(({theme:rt})=>({flex:1,paddingRight:rt.spacing.lg,marginRight:"6em",[`@media (max-width: ${rt.breakpoints.sm})`]:{marginRight:rt.spacing.none}})),StyledVideoFormatInstructions=newStyled("p",{target:"emkt0dj5"})(({theme:rt})=>({marginTop:rt.spacing.sm,marginBottom:rt.spacing.none,fontSize:rt.fontSizes.sm})),StyledDownloadButtonContainer=newStyled("div",{target:"emkt0dj6"})(({theme:rt})=>({marginTop:rt.spacing.twoXS})),VideoRecordedDialog=({onClose:rt,videoBlob:tt,fileName:et})=>{const nt=URL.createObjectURL(tt),ot=()=>{const at=document.createElement("a");at.setAttribute("href",nt),at.setAttribute("download",`${et}.webm`),at.click(),rt()};return jsxs(Modal,{isOpen:!0,onClose:rt,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:nt,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:ot,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:rt})=>({display:"flex",alignItems:"center",justifyItems:"center",marginRight:rt.spacing.twoXL,marginLeft:rt.spacing.sm,fontSize:rt.fontSizes.fourXL})),StyledUnsupportedScreenCastExplanation=newStyled("p",{target:"e1o5y2012"})(({theme:rt})=>({margin:rt.spacing.none})),UnsupportedBrowserDialog=({onClose:rt})=>jsxs(Modal,{isOpen:!0,onClose:rt,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:rt})=>({position:"fixed",display:"flex",justifyContent:"center",alignItems:"center",top:0,left:0,width:rt.sizes.full,height:rt.sizes.full,fontSize:"40vh",color:rt.colors.red,fontWeight:rt.fontWeights.bold,opacity:"0.8",textShadow:`1px 1px 10px ${rt.colors.darkGray}`,transition:"opacity 0.3s ease-in-out",animation:`${screencastCounterAnimation} 1s`})),Countdown=({countdown:rt,endCallback:tt})=>{const[et,nt]=reactExports.useState(rt);return jsx$1(StyledCountdown,{"data-testid":"stCountdown",onAnimationEnd:()=>{const at=et-1;at>=0&&nt(at),at===0&&tt()},children:jsx$1("span",{children:et})},`frame${et}`)},log=loglevelExports$1.getLogger("withScreencast");function withScreencast(rt){const tt=et=>{const{testOverride:nt}=et,ot=reactExports.useRef(null),[at,st]=reactExports.useState("streamlit-screencast"),[ut,ct]=reactExports.useState(!1),[pt,dt]=reactExports.useState(void 0),[ft,bt]=reactExports.useState(nt||"OFF"),ht=reactExports.useCallback(()=>{ct(Et=>!Et)},[]),mt=reactExports.useCallback(async()=>{if(!(ft==="OFF"||m$4(ot.current))){if(ft==="COUNTDOWN"){bt("OFF");return}if(ft==="RECORDING"){const Et=ot.current;if(!Et||Et.getState()==="inactive")bt("OFF");else{const zt=await Et.stop();dt(zt),bt("PREVIEW_FILE")}}}},[ft]),Ot=reactExports.useCallback(async()=>{if(!ScreenCastRecorder.isSupportedBrowser()){bt("UNSUPPORTED");return}ot.current=new ScreenCastRecorder({recordAudio:ut,onErrorOrStop:()=>{mt().catch(Et=>log.warn(`withScreencast.stopRecording threw an error: ${Et}`))}});try{await ot.current.initialize()}catch(Et){log.warn(`ScreenCastRecorder.initialize error: ${Et}`),bt("UNSUPPORTED");return}bt("COUNTDOWN")},[ut,mt]),yt=reactExports.useCallback(Et=>{if(!ScreenCastRecorder.isSupportedBrowser()){bt("UNSUPPORTED");return}if(ft==="OFF"){st(Et),bt("SETUP");return}mt().catch(zt=>log.warn(`withScreencast.stopRecording threw an error: ${zt}`))},[ft,mt]),Mt=reactExports.useCallback(async()=>{if(m$4(ot.current))throw new Error("Countdown finished but recorder is null");ot.current.start()?bt("RECORDING"):mt().catch(zt=>log.warn(`withScreencast.stopRecording threw an error: ${zt}`))},[mt]),At=reactExports.useCallback(()=>{bt("OFF")},[]);return jsxs("div",{className:"withScreencast","data-testid":"stScreencast",children:[jsx$1(rt,{...et,screenCast:{currentState:ft,toggleRecordAudio:ht,startRecording:yt,stopRecording:mt}}),ft==="UNSUPPORTED"&&jsx$1(UnsupportedBrowserDialog$1,{onClose:At}),ft==="SETUP"&&jsx$1(ScreencastDialog,{recordAudio:ut,onClose:At,startRecording:Ot,toggleRecordAudio:ht}),ft==="COUNTDOWN"&&jsx$1(Countdown,{countdown:3,endCallback:Mt}),ft==="PREVIEW_FILE"&&pt&&jsx$1(VideoRecordedDialog,{onClose:At,videoBlob:pt,fileName:at})]})};return tt.displayName=`withScreencast(${rt.displayName||rt.name||"Component"})`,hoistNonReactStatics$1(tt,rt)}const showDevelopmentOptions=(rt,tt)=>tt==Config.ToolbarMode.DEVELOPER?!0:Config.ToolbarMode.VIEWER==tt||Config.ToolbarMode.MINIMAL==tt?!1:rt||isLocalhost();function getTitle(rt){return rt||"Streamlit"}class StrategyV1{constructor(tt){this.appNav=tt,this.appPages=[],this.currentPageScriptHash=null,this.hideSidebarNav=null}handleNewSession(tt){var st,ut;this.appPages=tt.appPages,this.currentPageScriptHash=tt.pageScriptHash,this.hideSidebarNav=((st=tt.config)==null?void 0:st.hideSidebarNav)??!1;const et=this.appPages[0],nt=et.urlPathname??"",ot=((ut=this.appPages.find(ct=>ct.pageScriptHash===this.currentPageScriptHash))==null?void 0:ut.urlPathname)??"",at=et.pageScriptHash===this.currentPageScriptHash;return this.appNav.onUpdatePageUrl(nt,ot,at),document.title=getTitle(ot??""),[{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:at?"":ot,currentPageScriptHash:this.currentPageScriptHash})}]}handlePagesChanged(tt){const{appPages:et}=tt;return[{appPages:et},()=>{this.appNav.hostCommunicationMgr.sendMessageToHost({type:"SET_APP_PAGES",appPages:et})}]}handlePageNotFound(tt){var ot;const{pageName:et}=tt;this.appNav.onPageNotFound(et);const nt=((ot=this.appPages[0])==null?void 0:ot.pageScriptHash)??"";return this.currentPageScriptHash=nt,[{currentPageScriptHash:nt},()=>{this.appNav.hostCommunicationMgr.sendMessageToHost({type:"SET_CURRENT_PAGE_NAME",currentPageName:"",currentPageScriptHash:nt})}]}handleNavigation(tt){}findPageByUrlPath(tt){return this.appPages.length===0?null:this.appPages.find(et=>tt.endsWith("/"+et.urlPathname))??this.appPages[0]}clearPageElements(tt,et,nt){return AppRoot.empty(et,!1,nt,tt.logo)}}class StrategyV2{constructor(tt){this.appNav=tt,this.mainScriptHash=null,this.appPages=[],this.mainPage=null,this.hideSidebarNav=null}handleNewSession(tt){var et;return this.mainScriptHash=tt.mainScriptHash,this.hideSidebarNav===null&&(this.hideSidebarNav=((et=tt.config)==null?void 0:et.hideSidebarNav)??null),document.title=getTitle(""),[{hideSidebarNav:this.hideSidebarNav??!1},()=>{}]}handlePagesChanged(tt){}handlePageNotFound(tt){const{pageName:et}=tt;return this.appNav.onPageNotFound(et),[{currentPageScriptHash:this.mainScriptHash??""},()=>{this.appNav.hostCommunicationMgr.sendMessageToHost({type:"SET_CURRENT_PAGE_NAME",currentPageName:"",currentPageScriptHash:this.mainScriptHash??""})}]}handleNavigation(tt){const{sections:et,position:nt,appPages:ot}=tt;this.appPages=ot,this.hideSidebarNav=nt===Navigation.Position.HIDDEN;const at=tt.pageScriptHash,st=ot.find(pt=>pt.pageScriptHash===at),ut=ot.find(pt=>pt.isDefault);this.mainPage=ut;const ct=st.urlPathname;if(!this.appNav.isPageTitleSet){const pt=getTitle(st.pageName);document.title=pt,this.appNav.hostCommunicationMgr.sendMessageToHost({type:"SET_PAGE_TITLE",title:st.pageName??""})}return!this.appNav.isPageIconSet&&st.icon&&this.appNav.onPageIconChange(st.icon),this.appNav.onUpdatePageUrl(ut.urlPathname??"",ct,st.isDefault??!1),[{appPages:ot,navSections:et,hideSidebarNav:this.hideSidebarNav,expandSidebarNav:tt.expanded,currentPageScriptHash:at},()=>{this.appNav.hostCommunicationMgr.sendMessageToHost({type:"SET_APP_PAGES",appPages:ot}),this.appNav.hostCommunicationMgr.sendMessageToHost({type:"SET_CURRENT_PAGE_NAME",currentPageName:st.isDefault?"":ct,currentPageScriptHash:at})}]}findPageByUrlPath(tt){return this.appPages.find(et=>tt.endsWith("/"+et.urlPathname))??this.mainPage}clearPageElements(tt,et,nt){return tt.filterMainScriptElements(et)}}class AppNavigation{constructor(tt,et,nt,ot){this.hostCommunicationMgr=tt,this.onUpdatePageUrl=et,this.onPageNotFound=nt,this.onPageIconChange=ot,this.isPageIconSet=!1,this.isPageTitleSet=!1,this.strategy=new StrategyV1(this)}handleNewSession(tt){return this.isPageTitleSet=!1,this.isPageIconSet=!1,this.strategy.handleNewSession(tt)}handleNavigation(tt){return this.strategy instanceof StrategyV1&&(this.strategy=new StrategyV2(this)),this.strategy.handleNavigation(tt)}handlePagesChanged(tt){return this.strategy.handlePagesChanged(tt)}handlePageNotFound(tt){return this.strategy.handlePageNotFound(tt)}findPageByUrlPath(tt){return this.strategy.findPageByUrlPath(tt)}handlePageConfigChanged(tt){this.isPageIconSet=!!tt.favicon,this.isPageTitleSet=!!tt.title}clearPageElements(tt,et,nt){return this.strategy.clearPageElements(tt,et,nt)}}var define_PACKAGE_METADATA_default={version:"1.42.0"};const ELEMENT_LIST_BUFFER_TIMEOUT_MS=10,INITIAL_SCRIPT_RUN_ID="<null>",LOG=loglevelExports$1.getLogger("App");class App extends reactExports.PureComponent{constructor(tt){super(tt),this.sessionInfo=new SessionInfo,this.metricsMgr=new MetricsManager(this.sessionInfo),this.sessionEventDispatcher=new SessionEventDispatcher,this.embeddingId=generateUID$2(),this.showDeployError=(nt,ot,at)=>{this.openDialog({type:DialogType.DEPLOY_ERROR,title:nt,msg:ot,onContinue:at,onClose:()=>{},onTryAgain:this.sendLoadGitInfoBackMsg})},this.handleThemeMessage=(nt,ot)=>{const[,at,st]=createPresetThemes(),ut=isPresetTheme(this.props.theme.activeTheme);nt===at.name&&ut?this.props.theme.setTheme(at):nt===st.name&&ut?this.props.theme.setTheme(st):ot&&this.props.theme.setImportedTheme(ot)},this.handleConnectionStateChanged=nt=>{if(LOG.info(`Connection state changed from ${this.state.connectionState} to ${nt}`),nt===ConnectionState.CONNECTED){LOG.info("Reconnected to server.");const ot=this.state.scriptRunState===ScriptRunState.RERUN_REQUESTED||this.state.scriptRunState===ScriptRunState.RUNNING;(!this.sessionInfo.last||ot)&&(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:nt!==ConnectionState.DISCONNECTED_FOREVER}),this.sessionInfo.isSet&&this.sessionInfo.clearCurrent();this.setState({connectionState:nt})},this.handleGitInfoChanged=nt=>{this.setState({gitInfo:nt})},this.handleCustomParentMessage=nt=>{this.state.appConfig.enableCustomParentMessages?this.hostCommunicationMgr.sendMessageToHost({type:"CUSTOM_PARENT_MESSAGE",message:nt.message}):LOG.error("Sending messages to the host is disabled in line with the platform policy.")},this.handleMessage=nt=>{const ot=(at,st,ut)=>{const ct=at[st];if(ct in ut)return ut[ct](at[ct]);throw new Error(`Cannot handle ${st} "${ct}".`)};try{ot(nt,"type",{newSession:at=>this.handleNewSession(at),sessionStatusChanged:at=>this.handleSessionStatusChanged(at),sessionEvent:at=>this.handleSessionEvent(at),delta:at=>this.handleDeltaMsg(at,nt.metadata),pageConfigChanged:at=>this.handlePageConfigChanged(at),pageInfoChanged:at=>this.handlePageInfoChanged(at),pagesChanged:at=>this.handlePagesChanged(at),pageNotFound:at=>this.handlePageNotFound(at),gitInfoChanged:at=>this.handleGitInfoChanged(at),scriptFinished:at=>this.handleScriptFinished(at),pageProfile:at=>this.handlePageProfileMsg(at),autoRerun:at=>this.handleAutoRerun(at),fileUrlsResponse:at=>this.uploadClient.onFileURLsResponse(at),parentMessage:at=>this.handleCustomParentMessage(at),logo:at=>this.handleLogo(at,nt.metadata),navigation:at=>this.handleNavigation(at),authRedirect:at=>{isInChildFrame()?this.hostCommunicationMgr.sendMessageToSameOriginHost({type:"REDIRECT_TO_URL",url:at.url}):window.location.href=at.url}})}catch(at){const st=ensureError(at);LOG.error(st),this.showError("Bad message format",st.message)}},this.handleLogo=(nt,ot)=>{const at={activeScriptHash:ot.activeScriptHash,scriptRunId:this.state.scriptRunId};this.setState({elements:this.pendingElementsBuffer.appRootWithLogo(nt,at)},()=>{this.pendingElementsBuffer=this.state.elements})},this.handlePageConfigChanged=nt=>{const{title:ot,favicon:at,layout:st,initialSidebarState:ut,menuItems:ct}=nt;this.appNavigation.handlePageConfigChanged(nt),ot&&(this.hostCommunicationMgr.sendMessageToHost({type:"SET_PAGE_TITLE",title:ot}),document.title=ot),at&&this.onPageIconChanged(at),st!==this.state.layout&&this.setState(pt=>({layout:st,userSettings:{...pt.userSettings,wideMode:st===PageConfig.Layout.WIDE}})),ut!==this.state.initialSidebarState&&this.setState(()=>({initialSidebarState:ut})),this.setState({menuItems:ct})},this.handlePageInfoChanged=nt=>{const{queryString:ot}=nt,at=document.location.pathname+(ot?`?${ot}`:"");window.history.pushState({},"",at),this.hostCommunicationMgr.sendMessageToHost({type:"SET_QUERY_PARAM",queryParams:ot?`?${ot}`:""})},this.onPageNotFound=nt=>{const ot=nt?`You have requested page /${nt}, 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",`${ot}. Running the app's main page.`)},this.handlePageNotFound=nt=>{this.maybeSetState(this.appNavigation.handlePageNotFound(nt))},this.onPageIconChanged=nt=>{handleFavicon(nt,this.hostCommunicationMgr.sendMessageToHost,this.endpoints)},this.handlePagesChanged=nt=>{this.maybeSetState(this.appNavigation.handlePagesChanged(nt))},this.handleNavigation=nt=>{this.maybeSetState(this.appNavigation.handleNavigation(nt))},this.handlePageProfileMsg=nt=>{var st,ut,ct;const ot=PageProfile.toObject(nt),at=getBrowserInfo();this.metricsMgr.enqueue("pageProfile",{...ot,isFragmentRun:!!ot.isFragmentRun,appId:this.sessionInfo.current.appId,numPages:(st=this.state.appPages)==null?void 0:st.length,sessionId:this.sessionInfo.current.sessionId,pythonVersion:this.sessionInfo.current.pythonVersion,pageScriptHash:this.state.currentPageScriptHash,activeTheme:(ct=(ut=this.props.theme)==null?void 0:ut.activeTheme)==null?void 0:ct.name,totalLoadTime:Math.round((performance.now()-this.state.latestRunTime)*1e3),browserInfo:at})},this.handleAutoRerun=nt=>{const ot=setInterval(()=>{this.widgetMgr.sendUpdateWidgetsMessage(nt.fragmentId,!0)},nt.interval*1e3);this.setState(at=>({autoReruns:[...at.autoReruns,ot]}))},this.handleSessionStatusChanged=nt=>{this.setState(ot=>{let{scriptRunState:at}=ot,{dialog:st}=ot;return nt.scriptIsRunning&&ot.scriptRunState!==ScriptRunState.STOP_REQUESTED?(at=ScriptRunState.RUNNING,d$3(st)&&st.type===DialogType.SCRIPT_COMPILE_ERROR&&(st=void 0)):!nt.scriptIsRunning&&ot.scriptRunState!==ScriptRunState.RERUN_REQUESTED&&ot.scriptRunState!==ScriptRunState.COMPILATION_ERROR&&(at=ScriptRunState.NOT_RUNNING),{userSettings:{...ot.userSettings,runOnSave:!!nt.runOnSave},dialog:st,scriptRunState:at}})},this.handleSessionEvent=nt=>{if(this.sessionEventDispatcher.handleSessionEventMsg(nt),nt.type==="scriptCompilationException"){this.setState({scriptRunState:ScriptRunState.COMPILATION_ERROR});const ot={type:DialogType.SCRIPT_COMPILE_ERROR,exception:nt.scriptCompilationException,onClose:()=>{}};this.openDialog(ot)}},this.maybeUpdatePageUrl=(nt,ot,at)=>{const st=this.getBaseUriParts();if(st){const{pathname:ut}=st,ct=extractPageNameFromPathName(document.location.pathname,ut);if((ct===""?nt:ct)!==ot){const dt=at?"":ot,ft=preserveEmbedQueryParams(),bt=ft?`?${ft}`:"",mt=`${ut==="/"?"":ut}/${dt}${bt}`;window.history.pushState({},"",mt)}}},this.handleNewSession=nt=>{const ot=nt.initialize;if(this.hasStreamlitVersionChanged(ot)){window.location.reload();return}this.sessionInfo.isSet||this.handleOneTimeInitialization(nt);const{appHash:at,currentPageScriptHash:st}=this.state,{scriptRunId:ut,name:ct,mainScriptPath:pt,fragmentIdsThisRun:dt,pageScriptHash:ft,mainScriptHash:bt}=nt;if(dt.length)this.setState({fragmentIdsThisRun:dt,latestRunTime:performance.now()});else{this.cleanupAutoReruns();const mt=nt.config,Ot=nt.customTheme;this.processThemeInput(Ot),this.setState({allowRunOnSave:mt.allowRunOnSave,hideTopBar:mt.hideTopBar,toolbarMode:mt.toolbarMode,latestRunTime:performance.now(),mainScriptHash:bt,fragmentIdsThisRun:dt}),this.maybeSetState(this.appNavigation.handleNewSession(nt)),this.onPageIconChanged("./favicon.png")}const ht=hashString(this.sessionInfo.current.installationId+pt);this.metricsMgr.setMetadata(this.state.deployedAppMetadata),this.metricsMgr.setAppHash(ht),this.metricsMgr.enqueue("updateReport"),at===ht&&st===ft?this.setState({scriptRunId:ut}):this.clearAppState(ht,ut,ct,bt)},this.handleOneTimeInitialization=nt=>{const ot=nt.initialize,at=nt.config;this.sessionInfo.setCurrent(SessionInfo.propsFromNewSessionMessage(nt)),this.metricsMgr.initialize({gatherUsageStats:at.gatherUsageStats,sendMessageToHost:this.hostCommunicationMgr.sendMessageToHost}),this.handleSessionStatusChanged(ot.sessionStatus)},this.onHistoryChange=()=>{const{currentPageScriptHash:nt}=this.state,ot=this.appNavigation.findPageByUrlPath(document.location.pathname),at=document.location.toString().includes("#"),st=(ot==null?void 0:ot.pageScriptHash)===nt;m$4(ot)||at&&st||this.onPageChange(ot.pageScriptHash)},this.setAndSendTheme=nt=>{this.props.theme.setTheme(nt),this.setState({hideColoredLine:!isPresetTheme(nt)}),this.hostCommunicationMgr.sendMessageToHost({type:"SET_THEME_CONFIG",themeInfo:toExportedTheme(nt.emotion)})},this.createThemeHash=nt=>{if(!nt)return"hash_for_undefined_custom_theme";const ot=Object.entries(nt);return ot.sort(),hashString(ot.join(":"))},this.closeDialog=()=>{this.setState({dialog:void 0})},this.saveSettings=nt=>{const{runOnSave:ot}=this.state.userSettings,{runOnSave:at}=nt;if(this.setState({userSettings:nt}),ot!==at&&this.isServerConnected()){const st=new BackMsg$1({setRunOnSave:at});st.type="setRunOnSave",this.sendBackMsg(st)}},this.handleDeltaMsg=(nt,ot)=>{if(this.pendingElementsBuffer=this.pendingElementsBuffer.applyDelta(this.state.scriptRunId,nt,ot),!this.pendingElementsTimerRunning){this.pendingElementsTimerRunning=!0;const at=this.state.scriptRunState===ScriptRunState.RUNNING;setTimeout(()=>{this.pendingElementsTimerRunning=!1,at&&this.setState({elements:this.pendingElementsBuffer})},ELEMENT_LIST_BUFFER_TIMEOUT_MS)}},this.debugShutdownRuntime=()=>{if(this.isServerConnected()){const nt=new BackMsg$1({debugShutdownRuntime:!0});nt.type="debugShutdownRuntime",this.sendBackMsg(nt)}},this.debugDisconnectWebsocket=()=>{if(this.isServerConnected()){const nt=new BackMsg$1({debugDisconnectWebsocket:!0});nt.type="debugDisconnectWebsocket",this.sendBackMsg(nt)}},this.debugClearForwardMsgCache=()=>{var nt,ot;isLocalhost()&&((ot=(nt=this.connectionManager)==null?void 0:nt.websocketConnection)==null||ot.cache.messages.clear())},this.cleanupAutoReruns=()=>{this.state.autoReruns.forEach(nt=>{clearInterval(nt)}),this.setState({autoReruns:[]})},this.rerunScript=(nt=!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}),nt===!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=nt=>{const{elements:ot,mainScriptHash:at}=this.state;this.cleanupAutoReruns();const st=this.appNavigation.clearPageElements(ot,at,void 0),ut=new Set(Array.from(st.getElements()).map(ct=>getElementId(ct)).filter(notUndefined));this.sendRerunBackMsg(this.widgetMgr.getActiveWidgetStates(ut),void 0,nt)},this.isAppInReadyState=nt=>this.state.connectionState===ConnectionState.CONNECTED&&this.state.scriptRunState===ScriptRunState.NOT_RUNNING&&nt.scriptRunState===ScriptRunState.RUNNING&&nt.connectionState===ConnectionState.CONNECTED,this.sendRerunBackMsg=(nt,ot,at,st)=>{const ut=this.getBaseUriParts();if(!ut){LOG.error("Cannot send rerun backMessage when disconnected from server.");return}const{currentPageScriptHash:ct}=this.state,{pathname:pt}=ut;let dt=this.getQueryString(),ft="";at?at!=ct&&(dt=preserveEmbedQueryParams(),this.hostCommunicationMgr.sendMessageToHost({type:"SET_QUERY_PARAM",queryParams:dt})):ct?at=ct:(ft=extractPageNameFromPathName(document.location.pathname,pt),at=""),this.sendBackMsg(new BackMsg$1({rerunScript:{queryString:dt,widgetStates:nt,pageScriptHash:at,pageName:ft,fragmentId:ot,isAutoRerun:st}}))},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 nt=new BackMsg$1({stopScript:!0});nt.type="stopScript",this.sendBackMsg(nt),this.setState({scriptRunState:ScriptRunState.STOP_REQUESTED})},this.openClearCacheDialog=()=>{if(this.isServerConnected()){const nt={type:DialogType.CLEAR_CACHE,confirmCallback:this.clearCache,defaultAction:this.clearCache,onClose:()=>{}};this.openDialog(nt)}else LOG.error("Cannot clear cache: disconnected from server")},this.openDeployDialog=()=>{var ot;const nt={type:DialogType.DEPLOY_DIALOG,onClose:this.closeDialog,showDeployError:this.showDeployError,isDeployErrorModalOpen:((ot=this.state.dialog)==null?void 0:ot.type)===DialogType.DEPLOY_ERROR,metricsMgr:this.metricsMgr};this.openDialog(nt)},this.openThemeCreatorDialog=()=>{this.metricsMgr.enqueue("menuClick",{label:"editTheme"});const nt={type:DialogType.THEME_CREATOR,backToSettings:this.settingsCallback,onClose:this.closeDialog,metricsMgr:this.metricsMgr};this.openDialog(nt)},this.clearCache=()=>{if(this.closeDialog(),this.isServerConnected()){const nt=new BackMsg$1({clearCache:!0});nt.type="clearCache",this.sendBackMsg(nt)}else LOG.error("Cannot clear cache: disconnected from server")},this.sendAppHeartbeat=()=>{if(this.isServerConnected()){const nt=new BackMsg$1({appHeartbeat:!0});nt.type="appHeartbeat",this.sendBackMsg(nt)}else LOG.error("Cannot send app heartbeat: disconnected from server")},this.sendBackMsg=nt=>{this.connectionManager?(LOG.info(nt),this.connectionManager.sendMessage(nt)):LOG.error(`Not connected. Cannot send back message: ${nt}`)},this.handleConnectionError=nt=>{this.showError("Connection error",nt)},this.isServerConnected=()=>this.connectionManager?this.connectionManager.isConnected():!1,this.settingsCallback=(nt=!0)=>{const ot={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:nt,metricsMgr:this.metricsMgr};this.openDialog(ot)},this.aboutCallback=()=>{const{menuItems:nt}=this.state,ot={type:DialogType.ABOUT,sessionInfo:this.sessionInfo,onClose:this.closeDialog,aboutSectionMd:nt==null?void 0:nt.aboutSectionMd};this.openDialog(ot)},this.printCallback=()=>{const{scriptRunState:nt}=this.state;if(nt!==ScriptRunState.NOT_RUNNING){setTimeout(this.printCallback,500);return}let ot;try{const at=getIFrameEnclosingApp(this.embeddingId);at&&at.contentWindow?ot=at.contentWindow.window:ot=window}catch{ot=window}finally{ot||(ot=window),ot.print()}},this.screencastCallback=()=>{const{scriptName:nt}=this.state,{startRecording:ot}=this.props.screenCast,at=hooks().format("YYYY-MM-DD-HH-MM-SS");ot(`streamlit-${nt}-${at}`)},this.handleFullScreen=nt=>{this.setState({isFullScreen:nt})},this.setLibConfig=nt=>{this.setState({libConfig:nt})},this.setAppConfig=nt=>{this.setState({appConfig:nt})},this.addScriptFinishedHandler=nt=>{this.setState((ot,at)=>({scriptFinishedHandlers:ot.scriptFinishedHandlers.concat(nt)}))},this.removeScriptFinishedHandler=nt=>{this.setState((ot,at)=>({scriptFinishedHandlers:without$1(ot.scriptFinishedHandlers,nt)}))},this.getBaseUriParts=()=>this.connectionManager?this.connectionManager.getBaseUriParts():void 0,this.getQueryString=()=>{const{queryParams:nt}=this.state,ot=nt&&nt.length>0?nt:document.location.search;return ot.startsWith("?")?ot.substring(1):ot},this.isInCloudEnvironment=()=>{const{hostMenuItems:nt}=this.state;return nt&&(nt==null?void 0:nt.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=(nt,ot)=>{if(this.isServerConnected()){const at=new BackMsg$1({fileUrlsRequest:{requestId:nt,fileNames:ot.map(st=>st.name),sessionId:this.sessionInfo.current.sessionId}});at.type="fileUrlsRequest",this.sendBackMsg(at)}},this.handleKeyDown=nt=>{switch(nt){case"c":showDevelopmentOptions(this.state.isOwner,this.state.toolbarMode)&&this.openClearCacheDialog();break;case"r":this.rerunScript();break}},this.handleKeyUp=nt=>{nt==="esc"&&this.props.screenCast.stopRecording()},J$1();let et=this.createThemeHash();isPresetTheme(tt.theme.activeTheme)||(et=this.createThemeHash(toThemeInput(tt.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:et,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:nt=>this.setState({formsData:nt})}),this.hostCommunicationMgr=new HostCommunicationManager({streamlitExecutionStartedAt:tt.streamlitExecutionStartedAt,sendRerunBackMsg:this.sendRerunBackMsg,closeModal:this.closeDialog,stopScript:this.stopScript,rerunScript:this.rerunScript,clearCache:this.clearCache,sendAppHeartbeat:this.sendAppHeartbeat,setInputsDisabled:nt=>{this.setState({inputsDisabled:nt})},themeChanged:this.handleThemeMessage,pageChanged:this.onPageChange,isOwnerChanged:nt=>this.setState({isOwner:nt}),fileUploadClientConfigChanged:nt=>{this.endpoints.setFileUploadClientConfig!==void 0&&this.endpoints.setFileUploadClientConfig(nt)},hostMenuItemsChanged:nt=>{this.setState({hostMenuItems:nt})},hostToolbarItemsChanged:nt=>{this.setState({hostToolbarItems:nt})},hostHideSidebarNavChanged:nt=>{this.setState({hostHideSidebarNav:nt})},sidebarChevronDownshiftChanged:nt=>{this.setState({sidebarChevronDownshift:nt})},pageLinkBaseUrlChanged:nt=>{this.setState({pageLinkBaseUrl:nt})},queryParamsChanged:nt=>{this.setState({queryParams:nt})},deployedAppMetadataChanged:nt=>{this.setState({deployedAppMetadata:nt})},restartWebsocketConnection:()=>{this.connectionManager||this.initializeConnectionManager()},terminateWebsocketConnection:()=>{var nt;(nt=this.connectionManager)==null||nt.disconnect(),this.connectionManager=null}}),this.endpoints=new DefaultStreamlitEndpoints({getServerUri:this.getBaseUriParts,csrfEnabled:!0}),this.uploadClient=new FileUploadClient({sessionInfo:this.sessionInfo,endpoints:this.endpoints,formsWithPendingRequestsChanged:nt=>this.widgetMgr.setFormsWithUploadsInProgress(nt),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 tt;return(tt=this.sessionInfo.last)==null?void 0:tt.sessionId},endpoints:this.endpoints,onMessage:this.handleMessage,onConnectionError:this.handleConnectionError,connectionStateChanged:this.handleConnectionStateChanged,claimHostAuthToken:this.hostCommunicationMgr.claimAuthToken,resetHostAuthToken:this.hostCommunicationMgr.resetAuthToken,onHostConfigResp:tt=>{const{allowedOrigins:et,useExternalAuthToken:nt,disableFullscreenMode:ot,enableCustomParentMessages:at,mapboxToken:st,enforceDownloadInNewTab:ut,metricsUrl:ct}=tt,pt={allowedOrigins:et,useExternalAuthToken:nt,enableCustomParentMessages:at},dt={mapboxToken:st,disableFullscreenMode:ot,enforceDownloadInNewTab:ut};this.metricsMgr.setMetricsConfig(ct),this.hostCommunicationMgr.setAllowedOrigins(pt),this.setAppConfig(pt),this.setLibConfig(dt)}})}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 tt=document.querySelectorAll("[data-iframe-height]"),et=Array.from(tt).map(nt=>Math.ceil(nt.getBoundingClientRect().bottom));return Math.max(0,...et)}},__vitePreload(()=>import("./iframeResizer.contentWindow.BWR-QZPU.js").then(tt=>tt.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(tt,et){window.prerenderReady===!1&&this.isAppInReadyState(et)&&(window.prerenderReady=!0),this.state.scriptRunState!==et.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 tt;(tt=this.connectionManager)==null||tt.disconnect(),this.hostCommunicationMgr.closeHostCommunication(),window.removeEventListener("popstate",this.onHistoryChange,!1)}showError(tt,et){LOG.error(et);const nt={type:DialogType.WARNING,title:tt,msg:jsx$1(StreamlitMarkdown$1,{source:et,allowHTML:!1}),onClose:()=>{}};this.openDialog(nt)}hasStreamlitVersionChanged(tt){var nt;let et;if(((nt=window.__streamlit)==null?void 0:nt.ENABLE_RELOAD_BASED_ON_HARDCODED_STREAMLIT_VERSION)===!0?et=define_PACKAGE_METADATA_default.version:this.sessionInfo.isSet&&(et=this.sessionInfo.current.streamlitVersion),et){const{environmentInfo:ot}=tt;if(d$3(ot)&&d$3(ot.streamlitVersion))return et!=ot.streamlitVersion}return!1}maybeSetState(tt){if(tt){const[et,nt]=tt;this.setState(et,nt)}}processThemeInput(tt){const et=this.createThemeHash(tt);if(et===this.state.themeHash)return;this.setState({themeHash:et});const nt=!isPresetTheme(this.props.theme.activeTheme);if(tt){const ot=createTheme(CUSTOM_THEME_NAME,tt);this.props.theme.addThemes([ot]),(getCachedTheme()===null||nt)&&this.setAndSendTheme(ot)}else this.props.theme.addThemes([]),nt&&this.setAndSendTheme(getHostSpecifiedTheme());tt!=null&&tt.fontFaces&&this.props.theme.setImportedTheme(tt)}handleScriptFinished(tt){if(tt===ForwardMsg$1.ScriptFinishedStatus.FINISHED_SUCCESSFULLY||tt===ForwardMsg$1.ScriptFinishedStatus.FINISHED_EARLY_FOR_RERUN||tt===ForwardMsg$1.ScriptFinishedStatus.FINISHED_FRAGMENT_RUN_SUCCESSFULLY){if(window.setTimeout(()=>{this.state.scriptFinishedHandlers.map(et=>et())},0),tt===ForwardMsg$1.ScriptFinishedStatus.FINISHED_SUCCESSFULLY||tt===ForwardMsg$1.ScriptFinishedStatus.FINISHED_FRAGMENT_RUN_SUCCESSFULLY){this.setState(({scriptRunId:nt,fragmentIdsThisRun:ot})=>({elements:this.pendingElementsBuffer.clearStaleNodes(nt,ot)}),()=>{this.pendingElementsBuffer=this.state.elements});const et=new Set(Array.from(this.state.elements.getElements()).map(nt=>getElementId(nt)).filter(notUndefined));this.widgetMgr.removeInactive(et)}this.connectionManager!==null&&tt!==ForwardMsg$1.ScriptFinishedStatus.FINISHED_EARLY_FOR_RERUN&&this.sessionInfo.isSet&&this.connectionManager.incrementMessageCacheRunCount(this.sessionInfo.current.maxCachedMessageAge)}}clearAppState(tt,et,nt,ot){const{hideSidebarNav:at,elements:st}=this.state,ut=at&&st.sidebar||void 0;this.setState({scriptRunId:et,scriptName:nt,appHash:tt,elements:this.appNavigation.clearPageElements(this.pendingElementsBuffer,ot,ut)},()=>{this.pendingElementsBuffer=this.state.elements;const ct=new Set(Array.from(this.state.elements.getElements()).map(pt=>getElementId(pt)).filter(notUndefined));this.widgetMgr.removeInactive(ct)})}openDialog(tt){this.setState({dialog:tt})}render(){const{allowRunOnSave:tt,connectionState:et,dialog:nt,elements:ot,initialSidebarState:at,menuItems:st,isFullScreen:ut,scriptRunId:ct,scriptRunState:pt,userSettings:dt,hideTopBar:ft,hideSidebarNav:bt,hideColoredLine:ht,expandSidebarNav:mt,currentPageScriptHash:Ot,hostHideSidebarNav:yt,pageLinkBaseUrl:Mt,sidebarChevronDownshift:At,hostMenuItems:St,hostToolbarItems:Et,libConfig:zt,appConfig:vt,inputsDisabled:Tt,appPages:$t,navSections:Rt}=this.state,wt=showDevelopmentOptions(this.state.isOwner,this.state.toolbarMode),It=classNames("stApp",getEmbeddingIdClassName(this.embeddingId),{"streamlit-embedded":isEmbed(),"streamlit-wide":dt.wideMode}),kt=nt?StreamlitDialog({...nt,onClose:this.closeDialog}):null,Ft=Tt||et!==ConnectionState.CONNECTED;return jsx$1(AppContext.Provider,{value:{initialSidebarState:at,wideMode:dt.wideMode,embedded:isEmbed(),showPadding:!isEmbed()||isPaddingDisplayed(),disableScrolling:isScrollingHidden(),showToolbar:!isEmbed()||isToolbarDisplayed(),showColoredLine:!ht&&!isEmbed()||isColoredLineDisplayed(),pageLinkBaseUrl:Mt,sidebarChevronDownshift:At,gitInfo:this.state.gitInfo,appConfig:vt},children:jsx$1(LibContext.Provider,{value:{isFullScreen:ut,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:Ot,libConfig:zt,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:It,"data-testid":"stApp","data-test-script-state":ct==INITIAL_SCRIPT_RUN_ID?"initial":pt,"data-test-connection-state":et,children:[jsxs(Header,{children:[!ft&&jsxs(Fragment,{children:[jsx$1(StatusWidget,{connectionState:et,sessionEventDispatcher:this.sessionEventDispatcher,scriptRunState:pt,rerunScript:this.rerunScript,stopScript:this.stopScript,allowRunOnSave:tt}),jsx$1(ToolbarActions,{hostToolbarItems:Et,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:St,developmentMode:wt,sendMessageToHost:this.hostCommunicationMgr.sendMessageToHost,menuItems:st,metricsMgr:this.metricsMgr,toolbarMode:this.state.toolbarMode})]}),jsx$1(AppView,{endpoints:this.endpoints,sendMessageToHost:this.hostCommunicationMgr.sendMessageToHost,elements:ot,scriptRunId:ct,scriptRunState:pt,widgetMgr:this.widgetMgr,widgetsDisabled:Ft,uploadClient:this.uploadClient,componentRegistry:this.componentRegistry,formsData:this.state.formsData,appLogo:ot.logo,appPages:$t,navSections:Rt,onPageChange:this.onPageChange,currentPageScriptHash:Ot,hideSidebarNav:bt||yt,expandSidebarNav:mt}),kt]})})})})}}const AppWithScreenCast=withScreencast(App);function useThemeManager(){const rt=getDefaultTheme(),[tt,et]=reactExports.useState(rt),[nt,ot]=reactExports.useState([]),[at,st]=reactExports.useState([...createPresetThemes(),...isPresetTheme(rt)?[]:[rt]]),ut=ft=>{st([...createPresetThemes(),...ft])},ct=reactExports.useCallback(ft=>{ft!==tt&&(et(ft),ft.name===AUTO_THEME_NAME?removeCachedTheme():setCachedTheme(ft))},[et,tt]),pt=reactExports.useCallback(()=>{tt.name===AUTO_THEME_NAME&&ct(getHostSpecifiedTheme());const ft=at.filter(bt=>bt.name!==AUTO_THEME_NAME);st([createAutoTheme(),...ft])},[tt.name,at,ct]),dt=reactExports.useCallback(ft=>{ft.fontFaces&&ot(ft.fontFaces);const bt=new CustomThemeConfig(ft),ht=createTheme(CUSTOM_THEME_NAME,bt);ct(ht)},[ot,ct]);return reactExports.useEffect(()=>{const ft=window.matchMedia("(prefers-color-scheme: dark)");return ft.addEventListener("change",pt),window.addEventListener("afterprint",pt),()=>{window.removeEventListener("afterprint",pt),ft.removeEventListener("change",pt)}},[tt,at,pt]),[{setTheme:ct,activeTheme:tt,addThemes:ut,availableThemes:at,setImportedTheme:dt},nt]}const ThemedApp=({streamlitExecutionStartedAt:rt})=>{const[tt,et]=useThemeManager(),{activeTheme:nt}=tt,ot=nt.name===CUSTOM_THEME_NAME&&et.length>0;return jsx$1(RootStyleProvider,{theme:nt,children:jsx$1(WindowDimensionsProvider,{children:jsxs(PortalProvider,{children:[ot&&jsx$1(FontFaceDeclaration,{fontFaces:et}),jsx$1(AppWithScreenCast,{theme:tt,streamlitExecutionStartedAt:rt})]})})})},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{_getTag as $,PLACEMENT as A,ACCESSIBILITY_TYPE as B,convertRemToPx as C,DynamicIcon as D,EmotionIconBase as E,Fragment as F,hasLightBackgroundColor as G,Popover$2 as H,require$$0 as I,toString$7 as J,m$4 as K,merge$4 as L,numbro$1 as M,d$3 as N,hooks as O,PortalContext as P,getTimezone as Q,React$1 as R,moment$1 as S,isIntegerType as T,isUnsignedIntegerType as U,isDurationType as V,isPeriodType as W,format as X,isBooleanType as Y,_baseKeys as Z,_extends$Q as _,range$1 as a,lib$3 as a$,isArguments_1 as a0,isArray_1 as a1,isArrayLike_1 as a2,isBufferExports as a3,_isPrototype as a4,isTypedArray_1 as a5,DataFrameCellType as a6,Field$1 as a7,Null as a8,isTimeType as a9,mix$1 as aA,getStyledCell as aB,isEqual$1 as aC,StyledTooltipContentWrapper as aD,StreamlitMarkdown$1 as aE,LibContext as aF,Resizable as aG,getGray70 as aH,getGray30 as aI,getCategoricalColorsArray as aJ,getDivergingColorsArray as aK,getSequentialColorsArray as aL,getBlue80 as aM,debounce$4 as aN,Global as aO,_baseMerge as aP,_createAssigner as aQ,toaster as aR,Kind as aS,AlertElement$1 as aT,_assertThisInitialized as aU,StyledInlineCode as aV,ErrorElement as aW,Skeleton$1 as aX,Skeleton as aY,hoistNonReactStatics$1 as aZ,ensureError as a_,convertTimeToDate as aa,isDecimalType as ab,isStringType as ac,isEmptyType as ad,isDatetimeType as ae,isDateType as af,isObjectType as ag,isBytesType as ah,isNumericType as ai,isCategoricalType as aj,isListType as ak,isRangeIndexType as al,loglevelExports$1 as am,Arrow$2 as an,isArray$k as ao,_defineProperty$p as ap,_objectWithoutPropertiesLoose$j as aq,_typeof$c as ar,jsx as as,css as at,requireClassCallCheck as au,requireCreateClass as av,requireInherits as aw,requireToConsumableArray as ax,require_typeof as ay,transparentize as az,reactDomExports as b,without$1 as b$,parseToRgba as b0,assertNever as b1,DeckGlJsonChart$1 as b2,DEFAULT_IFRAME_FEATURE_POLICY as b3,DEFAULT_IFRAME_SANDBOX_POLICY as b4,darken as b5,BaseButtonSize as b6,BaseButtonKind as b7,BaseButtonTooltip as b8,DynamicButtonLabel as b9,StyledWidgetLabelHelpInline as bA,themeColors as bB,isMobile_1 as bC,CAMERA_PERMISSION_URL as bD,StyledWidgetLabelHelp as bE,StyledSpinnerIcon as bF,AcceptFileValue as bG,chatInputAcceptFileProtoValueToEnum as bH,isFocusVisible as bI,getOverride as bJ,getOverrideProps as bK,Checkbox$1 as bL,StyledContent as bM,StyledCheckbox$1 as bN,BaseColorPicker$1 as bO,useStyletron as bP,mergeOverride as bQ,toObjectOverride as bR,Icon$1 as bS,UIDConsumer as bT,StatefulMenu as bU,mergeOverrides as bV,ChevronDown$1 as bW,ThemeContext as bX,forkFocus as bY,forkBlur as bZ,Select as b_,IsSidebarContext as ba,Placement as bb,getGray90 as bc,getIncreasingGreen as bd,getDecreasingRed as be,PlotlyChart$1 as bf,keysToSnakeCase as bg,WindowDimensionsContext as bh,Video$1 as bi,zip$1 as bj,FileUploaderState as bk,UploadedFileInfo as bl,StyledSpinner as bm,ENABLE_PERIPHERALS_DOCS_URL as bn,Icon$2 as bo,BaseButton as bp,blend as bq,labelVisibilityProtoValueToEnum as br,TooltipIcon as bs,WidgetLabel as bt,Tooltip as bu,styled as bv,getOverrides as bw,LocaleContext as bx,ButtonGroup$1 as by,LabelVisibilityMessage as bz,_hasPath as c,fuzzyFilterSelectOptions as c0,TYPE as c1,VirtualDropdown as c2,classNames as c3,UISelectbox as c4,isValidFormId as c5,toPropertyKey as c6,_setPrototypeOf$a as c7,hexToRgb as c8,withWrapper as c9,NumberInput$1 as cA,__awaiter as ca,PropTypes as cb,isFromWindows as cc,StyledWidgetInstructions as cd,isFromMac as ce,CUSTOM_INPUT_TYPE as cf,SIZE$1 as cg,DeleteAlt$1 as ch,ADJOINED as ci,filterOptions as cj,ENHANCER_POSITION as ck,pick$1 as cl,Slider$2 as cm,ChevronLeft as cn,ChevronRight as co,isInForm as cp,toString_1 as cq,TextInput$1 as cr,ThemeProvider$1 as cs,createThemedStyled as ct,createThemedUseStyletron as cu,createThemedWithStyle as cv,expandBorderStyles as cw,withStyle as cx,getAugmentedNamespace as cy,reactIsExports$1 as cz,commonjsGlobal$2 as d,classnamesExports as e,_root as f,getDefaultExportFromCjs$1 as g,isObject_1 as h,isPropValid as i,jsx$1 as j,keyframes as k,_Set as l,_setToArray as m,newStyled as n,_SetCache as o,propTypesExports as p,_arrayIncludes as q,reactExports as r,_arrayIncludesWith as s,toNumber_1 as t,_cacheHas as u,groupBy$1 as v,__vitePreload as w,flatten$2 as x,useTheme as y,jsxs as z};
|