streamlit-nightly 1.42.3.dev20250226__py2.py3-none-any.whl → 1.42.3.dev20250228__py2.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 (101) hide show
  1. streamlit/commands/navigation.py +16 -4
  2. streamlit/commands/page_config.py +1 -2
  3. streamlit/elements/arrow.py +6 -5
  4. streamlit/elements/lib/column_types.py +101 -70
  5. streamlit/elements/widgets/button.py +18 -9
  6. streamlit/elements/widgets/chat.py +2 -1
  7. streamlit/elements/widgets/data_editor.py +6 -5
  8. streamlit/elements/widgets/number_input.py +3 -2
  9. streamlit/elements/widgets/slider.py +11 -3
  10. streamlit/errors.py +11 -9
  11. streamlit/navigation/page.py +2 -10
  12. streamlit/proto/ChatInput_pb2.py +6 -6
  13. streamlit/proto/ChatInput_pb2.pyi +5 -1
  14. streamlit/proto/ForwardMsg_pb2.py +12 -10
  15. streamlit/proto/PagesChanged_pb2.pyi +3 -1
  16. streamlit/runtime/app_session.py +1 -13
  17. streamlit/runtime/context.py +47 -2
  18. streamlit/runtime/pages_manager.py +61 -232
  19. streamlit/runtime/scriptrunner/script_runner.py +49 -2
  20. streamlit/runtime/scriptrunner_utils/script_run_context.py +1 -1
  21. streamlit/source_util.py +4 -90
  22. streamlit/static/index.html +1 -1
  23. streamlit/static/static/js/{FileDownload.esm.CWn5B5ZN.js → FileDownload.esm.BjRCwIvW.js} +1 -1
  24. streamlit/static/static/js/FileHelper.CGrcmoNK.js +5 -0
  25. streamlit/static/static/js/{FormClearHelper.BlCIuWCo.js → FormClearHelper.CyjIZnZM.js} +1 -1
  26. streamlit/static/static/js/{Hooks.DURid8_V.js → Hooks.-DbiQ7Am.js} +1 -1
  27. streamlit/static/static/js/{InputInstructions.gFFpIc6i.js → InputInstructions.CV_L9pmm.js} +1 -1
  28. streamlit/static/static/js/{ProgressBar.CtXtbXhv.js → ProgressBar.BMUfDSdU.js} +1 -1
  29. streamlit/static/static/js/{RenderInPortalIfExists.DKWNQmbm.js → RenderInPortalIfExists.DBak2tzf.js} +1 -1
  30. streamlit/static/static/js/{Toolbar.CKKwksQV.js → Toolbar.BpCHhFl7.js} +1 -1
  31. streamlit/static/static/js/{base-input.BUY9TLqO.js → base-input.B4K7gn3m.js} +1 -1
  32. streamlit/static/static/js/{checkbox.C4L_5Z9H.js → checkbox.CAX7YHDZ.js} +1 -1
  33. streamlit/static/static/js/{createSuper.DprEKsA6.js → createSuper.D9gT0sOi.js} +1 -1
  34. streamlit/static/static/js/{data-grid-overlay-editor.BArvtwSg.js → data-grid-overlay-editor.gLdGVwGm.js} +1 -1
  35. streamlit/static/static/js/{downloader.C5pxkE2v.js → downloader.DcsU6eyn.js} +1 -1
  36. streamlit/static/static/js/{es6.DmKjMqyQ.js → es6.dTL0Du7U.js} +2 -2
  37. streamlit/static/static/js/{iframeResizer.contentWindow.DhqbXIl1.js → iframeResizer.contentWindow.flH1YmDM.js} +1 -1
  38. streamlit/static/static/js/{index.D2-IYCcZ.js → index.-WtL21xT.js} +1 -1
  39. streamlit/static/static/js/{index.B-S4HX7x.js → index.B0VH6CCN.js} +1 -1
  40. streamlit/static/static/js/{index.xTncca7J.js → index.B6RoN18x.js} +1 -1
  41. streamlit/static/static/js/index.B7TcBuqC.js +1 -0
  42. streamlit/static/static/js/{index.B-vrwvgD.js → index.BCg2ff_8.js} +2 -2
  43. streamlit/static/static/js/{index.CvNhwseQ.js → index.BFxZ-0WR.js} +1 -1
  44. streamlit/static/static/js/{index.Cd03IYkG.js → index.BJIOzTyr.js} +1 -1
  45. streamlit/static/static/js/{index.DNr2W0gq.js → index.BMUI3dle.js} +1 -1
  46. streamlit/static/static/js/{index.KPwXWqBk.js → index.BUNYdCvS.js} +146 -146
  47. streamlit/static/static/js/{index.Bk3A478D.js → index.BV2qQuMO.js} +6 -6
  48. streamlit/static/static/js/{index.D2G24Udm.js → index.BX8IgiDA.js} +1 -1
  49. streamlit/static/static/js/{index.WAlW9lgW.js → index.BYdIAAme.js} +1 -1
  50. streamlit/static/static/js/{index.RFfgDsnM.js → index.BzXJd4o6.js} +1 -1
  51. streamlit/static/static/js/index.BzxT1LSG.js +1 -0
  52. streamlit/static/static/js/{index.NKOzzX__.js → index.CHfW08Eb.js} +1 -1
  53. streamlit/static/static/js/{index.c_V1HXTs.js → index.CWFsehBI.js} +1 -1
  54. streamlit/static/static/js/index.C_m4U-ik.js +201 -0
  55. streamlit/static/static/js/index.CgbCWpVz.js +4537 -0
  56. streamlit/static/static/js/{index.O5-Wn4Yr.js → index.ChXmN16b.js} +1 -1
  57. streamlit/static/static/js/{index.BUnWa5Cg.js → index.D-_iawK3.js} +1 -1
  58. streamlit/static/static/js/{index.BVHfAEko.js → index.D7qPBPzh.js} +1 -1
  59. streamlit/static/static/js/{index.BSczaRDm.js → index.D9Gtya_A.js} +1 -1
  60. streamlit/static/static/js/{index.oPGa5nFU.js → index.D9jWe5tN.js} +1 -1
  61. streamlit/static/static/js/{index.Bds7Anva.js → index.DB-0Yu8-.js} +1 -1
  62. streamlit/static/static/js/{index.CoQjULdH.js → index.DGu65w1V.js} +3 -3
  63. streamlit/static/static/js/index.DIHkG0HG.js +12 -0
  64. streamlit/static/static/js/{index.UE_L1IEZ.js → index.DIgKi8Bp.js} +1 -1
  65. streamlit/static/static/js/{index.BoBCblDb.js → index.DbiiV9to.js} +1 -1
  66. streamlit/static/static/js/{index.EIkP6R_d.js → index.DgSb0EiE.js} +1 -1
  67. streamlit/static/static/js/{index.RrEbViHi.js → index.DkoFwjhv.js} +1 -1
  68. streamlit/static/static/js/{index.doRPQ8od.js → index.DwAnNzqz.js} +1 -1
  69. streamlit/static/static/js/{index.ChEJa75P.js → index.PrjikacM.js} +1 -1
  70. streamlit/static/static/js/{index.BmnSGdtS.js → index.QEh4WZkI.js} +1 -1
  71. streamlit/static/static/js/{index.CXpOPWFV.js → index.iqovFu7V.js} +1 -1
  72. streamlit/static/static/js/{index.C3l2zbST.js → index.mRpR0u1n.js} +1 -1
  73. streamlit/static/static/js/{index.BEnZZwfW.js → index.u-XgtJxJ.js} +3 -3
  74. streamlit/static/static/js/{index.DtIKjlNZ.js → index.y-qJHV46.js} +1 -1
  75. streamlit/static/static/js/{input.EkJ_AsTP.js → input.DqgaXn2o.js} +1 -1
  76. streamlit/static/static/js/{memory.BFs17dZE.js → memory.DszNDPLb.js} +1 -1
  77. streamlit/static/static/js/{mergeWith.B4u0whL-.js → mergeWith.DFTSkXIf.js} +1 -1
  78. streamlit/static/static/js/{number-overlay-editor.DwazN43x.js → number-overlay-editor.C8_ha9YJ.js} +1 -1
  79. streamlit/static/static/js/{possibleConstructorReturn.CZfYLVBb.js → possibleConstructorReturn.cS4Ei6et.js} +1 -1
  80. streamlit/static/static/js/{sandbox.PjijA1v1.js → sandbox.Bj-BfqPP.js} +1 -1
  81. streamlit/static/static/js/{textarea.BGGnQXtw.js → textarea.BrvMyGxB.js} +1 -1
  82. streamlit/static/static/js/{timepicker.eLEnk1tw.js → timepicker.Ds8_GzH8.js} +2 -2
  83. streamlit/static/static/js/{toConsumableArray.CgKj9NUY.js → toConsumableArray.RfoD5uEy.js} +1 -1
  84. streamlit/static/static/js/{uniqueId.CPmOGhdZ.js → uniqueId.R_vr2E5T.js} +1 -1
  85. streamlit/static/static/js/{useBasicWidgetState.Bw_fxTtX.js → useBasicWidgetState.Cglgg1W1.js} +1 -1
  86. streamlit/static/static/js/{useOnInputChange.D8qi7pm4.js → useOnInputChange.CFTHBDsA.js} +1 -1
  87. streamlit/static/static/js/{withFullScreenWrapper.BjVufR9b.js → withFullScreenWrapper.BcyXoen-.js} +1 -1
  88. streamlit/testing/v1/app_test.py +8 -10
  89. streamlit/user_info.py +3 -0
  90. {streamlit_nightly-1.42.3.dev20250226.dist-info → streamlit_nightly-1.42.3.dev20250228.dist-info}/METADATA +1 -1
  91. {streamlit_nightly-1.42.3.dev20250226.dist-info → streamlit_nightly-1.42.3.dev20250228.dist-info}/RECORD +95 -95
  92. streamlit/static/static/js/FileHelper.Bii_mi1A.js +0 -5
  93. streamlit/static/static/js/index.BAfr2RC0.js +0 -3865
  94. streamlit/static/static/js/index.BCErGZwr.js +0 -1
  95. streamlit/static/static/js/index.CTqvpoOz.js +0 -12
  96. streamlit/static/static/js/index.DhcYAj3f.js +0 -1
  97. streamlit/static/static/js/index.u1gL_Cm_.js +0 -201
  98. {streamlit_nightly-1.42.3.dev20250226.data → streamlit_nightly-1.42.3.dev20250228.data}/scripts/streamlit.cmd +0 -0
  99. {streamlit_nightly-1.42.3.dev20250226.dist-info → streamlit_nightly-1.42.3.dev20250228.dist-info}/WHEEL +0 -0
  100. {streamlit_nightly-1.42.3.dev20250226.dist-info → streamlit_nightly-1.42.3.dev20250228.dist-info}/entry_points.txt +0 -0
  101. {streamlit_nightly-1.42.3.dev20250226.dist-info → streamlit_nightly-1.42.3.dev20250228.dist-info}/top_level.txt +0 -0
@@ -1 +0,0 @@
1
- import{r as s,E as $,_ as N,n as u,A as ht,y as j,j as n,ba as J,bv as ft,B as S,bq as Q,b5 as Z,bp as U,a$ as mt,bG as vt,bk as yt,bH as I,bt as wt,F as tt,bh as Ct,bI as It,L,bm as xt,bl as bt}from"./index.KPwXWqBk.js";import{g as St,F as zt,C as Ft,I as Et,E as Ut,u as Ht,a as Tt}from"./FileHelper.Bii_mi1A.js";import{I as Dt}from"./InputInstructions.gFFpIc6i.js";import{i as Bt}from"./inputUtils.CQWz5UKz.js";import{a as Y}from"./index.DW_MHI2K.js";import{U as V}from"./UploadFileInfo.C-jY39rj.js";import{T as Lt}from"./textarea.BGGnQXtw.js";import"./base-input.BUY9TLqO.js";var et=s.forwardRef(function(t,e){var l={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return s.createElement($,N({iconAttrs:l,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},t,{ref:e}),s.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),s.createElement("path",{d:"M16.5 6v11.5c0 2.21-1.79 4-4 4s-4-1.79-4-4V5a2.5 2.5 0 015 0v10.5c0 .55-.45 1-1 1s-1-.45-1-1V6H10v9.5a2.5 2.5 0 005 0V5c0-2.21-1.79-4-4-4S7 2.79 7 5v12.5c0 3.04 2.46 5.5 5.5 5.5s5.5-2.46 5.5-5.5V6h-1.5z"}))});et.displayName="AttachFile";var ot=s.forwardRef(function(t,e){var l={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return s.createElement($,N({iconAttrs:l,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},t,{ref:e}),s.createElement("path",{d:"M11 15h2v2h-2v-2zm0-8h2v6h-2V7zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}))});ot.displayName="ErrorOutline";var nt=s.forwardRef(function(t,e){var l={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return s.createElement($,N({iconAttrs:l,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},t,{ref:e}),s.createElement("rect",{width:24,height:24,fill:"none"}),s.createElement("path",{d:"M3 5.51v3.71c0 .46.31.86.76.97L11 12l-7.24 1.81c-.45.11-.76.51-.76.97v3.71c0 .72.73 1.2 1.39.92l15.42-6.49c.82-.34.82-1.5 0-1.84L4.39 4.58C3.73 4.31 3 4.79 3 5.51z"}))});nt.displayName="Send";const Rt=u("div",{target:"e1togvvn0"})("border:none;position:relative;display:flex;"),kt=u("div",{target:"e1togvvn1"})(({theme:t,extended:e})=>({border:`${t.sizes.borderWidth} solid`,borderColor:t.colors.widgetBorderColor??t.colors.transparent,borderRadius:t.radii.chatInput,backgroundColor:t.colors.secondaryBg,position:"relative",flexGrow:1,display:"flex",alignItems:"center",paddingLeft:t.spacing.lg,maxHeight:e?"none":t.sizes.minElementHeight,gap:t.spacing.sm,overflow:"hidden",":focus-within":{borderColor:t.colors.primary}})),Mt=u("button",{target:"e1togvvn2"})(({theme:t,disabled:e,extended:l})=>{const d=ht(t),[f,g]=d?[t.colors.gray60,t.colors.gray80]:[t.colors.gray80,t.colors.gray40];return{border:"none",backgroundColor:t.colors.transparent,borderTopRightRadius:l?"0":t.radii.chatInput,borderTopLeftRadius:l?t.radii.default:"0",borderBottomRightRadius:t.radii.chatInput,display:"inline-flex",alignItems:"center",justifyContent:"center",lineHeight:t.lineHeights.none,margin:t.spacing.none,padding:t.spacing.sm,color:e?f:g,pointerEvents:"auto","&:focus":{outline:"none"},":focus":{outline:"none"},"&:focus-visible":{backgroundColor:d?t.colors.gray10:t.colors.gray90},"&:hover":{color:t.colors.primary},"&:disabled, &:disabled:hover, &:disabled:active":{backgroundColor:t.colors.transparent,borderColor:t.colors.transparent,color:t.colors.gray,cursor:"not-allowed"}}}),Vt=u("div",{target:"e1togvvn3"})(({theme:t})=>({display:"flex",alignItems:"flex-end",height:"100%",position:"absolute",right:0,marginBottom:`-${t.sizes.borderWidth}`,pointerEvents:"none"})),$t=u("div",{target:"e1togvvn4"})(({theme:t})=>({position:"absolute",bottom:"0px",right:`calc(${t.iconSizes.xl} + 2 * ${t.spacing.sm} + ${t.spacing.sm})`})),Nt=u("div",{target:"ewqvugz0"})(({theme:t,height:e})=>({backgroundColor:t.colors.transparent,position:"absolute",left:0,bottom:0,minHeight:`max(${t.sizes.emptyDropdownHeight}, ${e})`,width:"100%",zIndex:t.zIndices.priority})),At=u("div",{target:"ewqvugz1"})(({theme:t,height:e})=>({border:`${t.sizes.borderWidth} solid`,borderColor:t.colors.primary,borderRadius:t.radii.chatInput,backgroundColor:t.colors.secondaryBg,color:t.colors.primary,display:"flex",alignItems:"center",justifyContent:"center",height:e,width:"100%",fontWeight:t.fontWeights.bold})),Wt=u("div",{target:"ewqvugz2"})(({theme:t,disabled:e})=>({display:"flex",alignItems:"top",height:"100%",marginTop:`-${t.sizes.borderWidth}`,cursor:e?"not-allowed":"auto"})),qt=u("div",{target:"ewqvugz3"})(({disabled:t})=>({pointerEvents:t?"none":"auto"})),Pt=u("div",{target:"ewqvugz4"})(({theme:t})=>({marginTop:"0.625em",marginLeft:t.spacing.sm,height:t.spacing.xl,width:t.sizes.borderWidth,backgroundColor:t.colors.fadedText20})),Ot=u("div",{target:"ewqvugz5"})(({theme:t})=>({left:0,right:0,lineHeight:t.lineHeights.tight,paddingLeft:t.spacing.sm,paddingRight:t.spacing.sm,overflowX:"auto"})),Kt=u("div",{target:"ewqvugz6"})(({})=>({display:"flex"})),_t=u("div",{target:"ewqvugz7"})(({})=>({flex:"0 0 auto"})),Xt=u("div",{target:"ewqvugz8"})(({theme:t})=>({display:"flex",alignItems:"center",padding:t.spacing.sm,gap:t.spacing.twoXS})),Gt=u("div",{target:"ewqvugz9"})(({theme:t})=>({color:t.colors.fadedText60})),Yt=u("div",{target:"ewqvugz10"})(({theme:t,fileStatus:e})=>({overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:e.type==="uploaded"?t.colors.bodyText:t.colors.fadedText60})),jt=u("div",{target:"ewqvugz11"})(({theme:t})=>({marginRight:t.spacing.md,color:t.colors.fadedText60})),Jt=u("small",{target:"ewqvugz12"})(({theme:t})=>({display:"flex",alignItems:"center",maxHeight:t.sizes.smallElementHeight,color:t.colors.fadedText60,"& :hover":{color:t.colors.bodyText}}));function Qt({children:t,content:e}){const l=j();return n(ft,{content:e,placement:J.TOP,overrides:{Body:{style:{top:`-${l.sizes.minElementHeight}`}}},children:t})}const Zt=({fileInfo:t})=>{const{type:e}=t.status;switch(e){case"uploading":return n(vt,{usingCustomTheme:!1,"data-testid":"stChatInputFileIconSpinner",size:"lg",margin:"0",padding:"0"});case"error":return n(Qt,{content:t.status.errorMessage,children:n(U,{content:ot,size:"lg"})});case"uploaded":return n(U,{content:Et,size:"lg"});default:return mt(e),null}},te=({fileInfo:t,onDelete:e})=>S(Xt,{className:"stChatInputFile","data-testid":"stChatInputFile",children:[n(Gt,{children:n(Zt,{fileInfo:t})}),n(Yt,{className:"stChatInputFileName","data-testid":"stChatInputFileName",title:t.name,fileStatus:t.status,children:t.name}),n(jt,{children:St(t.size,zt.Byte)}),n(Jt,{"data-testid":"stChatInputDeleteBtn",children:n(Q,{onClick:()=>e(t.id),kind:Z.MINIMAL,children:n(U,{content:Ft,size:"lg"})})})]}),ee=({items:t,onDelete:e})=>n(Ot,{"data-testid":"stChatUploadedFiles",children:n(Kt,{children:t.map(l=>n(_t,{children:n(te,{fileInfo:l,onDelete:e})},l.id))})}),oe=({getNextLocalFileId:t,addFiles:e,updateFile:l,uploadClient:d,element:f,onUploadProgress:g,onUploadComplete:m})=>(y,h)=>{const v=Y.CancelToken.source(),c=new V(h.name,h.size,t(),{type:"uploading",cancelToken:v,progress:1});e([c]),d.uploadFile({formId:"",...f},y.uploadUrl,h,p=>g(p,c.id),v.token).then(()=>m(c.id,y)).catch(p=>{Y.isCancel(p)||l(c.id,c.setStatus({type:"error",errorMessage:p?p.toString():"Unknown error"}))})},ne=({acceptMultipleFiles:t,uploadClient:e,uploadFile:l,addFiles:d,getNextLocalFileId:f,deleteExistingFiles:g,onUploadComplete:m})=>(y,h)=>{if(!t&&y.length===0&&h.length>1){const v=h.findIndex(c=>{var p;return((p=c.errors)==null?void 0:p[0].code)===Ut.TooManyFiles});v>=0&&(y.push(h[v].file),h.splice(v,1))}if(!t&&y.length>0&&g(),e.fetchFileURLs(y).then(v=>{yt(v,y).forEach(([c,p])=>{l(c,p)})}).catch(v=>{d(y.map(c=>new V(c.name,c.size,f(),{type:"error",errorMessage:v})))}),h.length>0){const v=h.map(c=>new V(c.file.name,c.file.size,f(),{type:"error",errorMessage:c.errors.map(p=>p.message).filter(p=>!!p).join(", ")}));d(v)}m()},re=({getRootProps:t,getInputProps:e,acceptFile:l,disabled:d,theme:f})=>S(Wt,{disabled:d,children:[S(qt,{"data-testid":"stChatInputFileUploadButton",disabled:d,...t(),children:[n("input",{...e()}),n(wt,{content:`Upload or drag and drop ${l===I.Multiple?"files":"a file"}`,placement:J.TOP,onMouseEnterDelay:500,children:n(Q,{kind:Z.MINIMAL,disabled:d,children:n(U,{content:et,size:"lg",color:d?f.colors.fadedText40:f.colors.fadedText60})})})]}),n(Pt,{})]}),ae=({getRootProps:t,getInputProps:e,acceptFile:l,inputHeight:d})=>S(tt,{children:[n(Nt,{height:d,...t(),children:n("input",{...e()})}),n(At,{height:d,children:`Drag and drop ${l===I.Multiple?"files":"a file"} here`})]}),ie=6.5,R=1,k=(t,e,l)=>l.map(d=>d.id===t?e:d),M=(t,e)=>e.find(l=>l.id===t);function se({disabled:t,element:e,widgetMgr:l,fragmentId:d,uploadClient:f}){const g=j(),m=s.useRef(null),y=s.useRef(0),h=s.useRef({minHeight:0,maxHeight:0}),{values:[v],elementRef:c}=Ct(s.useMemo(()=>["width"],[])),[p,T]=s.useState(!1),[z,D]=s.useState(e.default),[F,A]=s.useState(0),[H,rt]=s.useState(!1),[x,b]=s.useState([]),[E,B]=s.useState(!1),C=It(e.acceptFile),W=s.useCallback(o=>b(r=>[...r,...o]),[]),q=s.useCallback(o=>{b(r=>{const i=M(o,r);return L(i)?r:(i.status.type==="uploading"&&i.status.cancelToken.cancel(),i.status.type==="uploaded"&&i.status.fileUrls.deleteUrl&&f.deleteFile(i.status.fileUrls.deleteUrl),r.filter(a=>a.id!==o))})},[f]),at=()=>{const o=x.filter(r=>r.status.type==="uploaded").map(r=>{const{name:i,size:a,status:w}=r,{fileId:ut,fileUrls:gt}=w;return new xt({fileId:ut,fileUrls:gt,name:i,size:a})});return new bt({uploadedFileInfo:o})},P=()=>y.current++,it=ne({acceptMultipleFiles:C===I.Multiple,uploadClient:f,uploadFile:oe({getNextLocalFileId:P,addFiles:W,updateFile:(o,r)=>{b(i=>k(o,r,i))},uploadClient:f,element:e,onUploadProgress:(o,r)=>{b(i=>{const a=M(r,i);if(L(a)||a.status.type!=="uploading")return i;const w=Math.round(o.loaded*100/o.total);return a.status.progress===w?i:k(r,a.setStatus({type:"uploading",cancelToken:a.status.cancelToken,progress:w}),i)})},onUploadComplete:(o,r)=>{b(i=>{const a=M(o,i);return L(a)||a.status.type!=="uploading"?i:k(a.id,a.setStatus({type:"uploaded",fileId:r.fileId,fileUrls:r}),i)})}}),addFiles:W,getNextLocalFileId:P,deleteExistingFiles:()=>x.forEach(o=>q(o.id)),onUploadComplete:()=>{m.current&&m.current.focus()}}),{getRootProps:O,getInputProps:K}=Ht({onDrop:it,multiple:C===I.Multiple,accept:Tt(e.fileType)}),st=()=>{let o=0;const{current:r}=m;if(r){const i=r.placeholder;r.placeholder="",r.style.height="auto",o=r.scrollHeight,r.placeholder=i,r.style.height=""}return o},_=()=>{if(m.current&&m.current.focus(),!p||t)return;const o={data:z,fileUploaderState:at()};l.setChatInputValue(e,o,{fromUi:!0},d),T(!1),b([]),D(""),A(0)},lt=o=>{const{metaKey:r,ctrlKey:i,shiftKey:a}=o;Bt(o)&&!a&&!i&&!r&&(o.preventDefault(),_())},dt=o=>{const{value:r}=o.target,{maxChars:i}=e;i!==0&&r.length>i||(D(r),A(st()))};s.useEffect(()=>x.some(o=>o.status.type==="uploading")?T(!1):T(z!==""||x.length>0),[x,z]),s.useEffect(()=>{if(e.setValue){e.setValue=!1;const o=e.value||"";D(o)}},[e]),s.useEffect(()=>{if(m.current){const{offsetHeight:o}=m.current;h.current.minHeight=o,h.current.maxHeight=o*ie}},[m]),s.useEffect(()=>{const o=a=>{var w;a.preventDefault(),a.stopPropagation(),!E&&((w=a.dataTransfer)!=null&&w.types.includes("Files"))&&B(!0)},r=a=>{a.preventDefault(),a.stopPropagation(),E&&(a.clientX<=0&&a.clientY<=0||a.clientX>=window.innerWidth&&a.clientY>=window.innerHeight)&&B(!1)},i=a=>{a.preventDefault(),a.stopPropagation(),E&&B(!1)};return window.addEventListener("dragover",o),window.addEventListener("drop",i),window.addEventListener("dragleave",r),()=>{window.removeEventListener("dragover",o),window.removeEventListener("drop",i),window.removeEventListener("dragleave",r)}},[E]),s.useEffect(()=>{const{minHeight:o}=h.current;rt(F>0&&m.current?Math.abs(F-o)>R:!1)},[F]);const{placeholder:X,maxChars:ct}=e,{maxHeight:G}=h.current,pt=C!==I.None&&E;return S(tt,{children:[C===I.None?null:n(ee,{items:[...x],onDelete:q}),n(Rt,{className:"stChatInput","data-testid":"stChatInput",ref:c,children:pt?n(ae,{getRootProps:O,getInputProps:K,acceptFile:C,inputHeight:H?`${F+R}px`:g.sizes.minElementHeight}):S(kt,{extended:H,children:[C===I.None?null:n(re,{getRootProps:O,getInputProps:K,acceptFile:C,disabled:t,theme:g}),n(Lt,{inputRef:m,value:z,placeholder:X,onChange:dt,onKeyDown:lt,"aria-label":X,disabled:t,rows:1,overrides:{Root:{style:{minHeight:g.sizes.minElementHeight,outline:"none",borderLeftWidth:"0",borderRightWidth:"0",borderTopWidth:"0",borderBottomWidth:"0"}},Input:{props:{"data-testid":"stChatInputTextArea"},style:{lineHeight:g.lineHeights.inputWidget,"::placeholder":{opacity:"0.7"},height:H?`${F+R}px`:"auto",maxHeight:G?`${G}px`:"none",paddingLeft:g.spacing.none,paddingBottom:g.spacing.sm,paddingTop:g.spacing.sm,paddingRight:`calc(${g.iconSizes.xl} + 2 * ${g.spacing.sm} + ${g.spacing.sm})`}}}}),v>g.breakpoints.hideWidgetDetails&&n($t,{children:n(Dt,{dirty:p,value:z,maxLength:ct,type:"chat",inForm:!1})}),n(Vt,{children:n(Mt,{onClick:_,disabled:!p||t,extended:H,"data-testid":"stChatInputSubmitButton",children:n(U,{content:nt,size:"xl",color:"inherit"})})})]})})]})}const me=s.memo(se);export{me as default};
@@ -1,12 +0,0 @@
1
- import{r as m,bQ as Er,bR as Rr,bS as Tr,bT as Lr,d as Jr,bU as en,g as tn,bw as X,bN as Ae,bO as Ee,bV as rn,bM as xr,bx as W,C as jr,bW as nn,bX as Br,bY as sr,bZ as an,by as Be,b_ as on,b$ as sn,c0 as ln,z as Fr,H as un,y as lr,aD as cn,Q as Tt,L as pn,B as dn,j as We,bs as fn,bF as hn,bt as yn,ba as vn,bu as gn}from"./index.KPwXWqBk.js";import{a as mn}from"./useBasicWidgetState.Bw_fxTtX.js";import{D as Pe,a as Ie,T as bn,l as rt}from"./timepicker.eLEnk1tw.js";import{I as On}from"./input.EkJ_AsTP.js";import{I as Dn}from"./base-input.BUY9TLqO.js";import"./FormClearHelper.BlCIuWCo.js";import"./possibleConstructorReturn.CZfYLVBb.js";import"./createSuper.DprEKsA6.js";var Sn=["title","size","color","overrides"];function ft(){return ft=Object.assign?Object.assign.bind():function(t){for(var r=1;r<arguments.length;r++){var n=arguments[r];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t},ft.apply(this,arguments)}function $n(t,r){if(t==null)return{};var n=_n(t,r),a,e;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(e=0;e<o.length;e++)a=o[e],!(r.indexOf(a)>=0)&&Object.prototype.propertyIsEnumerable.call(t,a)&&(n[a]=t[a])}return n}function _n(t,r){if(t==null)return{};var n={},a=Object.keys(t),e,o;for(o=0;o<a.length;o++)e=a[o],!(r.indexOf(e)>=0)&&(n[e]=t[e]);return n}function wn(t,r){return Pn(t)||Mn(t,r)||Cn(t,r)||kn()}function kn(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
2
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Cn(t,r){if(t){if(typeof t=="string")return ur(t,r);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ur(t,r)}}function ur(t,r){(r==null||r>t.length)&&(r=t.length);for(var n=0,a=new Array(r);n<r;n++)a[n]=t[n];return a}function Mn(t,r){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var a=[],e=!0,o=!1,i,l;try{for(n=n.call(t);!(e=(i=n.next()).done)&&(a.push(i.value),!(r&&a.length===r));e=!0);}catch(u){o=!0,l=u}finally{try{!e&&n.return!=null&&n.return()}finally{if(o)throw l}}return a}}function Pn(t){if(Array.isArray(t))return t}function In(t,r){var n=Er(),a=wn(n,2),e=a[1],o=t.title,i=o===void 0?"Left":o,l=t.size,u=t.color,c=t.overrides,y=c===void 0?{}:c,p=$n(t,Sn),h=Rr({component:e.icons&&e.icons.ChevronLeft?e.icons.ChevronLeft:null},y&&y.Svg?Tr(y.Svg):{});return m.createElement(Lr,ft({viewBox:"0 0 24 24",ref:r,title:i,size:l,color:u,overrides:{Svg:h}},p),m.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9 12C9 12.2652 9.10536 12.5196 9.29289 12.7071L13.2929 16.7071C13.6834 17.0976 14.3166 17.0976 14.7071 16.7071C15.0976 16.3166 15.0976 15.6834 14.7071 15.2929L11.4142 12L14.7071 8.70711C15.0976 8.31658 15.0976 7.68342 14.7071 7.29289C14.3166 6.90237 13.6834 6.90237 13.2929 7.29289L9.29289 11.2929C9.10536 11.4804 9 11.7348 9 12Z"}))}const cr=m.forwardRef(In);var Hn=["title","size","color","overrides"];function ht(){return ht=Object.assign?Object.assign.bind():function(t){for(var r=1;r<arguments.length;r++){var n=arguments[r];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t},ht.apply(this,arguments)}function An(t,r){if(t==null)return{};var n=En(t,r),a,e;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(e=0;e<o.length;e++)a=o[e],!(r.indexOf(a)>=0)&&Object.prototype.propertyIsEnumerable.call(t,a)&&(n[a]=t[a])}return n}function En(t,r){if(t==null)return{};var n={},a=Object.keys(t),e,o;for(o=0;o<a.length;o++)e=a[o],!(r.indexOf(e)>=0)&&(n[e]=t[e]);return n}function Rn(t,r){return jn(t)||xn(t,r)||Ln(t,r)||Tn()}function Tn(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
3
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ln(t,r){if(t){if(typeof t=="string")return pr(t,r);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return pr(t,r)}}function pr(t,r){(r==null||r>t.length)&&(r=t.length);for(var n=0,a=new Array(r);n<r;n++)a[n]=t[n];return a}function xn(t,r){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var a=[],e=!0,o=!1,i,l;try{for(n=n.call(t);!(e=(i=n.next()).done)&&(a.push(i.value),!(r&&a.length===r));e=!0);}catch(u){o=!0,l=u}finally{try{!e&&n.return!=null&&n.return()}finally{if(o)throw l}}return a}}function jn(t){if(Array.isArray(t))return t}function Bn(t,r){var n=Er(),a=Rn(n,2),e=a[1],o=t.title,i=o===void 0?"Right":o,l=t.size,u=t.color,c=t.overrides,y=c===void 0?{}:c,p=An(t,Hn),h=Rr({component:e.icons&&e.icons.ChevronRight?e.icons.ChevronRight:null},y&&y.Svg?Tr(y.Svg):{});return m.createElement(Lr,ht({viewBox:"0 0 24 24",ref:r,title:i,size:l,color:u,overrides:{Svg:h}},p),m.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.29289 7.29289C8.90237 7.68342 8.90237 8.31658 9.29289 8.70711L12.5858 12L9.29289 15.2929C8.90237 15.6834 8.90237 16.3166 9.29289 16.7071C9.68342 17.0976 10.3166 17.0976 10.7071 16.7071L14.7071 12.7071C14.8946 12.5196 15 12.2652 15 12C15 11.7348 14.8946 11.4804 14.7071 11.2929L10.7071 7.29289C10.3166 6.90237 9.68342 6.90237 9.29289 7.29289Z"}))}const dr=m.forwardRef(Bn);var nt={exports:{}},at,fr;function Fn(){if(fr)return at;fr=1;function t(d){return d&&typeof d=="object"&&"default"in d?d.default:d}var r=t(Jr()),n=en();function a(d,b){for(var S=Object.getOwnPropertyNames(b),f=0;f<S.length;f++){var s=S[f],M=Object.getOwnPropertyDescriptor(b,s);M&&M.configurable&&d[s]===void 0&&Object.defineProperty(d,s,M)}return d}function e(){return(e=Object.assign||function(d){for(var b=1;b<arguments.length;b++){var S=arguments[b];for(var f in S)Object.prototype.hasOwnProperty.call(S,f)&&(d[f]=S[f])}return d}).apply(this,arguments)}function o(d,b){d.prototype=Object.create(b.prototype),a(d.prototype.constructor=d,b)}function i(d,b){if(d==null)return{};var S,f,s={},M=Object.keys(d);for(f=0;f<M.length;f++)S=M[f],0<=b.indexOf(S)||(s[S]=d[S]);return s}function l(d){if(d===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return d}var u=function(d,b,S,f,s,M,Y,te){if(!d){var R;if(b===void 0)R=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var j=[S,f,s,M,Y,te],N=0;(R=new Error(b.replace(/%s/g,function(){return j[N++]}))).name="Invariant Violation"}throw R.framesToPop=1,R}},c=u;function y(d,b,S){if("selectionStart"in d&&"selectionEnd"in d)d.selectionStart=b,d.selectionEnd=S;else{var f=d.createTextRange();f.collapse(!0),f.moveStart("character",b),f.moveEnd("character",S-b),f.select()}}function p(d){var b=0,S=0;if("selectionStart"in d&&"selectionEnd"in d)b=d.selectionStart,S=d.selectionEnd;else{var f=document.selection.createRange();f.parentElement()===d&&(b=-f.moveStart("character",-d.value.length),S=-f.moveEnd("character",-d.value.length))}return{start:b,end:S,length:S-b}}var h={9:"[0-9]",a:"[A-Za-z]","*":"[A-Za-z0-9]"},v="_";function g(d,b,S){var f="",s="",M=null,Y=[];if(b===void 0&&(b=v),S==null&&(S=h),!d||typeof d!="string")return{maskChar:b,formatChars:S,mask:null,prefix:null,lastEditablePosition:null,permanents:[]};var te=!1;return d.split("").forEach(function(R){te=!te&&R==="\\"||(te||!S[R]?(Y.push(f.length),f.length===Y.length-1&&(s+=R)):M=f.length+1,f+=R,!1)}),{maskChar:b,formatChars:S,prefix:s,mask:f,lastEditablePosition:M,permanents:Y}}function O(d,b){return d.permanents.indexOf(b)!==-1}function D(d,b,S){var f=d.mask,s=d.formatChars;if(!S)return!1;if(O(d,b))return f[b]===S;var M=s[f[b]];return new RegExp(M).test(S)}function _(d,b){return b.split("").every(function(S,f){return O(d,f)||!D(d,f,S)})}function $(d,b){var S=d.maskChar,f=d.prefix;if(!S){for(;b.length>f.length&&O(d,b.length-1);)b=b.slice(0,b.length-1);return b.length}for(var s=f.length,M=b.length;M>=f.length;M--){var Y=b[M];if(!O(d,M)&&D(d,M,Y)){s=M+1;break}}return s}function k(d,b){return $(d,b)===d.mask.length}function w(d,b){var S=d.maskChar,f=d.mask,s=d.prefix;if(!S){for((b=H(d,"",b,0)).length<s.length&&(b=s);b.length<f.length&&O(d,b.length);)b+=f[b.length];return b}if(b)return H(d,w(d,""),b,0);for(var M=0;M<f.length;M++)O(d,M)?b+=f[M]:b+=S;return b}function B(d,b,S,f){var s=S+f,M=d.maskChar,Y=d.mask,te=d.prefix,R=b.split("");if(M)return R.map(function(N,re){return re<S||s<=re?N:O(d,re)?Y[re]:M}).join("");for(var j=s;j<R.length;j++)O(d,j)&&(R[j]="");return S=Math.max(te.length,S),R.splice(S,s-S),b=R.join(""),w(d,b)}function H(d,b,S,f){var s=d.mask,M=d.maskChar,Y=d.prefix,te=S.split(""),R=k(d,b);return!M&&f>b.length&&(b+=s.slice(b.length,f)),te.every(function(j){for(;se=j,O(d,z=f)&&se!==s[z];){if(f>=b.length&&(b+=s[f]),N=j,re=f,M&&O(d,re)&&N===M)return!0;if(++f>=s.length)return!1}var N,re,z,se;return!D(d,f,j)&&j!==M||(f<b.length?b=M||R||f<Y.length?b.slice(0,f)+j+b.slice(f+1):(b=b.slice(0,f)+j+b.slice(f),w(d,b)):M||(b+=j),++f<s.length)}),b}function T(d,b,S,f){var s=d.mask,M=d.maskChar,Y=S.split(""),te=f;return Y.every(function(R){for(;N=R,O(d,j=f)&&N!==s[j];)if(++f>=s.length)return!1;var j,N;return(D(d,f,R)||R===M)&&f++,f<s.length}),f-te}function E(d,b){for(var S=b;0<=S;--S)if(!O(d,S))return S;return null}function P(d,b){for(var S=d.mask,f=b;f<S.length;++f)if(!O(d,f))return f;return null}function L(d){return d||d===0?d+"":""}function I(d,b,S,f,s){var M=d.mask,Y=d.prefix,te=d.lastEditablePosition,R=b,j="",N=0,re=0,z=Math.min(s.start,S.start);return S.end>s.start?re=(N=T(d,f,j=R.slice(s.start,S.end),z))?s.length:0:R.length<f.length&&(re=f.length-R.length),R=f,re&&(re===1&&!s.length&&(z=s.start===S.start?P(d,S.start):E(d,S.start)),R=B(d,R,z,re)),R=H(d,R,j,z),(z+=N)>=M.length?z=M.length:z<Y.length&&!N?z=Y.length:z>=Y.length&&z<te&&N&&(z=P(d,z)),j||(j=null),{value:R=w(d,R),enteredString:j,selection:{start:z,end:z}}}function A(){var d=new RegExp("windows","i"),b=new RegExp("phone","i"),S=navigator.userAgent;return d.test(S)&&b.test(S)}function x(d){return typeof d=="function"}function q(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame}function ve(){return window.cancelAnimationFrame||window.webkitCancelRequestAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame}function ie(d){return(ve()?q():function(){return setTimeout(d,1e3/60)})(d)}function J(d){(ve()||clearTimeout)(d)}var ee=function(d){function b(f){var s=d.call(this,f)||this;s.focused=!1,s.mounted=!1,s.previousSelection=null,s.selectionDeferId=null,s.saveSelectionLoopDeferId=null,s.saveSelectionLoop=function(){s.previousSelection=s.getSelection(),s.saveSelectionLoopDeferId=ie(s.saveSelectionLoop)},s.runSaveSelectionLoop=function(){s.saveSelectionLoopDeferId===null&&s.saveSelectionLoop()},s.stopSaveSelectionLoop=function(){s.saveSelectionLoopDeferId!==null&&(J(s.saveSelectionLoopDeferId),s.saveSelectionLoopDeferId=null,s.previousSelection=null)},s.getInputDOMNode=function(){if(!s.mounted)return null;var C=n.findDOMNode(l(l(s))),F=typeof window<"u"&&C instanceof window.Element;if(C&&!F)return null;if(C.nodeName!=="INPUT"&&(C=C.querySelector("input")),!C)throw new Error("react-input-mask: inputComponent doesn't contain input node");return C},s.getInputValue=function(){var C=s.getInputDOMNode();return C?C.value:null},s.setInputValue=function(C){var F=s.getInputDOMNode();F&&(s.value=C,F.value=C)},s.setCursorToEnd=function(){var C=$(s.maskOptions,s.value),F=P(s.maskOptions,C);F!==null&&s.setCursorPosition(F)},s.setSelection=function(C,F,U){U===void 0&&(U={});var V=s.getInputDOMNode(),Q=s.isFocused();V&&Q&&(U.deferred||y(V,C,F),s.selectionDeferId!==null&&J(s.selectionDeferId),s.selectionDeferId=ie(function(){s.selectionDeferId=null,y(V,C,F)}),s.previousSelection={start:C,end:F,length:Math.abs(F-C)})},s.getSelection=function(){return p(s.getInputDOMNode())},s.getCursorPosition=function(){return s.getSelection().start},s.setCursorPosition=function(C){s.setSelection(C,C)},s.isFocused=function(){return s.focused},s.getBeforeMaskedValueChangeConfig=function(){var C=s.maskOptions,F=C.mask,U=C.maskChar,V=C.permanents,Q=C.formatChars;return{mask:F,maskChar:U,permanents:V,alwaysShowMask:!!s.props.alwaysShowMask,formatChars:Q}},s.isInputAutofilled=function(C,F,U,V){var Q=s.getInputDOMNode();try{if(Q.matches(":-webkit-autofill"))return!0}catch{}return!s.focused||V.end<U.length&&F.end===C.length},s.onChange=function(C){var F=l(l(s)).beforePasteState,U=l(l(s)).previousSelection,V=s.props.beforeMaskedValueChange,Q=s.getInputValue(),fe=s.value,he=s.getSelection();s.isInputAutofilled(Q,he,fe,U)&&(fe=w(s.maskOptions,""),U={start:0,end:0,length:0}),F&&(U=F.selection,fe=F.value,he={start:U.start+Q.length,end:U.start+Q.length,length:0},Q=fe.slice(0,U.start)+Q+fe.slice(U.end),s.beforePasteState=null);var _e=I(s.maskOptions,Q,he,fe,U),Ne=_e.enteredString,me=_e.selection,ke=_e.value;if(x(V)){var He=V({value:ke,selection:me},{value:fe,selection:U},Ne,s.getBeforeMaskedValueChangeConfig());ke=He.value,me=He.selection}s.setInputValue(ke),x(s.props.onChange)&&s.props.onChange(C),s.isWindowsPhoneBrowser?s.setSelection(me.start,me.end,{deferred:!0}):s.setSelection(me.start,me.end)},s.onFocus=function(C){var F=s.props.beforeMaskedValueChange,U=s.maskOptions,V=U.mask,Q=U.prefix;if(s.focused=!0,s.mounted=!0,V){if(s.value)$(s.maskOptions,s.value)<s.maskOptions.mask.length&&s.setCursorToEnd();else{var fe=w(s.maskOptions,Q),he=w(s.maskOptions,fe),_e=$(s.maskOptions,he),Ne=P(s.maskOptions,_e),me={start:Ne,end:Ne};if(x(F)){var ke=F({value:he,selection:me},{value:s.value,selection:null},null,s.getBeforeMaskedValueChangeConfig());he=ke.value,me=ke.selection}var He=he!==s.getInputValue();He&&s.setInputValue(he),He&&x(s.props.onChange)&&s.props.onChange(C),s.setSelection(me.start,me.end)}s.runSaveSelectionLoop()}x(s.props.onFocus)&&s.props.onFocus(C)},s.onBlur=function(C){var F=s.props.beforeMaskedValueChange,U=s.maskOptions.mask;if(s.stopSaveSelectionLoop(),s.focused=!1,U&&!s.props.alwaysShowMask&&_(s.maskOptions,s.value)){var V="";x(F)&&(V=F({value:V,selection:null},{value:s.value,selection:s.previousSelection},null,s.getBeforeMaskedValueChangeConfig()).value);var Q=V!==s.getInputValue();Q&&s.setInputValue(V),Q&&x(s.props.onChange)&&s.props.onChange(C)}x(s.props.onBlur)&&s.props.onBlur(C)},s.onMouseDown=function(C){if(!s.focused&&document.addEventListener){s.mouseDownX=C.clientX,s.mouseDownY=C.clientY,s.mouseDownTime=new Date().getTime();var F=function U(V){if(document.removeEventListener("mouseup",U),s.focused){var Q=Math.abs(V.clientX-s.mouseDownX),fe=Math.abs(V.clientY-s.mouseDownY),he=Math.max(Q,fe),_e=new Date().getTime()-s.mouseDownTime;(he<=10&&_e<=200||he<=5&&_e<=300)&&s.setCursorToEnd()}};document.addEventListener("mouseup",F)}x(s.props.onMouseDown)&&s.props.onMouseDown(C)},s.onPaste=function(C){x(s.props.onPaste)&&s.props.onPaste(C),C.defaultPrevented||(s.beforePasteState={value:s.getInputValue(),selection:s.getSelection()},s.setInputValue(""))},s.handleRef=function(C){s.props.children==null&&x(s.props.inputRef)&&s.props.inputRef(C)};var M=f.mask,Y=f.maskChar,te=f.formatChars,R=f.alwaysShowMask,j=f.beforeMaskedValueChange,N=f.defaultValue,re=f.value;s.maskOptions=g(M,Y,te),N==null&&(N=""),re==null&&(re=N);var z=L(re);if(s.maskOptions.mask&&(R||z)&&(z=w(s.maskOptions,z),x(j))){var se=f.value;f.value==null&&(se=N),z=j({value:z,selection:null},{value:se=L(se),selection:null},null,s.getBeforeMaskedValueChangeConfig()).value}return s.value=z,s}o(b,d);var S=b.prototype;return S.componentDidMount=function(){this.mounted=!0,this.getInputDOMNode()&&(this.isWindowsPhoneBrowser=A(),this.maskOptions.mask&&this.getInputValue()!==this.value&&this.setInputValue(this.value))},S.componentDidUpdate=function(){var f=this.previousSelection,s=this.props,M=s.beforeMaskedValueChange,Y=s.alwaysShowMask,te=s.mask,R=s.maskChar,j=s.formatChars,N=this.maskOptions,re=Y||this.isFocused(),z=this.props.value!=null,se=z?L(this.props.value):this.value,C=f?f.start:null;if(this.maskOptions=g(te,R,j),this.maskOptions.mask){!N.mask&&this.isFocused()&&this.runSaveSelectionLoop();var F=this.maskOptions.mask&&this.maskOptions.mask!==N.mask;if(N.mask||z||(se=this.getInputValue()),(F||this.maskOptions.mask&&(se||re))&&(se=w(this.maskOptions,se)),F){var U=$(this.maskOptions,se);(C===null||U<C)&&(C=k(this.maskOptions,se)?U:P(this.maskOptions,U))}!this.maskOptions.mask||!_(this.maskOptions,se)||re||z&&this.props.value||(se="");var V={start:C,end:C};if(x(M)){var Q=M({value:se,selection:V},{value:this.value,selection:this.previousSelection},null,this.getBeforeMaskedValueChangeConfig());se=Q.value,V=Q.selection}this.value=se;var fe=this.getInputValue()!==this.value;fe?(this.setInputValue(this.value),this.forceUpdate()):F&&this.forceUpdate();var he=!1;V.start!=null&&V.end!=null&&(he=!f||f.start!==V.start||f.end!==V.end),(he||fe)&&this.setSelection(V.start,V.end)}else N.mask&&(this.stopSaveSelectionLoop(),this.forceUpdate())},S.componentWillUnmount=function(){this.mounted=!1,this.selectionDeferId!==null&&J(this.selectionDeferId),this.stopSaveSelectionLoop()},S.render=function(){var f,s=this.props,M=(s.mask,s.alwaysShowMask,s.maskChar,s.formatChars,s.inputRef,s.beforeMaskedValueChange,s.children),Y=i(s,["mask","alwaysShowMask","maskChar","formatChars","inputRef","beforeMaskedValueChange","children"]);if(M){x(M)||c(!1);var te=["onChange","onPaste","onMouseDown","onFocus","onBlur","value","disabled","readOnly"],R=e({},Y);te.forEach(function(N){return delete R[N]}),f=M(R),te.filter(function(N){return f.props[N]!=null&&f.props[N]!==Y[N]}).length&&c(!1)}else f=r.createElement("input",e({ref:this.handleRef},Y));var j={onFocus:this.onFocus,onBlur:this.onBlur};return this.maskOptions.mask&&(Y.disabled||Y.readOnly||(j.onChange=this.onChange,j.onPaste=this.onPaste,j.onMouseDown=this.onMouseDown),Y.value!=null&&(j.value=this.value)),f=r.cloneElement(f,j)},b}(r.Component);return at=ee,at}var hr;function Nn(){return hr||(hr=1,nt.exports=Fn()),nt.exports}var Wn=Nn();const Vn=tn(Wn);var Yn=["startEnhancer","endEnhancer","error","positive","onChange","onFocus","onBlur","value","disabled","readOnly"],zn=["Input"],Un=["mask","maskChar","overrides"];function yr(t,r){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);r&&(a=a.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,a)}return n}function ot(t){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?yr(Object(n),!0).forEach(function(a){qn(t,a,n[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):yr(Object(n)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(n,a))})}return t}function qn(t,r,n){return r in t?Object.defineProperty(t,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[r]=n,t}function ze(t){"@babel/helpers - typeof";return ze=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},ze(t)}function Fe(){return Fe=Object.assign?Object.assign.bind():function(t){for(var r=1;r<arguments.length;r++){var n=arguments[r];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t},Fe.apply(this,arguments)}function yt(t,r){if(t==null)return{};var n=Kn(t,r),a,e;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(e=0;e<o.length;e++)a=o[e],!(r.indexOf(a)>=0)&&Object.prototype.propertyIsEnumerable.call(t,a)&&(n[a]=t[a])}return n}function Kn(t,r){if(t==null)return{};var n={},a=Object.keys(t),e,o;for(o=0;o<a.length;o++)e=a[o],!(r.indexOf(e)>=0)&&(n[e]=t[e]);return n}var Nr=m.forwardRef(function(t,r){t.startEnhancer,t.endEnhancer,t.error,t.positive;var n=t.onChange,a=t.onFocus,e=t.onBlur,o=t.value,i=t.disabled,l=t.readOnly,u=yt(t,Yn);return m.createElement(Vn,Fe({onChange:n,onFocus:a,onBlur:e,value:o,disabled:i,readOnly:l},u),function(c){return m.createElement(Dn,Fe({ref:r,onChange:n,onFocus:a,onBlur:e,value:o,disabled:i,readOnly:l},c))})});Nr.displayName="MaskOverride";function Wr(t){var r=t.mask,n=t.maskChar,a=t.overrides;a=a===void 0?{}:a;var e=a.Input,o=e===void 0?{}:e,i=yt(a,zn),l=yt(t,Un),u=Nr,c={},y={};typeof o=="function"?u=o:ze(o)==="object"&&(u=o.component||u,c=o.props||{},y=o.style||{}),ze(c)==="object"&&(c=ot(ot({},c),{},{mask:c.mask||r,maskChar:c.maskChar||n}));var p=ot({Input:{component:u,props:c,style:y}},i);return m.createElement(On,Fe({},l,{overrides:p}))}Wr.defaultProps={maskChar:" "};var Lt=Object.freeze({horizontal:"horizontal",vertical:"vertical"}),Vr=[0,1,2,3,4,5,6],Xn=[0,1,2,3,4,5,6,7,8,9,10,11],oe={high:"high",default:"default"},$e={startDate:"startDate",endDate:"endDate"},Qn={locked:"locked"};function vr(t,r){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);r&&(a=a.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,a)}return n}function Me(t){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?vr(Object(n),!0).forEach(function(a){Zn(t,a,n[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):vr(Object(n)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(n,a))})}return t}function Zn(t,r,n){return r in t?Object.defineProperty(t,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[r]=n,t}var xt=X("label",function(t){var r=t.$disabled,n=t.$theme,a=n.colors,e=n.typography;return Me(Me({},e.font250),{},{width:"100%",color:r?a.contentSecondary:a.contentPrimary,display:"block",paddingTop:0,paddingRight:0,paddingBottom:0,paddingLeft:0})});xt.displayName="Label";xt.displayName="Label";var jt=X("span",function(t){var r=t.$theme.sizing;return{display:"flex",width:"100%",marginTop:r.scale300,marginRight:0,marginBottom:r.scale300,marginLeft:0}});jt.displayName="LabelContainer";jt.displayName="LabelContainer";var Bt=X("span",function(t){var r=t.$disabled,n=t.$counterError,a=t.$theme,e=a.colors,o=a.typography;return Me(Me({},o.font100),{},{flex:0,width:"100%",color:n?e.negative400:r?e.contentSecondary:e.contentPrimary})});Bt.displayName="LabelEndEnhancer";Bt.displayName="LabelEndEnhancer";var Ft=X("div",function(t){var r=t.$error,n=t.$positive,a=t.$theme,e=a.colors,o=a.sizing,i=a.typography,l=e.contentSecondary;return r?l=e.negative400:n&&(l=e.positive400),Me(Me({},i.font100),{},{color:l,paddingTop:0,paddingRight:0,paddingBottom:0,paddingLeft:0,marginTop:o.scale300,marginRight:0,marginBottom:o.scale300,marginLeft:0})});Ft.displayName="Caption";Ft.displayName="Caption";var Nt=X("div",function(t){var r=t.$theme.sizing;return{width:"100%",marginBottom:r.scale600}});Nt.displayName="ControlContainer";Nt.displayName="ControlContainer";function we(){return we=Object.assign?Object.assign.bind():function(t){for(var r=1;r<arguments.length;r++){var n=arguments[r];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t},we.apply(this,arguments)}function Ue(t){"@babel/helpers - typeof";return Ue=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Ue(t)}function Gn(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function Jn(t,r){for(var n=0;n<r.length;n++){var a=r[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,a.key,a)}}function ea(t,r,n){return r&&Jn(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function ta(t,r){if(typeof r!="function"&&r!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),r&&vt(t,r)}function vt(t,r){return vt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,e){return a.__proto__=e,a},vt(t,r)}function ra(t){var r=oa();return function(){var a=qe(t),e;if(r){var o=qe(this).constructor;e=Reflect.construct(a,arguments,o)}else e=a.apply(this,arguments);return na(this,e)}}function na(t,r){if(r&&(Ue(r)==="object"||typeof r=="function"))return r;if(r!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return aa(t)}function aa(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function oa(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function qe(t){return qe=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},qe(t)}function ia(t,r,n){return r in t?Object.defineProperty(t,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[r]=n,t}function sa(t,r,n,a){return r&&typeof r!="boolean"?typeof r=="function"?r(a):r:n&&typeof n!="boolean"?typeof n=="function"?n(a):n:t?typeof t=="function"?t(a):t:null}var gt=function(t){ta(n,t);var r=ra(n);function n(){return Gn(this,n),r.apply(this,arguments)}return ea(n,[{key:"render",value:function(){var e=this.props,o=e.overrides,i=o.Label,l=o.LabelEndEnhancer,u=o.LabelContainer,c=o.Caption,y=o.ControlContainer,p=e.label,h=e.caption,v=e.disabled,g=e.error,O=e.positive,D=e.htmlFor,_=e.children,$=e.counter,k=m.Children.only(_).props,w={$disabled:!!v,$error:!!g,$positive:!!O},B=Ae(i)||xt,H=Ae(l)||Bt,T=Ae(u)||jt,E=Ae(c)||Ft,P=Ae(y)||Nt,L=sa(h,g,O,w),I=this.props.labelEndEnhancer;if($){var A=null,x=null,q=null;Ue($)==="object"&&(x=$.length,A=$.maxLength,q=$.error),A=A||k.maxLength,x==null&&typeof k.value=="string"&&(x=k.value.length),x==null&&(x=0),w.$length=x,A==null?I||(I="".concat(x)):(w.$maxLength=x,I||(I="".concat(x,"/").concat(A)),x>A&&q==null&&(q=!0)),q&&(w.$error=!0,w.$counterError=!0)}return m.createElement(m.Fragment,null,p&&m.createElement(T,we({},w,Ee(u)),m.createElement(B,we({"data-baseweb":"form-control-label",htmlFor:D||k.id},w,Ee(i)),typeof p=="function"?p(w):p),!!I&&m.createElement(H,we({},w,Ee(l)),typeof I=="function"?I(w):I)),m.createElement(rn,null,function(ve){return m.createElement(P,we({"data-baseweb":"form-control-container"},w,Ee(y)),m.Children.map(_,function(ie,J){if(ie){var ee=ie.key||String(J);return m.cloneElement(ie,{key:ee,"aria-errormessage":g?ve:null,"aria-describedby":h||O?ve:null,disabled:k.disabled||v,error:typeof k.error<"u"?k.error:w.$error,positive:typeof k.positive<"u"?k.positive:w.$positive})}}),(!!h||!!g||O)&&m.createElement(E,we({"data-baseweb":"form-control-caption",id:ve},w,Ee(c)),L))}))}}]),n}(m.Component);ia(gt,"defaultProps",{overrides:{},label:null,caption:null,disabled:!1,counter:!1});function gr(t,r){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);r&&(a=a.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,a)}return n}function mr(t){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?gr(Object(n),!0).forEach(function(a){la(t,a,n[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):gr(Object(n)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(n,a))})}return t}function la(t,r,n){return r in t?Object.defineProperty(t,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[r]=n,t}var ua=function(r){return Xn.map(function(n){return{id:n.toString(),label:r(n)}})},ca=function(r,n){return r.map(function(a){return n.includes(Number(a.id))?a:mr(mr({},a),{},{disabled:!0})})},pa=function(r){var n=r.filterMonthsList,a=r.formatMonthLabel,e=ua(a);return n&&(e=ca(e,n)),e};function da(t){var r=t.$range,n=r===void 0?!1:r,a=t.$disabled,e=a===void 0?!1:a,o=t.$isHighlighted,i=o===void 0?!1:o,l=t.$isHovered,u=l===void 0?!1:l,c=t.$selected,y=c===void 0?!1:c,p=t.$hasRangeSelected,h=p===void 0?!1:p,v=t.$startDate,g=v===void 0?!1:v,O=t.$endDate,D=O===void 0?!1:O,_=t.$pseudoSelected,$=_===void 0?!1:_,k=t.$hasRangeHighlighted,w=k===void 0?!1:k,B=t.$pseudoHighlighted,H=B===void 0?!1:B,T=t.$hasRangeOnRight,E=T===void 0?!1:T,P=t.$startOfMonth,L=P===void 0?!1:P,I=t.$endOfMonth,A=I===void 0?!1:I,x=t.$outsideMonth,q=x===void 0?!1:x;return"".concat(+n).concat(+e).concat(+(i||u)).concat(+y).concat(+h).concat(+g).concat(+D).concat(+$).concat(+w).concat(+H).concat(+(w&&!H&&E)).concat(+(w&&!H&&!E)).concat(+L).concat(+A).concat(+q)}function fa(t,r){return ga(t)||va(t,r)||ya(t,r)||ha()}function ha(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
4
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ya(t,r){if(t){if(typeof t=="string")return br(t,r);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return br(t,r)}}function br(t,r){(r==null||r>t.length)&&(r=t.length);for(var n=0,a=new Array(r);n<r;n++)a[n]=t[n];return a}function va(t,r){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var a=[],e=!0,o=!1,i,l;try{for(n=n.call(t);!(e=(i=n.next()).done)&&(a.push(i.value),!(r&&a.length===r));e=!0);}catch(u){o=!0,l=u}finally{try{!e&&n.return!=null&&n.return()}finally{if(o)throw l}}return a}}function ga(t){if(Array.isArray(t))return t}function Or(t,r){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);r&&(a=a.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,a)}return n}function ne(t){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?Or(Object(n),!0).forEach(function(a){xe(t,a,n[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Or(Object(n)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(n,a))})}return t}function xe(t,r,n){return r in t?Object.defineProperty(t,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[r]=n,t}var Wt=X("div",function(t){var r=t.$separateRangeInputs;return ne({width:"100%"},r?{display:"flex",justifyContent:"center"}:{})});Wt.displayName="StyledInputWrapper";Wt.displayName="StyledInputWrapper";var Vt=X("div",function(t){var r=t.$theme;return ne(ne({},r.typography.LabelMedium),{},{marginBottom:r.sizing.scale300})});Vt.displayName="StyledInputLabel";Vt.displayName="StyledInputLabel";var Yt=X("div",function(t){var r=t.$theme;return{width:"100%",marginRight:r.sizing.scale300}});Yt.displayName="StyledStartDate";Yt.displayName="StyledStartDate";var zt=X("div",function(t){return t.$theme,{width:"100%"}});zt.displayName="StyledEndDate";zt.displayName="StyledEndDate";var Ut=X("div",function(t){var r=t.$theme,n=r.typography,a=r.colors,e=r.borders;return ne(ne({},n.font200),{},{color:a.calendarForeground,backgroundColor:a.calendarBackground,textAlign:"center",borderTopLeftRadius:e.surfaceBorderRadius,borderTopRightRadius:e.surfaceBorderRadius,borderBottomRightRadius:e.surfaceBorderRadius,borderBottomLeftRadius:e.surfaceBorderRadius,display:"inline-block"})});Ut.displayName="StyledRoot";Ut.displayName="StyledRoot";var qt=X("div",function(t){var r=t.$orientation;return{display:"flex",flexDirection:r===Lt.vertical?"column":"row"}});qt.displayName="StyledMonthContainer";qt.displayName="StyledMonthContainer";var Kt=X("div",function(t){var r=t.$theme.sizing,n=t.$density;return{paddingTop:r.scale300,paddingBottom:n===oe.high?r.scale400:r.scale300,paddingLeft:r.scale500,paddingRight:r.scale500}});Kt.displayName="StyledCalendarContainer";Kt.displayName="StyledCalendarContainer";var Ke=X("div",function(t){var r=t.$theme,n=r.direction==="rtl"?"right":"left";return{marginBottom:r.sizing.scale600,paddingLeft:r.sizing.scale600,paddingRight:r.sizing.scale600,textAlign:n}});Ke.displayName="StyledSelectorContainer";Ke.displayName="StyledSelectorContainer";var Xt=X("div",function(t){var r=t.$theme,n=r.typography,a=r.borders,e=r.colors,o=r.sizing,i=t.$density;return ne(ne({},i===oe.high?n.LabelMedium:n.LabelLarge),{},{color:e.calendarHeaderForeground,display:"flex",justifyContent:"space-between",alignItems:"center",paddingTop:o.scale600,paddingBottom:o.scale300,paddingLeft:o.scale600,paddingRight:o.scale600,backgroundColor:e.calendarHeaderBackground,borderTopLeftRadius:a.surfaceBorderRadius,borderTopRightRadius:a.surfaceBorderRadius,borderBottomRightRadius:0,borderBottomLeftRadius:0,minHeight:i===oe.high?"calc(".concat(o.scale800," + ").concat(o.scale0,")"):o.scale950})});Xt.displayName="StyledCalendarHeader";Xt.displayName="StyledCalendarHeader";var Qt=X("div",function(t){return{color:t.$theme.colors.calendarHeaderForeground,backgroundColor:t.$theme.colors.calendarHeaderBackground,whiteSpace:"nowrap"}});Qt.displayName="StyledMonthHeader";Qt.displayName="StyledMonthHeader";var Zt=X("button",function(t){var r=t.$theme,n=r.typography,a=r.colors,e=t.$isFocusVisible,o=t.$density;return ne(ne({},o===oe.high?n.LabelMedium:n.LabelLarge),{},{alignItems:"center",backgroundColor:"transparent",borderLeftWidth:0,borderRightWidth:0,borderTopWidth:0,borderBottomWidth:0,color:a.calendarHeaderForeground,cursor:"pointer",display:"flex",outline:"none",":focus":{boxShadow:e?"0 0 0 3px ".concat(a.accent):"none"}})});Zt.displayName="StyledMonthYearSelectButton";Zt.displayName="StyledMonthYearSelectButton";var Gt=X("span",function(t){var r=t.$theme.direction==="rtl"?"marginRight":"marginLeft";return xe({alignItems:"center",display:"flex"},r,t.$theme.sizing.scale500)});Gt.displayName="StyledMonthYearSelectIconContainer";Gt.displayName="StyledMonthYearSelectIconContainer";function Yr(t){var r=t.$theme,n=t.$disabled,a=t.$isFocusVisible;return{boxSizing:"border-box",display:"flex",color:n?r.colors.calendarHeaderForegroundDisabled:r.colors.calendarHeaderForeground,cursor:n?"default":"pointer",backgroundColor:"transparent",borderLeftWidth:0,borderRightWidth:0,borderTopWidth:0,borderBottomWidth:0,paddingTop:"0",paddingBottom:"0",paddingLeft:"0",paddingRight:"0",marginBottom:0,marginTop:0,outline:"none",":focus":n?{}:{boxShadow:a?"0 0 0 3px ".concat(r.colors.accent):"none"}}}var Jt=X("button",Yr);Jt.displayName="StyledPrevButton";Jt.displayName="StyledPrevButton";var er=X("button",Yr);er.displayName="StyledNextButton";er.displayName="StyledNextButton";var tr=X("div",function(t){return{display:"inline-block"}});tr.displayName="StyledMonth";tr.displayName="StyledMonth";var rr=X("div",function(t){var r=t.$theme.sizing;return{whiteSpace:"nowrap",display:"flex",marginBottom:r.scale0}});rr.displayName="StyledWeek";rr.displayName="StyledWeek";function K(t,r){var n,a=t.substr(0,12)+"1"+t.substr(13),e=t.substr(0,13)+"1"+t.substr(14);return n={},xe(n,t,r),xe(n,a,r),xe(n,e,r),n}function it(t,r){var n=r.colors,a={":before":{content:null},":after":{content:null}},e=a,o={color:n.calendarForegroundDisabled,":before":{content:null},":after":{content:null}},i={color:n.calendarForegroundDisabled,":before":{borderTopStyle:"none",borderBottomStyle:"none",borderLeftStyle:"none",borderRightStyle:"none",backgroundColor:"transparent"},":after":{borderTopLeftRadius:"0%",borderTopRightRadius:"0%",borderBottomLeftRadius:"0%",borderBottomRightRadius:"0%",borderTopColor:"transparent",borderBottomColor:"transparent",borderRightColor:"transparent",borderLeftColor:"transparent"}},l={":before":{content:null}},u=1;t&&t[u]==="1"&&(e=o);var c=Object.assign({},K("001000000000000",{color:n.calendarDayForegroundPseudoSelected}),K("000100000000000",{color:n.calendarDayForegroundSelected}),K("001100000000000",{color:n.calendarDayForegroundSelectedHighlighted}),{"010000000000000":{color:n.calendarForegroundDisabled,":after":{content:null}}},{"011000000000000":{color:n.calendarForegroundDisabled,":after":{content:null}}},K("000000000000001",i),K("101000000000000",l),K("101010000000000",l),K("100100000000000",{color:n.calendarDayForegroundSelected}),K("101100000000000",{color:n.calendarDayForegroundSelectedHighlighted,":before":{content:null}}),K("100111100000000",{color:n.calendarDayForegroundSelected,":before":{content:null}}),K("101111100000000",{color:n.calendarDayForegroundSelectedHighlighted,":before":{content:null}}),K("100111000000000",{color:n.calendarDayForegroundSelected}),K("100110100000000",{color:n.calendarDayForegroundSelected,":before":{left:null,right:"50%"}}),K("100100001010000",{color:n.calendarDayForegroundSelected}),K("100100001001000",{color:n.calendarDayForegroundSelected,":before":{left:null,right:"50%"}}),K("101000001010000",{":before":{left:null,right:"50%"}}),{"101000001001000":{}},{"101000001001100":{}},{"101000001001010":{}},K("100010010000000",{color:n.calendarDayForegroundPseudoSelected,":before":{left:"0",width:"100%"},":after":{content:null}}),{"101000001100000":{color:n.calendarDayForegroundPseudoSelected,":before":{left:"0",width:"100%"},":after":{content:null}}},K("100000001100000",{color:n.calendarDayForegroundPseudoSelected,":before":{left:"0",width:"100%"},":after":{content:null}}),K("101111000000000",{color:n.calendarDayForegroundSelectedHighlighted}),K("101110100000000",{color:n.calendarDayForegroundSelectedHighlighted,":before":{left:null,right:"50%"}}),K("101010010000000",{color:n.calendarDayForegroundPseudoSelectedHighlighted,":before":{left:"0",width:"100%"}}),K("100000000000001",i),K("100000001010001",i),K("100000001001001",i),K("100010000000001",i));return c[t]||e}var nr=X("div",function(t){var r=t.$disabled,n=t.$isFocusVisible,a=t.$isHighlighted,e=t.$peekNextMonth,o=t.$pseudoSelected,i=t.$range,l=t.$selected,u=t.$outsideMonth,c=t.$outsideMonthWithinRange,y=t.$hasDateLabel,p=t.$density,h=t.$hasLockedBehavior,v=t.$selectedInput,g=t.$value,O=t.$theme,D=O.colors,_=O.typography,$=O.sizing,k=da(t),w;y?p===oe.high?w="60px":w="70px":p===oe.high?w="40px":w="48px";var B=Array.isArray(g)?g:[g,null],H=fa(B,2),T=H[0],E=H[1],P=v===$e.startDate?E!==null&&typeof E<"u":T!==null&&typeof T<"u",L=i&&!(h&&!P);return ne(ne(ne({},p===oe.high?_.ParagraphSmall:_.ParagraphMedium),{},{boxSizing:"border-box",position:"relative",cursor:r||!e&&u?"default":"pointer",color:D.calendarForeground,display:"inline-block",width:p===oe.high?"42px":"50px",height:w,lineHeight:p===oe.high?$.scale700:$.scale900,textAlign:"center",paddingTop:$.scale300,paddingBottom:$.scale300,paddingLeft:$.scale300,paddingRight:$.scale300,marginTop:0,marginBottom:0,marginLeft:0,marginRight:0,outline:"none",backgroundColor:"transparent",transform:"scale(1)"},it(k,t.$theme)),{},{":after":ne(ne({zIndex:-1,content:'""',boxSizing:"border-box",display:"inline-block",boxShadow:n&&(!u||e)?"0 0 0 3px ".concat(D.accent):"none",backgroundColor:l?D.calendarDayBackgroundSelectedHighlighted:o&&a?D.calendarDayBackgroundPseudoSelectedHighlighted:D.calendarBackground,height:y?"100%":p===oe.high?"42px":"50px",width:"100%",position:"absolute",top:y?0:"-1px",left:0,paddingTop:$.scale200,paddingBottom:$.scale200,borderLeftWidth:"2px",borderRightWidth:"2px",borderTopWidth:"2px",borderBottomWidth:"2px",borderLeftStyle:"solid",borderRightStyle:"solid",borderTopStyle:"solid",borderBottomStyle:"solid",borderTopColor:D.borderSelected,borderBottomColor:D.borderSelected,borderRightColor:D.borderSelected,borderLeftColor:D.borderSelected,borderTopLeftRadius:y?$.scale800:"100%",borderTopRightRadius:y?$.scale800:"100%",borderBottomLeftRadius:y?$.scale800:"100%",borderBottomRightRadius:y?$.scale800:"100%"},it(k,t.$theme)[":after"]||{}),c?{content:null}:{})},L?{":before":ne(ne({zIndex:-1,content:'""',boxSizing:"border-box",display:"inline-block",backgroundColor:D.mono300,position:"absolute",height:"100%",width:"50%",top:0,left:"50%",borderTopWidth:"2px",borderBottomWidth:"2px",borderLeftWidth:"0",borderRightWidth:"0",borderTopStyle:"solid",borderBottomStyle:"solid",borderLeftStyle:"solid",borderRightStyle:"solid",borderTopColor:"transparent",borderBottomColor:"transparent",borderLeftColor:"transparent",borderRightColor:"transparent"},it(k,t.$theme)[":before"]||{}),c?{backgroundColor:D.mono300,left:"0",width:"100%",content:'""'}:{})}:{})});nr.displayName="StyledDay";nr.displayName="StyledDay";var ar=X("div",function(t){var r=t.$theme,n=r.typography,a=r.colors,e=t.$selected;return ne(ne({},n.ParagraphXSmall),{},{color:e?a.contentInverseTertiary:a.contentTertiary})});ar.displayName="StyledDayLabel";ar.displayName="StyledDayLabel";var or=X("div",function(t){var r=t.$theme,n=r.typography,a=r.colors,e=r.sizing,o=t.$density;return ne(ne({},n.LabelMedium),{},{color:a.contentTertiary,boxSizing:"border-box",position:"relative",cursor:"default",display:"inline-block",width:o===oe.high?"42px":"50px",height:o===oe.high?"40px":"48px",textAlign:"center",lineHeight:e.scale900,paddingTop:e.scale300,paddingBottom:e.scale300,paddingLeft:e.scale200,paddingRight:e.scale200,marginTop:0,marginBottom:0,marginLeft:0,marginRight:0,backgroundColor:"transparent"})});or.displayName="StyledWeekdayHeader";or.displayName="StyledWeekdayHeader";function mt(t){"@babel/helpers - typeof";return mt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},mt(t)}function ye(){return ye=Object.assign?Object.assign.bind():function(t){for(var r=1;r<arguments.length;r++){var n=arguments[r];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t},ye.apply(this,arguments)}function be(t,r){return Da(t)||Oa(t,r)||ba(t,r)||ma()}function ma(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
5
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ba(t,r){if(t){if(typeof t=="string")return Dr(t,r);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Dr(t,r)}}function Dr(t,r){(r==null||r>t.length)&&(r=t.length);for(var n=0,a=new Array(r);n<r;n++)a[n]=t[n];return a}function Oa(t,r){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var a=[],e=!0,o=!1,i,l;try{for(n=n.call(t);!(e=(i=n.next()).done)&&(a.push(i.value),!(r&&a.length===r));e=!0);}catch(u){o=!0,l=u}finally{try{!e&&n.return!=null&&n.return()}finally{if(o)throw l}}return a}}function Da(t){if(Array.isArray(t))return t}function Sr(t,r){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);r&&(a=a.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,a)}return n}function Ve(t){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?Sr(Object(n),!0).forEach(function(a){ae(t,a,n[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Sr(Object(n)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(n,a))})}return t}function Sa(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function $a(t,r){for(var n=0;n<r.length;n++){var a=r[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,a.key,a)}}function _a(t,r,n){return r&&$a(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function wa(t,r){if(typeof r!="function"&&r!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),r&&bt(t,r)}function bt(t,r){return bt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,e){return a.__proto__=e,a},bt(t,r)}function ka(t){var r=Ma();return function(){var a=Xe(t),e;if(r){var o=Xe(this).constructor;e=Reflect.construct(a,arguments,o)}else e=a.apply(this,arguments);return Ca(this,e)}}function Ca(t,r){if(r&&(mt(r)==="object"||typeof r=="function"))return r;if(r!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return le(t)}function le(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Ma(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Xe(t){return Xe=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Xe(t)}function ae(t,r,n){return r in t?Object.defineProperty(t,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[r]=n,t}var $r=function(r){return r.$theme,{cursor:"pointer"}},st=2e3,lt=2030,_r=0,wr=11,ut={NEXT:"next",PREVIOUS:"previous"};function kr(t){return t.split("-").map(Number)}var zr=function(t){wa(n,t);var r=ka(n);function n(a){var e;return Sa(this,n),e=r.call(this,a),ae(le(e),"dateHelpers",void 0),ae(le(e),"monthItems",void 0),ae(le(e),"yearItems",void 0),ae(le(e),"state",{isMonthDropdownOpen:!1,isYearDropdownOpen:!1,isFocusVisible:!1}),ae(le(e),"getDateProp",function(){return e.props.date||e.dateHelpers.date()}),ae(le(e),"getYearItems",function(){var o=e.getDateProp(),i=e.props.maxDate,l=e.props.minDate,u=i?e.dateHelpers.getYear(i):lt,c=l?e.dateHelpers.getYear(l):st,y=e.dateHelpers.getMonth(o);e.yearItems=Array.from({length:u-c+1},function(D,_){return c+_}).map(function(D){return{id:D.toString(),label:D.toString()}});var p=i?e.dateHelpers.getMonth(i):wr,h=l?e.dateHelpers.getMonth(l):_r,v=Array.from({length:p+1},function(D,_){return _}),g=Array.from({length:12-h},function(D,_){return _+h});if(y>v[v.length-1]){var O=e.yearItems.length-1;e.yearItems[O]=Ve(Ve({},e.yearItems[O]),{},{disabled:!0})}y<g[0]&&(e.yearItems[0]=Ve(Ve({},e.yearItems[0]),{},{disabled:!0}))}),ae(le(e),"getMonthItems",function(){var o=e.getDateProp(),i=e.dateHelpers.getYear(o),l=e.props.maxDate,u=e.props.minDate,c=l?e.dateHelpers.getYear(l):lt,y=u?e.dateHelpers.getYear(u):st,p=l?e.dateHelpers.getMonth(l):wr,h=Array.from({length:p+1},function($,k){return k}),v=u?e.dateHelpers.getMonth(u):_r,g=Array.from({length:12-v},function($,k){return k+v}),O=h.filter(function($){return g.includes($)}),D=i===c&&i===y?O:i===c?h:i===y?g:null,_=function(k){return e.dateHelpers.getMonthInLocale(k,e.props.locale)};e.monthItems=pa({filterMonthsList:D,formatMonthLabel:_})}),ae(le(e),"increaseMonth",function(){e.props.onMonthChange&&e.props.onMonthChange({date:e.dateHelpers.addMonths(e.getDateProp(),1-e.props.order)})}),ae(le(e),"decreaseMonth",function(){e.props.onMonthChange&&e.props.onMonthChange({date:e.dateHelpers.subMonths(e.getDateProp(),1)})}),ae(le(e),"isMultiMonthHorizontal",function(){var o=e.props,i=o.monthsShown,l=o.orientation;return i?l===Lt.horizontal&&i>1:!1}),ae(le(e),"isHiddenPaginationButton",function(o){var i=e.props,l=i.monthsShown,u=i.order;if(l&&e.isMultiMonthHorizontal())if(o===ut.NEXT){var c=u===l-1;return!c}else{var y=u===0;return!y}return!1}),ae(le(e),"handleFocus",function(o){xr(o)&&e.setState({isFocusVisible:!0})}),ae(le(e),"handleBlur",function(o){e.state.isFocusVisible!==!1&&e.setState({isFocusVisible:!1})}),ae(le(e),"renderPreviousMonthButton",function(o){var i=o.locale,l=o.theme,u=e.getDateProp(),c=e.props,y=c.overrides,p=y===void 0?{}:y,h=c.density,v=e.dateHelpers.monthDisabledBefore(u,e.props),g=!1;v&&(g=!0);var O=e.dateHelpers.subMonths(u,1),D=e.props.minDate?e.dateHelpers.getYear(e.props.minDate):st;e.dateHelpers.getYear(O)<D&&(g=!0);var _=e.isHiddenPaginationButton(ut.PREVIOUS);_&&(g=!0);var $=W(p.PrevButton,Jt),k=be($,2),w=k[0],B=k[1],H=W(p.PrevButtonIcon,l.direction==="rtl"?dr:cr),T=be(H,2),E=T[0],P=T[1],L=e.decreaseMonth;return v&&(L=null),m.createElement(w,ye({"aria-label":i.datepicker.previousMonth,tabIndex:0,onClick:L,disabled:g,$isFocusVisible:e.state.isFocusVisible,type:"button",$disabled:g,$order:e.props.order},B),_?null:m.createElement(E,ye({size:h===oe.high?24:36,overrides:{Svg:{style:$r}}},P)))}),ae(le(e),"renderNextMonthButton",function(o){var i=o.locale,l=o.theme,u=e.getDateProp(),c=e.props,y=c.overrides,p=y===void 0?{}:y,h=c.density,v=e.dateHelpers.monthDisabledAfter(u,e.props),g=!1;v&&(g=!0);var O=e.dateHelpers.addMonths(u,1),D=e.props.maxDate?e.dateHelpers.getYear(e.props.maxDate):lt;e.dateHelpers.getYear(O)>D&&(g=!0);var _=e.isHiddenPaginationButton(ut.NEXT);_&&(g=!0);var $=W(p.NextButton,er),k=be($,2),w=k[0],B=k[1],H=W(p.NextButtonIcon,l.direction==="rtl"?cr:dr),T=be(H,2),E=T[0],P=T[1],L=e.increaseMonth;return v&&(L=null),m.createElement(w,ye({"aria-label":i.datepicker.nextMonth,tabIndex:0,onClick:L,disabled:g,type:"button",$disabled:g,$isFocusVisible:e.state.isFocusVisible,$order:e.props.order},B),_?null:m.createElement(E,ye({size:h===oe.high?24:36,overrides:{Svg:{style:$r}}},P)))}),ae(le(e),"canArrowsOpenDropdown",function(o){return!e.state.isMonthDropdownOpen&&!e.state.isYearDropdownOpen&&(o.key==="ArrowUp"||o.key==="ArrowDown")}),ae(le(e),"renderMonthYearDropdown",function(){var o=e.getDateProp(),i=e.dateHelpers.getMonth(o),l=e.dateHelpers.getYear(o),u=e.props,c=u.locale,y=u.overrides,p=y===void 0?{}:y,h=u.density,v=W(p.MonthYearSelectButton,Zt),g=be(v,2),O=g[0],D=g[1],_=W(p.MonthYearSelectIconContainer,Gt),$=be(_,2),k=$[0],w=$[1],B=W(p.MonthYearSelectPopover,jr),H=be(B,2),T=H[0],E=H[1],P=W(p.MonthYearSelectStatefulMenu,nn),L=be(P,2),I=L[0],A=L[1];A.overrides=Br({List:{style:{height:"auto",maxHeight:"257px"}}},A&&A.overrides);var x=e.monthItems.findIndex(function(J){return J.id===e.dateHelpers.getMonth(o).toString()}),q=e.yearItems.findIndex(function(J){return J.id===e.dateHelpers.getYear(o).toString()}),ve="".concat(e.dateHelpers.getMonthInLocale(e.dateHelpers.getMonth(o),c)),ie="".concat(e.dateHelpers.getYear(o));return e.isMultiMonthHorizontal()?m.createElement("div",null,"".concat(ve," ").concat(ie)):m.createElement(m.Fragment,null,m.createElement(T,ye({placement:"bottom",autoFocus:!0,focusLock:!0,isOpen:e.state.isMonthDropdownOpen,onClick:function(){e.setState(function(ee){return{isMonthDropdownOpen:!ee.isMonthDropdownOpen}})},onClickOutside:function(){return e.setState({isMonthDropdownOpen:!1})},onEsc:function(){return e.setState({isMonthDropdownOpen:!1})},content:function(){return m.createElement(I,ye({initialState:{highlightedIndex:x,isFocused:!0},items:e.monthItems,onItemSelect:function(d){var b=d.item,S=d.event;S.preventDefault();var f=kr(b.id),s=e.dateHelpers.set(o,{year:l,month:f});e.props.onMonthChange&&e.props.onMonthChange({date:s}),e.setState({isMonthDropdownOpen:!1})}},A))}},E),m.createElement(O,ye({"aria-live":"polite",type:"button",$isFocusVisible:e.state.isFocusVisible,$density:h,onKeyUp:function(ee){e.canArrowsOpenDropdown(ee)&&e.setState({isMonthDropdownOpen:!0})},onKeyDown:function(ee){e.canArrowsOpenDropdown(ee)&&ee.preventDefault(),ee.key==="Tab"&&e.setState({isMonthDropdownOpen:!1})}},D),ve,m.createElement(k,w,m.createElement(sr,{title:"",overrides:{Svg:{props:{role:"presentation"}}},size:h===oe.high?16:24})))),m.createElement(T,ye({placement:"bottom",focusLock:!0,isOpen:e.state.isYearDropdownOpen,onClick:function(){e.setState(function(ee){return{isYearDropdownOpen:!ee.isYearDropdownOpen}})},onClickOutside:function(){return e.setState({isYearDropdownOpen:!1})},onEsc:function(){return e.setState({isYearDropdownOpen:!1})},content:function(){return m.createElement(I,ye({initialState:{highlightedIndex:q,isFocused:!0},items:e.yearItems,onItemSelect:function(d){var b=d.item,S=d.event;S.preventDefault();var f=kr(b.id),s=e.dateHelpers.set(o,{year:f,month:i});e.props.onYearChange&&e.props.onYearChange({date:s}),e.setState({isYearDropdownOpen:!1})}},A))}},E),m.createElement(O,ye({"aria-live":"polite",type:"button",$isFocusVisible:e.state.isFocusVisible,$density:h,onKeyUp:function(ee){e.canArrowsOpenDropdown(ee)&&e.setState({isYearDropdownOpen:!0})},onKeyDown:function(ee){e.canArrowsOpenDropdown(ee)&&ee.preventDefault(),ee.key==="Tab"&&e.setState({isYearDropdownOpen:!1})}},D),ie,m.createElement(k,w,m.createElement(sr,{title:"",overrides:{Svg:{props:{role:"presentation"}}},size:h===oe.high?16:24})))))}),e.dateHelpers=new Pe(a.adapter),e.monthItems=[],e.yearItems=[],e}return _a(n,[{key:"componentDidMount",value:function(){this.getYearItems(),this.getMonthItems()}},{key:"componentDidUpdate",value:function(e){var o=this.dateHelpers.getMonth(this.props.date)!==this.dateHelpers.getMonth(e.date),i=this.dateHelpers.getYear(this.props.date)!==this.dateHelpers.getYear(e.date);o&&this.getYearItems(),i&&this.getMonthItems()}},{key:"render",value:function(){var e=this,o=this.props,i=o.overrides,l=i===void 0?{}:i,u=o.density,c=W(l.CalendarHeader,Xt),y=be(c,2),p=y[0],h=y[1],v=W(l.MonthHeader,Qt),g=be(v,2),O=g[0],D=g[1],_=W(l.WeekdayHeader,or),$=be(_,2),k=$[0],w=$[1],B=this.dateHelpers.getStartOfWeek(this.getDateProp(),this.props.locale);return m.createElement(an.Consumer,null,function(H){return m.createElement(Be.Consumer,null,function(T){return m.createElement(m.Fragment,null,m.createElement(p,ye({},h,{$density:e.props.density,onFocus:sn(h,e.handleFocus),onBlur:on(h,e.handleBlur)}),e.renderPreviousMonthButton({locale:T,theme:H}),e.renderMonthYearDropdown(),e.renderNextMonthButton({locale:T,theme:H})),m.createElement(O,ye({role:"presentation"},D),Vr.map(function(E){var P=e.dateHelpers.addDays(B,E);return m.createElement(k,ye({key:E,alt:e.dateHelpers.getWeekdayInLocale(P,e.props.locale)},w,{$density:u}),e.dateHelpers.getWeekdayMinInLocale(P,e.props.locale))})))})})}}]),n}(m.Component);ae(zr,"defaultProps",{adapter:Ie,locale:null,maxDate:null,minDate:null,onYearChange:function(){},overrides:{}});function Ot(t){"@babel/helpers - typeof";return Ot=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Ot(t)}function je(){return je=Object.assign?Object.assign.bind():function(t){for(var r=1;r<arguments.length;r++){var n=arguments[r];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t},je.apply(this,arguments)}function Re(t,r){return Aa(t)||Ha(t,r)||Ia(t,r)||Pa()}function Pa(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
6
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ia(t,r){if(t){if(typeof t=="string")return Cr(t,r);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Cr(t,r)}}function Cr(t,r){(r==null||r>t.length)&&(r=t.length);for(var n=0,a=new Array(r);n<r;n++)a[n]=t[n];return a}function Ha(t,r){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var a=[],e=!0,o=!1,i,l;try{for(n=n.call(t);!(e=(i=n.next()).done)&&(a.push(i.value),!(r&&a.length===r));e=!0);}catch(u){o=!0,l=u}finally{try{!e&&n.return!=null&&n.return()}finally{if(o)throw l}}return a}}function Aa(t){if(Array.isArray(t))return t}function Ea(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function Ra(t,r){for(var n=0;n<r.length;n++){var a=r[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,a.key,a)}}function Ta(t,r,n){return r&&Ra(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function La(t,r){if(typeof r!="function"&&r!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),r&&Dt(t,r)}function Dt(t,r){return Dt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,e){return a.__proto__=e,a},Dt(t,r)}function xa(t){var r=Ba();return function(){var a=Qe(t),e;if(r){var o=Qe(this).constructor;e=Reflect.construct(a,arguments,o)}else e=a.apply(this,arguments);return ja(this,e)}}function ja(t,r){if(r&&(Ot(r)==="object"||typeof r=="function"))return r;if(r!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return ue(t)}function ue(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Ba(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Qe(t){return Qe=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Qe(t)}function ce(t,r,n){return r in t?Object.defineProperty(t,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[r]=n,t}var Ur=function(t){La(n,t);var r=xa(n);function n(a){var e;return Ea(this,n),e=r.call(this,a),ce(ue(e),"dayElm",void 0),ce(ue(e),"state",{isHovered:!1,isFocusVisible:!1}),ce(ue(e),"dateHelpers",void 0),ce(ue(e),"getDateProp",function(){return e.props.date===void 0?e.dateHelpers.date():e.props.date}),ce(ue(e),"getMonthProp",function(){return e.props.month===void 0||e.props.month===null?e.dateHelpers.getMonth(e.getDateProp()):e.props.month}),ce(ue(e),"onSelect",function(o){var i=e.props,l=i.range,u=i.value,c;if(Array.isArray(u)&&l&&e.props.hasLockedBehavior){var y=e.props.value,p=null,h=null;e.props.selectedInput===$e.startDate?(p=o,h=Array.isArray(y)&&y[1]?y[1]:null):e.props.selectedInput===$e.endDate&&(p=Array.isArray(y)&&y[0]?y[0]:null,h=o),c=[p],h&&c.push(h)}else if(Array.isArray(u)&&l&&!e.props.hasLockedBehavior){var v=Re(u,2),g=v[0],O=v[1];!g&&!O||g&&O?c=[o,null]:!g&&O&&e.dateHelpers.isAfter(O,o)?c=[o,O]:!g&&O&&e.dateHelpers.isAfter(o,O)?c=[O,o]:g&&!O&&e.dateHelpers.isAfter(o,g)?c=[g,o]:c=[o,g]}else c=o;e.props.onSelect({date:c})}),ce(ue(e),"onKeyDown",function(o){var i=e.getDateProp(),l=e.props,u=l.highlighted,c=l.disabled;o.key==="Enter"&&u&&!c&&(o.preventDefault(),e.onSelect(i))}),ce(ue(e),"onClick",function(o){var i=e.getDateProp(),l=e.props.disabled;l||(e.props.onClick({event:o,date:i}),e.onSelect(i))}),ce(ue(e),"onFocus",function(o){xr(o)&&e.setState({isFocusVisible:!0}),e.props.onFocus({event:o,date:e.getDateProp()})}),ce(ue(e),"onBlur",function(o){e.state.isFocusVisible!==!1&&e.setState({isFocusVisible:!1}),e.props.onBlur({event:o,date:e.getDateProp()})}),ce(ue(e),"onMouseOver",function(o){e.setState({isHovered:!0}),e.props.onMouseOver({event:o,date:e.getDateProp()})}),ce(ue(e),"onMouseLeave",function(o){e.setState({isHovered:!1}),e.props.onMouseLeave({event:o,date:e.getDateProp()})}),ce(ue(e),"isOutsideMonth",function(){var o=e.getMonthProp();return o!==void 0&&o!==e.dateHelpers.getMonth(e.getDateProp())}),ce(ue(e),"getOrderedDates",function(){var o=e.props,i=o.highlightedDate,l=o.value;if(!l||!Array.isArray(l)||!l[0]||!l[1]&&!i)return[];var u=l[0],c=l.length>1&&l[1]?l[1]:i;if(!u||!c)return[];var y=e.clampToDayStart(u),p=e.clampToDayStart(c);return e.dateHelpers.isAfter(y,p)?[p,y]:[y,p]}),ce(ue(e),"isOutsideOfMonthButWithinRange",function(){var o=e.clampToDayStart(e.getDateProp()),i=e.getOrderedDates();if(i.length<2||e.dateHelpers.isSameDay(i[0],i[1]))return!1;var l=e.dateHelpers.getDate(o);if(l>15){var u=e.clampToDayStart(e.dateHelpers.addDays(e.dateHelpers.getEndOfMonth(o),1));return e.dateHelpers.isOnOrBeforeDay(i[0],e.dateHelpers.getEndOfMonth(o))&&e.dateHelpers.isOnOrAfterDay(i[1],u)}else{var c=e.clampToDayStart(e.dateHelpers.subDays(e.dateHelpers.getStartOfMonth(o),1));return e.dateHelpers.isOnOrAfterDay(i[1],e.dateHelpers.getStartOfMonth(o))&&e.dateHelpers.isOnOrBeforeDay(i[0],c)}}),ce(ue(e),"clampToDayStart",function(o){var i=e.dateHelpers,l=i.setSeconds,u=i.setMinutes,c=i.setHours;return l(u(c(o,0),0),0)}),e.dateHelpers=new Pe(a.adapter),e}return Ta(n,[{key:"componentDidMount",value:function(){this.dayElm&&this.props.focusedCalendar&&(this.props.highlighted||!this.props.highlightedDate&&this.isSelected())&&this.dayElm.focus()}},{key:"componentDidUpdate",value:function(e){this.dayElm&&this.props.focusedCalendar&&(this.props.highlighted||!this.props.highlightedDate&&this.isSelected())&&this.dayElm.focus()}},{key:"isSelected",value:function(){var e=this.getDateProp(),o=this.props.value;return Array.isArray(o)?this.dateHelpers.isSameDay(e,o[0])||this.dateHelpers.isSameDay(e,o[1]):this.dateHelpers.isSameDay(e,o)}},{key:"isPseudoSelected",value:function(){var e=this.getDateProp(),o=this.props.value;if(Array.isArray(o)){var i=Re(o,2),l=i[0],u=i[1];if(!l&&!u)return!1;if(l&&u)return this.dateHelpers.isDayInRange(this.clampToDayStart(e),this.clampToDayStart(l),this.clampToDayStart(u))}}},{key:"isPseudoHighlighted",value:function(){var e=this.getDateProp(),o=this.props,i=o.value,l=o.highlightedDate;if(Array.isArray(i)){var u=Re(i,2),c=u[0],y=u[1];if(!c&&!y)return!1;if(l&&c&&!y)return this.dateHelpers.isAfter(l,c)?this.dateHelpers.isDayInRange(this.clampToDayStart(e),this.clampToDayStart(c),this.clampToDayStart(l)):this.dateHelpers.isDayInRange(this.clampToDayStart(e),this.clampToDayStart(l),this.clampToDayStart(c));if(l&&!c&&y)return this.dateHelpers.isAfter(l,y)?this.dateHelpers.isDayInRange(this.clampToDayStart(e),this.clampToDayStart(y),this.clampToDayStart(l)):this.dateHelpers.isDayInRange(this.clampToDayStart(e),this.clampToDayStart(l),this.clampToDayStart(y))}}},{key:"getSharedProps",value:function(){var e=this.getDateProp(),o=this.props,i=o.value,l=o.highlightedDate,u=o.range,c=o.highlighted,y=o.peekNextMonth,p=c,h=this.isSelected(),v=!!(Array.isArray(i)&&u&&l&&(i[0]&&!i[1]&&!this.dateHelpers.isSameDay(i[0],l)||!i[0]&&i[1]&&!this.dateHelpers.isSameDay(i[1],l))),g=!y&&this.isOutsideMonth(),O=!!(Array.isArray(i)&&u&&g&&!y&&this.isOutsideOfMonthButWithinRange());return{$date:e,$density:this.props.density,$disabled:this.props.disabled,$endDate:Array.isArray(i)&&!!(i[0]&&i[1])&&u&&h&&this.dateHelpers.isSameDay(e,i[1])||!1,$hasDateLabel:!!this.props.dateLabel,$hasRangeHighlighted:v,$hasRangeOnRight:Array.isArray(i)&&v&&l&&(i[0]&&this.dateHelpers.isAfter(l,i[0])||i[1]&&this.dateHelpers.isAfter(l,i[1])),$hasRangeSelected:Array.isArray(i)?!!(i[0]&&i[1]):!1,$highlightedDate:l,$isHighlighted:p,$isHovered:this.state.isHovered,$isFocusVisible:this.state.isFocusVisible,$startOfMonth:this.dateHelpers.isStartOfMonth(e),$endOfMonth:this.dateHelpers.isEndOfMonth(e),$month:this.getMonthProp(),$outsideMonth:g,$outsideMonthWithinRange:O,$peekNextMonth:y,$pseudoHighlighted:u&&!p&&!h?this.isPseudoHighlighted():!1,$pseudoSelected:u&&!h?this.isPseudoSelected():!1,$range:u,$selected:h,$startDate:Array.isArray(i)&&i[0]&&i[1]&&u&&h?this.dateHelpers.isSameDay(e,i[0]):!1,$hasLockedBehavior:this.props.hasLockedBehavior,$selectedInput:this.props.selectedInput,$value:this.props.value}}},{key:"getAriaLabel",value:function(e,o){var i=this.getDateProp();return"".concat(e.$selected?e.$range?e.$endDate?o.datepicker.selectedEndDateLabel:o.datepicker.selectedStartDateLabel:o.datepicker.selectedLabel:e.$disabled?o.datepicker.dateNotAvailableLabel:o.datepicker.chooseLabel," ").concat(this.dateHelpers.format(i,"fullOrdinalWeek",this.props.locale),". ").concat(e.$disabled?"":o.datepicker.dateAvailableLabel)}},{key:"render",value:function(){var e=this,o=this.getDateProp(),i=this.props,l=i.peekNextMonth,u=i.overrides,c=u===void 0?{}:u,y=this.getSharedProps(),p=W(c.Day,nr),h=Re(p,2),v=h[0],g=h[1],O=W(c.DayLabel,ar),D=Re(O,2),_=D[0],$=D[1],k=this.props.dateLabel&&this.props.dateLabel(o);return!l&&y.$outsideMonth?m.createElement(v,je({role:"gridcell"},y,g,{onFocus:this.onFocus,onBlur:this.onBlur})):m.createElement(Be.Consumer,null,function(w){return m.createElement(v,je({"aria-label":e.getAriaLabel(y,w),ref:function(H){e.dayElm=H},role:"gridcell","aria-roledescription":"button",tabIndex:e.props.highlighted||!e.props.highlightedDate&&e.isSelected()?0:-1},y,g,{onFocus:e.onFocus,onBlur:e.onBlur,onClick:e.onClick,onKeyDown:e.onKeyDown,onMouseOver:e.onMouseOver,onMouseLeave:e.onMouseLeave}),m.createElement("div",null,e.dateHelpers.getDate(o)),k?m.createElement(_,je({},y,$),k):null)})}}]),n}(m.Component);ce(Ur,"defaultProps",{disabled:!1,highlighted:!1,range:!1,adapter:Ie,onClick:function(){},onSelect:function(){},onFocus:function(){},onBlur:function(){},onMouseOver:function(){},onMouseLeave:function(){},overrides:{},peekNextMonth:!0,value:null});function St(t){"@babel/helpers - typeof";return St=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},St(t)}function $t(){return $t=Object.assign?Object.assign.bind():function(t){for(var r=1;r<arguments.length;r++){var n=arguments[r];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t},$t.apply(this,arguments)}function Fa(t,r){return Ya(t)||Va(t,r)||Wa(t,r)||Na()}function Na(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
7
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Wa(t,r){if(t){if(typeof t=="string")return Mr(t,r);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Mr(t,r)}}function Mr(t,r){(r==null||r>t.length)&&(r=t.length);for(var n=0,a=new Array(r);n<r;n++)a[n]=t[n];return a}function Va(t,r){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var a=[],e=!0,o=!1,i,l;try{for(n=n.call(t);!(e=(i=n.next()).done)&&(a.push(i.value),!(r&&a.length===r));e=!0);}catch(u){o=!0,l=u}finally{try{!e&&n.return!=null&&n.return()}finally{if(o)throw l}}return a}}function Ya(t){if(Array.isArray(t))return t}function za(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function Ua(t,r){for(var n=0;n<r.length;n++){var a=r[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,a.key,a)}}function qa(t,r,n){return r&&Ua(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function Ka(t,r){if(typeof r!="function"&&r!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),r&&_t(t,r)}function _t(t,r){return _t=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,e){return a.__proto__=e,a},_t(t,r)}function Xa(t){var r=Za();return function(){var a=Ze(t),e;if(r){var o=Ze(this).constructor;e=Reflect.construct(a,arguments,o)}else e=a.apply(this,arguments);return Qa(this,e)}}function Qa(t,r){if(r&&(St(r)==="object"||typeof r=="function"))return r;if(r!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return wt(t)}function wt(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Za(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Ze(t){return Ze=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Ze(t)}function kt(t,r,n){return r in t?Object.defineProperty(t,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[r]=n,t}var qr=function(t){Ka(n,t);var r=Xa(n);function n(a){var e;return za(this,n),e=r.call(this,a),kt(wt(e),"dateHelpers",void 0),kt(wt(e),"renderDays",function(){var o=e.dateHelpers.getStartOfWeek(e.props.date||e.dateHelpers.date(),e.props.locale),i=[];return i.concat(Vr.map(function(l){var u=e.dateHelpers.addDays(o,l);return m.createElement(Ur,{adapter:e.props.adapter,date:u,dateLabel:e.props.dateLabel,density:e.props.density,disabled:e.dateHelpers.isDayDisabled(u,e.props),excludeDates:e.props.excludeDates,filterDate:e.props.filterDate,highlightedDate:e.props.highlightedDate,highlighted:e.dateHelpers.isSameDay(u,e.props.highlightedDate),includeDates:e.props.includeDates,focusedCalendar:e.props.focusedCalendar,range:e.props.range,key:l,locale:e.props.locale,minDate:e.props.minDate,maxDate:e.props.maxDate,month:e.props.month,onSelect:e.props.onChange,onBlur:e.props.onDayBlur,onFocus:e.props.onDayFocus,onClick:e.props.onDayClick,onMouseOver:e.props.onDayMouseOver,onMouseLeave:e.props.onDayMouseLeave,overrides:e.props.overrides,peekNextMonth:e.props.peekNextMonth,value:e.props.value,hasLockedBehavior:e.props.hasLockedBehavior,selectedInput:e.props.selectedInput})}))}),e.dateHelpers=new Pe(a.adapter),e}return qa(n,[{key:"render",value:function(){var e=this.props.overrides,o=e===void 0?{}:e,i=W(o.Week,rr),l=Fa(i,2),u=l[0],c=l[1];return m.createElement(u,$t({role:"row"},c),this.renderDays())}}]),n}(m.Component);kt(qr,"defaultProps",{adapter:Ie,highlightedDate:null,onDayClick:function(){},onDayFocus:function(){},onDayBlur:function(){},onDayMouseOver:function(){},onDayMouseLeave:function(){},onChange:function(){},overrides:{},peekNextMonth:!1});function Ct(t){"@babel/helpers - typeof";return Ct=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Ct(t)}function Ga(t,r){return ro(t)||to(t,r)||eo(t,r)||Ja()}function Ja(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
8
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function eo(t,r){if(t){if(typeof t=="string")return Pr(t,r);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Pr(t,r)}}function Pr(t,r){(r==null||r>t.length)&&(r=t.length);for(var n=0,a=new Array(r);n<r;n++)a[n]=t[n];return a}function to(t,r){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var a=[],e=!0,o=!1,i,l;try{for(n=n.call(t);!(e=(i=n.next()).done)&&(a.push(i.value),!(r&&a.length===r));e=!0);}catch(u){o=!0,l=u}finally{try{!e&&n.return!=null&&n.return()}finally{if(o)throw l}}return a}}function ro(t){if(Array.isArray(t))return t}function no(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function ao(t,r){for(var n=0;n<r.length;n++){var a=r[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,a.key,a)}}function oo(t,r,n){return r&&ao(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function io(t,r){if(typeof r!="function"&&r!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),r&&Mt(t,r)}function Mt(t,r){return Mt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,e){return a.__proto__=e,a},Mt(t,r)}function so(t){var r=uo();return function(){var a=Ge(t),e;if(r){var o=Ge(this).constructor;e=Reflect.construct(a,arguments,o)}else e=a.apply(this,arguments);return lo(this,e)}}function lo(t,r){if(r&&(Ct(r)==="object"||typeof r=="function"))return r;if(r!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Te(t)}function Te(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function uo(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Ge(t){return Ge=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Ge(t)}function Le(t,r,n){return r in t?Object.defineProperty(t,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[r]=n,t}var co={dateLabel:null,density:oe.high,excludeDates:null,filterDate:null,highlightDates:null,includeDates:null,locale:null,maxDate:null,minDate:null,month:null,adapter:Ie,onDayClick:function(){},onDayFocus:function(){},onDayBlur:function(){},onDayMouseOver:function(){},onDayMouseLeave:function(){},overrides:{},peekNextMonth:!1,value:null},po=6,Kr=function(t){io(n,t);var r=so(n);function n(a){var e;return no(this,n),e=r.call(this,a),Le(Te(e),"dateHelpers",void 0),Le(Te(e),"getDateProp",function(){return e.props.date||e.dateHelpers.date()}),Le(Te(e),"isWeekInMonth",function(o){var i=e.getDateProp(),l=e.dateHelpers.addDays(o,6);return e.dateHelpers.isSameMonth(o,i)||e.dateHelpers.isSameMonth(l,i)}),Le(Te(e),"renderWeeks",function(){for(var o=[],i=e.dateHelpers.getStartOfWeek(e.dateHelpers.getStartOfMonth(e.getDateProp()),e.props.locale),l=0,u=!0;u||e.props.fixedHeight&&e.props.peekNextMonth&&l<po;)o.push(m.createElement(qr,{adapter:e.props.adapter,date:i,dateLabel:e.props.dateLabel,density:e.props.density,excludeDates:e.props.excludeDates,filterDate:e.props.filterDate,highlightedDate:e.props.highlightedDate,includeDates:e.props.includeDates,focusedCalendar:e.props.focusedCalendar,range:e.props.range,key:l,locale:e.props.locale,minDate:e.props.minDate,maxDate:e.props.maxDate,month:e.dateHelpers.getMonth(e.getDateProp()),onDayBlur:e.props.onDayBlur,onDayFocus:e.props.onDayFocus,onDayClick:e.props.onDayClick,onDayMouseOver:e.props.onDayMouseOver,onDayMouseLeave:e.props.onDayMouseLeave,onChange:e.props.onChange,overrides:e.props.overrides,peekNextMonth:e.props.peekNextMonth,value:e.props.value,hasLockedBehavior:e.props.hasLockedBehavior,selectedInput:e.props.selectedInput})),l++,i=e.dateHelpers.addWeeks(i,1),u=e.isWeekInMonth(i);return o}),e.dateHelpers=new Pe(a.adapter),e}return oo(n,[{key:"render",value:function(){var e=this.props.overrides,o=e===void 0?{}:e,i=W(o.Month,tr),l=Ga(i,2),u=l[0],c=l[1];return m.createElement(u,c,this.renderWeeks())}}]),n}(m.Component);Le(Kr,"defaultProps",co);function Pt(t){"@babel/helpers - typeof";return Pt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Pt(t)}var fo=["overrides"];function ho(t,r){if(t==null)return{};var n=yo(t,r),a,e;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(e=0;e<o.length;e++)a=o[e],!(r.indexOf(a)>=0)&&Object.prototype.propertyIsEnumerable.call(t,a)&&(n[a]=t[a])}return n}function yo(t,r){if(t==null)return{};var n={},a=Object.keys(t),e,o;for(o=0;o<a.length;o++)e=a[o],!(r.indexOf(e)>=0)&&(n[e]=t[e]);return n}function De(t,r){return mo(t)||go(t,r)||Xr(t,r)||vo()}function vo(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
9
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function go(t,r){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var a=[],e=!0,o=!1,i,l;try{for(n=n.call(t);!(e=(i=n.next()).done)&&(a.push(i.value),!(r&&a.length===r));e=!0);}catch(u){o=!0,l=u}finally{try{!e&&n.return!=null&&n.return()}finally{if(o)throw l}}return a}}function mo(t){if(Array.isArray(t))return t}function ct(t){return Do(t)||Oo(t)||Xr(t)||bo()}function bo(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
10
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Xr(t,r){if(t){if(typeof t=="string")return It(t,r);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return It(t,r)}}function Oo(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function Do(t){if(Array.isArray(t))return It(t)}function It(t,r){(r==null||r>t.length)&&(r=t.length);for(var n=0,a=new Array(r);n<r;n++)a[n]=t[n];return a}function Se(){return Se=Object.assign?Object.assign.bind():function(t){for(var r=1;r<arguments.length;r++){var n=arguments[r];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t},Se.apply(this,arguments)}function So(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function $o(t,r){for(var n=0;n<r.length;n++){var a=r[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,a.key,a)}}function _o(t,r,n){return r&&$o(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function wo(t,r){if(typeof r!="function"&&r!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),r&&Ht(t,r)}function Ht(t,r){return Ht=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,e){return a.__proto__=e,a},Ht(t,r)}function ko(t){var r=Mo();return function(){var a=Je(t),e;if(r){var o=Je(this).constructor;e=Reflect.construct(a,arguments,o)}else e=a.apply(this,arguments);return Co(this,e)}}function Co(t,r){if(r&&(Pt(r)==="object"||typeof r=="function"))return r;if(r!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Z(t)}function Z(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Mo(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Je(t){return Je=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Je(t)}function G(t,r,n){return r in t?Object.defineProperty(t,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[r]=n,t}var Qr=function(t){wo(n,t);var r=ko(n);function n(a){var e;So(this,n),e=r.call(this,a),G(Z(e),"dateHelpers",void 0),G(Z(e),"calendar",void 0),G(Z(e),"getDateInView",function(){var p=e.props,h=p.highlightedDate,v=p.value,g=e.dateHelpers.getEffectiveMinDate(e.props),O=e.dateHelpers.getEffectiveMaxDate(e.props),D=e.dateHelpers.date(),_=e.getSingleDate(v)||h;return _||(g&&e.dateHelpers.isBefore(D,g)?g:O&&e.dateHelpers.isAfter(D,O)?O:D)}),G(Z(e),"handleMonthChange",function(p){e.setHighlightedDate(e.dateHelpers.getStartOfMonth(p)),e.props.onMonthChange&&e.props.onMonthChange({date:p})}),G(Z(e),"handleYearChange",function(p){e.setHighlightedDate(p),e.props.onYearChange&&e.props.onYearChange({date:p})}),G(Z(e),"changeMonth",function(p){var h=p.date;e.setState({date:h},function(){return e.handleMonthChange(e.state.date)})}),G(Z(e),"changeYear",function(p){var h=p.date;e.setState({date:h},function(){return e.handleYearChange(e.state.date)})}),G(Z(e),"renderCalendarHeader",function(){var p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:e.state.date,h=arguments.length>1?arguments[1]:void 0;return m.createElement(zr,Se({},e.props,{key:"month-header-".concat(h),date:p,order:h,onMonthChange:e.changeMonth,onYearChange:e.changeYear}))}),G(Z(e),"onKeyDown",function(p){switch(p.key){case"ArrowUp":case"ArrowDown":case"ArrowLeft":case"ArrowRight":case"Home":case"End":case"PageUp":case"PageDown":e.handleArrowKey(p.key),p.preventDefault(),p.stopPropagation();break}}),G(Z(e),"handleArrowKey",function(p){var h=e.state.highlightedDate,v=h,g=e.dateHelpers.date();switch(p){case"ArrowLeft":v=e.dateHelpers.subDays(v||g,1);break;case"ArrowRight":v=e.dateHelpers.addDays(v||g,1);break;case"ArrowUp":v=e.dateHelpers.subWeeks(v||g,1);break;case"ArrowDown":v=e.dateHelpers.addWeeks(v||g,1);break;case"Home":v=e.dateHelpers.getStartOfWeek(v||g);break;case"End":v=e.dateHelpers.getEndOfWeek(v||g);break;case"PageUp":v=e.dateHelpers.subMonths(v||g,1);break;case"PageDown":v=e.dateHelpers.addMonths(v||g,1);break}e.setState({highlightedDate:v,date:v})}),G(Z(e),"focusCalendar",function(){e.state.focused||e.setState({focused:!0})}),G(Z(e),"blurCalendar",function(){if(typeof document<"u"){var p=document.activeElement;e.calendar&&!e.calendar.contains(p)&&e.setState({focused:!1})}}),G(Z(e),"handleTabbing",function(p){if(typeof document<"u"&&p.keyCode===9){var h=document.activeElement,v=e.state.rootElement?e.state.rootElement.querySelectorAll('[tabindex="0"]'):null,g=v?v.length:0;p.shiftKey?v&&h===v[0]&&(p.preventDefault(),v[g-1].focus()):v&&h===v[g-1]&&(p.preventDefault(),v[0].focus())}}),G(Z(e),"onDayFocus",function(p){var h=p.date;e.setState({highlightedDate:h}),e.focusCalendar(),e.props.onDayFocus&&e.props.onDayFocus(p)}),G(Z(e),"onDayMouseOver",function(p){var h=p.date;e.setState({highlightedDate:h}),e.props.onDayMouseOver&&e.props.onDayMouseOver(p)}),G(Z(e),"onDayMouseLeave",function(p){var h=p.date,v=e.props.value,g=e.getSingleDate(v);e.setState({highlightedDate:g||h}),e.props.onDayMouseLeave&&e.props.onDayMouseLeave(p)}),G(Z(e),"handleDateChange",function(p){var h=e.props.onChange,v=h===void 0?function(k){}:h,g=p.date;if(Array.isArray(p.date)){var O=ct(e.state.time),D=p.date[0]?e.dateHelpers.applyDateToTime(O[0],p.date[0]):null,_=p.date[1]?e.dateHelpers.applyDateToTime(O[1],p.date[1]):null;O[0]=D,_?(g=[D,_],O[1]=_):g=[D],e.setState({time:O})}else if(!Array.isArray(e.props.value)&&p.date){var $=e.dateHelpers.applyDateToTime(e.state.time[0],p.date);g=$,e.setState({time:[$]})}v({date:g})}),G(Z(e),"handleTimeChange",function(p,h){var v=e.props.onChange,g=v===void 0?function($){}:v,O=ct(e.state.time);if(O[h]=e.dateHelpers.applyTimeToDate(O[h],p),e.setState({time:O}),Array.isArray(e.props.value)){var D=e.props.value.map(function($,k){return $&&h===k?e.dateHelpers.applyTimeToDate($,p):$});g({date:[D[0],D[1]]})}else{var _=e.dateHelpers.applyTimeToDate(e.props.value,p);g({date:_})}}),G(Z(e),"renderMonths",function(p){for(var h=e.props,v=h.overrides,g=v===void 0?{}:v,O=h.orientation,D=[],_=W(g.CalendarContainer,Kt),$=De(_,2),k=$[0],w=$[1],B=W(g.MonthContainer,qt),H=De(B,2),T=H[0],E=H[1],P=0;P<(e.props.monthsShown||1);++P){var L=[],I=e.dateHelpers.addMonths(e.state.date,P),A="month-".concat(P);L.push(e.renderCalendarHeader(I,P)),L.push(m.createElement(k,Se({key:A,ref:function(q){e.calendar=q},role:"grid","aria-roledescription":p.ariaRoleDescCalMonth,"aria-multiselectable":e.props.range||null,onKeyDown:e.onKeyDown},w,{$density:e.props.density}),m.createElement(Kr,{adapter:e.props.adapter,date:I,dateLabel:e.props.dateLabel,density:e.props.density,excludeDates:e.props.excludeDates,filterDate:e.props.filterDate,highlightedDate:e.state.highlightedDate,includeDates:e.props.includeDates,focusedCalendar:e.state.focused,range:e.props.range,locale:e.props.locale,maxDate:e.props.maxDate,minDate:e.props.minDate,month:e.dateHelpers.getMonth(e.state.date),onDayBlur:e.blurCalendar,onDayFocus:e.onDayFocus,onDayClick:e.props.onDayClick,onDayMouseOver:e.onDayMouseOver,onDayMouseLeave:e.onDayMouseLeave,onChange:e.handleDateChange,overrides:g,value:e.props.value,peekNextMonth:e.props.peekNextMonth,fixedHeight:e.props.fixedHeight,hasLockedBehavior:!!e.props.hasLockedBehavior,selectedInput:e.props.selectedInput}))),D.push(m.createElement("div",{key:"month-component-".concat(P)},L))}return m.createElement(T,Se({$orientation:O},E),D)}),G(Z(e),"renderTimeSelect",function(p,h,v){var g=e.props.overrides,O=g===void 0?{}:g,D=W(O.TimeSelectContainer,Ke),_=De(D,2),$=_[0],k=_[1],w=W(O.TimeSelectFormControl,gt),B=De(w,2),H=B[0],T=B[1],E=W(O.TimeSelect,bn),P=De(E,2),L=P[0],I=P[1];return m.createElement($,k,m.createElement(H,Se({label:v},T),m.createElement(L,Se({value:p&&e.dateHelpers.date(p),onChange:h,nullable:!0},I))))}),G(Z(e),"renderQuickSelect",function(){var p=e.props.overrides,h=p===void 0?{}:p,v=W(h.QuickSelectContainer,Ke),g=De(v,2),O=g[0],D=g[1],_=W(h.QuickSelectFormControl,gt),$=De(_,2),k=$[0],w=$[1],B=W(h.QuickSelect,ln),H=De(B,2),T=H[0],E=H[1],P=E.overrides,L=ho(E,fo);if(!e.props.quickSelect)return null;var I=e.dateHelpers.set(e.dateHelpers.date(),{hours:12,minutes:0,seconds:0});return m.createElement(Be.Consumer,null,function(A){return m.createElement(O,D,m.createElement(k,Se({label:A.datepicker.quickSelectLabel},w),m.createElement(T,Se({"aria-label":A.datepicker.quickSelectAriaLabel,labelKey:"id",onChange:function(q){q.option?(e.setState({quickSelectId:q.option.id}),e.props.onChange&&(e.props.range?e.props.onChange({date:[q.option.beginDate,q.option.endDate||I]}):e.props.onChange({date:q.option.beginDate}))):(e.setState({quickSelectId:null}),e.props.onChange&&e.props.onChange({date:[]})),e.props.onQuickSelectChange&&e.props.onQuickSelectChange(q.option)},options:e.props.quickSelectOptions||[{id:A.datepicker.pastWeek,beginDate:e.dateHelpers.subWeeks(I,1)},{id:A.datepicker.pastMonth,beginDate:e.dateHelpers.subMonths(I,1)},{id:A.datepicker.pastThreeMonths,beginDate:e.dateHelpers.subMonths(I,3)},{id:A.datepicker.pastSixMonths,beginDate:e.dateHelpers.subMonths(I,6)},{id:A.datepicker.pastYear,beginDate:e.dateHelpers.subYears(I,1)},{id:A.datepicker.pastTwoYears,beginDate:e.dateHelpers.subYears(I,2)}],placeholder:A.datepicker.quickSelectPlaceholder,value:e.state.quickSelectId&&[{id:e.state.quickSelectId}],overrides:Br({Dropdown:{style:{textAlign:"start"}}},P)},L))))})});var o=e.props,i=o.highlightedDate,l=o.value,u=o.adapter;e.dateHelpers=new Pe(u);var c=e.getDateInView(),y=[];return Array.isArray(l)?y=ct(l):l&&(y=[l]),e.state={highlightedDate:e.getSingleDate(l)||(i&&e.dateHelpers.isSameMonth(c,i)?i:e.dateHelpers.date()),focused:!1,date:c,quickSelectId:null,rootElement:null,time:y},e}return _o(n,[{key:"componentDidMount",value:function(){this.props.autoFocusCalendar&&this.focusCalendar()}},{key:"componentDidUpdate",value:function(e){if(this.props.highlightedDate&&!this.dateHelpers.isSameDay(this.props.highlightedDate,e.highlightedDate)&&this.setState({date:this.props.highlightedDate}),this.props.autoFocusCalendar&&this.props.autoFocusCalendar!==e.autoFocusCalendar&&this.focusCalendar(),e.value!==this.props.value){var o=this.getDateInView();this.isInView(o)||this.setState({date:o})}}},{key:"isInView",value:function(e){var o=this.state.date,i=this.dateHelpers.getYear(e)-this.dateHelpers.getYear(o),l=i*12+this.dateHelpers.getMonth(e)-this.dateHelpers.getMonth(o);return l>=0&&l<(this.props.monthsShown||1)}},{key:"getSingleDate",value:function(e){return Array.isArray(e)?e[0]||null:e}},{key:"setHighlightedDate",value:function(e){var o=this.props.value,i=this.getSingleDate(o),l;i&&this.dateHelpers.isSameMonth(i,e)&&this.dateHelpers.isSameYear(i,e)?l={highlightedDate:i}:l={highlightedDate:e},this.setState(l)}},{key:"render",value:function(){var e=this,o=this.props.overrides,i=o===void 0?{}:o,l=W(i.Root,Ut),u=De(l,2),c=u[0],y=u[1],p=[].concat(this.props.value),h=De(p,2),v=h[0],g=h[1];return m.createElement(Be.Consumer,null,function(O){return m.createElement(c,Se({$density:e.props.density,"data-baseweb":"calendar",role:"application","aria-roledescription":"datepicker",ref:function(_){_&&_ instanceof HTMLElement&&!e.state.rootElement&&e.setState({rootElement:_})},"aria-label":O.datepicker.ariaLabelCalendar,onKeyDown:e.props.trapTabbing?e.handleTabbing:null},y),e.renderMonths({ariaRoleDescCalMonth:O.datepicker.ariaRoleDescriptionCalendarMonth}),e.props.timeSelectStart&&e.renderTimeSelect(v,function(D){return e.handleTimeChange(D,0)},O.datepicker.timeSelectStartLabel),e.props.timeSelectEnd&&e.props.range&&e.renderTimeSelect(g,function(D){return e.handleTimeChange(D,1)},O.datepicker.timeSelectEndLabel),e.renderQuickSelect())})}}]),n}(m.Component);G(Qr,"defaultProps",{autoFocusCalendar:!1,dateLabel:null,density:oe.default,excludeDates:null,filterDate:null,highlightedDate:null,includeDates:null,range:!1,locale:null,maxDate:null,minDate:null,onDayClick:function(){},onDayFocus:function(){},onDayMouseOver:function(){},onDayMouseLeave:function(){},onMonthChange:function(){},onYearChange:function(){},onChange:function(){},orientation:Lt.horizontal,overrides:{},peekNextMonth:!1,adapter:Ie,value:null,trapTabbing:!1});function pt(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.replace(/\${(.*?)}/g,function(n,a){return r[a]===void 0?"${"+a+"}":r[a]})}function At(t){"@babel/helpers - typeof";return At=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},At(t)}function Ce(){return Ce=Object.assign?Object.assign.bind():function(t){for(var r=1;r<arguments.length;r++){var n=arguments[r];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t},Ce.apply(this,arguments)}function Ir(t,r){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);r&&(a=a.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,a)}return n}function Hr(t){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?Ir(Object(n),!0).forEach(function(a){pe(t,a,n[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Ir(Object(n)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(n,a))})}return t}function dt(t){return Ho(t)||Io(t)||Zr(t)||Po()}function Po(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
11
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Io(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function Ho(t){if(Array.isArray(t))return Rt(t)}function Ao(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function Eo(t,r){for(var n=0;n<r.length;n++){var a=r[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,a.key,a)}}function Ro(t,r,n){return r&&Eo(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function To(t,r){if(typeof r!="function"&&r!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),r&&Et(t,r)}function Et(t,r){return Et=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,e){return a.__proto__=e,a},Et(t,r)}function Lo(t){var r=jo();return function(){var a=et(t),e;if(r){var o=et(this).constructor;e=Reflect.construct(a,arguments,o)}else e=a.apply(this,arguments);return xo(this,e)}}function xo(t,r){if(r&&(At(r)==="object"||typeof r=="function"))return r;if(r!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return de(t)}function de(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function jo(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function et(t){return et=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},et(t)}function pe(t,r,n){return r in t?Object.defineProperty(t,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[r]=n,t}function Oe(t,r){return No(t)||Fo(t,r)||Zr(t,r)||Bo()}function Bo(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
12
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Zr(t,r){if(t){if(typeof t=="string")return Rt(t,r);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Rt(t,r)}}function Rt(t,r){(r==null||r>t.length)&&(r=t.length);for(var n=0,a=new Array(r);n<r;n++)a[n]=t[n];return a}function Fo(t,r){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var a=[],e=!0,o=!1,i,l;try{for(n=n.call(t);!(e=(i=n.next()).done)&&(a.push(i.value),!(r&&a.length===r));e=!0);}catch(u){o=!0,l=u}finally{try{!e&&n.return!=null&&n.return()}finally{if(o)throw l}}return a}}function No(t){if(Array.isArray(t))return t}var Ye="yyyy/MM/dd",ge="–",Wo=function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",a=arguments.length>2?arguments[2]:void 0,e=r,o=n.split(" ".concat(ge," ")),i=Oe(o,2),l=i[0],u=l===void 0?"":l,c=i[1],y=c===void 0?"":c;return a===$e.startDate&&y&&(e="".concat(e," ").concat(ge," ").concat(y)),a===$e.endDate&&(e="".concat(u," ").concat(ge," ").concat(e)),e},Gr=function(t){To(n,t);var r=Lo(n);function n(a){var e;return Ao(this,n),e=r.call(this,a),pe(de(e),"calendar",void 0),pe(de(e),"dateHelpers",void 0),pe(de(e),"handleChange",function(o){var i=e.props.onChange,l=e.props.onRangeChange;Array.isArray(o)?(i&&o.every(Boolean)&&i({date:o}),l&&l({date:dt(o)})):(i&&i({date:o}),l&&l({date:o}))}),pe(de(e),"onCalendarSelect",function(o){var i=!1,l=!1,u=!1,c=o.date;if(Array.isArray(c)&&e.props.range){if(!c[0]||!c[1])i=!0,l=!0,u=null;else if(c[0]&&c[1]){var y=c,p=Oe(y,2),h=p[0],v=p[1];e.dateHelpers.isAfter(h,v)?e.hasLockedBehavior()?(c=e.props.value,i=!0):c=[h,h]:e.dateHelpers.dateRangeIncludesDates(c,e.props.excludeDates)&&(c=e.props.value,i=!0),e.state.lastActiveElm&&e.state.lastActiveElm.focus()}}else e.state.lastActiveElm&&e.state.lastActiveElm.focus();var g=function(_,$){if(!_||!$)return!1;var k=e.dateHelpers.format(_,"keyboardDate"),w=e.dateHelpers.format($,"keyboardDate");return k===w?e.dateHelpers.getHours(_)!==e.dateHelpers.getHours($)||e.dateHelpers.getMinutes(_)!==e.dateHelpers.getMinutes($):!1},O=e.props.value;Array.isArray(c)&&Array.isArray(O)?c.some(function(D,_){return g(O[_],D)})&&(i=!0):!Array.isArray(c)&&!Array.isArray(O)&&g(O,c)&&(i=!0),e.setState(Hr(Hr({isOpen:i,isPseudoFocused:l},u===null?{}:{calendarFocused:u}),{},{inputValue:e.formatDisplayValue(c)})),e.handleChange(c)}),pe(de(e),"formatDisplayValue",function(o){var i=e.props,l=i.displayValueAtRangeIndex,u=i.formatDisplayValue;i.range;var c=e.normalizeDashes(e.props.formatString);if(typeof l=="number"&&o&&Array.isArray(o)){var y=o[l];return u?u(y,c):e.formatDate(y,c)}return u?u(o,c):e.formatDate(o,c)}),pe(de(e),"open",function(o){e.setState({isOpen:!0,isPseudoFocused:!0,calendarFocused:!1,selectedInput:o},e.props.onOpen)}),pe(de(e),"close",function(){var o=!1;e.setState({isOpen:!1,selectedInput:null,isPseudoFocused:o,calendarFocused:!1},e.props.onClose)}),pe(de(e),"handleEsc",function(){e.state.lastActiveElm&&e.state.lastActiveElm.focus(),e.close()}),pe(de(e),"handleInputBlur",function(){e.state.isPseudoFocused||e.close()}),pe(de(e),"getMask",function(){var o=e.props,i=o.formatString,l=o.mask,u=o.range,c=o.separateRangeInputs;return l===null||l===void 0&&i!==Ye?null:l?e.normalizeDashes(l):u&&!c?"9999/99/99 ".concat(ge," 9999/99/99"):"9999/99/99"}),pe(de(e),"handleInputChange",function(o,i){var l=e.props.range&&e.props.separateRangeInputs?Wo(o.currentTarget.value,e.state.inputValue,i):o.currentTarget.value,u=e.getMask(),c=e.normalizeDashes(e.props.formatString);(typeof u=="string"&&l===u.replace(/9/g," ")||l.length===0)&&(e.props.range?e.handleChange([]):e.handleChange(null)),e.setState({inputValue:l});var y=function(q){return c===Ye?e.dateHelpers.parse(q,"slashDate",e.props.locale):e.dateHelpers.parseString(q,c,e.props.locale)};if(e.props.range&&typeof e.props.displayValueAtRangeIndex!="number"){var p=e.normalizeDashes(l).split(" ".concat(ge," ")),h=Oe(p,2),v=h[0],g=h[1],O=e.dateHelpers.date(v),D=e.dateHelpers.date(g);c&&(O=y(v),D=y(g));var _=e.dateHelpers.isValid(O)&&e.dateHelpers.isValid(D),$=e.dateHelpers.isAfter(D,O)||e.dateHelpers.isEqual(O,D);_&&$&&e.handleChange([O,D])}else{var k=e.normalizeDashes(l),w=e.dateHelpers.date(k),B=e.props.formatString;k.replace(/(\s)*/g,"").length<B.replace(/(\s)*/g,"").length?w=null:w=y(k);var H=e.props,T=H.displayValueAtRangeIndex,E=H.range,P=H.value;if(w&&e.dateHelpers.isValid(w))if(E&&Array.isArray(P)&&typeof T=="number"){var L=Oe(P,2),I=L[0],A=L[1];T===0?(I=w,A?e.dateHelpers.isAfter(A,I)||e.dateHelpers.isEqual(I,A)?e.handleChange([I,A]):e.handleChange(dt(P)):e.handleChange([I])):T===1&&(A=w,I?e.dateHelpers.isAfter(A,I)||e.dateHelpers.isEqual(I,A)?e.handleChange([I,A]):e.handleChange(dt(P)):e.handleChange([A,A]))}else e.handleChange(w)}}),pe(de(e),"handleKeyDown",function(o){!e.state.isOpen&&o.keyCode===40?e.open():e.state.isOpen&&o.key==="ArrowDown"?(o.preventDefault(),e.focusCalendar()):e.state.isOpen&&o.keyCode===9&&e.close()}),pe(de(e),"focusCalendar",function(){if(typeof document<"u"){var o=document.activeElement;e.setState({calendarFocused:!0,lastActiveElm:o})}}),pe(de(e),"normalizeDashes",function(o){return o.replace(/-/g,ge).replace(/—/g,ge)}),pe(de(e),"hasLockedBehavior",function(){return e.props.rangedCalendarBehavior===Qn.locked&&e.props.range&&e.props.separateRangeInputs}),e.dateHelpers=new Pe(a.adapter),e.state={calendarFocused:!1,isOpen:!1,selectedInput:null,isPseudoFocused:!1,lastActiveElm:null,inputValue:e.formatDisplayValue(a.value)||""},e}return Ro(n,[{key:"getNullDatePlaceholder",value:function(e){return(this.getMask()||e).split(ge)[0].replace(/[0-9]|[a-z]/g," ")}},{key:"formatDate",value:function(e,o){var i=this,l=function(p){return o===Ye?i.dateHelpers.format(p,"slashDate",i.props.locale):i.dateHelpers.formatDate(p,o,i.props.locale)};if(e){if(Array.isArray(e)&&!e[0]&&!e[1])return"";if(Array.isArray(e)&&!e[0]&&e[1]){var u=l(e[1]),c=this.getNullDatePlaceholder(o);return[c,u].join(" ".concat(ge," "))}else return Array.isArray(e)?e.map(function(y){return y?l(y):""}).join(" ".concat(ge," ")):l(e)}else return""}},{key:"componentDidUpdate",value:function(e){e.value!==this.props.value&&this.setState({inputValue:this.formatDisplayValue(this.props.value)})}},{key:"renderInputComponent",value:function(e,o){var i=this,l=this.props.overrides,u=l===void 0?{}:l,c=W(u.Input,Wr),y=Oe(c,2),p=y[0],h=y[1],v=this.props.placeholder||this.props.placeholder===""?this.props.placeholder:this.props.range&&!this.props.separateRangeInputs?"YYYY/MM/DD ".concat(ge," YYYY/MM/DD"):"YYYY/MM/DD",g=(this.state.inputValue||"").split(" ".concat(ge," ")),O=Oe(g,2),D=O[0],_=D===void 0?"":D,$=O[1],k=$===void 0?"":$,w=o===$e.startDate?_:o===$e.endDate?k:this.state.inputValue;return m.createElement(p,Ce({"aria-disabled":this.props.disabled,"aria-label":this.props["aria-label"]||(this.props.range?e.datepicker.ariaLabelRange:e.datepicker.ariaLabel),error:this.props.error,positive:this.props.positive,"aria-describedby":this.props["aria-describedby"],"aria-labelledby":this.props["aria-labelledby"],"aria-required":this.props.required||null,disabled:this.props.disabled,size:this.props.size,value:w,onFocus:function(){return i.open(o)},onBlur:this.handleInputBlur,onKeyDown:this.handleKeyDown,onChange:function(H){return i.handleInputChange(H,o)},placeholder:v,mask:this.getMask(),required:this.props.required,clearable:this.props.clearable},h))}},{key:"render",value:function(){var e=this,o=this.props,i=o.overrides,l=i===void 0?{}:i,u=o.startDateLabel,c=u===void 0?"Start Date":u,y=o.endDateLabel,p=y===void 0?"End Date":y,h=W(l.Popover,jr),v=Oe(h,2),g=v[0],O=v[1],D=W(l.InputWrapper,Wt),_=Oe(D,2),$=_[0],k=_[1],w=W(l.StartDate,Yt),B=Oe(w,2),H=B[0],T=B[1],E=W(l.EndDate,zt),P=Oe(E,2),L=P[0],I=P[1],A=W(l.InputLabel,Vt),x=Oe(A,2),q=x[0],ve=x[1];return m.createElement(Be.Consumer,null,function(ie){return m.createElement(m.Fragment,null,m.createElement(g,Ce({accessibilityType:un.none,focusLock:!1,autoFocus:!1,mountNode:e.props.mountNode,placement:Fr.bottom,isOpen:e.state.isOpen,onClickOutside:e.close,onEsc:e.handleEsc,content:m.createElement(Qr,Ce({adapter:e.props.adapter,autoFocusCalendar:e.state.calendarFocused,trapTabbing:!0,value:e.props.value},e.props,{onChange:e.onCalendarSelect,selectedInput:e.state.selectedInput,hasLockedBehavior:e.hasLockedBehavior()}))},O),m.createElement($,Ce({},k,{$separateRangeInputs:e.props.range&&e.props.separateRangeInputs}),e.props.range&&e.props.separateRangeInputs?m.createElement(m.Fragment,null,m.createElement(H,T,m.createElement(q,ve,c),e.renderInputComponent(ie,$e.startDate)),m.createElement(L,I,m.createElement(q,ve,p),e.renderInputComponent(ie,$e.endDate))):m.createElement(m.Fragment,null,e.renderInputComponent(ie)))),m.createElement("p",{id:e.props["aria-describedby"],style:{position:"fixed",width:"0px",height:"0px",borderLeftWidth:0,borderRightWidth:0,borderTopWidth:0,borderBottomWidth:0,padding:0,overflow:"hidden",clip:"rect(0, 0, 0, 0)",clipPath:"inset(100%)"}},ie.datepicker.screenReaderMessageInput),m.createElement("p",{"aria-live":"assertive",style:{position:"fixed",width:"0px",height:"0px",borderLeftWidth:0,borderRightWidth:0,borderTopWidth:0,borderBottomWidth:0,padding:0,overflow:"hidden",clip:"rect(0, 0, 0, 0)",clipPath:"inset(100%)"}},!e.props.value||Array.isArray(e.props.value)&&!e.props.value[0]&&!e.props.value[1]?"":Array.isArray(e.props.value)?e.props.value[0]&&e.props.value[1]?pt(ie.datepicker.selectedDateRange,{startDate:e.formatDisplayValue(e.props.value[0]),endDate:e.formatDisplayValue(e.props.value[1])}):"".concat(pt(ie.datepicker.selectedDate,{date:e.formatDisplayValue(e.props.value[0])})," ").concat(ie.datepicker.selectSecondDatePrompt):pt(ie.datepicker.selectedDate,{date:e.state.inputValue||""})))})}}]),n}(m.Component);pe(Gr,"defaultProps",{"aria-describedby":"datepicker--screenreader--message--input",value:null,formatString:Ye,adapter:Ie});const Ar=t=>{var r;return((r=t==null?void 0:t.getWeekInfo)==null?void 0:r.call(t))??(t==null?void 0:t.weekInfo)??null},Vo=t=>{const r=m.useMemo(()=>{try{return Ar(new Intl.Locale(t))}catch{return Ar(new Intl.Locale("en-US"))}},[t]);if(!r)return rt;const n=r.firstDay===7?0:r.firstDay;return{...rt,options:{...rt.options,weekStartsOn:n}}},ir="YYYY/MM/DD";function tt(t){return t.map(r=>new Date(r))}function Yo(t){return t?t.map(r=>Tt(r).format(ir)):[]}function zo({disabled:t,element:r,widgetMgr:n,fragmentId:a}){var T;const e=lr(),[o,i]=mn({getStateFromWidgetMgr:Uo,getDefaultStateFromProto:qo,getCurrStateFromProto:Ko,updateWidgetMgrState:Xo,element:r,widgetMgr:n,fragmentId:a}),[l,u]=m.useState(!1),{colors:c,fontSizes:y,lineHeights:p,spacing:h,sizes:v}=lr(),{locale:g}=m.useContext(cn),O=Vo(g),D=Tt(r.min,ir).toDate(),_=Qo(r),$=r.default.length===0&&!t,k=m.useMemo(()=>r.format.replaceAll(/[a-zA-Z]/g,"9"),[r.format]),w=m.useMemo(()=>r.format.replaceAll("Y","y").replaceAll("D","d"),[r.format]),B=m.useCallback(({date:E})=>{if(pn(E)){i({value:[],fromUi:!0}),u(!0);return}const P=[];Array.isArray(E)?E.forEach(L=>{L&&P.push(L)}):P.push(E),i({value:P,fromUi:!0}),u(!P)},[i]),H=m.useCallback(()=>{if(!l)return;const E=tt(r.default);i({value:E,fromUi:!0}),u(!E)},[l,r,i]);return dn("div",{className:"stDateInput","data-testid":"stDateInput",children:[We(gn,{label:r.label,disabled:t,labelVisibility:fn((T=r.labelVisibility)==null?void 0:T.value),children:r.help&&We(hn,{children:We(yn,{content:r.help,placement:vn.TOP_RIGHT})})}),We(Gr,{locale:O,density:oe.high,formatString:w,mask:r.isRange?`${k} – ${k}`:k,placeholder:r.isRange?`${r.format} – ${r.format}`:r.format,disabled:t,onChange:B,onClose:H,overrides:{Popover:{props:{placement:Fr.bottomLeft,overrides:{Body:{style:{marginTop:e.spacing.px}}}}},CalendarContainer:{style:{fontSize:y.sm,paddingRight:h.sm,paddingLeft:h.sm,paddingBottom:h.sm,paddingTop:h.sm}},Week:{style:{fontSize:y.sm}},Day:{style:({$pseudoHighlighted:E,$pseudoSelected:P,$selected:L,$isHovered:I})=>({fontSize:y.sm,lineHeight:p.base,"::before":{backgroundColor:L||P||E||I?`${c.secondaryBg} !important`:c.transparent},"::after":{borderColor:c.transparent}})},PrevButton:{style:()=>({display:"flex",alignItems:"center",justifyContent:"center",":active":{backgroundColor:c.transparent},":focus":{backgroundColor:c.transparent,outline:0}})},NextButton:{style:{display:"flex",alignItems:"center",justifyContent:"center",":active":{backgroundColor:c.transparent},":focus":{backgroundColor:c.transparent,outline:0}}},Input:{props:{maskChar:null,overrides:{Root:{style:{borderLeftWidth:v.borderWidth,borderRightWidth:v.borderWidth,borderTopWidth:v.borderWidth,borderBottomWidth:v.borderWidth,paddingRight:h.twoXS}},ClearIcon:{props:{overrides:{Svg:{style:{color:c.darkGray,padding:h.threeXS,height:v.clearIconSize,width:v.clearIconSize,":hover":{fill:c.bodyText}}}}}},Input:{style:{paddingRight:h.sm,paddingLeft:h.sm,paddingBottom:h.sm,paddingTop:h.sm,lineHeight:p.inputWidget},props:{"data-testid":"stDateInputField"}}}}}},value:o,minDate:D,maxDate:_,range:r.isRange,clearable:$})]})}function Uo(t,r){const n=t.getStringArrayValue(r),a=n!==void 0?n:r.default||[];return tt(a)}function qo(t){return tt(t.default)??[]}function Ko(t){return tt(t.value)??[]}function Xo(t,r,n,a){r.setStringArrayValue(t,Yo(n.value),{fromUi:n.fromUi},a)}function Qo(t){const r=t.max;return r&&r.length>0?Tt(r,ir).toDate():void 0}const oi=m.memo(zo);export{oi as default};
@@ -1 +0,0 @@
1
- import{r as g,E as C,_ as b,n as d,G as $,B as p,j as n,bp as m,bq as F,b4 as O,b5 as S,cp as q,cq as G,aZ as _,F as K,bi as j,R as Y,aA as Z,bk as J,L as h,bm as Q,bl as ee,bs as te,bF as ie,bt as se,ba as le,bu as ae}from"./index.KPwXWqBk.js";import{a as I}from"./index.DW_MHI2K.js";import{F as ne}from"./FormClearHelper.BlCIuWCo.js";import{g as w,F as f,a as oe,D as re,I as de,C as ce,s as pe}from"./FileHelper.Bii_mi1A.js";import{S as ge,P as ue}from"./ProgressBar.CtXtbXhv.js";import{u as he}from"./Hooks.DURid8_V.js";import{U as y}from"./UploadFileInfo.C-jY39rj.js";var M=g.forwardRef(function(e,s){var t={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return g.createElement(C,b({iconAttrs:t,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:s}),g.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),g.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"}))});M.displayName="CloudUpload";var B=g.forwardRef(function(e,s){var t={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return g.createElement(C,b({iconAttrs:t,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:s}),g.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"}))});B.displayName="Error";const V=d("section",{target:"e17y52ym0"})(({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})),D=d("div",{target:"e17y52ym1"})({marginRight:"auto",alignItems:"center",display:"flex"}),P=d("span",{target:"e17y52ym2"})(({theme:e})=>({color:e.colors.darkenedBgMix100,marginRight:e.spacing.lg})),me=d("span",{target:"e17y52ym3"})(({theme:e})=>({marginBottom:e.spacing.twoXS})),fe=d("div",{target:"e17y52ym4"})({display:"flex",flexDirection:"column"}),L=d("div",{target:"e17y52ym5"})(({theme:e})=>({left:0,right:0,lineHeight:e.lineHeights.tight,paddingTop:e.spacing.md,paddingLeft:e.spacing.lg,paddingRight:e.spacing.lg})),ye=d("ul",{target:"e17y52ym6"})(({theme:e})=>({listStyleType:"none",margin:e.spacing.none,padding:e.spacing.none})),E=d("li",{target:"e17y52ym7"})(({theme:e})=>({margin:e.spacing.none,padding:e.spacing.none})),A=d("div",{target:"e17y52ym8"})(({theme:e})=>({display:"flex",alignItems:"baseline",flex:1,paddingLeft:e.spacing.lg,overflow:"hidden"})),W=d("div",{target:"e17y52ym9"})(({theme:e})=>({marginRight:e.spacing.sm,marginBottom:e.spacing.twoXS,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"})),k=d("div",{target:"e17y52ym10"})(({theme:e})=>({display:"flex",alignItems:"center",marginBottom:e.spacing.twoXS})),Fe=d("span",{target:"e17y52ym11"})(({theme:e})=>({marginRight:e.spacing.twoXS})),Se=d("div",{target:"e17y52ym12"})(({theme:e})=>({display:"flex",padding:e.spacing.twoXS,color:e.colors.darkenedBgMix100})),N=d("small",{target:"e17y52ym13"})(({theme:e})=>({color:e.colors.danger,fontSize:e.fontSizes.sm,height:e.fontSizes.sm,lineHeight:e.fontSizes.sm,display:"flex",alignItems:"center",whiteSpace:"nowrap"})),R=d("span",{target:"e17y52ym14"})({}),Ue=e=>({[V]:{display:"flex",flexDirection:"column",alignItems:"flex-start"},[D]:{marginBottom:e.spacing.lg},[P]:{display:"none"},[L]:{paddingRight:e.spacing.lg},[k]:{maxWidth:"inherit",flex:1,alignItems:"flex-start",marginBottom:e.spacing.sm},[W]:{width:e.sizes.full},[A]:{flexDirection:"column"},[N]:{height:"auto",whiteSpace:"initial"},[R]:{display:"none"},[E]:{margin:e.spacing.none,padding:e.spacing.none}}),we=d("div",{target:"e17y52ym15"})(({theme:e,width:s})=>{if(s<$("23rem"))return Ue(e)});var v;(function(e){e.DANGER="danger"})(v||(v={}));const x=d("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}}),xe=({multiple:e,acceptedExtensions:s,maxSizeBytes:t})=>p(D,{"data-testid":"stFileUploaderDropzoneInstructions",children:[n(P,{children:n(m,{content:M,size:"threeXL"})}),p(fe,{children:[p(me,{children:["Drag and drop file",e?"s":""," here"]}),p(x,{children:[`Limit ${w(t,f.Byte,0)} per file`,s.length?` • ${s.map(i=>i.replace(/^\./,"").toUpperCase()).join(", ")}`:null]})]})]}),Ie=({onDrop:e,multiple:s,acceptedExtensions:t,maxSizeBytes:i,disabled:l,label:o})=>n(re,{onDrop:e,multiple:s,accept:oe(t),maxSize:i,disabled:l,useFsAccessApi:!1,children:({getRootProps:a,getInputProps:r})=>p(V,{...a(),"data-testid":"stFileUploaderDropzone",isDisabled:l,"aria-label":o,children:[n("input",{"data-testid":"stFileUploaderDropzoneInput",...r()}),n(xe,{multiple:s,acceptedExtensions:t,maxSizeBytes:i}),n(F,{kind:S.SECONDARY,disabled:l,size:O.SMALL,children:"Browse files"})]})}),ve=d("div",{target:"egc9vxm0"})(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"space-between",paddingBottom:e.spacing.twoXS,marginBottom:e.spacing.twoXS})),ze=d("div",{target:"egc9vxm1"})(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"center",color:e.colors.fadedText40})),Ce=({currentPage:e,totalPages:s,onNext:t,onPrevious:i})=>p(ve,{"data-testid":"stFileUploaderPagination",children:[n(x,{children:`Showing page ${e} of ${s}`}),p(ze,{children:[n(F,{onClick:i,kind:S.MINIMAL,children:n(m,{content:q,size:"xl"})}),n(F,{onClick:t,kind:S.MINIMAL,children:n(m,{content:G,size:"xl"})})]})]}),z=(e,s)=>Math.ceil(e.length/s),be=e=>_(({pageSize:t,items:i,resetOnAdd:l,...o})=>{const[a,r]=g.useState(0),[c,U]=g.useState(z(i,t)),u=he(i);g.useEffect(()=>{u&&u.length!==i.length&&U(z(i,t)),u&&u.length<i.length?l&&r(0):a+1>=c&&r(c-1)},[i,a,t,u,l,c]);const T=()=>{r(Math.min(a+1,c-1))},H=()=>{r(Math.max(0,a-1))},X=i.slice(a*t,a*t+t);return p(K,{children:[n(e,{items:X,...o}),i.length>t?n(Ce,{pageSize:t,totalPages:c,currentPage:a+1,onNext:T,onPrevious:H}):null]})},e),Me=({fileInfo:e})=>e.status.type==="uploading"?n(ue,{value:e.status.progress,size:ge.SMALL}):e.status.type==="error"?p(N,{children:[n(Fe,{"data-testid":"stFileUploaderFileErrorMessage",children:e.status.errorMessage}),n(R,{children:n(m,{content:B,size:"lg"})})]}):e.status.type==="uploaded"?n(x,{children:w(e.size,f.Byte)}):null,Be=({fileInfo:e,onDelete:s})=>p(k,{className:"stFileUploaderFile","data-testid":"stFileUploaderFile",children:[n(Se,{children:n(m,{content:de,size:"twoXL"})}),p(A,{className:"stFileUploaderFileData",children:[n(W,{className:"stFileUploaderFileName","data-testid":"stFileUploaderFileName",title:e.name,children:e.name}),n(Me,{fileInfo:e})]}),n("div",{"data-testid":"stFileUploaderDeleteBtn",children:n(F,{onClick:()=>s(e.id),kind:S.MINIMAL,children:n(m,{content:ce,size:"lg"})})})]}),Ve=({items:e,onDelete:s})=>n(ye,{children:e.map(t=>n(E,{children:n(Be,{fileInfo:t,onDelete:s})},t.id))}),De=be(Ve),Pe=e=>n(L,{children:n(De,{...e})});class Le extends Y.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,a=l.getFileUploaderStateValue(i);Z(t,a)||l.setFileUploaderStateValue(i,t,{fromUi:!0},o)},this.reset=()=>{this.setState({files:[]})},this.dropHandler=(t,i)=>{const{element:l}=this.props,{multipleFiles:o}=l;if(!o&&t.length===0&&i.length>1){const a=i.findIndex(r=>r.errors.length===1&&r.errors[0].code==="too-many-files");a>=0&&(t.push(i[a].file),i.splice(a,1))}if(this.props.uploadClient.fetchFileURLs(t).then(a=>{if(!o&&t.length>0){const r=this.state.files.find(c=>c.status.type!=="error");r&&(this.forceUpdatingStatus=!0,this.deleteFile(r.id),this.forceUpdatingStatus=!1)}J(a,t).forEach(([r,c])=>{this.uploadFile(r,c)})}).catch(a=>{this.addFiles(t.map(r=>new y(r.name,r.size,this.nextLocalFileId(),{type:"error",errorMessage:a})))}),i.length>0){const a=i.map(r=>{const{file:c}=r;return new y(c.name,c.size,this.nextLocalFileId(),{type:"error",errorMessage:this.getErrorMessage(r.errors[0].code,r.file)})});this.addFiles(a)}},this.uploadFile=(t,i)=>{const l=I.CancelToken.source(),o=new y(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,a=>this.onUploadProgress(a,o.id),l.token).then(()=>this.onUploadComplete(o.id,t)).catch(a=>{I.isCancel(a)||this.updateFile(o.id,o.setStatus({type:"error",errorMessage:a?a.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.getErrorMessage=(t,i)=>{switch(t){case"file-too-large":return`File must be ${w(this.maxUploadSizeInBytes,f.Byte)} or smaller.`;case"file-invalid-type":return`${i.type} files are not allowed.`;case"file-too-small":return"File size is too small.";case"too-many-files":return"Only one file is allowed.";default:return"Unexpected error. Please try again."}},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=>{this.setState(i=>({files:[...i.files,t]}))},this.addFiles=t=>{this.setState(i=>({files:[...i.files,...t]}))},this.removeFile=t=>{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)=>{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=()=>{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:[],newestServerFileId:0},{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(a=>{const r=a.name,c=a.size,U=a.fileId,u=a.fileUrls;return new y(r,c,this.nextLocalFileId(),{type:"uploaded",fileId:U,fileUrls:u})})}}componentWillUnmount(){this.formClearHelper.disconnect()}get maxUploadSizeInBytes(){const s=this.props.element.maxUploadSizeMb;return pe(s,f.Megabyte,f.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:a,fileUrls:r}=o;return new Q({fileId:a,fileUrls:r,name:i,size:l})});return new ee({uploadedFileInfo:s})}render(){var c;const{files:s}=this.state,{element:t,disabled:i,widgetMgr:l,width:o}=this.props,a=t.type;this.formClearHelper.manageFormClearListener(l,t.formId,this.onFormCleared);const r=s.slice().reverse();return p(we,{className:"stFileUploader","data-testid":"stFileUploader",width:o,children:[n(ae,{label:t.label,disabled:i,labelVisibility:te((c=t.labelVisibility)==null?void 0:c.value),children:t.help&&n(ie,{children:n(se,{content:t.help,placement:le.TOP_RIGHT})})}),n(Ie,{onDrop:this.dropHandler,multiple:t.multipleFiles,acceptedExtensions:a,maxSizeBytes:this.maxUploadSizeInBytes,label:t.label,disabled:i}),r.length>0&&n(Pe,{items:r,pageSize:3,onDelete:this.deleteFile,resetOnAdd:!0})]})}nextLocalFileId(){return this.localFileIdCounter++}}const He=j(g.memo(Le));export{He as default};