@stlite/desktop 0.87.0 → 0.88.0

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 (72) hide show
  1. package/build/assets/{ErrorOutline.esm-C8z2dN3x.js → ErrorOutline.esm-D5Ifiwqa.js} +1 -1
  2. package/build/assets/{FileDownload.esm-kSzyJagP.js → FileDownload.esm-DOHSKnrq.js} +1 -1
  3. package/build/assets/{FileHelper-BbrZYz8x.js → FileHelper-BTXiVf4-.js} +1 -1
  4. package/build/assets/{FormClearHelper-fvwQICEk.js → FormClearHelper-BC4K9Zmh.js} +1 -1
  5. package/build/assets/{Hooks-CCS44jMc.js → Hooks-GYU3aDYH.js} +1 -1
  6. package/build/assets/{InputInstructions-BgxdtQsQ.js → InputInstructions-CqSmotDL.js} +1 -1
  7. package/build/assets/{Particles-C6lCS8Mc.js → Particles-DKyXwmGK.js} +1 -1
  8. package/build/assets/{ProgressBar-CXipOcU9.js → ProgressBar-B7cXo5Zk.js} +1 -1
  9. package/build/assets/{Toolbar-DiWCQxr5.js → Toolbar-CF99-ktZ.js} +1 -1
  10. package/build/assets/{base-input-D2OIsCyG.js → base-input-Bu7lYJya.js} +1 -1
  11. package/build/assets/{checkbox-BNaalk8J.js → checkbox-vy_88iMk.js} +1 -1
  12. package/build/assets/{createSuper-CQM18OGw.js → createSuper-BZDCsfCp.js} +1 -1
  13. package/build/assets/{data-grid-overlay-editor-CK8RiHSC.js → data-grid-overlay-editor-P0wPqvRS.js} +1 -1
  14. package/build/assets/{downloader-CE817MUq.js → downloader-E6SH6tis.js} +1 -1
  15. package/build/assets/{es6-D9GNxEuI.js → es6-lWl2HAKQ.js} +2 -2
  16. package/build/assets/{iframeResizer.contentWindow-CNYkPhE6.js → iframeResizer.contentWindow-BblXhc8K.js} +1 -1
  17. package/build/assets/{index-cAlcGRT2.js → index-3q7VEUlu.js} +1 -1
  18. package/build/assets/{index-B-7mLFMQ.js → index-9Wb22-Zl.js} +1 -1
  19. package/build/assets/{index-DCNLpqIv.js → index-B2QqSXxG.js} +4 -4
  20. package/build/assets/{index-C1VFEx3W.js → index-BAt37HPV.js} +1 -1
  21. package/build/assets/{index-DFlTnZFo.js → index-BHD6dN1i.js} +1 -1
  22. package/build/assets/{index-CDtHDDVr.js → index-BHYA8KUU.js} +1 -1
  23. package/build/assets/{index-B5zkrGKq.js → index-Ba8Fd3Iw.js} +1 -1
  24. package/build/assets/{index-CjHv4qYi.js → index-Bl3t7YE9.js} +1 -1
  25. package/build/assets/{index-BGbl-ncy.js → index-C0rU7wjo.js} +1 -1
  26. package/build/assets/{index-mlKr_pQQ.js → index-C8408c32.js} +1 -1
  27. package/build/assets/{index--SdlqSfi.js → index-C9dv_cRO.js} +1 -1
  28. package/build/assets/{index-CnRs0MgX.js → index-CBgaSeZa.js} +1 -1
  29. package/build/assets/{index-BI9UgvCi.js → index-CESihKoP.js} +1 -1
  30. package/build/assets/{index-X9E9p-kg.js → index-CHcwRuRz.js} +1 -1
  31. package/build/assets/{index-C6fUDD3N.js → index-CO2uSAB4.js} +1 -1
  32. package/build/assets/{index-DFWekVRf.js → index-COVY3it_.js} +1 -1
  33. package/build/assets/{index-DDiZtaVk.js → index-C_XWYeXZ.js} +1 -1
  34. package/build/assets/{index-Wzix0Ssr.js → index-CcNoZyGq.js} +1 -1
  35. package/build/assets/{index-7qt3HHfl.js → index-CeooaFxj.js} +1 -1
  36. package/build/assets/{index-B3wu97uA.js → index-Ck8oqwxV.js} +1 -1
  37. package/build/assets/{index-CGMUJ4kd.js → index-D1lT9gPf.js} +1 -1
  38. package/build/assets/{index-DhqQeff3.js → index-D7qhlvAL.js} +5 -5
  39. package/build/assets/{index-DqnX_TF4.js → index-DDHABoz7.js} +1 -1
  40. package/build/assets/{index-DhxOxSgZ.js → index-DKJBdNcR.js} +1 -1
  41. package/build/assets/{index-CT5_r023.js → index-DLKkPsKG.js} +1 -1
  42. package/build/assets/{index-CI7_FxNG.js → index-DPhgZ6z8.js} +1 -1
  43. package/build/assets/{index---v6J_Xe.js → index-DodBZ077.js} +1 -1
  44. package/build/assets/{index-DXGgezsh.js → index-E1lgIpin.js} +1 -1
  45. package/build/assets/{index-D0YDqQsn.js → index-IjmnJRcJ.js} +1 -1
  46. package/build/assets/{index-Vs85zs5K.js → index-J69gSkQ7.js} +1 -1
  47. package/build/assets/{index-Bnvb95fQ.js → index-LjAoKxoo.js} +1 -1
  48. package/build/assets/{index-Dc2c4xJB.js → index-NFS9SZBh.js} +1 -1
  49. package/build/assets/{index-XLeMBlQJ.js → index-UG5gS873.js} +1 -1
  50. package/build/assets/{index-CxsEqDQL.js → index-oUxYecyl.js} +1 -1
  51. package/build/assets/{index-BDOZpIxN.js → index-rGN93mnX.js} +1 -1
  52. package/build/assets/{index-CKEBU2Tu.js → index-sNwZkMcg.js} +1 -1
  53. package/build/assets/{index-DyVqVg90.js → index-tGudOCY7.js} +1 -1
  54. package/build/assets/{inherits-BWX75f6B.js → inherits-CxdXuG_P.js} +1 -1
  55. package/build/assets/{input-DTfsWA-x.js → input-CK3Z1ctS.js} +1 -1
  56. package/build/assets/{memory-DS2CpVMo.js → memory-F_WtxrTu.js} +1 -1
  57. package/build/assets/{mergeWith-fWFIuGgc.js → mergeWith-DB-_2-Rw.js} +1 -1
  58. package/build/assets/{number-overlay-editor-DDQgeQYn.js → number-overlay-editor-B9-dA9Oc.js} +1 -1
  59. package/build/assets/{sandbox-VD4WfD0W.js → sandbox-OL9X-HVr.js} +1 -1
  60. package/build/assets/{slicedToArray-CgI3PJi3.js → slicedToArray-Dcf1iVtV.js} +1 -1
  61. package/build/assets/{timepicker-qd0SiRjC.js → timepicker-CNx-qwHe.js} +1 -1
  62. package/build/assets/{uniqueId-Dgo2nsPZ.js → uniqueId-B67KB2Sb.js} +1 -1
  63. package/build/assets/{useBasicWidgetState-9vtYd9vP.js → useBasicWidgetState-DVIC6bdr.js} +1 -1
  64. package/build/assets/{useTextInputAutoExpand-BFx1z0yW.js → useTextInputAutoExpand-D9ObUIEt.js} +1 -1
  65. package/build/assets/{useUpdateUiValue-BF7Ryinr.js → useUpdateUiValue-BpA660Wd.js} +1 -1
  66. package/build/assets/{withFullScreenWrapper-C3PKUCi4.js → withFullScreenWrapper-CQbXKdaQ.js} +1 -1
  67. package/build/assets/worker-Cet_Vg8m.js +105 -0
  68. package/build/electron/worker.js +9 -9
  69. package/build/index.html +1 -1
  70. package/package.json +5 -5
  71. package/wheels/streamlit-1.48.0-cp312-none-any.whl +0 -0
  72. package/build/assets/worker-B7Gzidb7.js +0 -105
@@ -1 +1 @@
1
- import{r as l,E as K,_ as O,c as p,j as o,c1 as ne,bJ as Y,bX as G,bF as J,bY as F,ci as y,ap as U,c2 as le,bx as de,bW as ce,bT as pe,cg as Q,b8 as ge,bm as ue,bQ as he,cj as me,F as H,bV as fe,bU as xe}from"./index-DCNLpqIv.js";import{g as be,C as ve,I as ye,F as M,E as je,a as Ie,s as we,u as Ce,b as ze}from"./FileHelper-BbrZYz8x.js";import{I as Fe}from"./InputInstructions-BgxdtQsQ.js";import{u as Ee,T as Te}from"./useTextInputAutoExpand-BFx1z0yW.js";import{i as Re}from"./inputUtils-CptNuJwn.js";import{E as Le}from"./ErrorOutline.esm-C8z2dN3x.js";import{U as _}from"./UploadFileInfo-C-jY39rj.js";import"./base-input-D2OIsCyG.js";var q=l.forwardRef(function(e,t){var a={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return l.createElement(K,O({iconAttrs:a,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),l.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),l.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"}))});q.displayName="AttachFile";var Z=l.forwardRef(function(e,t){var a={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return l.createElement(K,O({iconAttrs:a,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),l.createElement("rect",{width:24,height:24,fill:"none"}),l.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"}))});Z.displayName="Send";const Se=p("div",{target:"e3id6jz12"})(({theme:e,height:t})=>({backgroundColor:e.colors.transparent,position:"absolute",left:0,bottom:0,minHeight:`max(${e.sizes.emptyDropdownHeight}, ${t})`,width:"100%",zIndex:e.zIndices.priority}),""),Ue=p("div",{target:"e3id6jz11"})(({theme:e,height:t})=>({border:`${e.sizes.borderWidth} solid`,borderColor:e.colors.primary,borderRadius:e.radii.chatInput,backgroundColor:e.colors.secondaryBg,color:e.colors.primary,display:"flex",alignItems:"center",justifyContent:"center",height:t,width:"100%",fontWeight:e.fontWeights.bold}),""),He=p("div",{target:"e3id6jz10"})(({theme:e,disabled:t})=>({display:"flex",alignItems:"top",height:"100%",marginTop:`-${e.sizes.borderWidth}`,cursor:t?"not-allowed":"auto"}),""),Me=p("div",{target:"e3id6jz9"})(({disabled:e})=>({pointerEvents:e?"none":"auto"}),""),ke=p("div",{target:"e3id6jz8"})(({theme:e})=>({marginTop:"0.625em",marginLeft:e.spacing.sm,height:e.spacing.xl,width:e.sizes.borderWidth,backgroundColor:e.colors.fadedText20}),""),Be=p("div",{target:"e3id6jz7"})(({theme:e})=>({left:0,right:0,lineHeight:e.lineHeights.tight,paddingLeft:e.spacing.sm,paddingRight:e.spacing.sm,overflowX:"auto"}),""),Pe=p("div",{target:"e3id6jz6"})({name:"zjik7",styles:"display:flex"}),We=p("div",{target:"e3id6jz5"})({name:"ou8xsw",styles:"flex:0 0 auto"}),Ne=p("div",{target:"e3id6jz4"})(({theme:e})=>({display:"flex",alignItems:"center",padding:e.spacing.sm,gap:e.spacing.twoXS}),""),De=p("div",{target:"e3id6jz3"})(({theme:e})=>({color:e.colors.fadedText60}),""),$e=p("div",{target:"e3id6jz2"})(({theme:e,fileStatus:t})=>({overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:t.type==="uploaded"?e.colors.bodyText:e.colors.fadedText60}),""),Ve=p("div",{target:"e3id6jz1"})(({theme:e})=>({marginRight:e.spacing.md,color:e.colors.fadedText60}),""),Ae=p("small",{target:"e3id6jz0"})(({theme:e})=>({display:"flex",alignItems:"center",maxHeight:e.sizes.smallElementHeight,color:e.colors.fadedText60,"& :hover":{color:e.colors.bodyText}}),""),Xe=({getRootProps:e,getInputProps:t,acceptFile:a,disabled:d,theme:m})=>o.jsxs(He,{disabled:d,children:[o.jsxs(Me,{"data-testid":"stChatInputFileUploadButton",disabled:d,...e(),children:[o.jsx("input",{...t()}),o.jsx(ne,{content:`Upload or drag and drop ${a===y.Multiple?"files":"a file"}`,placement:Y.TOP,onMouseEnterDelay:500,children:o.jsx(G,{kind:J.MINIMAL,disabled:d,children:o.jsx(F,{content:q,size:"lg",color:d?m.colors.fadedText40:m.colors.fadedText60})})})]}),o.jsx(ke,{})]}),Ke=l.memo(Xe),Oe=({getRootProps:e,getInputProps:t,acceptFile:a,inputHeight:d})=>o.jsxs(o.Fragment,{children:[o.jsx(Se,{height:d,...e(),children:o.jsx("input",{...t()})}),o.jsx(Ue,{height:d,children:`Drag and drop ${a===y.Multiple?"files":"a file"} here`})]}),Ye=l.memo(Oe);function Ge({children:e,content:t}){const a=U();return o.jsx(le,{content:t,placement:Y.TOP,overrides:{Body:{style:{top:`-${a.sizes.minElementHeight}`}}},children:e})}const Je=({fileInfo:e})=>{const t=U(),{type:a}=e.status;switch(a){case"uploading":return o.jsx(ce,{"data-testid":"stChatInputFileIconSpinner",size:"lg",margin:"0",padding:"0"});case"error":return o.jsx(Ge,{content:e.status.errorMessage,children:o.jsx(F,{color:t.colors.red,content:Le,size:"lg"})});case"uploaded":return o.jsx(F,{content:ye,size:"lg"});default:return de(a),null}},Qe=({fileInfo:e,onDelete:t})=>o.jsxs(Ne,{className:"stChatInputFile","data-testid":"stChatInputFile",children:[o.jsx(De,{children:o.jsx(Je,{fileInfo:e})}),o.jsx($e,{className:"stChatInputFileName","data-testid":"stChatInputFileName",title:e.name,fileStatus:e.status,children:e.name}),o.jsx(Ve,{children:be(e.size,M.Byte)}),o.jsx(Ae,{"data-testid":"stChatInputDeleteBtn",children:o.jsx(G,{onClick:()=>t(e.id),kind:J.MINIMAL,children:o.jsx(F,{content:ve,size:"lg"})})})]}),_e=l.memo(Qe),qe=({items:e,onDelete:t})=>o.jsx(Be,{"data-testid":"stChatUploadedFiles",children:o.jsx(Pe,{children:e.map(a=>o.jsx(We,{children:o.jsx(_e,{fileInfo:a,onDelete:t})},a.id))})}),Ze=l.memo(qe),et=({acceptMultipleFiles:e,maxFileSize:t,uploadClient:a,uploadFile:d,addFiles:m,getNextLocalFileId:c,deleteExistingFiles:b,onUploadComplete:x})=>(f,u)=>{if(!e&&f.length===0&&u.length>1){const g=u.findIndex(h=>h.errors?.[0].code===je.TooManyFiles);g>=0&&(f.push(u[g].file),u.splice(g,1))}if(!e&&f.length>0&&b(),a.fetchFileURLs(f).then(g=>{pe(g,f).forEach(([h,E])=>{d(h,E)})}).catch(g=>{m(f.map(h=>new _(h.name,h.size,c(),{type:"error",errorMessage:g})))}),u.length>0){const g=u.map(h=>Ie(h,c(),t));m(g)}x()},tt=({getNextLocalFileId:e,addFiles:t,updateFile:a,uploadClient:d,element:m,onUploadProgress:c,onUploadComplete:b})=>(x,f)=>{const u=Q.CancelToken.source(),g=new _(f.name,f.size,e(),{type:"uploading",cancelToken:u,progress:1});t([g]),d.uploadFile({formId:"",...m},x.uploadUrl,f,h=>c(h,g.id),u.token).then(()=>b(g.id,x)).catch(h=>{Q.isCancel(h)||a(g.id,g.setStatus({type:"error",errorMessage:h?h.toString():"Unknown error"}))})},ot=p("div",{target:"e1d2x3se4"})({name:"1nibcdy",styles:"border:none;position:relative;display:flex"}),it=p("div",{target:"e1d2x3se3"})(({theme:e,extended:t})=>({border:`${e.sizes.borderWidth} solid`,borderColor:e.colors.widgetBorderColor??e.colors.transparent,borderRadius:e.radii.chatInput,backgroundColor:e.colors.secondaryBg,position:"relative",flexGrow:1,display:"flex",alignItems:"center",paddingLeft:e.spacing.lg,maxHeight:t?"none":e.sizes.minElementHeight,gap:e.spacing.sm,overflow:"hidden",":focus-within":{borderColor:e.colors.primary}}),""),st=p("button",{target:"e1d2x3se2"})(({theme:e,disabled:t,extended:a})=>{const d=ge(e),[m,c]=d?[e.colors.gray60,e.colors.gray80]:[e.colors.gray80,e.colors.gray40];return{border:"none",backgroundColor:e.colors.transparent,borderTopRightRadius:a?"0":e.radii.chatInput,borderTopLeftRadius:a?e.radii.default:"0",borderBottomRightRadius:e.radii.chatInput,display:"inline-flex",alignItems:"center",justifyContent:"center",lineHeight:e.lineHeights.none,margin:e.spacing.none,padding:e.spacing.sm,color:t?m:c,pointerEvents:"auto","&:focus":{outline:"none"},":focus":{outline:"none"},"&:focus-visible":{backgroundColor:d?e.colors.gray10:e.colors.gray90},"&:hover":{color:e.colors.primary},"&:disabled, &:disabled:hover, &:disabled:active":{backgroundColor:e.colors.transparent,borderColor:e.colors.transparent,color:e.colors.gray,cursor:"not-allowed"}}},""),at=p("div",{target:"e1d2x3se1"})(({theme:e})=>({display:"flex",alignItems:"flex-end",height:"100%",position:"absolute",right:0,marginBottom:`-${e.sizes.borderWidth}`,pointerEvents:"none"}),""),rt=p("div",{target:"e1d2x3se0"})(({theme:e})=>({position:"absolute",bottom:"0px",right:`calc(${e.iconSizes.xl} + 2 * ${e.spacing.sm} + ${e.spacing.sm})`}),""),k=(e,t,a)=>a.map(d=>d.id===e?t:d),B=(e,t)=>t.find(a=>a.id===e);function nt({disabled:e,element:t,widgetMgr:a,fragmentId:d,uploadClient:m}){const c=U(),{placeholder:b,maxChars:x}=t,f=l.useRef(0),u=l.useRef(null),[g,h]=ue(),{innerWidth:E,innerHeight:P}=he(),[C,R]=l.useState(t.default),[j,I]=l.useState([]),[z,L]=l.useState(!1),w=Ee({textareaRef:u,dependencies:[b]}),S=l.useMemo(()=>j.some(i=>i.status.type==="uploading")?!1:C!==""||j.length>0,[j,C]),v=me(t.acceptFile),W=we(t.maxUploadSizeMb,M.Megabyte,M.Byte),N=l.useCallback(i=>I(r=>[...r,...i]),[]),D=l.useCallback(i=>{I(r=>{const n=B(i,r);return H(n)?r:(n.status.type==="uploading"&&n.status.cancelToken.cancel(),n.status.type==="uploaded"&&n.status.fileUrls.deleteUrl&&m.deleteFile(n.status.fileUrls.deleteUrl),r.filter(s=>s.id!==i))})},[m]),ee=()=>{const i=j.filter(r=>r.status.type==="uploaded").map(r=>{const{name:n,size:s,status:T}=r,{fileId:ae,fileUrls:re}=T;return new fe({fileId:ae,fileUrls:re,name:n,size:s})});return new xe({uploadedFileInfo:i})},$=()=>f.current++,te=et({acceptMultipleFiles:v===y.Multiple,maxFileSize:W,uploadClient:m,uploadFile:tt({getNextLocalFileId:$,addFiles:N,updateFile:(i,r)=>{I(n=>k(i,r,n))},uploadClient:m,element:t,onUploadProgress:(i,r)=>{I(n=>{const s=B(r,n);if(H(s)||s.status.type!=="uploading")return n;const T=Math.round(i.loaded*100/i.total);return s.status.progress===T?n:k(r,s.setStatus({type:"uploading",cancelToken:s.status.cancelToken,progress:T}),n)})},onUploadComplete:(i,r)=>{I(n=>{const s=B(i,n);return H(s)||s.status.type!=="uploading"?n:k(s.id,s.setStatus({type:"uploaded",fileId:r.fileId,fileUrls:r}),n)})}}),addFiles:N,getNextLocalFileId:$,deleteExistingFiles:()=>j.forEach(i=>D(i.id)),onUploadComplete:()=>{u.current&&u.current.focus()}}),{getRootProps:V,getInputProps:A}=Ce({onDrop:te,multiple:v===y.Multiple,accept:ze(t.fileType),maxSize:W}),X=()=>{if(u.current&&u.current.focus(),!S||e)return;const i={data:C,fileUploaderState:ee()};a.setChatInputValue(t,i,{fromUi:!0},d),I([]),R("")},oe=i=>{const{metaKey:r,ctrlKey:n,shiftKey:s}=i;Re(i)&&!s&&!n&&!r&&(i.preventDefault(),X())},ie=i=>{const{value:r}=i.target;x!==0&&r.length>x||(R(r),w.updateScrollHeight())};l.useEffect(()=>{if(t.setValue){t.setValue=!1;const i=t.value||"";R(i)}},[t]),l.useEffect(()=>{const i=s=>{s.preventDefault(),s.stopPropagation(),!z&&s.dataTransfer?.types.includes("Files")&&L(!0)},r=s=>{s.preventDefault(),s.stopPropagation(),z&&(s.clientX<=0&&s.clientY<=0||s.clientX>=E&&s.clientY>=P)&&L(!1)},n=s=>{s.preventDefault(),s.stopPropagation(),z&&L(!1)};return window.addEventListener("dragover",i),window.addEventListener("drop",n),window.addEventListener("dragleave",r),()=>{window.removeEventListener("dragover",i),window.removeEventListener("drop",n),window.removeEventListener("dragleave",r)}},[z,E,P]);const se=v!==y.None&&z;return o.jsxs(o.Fragment,{children:[v===y.None?null:o.jsx(Ze,{items:[...j],onDelete:D}),o.jsx(ot,{className:"stChatInput","data-testid":"stChatInput",ref:h,children:se?o.jsx(Ye,{getRootProps:V,getInputProps:A,acceptFile:v,inputHeight:w.height}):o.jsxs(it,{extended:w.isExtended,children:[v===y.None?null:o.jsx(Ke,{getRootProps:V,getInputProps:A,acceptFile:v,disabled:e,theme:c}),o.jsx(Te,{inputRef:u,value:C,placeholder:b,onChange:ie,onKeyDown:oe,"aria-label":b,disabled:e,rows:1,overrides:{Root:{style:{minHeight:c.sizes.minElementHeight,outline:"none",borderLeftWidth:"0",borderRightWidth:"0",borderTopWidth:"0",borderBottomWidth:"0",borderTopLeftRadius:"0",borderTopRightRadius:"0",borderBottomRightRadius:"0",borderBottomLeftRadius:"0"}},Input:{props:{"data-testid":"stChatInputTextArea"},style:{fontWeight:c.fontWeights.normal,lineHeight:c.lineHeights.inputWidget,"::placeholder":{color:c.colors.fadedText60},height:w.height,maxHeight:w.maxHeight,paddingLeft:c.spacing.none,paddingBottom:c.spacing.sm,paddingTop:c.spacing.sm,paddingRight:`calc(${c.iconSizes.xl} + 2 * ${c.spacing.sm} + ${c.spacing.sm})`}}}}),g>c.breakpoints.hideWidgetDetails&&o.jsx(rt,{children:o.jsx(Fe,{dirty:S,value:C,maxLength:x,type:"chat",inForm:!1})}),o.jsx(at,{children:o.jsx(st,{onClick:X,disabled:!S||e,extended:w.isExtended,"data-testid":"stChatInputSubmitButton",children:o.jsx(F,{content:Z,size:"xl",color:"inherit"})})})]})})]})}const lt=l.memo(nt);export{lt as default};
1
+ import{r as l,E as K,_ as O,c as p,j as o,c1 as ne,bJ as Y,bX as G,bF as J,bY as F,ci as y,ap as U,c2 as le,bx as de,bW as ce,bT as pe,cg as Q,b8 as ge,bm as ue,bQ as he,cj as me,F as H,bV as fe,bU as xe}from"./index-B2QqSXxG.js";import{g as be,C as ve,I as ye,F as M,E as je,a as Ie,s as we,u as Ce,b as ze}from"./FileHelper-BTXiVf4-.js";import{I as Fe}from"./InputInstructions-CqSmotDL.js";import{u as Ee,T as Te}from"./useTextInputAutoExpand-D9ObUIEt.js";import{i as Re}from"./inputUtils-CptNuJwn.js";import{E as Le}from"./ErrorOutline.esm-D5Ifiwqa.js";import{U as _}from"./UploadFileInfo-C-jY39rj.js";import"./base-input-Bu7lYJya.js";var q=l.forwardRef(function(e,t){var a={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return l.createElement(K,O({iconAttrs:a,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),l.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),l.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"}))});q.displayName="AttachFile";var Z=l.forwardRef(function(e,t){var a={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return l.createElement(K,O({iconAttrs:a,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),l.createElement("rect",{width:24,height:24,fill:"none"}),l.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"}))});Z.displayName="Send";const Se=p("div",{target:"e3id6jz12"})(({theme:e,height:t})=>({backgroundColor:e.colors.transparent,position:"absolute",left:0,bottom:0,minHeight:`max(${e.sizes.emptyDropdownHeight}, ${t})`,width:"100%",zIndex:e.zIndices.priority}),""),Ue=p("div",{target:"e3id6jz11"})(({theme:e,height:t})=>({border:`${e.sizes.borderWidth} solid`,borderColor:e.colors.primary,borderRadius:e.radii.chatInput,backgroundColor:e.colors.secondaryBg,color:e.colors.primary,display:"flex",alignItems:"center",justifyContent:"center",height:t,width:"100%",fontWeight:e.fontWeights.bold}),""),He=p("div",{target:"e3id6jz10"})(({theme:e,disabled:t})=>({display:"flex",alignItems:"top",height:"100%",marginTop:`-${e.sizes.borderWidth}`,cursor:t?"not-allowed":"auto"}),""),Me=p("div",{target:"e3id6jz9"})(({disabled:e})=>({pointerEvents:e?"none":"auto"}),""),ke=p("div",{target:"e3id6jz8"})(({theme:e})=>({marginTop:"0.625em",marginLeft:e.spacing.sm,height:e.spacing.xl,width:e.sizes.borderWidth,backgroundColor:e.colors.fadedText20}),""),Be=p("div",{target:"e3id6jz7"})(({theme:e})=>({left:0,right:0,lineHeight:e.lineHeights.tight,paddingLeft:e.spacing.sm,paddingRight:e.spacing.sm,overflowX:"auto"}),""),Pe=p("div",{target:"e3id6jz6"})({name:"zjik7",styles:"display:flex"}),We=p("div",{target:"e3id6jz5"})({name:"ou8xsw",styles:"flex:0 0 auto"}),Ne=p("div",{target:"e3id6jz4"})(({theme:e})=>({display:"flex",alignItems:"center",padding:e.spacing.sm,gap:e.spacing.twoXS}),""),De=p("div",{target:"e3id6jz3"})(({theme:e})=>({color:e.colors.fadedText60}),""),$e=p("div",{target:"e3id6jz2"})(({theme:e,fileStatus:t})=>({overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:t.type==="uploaded"?e.colors.bodyText:e.colors.fadedText60}),""),Ve=p("div",{target:"e3id6jz1"})(({theme:e})=>({marginRight:e.spacing.md,color:e.colors.fadedText60}),""),Ae=p("small",{target:"e3id6jz0"})(({theme:e})=>({display:"flex",alignItems:"center",maxHeight:e.sizes.smallElementHeight,color:e.colors.fadedText60,"& :hover":{color:e.colors.bodyText}}),""),Xe=({getRootProps:e,getInputProps:t,acceptFile:a,disabled:d,theme:m})=>o.jsxs(He,{disabled:d,children:[o.jsxs(Me,{"data-testid":"stChatInputFileUploadButton",disabled:d,...e(),children:[o.jsx("input",{...t()}),o.jsx(ne,{content:`Upload or drag and drop ${a===y.Multiple?"files":"a file"}`,placement:Y.TOP,onMouseEnterDelay:500,children:o.jsx(G,{kind:J.MINIMAL,disabled:d,children:o.jsx(F,{content:q,size:"lg",color:d?m.colors.fadedText40:m.colors.fadedText60})})})]}),o.jsx(ke,{})]}),Ke=l.memo(Xe),Oe=({getRootProps:e,getInputProps:t,acceptFile:a,inputHeight:d})=>o.jsxs(o.Fragment,{children:[o.jsx(Se,{height:d,...e(),children:o.jsx("input",{...t()})}),o.jsx(Ue,{height:d,children:`Drag and drop ${a===y.Multiple?"files":"a file"} here`})]}),Ye=l.memo(Oe);function Ge({children:e,content:t}){const a=U();return o.jsx(le,{content:t,placement:Y.TOP,overrides:{Body:{style:{top:`-${a.sizes.minElementHeight}`}}},children:e})}const Je=({fileInfo:e})=>{const t=U(),{type:a}=e.status;switch(a){case"uploading":return o.jsx(ce,{"data-testid":"stChatInputFileIconSpinner",size:"lg",margin:"0",padding:"0"});case"error":return o.jsx(Ge,{content:e.status.errorMessage,children:o.jsx(F,{color:t.colors.red,content:Le,size:"lg"})});case"uploaded":return o.jsx(F,{content:ye,size:"lg"});default:return de(a),null}},Qe=({fileInfo:e,onDelete:t})=>o.jsxs(Ne,{className:"stChatInputFile","data-testid":"stChatInputFile",children:[o.jsx(De,{children:o.jsx(Je,{fileInfo:e})}),o.jsx($e,{className:"stChatInputFileName","data-testid":"stChatInputFileName",title:e.name,fileStatus:e.status,children:e.name}),o.jsx(Ve,{children:be(e.size,M.Byte)}),o.jsx(Ae,{"data-testid":"stChatInputDeleteBtn",children:o.jsx(G,{onClick:()=>t(e.id),kind:J.MINIMAL,children:o.jsx(F,{content:ve,size:"lg"})})})]}),_e=l.memo(Qe),qe=({items:e,onDelete:t})=>o.jsx(Be,{"data-testid":"stChatUploadedFiles",children:o.jsx(Pe,{children:e.map(a=>o.jsx(We,{children:o.jsx(_e,{fileInfo:a,onDelete:t})},a.id))})}),Ze=l.memo(qe),et=({acceptMultipleFiles:e,maxFileSize:t,uploadClient:a,uploadFile:d,addFiles:m,getNextLocalFileId:c,deleteExistingFiles:b,onUploadComplete:x})=>(f,u)=>{if(!e&&f.length===0&&u.length>1){const g=u.findIndex(h=>h.errors?.[0].code===je.TooManyFiles);g>=0&&(f.push(u[g].file),u.splice(g,1))}if(!e&&f.length>0&&b(),a.fetchFileURLs(f).then(g=>{pe(g,f).forEach(([h,E])=>{d(h,E)})}).catch(g=>{m(f.map(h=>new _(h.name,h.size,c(),{type:"error",errorMessage:g})))}),u.length>0){const g=u.map(h=>Ie(h,c(),t));m(g)}x()},tt=({getNextLocalFileId:e,addFiles:t,updateFile:a,uploadClient:d,element:m,onUploadProgress:c,onUploadComplete:b})=>(x,f)=>{const u=Q.CancelToken.source(),g=new _(f.name,f.size,e(),{type:"uploading",cancelToken:u,progress:1});t([g]),d.uploadFile({formId:"",...m},x.uploadUrl,f,h=>c(h,g.id),u.token).then(()=>b(g.id,x)).catch(h=>{Q.isCancel(h)||a(g.id,g.setStatus({type:"error",errorMessage:h?h.toString():"Unknown error"}))})},ot=p("div",{target:"e1d2x3se4"})({name:"1nibcdy",styles:"border:none;position:relative;display:flex"}),it=p("div",{target:"e1d2x3se3"})(({theme:e,extended:t})=>({border:`${e.sizes.borderWidth} solid`,borderColor:e.colors.widgetBorderColor??e.colors.transparent,borderRadius:e.radii.chatInput,backgroundColor:e.colors.secondaryBg,position:"relative",flexGrow:1,display:"flex",alignItems:"center",paddingLeft:e.spacing.lg,maxHeight:t?"none":e.sizes.minElementHeight,gap:e.spacing.sm,overflow:"hidden",":focus-within":{borderColor:e.colors.primary}}),""),st=p("button",{target:"e1d2x3se2"})(({theme:e,disabled:t,extended:a})=>{const d=ge(e),[m,c]=d?[e.colors.gray60,e.colors.gray80]:[e.colors.gray80,e.colors.gray40];return{border:"none",backgroundColor:e.colors.transparent,borderTopRightRadius:a?"0":e.radii.chatInput,borderTopLeftRadius:a?e.radii.default:"0",borderBottomRightRadius:e.radii.chatInput,display:"inline-flex",alignItems:"center",justifyContent:"center",lineHeight:e.lineHeights.none,margin:e.spacing.none,padding:e.spacing.sm,color:t?m:c,pointerEvents:"auto","&:focus":{outline:"none"},":focus":{outline:"none"},"&:focus-visible":{backgroundColor:d?e.colors.gray10:e.colors.gray90},"&:hover":{color:e.colors.primary},"&:disabled, &:disabled:hover, &:disabled:active":{backgroundColor:e.colors.transparent,borderColor:e.colors.transparent,color:e.colors.gray,cursor:"not-allowed"}}},""),at=p("div",{target:"e1d2x3se1"})(({theme:e})=>({display:"flex",alignItems:"flex-end",height:"100%",position:"absolute",right:0,marginBottom:`-${e.sizes.borderWidth}`,pointerEvents:"none"}),""),rt=p("div",{target:"e1d2x3se0"})(({theme:e})=>({position:"absolute",bottom:"0px",right:`calc(${e.iconSizes.xl} + 2 * ${e.spacing.sm} + ${e.spacing.sm})`}),""),k=(e,t,a)=>a.map(d=>d.id===e?t:d),B=(e,t)=>t.find(a=>a.id===e);function nt({disabled:e,element:t,widgetMgr:a,fragmentId:d,uploadClient:m}){const c=U(),{placeholder:b,maxChars:x}=t,f=l.useRef(0),u=l.useRef(null),[g,h]=ue(),{innerWidth:E,innerHeight:P}=he(),[C,R]=l.useState(t.default),[j,I]=l.useState([]),[z,L]=l.useState(!1),w=Ee({textareaRef:u,dependencies:[b]}),S=l.useMemo(()=>j.some(i=>i.status.type==="uploading")?!1:C!==""||j.length>0,[j,C]),v=me(t.acceptFile),W=we(t.maxUploadSizeMb,M.Megabyte,M.Byte),N=l.useCallback(i=>I(r=>[...r,...i]),[]),D=l.useCallback(i=>{I(r=>{const n=B(i,r);return H(n)?r:(n.status.type==="uploading"&&n.status.cancelToken.cancel(),n.status.type==="uploaded"&&n.status.fileUrls.deleteUrl&&m.deleteFile(n.status.fileUrls.deleteUrl),r.filter(s=>s.id!==i))})},[m]),ee=()=>{const i=j.filter(r=>r.status.type==="uploaded").map(r=>{const{name:n,size:s,status:T}=r,{fileId:ae,fileUrls:re}=T;return new fe({fileId:ae,fileUrls:re,name:n,size:s})});return new xe({uploadedFileInfo:i})},$=()=>f.current++,te=et({acceptMultipleFiles:v===y.Multiple,maxFileSize:W,uploadClient:m,uploadFile:tt({getNextLocalFileId:$,addFiles:N,updateFile:(i,r)=>{I(n=>k(i,r,n))},uploadClient:m,element:t,onUploadProgress:(i,r)=>{I(n=>{const s=B(r,n);if(H(s)||s.status.type!=="uploading")return n;const T=Math.round(i.loaded*100/i.total);return s.status.progress===T?n:k(r,s.setStatus({type:"uploading",cancelToken:s.status.cancelToken,progress:T}),n)})},onUploadComplete:(i,r)=>{I(n=>{const s=B(i,n);return H(s)||s.status.type!=="uploading"?n:k(s.id,s.setStatus({type:"uploaded",fileId:r.fileId,fileUrls:r}),n)})}}),addFiles:N,getNextLocalFileId:$,deleteExistingFiles:()=>j.forEach(i=>D(i.id)),onUploadComplete:()=>{u.current&&u.current.focus()}}),{getRootProps:V,getInputProps:A}=Ce({onDrop:te,multiple:v===y.Multiple,accept:ze(t.fileType),maxSize:W}),X=()=>{if(u.current&&u.current.focus(),!S||e)return;const i={data:C,fileUploaderState:ee()};a.setChatInputValue(t,i,{fromUi:!0},d),I([]),R("")},oe=i=>{const{metaKey:r,ctrlKey:n,shiftKey:s}=i;Re(i)&&!s&&!n&&!r&&(i.preventDefault(),X())},ie=i=>{const{value:r}=i.target;x!==0&&r.length>x||(R(r),w.updateScrollHeight())};l.useEffect(()=>{if(t.setValue){t.setValue=!1;const i=t.value||"";R(i)}},[t]),l.useEffect(()=>{const i=s=>{s.preventDefault(),s.stopPropagation(),!z&&s.dataTransfer?.types.includes("Files")&&L(!0)},r=s=>{s.preventDefault(),s.stopPropagation(),z&&(s.clientX<=0&&s.clientY<=0||s.clientX>=E&&s.clientY>=P)&&L(!1)},n=s=>{s.preventDefault(),s.stopPropagation(),z&&L(!1)};return window.addEventListener("dragover",i),window.addEventListener("drop",n),window.addEventListener("dragleave",r),()=>{window.removeEventListener("dragover",i),window.removeEventListener("drop",n),window.removeEventListener("dragleave",r)}},[z,E,P]);const se=v!==y.None&&z;return o.jsxs(o.Fragment,{children:[v===y.None?null:o.jsx(Ze,{items:[...j],onDelete:D}),o.jsx(ot,{className:"stChatInput","data-testid":"stChatInput",ref:h,children:se?o.jsx(Ye,{getRootProps:V,getInputProps:A,acceptFile:v,inputHeight:w.height}):o.jsxs(it,{extended:w.isExtended,children:[v===y.None?null:o.jsx(Ke,{getRootProps:V,getInputProps:A,acceptFile:v,disabled:e,theme:c}),o.jsx(Te,{inputRef:u,value:C,placeholder:b,onChange:ie,onKeyDown:oe,"aria-label":b,disabled:e,rows:1,overrides:{Root:{style:{minHeight:c.sizes.minElementHeight,outline:"none",borderLeftWidth:"0",borderRightWidth:"0",borderTopWidth:"0",borderBottomWidth:"0",borderTopLeftRadius:"0",borderTopRightRadius:"0",borderBottomRightRadius:"0",borderBottomLeftRadius:"0"}},Input:{props:{"data-testid":"stChatInputTextArea"},style:{fontWeight:c.fontWeights.normal,lineHeight:c.lineHeights.inputWidget,"::placeholder":{color:c.colors.fadedText60},height:w.height,maxHeight:w.maxHeight,paddingLeft:c.spacing.none,paddingBottom:c.spacing.sm,paddingTop:c.spacing.sm,paddingRight:`calc(${c.iconSizes.xl} + 2 * ${c.spacing.sm} + ${c.spacing.sm})`}}}}),g>c.breakpoints.hideWidgetDetails&&o.jsx(rt,{children:o.jsx(Fe,{dirty:S,value:C,maxLength:x,type:"chat",inForm:!1})}),o.jsx(at,{children:o.jsx(st,{onClick:X,disabled:!S||e,extended:w.isExtended,"data-testid":"stChatInputSubmitButton",children:o.jsx(F,{content:Z,size:"xl",color:"inherit"})})})]})})]})}const lt=l.memo(nt);export{lt as default};
@@ -1,2 +1,2 @@
1
- import{c3 as q,c4 as H,r as f,c5 as J,ap as Q,c6 as Y,c7 as u,j as g,c8 as Z,b$ as ee,c0 as te,c9 as re,c1 as ne,bJ as oe,ca as ie,bX as ae,bF as C,bE as U,bI as ce}from"./index-DCNLpqIv.js";import{a as le}from"./useBasicWidgetState-9vtYd9vP.js";import"./FormClearHelper-fvwQICEk.js";var ue={secondary:"secondary"},A={default:"default"},se={default:"default"},x=Object.freeze({radio:"radio",checkbox:"checkbox"}),N=q("div",function(e){var t=e.$shape,r=e.$length,n=e.$theme,o=r===1?void 0:t!==A.default?"-".concat(n.sizing.scale100):"-0.5px";return{display:"flex",marginLeft:o,marginRight:o}});N.displayName="StyledRoot",N.displayName="StyledRoot";function G(e){"@babel/helpers - typeof";return G=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},G(e)}function z(){return z=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},z.apply(this,arguments)}function V(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function fe(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?V(Object(r),!0).forEach(function(n){$(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):V(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function pe(e,t){return me(e)||be(e,t)||ye(e,t)||de()}function de(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
1
+ import{c3 as q,c4 as H,r as f,c5 as J,ap as Q,c6 as Y,c7 as u,j as g,c8 as Z,b$ as ee,c0 as te,c9 as re,c1 as ne,bJ as oe,ca as ie,bX as ae,bF as C,bE as U,bI as ce}from"./index-B2QqSXxG.js";import{a as le}from"./useBasicWidgetState-DVIC6bdr.js";import"./FormClearHelper-BC4K9Zmh.js";var ue={secondary:"secondary"},A={default:"default"},se={default:"default"},x=Object.freeze({radio:"radio",checkbox:"checkbox"}),N=q("div",function(e){var t=e.$shape,r=e.$length,n=e.$theme,o=r===1?void 0:t!==A.default?"-".concat(n.sizing.scale100):"-0.5px";return{display:"flex",marginLeft:o,marginRight:o}});N.displayName="StyledRoot",N.displayName="StyledRoot";function G(e){"@babel/helpers - typeof";return G=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},G(e)}function z(){return z=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},z.apply(this,arguments)}function V(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function fe(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?V(Object(r),!0).forEach(function(n){$(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):V(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function pe(e,t){return me(e)||be(e,t)||ye(e,t)||de()}function de(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
2
2
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ye(e,t){if(e){if(typeof e=="string")return X(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return X(e,t)}}function X(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function be(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],o=!0,a=!1,i,p;try{for(r=r.call(e);!(o=(i=r.next()).done)&&(n.push(i.value),!(t&&n.length===t));o=!0);}catch(b){a=!0,p=b}finally{try{!o&&r.return!=null&&r.return()}finally{if(a)throw p}}return n}}function me(e){if(Array.isArray(e))return e}function he(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ge(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function ve(e,t,r){return t&&ge(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Oe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&B(e,t)}function B(e,t){return B=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},B(e,t)}function Se(e){var t=Ee();return function(){var r=I(e),n;if(t){var o=I(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return we(this,n)}}function we(e,t){if(t&&(G(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return W(e)}function W(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ee(){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 I(e){return I=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},I(e)}function $(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function je(e,t){return!Array.isArray(e)&&typeof e!="number"?!1:Array.isArray(e)?e.includes(t):e===t}var F=function(e){Oe(r,e);var t=Se(r);function r(){var n;he(this,r);for(var o=arguments.length,a=new Array(o),i=0;i<o;i++)a[i]=arguments[i];return n=t.call.apply(t,[this].concat(a)),$(W(n),"childRefs",{}),n}return ve(r,[{key:"render",value:function(){var n=this,o=this.props,a=o.overrides,i=a===void 0?{}:a,p=o.mode,b=p===void 0?x.checkbox:p,l=o.children,m=o.selected,E=o.disabled,d=o.onClick,S=o.kind,y=o.shape,j=o.size,v=H(i.Root,N),P=pe(v,2),L=P[0],_=P[1],R=this.props["aria-label"]||this.props.ariaLabel,s=b===x.radio,w=f.Children.count(l);return f.createElement(J.Consumer,null,function(K){return f.createElement(L,z({"aria-label":R||K.buttongroup.ariaLabel,"data-baseweb":"button-group",role:s?"radiogroup":"group",$shape:y,$length:l.length},_),f.Children.map(l,function(h,k){if(!f.isValidElement(h))return null;var M=h.props.isSelected?h.props.isSelected:je(m,k);return s&&(n.childRefs[k]=f.createRef()),f.cloneElement(h,{disabled:E||h.props.disabled,isSelected:M,ref:s?n.childRefs[k]:void 0,tabIndex:!s||M||s&&(!m||m===-1)&&k===0?0:-1,onKeyDown:function(c){if(s){var O=Number(m)?Number(m):0;if(c.key==="ArrowUp"||c.key==="ArrowLeft"){c.preventDefault&&c.preventDefault();var T=O-1<0?w-1:O-1;d&&d(c,T),n.childRefs[T].current&&n.childRefs[T].current.focus()}if(c.key==="ArrowDown"||c.key==="ArrowRight"){c.preventDefault&&c.preventDefault();var D=O+1>w-1?0:O+1;d&&d(c,D),n.childRefs[D].current&&n.childRefs[D].current.focus()}}},kind:S,onClick:function(c){E||(h.props.onClick&&h.props.onClick(c),d&&d(c,k))},shape:y,size:j,overrides:fe({BaseButton:{style:function(c){var O=c.$theme;return l.length===1?{}:y!==A.default?{marginLeft:O.sizing.scale100,marginRight:O.sizing.scale100}:{marginLeft:"0.5px",marginRight:"0.5px"}},props:{"aria-checked":M,role:s?"radio":"checkbox"}}},h.props.overrides)})}))})}}]),r}(f.Component);$(F,"defaultProps",{disabled:!1,onClick:function(){},shape:A.default,size:se.default,kind:ue.secondary});function Le(e,t){return t.includes(e)?t.filter(r=>r!==e):[...t,e]}function Re(e,t,r){return e==u.ClickMode.MULTI_SELECT?Le(t,r??[]):r?.includes(t)?[]:[t]}function ke(e){return e.length===0?-1:e[0]}function Ce(e,t,r,n){t.setIntArrayValue(e,r.value,{fromUi:r.fromUi},n)}function Pe(e,t,r){const n=r===u.Style.PILLS?C.PILLS:r===u.Style.BORDERLESS?C.BORDERLESS_ICON:C.SEGMENTED_CONTROL,o=r===u.Style.BORDERLESS?U.XSMALL:U.MEDIUM,a=n===C.PILLS||n===C.SEGMENTED_CONTROL,i=r===u.Style.BORDERLESS?"lg":"base";return{element:g.jsx(ce,{icon:t,label:e,iconSize:i,useSmallerFont:a}),kind:n,size:o}}function xe(e,t,r,n){return r.indexOf(n)>-1?!0:t!==u.ClickMode.SINGLE_SELECT||e!==u.SelectionVisualization.ALL_UP_TO_SELECTED?!1:r.length>0&&n<r[0]}function Ie(e,t){return e&&(t=`${t}Active`),t}function _e(e,t,r){const n={flexWrap:"wrap",maxWidth:"100%",margin:"0 0"},o=r?"100%":"auto",a=r?{}:{content:"''",flex:1e4};switch(e){case u.Style.BORDERLESS:return{...n,columnGap:t.threeXS,rowGap:t.threeXS};case u.Style.PILLS:return{...n,columnGap:t.twoXS,rowGap:t.twoXS,width:o};case u.Style.SEGMENTED_CONTROL:return{...n,columnGap:t.none,rowGap:t.twoXS,"::after":a,width:o};default:return n}}function Me(e,t,r,n,o,a,i){const p=xe(r,n,o,t);let b=e.content,l=e.contentIcon;return p&&(b=e.selectedContent?e.selectedContent:b,l=e.selectedContentIcon?e.selectedContentIcon:l),f.forwardRef(function(m,E){const{element:d,kind:S,size:y}=Pe(b??"",l??void 0,a),j=Ie(!!(p&&!e.selectedContent&&!e.selectedContentIcon),S);return g.jsx(ae,{...m,size:y,kind:j,containerWidth:i,children:d})})}function Te(e,t){return e.getIntArrayValue(t)}function De(e){return e.default??null}function Ae(e){return e.value??null}function Ne(e){const{disabled:t,element:r,fragmentId:n,widgetMgr:o,widthConfig:a}=e,{clickMode:i,options:p,selectionVisualization:b,style:l,label:m,labelVisibility:E,help:d}=r,S=Q(),[y,j]=le({getStateFromWidgetMgr:Te,getDefaultStateFromProto:De,getCurrStateFromProto:Ae,updateWidgetMgrState:Ce,element:r,widgetMgr:o,fragmentId:n}),v=Y(a),P=(R,s)=>{const w=Re(i,s,y);j({value:w,fromUi:!0})};let L;i===u.ClickMode.SINGLE_SELECT?L=x.radio:i===u.ClickMode.MULTI_SELECT&&(L=x.checkbox);const _=f.useMemo(()=>p.map((R,s)=>{const w=Me(R,s,b,i,y,l,v);return g.jsx(w,{},`${R.content}-${s}`)}),[i,p,b,l,y,v]);return g.jsxs(Z,{className:"stButtonGroup","data-testid":"stButtonGroup",containerWidth:v,children:[g.jsx(ee,{label:m,disabled:t,labelVisibility:te(E?.value??ie.LabelVisibilityOptions.COLLAPSED),children:d&&g.jsx(re,{children:g.jsx(ne,{content:d,placement:oe.TOP})})}),g.jsx(F,{disabled:t,mode:L,onClick:P,selected:i===u.ClickMode.MULTI_SELECT?y:ke(y),overrides:{Root:{style:f.useCallback(()=>_e(l,S.spacing,v),[l,S.spacing,v])}},children:_})]})}const Ge=f.memo(Ne);export{Ge as default};
@@ -1,2 +1,2 @@
1
- import{c as Xe,r as ie,j as Rt}from"./index-DCNLpqIv.js";/*! @license DOMPurify 3.2.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.6/LICENSE */const{entries:le,setPrototypeOf:se,isFrozen:qe,getPrototypeOf:$e,getOwnPropertyDescriptor:Ke}=Object;let{freeze:y,seal:b,create:ce}=Object,{apply:wt,construct:Ot}=typeof Reflect<"u"&&Reflect;y||(y=function(r){return r}),b||(b=function(r){return r}),wt||(wt=function(r,o,i){return r.apply(o,i)}),Ot||(Ot=function(r,o){return new r(...o)});const it=_(Array.prototype.forEach),Ve=_(Array.prototype.lastIndexOf),ue=_(Array.prototype.pop),X=_(Array.prototype.push),Ze=_(Array.prototype.splice),lt=_(String.prototype.toLowerCase),Lt=_(String.prototype.toString),me=_(String.prototype.match),q=_(String.prototype.replace),Je=_(String.prototype.indexOf),Qe=_(String.prototype.trim),S=_(Object.prototype.hasOwnProperty),A=_(RegExp.prototype.test),$=tn(TypeError);function _(r){return function(o){o instanceof RegExp&&(o.lastIndex=0);for(var i=arguments.length,l=new Array(i>1?i-1:0),h=1;h<i;h++)l[h-1]=arguments[h];return wt(r,o,l)}}function tn(r){return function(){for(var o=arguments.length,i=new Array(o),l=0;l<o;l++)i[l]=arguments[l];return Ot(r,i)}}function a(r,o){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:lt;se&&se(r,null);let l=o.length;for(;l--;){let h=o[l];if(typeof h=="string"){const R=i(h);R!==h&&(qe(o)||(o[l]=R),h=R)}r[h]=!0}return r}function en(r){for(let o=0;o<r.length;o++)S(r,o)||(r[o]=null);return r}function D(r){const o=ce(null);for(const[i,l]of le(r))S(r,i)&&(Array.isArray(l)?o[i]=en(l):l&&typeof l=="object"&&l.constructor===Object?o[i]=D(l):o[i]=l);return o}function K(r,o){for(;r!==null;){const l=Ke(r,o);if(l){if(l.get)return _(l.get);if(typeof l.value=="function")return _(l.value)}r=$e(r)}function i(){return null}return i}const pe=y(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),vt=y(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Dt=y(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),nn=y(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Ct=y(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),on=y(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),fe=y(["#text"]),de=y(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),xt=y(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),ge=y(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),st=y(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),rn=b(/\{\{[\w\W]*|[\w\W]*\}\}/gm),an=b(/<%[\w\W]*|[\w\W]*%>/gm),ln=b(/\$\{[\w\W]*/gm),sn=b(/^data-[\-\w.\u00B7-\uFFFF]+$/),cn=b(/^aria-[\-\w]+$/),he=b(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),un=b(/^(?:\w+script|data):/i),mn=b(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Te=b(/^html$/i),pn=b(/^[a-z][.\w]*(-[.\w]+)+$/i);var Ee=Object.freeze({__proto__:null,ARIA_ATTR:cn,ATTR_WHITESPACE:mn,CUSTOM_ELEMENT:pn,DATA_ATTR:sn,DOCTYPE_NAME:Te,ERB_EXPR:an,IS_ALLOWED_URI:he,IS_SCRIPT_OR_DATA:un,MUSTACHE_EXPR:rn,TMPLIT_EXPR:ln});const V={element:1,text:3,progressingInstruction:7,comment:8,document:9},fn=function(){return typeof window>"u"?null:window},dn=function(r,o){if(typeof r!="object"||typeof r.createPolicy!="function")return null;let i=null;const l="data-tt-policy-suffix";o&&o.hasAttribute(l)&&(i=o.getAttribute(l));const h="dompurify"+(i?"#"+i:"");try{return r.createPolicy(h,{createHTML(R){return R},createScriptURL(R){return R}})}catch{return console.warn("TrustedTypes policy "+h+" could not be created."),null}},ye=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Ae(){let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:fn();const o=t=>Ae(t);if(o.version="3.2.6",o.removed=[],!r||!r.document||r.document.nodeType!==V.document||!r.Element)return o.isSupported=!1,o;let{document:i}=r;const l=i,h=l.currentScript,{DocumentFragment:R,HTMLTemplateElement:_e,Node:ct,Element:Mt,NodeFilter:F,NamedNodeMap:be=r.NamedNodeMap||r.MozNamedAttrMap,HTMLFormElement:Ne,DOMParser:Se,trustedTypes:Z}=r,W=Mt.prototype,Re=K(W,"cloneNode"),we=K(W,"remove"),Oe=K(W,"nextSibling"),Le=K(W,"childNodes"),J=K(W,"parentNode");if(typeof _e=="function"){const t=i.createElement("template");t.content&&t.content.ownerDocument&&(i=t.content.ownerDocument)}let T,B="";const{implementation:ut,createNodeIterator:ve,createDocumentFragment:De,getElementsByTagName:Ce}=i,{importNode:xe}=l;let E=ye();o.isSupported=typeof le=="function"&&typeof J=="function"&&ut&&ut.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:mt,ERB_EXPR:pt,TMPLIT_EXPR:ft,DATA_ATTR:ke,ARIA_ATTR:Ie,IS_SCRIPT_OR_DATA:Me,ATTR_WHITESPACE:Ut,CUSTOM_ELEMENT:Ue}=Ee;let{IS_ALLOWED_URI:Pt}=Ee,m=null;const Ht=a({},[...pe,...vt,...Dt,...Ct,...fe]);let f=null;const zt=a({},[...de,...xt,...ge,...st]);let u=Object.seal(ce(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),G=null,dt=null,Ft=!0,gt=!0,Wt=!1,Bt=!0,k=!1,Q=!0,C=!1,ht=!1,Tt=!1,I=!1,tt=!1,et=!1,Gt=!0,Yt=!1;const Pe="user-content-";let Et=!0,Y=!1,M={},U=null;const jt=a({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Xt=null;const qt=a({},["audio","video","img","source","image","track"]);let yt=null;const $t=a({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),nt="http://www.w3.org/1998/Math/MathML",ot="http://www.w3.org/2000/svg",O="http://www.w3.org/1999/xhtml";let P=O,At=!1,_t=null;const He=a({},[nt,ot,O],Lt);let rt=a({},["mi","mo","mn","ms","mtext"]),at=a({},["annotation-xml"]);const ze=a({},["title","style","font","a","script"]);let j=null;const Fe=["application/xhtml+xml","text/html"],We="text/html";let p=null,H=null;const Be=i.createElement("form"),Kt=function(t){return t instanceof RegExp||t instanceof Function},bt=function(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(H&&H===t)){if((!t||typeof t!="object")&&(t={}),t=D(t),j=Fe.indexOf(t.PARSER_MEDIA_TYPE)===-1?We:t.PARSER_MEDIA_TYPE,p=j==="application/xhtml+xml"?Lt:lt,m=S(t,"ALLOWED_TAGS")?a({},t.ALLOWED_TAGS,p):Ht,f=S(t,"ALLOWED_ATTR")?a({},t.ALLOWED_ATTR,p):zt,_t=S(t,"ALLOWED_NAMESPACES")?a({},t.ALLOWED_NAMESPACES,Lt):He,yt=S(t,"ADD_URI_SAFE_ATTR")?a(D($t),t.ADD_URI_SAFE_ATTR,p):$t,Xt=S(t,"ADD_DATA_URI_TAGS")?a(D(qt),t.ADD_DATA_URI_TAGS,p):qt,U=S(t,"FORBID_CONTENTS")?a({},t.FORBID_CONTENTS,p):jt,G=S(t,"FORBID_TAGS")?a({},t.FORBID_TAGS,p):D({}),dt=S(t,"FORBID_ATTR")?a({},t.FORBID_ATTR,p):D({}),M=S(t,"USE_PROFILES")?t.USE_PROFILES:!1,Ft=t.ALLOW_ARIA_ATTR!==!1,gt=t.ALLOW_DATA_ATTR!==!1,Wt=t.ALLOW_UNKNOWN_PROTOCOLS||!1,Bt=t.ALLOW_SELF_CLOSE_IN_ATTR!==!1,k=t.SAFE_FOR_TEMPLATES||!1,Q=t.SAFE_FOR_XML!==!1,C=t.WHOLE_DOCUMENT||!1,I=t.RETURN_DOM||!1,tt=t.RETURN_DOM_FRAGMENT||!1,et=t.RETURN_TRUSTED_TYPE||!1,Tt=t.FORCE_BODY||!1,Gt=t.SANITIZE_DOM!==!1,Yt=t.SANITIZE_NAMED_PROPS||!1,Et=t.KEEP_CONTENT!==!1,Y=t.IN_PLACE||!1,Pt=t.ALLOWED_URI_REGEXP||he,P=t.NAMESPACE||O,rt=t.MATHML_TEXT_INTEGRATION_POINTS||rt,at=t.HTML_INTEGRATION_POINTS||at,u=t.CUSTOM_ELEMENT_HANDLING||{},t.CUSTOM_ELEMENT_HANDLING&&Kt(t.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(u.tagNameCheck=t.CUSTOM_ELEMENT_HANDLING.tagNameCheck),t.CUSTOM_ELEMENT_HANDLING&&Kt(t.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(u.attributeNameCheck=t.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),t.CUSTOM_ELEMENT_HANDLING&&typeof t.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(u.allowCustomizedBuiltInElements=t.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),k&&(gt=!1),tt&&(I=!0),M&&(m=a({},fe),f=[],M.html===!0&&(a(m,pe),a(f,de)),M.svg===!0&&(a(m,vt),a(f,xt),a(f,st)),M.svgFilters===!0&&(a(m,Dt),a(f,xt),a(f,st)),M.mathMl===!0&&(a(m,Ct),a(f,ge),a(f,st))),t.ADD_TAGS&&(m===Ht&&(m=D(m)),a(m,t.ADD_TAGS,p)),t.ADD_ATTR&&(f===zt&&(f=D(f)),a(f,t.ADD_ATTR,p)),t.ADD_URI_SAFE_ATTR&&a(yt,t.ADD_URI_SAFE_ATTR,p),t.FORBID_CONTENTS&&(U===jt&&(U=D(U)),a(U,t.FORBID_CONTENTS,p)),Et&&(m["#text"]=!0),C&&a(m,["html","head","body"]),m.table&&(a(m,["tbody"]),delete G.tbody),t.TRUSTED_TYPES_POLICY){if(typeof t.TRUSTED_TYPES_POLICY.createHTML!="function")throw $('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof t.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw $('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');T=t.TRUSTED_TYPES_POLICY,B=T.createHTML("")}else T===void 0&&(T=dn(Z,h)),T!==null&&typeof B=="string"&&(B=T.createHTML(""));y&&y(t),H=t}},Vt=a({},[...vt,...Dt,...nn]),Zt=a({},[...Ct,...on]),Ge=function(t){let n=J(t);(!n||!n.tagName)&&(n={namespaceURI:P,tagName:"template"});const e=lt(t.tagName),s=lt(n.tagName);return _t[t.namespaceURI]?t.namespaceURI===ot?n.namespaceURI===O?e==="svg":n.namespaceURI===nt?e==="svg"&&(s==="annotation-xml"||rt[s]):!!Vt[e]:t.namespaceURI===nt?n.namespaceURI===O?e==="math":n.namespaceURI===ot?e==="math"&&at[s]:!!Zt[e]:t.namespaceURI===O?n.namespaceURI===ot&&!at[s]||n.namespaceURI===nt&&!rt[s]?!1:!Zt[e]&&(ze[e]||!Vt[e]):!!(j==="application/xhtml+xml"&&_t[t.namespaceURI]):!1},x=function(t){X(o.removed,{element:t});try{J(t).removeChild(t)}catch{we(t)}},z=function(t,n){try{X(o.removed,{attribute:n.getAttributeNode(t),from:n})}catch{X(o.removed,{attribute:null,from:n})}if(n.removeAttribute(t),t==="is")if(I||tt)try{x(n)}catch{}else try{n.setAttribute(t,"")}catch{}},Jt=function(t){let n=null,e=null;if(Tt)t="<remove></remove>"+t;else{const c=me(t,/^[\r\n\t ]+/);e=c&&c[0]}j==="application/xhtml+xml"&&P===O&&(t='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+t+"</body></html>");const s=T?T.createHTML(t):t;if(P===O)try{n=new Se().parseFromString(s,j)}catch{}if(!n||!n.documentElement){n=ut.createDocument(P,"template",null);try{n.documentElement.innerHTML=At?B:s}catch{}}const d=n.body||n.documentElement;return t&&e&&d.insertBefore(i.createTextNode(e),d.childNodes[0]||null),P===O?Ce.call(n,C?"html":"body")[0]:C?n.documentElement:d},Qt=function(t){return ve.call(t.ownerDocument||t,t,F.SHOW_ELEMENT|F.SHOW_COMMENT|F.SHOW_TEXT|F.SHOW_PROCESSING_INSTRUCTION|F.SHOW_CDATA_SECTION,null)},Nt=function(t){return t instanceof Ne&&(typeof t.nodeName!="string"||typeof t.textContent!="string"||typeof t.removeChild!="function"||!(t.attributes instanceof be)||typeof t.removeAttribute!="function"||typeof t.setAttribute!="function"||typeof t.namespaceURI!="string"||typeof t.insertBefore!="function"||typeof t.hasChildNodes!="function")},te=function(t){return typeof ct=="function"&&t instanceof ct};function L(t,n,e){it(t,s=>{s.call(o,n,e,H)})}const ee=function(t){let n=null;if(L(E.beforeSanitizeElements,t,null),Nt(t))return x(t),!0;const e=p(t.nodeName);if(L(E.uponSanitizeElement,t,{tagName:e,allowedTags:m}),Q&&t.hasChildNodes()&&!te(t.firstElementChild)&&A(/<[/\w!]/g,t.innerHTML)&&A(/<[/\w!]/g,t.textContent)||t.nodeType===V.progressingInstruction||Q&&t.nodeType===V.comment&&A(/<[/\w]/g,t.data))return x(t),!0;if(!m[e]||G[e]){if(!G[e]&&oe(e)&&(u.tagNameCheck instanceof RegExp&&A(u.tagNameCheck,e)||u.tagNameCheck instanceof Function&&u.tagNameCheck(e)))return!1;if(Et&&!U[e]){const s=J(t)||t.parentNode,d=Le(t)||t.childNodes;if(d&&s){const c=d.length;for(let v=c-1;v>=0;--v){const N=Re(d[v],!0);N.__removalCount=(t.__removalCount||0)+1,s.insertBefore(N,Oe(t))}}}return x(t),!0}return t instanceof Mt&&!Ge(t)||(e==="noscript"||e==="noembed"||e==="noframes")&&A(/<\/no(script|embed|frames)/i,t.innerHTML)?(x(t),!0):(k&&t.nodeType===V.text&&(n=t.textContent,it([mt,pt,ft],s=>{n=q(n,s," ")}),t.textContent!==n&&(X(o.removed,{element:t.cloneNode()}),t.textContent=n)),L(E.afterSanitizeElements,t,null),!1)},ne=function(t,n,e){if(Gt&&(n==="id"||n==="name")&&(e in i||e in Be))return!1;if(!(gt&&!dt[n]&&A(ke,n))&&!(Ft&&A(Ie,n))){if(!f[n]||dt[n]){if(!(oe(t)&&(u.tagNameCheck instanceof RegExp&&A(u.tagNameCheck,t)||u.tagNameCheck instanceof Function&&u.tagNameCheck(t))&&(u.attributeNameCheck instanceof RegExp&&A(u.attributeNameCheck,n)||u.attributeNameCheck instanceof Function&&u.attributeNameCheck(n))||n==="is"&&u.allowCustomizedBuiltInElements&&(u.tagNameCheck instanceof RegExp&&A(u.tagNameCheck,e)||u.tagNameCheck instanceof Function&&u.tagNameCheck(e))))return!1}else if(!yt[n]&&!A(Pt,q(e,Ut,""))&&!((n==="src"||n==="xlink:href"||n==="href")&&t!=="script"&&Je(e,"data:")===0&&Xt[t])&&!(Wt&&!A(Me,q(e,Ut,"")))&&e)return!1}return!0},oe=function(t){return t!=="annotation-xml"&&me(t,Ue)},re=function(t){L(E.beforeSanitizeAttributes,t,null);const{attributes:n}=t;if(!n||Nt(t))return;const e={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:f,forceKeepAttr:void 0};let s=n.length;for(;s--;){const d=n[s],{name:c,namespaceURI:v,value:N}=d,w=p(c),St=N;let g=c==="value"?St:Qe(St);if(e.attrName=w,e.attrValue=g,e.keepAttr=!0,e.forceKeepAttr=void 0,L(E.uponSanitizeAttribute,t,e),g=e.attrValue,Yt&&(w==="id"||w==="name")&&(z(c,t),g=Pe+g),Q&&A(/((--!?|])>)|<\/(style|title)/i,g)){z(c,t);continue}if(e.forceKeepAttr)continue;if(!e.keepAttr){z(c,t);continue}if(!Bt&&A(/\/>/i,g)){z(c,t);continue}k&&it([mt,pt,ft],je=>{g=q(g,je," ")});const ae=p(t.nodeName);if(!ne(ae,w,g)){z(c,t);continue}if(T&&typeof Z=="object"&&typeof Z.getAttributeType=="function"&&!v)switch(Z.getAttributeType(ae,w)){case"TrustedHTML":{g=T.createHTML(g);break}case"TrustedScriptURL":{g=T.createScriptURL(g);break}}if(g!==St)try{v?t.setAttributeNS(v,c,g):t.setAttribute(c,g),Nt(t)?x(t):ue(o.removed)}catch{z(c,t)}}L(E.afterSanitizeAttributes,t,null)},Ye=function t(n){let e=null;const s=Qt(n);for(L(E.beforeSanitizeShadowDOM,n,null);e=s.nextNode();)L(E.uponSanitizeShadowNode,e,null),ee(e),re(e),e.content instanceof R&&t(e.content);L(E.afterSanitizeShadowDOM,n,null)};return o.sanitize=function(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},e=null,s=null,d=null,c=null;if(At=!t,At&&(t="<!-->"),typeof t!="string"&&!te(t))if(typeof t.toString=="function"){if(t=t.toString(),typeof t!="string")throw $("dirty is not a string, aborting")}else throw $("toString is not a function");if(!o.isSupported)return t;if(ht||bt(n),o.removed=[],typeof t=="string"&&(Y=!1),Y){if(t.nodeName){const w=p(t.nodeName);if(!m[w]||G[w])throw $("root node is forbidden and cannot be sanitized in-place")}}else if(t instanceof ct)e=Jt("<!---->"),s=e.ownerDocument.importNode(t,!0),s.nodeType===V.element&&s.nodeName==="BODY"||s.nodeName==="HTML"?e=s:e.appendChild(s);else{if(!I&&!k&&!C&&t.indexOf("<")===-1)return T&&et?T.createHTML(t):t;if(e=Jt(t),!e)return I?null:et?B:""}e&&Tt&&x(e.firstChild);const v=Qt(Y?t:e);for(;d=v.nextNode();)ee(d),re(d),d.content instanceof R&&Ye(d.content);if(Y)return t;if(I){if(tt)for(c=De.call(e.ownerDocument);e.firstChild;)c.appendChild(e.firstChild);else c=e;return(f.shadowroot||f.shadowrootmode)&&(c=xe.call(l,c,!0)),c}let N=C?e.outerHTML:e.innerHTML;return C&&m["!doctype"]&&e.ownerDocument&&e.ownerDocument.doctype&&e.ownerDocument.doctype.name&&A(Te,e.ownerDocument.doctype.name)&&(N="<!DOCTYPE "+e.ownerDocument.doctype.name+`>
1
+ import{c as Xe,r as ie,j as Rt}from"./index-B2QqSXxG.js";/*! @license DOMPurify 3.2.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.6/LICENSE */const{entries:le,setPrototypeOf:se,isFrozen:qe,getPrototypeOf:$e,getOwnPropertyDescriptor:Ke}=Object;let{freeze:y,seal:b,create:ce}=Object,{apply:wt,construct:Ot}=typeof Reflect<"u"&&Reflect;y||(y=function(r){return r}),b||(b=function(r){return r}),wt||(wt=function(r,o,i){return r.apply(o,i)}),Ot||(Ot=function(r,o){return new r(...o)});const it=_(Array.prototype.forEach),Ve=_(Array.prototype.lastIndexOf),ue=_(Array.prototype.pop),X=_(Array.prototype.push),Ze=_(Array.prototype.splice),lt=_(String.prototype.toLowerCase),Lt=_(String.prototype.toString),me=_(String.prototype.match),q=_(String.prototype.replace),Je=_(String.prototype.indexOf),Qe=_(String.prototype.trim),S=_(Object.prototype.hasOwnProperty),A=_(RegExp.prototype.test),$=tn(TypeError);function _(r){return function(o){o instanceof RegExp&&(o.lastIndex=0);for(var i=arguments.length,l=new Array(i>1?i-1:0),h=1;h<i;h++)l[h-1]=arguments[h];return wt(r,o,l)}}function tn(r){return function(){for(var o=arguments.length,i=new Array(o),l=0;l<o;l++)i[l]=arguments[l];return Ot(r,i)}}function a(r,o){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:lt;se&&se(r,null);let l=o.length;for(;l--;){let h=o[l];if(typeof h=="string"){const R=i(h);R!==h&&(qe(o)||(o[l]=R),h=R)}r[h]=!0}return r}function en(r){for(let o=0;o<r.length;o++)S(r,o)||(r[o]=null);return r}function D(r){const o=ce(null);for(const[i,l]of le(r))S(r,i)&&(Array.isArray(l)?o[i]=en(l):l&&typeof l=="object"&&l.constructor===Object?o[i]=D(l):o[i]=l);return o}function K(r,o){for(;r!==null;){const l=Ke(r,o);if(l){if(l.get)return _(l.get);if(typeof l.value=="function")return _(l.value)}r=$e(r)}function i(){return null}return i}const pe=y(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),vt=y(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Dt=y(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),nn=y(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Ct=y(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),on=y(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),fe=y(["#text"]),de=y(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),xt=y(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),ge=y(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),st=y(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),rn=b(/\{\{[\w\W]*|[\w\W]*\}\}/gm),an=b(/<%[\w\W]*|[\w\W]*%>/gm),ln=b(/\$\{[\w\W]*/gm),sn=b(/^data-[\-\w.\u00B7-\uFFFF]+$/),cn=b(/^aria-[\-\w]+$/),he=b(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),un=b(/^(?:\w+script|data):/i),mn=b(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Te=b(/^html$/i),pn=b(/^[a-z][.\w]*(-[.\w]+)+$/i);var Ee=Object.freeze({__proto__:null,ARIA_ATTR:cn,ATTR_WHITESPACE:mn,CUSTOM_ELEMENT:pn,DATA_ATTR:sn,DOCTYPE_NAME:Te,ERB_EXPR:an,IS_ALLOWED_URI:he,IS_SCRIPT_OR_DATA:un,MUSTACHE_EXPR:rn,TMPLIT_EXPR:ln});const V={element:1,text:3,progressingInstruction:7,comment:8,document:9},fn=function(){return typeof window>"u"?null:window},dn=function(r,o){if(typeof r!="object"||typeof r.createPolicy!="function")return null;let i=null;const l="data-tt-policy-suffix";o&&o.hasAttribute(l)&&(i=o.getAttribute(l));const h="dompurify"+(i?"#"+i:"");try{return r.createPolicy(h,{createHTML(R){return R},createScriptURL(R){return R}})}catch{return console.warn("TrustedTypes policy "+h+" could not be created."),null}},ye=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Ae(){let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:fn();const o=t=>Ae(t);if(o.version="3.2.6",o.removed=[],!r||!r.document||r.document.nodeType!==V.document||!r.Element)return o.isSupported=!1,o;let{document:i}=r;const l=i,h=l.currentScript,{DocumentFragment:R,HTMLTemplateElement:_e,Node:ct,Element:Mt,NodeFilter:F,NamedNodeMap:be=r.NamedNodeMap||r.MozNamedAttrMap,HTMLFormElement:Ne,DOMParser:Se,trustedTypes:Z}=r,W=Mt.prototype,Re=K(W,"cloneNode"),we=K(W,"remove"),Oe=K(W,"nextSibling"),Le=K(W,"childNodes"),J=K(W,"parentNode");if(typeof _e=="function"){const t=i.createElement("template");t.content&&t.content.ownerDocument&&(i=t.content.ownerDocument)}let T,B="";const{implementation:ut,createNodeIterator:ve,createDocumentFragment:De,getElementsByTagName:Ce}=i,{importNode:xe}=l;let E=ye();o.isSupported=typeof le=="function"&&typeof J=="function"&&ut&&ut.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:mt,ERB_EXPR:pt,TMPLIT_EXPR:ft,DATA_ATTR:ke,ARIA_ATTR:Ie,IS_SCRIPT_OR_DATA:Me,ATTR_WHITESPACE:Ut,CUSTOM_ELEMENT:Ue}=Ee;let{IS_ALLOWED_URI:Pt}=Ee,m=null;const Ht=a({},[...pe,...vt,...Dt,...Ct,...fe]);let f=null;const zt=a({},[...de,...xt,...ge,...st]);let u=Object.seal(ce(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),G=null,dt=null,Ft=!0,gt=!0,Wt=!1,Bt=!0,k=!1,Q=!0,C=!1,ht=!1,Tt=!1,I=!1,tt=!1,et=!1,Gt=!0,Yt=!1;const Pe="user-content-";let Et=!0,Y=!1,M={},U=null;const jt=a({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Xt=null;const qt=a({},["audio","video","img","source","image","track"]);let yt=null;const $t=a({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),nt="http://www.w3.org/1998/Math/MathML",ot="http://www.w3.org/2000/svg",O="http://www.w3.org/1999/xhtml";let P=O,At=!1,_t=null;const He=a({},[nt,ot,O],Lt);let rt=a({},["mi","mo","mn","ms","mtext"]),at=a({},["annotation-xml"]);const ze=a({},["title","style","font","a","script"]);let j=null;const Fe=["application/xhtml+xml","text/html"],We="text/html";let p=null,H=null;const Be=i.createElement("form"),Kt=function(t){return t instanceof RegExp||t instanceof Function},bt=function(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(H&&H===t)){if((!t||typeof t!="object")&&(t={}),t=D(t),j=Fe.indexOf(t.PARSER_MEDIA_TYPE)===-1?We:t.PARSER_MEDIA_TYPE,p=j==="application/xhtml+xml"?Lt:lt,m=S(t,"ALLOWED_TAGS")?a({},t.ALLOWED_TAGS,p):Ht,f=S(t,"ALLOWED_ATTR")?a({},t.ALLOWED_ATTR,p):zt,_t=S(t,"ALLOWED_NAMESPACES")?a({},t.ALLOWED_NAMESPACES,Lt):He,yt=S(t,"ADD_URI_SAFE_ATTR")?a(D($t),t.ADD_URI_SAFE_ATTR,p):$t,Xt=S(t,"ADD_DATA_URI_TAGS")?a(D(qt),t.ADD_DATA_URI_TAGS,p):qt,U=S(t,"FORBID_CONTENTS")?a({},t.FORBID_CONTENTS,p):jt,G=S(t,"FORBID_TAGS")?a({},t.FORBID_TAGS,p):D({}),dt=S(t,"FORBID_ATTR")?a({},t.FORBID_ATTR,p):D({}),M=S(t,"USE_PROFILES")?t.USE_PROFILES:!1,Ft=t.ALLOW_ARIA_ATTR!==!1,gt=t.ALLOW_DATA_ATTR!==!1,Wt=t.ALLOW_UNKNOWN_PROTOCOLS||!1,Bt=t.ALLOW_SELF_CLOSE_IN_ATTR!==!1,k=t.SAFE_FOR_TEMPLATES||!1,Q=t.SAFE_FOR_XML!==!1,C=t.WHOLE_DOCUMENT||!1,I=t.RETURN_DOM||!1,tt=t.RETURN_DOM_FRAGMENT||!1,et=t.RETURN_TRUSTED_TYPE||!1,Tt=t.FORCE_BODY||!1,Gt=t.SANITIZE_DOM!==!1,Yt=t.SANITIZE_NAMED_PROPS||!1,Et=t.KEEP_CONTENT!==!1,Y=t.IN_PLACE||!1,Pt=t.ALLOWED_URI_REGEXP||he,P=t.NAMESPACE||O,rt=t.MATHML_TEXT_INTEGRATION_POINTS||rt,at=t.HTML_INTEGRATION_POINTS||at,u=t.CUSTOM_ELEMENT_HANDLING||{},t.CUSTOM_ELEMENT_HANDLING&&Kt(t.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(u.tagNameCheck=t.CUSTOM_ELEMENT_HANDLING.tagNameCheck),t.CUSTOM_ELEMENT_HANDLING&&Kt(t.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(u.attributeNameCheck=t.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),t.CUSTOM_ELEMENT_HANDLING&&typeof t.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(u.allowCustomizedBuiltInElements=t.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),k&&(gt=!1),tt&&(I=!0),M&&(m=a({},fe),f=[],M.html===!0&&(a(m,pe),a(f,de)),M.svg===!0&&(a(m,vt),a(f,xt),a(f,st)),M.svgFilters===!0&&(a(m,Dt),a(f,xt),a(f,st)),M.mathMl===!0&&(a(m,Ct),a(f,ge),a(f,st))),t.ADD_TAGS&&(m===Ht&&(m=D(m)),a(m,t.ADD_TAGS,p)),t.ADD_ATTR&&(f===zt&&(f=D(f)),a(f,t.ADD_ATTR,p)),t.ADD_URI_SAFE_ATTR&&a(yt,t.ADD_URI_SAFE_ATTR,p),t.FORBID_CONTENTS&&(U===jt&&(U=D(U)),a(U,t.FORBID_CONTENTS,p)),Et&&(m["#text"]=!0),C&&a(m,["html","head","body"]),m.table&&(a(m,["tbody"]),delete G.tbody),t.TRUSTED_TYPES_POLICY){if(typeof t.TRUSTED_TYPES_POLICY.createHTML!="function")throw $('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof t.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw $('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');T=t.TRUSTED_TYPES_POLICY,B=T.createHTML("")}else T===void 0&&(T=dn(Z,h)),T!==null&&typeof B=="string"&&(B=T.createHTML(""));y&&y(t),H=t}},Vt=a({},[...vt,...Dt,...nn]),Zt=a({},[...Ct,...on]),Ge=function(t){let n=J(t);(!n||!n.tagName)&&(n={namespaceURI:P,tagName:"template"});const e=lt(t.tagName),s=lt(n.tagName);return _t[t.namespaceURI]?t.namespaceURI===ot?n.namespaceURI===O?e==="svg":n.namespaceURI===nt?e==="svg"&&(s==="annotation-xml"||rt[s]):!!Vt[e]:t.namespaceURI===nt?n.namespaceURI===O?e==="math":n.namespaceURI===ot?e==="math"&&at[s]:!!Zt[e]:t.namespaceURI===O?n.namespaceURI===ot&&!at[s]||n.namespaceURI===nt&&!rt[s]?!1:!Zt[e]&&(ze[e]||!Vt[e]):!!(j==="application/xhtml+xml"&&_t[t.namespaceURI]):!1},x=function(t){X(o.removed,{element:t});try{J(t).removeChild(t)}catch{we(t)}},z=function(t,n){try{X(o.removed,{attribute:n.getAttributeNode(t),from:n})}catch{X(o.removed,{attribute:null,from:n})}if(n.removeAttribute(t),t==="is")if(I||tt)try{x(n)}catch{}else try{n.setAttribute(t,"")}catch{}},Jt=function(t){let n=null,e=null;if(Tt)t="<remove></remove>"+t;else{const c=me(t,/^[\r\n\t ]+/);e=c&&c[0]}j==="application/xhtml+xml"&&P===O&&(t='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+t+"</body></html>");const s=T?T.createHTML(t):t;if(P===O)try{n=new Se().parseFromString(s,j)}catch{}if(!n||!n.documentElement){n=ut.createDocument(P,"template",null);try{n.documentElement.innerHTML=At?B:s}catch{}}const d=n.body||n.documentElement;return t&&e&&d.insertBefore(i.createTextNode(e),d.childNodes[0]||null),P===O?Ce.call(n,C?"html":"body")[0]:C?n.documentElement:d},Qt=function(t){return ve.call(t.ownerDocument||t,t,F.SHOW_ELEMENT|F.SHOW_COMMENT|F.SHOW_TEXT|F.SHOW_PROCESSING_INSTRUCTION|F.SHOW_CDATA_SECTION,null)},Nt=function(t){return t instanceof Ne&&(typeof t.nodeName!="string"||typeof t.textContent!="string"||typeof t.removeChild!="function"||!(t.attributes instanceof be)||typeof t.removeAttribute!="function"||typeof t.setAttribute!="function"||typeof t.namespaceURI!="string"||typeof t.insertBefore!="function"||typeof t.hasChildNodes!="function")},te=function(t){return typeof ct=="function"&&t instanceof ct};function L(t,n,e){it(t,s=>{s.call(o,n,e,H)})}const ee=function(t){let n=null;if(L(E.beforeSanitizeElements,t,null),Nt(t))return x(t),!0;const e=p(t.nodeName);if(L(E.uponSanitizeElement,t,{tagName:e,allowedTags:m}),Q&&t.hasChildNodes()&&!te(t.firstElementChild)&&A(/<[/\w!]/g,t.innerHTML)&&A(/<[/\w!]/g,t.textContent)||t.nodeType===V.progressingInstruction||Q&&t.nodeType===V.comment&&A(/<[/\w]/g,t.data))return x(t),!0;if(!m[e]||G[e]){if(!G[e]&&oe(e)&&(u.tagNameCheck instanceof RegExp&&A(u.tagNameCheck,e)||u.tagNameCheck instanceof Function&&u.tagNameCheck(e)))return!1;if(Et&&!U[e]){const s=J(t)||t.parentNode,d=Le(t)||t.childNodes;if(d&&s){const c=d.length;for(let v=c-1;v>=0;--v){const N=Re(d[v],!0);N.__removalCount=(t.__removalCount||0)+1,s.insertBefore(N,Oe(t))}}}return x(t),!0}return t instanceof Mt&&!Ge(t)||(e==="noscript"||e==="noembed"||e==="noframes")&&A(/<\/no(script|embed|frames)/i,t.innerHTML)?(x(t),!0):(k&&t.nodeType===V.text&&(n=t.textContent,it([mt,pt,ft],s=>{n=q(n,s," ")}),t.textContent!==n&&(X(o.removed,{element:t.cloneNode()}),t.textContent=n)),L(E.afterSanitizeElements,t,null),!1)},ne=function(t,n,e){if(Gt&&(n==="id"||n==="name")&&(e in i||e in Be))return!1;if(!(gt&&!dt[n]&&A(ke,n))&&!(Ft&&A(Ie,n))){if(!f[n]||dt[n]){if(!(oe(t)&&(u.tagNameCheck instanceof RegExp&&A(u.tagNameCheck,t)||u.tagNameCheck instanceof Function&&u.tagNameCheck(t))&&(u.attributeNameCheck instanceof RegExp&&A(u.attributeNameCheck,n)||u.attributeNameCheck instanceof Function&&u.attributeNameCheck(n))||n==="is"&&u.allowCustomizedBuiltInElements&&(u.tagNameCheck instanceof RegExp&&A(u.tagNameCheck,e)||u.tagNameCheck instanceof Function&&u.tagNameCheck(e))))return!1}else if(!yt[n]&&!A(Pt,q(e,Ut,""))&&!((n==="src"||n==="xlink:href"||n==="href")&&t!=="script"&&Je(e,"data:")===0&&Xt[t])&&!(Wt&&!A(Me,q(e,Ut,"")))&&e)return!1}return!0},oe=function(t){return t!=="annotation-xml"&&me(t,Ue)},re=function(t){L(E.beforeSanitizeAttributes,t,null);const{attributes:n}=t;if(!n||Nt(t))return;const e={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:f,forceKeepAttr:void 0};let s=n.length;for(;s--;){const d=n[s],{name:c,namespaceURI:v,value:N}=d,w=p(c),St=N;let g=c==="value"?St:Qe(St);if(e.attrName=w,e.attrValue=g,e.keepAttr=!0,e.forceKeepAttr=void 0,L(E.uponSanitizeAttribute,t,e),g=e.attrValue,Yt&&(w==="id"||w==="name")&&(z(c,t),g=Pe+g),Q&&A(/((--!?|])>)|<\/(style|title)/i,g)){z(c,t);continue}if(e.forceKeepAttr)continue;if(!e.keepAttr){z(c,t);continue}if(!Bt&&A(/\/>/i,g)){z(c,t);continue}k&&it([mt,pt,ft],je=>{g=q(g,je," ")});const ae=p(t.nodeName);if(!ne(ae,w,g)){z(c,t);continue}if(T&&typeof Z=="object"&&typeof Z.getAttributeType=="function"&&!v)switch(Z.getAttributeType(ae,w)){case"TrustedHTML":{g=T.createHTML(g);break}case"TrustedScriptURL":{g=T.createScriptURL(g);break}}if(g!==St)try{v?t.setAttributeNS(v,c,g):t.setAttribute(c,g),Nt(t)?x(t):ue(o.removed)}catch{z(c,t)}}L(E.afterSanitizeAttributes,t,null)},Ye=function t(n){let e=null;const s=Qt(n);for(L(E.beforeSanitizeShadowDOM,n,null);e=s.nextNode();)L(E.uponSanitizeShadowNode,e,null),ee(e),re(e),e.content instanceof R&&t(e.content);L(E.afterSanitizeShadowDOM,n,null)};return o.sanitize=function(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},e=null,s=null,d=null,c=null;if(At=!t,At&&(t="<!-->"),typeof t!="string"&&!te(t))if(typeof t.toString=="function"){if(t=t.toString(),typeof t!="string")throw $("dirty is not a string, aborting")}else throw $("toString is not a function");if(!o.isSupported)return t;if(ht||bt(n),o.removed=[],typeof t=="string"&&(Y=!1),Y){if(t.nodeName){const w=p(t.nodeName);if(!m[w]||G[w])throw $("root node is forbidden and cannot be sanitized in-place")}}else if(t instanceof ct)e=Jt("<!---->"),s=e.ownerDocument.importNode(t,!0),s.nodeType===V.element&&s.nodeName==="BODY"||s.nodeName==="HTML"?e=s:e.appendChild(s);else{if(!I&&!k&&!C&&t.indexOf("<")===-1)return T&&et?T.createHTML(t):t;if(e=Jt(t),!e)return I?null:et?B:""}e&&Tt&&x(e.firstChild);const v=Qt(Y?t:e);for(;d=v.nextNode();)ee(d),re(d),d.content instanceof R&&Ye(d.content);if(Y)return t;if(I){if(tt)for(c=De.call(e.ownerDocument);e.firstChild;)c.appendChild(e.firstChild);else c=e;return(f.shadowroot||f.shadowrootmode)&&(c=xe.call(l,c,!0)),c}let N=C?e.outerHTML:e.innerHTML;return C&&m["!doctype"]&&e.ownerDocument&&e.ownerDocument.doctype&&e.ownerDocument.doctype.name&&A(Te,e.ownerDocument.doctype.name)&&(N="<!DOCTYPE "+e.ownerDocument.doctype.name+`>
2
2
  `+N),k&&it([mt,pt,ft],w=>{N=q(N,w," ")}),T&&et?T.createHTML(N):N},o.setConfig=function(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};bt(t),ht=!0},o.clearConfig=function(){H=null,ht=!1},o.isValidAttribute=function(t,n,e){H||bt({});const s=p(t),d=p(n);return ne(s,d,e)},o.addHook=function(t,n){typeof n=="function"&&X(E[t],n)},o.removeHook=function(t,n){if(n!==void 0){const e=Ve(E[t],n);return e===-1?void 0:Ze(E[t],e,1)[0]}return ue(E[t])},o.removeHooks=function(t){E[t]=[]},o.removeAllHooks=function(){E=ye()},o}var kt=Ae();const gn=Xe("div",{target:"e18540fl0"})({name:"1d3w5wq",styles:"width:100%"}),It="data-temp-href-target";kt.addHook("beforeSanitizeAttributes",function(r){r instanceof HTMLElement&&r.hasAttribute("target")&&r.getAttribute("target")==="_blank"&&r.setAttribute(It,"_blank")}),kt.addHook("afterSanitizeAttributes",function(r){r instanceof HTMLElement&&r.hasAttribute(It)&&(r.setAttribute("target","_blank"),r.setAttribute("rel","noopener noreferrer"),r.removeAttribute(It))});const hn=r=>{const o={USE_PROFILES:{html:!0},FORCE_BODY:!0};return kt.sanitize(r,o)};function Tn({element:r}){const{body:o}=r,i=ie.useMemo(()=>hn(o),[o]);return Rt.jsx(Rt.Fragment,{children:i&&Rt.jsx(gn,{className:"stHtml","data-testid":"stHtml",dangerouslySetInnerHTML:{__html:i}})})}const En=ie.memo(Tn);export{En as default};
@@ -1 +1 @@
1
- import{cO as c,a$ as i,bv as f,cP as u}from"./index-DCNLpqIv.js";function p(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){for(var o=0;o<t.length;o++){var r=t[o];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,c(r.key),r)}}function b(e,t,o){return t&&a(e.prototype,t),o&&a(e,o),Object.defineProperty(e,"prototype",{writable:!1}),e}function s(e,t){if(t&&(i(t)=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return f(e)}function n(e){return n=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},n(e)}function l(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&u(e,t)}export{l as _,b as a,p as b,n as c,s as d};
1
+ import{cO as c,a$ as i,bv as f,cP as u}from"./index-B2QqSXxG.js";function p(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){for(var o=0;o<t.length;o++){var r=t[o];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,c(r.key),r)}}function b(e,t,o){return t&&a(e.prototype,t),o&&a(e,o),Object.defineProperty(e,"prototype",{writable:!1}),e}function s(e,t){if(t&&(i(t)=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return f(e)}function n(e){return n=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},n(e)}function l(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&u(e,t)}export{l as _,b as a,p as b,n as c,s as d};
@@ -1,2 +1,2 @@
1
- import{c4 as m,r as f,cW as W,c$ as S,cY as p}from"./index-DCNLpqIv.js";import{R as Y,c as P,d as G,B as H}from"./base-input-D2OIsCyG.js";function v(t){"@babel/helpers - typeof";return v=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},v(t)}var J=["Root","StartEnhancer","EndEnhancer"],K=["startEnhancer","endEnhancer","overrides"];function i(){return i=Object.assign?Object.assign.bind():function(t){for(var r=1;r<arguments.length;r++){var n=arguments[r];for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])}return t},i.apply(this,arguments)}function O(t,r){return V(t)||Q(t,r)||N(t,r)||L()}function L(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
1
+ import{c4 as m,r as f,cW as W,c$ as S,cY as p}from"./index-B2QqSXxG.js";import{R as Y,c as P,d as G,B as H}from"./base-input-Bu7lYJya.js";function v(t){"@babel/helpers - typeof";return v=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},v(t)}var J=["Root","StartEnhancer","EndEnhancer"],K=["startEnhancer","endEnhancer","overrides"];function i(){return i=Object.assign?Object.assign.bind():function(t){for(var r=1;r<arguments.length;r++){var n=arguments[r];for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])}return t},i.apply(this,arguments)}function O(t,r){return V(t)||Q(t,r)||N(t,r)||L()}function L(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
2
2
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function N(t,r){if(t){if(typeof t=="string")return F(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 F(t,r)}}function F(t,r){(r==null||r>t.length)&&(r=t.length);for(var n=0,e=new Array(r);n<r;n++)e[n]=t[n];return e}function Q(t,r){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var e=[],o=!0,u=!1,a,c;try{for(n=n.call(t);!(o=(a=n.next()).done)&&(e.push(a.value),!(r&&e.length===r));o=!0);}catch(d){u=!0,c=d}finally{try{!o&&n.return!=null&&n.return()}finally{if(u)throw c}}return e}}function V(t){if(Array.isArray(t))return t}function R(t,r){if(t==null)return{};var n=X(t,r),e,o;if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(t);for(o=0;o<u.length;o++)e=u[o],!(r.indexOf(e)>=0)&&Object.prototype.propertyIsEnumerable.call(t,e)&&(n[e]=t[e])}return n}function X(t,r){if(t==null)return{};var n={},e=Object.keys(t),o,u;for(u=0;u<e.length;u++)o=e[u],!(r.indexOf(o)>=0)&&(n[o]=t[o]);return n}function Z(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function tt(t,r){for(var n=0;n<r.length;n++){var e=r[n];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(t,e.key,e)}}function rt(t,r,n){return r&&tt(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function et(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&&g(t,r)}function g(t,r){return g=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,e){return n.__proto__=e,n},g(t,r)}function nt(t){var r=ut();return function(){var n=b(t),e;if(r){var o=b(this).constructor;e=Reflect.construct(n,arguments,o)}else e=n.apply(this,arguments);return ot(this,e)}}function ot(t,r){if(r&&(v(r)==="object"||typeof r=="function"))return r;if(r!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return y(t)}function y(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function ut(){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 b(t){return b=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},b(t)}function h(t,r,n){return r in t?Object.defineProperty(t,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[r]=n,t}var B=function(t){et(n,t);var r=nt(n);function n(){var e;Z(this,n);for(var o=arguments.length,u=new Array(o),a=0;a<o;a++)u[a]=arguments[a];return e=r.call.apply(r,[this].concat(u)),h(y(e),"state",{isFocused:e.props.autoFocus||!1}),h(y(e),"onFocus",function(c){e.setState({isFocused:!0}),e.props.onFocus(c)}),h(y(e),"onBlur",function(c){e.setState({isFocused:!1}),e.props.onBlur(c)}),e}return rt(n,[{key:"render",value:function(){var e=this.props,o=e.startEnhancer,u=e.endEnhancer,a=e.overrides,c=a.Root,d=a.StartEnhancer,x=a.EndEnhancer,A=R(a,J),I=R(e,K),$=m(c,Y),j=O($,2),T=j[0],C=j[1],k=m(d,P),w=O(k,2),q=w[0],z=w[1],D=m(x,P),E=O(D,2),M=E[0],U=E[1],s=G(this.props,this.state);return f.createElement(T,i({"data-baseweb":"input"},s,C,{$adjoined:_(o,u),$hasIconTrailing:this.props.clearable||this.props.type=="password"}),l(o)&&f.createElement(q,i({},s,z,{$position:S.start}),typeof o=="function"?o(s):o),f.createElement(H,i({},I,{overrides:A,adjoined:_(o,u),onFocus:this.onFocus,onBlur:this.onBlur})),l(u)&&f.createElement(M,i({},s,U,{$position:S.end}),typeof u=="function"?u(s):u))}}]),n}(f.Component);h(B,"defaultProps",{autoComplete:"on",autoFocus:!1,disabled:!1,name:"",onBlur:function(){},onFocus:function(){},overrides:{},required:!1,size:W.default,startEnhancer:null,endEnhancer:null,clearable:!1,type:"text",readOnly:!1});function _(t,r){return l(t)&&l(r)?p.both:l(t)?p.left:l(r)?p.right:p.none}function l(t){return!!(t||t===0)}export{B as I};
@@ -1 +1 @@
1
- import{c as p,e as y}from"./es6-D9GNxEuI.js";import"./index-DCNLpqIv.js";const{File:r,Blob:_,DOMException:s}=p,{INVALID:z,GONE:n,MISMATCH:f,MOD_ERR:m,SYNTAX:w,SECURITY:A,DISALLOWED:b}=y;class c{constructor(i,e){this.fileHandle=i,this.file=e,this.size=e.size,this.position=0}write(i){let e=this.file;if(typeof i=="object"){if(i.type==="write"){if(Number.isInteger(i.position)&&i.position>=0&&(this.position=i.position,this.size<i.position&&(this.file=new r([this.file,new ArrayBuffer(i.position-this.size)],this.file.name,this.file))),!("data"in i))throw new s(...w("write requires a data argument"));i=i.data}else if(i.type==="seek")if(Number.isInteger(i.position)&&i.position>=0){if(this.size<i.position)throw new s(...z);this.position=i.position;return}else throw new s(...w("seek requires a position argument"));else if(i.type==="truncate")if(Number.isInteger(i.size)&&i.size>=0){e=i.size<this.size?new r([e.slice(0,i.size)],e.name,e):new r([e,new Uint8Array(i.size-this.size)],e.name),this.size=e.size,this.position>e.size&&(this.position=e.size),this.file=e;return}else throw new s(...w("truncate requires a size argument"))}i=new _([i]);let t=this.file;const o=t.slice(0,this.position),u=t.slice(this.position+i.size);let a=this.position-o.size;a<0&&(a=0),t=new r([o,new Uint8Array(a),i,u],t.name),this.size=t.size,this.position+=i.size,this.file=t}close(){if(this.fileHandle._deleted)throw new s(...n);this.fileHandle._file=this.file,this.file=this.position=this.size=null,this.fileHandle.onclose&&this.fileHandle.onclose(this.fileHandle)}}class h{constructor(i="",e=new r([],i),t=!0){this._file=e,this.name=i,this.kind="file",this._deleted=!1,this.writable=t,this.readable=!0}async getFile(){if(this._deleted)throw new s(...n);return this._file}async createWritable(i){if(!this.writable)throw new s(...b);if(this._deleted)throw new s(...n);const e=i.keepExistingData?await this.getFile():new r([],this.name);return new c(this,e)}async isSameEntry(i){return this===i}async _destroy(){this._deleted=!0,this._file=null}}class l{constructor(i,e=!0){this.name=i,this.kind="directory",this._deleted=!1,this._entries={},this.writable=e,this.readable=!0}async*entries(){if(this._deleted)throw new s(...n);yield*Object.entries(this._entries)}async isSameEntry(i){return this===i}async getDirectoryHandle(i,e){if(this._deleted)throw new s(...n);const t=this._entries[i];if(t){if(t instanceof h)throw new s(...f);return t}else{if(e.create)return this._entries[i]=new l(i);throw new s(...n)}}async getFileHandle(i,e){const t=this._entries[i],o=t instanceof h;if(t&&o)return t;if(t&&!o)throw new s(...f);if(!t&&!e.create)throw new s(...n);if(!t&&e.create)return this._entries[i]=new h(i)}async removeEntry(i,e){const t=this._entries[i];if(!t)throw new s(...n);await t._destroy(e.recursive),delete this._entries[i]}async _destroy(i){for(let e of Object.values(this._entries)){if(!i)throw new s(...m);await e._destroy(i)}this._entries={},this._deleted=!0}}const g=new l(""),H=()=>g;export{h as FileHandle,l as FolderHandle,c as Sink,H as default};
1
+ import{c as p,e as y}from"./es6-lWl2HAKQ.js";import"./index-B2QqSXxG.js";const{File:r,Blob:_,DOMException:s}=p,{INVALID:z,GONE:n,MISMATCH:f,MOD_ERR:m,SYNTAX:w,SECURITY:A,DISALLOWED:b}=y;class c{constructor(i,e){this.fileHandle=i,this.file=e,this.size=e.size,this.position=0}write(i){let e=this.file;if(typeof i=="object"){if(i.type==="write"){if(Number.isInteger(i.position)&&i.position>=0&&(this.position=i.position,this.size<i.position&&(this.file=new r([this.file,new ArrayBuffer(i.position-this.size)],this.file.name,this.file))),!("data"in i))throw new s(...w("write requires a data argument"));i=i.data}else if(i.type==="seek")if(Number.isInteger(i.position)&&i.position>=0){if(this.size<i.position)throw new s(...z);this.position=i.position;return}else throw new s(...w("seek requires a position argument"));else if(i.type==="truncate")if(Number.isInteger(i.size)&&i.size>=0){e=i.size<this.size?new r([e.slice(0,i.size)],e.name,e):new r([e,new Uint8Array(i.size-this.size)],e.name),this.size=e.size,this.position>e.size&&(this.position=e.size),this.file=e;return}else throw new s(...w("truncate requires a size argument"))}i=new _([i]);let t=this.file;const o=t.slice(0,this.position),u=t.slice(this.position+i.size);let a=this.position-o.size;a<0&&(a=0),t=new r([o,new Uint8Array(a),i,u],t.name),this.size=t.size,this.position+=i.size,this.file=t}close(){if(this.fileHandle._deleted)throw new s(...n);this.fileHandle._file=this.file,this.file=this.position=this.size=null,this.fileHandle.onclose&&this.fileHandle.onclose(this.fileHandle)}}class h{constructor(i="",e=new r([],i),t=!0){this._file=e,this.name=i,this.kind="file",this._deleted=!1,this.writable=t,this.readable=!0}async getFile(){if(this._deleted)throw new s(...n);return this._file}async createWritable(i){if(!this.writable)throw new s(...b);if(this._deleted)throw new s(...n);const e=i.keepExistingData?await this.getFile():new r([],this.name);return new c(this,e)}async isSameEntry(i){return this===i}async _destroy(){this._deleted=!0,this._file=null}}class l{constructor(i,e=!0){this.name=i,this.kind="directory",this._deleted=!1,this._entries={},this.writable=e,this.readable=!0}async*entries(){if(this._deleted)throw new s(...n);yield*Object.entries(this._entries)}async isSameEntry(i){return this===i}async getDirectoryHandle(i,e){if(this._deleted)throw new s(...n);const t=this._entries[i];if(t){if(t instanceof h)throw new s(...f);return t}else{if(e.create)return this._entries[i]=new l(i);throw new s(...n)}}async getFileHandle(i,e){const t=this._entries[i],o=t instanceof h;if(t&&o)return t;if(t&&!o)throw new s(...f);if(!t&&!e.create)throw new s(...n);if(!t&&e.create)return this._entries[i]=new h(i)}async removeEntry(i,e){const t=this._entries[i];if(!t)throw new s(...n);await t._destroy(e.recursive),delete this._entries[i]}async _destroy(i){for(let e of Object.values(this._entries)){if(!i)throw new s(...m);await e._destroy(i)}this._entries={},this._deleted=!0}}const g=new l(""),H=()=>g;export{h as FileHandle,l as FolderHandle,c as Sink,H as default};
@@ -1 +1 @@
1
- import{bo as e,bp as f,g as m}from"./index-DCNLpqIv.js";var r,a;function p(){if(a)return r;a=1;var t=e(),n=f(),o=n(function(i,s,u,c){t(i,s,u,c)});return r=o,r}var v=p();const b=m(v);export{b as m};
1
+ import{bo as e,bp as f,g as m}from"./index-B2QqSXxG.js";var r,a;function p(){if(a)return r;a=1;var t=e(),n=f(),o=n(function(i,s,u,c){t(i,s,u,c)});return r=o,r}var v=p();const b=m(v);export{b as m};
@@ -1,4 +1,4 @@
1
- import{R as X,r as R}from"./index-DCNLpqIv.js";import{s as Re}from"./index-DhqQeff3.js";import"./withFullScreenWrapper-C3PKUCi4.js";import"./Toolbar-DiWCQxr5.js";import"./FormClearHelper-fvwQICEk.js";import"./mergeWith-fWFIuGgc.js";import"./sprintf-D7DtBTRn.js";import"./checkbox-BNaalk8J.js";import"./createDownloadLinkElement-ZaXNnPK4.js";import"./slicedToArray-CgI3PJi3.js";import"./inherits-BWX75f6B.js";import"./createSuper-CQM18OGw.js";import"./FileDownload.esm-kSzyJagP.js";const Te=Re("div")({name:"NumberOverlayEditorStyle",class:"gdg-n15fjm3e",propsAsIs:!1});function de(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,n=Object.getOwnPropertySymbols(e);a<n.length;a++)t.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(r[n[a]]=e[n[a]]);return r}var re;(function(e){e.event="event",e.props="prop"})(re||(re={}));function J(){}function Fe(e){var t,r=void 0;return function(){for(var n=[],a=arguments.length;a--;)n[a]=arguments[a];return t&&n.length===t.length&&n.every(function(u,l){return u===t[l]})||(t=n,r=e.apply(void 0,n)),r}}function ae(e){return!!(e||"").match(/\d/)}function Y(e){return e==null}function Be(e){return typeof e=="number"&&isNaN(e)}function me(e){return Y(e)||Be(e)||typeof e=="number"&&!isFinite(e)}function ge(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}function Me(e){switch(e){case"lakh":return/(\d+?)(?=(\d\d)+(\d)(?!\d))(\.\d+)?/g;case"wan":return/(\d)(?=(\d{4})+(?!\d))/g;case"thousand":default:return/(\d)(?=(\d{3})+(?!\d))/g}}function ke(e,t,r){var n=Me(r),a=e.search(/[1-9]/);return a=a===-1?e.length:a,e.substring(0,a)+e.substring(a,e.length).replace(n,"$1"+t)}function We(e){var t=R.useRef(e);t.current=e;var r=R.useRef(function(){for(var n=[],a=arguments.length;a--;)n[a]=arguments[a];return t.current.apply(t,n)});return r.current}function se(e,t){t===void 0&&(t=!0);var r=e[0]==="-",n=r&&t;e=e.replace("-","");var a=e.split("."),u=a[0],l=a[1]||"";return{beforeDecimal:u,afterDecimal:l,hasNegation:r,addNegation:n}}function Le(e){if(!e)return e;var t=e[0]==="-";t&&(e=e.substring(1,e.length));var r=e.split("."),n=r[0].replace(/^0+/,"")||"0",a=r[1]||"";return(t?"-":"")+n+(a?"."+a:"")}function pe(e,t,r){for(var n="",a=r?"0":"",u=0;u<=t-1;u++)n+=e[u]||a;return n}function he(e,t){return Array(t+1).join(e)}function Se(e){var t=e+"",r=t[0]==="-"?"-":"";r&&(t=t.substring(1));var n=t.split(/[eE]/g),a=n[0],u=n[1];if(u=Number(u),!u)return r+a;a=a.replace(".","");var l=1+u,g=a.length;return l<0?a="0."+he("0",Math.abs(l))+a:l>=g?a=a+he("0",l-g):a=(a.substring(0,l)||"0")+"."+a.substring(l),r+a}function be(e,t,r){if(["","-"].indexOf(e)!==-1)return e;var n=(e.indexOf(".")!==-1||r)&&t,a=se(e),u=a.beforeDecimal,l=a.afterDecimal,g=a.hasNegation,h=parseFloat("0."+(l||"0")),S=l.length<=t?"0."+l:h.toFixed(t),p=S.split("."),v=u;u&&Number(p[0])&&(v=u.split("").reverse().reduce(function(O,E,m){return O.length>m?(Number(O[0])+Number(E)).toString()+O.substring(1,O.length):E+O},p[0]));var V=pe(p[1]||"",t,r),b=g?"-":"",s=n?".":"";return""+b+v+s+V}function G(e,t){if(e.value=e.value,e!==null){if(e.createTextRange){var r=e.createTextRange();return r.move("character",t),r.select(),!0}return e.selectionStart||e.selectionStart===0?(e.focus(),e.setSelectionRange(t,t),!0):(e.focus(),!1)}}var ye=Fe(function(e,t){for(var r=0,n=0,a=e.length,u=t.length;e[r]===t[r]&&r<a;)r++;for(;e[a-1-n]===t[u-1-n]&&u-n>r&&a-n>r;)n++;return{from:{start:r,end:a-n},to:{start:r,end:u-n}}}),Pe=function(e,t){var r=Math.min(e.selectionStart,t);return{from:{start:r,end:e.selectionEnd},to:{start:r,end:t}}};function Ke(e,t,r){return Math.min(Math.max(e,t),r)}function fe(e){return Math.max(e.selectionStart,e.selectionEnd)}function Ue(){return typeof navigator<"u"&&!(navigator.platform&&/iPhone|iPod/.test(navigator.platform))}function _e(e){return{from:{start:0,end:0},to:{start:0,end:e.length},lastValue:""}}function $e(e){var t=e.currentValue,r=e.formattedValue,n=e.currentValueIndex,a=e.formattedValueIndex;return t[n]===r[a]}function ze(e,t,r,n,a,u,l){l===void 0&&(l=$e);var g=a.findIndex(function(L){return L}),h=e.slice(0,g);!t&&!r.startsWith(h)&&(t=h,r=h+r,n=n+h.length);for(var S=r.length,p=e.length,v={},V=new Array(S),b=0;b<S;b++){V[b]=-1;for(var s=0,O=p;s<O;s++){var E=l({currentValue:r,lastValue:t,formattedValue:e,currentValueIndex:b,formattedValueIndex:s});if(E&&v[s]!==!0){V[b]=s,v[s]=!0;break}}}for(var m=n;m<S&&(V[m]===-1||!u(r[m]));)m++;var T=m===S||V[m]===-1?p:V[m];for(m=n-1;m>0&&V[m]===-1;)m--;var F=m===-1||V[m]===-1?0:V[m]+1;return F>T?T:n-F<T-n?F:T}function Ve(e,t,r,n){var a=e.length;if(t=Ke(t,0,a),n==="left"){for(;t>=0&&!r[t];)t--;t===-1&&(t=r.indexOf(!0))}else{for(;t<=a&&!r[t];)t++;t>a&&(t=r.lastIndexOf(!0))}return t===-1&&(t=a),t}function Je(e){for(var t=Array.from({length:e.length+1}).map(function(){return!0}),r=0,n=t.length;r<n;r++)t[r]=!!(ae(e[r])||ae(e[r-1]));return t}function we(e,t,r,n,a,u){u===void 0&&(u=J);var l=We(function(s,O){var E,m;return me(s)?(m="",E=""):typeof s=="number"||O?(m=typeof s=="number"?Se(s):s,E=n(m)):(m=a(s,void 0),E=n(m)),{formattedValue:E,numAsString:m}}),g=R.useState(function(){return l(Y(e)?t:e,r)}),h=g[0],S=g[1],p=function(s,O){s.formattedValue!==h.formattedValue&&S({formattedValue:s.formattedValue,numAsString:s.value}),u(s,O)},v=e,V=r;Y(e)&&(v=h.numAsString,V=!0);var b=l(v,V);return R.useMemo(function(){S(b)},[b.formattedValue]),[h,p]}function Ze(e){return e.replace(/[^0-9]/g,"")}function qe(e){return e}function Ge(e){var t=e.type;t===void 0&&(t="text");var r=e.displayType;r===void 0&&(r="input");var n=e.customInput,a=e.renderText,u=e.getInputRef,l=e.format;l===void 0&&(l=qe);var g=e.removeFormatting;g===void 0&&(g=Ze);var h=e.defaultValue,S=e.valueIsNumericString,p=e.onValueChange,v=e.isAllowed,V=e.onChange;V===void 0&&(V=J);var b=e.onKeyDown;b===void 0&&(b=J);var s=e.onMouseUp;s===void 0&&(s=J);var O=e.onFocus;O===void 0&&(O=J);var E=e.onBlur;E===void 0&&(E=J);var m=e.value,T=e.getCaretBoundary;T===void 0&&(T=Je);var F=e.isValidInputCharacter;F===void 0&&(F=ae);var L=e.isCharacterSame,M=de(e,["type","displayType","customInput","renderText","getInputRef","format","removeFormatting","defaultValue","valueIsNumericString","onValueChange","isAllowed","onChange","onKeyDown","onMouseUp","onFocus","onBlur","value","getCaretBoundary","isValidInputCharacter","isCharacterSame"]),Z=we(m,h,!!S,l,g,p),P=Z[0],w=P.formattedValue,k=P.numAsString,q=Z[1],W=R.useRef(),U=R.useRef({formattedValue:w,numAsString:k}),_=function(o,i){U.current={formattedValue:o.formattedValue,numAsString:o.value},q(o,i)},Q=R.useState(!1),ee=Q[0],d=Q[1],c=R.useRef(null),x=R.useRef({setCaretTimeout:null,focusTimeout:null});R.useEffect(function(){return d(!0),function(){clearTimeout(x.current.setCaretTimeout),clearTimeout(x.current.focusTimeout)}},[]);var C=l,j=function(o,i){var f=parseFloat(i);return{formattedValue:o,value:i,floatValue:isNaN(f)?void 0:f}},A=function(o,i,f){o.selectionStart===0&&o.selectionEnd===o.value.length||(G(o,i),x.current.setCaretTimeout=setTimeout(function(){o.value===f&&o.selectionStart!==i&&G(o,i)},0))},I=function(o,i,f){return Ve(o,i,T(o),f)},H=function(o,i,f){var D=T(i),B=ze(i,w,o,f,D,F,L);return B=Ve(i,B,D),B},oe=function(o){var i=o.formattedValue;i===void 0&&(i="");var f=o.input,D=o.source,B=o.event,N=o.numAsString,y;if(f){var K=o.inputValue||f.value,$=fe(f);f.value=i,y=H(K,i,$),y!==void 0&&A(f,y,i)}i!==w&&_(j(i,N),{event:B,source:D})};R.useEffect(function(){var o=U.current,i=o.formattedValue,f=o.numAsString;(w!==i||k!==f)&&_(j(w,k),{event:void 0,source:re.props})},[w,k]);var te=c.current?fe(c.current):void 0,ne=typeof window<"u"?R.useLayoutEffect:R.useEffect;ne(function(){var o=c.current;if(w!==U.current.formattedValue&&o){var i=H(U.current.formattedValue,w,te);o.value=w,A(o,i,w)}},[w]);var ie=function(o,i,f){var D=i.target,B=W.current?Pe(W.current,D.selectionEnd):ye(w,o),N=Object.assign(Object.assign({},B),{lastValue:w}),y=g(o,N),K=C(y);if(y=g(K,void 0),v&&!v(j(K,y))){var $=i.target,z=fe($),ce=H(o,w,z);return $.value=w,A($,ce,w),!1}return oe({formattedValue:K,numAsString:y,inputValue:o,event:i,source:f,input:i.target}),!0},le=function(o,i){i===void 0&&(i=0);var f=o.selectionStart,D=o.selectionEnd;W.current={selectionStart:f,selectionEnd:D+i}},Ne=function(o){var i=o.target,f=i.value,D=ie(f,o,re.event);D&&V(o),W.current=void 0},Oe=function(o){var i=o.target,f=o.key,D=i.selectionStart,B=i.selectionEnd,N=i.value;N===void 0&&(N="");var y;f==="ArrowLeft"||f==="Backspace"?y=Math.max(D-1,0):f==="ArrowRight"?y=Math.min(D+1,N.length):f==="Delete"&&(y=D);var K=0;f==="Delete"&&D===B&&(K=1);var $=f==="ArrowLeft"||f==="ArrowRight";if(y===void 0||D!==B&&!$){b(o),le(i,K);return}var z=y;if($){var ce=f==="ArrowLeft"?"left":"right";z=I(N,y,ce),z!==y&&o.preventDefault()}else f==="Delete"&&!F(N[y])?z=I(N,y,"right"):f==="Backspace"&&!F(N[y])&&(z=I(N,y,"left"));z!==y&&A(i,z,N),b(o),le(i,K)},Ee=function(o){var i=o.target,f=function(){var D=i.selectionStart,B=i.selectionEnd,N=i.value;if(N===void 0&&(N=""),D===B){var y=I(N,D);y!==D&&A(i,y,N)}};f(),requestAnimationFrame(function(){f()}),s(o),le(i)},Ae=function(o){o.persist&&o.persist();var i=o.target,f=o.currentTarget;c.current=i,x.current.focusTimeout=setTimeout(function(){var D=i.selectionStart,B=i.selectionEnd,N=i.value;N===void 0&&(N="");var y=I(N,D);y!==D&&!(D===0&&B===N.length)&&A(i,y,N),O(Object.assign(Object.assign({},o),{currentTarget:f}))},0)},Ce=function(o){c.current=null,clearTimeout(x.current.focusTimeout),clearTimeout(x.current.setCaretTimeout),E(o)},je=ee&&Ue()?"numeric":void 0,ve=Object.assign({inputMode:je},M,{type:t,value:w,onChange:Ne,onKeyDown:Oe,onMouseUp:Ee,onFocus:Ae,onBlur:Ce});if(r==="text")return a?X.createElement(X.Fragment,null,a(w,M)||null):X.createElement("span",Object.assign({},M,{ref:u}),w);if(n){var Ie=n;return X.createElement(Ie,Object.assign({},ve,{ref:u}))}return X.createElement("input",Object.assign({},ve,{ref:u}))}function xe(e,t){var r=t.decimalScale,n=t.fixedDecimalScale,a=t.prefix;a===void 0&&(a="");var u=t.suffix;u===void 0&&(u="");var l=t.allowNegative,g=t.thousandsGroupStyle;if(g===void 0&&(g="thousand"),e===""||e==="-")return e;var h=ue(t),S=h.thousandSeparator,p=h.decimalSeparator,v=r!==0&&e.indexOf(".")!==-1||r&&n,V=se(e,l),b=V.beforeDecimal,s=V.afterDecimal,O=V.addNegation;return r!==void 0&&(s=pe(s,r,!!n)),S&&(b=ke(b,S,g)),a&&(b=a+b),u&&(s=s+u),O&&(b="-"+b),e=b+(v&&p||"")+s,e}function ue(e){var t=e.decimalSeparator;t===void 0&&(t=".");var r=e.thousandSeparator,n=e.allowedDecimalSeparators;return r===!0&&(r=","),n||(n=[t,"."]),{decimalSeparator:t,thousandSeparator:r,allowedDecimalSeparators:n}}function Qe(e,t){e===void 0&&(e="");var r=new RegExp("(-)"),n=new RegExp("(-)(.)*(-)"),a=r.test(e),u=n.test(e);return e=e.replace(/-/g,""),a&&!u&&t&&(e="-"+e),e}function He(e,t){return new RegExp("(^-)|[0-9]|"+ge(e),"g")}function Xe(e,t,r){return e===""?!0:!t?.match(/\d/)&&!r?.match(/\d/)&&typeof e=="string"&&!isNaN(Number(e))}function Ye(e,t,r){var n;t===void 0&&(t=_e(e));var a=r.allowNegative,u=r.prefix;u===void 0&&(u="");var l=r.suffix;l===void 0&&(l="");var g=r.decimalScale,h=t.from,S=t.to,p=S.start,v=S.end,V=ue(r),b=V.allowedDecimalSeparators,s=V.decimalSeparator,O=e[v]===s;if(ae(e)&&(e===u||e===l)&&t.lastValue==="")return e;if(v-p===1&&b.indexOf(e[p])!==-1){var E=g===0?"":s;e=e.substring(0,p)+E+e.substring(p+1,e.length)}var m=function(c,x,C){var j=!1,A=!1;u.startsWith("-")?j=!1:c.startsWith("--")?(j=!1,A=!0):l.startsWith("-")&&c.length===l.length?j=!1:c[0]==="-"&&(j=!0);var I=j?1:0;return A&&(I=2),I&&(c=c.substring(I),x-=I,C-=I),{value:c,start:x,end:C,hasNegation:j}},T=m(e,p,v),F=T.hasNegation;n=T,e=n.value,p=n.start,v=n.end;var L=m(t.lastValue,h.start,h.end),M=L.start,Z=L.end,P=L.value,w=e.substring(p,v);e.length&&P.length&&(M>P.length-l.length||Z<u.length)&&!(w&&l.startsWith(w))&&(e=P);var k=0;e.startsWith(u)?k+=u.length:p<u.length&&(k=p),e=e.substring(k),v-=k;var q=e.length,W=e.length-l.length;e.endsWith(l)?q=W:(v>W||v>e.length-l.length)&&(q=v),e=e.substring(0,q),e=Qe(F?"-"+e:e,a),e=(e.match(He(s))||[]).join("");var U=e.indexOf(s);e=e.replace(new RegExp(ge(s),"g"),function(c,x){return x===U?".":""});var _=se(e,a),Q=_.beforeDecimal,ee=_.afterDecimal,d=_.addNegation;return S.end-S.start<h.end-h.start&&Q===""&&O&&!parseFloat(ee)&&(e=d?"-":""),e}function et(e,t){var r=t.prefix;r===void 0&&(r="");var n=t.suffix;n===void 0&&(n="");var a=Array.from({length:e.length+1}).map(function(){return!0}),u=e[0]==="-";a.fill(!1,0,r.length+(u?1:0));var l=e.length;return a.fill(!1,l-n.length+1,l+1),a}function tt(e){var t=ue(e),r=t.thousandSeparator,n=t.decimalSeparator,a=e.prefix;a===void 0&&(a="");var u=e.allowNegative;if(u===void 0&&(u=!0),r===n)throw new Error(`
1
+ import{R as X,r as R}from"./index-B2QqSXxG.js";import{s as Re}from"./index-D7qhlvAL.js";import"./withFullScreenWrapper-CQbXKdaQ.js";import"./Toolbar-CF99-ktZ.js";import"./FormClearHelper-BC4K9Zmh.js";import"./mergeWith-DB-_2-Rw.js";import"./sprintf-D7DtBTRn.js";import"./checkbox-vy_88iMk.js";import"./createDownloadLinkElement-ZaXNnPK4.js";import"./slicedToArray-Dcf1iVtV.js";import"./inherits-CxdXuG_P.js";import"./createSuper-BZDCsfCp.js";import"./FileDownload.esm-DOHSKnrq.js";const Te=Re("div")({name:"NumberOverlayEditorStyle",class:"gdg-n15fjm3e",propsAsIs:!1});function de(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,n=Object.getOwnPropertySymbols(e);a<n.length;a++)t.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(r[n[a]]=e[n[a]]);return r}var re;(function(e){e.event="event",e.props="prop"})(re||(re={}));function J(){}function Fe(e){var t,r=void 0;return function(){for(var n=[],a=arguments.length;a--;)n[a]=arguments[a];return t&&n.length===t.length&&n.every(function(u,l){return u===t[l]})||(t=n,r=e.apply(void 0,n)),r}}function ae(e){return!!(e||"").match(/\d/)}function Y(e){return e==null}function Be(e){return typeof e=="number"&&isNaN(e)}function me(e){return Y(e)||Be(e)||typeof e=="number"&&!isFinite(e)}function ge(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}function Me(e){switch(e){case"lakh":return/(\d+?)(?=(\d\d)+(\d)(?!\d))(\.\d+)?/g;case"wan":return/(\d)(?=(\d{4})+(?!\d))/g;case"thousand":default:return/(\d)(?=(\d{3})+(?!\d))/g}}function ke(e,t,r){var n=Me(r),a=e.search(/[1-9]/);return a=a===-1?e.length:a,e.substring(0,a)+e.substring(a,e.length).replace(n,"$1"+t)}function We(e){var t=R.useRef(e);t.current=e;var r=R.useRef(function(){for(var n=[],a=arguments.length;a--;)n[a]=arguments[a];return t.current.apply(t,n)});return r.current}function se(e,t){t===void 0&&(t=!0);var r=e[0]==="-",n=r&&t;e=e.replace("-","");var a=e.split("."),u=a[0],l=a[1]||"";return{beforeDecimal:u,afterDecimal:l,hasNegation:r,addNegation:n}}function Le(e){if(!e)return e;var t=e[0]==="-";t&&(e=e.substring(1,e.length));var r=e.split("."),n=r[0].replace(/^0+/,"")||"0",a=r[1]||"";return(t?"-":"")+n+(a?"."+a:"")}function pe(e,t,r){for(var n="",a=r?"0":"",u=0;u<=t-1;u++)n+=e[u]||a;return n}function he(e,t){return Array(t+1).join(e)}function Se(e){var t=e+"",r=t[0]==="-"?"-":"";r&&(t=t.substring(1));var n=t.split(/[eE]/g),a=n[0],u=n[1];if(u=Number(u),!u)return r+a;a=a.replace(".","");var l=1+u,g=a.length;return l<0?a="0."+he("0",Math.abs(l))+a:l>=g?a=a+he("0",l-g):a=(a.substring(0,l)||"0")+"."+a.substring(l),r+a}function be(e,t,r){if(["","-"].indexOf(e)!==-1)return e;var n=(e.indexOf(".")!==-1||r)&&t,a=se(e),u=a.beforeDecimal,l=a.afterDecimal,g=a.hasNegation,h=parseFloat("0."+(l||"0")),S=l.length<=t?"0."+l:h.toFixed(t),p=S.split("."),v=u;u&&Number(p[0])&&(v=u.split("").reverse().reduce(function(O,E,m){return O.length>m?(Number(O[0])+Number(E)).toString()+O.substring(1,O.length):E+O},p[0]));var V=pe(p[1]||"",t,r),b=g?"-":"",s=n?".":"";return""+b+v+s+V}function G(e,t){if(e.value=e.value,e!==null){if(e.createTextRange){var r=e.createTextRange();return r.move("character",t),r.select(),!0}return e.selectionStart||e.selectionStart===0?(e.focus(),e.setSelectionRange(t,t),!0):(e.focus(),!1)}}var ye=Fe(function(e,t){for(var r=0,n=0,a=e.length,u=t.length;e[r]===t[r]&&r<a;)r++;for(;e[a-1-n]===t[u-1-n]&&u-n>r&&a-n>r;)n++;return{from:{start:r,end:a-n},to:{start:r,end:u-n}}}),Pe=function(e,t){var r=Math.min(e.selectionStart,t);return{from:{start:r,end:e.selectionEnd},to:{start:r,end:t}}};function Ke(e,t,r){return Math.min(Math.max(e,t),r)}function fe(e){return Math.max(e.selectionStart,e.selectionEnd)}function Ue(){return typeof navigator<"u"&&!(navigator.platform&&/iPhone|iPod/.test(navigator.platform))}function _e(e){return{from:{start:0,end:0},to:{start:0,end:e.length},lastValue:""}}function $e(e){var t=e.currentValue,r=e.formattedValue,n=e.currentValueIndex,a=e.formattedValueIndex;return t[n]===r[a]}function ze(e,t,r,n,a,u,l){l===void 0&&(l=$e);var g=a.findIndex(function(L){return L}),h=e.slice(0,g);!t&&!r.startsWith(h)&&(t=h,r=h+r,n=n+h.length);for(var S=r.length,p=e.length,v={},V=new Array(S),b=0;b<S;b++){V[b]=-1;for(var s=0,O=p;s<O;s++){var E=l({currentValue:r,lastValue:t,formattedValue:e,currentValueIndex:b,formattedValueIndex:s});if(E&&v[s]!==!0){V[b]=s,v[s]=!0;break}}}for(var m=n;m<S&&(V[m]===-1||!u(r[m]));)m++;var T=m===S||V[m]===-1?p:V[m];for(m=n-1;m>0&&V[m]===-1;)m--;var F=m===-1||V[m]===-1?0:V[m]+1;return F>T?T:n-F<T-n?F:T}function Ve(e,t,r,n){var a=e.length;if(t=Ke(t,0,a),n==="left"){for(;t>=0&&!r[t];)t--;t===-1&&(t=r.indexOf(!0))}else{for(;t<=a&&!r[t];)t++;t>a&&(t=r.lastIndexOf(!0))}return t===-1&&(t=a),t}function Je(e){for(var t=Array.from({length:e.length+1}).map(function(){return!0}),r=0,n=t.length;r<n;r++)t[r]=!!(ae(e[r])||ae(e[r-1]));return t}function we(e,t,r,n,a,u){u===void 0&&(u=J);var l=We(function(s,O){var E,m;return me(s)?(m="",E=""):typeof s=="number"||O?(m=typeof s=="number"?Se(s):s,E=n(m)):(m=a(s,void 0),E=n(m)),{formattedValue:E,numAsString:m}}),g=R.useState(function(){return l(Y(e)?t:e,r)}),h=g[0],S=g[1],p=function(s,O){s.formattedValue!==h.formattedValue&&S({formattedValue:s.formattedValue,numAsString:s.value}),u(s,O)},v=e,V=r;Y(e)&&(v=h.numAsString,V=!0);var b=l(v,V);return R.useMemo(function(){S(b)},[b.formattedValue]),[h,p]}function Ze(e){return e.replace(/[^0-9]/g,"")}function qe(e){return e}function Ge(e){var t=e.type;t===void 0&&(t="text");var r=e.displayType;r===void 0&&(r="input");var n=e.customInput,a=e.renderText,u=e.getInputRef,l=e.format;l===void 0&&(l=qe);var g=e.removeFormatting;g===void 0&&(g=Ze);var h=e.defaultValue,S=e.valueIsNumericString,p=e.onValueChange,v=e.isAllowed,V=e.onChange;V===void 0&&(V=J);var b=e.onKeyDown;b===void 0&&(b=J);var s=e.onMouseUp;s===void 0&&(s=J);var O=e.onFocus;O===void 0&&(O=J);var E=e.onBlur;E===void 0&&(E=J);var m=e.value,T=e.getCaretBoundary;T===void 0&&(T=Je);var F=e.isValidInputCharacter;F===void 0&&(F=ae);var L=e.isCharacterSame,M=de(e,["type","displayType","customInput","renderText","getInputRef","format","removeFormatting","defaultValue","valueIsNumericString","onValueChange","isAllowed","onChange","onKeyDown","onMouseUp","onFocus","onBlur","value","getCaretBoundary","isValidInputCharacter","isCharacterSame"]),Z=we(m,h,!!S,l,g,p),P=Z[0],w=P.formattedValue,k=P.numAsString,q=Z[1],W=R.useRef(),U=R.useRef({formattedValue:w,numAsString:k}),_=function(o,i){U.current={formattedValue:o.formattedValue,numAsString:o.value},q(o,i)},Q=R.useState(!1),ee=Q[0],d=Q[1],c=R.useRef(null),x=R.useRef({setCaretTimeout:null,focusTimeout:null});R.useEffect(function(){return d(!0),function(){clearTimeout(x.current.setCaretTimeout),clearTimeout(x.current.focusTimeout)}},[]);var C=l,j=function(o,i){var f=parseFloat(i);return{formattedValue:o,value:i,floatValue:isNaN(f)?void 0:f}},A=function(o,i,f){o.selectionStart===0&&o.selectionEnd===o.value.length||(G(o,i),x.current.setCaretTimeout=setTimeout(function(){o.value===f&&o.selectionStart!==i&&G(o,i)},0))},I=function(o,i,f){return Ve(o,i,T(o),f)},H=function(o,i,f){var D=T(i),B=ze(i,w,o,f,D,F,L);return B=Ve(i,B,D),B},oe=function(o){var i=o.formattedValue;i===void 0&&(i="");var f=o.input,D=o.source,B=o.event,N=o.numAsString,y;if(f){var K=o.inputValue||f.value,$=fe(f);f.value=i,y=H(K,i,$),y!==void 0&&A(f,y,i)}i!==w&&_(j(i,N),{event:B,source:D})};R.useEffect(function(){var o=U.current,i=o.formattedValue,f=o.numAsString;(w!==i||k!==f)&&_(j(w,k),{event:void 0,source:re.props})},[w,k]);var te=c.current?fe(c.current):void 0,ne=typeof window<"u"?R.useLayoutEffect:R.useEffect;ne(function(){var o=c.current;if(w!==U.current.formattedValue&&o){var i=H(U.current.formattedValue,w,te);o.value=w,A(o,i,w)}},[w]);var ie=function(o,i,f){var D=i.target,B=W.current?Pe(W.current,D.selectionEnd):ye(w,o),N=Object.assign(Object.assign({},B),{lastValue:w}),y=g(o,N),K=C(y);if(y=g(K,void 0),v&&!v(j(K,y))){var $=i.target,z=fe($),ce=H(o,w,z);return $.value=w,A($,ce,w),!1}return oe({formattedValue:K,numAsString:y,inputValue:o,event:i,source:f,input:i.target}),!0},le=function(o,i){i===void 0&&(i=0);var f=o.selectionStart,D=o.selectionEnd;W.current={selectionStart:f,selectionEnd:D+i}},Ne=function(o){var i=o.target,f=i.value,D=ie(f,o,re.event);D&&V(o),W.current=void 0},Oe=function(o){var i=o.target,f=o.key,D=i.selectionStart,B=i.selectionEnd,N=i.value;N===void 0&&(N="");var y;f==="ArrowLeft"||f==="Backspace"?y=Math.max(D-1,0):f==="ArrowRight"?y=Math.min(D+1,N.length):f==="Delete"&&(y=D);var K=0;f==="Delete"&&D===B&&(K=1);var $=f==="ArrowLeft"||f==="ArrowRight";if(y===void 0||D!==B&&!$){b(o),le(i,K);return}var z=y;if($){var ce=f==="ArrowLeft"?"left":"right";z=I(N,y,ce),z!==y&&o.preventDefault()}else f==="Delete"&&!F(N[y])?z=I(N,y,"right"):f==="Backspace"&&!F(N[y])&&(z=I(N,y,"left"));z!==y&&A(i,z,N),b(o),le(i,K)},Ee=function(o){var i=o.target,f=function(){var D=i.selectionStart,B=i.selectionEnd,N=i.value;if(N===void 0&&(N=""),D===B){var y=I(N,D);y!==D&&A(i,y,N)}};f(),requestAnimationFrame(function(){f()}),s(o),le(i)},Ae=function(o){o.persist&&o.persist();var i=o.target,f=o.currentTarget;c.current=i,x.current.focusTimeout=setTimeout(function(){var D=i.selectionStart,B=i.selectionEnd,N=i.value;N===void 0&&(N="");var y=I(N,D);y!==D&&!(D===0&&B===N.length)&&A(i,y,N),O(Object.assign(Object.assign({},o),{currentTarget:f}))},0)},Ce=function(o){c.current=null,clearTimeout(x.current.focusTimeout),clearTimeout(x.current.setCaretTimeout),E(o)},je=ee&&Ue()?"numeric":void 0,ve=Object.assign({inputMode:je},M,{type:t,value:w,onChange:Ne,onKeyDown:Oe,onMouseUp:Ee,onFocus:Ae,onBlur:Ce});if(r==="text")return a?X.createElement(X.Fragment,null,a(w,M)||null):X.createElement("span",Object.assign({},M,{ref:u}),w);if(n){var Ie=n;return X.createElement(Ie,Object.assign({},ve,{ref:u}))}return X.createElement("input",Object.assign({},ve,{ref:u}))}function xe(e,t){var r=t.decimalScale,n=t.fixedDecimalScale,a=t.prefix;a===void 0&&(a="");var u=t.suffix;u===void 0&&(u="");var l=t.allowNegative,g=t.thousandsGroupStyle;if(g===void 0&&(g="thousand"),e===""||e==="-")return e;var h=ue(t),S=h.thousandSeparator,p=h.decimalSeparator,v=r!==0&&e.indexOf(".")!==-1||r&&n,V=se(e,l),b=V.beforeDecimal,s=V.afterDecimal,O=V.addNegation;return r!==void 0&&(s=pe(s,r,!!n)),S&&(b=ke(b,S,g)),a&&(b=a+b),u&&(s=s+u),O&&(b="-"+b),e=b+(v&&p||"")+s,e}function ue(e){var t=e.decimalSeparator;t===void 0&&(t=".");var r=e.thousandSeparator,n=e.allowedDecimalSeparators;return r===!0&&(r=","),n||(n=[t,"."]),{decimalSeparator:t,thousandSeparator:r,allowedDecimalSeparators:n}}function Qe(e,t){e===void 0&&(e="");var r=new RegExp("(-)"),n=new RegExp("(-)(.)*(-)"),a=r.test(e),u=n.test(e);return e=e.replace(/-/g,""),a&&!u&&t&&(e="-"+e),e}function He(e,t){return new RegExp("(^-)|[0-9]|"+ge(e),"g")}function Xe(e,t,r){return e===""?!0:!t?.match(/\d/)&&!r?.match(/\d/)&&typeof e=="string"&&!isNaN(Number(e))}function Ye(e,t,r){var n;t===void 0&&(t=_e(e));var a=r.allowNegative,u=r.prefix;u===void 0&&(u="");var l=r.suffix;l===void 0&&(l="");var g=r.decimalScale,h=t.from,S=t.to,p=S.start,v=S.end,V=ue(r),b=V.allowedDecimalSeparators,s=V.decimalSeparator,O=e[v]===s;if(ae(e)&&(e===u||e===l)&&t.lastValue==="")return e;if(v-p===1&&b.indexOf(e[p])!==-1){var E=g===0?"":s;e=e.substring(0,p)+E+e.substring(p+1,e.length)}var m=function(c,x,C){var j=!1,A=!1;u.startsWith("-")?j=!1:c.startsWith("--")?(j=!1,A=!0):l.startsWith("-")&&c.length===l.length?j=!1:c[0]==="-"&&(j=!0);var I=j?1:0;return A&&(I=2),I&&(c=c.substring(I),x-=I,C-=I),{value:c,start:x,end:C,hasNegation:j}},T=m(e,p,v),F=T.hasNegation;n=T,e=n.value,p=n.start,v=n.end;var L=m(t.lastValue,h.start,h.end),M=L.start,Z=L.end,P=L.value,w=e.substring(p,v);e.length&&P.length&&(M>P.length-l.length||Z<u.length)&&!(w&&l.startsWith(w))&&(e=P);var k=0;e.startsWith(u)?k+=u.length:p<u.length&&(k=p),e=e.substring(k),v-=k;var q=e.length,W=e.length-l.length;e.endsWith(l)?q=W:(v>W||v>e.length-l.length)&&(q=v),e=e.substring(0,q),e=Qe(F?"-"+e:e,a),e=(e.match(He(s))||[]).join("");var U=e.indexOf(s);e=e.replace(new RegExp(ge(s),"g"),function(c,x){return x===U?".":""});var _=se(e,a),Q=_.beforeDecimal,ee=_.afterDecimal,d=_.addNegation;return S.end-S.start<h.end-h.start&&Q===""&&O&&!parseFloat(ee)&&(e=d?"-":""),e}function et(e,t){var r=t.prefix;r===void 0&&(r="");var n=t.suffix;n===void 0&&(n="");var a=Array.from({length:e.length+1}).map(function(){return!0}),u=e[0]==="-";a.fill(!1,0,r.length+(u?1:0));var l=e.length;return a.fill(!1,l-n.length+1,l+1),a}function tt(e){var t=ue(e),r=t.thousandSeparator,n=t.decimalSeparator,a=e.prefix;a===void 0&&(a="");var u=e.allowNegative;if(u===void 0&&(u=!0),r===n)throw new Error(`
2
2
  Decimal separator can't be same as thousand separator.
3
3
  thousandSeparator: `+r+` (thousandSeparator = {true} is same as thousandSeparator = ",")
4
4
  decimalSeparator: `+n+` (default value for decimalSeparator is .)
@@ -1 +1 @@
1
- import{e as l}from"./es6-D9GNxEuI.js";import"./index-DCNLpqIv.js";const{DISALLOWED:h}=l;class w{constructor(e,t){this.writer=e,this.fileEntry=t}async write(e){if(typeof e=="object"){if(e.type==="write"){if(Number.isInteger(e.position)&&e.position>=0&&(this.writer.seek(e.position),this.writer.position!==e.position&&(await new Promise((t,i)=>{this.writer.onwriteend=t,this.writer.onerror=i,this.writer.truncate(e.position)}),this.writer.seek(e.position))),!("data"in e))throw new DOMException("Failed to execute 'write' on 'UnderlyingSinkBase': Invalid params passed. write requires a data argument","SyntaxError");e=e.data}else if(e.type==="seek")if(Number.isInteger(e.position)&&e.position>=0){if(this.writer.seek(e.position),this.writer.position!==e.position)throw new DOMException("seeking position failed","InvalidStateError");return}else throw new DOMException("Failed to execute 'write' on 'UnderlyingSinkBase': Invalid params passed. seek requires a position argument","SyntaxError");else if(e.type==="truncate")return new Promise(t=>{if(Number.isInteger(e.size)&&e.size>=0)this.writer.onwriteend=i=>t(),this.writer.truncate(e.size);else throw new DOMException("Failed to execute 'write' on 'UnderlyingSinkBase': Invalid params passed. truncate requires a size argument","SyntaxError")})}await new Promise((t,i)=>{this.writer.onwriteend=t,this.writer.onerror=i,this.writer.write(new Blob([e]))})}close(){return new Promise(this.fileEntry.file.bind(this.fileEntry))}}class a{constructor(e,t=!0){this.file=e,this.kind="file",this.writable=t,this.readable=!0}get name(){return this.file.name}isSameEntry(e){return this.file.toURL()===e.file.toURL()}getFile(){return new Promise(this.file.file.bind(this.file))}createWritable(e){if(!this.writable)throw new DOMException(...h);return new Promise((t,i)=>this.file.createWriter(r=>{e.keepExistingData===!1?(r.onwriteend=n=>t(new w(r,this.file)),r.truncate(0)):t(new w(r,this.file))},i))}}class s{constructor(e,t=!0){this.dir=e,this.writable=t,this.readable=!0,this.kind="directory",this.name=e.name}isSameEntry(e){return this.dir.fullPath===e.dir.fullPath}async*entries(){const e=this.dir.createReader(),t=await new Promise(e.readEntries.bind(e));for(const i of t)yield[i.name,i.isFile?new a(i,this.writable):new s(i,this.writable)]}getDirectoryHandle(e,t){return new Promise((i,r)=>{this.dir.getDirectory(e,t,n=>{i(new s(n))},r)})}getFileHandle(e,t){return new Promise((i,r)=>this.dir.getFile(e,t,n=>i(new a(n)),r))}async removeEntry(e,t){const i=await this.getDirectoryHandle(e,{create:!1}).catch(r=>r.name==="TypeMismatchError"?this.getFileHandle(e,{create:!1}):r);if(i instanceof Error)throw i;return new Promise((r,n)=>{i instanceof s?t.recursive?i.dir.removeRecursively(()=>r(),n):i.dir.remove(()=>r(),n):i.file&&i.file.remove(()=>r(),n)})}}const d=(o={})=>new Promise((e,t)=>window.webkitRequestFileSystem(o._persistent,0,i=>e(new s(i.root)),t));export{a as FileHandle,s as FolderHandle,d as default};
1
+ import{e as l}from"./es6-lWl2HAKQ.js";import"./index-B2QqSXxG.js";const{DISALLOWED:h}=l;class w{constructor(e,t){this.writer=e,this.fileEntry=t}async write(e){if(typeof e=="object"){if(e.type==="write"){if(Number.isInteger(e.position)&&e.position>=0&&(this.writer.seek(e.position),this.writer.position!==e.position&&(await new Promise((t,i)=>{this.writer.onwriteend=t,this.writer.onerror=i,this.writer.truncate(e.position)}),this.writer.seek(e.position))),!("data"in e))throw new DOMException("Failed to execute 'write' on 'UnderlyingSinkBase': Invalid params passed. write requires a data argument","SyntaxError");e=e.data}else if(e.type==="seek")if(Number.isInteger(e.position)&&e.position>=0){if(this.writer.seek(e.position),this.writer.position!==e.position)throw new DOMException("seeking position failed","InvalidStateError");return}else throw new DOMException("Failed to execute 'write' on 'UnderlyingSinkBase': Invalid params passed. seek requires a position argument","SyntaxError");else if(e.type==="truncate")return new Promise(t=>{if(Number.isInteger(e.size)&&e.size>=0)this.writer.onwriteend=i=>t(),this.writer.truncate(e.size);else throw new DOMException("Failed to execute 'write' on 'UnderlyingSinkBase': Invalid params passed. truncate requires a size argument","SyntaxError")})}await new Promise((t,i)=>{this.writer.onwriteend=t,this.writer.onerror=i,this.writer.write(new Blob([e]))})}close(){return new Promise(this.fileEntry.file.bind(this.fileEntry))}}class a{constructor(e,t=!0){this.file=e,this.kind="file",this.writable=t,this.readable=!0}get name(){return this.file.name}isSameEntry(e){return this.file.toURL()===e.file.toURL()}getFile(){return new Promise(this.file.file.bind(this.file))}createWritable(e){if(!this.writable)throw new DOMException(...h);return new Promise((t,i)=>this.file.createWriter(r=>{e.keepExistingData===!1?(r.onwriteend=n=>t(new w(r,this.file)),r.truncate(0)):t(new w(r,this.file))},i))}}class s{constructor(e,t=!0){this.dir=e,this.writable=t,this.readable=!0,this.kind="directory",this.name=e.name}isSameEntry(e){return this.dir.fullPath===e.dir.fullPath}async*entries(){const e=this.dir.createReader(),t=await new Promise(e.readEntries.bind(e));for(const i of t)yield[i.name,i.isFile?new a(i,this.writable):new s(i,this.writable)]}getDirectoryHandle(e,t){return new Promise((i,r)=>{this.dir.getDirectory(e,t,n=>{i(new s(n))},r)})}getFileHandle(e,t){return new Promise((i,r)=>this.dir.getFile(e,t,n=>i(new a(n)),r))}async removeEntry(e,t){const i=await this.getDirectoryHandle(e,{create:!1}).catch(r=>r.name==="TypeMismatchError"?this.getFileHandle(e,{create:!1}):r);if(i instanceof Error)throw i;return new Promise((r,n)=>{i instanceof s?t.recursive?i.dir.removeRecursively(()=>r(),n):i.dir.remove(()=>r(),n):i.file&&i.file.remove(()=>r(),n)})}}const d=(o={})=>new Promise((e,t)=>window.webkitRequestFileSystem(o._persistent,0,i=>e(new s(i.root)),t));export{a as FileHandle,s as FolderHandle,d as default};
@@ -1,2 +1,2 @@
1
- import{r as a,E as y,_ as d,bz as h}from"./index-DCNLpqIv.js";var s=a.forwardRef(function(r,e){var t={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return a.createElement(y,d({iconAttrs:t,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},r,{ref:e}),a.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),a.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"}))});s.displayName="Close";function b(r){if(Array.isArray(r))return r}function p(r,e){var t=r==null?null:typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(t!=null){var i,u,f,l,o=[],n=!0,c=!1;try{if(f=(t=t.call(r)).next,e===0){if(Object(t)!==t)return;n=!1}else for(;!(n=(i=f.call(t)).done)&&(o.push(i.value),o.length!==e);n=!0);}catch(m){c=!0,u=m}finally{try{if(!n&&t.return!=null&&(l=t.return(),Object(l)!==l))return}finally{if(c)throw u}}return o}}function v(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
1
+ import{r as a,E as y,_ as d,bz as h}from"./index-B2QqSXxG.js";var s=a.forwardRef(function(r,e){var t={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return a.createElement(y,d({iconAttrs:t,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},r,{ref:e}),a.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),a.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"}))});s.displayName="Close";function b(r){if(Array.isArray(r))return r}function p(r,e){var t=r==null?null:typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(t!=null){var i,u,f,l,o=[],n=!0,c=!1;try{if(f=(t=t.call(r)).next,e===0){if(Object(t)!==t)return;n=!1}else for(;!(n=(i=f.call(t)).done)&&(o.push(i.value),o.length!==e);n=!0);}catch(m){c=!0,u=m}finally{try{if(!n&&t.return!=null&&(l=t.return(),Object(l)!==l))return}finally{if(c)throw u}}return o}}function v(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
2
2
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function w(r,e){return b(r)||p(r,e)||h(r,e)||v()}export{s as C,w as _};