streamlit-nightly 1.53.2.dev20260125__py3-none-any.whl → 1.53.2.dev20260128__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.
- streamlit/commands/logo.py +81 -25
- streamlit/config.py +11 -0
- streamlit/deprecation_util.py +19 -1
- streamlit/elements/arrow.py +2 -1
- streamlit/elements/lib/built_in_chart_utils.py +2 -2
- streamlit/elements/lib/options_selector_utils.py +72 -22
- streamlit/elements/widgets/select_slider.py +123 -37
- streamlit/hello/plotting_demo.py +19 -12
- streamlit/proto/Logo_pb2.py +5 -3
- streamlit/proto/Logo_pb2.pyi +25 -1
- streamlit/proto/NewSession_pb2.py +24 -22
- streamlit/proto/NewSession_pb2.pyi +23 -1
- streamlit/proto/Slider_pb2.py +6 -6
- streamlit/proto/Slider_pb2.pyi +9 -1
- streamlit/runtime/app_session.py +19 -0
- streamlit/runtime/scriptrunner/script_runner.py +17 -0
- streamlit/runtime/scriptrunner_utils/script_run_context.py +13 -10
- streamlit/runtime/state/__init__.py +7 -1
- streamlit/runtime/state/common.py +13 -0
- streamlit/runtime/state/query_params.py +494 -6
- streamlit/runtime/state/session_state.py +178 -3
- streamlit/runtime/state/widgets.py +26 -1
- streamlit/static/index.html +1 -1
- streamlit/static/manifest.json +299 -299
- streamlit/static/static/js/{ErrorOutline.esm.CIFYUdwC.js → ErrorOutline.esm.D71F8ziR.js} +1 -1
- streamlit/static/static/js/{FileDownload.esm.DWVTnTHm.js → FileDownload.esm.yTkppsJy.js} +1 -1
- streamlit/static/static/js/{FileHelper.BPYQIPd1.js → FileHelper.hUOqtbwa.js} +1 -1
- streamlit/static/static/js/{FormClearHelper.CypmvhYZ.js → FormClearHelper.DN8D_YXO.js} +1 -1
- streamlit/static/static/js/{InputInstructions.Bi62hDTQ.js → InputInstructions.DbssY6d4.js} +1 -1
- streamlit/static/static/js/{Particles.yebG0VuV.js → Particles.BznyVdfo.js} +1 -1
- streamlit/static/static/js/{ProgressBar.Dy9CI6w4.js → ProgressBar.C5uBOtcx.js} +1 -1
- streamlit/static/static/js/{StreamlitSyntaxHighlighter.Btk92CPv.js → StreamlitSyntaxHighlighter.Nf1895x-.js} +1 -1
- streamlit/static/static/js/{TableChart.esm.DBeVaFNt.js → TableChart.esm.DHKzVs3a.js} +1 -1
- streamlit/static/static/js/{Toolbar.DC2Tp-qb.js → Toolbar.CQsWYXer.js} +1 -1
- streamlit/static/static/js/{WidgetLabelHelpIconInline.3DnEd9BK.js → WidgetLabelHelpIconInline.6xCU76OE.js} +1 -1
- streamlit/static/static/js/{base-input.7Sj6pVk0.js → base-input.Cs-E6S71.js} +1 -1
- streamlit/static/static/js/{checkbox.CcUx3XuQ.js → checkbox.OTGupu18.js} +1 -1
- streamlit/static/static/js/{createDownloadLinkElement.DZuwkCqy.js → createDownloadLinkElement.DnBEQQbK.js} +1 -1
- streamlit/static/static/js/{data-grid-overlay-editor.Dw-AewlN.js → data-grid-overlay-editor.COiiMi5r.js} +1 -1
- streamlit/static/static/js/{downloader.Bsx5M2Du.js → downloader.K0GUNeuj.js} +1 -1
- streamlit/static/static/js/embed.o8HvK3mH.js +193 -0
- streamlit/static/static/js/{es6.BpAqZaR_.js → es6.BHy5pqTP.js} +2 -2
- streamlit/static/static/js/{formatNumber.DjehVPVS.js → formatNumber.BK7h0k2z.js} +1 -1
- streamlit/static/static/js/{iconPosition.D02OPE-d.js → iconPosition.2YynQUxu.js} +1 -1
- streamlit/static/static/js/{iframeResizer.contentWindow.xtstqPd7.js → iframeResizer.contentWindow.D5h3hQuU.js} +1 -1
- streamlit/static/static/js/{index.5H98WqjT.js → index.5zqfJ-in.js} +1 -1
- streamlit/static/static/js/{index.B5tD5YeV.js → index.6c-qDsD7.js} +1 -1
- streamlit/static/static/js/{index.CA0RmxJF.js → index.8MlRyIxN.js} +1 -1
- streamlit/static/static/js/{index.DSSapl3Q.js → index.BIqcOZ_u.js} +1 -1
- streamlit/static/static/js/{index.DJjSqPAx.js → index.BPdmXoYW.js} +1 -1
- streamlit/static/static/js/{index.iXzAofuY.js → index.BZ-GJVxB.js} +2 -2
- streamlit/static/static/js/{index.CKUBdVQ9.js → index.BfMPq234.js} +1 -1
- streamlit/static/static/js/{index.B8-HOwf1.js → index.Bfo1cXfC.js} +1 -1
- streamlit/static/static/js/{index.-faJDV20.js → index.Bgf49D1Z.js} +1 -1
- streamlit/static/static/js/{index.CgARjn28.js → index.Bqmx23jK.js} +1 -1
- streamlit/static/static/js/{index.D6Z9hKJY.js → index.BtRWcqZV.js} +1 -1
- streamlit/static/static/js/{index.ZIA43eTF.js → index.BtuskCwg.js} +1 -1
- streamlit/static/static/js/{index.BV6XgCij.js → index.BzTVI_BY.js} +1 -1
- streamlit/static/static/js/{index.DDu_qTm0.js → index.C2EoeVjP.js} +1 -1
- streamlit/static/static/js/{index.8FPw0_gD.js → index.C65jHNhe.js} +1 -1
- streamlit/static/static/js/{index.D6J2UPzF.js → index.C6wyTXhz.js} +1 -1
- streamlit/static/static/js/{index.CGbvkEtg.js → index.C7wst9Tm.js} +1 -1
- streamlit/static/static/js/{index.BIcJe97b.js → index.COh5V_89.js} +1 -1
- streamlit/static/static/js/index.CSPY26T2.js +1 -0
- streamlit/static/static/js/{index.CEwnDCn9.js → index.CUkhn-vu.js} +1 -1
- streamlit/static/static/js/{index.DO2T-QzF.js → index.CX0KdFyR.js} +1 -1
- streamlit/static/static/js/{index.BDlI2pRp.js → index.CYhhEdja.js} +1 -1
- streamlit/static/static/js/{index.DgLRJfs3.js → index.CZf7Go1Z.js} +1 -1
- streamlit/static/static/js/{index.DZv5AoR1.js → index.Cb03y5I8.js} +1 -1
- streamlit/static/static/js/{index.BVhVdVeE.js → index.CdsyTabv.js} +1 -1
- streamlit/static/static/js/{index.JL0uGAeJ.js → index.CgVv04GM.js} +1 -1
- streamlit/static/static/js/index.CjRU8O1O.js +2 -0
- streamlit/static/static/js/{index.BqfJJr3c.js → index.CwtpGPHA.js} +1 -1
- streamlit/static/static/js/{index.iF5zYERg.js → index.CxWzt6oi.js} +1 -1
- streamlit/static/static/js/{index.m3dn5Bai.js → index.DBPWUJsj.js} +5 -5
- streamlit/static/static/js/{index.D9RL5sRp.js → index.DJfMW0Gy.js} +1 -1
- streamlit/static/static/js/{index.BOkpEbJS.js → index.DLUSo6de.js} +1 -1
- streamlit/static/static/js/{index.S-mjkUeF.js → index.DL_yE83J.js} +1 -1
- streamlit/static/static/js/{index.BK9S5qug.js → index.DVRCyxMp.js} +1 -1
- streamlit/static/static/js/{index.D_TIyPF4.js → index.Dc5-tFdw.js} +1 -1
- streamlit/static/static/js/index.DcngUOyD.js +2 -0
- streamlit/static/static/js/{index.B9gbSNsw.js → index.Dh3PJIlq.js} +1 -1
- streamlit/static/static/js/{index.BvZbnSMC.js → index.DlgcEr0f.js} +1 -1
- streamlit/static/static/js/{index.Bo1ztye0.js → index.DxGXuhh6.js} +1 -1
- streamlit/static/static/js/{index.x1B588Xu.js → index.DxfYCrPp.js} +1 -1
- streamlit/static/static/js/{index.CyDHwK5P.js → index.HmRK3HyC.js} +1 -1
- streamlit/static/static/js/{index.DdxofXV8.js → index.TjMWsKSH.js} +3 -3
- streamlit/static/static/js/{index.Bri1T2TS.js → index.VwDKazgt.js} +1 -1
- streamlit/static/static/js/{index.BB_iwaVr.js → index.aCorc3Yt.js} +34 -34
- streamlit/static/static/js/{index.CdRwiHPm.js → index.cfuZ69LI.js} +1 -1
- streamlit/static/static/js/{index.C9v49R-a.js → index.hlAfdSqC.js} +1 -1
- streamlit/static/static/js/{index.BGTMh3Uu.js → index.iUV9rb8C.js} +1 -1
- streamlit/static/static/js/{index.XFMDBL5n.js → index.q0ceUXt6.js} +1 -1
- streamlit/static/static/js/{input.VYKyGuhi.js → input.CXGIJ7D6.js} +1 -1
- streamlit/static/static/js/{main.u5Bb3MY7.js → main.CCVkbuxC.js} +1 -1
- streamlit/static/static/js/{memory.BOMt4yAV.js → memory.CNbnYs2A.js} +1 -1
- streamlit/static/static/js/{number-overlay-editor.CihlAHgl.js → number-overlay-editor.CvI6wkld.js} +1 -1
- streamlit/static/static/js/{pandasStylerUtils.BuqSgXpk.js → pandasStylerUtils.CFSReOTm.js} +1 -1
- streamlit/static/static/js/{sandbox.COGR4pqz.js → sandbox.Bld0L3us.js} +1 -1
- streamlit/static/static/js/{styled-components.BEf3c4IJ.js → styled-components.BoUHK6TA.js} +1 -1
- streamlit/static/static/js/{throttle.Bl-XsA9N.js → throttle.ByDFm7WV.js} +1 -1
- streamlit/static/static/js/{timepicker.B-HgBYlK.js → timepicker.CN6CUZEL.js} +1 -1
- streamlit/static/static/js/{toConsumableArray.BrQebwtE.js → toConsumableArray.DwMycSpg.js} +1 -1
- streamlit/static/static/js/uniqueId.DcCWa2cf.js +1 -0
- streamlit/static/static/js/{useBasicWidgetState.8WwISl9r.js → useBasicWidgetState.Bg0ZMUt5.js} +1 -1
- streamlit/static/static/js/{useIntlLocale.D37LWdCR.js → useIntlLocale.DgBUDcPA.js} +1 -1
- streamlit/static/static/js/{useTextInputAutoExpand.Bb_KqJvq.js → useTextInputAutoExpand.DDBezxks.js} +1 -1
- streamlit/static/static/js/{useUpdateUiValue.D1BLS5t7.js → useUpdateUiValue.Df1h6fXC.js} +1 -1
- streamlit/static/static/js/{useWaveformController.Ce0-qTws.js → useWaveformController.DbWw5MEk.js} +1 -1
- streamlit/static/static/js/{withCalculatedWidth.BX2K3UVv.js → withCalculatedWidth.YaK0HIIP.js} +1 -1
- streamlit/static/static/js/{withFullScreenWrapper.CqfGs8T2.js → withFullScreenWrapper.CcWCKoY8.js} +1 -1
- streamlit/testing/v1/element_tree.py +23 -8
- streamlit/web/bootstrap.py +5 -2
- streamlit/web/server/server_util.py +22 -0
- {streamlit_nightly-1.53.2.dev20260125.dist-info → streamlit_nightly-1.53.2.dev20260128.dist-info}/METADATA +1 -1
- {streamlit_nightly-1.53.2.dev20260125.dist-info → streamlit_nightly-1.53.2.dev20260128.dist-info}/RECORD +120 -120
- streamlit/static/static/js/embed.C7by6AoE.js +0 -195
- streamlit/static/static/js/index.Bhy8EBYI.js +0 -2
- streamlit/static/static/js/index.C5ehUqNt.js +0 -2
- streamlit/static/static/js/index.m4WkwGMu.js +0 -1
- streamlit/static/static/js/uniqueId.8R4hbkYl.js +0 -1
- {streamlit_nightly-1.53.2.dev20260125.data → streamlit_nightly-1.53.2.dev20260128.data}/scripts/streamlit.cmd +0 -0
- {streamlit_nightly-1.53.2.dev20260125.dist-info → streamlit_nightly-1.53.2.dev20260128.dist-info}/WHEEL +0 -0
- {streamlit_nightly-1.53.2.dev20260125.dist-info → streamlit_nightly-1.53.2.dev20260128.dist-info}/entry_points.txt +0 -0
- {streamlit_nightly-1.53.2.dev20260125.dist-info → streamlit_nightly-1.53.2.dev20260128.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{z as qt,r as x,j as te}from"./index.aCorc3Yt.js";const{entries:gt,setPrototypeOf:ft,isFrozen:Kt,getPrototypeOf:Zt,getOwnPropertyDescriptor:Jt}=Object;let{freeze:R,seal:O,create:ht}=Object,{apply:ve,construct:Ue}=typeof Reflect<"u"&&Reflect;R||(R=function(n){return n});O||(O=function(n){return n});ve||(ve=function(n,s,a){return n.apply(s,a)});Ue||(Ue=function(n,s){return new n(...s)});const me=y(Array.prototype.forEach),Qt=y(Array.prototype.lastIndexOf),ut=y(Array.prototype.pop),K=y(Array.prototype.push),en=y(Array.prototype.splice),de=y(String.prototype.toLowerCase),Ce=y(String.prototype.toString),mt=y(String.prototype.match),Z=y(String.prototype.replace),tn=y(String.prototype.indexOf),nn=y(String.prototype.trim),b=y(Object.prototype.hasOwnProperty),S=y(RegExp.prototype.test),J=on(TypeError);function y(o){return function(n){n instanceof RegExp&&(n.lastIndex=0);for(var s=arguments.length,a=new Array(s>1?s-1:0),d=1;d<s;d++)a[d-1]=arguments[d];return ve(o,n,a)}}function on(o){return function(){for(var n=arguments.length,s=new Array(n),a=0;a<n;a++)s[a]=arguments[a];return Ue(o,s)}}function l(o,n){let s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:de;ft&&ft(o,null);let a=n.length;for(;a--;){let d=n[a];if(typeof d=="string"){const A=s(d);A!==d&&(Kt(n)||(n[a]=A),d=A)}o[d]=!0}return o}function rn(o){for(let n=0;n<o.length;n++)b(o,n)||(o[n]=null);return o}function w(o){const n=ht(null);for(const[s,a]of gt(o))b(o,s)&&(Array.isArray(a)?n[s]=rn(a):a&&typeof a=="object"&&a.constructor===Object?n[s]=w(a):n[s]=a);return n}function Q(o,n){for(;o!==null;){const a=Jt(o,n);if(a){if(a.get)return y(a.get);if(typeof a.value=="function")return y(a.value)}o=Zt(o)}function s(){return null}return s}const pt=R(["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"]),we=R(["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"]),xe=R(["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"]),an=R(["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"]),Pe=R(["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"]),sn=R(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),dt=R(["#text"]),Tt=R(["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"]),ke=R(["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"]),_t=R(["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"]),pe=R(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),ln=O(/\{\{[\w\W]*|[\w\W]*\}\}/gm),cn=O(/<%[\w\W]*|[\w\W]*%>/gm),fn=O(/\$\{[\w\W]*/gm),un=O(/^data-[\-\w.\u00B7-\uFFFF]+$/),mn=O(/^aria-[\-\w]+$/),St=O(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),pn=O(/^(?:\w+script|data):/i),dn=O(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Rt=O(/^html$/i),Tn=O(/^[a-z][.\w]*(-[.\w]+)+$/i);var Et=Object.freeze({__proto__:null,ARIA_ATTR:mn,ATTR_WHITESPACE:dn,CUSTOM_ELEMENT:Tn,DATA_ATTR:un,DOCTYPE_NAME:Rt,ERB_EXPR:cn,IS_ALLOWED_URI:St,IS_SCRIPT_OR_DATA:pn,MUSTACHE_EXPR:ln,TMPLIT_EXPR:fn});const ee={element:1,text:3,progressingInstruction:7,comment:8,document:9},_n=function(){return typeof window>"u"?null:window},En=function(n,s){if(typeof n!="object"||typeof n.createPolicy!="function")return null;let a=null;const d="data-tt-policy-suffix";s&&s.hasAttribute(d)&&(a=s.getAttribute(d));const A="dompurify"+(a?"#"+a:"");try{return n.createPolicy(A,{createHTML(I){return I},createScriptURL(I){return I}})}catch{return console.warn("TrustedTypes policy "+A+" could not be created."),null}},At=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function yt(){let o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:_n();const n=r=>yt(r);if(n.version="3.2.6",n.removed=[],!o||!o.document||o.document.nodeType!==ee.document||!o.Element)return n.isSupported=!1,n;let{document:s}=o;const a=s,d=a.currentScript,{DocumentFragment:A,HTMLTemplateElement:I,Node:G,Element:ne,NodeFilter:B,NamedNodeMap:bt=o.NamedNodeMap||o.MozNamedAttrMap,HTMLFormElement:It,DOMParser:Dt,trustedTypes:oe}=o,Y=ne.prototype,Nt=Q(Y,"cloneNode"),Mt=Q(Y,"remove"),Ct=Q(Y,"nextSibling"),wt=Q(Y,"childNodes"),ie=Q(Y,"parentNode");if(typeof I=="function"){const r=s.createElement("template");r.content&&r.content.ownerDocument&&(s=r.content.ownerDocument)}let g,X="";const{implementation:_e,createNodeIterator:xt,createDocumentFragment:Pt,getElementsByTagName:kt}=s,{importNode:vt}=a;let h=At();n.isSupported=typeof gt=="function"&&typeof ie=="function"&&_e&&_e.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:Ee,ERB_EXPR:Ae,TMPLIT_EXPR:ge,DATA_ATTR:Ut,ARIA_ATTR:Ht,IS_SCRIPT_OR_DATA:Ft,ATTR_WHITESPACE:Fe,CUSTOM_ELEMENT:zt}=Et;let{IS_ALLOWED_URI:ze}=Et,m=null;const We=l({},[...pt,...we,...xe,...Pe,...dt]);let T=null;const Ge=l({},[...Tt,...ke,..._t,...pe]);let f=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}})),j=null,he=null,Be=!0,Se=!0,Ye=!1,Xe=!0,k=!1,re=!0,P=!1,Re=!1,ye=!1,v=!1,ae=!1,se=!1,je=!0,Ve=!1;const Wt="user-content-";let Le=!0,V=!1,U={},H=null;const $e=l({},["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 qe=null;const Ke=l({},["audio","video","img","source","image","track"]);let Oe=null;const Ze=l({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),le="http://www.w3.org/1998/Math/MathML",ce="http://www.w3.org/2000/svg",N="http://www.w3.org/1999/xhtml";let F=N,be=!1,Ie=null;const Gt=l({},[le,ce,N],Ce);let fe=l({},["mi","mo","mn","ms","mtext"]),ue=l({},["annotation-xml"]);const Bt=l({},["title","style","font","a","script"]);let $=null;const Yt=["application/xhtml+xml","text/html"],Xt="text/html";let p=null,z=null;const jt=s.createElement("form"),Je=function(e){return e instanceof RegExp||e instanceof Function},De=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(z&&z===e)){if((!e||typeof e!="object")&&(e={}),e=w(e),$=Yt.indexOf(e.PARSER_MEDIA_TYPE)===-1?Xt:e.PARSER_MEDIA_TYPE,p=$==="application/xhtml+xml"?Ce:de,m=b(e,"ALLOWED_TAGS")?l({},e.ALLOWED_TAGS,p):We,T=b(e,"ALLOWED_ATTR")?l({},e.ALLOWED_ATTR,p):Ge,Ie=b(e,"ALLOWED_NAMESPACES")?l({},e.ALLOWED_NAMESPACES,Ce):Gt,Oe=b(e,"ADD_URI_SAFE_ATTR")?l(w(Ze),e.ADD_URI_SAFE_ATTR,p):Ze,qe=b(e,"ADD_DATA_URI_TAGS")?l(w(Ke),e.ADD_DATA_URI_TAGS,p):Ke,H=b(e,"FORBID_CONTENTS")?l({},e.FORBID_CONTENTS,p):$e,j=b(e,"FORBID_TAGS")?l({},e.FORBID_TAGS,p):w({}),he=b(e,"FORBID_ATTR")?l({},e.FORBID_ATTR,p):w({}),U=b(e,"USE_PROFILES")?e.USE_PROFILES:!1,Be=e.ALLOW_ARIA_ATTR!==!1,Se=e.ALLOW_DATA_ATTR!==!1,Ye=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Xe=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,k=e.SAFE_FOR_TEMPLATES||!1,re=e.SAFE_FOR_XML!==!1,P=e.WHOLE_DOCUMENT||!1,v=e.RETURN_DOM||!1,ae=e.RETURN_DOM_FRAGMENT||!1,se=e.RETURN_TRUSTED_TYPE||!1,ye=e.FORCE_BODY||!1,je=e.SANITIZE_DOM!==!1,Ve=e.SANITIZE_NAMED_PROPS||!1,Le=e.KEEP_CONTENT!==!1,V=e.IN_PLACE||!1,ze=e.ALLOWED_URI_REGEXP||St,F=e.NAMESPACE||N,fe=e.MATHML_TEXT_INTEGRATION_POINTS||fe,ue=e.HTML_INTEGRATION_POINTS||ue,f=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&Je(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(f.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&Je(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(f.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(f.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),k&&(Se=!1),ae&&(v=!0),U&&(m=l({},dt),T=[],U.html===!0&&(l(m,pt),l(T,Tt)),U.svg===!0&&(l(m,we),l(T,ke),l(T,pe)),U.svgFilters===!0&&(l(m,xe),l(T,ke),l(T,pe)),U.mathMl===!0&&(l(m,Pe),l(T,_t),l(T,pe))),e.ADD_TAGS&&(m===We&&(m=w(m)),l(m,e.ADD_TAGS,p)),e.ADD_ATTR&&(T===Ge&&(T=w(T)),l(T,e.ADD_ATTR,p)),e.ADD_URI_SAFE_ATTR&&l(Oe,e.ADD_URI_SAFE_ATTR,p),e.FORBID_CONTENTS&&(H===$e&&(H=w(H)),l(H,e.FORBID_CONTENTS,p)),Le&&(m["#text"]=!0),P&&l(m,["html","head","body"]),m.table&&(l(m,["tbody"]),delete j.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!="function")throw J('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw J('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');g=e.TRUSTED_TYPES_POLICY,X=g.createHTML("")}else g===void 0&&(g=En(oe,d)),g!==null&&typeof X=="string"&&(X=g.createHTML(""));R&&R(e),z=e}},Qe=l({},[...we,...xe,...an]),et=l({},[...Pe,...sn]),Vt=function(e){let t=ie(e);(!t||!t.tagName)&&(t={namespaceURI:F,tagName:"template"});const i=de(e.tagName),c=de(t.tagName);return Ie[e.namespaceURI]?e.namespaceURI===ce?t.namespaceURI===N?i==="svg":t.namespaceURI===le?i==="svg"&&(c==="annotation-xml"||fe[c]):!!Qe[i]:e.namespaceURI===le?t.namespaceURI===N?i==="math":t.namespaceURI===ce?i==="math"&&ue[c]:!!et[i]:e.namespaceURI===N?t.namespaceURI===ce&&!ue[c]||t.namespaceURI===le&&!fe[c]?!1:!et[i]&&(Bt[i]||!Qe[i]):!!($==="application/xhtml+xml"&&Ie[e.namespaceURI]):!1},D=function(e){K(n.removed,{element:e});try{ie(e).removeChild(e)}catch{Mt(e)}},W=function(e,t){try{K(n.removed,{attribute:t.getAttributeNode(e),from:t})}catch{K(n.removed,{attribute:null,from:t})}if(t.removeAttribute(e),e==="is")if(v||ae)try{D(t)}catch{}else try{t.setAttribute(e,"")}catch{}},tt=function(e){let t=null,i=null;if(ye)e="<remove></remove>"+e;else{const u=mt(e,/^[\r\n\t ]+/);i=u&&u[0]}$==="application/xhtml+xml"&&F===N&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");const c=g?g.createHTML(e):e;if(F===N)try{t=new Dt().parseFromString(c,$)}catch{}if(!t||!t.documentElement){t=_e.createDocument(F,"template",null);try{t.documentElement.innerHTML=be?X:c}catch{}}const _=t.body||t.documentElement;return e&&i&&_.insertBefore(s.createTextNode(i),_.childNodes[0]||null),F===N?kt.call(t,P?"html":"body")[0]:P?t.documentElement:_},nt=function(e){return xt.call(e.ownerDocument||e,e,B.SHOW_ELEMENT|B.SHOW_COMMENT|B.SHOW_TEXT|B.SHOW_PROCESSING_INSTRUCTION|B.SHOW_CDATA_SECTION,null)},Ne=function(e){return e instanceof It&&(typeof e.nodeName!="string"||typeof e.textContent!="string"||typeof e.removeChild!="function"||!(e.attributes instanceof bt)||typeof e.removeAttribute!="function"||typeof e.setAttribute!="function"||typeof e.namespaceURI!="string"||typeof e.insertBefore!="function"||typeof e.hasChildNodes!="function")},ot=function(e){return typeof G=="function"&&e instanceof G};function M(r,e,t){me(r,i=>{i.call(n,e,t,z)})}const it=function(e){let t=null;if(M(h.beforeSanitizeElements,e,null),Ne(e))return D(e),!0;const i=p(e.nodeName);if(M(h.uponSanitizeElement,e,{tagName:i,allowedTags:m}),re&&e.hasChildNodes()&&!ot(e.firstElementChild)&&S(/<[/\w!]/g,e.innerHTML)&&S(/<[/\w!]/g,e.textContent)||e.nodeType===ee.progressingInstruction||re&&e.nodeType===ee.comment&&S(/<[/\w]/g,e.data))return D(e),!0;if(!m[i]||j[i]){if(!j[i]&&at(i)&&(f.tagNameCheck instanceof RegExp&&S(f.tagNameCheck,i)||f.tagNameCheck instanceof Function&&f.tagNameCheck(i)))return!1;if(Le&&!H[i]){const c=ie(e)||e.parentNode,_=wt(e)||e.childNodes;if(_&&c){const u=_.length;for(let L=u-1;L>=0;--L){const C=Nt(_[L],!0);C.__removalCount=(e.__removalCount||0)+1,c.insertBefore(C,Ct(e))}}}return D(e),!0}return e instanceof ne&&!Vt(e)||(i==="noscript"||i==="noembed"||i==="noframes")&&S(/<\/no(script|embed|frames)/i,e.innerHTML)?(D(e),!0):(k&&e.nodeType===ee.text&&(t=e.textContent,me([Ee,Ae,ge],c=>{t=Z(t,c," ")}),e.textContent!==t&&(K(n.removed,{element:e.cloneNode()}),e.textContent=t)),M(h.afterSanitizeElements,e,null),!1)},rt=function(e,t,i){if(je&&(t==="id"||t==="name")&&(i in s||i in jt))return!1;if(!(Se&&!he[t]&&S(Ut,t))){if(!(Be&&S(Ht,t))){if(!T[t]||he[t]){if(!(at(e)&&(f.tagNameCheck instanceof RegExp&&S(f.tagNameCheck,e)||f.tagNameCheck instanceof Function&&f.tagNameCheck(e))&&(f.attributeNameCheck instanceof RegExp&&S(f.attributeNameCheck,t)||f.attributeNameCheck instanceof Function&&f.attributeNameCheck(t))||t==="is"&&f.allowCustomizedBuiltInElements&&(f.tagNameCheck instanceof RegExp&&S(f.tagNameCheck,i)||f.tagNameCheck instanceof Function&&f.tagNameCheck(i))))return!1}else if(!Oe[t]){if(!S(ze,Z(i,Fe,""))){if(!((t==="src"||t==="xlink:href"||t==="href")&&e!=="script"&&tn(i,"data:")===0&&qe[e])){if(!(Ye&&!S(Ft,Z(i,Fe,"")))){if(i)return!1}}}}}}return!0},at=function(e){return e!=="annotation-xml"&&mt(e,zt)},st=function(e){M(h.beforeSanitizeAttributes,e,null);const{attributes:t}=e;if(!t||Ne(e))return;const i={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:T,forceKeepAttr:void 0};let c=t.length;for(;c--;){const _=t[c],{name:u,namespaceURI:L,value:C}=_,q=p(u),Me=C;let E=u==="value"?Me:nn(Me);if(i.attrName=q,i.attrValue=E,i.keepAttr=!0,i.forceKeepAttr=void 0,M(h.uponSanitizeAttribute,e,i),E=i.attrValue,Ve&&(q==="id"||q==="name")&&(W(u,e),E=Wt+E),re&&S(/((--!?|])>)|<\/(style|title)/i,E)){W(u,e);continue}if(i.forceKeepAttr)continue;if(!i.keepAttr){W(u,e);continue}if(!Xe&&S(/\/>/i,E)){W(u,e);continue}k&&me([Ee,Ae,ge],ct=>{E=Z(E,ct," ")});const lt=p(e.nodeName);if(!rt(lt,q,E)){W(u,e);continue}if(g&&typeof oe=="object"&&typeof oe.getAttributeType=="function"&&!L)switch(oe.getAttributeType(lt,q)){case"TrustedHTML":{E=g.createHTML(E);break}case"TrustedScriptURL":{E=g.createScriptURL(E);break}}if(E!==Me)try{L?e.setAttributeNS(L,u,E):e.setAttribute(u,E),Ne(e)?D(e):ut(n.removed)}catch{W(u,e)}}M(h.afterSanitizeAttributes,e,null)},$t=function r(e){let t=null;const i=nt(e);for(M(h.beforeSanitizeShadowDOM,e,null);t=i.nextNode();)M(h.uponSanitizeShadowNode,t,null),it(t),st(t),t.content instanceof A&&r(t.content);M(h.afterSanitizeShadowDOM,e,null)};return n.sanitize=function(r){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=null,i=null,c=null,_=null;if(be=!r,be&&(r="<!-->"),typeof r!="string"&&!ot(r))if(typeof r.toString=="function"){if(r=r.toString(),typeof r!="string")throw J("dirty is not a string, aborting")}else throw J("toString is not a function");if(!n.isSupported)return r;if(Re||De(e),n.removed=[],typeof r=="string"&&(V=!1),V){if(r.nodeName){const C=p(r.nodeName);if(!m[C]||j[C])throw J("root node is forbidden and cannot be sanitized in-place")}}else if(r instanceof G)t=tt("<!---->"),i=t.ownerDocument.importNode(r,!0),i.nodeType===ee.element&&i.nodeName==="BODY"||i.nodeName==="HTML"?t=i:t.appendChild(i);else{if(!v&&!k&&!P&&r.indexOf("<")===-1)return g&&se?g.createHTML(r):r;if(t=tt(r),!t)return v?null:se?X:""}t&&ye&&D(t.firstChild);const u=nt(V?r:t);for(;c=u.nextNode();)it(c),st(c),c.content instanceof A&&$t(c.content);if(V)return r;if(v){if(ae)for(_=Pt.call(t.ownerDocument);t.firstChild;)_.appendChild(t.firstChild);else _=t;return(T.shadowroot||T.shadowrootmode)&&(_=vt.call(a,_,!0)),_}let L=P?t.outerHTML:t.innerHTML;return P&&m["!doctype"]&&t.ownerDocument&&t.ownerDocument.doctype&&t.ownerDocument.doctype.name&&S(Rt,t.ownerDocument.doctype.name)&&(L="<!DOCTYPE "+t.ownerDocument.doctype.name+`>
|
|
2
|
+
`+L),k&&me([Ee,Ae,ge],C=>{L=Z(L,C," ")}),g&&se?g.createHTML(L):L},n.setConfig=function(){let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};De(r),Re=!0},n.clearConfig=function(){z=null,Re=!1},n.isValidAttribute=function(r,e,t){z||De({});const i=p(r),c=p(e);return rt(i,c,t)},n.addHook=function(r,e){typeof e=="function"&&K(h[r],e)},n.removeHook=function(r,e){if(e!==void 0){const t=Qt(h[r],e);return t===-1?void 0:en(h[r],t,1)[0]}return ut(h[r])},n.removeHooks=function(r){h[r]=[]},n.removeAllHooks=function(){h=At()},n}var Te=yt();const He="data-temp-href-target";Te.addHook("beforeSanitizeAttributes",function(o){o instanceof HTMLElement&&o.hasAttribute("target")&&o.getAttribute("target")==="_blank"&&o.setAttribute(He,"_blank")});Te.addHook("afterSanitizeAttributes",function(o){o instanceof HTMLElement&&o.hasAttribute(He)&&(o.setAttribute("target","_blank"),o.setAttribute("rel","noopener noreferrer"),o.removeAttribute(He))});const Lt={USE_PROFILES:{html:!0},FORCE_BODY:!0},An=qt("div",{target:"e1o5kn6k0"})(({theme:o})=>({width:"100%","ul, ol, dl":{paddingLeft:o.spacing.threeXL}})),Ot=x.forwardRef(function(n,s){return te(An,{className:"stHtml","data-testid":"stHtml",ref:s,...n})}),gn={...Lt,ADD_TAGS:["script","style"],ADD_ATTR:["src","type","async","defer","nonce","crossorigin","referrerpolicy","integrity"]};function hn(o){return Te.sanitize(o,gn)}const Sn=({body:o})=>{const n=x.useRef(null),s=x.useMemo(()=>hn(o),[o]);return x.useEffect(()=>{const a=n.current;return a?(a.innerHTML=s,Array.from(a.querySelectorAll("script")).forEach(A=>{const I=document.createElement("script");for(const{name:G,value:ne}of Array.from(A.attributes))try{I.setAttribute(G,ne)}catch{}A.src||(I.textContent=A.textContent),A.parentNode?.replaceChild(I,A)}),()=>{a.innerHTML=""}):void 0},[s]),te(Ot,{ref:n})},Rn=x.memo(Sn);function yn(o){return Te.sanitize(o,Lt)}function Ln({body:o}){const n=x.useMemo(()=>yn(o),[o]);return n?te(Ot,{dangerouslySetInnerHTML:{__html:n}}):null}const On=x.memo(Ln);function bn({element:o}){const{body:n,unsafeAllowJavascript:s}=o;return s?te(Rn,{body:n}):te(On,{body:n})}const Dn=x.memo(bn);export{Dn as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as W,aA as O,z as _,r as i,k as $,l as q,a9 as S,aa as G,o as M,j as c,ab as N,ac as J,ae as Q}from"./index.
|
|
1
|
+
import{p as W,aA as O,z as _,r as i,k as $,l as q,a9 as S,aa as G,o as M,j as c,ab as N,ac as J,ae as Q}from"./index.aCorc3Yt.js";import{I as X}from"./InputInstructions.DbssY6d4.js";import{u as Y}from"./useBasicWidgetState.Bg0ZMUt5.js";import{u as Z,a as tt,b as et}from"./useUpdateUiValue.Df1h6fXC.js";import{u as ot,T as at}from"./useTextInputAutoExpand.DDBezxks.js";import{u as it}from"./uniqueId.DcCWa2cf.js";import"./FormClearHelper.DN8D_YXO.js";import"./inputUtils.CptNuJwn.js";import"./base-input.Cs-E6S71.js";const st=(e,t)=>{let a="auto";if(e.heightConfig?.useStretch)a="100%";else if(e.heightConfig?.pixelHeight&&e.heightConfig.pixelHeight>0){const s=W(t.labelVisibility?.value)===O.Collapsed?2:30,l=e.heightConfig.pixelHeight-s;a=`${Math.max(0,l)}px`}return a},rt=_("div",{target:"e1tmb1p40"})({height:"100%",display:"flex",flexDirection:"column"}),T=(e,t)=>e.getStringValue(t)??t.default??null,lt=e=>e.default??null,nt=e=>e.value??null,ut=(e,t,a,s)=>{t.setStringValue(e,a.value,{fromUi:a.fromUi},s)},dt=({disabled:e,element:t,widgetMgr:a,fragmentId:s,outerElement:l})=>{const h=i.useRef(it("text_area_")).current,{width:y,elementRef:V}=$(),[r,g]=i.useState(!1),[I,x]=i.useState(!1),n=l.heightConfig?.useContent??!1,v=l.heightConfig?.useStretch??!1,A=st(l,t),C=i.useRef(null),[u,p]=i.useState(()=>T(a,t)??null),F=i.useCallback(()=>{p(t.default??null),g(!0)},[t]),[R,f]=Y({getStateFromWidgetMgr:T,getDefaultStateFromProto:lt,getCurrStateFromProto:nt,updateWidgetMgrState:ut,element:t,widgetMgr:a,fragmentId:s,onFormCleared:F});Z(R,u,p,r);const o=q(),{height:k,maxHeight:z,updateScrollHeight:H}=ot({textareaRef:C,dependencies:[t.placeholder]}),m=i.useCallback(()=>{g(!1),f({value:u,fromUi:!0})},[u,f]),L=i.useCallback(()=>{r&&m(),x(!1)},[r,m]),B=i.useCallback(()=>{x(!0)},[]),D=i.useCallback(()=>{n&&H()},[n,H]),E=tt({formId:t.formId,maxChars:t.maxChars,setDirty:g,setUiValue:p,setValueWithSource:f,additionalAction:D}),U=et(t.formId,m,r,a,s,!0),{placeholder:P,formId:b}=t,j=S({formId:b})?a.allowFormEnterToSubmit(b):r,w=I&&y>G(o.breakpoints.hideWidgetDetails);return M(rt,{className:"stTextArea","data-testid":"stTextArea",ref:V,children:[c(J,{label:t.label,disabled:e,labelVisibility:W(t.labelVisibility?.value),htmlFor:h,children:t.help&&c(N,{content:t.help,label:t.label})}),c(at,{inputRef:n?C:void 0,value:u??"",placeholder:P,onBlur:L,onFocus:B,onChange:E,onKeyDown:U,"aria-label":t.label,disabled:e,id:h,overrides:{Input:{style:{fontWeight:o.fontWeights.normal,lineHeight:o.lineHeights.inputWidget,height:n?k:A,maxHeight:n?z:"",minHeight:o.sizes.largestElementHeight,resize:v?"none":"vertical",paddingRight:o.spacing.md,paddingLeft:o.spacing.md,paddingBottom:o.spacing.md,paddingTop:o.spacing.md,"::placeholder":{color:o.colors.fadedText60}}},Root:{props:{"data-testid":"stTextAreaRootElement"},style:({$isFocused:K})=>{const d=Q(o.colors,K);return{borderLeftWidth:o.sizes.borderWidth,borderRightWidth:o.sizes.borderWidth,borderTopWidth:o.sizes.borderWidth,borderBottomWidth:o.sizes.borderWidth,borderTopColor:d,borderRightColor:d,borderBottomColor:d,borderLeftColor:d,flexGrow:1}}}}}),w&&c(X,{dirty:r,value:u??"",maxLength:t.maxChars,type:"multiline",inForm:S({formId:b}),allowEnterToSubmit:j})]})},Ht=i.memo(dt);export{Ht as default};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{am as _,an as ye,w as O,r as u,l as $e,o as ne,j as M,P as Oe,ac as Re,q as oe,aa as ie,bq as ae,p as _e,e as Se}from"./index.
|
|
1
|
+
import{am as _,an as ye,w as O,r as u,l as $e,o as ne,j as M,P as Oe,ac as Re,q as oe,aa as ie,bq as ae,p as _e,e as Se}from"./index.aCorc3Yt.js";import{W as Pe}from"./WidgetLabelHelpIconInline.6xCU76OE.js";import{u as we}from"./useBasicWidgetState.Bg0ZMUt5.js";import"./FormClearHelper.DN8D_YXO.js";var se={vertical:"vertical",horizontal:"horizontal"};function le(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function D(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?le(Object(n),!0).forEach(function(r){R(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):le(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function R(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var E=0,L=1,T=2;function z(e){return e.$isActive?T:e.$isHovered?L:E}function Me(e){var t=e.$theme.colors,n=e.$disabled,r=e.$checked,o=e.$isFocusVisible,i=e.$error;if(n)return t.tickFillDisabled;if(r)if(i)switch(z(e)){case E:return t.tickFillErrorSelected;case L:return t.tickFillErrorSelectedHover;case T:return t.tickFillErrorSelectedHoverActive}else switch(z(e)){case E:return t.tickFillSelected;case L:return t.tickFillSelectedHover;case T:return t.tickFillSelectedHoverActive}else return o?t.borderSelected:i?t.tickBorderError:t.tickBorder;return null}function ke(e){var t=e.$theme.colors;if(e.$disabled)return t.tickMarkFillDisabled;if(e.$checked)return t.tickMarkFill;if(e.$error)switch(z(e)){case E:return t.tickFillError;case L:return t.tickFillErrorHover;case T:return t.tickFillErrorHoverActive}else switch(z(e)){case E:return t.tickFill;case L:return t.tickFillHover;case T:return t.tickFillActive}}function Fe(e){var t=e.$labelPlacement,n=t===void 0?"":t,r=e.$theme,o;switch(n){case"top":o="Bottom";break;case"bottom":o="Top";break;case"left":o=r.direction==="rtl"?"Left":"Right";break;default:case"right":o=r.direction==="rtl"?"Right":"Left";break}var i=r.sizing,s=i.scale300;return R({},"padding".concat(o),s)}function Ie(e){var t=e.$disabled,n=e.$theme,r=n.colors;return t?r.contentSecondary:r.contentPrimary}var q=_("div",function(e){var t=e.$disabled,n=e.$align;return{display:"flex",flexWrap:"wrap",flexDirection:n==="horizontal"?"row":"column",alignItems:n==="horizontal"?"center":"flex-start",cursor:t?"not-allowed":"pointer","-webkit-tap-highlight-color":"transparent"}});q.displayName="RadioGroupRoot";q.displayName="RadioGroupRoot";var X=_("label",function(e){var t,n=e.$disabled,r=e.$hasDescription,o=e.$labelPlacement,i=e.$theme,s=e.$align,a=i.sizing,c=s==="horizontal",p=i.direction==="rtl"?"Left":"Right";return t={flexDirection:o==="top"||o==="bottom"?"column":"row",display:"flex",alignItems:"center",cursor:n?"not-allowed":"pointer",marginTop:a.scale200},R(t,"margin".concat(p),c?a.scale200:null),R(t,"marginBottom",r&&!c?null:a.scale200),t});X.displayName="Root";X.displayName="Root";var K=_("div",function(e){var t=e.$theme,n=t.animation,r=t.sizing;return{backgroundColor:ke(e),borderTopLeftRadius:"50%",borderTopRightRadius:"50%",borderBottomRightRadius:"50%",borderBottomLeftRadius:"50%",height:e.$checked?r.scale200:r.scale550,transitionDuration:n.timing200,transitionTimingFunction:n.easeOutCurve,width:e.$checked?r.scale200:r.scale550}});K.displayName="RadioMarkInner";K.displayName="RadioMarkInner";var J=_("div",function(e){var t=e.$theme,n=t.animation,r=t.sizing;return{alignItems:"center",backgroundColor:Me(e),borderTopLeftRadius:"50%",borderTopRightRadius:"50%",borderBottomRightRadius:"50%",borderBottomLeftRadius:"50%",boxShadow:e.$isFocusVisible&&e.$checked?"0 0 0 3px ".concat(e.$theme.colors.accent):"none",display:"flex",height:r.scale700,justifyContent:"center",marginTop:r.scale0,marginRight:r.scale0,marginBottom:r.scale0,marginLeft:r.scale0,outline:"none",verticalAlign:"middle",width:r.scale700,flexShrink:0,transitionDuration:n.timing200,transitionTimingFunction:n.easeOutCurve}});J.displayName="RadioMarkOuter";J.displayName="RadioMarkOuter";var Q=_("div",function(e){var t=e.$theme.typography;return D(D({verticalAlign:"middle"},Fe(e)),{},{color:Ie(e)},t.LabelMedium)});Q.displayName="Label";Q.displayName="Label";var Y=_("input",{width:0,height:0,marginTop:0,marginRight:0,marginBottom:0,marginLeft:0,paddingTop:0,paddingRight:0,paddingBottom:0,paddingLeft:0,clip:"rect(0 0 0 0)",position:"absolute"});Y.displayName="Input";Y.displayName="Input";var Z=_("div",function(e){var t,n=e.$theme,r=e.$align,o=r==="horizontal",i=n.direction==="rtl"?"Right":"Left",s=n.direction==="rtl"?"Left":"Right";return D(D({},n.typography.ParagraphSmall),{},(t={color:n.colors.contentSecondary,cursor:"auto"},R(t,"margin".concat(i),r==="horizontal"?null:n.sizing.scale900),R(t,"margin".concat(s),o?n.sizing.scale200:null),R(t,"maxWidth","240px"),t))});Z.displayName="Description";Z.displayName="Description";function N(e){"@babel/helpers - typeof";return N=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},N(e)}function V(){return V=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},V.apply(this,arguments)}function Ee(e,t){return Ae(e)||xe(e,t)||Te(e,t)||Le()}function Le(){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 Te(e,t){if(e){if(typeof e=="string")return ue(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ue(e,t)}}function ue(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function xe(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r=[],o=!0,i=!1,s,a;try{for(n=n.call(e);!(o=(s=n.next()).done)&&(r.push(s.value),!(t&&r.length===t));o=!0);}catch(c){i=!0,a=c}finally{try{!o&&n.return!=null&&n.return()}finally{if(i)throw a}}return r}}function Ae(e){if(Array.isArray(e))return e}function je(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function De(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function ze(e,t,n){return t&&De(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Be(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)}function U(e,t){return U=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,o){return r.__proto__=o,r},U(e,t)}function Ce(e){var t=Ne();return function(){var r=B(e),o;if(t){var i=B(this).constructor;o=Reflect.construct(r,arguments,i)}else o=r.apply(this,arguments);return He(this,o)}}function He(e,t){if(t&&(N(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return A(e)}function A(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ne(){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(e){return B=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},B(e)}function j(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var pe=(function(e){Be(n,e);var t=Ce(n);function n(){var r;je(this,n);for(var o=arguments.length,i=new Array(o),s=0;s<o;s++)i[s]=arguments[s];return r=t.call.apply(t,[this].concat(i)),j(A(r),"state",{isFocusVisible:!1,focusedRadioIndex:-1}),j(A(r),"handleFocus",function(a,c){ye(a)&&r.setState({isFocusVisible:!0}),r.setState({focusedRadioIndex:c}),r.props.onFocus&&r.props.onFocus(a)}),j(A(r),"handleBlur",function(a,c){r.state.isFocusVisible!==!1&&r.setState({isFocusVisible:!1}),r.setState({focusedRadioIndex:-1}),r.props.onBlur&&r.props.onBlur(a)}),r}return ze(n,[{key:"render",value:function(){var o=this,i=this.props.overrides,s=i===void 0?{}:i,a=O(s.RadioGroupRoot,q),c=Ee(a,2),p=c[0],m=c[1];return u.createElement(p,V({id:this.props.id,role:"radiogroup","aria-describedby":this.props["aria-describedby"],"aria-errormessage":this.props["aria-errormessage"],"aria-invalid":this.props.error||null,"aria-label":this.props["aria-label"],"aria-labelledby":this.props["aria-labelledby"],$align:this.props.align,$disabled:this.props.disabled,$error:this.props.error,$required:this.props.required},m),u.Children.map(this.props.children,function(f,l){if(!u.isValidElement(f))return null;var d=o.props.value===f.props.value;return u.cloneElement(f,{align:o.props.align,autoFocus:o.props.autoFocus,checked:d,disabled:o.props.disabled||f.props.disabled,error:o.props.error,isFocused:o.state.focusedRadioIndex===l,isFocusVisible:o.state.isFocusVisible,tabIndex:l===0&&!o.props.value||d?"0":"-1",labelPlacement:o.props.labelPlacement,name:o.props.name,onBlur:function(g){return o.handleBlur(g,l)},onFocus:function(g){return o.handleFocus(g,l)},onChange:o.props.onChange,onMouseEnter:o.props.onMouseEnter,onMouseLeave:o.props.onMouseLeave})}))}}]),n})(u.Component);j(pe,"defaultProps",{name:"",value:"",disabled:!1,autoFocus:!1,labelPlacement:"right",align:"vertical",error:!1,required:!1,onChange:function(){},onMouseEnter:function(){},onMouseLeave:function(){},onFocus:function(){},onBlur:function(){},overrides:{}});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 $(){return $=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},$.apply(this,arguments)}function w(e,t){return We(e)||Ge(e,t)||Ue(e,t)||Ve()}function Ve(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
3
3
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ue(e,t){if(e){if(typeof e=="string")return ce(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ce(e,t)}}function ce(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Ge(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r=[],o=!0,i=!1,s,a;try{for(n=n.call(e);!(o=(s=n.next()).done)&&(r.push(s.value),!(t&&r.length===t));o=!0);}catch(c){i=!0,a=c}finally{try{!o&&n.return!=null&&n.return()}finally{if(i)throw a}}return r}}function We(e){if(Array.isArray(e))return e}function qe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Xe(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Ke(e,t,n){return t&&Xe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Je(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&&W(e,t)}function W(e,t){return W=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,o){return r.__proto__=o,r},W(e,t)}function Qe(e){var t=Ze();return function(){var r=C(e),o;if(t){var i=C(this).constructor;o=Reflect.construct(r,arguments,i)}else o=r.apply(this,arguments);return Ye(this,o)}}function Ye(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 k(e)}function k(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ze(){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 C(e){return C=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},C(e)}function F(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function et(e){return e==="top"||e==="left"}function tt(e){return e==="bottom"||e==="right"}var rt=function(t){return t.stopPropagation()},fe=(function(e){Je(n,e);var t=Qe(n);function n(){var r;qe(this,n);for(var o=arguments.length,i=new Array(o),s=0;s<o;s++)i[s]=arguments[s];return r=t.call.apply(t,[this].concat(i)),F(k(r),"state",{isActive:!1,isHovered:!1}),F(k(r),"onMouseEnter",function(a){r.setState({isHovered:!0}),r.props.onMouseEnter&&r.props.onMouseEnter(a)}),F(k(r),"onMouseLeave",function(a){r.setState({isHovered:!1}),r.props.onMouseLeave&&r.props.onMouseLeave(a)}),F(k(r),"onMouseDown",function(a){r.setState({isActive:!0}),r.props.onMouseDown&&r.props.onMouseDown(a)}),F(k(r),"onMouseUp",function(a){r.setState({isActive:!1}),r.props.onMouseUp&&r.props.onMouseUp(a)}),r}return Ke(n,[{key:"componentDidMount",value:function(){var o;this.props.autoFocus&&(o=this.props.inputRef)!==null&&o!==void 0&&o.current&&this.props.inputRef.current.focus()}},{key:"render",value:function(){var o=this.props.overrides,i=o===void 0?{}:o,s=O(i.Root,X),a=w(s,2),c=a[0],p=a[1],m=O(i.Label,Q),f=w(m,2),l=f[0],d=f[1],h=O(i.Input,Y),g=w(h,2),S=g[0],H=g[1],x=O(i.Description,Z),I=w(x,2),v=I[0],b=I[1],y=O(i.RadioMarkInner,K),ee=w(y,2),de=ee[0],he=ee[1],ge=O(i.RadioMarkOuter,J),te=w(ge,2),be=te[0],me=te[1],P={$align:this.props.align,$checked:this.props.checked,$disabled:this.props.disabled,$hasDescription:!!this.props.description,$isActive:this.state.isActive,$error:this.props.error,$isFocused:this.props.isFocused,$isFocusVisible:this.props.isFocused&&this.props.isFocusVisible,$isHovered:this.state.isHovered,$labelPlacement:this.props.labelPlacement,$required:this.props.required,$value:this.props.value},re=u.createElement(l,$({},P,d),this.props.containsInteractiveElement?u.createElement("div",{onClick:function(ve){return ve.preventDefault()}},this.props.children):this.props.children);return u.createElement(u.Fragment,null,u.createElement(c,$({"data-baseweb":"radio",onMouseEnter:this.onMouseEnter,onMouseLeave:this.onMouseLeave,onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp},P,p),et(this.props.labelPlacement)&&re,u.createElement(be,$({},P,me),u.createElement(de,$({},P,he))),u.createElement(S,$({"aria-invalid":this.props.error||null,checked:this.props.checked,disabled:this.props.disabled,name:this.props.name,onBlur:this.props.onBlur,onFocus:this.props.onFocus,onClick:rt,onChange:this.props.onChange,ref:this.props.inputRef,required:this.props.required,tabIndex:this.props.tabIndex,type:"radio",value:this.props.value},P,H)),tt(this.props.labelPlacement)&&re),!!this.props.description&&u.createElement(v,$({},P,b),this.props.description))}}]),n})(u.Component);F(fe,"defaultProps",{overrides:{},containsInteractiveElement:!1,checked:!1,disabled:!1,autoFocus:!1,inputRef:u.createRef(),align:"vertical",error:!1,onChange:function(){},onMouseEnter:function(){},onMouseLeave:function(){},onMouseDown:function(){},onMouseUp:function(){},onFocus:function(){},onBlur:function(){}});function nt(e){const t=parseFloat(e.sizes.checkbox),n=parseFloat(e.spacing.threeXS),r=ie(t.toString()),o=Math.round(r*.375);let i=Math.round(ie((t-n).toString()));return i>=r&&(i-=1),[ae(o,"px"),ae(i,"px")]}function ot({disabled:e,horizontal:t,value:n,onChange:r,options:o,captions:i,label:s,labelVisibility:a,help:c}){const[p,m]=u.useState(n??null);u.useEffect(()=>{n!==p&&m(n??null)},[n]);const f=u.useCallback(v=>{const b=parseInt(v.target.value,10);m(b),r(b)},[r]),l=$e(),d=i.length>0,h=o.length>0,g=h?o:["No options to select."],S=e||!h,H=v=>v==""&&t&&d?" ":v,[x,I]=nt(l);return ne("div",{className:"stRadio","data-testid":"stRadio",children:[M(Re,{label:s,disabled:S,labelVisibility:a,children:c&&M(Pe,{content:c,placement:Oe.TOP_RIGHT,label:s})}),M(pe,{onChange:f,value:p!==null?p.toString():void 0,disabled:S,align:t?se.horizontal:se.vertical,"aria-label":s,"data-testid":"stRadioGroup",overrides:{RadioGroupRoot:{style:{gap:d?l.spacing.sm:l.spacing.none,minHeight:l.sizes.minElementHeight}}},children:g.map((v,b)=>ne(fe,{value:b.toString(),overrides:{Root:{style:({$isFocusVisible:y})=>({marginBottom:l.spacing.none,marginTop:l.spacing.none,marginRight:d?l.spacing.sm:l.spacing.lg,paddingLeft:l.spacing.none,alignItems:"start",paddingRight:l.spacing.threeXS,backgroundColor:y?l.colors.darkenedBgMix25:""})},RadioMarkOuter:{style:({$checked:y})=>({width:l.sizes.checkbox,height:l.sizes.checkbox,marginTop:"0.35rem",marginRight:l.spacing.none,marginLeft:l.spacing.none,backgroundColor:y&&!S?l.colors.primary:l.colors.borderColor})},RadioMarkInner:{style:({$checked:y})=>({height:y?x:I,width:y?x:I})},Label:{style:{color:S?l.colors.fadedText40:l.colors.bodyText,position:"relative",top:l.spacing.px}}},children:[M(oe,{source:v,allowHTML:!1,isLabel:!0,largerLabel:!0}),d&&M(oe,{source:H(i[b]),allowHTML:!1,isCaption:!0,isLabel:!0})]},b))})]})}const it=u.memo(ot);function at({disabled:e,element:t,widgetMgr:n,fragmentId:r}){const[o,i]=we({getStateFromWidgetMgr:st,getDefaultStateFromProto:lt,getCurrStateFromProto:ut,updateWidgetMgrState:ct,element:t,widgetMgr:n,fragmentId:r}),{horizontal:s,options:a,captions:c,label:p,labelVisibility:m,help:f}=t,l=u.useCallback(h=>{const g=a[h]??null;i({value:g,fromUi:!0})},[i,a]),d=u.useMemo(()=>{if(o===null)return null;const h=a.indexOf(o);return h>=0?h:null},[o,a]);return M(it,{label:p,onChange:l,options:a,captions:c,disabled:e,horizontal:s,labelVisibility:_e(m?.value),value:d,help:f})}function st(e,t){return e.getStringValue(t)}function lt(e){return e.options.length===0||Se(e.default)?null:e.options[e.default]}function ut(e){return e.rawValue??null}function ct(e,t,n,r){t.setStringValue(e,n.value,{fromUi:n.fromUi},r)}const bt=u.memo(at);export{bt as default};
|