streamlit-nightly 1.42.3.dev20250226__py2.py3-none-any.whl → 1.42.3.dev20250227__py2.py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (93) hide show
  1. streamlit/commands/navigation.py +16 -4
  2. streamlit/commands/page_config.py +1 -2
  3. streamlit/elements/widgets/button.py +5 -7
  4. streamlit/elements/widgets/chat.py +2 -1
  5. streamlit/errors.py +11 -9
  6. streamlit/navigation/page.py +2 -10
  7. streamlit/proto/ChatInput_pb2.py +6 -6
  8. streamlit/proto/ChatInput_pb2.pyi +5 -1
  9. streamlit/proto/ForwardMsg_pb2.py +12 -10
  10. streamlit/proto/PagesChanged_pb2.pyi +3 -1
  11. streamlit/runtime/app_session.py +1 -13
  12. streamlit/runtime/pages_manager.py +61 -232
  13. streamlit/runtime/scriptrunner/script_runner.py +49 -2
  14. streamlit/runtime/scriptrunner_utils/script_run_context.py +1 -1
  15. streamlit/source_util.py +4 -90
  16. streamlit/static/index.html +1 -1
  17. streamlit/static/static/js/{FileDownload.esm.CWn5B5ZN.js → FileDownload.esm.rdZtCw5-.js} +1 -1
  18. streamlit/static/static/js/FileHelper.BztOEKJy.js +5 -0
  19. streamlit/static/static/js/{FormClearHelper.BlCIuWCo.js → FormClearHelper.Drd1fMJc.js} +1 -1
  20. streamlit/static/static/js/{Hooks.DURid8_V.js → Hooks.DWd0hyk4.js} +1 -1
  21. streamlit/static/static/js/{InputInstructions.gFFpIc6i.js → InputInstructions.B7xrWTG0.js} +1 -1
  22. streamlit/static/static/js/{ProgressBar.CtXtbXhv.js → ProgressBar.CBgJiTH-.js} +1 -1
  23. streamlit/static/static/js/{RenderInPortalIfExists.DKWNQmbm.js → RenderInPortalIfExists.US28tQOn.js} +1 -1
  24. streamlit/static/static/js/{Toolbar.CKKwksQV.js → Toolbar.CAOt-xaL.js} +1 -1
  25. streamlit/static/static/js/{base-input.BUY9TLqO.js → base-input.CauNaJqr.js} +1 -1
  26. streamlit/static/static/js/{checkbox.C4L_5Z9H.js → checkbox.ChzWCtre.js} +1 -1
  27. streamlit/static/static/js/{createSuper.DprEKsA6.js → createSuper.D_39RJB6.js} +1 -1
  28. streamlit/static/static/js/{data-grid-overlay-editor.BArvtwSg.js → data-grid-overlay-editor.rIelkOVS.js} +1 -1
  29. streamlit/static/static/js/{downloader.C5pxkE2v.js → downloader.Dz5I28nG.js} +1 -1
  30. streamlit/static/static/js/{es6.DmKjMqyQ.js → es6.DwnEjMMn.js} +2 -2
  31. streamlit/static/static/js/{iframeResizer.contentWindow.DhqbXIl1.js → iframeResizer.contentWindow.BRiRifwd.js} +1 -1
  32. streamlit/static/static/js/{index.BEnZZwfW.js → index.BE6MTF-B.js} +1 -1
  33. streamlit/static/static/js/{index.c_V1HXTs.js → index.BUdhIGhT.js} +1 -1
  34. streamlit/static/static/js/{index.B-S4HX7x.js → index.BWeYb5ES.js} +1 -1
  35. streamlit/static/static/js/{index.CTqvpoOz.js → index.Bb4OB39A.js} +1 -1
  36. streamlit/static/static/js/{index.BoBCblDb.js → index.BrAW6bFJ.js} +1 -1
  37. streamlit/static/static/js/{index.CXpOPWFV.js → index.CAHGh74D.js} +1 -1
  38. streamlit/static/static/js/{index.UE_L1IEZ.js → index.CBre8Aui.js} +1 -1
  39. streamlit/static/static/js/{index.B-vrwvgD.js → index.CM12P2T1.js} +1 -1
  40. streamlit/static/static/js/{index.Cd03IYkG.js → index.CO3dZWKG.js} +1 -1
  41. streamlit/static/static/js/{index.CvNhwseQ.js → index.CUz1_nAm.js} +1 -1
  42. streamlit/static/static/js/{index.BVHfAEko.js → index.C_C365T5.js} +1 -1
  43. streamlit/static/static/js/{index.NKOzzX__.js → index.CmYiLKNX.js} +1 -1
  44. streamlit/static/static/js/{index.RFfgDsnM.js → index.CoUzNoRf.js} +1 -1
  45. streamlit/static/static/js/{index.RrEbViHi.js → index.Ct7MPsA3.js} +1 -1
  46. streamlit/static/static/js/{index.D2G24Udm.js → index.D1K6NCBQ.js} +1 -1
  47. streamlit/static/static/js/{index.CoQjULdH.js → index.D2xM-XzG.js} +1 -1
  48. streamlit/static/static/js/{index.D2-IYCcZ.js → index.D9rv1PQ0.js} +1 -1
  49. streamlit/static/static/js/{index.ChEJa75P.js → index.DIeegLbv.js} +1 -1
  50. streamlit/static/static/js/{index.oPGa5nFU.js → index.DJvwxFLn.js} +1 -1
  51. streamlit/static/static/js/{index.DtIKjlNZ.js → index.DKuQg2D4.js} +1 -1
  52. streamlit/static/static/js/{index.Bk3A478D.js → index.DWFLx6Tc.js} +6 -6
  53. streamlit/static/static/js/{index.WAlW9lgW.js → index.DYUhWSq6.js} +1 -1
  54. streamlit/static/static/js/{index.Bds7Anva.js → index.Db3jGJxa.js} +1 -1
  55. streamlit/static/static/js/{index.KPwXWqBk.js → index.DfNAkKAr.js} +145 -145
  56. streamlit/static/static/js/{index.EIkP6R_d.js → index.DgNQKEeQ.js} +1 -1
  57. streamlit/static/static/js/{index.BmnSGdtS.js → index.Dj91melR.js} +1 -1
  58. streamlit/static/static/js/{index.C3l2zbST.js → index.DkKZlAsv.js} +1 -1
  59. streamlit/static/static/js/index.DkgVNhWs.js +1 -0
  60. streamlit/static/static/js/{index.DNr2W0gq.js → index.Dzp8iBkF.js} +1 -1
  61. streamlit/static/static/js/index.LL2DLZZA.js +201 -0
  62. streamlit/static/static/js/index.ORHz8Y8P.js +4537 -0
  63. streamlit/static/static/js/{index.O5-Wn4Yr.js → index.V3Vj2d9m.js} +1 -1
  64. streamlit/static/static/js/{index.BUnWa5Cg.js → index.YNWoT4uW.js} +1 -1
  65. streamlit/static/static/js/index.aL_kqyvR.js +1 -0
  66. streamlit/static/static/js/{index.BSczaRDm.js → index.fP6rBxlc.js} +1 -1
  67. streamlit/static/static/js/{index.xTncca7J.js → index.pvQjxG7y.js} +1 -1
  68. streamlit/static/static/js/{index.doRPQ8od.js → index.wxpL02VY.js} +1 -1
  69. streamlit/static/static/js/{input.EkJ_AsTP.js → input.D_dn5-2t.js} +1 -1
  70. streamlit/static/static/js/{memory.BFs17dZE.js → memory.pnMTtWQR.js} +1 -1
  71. streamlit/static/static/js/{mergeWith.B4u0whL-.js → mergeWith.CRrYodeI.js} +1 -1
  72. streamlit/static/static/js/{number-overlay-editor.DwazN43x.js → number-overlay-editor.C65GBS2P.js} +1 -1
  73. streamlit/static/static/js/{possibleConstructorReturn.CZfYLVBb.js → possibleConstructorReturn.BnQk7lq_.js} +1 -1
  74. streamlit/static/static/js/{sandbox.PjijA1v1.js → sandbox.CrxXt1li.js} +1 -1
  75. streamlit/static/static/js/{textarea.BGGnQXtw.js → textarea.DiFyO5JY.js} +1 -1
  76. streamlit/static/static/js/{timepicker.eLEnk1tw.js → timepicker.B1Y7LIk4.js} +1 -1
  77. streamlit/static/static/js/{toConsumableArray.CgKj9NUY.js → toConsumableArray.BWpBUK-j.js} +1 -1
  78. streamlit/static/static/js/{uniqueId.CPmOGhdZ.js → uniqueId.7ecIUkUs.js} +1 -1
  79. streamlit/static/static/js/{useBasicWidgetState.Bw_fxTtX.js → useBasicWidgetState.deG0KPm0.js} +1 -1
  80. streamlit/static/static/js/{useOnInputChange.D8qi7pm4.js → useOnInputChange.CQ7sD7CO.js} +1 -1
  81. streamlit/static/static/js/{withFullScreenWrapper.BjVufR9b.js → withFullScreenWrapper.D0wnBu3k.js} +1 -1
  82. streamlit/testing/v1/app_test.py +8 -10
  83. {streamlit_nightly-1.42.3.dev20250226.dist-info → streamlit_nightly-1.42.3.dev20250227.dist-info}/METADATA +1 -1
  84. {streamlit_nightly-1.42.3.dev20250226.dist-info → streamlit_nightly-1.42.3.dev20250227.dist-info}/RECORD +88 -88
  85. streamlit/static/static/js/FileHelper.Bii_mi1A.js +0 -5
  86. streamlit/static/static/js/index.BAfr2RC0.js +0 -3865
  87. streamlit/static/static/js/index.BCErGZwr.js +0 -1
  88. streamlit/static/static/js/index.DhcYAj3f.js +0 -1
  89. streamlit/static/static/js/index.u1gL_Cm_.js +0 -201
  90. {streamlit_nightly-1.42.3.dev20250226.data → streamlit_nightly-1.42.3.dev20250227.data}/scripts/streamlit.cmd +0 -0
  91. {streamlit_nightly-1.42.3.dev20250226.dist-info → streamlit_nightly-1.42.3.dev20250227.dist-info}/WHEEL +0 -0
  92. {streamlit_nightly-1.42.3.dev20250226.dist-info → streamlit_nightly-1.42.3.dev20250227.dist-info}/entry_points.txt +0 -0
  93. {streamlit_nightly-1.42.3.dev20250226.dist-info → streamlit_nightly-1.42.3.dev20250227.dist-info}/top_level.txt +0 -0
@@ -1 +1 @@
1
- import{r as o,E as X,_ as q,cB as I,L as b,N as J,as as ut,n as x,y as ct,bh as dt,cr as pt,B as N,j as u,bs as ft,bF as bt,bt as mt,ba as gt,bu as ht,bp as G}from"./index.KPwXWqBk.js";import{u as yt}from"./uniqueId.CPmOGhdZ.js";import{u as It}from"./FormClearHelper.BlCIuWCo.js";import{I as Tt}from"./InputInstructions.gFFpIc6i.js";import{s as wt}from"./sprintf.D7DtBTRn.js";import{I as Ct}from"./input.EkJ_AsTP.js";import"./base-input.BUY9TLqO.js";var Q=o.forwardRef(function(t,e){var r={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return o.createElement(X,q({iconAttrs:r,iconVerticalAlign:"middle",iconViewBox:"0 0 8 8"},t,{ref:e}),o.createElement("path",{d:"M0 3v2h8V3H0z"}))});Q.displayName="Minus";var Y=o.forwardRef(function(t,e){var r={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return o.createElement(X,q({iconAttrs:r,iconVerticalAlign:"middle",iconViewBox:"0 0 8 8"},t,{ref:e}),o.createElement("path",{d:"M3 0v3H0v2h3v3h2V5h3V3H5V0H3z"}))});Y.displayName="Plus";const vt=ut.getLogger("NumberInput");function St(t){return b(t)||t===""?void 0:t}const z=({value:t,format:e,step:r,dataType:f})=>{if(b(t))return null;let n=St(e);if(b(n)&&J(r)){const d=r.toString();f===I.DataType.FLOAT&&r!==0&&d.includes(".")&&(n=`%0.${d.split(".")[1].length}f`)}if(b(n))return t.toString();try{return wt.sprintf(n,t)}catch(d){return vt.warn(`Error in sprintf(${n}, ${t}): ${d}`),String(t)}},Vt=(t,e,r)=>b(t)?!1:t-e>=r,kt=(t,e,r)=>b(t)?!1:t+e<=r,xt=t=>(t.element.dataType===I.DataType.INT?t.widgetMgr.getIntValue(t.element):t.widgetMgr.getDoubleValue(t.element))??t.element.default??null,M=({step:t,dataType:e})=>t||(e===I.DataType.INT?1:.01),Rt=x("div",{target:"e5tuigk0"})(({theme:t})=>({display:"flex",flexDirection:"row",flexWrap:"nowrap",alignItems:"center",height:t.sizes.minElementHeight,borderWidth:t.sizes.borderWidth,borderStyle:"solid",borderColor:t.colors.widgetBorderColor??t.colors.secondaryBg,transitionDuration:"200ms",transitionProperty:"border",transitionTimingFunction:"cubic-bezier(0.2, 0.8, 0.4, 1)",borderRadius:t.radii.default,overflow:"hidden","&.focused":{borderColor:t.colors.primary},input:{MozAppearance:"textfield","&::-webkit-inner-spin-button, &::-webkit-outer-spin-button":{WebkitAppearance:"none",margin:t.spacing.none}}})),Dt=x("div",{target:"e5tuigk1"})({display:"flex",flexDirection:"row",alignSelf:"stretch"}),K=x("button",{target:"e5tuigk2"})(({theme:t})=>({margin:t.spacing.none,border:"none",height:t.sizes.full,display:"flex",alignItems:"center",width:t.sizes.numberInputControlsWidth,justifyContent:"center",color:t.colors.bodyText,transition:"color 300ms, backgroundColor 300ms",backgroundColor:t.colors.secondaryBg,"&:hover:enabled, &:focus:enabled":{color:t.colors.white,backgroundColor:t.colors.primary,transition:"none",outline:"none"},"&:active":{outline:"none",border:"none"},"&:last-of-type":{borderTopRightRadius:t.radii.default,borderBottomRightRadius:t.radii.default},"&:disabled":{cursor:"not-allowed",color:t.colors.fadedText40}})),Et=x("div",{target:"e5tuigk3"})(({theme:t,clearable:e})=>({position:"absolute",marginRight:t.spacing.twoXS,left:0,right:`calc(${t.sizes.numberInputControlsWidth} * 2 + ${e?"1em":"0em"})`})),Ft=({disabled:t,element:e,widgetMgr:r,fragmentId:f})=>{var j;const n=ct(),{dataType:d,id:C,formId:p,default:B,format:W}=e,m=e.hasMin?e.min:-1/0,g=e.hasMax?e.max:1/0,{values:[L],elementRef:Z}=dt(o.useMemo(()=>["width"],[])),[s,tt]=o.useState(M(e)),A=xt({element:e,widgetMgr:r}),[h,T]=o.useState(!1),[i,w]=o.useState(A),[H,v]=o.useState(z({value:A,...e,step:s})),[P,U]=o.useState(!1),R=o.useRef(null),$=o.useRef(yt("number_input_")),S=Vt(i,s,m),V=kt(i,s,g),O=pt({formId:p}),et=O?r.allowFormEnterToSubmit(p):h,ot=P&&L>n.breakpoints.hideWidgetDetails;o.useEffect(()=>{tt(M({step:e.step,dataType:e.dataType}))},[e.dataType,e.step]);const l=o.useCallback(({value:a,source:c})=>{var y;if(J(a)&&(m>a||a>g))(y=R.current)==null||y.reportValidity();else{const k=a??B??null;switch(d){case I.DataType.INT:r.setIntValue({id:C,formId:p},k,c,f);break;case I.DataType.FLOAT:r.setDoubleValue({id:C,formId:p},k,c,f);break;default:throw new Error("Invalid data type")}T(!1),w(k),v(z({value:k,dataType:d,format:W,step:s}))}},[m,g,R,r,f,s,d,C,p,B,W]),rt=o.useCallback(()=>{h&&l({value:i,source:{fromUi:!0}}),U(!1)},[h,i,l]),nt=o.useCallback(()=>{U(!0)},[]),_=o.useCallback(()=>{const{value:a}=e;e.setValue=!1,w(a??null),v(z({value:a??null,...e,step:s})),l({value:a??null,source:{fromUi:!1}})},[e,s,l]);o.useEffect(()=>{e.setValue?_():l({value:i,source:{fromUi:!1}})},[]),e.setValue&&_();const D=b(e.default)&&!t,at=o.useCallback(()=>{const a=e.default??null;w(a),l({value:a,source:{fromUi:!0}})},[e]);It({element:e,widgetMgr:r,onFormCleared:at});const st=a=>{const{value:c}=a.target;if(c==="")T(!0),w(null),v(null);else{let y;e.dataType===I.DataType.INT?y=parseInt(c,10):y=parseFloat(c),T(!0),w(y),v(c)}},E=o.useCallback(()=>{V&&(T(!0),l({value:(i??m)+s,source:{fromUi:!0}}))},[i,m,s,V]),F=o.useCallback(()=>{S&&(T(!0),l({value:(i??g)-s,source:{fromUi:!0}}))},[i,g,s,S]),it=o.useCallback(a=>{const{key:c}=a;switch(c){case"ArrowUp":a.preventDefault(),E();break;case"ArrowDown":a.preventDefault(),F();break}},[E,F]),lt=o.useCallback(a=>{a.key==="Enter"&&(h&&l({value:i,source:{fromUi:!0}}),r.allowFormEnterToSubmit(p)&&r.submitForm(p,f))},[h,i,l,r,p,f]);return N("div",{className:"stNumberInput","data-testid":"stNumberInput",ref:Z,children:[u(ht,{label:e.label,disabled:t,labelVisibility:ft((j=e.labelVisibility)==null?void 0:j.value),htmlFor:$.current,children:e.help&&u(bt,{children:u(mt,{content:e.help,placement:gt.TOP_RIGHT})})}),N(Rt,{className:P?"focused":"","data-testid":"stNumberInputContainer",children:[u(Ct,{type:"number",inputRef:R,value:H??"",placeholder:e.placeholder,onBlur:rt,onFocus:nt,onChange:st,onKeyPress:lt,onKeyDown:it,clearable:D,clearOnEscape:D,disabled:t,"aria-label":e.label,id:$.current,overrides:{ClearIconContainer:{style:{padding:0}},ClearIcon:{props:{overrides:{Svg:{style:{color:n.colors.darkGray,padding:n.spacing.threeXS,height:n.sizes.clearIconSize,width:n.sizes.clearIconSize,":hover":{fill:n.colors.bodyText}}}}}},Input:{props:{"data-testid":"stNumberInputField",step:s,min:m,max:g,type:"number",inputMode:""},style:{lineHeight:n.lineHeights.inputWidget,paddingRight:n.spacing.sm,paddingLeft:n.spacing.sm,paddingBottom:n.spacing.sm,paddingTop:n.spacing.sm}},InputContainer:{style:()=>({borderTopRightRadius:0,borderBottomRightRadius:0})},Root:{style:{borderTopRightRadius:0,borderBottomRightRadius:0,borderTopLeftRadius:0,borderBottomLeftRadius:0,borderLeftWidth:0,borderRightWidth:0,borderTopWidth:0,borderBottomWidth:0,paddingRight:0}}}}),L>n.breakpoints.hideNumberInputControls&&N(Dt,{children:[u(K,{"data-testid":"stNumberInputStepDown",onClick:F,disabled:!S||t,tabIndex:-1,children:u(G,{content:Q,size:"xs",color:S?"inherit":n.colors.disabled})}),u(K,{"data-testid":"stNumberInputStepUp",onClick:E,disabled:!V||t,tabIndex:-1,children:u(G,{content:Y,size:"xs",color:V?"inherit":n.colors.disabled})})]})]}),ot&&u(Et,{clearable:D,children:u(Tt,{dirty:h,value:H??"",inForm:O,allowEnterToSubmit:et})})]})},Pt=o.memo(Ft);export{Pt as default};
1
+ import{r as o,E as X,_ as q,cB as I,L as b,N as J,as as ut,n as x,y as ct,bh as dt,cr as pt,B as N,j as u,bs as ft,bF as bt,bt as mt,ba as gt,bu as ht,bp as G}from"./index.DfNAkKAr.js";import{u as yt}from"./uniqueId.7ecIUkUs.js";import{u as It}from"./FormClearHelper.Drd1fMJc.js";import{I as Tt}from"./InputInstructions.B7xrWTG0.js";import{s as wt}from"./sprintf.D7DtBTRn.js";import{I as Ct}from"./input.D_dn5-2t.js";import"./base-input.CauNaJqr.js";var Q=o.forwardRef(function(t,e){var r={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return o.createElement(X,q({iconAttrs:r,iconVerticalAlign:"middle",iconViewBox:"0 0 8 8"},t,{ref:e}),o.createElement("path",{d:"M0 3v2h8V3H0z"}))});Q.displayName="Minus";var Y=o.forwardRef(function(t,e){var r={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return o.createElement(X,q({iconAttrs:r,iconVerticalAlign:"middle",iconViewBox:"0 0 8 8"},t,{ref:e}),o.createElement("path",{d:"M3 0v3H0v2h3v3h2V5h3V3H5V0H3z"}))});Y.displayName="Plus";const vt=ut.getLogger("NumberInput");function St(t){return b(t)||t===""?void 0:t}const z=({value:t,format:e,step:r,dataType:f})=>{if(b(t))return null;let n=St(e);if(b(n)&&J(r)){const d=r.toString();f===I.DataType.FLOAT&&r!==0&&d.includes(".")&&(n=`%0.${d.split(".")[1].length}f`)}if(b(n))return t.toString();try{return wt.sprintf(n,t)}catch(d){return vt.warn(`Error in sprintf(${n}, ${t}): ${d}`),String(t)}},Vt=(t,e,r)=>b(t)?!1:t-e>=r,kt=(t,e,r)=>b(t)?!1:t+e<=r,xt=t=>(t.element.dataType===I.DataType.INT?t.widgetMgr.getIntValue(t.element):t.widgetMgr.getDoubleValue(t.element))??t.element.default??null,M=({step:t,dataType:e})=>t||(e===I.DataType.INT?1:.01),Rt=x("div",{target:"e5tuigk0"})(({theme:t})=>({display:"flex",flexDirection:"row",flexWrap:"nowrap",alignItems:"center",height:t.sizes.minElementHeight,borderWidth:t.sizes.borderWidth,borderStyle:"solid",borderColor:t.colors.widgetBorderColor??t.colors.secondaryBg,transitionDuration:"200ms",transitionProperty:"border",transitionTimingFunction:"cubic-bezier(0.2, 0.8, 0.4, 1)",borderRadius:t.radii.default,overflow:"hidden","&.focused":{borderColor:t.colors.primary},input:{MozAppearance:"textfield","&::-webkit-inner-spin-button, &::-webkit-outer-spin-button":{WebkitAppearance:"none",margin:t.spacing.none}}})),Dt=x("div",{target:"e5tuigk1"})({display:"flex",flexDirection:"row",alignSelf:"stretch"}),K=x("button",{target:"e5tuigk2"})(({theme:t})=>({margin:t.spacing.none,border:"none",height:t.sizes.full,display:"flex",alignItems:"center",width:t.sizes.numberInputControlsWidth,justifyContent:"center",color:t.colors.bodyText,transition:"color 300ms, backgroundColor 300ms",backgroundColor:t.colors.secondaryBg,"&:hover:enabled, &:focus:enabled":{color:t.colors.white,backgroundColor:t.colors.primary,transition:"none",outline:"none"},"&:active":{outline:"none",border:"none"},"&:last-of-type":{borderTopRightRadius:t.radii.default,borderBottomRightRadius:t.radii.default},"&:disabled":{cursor:"not-allowed",color:t.colors.fadedText40}})),Et=x("div",{target:"e5tuigk3"})(({theme:t,clearable:e})=>({position:"absolute",marginRight:t.spacing.twoXS,left:0,right:`calc(${t.sizes.numberInputControlsWidth} * 2 + ${e?"1em":"0em"})`})),Ft=({disabled:t,element:e,widgetMgr:r,fragmentId:f})=>{var j;const n=ct(),{dataType:d,id:C,formId:p,default:B,format:W}=e,m=e.hasMin?e.min:-1/0,g=e.hasMax?e.max:1/0,{values:[L],elementRef:Z}=dt(o.useMemo(()=>["width"],[])),[s,tt]=o.useState(M(e)),A=xt({element:e,widgetMgr:r}),[h,T]=o.useState(!1),[i,w]=o.useState(A),[H,v]=o.useState(z({value:A,...e,step:s})),[P,U]=o.useState(!1),R=o.useRef(null),$=o.useRef(yt("number_input_")),S=Vt(i,s,m),V=kt(i,s,g),O=pt({formId:p}),et=O?r.allowFormEnterToSubmit(p):h,ot=P&&L>n.breakpoints.hideWidgetDetails;o.useEffect(()=>{tt(M({step:e.step,dataType:e.dataType}))},[e.dataType,e.step]);const l=o.useCallback(({value:a,source:c})=>{var y;if(J(a)&&(m>a||a>g))(y=R.current)==null||y.reportValidity();else{const k=a??B??null;switch(d){case I.DataType.INT:r.setIntValue({id:C,formId:p},k,c,f);break;case I.DataType.FLOAT:r.setDoubleValue({id:C,formId:p},k,c,f);break;default:throw new Error("Invalid data type")}T(!1),w(k),v(z({value:k,dataType:d,format:W,step:s}))}},[m,g,R,r,f,s,d,C,p,B,W]),rt=o.useCallback(()=>{h&&l({value:i,source:{fromUi:!0}}),U(!1)},[h,i,l]),nt=o.useCallback(()=>{U(!0)},[]),_=o.useCallback(()=>{const{value:a}=e;e.setValue=!1,w(a??null),v(z({value:a??null,...e,step:s})),l({value:a??null,source:{fromUi:!1}})},[e,s,l]);o.useEffect(()=>{e.setValue?_():l({value:i,source:{fromUi:!1}})},[]),e.setValue&&_();const D=b(e.default)&&!t,at=o.useCallback(()=>{const a=e.default??null;w(a),l({value:a,source:{fromUi:!0}})},[e]);It({element:e,widgetMgr:r,onFormCleared:at});const st=a=>{const{value:c}=a.target;if(c==="")T(!0),w(null),v(null);else{let y;e.dataType===I.DataType.INT?y=parseInt(c,10):y=parseFloat(c),T(!0),w(y),v(c)}},E=o.useCallback(()=>{V&&(T(!0),l({value:(i??m)+s,source:{fromUi:!0}}))},[i,m,s,V]),F=o.useCallback(()=>{S&&(T(!0),l({value:(i??g)-s,source:{fromUi:!0}}))},[i,g,s,S]),it=o.useCallback(a=>{const{key:c}=a;switch(c){case"ArrowUp":a.preventDefault(),E();break;case"ArrowDown":a.preventDefault(),F();break}},[E,F]),lt=o.useCallback(a=>{a.key==="Enter"&&(h&&l({value:i,source:{fromUi:!0}}),r.allowFormEnterToSubmit(p)&&r.submitForm(p,f))},[h,i,l,r,p,f]);return N("div",{className:"stNumberInput","data-testid":"stNumberInput",ref:Z,children:[u(ht,{label:e.label,disabled:t,labelVisibility:ft((j=e.labelVisibility)==null?void 0:j.value),htmlFor:$.current,children:e.help&&u(bt,{children:u(mt,{content:e.help,placement:gt.TOP_RIGHT})})}),N(Rt,{className:P?"focused":"","data-testid":"stNumberInputContainer",children:[u(Ct,{type:"number",inputRef:R,value:H??"",placeholder:e.placeholder,onBlur:rt,onFocus:nt,onChange:st,onKeyPress:lt,onKeyDown:it,clearable:D,clearOnEscape:D,disabled:t,"aria-label":e.label,id:$.current,overrides:{ClearIconContainer:{style:{padding:0}},ClearIcon:{props:{overrides:{Svg:{style:{color:n.colors.darkGray,padding:n.spacing.threeXS,height:n.sizes.clearIconSize,width:n.sizes.clearIconSize,":hover":{fill:n.colors.bodyText}}}}}},Input:{props:{"data-testid":"stNumberInputField",step:s,min:m,max:g,type:"number",inputMode:""},style:{lineHeight:n.lineHeights.inputWidget,paddingRight:n.spacing.sm,paddingLeft:n.spacing.sm,paddingBottom:n.spacing.sm,paddingTop:n.spacing.sm}},InputContainer:{style:()=>({borderTopRightRadius:0,borderBottomRightRadius:0})},Root:{style:{borderTopRightRadius:0,borderBottomRightRadius:0,borderTopLeftRadius:0,borderBottomLeftRadius:0,borderLeftWidth:0,borderRightWidth:0,borderTopWidth:0,borderBottomWidth:0,paddingRight:0}}}}),L>n.breakpoints.hideNumberInputControls&&N(Dt,{children:[u(K,{"data-testid":"stNumberInputStepDown",onClick:F,disabled:!S||t,tabIndex:-1,children:u(G,{content:Q,size:"xs",color:S?"inherit":n.colors.disabled})}),u(K,{"data-testid":"stNumberInputStepUp",onClick:E,disabled:!V||t,tabIndex:-1,children:u(G,{content:Y,size:"xs",color:V?"inherit":n.colors.disabled})})]})]}),ot&&u(Et,{clearable:D,children:u(Tt,{dirty:h,value:H??"",inForm:O,allowEnterToSubmit:et})})]})},Pt=o.memo(Ft);export{Pt as default};
@@ -1,2 +1,2 @@
1
- import{r as J,j as ct,F as Vt}from"./index.KPwXWqBk.js";/*! @license DOMPurify 3.2.4 | (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.4/LICENSE */const{entries:At,setPrototypeOf:ft,isFrozen:$t,getPrototypeOf:qt,getOwnPropertyDescriptor:Kt}=Object;let{freeze:S,seal:y,create:ht}=Object,{apply:xe,construct:Pe}=typeof Reflect<"u"&&Reflect;S||(S=function(n){return n});y||(y=function(n){return n});xe||(xe=function(n,l,r){return n.apply(l,r)});Pe||(Pe=function(n,l){return new n(...l)});const le=R(Array.prototype.forEach),Zt=R(Array.prototype.lastIndexOf),ut=R(Array.prototype.pop),V=R(Array.prototype.push),Jt=R(Array.prototype.splice),fe=R(String.prototype.toLowerCase),Ne=R(String.prototype.toString),mt=R(String.prototype.match),$=R(String.prototype.replace),Qt=R(String.prototype.indexOf),en=R(String.prototype.trim),b=R(Object.prototype.hasOwnProperty),h=R(RegExp.prototype.test),q=tn(TypeError);function R(a){return function(n){for(var l=arguments.length,r=new Array(l>1?l-1:0),f=1;f<l;f++)r[f-1]=arguments[f];return xe(a,n,r)}}function tn(a){return function(){for(var n=arguments.length,l=new Array(n),r=0;r<n;r++)l[r]=arguments[r];return Pe(a,l)}}function s(a,n){let l=arguments.length>2&&arguments[2]!==void 0?arguments[2]:fe;ft&&ft(a,null);let r=n.length;for(;r--;){let f=n[r];if(typeof f=="string"){const L=l(f);L!==f&&($t(n)||(n[r]=L),f=L)}a[f]=!0}return a}function nn(a){for(let n=0;n<a.length;n++)b(a,n)||(a[n]=null);return a}function x(a){const n=ht(null);for(const[l,r]of At(a))b(a,l)&&(Array.isArray(r)?n[l]=nn(r):r&&typeof r=="object"&&r.constructor===Object?n[l]=x(r):n[l]=r);return n}function K(a,n){for(;a!==null;){const r=Kt(a,n);if(r){if(r.get)return R(r.get);if(typeof r.value=="function")return R(r.value)}a=qt(a)}function l(){return null}return l}const pt=S(["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"]),De=S(["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"]),Ie=S(["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"]),on=S(["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"]),Me=S(["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"]),an=S(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),dt=S(["#text"]),Tt=S(["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"]),Ce=S(["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"]),Et=S(["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"]),ce=S(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),rn=y(/\{\{[\w\W]*|[\w\W]*\}\}/gm),sn=y(/<%[\w\W]*|[\w\W]*%>/gm),ln=y(/\$\{[\w\W]*/gm),cn=y(/^data-[\-\w.\u00B7-\uFFFF]+$/),fn=y(/^aria-[\-\w]+$/),St=y(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),un=y(/^(?:\w+script|data):/i),mn=y(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Rt=y(/^html$/i),pn=y(/^[a-z][.\w]*(-[.\w]+)+$/i);var _t=Object.freeze({__proto__:null,ARIA_ATTR:fn,ATTR_WHITESPACE:mn,CUSTOM_ELEMENT:pn,DATA_ATTR:cn,DOCTYPE_NAME:Rt,ERB_EXPR:sn,IS_ALLOWED_URI:St,IS_SCRIPT_OR_DATA:un,MUSTACHE_EXPR:rn,TMPLIT_EXPR:ln});const Z={element:1,text:3,progressingInstruction:7,comment:8,document:9},dn=function(){return typeof window>"u"?null:window},Tn=function(n,l){if(typeof n!="object"||typeof n.createPolicy!="function")return null;let r=null;const f="data-tt-policy-suffix";l&&l.hasAttribute(f)&&(r=l.getAttribute(f));const L="dompurify"+(r?"#"+r:"");try{return n.createPolicy(L,{createHTML(I){return I},createScriptURL(I){return I}})}catch{return console.warn("TrustedTypes policy "+L+" could not be created."),null}},gt=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Ot(){let a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:dn();const n=i=>Ot(i);if(n.version="3.2.4",n.removed=[],!a||!a.document||a.document.nodeType!==Z.document||!a.Element)return n.isSupported=!1,n;let{document:l}=a;const r=l,f=r.currentScript,{DocumentFragment:L,HTMLTemplateElement:I,Node:ue,Element:Ue,NodeFilter:z,NamedNodeMap:Lt=a.NamedNodeMap||a.MozNamedAttrMap,HTMLFormElement:yt,DOMParser:bt,trustedTypes:Q}=a,G=Ue.prototype,Nt=K(G,"cloneNode"),Dt=K(G,"remove"),It=K(G,"nextSibling"),Mt=K(G,"childNodes"),ee=K(G,"parentNode");if(typeof I=="function"){const i=l.createElement("template");i.content&&i.content.ownerDocument&&(l=i.content.ownerDocument)}let _,W="";const{implementation:me,createNodeIterator:Ct,createDocumentFragment:wt,getElementsByTagName:xt}=l,{importNode:Pt}=r;let g=gt();n.isSupported=typeof At=="function"&&typeof ee=="function"&&me&&me.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:pe,ERB_EXPR:de,TMPLIT_EXPR:Te,DATA_ATTR:kt,ARIA_ATTR:vt,IS_SCRIPT_OR_DATA:Ut,ATTR_WHITESPACE:Fe,CUSTOM_ELEMENT:Ft}=_t;let{IS_ALLOWED_URI:He}=_t,m=null;const ze=s({},[...pt,...De,...Ie,...Me,...dt]);let d=null;const Ge=s({},[...Tt,...Ce,...Et,...ce]);let u=Object.seal(ht(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}})),B=null,Ee=null,We=!0,_e=!0,Be=!1,Ye=!0,P=!1,ge=!0,w=!1,Ae=!1,he=!1,k=!1,te=!1,ne=!1,Xe=!0,je=!1;const Ht="user-content-";let Se=!0,Y=!1,v={},U=null;const Ve=s({},["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 $e=null;const qe=s({},["audio","video","img","source","image","track"]);let Re=null;const Ke=s({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),oe="http://www.w3.org/1998/Math/MathML",ie="http://www.w3.org/2000/svg",M="http://www.w3.org/1999/xhtml";let F=M,Oe=!1,Le=null;const zt=s({},[oe,ie,M],Ne);let ae=s({},["mi","mo","mn","ms","mtext"]),re=s({},["annotation-xml"]);const Gt=s({},["title","style","font","a","script"]);let X=null;const Wt=["application/xhtml+xml","text/html"],Bt="text/html";let p=null,H=null;const Yt=l.createElement("form"),Ze=function(e){return e instanceof RegExp||e instanceof Function},ye=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(H&&H===e)){if((!e||typeof e!="object")&&(e={}),e=x(e),X=Wt.indexOf(e.PARSER_MEDIA_TYPE)===-1?Bt:e.PARSER_MEDIA_TYPE,p=X==="application/xhtml+xml"?Ne:fe,m=b(e,"ALLOWED_TAGS")?s({},e.ALLOWED_TAGS,p):ze,d=b(e,"ALLOWED_ATTR")?s({},e.ALLOWED_ATTR,p):Ge,Le=b(e,"ALLOWED_NAMESPACES")?s({},e.ALLOWED_NAMESPACES,Ne):zt,Re=b(e,"ADD_URI_SAFE_ATTR")?s(x(Ke),e.ADD_URI_SAFE_ATTR,p):Ke,$e=b(e,"ADD_DATA_URI_TAGS")?s(x(qe),e.ADD_DATA_URI_TAGS,p):qe,U=b(e,"FORBID_CONTENTS")?s({},e.FORBID_CONTENTS,p):Ve,B=b(e,"FORBID_TAGS")?s({},e.FORBID_TAGS,p):{},Ee=b(e,"FORBID_ATTR")?s({},e.FORBID_ATTR,p):{},v=b(e,"USE_PROFILES")?e.USE_PROFILES:!1,We=e.ALLOW_ARIA_ATTR!==!1,_e=e.ALLOW_DATA_ATTR!==!1,Be=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Ye=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,P=e.SAFE_FOR_TEMPLATES||!1,ge=e.SAFE_FOR_XML!==!1,w=e.WHOLE_DOCUMENT||!1,k=e.RETURN_DOM||!1,te=e.RETURN_DOM_FRAGMENT||!1,ne=e.RETURN_TRUSTED_TYPE||!1,he=e.FORCE_BODY||!1,Xe=e.SANITIZE_DOM!==!1,je=e.SANITIZE_NAMED_PROPS||!1,Se=e.KEEP_CONTENT!==!1,Y=e.IN_PLACE||!1,He=e.ALLOWED_URI_REGEXP||St,F=e.NAMESPACE||M,ae=e.MATHML_TEXT_INTEGRATION_POINTS||ae,re=e.HTML_INTEGRATION_POINTS||re,u=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&Ze(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(u.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&Ze(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(u.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(u.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),P&&(_e=!1),te&&(k=!0),v&&(m=s({},dt),d=[],v.html===!0&&(s(m,pt),s(d,Tt)),v.svg===!0&&(s(m,De),s(d,Ce),s(d,ce)),v.svgFilters===!0&&(s(m,Ie),s(d,Ce),s(d,ce)),v.mathMl===!0&&(s(m,Me),s(d,Et),s(d,ce))),e.ADD_TAGS&&(m===ze&&(m=x(m)),s(m,e.ADD_TAGS,p)),e.ADD_ATTR&&(d===Ge&&(d=x(d)),s(d,e.ADD_ATTR,p)),e.ADD_URI_SAFE_ATTR&&s(Re,e.ADD_URI_SAFE_ATTR,p),e.FORBID_CONTENTS&&(U===Ve&&(U=x(U)),s(U,e.FORBID_CONTENTS,p)),Se&&(m["#text"]=!0),w&&s(m,["html","head","body"]),m.table&&(s(m,["tbody"]),delete B.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!="function")throw q('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw q('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');_=e.TRUSTED_TYPES_POLICY,W=_.createHTML("")}else _===void 0&&(_=Tn(Q,f)),_!==null&&typeof W=="string"&&(W=_.createHTML(""));S&&S(e),H=e}},Je=s({},[...De,...Ie,...on]),Qe=s({},[...Me,...an]),Xt=function(e){let t=ee(e);(!t||!t.tagName)&&(t={namespaceURI:F,tagName:"template"});const o=fe(e.tagName),c=fe(t.tagName);return Le[e.namespaceURI]?e.namespaceURI===ie?t.namespaceURI===M?o==="svg":t.namespaceURI===oe?o==="svg"&&(c==="annotation-xml"||ae[c]):!!Je[o]:e.namespaceURI===oe?t.namespaceURI===M?o==="math":t.namespaceURI===ie?o==="math"&&re[c]:!!Qe[o]:e.namespaceURI===M?t.namespaceURI===ie&&!re[c]||t.namespaceURI===oe&&!ae[c]?!1:!Qe[o]&&(Gt[o]||!Je[o]):!!(X==="application/xhtml+xml"&&Le[e.namespaceURI]):!1},N=function(e){V(n.removed,{element:e});try{ee(e).removeChild(e)}catch{Dt(e)}},se=function(e,t){try{V(n.removed,{attribute:t.getAttributeNode(e),from:t})}catch{V(n.removed,{attribute:null,from:t})}if(t.removeAttribute(e),e==="is")if(k||te)try{N(t)}catch{}else try{t.setAttribute(e,"")}catch{}},et=function(e){let t=null,o=null;if(he)e="<remove></remove>"+e;else{const T=mt(e,/^[\r\n\t ]+/);o=T&&T[0]}X==="application/xhtml+xml"&&F===M&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");const c=_?_.createHTML(e):e;if(F===M)try{t=new bt().parseFromString(c,X)}catch{}if(!t||!t.documentElement){t=me.createDocument(F,"template",null);try{t.documentElement.innerHTML=Oe?W:c}catch{}}const E=t.body||t.documentElement;return e&&o&&E.insertBefore(l.createTextNode(o),E.childNodes[0]||null),F===M?xt.call(t,w?"html":"body")[0]:w?t.documentElement:E},tt=function(e){return Ct.call(e.ownerDocument||e,e,z.SHOW_ELEMENT|z.SHOW_COMMENT|z.SHOW_TEXT|z.SHOW_PROCESSING_INSTRUCTION|z.SHOW_CDATA_SECTION,null)},be=function(e){return e instanceof yt&&(typeof e.nodeName!="string"||typeof e.textContent!="string"||typeof e.removeChild!="function"||!(e.attributes instanceof Lt)||typeof e.removeAttribute!="function"||typeof e.setAttribute!="function"||typeof e.namespaceURI!="string"||typeof e.insertBefore!="function"||typeof e.hasChildNodes!="function")},nt=function(e){return typeof ue=="function"&&e instanceof ue};function C(i,e,t){le(i,o=>{o.call(n,e,t,H)})}const ot=function(e){let t=null;if(C(g.beforeSanitizeElements,e,null),be(e))return N(e),!0;const o=p(e.nodeName);if(C(g.uponSanitizeElement,e,{tagName:o,allowedTags:m}),e.hasChildNodes()&&!nt(e.firstElementChild)&&h(/<[/\w]/g,e.innerHTML)&&h(/<[/\w]/g,e.textContent)||e.nodeType===Z.progressingInstruction||ge&&e.nodeType===Z.comment&&h(/<[/\w]/g,e.data))return N(e),!0;if(!m[o]||B[o]){if(!B[o]&&at(o)&&(u.tagNameCheck instanceof RegExp&&h(u.tagNameCheck,o)||u.tagNameCheck instanceof Function&&u.tagNameCheck(o)))return!1;if(Se&&!U[o]){const c=ee(e)||e.parentNode,E=Mt(e)||e.childNodes;if(E&&c){const T=E.length;for(let O=T-1;O>=0;--O){const D=Nt(E[O],!0);D.__removalCount=(e.__removalCount||0)+1,c.insertBefore(D,It(e))}}}return N(e),!0}return e instanceof Ue&&!Xt(e)||(o==="noscript"||o==="noembed"||o==="noframes")&&h(/<\/no(script|embed|frames)/i,e.innerHTML)?(N(e),!0):(P&&e.nodeType===Z.text&&(t=e.textContent,le([pe,de,Te],c=>{t=$(t,c," ")}),e.textContent!==t&&(V(n.removed,{element:e.cloneNode()}),e.textContent=t)),C(g.afterSanitizeElements,e,null),!1)},it=function(e,t,o){if(Xe&&(t==="id"||t==="name")&&(o in l||o in Yt))return!1;if(!(_e&&!Ee[t]&&h(kt,t))){if(!(We&&h(vt,t))){if(!d[t]||Ee[t]){if(!(at(e)&&(u.tagNameCheck instanceof RegExp&&h(u.tagNameCheck,e)||u.tagNameCheck instanceof Function&&u.tagNameCheck(e))&&(u.attributeNameCheck instanceof RegExp&&h(u.attributeNameCheck,t)||u.attributeNameCheck instanceof Function&&u.attributeNameCheck(t))||t==="is"&&u.allowCustomizedBuiltInElements&&(u.tagNameCheck instanceof RegExp&&h(u.tagNameCheck,o)||u.tagNameCheck instanceof Function&&u.tagNameCheck(o))))return!1}else if(!Re[t]){if(!h(He,$(o,Fe,""))){if(!((t==="src"||t==="xlink:href"||t==="href")&&e!=="script"&&Qt(o,"data:")===0&&$e[e])){if(!(Be&&!h(Ut,$(o,Fe,"")))){if(o)return!1}}}}}}return!0},at=function(e){return e!=="annotation-xml"&&mt(e,Ft)},rt=function(e){C(g.beforeSanitizeAttributes,e,null);const{attributes:t}=e;if(!t||be(e))return;const o={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:d,forceKeepAttr:void 0};let c=t.length;for(;c--;){const E=t[c],{name:T,namespaceURI:O,value:D}=E,j=p(T);let A=T==="value"?D:en(D);if(o.attrName=j,o.attrValue=A,o.keepAttr=!0,o.forceKeepAttr=void 0,C(g.uponSanitizeAttribute,e,o),A=o.attrValue,je&&(j==="id"||j==="name")&&(se(T,e),A=Ht+A),ge&&h(/((--!?|])>)|<\/(style|title)/i,A)){se(T,e);continue}if(o.forceKeepAttr||(se(T,e),!o.keepAttr))continue;if(!Ye&&h(/\/>/i,A)){se(T,e);continue}P&&le([pe,de,Te],lt=>{A=$(A,lt," ")});const st=p(e.nodeName);if(it(st,j,A)){if(_&&typeof Q=="object"&&typeof Q.getAttributeType=="function"&&!O)switch(Q.getAttributeType(st,j)){case"TrustedHTML":{A=_.createHTML(A);break}case"TrustedScriptURL":{A=_.createScriptURL(A);break}}try{O?e.setAttributeNS(O,T,A):e.setAttribute(T,A),be(e)?N(e):ut(n.removed)}catch{}}}C(g.afterSanitizeAttributes,e,null)},jt=function i(e){let t=null;const o=tt(e);for(C(g.beforeSanitizeShadowDOM,e,null);t=o.nextNode();)C(g.uponSanitizeShadowNode,t,null),ot(t),rt(t),t.content instanceof L&&i(t.content);C(g.afterSanitizeShadowDOM,e,null)};return n.sanitize=function(i){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=null,o=null,c=null,E=null;if(Oe=!i,Oe&&(i="<!-->"),typeof i!="string"&&!nt(i))if(typeof i.toString=="function"){if(i=i.toString(),typeof i!="string")throw q("dirty is not a string, aborting")}else throw q("toString is not a function");if(!n.isSupported)return i;if(Ae||ye(e),n.removed=[],typeof i=="string"&&(Y=!1),Y){if(i.nodeName){const D=p(i.nodeName);if(!m[D]||B[D])throw q("root node is forbidden and cannot be sanitized in-place")}}else if(i instanceof ue)t=et("<!---->"),o=t.ownerDocument.importNode(i,!0),o.nodeType===Z.element&&o.nodeName==="BODY"||o.nodeName==="HTML"?t=o:t.appendChild(o);else{if(!k&&!P&&!w&&i.indexOf("<")===-1)return _&&ne?_.createHTML(i):i;if(t=et(i),!t)return k?null:ne?W:""}t&&he&&N(t.firstChild);const T=tt(Y?i:t);for(;c=T.nextNode();)ot(c),rt(c),c.content instanceof L&&jt(c.content);if(Y)return i;if(k){if(te)for(E=wt.call(t.ownerDocument);t.firstChild;)E.appendChild(t.firstChild);else E=t;return(d.shadowroot||d.shadowrootmode)&&(E=Pt.call(r,E,!0)),E}let O=w?t.outerHTML:t.innerHTML;return w&&m["!doctype"]&&t.ownerDocument&&t.ownerDocument.doctype&&t.ownerDocument.doctype.name&&h(Rt,t.ownerDocument.doctype.name)&&(O="<!DOCTYPE "+t.ownerDocument.doctype.name+`>
1
+ import{r as J,j as ct,F as Vt}from"./index.DfNAkKAr.js";/*! @license DOMPurify 3.2.4 | (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.4/LICENSE */const{entries:At,setPrototypeOf:ft,isFrozen:$t,getPrototypeOf:qt,getOwnPropertyDescriptor:Kt}=Object;let{freeze:S,seal:y,create:ht}=Object,{apply:xe,construct:Pe}=typeof Reflect<"u"&&Reflect;S||(S=function(n){return n});y||(y=function(n){return n});xe||(xe=function(n,l,r){return n.apply(l,r)});Pe||(Pe=function(n,l){return new n(...l)});const le=R(Array.prototype.forEach),Zt=R(Array.prototype.lastIndexOf),ut=R(Array.prototype.pop),V=R(Array.prototype.push),Jt=R(Array.prototype.splice),fe=R(String.prototype.toLowerCase),Ne=R(String.prototype.toString),mt=R(String.prototype.match),$=R(String.prototype.replace),Qt=R(String.prototype.indexOf),en=R(String.prototype.trim),b=R(Object.prototype.hasOwnProperty),h=R(RegExp.prototype.test),q=tn(TypeError);function R(a){return function(n){for(var l=arguments.length,r=new Array(l>1?l-1:0),f=1;f<l;f++)r[f-1]=arguments[f];return xe(a,n,r)}}function tn(a){return function(){for(var n=arguments.length,l=new Array(n),r=0;r<n;r++)l[r]=arguments[r];return Pe(a,l)}}function s(a,n){let l=arguments.length>2&&arguments[2]!==void 0?arguments[2]:fe;ft&&ft(a,null);let r=n.length;for(;r--;){let f=n[r];if(typeof f=="string"){const L=l(f);L!==f&&($t(n)||(n[r]=L),f=L)}a[f]=!0}return a}function nn(a){for(let n=0;n<a.length;n++)b(a,n)||(a[n]=null);return a}function x(a){const n=ht(null);for(const[l,r]of At(a))b(a,l)&&(Array.isArray(r)?n[l]=nn(r):r&&typeof r=="object"&&r.constructor===Object?n[l]=x(r):n[l]=r);return n}function K(a,n){for(;a!==null;){const r=Kt(a,n);if(r){if(r.get)return R(r.get);if(typeof r.value=="function")return R(r.value)}a=qt(a)}function l(){return null}return l}const pt=S(["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"]),De=S(["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"]),Ie=S(["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"]),on=S(["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"]),Me=S(["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"]),an=S(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),dt=S(["#text"]),Tt=S(["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"]),Ce=S(["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"]),Et=S(["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"]),ce=S(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),rn=y(/\{\{[\w\W]*|[\w\W]*\}\}/gm),sn=y(/<%[\w\W]*|[\w\W]*%>/gm),ln=y(/\$\{[\w\W]*/gm),cn=y(/^data-[\-\w.\u00B7-\uFFFF]+$/),fn=y(/^aria-[\-\w]+$/),St=y(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),un=y(/^(?:\w+script|data):/i),mn=y(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Rt=y(/^html$/i),pn=y(/^[a-z][.\w]*(-[.\w]+)+$/i);var _t=Object.freeze({__proto__:null,ARIA_ATTR:fn,ATTR_WHITESPACE:mn,CUSTOM_ELEMENT:pn,DATA_ATTR:cn,DOCTYPE_NAME:Rt,ERB_EXPR:sn,IS_ALLOWED_URI:St,IS_SCRIPT_OR_DATA:un,MUSTACHE_EXPR:rn,TMPLIT_EXPR:ln});const Z={element:1,text:3,progressingInstruction:7,comment:8,document:9},dn=function(){return typeof window>"u"?null:window},Tn=function(n,l){if(typeof n!="object"||typeof n.createPolicy!="function")return null;let r=null;const f="data-tt-policy-suffix";l&&l.hasAttribute(f)&&(r=l.getAttribute(f));const L="dompurify"+(r?"#"+r:"");try{return n.createPolicy(L,{createHTML(I){return I},createScriptURL(I){return I}})}catch{return console.warn("TrustedTypes policy "+L+" could not be created."),null}},gt=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Ot(){let a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:dn();const n=i=>Ot(i);if(n.version="3.2.4",n.removed=[],!a||!a.document||a.document.nodeType!==Z.document||!a.Element)return n.isSupported=!1,n;let{document:l}=a;const r=l,f=r.currentScript,{DocumentFragment:L,HTMLTemplateElement:I,Node:ue,Element:Ue,NodeFilter:z,NamedNodeMap:Lt=a.NamedNodeMap||a.MozNamedAttrMap,HTMLFormElement:yt,DOMParser:bt,trustedTypes:Q}=a,G=Ue.prototype,Nt=K(G,"cloneNode"),Dt=K(G,"remove"),It=K(G,"nextSibling"),Mt=K(G,"childNodes"),ee=K(G,"parentNode");if(typeof I=="function"){const i=l.createElement("template");i.content&&i.content.ownerDocument&&(l=i.content.ownerDocument)}let _,W="";const{implementation:me,createNodeIterator:Ct,createDocumentFragment:wt,getElementsByTagName:xt}=l,{importNode:Pt}=r;let g=gt();n.isSupported=typeof At=="function"&&typeof ee=="function"&&me&&me.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:pe,ERB_EXPR:de,TMPLIT_EXPR:Te,DATA_ATTR:kt,ARIA_ATTR:vt,IS_SCRIPT_OR_DATA:Ut,ATTR_WHITESPACE:Fe,CUSTOM_ELEMENT:Ft}=_t;let{IS_ALLOWED_URI:He}=_t,m=null;const ze=s({},[...pt,...De,...Ie,...Me,...dt]);let d=null;const Ge=s({},[...Tt,...Ce,...Et,...ce]);let u=Object.seal(ht(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}})),B=null,Ee=null,We=!0,_e=!0,Be=!1,Ye=!0,P=!1,ge=!0,w=!1,Ae=!1,he=!1,k=!1,te=!1,ne=!1,Xe=!0,je=!1;const Ht="user-content-";let Se=!0,Y=!1,v={},U=null;const Ve=s({},["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 $e=null;const qe=s({},["audio","video","img","source","image","track"]);let Re=null;const Ke=s({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),oe="http://www.w3.org/1998/Math/MathML",ie="http://www.w3.org/2000/svg",M="http://www.w3.org/1999/xhtml";let F=M,Oe=!1,Le=null;const zt=s({},[oe,ie,M],Ne);let ae=s({},["mi","mo","mn","ms","mtext"]),re=s({},["annotation-xml"]);const Gt=s({},["title","style","font","a","script"]);let X=null;const Wt=["application/xhtml+xml","text/html"],Bt="text/html";let p=null,H=null;const Yt=l.createElement("form"),Ze=function(e){return e instanceof RegExp||e instanceof Function},ye=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(H&&H===e)){if((!e||typeof e!="object")&&(e={}),e=x(e),X=Wt.indexOf(e.PARSER_MEDIA_TYPE)===-1?Bt:e.PARSER_MEDIA_TYPE,p=X==="application/xhtml+xml"?Ne:fe,m=b(e,"ALLOWED_TAGS")?s({},e.ALLOWED_TAGS,p):ze,d=b(e,"ALLOWED_ATTR")?s({},e.ALLOWED_ATTR,p):Ge,Le=b(e,"ALLOWED_NAMESPACES")?s({},e.ALLOWED_NAMESPACES,Ne):zt,Re=b(e,"ADD_URI_SAFE_ATTR")?s(x(Ke),e.ADD_URI_SAFE_ATTR,p):Ke,$e=b(e,"ADD_DATA_URI_TAGS")?s(x(qe),e.ADD_DATA_URI_TAGS,p):qe,U=b(e,"FORBID_CONTENTS")?s({},e.FORBID_CONTENTS,p):Ve,B=b(e,"FORBID_TAGS")?s({},e.FORBID_TAGS,p):{},Ee=b(e,"FORBID_ATTR")?s({},e.FORBID_ATTR,p):{},v=b(e,"USE_PROFILES")?e.USE_PROFILES:!1,We=e.ALLOW_ARIA_ATTR!==!1,_e=e.ALLOW_DATA_ATTR!==!1,Be=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Ye=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,P=e.SAFE_FOR_TEMPLATES||!1,ge=e.SAFE_FOR_XML!==!1,w=e.WHOLE_DOCUMENT||!1,k=e.RETURN_DOM||!1,te=e.RETURN_DOM_FRAGMENT||!1,ne=e.RETURN_TRUSTED_TYPE||!1,he=e.FORCE_BODY||!1,Xe=e.SANITIZE_DOM!==!1,je=e.SANITIZE_NAMED_PROPS||!1,Se=e.KEEP_CONTENT!==!1,Y=e.IN_PLACE||!1,He=e.ALLOWED_URI_REGEXP||St,F=e.NAMESPACE||M,ae=e.MATHML_TEXT_INTEGRATION_POINTS||ae,re=e.HTML_INTEGRATION_POINTS||re,u=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&Ze(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(u.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&Ze(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(u.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(u.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),P&&(_e=!1),te&&(k=!0),v&&(m=s({},dt),d=[],v.html===!0&&(s(m,pt),s(d,Tt)),v.svg===!0&&(s(m,De),s(d,Ce),s(d,ce)),v.svgFilters===!0&&(s(m,Ie),s(d,Ce),s(d,ce)),v.mathMl===!0&&(s(m,Me),s(d,Et),s(d,ce))),e.ADD_TAGS&&(m===ze&&(m=x(m)),s(m,e.ADD_TAGS,p)),e.ADD_ATTR&&(d===Ge&&(d=x(d)),s(d,e.ADD_ATTR,p)),e.ADD_URI_SAFE_ATTR&&s(Re,e.ADD_URI_SAFE_ATTR,p),e.FORBID_CONTENTS&&(U===Ve&&(U=x(U)),s(U,e.FORBID_CONTENTS,p)),Se&&(m["#text"]=!0),w&&s(m,["html","head","body"]),m.table&&(s(m,["tbody"]),delete B.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!="function")throw q('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw q('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');_=e.TRUSTED_TYPES_POLICY,W=_.createHTML("")}else _===void 0&&(_=Tn(Q,f)),_!==null&&typeof W=="string"&&(W=_.createHTML(""));S&&S(e),H=e}},Je=s({},[...De,...Ie,...on]),Qe=s({},[...Me,...an]),Xt=function(e){let t=ee(e);(!t||!t.tagName)&&(t={namespaceURI:F,tagName:"template"});const o=fe(e.tagName),c=fe(t.tagName);return Le[e.namespaceURI]?e.namespaceURI===ie?t.namespaceURI===M?o==="svg":t.namespaceURI===oe?o==="svg"&&(c==="annotation-xml"||ae[c]):!!Je[o]:e.namespaceURI===oe?t.namespaceURI===M?o==="math":t.namespaceURI===ie?o==="math"&&re[c]:!!Qe[o]:e.namespaceURI===M?t.namespaceURI===ie&&!re[c]||t.namespaceURI===oe&&!ae[c]?!1:!Qe[o]&&(Gt[o]||!Je[o]):!!(X==="application/xhtml+xml"&&Le[e.namespaceURI]):!1},N=function(e){V(n.removed,{element:e});try{ee(e).removeChild(e)}catch{Dt(e)}},se=function(e,t){try{V(n.removed,{attribute:t.getAttributeNode(e),from:t})}catch{V(n.removed,{attribute:null,from:t})}if(t.removeAttribute(e),e==="is")if(k||te)try{N(t)}catch{}else try{t.setAttribute(e,"")}catch{}},et=function(e){let t=null,o=null;if(he)e="<remove></remove>"+e;else{const T=mt(e,/^[\r\n\t ]+/);o=T&&T[0]}X==="application/xhtml+xml"&&F===M&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");const c=_?_.createHTML(e):e;if(F===M)try{t=new bt().parseFromString(c,X)}catch{}if(!t||!t.documentElement){t=me.createDocument(F,"template",null);try{t.documentElement.innerHTML=Oe?W:c}catch{}}const E=t.body||t.documentElement;return e&&o&&E.insertBefore(l.createTextNode(o),E.childNodes[0]||null),F===M?xt.call(t,w?"html":"body")[0]:w?t.documentElement:E},tt=function(e){return Ct.call(e.ownerDocument||e,e,z.SHOW_ELEMENT|z.SHOW_COMMENT|z.SHOW_TEXT|z.SHOW_PROCESSING_INSTRUCTION|z.SHOW_CDATA_SECTION,null)},be=function(e){return e instanceof yt&&(typeof e.nodeName!="string"||typeof e.textContent!="string"||typeof e.removeChild!="function"||!(e.attributes instanceof Lt)||typeof e.removeAttribute!="function"||typeof e.setAttribute!="function"||typeof e.namespaceURI!="string"||typeof e.insertBefore!="function"||typeof e.hasChildNodes!="function")},nt=function(e){return typeof ue=="function"&&e instanceof ue};function C(i,e,t){le(i,o=>{o.call(n,e,t,H)})}const ot=function(e){let t=null;if(C(g.beforeSanitizeElements,e,null),be(e))return N(e),!0;const o=p(e.nodeName);if(C(g.uponSanitizeElement,e,{tagName:o,allowedTags:m}),e.hasChildNodes()&&!nt(e.firstElementChild)&&h(/<[/\w]/g,e.innerHTML)&&h(/<[/\w]/g,e.textContent)||e.nodeType===Z.progressingInstruction||ge&&e.nodeType===Z.comment&&h(/<[/\w]/g,e.data))return N(e),!0;if(!m[o]||B[o]){if(!B[o]&&at(o)&&(u.tagNameCheck instanceof RegExp&&h(u.tagNameCheck,o)||u.tagNameCheck instanceof Function&&u.tagNameCheck(o)))return!1;if(Se&&!U[o]){const c=ee(e)||e.parentNode,E=Mt(e)||e.childNodes;if(E&&c){const T=E.length;for(let O=T-1;O>=0;--O){const D=Nt(E[O],!0);D.__removalCount=(e.__removalCount||0)+1,c.insertBefore(D,It(e))}}}return N(e),!0}return e instanceof Ue&&!Xt(e)||(o==="noscript"||o==="noembed"||o==="noframes")&&h(/<\/no(script|embed|frames)/i,e.innerHTML)?(N(e),!0):(P&&e.nodeType===Z.text&&(t=e.textContent,le([pe,de,Te],c=>{t=$(t,c," ")}),e.textContent!==t&&(V(n.removed,{element:e.cloneNode()}),e.textContent=t)),C(g.afterSanitizeElements,e,null),!1)},it=function(e,t,o){if(Xe&&(t==="id"||t==="name")&&(o in l||o in Yt))return!1;if(!(_e&&!Ee[t]&&h(kt,t))){if(!(We&&h(vt,t))){if(!d[t]||Ee[t]){if(!(at(e)&&(u.tagNameCheck instanceof RegExp&&h(u.tagNameCheck,e)||u.tagNameCheck instanceof Function&&u.tagNameCheck(e))&&(u.attributeNameCheck instanceof RegExp&&h(u.attributeNameCheck,t)||u.attributeNameCheck instanceof Function&&u.attributeNameCheck(t))||t==="is"&&u.allowCustomizedBuiltInElements&&(u.tagNameCheck instanceof RegExp&&h(u.tagNameCheck,o)||u.tagNameCheck instanceof Function&&u.tagNameCheck(o))))return!1}else if(!Re[t]){if(!h(He,$(o,Fe,""))){if(!((t==="src"||t==="xlink:href"||t==="href")&&e!=="script"&&Qt(o,"data:")===0&&$e[e])){if(!(Be&&!h(Ut,$(o,Fe,"")))){if(o)return!1}}}}}}return!0},at=function(e){return e!=="annotation-xml"&&mt(e,Ft)},rt=function(e){C(g.beforeSanitizeAttributes,e,null);const{attributes:t}=e;if(!t||be(e))return;const o={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:d,forceKeepAttr:void 0};let c=t.length;for(;c--;){const E=t[c],{name:T,namespaceURI:O,value:D}=E,j=p(T);let A=T==="value"?D:en(D);if(o.attrName=j,o.attrValue=A,o.keepAttr=!0,o.forceKeepAttr=void 0,C(g.uponSanitizeAttribute,e,o),A=o.attrValue,je&&(j==="id"||j==="name")&&(se(T,e),A=Ht+A),ge&&h(/((--!?|])>)|<\/(style|title)/i,A)){se(T,e);continue}if(o.forceKeepAttr||(se(T,e),!o.keepAttr))continue;if(!Ye&&h(/\/>/i,A)){se(T,e);continue}P&&le([pe,de,Te],lt=>{A=$(A,lt," ")});const st=p(e.nodeName);if(it(st,j,A)){if(_&&typeof Q=="object"&&typeof Q.getAttributeType=="function"&&!O)switch(Q.getAttributeType(st,j)){case"TrustedHTML":{A=_.createHTML(A);break}case"TrustedScriptURL":{A=_.createScriptURL(A);break}}try{O?e.setAttributeNS(O,T,A):e.setAttribute(T,A),be(e)?N(e):ut(n.removed)}catch{}}}C(g.afterSanitizeAttributes,e,null)},jt=function i(e){let t=null;const o=tt(e);for(C(g.beforeSanitizeShadowDOM,e,null);t=o.nextNode();)C(g.uponSanitizeShadowNode,t,null),ot(t),rt(t),t.content instanceof L&&i(t.content);C(g.afterSanitizeShadowDOM,e,null)};return n.sanitize=function(i){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=null,o=null,c=null,E=null;if(Oe=!i,Oe&&(i="<!-->"),typeof i!="string"&&!nt(i))if(typeof i.toString=="function"){if(i=i.toString(),typeof i!="string")throw q("dirty is not a string, aborting")}else throw q("toString is not a function");if(!n.isSupported)return i;if(Ae||ye(e),n.removed=[],typeof i=="string"&&(Y=!1),Y){if(i.nodeName){const D=p(i.nodeName);if(!m[D]||B[D])throw q("root node is forbidden and cannot be sanitized in-place")}}else if(i instanceof ue)t=et("<!---->"),o=t.ownerDocument.importNode(i,!0),o.nodeType===Z.element&&o.nodeName==="BODY"||o.nodeName==="HTML"?t=o:t.appendChild(o);else{if(!k&&!P&&!w&&i.indexOf("<")===-1)return _&&ne?_.createHTML(i):i;if(t=et(i),!t)return k?null:ne?W:""}t&&he&&N(t.firstChild);const T=tt(Y?i:t);for(;c=T.nextNode();)ot(c),rt(c),c.content instanceof L&&jt(c.content);if(Y)return i;if(k){if(te)for(E=wt.call(t.ownerDocument);t.firstChild;)E.appendChild(t.firstChild);else E=t;return(d.shadowroot||d.shadowrootmode)&&(E=Pt.call(r,E,!0)),E}let O=w?t.outerHTML:t.innerHTML;return w&&m["!doctype"]&&t.ownerDocument&&t.ownerDocument.doctype&&t.ownerDocument.doctype.name&&h(Rt,t.ownerDocument.doctype.name)&&(O="<!DOCTYPE "+t.ownerDocument.doctype.name+`>
2
2
  `+O),P&&le([pe,de,Te],D=>{O=$(O,D," ")}),_&&ne?_.createHTML(O):O},n.setConfig=function(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};ye(i),Ae=!0},n.clearConfig=function(){H=null,Ae=!1},n.isValidAttribute=function(i,e,t){H||ye({});const o=p(i),c=p(e);return it(o,c,t)},n.addHook=function(i,e){typeof e=="function"&&V(g[i],e)},n.removeHook=function(i,e){if(e!==void 0){const t=Zt(g[i],e);return t===-1?void 0:Jt(g[i],t,1)[0]}return ut(g[i])},n.removeHooks=function(i){g[i]=[]},n.removeAllHooks=function(){g=gt()},n}var ve=Ot();const ke="data-temp-href-target";ve.addHook("beforeSanitizeAttributes",function(a){a instanceof HTMLElement&&a.hasAttribute("target")&&a.getAttribute("target")==="_blank"&&a.setAttribute(ke,"_blank")});ve.addHook("afterSanitizeAttributes",function(a){a instanceof HTMLElement&&a.hasAttribute(ke)&&(a.setAttribute("target","_blank"),a.setAttribute("rel","noopener noreferrer"),a.removeAttribute(ke))});const we=a=>{const n={USE_PROFILES:{html:!0},FORCE_BODY:!0};return ve.sanitize(a,n)};function En({element:a}){const{body:n}=a,[l,r]=J.useState(we(n)),f=J.useRef(null);return J.useEffect(()=>{we(n)!==l&&r(we(n))},[n]),J.useEffect(()=>{var L,I;((L=f.current)==null?void 0:L.clientHeight)===0&&((I=f.current.parentElement)==null?void 0:I.childElementCount)===1&&f.current.parentElement.classList.add("stHtml-empty")}),ct(Vt,{children:l&&ct("div",{className:"stHtml","data-testid":"stHtml",ref:f,dangerouslySetInnerHTML:{__html:l}})})}const gn=J.memo(En);export{gn as default};