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 +1 @@
|
|
|
1
|
-
import{get as O}from"./index.
|
|
1
|
+
import{get as O}from"./index.KN1VmyYN.js";import{M as P}from"./index.BRfGUOQ-.js";const s=[{description:"angry face",emoji:"😠",emoticons:[">:(",">:[",">:-(",">:-[",">=(",">=[",">=-(",">=-["],name:"angry",tags:["mad","annoyed"]},{description:"smiling face with smiling eyes",emoji:"😊",emoticons:[':")',':"]',':"D',':-")',':-"]',':-"D','=")','="]','="D','=-")','=-"]','=-"D'],name:"blush",tags:["proud"]},{description:"broken heart",emoji:"💔",emoticons:["<\\3","</3"],name:"broken_heart",tags:[]},{description:"confused face",emoji:"😕",emoticons:[":/",":\\",":-/",":-\\","=/","=\\","=-/","=-\\"],name:"confused",tags:[]},{description:"crying face",emoji:"😢",emoticons:[":,(",":,[",":,|",":,-(",":,-[",":,-|",":'(",":'[",":'|",":'-(",":'-[",":'-|","=,(","=,[","=,|","=,-(","=,-[","=,-|","='(","='[","='|","='-(","='-[","='-|","T-T"],name:"cry",tags:["sad","tear"]},{description:"frowning face with open mouth",emoji:"😦",emoticons:[":(",":[",":-(",":-[","=(","=[","=-(","=-["],name:"frowning",tags:[]},{description:"red heart",emoji:"❤️",emoticons:["<3"],name:"heart",tags:["love"]},{description:"angry face with horns",emoji:"👿",emoticons:["]:(","]:[","]:-(","]:-[","]=(","]=[","]=-(","]=-["],name:"imp",tags:["angry","devil","evil","horns"]},{description:"smiling face with halo",emoji:"😇",emoticons:["o:)","o:]","o:D","o:-)","o:-]","o:-D","o=)","o=]","o=D","o=-)","o=-]","o=-D","O:)","O:]","O:D","O:-)","O:-]","O:-D","O=)","O=]","O=D","O=-)","O=-]","O=-D","0:)","0:]","0:D","0:-)","0:-]","0:-D","0=)","0=]","0=D","0=-)","0=-]","0=-D"],name:"innocent",tags:["angel"]},{description:"face with tears of joy",emoji:"😂",emoticons:[":,)",":,]",":,D",":,-)",":,-]",":,-D",":')",":']",":'D",":'-)",":'-]",":'-D","=,)","=,]","=,D","=,-)","=,-]","=,-D","=')","=']","='D","='-)","='-]","='-D"],name:"joy",tags:["tears"]},{description:"kissing face",emoji:"😗",emoticons:[":*",":-*","=*","=-*"],name:"kissing",tags:[]},{description:"grinning squinting face",emoji:"😆",emoticons:["x)","x]","xD","x-)","x-]","x-D","X)","X]","X-)","X-]","X-D"],name:"laughing",tags:["happy","haha"]},{description:"man",emoji:"👨",emoticons:[":3",":-3","=3","=-3",";3",";-3","x3","x-3","X3","X-3"],name:"man",tags:["mustache","father","dad"]},{description:"neutral face",emoji:"😐",emoticons:[":|",":-|","=|","=-|"],name:"neutral_face",tags:["meh"]},{description:"face without mouth",emoji:"😶",emoticons:[":-"],name:"no_mouth",tags:["mute","silence"]},{description:"face with open mouth",emoji:"😮",emoticons:[":o",":O",":0",":-o",":-O",":-0","=o","=O","=0","=-o","=-O","=-0"],name:"open_mouth",tags:["surprise","impressed","wow"]},{description:"enraged face",emoji:"😡",emoticons:[":@",":-@","=@","=-@"],name:"rage",tags:["angry"]},{description:"grinning face with smiling eyes",emoji:"😄",emoticons:[":D",":-D","=D","=-D"],name:"smile",tags:["happy","joy","laugh","pleased"]},{description:"grinning face with big eyes",emoji:"😃",emoticons:[":)",":]",":-)",":-]","=)","=]","=-)","=-]"],name:"smiley",tags:["happy","joy","haha"]},{description:"smiling face with horns",emoji:"😈",emoticons:["]:)","]:]","]:D","]:-)","]:-]","]:-D","]=)","]=]","]=D","]=-)","]=-]","]=-D"],name:"smiling_imp",tags:["devil","evil","horns"]},{description:"loudly crying face",emoji:"😭",emoticons:[":,'(",":,'[",":,'-(",":,'-[",":',(",":',[",":',-(",":',-[","=,'(","=,'[","=,'-(","=,'-[","=',(","=',[","=',-(","=',-["],name:"sob",tags:["sad","cry","bawling"]},{description:"face with tongue",emoji:"😛",emoticons:[":p",":P",":d",":-p",":-P",":-d","=p","=P","=d","=-p","=-P","=-d"],name:"stuck_out_tongue",tags:[]},{description:"squinting face with tongue",emoji:"😝",emoticons:["xP","x-p","x-P","x-d","Xp","Xd","X-p","X-P","X-d"],name:"stuck_out_tongue_closed_eyes",tags:["prank"]},{description:"winking face with tongue",emoji:"😜",emoticons:[";p",";P",";d",";-p",";-P",";-d"],name:"stuck_out_tongue_winking_eye",tags:["prank","silly"]},{description:"smiling face with sunglasses",emoji:"😎",emoticons:["8)","8]","8D","8-)","8-]","8-D","B)","B]","B-)","B-]","B-D"],name:"sunglasses",tags:["cool"]},{description:"downcast face with sweat",emoji:"😓",emoticons:[",:(",",:[",",:-(",",:-[",",=(",",=[",",=-(",",=-[","':(","':[","':-(","':-[","'=(","'=[","'=-(","'=-["],name:"sweat",tags:[]},{description:"grinning face with sweat",emoji:"😅",emoticons:[",:)",",:]",",:D",",:-)",",:-]",",:-D",",=)",",=]",",=D",",=-)",",=-]",",=-D","':)","':]","':D","':-)","':-]","':-D","'=)","'=]","'=D","'=-)","'=-]","'=-D"],name:"sweat_smile",tags:["hot"]},{description:"unamused face",emoji:"😒",emoticons:[":$",":s",":z",":S",":Z",":-$",":-s",":-z",":-S",":-Z","=$","=s","=z","=S","=Z","=-$","=-s","=-z","=-S","=-Z"],name:"unamused",tags:["meh"]},{description:"winking face",emoji:"😉",emoticons:[";)",";]",";D",";-)",";-]",";-D"],name:"wink",tags:["flirt"]}],x=/:\+1:|:-1:|:[\w-]+:/g,b=/(^|\s)[@$|*'",;.=:\-)([\]\\/<>038BOopPsSdDxXzZ]{2,5}/g,k=/(?:_|-(?!1))/g,X={padSpaceAfter:!1,emoticon:!1,accessible:!1},T=f=>{const t=Object.assign({},X,f),r=!!t.padSpaceAfter,u=!!t.emoticon,g=!!t.accessible;function d(e,i){return{type:"text",value:e,data:{hName:"span",hProperties:{role:"img",ariaLabel:i},hChildren:[{type:"text",value:e}]}}}function D(e){const i=s.find(o=>o.emoticons.includes(e)),n=s.find(o=>o.emoticons.includes(e.slice(0,-1))),a=s.find(o=>o.emoticons.includes(e.slice(1))),c=s.find(o=>o.emoticons.includes(e.slice(1,-1))),m=i||n||a||c;if(!m)return!1;const w=!(i||a)&&(c||n)?e.slice(-1):"",y=!(i||n)&&(c||a)?e.slice(0,1):"",_=r?" ":"",l=y+m.emoji+_+w;return g?d(l,m.name+" emoticon"):l}function h(e){let i=O(e);if(typeof i>"u")return!1;if(r&&(i=i+" "),g){const n=e.slice(1,-1).replace(k," ")+" emoji";return d(i,n)}return i}const p=[[x,h]];u&&p.push([b,D]);function j(e){P(e,p)}return j};export{T as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r,E as S,_ as z,W as dt,F as m,aj as Re,cw as b,cu as Me,o as A,j as a,P as ue,az as V,aA as pe,a0 as K,b as ut,B as pt,Z as Te,bX as gt,l as ft,k as ht,b8 as mt,cx as wt,e as ie,bS as Ve,bT as vt,ab as Ct}from"./index.BRfGUOQ-.js";import{u as ke,I as yt,g as Ae,F as G,E as ce,b as xt,s as bt,a as Fe}from"./FileHelper.C---TH7o.js";import{u as St}from"./useWaveformController.CBlvXlgZ.js";import{I as zt}from"./InputInstructions.sxc3InCI.js";import{u as Et,T as It}from"./useTextInputAutoExpand.BrBonw8t.js";import{i as Rt}from"./inputUtils.CptNuJwn.js";import{T as Vt}from"./TableChart.esm.BdA4Q1rZ.js";import{E as At}from"./ErrorOutline.esm.BjVqd_6R.js";import{U as De}from"./UploadFileInfo.Dr-zDST7.js";import"./base-input.Gf1cKuQR.js";var Ue=r.forwardRef(function(e,t){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return r.createElement(S,z({iconAttrs:o,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),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"}))});Ue.displayName="Article";var He=r.forwardRef(function(e,t){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return r.createElement(S,z({iconAttrs:o,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),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"}))});He.displayName="Code";var Le=r.forwardRef(function(e,t){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return r.createElement(S,z({iconAttrs:o,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),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"}))});Le.displayName="Description";var Be=r.forwardRef(function(e,t){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return r.createElement(S,z({iconAttrs:o,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),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"}))});Be.displayName="Folder";var Ne=r.forwardRef(function(e,t){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return r.createElement(S,z({iconAttrs:o,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),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"}))});Ne.displayName="Image";var We=r.forwardRef(function(e,t){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return r.createElement(S,z({iconAttrs:o,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),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"}))});We.displayName="MusicNote";var Pe=r.forwardRef(function(e,t){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return r.createElement(S,z({iconAttrs:o,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),r.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),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 3zm-1-9c0-.55.45-1 1-1s1 .45 1 1v6c0 .55-.45 1-1 1s-1-.45-1-1V5zm6 6c0 2.76-2.24 5-5 5s-5-2.24-5-5H5c0 3.53 2.61 6.43 6 6.92V21h2v-3.08c3.39-.49 6-3.39 6-6.92h-2z"}))});Pe.displayName="MicNone";var Oe=r.forwardRef(function(e,t){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return r.createElement(S,z({iconAttrs:o,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),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"}))});Oe.displayName="Videocam";var $e=r.forwardRef(function(e,t){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return r.createElement(S,z({iconAttrs:o,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),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"}))});$e.displayName="Add";var Xe=r.forwardRef(function(e,t){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return r.createElement(S,z({iconAttrs:o,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),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"}))});Xe.displayName="ArrowUpward";var je=r.forwardRef(function(e,t){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return r.createElement(S,z({iconAttrs:o,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),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"}))});je.displayName="Cancel";var _e=r.forwardRef(function(e,t){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return r.createElement(S,z({iconAttrs:o,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),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"}))});_e.displayName="Check";var Ke=r.forwardRef(function(e,t){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return r.createElement(S,z({iconAttrs:o,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),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"}))});Ke.displayName="Close";var Ge=r.forwardRef(function(e,t){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return r.createElement(S,z({iconAttrs:o,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),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"}))});Ge.displayName="ErrorOutline";const _=dt.getLogger("ChatInput"),Ft=m("div",{target:"e5ztmp70"})({position:"relative",display:"flex",flexDirection:"column"}),Mt=m("div",{target:"e5ztmp71"})(({theme:e})=>({backgroundColor:e.colors.secondaryBg,border:`${e.sizes.borderWidth} solid`,borderColor:e.colors.widgetBorderColor??e.colors.transparent,position:"relative",display:"flex",flexDirection:"column",alignItems:"stretch",flex:1,paddingTop:e.spacing.md,paddingBottom:e.spacing.md,paddingLeft:e.spacing.lg,paddingRight:e.spacing.lg,gap:e.spacing.sm,borderRadius:e.radii.default,boxSizing:"border-box",":focus-within":{borderColor:e.colors.primary}})),Tt=m("div",{target:"e5ztmp72"})(({theme:e})=>({display:"flex",flexWrap:"wrap",gap:e.spacing.sm})),kt=m("div",{target:"e5ztmp73"})(({theme:e,isStacked:t})=>({display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",width:"100%",gap:e.spacing.sm,flexWrap:t?"wrap":"nowrap"})),Dt=m("div",{target:"e5ztmp74"})(({isStacked:e})=>({flex:e?"none":1,width:e?"100%":"auto",order:e?-1:0,display:"flex",alignItems:"center",minWidth:0})),Ut=m("div",{target:"e5ztmp75"})(({theme:e})=>({display:"flex",flexDirection:"row",flexShrink:0,gap:e.spacing.sm,alignItems:"center"})),Ht=m("div",{target:"e5ztmp76"})(({theme:e})=>({display:"flex",flexDirection:"row",gap:e.spacing.sm,alignItems:"center"})),Lt=m("div",{target:"e5ztmp77"})(({theme:e})=>({position:"absolute",top:e.spacing.twoXS,right:e.spacing.lg,color:e.colors.fadedText60,fontSize:e.fontSizes.twoSm,textAlign:"right",whiteSpace:"nowrap",pointerEvents:"auto",cursor:"text",zIndex:e.zIndices.priority,"& .stChatInputInstructions":{position:"static"}})),T=m("button",{target:"e5ztmp78"})(({theme:e,disabled:t,hasError:o,primary:p})=>{if(p)return{border:"none",backgroundColor:t?e.colors.darkenedBgMix15:e.colors.primary,borderRadius:e.radii.button,display:"inline-flex",alignItems:"center",justifyContent:"center",lineHeight:e.lineHeights.none,margin:e.spacing.none,padding:e.spacing.xs,width:e.sizes.chatInputPrimaryButtonSize,height:e.sizes.chatInputPrimaryButtonSize,color:t?e.colors.fadedText40:e.colors.white,cursor:t?"not-allowed":"pointer",transition:"background-color 200ms ease","&:focus":{outline:"none"},":focus":{outline:"none"},"&:focus-visible":{boxShadow:Re(e)},"&:hover":{backgroundColor:t?e.colors.darkenedBgMix15:e.colors.primary}};const l=()=>o?e.colors.redTextColor:t?e.colors.fadedText40:e.colors.fadedText60;return{border:"none",backgroundColor:e.colors.transparent,borderRadius:e.radii.default,display:"inline-flex",alignItems:"center",justifyContent:"center",lineHeight:e.lineHeights.none,margin:e.spacing.none,padding:e.spacing.none,color:l(),pointerEvents:"auto","&:focus":{outline:"none"},":focus":{outline:"none"},"&:focus-visible":{boxShadow:Re(e)},"&:hover":{color:o?e.colors.redColor:e.colors.bodyText},"&:active":{color:e.colors.primary},"&:disabled, &:disabled:hover, &:disabled:active":{backgroundColor:e.colors.transparent,borderColor:e.colors.transparent,color:e.colors.fadedText40,cursor:"not-allowed"},"& svg":{width:e.iconSizes.lg,height:e.iconSizes.lg}}}),Bt=m("div",{target:"e5ztmp79"})(({isRecording:e})=>({display:e?"flex":"none",flex:1,alignItems:"center",minWidth:0})),Nt=m("div",{target:"e5ztmp710"})(({theme:e})=>({position:"relative",width:"100%",height:e.sizes.chatInputPrimaryButtonSize,borderRadius:e.radii.default,overflow:"hidden","& > div":{position:"absolute",inset:0}})),Ye=(e,t)=>t===b.Directory?{...e,webkitdirectory:"",multiple:!0}:e,Wt=(e,t)=>{if(!t||t.length===0)return!0;const o=e.name.toLowerCase(),p=o.lastIndexOf(".");if(p===-1||p===o.length-1)return t.some(d=>d===""||d===".");const l=o.substring(p),w=o.substring(p+1);return t.some(d=>{const v=d.toLowerCase();return v.startsWith(".")?l===v:w===v})},Pt=(e,t)=>Wt(e,t)?{isValid:!0}:{isValid:!1,errorMessage:`${e.type||"This type of"} files are not allowed.`},de=e=>{switch(e){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 Me(e),"a file"}},Ot=m("div",{target:"e1p4ydfm0"})(({theme:e})=>({backgroundColor:e.colors.transparent,position:"absolute",inset:0,zIndex:e.zIndices.priority,borderRadius:e.radii.chatInput})),$t=m("div",{target:"e1p4ydfm1"})(({theme:e})=>({position:"absolute",inset:0,border:`${e.sizes.borderWidth} solid`,borderColor:e.colors.primary,borderRadius:e.radii.chatInput,backgroundColor:e.colors.secondaryBg,color:e.colors.primary,display:"flex",alignItems:"center",justifyContent:"center",fontWeight:e.fontWeights.bold,pointerEvents:"none",zIndex:e.zIndices.priority})),Xt=m("div",{target:"e1p4ydfm2"})(({disabled:e})=>({pointerEvents:e?"none":"auto"})),jt=m("div",{target:"e1p4ydfm3"})(({theme:e})=>({lineHeight:e.lineHeights.tight})),_t=m("div",{target:"e1p4ydfm4"})(({theme:e})=>({display:"flex",flexWrap:"wrap",gap:e.spacing.sm})),Kt=m("div",{target:"e1p4ydfm5"})({flex:"0 0 auto",maxWidth:"100%"}),Gt=m("div",{target:"e1p4ydfm6"})(({theme:e,isError:t,isClickable:o})=>({position:"relative",display:"inline-flex",alignItems:"center",width:"fit-content",minWidth:"9rem",maxWidth:"11rem",backgroundColor:t?e.colors.redBackgroundColor:e.colors.bgColor,padding:e.spacing.twoXS,paddingRight:e.spacing.twoXL,borderRadius:e.radii.default,gap:e.spacing.sm,cursor:o?"pointer":"default"})),Yt=m("div",{target:"e1p4ydfm7"})({display:"flex",flexDirection:"column",minWidth:0}),qt=m("div",{target:"e1p4ydfm8"})(({theme:e,fileStatus:t})=>({display:"flex",alignItems:"center",justifyContent:"center",borderRadius:e.radii.default,width:e.sizes.chatInputFileIconSize,height:e.sizes.chatInputFileIconSize,flexShrink:0,overflow:"hidden",...t==="uploaded"&&{backgroundColor:e.colors.bodyText,color:e.colors.bgColor},...t==="uploading"&&{backgroundColor:e.colors.fadedText10,color:e.colors.fadedText60},...t==="error"&&{backgroundColor:e.colors.redBackgroundColor,color:e.colors.redTextColor}})),Zt=m("img",{target:"e1p4ydfm9"})({width:"100%",height:"100%",objectFit:"cover"}),Jt=m("div",{target:"e1p4ydfm10"})(({theme:e,fileStatus:t})=>({overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:t.type==="uploading"?e.colors.fadedText60:e.colors.bodyText})),Qt=m("div",{target:"e1p4ydfm11"})(({theme:e})=>({color:e.colors.fadedText60,fontSize:e.fontSizes.sm})),er=m("small",{target:"e1p4ydfm12"})(({theme:e,isError:t})=>({position:"absolute",top:e.spacing.twoXS,right:e.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?e.colors.redTextColor:e.colors.fadedText60,padding:0,overflow:"hidden",boxSizing:"border-box",lineHeight:0,"&:hover":{backgroundColor:"transparent",color:t?e.colors.redColor:e.colors.bodyText}}})),tr=m("span",{target:"e1p4ydfm13"})({position:"absolute",width:"1px",height:"1px",padding:0,margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",border:0}),rr=({onDrop:e,multiple:t,accept:o,maxSize:p,acceptFile:l,disabled:w})=>{const{getRootProps:d,getInputProps:v}=ke({onDrop:e,multiple:t,accept:o,maxSize:p,useFsAccessApi:!1}),C=Ye(v(),l),c=d({tabIndex:-1});return A(Xt,{"data-testid":"stChatInputFileUploadButton",disabled:w,...c,children:[a("input",{...C}),a(pe,{content:`Upload or drag and drop ${de(l)}`,placement:ue.TOP,onMouseEnterDelay:500,children:a(T,{type:"button",disabled:w,"aria-label":`Upload ${de(l)}`,children:a(V,{content:$e,size:"xl",color:"inherit"})})})]})},or=r.memo(rr),nr=({getRootProps:e,getInputProps:t,acceptFile:o})=>{const p=Ye(t(),o);return A(K,{children:[a(Ot,{...e(),children:a("input",{...p})}),a($t,{children:`Drag and drop ${de(o)} here`})]})},ar=r.memo(nr),qe=new Set(["jpg","jpeg","png","gif","webp","svg","bmp"]),ir=new Set(["pdf"]),sr=new Set(["csv","tsv","xlsx","xls"]),lr=new Set(["txt","md","json","xml","yaml","yml"]),cr=new Set(["py","js","ts","jsx","tsx","css","html","java","cpp","c","go","rs","rb","php","swift","kt","scala","sh","bash","sql"]),dr=new Set(["mp3","wav","m4a","ogg","flac","aac"]),ur=new Set(["mp4","webm","mov","avi","mkv","wmv"]),pr=new Set(["zip","tar","gz","rar","7z","bz2"]);function Ze(e){const t=e.lastIndexOf(".");return t===-1||t===e.length-1?"":e.slice(t+1).toLowerCase()}function gr(e){const t=Ze(e);return qe.has(t)?Ne:ir.has(t)?Ue:sr.has(t)?Vt:lr.has(t)?Le:cr.has(t)?He:dr.has(t)?We:ur.has(t)?Oe:pr.has(t)?Be:yt}function fr(e){const t=Ze(e);return qe.has(t)}const hr=16;function mr(e,t=hr){if(e.length<=t)return e;const o=e.lastIndexOf(".");if(!(o>0&&o<e.length-1)){const f=Math.floor((t-3)/2),g=f>0?e.slice(-f):"";return`${e.slice(0,f)}...${g}`}const l=e.slice(o),w=e.slice(0,o),d=t-l.length-3;if(d<=0){const f=Math.floor((t-3)/2),g=f>0?e.slice(-f):"";return`${e.slice(0,f)}...${g}`}const v=Math.ceil(d/2),C=Math.floor(d/2),c=C>0?w.slice(-C):"";return`${w.slice(0,v)}...${c}${l}`}function wr(e,t){const o=r.useMemo(()=>!e||!fr(t)?null:URL.createObjectURL(e),[e,t]);return r.useEffect(()=>()=>{o&&URL.revokeObjectURL(o)},[o]),o}const vr=({fileInfo:e,imagePreviewUrl:t})=>{const{type:o}=e.status;switch(o){case"uploading":return a(Te,{iconValue:"spinner",testid:"stChatInputFileIconSpinner",size:"lg"});case"error":return a(V,{content:At,size:"lg",testid:"stChatInputFileIconError"});case"uploaded":return t?a(Zt,{src:t,alt:e.name,"data-testid":"stChatInputFileImagePreview"}):a(V,{content:gr(e.name),size:"lg"});default:return Me(o),null}},Cr=({fileInfo:e,onDelete:t,onRetry:o})=>{const p=e.status.type,l=p==="error",w=p==="uploading",d=l&&o!==void 0&&e.file!==void 0,v=r.useId(),C=wr(e.file,e.name),c=e.status.type==="error"?e.status.errorMessage:"Upload failed",f=r.useCallback(()=>{d&&o(e)},[d,o,e]),g=r.useCallback(y=>{d&&(y.key==="Enter"||y.key===" ")&&(y.preventDefault(),o(e))},[d,o,e]),h=r.useCallback(y=>{y.stopPropagation(),t(e.id)},[t,e.id]),k=w?`Cancel upload of ${e.name}`:`Remove ${e.name}`,Y=Ae(e.size,G.Byte),W=`${e.name}, ${Y}`,D=A(Gt,{className:"stChatInputFile","data-testid":"stChatInputFile",isError:l,isClickable:d,onClick:d?f:void 0,onKeyDown:d?g:void 0,title:d?"Click to retry upload":void 0,role:d?"button":void 0,tabIndex:d?0:void 0,"aria-label":W,"aria-invalid":l||void 0,"aria-describedby":l?v:void 0,children:[a(qt,{fileStatus:p,children:a(vr,{fileInfo:e,imagePreviewUrl:C})}),A(Yt,{children:[a(Jt,{className:"stChatInputFileName","data-testid":"stChatInputFileName",title:e.name,fileStatus:e.status,children:mr(e.name)}),a(Qt,{children:Ae(e.size,G.Byte)})]}),a(er,{"data-testid":"stChatInputDeleteBtn",isError:l,children:a(ut,{onClick:h,kind:pt.MINIMAL,"aria-label":k,children:a(V,{content:je,size:"md"})})}),l&&A(tr,{id:v,role:"alert",children:["Error: ",c]})]});return l?a(pe,{content:c,placement:ue.TOP,error:!0,children:D}):D},yr=r.memo(Cr),xr=({items:e,onDelete:t,onRetry:o})=>a(jt,{"data-testid":"stChatUploadedFiles",children:a(_t,{children:e.map(p=>a(Kt,{children:a(yr,{fileInfo:p,onDelete:t,onRetry:o})},p.id))})}),br=r.memo(xr),Sr=(e,t,o)=>{const p=[],l=[];return e.forEach(w=>{if(w.size>o){l.push({file:w,errors:[{code:ce.FileTooLarge,message:`File is too large. Maximum size is ${o} bytes.`}]});return}const d=Pt(w,t.fileType);if(!d.isValid){l.push({file:w,errors:[{code:ce.FileInvalidType,message:d.errorMessage||"File type not allowed."}]});return}p.push(w)}),{accepted:p,rejected:l}},zr=({acceptMultipleFiles:e,maxFileSize:t,uploadClient:o,uploadFile:p,addFiles:l,getNextLocalFileId:w,deleteExistingFiles:d,onUploadComplete:v,element:C})=>(c,f)=>{if(c.length>0){const{accepted:g,rejected:h}=Sr(c,C,t);c=g,f=[...f,...h]}if(!e&&c.length===0&&f.length>1){const g=f.findIndex(h=>h.errors?.[0].code===ce.TooManyFiles);g>=0&&(c.push(f[g].file),f.splice(g,1))}if(!e&&c.length>0&&d(),o.fetchFileURLs(c).then(g=>{gt(g,c).forEach(([h,k])=>{p(h,k)})}).catch(g=>{l(c.map(h=>new De(h.name,h.size,w(),{type:"error",errorMessage:g},h)))}),f.length>0){const g=f.map(h=>xt(h,w(),t));l(g)}v()},Er=({getNextLocalFileId:e,addFiles:t,updateFile:o,uploadClient:p,element:l,onUploadProgress:w,onUploadComplete:d})=>(v,C)=>{const c=C.webkitRelativePath||C.name,f=new AbortController,g=new De(c,C.size,e(),{type:"uploading",abortController:f,progress:1},C);t([g]),p.uploadFile({formId:"",...l},v.uploadUrl,C,h=>w(h,g.id),f.signal).then(()=>d(g.id,v)).catch(h=>{h instanceof DOMException&&h.name==="AbortError"||o(g.id,g.setStatus({type:"error",errorMessage:h?h.toString():"Unknown error"}))})};function Ir(e,t,o){return{Root:{style:{minHeight:e.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:e.fontWeights.normal,lineHeight:e.lineHeights.inputWidget,"::placeholder":{color:e.colors.fadedText60},height:t.isExtended?t.height:"auto",maxHeight:t.maxHeight,overflowY:"auto",paddingLeft:e.spacing.none,paddingRight:e.spacing.none,paddingBottom:e.spacing.twoXS,paddingTop:e.spacing.twoXS,width:"100%"}}}}const se=(e,t,o)=>o.map(p=>p.id===e?t:p),le=(e,t)=>t.find(o=>o.id===e);function Rr({disabled:e,element:t,widgetMgr:o,fragmentId:p,uploadClient:l}){const w=ft(),{placeholder:d,maxChars:v}=t,C=r.useRef(0),c=r.useRef(null),f=r.useRef(!1),g=r.useRef(null),h=r.useRef(null),{width:k,elementRef:Y}=ht(),{innerWidth:W,innerHeight:D}=mt(),[y,q]=r.useState(t.default),[I,F]=r.useState([]),[U,Z]=r.useState(!1),[H,ge]=r.useState(!1),[J,L]=r.useState(null),[M,Q]=r.useState(!1),[Je,fe]=r.useState(0),ee=t.acceptAudio??!1;r.useEffect(()=>()=>{h.current&&h.current.abort()},[]);const P=Et({textareaRef:c,dependencies:[d,M]}),O=r.useRef(""),$=r.useRef(0),te=r.useRef(null),he=r.useRef(null),B=r.useCallback(n=>{const i=getComputedStyle(n);O.current=`${i.fontWeight} ${i.fontSize} ${i.fontFamily}`;const u=parseFloat(i.paddingLeft)||0,s=parseFloat(i.paddingRight)||0;$.current=n.clientWidth-u-s},[]);r.useLayoutEffect(()=>{const n=c.current;if(!n)return;B(n);const i=new ResizeObserver(()=>B(n));return i.observe(n),()=>i.disconnect()},[B,M]),r.useEffect(()=>{if(y===""){Q(!1);return}if(M)return;const n=c.current;if(!n||(($.current<=0||!O.current)&&B(n),$.current<=0||!O.current))return;te.current||(te.current=document.createElement("canvas"),he.current=te.current.getContext("2d"));const i=he.current;i&&(i.font=O.current,i.measureText(y).width>$.current-10&&Q(!0))},[y,M,B]);const X=r.useMemo(()=>I.some(n=>n.status.type==="uploading")?!1:y!==""||I.length>0,[I,y]),E=wt(t.acceptFile),re=bt(t.maxUploadSizeMb,G.Megabyte,G.Byte),me=r.useCallback(n=>F(i=>[...i,...n]),[]),we=r.useCallback(n=>{n.status.type==="uploading"&&n.status.abortController.abort(),n.status.type==="uploaded"&&n.status.fileUrls.deleteUrl&&l.deleteFile(n.status.fileUrls.deleteUrl).catch(i=>{_.error("Failed to delete file from server:",i)})},[l]),ve=r.useCallback(n=>{F(i=>{const u=le(n,i);if(ie(u))return i;we(u);const s=i.filter(x=>x.id!==n);return s.length===0&&fe(x=>x+1),s})},[we]),oe=r.useRef(null),Qe=r.useCallback(n=>{!n.file||n.status.type!=="error"||(F(i=>i.filter(u=>u.id!==n.id)),oe.current&&oe.current([n.file],[]))},[]),Ce=r.useCallback(()=>{const n=I.filter(i=>i.status.type==="uploaded").map(i=>{const{name:u,size:s,status:x}=i,{fileId:ae,fileUrls:ct}=x;return new Ve({fileId:ae,fileUrls:ct,name:u,size:s})});return new vt({uploadedFileInfo:n})},[I]),ye=()=>C.current++,ne=zr({acceptMultipleFiles:E===b.Multiple||E===b.Directory,maxFileSize:re,uploadClient:l,uploadFile:Er({getNextLocalFileId:ye,addFiles:me,updateFile:(n,i)=>{F(u=>se(n,i,u))},uploadClient:l,element:t,onUploadProgress:(n,i)=>{F(u=>{const s=le(i,u);if(ie(s)||s.status.type!=="uploading")return u;const x=Math.round(n.loaded*100/n.total);return s.status.progress===x?u:se(i,s.setStatus({type:"uploading",abortController:s.status.abortController,progress:x}),u)})},onUploadComplete:(n,i)=>{F(u=>{const s=le(n,u);return ie(s)||s.status.type!=="uploading"?u:se(s.id,s.setStatus({type:"uploaded",fileId:i.fileId,fileUrls:i}),u)})}}),addFiles:me,getNextLocalFileId:ye,deleteExistingFiles:()=>I.forEach(n=>ve(n.id)),onUploadComplete:()=>{c.current&&c.current.focus()},element:t});oe.current=ne;const{getRootProps:et,getInputProps:tt}=ke({onDrop:ne,multiple:E===b.Multiple||E===b.Directory,accept:Fe(t.fileType),maxSize:re,useFsAccessApi:!1}),j=r.useCallback(n=>{if(c.current&&c.current.focus(),!X&&!n||e)return;const i=Ce(),u={data:y,fileUploaderState:i,audioFileInfo:n};o.setChatInputValue(t,u,{fromUi:!0},p),I.length>0&&fe(s=>s+1),F([]),q(""),Q(!1),P.clearScrollHeight()},[X,e,y,I.length,Ce,o,t,p,P]),xe=r.useCallback(async n=>{const i=new Date().toISOString().replace(/[:.]/g,"-"),u=new File([n],`audio-${i}.wav`,{type:"audio/wav"});try{ge(!0);const s=await l.fetchFileURLs([u]);if(s.length===0)throw new Error("Failed to get upload URL for audio file");const x=s[0];h.current=new AbortController,await l.uploadFile({formId:"",...t},x.uploadUrl,u,()=>{},h.current.signal);const ae=new Ve({fileId:x.fileId,fileUrls:x,name:u.name,size:u.size});j(ae)}catch(s){const x="Recording failed";_.error("Audio upload failed:",s),L(x),c.current&&c.current.focus()}finally{ge(!1)}},[l,t,j]),rt=r.useMemo(()=>({onApprove:xe,onPermissionDenied:()=>{const n="Microphone access denied";L(n),_.error("Permission denied:",n)},onError:n=>{L("Recording failed"),_.error("Recording error:",n)},onRecordStart:()=>{L(null)}}),[xe]),R=St({containerRef:g,sampleRate:t.audioSampleRate??void 0,events:rt}),be=r.useCallback(()=>{j()},[j]),ot=n=>{const{metaKey:i,ctrlKey:u,shiftKey:s}=n;Rt(n)&&!s&&!u&&!i&&(n.preventDefault(),be())},nt=n=>{const{value:i}=n.target;v!==0&&i.length>v||(q(i),P.updateScrollHeight(),J&&L(null))},Se=r.useCallback(async n=>{n.preventDefault(),n.stopPropagation(),!(!ee||e||R.state==="recording")&&await R.start()},[ee,e,R]),at=r.useCallback(()=>{R.cancel(),c.current&&c.current.focus()},[R]),ze=r.useCallback(async()=>{const{blob:n}=await R.stop();await R.approve(n)},[R]),Ee=r.useCallback(n=>{Se(n)},[Se]),it=r.useCallback(()=>{ze()},[ze]),st=r.useCallback(()=>{c.current&&c.current.focus()},[]);r.useEffect(()=>{if(t.setValue&&!f.current){f.current=!0;const n=t.value||"";q(n)}},[t.setValue,t.value]),r.useEffect(()=>{f.current=!1},[t]),r.useEffect(()=>{const n=s=>{s.preventDefault(),s.stopPropagation(),!U&&s.dataTransfer?.types.includes("Files")&&Z(!0)},i=s=>{s.preventDefault(),s.stopPropagation(),U&&(s.clientX<=0&&s.clientY<=0||s.clientX>=W&&s.clientY>=D)&&Z(!1)},u=s=>{s.preventDefault(),s.stopPropagation(),U&&Z(!1)};return window.addEventListener("dragover",n),window.addEventListener("drop",u),window.addEventListener("dragleave",i),()=>{window.removeEventListener("dragover",n),window.removeEventListener("drop",u),window.removeEventListener("dragleave",i)}},[U,W,D]);const lt=E!==b.None&&U,N=R.state==="recording",Ie=!N&&k>Ct(w.breakpoints.hideWidgetDetails)&&v>0;return a(Ft,{className:"stChatInput","data-testid":"stChatInput",ref:Y,children:A(Mt,{children:[Ie&&a(Lt,{onClick:st,id:"stChatInputInstructions",children:a(zt,{dirty:X,value:y,maxLength:v,type:"chat",inForm:!1,className:"stChatInputInstructions"})}),lt&&a(ar,{getRootProps:et,getInputProps:tt,acceptFile:E}),E!==b.None&&I.length>0&&a(Tt,{children:a(br,{items:[...I],onDelete:ve,onRetry:Qe})}),A(kt,{isStacked:M,children:[a(Ut,{children:E!==b.None&&!N&&a(or,{onDrop:ne,multiple:E===b.Multiple||E===b.Directory,accept:Fe(t.fileType),maxSize:re,acceptFile:E,disabled:e},Je)}),a(Bt,{isRecording:N,children:a(Nt,{ref:g})}),!N&&a(Dt,{isStacked:M,children:a(It,{inputRef:c,value:y,placeholder:d,onChange:nt,onKeyDown:ot,"aria-label":d,disabled:e,rows:1,"aria-describedby":Ie?"stChatInputInstructions":void 0,overrides:Ir(w,P,{width:"100%"})})}),a(Ht,{children:N?A(K,{children:[a(T,{onClick:at,disabled:e,"data-testid":"stChatInputCancelButton","aria-label":"Cancel recording",children:a(V,{content:Ke,size:"lg",color:"inherit"})}),a(T,{onClick:it,disabled:e||H,"data-testid":"stChatInputApproveButton","aria-label":"Submit recording",children:H?a(Te,{size:"lg",iconValue:"spinner"}):a(V,{content:_e,size:"lg",color:"inherit"})})]}):A(K,{children:[ee&&a(K,{children:J?a(pe,{content:J,placement:ue.TOP,error:!0,children:a(T,{onClick:Ee,disabled:e||H,hasError:!0,"data-testid":"stChatInputMicButton","aria-label":"Start recording",children:a(V,{content:Ge,size:"xl",color:"inherit"})})}):a(T,{onClick:Ee,disabled:e||H,"data-testid":"stChatInputMicButton","aria-label":"Start recording",children:a(V,{content:Pe,size:"xl",color:"inherit"})})}),a(T,{onClick:be,disabled:!X||e||H,"data-testid":"stChatInputSubmitButton","aria-label":"Send message",primary:!0,children:a(V,{content:Xe,size:"lg",color:"inherit"})})]})})]})]})})}const Br=r.memo(Rr);export{Br as default};
|