streamlit 1.49.1__py3-none-any.whl → 1.51.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.
Files changed (259) hide show
  1. streamlit/__init__.py +4 -1
  2. streamlit/column_config.py +2 -0
  3. streamlit/commands/navigation.py +7 -7
  4. streamlit/commands/page_config.py +4 -6
  5. streamlit/components/v1/custom_component.py +17 -42
  6. streamlit/components/v2/__init__.py +458 -0
  7. streamlit/components/v2/bidi_component/__init__.py +20 -0
  8. streamlit/components/v2/bidi_component/constants.py +29 -0
  9. streamlit/components/v2/bidi_component/main.py +386 -0
  10. streamlit/components/v2/bidi_component/serialization.py +265 -0
  11. streamlit/components/v2/bidi_component/state.py +92 -0
  12. streamlit/components/v2/component_definition_resolver.py +143 -0
  13. streamlit/components/v2/component_file_watcher.py +403 -0
  14. streamlit/components/v2/component_manager.py +431 -0
  15. streamlit/components/v2/component_manifest_handler.py +122 -0
  16. streamlit/components/v2/component_path_utils.py +245 -0
  17. streamlit/components/v2/component_registry.py +409 -0
  18. streamlit/components/v2/get_bidi_component_manager.py +51 -0
  19. streamlit/components/v2/manifest_scanner.py +615 -0
  20. streamlit/components/v2/presentation.py +198 -0
  21. streamlit/components/v2/types.py +324 -0
  22. streamlit/config.py +741 -32
  23. streamlit/config_option.py +4 -1
  24. streamlit/config_util.py +650 -1
  25. streamlit/connections/base_connection.py +4 -2
  26. streamlit/dataframe_util.py +18 -10
  27. streamlit/delta_generator.py +8 -7
  28. streamlit/delta_generator_singletons.py +3 -1
  29. streamlit/deprecation_util.py +17 -6
  30. streamlit/elements/arrow.py +90 -42
  31. streamlit/elements/deck_gl_json_chart.py +98 -39
  32. streamlit/elements/dialog_decorator.py +2 -1
  33. streamlit/elements/exception.py +3 -1
  34. streamlit/elements/form.py +6 -6
  35. streamlit/elements/graphviz_chart.py +24 -9
  36. streamlit/elements/heading.py +3 -5
  37. streamlit/elements/iframe.py +0 -2
  38. streamlit/elements/image.py +12 -13
  39. streamlit/elements/layouts.py +89 -22
  40. streamlit/elements/lib/built_in_chart_utils.py +95 -31
  41. streamlit/elements/lib/color_util.py +8 -18
  42. streamlit/elements/lib/column_config_utils.py +9 -8
  43. streamlit/elements/lib/column_types.py +595 -148
  44. streamlit/elements/lib/dialog.py +3 -2
  45. streamlit/elements/lib/image_utils.py +3 -5
  46. streamlit/elements/lib/layout_utils.py +50 -13
  47. streamlit/elements/lib/mutable_status_container.py +2 -2
  48. streamlit/elements/lib/options_selector_utils.py +2 -2
  49. streamlit/elements/lib/pandas_styler_utils.py +30 -14
  50. streamlit/elements/lib/utils.py +21 -9
  51. streamlit/elements/map.py +81 -40
  52. streamlit/elements/media.py +7 -7
  53. streamlit/elements/metric.py +11 -35
  54. streamlit/elements/pdf.py +2 -4
  55. streamlit/elements/plotly_chart.py +142 -26
  56. streamlit/elements/progress.py +2 -4
  57. streamlit/elements/pyplot.py +6 -6
  58. streamlit/elements/space.py +113 -0
  59. streamlit/elements/vega_charts.py +400 -143
  60. streamlit/elements/widgets/audio_input.py +52 -4
  61. streamlit/elements/widgets/button.py +29 -29
  62. streamlit/elements/widgets/button_group.py +33 -6
  63. streamlit/elements/widgets/camera_input.py +3 -4
  64. streamlit/elements/widgets/chat.py +7 -0
  65. streamlit/elements/widgets/checkbox.py +1 -0
  66. streamlit/elements/widgets/color_picker.py +1 -0
  67. streamlit/elements/widgets/data_editor.py +34 -29
  68. streamlit/elements/widgets/file_uploader.py +6 -10
  69. streamlit/elements/widgets/multiselect.py +14 -3
  70. streamlit/elements/widgets/number_input.py +5 -4
  71. streamlit/elements/widgets/radio.py +10 -2
  72. streamlit/elements/widgets/select_slider.py +8 -4
  73. streamlit/elements/widgets/selectbox.py +9 -2
  74. streamlit/elements/widgets/slider.py +38 -41
  75. streamlit/elements/widgets/text_widgets.py +6 -0
  76. streamlit/elements/widgets/time_widgets.py +15 -12
  77. streamlit/elements/write.py +28 -23
  78. streamlit/emojis.py +1 -1
  79. streamlit/errors.py +115 -0
  80. streamlit/git_util.py +65 -43
  81. streamlit/hello/hello.py +8 -0
  82. streamlit/hello/utils.py +2 -1
  83. streamlit/material_icon_names.py +1 -1
  84. streamlit/navigation/page.py +4 -1
  85. streamlit/proto/ArrowData_pb2.py +27 -0
  86. streamlit/proto/ArrowData_pb2.pyi +46 -0
  87. streamlit/proto/Arrow_pb2.py +10 -8
  88. streamlit/proto/Arrow_pb2.pyi +31 -2
  89. streamlit/proto/AudioInput_pb2.py +2 -2
  90. streamlit/proto/AudioInput_pb2.pyi +6 -2
  91. streamlit/proto/BidiComponent_pb2.py +34 -0
  92. streamlit/proto/BidiComponent_pb2.pyi +153 -0
  93. streamlit/proto/Block_pb2.py +11 -11
  94. streamlit/proto/Block_pb2.pyi +9 -1
  95. streamlit/proto/DeckGlJsonChart_pb2.py +10 -4
  96. streamlit/proto/DeckGlJsonChart_pb2.pyi +9 -3
  97. streamlit/proto/Element_pb2.py +5 -3
  98. streamlit/proto/Element_pb2.pyi +14 -4
  99. streamlit/proto/HeightConfig_pb2.py +2 -2
  100. streamlit/proto/HeightConfig_pb2.pyi +6 -3
  101. streamlit/proto/NewSession_pb2.py +18 -16
  102. streamlit/proto/NewSession_pb2.pyi +158 -6
  103. streamlit/proto/PlotlyChart_pb2.py +8 -6
  104. streamlit/proto/PlotlyChart_pb2.pyi +3 -1
  105. streamlit/proto/Space_pb2.py +27 -0
  106. streamlit/proto/Space_pb2.pyi +42 -0
  107. streamlit/proto/WidgetStates_pb2.py +2 -2
  108. streamlit/proto/WidgetStates_pb2.pyi +13 -3
  109. streamlit/proto/WidthConfig_pb2.py +2 -2
  110. streamlit/proto/WidthConfig_pb2.pyi +6 -3
  111. streamlit/runtime/app_session.py +45 -6
  112. streamlit/runtime/caching/cache_data_api.py +4 -4
  113. streamlit/runtime/caching/cache_errors.py +4 -1
  114. streamlit/runtime/caching/cache_resource_api.py +3 -2
  115. streamlit/runtime/caching/cache_utils.py +2 -1
  116. streamlit/runtime/caching/cached_message_replay.py +3 -3
  117. streamlit/runtime/caching/hashing.py +3 -4
  118. streamlit/runtime/caching/legacy_cache_api.py +2 -1
  119. streamlit/runtime/connection_factory.py +1 -3
  120. streamlit/runtime/forward_msg_queue.py +4 -1
  121. streamlit/runtime/fragment.py +2 -1
  122. streamlit/runtime/memory_media_file_storage.py +1 -1
  123. streamlit/runtime/metrics_util.py +6 -2
  124. streamlit/runtime/runtime.py +14 -0
  125. streamlit/runtime/scriptrunner/exec_code.py +2 -1
  126. streamlit/runtime/scriptrunner/script_runner.py +2 -2
  127. streamlit/runtime/scriptrunner_utils/script_run_context.py +3 -6
  128. streamlit/runtime/secrets.py +2 -4
  129. streamlit/runtime/session_manager.py +3 -1
  130. streamlit/runtime/state/common.py +30 -5
  131. streamlit/runtime/state/presentation.py +85 -0
  132. streamlit/runtime/state/safe_session_state.py +2 -2
  133. streamlit/runtime/state/session_state.py +220 -16
  134. streamlit/runtime/state/widgets.py +19 -3
  135. streamlit/runtime/theme_util.py +148 -0
  136. streamlit/runtime/websocket_session_manager.py +3 -1
  137. streamlit/source_util.py +2 -2
  138. streamlit/static/index.html +2 -2
  139. streamlit/static/manifest.json +244 -227
  140. streamlit/static/static/css/{index.C8X8rNzw.css → index.BpABIXK9.css} +1 -1
  141. streamlit/static/static/css/index.DgR7E2CV.css +1 -0
  142. streamlit/static/static/js/{ErrorOutline.esm.DcGrhbBP.js → ErrorOutline.esm.YoJdlW1p.js} +1 -1
  143. streamlit/static/static/js/{FileDownload.esm.DgBvV6Pq.js → FileDownload.esm.Ddx8VEYy.js} +1 -1
  144. streamlit/static/static/js/{FileHelper.M6AAaeuA.js → FileHelper.90EtOmj9.js} +1 -1
  145. streamlit/static/static/js/{FormClearHelper.DHh1GFzm.js → FormClearHelper.BB1Km6eP.js} +1 -1
  146. streamlit/static/static/js/InputInstructions.jhH15PqV.js +1 -0
  147. streamlit/static/static/js/{Particles.DDVT-6Qc.js → Particles.DUsputn1.js} +1 -1
  148. streamlit/static/static/js/{ProgressBar.BEY0cXXV.js → ProgressBar.DLY8H6nE.js} +2 -2
  149. streamlit/static/static/js/Toolbar.D8nHCkuz.js +1 -0
  150. streamlit/static/static/js/{base-input.CK3UVGp1.js → base-input.CJGiNqed.js} +3 -3
  151. streamlit/static/static/js/{checkbox.D8W881TL.js → checkbox.Cpdd482O.js} +1 -1
  152. streamlit/static/static/js/{createSuper.B6W-Dh9S.js → createSuper.CuQIogbW.js} +1 -1
  153. streamlit/static/static/js/data-grid-overlay-editor.2Ufgxc6y.js +1 -0
  154. streamlit/static/static/js/{downloader.DiKpuU_S.js → downloader.CN0K7xlu.js} +1 -1
  155. streamlit/static/static/js/{es6.B8zRNPZ-.js → es6.BJcsVXQ0.js} +2 -2
  156. streamlit/static/static/js/{iframeResizer.contentWindow.DIewJmmh.js → iframeResizer.contentWindow.XzUvQqcZ.js} +1 -1
  157. streamlit/static/static/js/index.B1ZQh4P1.js +1 -0
  158. streamlit/static/static/js/index.BKstZk0M.js +27 -0
  159. streamlit/static/static/js/{index.Bte_9Lyq.js → index.BMcFsUee.js} +1 -1
  160. streamlit/static/static/js/{index.qhs54UAB.js → index.BR-IdcTb.js} +1 -1
  161. streamlit/static/static/js/{index.CejBxbg1.js → index.B_dWA3vd.js} +1 -1
  162. streamlit/static/static/js/{index.D5naqx-J.js → index.BgnZEMVh.js} +1 -1
  163. streamlit/static/static/js/{index.C7fRKRs4.js → index.BohqXifI.js} +1 -1
  164. streamlit/static/static/js/{index.cnnXF7xQ.js → index.Br5nxKNj.js} +1 -1
  165. streamlit/static/static/js/index.BrIKVbNc.js +3 -0
  166. streamlit/static/static/js/index.BtWUPzle.js +1 -0
  167. streamlit/static/static/js/index.C0RLraek.js +1 -0
  168. streamlit/static/static/js/{index.CP5TD2z1.js → index.CAIjskgG.js} +1 -1
  169. streamlit/static/static/js/{index.CD8HuT3N.js → index.CAj-7vWz.js} +135 -162
  170. streamlit/static/static/js/{index.DtYN2x4k.js → index.CMtEit2O.js} +1 -1
  171. streamlit/static/static/js/index.CkRlykEE.js +12 -0
  172. streamlit/static/static/js/{index.Ts_0SdB9.js → index.CmN3FXfI.js} +2 -2
  173. streamlit/static/static/js/{index.BnEpvLEz.js → index.CwbFI1_-.js} +1 -1
  174. streamlit/static/static/js/{index.CcJf6BCU.js → index.CxIUUfab.js} +27 -27
  175. streamlit/static/static/js/index.D2KPNy7e.js +1 -0
  176. streamlit/static/static/js/{index.Ch7MBCx0.js → index.D3GPA5k4.js} +47 -47
  177. streamlit/static/static/js/{index.ho6NIXGl.js → index.DGAh7DMq.js} +1 -1
  178. streamlit/static/static/js/index.DKb_NvmG.js +197 -0
  179. streamlit/static/static/js/{index.CvYYtxD_.js → index.DMqgUYKq.js} +1 -1
  180. streamlit/static/static/js/{index.zecpGxtj.js → index.DOFlg3dS.js} +1 -1
  181. streamlit/static/static/js/{index.B9mjBcgE.js → index.DPUXkcQL.js} +1 -1
  182. streamlit/static/static/js/index.DX1xY89g.js +1 -0
  183. streamlit/static/static/js/index.DYATBCsq.js +2 -0
  184. streamlit/static/static/js/{index.D2-atlaQ.js → index.DaSmGJ76.js} +3 -3
  185. streamlit/static/static/js/index.Dd7bMeLP.js +1 -0
  186. streamlit/static/static/js/{index.4eF4NxG2.js → index.DjmmgI5U.js} +1 -1
  187. streamlit/static/static/js/index.Dq56CyM2.js +1 -0
  188. streamlit/static/static/js/index.DuiXaS5_.js +7 -0
  189. streamlit/static/static/js/index.DvFidMLe.js +2 -0
  190. streamlit/static/static/js/{index.452cqrrL.js → index.DwkhC5Pc.js} +1 -1
  191. streamlit/static/static/js/{index.Dk4C7X3i.js → index.Q-3sFn1v.js} +1 -1
  192. streamlit/static/static/js/{index.CjXWwH-y.js → index.QJ5QO9sJ.js} +1 -1
  193. streamlit/static/static/js/{index.B6U8LQo3.js → index.VwTaeety.js} +1 -1
  194. streamlit/static/static/js/index.YOqQbeX8.js +1 -0
  195. streamlit/static/static/js/{input.nzVJphXi.js → input.D4MN_FzN.js} +1 -1
  196. streamlit/static/static/js/{memory.CjCgTQz3.js → memory.DrZjtdGT.js} +1 -1
  197. streamlit/static/static/js/{number-overlay-editor.DaRFzZEO.js → number-overlay-editor.DRwAw1In.js} +1 -1
  198. streamlit/static/static/js/{possibleConstructorReturn.DgiPnZ9N.js → possibleConstructorReturn.exeeJQEP.js} +1 -1
  199. streamlit/static/static/js/record.B-tDciZb.js +1 -0
  200. streamlit/static/static/js/{sandbox.mithfq7Z.js → sandbox.ClO3IuUr.js} +1 -1
  201. streamlit/static/static/js/{timepicker.Dbl5KFh6.js → timepicker.DAhu-vcF.js} +4 -4
  202. streamlit/static/static/js/{toConsumableArray.D-Dx88BQ.js → toConsumableArray.DNbljYEC.js} +1 -1
  203. streamlit/static/static/js/{uniqueId.Bh26R_3S.js → uniqueId.oG4Gvj1v.js} +1 -1
  204. streamlit/static/static/js/{useBasicWidgetState.DeK-QJpD.js → useBasicWidgetState.D6sOH6oI.js} +1 -1
  205. streamlit/static/static/js/{useTextInputAutoExpand.4iAdLWD-.js → useTextInputAutoExpand.4u3_GcuN.js} +2 -2
  206. streamlit/static/static/js/{useUpdateUiValue.CmT7_nJN.js → useUpdateUiValue.F2R3eTeR.js} +1 -1
  207. streamlit/static/static/js/wavesurfer.esm.vI8Eid4k.js +73 -0
  208. streamlit/static/static/js/withFullScreenWrapper.zothJIsI.js +1 -0
  209. streamlit/static/static/media/MaterialSymbols-Rounded.C7IFxh57.woff2 +0 -0
  210. streamlit/string_util.py +56 -1
  211. streamlit/testing/v1/app_test.py +2 -2
  212. streamlit/testing/v1/element_tree.py +23 -9
  213. streamlit/testing/v1/util.py +2 -2
  214. streamlit/type_util.py +3 -4
  215. streamlit/url_util.py +1 -3
  216. streamlit/user_info.py +1 -2
  217. streamlit/util.py +3 -1
  218. streamlit/watcher/event_based_path_watcher.py +23 -12
  219. streamlit/watcher/local_sources_watcher.py +11 -1
  220. streamlit/watcher/path_watcher.py +9 -6
  221. streamlit/watcher/polling_path_watcher.py +4 -1
  222. streamlit/watcher/util.py +2 -2
  223. streamlit/web/bootstrap.py +0 -31
  224. streamlit/web/cli.py +51 -22
  225. streamlit/web/server/bidi_component_request_handler.py +193 -0
  226. streamlit/web/server/component_file_utils.py +97 -0
  227. streamlit/web/server/component_request_handler.py +8 -21
  228. streamlit/web/server/oidc_mixin.py +3 -1
  229. streamlit/web/server/routes.py +18 -5
  230. streamlit/web/server/server.py +10 -0
  231. streamlit/web/server/server_util.py +3 -1
  232. streamlit/web/server/upload_file_request_handler.py +3 -1
  233. {streamlit-1.49.1.dist-info → streamlit-1.51.0.dist-info}/METADATA +4 -5
  234. {streamlit-1.49.1.dist-info → streamlit-1.51.0.dist-info}/RECORD +238 -209
  235. streamlit/static/static/css/index.COe1010n.css +0 -1
  236. streamlit/static/static/js/Hooks.DGu1od_L.js +0 -1
  237. streamlit/static/static/js/InputInstructions.z6sVgyYt.js +0 -1
  238. streamlit/static/static/js/Toolbar.DSnK1fUh.js +0 -1
  239. streamlit/static/static/js/data-grid-overlay-editor.DRTHOydk.js +0 -1
  240. streamlit/static/static/js/index.BXYmrqnf.js +0 -1
  241. streamlit/static/static/js/index.B_8AnktO.js +0 -1
  242. streamlit/static/static/js/index.Bl7zGQSh.js +0 -7
  243. streamlit/static/static/js/index.BnJIOYn9.js +0 -73
  244. streamlit/static/static/js/index.C1HcTl5K.js +0 -1
  245. streamlit/static/static/js/index.C7lSmSOP.js +0 -1
  246. streamlit/static/static/js/index.C_tmcx4B.js +0 -1
  247. streamlit/static/static/js/index.D3K5nOu9.js +0 -197
  248. streamlit/static/static/js/index.DkKT3LUI.js +0 -1
  249. streamlit/static/static/js/index.MTPPBDHk.js +0 -2
  250. streamlit/static/static/js/index.pqW9AMJD.js +0 -3
  251. streamlit/static/static/js/index.urHgTgMQ.js +0 -12
  252. streamlit/static/static/js/index.wzkv_11M.js +0 -1
  253. streamlit/static/static/js/index.yF5AncHY.js +0 -1
  254. streamlit/static/static/js/withFullScreenWrapper.DLp1ENGm.js +0 -1
  255. streamlit/static/static/media/MaterialSymbols-Rounded.CBxVaFdk.woff2 +0 -0
  256. {streamlit-1.49.1.data → streamlit-1.51.0.data}/scripts/streamlit.cmd +0 -0
  257. {streamlit-1.49.1.dist-info → streamlit-1.51.0.dist-info}/WHEEL +0 -0
  258. {streamlit-1.49.1.dist-info → streamlit-1.51.0.dist-info}/entry_points.txt +0 -0
  259. {streamlit-1.49.1.dist-info → streamlit-1.51.0.dist-info}/top_level.txt +0 -0
@@ -1 +1 @@
1
- import{v as T,r as i,w as b,V as L,j as p,x as N}from"./index.CD8HuT3N.js";const U=T("iframe",{target:"eymnmwl0"})(({theme:r})=>({colorScheme:"normal",border:"none",padding:r.spacing.none,margin:r.spacing.none,width:"100%",aspectRatio:"16 / 9"})),R=N.getLogger("Video"),A={width:"100%"};function O({element:r,endpoints:s,elementMgr:f}){const n=i.useRef(null),{type:y,url:l,startTime:a,subtitles:d,endTime:o,loop:u,autoplay:m,muted:E}=r;let g=b(l);const S=i.useMemo(()=>{if(!r.id)return!0;const e=f.getElementState(r.id,"preventAutoplay");return e||f.setElementState(r.id,"preventAutoplay",!0),e??!1},[r.id,f]),v=i.useMemo(()=>JSON.stringify(d?d.map(e=>s.buildMediaURL(`${e.url}`)):[]),[d,s]);i.useEffect(()=>{const e=JSON.parse(v);e.length!==0&&e.forEach(t=>{s.checkSourceUrlResponse(t,"Video Subtitle")})},[v,s]),i.useEffect(()=>{n.current&&(n.current.currentTime=a)},[a]),i.useEffect(()=>{const e=n.current,t=()=>{e&&(e.currentTime=r.startTime)};return e&&e.addEventListener("loadedmetadata",t),()=>{e&&e.removeEventListener("loadedmetadata",t)}},[r]),i.useEffect(()=>{const e=n.current;if(!e)return;let t=!1;const c=()=>{o>0&&e.currentTime>=o&&(u?(e.currentTime=a||0,e.play()):t||(t=!0,e.pause()))};return o>0&&e.addEventListener("timeupdate",c),()=>{e&&o>0&&e.removeEventListener("timeupdate",c)}},[o,u,a]),i.useEffect(()=>{const e=n.current;if(!e)return;const t=()=>{u&&(e.currentTime=a||0,e.play())};return e.addEventListener("ended",t),()=>{e&&e.removeEventListener("ended",t)}},[u,a]);const V=e=>{const t=new URL(e);if(a&&!isNaN(a)&&t.searchParams.append("start",a.toString()),o&&!isNaN(o)&&t.searchParams.append("end",o.toString()),u){t.searchParams.append("loop","1");const c=t.pathname.split("/").pop();c&&t.searchParams.append("playlist",c)}return m&&t.searchParams.append("autoplay","1"),E&&t.searchParams.append("mute","1"),t.toString()};if(y===L.Type.YOUTUBE_IFRAME)return p(U,{className:"stVideo","data-testid":"stVideo",title:l,src:V(l),allow:"autoplay; encrypted-media",allowFullScreen:!0});const h=e=>{const t=e.currentTarget.src;R.error(`Client Error: Video source error - ${t}`),s.sendClientErrorToHost("Video","Video source failed to load","onerror triggered",t)};return p("video",{className:"stVideo","data-testid":"stVideo",ref:n,controls:!0,muted:E,autoPlay:m&&!S,src:s.buildMediaURL(l),style:A,crossOrigin:g,onError:h,children:d&&d.map((e,t)=>p("track",{kind:"captions",src:s.buildMediaURL(`${e.url}`),label:`${e.label}`,default:t===0,"data-testid":"stVideoSubtitle"},t))})}const P=i.memo(O);export{P as default};
1
+ import{s as T,r as i,v as b,V as L,j as p,w as N}from"./index.CAj-7vWz.js";const U=T("iframe",{target:"eymnmwl0"})(({theme:r})=>({colorScheme:"normal",border:"none",padding:r.spacing.none,margin:r.spacing.none,width:"100%",aspectRatio:"16 / 9"})),R=N.getLogger("Video"),A={width:"100%"};function O({element:r,endpoints:s,elementMgr:f}){const n=i.useRef(null),{type:y,url:c,startTime:a,subtitles:l,endTime:o,loop:d,autoplay:m,muted:E}=r;let g=b(c);const S=i.useMemo(()=>{if(!r.id)return!0;const e=f.getElementState(r.id,"preventAutoplay");return e||f.setElementState(r.id,"preventAutoplay",!0),e??!1},[r.id,f]),v=i.useMemo(()=>JSON.stringify(l?l.map(e=>s.buildMediaURL(`${e.url}`)):[]),[l,s]);i.useEffect(()=>{const e=JSON.parse(v);e.length!==0&&e.forEach(t=>{s.checkSourceUrlResponse(t,"Video Subtitle")})},[v,s]),i.useEffect(()=>{n.current&&(n.current.currentTime=a)},[a]),i.useEffect(()=>{const e=n.current,t=()=>{e&&(e.currentTime=r.startTime)};return e&&e.addEventListener("loadedmetadata",t),()=>{e&&e.removeEventListener("loadedmetadata",t)}},[r]),i.useEffect(()=>{const e=n.current;if(!e)return;let t=!1;const u=()=>{o>0&&e.currentTime>=o&&(d?(e.currentTime=a||0,e.play()):t||(t=!0,e.pause()))};return o>0&&e.addEventListener("timeupdate",u),()=>{e&&o>0&&e.removeEventListener("timeupdate",u)}},[o,d,a]),i.useEffect(()=>{const e=n.current;if(!e)return;const t=()=>{d&&(e.currentTime=a||0,e.play())};return e.addEventListener("ended",t),()=>{e&&e.removeEventListener("ended",t)}},[d,a]);const V=e=>{const t=new URL(e);if(a&&!isNaN(a)&&t.searchParams.append("start",a.toString()),o&&!isNaN(o)&&t.searchParams.append("end",o.toString()),d){t.searchParams.append("loop","1");const u=t.pathname.split("/").pop();u&&t.searchParams.append("playlist",u)}return m&&t.searchParams.append("autoplay","1"),E&&t.searchParams.append("mute","1"),t.toString()};if(y===L.Type.YOUTUBE_IFRAME)return p(U,{className:"stVideo","data-testid":"stVideo",title:c,src:V(c),allow:"autoplay; encrypted-media",allowFullScreen:!0});const h=e=>{const t=e.currentTarget.src;R.error(`Client Error: Video source error - ${t}`),s.sendClientErrorToHost("Video","Video source failed to load","onerror triggered",t)};return p("video",{className:"stVideo","data-testid":"stVideo",ref:n,controls:!0,muted:E,autoPlay:m&&!S,src:s.buildMediaURL(c),style:A,crossOrigin:g,onError:h,children:l?.map((e,t)=>p("track",{kind:"captions",src:s.buildMediaURL(`${e.url}`),label:`${e.label}`,default:t===0,"data-testid":"stVideoSubtitle"},t))})}const P=i.memo(O);export{P as default};
@@ -1 +1 @@
1
- import{v as l,r as i,w as A,j as f,x as g}from"./index.CD8HuT3N.js";const T=l("div",{target:"ea9qfvi0"})(()=>({lineHeight:0})),y=l("audio",{target:"ea9qfvi1"})(({theme:t})=>({width:"100%",height:t.sizes.minElementHeight,margin:0,padding:0})),h=g.getLogger("Audio");function L({element:t,endpoints:a,elementMgr:s}){const o=i.useRef(null),{startTime:n,endTime:d,loop:u,autoplay:p}=t,E=i.useMemo(()=>{if(!t.id)return!0;const e=s.getElementState(t.id,"preventAutoplay");return e||s.setElementState(t.id,"preventAutoplay",!0),e??!1},[t.id,s]);i.useEffect(()=>{o.current&&(o.current.currentTime=n)},[n]),i.useEffect(()=>{const e=o.current,r=()=>{e&&(e.currentTime=t.startTime)};return e&&e.addEventListener("loadedmetadata",r),()=>{e&&e.removeEventListener("loadedmetadata",r)}},[t]),i.useEffect(()=>{const e=o.current;if(!e)return;let r=!1;const c=()=>{d>0&&e.currentTime>=d&&(u?(e.currentTime=n||0,e.play()):r||(r=!0,e.pause()))};return d>0&&e.addEventListener("timeupdate",c),()=>{e&&d>0&&e.removeEventListener("timeupdate",c)}},[d,u,n]),i.useEffect(()=>{const e=o.current;if(!e)return;const r=()=>{u&&(e.currentTime=n||0,e.play())};return e.addEventListener("ended",r),()=>{e&&e.removeEventListener("ended",r)}},[u,n]);const m=A(t.url),v=a.buildMediaURL(t.url);return f(T,{children:f(y,{className:"stAudio","data-testid":"stAudio",ref:o,controls:!0,autoPlay:p&&!E,src:v,onError:e=>{const r=e.currentTarget.src;h.error(`Client Error: Audio source error - ${r}`),a.sendClientErrorToHost("Audio","Audio source failed to load","onerror triggered",r)},crossOrigin:m})})}const C=i.memo(L);export{C as default};
1
+ import{s as l,r as i,v as A,j as f,w as g}from"./index.CAj-7vWz.js";const T=l("div",{target:"ea9qfvi0"})(()=>({lineHeight:0})),y=l("audio",{target:"ea9qfvi1"})(({theme:t})=>({width:"100%",height:t.sizes.minElementHeight,margin:0,padding:0})),h=g.getLogger("Audio");function L({element:t,endpoints:a,elementMgr:u}){const o=i.useRef(null),{startTime:n,endTime:d,loop:s,autoplay:p}=t,E=i.useMemo(()=>{if(!t.id)return!0;const e=u.getElementState(t.id,"preventAutoplay");return e||u.setElementState(t.id,"preventAutoplay",!0),e??!1},[t.id,u]);i.useEffect(()=>{o.current&&(o.current.currentTime=n)},[n]),i.useEffect(()=>{const e=o.current,r=()=>{e&&(e.currentTime=t.startTime)};return e&&e.addEventListener("loadedmetadata",r),()=>{e&&e.removeEventListener("loadedmetadata",r)}},[t]),i.useEffect(()=>{const e=o.current;if(!e)return;let r=!1;const c=()=>{d>0&&e.currentTime>=d&&(s?(e.currentTime=n||0,e.play()):r||(r=!0,e.pause()))};return d>0&&e.addEventListener("timeupdate",c),()=>{e&&d>0&&e.removeEventListener("timeupdate",c)}},[d,s,n]),i.useEffect(()=>{const e=o.current;if(!e)return;const r=()=>{s&&(e.currentTime=n||0,e.play())};return e.addEventListener("ended",r),()=>{e&&e.removeEventListener("ended",r)}},[s,n]);const m=A(t.url),v=a.buildMediaURL(t.url);return f(T,{children:f(y,{className:"stAudio","data-testid":"stAudio",ref:o,controls:!0,autoPlay:p&&!E,src:v,onError:e=>{const r=e.currentTarget.src;h.error(`Client Error: Audio source error - ${r}`),a.sendClientErrorToHost("Audio","Audio source failed to load","onerror triggered",r)},crossOrigin:m})})}const C=i.memo(L);export{C as default};
@@ -1 +1 @@
1
- import{r as l,m as s,j as d,l as V,U as x}from"./index.CD8HuT3N.js";import{u as U}from"./useBasicWidgetState.DeK-QJpD.js";import"./FormClearHelper.DHh1GFzm.js";const h=(t,e)=>t.getStringValue(e),v=t=>t.options.length===0||s(t.default)?null:t.options[t.default],w=t=>t.rawValue??null,y=(t,e,o,a)=>{e.setStringValue(t,o.value,{fromUi:o.fromUi},a)},C=({disabled:t,element:e,widgetMgr:o,fragmentId:a})=>{const{options:i,help:u,label:n,labelVisibility:c,placeholder:p,acceptNewOptions:f}=e,[g,r]=U({getStateFromWidgetMgr:h,getDefaultStateFromProto:v,getCurrStateFromProto:w,updateWidgetMgrState:y,element:e,widgetMgr:o,fragmentId:a}),b=l.useCallback(S=>{r({value:S,fromUi:!0})},[r]),m=s(e.default)&&!t;return d(x,{label:n,labelVisibility:V(c?.value),options:i,disabled:t,onChange:b,value:g,help:u,placeholder:p,clearable:m,acceptNewOptions:f??!1})},P=l.memo(C);export{P as default};
1
+ import{r as l,k as s,j as m,l as V,U as x}from"./index.CAj-7vWz.js";import{u as U}from"./useBasicWidgetState.D6sOH6oI.js";import"./FormClearHelper.BB1Km6eP.js";const h=(t,e)=>t.getStringValue(e),v=t=>t.options.length===0||s(t.default)?null:t.options[t.default],w=t=>t.rawValue??null,y=(t,e,o,a)=>{e.setStringValue(t,o.value,{fromUi:o.fromUi},a)},C=({disabled:t,element:e,widgetMgr:o,fragmentId:a})=>{const{options:i,help:u,label:n,labelVisibility:c,placeholder:p,acceptNewOptions:f}=e,[g,r]=U({getStateFromWidgetMgr:h,getDefaultStateFromProto:v,getCurrStateFromProto:w,updateWidgetMgrState:y,element:e,widgetMgr:o,fragmentId:a}),b=l.useCallback(d=>{r({value:d,fromUi:!0})},[r]),S=s(e.default)&&!t;return m(x,{label:n,labelVisibility:V(c?.value),options:i,disabled:t,onChange:b,value:g,help:u,placeholder:p,clearable:S,acceptNewOptions:f??!1})},P=l.memo(C);export{P as default};
@@ -0,0 +1 @@
1
+ import{s as u,r as L,I as v,e as h,j as i,v as C,S as E,w as b}from"./index.CAj-7vWz.js";import{w as T,E as W}from"./withFullScreenWrapper.zothJIsI.js";import{S as p,T as y}from"./Toolbar.D8nHCkuz.js";const F=u("div",{target:"e1mq0gaz0"})(({theme:e,shouldStretch:t})=>({display:"flex",flexDirection:"row",flexWrap:"wrap",rowGap:e.spacing.lg,maxWidth:"100%",width:t?"100%":"fit-content"})),j=u("div",{target:"e1mq0gaz1"})(({theme:e,shouldStretch:t})=>({display:"flex",flexDirection:"column",alignItems:"stretch",width:t?"100%":"auto",flexGrow:t?1:0,">img":{borderRadius:e.radii.default}})),q=u("div",{target:"e1mq0gaz2"})(({theme:e})=>({textAlign:"center",marginTop:e.spacing.xs,wordWrap:"break-word",padding:e.spacing.threeXS})),H=b.getLogger("ImageList");function M(e,t,r){if(e){if(e.useStretch)return r;if(e.useContent)return;if(e.pixelWidth)return e.pixelWidth}if(t!=null)switch(t){case-1:case-3:case-4:return;case-2:case-5:return r;default:return t>0?t:void 0}}const R=({itemKey:e,image:t,imgStyle:r,buildMediaURL:l,handleImageError:s,shouldStretch:d})=>{const o=C(t.url);return h(j,{"data-testid":"stImageContainer",shouldStretch:d,children:[i("img",{style:r,src:l(t.url),alt:e,onError:s,crossOrigin:o}),t.caption&&i(q,{"data-testid":"stImageCaption",style:r,children:i(E,{source:t.caption,allowHTML:!1,isCaption:!0,isLabel:!0})})]})};function z({element:e,endpoints:t,widthConfig:r,disableFullscreenMode:l}){const{expanded:s,width:d,height:o,expand:x,collapse:f}=v(W),g=d||0,I=M(r,e.width,g),m=r?.useStretch||e.width===-5,a={};o&&s?(a.maxHeight=o,a.objectFit="contain",a.width="100%"):(a.width=I??"100%",a.maxWidth="100%");const w=c=>{const n=c.currentTarget.src;H.error(`Client Error: Image source error - ${n}`),t.sendClientErrorToHost("Image","Image source failed to load","onerror triggered",n)};return h(p,{width:g,height:o,useContainerWidth:s,topCentered:!0,children:[i(y,{target:p,isFullScreen:s,onExpand:x,onCollapse:f,disableFullscreenMode:l}),i(F,{className:"stImage","data-testid":"stImage",shouldStretch:m,children:e.imgs.map((c,n)=>i(R,{itemKey:n.toString(),image:c,imgStyle:a,buildMediaURL:S=>t.buildMediaURL(S),handleImageError:w,shouldStretch:m},n))})]})}const G=T(z),A=L.memo(G);export{A as default};
@@ -0,0 +1,2 @@
1
+ import{r as a,w as Fr,bF as K,bm as kr,a1 as ir,a2 as Br,b0 as Tr,u as _r,j as h,I as L,L as dr,bG as Wr,s as lr,bH as fr}from"./index.CAj-7vWz.js";const _=a.createContext(null);_.displayName="BidiComponentContext";const T=Fr.getLogger("BidiComponent"),Y="__",W="__streamlit_arrow_ref__",Ur="$$STREAMLIT_INTERNAL_KEY",Lr=(r,e)=>{if(r&&typeof r=="object"&&!Array.isArray(r)){if(typeof r[W]=="string"){const t=r[W],n=e[t];if(n)try{return K(n)}catch{return null}return null}const o={};for(const[t,n]of Object.entries(r))if(n&&typeof n=="object"&&!Array.isArray(n)&&typeof n[W]=="string"){const u=n[W],s=e[u];if(s)try{o[t]=K(s)}catch{o[t]=null}else o[t]=null}else o[t]=n;return o}return r},Ar=({arrowBlobs:r,arrowData:e,bytes:o,data:t,json:n,mixedJson:u})=>{switch(t){case"json":return n?JSON.parse(n):null;case"arrowData":return e??null;case"bytes":return o??null;case"mixed":{if(u&&r&&u){const s=JSON.parse(u),c={};return r&&Object.entries(r).forEach(([f,l])=>{l?.data&&(c[f]=l.data)}),Lr(s,c)}return null}case"any":case void 0:return null;default:kr(t)}};var A,X;function Ir(){if(X)return A;X=1;function r(e,o,t,n){var u=-1,s=e==null?0:e.length;for(n&&s&&(t=e[++u]);++u<s;)t=o(t,e[u],u,e);return t}return A=r,A}var I,Q;function Or(){if(Q)return I;Q=1;function r(e){return function(o){return e?.[o]}}return I=r,I}var O,rr;function zr(){if(rr)return O;rr=1;var r=Or(),e={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},o=r(e);return O=o,O}var z,er;function Mr(){if(er)return z;er=1;var r=zr(),e=ir(),o=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,t="\\u0300-\\u036f",n="\\ufe20-\\ufe2f",u="\\u20d0-\\u20ff",s=t+n+u,c="["+s+"]",f=RegExp(c,"g");function l(d){return d=e(d),d&&d.replace(o,r).replace(f,"")}return z=l,z}var M,or;function jr(){if(or)return M;or=1;var r=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function e(o){return o.match(r)||[]}return M=e,M}var j,tr;function Nr(){if(tr)return j;tr=1;var r=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function e(o){return r.test(o)}return j=e,j}var N,nr;function qr(){if(nr)return N;nr=1;var r="\\ud800-\\udfff",e="\\u0300-\\u036f",o="\\ufe20-\\ufe2f",t="\\u20d0-\\u20ff",n=e+o+t,u="\\u2700-\\u27bf",s="a-z\\xdf-\\xf6\\xf8-\\xff",c="\\xac\\xb1\\xd7\\xf7",f="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",l="\\u2000-\\u206f",d=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",i="A-Z\\xc0-\\xd6\\xd8-\\xde",R="\\ufe0e\\ufe0f",b=c+f+l+d,p="['’]",C="["+b+"]",g="["+n+"]",y="\\d+",w="["+u+"]",S="["+s+"]",m="[^"+r+b+y+u+s+i+"]",E="\\ud83c[\\udffb-\\udfff]",x="(?:"+g+"|"+E+")",F="[^"+r+"]",k="(?:\\ud83c[\\udde6-\\uddff]){2}",v="[\\ud800-\\udbff][\\udc00-\\udfff]",B="["+i+"]",pr="\\u200d",H="(?:"+S+"|"+m+")",br="(?:"+B+"|"+m+")",V="(?:"+p+"(?:d|ll|m|re|s|t|ve))?",J="(?:"+p+"(?:D|LL|M|RE|S|T|VE))?",G=x+"?",Z="["+R+"]?",mr="(?:"+pr+"(?:"+[F,k,v].join("|")+")"+Z+G+")*",hr="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Rr="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",vr=Z+G+mr,yr="(?:"+[w,k,v].join("|")+")"+vr,Sr=RegExp([B+"?"+S+"+"+V+"(?="+[C,B,"$"].join("|")+")",br+"+"+J+"(?="+[C,B+H,"$"].join("|")+")",B+"?"+H+"+"+V,B+"+"+J,Rr,hr,y,yr].join("|"),"g");function Er(wr){return wr.match(Sr)||[]}return N=Er,N}var q,ur;function Pr(){if(ur)return q;ur=1;var r=jr(),e=Nr(),o=ir(),t=qr();function n(u,s,c){return u=o(u),s=c?void 0:s,s===void 0?e(u)?t(u):r(u):u.match(s)||[]}return q=n,q}var P,sr;function $r(){if(sr)return P;sr=1;var r=Ir(),e=Mr(),o=Pr(),t="['’]",n=RegExp(t,"g");function u(s){return function(c){return r(o(e(c).replace(n,"")),s,"")}}return P=u,P}var $,ar;function Dr(){if(ar)return $;ar=1;var r=$r(),e=r(function(o,t,n){return o+(n?"-":"")+t.toLowerCase()});return $=e,$}var Hr=Dr();const Vr=Br(Hr),Jr=(r,e="--st")=>{const o={};return Object.entries(r).forEach(([t,n])=>{const u=Vr(t),s=`${e}-${u}`;if(typeof n=="boolean"){o[s]=n?"1":"0";return}o[s]=String(n)}),o},Gr=r=>({primaryColor:r.colors.primary,backgroundColor:r.colors.bgColor,secondaryBackgroundColor:r.colors.secondaryBg,textColor:r.colors.bodyText,linkColor:r.colors.link,linkUnderline:r.linkUnderline,headingFont:r.genericFonts.headingFont,codeFont:r.genericFonts.codeFont,baseRadius:r.radii.default,buttonRadius:r.radii.button,baseFontSize:typeof r.fontSizes.baseFontSize=="number"?`${r.fontSizes.baseFontSize}px`:String(r.fontSizes.baseFontSize),baseFontWeight:r.fontWeights.normal,codeFontWeight:r.fontWeights.code,codeFontSize:r.fontSizes.codeFontSize,headingFontSizes:[r.fontSizes.h1FontSize,r.fontSizes.h2FontSize,r.fontSizes.h3FontSize,r.fontSizes.h4FontSize,r.fontSizes.h5FontSize,r.fontSizes.h6FontSize],headingFontWeights:[r.fontWeights.h1FontWeight,r.fontWeights.h2FontWeight,r.fontWeights.h3FontWeight,r.fontWeights.h4FontWeight,r.fontWeights.h5FontWeight,r.fontWeights.h6FontWeight],borderColor:r.colors.borderColor,dataframeBorderColor:r.colors.dataframeBorderColor,dataframeHeaderBackgroundColor:r.colors.dataframeHeaderBackgroundColor,codeBackgroundColor:r.colors.codeBackgroundColor,font:r.genericFonts.bodyFont,chartCategoricalColors:r.colors.chartCategoricalColors,chartSequentialColors:r.colors.chartSequentialColors,headingColor:r.colors.headingColor,borderColorLight:r.colors.borderColorLight,codeTextColor:r.colors.codeTextColor,widgetBorderColor:r.colors.widgetBorderColor,redColor:r.colors.redColor,orangeColor:r.colors.orangeColor,yellowColor:r.colors.yellowColor,blueColor:r.colors.blueColor,greenColor:r.colors.greenColor,violetColor:r.colors.violetColor,grayColor:r.colors.grayColor,redBackgroundColor:r.colors.redBackgroundColor,orangeBackgroundColor:r.colors.orangeBackgroundColor,yellowBackgroundColor:r.colors.yellowBackgroundColor,blueBackgroundColor:r.colors.blueBackgroundColor,greenBackgroundColor:r.colors.greenBackgroundColor,violetBackgroundColor:r.colors.violetBackgroundColor,grayBackgroundColor:r.colors.grayBackgroundColor,redTextColor:r.colors.redTextColor,orangeTextColor:r.colors.orangeTextColor,yellowTextColor:r.colors.yellowTextColor,blueTextColor:r.colors.blueTextColor,greenTextColor:r.colors.greenTextColor,violetTextColor:r.colors.violetTextColor,grayTextColor:r.colors.grayTextColor}),Zr=a.memo(({element:r,children:e,widgetMgr:o,fragmentId:t})=>{const{arrowData:n,bytes:u,componentName:s,cssContent:c,cssSourcePath:f,data:l,htmlContent:d,id:i,jsContent:R,json:b,jsSourcePath:p,mixed:C}=r,g=a.useMemo(()=>({id:r.id,formId:r.formId}),[r.id,r.formId]),y=a.useCallback(()=>{const x=o.getJsonValue(g);if(!x)return{};try{return JSON.parse(x)}catch(F){const k=Tr(F);return T.warn("Failed to parse widget JSON value; returning empty object.",{widgetId:g.id,formId:g.formId,error:k.message}),{}}},[g,o]),w=a.useMemo(()=>Ar({arrowBlobs:C?.arrowBlobs||void 0,arrowData:n?.data||void 0,bytes:u,data:l,json:b,mixedJson:C?.json||void 0}),[l,b,n?.data,u,C?.json,C?.arrowBlobs]),S=_r(),m=a.useMemo(()=>Gr(S),[S]),E=a.useMemo(()=>({componentName:s,cssContent:c?.trim(),cssSourcePath:f||void 0,data:w,fragmentId:t,getWidgetValue:y,htmlContent:d?.trim(),id:i,formId:r.formId||void 0,jsContent:R||void 0,jsSourcePath:p||void 0,theme:m,widgetMgr:o}),[s,c,f,t,y,d,i,r.formId,R,p,w,m,o]);return h(_.Provider,{value:E,children:e})}),Cr=(r,e)=>{if(r instanceof Error)return r;const o=e?`${e}: ${String(r)}`:String(r);return new Error(o)},U=(r,e,o)=>{const t=Cr(r,o);T.error(`BidiComponent Error: ${t.message}`,r),e(t)},Kr=(r,e)=>{try{const t=document.createRange().createContextualFragment(r);e.appendChild(t)}catch(o){T.warn("createContextualFragment failed, falling back to innerHTML",o),e.innerHTML=r}},gr=({containerRef:r,setError:e,skip:o=!1})=>{const t=a.useRef(null),{htmlContent:n,cssContent:u,cssSourcePath:s,componentName:c}=L(_),{componentRegistry:{getBidiComponentURL:f}}=a.useContext(dr),l=a.useMemo(()=>{if(s)return f(c,s)},[c,s,f]);return a.useEffect(()=>{if(o)return;const d=r.current;if(d)try{if(t.current&&t.current.parentNode===d&&d.removeChild(t.current),t.current=document.createElement("div"),n){const i=document.createElement("div");Kr(n,i),t.current.appendChild(i)}if(u){const i=document.createElement("style");i.textContent=u,t.current.appendChild(i)}else if(l){const i=document.createElement("link");i.href=l,i.rel="stylesheet",i.onerror=()=>{U(new Error(`Failed to load CSS from ${l}`),e)},t.current.appendChild(i)}d.appendChild(t.current)}catch(i){U(i,e,"Failed to process HTML/CSS content")}},[n,u,r,l,e,o]),t};class Yr{constructor(){this.hashSeed=2166136261,this.hashPrime=16777619,this.cache=new Map}computeHash(e){let o=this.hashSeed;for(let t=0;t<e.length;t++)o^=e.charCodeAt(t),o=Math.imul(o>>>0,this.hashPrime)>>>0;return(o>>>0).toString(16)}getOrCreateUrlForJs(e,o){const t=this.computeHash(e),n=this.cache.get(t);if(n)return{url:n,hash:t};const u=`${e}
2
+ //# sourceURL=${o}-${t}.js`,s=new Blob([u],{type:"text/javascript"}),c=URL.createObjectURL(s);return this.cache.set(t,c),{url:c,hash:t}}}const Xr=new Yr,Qr="events";function re(r){if(r.includes(Y))throw new Error("Base component id must not contain the delimiter sequence");return`${Ur}_${r}${Y}${Qr}`}const cr=async({componentId:r,componentIdForWidgetMgr:e,componentName:o,data:t,formId:n,fragmentId:u,getWidgetValue:s,moduleUrl:c,parentElement:f,widgetMgr:l})=>{const d=await import(c);if(!d)throw new Error("JS module does not exist.");if(!d.default||typeof d.default!="function")throw new Error("JS module does not have a default export function.");const i=(b,p)=>{let C={};try{C={...s(),[b]:p}}catch(g){T.error(`Failed to get existing value for ${b}`,g),C={[b]:p}}l.setJsonValue({id:e,formId:n},C,{fromUi:!0},u)},R=(b,p)=>{if(n){T.warn("BidiComponent: setTriggerValue ignored inside st.form. Triggers are not allowed in forms; use setStateValue and form submit instead.");return}const C=re(e);l.setTriggerValue({id:C,formId:n},{fromUi:!0},u,{event:b,value:p})};return d.default({name:o,data:t,key:r,parentElement:f,setStateValue:i,setTriggerValue:R})},xr=({containerRef:r,setError:e,skip:o=!1})=>{const n=`st-bidi-component-${a.useMemo(()=>Wr(),[])}`,{componentName:u,data:s,formId:c,fragmentId:f,getWidgetValue:l,id:d,jsContent:i,jsSourcePath:R,theme:b,widgetMgr:p}=L(_),{componentRegistry:{getBidiComponentURL:C}}=a.useContext(dr),g=a.useMemo(()=>{if(R)return C(u,R)},[u,R,C]),y=a.useRef(),w=a.useRef(),S=a.useRef(!1);a.useEffect(()=>{const{current:m}=r;if(o||!i&&!g||!m)return;(async()=>{try{if(i){const{url:x}=Xr.getOrCreateUrlForJs(i,`st-bidi-${u}`);y.current=await cr({componentId:n,componentIdForWidgetMgr:d,componentName:u,data:s,formId:c,fragmentId:f,getWidgetValue:l,moduleUrl:x,parentElement:m,widgetMgr:p})}else if(g){const x=g;try{await new Promise((F,k)=>{const v=document.createElement("script");v.type="module",v.src=x,v.async=!0,v.onload=()=>F(),v.onerror=()=>k(new Error(`Failed to load script from ${g}`)),document.head.appendChild(v),w.current=v}),y.current=await cr({componentId:n,componentIdForWidgetMgr:d,componentName:u,data:s,formId:c,fragmentId:f,getWidgetValue:l,moduleUrl:x,parentElement:m,widgetMgr:p})}catch(F){throw Cr(F,`Failed to load or execute script from ${g}`)}}}catch(x){S.current||U(x,e)}})()},[n,u,r,s,c,f,l,d,i,g,e,o,p,b]),a.useEffect(()=>()=>{S.current=!0;const m=y.current;m&&Promise.resolve(m).then(x=>{x?.()}).catch(x=>{T.error("Failed to run custom component cleanup",x)});const E=w.current;E?.parentNode&&E.parentNode.removeChild(E)},[])},ee=lr("div",{target:"e10xsstg0"})(({cssCustomProperties:r})=>({...r,display:"contents"})),D=lr("div",{target:"e10xsstg1"})({width:"100%",height:"100%"}),oe=a.memo(()=>{const r=a.useRef(null),e=a.useRef(null),[o,t]=a.useState(!1),[n,u]=a.useState(null),{id:s}=L(_);a.useEffect(()=>{if(r.current)try{if(r.current.shadowRoot){e.current=r.current.shadowRoot,t(!0);return}e.current=r.current.attachShadow({mode:"open"}),t(!0)}catch(f){U(f,u,"Failed to create shadow DOM")}},[s]);const c=!o||!!n;return gr({containerRef:e,setError:u,skip:c}),xr({containerRef:e,setError:u,skip:c}),n?h(fr,{name:"BidiComponent Error",message:n.message,stack:n.stack}):h(D,{ref:r,"data-testid":"stBidiComponentIsolated"})}),te=a.memo(()=>{const r=a.useRef(null),[e,o]=a.useState(null),t=!!e;return gr({containerRef:r,setError:o,skip:t}),xr({containerRef:r,setError:o,skip:t}),e?h(fr,{name:"BidiComponent Error",message:e.message,stack:e.stack}):h(D,{ref:r,"data-testid":"stBidiComponentRegular"})}),ne=({children:r})=>{const{theme:e}=L(_),o=a.useMemo(()=>Jr(e),[e]);return h(ee,{cssCustomProperties:o,children:r})},ue=({element:r,widgetMgr:e,fragmentId:o})=>{const{isolateStyles:t}=r;return h(Zr,{element:r,widgetMgr:e,fragmentId:o,children:h(D,{className:"stBidiComponent",children:h(ne,{children:t?h(oe,{}):h(te,{})})})})},ae=a.memo(ue);export{_ as BidiComponentContext,ae as default};
@@ -1,3 +1,3 @@
1
- import{bq as ce,bw as pe,bx as fe,by as ge,bz as ye,bA as me,ap as ve,ad as be,aC as he,bB as Se,aq as Oe,bC as Ce,b0 as K,bD as Ie,v as ae,bE as Pe,bF as $e,r as H,M as _e,m as J,u as Te,e as Ee,j as z,l as Re,R as we,T as De,P as xe,W as Ae,Z as We}from"./index.CD8HuT3N.js";import{u as Be}from"./useBasicWidgetState.DeK-QJpD.js";import{T as Me}from"./timepicker.Dbl5KFh6.js";import"./FormClearHelper.DHh1GFzm.js";import"./possibleConstructorReturn.DgiPnZ9N.js";import"./createSuper.B6W-Dh9S.js";var Ne=ce.Consumer;const Le=Object.freeze(Object.defineProperty({__proto__:null,ThemeConsumer:Ne,ThemeProvider:pe,createThemedStyled:fe,createThemedUseStyletron:ge,createThemedWithStyle:ye,expandBorderStyles:me,hexToRgb:ve,styled:be,useStyletron:he,withStyle:Se,withWrapper:Oe},Symbol.toStringTag,{value:"Module"}));var C={};const Y=Ce(Le);var w={},X;function Fe(){if(X)return w;X=1,Object.defineProperty(w,"__esModule",{value:!0}),w.STATE_CHANGE_TYPE=w.SIZE=w.ENHANCER_POSITION=w.CUSTOM_INPUT_TYPE=w.ADJOINED=void 0;var f={change:"change"};w.STATE_CHANGE_TYPE=f;var c={textarea:"textarea"};w.CUSTOM_INPUT_TYPE=c;var h={none:"none",left:"left",right:"right",both:"both"};w.ADJOINED=h;var m={mini:"mini",default:"default",compact:"compact",large:"large"};w.SIZE=m;var b={start:"start",end:"end"};return w.ENHANCER_POSITION=b,w}var q={},A={},k={},Q;function ze(){if(Q)return k;Q=1,Object.defineProperty(k,"__esModule",{value:!0}),k.default=c;function f(m){"@babel/helpers - typeof";return f=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(b){return typeof b}:function(b){return b&&typeof Symbol=="function"&&b.constructor===Symbol&&b!==Symbol.prototype?"symbol":typeof b},f(m)}function c(m){m=m||{};for(var b=arguments.length<=1?0:arguments.length-1,v,y,S=0;S<b;S++){v=(S+1<1||arguments.length<=S+1?void 0:arguments[S+1])||{};for(var g in v)f(v[g])!==void 0&&(y=v[g],h(y)?m[g]=c(m[g]||Array.isArray(y)&&[]||{},y):m[g]=y)}return m}function h(m){return Array.isArray(m)||{}.toString.call(m)=="[object Object]"}return k}var ee;function le(){if(ee)return A;ee=1,Object.defineProperty(A,"__esModule",{value:!0}),A.getOverride=E,A.getOverrideProps=_,A.getOverrides=L,A.mergeConfigurationOverrides=N,A.mergeOverride=x,A.mergeOverrides=M,A.toObjectOverride=D,A.useOverrides=F;var f=v(K()),c=Ie(),h=m(ze());function m(i){return i&&i.__esModule?i:{default:i}}function b(i){if(typeof WeakMap!="function")return null;var t=new WeakMap,u=new WeakMap;return(b=function(r){return r?u:t})(i)}function v(i,t){if(i&&i.__esModule)return i;if(i===null||P(i)!=="object"&&typeof i!="function")return{default:i};var u=b(t);if(u&&u.has(i))return u.get(i);var s={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in i)if(a!=="default"&&Object.prototype.hasOwnProperty.call(i,a)){var l=r?Object.getOwnPropertyDescriptor(i,a):null;l&&(l.get||l.set)?Object.defineProperty(s,a,l):s[a]=i[a]}return s.default=i,u&&u.set(i,s),s}function y(){return y=Object.assign?Object.assign.bind():function(i){for(var t=1;t<arguments.length;t++){var u=arguments[t];for(var s in u)Object.prototype.hasOwnProperty.call(u,s)&&(i[s]=u[s])}return i},y.apply(this,arguments)}function S(i,t){var u=Object.keys(i);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(i);t&&(s=s.filter(function(r){return Object.getOwnPropertyDescriptor(i,r).enumerable})),u.push.apply(u,s)}return u}function g(i){for(var t=1;t<arguments.length;t++){var u=arguments[t]!=null?arguments[t]:{};t%2?S(Object(u),!0).forEach(function(s){$(i,s,u[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(u)):S(Object(u)).forEach(function(s){Object.defineProperty(i,s,Object.getOwnPropertyDescriptor(u,s))})}return i}function $(i,t,u){return t in i?Object.defineProperty(i,t,{value:u,enumerable:!0,configurable:!0,writable:!0}):i[t]=u,i}function P(i){"@babel/helpers - typeof";return P=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},P(i)}function E(i){return(0,c.isValidElementType)(i)?i:i&&P(i)==="object"?i.component:i}function _(i){return i&&P(i)==="object"?P(i.props)==="object"?g(g({},i.props),{},{$style:i.style}):{$style:i.style}:{}}function D(i){return(0,c.isValidElementType)(i)?{component:i}:i||{}}function L(i,t){var u=E(i)||t;if(i&&P(i)==="object"&&typeof i.props=="function"){var s=f.forwardRef(function(a,l){var n=i.props(a),e=_(g(g({},i),{},{props:n}));return f.createElement(u,y({ref:l},e))});return s.displayName=u.displayName,[s,{}]}var r=_(i);return[u,r]}function M(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},u=Object.assign({},i,t),s=Object.keys(u);return s.reduce(function(r,a){return r[a]=x(D(i[a]),D(t[a])),r},{})}function x(i,t){var u=g(g({},i),t);return i.props&&t.props&&(u.props=N(i.props,t.props)),i.style&&t.style&&(u.style=N(i.style,t.style)),u}function N(i,t){return P(i)==="object"&&P(t)==="object"?(0,h.default)({},i,t):function(){return(0,h.default)({},typeof i=="function"?i.apply(void 0,arguments):i,typeof t=="function"?t.apply(void 0,arguments):t)}}function F(i){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return f.useMemo(function(){return Object.keys(i).reduce(function(u,s){return u[s]=L(t[s],i[s]),u},{})},[t])}return A}var j={},Z={},te;function Ze(){if(te)return Z;te=1,Object.defineProperty(Z,"__esModule",{value:!0}),Z.Svg=void 0,Z.getSvgStyles=c;var f=Y;function c(m){var b=m.$theme,v=m.$size,y=m.$color,S=b.sizing.scale600;v&&(b.sizing[v]?S=b.sizing[v]:typeof v=="number"?S="".concat(v,"px"):S=v);var g="currentColor";return y&&(b.colors[y]?g=b.colors[y]:g=y),{display:"inline-block",fill:g,color:g,height:S,width:S}}var h=(0,f.styled)("svg",c);return Z.Svg=h,h.displayName="Svg",h.displayName="Svg",Z}var V={},re;function qe(){if(re)return V;re=1,Object.defineProperty(V,"__esModule",{value:!0}),V.default=f;function f(c){var h={};for(var m in c)m[0]!=="$"&&(h[m]=c[m]);return h}return V}var ne;function je(){if(ne)return j;ne=1;function f(r){"@babel/helpers - typeof";return f=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(a){return typeof a}:function(a){return a&&typeof Symbol=="function"&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},f(r)}Object.defineProperty(j,"__esModule",{value:!0}),j.default=void 0;var c=g(K()),h=le(),m=Ze(),b=y(qe()),v=["children","title","size","color","overrides"];function y(r){return r&&r.__esModule?r:{default:r}}function S(r){if(typeof WeakMap!="function")return null;var a=new WeakMap,l=new WeakMap;return(S=function(e){return e?l:a})(r)}function g(r,a){if(r&&r.__esModule)return r;if(r===null||f(r)!=="object"&&typeof r!="function")return{default:r};var l=S(a);if(l&&l.has(r))return l.get(r);var n={},e=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in r)if(o!=="default"&&Object.prototype.hasOwnProperty.call(r,o)){var p=e?Object.getOwnPropertyDescriptor(r,o):null;p&&(p.get||p.set)?Object.defineProperty(n,o,p):n[o]=r[o]}return n.default=r,l&&l.set(r,n),n}function $(){return $=Object.assign?Object.assign.bind():function(r){for(var a=1;a<arguments.length;a++){var l=arguments[a];for(var n in l)Object.prototype.hasOwnProperty.call(l,n)&&(r[n]=l[n])}return r},$.apply(this,arguments)}function P(r,a){var l=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);a&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})),l.push.apply(l,n)}return l}function E(r){for(var a=1;a<arguments.length;a++){var l=arguments[a]!=null?arguments[a]:{};a%2?P(Object(l),!0).forEach(function(n){_(r,n,l[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(l)):P(Object(l)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(l,n))})}return r}function _(r,a,l){return a in r?Object.defineProperty(r,a,{value:l,enumerable:!0,configurable:!0,writable:!0}):r[a]=l,r}function D(r,a){return F(r)||N(r,a)||M(r,a)||L()}function L(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
2
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function M(r,a){if(r){if(typeof r=="string")return x(r,a);var l=Object.prototype.toString.call(r).slice(8,-1);if(l==="Object"&&r.constructor&&(l=r.constructor.name),l==="Map"||l==="Set")return Array.from(r);if(l==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(l))return x(r,a)}}function x(r,a){(a==null||a>r.length)&&(a=r.length);for(var l=0,n=new Array(a);l<a;l++)n[l]=r[l];return n}function N(r,a){var l=r==null?null:typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(l!=null){var n=[],e=!0,o=!1,p,d;try{for(l=l.call(r);!(e=(p=l.next()).done)&&(n.push(p.value),!(a&&n.length===a));e=!0);}catch(O){o=!0,d=O}finally{try{!e&&l.return!=null&&l.return()}finally{if(o)throw d}}return n}}function F(r){if(Array.isArray(r))return r}function i(r,a){if(r==null)return{};var l=t(r,a),n,e;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(r);for(e=0;e<o.length;e++)n=o[e],!(a.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(r,n)&&(l[n]=r[n])}return l}function t(r,a){if(r==null)return{};var l={},n=Object.keys(r),e,o;for(o=0;o<n.length;o++)e=n[o],!(a.indexOf(e)>=0)&&(l[e]=r[e]);return l}var u=function(a,l){var n=a.children,e=a.title,o=a.size,p=a.color,d=a.overrides,O=d===void 0?{}:d,I=i(a,v),R=(0,h.getOverrides)(O.Svg,m.Svg),W=D(R,2),T=W[0],B=W[1],U=T.__STYLETRON__?E(E({title:e,$color:p,$size:o},I),B):E(E({title:e,color:p,size:o},(0,b.default)(I)),(0,b.default)(B));return c.createElement(T,$({"data-baseweb":"icon",ref:l},U),e?c.createElement("title",null,e):null,n)},s=c.forwardRef(u);return j.default=s,j}var oe;function ke(){if(oe)return q;oe=1;function f(t){"@babel/helpers - typeof";return f=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},f(t)}Object.defineProperty(q,"__esModule",{value:!0}),q.default=void 0;var c=g(K()),h=Y,m=le(),b=y(je()),v=["title","size","color","overrides"];function y(t){return t&&t.__esModule?t:{default:t}}function S(t){if(typeof WeakMap!="function")return null;var u=new WeakMap,s=new WeakMap;return(S=function(a){return a?s:u})(t)}function g(t,u){if(t&&t.__esModule)return t;if(t===null||f(t)!=="object"&&typeof t!="function")return{default:t};var s=S(u);if(s&&s.has(t))return s.get(t);var r={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var l in t)if(l!=="default"&&Object.prototype.hasOwnProperty.call(t,l)){var n=a?Object.getOwnPropertyDescriptor(t,l):null;n&&(n.get||n.set)?Object.defineProperty(r,l,n):r[l]=t[l]}return r.default=t,s&&s.set(t,r),r}function $(){return $=Object.assign?Object.assign.bind():function(t){for(var u=1;u<arguments.length;u++){var s=arguments[u];for(var r in s)Object.prototype.hasOwnProperty.call(s,r)&&(t[r]=s[r])}return t},$.apply(this,arguments)}function P(t,u){if(t==null)return{};var s=E(t,u),r,a;if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(t);for(a=0;a<l.length;a++)r=l[a],!(u.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(s[r]=t[r])}return s}function E(t,u){if(t==null)return{};var s={},r=Object.keys(t),a,l;for(l=0;l<r.length;l++)a=r[l],!(u.indexOf(a)>=0)&&(s[a]=t[a]);return s}function _(t,u){return N(t)||x(t,u)||L(t,u)||D()}function D(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
3
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function L(t,u){if(t){if(typeof t=="string")return M(t,u);var s=Object.prototype.toString.call(t).slice(8,-1);if(s==="Object"&&t.constructor&&(s=t.constructor.name),s==="Map"||s==="Set")return Array.from(t);if(s==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(s))return M(t,u)}}function M(t,u){(u==null||u>t.length)&&(u=t.length);for(var s=0,r=new Array(u);s<u;s++)r[s]=t[s];return r}function x(t,u){var s=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(s!=null){var r=[],a=!0,l=!1,n,e;try{for(s=s.call(t);!(a=(n=s.next()).done)&&(r.push(n.value),!(u&&r.length===u));a=!0);}catch(o){l=!0,e=o}finally{try{!a&&s.return!=null&&s.return()}finally{if(l)throw e}}return r}}function N(t){if(Array.isArray(t))return t}function F(t,u){var s=(0,h.useStyletron)(),r=_(s,2),a=r[1],l=t.title,n=l===void 0?"Delete Alt":l,e=t.size,o=t.color,p=t.overrides,d=p===void 0?{}:p,O=P(t,v),I=(0,m.mergeOverride)({component:a.icons&&a.icons.DeleteAlt?a.icons.DeleteAlt:null},d&&d.Svg?(0,m.toObjectOverride)(d.Svg):{});return c.createElement(b.default,$({viewBox:"0 0 24 24",ref:u,title:n,size:e,color:o,overrides:{Svg:I}},O),c.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 20C16.4183 20 20 16.4183 20 12C20 7.58173 16.4183 4 12 4C7.58173 4 4 7.58173 4 12C4 16.4183 7.58173 20 12 20ZM10.0303 8.96967C9.73743 8.67679 9.26257 8.67679 8.96967 8.96967C8.67676 9.26257 8.67676 9.73743 8.96967 10.0303L10.9393 12L8.96967 13.9697C8.67676 14.2626 8.67676 14.7374 8.96967 15.0303C9.26257 15.3232 9.73743 15.3232 10.0303 15.0303L12 13.0607L13.9697 15.0303C14.2626 15.3232 14.7374 15.3232 15.0303 15.0303C15.3232 14.7374 15.3232 14.2626 15.0303 13.9697L13.0607 12L15.0303 10.0303C15.3232 9.73743 15.3232 9.26257 15.0303 8.96967C14.7374 8.67679 14.2626 8.67679 13.9697 8.96967L12 10.9393L10.0303 8.96967Z"}))}var i=c.forwardRef(F);return q.default=i,q}var ie;function Ve(){if(ie)return C;ie=1,Object.defineProperty(C,"__esModule",{value:!0}),C.getRootStyles=C.getInputStyles=C.getInputContainerStyles=C.StyledMaskToggleButton=C.StyledClearIconContainer=C.StyledClearIcon=C.Root=C.InputEnhancer=C.InputContainer=C.Input=void 0;var f=Y,c=Fe(),h=m(ke());function m(n){return n&&n.__esModule?n:{default:n}}function b(n,e){var o=Object.keys(n);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(n);e&&(p=p.filter(function(d){return Object.getOwnPropertyDescriptor(n,d).enumerable})),o.push.apply(o,p)}return o}function v(n){for(var e=1;e<arguments.length;e++){var o=arguments[e]!=null?arguments[e]:{};e%2?b(Object(o),!0).forEach(function(p){y(n,p,o[p])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):b(Object(o)).forEach(function(p){Object.defineProperty(n,p,Object.getOwnPropertyDescriptor(o,p))})}return n}function y(n,e,o){return e in n?Object.defineProperty(n,e,{value:o,enumerable:!0,configurable:!0,writable:!0}):n[e]=o,n}var S=(0,f.styled)("button",function(n){var e,o=n.$theme,p=n.$size,d=n.$isFocusVisible,O=(e={},y(e,c.SIZE.mini,o.sizing.scale400),y(e,c.SIZE.compact,o.sizing.scale400),y(e,c.SIZE.default,o.sizing.scale300),y(e,c.SIZE.large,o.sizing.scale200),e)[p];return{display:"flex",alignItems:"center",borderTopStyle:"none",borderBottomStyle:"none",borderLeftStyle:"none",borderRightStyle:"none",background:"none",paddingLeft:O,paddingRight:O,outline:d?"solid 3px ".concat(o.colors.accent):"none",color:o.colors.contentPrimary}});C.StyledMaskToggleButton=S,S.displayName="StyledMaskToggleButton",S.displayName="StyledMaskToggleButton";var g=(0,f.styled)("div",function(n){var e,o=n.$alignTop,p=o===void 0?!1:o,d=n.$size,O=n.$theme,I=(e={},y(e,c.SIZE.mini,O.sizing.scale200),y(e,c.SIZE.compact,O.sizing.scale200),y(e,c.SIZE.default,O.sizing.scale100),y(e,c.SIZE.large,O.sizing.scale0),e)[d];return{display:"flex",alignItems:p?"flex-start":"center",paddingLeft:I,paddingRight:I,paddingTop:p?O.sizing.scale500:"0px",color:O.colors.contentPrimary}});C.StyledClearIconContainer=g,g.displayName="StyledClearIconContainer",g.displayName="StyledClearIconContainer";var $=(0,f.styled)(h.default,function(n){var e=n.$theme,o=n.$isFocusVisible;return{cursor:"pointer",outline:o?"solid 3px ".concat(e.colors.accent):"none"}});C.StyledClearIcon=$,$.displayName="StyledClearIcon",$.displayName="StyledClearIcon";function P(n,e){var o;return(o={},y(o,c.SIZE.mini,{paddingTop:e.scale100,paddingBottom:e.scale100,paddingLeft:e.scale550,paddingRight:e.scale550}),y(o,c.SIZE.compact,{paddingTop:e.scale200,paddingBottom:e.scale200,paddingLeft:e.scale550,paddingRight:e.scale550}),y(o,c.SIZE.default,{paddingTop:e.scale400,paddingBottom:e.scale400,paddingLeft:e.scale550,paddingRight:e.scale550}),y(o,c.SIZE.large,{paddingTop:e.scale550,paddingBottom:e.scale550,paddingLeft:e.scale550,paddingRight:e.scale550}),o)[n]}function E(n,e,o,p,d){var O=n===c.ADJOINED.both||n===c.ADJOINED.left&&p!=="rtl"||n===c.ADJOINED.right&&p==="rtl"||d&&p==="rtl",I=n===c.ADJOINED.both||n===c.ADJOINED.right&&p!=="rtl"||n===c.ADJOINED.left&&p==="rtl"||d&&p!=="rtl";return{paddingLeft:O?o.scale550:"0px",paddingRight:I?o.scale550:"0px"}}function _(n,e){var o;return(o={},y(o,c.SIZE.mini,e.font100),y(o,c.SIZE.compact,e.font200),y(o,c.SIZE.default,e.font300),y(o,c.SIZE.large,e.font400),o)[n]}function D(n,e,o){var p=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,d=arguments.length>4?arguments[4]:void 0;return n?{borderLeftColor:d.inputFillDisabled,borderRightColor:d.inputFillDisabled,borderTopColor:d.inputFillDisabled,borderBottomColor:d.inputFillDisabled,backgroundColor:d.inputFillDisabled}:e?{borderLeftColor:d.borderSelected,borderRightColor:d.borderSelected,borderTopColor:d.borderSelected,borderBottomColor:d.borderSelected,backgroundColor:d.inputFillActive}:o?{borderLeftColor:d.inputBorderError,borderRightColor:d.inputBorderError,borderTopColor:d.inputBorderError,borderBottomColor:d.inputBorderError,backgroundColor:d.inputFillError}:p?{borderLeftColor:d.inputBorderPositive,borderRightColor:d.inputBorderPositive,borderTopColor:d.inputBorderPositive,borderBottomColor:d.inputBorderPositive,backgroundColor:d.inputFillPositive}:{borderLeftColor:d.inputBorder,borderRightColor:d.inputBorder,borderTopColor:d.inputBorder,borderBottomColor:d.inputBorder,backgroundColor:d.inputFill}}function L(n,e){var o=e.inputBorderRadius;return n===c.SIZE.mini&&(o=e.inputBorderRadiusMini),{borderTopLeftRadius:o,borderBottomLeftRadius:o,borderTopRightRadius:o,borderBottomRightRadius:o}}var M=function(e){var o=e.$isFocused,p=e.$adjoined,d=e.$error,O=e.$disabled,I=e.$positive,R=e.$size,W=e.$theme,T=e.$theme,B=T.borders,U=T.colors,ue=T.sizing,se=T.typography,G=T.animation,de=e.$hasIconTrailing;return v(v(v(v({boxSizing:"border-box",display:"flex",overflow:"hidden",width:"100%",borderLeftWidth:"2px",borderRightWidth:"2px",borderTopWidth:"2px",borderBottomWidth:"2px",borderLeftStyle:"solid",borderRightStyle:"solid",borderTopStyle:"solid",borderBottomStyle:"solid",transitionProperty:"border",transitionDuration:G.timing200,transitionTimingFunction:G.easeOutCurve},L(R,B)),_(R,se)),D(O,o,d,I,U)),E(p,R,ue,W.direction,de))};C.getRootStyles=M;var x=(0,f.styled)("div",M);C.Root=x,x.displayName="Root",x.displayName="Root";function N(n,e){var o;return(o={},y(o,c.SIZE.mini,{paddingRight:e.scale400,paddingLeft:e.scale400}),y(o,c.SIZE.compact,{paddingRight:e.scale400,paddingLeft:e.scale400}),y(o,c.SIZE.default,{paddingRight:e.scale300,paddingLeft:e.scale300}),y(o,c.SIZE.large,{paddingRight:e.scale200,paddingLeft:e.scale200}),o)[n]}function F(n,e,o,p,d){return n?{color:d.inputEnhancerTextDisabled,backgroundColor:d.inputFillDisabled}:e?{color:d.contentPrimary,backgroundColor:d.inputFillActive}:o?{color:d.contentPrimary,backgroundColor:d.inputFillError}:p?{color:d.contentPrimary,backgroundColor:d.inputFillPositive}:{color:d.contentPrimary,backgroundColor:d.inputFill}}var i=(0,f.styled)("div",function(n){var e=n.$size,o=n.$disabled,p=n.$isFocused,d=n.$error,O=n.$positive,I=n.$theme,R=I.colors,W=I.sizing,T=I.typography,B=I.animation;return v(v(v({display:"flex",alignItems:"center",justifyContent:"center",transitionProperty:"color, background-color",transitionDuration:B.timing200,transitionTimingFunction:B.easeOutCurve},_(e,T)),N(e,W)),F(o,p,d,O,R))});C.InputEnhancer=i,i.displayName="InputEnhancer",i.displayName="InputEnhancer";function t(n,e,o,p,d){return n?{color:d.inputTextDisabled,backgroundColor:d.inputFillDisabled}:e?{color:d.contentPrimary,backgroundColor:d.inputFillActive}:o?{color:d.contentPrimary,backgroundColor:d.inputFillError}:p?{color:d.contentPrimary,backgroundColor:d.inputFillPositive}:{color:d.contentPrimary,backgroundColor:d.inputFill}}var u=function(e){var o=e.$isFocused,p=e.$error,d=e.$disabled,O=e.$positive,I=e.$size,R=e.$theme,W=R.colors,T=R.typography,B=R.animation;return v(v({display:"flex",width:"100%",transitionProperty:"background-color",transitionDuration:B.timing200,transitionTimingFunction:B.easeOutCurve},_(I,T)),t(d,o,p,O,W))};C.getInputContainerStyles=u;var s=(0,f.styled)("div",u);C.InputContainer=s,s.displayName="InputContainer",s.displayName="InputContainer";function r(n,e,o,p){return n?{color:p.inputTextDisabled,"-webkit-text-fill-color":p.inputTextDisabled,caretColor:p.contentPrimary,"::placeholder":{color:p.inputPlaceholderDisabled}}:{color:p.contentPrimary,caretColor:p.contentPrimary,"::placeholder":{color:p.inputPlaceholder}}}var a=function(e){var o=e.$disabled,p=e.$isFocused,d=e.$error,O=e.$size,I=e.$theme,R=I.colors,W=I.sizing,T=I.typography;return v(v(v({boxSizing:"border-box",backgroundColor:"transparent",borderLeftWidth:0,borderRightWidth:0,borderTopWidth:0,borderBottomWidth:0,borderLeftStyle:"none",borderRightStyle:"none",borderTopStyle:"none",borderBottomStyle:"none",outline:"none",width:"100%",minWidth:0,maxWidth:"100%",cursor:o?"not-allowed":"text",margin:"0",paddingTop:"0",paddingBottom:"0",paddingLeft:"0",paddingRight:"0"},_(O,T)),P(O,W)),r(o,p,d,R))};C.getInputStyles=a;var l=(0,f.styled)("input",a);return C.Input=l,l.displayName="Input",l.displayName="Input",C}var He=Ve();const Ue=ae("div",{target:"e1hlhgmz0"})({position:"absolute",top:"50%",right:"2.05em"}),Je=ae(Pe,{shouldForwardProp:$e,target:"e1hlhgmz1"})(({theme:f,$isHighlighted:c})=>({paddingRight:f.spacing.lg,paddingLeft:f.spacing.lg,paddingTop:f.spacing.sm,paddingBottom:f.spacing.sm,background:c?f.colors.darkenedBgMix15:void 0,"&:hover, &:active, &:focus-visible":{background:f.colors.darkenedBgMix15}}));function Ke({disabled:f,element:c,widgetMgr:h,fragmentId:m}){const[b,v]=Be({getStateFromWidgetMgr:Ye,getDefaultStateFromProto:Ge,getCurrStateFromProto:Xe,updateWidgetMgrState:Qe,element:c,widgetMgr:h,fragmentId:m}),y=H.useContext(_e),S=J(c.default)&&!f,g=Te(),$={Select:{props:{disabled:f,overrides:{ControlContainer:{style:{height:g.sizes.minElementHeight,borderLeftWidth:g.sizes.borderWidth,borderRightWidth:g.sizes.borderWidth,borderTopWidth:g.sizes.borderWidth,borderBottomWidth:g.sizes.borderWidth}},IconsContainer:{style:()=>({paddingRight:g.spacing.sm})},ValueContainer:{style:()=>({lineHeight:g.lineHeights.inputWidget,paddingRight:g.spacing.sm,paddingLeft:g.spacing.md,paddingBottom:g.spacing.sm,paddingTop:g.spacing.sm})},SingleValue:{style:{fontWeight:g.fontWeights.normal},props:{"data-testid":"stTimeInputTimeDisplay"}},Dropdown:{style:()=>({paddingTop:g.spacing.none,paddingBottom:g.spacing.none,boxShadow:"none",maxHeight:g.sizes.maxDropdownHeight})},DropdownListItem:{component:Je},Popover:{props:{ignoreBoundary:y,overrides:{Body:{style:()=>({marginTop:g.spacing.px})}}}},Placeholder:{style:()=>({color:g.colors.fadedText60})},SelectArrow:{component:We,props:{overrides:{Svg:{style:()=>({width:g.iconSizes.xl,height:g.iconSizes.xl})}}}}}}}},P=H.useCallback(_=>{const D=_===null?null:et(_);v({value:D,fromUi:!0})},[v]),E=H.useCallback(()=>{P(null)},[P]);return Ee("div",{className:"stTimeInput","data-testid":"stTimeInput",children:[z(Ae,{label:c.label,disabled:f,labelVisibility:Re(c.labelVisibility?.value),children:c.help&&z(we,{children:z(De,{content:c.help,placement:xe.TOP_RIGHT})})}),z(Me,{format:"24",step:c.step?Number(c.step):900,value:J(b)?void 0:tt(b),onChange:P,overrides:$,nullable:S,creatable:!0,"aria-label":c.label}),S&&!J(b)&&z(Ue,{onClick:E,"data-testid":"stTimeInputClearButton",children:z(He.StyledClearIcon,{overrides:{Svg:{style:{color:g.colors.darkGray,padding:g.spacing.threeXS,height:g.sizes.clearIconSize,width:g.sizes.clearIconSize,":hover":{fill:g.colors.bodyText}}}},$isFocusVisible:!1})})]})}function Ye(f,c){return f.getStringValue(c)??null}function Ge(f){return f.default??null}function Xe(f){return f.value??null}function Qe(f,c,h,m){c.setStringValue(f,h.value,{fromUi:h.fromUi},m)}function et(f){const c=f.getHours().toString().padStart(2,"0"),h=f.getMinutes().toString().padStart(2,"0");return`${c}:${h}`}function tt(f){if(f===null)return null;const[c,h]=f.split(":").map(Number),m=new Date;return m.setHours(c),m.setMinutes(h),m}const ut=H.memo(Ke);export{ut as default};
1
+ import{bp as ce,bv as pe,bw as fe,bx as ge,by as ye,bz as me,am as ve,aa as be,az as he,bA as Se,an as Oe,bB as Ce,a_ as K,bC as Ie,s as ae,bD as Pe,bE as $e,r as H,J as _e,k as J,u as Te,e as Ee,j as z,l as Re,O as we,T as De,P as xe,W as Ae,X as We}from"./index.CAj-7vWz.js";import{u as Be}from"./useBasicWidgetState.D6sOH6oI.js";import{T as Ne}from"./timepicker.DAhu-vcF.js";import"./FormClearHelper.BB1Km6eP.js";import"./possibleConstructorReturn.exeeJQEP.js";import"./createSuper.CuQIogbW.js";var Me=ce.Consumer;const Le=Object.freeze(Object.defineProperty({__proto__:null,ThemeConsumer:Me,ThemeProvider:pe,createThemedStyled:fe,createThemedUseStyletron:ge,createThemedWithStyle:ye,expandBorderStyles:me,hexToRgb:ve,styled:be,useStyletron:he,withStyle:Se,withWrapper:Oe},Symbol.toStringTag,{value:"Module"}));var C={};const Y=Ce(Le);var w={},X;function Fe(){if(X)return w;X=1,Object.defineProperty(w,"__esModule",{value:!0}),w.STATE_CHANGE_TYPE=w.SIZE=w.ENHANCER_POSITION=w.CUSTOM_INPUT_TYPE=w.ADJOINED=void 0;var f={change:"change"};w.STATE_CHANGE_TYPE=f;var c={textarea:"textarea"};w.CUSTOM_INPUT_TYPE=c;var h={none:"none",left:"left",right:"right",both:"both"};w.ADJOINED=h;var m={mini:"mini",default:"default",compact:"compact",large:"large"};w.SIZE=m;var b={start:"start",end:"end"};return w.ENHANCER_POSITION=b,w}var q={},A={},k={},Q;function ze(){if(Q)return k;Q=1,Object.defineProperty(k,"__esModule",{value:!0}),k.default=c;function f(m){"@babel/helpers - typeof";return f=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(b){return typeof b}:function(b){return b&&typeof Symbol=="function"&&b.constructor===Symbol&&b!==Symbol.prototype?"symbol":typeof b},f(m)}function c(m){m=m||{};for(var b=arguments.length<=1?0:arguments.length-1,v,y,S=0;S<b;S++){v=(S+1<1||arguments.length<=S+1?void 0:arguments[S+1])||{};for(var g in v)f(v[g])!==void 0&&(y=v[g],h(y)?m[g]=c(m[g]||Array.isArray(y)&&[]||{},y):m[g]=y)}return m}function h(m){return Array.isArray(m)||{}.toString.call(m)=="[object Object]"}return k}var ee;function le(){if(ee)return A;ee=1,Object.defineProperty(A,"__esModule",{value:!0}),A.getOverride=E,A.getOverrideProps=_,A.getOverrides=L,A.mergeConfigurationOverrides=M,A.mergeOverride=x,A.mergeOverrides=N,A.toObjectOverride=D,A.useOverrides=F;var f=v(K()),c=Ie(),h=m(ze());function m(i){return i&&i.__esModule?i:{default:i}}function b(i){if(typeof WeakMap!="function")return null;var t=new WeakMap,u=new WeakMap;return(b=function(r){return r?u:t})(i)}function v(i,t){if(i&&i.__esModule)return i;if(i===null||P(i)!=="object"&&typeof i!="function")return{default:i};var u=b(t);if(u&&u.has(i))return u.get(i);var s={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in i)if(a!=="default"&&Object.prototype.hasOwnProperty.call(i,a)){var l=r?Object.getOwnPropertyDescriptor(i,a):null;l&&(l.get||l.set)?Object.defineProperty(s,a,l):s[a]=i[a]}return s.default=i,u&&u.set(i,s),s}function y(){return y=Object.assign?Object.assign.bind():function(i){for(var t=1;t<arguments.length;t++){var u=arguments[t];for(var s in u)Object.prototype.hasOwnProperty.call(u,s)&&(i[s]=u[s])}return i},y.apply(this,arguments)}function S(i,t){var u=Object.keys(i);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(i);t&&(s=s.filter(function(r){return Object.getOwnPropertyDescriptor(i,r).enumerable})),u.push.apply(u,s)}return u}function g(i){for(var t=1;t<arguments.length;t++){var u=arguments[t]!=null?arguments[t]:{};t%2?S(Object(u),!0).forEach(function(s){$(i,s,u[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(u)):S(Object(u)).forEach(function(s){Object.defineProperty(i,s,Object.getOwnPropertyDescriptor(u,s))})}return i}function $(i,t,u){return t in i?Object.defineProperty(i,t,{value:u,enumerable:!0,configurable:!0,writable:!0}):i[t]=u,i}function P(i){"@babel/helpers - typeof";return P=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},P(i)}function E(i){return(0,c.isValidElementType)(i)?i:i&&P(i)==="object"?i.component:i}function _(i){return i&&P(i)==="object"?P(i.props)==="object"?g(g({},i.props),{},{$style:i.style}):{$style:i.style}:{}}function D(i){return(0,c.isValidElementType)(i)?{component:i}:i||{}}function L(i,t){var u=E(i)||t;if(i&&P(i)==="object"&&typeof i.props=="function"){var s=f.forwardRef(function(a,l){var n=i.props(a),e=_(g(g({},i),{},{props:n}));return f.createElement(u,y({ref:l},e))});return s.displayName=u.displayName,[s,{}]}var r=_(i);return[u,r]}function N(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},u=Object.assign({},i,t),s=Object.keys(u);return s.reduce(function(r,a){return r[a]=x(D(i[a]),D(t[a])),r},{})}function x(i,t){var u=g(g({},i),t);return i.props&&t.props&&(u.props=M(i.props,t.props)),i.style&&t.style&&(u.style=M(i.style,t.style)),u}function M(i,t){return P(i)==="object"&&P(t)==="object"?(0,h.default)({},i,t):function(){return(0,h.default)({},typeof i=="function"?i.apply(void 0,arguments):i,typeof t=="function"?t.apply(void 0,arguments):t)}}function F(i){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return f.useMemo(function(){return Object.keys(i).reduce(function(u,s){return u[s]=L(t[s],i[s]),u},{})},[t])}return A}var j={},Z={},te;function Ze(){if(te)return Z;te=1,Object.defineProperty(Z,"__esModule",{value:!0}),Z.Svg=void 0,Z.getSvgStyles=c;var f=Y;function c(m){var b=m.$theme,v=m.$size,y=m.$color,S=b.sizing.scale600;v&&(b.sizing[v]?S=b.sizing[v]:typeof v=="number"?S="".concat(v,"px"):S=v);var g="currentColor";return y&&(b.colors[y]?g=b.colors[y]:g=y),{display:"inline-block",fill:g,color:g,height:S,width:S}}var h=(0,f.styled)("svg",c);return Z.Svg=h,h.displayName="Svg",h.displayName="Svg",Z}var V={},re;function qe(){if(re)return V;re=1,Object.defineProperty(V,"__esModule",{value:!0}),V.default=f;function f(c){var h={};for(var m in c)m[0]!=="$"&&(h[m]=c[m]);return h}return V}var ne;function je(){if(ne)return j;ne=1;function f(r){"@babel/helpers - typeof";return f=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(a){return typeof a}:function(a){return a&&typeof Symbol=="function"&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},f(r)}Object.defineProperty(j,"__esModule",{value:!0}),j.default=void 0;var c=g(K()),h=le(),m=Ze(),b=y(qe()),v=["children","title","size","color","overrides"];function y(r){return r&&r.__esModule?r:{default:r}}function S(r){if(typeof WeakMap!="function")return null;var a=new WeakMap,l=new WeakMap;return(S=function(e){return e?l:a})(r)}function g(r,a){if(r&&r.__esModule)return r;if(r===null||f(r)!=="object"&&typeof r!="function")return{default:r};var l=S(a);if(l&&l.has(r))return l.get(r);var n={},e=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in r)if(o!=="default"&&Object.prototype.hasOwnProperty.call(r,o)){var p=e?Object.getOwnPropertyDescriptor(r,o):null;p&&(p.get||p.set)?Object.defineProperty(n,o,p):n[o]=r[o]}return n.default=r,l&&l.set(r,n),n}function $(){return $=Object.assign?Object.assign.bind():function(r){for(var a=1;a<arguments.length;a++){var l=arguments[a];for(var n in l)Object.prototype.hasOwnProperty.call(l,n)&&(r[n]=l[n])}return r},$.apply(this,arguments)}function P(r,a){var l=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);a&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})),l.push.apply(l,n)}return l}function E(r){for(var a=1;a<arguments.length;a++){var l=arguments[a]!=null?arguments[a]:{};a%2?P(Object(l),!0).forEach(function(n){_(r,n,l[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(l)):P(Object(l)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(l,n))})}return r}function _(r,a,l){return a in r?Object.defineProperty(r,a,{value:l,enumerable:!0,configurable:!0,writable:!0}):r[a]=l,r}function D(r,a){return F(r)||M(r,a)||N(r,a)||L()}function L(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
2
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function N(r,a){if(r){if(typeof r=="string")return x(r,a);var l=Object.prototype.toString.call(r).slice(8,-1);if(l==="Object"&&r.constructor&&(l=r.constructor.name),l==="Map"||l==="Set")return Array.from(r);if(l==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(l))return x(r,a)}}function x(r,a){(a==null||a>r.length)&&(a=r.length);for(var l=0,n=new Array(a);l<a;l++)n[l]=r[l];return n}function M(r,a){var l=r==null?null:typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(l!=null){var n=[],e=!0,o=!1,p,d;try{for(l=l.call(r);!(e=(p=l.next()).done)&&(n.push(p.value),!(a&&n.length===a));e=!0);}catch(O){o=!0,d=O}finally{try{!e&&l.return!=null&&l.return()}finally{if(o)throw d}}return n}}function F(r){if(Array.isArray(r))return r}function i(r,a){if(r==null)return{};var l=t(r,a),n,e;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(r);for(e=0;e<o.length;e++)n=o[e],!(a.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(r,n)&&(l[n]=r[n])}return l}function t(r,a){if(r==null)return{};var l={},n=Object.keys(r),e,o;for(o=0;o<n.length;o++)e=n[o],!(a.indexOf(e)>=0)&&(l[e]=r[e]);return l}var u=function(a,l){var n=a.children,e=a.title,o=a.size,p=a.color,d=a.overrides,O=d===void 0?{}:d,I=i(a,v),R=(0,h.getOverrides)(O.Svg,m.Svg),W=D(R,2),T=W[0],B=W[1],U=T.__STYLETRON__?E(E({title:e,$color:p,$size:o},I),B):E(E({title:e,color:p,size:o},(0,b.default)(I)),(0,b.default)(B));return c.createElement(T,$({"data-baseweb":"icon",ref:l},U),e?c.createElement("title",null,e):null,n)},s=c.forwardRef(u);return j.default=s,j}var oe;function ke(){if(oe)return q;oe=1;function f(t){"@babel/helpers - typeof";return f=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},f(t)}Object.defineProperty(q,"__esModule",{value:!0}),q.default=void 0;var c=g(K()),h=Y,m=le(),b=y(je()),v=["title","size","color","overrides"];function y(t){return t&&t.__esModule?t:{default:t}}function S(t){if(typeof WeakMap!="function")return null;var u=new WeakMap,s=new WeakMap;return(S=function(a){return a?s:u})(t)}function g(t,u){if(t&&t.__esModule)return t;if(t===null||f(t)!=="object"&&typeof t!="function")return{default:t};var s=S(u);if(s&&s.has(t))return s.get(t);var r={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var l in t)if(l!=="default"&&Object.prototype.hasOwnProperty.call(t,l)){var n=a?Object.getOwnPropertyDescriptor(t,l):null;n&&(n.get||n.set)?Object.defineProperty(r,l,n):r[l]=t[l]}return r.default=t,s&&s.set(t,r),r}function $(){return $=Object.assign?Object.assign.bind():function(t){for(var u=1;u<arguments.length;u++){var s=arguments[u];for(var r in s)Object.prototype.hasOwnProperty.call(s,r)&&(t[r]=s[r])}return t},$.apply(this,arguments)}function P(t,u){if(t==null)return{};var s=E(t,u),r,a;if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(t);for(a=0;a<l.length;a++)r=l[a],!(u.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(s[r]=t[r])}return s}function E(t,u){if(t==null)return{};var s={},r=Object.keys(t),a,l;for(l=0;l<r.length;l++)a=r[l],!(u.indexOf(a)>=0)&&(s[a]=t[a]);return s}function _(t,u){return M(t)||x(t,u)||L(t,u)||D()}function D(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
3
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function L(t,u){if(t){if(typeof t=="string")return N(t,u);var s=Object.prototype.toString.call(t).slice(8,-1);if(s==="Object"&&t.constructor&&(s=t.constructor.name),s==="Map"||s==="Set")return Array.from(t);if(s==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(s))return N(t,u)}}function N(t,u){(u==null||u>t.length)&&(u=t.length);for(var s=0,r=new Array(u);s<u;s++)r[s]=t[s];return r}function x(t,u){var s=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(s!=null){var r=[],a=!0,l=!1,n,e;try{for(s=s.call(t);!(a=(n=s.next()).done)&&(r.push(n.value),!(u&&r.length===u));a=!0);}catch(o){l=!0,e=o}finally{try{!a&&s.return!=null&&s.return()}finally{if(l)throw e}}return r}}function M(t){if(Array.isArray(t))return t}function F(t,u){var s=(0,h.useStyletron)(),r=_(s,2),a=r[1],l=t.title,n=l===void 0?"Delete Alt":l,e=t.size,o=t.color,p=t.overrides,d=p===void 0?{}:p,O=P(t,v),I=(0,m.mergeOverride)({component:a.icons&&a.icons.DeleteAlt?a.icons.DeleteAlt:null},d&&d.Svg?(0,m.toObjectOverride)(d.Svg):{});return c.createElement(b.default,$({viewBox:"0 0 24 24",ref:u,title:n,size:e,color:o,overrides:{Svg:I}},O),c.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 20C16.4183 20 20 16.4183 20 12C20 7.58173 16.4183 4 12 4C7.58173 4 4 7.58173 4 12C4 16.4183 7.58173 20 12 20ZM10.0303 8.96967C9.73743 8.67679 9.26257 8.67679 8.96967 8.96967C8.67676 9.26257 8.67676 9.73743 8.96967 10.0303L10.9393 12L8.96967 13.9697C8.67676 14.2626 8.67676 14.7374 8.96967 15.0303C9.26257 15.3232 9.73743 15.3232 10.0303 15.0303L12 13.0607L13.9697 15.0303C14.2626 15.3232 14.7374 15.3232 15.0303 15.0303C15.3232 14.7374 15.3232 14.2626 15.0303 13.9697L13.0607 12L15.0303 10.0303C15.3232 9.73743 15.3232 9.26257 15.0303 8.96967C14.7374 8.67679 14.2626 8.67679 13.9697 8.96967L12 10.9393L10.0303 8.96967Z"}))}var i=c.forwardRef(F);return q.default=i,q}var ie;function Ve(){if(ie)return C;ie=1,Object.defineProperty(C,"__esModule",{value:!0}),C.getRootStyles=C.getInputStyles=C.getInputContainerStyles=C.StyledMaskToggleButton=C.StyledClearIconContainer=C.StyledClearIcon=C.Root=C.InputEnhancer=C.InputContainer=C.Input=void 0;var f=Y,c=Fe(),h=m(ke());function m(n){return n&&n.__esModule?n:{default:n}}function b(n,e){var o=Object.keys(n);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(n);e&&(p=p.filter(function(d){return Object.getOwnPropertyDescriptor(n,d).enumerable})),o.push.apply(o,p)}return o}function v(n){for(var e=1;e<arguments.length;e++){var o=arguments[e]!=null?arguments[e]:{};e%2?b(Object(o),!0).forEach(function(p){y(n,p,o[p])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):b(Object(o)).forEach(function(p){Object.defineProperty(n,p,Object.getOwnPropertyDescriptor(o,p))})}return n}function y(n,e,o){return e in n?Object.defineProperty(n,e,{value:o,enumerable:!0,configurable:!0,writable:!0}):n[e]=o,n}var S=(0,f.styled)("button",function(n){var e,o=n.$theme,p=n.$size,d=n.$isFocusVisible,O=(e={},y(e,c.SIZE.mini,o.sizing.scale400),y(e,c.SIZE.compact,o.sizing.scale400),y(e,c.SIZE.default,o.sizing.scale300),y(e,c.SIZE.large,o.sizing.scale200),e)[p];return{display:"flex",alignItems:"center",borderTopStyle:"none",borderBottomStyle:"none",borderLeftStyle:"none",borderRightStyle:"none",background:"none",paddingLeft:O,paddingRight:O,outline:d?"solid 3px ".concat(o.colors.accent):"none",color:o.colors.contentPrimary}});C.StyledMaskToggleButton=S,S.displayName="StyledMaskToggleButton",S.displayName="StyledMaskToggleButton";var g=(0,f.styled)("div",function(n){var e,o=n.$alignTop,p=o===void 0?!1:o,d=n.$size,O=n.$theme,I=(e={},y(e,c.SIZE.mini,O.sizing.scale200),y(e,c.SIZE.compact,O.sizing.scale200),y(e,c.SIZE.default,O.sizing.scale100),y(e,c.SIZE.large,O.sizing.scale0),e)[d];return{display:"flex",alignItems:p?"flex-start":"center",paddingLeft:I,paddingRight:I,paddingTop:p?O.sizing.scale500:"0px",color:O.colors.contentPrimary}});C.StyledClearIconContainer=g,g.displayName="StyledClearIconContainer",g.displayName="StyledClearIconContainer";var $=(0,f.styled)(h.default,function(n){var e=n.$theme,o=n.$isFocusVisible;return{cursor:"pointer",outline:o?"solid 3px ".concat(e.colors.accent):"none"}});C.StyledClearIcon=$,$.displayName="StyledClearIcon",$.displayName="StyledClearIcon";function P(n,e){var o;return(o={},y(o,c.SIZE.mini,{paddingTop:e.scale100,paddingBottom:e.scale100,paddingLeft:e.scale550,paddingRight:e.scale550}),y(o,c.SIZE.compact,{paddingTop:e.scale200,paddingBottom:e.scale200,paddingLeft:e.scale550,paddingRight:e.scale550}),y(o,c.SIZE.default,{paddingTop:e.scale400,paddingBottom:e.scale400,paddingLeft:e.scale550,paddingRight:e.scale550}),y(o,c.SIZE.large,{paddingTop:e.scale550,paddingBottom:e.scale550,paddingLeft:e.scale550,paddingRight:e.scale550}),o)[n]}function E(n,e,o,p,d){var O=n===c.ADJOINED.both||n===c.ADJOINED.left&&p!=="rtl"||n===c.ADJOINED.right&&p==="rtl"||d&&p==="rtl",I=n===c.ADJOINED.both||n===c.ADJOINED.right&&p!=="rtl"||n===c.ADJOINED.left&&p==="rtl"||d&&p!=="rtl";return{paddingLeft:O?o.scale550:"0px",paddingRight:I?o.scale550:"0px"}}function _(n,e){var o;return(o={},y(o,c.SIZE.mini,e.font100),y(o,c.SIZE.compact,e.font200),y(o,c.SIZE.default,e.font300),y(o,c.SIZE.large,e.font400),o)[n]}function D(n,e,o){var p=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,d=arguments.length>4?arguments[4]:void 0;return n?{borderLeftColor:d.inputFillDisabled,borderRightColor:d.inputFillDisabled,borderTopColor:d.inputFillDisabled,borderBottomColor:d.inputFillDisabled,backgroundColor:d.inputFillDisabled}:e?{borderLeftColor:d.borderSelected,borderRightColor:d.borderSelected,borderTopColor:d.borderSelected,borderBottomColor:d.borderSelected,backgroundColor:d.inputFillActive}:o?{borderLeftColor:d.inputBorderError,borderRightColor:d.inputBorderError,borderTopColor:d.inputBorderError,borderBottomColor:d.inputBorderError,backgroundColor:d.inputFillError}:p?{borderLeftColor:d.inputBorderPositive,borderRightColor:d.inputBorderPositive,borderTopColor:d.inputBorderPositive,borderBottomColor:d.inputBorderPositive,backgroundColor:d.inputFillPositive}:{borderLeftColor:d.inputBorder,borderRightColor:d.inputBorder,borderTopColor:d.inputBorder,borderBottomColor:d.inputBorder,backgroundColor:d.inputFill}}function L(n,e){var o=e.inputBorderRadius;return n===c.SIZE.mini&&(o=e.inputBorderRadiusMini),{borderTopLeftRadius:o,borderBottomLeftRadius:o,borderTopRightRadius:o,borderBottomRightRadius:o}}var N=function(e){var o=e.$isFocused,p=e.$adjoined,d=e.$error,O=e.$disabled,I=e.$positive,R=e.$size,W=e.$theme,T=e.$theme,B=T.borders,U=T.colors,ue=T.sizing,se=T.typography,G=T.animation,de=e.$hasIconTrailing;return v(v(v(v({boxSizing:"border-box",display:"flex",overflow:"hidden",width:"100%",borderLeftWidth:"2px",borderRightWidth:"2px",borderTopWidth:"2px",borderBottomWidth:"2px",borderLeftStyle:"solid",borderRightStyle:"solid",borderTopStyle:"solid",borderBottomStyle:"solid",transitionProperty:"border",transitionDuration:G.timing200,transitionTimingFunction:G.easeOutCurve},L(R,B)),_(R,se)),D(O,o,d,I,U)),E(p,R,ue,W.direction,de))};C.getRootStyles=N;var x=(0,f.styled)("div",N);C.Root=x,x.displayName="Root",x.displayName="Root";function M(n,e){var o;return(o={},y(o,c.SIZE.mini,{paddingRight:e.scale400,paddingLeft:e.scale400}),y(o,c.SIZE.compact,{paddingRight:e.scale400,paddingLeft:e.scale400}),y(o,c.SIZE.default,{paddingRight:e.scale300,paddingLeft:e.scale300}),y(o,c.SIZE.large,{paddingRight:e.scale200,paddingLeft:e.scale200}),o)[n]}function F(n,e,o,p,d){return n?{color:d.inputEnhancerTextDisabled,backgroundColor:d.inputFillDisabled}:e?{color:d.contentPrimary,backgroundColor:d.inputFillActive}:o?{color:d.contentPrimary,backgroundColor:d.inputFillError}:p?{color:d.contentPrimary,backgroundColor:d.inputFillPositive}:{color:d.contentPrimary,backgroundColor:d.inputFill}}var i=(0,f.styled)("div",function(n){var e=n.$size,o=n.$disabled,p=n.$isFocused,d=n.$error,O=n.$positive,I=n.$theme,R=I.colors,W=I.sizing,T=I.typography,B=I.animation;return v(v(v({display:"flex",alignItems:"center",justifyContent:"center",transitionProperty:"color, background-color",transitionDuration:B.timing200,transitionTimingFunction:B.easeOutCurve},_(e,T)),M(e,W)),F(o,p,d,O,R))});C.InputEnhancer=i,i.displayName="InputEnhancer",i.displayName="InputEnhancer";function t(n,e,o,p,d){return n?{color:d.inputTextDisabled,backgroundColor:d.inputFillDisabled}:e?{color:d.contentPrimary,backgroundColor:d.inputFillActive}:o?{color:d.contentPrimary,backgroundColor:d.inputFillError}:p?{color:d.contentPrimary,backgroundColor:d.inputFillPositive}:{color:d.contentPrimary,backgroundColor:d.inputFill}}var u=function(e){var o=e.$isFocused,p=e.$error,d=e.$disabled,O=e.$positive,I=e.$size,R=e.$theme,W=R.colors,T=R.typography,B=R.animation;return v(v({display:"flex",width:"100%",transitionProperty:"background-color",transitionDuration:B.timing200,transitionTimingFunction:B.easeOutCurve},_(I,T)),t(d,o,p,O,W))};C.getInputContainerStyles=u;var s=(0,f.styled)("div",u);C.InputContainer=s,s.displayName="InputContainer",s.displayName="InputContainer";function r(n,e,o,p){return n?{color:p.inputTextDisabled,"-webkit-text-fill-color":p.inputTextDisabled,caretColor:p.contentPrimary,"::placeholder":{color:p.inputPlaceholderDisabled}}:{color:p.contentPrimary,caretColor:p.contentPrimary,"::placeholder":{color:p.inputPlaceholder}}}var a=function(e){var o=e.$disabled,p=e.$isFocused,d=e.$error,O=e.$size,I=e.$theme,R=I.colors,W=I.sizing,T=I.typography;return v(v(v({boxSizing:"border-box",backgroundColor:"transparent",borderLeftWidth:0,borderRightWidth:0,borderTopWidth:0,borderBottomWidth:0,borderLeftStyle:"none",borderRightStyle:"none",borderTopStyle:"none",borderBottomStyle:"none",outline:"none",width:"100%",minWidth:0,maxWidth:"100%",cursor:o?"not-allowed":"text",margin:"0",paddingTop:"0",paddingBottom:"0",paddingLeft:"0",paddingRight:"0"},_(O,T)),P(O,W)),r(o,p,d,R))};C.getInputStyles=a;var l=(0,f.styled)("input",a);return C.Input=l,l.displayName="Input",l.displayName="Input",C}var He=Ve();const Ue=ae("div",{target:"e1hlhgmz0"})({position:"absolute",top:"50%",right:"2.05em"}),Je=ae(Pe,{shouldForwardProp:$e,target:"e1hlhgmz1"})(({theme:f,$isHighlighted:c})=>({paddingRight:f.spacing.lg,paddingLeft:f.spacing.lg,paddingTop:f.spacing.sm,paddingBottom:f.spacing.sm,background:c?f.colors.darkenedBgMix15:void 0,"&:hover, &:active, &:focus-visible":{background:f.colors.darkenedBgMix15}}));function Ke({disabled:f,element:c,widgetMgr:h,fragmentId:m}){const[b,v]=Be({getStateFromWidgetMgr:Ye,getDefaultStateFromProto:Ge,getCurrStateFromProto:Xe,updateWidgetMgrState:Qe,element:c,widgetMgr:h,fragmentId:m}),y=H.useContext(_e),S=J(c.default)&&!f,g=Te(),$={Select:{props:{disabled:f,overrides:{ControlContainer:{style:{height:g.sizes.minElementHeight,borderLeftWidth:g.sizes.borderWidth,borderRightWidth:g.sizes.borderWidth,borderTopWidth:g.sizes.borderWidth,borderBottomWidth:g.sizes.borderWidth}},IconsContainer:{style:()=>({paddingRight:g.spacing.sm})},ValueContainer:{style:()=>({lineHeight:g.lineHeights.inputWidget,paddingRight:g.spacing.sm,paddingLeft:g.spacing.md,paddingBottom:g.spacing.sm,paddingTop:g.spacing.sm})},SingleValue:{style:{fontWeight:g.fontWeights.normal},props:{"data-testid":"stTimeInputTimeDisplay"}},Dropdown:{style:()=>({paddingTop:g.spacing.none,paddingBottom:g.spacing.none,boxShadow:"none",maxHeight:g.sizes.maxDropdownHeight})},DropdownListItem:{component:Je},Popover:{props:{ignoreBoundary:y,overrides:{Body:{style:()=>({marginTop:g.spacing.px})}}}},Placeholder:{style:()=>({color:g.colors.fadedText60})},SelectArrow:{component:We,props:{overrides:{Svg:{style:()=>({width:g.iconSizes.xl,height:g.iconSizes.xl})}}}}}}}},P=H.useCallback(_=>{const D=_===null?null:et(_);v({value:D,fromUi:!0})},[v]),E=H.useCallback(()=>{P(null)},[P]);return Ee("div",{className:"stTimeInput","data-testid":"stTimeInput",children:[z(Ae,{label:c.label,disabled:f,labelVisibility:Re(c.labelVisibility?.value),children:c.help&&z(we,{children:z(De,{content:c.help,placement:xe.TOP_RIGHT})})}),z(Ne,{format:"24",step:c.step?Number(c.step):900,value:J(b)?void 0:tt(b),onChange:P,overrides:$,nullable:S,creatable:!0,"aria-label":c.label}),S&&!J(b)&&z(Ue,{onClick:E,"data-testid":"stTimeInputClearButton",children:z(He.StyledClearIcon,{overrides:{Svg:{style:{color:g.colors.grayTextColor,padding:g.spacing.threeXS,height:g.sizes.clearIconSize,width:g.sizes.clearIconSize,":hover":{fill:g.colors.bodyText}}}},$isFocusVisible:!1})})]})}function Ye(f,c){return f.getStringValue(c)??null}function Ge(f){return f.default??null}function Xe(f){return f.value??null}function Qe(f,c,h,m){c.setStringValue(f,h.value,{fromUi:h.fromUi},m)}function et(f){const c=f.getHours().toString().padStart(2,"0"),h=f.getMinutes().toString().padStart(2,"0");return`${c}:${h}`}function tt(f){if(f===null)return null;const[c,h]=f.split(":").map(Number),m=new Date;return m.setHours(c),m.setMinutes(h),m}const ut=H.memo(Ke);export{ut as default};
@@ -0,0 +1 @@
1
+ import{s as C,r as n,u as W,J as I,M as O,N as V,e as H,j as r,l as L,O as N,T as P,P as $,W as B,Q as E,R as F,X as k,Y as A}from"./index.CAj-7vWz.js";import{u as D}from"./useBasicWidgetState.D6sOH6oI.js";import"./FormClearHelper.BB1Km6eP.js";const U=C("div",{target:"euzcfsp0"})(({theme:o})=>({"span[aria-disabled='true']":{background:o.colors.fadedText05}})),Y=(o,t)=>o.getStringArrayValue(t),j=o=>o.default.map(t=>o.options[t])??null,K=o=>o.rawValues??null,X=(o,t,a,l)=>{t.setStringArrayValue(o,a.value,{fromUi:a.fromUi},l)},G=o=>{const{element:t,widgetMgr:a,fragmentId:l}=o,e=W(),S=n.useContext(I),[i,d]=D({getStateFromWidgetMgr:Y,getDefaultStateFromProto:j,getCurrStateFromProto:K,updateWidgetMgrState:X,element:t,widgetMgr:a,fragmentId:l}),p=t.maxSelections>0&&i.length>=t.maxSelections,f=n.useMemo(()=>{if(t.maxSelections===0)return"No results";if(i.length===t.maxSelections){const s=t.maxSelections!==1?"options":"option";return`You can only select up to ${t.maxSelections} ${s}. Remove an option first.`}return"No results"},[t.maxSelections,i.length]),u=n.useCallback(s=>{switch(s.type){case"remove":return O(i,s.option?.value);case"clear":return[];case"select":return i.concat([s.option?.value]);default:throw new Error(`State transition is unknown: ${s.type}`)}},[i]),b=n.useCallback(s=>{t.maxSelections&&s.type==="select"&&i.length>=t.maxSelections||d({value:u(s),fromUi:!0})},[t.maxSelections,u,d,i.length]),{options:x}=t,{placeholder:y,disabled:v,selectOptions:z,inputReadOnly:M,valuesToUiMulti:g,createFilterOptions:m}=V({options:x,isMulti:!0,acceptNewOptions:t.acceptNewOptions??!1,placeholderInput:t.placeholder}),T=n.useCallback((s,h)=>p?[]:m(i)(s,h),[m,p,i]),c=o.disabled||v,w=n.useMemo(()=>g(i),[g,i]),R=n.useMemo(()=>{const s=e.fontSizes.baseFontSize*1.6+14;return`${Math.round(s*4.25)}px`},[e.fontSizes.baseFontSize]);return H("div",{className:"stMultiSelect","data-testid":"stMultiSelect",children:[r(B,{label:t.label,disabled:c,labelVisibility:L(t.labelVisibility?.value),children:t.help&&r(N,{children:r(P,{content:t.help,placement:$.TOP_RIGHT})})}),r(U,{children:r(E,{creatable:t.acceptNewOptions??!1,options:z,labelKey:"label",valueKey:"value","aria-label":t.label,placeholder:y,type:A.select,multi:!0,onChange:b,value:w,disabled:c,size:"compact",noResultsMsg:f,filterOptions:T,closeOnSelect:!1,ignoreCase:!1,overrides:{Popover:{props:{ignoreBoundary:S,overrides:{Body:{style:()=>({marginTop:e.spacing.px})}}}},SelectArrow:{component:k,props:{style:{cursor:"pointer"},overrides:{Svg:{style:()=>({width:e.iconSizes.xl,height:e.iconSizes.xl})}}}},IconsContainer:{style:()=>({paddingRight:e.spacing.sm})},ControlContainer:{style:{maxHeight:R,minHeight:e.sizes.minElementHeight,borderLeftWidth:e.sizes.borderWidth,borderRightWidth:e.sizes.borderWidth,borderTopWidth:e.sizes.borderWidth,borderBottomWidth:e.sizes.borderWidth}},Placeholder:{style:()=>({flex:"inherit",color:c?e.colors.fadedText40:e.colors.fadedText60})},ValueContainer:{style:()=>({overflowY:"auto",paddingLeft:e.spacing.sm,paddingTop:e.spacing.none,paddingBottom:e.spacing.none,paddingRight:e.spacing.none})},ClearIcon:{props:{overrides:{Svg:{style:{color:e.colors.grayTextColor,padding:e.spacing.threeXS,height:e.sizes.clearIconSize,width:e.sizes.clearIconSize,cursor:"pointer",":hover":{fill:e.colors.bodyText}}}}}},SearchIcon:{style:{color:e.colors.grayTextColor}},Tag:{props:{overrides:{Root:{style:{fontWeight:e.fontWeights.normal,borderTopLeftRadius:e.radii.md,borderTopRightRadius:e.radii.md,borderBottomRightRadius:e.radii.md,borderBottomLeftRadius:e.radii.md,fontSize:e.fontSizes.md,paddingLeft:e.spacing.sm,marginLeft:e.spacing.none,marginRight:e.spacing.sm,height:`calc(${e.sizes.minElementHeight} - 2 * ${e.spacing.xs})`,maxWidth:`calc(100% - ${e.spacing.lg})`,cursor:"default !important"}},Action:{style:{paddingLeft:0}},ActionIcon:{props:{overrides:{Svg:{style:{width:"0.625em",height:"0.625em"}}}}}}}},MultiValue:{props:{overrides:{Root:{style:{fontSize:e.fontSizes.sm}}}}},Input:{props:{readOnly:M}},Dropdown:{component:F}}})})]})},q=n.memo(G);export{q as default};
@@ -1 +1 @@
1
- import{v as t,ac as l,t as v,c as n,r as b,B as s,j as a,a as B,D as k,d as C}from"./index.CD8HuT3N.js";function x(o,r){switch(o){case n.XSMALL:return{padding:`${r.spacing.twoXS} ${r.spacing.sm}`,fontSize:r.fontSizes.sm};case n.SMALL:return{padding:`${r.spacing.twoXS} ${r.spacing.md}`};case n.LARGE:return{padding:`${r.spacing.md} ${r.spacing.md}`};default:return{padding:`${r.spacing.xs} ${r.spacing.md}`}}}const u=t("a",{target:"eyqil1z0"})(({containerWidth:o,size:r,theme:i})=>({display:"inline-flex",alignItems:"center",justifyContent:"center",fontWeight:i.fontWeights.normal,padding:`${i.spacing.xs} ${i.spacing.md}`,borderRadius:i.radii.button,minHeight:i.sizes.minElementHeight,margin:0,lineHeight:i.lineHeights.base,color:i.colors.primary,textDecoration:"none",width:o?"100%":"auto",userSelect:"none","&:visited":{color:i.colors.primary},"&:focus":{outline:"none"},"&:focus-visible":{boxShadow:`0 0 0 0.2rem ${v(i.colors.primary,.5)}`},"&:hover":{textDecoration:"none"},"&:active":{textDecoration:"none"},...x(r,i)})),L=t(u,{target:"eyqil1z1"})(({theme:o})=>({backgroundColor:o.colors.primary,color:o.colors.white,border:`${o.sizes.borderWidth} solid ${o.colors.primary}`,"&:hover, &:focus-visible":{backgroundColor:l(o.colors.primary,.15),borderColor:l(o.colors.primary,.15)},"&:active":{backgroundColor:o.colors.primary,borderColor:l(o.colors.primary,.15)},"&:visited:not(:active)":{color:o.colors.white},"&[disabled], &[disabled]:hover, &[disabled]:active, &[disabled]:visited":{borderColor:o.colors.borderColor,backgroundColor:o.colors.transparent,color:o.colors.fadedText40,cursor:"not-allowed"}})),S=t(u,{target:"eyqil1z2"})(({theme:o})=>({backgroundColor:o.colors.lightenedBg05,color:o.colors.bodyText,border:`${o.sizes.borderWidth} solid ${o.colors.borderColor}`,"&:visited":{color:o.colors.bodyText},"&:hover, &:focus-visible":{backgroundColor:o.colors.darkenedBgMix15},"&:active":{backgroundColor:o.colors.darkenedBgMix25},"&[disabled], &[disabled]:hover, &[disabled]:active":{borderColor:o.colors.borderColor,backgroundColor:o.colors.transparent,color:o.colors.fadedText40,cursor:"not-allowed"}})),$=t(u,{target:"eyqil1z3"})(({theme:o})=>({padding:o.spacing.none,backgroundColor:o.colors.transparent,color:o.colors.bodyText,border:"none","&:visited":{color:o.colors.bodyText},"&:hover, &:focus-visible":{color:o.colors.primary},"&:hover:not([disabled]), &:focus-visible:not([disabled])":{"span.stMarkdownColoredText":{color:"inherit !important"}},"&:active":{color:l(o.colors.primary,.25)},"&[disabled], &[disabled]:hover, &[disabled]:active":{backgroundColor:o.colors.transparent,color:o.colors.fadedText40,cursor:"not-allowed"}}));function T({kind:o,size:r,disabled:i,children:d,autoFocus:e,href:p,rel:g,target:y,onClick:f}){let c=L;return o===s.SECONDARY?c=S:o===s.TERTIARY&&(c=$),a(c,{kind:o,size:r||n.MEDIUM,containerWidth:!0,disabled:i||!1,autoFocus:e||!1,href:p,target:y,rel:g,onClick:f,tabIndex:i?-1:0,"data-testid":`stBaseLinkButton-${o}`,children:d})}const z=b.memo(T);function w(o){const{element:r}=o;let i=s.SECONDARY;r.type==="primary"?i=s.PRIMARY:r.type==="tertiary"&&(i=s.TERTIARY);const d=e=>{r.disabled&&e.preventDefault()};return a(C,{className:"stLinkButton","data-testid":"stLinkButton",children:a(B,{help:r.help,containerWidth:!0,children:a(z,{kind:i,size:n.SMALL,disabled:r.disabled,onClick:d,href:r.url,target:"_blank",rel:"noreferrer","aria-disabled":r.disabled,children:a(k,{icon:r.icon,label:r.label})})})})}const A=b.memo(w);export{A as default};
1
+ import{s as t,a9 as l,t as v,c as n,r as b,B as s,j as a,a as B,D as k,d as C}from"./index.CAj-7vWz.js";function x(o,r){switch(o){case n.XSMALL:return{padding:`${r.spacing.twoXS} ${r.spacing.sm}`,fontSize:r.fontSizes.sm};case n.SMALL:return{padding:`${r.spacing.twoXS} ${r.spacing.md}`};case n.LARGE:return{padding:`${r.spacing.md} ${r.spacing.md}`};default:return{padding:`${r.spacing.xs} ${r.spacing.md}`}}}const u=t("a",{target:"eyqil1z0"})(({containerWidth:o,size:r,theme:i})=>({display:"inline-flex",alignItems:"center",justifyContent:"center",fontWeight:i.fontWeights.normal,padding:`${i.spacing.xs} ${i.spacing.md}`,borderRadius:i.radii.button,minHeight:i.sizes.minElementHeight,margin:0,lineHeight:i.lineHeights.base,color:i.colors.primary,textDecoration:"none",width:o?"100%":"auto",userSelect:"none","&:visited":{color:i.colors.primary},"&:focus":{outline:"none"},"&:focus-visible":{boxShadow:`0 0 0 0.2rem ${v(i.colors.primary,.5)}`},"&:hover":{textDecoration:"none"},"&:active":{textDecoration:"none"},...x(r,i)})),L=t(u,{target:"eyqil1z1"})(({theme:o})=>({backgroundColor:o.colors.primary,color:o.colors.white,border:`${o.sizes.borderWidth} solid ${o.colors.primary}`,"&:hover, &:focus-visible":{backgroundColor:l(o.colors.primary,.15),borderColor:l(o.colors.primary,.15)},"&:active":{backgroundColor:o.colors.primary,borderColor:l(o.colors.primary,.15)},"&:visited:not(:active)":{color:o.colors.white},"&[disabled], &[disabled]:hover, &[disabled]:active, &[disabled]:visited":{borderColor:o.colors.borderColor,backgroundColor:o.colors.transparent,color:o.colors.fadedText40,cursor:"not-allowed"}})),S=t(u,{target:"eyqil1z2"})(({theme:o})=>({backgroundColor:o.colors.lightenedBg05,color:o.colors.bodyText,border:`${o.sizes.borderWidth} solid ${o.colors.borderColor}`,"&:visited":{color:o.colors.bodyText},"&:hover, &:focus-visible":{backgroundColor:o.colors.darkenedBgMix15},"&:active":{backgroundColor:o.colors.darkenedBgMix25},"&[disabled], &[disabled]:hover, &[disabled]:active":{borderColor:o.colors.borderColor,backgroundColor:o.colors.transparent,color:o.colors.fadedText40,cursor:"not-allowed"}})),$=t(u,{target:"eyqil1z3"})(({theme:o})=>({padding:o.spacing.none,backgroundColor:o.colors.transparent,color:o.colors.bodyText,border:"none","&:visited":{color:o.colors.bodyText},"&:hover, &:focus-visible":{color:o.colors.primary},"&:hover:not([disabled]), &:focus-visible:not([disabled])":{"span.stMarkdownColoredText":{color:"inherit !important"}},"&:active":{color:l(o.colors.primary,.25)},"&[disabled], &[disabled]:hover, &[disabled]:active":{backgroundColor:o.colors.transparent,color:o.colors.fadedText40,cursor:"not-allowed"}}));function T({kind:o,size:r,disabled:i,children:d,autoFocus:e,href:p,rel:g,target:y,onClick:f}){let c=L;return o===s.SECONDARY?c=S:o===s.TERTIARY&&(c=$),a(c,{kind:o,size:r||n.MEDIUM,containerWidth:!0,disabled:i||!1,autoFocus:e||!1,href:p,target:y,rel:g,onClick:f,tabIndex:i?-1:0,"data-testid":`stBaseLinkButton-${o}`,children:d})}const z=b.memo(T);function w(o){const{element:r}=o;let i=s.SECONDARY;r.type==="primary"?i=s.PRIMARY:r.type==="tertiary"&&(i=s.TERTIARY);const d=e=>{r.disabled&&e.preventDefault()};return a(C,{className:"stLinkButton","data-testid":"stLinkButton",children:a(B,{help:r.help,containerWidth:!0,children:a(z,{kind:i,size:n.SMALL,disabled:r.disabled,onClick:d,href:r.url,target:"_blank",rel:"noreferrer","aria-disabled":r.disabled,children:a(k,{icon:r.icon,label:r.label})})})})}const A=b.memo(w);export{A as default};
@@ -0,0 +1 @@
1
+ import{r as c,E as j,_ as Y,bl as C,bm as _,s as g,e as D,j as r,P as G,b as q,B as J,al as T,T as ut,F as Q,u as k,ak as gt,af as ht,bn as ft,h as mt,a3 as yt,ap as Ct,bo as bt,k as H,bg as xt,bh as It}from"./index.CAj-7vWz.js";import{g as wt,C as vt,I as St,F as $,E as Z,a as Ft,s as Ut,u as Dt,b as Et}from"./FileHelper.90EtOmj9.js";import{I as zt}from"./InputInstructions.jhH15PqV.js";import{u as Tt,T as Bt}from"./useTextInputAutoExpand.4u3_GcuN.js";import{i as Rt}from"./inputUtils.CptNuJwn.js";import{E as Lt}from"./ErrorOutline.esm.YoJdlW1p.js";import{U as tt}from"./UploadFileInfo.C-jY39rj.js";import"./base-input.CJGiNqed.js";var et=c.forwardRef(function(t,e){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return c.createElement(j,Y({iconAttrs:o,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},t,{ref:e}),c.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),c.createElement("path",{d:"M16.5 6v11.5c0 2.21-1.79 4-4 4s-4-1.79-4-4V5a2.5 2.5 0 015 0v10.5c0 .55-.45 1-1 1s-1-.45-1-1V6H10v9.5a2.5 2.5 0 005 0V5c0-2.21-1.79-4-4-4S7 2.79 7 5v12.5c0 3.04 2.46 5.5 5.5 5.5s5.5-2.46 5.5-5.5V6h-1.5z"}))});et.displayName="AttachFile";var ot=c.forwardRef(function(t,e){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return c.createElement(j,Y({iconAttrs:o,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},t,{ref:e}),c.createElement("rect",{width:24,height:24,fill:"none"}),c.createElement("path",{d:"M3 5.51v3.71c0 .46.31.86.76.97L11 12l-7.24 1.81c-.45.11-.76.51-.76.97v3.71c0 .72.73 1.2 1.39.92l15.42-6.49c.82-.34.82-1.5 0-1.84L4.39 4.58C3.73 4.31 3 4.79 3 5.51z"}))});ot.displayName="Send";const rt=(t,e)=>e===C.Directory?{...t,webkitdirectory:"",multiple:!0}:t,Ht=(t,e)=>{if(!e||e.length===0)return!0;const o=t.name.toLowerCase(),i=o.lastIndexOf(".");if(i===-1||i===o.length-1)return e.some(m=>m===""||m===".");const p=o.substring(i),s=o.substring(i+1);return e.some(m=>{const b=m.toLowerCase();return b.startsWith(".")?p===b:s===b})},Vt=(t,e)=>Ht(t,e)?{isValid:!0}:{isValid:!1,errorMessage:`${t.type||"This type of"} files are not allowed.`},nt=t=>{switch(t){case C.None:return"a file";case C.Single:return"a file";case C.Multiple:return"files";case C.Directory:return"a directory";default:return _(t),"a file"}},Mt=g("div",{target:"e15560op0"})(({theme:t,height:e})=>({backgroundColor:t.colors.transparent,position:"absolute",left:0,bottom:0,minHeight:`max(${t.sizes.emptyDropdownHeight}, ${e})`,width:"100%",zIndex:t.zIndices.priority})),$t=g("div",{target:"e15560op1"})(({theme:t,height:e})=>({border:`${t.sizes.borderWidth} solid`,borderColor:t.colors.primary,borderRadius:t.radii.chatInput,backgroundColor:t.colors.secondaryBg,color:t.colors.primary,display:"flex",alignItems:"center",justifyContent:"center",height:e,width:"100%",fontWeight:t.fontWeights.bold})),kt=g("div",{target:"e15560op2"})(({theme:t,disabled:e})=>({display:"flex",alignItems:"top",height:"100%",marginTop:`-${t.sizes.borderWidth}`,cursor:e?"not-allowed":"auto"})),Wt=g("div",{target:"e15560op3"})(({disabled:t})=>({pointerEvents:t?"none":"auto"})),Nt=g("div",{target:"e15560op4"})(({theme:t})=>({marginTop:"0.625em",marginLeft:t.spacing.sm,height:t.spacing.xl,width:t.sizes.borderWidth,backgroundColor:t.colors.fadedText20})),At=g("div",{target:"e15560op5"})(({theme:t})=>({left:0,right:0,lineHeight:t.lineHeights.tight,paddingLeft:t.spacing.sm,paddingRight:t.spacing.sm,overflowX:"auto"})),Pt=g("div",{target:"e15560op6"})({display:"flex"}),Kt=g("div",{target:"e15560op7"})({flex:"0 0 auto"}),Ot=g("div",{target:"e15560op8"})(({theme:t})=>({display:"flex",alignItems:"center",padding:t.spacing.sm,gap:t.spacing.twoXS})),Xt=g("div",{target:"e15560op9"})(({theme:t})=>({color:t.colors.fadedText60})),jt=g("div",{target:"e15560op10"})(({theme:t,fileStatus:e})=>({overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:e.type==="uploaded"?t.colors.bodyText:t.colors.fadedText60})),Yt=g("div",{target:"e15560op11"})(({theme:t})=>({marginRight:t.spacing.md,color:t.colors.fadedText60})),_t=g("small",{target:"e15560op12"})(({theme:t})=>({display:"flex",alignItems:"center",maxHeight:t.sizes.smallElementHeight,color:t.colors.fadedText60,"& :hover":{color:t.colors.bodyText}})),Gt=({getRootProps:t,getInputProps:e,acceptFile:o,disabled:i,theme:p})=>{const s=rt(e(),o);return D(kt,{disabled:i,children:[D(Wt,{"data-testid":"stChatInputFileUploadButton",disabled:i,...t(),children:[r("input",{...s}),r(ut,{content:`Upload or drag and drop ${nt(o)}`,placement:G.TOP,onMouseEnterDelay:500,children:r(q,{kind:J.MINIMAL,disabled:i,children:r(T,{content:et,size:"lg",color:i?p.colors.fadedText40:p.colors.fadedText60})})})]}),r(Nt,{})]})},qt=c.memo(Gt),Jt=({getRootProps:t,getInputProps:e,acceptFile:o,inputHeight:i})=>{const p=rt(e(),o);return D(Q,{children:[r(Mt,{height:i,...t(),children:r("input",{...p})}),r($t,{height:i,children:`Drag and drop ${nt(o)} here`})]})},Qt=c.memo(Jt);function Zt({children:t,content:e}){const o=k();return r(gt,{content:e,placement:G.TOP,overrides:{Body:{style:{top:`-${o.sizes.minElementHeight}`}}},children:t})}const te=({fileInfo:t})=>{const e=k(),{type:o}=t.status;switch(o){case"uploading":return r(ht,{"data-testid":"stChatInputFileIconSpinner",size:"lg",margin:"0",padding:"0"});case"error":return r(Zt,{content:t.status.errorMessage,children:r(T,{color:e.colors.redTextColor,content:Lt,size:"lg"})});case"uploaded":return r(T,{content:St,size:"lg"});default:return _(o),null}},ee=({fileInfo:t,onDelete:e})=>D(Ot,{className:"stChatInputFile","data-testid":"stChatInputFile",children:[r(Xt,{children:r(te,{fileInfo:t})}),r(jt,{className:"stChatInputFileName","data-testid":"stChatInputFileName",title:t.name,fileStatus:t.status,children:t.name}),r(Yt,{children:wt(t.size,$.Byte)}),r(_t,{"data-testid":"stChatInputDeleteBtn",children:r(q,{onClick:()=>e(t.id),kind:J.MINIMAL,children:r(T,{content:vt,size:"lg"})})})]}),oe=c.memo(ee),re=({items:t,onDelete:e})=>r(At,{"data-testid":"stChatUploadedFiles",children:r(Pt,{children:t.map(o=>r(Kt,{children:r(oe,{fileInfo:o,onDelete:e})},o.id))})}),ne=c.memo(re),ae=(t,e)=>{const o=[],i=[];return t.forEach(p=>{const s=Vt(p,e.fileType);s.isValid?o.push(p):i.push({file:p,errors:[{code:Z.FileInvalidType,message:s.errorMessage||"File type not allowed."}]})}),{accepted:o,rejected:i}},ie=({acceptMultipleFiles:t,acceptDirectoryFiles:e,maxFileSize:o,uploadClient:i,uploadFile:p,addFiles:s,getNextLocalFileId:m,deleteExistingFiles:b,onUploadComplete:w,element:x})=>(f,h)=>{if(e&&f.length>0){const{accepted:u,rejected:y}=ae(f,x);f=u,h=[...h,...y]}if(!t&&f.length===0&&h.length>1){const u=h.findIndex(y=>y.errors?.[0].code===Z.TooManyFiles);u>=0&&(f.push(h[u].file),h.splice(u,1))}if(!t&&f.length>0&&b(),i.fetchFileURLs(f).then(u=>{ft(u,f).forEach(([y,v])=>{p(y,v)})}).catch(u=>{s(f.map(y=>new tt(y.name,y.size,m(),{type:"error",errorMessage:u})))}),h.length>0){const u=h.map(y=>Ft(y,m(),o));s(u)}w()},se=({getNextLocalFileId:t,addFiles:e,updateFile:o,uploadClient:i,element:p,onUploadProgress:s,onUploadComplete:m})=>(b,w)=>{const x=w.webkitRelativePath||w.name,f=new AbortController,h=new tt(x,w.size,t(),{type:"uploading",abortController:f,progress:1});e([h]),i.uploadFile({formId:"",...p},b.uploadUrl,w,u=>s(u,h.id),f.signal).then(()=>m(h.id,b)).catch(u=>{u instanceof DOMException&&u.name==="AbortError"||o(h.id,h.setStatus({type:"error",errorMessage:u?u.toString():"Unknown error"}))})},le=g("div",{target:"exaa2ht0"})("border:none;position:relative;display:flex;"),de=g("div",{target:"exaa2ht1"})(({theme:t,extended:e})=>({border:`${t.sizes.borderWidth} solid`,borderColor:t.colors.widgetBorderColor??t.colors.transparent,borderRadius:t.radii.chatInput,backgroundColor:t.colors.secondaryBg,position:"relative",flexGrow:1,display:"flex",alignItems:"center",paddingLeft:t.spacing.lg,maxHeight:e?"none":t.sizes.minElementHeight,gap:t.spacing.sm,overflow:"hidden",":focus-within":{borderColor:t.colors.primary}})),ce=g("button",{target:"exaa2ht2"})(({theme:t,disabled:e,extended:o})=>{const i=mt(t),[p,s]=i?[t.colors.gray60,t.colors.gray80]:[t.colors.gray80,t.colors.gray40];return{border:"none",backgroundColor:t.colors.transparent,borderTopRightRadius:o?"0":t.radii.chatInput,borderTopLeftRadius:o?t.radii.default:"0",borderBottomRightRadius:t.radii.chatInput,display:"inline-flex",alignItems:"center",justifyContent:"center",lineHeight:t.lineHeights.none,margin:t.spacing.none,padding:t.spacing.sm,color:e?p:s,pointerEvents:"auto","&:focus":{outline:"none"},":focus":{outline:"none"},"&:focus-visible":{backgroundColor:i?t.colors.gray10:t.colors.gray90},"&:hover":{color:t.colors.primary},"&:disabled, &:disabled:hover, &:disabled:active":{backgroundColor:t.colors.transparent,borderColor:t.colors.transparent,color:t.colors.gray60,cursor:"not-allowed"}}}),pe=g("div",{target:"exaa2ht3"})(({theme:t})=>({display:"flex",alignItems:"flex-end",height:"100%",position:"absolute",right:0,marginBottom:`-${t.sizes.borderWidth}`,pointerEvents:"none"})),ue=g("div",{target:"exaa2ht4"})(({theme:t})=>({position:"absolute",bottom:"0px",right:`calc(${t.iconSizes.xl} + 2 * ${t.spacing.sm} + ${t.spacing.sm})`})),V=(t,e,o)=>o.map(i=>i.id===t?e:i),M=(t,e)=>e.find(o=>o.id===t);function ge({disabled:t,element:e,widgetMgr:o,fragmentId:i,uploadClient:p}){const s=k(),{placeholder:m,maxChars:b}=e,w=c.useRef(0),x=c.useRef(null),{width:f,elementRef:h}=yt(),{innerWidth:u,innerHeight:y}=Ct(),[v,B]=c.useState(e.default),[F,U]=c.useState([]),[E,R]=c.useState(!1),S=Tt({textareaRef:x,dependencies:[m]}),L=c.useMemo(()=>F.some(n=>n.status.type==="uploading")?!1:v!==""||F.length>0,[F,v]),I=bt(e.acceptFile),W=Ut(e.maxUploadSizeMb,$.Megabyte,$.Byte),N=c.useCallback(n=>U(l=>[...l,...n]),[]),A=c.useCallback(n=>{U(l=>{const d=M(n,l);return H(d)?l:(d.status.type==="uploading"&&d.status.abortController.abort(),d.status.type==="uploaded"&&d.status.fileUrls.deleteUrl&&p.deleteFile(d.status.fileUrls.deleteUrl),l.filter(a=>a.id!==n))})},[p]),at=()=>{const n=F.filter(l=>l.status.type==="uploaded").map(l=>{const{name:d,size:a,status:z}=l,{fileId:ct,fileUrls:pt}=z;return new xt({fileId:ct,fileUrls:pt,name:d,size:a})});return new It({uploadedFileInfo:n})},P=()=>w.current++,it=ie({acceptMultipleFiles:I===C.Multiple||I===C.Directory,acceptDirectoryFiles:I===C.Directory,maxFileSize:W,uploadClient:p,uploadFile:se({getNextLocalFileId:P,addFiles:N,updateFile:(n,l)=>{U(d=>V(n,l,d))},uploadClient:p,element:e,onUploadProgress:(n,l)=>{U(d=>{const a=M(l,d);if(H(a)||a.status.type!=="uploading")return d;const z=Math.round(n.loaded*100/n.total);return a.status.progress===z?d:V(l,a.setStatus({type:"uploading",abortController:a.status.abortController,progress:z}),d)})},onUploadComplete:(n,l)=>{U(d=>{const a=M(n,d);return H(a)||a.status.type!=="uploading"?d:V(a.id,a.setStatus({type:"uploaded",fileId:l.fileId,fileUrls:l}),d)})}}),addFiles:N,getNextLocalFileId:P,deleteExistingFiles:()=>F.forEach(n=>A(n.id)),onUploadComplete:()=>{x.current&&x.current.focus()},element:e}),{getRootProps:K,getInputProps:O}=Dt({onDrop:it,multiple:I===C.Multiple||I===C.Directory,accept:Et(e.fileType),maxSize:W}),X=()=>{if(x.current&&x.current.focus(),!L||t)return;const n={data:v,fileUploaderState:at()};o.setChatInputValue(e,n,{fromUi:!0},i),U([]),B(""),S.clearScrollHeight()},st=n=>{const{metaKey:l,ctrlKey:d,shiftKey:a}=n;Rt(n)&&!a&&!d&&!l&&(n.preventDefault(),X())},lt=n=>{const{value:l}=n.target;b!==0&&l.length>b||(B(l),S.updateScrollHeight())};c.useEffect(()=>{if(e.setValue){e.setValue=!1;const n=e.value||"";B(n)}},[e]),c.useEffect(()=>{const n=a=>{a.preventDefault(),a.stopPropagation(),!E&&a.dataTransfer?.types.includes("Files")&&R(!0)},l=a=>{a.preventDefault(),a.stopPropagation(),E&&(a.clientX<=0&&a.clientY<=0||a.clientX>=u&&a.clientY>=y)&&R(!1)},d=a=>{a.preventDefault(),a.stopPropagation(),E&&R(!1)};return window.addEventListener("dragover",n),window.addEventListener("drop",d),window.addEventListener("dragleave",l),()=>{window.removeEventListener("dragover",n),window.removeEventListener("drop",d),window.removeEventListener("dragleave",l)}},[E,u,y]);const dt=I!==C.None&&E;return D(Q,{children:[I===C.None?null:r(ne,{items:[...F],onDelete:A}),r(le,{className:"stChatInput","data-testid":"stChatInput",ref:h,children:dt?r(Qt,{getRootProps:K,getInputProps:O,acceptFile:I,inputHeight:S.height}):D(de,{extended:S.isExtended,children:[I===C.None?null:r(qt,{getRootProps:K,getInputProps:O,acceptFile:I,disabled:t,theme:s}),r(Bt,{inputRef:x,value:v,placeholder:m,onChange:lt,onKeyDown:st,"aria-label":m,disabled:t,rows:1,overrides:{Root:{style:{minHeight:s.sizes.minElementHeight,outline:"none",borderLeftWidth:"0",borderRightWidth:"0",borderTopWidth:"0",borderBottomWidth:"0",borderTopLeftRadius:"0",borderTopRightRadius:"0",borderBottomRightRadius:"0",borderBottomLeftRadius:"0"}},Input:{props:{"data-testid":"stChatInputTextArea"},style:{fontWeight:s.fontWeights.normal,lineHeight:s.lineHeights.inputWidget,"::placeholder":{color:s.colors.fadedText60},height:S.height,maxHeight:S.maxHeight,paddingLeft:s.spacing.none,paddingBottom:s.spacing.sm,paddingTop:s.spacing.sm,paddingRight:`calc(${s.iconSizes.xl} + 2 * ${s.spacing.sm} + ${s.spacing.sm})`}}}}),f>s.breakpoints.hideWidgetDetails&&r(ue,{children:r(zt,{dirty:L,value:v,maxLength:b,type:"chat",inForm:!1})}),r(pe,{children:r(ce,{onClick:X,disabled:!L||t,extended:S.isExtended,"data-testid":"stChatInputSubmitButton",children:r(T,{content:ot,size:"xl",color:"inherit"})})})]})})]})}const we=c.memo(ge);export{we as default};
@@ -0,0 +1,7 @@
1
+ import{s as c,Z as l,r as i,j as a,ao as p}from"./index.CAj-7vWz.js";import{P as d,R as f}from"./Particles.DUsputn1.js";const g=""+new URL("../media/flake-0.DgWaVvm5.png",import.meta.url).href,u=""+new URL("../media/flake-1.B2r5AHMK.png",import.meta.url).href,E=""+new URL("../media/flake-2.BnWSExPC.png",import.meta.url).href,o=150,s=150,S=10,x=90,_=4e3,e=(t,n=0)=>Math.random()*(t-n)+n,w=()=>l(`from{transform:translateY(0)
2
+ rotateX(`,e(360),`deg)
3
+ rotateY(`,e(360),`deg)
4
+ rotateZ(`,e(360),"deg);}to{transform:translateY(calc(100vh + ",o,`px))
5
+ rotateX(0)
6
+ rotateY(0)
7
+ rotateZ(0);}`),A=c("img",{target:"es7rdur0"})(({theme:t})=>({position:"fixed",top:`${-o}px`,marginLeft:`${-s/2}px`,zIndex:t.zIndices.balloons,left:`${e(x,S)}vw`,animationDelay:`${e(_)}ms`,height:`${o}px`,width:`${s}px`,pointerEvents:"none",animationDuration:"3000ms",animationName:w(),animationTimingFunction:"ease-in",animationDirection:"normal",animationIterationCount:1,opacity:1})),I=100,m=[g,u,E],M=m.length,h=i.memo(({particleType:t,resourceCrossOriginMode:n})=>{const r=m[t];return a(A,{src:r,crossOrigin:p(n,r)})}),P=function({scriptRunId:n}){return a(f,{children:a(d,{className:"stSnow","data-testid":"stSnow",scriptRunId:n,numParticleTypes:M,numParticles:I,ParticleComponent:h})})},L=i.memo(P);export{I as NUM_FLAKES,L as default};
@@ -0,0 +1,2 @@
1
+ import{a_ as Ze,aa as Q,r as _,bp as vt,ab as mt,o as J,aE as bt,aF as yt,s as oe,t as Ve,bf as Tt,u as kt,bq as Ot,j as Z,e as Ie,l as wt,O as Rt,T as St,P as Mt,W as $t,br as _t,bs as _e}from"./index.CAj-7vWz.js";import{s as Ne}from"./sprintf.D7DtBTRn.js";import{u as Et}from"./useBasicWidgetState.D6sOH6oI.js";import"./FormClearHelper.BB1Km6eP.js";var ue={},H={},ce={},le={},Ue;function xe(){if(Ue)return le;Ue=1,Object.defineProperty(le,"__esModule",{value:!0}),le.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||(le.Direction=e={})),le}var He;function Ge(){return He||(He=1,function(e){var r=ce&&ce.__spreadArray||function(i,o,u){if(u||arguments.length===2)for(var h=0,m=o.length,g;h<m;h++)(g||!(h in o))&&(g||(g=Array.prototype.slice.call(o,0,h)),g[h]=o[h]);return i.concat(g||Array.prototype.slice.call(o))};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=Ze(),s=xe(),v=function(i){var o=i.toString().split(".")[1];return o?o.length:0};e.getStepDecimals=v;function S(i){return i.touches&&i.touches.length||i.changedTouches&&i.changedTouches.length}e.isTouchEvent=S;function l(i,o,u){var h=(o-i)/u,m=8,g=Number(h.toFixed(m));return parseInt(g.toString(),10)===g}e.isStepDivisible=l;function p(i,o,u,h,m,g,T){var $=1e11;if(i=Math.round(i*$)/$,!g){var D=T[o-1],x=T[o+1];if(D&&D>i)return D;if(x&&x<i)return x}if(i>h)return h;if(i<u)return u;var U=Math.floor(i*$-u*$)%Math.floor(m*$),V=Math.floor(i*$-Math.abs(U)),W=U===0?i:V/$,A=Math.abs(U/$)<m/2?W:W+m,L=(0,e.getStepDecimals)(m);return parseFloat(A.toFixed(L))}e.normalizeValue=p;function F(i,o,u){return(i-o)/(u-o)}e.relativeValue=F;function j(i){return i===s.Direction.Up||i===s.Direction.Down}e.isVertical=j;function z(i,o,u){if(o>=u)throw new RangeError("min (".concat(o,") is equal/bigger than max (").concat(u,")"));if(i<o)throw new RangeError("value (".concat(i,") is smaller than min (").concat(o,")"));if(i>u)throw new RangeError("value (".concat(i,") is bigger than max (").concat(u,")"))}e.checkBoundaries=z;function E(i,o,u){return i<o?o:i>u?u:i}e.checkValuesAgainstBoundaries=E;function y(i){if(!(i.length<2)&&!i.slice(1).every(function(o,u){return i[u]<=o}))throw new RangeError("values={[".concat(i,"]} needs to be sorted when allowOverlap={false}"))}e.checkInitialOverlap=y;function d(i){var o=window.getComputedStyle(i);return{top:parseInt(o["margin-top"],10),bottom:parseInt(o["margin-bottom"],10),left:parseInt(o["margin-left"],10),right:parseInt(o["margin-right"],10)}}e.getMargin=d;function t(i){var o=window.getComputedStyle(i);return{top:parseInt(o["padding-top"],10)+parseInt(o["border-top-width"],10),bottom:parseInt(o["padding-bottom"],10)+parseInt(o["border-bottom-width"],10),left:parseInt(o["padding-left"],10)+parseInt(o["border-left-width"],10),right:parseInt(o["padding-right"],10)+parseInt(o["border-right-width"],10)}}e.getPaddingAndBorder=t;function a(i,o,u){var h=u?-1:1;i.forEach(function(m,g){return f(m,h*o[g].x,o[g].y)})}e.translateThumbs=a;function c(i,o,u,h){for(var m=0,g=B(i[0],o,u,h),T=1;T<i.length;T++){var $=B(i[T],o,u,h);$<g&&(g=$,m=T)}return m}e.getClosestThumbIndex=c;function f(i,o,u){i.style.transform="translate(".concat(o,"px, ").concat(u,"px)")}e.translate=f;var b=function(i){var o=[],u=null,h=function(){for(var m=[],g=0;g<arguments.length;g++)m[g]=arguments[g];o=m,!u&&(u=requestAnimationFrame(function(){u=null,i.apply(void 0,o)}))};return h};e.schd=b;function k(i,o,u){var h=i.slice(0);return h[o]=u,h}e.replaceAt=k;function I(i){var o=i.values,u=i.colors,h=i.min,m=i.max,g=i.direction,T=g===void 0?s.Direction.Right:g,$=i.rtl,D=$===void 0?!1:$;D&&T===s.Direction.Right?T=s.Direction.Left:D&&s.Direction.Left&&(T=s.Direction.Right);var x=o.slice(0).sort(function(V,W){return V-W}).map(function(V){return(V-h)/(m-h)*100}),U=x.reduce(function(V,W,A){return"".concat(V,", ").concat(u[A]," ").concat(W,"%, ").concat(u[A+1]," ").concat(W,"%")},"");return"linear-gradient(".concat(T,", ").concat(u[0]," 0%").concat(U,", ").concat(u[u.length-1]," 100%)")}e.getTrackBackground=I;function O(){}e.voidFn=O;function w(i){throw new Error("Didn't expect to get here")}e.assertUnreachable=w;var M=function(i,o,u,h,m){m===void 0&&(m=function(T){return T});var g=Math.ceil(r([i],Array.from(i.children),!0).reduce(function(T,$){var D=Math.ceil($.getBoundingClientRect().width);if($.innerText&&$.innerText.includes(u)&&$.childElementCount===0){var x=$.cloneNode(!0);x.innerHTML=m(o.toFixed(h)),x.style.visibility="hidden",document.body.appendChild(x),D=Math.ceil(x.getBoundingClientRect().width),document.body.removeChild(x)}return D>T?D:T},i.getBoundingClientRect().width));return g},P=function(i,o,u,h,m,g,T){T===void 0&&(T=function(x){return x});var $=[],D=function(x){var U=M(u[x],h[x],m,g,T),V=o[x].x;o.forEach(function(W,A){var L=W.x,G=M(u[A],h[A],m,g,T);x!==A&&(V>=L&&V<=L+G||V+U>=L&&V+U<=L+G)&&($.includes(A)||($.push(x),$.push(A),$=r(r([],$,!0),[x,A],!1),D(A)))})};return D(i),Array.from(new Set($.sort()))},R=function(i,o,u,h,m,g){h===void 0&&(h=.1),m===void 0&&(m=" - "),g===void 0&&(g=function(A){return A});var T=(0,e.getStepDecimals)(h),$=(0,n.useState)({}),D=$[0],x=$[1],U=(0,n.useState)(g(o[u].toFixed(T))),V=U[0],W=U[1];return(0,n.useEffect)(function(){if(i){var A=i.getThumbs();if(A.length<1)return;var L={},G=i.getOffsets(),ne=P(u,G,A,o,m,T,g),fe=g(o[u].toFixed(T));if(ne.length){var ee=ne.reduce(function(te,se,ve,me){return te.length?r(r([],te,!0),[G[me[ve]].x],!1):[G[me[ve]].x]},[]);if(Math.min.apply(Math,ee)===G[u].x){var he=[];ne.forEach(function(te){he.push(o[te].toFixed(T))}),fe=Array.from(new Set(he.sort(function(te,se){return parseFloat(te)-parseFloat(se)}))).map(g).join(m);var ge=Math.min.apply(Math,ee),pe=Math.max.apply(Math,ee),$e=A[ne[ee.indexOf(pe)]].getBoundingClientRect().width;L.left="".concat(Math.abs(ge-(pe+$e))/2,"px"),L.transform="translate(-50%, 0)"}else L.visibility="hidden"}W(fe),x(L)}},[i,o]),[V,D]};e.useThumbOverlap=R;function B(i,o,u,h){var m=i.getBoundingClientRect(),g=m.left,T=m.top,$=m.width,D=m.height;return j(h)?Math.abs(u-(T+D/2)):Math.abs(o-(g+$/2))}var C=function(){var i,o=((i=navigator.userAgentData)===null||i===void 0?void 0:i.platform)||navigator.platform;return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(o)||navigator.userAgent.includes("Mac")&&"ontouchend"in document};e.isIOS=C}(ce)),ce}var We;function It(){if(We)return H;We=1;var e=H&&H.__extends||function(){var E=function(y,d){return E=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])},E(y,d)};return function(y,d){if(typeof d!="function"&&d!==null)throw new TypeError("Class extends value "+String(d)+" is not a constructor or null");E(y,d);function t(){this.constructor=y}y.prototype=d===null?Object.create(d):(t.prototype=d.prototype,new t)}}(),r=H&&H.__createBinding||(Object.create?function(E,y,d,t){t===void 0&&(t=d);var a=Object.getOwnPropertyDescriptor(y,d);(!a||("get"in a?!y.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return y[d]}}),Object.defineProperty(E,t,a)}:function(E,y,d,t){t===void 0&&(t=d),E[t]=y[d]}),n=H&&H.__setModuleDefault||(Object.create?function(E,y){Object.defineProperty(E,"default",{enumerable:!0,value:y})}:function(E,y){E.default=y}),s=H&&H.__importStar||function(E){if(E&&E.__esModule)return E;var y={};if(E!=null)for(var d in E)d!=="default"&&Object.prototype.hasOwnProperty.call(E,d)&&r(y,E,d);return n(y,E),y},v=H&&H.__spreadArray||function(E,y,d){if(d||arguments.length===2)for(var t=0,a=y.length,c;t<a;t++)(c||!(t in y))&&(c||(c=Array.prototype.slice.call(y,0,t)),c[t]=y[t]);return E.concat(c||Array.prototype.slice.call(y))};Object.defineProperty(H,"__esModule",{value:!0});var S=s(Ze()),l=Ge(),p=xe(),F=["ArrowRight","ArrowUp","k","PageUp"],j=["ArrowLeft","ArrowDown","j","PageDown"],z=function(E){e(y,E);function y(d){var t=E.call(this,d)||this;if(t.trackRef=S.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,b=a.min,k=a.max,I=t.trackRef.current;if(!I)return console.warn("No track element found."),[];var O=I.getBoundingClientRect(),w=(0,l.getPaddingAndBorder)(I);return t.getThumbs().map(function(M,P){var R={x:0,y:0},B=M.getBoundingClientRect(),C=(0,l.getMargin)(M);switch(c){case p.Direction.Right:return R.x=(C.left+w.left)*-1,R.y=((B.height-O.height)/2+w.top)*-1,R.x+=O.width*(0,l.relativeValue)(f[P],b,k)-B.width/2,R;case p.Direction.Left:return R.x=(C.right+w.right)*-1,R.y=((B.height-O.height)/2+w.top)*-1,R.x+=O.width-O.width*(0,l.relativeValue)(f[P],b,k)-B.width/2,R;case p.Direction.Up:return R.x=((B.width-O.width)/2+C.left+w.left)*-1,R.y=-w.left,R.y+=O.height-O.height*(0,l.relativeValue)(f[P],b,k)-B.height/2,R;case p.Direction.Down:return R.x=((B.width-O.width)/2+C.left+w.left)*-1,R.y=-w.left,R.y+=O.height*(0,l.relativeValue)(f[P],b,k)-B.height/2,R;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(b){var k;return(k=b.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(b){return b.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(b){var k;return(k=b.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(b){return b.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(b,k){return k===f?Math.max.apply(Math,t.state.thumbZIndexes):b<=t.state.thumbZIndexes[f]?b:b-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,b=c.onChange,k=c.step,I=c.rtl,O=c.direction,w=t.state.isChanged,M=t.getTargetIndex(a.nativeEvent),P=I||O===p.Direction.Left||O===p.Direction.Down?-1:1;M!==-1&&(F.includes(a.key)?(a.preventDefault(),t.setState({draggedThumbIndex:M,isChanged:!0}),b((0,l.replaceAt)(f,M,t.normalizeValue(f[M]+P*(a.key==="PageUp"?k*10:k),M)))):j.includes(a.key)?(a.preventDefault(),t.setState({draggedThumbIndex:M,isChanged:!0}),b((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(){w&&t.fireOnFinalChange()}):w&&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,b=f.draggedThumbIndex,k=f.draggedTrackPos,I=t.props,O=I.direction,w=I.min,M=I.max,P=I.onChange,R=I.values,B=I.step,C=I.rtl;if(b===-1&&k[0]===-1&&k[1]===-1)return null;var i=t.trackRef.current;if(!i)return null;var o=i.getBoundingClientRect(),u=(0,l.isVertical)(O)?o.height:o.width;if(k[0]!==-1&&k[1]!==-1){var h=a-k[0],m=c-k[1],g=0;switch(O){case p.Direction.Right:case p.Direction.Left:g=h/u*(M-w);break;case p.Direction.Down:case p.Direction.Up:g=m/u*(M-w);break;default:(0,l.assertUnreachable)(O)}if(C&&(g*=-1),Math.abs(g)>=B/2){for(var T=0;T<t.thumbRefs.length;T++){if(R[T]===M&&Math.sign(g)===1||R[T]===w&&Math.sign(g)===-1)return;var $=R[T]+g;$>M?g=M-R[T]:$<w&&(g=w-R[T])}for(var D=R.slice(0),T=0;T<t.thumbRefs.length;T++)D=(0,l.replaceAt)(D,T,t.normalizeValue(R[T]+g,T));t.setState({draggedTrackPos:[a,c]}),P(D)}}else{var x=0;switch(O){case p.Direction.Right:x=(a-o.left)/u*(M-w)+w;break;case p.Direction.Left:x=(u-(a-o.left))/u*(M-w)+w;break;case p.Direction.Down:x=(c-o.top)/u*(M-w)+w;break;case p.Direction.Up:x=(u-(c-o.top))/u*(M-w)+w;break;default:(0,l.assertUnreachable)(O)}C&&(x=M+w-x),Math.abs(R[b]-x)>=B/2&&P((0,l.replaceAt)(R,b,t.normalizeValue(x,b)))}},t.normalizeValue=function(a,c){var f=t.props,b=f.min,k=f.max,I=f.step,O=f.allowOverlap,w=f.values;return(0,l.normalizeValue)(a,c,b,k,I,O,w)},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]=S.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),b=parseInt(a.paddingLeft,10),k=parseInt(a.paddingTop,10),I=[],O=0;O<t.numOfMarks+1;O++){var w=9999,M=9999;if(t.markRefs[O].current){var P=t.markRefs[O].current.getBoundingClientRect();w=P.height,M=P.width}t.props.direction===p.Direction.Left||t.props.direction===p.Direction.Right?I.push([Math.round(c/t.numOfMarks*O+b-M/2),-Math.round((w-f)/2)]):I.push([Math.round(f/t.numOfMarks*O+k-w/2),-Math.round((M-c)/2)])}t.setState({markOffsets:I})}},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 S.createRef()}),t.updateMarkRefs(d),t}return y.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(b){return(0,l.checkBoundaries)(b,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(b){(0,l.isStepDivisible)(c,b,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.")})},y.prototype.componentDidUpdate=function(d,t){var a=this.props,c=a.max,f=a.min,b=a.step,k=a.values,I=a.rtl;(d.max!==c||d.min!==f||d.step!==b)&&this.updateMarkRefs(this.props),(0,l.translateThumbs)(this.getThumbs(),this.getOffsets(),I),(d.max!==c||d.min!==f||d.step!==b||t.markOffsets.length!==this.state.markOffsets.length)&&(this.calculateMarkOffsets(),k.forEach(function(O){(0,l.isStepDivisible)(f,O,b)||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.")}))},y.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)},y.prototype.render=function(){var d=this,t=this.props,a=t.label,c=t.labelledBy,f=t.renderTrack,b=t.renderThumb,k=t.renderMark,I=k===void 0?function(){return null}:k,O=t.values,w=t.min,M=t.max,P=t.allowOverlap,R=t.disabled,B=this.state,C=B.draggedThumbIndex,i=B.thumbZIndexes,o=B.markOffsets;return f({props:{style:{transform:"scale(1)",cursor:C>-1?"grabbing":this.props.draggableTrack?(0,l.isVertical)(this.props.direction)?"ns-resize":"ew-resize":O.length===1&&!R?"pointer":"inherit"},onMouseDown:R?l.voidFn:this.onMouseDownTrack,onTouchStart:R?l.voidFn:this.onTouchStartTrack,ref:this.trackRef},isDragged:this.state.draggedThumbIndex>-1,disabled:R,children:v(v([],o.map(function(u,h,m){return I({props:{style:d.props.direction===p.Direction.Left||d.props.direction===p.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(h),ref:d.markRefs[h]},index:h})}),!0),O.map(function(u,h){var m=d.state.draggedThumbIndex===h;return b({index:h,value:u,isDragged:m,props:{style:{position:"absolute",zIndex:i[h],cursor:R?"inherit":m?"grabbing":"grab",userSelect:"none",touchAction:"none",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none"},key:h,tabIndex:R?void 0:0,"aria-valuemax":P?M:O[h+1]||M,"aria-valuemin":P?w:O[h-1]||w,"aria-valuenow":u,draggable:!1,ref:d.thumbRefs[h],"aria-label":a,"aria-labelledby":c,role:"slider",onKeyDown:R?l.voidFn:d.onKeyDown,onKeyUp:R?l.voidFn:d.onKeyUp}})}),!0)})},y.defaultProps={label:"Accessibility label",labelledBy:null,step:1,direction:p.Direction.Right,rtl:!1,disabled:!1,allowOverlap:!1,draggableTrack:!1,min:0,max:100},y}(S.Component);return H.default=z,H}var qe;function xt(){return qe||(qe=1,function(e){var r=ue&&ue.__importDefault||function(S){return S&&S.__esModule?S:{default:S}};Object.defineProperty(e,"__esModule",{value:!0}),e.checkValuesAgainstBoundaries=e.relativeValue=e.useThumbOverlap=e.Direction=e.getTrackBackground=e.Range=void 0;var n=r(It());e.Range=n.default;var s=Ge();Object.defineProperty(e,"getTrackBackground",{enumerable:!0,get:function(){return s.getTrackBackground}}),Object.defineProperty(e,"useThumbOverlap",{enumerable:!0,get:function(){return s.useThumbOverlap}}),Object.defineProperty(e,"relativeValue",{enumerable:!0,get:function(){return s.relativeValue}}),Object.defineProperty(e,"checkValuesAgainstBoundaries",{enumerable:!0,get:function(){return s.checkValuesAgainstBoundaries}});var v=xe();Object.defineProperty(e,"Direction",{enumerable:!0,get:function(){return v.Direction}})}(ue)),ue}var Je=xt();function Ke(e,r){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);r&&(s=s.filter(function(v){return Object.getOwnPropertyDescriptor(e,v).enumerable})),n.push.apply(n,s)}return n}function be(e){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?Ke(Object(n),!0).forEach(function(s){Ct(e,s,n[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ke(Object(n)).forEach(function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(n,s))})}return e}function Ct(e,r,n){return r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}var ye=Q("div",{position:"relative",width:"100%"});ye.displayName="Root";ye.displayName="Root";ye.displayName="StyledRoot";var Te=Q("div",function(e){var r=e.$theme,n=e.$value,s=n===void 0?[]:n,v=e.$disabled,S=e.$isDragged,l=r.sizing,p="inherit";return v?p="not-allowed":S?p="grabbing":s.length===1&&(p="pointer"),{paddingTop:l.scale600,paddingBottom:l.scale600,paddingRight:l.scale600,paddingLeft:l.scale600,display:"flex",cursor:p,backgroundColor:r.colors.sliderTrackFill}});Te.displayName="Track";Te.displayName="Track";Te.displayName="StyledTrack";var de=Q("div",function(e){var r=e.$theme,n=e.$value,s=n===void 0?[]:n,v=e.$min,S=e.$max,l=e.$disabled,p=r.colors,F=r.borders,j=r.direction,z=r.borders.useRoundedCorners?F.radius100:0;return{borderTopLeftRadius:z,borderTopRightRadius:z,borderBottomRightRadius:z,borderBottomLeftRadius:z,background:Je.getTrackBackground({values:s,colors:s.length===1?[l?p.borderOpaque:p.primary,l?p.backgroundSecondary:p.borderOpaque]:[l?p.backgroundSecondary:p.borderOpaque,l?p.borderOpaque:p.primary,l?p.backgroundSecondary:p.borderOpaque],min:v||0,max:S||0,rtl:j==="rtl"}),height:"2px",width:"100%",alignSelf:"center",cursor:l?"not-allowed":"inherit"}});de.displayName="InnerTrack";de.displayName="InnerTrack";de.displayName="StyledInnerTrack";var ke=Q("div",function(e){return{width:"4px",height:"2px",backgroundColor:e.$theme.colors.backgroundPrimary,marginLeft:"16px"}});ke.displayName="Mark";ke.displayName="Mark";ke.displayName="StyledMark";var Oe=Q("div",function(e){return be(be({},e.$theme.typography.font200),{},{color:e.$theme.colors.contentPrimary})});Oe.displayName="Tick";Oe.displayName="Tick";Oe.displayName="StyledTick";var we=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}});we.displayName="TickBar";we.displayName="TickBar";we.displayName="StyledTickBar";var Re=Q("div",function(e){var r=e.$theme,n=e.$value,s=n===void 0?[]:n,v=e.$thumbIndex,S=e.$disabled,l=s.length===2&&v===0,p=s.length===2&&v===1;return r.direction==="rtl"&&(p||l)&&(l=!l,p=!p),{height:"24px",width:"24px",borderTopLeftRadius:"24px",borderTopRightRadius:"24px",borderBottomLeftRadius:"24px",borderBottomRightRadius:"24px",display:"flex",justifyContent:"center",alignItems:"center",backgroundColor:S?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:S?"not-allowed":"inherit"}});Re.displayName="Thumb";Re.displayName="Thumb";Re.displayName="StyledThumb";var Se=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}});Se.displayName="InnerThumb";Se.displayName="InnerThumb";Se.displayName="StyledInnerThumb";var Me=Q("div",function(e){var r=e.$disabled,n=e.$theme;return be(be({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"})});Me.displayName="ThumbValue";Me.displayName="ThumbValue";Me.displayName="StyledThumbValue";function Xe(e,r){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);r&&(s=s.filter(function(v){return Object.getOwnPropertyDescriptor(e,v).enumerable})),n.push.apply(n,s)}return n}function Dt(e){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?Xe(Object(n),!0).forEach(function(s){Pt(e,s,n[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Xe(Object(n)).forEach(function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(n,s))})}return e}function Pt(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 s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},X.apply(this,arguments)}function K(e,r){return Ft(e)||Lt(e,r)||At(e,r)||Bt()}function Bt(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
2
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function At(e,r){if(e){if(typeof e=="string")return Ye(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 Ye(e,r)}}function Ye(e,r){(r==null||r>e.length)&&(r=e.length);for(var n=0,s=new Array(r);n<r;n++)s[n]=e[n];return s}function Lt(e,r){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var s=[],v=!0,S=!1,l,p;try{for(n=n.call(e);!(v=(l=n.next()).done)&&(s.push(l.value),!(r&&s.length===r));v=!0);}catch(F){S=!0,p=F}finally{try{!v&&n.return!=null&&n.return()}finally{if(S)throw p}}return s}}function Ft(e){if(Array.isArray(e))return e}var jt=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 zt(e){var r=e.overrides,n=r===void 0?{}:r,s=e.disabled,v=s===void 0?!1:s,S=e.marks,l=S===void 0?!1:S,p=e.onChange,F=p===void 0?function(){}:p,j=e.onFinalChange,z=j===void 0?function(){}:j,E=e.min,y=E===void 0?0:E,d=e.max,t=d===void 0?100:d,a=e.step,c=a===void 0?1:a,f=e.persistentThumb,b=f===void 0?!1:f,k=e.valueToLabel,I=k===void 0?function(Y){return Y}:k,O=e.value,w=_.useContext(vt),M=_.useState(!1),P=K(M,2),R=P[0],B=P[1],C=_.useState(!1),i=K(C,2),o=i[0],u=i[1],h=_.useState(!1),m=K(h,2),g=m[0],T=m[1],$=_.useState(-1),D=K($,2),x=D[0],U=D[1],V=_.useCallback(function(Y){mt(Y)&&T(!0);var N=Y.target.parentNode.firstChild===Y.target?0:1;U(N)},[]),W=_.useCallback(function(Y){g!==!1&&T(!1),U(-1)},[]),A=jt(O),L={$disabled:v,$step:c,$min:y,$max:t,$marks:l,$value:A,$isFocusVisible:g},G=J(n.Root,ye),ne=K(G,2),fe=ne[0],ee=ne[1],he=J(n.Track,Te),ge=K(he,2),pe=ge[0],$e=ge[1],te=J(n.InnerTrack,de),se=K(te,2),ve=se[0],me=se[1],Qe=J(n.Thumb,Re),Ce=K(Qe,2),et=Ce[0],tt=Ce[1],rt=J(n.InnerThumb,Se),De=K(rt,2),nt=De[0],at=De[1],it=J(n.ThumbValue,Me),Pe=K(it,2),ot=Pe[0],st=Pe[1],ut=J(n.Tick,Oe),Be=K(ut,2),Ae=Be[0],Le=Be[1],ct=J(n.TickBar,we),Fe=K(ct,2),lt=Fe[0],dt=Fe[1],ft=J(n.Mark,ke),je=K(ft,2),ht=je[0],gt=je[1];return _.createElement(fe,X({"data-baseweb":"slider"},L,ee,{onFocus:yt(ee,V),onBlur:bt(ee,W)}),_.createElement(Je.Range,X({step:c,min:y,max:t,values:A,disabled:v,onChange:function(N){return F({value:N})},onFinalChange:function(N){return z({value:N})},rtl:w.direction==="rtl",renderTrack:function(N){var re=N.props,q=N.children,ae=N.isDragged;return _.createElement(pe,X({onMouseDown:re.onMouseDown,onTouchStart:re.onTouchStart,$isDragged:ae},L,$e),_.createElement(ve,X({$isDragged:ae,ref:re.ref},L,me),q))},renderThumb:function(N){var re=N.props,q=N.index,ae=N.isDragged,ze=b||(!!q&&o||!q&&R||ae)&&!v;return _.createElement(et,X({},re,{onMouseEnter:function(){q===0?B(!0):u(!0)},onMouseLeave:function(){q===0?B(!1):u(!1)},$thumbIndex:q,$isDragged:ae,style:Dt({},re.style)},L,tt,{$isFocusVisible:g&&x===q}),ze&&_.createElement(ot,X({$thumbIndex:q,$isDragged:ae},L,st),I(A[q])),ze&&_.createElement(nt,X({$thumbIndex:q,$isDragged:ae},L,at)))}},l?{renderMark:function(N){var re=N.props,q=N.index;return _.createElement(ht,X({$markIndex:q},re,L,gt))}}:{})),_.createElement(lt,X({},L,dt),_.createElement(Ae,X({},L,Le),I(y)),_.createElement(Ae,X({},L,Le),I(t))))}const Vt=oe("div",{target:"e10fdlpp0"})({position:"relative",":focus-within:has(:focus-visible)":{"--slider-focused":1}}),Nt=oe("div",{target:"e10fdlpp1"})(({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?`0 0 0 0.2rem ${Ve(r.colors.primary,.5)}`:"none",":focus":{outline:"none"},":focus-visible":{boxShadow:`0 0 0 0.2rem ${Ve(r.colors.primary,.5)}`}})),Ut=oe("div",{target:"e10fdlpp2"})(({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"})),Ht=oe("div",{target:"e10fdlpp3"})({flex:1}),Wt=oe("div",{target:"e10fdlpp4"})(({theme:e})=>({position:"absolute",height:e.spacing.twoXS,left:`calc(${e.sizes.sliderThumb} / 2)`,right:`calc(${e.sizes.sliderThumb} / 2)`})),qt=oe("div",{target:"e10fdlpp5"})(({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 Kt({minLabel:e,maxLabel:r,isHovered:n,isDisabled:s}){return Ie(qt,{"data-testid":"stSliderTickBar",isHovered:n,isDisabled:s,children:[Z("span",{children:e}),Z("span",{children:r})]})}function Xt({disabled:e,element:r,widgetMgr:n,fragmentId:s}){const[v,S]=Et({getStateFromWidgetMgr:Yt,getDefaultStateFromProto:Zt,getCurrStateFromProto:Gt,updateWidgetMgrState:Jt,element:r,widgetMgr:n,fragmentId:s}),[l,p]=_.useState(v),[F,j]=_.useState(!1),[z,E]=_.useState(!1),y=_.useCallback(()=>j(!0),[]),d=_.useCallback(()=>j(!1),[]),t=_.useRef(null),[a]=_.useState([]),[c]=_.useState([]),f=kt(),b=l.map(C=>Ee(C,r)),k=Ee(r.min,r),I=Ee(r.max,r),O=r.label;_.useEffect(()=>{p(v)},[v]);const w=_.useCallback(({value:C})=>{S({value:C,fromUi:!0}),E(!1)},[S]),M=_.useCallback(({value:C})=>{p(C),E(!0)},[]),P=_.useCallback(_.forwardRef(function(i,o){const{$thumbIndex:u}=i,h=u||0;a[h]=o,c[h]||=_.createRef();const m=Ot(i,["role","style","aria-valuemax","aria-valuemin","aria-valuenow","tabIndex","onKeyUp","onKeyDown","onMouseEnter","onMouseLeave","draggable"]),g=b[h];return Z(Nt,{...m,disabled:i.$disabled===!0,isDragged:i.$isDragged===!0,ref:a[h],"aria-valuetext":g,"aria-label":O,children:Z(Ut,{"data-testid":"stSliderThumbValue",disabled:i.$disabled===!0,ref:c[h],children:g})})}),[]);_.useEffect(()=>{c.map((m,g)=>{m.current&&(m.current.innerText=b[g])}),a.map((m,g)=>{m.current&&m.current.setAttribute("aria-valuetext",b[g])});const C=t.current??null,i=a[0].current,o=a[1]?.current,u=c[0].current,h=c[1]?.current;tr(C,i,o,u,h)});const R=_.useCallback(({$disabled:C})=>({height:f.spacing.twoXS,...C?{background:f.colors.darkenedBgMix25}:{}}),[f.colors.darkenedBgMix25,f.spacing.twoXS]),B=_.useCallback(_.forwardRef(function(i,o){const{children:u,...h}=i;return Ie(Ht,{children:[Z(Wt,{ref:o,children:u}),Z(de,{...h,style:R({$disabled:i.$disabled})})]})}),[]);return Ie(Vt,{ref:t,className:"stSlider","data-testid":"stSlider",onMouseEnter:y,onMouseLeave:d,children:[Z($t,{label:r.label,disabled:e,labelVisibility:wt(r.labelVisibility?.value),children:r.help&&Z(Rt,{children:Z(St,{content:r.help,placement:Mt.TOP_RIGHT})})}),Z(zt,{min:r.min,max:r.max,step:r.step,value:er(l,r),onChange:M,onFinalChange:w,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:B,TickBar:{component:Kt,props:{minLabel:k,maxLabel:I,isHovered:F||z,isDisabled:e}}}})]})}function Yt(e,r){return e.getDoubleArrayValue(r)}function Zt(e){return e.default}function Gt(e){return e.value}function Jt(e,r,n,s){r.setDoubleArrayValue(e,n.value,{fromUi:n.fromUi},s)}function Qt(e){const{dataType:r}=e;return r===_e.DataType.DATETIME||r===_e.DataType.DATE||r===_e.DataType.TIME}function Ee(e,r){const{format:n,options:s}=r;return Qt(r)?_t.utc(e/1e3).format(n):s.length>0?Ne.sprintf(n,s[e]):Ne.sprintf(n,e)}function er(e,r){const{min:n,max:s}=r;let v=e[0],S=e.length>1?e[1]:e[0];return v>S&&(v=S),v<n&&(v=n),v>s&&(v=s),S<n&&(S=n),S>s&&(S=s),e.length>1?[v,S]:[v]}function tr(e,r,n,s,v){!e||!r||!s||(ie(e,r,s),n&&v&&(ie(e,n,v),rr(e,r,n,s,v)))}function ie(e,r,n){const s=e.getBoundingClientRect(),v=r.getBoundingClientRect(),S=n.getBoundingClientRect(),l=v.left+v.width/2,p=l-S.width/2<s.left,F=l+S.width/2>s.right;n.style.left=p?"0":"",n.style.right=F?"0":""}function rr(e,r,n,s,v){const l=e.getBoundingClientRect(),p=r.getBoundingClientRect(),F=n.getBoundingClientRect(),j=s.getBoundingClientRect(),z=v.getBoundingClientRect(),E=l.left+l.width/2,y=p.left+p.width/2,d=F.left+F.width/2,t=y-j.width/2>=l.left,a=d+z.width/2<=l.right,c=p.left-j.width>=l.left,f=F.right+z.width<=l.right,b=t?j.width/2:j.width,k=a?z.width/2:z.width,I=y+b;if(d-k-I>24){ie(e,r,s),ie(e,n,v);return}if(c&&f){s.style.left="",s.style.right=`${Math.round(p.width)}px`,v.style.left=`${Math.round(F.width)}px`,v.style.right="";return}y<E?(ie(e,r,s),v.style.left=`${Math.round(y+b+24-d)}px`,v.style.right=""):(ie(e,n,v),s.style.left="",s.style.right=`${-Math.round(d-k-24-y)}px`)}const sr=Tt(_.memo(Xt));export{sr as default};
@@ -1 +1 @@
1
- import{v as U,r as a,a6 as k,u as H,a7 as S,e as B,j as n,l as j,R as O,T as _,P as K,W as $,y as q,a8 as w}from"./index.CD8HuT3N.js";import{u as A}from"./uniqueId.Bh26R_3S.js";import{I as G}from"./InputInstructions.z6sVgyYt.js";import{u as N}from"./useBasicWidgetState.DeK-QJpD.js";import{u as J,a as M,b as Q}from"./useUpdateUiValue.CmT7_nJN.js";import{I as X}from"./input.nzVJphXi.js";import"./FormClearHelper.DHh1GFzm.js";import"./inputUtils.CptNuJwn.js";import"./base-input.CK3UVGp1.js";const Y=U("div",{target:"e1o1zy6o0"})("position:relative;");function Z({disabled:o,element:t,widgetMgr:s,fragmentId:u}){const[r,c]=a.useState(()=>W(s,t)??null),{width:T,elementRef:y}=k(),[i,p]=a.useState(!1),x=a.useCallback(()=>{c(t.default??null),p(!0)},[t.default]),[V,m]=N({getStateFromWidgetMgr:W,getDefaultStateFromProto:tt,getCurrStateFromProto:et,updateWidgetMgrState:ot,element:t,widgetMgr:s,fragmentId:u,onFormCleared:x});J(V,r,c,i);const[C,g]=a.useState(!1),e=H(),[f]=a.useState(()=>A("text_input_")),{placeholder:F,formId:l,icon:d,maxChars:b}=t,h=a.useCallback(()=>{p(!1),m({value:r,fromUi:!0})},[r,m]),v=S({formId:l})?s.allowFormEnterToSubmit(l):i,E=C&&T>e.breakpoints.hideWidgetDetails,z=a.useCallback(()=>{i&&h(),g(!1)},[i,h]),R=a.useCallback(()=>{g(!0)},[]),P=M({formId:l,maxChars:b,setDirty:p,setUiValue:c,setValueWithSource:m}),L=Q(l,h,i,s,u),I=d?.startsWith(":material"),D=I?"lg":"base";return B(Y,{className:"stTextInput","data-testid":"stTextInput",ref:y,children:[n($,{label:t.label,disabled:o,labelVisibility:j(t.labelVisibility?.value),htmlFor:f,children:t.help&&n(O,{children:n(_,{content:t.help,placement:K.TOP_RIGHT})})}),n(X,{value:r??"",placeholder:F,onBlur:z,onFocus:R,onChange:P,onKeyPress:L,"aria-label":t.label,disabled:o,id:f,type:at(t),autoComplete:t.autocomplete,startEnhancer:d&&n(q,{"data-testid":"stTextInputIcon",iconValue:d,size:D}),overrides:{Input:{style:{fontWeight:e.fontWeights.normal,minWidth:0,lineHeight:e.lineHeights.inputWidget,paddingRight:e.spacing.sm,paddingLeft:e.spacing.md,paddingBottom:e.spacing.sm,paddingTop:e.spacing.sm,"::placeholder":{color:e.colors.fadedText60}}},Root:{props:{"data-testid":"stTextInputRootElement"},style:{height:e.sizes.minElementHeight,borderLeftWidth:e.sizes.borderWidth,borderRightWidth:e.sizes.borderWidth,borderTopWidth:e.sizes.borderWidth,borderBottomWidth:e.sizes.borderWidth,paddingLeft:d?e.spacing.sm:0}},StartEnhancer:{style:{paddingLeft:0,paddingRight:0,minWidth:e.iconSizes.lg,color:I?e.colors.fadedText60:"inherit"}}}}),E&&n(G,{dirty:i,value:r??"",maxLength:b,inForm:S({formId:l}),allowEnterToSubmit:v})]})}function W(o,t){return o.getStringValue(t)??null}function tt(o){return o.default??null}function et(o){return o.value??null}function ot(o,t,s,u){t.setStringValue(o,s.value,{fromUi:s.fromUi},u)}function at(o){return o.type===w.Type.PASSWORD?"password":"text"}const mt=a.memo(Z);export{mt as default};
1
+ import{s as U,r as a,a3 as k,u as H,a4 as S,e as B,j as n,l as O,O as j,T as _,P as K,W as $,x as q,a5 as w}from"./index.CAj-7vWz.js";import{u as A}from"./uniqueId.oG4Gvj1v.js";import{I as G}from"./InputInstructions.jhH15PqV.js";import{u as N}from"./useBasicWidgetState.D6sOH6oI.js";import{u as J,a as M,b as Q}from"./useUpdateUiValue.F2R3eTeR.js";import{I as X}from"./input.D4MN_FzN.js";import"./FormClearHelper.BB1Km6eP.js";import"./inputUtils.CptNuJwn.js";import"./base-input.CJGiNqed.js";const Y=U("div",{target:"e1o1zy6o0"})("position:relative;");function Z({disabled:o,element:t,widgetMgr:s,fragmentId:u}){const[r,c]=a.useState(()=>W(s,t)??null),{width:T,elementRef:y}=k(),[i,p]=a.useState(!1),x=a.useCallback(()=>{c(t.default??null),p(!0)},[t.default]),[V,m]=N({getStateFromWidgetMgr:W,getDefaultStateFromProto:tt,getCurrStateFromProto:et,updateWidgetMgrState:ot,element:t,widgetMgr:s,fragmentId:u,onFormCleared:x});J(V,r,c,i);const[C,g]=a.useState(!1),e=H(),[f]=a.useState(()=>A("text_input_")),{placeholder:F,formId:l,icon:d,maxChars:b}=t,h=a.useCallback(()=>{p(!1),m({value:r,fromUi:!0})},[r,m]),E=S({formId:l})?s.allowFormEnterToSubmit(l):i,v=C&&T>e.breakpoints.hideWidgetDetails,z=a.useCallback(()=>{i&&h(),g(!1)},[i,h]),P=a.useCallback(()=>{g(!0)},[]),R=M({formId:l,maxChars:b,setDirty:p,setUiValue:c,setValueWithSource:m}),L=Q(l,h,i,s,u),I=d?.startsWith(":material"),D=I?"lg":"base";return B(Y,{className:"stTextInput","data-testid":"stTextInput",ref:y,children:[n($,{label:t.label,disabled:o,labelVisibility:O(t.labelVisibility?.value),htmlFor:f,children:t.help&&n(j,{children:n(_,{content:t.help,placement:K.TOP_RIGHT})})}),n(X,{value:r??"",placeholder:F,onBlur:z,onFocus:P,onChange:R,onKeyPress:L,"aria-label":t.label,disabled:o,id:f,type:at(t),autoComplete:t.autocomplete,startEnhancer:d&&n(q,{"data-testid":"stTextInputIcon",iconValue:d,size:D}),overrides:{Input:{style:{fontWeight:e.fontWeights.normal,minWidth:0,lineHeight:e.lineHeights.inputWidget,paddingRight:e.spacing.sm,paddingLeft:e.spacing.md,paddingBottom:e.spacing.sm,paddingTop:e.spacing.sm,"::placeholder":{color:e.colors.fadedText60}}},Root:{props:{"data-testid":"stTextInputRootElement"},style:{height:e.sizes.minElementHeight,borderLeftWidth:e.sizes.borderWidth,borderRightWidth:e.sizes.borderWidth,borderTopWidth:e.sizes.borderWidth,borderBottomWidth:e.sizes.borderWidth,paddingLeft:d?e.spacing.sm:0}},StartEnhancer:{style:{paddingLeft:0,paddingRight:0,minWidth:e.iconSizes.lg,color:I?e.colors.fadedText60:"inherit"}}}}),v&&n(G,{dirty:i,value:r??"",maxLength:b,inForm:S({formId:l}),allowEnterToSubmit:E})]})}function W(o,t){return o.getStringValue(t)??null}function tt(o){return o.default??null}function et(o){return o.value??null}function ot(o,t,s,u){t.setStringValue(o,s.value,{fromUi:s.fromUi},u)}function at(o){return o.type===w.Type.PASSWORD?"password":"text"}const mt=a.memo(Z);export{mt as default};
@@ -1 +1 @@
1
- import{r as p,u as T,h as k,j as n,e as C,l as y,S,f as L,T as W,P as B,g as w,t as R,C as E,i as P}from"./index.CD8HuT3N.js";import{u as $}from"./useBasicWidgetState.DeK-QJpD.js";import{S as v,L as X,a as m}from"./checkbox.D8W881TL.js";import"./FormClearHelper.DHh1GFzm.js";function H({element:e,disabled:a,widgetMgr:s,fragmentId:d}){const[f,g]=$({getStateFromWidgetMgr:M,getDefaultStateFromProto:V,getCurrStateFromProto:I,updateWidgetMgrState:j,element:e,widgetMgr:s,fragmentId:d}),x=p.useCallback(i=>{g({value:i.target.checked,fromUi:!0})},[g]),t=T(),{colors:o,spacing:h,sizes:r}=t,u=k(t),b=a?o.fadedText40:o.bodyText;return n(P,{className:"row-widget stCheckbox","data-testid":"stCheckbox",children:n(v,{checked:f,disabled:a,onChange:x,"aria-label":e.label,checkmarkType:e.type===E.StyleType.TOGGLE?m.toggle:m.default,labelPlacement:X.right,overrides:{Root:{style:({$isFocusVisible:i})=>({marginBottom:h.none,marginTop:h.none,backgroundColor:i?o.darkenedBgMix25:"",display:"flex",alignItems:"start"})},Toggle:{style:({$checked:i})=>{let c=u?o.bgColor:o.bodyText;return a&&(c=u?o.gray70:o.gray90),{width:`calc(${r.checkbox} - ${t.spacing.twoXS})`,height:`calc(${r.checkbox} - ${t.spacing.twoXS})`,transform:i?`translateX(${r.checkbox})`:"",backgroundColor:c,boxShadow:""}}},ToggleTrack:{style:({$checked:i,$isHovered:c})=>{let l=o.fadedText40;return c&&!a&&(l=o.fadedText20),i&&!a&&(l=o.primary),{marginRight:0,marginLeft:0,marginBottom:0,marginTop:t.spacing.twoXS,paddingLeft:t.spacing.threeXS,paddingRight:t.spacing.threeXS,width:`calc(2 * ${r.checkbox})`,minWidth:`calc(2 * ${r.checkbox})`,height:r.checkbox,minHeight:r.checkbox,borderBottomLeftRadius:t.radii.full,borderTopLeftRadius:t.radii.full,borderBottomRightRadius:t.radii.full,borderTopRightRadius:t.radii.full,backgroundColor:l}}},Checkmark:{style:({$isFocusVisible:i,$checked:c})=>{const l=c&&!a?o.primary:o.fadedText40;return{outline:0,width:r.checkbox,height:r.checkbox,marginTop:t.spacing.twoXS,marginLeft:0,marginBottom:0,boxShadow:i&&c?`0 0 0 0.2rem ${R(o.primary,.5)}`:"",borderLeftWidth:r.borderWidth,borderRightWidth:r.borderWidth,borderTopWidth:r.borderWidth,borderBottomWidth:r.borderWidth,borderLeftColor:l,borderRightColor:l,borderTopColor:l,borderBottomColor:l}}},Label:{style:{lineHeight:t.lineHeights.small,paddingLeft:t.spacing.sm,position:"relative",color:b}}},children:C(w,{visibility:y(e.labelVisibility?.value),"data-testid":"stWidgetLabel",children:[n(S,{source:e.label,allowHTML:!1,isLabel:!0,largerLabel:!0}),e.help&&n(L,{color:b,children:n(W,{content:e.help,placement:B.TOP_RIGHT})})]})})})}function M(e,a){return e.getBoolValue(a)}function V(e){return e.default??null}function I(e){return e.value??null}function j(e,a,s,d){a.setBoolValue(e,s.value,{fromUi:s.fromUi},d)}const z=p.memo(H);export{z as default};
1
+ import{r as p,u as T,h as k,j as n,e as C,l as y,S,f as L,T as W,P as B,g as w,t as R,C as E,i as P}from"./index.CAj-7vWz.js";import{u as $}from"./useBasicWidgetState.D6sOH6oI.js";import{S as v,L as X,a as m}from"./checkbox.Cpdd482O.js";import"./FormClearHelper.BB1Km6eP.js";function H({element:e,disabled:a,widgetMgr:s,fragmentId:d}){const[f,g]=$({getStateFromWidgetMgr:M,getDefaultStateFromProto:V,getCurrStateFromProto:I,updateWidgetMgrState:j,element:e,widgetMgr:s,fragmentId:d}),x=p.useCallback(i=>{g({value:i.target.checked,fromUi:!0})},[g]),t=T(),{colors:o,spacing:h,sizes:r}=t,u=k(t),b=a?o.fadedText40:o.bodyText;return n(P,{className:"row-widget stCheckbox","data-testid":"stCheckbox",children:n(v,{checked:f,disabled:a,onChange:x,"aria-label":e.label,checkmarkType:e.type===E.StyleType.TOGGLE?m.toggle:m.default,labelPlacement:X.right,overrides:{Root:{style:({$isFocusVisible:i})=>({marginBottom:h.none,marginTop:h.none,backgroundColor:i?o.darkenedBgMix25:"",display:"flex",alignItems:"start"})},Toggle:{style:({$checked:i})=>{let c=u?o.bgColor:o.bodyText;return a&&(c=u?o.gray70:o.gray90),{width:`calc(${r.checkbox} - ${t.spacing.twoXS})`,height:`calc(${r.checkbox} - ${t.spacing.twoXS})`,transform:i?`translateX(${r.checkbox})`:"",backgroundColor:c,boxShadow:""}}},ToggleTrack:{style:({$checked:i,$isHovered:c})=>{let l=o.fadedText40;return c&&!a&&(l=o.fadedText20),i&&!a&&(l=o.primary),{marginRight:0,marginLeft:0,marginBottom:0,marginTop:t.spacing.twoXS,paddingLeft:t.spacing.threeXS,paddingRight:t.spacing.threeXS,width:`calc(2 * ${r.checkbox})`,minWidth:`calc(2 * ${r.checkbox})`,height:r.checkbox,minHeight:r.checkbox,borderBottomLeftRadius:t.radii.full,borderTopLeftRadius:t.radii.full,borderBottomRightRadius:t.radii.full,borderTopRightRadius:t.radii.full,backgroundColor:l}}},Checkmark:{style:({$isFocusVisible:i,$checked:c})=>{const l=c&&!a?o.primary:o.fadedText40;return{outline:0,width:r.checkbox,height:r.checkbox,marginTop:t.spacing.twoXS,marginLeft:0,marginBottom:0,boxShadow:i&&c?`0 0 0 0.2rem ${R(o.primary,.5)}`:"",borderLeftWidth:r.borderWidth,borderRightWidth:r.borderWidth,borderTopWidth:r.borderWidth,borderBottomWidth:r.borderWidth,borderLeftColor:l,borderRightColor:l,borderTopColor:l,borderBottomColor:l}}},Label:{style:{lineHeight:t.lineHeights.small,paddingLeft:t.spacing.sm,position:"relative",color:b}}},children:C(w,{visibility:y(e.labelVisibility?.value),"data-testid":"stWidgetLabel",children:[n(S,{source:e.label,allowHTML:!1,isLabel:!0,largerLabel:!0}),e.help&&n(L,{color:b,children:n(W,{content:e.help,placement:B.TOP_RIGHT})})]})})})}function M(e,a){return e.getBoolValue(a)}function V(e){return e.default??null}function I(e){return e.value??null}function j(e,a,s,d){a.setBoolValue(e,s.value,{fromUi:s.fromUi},d)}const z=p.memo(H);export{z as default};
@@ -1 +1 @@
1
- import{v as c,r as a,j as o,e as u,ah as S,ai as f,S as g}from"./index.CD8HuT3N.js";const x=c("div",{target:"e8cs83k0"})(({theme:e,cache:n})=>({...n?{paddingBottom:e.spacing.lg,background:`linear-gradient(to bottom, ${e.colors.bgColor} 0%, ${e.colors.bgColor} 80%, transparent 100%)`}:null})),T=c("div",{target:"e8cs83k1"})({display:"flex",alignItems:"center",width:"100%"}),$=c("div",{target:"e8cs83k2"})(({theme:e})=>({display:"flex",gap:e.spacing.sm,alignItems:"baseline"})),h=c("div",{target:"e8cs83k3"})(({theme:e})=>({opacity:.6,fontSize:e.fontSizes.sm})),y=e=>{const n=Math.floor(e/3600),t=Math.floor(e%3600/60),s=e%60;if(n===0&&t===0)return`(${s.toFixed(1)} seconds)`;if(n===0){const d=`${t} minute${t===1?"":"s"}`,m=s===0?"":`, ${s.toFixed(1)} seconds`;return`(${d}${m})`}const l=`${n} hour${n===1?"":"s"}`,r=t===0?"":`, ${t} minute${t===1?"":"s"}`,i=s===0?"":`, ${s.toFixed(1)} seconds`;return`(${l}${r}${i})`};function v({element:e}){const{cache:n,showTime:t}=e,[s,l]=a.useState(0),r=a.useRef(null);return a.useEffect(()=>{if(!t)return;r.current=Date.now();const i=()=>{if(r.current!==null){const p=(Date.now()-r.current)/1e3;l(p)}};i();const d=setInterval(i,100);return()=>clearInterval(d)},[t]),o(x,{className:S({stSpinner:!0,stCacheSpinner:n}),"data-testid":"stSpinner",cache:n,children:u(T,{children:[o(f,{size:"base",margin:"0 md 0 0",padding:"0"}),u($,{children:[o(g,{source:e.text,allowHTML:!1}),t&&o(h,{children:y(s)})]})]})})}const k=a.memo(v);export{k as default};
1
+ import{s as c,r as a,j as o,e as u,ae as f,af as S,S as g}from"./index.CAj-7vWz.js";const x=c("div",{target:"e8cs83k0"})(({theme:e,cache:n})=>({...n?{paddingBottom:e.spacing.lg,background:`linear-gradient(to bottom, ${e.colors.bgColor} 0%, ${e.colors.bgColor} 80%, transparent 100%)`}:null})),T=c("div",{target:"e8cs83k1"})({display:"flex",alignItems:"center",width:"100%"}),$=c("div",{target:"e8cs83k2"})(({theme:e})=>({display:"flex",gap:e.spacing.sm,alignItems:"baseline"})),h=c("div",{target:"e8cs83k3"})(({theme:e})=>({opacity:.6,fontSize:e.fontSizes.sm})),y=e=>{const n=Math.floor(e/3600),t=Math.floor(e%3600/60),s=e%60;if(n===0&&t===0)return`(${s.toFixed(1)} seconds)`;if(n===0){const d=`${t} minute${t===1?"":"s"}`,m=s===0?"":`, ${s.toFixed(1)} seconds`;return`(${d}${m})`}const l=`${n} hour${n===1?"":"s"}`,r=t===0?"":`, ${t} minute${t===1?"":"s"}`,i=s===0?"":`, ${s.toFixed(1)} seconds`;return`(${l}${r}${i})`};function b({element:e}){const{cache:n,showTime:t}=e,[s,l]=a.useState(0),r=a.useRef(null);return a.useEffect(()=>{if(!t)return;r.current=Date.now();const i=()=>{if(r.current!==null){const p=(Date.now()-r.current)/1e3;l(p)}};i();const d=setInterval(i,100);return()=>clearInterval(d)},[t]),o(x,{className:f({stSpinner:!0,stCacheSpinner:n}),"data-testid":"stSpinner",cache:n,children:u(T,{children:[o(S,{size:"base",margin:"0 md 0 0",padding:"0"}),u($,{children:[o(g,{source:e.text,allowHTML:!1}),t&&o(h,{children:y(s)})]})]})})}const v=a.memo(b);export{v as default};
@@ -1 +1 @@
1
- import{v as l,r as d,L as p,u,j as a,a as f,P as x,e as b,y as k,S as L}from"./index.CD8HuT3N.js";const v=l("div",{target:"e11lneww0"})({display:"flex",flexDirection:"column",width:"100%"}),w=l("a",{target:"e11lneww1"})(({disabled:n,isCurrentPage:e,theme:o})=>({textDecoration:"none",width:"100%",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"flex-start",gap:o.spacing.sm,borderRadius:o.radii.default,paddingLeft:o.spacing.sm,paddingRight:o.spacing.sm,marginTop:o.spacing.threeXS,marginBottom:o.spacing.threeXS,lineHeight:o.lineHeights.menuItem,backgroundColor:e?o.colors.darkenedBgMix15:"transparent","&:hover":{backgroundColor:e?o.colors.darkenedBgMix25:o.colors.darkenedBgMix15},"&:active,&:visited,&:hover":{textDecoration:"none"},"&:focus":{outline:"none"},"&:focus-visible":{backgroundColor:o.colors.darkenedBgMix15},"@media print":{paddingLeft:o.spacing.none},...n?{borderColor:o.colors.borderColor,backgroundColor:o.colors.transparent,color:o.colors.fadedText40,cursor:"not-allowed","&:hover":{color:o.colors.fadedText40,backgroundColor:o.colors.transparent}}:{}})),C=l("span",{target:"e11lneww2"})(({disabled:n,theme:e})=>({color:e.colors.bodyText,overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",display:"table-cell",...n?{borderColor:e.colors.borderColor,backgroundColor:e.colors.transparent,color:e.colors.fadedText40,cursor:"not-allowed"}:{}}));function T(n){const{onPageChange:e,currentPageScriptHash:o}=d.useContext(p),{colors:i}=u(),{disabled:t,element:r}=n,s=o===r.pageScriptHash,g=c=>{r.external?t&&c.preventDefault():(c.preventDefault(),t||e(r.pageScriptHash))};return a("div",{className:"stPageLink","data-testid":"stPageLink",children:a(f,{help:r.help,placement:x.TOP_RIGHT,containerWidth:!0,children:a(v,{children:b(w,{"data-testid":"stPageLink-NavLink",disabled:t,isCurrentPage:s,href:r.page,target:r.external?"_blank":"",rel:"noreferrer",onClick:g,children:[r.icon&&a(k,{size:"lg",color:t?i.fadedText40:i.bodyText,iconValue:r.icon}),a(C,{disabled:t,children:a(L,{source:r.label,allowHTML:!1,isLabel:!0,boldLabel:s,largerLabel:!0,disableLinks:!0})})]})})})})}const S=d.memo(T);export{S as default};
1
+ import{s as l,r as d,L as p,u,j as a,a as f,P as x,e as b,x as k,S as L}from"./index.CAj-7vWz.js";const w=l("div",{target:"e11lneww0"})({display:"flex",flexDirection:"column",width:"100%"}),C=l("a",{target:"e11lneww1"})(({disabled:n,isCurrentPage:e,theme:o})=>({textDecoration:"none",width:"100%",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"flex-start",gap:o.spacing.sm,borderRadius:o.radii.default,paddingLeft:o.spacing.sm,paddingRight:o.spacing.sm,marginTop:o.spacing.threeXS,marginBottom:o.spacing.threeXS,lineHeight:o.lineHeights.menuItem,backgroundColor:e?o.colors.darkenedBgMix15:"transparent","&:hover":{backgroundColor:e?o.colors.darkenedBgMix25:o.colors.darkenedBgMix15},"&:active,&:visited,&:hover":{textDecoration:"none"},"&:focus":{outline:"none"},"&:focus-visible":{backgroundColor:o.colors.darkenedBgMix15},"@media print":{paddingLeft:o.spacing.none},...n?{borderColor:o.colors.borderColor,backgroundColor:o.colors.transparent,color:o.colors.fadedText40,cursor:"not-allowed","&:hover":{color:o.colors.fadedText40,backgroundColor:o.colors.transparent}}:{}})),v=l("span",{target:"e11lneww2"})(({disabled:n,theme:e})=>({color:e.colors.bodyText,overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",display:"table-cell",...n?{borderColor:e.colors.borderColor,backgroundColor:e.colors.transparent,color:e.colors.fadedText40,cursor:"not-allowed"}:{}}));function T(n){const{onPageChange:e,currentPageScriptHash:o}=d.useContext(p),{colors:i}=u(),{disabled:t,element:r}=n,s=o===r.pageScriptHash,g=c=>{r.external?t&&c.preventDefault():(c.preventDefault(),t||e(r.pageScriptHash))};return a("div",{className:"stPageLink","data-testid":"stPageLink",children:a(f,{help:r.help,placement:x.TOP_RIGHT,containerWidth:!0,children:a(w,{children:b(C,{"data-testid":"stPageLink-NavLink",disabled:t,isCurrentPage:s,href:r.page,target:r.external?"_blank":"",rel:"noreferrer",onClick:g,children:[r.icon&&a(k,{size:"lg",color:t?i.fadedText40:i.bodyText,iconValue:r.icon}),a(v,{disabled:t,children:a(L,{source:r.label,allowHTML:!1,isLabel:!0,boldLabel:s,largerLabel:!0,disableLinks:!0})})]})})})})}const S=d.memo(T);export{S as default};
@@ -0,0 +1 @@
1
+ import{s as i,Z as m,r as c,j as n,ao as p}from"./index.CAj-7vWz.js";import{P as f,R as d}from"./Particles.DUsputn1.js";const g=""+new URL("../media/balloon-0.Czj7AKwE.png",import.meta.url).href,B=""+new URL("../media/balloon-1.CNvFFrND.png",import.meta.url).href,L=""+new URL("../media/balloon-2.DTvC6B1t.png",import.meta.url).href,h=""+new URL("../media/balloon-3.CgSk4tbL.png",import.meta.url).href,u=""+new URL("../media/balloon-4.mbtFrzxf.png",import.meta.url).href,x=""+new URL("../media/balloon-5.CSwkUfRA.png",import.meta.url).href,t=300,e=121,s=20,A=80,_=1e3,I=m("from{transform:translateY(calc(100vh + ",t,"px));}to{transform:translateY(0);}"),M=i("img",{target:"eosrfo90"})(({theme:o})=>({position:"fixed",top:`${-t}px`,marginLeft:`${-e/2}px`,zIndex:o.zIndices.balloons,left:`${Math.random()*(A-s)+s}vw`,animationDelay:`${Math.random()*_}ms`,height:`${t}px`,width:`${e}px`,pointerEvents:"none",animationDuration:"750ms",animationName:I,animationTimingFunction:"ease-in",animationDirection:"normal",animationIterationCount:1,opacity:1})),b=30,l=[g,B,L,h,u,x],w=l.length,E=({particleType:o,resourceCrossOriginMode:r})=>{const a=l[o];return n(M,{src:a,crossOrigin:p(r,a)})},N=({scriptRunId:o})=>n(d,{children:n(f,{className:"stBalloons","data-testid":"stBalloons",scriptRunId:o,numParticleTypes:w,numParticles:b,ParticleComponent:E})}),P=c.memo(N);export{b as NUM_BALLOONS,P as default};
@@ -1,2 +1,2 @@
1
- import{p as v,r as l,q as k,s as S,A as p}from"./index.CD8HuT3N.js";import{R as C,I as w,g as J,B as M}from"./base-input.CK3UVGp1.js";function _(e){"@babel/helpers - typeof";return _=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_(e)}var U=["Root","StartEnhancer","EndEnhancer"],Z=["startEnhancer","endEnhancer","overrides"];function f(){return f=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},f.apply(this,arguments)}function O(e,t){return V(e)||Q(e,t)||K(e,t)||G()}function G(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
1
+ import{o as v,r as l,p as k,q as S,A as p}from"./index.CAj-7vWz.js";import{R as C,I as w,g as J,B as M}from"./base-input.CJGiNqed.js";function _(e){"@babel/helpers - typeof";return _=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_(e)}var U=["Root","StartEnhancer","EndEnhancer"],Z=["startEnhancer","endEnhancer","overrides"];function f(){return f=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},f.apply(this,arguments)}function O(e,t){return V(e)||Q(e,t)||K(e,t)||G()}function G(){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 K(e,t){if(e){if(typeof e=="string")return j(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return j(e,t)}}function j(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Q(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],o=!0,a=!1,i,u;try{for(r=r.call(e);!(o=(i=r.next()).done)&&(n.push(i.value),!(t&&n.length===t));o=!0);}catch(b){a=!0,u=b}finally{try{!o&&r.return!=null&&r.return()}finally{if(a)throw u}}return n}}function V(e){if(Array.isArray(e))return e}function I(e,t){if(e==null)return{};var r=X(e,t),n,o;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)n=a[o],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function X(e,t){if(e==null)return{};var r={},n=Object.keys(e),o,a;for(a=0;a<n.length;a++)o=n[a],!(t.indexOf(o)>=0)&&(r[o]=e[o]);return r}function Y(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ee(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function te(e,t,r){return t&&ee(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function re(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&m(e,t)}function m(e,t){return m=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},m(e,t)}function ne(e){var t=ae();return function(){var n=h(e),o;if(t){var a=h(this).constructor;o=Reflect.construct(n,arguments,a)}else o=n.apply(this,arguments);return oe(this,o)}}function oe(e,t){if(t&&(_(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return y(e)}function y(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ae(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function h(e){return h=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},h(e)}function d(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var ie=function(e){re(r,e);var t=ne(r);function r(){var n;Y(this,r);for(var o=arguments.length,a=new Array(o),i=0;i<o;i++)a[i]=arguments[i];return n=t.call.apply(t,[this].concat(a)),d(y(n),"state",{isFocused:n.props.autoFocus||!1}),d(y(n),"onFocus",function(u){n.setState({isFocused:!0}),n.props.onFocus(u)}),d(y(n),"onBlur",function(u){n.setState({isFocused:!1}),n.props.onBlur(u)}),n}return te(r,[{key:"render",value:function(){var o=this.props,a=o.startEnhancer,i=o.endEnhancer,u=o.overrides,b=u.Root,A=u.StartEnhancer,B=u.EndEnhancer,F=I(u,U),T=I(o,Z),x=v(b,C),g=O(x,2),$=g[0],N=g[1],D=v(A,w),E=O(D,2),W=E[0],q=E[1],z=v(B,w),P=O(z,2),H=P[0],L=P[1],c=J(this.props,this.state);return l.createElement($,f({"data-baseweb":"input"},c,N,{$adjoined:R(a,i),$hasIconTrailing:this.props.clearable||this.props.type=="password"}),s(a)&&l.createElement(W,f({},c,q,{$position:S.start}),typeof a=="function"?a(c):a),l.createElement(M,f({},T,{overrides:F,adjoined:R(a,i),onFocus:this.onFocus,onBlur:this.onBlur})),s(i)&&l.createElement(H,f({},c,L,{$position:S.end}),typeof i=="function"?i(c):i))}}]),r}(l.Component);d(ie,"defaultProps",{autoComplete:"on",autoFocus:!1,disabled:!1,name:"",onBlur:function(){},onFocus:function(){},overrides:{},required:!1,size:k.default,startEnhancer:null,endEnhancer:null,clearable:!1,type:"text",readOnly:!1});function R(e,t){return s(e)&&s(t)?p.both:s(e)?p.left:s(t)?p.right:p.none}function s(e){return!!(e||e===0)}export{ie as I};
@@ -1 +1 @@
1
- import{c as p,e as c}from"./es6.B8zRNPZ-.js";import"./index.CD8HuT3N.js";const{File:n,Blob:_,DOMException:s}=p,{INVALID:z,GONE:r,MISMATCH:w,MOD_ERR:b,SYNTAX:a,SECURITY:I,DISALLOWED:m}=c;class g{constructor(e,i){this.fileHandle=e,this.file=i,this.size=i.size,this.position=0}write(e){let i=this.file;if(typeof e=="object"){if(e.type==="write"){if(Number.isInteger(e.position)&&e.position>=0&&(this.position=e.position,this.size<e.position&&(this.file=new n([this.file,new ArrayBuffer(e.position-this.size)],this.file.name,this.file))),!("data"in e))throw new s(...a("write requires a data argument"));e=e.data}else if(e.type==="seek")if(Number.isInteger(e.position)&&e.position>=0){if(this.size<e.position)throw new s(...z);this.position=e.position;return}else throw new s(...a("seek requires a position argument"));else if(e.type==="truncate")if(Number.isInteger(e.size)&&e.size>=0){i=e.size<this.size?new n([i.slice(0,e.size)],i.name,i):new n([i,new Uint8Array(e.size-this.size)],i.name),this.size=i.size,this.position>i.size&&(this.position=i.size),this.file=i;return}else throw new s(...a("truncate requires a size argument"))}e=new _([e]);let t=this.file;const o=t.slice(0,this.position),y=t.slice(this.position+e.size);let l=this.position-o.size;l<0&&(l=0),t=new n([o,new Uint8Array(l),e,y],t.name),this.size=t.size,this.position+=e.size,this.file=t}close(){if(this.fileHandle._deleted)throw new s(...r);this.fileHandle._file=this.file,this.file=this.position=this.size=null,this.fileHandle.onclose&&this.fileHandle.onclose(this.fileHandle)}}class f{constructor(e="",i=new n([],e),t=!0){this._file=i,this.name=e,this.kind="file",this._deleted=!1,this.writable=t,this.readable=!0}async getFile(){if(this._deleted)throw new s(...r);return this._file}async createWritable(e){if(!this.writable)throw new s(...m);if(this._deleted)throw new s(...r);const i=e.keepExistingData?await this.getFile():new n([],this.name);return new g(this,i)}async isSameEntry(e){return this===e}async _destroy(){this._deleted=!0,this._file=null}}class h{constructor(e,i=!0){this.name=e,this.kind="directory",this._deleted=!1,this._entries={},this.writable=i,this.readable=!0}async*entries(){if(this._deleted)throw new s(...r);yield*Object.entries(this._entries)}async isSameEntry(e){return this===e}async getDirectoryHandle(e,i){if(this._deleted)throw new s(...r);const t=this._entries[e];if(t){if(t instanceof f)throw new s(...w);return t}else{if(i.create)return this._entries[e]=new h(e);throw new s(...r)}}async getFileHandle(e,i){const t=this._entries[e],o=t instanceof f;if(t&&o)return t;if(t&&!o)throw new s(...w);if(!t&&!i.create)throw new s(...r);if(!t&&i.create)return this._entries[e]=new f(e)}async removeEntry(e,i){const t=this._entries[e];if(!t)throw new s(...r);await t._destroy(i.recursive),delete this._entries[e]}async _destroy(e){for(let i of Object.values(this._entries)){if(!e)throw new s(...b);await i._destroy(e)}this._entries={},this._deleted=!0}}const u=new h(""),A=()=>u;export{f as FileHandle,h as FolderHandle,g as Sink,A as default};
1
+ import{c as p,e as c}from"./es6.BJcsVXQ0.js";import"./index.CAj-7vWz.js";const{File:n,Blob:_,DOMException:s}=p,{INVALID:z,GONE:r,MISMATCH:w,MOD_ERR:b,SYNTAX:a,SECURITY:I,DISALLOWED:m}=c;class g{constructor(e,i){this.fileHandle=e,this.file=i,this.size=i.size,this.position=0}write(e){let i=this.file;if(typeof e=="object"){if(e.type==="write"){if(Number.isInteger(e.position)&&e.position>=0&&(this.position=e.position,this.size<e.position&&(this.file=new n([this.file,new ArrayBuffer(e.position-this.size)],this.file.name,this.file))),!("data"in e))throw new s(...a("write requires a data argument"));e=e.data}else if(e.type==="seek")if(Number.isInteger(e.position)&&e.position>=0){if(this.size<e.position)throw new s(...z);this.position=e.position;return}else throw new s(...a("seek requires a position argument"));else if(e.type==="truncate")if(Number.isInteger(e.size)&&e.size>=0){i=e.size<this.size?new n([i.slice(0,e.size)],i.name,i):new n([i,new Uint8Array(e.size-this.size)],i.name),this.size=i.size,this.position>i.size&&(this.position=i.size),this.file=i;return}else throw new s(...a("truncate requires a size argument"))}e=new _([e]);let t=this.file;const o=t.slice(0,this.position),y=t.slice(this.position+e.size);let l=this.position-o.size;l<0&&(l=0),t=new n([o,new Uint8Array(l),e,y],t.name),this.size=t.size,this.position+=e.size,this.file=t}close(){if(this.fileHandle._deleted)throw new s(...r);this.fileHandle._file=this.file,this.file=this.position=this.size=null,this.fileHandle.onclose&&this.fileHandle.onclose(this.fileHandle)}}class f{constructor(e="",i=new n([],e),t=!0){this._file=i,this.name=e,this.kind="file",this._deleted=!1,this.writable=t,this.readable=!0}async getFile(){if(this._deleted)throw new s(...r);return this._file}async createWritable(e){if(!this.writable)throw new s(...m);if(this._deleted)throw new s(...r);const i=e.keepExistingData?await this.getFile():new n([],this.name);return new g(this,i)}async isSameEntry(e){return this===e}async _destroy(){this._deleted=!0,this._file=null}}class h{constructor(e,i=!0){this.name=e,this.kind="directory",this._deleted=!1,this._entries={},this.writable=i,this.readable=!0}async*entries(){if(this._deleted)throw new s(...r);yield*Object.entries(this._entries)}async isSameEntry(e){return this===e}async getDirectoryHandle(e,i){if(this._deleted)throw new s(...r);const t=this._entries[e];if(t){if(t instanceof f)throw new s(...w);return t}else{if(i.create)return this._entries[e]=new h(e);throw new s(...r)}}async getFileHandle(e,i){const t=this._entries[e],o=t instanceof f;if(t&&o)return t;if(t&&!o)throw new s(...w);if(!t&&!i.create)throw new s(...r);if(!t&&i.create)return this._entries[e]=new f(e)}async removeEntry(e,i){const t=this._entries[e];if(!t)throw new s(...r);await t._destroy(i.recursive),delete this._entries[e]}async _destroy(e){for(let i of Object.values(this._entries)){if(!e)throw new s(...b);await i._destroy(e)}this._entries={},this._deleted=!0}}const u=new h(""),A=()=>u;export{f as FileHandle,h as FolderHandle,g as Sink,A as default};