streamlit-nightly 1.43.3.dev20250318__py3-none-any.whl → 1.43.3.dev20250319__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 (131) hide show
  1. streamlit/auth_util.py +1 -1
  2. streamlit/commands/page_config.py +1 -1
  3. streamlit/config.py +11 -14
  4. streamlit/connections/snowflake_connection.py +2 -2
  5. streamlit/connections/snowpark_connection.py +1 -1
  6. streamlit/connections/sql_connection.py +1 -1
  7. streamlit/connections/util.py +1 -1
  8. streamlit/dataframe_util.py +12 -12
  9. streamlit/delta_generator.py +2 -2
  10. streamlit/deprecation_util.py +2 -2
  11. streamlit/elements/arrow.py +3 -3
  12. streamlit/elements/deck_gl_json_chart.py +4 -4
  13. streamlit/elements/dialog_decorator.py +2 -2
  14. streamlit/elements/heading.py +1 -1
  15. streamlit/elements/html.py +3 -3
  16. streamlit/elements/lib/built_in_chart_utils.py +9 -8
  17. streamlit/elements/lib/color_util.py +7 -7
  18. streamlit/elements/lib/dialog.py +1 -1
  19. streamlit/elements/lib/image_utils.py +9 -7
  20. streamlit/elements/lib/mutable_status_container.py +1 -1
  21. streamlit/elements/media.py +2 -2
  22. streamlit/elements/metric.py +1 -1
  23. streamlit/elements/plotly_chart.py +4 -4
  24. streamlit/elements/vega_charts.py +5 -5
  25. streamlit/elements/widgets/button_group.py +1 -1
  26. streamlit/elements/widgets/multiselect.py +3 -2
  27. streamlit/elements/widgets/select_slider.py +3 -5
  28. streamlit/elements/widgets/slider.py +4 -4
  29. streamlit/elements/widgets/time_widgets.py +4 -4
  30. streamlit/elements/write.py +1 -1
  31. streamlit/proto/NewSession_pb2.py +16 -16
  32. streamlit/proto/NewSession_pb2.pyi +16 -11
  33. streamlit/runtime/app_session.py +1 -1
  34. streamlit/runtime/caching/cache_data_api.py +2 -2
  35. streamlit/runtime/caching/cache_resource_api.py +2 -2
  36. streamlit/runtime/caching/hashing.py +7 -7
  37. streamlit/runtime/metrics_util.py +1 -1
  38. streamlit/runtime/scriptrunner/script_runner.py +1 -1
  39. streamlit/runtime/scriptrunner_utils/script_requests.py +1 -1
  40. streamlit/runtime/session_manager.py +1 -1
  41. streamlit/runtime/state/session_state.py +3 -3
  42. streamlit/runtime/websocket_session_manager.py +2 -2
  43. streamlit/static/index.html +1 -1
  44. streamlit/static/static/css/index.C5t3M85E.css +1 -0
  45. streamlit/static/static/js/{FileDownload.esm.qg6FU0gn.js → FileDownload.esm.Dz4lqu2t.js} +1 -1
  46. streamlit/static/static/js/{FileHelper.BjsqRSXf.js → FileHelper.B_o0E5mY.js} +1 -1
  47. streamlit/static/static/js/{FormClearHelper.lrCbq3h9.js → FormClearHelper.B5ARMjis.js} +1 -1
  48. streamlit/static/static/js/{Hooks.DLM8-GOj.js → Hooks.gYcZ3nte.js} +1 -1
  49. streamlit/static/static/js/{InputInstructions.C6xqeBjt.js → InputInstructions.K_vAW_MG.js} +1 -1
  50. streamlit/static/static/js/{ProgressBar.CwnbGH4T.js → ProgressBar.DOjGuUdH.js} +1 -1
  51. streamlit/static/static/js/{RenderInPortalIfExists.DBosjlw4.js → RenderInPortalIfExists.C4HdMGrO.js} +1 -1
  52. streamlit/static/static/js/{Toolbar.DPjbmT0r.js → Toolbar.BZqFuVCo.js} +1 -1
  53. streamlit/static/static/js/{base-input.DYN8lKyb.js → base-input.DtNLPEYc.js} +1 -1
  54. streamlit/static/static/js/{checkbox.DHvRlo93.js → checkbox.De5lDKlG.js} +1 -1
  55. streamlit/static/static/js/{createSuper.ClJZbMNR.js → createSuper.DUfdjejQ.js} +1 -1
  56. streamlit/static/static/js/data-grid-overlay-editor.ByFOuSZw.js +1 -0
  57. streamlit/static/static/js/{downloader.D-SIwsMu.js → downloader.Bndt7ayy.js} +1 -1
  58. streamlit/static/static/js/{es6.RZQgn996.js → es6.B9axslaM.js} +2 -2
  59. streamlit/static/static/js/{iframeResizer.contentWindow.CXViiYfd.js → iframeResizer.contentWindow.C19fTVqS.js} +1 -1
  60. streamlit/static/static/js/{index.9SqbTcLN.js → index.3vPW8lC3.js} +1 -1
  61. streamlit/static/static/js/{index.DJnKVyky.js → index.8fEQ0naY.js} +1 -1
  62. streamlit/static/static/js/{index.ChEumMTh.js → index.B9N7bKyh.js} +1 -1
  63. streamlit/static/static/js/{index.BnRmaj0q.js → index.BBkaxxeO.js} +1 -1
  64. streamlit/static/static/js/index.BDWxQ6IH.js +3 -0
  65. streamlit/static/static/js/{index.Clo5LWpc.js → index.BELm1MW6.js} +1 -1
  66. streamlit/static/static/js/{index.Bz8bUQom.js → index.BKE695Zg.js} +1 -1
  67. streamlit/static/static/js/{index.DC-G9iGy.js → index.BKhwcUMH.js} +83 -83
  68. streamlit/static/static/js/index.BOsCHoek.js +1 -0
  69. streamlit/static/static/js/{index.Df97B7YB.js → index.BQkmoKYZ.js} +1 -1
  70. streamlit/static/static/js/{index.Cvp6swyX.js → index.BRjv0YAi.js} +1 -1
  71. streamlit/static/static/js/index.BTbDncVq.js +1 -0
  72. streamlit/static/static/js/{index.CJNnM66H.js → index.BVKRKiWg.js} +1 -1
  73. streamlit/static/static/js/{index.Dw0WhCiS.js → index.Bbd47eDn.js} +1 -1
  74. streamlit/static/static/js/index.Bk2R3MJ7.js +1 -0
  75. streamlit/static/static/js/{index.krYobKf-.js → index.BoIgF6Mf.js} +2 -2
  76. streamlit/static/static/js/{index.HyA1RCUq.js → index.BpkIFU8i.js} +1 -1
  77. streamlit/static/static/js/{index.jtYhcA9Y.js → index.BrZWnIcP.js} +1 -1
  78. streamlit/static/static/js/index.Bu7fiR4T.js +1 -0
  79. streamlit/static/static/js/{index.Do_EEKkv.js → index.C4zUVQy-.js} +1 -1
  80. streamlit/static/static/js/index.CBtAFng_.js +1 -0
  81. streamlit/static/static/js/{index.C-HVVl5G.js → index.CGzFdF4L.js} +2 -2
  82. streamlit/static/static/js/{index.BYzci3kh.js → index.CKmyhCjm.js} +1 -1
  83. streamlit/static/static/js/index.CVbLNEv4.js +1 -0
  84. streamlit/static/static/js/{index.Dk0AzWKK.js → index.CYG25qUi.js} +1 -1
  85. streamlit/static/static/js/{index.CqzRlT_N.js → index.DCgNoHge.js} +3 -3
  86. streamlit/static/static/js/{index.COChIdSa.js → index.DJzV_Hd9.js} +1 -1
  87. streamlit/static/static/js/{index.CVwvNsMT.js → index.DQ8O6p2Z.js} +1 -1
  88. streamlit/static/static/js/{index.BLNPtZ0I.js → index.DWQ-qPH7.js} +1 -1
  89. streamlit/static/static/js/{index.DPBPYkVj.js → index.DxsZ6SOh.js} +1 -1
  90. streamlit/static/static/js/{index.BrmZ2YXw.js → index.K2n8XAB3.js} +1 -1
  91. streamlit/static/static/js/{index.PrTbO9_K.js → index.KmpTf7BC.js} +16 -16
  92. streamlit/static/static/js/{index.DXtp2vWQ.js → index.TIHw6394.js} +1 -1
  93. streamlit/static/static/js/{index.Cjhlljyd.js → index.TXEfAqTZ.js} +1 -1
  94. streamlit/static/static/js/index.bco4avsR.js +1 -0
  95. streamlit/static/static/js/{index.Nr-h-MEp.js → index.cHVEPjHw.js} +2 -2
  96. streamlit/static/static/js/index.xvt4PCc-.js +1 -0
  97. streamlit/static/static/js/{input.dDObaqA1.js → input.5dHsg5IP.js} +1 -1
  98. streamlit/static/static/js/{memory.ByHTAQoD.js → memory.7AvKwFql.js} +1 -1
  99. streamlit/static/static/js/{mergeWith.BZKwBIi3.js → mergeWith.Bz2fCjZ-.js} +1 -1
  100. streamlit/static/static/js/{number-overlay-editor.xIt9oCDu.js → number-overlay-editor.BzFQCoPo.js} +1 -1
  101. streamlit/static/static/js/{possibleConstructorReturn.CWDGHg1z.js → possibleConstructorReturn.BWYpSIhJ.js} +1 -1
  102. streamlit/static/static/js/{sandbox.Bp7KFO4N.js → sandbox.DDDzfccc.js} +1 -1
  103. streamlit/static/static/js/{textarea.BryYk9e_.js → textarea.UlZOYsGE.js} +1 -1
  104. streamlit/static/static/js/{timepicker.BXqQU8Wg.js → timepicker.C8uTDs22.js} +1 -1
  105. streamlit/static/static/js/{toConsumableArray.jCEZas3E.js → toConsumableArray.CdG0Nv6r.js} +1 -1
  106. streamlit/static/static/js/{uniqueId.Bo8oca1r.js → uniqueId.hWzaDSRc.js} +1 -1
  107. streamlit/static/static/js/{useBasicWidgetState.B5KzIWBc.js → useBasicWidgetState.CtYBARrn.js} +1 -1
  108. streamlit/static/static/js/{useOnInputChange.DbufYBDh.js → useOnInputChange.Cpz9bdhf.js} +1 -1
  109. streamlit/static/static/js/withFullScreenWrapper.BcDfXDtz.js +1 -0
  110. streamlit/string_util.py +1 -1
  111. streamlit/testing/v1/element_tree.py +14 -14
  112. streamlit/watcher/event_based_path_watcher.py +1 -1
  113. streamlit/web/server/routes.py +1 -0
  114. {streamlit_nightly-1.43.3.dev20250318.dist-info → streamlit_nightly-1.43.3.dev20250319.dist-info}/METADATA +2 -2
  115. {streamlit_nightly-1.43.3.dev20250318.dist-info → streamlit_nightly-1.43.3.dev20250319.dist-info}/RECORD +119 -119
  116. {streamlit_nightly-1.43.3.dev20250318.dist-info → streamlit_nightly-1.43.3.dev20250319.dist-info}/WHEEL +1 -1
  117. streamlit/static/static/css/index.Bmkmz40k.css +0 -1
  118. streamlit/static/static/js/data-grid-overlay-editor.CBlXaHUd.js +0 -1
  119. streamlit/static/static/js/index.9un9ip3K.js +0 -3
  120. streamlit/static/static/js/index.B683Y0MV.js +0 -1
  121. streamlit/static/static/js/index.BOAw4pUA.js +0 -1
  122. streamlit/static/static/js/index.BjS7LGRO.js +0 -1
  123. streamlit/static/static/js/index.CI-nHxA-.js +0 -1
  124. streamlit/static/static/js/index.CaO-RWxy.js +0 -1
  125. streamlit/static/static/js/index.CqnxBfXn.js +0 -1
  126. streamlit/static/static/js/index.DveSnEeT.js +0 -1
  127. streamlit/static/static/js/index.RAvbwGxj.js +0 -1
  128. streamlit/static/static/js/withFullScreenWrapper.BKsmWq7e.js +0 -1
  129. {streamlit_nightly-1.43.3.dev20250318.data → streamlit_nightly-1.43.3.dev20250319.data}/scripts/streamlit.cmd +0 -0
  130. {streamlit_nightly-1.43.3.dev20250318.dist-info → streamlit_nightly-1.43.3.dev20250319.dist-info}/entry_points.txt +0 -0
  131. {streamlit_nightly-1.43.3.dev20250318.dist-info → streamlit_nightly-1.43.3.dev20250319.dist-info}/top_level.txt +0 -0
@@ -1 +0,0 @@
1
- import{n as N,r as i,bi as b,j as l}from"./index.DC-G9iGy.js";const w=N("iframe",{target:"eymnmwl0"})(({theme:a})=>({colorScheme:"normal",border:"none",padding:a.spacing.none,margin:a.spacing.none,width:"100%",aspectRatio:"16 / 9"})),P={width:"100%"};function R({element:a,endpoints:f,elementMgr:c}){const n=i.useRef(null),{type:v,url:p,startTime:o,subtitles:m,endTime:d,loop:u,autoplay:E,muted:T}=a,h=i.useMemo(()=>{if(!a.id)return!0;const e=c.getElementState(a.id,"preventAutoplay");return e||c.setElementState(a.id,"preventAutoplay",!0),e??!1},[a.id,c]);i.useEffect(()=>{n.current&&(n.current.currentTime=o)},[o]),i.useEffect(()=>{const e=n.current,t=()=>{e&&(e.currentTime=a.startTime)};return e&&e.addEventListener("loadedmetadata",t),()=>{e&&e.removeEventListener("loadedmetadata",t)}},[a]),i.useEffect(()=>{const e=n.current;if(!e)return;let t=!1;const s=()=>{d>0&&e.currentTime>=d&&(u?(e.currentTime=o||0,e.play()):t||(t=!0,e.pause()))};return d>0&&e.addEventListener("timeupdate",s),()=>{e&&d>0&&e.removeEventListener("timeupdate",s)}},[d,u,o]),i.useEffect(()=>{const e=n.current;if(!e)return;const t=()=>{u&&(e.currentTime=o||0,e.play())};return e.addEventListener("ended",t),()=>{e&&e.removeEventListener("ended",t)}},[u,o]);const S=e=>{const{startTime:t,endTime:s,loop:L,autoplay:V,muted:g}=a,r=new URL(e);if(t&&!isNaN(t)&&r.searchParams.append("start",t.toString()),s&&!isNaN(s)&&r.searchParams.append("end",s.toString()),L){r.searchParams.append("loop","1");const y=r.pathname.split("/").pop();y&&r.searchParams.append("playlist",y)}return V&&r.searchParams.append("autoplay","1"),g&&r.searchParams.append("mute","1"),r.toString()};return v===b.Type.YOUTUBE_IFRAME?l(w,{className:"stVideo","data-testid":"stVideo",title:p,src:S(p),allow:"autoplay; encrypted-media",allowFullScreen:!0}):l("video",{className:"stVideo","data-testid":"stVideo",ref:n,controls:!0,muted:T,autoPlay:E&&!h,src:f.buildMediaURL(p),style:P,crossOrigin:void 0,children:m&&m.map((e,t)=>l("track",{kind:"captions",src:f.buildMediaURL(`${e.url}`),label:`${e.label}`,default:t===0},t))})}const A=i.memo(R);export{A as default};
@@ -1 +0,0 @@
1
- import{r as M,E as T,_ as O,n as I,I as K,B as P,j as h,bu as Y,ba as $,bp as Z,b5 as ee,bo as j,bB as z,d as te,g as re,aL as ie,y as ae,bC as ne,bD as oe,bE as se,R as le,as as de,aA as ce,L as x,bl as ue,bk as pe,br as fe,bF as he,bs as ge,bt as me,F as ve}from"./index.DC-G9iGy.js";import{a as V}from"./index.D8rVyQy1.js";import{F as Se}from"./FormClearHelper.lrCbq3h9.js";import{U as L}from"./UploadFileInfo.C-jY39rj.js";import{P as ye,S as be}from"./ProgressBar.CwnbGH4T.js";var N=M.forwardRef(function(t,l){var r={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return M.createElement(T,O({iconAttrs:r,iconVerticalAlign:"middle",iconViewBox:"0 0 8 8"},t,{ref:l}),M.createElement("path",{d:"M.5 1c-.28 0-.5.23-.5.5v4c0 .28.23.5.5.5h5c.28 0 .5-.22.5-.5V4l1 1h1V2H7L6 3V1.5c0-.28-.22-.5-.5-.5h-5z"}))});N.displayName="Video";var D=M.forwardRef(function(t,l){var r={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return M.createElement(T,O({iconAttrs:r,iconVerticalAlign:"middle",iconViewBox:"0 0 8 8"},t,{ref:l}),M.createElement("path",{d:"M1.41 0L0 1.41l.72.72L2.5 3.94.72 5.72 0 6.41l1.41 1.44.72-.72 1.81-1.81 1.78 1.81.69.72 1.44-1.44-.72-.69-1.81-1.78 1.81-1.81.72-.72L6.41 0l-.69.72L3.94 2.5 2.13.72 1.41 0z"}))});D.displayName="X";var H=M.forwardRef(function(t,l){var r={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return M.createElement(T,O({iconAttrs:r,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},t,{ref:l}),M.createElement("rect",{width:24,height:24,fill:"none"}),M.createElement("path",{d:"M20 5h-3.17l-1.24-1.35A1.99 1.99 0 0014.12 3H9.88c-.56 0-1.1.24-1.48.65L7.17 5H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm-1.35 8.35l-2.79 2.79c-.32.32-.86.1-.86-.35v-1.75H9v1.75c0 .45-.54.67-.85.35l-2.79-2.79c-.2-.2-.2-.51 0-.71l2.79-2.79a.5.5 0 01.85.36v1.83h6v-1.83c0-.45.54-.67.85-.35l2.79 2.79c.2.19.2.51.01.7z"}))});H.displayName="SwitchCamera";var k;(function(t){t.XSMALL="xsmall",t.SMALL="small",t.MEDIUM="medium",t.LARGE="large"})(k||(k={}));function Me(t,l){switch(t){case"xsmall":return{padding:`${l.spacing.twoXS} ${l.spacing.sm}`,fontSize:l.fontSizes.sm};case"small":return{padding:`${l.spacing.twoXS} ${l.spacing.md}`};case"large":return{padding:`${l.spacing.md} ${l.spacing.md}`};default:return{padding:`${l.spacing.xs} ${l.spacing.md}`}}}const G=I("div",{target:"e47j7ja0"})({position:"relative",overflow:"hidden",width:"100%",objectFit:"contain"}),W=I("div",{target:"e47j7ja1"})(({theme:t,width:l})=>({backgroundColor:t.colors.secondaryBg,borderRadius:`${t.radii.default} ${t.radii.default} 0 0`,width:"100%",height:l*9/16,display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center"})),we=I("p",{target:"e47j7ja2"})(({theme:t})=>({marginTop:t.spacing.sm,textAlign:"center"})),Ce=I("img",{target:"e47j7ja3"})(({theme:t,opacity:l})=>({borderRadius:`${t.radii.default} ${t.radii.default} 0 0`,objectFit:"contain",opacity:l})),Ue=I("a",{target:"e47j7ja4"})(({theme:t})=>({color:t.colors.primary,display:"block",textDecoration:"none"})),Ie=I("span",{target:"e47j7ja5"})({display:"flex",alignItems:"center"}),Ee=I("div",{target:"e47j7ja6"})(({theme:t})=>({position:"absolute",top:t.spacing.lg,right:t.spacing.lg,zIndex:t.zIndices.priority,color:t.colors.fadedText40,mixBlendMode:"difference",opacity:.6})),Fe=I("div",{target:"e47j7ja8"})({height:"fit-content",width:"100%",position:"absolute",bottom:0}),Pe=I("button",{target:"e47j7ja9"})(({theme:t})=>({position:"relative",display:"inline-flex",flexDirection:"column",alignItems:"center",justifyContent:"center",backgroundColor:t.colors.lightenedBg05,border:`${t.sizes.borderWidth} solid ${t.colors.borderColor}`,borderRadius:`0 0 ${t.radii.default} ${t.radii.default}`,"&:hover":{borderColor:t.colors.primary,color:t.colors.primary},"&:active":{color:t.colors.white,borderColor:t.colors.primary,backgroundColor:t.colors.primary},"&:focus:not(:active)":{borderColor:t.colors.primary,color:t.colors.primary},"&:disabled, &:disabled:hover, &:disabled:active":{color:t.colors.fadedText40},fontWeight:t.fontWeights.normal,padding:`${t.spacing.xs} ${t.spacing.md}`,margin:t.spacing.none,lineHeight:t.lineHeights.base,color:"inherit",width:"100%",userSelect:"none","&:focus":{outline:"none"},"&:focus-visible":{boxShadow:`0 0 0 0.2rem ${K(t.colors.primary,.5)}`},...Me("medium",t)}));function q({disabled:t,onClick:l,children:r,progress:n}){return P(Pe,{disabled:t||!1,onClick:l||(()=>{}),progress:n||null,"data-testid":"stCameraInputButton",children:[r,n?h(Fe,{children:h(ye,{value:n,size:be.EXTRASMALL,overrides:{Bar:{style:{borderTopLeftRadius:0,borderTopRightRadius:0}},BarProgress:{style:{borderTopLeftRadius:0,borderTopRightRadius:0}},BarContainer:{style:{borderTopLeftRadius:0,borderTopRightRadius:0}}}})}):null]})}var F;(function(t){t.USER="user",t.ENVIRONMENT="environment"})(F||(F={}));const Re=({switchFacingMode:t})=>h(Ee,{"data-testid":"stCameraInputSwitchButton",children:h(Y,{content:"Switch camera",placement:$.TOP_RIGHT,children:h(Z,{kind:ee.MINIMAL,onClick:t,children:h(j,{content:H,size:"twoXL",color:z.white})})})});var _={exports:{}},xe=_.exports,B;function _e(){return B||(B=1,function(t,l){(function(n,a){t.exports=a(te())})(xe,function(r){return function(n){var a={};function o(s){if(a[s])return a[s].exports;var p=a[s]={i:s,l:!1,exports:{}};return n[s].call(p.exports,p,p.exports,o),p.l=!0,p.exports}return o.m=n,o.c=a,o.d=function(s,p,g){o.o(s,p)||Object.defineProperty(s,p,{enumerable:!0,get:g})},o.r=function(s){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(s,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(s,"__esModule",{value:!0})},o.t=function(s,p){if(p&1&&(s=o(s)),p&8||p&4&&typeof s=="object"&&s&&s.__esModule)return s;var g=Object.create(null);if(o.r(g),Object.defineProperty(g,"default",{enumerable:!0,value:s}),p&2&&typeof s!="string")for(var U in s)o.d(g,U,(function(C){return s[C]}).bind(null,U));return g},o.n=function(s){var p=s&&s.__esModule?function(){return s.default}:function(){return s};return o.d(p,"a",p),p},o.o=function(s,p){return Object.prototype.hasOwnProperty.call(s,p)},o.p="",o(o.s="./src/react-webcam.tsx")}({"./src/react-webcam.tsx":function(n,a,o){o.r(a);var s=o("react"),p=function(){var m=function(u,e){return m=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,d){i.__proto__=d}||function(i,d){for(var c in d)d.hasOwnProperty(c)&&(i[c]=d[c])},m(u,e)};return function(u,e){m(u,e);function i(){this.constructor=u}u.prototype=e===null?Object.create(e):(i.prototype=e.prototype,new i)}}(),g=function(){return g=Object.assign||function(m){for(var u,e=1,i=arguments.length;e<i;e++){u=arguments[e];for(var d in u)Object.prototype.hasOwnProperty.call(u,d)&&(m[d]=u[d])}return m},g.apply(this,arguments)},U=function(m,u){var e={};for(var i in m)Object.prototype.hasOwnProperty.call(m,i)&&u.indexOf(i)<0&&(e[i]=m[i]);if(m!=null&&typeof Object.getOwnPropertySymbols=="function")for(var d=0,i=Object.getOwnPropertySymbols(m);d<i.length;d++)u.indexOf(i[d])<0&&Object.prototype.propertyIsEnumerable.call(m,i[d])&&(e[i[d]]=m[i[d]]);return e};(function(){typeof window>"u"||(navigator.mediaDevices===void 0&&(navigator.mediaDevices={}),navigator.mediaDevices.getUserMedia===void 0&&(navigator.mediaDevices.getUserMedia=function(u){var e=navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia||navigator.msGetUserMedia;return e?new Promise(function(i,d){e.call(navigator,u,i,d)}):Promise.reject(new Error("getUserMedia is not implemented in this browser"))}))})();function C(){return!!(navigator.mediaDevices&&navigator.mediaDevices.getUserMedia)}var E=function(m){p(u,m);function u(e){var i=m.call(this,e)||this;return i.canvas=null,i.ctx=null,i.requestUserMediaId=0,i.unmounted=!1,i.state={hasUserMedia:!1},i}return u.prototype.componentDidMount=function(){var e=this,i=e.state,d=e.props;if(this.unmounted=!1,!C()){d.onUserMediaError("getUserMedia not supported");return}i.hasUserMedia||this.requestUserMedia(),d.children&&typeof d.children!="function"&&console.warn("children must be a function")},u.prototype.componentDidUpdate=function(e){var i=this.props;if(!C()){i.onUserMediaError("getUserMedia not supported");return}var d=JSON.stringify(e.audioConstraints)!==JSON.stringify(i.audioConstraints),c=JSON.stringify(e.videoConstraints)!==JSON.stringify(i.videoConstraints),b=e.minScreenshotWidth!==i.minScreenshotWidth,S=e.minScreenshotHeight!==i.minScreenshotHeight;(c||b||S)&&(this.canvas=null,this.ctx=null),(d||c)&&(this.stopAndCleanup(),this.requestUserMedia())},u.prototype.componentWillUnmount=function(){this.unmounted=!0,this.stopAndCleanup()},u.stopMediaStream=function(e){e&&(e.getVideoTracks&&e.getAudioTracks?(e.getVideoTracks().map(function(i){e.removeTrack(i),i.stop()}),e.getAudioTracks().map(function(i){e.removeTrack(i),i.stop()})):e.stop())},u.prototype.stopAndCleanup=function(){var e=this.state;e.hasUserMedia&&(u.stopMediaStream(this.stream),e.src&&window.URL.revokeObjectURL(e.src))},u.prototype.getScreenshot=function(e){var i=this,d=i.state,c=i.props;if(!d.hasUserMedia)return null;var b=this.getCanvas(e);return b&&b.toDataURL(c.screenshotFormat,c.screenshotQuality)},u.prototype.getCanvas=function(e){var i=this,d=i.state,c=i.props;if(!this.video||!d.hasUserMedia||!this.video.videoHeight)return null;if(!this.ctx){var b=this.video.videoWidth,S=this.video.videoHeight;if(!this.props.forceScreenshotSourceSize){var v=b/S;b=c.minScreenshotWidth||this.video.clientWidth,S=b/v,c.minScreenshotHeight&&S<c.minScreenshotHeight&&(S=c.minScreenshotHeight,b=S*v)}this.canvas=document.createElement("canvas"),this.canvas.width=(e==null?void 0:e.width)||b,this.canvas.height=(e==null?void 0:e.height)||S,this.ctx=this.canvas.getContext("2d")}var w=this,y=w.ctx,f=w.canvas;return y&&f&&(f.width=(e==null?void 0:e.width)||f.width,f.height=(e==null?void 0:e.height)||f.height,c.mirrored&&(y.translate(f.width,0),y.scale(-1,1)),y.imageSmoothingEnabled=c.imageSmoothing,y.drawImage(this.video,0,0,(e==null?void 0:e.width)||f.width,(e==null?void 0:e.height)||f.height),c.mirrored&&(y.scale(-1,1),y.translate(-f.width,0))),f},u.prototype.requestUserMedia=function(){var e=this,i=this.props,d=function(S,v){var w={video:typeof v<"u"?v:!0};i.audio&&(w.audio=typeof S<"u"?S:!0),e.requestUserMediaId++;var y=e.requestUserMediaId;navigator.mediaDevices.getUserMedia(w).then(function(f){e.unmounted||y!==e.requestUserMediaId?u.stopMediaStream(f):e.handleUserMedia(null,f)}).catch(function(f){e.handleUserMedia(f)})};if("mediaDevices"in navigator)d(i.audioConstraints,i.videoConstraints);else{var c=function(S){return{optional:[{sourceId:S}]}},b=function(S){var v=S.deviceId;return typeof v=="string"?v:Array.isArray(v)&&v.length>0?v[0]:typeof v=="object"&&v.ideal?v.ideal:null};MediaStreamTrack.getSources(function(S){var v=null,w=null;S.forEach(function(R){R.kind==="audio"?v=R.id:R.kind==="video"&&(w=R.id)});var y=b(i.audioConstraints);y&&(v=y);var f=b(i.videoConstraints);f&&(w=f),d(c(v),c(w))})}},u.prototype.handleUserMedia=function(e,i){var d=this.props;if(e||!i){this.setState({hasUserMedia:!1}),d.onUserMediaError(e);return}this.stream=i;try{this.video&&(this.video.srcObject=i),this.setState({hasUserMedia:!0})}catch{this.setState({hasUserMedia:!0,src:window.URL.createObjectURL(i)})}d.onUserMedia(i)},u.prototype.render=function(){var e=this,i=this,d=i.state,c=i.props,b=c.audio;c.forceScreenshotSourceSize;var S=c.disablePictureInPicture;c.onUserMedia,c.onUserMediaError,c.screenshotFormat,c.screenshotQuality,c.minScreenshotWidth,c.minScreenshotHeight,c.audioConstraints,c.videoConstraints,c.imageSmoothing;var v=c.mirrored,w=c.style,y=w===void 0?{}:w,f=c.children,R=U(c,["audio","forceScreenshotSourceSize","disablePictureInPicture","onUserMedia","onUserMediaError","screenshotFormat","screenshotQuality","minScreenshotWidth","minScreenshotHeight","audioConstraints","videoConstraints","imageSmoothing","mirrored","style","children"]),X=v?g(g({},y),{transform:(y.transform||"")+" scaleX(-1)"}):y,Q={getScreenshot:this.getScreenshot.bind(this)};return s.createElement(s.Fragment,null,s.createElement("video",g({autoPlay:!0,disablePictureInPicture:S,src:d.src,muted:!b,playsInline:!0,ref:function(J){e.video=J},style:X},R)),f&&f(Q))},u.defaultProps={audio:!1,disablePictureInPicture:!1,forceScreenshotSourceSize:!1,imageSmoothing:!0,mirrored:!1,onUserMedia:function(){},onUserMediaError:function(){},screenshotFormat:"image/webp",screenshotQuality:.92},u}(s.Component);a.default=E},react:function(n,a){n.exports=r}}).default})}(_)),_.exports}var Te=_e();const Oe=re(Te);var A;(function(t){t.PENDING="pending",t.SUCCESS="success",t.ERROR="error"})(A||(A={}));const je=({width:t})=>P(W,{width:t,children:[h(j,{size:"threeXL",color:z.gray60,content:N}),P(we,{children:["This app would like to use your camera.",h(Ue,{href:oe,rel:"noopener noreferrer",target:"_blank",children:"Learn how to allow access."})]})]}),We=({handleCapture:t,width:l,disabled:r,clearPhotoInProgress:n,setClearPhotoInProgress:a,facingMode:o,setFacingMode:s,testOverride:p})=>{const[g,U]=M.useState(p||"pending"),C=M.useRef(null),[E,m]=M.useState(l),u=M.useCallback(ie(1e3,m),[]);M.useEffect(()=>{u(l)},[l,u]);function e(){if(C.current!==null){const d=C.current.getScreenshot();t(d)}}const i=ae();return P(G,{"data-testid":"stCameraInputWebcamComponent",children:[g!=="success"&&!r&&!n?h(je,{width:E}):ne.isMobile&&h(Re,{switchFacingMode:s}),h(W,{"data-testid":"stCameraInputWebcamStyledBox",hidden:g!=="success"&&!r&&!n,width:E,children:!r&&h(Oe,{audio:!1,ref:C,screenshotFormat:"image/jpeg",screenshotQuality:1,width:E,height:E*9/16,style:{borderRadius:`${i.radii.default} ${i.radii.default} 0 0`},onUserMediaError:()=>{U("error")},onUserMedia:()=>{U("success"),a(!1)},videoConstraints:{width:{ideal:E},facingMode:o}})}),h(q,{onClick:e,disabled:g!=="success"||r||n,children:"Take Photo"})]})},Ve=150,Le=de.getLogger("CameraInput");class ke extends le.PureComponent{constructor(l){super(l),this.localFileIdCounter=1,this.RESTORED_FROM_WIDGET_STRING="RESTORED_FROM_WIDGET",this.formClearHelper=new Se,this.getProgress=()=>{if(this.state.files.length>0&&this.state.files[this.state.files.length-1].status.type==="uploading")return this.state.files[this.state.files.length-1].status.progress},this.setClearPhotoInProgress=r=>{this.setState({clearPhotoInProgress:r})},this.setFacingMode=()=>{this.setState(r=>({facingMode:r.facingMode===F.USER?F.ENVIRONMENT:F.USER}))},this.handleCapture=r=>{if(r===null)return Promise.resolve();this.setState({imgSrc:r,shutter:!0,minShutterEffectPassed:!1});const n=a=>new Promise(o=>setTimeout(o,a));return Be(r,`camera-input-${new Date().toISOString().replace(/:/g,"_")}.jpg`).then(a=>this.props.uploadClient.fetchFileURLs([a]).then(o=>({file:a,fileUrls:o[0]}))).then(({file:a,fileUrls:o})=>this.uploadFile(o,a)).then(()=>n(Ve)).then(()=>{this.setState((a,o)=>({imgSrc:r,shutter:a.shutter,minShutterEffectPassed:!0}))}).catch(a=>{Le.error(a)})},this.removeCapture=()=>{this.state.files.length!==0&&(this.state.files.forEach(r=>this.deleteFile(r.id)),this.setState({imgSrc:null,clearPhotoInProgress:!0}))},this.componentDidUpdate=()=>{if(this.status!=="ready")return;const r=this.createWidgetValue(),{element:n,widgetMgr:a,fragmentId:o}=this.props,s=a.getFileUploaderStateValue(n);ce(r,s)||a.setFileUploaderStateValue(n,r,{fromUi:!0},o)},this.onFormCleared=()=>{this.setState({files:[]},()=>{const r=this.createWidgetValue();if(x(r))return;this.setState({imgSrc:null});const{widgetMgr:n,element:a,fragmentId:o}=this.props;n.setFileUploaderStateValue(a,r,{fromUi:!0},o)})},this.deleteFile=r=>{const n=this.getFile(r);x(n)||(n.status.type==="uploading"&&n.status.cancelToken.cancel(),n.status.type==="uploaded"&&n.status.fileUrls.deleteUrl&&this.props.uploadClient.deleteFile(n.status.fileUrls.deleteUrl),this.removeFile(r))},this.addFile=r=>{this.setState(n=>({files:[...n.files,r]}))},this.removeFile=r=>{this.setState(n=>({files:n.files.filter(a=>a.id!==r)}))},this.getFile=r=>this.state.files.find(n=>n.id===r),this.updateFile=(r,n)=>{this.setState(a=>({files:a.files.map(o=>o.id===r?n:o)}))},this.onUploadComplete=(r,n)=>{this.setState(()=>({shutter:!1}));const a=this.getFile(r);x(a)||a.status.type!=="uploading"||this.updateFile(a.id,a.setStatus({type:"uploaded",fileId:n.fileId,fileUrls:n}))},this.onUploadProgress=(r,n)=>{const a=this.getFile(n);if(x(a)||a.status.type!=="uploading")return;const o=Math.round(r.loaded*100/r.total);a.status.progress!==o&&this.updateFile(n,a.setStatus({type:"uploading",cancelToken:a.status.cancelToken,progress:o}))},this.reset=()=>{this.setState({files:[],imgSrc:null})},this.uploadFile=(r,n)=>{const a=V.CancelToken.source(),o=new L(n.name,n.size,this.nextLocalFileId(),{type:"uploading",cancelToken:a,progress:1});this.addFile(o),this.props.uploadClient.uploadFile(this.props.element,r.uploadUrl,n,s=>this.onUploadProgress(s,o.id),a.token).then(()=>this.onUploadComplete(o.id,r)).catch(s=>{V.isCancel(s)||this.updateFile(o.id,o.setStatus({type:"error",errorMessage:s?s.toString():"Unknown error"}))})},this.state=this.initialValue}get initialValue(){const l={files:[],imgSrc:null,shutter:!1,minShutterEffectPassed:!0,clearPhotoInProgress:!1,facingMode:F.USER},{widgetMgr:r,element:n}=this.props,a=r.getFileUploaderStateValue(n);if(x(a))return l;const{uploadedFileInfo:o}=a;return x(o)||o.length===0?l:{files:o.map(s=>{const p=s.name,g=s.size,U=s.fileId,C=s.fileUrls;return new L(p,g,this.nextLocalFileId(),{type:"uploaded",fileId:U,fileUrls:C})}),imgSrc:o.length===0?"":this.RESTORED_FROM_WIDGET_STRING,shutter:!1,minShutterEffectPassed:!1,clearPhotoInProgress:!1,facingMode:F.USER}}componentWillUnmount(){this.formClearHelper.disconnect()}get status(){const l=r=>r.status.type==="uploading";return this.state.files.some(l)?"updating":"ready"}componentDidMount(){const l=this.createWidgetValue(),{element:r,widgetMgr:n,fragmentId:a}=this.props;n.getFileUploaderStateValue(r)===void 0&&n.setFileUploaderStateValue(r,l,{fromUi:!1},a)}createWidgetValue(){const l=this.state.files.filter(r=>r.status.type==="uploaded").map(r=>{const{name:n,size:a,status:o}=r;return new ue({fileId:o.fileId,fileUrls:o.fileUrls,name:n,size:a})});return new pe({uploadedFileInfo:l})}render(){var o;const{element:l,widgetMgr:r,disabled:n,width:a}=this.props;return this.formClearHelper.manageFormClearListener(r,l.formId,this.onFormCleared),P(G,{className:"stCameraInput","data-testid":"stCameraInput",children:[h(me,{label:l.label,disabled:n,labelVisibility:fe((o=l.labelVisibility)==null?void 0:o.value),children:l.help&&h(he,{children:h(ge,{content:l.help,placement:$.TOP_RIGHT})})}),this.state.imgSrc?P(ve,{children:[h(W,{width:a,children:this.state.imgSrc!==this.RESTORED_FROM_WIDGET_STRING&&h(Ce,{src:this.state.imgSrc,alt:"Snapshot",opacity:this.state.shutter||!this.state.minShutterEffectPassed?"50%":"100%",width:a,height:a*9/16})}),h(q,{onClick:this.removeCapture,progress:this.getProgress(),disabled:!!this.getProgress()||n,children:this.getProgress()?"Uploading...":P(Ie,{children:[h(j,{content:D,margin:"0 xs 0 0",size:"sm"})," Clear photo"]})})]}):h(We,{handleCapture:this.handleCapture,width:a,disabled:n,clearPhotoInProgress:this.state.clearPhotoInProgress,setClearPhotoInProgress:this.setClearPhotoInProgress,facingMode:this.state.facingMode,setFacingMode:this.setFacingMode,testOverride:this.props.testOverride})]})}nextLocalFileId(){return this.localFileIdCounter++}}function Be(t,l){return fetch(t).then(r=>r.arrayBuffer()).then(r=>new File([r],l,{type:"image/jpeg"}))}const He=se(ke);export{He as default};
@@ -1 +0,0 @@
1
- import{n as z,r as a,bh as U,y as k,cr as g,B,j as u,br as H,bF as L,bs as D,ba as j,bt as O,cs as _}from"./index.DC-G9iGy.js";import{u as w}from"./uniqueId.Bo8oca1r.js";import{u as K,a as $,b as q}from"./useOnInputChange.DbufYBDh.js";import{a as A}from"./useBasicWidgetState.B5KzIWBc.js";import{I as G}from"./InputInstructions.C6xqeBjt.js";import{I as N}from"./input.dDObaqA1.js";import"./inputUtils.CQWz5UKz.js";import"./FormClearHelper.lrCbq3h9.js";import"./base-input.DYN8lKyb.js";const J=z("div",{target:"e1o1zy6o0"})("position:relative;");function Q({disabled:e,element:t,widgetMgr:s,fragmentId:n}){var b;const[r,l]=a.useState(()=>I(s,t)??null),[S,W]=U(),[i,d]=a.useState(!1),y=a.useCallback(()=>{l(t.default??null),d(!0)},[t.default]),[T,c]=A({getStateFromWidgetMgr:I,getDefaultStateFromProto:X,getCurrStateFromProto:Y,updateWidgetMgrState:Z,element:t,widgetMgr:s,fragmentId:n,onFormCleared:y});K(T,r,l,i);const[x,m]=a.useState(!1),o=k(),[h]=a.useState(()=>w("text_input_")),{placeholder:C,formId:f}=t,p=a.useCallback(()=>{d(!1),c({value:r,fromUi:!0})},[r,c]),F=g({formId:f})?s.allowFormEnterToSubmit(f):i,V=x&&S>o.breakpoints.hideWidgetDetails,v=a.useCallback(()=>{i&&p(),m(!1)},[i,p]),E=a.useCallback(()=>{m(!0)},[]),P=$({formId:t.formId,maxChars:t.maxChars,setDirty:d,setUiValue:l,setValueWithSource:c}),R=q(t.formId,p,i,s,n);return B(J,{className:"stTextInput","data-testid":"stTextInput",ref:W,children:[u(O,{label:t.label,disabled:e,labelVisibility:H((b=t.labelVisibility)==null?void 0:b.value),htmlFor:h,children:t.help&&u(L,{children:u(D,{content:t.help,placement:j.TOP_RIGHT})})}),u(N,{value:r??"",placeholder:C,onBlur:v,onFocus:E,onChange:P,onKeyPress:R,"aria-label":t.label,disabled:e,id:h,type:M(t),autoComplete:t.autocomplete,overrides:{Input:{style:{minWidth:0,"::placeholder":{opacity:"0.7"},lineHeight:o.lineHeights.inputWidget,paddingRight:o.spacing.sm,paddingLeft:o.spacing.sm,paddingBottom:o.spacing.sm,paddingTop:o.spacing.sm}},Root:{props:{"data-testid":"stTextInputRootElement"},style:{height:o.sizes.minElementHeight,borderLeftWidth:o.sizes.borderWidth,borderRightWidth:o.sizes.borderWidth,borderTopWidth:o.sizes.borderWidth,borderBottomWidth:o.sizes.borderWidth}}}}),V&&u(G,{dirty:i,value:r??"",maxLength:t.maxChars,inForm:g({formId:t.formId}),allowEnterToSubmit:F})]})}function I(e,t){return e.getStringValue(t)??null}function X(e){return e.default??null}function Y(e){return e.value??null}function Z(e,t,s,n){t.setStringValue(e,s.value,{fromUi:s.fromUi},n)}function M(e){return e.type===_.Type.PASSWORD?"password":"text"}const lt=a.memo(Q);export{lt as default};
@@ -1 +0,0 @@
1
- import{n as f,r,j as c}from"./index.DC-G9iGy.js";const E=f("div",{target:"ea9qfvi0"})(()=>({lineHeight:0})),y=f("audio",{target:"ea9qfvi1"})(({theme:t})=>({width:"100%",height:t.sizes.minElementHeight,margin:0,padding:0}));function A({element:t,endpoints:l,elementMgr:o}){const n=r.useRef(null),{startTime:a,endTime:d,loop:u,autoplay:p}=t,m=r.useMemo(()=>{if(!t.id)return!0;const e=o.getElementState(t.id,"preventAutoplay");return e||o.setElementState(t.id,"preventAutoplay",!0),e??!1},[t.id,o]);r.useEffect(()=>{n.current&&(n.current.currentTime=a)},[a]),r.useEffect(()=>{const e=n.current,i=()=>{e&&(e.currentTime=t.startTime)};return e&&e.addEventListener("loadedmetadata",i),()=>{e&&e.removeEventListener("loadedmetadata",i)}},[t]),r.useEffect(()=>{const e=n.current;if(!e)return;let i=!1;const s=()=>{d>0&&e.currentTime>=d&&(u?(e.currentTime=a||0,e.play()):i||(i=!0,e.pause()))};return d>0&&e.addEventListener("timeupdate",s),()=>{e&&d>0&&e.removeEventListener("timeupdate",s)}},[d,u,a]),r.useEffect(()=>{const e=n.current;if(!e)return;const i=()=>{u&&(e.currentTime=a||0,e.play())};return e.addEventListener("ended",i),()=>{e&&e.removeEventListener("ended",i)}},[u,a]);const v=l.buildMediaURL(t.url);return c(E,{children:c(y,{className:"stAudio","data-testid":"stAudio",ref:n,controls:!0,autoPlay:p&&!m,src:v})})}const h=r.memo(A);export{h as default};
@@ -1 +0,0 @@
1
- import{r as u,R as f,aD as m,b5 as i,j as e,b6 as b,bp as B,b4 as p,b7 as D}from"./index.DC-G9iGy.js";import{c as h}from"./createDownloadLinkElement.DZMwyjvU.js";function w(n,o,t){return h({enforceDownloadInNewTab:t,url:n.buildMediaURL(o),filename:""})}function R(n){const{disabled:o,element:t,widgetMgr:l,endpoints:r,fragmentId:s}=n,{libConfig:{enforceDownloadInNewTab:d=!1}}=f.useContext(m);let a=i.SECONDARY;t.type==="primary"?a=i.PRIMARY:t.type==="tertiary"&&(a=i.TERTIARY);const c=()=>{t.ignoreRerun||l.setTriggerValue(t,{fromUi:!0},s),w(r,t.url,d).click()};return e("div",{className:"stDownloadButton","data-testid":"stDownloadButton",children:e(b,{help:t.help,containerWidth:t.useContainerWidth,children:e(B,{kind:a,size:p.SMALL,disabled:o,onClick:c,containerWidth:t.useContainerWidth,children:e(D,{icon:t.icon,label:t.label})})})})}const L=u.memo(R);export{L as default};
@@ -1 +0,0 @@
1
- import{n as o,r as h,B as m,j as i,aC as S}from"./index.DC-G9iGy.js";import{w as y,u as W,E as b}from"./withFullScreenWrapper.BKsmWq7e.js";import{S as g,T as L}from"./Toolbar.DPjbmT0r.js";const M=o("div",{target:"evl31sl0"})(({theme:t})=>({display:"flex",flexDirection:"row",flexWrap:"wrap",rowGap:t.spacing.lg,maxWidth:"100%",width:"fit-content"})),E=o("div",{target:"evl31sl1"})(({theme:t})=>({display:"flex",flexDirection:"column",alignItems:"stretch",width:"auto",flexGrow:0,">img":{borderRadius:t.radii.default}})),O=o("div",{target:"evl31sl2"})(({theme:t})=>({textAlign:"center",marginTop:t.spacing.xs,wordWrap:"break-word",padding:t.spacing.threeXS}));var p;(function(t){t[t.OriginalWidth=-1]="OriginalWidth",t[t.ColumnWidth=-2]="ColumnWidth",t[t.AutoWidth=-3]="AutoWidth",t[t.MinImageOrContainer=-4]="MinImageOrContainer",t[t.MaxImageOrContainer=-5]="MaxImageOrContainer"})(p||(p={}));function F({element:t,endpoints:u,disableFullscreenMode:x}){const{expanded:r,width:f,height:s,expand:w,collapse:C}=W(b),d=f||0;let n;const a=t.width;if([-1,-3,-4].includes(a))n=void 0;else if([-2,-5].includes(a))n=d;else if(a>0)n=a;else throw Error(`Invalid image width: ${a}`);const e={};return s&&r?(e.maxHeight=s,e.objectFit="contain"):(e.width=n,e.maxWidth="100%"),m(g,{width:d,height:s,useContainerWidth:r,topCentered:!0,children:[i(L,{target:g,isFullScreen:r,onExpand:w,onCollapse:C,disableFullscreenMode:x}),i(M,{className:"stImage","data-testid":"stImage",children:t.imgs.map((I,c)=>{const l=I;return m(E,{"data-testid":"stImageContainer",children:[i("img",{style:e,src:u.buildMediaURL(l.url),alt:c.toString()}),l.caption&&i(O,{"data-testid":"stImageCaption",style:e,children:i(S,{source:l.caption,allowHTML:!1,isCaption:!0,isLabel:!0})})]},c)})})]})}const T=y(F),k=h.memo(T);export{k as default};
@@ -1 +0,0 @@
1
- import{r,E as q,_ as J,cB as I,L as m,N as M,as as ut,n as x,y as ct,bh as dt,cr as pt,B as N,j as c,br as ft,bF as bt,bs as mt,ba as gt,bt as ht,bo as G}from"./index.DC-G9iGy.js";import{u as yt}from"./uniqueId.Bo8oca1r.js";import{u as It}from"./FormClearHelper.lrCbq3h9.js";import{I as wt}from"./InputInstructions.C6xqeBjt.js";import{s as Tt}from"./sprintf.D7DtBTRn.js";import{I as vt}from"./input.dDObaqA1.js";import"./base-input.DYN8lKyb.js";var Q=r.forwardRef(function(t,e){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return r.createElement(q,J({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 8 8"},t,{ref:e}),r.createElement("path",{d:"M0 3v2h8V3H0z"}))});Q.displayName="Minus";var Y=r.forwardRef(function(t,e){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return r.createElement(q,J({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 8 8"},t,{ref:e}),r.createElement("path",{d:"M3 0v3H0v2h3v3h2V5h3V3H5V0H3z"}))});Y.displayName="Plus";const Ct=ut.getLogger("NumberInput");function St(t){return m(t)||t===""?void 0:t}const z=({value:t,format:e,step:n,dataType:b})=>{if(m(t))return null;let a=St(e);if(m(a)&&M(n)){const d=n.toString();b===I.DataType.FLOAT&&n!==0&&d.includes(".")&&(a=`%0.${d.split(".")[1].length}f`)}if(m(a))return t.toString();try{return Tt.sprintf(a,t)}catch(d){return Ct.warn(`Error in sprintf(${a}, ${t}): ${d}`),String(t)}},Vt=(t,e,n)=>m(t)?!1:t-e>=n,kt=(t,e,n)=>m(t)?!1:t+e<=n,Rt=t=>(t.element.dataType===I.DataType.INT?t.widgetMgr.getIntValue(t.element):t.widgetMgr.getDoubleValue(t.element))??t.element.default??null,K=({step:t,dataType:e})=>t||(e===I.DataType.INT?1:.01),xt=x("div",{target:"e5tuigk0"})(({theme:t})=>({display:"flex",flexDirection:"row",flexWrap:"nowrap",alignItems:"center",height:t.sizes.minElementHeight,borderWidth:t.sizes.borderWidth,borderStyle:"solid",borderColor:t.colors.widgetBorderColor??t.colors.secondaryBg,transitionDuration:"200ms",transitionProperty:"border",transitionTimingFunction:"cubic-bezier(0.2, 0.8, 0.4, 1)",borderRadius:t.radii.default,overflow:"hidden","&.focused":{borderColor:t.colors.primary},input:{MozAppearance:"textfield","&::-webkit-inner-spin-button, &::-webkit-outer-spin-button":{WebkitAppearance:"none",margin:t.spacing.none}}})),Dt=x("div",{target:"e5tuigk1"})({display:"flex",flexDirection:"row",alignSelf:"stretch"}),X=x("button",{target:"e5tuigk2"})(({theme:t})=>({margin:t.spacing.none,border:"none",height:t.sizes.full,display:"flex",alignItems:"center",width:t.sizes.numberInputControlsWidth,justifyContent:"center",color:t.colors.bodyText,transition:"color 300ms, backgroundColor 300ms",backgroundColor:t.colors.secondaryBg,"&:hover:enabled, &:focus:enabled":{color:t.colors.white,backgroundColor:t.colors.primary,transition:"none",outline:"none"},"&:active":{outline:"none",border:"none"},"&:last-of-type":{borderTopRightRadius:t.radii.default,borderBottomRightRadius:t.radii.default},"&:disabled":{cursor:"not-allowed",color:t.colors.fadedText40}})),Et=x("div",{target:"e5tuigk3"})(({theme:t,clearable:e})=>({position:"absolute",marginRight:t.spacing.twoXS,left:0,right:`calc(${t.sizes.numberInputControlsWidth} * 2 + ${e?"1em":"0em"})`})),Ft=({disabled:t,element:e,widgetMgr:n,fragmentId:b})=>{var j;const a=ct(),{dataType:d,id:v,formId:p,default:B,format:W,min:g,max:h}=e,[L,Z]=dt(),[s,tt]=r.useState(()=>K(e)),A=Rt({element:e,widgetMgr:n}),[y,w]=r.useState(!1),[l,T]=r.useState(A),[H,C]=r.useState(()=>z({value:A,...e,step:s})),[P,U]=r.useState(!1),S=r.useRef(null),$=r.useRef(yt("number_input_")),V=Vt(l,s,g),k=kt(l,s,h),O=pt({formId:p}),et=O?n.allowFormEnterToSubmit(p):y,rt=P&&L>a.breakpoints.hideWidgetDetails;r.useEffect(()=>{tt(K({step:e.step,dataType:e.dataType}))},[e.dataType,e.step]);const u=r.useCallback(({value:o,source:i})=>{var f;if(M(o)&&(g>o||o>h))(f=S.current)==null||f.reportValidity();else{const R=o??B??null;switch(d){case I.DataType.INT:n.setIntValue({id:v,formId:p},R,i,b);break;case I.DataType.FLOAT:n.setDoubleValue({id:v,formId:p},R,i,b);break;default:throw new Error("Invalid data type")}w(!1),T(R),C(z({value:R,dataType:d,format:W,step:s}))}},[g,h,S,n,b,s,d,v,p,B,W]),ot=r.useCallback(()=>{y&&u({value:l,source:{fromUi:!0}}),U(!1)},[y,l,u]),nt=r.useCallback(()=>{U(!0)},[]),_=r.useCallback(()=>{const{value:o}=e;e.setValue=!1,T(o??null),C(z({value:o??null,...e,step:s})),u({value:o??null,source:{fromUi:!1}})},[e,s,u]);r.useEffect(()=>{e.setValue?_():u({value:l,source:{fromUi:!1}});const o=S.current;if(o){const i=f=>{f.preventDefault()};return o.addEventListener("wheel",i),()=>{o.removeEventListener("wheel",i)}}},[]),e.setValue&&_();const D=m(e.default)&&!t,at=r.useCallback(()=>{const o=e.default??null;T(o),u({value:o,source:{fromUi:!0}})},[e]);It({element:e,widgetMgr:n,onFormCleared:at});const st=o=>{const{value:i}=o.target;if(i==="")w(!0),T(null),C(null);else{let f;e.dataType===I.DataType.INT?f=parseInt(i,10):f=parseFloat(i),w(!0),T(f),C(i)}},E=r.useCallback(()=>{k&&(w(!0),u({value:(l??g)+s,source:{fromUi:!0}}))},[l,g,s,k]),F=r.useCallback(()=>{V&&(w(!0),u({value:(l??h)-s,source:{fromUi:!0}}))},[l,h,s,V]),it=r.useCallback(o=>{const{key:i}=o;switch(i){case"ArrowUp":o.preventDefault(),E();break;case"ArrowDown":o.preventDefault(),F();break}},[E,F]),lt=r.useCallback(o=>{o.key==="Enter"&&(y&&u({value:l,source:{fromUi:!0}}),n.allowFormEnterToSubmit(p)&&n.submitForm(p,b))},[y,l,u,n,p,b]);return N("div",{className:"stNumberInput","data-testid":"stNumberInput",ref:Z,children:[c(ht,{label:e.label,disabled:t,labelVisibility:ft((j=e.labelVisibility)==null?void 0:j.value),htmlFor:$.current,children:e.help&&c(bt,{children:c(mt,{content:e.help,placement:gt.TOP_RIGHT})})}),N(xt,{className:P?"focused":"","data-testid":"stNumberInputContainer",children:[c(vt,{type:"number",inputRef:S,value:H??"",placeholder:e.placeholder,onBlur:ot,onFocus:nt,onChange:st,onKeyPress:lt,onKeyDown:it,clearable:D,clearOnEscape:D,disabled:t,"aria-label":e.label,id:$.current,overrides:{ClearIconContainer:{style:{padding:0}},ClearIcon:{props:{overrides:{Svg:{style:{color:a.colors.darkGray,padding:a.spacing.threeXS,height:a.sizes.clearIconSize,width:a.sizes.clearIconSize,":hover":{fill:a.colors.bodyText}}}}}},Input:{props:{"data-testid":"stNumberInputField",step:s,min:g,max:h,type:"number",inputMode:""},style:{lineHeight:a.lineHeights.inputWidget,paddingRight:a.spacing.sm,paddingLeft:a.spacing.sm,paddingBottom:a.spacing.sm,paddingTop:a.spacing.sm}},InputContainer:{style:()=>({borderTopRightRadius:0,borderBottomRightRadius:0})},Root:{style:{borderTopRightRadius:0,borderBottomRightRadius:0,borderTopLeftRadius:0,borderBottomLeftRadius:0,borderLeftWidth:0,borderRightWidth:0,borderTopWidth:0,borderBottomWidth:0,paddingRight:0}}}}),L>a.breakpoints.hideNumberInputControls&&N(Dt,{children:[c(X,{"data-testid":"stNumberInputStepDown",onClick:F,disabled:!V||t,tabIndex:-1,children:c(G,{content:Q,size:"xs",color:V?"inherit":a.colors.disabled})}),c(X,{"data-testid":"stNumberInputStepUp",onClick:E,disabled:!k||t,tabIndex:-1,children:c(G,{content:Y,size:"xs",color:k?"inherit":a.colors.disabled})})]})]}),rt&&c(Et,{clearable:D,children:c(wt,{dirty:y,value:H??"",inForm:O,allowEnterToSubmit:et})})]})},Pt=r.memo(Ft);export{Pt as default};
@@ -1 +0,0 @@
1
- import{n as R,r,y as M,c1 as T,c2 as W,B as C,j as l,br as V,bF as L,bs as O,ba as P,bt as k,c0 as B,c3 as E,bY as N,c4 as $,bC as F}from"./index.DC-G9iGy.js";import{a as A}from"./useBasicWidgetState.B5KzIWBc.js";import"./FormClearHelper.lrCbq3h9.js";const H=R("div",{target:"euzcfsp0"})(({theme:s})=>({"span[aria-disabled='true']":{background:s.colors.fadedText05}})),D=(s,t)=>s.getIntArrayValue(t),U=s=>s.default??null,j=s=>s.value??null,G=(s,t,a,u)=>{t.setIntArrayValue(s,a.value,{fromUi:a.fromUi},u)},K=s=>{var S;const{element:t,widgetMgr:a,fragmentId:u}=s,e=M(),[n,g]=A({getStateFromWidgetMgr:D,getDefaultStateFromProto:U,getCurrStateFromProto:j,updateWidgetMgrState:G,element:t,widgetMgr:a,fragmentId:u}),m=t.maxSelections>0&&n.length>=t.maxSelections,y=r.useMemo(()=>{if(t.maxSelections===0)return"No results";if(n.length===t.maxSelections){const o=t.maxSelections!==1?"options":"option";return`You can only select up to ${t.maxSelections} ${o}. Remove an option first.`}return"No results"},[t.maxSelections,n.length]),f=r.useMemo(()=>n.map(o=>{const i=t.options[o];return{value:o.toString(),label:i}}),[t.options,n]),h=r.useCallback(o=>{const i=()=>{var d;const p=(d=o.option)==null?void 0:d.value;return parseInt(p,10)};switch(o.type){case"remove":return T(n,i());case"clear":return[];case"select":return n.concat([i()]);default:throw new Error(`State transition is unknown: ${o.type}`)}},[n]),v=r.useCallback(o=>{t.maxSelections&&o.type==="select"&&n.length>=t.maxSelections||g({value:h(o),fromUi:!0})},[t.maxSelections,h,g,n.length]),x=r.useCallback((o,i)=>{if(m)return[];const p=o.filter(d=>!n.includes(Number(d.value)));return W(p,i)},[m,n]),{options:c}=t,b=c.length===0?!0:s.disabled,z=c.length===0?"No options to select.":t.placeholder,w=c.map((o,i)=>({label:o,value:i.toString()})),I=c.length>10;return C("div",{className:"stMultiSelect","data-testid":"stMultiSelect",children:[l(k,{label:t.label,disabled:b,labelVisibility:V((S=t.labelVisibility)==null?void 0:S.value),children:t.help&&l(L,{children:l(O,{content:t.help,placement:P.TOP_RIGHT})})}),l(H,{children:l(B,{options:w,labelKey:"label",valueKey:"value","aria-label":t.label,placeholder:z,type:$.select,multi:!0,onChange:v,value:f,disabled:b,size:"compact",noResultsMsg:y,filterOptions:x,closeOnSelect:!1,overrides:{Popover:{props:{overrides:{Body:{style:()=>({marginTop:e.spacing.px})}}}},SelectArrow:{component:N,props:{overrides:{Svg:{style:()=>({width:e.iconSizes.xl,height:e.iconSizes.xl})}}}},IconsContainer:{style:()=>({paddingRight:e.spacing.sm})},ControlContainer:{style:{minHeight:e.sizes.minElementHeight,borderLeftWidth:e.sizes.borderWidth,borderRightWidth:e.sizes.borderWidth,borderTopWidth:e.sizes.borderWidth,borderBottomWidth:e.sizes.borderWidth}},Placeholder:{style:()=>({flex:"inherit",opacity:"0.7"})},ValueContainer:{style:()=>({paddingLeft:e.spacing.sm,paddingTop:e.spacing.none,paddingBottom:e.spacing.none,paddingRight:e.spacing.none})},ClearIcon:{props:{overrides:{Svg:{style:{color:e.colors.darkGray,padding:e.spacing.threeXS,height:e.sizes.clearIconSize,width:e.sizes.clearIconSize,cursor:"pointer",":hover":{fill:e.colors.bodyText}}}}}},SearchIcon:{style:{color:e.colors.darkGray}},Tag:{props:{overrides:{Root:{style:{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:F.isMobile&&I===!1?"readonly":null}},Dropdown:{component:E}}})})]})},q=r.memo(K);export{q as default};
@@ -1 +0,0 @@
1
- import{n as p,r as n,aD as x,bg as h,y,bh as C,j as i,aZ as w}from"./index.DC-G9iGy.js";const b=p("div",{target:"ek8upll0"})(({theme:e,isExpanded:t})=>({width:"100%",...t?{position:"fixed",top:0,left:0,bottom:0,right:0,background:e.colors.bgColor,zIndex:e.zIndices.fullscreenWrapper,padding:e.spacing.md,paddingTop:e.sizes.fullScreenHeaderHeight,overflow:["auto","overlay"],display:"flex",alignItems:"center",justifyContent:"center"}:{}})),f=n.createContext(null);f.displayName="ElementFullscreenContext";const g=e=>{const t=n.useContext(e);if(t==null)throw new Error(`useRequiredContext: ${e.displayName??"context"} not found`);return t},F=()=>{const{setFullScreen:e}=n.useContext(x),[t,u]=n.useState(!1),{fullHeight:s,fullWidth:c}=g(h),o=n.useCallback(a=>{u(a),e(a)},[e]),d=n.useCallback(()=>{document.body.style.overflow="hidden",o(!0)},[o]),l=n.useCallback(()=>{document.body.style.overflow="unset",o(!1)},[o]),r=n.useCallback(a=>{a.keyCode===27&&t&&l()},[l,t]);return n.useEffect(()=>(document.addEventListener("keydown",r,!1),()=>{document.removeEventListener("keydown",r,!1)}),[r]),n.useMemo(()=>({expanded:t,zoomIn:d,zoomOut:l,fullHeight:s,fullWidth:c}),[t,d,l,s,c])},S=({children:e,height:t})=>{const u=y(),{expanded:s,fullHeight:c,fullWidth:o,zoomIn:d,zoomOut:l}=F(),[r,a]=C(),m=n.useMemo(()=>({width:s?o:r,height:s?c:t,expanded:s,expand:d,collapse:l}),[s,c,o,t,r,d,l]);return i(f.Provider,{value:m,children:i(b,{ref:a,isExpanded:s,"data-testid":"stFullScreenFrame",theme:u,children:e})})};function E(e){const t=u=>i(S,{children:i(e,{...u})});return t.displayName=`withFullScreenWrapper(${e.displayName||e.name})`,w(t,e)}export{f as E,g as u,E as w};