streamlit 1.49.0__py3-none-any.whl → 1.50.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- streamlit/column_config.py +2 -0
- streamlit/commands/navigation.py +3 -1
- streamlit/components/v1/custom_component.py +17 -42
- streamlit/config.py +306 -0
- streamlit/connections/base_connection.py +4 -2
- streamlit/dataframe_util.py +3 -2
- streamlit/delta_generator.py +2 -3
- streamlit/elements/arrow.py +63 -43
- streamlit/elements/deck_gl_json_chart.py +1 -0
- streamlit/elements/form.py +6 -6
- streamlit/elements/graphviz_chart.py +23 -6
- streamlit/elements/iframe.py +0 -2
- streamlit/elements/image.py +10 -9
- streamlit/elements/layouts.py +58 -11
- streamlit/elements/lib/built_in_chart_utils.py +95 -29
- streamlit/elements/lib/column_config_utils.py +5 -0
- streamlit/elements/lib/column_types.py +563 -144
- streamlit/elements/lib/dialog.py +1 -0
- streamlit/elements/lib/layout_utils.py +4 -4
- streamlit/elements/lib/pandas_styler_utils.py +30 -14
- streamlit/elements/lib/utils.py +17 -5
- streamlit/elements/map.py +1 -3
- streamlit/elements/media.py +2 -0
- streamlit/elements/metric.py +10 -32
- streamlit/elements/plotly_chart.py +17 -9
- streamlit/elements/pyplot.py +6 -6
- streamlit/elements/vega_charts.py +110 -44
- streamlit/elements/widgets/audio_input.py +48 -0
- streamlit/elements/widgets/button.py +27 -25
- streamlit/elements/widgets/button_group.py +1 -0
- streamlit/elements/widgets/camera_input.py +1 -0
- streamlit/elements/widgets/chat.py +1 -0
- streamlit/elements/widgets/checkbox.py +1 -0
- streamlit/elements/widgets/color_picker.py +1 -0
- streamlit/elements/widgets/data_editor.py +6 -5
- streamlit/elements/widgets/file_uploader.py +1 -0
- streamlit/elements/widgets/multiselect.py +10 -0
- streamlit/elements/widgets/number_input.py +3 -0
- streamlit/elements/widgets/radio.py +1 -0
- streamlit/elements/widgets/select_slider.py +1 -0
- streamlit/elements/widgets/selectbox.py +4 -0
- streamlit/elements/widgets/slider.py +1 -0
- streamlit/elements/widgets/text_widgets.py +6 -0
- streamlit/elements/widgets/time_widgets.py +9 -0
- streamlit/elements/write.py +1 -17
- streamlit/git_util.py +65 -43
- streamlit/material_icon_names.py +1 -1
- streamlit/proto/Arrow_pb2.py +10 -8
- streamlit/proto/Arrow_pb2.pyi +31 -2
- streamlit/proto/AudioInput_pb2.py +2 -2
- streamlit/proto/AudioInput_pb2.pyi +6 -2
- streamlit/proto/Block_pb2.py +11 -11
- streamlit/proto/Block_pb2.pyi +5 -0
- streamlit/proto/NewSession_pb2.py +18 -16
- streamlit/proto/NewSession_pb2.pyi +135 -2
- streamlit/runtime/app_session.py +18 -5
- streamlit/runtime/theme_util.py +148 -0
- streamlit/static/index.html +2 -2
- streamlit/static/manifest.json +221 -221
- streamlit/static/static/css/index.CHEnSPGk.css +1 -0
- streamlit/static/static/css/{index.C8X8rNzw.css → index.CIiu7Ygf.css} +1 -1
- streamlit/static/static/js/{ErrorOutline.esm.u9XvzxL8.js → ErrorOutline.esm.DUpR0_Ka.js} +1 -1
- streamlit/static/static/js/{FileDownload.esm.CaRyZ-b2.js → FileDownload.esm.CN4j9-1w.js} +1 -1
- streamlit/static/static/js/{FileHelper.Dk2SwIi3.js → FileHelper.CaIUKG91.js} +1 -1
- streamlit/static/static/js/{FormClearHelper.l_UPPvkg.js → FormClearHelper.DTcdrasw.js} +1 -1
- streamlit/static/static/js/{Hooks.BxrVEftw.js → Hooks.BRba_Own.js} +1 -1
- streamlit/static/static/js/InputInstructions.xnSDuYeQ.js +1 -0
- streamlit/static/static/js/{Particles.DkY6FDnc.js → Particles.CElH0XX2.js} +1 -1
- streamlit/static/static/js/{ProgressBar.BPtSM82n.js → ProgressBar.DetlP5aY.js} +2 -2
- streamlit/static/static/js/Toolbar.C77ar7rq.js +1 -0
- streamlit/static/static/js/{base-input.egUI4LjJ.js → base-input.BQft14La.js} +3 -3
- streamlit/static/static/js/{checkbox.ButpszcE.js → checkbox.yZOfXCeX.js} +1 -1
- streamlit/static/static/js/{createSuper.DYJA5xa6.js → createSuper.Dh9w1cs8.js} +1 -1
- streamlit/static/static/js/data-grid-overlay-editor.DcuHuCyW.js +1 -0
- streamlit/static/static/js/{downloader.B3TjsSPZ.js → downloader.MeHtkq8r.js} +1 -1
- streamlit/static/static/js/{es6.BYSNuG4D.js → es6.VpBPGCnM.js} +2 -2
- streamlit/static/static/js/{iframeResizer.contentWindow.CNPHJsF2.js → iframeResizer.contentWindow.yMw_ARIL.js} +1 -1
- streamlit/static/static/js/{index.DgpIMUsr.js → index.64ejlaaT.js} +1 -1
- streamlit/static/static/js/{index.BBnWuh07.js → index.6xX1278W.js} +90 -91
- streamlit/static/static/js/index.B-hiXRzw.js +1 -0
- streamlit/static/static/js/{index.DtwkPJs5.js → index.B0H9IXUJ.js} +47 -47
- streamlit/static/static/js/{index.0tDq1WXk.js → index.B4cAbHP6.js} +1 -1
- streamlit/static/static/js/{index.CFjU0x00.js → index.B4dUQfni.js} +1 -1
- streamlit/static/static/js/{index.BrD9sbpx.js → index.BPQo7BKk.js} +1 -1
- streamlit/static/static/js/index.Baqa90pe.js +2 -0
- streamlit/static/static/js/{index.uInpwWAP.js → index.Bj9JgOEC.js} +1 -1
- streamlit/static/static/js/index.BjCwMzj4.js +3 -0
- streamlit/static/static/js/{index.C3EXAI-u.js → index.Bm3VbPB5.js} +1 -1
- streamlit/static/static/js/{index.DGcW849X.js → index.Bxz2yX3P.js} +1 -1
- streamlit/static/static/js/{index.CeXLlclc.js → index.BycLveZ4.js} +1 -1
- streamlit/static/static/js/{index.CjQnYKID.js → index.C9BdUqTi.js} +1 -1
- streamlit/static/static/js/index.CFMf5_ez.js +197 -0
- streamlit/static/static/js/index.CGYqqs6j.js +1 -0
- streamlit/static/static/js/{index.CFePF7s4.js → index.CH1tqnSs.js} +1 -1
- streamlit/static/static/js/{index.BoJaJReB.js → index.CMItVsFA.js} +1 -1
- streamlit/static/static/js/{index.CuEFSQ-o.js → index.CTBk8Vk2.js} +1 -1
- streamlit/static/static/js/index.CiAQIz1H.js +7 -0
- streamlit/static/static/js/index.Cj7DSzVR.js +73 -0
- streamlit/static/static/js/index.Ck8rQ9OL.js +1 -0
- streamlit/static/static/js/{index.CqSRo6zQ.js → index.ClELlchS.js} +2 -2
- streamlit/static/static/js/{index.DP1rDFP0.js → index.Cnpi3o3E.js} +1 -1
- streamlit/static/static/js/{index.Cl_966eE.js → index.Ctn27_AE.js} +1 -1
- streamlit/static/static/js/{index.D4jR1m1z.js → index.D2QEXQq_.js} +1 -1
- streamlit/static/static/js/index.DH71Ezyj.js +1 -0
- streamlit/static/static/js/{index.CfiZGqj3.js → index.DHh-U0dK.js} +2 -2
- streamlit/static/static/js/{index.Bp1Of6L8.js → index.DK7hD7_w.js} +1 -1
- streamlit/static/static/js/{index.MQLQLR5Z.js → index.DKv_lNO7.js} +1 -1
- streamlit/static/static/js/index.DNLrMXgm.js +12 -0
- streamlit/static/static/js/index.DW0Grddz.js +1 -0
- streamlit/static/static/js/{index.Cb9gN2T2.js → index.Dbe-Q3C-.js} +1 -1
- streamlit/static/static/js/index.DcPNYEUo.js +1 -0
- streamlit/static/static/js/index.DuxqVQpd.js +1 -0
- streamlit/static/static/js/{index.BH79B25f.js → index.FFOzOWzC.js} +1 -1
- streamlit/static/static/js/{index.DWedOrkQ.js → index.GRUzrudl.js} +1 -1
- streamlit/static/static/js/{input.CbP5ZuQ7.js → input.s6pjQ49A.js} +1 -1
- streamlit/static/static/js/{memory.BuacVo2L.js → memory.Cuvsdfrl.js} +1 -1
- streamlit/static/static/js/{number-overlay-editor.BZb9zRl_.js → number-overlay-editor.DdgVR5m3.js} +1 -1
- streamlit/static/static/js/{possibleConstructorReturn.DSM84rOS.js → possibleConstructorReturn.CqidKeei.js} +1 -1
- streamlit/static/static/js/{sandbox.C480llMG.js → sandbox.CCQREcJx.js} +1 -1
- streamlit/static/static/js/{timepicker.BunxCVp7.js → timepicker.mkJF97Bb.js} +4 -4
- streamlit/static/static/js/{toConsumableArray.B4o8rEx1.js → toConsumableArray.De7I7KVR.js} +1 -1
- streamlit/static/static/js/{uniqueId.tii0yosY.js → uniqueId.RI1LJdtz.js} +1 -1
- streamlit/static/static/js/{useBasicWidgetState.Bnm4FD6K.js → useBasicWidgetState.CedkNjUW.js} +1 -1
- streamlit/static/static/js/{useTextInputAutoExpand.Dgtwc1m0.js → useTextInputAutoExpand.Ca7w8dVs.js} +2 -2
- streamlit/static/static/js/{useUpdateUiValue.DjXdMFGw.js → useUpdateUiValue.DeXelfRH.js} +1 -1
- streamlit/static/static/js/withFullScreenWrapper.C3561XxJ.js +1 -0
- streamlit/static/static/media/MaterialSymbols-Rounded.DeCZgS-4.woff2 +0 -0
- streamlit/string_util.py +58 -1
- streamlit/web/bootstrap.py +0 -31
- streamlit/web/server/routes.py +17 -4
- streamlit/web/server/server.py +1 -0
- {streamlit-1.49.0.dist-info → streamlit-1.50.0.dist-info}/METADATA +1 -1
- {streamlit-1.49.0.dist-info → streamlit-1.50.0.dist-info}/RECORD +137 -136
- streamlit/static/static/css/index.COe1010n.css +0 -1
- streamlit/static/static/js/InputInstructions.C254RU9X.js +0 -1
- streamlit/static/static/js/Toolbar.BO_3WBaS.js +0 -1
- streamlit/static/static/js/data-grid-overlay-editor.C9gQLEnU.js +0 -1
- streamlit/static/static/js/index.BDZorv41.js +0 -1
- streamlit/static/static/js/index.BeTC4Yl-.js +0 -197
- streamlit/static/static/js/index.BnOd05Ko.js +0 -2
- streamlit/static/static/js/index.Bpe4-O2W.js +0 -1
- streamlit/static/static/js/index.C1qCS-sd.js +0 -1
- streamlit/static/static/js/index.C77g9sAQ.js +0 -3
- streamlit/static/static/js/index.Ca3y4ztK.js +0 -1
- streamlit/static/static/js/index.CbwuUwu4.js +0 -12
- streamlit/static/static/js/index.DKb-BAE2.js +0 -1
- streamlit/static/static/js/index.DStzYLqM.js +0 -73
- streamlit/static/static/js/index.DVKQKDLu.js +0 -1
- streamlit/static/static/js/index.DYbRPmVF.js +0 -1
- streamlit/static/static/js/index.z992t-BQ.js +0 -7
- streamlit/static/static/js/withFullScreenWrapper.0cy2pVf5.js +0 -1
- streamlit/static/static/media/MaterialSymbols-Rounded.CBxVaFdk.woff2 +0 -0
- {streamlit-1.49.0.data → streamlit-1.50.0.data}/scripts/streamlit.cmd +0 -0
- {streamlit-1.49.0.dist-info → streamlit-1.50.0.dist-info}/WHEEL +0 -0
- {streamlit-1.49.0.dist-info → streamlit-1.50.0.dist-info}/entry_points.txt +0 -0
- {streamlit-1.49.0.dist-info → streamlit-1.50.0.dist-info}/top_level.txt +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
import{v as t,
|
|
1
|
+
import{v as t,aa 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.6xX1278W.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 +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.
|
|
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.6xX1278W.js";import{u as $}from"./useBasicWidgetState.CedkNjUW.js";import{S as v,L as X,a as m}from"./checkbox.yZOfXCeX.js";import"./FormClearHelper.DTcdrasw.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 T,r as i,w as b,V as L,j as p,x as N}from"./index.
|
|
1
|
+
import{v as T,r as i,w as b,V as L,j as p,x as N}from"./index.6xX1278W.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};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a$ as Ye,ab as Q,r as E,bq as vt,ac as mt,p as Z,aF as bt,aG as yt,v as me,t as ze,bg as Tt,u as kt,br as Ot,j as re,e as Ge,l as wt,Q as Rt,T as St,P as Mt,W as _t,bs as $t,bt as $e}from"./index.6xX1278W.js";import{s as Ve}from"./sprintf.D7DtBTRn.js";import{u as Et}from"./useBasicWidgetState.CedkNjUW.js";import"./FormClearHelper.DTcdrasw.js";var se={},H={},ue={},ce={},Ne;function Ie(){if(Ne)return ce;Ne=1,Object.defineProperty(ce,"__esModule",{value:!0}),ce.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||(ce.Direction=e={})),ce}var Ue;function Ze(){return Ue||(Ue=1,function(e){var r=ue&&ue.__spreadArray||function(i,s,u){if(u||arguments.length===2)for(var h=0,m=s.length,v;h<m;h++)(v||!(h in s))&&(v||(v=Array.prototype.slice.call(s,0,h)),v[h]=s[h]);return i.concat(v||Array.prototype.slice.call(s))};Object.defineProperty(e,"__esModule",{value:!0}),e.isIOS=e.useThumbOverlap=e.assertUnreachable=e.voidFn=e.getTrackBackground=e.replaceAt=e.schd=e.translate=e.getClosestThumbIndex=e.translateThumbs=e.getPaddingAndBorder=e.getMargin=e.checkInitialOverlap=e.checkValuesAgainstBoundaries=e.checkBoundaries=e.isVertical=e.relativeValue=e.normalizeValue=e.isStepDivisible=e.isTouchEvent=e.getStepDecimals=void 0;var n=Ye(),o=Ie(),p=function(i){var s=i.toString().split(".")[1];return s?s.length:0};e.getStepDecimals=p;function S(i){return i.touches&&i.touches.length||i.changedTouches&&i.changedTouches.length}e.isTouchEvent=S;function l(i,s,u){var h=(s-i)/u,m=8,v=Number(h.toFixed(m));return parseInt(v.toString(),10)===v}e.isStepDivisible=l;function g(i,s,u,h,m,v,T){var _=1e11;if(i=Math.round(i*_)/_,!v){var D=T[s-1],x=T[s+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/_,B=Math.abs(U/_)<m/2?W:W+m,A=(0,e.getStepDecimals)(m);return parseFloat(B.toFixed(A))}e.normalizeValue=g;function F(i,s,u){return(i-s)/(u-s)}e.relativeValue=F;function j(i){return i===o.Direction.Up||i===o.Direction.Down}e.isVertical=j;function z(i,s,u){if(s>=u)throw new RangeError("min (".concat(s,") is equal/bigger than max (").concat(u,")"));if(i<s)throw new RangeError("value (".concat(i,") is smaller than min (").concat(s,")"));if(i>u)throw new RangeError("value (".concat(i,") is bigger than max (").concat(u,")"))}e.checkBoundaries=z;function $(i,s,u){return i<s?s:i>u?u:i}e.checkValuesAgainstBoundaries=$;function y(i){if(!(i.length<2)&&!i.slice(1).every(function(s,u){return i[u]<=s}))throw new RangeError("values={[".concat(i,"]} needs to be sorted when allowOverlap={false}"))}e.checkInitialOverlap=y;function d(i){var s=window.getComputedStyle(i);return{top:parseInt(s["margin-top"],10),bottom:parseInt(s["margin-bottom"],10),left:parseInt(s["margin-left"],10),right:parseInt(s["margin-right"],10)}}e.getMargin=d;function t(i){var s=window.getComputedStyle(i);return{top:parseInt(s["padding-top"],10)+parseInt(s["border-top-width"],10),bottom:parseInt(s["padding-bottom"],10)+parseInt(s["border-bottom-width"],10),left:parseInt(s["padding-left"],10)+parseInt(s["border-left-width"],10),right:parseInt(s["padding-right"],10)+parseInt(s["border-right-width"],10)}}e.getPaddingAndBorder=t;function a(i,s,u){var h=u?-1:1;i.forEach(function(m,v){return f(m,h*s[v].x,s[v].y)})}e.translateThumbs=a;function c(i,s,u,h){for(var m=0,v=C(i[0],s,u,h),T=1;T<i.length;T++){var _=C(i[T],s,u,h);_<v&&(v=_,m=T)}return m}e.getClosestThumbIndex=c;function f(i,s,u){i.style.transform="translate(".concat(s,"px, ").concat(u,"px)")}e.translate=f;var b=function(i){var s=[],u=null,h=function(){for(var m=[],v=0;v<arguments.length;v++)m[v]=arguments[v];s=m,!u&&(u=requestAnimationFrame(function(){u=null,i.apply(void 0,s)}))};return h};e.schd=b;function k(i,s,u){var h=i.slice(0);return h[s]=u,h}e.replaceAt=k;function I(i){var s=i.values,u=i.colors,h=i.min,m=i.max,v=i.direction,T=v===void 0?o.Direction.Right:v,_=i.rtl,D=_===void 0?!1:_;D&&T===o.Direction.Right?T=o.Direction.Left:D&&o.Direction.Left&&(T=o.Direction.Right);var x=s.slice(0).sort(function(V,W){return V-W}).map(function(V){return(V-h)/(m-h)*100}),U=x.reduce(function(V,W,B){return"".concat(V,", ").concat(u[B]," ").concat(W,"%, ").concat(u[B+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,s,u,h,m){m===void 0&&(m=function(T){return T});var v=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(s.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 v},P=function(i,s,u,h,m,v,T){T===void 0&&(T=function(x){return x});var _=[],D=function(x){var U=M(u[x],h[x],m,v,T),V=s[x].x;s.forEach(function(W,B){var A=W.x,G=M(u[B],h[B],m,v,T);x!==B&&(V>=A&&V<=A+G||V+U>=A&&V+U<=A+G)&&(_.includes(B)||(_.push(x),_.push(B),_=r(r([],_,!0),[x,B],!1),D(B)))})};return D(i),Array.from(new Set(_.sort()))},R=function(i,s,u,h,m,v){h===void 0&&(h=.1),m===void 0&&(m=" - "),v===void 0&&(v=function(B){return B});var T=(0,e.getStepDecimals)(h),_=(0,n.useState)({}),D=_[0],x=_[1],U=(0,n.useState)(v(s[u].toFixed(T))),V=U[0],W=U[1];return(0,n.useEffect)(function(){if(i){var B=i.getThumbs();if(B.length<1)return;var A={},G=i.getOffsets(),ne=P(u,G,B,s,m,T,v),le=v(s[u].toFixed(T));if(ne.length){var J=ne.reduce(function(ee,oe,ge,pe){return ee.length?r(r([],ee,!0),[G[pe[ge]].x],!1):[G[pe[ge]].x]},[]);if(Math.min.apply(Math,J)===G[u].x){var de=[];ne.forEach(function(ee){de.push(s[ee].toFixed(T))}),le=Array.from(new Set(de.sort(function(ee,oe){return parseFloat(ee)-parseFloat(oe)}))).map(v).join(m);var fe=Math.min.apply(Math,J),he=Math.max.apply(Math,J),_e=B[ne[J.indexOf(he)]].getBoundingClientRect().width;A.left="".concat(Math.abs(fe-(he+_e))/2,"px"),A.transform="translate(-50%, 0)"}else A.visibility="hidden"}W(le),x(A)}},[i,s]),[V,D]};e.useThumbOverlap=R;function C(i,s,u,h){var m=i.getBoundingClientRect(),v=m.left,T=m.top,_=m.width,D=m.height;return j(h)?Math.abs(u-(T+D/2)):Math.abs(s-(v+_/2))}var L=function(){var i,s=((i=navigator.userAgentData)===null||i===void 0?void 0:i.platform)||navigator.platform;return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(s)||navigator.userAgent.includes("Mac")&&"ontouchend"in document};e.isIOS=L}(ue)),ue}var He;function It(){if(He)return H;He=1;var e=H&&H.__extends||function(){var $=function(y,d){return $=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])},$(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");$(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($,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($,t,a)}:function($,y,d,t){t===void 0&&(t=d),$[t]=y[d]}),n=H&&H.__setModuleDefault||(Object.create?function($,y){Object.defineProperty($,"default",{enumerable:!0,value:y})}:function($,y){$.default=y}),o=H&&H.__importStar||function($){if($&&$.__esModule)return $;var y={};if($!=null)for(var d in $)d!=="default"&&Object.prototype.hasOwnProperty.call($,d)&&r(y,$,d);return n(y,$),y},p=H&&H.__spreadArray||function($,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 $.concat(c||Array.prototype.slice.call(y))};Object.defineProperty(H,"__esModule",{value:!0});var S=o(Ye()),l=Ze(),g=Ie(),F=["ArrowRight","ArrowUp","k","PageUp"],j=["ArrowLeft","ArrowDown","j","PageDown"],z=function($){e(y,$);function y(d){var t=$.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},C=M.getBoundingClientRect(),L=(0,l.getMargin)(M);switch(c){case g.Direction.Right:return R.x=(L.left+w.left)*-1,R.y=((C.height-O.height)/2+w.top)*-1,R.x+=O.width*(0,l.relativeValue)(f[P],b,k)-C.width/2,R;case g.Direction.Left:return R.x=(L.right+w.right)*-1,R.y=((C.height-O.height)/2+w.top)*-1,R.x+=O.width-O.width*(0,l.relativeValue)(f[P],b,k)-C.width/2,R;case g.Direction.Up:return R.x=((C.width-O.width)/2+L.left+w.left)*-1,R.y=-w.left,R.y+=O.height-O.height*(0,l.relativeValue)(f[P],b,k)-C.height/2,R;case g.Direction.Down:return R.x=((C.width-O.width)/2+L.left+w.left)*-1,R.y=-w.left,R.y+=O.height*(0,l.relativeValue)(f[P],b,k)-C.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===g.Direction.Left||O===g.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,C=I.step,L=I.rtl;if(b===-1&&k[0]===-1&&k[1]===-1)return null;var i=t.trackRef.current;if(!i)return null;var s=i.getBoundingClientRect(),u=(0,l.isVertical)(O)?s.height:s.width;if(k[0]!==-1&&k[1]!==-1){var h=a-k[0],m=c-k[1],v=0;switch(O){case g.Direction.Right:case g.Direction.Left:v=h/u*(M-w);break;case g.Direction.Down:case g.Direction.Up:v=m/u*(M-w);break;default:(0,l.assertUnreachable)(O)}if(L&&(v*=-1),Math.abs(v)>=C/2){for(var T=0;T<t.thumbRefs.length;T++){if(R[T]===M&&Math.sign(v)===1||R[T]===w&&Math.sign(v)===-1)return;var _=R[T]+v;_>M?v=M-R[T]:_<w&&(v=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]+v,T));t.setState({draggedTrackPos:[a,c]}),P(D)}}else{var x=0;switch(O){case g.Direction.Right:x=(a-s.left)/u*(M-w)+w;break;case g.Direction.Left:x=(u-(a-s.left))/u*(M-w)+w;break;case g.Direction.Down:x=(c-s.top)/u*(M-w)+w;break;case g.Direction.Up:x=(u-(c-s.top))/u*(M-w)+w;break;default:(0,l.assertUnreachable)(O)}L&&(x=M+w-x),Math.abs(R[b]-x)>=C/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===g.Direction.Left||t.props.direction===g.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,C=this.state,L=C.draggedThumbIndex,i=C.thumbZIndexes,s=C.markOffsets;return f({props:{style:{transform:"scale(1)",cursor:L>-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:p(p([],s.map(function(u,h,m){return I({props:{style:d.props.direction===g.Direction.Left||d.props.direction===g.Direction.Right?{position:"absolute",left:"".concat(u[0],"px"),marginTop:"".concat(u[1],"px")}:{position:"absolute",top:"".concat(u[0],"px"),marginLeft:"".concat(u[1],"px")},key:"mark".concat(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:g.Direction.Right,rtl:!1,disabled:!1,allowOverlap:!1,draggableTrack:!1,min:0,max:100},y}(S.Component);return H.default=z,H}var We;function xt(){return We||(We=1,function(e){var r=se&&se.__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 o=Ze();Object.defineProperty(e,"getTrackBackground",{enumerable:!0,get:function(){return o.getTrackBackground}}),Object.defineProperty(e,"useThumbOverlap",{enumerable:!0,get:function(){return o.useThumbOverlap}}),Object.defineProperty(e,"relativeValue",{enumerable:!0,get:function(){return o.relativeValue}}),Object.defineProperty(e,"checkValuesAgainstBoundaries",{enumerable:!0,get:function(){return o.checkValuesAgainstBoundaries}});var p=Ie();Object.defineProperty(e,"Direction",{enumerable:!0,get:function(){return p.Direction}})}(se)),se}var Qe=xt();function qe(e,r){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter(function(p){return Object.getOwnPropertyDescriptor(e,p).enumerable})),n.push.apply(n,o)}return n}function ve(e){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?qe(Object(n),!0).forEach(function(o){Ct(e,o,n[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):qe(Object(n)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(n,o))})}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 be=Q("div",{position:"relative",width:"100%"});be.displayName="Root";be.displayName="Root";be.displayName="StyledRoot";var ye=Q("div",function(e){var r=e.$theme,n=e.$value,o=n===void 0?[]:n,p=e.$disabled,S=e.$isDragged,l=r.sizing,g="inherit";return p?g="not-allowed":S?g="grabbing":o.length===1&&(g="pointer"),{paddingTop:l.scale600,paddingBottom:l.scale600,paddingRight:l.scale600,paddingLeft:l.scale600,display:"flex",cursor:g,backgroundColor:r.colors.sliderTrackFill}});ye.displayName="Track";ye.displayName="Track";ye.displayName="StyledTrack";var Te=Q("div",function(e){var r=e.$theme,n=e.$value,o=n===void 0?[]:n,p=e.$min,S=e.$max,l=e.$disabled,g=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:Qe.getTrackBackground({values:o,colors:o.length===1?[l?g.borderOpaque:g.primary,l?g.backgroundSecondary:g.borderOpaque]:[l?g.backgroundSecondary:g.borderOpaque,l?g.borderOpaque:g.primary,l?g.backgroundSecondary:g.borderOpaque],min:p||0,max:S||0,rtl:j==="rtl"}),height:"2px",width:"100%",alignSelf:"center",cursor:l?"not-allowed":"inherit"}});Te.displayName="InnerTrack";Te.displayName="InnerTrack";Te.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 ve(ve({},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,o=n===void 0?[]:n,p=e.$thumbIndex,S=e.$disabled,l=o.length===2&&p===0,g=o.length===2&&p===1;return r.direction==="rtl"&&(g||l)&&(l=!l,g=!g),{height:"24px",width:"24px",borderTopLeftRadius:"24px",borderTopRightRadius:"24px",borderBottomLeftRadius:"24px",borderBottomRightRadius:"24px",display:"flex",justifyContent:"center",alignItems:"center",backgroundColor: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 ve(ve({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 Ke(e,r){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter(function(p){return Object.getOwnPropertyDescriptor(e,p).enumerable})),n.push.apply(n,o)}return n}function Dt(e){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?Ke(Object(n),!0).forEach(function(o){Pt(e,o,n[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ke(Object(n)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(n,o))})}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 o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}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 Xe(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 Xe(e,r)}}function Xe(e,r){(r==null||r>e.length)&&(r=e.length);for(var n=0,o=new Array(r);n<r;n++)o[n]=e[n];return o}function Lt(e,r){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var o=[],p=!0,S=!1,l,g;try{for(n=n.call(e);!(p=(l=n.next()).done)&&(o.push(l.value),!(r&&o.length===r));p=!0);}catch(F){S=!0,g=F}finally{try{!p&&n.return!=null&&n.return()}finally{if(S)throw g}}return o}}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,o=e.disabled,p=o===void 0?!1:o,S=e.marks,l=S===void 0?!1:S,g=e.onChange,F=g===void 0?function(){}:g,j=e.onFinalChange,z=j===void 0?function(){}:j,$=e.min,y=$===void 0?0:$,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=E.useContext(vt),M=E.useState(!1),P=K(M,2),R=P[0],C=P[1],L=E.useState(!1),i=K(L,2),s=i[0],u=i[1],h=E.useState(!1),m=K(h,2),v=m[0],T=m[1],_=E.useState(-1),D=K(_,2),x=D[0],U=D[1],V=E.useCallback(function(Y){mt(Y)&&T(!0);var N=Y.target.parentNode.firstChild===Y.target?0:1;U(N)},[]),W=E.useCallback(function(Y){v!==!1&&T(!1),U(-1)},[]),B=jt(O),A={$disabled:p,$step:c,$min:y,$max:t,$marks:l,$value:B,$isFocusVisible:v},G=Z(n.Root,be),ne=K(G,2),le=ne[0],J=ne[1],de=Z(n.Track,ye),fe=K(de,2),he=fe[0],_e=fe[1],ee=Z(n.InnerTrack,Te),oe=K(ee,2),ge=oe[0],pe=oe[1],Je=Z(n.Thumb,Re),xe=K(Je,2),et=xe[0],tt=xe[1],rt=Z(n.InnerThumb,Se),Ce=K(rt,2),nt=Ce[0],at=Ce[1],it=Z(n.ThumbValue,Me),De=K(it,2),ot=De[0],st=De[1],ut=Z(n.Tick,Oe),Pe=K(ut,2),Be=Pe[0],Ae=Pe[1],ct=Z(n.TickBar,we),Le=K(ct,2),lt=Le[0],dt=Le[1],ft=Z(n.Mark,ke),Fe=K(ft,2),ht=Fe[0],gt=Fe[1];return E.createElement(le,X({"data-baseweb":"slider"},A,J,{onFocus:yt(J,V),onBlur:bt(J,W)}),E.createElement(Qe.Range,X({step:c,min:y,max:t,values:B,disabled:p,onChange:function(N){return F({value:N})},onFinalChange:function(N){return z({value:N})},rtl:w.direction==="rtl",renderTrack:function(N){var te=N.props,q=N.children,ae=N.isDragged;return E.createElement(he,X({onMouseDown:te.onMouseDown,onTouchStart:te.onTouchStart,$isDragged:ae},A,_e),E.createElement(ge,X({$isDragged:ae,ref:te.ref},A,pe),q))},renderThumb:function(N){var te=N.props,q=N.index,ae=N.isDragged,je=b||(!!q&&s||!q&&R||ae)&&!p;return E.createElement(et,X({},te,{onMouseEnter:function(){q===0?C(!0):u(!0)},onMouseLeave:function(){q===0?C(!1):u(!1)},$thumbIndex:q,$isDragged:ae,style:Dt({},te.style)},A,tt,{$isFocusVisible:v&&x===q}),je&&E.createElement(ot,X({$thumbIndex:q,$isDragged:ae},A,st),I(B[q])),je&&E.createElement(nt,X({$thumbIndex:q,$isDragged:ae},A,at)))}},l?{renderMark:function(N){var te=N.props,q=N.index;return E.createElement(ht,X({$markIndex:q},te,A,gt))}}:{})),E.createElement(lt,X({},A,dt),E.createElement(Be,X({},A,Ae),I(y)),E.createElement(Be,X({},A,Ae),I(t))))}const Vt=me("div",{target:"ezks3vl0"})({position:"relative"}),Nt=me("div",{target:"ezks3vl1"})(({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 ${ze(r.colors.primary,.5)}`:"none",":focus":{outline:"none"},":focus-visible":{boxShadow:`0 0 0 0.2rem ${ze(r.colors.primary,.5)}`}})),Ut=me("div",{target:"ezks3vl2"})(({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=me("div",{target:"ezks3vl3"})(({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:0,transition:"opacity 70ms ease-in-out"}));function Wt({minLabel:e,maxLabel:r,isHovered:n,isDisabled:o}){return Ge(Ht,{"data-testid":"stSliderTickBar",isHovered:n,isDisabled:o,children:[re("span",{children:e}),re("span",{children:r})]})}function qt({disabled:e,element:r,widgetMgr:n,fragmentId:o}){const[p,S]=Et({getStateFromWidgetMgr:Kt,getDefaultStateFromProto:Xt,getCurrStateFromProto:Yt,updateWidgetMgrState:Gt,element:r,widgetMgr:n,fragmentId:o}),[l,g]=E.useState(p),[F,j]=E.useState(!1),[z,$]=E.useState(!1),y=E.useCallback(()=>j(!0),[]),d=E.useCallback(()=>j(!1),[]),t=E.useRef(null),[a]=E.useState([]),[c]=E.useState([]),f=kt(),b=l.map(C=>Ee(C,r)),k=Ee(r.min,r),I=Ee(r.max,r),O=r.label;E.useEffect(()=>{g(p)},[p]);const w=E.useCallback(({value:C})=>{S({value:C,fromUi:!0}),$(!1)},[S]),M=E.useCallback(({value:C})=>{g(C),$(!0)},[]),P=E.useCallback(E.forwardRef(function(L,i){const{$thumbIndex:s}=L,u=s||0;a[u]=i,c[u]||=E.createRef();const h=Ot(L,["role","style","aria-valuemax","aria-valuemin","aria-valuenow","tabIndex","onKeyUp","onKeyDown","onMouseEnter","onMouseLeave","draggable"]),m=b[u];return re(Nt,{...h,disabled:L.$disabled===!0,isDragged:L.$isDragged===!0,ref:a[u],"aria-valuetext":m,"aria-label":O,children:re(Ut,{"data-testid":"stSliderThumbValue",disabled:L.$disabled===!0,ref:c[u],children:m})})}),[]);E.useEffect(()=>{c.map((h,m)=>{h.current&&(h.current.innerText=b[m])}),a.map((h,m)=>{h.current&&h.current.setAttribute("aria-valuetext",b[m])});const C=t.current??null,L=a[0].current,i=a[1]?.current,s=c[0].current,u=c[1]?.current;Jt(C,L,i,s,u)});const R=E.useCallback(({$disabled:C})=>({height:f.spacing.twoXS,...C?{background:f.colors.darkenedBgMix25}:{}}),[f.colors.darkenedBgMix25,f.spacing.twoXS]);return Ge(Vt,{ref:t,className:"stSlider","data-testid":"stSlider",onMouseEnter:y,onMouseLeave:d,children:[re(_t,{label:r.label,disabled:e,labelVisibility:wt(r.labelVisibility?.value),children:r.help&&re(Rt,{children:re(St,{content:r.help,placement:Mt.TOP_RIGHT})})}),re(zt,{min:r.min,max:r.max,step:r.step,value:Qt(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:{style:R},TickBar:{component:Wt,props:{minLabel:k,maxLabel:I,isHovered:F||z,isDisabled:e}}}})]})}function Kt(e,r){return e.getDoubleArrayValue(r)}function Xt(e){return e.default}function Yt(e){return e.value}function Gt(e,r,n,o){r.setDoubleArrayValue(e,n.value,{fromUi:n.fromUi},o)}function Zt(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:o}=r;return Zt(r)?$t.utc(e/1e3).format(n):o.length>0?Ve.sprintf(n,o[e]):Ve.sprintf(n,e)}function Qt(e,r){const{min:n,max:o}=r;let p=e[0],S=e.length>1?e[1]:e[0];return p>S&&(p=S),p<n&&(p=n),p>o&&(p=o),S<n&&(S=n),S>o&&(S=o),e.length>1?[p,S]:[p]}function Jt(e,r,n,o,p){!e||!r||!o||(ie(e,r,o),n&&p&&(ie(e,n,p),er(e,r,n,o,p)))}function ie(e,r,n){const o=e.getBoundingClientRect(),p=r.getBoundingClientRect(),S=n.getBoundingClientRect(),l=p.left+p.width/2,g=l-S.width/2<o.left,F=l+S.width/2>o.right;n.style.left=g?"0":"",n.style.right=F?"0":""}function er(e,r,n,o,p){const l=e.getBoundingClientRect(),g=r.getBoundingClientRect(),F=n.getBoundingClientRect(),j=o.getBoundingClientRect(),z=p.getBoundingClientRect(),$=l.left+l.width/2,y=g.left+g.width/2,d=F.left+F.width/2,t=y-j.width/2>=l.left,a=d+z.width/2<=l.right,c=g.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,o),ie(e,n,p);return}if(c&&f){o.style.left="",o.style.right=`${Math.round(g.width)}px`,p.style.left=`${Math.round(F.width)}px`,p.style.right="";return}y<$?(ie(e,r,o),p.style.left=`${Math.round(y+b+24-d)}px`,p.style.right=""):(ie(e,n,p),o.style.left="",o.style.right=`${-Math.round(d-k-24-y)}px`)}const ir=Tt(E.memo(qt));export{ir as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as o,L as h,B as i,j as e,a as k,b as g,c as R,D as C}from"./index.
|
|
1
|
+
import{r as o,L as h,B as i,j as e,a as k,b as g,c as R,D as C}from"./index.6xX1278W.js";import{c as L}from"./createDownloadLinkElement.ZaXNnPK4.js";function x(d){const{disabled:c,element:l,widgetMgr:u,endpoints:t,fragmentId:f}=d,{help:m,label:B,icon:w,ignoreRerun:D,type:s,url:r}=l,{libConfig:{enforceDownloadInNewTab:p=!1}}=o.useContext(h);let n=i.SECONDARY;s==="primary"?n=i.PRIMARY:s==="tertiary"&&(n=i.TERTIARY);const a=o.useMemo(()=>t.buildDownloadUrl(r),[t,r]);o.useEffect(()=>{t.checkSourceUrlResponse(a,"Download Button")},[a,t]);const b=()=>{D||u.setTriggerValue(l,{fromUi:!0},f),L({filename:"",url:a,enforceDownloadInNewTab:p}).click()};return e("div",{className:"stDownloadButton","data-testid":"stDownloadButton",children:e(k,{help:m,containerWidth:!0,children:e(g,{kind:n,size:R.SMALL,disabled:c,onClick:b,containerWidth:!0,children:e(C,{icon:w,label:B})})})})}const A=o.memo(x);export{A as default};
|