streamlit 1.51.0__py3-none-any.whl → 1.52.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- streamlit/__init__.py +1 -0
- streamlit/commands/execution_control.py +89 -14
- streamlit/components/v1/component_arrow.py +7 -7
- streamlit/components/v2/__init__.py +59 -3
- streamlit/components/v2/bidi_component/main.py +161 -13
- streamlit/components/v2/bidi_component/serialization.py +13 -6
- streamlit/components/v2/component_manager.py +11 -3
- streamlit/components/v2/component_registry.py +18 -1
- streamlit/components/v2/types.py +2 -2
- streamlit/connections/snowflake_connection.py +1 -1
- streamlit/connections/snowpark_connection.py +1 -1
- streamlit/dataframe_util.py +18 -18
- streamlit/delta_generator.py +7 -0
- streamlit/delta_generator_singletons.py +8 -14
- streamlit/elements/alert.py +16 -0
- streamlit/elements/arrow.py +36 -6
- streamlit/elements/bokeh_chart.py +10 -78
- streamlit/elements/code.py +2 -2
- streamlit/elements/deck_gl_json_chart.py +1 -1
- streamlit/elements/exception.py +1 -1
- streamlit/elements/form.py +27 -0
- streamlit/elements/heading.py +60 -5
- streamlit/elements/html.py +13 -2
- streamlit/elements/image.py +1 -1
- streamlit/elements/layouts.py +28 -22
- streamlit/elements/lib/built_in_chart_utils.py +49 -16
- streamlit/elements/lib/color_util.py +1 -1
- streamlit/elements/lib/column_config_utils.py +6 -5
- streamlit/elements/lib/layout_utils.py +50 -0
- streamlit/elements/lib/pandas_styler_utils.py +17 -9
- streamlit/elements/lib/shortcut_utils.py +152 -0
- streamlit/elements/markdown.py +50 -3
- streamlit/elements/metric.py +31 -1
- streamlit/elements/plotly_chart.py +75 -6
- streamlit/elements/spinner.py +1 -1
- streamlit/elements/text.py +20 -3
- streamlit/elements/toast.py +2 -0
- streamlit/elements/vega_charts.py +17 -1
- streamlit/elements/widgets/audio_input.py +8 -7
- streamlit/elements/widgets/button.py +279 -40
- streamlit/elements/widgets/button_group.py +27 -2
- streamlit/elements/widgets/camera_input.py +1 -1
- streamlit/elements/widgets/chat.py +300 -42
- streamlit/elements/widgets/color_picker.py +7 -0
- streamlit/elements/widgets/data_editor.py +68 -28
- streamlit/elements/widgets/file_uploader.py +4 -1
- streamlit/elements/widgets/number_input.py +2 -0
- streamlit/elements/widgets/text_widgets.py +2 -0
- streamlit/elements/widgets/time_widgets.py +581 -9
- streamlit/errors.py +22 -0
- streamlit/git_util.py +1 -1
- streamlit/navigation/page.py +7 -0
- streamlit/net_util.py +2 -2
- streamlit/proto/Alert_pb2.pyi +3 -3
- streamlit/proto/AppPage_pb2.pyi +7 -1
- streamlit/proto/ArrowData_pb2.pyi +7 -1
- streamlit/proto/ArrowNamedDataSet_pb2.pyi +7 -1
- streamlit/proto/ArrowVegaLiteChart_pb2.pyi +7 -1
- streamlit/proto/Arrow_pb2.py +10 -10
- streamlit/proto/Arrow_pb2.pyi +19 -12
- streamlit/proto/AudioInput_pb2.pyi +7 -1
- streamlit/proto/Audio_pb2.pyi +7 -1
- streamlit/proto/AuthRedirect_pb2.pyi +7 -1
- streamlit/proto/AutoRerun_pb2.pyi +7 -1
- streamlit/proto/BackMsg_pb2.py +4 -2
- streamlit/proto/BackMsg_pb2.pyi +34 -4
- streamlit/proto/Balloons_pb2.pyi +7 -1
- streamlit/proto/BidiComponent_pb2.pyi +10 -4
- streamlit/proto/Block_pb2.pyi +35 -35
- streamlit/proto/BokehChart_pb2.pyi +7 -1
- streamlit/proto/ButtonGroup_pb2.pyi +9 -9
- streamlit/proto/Button_pb2.py +2 -2
- streamlit/proto/Button_pb2.pyi +11 -2
- streamlit/proto/CameraInput_pb2.pyi +7 -1
- streamlit/proto/ChatInput_pb2.py +6 -6
- streamlit/proto/ChatInput_pb2.pyi +18 -6
- streamlit/proto/Checkbox_pb2.pyi +3 -3
- streamlit/proto/ClientState_pb2.pyi +10 -4
- streamlit/proto/Code_pb2.pyi +7 -1
- streamlit/proto/ColorPicker_pb2.pyi +7 -1
- streamlit/proto/Common_pb2.py +3 -3
- streamlit/proto/Common_pb2.pyi +35 -23
- streamlit/proto/Components_pb2.pyi +19 -13
- streamlit/proto/DataFrame_pb2.pyi +55 -49
- streamlit/proto/DateInput_pb2.pyi +7 -1
- streamlit/proto/DateTimeInput_pb2.py +28 -0
- streamlit/proto/DateTimeInput_pb2.pyi +92 -0
- streamlit/proto/DeckGlJsonChart_pb2.pyi +3 -3
- streamlit/proto/Delta_pb2.pyi +7 -1
- streamlit/proto/DocString_pb2.pyi +10 -4
- streamlit/proto/DownloadButton_pb2.py +2 -2
- streamlit/proto/DownloadButton_pb2.pyi +16 -2
- streamlit/proto/Element_pb2.py +5 -3
- streamlit/proto/Element_pb2.pyi +23 -5
- streamlit/proto/Empty_pb2.pyi +7 -1
- streamlit/proto/Exception_pb2.pyi +7 -1
- streamlit/proto/Favicon_pb2.pyi +7 -1
- streamlit/proto/FileUploader_pb2.pyi +7 -1
- streamlit/proto/ForwardMsg_pb2.py +12 -10
- streamlit/proto/ForwardMsg_pb2.pyi +42 -15
- streamlit/proto/GapSize_pb2.pyi +4 -4
- streamlit/proto/GitInfo_pb2.pyi +3 -3
- streamlit/proto/GraphVizChart_pb2.pyi +7 -1
- streamlit/proto/Heading_pb2.pyi +7 -1
- streamlit/proto/HeightConfig_pb2.pyi +7 -1
- streamlit/proto/Html_pb2.py +2 -2
- streamlit/proto/Html_pb2.pyi +11 -2
- streamlit/proto/IFrame_pb2.pyi +7 -1
- streamlit/proto/Image_pb2.pyi +10 -4
- streamlit/proto/Json_pb2.pyi +7 -1
- streamlit/proto/LabelVisibilityMessage_pb2.pyi +3 -3
- streamlit/proto/LinkButton_pb2.py +2 -2
- streamlit/proto/LinkButton_pb2.pyi +15 -2
- streamlit/proto/Logo_pb2.pyi +7 -1
- streamlit/proto/Markdown_pb2.pyi +3 -3
- streamlit/proto/Metric_pb2.pyi +7 -7
- streamlit/proto/MetricsEvent_pb2.pyi +10 -4
- streamlit/proto/MultiSelect_pb2.pyi +7 -1
- streamlit/proto/NamedDataSet_pb2.pyi +7 -1
- streamlit/proto/Navigation_pb2.pyi +3 -3
- streamlit/proto/NewSession_pb2.pyi +40 -40
- streamlit/proto/NumberInput_pb2.pyi +3 -3
- streamlit/proto/PageConfig_pb2.pyi +7 -7
- streamlit/proto/PageInfo_pb2.pyi +7 -1
- streamlit/proto/PageLink_pb2.py +2 -2
- streamlit/proto/PageLink_pb2.pyi +11 -2
- streamlit/proto/PageNotFound_pb2.pyi +7 -1
- streamlit/proto/PageProfile_pb2.pyi +13 -7
- streamlit/proto/PagesChanged_pb2.pyi +7 -1
- streamlit/proto/ParentMessage_pb2.pyi +7 -1
- streamlit/proto/PlotlyChart_pb2.pyi +6 -6
- streamlit/proto/Progress_pb2.pyi +7 -1
- streamlit/proto/Radio_pb2.pyi +7 -1
- streamlit/proto/RootContainer_pb2.pyi +1 -1
- streamlit/proto/Selectbox_pb2.pyi +7 -1
- streamlit/proto/SessionEvent_pb2.pyi +7 -1
- streamlit/proto/SessionStatus_pb2.pyi +7 -1
- streamlit/proto/Skeleton_pb2.pyi +3 -3
- streamlit/proto/Slider_pb2.pyi +5 -5
- streamlit/proto/Snow_pb2.pyi +7 -1
- streamlit/proto/Space_pb2.pyi +7 -1
- streamlit/proto/Spinner_pb2.pyi +7 -1
- streamlit/proto/TextAlignmentConfig_pb2.py +29 -0
- streamlit/proto/TextAlignmentConfig_pb2.pyi +68 -0
- streamlit/proto/TextArea_pb2.pyi +7 -1
- streamlit/proto/TextInput_pb2.pyi +3 -3
- streamlit/proto/Text_pb2.pyi +7 -1
- streamlit/proto/TimeInput_pb2.pyi +7 -1
- streamlit/proto/Toast_pb2.pyi +7 -1
- streamlit/proto/VegaLiteChart_pb2.pyi +7 -1
- streamlit/proto/Video_pb2.pyi +6 -6
- streamlit/proto/WidgetStates_pb2.pyi +10 -4
- streamlit/proto/WidthConfig_pb2.pyi +7 -1
- streamlit/proto/openmetrics_data_model_pb2.pyi +52 -52
- streamlit/runtime/app_session.py +38 -1
- streamlit/runtime/caching/cache_data_api.py +1 -1
- streamlit/runtime/caching/cache_resource_api.py +2 -2
- streamlit/runtime/caching/cache_utils.py +1 -1
- streamlit/runtime/caching/hashing.py +1 -1
- streamlit/runtime/download_data_util.py +53 -0
- streamlit/runtime/forward_msg_queue.py +1 -0
- streamlit/runtime/media_file_manager.py +178 -2
- streamlit/runtime/metrics_util.py +87 -3
- streamlit/runtime/scriptrunner/script_runner.py +3 -1
- streamlit/runtime/state/query_params.py +80 -29
- streamlit/runtime/state/session_state.py +2 -2
- streamlit/static/index.html +1 -1
- streamlit/static/manifest.json +530 -229
- streamlit/static/static/js/{ErrorOutline.esm.YoJdlW1p.js → ErrorOutline.esm.ZJDbmVTx.js} +1 -1
- streamlit/static/static/js/{FileDownload.esm.Ddx8VEYy.js → FileDownload.esm.Dx0vI3vH.js} +1 -1
- streamlit/static/static/js/{FileHelper.90EtOmj9.js → FileHelper.B7Ero7qQ.js} +3 -3
- streamlit/static/static/js/{FormClearHelper.BB1Km6eP.js → FormClearHelper.CG2XN1_g.js} +1 -1
- streamlit/static/static/js/IFrameUtil.DefezniK.js +1 -0
- streamlit/static/static/js/InputInstructions.Cj5-1zf6.js +1 -0
- streamlit/static/static/js/Particles.BfWfv0Aw.js +1 -0
- streamlit/static/static/js/{ProgressBar.DLY8H6nE.js → ProgressBar.CGQ8OgfO.js} +2 -2
- streamlit/static/static/js/StreamlitSyntaxHighlighter.DTKLpwhl.js +20 -0
- streamlit/static/static/js/{Toolbar.D8nHCkuz.js → Toolbar.B2qFUmd9.js} +1 -1
- streamlit/static/static/js/_arrayIncludes.B19Iyn2B.js +1 -0
- streamlit/static/static/js/_baseIndexOf.BTknn6Gb.js +1 -0
- streamlit/static/static/js/{base-input.CJGiNqed.js → base-input.o9tL8MDP.js} +4 -4
- streamlit/static/static/js/{checkbox.Cpdd482O.js → checkbox.0BeV1IBL.js} +1 -1
- streamlit/static/static/js/{createSuper.CuQIogbW.js → createSuper.RBO59fEm.js} +1 -1
- streamlit/static/static/js/data-grid-overlay-editor.CiTkUy0t.js +1 -0
- streamlit/static/static/js/{downloader.CN0K7xlu.js → downloader.DwNZg3Mw.js} +1 -1
- streamlit/static/static/js/embed.XT9xNd3F.js +195 -0
- streamlit/static/static/js/{es6.BJcsVXQ0.js → es6.x9KsYQg-.js} +2 -2
- streamlit/static/static/js/{iframeResizer.contentWindow.XzUvQqcZ.js → iframeResizer.contentWindow.ZVXpMPi0.js} +1 -1
- streamlit/static/static/js/index.5VPOamri.js +1 -0
- streamlit/static/static/js/index.8HslT92O.js +14 -0
- streamlit/static/static/js/index.AnXMIBz3.js +7 -0
- streamlit/static/static/js/index.B0yp3bM1.js +6 -0
- streamlit/static/static/js/index.B1fRb5wF.js +1 -0
- streamlit/static/static/js/index.B527JZdO.js +3 -0
- streamlit/static/static/js/index.BHgV-yW4.js +1 -0
- streamlit/static/static/js/index.BQr-XwGV.js +1 -0
- streamlit/static/static/js/index.BTtmaLDB.js +1 -0
- streamlit/static/static/js/index.BWB_91TA.js +1 -0
- streamlit/static/static/js/index.BfEKaEmw.js +1 -0
- streamlit/static/static/js/index.BfXjTO8b.js +1 -0
- streamlit/static/static/js/index.Bjy4NRu9.js +3 -0
- streamlit/static/static/js/index.Bu5JWpT_.js +1 -0
- streamlit/static/static/js/index.BuCx76ZV.js +1 -0
- streamlit/static/static/js/index.BxjzhVUb.js +2 -0
- streamlit/static/static/js/index.By55VdPY.js +1 -0
- streamlit/static/static/js/index.CF5MxTbK.js +1 -0
- streamlit/static/static/js/index.CLmq_z9K.js +1 -0
- streamlit/static/static/js/index.CNH4rdSz.js +1 -0
- streamlit/static/static/js/{index.D3GPA5k4.js → index.CTgm_-jO.js} +9 -40
- streamlit/static/static/js/index.C_rK-Swb.js +188 -0
- streamlit/static/static/js/index.CjozwSzS.js +1 -0
- streamlit/static/static/js/{index.DOFlg3dS.js → index.CkGVt6-G.js} +1 -1
- streamlit/static/static/js/index.CuvXOyER.js +2 -0
- streamlit/static/static/js/{index.B_dWA3vd.js → index.CyUHWoCC.js} +2 -2
- streamlit/static/static/js/index.CyroQtI4.js +2 -0
- streamlit/static/static/js/index.D6HmkoDm.js +263 -0
- streamlit/static/static/js/index.DAqCNvsO.js +1 -0
- streamlit/static/static/js/index.DB_w_CZQ.js +1 -0
- streamlit/static/static/js/index.DBalctjj.js +2 -0
- streamlit/static/static/js/index.DK0RFJUG.js +11 -0
- streamlit/static/static/js/index.DMxc2XFp.js +151 -0
- streamlit/static/static/js/index.DO5utP74.js +2 -0
- streamlit/static/static/js/index.DS7lf09n.js +1 -0
- streamlit/static/static/js/index.DWexTVLY.js +1 -0
- streamlit/static/static/js/index.DXxnU5ej.js +1 -0
- streamlit/static/static/js/index.DcU3uDvB.js +2 -0
- streamlit/static/static/js/index.DlltaH7J.js +1 -0
- streamlit/static/static/js/index.DpNTZz82.js +27 -0
- streamlit/static/static/js/index.Dr9HIhQw.js +1 -0
- streamlit/static/static/js/index.DsgAU5lc.js +1 -0
- streamlit/static/static/js/{index.DPUXkcQL.js → index.KfXqjDYy.js} +1 -1
- streamlit/static/static/js/index.PaidgjCs.js +1 -0
- streamlit/static/static/js/index.RJZuWCGA.js +1 -0
- streamlit/static/static/js/{index.CxIUUfab.js → index.hbeqcRTn.js} +53 -122
- streamlit/static/static/js/index.q5hIQwAY.js +1 -0
- streamlit/static/static/js/index.rORSX6IW.js +1 -0
- streamlit/static/static/js/index.uSX757_v.js +1 -0
- streamlit/static/static/js/index.x_QRaLMd.js +1 -0
- streamlit/static/static/js/{input.D4MN_FzN.js → input.D5oh9-aB.js} +2 -2
- streamlit/static/static/js/main.q9oGOg0H.js +13 -0
- streamlit/static/static/js/{memory.DrZjtdGT.js → memory.5kCSFUJS.js} +1 -1
- streamlit/static/static/js/moment.C3j7ZXd7.js +4 -0
- streamlit/static/static/js/number-overlay-editor.Cn_LsK8N.js +9 -0
- streamlit/static/static/js/pandasStylerUtils.BqhXt51_.js +1 -0
- streamlit/static/static/js/{possibleConstructorReturn.exeeJQEP.js → possibleConstructorReturn.DD9NK1Z8.js} +1 -1
- streamlit/static/static/js/{sandbox.ClO3IuUr.js → sandbox.DACSyz29.js} +1 -1
- streamlit/static/static/js/styled-components.C3R090At.js +1 -0
- streamlit/static/static/js/threshold.Q1mXg5rX.js +1 -0
- streamlit/static/static/js/throttle.B0GR3Iyz.js +1 -0
- streamlit/static/static/js/{timepicker.DAhu-vcF.js → timepicker.BdhzPxrv.js} +1 -1
- streamlit/static/static/js/timer.C2hYhUse.js +1 -0
- streamlit/static/static/js/{toConsumableArray.DNbljYEC.js → toConsumableArray.Db2pdqM2.js} +1 -1
- streamlit/static/static/js/uniqueId.CtqIr-Yh.js +1 -0
- streamlit/static/static/js/urls.BwSlolu9.js +1 -0
- streamlit/static/static/js/{useBasicWidgetState.D6sOH6oI.js → useBasicWidgetState.Bfp6TnSw.js} +1 -1
- streamlit/static/static/js/useIntlLocale.hRV75Xgj.js +12 -0
- streamlit/static/static/js/{useTextInputAutoExpand.4u3_GcuN.js → useTextInputAutoExpand.QepX7n8Y.js} +1 -1
- streamlit/static/static/js/useUpdateUiValue.DHx8TzX6.js +1 -0
- streamlit/static/static/js/useWaveformController.WxVzpzEX.js +1 -0
- streamlit/static/static/js/value.B4vHRSi7.js +1 -0
- streamlit/static/static/js/withCalculatedWidth.DcKeRSWJ.js +1 -0
- streamlit/static/static/js/withFullScreenWrapper.CrHddARq.js +1 -0
- streamlit/string_util.py +8 -1
- streamlit/testing/v1/app_test.py +15 -0
- streamlit/testing/v1/element_tree.py +62 -0
- streamlit/web/bootstrap.py +24 -0
- streamlit/web/server/oauth_authlib_routes.py +5 -2
- streamlit/web/server/upload_file_request_handler.py +16 -0
- {streamlit-1.51.0.dist-info → streamlit-1.52.0.dist-info}/METADATA +9 -5
- {streamlit-1.51.0.dist-info → streamlit-1.52.0.dist-info}/RECORD +274 -239
- streamlit/static/static/js/InputInstructions.jhH15PqV.js +0 -1
- streamlit/static/static/js/Particles.DUsputn1.js +0 -1
- streamlit/static/static/js/data-grid-overlay-editor.2Ufgxc6y.js +0 -1
- streamlit/static/static/js/index.B1ZQh4P1.js +0 -1
- streamlit/static/static/js/index.BKstZk0M.js +0 -27
- streamlit/static/static/js/index.BMcFsUee.js +0 -1
- streamlit/static/static/js/index.BR-IdcTb.js +0 -2
- streamlit/static/static/js/index.BgnZEMVh.js +0 -1
- streamlit/static/static/js/index.BohqXifI.js +0 -1
- streamlit/static/static/js/index.Br5nxKNj.js +0 -2
- streamlit/static/static/js/index.BrIKVbNc.js +0 -3
- streamlit/static/static/js/index.BtWUPzle.js +0 -1
- streamlit/static/static/js/index.C0RLraek.js +0 -1
- streamlit/static/static/js/index.CAIjskgG.js +0 -1
- streamlit/static/static/js/index.CAj-7vWz.js +0 -949
- streamlit/static/static/js/index.CMtEit2O.js +0 -1
- streamlit/static/static/js/index.CkRlykEE.js +0 -12
- streamlit/static/static/js/index.CmN3FXfI.js +0 -1617
- streamlit/static/static/js/index.CwbFI1_-.js +0 -1
- streamlit/static/static/js/index.D2KPNy7e.js +0 -1
- streamlit/static/static/js/index.DGAh7DMq.js +0 -1
- streamlit/static/static/js/index.DKb_NvmG.js +0 -197
- streamlit/static/static/js/index.DMqgUYKq.js +0 -1
- streamlit/static/static/js/index.DX1xY89g.js +0 -1
- streamlit/static/static/js/index.DYATBCsq.js +0 -2
- streamlit/static/static/js/index.DaSmGJ76.js +0 -3
- streamlit/static/static/js/index.Dd7bMeLP.js +0 -1
- streamlit/static/static/js/index.DjmmgI5U.js +0 -1
- streamlit/static/static/js/index.Dq56CyM2.js +0 -1
- streamlit/static/static/js/index.DuiXaS5_.js +0 -7
- streamlit/static/static/js/index.DvFidMLe.js +0 -2
- streamlit/static/static/js/index.DwkhC5Pc.js +0 -1
- streamlit/static/static/js/index.Q-3sFn1v.js +0 -1
- streamlit/static/static/js/index.QJ5QO9sJ.js +0 -1
- streamlit/static/static/js/index.VwTaeety.js +0 -1
- streamlit/static/static/js/index.YOqQbeX8.js +0 -1
- streamlit/static/static/js/number-overlay-editor.DRwAw1In.js +0 -9
- streamlit/static/static/js/uniqueId.oG4Gvj1v.js +0 -1
- streamlit/static/static/js/useUpdateUiValue.F2R3eTeR.js +0 -1
- streamlit/static/static/js/withFullScreenWrapper.zothJIsI.js +0 -1
- {streamlit-1.51.0.data → streamlit-1.52.0.data}/scripts/streamlit.cmd +0 -0
- {streamlit-1.51.0.dist-info → streamlit-1.52.0.dist-info}/WHEEL +0 -0
- {streamlit-1.51.0.dist-info → streamlit-1.52.0.dist-info}/entry_points.txt +0 -0
- {streamlit-1.51.0.dist-info → streamlit-1.52.0.dist-info}/top_level.txt +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,E as Z,_ as K,u as Le,bb as ae,ax as ze,bt as le,L as We,k as he,n as q,b0 as ce,bn as Me,bh as Oe,bg as _e,s as C,j as d,af as Ve,e as $,B as Ne,al as He,b as je,bu as qe,l as $e,T as Ge,P as Xe,W as Ze}from"./index.CAj-7vWz.js";import{T as Ke,a as de}from"./Toolbar.D8nHCkuz.js";import{u as Je,F as Qe}from"./FormClearHelper.BB1Km6eP.js";import{c as Ye}from"./createDownloadLinkElement.ZaXNnPK4.js";import{F as er,D as rr}from"./FileDownload.esm.Ddx8VEYy.js";var pe=t.forwardRef(function(e,r){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return t.createElement(Z,K({iconAttrs:o,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:r}),t.createElement("g",{fill:"none"},t.createElement("rect",{width:24,height:24}),t.createElement("rect",{width:24,height:24}),t.createElement("rect",{width:24,height:24})),t.createElement("path",{d:"M12 14c1.66 0 3-1.34 3-3V5c0-1.66-1.34-3-3-3S9 3.34 9 5v6c0 1.66 1.34 3 3 3z"}),t.createElement("path",{d:"M17 11c0 2.76-2.24 5-5 5s-5-2.24-5-5H5c0 3.53 2.61 6.43 6 6.92V21h2v-3.08c3.39-.49 6-3.39 6-6.92h-2z"}))});pe.displayName="Mic";var ge=t.forwardRef(function(e,r){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return t.createElement(Z,K({iconAttrs:o,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:r}),t.createElement("rect",{width:24,height:24,fill:"none"}),t.createElement("path",{d:"M8 19c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2s-2 .9-2 2v10c0 1.1.9 2 2 2zm6-12v10c0 1.1.9 2 2 2s2-.9 2-2V7c0-1.1-.9-2-2-2s-2 .9-2 2z"}))});ge.displayName="Pause";var ye=t.forwardRef(function(e,r){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return t.createElement(Z,K({iconAttrs:o,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:r}),t.createElement("rect",{width:24,height:24,fill:"none"}),t.createElement("path",{d:"M8 6.82v10.36c0 .79.87 1.27 1.54.84l8.14-5.18a1 1 0 000-1.69L9.54 5.98A.998.998 0 008 6.82z"}))});ye.displayName="PlayArrow";var ve=t.forwardRef(function(e,r){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return t.createElement(Z,K({iconAttrs:o,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:r}),t.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),t.createElement("path",{d:"M17.65 6.35a7.95 7.95 0 00-6.48-2.31c-3.67.37-6.69 3.35-7.1 7.02C3.52 15.91 7.27 20 12 20a7.98 7.98 0 007.21-4.56c.32-.67-.16-1.44-.9-1.44-.37 0-.72.2-.88.53a5.994 5.994 0 01-6.8 3.31c-2.22-.49-4.01-2.3-4.48-4.52A6.002 6.002 0 0112 6c1.66 0 3.14.69 4.22 1.78l-1.51 1.51c-.63.63-.19 1.71.7 1.71H19c.55 0 1-.45 1-1V6.41c0-.89-1.08-1.34-1.71-.71l-.64.65z"}))});ve.displayName="Refresh";var we=t.forwardRef(function(e,r){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return t.createElement(Z,K({iconAttrs:o,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:r}),t.createElement("g",{fill:"none"},t.createElement("rect",{width:24,height:24}),t.createElement("rect",{width:24,height:24})),t.createElement("path",{fillRule:"evenodd",d:"M9 16h6c.55 0 1-.45 1-1V9c0-.55-.45-1-1-1H9c-.55 0-1 .45-1 1v6c0 .55.45 1 1 1zm3-14C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2z"}))});we.displayName="StopCircle";async function tr(e,r=16e3){if(!e||e.size===0)throw new Error("Invalid or empty blob provided");if(!window.AudioContext)throw new Error("AudioContext not supported in this browser");const o=new AudioContext;try{const n=await e.arrayBuffer(),s=await o.decodeAudioData(n),p=r??s.sampleRate,l=await nr(s,p);return or(l,p)}finally{o.close()}}async function nr(e,r){const{duration:o,numberOfChannels:n,sampleRate:s}=e,p=Math.ceil(o*r);if(!window.OfflineAudioContext)throw new Error("OfflineAudioContext not supported");const l=new OfflineAudioContext(1,p,r),v=l.createBufferSource();if(v.buffer=e,n>1){const y=l.createChannelSplitter(n),u=l.createChannelMerger(1);v.connect(y);for(let i=0;i<n;i++){const a=l.createGain();a.gain.value=1/n,y.connect(a,i),a.connect(u,0,0)}u.connect(l.destination)}else v.connect(l.destination);v.start(0);try{return await l.startRendering()}catch(y){throw new Error(`Failed to resample audio from ${s}Hz to ${r}Hz: ${y instanceof Error?y.message:String(y)}`)}}function or(e,r){const n=e.length,s=n*2+44,p=new ArrayBuffer(s),l=new DataView(p),v=e.getChannelData(0),y=(i,a)=>{for(let f=0;f<a.length;f++)l.setUint8(i+f,a.charCodeAt(f))};y(0,"RIFF"),l.setUint32(4,s-8,!0),y(8,"WAVE"),y(12,"fmt "),l.setUint32(16,16,!0),l.setUint16(20,1,!0),l.setUint16(22,1,!0),l.setUint32(24,r,!0),l.setUint32(28,r*2,!0),l.setUint16(32,2,!0),l.setUint16(34,16,!0),y(36,"data"),l.setUint32(40,n*2,!0);let u=44;for(let i=0;i<n;i++){const a=Math.max(-1,Math.min(1,v[i]));l.setInt16(u,a*32767,!0),u+=2}return new Blob([p],{type:"audio/wav"})}class ue{constructor(){this.wavesurfer=null,this.currentBlobUrl=null,this.events={},this.isPlaying=!1}initialize(r){this.wavesurfer=r,this.setupEventListeners()}setupEventListeners(){this.wavesurfer&&(this.teardownEventListeners(),this.handleTimeUpdate=r=>{this.events.onTimeUpdate?.(r*1e3)},this.handlePause=()=>{this.isPlaying=!1,this.events.onPause?.()},this.handlePlay=()=>{this.isPlaying=!0,this.events.onPlay?.()},this.handleFinish=()=>{this.isPlaying=!1,this.events.onFinish?.()},this.handleReady=()=>{this.events.onReady?.()},this.handleError=r=>{const o=r instanceof Error?r:new Error(String(r));this.events.onError?.(o)},this.wavesurfer.on("timeupdate",this.handleTimeUpdate),this.wavesurfer.on("pause",this.handlePause),this.wavesurfer.on("play",this.handlePlay),this.wavesurfer.on("finish",this.handleFinish),this.wavesurfer.on("ready",this.handleReady),this.wavesurfer.on("error",this.handleError))}setEventHandlers(r){this.events=r}async load(r){if(!this.wavesurfer)throw new Error("WaveSurfer not initialized");this.cleanupPreviousUrl();let o,n=null;try{if(r instanceof Blob)n=URL.createObjectURL(r),o=n;else if(r instanceof ArrayBuffer){const s=new Blob([r]);n=URL.createObjectURL(s),o=n}else o=r;this.currentBlobUrl=n,await this.wavesurfer.load(o)}catch(s){throw this.cleanupPreviousUrl(),s}}async play(){if(!this.wavesurfer)throw new Error("WaveSurfer not initialized");await this.wavesurfer.play()}pause(){this.wavesurfer&&this.wavesurfer.pause()}getDuration(){return this.wavesurfer?this.wavesurfer.getDuration()*1e3:0}getCurrentTime(){return this.wavesurfer?this.wavesurfer.getCurrentTime()*1e3:0}getIsPlaying(){return this.isPlaying}seekToStart(){this.wavesurfer&&this.wavesurfer.seekTo(0)}cleanupPreviousUrl(){this.currentBlobUrl&&(URL.revokeObjectURL(this.currentBlobUrl),this.currentBlobUrl=null)}destroy(){this.pause(),this.cleanupPreviousUrl(),this.wavesurfer&&(this.teardownEventListeners(),this.wavesurfer.empty(),this.wavesurfer=null),this.events={},this.isPlaying=!1,this.handleTimeUpdate=void 0,this.handlePause=void 0,this.handlePlay=void 0,this.handleFinish=void 0,this.handleReady=void 0,this.handleError=void 0}teardownEventListeners(){this.wavesurfer&&(this.handleTimeUpdate&&(this.wavesurfer.un("timeupdate",this.handleTimeUpdate),this.handleTimeUpdate=void 0),this.handlePause&&(this.wavesurfer.un("pause",this.handlePause),this.handlePause=void 0),this.handlePlay&&(this.wavesurfer.un("play",this.handlePlay),this.handlePlay=void 0),this.handleFinish&&(this.wavesurfer.un("finish",this.handleFinish),this.handleFinish=void 0),this.handleReady&&(this.wavesurfer.un("ready",this.handleReady),this.handleReady=void 0),this.handleError&&(this.wavesurfer.un("error",this.handleError),this.handleError=void 0))}}class sr{constructor(r={}){this.wavesurfer=null,this.recordPlugin=null,this.isRecording=!1,this.recordEndResolve=null,this.recordEndReject=null,this.events={},this.options=r}initialize(r,o){this.wavesurfer=r;try{const n={renderRecordedAudio:!1,mimeType:"audio/webm"};this.recordPlugin=r.registerPlugin(o.create(n)),this.setupEventListeners()}catch(n){const s=n instanceof Error?n:new Error(String(n));throw s.name==="NotAllowedError"||s.name==="PermissionDeniedError"?(this.events.onPermissionDenied?.(),new Error("Microphone permission denied")):(this.events.onError?.(s),s)}}setupEventListeners(){this.recordPlugin&&(this.recordPlugin.on("record-start",()=>{this.isRecording=!0,this.events.onRecordStart?.()}),this.recordPlugin.on("record-end",r=>{this.isRecording=!1,this.events.onRecordEnd?.(r),this.recordEndResolve&&r&&r.size>0?(this.recordEndResolve(r),this.recordEndResolve=null,this.recordEndReject=null):this.recordEndReject?(this.recordEndReject(new Error("Invalid or empty recording")),this.recordEndResolve=null,this.recordEndReject=null):(this.recordEndResolve=null,this.recordEndReject=null)}),this.recordPlugin.on("record-progress",r=>{this.events.onRecordProgress?.(r)}))}setEventHandlers(r){this.events=r}async startRecording(){if(!this.recordPlugin)throw new Error("Record plugin not initialized");if(this.isRecording)return;const r=typeof this.options.sampleRate=="number"?this.options.sampleRate:void 0,o={};r!==void 0&&(o.sampleRate={ideal:r}),await this.startRecordingWithConstraints(o,r!==void 0)}async startRecordingWithConstraints(r,o){if(!this.recordPlugin)throw new Error("Record plugin not initialized");try{const n=Object.keys(r).length?r:void 0;await this.recordPlugin.startRecording(n)}catch(n){const s=n instanceof Error?n:new Error(String(n));if(s.name==="NotAllowedError"||s.name==="PermissionDeniedError")throw this.events.onPermissionDenied?.(),new Error("Microphone permission denied");if(o&&(s.name==="OverconstrainedError"||s.name==="NotReadableError")){this.options.sampleRate=void 0,await this.startRecordingWithConstraints({},!1);return}throw this.events.onError?.(s),s}}async stopRecording(){if(!this.recordPlugin||!this.isRecording)throw new Error("Not currently recording");try{return new Promise((r,o)=>{this.recordEndResolve=r,this.recordEndReject=o,this.recordPlugin?.stopRecording()})}catch(r){const o=r instanceof Error?r:new Error(String(r));throw this.events.onError?.(o),o}}cancelRecording(){this.recordPlugin&&this.isRecording&&(this.recordPlugin.stopRecording(),this.isRecording=!1,this.recordEndResolve=null,this.recordEndReject=null)}destroy(){this.cancelRecording(),this.recordPlugin&&(this.recordPlugin.destroy(),this.recordPlugin=null),this.wavesurfer=null,this.events={}}}const ir=4,ar=4,lr=8,cr=0,dr=4,ur=16e3;function fr({containerRef:e,sampleRate:r,events:o}){const n=Le(),[s,p]=t.useState("idle"),[l,v]=t.useState(null),[y,u]=t.useState(!1),i=t.useRef(null),a=t.useRef(null),f=t.useRef(null),h=t.useRef(o||{}),x=t.useRef(!1),b=t.useRef(new Set),w=t.useRef(!1),F=r===void 0?ur:r;t.useEffect(()=>{h.current=o||{}},[o]);const _=t.useCallback(()=>{const c=Array.from(b.current);b.current.clear(),c.forEach(m=>{m.resolve()})},[]),D=t.useCallback(c=>{u(!1);const m=Array.from(b.current);b.current.clear(),m.forEach(E=>{E.reject(c)})},[]),T=t.useCallback(c=>{const m={onPlay:()=>{u(!0),h.current.onPlaybackPlay?.()},onPause:()=>{u(!1),h.current.onPlaybackPause?.()},onFinish:()=>{u(!1),h.current.onPlaybackFinish?.()},onReady:()=>{_()},onError:E=>{u(!1),D(E),h.current.onError?.(E)}};c.setEventHandlers(m)},[_,D]),P=t.useCallback(async()=>{if(!(x.current||!e.current))try{const[c,m]=await Promise.all([ae(()=>import("./wavesurfer.esm.vI8Eid4k.js"),[],import.meta.url),ae(()=>import("./record.B-tDciZb.js"),[],import.meta.url)]),E=c.default,A=m.default,U=E.create({container:e.current,waveColor:n.colors.primary,progressColor:n.colors.bodyText,height:ze(n.sizes.largestElementHeight)-2*dr,barWidth:ir,barGap:ar,barRadius:lr,cursorWidth:cr,interact:!0});i.current=U,w.current=!1;const H=new sr({sampleRate:F});H.initialize(U,A),H.setEventHandlers({onRecordProgress:j=>{h.current.onProgressMs?.(j)},onPermissionDenied:()=>{h.current.onPermissionDenied?.(),p("idle")},onError:j=>{h.current.onError?.(j),p("idle")}}),a.current=H;const L=new ue;L.initialize(U),f.current=L,T(L),x.current=!0}catch(c){const m=c instanceof Error?c:new Error(String(c));h.current.onError?.(m)}},[e,n,F,T]);t.useEffect(()=>{P();const c=b.current;return()=>{c.clear(),u(!1),a.current&&(a.current.destroy(),a.current=null),f.current&&(f.current.destroy(),f.current=null),i.current&&(i.current.destroy(),i.current=null),x.current=!1,w.current=!1}},[P]),t.useEffect(()=>{const c=i.current;if(c){if(s==="recording"){c.setOptions({waveColor:n.colors.primary,progressColor:n.colors.primary});return}if(w.current){c.setOptions({interact:!0,waveColor:le(n.colors.fadedText40,n.colors.secondaryBg),progressColor:n.colors.bodyText});return}c.setOptions({waveColor:n.colors.primary,progressColor:n.colors.bodyText})}},[s,n.colors.bodyText,n.colors.fadedText40,n.colors.primary,n.colors.secondaryBg]);const R=t.useCallback(async()=>{if(s!=="recording"){if(x.current||await P(),!a.current)throw new Error("Record backend not initialized");i.current&&i.current.setOptions({waveColor:n.colors.primary,progressColor:n.colors.primary}),w.current=!1,await a.current.startRecording(),p("recording"),v(null),u(!1),h.current.onRecordStart?.()}},[s,P,n.colors.primary]),G=t.useCallback(()=>{f.current&&i.current&&(f.current.destroy(),f.current=new ue,f.current.initialize(i.current),b.current.clear(),u(!1),T(f.current)),w.current=!1},[T]),M=t.useCallback(()=>{f.current?.seekToStart(),u(!1),w.current=!0,i.current&&i.current.setOptions({interact:!0,waveColor:le(n.colors.fadedText40,n.colors.secondaryBg),progressColor:n.colors.bodyText})},[n.colors.bodyText,n.colors.fadedText40,n.colors.secondaryBg]),k=t.useCallback(async()=>{if(s!=="recording")throw new Error("Not currently recording");if(!a.current||!f.current)throw new Error("Backends not initialized");try{const c=await a.current.stopRecording();return v(c),await new Promise((m,E)=>{if(!f.current){E(new Error("Player not initialized"));return}const A={resolve:()=>{b.current.delete(A),m()},reject:U=>{b.current.delete(A),E(U)}};b.current.add(A),f.current.load(c).catch(U=>{b.current.delete(A),E(U instanceof Error?U:new Error(String(U)))})}),p("idle"),u(!1),M(),h.current.onRecordReady?.(c),c}catch(c){const m=c instanceof Error?c:new Error(String(c));throw u(!1),m}},[s,M]),V=t.useCallback(async c=>{const m=c??l;if(!m)throw new Error("No recorded audio to approve");try{const E=await tr(m,F);h.current.onApprove?.(E),v(null),p("idle")}catch(E){const A=E instanceof Error?E:new Error(String(E));throw h.current.onError?.(A),A}},[l,F]),N=t.useCallback(()=>{s==="recording"&&a.current?.cancelRecording(),G(),v(null),p("idle"),u(!1),w.current=!1,h.current.onCancel?.()},[s,G]),z={isPlaying:t.useCallback(()=>f.current?.getIsPlaying()??!1,[]),play:t.useCallback(async()=>{if(!f.current)throw new Error("Player not initialized");await f.current.play()},[]),pause:t.useCallback(()=>{f.current?.pause()},[]),load:t.useCallback(async c=>{if(x.current||await P(),!f.current)throw new Error("Player not initialized");await f.current.load(c),M()},[M,P]),getCurrentTimeMs:t.useCallback(()=>f.current?.getCurrentTime()??0,[]),getDurationMs:t.useCallback(()=>f.current?.getDuration()??0,[])},J=t.useCallback(c=>{h.current=c},[]);return{state:s,isPlaybackPlaying:y,start:R,stop:k,approve:V,cancel:N,playback:z,setEventHandlers:J}}const hr=(e,r)=>{const{libConfig:{enforceDownloadInNewTab:o=!1}}=t.useContext(We);return t.useCallback(()=>{if(!e)return;const s=Ye({enforceDownloadInNewTab:o,url:e,filename:r});s.style.display="none",document.body.appendChild(s),s.click(),document.body.removeChild(s)},[e,o,r])},Y=({widgetMgr:e,id:r,formId:o,key:n,defaultValue:s})=>{t.useEffect(()=>{const i=e.getElementState(r,n);he(i)&&q(s)&&e.setElementState(r,n,s)},[e,r,n,s]);const[p,l]=t.useState(e.getElementState(r,n)??s),v=t.useCallback(i=>{e.setElementState(r,n,i),l(i)},[e,r,n]),y=t.useMemo(()=>({formId:o||""}),[o]),u=t.useCallback(()=>v(s),[s,v]);return Je({element:y,widgetMgr:e,onFormCleared:u}),[p,v]},pr=async({files:e,uploadClient:r,widgetMgr:o,widgetInfo:n,fragmentId:s,signal:p})=>{let l=[];try{l=await r.fetchFileURLs(e)}catch(i){return{successfulUploads:[],failedUploads:e.map(a=>({file:a,error:ce(i)}))}}const v=Me(e,l),y=[],u=[];return await Promise.all(v.map(async([i,a])=>{if(!i||!a?.uploadUrl||!a.fileId)return{file:i,fileUrl:a,error:new Error("No upload URL found")};try{await r.uploadFile({id:a.fileId,formId:n.formId||""},a.uploadUrl,i,void 0,p),y.push({fileUrl:a,file:i})}catch(f){const h=ce(f);u.push({file:i,error:h})}})),o.setFileUploaderStateValue(n,new Oe({uploadedFileInfo:y.map(({file:i,fileUrl:a})=>new _e({fileId:a.fileId,fileUrls:a,name:i.webkitRelativePath||i.name,size:i.size}))}),{fromUi:!0},s),{successfulUploads:y,failedUploads:u}},gr=C("div",{target:"e3q8yfp0"})(),fe=C("div",{target:"e3q8yfp1"})(({theme:e,disabled:r})=>({height:e.sizes.largestElementHeight,width:"100%",background:e.colors.secondaryBg,borderRadius:e.radii.default,marginBottom:e.spacing.twoXS,display:"flex",alignItems:"center",position:"relative",paddingLeft:e.spacing.xs,paddingRight:e.spacing.sm,border:e.colors.widgetBorderColor?`${e.sizes.borderWidth} solid ${e.colors.widgetBorderColor}`:void 0,cursor:r?"not-allowed":"auto",overflow:"hidden"})),yr=C("div",{target:"e3q8yfp2"})({flex:1}),vr=C("div",{target:"e3q8yfp3"})(({show:e,theme:r})=>({display:e?"block":"none",position:"relative",height:r.sizes.largestElementHeight,"& > div":{position:"absolute",top:0,left:0,width:"100%",height:"100%",display:"flex",alignItems:"center"}})),wr=C("span",{target:"e3q8yfp4"})(({theme:e,isPlayingOrRecording:r,disabled:o})=>({margin:e.spacing.sm,fontFamily:e.fonts.monospace,color:o?e.colors.fadedText40:r?e.colors.bodyText:e.colors.fadedText60,backgroundColor:e.colors.secondaryBg,fontSize:e.fontSizes.sm})),me=C("div",{target:"e3q8yfp5"})({width:"100%",textAlign:"center",overflow:"hidden"}),Ee=C("span",{target:"e3q8yfp6"})(({theme:e})=>({color:e.colors.bodyText})),mr=C("a",{target:"e3q8yfp7"})(({theme:e})=>({color:e.colors.link,textDecoration:e.linkUnderline?"underline":"none"})),Er=C("div",{target:"e3q8yfp8"})(({theme:e})=>({flex:1,height:e.sizes.largestElementHeight,display:"flex",justifyContent:"center",alignItems:"center"})),Rr=C("div",{target:"e3q8yfp9"})(({theme:e})=>{const r="0.625em";return{opacity:.2,width:"100%",height:r,backgroundSize:r,backgroundImage:`radial-gradient(${e.colors.fadedText10} 40%, transparent 40%)`,backgroundRepeat:"repeat"}}),br=C("span",{target:"e3q8yfp10"})(({theme:e})=>({"& > button":{color:e.colors.primary,padding:e.spacing.threeXS},"& > button:hover, & > button:focus":{color:e.colors.redColor}})),Cr=C("span",{target:"e3q8yfp11"})(({theme:e})=>({"& > button":{padding:e.spacing.threeXS,color:e.colors.fadedText60},"& > button:hover, & > button:focus":{color:e.colors.bodyText}})),Re=C("span",{target:"e3q8yfp12"})(({theme:e})=>({"& > button":{padding:e.spacing.threeXS,color:e.colors.fadedText60},"& > button:hover, & > button:focus":{color:e.colors.bodyText}})),ee=C("div",{target:"e3q8yfp13"})(({theme:e})=>({display:"flex",justifyContent:"center",alignItems:"center",flexGrow:0,flexShrink:1,padding:e.spacing.xs,gap:e.spacing.twoXS,marginRight:e.spacing.twoXS})),Pr=C("div",{target:"e3q8yfp14"})(({theme:e})=>({marginLeft:e.spacing.sm})),X=({onClick:e,disabled:r,ariaLabel:o,iconContent:n})=>d(je,{kind:Ne.BORDERLESS_ICON,onClick:e,disabled:r,"aria-label":o,containerWidth:!0,"data-testid":"stAudioInputActionButton",children:d(He,{content:n,size:"lg",color:"inherit"})}),Sr=({disabled:e,stopRecording:r})=>d(br,{children:d(X,{onClick:r,disabled:e,ariaLabel:"Stop recording",iconContent:we})}),kr=({disabled:e,isPlaying:r,onClickPlayPause:o})=>d(Re,{children:r?d(X,{onClick:o,disabled:e,ariaLabel:"Pause",iconContent:ge}):d(X,{onClick:o,disabled:e,ariaLabel:"Play",iconContent:ye})}),Ar=({disabled:e,startRecording:r})=>d(Cr,{children:d(X,{onClick:r,disabled:e,ariaLabel:"Record",iconContent:pe})}),Ur=({onClick:e})=>d(Re,{children:d(X,{disabled:!1,onClick:e,ariaLabel:"Reset",iconContent:ve})}),Tr=({disabled:e,isRecording:r,isPlaying:o,isUploading:n,isError:s,recordingUrlExists:p,startRecording:l,stopRecording:v,onClickPlayPause:y,onClear:u})=>s?d(ee,{children:d(Ur,{onClick:u})}):n?d(ee,{children:d(Ve,{"aria-label":"Uploading",size:"base",margin:"0",padding:"0"})}):$(ee,{children:[r?d(Sr,{disabled:e,stopRecording:v}):d(Ar,{disabled:e,startRecording:l}),p&&d(kr,{disabled:e,isPlaying:o,onClickPlayPause:y})]}),Ir=t.memo(Tr),xr=()=>d(me,{children:d(Ee,{children:"An error has occurred, please try again."})}),Br=t.memo(xr),B="00:00",O=e=>{const r=Math.floor(e/1e3),o=Math.floor(r/60),n=Math.floor(o/60),s=r%60,p=o%60,l=s.toString().padStart(2,"0"),v=p.toString().padStart(2,"0"),y=n.toString().padStart(2,"0");return o<60?`${v}:${l}`:`${y}:${v}:${l}`},Fr=()=>$(me,{children:[d(Ee,{children:"This app would like to use your microphone."})," ",d(mr,{href:qe,rel:"noopener noreferrer",target:"_blank",children:"Learn how to allow access."})]}),Dr=t.memo(Fr),Lr=()=>d(Er,{children:d(Rr,{})}),zr=t.memo(Lr),Wr=({element:e,uploadClient:r,widgetMgr:o,fragmentId:n,disabled:s})=>{const p=t.useRef(null),[l,v]=t.useState(!1),[y,u]=t.useState(!1),[i,a]=t.useState(!1),[f,h]=t.useState(B),[x,b]=Y({widgetMgr:o,id:e.id,key:"deleteFileUrl",defaultValue:null}),[w,F]=Y({widgetMgr:o,id:e.id,key:"recordingUrl",defaultValue:null}),[_,D]=Y({widgetMgr:o,id:e.id,formId:e.formId,key:"recordingTime",defaultValue:B}),T=t.useRef(null),P=t.useRef(null),R=t.useRef(null),G=t.useRef(),M=e.id,k=e.formId,V=fr({containerRef:p,sampleRate:e.sampleRate??void 0,events:{onPermissionDenied:()=>{v(!0)},onError:()=>{a(!0)},onRecordStart:()=>{D(B),h(B)},onRecordReady:()=>{const g=O(V.playback.getDurationMs());D(g),h(g)},onApprove:g=>{G.current?.(g)},onCancel:()=>{D(B),h(B)},onProgressMs:g=>{D(O(g))},onPlaybackPause:()=>{h(O(V.playback.getCurrentTimeMs()))},onPlaybackFinish:()=>{h(O(V.playback.getDurationMs()))}}}),{state:N,isPlaybackPlaying:z,start:J,stop:c,approve:m,cancel:E,playback:{play:A,pause:U,load:H,getCurrentTimeMs:L,getDurationMs:j}}=V,be=t.useCallback(async g=>{T.current&&T.current.abort();const I=new AbortController;T.current=I;try{if(u(!0),q(k)&&o.setFormsWithUploadsInProgress(new Set([k])),I.signal.aborted)return;let S;try{S=URL.createObjectURL(g),P.current&&P.current!==S&&URL.revokeObjectURL(P.current),P.current=S}catch{a(!0),u(!1),q(k)&&o.setFormsWithUploadsInProgress(new Set);return}if(I.signal.aborted){URL.revokeObjectURL(S),P.current=null;return}F(S);const xe=new Date().toISOString().slice(0,16).replace(/:/g,"-"),Be=new File([g],`${xe}_audio.wav`,{type:g.type});try{const{successfulUploads:Fe,failedUploads:De}=await pr({files:[Be],uploadClient:r,widgetMgr:o,widgetInfo:{id:M,formId:k},fragmentId:n,signal:I.signal});if(I.signal.aborted)return;if(De.length>0){a(!0);return}a(!1);const ie=Fe[0];ie?.fileUrl?.deleteUrl&&b(ie.fileUrl.deleteUrl)}catch{I.signal.aborted||a(!0)}finally{q(k)&&o.setFormsWithUploadsInProgress(new Set),I.signal.aborted||u(!1)}}catch{I.signal.aborted||(a(!0),u(!1)),q(k)&&o.setFormsWithUploadsInProgress(new Set)}},[r,o,M,k,n,b,F]);G.current=be;const W=t.useCallback(async({updateWidgetManager:g,deleteFile:I})=>{const S=w;if(S&&P.current===S&&(URL.revokeObjectURL(S),P.current=null),R.current&&(cancelAnimationFrame(R.current),R.current=null),F(null),b(null),h(B),D(B),E(),g&&o.setFileUploaderStateValue(e,{},{fromUi:!0},n),I&&x)try{await r.deleteFile(x)}catch{}q(S)&&URL.revokeObjectURL(S)},[x,w,r,E,e,o,n,D,b,F]);t.useEffect(()=>{const g=()=>{z&&(h(O(L())),R.current=requestAnimationFrame(g))};return z?R.current=requestAnimationFrame(g):R.current&&(cancelAnimationFrame(R.current),R.current=null),()=>{R.current&&(cancelAnimationFrame(R.current),R.current=null)}},[z,L]),t.useEffect(()=>{if(!w)return;let g=!1;return h(_),(async()=>{try{if(await H(w),g)return;const S=j();S>0&&h(O(S))}catch{g||a(!0)}})(),()=>{g=!0}},[w,_,H,j]),t.useEffect(()=>{if(he(k))return;const g=new Qe;return g.manageFormClearListener(o,k,()=>{W({updateWidgetManager:!0,deleteFile:!1})}),()=>g.disconnect()},[k,W,o]),t.useEffect(()=>()=>{T.current&&(T.current.abort(),T.current=null),R.current&&(cancelAnimationFrame(R.current),R.current=null)},[]);const Ce=t.useCallback(async()=>{try{if(z){const g=L();U(),h(O(g))}else N==="idle"&&w&&(L()<=100&&h(B),await A())}catch{a(!0)}},[z,L,U,A,w,N]),re=t.useCallback(async()=>{w&&await W({updateWidgetManager:!1,deleteFile:!0});try{h(B),await J()}catch{}},[W,w,J]),te=t.useCallback(async()=>{try{const g=await c();await m(g)}catch{a(!0)}},[m,c]),ne=hr(w,"recording.wav"),Pe=t.useCallback(()=>{re()},[re]),Se=t.useCallback(()=>{te()},[te]),ke=t.useCallback(()=>{W({updateWidgetManager:!1,deleteFile:!0}),a(!1)},[W]),Ae=t.useCallback(()=>{ne()},[ne]),Ue=t.useCallback(()=>{W({updateWidgetManager:!0,deleteFile:!0})},[W]),Q=N==="recording",oe=z,Te=Q?_:f,se=N==="idle"&&!l&&!w,Ie=l||se||i;return $(gr,{className:"stAudioInput","data-testid":"stAudioInput",children:[d(Ze,{label:e.label,disabled:s,labelVisibility:$e(e.labelVisibility?.value),children:e.help&&d(Pr,{children:d(Ge,{content:e.help,placement:Xe.TOP})})}),$(fe,{disabled:s,children:[$(Ke,{isFullScreen:!1,disableFullscreenMode:!0,target:fe,children:[w&&d(de,{label:"Download as WAV",icon:er,onClick:Ae}),x&&d(de,{label:"Clear recording",icon:rr,onClick:Ue})]}),d(Ir,{isRecording:Q,isPlaying:oe,isUploading:y,isError:i,recordingUrlExists:!!w,startRecording:Pe,stopRecording:Se,onClickPlayPause:()=>void Ce(),onClear:ke,disabled:s||l}),$(yr,{children:[i&&d(Br,{}),se&&d(zr,{}),l&&d(Dr,{}),d(vr,{"data-testid":"stAudioInputWaveSurfer",ref:p,show:!Ie})]}),d(wr,{isPlayingOrRecording:Q||oe,disabled:s,"data-testid":"stAudioInputWaveformTimeCode",children:Te})]})]})},Hr=t.memo(Wr);export{Hr as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r,E as M,_ as J,s as E,aw as T,k as h,n as Q,w as ft,u as mt,a3 as bt,a4 as gt,ax as X,e as W,j as u,l as ht,O as yt,T as It,P as Tt,W as wt,x as Ct,al as G}from"./index.CAj-7vWz.js";import{u as St}from"./uniqueId.oG4Gvj1v.js";import{I as vt}from"./InputInstructions.jhH15PqV.js";import{u as Vt}from"./FormClearHelper.BB1Km6eP.js";import{s as xt}from"./sprintf.D7DtBTRn.js";import{I as kt}from"./input.D4MN_FzN.js";import"./base-input.CJGiNqed.js";var Y=r.forwardRef(function(t,e){var a={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return r.createElement(M,J({iconAttrs:a,iconVerticalAlign:"middle",iconViewBox:"0 0 8 8"},t,{ref:e}),r.createElement("path",{d:"M0 3v2h8V3H0z"}))});Y.displayName="Minus";var Z=r.forwardRef(function(t,e){var a={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return r.createElement(M,J({iconAttrs:a,iconVerticalAlign:"middle",iconViewBox:"0 0 8 8"},t,{ref:e}),r.createElement("path",{d:"M3 0v3H0v2h3v3h2V5h3V3H5V0H3z"}))});Z.displayName="Plus";const Dt=E("div",{target:"eaba2yi0"})(({theme:t})=>({display:"flex",flexDirection:"row",flexWrap:"nowrap",alignItems:"center",height:t.sizes.minElementHeight,borderWidth:t.sizes.borderWidth,borderStyle:"solid",borderColor:t.colors.widgetBorderColor??t.colors.secondaryBg,transitionDuration:"200ms",transitionProperty:"border",transitionTimingFunction:"cubic-bezier(0.2, 0.8, 0.4, 1)",borderRadius:t.radii.default,overflow:"hidden","&.focused":{borderColor:t.colors.primary},input:{MozAppearance:"textfield","&::-webkit-inner-spin-button, &::-webkit-outer-spin-button":{WebkitAppearance:"none",margin:t.spacing.none}}})),Et=E("div",{target:"eaba2yi1"})({display:"flex",flexDirection:"row",alignSelf:"stretch"}),K=E("button",{target:"eaba2yi2"})(({theme:t})=>({margin:t.spacing.none,border:"none",height:t.sizes.full,display:"flex",alignItems:"center",width:t.sizes.numberInputControlsWidth,justifyContent:"center",color:t.colors.bodyText,transition:"color 300ms, backgroundColor 300ms",backgroundColor:t.colors.secondaryBg,"&:hover:enabled, &:focus:enabled":{color:t.colors.white,backgroundColor:t.colors.primary,transition:"none",outline:"none"},"&:active":{outline:"none",border:"none"},"&:disabled":{cursor:"not-allowed",color:t.colors.fadedText40}})),Rt=E("div",{target:"eaba2yi3"})(({theme:t,clearable:e})=>({position:"absolute",marginRight:t.spacing.twoXS,left:0,right:`calc(${t.sizes.numberInputControlsWidth} * 2 + ${e?"1em":"0em"})`})),Nt=ft.getLogger("NumberInput");function Ft(t){return h(t)||t===""?void 0:t}const D=({value:t,format:e,step:a,dataType:m})=>{if(h(t))return null;let o=Ft(e);if(h(o)&&Q(a)){const i=a.toString();m===T.DataType.FLOAT&&a!==0&&i.includes(".")&&(o=`%0.${i.split(".")[1].length}f`)}if(h(o))return t.toString();try{return xt.sprintf(o,t)}catch(i){return Nt.warn(`Error in sprintf(${o}, ${t}): ${i}`),String(t)}},zt=(t,e,a)=>h(t)?!1:t-e>=a,Wt=(t,e,a)=>h(t)?!1:t+e<=a,Lt=t=>(t.element.dataType===T.DataType.INT?t.widgetMgr.getIntValue(t.element):t.widgetMgr.getDoubleValue(t.element))??t.element.default??null,q=({step:t,dataType:e})=>t||(e===T.DataType.INT?1:.01),Bt=({disabled:t,element:e,widgetMgr:a,fragmentId:m})=>{const o=mt(),{dataType:i,id:v,formId:f,default:L,format:b,icon:R,min:y,max:I}=e,{width:B,elementRef:tt}=bt(),[s,et]=r.useState(()=>q(e)),P=Lt({element:e,widgetMgr:a}),[g,w]=r.useState(!1),[l,C]=r.useState(P),[U,H]=r.useState(!1),V=r.useRef(null),A=r.useRef(St("number_input_")),[O,S]=r.useState(()=>D({value:P,dataType:i,format:b,step:s})),x=zt(l,s,y),k=Wt(l,s,I),$=gt({formId:f}),ot=$?a.allowFormEnterToSubmit(f):g,rt=U&&B>o.breakpoints.hideWidgetDetails;r.useEffect(()=>{et(q({step:e.step,dataType:e.dataType}))},[e.dataType,e.step]),r.useEffect(()=>{g||S(D({value:l,dataType:i,format:b,step:s}))},[i,b,s]);const d=r.useCallback(({value:n,source:c})=>{if(Q(n)&&(y>n||n>I))V.current?.reportValidity();else{const p=n??L??null;switch(i){case T.DataType.INT:a.setIntValue({id:v,formId:f},p,c,m);break;case T.DataType.FLOAT:a.setDoubleValue({id:v,formId:f},p,c,m);break;default:throw new Error("Invalid data type")}w(!1),C(p),S(D({value:p,dataType:i,format:b,step:s}))}},[y,I,V,a,m,s,i,v,f,L,b]),nt=r.useCallback(()=>{g&&d({value:l,source:{fromUi:!0}}),H(!1)},[g,l,d]),at=r.useCallback(()=>{H(!0)},[]),j=r.useCallback(()=>{const{value:n}=e;e.setValue=!1,C(n??null),S(D({value:n??null,dataType:i,format:b,step:s})),d({value:n??null,source:{fromUi:!1}})},[e,s,d,i,b]);r.useEffect(()=>{e.setValue?j():d({value:l,source:{fromUi:!1}});const n=V.current;if(n){const c=p=>{p.preventDefault()};return n.addEventListener("wheel",c),()=>{n.removeEventListener("wheel",c)}}},[]),e.setValue&&j();const N=h(e.default)&&!t,st=r.useCallback(()=>{const n=e.default??null;C(n),d({value:n,source:{fromUi:!0}})},[e]);Vt({element:e,widgetMgr:a,onFormCleared:st});const it=n=>{const{value:c}=n.target;if(c==="")w(!0),C(null),S(null);else{let p;e.dataType===T.DataType.INT?p=parseInt(c,10):p=parseFloat(c),w(!0),C(p),S(c)}},F=r.useCallback(()=>{k&&(w(!0),d({value:(l??y)+s,source:{fromUi:!0}}))},[l,y,s,k]),z=r.useCallback(()=>{x&&(w(!0),d({value:(l??I)-s,source:{fromUi:!0}}))},[l,I,s,x]),lt=r.useCallback(n=>{const{key:c}=n;switch(c){case"ArrowUp":n.preventDefault(),F();break;case"ArrowDown":n.preventDefault(),z();break}},[F,z]),ct=r.useCallback(n=>{n.key==="Enter"&&(g&&d({value:l,source:{fromUi:!0}}),a.allowFormEnterToSubmit(f)&&a.submitForm(f,m))},[g,l,d,a,f,m]),_=R?.startsWith(":material"),ut=_?"lg":"base",dt=X(o.iconSizes.lg)+2*X(o.spacing.twoXS),pt=R?o.breakpoints.hideNumberInputControls+dt:o.breakpoints.hideNumberInputControls;return W("div",{className:"stNumberInput","data-testid":"stNumberInput",ref:tt,children:[u(wt,{label:e.label,disabled:t,labelVisibility:ht(e.labelVisibility?.value),htmlFor:A.current,children:e.help&&u(yt,{children:u(It,{content:e.help,placement:Tt.TOP_RIGHT})})}),W(Dt,{className:U?"focused":"","data-testid":"stNumberInputContainer",children:[u(kt,{type:"number",inputRef:V,value:O??"",placeholder:e.placeholder,onBlur:nt,onFocus:at,onChange:it,onKeyPress:ct,onKeyDown:lt,clearable:N,clearOnEscape:N,disabled:t,"aria-label":e.label,startEnhancer:e.icon&&u(Ct,{"data-testid":"stNumberInputIcon",iconValue:e.icon,size:ut}),id:A.current,overrides:{ClearIconContainer:{style:{padding:0}},ClearIcon:{props:{overrides:{Svg:{style:{color:o.colors.grayTextColor,padding:o.spacing.threeXS,height:o.sizes.clearIconSize,width:o.sizes.clearIconSize,":hover":{fill:o.colors.bodyText}}}}}},Input:{props:{"data-testid":"stNumberInputField",step:s,min:y,max:I,type:"number",inputMode:""},style:{fontWeight:o.fontWeights.normal,lineHeight:o.lineHeights.inputWidget,paddingRight:o.spacing.sm,paddingLeft:o.spacing.md,paddingBottom:o.spacing.sm,paddingTop:o.spacing.sm,"::placeholder":{color:o.colors.fadedText60}}},InputContainer:{style:()=>({borderTopRightRadius:0,borderBottomRightRadius:0})},Root:{style:{borderTopRightRadius:0,borderBottomRightRadius:0,borderTopLeftRadius:0,borderBottomLeftRadius:0,borderLeftWidth:0,borderRightWidth:0,borderTopWidth:0,borderBottomWidth:0,paddingRight:0,paddingLeft:R?o.spacing.sm:0}},StartEnhancer:{style:{paddingLeft:0,paddingRight:0,minWidth:o.iconSizes.lg,color:_?o.colors.fadedText60:"inherit"}}}}),B>pt&&W(Et,{children:[u(K,{"data-testid":"stNumberInputStepDown",onClick:z,disabled:!x||t,tabIndex:-1,children:u(G,{content:Y,size:"xs",color:x?"inherit":o.colors.fadedText40})}),u(K,{"data-testid":"stNumberInputStepUp",onClick:F,disabled:!k||t,tabIndex:-1,children:u(G,{content:Z,size:"xs",color:k?"inherit":o.colors.fadedText40})})]})]}),rt&&u(Rt,{clearable:N,children:u(vt,{dirty:g,value:O??"",inForm:$,allowEnterToSubmit:ot})})]})},_t=r.memo(Bt);export{_t as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{s as e,r as a,e as t,j as r,S as o}from"./index.CAj-7vWz.js";import{P as i}from"./ProgressBar.DLY8H6nE.js";const l=e("div",{target:"e1675qd10"})(({theme:s})=>({paddingBottom:s.spacing.sm,lineHeight:"normal"}));function d({element:s}){return t("div",{className:"stProgress","data-testid":"stProgress",children:[r(l,{children:r(o,{source:s.text,allowHTML:!1,isLabel:!0})}),r(i,{value:s.value})]})}const m=a.memo(d);export{m as default};
|