streamlit-nightly 1.46.1.dev20250622__py3-none-any.whl → 1.46.1.dev20250623__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 (81) hide show
  1. streamlit/config.py +29 -4
  2. streamlit/elements/code.py +3 -2
  3. streamlit/elements/form.py +2 -1
  4. streamlit/elements/widgets/button_group.py +40 -1
  5. streamlit/proto/NewSession_pb2.py +16 -16
  6. streamlit/proto/NewSession_pb2.pyi +12 -2
  7. streamlit/static/index.html +1 -1
  8. streamlit/static/manifest.json +214 -214
  9. streamlit/static/static/js/{ErrorOutline.esm.DV0xGZr0.js → ErrorOutline.esm.6jfnPRv8.js} +1 -1
  10. streamlit/static/static/js/{FileDownload.esm.B5OHehZX.js → FileDownload.esm.Cnl6nXhQ.js} +1 -1
  11. streamlit/static/static/js/{FileHelper.CIllbZ_T.js → FileHelper.cSMax3oI.js} +1 -1
  12. streamlit/static/static/js/{FormClearHelper.B4Xd3eAo.js → FormClearHelper.4d5unoV3.js} +1 -1
  13. streamlit/static/static/js/{Hooks.DCO6FLy2.js → Hooks.DZueJ4q3.js} +1 -1
  14. streamlit/static/static/js/{InputInstructions.8iiiZurT.js → InputInstructions.TPKmOf1e.js} +1 -1
  15. streamlit/static/static/js/{ProgressBar.7dxhGygF.js → ProgressBar.9KpGrB3q.js} +2 -2
  16. streamlit/static/static/js/{RenderInPortalIfExists.D4Mwwa5a.js → RenderInPortalIfExists.B6RP7YdE.js} +1 -1
  17. streamlit/static/static/js/{Toolbar.MfU_z1Pl.js → Toolbar.D6JzrqIQ.js} +1 -1
  18. streamlit/static/static/js/{base-input.CD_ZJb6M.js → base-input.Bnn6NZuq.js} +3 -3
  19. streamlit/static/static/js/{checkbox.DHKvEdaN.js → checkbox.B02sfadZ.js} +2 -2
  20. streamlit/static/static/js/{createSuper.CYFdzcEc.js → createSuper.SaBC7ngU.js} +1 -1
  21. streamlit/static/static/js/{data-grid-overlay-editor.CASJyml1.js → data-grid-overlay-editor.BLEevpKv.js} +1 -1
  22. streamlit/static/static/js/{downloader.BujRtTJQ.js → downloader.D-PXYVMM.js} +1 -1
  23. streamlit/static/static/js/{es6.BzpKRHTl.js → es6.Do8H78Dr.js} +2 -2
  24. streamlit/static/static/js/{iframeResizer.contentWindow.DdNKjgL-.js → iframeResizer.contentWindow.DaJOnu7q.js} +1 -1
  25. streamlit/static/static/js/{index.B5CWfjKJ.js → index.-Vk-JZRg.js} +1 -1
  26. streamlit/static/static/js/{index.CGTmrxQF.js → index.0fF-8FTP.js} +1 -1
  27. streamlit/static/static/js/{index.e7dbVhPC.js → index.AoD39gIA.js} +1 -1
  28. streamlit/static/static/js/{index.CNPzEZK5.js → index.B24flF1W.js} +1 -1
  29. streamlit/static/static/js/{index.Cd7pSbPb.js → index.BCrknDkt.js} +1 -1
  30. streamlit/static/static/js/{index.BYzu-8O6.js → index.Bd-qicCf.js} +1 -1
  31. streamlit/static/static/js/{index.CCloC5pv.js → index.BtrfeCpV.js} +1 -1
  32. streamlit/static/static/js/{index.pFmc4GEU.js → index.BzMniOtq.js} +1 -1
  33. streamlit/static/static/js/{index.BLKUfpY9.js → index.CEKUbLdO.js} +1 -1
  34. streamlit/static/static/js/{index.RGCDyZwL.js → index.CI88kTQV.js} +1 -1
  35. streamlit/static/static/js/{index.CYj0qmZR.js → index.CJ3PXy05.js} +1 -1
  36. streamlit/static/static/js/{index.DSUJ0c6K.js → index.CPO9FnfH.js} +1 -1
  37. streamlit/static/static/js/{index.kWcXsYvp.js → index.CRVtayit.js} +1 -1
  38. streamlit/static/static/js/{index.D33D625y.js → index.CTa7TVdK.js} +1 -1
  39. streamlit/static/static/js/{index.C4zuEVgR.js → index.CWjjjpBo.js} +1 -1
  40. streamlit/static/static/js/{index.ofH1nMYX.js → index.C_sZeM1t.js} +1 -1
  41. streamlit/static/static/js/{index.BF7tH6NK.js → index.CakTEdtN.js} +1 -1
  42. streamlit/static/static/js/{index.CwTKDRFO.js → index.CtwU5Nda.js} +1 -1
  43. streamlit/static/static/js/{index.XK0W3e5F.js → index.CvLo0WJS.js} +6 -6
  44. streamlit/static/static/js/{index.BBxmbB8u.js → index.DAD1VX9u.js} +1 -1
  45. streamlit/static/static/js/{index.EBCAt5lH.js → index.DAjyn_pv.js} +1 -1
  46. streamlit/static/static/js/{index.BRALdPQV.js → index.DC2Olf5i.js} +1 -1
  47. streamlit/static/static/js/{index.CW_IFCtB.js → index.DFoPqIqm.js} +1 -1
  48. streamlit/static/static/js/{index.l0tODCkU.js → index.DIWyCwyy.js} +1 -1
  49. streamlit/static/static/js/{index.UT1zwx6I.js → index.DLIUt_5s.js} +1 -1
  50. streamlit/static/static/js/{index.DvR5u8dP.js → index.DRY0GdE8.js} +1 -1
  51. streamlit/static/static/js/{index.SXFI-bxq.js → index.DSL_L5gy.js} +1 -1
  52. streamlit/static/static/js/{index.BmCdua0H.js → index.DdZFxK5_.js} +1 -1
  53. streamlit/static/static/js/{index.cKbFF_YI.js → index.Dii3Kpb1.js} +1 -1
  54. streamlit/static/static/js/{index.C4XoxASX.js → index.DwRhVQCG.js} +1 -1
  55. streamlit/static/static/js/{index.fSbFmy0I.js → index.G-xNC_zR.js} +1 -1
  56. streamlit/static/static/js/{index.BFZO9BwP.js → index.GQSrzYvF.js} +136 -110
  57. streamlit/static/static/js/{index.CweOixv3.js → index.HuXynmwU.js} +2 -2
  58. streamlit/static/static/js/index.Ur6r0Scb.js +2 -0
  59. streamlit/static/static/js/{index.31L_nN7t.js → index.agUYkS1G.js} +1 -1
  60. streamlit/static/static/js/{index.B5SF9Bg7.js → index.jvvQMO9i.js} +1 -1
  61. streamlit/static/static/js/{index.25z42FPO.js → index.pvWqfcnM.js} +1 -1
  62. streamlit/static/static/js/{input.Cc_dbkdO.js → input.BsbIu3V-.js} +2 -2
  63. streamlit/static/static/js/{memory.BUJhegEf.js → memory.DLgZAYR-.js} +1 -1
  64. streamlit/static/static/js/{mergeWith.BihcIFU9.js → mergeWith.dTGwC2vZ.js} +1 -1
  65. streamlit/static/static/js/{number-overlay-editor.t4ZZhdY2.js → number-overlay-editor.1fvDrqrD.js} +1 -1
  66. streamlit/static/static/js/{possibleConstructorReturn.B1UQDThh.js → possibleConstructorReturn.Dk_wv59O.js} +1 -1
  67. streamlit/static/static/js/{sandbox.CISGR_4e.js → sandbox.Cg6lG2Sf.js} +1 -1
  68. streamlit/static/static/js/{textarea.BXc2-al_.js → textarea.DBC27xex.js} +2 -2
  69. streamlit/static/static/js/{timepicker.CmUmXHhB.js → timepicker.7h0iYUgW.js} +4 -4
  70. streamlit/static/static/js/{toConsumableArray.YAwDRCO5.js → toConsumableArray.B_hGxMM4.js} +1 -1
  71. streamlit/static/static/js/{uniqueId.B5Af-iXZ.js → uniqueId.OfTwqNZo.js} +1 -1
  72. streamlit/static/static/js/{useBasicWidgetState.GEeXHHcq.js → useBasicWidgetState.BwLEUZab.js} +1 -1
  73. streamlit/static/static/js/{useOnInputChange.BUgD6B0U.js → useOnInputChange.dALPpkgr.js} +1 -1
  74. streamlit/static/static/js/{withFullScreenWrapper.Pb8hqWLi.js → withFullScreenWrapper.CYjEH_RX.js} +1 -1
  75. {streamlit_nightly-1.46.1.dev20250622.dist-info → streamlit_nightly-1.46.1.dev20250623.dist-info}/METADATA +1 -1
  76. {streamlit_nightly-1.46.1.dev20250622.dist-info → streamlit_nightly-1.46.1.dev20250623.dist-info}/RECORD +80 -80
  77. streamlit/static/static/js/index.BsUjj-QK.js +0 -2
  78. {streamlit_nightly-1.46.1.dev20250622.data → streamlit_nightly-1.46.1.dev20250623.data}/scripts/streamlit.cmd +0 -0
  79. {streamlit_nightly-1.46.1.dev20250622.dist-info → streamlit_nightly-1.46.1.dev20250623.dist-info}/WHEEL +0 -0
  80. {streamlit_nightly-1.46.1.dev20250622.dist-info → streamlit_nightly-1.46.1.dev20250623.dist-info}/entry_points.txt +0 -0
  81. {streamlit_nightly-1.46.1.dev20250622.dist-info → streamlit_nightly-1.46.1.dev20250623.dist-info}/top_level.txt +0 -0
@@ -1,4 +1,4 @@
1
- import{r as h,E as $,_ as H,b8 as pt,bh as _t,bi as $t,bj as Ht,M as X,O as q,aE as Vt,n as P,bk as jt,C as N,j as v,bl as Gt,b2 as Xt,bm as qt,bn as Yt,l as Kt,z as Jt,bo as tt,H as Qt,aA as Zt,bp as te,bq as ee,b7 as ie,br as ne}from"./index.BFZO9BwP.js";import{u as se,F as re}from"./FormClearHelper.B4Xd3eAo.js";import{T as oe,a as mt}from"./Toolbar.MfU_z1Pl.js";import{u as ae}from"./Hooks.DCO6FLy2.js";import{c as le}from"./createDownloadLinkElement.DZMwyjvU.js";import{F as ce,D as de}from"./FileDownload.esm.B5OHehZX.js";var yt=h.forwardRef(function(n,t){var e={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return h.createElement($,H({iconAttrs:e,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},n,{ref:t}),h.createElement("g",{fill:"none"},h.createElement("rect",{width:24,height:24}),h.createElement("rect",{width:24,height:24}),h.createElement("rect",{width:24,height:24})),h.createElement("path",{d:"M12 14c1.66 0 3-1.34 3-3V5c0-1.66-1.34-3-3-3S9 3.34 9 5v6c0 1.66 1.34 3 3 3z"}),h.createElement("path",{d:"M17 11c0 2.76-2.24 5-5 5s-5-2.24-5-5H5c0 3.53 2.61 6.43 6 6.92V21h2v-3.08c3.39-.49 6-3.39 6-6.92h-2z"}))});yt.displayName="Mic";var bt=h.forwardRef(function(n,t){var e={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return h.createElement($,H({iconAttrs:e,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},n,{ref:t}),h.createElement("rect",{width:24,height:24,fill:"none"}),h.createElement("path",{d:"M8 19c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2s-2 .9-2 2v10c0 1.1.9 2 2 2zm6-12v10c0 1.1.9 2 2 2s2-.9 2-2V7c0-1.1-.9-2-2-2s-2 .9-2 2z"}))});bt.displayName="Pause";var wt=h.forwardRef(function(n,t){var e={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return h.createElement($,H({iconAttrs:e,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},n,{ref:t}),h.createElement("rect",{width:24,height:24,fill:"none"}),h.createElement("path",{d:"M8 6.82v10.36c0 .79.87 1.27 1.54.84l8.14-5.18a1 1 0 000-1.69L9.54 5.98A.998.998 0 008 6.82z"}))});wt.displayName="PlayArrow";var St=h.forwardRef(function(n,t){var e={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return h.createElement($,H({iconAttrs:e,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},n,{ref:t}),h.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),h.createElement("path",{d:"M17.65 6.35a7.95 7.95 0 00-6.48-2.31c-3.67.37-6.69 3.35-7.1 7.02C3.52 15.91 7.27 20 12 20a7.98 7.98 0 007.21-4.56c.32-.67-.16-1.44-.9-1.44-.37 0-.72.2-.88.53a5.994 5.994 0 01-6.8 3.31c-2.22-.49-4.01-2.3-4.48-4.52A6.002 6.002 0 0112 6c1.66 0 3.14.69 4.22 1.78l-1.51 1.51c-.63.63-.19 1.71.7 1.71H19c.55 0 1-.45 1-1V6.41c0-.89-1.08-1.34-1.71-.71l-.64.65z"}))});St.displayName="Refresh";var Ct=h.forwardRef(function(n,t){var e={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return h.createElement($,H({iconAttrs:e,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},n,{ref:t}),h.createElement("g",{fill:"none"},h.createElement("rect",{width:24,height:24}),h.createElement("rect",{width:24,height:24})),h.createElement("path",{fillRule:"evenodd",d:"M9 16h6c.55 0 1-.45 1-1V9c0-.55-.45-1-1-1H9c-.55 0-1 .45-1 1v6c0 .55.45 1 1 1zm3-14C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2z"}))});Ct.displayName="StopCircle";function R(n,t,e,i){return new(e||(e=Promise))(function(s,r){function a(c){try{d(i.next(c))}catch(l){r(l)}}function o(c){try{d(i.throw(c))}catch(l){r(l)}}function d(c){var l;c.done?s(c.value):(l=c.value,l instanceof e?l:new e(function(p){p(l)})).then(a,o)}d((i=i.apply(n,t||[])).next())})}let V=class{constructor(){this.listeners={}}on(t,e,i){if(this.listeners[t]||(this.listeners[t]=new Set),this.listeners[t].add(e),i==null?void 0:i.once){const s=()=>{this.un(t,s),this.un(t,e)};return this.on(t,s),s}return()=>this.un(t,e)}un(t,e){var i;(i=this.listeners[t])===null||i===void 0||i.delete(e)}once(t,e){return this.on(t,e,{once:!0})}unAll(){this.listeners={}}emit(t,...e){this.listeners[t]&&this.listeners[t].forEach(i=>i(...e))}};const j={decode:function(n,t){return R(this,void 0,void 0,function*(){const e=new AudioContext({sampleRate:t});return e.decodeAudioData(n).finally(()=>e.close())})},createBuffer:function(n,t){return typeof n[0]=="number"&&(n=[n]),function(e){const i=e[0];if(i.some(s=>s>1||s<-1)){const s=i.length;let r=0;for(let a=0;a<s;a++){const o=Math.abs(i[a]);o>r&&(r=o)}for(const a of e)for(let o=0;o<s;o++)a[o]/=r}}(n),{duration:t,length:n[0].length,sampleRate:n[0].length/t,numberOfChannels:n.length,getChannelData:e=>n==null?void 0:n[e],copyFromChannel:AudioBuffer.prototype.copyFromChannel,copyToChannel:AudioBuffer.prototype.copyToChannel}}};function Et(n,t){const e=t.xmlns?document.createElementNS(t.xmlns,n):document.createElement(n);for(const[i,s]of Object.entries(t))if(i==="children")for(const[r,a]of Object.entries(t))typeof a=="string"?e.appendChild(document.createTextNode(a)):e.appendChild(Et(r,a));else i==="style"?Object.assign(e.style,s):i==="textContent"?e.textContent=s:e.setAttribute(i,s.toString());return e}function ft(n,t,e){const i=Et(n,t||{});return e==null||e.appendChild(i),i}var he=Object.freeze({__proto__:null,createElement:ft,default:ft});const ue={fetchBlob:function(n,t,e){return R(this,void 0,void 0,function*(){const i=yield fetch(n,e);if(i.status>=400)throw new Error(`Failed to fetch ${n}: ${i.status} (${i.statusText})`);return function(s,r){R(this,void 0,void 0,function*(){if(!s.body||!s.headers)return;const a=s.body.getReader(),o=Number(s.headers.get("Content-Length"))||0;let d=0;const c=p=>R(this,void 0,void 0,function*(){d+=(p==null?void 0:p.length)||0;const u=Math.round(d/o*100);r(u)}),l=()=>R(this,void 0,void 0,function*(){let p;try{p=yield a.read()}catch{return}p.done||(c(p.value),yield l())});l()})}(i.clone(),t),i.blob()})}};class pe extends V{constructor(t){super(),this.isExternalMedia=!1,t.media?(this.media=t.media,this.isExternalMedia=!0):this.media=document.createElement("audio"),t.mediaControls&&(this.media.controls=!0),t.autoplay&&(this.media.autoplay=!0),t.playbackRate!=null&&this.onMediaEvent("canplay",()=>{t.playbackRate!=null&&(this.media.playbackRate=t.playbackRate)},{once:!0})}onMediaEvent(t,e,i){return this.media.addEventListener(t,e,i),()=>this.media.removeEventListener(t,e,i)}getSrc(){return this.media.currentSrc||this.media.src||""}revokeSrc(){const t=this.getSrc();t.startsWith("blob:")&&URL.revokeObjectURL(t)}canPlayType(t){return this.media.canPlayType(t)!==""}setSrc(t,e){const i=this.getSrc();if(t&&i===t)return;this.revokeSrc();const s=e instanceof Blob&&(this.canPlayType(e.type)||!t)?URL.createObjectURL(e):t;i&&(this.media.src="");try{this.media.src=s}catch{this.media.src=t}}destroy(){this.isExternalMedia||(this.media.pause(),this.media.remove(),this.revokeSrc(),this.media.src="",this.media.load())}setMediaElement(t){this.media=t}play(){return R(this,void 0,void 0,function*(){return this.media.play()})}pause(){this.media.pause()}isPlaying(){return!this.media.paused&&!this.media.ended}setTime(t){this.media.currentTime=Math.max(0,Math.min(t,this.getDuration()))}getDuration(){return this.media.duration}getCurrentTime(){return this.media.currentTime}getVolume(){return this.media.volume}setVolume(t){this.media.volume=t}getMuted(){return this.media.muted}setMuted(t){this.media.muted=t}getPlaybackRate(){return this.media.playbackRate}isSeeking(){return this.media.seeking}setPlaybackRate(t,e){e!=null&&(this.media.preservesPitch=e),this.media.playbackRate=t}getMediaElement(){return this.media}setSinkId(t){return this.media.setSinkId(t)}}class U extends V{constructor(t,e){super(),this.timeouts=[],this.isScrollable=!1,this.audioData=null,this.resizeObserver=null,this.lastContainerWidth=0,this.isDragging=!1,this.subscriptions=[],this.unsubscribeOnScroll=[],this.subscriptions=[],this.options=t;const i=this.parentFromOptionsContainer(t.container);this.parent=i;const[s,r]=this.initHtml();i.appendChild(s),this.container=s,this.scrollContainer=r.querySelector(".scroll"),this.wrapper=r.querySelector(".wrapper"),this.canvasWrapper=r.querySelector(".canvases"),this.progressWrapper=r.querySelector(".progress"),this.cursor=r.querySelector(".cursor"),e&&r.appendChild(e),this.initEvents()}parentFromOptionsContainer(t){let e;if(typeof t=="string"?e=document.querySelector(t):t instanceof HTMLElement&&(e=t),!e)throw new Error("Container not found");return e}initEvents(){const t=e=>{const i=this.wrapper.getBoundingClientRect(),s=e.clientX-i.left,r=e.clientY-i.top;return[s/i.width,r/i.height]};if(this.wrapper.addEventListener("click",e=>{const[i,s]=t(e);this.emit("click",i,s)}),this.wrapper.addEventListener("dblclick",e=>{const[i,s]=t(e);this.emit("dblclick",i,s)}),this.options.dragToSeek!==!0&&typeof this.options.dragToSeek!="object"||this.initDrag(),this.scrollContainer.addEventListener("scroll",()=>{const{scrollLeft:e,scrollWidth:i,clientWidth:s}=this.scrollContainer,r=e/i,a=(e+s)/i;this.emit("scroll",r,a,e,e+s)}),typeof ResizeObserver=="function"){const e=this.createDelay(100);this.resizeObserver=new ResizeObserver(()=>{e().then(()=>this.onContainerResize()).catch(()=>{})}),this.resizeObserver.observe(this.scrollContainer)}}onContainerResize(){const t=this.parent.clientWidth;t===this.lastContainerWidth&&this.options.height!=="auto"||(this.lastContainerWidth=t,this.reRender())}initDrag(){this.subscriptions.push(function(t,e,i,s,r=3,a=0,o=100){if(!t)return()=>{};const d=matchMedia("(pointer: coarse)").matches;let c=()=>{};const l=p=>{if(p.button!==a)return;p.preventDefault(),p.stopPropagation();let u=p.clientX,m=p.clientY,f=!1;const y=Date.now(),g=w=>{if(w.preventDefault(),w.stopPropagation(),d&&Date.now()-y<o)return;const T=w.clientX,D=w.clientY,k=T-u,W=D-m;if(f||Math.abs(k)>r||Math.abs(W)>r){const O=t.getBoundingClientRect(),{left:F,top:L}=O;f||(i==null||i(u-F,m-L),f=!0),e(k,W,T-F,D-L),u=T,m=D}},S=w=>{if(f){const T=w.clientX,D=w.clientY,k=t.getBoundingClientRect(),{left:W,top:O}=k;s==null||s(T-W,D-O)}c()},b=w=>{w.relatedTarget&&w.relatedTarget!==document.documentElement||S(w)},x=w=>{f&&(w.stopPropagation(),w.preventDefault())},A=w=>{f&&w.preventDefault()};document.addEventListener("pointermove",g),document.addEventListener("pointerup",S),document.addEventListener("pointerout",b),document.addEventListener("pointercancel",b),document.addEventListener("touchmove",A,{passive:!1}),document.addEventListener("click",x,{capture:!0}),c=()=>{document.removeEventListener("pointermove",g),document.removeEventListener("pointerup",S),document.removeEventListener("pointerout",b),document.removeEventListener("pointercancel",b),document.removeEventListener("touchmove",A),setTimeout(()=>{document.removeEventListener("click",x,{capture:!0})},10)}};return t.addEventListener("pointerdown",l),()=>{c(),t.removeEventListener("pointerdown",l)}}(this.wrapper,(t,e,i)=>{this.emit("drag",Math.max(0,Math.min(1,i/this.wrapper.getBoundingClientRect().width)))},t=>{this.isDragging=!0,this.emit("dragstart",Math.max(0,Math.min(1,t/this.wrapper.getBoundingClientRect().width)))},t=>{this.isDragging=!1,this.emit("dragend",Math.max(0,Math.min(1,t/this.wrapper.getBoundingClientRect().width)))}))}getHeight(t,e){var i;const s=((i=this.audioData)===null||i===void 0?void 0:i.numberOfChannels)||1;if(t==null)return 128;if(!isNaN(Number(t)))return Number(t);if(t==="auto"){const r=this.parent.clientHeight||128;return e!=null&&e.every(a=>!a.overlay)?r/s:r}return 128}initHtml(){const t=document.createElement("div"),e=t.attachShadow({mode:"open"}),i=this.options.cspNonce&&typeof this.options.cspNonce=="string"?this.options.cspNonce.replace(/"/g,""):"";return e.innerHTML=`
1
+ import{r as h,E as $,_ as H,b8 as pt,bh as _t,bi as $t,bj as Ht,M as X,O as q,aE as Vt,n as P,bk as jt,C as N,j as v,bl as Gt,b2 as Xt,bm as qt,bn as Yt,l as Kt,z as Jt,bo as tt,H as Qt,aA as Zt,bp as te,bq as ee,b7 as ie,br as ne}from"./index.GQSrzYvF.js";import{u as se,F as re}from"./FormClearHelper.4d5unoV3.js";import{T as oe,a as mt}from"./Toolbar.D6JzrqIQ.js";import{u as ae}from"./Hooks.DZueJ4q3.js";import{c as le}from"./createDownloadLinkElement.DZMwyjvU.js";import{F as ce,D as de}from"./FileDownload.esm.Cnl6nXhQ.js";var yt=h.forwardRef(function(n,t){var e={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return h.createElement($,H({iconAttrs:e,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},n,{ref:t}),h.createElement("g",{fill:"none"},h.createElement("rect",{width:24,height:24}),h.createElement("rect",{width:24,height:24}),h.createElement("rect",{width:24,height:24})),h.createElement("path",{d:"M12 14c1.66 0 3-1.34 3-3V5c0-1.66-1.34-3-3-3S9 3.34 9 5v6c0 1.66 1.34 3 3 3z"}),h.createElement("path",{d:"M17 11c0 2.76-2.24 5-5 5s-5-2.24-5-5H5c0 3.53 2.61 6.43 6 6.92V21h2v-3.08c3.39-.49 6-3.39 6-6.92h-2z"}))});yt.displayName="Mic";var bt=h.forwardRef(function(n,t){var e={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return h.createElement($,H({iconAttrs:e,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},n,{ref:t}),h.createElement("rect",{width:24,height:24,fill:"none"}),h.createElement("path",{d:"M8 19c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2s-2 .9-2 2v10c0 1.1.9 2 2 2zm6-12v10c0 1.1.9 2 2 2s2-.9 2-2V7c0-1.1-.9-2-2-2s-2 .9-2 2z"}))});bt.displayName="Pause";var wt=h.forwardRef(function(n,t){var e={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return h.createElement($,H({iconAttrs:e,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},n,{ref:t}),h.createElement("rect",{width:24,height:24,fill:"none"}),h.createElement("path",{d:"M8 6.82v10.36c0 .79.87 1.27 1.54.84l8.14-5.18a1 1 0 000-1.69L9.54 5.98A.998.998 0 008 6.82z"}))});wt.displayName="PlayArrow";var St=h.forwardRef(function(n,t){var e={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return h.createElement($,H({iconAttrs:e,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},n,{ref:t}),h.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),h.createElement("path",{d:"M17.65 6.35a7.95 7.95 0 00-6.48-2.31c-3.67.37-6.69 3.35-7.1 7.02C3.52 15.91 7.27 20 12 20a7.98 7.98 0 007.21-4.56c.32-.67-.16-1.44-.9-1.44-.37 0-.72.2-.88.53a5.994 5.994 0 01-6.8 3.31c-2.22-.49-4.01-2.3-4.48-4.52A6.002 6.002 0 0112 6c1.66 0 3.14.69 4.22 1.78l-1.51 1.51c-.63.63-.19 1.71.7 1.71H19c.55 0 1-.45 1-1V6.41c0-.89-1.08-1.34-1.71-.71l-.64.65z"}))});St.displayName="Refresh";var Ct=h.forwardRef(function(n,t){var e={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return h.createElement($,H({iconAttrs:e,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},n,{ref:t}),h.createElement("g",{fill:"none"},h.createElement("rect",{width:24,height:24}),h.createElement("rect",{width:24,height:24})),h.createElement("path",{fillRule:"evenodd",d:"M9 16h6c.55 0 1-.45 1-1V9c0-.55-.45-1-1-1H9c-.55 0-1 .45-1 1v6c0 .55.45 1 1 1zm3-14C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2z"}))});Ct.displayName="StopCircle";function R(n,t,e,i){return new(e||(e=Promise))(function(s,r){function a(c){try{d(i.next(c))}catch(l){r(l)}}function o(c){try{d(i.throw(c))}catch(l){r(l)}}function d(c){var l;c.done?s(c.value):(l=c.value,l instanceof e?l:new e(function(p){p(l)})).then(a,o)}d((i=i.apply(n,t||[])).next())})}let V=class{constructor(){this.listeners={}}on(t,e,i){if(this.listeners[t]||(this.listeners[t]=new Set),this.listeners[t].add(e),i==null?void 0:i.once){const s=()=>{this.un(t,s),this.un(t,e)};return this.on(t,s),s}return()=>this.un(t,e)}un(t,e){var i;(i=this.listeners[t])===null||i===void 0||i.delete(e)}once(t,e){return this.on(t,e,{once:!0})}unAll(){this.listeners={}}emit(t,...e){this.listeners[t]&&this.listeners[t].forEach(i=>i(...e))}};const j={decode:function(n,t){return R(this,void 0,void 0,function*(){const e=new AudioContext({sampleRate:t});return e.decodeAudioData(n).finally(()=>e.close())})},createBuffer:function(n,t){return typeof n[0]=="number"&&(n=[n]),function(e){const i=e[0];if(i.some(s=>s>1||s<-1)){const s=i.length;let r=0;for(let a=0;a<s;a++){const o=Math.abs(i[a]);o>r&&(r=o)}for(const a of e)for(let o=0;o<s;o++)a[o]/=r}}(n),{duration:t,length:n[0].length,sampleRate:n[0].length/t,numberOfChannels:n.length,getChannelData:e=>n==null?void 0:n[e],copyFromChannel:AudioBuffer.prototype.copyFromChannel,copyToChannel:AudioBuffer.prototype.copyToChannel}}};function Et(n,t){const e=t.xmlns?document.createElementNS(t.xmlns,n):document.createElement(n);for(const[i,s]of Object.entries(t))if(i==="children")for(const[r,a]of Object.entries(t))typeof a=="string"?e.appendChild(document.createTextNode(a)):e.appendChild(Et(r,a));else i==="style"?Object.assign(e.style,s):i==="textContent"?e.textContent=s:e.setAttribute(i,s.toString());return e}function ft(n,t,e){const i=Et(n,t||{});return e==null||e.appendChild(i),i}var he=Object.freeze({__proto__:null,createElement:ft,default:ft});const ue={fetchBlob:function(n,t,e){return R(this,void 0,void 0,function*(){const i=yield fetch(n,e);if(i.status>=400)throw new Error(`Failed to fetch ${n}: ${i.status} (${i.statusText})`);return function(s,r){R(this,void 0,void 0,function*(){if(!s.body||!s.headers)return;const a=s.body.getReader(),o=Number(s.headers.get("Content-Length"))||0;let d=0;const c=p=>R(this,void 0,void 0,function*(){d+=(p==null?void 0:p.length)||0;const u=Math.round(d/o*100);r(u)}),l=()=>R(this,void 0,void 0,function*(){let p;try{p=yield a.read()}catch{return}p.done||(c(p.value),yield l())});l()})}(i.clone(),t),i.blob()})}};class pe extends V{constructor(t){super(),this.isExternalMedia=!1,t.media?(this.media=t.media,this.isExternalMedia=!0):this.media=document.createElement("audio"),t.mediaControls&&(this.media.controls=!0),t.autoplay&&(this.media.autoplay=!0),t.playbackRate!=null&&this.onMediaEvent("canplay",()=>{t.playbackRate!=null&&(this.media.playbackRate=t.playbackRate)},{once:!0})}onMediaEvent(t,e,i){return this.media.addEventListener(t,e,i),()=>this.media.removeEventListener(t,e,i)}getSrc(){return this.media.currentSrc||this.media.src||""}revokeSrc(){const t=this.getSrc();t.startsWith("blob:")&&URL.revokeObjectURL(t)}canPlayType(t){return this.media.canPlayType(t)!==""}setSrc(t,e){const i=this.getSrc();if(t&&i===t)return;this.revokeSrc();const s=e instanceof Blob&&(this.canPlayType(e.type)||!t)?URL.createObjectURL(e):t;i&&(this.media.src="");try{this.media.src=s}catch{this.media.src=t}}destroy(){this.isExternalMedia||(this.media.pause(),this.media.remove(),this.revokeSrc(),this.media.src="",this.media.load())}setMediaElement(t){this.media=t}play(){return R(this,void 0,void 0,function*(){return this.media.play()})}pause(){this.media.pause()}isPlaying(){return!this.media.paused&&!this.media.ended}setTime(t){this.media.currentTime=Math.max(0,Math.min(t,this.getDuration()))}getDuration(){return this.media.duration}getCurrentTime(){return this.media.currentTime}getVolume(){return this.media.volume}setVolume(t){this.media.volume=t}getMuted(){return this.media.muted}setMuted(t){this.media.muted=t}getPlaybackRate(){return this.media.playbackRate}isSeeking(){return this.media.seeking}setPlaybackRate(t,e){e!=null&&(this.media.preservesPitch=e),this.media.playbackRate=t}getMediaElement(){return this.media}setSinkId(t){return this.media.setSinkId(t)}}class U extends V{constructor(t,e){super(),this.timeouts=[],this.isScrollable=!1,this.audioData=null,this.resizeObserver=null,this.lastContainerWidth=0,this.isDragging=!1,this.subscriptions=[],this.unsubscribeOnScroll=[],this.subscriptions=[],this.options=t;const i=this.parentFromOptionsContainer(t.container);this.parent=i;const[s,r]=this.initHtml();i.appendChild(s),this.container=s,this.scrollContainer=r.querySelector(".scroll"),this.wrapper=r.querySelector(".wrapper"),this.canvasWrapper=r.querySelector(".canvases"),this.progressWrapper=r.querySelector(".progress"),this.cursor=r.querySelector(".cursor"),e&&r.appendChild(e),this.initEvents()}parentFromOptionsContainer(t){let e;if(typeof t=="string"?e=document.querySelector(t):t instanceof HTMLElement&&(e=t),!e)throw new Error("Container not found");return e}initEvents(){const t=e=>{const i=this.wrapper.getBoundingClientRect(),s=e.clientX-i.left,r=e.clientY-i.top;return[s/i.width,r/i.height]};if(this.wrapper.addEventListener("click",e=>{const[i,s]=t(e);this.emit("click",i,s)}),this.wrapper.addEventListener("dblclick",e=>{const[i,s]=t(e);this.emit("dblclick",i,s)}),this.options.dragToSeek!==!0&&typeof this.options.dragToSeek!="object"||this.initDrag(),this.scrollContainer.addEventListener("scroll",()=>{const{scrollLeft:e,scrollWidth:i,clientWidth:s}=this.scrollContainer,r=e/i,a=(e+s)/i;this.emit("scroll",r,a,e,e+s)}),typeof ResizeObserver=="function"){const e=this.createDelay(100);this.resizeObserver=new ResizeObserver(()=>{e().then(()=>this.onContainerResize()).catch(()=>{})}),this.resizeObserver.observe(this.scrollContainer)}}onContainerResize(){const t=this.parent.clientWidth;t===this.lastContainerWidth&&this.options.height!=="auto"||(this.lastContainerWidth=t,this.reRender())}initDrag(){this.subscriptions.push(function(t,e,i,s,r=3,a=0,o=100){if(!t)return()=>{};const d=matchMedia("(pointer: coarse)").matches;let c=()=>{};const l=p=>{if(p.button!==a)return;p.preventDefault(),p.stopPropagation();let u=p.clientX,m=p.clientY,f=!1;const y=Date.now(),g=w=>{if(w.preventDefault(),w.stopPropagation(),d&&Date.now()-y<o)return;const T=w.clientX,D=w.clientY,k=T-u,W=D-m;if(f||Math.abs(k)>r||Math.abs(W)>r){const O=t.getBoundingClientRect(),{left:F,top:L}=O;f||(i==null||i(u-F,m-L),f=!0),e(k,W,T-F,D-L),u=T,m=D}},S=w=>{if(f){const T=w.clientX,D=w.clientY,k=t.getBoundingClientRect(),{left:W,top:O}=k;s==null||s(T-W,D-O)}c()},b=w=>{w.relatedTarget&&w.relatedTarget!==document.documentElement||S(w)},x=w=>{f&&(w.stopPropagation(),w.preventDefault())},A=w=>{f&&w.preventDefault()};document.addEventListener("pointermove",g),document.addEventListener("pointerup",S),document.addEventListener("pointerout",b),document.addEventListener("pointercancel",b),document.addEventListener("touchmove",A,{passive:!1}),document.addEventListener("click",x,{capture:!0}),c=()=>{document.removeEventListener("pointermove",g),document.removeEventListener("pointerup",S),document.removeEventListener("pointerout",b),document.removeEventListener("pointercancel",b),document.removeEventListener("touchmove",A),setTimeout(()=>{document.removeEventListener("click",x,{capture:!0})},10)}};return t.addEventListener("pointerdown",l),()=>{c(),t.removeEventListener("pointerdown",l)}}(this.wrapper,(t,e,i)=>{this.emit("drag",Math.max(0,Math.min(1,i/this.wrapper.getBoundingClientRect().width)))},t=>{this.isDragging=!0,this.emit("dragstart",Math.max(0,Math.min(1,t/this.wrapper.getBoundingClientRect().width)))},t=>{this.isDragging=!1,this.emit("dragend",Math.max(0,Math.min(1,t/this.wrapper.getBoundingClientRect().width)))}))}getHeight(t,e){var i;const s=((i=this.audioData)===null||i===void 0?void 0:i.numberOfChannels)||1;if(t==null)return 128;if(!isNaN(Number(t)))return Number(t);if(t==="auto"){const r=this.parent.clientHeight||128;return e!=null&&e.every(a=>!a.overlay)?r/s:r}return 128}initHtml(){const t=document.createElement("div"),e=t.attachShadow({mode:"open"}),i=this.options.cspNonce&&typeof this.options.cspNonce=="string"?this.options.cspNonce.replace(/"/g,""):"";return e.innerHTML=`
2
2
  <style${i?` nonce="${i}"`:""}>
3
3
  :host {
4
4
  user-select: none;
@@ -1 +1 @@
1
- import{r as o,aN as U,z as k,cp as x,C as A,j as l,bp as L,bE as P,bq as B,b7 as D,br as j}from"./index.BFZO9BwP.js";import{u as _}from"./uniqueId.B5Af-iXZ.js";import{u as q,a as w,b as K}from"./useOnInputChange.BUgD6B0U.js";import{I as N}from"./InputInstructions.8iiiZurT.js";import{a as O}from"./useBasicWidgetState.GEeXHHcq.js";import{T as $}from"./textarea.BXc2-al_.js";import"./inputUtils.CQWz5UKz.js";import"./FormClearHelper.B4Xd3eAo.js";import"./base-input.CD_ZJb6M.js";const T=(a,t)=>a.getStringValue(t)??t.default??null,G=a=>a.default??null,J=a=>a.value??null,Q=(a,t,s,u)=>{t.setStringValue(a,s.value,{fromUi:s.fromUi},u)},X=({disabled:a,element:t,widgetMgr:s,fragmentId:u})=>{var g;const h=o.useRef(_("text_area_")).current,[W,S]=U(),[r,n]=o.useState(!1),[C,b]=o.useState(!1),[i,d]=o.useState(()=>T(s,t)??null),I=o.useCallback(()=>{d(t.default??null),n(!0)},[t]),[V,c]=O({getStateFromWidgetMgr:T,getDefaultStateFromProto:G,getCurrStateFromProto:J,updateWidgetMgrState:Q,element:t,widgetMgr:s,fragmentId:u,onFormCleared:I});q(V,i,d,r);const e=k(),m=o.useCallback(()=>{n(!1),c({value:i,fromUi:!0})},[i,c]),y=o.useCallback(()=>{r&&m(),b(!1)},[r,m]),F=o.useCallback(()=>{b(!0)},[]),v=w({formId:t.formId,maxChars:t.maxChars,setDirty:n,setUiValue:d,setValueWithSource:c}),E=K(t.formId,m,r,s,u,!0),{height:f,placeholder:z,formId:p}=t,R=x({formId:p})?s.allowFormEnterToSubmit(p):r,H=C&&W>e.breakpoints.hideWidgetDetails;return A("div",{className:"stTextArea","data-testid":"stTextArea",ref:S,children:[l(j,{label:t.label,disabled:a,labelVisibility:L((g=t.labelVisibility)==null?void 0:g.value),htmlFor:h,children:t.help&&l(P,{children:l(B,{content:t.help,placement:D.TOP_RIGHT})})}),l($,{value:i??"",placeholder:z,onBlur:y,onFocus:F,onChange:v,onKeyDown:E,"aria-label":t.label,disabled:a,id:h,overrides:{Input:{style:{lineHeight:e.lineHeights.inputWidget,height:f?`${f}px`:"",minHeight:e.sizes.largestElementHeight,resize:"vertical",paddingRight:e.spacing.md,paddingLeft:e.spacing.md,paddingBottom:e.spacing.md,paddingTop:e.spacing.md,"::placeholder":{color:e.colors.fadedText60}}},Root:{props:{"data-testid":"stTextAreaRootElement"},style:{borderLeftWidth:e.sizes.borderWidth,borderRightWidth:e.sizes.borderWidth,borderTopWidth:e.sizes.borderWidth,borderBottomWidth:e.sizes.borderWidth}}}}),H&&l(N,{dirty:r,value:i??"",maxLength:t.maxChars,type:"multiline",inForm:x({formId:p}),allowEnterToSubmit:R})]})},it=o.memo(X);export{it as default};
1
+ import{r as o,aN as U,z as k,cq as x,C as A,j as l,bp as L,bF as P,bq as B,b7 as D,br as j}from"./index.GQSrzYvF.js";import{u as q}from"./uniqueId.OfTwqNZo.js";import{u as _,a as w,b as K}from"./useOnInputChange.dALPpkgr.js";import{I as N}from"./InputInstructions.TPKmOf1e.js";import{a as O}from"./useBasicWidgetState.BwLEUZab.js";import{T as $}from"./textarea.DBC27xex.js";import"./inputUtils.CQWz5UKz.js";import"./FormClearHelper.4d5unoV3.js";import"./base-input.Bnn6NZuq.js";const T=(a,t)=>a.getStringValue(t)??t.default??null,G=a=>a.default??null,J=a=>a.value??null,Q=(a,t,s,u)=>{t.setStringValue(a,s.value,{fromUi:s.fromUi},u)},X=({disabled:a,element:t,widgetMgr:s,fragmentId:u})=>{var g;const h=o.useRef(q("text_area_")).current,[W,S]=U(),[r,n]=o.useState(!1),[C,b]=o.useState(!1),[i,d]=o.useState(()=>T(s,t)??null),I=o.useCallback(()=>{d(t.default??null),n(!0)},[t]),[F,c]=O({getStateFromWidgetMgr:T,getDefaultStateFromProto:G,getCurrStateFromProto:J,updateWidgetMgrState:Q,element:t,widgetMgr:s,fragmentId:u,onFormCleared:I});_(F,i,d,r);const e=k(),m=o.useCallback(()=>{n(!1),c({value:i,fromUi:!0})},[i,c]),V=o.useCallback(()=>{r&&m(),b(!1)},[r,m]),y=o.useCallback(()=>{b(!0)},[]),v=w({formId:t.formId,maxChars:t.maxChars,setDirty:n,setUiValue:d,setValueWithSource:c}),E=K(t.formId,m,r,s,u,!0),{height:f,placeholder:z,formId:p}=t,R=x({formId:p})?s.allowFormEnterToSubmit(p):r,H=C&&W>e.breakpoints.hideWidgetDetails;return A("div",{className:"stTextArea","data-testid":"stTextArea",ref:S,children:[l(j,{label:t.label,disabled:a,labelVisibility:L((g=t.labelVisibility)==null?void 0:g.value),htmlFor:h,children:t.help&&l(P,{children:l(B,{content:t.help,placement:D.TOP_RIGHT})})}),l($,{value:i??"",placeholder:z,onBlur:V,onFocus:y,onChange:v,onKeyDown:E,"aria-label":t.label,disabled:a,id:h,overrides:{Input:{style:{lineHeight:e.lineHeights.inputWidget,height:f?`${f}px`:"",minHeight:e.sizes.largestElementHeight,resize:"vertical",paddingRight:e.spacing.md,paddingLeft:e.spacing.md,paddingBottom:e.spacing.md,paddingTop:e.spacing.md,"::placeholder":{color:e.colors.fadedText60}}},Root:{props:{"data-testid":"stTextAreaRootElement"},style:{borderLeftWidth:e.sizes.borderWidth,borderRightWidth:e.sizes.borderWidth,borderTopWidth:e.sizes.borderWidth,borderBottomWidth:e.sizes.borderWidth}}}}),H&&l(N,{dirty:r,value:i??"",maxLength:t.maxChars,type:"multiline",inForm:x({formId:p}),allowEnterToSubmit:R})]})},it=o.memo(X);export{it as default};
@@ -1 +1 @@
1
- import{n as l,k as s,r,j as n}from"./index.BFZO9BwP.js";import{P as i,R as m}from"./RenderInPortalIfExists.D4Mwwa5a.js";const c=""+new URL("../media/balloon-0.Czj7AKwE.png",import.meta.url).href,p=""+new URL("../media/balloon-1.CNvFFrND.png",import.meta.url).href,f=""+new URL("../media/balloon-2.DTvC6B1t.png",import.meta.url).href,d=""+new URL("../media/balloon-3.CgSk4tbL.png",import.meta.url).href,B=""+new URL("../media/balloon-4.mbtFrzxf.png",import.meta.url).href,L=""+new URL("../media/balloon-5.CSwkUfRA.png",import.meta.url).href,a=300,h=121,t=20,g=80,u=1e3,x=s("from{transform:translateY(calc(100vh + ",a,"px));}to{transform:translateY(0);}"),_=l("img",{target:"eosrfo90"})(({theme:o})=>({position:"fixed",top:"-300px",marginLeft:`${-121/2}px`,zIndex:o.zIndices.balloons,left:`${Math.random()*(g-t)+t}vw`,animationDelay:`${Math.random()*u}ms`,height:`${a}px`,width:`${h}px`,pointerEvents:"none",animationDuration:"750ms",animationName:x,animationTimingFunction:"ease-in",animationDirection:"normal",animationIterationCount:1,opacity:1})),w=30,e=[c,p,f,d,B,L],A=e.length,I=({particleType:o})=>n(_,{src:e[o]}),M=({scriptRunId:o})=>n(m,{children:n(i,{className:"stBalloons","data-testid":"stBalloons",scriptRunId:o,numParticleTypes:A,numParticles:w,ParticleComponent:I})}),S=r.memo(M);export{w as NUM_BALLOONS,S as default};
1
+ import{n as l,k as s,r,j as n}from"./index.GQSrzYvF.js";import{P as i,R as m}from"./RenderInPortalIfExists.B6RP7YdE.js";const c=""+new URL("../media/balloon-0.Czj7AKwE.png",import.meta.url).href,p=""+new URL("../media/balloon-1.CNvFFrND.png",import.meta.url).href,f=""+new URL("../media/balloon-2.DTvC6B1t.png",import.meta.url).href,d=""+new URL("../media/balloon-3.CgSk4tbL.png",import.meta.url).href,B=""+new URL("../media/balloon-4.mbtFrzxf.png",import.meta.url).href,L=""+new URL("../media/balloon-5.CSwkUfRA.png",import.meta.url).href,a=300,h=121,t=20,g=80,u=1e3,x=s("from{transform:translateY(calc(100vh + ",a,"px));}to{transform:translateY(0);}"),_=l("img",{target:"eosrfo90"})(({theme:o})=>({position:"fixed",top:"-300px",marginLeft:`${-121/2}px`,zIndex:o.zIndices.balloons,left:`${Math.random()*(g-t)+t}vw`,animationDelay:`${Math.random()*u}ms`,height:`${a}px`,width:`${h}px`,pointerEvents:"none",animationDuration:"750ms",animationName:x,animationTimingFunction:"ease-in",animationDirection:"normal",animationIterationCount:1,opacity:1})),w=30,e=[c,p,f,d,B,L],A=e.length,I=({particleType:o})=>n(_,{src:e[o]}),M=({scriptRunId:o})=>n(m,{children:n(i,{className:"stBalloons","data-testid":"stBalloons",scriptRunId:o,numParticleTypes:A,numParticles:w,ParticleComponent:I})}),S=r.memo(M);export{w as NUM_BALLOONS,S as default};
@@ -1 +1 @@
1
- import{r as i,j as c,bp as g,bO as b}from"./index.BFZO9BwP.js";import{a as m}from"./useBasicWidgetState.GEeXHHcq.js";import"./FormClearHelper.B4Xd3eAo.js";const p=(t,e)=>t.getStringValue(e),f=t=>t.default??null,C=t=>t.value??null,d=(t,e,r,o)=>{e.setStringValue(t,r.value,{fromUi:r.fromUi},o)},S=({element:t,disabled:e,widgetMgr:r,fragmentId:o})=>{var l;const[s,a]=m({getStateFromWidgetMgr:p,getDefaultStateFromProto:f,getCurrStateFromProto:C,updateWidgetMgrState:d,element:t,widgetMgr:r,fragmentId:o}),u=i.useCallback(n=>{a({value:n,fromUi:!0})},[a]);return c(b,{label:t.label,labelVisibility:g((l=t.labelVisibility)==null?void 0:l.value),help:t.help,onChange:u,disabled:e,value:s})},k=i.memo(S);export{k as default};
1
+ import{r as i,j as c,bp as g,bP as b}from"./index.GQSrzYvF.js";import{a as m}from"./useBasicWidgetState.BwLEUZab.js";import"./FormClearHelper.4d5unoV3.js";const p=(t,e)=>t.getStringValue(e),f=t=>t.default??null,C=t=>t.value??null,d=(t,e,r,o)=>{e.setStringValue(t,r.value,{fromUi:r.fromUi},o)},P=({element:t,disabled:e,widgetMgr:r,fragmentId:o})=>{var l;const[s,a]=m({getStateFromWidgetMgr:p,getDefaultStateFromProto:f,getCurrStateFromProto:C,updateWidgetMgrState:d,element:t,widgetMgr:r,fragmentId:o}),u=i.useCallback(n=>{a({value:n,fromUi:!0})},[a]);return c(b,{label:t.label,labelVisibility:g((l=t.labelVisibility)==null?void 0:l.value),help:t.help,onChange:u,disabled:e,value:s})},k=i.memo(P);export{k as default};
@@ -1 +1 @@
1
- import{r,E as Q,_ as Y,cz as y,M as m,O as Z,l as mt,n as E,z as ht,aN as gt,cp as It,H as q,C as F,j as c,bp as yt,bE as Tt,bq as wt,b7 as Ct,br as St,D as vt,bm as K}from"./index.BFZO9BwP.js";import{u as Vt}from"./uniqueId.B5Af-iXZ.js";import{u as xt}from"./FormClearHelper.B4Xd3eAo.js";import{I as kt}from"./InputInstructions.8iiiZurT.js";import{s as Dt}from"./sprintf.D7DtBTRn.js";import{I as Et}from"./input.Cc_dbkdO.js";import"./base-input.CD_ZJb6M.js";var tt=r.forwardRef(function(t,e){var a={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return r.createElement(Q,Y({iconAttrs:a,iconVerticalAlign:"middle",iconViewBox:"0 0 8 8"},t,{ref:e}),r.createElement("path",{d:"M0 3v2h8V3H0z"}))});tt.displayName="Minus";var et=r.forwardRef(function(t,e){var a={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return r.createElement(Q,Y({iconAttrs:a,iconVerticalAlign:"middle",iconViewBox:"0 0 8 8"},t,{ref:e}),r.createElement("path",{d:"M3 0v3H0v2h3v3h2V5h3V3H5V0H3z"}))});et.displayName="Plus";const Nt=mt.getLogger("NumberInput");function Rt(t){return m(t)||t===""?void 0:t}const W=({value:t,format:e,step:a,dataType:b})=>{if(m(t))return null;let o=Rt(e);if(m(o)&&Z(a)){const d=a.toString();b===y.DataType.FLOAT&&a!==0&&d.includes(".")&&(o=`%0.${d.split(".")[1].length}f`)}if(m(o))return t.toString();try{return Dt.sprintf(o,t)}catch(d){return Nt.warn(`Error in sprintf(${o}, ${t}): ${d}`),String(t)}},zt=(t,e,a)=>m(t)?!1:t-e>=a,Ft=(t,e,a)=>m(t)?!1:t+e<=a,Wt=t=>(t.element.dataType===y.DataType.INT?t.widgetMgr.getIntValue(t.element):t.widgetMgr.getDoubleValue(t.element))??t.element.default??null,M=({step:t,dataType:e})=>t||(e===y.DataType.INT?1:.01),Lt=E("div",{target:"eaba2yi0"})(({theme:t})=>({display:"flex",flexDirection:"row",flexWrap:"nowrap",alignItems:"center",height:t.sizes.minElementHeight,borderWidth:t.sizes.borderWidth,borderStyle:"solid",borderColor:t.colors.widgetBorderColor??t.colors.secondaryBg,transitionDuration:"200ms",transitionProperty:"border",transitionTimingFunction:"cubic-bezier(0.2, 0.8, 0.4, 1)",borderRadius:t.radii.default,overflow:"hidden","&.focused":{borderColor:t.colors.primary},input:{MozAppearance:"textfield","&::-webkit-inner-spin-button, &::-webkit-outer-spin-button":{WebkitAppearance:"none",margin:t.spacing.none}}})),Bt=E("div",{target:"eaba2yi1"})({display:"flex",flexDirection:"row",alignSelf:"stretch"}),J=E("button",{target:"eaba2yi2"})(({theme:t})=>({margin:t.spacing.none,border:"none",height:t.sizes.full,display:"flex",alignItems:"center",width:t.sizes.numberInputControlsWidth,justifyContent:"center",color:t.colors.bodyText,transition:"color 300ms, backgroundColor 300ms",backgroundColor:t.colors.secondaryBg,"&:hover:enabled, &:focus:enabled":{color:t.colors.white,backgroundColor:t.colors.primary,transition:"none",outline:"none"},"&:active":{outline:"none",border:"none"},"&:disabled":{cursor:"not-allowed",color:t.colors.fadedText40}})),Ht=E("div",{target:"eaba2yi3"})(({theme:t,clearable:e})=>({position:"absolute",marginRight:t.spacing.twoXS,left:0,right:`calc(${t.sizes.numberInputControlsWidth} * 2 + ${e?"1em":"0em"})`})),Pt=({disabled:t,element:e,widgetMgr:a,fragmentId:b})=>{var X;const o=ht(),{dataType:d,id:S,formId:p,default:L,format:B,icon:T,min:h,max:g}=e,[H,ot]=gt(),[s,rt]=r.useState(()=>M(e)),P=Wt({element:e,widgetMgr:a}),[I,w]=r.useState(!1),[l,C]=r.useState(P),[U,v]=r.useState(()=>W({value:P,...e,step:s})),[A,O]=r.useState(!1),V=r.useRef(null),$=r.useRef(Vt("number_input_")),x=zt(l,s,h),k=Ft(l,s,g),j=It({formId:p}),nt=j?a.allowFormEnterToSubmit(p):I,at=A&&H>o.breakpoints.hideWidgetDetails;r.useEffect(()=>{rt(M({step:e.step,dataType:e.dataType}))},[e.dataType,e.step]);const u=r.useCallback(({value:n,source:i})=>{var f;if(Z(n)&&(h>n||n>g))(f=V.current)==null||f.reportValidity();else{const D=n??L??null;switch(d){case y.DataType.INT:a.setIntValue({id:S,formId:p},D,i,b);break;case y.DataType.FLOAT:a.setDoubleValue({id:S,formId:p},D,i,b);break;default:throw new Error("Invalid data type")}w(!1),C(D),v(W({value:D,dataType:d,format:B,step:s}))}},[h,g,V,a,b,s,d,S,p,L,B]),st=r.useCallback(()=>{I&&u({value:l,source:{fromUi:!0}}),O(!1)},[I,l,u]),it=r.useCallback(()=>{O(!0)},[]),_=r.useCallback(()=>{const{value:n}=e;e.setValue=!1,C(n??null),v(W({value:n??null,...e,step:s})),u({value:n??null,source:{fromUi:!1}})},[e,s,u]);r.useEffect(()=>{e.setValue?_():u({value:l,source:{fromUi:!1}});const n=V.current;if(n){const i=f=>{f.preventDefault()};return n.addEventListener("wheel",i),()=>{n.removeEventListener("wheel",i)}}},[]),e.setValue&&_();const N=m(e.default)&&!t,lt=r.useCallback(()=>{const n=e.default??null;C(n),u({value:n,source:{fromUi:!0}})},[e]);xt({element:e,widgetMgr:a,onFormCleared:lt});const ct=n=>{const{value:i}=n.target;if(i==="")w(!0),C(null),v(null);else{let f;e.dataType===y.DataType.INT?f=parseInt(i,10):f=parseFloat(i),w(!0),C(f),v(i)}},R=r.useCallback(()=>{k&&(w(!0),u({value:(l??h)+s,source:{fromUi:!0}}))},[l,h,s,k]),z=r.useCallback(()=>{x&&(w(!0),u({value:(l??g)-s,source:{fromUi:!0}}))},[l,g,s,x]),ut=r.useCallback(n=>{const{key:i}=n;switch(i){case"ArrowUp":n.preventDefault(),R();break;case"ArrowDown":n.preventDefault(),z();break}},[R,z]),dt=r.useCallback(n=>{n.key==="Enter"&&(I&&u({value:l,source:{fromUi:!0}}),a.allowFormEnterToSubmit(p)&&a.submitForm(p,b))},[I,l,u,a,p,b]),G=T==null?void 0:T.startsWith(":material"),pt=G?"lg":"base",ft=q(o.iconSizes.lg)+2*q(o.spacing.twoXS),bt=T?o.breakpoints.hideNumberInputControls+ft:o.breakpoints.hideNumberInputControls;return F("div",{className:"stNumberInput","data-testid":"stNumberInput",ref:ot,children:[c(St,{label:e.label,disabled:t,labelVisibility:yt((X=e.labelVisibility)==null?void 0:X.value),htmlFor:$.current,children:e.help&&c(Tt,{children:c(wt,{content:e.help,placement:Ct.TOP_RIGHT})})}),F(Lt,{className:A?"focused":"","data-testid":"stNumberInputContainer",children:[c(Et,{type:"number",inputRef:V,value:U??"",placeholder:e.placeholder,onBlur:st,onFocus:it,onChange:ct,onKeyPress:dt,onKeyDown:ut,clearable:N,clearOnEscape:N,disabled:t,"aria-label":e.label,startEnhancer:e.icon&&c(vt,{"data-testid":"stNumberInputIcon",iconValue:e.icon,size:pt}),id:$.current,overrides:{ClearIconContainer:{style:{padding:0}},ClearIcon:{props:{overrides:{Svg:{style:{color:o.colors.darkGray,padding:o.spacing.threeXS,height:o.sizes.clearIconSize,width:o.sizes.clearIconSize,":hover":{fill:o.colors.bodyText}}}}}},Input:{props:{"data-testid":"stNumberInputField",step:s,min:h,max:g,type:"number",inputMode:""},style:{lineHeight:o.lineHeights.inputWidget,paddingRight:o.spacing.sm,paddingLeft:o.spacing.md,paddingBottom:o.spacing.sm,paddingTop:o.spacing.sm,"::placeholder":{color:o.colors.fadedText60}}},InputContainer:{style:()=>({borderTopRightRadius:0,borderBottomRightRadius:0})},Root:{style:{borderTopRightRadius:0,borderBottomRightRadius:0,borderTopLeftRadius:0,borderBottomLeftRadius:0,borderLeftWidth:0,borderRightWidth:0,borderTopWidth:0,borderBottomWidth:0,paddingRight:0,paddingLeft:T?o.spacing.sm:0}},StartEnhancer:{style:{paddingLeft:0,paddingRight:0,minWidth:o.iconSizes.lg,color:G?o.colors.fadedText60:"inherit"}}}}),H>bt&&F(Bt,{children:[c(J,{"data-testid":"stNumberInputStepDown",onClick:z,disabled:!x||t,tabIndex:-1,children:c(K,{content:tt,size:"xs",color:x?"inherit":o.colors.disabled})}),c(J,{"data-testid":"stNumberInputStepUp",onClick:R,disabled:!k||t,tabIndex:-1,children:c(K,{content:et,size:"xs",color:k?"inherit":o.colors.disabled})})]})]}),at&&c(Ht,{clearable:N,children:c(kt,{dirty:I,value:U??"",inForm:j,allowEnterToSubmit:nt})})]})},Xt=r.memo(Pt);export{Xt as default};
1
+ import{r,E as Q,_ as Y,cA as y,M as m,O as Z,l as mt,n as E,z as ht,aN as gt,cq as It,H as X,C as z,j as c,bp as yt,bF as Tt,bq as wt,b7 as Ct,br as St,D as vt,bm as K}from"./index.GQSrzYvF.js";import{u as Vt}from"./uniqueId.OfTwqNZo.js";import{u as xt}from"./FormClearHelper.4d5unoV3.js";import{I as kt}from"./InputInstructions.TPKmOf1e.js";import{s as Dt}from"./sprintf.D7DtBTRn.js";import{I as Et}from"./input.BsbIu3V-.js";import"./base-input.Bnn6NZuq.js";var tt=r.forwardRef(function(t,e){var a={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return r.createElement(Q,Y({iconAttrs:a,iconVerticalAlign:"middle",iconViewBox:"0 0 8 8"},t,{ref:e}),r.createElement("path",{d:"M0 3v2h8V3H0z"}))});tt.displayName="Minus";var et=r.forwardRef(function(t,e){var a={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return r.createElement(Q,Y({iconAttrs:a,iconVerticalAlign:"middle",iconViewBox:"0 0 8 8"},t,{ref:e}),r.createElement("path",{d:"M3 0v3H0v2h3v3h2V5h3V3H5V0H3z"}))});et.displayName="Plus";const Nt=mt.getLogger("NumberInput");function Rt(t){return m(t)||t===""?void 0:t}const W=({value:t,format:e,step:a,dataType:b})=>{if(m(t))return null;let o=Rt(e);if(m(o)&&Z(a)){const d=a.toString();b===y.DataType.FLOAT&&a!==0&&d.includes(".")&&(o=`%0.${d.split(".")[1].length}f`)}if(m(o))return t.toString();try{return Dt.sprintf(o,t)}catch(d){return Nt.warn(`Error in sprintf(${o}, ${t}): ${d}`),String(t)}},Ft=(t,e,a)=>m(t)?!1:t-e>=a,zt=(t,e,a)=>m(t)?!1:t+e<=a,Wt=t=>(t.element.dataType===y.DataType.INT?t.widgetMgr.getIntValue(t.element):t.widgetMgr.getDoubleValue(t.element))??t.element.default??null,M=({step:t,dataType:e})=>t||(e===y.DataType.INT?1:.01),Lt=E("div",{target:"eaba2yi0"})(({theme:t})=>({display:"flex",flexDirection:"row",flexWrap:"nowrap",alignItems:"center",height:t.sizes.minElementHeight,borderWidth:t.sizes.borderWidth,borderStyle:"solid",borderColor:t.colors.widgetBorderColor??t.colors.secondaryBg,transitionDuration:"200ms",transitionProperty:"border",transitionTimingFunction:"cubic-bezier(0.2, 0.8, 0.4, 1)",borderRadius:t.radii.default,overflow:"hidden","&.focused":{borderColor:t.colors.primary},input:{MozAppearance:"textfield","&::-webkit-inner-spin-button, &::-webkit-outer-spin-button":{WebkitAppearance:"none",margin:t.spacing.none}}})),Bt=E("div",{target:"eaba2yi1"})({display:"flex",flexDirection:"row",alignSelf:"stretch"}),J=E("button",{target:"eaba2yi2"})(({theme:t})=>({margin:t.spacing.none,border:"none",height:t.sizes.full,display:"flex",alignItems:"center",width:t.sizes.numberInputControlsWidth,justifyContent:"center",color:t.colors.bodyText,transition:"color 300ms, backgroundColor 300ms",backgroundColor:t.colors.secondaryBg,"&:hover:enabled, &:focus:enabled":{color:t.colors.white,backgroundColor:t.colors.primary,transition:"none",outline:"none"},"&:active":{outline:"none",border:"none"},"&:disabled":{cursor:"not-allowed",color:t.colors.fadedText40}})),Ht=E("div",{target:"eaba2yi3"})(({theme:t,clearable:e})=>({position:"absolute",marginRight:t.spacing.twoXS,left:0,right:`calc(${t.sizes.numberInputControlsWidth} * 2 + ${e?"1em":"0em"})`})),Pt=({disabled:t,element:e,widgetMgr:a,fragmentId:b})=>{var G;const o=ht(),{dataType:d,id:S,formId:p,default:L,format:B,icon:T,min:h,max:g}=e,[H,ot]=gt(),[s,rt]=r.useState(()=>M(e)),P=Wt({element:e,widgetMgr:a}),[I,w]=r.useState(!1),[l,C]=r.useState(P),[U,v]=r.useState(()=>W({value:P,...e,step:s})),[A,O]=r.useState(!1),V=r.useRef(null),$=r.useRef(Vt("number_input_")),x=Ft(l,s,h),k=zt(l,s,g),j=It({formId:p}),nt=j?a.allowFormEnterToSubmit(p):I,at=A&&H>o.breakpoints.hideWidgetDetails;r.useEffect(()=>{rt(M({step:e.step,dataType:e.dataType}))},[e.dataType,e.step]);const u=r.useCallback(({value:n,source:i})=>{var f;if(Z(n)&&(h>n||n>g))(f=V.current)==null||f.reportValidity();else{const D=n??L??null;switch(d){case y.DataType.INT:a.setIntValue({id:S,formId:p},D,i,b);break;case y.DataType.FLOAT:a.setDoubleValue({id:S,formId:p},D,i,b);break;default:throw new Error("Invalid data type")}w(!1),C(D),v(W({value:D,dataType:d,format:B,step:s}))}},[h,g,V,a,b,s,d,S,p,L,B]),st=r.useCallback(()=>{I&&u({value:l,source:{fromUi:!0}}),O(!1)},[I,l,u]),it=r.useCallback(()=>{O(!0)},[]),_=r.useCallback(()=>{const{value:n}=e;e.setValue=!1,C(n??null),v(W({value:n??null,...e,step:s})),u({value:n??null,source:{fromUi:!1}})},[e,s,u]);r.useEffect(()=>{e.setValue?_():u({value:l,source:{fromUi:!1}});const n=V.current;if(n){const i=f=>{f.preventDefault()};return n.addEventListener("wheel",i),()=>{n.removeEventListener("wheel",i)}}},[]),e.setValue&&_();const N=m(e.default)&&!t,lt=r.useCallback(()=>{const n=e.default??null;C(n),u({value:n,source:{fromUi:!0}})},[e]);xt({element:e,widgetMgr:a,onFormCleared:lt});const ct=n=>{const{value:i}=n.target;if(i==="")w(!0),C(null),v(null);else{let f;e.dataType===y.DataType.INT?f=parseInt(i,10):f=parseFloat(i),w(!0),C(f),v(i)}},R=r.useCallback(()=>{k&&(w(!0),u({value:(l??h)+s,source:{fromUi:!0}}))},[l,h,s,k]),F=r.useCallback(()=>{x&&(w(!0),u({value:(l??g)-s,source:{fromUi:!0}}))},[l,g,s,x]),ut=r.useCallback(n=>{const{key:i}=n;switch(i){case"ArrowUp":n.preventDefault(),R();break;case"ArrowDown":n.preventDefault(),F();break}},[R,F]),dt=r.useCallback(n=>{n.key==="Enter"&&(I&&u({value:l,source:{fromUi:!0}}),a.allowFormEnterToSubmit(p)&&a.submitForm(p,b))},[I,l,u,a,p,b]),q=T==null?void 0:T.startsWith(":material"),pt=q?"lg":"base",ft=X(o.iconSizes.lg)+2*X(o.spacing.twoXS),bt=T?o.breakpoints.hideNumberInputControls+ft:o.breakpoints.hideNumberInputControls;return z("div",{className:"stNumberInput","data-testid":"stNumberInput",ref:ot,children:[c(St,{label:e.label,disabled:t,labelVisibility:yt((G=e.labelVisibility)==null?void 0:G.value),htmlFor:$.current,children:e.help&&c(Tt,{children:c(wt,{content:e.help,placement:Ct.TOP_RIGHT})})}),z(Lt,{className:A?"focused":"","data-testid":"stNumberInputContainer",children:[c(Et,{type:"number",inputRef:V,value:U??"",placeholder:e.placeholder,onBlur:st,onFocus:it,onChange:ct,onKeyPress:dt,onKeyDown:ut,clearable:N,clearOnEscape:N,disabled:t,"aria-label":e.label,startEnhancer:e.icon&&c(vt,{"data-testid":"stNumberInputIcon",iconValue:e.icon,size:pt}),id:$.current,overrides:{ClearIconContainer:{style:{padding:0}},ClearIcon:{props:{overrides:{Svg:{style:{color:o.colors.darkGray,padding:o.spacing.threeXS,height:o.sizes.clearIconSize,width:o.sizes.clearIconSize,":hover":{fill:o.colors.bodyText}}}}}},Input:{props:{"data-testid":"stNumberInputField",step:s,min:h,max:g,type:"number",inputMode:""},style:{lineHeight:o.lineHeights.inputWidget,paddingRight:o.spacing.sm,paddingLeft:o.spacing.md,paddingBottom:o.spacing.sm,paddingTop:o.spacing.sm,"::placeholder":{color:o.colors.fadedText60}}},InputContainer:{style:()=>({borderTopRightRadius:0,borderBottomRightRadius:0})},Root:{style:{borderTopRightRadius:0,borderBottomRightRadius:0,borderTopLeftRadius:0,borderBottomLeftRadius:0,borderLeftWidth:0,borderRightWidth:0,borderTopWidth:0,borderBottomWidth:0,paddingRight:0,paddingLeft:T?o.spacing.sm:0}},StartEnhancer:{style:{paddingLeft:0,paddingRight:0,minWidth:o.iconSizes.lg,color:q?o.colors.fadedText60:"inherit"}}}}),H>bt&&z(Bt,{children:[c(J,{"data-testid":"stNumberInputStepDown",onClick:F,disabled:!x||t,tabIndex:-1,children:c(K,{content:tt,size:"xs",color:x?"inherit":o.colors.disabled})}),c(J,{"data-testid":"stNumberInputStepUp",onClick:R,disabled:!k||t,tabIndex:-1,children:c(K,{content:et,size:"xs",color:k?"inherit":o.colors.disabled})})]})]}),at&&c(Ht,{clearable:N,children:c(kt,{dirty:I,value:U??"",inForm:j,allowEnterToSubmit:nt})})]})},Gt=r.memo(Pt);export{Gt as default};
@@ -1 +1 @@
1
- import{n as s,r as t,O as i,j as d,a_ as c,a$ as e,M as l}from"./index.BFZO9BwP.js";const g=s("iframe",{target:"e3tg43n0"})(({theme:o,disableScrolling:n})=>({width:"100%",colorScheme:"normal",border:"none",padding:o.spacing.none,margin:o.spacing.none,overflow:n?"hidden":void 0}));function r(o){return l(o)||o===""?void 0:o}function I({element:o}){const n=r(o.src),a=i(n)?void 0:r(o.srcdoc);return d(g,{className:"stIFrame","data-testid":"stIFrame",allow:e,disableScrolling:!o.scrolling,src:n,srcDoc:a,height:o.height,scrolling:o.scrolling?"auto":"no",sandbox:c,title:"st.iframe",tabIndex:o.tabIndex??void 0})}const m=t.memo(I);export{m as default};
1
+ import{n as s,r as t,O as i,j as d,a_ as c,a$ as e,M as l}from"./index.GQSrzYvF.js";const g=s("iframe",{target:"e3tg43n0"})(({theme:o,disableScrolling:n})=>({width:"100%",colorScheme:"normal",border:"none",padding:o.spacing.none,margin:o.spacing.none,overflow:n?"hidden":void 0}));function r(o){return l(o)||o===""?void 0:o}function I({element:o}){const n=r(o.src),a=i(n)?void 0:r(o.srcdoc);return d(g,{className:"stIFrame","data-testid":"stIFrame",allow:e,disableScrolling:!o.scrolling,src:n,srcDoc:a,height:o.height,scrolling:o.scrolling?"auto":"no",sandbox:c,title:"st.iframe",tabIndex:o.tabIndex??void 0})}const m=t.memo(I);export{m as default};
@@ -1 +1 @@
1
- import{n as c,r as C,aD as S,C as p,j as i,aC as E,l as y}from"./index.BFZO9BwP.js";import{w as L,E as W}from"./withFullScreenWrapper.Pb8hqWLi.js";import{S as h,T as v}from"./Toolbar.MfU_z1Pl.js";const b=c("div",{target:"evl31sl0"})(({theme:e})=>({display:"flex",flexDirection:"row",flexWrap:"wrap",rowGap:e.spacing.lg,maxWidth:"100%",width:"fit-content"})),T=c("div",{target:"evl31sl1"})(({theme:e})=>({display:"flex",flexDirection:"column",alignItems:"stretch",width:"auto",flexGrow:0,">img":{borderRadius:e.radii.default}})),F=c("div",{target:"evl31sl2"})(({theme:e})=>({textAlign:"center",marginTop:e.spacing.xs,wordWrap:"break-word",padding:e.spacing.threeXS})),j=y.getLogger("ImageList");function D({element:e,endpoints:g,disableFullscreenMode:u}){const{expanded:s,width:w,height:l,expand:x,collapse:f}=S(W),m=w||0;let o;const r=e.width;if([-1,-3,-4].includes(r))o=void 0;else if([-2,-5].includes(r))o=m;else if(r>0)o=r;else throw Error(`Invalid image width: ${r}`);const t={};l&&s?(t.maxHeight=l,t.objectFit="contain",t.width="100%"):(t.width=o??"100%",t.maxWidth="100%");const I=n=>{const a=n.currentTarget.src;j.error(`Client Error: Image source error - ${a}`),g.sendClientErrorToHost("Image","Image source failed to load","onerror triggered",a)};return p(h,{width:m,height:l,useContainerWidth:s,topCentered:!0,children:[i(v,{target:h,isFullScreen:s,onExpand:x,onCollapse:f,disableFullscreenMode:u}),i(b,{className:"stImage","data-testid":"stImage",children:e.imgs.map((n,a)=>{const d=n;return p(T,{"data-testid":"stImageContainer",children:[i("img",{style:t,src:g.buildMediaURL(d.url),alt:a.toString(),onError:I}),d.caption&&i(F,{"data-testid":"stImageCaption",style:t,children:i(E,{source:d.caption,allowHTML:!1,isCaption:!0,isLabel:!0})})]},a)})})]})}const G=L(D),$=C.memo(G);export{$ as default};
1
+ import{n as c,r as C,aD as S,C as p,j as i,aC as E,l as y}from"./index.GQSrzYvF.js";import{w as L,E as W}from"./withFullScreenWrapper.CYjEH_RX.js";import{S as h,T as v}from"./Toolbar.D6JzrqIQ.js";const b=c("div",{target:"evl31sl0"})(({theme:e})=>({display:"flex",flexDirection:"row",flexWrap:"wrap",rowGap:e.spacing.lg,maxWidth:"100%",width:"fit-content"})),T=c("div",{target:"evl31sl1"})(({theme:e})=>({display:"flex",flexDirection:"column",alignItems:"stretch",width:"auto",flexGrow:0,">img":{borderRadius:e.radii.default}})),F=c("div",{target:"evl31sl2"})(({theme:e})=>({textAlign:"center",marginTop:e.spacing.xs,wordWrap:"break-word",padding:e.spacing.threeXS})),j=y.getLogger("ImageList");function D({element:e,endpoints:g,disableFullscreenMode:u}){const{expanded:s,width:w,height:l,expand:x,collapse:f}=S(W),m=w||0;let o;const r=e.width;if([-1,-3,-4].includes(r))o=void 0;else if([-2,-5].includes(r))o=m;else if(r>0)o=r;else throw Error(`Invalid image width: ${r}`);const t={};l&&s?(t.maxHeight=l,t.objectFit="contain",t.width="100%"):(t.width=o??"100%",t.maxWidth="100%");const I=n=>{const a=n.currentTarget.src;j.error(`Client Error: Image source error - ${a}`),g.sendClientErrorToHost("Image","Image source failed to load","onerror triggered",a)};return p(h,{width:m,height:l,useContainerWidth:s,topCentered:!0,children:[i(v,{target:h,isFullScreen:s,onExpand:x,onCollapse:f,disableFullscreenMode:u}),i(b,{className:"stImage","data-testid":"stImage",children:e.imgs.map((n,a)=>{const d=n;return p(T,{"data-testid":"stImageContainer",children:[i("img",{style:t,src:g.buildMediaURL(d.url),alt:a.toString(),onError:I}),d.caption&&i(F,{"data-testid":"stImageCaption",style:t,children:i(E,{source:d.caption,allowHTML:!1,isCaption:!0,isLabel:!0})})]},a)})})]})}const G=L(D),$=C.memo(G);export{$ as default};
@@ -1 +1 @@
1
- import{n as l,b0 as C,J as b,b1 as n,r as u,b2 as s,j as a,b3 as v,b4 as B,b5 as k}from"./index.BFZO9BwP.js";function S(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 e=l("a",{target:"e1xsxz6b0"})(({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 ${b(i.colors.primary,.5)}`},"&:hover":{textDecoration:"none"},"&:active":{textDecoration:"none"},...S(r,i)})),L=l(e,{target:"e1xsxz6b1"})(({theme:o})=>({backgroundColor:o.colors.primary,color:o.colors.white,border:`${o.sizes.borderWidth} solid ${o.colors.primary}`,"&:hover":{backgroundColor:C(o.colors.primary,.05),color:o.colors.white},"&:active":{backgroundColor:"transparent",color:o.colors.primary},"&: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"}})),$=l(e,{target:"e1xsxz6b2"})(({theme:o})=>({backgroundColor:o.colors.lightenedBg05,color:o.colors.bodyText,border:`${o.sizes.borderWidth} solid ${o.colors.borderColor}`,"&:visited":{color:o.colors.bodyText},"&:hover":{borderColor:o.colors.primary,color:o.colors.primary},"&:active":{color:o.colors.white,borderColor:o.colors.primary,backgroundColor:o.colors.primary},"&:focus:not(:active)":{borderColor:o.colors.primary,color:o.colors.primary},"&[disabled], &[disabled]:hover, &[disabled]:active":{borderColor:o.colors.borderColor,backgroundColor:o.colors.transparent,color:o.colors.fadedText40,cursor:"not-allowed"}})),w=l(e,{target:"e1xsxz6b3"})(({theme:o})=>({padding:o.spacing.none,backgroundColor:o.colors.transparent,color:o.colors.bodyText,border:"none","&:visited":{color:o.colors.bodyText},"&:hover":{color:o.colors.primary},"&:active":{color:o.colors.primary},"&:focus":{outline:"none"},"&:focus-visible":{color:o.colors.primary,boxShadow:`0 0 0 0.2rem ${b(o.colors.primary,.5)}`},"&[disabled], &[disabled]:hover, &[disabled]:active":{backgroundColor:o.colors.transparent,color:o.colors.fadedText40,cursor:"not-allowed"}}));function z({kind:o,size:r,disabled:i,containerWidth:t,children:c,autoFocus:p,href:g,rel:y,target:f,onClick:x}){let d=L;return o===s.SECONDARY?d=$:o===s.TERTIARY&&(d=w),a(d,{kind:o,size:r||n.MEDIUM,containerWidth:t||!1,disabled:i||!1,autoFocus:p||!1,href:g,target:f,rel:y,onClick:x,tabIndex:i?-1:0,"data-testid":`stBaseLinkButton-${o}`,children:c})}const T=u.memo(z);function R(o){const{element:r}=o;let i=s.SECONDARY;r.type==="primary"?i=s.PRIMARY:r.type==="tertiary"&&(i=s.TERTIARY);const t=c=>{r.disabled&&c.preventDefault()};return a(k,{className:"stLinkButton","data-testid":"stLinkButton",children:a(v,{help:r.help,containerWidth:r.useContainerWidth,children:a(T,{kind:i,size:n.SMALL,disabled:r.disabled,onClick:t,containerWidth:r.useContainerWidth,href:r.url,target:"_blank",rel:"noreferrer","aria-disabled":r.disabled,children:a(B,{icon:r.icon,label:r.label})})})})}const W=u.memo(R);export{W as default};
1
+ import{n as l,b0 as C,J as b,b1 as n,r as u,b2 as s,j as a,b3 as v,b4 as B,b5 as k}from"./index.GQSrzYvF.js";function S(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 e=l("a",{target:"e1xsxz6b0"})(({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 ${b(i.colors.primary,.5)}`},"&:hover":{textDecoration:"none"},"&:active":{textDecoration:"none"},...S(r,i)})),L=l(e,{target:"e1xsxz6b1"})(({theme:o})=>({backgroundColor:o.colors.primary,color:o.colors.white,border:`${o.sizes.borderWidth} solid ${o.colors.primary}`,"&:hover":{backgroundColor:C(o.colors.primary,.05),color:o.colors.white},"&:active":{backgroundColor:"transparent",color:o.colors.primary},"&: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"}})),$=l(e,{target:"e1xsxz6b2"})(({theme:o})=>({backgroundColor:o.colors.lightenedBg05,color:o.colors.bodyText,border:`${o.sizes.borderWidth} solid ${o.colors.borderColor}`,"&:visited":{color:o.colors.bodyText},"&:hover":{borderColor:o.colors.primary,color:o.colors.primary},"&:active":{color:o.colors.white,borderColor:o.colors.primary,backgroundColor:o.colors.primary},"&:focus:not(:active)":{borderColor:o.colors.primary,color:o.colors.primary},"&[disabled], &[disabled]:hover, &[disabled]:active":{borderColor:o.colors.borderColor,backgroundColor:o.colors.transparent,color:o.colors.fadedText40,cursor:"not-allowed"}})),w=l(e,{target:"e1xsxz6b3"})(({theme:o})=>({padding:o.spacing.none,backgroundColor:o.colors.transparent,color:o.colors.bodyText,border:"none","&:visited":{color:o.colors.bodyText},"&:hover":{color:o.colors.primary},"&:active":{color:o.colors.primary},"&:focus":{outline:"none"},"&:focus-visible":{color:o.colors.primary,boxShadow:`0 0 0 0.2rem ${b(o.colors.primary,.5)}`},"&[disabled], &[disabled]:hover, &[disabled]:active":{backgroundColor:o.colors.transparent,color:o.colors.fadedText40,cursor:"not-allowed"}}));function z({kind:o,size:r,disabled:i,containerWidth:t,children:c,autoFocus:p,href:g,rel:y,target:f,onClick:x}){let d=L;return o===s.SECONDARY?d=$:o===s.TERTIARY&&(d=w),a(d,{kind:o,size:r||n.MEDIUM,containerWidth:t||!1,disabled:i||!1,autoFocus:p||!1,href:g,target:f,rel:y,onClick:x,tabIndex:i?-1:0,"data-testid":`stBaseLinkButton-${o}`,children:c})}const T=u.memo(z);function R(o){const{element:r}=o;let i=s.SECONDARY;r.type==="primary"?i=s.PRIMARY:r.type==="tertiary"&&(i=s.TERTIARY);const t=c=>{r.disabled&&c.preventDefault()};return a(k,{className:"stLinkButton","data-testid":"stLinkButton",children:a(v,{help:r.help,containerWidth:r.useContainerWidth,children:a(T,{kind:i,size:n.SMALL,disabled:r.disabled,onClick:t,containerWidth:r.useContainerWidth,href:r.url,target:"_blank",rel:"noreferrer","aria-disabled":r.disabled,children:a(B,{icon:r.icon,label:r.label})})})})}const W=u.memo(R);export{W as default};
@@ -1 +1 @@
1
- import{r as d,E as S,_ as x,n as c,H as O,C as g,j as a,bm as f,bn as F,b1 as _,b2 as w,bf as q,F as G,bC as K,aA as Y,bh as J,bD as z,M as h,b as m,bj as Q,bi as Z,bp as ee,bE as te,bq as ie,b7 as se,br as le}from"./index.BFZO9BwP.js";import{F as ne}from"./FormClearHelper.B4Xd3eAo.js";import{g as b,F as y,b as ae,D as oe,I as re,C as de,a as ce,s as pe}from"./FileHelper.CIllbZ_T.js";import{S as ge,P as ue}from"./ProgressBar.7dxhGygF.js";import{u as he}from"./Hooks.DCO6FLy2.js";import{U as v}from"./UploadFileInfo.C-jY39rj.js";var M=d.forwardRef(function(e,s){var t={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return d.createElement(S,x({iconAttrs:t,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:s}),d.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),d.createElement("path",{d:"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12l4.58-4.59z"}))});M.displayName="ChevronLeft";var V=d.forwardRef(function(e,s){var t={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return d.createElement(S,x({iconAttrs:t,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:s}),d.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),d.createElement("path",{d:"M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6-6-6z"}))});V.displayName="ChevronRight";var B=d.forwardRef(function(e,s){var t={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return d.createElement(S,x({iconAttrs:t,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:s}),d.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),d.createElement("path",{d:"M19.35 10.04A7.49 7.49 0 0012 4C9.11 4 6.6 5.64 5.35 8.04A5.994 5.994 0 000 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96zM19 18H6c-2.21 0-4-1.79-4-4 0-2.05 1.53-3.76 3.56-3.97l1.07-.11.5-.95A5.469 5.469 0 0112 6c2.62 0 4.88 1.86 5.39 4.43l.3 1.5 1.53.11A2.98 2.98 0 0122 15c0 1.65-1.35 3-3 3zM8 13h2.55v3h2.9v-3H16l-4-4z"}))});B.displayName="CloudUpload";var D=d.forwardRef(function(e,s){var t={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return d.createElement(S,x({iconAttrs:t,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:s}),d.createElement("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"}))});D.displayName="Error";const L=c("section",{target:"e16xj5sw0"})(({isDisabled:e,theme:s})=>({display:"flex",alignItems:"center",padding:s.spacing.lg,backgroundColor:s.colors.secondaryBg,borderRadius:s.radii.default,border:s.colors.widgetBorderColor?`${s.sizes.borderWidth} solid ${s.colors.widgetBorderColor}`:void 0,":focus":{outline:"none"},":focus-visible":{boxShadow:`0 0 0 1px ${s.colors.primary}`},color:e?s.colors.gray:s.colors.bodyText})),P=c("div",{target:"e16xj5sw1"})({marginRight:"auto",alignItems:"center",display:"flex"}),E=c("span",{target:"e16xj5sw2"})(({theme:e})=>({color:e.colors.darkenedBgMix100,marginRight:e.spacing.lg})),fe=c("span",{target:"e16xj5sw3"})(({theme:e})=>({marginBottom:e.spacing.twoXS})),me=c("div",{target:"e16xj5sw4"})({display:"flex",flexDirection:"column"}),A=c("div",{target:"e16xj5sw5"})(({theme:e})=>({left:0,right:0,lineHeight:e.lineHeights.tight,paddingTop:e.spacing.md,paddingLeft:e.spacing.lg,paddingRight:e.spacing.lg})),Fe=c("ul",{target:"e16xj5sw6"})(({theme:e})=>({listStyleType:"none",margin:e.spacing.none,padding:e.spacing.none})),j=c("li",{target:"e16xj5sw7"})(({theme:e})=>({margin:e.spacing.none,padding:e.spacing.none})),H=c("div",{target:"e16xj5sw8"})(({theme:e})=>({display:"flex",alignItems:"baseline",flex:1,paddingLeft:e.spacing.lg,overflow:"hidden"})),N=c("div",{target:"e16xj5sw9"})(({theme:e})=>({marginRight:e.spacing.sm,marginBottom:e.spacing.twoXS,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"})),W=c("div",{target:"e16xj5sw10"})(({theme:e})=>({display:"flex",alignItems:"center",marginBottom:e.spacing.twoXS})),we=c("span",{target:"e16xj5sw11"})(({theme:e})=>({marginRight:e.spacing.twoXS})),ye=c("div",{target:"e16xj5sw12"})(({theme:e})=>({display:"flex",padding:e.spacing.twoXS,color:e.colors.darkenedBgMix100})),R=c("small",{target:"e16xj5sw13"})(({theme:e})=>({color:e.colors.red,fontSize:e.fontSizes.sm,height:e.fontSizes.sm,lineHeight:e.fontSizes.sm,display:"flex",alignItems:"center",whiteSpace:"nowrap"})),k=c("span",{target:"e16xj5sw14"})({}),Se=e=>({[L]:{display:"flex",flexDirection:"column",alignItems:"flex-start"},[P]:{marginBottom:e.spacing.lg},[E]:{display:"none"},[A]:{paddingRight:e.spacing.lg},[W]:{maxWidth:"inherit",flex:1,alignItems:"flex-start",marginBottom:e.spacing.sm},[N]:{width:e.sizes.full},[H]:{flexDirection:"column"},[R]:{height:"auto",whiteSpace:"initial"},[k]:{display:"none"},[j]:{margin:e.spacing.none,padding:e.spacing.none}}),xe=c("div",{target:"e16xj5sw15"})(({theme:e,width:s})=>{if(s<O("23rem"))return Se(e)}),I=c("small",{target:"ejh2rmr0"})(({kind:e,theme:s})=>{const{danger:t,fadedText60:i}=s.colors;return{color:e==="danger"?t:i,fontSize:s.fontSizes.sm,lineHeight:s.lineHeights.tight}}),Ue=({multiple:e,acceptedExtensions:s,maxSizeBytes:t})=>g(P,{"data-testid":"stFileUploaderDropzoneInstructions",children:[a(E,{children:a(f,{content:B,size:"threeXL"})}),g(me,{children:[g(fe,{children:["Drag and drop file",e?"s":""," here"]}),g(I,{children:[`Limit ${b(t,y.Byte,0)} per file`,s.length?` • ${s.map(i=>i.replace(/^\./,"").toUpperCase()).join(", ")}`:null]})]})]}),ve=d.memo(Ue),Ie=({onDrop:e,multiple:s,acceptedExtensions:t,maxSizeBytes:i,disabled:l,label:o})=>a(oe,{onDrop:e,multiple:s,accept:ae(t),maxSize:i,disabled:l,useFsAccessApi:!1,children:({getRootProps:n,getInputProps:r})=>g(L,{...n(),"data-testid":"stFileUploaderDropzone",isDisabled:l,"aria-label":o,children:[a("input",{"data-testid":"stFileUploaderDropzoneInput",...r()}),a(ve,{multiple:s,acceptedExtensions:t,maxSizeBytes:i}),a(F,{kind:w.SECONDARY,disabled:l,size:_.SMALL,children:"Browse files"})]})}),ze=d.memo(Ie),Ce=c("div",{target:"egc9vxm0"})(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"space-between",paddingBottom:e.spacing.twoXS,marginBottom:e.spacing.twoXS})),be=c("div",{target:"egc9vxm1"})(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"center",color:e.colors.fadedText40})),Me=({currentPage:e,totalPages:s,onNext:t,onPrevious:i})=>g(Ce,{"data-testid":"stFileUploaderPagination",children:[a(I,{children:`Showing page ${e} of ${s}`}),g(be,{children:[a(F,{onClick:i,kind:w.MINIMAL,children:a(f,{content:M,size:"xl"})}),a(F,{onClick:t,kind:w.MINIMAL,children:a(f,{content:V,size:"xl"})})]})]}),Ve=d.memo(Me),C=(e,s)=>Math.ceil(e.length/s),Be=e=>q(({pageSize:t,items:i,resetOnAdd:l,...o})=>{const[n,r]=d.useState(0),[p,U]=d.useState(()=>C(i,t)),u=he(i);d.useEffect(()=>{u&&u.length!==i.length&&U(C(i,t)),u&&u.length<i.length?l&&r(0):n+1>=p&&r(p-1)},[i,n,t,u,l,p]);const T=()=>{r(Math.min(n+1,p-1))},$=()=>{r(Math.max(0,n-1))},X=i.slice(n*t,n*t+t);return g(G,{children:[a(e,{items:X,...o}),i.length>t?a(Ve,{pageSize:t,totalPages:p,currentPage:n+1,onNext:T,onPrevious:$}):null]})},e),De=({fileInfo:e})=>e.status.type==="uploading"?a(ue,{value:e.status.progress,size:ge.SMALL}):e.status.type==="error"?g(R,{children:[a(we,{"data-testid":"stFileUploaderFileErrorMessage",children:e.status.errorMessage}),a(k,{children:a(f,{content:D,size:"lg"})})]}):e.status.type==="uploaded"?a(I,{children:b(e.size,y.Byte)}):null,Le=({fileInfo:e,onDelete:s})=>g(W,{className:"stFileUploaderFile","data-testid":"stFileUploaderFile",children:[a(ye,{children:a(f,{content:re,size:"twoXL"})}),g(H,{className:"stFileUploaderFileData",children:[a(N,{className:"stFileUploaderFileName","data-testid":"stFileUploaderFileName",title:e.name,children:e.name}),a(De,{fileInfo:e})]}),a("div",{"data-testid":"stFileUploaderDeleteBtn",children:a(F,{onClick:()=>s(e.id),kind:w.MINIMAL,children:a(f,{content:de,size:"lg"})})})]}),Pe=d.memo(Le),Ee=({items:e,onDelete:s})=>a(Fe,{children:e.map(t=>a(j,{children:a(Pe,{fileInfo:t,onDelete:s})},t.id))}),Ae=Be(Ee),je=e=>a(A,{children:a(Ae,{...e})}),He=d.memo(je);class Ne extends d.PureComponent{constructor(s){super(s),this.formClearHelper=new ne,this.localFileIdCounter=1,this.forceUpdatingStatus=!1,this.componentDidUpdate=()=>{if(this.status!=="ready")return;const t=this.createWidgetValue(),{element:i,widgetMgr:l,fragmentId:o}=this.props,n=l.getFileUploaderStateValue(i);Y(t,n)||l.setFileUploaderStateValue(i,t,{fromUi:!0},o)},this.dropHandler=(t,i)=>{const{element:l}=this.props,{multipleFiles:o}=l;if(!o&&t.length===0&&i.length>1){const n=i.findIndex(r=>r.errors.length===1&&r.errors[0].code==="too-many-files");n>=0&&(t.push(i[n].file),i.splice(n,1))}if(this.props.uploadClient.fetchFileURLs(t).then(n=>{if(!o&&t.length>0){const r=this.state.files.find(p=>p.status.type!=="error");r&&(this.forceUpdatingStatus=!0,this.deleteFile(r.id),this.forceUpdatingStatus=!1)}J(n,t).forEach(([r,p])=>{this.uploadFile(r,p)})}).catch(n=>{this.addFiles(t.map(r=>new v(r.name,r.size,this.nextLocalFileId(),{type:"error",errorMessage:n})))}),i.length>0){const n=i.map(r=>ce(r,this.nextLocalFileId(),this.maxUploadSizeInBytes));this.addFiles(n)}},this.uploadFile=(t,i)=>{const l=z.CancelToken.source(),o=new v(i.name,i.size,this.nextLocalFileId(),{type:"uploading",cancelToken:l,progress:1});this.addFile(o),this.props.uploadClient.uploadFile(this.props.element,t.uploadUrl,i,n=>this.onUploadProgress(n,o.id),l.token).then(()=>this.onUploadComplete(o.id,t)).catch(n=>{z.isCancel(n)||this.updateFile(o.id,o.setStatus({type:"error",errorMessage:n?n.toString():"Unknown error"}))})},this.onUploadComplete=(t,i)=>{const l=this.getFile(t);h(l)||l.status.type!=="uploading"||this.updateFile(l.id,l.setStatus({type:"uploaded",fileId:i.fileId,fileUrls:i}))},this.deleteFile=t=>{const i=this.getFile(t);h(i)||(i.status.type==="uploading"&&i.status.cancelToken.cancel(),i.status.type==="uploaded"&&i.status.fileUrls.deleteUrl&&this.props.uploadClient.deleteFile(i.status.fileUrls.deleteUrl),this.removeFile(t))},this.addFile=t=>{m.flushSync(()=>{this.setState(i=>({files:[...i.files,t]}))})},this.addFiles=t=>{m.flushSync(()=>{this.setState(i=>({files:[...i.files,...t]}))})},this.removeFile=t=>{m.flushSync(()=>{this.setState(i=>({files:i.files.filter(l=>l.id!==t)}))})},this.getFile=t=>this.state.files.find(i=>i.id===t),this.updateFile=(t,i)=>{m.flushSync(()=>{this.setState(l=>({files:l.files.map(o=>o.id===t?i:o)}))})},this.onUploadProgress=(t,i)=>{const l=this.getFile(i);if(h(l)||l.status.type!=="uploading")return;const o=Math.round(t.loaded*100/t.total);l.status.progress!==o&&this.updateFile(i,l.setStatus({type:"uploading",cancelToken:l.status.cancelToken,progress:o}))},this.onFormCleared=()=>{m.flushSync(()=>{this.setState({files:[]},()=>{const t=this.createWidgetValue();if(h(t))return;const{widgetMgr:i,element:l,fragmentId:o}=this.props;i.setFileUploaderStateValue(l,t,{fromUi:!0},o)})})},this.state=this.initialValue}get initialValue(){const s={files:[]},{widgetMgr:t,element:i}=this.props,l=t.getFileUploaderStateValue(i);if(h(l))return s;const{uploadedFileInfo:o}=l;return h(o)||o.length===0?s:{files:o.map(n=>{const r=n.name,p=n.size,U=n.fileId,u=n.fileUrls;return new v(r,p,this.nextLocalFileId(),{type:"uploaded",fileId:U,fileUrls:u})})}}componentWillUnmount(){this.formClearHelper.disconnect()}get maxUploadSizeInBytes(){const s=this.props.element.maxUploadSizeMb;return pe(s,y.Megabyte,y.Byte)}get status(){const s=t=>t.status.type==="uploading";return this.state.files.some(s)||this.forceUpdatingStatus?"updating":"ready"}componentDidMount(){const s=this.createWidgetValue(),{element:t,widgetMgr:i,fragmentId:l}=this.props;i.getFileUploaderStateValue(t)===void 0&&i.setFileUploaderStateValue(t,s,{fromUi:!1},l)}createWidgetValue(){const s=this.state.files.filter(t=>t.status.type==="uploaded").map(t=>{const{name:i,size:l,status:o}=t,{fileId:n,fileUrls:r}=o;return new Q({fileId:n,fileUrls:r,name:i,size:l})});return new Z({uploadedFileInfo:s})}render(){var p;const{files:s}=this.state,{element:t,disabled:i,widgetMgr:l,width:o}=this.props,n=t.type;this.formClearHelper.manageFormClearListener(l,t.formId,this.onFormCleared);const r=s.slice().reverse();return g(xe,{className:"stFileUploader","data-testid":"stFileUploader",width:o,children:[a(le,{label:t.label,disabled:i,labelVisibility:ee((p=t.labelVisibility)==null?void 0:p.value),children:t.help&&a(te,{children:a(ie,{content:t.help,placement:se.TOP_RIGHT})})}),a(ze,{onDrop:this.dropHandler,multiple:t.multipleFiles,acceptedExtensions:n,maxSizeBytes:this.maxUploadSizeInBytes,label:t.label,disabled:i}),r.length>0&&a(He,{items:r,pageSize:3,onDelete:this.deleteFile,resetOnAdd:!0})]})}nextLocalFileId(){return this.localFileIdCounter++}}const Oe=K(d.memo(Ne));export{Oe as default};
1
+ import{r as d,E as S,_ as x,n as c,H as O,C as g,j as a,bm as f,bn as F,b1 as _,b2 as w,bf as q,F as G,bD as K,aA as Y,bh as J,bE as z,M as h,b as m,bj as Q,bi as Z,bp as ee,bF as te,bq as ie,b7 as se,br as le}from"./index.GQSrzYvF.js";import{F as ne}from"./FormClearHelper.4d5unoV3.js";import{g as b,F as y,b as ae,D as oe,I as re,C as de,a as ce,s as pe}from"./FileHelper.cSMax3oI.js";import{S as ge,P as ue}from"./ProgressBar.9KpGrB3q.js";import{u as he}from"./Hooks.DZueJ4q3.js";import{U as v}from"./UploadFileInfo.C-jY39rj.js";var M=d.forwardRef(function(e,s){var t={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return d.createElement(S,x({iconAttrs:t,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:s}),d.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),d.createElement("path",{d:"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12l4.58-4.59z"}))});M.displayName="ChevronLeft";var V=d.forwardRef(function(e,s){var t={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return d.createElement(S,x({iconAttrs:t,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:s}),d.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),d.createElement("path",{d:"M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6-6-6z"}))});V.displayName="ChevronRight";var B=d.forwardRef(function(e,s){var t={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return d.createElement(S,x({iconAttrs:t,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:s}),d.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),d.createElement("path",{d:"M19.35 10.04A7.49 7.49 0 0012 4C9.11 4 6.6 5.64 5.35 8.04A5.994 5.994 0 000 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96zM19 18H6c-2.21 0-4-1.79-4-4 0-2.05 1.53-3.76 3.56-3.97l1.07-.11.5-.95A5.469 5.469 0 0112 6c2.62 0 4.88 1.86 5.39 4.43l.3 1.5 1.53.11A2.98 2.98 0 0122 15c0 1.65-1.35 3-3 3zM8 13h2.55v3h2.9v-3H16l-4-4z"}))});B.displayName="CloudUpload";var D=d.forwardRef(function(e,s){var t={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return d.createElement(S,x({iconAttrs:t,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:s}),d.createElement("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"}))});D.displayName="Error";const L=c("section",{target:"e16xj5sw0"})(({isDisabled:e,theme:s})=>({display:"flex",alignItems:"center",padding:s.spacing.lg,backgroundColor:s.colors.secondaryBg,borderRadius:s.radii.default,border:s.colors.widgetBorderColor?`${s.sizes.borderWidth} solid ${s.colors.widgetBorderColor}`:void 0,":focus":{outline:"none"},":focus-visible":{boxShadow:`0 0 0 1px ${s.colors.primary}`},color:e?s.colors.gray:s.colors.bodyText})),P=c("div",{target:"e16xj5sw1"})({marginRight:"auto",alignItems:"center",display:"flex"}),E=c("span",{target:"e16xj5sw2"})(({theme:e})=>({color:e.colors.darkenedBgMix100,marginRight:e.spacing.lg})),fe=c("span",{target:"e16xj5sw3"})(({theme:e})=>({marginBottom:e.spacing.twoXS})),me=c("div",{target:"e16xj5sw4"})({display:"flex",flexDirection:"column"}),A=c("div",{target:"e16xj5sw5"})(({theme:e})=>({left:0,right:0,lineHeight:e.lineHeights.tight,paddingTop:e.spacing.md,paddingLeft:e.spacing.lg,paddingRight:e.spacing.lg})),Fe=c("ul",{target:"e16xj5sw6"})(({theme:e})=>({listStyleType:"none",margin:e.spacing.none,padding:e.spacing.none})),j=c("li",{target:"e16xj5sw7"})(({theme:e})=>({margin:e.spacing.none,padding:e.spacing.none})),H=c("div",{target:"e16xj5sw8"})(({theme:e})=>({display:"flex",alignItems:"baseline",flex:1,paddingLeft:e.spacing.lg,overflow:"hidden"})),N=c("div",{target:"e16xj5sw9"})(({theme:e})=>({marginRight:e.spacing.sm,marginBottom:e.spacing.twoXS,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"})),W=c("div",{target:"e16xj5sw10"})(({theme:e})=>({display:"flex",alignItems:"center",marginBottom:e.spacing.twoXS})),we=c("span",{target:"e16xj5sw11"})(({theme:e})=>({marginRight:e.spacing.twoXS})),ye=c("div",{target:"e16xj5sw12"})(({theme:e})=>({display:"flex",padding:e.spacing.twoXS,color:e.colors.darkenedBgMix100})),R=c("small",{target:"e16xj5sw13"})(({theme:e})=>({color:e.colors.red,fontSize:e.fontSizes.sm,height:e.fontSizes.sm,lineHeight:e.fontSizes.sm,display:"flex",alignItems:"center",whiteSpace:"nowrap"})),k=c("span",{target:"e16xj5sw14"})({}),Se=e=>({[L]:{display:"flex",flexDirection:"column",alignItems:"flex-start"},[P]:{marginBottom:e.spacing.lg},[E]:{display:"none"},[A]:{paddingRight:e.spacing.lg},[W]:{maxWidth:"inherit",flex:1,alignItems:"flex-start",marginBottom:e.spacing.sm},[N]:{width:e.sizes.full},[H]:{flexDirection:"column"},[R]:{height:"auto",whiteSpace:"initial"},[k]:{display:"none"},[j]:{margin:e.spacing.none,padding:e.spacing.none}}),xe=c("div",{target:"e16xj5sw15"})(({theme:e,width:s})=>{if(s<O("23rem"))return Se(e)}),I=c("small",{target:"ejh2rmr0"})(({kind:e,theme:s})=>{const{danger:t,fadedText60:i}=s.colors;return{color:e==="danger"?t:i,fontSize:s.fontSizes.sm,lineHeight:s.lineHeights.tight}}),Ue=({multiple:e,acceptedExtensions:s,maxSizeBytes:t})=>g(P,{"data-testid":"stFileUploaderDropzoneInstructions",children:[a(E,{children:a(f,{content:B,size:"threeXL"})}),g(me,{children:[g(fe,{children:["Drag and drop file",e?"s":""," here"]}),g(I,{children:[`Limit ${b(t,y.Byte,0)} per file`,s.length?` • ${s.map(i=>i.replace(/^\./,"").toUpperCase()).join(", ")}`:null]})]})]}),ve=d.memo(Ue),Ie=({onDrop:e,multiple:s,acceptedExtensions:t,maxSizeBytes:i,disabled:l,label:o})=>a(oe,{onDrop:e,multiple:s,accept:ae(t),maxSize:i,disabled:l,useFsAccessApi:!1,children:({getRootProps:n,getInputProps:r})=>g(L,{...n(),"data-testid":"stFileUploaderDropzone",isDisabled:l,"aria-label":o,children:[a("input",{"data-testid":"stFileUploaderDropzoneInput",...r()}),a(ve,{multiple:s,acceptedExtensions:t,maxSizeBytes:i}),a(F,{kind:w.SECONDARY,disabled:l,size:_.SMALL,children:"Browse files"})]})}),ze=d.memo(Ie),Ce=c("div",{target:"egc9vxm0"})(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"space-between",paddingBottom:e.spacing.twoXS,marginBottom:e.spacing.twoXS})),be=c("div",{target:"egc9vxm1"})(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"center",color:e.colors.fadedText40})),Me=({currentPage:e,totalPages:s,onNext:t,onPrevious:i})=>g(Ce,{"data-testid":"stFileUploaderPagination",children:[a(I,{children:`Showing page ${e} of ${s}`}),g(be,{children:[a(F,{onClick:i,kind:w.MINIMAL,children:a(f,{content:M,size:"xl"})}),a(F,{onClick:t,kind:w.MINIMAL,children:a(f,{content:V,size:"xl"})})]})]}),Ve=d.memo(Me),C=(e,s)=>Math.ceil(e.length/s),Be=e=>q(({pageSize:t,items:i,resetOnAdd:l,...o})=>{const[n,r]=d.useState(0),[p,U]=d.useState(()=>C(i,t)),u=he(i);d.useEffect(()=>{u&&u.length!==i.length&&U(C(i,t)),u&&u.length<i.length?l&&r(0):n+1>=p&&r(p-1)},[i,n,t,u,l,p]);const T=()=>{r(Math.min(n+1,p-1))},$=()=>{r(Math.max(0,n-1))},X=i.slice(n*t,n*t+t);return g(G,{children:[a(e,{items:X,...o}),i.length>t?a(Ve,{pageSize:t,totalPages:p,currentPage:n+1,onNext:T,onPrevious:$}):null]})},e),De=({fileInfo:e})=>e.status.type==="uploading"?a(ue,{value:e.status.progress,size:ge.SMALL}):e.status.type==="error"?g(R,{children:[a(we,{"data-testid":"stFileUploaderFileErrorMessage",children:e.status.errorMessage}),a(k,{children:a(f,{content:D,size:"lg"})})]}):e.status.type==="uploaded"?a(I,{children:b(e.size,y.Byte)}):null,Le=({fileInfo:e,onDelete:s})=>g(W,{className:"stFileUploaderFile","data-testid":"stFileUploaderFile",children:[a(ye,{children:a(f,{content:re,size:"twoXL"})}),g(H,{className:"stFileUploaderFileData",children:[a(N,{className:"stFileUploaderFileName","data-testid":"stFileUploaderFileName",title:e.name,children:e.name}),a(De,{fileInfo:e})]}),a("div",{"data-testid":"stFileUploaderDeleteBtn",children:a(F,{onClick:()=>s(e.id),kind:w.MINIMAL,children:a(f,{content:de,size:"lg"})})})]}),Pe=d.memo(Le),Ee=({items:e,onDelete:s})=>a(Fe,{children:e.map(t=>a(j,{children:a(Pe,{fileInfo:t,onDelete:s})},t.id))}),Ae=Be(Ee),je=e=>a(A,{children:a(Ae,{...e})}),He=d.memo(je);class Ne extends d.PureComponent{constructor(s){super(s),this.formClearHelper=new ne,this.localFileIdCounter=1,this.forceUpdatingStatus=!1,this.componentDidUpdate=()=>{if(this.status!=="ready")return;const t=this.createWidgetValue(),{element:i,widgetMgr:l,fragmentId:o}=this.props,n=l.getFileUploaderStateValue(i);Y(t,n)||l.setFileUploaderStateValue(i,t,{fromUi:!0},o)},this.dropHandler=(t,i)=>{const{element:l}=this.props,{multipleFiles:o}=l;if(!o&&t.length===0&&i.length>1){const n=i.findIndex(r=>r.errors.length===1&&r.errors[0].code==="too-many-files");n>=0&&(t.push(i[n].file),i.splice(n,1))}if(this.props.uploadClient.fetchFileURLs(t).then(n=>{if(!o&&t.length>0){const r=this.state.files.find(p=>p.status.type!=="error");r&&(this.forceUpdatingStatus=!0,this.deleteFile(r.id),this.forceUpdatingStatus=!1)}J(n,t).forEach(([r,p])=>{this.uploadFile(r,p)})}).catch(n=>{this.addFiles(t.map(r=>new v(r.name,r.size,this.nextLocalFileId(),{type:"error",errorMessage:n})))}),i.length>0){const n=i.map(r=>ce(r,this.nextLocalFileId(),this.maxUploadSizeInBytes));this.addFiles(n)}},this.uploadFile=(t,i)=>{const l=z.CancelToken.source(),o=new v(i.name,i.size,this.nextLocalFileId(),{type:"uploading",cancelToken:l,progress:1});this.addFile(o),this.props.uploadClient.uploadFile(this.props.element,t.uploadUrl,i,n=>this.onUploadProgress(n,o.id),l.token).then(()=>this.onUploadComplete(o.id,t)).catch(n=>{z.isCancel(n)||this.updateFile(o.id,o.setStatus({type:"error",errorMessage:n?n.toString():"Unknown error"}))})},this.onUploadComplete=(t,i)=>{const l=this.getFile(t);h(l)||l.status.type!=="uploading"||this.updateFile(l.id,l.setStatus({type:"uploaded",fileId:i.fileId,fileUrls:i}))},this.deleteFile=t=>{const i=this.getFile(t);h(i)||(i.status.type==="uploading"&&i.status.cancelToken.cancel(),i.status.type==="uploaded"&&i.status.fileUrls.deleteUrl&&this.props.uploadClient.deleteFile(i.status.fileUrls.deleteUrl),this.removeFile(t))},this.addFile=t=>{m.flushSync(()=>{this.setState(i=>({files:[...i.files,t]}))})},this.addFiles=t=>{m.flushSync(()=>{this.setState(i=>({files:[...i.files,...t]}))})},this.removeFile=t=>{m.flushSync(()=>{this.setState(i=>({files:i.files.filter(l=>l.id!==t)}))})},this.getFile=t=>this.state.files.find(i=>i.id===t),this.updateFile=(t,i)=>{m.flushSync(()=>{this.setState(l=>({files:l.files.map(o=>o.id===t?i:o)}))})},this.onUploadProgress=(t,i)=>{const l=this.getFile(i);if(h(l)||l.status.type!=="uploading")return;const o=Math.round(t.loaded*100/t.total);l.status.progress!==o&&this.updateFile(i,l.setStatus({type:"uploading",cancelToken:l.status.cancelToken,progress:o}))},this.onFormCleared=()=>{m.flushSync(()=>{this.setState({files:[]},()=>{const t=this.createWidgetValue();if(h(t))return;const{widgetMgr:i,element:l,fragmentId:o}=this.props;i.setFileUploaderStateValue(l,t,{fromUi:!0},o)})})},this.state=this.initialValue}get initialValue(){const s={files:[]},{widgetMgr:t,element:i}=this.props,l=t.getFileUploaderStateValue(i);if(h(l))return s;const{uploadedFileInfo:o}=l;return h(o)||o.length===0?s:{files:o.map(n=>{const r=n.name,p=n.size,U=n.fileId,u=n.fileUrls;return new v(r,p,this.nextLocalFileId(),{type:"uploaded",fileId:U,fileUrls:u})})}}componentWillUnmount(){this.formClearHelper.disconnect()}get maxUploadSizeInBytes(){const s=this.props.element.maxUploadSizeMb;return pe(s,y.Megabyte,y.Byte)}get status(){const s=t=>t.status.type==="uploading";return this.state.files.some(s)||this.forceUpdatingStatus?"updating":"ready"}componentDidMount(){const s=this.createWidgetValue(),{element:t,widgetMgr:i,fragmentId:l}=this.props;i.getFileUploaderStateValue(t)===void 0&&i.setFileUploaderStateValue(t,s,{fromUi:!1},l)}createWidgetValue(){const s=this.state.files.filter(t=>t.status.type==="uploaded").map(t=>{const{name:i,size:l,status:o}=t,{fileId:n,fileUrls:r}=o;return new Q({fileId:n,fileUrls:r,name:i,size:l})});return new Z({uploadedFileInfo:s})}render(){var p;const{files:s}=this.state,{element:t,disabled:i,widgetMgr:l,width:o}=this.props,n=t.type;this.formClearHelper.manageFormClearListener(l,t.formId,this.onFormCleared);const r=s.slice().reverse();return g(xe,{className:"stFileUploader","data-testid":"stFileUploader",width:o,children:[a(le,{label:t.label,disabled:i,labelVisibility:ee((p=t.labelVisibility)==null?void 0:p.value),children:t.help&&a(te,{children:a(ie,{content:t.help,placement:se.TOP_RIGHT})})}),a(ze,{onDrop:this.dropHandler,multiple:t.multipleFiles,acceptedExtensions:n,maxSizeBytes:this.maxUploadSizeInBytes,label:t.label,disabled:i}),r.length>0&&a(He,{items:r,pageSize:3,onDelete:this.deleteFile,resetOnAdd:!0})]})}nextLocalFileId(){return this.localFileIdCounter++}}const Oe=K(d.memo(Ne));export{Oe as default};