streamlit-nightly 1.52.3.dev20260111__py3-none-any.whl → 1.52.3.dev20260113__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/__init__.py +1 -1
- streamlit/auth_util.py +25 -2
- streamlit/cli_util.py +1 -1
- streamlit/components/v2/bidi_component/main.py +2 -2
- streamlit/connections/snowflake_connection.py +1 -1
- streamlit/dataframe_util.py +1 -3
- streamlit/elements/arrow.py +5 -1
- streamlit/elements/lib/color_util.py +1 -1
- streamlit/elements/lib/image_utils.py +1 -1
- streamlit/elements/vega_charts.py +4 -1
- streamlit/elements/widgets/multiselect.py +1 -1
- streamlit/elements/widgets/time_widgets.py +1 -1
- streamlit/elements/write.py +1 -2
- streamlit/errors.py +2 -0
- streamlit/external/langchain/streamlit_callback_handler.py +1 -1
- streamlit/proto/Alert_pb2.pyi +31 -31
- streamlit/proto/AppPage_pb2.pyi +30 -30
- streamlit/proto/ArrowData_pb2.pyi +15 -15
- streamlit/proto/ArrowNamedDataSet_pb2.pyi +25 -25
- streamlit/proto/ArrowVegaLiteChart_pb2.pyi +45 -45
- streamlit/proto/Arrow_pb2.pyi +126 -97
- streamlit/proto/AudioInput_pb2.pyi +39 -39
- streamlit/proto/Audio_pb2.pyi +39 -39
- streamlit/proto/AuthRedirect_pb2.pyi +15 -15
- streamlit/proto/AutoRerun_pb2.pyi +18 -18
- streamlit/proto/BackMsg_pb2.pyi +64 -64
- streamlit/proto/Balloons_pb2.pyi +15 -15
- streamlit/proto/BidiComponent_pb2.pyi +100 -100
- streamlit/proto/Block_pb2.pyi +295 -264
- streamlit/proto/BokehChart_pb2.pyi +21 -21
- streamlit/proto/ButtonGroup_pb2.pyi +96 -96
- streamlit/proto/ButtonLikeIconPosition_pb2.pyi +12 -12
- streamlit/proto/Button_pb2.pyi +63 -50
- streamlit/proto/CameraInput_pb2.pyi +34 -34
- streamlit/proto/ChatInput_pb2.pyi +63 -63
- streamlit/proto/Checkbox_pb2.pyi +49 -49
- streamlit/proto/ClientState_pb2.pyi +85 -85
- streamlit/proto/Code_pb2.pyi +41 -28
- streamlit/proto/ColorPicker_pb2.pyi +43 -43
- streamlit/proto/Common_pb2.pyi +175 -175
- streamlit/proto/Components_pb2.pyi +110 -110
- streamlit/proto/DataFrame_pb2.pyi +209 -209
- streamlit/proto/DateInput_pb2.pyi +59 -59
- streamlit/proto/DateTimeInput_pb2.pyi +62 -62
- streamlit/proto/DeckGlJsonChart_pb2.pyi +91 -56
- streamlit/proto/Delta_pb2.pyi +44 -44
- streamlit/proto/DocString_pb2.pyi +51 -51
- streamlit/proto/DownloadButton_pb2.pyi +59 -59
- streamlit/proto/Element_pb2.pyi +319 -319
- streamlit/proto/Empty_pb2.pyi +10 -10
- streamlit/proto/Exception_pb2.pyi +37 -37
- streamlit/proto/Favicon_pb2.pyi +15 -15
- streamlit/proto/FileUploader_pb2.pyi +49 -49
- streamlit/proto/ForwardMsg_pb2.pyi +176 -170
- streamlit/proto/GapSize_pb2.pyi +23 -23
- streamlit/proto/GitInfo_pb2.pyi +37 -37
- streamlit/proto/GraphVizChart_pb2.pyi +38 -25
- streamlit/proto/Heading_pb2.pyi +30 -30
- streamlit/proto/HeightConfig_pb2.pyi +31 -31
- streamlit/proto/Html_pb2.pyi +18 -18
- streamlit/proto/IFrame_pb2.pyi +76 -47
- streamlit/proto/Image_pb2.pyi +49 -36
- streamlit/proto/Json_pb2.pyi +25 -25
- streamlit/proto/LabelVisibilityMessage_pb2.pyi +18 -18
- streamlit/proto/LinkButton_pb2.pyi +43 -43
- streamlit/proto/Logo_pb2.pyi +24 -24
- streamlit/proto/Markdown_pb2.pyi +30 -30
- streamlit/proto/Metric_pb2.pyi +59 -59
- streamlit/proto/MetricsEvent_pb2.pyi +171 -171
- streamlit/proto/MultiSelect_pb2.pyi +72 -66
- streamlit/proto/NamedDataSet_pb2.pyi +25 -25
- streamlit/proto/Navigation_pb2.pyi +35 -35
- streamlit/proto/NewSession_pb2.pyi +511 -498
- streamlit/proto/NumberInput_pb2.pyi +79 -79
- streamlit/proto/PageConfig_pb2.pyi +71 -71
- streamlit/proto/PageInfo_pb2.pyi +15 -15
- streamlit/proto/PageLink_pb2.pyi +47 -47
- streamlit/proto/PageNotFound_pb2.pyi +15 -15
- streamlit/proto/PageProfile_pb2.pyi +85 -85
- streamlit/proto/PagesChanged_pb2.pyi +19 -19
- streamlit/proto/ParentMessage_pb2.pyi +15 -15
- streamlit/proto/PlotlyChart_pb2.pyi +79 -64
- streamlit/proto/Progress_pb2.pyi +18 -18
- streamlit/proto/Radio_pb2.pyi +62 -62
- streamlit/proto/RootContainer_pb2.pyi +12 -12
- streamlit/proto/Selectbox_pb2.pyi +80 -70
- streamlit/proto/SessionEvent_pb2.pyi +27 -27
- streamlit/proto/SessionStatus_pb2.pyi +18 -18
- streamlit/proto/Skeleton_pb2.pyi +25 -25
- streamlit/proto/Slider_pb2.pyi +74 -74
- streamlit/proto/Snow_pb2.pyi +15 -15
- streamlit/proto/Space_pb2.pyi +10 -10
- streamlit/proto/Spinner_pb2.pyi +21 -21
- streamlit/proto/TextAlignmentConfig_pb2.pyi +18 -18
- streamlit/proto/TextArea_pb2.pyi +72 -59
- streamlit/proto/TextInput_pb2.pyi +67 -67
- streamlit/proto/Text_pb2.pyi +18 -18
- streamlit/proto/TimeInput_pb2.pyi +52 -52
- streamlit/proto/Toast_pb2.pyi +25 -25
- streamlit/proto/Transient_pb2.pyi +19 -19
- streamlit/proto/VegaLiteChart_pb2.pyi +32 -32
- streamlit/proto/Video_pb2.pyi +65 -65
- streamlit/proto/WidgetStates_pb2.pyi +91 -85
- streamlit/proto/WidthConfig_pb2.pyi +31 -31
- streamlit/proto/openmetrics_data_model_pb2.pyi +269 -269
- streamlit/runtime/app_session.py +1 -1
- streamlit/runtime/credentials.py +2 -2
- streamlit/runtime/metrics_util.py +3 -3
- streamlit/runtime/secrets.py +1 -1
- streamlit/runtime/stats.py +1 -3
- streamlit/static/index.html +1 -1
- streamlit/static/manifest.json +296 -296
- streamlit/static/static/js/{ErrorOutline.esm.D0HiUB0L.js → ErrorOutline.esm.BjVqd_6R.js} +1 -1
- streamlit/static/static/js/{FileDownload.esm.BuUS-pfi.js → FileDownload.esm.DJCSsghl.js} +1 -1
- streamlit/static/static/js/{FileHelper.Pf8URFng.js → FileHelper.C---TH7o.js} +1 -1
- streamlit/static/static/js/{FormClearHelper.By4vKj6A.js → FormClearHelper.C-6BC487.js} +1 -1
- streamlit/static/static/js/{InputInstructions.BiaGyIXk.js → InputInstructions.sxc3InCI.js} +1 -1
- streamlit/static/static/js/{Particles.2-EdjYhR.js → Particles.S8yD7iW-.js} +1 -1
- streamlit/static/static/js/{ProgressBar.Dgbh0B0d.js → ProgressBar.BiYsyZCC.js} +1 -1
- streamlit/static/static/js/{StreamlitSyntaxHighlighter.DSl8Wr3R.js → StreamlitSyntaxHighlighter.9jZF8jX1.js} +1 -1
- streamlit/static/static/js/{TableChart.esm.MOwyTUPh.js → TableChart.esm.BdA4Q1rZ.js} +1 -1
- streamlit/static/static/js/{Toolbar.CowuXIFr.js → Toolbar.B9DaaDfN.js} +1 -1
- streamlit/static/static/js/{WidgetLabelHelpIconInline.BdGIJQe4.js → WidgetLabelHelpIconInline.DxODTLS2.js} +1 -1
- streamlit/static/static/js/{base-input.CHPo5oJ1.js → base-input.Gf1cKuQR.js} +1 -1
- streamlit/static/static/js/{checkbox.Dkt2TQVS.js → checkbox.CnoNruf3.js} +1 -1
- streamlit/static/static/js/{createDownloadLinkElement.BaE-_v8I.js → createDownloadLinkElement.B48AepiL.js} +1 -1
- streamlit/static/static/js/{data-grid-overlay-editor.C1ncL-Nr.js → data-grid-overlay-editor.Cmdq9aqU.js} +1 -1
- streamlit/static/static/js/{downloader.yaq2AzD9.js → downloader.CQLoQdMX.js} +1 -1
- streamlit/static/static/js/{embed.DJJvCVz2.js → embed.oKwocwU8.js} +1 -1
- streamlit/static/static/js/{es6.D2jK98VU.js → es6.BRxlY_y5.js} +2 -2
- streamlit/static/static/js/{formatNumber.Cxr2q_Sk.js → formatNumber.DaagZyZe.js} +1 -1
- streamlit/static/static/js/{iconPosition.5dHEZYw2.js → iconPosition.Q3hNvmK4.js} +1 -1
- streamlit/static/static/js/{iframeResizer.contentWindow.Cedt4qbc.js → iframeResizer.contentWindow.B6EBvI9L.js} +1 -1
- streamlit/static/static/js/{index.DaITTdfQ.js → index.19_qtO6t.js} +1 -1
- streamlit/static/static/js/{index._nL4Yjdr.js → index.43b777iP.js} +1 -1
- streamlit/static/static/js/{index.P-CMMGUY.js → index.B03eQZoH.js} +1 -1
- streamlit/static/static/js/{index.D2EVLt1U.js → index.B9kZB0o1.js} +1 -1
- streamlit/static/static/js/{index.BkDplL5I.js → index.BAI9aHCq.js} +1 -1
- streamlit/static/static/js/{index.CT9jvPcD.js → index.BF23fbfs.js} +1 -1
- streamlit/static/static/js/{index.TO9vodwr.js → index.BGBTkulf.js} +1 -1
- streamlit/static/static/js/{index.01VsD2h1.js → index.BRfGUOQ-.js} +5 -5
- streamlit/static/static/js/{index.D6ea3OJl.js → index.BVT89mQw.js} +1 -1
- streamlit/static/static/js/{index.BHMoYAbd.js → index.BXEC4cf3.js} +1 -1
- streamlit/static/static/js/{index.B6EliwN_.js → index.BbSFVZ3p.js} +1 -1
- streamlit/static/static/js/{index.B7EzT2pL.js → index.BkSwGJoh.js} +1 -1
- streamlit/static/static/js/{index.B6Uhb_NP.js → index.BnfTPrHb.js} +1 -1
- streamlit/static/static/js/{index.qzz9PjCO.js → index.BoX8d5rK.js} +1 -1
- streamlit/static/static/js/{index.Bb9kjc_v.js → index.Boa0Egng.js} +1 -1
- streamlit/static/static/js/{index.CjQo7CUO.js → index.BzwlrgZO.js} +1 -1
- streamlit/static/static/js/{index.Ba6hzYdl.js → index.C0fSEz-3.js} +1 -1
- streamlit/static/static/js/{index.B2TDaHdI.js → index.CCFwVy90.js} +1 -1
- streamlit/static/static/js/{index.Dt0Psatx.js → index.CCQ5p_WC.js} +1 -1
- streamlit/static/static/js/{index.DeGjj5Xy.js → index.CFCBhOfx.js} +1 -1
- streamlit/static/static/js/{index.DredtYc0.js → index.CIbgt5wY.js} +1 -1
- streamlit/static/static/js/{index.CD8IIWcc.js → index.CJ4oJe0V.js} +1 -1
- streamlit/static/static/js/{index.6_D2Y2jA.js → index.CP-hoxJM.js} +1 -1
- streamlit/static/static/js/{index.BXCQzqUL.js → index.CSfsEKCF.js} +1 -1
- streamlit/static/static/js/{index.C8PH2B2k.js → index.CVlg41MB.js} +1 -1
- streamlit/static/static/js/{index.BVit6ClT.js → index.CYE7b5Du.js} +1 -1
- streamlit/static/static/js/{index.DKUtJ1wC.js → index.Ca7MUNWJ.js} +1 -1
- streamlit/static/static/js/index.CrPjcPY1.js +1 -0
- streamlit/static/static/js/{index.BMPclSge.js → index.CvB9JBqS.js} +5 -5
- streamlit/static/static/js/{index.BCCeRfnu.js → index.CvIqsWy1.js} +1 -1
- streamlit/static/static/js/{index.wLJVkoPD.js → index.D1pK_Vw2.js} +1 -1
- streamlit/static/static/js/{index.B0GsKOuI.js → index.D6X2coHR.js} +1 -1
- streamlit/static/static/js/{index.B4x2O71H.js → index.DGYHxruh.js} +1 -1
- streamlit/static/static/js/{index.DcKOiCiE.js → index.DJ7P09eb.js} +1 -1
- streamlit/static/static/js/{index.CcHnYd9w.js → index.Dh5SAThV.js} +1 -1
- streamlit/static/static/js/{index.BFopzcDu.js → index.Fu73QtkD.js} +1 -1
- streamlit/static/static/js/{index.CIlqaESj.js → index.KN1VmyYN.js} +1 -1
- streamlit/static/static/js/{index.B9DrCSR6.js → index.KtjGDGY5.js} +1 -1
- streamlit/static/static/js/{index.DLB_Wwth.js → index.OpATzEaW.js} +1 -1
- streamlit/static/static/js/{index.CcJEaOpw.js → index.QHnxuesF.js} +1 -1
- streamlit/static/static/js/{index.1djeb6e0.js → index.QTaWooav.js} +1 -1
- streamlit/static/static/js/{index.BgVtKHgk.js → index.WXybx2Xq.js} +1 -1
- streamlit/static/static/js/{index.DtGneC7j.js → index.Xg-Qttib.js} +1 -1
- streamlit/static/static/js/{index.Dewn3Ni9.js → index.j4fnjyHo.js} +1 -1
- streamlit/static/static/js/{index.CAobVzMK.js → index.na9UBuse.js} +1 -1
- streamlit/static/static/js/{index.D2v1x0i_.js → index.pU9mQeVC.js} +1 -1
- streamlit/static/static/js/{index.DbTMA1_Q.js → index.slgxPafU.js} +1 -1
- streamlit/static/static/js/{index.DozBVd6-.js → index.whRT3Vm3.js} +1 -1
- streamlit/static/static/js/{input.27t-DftI.js → input.CPzINTl-.js} +1 -1
- streamlit/static/static/js/{main.BEfv2Y8-.js → main.DSPn8dUe.js} +1 -1
- streamlit/static/static/js/{memory.CaZBVQ_1.js → memory.CfD8IGoU.js} +1 -1
- streamlit/static/static/js/{number-overlay-editor.CAIp-3oo.js → number-overlay-editor.4Ae0qegV.js} +1 -1
- streamlit/static/static/js/{pandasStylerUtils.BY9qaz81.js → pandasStylerUtils.D2EjZ7k6.js} +1 -1
- streamlit/static/static/js/{sandbox.BJUaaWFJ.js → sandbox.C6vcPIm0.js} +1 -1
- streamlit/static/static/js/{styled-components.DQsMkvXn.js → styled-components.BBmp8buj.js} +1 -1
- streamlit/static/static/js/{throttle.DSR3q89S.js → throttle.BPcPpy-S.js} +1 -1
- streamlit/static/static/js/{timepicker.gie5YwtP.js → timepicker.ryzkTs2C.js} +1 -1
- streamlit/static/static/js/{toConsumableArray.C9lVwnAo.js → toConsumableArray.Dg1nDaB_.js} +1 -1
- streamlit/static/static/js/uniqueId.BFHzT5KQ.js +1 -0
- streamlit/static/static/js/{useBasicWidgetState.DrTKs46R.js → useBasicWidgetState.A4U5lzAm.js} +1 -1
- streamlit/static/static/js/{useIntlLocale.CmSionuT.js → useIntlLocale.DWJgLlNz.js} +1 -1
- streamlit/static/static/js/{useTextInputAutoExpand.D7lViJSu.js → useTextInputAutoExpand.BrBonw8t.js} +1 -1
- streamlit/static/static/js/{useUpdateUiValue.Ct3CJQBQ.js → useUpdateUiValue.BkOWyNVX.js} +1 -1
- streamlit/static/static/js/{useWaveformController.D-KQLpLI.js → useWaveformController.CBlvXlgZ.js} +1 -1
- streamlit/static/static/js/{withCalculatedWidth.CD0pPoZr.js → withCalculatedWidth.D4cpOyNe.js} +1 -1
- streamlit/static/static/js/{withFullScreenWrapper.Ch22PgdD.js → withFullScreenWrapper.BMim3w94.js} +1 -1
- streamlit/testing/v1/app_test.py +1 -1
- streamlit/user_info.py +6 -4
- streamlit/web/server/browser_websocket_handler.py +2 -2
- streamlit/web/server/oauth_authlib_routes.py +97 -20
- streamlit/web/server/starlette/starlette_routes.py +1 -3
- streamlit/web/server/stats_request_handler.py +1 -3
- {streamlit_nightly-1.52.3.dev20260111.dist-info → streamlit_nightly-1.52.3.dev20260113.dist-info}/METADATA +1 -1
- {streamlit_nightly-1.52.3.dev20260111.dist-info → streamlit_nightly-1.52.3.dev20260113.dist-info}/RECORD +211 -211
- streamlit/static/static/js/index.i_eQw7NS.js +0 -1
- streamlit/static/static/js/uniqueId.BdEQNrWF.js +0 -1
- {streamlit_nightly-1.52.3.dev20260111.data → streamlit_nightly-1.52.3.dev20260113.data}/scripts/streamlit.cmd +0 -0
- {streamlit_nightly-1.52.3.dev20260111.dist-info → streamlit_nightly-1.52.3.dev20260113.dist-info}/WHEEL +0 -0
- {streamlit_nightly-1.52.3.dev20260111.dist-info → streamlit_nightly-1.52.3.dev20260113.dist-info}/entry_points.txt +0 -0
- {streamlit_nightly-1.52.3.dev20260111.dist-info → streamlit_nightly-1.52.3.dev20260113.dist-info}/top_level.txt +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r,E as y,_ as x,W as te,F as m,aj as St,ct as b,cu as Rt,o as E,j as a,P as it,az as z,aA as st,a0 as W,b as ee,B as re,Z as At,bX as oe,l as ne,k as ae,b8 as ie,cv as se,e as tt,bS as It,bT as le,ab as ce}from"./index.01VsD2h1.js";import{I as de,g as zt,F as j,E as ot,b as ue,s as pe,u as ge,a as fe}from"./FileHelper.Pf8URFng.js";import{u as he}from"./useWaveformController.D-KQLpLI.js";import{I as we}from"./InputInstructions.BiaGyIXk.js";import{u as me,T as Vt}from"./useTextInputAutoExpand.D7lViJSu.js";import{i as ve}from"./inputUtils.CptNuJwn.js";import{T as Ce}from"./TableChart.esm.MOwyTUPh.js";import{E as ye}from"./ErrorOutline.esm.D0HiUB0L.js";import{U as Mt}from"./UploadFileInfo.Dr-zDST7.js";import"./base-input.CHPo5oJ1.js";var Dt=r.forwardRef(function(t,e){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return r.createElement(y,x({iconAttrs:o,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},t,{ref:e}),r.createElement("rect",{width:24,height:24,fill:"none"}),r.createElement("path",{d:"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"}),r.createElement("path",{d:"M14 17H7v-2h7v2zm3-4H7v-2h10v2zm0-4H7V7h10v2z"}))});Dt.displayName="Article";var Ft=r.forwardRef(function(t,e){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return r.createElement(y,x({iconAttrs:o,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},t,{ref:e}),r.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),r.createElement("path",{d:"M9.4 16.6L4.8 12l4.6-4.6L8 6l-6 6 6 6 1.4-1.4zm5.2 0l4.6-4.6-4.6-4.6L16 6l6 6-6 6-1.4-1.4z"}))});Ft.displayName="Code";var Tt=r.forwardRef(function(t,e){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return r.createElement(y,x({iconAttrs:o,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},t,{ref:e}),r.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),r.createElement("path",{d:"M8 16h8v2H8zm0-4h8v2H8zm6-10H6c-1.1 0-2 .9-2 2v16c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6zm4 18H6V4h7v5h5v11z"}))});Tt.displayName="Description";var Ut=r.forwardRef(function(t,e){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return r.createElement(y,x({iconAttrs:o,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},t,{ref:e}),r.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),r.createElement("path",{d:"M9.17 6l2 2H20v10H4V6h5.17M10 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2h-8l-2-2z"}))});Ut.displayName="Folder";var Ht=r.forwardRef(function(t,e){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return r.createElement(y,x({iconAttrs:o,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},t,{ref:e}),r.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),r.createElement("path",{d:"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-4.86 8.86l-3 3.87L9 13.14 6 17h12l-3.86-5.14z"}))});Ht.displayName="Image";var Bt=r.forwardRef(function(t,e){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return r.createElement(y,x({iconAttrs:o,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},t,{ref:e}),r.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),r.createElement("path",{d:"M12 3l.01 10.55c-.59-.34-1.27-.55-2-.55a4.001 4.001 0 100 8c2.22 0 3.99-1.79 3.99-4V7h4V3h-6zm-1.99 16c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2z"}))});Bt.displayName="MusicNote";var Nt=r.forwardRef(function(t,e){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return r.createElement(y,x({iconAttrs:o,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},t,{ref:e}),r.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),r.createElement("path",{d:"M15 8v8H5V8h10m1-2H4c-.55 0-1 .45-1 1v10c0 .55.45 1 1 1h12c.55 0 1-.45 1-1v-3.5l4 4v-11l-4 4V7c0-.55-.45-1-1-1z"}))});Nt.displayName="Videocam";var Lt=r.forwardRef(function(t,e){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return r.createElement(y,x({iconAttrs:o,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},t,{ref:e}),r.createElement("rect",{width:24,height:24,fill:"none"}),r.createElement("path",{d:"M18 13h-5v5c0 .55-.45 1-1 1s-1-.45-1-1v-5H6c-.55 0-1-.45-1-1s.45-1 1-1h5V6c0-.55.45-1 1-1s1 .45 1 1v5h5c.55 0 1 .45 1 1s-.45 1-1 1z"}))});Lt.displayName="Add";var nt=r.forwardRef(function(t,e){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return r.createElement(y,x({iconAttrs:o,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},t,{ref:e}),r.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),r.createElement("path",{d:"M13 19V7.83l4.88 4.88c.39.39 1.03.39 1.42 0a.996.996 0 000-1.41l-6.59-6.59a.996.996 0 00-1.41 0l-6.6 6.58a.996.996 0 101.41 1.41L11 7.83V19c0 .55.45 1 1 1s1-.45 1-1z"}))});nt.displayName="ArrowUpward";var Pt=r.forwardRef(function(t,e){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return r.createElement(y,x({iconAttrs:o,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},t,{ref:e}),r.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),r.createElement("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm4.29 12.89a.996.996 0 11-1.41 1.41L12 13.41 9.11 16.3a.996.996 0 11-1.41-1.41L10.59 12 7.71 9.11A.996.996 0 119.12 7.7L12 10.59l2.89-2.89a.996.996 0 111.41 1.41L13.41 12l2.88 2.89z"}))});Pt.displayName="Cancel";var Wt=r.forwardRef(function(t,e){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return r.createElement(y,x({iconAttrs:o,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},t,{ref:e}),r.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),r.createElement("path",{d:"M18 6.7l-8.48 8.48-3.54-3.54a.996.996 0 10-1.41 1.41l4.24 4.24c.39.39 1.02.39 1.41 0l9.18-9.18a.999.999 0 00-.01-1.42c-.37-.38-1-.38-1.39.01z"}))});Wt.displayName="Check";var Ot=r.forwardRef(function(t,e){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return r.createElement(y,x({iconAttrs:o,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},t,{ref:e}),r.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),r.createElement("path",{d:"M18.3 5.71a.996.996 0 00-1.41 0L12 10.59 7.11 5.7A.996.996 0 105.7 7.11L10.59 12 5.7 16.89a.996.996 0 101.41 1.41L12 13.41l4.89 4.89a.996.996 0 101.41-1.41L13.41 12l4.89-4.89c.38-.38.38-1.02 0-1.4z"}))});Ot.displayName="Close";var $t=r.forwardRef(function(t,e){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return r.createElement(y,x({iconAttrs:o,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},t,{ref:e}),r.createElement("rect",{width:24,height:24,fill:"none"}),r.createElement("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 11c-.55 0-1-.45-1-1V8c0-.55.45-1 1-1s1 .45 1 1v4c0 .55-.45 1-1 1zm0 4c-.55 0-1-.45-1-1s.45-1 1-1 1 .45 1 1-.45 1-1 1z"}))});$t.displayName="ErrorOutline";var Xt=r.forwardRef(function(t,e){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return r.createElement(y,x({iconAttrs:o,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},t,{ref:e}),r.createElement("rect",{width:24,height:24,fill:"none"}),r.createElement("path",{d:"M12 14c1.66 0 3-1.34 3-3V5c0-1.66-1.34-3-3-3S9 3.34 9 5v6c0 1.66 1.34 3 3 3z"}),r.createElement("path",{d:"M17.91 11c-.49 0-.9.36-.98.85C16.52 14.21 14.47 16 12 16s-4.52-1.79-4.93-4.15a.998.998 0 00-.98-.85c-.61 0-1.09.54-1 1.14.49 3 2.89 5.34 5.91 5.78V20c0 .55.45 1 1 1s1-.45 1-1v-2.08c3.02-.44 5.42-2.78 5.91-5.78.1-.6-.39-1.14-1-1.14z"}))});Xt.displayName="Mic";const X=te.getLogger("ChatInput"),xe=m("div",{target:"e1ek8sgn0"})({position:"relative",display:"flex",flexDirection:"column"}),be=m("div",{target:"e1ek8sgn1"})(({theme:t})=>({backgroundColor:t.colors.secondaryBg,border:`${t.sizes.borderWidth} solid`,borderColor:t.colors.widgetBorderColor??t.colors.transparent,position:"relative",display:"flex",flexDirection:"column",alignItems:"stretch",flex:1,padding:t.spacing.lg,borderRadius:t.radii.default,boxSizing:"border-box",":focus-within":{borderColor:t.colors.primary}})),Ee=m("div",{target:"e1ek8sgn2"})(({theme:t})=>({position:"relative",display:"flex",flexDirection:"column",gap:t.spacing.sm})),Se=m("div",{target:"e1ek8sgn3"})({position:"relative",display:"flex",flexDirection:"column"}),Ie=m("div",{target:"e1ek8sgn4"})(({theme:t})=>({display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",width:"100%",gap:t.spacing.sm})),ze=m("div",{target:"e1ek8sgn5"})(({theme:t})=>({display:"flex",flexDirection:"row",alignItems:"flex-end",width:"100%",marginTop:"auto",gap:t.spacing.lg})),Ve=m("div",{target:"e1ek8sgn6"})(({theme:t})=>({display:"flex",flexDirection:"row",flex:"1 0 0",gap:t.spacing.sm,alignItems:"center"})),ke=m("div",{target:"e1ek8sgn7"})(({theme:t})=>({display:"flex",flexDirection:"row",gap:t.spacing.sm,alignItems:"center",position:"relative"})),Re=m("div",{target:"e1ek8sgn8"})(({theme:t})=>({position:"absolute",top:t.spacing.twoXS,right:t.spacing.lg,color:t.colors.fadedText60,fontSize:t.fontSizes.twoSm,textAlign:"right",whiteSpace:"nowrap",pointerEvents:"auto",cursor:"text",zIndex:t.zIndices.priority,"& .stChatInputInstructions":{position:"static"}})),F=m("button",{target:"e1ek8sgn9"})(({theme:t,disabled:e,hasError:o,primary:l,withVerticalOffset:c})=>{if(l)return{border:"none",backgroundColor:e?t.colors.darkenedBgMix15:t.colors.primary,borderRadius:t.radii.button,display:"inline-flex",alignItems:"center",justifyContent:"center",lineHeight:t.lineHeights.none,margin:t.spacing.none,marginBottom:c?t.sizes.chatInputButtonVerticalOffset:void 0,padding:t.spacing.xs,width:t.sizes.chatInputPrimaryButtonSize,height:t.sizes.chatInputPrimaryButtonSize,color:e?t.colors.fadedText40:t.colors.white,cursor:e?"not-allowed":"pointer",transition:"background-color 200ms ease","&:focus":{outline:"none"},":focus":{outline:"none"},"&:focus-visible":{boxShadow:St(t)},"&:hover":{backgroundColor:e?t.colors.darkenedBgMix15:t.colors.primary}};const f=()=>o?t.colors.redTextColor:e?t.colors.fadedText40:t.colors.fadedText60;return{border:"none",backgroundColor:t.colors.transparent,borderRadius:t.radii.default,display:"inline-flex",alignItems:"center",justifyContent:"center",lineHeight:t.lineHeights.none,margin:t.spacing.none,padding:t.spacing.none,color:f(),pointerEvents:"auto","&:focus":{outline:"none"},":focus":{outline:"none"},"&:focus-visible":{boxShadow:St(t)},"&:hover":{color:o?t.colors.redColor:t.colors.bodyText},"&:active":{color:t.colors.primary},"&:disabled, &:disabled:hover, &:disabled:active":{backgroundColor:t.colors.transparent,borderColor:t.colors.transparent,color:t.colors.fadedText40,cursor:"not-allowed"},"& svg":{width:t.iconSizes.lg,height:t.iconSizes.lg}}}),Ae=m("div",{target:"e1ek8sgn10"})(({isRecording:t})=>({display:t?"flex":"none",flex:1,alignItems:"center",minWidth:0})),Me=m("div",{target:"e1ek8sgn11"})(({theme:t})=>({position:"relative",width:"100%",minHeight:t.sizes.minElementHeight,borderRadius:t.radii.default,overflow:"hidden","& > div":{position:"absolute",inset:0}})),jt=(t,e)=>e===b.Directory?{...t,webkitdirectory:"",multiple:!0}:t,De=(t,e)=>{if(!e||e.length===0)return!0;const o=t.name.toLowerCase(),l=o.lastIndexOf(".");if(l===-1||l===o.length-1)return e.some(d=>d===""||d===".");const c=o.substring(l),f=o.substring(l+1);return e.some(d=>{const v=d.toLowerCase();return v.startsWith(".")?c===v:f===v})},Fe=(t,e)=>De(t,e)?{isValid:!0}:{isValid:!1,errorMessage:`${t.type||"This type of"} files are not allowed.`},at=t=>{switch(t){case b.None:return"a file";case b.Single:return"a file";case b.Multiple:return"files";case b.Directory:return"a directory";default:return Rt(t),"a file"}},Te=m("div",{target:"e8ata110"})(({theme:t})=>({backgroundColor:t.colors.transparent,position:"absolute",inset:0,zIndex:t.zIndices.priority,borderRadius:t.radii.chatInput})),Ue=m("div",{target:"e8ata111"})(({theme:t})=>({position:"absolute",inset:0,border:`${t.sizes.borderWidth} solid`,borderColor:t.colors.primary,borderRadius:t.radii.chatInput,backgroundColor:t.colors.secondaryBg,color:t.colors.primary,display:"flex",alignItems:"center",justifyContent:"center",fontWeight:t.fontWeights.bold,pointerEvents:"none",zIndex:t.zIndices.priority})),He=m("div",{target:"e8ata112"})(({disabled:t})=>({pointerEvents:t?"none":"auto"})),Be=m("div",{target:"e8ata113"})(({theme:t})=>({lineHeight:t.lineHeights.tight})),Ne=m("div",{target:"e8ata114"})(({theme:t})=>({display:"flex",flexWrap:"wrap",gap:t.spacing.sm})),Le=m("div",{target:"e8ata115"})({flex:"0 0 auto",maxWidth:"100%"}),Pe=m("div",{target:"e8ata116"})(({theme:t,isError:e,isClickable:o})=>({position:"relative",display:"inline-flex",alignItems:"center",width:"fit-content",minWidth:"9rem",maxWidth:"100%",backgroundColor:e?t.colors.redBackgroundColor:t.colors.bgColor,padding:t.spacing.twoXS,paddingRight:t.spacing.twoXL,borderRadius:t.radii.default,gap:t.spacing.sm,cursor:o?"pointer":"default"})),We=m("div",{target:"e8ata117"})({display:"flex",flexDirection:"column",minWidth:0}),Oe=m("div",{target:"e8ata118"})(({theme:t,fileStatus:e})=>({display:"flex",alignItems:"center",justifyContent:"center",borderRadius:t.radii.default,width:t.sizes.chatInputFileIconSize,height:t.sizes.chatInputFileIconSize,flexShrink:0,...e==="uploaded"&&{backgroundColor:t.colors.bodyText,color:t.colors.bgColor},...e==="uploading"&&{backgroundColor:t.colors.fadedText10,color:t.colors.fadedText60},...e==="error"&&{backgroundColor:t.colors.redBackgroundColor,color:t.colors.redTextColor}})),$e=m("div",{target:"e8ata119"})(({theme:t,fileStatus:e})=>({overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:e.type==="uploading"?t.colors.fadedText60:t.colors.bodyText})),Xe=m("div",{target:"e8ata1110"})(({theme:t})=>({color:t.colors.fadedText60,fontSize:t.fontSizes.sm})),je=m("small",{target:"e8ata1111"})(({theme:t})=>({position:"absolute",top:t.spacing.twoXS,right:t.spacing.twoXS,display:"flex",alignItems:"center",justifyContent:"center",lineHeight:0,"& button":{display:"flex",alignItems:"center",justifyContent:"center",width:"fit-content",height:"fit-content",minHeight:"unset",minWidth:"unset",maxHeight:"unset",maxWidth:"unset",borderRadius:"50%",backgroundColor:"transparent",color:t.colors.fadedText20,padding:0,overflow:"hidden",boxSizing:"border-box",lineHeight:0,"&:hover":{backgroundColor:"transparent",color:t.colors.fadedText40}}})),_e=m("span",{target:"e8ata1112"})({position:"absolute",width:"1px",height:"1px",padding:0,margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",border:0}),Ke=({getRootProps:t,getInputProps:e,acceptFile:o,disabled:l})=>{const c=jt(e(),o),f=t({tabIndex:-1});return E(He,{"data-testid":"stChatInputFileUploadButton",disabled:l,...f,children:[a("input",{...c}),a(st,{content:`Upload or drag and drop ${at(o)}`,placement:it.TOP,onMouseEnterDelay:500,children:a(F,{disabled:l,"aria-label":`Upload ${at(o)}`,children:a(z,{content:Lt,size:"xl",color:"inherit"})})})]})},Ge=r.memo(Ke),Ye=({getRootProps:t,getInputProps:e,acceptFile:o})=>{const l=jt(e(),o);return E(W,{children:[a(Te,{...t(),children:a("input",{...l})}),a(Ue,{children:`Drag and drop ${at(o)} here`})]})},qe=r.memo(Ye),Ze=new Set(["jpg","jpeg","png","gif","webp","svg","bmp"]),Je=new Set(["pdf"]),Qe=new Set(["csv","tsv","xlsx","xls"]),tr=new Set(["txt","md","json","xml","yaml","yml"]),er=new Set(["py","js","ts","jsx","tsx","css","html","java","cpp","c","go","rs","rb","php","swift","kt","scala","sh","bash","sql"]),rr=new Set(["mp3","wav","m4a","ogg","flac","aac"]),or=new Set(["mp4","webm","mov","avi","mkv","wmv"]),nr=new Set(["zip","tar","gz","rar","7z","bz2"]);function ar(t){const e=t.lastIndexOf(".");return e===-1||e===t.length-1?"":t.slice(e+1).toLowerCase()}function ir(t){const e=ar(t);return Ze.has(e)?Ht:Je.has(e)?Dt:Qe.has(e)?Ce:tr.has(e)?Tt:er.has(e)?Ft:rr.has(e)?Bt:or.has(e)?Nt:nr.has(e)?Ut:de}const sr=36;function lr(t,e=sr){if(t.length<=e)return t;const o=t.lastIndexOf(".");if(!(o>0&&o<t.length-1)){const h=Math.floor((e-3)/2),g=h>0?t.slice(-h):"";return`${t.slice(0,h)}...${g}`}const c=t.slice(o),f=t.slice(0,o),d=e-c.length-3;if(d<=0){const h=Math.floor((e-3)/2),g=h>0?t.slice(-h):"";return`${t.slice(0,h)}...${g}`}const v=Math.ceil(d/2),C=Math.floor(d/2),u=C>0?f.slice(-C):"";return`${f.slice(0,v)}...${u}${c}`}const cr=({fileInfo:t})=>{const{type:e}=t.status;switch(e){case"uploading":return a(At,{iconValue:"spinner",testid:"stChatInputFileIconSpinner",size:"lg"});case"error":return a(z,{content:ye,size:"lg",testid:"stChatInputFileIconError"});case"uploaded":return a(z,{content:ir(t.name),size:"lg"});default:return Rt(e),null}},dr=({fileInfo:t,onDelete:e,onRetry:o})=>{const l=t.status.type,c=l==="error",f=l==="uploading",d=c&&o!==void 0&&t.file!==void 0,v=r.useId(),C=t.status.type==="error"?t.status.errorMessage:"Upload failed",u=r.useCallback(()=>{d&&o(t)},[d,o,t]),h=r.useCallback(k=>{d&&(k.key==="Enter"||k.key===" ")&&(k.preventDefault(),o(t))},[d,o,t]),g=r.useCallback(k=>{k.stopPropagation(),e(t.id)},[e,t.id]),w=f?`Cancel upload of ${t.name}`:`Remove ${t.name}`,U=zt(t.size,j.Byte),_=`${t.name}, ${U}`,H=E(Pe,{className:"stChatInputFile","data-testid":"stChatInputFile",isError:c,isClickable:d,onClick:d?u:void 0,onKeyDown:d?h:void 0,title:d?"Click to retry upload":void 0,role:d?"button":void 0,tabIndex:d?0:void 0,"aria-label":_,"aria-invalid":c||void 0,"aria-describedby":c?v:void 0,children:[a(Oe,{fileStatus:l,children:a(cr,{fileInfo:t})}),E(We,{children:[a($e,{className:"stChatInputFileName","data-testid":"stChatInputFileName",title:t.name,fileStatus:t.status,children:lr(t.name)}),a(Xe,{children:zt(t.size,j.Byte)})]}),a(je,{"data-testid":"stChatInputDeleteBtn",children:a(ee,{onClick:g,kind:re.MINIMAL,"aria-label":w,children:a(z,{content:Pt,size:"md"})})}),c&&E(_e,{id:v,role:"alert",children:["Error: ",C]})]});return c?a(st,{content:C,placement:it.TOP,error:!0,children:H}):H},ur=r.memo(dr),pr=({items:t,onDelete:e,onRetry:o})=>a(Be,{"data-testid":"stChatUploadedFiles",children:a(Ne,{children:t.map(l=>a(Le,{children:a(ur,{fileInfo:l,onDelete:e,onRetry:o})},l.id))})}),gr=r.memo(pr),fr=(t,e,o)=>{const l=[],c=[];return t.forEach(f=>{if(f.size>o){c.push({file:f,errors:[{code:ot.FileTooLarge,message:`File is too large. Maximum size is ${o} bytes.`}]});return}const d=Fe(f,e.fileType);if(!d.isValid){c.push({file:f,errors:[{code:ot.FileInvalidType,message:d.errorMessage||"File type not allowed."}]});return}l.push(f)}),{accepted:l,rejected:c}},hr=({acceptMultipleFiles:t,maxFileSize:e,uploadClient:o,uploadFile:l,addFiles:c,getNextLocalFileId:f,deleteExistingFiles:d,onUploadComplete:v,element:C})=>(u,h)=>{if(u.length>0){const{accepted:g,rejected:w}=fr(u,C,e);u=g,h=[...h,...w]}if(!t&&u.length===0&&h.length>1){const g=h.findIndex(w=>w.errors?.[0].code===ot.TooManyFiles);g>=0&&(u.push(h[g].file),h.splice(g,1))}if(!t&&u.length>0&&d(),o.fetchFileURLs(u).then(g=>{oe(g,u).forEach(([w,U])=>{l(w,U)})}).catch(g=>{c(u.map(w=>new Mt(w.name,w.size,f(),{type:"error",errorMessage:g},w)))}),h.length>0){const g=h.map(w=>ue(w,f(),e));c(g)}v()},wr=({getNextLocalFileId:t,addFiles:e,updateFile:o,uploadClient:l,element:c,onUploadProgress:f,onUploadComplete:d})=>(v,C)=>{const u=C.webkitRelativePath||C.name,h=new AbortController,g=new Mt(u,C.size,t(),{type:"uploading",abortController:h,progress:1},C);e([g]),l.uploadFile({formId:"",...c},v.uploadUrl,C,w=>f(w,g.id),h.signal).then(()=>d(g.id,v)).catch(w=>{w instanceof DOMException&&w.name==="AbortError"||o(g.id,g.setStatus({type:"error",errorMessage:w?w.toString():"Unknown error"}))})};function kt(t,e,o){return{Root:{style:{minHeight:t.sizes.chatInputTextareaMinHeight,outline:"none",borderLeftWidth:"0",borderRightWidth:"0",borderTopWidth:"0",borderBottomWidth:"0",borderTopLeftRadius:"0",borderTopRightRadius:"0",borderBottomRightRadius:"0",borderBottomLeftRadius:"0",...o}},Input:{props:{"data-testid":"stChatInputTextArea"},style:{fontWeight:t.fontWeights.normal,lineHeight:t.lineHeights.inputWidget,"::placeholder":{color:t.colors.fadedText60},height:e.height,maxHeight:e.maxHeight,overflowY:"auto",paddingLeft:t.spacing.none,paddingRight:t.spacing.none,paddingBottom:t.spacing.sm,paddingTop:t.spacing.sm,width:"100%"}}}}const et=(t,e,o)=>o.map(l=>l.id===t?e:l),rt=(t,e)=>e.find(o=>o.id===t);function mr({disabled:t,element:e,widgetMgr:o,fragmentId:l,uploadClient:c}){const f=ne(),{placeholder:d,maxChars:v}=e,C=r.useRef(0),u=r.useRef(null),h=r.useRef(!1),g=r.useRef(null),w=r.useRef(null),{width:U,elementRef:_}=ae(),{innerWidth:H,innerHeight:k}=ie(),[A,K]=r.useState(e.default),[R,M]=r.useState([]),[B,G]=r.useState(!1),[N,lt]=r.useState(!1),[Y,L]=r.useState(null),O=e.acceptAudio??!1;r.useEffect(()=>()=>{w.current&&w.current.abort()},[]);const T=me({textareaRef:u,dependencies:[d]}),P=r.useMemo(()=>R.some(n=>n.status.type==="uploading")?!1:A!==""||R.length>0,[R,A]),I=se(e.acceptFile),ct=pe(e.maxUploadSizeMb,j.Megabyte,j.Byte),dt=r.useCallback(n=>M(s=>[...s,...n]),[]),ut=r.useCallback(n=>{n.status.type==="uploading"&&n.status.abortController.abort(),n.status.type==="uploaded"&&n.status.fileUrls.deleteUrl&&c.deleteFile(n.status.fileUrls.deleteUrl).catch(s=>{X.error("Failed to delete file from server:",s)})},[c]),pt=r.useCallback(n=>{M(s=>{const p=rt(n,s);return tt(p)?s:(ut(p),s.filter(i=>i.id!==n))})},[ut]),q=r.useRef(null),_t=r.useCallback(n=>{!n.file||n.status.type!=="error"||(M(s=>s.filter(p=>p.id!==n.id)),q.current&&q.current([n.file],[]))},[]),gt=r.useCallback(()=>{const n=R.filter(s=>s.status.type==="uploaded").map(s=>{const{name:p,size:i,status:S}=s,{fileId:Q,fileUrls:Qt}=S;return new It({fileId:Q,fileUrls:Qt,name:p,size:i})});return new le({uploadedFileInfo:n})},[R]),ft=()=>C.current++,ht=hr({acceptMultipleFiles:I===b.Multiple||I===b.Directory,maxFileSize:ct,uploadClient:c,uploadFile:wr({getNextLocalFileId:ft,addFiles:dt,updateFile:(n,s)=>{M(p=>et(n,s,p))},uploadClient:c,element:e,onUploadProgress:(n,s)=>{M(p=>{const i=rt(s,p);if(tt(i)||i.status.type!=="uploading")return p;const S=Math.round(n.loaded*100/n.total);return i.status.progress===S?p:et(s,i.setStatus({type:"uploading",abortController:i.status.abortController,progress:S}),p)})},onUploadComplete:(n,s)=>{M(p=>{const i=rt(n,p);return tt(i)||i.status.type!=="uploading"?p:et(i.id,i.setStatus({type:"uploaded",fileId:s.fileId,fileUrls:s}),p)})}}),addFiles:dt,getNextLocalFileId:ft,deleteExistingFiles:()=>R.forEach(n=>pt(n.id)),onUploadComplete:()=>{u.current&&u.current.focus()},element:e});q.current=ht;const{getRootProps:wt,getInputProps:mt}=ge({onDrop:ht,multiple:I===b.Multiple||I===b.Directory,accept:fe(e.fileType),maxSize:ct}),$=r.useCallback(n=>{if(u.current&&u.current.focus(),!P&&!n||t)return;const s=gt(),p={data:A,fileUploaderState:s,audioFileInfo:n};o.setChatInputValue(e,p,{fromUi:!0},l),M([]),K(""),T.clearScrollHeight()},[P,t,A,gt,o,e,l,T]),vt=r.useCallback(async n=>{const s=new Date().toISOString().replace(/[:.]/g,"-"),p=new File([n],`audio-${s}.wav`,{type:"audio/wav"});try{lt(!0);const i=await c.fetchFileURLs([p]);if(i.length===0)throw new Error("Failed to get upload URL for audio file");const S=i[0];w.current=new AbortController,await c.uploadFile({formId:"",...e},S.uploadUrl,p,()=>{},w.current.signal);const Q=new It({fileId:S.fileId,fileUrls:S,name:p.name,size:p.size});$(Q)}catch(i){const S="Recording failed";X.error("Audio upload failed:",i),L(S),u.current&&u.current.focus()}finally{lt(!1)}},[c,e,$]),Kt=r.useMemo(()=>({onApprove:vt,onPermissionDenied:()=>{const n="Microphone access denied";L(n),X.error("Permission denied:",n)},onError:n=>{L("Recording failed"),X.error("Recording error:",n)},onRecordStart:()=>{L(null)}}),[vt]),V=he({containerRef:g,sampleRate:e.audioSampleRate??void 0,events:Kt}),Z=r.useCallback(()=>{$()},[$]),Ct=n=>{const{metaKey:s,ctrlKey:p,shiftKey:i}=n;ve(n)&&!i&&!p&&!s&&(n.preventDefault(),Z())},yt=n=>{const{value:s}=n.target;v!==0&&s.length>v||(K(s),T.updateScrollHeight(),Y&&L(null))},xt=r.useCallback(async n=>{n.preventDefault(),n.stopPropagation(),!(!O||t||V.state==="recording")&&await V.start()},[O,t,V]),Gt=r.useCallback(()=>{V.cancel(),u.current&&u.current.focus()},[V]),bt=r.useCallback(async()=>{const{blob:n}=await V.stop();await V.approve(n)},[V]),Et=r.useCallback(n=>{xt(n)},[xt]),Yt=r.useCallback(()=>{bt()},[bt]),qt=r.useCallback(()=>{u.current&&u.current.focus()},[]);r.useEffect(()=>{if(e.setValue&&!h.current){h.current=!0;const n=e.value||"";K(n)}},[e.setValue,e.value]),r.useEffect(()=>{h.current=!1},[e]),r.useEffect(()=>{const n=i=>{i.preventDefault(),i.stopPropagation(),!B&&i.dataTransfer?.types.includes("Files")&&G(!0)},s=i=>{i.preventDefault(),i.stopPropagation(),B&&(i.clientX<=0&&i.clientY<=0||i.clientX>=H&&i.clientY>=k)&&G(!1)},p=i=>{i.preventDefault(),i.stopPropagation(),B&&G(!1)};return window.addEventListener("dragover",n),window.addEventListener("drop",p),window.addEventListener("dragleave",s),()=>{window.removeEventListener("dragover",n),window.removeEventListener("drop",p),window.removeEventListener("dragleave",s)}},[B,H,k]);const Zt=I!==b.None&&B,D=V.state==="recording",Jt=I===b.None&&!O&&!D,J=!D&&U>ce(f.breakpoints.hideWidgetDetails)&&v>0;return a(xe,{className:"stChatInput","data-testid":"stChatInput",ref:_,children:E(be,{extended:T.isExtended||D,children:[J&&a(Re,{onClick:qt,id:"stChatInputInstructions",children:a(we,{dirty:P,value:A,maxLength:v,type:"chat",inForm:!1,className:"stChatInputInstructions"})}),Jt?E(ze,{children:[a(Vt,{inputRef:u,value:A,placeholder:d,onChange:yt,onKeyDown:Ct,"aria-label":d,disabled:t,rows:1,"aria-describedby":J?"stChatInputInstructions":void 0,overrides:kt(f,T,{flex:1})}),a(F,{onClick:Z,disabled:!P||t,"data-testid":"stChatInputSubmitButton","aria-label":"Send message",primary:!0,withVerticalOffset:!0,children:a(z,{content:nt,size:"lg",color:"inherit"})})]}):E(W,{children:[E(Ee,{children:[Zt&&a(qe,{getRootProps:wt,getInputProps:mt,acceptFile:I}),I!==b.None&&R.length>0&&a(gr,{items:[...R],onDelete:pt,onRetry:_t}),E(Se,{children:[a(Ae,{isRecording:D,children:a(Me,{ref:g})}),!D&&a(Vt,{inputRef:u,value:A,placeholder:d,onChange:yt,onKeyDown:Ct,"aria-label":d,disabled:t,rows:1,"aria-describedby":J?"stChatInputInstructions":void 0,overrides:kt(f,T,{width:"100%"})})]})]}),E(Ie,{children:[a(Ve,{children:I!==b.None&&!D&&a(Ge,{getRootProps:wt,getInputProps:mt,acceptFile:I,disabled:t})}),a(ke,{children:D?E(W,{children:[a(F,{onClick:Gt,disabled:t,"data-testid":"stChatInputCancelButton","aria-label":"Cancel recording",children:a(z,{content:Ot,size:"lg",color:"inherit"})}),a(F,{onClick:Yt,disabled:t||N,"data-testid":"stChatInputApproveButton","aria-label":"Submit recording",children:N?a(At,{size:"lg",iconValue:"spinner"}):a(z,{content:Wt,size:"lg",color:"inherit"})})]}):E(W,{children:[O&&a(W,{children:Y?a(st,{content:Y,placement:it.TOP,error:!0,children:a(F,{onClick:Et,disabled:t||N,hasError:!0,"data-testid":"stChatInputMicButton","aria-label":"Start recording",children:a(z,{content:$t,size:"xl",color:"inherit"})})}):a(F,{onClick:Et,disabled:t||N,"data-testid":"stChatInputMicButton","aria-label":"Start recording",children:a(z,{content:Xt,size:"xl",color:"inherit"})})}),a(F,{onClick:Z,disabled:!P||t||N,"data-testid":"stChatInputSubmitButton","aria-label":"Send message",primary:!0,children:a(z,{content:nt,size:"lg",color:"inherit"})})]})})]})]})]})})}const kr=r.memo(mr);export{kr as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{K as i}from"./index.01VsD2h1.js";var n=0;function u(r){var t=++n;return i(r)+t}export{u};
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|