streamlit-nightly 1.46.2.dev20250715__py3-none-any.whl → 1.47.1.dev20250716__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (82) hide show
  1. streamlit/connections/snowflake_connection.py +2 -2
  2. streamlit/elements/graphviz_chart.py +7 -0
  3. streamlit/elements/lib/file_uploader_utils.py +21 -2
  4. streamlit/elements/plotly_chart.py +6 -2
  5. streamlit/elements/pyplot.py +5 -1
  6. streamlit/elements/widgets/chat.py +6 -0
  7. streamlit/elements/widgets/file_uploader.py +6 -0
  8. streamlit/static/index.html +1 -1
  9. streamlit/static/manifest.json +218 -218
  10. streamlit/static/static/js/{ErrorOutline.esm.CaUhmcG6.js → ErrorOutline.esm.DNK5J9Fz.js} +1 -1
  11. streamlit/static/static/js/{FileDownload.esm.ZEl-HfEg.js → FileDownload.esm.Cb2Z--zt.js} +1 -1
  12. streamlit/static/static/js/{FileHelper.BKIVKQnB.js → FileHelper.QQBwcr1S.js} +1 -1
  13. streamlit/static/static/js/{FormClearHelper.C4W8xjEX.js → FormClearHelper.Fo17GZrr.js} +1 -1
  14. streamlit/static/static/js/{Hooks.Bcs7Dqad.js → Hooks.Blc9M7kn.js} +1 -1
  15. streamlit/static/static/js/{InputInstructions.CAp9mFM6.js → InputInstructions.DQ5Ej_7M.js} +1 -1
  16. streamlit/static/static/js/{ProgressBar.DBmbQ5U6.js → ProgressBar.DbvwXQwC.js} +1 -1
  17. streamlit/static/static/js/{RenderInPortalIfExists.BGENGpwt.js → RenderInPortalIfExists.DUUcjeaK.js} +1 -1
  18. streamlit/static/static/js/{Toolbar.CA92Moni.js → Toolbar.oggLWFZy.js} +1 -1
  19. streamlit/static/static/js/{base-input.C-H36mFE.js → base-input.DiS6HF4j.js} +1 -1
  20. streamlit/static/static/js/{checkbox.B6I7DbdE.js → checkbox.D60kv6TD.js} +1 -1
  21. streamlit/static/static/js/{createSuper.DEaMobJa.js → createSuper.C67qUZn1.js} +1 -1
  22. streamlit/static/static/js/{data-grid-overlay-editor.CxvB719M.js → data-grid-overlay-editor.Cov081px.js} +1 -1
  23. streamlit/static/static/js/{downloader.CDDSxxak.js → downloader.C82YfVzs.js} +1 -1
  24. streamlit/static/static/js/{es6.BMYexa9t.js → es6.BhqRltzl.js} +2 -2
  25. streamlit/static/static/js/{iframeResizer.contentWindow.D-l9cCws.js → iframeResizer.contentWindow.BZvCz8C4.js} +1 -1
  26. streamlit/static/static/js/{index.BjJqANY4.js → index.6RK7jQPW.js} +1 -1
  27. streamlit/static/static/js/{index.DygxY7Lg.js → index.B3AxymZr.js} +2 -2
  28. streamlit/static/static/js/{index.CEUhSvrW.js → index.B4lVqTBW.js} +1 -1
  29. streamlit/static/static/js/{index.Ch30W6NP.js → index.B5O7nWCz.js} +1 -1
  30. streamlit/static/static/js/{index.DJ6SMXzt.js → index.B5wDHoKR.js} +1 -1
  31. streamlit/static/static/js/{index.DBVPN8iJ.js → index.B6y7HgHo.js} +1 -1
  32. streamlit/static/static/js/{index.DFjvmFUl.js → index.BHolK_CI.js} +1 -1
  33. streamlit/static/static/js/{index.DMzpbFDn.js → index.BM85-T91.js} +1 -1
  34. streamlit/static/static/js/{index.Bb5Sxtkx.js → index.BNqR53-k.js} +1 -1
  35. streamlit/static/static/js/{index.DHv7KxuP.js → index.BOKlrlFj.js} +1 -1
  36. streamlit/static/static/js/{index.CZbA_QY0.js → index.BSlzPv51.js} +1 -1
  37. streamlit/static/static/js/{index.BdazK8za.js → index.BZF4FCAE.js} +1 -1
  38. streamlit/static/static/js/{index.1ZtAvXND.js → index.B_k2kuGW.js} +1 -1
  39. streamlit/static/static/js/{index.DNoDZbuV.js → index.By0Eif-W.js} +1 -1
  40. streamlit/static/static/js/{index.aLRZj3JI.js → index.C70-m6Fw.js} +1 -1
  41. streamlit/static/static/js/{index.Buz-cCdK.js → index.CA0u5BJL.js} +1 -1
  42. streamlit/static/static/js/{index.Br2RYgMU.js → index.C_X5F5TG.js} +1 -1
  43. streamlit/static/static/js/{index.Ce906Q5W.js → index.CaTOVCTS.js} +1 -1
  44. streamlit/static/static/js/{index.D9XZpDDt.js → index.Cb-_n28x.js} +1 -1
  45. streamlit/static/static/js/{index.Ou3kxN43.js → index.Cn9KSkdV.js} +1 -1
  46. streamlit/static/static/js/{index.B-g_Erog.js → index.CtapdFs_.js} +5 -5
  47. streamlit/static/static/js/{index.vRRu8CJW.js → index.CvFk5Vuj.js} +1 -1
  48. streamlit/static/static/js/{index.EAQB8Tuq.js → index.D1AeFlAQ.js} +3 -3
  49. streamlit/static/static/js/{index.CS9yBABI.js → index.D6Zkg3M-.js} +1 -1
  50. streamlit/static/static/js/{index.BoTBd6Jn.js → index.DFLdlD8F.js} +1 -1
  51. streamlit/static/static/js/{index.DYvo87DK.js → index.DGw6KzzW.js} +1 -1
  52. streamlit/static/static/js/{index.CphcnmQO.js → index.DJhDzJzB.js} +1 -1
  53. streamlit/static/static/js/{index.Dm8vdcs9.js → index.DbQYY96m.js} +1 -1
  54. streamlit/static/static/js/{index.phUFaJLn.js → index.KCUN3mSA.js} +1 -1
  55. streamlit/static/static/js/{index.DzH3Qe6P.js → index.KU83amIK.js} +1 -1
  56. streamlit/static/static/js/{index.Ct2v9YN2.js → index.LqU8bU6z.js} +1 -1
  57. streamlit/static/static/js/{index.BQQ5JTaz.js → index.RvGvTgvL.js} +1 -1
  58. streamlit/static/static/js/{index.kIS8fJE1.js → index.X5bDcXsg.js} +1 -1
  59. streamlit/static/static/js/{index.CqALE_Sz.js → index.dfF-LVn5.js} +1 -1
  60. streamlit/static/static/js/{index.C_f3O5DO.js → index.kt6H3rVc.js} +1 -1
  61. streamlit/static/static/js/{index.CfoE7jon.js → index.rrZNiSCJ.js} +1 -1
  62. streamlit/static/static/js/{index.C9PLrvrw.js → index.uTlWTJyJ.js} +1 -1
  63. streamlit/static/static/js/{input.DjnwsrgF.js → input.C5ChshDH.js} +1 -1
  64. streamlit/static/static/js/{memory.C-fF2BpE.js → memory.YFW_wmkS.js} +1 -1
  65. streamlit/static/static/js/{mergeWith.Cjweouij.js → mergeWith.CRLNQNLL.js} +1 -1
  66. streamlit/static/static/js/{number-overlay-editor.BFTlQD7x.js → number-overlay-editor.Coke5m2c.js} +1 -1
  67. streamlit/static/static/js/{possibleConstructorReturn.Cy1PJuxU.js → possibleConstructorReturn.DG2YBhZN.js} +1 -1
  68. streamlit/static/static/js/{sandbox.DvSXZ4R-.js → sandbox.Bk17Upg8.js} +1 -1
  69. streamlit/static/static/js/{timepicker.bPCY7gSF.js → timepicker.DGOKu1Dm.js} +1 -1
  70. streamlit/static/static/js/{toConsumableArray.DaNXH4b3.js → toConsumableArray.FS1y1Ph9.js} +1 -1
  71. streamlit/static/static/js/{uniqueId.CDZNs_pn.js → uniqueId.xlR2febd.js} +1 -1
  72. streamlit/static/static/js/{useBasicWidgetState.YAhDGDM8.js → useBasicWidgetState.WEzLnfWp.js} +1 -1
  73. streamlit/static/static/js/{useOnInputChange.HiDk3WIa.js → useOnInputChange.xCSX6R9u.js} +1 -1
  74. streamlit/static/static/js/{useTextInputAutoExpand.CwuIWHHK.js → useTextInputAutoExpand.Qpzi9U5B.js} +1 -1
  75. streamlit/static/static/js/{withFullScreenWrapper.C4lh8vGd.js → withFullScreenWrapper.BPdpC8z2.js} +1 -1
  76. streamlit/user_info.py +5 -1
  77. {streamlit_nightly-1.46.2.dev20250715.dist-info → streamlit_nightly-1.47.1.dev20250716.dist-info}/METADATA +13 -1
  78. {streamlit_nightly-1.46.2.dev20250715.dist-info → streamlit_nightly-1.47.1.dev20250716.dist-info}/RECORD +82 -82
  79. {streamlit_nightly-1.46.2.dev20250715.data → streamlit_nightly-1.47.1.dev20250716.data}/scripts/streamlit.cmd +0 -0
  80. {streamlit_nightly-1.46.2.dev20250715.dist-info → streamlit_nightly-1.47.1.dev20250716.dist-info}/WHEEL +0 -0
  81. {streamlit_nightly-1.46.2.dev20250715.dist-info → streamlit_nightly-1.47.1.dev20250716.dist-info}/entry_points.txt +0 -0
  82. {streamlit_nightly-1.46.2.dev20250715.dist-info → streamlit_nightly-1.47.1.dev20250716.dist-info}/top_level.txt +0 -0
@@ -1 +1 @@
1
- import{s as p,r as s,z as S,C as y,j as i,D as v,aG as w,aT as r,F as h,B as m,aU as L,aV as R}from"./index.EAQB8Tuq.js";const B=p("button",{target:"ee3yv4c0"})(({theme:o})=>({fontSize:o.fontSizes.sm,lineHeight:o.lineHeights.base,color:o.colors.fadedText60,backgroundColor:o.colors.transparent,fontFamily:"inherit",margin:o.spacing.none,border:"none",boxShadow:"none",padding:o.spacing.none,"&:hover, &:active, &:focus":{border:"none",outline:"none",boxShadow:"none"},"&:hover":{color:o.colors.primary}})),C=p("div",{target:"ee3yv4c1"})(({theme:o})=>({display:"flex",flexDirection:"row",gap:o.spacing.lg,"> span":{marginTop:o.spacing.twoXS}})),k=p("div",{target:"ee3yv4c2"})(({theme:o})=>({display:"flex",flexDirection:"column",gap:o.spacing.sm,alignItems:"start",justifyContent:"center",overflow:"hidden",minHeight:"100%",fontSize:o.fontSizes.sm,lineHeight:o.lineHeights.base,div:{display:"inline-flex"}}));function z(o){const a=m(o);return{Body:{props:{"data-testid":"stToast",className:"stToast"},style:{display:"flex",flexDirection:"row",gap:o.spacing.md,width:o.sizes.toastWidth,marginTop:o.spacing.sm,borderTopLeftRadius:o.radii.default,borderTopRightRadius:o.radii.default,borderBottomLeftRadius:o.radii.default,borderBottomRightRadius:o.radii.default,paddingTop:o.spacing.lg,paddingBottom:o.spacing.lg,paddingLeft:o.spacing.twoXL,paddingRight:o.spacing.twoXL,backgroundColor:a?o.colors.gray10:o.colors.gray90,color:o.colors.bodyText,boxShadow:a?"0px 4px 16px rgba(0, 0, 0, 0.16)":"0px 4px 16px rgba(0, 0, 0, 0.7)"}},CloseIcon:{style:{color:o.colors.fadedText40,width:o.fontSizes.lg,height:o.fontSizes.lg,marginRight:`calc(-1 * ${o.spacing.lg} / 2)`,":hover":{color:o.colors.bodyText}}}}}function E(o){if(o.length>104){let t=o.replace(/^(.{104}[^\s]*).*/,"$1");return t.length>104&&(t=t.substring(0,104).split(" ").slice(0,-1).join(" ")),t.trim()}return o}function D({body:o,icon:a}){const t=S(),n=E(o),d=o!==n,[e,x]=s.useState(!d),[u,b]=s.useState(0),f=s.useCallback(()=>{x(!e)},[e]),c=s.useMemo(()=>z(t),[t]),l=s.useMemo(()=>y(C,{expanded:e,children:[a&&i(v,{iconValue:a,size:"xl",testid:"stToastDynamicIcon"}),y(k,{children:[i(w,{source:e?o:n,allowHTML:!1,isToast:!0}),d&&i(B,{"data-testid":"stToastViewButton",onClick:f,children:e?"view less":"view more"})]})]}),[d,e,o,a,n,f]);s.useEffect(()=>{if(t.inSidebar)return;const g=r.info(l,{overrides:{...c}});return b(g),()=>{r.update(g,{overrides:{Body:{style:{display:"none"}}}}),r.clear(g)}},[]),s.useEffect(()=>{r.update(u,{children:l,overrides:{...c}})},[u,l,c]);const T=i(R,{kind:L.ERROR,body:"Streamlit API Error: `st.toast` cannot be called directly on the sidebar with `st.sidebar.toast`. See our `st.toast` API [docs](https://docs.streamlit.io/develop/api-reference/status/st.toast) for more information."});return i(h,{children:t.inSidebar&&T})}const I=s.memo(D);export{I as default};
1
+ import{s as p,r as s,z as S,C as y,j as i,D as v,aG as w,aT as r,F as h,B as m,aU as L,aV as R}from"./index.D1AeFlAQ.js";const B=p("button",{target:"ee3yv4c0"})(({theme:o})=>({fontSize:o.fontSizes.sm,lineHeight:o.lineHeights.base,color:o.colors.fadedText60,backgroundColor:o.colors.transparent,fontFamily:"inherit",margin:o.spacing.none,border:"none",boxShadow:"none",padding:o.spacing.none,"&:hover, &:active, &:focus":{border:"none",outline:"none",boxShadow:"none"},"&:hover":{color:o.colors.primary}})),C=p("div",{target:"ee3yv4c1"})(({theme:o})=>({display:"flex",flexDirection:"row",gap:o.spacing.lg,"> span":{marginTop:o.spacing.twoXS}})),k=p("div",{target:"ee3yv4c2"})(({theme:o})=>({display:"flex",flexDirection:"column",gap:o.spacing.sm,alignItems:"start",justifyContent:"center",overflow:"hidden",minHeight:"100%",fontSize:o.fontSizes.sm,lineHeight:o.lineHeights.base,div:{display:"inline-flex"}}));function z(o){const a=m(o);return{Body:{props:{"data-testid":"stToast",className:"stToast"},style:{display:"flex",flexDirection:"row",gap:o.spacing.md,width:o.sizes.toastWidth,marginTop:o.spacing.sm,borderTopLeftRadius:o.radii.default,borderTopRightRadius:o.radii.default,borderBottomLeftRadius:o.radii.default,borderBottomRightRadius:o.radii.default,paddingTop:o.spacing.lg,paddingBottom:o.spacing.lg,paddingLeft:o.spacing.twoXL,paddingRight:o.spacing.twoXL,backgroundColor:a?o.colors.gray10:o.colors.gray90,color:o.colors.bodyText,boxShadow:a?"0px 4px 16px rgba(0, 0, 0, 0.16)":"0px 4px 16px rgba(0, 0, 0, 0.7)"}},CloseIcon:{style:{color:o.colors.fadedText40,width:o.fontSizes.lg,height:o.fontSizes.lg,marginRight:`calc(-1 * ${o.spacing.lg} / 2)`,":hover":{color:o.colors.bodyText}}}}}function E(o){if(o.length>104){let t=o.replace(/^(.{104}[^\s]*).*/,"$1");return t.length>104&&(t=t.substring(0,104).split(" ").slice(0,-1).join(" ")),t.trim()}return o}function D({body:o,icon:a}){const t=S(),n=E(o),d=o!==n,[e,x]=s.useState(!d),[u,b]=s.useState(0),f=s.useCallback(()=>{x(!e)},[e]),c=s.useMemo(()=>z(t),[t]),l=s.useMemo(()=>y(C,{expanded:e,children:[a&&i(v,{iconValue:a,size:"xl",testid:"stToastDynamicIcon"}),y(k,{children:[i(w,{source:e?o:n,allowHTML:!1,isToast:!0}),d&&i(B,{"data-testid":"stToastViewButton",onClick:f,children:e?"view less":"view more"})]})]}),[d,e,o,a,n,f]);s.useEffect(()=>{if(t.inSidebar)return;const g=r.info(l,{overrides:{...c}});return b(g),()=>{r.update(g,{overrides:{Body:{style:{display:"none"}}}}),r.clear(g)}},[]),s.useEffect(()=>{r.update(u,{children:l,overrides:{...c}})},[u,l,c]);const T=i(R,{kind:L.ERROR,body:"Streamlit API Error: `st.toast` cannot be called directly on the sidebar with `st.sidebar.toast`. See our `st.toast` API [docs](https://docs.streamlit.io/develop/api-reference/status/st.toast) for more information."});return i(h,{children:t.inSidebar&&T})}const I=s.memo(D);export{I as default};
@@ -1 +1 @@
1
- import{r as l,E as _,_ as G,s as p,B as dt,z as $,j as o,b9 as Y,bu as ct,C as S,bp as J,b4 as q,bo as E,a_ as pt,bI as ut,bG as j,bj as gt,bJ as v,bs as ht,F as Q,aP as ft,bg as mt,bK as yt,M as H,bl as Ct,bk as bt}from"./index.EAQB8Tuq.js";import{g as vt,C as It,I as xt,F as M,E as wt,a as St,s as Ft,u as Ut,b as zt}from"./FileHelper.BKIVKQnB.js";import{I as Et}from"./InputInstructions.CAp9mFM6.js";import{i as Tt}from"./inputUtils.CptNuJwn.js";import{u as Bt,T as Dt}from"./useTextInputAutoExpand.CwuIWHHK.js";import{E as Rt}from"./ErrorOutline.esm.CaUhmcG6.js";import{U as Z}from"./UploadFileInfo.C-jY39rj.js";import"./base-input.C-H36mFE.js";var tt=l.forwardRef(function(t,e){var r={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return l.createElement(_,G({iconAttrs:r,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},t,{ref:e}),l.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),l.createElement("path",{d:"M16.5 6v11.5c0 2.21-1.79 4-4 4s-4-1.79-4-4V5a2.5 2.5 0 015 0v10.5c0 .55-.45 1-1 1s-1-.45-1-1V6H10v9.5a2.5 2.5 0 005 0V5c0-2.21-1.79-4-4-4S7 2.79 7 5v12.5c0 3.04 2.46 5.5 5.5 5.5s5.5-2.46 5.5-5.5V6h-1.5z"}))});tt.displayName="AttachFile";var et=l.forwardRef(function(t,e){var r={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return l.createElement(_,G({iconAttrs:r,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},t,{ref:e}),l.createElement("rect",{width:24,height:24,fill:"none"}),l.createElement("path",{d:"M3 5.51v3.71c0 .46.31.86.76.97L11 12l-7.24 1.81c-.45.11-.76.51-.76.97v3.71c0 .72.73 1.2 1.39.92l15.42-6.49c.82-.34.82-1.5 0-1.84L4.39 4.58C3.73 4.31 3 4.79 3 5.51z"}))});et.displayName="Send";const Ht=p("div",{target:"e1togvvn0"})("border:none;position:relative;display:flex;"),Lt=p("div",{target:"e1togvvn1"})(({theme:t,extended:e})=>({border:`${t.sizes.borderWidth} solid`,borderColor:t.colors.widgetBorderColor??t.colors.transparent,borderRadius:t.radii.chatInput,backgroundColor:t.colors.secondaryBg,position:"relative",flexGrow:1,display:"flex",alignItems:"center",paddingLeft:t.spacing.lg,maxHeight:e?"none":t.sizes.minElementHeight,gap:t.spacing.sm,overflow:"hidden",":focus-within":{borderColor:t.colors.primary}})),kt=p("button",{target:"e1togvvn2"})(({theme:t,disabled:e,extended:r})=>{const d=dt(t),[f,c]=d?[t.colors.gray60,t.colors.gray80]:[t.colors.gray80,t.colors.gray40];return{border:"none",backgroundColor:t.colors.transparent,borderTopRightRadius:r?"0":t.radii.chatInput,borderTopLeftRadius:r?t.radii.default:"0",borderBottomRightRadius:t.radii.chatInput,display:"inline-flex",alignItems:"center",justifyContent:"center",lineHeight:t.lineHeights.none,margin:t.spacing.none,padding:t.spacing.sm,color:e?f:c,pointerEvents:"auto","&:focus":{outline:"none"},":focus":{outline:"none"},"&:focus-visible":{backgroundColor:d?t.colors.gray10:t.colors.gray90},"&:hover":{color:t.colors.primary},"&:disabled, &:disabled:hover, &:disabled:active":{backgroundColor:t.colors.transparent,borderColor:t.colors.transparent,color:t.colors.gray,cursor:"not-allowed"}}}),Mt=p("div",{target:"e1togvvn3"})(({theme:t})=>({display:"flex",alignItems:"flex-end",height:"100%",position:"absolute",right:0,marginBottom:`-${t.sizes.borderWidth}`,pointerEvents:"none"})),$t=p("div",{target:"e1togvvn4"})(({theme:t})=>({position:"absolute",bottom:"0px",right:`calc(${t.iconSizes.xl} + 2 * ${t.spacing.sm} + ${t.spacing.sm})`})),Vt=p("div",{target:"e15560op0"})(({theme:t,height:e})=>({backgroundColor:t.colors.transparent,position:"absolute",left:0,bottom:0,minHeight:`max(${t.sizes.emptyDropdownHeight}, ${e})`,width:"100%",zIndex:t.zIndices.priority})),Wt=p("div",{target:"e15560op1"})(({theme:t,height:e})=>({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",height:e,width:"100%",fontWeight:t.fontWeights.bold})),Nt=p("div",{target:"e15560op2"})(({theme:t,disabled:e})=>({display:"flex",alignItems:"top",height:"100%",marginTop:`-${t.sizes.borderWidth}`,cursor:e?"not-allowed":"auto"})),At=p("div",{target:"e15560op3"})(({disabled:t})=>({pointerEvents:t?"none":"auto"})),Pt=p("div",{target:"e15560op4"})(({theme:t})=>({marginTop:"0.625em",marginLeft:t.spacing.sm,height:t.spacing.xl,width:t.sizes.borderWidth,backgroundColor:t.colors.fadedText20})),Kt=p("div",{target:"e15560op5"})(({theme:t})=>({left:0,right:0,lineHeight:t.lineHeights.tight,paddingLeft:t.spacing.sm,paddingRight:t.spacing.sm,overflowX:"auto"})),Ot=p("div",{target:"e15560op6"})({display:"flex"}),Xt=p("div",{target:"e15560op7"})({flex:"0 0 auto"}),jt=p("div",{target:"e15560op8"})(({theme:t})=>({display:"flex",alignItems:"center",padding:t.spacing.sm,gap:t.spacing.twoXS})),_t=p("div",{target:"e15560op9"})(({theme:t})=>({color:t.colors.fadedText60})),Gt=p("div",{target:"e15560op10"})(({theme:t,fileStatus:e})=>({overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:e.type==="uploaded"?t.colors.bodyText:t.colors.fadedText60})),Yt=p("div",{target:"e15560op11"})(({theme:t})=>({marginRight:t.spacing.md,color:t.colors.fadedText60})),Jt=p("small",{target:"e15560op12"})(({theme:t})=>({display:"flex",alignItems:"center",maxHeight:t.sizes.smallElementHeight,color:t.colors.fadedText60,"& :hover":{color:t.colors.bodyText}}));function qt({children:t,content:e}){const r=$();return o(ct,{content:e,placement:Y.TOP,overrides:{Body:{style:{top:`-${r.sizes.minElementHeight}`}}},children:t})}const Qt=({fileInfo:t})=>{const e=$(),{type:r}=t.status;switch(r){case"uploading":return o(ut,{usingCustomTheme:!1,"data-testid":"stChatInputFileIconSpinner",size:"lg",margin:"0",padding:"0"});case"error":return o(qt,{content:t.status.errorMessage,children:o(E,{color:e.colors.red,content:Rt,size:"lg"})});case"uploaded":return o(E,{content:xt,size:"lg"});default:return pt(r),null}},Zt=({fileInfo:t,onDelete:e})=>S(jt,{className:"stChatInputFile","data-testid":"stChatInputFile",children:[o(_t,{children:o(Qt,{fileInfo:t})}),o(Gt,{className:"stChatInputFileName","data-testid":"stChatInputFileName",title:t.name,fileStatus:t.status,children:t.name}),o(Yt,{children:vt(t.size,M.Byte)}),o(Jt,{"data-testid":"stChatInputDeleteBtn",children:o(J,{onClick:()=>e(t.id),kind:q.MINIMAL,children:o(E,{content:It,size:"lg"})})})]}),te=l.memo(Zt),ee=({items:t,onDelete:e})=>o(Kt,{"data-testid":"stChatUploadedFiles",children:o(Ot,{children:t.map(r=>o(Xt,{children:o(te,{fileInfo:r,onDelete:e})},r.id))})}),oe=l.memo(ee),ne=({getNextLocalFileId:t,addFiles:e,updateFile:r,uploadClient:d,element:f,onUploadProgress:c,onUploadComplete:C})=>(y,m)=>{const g=j.CancelToken.source(),u=new Z(m.name,m.size,t(),{type:"uploading",cancelToken:g,progress:1});e([u]),d.uploadFile({formId:"",...f},y.uploadUrl,m,h=>c(h,u.id),g.token).then(()=>C(u.id,y)).catch(h=>{j.isCancel(h)||r(u.id,u.setStatus({type:"error",errorMessage:h?h.toString():"Unknown error"}))})},ae=({acceptMultipleFiles:t,maxFileSize:e,uploadClient:r,uploadFile:d,addFiles:f,getNextLocalFileId:c,deleteExistingFiles:C,onUploadComplete:y})=>(m,g)=>{if(!t&&m.length===0&&g.length>1){const u=g.findIndex(h=>h.errors?.[0].code===wt.TooManyFiles);u>=0&&(m.push(g[u].file),g.splice(u,1))}if(!t&&m.length>0&&C(),r.fetchFileURLs(m).then(u=>{gt(u,m).forEach(([h,T])=>{d(h,T)})}).catch(u=>{f(m.map(h=>new Z(h.name,h.size,c(),{type:"error",errorMessage:u})))}),g.length>0){const u=g.map(h=>St(h,c(),e));f(u)}y()},re=({getRootProps:t,getInputProps:e,acceptFile:r,disabled:d,theme:f})=>S(Nt,{disabled:d,children:[S(At,{"data-testid":"stChatInputFileUploadButton",disabled:d,...t(),children:[o("input",{...e()}),o(ht,{content:`Upload or drag and drop ${r===v.Multiple?"files":"a file"}`,placement:Y.TOP,onMouseEnterDelay:500,children:o(J,{kind:q.MINIMAL,disabled:d,children:o(E,{content:tt,size:"lg",color:d?f.colors.fadedText40:f.colors.fadedText60})})})]}),o(Pt,{})]}),ie=l.memo(re),se=({getRootProps:t,getInputProps:e,acceptFile:r,inputHeight:d})=>S(Q,{children:[o(Vt,{height:d,...t(),children:o("input",{...e()})}),o(Wt,{height:d,children:`Drag and drop ${r===v.Multiple?"files":"a file"} here`})]}),le=l.memo(se),L=(t,e,r)=>r.map(d=>d.id===t?e:d),k=(t,e)=>e.find(r=>r.id===t);function de({disabled:t,element:e,widgetMgr:r,fragmentId:d,uploadClient:f}){const c=$(),{placeholder:C,maxChars:y}=e,m=l.useRef(0),g=l.useRef(null),[u,h]=ft(),{innerWidth:T,innerHeight:V}=mt(),[F,B]=l.useState(e.default),[I,x]=l.useState([]),[U,D]=l.useState(!1),w=Bt({textareaRef:g,dependencies:[C]}),R=l.useMemo(()=>I.some(n=>n.status.type==="uploading")?!1:F!==""||I.length>0,[I,F]),b=yt(e.acceptFile),W=Ft(e.maxUploadSizeMb,M.Megabyte,M.Byte),N=l.useCallback(n=>x(i=>[...i,...n]),[]),A=l.useCallback(n=>{x(i=>{const s=k(n,i);return H(s)?i:(s.status.type==="uploading"&&s.status.cancelToken.cancel(),s.status.type==="uploaded"&&s.status.fileUrls.deleteUrl&&f.deleteFile(s.status.fileUrls.deleteUrl),i.filter(a=>a.id!==n))})},[f]),ot=()=>{const n=I.filter(i=>i.status.type==="uploaded").map(i=>{const{name:s,size:a,status:z}=i,{fileId:st,fileUrls:lt}=z;return new Ct({fileId:st,fileUrls:lt,name:s,size:a})});return new bt({uploadedFileInfo:n})},P=()=>m.current++,nt=ae({acceptMultipleFiles:b===v.Multiple,maxFileSize:W,uploadClient:f,uploadFile:ne({getNextLocalFileId:P,addFiles:N,updateFile:(n,i)=>{x(s=>L(n,i,s))},uploadClient:f,element:e,onUploadProgress:(n,i)=>{x(s=>{const a=k(i,s);if(H(a)||a.status.type!=="uploading")return s;const z=Math.round(n.loaded*100/n.total);return a.status.progress===z?s:L(i,a.setStatus({type:"uploading",cancelToken:a.status.cancelToken,progress:z}),s)})},onUploadComplete:(n,i)=>{x(s=>{const a=k(n,s);return H(a)||a.status.type!=="uploading"?s:L(a.id,a.setStatus({type:"uploaded",fileId:i.fileId,fileUrls:i}),s)})}}),addFiles:N,getNextLocalFileId:P,deleteExistingFiles:()=>I.forEach(n=>A(n.id)),onUploadComplete:()=>{g.current&&g.current.focus()}}),{getRootProps:K,getInputProps:O}=Ut({onDrop:nt,multiple:b===v.Multiple,accept:zt(e.fileType),maxSize:W}),X=()=>{if(g.current&&g.current.focus(),!R||t)return;const n={data:F,fileUploaderState:ot()};r.setChatInputValue(e,n,{fromUi:!0},d),x([]),B("")},at=n=>{const{metaKey:i,ctrlKey:s,shiftKey:a}=n;Tt(n)&&!a&&!s&&!i&&(n.preventDefault(),X())},rt=n=>{const{value:i}=n.target;y!==0&&i.length>y||(B(i),w.updateScrollHeight())};l.useEffect(()=>{if(e.setValue){e.setValue=!1;const n=e.value||"";B(n)}},[e]),l.useEffect(()=>{const n=a=>{a.preventDefault(),a.stopPropagation(),!U&&a.dataTransfer?.types.includes("Files")&&D(!0)},i=a=>{a.preventDefault(),a.stopPropagation(),U&&(a.clientX<=0&&a.clientY<=0||a.clientX>=T&&a.clientY>=V)&&D(!1)},s=a=>{a.preventDefault(),a.stopPropagation(),U&&D(!1)};return window.addEventListener("dragover",n),window.addEventListener("drop",s),window.addEventListener("dragleave",i),()=>{window.removeEventListener("dragover",n),window.removeEventListener("drop",s),window.removeEventListener("dragleave",i)}},[U,T,V]);const it=b!==v.None&&U;return S(Q,{children:[b===v.None?null:o(oe,{items:[...I],onDelete:A}),o(Ht,{className:"stChatInput","data-testid":"stChatInput",ref:h,children:it?o(le,{getRootProps:K,getInputProps:O,acceptFile:b,inputHeight:w.height}):S(Lt,{extended:w.isExtended,children:[b===v.None?null:o(ie,{getRootProps:K,getInputProps:O,acceptFile:b,disabled:t,theme:c}),o(Dt,{inputRef:g,value:F,placeholder:C,onChange:rt,onKeyDown:at,"aria-label":C,disabled:t,rows:1,overrides:{Root:{style:{minHeight:c.sizes.minElementHeight,outline:"none",borderLeftWidth:"0",borderRightWidth:"0",borderTopWidth:"0",borderBottomWidth:"0",borderTopLeftRadius:"0",borderTopRightRadius:"0",borderBottomRightRadius:"0",borderBottomLeftRadius:"0"}},Input:{props:{"data-testid":"stChatInputTextArea"},style:{fontWeight:c.fontWeights.normal,lineHeight:c.lineHeights.inputWidget,"::placeholder":{color:c.colors.fadedText60},height:w.height,maxHeight:w.maxHeight,paddingLeft:c.spacing.none,paddingBottom:c.spacing.sm,paddingTop:c.spacing.sm,paddingRight:`calc(${c.iconSizes.xl} + 2 * ${c.spacing.sm} + ${c.spacing.sm})`}}}}),u>c.breakpoints.hideWidgetDetails&&o($t,{children:o(Et,{dirty:R,value:F,maxLength:y,type:"chat",inForm:!1})}),o(Mt,{children:o(kt,{onClick:X,disabled:!R||t,extended:w.isExtended,"data-testid":"stChatInputSubmitButton",children:o(E,{content:et,size:"xl",color:"inherit"})})})]})})]})}const Ce=l.memo(de);export{Ce as default};
1
+ import{r as l,E as _,_ as G,s as p,B as dt,z as $,j as o,b9 as Y,bu as ct,C as S,bp as J,b4 as q,bo as E,a_ as pt,bI as ut,bG as j,bj as gt,bJ as v,bs as ht,F as Q,aP as ft,bg as mt,bK as yt,M as H,bl as Ct,bk as bt}from"./index.D1AeFlAQ.js";import{g as vt,C as It,I as xt,F as M,E as wt,a as St,s as Ft,u as Ut,b as zt}from"./FileHelper.QQBwcr1S.js";import{I as Et}from"./InputInstructions.DQ5Ej_7M.js";import{i as Tt}from"./inputUtils.CptNuJwn.js";import{u as Bt,T as Dt}from"./useTextInputAutoExpand.Qpzi9U5B.js";import{E as Rt}from"./ErrorOutline.esm.DNK5J9Fz.js";import{U as Z}from"./UploadFileInfo.C-jY39rj.js";import"./base-input.DiS6HF4j.js";var tt=l.forwardRef(function(t,e){var r={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return l.createElement(_,G({iconAttrs:r,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},t,{ref:e}),l.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),l.createElement("path",{d:"M16.5 6v11.5c0 2.21-1.79 4-4 4s-4-1.79-4-4V5a2.5 2.5 0 015 0v10.5c0 .55-.45 1-1 1s-1-.45-1-1V6H10v9.5a2.5 2.5 0 005 0V5c0-2.21-1.79-4-4-4S7 2.79 7 5v12.5c0 3.04 2.46 5.5 5.5 5.5s5.5-2.46 5.5-5.5V6h-1.5z"}))});tt.displayName="AttachFile";var et=l.forwardRef(function(t,e){var r={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return l.createElement(_,G({iconAttrs:r,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},t,{ref:e}),l.createElement("rect",{width:24,height:24,fill:"none"}),l.createElement("path",{d:"M3 5.51v3.71c0 .46.31.86.76.97L11 12l-7.24 1.81c-.45.11-.76.51-.76.97v3.71c0 .72.73 1.2 1.39.92l15.42-6.49c.82-.34.82-1.5 0-1.84L4.39 4.58C3.73 4.31 3 4.79 3 5.51z"}))});et.displayName="Send";const Ht=p("div",{target:"e1togvvn0"})("border:none;position:relative;display:flex;"),Lt=p("div",{target:"e1togvvn1"})(({theme:t,extended:e})=>({border:`${t.sizes.borderWidth} solid`,borderColor:t.colors.widgetBorderColor??t.colors.transparent,borderRadius:t.radii.chatInput,backgroundColor:t.colors.secondaryBg,position:"relative",flexGrow:1,display:"flex",alignItems:"center",paddingLeft:t.spacing.lg,maxHeight:e?"none":t.sizes.minElementHeight,gap:t.spacing.sm,overflow:"hidden",":focus-within":{borderColor:t.colors.primary}})),kt=p("button",{target:"e1togvvn2"})(({theme:t,disabled:e,extended:r})=>{const d=dt(t),[f,c]=d?[t.colors.gray60,t.colors.gray80]:[t.colors.gray80,t.colors.gray40];return{border:"none",backgroundColor:t.colors.transparent,borderTopRightRadius:r?"0":t.radii.chatInput,borderTopLeftRadius:r?t.radii.default:"0",borderBottomRightRadius:t.radii.chatInput,display:"inline-flex",alignItems:"center",justifyContent:"center",lineHeight:t.lineHeights.none,margin:t.spacing.none,padding:t.spacing.sm,color:e?f:c,pointerEvents:"auto","&:focus":{outline:"none"},":focus":{outline:"none"},"&:focus-visible":{backgroundColor:d?t.colors.gray10:t.colors.gray90},"&:hover":{color:t.colors.primary},"&:disabled, &:disabled:hover, &:disabled:active":{backgroundColor:t.colors.transparent,borderColor:t.colors.transparent,color:t.colors.gray,cursor:"not-allowed"}}}),Mt=p("div",{target:"e1togvvn3"})(({theme:t})=>({display:"flex",alignItems:"flex-end",height:"100%",position:"absolute",right:0,marginBottom:`-${t.sizes.borderWidth}`,pointerEvents:"none"})),$t=p("div",{target:"e1togvvn4"})(({theme:t})=>({position:"absolute",bottom:"0px",right:`calc(${t.iconSizes.xl} + 2 * ${t.spacing.sm} + ${t.spacing.sm})`})),Vt=p("div",{target:"e15560op0"})(({theme:t,height:e})=>({backgroundColor:t.colors.transparent,position:"absolute",left:0,bottom:0,minHeight:`max(${t.sizes.emptyDropdownHeight}, ${e})`,width:"100%",zIndex:t.zIndices.priority})),Wt=p("div",{target:"e15560op1"})(({theme:t,height:e})=>({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",height:e,width:"100%",fontWeight:t.fontWeights.bold})),Nt=p("div",{target:"e15560op2"})(({theme:t,disabled:e})=>({display:"flex",alignItems:"top",height:"100%",marginTop:`-${t.sizes.borderWidth}`,cursor:e?"not-allowed":"auto"})),At=p("div",{target:"e15560op3"})(({disabled:t})=>({pointerEvents:t?"none":"auto"})),Pt=p("div",{target:"e15560op4"})(({theme:t})=>({marginTop:"0.625em",marginLeft:t.spacing.sm,height:t.spacing.xl,width:t.sizes.borderWidth,backgroundColor:t.colors.fadedText20})),Kt=p("div",{target:"e15560op5"})(({theme:t})=>({left:0,right:0,lineHeight:t.lineHeights.tight,paddingLeft:t.spacing.sm,paddingRight:t.spacing.sm,overflowX:"auto"})),Ot=p("div",{target:"e15560op6"})({display:"flex"}),Xt=p("div",{target:"e15560op7"})({flex:"0 0 auto"}),jt=p("div",{target:"e15560op8"})(({theme:t})=>({display:"flex",alignItems:"center",padding:t.spacing.sm,gap:t.spacing.twoXS})),_t=p("div",{target:"e15560op9"})(({theme:t})=>({color:t.colors.fadedText60})),Gt=p("div",{target:"e15560op10"})(({theme:t,fileStatus:e})=>({overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:e.type==="uploaded"?t.colors.bodyText:t.colors.fadedText60})),Yt=p("div",{target:"e15560op11"})(({theme:t})=>({marginRight:t.spacing.md,color:t.colors.fadedText60})),Jt=p("small",{target:"e15560op12"})(({theme:t})=>({display:"flex",alignItems:"center",maxHeight:t.sizes.smallElementHeight,color:t.colors.fadedText60,"& :hover":{color:t.colors.bodyText}}));function qt({children:t,content:e}){const r=$();return o(ct,{content:e,placement:Y.TOP,overrides:{Body:{style:{top:`-${r.sizes.minElementHeight}`}}},children:t})}const Qt=({fileInfo:t})=>{const e=$(),{type:r}=t.status;switch(r){case"uploading":return o(ut,{usingCustomTheme:!1,"data-testid":"stChatInputFileIconSpinner",size:"lg",margin:"0",padding:"0"});case"error":return o(qt,{content:t.status.errorMessage,children:o(E,{color:e.colors.red,content:Rt,size:"lg"})});case"uploaded":return o(E,{content:xt,size:"lg"});default:return pt(r),null}},Zt=({fileInfo:t,onDelete:e})=>S(jt,{className:"stChatInputFile","data-testid":"stChatInputFile",children:[o(_t,{children:o(Qt,{fileInfo:t})}),o(Gt,{className:"stChatInputFileName","data-testid":"stChatInputFileName",title:t.name,fileStatus:t.status,children:t.name}),o(Yt,{children:vt(t.size,M.Byte)}),o(Jt,{"data-testid":"stChatInputDeleteBtn",children:o(J,{onClick:()=>e(t.id),kind:q.MINIMAL,children:o(E,{content:It,size:"lg"})})})]}),te=l.memo(Zt),ee=({items:t,onDelete:e})=>o(Kt,{"data-testid":"stChatUploadedFiles",children:o(Ot,{children:t.map(r=>o(Xt,{children:o(te,{fileInfo:r,onDelete:e})},r.id))})}),oe=l.memo(ee),ne=({getNextLocalFileId:t,addFiles:e,updateFile:r,uploadClient:d,element:f,onUploadProgress:c,onUploadComplete:C})=>(y,m)=>{const g=j.CancelToken.source(),u=new Z(m.name,m.size,t(),{type:"uploading",cancelToken:g,progress:1});e([u]),d.uploadFile({formId:"",...f},y.uploadUrl,m,h=>c(h,u.id),g.token).then(()=>C(u.id,y)).catch(h=>{j.isCancel(h)||r(u.id,u.setStatus({type:"error",errorMessage:h?h.toString():"Unknown error"}))})},ae=({acceptMultipleFiles:t,maxFileSize:e,uploadClient:r,uploadFile:d,addFiles:f,getNextLocalFileId:c,deleteExistingFiles:C,onUploadComplete:y})=>(m,g)=>{if(!t&&m.length===0&&g.length>1){const u=g.findIndex(h=>h.errors?.[0].code===wt.TooManyFiles);u>=0&&(m.push(g[u].file),g.splice(u,1))}if(!t&&m.length>0&&C(),r.fetchFileURLs(m).then(u=>{gt(u,m).forEach(([h,T])=>{d(h,T)})}).catch(u=>{f(m.map(h=>new Z(h.name,h.size,c(),{type:"error",errorMessage:u})))}),g.length>0){const u=g.map(h=>St(h,c(),e));f(u)}y()},re=({getRootProps:t,getInputProps:e,acceptFile:r,disabled:d,theme:f})=>S(Nt,{disabled:d,children:[S(At,{"data-testid":"stChatInputFileUploadButton",disabled:d,...t(),children:[o("input",{...e()}),o(ht,{content:`Upload or drag and drop ${r===v.Multiple?"files":"a file"}`,placement:Y.TOP,onMouseEnterDelay:500,children:o(J,{kind:q.MINIMAL,disabled:d,children:o(E,{content:tt,size:"lg",color:d?f.colors.fadedText40:f.colors.fadedText60})})})]}),o(Pt,{})]}),ie=l.memo(re),se=({getRootProps:t,getInputProps:e,acceptFile:r,inputHeight:d})=>S(Q,{children:[o(Vt,{height:d,...t(),children:o("input",{...e()})}),o(Wt,{height:d,children:`Drag and drop ${r===v.Multiple?"files":"a file"} here`})]}),le=l.memo(se),L=(t,e,r)=>r.map(d=>d.id===t?e:d),k=(t,e)=>e.find(r=>r.id===t);function de({disabled:t,element:e,widgetMgr:r,fragmentId:d,uploadClient:f}){const c=$(),{placeholder:C,maxChars:y}=e,m=l.useRef(0),g=l.useRef(null),[u,h]=ft(),{innerWidth:T,innerHeight:V}=mt(),[F,B]=l.useState(e.default),[I,x]=l.useState([]),[U,D]=l.useState(!1),w=Bt({textareaRef:g,dependencies:[C]}),R=l.useMemo(()=>I.some(n=>n.status.type==="uploading")?!1:F!==""||I.length>0,[I,F]),b=yt(e.acceptFile),W=Ft(e.maxUploadSizeMb,M.Megabyte,M.Byte),N=l.useCallback(n=>x(i=>[...i,...n]),[]),A=l.useCallback(n=>{x(i=>{const s=k(n,i);return H(s)?i:(s.status.type==="uploading"&&s.status.cancelToken.cancel(),s.status.type==="uploaded"&&s.status.fileUrls.deleteUrl&&f.deleteFile(s.status.fileUrls.deleteUrl),i.filter(a=>a.id!==n))})},[f]),ot=()=>{const n=I.filter(i=>i.status.type==="uploaded").map(i=>{const{name:s,size:a,status:z}=i,{fileId:st,fileUrls:lt}=z;return new Ct({fileId:st,fileUrls:lt,name:s,size:a})});return new bt({uploadedFileInfo:n})},P=()=>m.current++,nt=ae({acceptMultipleFiles:b===v.Multiple,maxFileSize:W,uploadClient:f,uploadFile:ne({getNextLocalFileId:P,addFiles:N,updateFile:(n,i)=>{x(s=>L(n,i,s))},uploadClient:f,element:e,onUploadProgress:(n,i)=>{x(s=>{const a=k(i,s);if(H(a)||a.status.type!=="uploading")return s;const z=Math.round(n.loaded*100/n.total);return a.status.progress===z?s:L(i,a.setStatus({type:"uploading",cancelToken:a.status.cancelToken,progress:z}),s)})},onUploadComplete:(n,i)=>{x(s=>{const a=k(n,s);return H(a)||a.status.type!=="uploading"?s:L(a.id,a.setStatus({type:"uploaded",fileId:i.fileId,fileUrls:i}),s)})}}),addFiles:N,getNextLocalFileId:P,deleteExistingFiles:()=>I.forEach(n=>A(n.id)),onUploadComplete:()=>{g.current&&g.current.focus()}}),{getRootProps:K,getInputProps:O}=Ut({onDrop:nt,multiple:b===v.Multiple,accept:zt(e.fileType),maxSize:W}),X=()=>{if(g.current&&g.current.focus(),!R||t)return;const n={data:F,fileUploaderState:ot()};r.setChatInputValue(e,n,{fromUi:!0},d),x([]),B("")},at=n=>{const{metaKey:i,ctrlKey:s,shiftKey:a}=n;Tt(n)&&!a&&!s&&!i&&(n.preventDefault(),X())},rt=n=>{const{value:i}=n.target;y!==0&&i.length>y||(B(i),w.updateScrollHeight())};l.useEffect(()=>{if(e.setValue){e.setValue=!1;const n=e.value||"";B(n)}},[e]),l.useEffect(()=>{const n=a=>{a.preventDefault(),a.stopPropagation(),!U&&a.dataTransfer?.types.includes("Files")&&D(!0)},i=a=>{a.preventDefault(),a.stopPropagation(),U&&(a.clientX<=0&&a.clientY<=0||a.clientX>=T&&a.clientY>=V)&&D(!1)},s=a=>{a.preventDefault(),a.stopPropagation(),U&&D(!1)};return window.addEventListener("dragover",n),window.addEventListener("drop",s),window.addEventListener("dragleave",i),()=>{window.removeEventListener("dragover",n),window.removeEventListener("drop",s),window.removeEventListener("dragleave",i)}},[U,T,V]);const it=b!==v.None&&U;return S(Q,{children:[b===v.None?null:o(oe,{items:[...I],onDelete:A}),o(Ht,{className:"stChatInput","data-testid":"stChatInput",ref:h,children:it?o(le,{getRootProps:K,getInputProps:O,acceptFile:b,inputHeight:w.height}):S(Lt,{extended:w.isExtended,children:[b===v.None?null:o(ie,{getRootProps:K,getInputProps:O,acceptFile:b,disabled:t,theme:c}),o(Dt,{inputRef:g,value:F,placeholder:C,onChange:rt,onKeyDown:at,"aria-label":C,disabled:t,rows:1,overrides:{Root:{style:{minHeight:c.sizes.minElementHeight,outline:"none",borderLeftWidth:"0",borderRightWidth:"0",borderTopWidth:"0",borderBottomWidth:"0",borderTopLeftRadius:"0",borderTopRightRadius:"0",borderBottomRightRadius:"0",borderBottomLeftRadius:"0"}},Input:{props:{"data-testid":"stChatInputTextArea"},style:{fontWeight:c.fontWeights.normal,lineHeight:c.lineHeights.inputWidget,"::placeholder":{color:c.colors.fadedText60},height:w.height,maxHeight:w.maxHeight,paddingLeft:c.spacing.none,paddingBottom:c.spacing.sm,paddingTop:c.spacing.sm,paddingRight:`calc(${c.iconSizes.xl} + 2 * ${c.spacing.sm} + ${c.spacing.sm})`}}}}),u>c.breakpoints.hideWidgetDetails&&o($t,{children:o(Et,{dirty:R,value:F,maxLength:y,type:"chat",inForm:!1})}),o(Mt,{children:o(kt,{onClick:X,disabled:!R||t,extended:w.isExtended,"data-testid":"stChatInputSubmitButton",children:o(E,{content:et,size:"xl",color:"inherit"})})})]})})]})}const Ce=l.memo(de);export{Ce as default};