streamlit-nightly 1.53.2.dev20260203__py3-none-any.whl → 1.54.1.dev20260204__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 (127) hide show
  1. streamlit/elements/arrow.py +66 -26
  2. streamlit/elements/lib/built_in_chart_utils.py +1 -1
  3. streamlit/elements/lib/column_config_utils.py +4 -4
  4. streamlit/elements/lib/options_selector_utils.py +4 -0
  5. streamlit/elements/lib/pandas_styler_utils.py +22 -22
  6. streamlit/elements/widgets/button_group.py +221 -86
  7. streamlit/elements/widgets/data_editor.py +9 -9
  8. streamlit/elements/widgets/radio.py +8 -4
  9. streamlit/hello/dataframe_demo.py +1 -1
  10. streamlit/proto/ArrowData_pb2.py +5 -3
  11. streamlit/proto/ArrowData_pb2.pyi +44 -4
  12. streamlit/proto/ArrowNamedDataSet_pb2.py +4 -4
  13. streamlit/proto/ArrowNamedDataSet_pb2.pyi +3 -3
  14. streamlit/proto/ArrowVegaLiteChart_pb2.py +4 -4
  15. streamlit/proto/ArrowVegaLiteChart_pb2.pyi +3 -3
  16. streamlit/proto/ButtonGroup_pb2.py +8 -8
  17. streamlit/proto/ButtonGroup_pb2.pyi +9 -7
  18. streamlit/proto/Dataframe_pb2.py +31 -0
  19. streamlit/proto/{Arrow_pb2.pyi → Dataframe_pb2.pyi} +39 -102
  20. streamlit/proto/Element_pb2.py +5 -4
  21. streamlit/proto/Element_pb2.pyi +11 -10
  22. streamlit/proto/Table_pb2.py +29 -0
  23. streamlit/proto/Table_pb2.pyi +83 -0
  24. streamlit/static/index.html +1 -1
  25. streamlit/static/manifest.json +308 -308
  26. streamlit/static/static/js/{ErrorOutline.esm.C9uHPmIj.js → ErrorOutline.esm.DWBqsdHn.js} +1 -1
  27. streamlit/static/static/js/{FileDownload.esm.D-YPxF3t.js → FileDownload.esm.D5koxJhf.js} +1 -1
  28. streamlit/static/static/js/{FileHelper.DQSH0zYW.js → FileHelper.kJKftfu4.js} +5 -5
  29. streamlit/static/static/js/{FormClearHelper.DQoXcOWo.js → FormClearHelper.CyGGPn10.js} +1 -1
  30. streamlit/static/static/js/{InputInstructions.C7VMyGT7.js → InputInstructions.oezYb8Lm.js} +1 -1
  31. streamlit/static/static/js/{Particles.BdQSRZde.js → Particles.BIpBmEwi.js} +1 -1
  32. streamlit/static/static/js/{ProgressBar.DNF_pWKr.js → ProgressBar.BRAS_FJc.js} +1 -1
  33. streamlit/static/static/js/{StreamlitSyntaxHighlighter.Cys9Bt18.js → StreamlitSyntaxHighlighter.c2qcx-xG.js} +1 -1
  34. streamlit/static/static/js/{TableChart.esm.B9SMgSK4.js → TableChart.esm.BuemQLVW.js} +1 -1
  35. streamlit/static/static/js/{Toolbar.BXfC9Z-W.js → Toolbar.mUe2Nmta.js} +1 -1
  36. streamlit/static/static/js/{WidgetLabelHelpIconInline.gkreC55g.js → WidgetLabelHelpIconInline.if89y2mu.js} +1 -1
  37. streamlit/static/static/js/{base-input.iB32RS3w.js → base-input.AJ4KxBTh.js} +1 -1
  38. streamlit/static/static/js/{checkbox.Bqz68SYq.js → checkbox.GY4JoJkM.js} +1 -1
  39. streamlit/static/static/js/{createDownloadLinkElement.YxVC9Qur.js → createDownloadLinkElement.BWJh90jh.js} +1 -1
  40. streamlit/static/static/js/{data-grid-overlay-editor.sBsdk5Xg.js → data-grid-overlay-editor.C9AINtRf.js} +1 -1
  41. streamlit/static/static/js/{downloader.Bzxqt3AW.js → downloader.BZY8OE4f.js} +1 -1
  42. streamlit/static/static/js/{embed.CDzakah3.js → embed.BjO7Ez0y.js} +1 -1
  43. streamlit/static/static/js/{es6.CxCc4bfn.js → es6.eb5oR8iN.js} +2 -2
  44. streamlit/static/static/js/{formatNumber.L8T7D36k.js → formatNumber.CCeQsvJQ.js} +1 -1
  45. streamlit/static/static/js/{iconPosition.C47DkA-1.js → iconPosition.D6eEnKvO.js} +1 -1
  46. streamlit/static/static/js/{iframeResizer.contentWindow.uEFLXEg3.js → iframeResizer.contentWindow.DTsWJRTo.js} +1 -1
  47. streamlit/static/static/js/{index.C6dhwBSe.js → index.B6l4FdUv.js} +1 -1
  48. streamlit/static/static/js/{index.BV_YgIHe.js → index.B7H2q9vo.js} +2 -2
  49. streamlit/static/static/js/{index.DjgdCvlK.js → index.BDdmrM58.js} +1 -1
  50. streamlit/static/static/js/{index.CAbQaUvi.js → index.BMbQnwRD.js} +1 -1
  51. streamlit/static/static/js/{index.CCLteRW6.js → index.BQ5MOzHu.js} +1 -1
  52. streamlit/static/static/js/{index.CzwJzgQs.js → index.BSgo_bkv.js} +1 -1
  53. streamlit/static/static/js/{index.B60AZFRh.js → index.BU5M9DsN.js} +1 -1
  54. streamlit/static/static/js/{index.BVTW_o-a.js → index.BYIxnU34.js} +1 -1
  55. streamlit/static/static/js/{index.DqhZqWYB.js → index.BZL2hIBz.js} +1 -1
  56. streamlit/static/static/js/{index.CAbafj7s.js → index.BZVrJlnq.js} +1 -1
  57. streamlit/static/static/js/{index.Ck0ZkOfK.js → index.Bd7QK46M.js} +1 -1
  58. streamlit/static/static/js/{index.BzdcdLDK.js → index.BfHA_i34.js} +1 -1
  59. streamlit/static/static/js/{index.kBgXO7Vv.js → index.Bgry-Ek_.js} +1 -1
  60. streamlit/static/static/js/{index.aZRhdEuX.js → index.Bi25zaXA.js} +1 -1
  61. streamlit/static/static/js/{index.QXukCzoh.js → index.Bj3M1xBC.js} +1 -1
  62. streamlit/static/static/js/{index.Bnwh8oZr.js → index.Bjrvlqx5.js} +6 -6
  63. streamlit/static/static/js/{index.h2N-W51I.js → index.BnOSeM5K.js} +1 -1
  64. streamlit/static/static/js/index.BoL6J1jK.js +2 -0
  65. streamlit/static/static/js/{index.BwvxzVOo.js → index.BoORyxOa.js} +1 -1
  66. streamlit/static/static/js/{index.Ba8L-ulI.js → index.Bpd7GPeH.js} +1 -1
  67. streamlit/static/static/js/{index.BG4RxMOI.js → index.BpeJX018.js} +1 -1
  68. streamlit/static/static/js/index.BriH7JVk.js +2 -0
  69. streamlit/static/static/js/{index.DO55kRo5.js → index.BwkeObMo.js} +1 -1
  70. streamlit/static/static/js/{index.C1d2QjTR.js → index.C0o85qmd.js} +1 -1
  71. streamlit/static/static/js/{index.D7L9gHlE.js → index.C7_wNJTH.js} +1 -1
  72. streamlit/static/static/js/{index.BwTkGOAy.js → index.CGZP_w9b.js} +1 -1
  73. streamlit/static/static/js/{index.CjBDVb1a.js → index.CGw52-0-.js} +1 -1
  74. streamlit/static/static/js/{index.D_cvtSlg.js → index.CUvtJj0a.js} +1 -1
  75. streamlit/static/static/js/{index.Dtbj_oyb.js → index.Cfx1ZHWt.js} +1 -1
  76. streamlit/static/static/js/{index.BvHsyiyy.js → index.Chl2kALe.js} +1 -1
  77. streamlit/static/static/js/index.Crlx_wdE.js +1 -0
  78. streamlit/static/static/js/{index.B_LfkwqU.js → index.D9A-8ebQ.js} +1 -1
  79. streamlit/static/static/js/{index.BHyzKS4e.js → index.DBIoNOen.js} +7 -7
  80. streamlit/static/static/js/{index.DgqmsDCJ.js → index.DMKTAe4F.js} +1 -1
  81. streamlit/static/static/js/{index.DEKnCsY-.js → index.DNrpqKVt.js} +1 -1
  82. streamlit/static/static/js/{index.BsrhCS7f.js → index.DSRvF_8e.js} +1 -1
  83. streamlit/static/static/js/{index.DN_oudQl.js → index.DhB1m_xG.js} +1 -1
  84. streamlit/static/static/js/{index.XJY9qZ6a.js → index.DiES30vM.js} +1 -1
  85. streamlit/static/static/js/{index.DHrByikW.js → index.DlJ4Y1xc.js} +1 -1
  86. streamlit/static/static/js/{index.C5-TpWis.js → index.J61yByUR.js} +1 -1
  87. streamlit/static/static/js/{index.iUHLeAvv.js → index.JxDTXE8N.js} +1 -1
  88. streamlit/static/static/js/{index.C1uZrWog.js → index.KGr28TP8.js} +1 -1
  89. streamlit/static/static/js/{index.BuJPJSD7.js → index.Pgm3rRpH.js} +1 -1
  90. streamlit/static/static/js/{index.fUsWkW8E.js → index.XzcYOc9I.js} +1 -1
  91. streamlit/static/static/js/{index.CQ713nQM.js → index.Z_u7ZS4h.js} +1 -1
  92. streamlit/static/static/js/{index.D-9VyyiA.js → index.hDg7x0Tp.js} +1 -1
  93. streamlit/static/static/js/{index.D2R3Co5f.js → index.k7p0hmaU.js} +1 -1
  94. streamlit/static/static/js/{index.Bh5BZaHG.js → index.syoxWolF.js} +1 -1
  95. streamlit/static/static/js/{index.kEL0HsUR.js → index.xZ651bTg.js} +1 -1
  96. streamlit/static/static/js/{input.BCHJn1Cw.js → input.C-PwAMG6.js} +1 -1
  97. streamlit/static/static/js/{main.23ZP6f1E.js → main.fMmyxXOf.js} +1 -1
  98. streamlit/static/static/js/{memory.D8f8Q4mO.js → memory.BG__eDEj.js} +1 -1
  99. streamlit/static/static/js/{number-overlay-editor.ZWvSpjJ5.js → number-overlay-editor.C0n-91sR.js} +1 -1
  100. streamlit/static/static/js/{pandasStylerUtils.DlZ2GBs_.js → pandasStylerUtils.BqWaUzvh.js} +1 -1
  101. streamlit/static/static/js/{sandbox.BH6D3KL9.js → sandbox.CHhc-txg.js} +1 -1
  102. streamlit/static/static/js/{sprintfjs.CtrdaGLQ.js → sprintfjs.BlFBKfMf.js} +1 -1
  103. streamlit/static/static/js/{styled-components.iD1HRMLc.js → styled-components.D5uOQqN2.js} +1 -1
  104. streamlit/static/static/js/{throttle.DR7d9vp_.js → throttle.DlZC3xNA.js} +1 -1
  105. streamlit/static/static/js/{timepicker.Bd34xjcG.js → timepicker._TfRUaDL.js} +1 -1
  106. streamlit/static/static/js/{toConsumableArray.BDTTq1c5.js → toConsumableArray.CZW4AmuW.js} +1 -1
  107. streamlit/static/static/js/uniqueId.CTTDAAaF.js +1 -0
  108. streamlit/static/static/js/{useBasicWidgetState.BXKaD8DQ.js → useBasicWidgetState.Bx27912z.js} +1 -1
  109. streamlit/static/static/js/{useIntlLocale.CysOvegI.js → useIntlLocale.DsOvysl7.js} +1 -1
  110. streamlit/static/static/js/{useTextInputAutoExpand.CVd5Hf2S.js → useTextInputAutoExpand.C9g8px1W.js} +1 -1
  111. streamlit/static/static/js/{useUpdateUiValue.CIUgfO8X.js → useUpdateUiValue.fF-Cntkp.js} +1 -1
  112. streamlit/static/static/js/{useWaveformController.CDLqlnLv.js → useWaveformController.C5EtFoJE.js} +1 -1
  113. streamlit/static/static/js/{withCalculatedWidth.Ce1Zblb2.js → withCalculatedWidth.CcvaXQb0.js} +1 -1
  114. streamlit/static/static/js/{withFullScreenWrapper.DBm7N75M.js → withFullScreenWrapper.DP61hzLF.js} +1 -1
  115. streamlit/testing/v1/element_tree.py +20 -15
  116. streamlit/web/server/routes.py +14 -0
  117. streamlit/web/server/server.py +4 -0
  118. {streamlit_nightly-1.53.2.dev20260203.dist-info → streamlit_nightly-1.54.1.dev20260204.dist-info}/METADATA +1 -1
  119. {streamlit_nightly-1.53.2.dev20260203.dist-info → streamlit_nightly-1.54.1.dev20260204.dist-info}/RECORD +122 -120
  120. streamlit/proto/Arrow_pb2.py +0 -34
  121. streamlit/static/static/js/index.B3zULhHv.js +0 -1
  122. streamlit/static/static/js/index.BrZtYm2A.js +0 -2
  123. streamlit/static/static/js/index.CcBYyLfq.js +0 -2
  124. streamlit/static/static/js/uniqueId.Bd_Iuzvc.js +0 -1
  125. {streamlit_nightly-1.53.2.dev20260203.dist-info → streamlit_nightly-1.54.1.dev20260204.dist-info}/WHEEL +0 -0
  126. {streamlit_nightly-1.53.2.dev20260203.dist-info → streamlit_nightly-1.54.1.dev20260204.dist-info}/entry_points.txt +0 -0
  127. {streamlit_nightly-1.53.2.dev20260203.dist-info → streamlit_nightly-1.54.1.dev20260204.dist-info}/top_level.txt +0 -0
@@ -1 +1 @@
1
- import{r,E as S,_ as E,V as ct,z as m,cz as b,cx as Fe,o as A,j as a,P as ue,az as V,aA as pe,$ as K,b as dt,B as ut,Y as Me,b_ as pt,l as gt,k as ft,bf as ht,cA as mt,e as ie,bT as Re,bU as wt,ac as vt}from"./index.BHyzKS4e.js";import{u as Te,I as Ct,g as Ve,F as Y,E as ce,b as xt,s as yt,a as Ae}from"./FileHelper.DQSH0zYW.js";import{u as bt}from"./useWaveformController.CDLqlnLv.js";import{I as St}from"./InputInstructions.C7VMyGT7.js";import{u as Et,T as It}from"./useTextInputAutoExpand.CVd5Hf2S.js";import{i as zt}from"./inputUtils.CptNuJwn.js";import{T as Rt}from"./TableChart.esm.B9SMgSK4.js";import{E as Vt}from"./ErrorOutline.esm.C9uHPmIj.js";import{U as ke}from"./UploadFileInfo.Dr-zDST7.js";import"./base-input.iB32RS3w.js";var Ue=r.forwardRef(function(e,t){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return r.createElement(S,E({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 De=r.forwardRef(function(e,t){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return r.createElement(S,E({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"}))});De.displayName="Code";var He=r.forwardRef(function(e,t){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return r.createElement(S,E({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"}))});He.displayName="Description";var Le=r.forwardRef(function(e,t){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return r.createElement(S,E({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"}))});Le.displayName="Folder";var Ne=r.forwardRef(function(e,t){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return r.createElement(S,E({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 Be=r.forwardRef(function(e,t){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return r.createElement(S,E({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"}))});Be.displayName="MusicNote";var We=r.forwardRef(function(e,t){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return r.createElement(S,E({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"}))});We.displayName="MicNone";var Pe=r.forwardRef(function(e,t){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return r.createElement(S,E({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"}))});Pe.displayName="Videocam";var Oe=r.forwardRef(function(e,t){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return r.createElement(S,E({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"}))});Oe.displayName="Add";var $e=r.forwardRef(function(e,t){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return r.createElement(S,E({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"}))});$e.displayName="ArrowUpward";var Xe=r.forwardRef(function(e,t){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return r.createElement(S,E({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"}))});Xe.displayName="Cancel";var je=r.forwardRef(function(e,t){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return r.createElement(S,E({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"}))});je.displayName="Check";var _e=r.forwardRef(function(e,t){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return r.createElement(S,E({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"}))});_e.displayName="Close";var Ke=r.forwardRef(function(e,t){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return r.createElement(S,E({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"}))});Ke.displayName="ErrorOutline";const _=ct.getLogger("ChatInput"),At=m("div",{target:"e15xmbo00"})({position:"relative",display:"flex",flexDirection:"column"}),Ft=m("div",{target:"e15xmbo01"})(({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}})),Mt=m("div",{target:"e15xmbo02"})(({theme:e})=>({display:"flex",flexWrap:"wrap",gap:e.spacing.sm})),Tt=m("div",{target:"e15xmbo03"})(({theme:e,isStacked:t})=>({display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",width:"100%",gap:e.spacing.sm,flexWrap:t?"wrap":"nowrap"})),kt=m("div",{target:"e15xmbo04"})(({isStacked:e})=>({flex:e?"none":1,width:e?"100%":"auto",order:e?-1:0,display:"flex",alignItems:"center",minWidth:0})),Ut=m("div",{target:"e15xmbo05"})(({theme:e})=>({display:"flex",flexDirection:"row",flexShrink:0,gap:e.spacing.sm,alignItems:"center"})),Dt=m("div",{target:"e15xmbo06"})(({theme:e})=>({display:"flex",flexDirection:"row",gap:e.spacing.sm,alignItems:"center"})),Ht=m("div",{target:"e15xmbo07"})(({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:"e15xmbo08"})(({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:e.shadows.focusRing},"&: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:e.shadows.focusRing},"&: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}}}),Lt=m("div",{target:"e15xmbo09"})(({isRecording:e})=>({display:e?"flex":"none",flex:1,alignItems:"center",minWidth:0})),Nt=m("div",{target:"e15xmbo010"})(({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,Bt=(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})},Wt=(e,t)=>Bt(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 Fe(e),"a file"}},Pt=m("div",{target:"e1lsn30a0"})(({theme:e})=>({backgroundColor:e.colors.transparent,position:"absolute",inset:0,zIndex:e.zIndices.priority,borderRadius:e.radii.chatInput})),Ot=m("div",{target:"e1lsn30a1"})(({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})),$t=m("div",{target:"e1lsn30a2"})(({disabled:e})=>({pointerEvents:e?"none":"auto"})),Xt=m("div",{target:"e1lsn30a3"})(({theme:e})=>({lineHeight:e.lineHeights.tight})),jt=m("div",{target:"e1lsn30a4"})(({theme:e})=>({display:"flex",flexWrap:"wrap",gap:e.spacing.sm})),_t=m("div",{target:"e1lsn30a5"})({flex:"0 0 auto",maxWidth:"100%"}),Kt=m("div",{target:"e1lsn30a6"})(({theme:e,isError:t,isClickable:o})=>({position:"relative",display:"inline-flex",alignItems:"center",width:"fit-content",minWidth:"9rem",maxWidth:"100%",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:"e1lsn30a7"})({display:"flex",flexDirection:"column",minWidth:0}),Gt=m("div",{target:"e1lsn30a8"})(({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}})),qt=m("img",{target:"e1lsn30a9"})({width:"100%",height:"100%",objectFit:"cover"}),Jt=m("div",{target:"e1lsn30a10"})(({theme:e,fileStatus:t})=>({overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:t.type==="uploading"?e.colors.fadedText60:e.colors.bodyText})),Qt=m("div",{target:"e1lsn30a11"})(({theme:e})=>({color:e.colors.fadedText60,fontSize:e.fontSizes.sm})),Zt=m("small",{target:"e1lsn30a12"})(({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}}})),er=m("span",{target:"e1lsn30a13"})({position:"absolute",width:"1px",height:"1px",padding:0,margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",border:0}),tr=({onDrop:e,multiple:t,accept:o,maxSize:p,acceptFile:l,disabled:w})=>{const{getRootProps:d,getInputProps:v}=Te({onDrop:e,multiple:t,accept:o,maxSize:p,useFsAccessApi:!1}),C=Ye(v(),l),c=d({tabIndex:-1});return A($t,{"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:Oe,size:"xl",color:"inherit"})})})]})},rr=r.memo(tr),or=({getRootProps:e,getInputProps:t,acceptFile:o})=>{const p=Ye(t(),o);return A(K,{children:[a(Pt,{...e(),children:a("input",{...p})}),a(Ot,{children:`Drag and drop ${de(o)} here`})]})},nr=r.memo(or),Ge=new Set(["jpg","jpeg","png","gif","webp","svg","bmp"]),ar=new Set(["pdf"]),ir=new Set(["csv","tsv","xlsx","xls"]),sr=new Set(["txt","md","json","xml","yaml","yml"]),lr=new Set(["py","js","ts","jsx","tsx","css","html","java","cpp","c","go","rs","rb","php","swift","kt","scala","sh","bash","sql"]),cr=new Set(["mp3","wav","m4a","ogg","flac","aac"]),dr=new Set(["mp4","webm","mov","avi","mkv","wmv"]),ur=new Set(["zip","tar","gz","rar","7z","bz2"]);function qe(e){const t=e.lastIndexOf(".");return t===-1||t===e.length-1?"":e.slice(t+1).toLowerCase()}function pr(e){const t=qe(e);return Ge.has(t)?Ne:ar.has(t)?Ue:ir.has(t)?Rt:sr.has(t)?He:lr.has(t)?De:cr.has(t)?Be:dr.has(t)?Pe:ur.has(t)?Le:Ct}function gr(e){const t=qe(e);return Ge.has(t)}const fr=20;function hr(e,t=fr){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 mr(e,t){const o=r.useMemo(()=>!e||!gr(t)?null:URL.createObjectURL(e),[e,t]);return r.useEffect(()=>()=>{o&&URL.revokeObjectURL(o)},[o]),o}const wr=({fileInfo:e,imagePreviewUrl:t})=>{const{type:o}=e.status;switch(o){case"uploading":return a(Me,{iconValue:"spinner",testid:"stChatInputFileIconSpinner",size:"lg"});case"error":return a(V,{content:Vt,size:"lg",testid:"stChatInputFileIconError"});case"uploaded":return t?a(qt,{src:t,alt:e.name,"data-testid":"stChatInputFileImagePreview"}):a(V,{content:pr(e.name),size:"lg"});default:return Fe(o),null}},vr=({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=mr(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(x=>{d&&(x.key==="Enter"||x.key===" ")&&(x.preventDefault(),o(e))},[d,o,e]),h=r.useCallback(x=>{x.stopPropagation(),t(e.id)},[t,e.id]),k=w?`Cancel upload of ${e.name}`:`Remove ${e.name}`,G=Ve(e.size,Y.Byte),W=`${e.name}, ${G}`,U=A(Kt,{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(Gt,{fileStatus:p,children:a(wr,{fileInfo:e,imagePreviewUrl:C})}),A(Yt,{children:[a(Jt,{className:"stChatInputFileName","data-testid":"stChatInputFileName",title:e.name,fileStatus:e.status,children:hr(e.name)}),a(Qt,{children:Ve(e.size,Y.Byte)})]}),a(Zt,{"data-testid":"stChatInputDeleteBtn",isError:l,children:a(dt,{onClick:h,kind:ut.MINIMAL,"aria-label":k,children:a(V,{content:Xe,size:"md"})})}),l&&A(er,{id:v,role:"alert",children:["Error: ",c]})]});return l?a(pe,{content:c,placement:ue.TOP,error:!0,children:U}):U},Cr=r.memo(vr),xr=({items:e,onDelete:t,onRetry:o})=>a(Xt,{"data-testid":"stChatUploadedFiles",children:a(jt,{children:e.map(p=>a(_t,{children:a(Cr,{fileInfo:p,onDelete:t,onRetry:o})},p.id))})}),yr=r.memo(xr),br=(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=Wt(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}},Sr=({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}=br(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=>{pt(g,c).forEach(([h,k])=>{p(h,k)})}).catch(g=>{l(c.map(h=>new ke(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 ke(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 zr({disabled:e,element:t,widgetMgr:o,fragmentId:p,uploadClient:l}){const w=gt(),{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:G}=ft(),{innerWidth:W,innerHeight:U}=ht(),[x,q]=r.useState(t.default),[z,F]=r.useState([]),[D,J]=r.useState(!1),[H,ge]=r.useState(!1),[Q,L]=r.useState(null),[M,Z]=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),N=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;N(n);const i=new ResizeObserver(()=>N(n));return i.observe(n),()=>i.disconnect()},[N,M]),r.useEffect(()=>{if(x===""){Z(!1);return}if(M)return;const n=c.current;if(!n||(($.current<=0||!O.current)&&N(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(x).width>$.current-10&&Z(!0))},[x,M,N]);const X=r.useMemo(()=>z.some(n=>n.status.type==="uploading")?!1:x!==""||z.length>0,[z,x]),I=mt(t.acceptFile),re=yt(t.maxUploadSizeMb,Y.Megabyte,Y.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(y=>y.id!==n);return s.length===0&&fe(y=>y+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=z.filter(i=>i.status.type==="uploaded").map(i=>{const{name:u,size:s,status:y}=i,{fileId:ae,fileUrls:lt}=y;return new Re({fileId:ae,fileUrls:lt,name:u,size:s})});return new wt({uploadedFileInfo:n})},[z]),xe=()=>C.current++,ne=Sr({acceptMultipleFiles:I===b.Multiple||I===b.Directory,maxFileSize:re,uploadClient:l,uploadFile:Er({getNextLocalFileId:xe,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 y=Math.round(n.loaded*100/n.total);return s.status.progress===y?u:se(i,s.setStatus({type:"uploading",abortController:s.status.abortController,progress:y}),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:xe,deleteExistingFiles:()=>z.forEach(n=>ve(n.id)),onUploadComplete:()=>{c.current&&c.current.focus()},element:t});oe.current=ne;const{getRootProps:Ze,getInputProps:et}=Te({onDrop:ne,multiple:I===b.Multiple||I===b.Directory,accept:Ae(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:x,fileUploaderState:i,audioFileInfo:n};o.setChatInputValue(t,u,{fromUi:!0},p),z.length>0&&fe(s=>s+1),F([]),q(""),Z(!1),P.clearScrollHeight()},[X,e,x,z.length,Ce,o,t,p,P]),ye=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 y=s[0];h.current=new AbortController,await l.uploadFile({formId:"",...t},y.uploadUrl,u,()=>{},h.current.signal);const ae=new Re({fileId:y.fileId,fileUrls:y,name:u.name,size:u.size});j(ae)}catch(s){const y="Recording failed";_.error("Audio upload failed:",s),L(y),c.current&&c.current.focus()}finally{ge(!1)}},[l,t,j]),tt=r.useMemo(()=>({onApprove:ye,onPermissionDenied:()=>{const n="Microphone access denied";L(n),_.error("Permission denied:",n)},onError:n=>{L("Recording failed"),_.error("Recording error:",n)},onRecordStart:()=>{L(null)}}),[ye]),R=bt({containerRef:g,sampleRate:t.audioSampleRate??void 0,events:tt}),be=r.useCallback(()=>{j()},[j]),rt=n=>{const{metaKey:i,ctrlKey:u,shiftKey:s}=n;zt(n)&&!s&&!u&&!i&&(n.preventDefault(),be())},ot=n=>{const{value:i}=n.target;v!==0&&i.length>v||(q(i),P.updateScrollHeight(),Q&&L(null))},Se=r.useCallback(async n=>{n.preventDefault(),n.stopPropagation(),!(!ee||e||R.state==="recording")&&await R.start()},[ee,e,R]),nt=r.useCallback(()=>{R.cancel(),c.current&&c.current.focus()},[R]),Ee=r.useCallback(async()=>{const{blob:n}=await R.stop();await R.approve(n)},[R]),Ie=r.useCallback(n=>{Se(n)},[Se]),at=r.useCallback(()=>{Ee()},[Ee]),it=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(),!D&&s.dataTransfer?.types.includes("Files")&&J(!0)},i=s=>{s.preventDefault(),s.stopPropagation(),D&&(s.clientX<=0&&s.clientY<=0||s.clientX>=W&&s.clientY>=U)&&J(!1)},u=s=>{s.preventDefault(),s.stopPropagation(),D&&J(!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)}},[D,W,U]);const st=I!==b.None&&D,B=R.state==="recording",ze=!B&&k>vt(w.breakpoints.hideWidgetDetails)&&v>0;return a(At,{className:"stChatInput","data-testid":"stChatInput",ref:G,children:A(Ft,{children:[ze&&a(Ht,{onClick:it,id:"stChatInputInstructions",children:a(St,{dirty:X,value:x,maxLength:v,type:"chat",inForm:!1,className:"stChatInputInstructions"})}),st&&a(nr,{getRootProps:Ze,getInputProps:et,acceptFile:I}),I!==b.None&&z.length>0&&a(Mt,{children:a(yr,{items:[...z],onDelete:ve,onRetry:Qe})}),A(Tt,{isStacked:M,children:[a(Ut,{children:I!==b.None&&!B&&a(rr,{onDrop:ne,multiple:I===b.Multiple||I===b.Directory,accept:Ae(t.fileType),maxSize:re,acceptFile:I,disabled:e},Je)}),a(Lt,{isRecording:B,children:a(Nt,{ref:g})}),!B&&a(kt,{isStacked:M,children:a(It,{inputRef:c,value:x,placeholder:d,onChange:ot,onKeyDown:rt,"aria-label":d,disabled:e,rows:1,"aria-describedby":ze?"stChatInputInstructions":void 0,overrides:Ir(w,P,{width:"100%"})})}),a(Dt,{children:B?A(K,{children:[a(T,{onClick:nt,disabled:e,"data-testid":"stChatInputCancelButton","aria-label":"Cancel recording",children:a(V,{content:_e,size:"lg",color:"inherit"})}),a(T,{onClick:at,disabled:e||H,"data-testid":"stChatInputApproveButton","aria-label":"Submit recording",children:H?a(Me,{size:"lg",iconValue:"spinner"}):a(V,{content:je,size:"lg",color:"inherit"})})]}):A(K,{children:[ee&&a(K,{children:Q?a(pe,{content:Q,placement:ue.TOP,error:!0,children:a(T,{onClick:Ie,disabled:e||H,hasError:!0,"data-testid":"stChatInputMicButton","aria-label":"Start recording",children:a(V,{content:Ke,size:"xl",color:"inherit"})})}):a(T,{onClick:Ie,disabled:e||H,"data-testid":"stChatInputMicButton","aria-label":"Start recording",children:a(V,{content:We,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:$e,size:"lg",color:"inherit"})})]})})]})]})})}const Lr=r.memo(zr);export{Lr as default};
1
+ import{r,E as S,_ as E,V as ct,z as m,cz as b,cx as Fe,o as A,j as a,P as ue,az as V,aA as pe,$ as K,b as dt,B as ut,Y as Me,b_ as pt,l as gt,k as ft,bf as ht,cA as mt,e as ie,bT as Re,bU as wt,ac as vt}from"./index.DBIoNOen.js";import{u as Te,I as Ct,g as Ve,F as Y,E as ce,b as xt,s as yt,a as Ae}from"./FileHelper.kJKftfu4.js";import{u as bt}from"./useWaveformController.C5EtFoJE.js";import{I as St}from"./InputInstructions.oezYb8Lm.js";import{u as Et,T as It}from"./useTextInputAutoExpand.C9g8px1W.js";import{i as zt}from"./inputUtils.CptNuJwn.js";import{T as Rt}from"./TableChart.esm.BuemQLVW.js";import{E as Vt}from"./ErrorOutline.esm.DWBqsdHn.js";import{U as ke}from"./UploadFileInfo.Dr-zDST7.js";import"./base-input.AJ4KxBTh.js";var Ue=r.forwardRef(function(e,t){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return r.createElement(S,E({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 De=r.forwardRef(function(e,t){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return r.createElement(S,E({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"}))});De.displayName="Code";var He=r.forwardRef(function(e,t){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return r.createElement(S,E({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"}))});He.displayName="Description";var Le=r.forwardRef(function(e,t){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return r.createElement(S,E({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"}))});Le.displayName="Folder";var Ne=r.forwardRef(function(e,t){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return r.createElement(S,E({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 Be=r.forwardRef(function(e,t){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return r.createElement(S,E({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"}))});Be.displayName="MusicNote";var We=r.forwardRef(function(e,t){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return r.createElement(S,E({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"}))});We.displayName="MicNone";var Pe=r.forwardRef(function(e,t){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return r.createElement(S,E({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"}))});Pe.displayName="Videocam";var Oe=r.forwardRef(function(e,t){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return r.createElement(S,E({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"}))});Oe.displayName="Add";var $e=r.forwardRef(function(e,t){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return r.createElement(S,E({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"}))});$e.displayName="ArrowUpward";var Xe=r.forwardRef(function(e,t){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return r.createElement(S,E({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"}))});Xe.displayName="Cancel";var je=r.forwardRef(function(e,t){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return r.createElement(S,E({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"}))});je.displayName="Check";var _e=r.forwardRef(function(e,t){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return r.createElement(S,E({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"}))});_e.displayName="Close";var Ke=r.forwardRef(function(e,t){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return r.createElement(S,E({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"}))});Ke.displayName="ErrorOutline";const _=ct.getLogger("ChatInput"),At=m("div",{target:"e15xmbo00"})({position:"relative",display:"flex",flexDirection:"column"}),Ft=m("div",{target:"e15xmbo01"})(({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}})),Mt=m("div",{target:"e15xmbo02"})(({theme:e})=>({display:"flex",flexWrap:"wrap",gap:e.spacing.sm})),Tt=m("div",{target:"e15xmbo03"})(({theme:e,isStacked:t})=>({display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",width:"100%",gap:e.spacing.sm,flexWrap:t?"wrap":"nowrap"})),kt=m("div",{target:"e15xmbo04"})(({isStacked:e})=>({flex:e?"none":1,width:e?"100%":"auto",order:e?-1:0,display:"flex",alignItems:"center",minWidth:0})),Ut=m("div",{target:"e15xmbo05"})(({theme:e})=>({display:"flex",flexDirection:"row",flexShrink:0,gap:e.spacing.sm,alignItems:"center"})),Dt=m("div",{target:"e15xmbo06"})(({theme:e})=>({display:"flex",flexDirection:"row",gap:e.spacing.sm,alignItems:"center"})),Ht=m("div",{target:"e15xmbo07"})(({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:"e15xmbo08"})(({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:e.shadows.focusRing},"&: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:e.shadows.focusRing},"&: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}}}),Lt=m("div",{target:"e15xmbo09"})(({isRecording:e})=>({display:e?"flex":"none",flex:1,alignItems:"center",minWidth:0})),Nt=m("div",{target:"e15xmbo010"})(({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,Bt=(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})},Wt=(e,t)=>Bt(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 Fe(e),"a file"}},Pt=m("div",{target:"e1lsn30a0"})(({theme:e})=>({backgroundColor:e.colors.transparent,position:"absolute",inset:0,zIndex:e.zIndices.priority,borderRadius:e.radii.chatInput})),Ot=m("div",{target:"e1lsn30a1"})(({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})),$t=m("div",{target:"e1lsn30a2"})(({disabled:e})=>({pointerEvents:e?"none":"auto"})),Xt=m("div",{target:"e1lsn30a3"})(({theme:e})=>({lineHeight:e.lineHeights.tight})),jt=m("div",{target:"e1lsn30a4"})(({theme:e})=>({display:"flex",flexWrap:"wrap",gap:e.spacing.sm})),_t=m("div",{target:"e1lsn30a5"})({flex:"0 0 auto",maxWidth:"100%"}),Kt=m("div",{target:"e1lsn30a6"})(({theme:e,isError:t,isClickable:o})=>({position:"relative",display:"inline-flex",alignItems:"center",width:"fit-content",minWidth:"9rem",maxWidth:"100%",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:"e1lsn30a7"})({display:"flex",flexDirection:"column",minWidth:0}),Gt=m("div",{target:"e1lsn30a8"})(({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}})),qt=m("img",{target:"e1lsn30a9"})({width:"100%",height:"100%",objectFit:"cover"}),Jt=m("div",{target:"e1lsn30a10"})(({theme:e,fileStatus:t})=>({overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:t.type==="uploading"?e.colors.fadedText60:e.colors.bodyText})),Qt=m("div",{target:"e1lsn30a11"})(({theme:e})=>({color:e.colors.fadedText60,fontSize:e.fontSizes.sm})),Zt=m("small",{target:"e1lsn30a12"})(({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}}})),er=m("span",{target:"e1lsn30a13"})({position:"absolute",width:"1px",height:"1px",padding:0,margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",border:0}),tr=({onDrop:e,multiple:t,accept:o,maxSize:p,acceptFile:l,disabled:w})=>{const{getRootProps:d,getInputProps:v}=Te({onDrop:e,multiple:t,accept:o,maxSize:p,useFsAccessApi:!1}),C=Ye(v(),l),c=d({tabIndex:-1});return A($t,{"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:Oe,size:"xl",color:"inherit"})})})]})},rr=r.memo(tr),or=({getRootProps:e,getInputProps:t,acceptFile:o})=>{const p=Ye(t(),o);return A(K,{children:[a(Pt,{...e(),children:a("input",{...p})}),a(Ot,{children:`Drag and drop ${de(o)} here`})]})},nr=r.memo(or),Ge=new Set(["jpg","jpeg","png","gif","webp","svg","bmp"]),ar=new Set(["pdf"]),ir=new Set(["csv","tsv","xlsx","xls"]),sr=new Set(["txt","md","json","xml","yaml","yml"]),lr=new Set(["py","js","ts","jsx","tsx","css","html","java","cpp","c","go","rs","rb","php","swift","kt","scala","sh","bash","sql"]),cr=new Set(["mp3","wav","m4a","ogg","flac","aac"]),dr=new Set(["mp4","webm","mov","avi","mkv","wmv"]),ur=new Set(["zip","tar","gz","rar","7z","bz2"]);function qe(e){const t=e.lastIndexOf(".");return t===-1||t===e.length-1?"":e.slice(t+1).toLowerCase()}function pr(e){const t=qe(e);return Ge.has(t)?Ne:ar.has(t)?Ue:ir.has(t)?Rt:sr.has(t)?He:lr.has(t)?De:cr.has(t)?Be:dr.has(t)?Pe:ur.has(t)?Le:Ct}function gr(e){const t=qe(e);return Ge.has(t)}const fr=20;function hr(e,t=fr){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 mr(e,t){const o=r.useMemo(()=>!e||!gr(t)?null:URL.createObjectURL(e),[e,t]);return r.useEffect(()=>()=>{o&&URL.revokeObjectURL(o)},[o]),o}const wr=({fileInfo:e,imagePreviewUrl:t})=>{const{type:o}=e.status;switch(o){case"uploading":return a(Me,{iconValue:"spinner",testid:"stChatInputFileIconSpinner",size:"lg"});case"error":return a(V,{content:Vt,size:"lg",testid:"stChatInputFileIconError"});case"uploaded":return t?a(qt,{src:t,alt:e.name,"data-testid":"stChatInputFileImagePreview"}):a(V,{content:pr(e.name),size:"lg"});default:return Fe(o),null}},vr=({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=mr(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(x=>{d&&(x.key==="Enter"||x.key===" ")&&(x.preventDefault(),o(e))},[d,o,e]),h=r.useCallback(x=>{x.stopPropagation(),t(e.id)},[t,e.id]),k=w?`Cancel upload of ${e.name}`:`Remove ${e.name}`,G=Ve(e.size,Y.Byte),W=`${e.name}, ${G}`,U=A(Kt,{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(Gt,{fileStatus:p,children:a(wr,{fileInfo:e,imagePreviewUrl:C})}),A(Yt,{children:[a(Jt,{className:"stChatInputFileName","data-testid":"stChatInputFileName",title:e.name,fileStatus:e.status,children:hr(e.name)}),a(Qt,{children:Ve(e.size,Y.Byte)})]}),a(Zt,{"data-testid":"stChatInputDeleteBtn",isError:l,children:a(dt,{onClick:h,kind:ut.MINIMAL,"aria-label":k,children:a(V,{content:Xe,size:"md"})})}),l&&A(er,{id:v,role:"alert",children:["Error: ",c]})]});return l?a(pe,{content:c,placement:ue.TOP,error:!0,children:U}):U},Cr=r.memo(vr),xr=({items:e,onDelete:t,onRetry:o})=>a(Xt,{"data-testid":"stChatUploadedFiles",children:a(jt,{children:e.map(p=>a(_t,{children:a(Cr,{fileInfo:p,onDelete:t,onRetry:o})},p.id))})}),yr=r.memo(xr),br=(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=Wt(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}},Sr=({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}=br(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=>{pt(g,c).forEach(([h,k])=>{p(h,k)})}).catch(g=>{l(c.map(h=>new ke(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 ke(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 zr({disabled:e,element:t,widgetMgr:o,fragmentId:p,uploadClient:l}){const w=gt(),{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:G}=ft(),{innerWidth:W,innerHeight:U}=ht(),[x,q]=r.useState(t.default),[z,F]=r.useState([]),[D,J]=r.useState(!1),[H,ge]=r.useState(!1),[Q,L]=r.useState(null),[M,Z]=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),N=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;N(n);const i=new ResizeObserver(()=>N(n));return i.observe(n),()=>i.disconnect()},[N,M]),r.useEffect(()=>{if(x===""){Z(!1);return}if(M)return;const n=c.current;if(!n||(($.current<=0||!O.current)&&N(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(x).width>$.current-10&&Z(!0))},[x,M,N]);const X=r.useMemo(()=>z.some(n=>n.status.type==="uploading")?!1:x!==""||z.length>0,[z,x]),I=mt(t.acceptFile),re=yt(t.maxUploadSizeMb,Y.Megabyte,Y.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(y=>y.id!==n);return s.length===0&&fe(y=>y+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=z.filter(i=>i.status.type==="uploaded").map(i=>{const{name:u,size:s,status:y}=i,{fileId:ae,fileUrls:lt}=y;return new Re({fileId:ae,fileUrls:lt,name:u,size:s})});return new wt({uploadedFileInfo:n})},[z]),xe=()=>C.current++,ne=Sr({acceptMultipleFiles:I===b.Multiple||I===b.Directory,maxFileSize:re,uploadClient:l,uploadFile:Er({getNextLocalFileId:xe,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 y=Math.round(n.loaded*100/n.total);return s.status.progress===y?u:se(i,s.setStatus({type:"uploading",abortController:s.status.abortController,progress:y}),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:xe,deleteExistingFiles:()=>z.forEach(n=>ve(n.id)),onUploadComplete:()=>{c.current&&c.current.focus()},element:t});oe.current=ne;const{getRootProps:Ze,getInputProps:et}=Te({onDrop:ne,multiple:I===b.Multiple||I===b.Directory,accept:Ae(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:x,fileUploaderState:i,audioFileInfo:n};o.setChatInputValue(t,u,{fromUi:!0},p),z.length>0&&fe(s=>s+1),F([]),q(""),Z(!1),P.clearScrollHeight()},[X,e,x,z.length,Ce,o,t,p,P]),ye=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 y=s[0];h.current=new AbortController,await l.uploadFile({formId:"",...t},y.uploadUrl,u,()=>{},h.current.signal);const ae=new Re({fileId:y.fileId,fileUrls:y,name:u.name,size:u.size});j(ae)}catch(s){const y="Recording failed";_.error("Audio upload failed:",s),L(y),c.current&&c.current.focus()}finally{ge(!1)}},[l,t,j]),tt=r.useMemo(()=>({onApprove:ye,onPermissionDenied:()=>{const n="Microphone access denied";L(n),_.error("Permission denied:",n)},onError:n=>{L("Recording failed"),_.error("Recording error:",n)},onRecordStart:()=>{L(null)}}),[ye]),R=bt({containerRef:g,sampleRate:t.audioSampleRate??void 0,events:tt}),be=r.useCallback(()=>{j()},[j]),rt=n=>{const{metaKey:i,ctrlKey:u,shiftKey:s}=n;zt(n)&&!s&&!u&&!i&&(n.preventDefault(),be())},ot=n=>{const{value:i}=n.target;v!==0&&i.length>v||(q(i),P.updateScrollHeight(),Q&&L(null))},Se=r.useCallback(async n=>{n.preventDefault(),n.stopPropagation(),!(!ee||e||R.state==="recording")&&await R.start()},[ee,e,R]),nt=r.useCallback(()=>{R.cancel(),c.current&&c.current.focus()},[R]),Ee=r.useCallback(async()=>{const{blob:n}=await R.stop();await R.approve(n)},[R]),Ie=r.useCallback(n=>{Se(n)},[Se]),at=r.useCallback(()=>{Ee()},[Ee]),it=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(),!D&&s.dataTransfer?.types.includes("Files")&&J(!0)},i=s=>{s.preventDefault(),s.stopPropagation(),D&&(s.clientX<=0&&s.clientY<=0||s.clientX>=W&&s.clientY>=U)&&J(!1)},u=s=>{s.preventDefault(),s.stopPropagation(),D&&J(!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)}},[D,W,U]);const st=I!==b.None&&D,B=R.state==="recording",ze=!B&&k>vt(w.breakpoints.hideWidgetDetails)&&v>0;return a(At,{className:"stChatInput","data-testid":"stChatInput",ref:G,children:A(Ft,{children:[ze&&a(Ht,{onClick:it,id:"stChatInputInstructions",children:a(St,{dirty:X,value:x,maxLength:v,type:"chat",inForm:!1,className:"stChatInputInstructions"})}),st&&a(nr,{getRootProps:Ze,getInputProps:et,acceptFile:I}),I!==b.None&&z.length>0&&a(Mt,{children:a(yr,{items:[...z],onDelete:ve,onRetry:Qe})}),A(Tt,{isStacked:M,children:[a(Ut,{children:I!==b.None&&!B&&a(rr,{onDrop:ne,multiple:I===b.Multiple||I===b.Directory,accept:Ae(t.fileType),maxSize:re,acceptFile:I,disabled:e},Je)}),a(Lt,{isRecording:B,children:a(Nt,{ref:g})}),!B&&a(kt,{isStacked:M,children:a(It,{inputRef:c,value:x,placeholder:d,onChange:ot,onKeyDown:rt,"aria-label":d,disabled:e,rows:1,"aria-describedby":ze?"stChatInputInstructions":void 0,overrides:Ir(w,P,{width:"100%"})})}),a(Dt,{children:B?A(K,{children:[a(T,{onClick:nt,disabled:e,"data-testid":"stChatInputCancelButton","aria-label":"Cancel recording",children:a(V,{content:_e,size:"lg",color:"inherit"})}),a(T,{onClick:at,disabled:e||H,"data-testid":"stChatInputApproveButton","aria-label":"Submit recording",children:H?a(Me,{size:"lg",iconValue:"spinner"}):a(V,{content:je,size:"lg",color:"inherit"})})]}):A(K,{children:[ee&&a(K,{children:Q?a(pe,{content:Q,placement:ue.TOP,error:!0,children:a(T,{onClick:Ie,disabled:e||H,hasError:!0,"data-testid":"stChatInputMicButton","aria-label":"Start recording",children:a(V,{content:Ke,size:"xl",color:"inherit"})})}):a(T,{onClick:Ie,disabled:e||H,"data-testid":"stChatInputMicButton","aria-label":"Start recording",children:a(V,{content:We,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:$e,size:"lg",color:"inherit"})})]})})]})]})})}const Lr=r.memo(zr);export{Lr as default};
@@ -1 +1 @@
1
- import{W as f,a8 as p,B as i,r as l,u as h,j as o,a as S,b as F,c as I,D as R,d as C,a9 as M}from"./index.BHyzKS4e.js";import{aa as D}from"./index.BHyzKS4e.js";import{m as x}from"./iconPosition.C47DkA-1.js";import{F as E,u as O}from"./FormClearHelper.DQoXcOWo.js";function y(a){const{disabled:d,element:t,widgetMgr:e,fragmentId:u}=a,{formId:s}=t,m=t.shortcut?t.shortcut:void 0,{formsData:B}=f(p),b=B.formsWithUploads.has(s);let n=i.SECONDARY_FORM_SUBMIT;t.type==="primary"?n=i.PRIMARY_FORM_SUBMIT:t.type==="tertiary"&&(n=i.TERTIARY_FORM_SUBMIT);const r=d||b;l.useEffect(()=>(e.addSubmitButton(s,t),()=>e.removeSubmitButton(s,t)),[e,s,t]);const c=l.useCallback(()=>{r||e.submitForm(t.formId,u,t)},[r,e,t,u]);return h({shortcut:m,disabled:r,onActivate:c}),o(C,{className:"stFormSubmitButton","data-testid":"stFormSubmitButton",children:o(S,{help:t.help,containerWidth:!0,children:o(F,{kind:n,size:I.SMALL,containerWidth:!0,disabled:r,onClick:c,children:o(R,{icon:t.icon,iconPosition:x(t.iconPosition),label:t.label,shortcut:m})})})})}function _(a){return o(M,{children:o(y,{...a})})}export{E as FormClearHelper,y as FormSubmitButton,_ as FormSubmitContent,D as default,O as useFormClearHelper};
1
+ import{W as f,a8 as p,B as i,r as l,u as h,j as o,a as S,b as F,c as I,D as R,d as C,a9 as M}from"./index.DBIoNOen.js";import{aa as D}from"./index.DBIoNOen.js";import{m as x}from"./iconPosition.D6eEnKvO.js";import{F as E,u as O}from"./FormClearHelper.CyGGPn10.js";function y(a){const{disabled:d,element:t,widgetMgr:e,fragmentId:u}=a,{formId:s}=t,m=t.shortcut?t.shortcut:void 0,{formsData:B}=f(p),b=B.formsWithUploads.has(s);let n=i.SECONDARY_FORM_SUBMIT;t.type==="primary"?n=i.PRIMARY_FORM_SUBMIT:t.type==="tertiary"&&(n=i.TERTIARY_FORM_SUBMIT);const r=d||b;l.useEffect(()=>(e.addSubmitButton(s,t),()=>e.removeSubmitButton(s,t)),[e,s,t]);const c=l.useCallback(()=>{r||e.submitForm(t.formId,u,t)},[r,e,t,u]);return h({shortcut:m,disabled:r,onActivate:c}),o(C,{className:"stFormSubmitButton","data-testid":"stFormSubmitButton",children:o(S,{help:t.help,containerWidth:!0,children:o(F,{kind:n,size:I.SMALL,containerWidth:!0,disabled:r,onClick:c,children:o(R,{icon:t.icon,iconPosition:x(t.iconPosition),label:t.label,shortcut:m})})})})}function _(a){return o(M,{children:o(y,{...a})})}export{E as FormClearHelper,y as FormSubmitButton,_ as FormSubmitContent,D as default,O as useFormClearHelper};
@@ -1 +1 @@
1
- import{p as W,aC as O,z as _,r as i,k as $,l as q,ab as S,ac as G,o as M,j as c,ad as N,ae as J,ag as Q}from"./index.BHyzKS4e.js";import{I as X}from"./InputInstructions.C7VMyGT7.js";import{u as Y}from"./useBasicWidgetState.BXKaD8DQ.js";import{u as Z,a as tt,b as et}from"./useUpdateUiValue.CIUgfO8X.js";import{u as ot,T as at}from"./useTextInputAutoExpand.CVd5Hf2S.js";import{u as it}from"./uniqueId.Bd_Iuzvc.js";import"./FormClearHelper.DQoXcOWo.js";import"./inputUtils.CptNuJwn.js";import"./base-input.iB32RS3w.js";const st=(e,t)=>{let a="auto";if(e.heightConfig?.useStretch)a="100%";else if(e.heightConfig?.pixelHeight&&e.heightConfig.pixelHeight>0){const s=W(t.labelVisibility?.value)===O.Collapsed?2:30,l=e.heightConfig.pixelHeight-s;a=`${Math.max(0,l)}px`}return a},rt=_("div",{target:"e1tmb1p40"})({height:"100%",display:"flex",flexDirection:"column"}),T=(e,t)=>e.getStringValue(t)??t.default??null,lt=e=>e.default??null,nt=e=>e.value??null,dt=(e,t,a,s)=>{t.setStringValue(e,a.value,{fromUi:a.fromUi},s)},ut=({disabled:e,element:t,widgetMgr:a,fragmentId:s,outerElement:l})=>{const h=i.useRef(it("text_area_")).current,{width:y,elementRef:V}=$(),[r,g]=i.useState(!1),[I,x]=i.useState(!1),n=l.heightConfig?.useContent??!1,v=l.heightConfig?.useStretch??!1,A=st(l,t),C=i.useRef(null),[d,p]=i.useState(()=>T(a,t)??null),F=i.useCallback(()=>{p(t.default??null),g(!0)},[t]),[R,f]=Y({getStateFromWidgetMgr:T,getDefaultStateFromProto:lt,getCurrStateFromProto:nt,updateWidgetMgrState:dt,element:t,widgetMgr:a,fragmentId:s,onFormCleared:F});Z(R,d,p,r);const o=q(),{height:k,maxHeight:z,updateScrollHeight:H}=ot({textareaRef:C,dependencies:[t.placeholder]}),m=i.useCallback(()=>{g(!1),f({value:d,fromUi:!0})},[d,f]),L=i.useCallback(()=>{r&&m(),x(!1)},[r,m]),B=i.useCallback(()=>{x(!0)},[]),D=i.useCallback(()=>{n&&H()},[n,H]),E=tt({formId:t.formId,maxChars:t.maxChars,setDirty:g,setUiValue:p,setValueWithSource:f,additionalAction:D}),U=et(t.formId,m,r,a,s,!0),{placeholder:P,formId:b}=t,j=S({formId:b})?a.allowFormEnterToSubmit(b):r,w=I&&y>G(o.breakpoints.hideWidgetDetails);return M(rt,{className:"stTextArea","data-testid":"stTextArea",ref:V,children:[c(J,{label:t.label,disabled:e,labelVisibility:W(t.labelVisibility?.value),htmlFor:h,children:t.help&&c(N,{content:t.help,label:t.label})}),c(at,{inputRef:n?C:void 0,value:d??"",placeholder:P,onBlur:L,onFocus:B,onChange:E,onKeyDown:U,"aria-label":t.label,disabled:e,id:h,overrides:{Input:{style:{fontWeight:o.fontWeights.normal,lineHeight:o.lineHeights.inputWidget,height:n?k:A,maxHeight:n?z:"",minHeight:o.sizes.largestElementHeight,resize:v?"none":"vertical",paddingRight:o.spacing.md,paddingLeft:o.spacing.md,paddingBottom:o.spacing.md,paddingTop:o.spacing.md,"::placeholder":{color:o.colors.fadedText60}}},Root:{props:{"data-testid":"stTextAreaRootElement"},style:({$isFocused:K})=>{const u=Q(o.colors,K);return{borderLeftWidth:o.sizes.borderWidth,borderRightWidth:o.sizes.borderWidth,borderTopWidth:o.sizes.borderWidth,borderBottomWidth:o.sizes.borderWidth,borderTopColor:u,borderRightColor:u,borderBottomColor:u,borderLeftColor:u,flexGrow:1}}}}}),w&&c(X,{dirty:r,value:d??"",maxLength:t.maxChars,type:"multiline",inForm:S({formId:b}),allowEnterToSubmit:j})]})},Ht=i.memo(ut);export{Ht as default};
1
+ import{p as W,aC as O,z as _,r as i,k as $,l as q,ab as S,ac as G,o as M,j as c,ad as N,ae as J,ag as Q}from"./index.DBIoNOen.js";import{I as X}from"./InputInstructions.oezYb8Lm.js";import{u as Y}from"./useBasicWidgetState.Bx27912z.js";import{u as Z,a as tt,b as et}from"./useUpdateUiValue.fF-Cntkp.js";import{u as ot,T as at}from"./useTextInputAutoExpand.C9g8px1W.js";import{u as it}from"./uniqueId.CTTDAAaF.js";import"./FormClearHelper.CyGGPn10.js";import"./inputUtils.CptNuJwn.js";import"./base-input.AJ4KxBTh.js";const st=(e,t)=>{let a="auto";if(e.heightConfig?.useStretch)a="100%";else if(e.heightConfig?.pixelHeight&&e.heightConfig.pixelHeight>0){const s=W(t.labelVisibility?.value)===O.Collapsed?2:30,l=e.heightConfig.pixelHeight-s;a=`${Math.max(0,l)}px`}return a},rt=_("div",{target:"e1tmb1p40"})({height:"100%",display:"flex",flexDirection:"column"}),T=(e,t)=>e.getStringValue(t)??t.default??null,lt=e=>e.default??null,nt=e=>e.value??null,dt=(e,t,a,s)=>{t.setStringValue(e,a.value,{fromUi:a.fromUi},s)},ut=({disabled:e,element:t,widgetMgr:a,fragmentId:s,outerElement:l})=>{const h=i.useRef(it("text_area_")).current,{width:y,elementRef:V}=$(),[r,g]=i.useState(!1),[I,x]=i.useState(!1),n=l.heightConfig?.useContent??!1,v=l.heightConfig?.useStretch??!1,A=st(l,t),C=i.useRef(null),[d,p]=i.useState(()=>T(a,t)??null),F=i.useCallback(()=>{p(t.default??null),g(!0)},[t]),[R,f]=Y({getStateFromWidgetMgr:T,getDefaultStateFromProto:lt,getCurrStateFromProto:nt,updateWidgetMgrState:dt,element:t,widgetMgr:a,fragmentId:s,onFormCleared:F});Z(R,d,p,r);const o=q(),{height:k,maxHeight:z,updateScrollHeight:H}=ot({textareaRef:C,dependencies:[t.placeholder]}),m=i.useCallback(()=>{g(!1),f({value:d,fromUi:!0})},[d,f]),L=i.useCallback(()=>{r&&m(),x(!1)},[r,m]),B=i.useCallback(()=>{x(!0)},[]),D=i.useCallback(()=>{n&&H()},[n,H]),E=tt({formId:t.formId,maxChars:t.maxChars,setDirty:g,setUiValue:p,setValueWithSource:f,additionalAction:D}),U=et(t.formId,m,r,a,s,!0),{placeholder:P,formId:b}=t,j=S({formId:b})?a.allowFormEnterToSubmit(b):r,w=I&&y>G(o.breakpoints.hideWidgetDetails);return M(rt,{className:"stTextArea","data-testid":"stTextArea",ref:V,children:[c(J,{label:t.label,disabled:e,labelVisibility:W(t.labelVisibility?.value),htmlFor:h,children:t.help&&c(N,{content:t.help,label:t.label})}),c(at,{inputRef:n?C:void 0,value:d??"",placeholder:P,onBlur:L,onFocus:B,onChange:E,onKeyDown:U,"aria-label":t.label,disabled:e,id:h,overrides:{Input:{style:{fontWeight:o.fontWeights.normal,lineHeight:o.lineHeights.inputWidget,height:n?k:A,maxHeight:n?z:"",minHeight:o.sizes.largestElementHeight,resize:v?"none":"vertical",paddingRight:o.spacing.md,paddingLeft:o.spacing.md,paddingBottom:o.spacing.md,paddingTop:o.spacing.md,"::placeholder":{color:o.colors.fadedText60}}},Root:{props:{"data-testid":"stTextAreaRootElement"},style:({$isFocused:K})=>{const u=Q(o.colors,K);return{borderLeftWidth:o.sizes.borderWidth,borderRightWidth:o.sizes.borderWidth,borderTopWidth:o.sizes.borderWidth,borderBottomWidth:o.sizes.borderWidth,borderTopColor:u,borderRightColor:u,borderBottomColor:u,borderLeftColor:u,flexGrow:1}}}}}),w&&c(X,{dirty:r,value:d??"",maxLength:t.maxChars,type:"multiline",inForm:S({formId:b}),allowEnterToSubmit:j})]})},Ht=i.memo(ut);export{Ht as default};
@@ -1 +1 @@
1
- import{z as f,r as s,l as v,o as x,j as i,Y as m,q as L,Z as r,$ as R,m as C,n as k,a0 as z,a1 as B}from"./index.BHyzKS4e.js";const E=f("button",{target:"e1a81sb30"})(({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}})),H=f("div",{target:"e1a81sb31"})(({theme:o})=>({display:"flex",flexDirection:"row",gap:o.spacing.lg,"> span":{marginTop:o.spacing.twoXS}})),D=f("div",{target:"e1a81sb32"})(({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 M(o){const a=C(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:o.colors.bgColor,filter:a?"brightness(0.98)":"brightness(1.2)",color:o.colors.bodyText,boxShadow:o.shadows.popover}},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 I(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 j({element:o}){const{body:a,icon:t,duration:d}=o,n=v(),c=I(a),l=a!==c,[e,T]=s.useState(!l),[b,w]=s.useState(0),y=s.useCallback(()=>{T(!e)},[e]),g=s.useMemo(()=>M(n),[n]),p=s.useMemo(()=>x(H,{expanded:e,children:[t&&i(m,{iconValue:t,size:"xl",testid:"stToastDynamicIcon"}),x(D,{children:[i(L,{source:e?a:c,allowHTML:!1,isToast:!0}),l&&i(E,{"data-testid":"stToastViewButton",onClick:y,children:e?"view less":"view more"})]})]}),[l,e,a,t,c,y]);s.useEffect(()=>{if(n.inSidebar)return;const h=k(d)?d===0?0:d*1e3:4e3,u=r.info(p,{overrides:{...g},autoHideDuration:h});return w(u),()=>{r.update(u,{overrides:{Body:{style:{display:"none"}}}}),r.clear(u)}},[]),s.useEffect(()=>{r.update(b,{children:p,overrides:{...g}})},[b,p,g]);const S=i(B,{kind:z.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(R,{children:n.inSidebar&&S})}const O=s.memo(j);export{O as default};
1
+ import{z as f,r as s,l as v,o as x,j as i,Y as m,q as L,Z as r,$ as R,m as C,n as k,a0 as z,a1 as B}from"./index.DBIoNOen.js";const E=f("button",{target:"e1a81sb30"})(({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}})),H=f("div",{target:"e1a81sb31"})(({theme:o})=>({display:"flex",flexDirection:"row",gap:o.spacing.lg,"> span":{marginTop:o.spacing.twoXS}})),D=f("div",{target:"e1a81sb32"})(({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 M(o){const a=C(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:o.colors.bgColor,filter:a?"brightness(0.98)":"brightness(1.2)",color:o.colors.bodyText,boxShadow:o.shadows.popover}},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 I(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 j({element:o}){const{body:a,icon:t,duration:d}=o,n=v(),c=I(a),l=a!==c,[e,T]=s.useState(!l),[b,w]=s.useState(0),y=s.useCallback(()=>{T(!e)},[e]),g=s.useMemo(()=>M(n),[n]),p=s.useMemo(()=>x(H,{expanded:e,children:[t&&i(m,{iconValue:t,size:"xl",testid:"stToastDynamicIcon"}),x(D,{children:[i(L,{source:e?a:c,allowHTML:!1,isToast:!0}),l&&i(E,{"data-testid":"stToastViewButton",onClick:y,children:e?"view less":"view more"})]})]}),[l,e,a,t,c,y]);s.useEffect(()=>{if(n.inSidebar)return;const h=k(d)?d===0?0:d*1e3:4e3,u=r.info(p,{overrides:{...g},autoHideDuration:h});return w(u),()=>{r.update(u,{overrides:{Body:{style:{display:"none"}}}}),r.clear(u)}},[]),s.useEffect(()=>{r.update(b,{children:p,overrides:{...g}})},[b,p,g]);const S=i(B,{kind:z.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(R,{children:n.inSidebar&&S})}const O=s.memo(j);export{O as default};
@@ -0,0 +1 @@
1
+ import{z as p,M as o,r as B,N,o as f,j as s,O as u,q as T,Q as m}from"./index.DBIoNOen.js";import{g as C,a as L,f as A}from"./pandasStylerUtils.BqWaUzvh.js";import"./moment.C7qA8nIE.js";import"./numbro.B9_PXfzp.js";import"./_baseIndexOf.BTknn6Gb.js";const w=p("div",{target:"er7ze0z0"})(({theme:e})=>({fontSize:e.fontSizes.md,fontFamily:e.genericFonts.bodyFont,lineHeight:e.lineHeights.small,captionSide:"bottom"})),M=p("div",{target:"er7ze0z1"})(({theme:e})=>({fontFamily:e.genericFonts.bodyFont,fontSize:e.fontSizes.sm,paddingTop:e.spacing.sm,paddingBottom:0,color:e.colors.fadedText60,textAlign:"left",wordWrap:"break-word",display:"inline-block"})),h=p("div",{target:"er7ze0z2"})(({theme:e,borderMode:t})=>({border:t===o.BorderMode.ALL?`${e.sizes.borderWidth} solid ${e.colors.dataframeBorderColor}`:"none",borderRadius:e.radii.default,overflow:"auto"})),O=p("table",{target:"er7ze0z3"})(({theme:e})=>({width:e.sizes.full,color:e.colors.bodyText,borderSpacing:0})),z=(e,t=o.BorderMode.ALL)=>({borderBottom:t!==o.BorderMode.NONE?`${e.sizes.borderWidth} solid ${e.colors.dataframeBorderColor}`:"none","tbody tr:last-child &":{borderBottom:t===o.BorderMode.ALL||t===o.BorderMode.HORIZONTAL?"none":void 0},borderRight:t===o.BorderMode.ALL?`${e.sizes.borderWidth} solid ${e.colors.dataframeBorderColor}`:"none","&:last-child":{borderRight:t===o.BorderMode.ALL?"none":void 0,paddingRight:t===o.BorderMode.NONE?"0":e.spacing.xs},verticalAlign:"middle",padding:`${e.spacing.twoXS} ${e.spacing.xs}`,"&:not(:first-of-type)":{paddingLeft:t===o.BorderMode.NONE||t===o.BorderMode.HORIZONTAL?e.spacing.lg:e.spacing.xs},"&:first-of-type":{paddingLeft:t===o.BorderMode.NONE?"0":e.spacing.xs},fontWeight:e.fontWeights.normal}),S=p("td",{target:"er7ze0z4"})(({theme:e,borderMode:t})=>z(e,t)),b=p("th",{target:"er7ze0z5"})(({theme:e,borderMode:t})=>({...z(e,t),textAlign:"inherit",color:e.colors.fadedText60,"&:first-of-type":{paddingLeft:t===o.BorderMode.NONE?"0":e.spacing.sm},"&:not(:first-of-type)":{paddingLeft:t===o.BorderMode.NONE||t===o.BorderMode.HORIZONTAL?e.spacing.lg:e.spacing.sm}})),H=p(S,{target:"er7ze0z6"})(({theme:e})=>({color:e.colors.gray70,fontStyle:"italic",fontSize:e.fontSizes.md,textAlign:"center"}));function R(e){const t=e.data,{cssId:l,cssStyles:n,caption:d}=t.styler??{},{numHeaderRows:g,numDataRows:c,numColumns:a}=t.dimensions,r=N(c),i=e.element.borderMode;return f(w,{className:"stTable","data-testid":"stTable",children:[n&&s("style",{children:n}),s(h,{borderMode:i,children:f(O,{id:l,"data-testid":"stTableStyledTable",children:[g>0&&E(t,i),s("tbody",{children:r.length===0?s("tr",{children:s(H,{"data-testid":"stTableStyledEmptyTableCell",colSpan:a||1,borderMode:i,children:"empty"})}):r.map(y=>$(t,y,a,i))})]})}),d&&s(M,{children:d})]})}function E(e,t){const l=t===o.BorderMode.NONE||t===o.BorderMode.HORIZONTAL;return s("thead",{children:C(e).map((n,d)=>s("tr",{children:n.map((g,c)=>{let a="inherit";if(l&&e.dimensions.numDataRows>0){const{contentType:r}=e.getCell(0,c);a=u(r)?"right":"left"}return s(b,{className:g.cssClass,scope:"col",borderMode:t,style:{textAlign:a},children:s(T,{source:g.name||" ",allowHTML:!1})},c)})},d))})}function $(e,t,l,n){return s("tr",{children:N(l).map(d=>x(e,t,d,n))},t)}function x(e,t,l,n){const{type:d,content:g,contentType:c}=e.getCell(t,l),a=L(e,t,l);let r=a?.displayContent||A(g,c),i=!1;const y={textAlign:u(c)?"right":"left"};switch(r?.endsWith('<span class="pd-t"></span>')&&(r=r.replace(/<span class="pd-t"><\/span>$/,""),i=!0),d){case m.INDEX:return f(b,{scope:"row",id:a?.cssId,className:a?.cssClass,borderMode:n,children:[i&&s("span",{className:"pd-t"}),s(T,{source:r||" ",allowHTML:!1})]},l);case m.DATA:return f(S,{id:a?.cssId,className:a?.cssClass,style:y,borderMode:n,children:[i&&s("span",{className:"pd-t"}),s(T,{source:r||" ",allowHTML:!1})]},l);default:throw new Error(`Cannot parse type "${d}".`)}}const j=B.memo(R);export{j as default};
@@ -1,2 +1,2 @@
1
- import{an as Ge,ao as Q,r as _,bV as mt,ap as bt,w as J,bq as yt,br as Tt,z as se,l as kt,bW as Ot,bX as wt,bY as Rt,j as Z,q as De,o as xe,p as St,ad as Mt,ae as $t,bZ as oe}from"./index.BHyzKS4e.js";import{h as _t}from"./moment.C7qA8nIE.js";import{w as Et}from"./withCalculatedWidth.Ce1Zblb2.js";import{u as It}from"./useBasicWidgetState.BXKaD8DQ.js";import{f as Dt}from"./formatMoment.C6Hwn6X5.js";import{f as xt}from"./formatNumber.L8T7D36k.js";import"./FormClearHelper.DQoXcOWo.js";import"./numbro.B9_PXfzp.js";import"./sprintfjs.CtrdaGLQ.js";var ce={},H={},le={},de={},He;function Ce(){if(He)return de;He=1,Object.defineProperty(de,"__esModule",{value:!0}),de.Direction=void 0;var e;return(function(r){r.Right="to right",r.Left="to left",r.Down="to bottom",r.Up="to top"})(e||(de.Direction=e={})),de}var We;function Je(){return We||(We=1,(function(e){var r=le&&le.__spreadArray||function(i,s,u){if(u||arguments.length===2)for(var p=0,m=s.length,v;p<m;p++)(v||!(p in s))&&(v||(v=Array.prototype.slice.call(s,0,p)),v[p]=s[p]);return i.concat(v||Array.prototype.slice.call(s))};Object.defineProperty(e,"__esModule",{value:!0}),e.isIOS=e.useThumbOverlap=e.assertUnreachable=e.voidFn=e.getTrackBackground=e.replaceAt=e.schd=e.translate=e.getClosestThumbIndex=e.translateThumbs=e.getPaddingAndBorder=e.getMargin=e.checkInitialOverlap=e.checkValuesAgainstBoundaries=e.checkBoundaries=e.isVertical=e.relativeValue=e.normalizeValue=e.isStepDivisible=e.isTouchEvent=e.getStepDecimals=void 0;var n=Ge(),o=Ce(),h=function(i){var s=i.toString().split(".")[1];return s?s.length:0};e.getStepDecimals=h;function O(i){return i.touches&&i.touches.length||i.changedTouches&&i.changedTouches.length}e.isTouchEvent=O;function l(i,s,u){var p=(s-i)/u,m=8,v=Number(p.toFixed(m));return parseInt(v.toString(),10)===v}e.isStepDivisible=l;function g(i,s,u,p,m,v,b){var $=1e11;if(i=Math.round(i*$)/$,!v){var C=b[s-1],E=b[s+1];if(C&&C>i)return C;if(E&&E<i)return E}if(i>p)return p;if(i<u)return u;var U=Math.floor(i*$-u*$)%Math.floor(m*$),z=Math.floor(i*$-Math.abs(U)),W=U===0?i:z/$,A=Math.abs(U/$)<m/2?W:W+m,B=(0,e.getStepDecimals)(m);return parseFloat(A.toFixed(B))}e.normalizeValue=g;function F(i,s,u){return(i-s)/(u-s)}e.relativeValue=F;function V(i){return i===o.Direction.Up||i===o.Direction.Down}e.isVertical=V;function j(i,s,u){if(s>=u)throw new RangeError("min (".concat(s,") is equal/bigger than max (").concat(u,")"));if(i<s)throw new RangeError("value (".concat(i,") is smaller than min (").concat(s,")"));if(i>u)throw new RangeError("value (".concat(i,") is bigger than max (").concat(u,")"))}e.checkBoundaries=j;function I(i,s,u){return i<s?s:i>u?u:i}e.checkValuesAgainstBoundaries=I;function T(i){if(!(i.length<2)&&!i.slice(1).every(function(s,u){return i[u]<=s}))throw new RangeError("values={[".concat(i,"]} needs to be sorted when allowOverlap={false}"))}e.checkInitialOverlap=T;function d(i){var s=window.getComputedStyle(i);return{top:parseInt(s["margin-top"],10),bottom:parseInt(s["margin-bottom"],10),left:parseInt(s["margin-left"],10),right:parseInt(s["margin-right"],10)}}e.getMargin=d;function t(i){var s=window.getComputedStyle(i);return{top:parseInt(s["padding-top"],10)+parseInt(s["border-top-width"],10),bottom:parseInt(s["padding-bottom"],10)+parseInt(s["border-bottom-width"],10),left:parseInt(s["padding-left"],10)+parseInt(s["border-left-width"],10),right:parseInt(s["padding-right"],10)+parseInt(s["border-right-width"],10)}}e.getPaddingAndBorder=t;function a(i,s,u){var p=u?-1:1;i.forEach(function(m,v){return f(m,p*s[v].x,s[v].y)})}e.translateThumbs=a;function c(i,s,u,p){for(var m=0,v=L(i[0],s,u,p),b=1;b<i.length;b++){var $=L(i[b],s,u,p);$<v&&(v=$,m=b)}return m}e.getClosestThumbIndex=c;function f(i,s,u){i.style.transform="translate(".concat(s,"px, ").concat(u,"px)")}e.translate=f;var y=function(i){var s=[],u=null,p=function(){for(var m=[],v=0;v<arguments.length;v++)m[v]=arguments[v];s=m,!u&&(u=requestAnimationFrame(function(){u=null,i.apply(void 0,s)}))};return p};e.schd=y;function k(i,s,u){var p=i.slice(0);return p[s]=u,p}e.replaceAt=k;function D(i){var s=i.values,u=i.colors,p=i.min,m=i.max,v=i.direction,b=v===void 0?o.Direction.Right:v,$=i.rtl,C=$===void 0?!1:$;C&&b===o.Direction.Right?b=o.Direction.Left:C&&o.Direction.Left&&(b=o.Direction.Right);var E=s.slice(0).sort(function(z,W){return z-W}).map(function(z){return(z-p)/(m-p)*100}),U=E.reduce(function(z,W,A){return"".concat(z,", ").concat(u[A]," ").concat(W,"%, ").concat(u[A+1]," ").concat(W,"%")},"");return"linear-gradient(".concat(b,", ").concat(u[0]," 0%").concat(U,", ").concat(u[u.length-1]," 100%)")}e.getTrackBackground=D;function w(){}e.voidFn=w;function R(i){throw new Error("Didn't expect to get here")}e.assertUnreachable=R;var M=function(i,s,u,p,m){m===void 0&&(m=function(b){return b});var v=Math.ceil(r([i],Array.from(i.children),!0).reduce(function(b,$){var C=Math.ceil($.getBoundingClientRect().width);if($.innerText&&$.innerText.includes(u)&&$.childElementCount===0){var E=$.cloneNode(!0);E.innerHTML=m(s.toFixed(p)),E.style.visibility="hidden",document.body.appendChild(E),C=Math.ceil(E.getBoundingClientRect().width),document.body.removeChild(E)}return C>b?C:b},i.getBoundingClientRect().width));return v},P=function(i,s,u,p,m,v,b){b===void 0&&(b=function(E){return E});var $=[],C=function(E){var U=M(u[E],p[E],m,v,b),z=s[E].x;s.forEach(function(W,A){var B=W.x,G=M(u[A],p[A],m,v,b);E!==A&&(z>=B&&z<=B+G||z+U>=B&&z+U<=B+G)&&($.includes(A)||($.push(E),$.push(A),$=r(r([],$,!0),[E,A],!1),C(A)))})};return C(i),Array.from(new Set($.sort()))},S=function(i,s,u,p,m,v){p===void 0&&(p=.1),m===void 0&&(m=" - "),v===void 0&&(v=function(A){return A});var b=(0,e.getStepDecimals)(p),$=(0,n.useState)({}),C=$[0],E=$[1],U=(0,n.useState)(v(s[u].toFixed(b))),z=U[0],W=U[1];return(0,n.useEffect)(function(){if(i){var A=i.getThumbs();if(A.length<1)return;var B={},G=i.getOffsets(),ne=P(u,G,A,s,m,b,v),he=v(s[u].toFixed(b));if(ne.length){var ee=ne.reduce(function(te,ue,me,be){return te.length?r(r([],te,!0),[G[be[me]].x],!1):[G[be[me]].x]},[]);if(Math.min.apply(Math,ee)===G[u].x){var ge=[];ne.forEach(function(te){ge.push(s[te].toFixed(b))}),he=Array.from(new Set(ge.sort(function(te,ue){return parseFloat(te)-parseFloat(ue)}))).map(v).join(m);var pe=Math.min.apply(Math,ee),ve=Math.max.apply(Math,ee),Ie=A[ne[ee.indexOf(ve)]].getBoundingClientRect().width;B.left="".concat(Math.abs(pe-(ve+Ie))/2,"px"),B.transform="translate(-50%, 0)"}else B.visibility="hidden"}W(he),E(B)}},[i,s]),[z,C]};e.useThumbOverlap=S;function L(i,s,u,p){var m=i.getBoundingClientRect(),v=m.left,b=m.top,$=m.width,C=m.height;return V(p)?Math.abs(u-(b+C/2)):Math.abs(s-(v+$/2))}var x=function(){var i,s=((i=navigator.userAgentData)===null||i===void 0?void 0:i.platform)||navigator.platform;return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(s)||navigator.userAgent.includes("Mac")&&"ontouchend"in document};e.isIOS=x})(le)),le}var qe;function Ct(){if(qe)return H;qe=1;var e=H&&H.__extends||(function(){var I=function(T,d){return I=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,a){t.__proto__=a}||function(t,a){for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(t[c]=a[c])},I(T,d)};return function(T,d){if(typeof d!="function"&&d!==null)throw new TypeError("Class extends value "+String(d)+" is not a constructor or null");I(T,d);function t(){this.constructor=T}T.prototype=d===null?Object.create(d):(t.prototype=d.prototype,new t)}})(),r=H&&H.__createBinding||(Object.create?(function(I,T,d,t){t===void 0&&(t=d);var a=Object.getOwnPropertyDescriptor(T,d);(!a||("get"in a?!T.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return T[d]}}),Object.defineProperty(I,t,a)}):(function(I,T,d,t){t===void 0&&(t=d),I[t]=T[d]})),n=H&&H.__setModuleDefault||(Object.create?(function(I,T){Object.defineProperty(I,"default",{enumerable:!0,value:T})}):function(I,T){I.default=T}),o=H&&H.__importStar||function(I){if(I&&I.__esModule)return I;var T={};if(I!=null)for(var d in I)d!=="default"&&Object.prototype.hasOwnProperty.call(I,d)&&r(T,I,d);return n(T,I),T},h=H&&H.__spreadArray||function(I,T,d){if(d||arguments.length===2)for(var t=0,a=T.length,c;t<a;t++)(c||!(t in T))&&(c||(c=Array.prototype.slice.call(T,0,t)),c[t]=T[t]);return I.concat(c||Array.prototype.slice.call(T))};Object.defineProperty(H,"__esModule",{value:!0});var O=o(Ge()),l=Je(),g=Ce(),F=["ArrowRight","ArrowUp","k","PageUp"],V=["ArrowLeft","ArrowDown","j","PageDown"],j=(function(I){e(T,I);function T(d){var t=I.call(this,d)||this;if(t.trackRef=O.createRef(),t.thumbRefs=[],t.state={draggedTrackPos:[-1,-1],draggedThumbIndex:-1,thumbZIndexes:new Array(t.props.values.length).fill(0).map(function(a,c){return c}),isChanged:!1,markOffsets:[]},t.getOffsets=function(){var a=t.props,c=a.direction,f=a.values,y=a.min,k=a.max,D=t.trackRef.current;if(!D)return console.warn("No track element found."),[];var w=D.getBoundingClientRect(),R=(0,l.getPaddingAndBorder)(D);return t.getThumbs().map(function(M,P){var S={x:0,y:0},L=M.getBoundingClientRect(),x=(0,l.getMargin)(M);switch(c){case g.Direction.Right:return S.x=(x.left+R.left)*-1,S.y=((L.height-w.height)/2+R.top)*-1,S.x+=w.width*(0,l.relativeValue)(f[P],y,k)-L.width/2,S;case g.Direction.Left:return S.x=(x.right+R.right)*-1,S.y=((L.height-w.height)/2+R.top)*-1,S.x+=w.width-w.width*(0,l.relativeValue)(f[P],y,k)-L.width/2,S;case g.Direction.Up:return S.x=((L.width-w.width)/2+x.left+R.left)*-1,S.y=-R.left,S.y+=w.height-w.height*(0,l.relativeValue)(f[P],y,k)-L.height/2,S;case g.Direction.Down:return S.x=((L.width-w.width)/2+x.left+R.left)*-1,S.y=-R.left,S.y+=w.height*(0,l.relativeValue)(f[P],y,k)-L.height/2,S;default:return(0,l.assertUnreachable)(c)}})},t.getThumbs=function(){return t.trackRef&&t.trackRef.current?Array.from(t.trackRef.current.children).filter(function(a){return a.hasAttribute("aria-valuenow")}):(console.warn("No thumbs found in the track container. Did you forget to pass & spread the `props` param in renderTrack?"),[])},t.getTargetIndex=function(a){return t.getThumbs().findIndex(function(c){return c===a.target||c.contains(a.target)})},t.addTouchEvents=function(a){document.addEventListener("touchmove",t.schdOnTouchMove,{passive:!1}),document.addEventListener("touchend",t.schdOnEnd,{passive:!1}),document.addEventListener("touchcancel",t.schdOnEnd,{passive:!1})},t.addMouseEvents=function(a){document.addEventListener("mousemove",t.schdOnMouseMove),document.addEventListener("mouseup",t.schdOnEnd)},t.onMouseDownTrack=function(a){var c;if(!(a.button!==0||(0,l.isIOS)()))if(a.persist(),a.preventDefault(),t.addMouseEvents(a.nativeEvent),t.props.values.length>1&&t.props.draggableTrack){if(t.thumbRefs.some(function(y){var k;return(k=y.current)===null||k===void 0?void 0:k.contains(a.target)}))return;t.setState({draggedTrackPos:[a.clientX,a.clientY]},function(){return t.onMove(a.clientX,a.clientY)})}else{var f=(0,l.getClosestThumbIndex)(t.thumbRefs.map(function(y){return y.current}),a.clientX,a.clientY,t.props.direction);(c=t.thumbRefs[f].current)===null||c===void 0||c.focus(),t.setState({draggedThumbIndex:f},function(){return t.onMove(a.clientX,a.clientY)})}},t.onResize=function(){(0,l.translateThumbs)(t.getThumbs(),t.getOffsets(),t.props.rtl),t.calculateMarkOffsets()},t.onTouchStartTrack=function(a){var c;if(a.persist(),t.addTouchEvents(a.nativeEvent),t.props.values.length>1&&t.props.draggableTrack){if(t.thumbRefs.some(function(y){var k;return(k=y.current)===null||k===void 0?void 0:k.contains(a.target)}))return;t.setState({draggedTrackPos:[a.touches[0].clientX,a.touches[0].clientY]},function(){return t.onMove(a.touches[0].clientX,a.touches[0].clientY)})}else{var f=(0,l.getClosestThumbIndex)(t.thumbRefs.map(function(y){return y.current}),a.touches[0].clientX,a.touches[0].clientY,t.props.direction);(c=t.thumbRefs[f].current)===null||c===void 0||c.focus(),t.setState({draggedThumbIndex:f},function(){return t.onMove(a.touches[0].clientX,a.touches[0].clientY)})}},t.onMouseOrTouchStart=function(a){if(!t.props.disabled){var c=(0,l.isTouchEvent)(a);if(!(!c&&a.button!==0)){var f=t.getTargetIndex(a);f!==-1&&(c?t.addTouchEvents(a):t.addMouseEvents(a),t.setState({draggedThumbIndex:f,thumbZIndexes:t.state.thumbZIndexes.map(function(y,k){return k===f?Math.max.apply(Math,t.state.thumbZIndexes):y<=t.state.thumbZIndexes[f]?y:y-1})}))}}},t.onMouseMove=function(a){a.preventDefault(),t.onMove(a.clientX,a.clientY)},t.onTouchMove=function(a){a.preventDefault(),t.onMove(a.touches[0].clientX,a.touches[0].clientY)},t.onKeyDown=function(a){var c=t.props,f=c.values,y=c.onChange,k=c.step,D=c.rtl,w=c.direction,R=t.state.isChanged,M=t.getTargetIndex(a.nativeEvent),P=D||w===g.Direction.Left||w===g.Direction.Down?-1:1;M!==-1&&(F.includes(a.key)?(a.preventDefault(),t.setState({draggedThumbIndex:M,isChanged:!0}),y((0,l.replaceAt)(f,M,t.normalizeValue(f[M]+P*(a.key==="PageUp"?k*10:k),M)))):V.includes(a.key)?(a.preventDefault(),t.setState({draggedThumbIndex:M,isChanged:!0}),y((0,l.replaceAt)(f,M,t.normalizeValue(f[M]-P*(a.key==="PageDown"?k*10:k),M)))):a.key==="Tab"?t.setState({draggedThumbIndex:-1},function(){R&&t.fireOnFinalChange()}):R&&t.fireOnFinalChange())},t.onKeyUp=function(a){var c=t.state.isChanged;t.setState({draggedThumbIndex:-1},function(){c&&t.fireOnFinalChange()})},t.onMove=function(a,c){var f=t.state,y=f.draggedThumbIndex,k=f.draggedTrackPos,D=t.props,w=D.direction,R=D.min,M=D.max,P=D.onChange,S=D.values,L=D.step,x=D.rtl;if(y===-1&&k[0]===-1&&k[1]===-1)return null;var i=t.trackRef.current;if(!i)return null;var s=i.getBoundingClientRect(),u=(0,l.isVertical)(w)?s.height:s.width;if(k[0]!==-1&&k[1]!==-1){var p=a-k[0],m=c-k[1],v=0;switch(w){case g.Direction.Right:case g.Direction.Left:v=p/u*(M-R);break;case g.Direction.Down:case g.Direction.Up:v=m/u*(M-R);break;default:(0,l.assertUnreachable)(w)}if(x&&(v*=-1),Math.abs(v)>=L/2){for(var b=0;b<t.thumbRefs.length;b++){if(S[b]===M&&Math.sign(v)===1||S[b]===R&&Math.sign(v)===-1)return;var $=S[b]+v;$>M?v=M-S[b]:$<R&&(v=R-S[b])}for(var C=S.slice(0),b=0;b<t.thumbRefs.length;b++)C=(0,l.replaceAt)(C,b,t.normalizeValue(S[b]+v,b));t.setState({draggedTrackPos:[a,c]}),P(C)}}else{var E=0;switch(w){case g.Direction.Right:E=(a-s.left)/u*(M-R)+R;break;case g.Direction.Left:E=(u-(a-s.left))/u*(M-R)+R;break;case g.Direction.Down:E=(c-s.top)/u*(M-R)+R;break;case g.Direction.Up:E=(u-(c-s.top))/u*(M-R)+R;break;default:(0,l.assertUnreachable)(w)}x&&(E=M+R-E),Math.abs(S[y]-E)>=L/2&&P((0,l.replaceAt)(S,y,t.normalizeValue(E,y)))}},t.normalizeValue=function(a,c){var f=t.props,y=f.min,k=f.max,D=f.step,w=f.allowOverlap,R=f.values;return(0,l.normalizeValue)(a,c,y,k,D,w,R)},t.onEnd=function(a){if(a.preventDefault(),document.removeEventListener("mousemove",t.schdOnMouseMove),document.removeEventListener("touchmove",t.schdOnTouchMove),document.removeEventListener("mouseup",t.schdOnEnd),document.removeEventListener("touchend",t.schdOnEnd),document.removeEventListener("touchcancel",t.schdOnEnd),t.state.draggedThumbIndex===-1&&t.state.draggedTrackPos[0]===-1&&t.state.draggedTrackPos[1]===-1)return null;t.setState({draggedThumbIndex:-1,draggedTrackPos:[-1,-1]},function(){t.fireOnFinalChange()})},t.fireOnFinalChange=function(){t.setState({isChanged:!1});var a=t.props,c=a.onFinalChange,f=a.values;c&&c(f)},t.updateMarkRefs=function(a){if(!a.renderMark){t.numOfMarks=void 0,t.markRefs=void 0;return}t.numOfMarks=(a.max-a.min)/t.props.step,t.markRefs=[];for(var c=0;c<t.numOfMarks+1;c++)t.markRefs[c]=O.createRef()},t.calculateMarkOffsets=function(){if(!(!t.props.renderMark||!t.trackRef||!t.numOfMarks||!t.markRefs||t.trackRef.current===null)){for(var a=window.getComputedStyle(t.trackRef.current),c=parseInt(a.width,10),f=parseInt(a.height,10),y=parseInt(a.paddingLeft,10),k=parseInt(a.paddingTop,10),D=[],w=0;w<t.numOfMarks+1;w++){var R=9999,M=9999;if(t.markRefs[w].current){var P=t.markRefs[w].current.getBoundingClientRect();R=P.height,M=P.width}t.props.direction===g.Direction.Left||t.props.direction===g.Direction.Right?D.push([Math.round(c/t.numOfMarks*w+y-M/2),-Math.round((R-f)/2)]):D.push([Math.round(f/t.numOfMarks*w+k-R/2),-Math.round((M-c)/2)])}t.setState({markOffsets:D})}},d.step===0)throw new Error('"step" property should be a positive number');return t.schdOnMouseMove=(0,l.schd)(t.onMouseMove),t.schdOnTouchMove=(0,l.schd)(t.onTouchMove),t.schdOnEnd=(0,l.schd)(t.onEnd),t.thumbRefs=d.values.map(function(){return O.createRef()}),t.updateMarkRefs(d),t}return T.prototype.componentDidMount=function(){var d=this,t=this.props,a=t.values,c=t.min,f=t.step;this.resizeObserver=window.ResizeObserver?new window.ResizeObserver(this.onResize):{observe:function(){return window.addEventListener("resize",d.onResize)},unobserve:function(){return window.removeEventListener("resize",d.onResize)}},document.addEventListener("touchstart",this.onMouseOrTouchStart,{passive:!1}),document.addEventListener("mousedown",this.onMouseOrTouchStart,{passive:!1}),!this.props.allowOverlap&&(0,l.checkInitialOverlap)(this.props.values),this.props.values.forEach(function(y){return(0,l.checkBoundaries)(y,d.props.min,d.props.max)}),this.resizeObserver.observe(this.trackRef.current),(0,l.translateThumbs)(this.getThumbs(),this.getOffsets(),this.props.rtl),this.calculateMarkOffsets(),a.forEach(function(y){(0,l.isStepDivisible)(c,y,f)||console.warn("The `values` property is in conflict with the current `step`, `min`, and `max` properties. Please provide values that are accessible using the min, max, and step values.")})},T.prototype.componentDidUpdate=function(d,t){var a=this.props,c=a.max,f=a.min,y=a.step,k=a.values,D=a.rtl;(d.max!==c||d.min!==f||d.step!==y)&&this.updateMarkRefs(this.props),(0,l.translateThumbs)(this.getThumbs(),this.getOffsets(),D),(d.max!==c||d.min!==f||d.step!==y||t.markOffsets.length!==this.state.markOffsets.length)&&(this.calculateMarkOffsets(),k.forEach(function(w){(0,l.isStepDivisible)(f,w,y)||console.warn("The `values` property is in conflict with the current `step`, `min`, and `max` properties. Please provide values that are accessible using the min, max, and step values.")}))},T.prototype.componentWillUnmount=function(){var d={passive:!1};document.removeEventListener("mousedown",this.onMouseOrTouchStart,d),document.removeEventListener("mousemove",this.schdOnMouseMove),document.removeEventListener("touchmove",this.schdOnTouchMove),document.removeEventListener("touchstart",this.onMouseOrTouchStart),document.removeEventListener("mouseup",this.schdOnEnd),document.removeEventListener("touchend",this.schdOnEnd),this.resizeObserver.unobserve(this.trackRef.current)},T.prototype.render=function(){var d=this,t=this.props,a=t.label,c=t.labelledBy,f=t.renderTrack,y=t.renderThumb,k=t.renderMark,D=k===void 0?function(){return null}:k,w=t.values,R=t.min,M=t.max,P=t.allowOverlap,S=t.disabled,L=this.state,x=L.draggedThumbIndex,i=L.thumbZIndexes,s=L.markOffsets;return f({props:{style:{transform:"scale(1)",cursor:x>-1?"grabbing":this.props.draggableTrack?(0,l.isVertical)(this.props.direction)?"ns-resize":"ew-resize":w.length===1&&!S?"pointer":"inherit"},onMouseDown:S?l.voidFn:this.onMouseDownTrack,onTouchStart:S?l.voidFn:this.onTouchStartTrack,ref:this.trackRef},isDragged:this.state.draggedThumbIndex>-1,disabled:S,children:h(h([],s.map(function(u,p,m){return D({props:{style:d.props.direction===g.Direction.Left||d.props.direction===g.Direction.Right?{position:"absolute",left:"".concat(u[0],"px"),marginTop:"".concat(u[1],"px")}:{position:"absolute",top:"".concat(u[0],"px"),marginLeft:"".concat(u[1],"px")},key:"mark".concat(p),ref:d.markRefs[p]},index:p})}),!0),w.map(function(u,p){var m=d.state.draggedThumbIndex===p;return y({index:p,value:u,isDragged:m,props:{style:{position:"absolute",zIndex:i[p],cursor:S?"inherit":m?"grabbing":"grab",userSelect:"none",touchAction:"none",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none"},key:p,tabIndex:S?void 0:0,"aria-valuemax":P?M:w[p+1]||M,"aria-valuemin":P?R:w[p-1]||R,"aria-valuenow":u,draggable:!1,ref:d.thumbRefs[p],"aria-label":a,"aria-labelledby":c,role:"slider",onKeyDown:S?l.voidFn:d.onKeyDown,onKeyUp:S?l.voidFn:d.onKeyUp}})}),!0)})},T.defaultProps={label:"Accessibility label",labelledBy:null,step:1,direction:g.Direction.Right,rtl:!1,disabled:!1,allowOverlap:!1,draggableTrack:!1,min:0,max:100},T})(O.Component);return H.default=j,H}var Ke;function Pt(){return Ke||(Ke=1,(function(e){var r=ce&&ce.__importDefault||function(O){return O&&O.__esModule?O:{default:O}};Object.defineProperty(e,"__esModule",{value:!0}),e.checkValuesAgainstBoundaries=e.relativeValue=e.useThumbOverlap=e.Direction=e.getTrackBackground=e.Range=void 0;var n=r(Ct());e.Range=n.default;var o=Je();Object.defineProperty(e,"getTrackBackground",{enumerable:!0,get:function(){return o.getTrackBackground}}),Object.defineProperty(e,"useThumbOverlap",{enumerable:!0,get:function(){return o.useThumbOverlap}}),Object.defineProperty(e,"relativeValue",{enumerable:!0,get:function(){return o.relativeValue}}),Object.defineProperty(e,"checkValuesAgainstBoundaries",{enumerable:!0,get:function(){return o.checkValuesAgainstBoundaries}});var h=Ce();Object.defineProperty(e,"Direction",{enumerable:!0,get:function(){return h.Direction}})})(ce)),ce}var Qe=Pt();function Xe(e,r){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter(function(h){return Object.getOwnPropertyDescriptor(e,h).enumerable})),n.push.apply(n,o)}return n}function Te(e){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?Xe(Object(n),!0).forEach(function(o){Lt(e,o,n[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Xe(Object(n)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(n,o))})}return e}function Lt(e,r,n){return r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}var ke=Q("div",{position:"relative",width:"100%"});ke.displayName="Root";ke.displayName="Root";ke.displayName="StyledRoot";var Oe=Q("div",function(e){var r=e.$theme,n=e.$value,o=n===void 0?[]:n,h=e.$disabled,O=e.$isDragged,l=r.sizing,g="inherit";return h?g="not-allowed":O?g="grabbing":o.length===1&&(g="pointer"),{paddingTop:l.scale600,paddingBottom:l.scale600,paddingRight:l.scale600,paddingLeft:l.scale600,display:"flex",cursor:g,backgroundColor:r.colors.sliderTrackFill}});Oe.displayName="Track";Oe.displayName="Track";Oe.displayName="StyledTrack";var fe=Q("div",function(e){var r=e.$theme,n=e.$value,o=n===void 0?[]:n,h=e.$min,O=e.$max,l=e.$disabled,g=r.colors,F=r.borders,V=r.direction,j=r.borders.useRoundedCorners?F.radius100:0;return{borderTopLeftRadius:j,borderTopRightRadius:j,borderBottomRightRadius:j,borderBottomLeftRadius:j,background:Qe.getTrackBackground({values:o,colors:o.length===1?[l?g.borderOpaque:g.primary,l?g.backgroundSecondary:g.borderOpaque]:[l?g.backgroundSecondary:g.borderOpaque,l?g.borderOpaque:g.primary,l?g.backgroundSecondary:g.borderOpaque],min:h||0,max:O||0,rtl:V==="rtl"}),height:"2px",width:"100%",alignSelf:"center",cursor:l?"not-allowed":"inherit"}});fe.displayName="InnerTrack";fe.displayName="InnerTrack";fe.displayName="StyledInnerTrack";var we=Q("div",function(e){return{width:"4px",height:"2px",backgroundColor:e.$theme.colors.backgroundPrimary,marginLeft:"16px"}});we.displayName="Mark";we.displayName="Mark";we.displayName="StyledMark";var Re=Q("div",function(e){return Te(Te({},e.$theme.typography.font200),{},{color:e.$theme.colors.contentPrimary})});Re.displayName="Tick";Re.displayName="Tick";Re.displayName="StyledTick";var Se=Q("div",function(e){var r=e.$theme,n=r.sizing;return{display:"flex",justifyContent:"space-between",alignItems:"center",paddingRight:n.scale600,paddingLeft:n.scale600,paddingBottom:n.scale400}});Se.displayName="TickBar";Se.displayName="TickBar";Se.displayName="StyledTickBar";var Me=Q("div",function(e){var r=e.$theme,n=e.$value,o=n===void 0?[]:n,h=e.$thumbIndex,O=e.$disabled,l=o.length===2&&h===0,g=o.length===2&&h===1;return r.direction==="rtl"&&(g||l)&&(l=!l,g=!g),{height:"24px",width:"24px",borderTopLeftRadius:"24px",borderTopRightRadius:"24px",borderBottomLeftRadius:"24px",borderBottomRightRadius:"24px",display:"flex",justifyContent:"center",alignItems:"center",backgroundColor:O?r.colors.sliderHandleFillDisabled:r.colors.sliderHandleFill,outline:"none",boxShadow:e.$isFocusVisible?"0 0 0 3px ".concat(r.colors.accent):"0 1px 4px rgba(0, 0, 0, 0.12)",cursor:O?"not-allowed":"inherit"}});Me.displayName="Thumb";Me.displayName="Thumb";Me.displayName="StyledThumb";var $e=Q("div",function(e){var r=e.$disabled,n=e.$theme;return{position:"absolute",top:"-16px",width:"4px",height:"20px",backgroundColor:r?n.colors.sliderHandleFillDisabled:n.colors.sliderHandleInnerFill}});$e.displayName="InnerThumb";$e.displayName="InnerThumb";$e.displayName="StyledInnerThumb";var _e=Q("div",function(e){var r=e.$disabled,n=e.$theme;return Te(Te({position:"absolute",top:"-".concat(n.sizing.scale1400)},n.typography.font200),{},{backgroundColor:r?n.colors.sliderHandleFillDisabled:n.colors.sliderHandleInnerFill,color:n.colors.contentInversePrimary,paddingLeft:n.sizing.scale600,paddingRight:n.sizing.scale600,paddingTop:n.sizing.scale500,paddingBottom:n.sizing.scale500,borderBottomLeftRadius:"48px",borderBottomRightRadius:"48px",borderTopLeftRadius:"48px",borderTopRightRadius:"48px",whiteSpace:"nowrap"})});_e.displayName="ThumbValue";_e.displayName="ThumbValue";_e.displayName="StyledThumbValue";function Ye(e,r){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter(function(h){return Object.getOwnPropertyDescriptor(e,h).enumerable})),n.push.apply(n,o)}return n}function At(e){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?Ye(Object(n),!0).forEach(function(o){Bt(e,o,n[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ye(Object(n)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(n,o))})}return e}function Bt(e,r,n){return r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function X(){return X=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},X.apply(this,arguments)}function K(e,r){return zt(e)||jt(e,r)||Vt(e,r)||Ft()}function Ft(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
1
+ import{an as Ge,ao as Q,r as _,bV as mt,ap as bt,w as J,bq as yt,br as Tt,z as se,l as kt,bW as Ot,bX as wt,bY as Rt,j as Z,q as De,o as xe,p as St,ad as Mt,ae as $t,bZ as oe}from"./index.DBIoNOen.js";import{h as _t}from"./moment.C7qA8nIE.js";import{w as Et}from"./withCalculatedWidth.CcvaXQb0.js";import{u as It}from"./useBasicWidgetState.Bx27912z.js";import{f as Dt}from"./formatMoment.C6Hwn6X5.js";import{f as xt}from"./formatNumber.CCeQsvJQ.js";import"./FormClearHelper.CyGGPn10.js";import"./numbro.B9_PXfzp.js";import"./sprintfjs.BlFBKfMf.js";var ce={},H={},le={},de={},He;function Ce(){if(He)return de;He=1,Object.defineProperty(de,"__esModule",{value:!0}),de.Direction=void 0;var e;return(function(r){r.Right="to right",r.Left="to left",r.Down="to bottom",r.Up="to top"})(e||(de.Direction=e={})),de}var We;function Je(){return We||(We=1,(function(e){var r=le&&le.__spreadArray||function(i,s,u){if(u||arguments.length===2)for(var p=0,m=s.length,v;p<m;p++)(v||!(p in s))&&(v||(v=Array.prototype.slice.call(s,0,p)),v[p]=s[p]);return i.concat(v||Array.prototype.slice.call(s))};Object.defineProperty(e,"__esModule",{value:!0}),e.isIOS=e.useThumbOverlap=e.assertUnreachable=e.voidFn=e.getTrackBackground=e.replaceAt=e.schd=e.translate=e.getClosestThumbIndex=e.translateThumbs=e.getPaddingAndBorder=e.getMargin=e.checkInitialOverlap=e.checkValuesAgainstBoundaries=e.checkBoundaries=e.isVertical=e.relativeValue=e.normalizeValue=e.isStepDivisible=e.isTouchEvent=e.getStepDecimals=void 0;var n=Ge(),o=Ce(),h=function(i){var s=i.toString().split(".")[1];return s?s.length:0};e.getStepDecimals=h;function O(i){return i.touches&&i.touches.length||i.changedTouches&&i.changedTouches.length}e.isTouchEvent=O;function l(i,s,u){var p=(s-i)/u,m=8,v=Number(p.toFixed(m));return parseInt(v.toString(),10)===v}e.isStepDivisible=l;function g(i,s,u,p,m,v,b){var $=1e11;if(i=Math.round(i*$)/$,!v){var C=b[s-1],E=b[s+1];if(C&&C>i)return C;if(E&&E<i)return E}if(i>p)return p;if(i<u)return u;var U=Math.floor(i*$-u*$)%Math.floor(m*$),z=Math.floor(i*$-Math.abs(U)),W=U===0?i:z/$,A=Math.abs(U/$)<m/2?W:W+m,B=(0,e.getStepDecimals)(m);return parseFloat(A.toFixed(B))}e.normalizeValue=g;function F(i,s,u){return(i-s)/(u-s)}e.relativeValue=F;function V(i){return i===o.Direction.Up||i===o.Direction.Down}e.isVertical=V;function j(i,s,u){if(s>=u)throw new RangeError("min (".concat(s,") is equal/bigger than max (").concat(u,")"));if(i<s)throw new RangeError("value (".concat(i,") is smaller than min (").concat(s,")"));if(i>u)throw new RangeError("value (".concat(i,") is bigger than max (").concat(u,")"))}e.checkBoundaries=j;function I(i,s,u){return i<s?s:i>u?u:i}e.checkValuesAgainstBoundaries=I;function T(i){if(!(i.length<2)&&!i.slice(1).every(function(s,u){return i[u]<=s}))throw new RangeError("values={[".concat(i,"]} needs to be sorted when allowOverlap={false}"))}e.checkInitialOverlap=T;function d(i){var s=window.getComputedStyle(i);return{top:parseInt(s["margin-top"],10),bottom:parseInt(s["margin-bottom"],10),left:parseInt(s["margin-left"],10),right:parseInt(s["margin-right"],10)}}e.getMargin=d;function t(i){var s=window.getComputedStyle(i);return{top:parseInt(s["padding-top"],10)+parseInt(s["border-top-width"],10),bottom:parseInt(s["padding-bottom"],10)+parseInt(s["border-bottom-width"],10),left:parseInt(s["padding-left"],10)+parseInt(s["border-left-width"],10),right:parseInt(s["padding-right"],10)+parseInt(s["border-right-width"],10)}}e.getPaddingAndBorder=t;function a(i,s,u){var p=u?-1:1;i.forEach(function(m,v){return f(m,p*s[v].x,s[v].y)})}e.translateThumbs=a;function c(i,s,u,p){for(var m=0,v=L(i[0],s,u,p),b=1;b<i.length;b++){var $=L(i[b],s,u,p);$<v&&(v=$,m=b)}return m}e.getClosestThumbIndex=c;function f(i,s,u){i.style.transform="translate(".concat(s,"px, ").concat(u,"px)")}e.translate=f;var y=function(i){var s=[],u=null,p=function(){for(var m=[],v=0;v<arguments.length;v++)m[v]=arguments[v];s=m,!u&&(u=requestAnimationFrame(function(){u=null,i.apply(void 0,s)}))};return p};e.schd=y;function k(i,s,u){var p=i.slice(0);return p[s]=u,p}e.replaceAt=k;function D(i){var s=i.values,u=i.colors,p=i.min,m=i.max,v=i.direction,b=v===void 0?o.Direction.Right:v,$=i.rtl,C=$===void 0?!1:$;C&&b===o.Direction.Right?b=o.Direction.Left:C&&o.Direction.Left&&(b=o.Direction.Right);var E=s.slice(0).sort(function(z,W){return z-W}).map(function(z){return(z-p)/(m-p)*100}),U=E.reduce(function(z,W,A){return"".concat(z,", ").concat(u[A]," ").concat(W,"%, ").concat(u[A+1]," ").concat(W,"%")},"");return"linear-gradient(".concat(b,", ").concat(u[0]," 0%").concat(U,", ").concat(u[u.length-1]," 100%)")}e.getTrackBackground=D;function w(){}e.voidFn=w;function R(i){throw new Error("Didn't expect to get here")}e.assertUnreachable=R;var M=function(i,s,u,p,m){m===void 0&&(m=function(b){return b});var v=Math.ceil(r([i],Array.from(i.children),!0).reduce(function(b,$){var C=Math.ceil($.getBoundingClientRect().width);if($.innerText&&$.innerText.includes(u)&&$.childElementCount===0){var E=$.cloneNode(!0);E.innerHTML=m(s.toFixed(p)),E.style.visibility="hidden",document.body.appendChild(E),C=Math.ceil(E.getBoundingClientRect().width),document.body.removeChild(E)}return C>b?C:b},i.getBoundingClientRect().width));return v},P=function(i,s,u,p,m,v,b){b===void 0&&(b=function(E){return E});var $=[],C=function(E){var U=M(u[E],p[E],m,v,b),z=s[E].x;s.forEach(function(W,A){var B=W.x,G=M(u[A],p[A],m,v,b);E!==A&&(z>=B&&z<=B+G||z+U>=B&&z+U<=B+G)&&($.includes(A)||($.push(E),$.push(A),$=r(r([],$,!0),[E,A],!1),C(A)))})};return C(i),Array.from(new Set($.sort()))},S=function(i,s,u,p,m,v){p===void 0&&(p=.1),m===void 0&&(m=" - "),v===void 0&&(v=function(A){return A});var b=(0,e.getStepDecimals)(p),$=(0,n.useState)({}),C=$[0],E=$[1],U=(0,n.useState)(v(s[u].toFixed(b))),z=U[0],W=U[1];return(0,n.useEffect)(function(){if(i){var A=i.getThumbs();if(A.length<1)return;var B={},G=i.getOffsets(),ne=P(u,G,A,s,m,b,v),he=v(s[u].toFixed(b));if(ne.length){var ee=ne.reduce(function(te,ue,me,be){return te.length?r(r([],te,!0),[G[be[me]].x],!1):[G[be[me]].x]},[]);if(Math.min.apply(Math,ee)===G[u].x){var ge=[];ne.forEach(function(te){ge.push(s[te].toFixed(b))}),he=Array.from(new Set(ge.sort(function(te,ue){return parseFloat(te)-parseFloat(ue)}))).map(v).join(m);var pe=Math.min.apply(Math,ee),ve=Math.max.apply(Math,ee),Ie=A[ne[ee.indexOf(ve)]].getBoundingClientRect().width;B.left="".concat(Math.abs(pe-(ve+Ie))/2,"px"),B.transform="translate(-50%, 0)"}else B.visibility="hidden"}W(he),E(B)}},[i,s]),[z,C]};e.useThumbOverlap=S;function L(i,s,u,p){var m=i.getBoundingClientRect(),v=m.left,b=m.top,$=m.width,C=m.height;return V(p)?Math.abs(u-(b+C/2)):Math.abs(s-(v+$/2))}var x=function(){var i,s=((i=navigator.userAgentData)===null||i===void 0?void 0:i.platform)||navigator.platform;return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(s)||navigator.userAgent.includes("Mac")&&"ontouchend"in document};e.isIOS=x})(le)),le}var qe;function Ct(){if(qe)return H;qe=1;var e=H&&H.__extends||(function(){var I=function(T,d){return I=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,a){t.__proto__=a}||function(t,a){for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(t[c]=a[c])},I(T,d)};return function(T,d){if(typeof d!="function"&&d!==null)throw new TypeError("Class extends value "+String(d)+" is not a constructor or null");I(T,d);function t(){this.constructor=T}T.prototype=d===null?Object.create(d):(t.prototype=d.prototype,new t)}})(),r=H&&H.__createBinding||(Object.create?(function(I,T,d,t){t===void 0&&(t=d);var a=Object.getOwnPropertyDescriptor(T,d);(!a||("get"in a?!T.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return T[d]}}),Object.defineProperty(I,t,a)}):(function(I,T,d,t){t===void 0&&(t=d),I[t]=T[d]})),n=H&&H.__setModuleDefault||(Object.create?(function(I,T){Object.defineProperty(I,"default",{enumerable:!0,value:T})}):function(I,T){I.default=T}),o=H&&H.__importStar||function(I){if(I&&I.__esModule)return I;var T={};if(I!=null)for(var d in I)d!=="default"&&Object.prototype.hasOwnProperty.call(I,d)&&r(T,I,d);return n(T,I),T},h=H&&H.__spreadArray||function(I,T,d){if(d||arguments.length===2)for(var t=0,a=T.length,c;t<a;t++)(c||!(t in T))&&(c||(c=Array.prototype.slice.call(T,0,t)),c[t]=T[t]);return I.concat(c||Array.prototype.slice.call(T))};Object.defineProperty(H,"__esModule",{value:!0});var O=o(Ge()),l=Je(),g=Ce(),F=["ArrowRight","ArrowUp","k","PageUp"],V=["ArrowLeft","ArrowDown","j","PageDown"],j=(function(I){e(T,I);function T(d){var t=I.call(this,d)||this;if(t.trackRef=O.createRef(),t.thumbRefs=[],t.state={draggedTrackPos:[-1,-1],draggedThumbIndex:-1,thumbZIndexes:new Array(t.props.values.length).fill(0).map(function(a,c){return c}),isChanged:!1,markOffsets:[]},t.getOffsets=function(){var a=t.props,c=a.direction,f=a.values,y=a.min,k=a.max,D=t.trackRef.current;if(!D)return console.warn("No track element found."),[];var w=D.getBoundingClientRect(),R=(0,l.getPaddingAndBorder)(D);return t.getThumbs().map(function(M,P){var S={x:0,y:0},L=M.getBoundingClientRect(),x=(0,l.getMargin)(M);switch(c){case g.Direction.Right:return S.x=(x.left+R.left)*-1,S.y=((L.height-w.height)/2+R.top)*-1,S.x+=w.width*(0,l.relativeValue)(f[P],y,k)-L.width/2,S;case g.Direction.Left:return S.x=(x.right+R.right)*-1,S.y=((L.height-w.height)/2+R.top)*-1,S.x+=w.width-w.width*(0,l.relativeValue)(f[P],y,k)-L.width/2,S;case g.Direction.Up:return S.x=((L.width-w.width)/2+x.left+R.left)*-1,S.y=-R.left,S.y+=w.height-w.height*(0,l.relativeValue)(f[P],y,k)-L.height/2,S;case g.Direction.Down:return S.x=((L.width-w.width)/2+x.left+R.left)*-1,S.y=-R.left,S.y+=w.height*(0,l.relativeValue)(f[P],y,k)-L.height/2,S;default:return(0,l.assertUnreachable)(c)}})},t.getThumbs=function(){return t.trackRef&&t.trackRef.current?Array.from(t.trackRef.current.children).filter(function(a){return a.hasAttribute("aria-valuenow")}):(console.warn("No thumbs found in the track container. Did you forget to pass & spread the `props` param in renderTrack?"),[])},t.getTargetIndex=function(a){return t.getThumbs().findIndex(function(c){return c===a.target||c.contains(a.target)})},t.addTouchEvents=function(a){document.addEventListener("touchmove",t.schdOnTouchMove,{passive:!1}),document.addEventListener("touchend",t.schdOnEnd,{passive:!1}),document.addEventListener("touchcancel",t.schdOnEnd,{passive:!1})},t.addMouseEvents=function(a){document.addEventListener("mousemove",t.schdOnMouseMove),document.addEventListener("mouseup",t.schdOnEnd)},t.onMouseDownTrack=function(a){var c;if(!(a.button!==0||(0,l.isIOS)()))if(a.persist(),a.preventDefault(),t.addMouseEvents(a.nativeEvent),t.props.values.length>1&&t.props.draggableTrack){if(t.thumbRefs.some(function(y){var k;return(k=y.current)===null||k===void 0?void 0:k.contains(a.target)}))return;t.setState({draggedTrackPos:[a.clientX,a.clientY]},function(){return t.onMove(a.clientX,a.clientY)})}else{var f=(0,l.getClosestThumbIndex)(t.thumbRefs.map(function(y){return y.current}),a.clientX,a.clientY,t.props.direction);(c=t.thumbRefs[f].current)===null||c===void 0||c.focus(),t.setState({draggedThumbIndex:f},function(){return t.onMove(a.clientX,a.clientY)})}},t.onResize=function(){(0,l.translateThumbs)(t.getThumbs(),t.getOffsets(),t.props.rtl),t.calculateMarkOffsets()},t.onTouchStartTrack=function(a){var c;if(a.persist(),t.addTouchEvents(a.nativeEvent),t.props.values.length>1&&t.props.draggableTrack){if(t.thumbRefs.some(function(y){var k;return(k=y.current)===null||k===void 0?void 0:k.contains(a.target)}))return;t.setState({draggedTrackPos:[a.touches[0].clientX,a.touches[0].clientY]},function(){return t.onMove(a.touches[0].clientX,a.touches[0].clientY)})}else{var f=(0,l.getClosestThumbIndex)(t.thumbRefs.map(function(y){return y.current}),a.touches[0].clientX,a.touches[0].clientY,t.props.direction);(c=t.thumbRefs[f].current)===null||c===void 0||c.focus(),t.setState({draggedThumbIndex:f},function(){return t.onMove(a.touches[0].clientX,a.touches[0].clientY)})}},t.onMouseOrTouchStart=function(a){if(!t.props.disabled){var c=(0,l.isTouchEvent)(a);if(!(!c&&a.button!==0)){var f=t.getTargetIndex(a);f!==-1&&(c?t.addTouchEvents(a):t.addMouseEvents(a),t.setState({draggedThumbIndex:f,thumbZIndexes:t.state.thumbZIndexes.map(function(y,k){return k===f?Math.max.apply(Math,t.state.thumbZIndexes):y<=t.state.thumbZIndexes[f]?y:y-1})}))}}},t.onMouseMove=function(a){a.preventDefault(),t.onMove(a.clientX,a.clientY)},t.onTouchMove=function(a){a.preventDefault(),t.onMove(a.touches[0].clientX,a.touches[0].clientY)},t.onKeyDown=function(a){var c=t.props,f=c.values,y=c.onChange,k=c.step,D=c.rtl,w=c.direction,R=t.state.isChanged,M=t.getTargetIndex(a.nativeEvent),P=D||w===g.Direction.Left||w===g.Direction.Down?-1:1;M!==-1&&(F.includes(a.key)?(a.preventDefault(),t.setState({draggedThumbIndex:M,isChanged:!0}),y((0,l.replaceAt)(f,M,t.normalizeValue(f[M]+P*(a.key==="PageUp"?k*10:k),M)))):V.includes(a.key)?(a.preventDefault(),t.setState({draggedThumbIndex:M,isChanged:!0}),y((0,l.replaceAt)(f,M,t.normalizeValue(f[M]-P*(a.key==="PageDown"?k*10:k),M)))):a.key==="Tab"?t.setState({draggedThumbIndex:-1},function(){R&&t.fireOnFinalChange()}):R&&t.fireOnFinalChange())},t.onKeyUp=function(a){var c=t.state.isChanged;t.setState({draggedThumbIndex:-1},function(){c&&t.fireOnFinalChange()})},t.onMove=function(a,c){var f=t.state,y=f.draggedThumbIndex,k=f.draggedTrackPos,D=t.props,w=D.direction,R=D.min,M=D.max,P=D.onChange,S=D.values,L=D.step,x=D.rtl;if(y===-1&&k[0]===-1&&k[1]===-1)return null;var i=t.trackRef.current;if(!i)return null;var s=i.getBoundingClientRect(),u=(0,l.isVertical)(w)?s.height:s.width;if(k[0]!==-1&&k[1]!==-1){var p=a-k[0],m=c-k[1],v=0;switch(w){case g.Direction.Right:case g.Direction.Left:v=p/u*(M-R);break;case g.Direction.Down:case g.Direction.Up:v=m/u*(M-R);break;default:(0,l.assertUnreachable)(w)}if(x&&(v*=-1),Math.abs(v)>=L/2){for(var b=0;b<t.thumbRefs.length;b++){if(S[b]===M&&Math.sign(v)===1||S[b]===R&&Math.sign(v)===-1)return;var $=S[b]+v;$>M?v=M-S[b]:$<R&&(v=R-S[b])}for(var C=S.slice(0),b=0;b<t.thumbRefs.length;b++)C=(0,l.replaceAt)(C,b,t.normalizeValue(S[b]+v,b));t.setState({draggedTrackPos:[a,c]}),P(C)}}else{var E=0;switch(w){case g.Direction.Right:E=(a-s.left)/u*(M-R)+R;break;case g.Direction.Left:E=(u-(a-s.left))/u*(M-R)+R;break;case g.Direction.Down:E=(c-s.top)/u*(M-R)+R;break;case g.Direction.Up:E=(u-(c-s.top))/u*(M-R)+R;break;default:(0,l.assertUnreachable)(w)}x&&(E=M+R-E),Math.abs(S[y]-E)>=L/2&&P((0,l.replaceAt)(S,y,t.normalizeValue(E,y)))}},t.normalizeValue=function(a,c){var f=t.props,y=f.min,k=f.max,D=f.step,w=f.allowOverlap,R=f.values;return(0,l.normalizeValue)(a,c,y,k,D,w,R)},t.onEnd=function(a){if(a.preventDefault(),document.removeEventListener("mousemove",t.schdOnMouseMove),document.removeEventListener("touchmove",t.schdOnTouchMove),document.removeEventListener("mouseup",t.schdOnEnd),document.removeEventListener("touchend",t.schdOnEnd),document.removeEventListener("touchcancel",t.schdOnEnd),t.state.draggedThumbIndex===-1&&t.state.draggedTrackPos[0]===-1&&t.state.draggedTrackPos[1]===-1)return null;t.setState({draggedThumbIndex:-1,draggedTrackPos:[-1,-1]},function(){t.fireOnFinalChange()})},t.fireOnFinalChange=function(){t.setState({isChanged:!1});var a=t.props,c=a.onFinalChange,f=a.values;c&&c(f)},t.updateMarkRefs=function(a){if(!a.renderMark){t.numOfMarks=void 0,t.markRefs=void 0;return}t.numOfMarks=(a.max-a.min)/t.props.step,t.markRefs=[];for(var c=0;c<t.numOfMarks+1;c++)t.markRefs[c]=O.createRef()},t.calculateMarkOffsets=function(){if(!(!t.props.renderMark||!t.trackRef||!t.numOfMarks||!t.markRefs||t.trackRef.current===null)){for(var a=window.getComputedStyle(t.trackRef.current),c=parseInt(a.width,10),f=parseInt(a.height,10),y=parseInt(a.paddingLeft,10),k=parseInt(a.paddingTop,10),D=[],w=0;w<t.numOfMarks+1;w++){var R=9999,M=9999;if(t.markRefs[w].current){var P=t.markRefs[w].current.getBoundingClientRect();R=P.height,M=P.width}t.props.direction===g.Direction.Left||t.props.direction===g.Direction.Right?D.push([Math.round(c/t.numOfMarks*w+y-M/2),-Math.round((R-f)/2)]):D.push([Math.round(f/t.numOfMarks*w+k-R/2),-Math.round((M-c)/2)])}t.setState({markOffsets:D})}},d.step===0)throw new Error('"step" property should be a positive number');return t.schdOnMouseMove=(0,l.schd)(t.onMouseMove),t.schdOnTouchMove=(0,l.schd)(t.onTouchMove),t.schdOnEnd=(0,l.schd)(t.onEnd),t.thumbRefs=d.values.map(function(){return O.createRef()}),t.updateMarkRefs(d),t}return T.prototype.componentDidMount=function(){var d=this,t=this.props,a=t.values,c=t.min,f=t.step;this.resizeObserver=window.ResizeObserver?new window.ResizeObserver(this.onResize):{observe:function(){return window.addEventListener("resize",d.onResize)},unobserve:function(){return window.removeEventListener("resize",d.onResize)}},document.addEventListener("touchstart",this.onMouseOrTouchStart,{passive:!1}),document.addEventListener("mousedown",this.onMouseOrTouchStart,{passive:!1}),!this.props.allowOverlap&&(0,l.checkInitialOverlap)(this.props.values),this.props.values.forEach(function(y){return(0,l.checkBoundaries)(y,d.props.min,d.props.max)}),this.resizeObserver.observe(this.trackRef.current),(0,l.translateThumbs)(this.getThumbs(),this.getOffsets(),this.props.rtl),this.calculateMarkOffsets(),a.forEach(function(y){(0,l.isStepDivisible)(c,y,f)||console.warn("The `values` property is in conflict with the current `step`, `min`, and `max` properties. Please provide values that are accessible using the min, max, and step values.")})},T.prototype.componentDidUpdate=function(d,t){var a=this.props,c=a.max,f=a.min,y=a.step,k=a.values,D=a.rtl;(d.max!==c||d.min!==f||d.step!==y)&&this.updateMarkRefs(this.props),(0,l.translateThumbs)(this.getThumbs(),this.getOffsets(),D),(d.max!==c||d.min!==f||d.step!==y||t.markOffsets.length!==this.state.markOffsets.length)&&(this.calculateMarkOffsets(),k.forEach(function(w){(0,l.isStepDivisible)(f,w,y)||console.warn("The `values` property is in conflict with the current `step`, `min`, and `max` properties. Please provide values that are accessible using the min, max, and step values.")}))},T.prototype.componentWillUnmount=function(){var d={passive:!1};document.removeEventListener("mousedown",this.onMouseOrTouchStart,d),document.removeEventListener("mousemove",this.schdOnMouseMove),document.removeEventListener("touchmove",this.schdOnTouchMove),document.removeEventListener("touchstart",this.onMouseOrTouchStart),document.removeEventListener("mouseup",this.schdOnEnd),document.removeEventListener("touchend",this.schdOnEnd),this.resizeObserver.unobserve(this.trackRef.current)},T.prototype.render=function(){var d=this,t=this.props,a=t.label,c=t.labelledBy,f=t.renderTrack,y=t.renderThumb,k=t.renderMark,D=k===void 0?function(){return null}:k,w=t.values,R=t.min,M=t.max,P=t.allowOverlap,S=t.disabled,L=this.state,x=L.draggedThumbIndex,i=L.thumbZIndexes,s=L.markOffsets;return f({props:{style:{transform:"scale(1)",cursor:x>-1?"grabbing":this.props.draggableTrack?(0,l.isVertical)(this.props.direction)?"ns-resize":"ew-resize":w.length===1&&!S?"pointer":"inherit"},onMouseDown:S?l.voidFn:this.onMouseDownTrack,onTouchStart:S?l.voidFn:this.onTouchStartTrack,ref:this.trackRef},isDragged:this.state.draggedThumbIndex>-1,disabled:S,children:h(h([],s.map(function(u,p,m){return D({props:{style:d.props.direction===g.Direction.Left||d.props.direction===g.Direction.Right?{position:"absolute",left:"".concat(u[0],"px"),marginTop:"".concat(u[1],"px")}:{position:"absolute",top:"".concat(u[0],"px"),marginLeft:"".concat(u[1],"px")},key:"mark".concat(p),ref:d.markRefs[p]},index:p})}),!0),w.map(function(u,p){var m=d.state.draggedThumbIndex===p;return y({index:p,value:u,isDragged:m,props:{style:{position:"absolute",zIndex:i[p],cursor:S?"inherit":m?"grabbing":"grab",userSelect:"none",touchAction:"none",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none"},key:p,tabIndex:S?void 0:0,"aria-valuemax":P?M:w[p+1]||M,"aria-valuemin":P?R:w[p-1]||R,"aria-valuenow":u,draggable:!1,ref:d.thumbRefs[p],"aria-label":a,"aria-labelledby":c,role:"slider",onKeyDown:S?l.voidFn:d.onKeyDown,onKeyUp:S?l.voidFn:d.onKeyUp}})}),!0)})},T.defaultProps={label:"Accessibility label",labelledBy:null,step:1,direction:g.Direction.Right,rtl:!1,disabled:!1,allowOverlap:!1,draggableTrack:!1,min:0,max:100},T})(O.Component);return H.default=j,H}var Ke;function Pt(){return Ke||(Ke=1,(function(e){var r=ce&&ce.__importDefault||function(O){return O&&O.__esModule?O:{default:O}};Object.defineProperty(e,"__esModule",{value:!0}),e.checkValuesAgainstBoundaries=e.relativeValue=e.useThumbOverlap=e.Direction=e.getTrackBackground=e.Range=void 0;var n=r(Ct());e.Range=n.default;var o=Je();Object.defineProperty(e,"getTrackBackground",{enumerable:!0,get:function(){return o.getTrackBackground}}),Object.defineProperty(e,"useThumbOverlap",{enumerable:!0,get:function(){return o.useThumbOverlap}}),Object.defineProperty(e,"relativeValue",{enumerable:!0,get:function(){return o.relativeValue}}),Object.defineProperty(e,"checkValuesAgainstBoundaries",{enumerable:!0,get:function(){return o.checkValuesAgainstBoundaries}});var h=Ce();Object.defineProperty(e,"Direction",{enumerable:!0,get:function(){return h.Direction}})})(ce)),ce}var Qe=Pt();function Xe(e,r){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter(function(h){return Object.getOwnPropertyDescriptor(e,h).enumerable})),n.push.apply(n,o)}return n}function Te(e){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?Xe(Object(n),!0).forEach(function(o){Lt(e,o,n[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Xe(Object(n)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(n,o))})}return e}function Lt(e,r,n){return r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}var ke=Q("div",{position:"relative",width:"100%"});ke.displayName="Root";ke.displayName="Root";ke.displayName="StyledRoot";var Oe=Q("div",function(e){var r=e.$theme,n=e.$value,o=n===void 0?[]:n,h=e.$disabled,O=e.$isDragged,l=r.sizing,g="inherit";return h?g="not-allowed":O?g="grabbing":o.length===1&&(g="pointer"),{paddingTop:l.scale600,paddingBottom:l.scale600,paddingRight:l.scale600,paddingLeft:l.scale600,display:"flex",cursor:g,backgroundColor:r.colors.sliderTrackFill}});Oe.displayName="Track";Oe.displayName="Track";Oe.displayName="StyledTrack";var fe=Q("div",function(e){var r=e.$theme,n=e.$value,o=n===void 0?[]:n,h=e.$min,O=e.$max,l=e.$disabled,g=r.colors,F=r.borders,V=r.direction,j=r.borders.useRoundedCorners?F.radius100:0;return{borderTopLeftRadius:j,borderTopRightRadius:j,borderBottomRightRadius:j,borderBottomLeftRadius:j,background:Qe.getTrackBackground({values:o,colors:o.length===1?[l?g.borderOpaque:g.primary,l?g.backgroundSecondary:g.borderOpaque]:[l?g.backgroundSecondary:g.borderOpaque,l?g.borderOpaque:g.primary,l?g.backgroundSecondary:g.borderOpaque],min:h||0,max:O||0,rtl:V==="rtl"}),height:"2px",width:"100%",alignSelf:"center",cursor:l?"not-allowed":"inherit"}});fe.displayName="InnerTrack";fe.displayName="InnerTrack";fe.displayName="StyledInnerTrack";var we=Q("div",function(e){return{width:"4px",height:"2px",backgroundColor:e.$theme.colors.backgroundPrimary,marginLeft:"16px"}});we.displayName="Mark";we.displayName="Mark";we.displayName="StyledMark";var Re=Q("div",function(e){return Te(Te({},e.$theme.typography.font200),{},{color:e.$theme.colors.contentPrimary})});Re.displayName="Tick";Re.displayName="Tick";Re.displayName="StyledTick";var Se=Q("div",function(e){var r=e.$theme,n=r.sizing;return{display:"flex",justifyContent:"space-between",alignItems:"center",paddingRight:n.scale600,paddingLeft:n.scale600,paddingBottom:n.scale400}});Se.displayName="TickBar";Se.displayName="TickBar";Se.displayName="StyledTickBar";var Me=Q("div",function(e){var r=e.$theme,n=e.$value,o=n===void 0?[]:n,h=e.$thumbIndex,O=e.$disabled,l=o.length===2&&h===0,g=o.length===2&&h===1;return r.direction==="rtl"&&(g||l)&&(l=!l,g=!g),{height:"24px",width:"24px",borderTopLeftRadius:"24px",borderTopRightRadius:"24px",borderBottomLeftRadius:"24px",borderBottomRightRadius:"24px",display:"flex",justifyContent:"center",alignItems:"center",backgroundColor:O?r.colors.sliderHandleFillDisabled:r.colors.sliderHandleFill,outline:"none",boxShadow:e.$isFocusVisible?"0 0 0 3px ".concat(r.colors.accent):"0 1px 4px rgba(0, 0, 0, 0.12)",cursor:O?"not-allowed":"inherit"}});Me.displayName="Thumb";Me.displayName="Thumb";Me.displayName="StyledThumb";var $e=Q("div",function(e){var r=e.$disabled,n=e.$theme;return{position:"absolute",top:"-16px",width:"4px",height:"20px",backgroundColor:r?n.colors.sliderHandleFillDisabled:n.colors.sliderHandleInnerFill}});$e.displayName="InnerThumb";$e.displayName="InnerThumb";$e.displayName="StyledInnerThumb";var _e=Q("div",function(e){var r=e.$disabled,n=e.$theme;return Te(Te({position:"absolute",top:"-".concat(n.sizing.scale1400)},n.typography.font200),{},{backgroundColor:r?n.colors.sliderHandleFillDisabled:n.colors.sliderHandleInnerFill,color:n.colors.contentInversePrimary,paddingLeft:n.sizing.scale600,paddingRight:n.sizing.scale600,paddingTop:n.sizing.scale500,paddingBottom:n.sizing.scale500,borderBottomLeftRadius:"48px",borderBottomRightRadius:"48px",borderTopLeftRadius:"48px",borderTopRightRadius:"48px",whiteSpace:"nowrap"})});_e.displayName="ThumbValue";_e.displayName="ThumbValue";_e.displayName="StyledThumbValue";function Ye(e,r){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter(function(h){return Object.getOwnPropertyDescriptor(e,h).enumerable})),n.push.apply(n,o)}return n}function At(e){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?Ye(Object(n),!0).forEach(function(o){Bt(e,o,n[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ye(Object(n)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(n,o))})}return e}function Bt(e,r,n){return r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function X(){return X=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},X.apply(this,arguments)}function K(e,r){return zt(e)||jt(e,r)||Vt(e,r)||Ft()}function Ft(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
2
2
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Vt(e,r){if(e){if(typeof e=="string")return Ze(e,r);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ze(e,r)}}function Ze(e,r){(r==null||r>e.length)&&(r=e.length);for(var n=0,o=new Array(r);n<r;n++)o[n]=e[n];return o}function jt(e,r){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var o=[],h=!0,O=!1,l,g;try{for(n=n.call(e);!(h=(l=n.next()).done)&&(o.push(l.value),!(r&&o.length===r));h=!0);}catch(F){O=!0,g=F}finally{try{!h&&n.return!=null&&n.return()}finally{if(O)throw g}}return o}}function zt(e){if(Array.isArray(e))return e}var Nt=function(r){if(r.length>2||r.length===0)throw new Error("the value prop represents positions of thumbs, so its length can be only one or two");return r};function Ut(e){var r=e.overrides,n=r===void 0?{}:r,o=e.disabled,h=o===void 0?!1:o,O=e.marks,l=O===void 0?!1:O,g=e.onChange,F=g===void 0?function(){}:g,V=e.onFinalChange,j=V===void 0?function(){}:V,I=e.min,T=I===void 0?0:I,d=e.max,t=d===void 0?100:d,a=e.step,c=a===void 0?1:a,f=e.persistentThumb,y=f===void 0?!1:f,k=e.valueToLabel,D=k===void 0?function(Y){return Y}:k,w=e.value,R=_.useContext(mt),M=_.useState(!1),P=K(M,2),S=P[0],L=P[1],x=_.useState(!1),i=K(x,2),s=i[0],u=i[1],p=_.useState(!1),m=K(p,2),v=m[0],b=m[1],$=_.useState(-1),C=K($,2),E=C[0],U=C[1],z=_.useCallback(function(Y){bt(Y)&&b(!0);var N=Y.target.parentNode.firstChild===Y.target?0:1;U(N)},[]),W=_.useCallback(function(Y){v!==!1&&b(!1),U(-1)},[]),A=Nt(w),B={$disabled:h,$step:c,$min:T,$max:t,$marks:l,$value:A,$isFocusVisible:v},G=J(n.Root,ke),ne=K(G,2),he=ne[0],ee=ne[1],ge=J(n.Track,Oe),pe=K(ge,2),ve=pe[0],Ie=pe[1],te=J(n.InnerTrack,fe),ue=K(te,2),me=ue[0],be=ue[1],et=J(n.Thumb,Me),Le=K(et,2),tt=Le[0],rt=Le[1],nt=J(n.InnerThumb,$e),Ae=K(nt,2),at=Ae[0],it=Ae[1],ot=J(n.ThumbValue,_e),Be=K(ot,2),st=Be[0],ut=Be[1],ct=J(n.Tick,Re),Fe=K(ct,2),Ve=Fe[0],je=Fe[1],lt=J(n.TickBar,Se),ze=K(lt,2),dt=ze[0],ft=ze[1],ht=J(n.Mark,we),Ne=K(ht,2),gt=Ne[0],pt=Ne[1];return _.createElement(he,X({"data-baseweb":"slider"},B,ee,{onFocus:Tt(ee,z),onBlur:yt(ee,W)}),_.createElement(Qe.Range,X({step:c,min:T,max:t,values:A,disabled:h,onChange:function(N){return F({value:N})},onFinalChange:function(N){return j({value:N})},rtl:R.direction==="rtl",renderTrack:function(N){var re=N.props,q=N.children,ae=N.isDragged;return _.createElement(ve,X({onMouseDown:re.onMouseDown,onTouchStart:re.onTouchStart,$isDragged:ae},B,Ie),_.createElement(me,X({$isDragged:ae,ref:re.ref},B,be),q))},renderThumb:function(N){var re=N.props,q=N.index,ae=N.isDragged,Ue=y||(!!q&&s||!q&&S||ae)&&!h;return _.createElement(tt,X({},re,{onMouseEnter:function(){q===0?L(!0):u(!0)},onMouseLeave:function(){q===0?L(!1):u(!1)},$thumbIndex:q,$isDragged:ae,style:At({},re.style)},B,rt,{$isFocusVisible:v&&E===q}),Ue&&_.createElement(st,X({$thumbIndex:q,$isDragged:ae},B,ut),D(A[q])),Ue&&_.createElement(at,X({$thumbIndex:q,$isDragged:ae},B,it)))}},l?{renderMark:function(N){var re=N.props,q=N.index;return _.createElement(gt,X({$markIndex:q},re,B,pt))}}:{})),_.createElement(dt,X({},B,ft),_.createElement(Ve,X({},B,je),D(T)),_.createElement(Ve,X({},B,je),D(t))))}const Ht=se("div",{target:"e16ozfla0"})({position:"relative",":focus-within:has(:focus-visible)":{"--slider-focused":1}}),Wt=se("div",{target:"e16ozfla1"})(({disabled:e,theme:r,isDragged:n})=>({alignItems:"center",backgroundColor:e?r.colors.gray60:r.colors.primary,borderTopLeftRadius:"100%",borderTopRightRadius:"100%",borderBottomLeftRadius:"100%",borderBottomRightRadius:"100%",borderTopStyle:"none",borderBottomStyle:"none",borderRightStyle:"none",borderLeftStyle:"none",display:"flex",justifyContent:"center",height:r.sizes.sliderThumb,width:r.sizes.sliderThumb,boxShadow:n?r.shadows.focusRing:r.shadows.none,":focus":{outline:"none"},":focus-visible":{boxShadow:r.shadows.focusRing}})),qt=se("div",{target:"e16ozfla2"})(({disabled:e,theme:r})=>({fontFamily:r.genericFonts.bodyFont,fontSize:r.fontSizes.sm,color:e?r.colors.gray60:r.colors.primary,top:"-1.6em",position:"absolute",whiteSpace:"nowrap",backgroundColor:r.colors.transparent,lineHeight:r.lineHeights.base,fontWeight:r.fontWeights.normal,pointerEvents:"none"})),Kt=se("div",{target:"e16ozfla3"})({flex:1}),Xt=se("div",{target:"e16ozfla4"})(({theme:e})=>({position:"absolute",height:e.spacing.twoXS,left:`calc(${e.sizes.sliderThumb} / 2)`,right:`calc(${e.sizes.sliderThumb} / 2)`})),Yt=se("div",{target:"e16ozfla5"})(({theme:e,isHovered:r,isDisabled:n})=>({position:"absolute",left:0,right:0,top:"100%",display:"flex",justifyContent:"space-between",pointerEvents:"none",marginTop:`-${e.spacing.md}`,fontSize:e.fontSizes.sm,lineHeight:e.lineHeights.base,fontWeight:e.fontWeights.normal,color:n?e.colors.fadedText40:e.colors.fadedText60,opacity:r?1:"var(--slider-focused, 0)",transition:r?"none":"opacity 300ms 200ms"}));function Zt({minLabel:e,maxLabel:r,isHovered:n,isDisabled:o}){return xe(Yt,{"data-testid":"stSliderTickBar",isHovered:n,isDisabled:o,children:[Z(De,{source:e,allowHTML:!1,inheritFont:!0,isLabel:!0}),Z(De,{source:r,allowHTML:!1,inheritFont:!0,isLabel:!0})]})}function Ee(e){return e.type===oe.Type.SELECT_SLIDER}function Pe(e,r,n){return e.map((o,h)=>{const O=r.indexOf(o);return O>=0?O:n[h]??0})}function Gt(e,r){return e.map(n=>r[n]??"")}function Jt({disabled:e,element:r,widgetMgr:n,fragmentId:o}){const[h,O]=It({getStateFromWidgetMgr:Qt,getDefaultStateFromProto:er,getCurrStateFromProto:tr,updateWidgetMgrState:rr,element:r,widgetMgr:n,fragmentId:o}),[l,g]=_.useState(h),[F,V]=_.useState(!1),[j,I]=_.useState(!1),T=_.useCallback(()=>V(!0),[]),d=_.useCallback(()=>V(!1),[]),t=_.useRef(null),[a]=_.useState([]),[c]=_.useState([]),f=kt(),y=_.useRef(r);y.current=r;const k=l.map(x=>ye(x,r)),D=ye(r.min,r),w=ye(r.max,r);_.useEffect(()=>{g(h)},[h]),Ot(()=>{if(!Ee(r))return;const x=n.getStringArrayValue(r);if(x===void 0)return;const i=Pe(x,r.options,r.default);g(i)},[r.options],(x,i)=>wt(x[0],i[0]));const R=_.useCallback(({value:x})=>{O({value:x,fromUi:!0}),I(!1)},[O]),M=_.useCallback(({value:x})=>{g(x),I(!0)},[]),P=_.useCallback(_.forwardRef(function(i,s){const{$thumbIndex:u,$value:p}=i,m=u||0;a[m]=s,c[m]||=_.createRef();const v=Rt(i,["role","style","aria-valuemax","aria-valuemin","aria-valuenow","tabIndex","onKeyUp","onKeyDown","onMouseEnter","onMouseLeave","draggable"]),b=y.current,C=(p??[b.min])[m]??b.min,E=ye(C,b);return Z(Wt,{...v,disabled:i.$disabled===!0,isDragged:i.$isDragged===!0,ref:a[m],"aria-valuetext":E,"aria-label":b.label,children:Z(qt,{"data-testid":"stSliderThumbValue",disabled:i.$disabled===!0,ref:c[m],children:Z(De,{source:E,allowHTML:!1,inheritFont:!0,isLabel:!0})})})}),[]);_.useLayoutEffect(()=>{a.forEach((m,v)=>{m.current&&m.current.setAttribute("aria-valuetext",k[v])});const x=t.current??null,i=a[0].current,s=a[1]?.current,u=c[0].current,p=c[1]?.current;or(x,i,s,u,p)});const S=_.useCallback(({$disabled:x})=>({height:f.spacing.twoXS,...x?{background:f.colors.darkenedBgMix25}:{}}),[f.colors.darkenedBgMix25,f.spacing.twoXS]),L=_.useCallback(_.forwardRef(function(i,s){const{children:u,...p}=i;return xe(Kt,{children:[Z(Xt,{ref:s,children:u}),Z(fe,{...p,style:S({$disabled:i.$disabled})})]})}),[]);return xe(Ht,{ref:t,className:"stSlider","data-testid":"stSlider",onMouseEnter:T,onMouseLeave:d,children:[Z($t,{label:r.label,disabled:e,labelVisibility:St(r.labelVisibility?.value),children:r.help&&Z(Mt,{content:r.help,label:r.label})}),Z(Ut,{min:r.min,max:r.max,step:r.step,value:ir(l,r),onChange:M,onFinalChange:R,disabled:e,overrides:{Thumb:P,Track:{style:{backgroundColor:"none !important",paddingLeft:f.spacing.none,paddingRight:f.spacing.none,paddingTop:`calc((${f.sizes.minElementHeight} - ${f.spacing.twoXS}) / 2)`,paddingBottom:`calc((${f.sizes.minElementHeight} - ${f.spacing.twoXS}) / 2)`}},InnerTrack:L,TickBar:{component:Zt,props:{minLabel:D,maxLabel:w,isHovered:F||j,isDisabled:e}}}})]})}function Qt(e,r){if(Ee(r)){const n=e.getStringArrayValue(r);return n===void 0?void 0:Pe(n,r.options,r.default)}return e.getDoubleArrayValue(r)}function er(e){return e.default}function tr(e){if(Ee(e)){const r=e.rawValue;return r&&r.length>0?Pe(r,e.options,e.default):e.default}return e.value}function rr(e,r,n,o){if(Ee(e)){const h=Gt(n.value,e.options);r.setStringArrayValue(e,h,{fromUi:n.fromUi},o)}else r.setDoubleArrayValue(e,n.value,{fromUi:n.fromUi},o)}function nr(e){const{dataType:r}=e;return r===oe.DataType.DATETIME||r===oe.DataType.DATE||r===oe.DataType.TIME}function ar(e){const{dataType:r}=e;return r===oe.DataType.DATE?"date":r===oe.DataType.TIME?"time":"datetime"}function ye(e,r){const{format:n,options:o}=r;if(o.length>0)return o[e]??"";if(nr(r)){const h=_t.utc(e/1e3);return Dt(h,n,ar(r))}return xt(e,n)}function ir(e,r){const{min:n,max:o}=r;let h=e[0],O=e.length>1?e[1]:e[0];return h>O&&(h=O),h<n&&(h=n),h>o&&(h=o),O<n&&(O=n),O>o&&(O=o),e.length>1?[h,O]:[h]}function or(e,r,n,o,h){!e||!r||!o||(ie(e,r,o),n&&h&&(ie(e,n,h),sr(e,r,n,o,h)))}function ie(e,r,n){const o=e.getBoundingClientRect(),h=r.getBoundingClientRect(),O=n.getBoundingClientRect(),l=h.left+h.width/2,g=l-O.width/2<o.left,F=l+O.width/2>o.right;n.style.left=g?"0":"",n.style.right=F?"0":""}function sr(e,r,n,o,h){const l=e.getBoundingClientRect(),g=r.getBoundingClientRect(),F=n.getBoundingClientRect(),V=o.getBoundingClientRect(),j=h.getBoundingClientRect(),I=l.left+l.width/2,T=g.left+g.width/2,d=F.left+F.width/2,t=T-V.width/2>=l.left,a=d+j.width/2<=l.right,c=g.left-V.width>=l.left,f=F.right+j.width<=l.right,y=t?V.width/2:V.width,k=a?j.width/2:j.width,D=T+y;if(d-k-D>24){ie(e,r,o),ie(e,n,h);return}if(c&&f){o.style.left="",o.style.right=`${Math.round(g.width)}px`,h.style.left=`${Math.round(F.width)}px`,h.style.right="";return}T<I?(ie(e,r,o),h.style.left=`${Math.round(T+y+24-d)}px`,h.style.right=""):(ie(e,n,h),o.style.left="",o.style.right=`${-Math.round(d-k-24-T)}px`)}const mr=Et(_.memo(Jt));export{mr as default};